Line

You are reading docs for v0.8. See latest (v0.9)

ui/client/features/pages-editor/services/SnippetFlowApi

Cockpit client (features), v0.8. Source: ui/client/features/pages-editor/services/SnippetFlowApi.tsx.

Functions#

parseSnippetTree()#

parseSnippetTree(snippet): Promise<{ error: string | null; roots: PagesEditorNode[]; }>

Defined in: ui/client/features/pages-editor/services/SnippetFlowApi.tsx:14

Ticket F.1 — the visual composer's live graph, a fresh parse of the text currently in the editor every time (never a cached layout).

Parameters#

snippet

string

Returns#

Promise<{ error: string | null; roots: PagesEditorNode[]; }>


rewireSnippetWire()#

rewireSnippetWire(body): Promise<{ error?: string; ok: boolean; snippet?: string; }>

Defined in: ui/client/features/pages-editor/services/SnippetFlowApi.tsx:21

Ticket F.2 — the visual composer's wire-rewrite: moves an existing prop from one child to a sibling, returning the rewritten snippet text (or a rejection reason) for the caller to hand to the existing save-back-to-source + diff-preview flow itself.

Parameters#

body
fromChildId

string

parentId

string

propName

string

snippet

string

toChildId

string

Returns#

Promise<{ error?: string; ok: boolean; snippet?: string; }>