interface
EmbeddedSchemaDraft
A temporary Apply/Cancel form for fields inside one plugin item. Its edits stay separate from the document until your Apply handler accepts them. This is not a saved document draft/version and cannot save to the server itself. Ridu tracks pending edits so the outer form can ask the user to Apply or Cancel.
Properties
| Property | Type | Description |
|---|---|---|
id | string | Unique ID for this temporary editing session. |
identity | string | Stable ID of the item being edited, or the proposed ID for a new item. |
dirty | boolean | Whether edits await Apply/Cancel. A proposed new item counts as dirty even before typing. |
stale | boolean | Whether the draft is no longer usable. Removal, changed source data, document/ locale/schema/access changes, discard, or closing the parent editor can expire it. Reopen a draft instead of applying old data. Moving the same item alone is allowed. |
issues | readonly ValidationIssue[] | Current validation issues shown in this draft. |
payload | () => Record< | Copy the draft's current field values; throws if it has expired or editing is blocked. |
validate | () => boolean | Check the draft against its declared field rules and update issues.
Returns whether it passes. Go validators and hooks run later, on document save.
The guarded plugin method throws if the draft has expired or editing is blocked. |
discard | () => void | Release this draft and abandon its pending edits. Safe to call more than once. |
Full signature
interface EmbeddedSchemaDraft { ... }Methods
EmbeddedSchemaDraft.discard()Release this draft and abandon its pending edits. Safe to call more than once.
EmbeddedSchemaDraft.payload()Copy the draft's current field values; throws if it has expired or editing is blocked.
EmbeddedSchemaDraft.validate()Check the draft against its declared field rules and update
issues. Returns whether it passes. Go validators and hooks run later, on document save. The guarded plugin method throws if the draft has expired or editing is blocked.