efficient-easel 0.105.1 → 1.0.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 (184) hide show
  1. package/README.md +103 -29
  2. package/dist/{LinkPicker-W2Rtxetz.d.ts → LinkPicker-hPEr1MJx.d.ts} +6 -4
  3. package/dist/autosave/index.d.ts +5 -5
  4. package/dist/chrome/chrome.css +50 -273
  5. package/dist/chrome/index.d.ts +61 -56
  6. package/dist/chrome/index.js +1 -1
  7. package/dist/chunk-2GVCAIPX.js +1 -0
  8. package/dist/chunk-4GNPKHV4.js +64 -0
  9. package/dist/chunk-5545A3PC.js +4 -0
  10. package/dist/chunk-7SQF6LZL.js +1 -0
  11. package/dist/chunk-BXMXTO36.js +1 -0
  12. package/dist/{chunk-NYKIQJT2.js → chunk-CKEPQNSQ.js} +1 -1
  13. package/dist/chunk-DJMMTWFP.js +1 -0
  14. package/dist/{chunk-PQXIFBDY.js → chunk-E2O2MRZR.js} +1 -1
  15. package/dist/chunk-EA2HTX37.js +5 -0
  16. package/dist/{chunk-SARZN4M7.js → chunk-FEK3S6HN.js} +1 -1
  17. package/dist/chunk-FPAVNX3Y.js +6 -0
  18. package/dist/chunk-HMJS344F.js +1 -0
  19. package/dist/chunk-JLTZQ4US.js +1 -0
  20. package/dist/chunk-JMGPPXNQ.js +24 -0
  21. package/dist/chunk-K56YDHYQ.js +1 -0
  22. package/dist/chunk-LOMEH6DG.js +1 -0
  23. package/dist/{chunk-V4LF7D4F.js → chunk-MAEXP3KE.js} +1 -1
  24. package/dist/chunk-MJM6SFD3.js +3 -0
  25. package/dist/chunk-NLRW4BGG.js +8 -0
  26. package/dist/chunk-OJAJVH7S.js +5 -0
  27. package/dist/chunk-ONRYLR2D.js +2 -0
  28. package/dist/chunk-ORR3Q4WV.js +1 -0
  29. package/dist/chunk-OTEXGJDU.js +5 -0
  30. package/dist/chunk-P2VEMZH5.js +1 -0
  31. package/dist/chunk-PT6V53OO.js +1 -0
  32. package/dist/chunk-PYCLHOSA.js +9 -0
  33. package/dist/chunk-Q27BB5ZC.js +14 -0
  34. package/dist/chunk-QLD57GBB.js +6 -0
  35. package/dist/{chunk-NWIW7AWH.js → chunk-QMNML7XH.js} +1 -1
  36. package/dist/chunk-QR4DLZ3P.js +5 -0
  37. package/dist/chunk-TJ7YIRWQ.js +21 -0
  38. package/dist/{chunk-3P6AMTOS.js → chunk-VPFNZ7TB.js} +1 -1
  39. package/dist/chunk-W3XX2CNW.js +16 -0
  40. package/dist/chunk-X6DQWK2C.js +1 -0
  41. package/dist/chunk-XWR5YVA7.js +9 -0
  42. package/dist/chunk-YABL4EWX.js +7 -0
  43. package/dist/chunk-ZNNATBDC.js +1 -0
  44. package/dist/chunk-ZP4G3X44.js +4 -0
  45. package/dist/copy/copy.css +66 -177
  46. package/dist/copy/index.d.ts +0 -2
  47. package/dist/copy/index.js +31 -32
  48. package/dist/drag/drag.css +31 -11
  49. package/dist/drag/index.d.ts +10 -0
  50. package/dist/drag/index.js +1 -1
  51. package/dist/easel/index.d.ts +10 -1
  52. package/dist/easel/index.js +1 -1
  53. package/dist/fields/fields.css +35 -304
  54. package/dist/fields/index.d.ts +87 -95
  55. package/dist/fields/index.js +1 -1
  56. package/dist/gold/gold.css +3 -3
  57. package/dist/gold/index.d.ts +6 -5
  58. package/dist/gold/index.js +1 -1
  59. package/dist/{host-BQ_b9Qzk.d.ts → host-CiuzZJXj.d.ts} +11 -1
  60. package/dist/index.d.ts +3 -3
  61. package/dist/index.js +1 -1
  62. package/dist/menu/index.d.ts +49 -93
  63. package/dist/menu/index.js +1 -1
  64. package/dist/menu/menu.css +37 -246
  65. package/dist/node-ops/index.d.ts +1 -1
  66. package/dist/panel/index.d.ts +46 -72
  67. package/dist/panel/index.js +17 -18
  68. package/dist/panel/panel.css +143 -372
  69. package/dist/pick/index.d.ts +52 -33
  70. package/dist/pick/index.js +7 -7
  71. package/dist/pick/pick.css +19 -150
  72. package/dist/rail/index.d.ts +48 -90
  73. package/dist/rail/index.js +1 -1
  74. package/dist/rail/rail.css +21 -108
  75. package/dist/screen/components/AddBlockRow.d.ts +8 -2
  76. package/dist/screen/components/AddBlockRow.js +1 -1
  77. package/dist/screen/components/AddChildRow.d.ts +4 -3
  78. package/dist/screen/components/AddChildRow.js +1 -1
  79. package/dist/screen/components/AddSidePanel.js +1 -1
  80. package/dist/screen/components/MediaSidePanel.d.ts +2 -2
  81. package/dist/screen/components/MediaSidePanel.js +1 -1
  82. package/dist/screen/components/NodeContextMenu.d.ts +31 -9
  83. package/dist/screen/components/NodeContextMenu.js +1 -1
  84. package/dist/screen/components/PageEditGuardNotices.js +1 -1
  85. package/dist/screen/components/ScreenChrome.js +1 -1
  86. package/dist/screen/components/ScreenDocumentContext.d.ts +2 -2
  87. package/dist/screen/components/ScreenDocumentContext.js +1 -1
  88. package/dist/screen/components/ScreenMount.d.ts +8 -8
  89. package/dist/screen/components/ScreenMount.js +1 -1
  90. package/dist/screen/components/ScreenStoreProvider.d.ts +8 -8
  91. package/dist/screen/components/ScreenStoreProvider.js +1 -1
  92. package/dist/screen/components/SectionScreenShell.js +16 -16
  93. package/dist/screen/components/SidePanelHead.d.ts +4 -2
  94. package/dist/screen/components/SidePanelHead.js +1 -1
  95. package/dist/screen/components/UiIcon.d.ts +10 -26
  96. package/dist/screen/components/UiIcon.js +2 -1
  97. package/dist/screen/components/panel-widths.d.ts +15 -1
  98. package/dist/screen/components/panel-widths.js +1 -1
  99. package/dist/screen/components/usePartBridge.d.ts +8 -8
  100. package/dist/screen/components/usePartBridge.js +1 -1
  101. package/dist/screen/index.d.ts +9 -9
  102. package/dist/screen/index.js +1 -1
  103. package/dist/screen/lib/admin-bridge.d.ts +1 -1
  104. package/dist/screen/lib/admin-bridge.js +1 -1
  105. package/dist/screen/lib/chrome-theme.d.ts +20 -12
  106. package/dist/screen/lib/chrome-theme.js +1 -1
  107. package/dist/screen/lib/document-addressing.d.ts +2 -2
  108. package/dist/screen/lib/host-chrome.d.ts +1 -1
  109. package/dist/screen/lib/host.d.ts +2 -2
  110. package/dist/screen/lib/key-scope.d.ts +31 -2
  111. package/dist/screen/lib/key-scope.js +1 -1
  112. package/dist/screen/lib/links/link-filters.d.ts +1 -1
  113. package/dist/screen/lib/media-panel.d.ts +2 -2
  114. package/dist/screen/lib/media-picker.d.ts +2 -2
  115. package/dist/screen/lib/page-lock.d.ts +1 -1
  116. package/dist/screen/lib/puck/section-doc.d.ts +5 -1
  117. package/dist/screen/lib/puck/section-doc.js +1 -1
  118. package/dist/screen/lib/puck/style-clipboard.d.ts +8 -8
  119. package/dist/screen/lib/puck/use-section-ops.js +1 -1
  120. package/dist/screen/lib/screen-parts.d.ts +47 -10
  121. package/dist/screen/lib/screen-parts.js +1 -1
  122. package/dist/screen/lib/section-templates.d.ts +1 -1
  123. package/dist/screen/lib/session-context.d.ts +1 -1
  124. package/dist/screen/lib/session.d.ts +1 -1
  125. package/dist/screen/screen.css +54 -206
  126. package/dist/screen/words.d.ts +17 -1
  127. package/dist/screen/words.js +1 -1
  128. package/dist/shell/index.d.ts +134 -118
  129. package/dist/shell/index.js +1 -1
  130. package/dist/shell/shell.css +130 -88
  131. package/dist/strings/catalogue.d.ts +5 -5
  132. package/dist/strings/catalogue.js +1 -1
  133. package/dist/strings/index.d.ts +5 -5
  134. package/dist/strings/index.js +1 -1
  135. package/dist/style-clipboard/index.d.ts +1 -1
  136. package/dist/text-styles/index.d.ts +12 -3
  137. package/dist/text-styles/index.js +33 -38
  138. package/dist/text-styles/text-styles.css +39 -71
  139. package/dist/tree/index.d.ts +49 -44
  140. package/dist/tree/index.js +1 -1
  141. package/dist/tree/tree.css +31 -653
  142. package/dist/{types-DJDBtdB2.d.ts → types-BqGnUVX5.d.ts} +32 -32
  143. package/dist/types-BsyPh6EW.d.ts +99 -0
  144. package/dist/{types-DWS-s9z-.d.ts → types-CsgMwHHa.d.ts} +14 -11
  145. package/dist/{types-CqY85foL.d.ts → types-Dt1CFR1S.d.ts} +4 -2
  146. package/dist/{wordFit-D4S36PvB.d.ts → wordFit-7XpmhcaW.d.ts} +3 -5
  147. package/dist/words-Cl9xMUYY.d.ts +41 -0
  148. package/dist/{words-D_Lnw1Gr.d.ts → words-CvFnwGSr.d.ts} +1 -1
  149. package/package.json +5 -1
  150. package/dist/chunk-2UX75JDP.js +0 -1
  151. package/dist/chunk-3EDSDPIP.js +0 -1
  152. package/dist/chunk-3QVB4AG2.js +0 -3
  153. package/dist/chunk-3WSPDAK2.js +0 -1
  154. package/dist/chunk-53G47SWO.js +0 -1
  155. package/dist/chunk-5MZ3RNQQ.js +0 -13
  156. package/dist/chunk-5ZBBXZPV.js +0 -6
  157. package/dist/chunk-7FBDZTUD.js +0 -2
  158. package/dist/chunk-7V5WZ46F.js +0 -2
  159. package/dist/chunk-BXZ6WLHC.js +0 -22
  160. package/dist/chunk-BZ5ASXOL.js +0 -1
  161. package/dist/chunk-EOJNJCMJ.js +0 -16
  162. package/dist/chunk-EWVJSRRY.js +0 -6
  163. package/dist/chunk-FMGFZNPW.js +0 -1
  164. package/dist/chunk-H24N5TMZ.js +0 -11
  165. package/dist/chunk-HLEET6NV.js +0 -65
  166. package/dist/chunk-IE4GFYKO.js +0 -1
  167. package/dist/chunk-KTVH2ZRL.js +0 -15
  168. package/dist/chunk-N7VRF7PR.js +0 -5
  169. package/dist/chunk-OWBO4WKA.js +0 -0
  170. package/dist/chunk-P67FP7PG.js +0 -9
  171. package/dist/chunk-P6O363EE.js +0 -6
  172. package/dist/chunk-Q4N7C6CT.js +0 -10
  173. package/dist/chunk-QH6LCNOX.js +0 -8
  174. package/dist/chunk-RW4XBUUW.js +0 -1
  175. package/dist/chunk-TTJ54QGG.js +0 -18
  176. package/dist/chunk-VSHV6KJQ.js +0 -5
  177. package/dist/chunk-VSOP4GUM.js +0 -1
  178. package/dist/chunk-WZ7TGAAT.js +0 -3
  179. package/dist/chunk-YC4TB3CJ.js +0 -25
  180. package/dist/chunk-ZFDCDJNZ.js +0 -16
  181. package/dist/chunk-ZNS7727Y.js +0 -12
  182. package/dist/chunk-ZTTWFAAC.js +0 -1
  183. package/dist/types-Djdq6Xkd.d.ts +0 -138
  184. package/dist/words-DgHcY5qB.d.ts +0 -33
@@ -1,12 +1,12 @@
1
1
  import * as react from 'react';
2
- import { T as TopBarProps, a as TopBarClusterProps, b as TopBarRailProps, E as EaselIconButtonProps, c as DeviceSwitchProps, d as SaveStateProps, e as SaveStateToggleProps, P as PanelResizeHandleProps, I as InspectorHeadProps, f as InspectorIconButtonProps, g as InspectorUpLevelProps, M as MediaPanelHeadProps, h as MediaPickKind, i as EditNoticeProps } from '../types-CqY85foL.js';
3
- export { D as DeviceOption, R as RailWordsShown, S as SaveTone } from '../types-CqY85foL.js';
2
+ import { T as TopBarProps, a as TopBarClusterProps, b as TopBarRailProps, E as EaselIconButtonProps, c as DeviceSwitchProps, d as SaveStateProps, e as SaveStateToggleProps, P as PanelResizeHandleProps, I as InspectorHeadProps, f as InspectorIconButtonProps, g as InspectorUpLevelProps, M as MediaPanelHeadProps, h as MediaPickKind, i as EditNoticeProps } from '../types-Dt1CFR1S.js';
3
+ export { D as DeviceOption, R as RailWordsShown, S as SaveTone } from '../types-Dt1CFR1S.js';
4
4
  import { LockWords, EditAccess, SaveConflict } from '../edit-lock/index.js';
5
5
  import { N as NoticeWords } from '../words-AHHfiaRY.js';
6
6
  export { C as ChromeWords } from '../words-AHHfiaRY.js';
7
7
  export { D as DEFAULT_PANEL_W, M as MAX_PANEL_W, a as MIN_PANEL_W, P as PanelSide, b as PanelWidths, c as clampPanelWidth, p as panelWidthVars, s as setPanelWidthVars } from '../panelWidths-D9hTLR25.js';
8
- import '../types-DWS-s9z-.js';
9
- import '../wordFit-D4S36PvB.js';
8
+ import '../types-CsgMwHHa.js';
9
+ import '../wordFit-7XpmhcaW.js';
10
10
 
11
11
  /**
12
12
  * The editor's top bar — 52px, white, a soft shadow, three clusters.
@@ -41,52 +41,46 @@ declare function TopBarDivider(): react.JSX.Element;
41
41
  * chosen word otherwise the glyphs plus the open panel's word;
42
42
  * glyphs only when even that does not fit.
43
43
  *
44
- * THE WIDTH IS CSS'S QUESTION, NOT THIS COMPONENT'S. The column is a container
45
- * (`.es-rail-fit`), and the word-fit rule in `panel.css` — the one the
46
- * segmented control reads — compares it with the words' widths as the person
47
- * drags the panel, with no script running. 0.48.0 decided the same thing here
48
- * in JS, all-or-nothing, re-measuring the column on every resize; that rule is
49
- * gone, so there is one.
44
+ * THE SHELL'S, SINCE efficient-shell 4.165.0. The rail is the shell's worded
45
+ * `IconRail` (`labels="beside"`, `labelsFit`), which measures its buttons
46
+ * against this column — the rail's parent — and keeps the words that fit, as
47
+ * the column is dragged, as the labels change and once the web fonts load. This
48
+ * component used to measure the words on a canvas and hand a stylesheet rule
49
+ * their widths; none of that is left here. On a server, and before the first
50
+ * measurement, the rail is icon-only, which always fits.
50
51
  *
51
- * WHAT IS LEFT HERE IS THE ONE THING CSS CANNOT DO: say how wide a word is. The
52
- * words are measured on a canvas in the rail's own type (no hidden copy of the
53
- * rail in the page) once, again when the labels change, and once the web fonts
54
- * have loaded. On a server, and anywhere a canvas cannot measure, there is no
55
- * measurement and the rail is icon-only, which always fits.
56
- *
57
- * AND A HOST MAY ASK WHICH STATE IT IS IN (`onWords`; second host, 2026-10-07).
58
- * A longer language drops its words sooner — German "Zurück" and "Ebenen"
59
- * where English has "Back" and "Layers" — and because the choosing is CSS's, a
60
- * host had no way to see that it had happened. The answer is READ BACK from
61
- * what the stylesheet drew (a clipped word is 0 wide), never worked out a
62
- * second time here, so there is still one rule. Only a host that asks pays for
63
- * it: one ResizeObserver on the column.
52
+ * A HOST MAY ASK WHICH STATE IT IS IN (`onWords`; second host, 2026-10-07): a
53
+ * longer language drops its words sooner — German "Zurück" and "Ebenen" where
54
+ * English has "Back" and "Layers". The answer is the shell's own
55
+ * (`onLabelsShown`), told once measured and again when it changes.
64
56
  */
65
57
  declare function TopBarRail({ items, ariaLabel, onWords }: TopBarRailProps): react.JSX.Element;
66
58
 
67
59
  /**
68
- * A 30px glyph button in the top bar — undo, redo, the panel toggles.
60
+ * A glyph button in the top bar — undo, redo, the panel toggles.
69
61
  *
70
- * The label is the tooltip AND the accessible name, and it is required: an
71
- * icon-only button has no other name, and "button" is all a screen reader would
72
- * say. `state` is for a toggle; a plain action leaves it off.
62
+ * The shell's `IconButton` in the shell's `Tooltip` (harness UI-24, UI-17;
63
+ * efficient-easel#199 step 4): this name stays because both editors' hosts
64
+ * import it, but nothing here draws a button any more. The label is the
65
+ * tooltip AND the accessible name, and it is required: an icon-only button has
66
+ * no other name. `state` is for a toggle: it is `aria-pressed`, which the
67
+ * chrome's sheet reads for the glyph's ink (the shell's IconButton has no
68
+ * pressed look yet — a gap named for the shell); a plain action leaves it off.
73
69
  */
74
70
  declare function EaselIconButton({ label, onClick, disabled, state, buttonRef, children }: EaselIconButtonProps): react.JSX.Element;
75
71
 
76
72
  /**
77
- * Which device the canvas previews — icon-only, one button held down.
78
- *
79
- * Lifted from `efficient-storefront/components/DeviceSwitch.tsx`. It takes its devices
80
- * as a list because the two editors do not preview the same set: the website
81
- * has Desktop / Tablet / Mobile, an email has Desktop / Phone. The drawing, the
82
- * size and the pressed state are what must match, and those live here.
73
+ * Which device the canvas previews — icon-only, one held down.
83
74
  *
84
- * NOT `SettingsSegmented`, deliberately (card 66083): that control edits a value
85
- * a merchant STORES and draws words. This is toolbar chrome — glyphs sized to
86
- * the icon buttons around it, editing only transient view state.
75
+ * The shell's `Segmented` (a button group: no `name`, so nothing submits it),
76
+ * harness UI-24 / efficient-easel#199 step 4. It takes its devices as a list
77
+ * because the two editors do not preview the same set: the website has
78
+ * Desktop / Tablet / Mobile, an email has Desktop / Phone.
87
79
  *
88
- * `aria-pressed` carries the current device. Before card 66083 only a background
89
- * colour did, so the strip read as unnamed buttons with no current value.
80
+ * Each option is its glyph with its name beside it, visually hidden
81
+ * (`.es-vh`), so the button is named by words and the strip draws only the
82
+ * glyph; the name is also the glyph's `Tooltip` (UI-17 — never a `title`).
83
+ * `aria-pressed` carries the current device (the shell's button group).
90
84
  */
91
85
  declare function DeviceSwitch<Id extends string>({ devices, value, onChange, ariaLabel, }: DeviceSwitchProps<Id>): react.JSX.Element;
92
86
 
@@ -105,27 +99,28 @@ declare function DeviceSwitch<Id extends string>({ devices, value, onChange, ari
105
99
  */
106
100
  declare function SaveState({ tone, label, counting, waitMs, ringRef, role }: SaveStateProps): react.JSX.Element;
107
101
  /**
108
- * The pill as the autosave on / off switch. A bare `<button>` — a native button
109
- * ignores author background and border on some platforms — so the inner
110
- * `SaveState` carries every visual and this adds hover and a focus ring.
102
+ * The autosave on / off switch, with the pill beside it.
103
+ *
104
+ * The shell's `Switch` (UI-24, efficient-easel#199 step 4): ON while autosave
105
+ * is on, so `pressed` (autosave paused) is its `checked` turned over. The
106
+ * pill (`children`, a `SaveState`) is the switch's label, so a click on it
107
+ * still flips autosave; `title` — what a flip will do — is the switch's
108
+ * accessible name and its `Tooltip` (UI-17, never a `title` attribute).
111
109
  */
112
110
  declare function SaveStateToggle({ pressed, title, onToggle, children }: SaveStateToggleProps): react.JSX.Element;
113
111
 
114
112
  /**
115
- * A drag grip on a side panel's inner edge.
116
- *
117
- * Lifted from `efficient-storefront/components/PanelResizeHandle.tsx`; the campaign
118
- * designer carried its own copy of the same idea. It owns NO width: the editor
119
- * holds and persists it, and the grip only reports a new clamped width through
120
- * `onResize`. The host renders it as an absolute child of the panel row, pinned
121
- * over the panel↔canvas seam, so the panels' `overflow: hidden` never clips it.
113
+ * A drag grip on a side panel's inner edge: the shell's `ResizeHandle`
114
+ * (harness UI-24; since 1.0.0, efficient-easel#199). The splitter role, the
115
+ * keys (arrows by 16px, Home and End to the bounds, Enter back to the default),
116
+ * the 3px drag threshold, the double-click reset and the `Tooltip` (never
117
+ * `title=`) are the shell's.
122
118
  *
123
- * ARIA window splitter: a focusable `separator` with aria-value*, arrows nudge,
124
- * Home resets, double-click resets.
125
- *
126
- * This leaf HAS hooks and touches `document.body` — in handlers and an effect
127
- * cleanup only, never at module-eval or render. A server component may import
128
- * the module and must render it inside the host's client boundary.
119
+ * It owns NO width: the editor holds and persists it. What stays here is where
120
+ * the grip sits — `chrome.css`'s `.es-resizer--left|right`, pinned over the
121
+ * panel↔canvas seam from `--es-left-w` / `--es-right-w`, because the editors
122
+ * render it as a child of the panel ROW, not of the panel — and the hint in
123
+ * the host's language (`ChromeWords.resize`).
129
124
  */
130
125
  declare function PanelResizeHandle({ side, width, min, max, defaultWidth, label, onResize }: PanelResizeHandleProps): react.JSX.Element;
131
126
 
@@ -139,7 +134,12 @@ declare function PanelResizeHandle({ side, width, min, max, defaultWidth, label,
139
134
  * margin, size and weight, so being an h2 moves nothing on screen.
140
135
  */
141
136
  declare function InspectorHead({ icon, name, kind, actions }: InspectorHeadProps): react.JSX.Element;
142
- /** A 28px glyph button in the inspector head. Named, like every icon-only button. */
137
+ /**
138
+ * A glyph button in the inspector head: the shell's `IconButton` (ghost, or
139
+ * ghost-danger for Delete and the like) in the shell's `Tooltip` (UI-24,
140
+ * UI-17). Named, like every icon-only button; the tooltip says `title` where
141
+ * it differs from the name (why a disabled button is disabled).
142
+ */
143
143
  declare function InspectorIconButton({ label, title, hasPopup, onClick, disabled, danger, expanded, buttonRef, children, }: InspectorIconButtonProps): react.JSX.Element;
144
144
  /**
145
145
  * ← GO UP ONE LEVEL — a blue text link naming the level above what is open,
@@ -155,7 +155,8 @@ declare function InspectorIconButton({ label, title, hasPopup, onClick, disabled
155
155
  * drawn here, so a host passes no glyph, and the words are always WHERE IT
156
156
  * GOES — the parent's name, never "Back".
157
157
  *
158
- * The whole link is the button, arrow and name. The host renders nothing when
158
+ * The shell's `Button` in its `link` variant, in the shell's `Tooltip`
159
+ * (UI-24): the whole link is the button, arrow and name. The host renders nothing when
159
160
  * there is no level above (efficient-easel/node-ops `parentStep` says so) — a
160
161
  * dead control would be permanent furniture on the level selected most.
161
162
  *
@@ -204,6 +205,10 @@ declare function mediaPickKind(accept: string): MediaPickKind;
204
205
  * document, or a save was refused. Never a dialog (blueprint 2.5): the operator
205
206
  * has to be able to read and copy from the screen it is warning them about.
206
207
  *
208
+ * The shell's `Banner` (warning, or info for a neutral notice) with the
209
+ * shell's `Button`s as its action, their explanations in its `Tooltip`
210
+ * (UI-24, UI-17). The wrapper is the bar's place and its live role only.
211
+ *
207
212
  * The host places it (under the top bar, above the canvas) and owns the
208
213
  * handlers; the words are `editNotice`'s. Renders nothing when there is nothing
209
214
  * to say, so a host can mount it unconditionally.
@@ -1 +1 @@
1
- export{DEFAULT_PANEL_W,DeviceSwitch,EaselIconButton,EaselTopBar,EditNotice,InspectorHead,InspectorIconButton,InspectorUpLevel,MAX_PANEL_W,MIN_PANEL_W,MediaPanelHead,PanelResizeHandle,SaveState,SaveStateToggle,TopBarCluster,TopBarDivider,TopBarRail,clampPanelWidth,editNotice,mediaPickKind,panelWidthVars,setPanelWidthVars}from"../chunk-YC4TB3CJ.js";import"../chunk-ZJEBF4NB.js";import"../chunk-THWO5YVZ.js";import"../chunk-RE4LP46F.js";import"../chunk-WZ7TGAAT.js";import"../chunk-2OAZYSWJ.js";import"../chunk-MFIRYGHW.js";import"../chunk-BZ5ASXOL.js";import"../chunk-L5KW4HG5.js";
1
+ export{DEFAULT_PANEL_W,DeviceSwitch,EaselIconButton,EaselTopBar,EditNotice,InspectorHead,InspectorIconButton,InspectorUpLevel,MAX_PANEL_W,MIN_PANEL_W,MediaPanelHead,PanelResizeHandle,SaveState,SaveStateToggle,TopBarCluster,TopBarDivider,TopBarRail,clampPanelWidth,editNotice,mediaPickKind,panelWidthVars,setPanelWidthVars}from"../chunk-TJ7YIRWQ.js";import"../chunk-ZJEBF4NB.js";import"../chunk-THWO5YVZ.js";import"../chunk-RE4LP46F.js";import"../chunk-MJM6SFD3.js";import"../chunk-2OAZYSWJ.js";import"../chunk-MFIRYGHW.js";import"../chunk-L5KW4HG5.js";
@@ -0,0 +1 @@
1
+ import{newNodeId as t}from"./chunk-PLVEGYK6.js";function o(t){return{root:{props:{}},content:[t],zones:{}}}function r(t){return(t.content??[])[0]??null}function n(t){return Array.isArray(t)&&t.length>0&&t.every(t=>!!t&&"object"==typeof t&&"string"==typeof t.type&&"object"==typeof t.props)}function e(o,r){const p={...o.props,id:t(o.type)};for(const[t,o]of Object.entries(p))n(o)&&(p[t]=o.map(t=>e(t,r)));const s={type:o.type,props:p};if(!r)return s;const c=r(s);return{...c,props:{...c.props,id:p.id}}}export{e as cloneNodeWithFreshIds,r as docToNode,o as nodeToDoc};
@@ -0,0 +1,64 @@
1
+ import{dedupeSlotChildren as e}from"./chunk-26OOWIJJ.js";import{styleClipboardOf as n}from"./chunk-SQTY6CJD.js";import{markedTreeNodeId as t,revealSelectedTreeRow as o,sameSelector as r}from"./chunk-FGNR22NY.js";import{cloneNodeWithFreshIds as i}from"./chunk-2GVCAIPX.js";import{rootRowName as l,slotChildRowName as s,slotChildRenameProp as d,sectionRenameProp as c}from"./chunk-TBF5CVPA.js";import{scrollPreviewToSection as a,gotoPreviewSlide as p,scrollPreviewToTop as u}from"./chunk-4ES5JGGX.js";import{useEaselKeyTarget as f,useEaselUndoKeys as h,editorRootFocus as m}from"./chunk-PT6V53OO.js";import{SlotChildActionsProvider as g}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as y,DEFAULT_PANEL_W as k,clampPanelWidth as S}from"./chunk-ORR3Q4WV.js";import{usePartBridge as v}from"./chunk-DJMMTWFP.js";import{useSectionOps as x}from"./chunk-QMNML7XH.js";import{useNodeClipboard as b,useNodeContextMenu as w}from"./chunk-JLTZQ4US.js";import{PageEditGuardNotices as z}from"./chunk-MAEXP3KE.js";import{useScreenDocument as C}from"./chunk-ONRYLR2D.js";import{requestMediaPick as B}from"./chunk-KG7RJWOK.js";import{heldStyle as O,styleShortcut as $}from"./chunk-57DJOKXT.js";import{AddChildRow as N}from"./chunk-5545A3PC.js";import{AddSidePanel as I}from"./chunk-OTEXGJDU.js";import{SidePanelHead as P,PanelShowStrip as T}from"./chunk-QR4DLZ3P.js";import{MediaSidePanel as A}from"./chunk-CKEPQNSQ.js";import{useScreenSaveSwitch as R,useScreenNodeKeys as M,useScreenPinned as j,useScreenDocumentLabel as E,useScreenCanvasFrame as L,useScreenInspectorPanel as D,useScreenDevices as V,useScreenPickFollowsSelection as H,useScreenLeftView as W,useScreenAdd as F,SELECTION_MODE as J,sameInspectorMode as U,useScreenBridges as G,useScreenBlockRules as X,useScreenBlockLook as Y,useScreenStorageNamespace as Q,useScreenNotify as K,useScreenCanvasHead as _,isSlotMode as q,useScreenStyleClipboard as Z,useScreenDocumentPass as ee,useScreenCanvasDrag as ne,ScreenCanvasTargetProvider as te,isPinnedFirst as oe,isPinnedLast as re,screenSlotsOf as ie}from"./chunk-OJAJVH7S.js";import{ROOT_ZONE as le,blockNodeActions as se,TREE_MAX_DEPTH as de,childSlotsOf as ce,slotFieldsOf as ae,slotChildrenIn as pe,nestsInTree as ue,newNodeId as fe}from"./chunk-PLVEGYK6.js";import{useMediaPanel as he,usePanelPick as me,useCancelPanelPick as ge}from"./chunk-R6WTQWAC.js";import{useEaselHost as ye,useHostEscape as ke}from"./chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as Se}from"./chunk-E2O2MRZR.js";import{useEasel as ve,useEaselApi as xe}from"./chunk-PYCLHOSA.js";import{TreeRow as be,Subtree as we,LayersTree as ze,TreeGroupLabel as Ce,TreeRowAction as Be,TreeSeam as Oe}from"./chunk-XWR5YVA7.js";import{toItemSelector as $e,useNodeOps as Ne}from"./chunk-D2BCHTQR.js";import{saveIndicator as Ie}from"./chunk-H6DDIBQ4.js";import{EaselTopBar as Pe,TopBarRail as Te,TopBarCluster as Ae,EaselIconButton as Re,TopBarDivider as Me,DeviceSwitch as je,InspectorIconButton as Ee,PanelResizeHandle as Le,MAX_PANEL_W as De,MIN_PANEL_W as Ve,panelWidthVars as He,SaveState as We,SaveStateToggle as Fe}from"./chunk-TJ7YIRWQ.js";import{useWords as Je}from"./chunk-MFIRYGHW.js";import{CanvasDragLayer as Ue}from"./chunk-W3XX2CNW.js";import{createDragSession as Ge,useTreeDrag as Xe,gapToMoveIndex as Ye}from"./chunk-67GNT6PF.js";import{useCanvasFrame as Qe,BLOCK_SELECTOR as Ke,useCanvasEvent as _e}from"./chunk-PAELDYYS.js";import{LayersIcon as qe,MediaIcon as Ze,UndoIcon as en,RedoIcon as nn,TrashIcon as tn,EyeOffIcon as on,EyeIcon as rn,DuplicateIcon as ln}from"./chunk-L5KW4HG5.js";import{zoneKey as sn,ROOT_ID as dn,ROOT_SLOT as cn,parseZoneKey as an,DataError as pn}from"./chunk-KRXQM65X.js";import{useRef as un,useMemo as fn,useState as hn,useEffect as mn,useCallback as gn,useLayoutEffect as yn,Fragment as kn}from"react";import{Tooltip as Sn,Button as vn,toast as xn}from"efficient-shell/ui";import{jsx as bn,jsxs as wn,Fragment as zn}from"react/jsx-runtime";function Cn({saveState:e,notSaving:n,readOnlyReason:t,toggle:o,onToggle:r,onRetry:i}){if(null!==t)/* @__PURE__ */return bn(We,{tone:"off",label:t,role:"status"});if(n)/* @__PURE__ */
2
+ return bn(We,{tone:e.pending?"off-unsaved":"off",label:"Not saving — see the notice above",role:"status"});const{tone:l,label:s}=Ie(e),d=e.failed&&!e.paused&&/* @__PURE__ */bn(vn,{variant:"secondary",size:"sm",onClick:i,children:"Retry now"});/* @__PURE__ */
3
+ return wn(zn,o?{children:[
4
+ /* @__PURE__ */bn(Fe,{pressed:e.paused,onToggle:r,title:e.paused?"Auto-save is off — click to turn it back on (saves your held edits)":"Auto-save is on — click to pause it",children:/* @__PURE__ */bn(We,{tone:l,label:s})}),d]}:{children:[
5
+ /* @__PURE__ */bn(We,{tone:l,label:s,role:"status"}),d]})}function Bn({expand:e}){/* @__PURE__ */
6
+ return bn("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */wn(zn,e?{children:[
7
+ /* @__PURE__ */bn("path",{d:"M8 9l4-4 4 4"}),
8
+ /* @__PURE__ */bn("path",{d:"M8 15l4 4 4-4"})]}:{children:[
9
+ /* @__PURE__ */bn("path",{d:"M8 4l4 4 4-4"}),
10
+ /* @__PURE__ */bn("path",{d:"M8 20l4-4 4 4"}),
11
+ /* @__PURE__ */bn("path",{d:"M5 12h14"})]})})}function On(e,n,t){const o=t-n;if(o<6)return null;if(o<26)return{top:Math.round((n+t)/2),height:Math.round(o)};return{top:Math.round(Math.min(Math.max(e,n+13),t-13))}}var $n="__rungs";var Nn="screen:band",In={duplicate:!0,delete:!0};function Pn(){const Ie=ye(),{target:We,docId:Fe,capabilities:Pn,currentSlug:Tn,siteId:An,onPublish:Rn,saveState:Mn,saveConflict:jn,retrySave:En,toggleAutoSave:Ln,readOnly:Dn,readOnlyReason:Vn=null}=C(),Hn=R(),Wn=M(),{mediaEditing:Fn,hasEditGuard:Jn,hasPinnedChrome:Un}=Pn,{appState:Gn,dispatch:Xn,history:Yn,selectedItem:Qn,getSelectorForId:Kn,config:_n}=ve(e=>e),qn=j(),{first:Zn,firstGroup:et,lastGroup:nt,isSectionGroup:tt,sectionGroupZone:ot,panelOf:rt}=qn,it=rt(Zn),lt=e=>oe(qn,e),st=e=>re(qn,e),dt="node"===qn.firstRow,ct=qn.band??null,at=Je("screen",Se),pt=E()??`/${Tn}`,ut=L(),ft=D(),ht=x({readOnly:Dn}),mt=un(null),gt=xe(),yt=fn(()=>({...ht,select:e=>{mt.current=e,ht.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=gt.config;mt.current=$e(e,t,n)}ht.commitDocument(e,n)}}),[ht,gt]),kt=Gn.ui,St=kt.leftSideBarVisible,vt=kt.rightSideBarVisible,{options:xt,widths:bt,initial:wt,fluid:zt,fit:Ct}=V(),[Bt,Ot]=hn(wt),$t=he(),Nt=Fn&&null!==$t,It=me(),Pt=ge();H(Qn?.props.id);const{read:Tt,write:At,forSelection:Rt}=W(),[Mt,jt]=hn(Tt);mn(()=>{At(Mt)},[Mt]);const[Et,Lt]=hn(0),Dt=un(null),Vt=un(null),Ht=Qe(Vt,{readySelector:Ke}),Wt=f(Vt);h(Vt,Ht);const[Ft,Jt]=hn(!1),Ut=un(!1),Gt=un(!1),[Xt,Yt]=hn(null),Qt=F(),Kt=e=>Yt(null===e?null:{zone:le,index:e}),[_t,qt]=hn([]),[Zt,eo]=hn(J),no="puck"===Zt.kind,to=Ft&&!Xt&&Qt.railTarget?Qt.railTarget(Gn.data,{node:Qn??null,mode:Zt}):null,oo=to?{zone:sn(to),index:to.index}:null,ro=Xt??oo,io=ro&&ro.zone===le?ro.index:null,lo=t(Zt,Qn?.props.id),[so,co]=hn(null);mn(()=>{so&&(o(),co(null))},[so]);const ao=un(Kn);ao.current=Kn;const po=gn((e,{scroll:n})=>{jt(n=>Rt(e,n)),n&&co(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=ao.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&Ho(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),uo=un(null);mn(()=>{const e=uo.current;uo.current=null;const n=null==Qn?.props.id?null:String(Qn.props.id);eo(e&&e.id===n?e.mode:rt(Qn?.type)??J);const t=Qn?.props.id,o=mt.current;if(mt.current=null,!t)return;const i=Kn(t);po(String(t),{scroll:!r(o,i??null,le)})},[Qn?.props.id,po]);const fo=gn(e=>{eo(n=>U(n,e)?n:e),Xn({type:"setUi",ui:{rightSideBarVisible:!0}})},[Xn]),ho=un(()=>{});ho.current=(e,n)=>{const t=e?Tr(e.zone??le)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==Qn?.props.id?null:String(Qn.props.id);eo(e=>U(e,n)?e:n),o!==r&&(uo.current={id:o,mode:n},yt.select(e))};const mo=gn((e,n)=>ho.current(e,n),[]),go={kind:Zt.kind,mode:Zt,open:fo,show:e=>eo(e),reveal:()=>{vt||Xn({type:"setUi",ui:{rightSideBarVisible:!0}})},select:mo},yo=G(go,{data:Gn.data,selected:Qn??null,zoneOf:e=>Kn(e)?.zone,readOnly:Boolean(Dn),select:e=>{eo(J),yt.select({index:e})},replace:(e,n)=>yt.replaceComponent(le,e,n),scrollTo:e=>oi(e)},{device:Bt,refreshes:Et},{setView:jt,reveal:()=>{St||Xn({type:"setUi",ui:{leftSideBarVisible:!0}})}}),ko=yo.pinnedSource??!1,So=yo.resolveLeftView?yo.resolveLeftView(Mt,Nt):"media"===Mt&&Nt?Mt:"sections",vo=X(),{isLockedBlock:xo,duplicateBlocked:bo,nestDepth:wo,newSectionNode:zo,canAddTo:Co,blockIsOffered:Bo}=vo,Oo=Y(),{labelAtLevel:$o,Icon:No,useProducts:Io}=Oo,Po=Oo.rowName?(e,n,t)=>Oo.rowName(e,n,t):void 0,To=gn(e=>{Xn({type:"setUi",ui:{rightSideBarVisible:!0}}),a(e),po(e,{scroll:!0})},[Xn,po]),{selectNode:Ao,openPartId:Ro}=v({mode:Zt,setMode:eo,onOpenPart:To}),[Mo,jo]=hn(null);ke(null!==Mo,()=>jo(null));const Eo=y(Q()),Lo=Eo.collapsed,Do=Eo.panelWidths,[Vo,Ho]=hn(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(Lo);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
12
+ return new Set}});mn(()=>{try{window.localStorage.setItem(Lo,JSON.stringify([...Vo]))}catch{}},[Vo]);const[Wo,Fo]=hn(()=>{if("undefined"==typeof window)return{...k};try{const e=window.localStorage.getItem(Do);if(!e)return{...k};const n=JSON.parse(e);return{left:S(Number(n.left)||k.left),right:S(Number(n.right)||k.right)}}catch{return{...k}}});mn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(Do,JSON.stringify(Wo))}catch{}},300);return()=>clearTimeout(e)},[Wo]);const Jo=gn((e,n)=>Fo(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),Uo=gn(e=>Jo("left",e),[Jo]),Go=gn(e=>Jo("right",e),[Jo]),Xo=e=>Vo.has(e),Yo=e=>Ho(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Qo=un(!1),Ko=un(null);mn(()=>{if(Qo.current&&!Ft){const e=Ko.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??Vt.current?.querySelector(`button[aria-label="${CSS.escape(at.add.title)}"]`))?.focus(),Ko.current=null}Qo.current=Ft},[Ft]),mn(()=>{if(!Ft||!Wt)return;const e=e=>{"Escape"===e.key&&ui()};return Wt.addEventListener("keydown",e),()=>Wt.removeEventListener("keydown",e)},[Ft,Wt]),ke(Ft,()=>ui()),mn(()=>{!St&&Ft&&(Jt(!1),Yt(null),Ut.current=!1)},[St]),mn(()=>{if(!It)return Gt.current&&Xn({type:"setUi",ui:{leftSideBarVisible:!1}}),void(Gt.current=!1);Ft&&(Jt(!1),Yt(null),Gt.current=Ut.current,Ut.current=!1),St||(Gt.current=!0,Xn({type:"setUi",ui:{leftSideBarVisible:!0}}))},[It]),mn(()=>{!St&&It&&(Gt.current=!1,Pt())},[St]),mn(()=>{if(!It||!Wt)return;const e=e=>{"Escape"===e.key&&Pt()};return Wt.addEventListener("keydown",e),()=>Wt.removeEventListener("keydown",e)},[It,Wt]),ke(null!==It,()=>Pt());const _o=K(),qo=(e,n="success")=>{_o?_o(e,"error"===n?"error":"info"):"error"===n?xn.error(e,{duration:3200,sound:!1}):xn.success(e,{duration:1900,sound:!1})},Zo=un(null),[er,nr]=hn(0),[tr,or]=hn(0),rr=_(),ir=un(null),lr=e=>Math.max(0,e.clientHeight-(ir.current?.offsetHeight??0));mn(()=>{const e=Zo.current;if(!e)return;const n=()=>{nr(e.clientWidth),or(lr(e))};n();const t=new ResizeObserver(n);return t.observe(e),ir.current&&t.observe(ir.current),()=>t.disconnect()},[]),yn(()=>{Zo.current&&(nr(Zo.current.clientWidth),or(lr(Zo.current)))},[Wo,St,vt]);const sr=Bt===zt?er>0?er:bt[zt]:bt[Bt],dr=er>0?Math.min(er/sr,"shrink"===Ct?1:2):1,cr=sr*dr,ar=er>0&&cr>er+1,pr={width:cr,height:tr||"100%",flex:"none",position:"relative"},ur={width:sr,height:tr?tr/dr:"100%",maxHeight:"none",transform:1!==dr?`scale(${dr})`:void 0,transformOrigin:"top left"},fr=()=>Xn({type:"setUi",ui:{leftSideBarVisible:!St}}),hr=()=>Xn({type:"setUi",ui:{rightSideBarVisible:!vt}}),mr=e=>{Ft&&(Jt(!1),Yt(null),Ut.current=!1,St&&Mt===e)||It&&(Gt.current=!1,Pt(),St&&Mt===e)||(St&&Mt===e?fr():(jt(e),St||Xn({type:"setUi",ui:{leftSideBarVisible:!0}})))},gr=()=>{B(Ie,{accept:"image/*",title:"Media library"})},yr=()=>{eo(J),yt.select(null),u()},kr=()=>{eo(it??J),vt||Xn({type:"setUi",ui:{rightSideBarVisible:!0}})},Sr=Gn.data.content??[],vr=()=>{const e=Sr.findIndex(lt),n=Sr.findIndex(st);return{floor:e>=0?e+1:0,cap:n>=0?n:Sr.length}},xr=_n,br=vo.stripCopy,wr=e=>i(e,br),zr=b(),Cr=Ne({data:Gn.data,config:xr,readOnly:Boolean(Dn),clipboard:zr,strip:br?e=>br(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==dn||e.slot!==cn)return{min:0,max:n-1};const{floor:t,cap:o}=vr();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&eo(J);const t=void 0===n||"node"===n?.kind?n:null;yt.commitDocument(e,t)}}),Br=e=>_n.components[e]?.label??e,Or=gn(e=>_n.components[e]?.defaultProps??{},[_n]),$r=e=>$o(e,"section",Br(e)),Nr=e=>l({type:e.type,props:e.props??{}},$r(e.type),Po),{nodeAddresses:Ir,zoneItems:Pr}=fn(()=>{const e=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map,t=(o,r,i)=>{n.set(r,o),o.forEach((n,o)=>{const l=String(n.props?.id??"");if(l&&e.set(l,{zone:r,index:o}),i>=de)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of ce(_n,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(Sr,le,0),{nodeAddresses:e,zoneItems:n}},[Sr,_n]),Tr=gn(e=>Pr.get(e)??[],[Pr]),Ar=e=>{const n=Ir.get(e);return n?Tr(n.zone)[n.index]:void 0},Rr=e=>ie(vo,_n,e),Mr=e=>{if(!vo.slotsOf||e===le)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=Ar(e.slice(0,n));if(!t)return null;const o=Rr(t).filter(e=>e.rung),r=o.findIndex(t=>t.slot===e.slice(n+1));return r<0?null:{node:t,slot:o[r],position:r}},jr=(()=>{if(!q(Zt))return null;const e=`${Zt.nodeId}:${Zt.slot}`;return Mr(e)?.slot.panel===Zt.kind?e:null})(),Er=un(null);mn(()=>{const e=Er.current;if(Er.current=null,!jr||!q(Zt))return;const n=Zt.nodeId;po(n,{scroll:e!==jr}),Ho(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[Zt]);const Lr=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=Ir.get(e);n&&(n.zone===le?ri(n.index):Ri(n.zone,n.index,e,Ar(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&jr!==i&&(Er.current=i),mo(null,r),vt||Xn({type:"setUi",ui:{rightSideBarVisible:!0}}),oi(o)},Dr=(e,n,t)=>{const o=`${e}:${n}`;if(Ho(n=>{if(!n.has(o)&&!n.has(e))return n;const t=new Set(n);return t.delete(o),t.delete(e),t}),!t)return;jr!==o&&(Er.current=o);mo(null,{kind:t,nodeId:e,slot:n})},Vr=(e,n,t)=>{if(Dn||!vo.moveSlot)return;const o=Ar(e),r=o?Rr(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:$n,index:n},s=Ye(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=vo.moveSlot(e,n,s);"string"==typeof d&&Dr(e,d,i.panel)},Hr=Io(),Wr=fn(()=>{const e=/* @__PURE__ */new Map;for(const n of Hr??[])e.set(n.slug,n.name);return e},[Hr]),Fr=e=>s(e,Br,Oo.plainText,e=>Wr.get(e),Oo.rowName),Jr=(e,n)=>{const t=_n.components[e.type]?.fields,o=n===le||qi(n)?"section":"block",r=n===le&&(lt(e)||st(e)||tt(e.type)),i="block"===o?d(t):r?null:c(t);return Oo.renamePropOf?Oo.renamePropOf(e,o,i):i},Ur=(e,n,t,o)=>{if(!(!Dn&&Mo?.zone===e&&Mo.index===n))return;const r=(t,o)=>{jo(null),o&&((e,n,t)=>{const o=Tr(e)[n];if(!o)return;const r=Jr(o,e);r&&yt.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
13
+ return bn("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":"Rename",onClick:e=>e.stopPropagation(),onBlur:e=>r(e.currentTarget.value,!0),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),r(e.currentTarget.value,!0)):"Escape"===e.key&&(e.preventDefault(),r("",!1))}},t)},Gr=n(Z()),Xr=Gr.scope({target:We,siteId:An,docId:Fe}),Yr=_n,Qr=(e,n)=>n===le?$r(e):Br(e),Kr=(e,n,t)=>{const o=Gr.plan(Xr,t,Qr(t.type,e),Yr);o&&(o.changed&&yt.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),qo(o.message))},_r=w({nodesIn:Tr,nodeAt:(e,n)=>Tr(e)[n]??null,labelOf:(e,n)=>n===le?$r(e):Br(e),renamePropOf:Jr,beginRename:(e,n)=>jo({zone:e,index:n}),history:{hasPast:Yn.hasPast,hasFuture:Yn.hasFuture,back:()=>Yn.back(),forward:()=>Yn.forward()},openAddSection:()=>{yt.select(null),ai(null)},openPageSettings:()=>{yt.select(null),eo(J)},pageSettingsLabel:at.pageSettings,readOnly:Boolean(Dn),collapseAll:()=>Ho(new Set(Tr(le).map(e=>String(e.props.id)))),onPasteRefused:e=>qo(e?at.pasteRefused({name:e.label}):"Your browser won’t let us read the clipboard — press ⌘V","error"),canPasteAt:(e,n)=>el(e,n),menuRows:yo.menuRows,isLocked:e=>xo(e.type),duplicateBlocked:e=>bo(Gn.data,e),permits:e=>se(_n,e.type),canAddTo:Co,nodeOps:Cr,isPinned:(e,n)=>n===le&&(lt(e)||st(e)),sectionBand:vr,openAddInside:(e,n)=>{e===le?ri(n):yt.select({zone:e,index:n}),ai(null)},locate:e=>Ir.get(e)??null,rowNameOf:(e,n)=>n===le?Nr(e):Fr(e),selectAt:(e,n,t,o)=>{e===le?ri(n):Ri(e,n,t,o??"")},slotRung:e=>{const n=Mr(e);return n?.slot.panel?{label:n.slot.label,select:()=>Lr(n.node,n.slot,!1)}:null},style:{held:()=>O(Xr),canCopy:e=>Gr.rows(Yr,e).some(e=>!1!==e.counted),copy:(e,n)=>Gr.copy(Xr,e,Qr(e.type,n),Yr),paste:(e,n,t)=>Kr(e,n,t)},keys:Wn?{target:Wt,selected:()=>{const e=Gn.ui.itemSelector;return e?{zone:e.zone??le,index:e.index}:null},held:()=>zr.get(),readOnly:Boolean(Dn),onDone:({done:e,name:n})=>{"copied"===e&&qo(at.copied({name:n}))}}:void 0},Ht),qr=un({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});mn(()=>{qr.current={copy:(e,n)=>Gr.copy(Xr,e,Qr(e.type,n),Yr),paste:Kr,at:()=>{const e=Gn.ui.itemSelector;if(!e)return null;const n=e.zone??le,t=Tr(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(Dn)}});const Zr=gn(e=>{const n=$(e);if(!n)return;const t=qr.current,o=t.at();o&&(e.preventDefault(),"copy"===n?t.copy(o.node,o.zone):t.readOnly||t.paste(o.zone,o.index,o.node))},[]);mn(()=>{if(!Wt)return;const e=e=>Zr(e);return Wt.addEventListener("keydown",e),()=>Wt.removeEventListener("keydown",e)},[Zr,Wt]),_e(Ht,"keydown",Zr);const ei=Sr.map(e=>e.props.id).join("|");mn(()=>{const e=Ht?.document??null,n=Ht?.window??null;let t=0;const o=[],r=()=>{if(!e)return void qt(e=>e.length?[]:e);const n=Sr.findIndex(st),t=n>=0?n:Sr.length,o=n=>{const t=Sr[n]?.props?.id;return null==t?null:e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(Ke)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=1;e<=t;e++){const n=o(e),t=o(e-1),l=n?.getBoundingClientRect()??null,s=t?.getBoundingClientRect()??null;if(!l&&!s)continue;const d=On(l&&s?(s.bottom+l.top)/2:l?l.top:s.bottom,Math.max(-1/0,...r(t).map(e=>e.bottom)),Math.min(1/0,...r(n).map(e=>e.top)));d&&i.push({...d,index:e})}qt(e=>function(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t].top!==n[t].top||e[t].index!==n[t].index||e[t].height!==n[t].height)return!1;return!0}(e,i)?e:i)},i=()=>{cancelAnimationFrame(t),t=requestAnimationFrame(r)};if(!e||!n)return void r();n.addEventListener("scroll",i,{passive:!0});const l=new ResizeObserver(i);return l.observe(e.documentElement),r(),o.push(setTimeout(r,150),setTimeout(r,450)),()=>{cancelAnimationFrame(t),o.forEach(clearTimeout),n.removeEventListener("scroll",i),l.disconnect()}},[Ht,ei,Bt,dr,St,vt,Qn?.props.id]);const ni=Ht?.document??null,ti=Ht?.window??null;mn(()=>{const e=Dt.current;if(!e||!ni||!ti)return;const n=[],t=()=>{const n=ni.querySelector(`[data-puck-component="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&ti.scrollTo({left:ti.scrollX,top:ti.scrollY+t,behavior:"instant"}),!0};return Dt.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[ni,ti]);const oi=e=>{yo.holdCanvasOn?yo.holdCanvasOn(e):a(e)},ri=e=>{eo(J),yt.select({index:e}),yo.sectionPressed?.(Sr[e]);const n=Sr[e]?.props?.id;n&&oi(n)},ii=e=>{const{floor:n,cap:t}=vr(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=Qn&&Zt.kind!==it?.kind?Sr.findIndex(e=>e.props.id===Qn.props.id):-1;return o(r>=0?r+1:t)},li=(e,n)=>{const{floor:t,cap:o}=vr(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(yt.reorderComponent(le,e,i),yt.select({index:i}),{moved:!0,dest:i})},si=(e,n,t,o)=>{eo(J),yt.select(o?{index:o.index,zone:o.zone}:{index:e}),a(n),qo(`Added “${t}” section`)},di=(e,n)=>{const t=ii(n),o=zo(e,{nodeDefaults:Or,newNodeId:fe,sectionLabel:$r,blockIsOffered:Bo}),r=o?yt.insertNode(le,t,o):yt.insertSection(e,t);return si(t,r,$r(e),o?((e,n,t)=>{if(e.type===t)return null;const o={at:null},r=(e,n,i)=>{const l=i.filter(n=>n===e.type).length;for(const{child:s,zone:d,index:c}of ce(_n,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=Co(e.type,l,d.slice(d.lastIndexOf(":")+1)),i=r?.choices??(r?.spec?[{type:r.spec.childType,label:r.spec.childType}]:[]);null!==r&&"footer"!==r.source&&`${e.props.id}:${r.slot}`===d&&i.some(e=>e.type===t)&&(o.at={zone:d,index:c,depth:n})}r(s,n+1,[...i,e.type])}};return r({type:e.type,props:{...e.props,id:n}},1,[]),o.at?{zone:o.at.zone,index:o.at.index}:null})(o,r,e):null),t},ci=(e,n,t)=>{const o=ii(t),r=yt.insertNode(le,o,n);return si(o,r,e),o},ai=e=>pi(le,e),pi=(e,n)=>{Ko.current=document.activeElement??null,It&&(Ut.current=Gt.current,Gt.current=!1,Pt()),Yt(null===n?null:{zone:e,index:n}),Jt(!0),St||(Ut.current=!0,Xn({type:"setUi",ui:{leftSideBarVisible:!0}}))},ui=()=>{Jt(!1),Yt(null),Ut.current&&Xn({type:"setUi",ui:{leftSideBarVisible:!1}}),Ut.current=!1},fi=(e,n,t)=>{if("section"===e.kind)yt.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;yt.insertNode(n,t,wr(e.template.node))}eo(J),yt.select({index:t,zone:n})},hi=(e,n)=>Oo.rowName?n?lt(e)?Oo.rowName(e,"section",at.header):st(e)?Oo.rowName(e,"section",at.footer):tt(e.type)?Oo.rowName(e,"section",Br(e.type)):Nr(e):Fr(e):n?$r(e.type):Br(e.type),mi=e=>n=>{e()},gi=()=>yo.editPinnedSource?.(),yi=(e,n,t)=>{if(Dn)return null;const o=Tr(e)[n];return o&&!se(_n,o.type).delete?null:/* @__PURE__ */bn(Be,{kind:"delete",label:`Delete ${t}`,onClick:()=>((e,n)=>{const t=Tr(e)[n]?.props?.id;null!=t&&Cr.remove(String(t))})(e,n),children:/* @__PURE__ */bn(tn,{size:15})})},ki=e=>Oo.rowPreview?.(e)||void 0,Si=e=>Oo.rowMarks?.(e)??void 0,vi=(e,n,t)=>Oo.rowActions?.(e,n,t)??null,xi=(e,n,t,o)=>{if(Dn)return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
14
+ return bn(Be,{kind:"eye",label:r?`Show ${o}`:`Hide ${o}`,onClick:()=>wi(e,n,t),children:/* @__PURE__ */bn(r?on:rn,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},bi=e=>{const n=$r(Sr[e]?.type??""),t=n?at.addSectionBefore({name:n}):at.addSectionHere;return vl(le,e,()=>ai(e),t)},wi=(e,n,t)=>{yt.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},zi=e=>ae(_n,e),Ci=e=>ce(_n,e),Bi=e=>vo.slotsOf?Rr(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:pe(e,n.slot)})):[{slot:null,rung:null,kids:Ci(e)}],Oi=e=>vo.slotsOf?Bi(e).flatMap(e=>e.kids):Ci(e),$i=e=>Boolean(vo.slotsOf)&&Rr(e).some(e=>e.rung),Ni=(e,n,t)=>null===t?void 0===n?Co(e):Co(e,n):Co(e,n,t),Ii=(e,n,t)=>{const o=ue(_n,e.type,n)&&(t||Oi(e).length>0||$i(e));return{collapsible:o,folded:o&&Xo(String(e.props.id))}},Pi=(e,n,t)=>Bi(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>Ii(e,r,t(e.type)).collapsible?[String(e.props.id),...Pi(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),Ti=e=>Oi(e).length>0||$i(e)||Boolean(Co(e.type)),Ai=e=>Boolean(Co(e)),Ri=(e,n,t,o)=>{if(eo(J),Co(o)?.spec?.slider){const t=e.split(":")[0];p(t,n),yt.select({index:n,zone:e}),a(t)}else yt.select({index:n,zone:e}),oi(t)},Mi=(e,n,t,o,r)=>{const i=`${e}:${n}`;yt.insertComponent(i,t,o),Co(r)?.spec?.slider?requestAnimationFrame(()=>{p(e,o),yt.select({index:o,zone:i})}):yt.select({index:o,zone:i})},ji=(e,n,t)=>{yt.insertComponent(e,n,t),eo(J),yt.select({index:t,zone:e})},Ei=un(/* @__PURE__ */new Set);mn(()=>{Sr.forEach(e=>{const n=Co(e.type)?.spec;if(!n)return;const t=e.props.id;if(Ei.current.has(t))return;Ei.current.add(t);if((Array.isArray(e.props[n.slot])?e.props[n.slot]:[]).length>0)return;if(n.skipSeed?.(e.props))return;const o=`${t}:${n.slot}`,r=n.legacy?.(e.props)??[];(r.length?r:n.seeds(Or)).forEach((e,t)=>yt.seedChild(o,t,n.childType,e))})},[Sr,yt,Or]);const Li=un(/* @__PURE__ */new Set);mn(()=>{Sr.forEach((n,t)=>{const o=n.props.id;if(Li.current.has(o))return;const r=e(n,zi(n.type));Li.current.add(o),r&&yt.replaceComponent(le,t,{...n,props:r})})},[Sr,yt]),ee(yt,_n);const Di=Sr.findIndex(st),Vi=Di>=0?Sr[Di]:null,Hi=dt?Sr.findIndex(lt):-1,Wi=Hi>=0?Sr[Hi]:null,Fi=Sr.find(e=>e.type===et)??null,Ji=Sr.find(e=>e.type===nt)??null,Ui=Di>=0?Di:Sr.length,Gi=[];Sr.forEach(e=>{st(e)||(Ti(e)&&Gi.push(String(e.props.id)),Gi.push(...Pi(e,1,Ai)))}),Vi&&(Gi.push(String(Vi.props.id)),Gi.push(...Pi(Vi,1,Ai)));const Xi=Gi.length>0&&Gi.every(e=>Vo.has(e)),Yi=e=>{const n=Oo.blockRowName(e,Br);return Oo.rowName?Oo.rowName(e,"block",n):n},Qi=(e,n,t,o)=>{const r=Tr(e)[t];if(!r)return;const i={...an(e),index:t},l={...an(n),index:Math.min(Math.max(o,0),Tr(n).length)},s=Ye(i,l);if(e!==n||s!==t)try{Cr.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof pn))throw e}},Ki=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of Ci(e))n.add(r),t(o)};for(const t of zi(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},_i=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Ir.get(n);if(!e)return null;if(e.zone===le)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},qi=e=>{const n=e.slice(0,e.indexOf(":")),t=Sr.find(e=>tt(e.type)&&String(e.props.id)===n);return t&&ot(n)===e?t:null},Zi=(e,n,t)=>{if(e.rung){const t=Ar(e.rung.nodeId),o=t?Rr(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===$n&&n.index>=0&&n.index<=o}if(n.slot===$n)return!1;if(e.add)return tl(e.add,n);const o=sn(n);if(tt(e.type))return!1;const r=qi(o),i=qi(e.zone);if(r||i)return!(!r||!i)&&(n.index>=0&&n.index<=Tr(o).length);if(e.zone===le||o===le){if(e.zone!==o)return!1;const{floor:t,cap:r}=vr();return n.index>=t&&n.index<=r}if(n.index<0||n.index>Tr(o).length)return!1;if(e.zone===o)return!0;const l=Vi&&!qn.lastIsOpen?String(Vi.props.id):null;return(!l||_i(e.zone)!==l&&_i(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??Tr(e)[t];if(!r)return!1;const i=n.split(":")[0],l=Ir.get(i),s=l?Tr(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&Ki(r).has(n))return!1;const d=Co(s.type,wo(Gn?.data,s.type,i),n.slice(n.lastIndexOf(":")+1));return!!d&&(!!(d.choices?d.choices.some(e=>e.type===r.type):d.spec?.childType===r.type)&&!d.spec?.addBlocked?.(Tr(n),r))})(e.zone,o,e.index,t)},el=(e,n)=>{const t=sn(e.from);if(t===sn(n))return!0;const o=e.node;return Zi({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},nl=e=>{const n=e.slice(0,e.indexOf(":")),t=Ir.get(n),o=t?Tr(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=Co(o.type,wo(Gn?.data,o.type,n),e.slice(e.lastIndexOf(":")+1));if(!r||`${n}:${r.slot}`!==e)return null;if("footer"===r.source)return null;const i=r.choices??(r.spec?[{type:r.spec.childType,label:Br(r.spec.childType)}]:[]),l=Mr(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:hi(o,t.zone===le)}},tl=(e,n)=>{const t=sn(n);if("block"!==e.kind){if(qi(t))return n.index>=0&&n.index<=Tr(t).length;if(t!==le)return!1;const{floor:e,cap:o}=vr();return n.index>=e&&n.index<=o}if(t===le)return!1;const o=nl(t);return!(!o||!o.choices.some(n=>n.type===e.type))&&!o.target.spec?.addBlocked?.(Tr(t))},ol=(e,n)=>{e.rung?Vr(e.rung.nodeId,e.index,n.index):e.add?((e,n)=>{if("block"!==e.kind&&qi(sn(n)))return void fi(e,sn(n),n.index);if("section"===e.kind)return void di(e.type,n.index);if("template"===e.kind)return void ci(e.template.name,wr(e.template.node),n.index);const t=sn(n),o=nl(t);o&&(o.target.spec?Mi(o.parentId,o.target.slot,e.type,n.index,o.parent.type):ji(t,e.type,n.index))})(e.add,n):e.zone===le?li(e.index,n.index):Qi(e.zone,sn(n),e.index,n.index)},[rl]=hn(()=>Ge()),il=Xe({keyOf:e=>e.id,readOnly:Boolean(Dn),session:rl,canDrop:Zi,onDrop:ol,onStep:(e,n)=>{e.rung?Vr(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===le?((e,n)=>{const t=$r(Sr[e]?.type??""),o=li(e,n<0?e-1:e+2);if(!o.moved)return void qo(`“${t}” is already ${n<0?"first":"last"}`);const{floor:r,cap:i}=vr();qo(`Moved “${t}” to position ${o.dest-r+1} of ${i-r}`)})(e.index,n):Qi(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),ll=gn(e=>{const{floor:n,cap:t}=vr(),o=[];for(const r of e.nodes){const e=sn(r.place),i=Tr(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(lt(i)||st(i)||xo(i.type))continue;if(tt(i.type))continue;const l=Boolean(qi(e)),s=e===le||l;e===le&&t-n<2||o.push({key:r.id,item:{id:r.id,zone:e,index:r.place.index,type:i.type},box:r.box,label:s?$r(i.type):Fr(i),from:r.place})}return{sources:o,zones:e.zones.filter(e=>e.children.length>0||Boolean(nl(sn(e.list))?.choices.length)||Boolean(qi(sn(e.list))))}},[Gn.data]),sl=e=>{eo(J),yt.select(e.zone===le?{index:e.index}:{index:e.index,zone:e.zone})},dl=ne(),cl=()=>({data:Gn.data,device:Bt,ops:yt,inspector:go}),al=dl?.model,pl=fn(()=>al?e=>al(e,ll(e),cl()):ll,[al,ll,Bt]),ul=dl?.measure,fl=ul?(e,n)=>ul(e,n,cl()):void 0,hl=dl?.canDrop,ml=hl?(e,n)=>hl(e,n,Zi,cl()):Zi,gl=dl?.drop,yl=gl?(e,n)=>gl(e,n,ol,cl()):ol,kl=dl?.pick,Sl=kl?e=>kl(e,sl,cl()):sl,vl=(e,n,t,o)=>/* @__PURE__ */bn(Oe,{...Dn?{}:il.seam({place:{...an(e),index:n}}),onAdd:Dn?void 0:t,label:o},`seam:${e}:${n}`),xl={rowClick:mi,isCollapsed:Xo,toggleCollapse:Yo},bl=e=>{const n=String(e.props.id),t=Sr.findIndex(e=>String(e.props.id)===n),o=ot(n),r=Tr(o),i=Xo(n),l=Br(e.type),s=Oo.rowName?Oo.rowName(e,"section",l):l,d=e=>vl(o,e,()=>pi(o,e),at.addSectionHere);/* @__PURE__ */
15
+ return wn(zn,{children:[
16
+ /* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(No,{type:e.type,size:13}),name:s,preview:ki(e),marks:Si(e),onSelect:()=>ri(t),nameSlot:Ur(le,t,n,s),selected:lo===n,actions:vi(e,le,t)??void 0,rowProps:{"data-node-id":n,onClick:mi(()=>ri(t))},fold:{open:!i,label:"section",onToggle:()=>Yo(n)}}),!i&&/* @__PURE__ */wn(we,{children:[r.map((n,t)=>{const r=String(n.props.id),i=Nr(n),l=Ti(n),s=l&&Xo(r),c=()=>Ri(o,t,r,e.type),{rowProps:a,...p}=il.row({item:{id:r,zone:o,index:t,type:n.type},place:{...an(o),index:t}},{"data-node-id":r,onClick:mi(c)});/* @__PURE__ */
17
+ return wn(kn,{children:[d(t),
18
+ /* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(No,{type:n.type,size:13}),name:i,preview:ki(n),marks:Si(n),onSelect:c,nameSlot:Ur(o,t,r,i),selected:lo===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Yo(r)}:void 0,actions:/* @__PURE__ */wn(zn,{children:[yi(o,t,i),vi(n,o,t),xi(o,t,n,i)]}),rowProps:a}),l&&!s&&/* @__PURE__ */bn(we,{children:Cl(n,2)})]},r)}),d(r.length)]})]})},wl=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=il.dragging,d=!Xo(l)&&s?.rung?.nodeId!==i,c={...an(l),index:0},a=s&&!s.rung&&Zi(s,c)?c:void 0,p=()=>Lr(e,n,!0),{rowProps:u,...f}=il.row({item:{id:`rung:${l}`,zone:`${i}:${$n}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:$n,index:t},into:a,canDrag:Boolean(vo.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:mi(p)}),h=Dn?null:vo.slotActions?.(e,n.slot);/* @__PURE__ */
19
+ return wn(kn,{children:[n.heading,
20
+ /* @__PURE__ */bn(be,{icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:jr===l,...f,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>Yo(l)},actions:h&&h.length>0?/* @__PURE__ */bn(zn,{children:h.map((t,o)=>/* @__PURE__ */bn(Be,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(Dn||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&Dr(o,e,n.panel)},i=t.run();i&&"function"==typeof i.then?i.then(r):r(i)})(e,n,t),children:"delete"===t.kind?/* @__PURE__ */bn(tn,{size:15}):/* @__PURE__ */bn(ln,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */bn(we,{children:r})]},l)},zl=(e,n)=>{const t=Bi(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
21
+ return bn(zn,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=Ni(e.type,void 0,t.slot),d=s?`${e.props.id}:${s.slot}`:null,c=null===t.slot?null:`${e.props.id}:${t.slot}`,a=null!==c&&Boolean(nl(c)?.choices.length),p=(e,n)=>a?vl(e,n,()=>pi(e,n),"Add block here"):vl(e,n),u=/* @__PURE__ */wn(zn,{children:[i.map(({child:n,zone:t,index:o})=>{const r=lo===String(n.props.id),{collapsible:i,folded:s}=Ii(n,l,Ai(n.type)),d=String(n.props.id),c=Yi(n),a=()=>Ri(t,o,d,e.type),{rowProps:u,...f}=il.row({item:{id:d,zone:t,index:o,type:n.type},place:{...an(t),index:o}},{"data-node-id":d,onClick:mi(a)});/* @__PURE__ */
22
+ return wn(kn,{children:[0===o&&p(t,0),
23
+ /* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(No,{type:n.type,size:13}),name:c,preview:ki(n),marks:Si(n),onSelect:a,nameSlot:Ur(t,o,d,c),selected:r,hidden:Boolean(n.props._hidden),...f,fold:i?{open:!s,label:"group",onToggle:()=>Yo(d)}:void 0,actions:/* @__PURE__ */wn(zn,{children:[yi(t,o,c),vi(n,t,o),xi(t,o,n,c)]}),rowProps:u}),i&&!s&&/* @__PURE__ */bn(we,{children:zl(n,l+1)}),p(t,o+1)]},String(n.props.id??`${t}-${o}`))}),null===c?d&&!i.some(e=>e.zone===d)?p(d,0):null:0!==i.length||!t.rung&&d!==c?null:p(c,0)]});return t.rung?wl(e,t.rung,r++,o,u):/* @__PURE__ */bn(kn,{children:u},t.slot??"")})})},Cl=(e,n)=>{const t=wo(Gn?.data,e.type,String(e.props.id)),o=Bi(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
24
+ return bn(zn,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=Ni(e.type,t,o.slot),c=d?.spec??null,a=c&&Array.isArray(e.props[c.slot])?e.props[c.slot]:[],p=d&&d.choices?{slot:d.slot,choices:d.choices}:null,u=String(e.props.id),f=c&&!c.fixed?`${u}:${c.slot}`:null,h=p?`${u}:${p.slot}`:null,m=(n,t)=>{const o=n===f&&c&&!c.addBlocked?.(a)?()=>Mi(e.props.id,c.slot,c.childType,t,e.type):n===h?()=>pi(n,t):void 0;return vl(n,t,o,n===f&&c?c.addLabel:"Add block here")},g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(c&&!c.fixed&&(null===g||g===f)),k=/* @__PURE__ */wn(zn,{children:[l.map(({child:n,zone:t,index:o})=>{const r=lo===String(n.props.id),i=Fr(n),l=String(n.props.id),{collapsible:d,folded:c}=Ii(n,s,Ai(n.type)),a=zi(n.type),p=1===a.length?`${l}:${a[0]}`:null,u=p?{...an(p),index:Tr(p).length}:void 0,f=il.dragging,h=u&&f&&Zi(f,u)?u:void 0,g=()=>Ri(t,o,l,e.type),{rowProps:y,...k}=il.row({item:{id:l,zone:t,index:o,type:n.type},place:{...an(t),index:o},into:h,canDrag:!xo(n.type)},{"data-node-id":l,onClick:mi(g)});/* @__PURE__ */
25
+ return wn(kn,{children:[0===o&&m(t,0),
26
+ /* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(No,{type:n.type,size:13}),name:i,preview:ki(n),marks:Si(n),onSelect:g,nameSlot:Ur(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...k,fold:d?{open:!c,label:"group",onToggle:()=>Yo(l)}:void 0,actions:xo(n.type)?vi(n,t,o)??void 0:/* @__PURE__ */wn(zn,{children:[yi(t,o,i),vi(n,t,o),xi(t,o,n,i)]}),rowProps:y}),d&&!c&&/* @__PURE__ */bn(we,{children:Cl(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&c&&
27
+ /* @__PURE__ */bn(N,{small:!0,label:c.addLabel,blocked:c.addBlocked?.(a)??null,onAdd:()=>Mi(e.props.id,c.slot,c.childType,a.length,e.type)}),null===g?h&&!l.some(e=>e.zone===h)?m(h,0):null:0!==l.length||(o.rung?y:g!==h)?null:m(g,0)]});return o.rung?wl(e,o.rung,i++,r,k):/* @__PURE__ */bn(kn,{children:k},o.slot??"")})})},Bl=(()=>{if(!Qn||!no)return null;const e=String(Qn.type),n=String(Qn.props.id),t=Co(e,wo(Gn?.data,e,n));if(!t||"footer"===t.source)return null;const o=Sr.some(e=>String(e.props?.id)===n),r=Array.isArray(Qn.props[t.slot])?Qn.props[t.slot]:[];if(t.spec?.addBlocked?.(r))return null;const i=t.choices??(t.spec?[{type:t.spec.childType,label:Br(t.spec.childType)}]:[]);return 0===i.length?null:{parentName:hi(Qn,o),choices:i,onPick:o=>{t.spec?Mi(n,t.slot,o,r.length,e):ji(`${n}:${t.slot}`,o,r.length)}}})(),Ol=ro&&ro.zone!==le&&!qi(ro.zone)?ro.zone:null,$l=!0===Qt.blocksFirst,Nl=Ol?nl(Ol):$l&&ro?null:Bl,Il=Boolean(Xt&&Ol)||$l&&Boolean(Nl&&Nl.choices.length>0),Pl=Ft||null!==It,Tl=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:St&&!Pl&&So===e.id,onSelect:()=>mr(e.id)}:e,Al=[{id:"add",label:at.add.title,icon:/* @__PURE__ */bn("span",{className:"sf-rail-plus","aria-hidden":"true",children:"+"}),active:Ft,onSelect:()=>Ft?ui():ai(null)},...(yo.railLead??[]).map(Tl),{id:"sections",label:"Layers",icon:/* @__PURE__ */bn(qe,{}),active:St&&!Pl&&"sections"===So,onSelect:()=>mr("sections")},...(yo.railTrail??[]).map(Tl)];Nt?Al.push({id:"media",label:at.railMedia,icon:/* @__PURE__ */bn(Ze,{}),active:St&&!Ft&&(null!==It||"media"===So),onSelect:()=>mr("media")}):Fn&&Al.push({id:"media",label:at.railMedia,icon:/* @__PURE__ */bn(Ze,{}),onSelect:gr});const Rl=[...yo.railLead??[],...yo.railTrail??[]].find(e=>"panel"in e&&e.id===So),Ml=Boolean(ct?.foldable)&&!ko,jl=ct?.label??(Jn?at.pageSections:at.templateSections),El=Ml&&Xo(Nn),Ll=/* @__PURE__ */wn(zn,{children:[Sr.map((e,n)=>{if(lt(e)||st(e)||tt(e.type))return null;const t=lo===String(e.props.id),o=Boolean(e.props._hidden);Ci(e);const r=String(e.props.id),i=yo.hasOwnRows?.(e)??!1,l=Ti(e)||i,s=l&&Xo(r),{rowProps:d,...c}=il.row({item:{id:r,zone:le,index:n,type:e.type},place:{...an(le),index:n}},{"data-node-id":r,onClick:mi(()=>ri(n))});/* @__PURE__ */
28
+ return wn(kn,{children:[n>0&&bi(n),
29
+ /* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(No,{type:e.type,size:13}),name:Nr(e),preview:ki(e),marks:Si(e),onSelect:()=>ri(n),nameSlot:Ur(le,n,r,Nr(e)),selected:t,hidden:o,...c,fold:l?{open:!s,label:"section",onToggle:()=>Yo(r)}:void 0,actions:/* @__PURE__ */wn(zn,{children:[yi(le,n,Nr(e)),vi(e,le,n),xi(le,n,e,Nr(e))]}),rowProps:d}),Ti(e)&&!s&&/* @__PURE__ */wn(we,{children:[Cl(e,1),yo.partRows?.(e,xl)]}),i&&!s&&/* @__PURE__ */bn(we,{children:yo.ownRows?.(e,n,xl)})]},String(e.props.id??n))}),!ko&&Ui>0&&bi(Ui),ct?.addAtEnd&&!ko&&!Dn&&/* @__PURE__ */bn(N,{small:!0,label:at.addSection,blocked:null,onAdd:()=>ai(Ui)})]}),Dl=(e,n,t)=>{const o=String(e.props.id),r=Oi(e).length>0||$i(e)||Boolean(Co(e.type)),i=r&&Xo(o),l="header"===t?at.header:at.footer,s=Oo.rowName?Oo.rowName(e,"section",l):l;/* @__PURE__ */
30
+ return wn(zn,{children:[
31
+ /* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(No,{type:t,size:13}),name:s,preview:ki(e),marks:Si(e),onSelect:()=>ri(n),nameSlot:Ur(le,n,o,s),selected:lo===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Yo(o)}:void 0,actions:vi(e,le,n)??void 0,rowProps:{"data-node-id":o,onClick:mi(()=>ri(n))}}),r&&!i&&/* @__PURE__ */bn(we,{children:zl(e,1)})]})};return(yo.wrap??(e=>e))(
32
+ /* @__PURE__ */bn(te,{target:Ht,children:/* @__PURE__ */wn("div",{ref:Vt,className:"sf-editor es-editor",style:He(Wo),onContextMenu:_r.onEditorContextMenu,...m(Ie),children:[
33
+ /* @__PURE__ */wn(Pe,{children:[
34
+ /* @__PURE__ */bn(Te,{items:Al,ariaLabel:"Left panel views"}),
35
+ /* @__PURE__ */wn(Ae,{children:[
36
+ /* @__PURE__ */bn(Re,{label:"Undo",disabled:Boolean(Dn)||!Yn.hasPast,onClick:()=>Yn.back(),children:/* @__PURE__ */bn(en,{})}),
37
+ /* @__PURE__ */bn(Re,{label:"Redo",disabled:Boolean(Dn)||!Yn.hasFuture,onClick:()=>Yn.forward(),children:/* @__PURE__ */bn(nn,{})}),
38
+ /* @__PURE__ */bn(Me,{}),
39
+ /* @__PURE__ */bn(je,{devices:xt,value:Bt,onChange:Ot})]}),
40
+ /* @__PURE__ */wn(Ae,{kind:"right",style:{minWidth:300},children:[
41
+ /* @__PURE__ */bn(Cn,{saveState:Mn,notSaving:Boolean(Dn)||null!=jn,readOnlyReason:Vn,toggle:Hn,onToggle:Ln,onRetry:En}),yo.barLead?.(),
42
+ /* @__PURE__ */bn(Sn,{content:"Refresh the preview (reloads the canvas, keeps your place)",side:"bottom",children:/* @__PURE__ */bn(vn,{variant:"secondary",onClick:()=>{Dt.current=(()=>{const e=Ht?.document;if(!e)return null;const n=Sr.findIndex(st),t=n>=0?n:Sr.length;let o=null;for(let n=0;n<t;n++){const t=Sr[n]?.props?.id;if(null==t)continue;const r=e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`);if(!r)continue;const i=r.getBoundingClientRect().top;i<=4&&(null===o||i>o.offset)&&(o={id:String(t),offset:i})}if(!o){const e=Qn?.props?.id??Sr[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),Lt(e=>e+1)},children:"Refresh"})}),yo.barTrail?.(),yo.barMain?yo.barMain():/* @__PURE__ */bn(vn,{variant:"primary",disabled:null!==Vn,onClick:()=>{Rn(Gn.data)},children:at.done})]})]}),
43
+ /* @__PURE__ */bn(z,{}),
44
+ /* @__PURE__ */wn("div",{className:"sf-body",children:[St?/* @__PURE__ */wn(zn,{children:[
45
+ /* @__PURE__ */bn("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":at.leftPanel,children:Ft?/* @__PURE__ */bn(I,{blocks:Nl,blocksOnly:Il,at:Xt?{label:(e=>{const n=qi(e.zone);if(n)return at.add.addingTo({name:Oo.rowName?hi(n,!0):Br(n.type)});if(e.zone===le){const n=Sr[e.index];return n&&!st(n)?at.add.addingBefore({name:hi(n,!0)}):at.add.addingAtEnd}const t=nl(e.zone);return t?at.add.addingTo({name:t.parentName}):at.add.addingHere})(Xt),onClear:()=>Yt(null)}:void 0,onAdd:e=>{const n=ro,t=(e,n)=>{Xt&&Yt({zone:e,index:n})};if(n&&"block"!==e.kind&&qi(n.zone))return fi(e,n.zone,n.index),void t(n.zone,n.index+1);if("section"===e.kind)return(e=>{if(null===io)return void di(e);const n=di(e,io);Xt&&Kt(n+1)})(e.type);if("template"===e.kind)return((e,n)=>{if(null===io)return void ci(e,n);const t=ci(e,n,io);Xt&&Kt(t+1)})(e.template.name,wr(e.template.node));if(n&&n.zone!==le){const o=nl(n.zone);if(!o)return;return o.target.spec?Mi(o.parentId,o.target.slot,e.type,n.index,o.parent.type):ji(n.zone,e.type,n.index),void t(n.zone,n.index+1)}Bl?.onPick(e.type)},itemFor:e=>({id:`new:${e.kind}:${"template"===e.kind?e.template.id:e.type}`,zone:"",index:-1,type:"template"===e.kind?e.template.node.type:e.type,add:e}),session:rl,siteWide:yo.addPanelRow?.(ui),onClose:ui,onHide:fr,readOnly:Boolean(Dn)}):It&&$t?
46
+ /* @__PURE__ */bn(A,{panel:$t,pick:It,onHide:fr}):Rl?Rl.panel({onHide:fr,notify:qo}):"media"===So&&$t?/* @__PURE__ */bn(A,{panel:$t,pick:null,onHide:fr}):/* @__PURE__ */wn(zn,{children:[
47
+ /* @__PURE__ */bn(P,{icon:/* @__PURE__ */bn(qe,{}),title:"Layers",context:pt,actions:Gi.length>0?/* @__PURE__ */bn(Ee,{label:Xi?"Expand all sections":"Collapse all sections",onClick:()=>Ho(e=>{const n=new Set(Gi);return Xi?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...Gi])}),children:/* @__PURE__ */bn(Bn,{expand:Xi})}):void 0,onHide:fr}),
48
+ /* @__PURE__ */wn(ze,{className:"sf-tree sf-scroll",children:[
49
+ /* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(No,{type:"page",size:13}),name:at.pageSettings,onSelect:yr,selected:!Qn&&no,rowProps:{onClick:mi(yr)}}),Fi&&/* @__PURE__ */wn(zn,{children:[
50
+ /* @__PURE__ */bn(Ce,{children:at.header}),bl(Fi)]}),!ko&&Un&&/* @__PURE__ */wn(zn,{children:[
51
+ /* @__PURE__ */bn(Ce,{children:at.header}),!dt&&/* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(No,{type:"header",size:13}),name:at.header,onSelect:kr,selected:Zt.kind===it?.kind,rowProps:{onClick:mi(kr)}})]}),!ko&&Wi&&Dl(Wi,Hi,"header"),!ko&&!Ml&&/* @__PURE__ */bn(Ce,{children:jl}),Ml?/* @__PURE__ */wn(zn,{children:[
52
+ /* @__PURE__ */bn(be,{icon:null,name:jl,fold:{open:!El,label:jl,onToggle:()=>Yo(Nn)}}),!El&&/* @__PURE__ */bn(we,{children:Ll})]}):Ll,Un&&/* @__PURE__ */bn(Ce,{children:at.footer}),Vi&&Dl(Vi,Di,"footer"),!ko&&!Vi&&Un&&/* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(No,{type:"footer",size:13}),name:at.footer,onSelect:gi,rowProps:{onClick:mi(gi),title:"Edit the site footer"}}),Ji&&bl(Ji),yo.treeFoot?.()]})]})}),
53
+ /* @__PURE__ */bn(Le,{side:"left",width:Wo.left,min:Ve,max:De,defaultWidth:k.left,label:at.resizeLeftPanel,onResize:Uo})]}):/* @__PURE__ */bn(T,{side:"left",onShow:fr}),
54
+ /* @__PURE__ */wn("div",{ref:Zo,className:"sf-center sf-scroll","data-sf-canvas-head":rr?"":void 0,style:{overflowX:ar?"auto":"hidden",overflowY:"hidden"},children:[rr&&/* @__PURE__ */bn("div",{ref:ir,className:"sf-canvas-head",children:/* @__PURE__ */bn(rr,{device:Bt})}),
55
+ /* @__PURE__ */bn("div",{className:"sf-frame-scaler",style:pr,children:/* @__PURE__ */bn("div",{className:"sf-frame "+(Bt===zt?"":`sf-frame--${Bt}`),style:ur,children:/* @__PURE__ */wn("div",{className:"sf-preview-host",children:[
56
+ /* @__PURE__ */bn(ut,{},Et),
57
+ /* @__PURE__ */bn(Ue,{canvas:Ht,session:rl,model:pl,measure:fl,canDrop:ml,onDrop:yl,onPick:Sl,onZoneAdd:e=>{const n=sn(e),t=Mr(n);t&&Lr(t.node,t.slot,!1),pi(n,0)},zoneAddLabel:at.canvasAddBlock,readOnly:Boolean(Dn),revision:Gn.data}),_t.length>0&&/* @__PURE__ */bn("div",{className:"sf-preview-gaps","aria-hidden":"true",children:_t.map(e=>/* @__PURE__ */wn("button",{type:"button",tabIndex:-1,className:void 0===e.height?"sf-preview-gap":"sf-preview-gap sf-preview-gap--tight",style:void 0===e.height?{top:e.top}:{top:e.top,height:e.height},onClick:()=>ai(e.index),children:[
58
+ /* @__PURE__ */bn("span",{className:"sf-preview-gap-line"}),
59
+ /* @__PURE__ */wn("span",{className:"sf-preview-gap-pill",children:[
60
+ /* @__PURE__ */bn("span",{className:"sf-preview-gap-plus",children:"+"}),
61
+ /* @__PURE__ */bn("span",{className:"sf-preview-gap-label",children:"Add section"})]})]},e.index))})]})})})]}),vt?/* @__PURE__ */wn(zn,{children:[
62
+ /* @__PURE__ */bn(g,{value:{selectChild:Ri,addChild:Mi,childRowName:Fr,blockRowName:Yi},children:/* @__PURE__ */bn(ft,{mode:Zt,onOpenWebsiteSettings:yo.openSettings??(()=>{}),onOpenSiteStyles:yo.openStyles,onSelectNode:Ao,onNotify:qo,onHidePanel:hr,nodeActions:Qn?se(_n,Qn.type):In})}),
63
+ /* @__PURE__ */bn(Le,{side:"right",width:Wo.right,min:Ve,max:De,defaultWidth:k.right,label:"Resize settings panel",onResize:Go})]}):
64
+ /* @__PURE__ */bn(T,{side:"right",onShow:hr})]}),_r.menu]})}))}export{Pn as ScreenChrome};
@@ -0,0 +1,4 @@
1
+ import{Tooltip as e}from"efficient-shell/ui";import{useId as s}from"react";import{jsxs as i,Fragment as l,jsx as r}from"react/jsx-runtime";function n({label:n,blocked:a,onAdd:d,small:c=!1}){const o=null!==a,t=s(),m=/* @__PURE__ */i("button",{type:"button",className:"sf-add-card","aria-disabled":o||void 0,"aria-describedby":o?t:void 0,onClick:o?void 0:d,children:[
2
+ /* @__PURE__ */r("span",{className:c?"sf-plus sf-plus--sm":"sf-plus",children:"+"}),n]});return o?/* @__PURE__ */i(l,{children:[
3
+ /* @__PURE__ */r(e,{content:a,children:m}),
4
+ /* @__PURE__ */r("span",{id:t,className:"es-vh",children:a})]}):m}export{n as AddChildRow};
@@ -0,0 +1 @@
1
+ import{DEFAULT_FIELDS_WORDS as e}from"./chunk-FPOKPNO4.js";import{useWords as i}from"./chunk-MFIRYGHW.js";import{ShellStringsProvider as n,InputNumber as s,Tooltip as a}from"efficient-shell/ui";import{jsx as l}from"react/jsx-runtime";function r({id:r,value:t,onChange:m,min:o,max:c,step:u=1,shiftStep:d,styleValue:p,icon:f,unit:h,steppers:b=!1,placeholder:v,readOnly:x=!1,ariaLabel:y,ariaLabelledBy:N,title:O}){const g=i("fields",e),j="number"==typeof t&&Number.isFinite(t)?t:null,F=/* @__PURE__ */l("div",{className:`es-fnum${f?" es-fnum--icon":""}${null===j&&void 0!==p?" is-style":""}`,children:/* @__PURE__ */l(n,{value:{number:{increase:g.more,decrease:g.less}},children:/* @__PURE__ */l(s,{id:r,size:"sm",className:"es-fnum-box",value:j,onChange:e=>m(e??void 0),min:o,max:c,step:u,shiftStep:d,readOnly:x,steppers:b,snap:!0,placeholder:void 0!==p?String(p):v,prefix:f?/* @__PURE__ */l("span",{className:"es-fnum-icon",children:f}):void 0,suffix:h?/* @__PURE__ */l("span",{className:"es-fnum-unit",children:h}):void 0,"aria-label":y,"aria-labelledby":N})})});return O?/* @__PURE__ */l(a,{content:O,children:F}):F}export{r as FieldNumber};
@@ -0,0 +1 @@
1
+ import{EaselMenuItems as o,menuLabel as e}from"./chunk-EA2HTX37.js";import{ContextMenu as r}from"efficient-shell/ui";import{jsx as n}from"react/jsx-runtime";function l({x:l,y:t,items:i,onClose:m,owner:s,portalTo:u}){return 0===i.length?null:/* @__PURE__ */n(r,{at:{x:l,y:t},owner:s??u??null,onClose:m,"aria-label":e(i),children:/* @__PURE__ */n(o,{items:i,onClose:m})})}export{l as EaselContextMenu};
@@ -1,4 +1,4 @@
1
- import{useScreenOwnerName as e}from"./chunk-VSHV6KJQ.js";import{settlePanelPick as n}from"./chunk-R6WTQWAC.js";import{MediaPanelHead as i,mediaPickKind as c}from"./chunk-YC4TB3CJ.js";import{jsxs as o,Fragment as r,jsx as t}from"react/jsx-runtime";function l({panel:l,pick:d,onHide:m}){const p=e();/* @__PURE__ */
1
+ import{useScreenOwnerName as e}from"./chunk-OJAJVH7S.js";import{settlePanelPick as n}from"./chunk-R6WTQWAC.js";import{MediaPanelHead as i,mediaPickKind as c}from"./chunk-TJ7YIRWQ.js";import{jsxs as o,Fragment as r,jsx as t}from"react/jsx-runtime";function l({panel:l,pick:d,onHide:m}){const p=e();/* @__PURE__ */
2
2
  return o(r,{children:[
3
3
  /* @__PURE__ */t(i,{context:p,pick:d?{kind:c(d.accept),field:d.title||void 0}:null,onCancel:()=>d&&n(d.requestId,null),onHide:m}),
4
4
  /* @__PURE__ */t("div",{className:"sf-media-panel",children:/* @__PURE__ */t(l,{pick:d,onPick:e=>d&&n(d.requestId,e)})})]})}export{l as MediaSidePanel};
@@ -0,0 +1 @@
1
+ import{useSectionOps as o}from"./chunk-QMNML7XH.js";import{decodePartId as e,encodePartId as r}from"./chunk-IYT6NN2J.js";import{usePreviewParts as t}from"./chunk-I54UCYOU.js";import{SELECTION_MODE as n}from"./chunk-OJAJVH7S.js";import{useEasel as p}from"./chunk-PYCLHOSA.js";import{useCallback as d,useEffect as c}from"react";var s=o=>"part"===o.kind;function m({mode:m,setMode:i,onOpenPart:a}){const{getSelectorForId:u}=p(o=>o),I=o(),{setSelectedPartId:f,setSelectHandler:k}=t(),l=d(o=>{const r=e(o);if(!r)return;const{nodeId:t,propKey:p}=r;p?(i(o=>s(o)&&o.nodeId===t&&o.propKey===p?o:{kind:"part",nodeId:t,propKey:p}),a?.(t)):i(o=>"part"===o.kind?n:o)},[i,a]);c(()=>{k(l)},[k,l]);const h=s(m)?r(m.nodeId,m.propKey):null;c(()=>{f(h)},[h,f]);return{selectNode:d(o=>{i(()=>n);const e=u(o);e&&I.select(e)},[i,u,I]),openPartId:h}}export{m as usePartBridge};
@@ -1 +1 @@
1
- var e={title:"Add",contextBlocks:"Blocks for this place",contextAll:"Sections and blocks",done:"Done",doneDescription:"Close Add and go back",startBlank:"Start blank",templates:"Your templates",inside:({name:e})=>`Inside ${e}`,tile:({name:e})=>`Add ${e}`,hintBlocks:"Drag into the page, or click to add.",hint:"Drag onto the page, or click to add.",searchBlocks:"Search blocks",searchSections:"Search sections",addingTo:({name:e})=>`Adding to ${e}`,addingBefore:({name:e})=>`Adding before ${e}`,addingAtEnd:"Adding at the end of the page",addingHere:"Adding here"},t={loading:"Loading…",waitingForAuthorization:"Waiting for editor authorization…",missingTemplatePage:"Couldn’t open a page in this template.",missingPage:({slug:e})=>`No storefront page with slug "${e}".`,missingDocument:"Couldn’t open this document.",loadFailed:({cause:e})=>`Could not load the document — ${e}`,noun:"page",pageSettings:"Page settings",header:"Header",footer:"Footer",pageSections:"Template · Home page",templateSections:"Template · Template",addSection:"Add section",addSectionBefore:({name:e})=>`Add section before ${e}`,addSectionHere:"Add section here",done:"Done",copied:({name:e})=>`Copied ${e}`,pasteRefused:({name:e})=>`${e} can’t be pasted here.`,add:e};export{e as DEFAULT_SCREEN_ADD_WORDS,t as DEFAULT_SCREEN_WORDS};
1
+ var e={title:"Add",contextBlocks:"Blocks for this place",contextAll:"Sections and blocks",done:"Done",doneDescription:"Close Add and go back",startBlank:"Start blank",templates:"Your templates",inside:({name:e})=>`Inside ${e}`,tile:({name:e})=>`Add ${e}`,hintBlocks:"Drag into the page, or click to add.",hint:"Drag onto the page, or click to add.",searchBlocks:"Search blocks",searchSections:"Search sections",addingTo:({name:e})=>`Adding to ${e}`,addingBefore:({name:e})=>`Adding before ${e}`,addingAtEnd:"Adding at the end of the page",addingHere:"Adding here"},t={loading:"Loading…",waitingForAuthorization:"Waiting for editor authorization…",missingTemplatePage:"Couldn’t open a page in this template.",missingPage:({slug:e})=>`No storefront page with slug "${e}".`,missingDocument:"Couldn’t open this document.",loadFailed:({cause:e})=>`Could not load the document — ${e}`,noun:"page",pageSettings:"Page settings",header:"Header",footer:"Footer",pageSections:"Template · Home page",templateSections:"Template · Template",addSection:"Add section",addSectionBefore:({name:e})=>`Add section before ${e}`,addSectionHere:"Add section here",done:"Done",copied:({name:e})=>`Copied ${e}`,pasteRefused:({name:e})=>`${e} can’t be pasted here.`,add:e,canvasAddBlock:"Add block",railMedia:"Media library",leftPanel:"Left panel",resizeLeftPanel:"Resize left panel"};export{e as DEFAULT_SCREEN_ADD_WORDS,t as DEFAULT_SCREEN_WORDS};
@@ -0,0 +1,5 @@
1
+ import{PopupMenuDivider as e,PopupMenuLabel as n,PopupSubmenu as l,PopupMenuItem as r}from"efficient-shell/ui";import{jsx as i,Fragment as c,jsxs as a}from"react/jsx-runtime";function t({items:a,onClose:t}){/* @__PURE__ */
2
+ return i(c,{children:a.map((c,a)=>{if("—"===c.label)/* @__PURE__ */return i(e,{},a);if(c.header)/* @__PURE__ */return i(n,{children:c.label},a);if(c.children?.length){const e=c.children.some(e=>void 0!==e.checked);/* @__PURE__ */
3
+ return i(l,{label:c.label,icon:u(c),children:c.children.map((n,l)=>/* @__PURE__ */i(r,{danger:n.danger,onClick:n.onClick,...e?{role:"menuitemradio",checked:Boolean(n.checked)}:{},children:d(n)},l))},a)}/* @__PURE__ */
4
+ return i(r,{danger:c.danger,onClick:()=>{c.onClick(),t()},children:d(c)},a)})})}function o(e){return e.find(e=>e.header)?.label}function u(e){return null==e.icon?null:/* @__PURE__ */i("span",{className:"es-menu-icon","aria-hidden":"true",children:e.icon})}function d(e){return null==e.icon&&null==e.shortcut?e.label:/* @__PURE__ */a(c,{children:[u(e),
5
+ /* @__PURE__ */i("span",{className:"es-menu-label",children:e.label}),null==e.shortcut?null:/* @__PURE__ */i("span",{className:"es-menu-shortcut","aria-hidden":"true",children:e.shortcut})]})}export{t as EaselMenuItems,o as menuLabel};
@@ -1,2 +1,2 @@
1
- import{ScreenPartsProvider as t}from"./chunk-VSHV6KJQ.js";import{useEaselHost as r}from"./chunk-U3JP4VGF.js";import{createEasel as e,EaselProvider as n}from"./chunk-P67FP7PG.js";import{useState as o,useEffect as s}from"react";import{jsx as i}from"react/jsx-runtime";function a({config:a,data:c,onChange:m,permissions:p,parts:f,children:u}){const[h]=o(()=>e({config:a,data:c,permissions:p}));s(()=>{h.setConfig(a)},[h,a]),s(()=>{if(!m)return;let t=h.getState().appState.data;return h.subscribe(()=>{const r=h.getState().appState.data;r!==t&&(t=r,m(r))})},[h,m]),s(()=>{p&&h.setPermissions(p)},[h,p]);const d=r();/* @__PURE__ */
1
+ import{ScreenPartsProvider as t}from"./chunk-OJAJVH7S.js";import{useEaselHost as r}from"./chunk-U3JP4VGF.js";import{createEasel as e,EaselProvider as n}from"./chunk-PYCLHOSA.js";import{useState as o,useEffect as s}from"react";import{jsx as i}from"react/jsx-runtime";function a({config:a,data:c,onChange:m,permissions:p,parts:f,children:u}){const[h]=o(()=>e({config:a,data:c,permissions:p}));s(()=>{h.setConfig(a)},[h,a]),s(()=>{if(!m)return;let t=h.getState().appState.data;return h.subscribe(()=>{const r=h.getState().appState.data;r!==t&&(t=r,m(r))})},[h,m]),s(()=>{p&&h.setPermissions(p)},[h,p]);const d=r();/* @__PURE__ */
2
2
  return i(n,{easel:h,hotkeys:d.ownsDocument,children:/* @__PURE__ */i(t,{parts:f,children:u})})}export{a as ScreenStoreProvider};
@@ -0,0 +1,6 @@
1
+ import{DEFAULT_PICK_WORDS as e}from"./chunk-ZAOM6PFH.js";import{parseHexColor as t,Popover as n,colorSwatchClasses as r,colorFill as l,ColorPickerPanel as i}from"efficient-shell/ui";export{hexToHsv,hsvToHex}from"efficient-shell/ui";import{useRef as a,useState as s,useLayoutEffect as o,useEffect as c}from"react";import{jsx as u,jsxs as p}from"react/jsx-runtime";var d=t,h=7,m=e=>e.toUpperCase(),g=(e,t,n)=>Math.min(n,Math.max(t,e));function f(e,t,n){return{s:n.width>0?g((e-n.left)/n.width,0,1):0,v:n.height>0?1-g((t-n.top)/n.height,0,1):0}}function v(e,t){return t.width>0?360*g((e-t.left)/t.width,0,1):0}function w(e){if(/^(data|blob):/i.test(e))return"";const t=(e.split(/[?#]/)[0]??"").split("/").filter(Boolean).pop()??"";try{return decodeURIComponent(t)}catch{return t}}function k({value:t,onChange:i,label:h,theme:g,caption:f,inherited:v,after:w,id:k,readOnly:x,words:y=e.colour}){const E=a(null),L=a(null),N=()=>{const e=E.current?.parentElement;return e?.classList.contains("es-field-head")?e.querySelector(":scope > .es-field-name .es-field-label"):e?.classList.contains("es-pick-line")?e.querySelector(":scope > .es-pick-line-label"):null},B=()=>L.current?.querySelector(".es-pick-hexwrap > *")??null,O=e=>e.scrollWidth>e.clientWidth+1,R=e=>{e&&(O(e)?e.dataset.clipped="true":delete e.dataset.clipped)},D=a(()=>{});D.current=()=>{R(N()),P||R(B())};const[T,M]=s(null),[P,S]=s(null);o(()=>D.current()),c(()=>{const e=E.current?.parentElement,t=e?.ownerDocument.defaultView;if(!e||!t?.ResizeObserver)return;const n=new t.ResizeObserver(()=>D.current());return n.observe(e),()=>n.disconnect()},[]),c(()=>{const e=E.current?.parentElement;if(!e)return;const t=e=>{const t=e;if(!t)return null;const n=N(),r=B();return n&&(t===n||n.contains(t))?n:r&&t===r?r:null},n=e=>{const n=t(e.target),r=U();if(!n||!r||n.ownerDocument.activeElement===n||!O(n))return;const l=n.getBoundingClientRect(),i=r.getBoundingClientRect(),a="INPUT"===n.tagName?n.value:n.textContent??"";M({text:a,left:l.left-i.left,top:l.top-i.top})},r=e=>{t(e.target)&&M(null)};return e.addEventListener("pointerover",n),e.addEventListener("pointerout",r),()=>{e.removeEventListener("pointerover",n),e.removeEventListener("pointerout",r)}},[]);const U=()=>{const e=E.current?.parentElement;return e&&(e.classList.contains("es-field-head")||e.classList.contains("es-pick-line"))?e:L.current},W=t?null:d(v??""),q=void 0===f||t&&d(f)===d(t)?null:f,F=q??(t?m(t):W?m(W):y.notSet);/* @__PURE__ */
2
+ return u("div",{ref:E,className:"es-pick-colour",children:/* @__PURE__ */p("div",{ref:L,className:"es-pick-colour-row","data-editing":P??void 0,onFocus:e=>{const t=e.target,n=U();if(!n||!t.classList.contains("es-pick-hex"))return;M(null),t.style.setProperty("--es-pick-edit-room",n.getBoundingClientRect().right-t.getBoundingClientRect().left+"px");const r=t.parentElement?.nextElementSibling,l=!!r&&t.getBoundingClientRect().right>r.getBoundingClientRect().left-2;S(l?"over":"room")},onBlur:e=>{const t=e.target;t.classList.contains("es-pick-hex")&&(t.style.removeProperty("--es-pick-edit-room"),S(null))},children:[
3
+ /* @__PURE__ */u(n,{id:k,className:"es-pick-swatch-wrap",trigger:/* @__PURE__ */u("span",{"aria-hidden":"true",style:{position:"absolute",inset:0,...l(t||W)}}),triggerLabel:y.swatch({label:h,shown:F}),triggerClassName:r({className:t?"es-pick-swatch":W?"es-pick-swatch is-inherited":"es-pick-swatch is-unset"}),"aria-label":y.dialog({label:h}),disabled:x,children:/* @__PURE__ */u(b,{value:t,onChange:i,label:h,theme:g,inherited:v,readOnly:x})}),
4
+ /* @__PURE__ */u("span",{className:"es-pick-hexwrap",children:null===q?/* @__PURE__ */u(C,{value:t,follows:W?m(W):void 0,onChange:e=>{x||e===t||i(e)},name:y.hex({label:h}),readOnly:x}):/* @__PURE__ */u("span",{className:"es-pick-caption",children:q})}),w,T?/* @__PURE__ */u("span",{className:"es-pick-tag","aria-hidden":"true",style:{left:T.left,top:T.top},children:T.text}):null]})})}function b({value:e,onChange:t,label:n,theme:r,onClose:l,id:a,inherited:s,readOnly:o,words:c,swatch:p,dragWrites:d="live"}){/* @__PURE__ */
5
+ return u(i,{id:a,className:"es-pick-window",value:e,onChange:t,label:n,presets:r?.map(e=>({value:e.value,label:e.name})),fallback:s,dragWrites:d,disabled:o,onClose:l})}function C({value:e,follows:t,onChange:n,name:r,readOnly:l}){const[i,o]=s(null),c=a(!1);/* @__PURE__ */
6
+ return u("input",{type:"text",className:!e&&t?"es-pick-hex is-inherited":"es-pick-hex",value:i??(e?m(e):t??""),"aria-label":r,maxLength:7,spellCheck:!1,autoComplete:"off",readOnly:l,onChange:t=>{o(t.target.value);const r=d(t.target.value);null!==r&&r!==e&&n(r)},onFocus:e=>e.currentTarget.select(),onMouseDown:e=>{c.current=e.currentTarget.ownerDocument.activeElement!==e.currentTarget},onMouseUp:e=>{c.current&&e.preventDefault(),c.current=!1},onKeyDown:e=>{"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),e.stopPropagation(),o(null),e.currentTarget.blur())},onBlur:()=>o(null)})}export{k as ColourPicker,b as ColourWindow,h as HEX_MAX_LENGTH,m as hexReadout,v as hueFromPoint,w as mediaName,f as svFromPoint,d as typedHex};
@@ -0,0 +1 @@
1
+ var e={accent:"var(--accent-600, var(--submit-bg))",accentTint:"color-mix(in srgb, var(--es-accent) 10%, var(--surface))",accentTintStrong:"color-mix(in srgb, var(--es-accent) 18%, var(--surface))",accentLine:"color-mix(in srgb, var(--es-accent) 32%, var(--surface))",accentText:"color-mix(in srgb, var(--es-accent) 65%, var(--ink-strongest))",accentRing:"var(--rosh-focus-ring)",accentShadow:"color-mix(in srgb, var(--es-accent) 35%, transparent)",onAccent:"var(--status-on-solid)",appBg:"var(--surface-sunken)",previewBg:"var(--surface-raised)",panel:"var(--surface)",raised:"var(--surface)",topbarBg:"var(--surface)",frameBg:"#ffffff",hover:"var(--surface-raised)",hatch:"color-mix(in srgb, var(--ink-strongest) 2%, transparent)",addcardVeil:"color-mix(in srgb, var(--surface-sunken) 66%, transparent)",fieldBg:"var(--surface)",trackBg:"var(--surface-raised)",inputBorder:"var(--line-strong)",fieldText:"var(--ink-strong)",fieldPlaceholder:"var(--ink-faintest)",knob:"var(--surface)",text:"var(--ink-strongest)",textStrong:"var(--ink-strongest)",textSecondary:"var(--ink)",muted:"var(--ink-faint)",icon:"var(--ink-faint)",disabled:"var(--ink-faintest)",divider:"var(--line)",line:"var(--line)",btnBorder:"var(--line-strong)",btnText:"var(--ink)",chipBg:"var(--surface-raised)",chipFg:"var(--ink-faint)",brandSquare:"var(--ink-strongest)",deviceBorder:"var(--line)",toastBg:"var(--status-draft-solid)",toggleOff:"var(--line-strong)",scrollbar:"var(--line-strong)",scrollbarHover:"var(--ink-faintest)",danger:"var(--status-danger-soft-ink)",dangerStrong:"var(--status-danger-soft-ink)",dangerTint:"var(--status-danger-soft)",warning:"var(--status-pending-soft-ink)",previewTint:"var(--status-pending-soft)",success:"var(--status-success-soft-ink)",panelRadius:"var(--radius-xl)",rowRadius:"var(--radius-lg)",fieldRadius:"var(--radius-md)",panelGap:12,space2:2,space4:4,space8:8,space12:12,space16:16,space32:32,panelShadow:"0 1px 2px rgba(0, 0, 0, 0.05), 0 10px 30px rgba(0, 0, 0, 0.06)",topbarShadow:"0 1px 3px rgba(0, 0, 0, 0.06)",raisedShadow:"0 1px 2px rgba(16, 24, 40, 0.1)",font:"var(--font-sans)"},a={previewBg:"var(--surface)",trackBg:"var(--surface)",chipBg:"var(--surface)"},r=[e.space2,e.space4,e.space8,e.space12,e.space16,e.space32],s={accent:"--es-accent",accentTint:"--es-accent-tint",accentTintStrong:"--es-accent-tint-strong",accentLine:"--es-accent-line",accentText:"--es-accent-text",accentRing:"--es-accent-ring",accentShadow:"--es-accent-shadow",onAccent:"--es-on-accent",appBg:"--es-app-bg",previewBg:"--es-preview-bg",panel:"--es-panel",raised:"--es-raised",topbarBg:"--es-topbar-bg",frameBg:"--es-frame-bg",hover:"--es-hover",hatch:"--es-hatch",addcardVeil:"--es-addcard-veil",fieldBg:"--es-field-bg",trackBg:"--es-track-bg",inputBorder:"--es-input-border",fieldText:"--es-field-text",fieldPlaceholder:"--es-field-placeholder",knob:"--es-knob",text:"--es-text",textStrong:"--es-text-strong",textSecondary:"--es-text-secondary",muted:"--es-muted",icon:"--es-icon",disabled:"--es-disabled",divider:"--es-divider",line:"--es-line",btnBorder:"--es-btn-border",btnText:"--es-btn-text",chipBg:"--es-chip-bg",chipFg:"--es-chip-fg",brandSquare:"--es-brand-square",deviceBorder:"--es-device-border",toastBg:"--es-toast-bg",toggleOff:"--es-toggle-off",scrollbar:"--es-scrollbar",scrollbarHover:"--es-scrollbar-hover",danger:"--es-danger",dangerStrong:"--es-danger-strong",dangerTint:"--es-danger-tint",warning:"--es-warning",previewTint:"--es-preview-tint",success:"--es-success",panelRadius:"--es-panel-radius",rowRadius:"--es-row-radius",fieldRadius:"--es-field-radius",panelGap:"--es-panel-gap",space2:"--es-space-2",space4:"--es-space-4",space8:"--es-space-8",space12:"--es-space-12",space16:"--es-space-16",space32:"--es-space-32",panelShadow:"--es-panel-shadow",topbarShadow:"--es-topbar-shadow",raisedShadow:"--es-raised-shadow",font:"--es-font"};export{r as SPACING_SCALE,s as shellCssVars,a as shellDarkTokens,e as shellTokens};
@@ -0,0 +1 @@
1
+ import{styleMenuItems as e}from"./chunk-57DJOKXT.js";import{useEaselSession as n}from"./chunk-O7Q4DDJT.js";import{ROOT_ZONE as t}from"./chunk-PLVEGYK6.js";import{useHostEscape as o}from"./chunk-U3JP4VGF.js";import{EaselMenuItems as l,menuLabel as r}from"./chunk-EA2HTX37.js";import{createNodeClipboard as i,nodeMenuItems as c}from"./chunk-2LK54I4E.js";import{useCanvasEvent as s}from"./chunk-PAELDYYS.js";import{isTypingTarget as a,framePointToHost as u}from"./chunk-ZNCEOSXO.js";import{UndoIcon as d,RedoIcon as p,AddIcon as f,PasteIcon as m,SettingsIcon as h,LayersIcon as y,CopyIcon as k}from"./chunk-L5KW4HG5.js";import{zoneKey as b,ROOT_SLOT as v,ROOT_ID as g}from"./chunk-KRXQM65X.js";import{useState as x,useCallback as C,useRef as w,useEffect as P}from"react";import{ContextMenu as z}from"efficient-shell/ui";import{jsx as O}from"react/jsx-runtime";function A(e,n){const o=[],l=/* @__PURE__ */new Set;let r={zone:n.zone,index:n.index};for(;r;){const n=e.nodeAt(r.zone,r.index);if(!n||l.has(n.props.id))break;if(l.add(n.props.id),o.push({zone:r.zone,index:r.index,node:n,parentType:null}),r.zone===t)break;const i=r.zone.lastIndexOf(":");if(i<=0)break;r=e.locate(r.zone.slice(0,i))}for(let e=0;e<o.length-1;e+=1)o[e].parentType=o[e+1].node.type;return o}var K=i(),D=/* @__PURE__ */new WeakMap;function E(e){if(e.claimsPage)return K;const n=e.registry;if(!n)return e.cache("easel:node-clipboard",i);let t=D.get(n);return t||(t=i(),D.set(n,t)),t}function S(){return E(n())}function T(e,n,o){if(n===t){const{floor:n,cap:t}=e.sectionBand();return{parentId:g,slot:v,index:Math.min(Math.max(o,n),t)}}const l=n.lastIndexOf(":");return{parentId:n.slice(0,l),slot:n.slice(l+1),index:o}}function j(e,n,t){const o=e.isPinned(n,t),l=!o&&!e.isLocked(n)&&!e.duplicateBlocked(n),r=e.permits?.(n)??{duplicate:!0,delete:!0};return{copy:!o&&r.duplicate,cut:l&&r.duplicate&&r.delete}}function L(e,n,t){const o=e.canPasteAt;if(!o)return b(n.from)===t.zone?T(e,t.zone,t.index+1):null;for(const l of A(e,t)){const t=T(e,l.zone,l.index+1);if(o(n,t))return t}return null}function M(e){if(e.defaultPrevented||e.altKey||e.shiftKey||!e.metaKey&&!e.ctrlKey)return null;if(a(e.target))return null;const n=e.target,t=n&&"ownerDocument"in n?n.ownerDocument??n:null,o=t?.getSelection?.();if(o&&!o.isCollapsed&&o.toString().trim())return null;const l=e.code||(1===e.key.length?`Key${e.key.toUpperCase()}`:"");return"KeyC"===l?"copy":"KeyX"===l?"cut":"KeyV"===l?"paste":null}function X(e,n,t,o){const l=e.nodeAt(t.zone,t.index);if(!l)return null;const r=l.props.id,i=e.labelOf(l.type,t.zone),c=j(e,l,t.zone);if("copy"===n)return c.copy?(e.nodeOps.copy(r,i),{done:"copied",name:i}):null;if(o.readOnly)return null;if("cut"===n)return c.cut?(e.nodeOps.cut(r,i),{done:"cut",name:i}):null;const s=o.held;if(!s)return null;const a=e.isPinned(l,t.zone)?null:L(e,s,t);return a?(e.nodeOps.paste(a),{done:"pasted",name:s.label}):(e.onPasteRefused(s),{done:"refused",name:s.label})}function I(n,o){const{zone:l,index:r}=o,i=n.nodeAt(l,r);if(!i)return[];const s=i.props.id,a=n.labelOf(i.type,l),u=Boolean(i.props._hidden),d=n.nodeOps,p=n.isPinned(i,l),f=n.isLocked(i),m=!p&&!f&&!n.duplicateBlocked(i),h=n.permits?.(i)??{duplicate:!0,delete:!0},y=j(n,i,l),k=A(n,o),b=d.held,v=b&&!p?L(n,b,o):null,g=!n.readOnly,x=n.style?e({held:g?n.style.held():null,canCopy:n.style.canCopy(i,l),onCopy:()=>n.style?.copy(i,l),onPaste:()=>n.style?.paste(l,r,i)}):[];return c({title:a,layer:{group:"pick",items:k.flatMap((e,o)=>{const l={label:n.rowNameOf(e.node,e.zone),checked:0===o,onClick:()=>n.selectAt(e.zone,e.index,e.node.props.id,e.parentType)},r=e.zone===t?null:n.slotRung?.(e.zone)??null;return r?[l,{label:r.label,checked:!1,onClick:r.select}]:[l]})},actions:{addInside:g&&n.canAddTo(i.type)?()=>n.openAddInside(l,r):void 0,duplicate:g&&m&&h.duplicate?()=>d.duplicate(s):void 0,moveUp:g&&d.canStep(s,-1)?()=>d.step(s,-1):void 0,moveDown:g&&d.canStep(s,1)?()=>d.step(s,1):void 0,copy:y.copy?()=>d.copy(s,a):void 0,cut:g&&y.cut?()=>d.cut(s,a):void 0,paste:g&&b&&v?{label:b.label,run:()=>d.paste(v)}:void 0,rename:g&&n.renamePropOf(i,l)?()=>n.beginRename(l,r):void 0,hide:!g||f||p?void 0:{hidden:u,run:()=>d.setProps(s,{_hidden:!u})},delete:g&&m&&h.delete?()=>d.remove(s):void 0},style:x,extras:n.menuRows?.(i,l,r)??void 0,pinnedLine:p?"Pinned — can’t be moved or deleted":void 0})}function R(e){const n=!e.readOnly,o=[];n&&e.history.hasPast&&o.push({label:"Undo",icon:/* @__PURE__ */O(d,{}),shortcut:"⌘Z",onClick:e.history.back}),n&&e.history.hasFuture&&o.push({label:"Redo",icon:/* @__PURE__ */O(p,{}),shortcut:"⇧⌘Z",onClick:e.history.forward});const l=n?[{label:"Add section",icon:/* @__PURE__ */O(f,{}),onClick:e.openAddSection}]:[],r=e.nodeOps.held,i=T(e,t,e.sectionBand().cap);if(n&&r&&(e.canPasteAt?e.canPasteAt(r,i):b(r.from)===t)){const n=i;l.push({label:`Paste ${r.label}`,icon:/* @__PURE__ */O(m,{}),shortcut:"⌘V",onClick:()=>e.nodeOps.paste(n)})}const c=[o,l,[{label:e.pageSettingsLabel??"Page settings",icon:/* @__PURE__ */O(h,{}),onClick:e.openPageSettings},{label:"Collapse all layers",icon:/* @__PURE__ */O(y,{}),onClick:e.collapseAll}]].filter(e=>e.length>0),s={label:"—",onClick:()=>{}};return c.flatMap((e,n)=>n?[s,...e]:e)}function Y(e,n){const t=n.selectionStart??0,o=n.selectionEnd??0,l=n.value.slice(t,o),r=e=>{n.focus(),n.setRangeText(e,t,o,"end"),n.dispatchEvent(new Event("input",{bubbles:!0}))},i=[];l&&(i.push({label:"Copy",icon:/* @__PURE__ */O(k,{}),shortcut:"⌘C",onClick:()=>navigator.clipboard?.writeText(l)}),i.push({label:"Cut",icon:/* @__PURE__ */O(k,{}),shortcut:"⌘X",onClick:()=>{navigator.clipboard?.writeText(l),r("")}})),i.push({label:"Paste",icon:/* @__PURE__ */O(m,{}),shortcut:"⌘V",onClick:()=>{navigator.clipboard?.readText().then(e=>{e&&r(e)}).catch(()=>e.onPasteRefused())}});const c=[i,n.value?[{label:"Select all",shortcut:"⌘A",onClick:()=>{n.focus(),n.select()}}]:[]].filter(e=>e.length>0),s={label:"—",onClick:()=>{}};return c.flatMap((e,n)=>n?[s,...e]:e)}function B(e){return e.shiftKey}function V(e,n){const[t,l]=x(null),r=C(()=>l(null),[]);o(null!==t,r);const i=w(e);i.current=e;const c=C(e=>{const n=i.current,t=n.keys;if(!t)return;const o=M(e);if(!o)return;const l=t.selected();if(!l)return;const r=X(n,o,l,{readOnly:t.readOnly,held:t.held()});r&&(e.preventDefault(),t.onDone?.(r))},[]),a=e.keys?.target??null;P(()=>{if(!a)return;const e=e=>c(e);return a.addEventListener("keydown",e),()=>a.removeEventListener("keydown",e)},[a,c]),s(n,"keydown",c);const d=C(n=>{if(B(n))return;const t=n.target;if(t?.closest?.("[data-slot-zone]"))return n.preventDefault(),void l(null);const o=function(e){const n=e?.closest?.("input, textarea");return n?n instanceof HTMLInputElement&&!["text","search","url","email","tel","number",""].includes(n.type)?null:n:null}(t);if(o)return n.preventDefault(),void l({kind:"input",x:n.clientX,y:n.clientY,el:o,owner:t});const r=t?.closest?.("[data-node-id]")?.getAttribute("data-node-id"),i=r?e.locate(r):null;n.preventDefault(),l(i?{kind:"node",x:n.clientX,y:n.clientY,...i,owner:t}:{kind:"empty",x:n.clientX,y:n.clientY,owner:t})},[e]);s(n,"contextmenu",t=>{if(B(t)||!n)return;const o=t.target?.closest?.("[data-puck-component]")??null,r=o?.getAttribute("data-puck-component"),i=r?e.locate(r):null;t.preventDefault();const c=u(n.frame,t.clientX,t.clientY),s=n.frame;l(i?{kind:"node",...c,...i,owner:s}:{kind:"empty",...c,owner:s})}),s(n,"mousedown",r),s(n,"scroll",r,{on:"window"});return{onEditorContextMenu:d,menu:t?/* @__PURE__ */O(U,{host:e,target:t,onClose:r}):null,closeMenu:r}}function U({host:e,target:n,onClose:t}){const o="node"===n.kind?I(e,n):"input"===n.kind?Y(e,n.el):R(e);return 0===o.length?null:/* @__PURE__ */O(z,{at:{x:n.x,y:n.y},owner:n.owner??null,onClose:t,"aria-label":r(o),children:/* @__PURE__ */O(l,{items:o,onClose:t})})}export{K as EASEL_NODE_CLIPBOARD,A as ancestorChain,E as nodeClipboardOf,j as nodeClipboardRules,I as nodeMenuItems,M as nodeShortcut,R as pageMenuItems,L as pastePlace,X as runNodeShortcut,Y as textMenuItems,S as useNodeClipboard,V as useNodeContextMenu};
@@ -0,0 +1,24 @@
1
+ import{FieldSelect as e}from"./chunk-NLRW4BGG.js";import{TreeSeam as n}from"./chunk-XWR5YVA7.js";import{SettingsField as l,SETTINGS_BUCKETS as t,SettingsTabs as a,SettingsGroup as r}from"./chunk-Q27BB5ZC.js";import{DEFAULT_TREE_WORDS as i}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as o}from"./chunk-QTLAVDJE.js";import{EaselMenuItems as s}from"./chunk-EA2HTX37.js";import{FieldNumber as c}from"./chunk-7SQF6LZL.js";import{SettingsSegmented as u}from"./chunk-QLD57GBB.js";import{DEFAULT_FIELDS_WORDS as d}from"./chunk-FPOKPNO4.js";import{useWords as m}from"./chunk-MFIRYGHW.js";import{useTreeDrag as p,gapToMoveIndex as h}from"./chunk-67GNT6PF.js";import{withTip as b}from"./chunk-P2VEMZH5.js";import{ChevronIcon as f,LockIcon as g,MoveUpIcon as v,MoveDownIcon as y,DuplicateIcon as x,TrashIcon as k}from"./chunk-L5KW4HG5.js";import{Textarea as w,Input as N,ContextMenu as O,tabPanelId as C,tabButtonId as j,SearchableSelect as S,Select as D}from"efficient-shell/ui";import{useRef as I,useState as $,useLayoutEffect as F,useId as L}from"react";import{jsx as P,jsxs as A}from"react/jsx-runtime";function T({id:e,value:n,onChange:l,placeholder:t,multiline:a=!1,rows:r=3,readOnly:i=!1,ariaLabel:o,ariaLabelledBy:s}){const c=n??"";return a?/* @__PURE__ */P(w,{id:e,size:"sm",className:"es-fin",value:c,rows:r,placeholder:t,readOnly:i,"aria-label":o,"aria-labelledby":s,onChange:e=>l(e.target.value)}):/* @__PURE__ */P(N,{id:e,size:"sm",className:"es-fin",type:"text",value:c,placeholder:t,readOnly:i,"aria-label":o,"aria-labelledby":s,onChange:e=>l(e.target.value)})}function E(e,n,l){const t=e.slice();return t.splice(Math.max(0,Math.min(n,t.length)),0,l),t}function M(e,n,l){const t=e.slice(),[a]=t.splice(n,1);return t.splice(Math.max(0,Math.min(l,t.length)),0,a),t}function z(e,n){return e.filter((e,l)=>l!==n)}function R(e){return null===e||"object"!=typeof e?e:JSON.parse(JSON.stringify(e))}var B='input, textarea, select, button, [contenteditable]:not([contenteditable="false"]), [tabindex]',H={parentId:"list",slot:"items"};function G({label:e,icon:l,noun:t,items:a,onChange:r,newItem:o,summary:c,itemName:u,thumb:w,min:N=0,max:C,readOnly:j=!1,open:S,onOpen:D,renderItem:L,renderRow:T,canRemove:G,lockedReason:K,fixed:Q=!1,removeOnRow:W=!0,canDuplicate:Y,above:V,head:q=!0}){const J=m("fields",d).list,X=m("tree",i),Z=t??J.item,U=!j&&!Q&&("number"!=typeof C||a.length<C),_=a.length<=N,ee=e=>!!G&&!G(a[e],e),ne=e=>!j&&!Q&&W&&!_&&!ee(e),le=e=>U&&(!Y||Y(a[e],e)),te=(e,n)=>u?u(e,n):J.itemName({noun:Z,n:n+1}),ae=I([]),re=I(null),[ie,oe]=$(null),se=I(null),[ce,ue]=$(null),[de,me]=$("");F(()=>{for(const e of ae.current){if(!e)continue;null!==e.querySelector(B)||j?e.removeAttribute("tabindex"):e.tabIndex=0}}),F(()=>{const e=re.current;if(!e)return;re.current=null;const n=ae.current[e.index]?.querySelectorAll(B)[e.nth]??ae.current[e.index];if(n?.focus(),n&&null!==e.start&&"setSelectionRange"in n)try{n.setSelectionRange(e.start,e.end)}catch{}});const pe=(e,n)=>{if(n<0||n>=a.length||n===e)return;const l=ae.current[e],t=l?.ownerDocument.activeElement;if(l&&t&&l.contains(t)){const e=[...l.querySelectorAll(B)].indexOf(t),a=t;re.current={index:n,nth:e,start:"number"==typeof a.selectionStart?a.selectionStart:null,end:"number"==typeof a.selectionEnd?a.selectionEnd:null}}r(M(a,e,n));const i=function(e,n,l){return null===e?null:e===n?l:n<e&&l>=e?e-1:n>e&&l<=e?e+1:e}(S,e,n);i!==S&&D(i),me(J.moved({n:n+1,total:a.length}))},he=e=>{U&&(r(E(a,e,o())),T?(re.current={index:e,nth:0,start:null,end:null},null!==S&&S>=e&&D(S+1)):D(e))},be=e=>{ne(e)&&(r(z(a,e)),S===e?D(null):null!==S&&S>e&&D(S-1))},fe=p({keyOf:e=>String(e),canDrop:(e,n)=>n.parentId===H.parentId&&n.slot===H.slot,onDrop:(e,n)=>{const l=h({...H,index:e},n);l!==e&&pe(e,l)},onStep:(e,n)=>pe(e,e+n),canStep:(e,n)=>e+n>=0&&e+n<a.length,readOnly:j}),ge=e=>{const n=[];return e>0&&n.push({label:J.moveUp,icon:/* @__PURE__ */P(v,{size:14}),shortcut:"⌥↑",onClick:()=>pe(e,e-1)}),e<a.length-1&&n.push({label:J.moveDown,icon:/* @__PURE__ */P(y,{size:14}),shortcut:"⌥↓",onClick:()=>pe(e,e+1)}),le(e)&&n.push({label:J.duplicate,icon:/* @__PURE__ */P(x,{size:14}),onClick:()=>(e=>{le(e)&&(r(E(a,e+1,R(a[e]))),null!==S&&S>e&&D(S+1))})(e)}),ne(e)&&n.push({label:J.delete,icon:/* @__PURE__ */P(k,{size:14}),danger:!0,onClick:()=>be(e)}),n},ve=(e,n,l,t)=>{j||0===ge(e).length||ue({index:e,x:n,y:l,owner:t})},ye=e=>n=>{const l=a.slice();l[e]=n,r(l)};/* @__PURE__ */
2
+ return A("div",{className:"es-list",children:[q?/* @__PURE__ */A("div",{className:"es-list-head",children:[
3
+ /* @__PURE__ */A("span",{className:"es-list-label",children:[l?/* @__PURE__ */P("span",{className:"es-field-icon","aria-hidden":"true",children:l}):null,e]}),
4
+ /* @__PURE__ */P("span",{className:"es-list-count",children:a.length})]}):null,V?/* @__PURE__ */P("div",{className:"es-list-above",children:V}):null,a.length?/* @__PURE__ */A("div",{className:"es-list-rows",...fe.rootProps(),children:[a.map((e,l)=>{const t=fe.row({item:l,place:{...H,index:l}}),a=t.draggable&&ie!==l,r=!T&&S===l,i=!j&&!Q&&W&&ee(l),o=["es-list-row",T?"is-inline":"is-item",r?"is-open":"",a?"is-draggable":"",t.dragging?"is-dragging":"",t.drop?`is-drop-${t.drop}`:""].filter(Boolean).join(" ");/* @__PURE__ */
5
+ return A("div",{className:"es-list-entry",children:[l>0?/* @__PURE__ */P("div",{className:"es-list-gap",children:/* @__PURE__ */P(n,{...fe.seam({place:{...H,index:l}}),onAdd:U?()=>he(l):void 0,label:J.addHere({noun:Z})})}):null,
6
+ /* @__PURE__ */A("div",{...t.rowProps,ref:e=>{ae.current[l]=e},className:o,draggable:a||void 0,"aria-keyshortcuts":t.draggable?"Alt+ArrowUp Alt+ArrowDown":void 0,onPointerDown:e=>{const n=e.target.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])'),a=!!n&&n===n.ownerDocument.activeElement;e.currentTarget.draggable=t.draggable&&!a,se.current=n&&!a?n:null,oe(a?l:null)},onDragStart:e=>{const n=se.current;se.current=null,n&&n.ownerDocument.activeElement===n&&n.blur(),t.rowProps.onDragStart?.(e)},onContextMenu:e=>{j||(e.preventDefault(),e.stopPropagation(),ve(l,e.clientX,e.clientY,e.currentTarget))},onKeyDown:e=>{if("ContextMenu"===e.key||e.shiftKey&&"F10"===e.key){e.preventDefault();const n=e.currentTarget.ownerDocument,t=e=>e.preventDefault();n.addEventListener("contextmenu",t,{capture:!0,once:!0}),n.defaultView?.setTimeout(()=>n.removeEventListener("contextmenu",t,{capture:!0}),500);const a=e.currentTarget.getBoundingClientRect();return void ve(l,a.left+24,a.bottom,e.currentTarget)}t.rowProps.onKeyDown?.(e)},children:[a?/* @__PURE__ */P("span",{className:"es-list-hint","aria-hidden":"true",children:X.dragHint}):null,T?/* @__PURE__ */P("div",{className:"es-list-row-main",children:T(e,l,ye(l))}):/* @__PURE__ */A("button",{type:"button",className:"es-list-open","aria-expanded":r,onClick:()=>D(r?null:l),children:[w?/* @__PURE__ */P("span",{className:"es-list-thumb","aria-hidden":"true",children:w(e,l)}):null,
7
+ /* @__PURE__ */P("span",{className:"es-list-row-name",children:te(e,l)}),/* @__PURE__ */P("span",c?{className:"es-list-row-summary",children:c(e,l)}:{className:"es-list-row-summary"}),
8
+ /* @__PURE__ */P(f,{size:14,className:"es-list-chev","aria-hidden":"true"})]}),j||Q||!W?null:i?b(K?K(e,l):J.locked,/* @__PURE__ */P("span",{className:"es-list-lock",role:"img","aria-label":K?K(e,l):J.locked,children:/* @__PURE__ */P(g,{size:13})})):b(J.deleteItem({noun:Z}),/* @__PURE__ */P("button",{type:"button",className:"es-list-x","aria-label":J.deleteItem({noun:Z}),disabled:!ne(l),onClick:()=>be(l),children:"×"}))]}),r?/* @__PURE__ */P("div",{className:"es-list-item",children:L(e,l,ye(l))}):null]},l)}),
9
+ /* @__PURE__ */P("div",{className:"es-list-gap",children:/* @__PURE__ */P(n,{...fe.seam({place:{...H,index:a.length}})})})]}):null,j||Q?null:/* @__PURE__ */P("button",{type:"button",className:"es-list-add",disabled:!U,onClick:()=>he(a.length),children:J.add({noun:Z})}),
10
+ /* @__PURE__ */P("span",{className:"es-list-said","aria-live":"polite",children:de}),ce&&ce.index<a.length?
11
+ /* @__PURE__ */P(O,{at:{x:ce.x,y:ce.y},owner:ce.owner,onClose:()=>ue(null),children:/* @__PURE__ */P(s,{items:ge(ce.index),onClose:()=>ue(null)})}):null]})}var K=(e,n)=>"string"==typeof e.label&&e.label?e.label:n;function Q({field:e,name:n,id:l,value:t,onChange:a,readOnly:i,context:o,renderers:s}){const[c,u]=$(!0),d=t&&"object"==typeof t?t:{};/* @__PURE__ */
12
+ return P(r,{id:`${l}-group`,title:K(e,n),open:c,onToggle:u,children:Object.entries(e.objectFields).map(([e,t])=>/* @__PURE__ */P(Y,{field:t,name:`${n}.${e}`,id:`${l}-${e}`,value:d[e],onChange:n=>a({...d,[e]:n}),readOnly:i,context:o,renderers:s},e))})}function W({field:e,name:n,id:l,value:t,onChange:a,readOnly:r,context:i,renderers:o,openItem:s,onOpenItem:c}){const[u,d]=$(null),m=c?s??null:u,p=c??d,h=Array.isArray(t)?t:[],b=e.getItemSummary;/* @__PURE__ */
13
+ return P(G,{label:K(e,n),icon:e.icon,noun:"string"==typeof e.noun?e.noun:void 0,items:h,onChange:a,newItem:()=>R({...e.defaultItemProps??{}}),summary:b?(e,n)=>b(e,n):void 0,min:e.min,max:e.max,readOnly:r,open:m,onOpen:p,renderItem:(t,a,s)=>Object.entries(e.arrayFields).map(([e,c])=>/* @__PURE__ */P(Y,{field:c,name:`${n}[${a}].${e}`,id:`${l}-${a}-${e}`,value:t?.[e],onChange:n=>s({...t,[e]:n}),readOnly:r,context:i,renderers:o},e))})}function Y(n){const{field:t,name:a,id:r,value:i,onChange:o,readOnly:s,context:d,renderers:m}=n;if(!t||t.marker||!1===t.visible)return null;const p=m?.[t.type];if(p)return p({field:t,name:a,id:r,value:i,onChange:o,readOnly:s});switch(t.type){case"custom":{const e={...d,field:t,name:a,id:r,value:i,onChange:o,readOnly:s};return t.render(e)}case"text":case"textarea":/* @__PURE__ */
14
+ return P(l,{label:K(t,a),htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */P(T,{id:r,value:"string"==typeof i?i:null==i?"":String(i),onChange:o,placeholder:t.placeholder,multiline:"textarea"===t.type,readOnly:s})});case"number":/* @__PURE__ */
15
+ return P(l,{label:K(t,a),htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */P(c,{id:r,value:"number"==typeof i?i:void 0,onChange:o,min:t.min,max:t.max,step:t.step,placeholder:t.placeholder,readOnly:s})});case"select":{const n=`${r}-label`;/* @__PURE__ */
16
+ return P(l,{label:K(t,a),labelId:n,htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */P(e,{id:r,value:i,options:t.options,onChange:o,readOnly:s,ariaLabelledBy:n})})}case"radio":/* @__PURE__ */
17
+ return P(l,{label:K(t,a),icon:t.icon,hint:t.hint,children:/* @__PURE__ */P(u,{ariaLabel:K(t,a),value:i,options:t.options.map(e=>({id:e.value,label:e.label,icon:e.icon,disabled:e.disabled||s})),onChange:e=>{s||o(e)}})});case"object":/* @__PURE__ */
18
+ return P(Q,{...n,field:t});case"array":/* @__PURE__ */
19
+ return P(W,{...n,field:t});case"slot":return null}}var V=e=>t.includes(e);function q(e){let n=t[0];const l=[],a=/* @__PURE__ */new Set;for(const[t,r]of Object.entries(e))r&&(V(r.bucket)&&(n=r.bucket),r.marker||!1===r.visible||(l.push({name:t,field:r,bucket:n}),"slot"!==r.type&&a.add(n)));return{rows:l,buckets:t.filter(e=>a.has(e))}}function J(e){return new Map(q(e).rows.map(e=>[e.name,e.bucket]))}function X({fields:e,values:n,onChange:l,readOnly:t=!1,context:r,tab:i,onTab:s,tabs:c=!0,tabIcons:u,renderers:d,idPrefix:p,ariaLabel:h,children:b}){const f=m("panel",o),g=L(),v=p??`es-insp${g.replace(/:/g,"")}`,y=q(e),[x,k]=$(void 0),w=i??x,N=w&&y.buckets.includes(w)?w:y.buckets[0],[O,S]=$(null),D=O&&O.panel===v&&y.rows.some(e=>e.name===O.name)?O:null,I=c&&y.buckets.length>1,F=I&&N?C(v,N):`${v}-rows`;/* @__PURE__ */
20
+ return A("div",{className:"es-insp",children:[I?/* @__PURE__ */P("div",{className:"es-insp-tabs",children:/* @__PURE__ */P(a,{ariaLabel:h??f.settings,activeId:N,onSelect:e=>{const n=e;void 0===i&&k(n),s?.(n)},items:y.buckets.map(e=>({id:e,label:f.buckets[e],icon:u?.[e]})),idPrefix:v})}):null,
21
+ /* @__PURE__ */A("div",{className:"es-insp-rows",id:F,role:I?"tabpanel":void 0,"aria-labelledby":I&&N?j(v,N):void 0,children:[y.rows.map(({name:e,field:a,bucket:i})=>/* @__PURE__ */P("div",{className:"es-insp-row","data-field":e,"data-bucket":i,hidden:!(!I||i===N)||void 0,children:/* @__PURE__ */P(Y,{field:a,name:e,id:`${v}-${e}`,value:n[e],onChange:n=>l(e,n),readOnly:t,context:r,renderers:d,openItem:D&&D.name===e?D.index:null,onOpenItem:n=>S(null===n?null:{panel:v,name:e,index:n})})},e)),b]})]})}function Z(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}function U({value:e,onChange:n,kinds:l,rules:t,filtersFor:a,label:r,readOnly:i}){const o=m("fields",d).link??d.link,[s,c]=$(null),[u,p]=$(null),h=s??t.kindOf(e),b=l.filter(e=>!e.hideWhenEmpty||Z(e.target).length>0||e.value===h),f=b.find(e=>"text"===e.target.type),g=b.find(e=>e.value===h)??f??b[0];if(!g)return null;const v="text"!==g.target.type,y=v?t.targetOf(e):e,x=Z(g.target),k=x.find(e=>e.value===y),w=e=>({value:e,label:o.unavailable({value:e})}),O="select"===g.target.type&&y&&a?a(y):null,C=O?t.readFilter(e):null,j=C?O?.find(e=>e.param===C.param):void 0,I=u&&u.against===e?u.text:e,F=!v&&""!==I.trim()&&!t.isSafe(I),L=e=>{if(!e)return n("");const l=x.find(n=>n.value===e);n(e,l?.label)},T=(e,n)=>n&&!e.some(e=>e.value===n)?[w(n),...e]:[...e],E=(e,n,l,t,a)=>{if(a){const a=l.map(e=>({value:e.value,label:e.label,...e.group?{sublabel:e.group}:{}}));/* @__PURE__ */
22
+ return P(S,{"aria-label":e,value:n,options:a,disabled:i,placeholder:l.find(e=>""===e.value)?.label,onChange:e=>""!==e||l.some(e=>""===e.value)?t(e):void 0})}const r=[];for(const e of l){const n=r[r.length-1],l={value:e.value,label:e.label};e.group?n&&"options"in n&&n.label===e.group?n.options.push(l):r.push({label:e.group,options:[l]}):r.push(l)}/* @__PURE__ */
23
+ return P(D,{size:"sm","aria-label":e,value:n,options:r,disabled:i,onChange:t})};let M;if("text"===g.target.type)M=/* @__PURE__ */P(N,{size:"sm",type:"text",className:"es-fin",invalid:F,"aria-label":o.address,placeholder:o.addressPlaceholder,value:I,readOnly:i,onChange:l=>(l=>{const a=l.trim();a?t.isSafe(l)?(p({text:l,against:a}),n(a)):p({text:l,against:e}):(p({text:l,against:""}),n(""))})(l.target.value)});else{const e="groups"===g.target.type?g.target.groups.flatMap(e=>e.options.map(n=>({value:n.value,label:n.label,group:e.label}))):g.target.options.map(e=>({value:e.value,label:e.label})),n=[{value:"",label:g.target.placeholder},...T(e,y)];M=E(g.label,y,n,L,e.length>10)}/* @__PURE__ */
24
+ return A("div",{className:"es-flink",role:r?"group":void 0,"aria-label":r,children:[E(o.linkType,g.value,b.map(e=>({value:e.value,label:e.label})),e=>{c(e),p(null);const l=b.find(n=>n.value===e);if(!l||"text"===l.target.type)return;const t=Z(l.target)[0];t?n(t.value,t.label):n("")},!1),M,O&&E(o.filter,C?.param??"",[{value:"",label:o.noFilter},...C&&!j?[w(C.param)]:[],...O.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return n(y,k?.label);const l=O?.find(n=>n.param===e),a=l?.values[0];a&&n(t.withFilter(y,{param:e,value:a.value}),a.label)},!1),O&&C&&E(o.value,C.value,T((j?.values??[]).map(e=>({value:e.value,label:e.label})),C.value),e=>{if(!C)return;const l=j?.values.find(n=>n.value===e);n(t.withFilter(y,{param:C.param,value:e}),l?.label)},(j?.values.length??0)>10),F&&/* @__PURE__ */P("p",{className:"es-flink-error",role:"alert",children:o.unsafe}),g.hint&&/* @__PURE__ */P("p",{className:"es-flink-hint",children:g.hint}),O&&/* @__PURE__ */P("p",{className:"es-flink-hint",children:o.filterHint})]})}export{T as FieldText,X as Inspector,Y as InspectorField,U as LinkPicker,G as ListField,J as bucketsOf,R as copyItem,E as insertAt,K as labelOf,M as moveTo,q as planFields,z as removeAt};
@@ -0,0 +1 @@
1
+ var e={name:"Layers",dragHint:"Drag to move · ⌥↑ ⌥↓",collapse:"Collapse",expand:"Expand",collapseNamed:({label:e})=>`Collapse ${e}`,expandNamed:({label:e})=>`Expand ${e}`,emptySlot:"No blocks yet",addBlock:"Add a block",dropHere:"Drop here"};export{e as DEFAULT_TREE_WORDS};
@@ -0,0 +1 @@
1
+ function t(t){if("undefined"==typeof document)return;const e=document.documentElement;e.removeAttribute("data-editor-theme");const n="string"==typeof t?t.trim():"";n&&e.setAttribute("data-theme",n)}export{t as applyEaselChromeTheme};
@@ -1 +1 @@
1
- import{useScreenDocument as n}from"./chunk-7V5WZ46F.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-PQXIFBDY.js";import{EditNotice as r}from"./chunk-YC4TB3CJ.js";import{useWords as e}from"./chunk-MFIRYGHW.js";import{jsx as i}from"react/jsx-runtime";function t(){const{capabilities:t,access:c,takeOverEditing:a,viewReadOnly:s,saveConflict:m,reloadFromServer:u}=n(),{noun:l}=e("screen",o);return t.hasEditGuard?/* @__PURE__ */i(r,{access:c,conflict:m,noun:l,onTakeOver:a,onViewReadOnly:s,onReload:u}):null}export{t as PageEditGuardNotices};
1
+ import{useScreenDocument as n}from"./chunk-ONRYLR2D.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-E2O2MRZR.js";import{EditNotice as r}from"./chunk-TJ7YIRWQ.js";import{useWords as e}from"./chunk-MFIRYGHW.js";import{jsx as i}from"react/jsx-runtime";function t(){const{capabilities:t,access:c,takeOverEditing:a,viewReadOnly:s,saveConflict:m,reloadFromServer:u}=n(),{noun:l}=e("screen",o);return t.hasEditGuard?/* @__PURE__ */i(r,{access:c,conflict:m,noun:l,onTakeOver:a,onViewReadOnly:s,onReload:u}):null}export{t as PageEditGuardNotices};
@@ -0,0 +1,3 @@
1
+ import{DEFAULT_RAIL_WORDS as e}from"./chunk-2OAZYSWJ.js";import{IconRailButton as i,IconRail as o}from"efficient-shell/ui";import{jsx as l}from"react/jsx-runtime";function a({label:e,icon:o,active:a,disabled:t,onSelect:n,className:r,tooltipSide:c}){const s=["es-rail-btn",a?"is-active":"",r??""].filter(Boolean).join(" ");/* @__PURE__ */
2
+ return l(i,{label:e,icon:o,active:a,disabled:t,onClick:n,tooltipSide:c,className:s})}function t({items:i,ariaLabel:t=e.label,className:n,orientation:r="column",onLabelsShown:c}){const s="row"===r;/* @__PURE__ */
3
+ return l(o,{"aria-label":t,orientation:s?"horizontal":"vertical",labels:s?"beside":"none",labelsFit:s,onLabelsShown:s?c:void 0,className:["es-rail",s?"es-rail-row":"",n??""].filter(Boolean).join(" "),children:i.map(e=>/* @__PURE__ */l(a,{label:e.label,icon:e.icon,active:e.active,disabled:e.disabled,onSelect:e.onSelect,tooltipSide:s?"bottom":"right"},e.id))})}export{t as EaselRail,a as EaselRailButton};
@@ -0,0 +1,8 @@
1
+ import{DEFAULT_FIELDS_WORDS as e}from"./chunk-FPOKPNO4.js";import{useWords as l}from"./chunk-MFIRYGHW.js";import{SearchableSelect as a,Select as i,Slider as n}from"efficient-shell/ui";import{jsx as s,jsxs as o}from"react/jsx-runtime";import{useId as r,useRef as t}from"react";function u(e,l){return e.find(e=>Object.is(e.value,l))}var d=e=>String(e);function c(n){const{id:r,options:t,placeholder:u,readOnly:c=!1,ariaLabel:m,ariaLabelledBy:v,searchable:b=!1,searchPlaceholder:h,groupCount:p=!1,renderOption:f}=n,g=l("fields",e),N=v?{"aria-labelledby":v}:m?{"aria-label":m}:{},O=t.some(e=>void 0!==e.thumb),y=O||void 0!==f||t.some(e=>void 0!==e.meta),C=e=>""===e?void 0:t[Number(e)],x=(e,l)=>{const a=C(e.value);return a?/* @__PURE__ */o("span",{className:"es-fsel-row",children:[O?/* @__PURE__ */s("span",{className:"es-fsel-thumb","aria-hidden":"true",children:a.thumb?/* @__PURE__ */s("img",{src:a.thumb,alt:"",loading:"lazy"}):null}):null,
2
+ /* @__PURE__ */s("span",{className:"es-fsel-label",children:f?f(a,{active:l.active??!1,chosen:l.selected}):a.label}),void 0===a.meta||b?null:/* @__PURE__ */s("span",{className:"es-fsel-meta","aria-hidden":"true",children:a.meta})]}):e.label};if(b&&!0!==n.multiple){const l=t.findIndex(e=>Object.is(e.value,n.value)),i=[];t.forEach((e,l)=>{if(e.disabled)return;const a=e.meta??e.group;i.push({value:d(l),label:e.label,...a?{sublabel:a}:{}})});const o=n.onChange;/* @__PURE__ */
3
+ return s("div",{className:"es-fsel",children:/* @__PURE__ */s(a,{id:r,value:l>=0?d(l):"",options:i,placeholder:h??u??g.search??e.search,disabled:c,renderOption:y?x:void 0,onChange:e=>{const l=C(e);l&&!Object.is(l.value,n.value)&&o(l.value)},...N})})}const j=[];let I=null;if(t.forEach((e,l)=>{const a={value:d(l),label:e.label,...e.disabled?{disabled:!0}:{}};void 0===e.group?(I=null,j.push(a)):I&&I.label===e.group?I.options.push(a):(I={label:e.group,options:[a]},j.push(I))}),p)for(const e of j)"options"in e&&(e.label=`${e.label} ${e.options.length}`);const F={id:r,size:"sm",className:"es-fsel-button",options:j,placeholder:u??g.choose,disabled:c,renderOption:y?x:void 0,...N};if(!0===n.multiple){const e=Array.isArray(n.value)?n.value:[],l=l=>e.some(e=>Object.is(e,l.value)),a=t.flatMap((e,a)=>l(e)?[d(a)]:[]),o=n.onChange;/* @__PURE__ */
4
+ return s("div",{className:"es-fsel",children:/* @__PURE__ */s(i,{...F,multiple:!0,value:a,onChange:e=>o(t.filter((l,a)=>e.includes(d(a))).map(e=>e.value))})})}const M=t.findIndex(e=>Object.is(e.value,n.value)),P=n.onChange;/* @__PURE__ */
5
+ return s("div",{className:"es-fsel",children:/* @__PURE__ */s(i,{...F,value:M>=0?d(M):"",onChange:e=>{const l=C(e);l&&!Object.is(l.value,n.value)&&P(l.value)}})})}function m({id:e,label:l,value:a,onChange:i,min:u,max:d,step:c=1,styleValue:m,unit:v,sliderMin:b,sliderMax:h,auto:p,readOnly:f=!1}){const g=r(),N=e??g,O="number"==typeof a&&Number.isFinite(a)?a:void 0,y=void 0!==p&&void 0===O,C=!y&&void 0===O&&void 0!==m,x=Number((b-c).toFixed(6)),j=t(!1),I=e=>{f||e===O||i(e)};/* @__PURE__ */
6
+ return o("div",{className:"es-fslider"+(C||y?" is-style":""),onChangeCapture:e=>{j.current="range"===e.target.type},children:[
7
+ /* @__PURE__ */s("label",{className:"es-fslider-name",htmlFor:N,children:l}),
8
+ /* @__PURE__ */s(n,{id:N,label:l,value:O??null,onChange:e=>{if(null===e)return I(void 0);I(void 0!==p&&j.current&&e<b?void 0:e)},min:void 0!==p?x:b,max:h,inputMin:u??-1e9,inputMax:d??Number.POSITIVE_INFINITY,step:c,suffix:v&&!y?v:void 0,emptyLabel:p??(void 0!==m?String(m):""),disabled:f,size:"sm"})]})}export{c as FieldSelect,m as FieldSlider,u as optionFor};