@dremchee/uframe / CreateUframeEditorOptions
Interface: CreateUframeEditorOptions
Defined in: embed/client.ts:10
Properties
activePageId?
optional activePageId?: string;Defined in: embed/client.ts:23
Which page is active on load (defaults to the first).
dataContext?
optional dataContext?: ResolveContext;Defined in: embed/client.ts:49
Sample data to preview bound/repeated blocks; sent after load (also via setDataContext).
document?
optional document?: PageDocument;Defined in: embed/client.ts:16
Initial document; sent on the editor's ready handshake. Single-page mode.
globals?
optional globals?: GlobalSettings | null;Defined in: embed/client.ts:29
Shared context (CSS variables / breakpoints / classes / symbols / page defaults) common to the whole page set; sent on the ready handshake. null/omitted → single-document mode (globals live on each document).
locale?
optional locale?: string;Defined in: embed/client.ts:37
Editor UI locale, defaults to en.
messages?
optional messages?: Partial<Record<string, Record<string, unknown>>>;Defined in: embed/client.ts:39
Host overrides for editor and plugin messages.
onActivePageChange?
optional onActivePageChange?: (pageId) => void;Defined in: embed/client.ts:59
The user switched the active page inside the editor.
Parameters
pageId
string
Returns
void
onChange?
optional onChange?: (document) => void;Defined in: embed/client.ts:54
Content edit of the active page. document.id identifies which page.
Parameters
document
PageDocument
Returns
void
onError?
optional onError?: (message) => void;Defined in: embed/client.ts:68
Parameters
message
string
Returns
void
onGlobalsChange?
optional onGlobalsChange?: (globals) => void;Defined in: embed/client.ts:61
Edit to the shared context — persist it independently of the document(s).
Parameters
globals
GlobalSettings
Returns
void
onPagesChange?
optional onPagesChange?: (pages, activePageId) => void;Defined in: embed/client.ts:57
Structural change to the page set (add / delete / reorder / rename).
Parameters
pages
PageDocument[]
activePageId
string
Returns
void
onReady?
optional onReady?: () => void;Defined in: embed/client.ts:50
Returns
void
onRequestAsset?
optional onRequestAsset?: (request) => void;Defined in: embed/client.ts:67
The editor asks to pick a media asset (image/file). Open the CMS's native media library, then reply via handle.setAsset(requestId, pick) — or setAsset(requestId, null) if the user cancels.
Parameters
request
AssetRequest & object
Returns
void
onSave?
optional onSave?: (document) => void;Defined in: embed/client.ts:55
Parameters
document
PageDocument
Returns
void
onStateChange?
optional onStateChange?: (state) => void;Defined in: embed/client.ts:52
Called when the editor changes a public UI-state field internally.
Parameters
state
Returns
void
pages?
optional pages?: PageDocument[];Defined in: embed/client.ts:21
Initial set of pages. When provided, the editor runs in multi-page mode and renders a page switcher. Each page is a PageDocument (carries id + title).
plugins?
optional plugins?: string[];Defined in: embed/client.ts:45
URLs of plugin dist modules to load into the editor on the ready handshake.
readonly?
optional readonly?: boolean;Defined in: embed/client.ts:30
schema?
optional schema?: NormalizedSchema;Defined in: embed/client.ts:47
Collection schema for the binding picker; sent after load (also via setSchema).
src
src: string;Defined in: embed/client.ts:14
URL of the built embed app (embed-dist/index.html).
state?
optional state?: Partial<UframeEditorState>;Defined in: embed/client.ts:34
Initial public editor UI state; overrides matching legacy options.
styleTokens?
optional styleTokens?: Partial<EditorUiThemeTokens>;Defined in: embed/client.ts:43
Prefix-free overrides, e.g. { accent: '#7c3aed' }.
target
target: HTMLElement;Defined in: embed/client.ts:12
Where to mount: a container (an iframe is created inside) or an existing iframe.
theme?
optional theme?: UframeTheme;Defined in: embed/client.ts:35
toolbarVisible?
optional toolbarVisible?: boolean;Defined in: embed/client.ts:32
Show the editor's built-in toolbar. Defaults to true.
uiTheme?
optional uiTheme?: EditorUiTheme;Defined in: embed/client.ts:41
Semantic light/dark palettes for the editor interface.