efficient-easel 27.1.0 → 27.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/dist/AddSidePanel-DwfZOS5C.d.ts +2002 -0
  2. package/dist/{ScreenDocumentContext-DPW_6gOC.d.ts → ScreenDocumentContext-JQr4hTeP.d.ts} +7 -5
  3. package/dist/blocks/index.d.ts +1 -1
  4. package/dist/{canvas-typing-CD1aeYnk.d.ts → canvas-typing-B33ssbpU.d.ts} +22 -3
  5. package/dist/{chunk-J5VPNHOW.js → chunk-2DFSODES.js} +1 -1
  6. package/dist/{chunk-LAJYMOY3.js → chunk-2ODVRWRM.js} +1 -1
  7. package/dist/{chunk-WL57KM5C.js → chunk-36AWYQLN.js} +6 -6
  8. package/dist/{chunk-QPNNWQ24.js → chunk-4JPAVKV6.js} +1 -1
  9. package/dist/chunk-64NREOML.js +1 -0
  10. package/dist/chunk-7WONGRN3.js +64 -0
  11. package/dist/chunk-AI5IQV4A.js +2 -0
  12. package/dist/chunk-BDYS3UAD.js +5 -0
  13. package/dist/{chunk-RTMDZJNE.js → chunk-DFLPDOZF.js} +1 -1
  14. package/dist/chunk-IHYRYSP2.js +7 -0
  15. package/dist/chunk-JEKFHCKS.js +8 -0
  16. package/dist/{chunk-SEH3Q3EL.js → chunk-JNNBGI6Y.js} +1 -1
  17. package/dist/chunk-KRONK73U.js +1 -0
  18. package/dist/{chunk-L36E2WCO.js → chunk-NMLAW6FI.js} +17 -17
  19. package/dist/chunk-OHHODU7N.js +26 -0
  20. package/dist/{chunk-XESNAMI3.js → chunk-PMDIDRDB.js} +4 -4
  21. package/dist/{chunk-P3HXHLES.js → chunk-TWXA55SR.js} +1 -1
  22. package/dist/copy/index.d.ts +3 -3
  23. package/dist/copy/index.js +29 -29
  24. package/dist/data/index.d.ts +1 -1
  25. package/dist/easel/index.d.ts +10 -2
  26. package/dist/easel/index.js +1 -1
  27. package/dist/fields/index.d.ts +1 -1
  28. package/dist/fields/index.js +1 -1
  29. package/dist/panel/index.d.ts +5 -0
  30. package/dist/panel/index.js +1 -1
  31. package/dist/{phone-order-CRKvsTsz.d.ts → phone-order-BCM_f8A1.d.ts} +7 -1
  32. package/dist/screen/components/AddBlockRow.js +1 -1
  33. package/dist/screen/components/AddSidePanel.d.ts +3 -5
  34. package/dist/screen/components/AddSidePanel.js +1 -1
  35. package/dist/screen/components/NodeContextMenu.d.ts +3 -5
  36. package/dist/screen/components/SaveControls.d.ts +3 -5
  37. package/dist/screen/components/ScreenChrome.js +1 -1
  38. package/dist/screen/components/ScreenDocumentContext.d.ts +2 -2
  39. package/dist/screen/components/ScreenMount.d.ts +3 -5
  40. package/dist/screen/components/ScreenMount.js +1 -1
  41. package/dist/screen/components/ScreenStoreProvider.d.ts +3 -5
  42. package/dist/screen/components/ScreenStoreProvider.js +1 -1
  43. package/dist/screen/components/SectionScreenShell.js +17 -17
  44. package/dist/screen/components/usePartBridge.d.ts +3 -5
  45. package/dist/screen/components/usePartBridge.js +1 -1
  46. package/dist/screen/index.d.ts +3 -5
  47. package/dist/screen/index.js +1 -1
  48. package/dist/screen/lib/admin-bridge.d.ts +1 -1
  49. package/dist/screen/lib/document/add-target-types.d.ts +37 -55
  50. package/dist/screen/lib/document/block-set-host.js +1 -1
  51. package/dist/screen/lib/document/block-size-fields.d.ts +2 -2
  52. package/dist/screen/lib/document/block-size-fields.js +1 -1
  53. package/dist/screen/lib/document/box-fields.d.ts +2 -2
  54. package/dist/screen/lib/document/box-fields.js +1 -1
  55. package/dist/screen/lib/document/button-fields.d.ts +2 -2
  56. package/dist/screen/lib/document/button-fields.js +1 -1
  57. package/dist/screen/lib/document/image-fields.d.ts +2 -2
  58. package/dist/screen/lib/document/image-fields.js +4 -4
  59. package/dist/screen/lib/document/new-child.d.ts +58 -0
  60. package/dist/screen/lib/document/new-child.js +1 -0
  61. package/dist/screen/lib/document/palette-sections.d.ts +3 -5
  62. package/dist/screen/lib/document/section-doc.d.ts +1 -1
  63. package/dist/screen/lib/document/shadow-fields.d.ts +2 -2
  64. package/dist/screen/lib/document/shadow-fields.js +1 -1
  65. package/dist/screen/lib/document/slot-section-spec.d.ts +37 -96
  66. package/dist/screen/lib/document/style-clipboard.d.ts +3 -5
  67. package/dist/screen/lib/document/style-fields.d.ts +2 -2
  68. package/dist/screen/lib/document/style-fields.js +1 -1
  69. package/dist/screen/lib/document/use-section-ops.d.ts +37 -3
  70. package/dist/screen/lib/document/use-section-ops.js +1 -1
  71. package/dist/screen/lib/document-addressing.d.ts +2 -2
  72. package/dist/screen/lib/document-hooks.d.ts +1 -1
  73. package/dist/screen/lib/host.d.ts +2 -2
  74. package/dist/screen/lib/key-scope.js +1 -1
  75. package/dist/screen/lib/media-panel.d.ts +2 -2
  76. package/dist/screen/lib/media-picker.d.ts +2 -2
  77. package/dist/screen/lib/page-lock.d.ts +1 -1
  78. package/dist/screen/lib/screen-parts.d.ts +21 -1828
  79. package/dist/screen/lib/screen-parts.js +1 -1
  80. package/dist/screen/lib/section-templates.d.ts +1 -1
  81. package/dist/screen/lib/session-context.d.ts +1 -1
  82. package/dist/screen/lib/session.d.ts +1 -1
  83. package/dist/screen/lib/shared-sections.d.ts +1 -1
  84. package/dist/text-styles/index.js +11 -11
  85. package/package.json +10 -4
  86. package/dist/chunk-3FANFZ4D.js +0 -1
  87. package/dist/chunk-D4TH4QQR.js +0 -2
  88. package/dist/chunk-DTEYSPJE.js +0 -64
  89. package/dist/chunk-GJ427TZL.js +0 -8
  90. package/dist/chunk-MNQDOSAX.js +0 -7
  91. package/dist/chunk-SDSBXW3V.js +0 -26
  92. package/dist/chunk-TUIBPB77.js +0 -5
@@ -0,0 +1,2002 @@
1
+ import * as react from 'react';
2
+ import { ReactNode, MouseEvent, ComponentType } from 'react';
3
+ import { M as MeasuredCanvas, C as CanvasDragModel, D as DragSession } from './CanvasDragLayer-DXeQGrwJ.js';
4
+ import { SectionTemplate } from './screen/lib/section-template-types.js';
5
+ import { SharedSectionUse, SharedSection } from './screen/lib/shared-section-types.js';
6
+ import { BlockChoice } from './screen/lib/document/block-choice.js';
7
+ import { Data, Config } from './blocks/index.js';
8
+ import { C as CanvasTarget } from './watch-Unf6SfUf.js';
9
+ import { D as DeviceOption } from './types-SrGNzYeO.js';
10
+ import { P as Place } from './types-Dq180WRV.js';
11
+ import { R as RepeatCopy } from './copy-place-CQIemdtU.js';
12
+ import { E as EaselContextMenuItem } from './types-BbOBWXMP.js';
13
+ import { E as EaselRailItem } from './types-Cy7rdmXt.js';
14
+ import { StyleRow } from './style-clipboard/index.js';
15
+ import { f as TreeRowMark } from './types-CoUTWUwB.js';
16
+ import { q as AnyScreenTarget } from './ScreenDocumentContext-JQr4hTeP.js';
17
+ import { HostProduct } from './screen/lib/host-chrome.js';
18
+ import { EaselSession } from './screen/lib/session.js';
19
+ import { SlotConfigView, SlotChild } from './screen/lib/document/content-tree.js';
20
+
21
+ /**
22
+ * A component type's own `defaultProps`, looked up in the old library's config.
23
+ *
24
+ * Handed IN rather than imported: `lib/document/config` imports the seed
25
+ * registry's neighbours, and a seed registry that reached back into the config
26
+ * would close the loop. Both callers of `seeds()` already hold the config
27
+ * (`components/ScreenChrome`, `components/StandaloneSectionEditor`),
28
+ * so the lookup travels the short way.
29
+ *
30
+ * ⚠️ IT IS OPTIONAL, AND THE FIVE SPECS THAT PREDATE IT IGNORE IT. They
31
+ * seed ONE flat child whose every field is content, so a missing default changes
32
+ * nothing they draw. Image & Text Columns seeds a Box holding blocks, and a Box
33
+ * without its `direction` / `justify` / `align` / `wrap` is a different shape on
34
+ * the page — see `boxColumnSeed` in lib/document/slot-specs.
35
+ */
36
+ type NodeDefaults$1 = (type: string) => Record<string, unknown>;
37
+ interface SlotSectionSpec {
38
+ /** The primary slot field on the section (e.g. Hero's `slides`). */
39
+ slot: string;
40
+ /** The child component type the slot holds. */
41
+ childType: string;
42
+ /** The "Add …" affordance label. */
43
+ addLabel: string;
44
+ /**
45
+ * The children ARE the section, and no surface offers to add one.
46
+ *
47
+ * ⚠️ NOT THE SAME THING AS `addBlocked`, AND THE DIFFERENCE IS WHY IT EXISTS.
48
+ * `addBlocked` is a reason adding is impossible RIGHT NOW — a hero anchor
49
+ * already holds four — so the row stays, greyed, with the sentence on it, and
50
+ * the merchant can act on it (re-place a group and Add comes back). A fixed
51
+ * set has no such state: the row would be permanently dead furniture, and
52
+ * `NodeContextMenu`'s own rule says it plainest — a row must never be a button
53
+ * that does nothing.
54
+ *
55
+ * Both surfaces that draw an Add row read this. `addBlocked` is still declared
56
+ * beside it, because the DROP path asks that one and never this.
57
+ */
58
+ fixed?: boolean;
59
+ /** Children render as a HORIZONTAL slider (selection must advance it). */
60
+ slider?: boolean;
61
+ /**
62
+ * What ONE new child of this slot is, when it is more than `childType`'s
63
+ * defaults: a node with its own slot children inline, built with the
64
+ * screen's maker (the config's defaults, the screen's fresh ids) — the
65
+ * contract `ScreenBlockRules.newSectionNode` keeps for a top-level section.
66
+ * Every door that adds `childType` to this slot (the Layers row, the Add
67
+ * panel's press and drop, the settings panel list, the one-section editor's
68
+ * card and list) lays it down with ONE `insertNode`, so one Undo takes it
69
+ * back. A choice of the slot other than `childType` is inserted as before.
70
+ * The ids `make.newNodeId` mints are the contract: the screen does not
71
+ * re-mint them. Absent: the type's defaults, as before.
72
+ */
73
+ newChild?: (make: ScreenNodeMaker) => ScreenNewNode;
74
+ /**
75
+ * What one prepared child is called on the Add panel's tile (a noun, the
76
+ * host's own words: "Scrolling bar"), read only with `newChild`. The tile
77
+ * puts its own "Add" in front, so this is never cut out of `addLabel`, whose
78
+ * words a host may translate. Absent: the tile keeps the type's own word.
79
+ */
80
+ childLabel?: string;
81
+ /**
82
+ * Prop bags for the default children a fresh section is seeded with.
83
+ *
84
+ * `defaultsFor` is {@link NodeDefaults} — present when the caller holds the
85
+ * config, absent otherwise, and every spec that seeds a plain content child
86
+ * simply declines it.
87
+ */
88
+ seeds: (defaultsFor?: NodeDefaults$1) => Record<string, unknown>[];
89
+ /**
90
+ * Convert a section's LEGACY props (an older inline-array field) into slot
91
+ * children at load-time — the chrome-only migration for pages saved before the
92
+ * field became a slot. Returns [] when there's nothing to migrate, in which
93
+ * case the seeder falls back to `seeds()`.
94
+ */
95
+ legacy?: (props: Record<string, unknown>) => Record<string, unknown>[];
96
+ /**
97
+ * Why this section cannot take another child right now — a sentence the
98
+ * merchant reads — or `null` when it can (card 66189).
99
+ *
100
+ * Optional, and only the Hero slide answers it today: a group is placed on one
101
+ * of nine anchors, an anchor stacks at most four, and a fifth would be drawn
102
+ * ON TOP of the fourth. The rule lives on the SPEC rather than inside
103
+ * `SlotChildRows` because the list is shared by five sections and this is one
104
+ * section's arithmetic — the list asks, the spec answers.
105
+ */
106
+ addBlocked?: (children: readonly unknown[], incoming?: unknown) => string | null;
107
+ /**
108
+ * Why this section must NOT be seeded at all, read off its OWN stored props.
109
+ *
110
+ * The seeder's existing guard is "the slot already has children" — right for a
111
+ * section whose only shape is the slot, and blind to a section that still
112
+ * carries an OLDER one. Image & Text Columns is the first of those: its
113
+ * columns used to be a `steps` ARRAY, the owner ruled on 2026-09-05 that
114
+ * nothing is migrated, and a stored page therefore has a full `steps` and an
115
+ * empty `boxes`. Without this the seeder would drop three fresh Boxes into a
116
+ * published page that already draws three columns, and the merchant would find
117
+ * six.
118
+ *
119
+ * Deliberately a question about the PARENT'S props, not about the slot — the
120
+ * slot is what the existing guard already reads, and answering "is there an
121
+ * older shape here" from the same place is what makes this a second question
122
+ * rather than a second opinion on the first.
123
+ */
124
+ skipSeed?: (props: Record<string, unknown>) => boolean;
125
+ /**
126
+ * What the list says about the children it ALREADY holds, or `null`.
127
+ *
128
+ * The counterpart to `addBlocked`, and deliberately a second question rather
129
+ * than a second answer from the first: `addBlocked` is about a group that has
130
+ * not arrived yet, this is about the ones that are already here and cannot all
131
+ * be drawn. A section that cannot get into that state simply declares neither.
132
+ */
133
+ notice?: (children: readonly unknown[]) => string | null;
134
+ }
135
+
136
+ /** Which registry answered — the discriminator three of the four decisions read. */
137
+ type AddTargetSource = "section" | "footer" | "container";
138
+ /**
139
+ * What a parent can take, and everything the four decisions below need to act on
140
+ * it.
141
+ *
142
+ * ⚠️ THE LOOKUP DECIDES FOUR THINGS, NOT ONE. Wiring only the choice list ships
143
+ * a menu with wrong row names, wrong handlers, and unreachable on an empty
144
+ * container — which is why this returns a record rather than a list:
145
+ *
146
+ * 1 the CHOICE LIST — {@link AddTarget.choices}, what the Add menu offers, or
147
+ * `null` where the parent adds ONE child type from a button instead.
148
+ * 2 the ROW NAME — `rowNamerFor` (components/SlotChildRows) reads
149
+ * {@link AddTarget.source} to pick the FOOTER's block-label rule over
150
+ * lib/document/slot-child-name.ts. It must ask "is this a FOOTER block", NOT
151
+ * "does this parent use a menu": a Box adds from a menu too and
152
+ * keeps the slot-child rule, or its Headings, Texts and Buttons all fall
153
+ * through to a rule that reads a heading, a bound menu and first-words.
154
+ * 3 WHICH HANDLERS — SectionScreenShell's adapter reads `source` to choose
155
+ * which pair of host handlers a row presses. Keyed the other way round it
156
+ * answered null for a Box, whose rows then pressed and did nothing.
157
+ * 4 REACHABILITY — `Boolean(canAddTo(type))` feeds `nestState`, and a row
158
+ * folds open only if it has children OR an add affordance. An EMPTY
159
+ * container with no caret cannot be opened to reach its own menu — and
160
+ * empty is exactly the state a merchant is in when adding the first block.
161
+ */
162
+ interface AddTarget {
163
+ /** Which of the three registries answered. */
164
+ source: AddTargetSource;
165
+ /**
166
+ * The slot this parent keeps its children on.
167
+ *
168
+ * RETURNED rather than defaulted, so a caller can never reach it by falling
169
+ * through another mechanism's constant — the rule container-blocks states for
170
+ * its own lookup, kept here because this is now the one that is asked. A Flex
171
+ * listed on the Footer's `blocks` would draw its rows off `undefined`.
172
+ */
173
+ slot: string;
174
+ /** The registry's own choice list, or `null` for a single-type "Add …" button. */
175
+ choices: BlockChoice[] | null;
176
+ /**
177
+ * The section's own spec — its `addLabel`, `childType`, `seeds`, `addBlocked`,
178
+ * `notice` and `slider`. Non-null exactly when `source === "section"`.
179
+ *
180
+ * Carried so a caller that needs a section's own arithmetic (the Hero slide's
181
+ * anchor cap, the seed-on-load effect) reaches it through this one seam rather
182
+ * than importing the registry beside it and gaining a second opinion.
183
+ */
184
+ spec: SlotSectionSpec | null;
185
+ }
186
+
187
+ /**
188
+ * WHAT THE WEBSITE HANDS THE EDITOR'S SCREEN — the parts of the screen that
189
+ * know there is a website, given to it instead of imported by it
190
+ * (doc/adr/0003).
191
+ *
192
+ * The screen — the frame, the panels, the tree, the add panel, the inspector —
193
+ * is being made to hold nothing a website has that an email does not: no page,
194
+ * no site theme, no pinned header, no chat bubble. What it used to import and
195
+ * wire itself, the website layer now wires and hands over here, and a screen
196
+ * mounted with no layer above it draws none of it.
197
+ *
198
+ * This is NOT `EaselChrome` (lib/host-chrome): that is what a HOST stands
199
+ * round the editor — the storefront's cart, its header's settings — built in
200
+ * the host and absent on the ambient session. These parts are the builder's
201
+ * own website layer, the same for every host, and present on every mount of
202
+ * the screen (`ScreenStoreProvider` supplies them, from whoever mounts it).
203
+ *
204
+ * Fixed for the life of a mount, like the session: `useBridges`,
205
+ * `useStandaloneBridges`, `useDocumentPass` and `blockLook.useProducts` are
206
+ * called as hooks, and `Canvas` and `Inspector` are rendered as element types,
207
+ * so the provider's value must not change while the screen is mounted.
208
+ */
209
+ /** A node of the document as the screen hands it to a layer: its type and its
210
+ * props, its id among them. */
211
+ interface ScreenNode {
212
+ type: string;
213
+ props: {
214
+ id: string;
215
+ [key: string]: unknown;
216
+ };
217
+ }
218
+ /**
219
+ * A panel of the layer's own, as the screen holds it: a kind, and whatever
220
+ * else the layer put beside it to say WHICH one (the node a panel is about).
221
+ * The screen stores it and hands it back, and reads no further into it than
222
+ * `kind`.
223
+ */
224
+ type ScreenInspectorMode = {
225
+ kind: string;
226
+ };
227
+ /**
228
+ * THE SELECTION'S OWN PANEL — the one mode the screen names for itself. In it
229
+ * the inspector follows the selection: a node's settings, or the document's
230
+ * with nothing selected. Every other mode is a panel of a layer's, which the
231
+ * screen stores and hands back; this is the one it puts the inspector back to
232
+ * when the selection changes, and on every press of a row of its own.
233
+ *
234
+ * ONE object for the module's life, so setting it while it is the mode already
235
+ * bails out of the state update. A layer whose inspector names this mode names
236
+ * THIS object (the website's `SELECTION_MODE`, components/SectionEditor, is it), so
237
+ * "is the panel showing the selection's own?" has one answer on both sides.
238
+ * The kind is `"selection"`; its old spelling went in easel 22.0.0.
239
+ */
240
+ declare const SELECTION_MODE: {
241
+ readonly kind: "selection";
242
+ };
243
+ /** Is this the selection's own panel? */
244
+ declare function isSelectionMode(mode: {
245
+ kind: string;
246
+ }): boolean;
247
+ /** The inspector drilled into one PART of a node (lib/document/part-id): the mode
248
+ * the screen's part bridge (components/usePartBridge) opens and closes. The
249
+ * website's inspector modes include it (components/SectionEditor
250
+ * `InspectorMode`). */
251
+ type ScreenPartMode = {
252
+ kind: "part";
253
+ nodeId: string;
254
+ propKey: string;
255
+ };
256
+ /** Are two panels the same panel: the same kind, about the same thing? Asked
257
+ * member by member, so the screen can answer without knowing what a layer
258
+ * keeps beside the kind. */
259
+ declare function sameInspectorMode(a: ScreenInspectorMode, b: ScreenInspectorMode): boolean;
260
+ /**
261
+ * A SLOT's own panel (0.105.0): the mode the screen opens when the row of a
262
+ * slot it draws as a rung is pressed (`ScreenSlot.panel`) — the campaign
263
+ * designer's Column inspector. `kind` is the layer's (`panel`), and beside it
264
+ * the node the slot is a slot of and the slot's own name. The screen makes it
265
+ * and hands it back to the layer's inspector; a layer may name one itself to
266
+ * `ScreenInspector.select`.
267
+ */
268
+ interface ScreenSlotMode extends ScreenInspectorMode {
269
+ nodeId: string;
270
+ slot: string;
271
+ }
272
+ /** Is a panel a slot's own ({@link ScreenSlotMode}) — about a node's slot, not
273
+ * the node? */
274
+ declare function isSlotMode(mode: ScreenInspectorMode): mode is ScreenSlotMode;
275
+ /** An address of a node the screen selects, as its own ops spell one: its
276
+ * index, in the list `zone` names (left out for the top-level list); or null,
277
+ * for nothing selected. */
278
+ type ScreenSelector = {
279
+ index: number;
280
+ zone?: string;
281
+ } | null;
282
+ /** The inspector, as far as a layer needs it: which panel it shows, and how to
283
+ * show one of the layer's own. */
284
+ interface ScreenInspector {
285
+ /** The kind of panel showing now. */
286
+ kind: string;
287
+ /** The panel showing now, whole: what `open` was handed, given back. */
288
+ mode: ScreenInspectorMode;
289
+ /** Show a panel of the layer's own and reveal the inspector, leaving the
290
+ * selection where it is. The same panel already showing stays, as the
291
+ * object it was (`sameInspectorMode`). */
292
+ open: (mode: ScreenInspectorMode) => void;
293
+ /**
294
+ * Put a panel of the layer's own in the inspector and leave the inspector as
295
+ * it stands, in view or hidden: with `reveal` after it, what a press on one
296
+ * of the screen's own rows does. `open` is for a handler registered once: it
297
+ * never changes identity, so it cannot ask whether the inspector is hidden
298
+ * and brings it out every time.
299
+ */
300
+ show: (mode: ScreenInspectorMode) => void;
301
+ /** Bring the inspector into view if it is hidden. What it shows stays. */
302
+ reveal: () => void;
303
+ /**
304
+ * Move the selection AND put a panel of the layer's own in the inspector, in
305
+ * one step (0.105.0): what the campaign designer's Column needs, which is a
306
+ * slot and not a node — nothing is selected (`null`) and the Column
307
+ * inspector shows. `show` then a selection would not hold: the screen puts
308
+ * the inspector back to the selection's own panel whenever the selection
309
+ * changes, so the mode is kept pending and that reset honours it for this
310
+ * one change. The inspector is left as it stands, in view or hidden, as
311
+ * `show` leaves it. A slot's own panel ({@link ScreenSlotMode}) for a slot
312
+ * the tree draws as a rung also unfolds the tree to that rung's row.
313
+ */
314
+ select: (selector: ScreenSelector, mode: ScreenInspectorMode) => void;
315
+ }
316
+ /**
317
+ * What the screen hands THE INSPECTOR it mounts in its right panel
318
+ * (`ScreenParts.Inspector`): the panel to show, the ways out of a panel,
319
+ * and what the screen's own furniture offers one. The names are the ones the
320
+ * screen has always passed, two of them in a website's words: they are the
321
+ * doors the bridges hand back (`openSettings`, `openStyles`).
322
+ */
323
+ interface ScreenInspectorPanelProps {
324
+ /** The panel to show: the selection's own (`SELECTION_MODE`), or one of the
325
+ * layer's, handed back as the screen was handed it. */
326
+ mode: ScreenInspectorMode;
327
+ /** The way to the settings of the whole document, from a panel that edits
328
+ * one part of it (`ScreenBridges.openSettings`). */
329
+ onOpenWebsiteSettings: () => void;
330
+ /** The way to the styles a part of a block can follow, from that part's own
331
+ * panel (`ScreenBridges.openStyles`). Omitted where there is nowhere to
332
+ * keep them, and the panel draws no door. */
333
+ onOpenSiteStyles?: () => void;
334
+ /** The way to THIS document's own styles (`ScreenBridges.openPageStyles`),
335
+ * for a panel with nothing selected to point at. Omitted where the layer
336
+ * hands none. */
337
+ onOpenPageStyles?: () => void;
338
+ /** Select a node and show ITS OWN settings: the way out of a panel that was
339
+ * scoped down to part of that node. */
340
+ onSelectNode: (nodeId: string) => void;
341
+ /** Withhold the head's duplicate and remove. Set by the screen whose
342
+ * document is ONE node, which a second node or none would break. */
343
+ hideNodeActions?: boolean;
344
+ /** Say one line through the screen's toast. Omitted by a screen with none. */
345
+ onNotify?: (msg: string, tone?: "success" | "error") => void;
346
+ /** Hide the panel: the last button of its head. Omitted by a screen whose
347
+ * inspector is always in view. */
348
+ onHidePanel?: () => void;
349
+ /**
350
+ * Which of the head's two node actions the selected node's BLOCK allows
351
+ * (0.103.0): its config's `permissions.duplicate` and `permissions.delete`,
352
+ * each true unless the config says false — the answer the screen's own tree
353
+ * rows and menu honour, handed on so the head the layer draws honours it
354
+ * too, hiding or greying a refused one. With nothing selected both are true.
355
+ * Handed by the page screen; a layer that never reads it draws its head as
356
+ * it did.
357
+ */
358
+ nodeActions?: ScreenNodeActions;
359
+ }
360
+ /** What a block's config allows of the two actions that make another node or
361
+ * take one away (`ComponentConfig.permissions`): `false` only where the config
362
+ * says so (lib/document/content-tree `blockNodeActions`). */
363
+ interface ScreenNodeActions {
364
+ duplicate: boolean;
365
+ delete: boolean;
366
+ }
367
+ /**
368
+ * The document and its tree of rows, as far as a layer needs them to wire and
369
+ * draw the parts of ONE block that are not nodes of their own: what is
370
+ * selected, where a node sits, and the three things a press on such a part's
371
+ * row does to the node it belongs to. Handed to the bridges on every render,
372
+ * so each member is that render's.
373
+ */
374
+ interface ScreenTree {
375
+ /** The document, as the rules are handed it. */
376
+ data: unknown;
377
+ /** The node selected now, or null. */
378
+ selected: ScreenNode | null;
379
+ /** The key of the list a node sits in, by the node's id. */
380
+ zoneOf: (id: string) => string | undefined;
381
+ /** Somebody else holds the document: nothing may be moved. */
382
+ readOnly: boolean;
383
+ /** Select the top-level node at `index` the way a press on its row does: the
384
+ * inspector goes back to the selection's own panel, then the selection
385
+ * moves. */
386
+ select: (index: number) => void;
387
+ /** Write the top-level node at `index` back, whole. */
388
+ replace: (index: number, node: ScreenNode) => void;
389
+ /** Bring the canvas to a node, as selecting its row does. */
390
+ scrollTo: (id: string) => void;
391
+ }
392
+ /**
393
+ * The canvas, as far as a layer needs it: which device it is being looked at
394
+ * on, and how often its frame has been rebuilt. The switch, its state and the
395
+ * Refresh are the screen's; a layer whose own fields or preview ask "which
396
+ * view is this?", or which puts the canvas somewhere of its own accord, is
397
+ * told here. Handed to the bridges on every render.
398
+ */
399
+ interface ScreenCanvas {
400
+ /** The id of the device the switch is on: one of the layer's own
401
+ * (`ScreenDevices.options`). */
402
+ device: string;
403
+ /** How many times the screen has rebuilt the canvas's frame (its Refresh).
404
+ * It changes with each one and with nothing else: a layer that put the
405
+ * canvas somewhere as the document opened lists it as a dependency, and
406
+ * puts it there again in the fresh frame. */
407
+ refreshes: number;
408
+ }
409
+ /**
410
+ * The left panel, as far as a layer needs it: to put it on a view and to bring
411
+ * it out. Which view it is on, whether it is open and what a press on the rail
412
+ * does to either are the screen's. Handed to the bridges on every render.
413
+ */
414
+ interface ScreenLeftPanel {
415
+ /** Put the panel on a view, by its id: one of the layer's own
416
+ * (`ScreenLeftView`) or one of the screen's. Whether the panel is in view
417
+ * stays, and the screen keeps the choice as it keeps any other. */
418
+ setView: (view: string) => void;
419
+ /** Bring the panel into view if it is hidden. What it shows stays. */
420
+ reveal: () => void;
421
+ }
422
+ /**
423
+ * What a line of the screen's toast may carry besides its words (owner
424
+ * 2026-10-14: a delete goes at once and its toast offers "Undo" for 8 s). The
425
+ * shell's `toast` takes all three (`efficient-shell` 7.24); a host's own
426
+ * `notify` is handed them and should pass them on, or the Undo is lost.
427
+ */
428
+ interface ScreenToastExtra {
429
+ /** One action after the words: "Undo". */
430
+ action?: {
431
+ label: string;
432
+ onClick: () => void;
433
+ };
434
+ /** How long the line stays, in ms. */
435
+ duration?: number;
436
+ /** Told once how the line went: its action, its time, or a tap. */
437
+ onClose?: (how: "action" | "timeout" | "dismissed") => void;
438
+ }
439
+ /** What a view of the layer's is handed when the left panel draws it: what the
440
+ * screen hands the heads of its own views. */
441
+ interface ScreenLeftViewFrame {
442
+ /** Hide the whole left panel: the last button of every view's head. */
443
+ onHide: () => void;
444
+ /** Say one line through the screen's toast — with its Undo and its time
445
+ * where it has them (`extra`, 7.0.0: a page deleted from the layer's own
446
+ * Pages panel offers Undo through the same door as a section). */
447
+ notify: (msg: string, tone?: "success" | "error", extra?: ScreenToastExtra) => void;
448
+ }
449
+ /**
450
+ * A VIEW of the left panel that is the layer's own: a button in the rail, and
451
+ * what the panel shows while the view is the one it is on. The screen lights
452
+ * the button and switches to the view exactly as it does for its own Layers,
453
+ * and draws no frame round what `panel` returns: a view draws its own head.
454
+ */
455
+ interface ScreenLeftView {
456
+ /** The view's id: what the screen holds as the view the panel is on, and
457
+ * what is kept between mounts (`ScreenLeftViewRules`), so one in use is
458
+ * never renamed. The rail button's id as well. */
459
+ id: string;
460
+ /** The rail button's name. */
461
+ label: string;
462
+ /** …and its glyph. */
463
+ icon: ReactNode;
464
+ /** The view, for the screen to place in the left panel as it comes back. A
465
+ * function called where the panel is drawn and not a component of its own:
466
+ * what it returns is mounted in the screen's place, with nothing between. */
467
+ panel: (frame: ScreenLeftViewFrame) => ReactNode;
468
+ }
469
+ /**
470
+ * What a layer stands in the rail: a view of its own, or a button that is NOT
471
+ * a view of the left panel — one that opens something of the layer's
472
+ * elsewhere. That one is the engine's own rail item (efficient-easel/rail),
473
+ * drawn as it is handed: the layer says whether it is lit and what a press
474
+ * does.
475
+ */
476
+ type ScreenRailItem = ScreenLeftView | EaselRailItem;
477
+ /** How a full node goes in (`ScreenDocumentOps.insertNode`, `SectionOps.insertNode`). */
478
+ interface InsertNodeOptions {
479
+ /** The node holds SAVED answers (a saved section template, a stored section
480
+ * rebuilt): resolved with trigger `"copy"`, so an emptied slot stays empty. */
481
+ copy?: boolean;
482
+ }
483
+ /**
484
+ * The screen's own writes of the document, as far as a layer's pass over a
485
+ * document needs them. They are the writes every surface of the screen makes
486
+ * (lib/document/use-section-ops), refused the same way while somebody else holds
487
+ * the document, and ONE object from render to render until that changes — so a
488
+ * pass may list it as a dependency and run no oftener for it.
489
+ *
490
+ * Every write is FOLDED into the history entry it happens in (1.0.1,
491
+ * `foldIntoHistory`): what a pass gives a document as it opens is part of the
492
+ * document the history starts at, never an undo step that one Undo takes back
493
+ * out. Autosave still hears each write.
494
+ */
495
+ interface ScreenDocumentOps {
496
+ /** Replace the whole working document, unrecorded. */
497
+ setDocument: (data: Data) => void;
498
+ /** Insert a node of `type`, as its own defaults, into the top-level list;
499
+ * returns the id it was given. */
500
+ insertSection: (type: string, index: number) => string;
501
+ /** Insert a FULL node — its type and its props, slot children inline — into
502
+ * the list `zone` names; returns the id it was given. `{ copy: true }` for
503
+ * a node that holds SAVED answers (a stored section rebuilt, a saved
504
+ * template): it is resolved as `"copy"`, not `"insert"` (use-section-ops). */
505
+ insertNode: (zone: string, index: number, node: ScreenNode, options?: InsertNodeOptions) => string;
506
+ /** Write the node at a place back, whole. */
507
+ replaceComponent: (zone: string, index: number, node: ScreenNode) => void;
508
+ }
509
+ /** What the tree lends a layer that draws a row in it: the row's own click,
510
+ * for a pointer landing outside its name. */
511
+ interface ScreenTreeRows {
512
+ rowClick: (select: () => void) => (e: MouseEvent<HTMLElement>) => void;
513
+ }
514
+ /** …and, for a layer that draws rows which fold, the tree's own fold state.
515
+ * The ids are the layer's to make; the tree keeps them with its own. */
516
+ interface ScreenTreeFolds extends ScreenTreeRows {
517
+ isCollapsed: (id: string) => boolean;
518
+ toggleCollapse: (id: string) => void;
519
+ }
520
+ /**
521
+ * A layer's main action, as data (`ScreenBridges.mainAction`, 8.0.0). The
522
+ * screen draws it; the layer draws nothing. Words are the layer's, already in
523
+ * its language.
524
+ */
525
+ interface ScreenMainAction {
526
+ /** The main half's word: "Publish", "Save and close". */
527
+ label: string;
528
+ /** Its Tooltip while it can be pressed ("Saves your changes and goes back to
529
+ * the campaign. Nothing is sent."). */
530
+ tooltip?: string;
531
+ /** What a press does. */
532
+ onPress: () => void;
533
+ /**
534
+ * The quiet form, while there is nothing for the action to do: the main
535
+ * half becomes secondary, with a check glyph, these words, and off with
536
+ * `reason` ("Published" / "Everything is live"). The chevron still opens.
537
+ * Absent or null: never quiet.
538
+ */
539
+ quiet?: {
540
+ label: string;
541
+ reason: string;
542
+ } | null;
543
+ /** A reason of the layer's own to turn the main half off, besides the
544
+ * screen's (a lock, a refused save, offline, a failed save). */
545
+ disabledReason?: string | null;
546
+ /** What the menu's status row says after the save ("Saved 2 seconds ago ·
547
+ * Changes not live yet"): "Changes not live yet", "Everything is live",
548
+ * "Never published", "Draft, nothing is sent". */
549
+ status?: string | null;
550
+ /**
551
+ * What the action will put live, one short line each, in the layer's words
552
+ * ("Home", "Site styles", "Main menu"): the website editor's one Publish
553
+ * puts the whole site live, and the merchant sees what it holds before the
554
+ * press. The save menu draws each line as a status row (the shell's
555
+ * `status` entry: muted, not a menu item) under the status row. Absent or
556
+ * empty: no list.
557
+ */
558
+ goingLive?: readonly string[];
559
+ /**
560
+ * The layer's own rows of the ▾ menu ("Version history"): drawn last, under
561
+ * Save now and one divider, as the shell's menu items. A press closes the
562
+ * menu, then runs `onSelect`. Absent or empty: the menu is as before, with
563
+ * no divider of their own.
564
+ */
565
+ menuItems?: readonly ScreenMenuItem[];
566
+ /** The action is running: the main half shows the shell's spinner. */
567
+ busy?: boolean;
568
+ }
569
+ /** One of the layer's rows in the ▾ menu ({@link ScreenMainAction.menuItems}). */
570
+ interface ScreenMenuItem {
571
+ /** Unique among the layer's rows. */
572
+ key: string;
573
+ /** The row's words, in the layer's language ("Version history"). */
574
+ label: string;
575
+ /** The shell glyph before the words. */
576
+ icon?: ReactNode;
577
+ /** What a press does, after the menu has closed. */
578
+ onSelect: () => void;
579
+ /** Turns the row off. */
580
+ disabled?: boolean;
581
+ }
582
+ /** What a layer's bridges give back for the screen to place. */
583
+ interface ScreenBridges {
584
+ /** A row under the Add panel's tiles, for something that is not a block.
585
+ * Handed the way to leave Add, for a row that opens a panel. */
586
+ addPanelRow?: (leaveAdd: () => void) => ReactNode;
587
+ /**
588
+ * Rows at the END of a top-level node's own children, for a part of that
589
+ * block which is not a node: "layer, do you draw anything under this row?".
590
+ * Asked only where the node's child rows are drawn, and what comes back is
591
+ * placed as it is — the layer draws with the tree's own row.
592
+ */
593
+ partRows?: (node: ScreenNode, rows: ScreenTreeRows) => ReactNode;
594
+ /**
595
+ * Does the layer draw a subtree of its OWN under this top-level node — rows
596
+ * for things the block keeps in its props and not in a slot? Such a row
597
+ * folds like any other, so the screen asks before it draws the caret.
598
+ */
599
+ hasOwnRows?: (node: ScreenNode) => boolean;
600
+ /** That subtree's rows, for the node at `index`. Asked only when
601
+ * `hasOwnRows` said yes and the row is unfolded. */
602
+ ownRows?: (node: ScreenNode, index: number, rows: ScreenTreeFolds) => ReactNode;
603
+ /**
604
+ * The row of a top-level node was pressed, and the screen has selected it:
605
+ * a layer that keeps a focus of its own INSIDE one block puts it back to the
606
+ * block. Called between the selection and the canvas's scroll. The node is
607
+ * the one at the pressed index, if there is one.
608
+ */
609
+ sectionPressed?: (node: ScreenNode | undefined) => void;
610
+ /**
611
+ * The layer's own controls in the top bar's right cluster. The screen draws
612
+ * that cluster as the save icon and the main button (8.0.0; it was the save
613
+ * pill, Refresh and the main button); a layer has two places in it.
614
+ * `barLead` stands FIRST among the actions, right after the save icon:
615
+ * something done with the whole document that only the layer has. What
616
+ * comes back is placed as it is, and a layer with nothing to offer just now
617
+ * returns nothing.
618
+ */
619
+ barLead?: () => ReactNode;
620
+ /** …and `barTrail` stands just before the main button: a way out to where
621
+ * the document is read (the website's Preview, the email designer's "Send
622
+ * a test email"). */
623
+ barTrail?: () => ReactNode;
624
+ /** …and `barView` stands in the CENTRE cluster, right after Refresh: a way
625
+ * to look at the document drawn as an icon beside the preview's own
626
+ * controls (the website's Preview, owner 2026-10-25). A layer that has one
627
+ * hands it here instead of `barTrail`. */
628
+ barView?: () => ReactNode;
629
+ /**
630
+ * …and `barMain` IS the main button, in its place at the end of the cluster
631
+ * (0.103.0): the layer's own way to finish with the document — the campaign
632
+ * designer's Done — where the screen draws Publish (a document that
633
+ * publishes) or Save. What comes back is placed as it is, nothing round it,
634
+ * and returning nothing leaves the place empty. Absent, the screen draws its
635
+ * own button, as it always has.
636
+ */
637
+ barMain?: () => ReactNode;
638
+ /**
639
+ * THE MAIN ACTION, AS DATA (8.0.0, card [DESIGN] A Clearer Save In Both
640
+ * Editors): what the layer's main button says and does, for the screen to
641
+ * draw as the shell's `SplitButton` with the save menu on its chevron. The
642
+ * website's is Publish (quiet as "Published" while everything is live); the
643
+ * email designer's is Save and close. The screen turns the main half off,
644
+ * with the reason, while the document is locked, frozen, refused, offline or
645
+ * holding a failed save; the chevron always opens. Handed back each render,
646
+ * so it follows the layer's state. Wins over `barMain`; with neither, the
647
+ * screen's own Done (`screen.done`) stands in the same split button.
648
+ */
649
+ mainAction?: ScreenMainAction | null;
650
+ /**
651
+ * The layer's own buttons in the rail. The screen draws the rail as Add, its
652
+ * own Layers and the host's Media library; a layer has two places in it.
653
+ * `railLead` stands between Add and Layers. Each list is the buttons THIS
654
+ * document has, in the order they are drawn: one it does not have is left
655
+ * out, and a view left out is a view the panel cannot be on.
656
+ */
657
+ railLead?: ReadonlyArray<ScreenRailItem>;
658
+ /** …and `railTrail` stands between Layers and Media. */
659
+ railTrail?: ReadonlyArray<ScreenRailItem>;
660
+ /**
661
+ * Which view the left panel ACTUALLY shows, given the one it is set to: the
662
+ * view kept from another document may be one this document does not have,
663
+ * and the panel then shows the screen's Layers. The layer answers, because
664
+ * some of the views are its own and which of them a document has is its to
665
+ * know. The screen has no media view (the media library is a popup,
666
+ * harness UI-20): a stored "media" view resolves to Layers like any other
667
+ * view this document does not have.
668
+ */
669
+ resolveLeftView?: (view: string) => string;
670
+ /**
671
+ * A tool of the layer's own at the foot of the Layers tree, under the last
672
+ * row: something that reads the whole document and is not a row of it.
673
+ * Placed as it comes back.
674
+ */
675
+ treeFoot?: () => ReactNode;
676
+ /**
677
+ * Two doors out of the inspector's panels, onto wherever the layer keeps what
678
+ * they lead to: a view of its own in the left panel, a panel of its own in
679
+ * the inspector. The screen hands them to the inspector it mounts and does
680
+ * not know where they go. `openSettings` is the way to the settings of the
681
+ * whole document, from a panel that edits one part of it. The inspector
682
+ * cannot do without it, so with no layer it is handed one that leads nowhere.
683
+ */
684
+ openSettings?: () => void;
685
+ /** …and `openStyles` the way to the styles a part of a block can follow,
686
+ * from that part's own panel. A layer with nowhere to keep them hands none,
687
+ * and the panel draws no door. */
688
+ openStyles?: () => void;
689
+ /**
690
+ * The way to THIS document's own styles — the website's Styles ▸ Basics, the This page group,
691
+ * the email's Styles — from the tree ground's menu (`screen.pageStyles`).
692
+ * The tree keeps no row for the document's settings (Lewis, 2026-10-26:
693
+ * the tree's first row goes), so this is the menu's one door to them. A layer
694
+ * that hands none gets no row.
695
+ */
696
+ openPageStyles?: () => void;
697
+ /**
698
+ * THE LAYER'S OWN ROWS IN A NODE'S RIGHT-CLICK MENU (0.105.0), by the group
699
+ * each joins (`ScreenMenuRows`): the campaign designer's "Check this image
700
+ * loads" and its phone rows. Asked of the node the menu was opened on, and
701
+ * where it sits, every time the menu is drawn; what comes back is placed at
702
+ * the end of its group, after the screen's own rows, as it is handed — a row
703
+ * that writes runs a component or an op of the layer's that reaches the
704
+ * document itself. Nothing handed back adds nothing. Absent: the screen's
705
+ * rows alone, as the menu has always drawn them.
706
+ */
707
+ menuRows?: (node: ScreenNode, zone: string, index: number) => ScreenMenuRows | null | undefined;
708
+ /**
709
+ * THE ROW'S OWN ACTIONS ON A DRAWN COPY (card copy typing, 2026-10-30). A
710
+ * card template is drawn once per row of its owner's data, each copy in a
711
+ * `data-sf-repeat` wrapper; the rows are the layer's, never the document's.
712
+ * Given, a right-click on a block in a copy offers, in the node's one menu,
713
+ * Add item after, Move item earlier, Move item later (the way a row cannot
714
+ * go greyed) and Delete item, and a press comes here with the copy's place.
715
+ * Withheld while nothing may be written. Absent: the menu is as before.
716
+ */
717
+ onCopyItem?: (request: CopyItemRequest) => void;
718
+ /** The layer's own context, stood round the whole screen. What it is handed
719
+ * is the screen; what it returns is rendered in the screen's place. */
720
+ wrap?: (screen: ReactNode) => ReactNode;
721
+ }
722
+ /** The document's half of a shared section (`ScreenPinnedNodes.shared`). */
723
+ interface ScreenSharedSections {
724
+ /** The pages that use this top-level node, this page among them, when it is
725
+ * a shared section; null when it is this page's own, or the header or
726
+ * footer. */
727
+ usedOn: (node: ScreenNode) => readonly SharedSectionUse[] | null;
728
+ /** Open one of those pages (a press in On N pages ▸). */
729
+ openPage: (page: SharedSectionUse) => void;
730
+ /** MAKE SHARED: the store made `section` from `node`. From now on the layer
731
+ * holds `node`, where it stands, as that shared section; the page looks the
732
+ * same, and its row turns green. */
733
+ adopt: (node: ScreenNode, section: SharedSection) => void;
734
+ /** What Add puts on the page for `section` — the node the layer holds as it
735
+ * — or null when it cannot go on this page: it is on it already (once per
736
+ * page). */
737
+ nodeOf: (section: SharedSection) => ScreenNode | null;
738
+ /** DETACH FROM SHARED: this page's own copy of the shared `node`, every id
739
+ * fresh (efficient-easel/data `copyNode`). The screen puts it in the node's
740
+ * place, one undo step, and the layer holds it as the page's own from then
741
+ * on. The other pages keep the shared section. */
742
+ detach: (node: ScreenNode) => ScreenNode;
743
+ /** A shared section was deleted: every page that used it now holds its own
744
+ * copy, this one included, and the layer takes that in. Optional. */
745
+ removed?: (section: SharedSection) => void;
746
+ }
747
+ /** What a press on a drawn copy's item row asks (`ScreenBridges.onCopyItem`). */
748
+ type CopyItemAction = "addAfter" | "moveEarlier" | "moveLater" | "delete";
749
+ /** The copy a row was pressed on, and what to do to its row. */
750
+ interface CopyItemRequest {
751
+ /** The block whose slot is drawn once per row. */
752
+ ownerId: string;
753
+ /** That slot (`template`). */
754
+ slot: string;
755
+ /** The row the copy is drawn for; 0 is the main copy. */
756
+ index: number;
757
+ /** The copy of an outer template this copy's owner is drawn in, when
758
+ * there is one (`RepeatCopy.outer`, `efficient-easel/easel`): the inner
759
+ * index alone names no row. */
760
+ outer?: RepeatCopy;
761
+ action: CopyItemAction;
762
+ }
763
+ /** A layer's own rows in a node's menu, by the group of the menu each goes at
764
+ * the end of (efficient-easel/node-ops `nodeMenuItems`' `extras`): `pick`
765
+ * (Select layer), `make` (Duplicate … Paste), `change` (Rename, Hide …) and
766
+ * `remove` (Delete). */
767
+ type ScreenMenuRows = Partial<Record<"pick" | "make" | "change" | "remove", EaselContextMenuItem[]>>;
768
+ /** A block type's own default props, read off the config the screen holds.
769
+ * The screen's to look up and a layer's to be lent: a layer that reached into
770
+ * the config for itself would be holding a second copy of it. */
771
+ type NodeDefaults = (type: string) => Record<string, unknown>;
772
+ /** What the screen lends a rule that builds a node. All four are the screen's
773
+ * own and none is a block's: the rule states the node, the screen says what a
774
+ * type defaults to, what its next id is, what it is called and whether the
775
+ * host offers it. */
776
+ interface ScreenNodeMaker {
777
+ /** A type's default props, from the config. */
778
+ nodeDefaults: NodeDefaults;
779
+ /** A fresh id for one node of a type. Called once per node, in the order the
780
+ * nodes are written. */
781
+ newNodeId: (type: string) => string;
782
+ /** What a top-level node of a type is called, as the tree and the toast say
783
+ * it. */
784
+ sectionLabel: (type: string) => string;
785
+ /** Does this editor's host offer the type? A rule that would lay down a block
786
+ * the host left out asks first. */
787
+ blockIsOffered: (type: string) => boolean;
788
+ }
789
+ /** A node as a rule hands it back: a type and its props, slot children inline
790
+ * in them. The screen inserts it whole. */
791
+ interface ScreenNewNode {
792
+ type: string;
793
+ props: Record<string, unknown>;
794
+ }
795
+ /** The node a `canAddTo` question is asked of: its id, and the document it is in. */
796
+ interface ScreenNodeAt {
797
+ id: string;
798
+ data: unknown;
799
+ }
800
+ /**
801
+ * The rules of particular blocks, asked by the screen and never stated in it:
802
+ * the screen is handed nodes and is not told which blocks exist. Plain
803
+ * functions of what they are passed, and the same object for the life of a
804
+ * mount, so the screen may call them anywhere without listing them as a
805
+ * dependency.
806
+ */
807
+ interface ScreenBlockRules {
808
+ /** A block that is what its section IS: it may be selected and edited, and
809
+ * never removed, hidden, duplicated or dragged. `node` is the node itself,
810
+ * where the screen asks of one (every place it does, since 18.1.0): a rule
811
+ * that locks ONE node, not a whole type — a shared section another tab
812
+ * holds (Shared section design v4). A rule that reads the type alone locks
813
+ * by type, as it always did. */
814
+ isLockedBlock: (type: string | undefined, node?: ScreenNode) => boolean;
815
+ /** Why a second one of this node cannot be made in this document, or null —
816
+ * a rule of the block's own. */
817
+ duplicateBlocked: (data: unknown, node: unknown) => string | null;
818
+ /**
819
+ * How many nodes of its own kind the node with `id` already sits inside, for
820
+ * a block that limits its own nesting; 0 for every other. It is the depth the
821
+ * add lookup is asked at, so every surface that adds into one node offers the
822
+ * same list.
823
+ */
824
+ nestDepth: (data: unknown, type: string, id: string) => number;
825
+ /**
826
+ * What a new top-level section of `type` STARTS AS, when that is more than
827
+ * its own defaults — an arrangement of several blocks, or a prop no default
828
+ * carries — as ONE node for the screen to insert in one step; or null, and
829
+ * the screen inserts the type by itself. Where it goes, selecting it and
830
+ * announcing it stay the screen's.
831
+ */
832
+ newSectionNode: (type: string, make: ScreenNodeMaker) => ScreenNewNode | null;
833
+ /**
834
+ * What can go in a node of `nodeType`, sitting `nestDepth` nodes of its own
835
+ * kind deep (0 when not said): the slot its children are kept on, and the
836
+ * menu's rows or the one child type a button adds — or null for a node that
837
+ * takes no children. THE ONE ANSWER every add surface of the screen asks (the
838
+ * tree, the panel, the menu, the Add panel), so no two of them can come to
839
+ * offer one node different lists; what each of the layer's blocks takes is
840
+ * the layer's catalogue, and the screen is not told it.
841
+ *
842
+ * `slot` (0.105.0) is asked where the screen means ONE slot of a node that
843
+ * has several: a gap or an empty slot in the tree, a slot place Add was
844
+ * opened at, a drop into a slot. The answer is that slot's (the campaign
845
+ * designer's Column 2 answers `col2`); a layer that keeps one slot per node
846
+ * may ignore it, and the screen then offers that slot alone, as before.
847
+ *
848
+ * `at` (24.2.0) is the ONE node asked of, where the screen means one: its
849
+ * id and the document it is in (Add opened in it, its rows in the tree, a
850
+ * drop or an insert into it). Two nodes of one type may take different
851
+ * children — the campaign designer's Box takes any email block, a Box in a
852
+ * Banner only what the Banner's bake can draw. A layer whose nodes of one
853
+ * type all take the same may ignore it. Absent where the question is about
854
+ * a type, not a node (the Add panel's catalogue).
855
+ */
856
+ canAddTo: (nodeType: string, nestDepth?: number, slot?: string, at?: ScreenNodeAt) => AddTarget | null;
857
+ /**
858
+ * THE SLOTS OF A NODE, IN ORDER, AS THE SCREEN DRAWS THEM (0.105.0). A slot
859
+ * that is a `rung` is a row of its own in the Layers tree, with its children
860
+ * under it, a level of the Select layer flyout and a place of its own in a
861
+ * drag: the campaign designer's section draws Column 1 and Column 2 so from
862
+ * two columns up, and its lone column not at all. Every other slot's children
863
+ * hang straight off the node's row, as they do today. A slot left out of the
864
+ * answer is not drawn (a column the section's layout hides). The tree, the
865
+ * Add panel's "Adding to …", the drag and the flyout read it; where a node's
866
+ * children are FOUND (the menu, a write, a drop's checks) is still every
867
+ * slot field.
868
+ *
869
+ * Answered for every node the tree draws; null or undefined for one is the
870
+ * screen's own reading of it, so a layer may answer for its sections alone.
871
+ * Absent: every slot field the config declares, in its order, none of them a
872
+ * rung — the tree the website has.
873
+ */
874
+ slotsOf?: (node: ScreenNode) => ReadonlyArray<ScreenSlot> | null | undefined;
875
+ /**
876
+ * A RUNG MOVED (0.105.0): the rung at `from` in the node's run of rungs (its
877
+ * place among `slotsOf`'s rungs) dropped so it rests at `to` — a drag in the
878
+ * tree, or ⌥↑ / ⌥↓ on its row. The layer writes the move (the campaign
879
+ * designer swaps two columns' blocks, or reorders the phone stack) and may
880
+ * answer the slot to select after it, which the screen selects as a press
881
+ * on that rung's row does. Absent: no rung is picked up.
882
+ */
883
+ moveSlot?: (nodeId: string, from: number, to: number) => string | null | void;
884
+ /**
885
+ * What a rung's row offers besides its fold (0.105.0): the campaign
886
+ * designer's Duplicate and Delete of a column, drawn in the order handed,
887
+ * among the row's actions. The screen confirms nothing: what a press asks
888
+ * first (Delete a column that still holds blocks) is the layer's `run`.
889
+ * Withheld while the document is read-only. Absent, or nothing handed: the
890
+ * row has none.
891
+ */
892
+ slotActions?: (node: ScreenNode, slot: string) => ReadonlyArray<ScreenSlotAction> | null | undefined;
893
+ /**
894
+ * Does the host of this editor offer the type? Asked of the editor's own
895
+ * session where the screen holds it, else of the editor on the page. Where
896
+ * no host chose its blocks, every type is.
897
+ */
898
+ blockIsOffered: (type: string, session?: EaselSession) => boolean;
899
+ /**
900
+ * Is a new block RESOLVED as it goes in (0.103.0)? With true, every insert
901
+ * the screen makes — a section, a block into a slot, a saved template, a
902
+ * seeded slot child — is followed by `easel.resolveNode(id, { trigger:
903
+ * 'insert' })`, as the campaign designer's own inserts are: the block's
904
+ * `resolveData` runs the moment it arrives (seeding its children, stamping a
905
+ * default), in the insert's own undo step, not at its first edit or the next
906
+ * time the document opens. Absent, false: an insert runs no resolver, as
907
+ * the website's never has.
908
+ */
909
+ resolveOnInsert?: boolean;
910
+ /**
911
+ * CLEAN A COPY (0.106.0): handed every node the screen COPIES into the
912
+ * document — the menu's Duplicate and Paste, ⌘V (a cut block pasted back
913
+ * too), a saved section put in from Add — one node at a time, a copied
914
+ * section's blocks each as well, and it answers the node as the copy should
915
+ * hold it: what only the original may hold taken out. The campaign
916
+ * designer's image block releases the hosted picture it baked (`bakedId`):
917
+ * the next bake deletes the asset that id names, so two blocks holding one
918
+ * would destroy each other's picture. It must keep the node's id (the copy's
919
+ * own, already fresh) and its type. Absent: a copy is its original, prop for
920
+ * prop, but its ids, as before.
921
+ */
922
+ stripCopy?: (node: ScreenNode) => ScreenNode;
923
+ }
924
+ /**
925
+ * ONE SLOT OF A NODE, as the screen draws it (`ScreenBlockRules.slotsOf`,
926
+ * 0.105.0). Only `slot` and `rung` are read of a slot that is not a rung.
927
+ */
928
+ interface ScreenSlot {
929
+ /** The slot field's name (`col2`): its children are `props[slot]`, its list
930
+ * is `${nodeId}:${slot}`. */
931
+ slot: string;
932
+ /** What the rung's row says ("Column 2"), and the flyout, and Add's
933
+ * "Adding to …". */
934
+ label: string;
935
+ /** The rung's glyph, drawn as handed. Absent: none. */
936
+ glyph?: ReactNode;
937
+ /** Drawn as a row of its own, its children under it. False: its children
938
+ * hang straight off the node's row. */
939
+ rung: boolean;
940
+ /**
941
+ * The kind of the layer's panel this rung is edited in (the Column
942
+ * inspector): a press on its row selects nothing and shows that panel, as a
943
+ * {@link ScreenSlotMode} naming the node and the slot, and the row is lit
944
+ * while it shows; the flyout lists it as a level. Absent: the rung only
945
+ * folds, its press selects the node it is a slot of, and the flyout leaves
946
+ * it out.
947
+ */
948
+ panel?: string;
949
+ /** A pill after the name ("2 of 3", the phone stack's place). */
950
+ badge?: ReactNode;
951
+ /** The hint the row shows when it may be dragged. Absent: the tree's own. */
952
+ dragHint?: string;
953
+ /** Drawn above the rung's row, as handed: the campaign designer's "Phone
954
+ * order" label over its first column. */
955
+ heading?: ReactNode;
956
+ /** False: the rung keeps its place, and is not picked up (a pinned
957
+ * section's columns). Absent: it moves where `moveSlot` is handed. */
958
+ movable?: boolean;
959
+ }
960
+ /** What a rung's row offers (`ScreenBlockRules.slotActions`, 0.105.0). */
961
+ interface ScreenSlotAction {
962
+ /** Which action: the screen draws its glyph, and the delete in its red. */
963
+ kind: "duplicate" | "delete";
964
+ /** Its tooltip and accessible name: "Duplicate Column 2", or why not. */
965
+ label: string;
966
+ /** Drawn, and not pressed: the label says why. */
967
+ disabled?: boolean;
968
+ /**
969
+ * The action, the layer's whole: it asks what it must ask first and writes.
970
+ * It may answer the slot to select after it (the copy, the column that took
971
+ * a deleted one's place), which the screen selects as a press on that rung's
972
+ * row does; nothing, and the selection stays.
973
+ */
974
+ run: () => string | null | void | Promise<string | null | void>;
975
+ }
976
+ /**
977
+ * The slot fields of `node` whose row the panel shows, in the config's order —
978
+ * THE ONE READER of "does a slot follow its row" (plan 2026-10-23 §6.0, "Batch
979
+ * 3 must do" item 2, GG 2026-10-26). A slot field that carries the shell's
980
+ * show-when rule (`./fields` `fieldIsShown`) and reads false for the node's own
981
+ * values is left out: the panel hides that row, so no Layers tree lists blocks
982
+ * the section no longer draws (the Product Grid's hand-picked products once its
983
+ * content is a Category). Nothing is deleted; the blocks come back with the row.
984
+ *
985
+ * Every Layers tree reads it: {@link screenSlotsOf} (the page editor's), the
986
+ * page tree's run with no `slotsOf`, and the one-section editor's. Where a
987
+ * node's children are FOUND — a drop, the address map, dedupe — is still
988
+ * content-tree's `childSlotsOf`, every slot field.
989
+ */
990
+ declare function shownSlotFieldsOf(config: SlotConfigView, node: ScreenNode): string[];
991
+ /** The children a Layers tree lists under `node`: those of its shown slots
992
+ * ({@link shownSlotFieldsOf}), addressed as `childSlotsOf` addresses them. */
993
+ declare function shownChildSlotsOf(config: SlotConfigView, node: ScreenNode): SlotChild[];
994
+ /**
995
+ * The slots of `node` as the screen draws them: the layer's answer
996
+ * (`slotsOf`), else — with no `slotsOf`, or none for this node — the slots
997
+ * {@link shownSlotFieldsOf} answers, in the config's order, none of them a rung.
998
+ */
999
+ declare function screenSlotsOf(rules: ScreenBlockRules, config: SlotConfigView, node: ScreenNode): ReadonlyArray<ScreenSlot>;
1000
+ /** The tier a node is NAMED at: a node at the top of the document is a section,
1001
+ * a node inside another is a block. */
1002
+ type ScreenNodeLevel = "section" | "block";
1003
+ /**
1004
+ * How the layer's blocks are NAMED AND DRAWN in the screen: the tree's rows and
1005
+ * the Add panel's tiles put a word, a glyph and a cover on a block, and which
1006
+ * word and which drawing is known only to the layer that knows every block it
1007
+ * has. The screen is handed a type and asks.
1008
+ *
1009
+ * The same object for the life of a mount, and its two components the same two
1010
+ * functions throughout: the screen renders them as element types, and a type
1011
+ * that changed identity would remount every row and tile that wears one.
1012
+ */
1013
+ interface ScreenBlockLook {
1014
+ /**
1015
+ * What a node of `type` is called at a level, given `base` — the label the
1016
+ * config holds for the type, which is the name of every node the layer does
1017
+ * not name by where it sits.
1018
+ */
1019
+ labelAtLevel: (type: string, level: ScreenNodeLevel, base: string) => string;
1020
+ /** The Add panel's one-line blurb for a section, by type. A type with none
1021
+ * has no entry. */
1022
+ descriptions: Record<string, string>;
1023
+ /** The Add panel's short heading for a group of sections, by the group's
1024
+ * key, where the layer has one; undefined, and the registry's own title for
1025
+ * the group is its heading. */
1026
+ categoryLabel: (id: string) => string | undefined;
1027
+ /** The blank section: the Add panel offers it first in its own group, with
1028
+ * the ungrouped blocks after it, and the blocks it takes (and they take)
1029
+ * are the blocks Add offers beyond the catalogue (11.0.0). Null: every
1030
+ * section stands in its group in the catalogue's order, and the blocks are
1031
+ * what every section takes. */
1032
+ firstSection: string | null;
1033
+ /**
1034
+ * What the row of a block says when the block is named by its own content
1035
+ * and not by the slot-child rule (lib/document/slot-child-name): the layer reads
1036
+ * the content, and `compLabel` — the config's label for a type, lent by the
1037
+ * screen — is the word for a block it has no rule for.
1038
+ */
1039
+ blockRowName: (child: {
1040
+ type: string;
1041
+ props: Record<string, unknown>;
1042
+ }, compLabel: (type: string) => string) => string;
1043
+ /**
1044
+ * The plain words of a block's stored copy, every mark of the layer's markup
1045
+ * unwrapped: what a tree row prints of a name the author typed, where no mark
1046
+ * can be drawn (lib/document/slot-child-name `slotChildRowName`). Which marks
1047
+ * there are is the layer's grammar — a website's is not an email's.
1048
+ */
1049
+ plainText: (copy: string) => string;
1050
+ /** The glyph of a block or section type, as a tree row and a block tile wear
1051
+ * it. */
1052
+ Icon: ComponentType<{
1053
+ type: string;
1054
+ size?: number;
1055
+ className?: string;
1056
+ }>;
1057
+ /** The cover picture of a section type, filling the Add panel's card — or
1058
+ * of a preset row, asked with the preset's key (`presets`). */
1059
+ Thumbnail: ComponentType<{
1060
+ type: string;
1061
+ }>;
1062
+ /**
1063
+ * ADD ROWS THAT ARE PRESETS, NOT BLOCK TYPES (GG ruling 2026-10-30, owner
1064
+ * item C36): each with its own key, label, group, blurb and cover, and an
1065
+ * `insert` that builds the node it lays down, in one step. Searched,
1066
+ * pressed after a ➕ and dragged like a section's row; it goes in the page's
1067
+ * own list only. Absent: every row is a block type, as before
1068
+ * (lib/document/palette-sections `PalettePreset`).
1069
+ */
1070
+ presets?: readonly PalettePreset[];
1071
+ /**
1072
+ * The products a row may be named after when its block holds only a
1073
+ * product's handle: null until they arrive, and for good when there are
1074
+ * none. A HOOK — the one member here that is — called once per render where
1075
+ * the screen read the products itself, so its effect keeps its place.
1076
+ */
1077
+ useProducts: () => readonly HostProduct[] | null;
1078
+ /**
1079
+ * THE LAYER'S LAST WORD ON WHAT A LAYERS ROW SAYS (0.103.0): handed a node,
1080
+ * the level it is named at and `fallback` — what the screen's own naming
1081
+ * rule answered (lib/document/slot-child-name: a name the node carries, else its
1082
+ * type's label; a pinned row's word) — it answers the row's name. Asked of
1083
+ * every node row the page screen's Layers tree draws, and of the menu's
1084
+ * Select layer flyout, a block's canvas handle and a section's own list of
1085
+ * its children in the inspector, which say the same words. The campaign
1086
+ * designer's rows read its own labels ("Section 2", "Header"). Absent: the
1087
+ * screen's rule, as it named every row.
1088
+ */
1089
+ rowName?: (node: ScreenNode, level: ScreenNodeLevel, fallback: string) => string;
1090
+ /**
1091
+ * THE PROP A RENAME WRITES, by the layer (0.105.0; owner ruling R11, Victor
1092
+ * Mau, 2026-10-09: Rename works on top-level sections in both editors). The
1093
+ * write side of `rowName`: handed a node, the level it is named at and
1094
+ * `base` — what the screen's own rule answered (lib/document/slot-child-name
1095
+ * `slotChildRenameProp` for a block, `sectionRenameProp` for a section) — it
1096
+ * answers the prop the Layers row's rename box writes, or null for a node
1097
+ * that has no name of its own, which takes Rename out of its menu. Answer the
1098
+ * prop `rowName` reads, so a renamed row says its new name: the campaign
1099
+ * designer's sections are named by their `label` ("Section name"). Asked of
1100
+ * every node the menu opens on, a pinned node and a section group's too.
1101
+ * Absent: the screen's rule — a block's declared name, and a section's
1102
+ * `name`, which its row reads.
1103
+ */
1104
+ renamePropOf?: (node: ScreenNode, level: ScreenNodeLevel, base: string | null) => string | null;
1105
+ /**
1106
+ * The quieter words a node row draws after its name (`TreeRow`'s
1107
+ * `preview`): a node's own first words, so a tree of rows all called
1108
+ * "Section" can be told apart by eye. The layer chooses and shortens them;
1109
+ * nothing (null, undefined, "") draws nothing. Absent: no row has any.
1110
+ */
1111
+ rowPreview?: (node: ScreenNode) => string | null | undefined;
1112
+ /**
1113
+ * The small marks a node row draws right after its name (`TreeRow`'s
1114
+ * `marks`): a state the row only SHOWS, such as "Shown on phones only".
1115
+ * Absent, or nothing handed back: no marks.
1116
+ */
1117
+ rowMarks?: (node: ScreenNode) => ReadonlyArray<TreeRowMark> | null | undefined;
1118
+ /**
1119
+ * The layer's own buttons on a node row, by the node and where it sits:
1120
+ * `TreeRowAction`s (efficient-easel/tree), placed between the screen's trash
1121
+ * and its eye — the campaign designer's phone switch. Asked of every node
1122
+ * row, a locked one and a pinned one too, so the layer decides; what comes
1123
+ * back is placed as it is, and nothing draws nothing. A button that writes
1124
+ * renders a component of the layer's that reaches the document itself.
1125
+ * Absent: the screen's two, as it drew them.
1126
+ */
1127
+ rowActions?: (node: ScreenNode, zone: string, index: number) => ReactNode;
1128
+ }
1129
+ /**
1130
+ * THE DEVICES the canvas can be looked at on. That the top bar has a switch,
1131
+ * and that the canvas is fitted to the pane and framed, is the screen's: any
1132
+ * editor's canvas is looked at on more than one. WHICH devices there are, what
1133
+ * each is called and how wide it is drawn is the layer's — a website has three
1134
+ * view tiers where an email has two.
1135
+ *
1136
+ * The same object for the life of a mount: the screen reads the device it
1137
+ * starts on from it once, and draws the switch from it on every render.
1138
+ */
1139
+ interface ScreenDevices {
1140
+ /** What the switch offers, in the order it draws them: an id, a name and a
1141
+ * glyph each (efficient-easel/chrome `DeviceSwitch`). */
1142
+ options: ReadonlyArray<DeviceOption>;
1143
+ /** The device a mount starts on. */
1144
+ initial: string;
1145
+ /**
1146
+ * The ONE device with no width of its own: the canvas draws it at the
1147
+ * pane's width, so it reflows as the pane is dragged, where every other is
1148
+ * a fixed width scaled to fit the pane. Its frame is the plain one; every
1149
+ * other device's wears a class named for its id.
1150
+ */
1151
+ fluid: string;
1152
+ /** The width each device is drawn at, in CSS px, by id. For `fluid` it is
1153
+ * only the width of the frame before the pane has been measured. */
1154
+ widths: Readonly<Record<string, number>>;
1155
+ /**
1156
+ * How a fixed device is fitted to the pane (0.105.0). `"fill"`: scaled to
1157
+ * the pane's width, up to twice its size, so a phone reads big and clear in
1158
+ * a wide pane — the website's view tiers. `"shrink"`: scaled DOWN when the
1159
+ * pane is narrower than the device and never up, so a device is drawn at its
1160
+ * real size or smaller — the campaign designer's phone, a mail preview of
1161
+ * the width the recipient's phone has. The fluid device is drawn at the
1162
+ * pane's width either way. Absent: `"fill"`.
1163
+ */
1164
+ fit?: "fill" | "shrink";
1165
+ }
1166
+ /**
1167
+ * WHAT A DRAG ON THE PAGE SCREEN CARRIES (0.105.0): a node of the document —
1168
+ * its id, the list it sits in (a zone key, `<parentId>:<slot>`), its index
1169
+ * there and its type — or, with `add`, a NEW one from the Add panel, which
1170
+ * has no place yet. One kind of thing for the ONE drag the Layers tree, the
1171
+ * canvas and the Add panel share, so a block picked up on one lands on
1172
+ * another. A layer's own canvas sources (`ScreenCanvasDrag.model`) carry it
1173
+ * too; a thing of the layer's that is not a node (the campaign designer's
1174
+ * column) is told apart by a `zone` and a `type` of the layer's own — a list
1175
+ * the document has none of, so the screen's writes find no node there and
1176
+ * do nothing, and the Layers tree, which draws no gap in it, takes none. A
1177
+ * layer that offers one answers for it on the canvas (`canDrop`, `drop`,
1178
+ * `pick`).
1179
+ */
1180
+ interface ScreenDragItem {
1181
+ id: string;
1182
+ zone: string;
1183
+ index: number;
1184
+ type: string;
1185
+ add?: AddKey;
1186
+ /** A slot the Layers tree draws as a row of its own (`slotsOf`, a rung),
1187
+ * picked up by its row: `index` is its place in its node's run of rungs. */
1188
+ rung?: {
1189
+ nodeId: string;
1190
+ slot: string;
1191
+ };
1192
+ /** A file carried out of the host's media popup (`ScreenCanvasDrag.media`):
1193
+ * `add` is what it becomes between things, and a drop on a thing that
1194
+ * takes it puts it there instead. */
1195
+ media?: true;
1196
+ }
1197
+ /** A file from the host's media library, dropped on the canvas (harness
1198
+ * UI-20, 2026-10-23), as the host's pick path gave it back (`MediaPlace`):
1199
+ * `url` is what draws. */
1200
+ interface ScreenMediaFile {
1201
+ id: string;
1202
+ url: string;
1203
+ kind: "image" | "video";
1204
+ name: string;
1205
+ }
1206
+ /**
1207
+ * A FILE FROM THE MEDIA POPUP, DROPPED ON THE CANVAS (`ScreenCanvasDrag.media`,
1208
+ * harness UI-20, owner decision Lewis 2026-10-23). The drag is the screen's:
1209
+ * it hears a file carried out of the host's popup, offers the places a new
1210
+ * picture may go — the lines Add's tiles get — and outlines a thing the file
1211
+ * may land ON. What a picture IS in this document is the layer's; what the
1212
+ * file becomes in the host first is the host's (`MediaPanelProvider` `place`,
1213
+ * its pick path: a website copies in a file another website holds).
1214
+ */
1215
+ interface ScreenMediaDrop {
1216
+ /** What a file dropped BETWEEN things becomes: Add's entry for the layer's
1217
+ * picture block, offered at exactly the places Add would offer it. */
1218
+ adds: {
1219
+ kind: "section" | "block";
1220
+ type: string;
1221
+ };
1222
+ /** May a file land ON this node, its picture replaced by it? */
1223
+ takes: (node: ScreenNode) => boolean;
1224
+ /** The node's props with the file as its picture. */
1225
+ replace: (node: ScreenNode, file: ScreenMediaFile) => Record<string, unknown>;
1226
+ /** A new node of `adds` holding the file, for a drop between things, made
1227
+ * with what the screen lends a rule that builds a node (its defaults, its
1228
+ * ids). */
1229
+ create: (file: ScreenMediaFile, maker: ScreenNodeMaker) => ScreenNode;
1230
+ }
1231
+ /**
1232
+ * What the screen tells a layer's canvas drag each time it asks
1233
+ * (`ScreenCanvasDrag`, 0.105.0). Its rules are plain functions, the same for
1234
+ * the life of the mount like the block rules, so what they reason about is
1235
+ * handed to them: the document as it stands, the device the canvas is drawn
1236
+ * as, and — for a drop or a pick that does what the screen's own would not —
1237
+ * the screen's writes and its inspector.
1238
+ */
1239
+ interface ScreenCanvasDragContext {
1240
+ /** The working document (`{ root, content, zones }`), as the store holds it
1241
+ * now: what the measure and the model are of. */
1242
+ data: unknown;
1243
+ /** The device the canvas is drawn as, one of the layer's own
1244
+ * (`ScreenDevices.options`): a phone may stack what a desktop lays across. */
1245
+ device: string;
1246
+ /** The screen's writes (`ScreenDocumentOps`, refused while somebody else
1247
+ * holds the document), for a drop of the layer's own. */
1248
+ ops: ScreenDocumentOps;
1249
+ /** The inspector, for a drop or a pick that opens a panel of the layer's
1250
+ * own on what it moved or named (a column's). */
1251
+ inspector: ScreenInspector;
1252
+ }
1253
+ /**
1254
+ * THE CANVAS DRAG, AS A LAYER HAS IT (`ScreenParts.canvasDrag`, 0.105.0).
1255
+ * That there is a drag on the canvas — the handle on the smallest box under
1256
+ * the pointer, the one drop line, the catch surface, the session it shares
1257
+ * with the Layers tree and the Add panel — is the screen's
1258
+ * (efficient-easel/drag `CanvasDragLayer`). How the canvas is MEASURED, what
1259
+ * may be picked up on it and what may land where on it may be the layer's: an
1260
+ * email lays its sections out in columns, measured from cells of its own, and
1261
+ * a column is grabbed by a strip down its edge that is the column's and not its
1262
+ * blocks'.
1263
+ *
1264
+ * Each member is optional and falls back on the screen's own; each is handed
1265
+ * the screen's own answer (`base`) as well, so a layer may add to it, narrow it
1266
+ * or answer only for what is its own and leave the rest to the screen. They
1267
+ * answer for the canvas only: a drop on the Layers tree is the tree's rules',
1268
+ * whatever surface the thing was picked up on.
1269
+ *
1270
+ * Plain functions, the same object for the life of the mount, like the block
1271
+ * rules; what they reason about is handed to them (`ScreenCanvasDragContext`).
1272
+ */
1273
+ interface ScreenCanvasDrag {
1274
+ /** How the canvas is measured into boxes, in the coordinates of `layer`
1275
+ * (the element the drag layer draws in). Absent: the old library's markers, the slots
1276
+ * and the blocks directly in them (efficient-easel/drag `measureCanvas`). */
1277
+ measure?: (canvas: CanvasTarget, layer: Element, context: ScreenCanvasDragContext) => MeasuredCanvas;
1278
+ /**
1279
+ * What may be picked up on what was measured, and which lists take drops,
1280
+ * handed the screen's own model of it (`base`: every node but the pinned
1281
+ * ones — asked through `isPinnedFirst` / `isPinnedLast` — a locked block, a
1282
+ * group of sections, and a section with nothing to trade places with). It
1283
+ * is asked of an EMPTY measure too, before the frame is first measured.
1284
+ * Absent: `base`.
1285
+ */
1286
+ model?: (measured: MeasuredCanvas, base: CanvasDragModel<ScreenDragItem>, context: ScreenCanvasDragContext) => CanvasDragModel<ScreenDragItem>;
1287
+ /** May the thing in hand land at `to` on the canvas? Handed the screen's
1288
+ * own rule (`base`, the Layers tree's). Absent: `base`. */
1289
+ canDrop?: (item: ScreenDragItem, to: Place, base: (item: ScreenDragItem, to: Place) => boolean, context: ScreenCanvasDragContext) => boolean;
1290
+ /** Land it, at a place `canDrop` said yes to. Handed the screen's own write
1291
+ * (`base`, the tree's: a section moved, a block moved, a new one added).
1292
+ * Absent: `base`. */
1293
+ drop?: (item: ScreenDragItem, to: Place, base: (item: ScreenDragItem, to: Place) => void, context: ScreenCanvasDragContext) => void;
1294
+ /** A handle CLICKED, not dragged: select what it names. Handed the screen's
1295
+ * own (`base`: the node, as a press on its row selects it). Absent: `base`. */
1296
+ pick?: (item: ScreenDragItem, base: (item: ScreenDragItem) => void, context: ScreenCanvasDragContext) => void;
1297
+ /** A file carried out of the host's media popup lands on the canvas
1298
+ * (`ScreenMediaDrop`). Absent: the canvas takes no such file. */
1299
+ media?: ScreenMediaDrop;
1300
+ }
1301
+ /** What a layer's head over the canvas is handed (`ScreenParts.CanvasHead`,
1302
+ * 0.105.0): the device the canvas is drawn as, so it can say what is the
1303
+ * device's (the campaign designer's mail-app switch is desktop's only). */
1304
+ interface ScreenCanvasHeadProps {
1305
+ device: string;
1306
+ }
1307
+ /**
1308
+ * WHAT IS PINNED in the document's top-level list. That the list has a BAND
1309
+ * its sections keep to — one node pinned ahead of it at most, and one behind —
1310
+ * is the screen's: where a new section lands, where a dragged one may be put
1311
+ * down, which nodes the canvas offers a handle on and what the menu withholds
1312
+ * are all read off that band, and the arithmetic of it is written once, in the
1313
+ * screen. WHICH types are pinned is the layer's: a website pins its Header
1314
+ * first and its Footer last, where an email pins nothing.
1315
+ *
1316
+ * And the layer's GROUPS OF SECTIONS, if it has them: a pinned top-level node
1317
+ * whose one list holds ordinary sections, which move among the groups' lists
1318
+ * and nowhere else. The screen draws a group's row and keeps its sections to
1319
+ * those lists; which types are groups, and what a group's list is keyed by,
1320
+ * it asks.
1321
+ *
1322
+ * And THE PANEL A PINNED NODE IS EDITED IN, where that is not the selection's
1323
+ * own: a node the layer pins may carry no fields, the layer keeping its
1324
+ * settings and showing them in a panel of the layer's. Which node, and which
1325
+ * panel, is the layer's to say; the screen asks by type where a node is
1326
+ * selected and where a pinned node's row is pressed, and shows what it is
1327
+ * handed.
1328
+ *
1329
+ * And HOW THE LAYERS TREE FRAMES THEM (0.103.0): which node is pinned where it
1330
+ * is not one type (`isFirst`, `isLast` — the campaign designer's Header and
1331
+ * Footer are both sections, told apart by a prop), how the first one's row is
1332
+ * drawn (`firstRow`) and what the band of sections between them looks like
1333
+ * (`band`). Each is optional, and its default is the tree the website has.
1334
+ *
1335
+ * The same object for the life of a mount, its functions plain functions of
1336
+ * what they are passed: the screen reads it anywhere, inside the callbacks and
1337
+ * effects it does not rebuild for it.
1338
+ */
1339
+ interface ScreenPinnedNodes {
1340
+ /** The type of the node pinned FIRST: the band starts after it. Null when
1341
+ * the layer pins none. */
1342
+ first: string | null;
1343
+ /** The type of the node pinned LAST: the band ends at it. */
1344
+ last: string | null;
1345
+ /**
1346
+ * Is this top-level node the one pinned first (0.103.0)? Where every node
1347
+ * of the pinned type is not pinned — the campaign designer's Header is an
1348
+ * `EmailSection` with `_region: "header"`, beside body sections of the same
1349
+ * type — the layer says which. The page screen asks it wherever it tested
1350
+ * a node against `first`: the band, the tree, the canvas handles, the menu.
1351
+ * (The section screen, which holds one node, still asks the type.) The
1352
+ * first node that answers yes is the one. Absent: a node of type `first`.
1353
+ */
1354
+ isFirst?: (node: ScreenNode) => boolean;
1355
+ /** …and the one pinned last (the Footer). Absent: a node of type `last`. */
1356
+ isLast?: (node: ScreenNode) => boolean;
1357
+ /**
1358
+ * May a block cross into and out of the node pinned LAST (0.106.0) — dragged
1359
+ * in the Layers tree or on the canvas, or pasted? Absent or false, the
1360
+ * website's Footer: its blocks reorder within their own slot and nothing
1361
+ * from the page's sections lands in it, nor leaves it. True, the campaign
1362
+ * designer's Footer, a section whose columns hold any block: its slots are
1363
+ * lists like every other's, asked what they take (the slot's own list, the
1364
+ * depth, never into itself). The node itself stays pinned either way.
1365
+ */
1366
+ lastIsOpen?: boolean;
1367
+ /**
1368
+ * How the Layers tree draws the node pinned first (0.103.0). `"panel"`: a
1369
+ * row of its own that opens the layer's panel for it (`panelOf`), drawn
1370
+ * whether or not the document holds the node, and none of its children —
1371
+ * the website's Header, whose settings are a panel. `"node"`: the node
1372
+ * itself, selected by its row and folding open into its children, exactly
1373
+ * as the node pinned last is drawn — the campaign designer's Header, a
1374
+ * section with blocks in it. Absent: `"panel"`.
1375
+ */
1376
+ firstRow?: "panel" | "node";
1377
+ /** What the band of sections between the two pins looks like in the tree
1378
+ * (0.103.0). Absent: a group label in the screen's words, the sections at
1379
+ * the tree's own depth, and no row after them. */
1380
+ band?: ScreenPinnedBand;
1381
+ /**
1382
+ * HEADER AND FOOTER EDITED IN PLACE (8.2.0, owner 2026-10-15). The words of
1383
+ * the canvas TAB on a pinned node — "Header · on every page" — or null for
1384
+ * a node that has none. Asked of each node pinned first or last and of each
1385
+ * group of sections. The screen draws the tab on the band's top edge while
1386
+ * the pointer is anywhere in it or anything in it is selected, at its true
1387
+ * size whatever the device is scaled by, kept inside the canvas when the
1388
+ * band starts above it; a click on the tab selects the band. Handing it
1389
+ * also makes a group of sections NO STEP of the canvas's click-through
1390
+ * chain: a click inside walks from the group's sections in, as on the page.
1391
+ * Absent: no tab, and the click chain as it was.
1392
+ */
1393
+ groupTab?: (node: ScreenNode) => string | null;
1394
+ /**
1395
+ * …the badge on the Layers row of each pinned node and group ("Every
1396
+ * page"). Handing it draws the in-place tree: the header and footer are
1397
+ * their own rows, with no "Header" / "Footer" group labels over them, and
1398
+ * no row that opens the footer somewhere else. Hidden while the left panel
1399
+ * is narrower than 240px, where the name needs the room. Absent: the tree
1400
+ * as it was.
1401
+ */
1402
+ groupBadge?: string;
1403
+ /**
1404
+ * SHARED, AND HOW FAR (Shared section design v4, Lewis 2026-10-21): how far
1405
+ * a top-level node reaches when many pages use it live — "On every page",
1406
+ * "On 3 pages" — or null for a node that is this page's own. Asked of each
1407
+ * top-level node, the header and footer and their groups included. For a
1408
+ * node it answers, the screen draws ONE look, green with the shell's
1409
+ * `shared` mark, colour never alone:
1410
+ * · its Layers row in the shell's shared tone, the mark at the row's end
1411
+ * and these words in the mark's Tooltip — in place of `groupBadge`;
1412
+ * · its canvas tab, while it or anything in it is selected or under the
1413
+ * pointer: the green badge with the mark and the row's name, these words
1414
+ * in the tab's Tooltip — in place of `groupTab`'s words;
1415
+ * · its selected and hover outline on the canvas in green
1416
+ * (`CanvasSharedContext`).
1417
+ * `groupTab` and `groupBadge` still say what they switch (the in-place tree,
1418
+ * the click chain). Absent: nothing is shared, and the screen is as it was.
1419
+ */
1420
+ sharedReach?: (node: ScreenNode) => string | null;
1421
+ /**
1422
+ * …and the DOCUMENT'S HALF of a shared section (Shared section design v4,
1423
+ * Lewis 2026-10-21): the layer holds which top-level nodes are shared
1424
+ * sections, and how a page's document stores them (a reference in its top
1425
+ * level, the section in a document of its own). The screen draws the rows
1426
+ * and asks the store (lib/shared-sections); what changes in the document is
1427
+ * asked here. Handed with a store (`SessionBackend.sharedSections`), the
1428
+ * screen offers:
1429
+ * · a page's own section's menu: Make shared — a name asked in a dialog,
1430
+ * the store makes the shared section, `adopt` takes the node in;
1431
+ * · a shared section's menu: On N pages ▸ (`usedOn`, a press `openPage`),
1432
+ * Detach from shared (`detach`), and Remove from this page in place of
1433
+ * Delete, its Layers trash saying so too;
1434
+ * · Add's "Shared sections" group above "Your templates": a card puts
1435
+ * `nodeOf` on the page (a reference, never a copy), and the card's menu
1436
+ * deletes the shared section (`removed`).
1437
+ * Absent: none of these. The header and footer are shared (`sharedReach`)
1438
+ * but answer `usedOn` with null: they keep the menu they have.
1439
+ */
1440
+ shared?: ScreenSharedSections;
1441
+ /**
1442
+ * …what the screen says ONCE per editing session (the easel session), the
1443
+ * first time an edit changes a pinned node or a group of sections: the
1444
+ * shell's toast, with Undo ("Changed on every page"). A seed, a load or an
1445
+ * undo says nothing. Absent: nothing is said.
1446
+ */
1447
+ changeNotice?: string;
1448
+ /**
1449
+ * WHAT A GROUP OF SECTIONS TAKES (8.3.0): may a section of `sectionType` go
1450
+ * into a group of `groupType` that holds `countNow` sections BEFORE it goes
1451
+ * in? Asked of every way a section arrives in a group: a new one from Add (a
1452
+ * click on a tile, a drag of one, and which tiles Add shows), a section dragged
1453
+ * there from the other group, and a paste. A section moved within its own group
1454
+ * is not asked: nothing arrives. The website's header takes up to 3 light
1455
+ * sections and its footer up to 6. Absent: a group takes any section, as before.
1456
+ */
1457
+ groupAccepts?: (groupType: string, sectionType: string, countNow: number) => boolean;
1458
+ /** The type of the group of sections pinned first, ahead of everything. */
1459
+ firstGroup: string | null;
1460
+ /** …and of the one pinned last. */
1461
+ lastGroup: string | null;
1462
+ /** Is a node of this type a group of sections? */
1463
+ isSectionGroup: (type: string | undefined) => boolean;
1464
+ /** The key of the list a group keeps its sections in, by the group's id. */
1465
+ sectionGroupZone: (groupId: string) => string;
1466
+ /**
1467
+ * The panel of the layer's own that a node of this type is edited in, or
1468
+ * null: the node is edited by its own fields, in the selection's own panel
1469
+ * (`SELECTION_MODE`). What comes back is what the screen stores, so it is
1470
+ * the SAME object every time the same type is asked about. Asked with no
1471
+ * type where nothing is selected, and answered null.
1472
+ */
1473
+ panelOf: (type: string | null | undefined) => ScreenInspectorMode | null;
1474
+ }
1475
+ /**
1476
+ * THE BAND, AS THE LAYERS TREE FRAMES IT (`ScreenPinnedNodes.band`, 0.103.0):
1477
+ * the sections between the two pins. Where the band starts and ends is the
1478
+ * screen's arithmetic either way; this is only how it is drawn.
1479
+ */
1480
+ interface ScreenPinnedBand {
1481
+ /** What the band is called. Absent: the screen's words, `screen.pageSections`
1482
+ * ("Page") on a document with the edit guard and
1483
+ * `screen.templateSections` ("Template") on one without. */
1484
+ label?: string;
1485
+ /** The band is a ROW that folds, its sections under it — the campaign
1486
+ * designer's Body. Absent or false: a group label over the sections, which
1487
+ * sit at the tree's own depth. */
1488
+ foldable?: boolean;
1489
+ }
1490
+ /** Is `node` the one the layer pins FIRST — its own test (`isFirst`), else a
1491
+ * node of the `first` type, the test the screen has always made. */
1492
+ declare function isPinnedFirst(pinned: ScreenPinnedNodes, node: ScreenNode): boolean;
1493
+ /** …and LAST (`isLast`, else a node of the `last` type). */
1494
+ declare function isPinnedLast(pinned: ScreenPinnedNodes, node: ScreenNode): boolean;
1495
+ /**
1496
+ * THE VIEW THE LEFT PANEL IS ON, from one mount to the next. That the panel
1497
+ * has views, that one of them is current and that the choice is kept is the
1498
+ * screen's: it holds the view in state and mirrors it from ONE effect, the
1499
+ * only writer. WHERE it is kept, which view a first mount opens on and what a
1500
+ * selection does to it are the layer's — a website opens on its page list,
1501
+ * and keeps the choice under a key of its own.
1502
+ *
1503
+ * The same object for the life of a mount: the screen seeds its state from
1504
+ * `read` once, and calls the other two from an effect and a callback it does
1505
+ * not rebuild for them.
1506
+ */
1507
+ interface ScreenLeftViewRules {
1508
+ /** The view a mount opens on: the one kept, or the layer's first. */
1509
+ read: () => string;
1510
+ /** Keep the view for the next mount. */
1511
+ write: (view: string) => void;
1512
+ /** What a change of the selection does to the view: handed the id of the
1513
+ * node selected, if one is, and the view the panel is on, it answers the
1514
+ * view to be on. */
1515
+ forSelection: (selectedId: string | null | undefined, current: string) => string;
1516
+ }
1517
+ /** What a style clipboard's scope is read off (`ScreenStyleClipboard.scope`):
1518
+ * the document the screen has open. */
1519
+ interface ScreenStyleDocument {
1520
+ /** What the screen is pointed at: a website's page, or a host's own
1521
+ * document (`{ kind: "document", record }`). */
1522
+ target: AnyScreenTarget;
1523
+ /** The website the page belongs to, or null. */
1524
+ siteId: string | null;
1525
+ /** The backend's id of the loaded document, or null while it loads. */
1526
+ docId: string | null;
1527
+ }
1528
+ /** What a Paste style onto one node would do: its new props, whether they
1529
+ * changed, how many rows were pasted, and the words the merchant reads. */
1530
+ interface ScreenStylePastePlan {
1531
+ props: Record<string, unknown>;
1532
+ changed: boolean;
1533
+ pasted: number;
1534
+ message: string;
1535
+ }
1536
+ /**
1537
+ * COPY STYLE / PASTE STYLE, where it is the layer's (0.105.0, seam E10). The
1538
+ * clipboard, the matching rule, the menu rows, their words and the ⌥⌘C / ⌥⌘V
1539
+ * keys are efficient-easel/style-clipboard's and the screen's; WHICH rows of a
1540
+ * node are its look, and how far a copied look travels (its scope), are the
1541
+ * layer's — the website's look is its Style and Layout tabs and travels across
1542
+ * one site's pages, the campaign designer's is its own panels' and stays in
1543
+ * one campaign. Each member is optional, and one left out is the website's
1544
+ * (lib/document/style-clipboard): a layer may hand only its scope. Plain functions,
1545
+ * the same object for the life of the mount.
1546
+ */
1547
+ interface ScreenStyleClipboard {
1548
+ /** The clipboard's scope for the open document: in another scope nothing is
1549
+ * held. Absent: `siteStyleScope(siteId)`, one site across its pages. */
1550
+ scope?: (doc: ScreenStyleDocument) => string;
1551
+ /** A node's look, as rows the clipboard holds and matches. Absent: the
1552
+ * website's (`nodeStyleRows`), the Style and Layout tabs. */
1553
+ rows?: (config: unknown, node: ScreenNode) => StyleRow[];
1554
+ /** Copy a node's look into `scope`, named `label` (the menu's word for it).
1555
+ * Absent: its `rows`, copied as they are stored. */
1556
+ copy?: (scope: string, node: ScreenNode, label: string, config: unknown) => void;
1557
+ /** What a paste onto a node would do, or null when nothing is held in
1558
+ * `scope`. The screen writes `props` through its one replace op when
1559
+ * `changed`, and always shows `message`. Absent: the held look laid over the
1560
+ * node's `rows` (efficient-easel/style-clipboard `planPaste`). */
1561
+ plan?: (scope: string, node: ScreenNode, label: string, config: unknown) => ScreenStylePastePlan | null;
1562
+ }
1563
+ interface ScreenParts {
1564
+ /**
1565
+ * The name a panel's head gives what is being edited — the website's name,
1566
+ * a campaign's — as the hook the head calls, through `useScreenOwnerName`.
1567
+ */
1568
+ useOwnerName?: () => string;
1569
+ /**
1570
+ * The Layers head's context line — what the open document is, under the
1571
+ * word "Layers" — as the hook the head calls (0.103.0). The campaign
1572
+ * designer's names the campaign and its variant. Absent: the document's
1573
+ * address, `/${slug}`, as the website's head has always said it.
1574
+ */
1575
+ useDocumentLabel?: () => string;
1576
+ /**
1577
+ * The layer's wiring between the inspector and what the layer draws in the
1578
+ * canvas, as ONE hook the screen calls where it used to hold that wiring: a
1579
+ * click on the layer's furniture in the canvas opens its panel, and the open
1580
+ * panel outlines the furniture. And its wiring for the parts of one block
1581
+ * that are not nodes: what selecting one does, and the rows it has in the
1582
+ * tree. And its own controls in the top bar, with whatever they run on. And
1583
+ * its buttons in the rail, with the views of the left panel they open.
1584
+ */
1585
+ useBridges?: (inspector: ScreenInspector, tree: ScreenTree, canvas: ScreenCanvas, left: ScreenLeftPanel) => ScreenBridges;
1586
+ /**
1587
+ * The same, for the screen that holds ONE node as its whole document
1588
+ * (SectionScreenShell). A hook of its own and not `useBridges` with less
1589
+ * handed in: that screen wired less — no site-wide furniture, no tree of
1590
+ * sections — and a hook cannot leave out half of itself by what it is
1591
+ * passed.
1592
+ */
1593
+ useStandaloneBridges?: (inspector: ScreenInspector) => ScreenBridges;
1594
+ /**
1595
+ * The layer's own pass over a document as it opens: what it lays down in one
1596
+ * that lacks it, and takes out of one that holds it twice. A hook of its own
1597
+ * and not one more thing the bridges run, because of WHERE it must run: the
1598
+ * bridges stand early among the screen's hooks, and this pass writes the
1599
+ * document, so it is called LAST of the screen's own passes over it — after
1600
+ * the slot seeding and the duplicate-id heal, which address top-level nodes
1601
+ * by index and would be thrown out by a node laid down ahead of them. Lent
1602
+ * the screen's writes and the config it holds, for the engine's node maker.
1603
+ */
1604
+ useDocumentPass?: (ops: ScreenDocumentOps, config: unknown) => void;
1605
+ /**
1606
+ * The layer's block rules. Handed here and NOT registered at import: what a
1607
+ * registry holds depends on which modules have loaded, and that order is not
1608
+ * the same in the app and in a script that loads one file, so a rule could
1609
+ * answer in one and be absent in the other.
1610
+ */
1611
+ blockRules?: ScreenBlockRules;
1612
+ /** How the layer's blocks are named and drawn. Handed here for the reason
1613
+ * the rules are. */
1614
+ blockLook?: ScreenBlockLook;
1615
+ /** The devices the layer's canvas is looked at on. Data, and handed here
1616
+ * for the reason the rules are. */
1617
+ devices?: ScreenDevices;
1618
+ /** Where the left panel's view is kept, and which one a mount opens on.
1619
+ * Plain functions, and handed here for the reason the rules are. */
1620
+ leftView?: ScreenLeftViewRules;
1621
+ /** Which node types are pinned in the top-level list, which are groups of
1622
+ * sections, and which are edited in a panel of the layer's. Data and three
1623
+ * plain functions, and handed here for the reason the rules are. */
1624
+ pinned?: ScreenPinnedNodes;
1625
+ /**
1626
+ * May the operator pause the autosave (0.103.0)? Since 8.0.0 the switch is
1627
+ * the save menu's Auto-save check box (the main button's ▾), where it was
1628
+ * the save pill; a layer whose editor always saves says false, and the menu
1629
+ * offers Save now alone. "Retry now" stays after a failed save either way.
1630
+ * Absent, true: the switch, as both editors have it.
1631
+ */
1632
+ saveSwitch?: boolean;
1633
+ /**
1634
+ * Does a field's media pick give way to a change of selection (0.103.0)? A
1635
+ * field of the selected block asks the host's panel to choose (lib/
1636
+ * media-panel); with true, selecting another block, or none, while it waits
1637
+ * leaves pick mode and settles the field with null, as Cancel would — the
1638
+ * campaign designer's picker belongs to the block it was opened for. Absent,
1639
+ * false: a pick outlives a change of selection, as the website's does.
1640
+ */
1641
+ pickFollowsSelection?: boolean;
1642
+ /**
1643
+ * WHERE A PERSON'S PANEL WIDTHS AND TREE FOLDS ARE KEPT (0.106.0): the
1644
+ * first part of the two `localStorage` keys, `<namespace>-panel-widths` and
1645
+ * `<namespace>-collapsed-sections`, so an editor beside the website's keeps
1646
+ * its own — the campaign designer's panels and folds are not the website
1647
+ * editor's. Read once, as the screen mounts. Absent (or empty): the website
1648
+ * editor's keys, `sf-editor-panel-widths` and
1649
+ * `sf-editor-collapsed-sections`, so a website's layout is what it was.
1650
+ */
1651
+ storageNamespace?: string;
1652
+ /** Copy style / Paste style's scope and a node's look, where they are the
1653
+ * layer's (0.105.0; `ScreenStyleClipboard`). Absent: the website's. */
1654
+ styleClipboard?: ScreenStyleClipboard;
1655
+ /**
1656
+ * Do ⌘C / ⌘X / ⌘V (Ctrl on Windows) copy, cut and paste the SELECTED block
1657
+ * (0.105.0)? The keyboard door to the menu's Copy, Cut and Paste rows, which
1658
+ * print these keys beside them: the menu's rules, the menu's place for a
1659
+ * paste, and a paste with nowhere to go there refused aloud
1660
+ * (`screen.pasteRefused`). Heard on the editor and in the canvas frame, never
1661
+ * where a person types or has words selected, nor with ⌥ (Copy style) or ⇧
1662
+ * held. Nothing is cut or pasted on a document this editor cannot write; a
1663
+ * copy is allowed there.
1664
+ *
1665
+ * Owner ruling R12/R13 (Victor Mau, 2026-10-09): Copy and Paste work the same
1666
+ * way in both editors. So the keys are on unless the layer says false.
1667
+ */
1668
+ nodeKeys?: boolean;
1669
+ /**
1670
+ * THE HOST'S OWN TOASTS (0.105.0; owner ruling R17, Victor Mau, 2026-10-09).
1671
+ * Every line the screen would say in its toast — "Copied Text", "Added
1672
+ * “Hero” section", a refused paste, a pasted style, what a panel of the
1673
+ * layer's or the inspector says through the screen's toast — goes to the host
1674
+ * instead, with its tone: `"error"` for what went wrong, `"info"` for the
1675
+ * rest; and the screen draws no toast of its own. The campaign designer
1676
+ * hands the admin portal's toast, so the designer's lines stand where every
1677
+ * other window's do. Called as each line is said, so it may change between
1678
+ * renders. Absent: the shell's `toast` (efficient-shell/ui, harness UI-24;
1679
+ * up to 0.106.0 the screen drew a toast of its own, `.sf-toast`).
1680
+ */
1681
+ notify?: (message: string, tone: "info" | "error", extra?: ScreenToastExtra) => void;
1682
+ /**
1683
+ * THE CANVAS the screen frames: the engine's, as the layer dresses it — the
1684
+ * layer's own sheet and theme in the frame, its own say over the outline
1685
+ * round a block. The screen places it in the pane it has measured, hands it
1686
+ * nothing, and remounts it by key to rebuild the frame; where the frame
1687
+ * stands, how it is fitted and what is laid over it are the screen's.
1688
+ *
1689
+ * ONE function for the life of a mount: the screen renders it as an element
1690
+ * type, and a type that changed identity would remount the whole canvas.
1691
+ *
1692
+ * The frame it draws is published to it, and to the head over it
1693
+ * (`CanvasHead`), as the screen found it: `useScreenCanvasTarget()`.
1694
+ */
1695
+ Canvas?: ComponentType;
1696
+ /**
1697
+ * A HEAD OVER THE CANVAS (0.105.0): the layer's own row above the frame, in
1698
+ * the canvas's well and at its own size — never scaled with a device — such
1699
+ * as the campaign designer's Subject line, its mail-app switch and its dark
1700
+ * mail app's bar, which sit above the email the way an inbox shows them. The
1701
+ * frame fills what is left of the well under it, and is fitted to that. It is
1702
+ * handed the device the canvas is drawn as. Absent: nothing is drawn above
1703
+ * the frame, and the frame fills the well.
1704
+ *
1705
+ * ONE function for the life of a mount, for the reason `Canvas` is.
1706
+ */
1707
+ CanvasHead?: ComponentType<ScreenCanvasHeadProps>;
1708
+ /**
1709
+ * The canvas drag's measure, model and rules, where they are the layer's
1710
+ * (0.105.0; `ScreenCanvasDrag`). Each member absent, and the whole object
1711
+ * absent, is the screen's own: the old library's markers, every node but the pinned
1712
+ * ones, the Layers tree's rules. Plain functions, and handed here for the
1713
+ * reason the rules are.
1714
+ */
1715
+ canvasDrag?: ScreenCanvasDrag;
1716
+ /**
1717
+ * THE INSPECTOR the screen mounts in its right panel: the panel of whatever
1718
+ * is selected and, in its place, each panel of the layer's own — frame, head
1719
+ * and body, since the screen draws nothing round it. The screen holds WHICH
1720
+ * panel is showing and hands it over (`mode`), with the ways out of a panel
1721
+ * and its own toast and Hide button; what a mode draws is the layer's.
1722
+ *
1723
+ * ONE function for the life of a mount: the screen renders it as an element
1724
+ * type, and a type that changed identity would remount the panel and drop
1725
+ * what a merchant has open in it.
1726
+ */
1727
+ Inspector?: ComponentType<ScreenInspectorPanelProps>;
1728
+ }
1729
+ declare function ScreenPartsProvider({ parts, children }: {
1730
+ parts: ScreenParts;
1731
+ children?: ReactNode;
1732
+ }): react.JSX.Element;
1733
+ /** The layer's parts; none when the screen stands by itself. */
1734
+ declare function useScreenParts(): ScreenParts;
1735
+ /** The layer's bridges, run in the screen. With no layer, nothing runs. */
1736
+ /** The name a panel's head gives what is being edited (`useOwnerName`). */
1737
+ declare function useScreenOwnerName(): string;
1738
+ /** The Layers head's context line (`useDocumentLabel`), or null with no
1739
+ * layer's, and the screen says the document's address. */
1740
+ declare function useScreenDocumentLabel(): string | null;
1741
+ declare function useScreenBridges(inspector: ScreenInspector, tree: ScreenTree, canvas: ScreenCanvas, left: ScreenLeftPanel): ScreenBridges;
1742
+ /** The layer's bridges for the screen that holds one node by itself. With no
1743
+ * layer, nothing runs. */
1744
+ declare function useStandaloneScreenBridges(inspector: ScreenInspector): ScreenBridges;
1745
+ /** The layer's pass over a document as it opens, run in the screen. With no
1746
+ * layer, nothing runs. */
1747
+ declare function useScreenDocumentPass(ops: ScreenDocumentOps, config: unknown): void;
1748
+ /** The layer's block rules. With no layer, the rules of an editor that has no
1749
+ * blocks of its own. */
1750
+ declare function useScreenBlockRules(): ScreenBlockRules;
1751
+ /** How the layer's blocks are named and drawn. With no layer, by what the
1752
+ * config says of them and with no drawing. */
1753
+ declare function useScreenBlockLook(): ScreenBlockLook;
1754
+ /** The devices the layer's canvas is looked at on. With no layer, the one that
1755
+ * fills the pane. */
1756
+ declare function useScreenDevices(): ScreenDevices;
1757
+ /** Where the layer keeps the left panel's view. With no layer, nowhere: every
1758
+ * mount opens on the Layers tree. */
1759
+ declare function useScreenLeftView(): ScreenLeftViewRules;
1760
+ /** Which node types the layer pins in the top-level list, and which are its
1761
+ * groups of sections. With no layer, none. */
1762
+ declare function useScreenPinned(): ScreenPinnedNodes;
1763
+ /** Whether the save pill is the autosave's switch. With no layer, it is, as
1764
+ * the screen has always drawn it. */
1765
+ declare function useScreenSaveSwitch(): boolean;
1766
+ /** Leave a field's pick when `selection` changes, if the layer says a pick
1767
+ * follows the selection (`pickFollowsSelection`). With no layer, a pick
1768
+ * outlives a change of selection, as it always has. */
1769
+ declare function useScreenPickFollowsSelection(selection: unknown): void;
1770
+ /** Where widths and folds are kept (`storageNamespace`), or undefined: the
1771
+ * website editor's keys. */
1772
+ declare function useScreenStorageNamespace(): string | undefined;
1773
+ /** The layer's style clipboard (`styleClipboard`), or null: the website's. */
1774
+ declare function useScreenStyleClipboard(): ScreenStyleClipboard | null;
1775
+ /** Whether ⌘C / ⌘X / ⌘V reach the selected block (`nodeKeys`). They do
1776
+ * unless the layer says not (owner ruling R12/R13). */
1777
+ declare function useScreenNodeKeys(): boolean;
1778
+ /** The host's toast (`notify`), or null: with none, the screen says its lines
1779
+ * in its own (R17). */
1780
+ declare function useScreenNotify(): ((message: string, tone: "info" | "error", extra?: ScreenToastExtra) => void) | null;
1781
+ /** The canvas the layer dresses for the screen to frame. With no layer, the
1782
+ * engine's plain one. */
1783
+ declare function useScreenCanvasFrame(): ComponentType;
1784
+ /** The layer's head over the canvas (`CanvasHead`), or null: with no layer's,
1785
+ * nothing is drawn above the frame. */
1786
+ declare function useScreenCanvasHead(): ComponentType<ScreenCanvasHeadProps> | null;
1787
+ /** The layer's canvas drag (`canvasDrag`), or null: with no layer's, every
1788
+ * answer is the screen's own. */
1789
+ declare function useScreenCanvasDrag(): ScreenCanvasDrag | null;
1790
+ /** Publishes the frame the page screen found. The screen's own: it stands round
1791
+ * the chrome, and adds nothing to the page. */
1792
+ declare function ScreenCanvasTargetProvider({ target, children }: {
1793
+ target: CanvasTarget | null;
1794
+ children?: ReactNode;
1795
+ }): react.JSX.Element;
1796
+ /** The canvas frame the page screen found: its frame, document and window, or
1797
+ * null while there is none — and always null outside the page screen (the
1798
+ * section screen watches for no frame). */
1799
+ declare function useScreenCanvasTarget(): CanvasTarget | null;
1800
+ /** The inspector the layer draws for the screen to mount. With no layer, the
1801
+ * engine's plain rows for the selection. */
1802
+ declare function useScreenInspectorPanel(): ComponentType<ScreenInspectorPanelProps>;
1803
+
1804
+ /**
1805
+ * A PALETTE ROW THAT IS A PRESET, NOT A BLOCK TYPE (GG ruling 2026-10-30,
1806
+ * owner item C36). The website's Contact / Locations section is offered as TWO
1807
+ * rows, "City pictures" and "City maps": each lays down its own arrangement of
1808
+ * ordinary blocks, and there is no block type behind either. So a row may be a
1809
+ * preset — its own key, label, group, blurb and cover — and pressing it lays
1810
+ * down what `insert` builds, in ONE insert, so one Undo takes it back (the way
1811
+ * a splittable section's press already lands: `newSectionNode`).
1812
+ *
1813
+ * The layer hands these in (`PaletteLook.presets`); the screen states none.
1814
+ * What the arrangement IS stays where the layer keeps arrangements (the
1815
+ * website: `SECTION_PRESETS`); this says only where the row sits and what it
1816
+ * is called.
1817
+ */
1818
+ interface PalettePreset {
1819
+ /** The row's own key, unique among presets. It names NO block type: a
1820
+ * preset whose key is a registered type is not offered (a type row and a
1821
+ * preset row would be one key with two meanings). The cover is the layer's
1822
+ * `Thumbnail`, asked with this key. */
1823
+ key: string;
1824
+ /** What the row is called. Also what the toast says when it is added. */
1825
+ label: string;
1826
+ /** The key of the category (`config.categories`) it is grouped under. A
1827
+ * category the config does not have, or does not offer, offers no preset. */
1828
+ cat: string;
1829
+ /** The block type in that category the row follows; absent, or not in the
1830
+ * category, and the row closes its group. */
1831
+ after?: string;
1832
+ /** The one-line blurb, shown and searched. */
1833
+ desc?: string;
1834
+ /** More words it is found by, searched but never shown. */
1835
+ alias?: string;
1836
+ /** The node it lays down — one node, slot children inline, every id fresh
1837
+ * from `make.newNodeId` — or null, and nothing is added. Lent the same
1838
+ * four things `newSectionNode` is. */
1839
+ insert: (make: ScreenNodeMaker) => ScreenNewNode | null;
1840
+ }
1841
+ /** One offerable section, with the category it is grouped under. */
1842
+ type PaletteSection = {
1843
+ /** The block type — or, on a preset row, the preset's key (`preset`). */
1844
+ type: string;
1845
+ cat: string;
1846
+ name: string;
1847
+ desc: string;
1848
+ /**
1849
+ * The heading of the category this section sits under, resolved once at build
1850
+ * time — SEARCHED, and already SHOWN as the nav row this card sits beneath.
1851
+ *
1852
+ * ⚠️ IT IS HERE BECAUSE THE NAV AND THE SEARCH DISAGREED. Seven of the
1853
+ * thirteen category names returned NOTHING when typed: "Blog & journal" reads
1854
+ * 5 in the nav, and "blog" found 0, because not one of Issue Header, Featured
1855
+ * Cover, Article Text, Recurring Columns or Latest Posts carries the word. Same
1856
+ * for shop, about, promotions, navigation, legal and layout. A merchant reads
1857
+ * the word off the screen, types it, and is told no section matches.
1858
+ *
1859
+ * Resolved HERE, not in `matchesQuery`, because the label needs the `config`
1860
+ * (`categoryLabel`) and the matcher is given only a section — passing config
1861
+ * into the matcher would make every caller carry it.
1862
+ */
1863
+ catLabel: string;
1864
+ /**
1865
+ * Another word this section is known by, searched but never shown.
1866
+ *
1867
+ * ⚠️ THIS EXISTS FOR ONE NODE AND ONE REASON. `Flex` is offered here as
1868
+ * "Blank section" and is called "Box" everywhere it is nested — so a merchant
1869
+ * who met it in a Layers row, or in last week's handoff, types "box" and must
1870
+ * still find it. Without this they would find NOTHING: the card is pinned out
1871
+ * of its group, so a search that misses it misses it completely.
1872
+ */
1873
+ alias?: string;
1874
+ /** Set on a PRESET row only: the preset it lays down. Absent on every
1875
+ * type row, so a type row is the row it always was. */
1876
+ preset?: PalettePreset;
1877
+ };
1878
+ /**
1879
+ * What the layer says of its sections for the palette: the word for a type at
1880
+ * a level, a group's short heading where it has one, and the blurbs. The
1881
+ * screen's `blockLook` is one (lib/screen-parts); so is the website's own
1882
+ * (lib/document/add-palette).
1883
+ */
1884
+ interface PaletteLook {
1885
+ /** What a node of `type` is called at a level, given the label the config
1886
+ * holds for it. */
1887
+ labelAtLevel: (type: string, level: "section" | "block", base: string) => string;
1888
+ /** A group's short heading, by its key, where the layer has one; undefined,
1889
+ * and the config's own title is the heading. */
1890
+ categoryLabel: (id: string) => string | undefined;
1891
+ /** The one-line blurb for a section, by type. */
1892
+ descriptions: Record<string, string>;
1893
+ /** Rows that are presets, not block types (`PalettePreset`). Absent: every
1894
+ * row is a type, as before. */
1895
+ presets?: readonly PalettePreset[];
1896
+ }
1897
+ /**
1898
+ * Flatten `config.categories` into an ordered section list.
1899
+ *
1900
+ * Grouping and order ARE the category order in the config — which is the
1901
+ * catalog's order — so this adds no opinion of its own. A component listed in a
1902
+ * category but absent from `components` is skipped: a stale catalog row cannot
1903
+ * render and certainly cannot insert, so offering it would be a card that fails
1904
+ * on click.
1905
+ *
1906
+ * Child-only blocks (HeroSlide / CollectionCard / ProductRef) and the four
1907
+ * generic primitives (Heading / Text / ImageBlock / ButtonBlock) sit in NO
1908
+ * category on purpose, so they never appear here — they are added from their
1909
+ * parent's slot instead. See the note above `categories:` in lib/document/config.tsx.
1910
+ *
1911
+ * A category the config marks `visible: false` is NOT offered (0.105.0, seam
1912
+ * E9): it is a registry's way of keeping blocks it has out of the picker — the
1913
+ * campaign designer's Product parts, its retired blocks, its Sections — and a
1914
+ * palette that listed them would offer things that may not be put on a page.
1915
+ * The old library's own palette read the flag the same way. No website category carries
1916
+ * it, so the website's palette is the list it was.
1917
+ */
1918
+ declare function buildPaletteSections(config: Config, look: PaletteLook): PaletteSection[];
1919
+ /** A category's display label — the layer's short one where there is one, else the config's title. */
1920
+ declare function categoryLabel(config: Config, id: string, shortLabel: (id: string) => string | undefined): string;
1921
+ /**
1922
+ * Does a section match a search query?
1923
+ *
1924
+ * The query is matched against the NAME, any ALIAS, the blurb, the component
1925
+ * TYPE and the CATEGORY HEADING — the type because a merchant who knows the
1926
+ * section by the word they saw in a handoff should still find it, the alias
1927
+ * because one node is called something else everywhere it is nested (see
1928
+ * `PaletteSection.alias`), and the category because it is PRINTED IN THE NAV
1929
+ * BESIDE THE RESULTS: seven of thirteen headings used to match nothing at all
1930
+ * (see `PaletteSection.catLabel`). A word a merchant can read off this screen
1931
+ * must find what it is labelling.
1932
+ *
1933
+ * `q` is expected already lower-cased and trimmed; an empty query matches
1934
+ * everything.
1935
+ */
1936
+ declare function matchesQuery(s: PaletteSection, q: string): boolean;
1937
+ /** The pinned section, or `null` if the layer pins none or the config does not offer it. */
1938
+ declare function pinnedSection(sections: PaletteSection[], pinned: string | null): PaletteSection | null;
1939
+ /** Every OTHER section — what the grouped grid below the pinned card draws. */
1940
+ declare function paletteWithoutPinned(sections: PaletteSection[], pinned: string | null): PaletteSection[];
1941
+
1942
+ /** What a tile adds, parsed back out of its key. */
1943
+ type AddKey = {
1944
+ kind: "section";
1945
+ type: string;
1946
+ } | {
1947
+ kind: "template";
1948
+ template: SectionTemplate;
1949
+ } | {
1950
+ kind: "shared";
1951
+ section: SharedSection;
1952
+ }
1953
+ /** A row that is a preset, not a block type (the layer's `presets`): what
1954
+ * it lays down is its `insert`'s. */
1955
+ | {
1956
+ kind: "preset";
1957
+ preset: PalettePreset;
1958
+ } | {
1959
+ kind: "block";
1960
+ type: string;
1961
+ };
1962
+ declare const sectionKey: (type: string) => string;
1963
+ declare const blockKey: (type: string) => string;
1964
+ declare const templateKey: (id: string) => string;
1965
+ declare const sharedKey: (id: string) => string;
1966
+ declare const presetKey: (key: string) => string;
1967
+ type AddSidePanelProps<I> = {
1968
+ /** Where the next thing goes, when the panel was opened at a place. */
1969
+ at?: {
1970
+ label: string;
1971
+ onClear: () => void;
1972
+ };
1973
+ /** At a place in a list of blocks: the blocks that list takes. They are in
1974
+ * the one list whatever the catalogue holds, so a place can always be
1975
+ * filled from it. */
1976
+ placeBlocks?: readonly BlockChoice[];
1977
+ /** At a place: what a tile is called THERE, by type, where the place lays
1978
+ * down more than the type (a slot whose spec prepares its child,
1979
+ * `SlotSectionSpec.newChild`). A type not in it keeps its own word. */
1980
+ placeNames?: ReadonlyMap<string, string>;
1981
+ /** At a place: may what a tile names go there? Null when it may, else why
1982
+ * not, in the panel's words — the tile is then dimmed and says so. Absent
1983
+ * (no place): every tile is offered, to drag. */
1984
+ canTake?: (key: AddKey) => string | null;
1985
+ /** At a place: put what a pressed tile names there. Absent (no place): a
1986
+ * press adds nothing, and a tile is only dragged. */
1987
+ onPick?: (key: AddKey) => void;
1988
+ /** The drag item for what a tile names — a drag in the editor's session. */
1989
+ itemFor: (key: AddKey) => I;
1990
+ session: DragSession<I>;
1991
+ /** A row under the tiles for something that is not a block, drawn by the
1992
+ * layer that owns it (the website: the Live chat bubble). */
1993
+ siteWide?: ReactNode;
1994
+ /** Leave Add — back to the view underneath (the head's "Done"). */
1995
+ onClose: () => void;
1996
+ /** Hide the left panel (the head's last button, as on every panel). */
1997
+ onHide?: () => void;
1998
+ readOnly?: boolean;
1999
+ };
2000
+ declare function AddSidePanel<I>({ at, placeBlocks, placeNames, canTake, onPick, itemFor, session, siteWide, onClose, onHide, readOnly, }: AddSidePanelProps<I>): react.JSX.Element;
2001
+
2002
+ export { isPinnedLast as $, type ScreenNodeActions as A, type ScreenNodeAt as B, type CopyItemAction as C, type ScreenNodeLevel as D, type ScreenNodeMaker as E, type ScreenPartMode as F, type ScreenParts as G, ScreenPartsProvider as H, type InsertNodeOptions as I, type ScreenPinnedBand as J, type ScreenPinnedNodes as K, type ScreenRailItem as L, type ScreenSelector as M, type NodeDefaults as N, type ScreenSharedSections as O, type ScreenSlot as P, type ScreenSlotAction as Q, type ScreenSlotMode as R, SELECTION_MODE as S, type ScreenStyleClipboard as T, type ScreenStyleDocument as U, type ScreenStylePastePlan as V, type ScreenToastExtra as W, type ScreenTree as X, type ScreenTreeFolds as Y, type ScreenTreeRows as Z, isPinnedFirst as _, type CopyItemRequest as a, isSelectionMode as a0, isSlotMode as a1, sameInspectorMode as a2, screenSlotsOf as a3, shownChildSlotsOf as a4, shownSlotFieldsOf as a5, useScreenBlockLook as a6, useScreenBlockRules as a7, useScreenBridges as a8, useScreenCanvasDrag as a9, categoryLabel as aA, matchesQuery as aB, paletteWithoutPinned as aC, pinnedSection as aD, type AddKey as aE, type AddSidePanelProps as aF, blockKey as aG, AddSidePanel as aH, presetKey as aI, sectionKey as aJ, sharedKey as aK, templateKey as aL, useScreenCanvasFrame as aa, useScreenCanvasHead as ab, useScreenCanvasTarget as ac, useScreenDevices as ad, useScreenDocumentLabel as ae, useScreenDocumentPass as af, useScreenInspectorPanel as ag, useScreenLeftView as ah, useScreenNodeKeys as ai, useScreenNotify as aj, useScreenOwnerName as ak, useScreenParts as al, useScreenPickFollowsSelection as am, useScreenPinned as an, useScreenSaveSwitch as ao, useScreenStorageNamespace as ap, useScreenStyleClipboard as aq, useStandaloneScreenBridges as ar, type SlotSectionSpec as as, type NodeDefaults$1 as at, type AddTarget as au, type AddTargetSource as av, type PaletteLook as aw, type PalettePreset as ax, type PaletteSection as ay, buildPaletteSections as az, type ScreenBlockLook as b, type ScreenBlockRules as c, type ScreenBridges as d, type ScreenCanvas as e, type ScreenCanvasDrag as f, type ScreenCanvasDragContext as g, type ScreenCanvasHeadProps as h, ScreenCanvasTargetProvider as i, type ScreenDevices as j, type ScreenDocumentOps as k, type ScreenDragItem as l, type ScreenInspector as m, type ScreenInspectorMode as n, type ScreenInspectorPanelProps as o, type ScreenLeftPanel as p, type ScreenLeftView as q, type ScreenLeftViewFrame as r, type ScreenLeftViewRules as s, type ScreenMainAction as t, type ScreenMediaDrop as u, type ScreenMediaFile as v, type ScreenMenuItem as w, type ScreenMenuRows as x, type ScreenNewNode as y, type ScreenNode as z };