efficient-easel 0.101.1 → 0.102.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 (231) hide show
  1. package/README.md +37 -0
  2. package/dist/LinkPicker-W2Rtxetz.d.ts +111 -0
  3. package/dist/autosave/index.d.ts +6 -3
  4. package/dist/autosave/index.js +1 -1
  5. package/dist/chrome/index.d.ts +3 -2
  6. package/dist/chrome/index.js +1 -25
  7. package/dist/chunk-26OOWIJJ.js +1 -0
  8. package/dist/chunk-2LK54I4E.js +1 -0
  9. package/dist/chunk-3QVB4AG2.js +3 -0
  10. package/dist/chunk-3U4GP5VA.js +10 -0
  11. package/dist/chunk-3WSPDAK2.js +1 -0
  12. package/dist/chunk-4ES5JGGX.js +1 -0
  13. package/dist/chunk-5464H65G.js +4 -0
  14. package/dist/chunk-57DJOKXT.js +1 -0
  15. package/dist/chunk-5MZ3RNQQ.js +13 -0
  16. package/dist/chunk-5ZBY24K7.js +1 -0
  17. package/dist/chunk-6DJHRLCU.js +25 -0
  18. package/dist/chunk-6FY3PZS3.js +1 -0
  19. package/dist/chunk-6TZTKAB5.js +1 -0
  20. package/dist/chunk-6W7WLPZH.js +1 -0
  21. package/dist/chunk-7F52SZOI.js +2 -0
  22. package/dist/chunk-7MU3RJ6S.js +1 -0
  23. package/dist/chunk-7RNTMJER.js +5 -0
  24. package/dist/chunk-A7ZJII7O.js +1 -0
  25. package/dist/chunk-AJBJ74ME.js +1 -0
  26. package/dist/chunk-AKFJK65Z.js +1 -0
  27. package/dist/chunk-AKZWUV5Z.js +1 -0
  28. package/dist/chunk-BDTITTMW.js +1 -0
  29. package/dist/chunk-BSPCSC45.js +1 -0
  30. package/dist/chunk-BXZ6WLHC.js +22 -0
  31. package/dist/chunk-D7M6IRPJ.js +8 -0
  32. package/dist/chunk-DUVRZ456.js +1 -0
  33. package/dist/chunk-E7GGVILG.js +1 -0
  34. package/dist/chunk-F2FPZIZV.js +62 -0
  35. package/dist/chunk-F6CCTEIX.js +1 -0
  36. package/dist/chunk-FGNR22NY.js +1 -0
  37. package/dist/chunk-FT35FX7D.js +2 -0
  38. package/dist/chunk-FUDHI5I4.js +1 -0
  39. package/dist/chunk-GENAF3P6.js +1 -0
  40. package/dist/chunk-GOTN2KY4.js +2 -0
  41. package/dist/chunk-GXQCZJOP.js +1 -0
  42. package/dist/chunk-GZO72N3Q.js +0 -0
  43. package/dist/chunk-HMX55DYT.js +1 -0
  44. package/dist/chunk-HQ4VVRIC.js +1 -0
  45. package/dist/chunk-HWW4XJOH.js +1 -0
  46. package/dist/chunk-I54UCYOU.js +1 -0
  47. package/dist/chunk-IQ5TA7AM.js +1 -0
  48. package/dist/chunk-IWAPPEL4.js +6 -0
  49. package/dist/chunk-IYT6NN2J.js +1 -0
  50. package/dist/chunk-J4RAY75C.js +1 -0
  51. package/dist/chunk-KCBEE2MC.js +2 -0
  52. package/dist/chunk-KDYIMJTZ.js +1 -0
  53. package/dist/chunk-KQMML6JM.js +4 -0
  54. package/dist/chunk-OM67AJQC.js +1 -0
  55. package/dist/chunk-OYX47SL7.js +1 -0
  56. package/dist/chunk-P67FP7PG.js +9 -0
  57. package/dist/chunk-PP44LCJM.js +1 -0
  58. package/dist/chunk-PWZOS45R.js +2 -0
  59. package/dist/chunk-Q3SQBNJB.js +1 -0
  60. package/dist/chunk-R2HLPNQF.js +1 -0
  61. package/dist/chunk-R5L2E7JX.js +1 -0
  62. package/dist/chunk-R5ZVNJLJ.js +2 -0
  63. package/dist/chunk-RLBXE4EU.js +1 -0
  64. package/dist/chunk-RW4XBUUW.js +1 -0
  65. package/dist/chunk-SERF2FAU.js +1 -0
  66. package/dist/chunk-TEZ6V6PA.js +4 -0
  67. package/dist/chunk-TTJ54QGG.js +18 -0
  68. package/dist/chunk-UH7TGWHR.js +1 -0
  69. package/dist/chunk-UVWVYMMZ.js +1 -0
  70. package/dist/chunk-VLSTGOVD.js +2 -0
  71. package/dist/chunk-VV5ADNBR.js +1 -0
  72. package/dist/chunk-ZE7I3PLX.js +1 -0
  73. package/dist/chunk-ZZ7VLIHQ.js +1 -0
  74. package/dist/drag/index.d.ts +3 -41
  75. package/dist/drag/index.js +1 -18
  76. package/dist/easel/index.js +1 -9
  77. package/dist/{words-BMzV04b1.d.ts → engine-DBxp_v6B.d.ts} +1 -58
  78. package/dist/fields/index.d.ts +2 -109
  79. package/dist/fields/index.js +1 -22
  80. package/dist/gold/index.d.ts +4 -2
  81. package/dist/host-B-byaQxg.d.ts +480 -0
  82. package/dist/menu/index.js +1 -1
  83. package/dist/node-ops/index.js +1 -1
  84. package/dist/panelWidths-D9hTLR25.d.ts +66 -0
  85. package/dist/screen/components/AddBlockRow.d.ts +14 -0
  86. package/dist/screen/components/AddBlockRow.js +1 -0
  87. package/dist/screen/components/AddChildRow.d.ts +39 -0
  88. package/dist/screen/components/AddChildRow.js +1 -0
  89. package/dist/screen/components/AddSidePanel.d.ts +54 -0
  90. package/dist/screen/components/AddSidePanel.js +1 -0
  91. package/dist/screen/components/MediaSidePanel.d.ts +47 -0
  92. package/dist/screen/components/MediaSidePanel.js +1 -0
  93. package/dist/screen/components/NodeContextMenu.d.ts +364 -0
  94. package/dist/screen/components/NodeContextMenu.js +1 -0
  95. package/dist/screen/components/PageEditGuardNotices.d.ts +5 -0
  96. package/dist/screen/components/PageEditGuardNotices.js +1 -0
  97. package/dist/screen/components/PanelToggleIcon.d.ts +14 -0
  98. package/dist/screen/components/PanelToggleIcon.js +1 -0
  99. package/dist/screen/components/PreviewDeviceContext.d.ts +28 -0
  100. package/dist/screen/components/PreviewDeviceContext.js +1 -0
  101. package/dist/screen/components/PreviewPartsContext.d.ts +33 -0
  102. package/dist/screen/components/PreviewPartsContext.js +1 -0
  103. package/dist/screen/components/ScreenChrome.d.ts +5 -0
  104. package/dist/screen/components/ScreenChrome.js +1 -0
  105. package/dist/screen/components/ScreenDocumentContext.d.ts +20 -0
  106. package/dist/screen/components/ScreenDocumentContext.js +1 -0
  107. package/dist/screen/components/ScreenMount.d.ts +75 -0
  108. package/dist/screen/components/ScreenMount.js +1 -0
  109. package/dist/screen/components/ScreenStoreProvider.d.ts +63 -0
  110. package/dist/screen/components/ScreenStoreProvider.js +1 -0
  111. package/dist/screen/components/SectionScreenShell.d.ts +5 -0
  112. package/dist/screen/components/SectionScreenShell.js +16 -0
  113. package/dist/screen/components/SidePanelHead.d.ts +81 -0
  114. package/dist/screen/components/SidePanelHead.js +1 -0
  115. package/dist/screen/components/SlotChildActionsContext.d.ts +41 -0
  116. package/dist/screen/components/SlotChildActionsContext.js +1 -0
  117. package/dist/screen/components/UiIcon.d.ts +52 -0
  118. package/dist/screen/components/UiIcon.js +1 -0
  119. package/dist/screen/components/panel-widths.d.ts +37 -0
  120. package/dist/screen/components/panel-widths.js +1 -0
  121. package/dist/screen/components/usePartBridge.d.ts +66 -0
  122. package/dist/screen/components/usePartBridge.js +1 -0
  123. package/dist/screen/index.d.ts +31 -0
  124. package/dist/screen/index.js +1 -0
  125. package/dist/screen/lib/admin-bridge.d.ts +105 -0
  126. package/dist/screen/lib/admin-bridge.js +1 -0
  127. package/dist/screen/lib/backend-error.d.ts +106 -0
  128. package/dist/screen/lib/backend-error.js +1 -0
  129. package/dist/screen/lib/chrome-theme.d.ts +21 -0
  130. package/dist/screen/lib/chrome-theme.js +1 -0
  131. package/dist/screen/lib/client-only.d.ts +24 -0
  132. package/dist/screen/lib/client-only.js +1 -0
  133. package/dist/screen/lib/content/view-tiers.d.ts +25 -0
  134. package/dist/screen/lib/content/view-tiers.js +1 -0
  135. package/dist/screen/lib/document-addressing.d.ts +20 -0
  136. package/dist/screen/lib/document-addressing.js +1 -0
  137. package/dist/screen/lib/document-contract.d.ts +230 -0
  138. package/dist/screen/lib/document-contract.js +1 -0
  139. package/dist/screen/lib/document-hooks.d.ts +71 -0
  140. package/dist/screen/lib/document-hooks.js +0 -0
  141. package/dist/screen/lib/document-switch.d.ts +74 -0
  142. package/dist/screen/lib/document-switch.js +1 -0
  143. package/dist/screen/lib/failure.d.ts +54 -0
  144. package/dist/screen/lib/failure.js +1 -0
  145. package/dist/screen/lib/host-chrome.d.ts +181 -0
  146. package/dist/screen/lib/host-chrome.js +1 -0
  147. package/dist/screen/lib/host-inbound.d.ts +20 -0
  148. package/dist/screen/lib/host-inbound.js +1 -0
  149. package/dist/screen/lib/host.d.ts +20 -0
  150. package/dist/screen/lib/host.js +1 -0
  151. package/dist/screen/lib/key-scope.d.ts +23 -0
  152. package/dist/screen/lib/key-scope.js +1 -0
  153. package/dist/screen/lib/links/link-filters.d.ts +41 -0
  154. package/dist/screen/lib/links/link-filters.js +0 -0
  155. package/dist/screen/lib/load-error.d.ts +29 -0
  156. package/dist/screen/lib/load-error.js +1 -0
  157. package/dist/screen/lib/media-panel.d.ts +94 -0
  158. package/dist/screen/lib/media-panel.js +1 -0
  159. package/dist/screen/lib/media-picker.d.ts +68 -0
  160. package/dist/screen/lib/media-picker.js +1 -0
  161. package/dist/screen/lib/page-lock.d.ts +5 -0
  162. package/dist/screen/lib/page-lock.js +1 -0
  163. package/dist/screen/lib/puck/add-target-types.d.ts +55 -0
  164. package/dist/screen/lib/puck/add-target-types.js +0 -0
  165. package/dist/screen/lib/puck/block-choice.d.ts +52 -0
  166. package/dist/screen/lib/puck/block-choice.js +1 -0
  167. package/dist/screen/lib/puck/block-types-in.d.ts +39 -0
  168. package/dist/screen/lib/puck/block-types-in.js +1 -0
  169. package/dist/screen/lib/puck/content-tree.d.ts +196 -0
  170. package/dist/screen/lib/puck/content-tree.js +1 -0
  171. package/dist/screen/lib/puck/device-fields.d.ts +126 -0
  172. package/dist/screen/lib/puck/device-fields.js +1 -0
  173. package/dist/screen/lib/puck/field-buckets.d.ts +22 -0
  174. package/dist/screen/lib/puck/field-buckets.js +1 -0
  175. package/dist/screen/lib/puck/field-markers.d.ts +205 -0
  176. package/dist/screen/lib/puck/field-markers.js +1 -0
  177. package/dist/screen/lib/puck/hidable.d.ts +44 -0
  178. package/dist/screen/lib/puck/hidable.js +1 -0
  179. package/dist/screen/lib/puck/palette-sections.d.ts +96 -0
  180. package/dist/screen/lib/puck/palette-sections.js +1 -0
  181. package/dist/screen/lib/puck/panel-fields.d.ts +47 -0
  182. package/dist/screen/lib/puck/panel-fields.js +1 -0
  183. package/dist/screen/lib/puck/panel-no-control-mark.d.ts +74 -0
  184. package/dist/screen/lib/puck/panel-no-control-mark.js +1 -0
  185. package/dist/screen/lib/puck/part-id.d.ts +23 -0
  186. package/dist/screen/lib/puck/part-id.js +1 -0
  187. package/dist/screen/lib/puck/preview-click.d.ts +49 -0
  188. package/dist/screen/lib/puck/preview-click.js +1 -0
  189. package/dist/screen/lib/puck/preview-dom.d.ts +8 -0
  190. package/dist/screen/lib/puck/preview-dom.js +1 -0
  191. package/dist/screen/lib/puck/preview-events.d.ts +25 -0
  192. package/dist/screen/lib/puck/preview-events.js +1 -0
  193. package/dist/screen/lib/puck/preview-selection-context.d.ts +72 -0
  194. package/dist/screen/lib/puck/preview-selection-context.js +1 -0
  195. package/dist/screen/lib/puck/section-doc.d.ts +20 -0
  196. package/dist/screen/lib/puck/section-doc.js +1 -0
  197. package/dist/screen/lib/puck/slot-child-name.d.ts +186 -0
  198. package/dist/screen/lib/puck/slot-child-name.js +1 -0
  199. package/dist/screen/lib/puck/slot-heal.d.ts +5 -0
  200. package/dist/screen/lib/puck/slot-heal.js +1 -0
  201. package/dist/screen/lib/puck/slot-section-spec.d.ts +96 -0
  202. package/dist/screen/lib/puck/slot-section-spec.js +0 -0
  203. package/dist/screen/lib/puck/style-clipboard.d.ts +78 -0
  204. package/dist/screen/lib/puck/style-clipboard.js +1 -0
  205. package/dist/screen/lib/puck/text-control-kinds.d.ts +71 -0
  206. package/dist/screen/lib/puck/text-control-kinds.js +1 -0
  207. package/dist/screen/lib/puck/tree-reveal.d.ts +62 -0
  208. package/dist/screen/lib/puck/tree-reveal.js +1 -0
  209. package/dist/screen/lib/puck/use-section-ops.d.ts +86 -0
  210. package/dist/screen/lib/puck/use-section-ops.js +1 -0
  211. package/dist/screen/lib/screen-parts.d.ts +727 -0
  212. package/dist/screen/lib/screen-parts.js +1 -0
  213. package/dist/screen/lib/section-template-types.d.ts +49 -0
  214. package/dist/screen/lib/section-template-types.js +0 -0
  215. package/dist/screen/lib/section-templates.d.ts +23 -0
  216. package/dist/screen/lib/section-templates.js +1 -0
  217. package/dist/screen/lib/session-context.d.ts +30 -0
  218. package/dist/screen/lib/session-context.js +1 -0
  219. package/dist/screen/lib/session.d.ts +255 -0
  220. package/dist/screen/lib/session.js +1 -0
  221. package/dist/screen/screen.css +1088 -0
  222. package/dist/session-DSQFmIvx.d.ts +43 -0
  223. package/dist/strings/catalogue.d.ts +4 -2
  224. package/dist/strings/catalogue.js +1 -1
  225. package/dist/strings/index.d.ts +4 -2
  226. package/dist/strings/index.js +1 -1
  227. package/dist/style-clipboard/index.js +1 -1
  228. package/dist/{types-DGcCsxs8.d.ts → types-CqY85foL.d.ts} +3 -65
  229. package/dist/words-D_Lnw1Gr.d.ts +59 -0
  230. package/package.json +343 -2
  231. package/dist/chunk-IG3U5NWJ.js +0 -1
@@ -0,0 +1,727 @@
1
+ import * as react from 'react';
2
+ import { ReactNode, MouseEvent, ComponentType } from 'react';
3
+ import { Data } from '../../blocks/index.js';
4
+ import { D as DeviceOption } from '../../types-CqY85foL.js';
5
+ import { a as EaselRailItem } from '../../types-DWS-s9z-.js';
6
+ import { HostProduct } from './host-chrome.js';
7
+ import { EaselSession } from './session.js';
8
+ import { AddTarget } from './puck/add-target-types.js';
9
+ import '../../types-E3HrTPg2.js';
10
+ import '../../data/index.js';
11
+ import '../../types-41704JE4.js';
12
+ import '../../resolve-D68pb3Bx.js';
13
+ import '../../plan-DChbUXdS.js';
14
+ import '../../edit-lock/index.js';
15
+ import '../../panelWidths-D9hTLR25.js';
16
+ import '../../wordFit-D4S36PvB.js';
17
+ import './links/link-filters.js';
18
+ import '../../LinkPicker-W2Rtxetz.js';
19
+ import './document-contract.js';
20
+ import './document-hooks.js';
21
+ import './section-template-types.js';
22
+ import './puck/content-tree.js';
23
+ import './puck/block-choice.js';
24
+ import './puck/slot-section-spec.js';
25
+
26
+ /**
27
+ * WHAT THE WEBSITE HANDS THE EDITOR'S SCREEN — the parts of the screen that
28
+ * know there is a website, given to it instead of imported by it
29
+ * (doc/adr/0003).
30
+ *
31
+ * The screen — the frame, the panels, the tree, the add panel, the inspector —
32
+ * is being made to hold nothing a website has that an email does not: no page,
33
+ * no site theme, no pinned header, no chat bubble. What it used to import and
34
+ * wire itself, the website layer now wires and hands over here, and a screen
35
+ * mounted with no layer above it draws none of it.
36
+ *
37
+ * This is NOT `EaselChrome` (lib/host-chrome): that is what a HOST stands
38
+ * round the editor — the storefront's cart, its header's settings — built in
39
+ * the host and absent on the ambient session. These parts are the builder's
40
+ * own website layer, the same for every host, and present on every mount of
41
+ * the screen (`ScreenStoreProvider` supplies them, from whoever mounts it).
42
+ *
43
+ * Fixed for the life of a mount, like the session: `useBridges`,
44
+ * `useStandaloneBridges`, `useDocumentPass` and `blockLook.useProducts` are
45
+ * called as hooks, and `Canvas` and `Inspector` are rendered as element types,
46
+ * so the provider's value must not change while the screen is mounted.
47
+ */
48
+ /** A node of the document as the screen hands it to a layer: its type and its
49
+ * props, its id among them. */
50
+ interface ScreenNode {
51
+ type: string;
52
+ props: {
53
+ id: string;
54
+ [key: string]: unknown;
55
+ };
56
+ }
57
+ /**
58
+ * A panel of the layer's own, as the screen holds it: a kind, and whatever
59
+ * else the layer put beside it to say WHICH one (the node a panel is about).
60
+ * The screen stores it and hands it back, and reads no further into it than
61
+ * `kind`.
62
+ */
63
+ type ScreenInspectorMode = {
64
+ kind: string;
65
+ };
66
+ /**
67
+ * THE SELECTION'S OWN PANEL — the one mode the screen names for itself. In it
68
+ * the inspector follows the selection: a node's settings, or the document's
69
+ * with nothing selected. Every other mode is a panel of a layer's, which the
70
+ * screen stores and hands back; this is the one it puts the inspector back to
71
+ * when the selection changes, and on every press of a row of its own.
72
+ *
73
+ * ONE object for the module's life, so setting it while it is the mode already
74
+ * bails out of the state update. A layer whose inspector names this mode names
75
+ * THIS object (the website's `PUCK_MODE`, components/SectionEditor, is it), so
76
+ * "is the panel showing the selection's own?" has one answer on both sides.
77
+ * The kind keeps the spelling the website's inspector has always tested for.
78
+ */
79
+ declare const SELECTION_MODE: {
80
+ readonly kind: "puck";
81
+ };
82
+ /** The inspector drilled into one PART of a node (lib/puck/part-id): the mode
83
+ * the screen's part bridge (components/usePartBridge) opens and closes. The
84
+ * website's inspector modes include it (components/SectionEditor
85
+ * `InspectorMode`). */
86
+ type ScreenPartMode = {
87
+ kind: "part";
88
+ nodeId: string;
89
+ propKey: string;
90
+ };
91
+ /** Are two panels the same panel: the same kind, about the same thing? Asked
92
+ * member by member, so the screen can answer without knowing what a layer
93
+ * keeps beside the kind. */
94
+ declare function sameInspectorMode(a: ScreenInspectorMode, b: ScreenInspectorMode): boolean;
95
+ /** The inspector, as far as a layer needs it: which panel it shows, and how to
96
+ * show one of the layer's own. */
97
+ interface ScreenInspector {
98
+ /** The kind of panel showing now. */
99
+ kind: string;
100
+ /** The panel showing now, whole: what `open` was handed, given back. */
101
+ mode: ScreenInspectorMode;
102
+ /** Show a panel of the layer's own and reveal the inspector, leaving the
103
+ * selection where it is. The same panel already showing stays, as the
104
+ * object it was (`sameInspectorMode`). */
105
+ open: (mode: ScreenInspectorMode) => void;
106
+ /**
107
+ * Put a panel of the layer's own in the inspector and leave the inspector as
108
+ * it stands, in view or hidden: with `reveal` after it, what a press on one
109
+ * of the screen's own rows does. `open` is for a handler registered once: it
110
+ * never changes identity, so it cannot ask whether the inspector is hidden
111
+ * and brings it out every time.
112
+ */
113
+ show: (mode: ScreenInspectorMode) => void;
114
+ /** Bring the inspector into view if it is hidden. What it shows stays. */
115
+ reveal: () => void;
116
+ }
117
+ /**
118
+ * What the screen hands THE INSPECTOR it mounts in its right panel
119
+ * (`ScreenParts.Inspector`): the panel to show, the ways out of a panel,
120
+ * and what the screen's own furniture offers one. The names are the ones the
121
+ * screen has always passed, two of them in a website's words: they are the
122
+ * doors the bridges hand back (`openSettings`, `openStyles`).
123
+ */
124
+ interface ScreenInspectorPanelProps {
125
+ /** The panel to show: the selection's own (`SELECTION_MODE`), or one of the
126
+ * layer's, handed back as the screen was handed it. */
127
+ mode: ScreenInspectorMode;
128
+ /** The way to the settings of the whole document, from a panel that edits
129
+ * one part of it (`ScreenBridges.openSettings`). */
130
+ onOpenWebsiteSettings: () => void;
131
+ /** The way to the styles a part of a block can follow, from that part's own
132
+ * panel (`ScreenBridges.openStyles`). Omitted where there is nowhere to
133
+ * keep them, and the panel draws no door. */
134
+ onOpenSiteStyles?: () => void;
135
+ /** Select a node and show ITS OWN settings: the way out of a panel that was
136
+ * scoped down to part of that node. */
137
+ onSelectNode: (nodeId: string) => void;
138
+ /** Withhold the head's duplicate and remove. Set by the screen whose
139
+ * document is ONE node, which a second node or none would break. */
140
+ hideNodeActions?: boolean;
141
+ /** Say one line through the screen's toast. Omitted by a screen with none. */
142
+ onNotify?: (msg: string, tone?: "success" | "error") => void;
143
+ /** Hide the panel: the last button of its head. Omitted by a screen whose
144
+ * inspector is always in view. */
145
+ onHidePanel?: () => void;
146
+ }
147
+ /**
148
+ * The document and its tree of rows, as far as a layer needs them to wire and
149
+ * draw the parts of ONE block that are not nodes of their own: what is
150
+ * selected, where a node sits, and the three things a press on such a part's
151
+ * row does to the node it belongs to. Handed to the bridges on every render,
152
+ * so each member is that render's.
153
+ */
154
+ interface ScreenTree {
155
+ /** The document, as the rules are handed it. */
156
+ data: unknown;
157
+ /** The node selected now, or null. */
158
+ selected: ScreenNode | null;
159
+ /** The key of the list a node sits in, by the node's id. */
160
+ zoneOf: (id: string) => string | undefined;
161
+ /** Somebody else holds the document: nothing may be moved. */
162
+ readOnly: boolean;
163
+ /** Select the top-level node at `index` the way a press on its row does: the
164
+ * inspector goes back to the selection's own panel, then the selection
165
+ * moves. */
166
+ select: (index: number) => void;
167
+ /** Write the top-level node at `index` back, whole. */
168
+ replace: (index: number, node: ScreenNode) => void;
169
+ /** Bring the canvas to a node, as selecting its row does. */
170
+ scrollTo: (id: string) => void;
171
+ }
172
+ /**
173
+ * The canvas, as far as a layer needs it: which device it is being looked at
174
+ * on, and how often its frame has been rebuilt. The switch, its state and the
175
+ * Refresh are the screen's; a layer whose own fields or preview ask "which
176
+ * view is this?", or which puts the canvas somewhere of its own accord, is
177
+ * told here. Handed to the bridges on every render.
178
+ */
179
+ interface ScreenCanvas {
180
+ /** The id of the device the switch is on: one of the layer's own
181
+ * (`ScreenDevices.options`). */
182
+ device: string;
183
+ /** How many times the screen has rebuilt the canvas's frame (its Refresh).
184
+ * It changes with each one and with nothing else: a layer that put the
185
+ * canvas somewhere as the document opened lists it as a dependency, and
186
+ * puts it there again in the fresh frame. */
187
+ refreshes: number;
188
+ }
189
+ /**
190
+ * The left panel, as far as a layer needs it: to put it on a view and to bring
191
+ * it out. Which view it is on, whether it is open and what a press on the rail
192
+ * does to either are the screen's. Handed to the bridges on every render.
193
+ */
194
+ interface ScreenLeftPanel {
195
+ /** Put the panel on a view, by its id: one of the layer's own
196
+ * (`ScreenLeftView`) or one of the screen's. Whether the panel is in view
197
+ * stays, and the screen keeps the choice as it keeps any other. */
198
+ setView: (view: string) => void;
199
+ /** Bring the panel into view if it is hidden. What it shows stays. */
200
+ reveal: () => void;
201
+ }
202
+ /** What a view of the layer's is handed when the left panel draws it: what the
203
+ * screen hands the heads of its own views. */
204
+ interface ScreenLeftViewFrame {
205
+ /** Hide the whole left panel: the last button of every view's head. */
206
+ onHide: () => void;
207
+ /** Say one line through the screen's toast. */
208
+ notify: (msg: string, tone?: "success" | "error") => void;
209
+ }
210
+ /**
211
+ * A VIEW of the left panel that is the layer's own: a button in the rail, and
212
+ * what the panel shows while the view is the one it is on. The screen lights
213
+ * the button and switches to the view exactly as it does for its own Layers,
214
+ * and draws no frame round what `panel` returns: a view draws its own head.
215
+ */
216
+ interface ScreenLeftView {
217
+ /** The view's id: what the screen holds as the view the panel is on, and
218
+ * what is kept between mounts (`ScreenLeftViewRules`), so one in use is
219
+ * never renamed. The rail button's id as well. */
220
+ id: string;
221
+ /** The rail button's name. */
222
+ label: string;
223
+ /** …and its glyph. */
224
+ icon: ReactNode;
225
+ /** The view, for the screen to place in the left panel as it comes back. A
226
+ * function called where the panel is drawn and not a component of its own:
227
+ * what it returns is mounted in the screen's place, with nothing between. */
228
+ panel: (frame: ScreenLeftViewFrame) => ReactNode;
229
+ }
230
+ /**
231
+ * What a layer stands in the rail: a view of its own, or a button that is NOT
232
+ * a view of the left panel — one that opens something of the layer's
233
+ * elsewhere. That one is the engine's own rail item (efficient-easel/rail),
234
+ * drawn as it is handed: the layer says whether it is lit and what a press
235
+ * does.
236
+ */
237
+ type ScreenRailItem = ScreenLeftView | EaselRailItem;
238
+ /**
239
+ * The screen's own writes of the document, as far as a layer's pass over a
240
+ * document needs them. They are the writes every surface of the screen makes
241
+ * (lib/puck/use-section-ops), refused the same way while somebody else holds
242
+ * the document, and ONE object from render to render until that changes — so a
243
+ * pass may list it as a dependency and run no oftener for it.
244
+ */
245
+ interface ScreenDocumentOps {
246
+ /** Replace the whole working document, unrecorded. */
247
+ setDocument: (data: Data) => void;
248
+ /** Insert a node of `type`, as its own defaults, into the top-level list;
249
+ * returns the id it was given. */
250
+ insertSection: (type: string, index: number) => string;
251
+ /** Insert a FULL node — its type and its props, slot children inline — into
252
+ * the list `zone` names; returns the id it was given. */
253
+ insertNode: (zone: string, index: number, node: ScreenNode) => string;
254
+ /** Write the node at a place back, whole. */
255
+ replaceComponent: (zone: string, index: number, node: ScreenNode) => void;
256
+ }
257
+ /** What the tree lends a layer that draws a row in it: the row's own click,
258
+ * for a pointer landing outside its name. */
259
+ interface ScreenTreeRows {
260
+ rowClick: (select: () => void) => (e: MouseEvent<HTMLElement>) => void;
261
+ }
262
+ /** …and, for a layer that draws rows which fold, the tree's own fold state.
263
+ * The ids are the layer's to make; the tree keeps them with its own. */
264
+ interface ScreenTreeFolds extends ScreenTreeRows {
265
+ isCollapsed: (id: string) => boolean;
266
+ toggleCollapse: (id: string) => void;
267
+ }
268
+ /** What a layer's bridges give back for the screen to place. */
269
+ interface ScreenBridges {
270
+ /** A row under the Add panel's tiles, for something that is not a block.
271
+ * Handed the way to leave Add, for a row that opens a panel. */
272
+ addPanelRow?: (leaveAdd: () => void) => ReactNode;
273
+ /**
274
+ * Rows at the END of a top-level node's own children, for a part of that
275
+ * block which is not a node: "layer, do you draw anything under this row?".
276
+ * Asked only where the node's child rows are drawn, and what comes back is
277
+ * placed as it is — the layer draws with the tree's own row.
278
+ */
279
+ partRows?: (node: ScreenNode, rows: ScreenTreeRows) => ReactNode;
280
+ /**
281
+ * Does the layer draw a subtree of its OWN under this top-level node — rows
282
+ * for things the block keeps in its props and not in a slot? Such a row
283
+ * folds like any other, so the screen asks before it draws the caret.
284
+ */
285
+ hasOwnRows?: (node: ScreenNode) => boolean;
286
+ /** That subtree's rows, for the node at `index`. Asked only when
287
+ * `hasOwnRows` said yes and the row is unfolded. */
288
+ ownRows?: (node: ScreenNode, index: number, rows: ScreenTreeFolds) => ReactNode;
289
+ /**
290
+ * The row of a top-level node was pressed, and the screen has selected it:
291
+ * a layer that keeps a focus of its own INSIDE one block puts it back to the
292
+ * block. Called between the selection and the canvas's scroll. The node is
293
+ * the one at the pressed index, if there is one.
294
+ */
295
+ sectionPressed?: (node: ScreenNode | undefined) => void;
296
+ /**
297
+ * The layer's own controls in the top bar's right cluster. The screen draws
298
+ * that cluster as the save state, Refresh and the main button; a layer has
299
+ * two places in it. `barLead` stands FIRST among the actions, between the
300
+ * save state and Refresh: something done with the whole document that only
301
+ * the layer has. What comes back is placed as it is, and a layer with
302
+ * nothing to offer just now returns nothing.
303
+ */
304
+ barLead?: () => ReactNode;
305
+ /** …and `barTrail` stands between Refresh and the main button: a way out to
306
+ * where the document is read. */
307
+ barTrail?: () => ReactNode;
308
+ /**
309
+ * The layer's own buttons in the rail. The screen draws the rail as Add, its
310
+ * own Layers and the host's Media library; a layer has two places in it.
311
+ * `railLead` stands between Add and Layers. Each list is the buttons THIS
312
+ * document has, in the order they are drawn: one it does not have is left
313
+ * out, and a view left out is a view the panel cannot be on.
314
+ */
315
+ railLead?: ReadonlyArray<ScreenRailItem>;
316
+ /** …and `railTrail` stands between Layers and Media. */
317
+ railTrail?: ReadonlyArray<ScreenRailItem>;
318
+ /**
319
+ * Which view the left panel ACTUALLY shows, given the one it is set to: the
320
+ * view kept from another document may be one this document does not have,
321
+ * and the panel then shows the screen's Layers. The layer answers, because
322
+ * some of the views are its own and which of them a document has is its to
323
+ * know; the screen says whether its Media view is there to show
324
+ * (`hasMedia`), so there is ONE fallback and not one on each side.
325
+ */
326
+ resolveLeftView?: (view: string, hasMedia: boolean) => string;
327
+ /**
328
+ * A tool of the layer's own at the foot of the Layers tree, under the last
329
+ * row: something that reads the whole document and is not a row of it.
330
+ * Placed as it comes back.
331
+ */
332
+ treeFoot?: () => ReactNode;
333
+ /**
334
+ * Two doors out of the inspector's panels, onto wherever the layer keeps what
335
+ * they lead to: a view of its own in the left panel, a panel of its own in
336
+ * the inspector. The screen hands them to the inspector it mounts and does
337
+ * not know where they go. `openSettings` is the way to the settings of the
338
+ * whole document, from a panel that edits one part of it. The inspector
339
+ * cannot do without it, so with no layer it is handed one that leads nowhere.
340
+ */
341
+ openSettings?: () => void;
342
+ /** …and `openStyles` the way to the styles a part of a block can follow,
343
+ * from that part's own panel. A layer with nowhere to keep them hands none,
344
+ * and the panel draws no door. */
345
+ openStyles?: () => void;
346
+ /**
347
+ * The open document is the one that STORES what the layer pins: the node
348
+ * every other document shows pinned and does not hold (the website's: the
349
+ * page that keeps the site's one footer). It is edited there in place, so
350
+ * the screen draws that document's tree without the rows an ordinary one has
351
+ * round its own sections, and without the row that leads to it. Absent, the
352
+ * document is an ordinary one.
353
+ */
354
+ pinnedSource?: boolean;
355
+ /** …and the way to edit what is pinned from a document that only shows it:
356
+ * what a press on its row in the tree does. Where it leads is the layer's
357
+ * (the website opens its footer's editor over the page). */
358
+ editPinnedSource?: () => void;
359
+ /**
360
+ * The layer's own way to bring the canvas to a node the screen has selected,
361
+ * for a document where the screen's plain scroll does not hold: one the
362
+ * layer draws something above, which reflows and takes the scroll back (the
363
+ * website's footer, edited under the page it was opened from). Handed back
364
+ * only for such a document, and the screen then calls it in place of its
365
+ * scroll; absent, the screen scrolls.
366
+ */
367
+ holdCanvasOn?: (id: string) => void;
368
+ /** The layer's own context, stood round the whole screen. What it is handed
369
+ * is the screen; what it returns is rendered in the screen's place. */
370
+ wrap?: (screen: ReactNode) => ReactNode;
371
+ }
372
+ /** A block type's own default props, read off the config the screen holds.
373
+ * The screen's to look up and a layer's to be lent: a layer that reached into
374
+ * the config for itself would be holding a second copy of it. */
375
+ type NodeDefaults = (type: string) => Record<string, unknown>;
376
+ /** What the screen lends a rule that builds a node. All four are the screen's
377
+ * own and none is a block's: the rule states the node, the screen says what a
378
+ * type defaults to, what its next id is, what it is called and whether the
379
+ * host offers it. */
380
+ interface ScreenNodeMaker {
381
+ /** A type's default props, from the config. */
382
+ nodeDefaults: NodeDefaults;
383
+ /** A fresh id for one node of a type. Called once per node, in the order the
384
+ * nodes are written. */
385
+ newNodeId: (type: string) => string;
386
+ /** What a top-level node of a type is called, as the tree and the toast say
387
+ * it. */
388
+ sectionLabel: (type: string) => string;
389
+ /** Does this editor's host offer the type? A rule that would lay down a block
390
+ * the host left out asks first. */
391
+ blockIsOffered: (type: string) => boolean;
392
+ }
393
+ /** A node as a rule hands it back: a type and its props, slot children inline
394
+ * in them. The screen inserts it whole. */
395
+ interface ScreenNewNode {
396
+ type: string;
397
+ props: Record<string, unknown>;
398
+ }
399
+ /**
400
+ * The rules of particular blocks, asked by the screen and never stated in it:
401
+ * the screen is handed nodes and is not told which blocks exist. Plain
402
+ * functions of what they are passed, and the same object for the life of a
403
+ * mount, so the screen may call them anywhere without listing them as a
404
+ * dependency.
405
+ */
406
+ interface ScreenBlockRules {
407
+ /** A block that is what its section IS: it may be selected and edited, and
408
+ * never removed, hidden, duplicated or dragged. */
409
+ isLockedBlock: (type: string | undefined) => boolean;
410
+ /** Why a second one of this node cannot be made in this document, or null —
411
+ * a rule of the block's own. */
412
+ duplicateBlocked: (data: unknown, node: unknown) => string | null;
413
+ /**
414
+ * How many nodes of its own kind the node with `id` already sits inside, for
415
+ * a block that limits its own nesting; 0 for every other. It is the depth the
416
+ * add lookup is asked at, so every surface that adds into one node offers the
417
+ * same list.
418
+ */
419
+ nestDepth: (data: unknown, type: string, id: string) => number;
420
+ /**
421
+ * What a new top-level section of `type` STARTS AS, when that is more than
422
+ * its own defaults — an arrangement of several blocks, or a prop no default
423
+ * carries — as ONE node for the screen to insert in one step; or null, and
424
+ * the screen inserts the type by itself. Where it goes, selecting it and
425
+ * announcing it stay the screen's.
426
+ */
427
+ newSectionNode: (type: string, make: ScreenNodeMaker) => ScreenNewNode | null;
428
+ /**
429
+ * What can go in a node of `nodeType`, sitting `nestDepth` nodes of its own
430
+ * kind deep (0 when not said): the slot its children are kept on, and the
431
+ * menu's rows or the one child type a button adds — or null for a node that
432
+ * takes no children. THE ONE ANSWER every add surface of the screen asks (the
433
+ * tree, the panel, the menu, the Add panel), so no two of them can come to
434
+ * offer one node different lists; what each of the layer's blocks takes is
435
+ * the layer's catalogue, and the screen is not told it.
436
+ */
437
+ canAddTo: (nodeType: string, nestDepth?: number) => AddTarget | null;
438
+ /**
439
+ * Does the host of this editor offer the type? Asked of the editor's own
440
+ * session where the screen holds it, else of the editor on the page. Where
441
+ * no host chose its blocks, every type is.
442
+ */
443
+ blockIsOffered: (type: string, session?: EaselSession) => boolean;
444
+ }
445
+ /** The tier a node is NAMED at: a node at the top of the document is a section,
446
+ * a node inside another is a block. */
447
+ type ScreenNodeLevel = "section" | "block";
448
+ /**
449
+ * How the layer's blocks are NAMED AND DRAWN in the screen: the tree's rows and
450
+ * the Add panel's tiles put a word, a glyph and a cover on a block, and which
451
+ * word and which drawing is known only to the layer that knows every block it
452
+ * has. The screen is handed a type and asks.
453
+ *
454
+ * The same object for the life of a mount, and its two components the same two
455
+ * functions throughout: the screen renders them as element types, and a type
456
+ * that changed identity would remount every row and tile that wears one.
457
+ */
458
+ interface ScreenBlockLook {
459
+ /**
460
+ * What a node of `type` is called at a level, given `base` — the label the
461
+ * config holds for the type, which is the name of every node the layer does
462
+ * not name by where it sits.
463
+ */
464
+ labelAtLevel: (type: string, level: ScreenNodeLevel, base: string) => string;
465
+ /** The Add panel's one-line blurb for a section, by type. A type with none
466
+ * has no entry. */
467
+ descriptions: Record<string, string>;
468
+ /** The Add panel's short heading for a group of sections, by the group's
469
+ * key, where the layer has one; undefined, and the registry's own title for
470
+ * the group is its heading. */
471
+ categoryLabel: (id: string) => string | undefined;
472
+ /** The section the Add panel offers FIRST, by itself, ahead of every group
473
+ * and taken out of its own; null, and every section stands in its group. */
474
+ firstSection: string | null;
475
+ /**
476
+ * What the row of a block says when the block is named by its own content
477
+ * and not by the slot-child rule (lib/puck/slot-child-name): the layer reads
478
+ * the content, and `compLabel` — the config's label for a type, lent by the
479
+ * screen — is the word for a block it has no rule for.
480
+ */
481
+ blockRowName: (child: {
482
+ type: string;
483
+ props: Record<string, unknown>;
484
+ }, compLabel: (type: string) => string) => string;
485
+ /**
486
+ * The plain words of a block's stored copy, every mark of the layer's markup
487
+ * unwrapped: what a tree row prints of a name the author typed, where no mark
488
+ * can be drawn (lib/puck/slot-child-name `slotChildRowName`). Which marks
489
+ * there are is the layer's grammar — a website's is not an email's.
490
+ */
491
+ plainText: (copy: string) => string;
492
+ /** The glyph of a block or section type, as a tree row and a block tile wear
493
+ * it. */
494
+ Icon: ComponentType<{
495
+ type: string;
496
+ size?: number;
497
+ className?: string;
498
+ }>;
499
+ /** The cover picture of a section type, filling the Add panel's card. */
500
+ Thumbnail: ComponentType<{
501
+ type: string;
502
+ }>;
503
+ /**
504
+ * The products a row may be named after when its block holds only a
505
+ * product's handle: null until they arrive, and for good when there are
506
+ * none. A HOOK — the one member here that is — called once per render where
507
+ * the screen read the products itself, so its effect keeps its place.
508
+ */
509
+ useProducts: () => readonly HostProduct[] | null;
510
+ }
511
+ /**
512
+ * THE DEVICES the canvas can be looked at on. That the top bar has a switch,
513
+ * and that the canvas is fitted to the pane and framed, is the screen's: any
514
+ * editor's canvas is looked at on more than one. WHICH devices there are, what
515
+ * each is called and how wide it is drawn is the layer's — a website has three
516
+ * view tiers where an email has two.
517
+ *
518
+ * The same object for the life of a mount: the screen reads the device it
519
+ * starts on from it once, and draws the switch from it on every render.
520
+ */
521
+ interface ScreenDevices {
522
+ /** What the switch offers, in the order it draws them: an id, a name and a
523
+ * glyph each (efficient-easel/chrome `DeviceSwitch`). */
524
+ options: ReadonlyArray<DeviceOption>;
525
+ /** The device a mount starts on. */
526
+ initial: string;
527
+ /**
528
+ * The ONE device with no width of its own: the canvas draws it at the
529
+ * pane's width, so it reflows as the pane is dragged, where every other is
530
+ * a fixed width scaled to fit the pane. Its frame is the plain one; every
531
+ * other device's wears a class named for its id.
532
+ */
533
+ fluid: string;
534
+ /** The width each device is drawn at, in CSS px, by id. For `fluid` it is
535
+ * only the width of the frame before the pane has been measured. */
536
+ widths: Readonly<Record<string, number>>;
537
+ }
538
+ /**
539
+ * WHAT IS PINNED in the document's top-level list. That the list has a BAND
540
+ * its sections keep to — one node pinned ahead of it at most, and one behind —
541
+ * is the screen's: where a new section lands, where a dragged one may be put
542
+ * down, which nodes the canvas offers a handle on and what the menu withholds
543
+ * are all read off that band, and the arithmetic of it is written once, in the
544
+ * screen. WHICH types are pinned is the layer's: a website pins its Header
545
+ * first and its Footer last, where an email pins nothing.
546
+ *
547
+ * And the layer's GROUPS OF SECTIONS, if it has them: a pinned top-level node
548
+ * whose one list holds ordinary sections, which move among the groups' lists
549
+ * and nowhere else. The screen draws a group's row and keeps its sections to
550
+ * those lists; which types are groups, and what a group's list is keyed by,
551
+ * it asks.
552
+ *
553
+ * And THE PANEL A PINNED NODE IS EDITED IN, where that is not the selection's
554
+ * own: a node the layer pins may carry no fields, the layer keeping its
555
+ * settings and showing them in a panel of the layer's. Which node, and which
556
+ * panel, is the layer's to say; the screen asks by type where a node is
557
+ * selected and where a pinned node's row is pressed, and shows what it is
558
+ * handed.
559
+ *
560
+ * The same object for the life of a mount, its three functions plain functions
561
+ * of what they are passed: the screen reads it anywhere, inside the callbacks
562
+ * and effects it does not rebuild for it.
563
+ */
564
+ interface ScreenPinnedNodes {
565
+ /** The type of the node pinned FIRST: the band starts after it. Null when
566
+ * the layer pins none. */
567
+ first: string | null;
568
+ /** The type of the node pinned LAST: the band ends at it. */
569
+ last: string | null;
570
+ /** The type of the group of sections pinned first, ahead of everything. */
571
+ firstGroup: string | null;
572
+ /** …and of the one pinned last. */
573
+ lastGroup: string | null;
574
+ /** Is a node of this type a group of sections? */
575
+ isSectionGroup: (type: string | undefined) => boolean;
576
+ /** The key of the list a group keeps its sections in, by the group's id. */
577
+ sectionGroupZone: (groupId: string) => string;
578
+ /**
579
+ * The panel of the layer's own that a node of this type is edited in, or
580
+ * null: the node is edited by its own fields, in the selection's own panel
581
+ * (`SELECTION_MODE`). What comes back is what the screen stores, so it is
582
+ * the SAME object every time the same type is asked about. Asked with no
583
+ * type where nothing is selected, and answered null.
584
+ */
585
+ panelOf: (type: string | null | undefined) => ScreenInspectorMode | null;
586
+ }
587
+ /**
588
+ * THE VIEW THE LEFT PANEL IS ON, from one mount to the next. That the panel
589
+ * has views, that one of them is current and that the choice is kept is the
590
+ * screen's: it holds the view in state and mirrors it from ONE effect, the
591
+ * only writer. WHERE it is kept, which view a first mount opens on and what a
592
+ * selection does to it are the layer's — a website opens on its page list,
593
+ * and keeps the choice under a key of its own.
594
+ *
595
+ * The same object for the life of a mount: the screen seeds its state from
596
+ * `read` once, and calls the other two from an effect and a callback it does
597
+ * not rebuild for them.
598
+ */
599
+ interface ScreenLeftViewRules {
600
+ /** The view a mount opens on: the one kept, or the layer's first. */
601
+ read: () => string;
602
+ /** Keep the view for the next mount. */
603
+ write: (view: string) => void;
604
+ /** What a change of the selection does to the view: handed the id of the
605
+ * node selected, if one is, and the view the panel is on, it answers the
606
+ * view to be on. */
607
+ forSelection: (selectedId: string | null | undefined, current: string) => string;
608
+ }
609
+ interface ScreenParts {
610
+ /**
611
+ * The name a panel's head gives what is being edited — the website's name,
612
+ * a campaign's — as the hook the head calls. The media panel's context line
613
+ * reads it (components/MediaSidePanel), through `useScreenOwnerName`.
614
+ */
615
+ useOwnerName?: () => string;
616
+ /**
617
+ * The layer's wiring between the inspector and what the layer draws in the
618
+ * canvas, as ONE hook the screen calls where it used to hold that wiring: a
619
+ * click on the layer's furniture in the canvas opens its panel, and the open
620
+ * panel outlines the furniture. And its wiring for the parts of one block
621
+ * that are not nodes: what selecting one does, and the rows it has in the
622
+ * tree. And its own controls in the top bar, with whatever they run on. And
623
+ * its buttons in the rail, with the views of the left panel they open.
624
+ */
625
+ useBridges?: (inspector: ScreenInspector, tree: ScreenTree, canvas: ScreenCanvas, left: ScreenLeftPanel) => ScreenBridges;
626
+ /**
627
+ * The same, for the screen that holds ONE node as its whole document
628
+ * (SectionScreenShell). A hook of its own and not `useBridges` with less
629
+ * handed in: that screen wired less — no site-wide furniture, no tree of
630
+ * sections — and a hook cannot leave out half of itself by what it is
631
+ * passed.
632
+ */
633
+ useStandaloneBridges?: (inspector: ScreenInspector) => ScreenBridges;
634
+ /**
635
+ * The layer's own pass over a document as it opens: what it lays down in one
636
+ * that lacks it, and takes out of one that holds it twice. A hook of its own
637
+ * and not one more thing the bridges run, because of WHERE it must run: the
638
+ * bridges stand early among the screen's hooks, and this pass writes the
639
+ * document, so it is called LAST of the screen's own passes over it — after
640
+ * the slot seeding and the duplicate-id heal, which address top-level nodes
641
+ * by index and would be thrown out by a node laid down ahead of them. Lent
642
+ * the screen's writes and the config it holds, for the engine's node maker.
643
+ */
644
+ useDocumentPass?: (ops: ScreenDocumentOps, config: unknown) => void;
645
+ /**
646
+ * The layer's block rules. Handed here and NOT registered at import: what a
647
+ * registry holds depends on which modules have loaded, and that order is not
648
+ * the same in the app and in a script that loads one file, so a rule could
649
+ * answer in one and be absent in the other.
650
+ */
651
+ blockRules?: ScreenBlockRules;
652
+ /** How the layer's blocks are named and drawn. Handed here for the reason
653
+ * the rules are. */
654
+ blockLook?: ScreenBlockLook;
655
+ /** The devices the layer's canvas is looked at on. Data, and handed here
656
+ * for the reason the rules are. */
657
+ devices?: ScreenDevices;
658
+ /** Where the left panel's view is kept, and which one a mount opens on.
659
+ * Plain functions, and handed here for the reason the rules are. */
660
+ leftView?: ScreenLeftViewRules;
661
+ /** Which node types are pinned in the top-level list, which are groups of
662
+ * sections, and which are edited in a panel of the layer's. Data and three
663
+ * plain functions, and handed here for the reason the rules are. */
664
+ pinned?: ScreenPinnedNodes;
665
+ /**
666
+ * THE CANVAS the screen frames: the engine's, as the layer dresses it — the
667
+ * layer's own sheet and theme in the frame, its own say over the outline
668
+ * round a block. The screen places it in the pane it has measured, hands it
669
+ * nothing, and remounts it by key to rebuild the frame; where the frame
670
+ * stands, how it is fitted and what is laid over it are the screen's.
671
+ *
672
+ * ONE function for the life of a mount: the screen renders it as an element
673
+ * type, and a type that changed identity would remount the whole canvas.
674
+ */
675
+ Canvas?: ComponentType;
676
+ /**
677
+ * THE INSPECTOR the screen mounts in its right panel: the panel of whatever
678
+ * is selected and, in its place, each panel of the layer's own — frame, head
679
+ * and body, since the screen draws nothing round it. The screen holds WHICH
680
+ * panel is showing and hands it over (`mode`), with the ways out of a panel
681
+ * and its own toast and Hide button; what a mode draws is the layer's.
682
+ *
683
+ * ONE function for the life of a mount: the screen renders it as an element
684
+ * type, and a type that changed identity would remount the panel and drop
685
+ * what a merchant has open in it.
686
+ */
687
+ Inspector?: ComponentType<ScreenInspectorPanelProps>;
688
+ }
689
+ declare function ScreenPartsProvider({ parts, children }: {
690
+ parts: ScreenParts;
691
+ children?: ReactNode;
692
+ }): react.JSX.Element;
693
+ /** The layer's parts; none when the screen stands by itself. */
694
+ declare function useScreenParts(): ScreenParts;
695
+ /** The layer's bridges, run in the screen. With no layer, nothing runs. */
696
+ /** The name a panel's head gives what is being edited (`useOwnerName`). */
697
+ declare function useScreenOwnerName(): string;
698
+ declare function useScreenBridges(inspector: ScreenInspector, tree: ScreenTree, canvas: ScreenCanvas, left: ScreenLeftPanel): ScreenBridges;
699
+ /** The layer's bridges for the screen that holds one node by itself. With no
700
+ * layer, nothing runs. */
701
+ declare function useStandaloneScreenBridges(inspector: ScreenInspector): ScreenBridges;
702
+ /** The layer's pass over a document as it opens, run in the screen. With no
703
+ * layer, nothing runs. */
704
+ declare function useScreenDocumentPass(ops: ScreenDocumentOps, config: unknown): void;
705
+ /** The layer's block rules. With no layer, the rules of an editor that has no
706
+ * blocks of its own. */
707
+ declare function useScreenBlockRules(): ScreenBlockRules;
708
+ /** How the layer's blocks are named and drawn. With no layer, by what the
709
+ * config says of them and with no drawing. */
710
+ declare function useScreenBlockLook(): ScreenBlockLook;
711
+ /** The devices the layer's canvas is looked at on. With no layer, the one that
712
+ * fills the pane. */
713
+ declare function useScreenDevices(): ScreenDevices;
714
+ /** Where the layer keeps the left panel's view. With no layer, nowhere: every
715
+ * mount opens on the Layers tree. */
716
+ declare function useScreenLeftView(): ScreenLeftViewRules;
717
+ /** Which node types the layer pins in the top-level list, and which are its
718
+ * groups of sections. With no layer, none. */
719
+ declare function useScreenPinned(): ScreenPinnedNodes;
720
+ /** The canvas the layer dresses for the screen to frame. With no layer, the
721
+ * engine's plain one. */
722
+ declare function useScreenCanvasFrame(): ComponentType;
723
+ /** The inspector the layer draws for the screen to mount. With no layer, the
724
+ * engine's plain rows for the selection. */
725
+ declare function useScreenInspectorPanel(): ComponentType<ScreenInspectorPanelProps>;
726
+
727
+ export { type NodeDefaults, SELECTION_MODE, type ScreenBlockLook, type ScreenBlockRules, type ScreenBridges, type ScreenCanvas, type ScreenDevices, type ScreenDocumentOps, type ScreenInspector, type ScreenInspectorMode, type ScreenInspectorPanelProps, type ScreenLeftPanel, type ScreenLeftView, type ScreenLeftViewFrame, type ScreenLeftViewRules, type ScreenNewNode, type ScreenNode, type ScreenNodeLevel, type ScreenNodeMaker, type ScreenPartMode, type ScreenParts, ScreenPartsProvider, type ScreenPinnedNodes, type ScreenRailItem, type ScreenTree, type ScreenTreeFolds, type ScreenTreeRows, sameInspectorMode, useScreenBlockLook, useScreenBlockRules, useScreenBridges, useScreenCanvasFrame, useScreenDevices, useScreenDocumentPass, useScreenInspectorPanel, useScreenLeftView, useScreenOwnerName, useScreenParts, useScreenPinned, useStandaloneScreenBridges };