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

PropertyTypeDescription
idstringUnique ID for this temporary editing session.
identitystringStable ID of the item being edited, or the proposed ID for a new item.
dirtybooleanWhether edits await Apply/Cancel. A proposed new item counts as dirty even before typing.
stalebooleanWhether 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.
issuesreadonly ValidationIssue[]Current validation issues shown in this draft.
payload() => Record<string, unknown>Copy the draft's current field values; throws if it has expired or editing is blocked.
validate() => booleanCheck 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() => voidRelease this draft and abandon its pending edits. Safe to call more than once.

Full signature

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.