efficient-easel 0.101.1 → 0.103.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 (234) hide show
  1. package/README.md +51 -0
  2. package/dist/LinkPicker-W2Rtxetz.d.ts +111 -0
  3. package/dist/autosave/index.d.ts +6 -3
  4. package/dist/autosave/index.js +1 -1
  5. package/dist/chrome/index.d.ts +3 -2
  6. package/dist/chrome/index.js +1 -25
  7. package/dist/chunk-26OOWIJJ.js +1 -0
  8. package/dist/chunk-2LK54I4E.js +1 -0
  9. package/dist/chunk-3M3A3DN2.js +4 -0
  10. package/dist/chunk-3QVB4AG2.js +3 -0
  11. package/dist/chunk-3WSPDAK2.js +1 -0
  12. package/dist/chunk-4ES5JGGX.js +1 -0
  13. package/dist/chunk-4MXFKJUY.js +1 -0
  14. package/dist/chunk-57DJOKXT.js +1 -0
  15. package/dist/chunk-5MZ3RNQQ.js +13 -0
  16. package/dist/chunk-5ZBY24K7.js +1 -0
  17. package/dist/chunk-66ICOE3I.js +8 -0
  18. package/dist/chunk-6DJHRLCU.js +25 -0
  19. package/dist/chunk-6FY3PZS3.js +1 -0
  20. package/dist/chunk-6TZTKAB5.js +1 -0
  21. package/dist/chunk-6UJ3Y6FC.js +1 -0
  22. package/dist/chunk-6W7WLPZH.js +1 -0
  23. package/dist/chunk-7F52SZOI.js +2 -0
  24. package/dist/chunk-7MU3RJ6S.js +1 -0
  25. package/dist/chunk-A7ZJII7O.js +1 -0
  26. package/dist/chunk-AJBJ74ME.js +1 -0
  27. package/dist/chunk-AKFJK65Z.js +1 -0
  28. package/dist/chunk-AKZWUV5Z.js +1 -0
  29. package/dist/chunk-BDTITTMW.js +1 -0
  30. package/dist/chunk-BSPCSC45.js +1 -0
  31. package/dist/chunk-BXZ6WLHC.js +22 -0
  32. package/dist/chunk-DUVRZ456.js +1 -0
  33. package/dist/chunk-F6CCTEIX.js +1 -0
  34. package/dist/chunk-FGNR22NY.js +1 -0
  35. package/dist/chunk-FUDHI5I4.js +1 -0
  36. package/dist/chunk-GENAF3P6.js +1 -0
  37. package/dist/chunk-GOTN2KY4.js +2 -0
  38. package/dist/chunk-GXN65JMA.js +1 -0
  39. package/dist/chunk-GXQCZJOP.js +1 -0
  40. package/dist/chunk-GZO72N3Q.js +0 -0
  41. package/dist/chunk-HDKTR5TZ.js +62 -0
  42. package/dist/chunk-HMX55DYT.js +1 -0
  43. package/dist/chunk-HQ4VVRIC.js +1 -0
  44. package/dist/chunk-HWW4XJOH.js +1 -0
  45. package/dist/chunk-I54UCYOU.js +1 -0
  46. package/dist/chunk-IQ5TA7AM.js +1 -0
  47. package/dist/chunk-IWAPPEL4.js +6 -0
  48. package/dist/chunk-IYT6NN2J.js +1 -0
  49. package/dist/chunk-KCBEE2MC.js +2 -0
  50. package/dist/chunk-KDYIMJTZ.js +1 -0
  51. package/dist/chunk-KQMML6JM.js +4 -0
  52. package/dist/chunk-LG436UTD.js +1 -0
  53. package/dist/chunk-MSBF7IW3.js +2 -0
  54. package/dist/chunk-NBJ2YY6Y.js +4 -0
  55. package/dist/chunk-OM67AJQC.js +1 -0
  56. package/dist/chunk-OORDMLL4.js +5 -0
  57. package/dist/chunk-OYX47SL7.js +1 -0
  58. package/dist/chunk-P67FP7PG.js +9 -0
  59. package/dist/chunk-PWZOS45R.js +2 -0
  60. package/dist/chunk-Q2HPBMG5.js +1 -0
  61. package/dist/chunk-Q3SQBNJB.js +1 -0
  62. package/dist/chunk-R2HLPNQF.js +1 -0
  63. package/dist/chunk-R5L2E7JX.js +1 -0
  64. package/dist/chunk-R5ZVNJLJ.js +2 -0
  65. package/dist/chunk-RLBXE4EU.js +1 -0
  66. package/dist/chunk-RW4XBUUW.js +1 -0
  67. package/dist/chunk-SERF2FAU.js +1 -0
  68. package/dist/chunk-TTJ54QGG.js +18 -0
  69. package/dist/chunk-VV5ADNBR.js +1 -0
  70. package/dist/chunk-YJXEHK6I.js +2 -0
  71. package/dist/chunk-Z3KBLIEH.js +10 -0
  72. package/dist/chunk-ZE7I3PLX.js +1 -0
  73. package/dist/chunk-ZWK3CBRU.js +1 -0
  74. package/dist/chunk-ZZ7VLIHQ.js +1 -0
  75. package/dist/drag/index.d.ts +3 -41
  76. package/dist/drag/index.js +1 -18
  77. package/dist/easel/index.js +1 -9
  78. package/dist/{words-BMzV04b1.d.ts → engine-DBxp_v6B.d.ts} +1 -58
  79. package/dist/fields/index.d.ts +2 -109
  80. package/dist/fields/index.js +1 -22
  81. package/dist/gold/index.d.ts +4 -2
  82. package/dist/host-DJ8Gzsx7.d.ts +552 -0
  83. package/dist/menu/index.js +1 -1
  84. package/dist/node-ops/index.js +1 -1
  85. package/dist/panelWidths-D9hTLR25.d.ts +66 -0
  86. package/dist/screen/components/AddBlockRow.d.ts +14 -0
  87. package/dist/screen/components/AddBlockRow.js +1 -0
  88. package/dist/screen/components/AddChildRow.d.ts +39 -0
  89. package/dist/screen/components/AddChildRow.js +1 -0
  90. package/dist/screen/components/AddSidePanel.d.ts +54 -0
  91. package/dist/screen/components/AddSidePanel.js +1 -0
  92. package/dist/screen/components/MediaSidePanel.d.ts +47 -0
  93. package/dist/screen/components/MediaSidePanel.js +1 -0
  94. package/dist/screen/components/NodeContextMenu.d.ts +364 -0
  95. package/dist/screen/components/NodeContextMenu.js +1 -0
  96. package/dist/screen/components/PageEditGuardNotices.d.ts +5 -0
  97. package/dist/screen/components/PageEditGuardNotices.js +1 -0
  98. package/dist/screen/components/PanelToggleIcon.d.ts +14 -0
  99. package/dist/screen/components/PanelToggleIcon.js +1 -0
  100. package/dist/screen/components/PreviewDeviceContext.d.ts +28 -0
  101. package/dist/screen/components/PreviewDeviceContext.js +1 -0
  102. package/dist/screen/components/PreviewPartsContext.d.ts +33 -0
  103. package/dist/screen/components/PreviewPartsContext.js +1 -0
  104. package/dist/screen/components/ScreenChrome.d.ts +5 -0
  105. package/dist/screen/components/ScreenChrome.js +1 -0
  106. package/dist/screen/components/ScreenDocumentContext.d.ts +20 -0
  107. package/dist/screen/components/ScreenDocumentContext.js +1 -0
  108. package/dist/screen/components/ScreenMount.d.ts +76 -0
  109. package/dist/screen/components/ScreenMount.js +1 -0
  110. package/dist/screen/components/ScreenStoreProvider.d.ts +63 -0
  111. package/dist/screen/components/ScreenStoreProvider.js +1 -0
  112. package/dist/screen/components/SectionScreenShell.d.ts +5 -0
  113. package/dist/screen/components/SectionScreenShell.js +16 -0
  114. package/dist/screen/components/SidePanelHead.d.ts +81 -0
  115. package/dist/screen/components/SidePanelHead.js +1 -0
  116. package/dist/screen/components/SlotChildActionsContext.d.ts +41 -0
  117. package/dist/screen/components/SlotChildActionsContext.js +1 -0
  118. package/dist/screen/components/UiIcon.d.ts +52 -0
  119. package/dist/screen/components/UiIcon.js +1 -0
  120. package/dist/screen/components/panel-widths.d.ts +37 -0
  121. package/dist/screen/components/panel-widths.js +1 -0
  122. package/dist/screen/components/usePartBridge.d.ts +66 -0
  123. package/dist/screen/components/usePartBridge.js +1 -0
  124. package/dist/screen/index.d.ts +31 -0
  125. package/dist/screen/index.js +1 -0
  126. package/dist/screen/lib/admin-bridge.d.ts +105 -0
  127. package/dist/screen/lib/admin-bridge.js +1 -0
  128. package/dist/screen/lib/backend-error.d.ts +106 -0
  129. package/dist/screen/lib/backend-error.js +1 -0
  130. package/dist/screen/lib/chrome-theme.d.ts +21 -0
  131. package/dist/screen/lib/chrome-theme.js +1 -0
  132. package/dist/screen/lib/client-only.d.ts +24 -0
  133. package/dist/screen/lib/client-only.js +1 -0
  134. package/dist/screen/lib/content/view-tiers.d.ts +25 -0
  135. package/dist/screen/lib/content/view-tiers.js +1 -0
  136. package/dist/screen/lib/document-addressing.d.ts +20 -0
  137. package/dist/screen/lib/document-addressing.js +1 -0
  138. package/dist/screen/lib/document-contract.d.ts +237 -0
  139. package/dist/screen/lib/document-contract.js +1 -0
  140. package/dist/screen/lib/document-hooks.d.ts +71 -0
  141. package/dist/screen/lib/document-hooks.js +0 -0
  142. package/dist/screen/lib/document-switch.d.ts +74 -0
  143. package/dist/screen/lib/document-switch.js +1 -0
  144. package/dist/screen/lib/failure.d.ts +54 -0
  145. package/dist/screen/lib/failure.js +1 -0
  146. package/dist/screen/lib/host-chrome.d.ts +181 -0
  147. package/dist/screen/lib/host-chrome.js +1 -0
  148. package/dist/screen/lib/host-inbound.d.ts +20 -0
  149. package/dist/screen/lib/host-inbound.js +1 -0
  150. package/dist/screen/lib/host.d.ts +20 -0
  151. package/dist/screen/lib/host.js +1 -0
  152. package/dist/screen/lib/key-scope.d.ts +23 -0
  153. package/dist/screen/lib/key-scope.js +1 -0
  154. package/dist/screen/lib/links/link-filters.d.ts +41 -0
  155. package/dist/screen/lib/links/link-filters.js +0 -0
  156. package/dist/screen/lib/load-error.d.ts +29 -0
  157. package/dist/screen/lib/load-error.js +1 -0
  158. package/dist/screen/lib/media-panel.d.ts +94 -0
  159. package/dist/screen/lib/media-panel.js +1 -0
  160. package/dist/screen/lib/media-picker.d.ts +68 -0
  161. package/dist/screen/lib/media-picker.js +1 -0
  162. package/dist/screen/lib/page-lock.d.ts +5 -0
  163. package/dist/screen/lib/page-lock.js +1 -0
  164. package/dist/screen/lib/puck/add-target-types.d.ts +55 -0
  165. package/dist/screen/lib/puck/add-target-types.js +0 -0
  166. package/dist/screen/lib/puck/block-choice.d.ts +52 -0
  167. package/dist/screen/lib/puck/block-choice.js +1 -0
  168. package/dist/screen/lib/puck/block-types-in.d.ts +39 -0
  169. package/dist/screen/lib/puck/block-types-in.js +1 -0
  170. package/dist/screen/lib/puck/content-tree.d.ts +196 -0
  171. package/dist/screen/lib/puck/content-tree.js +1 -0
  172. package/dist/screen/lib/puck/device-fields.d.ts +128 -0
  173. package/dist/screen/lib/puck/device-fields.js +1 -0
  174. package/dist/screen/lib/puck/field-buckets.d.ts +22 -0
  175. package/dist/screen/lib/puck/field-buckets.js +1 -0
  176. package/dist/screen/lib/puck/field-markers.d.ts +205 -0
  177. package/dist/screen/lib/puck/field-markers.js +1 -0
  178. package/dist/screen/lib/puck/hidable.d.ts +44 -0
  179. package/dist/screen/lib/puck/hidable.js +1 -0
  180. package/dist/screen/lib/puck/palette-sections.d.ts +96 -0
  181. package/dist/screen/lib/puck/palette-sections.js +1 -0
  182. package/dist/screen/lib/puck/panel-fields.d.ts +47 -0
  183. package/dist/screen/lib/puck/panel-fields.js +1 -0
  184. package/dist/screen/lib/puck/panel-no-control-mark.d.ts +74 -0
  185. package/dist/screen/lib/puck/panel-no-control-mark.js +1 -0
  186. package/dist/screen/lib/puck/part-id.d.ts +23 -0
  187. package/dist/screen/lib/puck/part-id.js +1 -0
  188. package/dist/screen/lib/puck/preview-click.d.ts +49 -0
  189. package/dist/screen/lib/puck/preview-click.js +1 -0
  190. package/dist/screen/lib/puck/preview-dom.d.ts +8 -0
  191. package/dist/screen/lib/puck/preview-dom.js +1 -0
  192. package/dist/screen/lib/puck/preview-events.d.ts +25 -0
  193. package/dist/screen/lib/puck/preview-events.js +1 -0
  194. package/dist/screen/lib/puck/preview-selection-context.d.ts +72 -0
  195. package/dist/screen/lib/puck/preview-selection-context.js +1 -0
  196. package/dist/screen/lib/puck/section-doc.d.ts +20 -0
  197. package/dist/screen/lib/puck/section-doc.js +1 -0
  198. package/dist/screen/lib/puck/slot-child-name.d.ts +186 -0
  199. package/dist/screen/lib/puck/slot-child-name.js +1 -0
  200. package/dist/screen/lib/puck/slot-heal.d.ts +5 -0
  201. package/dist/screen/lib/puck/slot-heal.js +1 -0
  202. package/dist/screen/lib/puck/slot-section-spec.d.ts +96 -0
  203. package/dist/screen/lib/puck/slot-section-spec.js +0 -0
  204. package/dist/screen/lib/puck/style-clipboard.d.ts +78 -0
  205. package/dist/screen/lib/puck/style-clipboard.js +1 -0
  206. package/dist/screen/lib/puck/text-control-kinds.d.ts +71 -0
  207. package/dist/screen/lib/puck/text-control-kinds.js +1 -0
  208. package/dist/screen/lib/puck/tree-reveal.d.ts +62 -0
  209. package/dist/screen/lib/puck/tree-reveal.js +1 -0
  210. package/dist/screen/lib/puck/use-section-ops.d.ts +86 -0
  211. package/dist/screen/lib/puck/use-section-ops.js +1 -0
  212. package/dist/screen/lib/screen-parts.d.ts +748 -0
  213. package/dist/screen/lib/screen-parts.js +1 -0
  214. package/dist/screen/lib/section-template-types.d.ts +49 -0
  215. package/dist/screen/lib/section-template-types.js +0 -0
  216. package/dist/screen/lib/section-templates.d.ts +23 -0
  217. package/dist/screen/lib/section-templates.js +1 -0
  218. package/dist/screen/lib/session-context.d.ts +30 -0
  219. package/dist/screen/lib/session-context.js +1 -0
  220. package/dist/screen/lib/session.d.ts +255 -0
  221. package/dist/screen/lib/session.js +1 -0
  222. package/dist/screen/screen.css +1102 -0
  223. package/dist/screen/words.d.ts +42 -0
  224. package/dist/screen/words.js +1 -0
  225. package/dist/session-DSQFmIvx.d.ts +43 -0
  226. package/dist/strings/catalogue.d.ts +13 -4
  227. package/dist/strings/catalogue.js +1 -1
  228. package/dist/strings/index.d.ts +5 -2
  229. package/dist/strings/index.js +1 -1
  230. package/dist/style-clipboard/index.js +1 -1
  231. package/dist/{types-DGcCsxs8.d.ts → types-CqY85foL.d.ts} +3 -65
  232. package/dist/words-D_Lnw1Gr.d.ts +59 -0
  233. package/package.json +348 -2
  234. package/dist/chunk-IG3U5NWJ.js +0 -1
package/README.md CHANGED
@@ -954,6 +954,57 @@ What still writes a `style`, and where it matters:
954
954
  and fails on any `style` attribute; `scripts/second-host-clickthrough.mjs`
955
955
  serves one under a real policy in Chrome.
956
956
 
957
+ ## The assembled screen — `efficient-easel/screen`
958
+
959
+ ```tsx
960
+ import { ScreenMount, ScreenPartsProvider } from 'efficient-easel/screen';
961
+ import 'efficient-easel/screen.css'; // after easel's other sheets, before the host's own
962
+ ```
963
+
964
+ The editor screen, put together once: the frame, the rail and the side
965
+ panels, the Layers tree, the add panel and block picker, the inspector, the
966
+ canvas's seams and the document's load-and-save. It came from
967
+ `efficient-web-builder` at 0.102.0 (that repository's `doc/adr/0003` and
968
+ `0004`), where the website editor had been made to import no website, so a
969
+ second editor (the campaign designer) can stand on it. A host hands it:
970
+
971
+ - **its parts** (`ScreenParts`, through `ScreenPartsProvider`): the blocks'
972
+ rules and looks, the inspector, the canvas, the left views and the rail
973
+ buttons, the toolbar's ends, its pinned chrome;
974
+ - **how its documents are addressed** (`ScreenDocumentProvider`'s
975
+ `addressing`, `screen/lib/document-addressing`): which document is home,
976
+ what stores the one a target names, what a switch does;
977
+ - **its backend and its block registry**, on the session
978
+ (`createEaselSession`, `screen/lib/session`).
979
+
980
+ A host whose documents are not a website's (0.103.0) points the screen at
981
+ one of its own: `ScreenMount`'s `target` is `{ kind: "document", record,
982
+ slug? }` (`DocumentTarget`), and its `addressing` is a
983
+ `DocumentAddressing<DocumentTarget>`, which may also say what a missing one
984
+ is called (`describeMissing`) and hear that one would not open
985
+ (`onLoadFailed`). A document the backend resolves with a `readOnlyReason` is
986
+ held read-only for good, and the save pill's place says why. The top bar's
987
+ main button is the layer's when its bridges hand one back (`barMain`), and
988
+ the save pill is no switch under `saveSwitch: false`. The words the screen
989
+ says while a document opens, or will not, and the edit notice's word for the
990
+ document are the `screen` group of `EaselStrings`. Each is optional: without
991
+ it the screen is the website's, as it was.
992
+
993
+ - **Every module is a subpath of its own** (`efficient-easel/screen/lib/session`,
994
+ `efficient-easel/screen/components/ScreenChrome`): hosts and their guards
995
+ import them one by one, and two export different types under one name.
996
+ `efficient-easel/screen` is the six a host mounts with. The list is the
997
+ folder, never written down: `scripts/sync-screen-exports.mjs` writes the
998
+ `exports` map from it and `tests/screen-exports.test.ts` fails one that
999
+ drifted.
1000
+ - **It still writes out some of the website it came from** (a website
1001
+ target's site and template, the pinned Header and Footer rows, the
1002
+ `storefront-editor:` host messages). Each is handed in as the campaign
1003
+ designer needs it; the list is in the builder's `doc/adr/0004`. A host's
1004
+ own document target is the first to have left it (0.103.0).
1005
+ - **Its classes keep their `sf-` names** and its strings their words: the
1006
+ hosts' sheets, their guards and the website's host address them.
1007
+
957
1008
  ## The engine's words — `efficient-easel/strings`
958
1009
 
959
1010
  `efficient-easel/strings` (added in 0.95.0) is every word the engine itself
@@ -0,0 +1,111 @@
1
+ import * as react from 'react';
2
+
3
+ /** One thing a link can point at: the URL it writes and the name it shows. */
4
+ type LinkOption = {
5
+ value: string;
6
+ label: string;
7
+ };
8
+ /** Options under one heading — the anchors of one page. */
9
+ type LinkOptionGroup = {
10
+ label: string;
11
+ options: readonly LinkOption[];
12
+ };
13
+ /** One filter on a link onto the product listing, or none. */
14
+ type LinkFilter = {
15
+ param: string;
16
+ value: string;
17
+ } | null;
18
+ /** A filter a listing link may offer, with the values it may take. */
19
+ type LinkFilterField = {
20
+ param: string;
21
+ label: string;
22
+ values: readonly LinkOption[];
23
+ };
24
+ /** What a kind's target box is: a list, a list in groups, or a typed address. */
25
+ type LinkTarget = {
26
+ type: 'select';
27
+ options: readonly LinkOption[];
28
+ placeholder: string;
29
+ } | {
30
+ type: 'groups';
31
+ groups: readonly LinkOptionGroup[];
32
+ placeholder: string;
33
+ } | {
34
+ type: 'text';
35
+ };
36
+ /** One entry of the Link type list, with everything its target box offers. */
37
+ type LinkKindChoice = {
38
+ /** The kind's key — what `rules.kindOf` answers. */
39
+ value: string;
40
+ /** Its name in the list ("Page", "Blog post"), and its target box's name. */
41
+ label: string;
42
+ target: LinkTarget;
43
+ /** A quiet line under the boxes while this kind is chosen. */
44
+ hint?: string;
45
+ /** Left out of the list while its target has nothing to pick — unless the
46
+ * saved link is this kind, so a link is never shown as something it is not. */
47
+ hideWhenEmpty?: boolean;
48
+ };
49
+ /**
50
+ * Everything the picker needs to know about a URL — and it knows nothing else.
51
+ * A host hands in its own rules (the storefront's come from
52
+ * `efficient-web-builder/links`), so a new kind or a new filter never changes
53
+ * this file.
54
+ */
55
+ type LinkRules = {
56
+ /** Which kind a saved URL is. */
57
+ kindOf: (url: string) => string;
58
+ /** The target a URL points at, with any listing filter taken off. */
59
+ targetOf: (url: string) => string;
60
+ /** The filter a URL carries onto the listing, or null. */
61
+ readFilter: (url: string) => LinkFilter;
62
+ /** The URL of a target with this filter written on (or cleared). */
63
+ withFilter: (url: string, filter: LinkFilter) => string;
64
+ /** May this typed address be saved? */
65
+ isSafe: (url: string) => boolean;
66
+ };
67
+ type LinkPickerProps = {
68
+ /** The saved link, or `''`. */
69
+ value: string;
70
+ /**
71
+ * The new link, and — when a thing was PICKED — its name, so a host can fill
72
+ * its own label with it (the admin's menu item does). No name when the link
73
+ * was typed or cleared.
74
+ */
75
+ onChange: (url: string, name?: string) => void;
76
+ /** The Link type list, in order, each with what its target box offers. */
77
+ kinds: readonly LinkKindChoice[];
78
+ rules: LinkRules;
79
+ /**
80
+ * The filters a link onto this target may carry, or null when the target is
81
+ * not the product listing. Asked only for a kind whose target is a list.
82
+ */
83
+ filtersFor?: (target: string) => readonly LinkFilterField[] | null;
84
+ /** The whole control's accessible name — "Button link", "Where “Wheels” goes". */
85
+ label?: string;
86
+ readOnly?: boolean;
87
+ };
88
+ /**
89
+ * ONE LINK PICKER ([MERGE] One Link Picker For Both Editors, owner
90
+ * 2026-10-06; mockup https://claude.ai/artifact/6mVmY5787gnXdSWP3syqhu v4): a
91
+ * type — Page / Anchor / Blog post / Product / Custom URL — then which one; on
92
+ * the product listing a Filter and then a Value. The website editor's Link
93
+ * field and the admin's menu item draw this same control.
94
+ *
95
+ * IT HOLDS NO URL RULE. Which kind a link is, which page it points at, what
96
+ * filter it carries and how one is written, which typed address is unsafe —
97
+ * all of it is `rules`, and every option and every name is the host's. Only
98
+ * the order of the boxes and how they answer each other is decided here.
99
+ *
100
+ * It never writes on its own. Opening a saved link writes nothing; a target,
101
+ * filter or value the host no longer offers is shown as "(unavailable)" and
102
+ * kept, never silently replaced.
103
+ *
104
+ * Every list is `FieldSelect`, the editor's one pop-up list — the anchors
105
+ * under one heading per page (`FieldOption.group`), a long list with a search
106
+ * box — never the browser's `<select>`. The boxes stack, one under the next,
107
+ * at every panel width.
108
+ */
109
+ declare function LinkPicker({ value, onChange, kinds, rules, filtersFor, label, readOnly }: LinkPickerProps): react.JSX.Element | null;
110
+
111
+ export { type LinkOption as L, type LinkFilterField as a, type LinkFilter as b, type LinkKindChoice as c, type LinkOptionGroup as d, LinkPicker as e, type LinkPickerProps as f, type LinkRules as g, type LinkTarget as h };
@@ -1,10 +1,13 @@
1
- import { A as Autosave, a as AutosaveSnapshot, b as SaveIndicator, c as AutosaveOptions } from '../words-BMzV04b1.js';
2
- export { d as AutosaveClock, S as SaveWords, e as createAutosave, s as saveIndicator } from '../words-BMzV04b1.js';
3
- import '../types-DGcCsxs8.js';
1
+ import { a as Autosave, A as AutosaveSnapshot, b as AutosaveOptions } from '../engine-DBxp_v6B.js';
2
+ export { c as AutosaveClock, d as createAutosave } from '../engine-DBxp_v6B.js';
3
+ import { a as SaveIndicator } from '../words-D_Lnw1Gr.js';
4
+ export { S as SaveWords, s as saveIndicator } from '../words-D_Lnw1Gr.js';
5
+ import '../types-CqY85foL.js';
4
6
  import '../types-DWS-s9z-.js';
5
7
  import '../wordFit-D4S36PvB.js';
6
8
  import 'react';
7
9
  import '../edit-lock/index.js';
10
+ import '../panelWidths-D9hTLR25.js';
8
11
 
9
12
  type UseAutosaveOptions<T> = Omit<AutosaveOptions<T>, 'save' | 'onFailure'> & {
10
13
  /** Write one document. Read at call time, so it may close over current props. */
@@ -1 +1 @@
1
- import{saveIndicator as e}from"../chunk-H6DDIBQ4.js";export{saveIndicator}from"../chunk-H6DDIBQ4.js";import{useRef as n,useEffect as t,useState as u,useSyncExternalStore as r,useMemo as o}from"react";var l=1e3,s=3e3,i=5e3,a=[2e3,5e3,15e3,3e4];function c(e,n=a){const t=n.length-1;return n[Number.isFinite(e)?Math.min(Math.max(Math.trunc(e),0),t):t]}var d={now:()=>Date.now(),setTimeout:(e,n)=>globalThis.setTimeout(e,n),clearTimeout:e=>globalThis.clearTimeout(e)};function f(e={}){const n=e.clock??d,t=e.debounceMs??1e3,u=e.maxWaitMs??3e3,r=e.unsavedAfterMs??5e3,o=e.retryDelays??a;let l=e.save??(()=>Promise.reject(new Error("autosave used before setSave"))),s=null,i=null,f=null,m=0,h=null,v=0,p=!1,w=!1,g=!1,b=!1,y=!1,T=!1,M=0,P=null,S=null;const D=/* @__PURE__ */new Set;let E=L();function L(){return{pending:null!==s,unsaved:T,failed:p,attempt:v,saved:w,paused:g,stopped:b}}function x(){if(y)return;const e=L();if(!Object.keys(e).every(n=>e[n]===E[n])){E=e;for(const e of[...D])e()}}function j(){null!==P&&n.clearTimeout(P),P=null}function k(e){j(),P=n.setTimeout(()=>{P=null,B()},e)}function F(){const e=n.now(),r=Math.min(m+t,(i??e)+u);k(Math.max(0,r-e))}function N(){if(null!==S&&n.clearTimeout(S),S=null,null===i)return void(T=!1);const e=i+r-n.now();T=e<=0,T||(S=n.setTimeout(()=>{S=null,T=!0,x()},e))}function B(){if(h)return h;if(y||b||!s)return Promise.resolve(null===s);j();const t=s,u=M;return f=null,h=Promise.resolve().then(()=>l(t.value)).then(()=>(u!==M||(h=null,w=!0,p=!1,v=0,s===t?(s=null,i=null):i=f??n.now(),f=null,N(),!s||g||b||y||F(),x()),!0),n=>{if(u!==M)return!1;if(h=null,f=null,b||y)return x(),!1;p=!0;const t=v;return v=t+1,e.onFailure?.(n,t),g||k(c(t,o)),x(),!1}),h}async function I(){for(;;){if(y||b)return null===s;if(!h&&!s)return!0;if(!await(h??B()))return!1}}return{setSave(e){l=e},push(e){if(y)return;const t=n.now();s={value:e},m=t,h&&null===f&&(f=t),null===i&&(i=t,N()),g||b||h||p||F(),x()},flush:I,retryNow:()=>(v=0,I()),pause(){y||g||(g=!0,j(),x())},resume:()=>y?Promise.resolve(null===s):(g=!1,x(),I()),stop(){y||(b=!0,j(),x())},reset(){y||(M++,h=null,j(),s=null,i=null,f=null,v=0,p=!1,w=!1,b=!1,N(),x())},hasPending:()=>null!==s,getSnapshot:()=>E,subscribe:e=>(D.add(e),()=>{D.delete(e)}),dispose(){j(),null!==S&&n.clearTimeout(S),S=null,y=!0}}}function m(e,n={document:document,window:window}){const t=n.document,u=n.window,r=()=>{"hidden"===t.visibilityState&&e()},o=()=>e();return t.addEventListener("visibilitychange",r),u.addEventListener("pagehide",o),()=>{t.removeEventListener("visibilitychange",r),u.removeEventListener("pagehide",o)}}function h(e){const n=e.getSnapshot();n.paused||n.stopped||e.flush()}function v(l){const s=n(l);t(()=>{s.current=l});const[i]=u(()=>f({...l,save:e=>s.current.save(e),onFailure:(e,n)=>s.current.onFailure?.(e,n)})),a=r(i.subscribe,i.getSnapshot,i.getSnapshot);t(()=>m(()=>h(i)),[i]);const c=l.warnBeforeUnload??!0;return t(()=>{if(!c)return;const e=e=>{i.hasPending()&&(e.preventDefault(),e.returnValue="")};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[i,c]),t(()=>()=>h(i),[i]),o(()=>({state:a,indicator:e(a),push:i.push,flush:i.flush,retryNow:i.retryNow,pause:i.pause,resume:i.resume,stop:i.stop,reset:i.reset,hasPending:i.hasPending}),[i,a])}export{l as AUTOSAVE_DEBOUNCE_MS,s as AUTOSAVE_MAX_WAIT_MS,a as AUTOSAVE_RETRY_DELAYS_MS,i as AUTOSAVE_UNSAVED_AFTER_MS,c as autosaveRetryDelay,f as createAutosave,m as installTabAwayFlush,v as useAutosave};
1
+ export{AUTOSAVE_DEBOUNCE_MS,AUTOSAVE_MAX_WAIT_MS,AUTOSAVE_RETRY_DELAYS_MS,AUTOSAVE_UNSAVED_AFTER_MS,autosaveRetryDelay,createAutosave,installTabAwayFlush,useAutosave}from"../chunk-BDTITTMW.js";export{saveIndicator}from"../chunk-H6DDIBQ4.js";
@@ -1,9 +1,10 @@
1
1
  import * as react from 'react';
2
- import { T as TopBarProps, a as TopBarClusterProps, b as TopBarRailProps, E as EaselIconButtonProps, D as DeviceSwitchProps, c as SaveStateProps, d as SaveStateToggleProps, P as PanelResizeHandleProps, I as InspectorHeadProps, e as InspectorIconButtonProps, f as InspectorUpLevelProps, M as MediaPanelHeadProps, g as MediaPickKind, h as EditNoticeProps } from '../types-DGcCsxs8.js';
3
- export { i as DEFAULT_PANEL_W, j as DeviceOption, k as MAX_PANEL_W, l as MIN_PANEL_W, m as PanelSide, n as PanelWidths, R as RailWordsShown, S as SaveTone, o as clampPanelWidth, p as panelWidthVars, s as setPanelWidthVars } from '../types-DGcCsxs8.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-CqY85foL.js';
3
+ export { D as DeviceOption, R as RailWordsShown, S as SaveTone } from '../types-CqY85foL.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
+ 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';
7
8
  import '../types-DWS-s9z-.js';
8
9
  import '../wordFit-D4S36PvB.js';
9
10
 
@@ -1,25 +1 @@
1
- import{DEFAULT_NOTICE_WORDS as e,DEFAULT_CHROME_WORDS as n}from"../chunk-ZJEBF4NB.js";import{holderOf as t,describeAge as i,nameOrSomeone as r}from"../chunk-JUQ6YJCG.js";import{DEFAULT_LOCK_WORDS as a}from"../chunk-RE4LP46F.js";import{railTokens as o,EaselRail as s}from"../chunk-WZ7TGAAT.js";import{DEFAULT_RAIL_WORDS as l}from"../chunk-2OAZYSWJ.js";import{useWords as c}from"../chunk-MFIRYGHW.js";import"../chunk-BZ5ASXOL.js";import{PanelLeftIcon as d,PanelRightIcon as u,MediaIcon as m,ImageIcon as h}from"../chunk-L5KW4HG5.js";import{jsx as p,jsxs as v,Fragment as f}from"react/jsx-runtime";import{useRef as b,useState as k,useCallback as g,useEffect as y,useLayoutEffect as w}from"react";function N({children:e}){/* @__PURE__ */
2
- return p("div",{className:"es-topbar",children:e})}function C({kind:e,style:n,children:t}){/* @__PURE__ */
3
- return p("div",{className:e?`es-cluster es-cluster--${e}`:"es-cluster",style:n,children:t})}function x(){/* @__PURE__ */
4
- return p("div",{className:"es-divider-v","aria-hidden":"true"})}var P="undefined"==typeof window?y:w;function O({items:e,ariaLabel:n,onWords:t}){const i=c("rail",l),r=b(null),[a,d]=k(void 0),[u,m]=k(null),h=JSON.stringify(e.map(e=>e.label));P(()=>{const n=r.current?.querySelector(".es-rail");if(!n)return;const t=document.createElement("canvas").getContext?.("2d")??null,i=()=>{if(m(h),!t)return d(void 0);const i=function(e,n,t){const i=parseFloat(getComputedStyle(e).getPropertyValue(n));return Number.isFinite(i)?i:t}(n,"--es-rail-word-size",o.wordFontSize),r=getComputedStyle(n).getPropertyValue("--es-rail-word-weight").trim()||String(o.wordFontWeight),a=getComputedStyle(n.querySelector(".es-rail-btn")??n).fontFamily;t.font=`${r} ${i}px ${a}`;const s=e.map(e=>t.measureText(e.label).width),l=e=>Math.ceil(4*e)/4;d({labelsPx:l(s.reduce((e,n)=>e+n,0)),widestLabelPx:l(Math.max(0,...s))})};i();let a=!0;return document.fonts?.ready.then(()=>a&&i()),()=>{a=!1}},[h]);const v=b(t);v.current=t;const f=b(null),g=Boolean(t),y=e.map(e=>e.active?"1":"0").join("");return P(()=>{const e=r.current;if(!g||!e||u!==h)return;const n=()=>{const n=Array.from(e.querySelectorAll(".es-rail-word")),t=n.filter(e=>e.getBoundingClientRect().width>0).length,i=n.length>0&&t===n.length?"all":t>0?"chosen":"none";i!==f.current&&(f.current=i,v.current?.(i))};n();const t=e.ownerDocument.defaultView?.ResizeObserver,i=t?new t(n):null;return i?.observe(e),()=>i?.disconnect()},[g,u,h,a,y]),/* @__PURE__ */p("div",{ref:r,className:"es-cluster es-cluster--rail es-rail-fit",children:/* @__PURE__ */p(s,{items:e,ariaLabel:n??i.label,orientation:"row",wordFit:a})})}function L({label:e,onClick:n,disabled:t,state:i,buttonRef:r,children:a}){/* @__PURE__ */
5
- return p("button",{ref:r,type:"button",className:i?`es-iconbtn es-iconbtn--${i}`:"es-iconbtn",title:e,"aria-label":e,disabled:t,onClick:n,children:a})}function S({devices:e,value:t,onChange:i,ariaLabel:r}){const a=c("chrome",n);/* @__PURE__ */
6
- return p("div",{className:"es-devseg",role:"group","aria-label":r??a.device,children:e.map(e=>{const n=e.id===t;/* @__PURE__ */
7
- return p("button",{type:"button",title:e.label,"aria-label":e.label,"aria-pressed":n,className:n?"is-active":void 0,onClick:()=>{n||i(e.id)},children:e.icon},e.id)})})}var B={idle:"is-quiet",saved:"is-quiet is-saved",saving:"is-saving",error:"is-error",off:"is-off","off-unsaved":"is-off is-unsaved"};function $({tone:e,label:n,counting:t,waitMs:i,ringRef:r,role:a}){/* @__PURE__ */
8
- return v("span",{className:`es-savestate ${B[e]}`,role:a,"aria-live":"polite",children:[/* @__PURE__ */p("span",t?{ref:r,className:"es-savestate-ring is-counting",style:void 0!==i?{"--es-savewait":`${i}ms`}:void 0,"aria-hidden":"true"}:{className:"es-savestate-dot","aria-hidden":"true"}),n]})}function M({pressed:e,title:n,onToggle:t,children:i}){/* @__PURE__ */
9
- return p("button",{type:"button",className:"es-savestate-toggle","aria-pressed":e,title:n,onClick:t,children:i})}var R="es-col-resizing";function z({side:e,width:t,min:i,max:r,defaultWidth:a,label:o,onResize:s}){const l=c("chrome",n),d=b(null),u=g((n,t)=>{const a="left"===e?n+t:n-t;return Math.round(Math.min(r,Math.max(i,a)))},[e,i,r]),m=g(e=>{d.current&&(d.current=null,document.body.classList.remove(R),e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))},[]),h=g(e=>{0===e.button&&(d.current={x:e.clientX,w:t,moved:!1},e.currentTarget.setPointerCapture(e.pointerId),document.body.classList.add(R))},[t]),v=g(e=>{const n=d.current;if(!n)return;if(0===e.buttons)return void m(e);const t=e.clientX-n.x;if(!n.moved){if(Math.abs(t)<3)return;n.moved=!0}s(u(n.w,t))},[s,u,m]),f=g(e=>{"ArrowLeft"===e.key?(e.preventDefault(),s(e=>u(e,-16))):"ArrowRight"===e.key?(e.preventDefault(),s(e=>u(e,16))):"Home"===e.key&&(e.preventDefault(),s(a))},[s,u,a]);return y(()=>()=>document.body.classList.remove(R),[]),/* @__PURE__ */p("div",{className:`es-resizer es-resizer--${e}`,role:"separator",tabIndex:0,"aria-orientation":"vertical","aria-label":o,"aria-valuenow":t,"aria-valuemin":i,"aria-valuemax":r,title:l.resize,onPointerDown:h,onPointerMove:v,onPointerUp:m,onPointerCancel:m,onLostPointerCapture:m,onDoubleClick:()=>s(a),onKeyDown:f,children:/* @__PURE__ */p("span",{className:"es-resizer-bar","aria-hidden":"true"})})}function j({icon:e,name:n,kind:t,actions:i}){/* @__PURE__ */
10
- return v("div",{className:"es-insp-head",children:[
11
- /* @__PURE__ */p("span",{className:"es-insp-chip","aria-hidden":"true",children:e}),
12
- /* @__PURE__ */v("div",{className:"es-insp-titles",children:[
13
- /* @__PURE__ */p("h2",{className:"es-insp-name",children:n}),
14
- /* @__PURE__ */p("div",{className:"es-insp-kind",children:t})]}),i?/* @__PURE__ */p("div",{className:"es-insp-actions",children:i}):null]})}function F({label:e,title:n,hasPopup:t,onClick:i,disabled:r,danger:a,expanded:o,buttonRef:s,children:l}){/* @__PURE__ */
15
- return p("button",{ref:s,type:"button",className:a?"es-insp-iconbtn es-insp-iconbtn--danger":"es-insp-iconbtn",title:n??e,"aria-label":e,"aria-haspopup":t,"aria-expanded":o,disabled:r,onClick:i,children:l})}function T({name:e,onSelect:t,label:i,inline:r}){const a=c("chrome",n),o=i??a.upLevel,s=/* @__PURE__ */v("button",{type:"button",className:"es-insp-up-btn",title:o,"aria-label":a.upLevelTo({label:o,name:e}),onClick:t,children:[
16
- /* @__PURE__ */p("span",{className:"es-insp-up-arrow","aria-hidden":"true",children:"←"}),
17
- /* @__PURE__ */p("span",{className:"es-insp-up-name",children:e})]});return r?s:/* @__PURE__ */p("div",{className:"es-insp-up",children:s})}function A({context:e,pick:t,onCancel:i,onHide:r,side:a="left"}){const o=c("chrome",n),s=r?/* @__PURE__ */p(F,{label:o.hidePanelLabel({side:a}),title:o.hidePanel,onClick:r,children:/* @__PURE__ */p("left"===a?d:u,{size:16})}):null;if(!t)/* @__PURE__ */
18
- return p(j,{icon:/* @__PURE__ */p(m,{}),name:o.mediaLibrary,kind:e,actions:s??void 0});const l=o.mediaKinds[t.kind];/* @__PURE__ */
19
- return p(j,{icon:/* @__PURE__ */p(h,{size:15}),name:o.mediaChoose({kind:l}),kind:t.field?o.mediaFor({field:t.field}):e,actions:/* @__PURE__ */v(f,{children:[
20
- /* @__PURE__ */p("button",{type:"button",className:"es-btn-ghost es-insp-textbtn",title:o.mediaKeep({kind:l}),onClick:i,children:o.mediaCancel}),s?/* @__PURE__ */v(f,{children:[
21
- /* @__PURE__ */p("span",{className:"es-insp-divider","aria-hidden":"true"}),s]}):null]})})}function W(e){return/svg/i.test(e)?"svg":e.startsWith("video")?"video":"image"}var D={notice:e,lock:a};function q(e,n,a,o=D){const s=o.notice,l=t(e),c={kind:"reload",label:s.reload};if(n){const e=i(n.secondsAgo,o.lock);return{tone:"warning",urgent:!0,lead:n.savedByYou?s.savedByYou({noun:a,when:e}):s.savedByOther({name:r(n.savedBy,o.lock),noun:a,when:e}),body:s.conflictBody,actions:l?[c,{kind:"take-over",label:s.takeOver,title:s.takeOverWhileDeciding}]:[c]}}if(!l)return null;const d=r(l.name,o.lock),u=i(l.secondsSinceSeen,o.lock);switch(e.kind){case"takenover":return{tone:"warning",urgent:!0,lead:s.tookOver({name:d,noun:a,when:i(l.secondsSinceHeld,o.lock)}),body:s.tookOverBody,actions:[{kind:"take-back",label:s.takeBack},c]};case"readonly":return{tone:"neutral",urgent:!1,lead:s.viewingOnly,body:s.viewingOnlyBody({name:d,noun:a,seen:u}),actions:[{kind:"take-over",label:s.takeOver}]};default:return{tone:"warning",urgent:!1,lead:s.editing({name:d,noun:a}),body:s.editingBody({seen:u}),actions:[{kind:"view-read-only",label:s.viewReadOnly},{kind:"take-over",label:s.takeOver,title:s.takeOverTold}]}}}function H({access:n,conflict:t,noun:i,onTakeOver:r,onViewReadOnly:o,onReload:s}){const l=q(n,t,i,{notice:c("notice",e),lock:c("lock",a)});if(!l)return null;const d={reload:s,"take-over":r,"take-back":r,"view-read-only":o};/* @__PURE__ */
22
- return v("div",{className:`es-notice is-${l.tone}`,role:l.urgent?"alert":"status",children:[
23
- /* @__PURE__ */v("span",{className:"es-notice-text",children:[
24
- /* @__PURE__ */p("strong",{children:l.lead})," ",l.body]}),
25
- /* @__PURE__ */p("span",{className:"es-notice-actions",children:l.actions.map(e=>/* @__PURE__ */p("button",{type:"button",className:"es-notice-btn",title:e.title,onClick:d[e.kind],children:e.label},e.kind))})]})}var I={left:288,right:320},J=220,Y=560;function G(e){return Math.min(560,Math.max(220,Math.round(e)))}function K(e){return{"--es-left-w":`${e.left}px`,"--es-right-w":`${e.right}px`}}function V(e,n){e.style.setProperty("--es-left-w",`${n.left}px`),e.style.setProperty("--es-right-w",`${n.right}px`)}export{I as DEFAULT_PANEL_W,S as DeviceSwitch,L as EaselIconButton,N as EaselTopBar,H as EditNotice,j as InspectorHead,F as InspectorIconButton,T as InspectorUpLevel,Y as MAX_PANEL_W,J as MIN_PANEL_W,A as MediaPanelHead,z as PanelResizeHandle,$ as SaveState,M as SaveStateToggle,C as TopBarCluster,x as TopBarDivider,O as TopBarRail,G as clampPanelWidth,q as editNotice,W as mediaPickKind,K as panelWidthVars,V as setPanelWidthVars};
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-6DJHRLCU.js";import"../chunk-ZJEBF4NB.js";import"../chunk-JUQ6YJCG.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";
@@ -0,0 +1 @@
1
+ function r(r,t){let n=!1;const o={...r.props};for(const s of t){const t=Array.isArray(r.props[s])?r.props[s]:[],e=/* @__PURE__ */new Set,p=t.filter(r=>{const t=r?.props?.id;return!(!t||e.has(t))&&(e.add(t),!0)});p.length!==t.length&&(o[s]=p,n=!0)}return n?o:null}export{r as dedupeSlotChildren};
@@ -0,0 +1 @@
1
+ import{DEFAULT_NODE_MENU_WORDS as e}from"./chunk-WK3AFPXY.js";import{TrashIcon as n,EyeIcon as o,EyeOffIcon as t,RenameIcon as c,PasteIcon as i,CopyIcon as l,MoveDownIcon as s,MoveUpIcon as p,DuplicateIcon as a,AddIcon as r,LayersIcon as u}from"./chunk-L5KW4HG5.js";import{jsx as h}from"react/jsx-runtime";function d(){let e=null;const n=/* @__PURE__ */new Set;return{get:()=>e,set(o){e=o;for(const e of[...n])e()},subscribe:e=>(n.add(e),()=>n.delete(e))}}var m={layer:{icon:/* @__PURE__ */h(u,{})},addInside:{icon:/* @__PURE__ */h(r,{})},duplicate:{icon:/* @__PURE__ */h(a,{})},moveUp:{icon:/* @__PURE__ */h(p,{})},moveDown:{icon:/* @__PURE__ */h(s,{})},copy:{icon:/* @__PURE__ */h(l,{}),shortcut:"⌘C"},cut:{icon:/* @__PURE__ */h(l,{}),shortcut:"⌘X"},paste:{icon:/* @__PURE__ */h(i,{}),shortcut:"⌘V"},rename:{icon:/* @__PURE__ */h(c,{})},hide:{icon:/* @__PURE__ */h(t,{})},show:{icon:/* @__PURE__ */h(o,{})},upLevel:{},delete:{icon:/* @__PURE__ */h(n,{}),danger:!0}};function g(n){const{actions:o,rows:t={},extras:c={},words:i=e}=n,l=e=>({...m[e],label:i[e],...t[e]}),s=(e,n,o)=>{const t=l(e),c={label:o??t.label??e,onClick:n};return t.icon&&(c.icon=t.icon),t.shortcut&&(c.shortcut=t.shortcut),t.danger&&(c.danger=!0),c},p=()=>{const e=l("layer"),o={label:e.label??i.layer,onClick:()=>{},children:n.layer.items};return e.icon&&(o.icon=e.icon),o},a=[],r=[],u=[],h=[],d=!!n.layer&&n.layer.items.length>1;if(d&&"pick"===(n.layer.group??"pick")&&a.push(p()),o.addInside&&r.push(s("addInside",o.addInside)),o.duplicate&&r.push(s("duplicate",o.duplicate)),o.moveUp&&r.push(s("moveUp",o.moveUp)),o.moveDown&&r.push(s("moveDown",o.moveDown)),o.copy&&r.push(s("copy",o.copy)),o.cut&&r.push(s("cut",o.cut)),o.paste){const e=l("paste").label??i.paste;r.push(s("paste",o.paste.run,i.pasteNamed({paste:e,label:o.paste.label})))}o.rename&&u.push(s("rename",o.rename)),o.hide&&u.push(o.hide.hidden?s("show",o.hide.run):s("hide",o.hide.run)),d&&"change"===n.layer.group&&u.push(p()),o.upLevel&&u.push(s("upLevel",o.upLevel)),o.delete&&h.push(s("delete",o.delete)),a.push(...c.pick??[]),r.push(...c.make??[]),u.push(...c.change??[]),h.push(...c.remove??[]);const g=[a,r,n.style??[],u,h].filter(e=>e.length>0),v=a.length+r.length+u.length+h.length===0,b=[{label:n.title,header:!0,onClick:()=>{}}];return v&&n.pinnedLine&&b.push({label:n.pinnedLine,header:!0,onClick:()=>{}}),g.forEach((e,o)=>{(o>0||v&&n.pinnedLine)&&b.push({label:"—",onClick:()=>{}}),b.push(...e)}),b}export{d as createNodeClipboard,g as nodeMenuItems};
@@ -0,0 +1,4 @@
1
+ import{settlePanelPick as e}from"./chunk-ZZ7VLIHQ.js";import{useScreenOwnerName as n}from"./chunk-NBJ2YY6Y.js";import{MediaPanelHead as i,mediaPickKind as c}from"./chunk-6DJHRLCU.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=n();/* @__PURE__ */
2
+ return o(r,{children:[
3
+ /* @__PURE__ */t(i,{context:p,pick:d?{kind:c(d.accept),field:d.title||void 0}:null,onCancel:()=>d&&e(d.requestId,null),onHide:m}),
4
+ /* @__PURE__ */t("div",{className:"sf-media-panel",children:/* @__PURE__ */t(l,{pick:d,onPick:n=>d&&e(d.requestId,n)})})]})}export{l as MediaSidePanel};
@@ -0,0 +1,3 @@
1
+ import{jsxs as l,jsx as s}from"react/jsx-runtime";function e({label:e,blocked:t,onAdd:n,small:a=!1}){/* @__PURE__ */
2
+ return l("button",{type:"button",className:"sf-add-card",disabled:null!==t,title:t??void 0,onClick:n,children:[
3
+ /* @__PURE__ */s("span",{className:a?"sf-plus sf-plus--sm":"sf-plus",children:"+"}),e]})}export{e as AddChildRow};
@@ -0,0 +1 @@
1
+ function t(t){"undefined"!=typeof document&&document.documentElement.setAttribute("data-editor-theme","light")}export{t as applyEaselChromeTheme};
@@ -0,0 +1 @@
1
+ import{HERO_SLIDER_GOTO_EVENT as t}from"./chunk-IQ5TA7AM.js";import{isPreviewClick as e}from"./chunk-R5L2E7JX.js";var n=()=>document.querySelector(".sf-editor #preview-frame");function o(t){e()||requestAnimationFrame(()=>{n()?.contentDocument?.querySelector(`[data-puck-component="${CSS.escape(t)}"]`)?.scrollIntoView({behavior:"smooth",block:"start"})})}function r(e,o){const r=n()?.contentWindow;if(!r)return;const c={id:e,index:o};r.dispatchEvent(new CustomEvent(t,{detail:c}))}function c(){requestAnimationFrame(()=>{n()?.contentWindow?.scrollTo({top:0,behavior:"smooth"})})}function u(t,{passes:e=[150,400],onPinned:o}={}){let r=0,c=!1;const u=[],i=()=>{const r=n(),s=r?.contentWindow,l=r?.contentDocument;if(!s||!l)return!1;const a=t(s,l);if(null==a)return!1;if(s.scrollTo({left:s.scrollX,top:a,behavior:"instant"}),!c){c=!0,o?.();for(const t of e)u.push(setTimeout(i,t))}return!0},s=()=>{!i()&&r++<150&&u.push(setTimeout(s,32))};return s(),()=>u.forEach(clearTimeout)}function i(t){return u((e,n)=>{const o=n.querySelector(`[data-puck-component="${CSS.escape(t)}"]`);return o?e.scrollY+o.getBoundingClientRect().top:null})}function s(t){return u((t,e)=>{if(!e.querySelector("[data-puck-component]"))return null;const n=Math.max(e.documentElement.scrollHeight,e.body?.scrollHeight??0);return n<=e.documentElement.clientHeight?null:n},{passes:[150,400,800,1300,2e3],onPinned:t})}export{r as gotoPreviewSlide,s as pinPreviewToBottom,i as pinPreviewToSection,n as previewFrame,o as scrollPreviewToSection,c as scrollPreviewToTop};
@@ -0,0 +1 @@
1
+ import{WebsiteBackendError as e}from"./chunk-KDYIMJTZ.js";import{backendOf as s}from"./chunk-AJBJ74ME.js";var r=()=>Promise.reject(new e("unavailable","This editor's backend keeps no section templates.")),t={list:()=>Promise.resolve([]),get:()=>Promise.resolve(null),ensure:r,save:r,update:r,rename:r,remove:r},o=()=>s().sectionTemplates??t,a={list:()=>o().list(),get:e=>o().get(e),ensure:(e,s,r)=>o().ensure(e,s,r),save:(e,s)=>o().save(e,s),update:(e,s)=>o().update(e,s),rename:(e,s)=>o().rename(e,s),remove:e=>o().remove(e)};export{a as sectionTemplates};
@@ -0,0 +1 @@
1
+ import{DEFAULT_STYLE_CLIPBOARD_WORDS as t}from"./chunk-6WY6ZXJG.js";import{CopyStyleIcon as e,PasteStyleIcon as n}from"./chunk-L5KW4HG5.js";import{jsx as o}from"react/jsx-runtime";var r="__styleKind";function u(t,e){return t[r]=e,t}function c(t,e){return`${t}:${e.map(t=>String(t)).sort().join("|")}`}function i(t){if(!t)return null;const e=t.indexOf(":");if(e<0)return null;const n=t.slice(0,e);return s.has(n)?{control:n,values:t.slice(e+1).split("|")}:null}var s=/* @__PURE__ */new Set(["choice","select","radio"]);function l(t){if(!t||"object"!=typeof t)return null;const e=t;return"string"==typeof e[r]?e[r]:"text"===e.type||"textarea"===e.type||"number"===e.type?e.type:"select"!==e.type&&"radio"!==e.type||!Array.isArray(e.options)?null:c(e.type,e.options.map(t=>t?.value))}function a(t){return null!=t&&""!==t}function p(t,e){let n=t;for(const t of e){if(!n||"object"!=typeof n)return;n=n[t]}return n}function f(t){return void 0===t?t:JSON.parse(JSON.stringify(t))}function d(t,e,n){const[o,...r]=e,u={...t};if(0===r.length)return void 0===n?delete u[o]:u[o]=n,u;const c=u[o],i=d(c&&"object"==typeof c?c:{},r,n);return 0===Object.keys(i).length?delete u[o]:u[o]=i,u}var y=t=>t.join("."),h="editor-shell:style-clipboard",g=null,m=!1,v=/* @__PURE__ */new Set;function S(){try{return"undefined"==typeof sessionStorage?null:sessionStorage}catch{return null}}function b(){if(!m){m=!0;try{const t=S()?.getItem(h);t&&(g=JSON.parse(t))}catch{g=null}}}function k(t){b(),g={scope:t.scope,sourceType:t.type,sourceLabel:t.label,rows:t.rows.map(e=>{const n=p(t.props,e.path);return{path:[...e.path],kind:e.kind,counted:!1!==e.counted,value:a(n)?f(n):void 0}})};try{S()?.setItem(h,JSON.stringify(g))}catch{}return v.forEach(t=>t()),g}function N(t){return b(),g&&g.scope===t?g:null}function j(t){return v.add(t),()=>{v.delete(t)}}function C(){g=null,m=!0;try{S()?.removeItem(h)}catch{}v.forEach(t=>t())}function w(t,e,n){if(t.kind===e.kind)return null!==e.kind||n;const o=i(t.kind),r=i(e.kind);return!(!o||!r||o.control!==r.control)&&(!a(t.value)||r.values.includes(String(t.value)))}function K(t,e){const n=t.sourceType===e.type,o=new Map(t.rows.map(t=>[y(t.path),t]));let r=e.props,u=0,c=!1;for(const t of e.rows){const e=o.get(y(t.path));if(!e)continue;if(!w(e,t,n))continue;const i=p(r,t.path),s=void 0===e.value?void 0:f(e.value);JSON.stringify(a(i)?i:void 0)!==JSON.stringify(s)&&(r=d(r,t.path,s),c=!0),!1!==t.counted&&(u+=1)}return{props:r,pasted:u,changed:c}}function O(e,n,o,r=t){return 0===e.pasted?r.nothing({source:n,target:o}):r.pasted({count:e.pasted,source:n})}var E="⌥⌘C",J="⌥⌘V";function T(r){const u=r.words??t,c=[];return r.canCopy&&c.push({label:u.copy,icon:/* @__PURE__ */o(e,{}),shortcut:"⌥⌘C",onClick:r.onCopy}),r.held&&c.push({label:u.paste({source:r.held.sourceLabel}),icon:/* @__PURE__ */o(n,{}),shortcut:"⌥⌘V",onClick:r.onPaste}),c}function x(t){if(!t.altKey||t.shiftKey||!t.metaKey&&!t.ctrlKey)return null;const e=t.target;return e&&(e.isContentEditable||"INPUT"===e.tagName||"TEXTAREA"===e.tagName||"SELECT"===e.tagName)?null:"KeyC"===t.code?"copy":"KeyV"===t.code?"paste":null}export{E as COPY_STYLE_SHORTCUT,J as PASTE_STYLE_SHORTCUT,r as STYLE_KIND,c as choiceKind,C as clearStyle,k as copyStyle,l as fieldKind,N as heldStyle,O as pasteMessage,K as planPaste,T as styleMenuItems,x as styleShortcut,j as subscribeStyle,u as withStyleKind};
@@ -0,0 +1,13 @@
1
+ import{jsx as e,jsxs as r,Fragment as a}from"react/jsx-runtime";var t={eye:/* @__PURE__ */r(a,{children:[
2
+ /* @__PURE__ */e("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7S2 12 2 12z"}),
3
+ /* @__PURE__ */e("circle",{cx:"12",cy:"12",r:"2.6"})]}),"eye-off":/* @__PURE__ */e("path",{d:"M3 3l18 18M10.6 10.6a2 2 0 002.8 2.8M9.4 5.2A9.7 9.7 0 0112 5c7 0 10 7 10 7a16 16 0 01-3.6 4.4M6.1 6.1A16 16 0 002 12s3 7 10 7a9.6 9.6 0 004.1-.9"}),search:/* @__PURE__ */r(a,{children:[
4
+ /* @__PURE__ */e("circle",{cx:"11",cy:"11",r:"7"}),
5
+ /* @__PURE__ */e("path",{d:"M21 21l-3.8-3.8"})]}),"external-link":/* @__PURE__ */r(a,{children:[
6
+ /* @__PURE__ */e("path",{d:"M14 4h6v6"}),
7
+ /* @__PURE__ */e("path",{d:"M20 4l-9 9"}),
8
+ /* @__PURE__ */e("path",{d:"M19 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h5"})]}),pencil:/* @__PURE__ */r(a,{children:[
9
+ /* @__PURE__ */e("path",{d:"M12 20h9"}),
10
+ /* @__PURE__ */e("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z"})]}),trash:/* @__PURE__ */r(a,{children:[
11
+ /* @__PURE__ */e("path",{d:"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m2 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}),
12
+ /* @__PURE__ */e("path",{d:"M10 11v6M14 11v6"})]}),"chevron-right":/* @__PURE__ */e("path",{d:"M9 6l6 6-6 6"})};function h({name:r,size:a,strokeWidth:h=1.8,rounded:d=!1,className:i,style:n}){/* @__PURE__ */
13
+ return e("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:h,strokeLinecap:d?"round":void 0,strokeLinejoin:d?"round":void 0,className:i,style:n,"aria-hidden":"true",children:t[r]})}export{h as UiIcon};
@@ -0,0 +1 @@
1
+ var t=t=>"object"==typeof t&&null!==t&&!Array.isArray(t);function o(o){return t(o)&&"string"==typeof o.type&&""!==o.type&&t(o.props)}function r(r,e,f){if(Array.isArray(r))for(const s of r)o(s)?n(s,e,f):t(s)&&"string"==typeof s.type&&""!==s.type&&e.add(s.type)}function e(r,f,s){if(Array.isArray(r)){if(s.has(r))return;s.add(r);for(const t of r)o(t)?n(t,f,s):e(t,f,s)}else if(t(r)&&!s.has(r)){s.add(r);for(const t of Object.values(r))e(t,f,s)}}function n(t,o,r){if(!r.has(t)){r.add(t),o.add(t.type);for(const n of Object.values(t.props))e(n,o,r)}}function f(f){const s=/* @__PURE__ */new Set,a=/* @__PURE__ */new Set;if(o(f))n(f,s,a);else if(t(f)){if(r(f.content,s,a),t(f.zones))for(const t of Object.values(f.zones))r(t,s,a);t(f.root)&&e(f.root,s,a)}return[...s].sort()}export{f as blockTypesIn};
@@ -0,0 +1,8 @@
1
+ import{blockRuns as e}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as n}from"./chunk-NBJ2YY6Y.js";import{useState as s,Fragment as a}from"react";import{jsxs as r,Fragment as c,jsx as o}from"react/jsx-runtime";function l({choices:l,onPick:t,open:m,onToggle:i}){const[p,u]=s(!1),{Icon:d}=n(),h=m??p;/* @__PURE__ */
2
+ return r(c,{children:[
3
+ /* @__PURE__ */r("button",{type:"button",className:"sf-add-card","aria-expanded":h,onClick:i??(()=>u(e=>!e)),children:[
4
+ /* @__PURE__ */o("span",{className:"sf-plus sf-plus--sm",children:"+"}),"Add block"]}),h&&/* @__PURE__ */o("div",{className:"sf-blockmenu",role:"menu",children:e(l).map(e=>/* @__PURE__ */r(a,{children:[e.group&&/* @__PURE__ */r("div",{className:"sf-menugroup-head",role:"presentation",children:[
5
+ /* @__PURE__ */o("span",{className:"sf-menugroup-title",children:e.group}),
6
+ /* @__PURE__ */o("span",{className:"sf-menugroup-count",children:e.items.length})]}),e.items.map(e=>/* @__PURE__ */r("button",{type:"button",className:"sf-blockmenu-item",role:"menuitem",onClick:()=>{u(!1),t(e.type)},children:[
7
+ /* @__PURE__ */o("span",{className:"sf-chip",children:/* @__PURE__ */o(d,{type:e.type,size:13})}),
8
+ /* @__PURE__ */o("span",{className:"sf-row-name",children:e.label})]},e.type))]},e.group??"all"))})]})}export{l as AddBlockRow};
@@ -0,0 +1,25 @@
1
+ import{DEFAULT_NOTICE_WORDS as e,DEFAULT_CHROME_WORDS as n}from"./chunk-ZJEBF4NB.js";import{holderOf as t,describeAge as i,nameOrSomeone as r}from"./chunk-JUQ6YJCG.js";import{DEFAULT_LOCK_WORDS as a}from"./chunk-RE4LP46F.js";import{railTokens as o,EaselRail as s}from"./chunk-WZ7TGAAT.js";import{DEFAULT_RAIL_WORDS as l}from"./chunk-2OAZYSWJ.js";import{useWords as c}from"./chunk-MFIRYGHW.js";import{PanelLeftIcon as d,PanelRightIcon as u,MediaIcon as m,ImageIcon as h}from"./chunk-L5KW4HG5.js";import{jsx as p,jsxs as v,Fragment as f}from"react/jsx-runtime";import{useRef as b,useState as k,useCallback as g,useEffect as y,useLayoutEffect as w}from"react";function N({children:e}){/* @__PURE__ */
2
+ return p("div",{className:"es-topbar",children:e})}function C({kind:e,style:n,children:t}){/* @__PURE__ */
3
+ return p("div",{className:e?`es-cluster es-cluster--${e}`:"es-cluster",style:n,children:t})}function x(){/* @__PURE__ */
4
+ return p("div",{className:"es-divider-v","aria-hidden":"true"})}var P="undefined"==typeof window?y:w;function O({items:e,ariaLabel:n,onWords:t}){const i=c("rail",l),r=b(null),[a,d]=k(void 0),[u,m]=k(null),h=JSON.stringify(e.map(e=>e.label));P(()=>{const n=r.current?.querySelector(".es-rail");if(!n)return;const t=document.createElement("canvas").getContext?.("2d")??null,i=()=>{if(m(h),!t)return d(void 0);const i=function(e,n,t){const i=parseFloat(getComputedStyle(e).getPropertyValue(n));return Number.isFinite(i)?i:t}(n,"--es-rail-word-size",o.wordFontSize),r=getComputedStyle(n).getPropertyValue("--es-rail-word-weight").trim()||String(o.wordFontWeight),a=getComputedStyle(n.querySelector(".es-rail-btn")??n).fontFamily;t.font=`${r} ${i}px ${a}`;const s=e.map(e=>t.measureText(e.label).width),l=e=>Math.ceil(4*e)/4;d({labelsPx:l(s.reduce((e,n)=>e+n,0)),widestLabelPx:l(Math.max(0,...s))})};i();let a=!0;return document.fonts?.ready.then(()=>a&&i()),()=>{a=!1}},[h]);const v=b(t);v.current=t;const f=b(null),g=Boolean(t),y=e.map(e=>e.active?"1":"0").join("");return P(()=>{const e=r.current;if(!g||!e||u!==h)return;const n=()=>{const n=Array.from(e.querySelectorAll(".es-rail-word")),t=n.filter(e=>e.getBoundingClientRect().width>0).length,i=n.length>0&&t===n.length?"all":t>0?"chosen":"none";i!==f.current&&(f.current=i,v.current?.(i))};n();const t=e.ownerDocument.defaultView?.ResizeObserver,i=t?new t(n):null;return i?.observe(e),()=>i?.disconnect()},[g,u,h,a,y]),/* @__PURE__ */p("div",{ref:r,className:"es-cluster es-cluster--rail es-rail-fit",children:/* @__PURE__ */p(s,{items:e,ariaLabel:n??i.label,orientation:"row",wordFit:a})})}function L({label:e,onClick:n,disabled:t,state:i,buttonRef:r,children:a}){/* @__PURE__ */
5
+ return p("button",{ref:r,type:"button",className:i?`es-iconbtn es-iconbtn--${i}`:"es-iconbtn",title:e,"aria-label":e,disabled:t,onClick:n,children:a})}function S({devices:e,value:t,onChange:i,ariaLabel:r}){const a=c("chrome",n);/* @__PURE__ */
6
+ return p("div",{className:"es-devseg",role:"group","aria-label":r??a.device,children:e.map(e=>{const n=e.id===t;/* @__PURE__ */
7
+ return p("button",{type:"button",title:e.label,"aria-label":e.label,"aria-pressed":n,className:n?"is-active":void 0,onClick:()=>{n||i(e.id)},children:e.icon},e.id)})})}var B={idle:"is-quiet",saved:"is-quiet is-saved",saving:"is-saving",error:"is-error",off:"is-off","off-unsaved":"is-off is-unsaved"};function $({tone:e,label:n,counting:t,waitMs:i,ringRef:r,role:a}){/* @__PURE__ */
8
+ return v("span",{className:`es-savestate ${B[e]}`,role:a,"aria-live":"polite",children:[/* @__PURE__ */p("span",t?{ref:r,className:"es-savestate-ring is-counting",style:void 0!==i?{"--es-savewait":`${i}ms`}:void 0,"aria-hidden":"true"}:{className:"es-savestate-dot","aria-hidden":"true"}),n]})}function M({pressed:e,title:n,onToggle:t,children:i}){/* @__PURE__ */
9
+ return p("button",{type:"button",className:"es-savestate-toggle","aria-pressed":e,title:n,onClick:t,children:i})}var R="es-col-resizing";function z({side:e,width:t,min:i,max:r,defaultWidth:a,label:o,onResize:s}){const l=c("chrome",n),d=b(null),u=g((n,t)=>{const a="left"===e?n+t:n-t;return Math.round(Math.min(r,Math.max(i,a)))},[e,i,r]),m=g(e=>{d.current&&(d.current=null,document.body.classList.remove(R),e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))},[]),h=g(e=>{0===e.button&&(d.current={x:e.clientX,w:t,moved:!1},e.currentTarget.setPointerCapture(e.pointerId),document.body.classList.add(R))},[t]),v=g(e=>{const n=d.current;if(!n)return;if(0===e.buttons)return void m(e);const t=e.clientX-n.x;if(!n.moved){if(Math.abs(t)<3)return;n.moved=!0}s(u(n.w,t))},[s,u,m]),f=g(e=>{"ArrowLeft"===e.key?(e.preventDefault(),s(e=>u(e,-16))):"ArrowRight"===e.key?(e.preventDefault(),s(e=>u(e,16))):"Home"===e.key&&(e.preventDefault(),s(a))},[s,u,a]);return y(()=>()=>document.body.classList.remove(R),[]),/* @__PURE__ */p("div",{className:`es-resizer es-resizer--${e}`,role:"separator",tabIndex:0,"aria-orientation":"vertical","aria-label":o,"aria-valuenow":t,"aria-valuemin":i,"aria-valuemax":r,title:l.resize,onPointerDown:h,onPointerMove:v,onPointerUp:m,onPointerCancel:m,onLostPointerCapture:m,onDoubleClick:()=>s(a),onKeyDown:f,children:/* @__PURE__ */p("span",{className:"es-resizer-bar","aria-hidden":"true"})})}function F({icon:e,name:n,kind:t,actions:i}){/* @__PURE__ */
10
+ return v("div",{className:"es-insp-head",children:[
11
+ /* @__PURE__ */p("span",{className:"es-insp-chip","aria-hidden":"true",children:e}),
12
+ /* @__PURE__ */v("div",{className:"es-insp-titles",children:[
13
+ /* @__PURE__ */p("h2",{className:"es-insp-name",children:n}),
14
+ /* @__PURE__ */p("div",{className:"es-insp-kind",children:t})]}),i?/* @__PURE__ */p("div",{className:"es-insp-actions",children:i}):null]})}function T({label:e,title:n,hasPopup:t,onClick:i,disabled:r,danger:a,expanded:o,buttonRef:s,children:l}){/* @__PURE__ */
15
+ return p("button",{ref:s,type:"button",className:a?"es-insp-iconbtn es-insp-iconbtn--danger":"es-insp-iconbtn",title:n??e,"aria-label":e,"aria-haspopup":t,"aria-expanded":o,disabled:r,onClick:i,children:l})}function j({name:e,onSelect:t,label:i,inline:r}){const a=c("chrome",n),o=i??a.upLevel,s=/* @__PURE__ */v("button",{type:"button",className:"es-insp-up-btn",title:o,"aria-label":a.upLevelTo({label:o,name:e}),onClick:t,children:[
16
+ /* @__PURE__ */p("span",{className:"es-insp-up-arrow","aria-hidden":"true",children:"←"}),
17
+ /* @__PURE__ */p("span",{className:"es-insp-up-name",children:e})]});return r?s:/* @__PURE__ */p("div",{className:"es-insp-up",children:s})}function W({context:e,pick:t,onCancel:i,onHide:r,side:a="left"}){const o=c("chrome",n),s=r?/* @__PURE__ */p(T,{label:o.hidePanelLabel({side:a}),title:o.hidePanel,onClick:r,children:/* @__PURE__ */p("left"===a?d:u,{size:16})}):null;if(!t)/* @__PURE__ */
18
+ return p(F,{icon:/* @__PURE__ */p(m,{}),name:o.mediaLibrary,kind:e,actions:s??void 0});const l=o.mediaKinds[t.kind];/* @__PURE__ */
19
+ return p(F,{icon:/* @__PURE__ */p(h,{size:15}),name:o.mediaChoose({kind:l}),kind:t.field?o.mediaFor({field:t.field}):e,actions:/* @__PURE__ */v(f,{children:[
20
+ /* @__PURE__ */p("button",{type:"button",className:"es-btn-ghost es-insp-textbtn",title:o.mediaKeep({kind:l}),onClick:i,children:o.mediaCancel}),s?/* @__PURE__ */v(f,{children:[
21
+ /* @__PURE__ */p("span",{className:"es-insp-divider","aria-hidden":"true"}),s]}):null]})})}function A(e){return/svg/i.test(e)?"svg":e.startsWith("video")?"video":"image"}var D={notice:e,lock:a};function q(e,n,a,o=D){const s=o.notice,l=t(e),c={kind:"reload",label:s.reload};if(n){const e=i(n.secondsAgo,o.lock);return{tone:"warning",urgent:!0,lead:n.savedByYou?s.savedByYou({noun:a,when:e}):s.savedByOther({name:r(n.savedBy,o.lock),noun:a,when:e}),body:s.conflictBody,actions:l?[c,{kind:"take-over",label:s.takeOver,title:s.takeOverWhileDeciding}]:[c]}}if(!l)return null;const d=r(l.name,o.lock),u=i(l.secondsSinceSeen,o.lock);switch(e.kind){case"takenover":return{tone:"warning",urgent:!0,lead:s.tookOver({name:d,noun:a,when:i(l.secondsSinceHeld,o.lock)}),body:s.tookOverBody,actions:[{kind:"take-back",label:s.takeBack},c]};case"readonly":return{tone:"neutral",urgent:!1,lead:s.viewingOnly,body:s.viewingOnlyBody({name:d,noun:a,seen:u}),actions:[{kind:"take-over",label:s.takeOver}]};default:return{tone:"warning",urgent:!1,lead:s.editing({name:d,noun:a}),body:s.editingBody({seen:u}),actions:[{kind:"view-read-only",label:s.viewReadOnly},{kind:"take-over",label:s.takeOver,title:s.takeOverTold}]}}}function H({access:n,conflict:t,noun:i,onTakeOver:r,onViewReadOnly:o,onReload:s}){const l=q(n,t,i,{notice:c("notice",e),lock:c("lock",a)});if(!l)return null;const d={reload:s,"take-over":r,"take-back":r,"view-read-only":o};/* @__PURE__ */
22
+ return v("div",{className:`es-notice is-${l.tone}`,role:l.urgent?"alert":"status",children:[
23
+ /* @__PURE__ */v("span",{className:"es-notice-text",children:[
24
+ /* @__PURE__ */p("strong",{children:l.lead})," ",l.body]}),
25
+ /* @__PURE__ */p("span",{className:"es-notice-actions",children:l.actions.map(e=>/* @__PURE__ */p("button",{type:"button",className:"es-notice-btn",title:e.title,onClick:d[e.kind],children:e.label},e.kind))})]})}var I={left:288,right:320},J=220,Y=560;function G(e){return Math.min(560,Math.max(220,Math.round(e)))}function K(e){return{"--es-left-w":`${e.left}px`,"--es-right-w":`${e.right}px`}}function V(e,n){e.style.setProperty("--es-left-w",`${n.left}px`),e.style.setProperty("--es-right-w",`${n.right}px`)}export{I as DEFAULT_PANEL_W,S as DeviceSwitch,L as EaselIconButton,N as EaselTopBar,H as EditNotice,F as InspectorHead,T as InspectorIconButton,j as InspectorUpLevel,Y as MAX_PANEL_W,J as MIN_PANEL_W,W as MediaPanelHead,z as PanelResizeHandle,$ as SaveState,M as SaveStateToggle,C as TopBarCluster,x as TopBarDivider,O as TopBarRail,G as clampPanelWidth,q as editNotice,A as mediaPickKind,K as panelWidthVars,V as setPanelWidthVars};
@@ -0,0 +1 @@
1
+ import{hasMediaPanel as e,requestPanelPick as t}from"./chunk-ZZ7VLIHQ.js";var n=/* @__PURE__ */new Map,r=0;function i(i,o){if(!i.connected)return Promise.resolve(null);const c=(r+=1,`mp-${"undefined"!=typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():String(r)}`);return e()?t({requestId:c,accept:o.accept,title:o.title,file:o.file??null}):new Promise(e=>{n.set(c,e),i.send("storefront-editor:open-media-picker",{requestId:c,accept:o.accept,title:o.title,...o.file?{file:o.file}:{}})})}function o(e,t){const r=n.get(e);r&&(n.delete(e),r(t))}export{i as requestMediaPick,o as resolveMediaPick};
@@ -0,0 +1 @@
1
+ import{activateEaselSession as r,deactivateEaselSession as n,currentEaselSession as e}from"./chunk-AJBJ74ME.js";import{createContext as o,useEffect as t,useContext as i}from"react";import{jsx as u}from"react/jsx-runtime";var c=o(null);function m({session:e,children:o}){return r(e),t(()=>(r(e),()=>n(e)),[e]),/* @__PURE__ */u(c.Provider,{value:e,children:o})}function f(){return i(c)??e()}export{m as EaselSessionProvider,f as useEaselSession};
@@ -0,0 +1 @@
1
+ import{DEFAULT_TEXT_STYLES_WORDS as o}from"./chunk-M6F6LS3H.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as r}from"./chunk-6WY6ZXJG.js";import{DEFAULT_SCREEN_WORDS as t}from"./chunk-ZWK3CBRU.js";import{DEFAULT_CANVAS_WORDS as m}from"./chunk-AELNNAFM.js";import{DEFAULT_TREE_WORDS as n}from"./chunk-3EDSDPIP.js";import{DEFAULT_PANEL_WORDS as c}from"./chunk-QTLAVDJE.js";import{DEFAULT_NODE_MENU_WORDS as s}from"./chunk-WK3AFPXY.js";import{DEFAULT_SAVE_WORDS as f}from"./chunk-H6DDIBQ4.js";import{DEFAULT_CHROME_WORDS as p,DEFAULT_NOTICE_WORDS as e}from"./chunk-ZJEBF4NB.js";import{DEFAULT_LOCK_WORDS as i}from"./chunk-RE4LP46F.js";import{DEFAULT_RAIL_WORDS as u}from"./chunk-2OAZYSWJ.js";import{DEFAULT_COPY_WORDS as k}from"./chunk-UH7IGZKF.js";import{DEFAULT_PICK_WORDS as j}from"./chunk-ZAOM6PFH.js";import{DEFAULT_FIELDS_WORDS as h}from"./chunk-FPOKPNO4.js";import{DEFAULT_DRAG_WORDS as l}from"./chunk-O2NLQBFX.js";var F={notice:e,lock:i,save:f,chrome:p,rail:u,tree:n,panel:c,fields:h,pick:j,drag:l,menu:s,styleClipboard:r,copy:k,canvas:m,textStyles:o,screen:t},a=o=>"object"==typeof o&&null!==o;function y(o,r){const t={};for(const m of Object.keys(o)){const n=o[m],c=r[m];null==c?t[m]=n:a(n)?t[m]=a(c)?y(n,c):n:t[m]=typeof c==typeof n?c:n}return t}function P(o,r){return r?y(o,r):o}export{F as DEFAULT_EASEL_STRINGS,P as mergeEaselStrings};
@@ -0,0 +1 @@
1
+ function t(t){return t&&"object"==typeof t?{text:t.text??"",hidden:!!t.hidden}:{text:"string"==typeof t?t:"",hidden:!1}}function e(e){return t(e).text}export{e as hidableText,t as readHidable};
@@ -0,0 +1,2 @@
1
+ import{jsx as n}from"react/jsx-runtime";var r="data-sf-no-control";function t(){/* @__PURE__ */
2
+ return n("span",{[r]:"",hidden:!0})}var o="__noControl";function u(n){const r=n?.[o];return r??null}function e(n,r){return{...n,[o]:r}}export{r as NO_CONTROL_ATTR,o as NO_CONTROL_FIELD,t as NoControlMark,e as noControlField,u as noControlMetaOf};
@@ -0,0 +1 @@
1
+ import{resolveMediaPick as e}from"./chunk-6FY3PZS3.js";function t(t){const r=t;switch(r?.type){case"storefront-editor:media-picked":{const r=t;return r.requestId&&e(r.requestId,r.media??null),!0}case"storefront-editor:media-pick-cancelled":{const r=t;return r.requestId&&e(r.requestId,null),!0}default:return!1}}export{t as routeSharedHostMessage};
@@ -0,0 +1 @@
1
+ import{isBackendError as e,readHostFailure as s,STATUS_UNREACHABLE as t,hostUnreachableMessage as n,hostLoadRefusalOf as a}from"./chunk-KDYIMJTZ.js";var i={unauthorized:"the editor's sign-in was refused (unauthorized).","changed-elsewhere":"the page changed while it was being opened (changed-elsewhere).","lock-taken":"somebody else holds this page (lock-taken).","not-found":"this page no longer exists (not-found).",invalid:"the backend refused the request (invalid).",unavailable:"the backend could not be reached (unavailable)."};function o(a){if(e(a))return s(a.cause)?o(a.cause):`${i[a.kind]} ${a.message}`.trim();const r=s(a);return r?r.status===t?`${n()} (no response)`:401===r.status||403===r.status?`the editor's sign-in was refused (${r.status}). Reload the console and open the editor again; if it keeps happening the bridged token is not valid for this site.`:404===r.status?"this page no longer exists (404).":r.status>=500?`the server failed (${r.status}). ${r.message}`:`the server refused the request (${r.status}). ${r.message}`:a instanceof Error?`${a.name}: ${a.message}`:String(a)}function r(e,s){return a(e,s)}export{o as describeLoadFailure,r as hostLoadRefusal};
@@ -0,0 +1 @@
1
+ var e=/* @__PURE__ */Symbol.for("efficient-web.efficient-backend");function n(n){return!!n&&!0===n[e]}function t(e){return e?.trim()||null}var r=null,o=/* @__PURE__ */new WeakMap;function i(e){r=e}function u(e=k()){if(e.hostBackend)return e.hostBackend;let n=o.get(e);if(!n){if(!r)throw new Error("efficient-web-builder: this editor was given no backend, and its host named no default one. Pass `backend`, or load the host's default backend first (the storefront's is lib/efficient-backend).");n=r(e),o.set(e,n)}return n}function d(e){if(!e.registry)throw new Error("efficient-web-builder: this editor was mounted with no block registry. Pass `registry` to createEditorSession (the storefront's is lib/puck/config).");return e.registry}function s(e={}){const t=e.backend??null,r=/* @__PURE__ */new Map,o={documentId:null,bridgedId:null};return{hostBackend:t,usesBridgedToken:null===t||n(t),blocks:e.blocks??null,registry:e.registry??null,chrome:e.chrome??null,documentHooks:e.documentHooks??null,auth:{token:null,brandId:null},site:o,siteId:()=>o.documentId??o.bridgedId,cache:(e,n)=>(r.has(e)||r.set(e,n()),r.get(e)),forget(e){void 0===e?r.clear():r.delete(e)}}}function c(e,n){e.site.documentId=t(n)}function l(e,n){e.site.bridgedId=t(n)}var f=s(),a=null,b=/* @__PURE__ */new Set;function k(){return a??f}function h(e){b.delete(e),a=e}function g(e){b.add(e),queueMicrotask(()=>{b.delete(e)&&a===e&&(a=null)})}function w(){return k().usesBridgedToken}function m(){f=s()}export{e as EFFICIENT_BACKEND,h as activateEaselSession,u as backendOf,s as createEaselSession,k as currentEaselSession,g as deactivateEaselSession,w as efficientClientOpen,n as isEfficientBackend,i as provideDefaultBackend,m as resetAmbientEaselSession,d as sessionRegistry,l as setSessionBridgedSite,c as setSessionDocumentSite};
@@ -0,0 +1 @@
1
+ import{newNodeId as t}from"./chunk-FUDHI5I4.js";function o(t){return{root:{props:{}},content:[t],zones:{}}}function n(t){return(t.content??[])[0]??null}function r(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){const n={...o.props,id:t(o.type)};for(const[t,o]of Object.entries(n))r(o)&&(n[t]=o.map(e));return{type:o.type,props:n}}export{e as cloneNodeWithFreshIds,n as docToNode,o as nodeToDoc};
@@ -0,0 +1 @@
1
+ import{PAGE_CONFLICT_CODE as r,readEaselFailure as o}from"./chunk-HMX55DYT.js";import{createEditLock as c}from"./chunk-JUQ6YJCG.js";var e=c({readFailure:o,conflictCode:r});export{e as pageEditLock};
@@ -0,0 +1 @@
1
+ import{saveIndicator as e}from"./chunk-H6DDIBQ4.js";import{useRef as n,useEffect as t,useState as u,useSyncExternalStore as r,useMemo as l}from"react";var o=1e3,s=3e3,i=5e3,a=[2e3,5e3,15e3,3e4];function c(e,n=a){const t=n.length-1;return n[Number.isFinite(e)?Math.min(Math.max(Math.trunc(e),0),t):t]}var d={now:()=>Date.now(),setTimeout:(e,n)=>globalThis.setTimeout(e,n),clearTimeout:e=>globalThis.clearTimeout(e)};function f(e={}){const n=e.clock??d,t=e.debounceMs??1e3,u=e.maxWaitMs??3e3,r=e.unsavedAfterMs??5e3,l=e.retryDelays??a;let o=e.save??(()=>Promise.reject(new Error("autosave used before setSave"))),s=null,i=null,f=null,m=0,h=null,v=0,p=!1,w=!1,g=!1,b=!1,y=!1,T=!1,M=0,P=null,S=null;const E=/* @__PURE__ */new Set;let L=D();function D(){return{pending:null!==s,unsaved:T,failed:p,attempt:v,saved:w,paused:g,stopped:b}}function x(){if(y)return;const e=D();if(!Object.keys(e).every(n=>e[n]===L[n])){L=e;for(const e of[...E])e()}}function F(){null!==P&&n.clearTimeout(P),P=null}function N(e){F(),P=n.setTimeout(()=>{P=null,B()},e)}function j(){const e=n.now(),r=Math.min(m+t,(i??e)+u);N(Math.max(0,r-e))}function k(){if(null!==S&&n.clearTimeout(S),S=null,null===i)return void(T=!1);const e=i+r-n.now();T=e<=0,T||(S=n.setTimeout(()=>{S=null,T=!0,x()},e))}function B(){if(h)return h;if(y||b||!s)return Promise.resolve(null===s);F();const t=s,u=M;return f=null,h=Promise.resolve().then(()=>o(t.value)).then(()=>(u!==M||(h=null,w=!0,p=!1,v=0,s===t?(s=null,i=null):i=f??n.now(),f=null,k(),!s||g||b||y||j(),x()),!0),n=>{if(u!==M)return!1;if(h=null,f=null,b||y)return x(),!1;p=!0;const t=v;return v=t+1,e.onFailure?.(n,t),g||N(c(t,l)),x(),!1}),h}async function A(){for(;;){if(y||b)return null===s;if(!h&&!s)return!0;if(!await(h??B()))return!1}}return{setSave(e){o=e},push(e){if(y)return;const t=n.now();s={value:e},m=t,h&&null===f&&(f=t),null===i&&(i=t,k()),g||b||h||p||j(),x()},flush:A,retryNow:()=>(v=0,A()),pause(){y||g||(g=!0,F(),x())},resume:()=>y?Promise.resolve(null===s):(g=!1,x(),A()),stop(){y||(b=!0,F(),x())},reset(){y||(M++,h=null,F(),s=null,i=null,f=null,v=0,p=!1,w=!1,b=!1,k(),x())},hasPending:()=>null!==s,getSnapshot:()=>L,subscribe:e=>(E.add(e),()=>{E.delete(e)}),dispose(){F(),null!==S&&n.clearTimeout(S),S=null,y=!0}}}function m(e,n={document:document,window:window}){const t=n.document,u=n.window,r=()=>{"hidden"===t.visibilityState&&e()},l=()=>e();return t.addEventListener("visibilitychange",r),u.addEventListener("pagehide",l),()=>{t.removeEventListener("visibilitychange",r),u.removeEventListener("pagehide",l)}}function h(e){const n=e.getSnapshot();n.paused||n.stopped||e.flush()}function v(o){const s=n(o);t(()=>{s.current=o});const[i]=u(()=>f({...o,save:e=>s.current.save(e),onFailure:(e,n)=>s.current.onFailure?.(e,n)})),a=r(i.subscribe,i.getSnapshot,i.getSnapshot);t(()=>m(()=>h(i)),[i]);const c=o.warnBeforeUnload??!0;return t(()=>{if(!c)return;const e=e=>{i.hasPending()&&(e.preventDefault(),e.returnValue="")};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[i,c]),t(()=>()=>h(i),[i]),l(()=>({state:a,indicator:e(a),push:i.push,flush:i.flush,retryNow:i.retryNow,pause:i.pause,resume:i.resume,stop:i.stop,reset:i.reset,hasPending:i.hasPending}),[i,a])}export{o as AUTOSAVE_DEBOUNCE_MS,s as AUTOSAVE_MAX_WAIT_MS,a as AUTOSAVE_RETRY_DELAYS_MS,i as AUTOSAVE_UNSAVED_AFTER_MS,c as autosaveRetryDelay,f as createAutosave,m as installTabAwayFlush,v as useAutosave};
@@ -0,0 +1 @@
1
+ import{createContext as r,useContext as o}from"react";var t=r("desktop"),e=()=>o(t);export{t as PreviewDeviceContext,e as usePreviewDevice};
@@ -0,0 +1,22 @@
1
+ import{FieldSelect as e}from"./chunk-EOJNJCMJ.js";import{TreeSeam as n}from"./chunk-ZFDCDJNZ.js";import{SettingsField as l,SETTINGS_BUCKETS as t,SettingsTabs as a,SettingsGroup as r}from"./chunk-ZNS7727Y.js";import{DEFAULT_TREE_WORDS as i}from"./chunk-3EDSDPIP.js";import{DEFAULT_PANEL_WORDS as o}from"./chunk-QTLAVDJE.js";import{EaselContextMenu as s}from"./chunk-KTVH2ZRL.js";import{FieldNumber as c}from"./chunk-EWVJSRRY.js";import{SettingsSegmented as u}from"./chunk-P6O363EE.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{ChevronIcon as b,LockIcon as f,MoveUpIcon as v,MoveDownIcon as g,DuplicateIcon as y,TrashIcon as x}from"./chunk-L5KW4HG5.js";import{useRef as k,useState as N,useLayoutEffect as O,useId as w}from"react";import{jsx as C,jsxs as I}from"react/jsx-runtime";function S({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__ */C("textarea",{id:e,className:"es-fin es-fin--area",value:c,rows:r,placeholder:t,readOnly:i,"aria-label":o,"aria-labelledby":s,onChange:e=>l(e.target.value)}):/* @__PURE__ */C("input",{id:e,type:"text",className:"es-fin",value:c,placeholder:t,readOnly:i,"aria-label":o,"aria-labelledby":s,onChange:e=>l(e.target.value)})}function D(e,n,l){const t=e.slice();return t.splice(Math.max(0,Math.min(n,t.length)),0,l),t}function j(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 $(e,n){return e.filter((e,l)=>l!==n)}function L(e){return null===e||"object"!=typeof e?e:JSON.parse(JSON.stringify(e))}var F='input, textarea, select, button, [contenteditable]:not([contenteditable="false"]), [tabindex]',P={parentId:"list",slot:"items"};function E({label:e,icon:l,noun:t,items:a,onChange:r,newItem:o,summary:c,itemName:u,thumb:w,min:S=0,max:E,readOnly:A=!1,open:M,onOpen:R,renderItem:T,renderRow:J,canRemove:z,lockedReason:H,fixed:K=!1,removeOnRow:B=!0,canDuplicate:V,above:W,head:Y=!0}){const Z=m("fields",d).list,q=m("tree",i),G=t??Z.item,U=!A&&!K&&("number"!=typeof E||a.length<E),Q=a.length<=S,X=e=>!!z&&!z(a[e],e),_=e=>!A&&!K&&B&&!Q&&!X(e),ee=e=>U&&(!V||V(a[e],e)),ne=(e,n)=>u?u(e,n):Z.itemName({noun:G,n:n+1}),le=k([]),te=k(null),[ae,re]=N(null),ie=k(null),[oe,se]=N(null),[ce,ue]=N("");O(()=>{for(const e of le.current){if(!e)continue;null!==e.querySelector(F)||A?e.removeAttribute("tabindex"):e.tabIndex=0}}),O(()=>{const e=te.current;if(!e)return;te.current=null;const n=le.current[e.index]?.querySelectorAll(F)[e.nth]??le.current[e.index];if(n?.focus(),n&&null!==e.start&&"setSelectionRange"in n)try{n.setSelectionRange(e.start,e.end)}catch{}});const de=(e,n)=>{if(n<0||n>=a.length||n===e)return;const l=le.current[e],t=l?.ownerDocument.activeElement;if(l&&t&&l.contains(t)){const e=[...l.querySelectorAll(F)].indexOf(t),a=t;te.current={index:n,nth:e,start:"number"==typeof a.selectionStart?a.selectionStart:null,end:"number"==typeof a.selectionEnd?a.selectionEnd:null}}r(j(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}(M,e,n);i!==M&&R(i),ue(Z.moved({n:n+1,total:a.length}))},me=e=>{U&&(r(D(a,e,o())),J?(te.current={index:e,nth:0,start:null,end:null},null!==M&&M>=e&&R(M+1)):R(e))},pe=e=>{_(e)&&(r($(a,e)),M===e?R(null):null!==M&&M>e&&R(M-1))},he=p({keyOf:e=>String(e),canDrop:(e,n)=>n.parentId===P.parentId&&n.slot===P.slot,onDrop:(e,n)=>{const l=h({...P,index:e},n);l!==e&&de(e,l)},onStep:(e,n)=>de(e,e+n),canStep:(e,n)=>e+n>=0&&e+n<a.length,readOnly:A}),be=e=>{const n=[];return e>0&&n.push({label:Z.moveUp,icon:/* @__PURE__ */C(v,{size:14}),shortcut:"⌥↑",onClick:()=>de(e,e-1)}),e<a.length-1&&n.push({label:Z.moveDown,icon:/* @__PURE__ */C(g,{size:14}),shortcut:"⌥↓",onClick:()=>de(e,e+1)}),ee(e)&&n.push({label:Z.duplicate,icon:/* @__PURE__ */C(y,{size:14}),onClick:()=>(e=>{ee(e)&&(r(D(a,e+1,L(a[e]))),null!==M&&M>e&&R(M+1))})(e)}),_(e)&&n.push({label:Z.delete,icon:/* @__PURE__ */C(x,{size:14}),danger:!0,onClick:()=>pe(e)}),n},fe=(e,n,l)=>{A||0===be(e).length||se({index:e,x:n,y:l})},ve=e=>n=>{const l=a.slice();l[e]=n,r(l)};/* @__PURE__ */
2
+ return I("div",{className:"es-list",children:[Y?/* @__PURE__ */I("div",{className:"es-list-head",children:[
3
+ /* @__PURE__ */I("span",{className:"es-list-label",children:[l?/* @__PURE__ */C("span",{className:"es-field-icon","aria-hidden":"true",children:l}):null,e]}),
4
+ /* @__PURE__ */C("span",{className:"es-list-count",children:a.length})]}):null,W?/* @__PURE__ */C("div",{className:"es-list-above",children:W}):null,a.length?/* @__PURE__ */I("div",{className:"es-list-rows",...he.rootProps(),children:[a.map((e,l)=>{const t=he.row({item:l,place:{...P,index:l}}),a=t.draggable&&ae!==l,r=!J&&M===l,i=!A&&!K&&B&&X(l),o=["es-list-row",J?"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 I("div",{className:"es-list-entry",children:[l>0?/* @__PURE__ */C(n,{...he.seam({place:{...P,index:l}}),onAdd:U?()=>me(l):void 0,label:Z.addHere({noun:G})}):null,
6
+ /* @__PURE__ */I("div",{...t.rowProps,ref:e=>{le.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,ie.current=n&&!a?n:null,re(a?l:null)},onDragStart:e=>{const n=ie.current;ie.current=null,n&&n.ownerDocument.activeElement===n&&n.blur(),t.rowProps.onDragStart?.(e)},onContextMenu:e=>{A||(e.preventDefault(),e.stopPropagation(),fe(l,e.clientX,e.clientY))},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 fe(l,a.left+24,a.bottom)}t.rowProps.onKeyDown?.(e)},children:[a?/* @__PURE__ */C("span",{className:"es-list-hint","aria-hidden":"true",children:q.dragHint}):null,J?/* @__PURE__ */C("div",{className:"es-list-row-main",children:J(e,l,ve(l))}):/* @__PURE__ */I("button",{type:"button",className:"es-list-open","aria-expanded":r,onClick:()=>R(r?null:l),children:[w?/* @__PURE__ */C("span",{className:"es-list-thumb","aria-hidden":"true",children:w(e,l)}):null,
7
+ /* @__PURE__ */C("span",{className:"es-list-row-name",children:ne(e,l)}),/* @__PURE__ */C("span",c?{className:"es-list-row-summary",children:c(e,l)}:{className:"es-list-row-summary"}),
8
+ /* @__PURE__ */C(b,{size:14,className:"es-list-chev","aria-hidden":"true"})]}),A||K||!B?null:i?/* @__PURE__ */C("span",{className:"es-list-lock",role:"img","aria-label":H?H(e,l):Z.locked,title:H?H(e,l):Z.locked,children:/* @__PURE__ */C(f,{size:13})}):/* @__PURE__ */C("button",{type:"button",className:"es-list-x","aria-label":Z.deleteItem({noun:G}),title:Z.deleteItem({noun:G}),disabled:!_(l),onClick:()=>pe(l),children:"×"})]}),r?/* @__PURE__ */C("div",{className:"es-list-item",children:T(e,l,ve(l))}):null]},l)}),
9
+ /* @__PURE__ */C(n,{...he.seam({place:{...P,index:a.length}})})]}):null,A||K?null:/* @__PURE__ */C("button",{type:"button",className:"es-list-add",disabled:!U,onClick:()=>me(a.length),children:Z.add({noun:G})}),
10
+ /* @__PURE__ */C("span",{className:"es-list-said","aria-live":"polite",children:ce}),oe&&oe.index<a.length?/* @__PURE__ */C(s,{x:oe.x,y:oe.y,items:be(oe.index),onClose:()=>se(null)}):null]})}var A=(e,n)=>"string"==typeof e.label&&e.label?e.label:n;function M({field:e,name:n,id:l,value:t,onChange:a,readOnly:i,context:o,renderers:s}){const[c,u]=N(!0),d=t&&"object"==typeof t?t:{};/* @__PURE__ */
11
+ return C(r,{id:`${l}-group`,title:A(e,n),open:c,onToggle:u,children:Object.entries(e.objectFields).map(([e,t])=>/* @__PURE__ */C(T,{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 R({field:e,name:n,id:l,value:t,onChange:a,readOnly:r,context:i,renderers:o,openItem:s,onOpenItem:c}){const[u,d]=N(null),m=c?s??null:u,p=c??d,h=Array.isArray(t)?t:[],b=e.getItemSummary;/* @__PURE__ */
12
+ return C(E,{label:A(e,n),icon:e.icon,noun:"string"==typeof e.noun?e.noun:void 0,items:h,onChange:a,newItem:()=>L({...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__ */C(T,{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 T(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__ */
13
+ return C(l,{label:A(t,a),htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */C(S,{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__ */
14
+ return C(l,{label:A(t,a),htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */C(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__ */
15
+ return C(l,{label:A(t,a),labelId:n,htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */C(e,{id:r,value:i,options:t.options,onChange:o,readOnly:s,ariaLabelledBy:n})})}case"radio":/* @__PURE__ */
16
+ return C(l,{label:A(t,a),icon:t.icon,hint:t.hint,children:/* @__PURE__ */C(u,{ariaLabel:A(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__ */
17
+ return C(M,{...n,field:t});case"array":/* @__PURE__ */
18
+ return C(R,{...n,field:t});case"slot":return null}}var J=e=>t.includes(e);function z(e){let n=t[0];const l=[],a=/* @__PURE__ */new Set;for(const[t,r]of Object.entries(e))r&&(J(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 H(e){return new Map(z(e).rows.map(e=>[e.name,e.bucket]))}function K({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),v=w(),g=p??`es-insp${v.replace(/:/g,"")}`,y=z(e),[x,k]=N(void 0),O=i??x,S=O&&y.buckets.includes(O)?O:y.buckets[0],[D,j]=N(null),$=D&&D.panel===g&&y.rows.some(e=>e.name===D.name)?D:null,L=c&&y.buckets.length>1,F=`${g}-rows`,P=e=>`${g}-tab-${e.toLowerCase()}`;/* @__PURE__ */
19
+ return I("div",{className:"es-insp",children:[L?/* @__PURE__ */C("div",{className:"es-insp-tabs",children:/* @__PURE__ */C(a,{ariaLabel:h??f.settings,activeId:S,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],htmlId:P(e),panelId:F}))})}):null,
20
+ /* @__PURE__ */I("div",{className:"es-insp-rows",id:F,role:L?"tabpanel":void 0,"aria-labelledby":L&&S?P(S):void 0,children:[y.rows.map(({name:e,field:a,bucket:i})=>/* @__PURE__ */C("div",{className:"es-insp-row","data-field":e,"data-bucket":i,hidden:!(!L||i===S)||void 0,children:/* @__PURE__ */C(T,{field:a,name:e,id:`${g}-${e}`,value:n[e],onChange:n=>l(e,n),readOnly:t,context:r,renderers:d,openItem:$&&$.name===e?$.index:null,onOpenItem:n=>j(null===n?null:{panel:g,name:e,index:n})})},e)),b]})]})}function B(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}function V({value:n,onChange:l,kinds:t,rules:a,filtersFor:r,label:i,readOnly:o}){const s=m("fields",d).link??d.link,[c,u]=N(null),[p,h]=N(null),b=c??a.kindOf(n),f=t.filter(e=>!e.hideWhenEmpty||B(e.target).length>0||e.value===b),v=f.find(e=>"text"===e.target.type),g=f.find(e=>e.value===b)??v??f[0];if(!g)return null;const y="text"!==g.target.type,x=y?a.targetOf(n):n,k=B(g.target),O=k.find(e=>e.value===x),w=e=>({value:e,label:s.unavailable({value:e})}),S="select"===g.target.type&&x&&r?r(x):null,D=S?a.readFilter(n):null,j=D?S?.find(e=>e.param===D.param):void 0,$=p&&p.against===n?p.text:n,L=!y&&""!==$.trim()&&!a.isSafe($),F=e=>{if(!e)return l("");const n=k.find(n=>n.value===e);l(e,n?.label)},P=(e,n)=>n&&!e.some(e=>e.value===n)?[w(n),...e]:[...e];let E;if("text"===g.target.type)E=/* @__PURE__ */C("input",{type:"text",className:"es-fin","aria-label":s.address,"aria-invalid":L||void 0,placeholder:s.addressPlaceholder,value:$,readOnly:o,onChange:e=>(e=>{const t=e.trim();t?a.isSafe(e)?(h({text:e,against:t}),l(t)):h({text:e,against:n}):(h({text:e,against:""}),l(""))})(e.target.value)});else{const n="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}));E=/* @__PURE__ */C(e,{ariaLabel:g.label,value:x,options:[{value:"",label:g.target.placeholder},...P(n,x)],searchable:n.length>10,readOnly:o,onChange:F})}/* @__PURE__ */
21
+ return I("div",{className:"es-flink",role:i?"group":void 0,"aria-label":i,children:[
22
+ /* @__PURE__ */C(e,{ariaLabel:s.linkType,value:g.value,options:f.map(e=>({value:e.value,label:e.label})),readOnly:o,onChange:e=>{u(e),h(null);const n=f.find(n=>n.value===e);if(!n||"text"===n.target.type)return;const t=B(n.target)[0];t?l(t.value,t.label):l("")}}),E,S&&/* @__PURE__ */C(e,{ariaLabel:s.filter,value:D?.param??"",options:[{value:"",label:s.noFilter},...D&&!j?[w(D.param)]:[],...S.map(e=>({value:e.param,label:e.label}))],readOnly:o,onChange:e=>{if(!e)return l(x,O?.label);const n=S?.find(n=>n.param===e),t=n?.values[0];t&&l(a.withFilter(x,{param:e,value:t.value}),t.label)}}),S&&D&&/* @__PURE__ */C(e,{ariaLabel:s.value,value:D.value,options:P((j?.values??[]).map(e=>({value:e.value,label:e.label})),D.value),searchable:(j?.values.length??0)>10,readOnly:o,onChange:e=>{if(!D)return;const n=j?.values.find(n=>n.value===e);l(a.withFilter(x,{param:D.param,value:e}),n?.label)}}),L&&/* @__PURE__ */C("p",{className:"es-flink-error",role:"alert",children:s.unsafe}),g.hint&&/* @__PURE__ */C("p",{className:"es-flink-hint",children:g.hint}),S&&/* @__PURE__ */C("p",{className:"es-flink-hint",children:s.filterHint})]})}export{S as FieldText,K as Inspector,T as InspectorField,V as LinkPicker,E as ListField,H as bucketsOf,L as copyItem,D as insertAt,A as labelOf,j as moveTo,z as planFields,$ as removeAt};
@@ -0,0 +1 @@
1
+ var n="__text",t="__link",r="__scaffold",o="__media",_="__fold";function e(n){const t=n?.[_];return t??null}function c(t){if(!t||"object"!=typeof t)return!1;const r=t[n];return!0===r?.identifier}var f=["_gAnchor","anchor"];export{f as ANCHOR_FIELD_KEYS,_ as FOLD_FIELD_MARKER,t as LINK_FIELD_MARKER,o as MEDIA_FIELD_MARKER,r as SCAFFOLD_FIELD_MARKER,n as TEXT_FIELD_MARKER,e as foldMetaOf,c as textFieldIdentifier};
@@ -0,0 +1 @@
1
+ import{ROOT_ZONE as e}from"./chunk-FUDHI5I4.js";import{styleMenuItems as n}from"./chunk-57DJOKXT.js";import{EaselContextMenu as t}from"./chunk-KTVH2ZRL.js";import{createNodeClipboard as o,nodeMenuItems as l}from"./chunk-2LK54I4E.js";import{useCanvasEvent as i}from"./chunk-PAELDYYS.js";import{framePointToHost as c}from"./chunk-ZNCEOSXO.js";import{UndoIcon as s,RedoIcon as r,AddIcon as a,PasteIcon as d,SettingsIcon as p,LayersIcon as u,CopyIcon as f}from"./chunk-L5KW4HG5.js";import{zoneKey as h,ROOT_SLOT as m,ROOT_ID as k}from"./chunk-KRXQM65X.js";import{useState as y,useCallback as b}from"react";import{jsx as v}from"react/jsx-runtime";function x(n,t){const o=[],l=/* @__PURE__ */new Set;let i={zone:t.zone,index:t.index};for(;i;){const t=n.nodeAt(i.zone,i.index);if(!t||l.has(t.props.id))break;if(l.add(t.props.id),o.push({zone:i.zone,index:i.index,node:t,parentType:null}),i.zone===e)break;const c=i.zone.lastIndexOf(":");if(c<=0)break;i=n.locate(i.zone.slice(0,c))}for(let e=0;e<o.length-1;e+=1)o[e].parentType=o[e+1].node.type;return o}var C=o();function g(n,t,o){if(t===e){const{floor:e,cap:t}=n.sectionBand();return{parentId:k,slot:m,index:Math.min(Math.max(o,e),t)}}const l=t.lastIndexOf(":");return{parentId:t.slice(0,l),slot:t.slice(l+1),index:o}}function A(e,t){const{zone:o,index:i}=t,c=e.nodeAt(o,i);if(!c)return[];const s=c.props.id,r=e.labelOf(c.type,o),a=Boolean(c.props._hidden),d=e.nodeOps,p=e.isPinned(c,o),u=e.isLocked(c),f=!p&&!u&&!e.duplicateBlocked(c),m=x(e,t),k=d.held,y=k&&!p&&h(k.from)===o?g(e,o,i+1):null,b=e.style?n({held:e.style.held(),canCopy:e.style.canCopy(c,o),onCopy:()=>e.style?.copy(c,o),onPaste:()=>e.style?.paste(o,i,c)}):[];return l({title:r,layer:{group:"pick",items:m.map((n,t)=>({label:e.rowNameOf(n.node,n.zone),checked:0===t,onClick:()=>e.selectAt(n.zone,n.index,n.node.props.id,n.parentType)}))},actions:{addInside:e.canAddTo(c.type)?()=>e.openAddInside(o,i):void 0,duplicate:f?()=>d.duplicate(s):void 0,moveUp:d.canStep(s,-1)?()=>d.step(s,-1):void 0,moveDown:d.canStep(s,1)?()=>d.step(s,1):void 0,copy:p?void 0:()=>d.copy(s,r),cut:f?()=>d.cut(s,r):void 0,paste:k&&y?{label:k.label,run:()=>d.paste(y)}:void 0,rename:e.renamePropOf(c,o)?()=>e.beginRename(o,i):void 0,hide:u||p?void 0:{hidden:a,run:()=>d.setProps(s,{_hidden:!a})},delete:f?()=>d.remove(s):void 0},style:b,pinnedLine:p?"Pinned — can’t be moved or deleted":void 0})}function P(n){const t=[];n.history.hasPast&&t.push({label:"Undo",icon:/* @__PURE__ */v(s,{}),shortcut:"⌘Z",onClick:n.history.back}),n.history.hasFuture&&t.push({label:"Redo",icon:/* @__PURE__ */v(r,{}),shortcut:"⇧⌘Z",onClick:n.history.forward});const o=[{label:"Add section",icon:/* @__PURE__ */v(a,{}),onClick:n.openAddSection}],l=n.nodeOps.held;if(l&&h(l.from)===e){const t=g(n,e,n.sectionBand().cap);o.push({label:`Paste ${l.label}`,icon:/* @__PURE__ */v(d,{}),shortcut:"⌘V",onClick:()=>n.nodeOps.paste(t)})}const i=[t,o,[{label:"Page settings",icon:/* @__PURE__ */v(p,{}),onClick:n.openPageSettings},{label:"Collapse all layers",icon:/* @__PURE__ */v(u,{}),onClick:n.collapseAll}]].filter(e=>e.length>0),c={label:"—",onClick:()=>{}};return i.flatMap((e,n)=>n?[c,...e]:e)}function z(e,n){const t=n.selectionStart??0,o=n.selectionEnd??0,l=n.value.slice(t,o),i=e=>{n.focus(),n.setRangeText(e,t,o,"end"),n.dispatchEvent(new Event("input",{bubbles:!0}))},c=[];l&&(c.push({label:"Copy",icon:/* @__PURE__ */v(f,{}),shortcut:"⌘C",onClick:()=>navigator.clipboard?.writeText(l)}),c.push({label:"Cut",icon:/* @__PURE__ */v(f,{}),shortcut:"⌘X",onClick:()=>{navigator.clipboard?.writeText(l),i("")}})),c.push({label:"Paste",icon:/* @__PURE__ */v(d,{}),shortcut:"⌘V",onClick:()=>{navigator.clipboard?.readText().then(e=>{e&&i(e)}).catch(()=>e.onPasteRefused())}});const s=[c,n.value?[{label:"Select all",shortcut:"⌘A",onClick:()=>{n.focus(),n.select()}}]:[]].filter(e=>e.length>0),r={label:"—",onClick:()=>{}};return s.flatMap((e,n)=>n?[r,...e]:e)}function I(e){return e.shiftKey}function O(e,n){const[o,l]=y(null),s=b(()=>l(null),[]),r=b(n=>{if(I(n))return;const t=n.target,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});const i=t?.closest?.("[data-node-id]")?.getAttribute("data-node-id"),c=i?e.locate(i):null;n.preventDefault(),l(c?{kind:"node",x:n.clientX,y:n.clientY,...c}:{kind:"empty",x:n.clientX,y:n.clientY})},[e]);i(n,"contextmenu",t=>{if(I(t)||!n)return;const o=t.target?.closest?.("[data-puck-component]")??null,i=o?.getAttribute("data-puck-component"),s=i?e.locate(i):null;t.preventDefault();const r=c(n.frame,t.clientX,t.clientY);l(s?{kind:"node",...r,...s}:{kind:"empty",...r})}),i(n,"mousedown",s),i(n,"scroll",s,{on:"window"});return{onEditorContextMenu:r,menu:o?/* @__PURE__ */v(t,{x:o.x,y:o.y,items:"node"===o.kind?A(e,o):"input"===o.kind?z(e,o.el):P(e),onClose:s}):null,closeMenu:s}}export{C as EASEL_NODE_CLIPBOARD,x as ancestorChain,A as nodeMenuItems,P as pageMenuItems,z as textMenuItems,O as useNodeContextMenu};
@@ -0,0 +1 @@
1
+ function e(e,n,t){return!(!e||!n)&&(e.index===n.index&&(e.zone??t)===(n.zone??t))}function n(e=("undefined"==typeof document?void 0:document)){const n=e?.querySelector(".es-tree"),t=n?.querySelector(".es-tree-row.is-selected");return!!t&&(function(e,n){if("function"!=typeof e.getBoundingClientRect)return!1;if("function"!=typeof n.getBoundingClientRect)return!1;const t=e.getBoundingClientRect(),o=n.getBoundingClientRect();return!(!t.height||!o.height)&&o.top>=t.top&&o.bottom<=t.bottom}(n,t)||t.scrollIntoView({block:"center",inline:"nearest"}),!0)}function t(e,n){return"part"===e.kind?e.nodeId??null:"puck"!==e.kind||null==n?null:String(n)}export{t as markedTreeNodeId,n as revealSelectedTreeRow,e as sameSelector};
@@ -0,0 +1 @@
1
+ function n(n,t){const r=n.components?.[t]?.fields??{};return Object.keys(r).filter(n=>"slot"===r[n]?.type)}function t(t,r){return n(t,r.type).flatMap(n=>(Array.isArray(r.props[n])?r.props[n]:[]).map((t,e)=>({child:t,zone:`${r.props.id}:${n}`,index:e})))}function r(n,r,e){const o=(r,i,u,p)=>{if(!r||"object"!=typeof r||!r.props)return null;if(r.props.id===e)return{item:r,zone:i,index:u};if(p>=12)return null;for(const{child:e,zone:i,index:u}of t(n,r)){const n=o(e,i,u,p+1);if(n)return n}return null};for(let n=0;n<r.length;n+=1){const t=o(r[n],f,n,0);if(t)return t}return null}var e=6;function o(t,r,e){return e<6&&n(t,r).length>0}var i=n=>`${n}-${crypto.randomUUID()}`,u="Header",p="Footer",f="root:default-zone",s=[u,p];function c(n){const t=/* @__PURE__ */new Set,r=[];return n.forEach((n,e)=>{const o=n?.type;void 0!==o&&s.includes(o)&&(t.has(o)?r.push(e):t.add(o))}),r}function l(n){return c(n).map(t=>n[t]?.props?.id).filter(n=>"string"==typeof n)}function d(n,t){const r=(n,t)=>n.some(n=>n?.type===t);return s.filter(e=>!r(n,e)&&!r(t,e))}export{p as FOOTER_TYPE,u as HEADER_TYPE,f as ROOT_ZONE,e as TREE_MAX_DEPTH,t as childSlotsOf,r as locateNode,d as missingPinnedTypes,o as nestsInTree,i as newNodeId,l as pinnedDuplicateIds,c as pinnedDuplicateIndices,n as slotFieldsOf};
@@ -0,0 +1 @@
1
+ function e(e,n){const o=e.categories??{},c=e.components,r=[];for(const[s,i]of Object.entries(o))for(const o of i?.components??[]){const i=c[o];if(!i)continue;const a=i.label??o,l=n.labelAtLevel(o,"section",a);r.push({type:o,cat:s,catLabel:t(e,s,n.categoryLabel),name:l,desc:n.descriptions[o]??"",...l===a?{}:{alias:a}})}return r}function t(e,t,n){return n(t)??e.categories?.[t]?.title??t}function n(e,t){return!t||`${e.name} ${e.alias??""} ${e.desc} ${e.type} ${e.catLabel}`.toLowerCase().includes(t)}function o(e,t){return e.find(e=>e.type===t)??null}function c(e,t){return e.filter(e=>e.type!==t)}export{e as buildPaletteSections,t as categoryLabel,n as matchesQuery,c as paletteWithoutPinned,o as pinnedSection};
@@ -0,0 +1,2 @@
1
+ import{runAsPreviewClick as e}from"./chunk-R5L2E7JX.js";import{useRef as r,useCallback as t,createContext as n,useState as c,useContext as l}from"react";import{jsx as o}from"react/jsx-runtime";function s(){const n=r(()=>{});return{select:t((...r)=>e(()=>n.current(...r)),[]),setSelectHandler:t(e=>{n.current=e},[])}}function u(e){const r=`set${e.charAt(0).toUpperCase()}${e.slice(1)}`,t=(t,n,c,l)=>({[e]:t,[r]:n,select:c,setSelectHandler:l}),u=n(t(null,()=>{},()=>{},()=>{}));return{Provider:function({children:e}){const[r,n]=c(null),{select:l,setSelectHandler:i}=s();/* @__PURE__ */
2
+ return o(u.Provider,{value:t(r,n,l,i),children:e})},useSelection:()=>l(u)}}export{u as createPreviewSelectionContext,s as useSelectHandler};
@@ -0,0 +1 @@
1
+ import{useSectionOps as o}from"./chunk-VV5ADNBR.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-NBJ2YY6Y.js";import{useEasel as p}from"./chunk-P67FP7PG.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 P=s(m)?r(m.nodeId,m.propKey):null;c(()=>{f(P)},[P,f]);return{selectNode:d(o=>{i(()=>n);const e=u(o);e&&I.select(e)},[i,u,I]),openPartId:P}}export{m as usePartBridge};
@@ -0,0 +1 @@
1
+ import{useState as r,useEffect as t}from"react";import{jsx as n}from"react/jsx-runtime";function o(o){return function(e){const[u,c]=r(!1);return t(()=>c(!0),[]),u?/* @__PURE__ */n(o,{...e}):null}}export{o as clientOnly};
File without changes