interface

PluginFieldBinding

Read and update one field in the unsaved form, including validation messages and live feedback.

Properties and methods

PropertyTypeDescription
schemaSchemaField & { type: Type; }A copy of the field's resolved settings, including its current path, label and rules. schema.admin.readOnly reflects field configuration and access, not a pending document save.
valueValue | Input | null | undefinedThe latest value in the form, including unsaved edits. Objects and arrays are copied: modifying this result does not update the form. Call set to change it. null and undefined mean the field is empty or absent. Other values pass through decodeValue, or through decodeInput if the output decoder rejects a pending edit. Reading throws if neither decoder accepts the value.
rawValueunknownA copy of the current value before decoding. Use this to display or recover older data your decoder rejects; validate it before treating it as Value.
issuesreadonly ValidationIssue[]Current form and server validation issues for this field and its children.
liveValidationFieldLiveValidationRead the check’s status or call retry() after a failure. Ridu runs the requests; messages appear alongside other validation issues in field.issues.
readOnlybooleanWhether changes are currently blocked, for example by access rules, a save in progress, or a stale binding. Bindings from form.bind also respect the source editor's read-only state. set checks this again when called.
stalebooleanWhether this connection has expired. Once true, it cannot become usable again.
set(value: Input | null) => voidReplace the value in the unsaved form. Use null to clear it; undefined is rejected. Ridu copies and decodes the supplied value, checks editability, and updates its normal form state. This does not send a save request to the server. Throws if the binding is stale, the field is read-only, the decoder rejects the value, or a structured edit changes a protected child field. Server validation still runs when the document is saved.

How it works

Ridu creates and cleans up this field connection. For arrays and blocks, it follows the row’s stable _key through reorder. Removing the field or replacing the form makes the connection stale; use the binding supplied to the newly mounted editor.

Full signature

interface PluginFieldBinding<Value, Type extends FieldType = FieldType, Input = Value> { ... }

Source packages/plugin/src/index.ts:12

Methods

  • PluginFieldBinding.set()

    Replace the value in the unsaved form. Use null to clear it; undefined is rejected. Ridu copies and decodes the supplied value, checks editability, and updates its normal form state. This does not send a save request to the server.

Related guides