Home > @uniformdev/mesh-sdk > EditorStateApi
EditorStateApi interface
Imperative API for interacting with the composition/entry editor state. Available on canvasEditorTools and paramType locations.
All methods use object parameters for consistency across client, wire format, and server.
Signature:
Methods
| Method | Description |
|---|---|
| deleteNode(params) | |
| disableLocale(params) | |
| enableLocale(params) | |
| exportMetadata() | |
| exportRootNodeMetadata() | |
| exportSubtree(params) | |
| exportTree(params) | |
| getNodeById(params) | |
| getNodeChildren(params) | |
| getNodeProperties(params) | |
| getNodeProperty(params) | |
| getParentInfo(params) | |
| getPristine() | |
| getRootNodeId() | |
| getSelectedNodeId() | |
| getSelectedParameterId() | |
| insertNode(params) | |
| insertPattern(params) | |
| isPatternPropertyOverridden(params) | |
| moveNode(params) | |
| resetPatternPropertyOverride(params) | |
| setCurrentLocale(params) | Sets the currently active locale in the editor UI |
| setDynamicInputPreviewValue(params) | Sets the current preview value for a dynamic input. |
| setPropertyLocalizability(params) | <p>(BETA) Toggles a parameter between "shared" (single invariant value) and "localized" (per-locale values) — the same operation as the dashboard "Use locale-specific values" switch on the parameter's locale drawer.</p><p>- <code>isLocalized: true</code> copies the current invariant value (and its conditions) into each locale enabled on the composition. - <code>isLocalized: false</code> copies the value from <code>copyFromLocale</code> (or the first defined locale, if omitted) back into the invariant slot and drops the per-locale values.</p><p>The migration handles pattern parameter overrides, <code>contentReference</code> data resource forking, and the per-node localizability metadata, so the resulting state matches what the dashboard UI would produce for the same toggle. The whole migration is one editor mutation, which keeps it as a single undo step for the user.</p><p>The caller must supply <code>propertyDefinition</code> — the component-definition parameter for <code>(nodeId, property)</code>. This is required so the bridge can enforce localizability business rules (e.g. refusing to localize a parameter whose definition forbids it) and resolve the parameter type for value fan-out. Resolve it from the Uniform public API using your service account API key (or, in the future, identity delegation) and cache it client-side as needed.</p><p>No-ops if the parameter is already in the requested state; if the parameter does not exist on the node; if (when localizing) no locales are enabled; or if (when localizing) the supplied <code>propertyDefinition.localizable</code> is <code>false</code>.</p><p>This is beta functionality. It is intentionally exposed as <code>@deprecated</code> so consumers do not depend on it from production integrations — the signature and behaviour may change without notice.</p> |
| setSelectedNodeId(params) | |
| setSelectedParameterId(params) | |
| updateNodeProperty(params) | |
| updateRootMetadata(params) | |
| updateRootNode(params) |