method
FieldAuthoringHost.createSchemaPayload
Create a new embedded item's field payload with Go-declared defaults and a fresh identity.
Example
import type { FieldAuthoringHost } from '@riducms/plugin';
function insertCallout(
authoring: FieldAuthoringHost,
insert: (fields: Record<string, unknown>) => void
) {
const fields = authoring.createSchemaPayload?.({
treeKey: 'blocks',
caseTag: 'block',
variantSlug: 'callout'
});
if (fields) insert(fields);
}Arguments
| Argument | Type | Description |
|---|---|---|
scope | EmbeddedSchemaVariantScope | Select the declared tree, case tag, and variant to insert. |
Returns
New ordinary field data, including a fresh identity and configured defaults. Insert and serialize it through your plugin editor.
Record<string, unknown>How it works
This method only creates data. It does not insert an outer plugin item, change the parent form, or open an Apply/Cancel draft. Check that the optional method exists before calling it.
Full signature
FieldAuthoringHost.createSchemaPayload(
scope: EmbeddedSchemaVariantScope,
): Record<string, unknown>Related types
EmbeddedSchemaVariantScopeSelect a Go-declared embedded variant when creating or copying an item's field data.