Line

You are reading the unreleased docs (next). See latest (v0.9)

ui/client/features/page-builder/services/LayoutStore

The builder's only effects: a layout kept in this browser's localStorage (one key per page name), and the exported TSX handed to the clipboard or saved as a file.

Cockpit client (features), next. Source: ui/client/features/page-builder/services/LayoutStore.ts.

Variables#

exportFile#

const exportFile: object

Defined in: ui/client/features/page-builder/services/LayoutStore.ts:26

The TSX to the clipboard (true) or, when the browser refuses, nothing (false). Download is a file of <name>.tsx.

Type Declaration#

copy()

copy(text): Promise<boolean>

Parameters
text

string

Returns

Promise<boolean>

download()

download(fileName, text): void

Parameters
fileName

string

text

string

Returns

void

Functions#

loadLayout()#

loadLayout(name): string | null

Defined in: ui/client/features/page-builder/services/LayoutStore.ts:17

The layout JSON saved under this name, or null when there is none.

Parameters#

name

string

Returns#

string | null


saveLayout()#

saveLayout(name, json): boolean

Defined in: ui/client/features/page-builder/services/LayoutStore.ts:7

Keeps the Craft layout JSON (query.serialize()) under the page's name. Returns false when storage refused it.

Parameters#

name

string

json

string

Returns#

boolean