Skip to content

@dremchee/uframe / CreateUframeEditorOptions

Interface: CreateUframeEditorOptions

Defined in: embed/client.ts:10

Properties

activePageId?

ts
optional activePageId?: string;

Defined in: embed/client.ts:23

Which page is active on load (defaults to the first).


dataContext?

ts
optional dataContext?: ResolveContext;

Defined in: embed/client.ts:49

Sample data to preview bound/repeated blocks; sent after load (also via setDataContext).


document?

ts
optional document?: PageDocument;

Defined in: embed/client.ts:16

Initial document; sent on the editor's ready handshake. Single-page mode.


globals?

ts
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?

ts
optional locale?: string;

Defined in: embed/client.ts:37

Editor UI locale, defaults to en.


messages?

ts
optional messages?: Partial<Record<string, Record<string, unknown>>>;

Defined in: embed/client.ts:39

Host overrides for editor and plugin messages.


onActivePageChange?

ts
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?

ts
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?

ts
optional onError?: (message) => void;

Defined in: embed/client.ts:68

Parameters

message

string

Returns

void


onGlobalsChange?

ts
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?

ts
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?

ts
optional onReady?: () => void;

Defined in: embed/client.ts:50

Returns

void


onRequestAsset?

ts
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?

ts
optional onSave?: (document) => void;

Defined in: embed/client.ts:55

Parameters

document

PageDocument

Returns

void


onStateChange?

ts
optional onStateChange?: (state) => void;

Defined in: embed/client.ts:52

Called when the editor changes a public UI-state field internally.

Parameters

state

UframeEditorState

Returns

void


pages?

ts
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?

ts
optional plugins?: string[];

Defined in: embed/client.ts:45

URLs of plugin dist modules to load into the editor on the ready handshake.


readonly?

ts
optional readonly?: boolean;

Defined in: embed/client.ts:30


schema?

ts
optional schema?: NormalizedSchema;

Defined in: embed/client.ts:47

Collection schema for the binding picker; sent after load (also via setSchema).


src

ts
src: string;

Defined in: embed/client.ts:14

URL of the built embed app (embed-dist/index.html).


state?

ts
optional state?: Partial<UframeEditorState>;

Defined in: embed/client.ts:34

Initial public editor UI state; overrides matching legacy options.


styleTokens?

ts
optional styleTokens?: Partial<EditorUiThemeTokens>;

Defined in: embed/client.ts:43

Prefix-free overrides, e.g. { accent: '#7c3aed' }.


target

ts
target: HTMLElement;

Defined in: embed/client.ts:12

Where to mount: a container (an iframe is created inside) or an existing iframe.


theme?

ts
optional theme?: UframeTheme;

Defined in: embed/client.ts:35


toolbarVisible?

ts
optional toolbarVisible?: boolean;

Defined in: embed/client.ts:32

Show the editor's built-in toolbar. Defaults to true.


uiTheme?

ts
optional uiTheme?: EditorUiTheme;

Defined in: embed/client.ts:41

Semantic light/dark palettes for the editor interface.