efficient-easel 2.2.0 → 3.1.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 (101) hide show
  1. package/README.md +17 -4
  2. package/dist/chrome/index.d.ts +2 -2
  3. package/dist/chrome/index.js +1 -1
  4. package/dist/{chunk-2JIWFFXA.js → chunk-42TMLDSQ.js} +1 -1
  5. package/dist/{chunk-6OY2THZH.js → chunk-4LD4KA27.js} +1 -1
  6. package/dist/chunk-53NZMIRT.js +1 -0
  7. package/dist/chunk-5SOSVTVI.js +5 -0
  8. package/dist/{chunk-7SQF6LZL.js → chunk-66LWADFP.js} +1 -1
  9. package/dist/chunk-7HGVGKWU.js +64 -0
  10. package/dist/{chunk-VB5LRSGJ.js → chunk-BVUPKIM3.js} +1 -1
  11. package/dist/chunk-CRPJGCSO.js +20 -0
  12. package/dist/{chunk-35Q5HMJZ.js → chunk-EF3YSWT5.js} +1 -1
  13. package/dist/chunk-EJ6QAWRH.js +5 -0
  14. package/dist/chunk-FFYXVAAL.js +1 -0
  15. package/dist/{chunk-OXYGFK2B.js → chunk-GTDLBUOC.js} +6 -6
  16. package/dist/chunk-JVUGLF5I.js +7 -0
  17. package/dist/chunk-JZDEIRH4.js +1 -0
  18. package/dist/{chunk-UAVNI3BU.js → chunk-LHZIMK3M.js} +1 -1
  19. package/dist/chunk-LYALMY55.js +1 -0
  20. package/dist/{chunk-ZV6OYSZ7.js → chunk-MYC3AVG2.js} +1 -1
  21. package/dist/{chunk-FOBGSFFS.js → chunk-OZ72A6MY.js} +7 -7
  22. package/dist/{chunk-ZNNATBDC.js → chunk-QMBB7SU5.js} +1 -1
  23. package/dist/chunk-TCNPQKY6.js +4 -0
  24. package/dist/{chunk-AAT3O7PK.js → chunk-TGF7KEO7.js} +1 -1
  25. package/dist/chunk-UV4D7CDX.js +5 -0
  26. package/dist/{chunk-ONRYLR2D.js → chunk-VGV5D667.js} +2 -2
  27. package/dist/chunk-VX5GDBRI.js +2 -0
  28. package/dist/chunk-Y2G7CU6A.js +1 -0
  29. package/dist/copy/copy.css +79 -82
  30. package/dist/copy/index.d.ts +9 -7
  31. package/dist/copy/index.js +21 -31
  32. package/dist/fields/fields.css +0 -28
  33. package/dist/fields/index.d.ts +2 -2
  34. package/dist/fields/index.js +1 -1
  35. package/dist/panel/index.d.ts +4 -222
  36. package/dist/panel/index.js +12 -15
  37. package/dist/panel/panel.css +0 -165
  38. package/dist/screen/components/AddBlockRow.js +1 -1
  39. package/dist/screen/components/AddSidePanel.js +1 -1
  40. package/dist/screen/components/MediaSidePanel.d.ts +1 -1
  41. package/dist/screen/components/MediaSidePanel.js +1 -1
  42. package/dist/screen/components/NodeContextMenu.d.ts +16 -14
  43. package/dist/screen/components/NodeContextMenu.js +1 -1
  44. package/dist/screen/components/PageEditGuardNotices.js +1 -1
  45. package/dist/screen/components/ScreenChrome.js +1 -1
  46. package/dist/screen/components/ScreenDocumentContext.d.ts +1 -1
  47. package/dist/screen/components/ScreenDocumentContext.js +1 -1
  48. package/dist/screen/components/ScreenMount.d.ts +1 -1
  49. package/dist/screen/components/ScreenMount.js +1 -1
  50. package/dist/screen/components/ScreenStoreProvider.d.ts +1 -1
  51. package/dist/screen/components/ScreenStoreProvider.js +1 -1
  52. package/dist/screen/components/SectionScreenShell.js +16 -16
  53. package/dist/screen/components/SidePanelHead.js +1 -1
  54. package/dist/screen/components/UiIcon.js +1 -1
  55. package/dist/screen/components/panel-widths.js +1 -1
  56. package/dist/screen/components/usePartBridge.d.ts +1 -1
  57. package/dist/screen/components/usePartBridge.js +1 -1
  58. package/dist/screen/index.d.ts +1 -1
  59. package/dist/screen/index.js +1 -1
  60. package/dist/screen/lib/admin-bridge.d.ts +1 -1
  61. package/dist/screen/lib/document-addressing.d.ts +1 -1
  62. package/dist/screen/lib/host-chrome.d.ts +1 -1
  63. package/dist/screen/lib/host.d.ts +1 -1
  64. package/dist/screen/lib/links/link-filters.d.ts +1 -2
  65. package/dist/screen/lib/media-panel.d.ts +1 -1
  66. package/dist/screen/lib/media-picker.d.ts +1 -1
  67. package/dist/screen/lib/page-lock.d.ts +1 -1
  68. package/dist/screen/lib/puck/device-fields.js +1 -1
  69. package/dist/screen/lib/puck/style-clipboard.d.ts +8 -4
  70. package/dist/screen/lib/puck/style-clipboard.js +1 -1
  71. package/dist/screen/lib/puck/use-section-ops.js +1 -1
  72. package/dist/screen/lib/screen-parts.d.ts +1 -1
  73. package/dist/screen/lib/screen-parts.js +1 -1
  74. package/dist/screen/lib/section-templates.d.ts +1 -1
  75. package/dist/screen/lib/session-context.d.ts +1 -1
  76. package/dist/screen/lib/session.d.ts +1 -1
  77. package/dist/screen/words.d.ts +123 -1
  78. package/dist/screen/words.js +1 -1
  79. package/dist/strings/catalogue.d.ts +3 -3
  80. package/dist/strings/catalogue.js +1 -1
  81. package/dist/strings/index.d.ts +3 -3
  82. package/dist/strings/index.js +1 -1
  83. package/dist/text-styles/index.js +11 -11
  84. package/dist/{words-AHHfiaRY.d.ts → words-C1U_dLBh.d.ts} +7 -0
  85. package/dist/{words-XH0TvZPg.d.ts → words-lpvYzf5U.d.ts} +4 -19
  86. package/dist/{words-D8kf071T.d.ts → words-vhnV8sM7.d.ts} +4 -26
  87. package/package.json +3 -3
  88. package/dist/LinkPicker-hPEr1MJx.d.ts +0 -113
  89. package/dist/chunk-4TMMEBAG.js +0 -4
  90. package/dist/chunk-5TRBCPRB.js +0 -5
  91. package/dist/chunk-BSSKAEFF.js +0 -5
  92. package/dist/chunk-E2O2MRZR.js +0 -1
  93. package/dist/chunk-FPOKPNO4.js +0 -1
  94. package/dist/chunk-HGTPLCTQ.js +0 -1
  95. package/dist/chunk-PWZOS45R.js +0 -2
  96. package/dist/chunk-RC6DD4XP.js +0 -7
  97. package/dist/chunk-TSQUEJZB.js +0 -5
  98. package/dist/chunk-UEM66O42.js +0 -64
  99. package/dist/chunk-UH7IGZKF.js +0 -1
  100. package/dist/chunk-VETFIYQR.js +0 -23
  101. package/dist/chunk-ZJEBF4NB.js +0 -1
package/README.md CHANGED
@@ -1197,15 +1197,20 @@ const german: DeepPartial<EaselStrings> = {
1197
1197
 
1198
1198
  - **`EaselStrings`** is grouped by the module that says the word (`notice`,
1199
1199
  `lock`, `save`, `chrome`, `rail`, `tree`, `panel`, `fields`, `pick`, `drag`,
1200
- `menu`, `styleClipboard`, `copy`, `canvas`). A plain word is a `string`;
1200
+ `menu`, `styleClipboard`, `copy`, `canvas`, `textStyles`, `screen`). A plain word is a `string`;
1201
1201
  anything with a value in it is a function, so the host places the value and
1202
1202
  does its own plural. `DEFAULT_EASEL_STRINGS` is the English.
1203
1203
  - **What is left out falls back** (`mergeEaselStrings`), and a provider inside
1204
1204
  another lays its words over the outer one's.
1205
1205
  - **The provider reaches the parts that have hooks:** the edit notice, the device
1206
- switch, "up one level", the panel grip and the top-bar rail; the copy box, its
1207
- bar and its link window; `Inspector`, the number box, the dropdown and the list
1208
- field; the canvas frame's title.
1206
+ switch, "up one level", the panel grip and the top-bar rail; the copy box and
1207
+ its bar; `Inspector`, the number box, the dropdown and the list field; the
1208
+ canvas frame's title.
1209
+ - **The shell's parts speak the shell's words.** The copy box's link window and
1210
+ `fields.LinkPicker` are efficient-shell's `LinkPicker`, and `panel`'s
1211
+ `SettingsCorners` / `SettingsPlacement` its `CornersInput` / `AlignmentGrid`
1212
+ (3.0.0): a host translates them with the shell's `ShellStringsProvider`
1213
+ (`link`, `corners`), not with this provider.
1209
1214
  - **The leaves are handed their words.** The rail, the settings-panel
1210
1215
  primitives and the Layers tree are hook-free; the pickers, the Add panel and
1211
1216
  the canvas layer may import only their own folder. None of them reads the
@@ -1236,6 +1241,14 @@ const german: DeepPartial<EaselStrings> = {
1236
1241
  all: what a host's own test imports to check its languages against the
1237
1242
  engine's keys.
1238
1243
 
1244
+ - **The assembled screen hands its own leaves their words** (3.1.0). Under
1245
+ `EaselStringsProvider`, `efficient-easel/screen` draws every word of its own
1246
+ from the catalogue — the top bar, the save pill, the Layers panel and its
1247
+ rows, the right-click menu, the Add panel, the canvas layer, the prompt
1248
+ before a switch of document — so a host that mounts the screen only wraps
1249
+ it in the provider. A host that draws one of the leaves itself still hands
1250
+ it its group, as above.
1251
+
1239
1252
  What a host supplies was never the engine's and is not in the catalogue: a
1240
1253
  block's name, a field's label, a tile's caption, the document's `noun`.
1241
1254
 
@@ -2,8 +2,8 @@ import * as react from 'react';
2
2
  import { T as TopBarProps, a as TopBarClusterProps, b as TopBarRailProps, E as EaselIconButtonProps, c as DeviceSwitchProps, d as SaveStateProps, e as SaveStateToggleProps, P as PanelResizeHandleProps, I as InspectorHeadProps, f as InspectorIconButtonProps, g as InspectorUpLevelProps, M as MediaPanelHeadProps, h as MediaPickKind, i as EditNoticeProps } from '../types-Dt1CFR1S.js';
3
3
  export { D as DeviceOption, R as RailWordsShown, S as SaveTone } from '../types-Dt1CFR1S.js';
4
4
  import { LockWords, EditAccess, SaveConflict } from '../edit-lock/index.js';
5
- import { N as NoticeWords } from '../words-AHHfiaRY.js';
6
- export { C as ChromeWords } from '../words-AHHfiaRY.js';
5
+ import { N as NoticeWords } from '../words-C1U_dLBh.js';
6
+ export { C as ChromeWords } from '../words-C1U_dLBh.js';
7
7
  export { D as DEFAULT_PANEL_W, M as MAX_PANEL_W, a as MIN_PANEL_W, P as PanelSide, b as PanelWidths, c as clampPanelWidth, p as panelWidthVars, s as setPanelWidthVars } from '../panelWidths-D9hTLR25.js';
8
8
  import '../types-CsgMwHHa.js';
9
9
  import '../wordFit-7XpmhcaW.js';
@@ -1 +1 @@
1
- export{DEFAULT_PANEL_W,DeviceSwitch,EaselIconButton,EaselTopBar,EditNotice,InspectorHead,InspectorIconButton,InspectorUpLevel,MAX_PANEL_W,MIN_PANEL_W,MediaPanelHead,PanelResizeHandle,SaveState,SaveStateToggle,TopBarCluster,TopBarDivider,TopBarRail,clampPanelWidth,editNotice,mediaPickKind,panelWidthVars,setPanelWidthVars}from"../chunk-OXYGFK2B.js";import"../chunk-ZJEBF4NB.js";import"../chunk-THWO5YVZ.js";import"../chunk-RE4LP46F.js";import"../chunk-MJM6SFD3.js";import"../chunk-2OAZYSWJ.js";import"../chunk-MFIRYGHW.js";
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-GTDLBUOC.js";import"../chunk-Y2G7CU6A.js";import"../chunk-THWO5YVZ.js";import"../chunk-RE4LP46F.js";import"../chunk-MJM6SFD3.js";import"../chunk-2OAZYSWJ.js";import"../chunk-MFIRYGHW.js";
@@ -1 +1 @@
1
- import{DEFAULT_PANEL_W as s,clampPanelWidth as e}from"./chunk-OXYGFK2B.js";var a="sf-editor-panel-widths",l="sf-editor-collapsed-sections";function t(s){return s?{panelWidths:`${s}-panel-widths`,collapsed:`${s}-collapsed-sections`}:{panelWidths:a,collapsed:l}}var o={...s},d=s=>e(s);export{l as COLLAPSED_SECTIONS_KEY,o as DEFAULT_PANEL_W,a as PANEL_WIDTHS_KEY,d as clampPanelWidth,t as screenStorageKeys};
1
+ import{DEFAULT_PANEL_W as s,clampPanelWidth as e}from"./chunk-GTDLBUOC.js";var a="sf-editor-panel-widths",l="sf-editor-collapsed-sections";function t(s){return s?{panelWidths:`${s}-panel-widths`,collapsed:`${s}-collapsed-sections`}:{panelWidths:a,collapsed:l}}var o={...s},d=s=>e(s);export{l as COLLAPSED_SECTIONS_KEY,o as DEFAULT_PANEL_W,a as PANEL_WIDTHS_KEY,d as clampPanelWidth,t as screenStorageKeys};
@@ -1,4 +1,4 @@
1
- import{useScreenOwnerName as e}from"./chunk-5TRBCPRB.js";import{settlePanelPick as n}from"./chunk-R6WTQWAC.js";import{MediaPanelHead as i,mediaPickKind as c}from"./chunk-OXYGFK2B.js";import{jsxs as o,Fragment as r,jsx as t}from"react/jsx-runtime";function l({panel:l,pick:d,onHide:m}){const p=e();/* @__PURE__ */
1
+ import{useScreenOwnerName as e}from"./chunk-EJ6QAWRH.js";import{settlePanelPick as n}from"./chunk-R6WTQWAC.js";import{MediaPanelHead as i,mediaPickKind as c}from"./chunk-GTDLBUOC.js";import{jsxs as o,Fragment as r,jsx as t}from"react/jsx-runtime";function l({panel:l,pick:d,onHide:m}){const p=e();/* @__PURE__ */
2
2
  return o(r,{children:[
3
3
  /* @__PURE__ */t(i,{context:p,pick:d?{kind:c(d.accept),field:d.title||void 0}:null,onCancel:()=>d&&n(d.requestId,null),onHide:m}),
4
4
  /* @__PURE__ */t("div",{className:"sf-media-panel",children:/* @__PURE__ */t(l,{pick:d,onPick:e=>d&&n(d.requestId,e)})})]})}export{l as MediaSidePanel};
@@ -0,0 +1 @@
1
+ import{styleMenuItems as e}from"./chunk-V7U33NF2.js";import{useEaselSession as n}from"./chunk-O7Q4DDJT.js";import{ROOT_ZONE as t}from"./chunk-PLVEGYK6.js";import{useHostEscape as o}from"./chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as l}from"./chunk-LYALMY55.js";import{EaselMenuItems as r,menuLabel as i}from"./chunk-EA2HTX37.js";import{createNodeClipboard as c,nodeMenuItems as s}from"./chunk-OSPUG6S6.js";import{DEFAULT_NODE_MENU_WORDS as a}from"./chunk-WK3AFPXY.js";import{useCanvasEvent as u}from"./chunk-PAELDYYS.js";import{isTypingTarget as d,framePointToHost as p}from"./chunk-ZNCEOSXO.js";import{zoneKey as f,ROOT_SLOT as m,ROOT_ID as h}from"./chunk-KRXQM65X.js";import{useState as y,useCallback as k,useRef as b,useEffect as v}from"react";import{ContextMenu as g}from"efficient-shell/ui";import{UndoIcon as w,RedoIcon as x,AddIcon as C,PasteIcon as z,SettingsIcon as O,LayersIcon as P,CopyIcon as A}from"efficient-shell/icons/efficient";import{jsx as S}from"react/jsx-runtime";function j(e,n){const o=[],l=/* @__PURE__ */new Set;let r={zone:n.zone,index:n.index};for(;r;){const n=e.nodeAt(r.zone,r.index);if(!n||l.has(n.props.id))break;if(l.add(n.props.id),o.push({zone:r.zone,index:r.index,node:n,parentType:null}),r.zone===t)break;const i=r.zone.lastIndexOf(":");if(i<=0)break;r=e.locate(r.zone.slice(0,i))}for(let e=0;e<o.length-1;e+=1)o[e].parentType=o[e+1].node.type;return o}var D=c(),K=/* @__PURE__ */new WeakMap;function M(e){if(e.claimsPage)return D;const n=e.registry;if(!n)return e.cache("easel:node-clipboard",c);let t=K.get(n);return t||(t=c(),K.set(n,t)),t}function T(){return M(n())}function X(e,n,o){if(n===t){const{floor:n,cap:t}=e.sectionBand();return{parentId:h,slot:m,index:Math.min(Math.max(o,n),t)}}const l=n.lastIndexOf(":");return{parentId:n.slice(0,l),slot:n.slice(l+1),index:o}}function E(e,n,t){const o=e.isPinned(n,t),l=!o&&!e.isLocked(n)&&!e.duplicateBlocked(n),r=e.permits?.(n)??{duplicate:!0,delete:!0};return{copy:!o&&r.duplicate,cut:l&&r.duplicate&&r.delete}}function L(e,n,t){const o=e.canPasteAt;if(!o)return f(n.from)===t.zone?X(e,t.zone,t.index+1):null;for(const l of j(e,t)){const t=X(e,l.zone,l.index+1);if(o(n,t))return t}return null}function Y(e){if(e.defaultPrevented||e.altKey||e.shiftKey||!e.metaKey&&!e.ctrlKey)return null;if(d(e.target))return null;const n=e.target,t=n&&"ownerDocument"in n?n.ownerDocument??n:null,o=t?.getSelection?.();if(o&&!o.isCollapsed&&o.toString().trim())return null;const l=e.code||(1===e.key.length?`Key${e.key.toUpperCase()}`:"");return"KeyC"===l?"copy":"KeyX"===l?"cut":"KeyV"===l?"paste":null}function I(e,n,t,o){const l=e.nodeAt(t.zone,t.index);if(!l)return null;const r=l.props.id,i=e.labelOf(l.type,t.zone),c=E(e,l,t.zone);if("copy"===n)return c.copy?(e.nodeOps.copy(r,i),{done:"copied",name:i}):null;if(o.readOnly)return null;if("cut"===n)return c.cut?(e.nodeOps.cut(r,i),{done:"cut",name:i}):null;const s=o.held;if(!s)return null;const a=e.isPinned(l,t.zone)?null:L(e,s,t);return a?(e.nodeOps.paste(a),{done:"pasted",name:s.label}):(e.onPasteRefused(s),{done:"refused",name:s.label})}function R(n,o){const{zone:l,index:r}=o,i=n.nodeAt(l,r);if(!i)return[];const c=i.props.id,a=n.labelOf(i.type,l),u=Boolean(i.props._hidden),d=n.nodeOps,p=n.isPinned(i,l),f=n.isLocked(i),m=!p&&!f&&!n.duplicateBlocked(i),h=n.permits?.(i)??{duplicate:!0,delete:!0},y=E(n,i,l),k=j(n,o),b=d.held,v=b&&!p?L(n,b,o):null,g=!n.readOnly,w=n.style?e({held:g?n.style.held():null,canCopy:n.style.canCopy(i,l),onCopy:()=>n.style?.copy(i,l),onPaste:()=>n.style?.paste(l,r,i),words:n.words?.styleClipboard}):[];return s({title:a,words:n.words?.menu,layer:{group:"pick",items:k.flatMap((e,o)=>{const l={label:n.rowNameOf(e.node,e.zone),checked:0===o,onClick:()=>n.selectAt(e.zone,e.index,e.node.props.id,e.parentType)},r=e.zone===t?null:n.slotRung?.(e.zone)??null;return r?[l,{label:r.label,checked:!1,onClick:r.select}]:[l]})},actions:{addInside:g&&n.canAddTo(i.type)?()=>n.openAddInside(l,r):void 0,duplicate:g&&m&&h.duplicate?()=>d.duplicate(c):void 0,moveUp:g&&d.canStep(c,-1)?()=>d.step(c,-1):void 0,moveDown:g&&d.canStep(c,1)?()=>d.step(c,1):void 0,copy:y.copy?()=>d.copy(c,a):void 0,cut:g&&y.cut?()=>d.cut(c,a):void 0,paste:g&&b&&v?{label:b.label,run:()=>d.paste(v)}:void 0,rename:g&&n.renamePropOf(i,l)?()=>n.beginRename(l,r):void 0,hide:!g||f||p?void 0:{hidden:u,run:()=>d.setProps(c,{_hidden:!u})},delete:g&&m&&h.delete?()=>d.remove(c):void 0},style:w,extras:n.menuRows?.(i,l,r)??void 0,pinnedLine:p?N(n).pinned:void 0})}var N=e=>e.words?.screen??l.menu;function U(e){const n=N(e),o=!e.readOnly,r=[];o&&e.history.hasPast&&r.push({label:n.undo,icon:/* @__PURE__ */S(w,{}),shortcut:"⌘Z",onClick:e.history.back}),o&&e.history.hasFuture&&r.push({label:n.redo,icon:/* @__PURE__ */S(x,{}),shortcut:"⇧⌘Z",onClick:e.history.forward});const i=o?[{label:n.addSection,icon:/* @__PURE__ */S(C,{}),onClick:e.openAddSection}]:[],c=e.nodeOps.held,s=X(e,t,e.sectionBand().cap);if(o&&c&&(e.canPasteAt?e.canPasteAt(c,s):f(c.from)===t)){const n=s,t=e.words?.menu??a;i.push({label:t.pasteNamed({paste:t.paste,label:c.label}),icon:/* @__PURE__ */S(z,{}),shortcut:"⌘V",onClick:()=>e.nodeOps.paste(n)})}const u=[r,i,[{label:e.pageSettingsLabel??l.pageSettings,icon:/* @__PURE__ */S(O,{}),onClick:e.openPageSettings},{label:n.collapseAll,icon:/* @__PURE__ */S(P,{}),onClick:e.collapseAll}]].filter(e=>e.length>0),d={label:"—",onClick:()=>{}};return u.flatMap((e,n)=>n?[d,...e]:e)}function V(e,n){const t=n.selectionStart??0,o=n.selectionEnd??0,l=n.value.slice(t,o),r=e=>{n.focus(),n.setRangeText(e,t,o,"end"),n.dispatchEvent(new Event("input",{bubbles:!0}))},i=e.words?.menu??a,c=N(e),s=[];l&&(s.push({label:i.copy,icon:/* @__PURE__ */S(A,{}),shortcut:"⌘C",onClick:()=>navigator.clipboard?.writeText(l)}),s.push({label:i.cut,icon:/* @__PURE__ */S(A,{}),shortcut:"⌘X",onClick:()=>{navigator.clipboard?.writeText(l),r("")}})),s.push({label:i.paste,icon:/* @__PURE__ */S(z,{}),shortcut:"⌘V",onClick:()=>{navigator.clipboard?.readText().then(e=>{e&&r(e)}).catch(()=>e.onPasteRefused())}});const u=[s,n.value?[{label:c.selectAll,shortcut:"⌘A",onClick:()=>{n.focus(),n.select()}}]:[]].filter(e=>e.length>0),d={label:"—",onClick:()=>{}};return u.flatMap((e,n)=>n?[d,...e]:e)}function B(e){return e.shiftKey}function F(e,n){const[t,l]=y(null),r=k(()=>l(null),[]);o(null!==t,r);const i=b(e);i.current=e;const c=k(e=>{const n=i.current,t=n.keys;if(!t)return;const o=Y(e);if(!o)return;const l=t.selected();if(!l)return;const r=I(n,o,l,{readOnly:t.readOnly,held:t.held()});r&&(e.preventDefault(),t.onDone?.(r))},[]),s=e.keys?.target??null;v(()=>{if(!s)return;const e=e=>c(e);return s.addEventListener("keydown",e),()=>s.removeEventListener("keydown",e)},[s,c]),u(n,"keydown",c);const a=k(n=>{if(B(n))return;const t=n.target;if(t?.closest?.("[data-slot-zone]"))return n.preventDefault(),void l(null);const o=function(e){const n=e?.closest?.("input, textarea");return n&&("INPUT"!==n.tagName||["text","search","url","email","tel","number",""].includes(n.type))?n:null}(t);if(o)return n.preventDefault(),void l({kind:"input",x:n.clientX,y:n.clientY,el:o,owner:t});const r=t?.closest?.("[data-node-id]")?.getAttribute("data-node-id"),i=r?e.locate(r):null;n.preventDefault(),l(i?{kind:"node",x:n.clientX,y:n.clientY,...i,owner:t}:{kind:"empty",x:n.clientX,y:n.clientY,owner:t})},[e]);u(n,"contextmenu",t=>{if(B(t)||!n)return;const o=t.target?.closest?.("[data-puck-component]")??null,r=o?.getAttribute("data-puck-component"),i=r?e.locate(r):null;t.preventDefault();const c=p(n.frame,t.clientX,t.clientY),s=n.frame;l(i?{kind:"node",...c,...i,owner:s}:{kind:"empty",...c,owner:s})}),u(n,"mousedown",r),u(n,"scroll",r,{on:"window"});return{onEditorContextMenu:a,menu:t?/* @__PURE__ */S(G,{host:e,target:t,onClose:r}):null,closeMenu:r}}function G({host:e,target:n,onClose:t}){const o="node"===n.kind?R(e,n):"input"===n.kind?V(e,n.el):U(e);return 0===o.length?null:/* @__PURE__ */S(g,{at:{x:n.x,y:n.y},owner:n.owner??null,onClose:t,"aria-label":i(o),children:/* @__PURE__ */S(r,{items:o,onClose:t})})}export{D as EASEL_NODE_CLIPBOARD,j as ancestorChain,M as nodeClipboardOf,E as nodeClipboardRules,R as nodeMenuItems,Y as nodeShortcut,U as pageMenuItems,L as pastePlace,I as runNodeShortcut,V as textMenuItems,T as useNodeClipboard,F as useNodeContextMenu};
@@ -0,0 +1,5 @@
1
+ import{PanelToggleIcon as e}from"./chunk-KQMML6JM.js";import{InspectorHead as n}from"./chunk-GTDLBUOC.js";import{DEFAULT_CHROME_WORDS as i}from"./chunk-Y2G7CU6A.js";import{useWords as o}from"./chunk-MFIRYGHW.js";import{Tooltip as s,IconButton as t,Button as c}from"efficient-shell/ui";import{jsx as r,jsxs as l,Fragment as d}from"react/jsx-runtime";function a({icon:e,title:i,context:o,actions:s,side:t="left",onHide:c}){/* @__PURE__ */
2
+ return r(n,{icon:e,name:i,kind:o,actions:s||c?/* @__PURE__ */l(d,{children:[s,c?/* @__PURE__ */r(m,{side:t,onHide:c,divider:Boolean(s)}):null]}):void 0})}function m({side:n,onHide:c,divider:a=!1}){const m=o("chrome",i);/* @__PURE__ */
3
+ return l(d,{children:[a?/* @__PURE__ */r("span",{className:"sf-head-divider","aria-hidden":"true"}):null,
4
+ /* @__PURE__ */r(s,{content:m.hidePanel,side:"bottom",children:/* @__PURE__ */r(t,{className:"es-insp-iconbtn","aria-label":m.hidePanelLabel({side:n}),onClick:c,children:/* @__PURE__ */r(e,{side:n})})})]})}function h({side:n,onShow:c}){const l=o("chrome",i);/* @__PURE__ */
5
+ return r("div",{className:`es-sidepanel es-sidepanel--${n} sf-panel-strip`,children:/* @__PURE__ */r(s,{content:l.showPanel,side:"bottom",children:/* @__PURE__ */r(t,{className:"es-insp-iconbtn","aria-label":l.showPanelLabel({side:n}),onClick:c,children:/* @__PURE__ */r(e,{side:n})})})})}function u({label:e,onClick:n,description:i}){const o=/* @__PURE__ */r(c,{variant:"secondary",size:"sm",className:"es-insp-textbtn",onClick:n,children:e});return i?/* @__PURE__ */r(s,{content:i,side:"bottom",children:o}):o}export{m as PanelHideButton,u as PanelModeExit,h as PanelShowStrip,a as SidePanelHead};
@@ -1 +1 @@
1
- import{DEFAULT_FIELDS_WORDS as e}from"./chunk-FPOKPNO4.js";import{useWords as i}from"./chunk-MFIRYGHW.js";import{ShellStringsProvider as n,InputNumber as s,Tooltip as a}from"efficient-shell/ui";import{jsx as l}from"react/jsx-runtime";function r({id:r,value:t,onChange:m,min:o,max:c,step:u=1,shiftStep:d,styleValue:p,icon:f,unit:h,steppers:b=!1,placeholder:v,readOnly:x=!1,ariaLabel:y,ariaLabelledBy:N,title:O}){const g=i("fields",e),j="number"==typeof t&&Number.isFinite(t)?t:null,F=/* @__PURE__ */l("div",{className:`es-fnum${f?" es-fnum--icon":""}${null===j&&void 0!==p?" is-style":""}`,children:/* @__PURE__ */l(n,{value:{number:{increase:g.more,decrease:g.less}},children:/* @__PURE__ */l(s,{id:r,size:"sm",className:"es-fnum-box",value:j,onChange:e=>m(e??void 0),min:o,max:c,step:u,shiftStep:d,readOnly:x,steppers:b,snap:!0,placeholder:void 0!==p?String(p):v,prefix:f?/* @__PURE__ */l("span",{className:"es-fnum-icon",children:f}):void 0,suffix:h?/* @__PURE__ */l("span",{className:"es-fnum-unit",children:h}):void 0,"aria-label":y,"aria-labelledby":N})})});return O?/* @__PURE__ */l(a,{content:O,children:F}):F}export{r as FieldNumber};
1
+ import{DEFAULT_FIELDS_WORDS as e}from"./chunk-FFYXVAAL.js";import{useWords as i}from"./chunk-MFIRYGHW.js";import{ShellStringsProvider as n,InputNumber as s,Tooltip as a}from"efficient-shell/ui";import{jsx as l}from"react/jsx-runtime";function r({id:r,value:t,onChange:m,min:o,max:c,step:u=1,shiftStep:d,styleValue:p,icon:f,unit:h,steppers:b=!1,placeholder:v,readOnly:x=!1,ariaLabel:y,ariaLabelledBy:N,title:F}){const g=i("fields",e),j="number"==typeof t&&Number.isFinite(t)?t:null,L=/* @__PURE__ */l("div",{className:`es-fnum${f?" es-fnum--icon":""}${null===j&&void 0!==p?" is-style":""}`,children:/* @__PURE__ */l(n,{value:{number:{increase:g.more,decrease:g.less}},children:/* @__PURE__ */l(s,{id:r,size:"sm",className:"es-fnum-box",value:j,onChange:e=>m(e??void 0),min:o,max:c,step:u,shiftStep:d,readOnly:x,steppers:b,snap:!0,placeholder:void 0!==p?String(p):v,prefix:f?/* @__PURE__ */l("span",{className:"es-fnum-icon",children:f}):void 0,suffix:h?/* @__PURE__ */l("span",{className:"es-fnum-unit",children:h}):void 0,"aria-label":y,"aria-labelledby":N})})});return F?/* @__PURE__ */l(a,{content:F,children:L}):L}export{r as FieldNumber};
@@ -0,0 +1,64 @@
1
+ import{dedupeSlotChildren as e}from"./chunk-26OOWIJJ.js";import{styleClipboardOf as n}from"./chunk-MYC3AVG2.js";import{markedTreeNodeId as t,revealSelectedTreeRow as o,sameSelector as r}from"./chunk-FGNR22NY.js";import{cloneNodeWithFreshIds as i}from"./chunk-2GVCAIPX.js";import{rootRowName as l,slotChildRowName as s,slotChildRenameProp as d,sectionRenameProp as c}from"./chunk-TBF5CVPA.js";import{scrollPreviewToSection as a,gotoPreviewSlide as p,scrollPreviewToTop as u}from"./chunk-4ES5JGGX.js";import{useEaselKeyTarget as f,useEaselUndoKeys as h,editorRootFocus as m}from"./chunk-PT6V53OO.js";import{SlotChildActionsProvider as g}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as y,DEFAULT_PANEL_W as k,clampPanelWidth as S}from"./chunk-42TMLDSQ.js";import{usePartBridge as v}from"./chunk-BVUPKIM3.js";import{useSectionOps as w}from"./chunk-LHZIMK3M.js";import{useNodeClipboard as x,useNodeContextMenu as b}from"./chunk-53NZMIRT.js";import{PageEditGuardNotices as z}from"./chunk-EF3YSWT5.js";import{useScreenDocument as B}from"./chunk-VGV5D667.js";import{requestMediaPick as C}from"./chunk-KG7RJWOK.js";import{heldStyle as O,styleShortcut as N}from"./chunk-V7U33NF2.js";import{AddChildRow as I}from"./chunk-5545A3PC.js";import{AddSidePanel as T}from"./chunk-UV4D7CDX.js";import{SidePanelHead as P,PanelShowStrip as $}from"./chunk-5SOSVTVI.js";import{MediaSidePanel as A}from"./chunk-4LD4KA27.js";import{useScreenSaveSwitch as M,useScreenNodeKeys as j,useScreenPinned as R,useScreenDocumentLabel as L,useScreenCanvasFrame as V,useScreenInspectorPanel as E,useScreenDevices as D,useScreenPickFollowsSelection as H,useScreenLeftView as F,useScreenAdd as W,SELECTION_MODE as U,sameInspectorMode as G,useScreenBridges as Y,useScreenBlockRules as J,useScreenBlockLook as K,useScreenStorageNamespace as X,useScreenNotify as _,useScreenCanvasHead as Q,isSlotMode as q,useScreenStyleClipboard as Z,useScreenDocumentPass as ee,useScreenCanvasDrag as ne,ScreenCanvasTargetProvider as te,isPinnedFirst as oe,isPinnedLast as re,screenSlotsOf as ie}from"./chunk-EJ6QAWRH.js";import{ROOT_ZONE as le,blockNodeActions as se,TREE_MAX_DEPTH as de,childSlotsOf as ce,slotFieldsOf as ae,slotChildrenIn as pe,nestsInTree as ue,newNodeId as fe}from"./chunk-PLVEGYK6.js";import{useMediaPanel as he,usePanelPick as me,useCancelPanelPick as ge}from"./chunk-R6WTQWAC.js";import{useEaselHost as ye,useHostEscape as ke}from"./chunk-U3JP4VGF.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as Se}from"./chunk-6WY6ZXJG.js";import{DEFAULT_SCREEN_WORDS as ve}from"./chunk-LYALMY55.js";import{useEasel as we,useEaselApi as xe}from"./chunk-PYCLHOSA.js";import{TreeRow as be,Subtree as ze,LayersTree as Be,TreeGroupLabel as Ce,TreeRowAction as Oe,TreeSeam as Ne}from"./chunk-UFY6RNMT.js";import{DEFAULT_TREE_WORDS as Ie}from"./chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as Te}from"./chunk-WK3AFPXY.js";import{toItemSelector as Pe,useNodeOps as $e}from"./chunk-D2BCHTQR.js";import{LayersIcon as Ae,MediaIcon as Me}from"./chunk-4VJATVVR.js";import{DEFAULT_SAVE_WORDS as je,saveIndicator as Re}from"./chunk-H6DDIBQ4.js";import{EaselTopBar as Le,TopBarRail as Ve,TopBarCluster as Ee,EaselIconButton as De,TopBarDivider as He,DeviceSwitch as Fe,InspectorIconButton as We,PanelResizeHandle as Ue,MAX_PANEL_W as Ge,MIN_PANEL_W as Ye,panelWidthVars as Je,SaveState as Ke,SaveStateToggle as Xe}from"./chunk-GTDLBUOC.js";import{DEFAULT_CHROME_WORDS as _e}from"./chunk-Y2G7CU6A.js";import{useWords as Qe}from"./chunk-MFIRYGHW.js";import{CanvasDragLayer as qe}from"./chunk-6HHHBBSY.js";import{DEFAULT_DRAG_WORDS as Ze}from"./chunk-O2NLQBFX.js";import{createDragSession as en,useTreeDrag as nn,gapToMoveIndex as tn}from"./chunk-67GNT6PF.js";import{useCanvasFrame as on,BLOCK_SELECTOR as rn,useCanvasEvent as ln}from"./chunk-PAELDYYS.js";import{zoneKey as sn,ROOT_ID as dn,ROOT_SLOT as cn,parseZoneKey as an,DataError as pn}from"./chunk-KRXQM65X.js";import{useRef as un,useMemo as fn,useState as hn,useEffect as mn,useCallback as gn,useLayoutEffect as yn,Fragment as kn}from"react";import{Tooltip as Sn,Button as vn,toast as wn}from"efficient-shell/ui";import{UndoIcon as xn,RedoIcon as bn,TrashIcon as zn,EyeOffIcon as Bn,EyeIcon as Cn,DuplicateIcon as On}from"efficient-shell/icons/efficient";import{jsx as Nn,jsxs as In,Fragment as Tn}from"react/jsx-runtime";function Pn({saveState:e,notSaving:n,readOnlyReason:t,toggle:o,onToggle:r,onRetry:i,words:l,saveWords:s}){if(null!==t)/* @__PURE__ */return Nn(Ke,{tone:"off",label:t,role:"status"});if(n)/* @__PURE__ */
2
+ return Nn(Ke,{tone:e.pending?"off-unsaved":"off",label:l.notSaving,role:"status"});const{tone:d,label:c}=Re(e,s),a=e.failed&&!e.paused&&/* @__PURE__ */Nn(vn,{variant:"secondary",size:"sm",onClick:i,children:l.retry});/* @__PURE__ */
3
+ return In(Tn,o?{children:[
4
+ /* @__PURE__ */Nn(Xe,{pressed:e.paused,onToggle:r,title:e.paused?l.autoSaveOff:l.autoSaveOn,children:/* @__PURE__ */Nn(Ke,{tone:d,label:c})}),a]}:{children:[
5
+ /* @__PURE__ */Nn(Ke,{tone:d,label:c,role:"status"}),a]})}function $n({expand:e}){/* @__PURE__ */
6
+ return Nn("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */In(Tn,e?{children:[
7
+ /* @__PURE__ */Nn("path",{d:"M8 9l4-4 4 4"}),
8
+ /* @__PURE__ */Nn("path",{d:"M8 15l4 4 4-4"})]}:{children:[
9
+ /* @__PURE__ */Nn("path",{d:"M8 4l4 4 4-4"}),
10
+ /* @__PURE__ */Nn("path",{d:"M8 20l4-4 4 4"}),
11
+ /* @__PURE__ */Nn("path",{d:"M5 12h14"})]})})}function An(e,n,t){const o=t-n;if(o<6)return null;if(o<26)return{top:Math.round((n+t)/2),height:Math.round(o)};return{top:Math.round(Math.min(Math.max(e,n+13),t-13))}}var Mn="__rungs";var jn="screen:band",Rn={duplicate:!0,delete:!0};function Ln(){const Re=ye(),{target:Ke,docId:Xe,capabilities:Ln,currentSlug:Vn,siteId:En,onPublish:Dn,saveState:Hn,saveConflict:Fn,retrySave:Wn,toggleAutoSave:Un,readOnly:Gn,readOnlyReason:Yn=null}=B(),Jn=M(),Kn=j(),{mediaEditing:Xn,hasEditGuard:_n,hasPinnedChrome:Qn}=Ln,{appState:qn,dispatch:Zn,history:et,selectedItem:nt,getSelectorForId:tt,config:ot}=we(e=>e),rt=R(),{first:it,firstGroup:lt,lastGroup:st,isSectionGroup:dt,sectionGroupZone:ct,panelOf:at}=rt,pt=at(it),ut=e=>oe(rt,e),ft=e=>re(rt,e),ht="node"===rt.firstRow,mt=rt.band??null,gt=Qe("screen",ve),yt=Qe("tree",Ie),kt=Qe("drag",Ze),St=Qe("save",je),vt=Qe("menu",Te),wt=Qe("styleClipboard",Se),xt=Qe("chrome",_e),bt=L()??`/${Vn}`,zt=V(),Bt=E(),Ct=w({readOnly:Gn}),Ot=w({readOnly:Gn,foldIntoHistory:!0}),Nt=un(null),It=xe(),Tt=fn(()=>({...Ct,select:e=>{Nt.current=e,Ct.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=It.config;Nt.current=Pe(e,t,n)}Ct.commitDocument(e,n)}}),[Ct,It]),Pt=qn.ui,$t=Pt.leftSideBarVisible,At=Pt.rightSideBarVisible,{options:Mt,widths:jt,initial:Rt,fluid:Lt,fit:Vt}=D(),[Et,Dt]=hn(Rt),Ht=he(),Ft=Xn&&null!==Ht,Wt=me(),Ut=ge();H(nt?.props.id);const{read:Gt,write:Yt,forSelection:Jt}=F(),[Kt,Xt]=hn(Gt);mn(()=>{Yt(Kt)},[Kt]);const[_t,Qt]=hn(0),qt=un(null),Zt=un(null),eo=on(Zt,{readySelector:rn}),no=f(Zt);h(Zt,eo);const[to,oo]=hn(!1),ro=un(!1),io=un(!1),[lo,so]=hn(null),co=W(),ao=e=>so(null===e?null:{zone:le,index:e}),[po,uo]=hn([]),[fo,ho]=hn(U),mo="puck"===fo.kind,go=to&&!lo&&co.railTarget?co.railTarget(qn.data,{node:nt??null,mode:fo}):null,yo=go?{zone:sn(go),index:go.index}:null,ko=lo??yo,So=ko&&ko.zone===le?ko.index:null,vo=t(fo,nt?.props.id),[wo,xo]=hn(null);mn(()=>{wo&&(o(),xo(null))},[wo]);const bo=un(tt);bo.current=tt;const zo=gn((e,{scroll:n})=>{Xt(n=>Jt(e,n)),n&&xo(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=bo.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&er(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),Bo=un(null);mn(()=>{const e=Bo.current;Bo.current=null;const n=null==nt?.props.id?null:String(nt.props.id);ho(e&&e.id===n?e.mode:at(nt?.type)??U);const t=nt?.props.id,o=Nt.current;if(Nt.current=null,!t)return;const i=tt(t);zo(String(t),{scroll:!r(o,i??null,le)})},[nt?.props.id,zo]);const Co=gn(e=>{ho(n=>G(n,e)?n:e),Zn({type:"setUi",ui:{rightSideBarVisible:!0}})},[Zn]),Oo=un(()=>{});Oo.current=(e,n)=>{const t=e?Gr(e.zone??le)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==nt?.props.id?null:String(nt.props.id);ho(e=>G(e,n)?e:n),o!==r&&(Bo.current={id:o,mode:n},Tt.select(e))};const No=gn((e,n)=>Oo.current(e,n),[]),Io={kind:fo.kind,mode:fo,open:Co,show:e=>ho(e),reveal:()=>{At||Zn({type:"setUi",ui:{rightSideBarVisible:!0}})},select:No},To=Y(Io,{data:qn.data,selected:nt??null,zoneOf:e=>tt(e)?.zone,readOnly:Boolean(Gn),select:e=>{ho(U),Tt.select({index:e})},replace:(e,n)=>Tt.replaceComponent(le,e,n),scrollTo:e=>gi(e)},{device:Et,refreshes:_t},{setView:Xt,reveal:()=>{$t||Zn({type:"setUi",ui:{leftSideBarVisible:!0}})}}),Po=To.pinnedSource??!1,$o=To.resolveLeftView?To.resolveLeftView(Kt,Ft):"media"===Kt&&Ft?Kt:"sections",Ao=J(),{isLockedBlock:Mo,duplicateBlocked:jo,nestDepth:Ro,newSectionNode:Lo,canAddTo:Vo,blockIsOffered:Eo}=Ao,Do=K(),{labelAtLevel:Ho,Icon:Fo,useProducts:Wo}=Do,Uo=Do.rowName?(e,n,t)=>Do.rowName(e,n,t):void 0,Go=gn(e=>{Zn({type:"setUi",ui:{rightSideBarVisible:!0}}),a(e),zo(e,{scroll:!0})},[Zn,zo]),{selectNode:Yo,openPartId:Jo}=v({mode:fo,setMode:ho,onOpenPart:Go}),[Ko,Xo]=hn(null);ke(null!==Ko,()=>Xo(null));const _o=y(X()),Qo=_o.collapsed,qo=_o.panelWidths,[Zo,er]=hn(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(Qo);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
12
+ return new Set}});mn(()=>{try{window.localStorage.setItem(Qo,JSON.stringify([...Zo]))}catch{}},[Zo]);const[nr,tr]=hn(()=>{if("undefined"==typeof window)return{...k};try{const e=window.localStorage.getItem(qo);if(!e)return{...k};const n=JSON.parse(e);return{left:S(Number(n.left)||k.left),right:S(Number(n.right)||k.right)}}catch{return{...k}}});mn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(qo,JSON.stringify(nr))}catch{}},300);return()=>clearTimeout(e)},[nr]);const or=gn((e,n)=>tr(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),rr=gn(e=>or("left",e),[or]),ir=gn(e=>or("right",e),[or]),lr=e=>Zo.has(e),sr=e=>er(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),dr=un(!1),cr=un(null);mn(()=>{if(dr.current&&!to){const e=cr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??Zt.current?.querySelector(`button[aria-label="${CSS.escape(gt.add.title)}"]`))?.focus(),cr.current=null}dr.current=to},[to]),mn(()=>{if(!to||!no)return;const e=e=>{"Escape"===e.key&&Bi()};return no.addEventListener("keydown",e),()=>no.removeEventListener("keydown",e)},[to,no]),ke(to,()=>Bi()),mn(()=>{!$t&&to&&(oo(!1),so(null),ro.current=!1)},[$t]),mn(()=>{if(!Wt)return io.current&&Zn({type:"setUi",ui:{leftSideBarVisible:!1}}),void(io.current=!1);to&&(oo(!1),so(null),io.current=ro.current,ro.current=!1),$t||(io.current=!0,Zn({type:"setUi",ui:{leftSideBarVisible:!0}}))},[Wt]),mn(()=>{!$t&&Wt&&(io.current=!1,Ut())},[$t]),mn(()=>{if(!Wt||!no)return;const e=e=>{"Escape"===e.key&&Ut()};return no.addEventListener("keydown",e),()=>no.removeEventListener("keydown",e)},[Wt,no]),ke(null!==Wt,()=>Ut());const ar=_(),pr=(e,n="success")=>{ar?ar(e,"error"===n?"error":"info"):"error"===n?wn.error(e,{duration:3200,sound:!1}):wn.success(e,{duration:1900,sound:!1})},ur=un(null),[fr,hr]=hn(0),[mr,gr]=hn(0),yr=Q(),kr=un(null),Sr=e=>Math.max(0,e.clientHeight-(kr.current?.offsetHeight??0));mn(()=>{const e=ur.current;if(!e)return;const n=()=>{hr(e.clientWidth),gr(Sr(e))};n();const t=new ResizeObserver(n);return t.observe(e),kr.current&&t.observe(kr.current),()=>t.disconnect()},[]),yn(()=>{ur.current&&(hr(ur.current.clientWidth),gr(Sr(ur.current)))},[nr,$t,At]);const vr=Et===Lt?fr>0?fr:jt[Lt]:jt[Et],wr=fr>0?Math.min(fr/vr,"shrink"===Vt?1:2):1,xr=vr*wr,br=fr>0&&xr>fr+1,zr={width:xr,height:mr||"100%",flex:"none",position:"relative"},Br={width:vr,height:mr?mr/wr:"100%",maxHeight:"none",transform:1!==wr?`scale(${wr})`:void 0,transformOrigin:"top left"},Cr=()=>Zn({type:"setUi",ui:{leftSideBarVisible:!$t}}),Or=()=>Zn({type:"setUi",ui:{rightSideBarVisible:!At}}),Nr=e=>{to&&(oo(!1),so(null),ro.current=!1,$t&&Kt===e)||Wt&&(io.current=!1,Ut(),$t&&Kt===e)||($t&&Kt===e?Cr():(Xt(e),$t||Zn({type:"setUi",ui:{leftSideBarVisible:!0}})))},Ir=()=>{C(Re,{accept:"image/*",title:xt.mediaLibrary})},Tr=()=>{ho(U),Tt.select(null),u()},Pr=()=>{ho(pt??U),At||Zn({type:"setUi",ui:{rightSideBarVisible:!0}})},$r=qn.data.content??[],Ar=()=>{const e=$r.findIndex(ut),n=$r.findIndex(ft);return{floor:e>=0?e+1:0,cap:n>=0?n:$r.length}},Mr=ot,jr=Ao.stripCopy,Rr=e=>i(e,jr),Lr=x(),Vr=$e({data:qn.data,config:Mr,readOnly:Boolean(Gn),clipboard:Lr,strip:jr?e=>jr(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==dn||e.slot!==cn)return{min:0,max:n-1};const{floor:t,cap:o}=Ar();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&ho(U);const t=void 0===n||"node"===n?.kind?n:null;Tt.commitDocument(e,t)}}),Er=e=>Ho(e,"block",ot.components[e]?.label??e),Dr=gn(e=>ot.components[e]?.defaultProps??{},[ot]),Hr=e=>Ho(e,"section",Er(e)),Fr=e=>l({type:e.type,props:e.props??{}},Hr(e.type),Uo),{nodeAddresses:Wr,zoneItems:Ur}=fn(()=>{const e=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map,t=(o,r,i)=>{n.set(r,o),o.forEach((n,o)=>{const l=String(n.props?.id??"");if(l&&e.set(l,{zone:r,index:o}),i>=de)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of ce(ot,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t($r,le,0),{nodeAddresses:e,zoneItems:n}},[$r,ot]),Gr=gn(e=>Ur.get(e)??[],[Ur]),Yr=e=>{const n=Wr.get(e);return n?Gr(n.zone)[n.index]:void 0},Jr=e=>ie(Ao,ot,e),Kr=e=>{if(!Ao.slotsOf||e===le)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=Yr(e.slice(0,n));if(!t)return null;const o=Jr(t).filter(e=>e.rung),r=o.findIndex(t=>t.slot===e.slice(n+1));return r<0?null:{node:t,slot:o[r],position:r}},Xr=(()=>{if(!q(fo))return null;const e=`${fo.nodeId}:${fo.slot}`;return Kr(e)?.slot.panel===fo.kind?e:null})(),_r=un(null);mn(()=>{const e=_r.current;if(_r.current=null,!Xr||!q(fo))return;const n=fo.nodeId;zo(n,{scroll:e!==Xr}),er(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[fo]);const Qr=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=Wr.get(e);n&&(n.zone===le?yi(n.index):Ji(n.zone,n.index,e,Yr(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&Xr!==i&&(_r.current=i),No(null,r),At||Zn({type:"setUi",ui:{rightSideBarVisible:!0}}),gi(o)},qr=(e,n,t)=>{const o=`${e}:${n}`;if(er(n=>{if(!n.has(o)&&!n.has(e))return n;const t=new Set(n);return t.delete(o),t.delete(e),t}),!t)return;Xr!==o&&(_r.current=o);No(null,{kind:t,nodeId:e,slot:n})},Zr=(e,n,t)=>{if(Gn||!Ao.moveSlot)return;const o=Yr(e),r=o?Jr(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:Mn,index:n},s=tn(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=Ao.moveSlot(e,n,s);"string"==typeof d&&qr(e,d,i.panel)},ei=Wo(),ni=fn(()=>{const e=/* @__PURE__ */new Map;for(const n of ei??[])e.set(n.slug,n.name);return e},[ei]),ti=e=>s(e,Er,Do.plainText,e=>ni.get(e),Do.rowName),oi=(e,n)=>{const t=ot.components[e.type]?.fields,o=n===le||pl(n)?"section":"block",r=n===le&&(ut(e)||ft(e)||dt(e.type)),i="block"===o?d(t):r?null:c(t);return Do.renamePropOf?Do.renamePropOf(e,o,i):i},ri=(e,n,t,o)=>{if(!(!Gn&&Ko?.zone===e&&Ko.index===n))return;const r=(t,o)=>{Xo(null),o&&((e,n,t)=>{const o=Gr(e)[n];if(!o)return;const r=oi(o,e);r&&Tt.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
13
+ return Nn("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":gt.rename,onClick:e=>e.stopPropagation(),onBlur:e=>r(e.currentTarget.value,!0),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),r(e.currentTarget.value,!0)):"Escape"===e.key&&(e.preventDefault(),r("",!1))}},t)},ii=n(Z(),wt),li=ii.scope({target:Ke,siteId:En,docId:Xe}),si=ot,di=(e,n)=>n===le?Hr(e):Er(e),ci=(e,n,t)=>{const o=ii.plan(li,t,di(t.type,e),si);o&&(o.changed&&Tt.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),pr(o.message))},ai=b({nodesIn:Gr,nodeAt:(e,n)=>Gr(e)[n]??null,labelOf:(e,n)=>n===le?Hr(e):Er(e),renamePropOf:oi,beginRename:(e,n)=>Xo({zone:e,index:n}),history:{hasPast:et.hasPast,hasFuture:et.hasFuture,back:()=>et.back(),forward:()=>et.forward()},openAddSection:()=>{Tt.select(null),bi(null)},openPageSettings:()=>{Tt.select(null),ho(U)},pageSettingsLabel:gt.pageSettings,words:{menu:vt,styleClipboard:wt,screen:gt.menu},readOnly:Boolean(Gn),collapseAll:()=>er(new Set(Gr(le).map(e=>String(e.props.id)))),onPasteRefused:e=>pr(e?gt.pasteRefused({name:e.label}):gt.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>fl(e,n),menuRows:To.menuRows,isLocked:e=>Mo(e.type),duplicateBlocked:e=>jo(qn.data,e),permits:e=>se(ot,e.type),canAddTo:Vo,nodeOps:Vr,isPinned:(e,n)=>n===le&&(ut(e)||ft(e)),sectionBand:Ar,openAddInside:(e,n)=>{e===le?yi(n):Tt.select({zone:e,index:n}),bi(null)},locate:e=>Wr.get(e)??null,rowNameOf:(e,n)=>n===le?Fr(e):ti(e),selectAt:(e,n,t,o)=>{e===le?yi(n):Ji(e,n,t,o??"")},slotRung:e=>{const n=Kr(e);return n?.slot.panel?{label:n.slot.label,select:()=>Qr(n.node,n.slot,!1)}:null},style:{held:()=>O(li),canCopy:e=>ii.rows(si,e).some(e=>!1!==e.counted),copy:(e,n)=>ii.copy(li,e,di(e.type,n),si),paste:(e,n,t)=>ci(e,n,t)},keys:Kn?{target:no,selected:()=>{const e=qn.ui.itemSelector;return e?{zone:e.zone??le,index:e.index}:null},held:()=>Lr.get(),readOnly:Boolean(Gn),onDone:({done:e,name:n})=>{"copied"===e&&pr(gt.copied({name:n}))}}:void 0},eo),pi=un({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});mn(()=>{pi.current={copy:(e,n)=>ii.copy(li,e,di(e.type,n),si),paste:ci,at:()=>{const e=qn.ui.itemSelector;if(!e)return null;const n=e.zone??le,t=Gr(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(Gn)}});const ui=gn(e=>{const n=N(e);if(!n)return;const t=pi.current,o=t.at();o&&(e.preventDefault(),"copy"===n?t.copy(o.node,o.zone):t.readOnly||t.paste(o.zone,o.index,o.node))},[]);mn(()=>{if(!no)return;const e=e=>ui(e);return no.addEventListener("keydown",e),()=>no.removeEventListener("keydown",e)},[ui,no]),ln(eo,"keydown",ui);const fi=$r.map(e=>e.props.id).join("|");mn(()=>{const e=eo?.document??null,n=eo?.window??null;let t=0;const o=[],r=()=>{if(!e)return void uo(e=>e.length?[]:e);const n=$r.findIndex(ft),t=n>=0?n:$r.length,o=n=>{const t=$r[n]?.props?.id;return null==t?null:e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(rn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=1;e<=t;e++){const n=o(e),t=o(e-1),l=n?.getBoundingClientRect()??null,s=t?.getBoundingClientRect()??null;if(!l&&!s)continue;const d=An(l&&s?(s.bottom+l.top)/2:l?l.top:s.bottom,Math.max(-1/0,...r(t).map(e=>e.bottom)),Math.min(1/0,...r(n).map(e=>e.top)));d&&i.push({...d,index:e})}uo(e=>function(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t].top!==n[t].top||e[t].index!==n[t].index||e[t].height!==n[t].height)return!1;return!0}(e,i)?e:i)},i=()=>{cancelAnimationFrame(t),t=requestAnimationFrame(r)};if(!e||!n)return void r();n.addEventListener("scroll",i,{passive:!0});const l=new ResizeObserver(i);return l.observe(e.documentElement),r(),o.push(setTimeout(r,150),setTimeout(r,450)),()=>{cancelAnimationFrame(t),o.forEach(clearTimeout),n.removeEventListener("scroll",i),l.disconnect()}},[eo,fi,Et,wr,$t,At,nt?.props.id]);const hi=eo?.document??null,mi=eo?.window??null;mn(()=>{const e=qt.current;if(!e||!hi||!mi)return;const n=[],t=()=>{const n=hi.querySelector(`[data-puck-component="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&mi.scrollTo({left:mi.scrollX,top:mi.scrollY+t,behavior:"instant"}),!0};return qt.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[hi,mi]);const gi=e=>{To.holdCanvasOn?To.holdCanvasOn(e):a(e)},yi=e=>{ho(U),Tt.select({index:e}),To.sectionPressed?.($r[e]);const n=$r[e]?.props?.id;n&&gi(n)},ki=e=>{const{floor:n,cap:t}=Ar(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=nt&&fo.kind!==pt?.kind?$r.findIndex(e=>e.props.id===nt.props.id):-1;return o(r>=0?r+1:t)},Si=(e,n)=>{const{floor:t,cap:o}=Ar(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(Tt.reorderComponent(le,e,i),Tt.select({index:i}),{moved:!0,dest:i})},vi=(e,n,t,o)=>{ho(U),Tt.select(o?{index:o.index,zone:o.zone}:{index:e}),a(n),pr(gt.sectionAdded({name:t}))},wi=(e,n)=>{const t=ki(n),o=Lo(e,{nodeDefaults:Dr,newNodeId:fe,sectionLabel:Hr,blockIsOffered:Eo}),r=o?Tt.insertNode(le,t,o):Tt.insertSection(e,t);return vi(t,r,Hr(e),o?((e,n,t)=>{if(e.type===t)return null;const o={at:null},r=(e,n,i)=>{const l=i.filter(n=>n===e.type).length;for(const{child:s,zone:d,index:c}of ce(ot,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=Vo(e.type,l,d.slice(d.lastIndexOf(":")+1)),i=r?.choices??(r?.spec?[{type:r.spec.childType,label:r.spec.childType}]:[]);null!==r&&"footer"!==r.source&&`${e.props.id}:${r.slot}`===d&&i.some(e=>e.type===t)&&(o.at={zone:d,index:c,depth:n})}r(s,n+1,[...i,e.type])}};return r({type:e.type,props:{...e.props,id:n}},1,[]),o.at?{zone:o.at.zone,index:o.at.index}:null})(o,r,e):null),t},xi=(e,n,t)=>{const o=ki(t),r=Tt.insertNode(le,o,n);return vi(o,r,e),o},bi=e=>zi(le,e),zi=(e,n)=>{cr.current=document.activeElement??null,Wt&&(ro.current=io.current,io.current=!1,Ut()),so(null===n?null:{zone:e,index:n}),oo(!0),$t||(ro.current=!0,Zn({type:"setUi",ui:{leftSideBarVisible:!0}}))},Bi=()=>{oo(!1),so(null),ro.current&&Zn({type:"setUi",ui:{leftSideBarVisible:!1}}),ro.current=!1},Ci=(e,n,t)=>{if("section"===e.kind)Tt.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;Tt.insertNode(n,t,Rr(e.template.node))}ho(U),Tt.select({index:t,zone:n})},Oi=(e,n)=>Do.rowName?n?ut(e)?Do.rowName(e,"section",gt.header):ft(e)?Do.rowName(e,"section",gt.footer):dt(e.type)?Do.rowName(e,"section",Er(e.type)):Fr(e):ti(e):n?Hr(e.type):Er(e.type),Ni=e=>n=>{e()},Ii=()=>To.editPinnedSource?.(),Ti=(e,n,t)=>{if(Gn)return null;const o=Gr(e)[n];return o&&!se(ot,o.type).delete?null:/* @__PURE__ */Nn(Oe,{kind:"delete",label:gt.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=Gr(e)[n]?.props?.id;null!=t&&Vr.remove(String(t))})(e,n),children:/* @__PURE__ */Nn(zn,{size:15})})},Pi=e=>Do.rowPreview?.(e)||void 0,$i=e=>Do.rowMarks?.(e)??void 0,Ai=(e,n,t)=>Do.rowActions?.(e,n,t)??null,Mi=(e,n,t,o)=>{if(Gn)return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
14
+ return Nn(Oe,{kind:"eye",label:r?gt.showNamed({name:o}):gt.hideNamed({name:o}),onClick:()=>Ri(e,n,t),children:/* @__PURE__ */Nn(r?Bn:Cn,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},ji=e=>{const n=Hr($r[e]?.type??""),t=n?gt.addSectionBefore({name:n}):gt.addSectionHere;return Al(le,e,()=>bi(e),t)},Ri=(e,n,t)=>{Tt.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},Li=e=>ae(ot,e),Vi=e=>ce(ot,e),Ei=e=>Ao.slotsOf?Jr(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:pe(e,n.slot)})):[{slot:null,rung:null,kids:Vi(e)}],Di=e=>Ao.slotsOf?Ei(e).flatMap(e=>e.kids):Vi(e),Hi=e=>Boolean(Ao.slotsOf)&&Jr(e).some(e=>e.rung),Fi=(e,n,t)=>null===t?void 0===n?Vo(e):Vo(e,n):Vo(e,n,t),Wi=(e,n,t)=>{const o=ue(ot,e.type,n)&&(t||Di(e).length>0||Hi(e));return{collapsible:o,folded:o&&lr(String(e.props.id))}},Ui=(e,n,t)=>Ei(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>Wi(e,r,t(e.type)).collapsible?[String(e.props.id),...Ui(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),Gi=e=>Di(e).length>0||Hi(e)||Boolean(Vo(e.type)),Yi=e=>Boolean(Vo(e)),Ji=(e,n,t,o)=>{if(ho(U),Vo(o)?.spec?.slider){const t=e.split(":")[0];p(t,n),Tt.select({index:n,zone:e}),a(t)}else Tt.select({index:n,zone:e}),gi(t)},Ki=(e,n,t,o,r)=>{const i=`${e}:${n}`;Tt.insertComponent(i,t,o),Vo(r)?.spec?.slider?requestAnimationFrame(()=>{p(e,o),Tt.select({index:o,zone:i})}):Tt.select({index:o,zone:i})},Xi=(e,n,t)=>{Tt.insertComponent(e,n,t),ho(U),Tt.select({index:t,zone:e})},_i=un(/* @__PURE__ */new Set);mn(()=>{$r.forEach(e=>{const n=Vo(e.type)?.spec;if(!n)return;const t=e.props.id;if(_i.current.has(t))return;_i.current.add(t);if((Array.isArray(e.props[n.slot])?e.props[n.slot]:[]).length>0)return;if(n.skipSeed?.(e.props))return;const o=`${t}:${n.slot}`,r=n.legacy?.(e.props)??[];(r.length?r:n.seeds(Dr)).forEach((e,t)=>Ot.seedChild(o,t,n.childType,e))})},[$r,Ot,Dr]);const Qi=un(/* @__PURE__ */new Set);mn(()=>{$r.forEach((n,t)=>{const o=n.props.id;if(Qi.current.has(o))return;const r=e(n,Li(n.type));Qi.current.add(o),r&&Ot.replaceComponent(le,t,{...n,props:r})})},[$r,Ot]),ee(Ot,ot);const qi=$r.findIndex(ft),Zi=qi>=0?$r[qi]:null,el=ht?$r.findIndex(ut):-1,nl=el>=0?$r[el]:null,tl=$r.find(e=>e.type===lt)??null,ol=$r.find(e=>e.type===st)??null,rl=qi>=0?qi:$r.length,il=[];$r.forEach(e=>{ft(e)||(Gi(e)&&il.push(String(e.props.id)),il.push(...Ui(e,1,Yi)))}),Zi&&(il.push(String(Zi.props.id)),il.push(...Ui(Zi,1,Yi)));const ll=il.length>0&&il.every(e=>Zo.has(e)),sl=e=>{const n=Do.blockRowName(e,Er);return Do.rowName?Do.rowName(e,"block",n):n},dl=(e,n,t,o)=>{const r=Gr(e)[t];if(!r)return;const i={...an(e),index:t},l={...an(n),index:Math.min(Math.max(o,0),Gr(n).length)},s=tn(i,l);if(e!==n||s!==t)try{Vr.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof pn))throw e}},cl=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of Vi(e))n.add(r),t(o)};for(const t of Li(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},al=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Wr.get(n);if(!e)return null;if(e.zone===le)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},pl=e=>{const n=e.slice(0,e.indexOf(":")),t=$r.find(e=>dt(e.type)&&String(e.props.id)===n);return t&&ct(n)===e?t:null},ul=(e,n,t)=>{if(e.rung){const t=Yr(e.rung.nodeId),o=t?Jr(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===Mn&&n.index>=0&&n.index<=o}if(n.slot===Mn)return!1;if(e.add)return ml(e.add,n);const o=sn(n);if(dt(e.type))return!1;const r=pl(o),i=pl(e.zone);if(r||i)return!(!r||!i)&&(n.index>=0&&n.index<=Gr(o).length);if(e.zone===le||o===le){if(e.zone!==o)return!1;const{floor:t,cap:r}=Ar();return n.index>=t&&n.index<=r}if(n.index<0||n.index>Gr(o).length)return!1;if(e.zone===o)return!0;const l=Zi&&!rt.lastIsOpen?String(Zi.props.id):null;return(!l||al(e.zone)!==l&&al(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??Gr(e)[t];if(!r)return!1;const i=n.split(":")[0],l=Wr.get(i),s=l?Gr(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&cl(r).has(n))return!1;const d=Vo(s.type,Ro(qn?.data,s.type,i),n.slice(n.lastIndexOf(":")+1));return!!d&&(!!(d.choices?d.choices.some(e=>e.type===r.type):d.spec?.childType===r.type)&&!d.spec?.addBlocked?.(Gr(n),r))})(e.zone,o,e.index,t)},fl=(e,n)=>{const t=sn(e.from);if(t===sn(n))return!0;const o=e.node;return ul({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},hl=e=>{const n=e.slice(0,e.indexOf(":")),t=Wr.get(n),o=t?Gr(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=Vo(o.type,Ro(qn?.data,o.type,n),e.slice(e.lastIndexOf(":")+1));if(!r||`${n}:${r.slot}`!==e)return null;if("footer"===r.source)return null;const i=r.choices??(r.spec?[{type:r.spec.childType,label:Er(r.spec.childType)}]:[]),l=Kr(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:Oi(o,t.zone===le)}},ml=(e,n)=>{const t=sn(n);if("block"!==e.kind){if(pl(t))return n.index>=0&&n.index<=Gr(t).length;if(t!==le)return!1;const{floor:e,cap:o}=Ar();return n.index>=e&&n.index<=o}if(t===le)return!1;const o=hl(t);return!(!o||!o.choices.some(n=>n.type===e.type))&&!o.target.spec?.addBlocked?.(Gr(t))},gl=(e,n)=>{e.rung?Zr(e.rung.nodeId,e.index,n.index):e.add?((e,n)=>{if("block"!==e.kind&&pl(sn(n)))return void Ci(e,sn(n),n.index);if("section"===e.kind)return void wi(e.type,n.index);if("template"===e.kind)return void xi(e.template.name,Rr(e.template.node),n.index);const t=sn(n),o=hl(t);o&&(o.target.spec?Ki(o.parentId,o.target.slot,e.type,n.index,o.parent.type):Xi(t,e.type,n.index))})(e.add,n):e.zone===le?Si(e.index,n.index):dl(e.zone,sn(n),e.index,n.index)},[yl]=hn(()=>en()),kl=nn({keyOf:e=>e.id,readOnly:Boolean(Gn),session:yl,canDrop:ul,onDrop:gl,onStep:(e,n)=>{e.rung?Zr(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===le?((e,n)=>{const t=Hr($r[e]?.type??""),o=Si(e,n<0?e-1:e+2);if(!o.moved)return void pr(n<0?gt.sectionFirst({name:t}):gt.sectionLast({name:t}));const{floor:r,cap:i}=Ar();pr(gt.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):dl(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),Sl=gn(e=>{const{floor:n,cap:t}=Ar(),o=[];for(const r of e.nodes){const e=sn(r.place),i=Gr(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(ut(i)||ft(i)||Mo(i.type))continue;if(dt(i.type))continue;const l=Boolean(pl(e)),s=e===le||l;e===le&&t-n<2||o.push({key:r.id,item:{id:r.id,zone:e,index:r.place.index,type:i.type},box:r.box,label:s?Hr(i.type):ti(i),from:r.place})}return{sources:o,zones:e.zones.filter(e=>e.children.length>0||Boolean(hl(sn(e.list))?.choices.length)||Boolean(pl(sn(e.list))))}},[qn.data]),vl=e=>{ho(U),Tt.select(e.zone===le?{index:e.index}:{index:e.index,zone:e.zone})},wl=ne(),xl=()=>({data:qn.data,device:Et,ops:Tt,inspector:Io}),bl=wl?.model,zl=fn(()=>bl?e=>bl(e,Sl(e),xl()):Sl,[bl,Sl,Et]),Bl=wl?.measure,Cl=Bl?(e,n)=>Bl(e,n,xl()):void 0,Ol=wl?.canDrop,Nl=Ol?(e,n)=>Ol(e,n,ul,xl()):ul,Il=wl?.drop,Tl=Il?(e,n)=>Il(e,n,gl,xl()):gl,Pl=wl?.pick,$l=Pl?e=>Pl(e,vl,xl()):vl,Al=(e,n,t,o)=>/* @__PURE__ */Nn(Ne,{...Gn?{}:kl.seam({place:{...an(e),index:n}}),onAdd:Gn?void 0:t,label:o},`seam:${e}:${n}`),Ml={rowClick:Ni,isCollapsed:lr,toggleCollapse:sr},jl=e=>{const n=String(e.props.id),t=$r.findIndex(e=>String(e.props.id)===n),o=ct(n),r=Gr(o),i=lr(n),l=Er(e.type),s=Do.rowName?Do.rowName(e,"section",l):l,d=e=>Al(o,e,()=>zi(o,e),gt.addSectionHere);/* @__PURE__ */
15
+ return In(Tn,{children:[
16
+ /* @__PURE__ */Nn(be,{words:yt,icon:/* @__PURE__ */Nn(Fo,{type:e.type,size:13}),name:s,preview:Pi(e),marks:$i(e),onSelect:()=>yi(t),nameSlot:ri(le,t,n,s),selected:vo===n,actions:Ai(e,le,t)??void 0,rowProps:{"data-node-id":n,onClick:Ni(()=>yi(t))},fold:{open:!i,label:"section",onToggle:()=>sr(n)}}),!i&&/* @__PURE__ */In(ze,{children:[r.map((n,t)=>{const r=String(n.props.id),i=Fr(n),l=Gi(n),s=l&&lr(r),c=()=>Ji(o,t,r,e.type),{rowProps:a,...p}=kl.row({item:{id:r,zone:o,index:t,type:n.type},place:{...an(o),index:t}},{"data-node-id":r,onClick:Ni(c)});/* @__PURE__ */
17
+ return In(kn,{children:[d(t),
18
+ /* @__PURE__ */Nn(be,{words:yt,icon:/* @__PURE__ */Nn(Fo,{type:n.type,size:13}),name:i,preview:Pi(n),marks:$i(n),onSelect:c,nameSlot:ri(o,t,r,i),selected:vo===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>sr(r)}:void 0,actions:/* @__PURE__ */In(Tn,{children:[Ti(o,t,i),Ai(n,o,t),Mi(o,t,n,i)]}),rowProps:a}),l&&!s&&/* @__PURE__ */Nn(ze,{children:Vl(n,2)})]},r)}),d(r.length)]})]})},Rl=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=kl.dragging,d=!lr(l)&&s?.rung?.nodeId!==i,c={...an(l),index:0},a=s&&!s.rung&&ul(s,c)?c:void 0,p=()=>Qr(e,n,!0),{rowProps:u,...f}=kl.row({item:{id:`rung:${l}`,zone:`${i}:${Mn}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:Mn,index:t},into:a,canDrag:Boolean(Ao.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:Ni(p)}),h=Gn?null:Ao.slotActions?.(e,n.slot);/* @__PURE__ */
19
+ return In(kn,{children:[n.heading,
20
+ /* @__PURE__ */Nn(be,{words:yt,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:Xr===l,...f,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>sr(l)},actions:h&&h.length>0?/* @__PURE__ */Nn(Tn,{children:h.map((t,o)=>/* @__PURE__ */Nn(Oe,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(Gn||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&qr(o,e,n.panel)},i=t.run();i&&"function"==typeof i.then?i.then(r):r(i)})(e,n,t),children:"delete"===t.kind?/* @__PURE__ */Nn(zn,{size:15}):/* @__PURE__ */Nn(On,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */Nn(ze,{children:r})]},l)},Ll=(e,n)=>{const t=Ei(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
21
+ return Nn(Tn,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=Fi(e.type,void 0,t.slot),d=s?`${e.props.id}:${s.slot}`:null,c=null===t.slot?null:`${e.props.id}:${t.slot}`,a=null!==c&&Boolean(hl(c)?.choices.length),p=(e,n)=>a?Al(e,n,()=>zi(e,n),gt.addBlockHere):Al(e,n),u=/* @__PURE__ */In(Tn,{children:[i.map(({child:n,zone:t,index:o})=>{const r=vo===String(n.props.id),{collapsible:i,folded:s}=Wi(n,l,Yi(n.type)),d=String(n.props.id),c=sl(n),a=()=>Ji(t,o,d,e.type),{rowProps:u,...f}=kl.row({item:{id:d,zone:t,index:o,type:n.type},place:{...an(t),index:o}},{"data-node-id":d,onClick:Ni(a)});/* @__PURE__ */
22
+ return In(kn,{children:[0===o&&p(t,0),
23
+ /* @__PURE__ */Nn(be,{words:yt,icon:/* @__PURE__ */Nn(Fo,{type:n.type,size:13}),name:c,preview:Pi(n),marks:$i(n),onSelect:a,nameSlot:ri(t,o,d,c),selected:r,hidden:Boolean(n.props._hidden),...f,fold:i?{open:!s,label:"group",onToggle:()=>sr(d)}:void 0,actions:/* @__PURE__ */In(Tn,{children:[Ti(t,o,c),Ai(n,t,o),Mi(t,o,n,c)]}),rowProps:u}),i&&!s&&/* @__PURE__ */Nn(ze,{children:Ll(n,l+1)}),p(t,o+1)]},String(n.props.id??`${t}-${o}`))}),null===c?d&&!i.some(e=>e.zone===d)?p(d,0):null:0!==i.length||!t.rung&&d!==c?null:p(c,0)]});return t.rung?Rl(e,t.rung,r++,o,u):/* @__PURE__ */Nn(kn,{children:u},t.slot??"")})})},Vl=(e,n)=>{const t=Ro(qn?.data,e.type,String(e.props.id)),o=Ei(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
24
+ return Nn(Tn,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=Fi(e.type,t,o.slot),c=d?.spec??null,a=c&&Array.isArray(e.props[c.slot])?e.props[c.slot]:[],p=d&&d.choices?{slot:d.slot,choices:d.choices}:null,u=String(e.props.id),f=c&&!c.fixed?`${u}:${c.slot}`:null,h=p?`${u}:${p.slot}`:null,m=(n,t)=>{const o=n===f&&c&&!c.addBlocked?.(a)?()=>Ki(e.props.id,c.slot,c.childType,t,e.type):n===h?()=>zi(n,t):void 0;return Al(n,t,o,n===f&&c?c.addLabel:gt.addBlockHere)},g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(c&&!c.fixed&&(null===g||g===f)),k=/* @__PURE__ */In(Tn,{children:[l.map(({child:n,zone:t,index:o})=>{const r=vo===String(n.props.id),i=ti(n),l=String(n.props.id),{collapsible:d,folded:c}=Wi(n,s,Yi(n.type)),a=Li(n.type),p=1===a.length?`${l}:${a[0]}`:null,u=p?{...an(p),index:Gr(p).length}:void 0,f=kl.dragging,h=u&&f&&ul(f,u)?u:void 0,g=()=>Ji(t,o,l,e.type),{rowProps:y,...k}=kl.row({item:{id:l,zone:t,index:o,type:n.type},place:{...an(t),index:o},into:h,canDrag:!Mo(n.type)},{"data-node-id":l,onClick:Ni(g)});/* @__PURE__ */
25
+ return In(kn,{children:[0===o&&m(t,0),
26
+ /* @__PURE__ */Nn(be,{words:yt,icon:/* @__PURE__ */Nn(Fo,{type:n.type,size:13}),name:i,preview:Pi(n),marks:$i(n),onSelect:g,nameSlot:ri(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...k,fold:d?{open:!c,label:"group",onToggle:()=>sr(l)}:void 0,actions:Mo(n.type)?Ai(n,t,o)??void 0:/* @__PURE__ */In(Tn,{children:[Ti(t,o,i),Ai(n,t,o),Mi(t,o,n,i)]}),rowProps:y}),d&&!c&&/* @__PURE__ */Nn(ze,{children:Vl(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&c&&
27
+ /* @__PURE__ */Nn(I,{small:!0,label:c.addLabel,blocked:c.addBlocked?.(a)??null,onAdd:()=>Ki(e.props.id,c.slot,c.childType,a.length,e.type)}),null===g?h&&!l.some(e=>e.zone===h)?m(h,0):null:0!==l.length||(o.rung?y:g!==h)?null:m(g,0)]});return o.rung?Rl(e,o.rung,i++,r,k):/* @__PURE__ */Nn(kn,{children:k},o.slot??"")})})},El=(()=>{if(!nt||!mo)return null;const e=String(nt.type),n=String(nt.props.id),t=Vo(e,Ro(qn?.data,e,n));if(!t||"footer"===t.source)return null;const o=$r.some(e=>String(e.props?.id)===n),r=Array.isArray(nt.props[t.slot])?nt.props[t.slot]:[];if(t.spec?.addBlocked?.(r))return null;const i=t.choices??(t.spec?[{type:t.spec.childType,label:Er(t.spec.childType)}]:[]);return 0===i.length?null:{parentName:Oi(nt,o),choices:i,onPick:o=>{t.spec?Ki(n,t.slot,o,r.length,e):Xi(`${n}:${t.slot}`,o,r.length)}}})(),Dl=ko&&ko.zone!==le&&!pl(ko.zone)?ko.zone:null,Hl=!0===co.blocksFirst,Fl=Dl?hl(Dl):Hl&&ko?null:El,Wl=Boolean(lo&&Dl)||Hl&&Boolean(Fl&&Fl.choices.length>0),Ul=to||null!==Wt,Gl=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:$t&&!Ul&&$o===e.id,onSelect:()=>Nr(e.id)}:e,Yl=[{id:"add",label:gt.add.title,icon:/* @__PURE__ */Nn("span",{className:"sf-rail-plus","aria-hidden":"true",children:"+"}),active:to,onSelect:()=>to?Bi():bi(null)},...(To.railLead??[]).map(Gl),{id:"sections",label:gt.layers,icon:/* @__PURE__ */Nn(Ae,{}),active:$t&&!Ul&&"sections"===$o,onSelect:()=>Nr("sections")},...(To.railTrail??[]).map(Gl)];Ft?Yl.push({id:"media",label:gt.railMedia,icon:/* @__PURE__ */Nn(Me,{}),active:$t&&!to&&(null!==Wt||"media"===$o),onSelect:()=>Nr("media")}):Xn&&Yl.push({id:"media",label:gt.railMedia,icon:/* @__PURE__ */Nn(Me,{}),onSelect:Ir});const Jl=[...To.railLead??[],...To.railTrail??[]].find(e=>"panel"in e&&e.id===$o),Kl=Boolean(mt?.foldable)&&!Po,Xl=mt?.label??(_n?gt.pageSections:gt.templateSections),_l=Kl&&lr(jn),Ql=/* @__PURE__ */In(Tn,{children:[$r.map((e,n)=>{if(ut(e)||ft(e)||dt(e.type))return null;const t=vo===String(e.props.id),o=Boolean(e.props._hidden);Vi(e);const r=String(e.props.id),i=To.hasOwnRows?.(e)??!1,l=Gi(e)||i,s=l&&lr(r),{rowProps:d,...c}=kl.row({item:{id:r,zone:le,index:n,type:e.type},place:{...an(le),index:n}},{"data-node-id":r,onClick:Ni(()=>yi(n))});/* @__PURE__ */
28
+ return In(kn,{children:[n>0&&ji(n),
29
+ /* @__PURE__ */Nn(be,{words:yt,icon:/* @__PURE__ */Nn(Fo,{type:e.type,size:13}),name:Fr(e),preview:Pi(e),marks:$i(e),onSelect:()=>yi(n),nameSlot:ri(le,n,r,Fr(e)),selected:t,hidden:o,...c,fold:l?{open:!s,label:"section",onToggle:()=>sr(r)}:void 0,actions:/* @__PURE__ */In(Tn,{children:[Ti(le,n,Fr(e)),Ai(e,le,n),Mi(le,n,e,Fr(e))]}),rowProps:d}),Gi(e)&&!s&&/* @__PURE__ */In(ze,{children:[Vl(e,1),To.partRows?.(e,Ml)]}),i&&!s&&/* @__PURE__ */Nn(ze,{children:To.ownRows?.(e,n,Ml)})]},String(e.props.id??n))}),!Po&&rl>0&&ji(rl),mt?.addAtEnd&&!Po&&!Gn&&/* @__PURE__ */Nn(I,{small:!0,label:gt.addSection,blocked:null,onAdd:()=>bi(rl)})]}),ql=(e,n,t)=>{const o=String(e.props.id),r=Di(e).length>0||Hi(e)||Boolean(Vo(e.type)),i=r&&lr(o),l="header"===t?gt.header:gt.footer,s=Do.rowName?Do.rowName(e,"section",l):l;/* @__PURE__ */
30
+ return In(Tn,{children:[
31
+ /* @__PURE__ */Nn(be,{words:yt,icon:/* @__PURE__ */Nn(Fo,{type:t,size:13}),name:s,preview:Pi(e),marks:$i(e),onSelect:()=>yi(n),nameSlot:ri(le,n,o,s),selected:vo===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>sr(o)}:void 0,actions:Ai(e,le,n)??void 0,rowProps:{"data-node-id":o,onClick:Ni(()=>yi(n))}}),r&&!i&&/* @__PURE__ */Nn(ze,{children:Ll(e,1)})]})};return(To.wrap??(e=>e))(
32
+ /* @__PURE__ */Nn(te,{target:eo,children:/* @__PURE__ */In("div",{ref:Zt,className:"sf-editor es-editor",style:Je(nr),onContextMenu:ai.onEditorContextMenu,...m(Re),children:[
33
+ /* @__PURE__ */In(Le,{children:[
34
+ /* @__PURE__ */Nn(Ve,{items:Yl,ariaLabel:gt.bar.views}),
35
+ /* @__PURE__ */In(Ee,{children:[
36
+ /* @__PURE__ */Nn(De,{label:gt.bar.undo,disabled:Boolean(Gn)||!et.hasPast,onClick:()=>et.back(),children:/* @__PURE__ */Nn(xn,{})}),
37
+ /* @__PURE__ */Nn(De,{label:gt.bar.redo,disabled:Boolean(Gn)||!et.hasFuture,onClick:()=>et.forward(),children:/* @__PURE__ */Nn(bn,{})}),
38
+ /* @__PURE__ */Nn(He,{}),
39
+ /* @__PURE__ */Nn(Fe,{devices:Mt,value:Et,onChange:Dt})]}),
40
+ /* @__PURE__ */In(Ee,{kind:"right",style:{minWidth:300},children:[
41
+ /* @__PURE__ */Nn(Pn,{saveState:Hn,notSaving:Boolean(Gn)||null!=Fn,readOnlyReason:Yn,toggle:Jn,onToggle:Un,onRetry:Wn,words:gt.bar,saveWords:St}),To.barLead?.(),
42
+ /* @__PURE__ */Nn(Sn,{content:gt.bar.refreshTip,side:"bottom",children:/* @__PURE__ */Nn(vn,{variant:"secondary",onClick:()=>{qt.current=(()=>{const e=eo?.document;if(!e)return null;const n=$r.findIndex(ft),t=n>=0?n:$r.length;let o=null;for(let n=0;n<t;n++){const t=$r[n]?.props?.id;if(null==t)continue;const r=e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`);if(!r)continue;const i=r.getBoundingClientRect().top;i<=4&&(null===o||i>o.offset)&&(o={id:String(t),offset:i})}if(!o){const e=nt?.props?.id??$r[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),Qt(e=>e+1)},children:gt.bar.refresh})}),To.barTrail?.(),To.barMain?To.barMain():/* @__PURE__ */Nn(vn,{variant:"primary",disabled:null!==Yn,onClick:()=>{Dn(qn.data)},children:gt.done})]})]}),
43
+ /* @__PURE__ */Nn(z,{}),
44
+ /* @__PURE__ */In("div",{className:"sf-body",children:[$t?/* @__PURE__ */In(Tn,{children:[
45
+ /* @__PURE__ */Nn("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":gt.leftPanel,children:to?/* @__PURE__ */Nn(T,{blocks:Fl,blocksOnly:Wl,at:lo?{label:(e=>{const n=pl(e.zone);if(n)return gt.add.addingTo({name:Do.rowName?Oi(n,!0):Er(n.type)});if(e.zone===le){const n=$r[e.index];return n&&!ft(n)?gt.add.addingBefore({name:Oi(n,!0)}):gt.add.addingAtEnd}const t=hl(e.zone);return t?gt.add.addingTo({name:t.parentName}):gt.add.addingHere})(lo),onClear:()=>so(null)}:void 0,onAdd:e=>{const n=ko,t=(e,n)=>{lo&&so({zone:e,index:n})};if(n&&"block"!==e.kind&&pl(n.zone))return Ci(e,n.zone,n.index),void t(n.zone,n.index+1);if("section"===e.kind)return(e=>{if(null===So)return void wi(e);const n=wi(e,So);lo&&ao(n+1)})(e.type);if("template"===e.kind)return((e,n)=>{if(null===So)return void xi(e,n);const t=xi(e,n,So);lo&&ao(t+1)})(e.template.name,Rr(e.template.node));if(n&&n.zone!==le){const o=hl(n.zone);if(!o)return;return o.target.spec?Ki(o.parentId,o.target.slot,e.type,n.index,o.parent.type):Xi(n.zone,e.type,n.index),void t(n.zone,n.index+1)}El?.onPick(e.type)},itemFor:e=>({id:`new:${e.kind}:${"template"===e.kind?e.template.id:e.type}`,zone:"",index:-1,type:"template"===e.kind?e.template.node.type:e.type,add:e}),session:yl,siteWide:To.addPanelRow?.(Bi),onClose:Bi,onHide:Cr,readOnly:Boolean(Gn)}):Wt&&Ht?
46
+ /* @__PURE__ */Nn(A,{panel:Ht,pick:Wt,onHide:Cr}):Jl?Jl.panel({onHide:Cr,notify:pr}):"media"===$o&&Ht?/* @__PURE__ */Nn(A,{panel:Ht,pick:null,onHide:Cr}):/* @__PURE__ */In(Tn,{children:[
47
+ /* @__PURE__ */Nn(P,{icon:/* @__PURE__ */Nn(Ae,{}),title:gt.layers,context:bt,actions:il.length>0?/* @__PURE__ */Nn(We,{label:ll?gt.expandAll:gt.collapseAll,onClick:()=>er(e=>{const n=new Set(il);return ll?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...il])}),children:/* @__PURE__ */Nn($n,{expand:ll})}):void 0,onHide:Cr}),
48
+ /* @__PURE__ */In(Be,{className:"sf-tree sf-scroll",words:yt,children:[
49
+ /* @__PURE__ */Nn(be,{words:yt,icon:/* @__PURE__ */Nn(Fo,{type:"page",size:13}),name:gt.pageSettings,onSelect:Tr,selected:!nt&&mo,rowProps:{onClick:Ni(Tr)}}),tl&&/* @__PURE__ */In(Tn,{children:[
50
+ /* @__PURE__ */Nn(Ce,{children:gt.header}),jl(tl)]}),!Po&&Qn&&/* @__PURE__ */In(Tn,{children:[
51
+ /* @__PURE__ */Nn(Ce,{children:gt.header}),!ht&&/* @__PURE__ */Nn(be,{words:yt,icon:/* @__PURE__ */Nn(Fo,{type:"header",size:13}),name:gt.header,onSelect:Pr,selected:fo.kind===pt?.kind,rowProps:{onClick:Ni(Pr)}})]}),!Po&&nl&&ql(nl,el,"header"),!Po&&!Kl&&/* @__PURE__ */Nn(Ce,{children:Xl}),Kl?/* @__PURE__ */In(Tn,{children:[
52
+ /* @__PURE__ */Nn(be,{words:yt,icon:null,name:Xl,fold:{open:!_l,label:Xl,onToggle:()=>sr(jn)}}),!_l&&/* @__PURE__ */Nn(ze,{children:Ql})]}):Ql,Qn&&/* @__PURE__ */Nn(Ce,{children:gt.footer}),Zi&&ql(Zi,qi,"footer"),!Po&&!Zi&&Qn&&/* @__PURE__ */Nn(be,{words:yt,icon:/* @__PURE__ */Nn(Fo,{type:"footer",size:13}),name:gt.footer,onSelect:Ii,rowProps:{onClick:Ni(Ii),title:gt.editFooter}}),ol&&jl(ol),To.treeFoot?.()]})]})}),
53
+ /* @__PURE__ */Nn(Ue,{side:"left",width:nr.left,min:Ye,max:Ge,defaultWidth:k.left,label:gt.resizeLeftPanel,onResize:rr})]}):/* @__PURE__ */Nn($,{side:"left",onShow:Cr}),
54
+ /* @__PURE__ */In("div",{ref:ur,className:"sf-center sf-scroll","data-sf-canvas-head":yr?"":void 0,style:{overflowX:br?"auto":"hidden",overflowY:"hidden"},children:[yr&&/* @__PURE__ */Nn("div",{ref:kr,className:"sf-canvas-head",children:/* @__PURE__ */Nn(yr,{device:Et})}),
55
+ /* @__PURE__ */Nn("div",{className:"sf-frame-scaler",style:zr,children:/* @__PURE__ */Nn("div",{className:"sf-frame "+(Et===Lt?"":`sf-frame--${Et}`),style:Br,children:/* @__PURE__ */In("div",{className:"sf-preview-host",children:[
56
+ /* @__PURE__ */Nn(zt,{},_t),
57
+ /* @__PURE__ */Nn(qe,{canvas:eo,session:yl,model:zl,measure:Cl,canDrop:Nl,onDrop:Tl,onPick:$l,onZoneAdd:e=>{const n=sn(e),t=Kr(n);t&&Qr(t.node,t.slot,!1),zi(n,0)},zoneAddLabel:gt.canvasAddBlock,words:kt.canvas,readOnly:Boolean(Gn),revision:qn.data}),po.length>0&&/* @__PURE__ */Nn("div",{className:"sf-preview-gaps","aria-hidden":"true",children:po.map(e=>/* @__PURE__ */In("button",{type:"button",tabIndex:-1,className:void 0===e.height?"sf-preview-gap":"sf-preview-gap sf-preview-gap--tight",style:void 0===e.height?{top:e.top}:{top:e.top,height:e.height},onClick:()=>bi(e.index),children:[
58
+ /* @__PURE__ */Nn("span",{className:"sf-preview-gap-line"}),
59
+ /* @__PURE__ */In("span",{className:"sf-preview-gap-pill",children:[
60
+ /* @__PURE__ */Nn("span",{className:"sf-preview-gap-plus",children:"+"}),
61
+ /* @__PURE__ */Nn("span",{className:"sf-preview-gap-label",children:gt.addSection})]})]},e.index))})]})})})]}),At?/* @__PURE__ */In(Tn,{children:[
62
+ /* @__PURE__ */Nn(g,{value:{selectChild:Ji,addChild:Ki,childRowName:ti,blockRowName:sl},children:/* @__PURE__ */Nn(Bt,{mode:fo,onOpenWebsiteSettings:To.openSettings??(()=>{}),onOpenSiteStyles:To.openStyles,onSelectNode:Yo,onNotify:pr,onHidePanel:Or,nodeActions:nt?se(ot,nt.type):Rn})}),
63
+ /* @__PURE__ */Nn(Ue,{side:"right",width:nr.right,min:Ye,max:Ge,defaultWidth:k.right,label:gt.resizeSettingsPanel,onResize:ir})]}):
64
+ /* @__PURE__ */Nn($,{side:"right",onShow:Or})]}),ai.menu]})}))}export{Ln as ScreenChrome};
@@ -1 +1 @@
1
- import{useSectionOps as o}from"./chunk-UAVNI3BU.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-5TRBCPRB.js";import{useEasel as p}from"./chunk-PYCLHOSA.js";import{useCallback as d,useEffect as c}from"react";var s=o=>"part"===o.kind;function m({mode:m,setMode:i,onOpenPart:I}){const{getSelectorForId:a}=p(o=>o),u=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}),I?.(t)):i(o=>"part"===o.kind?n:o)},[i,I]);c(()=>{k(l)},[k,l]);const h=s(m)?r(m.nodeId,m.propKey):null;c(()=>{f(h)},[h,f]);return{selectNode:d(o=>{i(()=>n);const e=a(o);e&&u.select(e)},[i,a,u]),openPartId:h}}export{m as usePartBridge};
1
+ import{useSectionOps as o}from"./chunk-LHZIMK3M.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-EJ6QAWRH.js";import{useEasel as p}from"./chunk-PYCLHOSA.js";import{useCallback as d,useEffect as c}from"react";var s=o=>"part"===o.kind;function m({mode:m,setMode:i,onOpenPart:I}){const{getSelectorForId:a}=p(o=>o),u=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}),I?.(t)):i(o=>"part"===o.kind?n:o)},[i,I]);c(()=>{k(l)},[k,l]);const h=s(m)?r(m.nodeId,m.propKey):null;c(()=>{f(h)},[h,f]);return{selectNode:d(o=>{i(()=>n);const e=a(o);e&&u.select(e)},[i,a,u]),openPartId:h}}export{m as usePartBridge};
@@ -0,0 +1,20 @@
1
+ import{FieldSelect as e}from"./chunk-OZ72A6MY.js";import{TreeSeam as n}from"./chunk-UFY6RNMT.js";import{SettingsField as t,SETTINGS_BUCKETS as l,SettingsTabs as a,SettingsGroup as r}from"./chunk-YNOZ5NXW.js";import{DEFAULT_TREE_WORDS as i}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as o}from"./chunk-QTLAVDJE.js";import{EaselMenuItems as s}from"./chunk-EA2HTX37.js";import{FieldNumber as c}from"./chunk-66LWADFP.js";import{SettingsSegmented as d}from"./chunk-QLD57GBB.js";import{DEFAULT_FIELDS_WORDS as u}from"./chunk-FFYXVAAL.js";import{useWords as m}from"./chunk-MFIRYGHW.js";import{useTreeDrag as p,gapToMoveIndex as h}from"./chunk-67GNT6PF.js";import{withTip as b}from"./chunk-P2VEMZH5.js";import{Textarea as f,Input as g,SortableList as v,ListRow as y,ContextMenu as x,tabPanelId as k,tabButtonId as w}from"efficient-shell/ui";export{LinkPicker}from"efficient-shell/ui";import{useRef as N,useState as O,useLayoutEffect as C,useId as j}from"react";import{jsx as D,jsxs as I}from"react/jsx-runtime";import{ChevronIcon as $,LockIcon as S,MoveUpIcon as P,MoveDownIcon as L,DuplicateIcon as F,TrashIcon as M}from"efficient-shell/icons/efficient";function T({id:e,value:n,onChange:t,placeholder:l,multiline:a=!1,rows:r=3,readOnly:i=!1,ariaLabel:o,ariaLabelledBy:s}){const c=n??"";return a?/* @__PURE__ */D(f,{id:e,size:"sm",className:"es-fin",value:c,rows:r,placeholder:l,readOnly:i,"aria-label":o,"aria-labelledby":s,onChange:e=>t(e.target.value)}):/* @__PURE__ */D(g,{id:e,size:"sm",className:"es-fin",type:"text",value:c,placeholder:l,readOnly:i,"aria-label":o,"aria-labelledby":s,onChange:e=>t(e.target.value)})}function A(e,n,t){const l=e.slice();return l.splice(Math.max(0,Math.min(n,l.length)),0,t),l}function E(e,n,t){const l=e.slice(),[a]=l.splice(n,1);return l.splice(Math.max(0,Math.min(t,l.length)),0,a),l}function R(e,n){return e.filter((e,t)=>t!==n)}function z(e){return null===e||"object"!=typeof e?e:JSON.parse(JSON.stringify(e))}var Y='input, textarea, select, button, [contenteditable]:not([contenteditable="false"]), [tabindex]',H={parentId:"list",slot:"items"};function B({label:e,icon:t,noun:l,items:a,onChange:r,newItem:o,summary:c,itemName:d,thumb:f,min:g=0,max:k,readOnly:w=!1,open:j,onOpen:T,renderItem:B,renderRow:K,canRemove:V,lockedReason:X,fixed:G=!1,removeOnRow:J=!0,canDuplicate:Q,above:W,head:Z=!0}){const q=m("fields",u).list,U=m("tree",i),_=l??q.item,ee=!w&&!G&&("number"!=typeof k||a.length<k),ne=a.length<=g,te=e=>!!V&&!V(a[e],e),le=e=>!w&&!G&&J&&!ne&&!te(e),ae=e=>ee&&(!Q||Q(a[e],e)),re=(e,n)=>d?d(e,n):q.itemName({noun:_,n:n+1}),ie=N([]),oe=N(null),[se,ce]=O(null),de=N(null),[ue,me]=O(null),[pe,he]=O("");C(()=>{const e=oe.current;if(!e)return;oe.current=null;const n=ie.current[e.index]?.querySelectorAll(Y)[e.nth]??ie.current[e.index];if(n?.focus(),n&&null!==e.start&&"setSelectionRange"in n)try{n.setSelectionRange(e.start,e.end)}catch{}});const be=(e,n)=>{if(n<0||n>=a.length||n===e)return;const t=ie.current[e],l=t?.ownerDocument.activeElement;if(t&&l&&t.contains(l)){const e=[...t.querySelectorAll(Y)].indexOf(l),a=l;oe.current={index:n,nth:e,start:"number"==typeof a.selectionStart?a.selectionStart:null,end:"number"==typeof a.selectionEnd?a.selectionEnd:null}}r(E(a,e,n));const i=function(e,n,t){return null===e?null:e===n?t:n<e&&t>=e?e-1:n>e&&t<=e?e+1:e}(j,e,n);i!==j&&T(i),he(q.moved({n:n+1,total:a.length}))},fe=e=>{ee&&(r(A(a,e,o())),K?(oe.current={index:e,nth:0,start:null,end:null},null!==j&&j>=e&&T(j+1)):T(e))},ge=e=>{le(e)&&(r(R(a,e)),j===e?T(null):null!==j&&j>e&&T(j-1))},ve=p({keyOf:e=>String(e),canDrop:(e,n)=>n.parentId===H.parentId&&n.slot===H.slot,onDrop:(e,n)=>{const t=h({...H,index:e},n);t!==e&&be(e,t)},onStep:(e,n)=>be(e,e+n),canStep:(e,n)=>e+n>=0&&e+n<a.length,readOnly:w}),ye=e=>{const n=[];return e>0&&n.push({label:q.moveUp,icon:/* @__PURE__ */D(P,{size:14}),shortcut:"⌥↑",onClick:()=>be(e,e-1)}),e<a.length-1&&n.push({label:q.moveDown,icon:/* @__PURE__ */D(L,{size:14}),shortcut:"⌥↓",onClick:()=>be(e,e+1)}),ae(e)&&n.push({label:q.duplicate,icon:/* @__PURE__ */D(F,{size:14}),onClick:()=>(e=>{ae(e)&&(r(A(a,e+1,z(a[e]))),null!==j&&j>e&&T(j+1))})(e)}),le(e)&&n.push({label:q.delete,icon:/* @__PURE__ */D(M,{size:14}),danger:!0,onClick:()=>ge(e)}),n},xe=(e,n,t,l)=>{w||0===ye(e).length||me({index:e,x:n,y:t,owner:l})},ke=e=>n=>{const t=a.slice();t[e]=n,r(t)};/* @__PURE__ */
2
+ return I("div",{className:"es-list",children:[Z?/* @__PURE__ */I("div",{className:"es-list-head",children:[
3
+ /* @__PURE__ */I("span",{className:"es-list-label",children:[t?/* @__PURE__ */D("span",{className:"es-field-icon","aria-hidden":"true",children:t}):null,e]}),
4
+ /* @__PURE__ */D("span",{className:"es-list-count",children:a.length})]}):null,W?/* @__PURE__ */D("div",{className:"es-list-above",children:W}):null,a.length?/* @__PURE__ */I(v,{"aria-label":e,spacing:"comfortable",className:"es-list-rows",rootProps:ve.rootProps(),children:[a.map((e,t)=>{const l=ve.row({item:t,place:{...H,index:t}}),a=l.draggable&&se!==t,r=!K&&j===t,i=!w&&!G&&J&&te(t),o=["es-list-row",K?"is-inline":"is-item",r?"is-open":"",a?"is-draggable":"",l.dragging?"is-dragging":"",l.drop?`is-drop-${l.drop}`:""].filter(Boolean).join(" ");return[t>0?/* @__PURE__ */D(n,{...ve.seam({place:{...H,index:t}}),onAdd:ee?()=>fe(t):void 0,label:q.addHere({noun:_})},`seam-${t}`):null,
5
+ /* @__PURE__ */D(y,{className:o,flat:!!K,active:r,draggable:l.draggable,dragHint:U.dragHint,dragging:l.dragging,drop:"before"===l.drop||"after"===l.drop?l.drop:void 0,onMove:l.draggable?e=>be(t,"up"===e?t-1:t+1):void 0,rowRef:e=>{ie.current[t]=e},rowProps:{...l.rowProps,draggable:a||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=l.draggable&&!a,de.current=n&&!a?n:null,ce(a?t:null)},onDragStart:e=>{const n=de.current;de.current=null,n&&n.ownerDocument.activeElement===n&&n.blur(),l.rowProps.onDragStart?.(e)},onContextMenu:e=>{w||(e.preventDefault(),e.stopPropagation(),xe(t,e.clientX,e.clientY,e.currentTarget))},onKeyDown:e=>{if("ContextMenu"===e.key||e.shiftKey&&"F10"===e.key){e.preventDefault();const n=e.currentTarget.ownerDocument,l=e=>e.preventDefault();n.addEventListener("contextmenu",l,{capture:!0,once:!0}),n.defaultView?.setTimeout(()=>n.removeEventListener("contextmenu",l,{capture:!0}),500);const a=e.currentTarget.getBoundingClientRect();return void xe(t,a.left+24,a.bottom,e.currentTarget)}l.rowProps.onKeyDown?.(e)}},actions:w||G||!J?void 0:i?b(X?X(e,t):q.locked,/* @__PURE__ */D("span",{className:"es-list-lock",role:"img","aria-label":X?X(e,t):q.locked,children:/* @__PURE__ */D(S,{size:13})})):b(q.deleteItem({noun:_}),/* @__PURE__ */D("button",{type:"button",className:"es-list-x","aria-label":q.deleteItem({noun:_}),disabled:!le(t),onClick:()=>ge(t),children:"×"})),below:r?/* @__PURE__ */D("div",{className:"es-list-item",children:B(e,t,ke(t))}):void 0,children:K?/* @__PURE__ */D("div",{className:"es-list-row-main",children:K(e,t,ke(t))}):/* @__PURE__ */I("button",{type:"button",className:"es-list-open","aria-expanded":r,onClick:()=>T(r?null:t),children:[f?/* @__PURE__ */D("span",{className:"es-list-thumb","aria-hidden":"true",children:f(e,t)}):null,
6
+ /* @__PURE__ */D("span",{className:"es-list-row-name",children:re(e,t)}),/* @__PURE__ */D("span",c?{className:"es-list-row-summary",children:c(e,t)}:{className:"es-list-row-summary"}),
7
+ /* @__PURE__ */D($,{size:14,className:"es-list-chev","aria-hidden":"true"})]})},t)]}),
8
+ /* @__PURE__ */D(n,{...ve.seam({place:{...H,index:a.length}})})]}):null,w||G?null:/* @__PURE__ */D("button",{type:"button",className:"es-list-add",disabled:!ee,onClick:()=>fe(a.length),children:q.add({noun:_})}),
9
+ /* @__PURE__ */D("span",{className:"es-list-said","aria-live":"polite",children:pe}),ue&&ue.index<a.length?
10
+ /* @__PURE__ */D(x,{at:{x:ue.x,y:ue.y},owner:ue.owner,onClose:()=>me(null),children:/* @__PURE__ */D(s,{items:ye(ue.index),onClose:()=>me(null)})}):null]})}var K=(e,n)=>"string"==typeof e.label&&e.label?e.label:n;function V({field:e,name:n,id:t,value:l,onChange:a,readOnly:i,context:o,renderers:s}){const[c,d]=O(!0),u=l&&"object"==typeof l?l:{};/* @__PURE__ */
11
+ return D(r,{id:`${t}-group`,title:K(e,n),open:c,onToggle:d,children:Object.entries(e.objectFields).map(([e,l])=>/* @__PURE__ */D(G,{field:l,name:`${n}.${e}`,id:`${t}-${e}`,value:u[e],onChange:n=>a({...u,[e]:n}),readOnly:i,context:o,renderers:s},e))})}function X({field:e,name:n,id:t,value:l,onChange:a,readOnly:r,context:i,renderers:o,openItem:s,onOpenItem:c}){const[d,u]=O(null),m=c?s??null:d,p=c??u,h=Array.isArray(l)?l:[],b=e.getItemSummary;/* @__PURE__ */
12
+ return D(B,{label:K(e,n),icon:e.icon,noun:"string"==typeof e.noun?e.noun:void 0,items:h,onChange:a,newItem:()=>z({...e.defaultItemProps??{}}),summary:b?(e,n)=>b(e,n):void 0,min:e.min,max:e.max,readOnly:r,open:m,onOpen:p,renderItem:(l,a,s)=>Object.entries(e.arrayFields).map(([e,c])=>/* @__PURE__ */D(G,{field:c,name:`${n}[${a}].${e}`,id:`${t}-${a}-${e}`,value:l?.[e],onChange:n=>s({...l,[e]:n}),readOnly:r,context:i,renderers:o},e))})}function G(n){const{field:l,name:a,id:r,value:i,onChange:o,readOnly:s,context:u,renderers:m}=n;if(!l||l.marker||!1===l.visible)return null;const p=m?.[l.type];if(p)return p({field:l,name:a,id:r,value:i,onChange:o,readOnly:s});switch(l.type){case"custom":{const e={...u,field:l,name:a,id:r,value:i,onChange:o,readOnly:s};return l.render(e)}case"text":case"textarea":/* @__PURE__ */
13
+ return D(t,{label:K(l,a),htmlFor:r,icon:l.icon,hint:l.hint,children:/* @__PURE__ */D(T,{id:r,value:"string"==typeof i?i:null==i?"":String(i),onChange:o,placeholder:l.placeholder,multiline:"textarea"===l.type,readOnly:s})});case"number":/* @__PURE__ */
14
+ return D(t,{label:K(l,a),htmlFor:r,icon:l.icon,hint:l.hint,children:/* @__PURE__ */D(c,{id:r,value:"number"==typeof i?i:void 0,onChange:o,min:l.min,max:l.max,step:l.step,placeholder:l.placeholder,readOnly:s})});case"select":{const n=`${r}-label`;/* @__PURE__ */
15
+ return D(t,{label:K(l,a),labelId:n,htmlFor:r,icon:l.icon,hint:l.hint,children:/* @__PURE__ */D(e,{id:r,value:i,options:l.options,onChange:o,readOnly:s,ariaLabelledBy:n})})}case"radio":/* @__PURE__ */
16
+ return D(t,{label:K(l,a),icon:l.icon,hint:l.hint,children:/* @__PURE__ */D(d,{ariaLabel:K(l,a),value:i,options:l.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 D(V,{...n,field:l});case"array":/* @__PURE__ */
18
+ return D(X,{...n,field:l});case"slot":return null}}var J=e=>l.includes(e);function Q(e){let n=l[0];const t=[],a=/* @__PURE__ */new Set;for(const[l,r]of Object.entries(e))r&&(J(r.bucket)&&(n=r.bucket),r.marker||!1===r.visible||(t.push({name:l,field:r,bucket:n}),"slot"!==r.type&&a.add(n)));return{rows:t,buckets:l.filter(e=>a.has(e))}}function W(e){return new Map(Q(e).rows.map(e=>[e.name,e.bucket]))}function Z({fields:e,values:n,onChange:t,readOnly:l=!1,context:r,tab:i,onTab:s,tabs:c=!0,tabIcons:d,renderers:u,idPrefix:p,ariaLabel:h,children:b}){const f=m("panel",o),g=j(),v=p??`es-insp${g.replace(/:/g,"")}`,y=Q(e),[x,N]=O(void 0),C=i??x,$=C&&y.buckets.includes(C)?C:y.buckets[0],[S,P]=O(null),L=S&&S.panel===v&&y.rows.some(e=>e.name===S.name)?S:null,F=c&&y.buckets.length>1,M=F&&$?k(v,$):`${v}-rows`;/* @__PURE__ */
19
+ return I("div",{className:"es-insp",children:[F?/* @__PURE__ */D("div",{className:"es-insp-tabs",children:/* @__PURE__ */D(a,{ariaLabel:h??f.settings,activeId:$,onSelect:e=>{const n=e;void 0===i&&N(n),s?.(n)},items:y.buckets.map(e=>({id:e,label:f.buckets[e],icon:d?.[e]})),idPrefix:v})}):null,
20
+ /* @__PURE__ */I("div",{className:"es-insp-rows",id:M,role:F?"tabpanel":void 0,"aria-labelledby":F&&$?w(v,$):void 0,children:[y.rows.map(({name:e,field:a,bucket:i})=>/* @__PURE__ */D("div",{className:"es-insp-row","data-field":e,"data-bucket":i,hidden:!(!F||i===$)||void 0,children:/* @__PURE__ */D(G,{field:a,name:e,id:`${v}-${e}`,value:n[e],onChange:n=>t(e,n),readOnly:l,context:r,renderers:u,openItem:L&&L.name===e?L.index:null,onOpenItem:n=>P(null===n?null:{panel:v,name:e,index:n})})},e)),b]})]})}export{T as FieldText,Z as Inspector,G as InspectorField,B as ListField,W as bucketsOf,z as copyItem,A as insertAt,K as labelOf,E as moveTo,Q as planFields,R as removeAt};
@@ -1 +1 @@
1
- import{useScreenDocument as n}from"./chunk-ONRYLR2D.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-E2O2MRZR.js";import{EditNotice as r}from"./chunk-OXYGFK2B.js";import{useWords as e}from"./chunk-MFIRYGHW.js";import{jsx as i}from"react/jsx-runtime";function t(){const{capabilities:t,access:c,takeOverEditing:a,viewReadOnly:s,saveConflict:m,reloadFromServer:u}=n(),{noun:l}=e("screen",o);return t.hasEditGuard?/* @__PURE__ */i(r,{access:c,conflict:m,noun:l,onTakeOver:a,onViewReadOnly:s,onReload:u}):null}export{t as PageEditGuardNotices};
1
+ import{useScreenDocument as n}from"./chunk-VGV5D667.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-LYALMY55.js";import{EditNotice as r}from"./chunk-GTDLBUOC.js";import{useWords as e}from"./chunk-MFIRYGHW.js";import{jsx as i}from"react/jsx-runtime";function t(){const{capabilities:t,access:c,takeOverEditing:a,viewReadOnly:s,saveConflict:m,reloadFromServer:u}=n(),{noun:l}=e("screen",o);return t.hasEditGuard?/* @__PURE__ */i(r,{access:c,conflict:m,noun:l,onTakeOver:a,onViewReadOnly:s,onReload:u}):null}export{t as PageEditGuardNotices};
@@ -0,0 +1,5 @@
1
+ import{slotFieldsOf as n}from"./chunk-PLVEGYK6.js";import{usePickFollowsSelection as e}from"./chunk-R6WTQWAC.js";import{EaselCanvas as t,useSelectedFields as r}from"./chunk-PYCLHOSA.js";import{Inspector as i}from"./chunk-CRPJGCSO.js";import{createContext as o,useContext as u}from"react";import{DesktopIcon as l}from"efficient-shell/icons/efficient";import{jsx as s}from"react/jsx-runtime";var c={kind:"puck"};function f(n,e){const t=n,r=e,i=Object.keys(t);return i.length===Object.keys(r).length&&i.every(n=>Object.is(t[n],r[n]))}function a(n){const e=n;return"string"==typeof e.nodeId&&"string"==typeof e.slot}function d(e,t,r){const i=e.slotsOf?.(r);return i||n(t,r.type).map(n=>({slot:n,label:n,rung:!1}))}function p(n,e){return n.isFirst?n.isFirst(e):e.type===n.first}function m(n,e){return n.isLast?n.isLast(e):e.type===n.last}var k={},h={},v=()=>k,g=()=>"",y=()=>null,b=()=>{},O={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},C={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},L={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */s(l,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},S={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},j={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function w(){/* @__PURE__ */
2
+ return s(t,{height:"fill"})}function P(){const{id:n,fields:e,values:t,readOnly:o,onChange:u}=r();/* @__PURE__ */
3
+ return s("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */s(i,{fields:e,values:t,onChange:u,readOnly:o,idPrefix:n})})}var G=o({});function D({parts:n,children:e}){/* @__PURE__ */
4
+ return s(G.Provider,{value:n,children:e})}function N(){return u(G)}function x(){return(N().useOwnerName??g)()}function A(){return(N().useDocumentLabel??y)()}function B(n,e,t,r){return(N().useBridges??v)(n,e,t,r)}function I(n){return(N().useStandaloneBridges??v)(n)}function R(n,e){(N().useDocumentPass??b)(n,e)}function T(){return N().blockRules??O}function F(){return N().blockLook??C}function H(){return N().devices??L}function K(){return N().leftView??S}function V(){return N().pinned??j}function W(){return N().saveSwitch??!0}function Y(n){e(!0===N().pickFollowsSelection,n)}function E(){return N().add??h}function J(){return N().storageNamespace||void 0}function Q(){return N().styleClipboard??null}function Z(){return N().nodeKeys??!0}function q(){return N().notify??null}function z(){return N().Canvas??w}function M(){return N().CanvasHead??null}function U(){return N().canvasDrag??null}var X=o(null);function $({target:n,children:e}){/* @__PURE__ */
5
+ return s(X.Provider,{value:n,children:e})}function _(){return u(X)}function nn(){return N().Inspector??P}export{c as SELECTION_MODE,$ as ScreenCanvasTargetProvider,D as ScreenPartsProvider,p as isPinnedFirst,m as isPinnedLast,a as isSlotMode,f as sameInspectorMode,d as screenSlotsOf,E as useScreenAdd,F as useScreenBlockLook,T as useScreenBlockRules,B as useScreenBridges,U as useScreenCanvasDrag,z as useScreenCanvasFrame,M as useScreenCanvasHead,_ as useScreenCanvasTarget,H as useScreenDevices,A as useScreenDocumentLabel,R as useScreenDocumentPass,nn as useScreenInspectorPanel,K as useScreenLeftView,Z as useScreenNodeKeys,q as useScreenNotify,x as useScreenOwnerName,N as useScreenParts,Y as useScreenPickFollowsSelection,V as useScreenPinned,W as useScreenSaveSwitch,J as useScreenStorageNamespace,Q as useScreenStyleClipboard,I as useStandaloneScreenBridges};
@@ -0,0 +1 @@
1
+ var e={less:"Less",more:"More",choose:"Choose…",search:"Search…",noMatches:"No matches",list:{item:"item",itemName:({noun:e,n:o})=>{return`${t=e,t?t[0].toUpperCase()+t.slice(1):t} ${o}`;var t},position:({n:e,total:o})=>`${e} of ${o}`,duplicate:"Duplicate",duplicateItem:({noun:e})=>`Duplicate ${e}`,deleteItem:({noun:e})=>`Delete ${e}`,add:({noun:e})=>`+ Add ${e}`,addHere:({noun:e})=>`Add ${e} here`,moveUp:"Move up",moveDown:"Move down",delete:"Delete",locked:"This one cannot be removed",moved:({n:e,total:o})=>`Moved to ${e} of ${o}`}};export{e as DEFAULT_FIELDS_WORDS};
@@ -1,9 +1,9 @@
1
- import{DEFAULT_NOTICE_WORDS as e,DEFAULT_CHROME_WORDS as n}from"./chunk-ZJEBF4NB.js";import{holderOf as i,describeAge as a,nameOrSomeone as s}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as t}from"./chunk-RE4LP46F.js";import{EaselRail as l}from"./chunk-MJM6SFD3.js";import{DEFAULT_RAIL_WORDS as r}from"./chunk-2OAZYSWJ.js";import{useWords as o}from"./chunk-MFIRYGHW.js";import{jsx as c,jsxs as d,Fragment as u}from"react/jsx-runtime";import{Tooltip as h,IconButton as m,Segmented as v,Switch as f,ResizeHandle as k,Button as p,Banner as b}from"efficient-shell/ui";import{PanelLeftIcon as g,PanelRightIcon as y,MediaIcon as N,ImageIcon as w}from"efficient-shell/icons/efficient";function C({children:e}){/* @__PURE__ */
1
+ import{DEFAULT_NOTICE_WORDS as e,DEFAULT_CHROME_WORDS as n}from"./chunk-Y2G7CU6A.js";import{holderOf as i,describeAge as a,nameOrSomeone as s}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as t}from"./chunk-RE4LP46F.js";import{EaselRail as l}from"./chunk-MJM6SFD3.js";import{DEFAULT_RAIL_WORDS as r}from"./chunk-2OAZYSWJ.js";import{useWords as o}from"./chunk-MFIRYGHW.js";import{jsx as c,jsxs as d,Fragment as u}from"react/jsx-runtime";import{Tooltip as h,IconButton as m,Segmented as v,Switch as f,ResizeHandle as k,Button as p,Banner as b}from"efficient-shell/ui";import{PanelLeftIcon as g,PanelRightIcon as y,MediaIcon as N,ImageIcon as w}from"efficient-shell/icons/efficient";function C({children:e}){/* @__PURE__ */
2
2
  return c("div",{className:"es-topbar",children:e})}function O({kind:e,style:n,children:i}){/* @__PURE__ */
3
3
  return c("div",{className:e?`es-cluster es-cluster--${e}`:"es-cluster",style:n,children:i})}function x(){/* @__PURE__ */
4
4
  return c("div",{className:"es-divider-v","aria-hidden":"true"})}function z({items:e,ariaLabel:n,onWords:i}){const a=o("rail",r);/* @__PURE__ */
5
- return c("div",{className:"es-cluster es-cluster--rail es-rail-fit",children:/* @__PURE__ */c(l,{items:e,ariaLabel:n??a.label,orientation:"row",onLabelsShown:i})})}function B({label:e,onClick:n,disabled:i,state:a,buttonRef:s,children:t}){/* @__PURE__ */
6
- return c(h,{content:e,side:"bottom",children:/* @__PURE__ */c(m,{ref:s,"aria-label":e,"aria-pressed":a?"active"===a:void 0,className:"es-iconbtn",disabled:i,onClick:n,children:t})})}function R({devices:e,value:i,onChange:a,ariaLabel:s}){const t=o("chrome",n);/* @__PURE__ */
5
+ return c("div",{className:"es-cluster es-cluster--rail es-rail-fit",children:/* @__PURE__ */c(l,{items:e,ariaLabel:n??a.label,orientation:"row",onLabelsShown:i})})}function R({label:e,onClick:n,disabled:i,state:a,buttonRef:s,children:t}){/* @__PURE__ */
6
+ return c(h,{content:e,side:"bottom",children:/* @__PURE__ */c(m,{ref:s,"aria-label":e,"aria-pressed":a?"active"===a:void 0,className:"es-iconbtn",disabled:i,onClick:n,children:t})})}function B({devices:e,value:i,onChange:a,ariaLabel:s}){const t=o("chrome",n);/* @__PURE__ */
7
7
  return c(v,{className:"es-devseg",size:"sm",label:s??t.device,value:i,onChange:e=>{e!==i&&a(e)},options:e.map(e=>({value:e.id,icon:/* @__PURE__ */c(h,{content:e.label,side:"bottom",children:/* @__PURE__ */c("span",{className:"es-devseg-glyph","aria-hidden":"true",children:e.icon})}),label:/* @__PURE__ */c("span",{className:"es-vh",children:e.label})}))})}var L={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:i,waitMs:a,ringRef:s,role:t}){/* @__PURE__ */
8
8
  return d("span",{className:`es-savestate ${L[e]}`,role:t,"aria-live":"polite",children:[/* @__PURE__ */c("span",i?{ref:s,className:"es-savestate-ring is-counting",style:void 0!==a?{"--es-savewait":`${a}ms`}:void 0,"aria-hidden":"true"}:{className:"es-savestate-dot","aria-hidden":"true"}),n]})}function W({pressed:e,title:n,onToggle:i,children:a}){/* @__PURE__ */
9
9
  return c("span",{className:"es-savestate-toggle",children:/* @__PURE__ */c(h,{content:n,side:"bottom",children:/* @__PURE__ */c(f,{size:"sm",checked:!e,"aria-label":n,label:a,onChange:()=>i()})})})}function j({side:e,width:i,min:a,max:s,defaultWidth:t,label:l,onResize:r}){const d=o("chrome",n);/* @__PURE__ */
@@ -13,9 +13,9 @@ return d("div",{className:"es-insp-head",children:[
13
13
  /* @__PURE__ */d("div",{className:"es-insp-titles",children:[
14
14
  /* @__PURE__ */c("h2",{className:"es-insp-name",children:n}),
15
15
  /* @__PURE__ */c("div",{className:"es-insp-kind",children:i})]}),a?/* @__PURE__ */c("div",{className:"es-insp-actions",children:a}):null]})}function S({label:e,title:n,hasPopup:i,onClick:a,disabled:s,danger:t,expanded:l,buttonRef:r,children:o}){/* @__PURE__ */
16
- return c(h,{content:n??e,side:"bottom",children:/* @__PURE__ */c(m,{ref:r,variant:t?"ghost-danger":"ghost",className:"es-insp-iconbtn","aria-label":e,"aria-haspopup":i,"aria-expanded":l,disabled:s,onClick:a,children:o})})}function P({name:e,onSelect:i,label:a,inline:s}){const t=o("chrome",n),l=a??t.upLevel,r=/* @__PURE__ */c(h,{content:l,side:"bottom",children:/* @__PURE__ */c(p,{variant:"link",size:"sm",className:"es-insp-up-btn","aria-label":t.upLevelTo({label:l,name:e}),leftIcon:/* @__PURE__ */c("span",{className:"es-insp-up-arrow","aria-hidden":"true",children:"←"}),onClick:i,children:/* @__PURE__ */c("span",{className:"es-insp-up-name",children:e})})});return s?r:/* @__PURE__ */c("div",{className:"es-insp-up",children:r})}function F({context:e,pick:i,onCancel:a,onHide:s,side:t="left"}){const l=o("chrome",n),r=s?/* @__PURE__ */c(S,{label:l.hidePanelLabel({side:t}),title:l.hidePanel,onClick:s,children:/* @__PURE__ */c("left"===t?g:y,{size:16})}):null;if(!i)/* @__PURE__ */
16
+ return c(h,{content:n??e,side:"bottom",children:/* @__PURE__ */c(m,{ref:r,variant:t?"ghost-danger":"ghost",className:"es-insp-iconbtn","aria-label":e,"aria-haspopup":i,"aria-expanded":l,disabled:s,onClick:a,children:o})})}function P({name:e,onSelect:i,label:a,inline:s}){const t=o("chrome",n),l=a??t.upLevel,r=/* @__PURE__ */c(h,{content:l,side:"bottom",children:/* @__PURE__ */c(p,{variant:"link",size:"sm",className:"es-insp-up-btn","aria-label":t.upLevelTo({label:l,name:e}),leftIcon:/* @__PURE__ */c("span",{className:"es-insp-up-arrow","aria-hidden":"true",children:"←"}),onClick:i,children:/* @__PURE__ */c("span",{className:"es-insp-up-name",children:e})})});return s?r:/* @__PURE__ */c("div",{className:"es-insp-up",children:r})}function Y({context:e,pick:i,onCancel:a,onHide:s,side:t="left"}){const l=o("chrome",n),r=s?/* @__PURE__ */c(S,{label:l.hidePanelLabel({side:t}),title:l.hidePanel,onClick:s,children:/* @__PURE__ */c("left"===t?g:y,{size:16})}):null;if(!i)/* @__PURE__ */
17
17
  return c(M,{icon:/* @__PURE__ */c(N,{}),name:l.mediaLibrary,kind:e,actions:r??void 0});const m=l.mediaKinds[i.kind];/* @__PURE__ */
18
18
  return c(M,{icon:/* @__PURE__ */c(w,{size:15}),name:l.mediaChoose({kind:m}),kind:i.field?l.mediaFor({field:i.field}):e,actions:/* @__PURE__ */d(u,{children:[
19
19
  /* @__PURE__ */c(h,{content:l.mediaKeep({kind:m}),side:"bottom",children:/* @__PURE__ */c(p,{variant:"secondary",size:"sm",className:"es-insp-textbtn",onClick:a,children:l.mediaCancel})}),r?/* @__PURE__ */d(u,{children:[
20
- /* @__PURE__ */c("span",{className:"es-insp-divider","aria-hidden":"true"}),r]}):null]})})}function T(e){return/svg/i.test(e)?"svg":e.startsWith("video")?"video":"image"}var Y={notice:e,lock:t};function H(e,n,t,l=Y){const r=l.notice,o=i(e),c={kind:"reload",label:r.reload};if(n){const e=a(n.secondsAgo,l.lock);return{tone:"warning",urgent:!0,lead:n.savedByYou?r.savedByYou({noun:t,when:e}):r.savedByOther({name:s(n.savedBy,l.lock),noun:t,when:e}),body:r.conflictBody,actions:o?[c,{kind:"take-over",label:r.takeOver,title:r.takeOverWhileDeciding}]:[c]}}if(!o)return null;const d=s(o.name,l.lock),u=a(o.secondsSinceSeen,l.lock);switch(e.kind){case"takenover":return{tone:"warning",urgent:!0,lead:r.tookOver({name:d,noun:t,when:a(o.secondsSinceHeld,l.lock)}),body:r.tookOverBody,actions:[{kind:"take-back",label:r.takeBack},c]};case"readonly":return{tone:"neutral",urgent:!1,lead:r.viewingOnly,body:r.viewingOnlyBody({name:d,noun:t,seen:u}),actions:[{kind:"take-over",label:r.takeOver}]};default:return{tone:"warning",urgent:!1,lead:r.editing({name:d,noun:t}),body:r.editingBody({seen:u}),actions:[{kind:"view-read-only",label:r.viewReadOnly},{kind:"take-over",label:r.takeOver,title:r.takeOverTold}]}}}function J({access:n,conflict:i,noun:a,onTakeOver:s,onViewReadOnly:l,onReload:r}){const d=H(n,i,a,{notice:o("notice",e),lock:o("lock",t)});if(!d)return null;const u={reload:r,"take-over":s,"take-back":s,"view-read-only":l},m=d.actions.map(e=>e.title?/* @__PURE__ */c(h,{content:e.title,side:"bottom",children:/* @__PURE__ */c(p,{variant:"secondary",size:"sm",onClick:u[e.kind],children:e.label})},e.kind):/* @__PURE__ */c(p,{variant:"secondary",size:"sm",onClick:u[e.kind],children:e.label},e.kind));/* @__PURE__ */
21
- return c("div",{className:`es-notice is-${d.tone}`,role:d.urgent?"alert":"status",children:/* @__PURE__ */c(b,{tone:"warning"===d.tone?"warning":"info",title:d.lead,action:/* @__PURE__ */c("span",{className:"es-notice-actions",children:m}),children:d.body})})}var Z={left:288,right:320},q=220,A=560;function D(e){return Math.min(560,Math.max(220,Math.round(e)))}function E(e){return{"--es-left-w":`${e.left}px`,"--es-right-w":`${e.right}px`}}function I(e,n){e.style.setProperty("--es-left-w",`${n.left}px`),e.style.setProperty("--es-right-w",`${n.right}px`)}export{Z as DEFAULT_PANEL_W,R as DeviceSwitch,B as EaselIconButton,C as EaselTopBar,J as EditNotice,M as InspectorHead,S as InspectorIconButton,P as InspectorUpLevel,A as MAX_PANEL_W,q as MIN_PANEL_W,F as MediaPanelHead,j as PanelResizeHandle,$ as SaveState,W as SaveStateToggle,O as TopBarCluster,x as TopBarDivider,z as TopBarRail,D as clampPanelWidth,H as editNotice,T as mediaPickKind,E as panelWidthVars,I as setPanelWidthVars};
20
+ /* @__PURE__ */c("span",{className:"es-insp-divider","aria-hidden":"true"}),r]}):null]})})}function T(e){return/svg/i.test(e)?"svg":e.startsWith("video")?"video":"image"}var F={notice:e,lock:t};function H(e,n,t,l=F){const r=l.notice,o=i(e),c={kind:"reload",label:r.reload};if(n){const e=a(n.secondsAgo,l.lock);return{tone:"warning",urgent:!0,lead:n.savedByYou?r.savedByYou({noun:t,when:e}):r.savedByOther({name:s(n.savedBy,l.lock),noun:t,when:e}),body:r.conflictBody,actions:o?[c,{kind:"take-over",label:r.takeOver,title:r.takeOverWhileDeciding}]:[c]}}if(!o)return null;const d=s(o.name,l.lock),u=a(o.secondsSinceSeen,l.lock);switch(e.kind){case"takenover":return{tone:"warning",urgent:!0,lead:r.tookOver({name:d,noun:t,when:a(o.secondsSinceHeld,l.lock)}),body:r.tookOverBody,actions:[{kind:"take-back",label:r.takeBack},c]};case"readonly":return{tone:"neutral",urgent:!1,lead:r.viewingOnly,body:r.viewingOnlyBody({name:d,noun:t,seen:u}),actions:[{kind:"take-over",label:r.takeOver}]};default:return{tone:"warning",urgent:!1,lead:r.editing({name:d,noun:t}),body:r.editingBody({seen:u}),actions:[{kind:"view-read-only",label:r.viewReadOnly},{kind:"take-over",label:r.takeOver,title:r.takeOverTold}]}}}function A({access:n,conflict:i,noun:a,onTakeOver:s,onViewReadOnly:l,onReload:r}){const d=H(n,i,a,{notice:o("notice",e),lock:o("lock",t)});if(!d)return null;const u={reload:r,"take-over":s,"take-back":s,"view-read-only":l},m=d.actions.map(e=>e.title?/* @__PURE__ */c(h,{content:e.title,side:"bottom",children:/* @__PURE__ */c(p,{variant:"secondary",size:"sm",onClick:u[e.kind],children:e.label})},e.kind):/* @__PURE__ */c(p,{variant:"secondary",size:"sm",onClick:u[e.kind],children:e.label},e.kind));/* @__PURE__ */
21
+ return c("div",{className:`es-notice is-${d.tone}`,role:d.urgent?"alert":"status",children:/* @__PURE__ */c(b,{tone:"warning"===d.tone?"warning":"info",title:d.lead,action:/* @__PURE__ */c("span",{className:"es-notice-actions",children:m}),children:d.body})})}var q={left:288,right:320},D=220,G=560;function I(e){return Math.min(560,Math.max(220,Math.round(e)))}function J(e){return{"--es-left-w":`${e.left}px`,"--es-right-w":`${e.right}px`}}function K(e,n){e.style.setProperty("--es-left-w",`${n.left}px`),e.style.setProperty("--es-right-w",`${n.right}px`)}export{q as DEFAULT_PANEL_W,B as DeviceSwitch,R as EaselIconButton,C as EaselTopBar,A as EditNotice,M as InspectorHead,S as InspectorIconButton,P as InspectorUpLevel,G as MAX_PANEL_W,D as MIN_PANEL_W,Y as MediaPanelHead,j as PanelResizeHandle,$ as SaveState,W as SaveStateToggle,O as TopBarCluster,x as TopBarDivider,z as TopBarRail,I as clampPanelWidth,H as editNotice,T as mediaPickKind,J as panelWidthVars,K as setPanelWidthVars};
@@ -0,0 +1,7 @@
1
+ import{clientOnly as n}from"./chunk-GXQCZJOP.js";import{ScreenStoreProvider as r}from"./chunk-TGF7KEO7.js";import{ScreenChrome as e}from"./chunk-7HGVGKWU.js";import{ScreenDocumentProvider as i,useScreenDocument as a}from"./chunk-VGV5D667.js";import{DEFAULT_SCREEN_WORDS as s}from"./chunk-LYALMY55.js";import{documentPermissions as o}from"./chunk-THWO5YVZ.js";import{useWords as c}from"./chunk-MFIRYGHW.js";import{useMemo as t}from"react";import{Dialog as d,Button as l}from"efficient-shell/ui";import{jsx as m,jsxs as g,Fragment as h}from"react/jsx-runtime";var f=n(r),v=n(e);function p({saving:n,onCancel:r,onDiscard:e,onSave:i}){const a=c("screen",s).leave;/* @__PURE__ */
2
+ return m(d,{open:!0,role:"alertdialog",size:"sm",title:a.title,onClose:r,footer:/* @__PURE__ */g(h,{children:[
3
+ /* @__PURE__ */m(l,{variant:"secondary",onClick:r,children:a.cancel}),
4
+ /* @__PURE__ */m(l,{variant:"ghost-danger",onClick:e,children:a.discard}),
5
+ /* @__PURE__ */m(l,{variant:"primary",loading:n,onClick:i,children:n?a.saving:a.save})]}),children:a.body})}function u({target:n,addressing:r,onHostMessage:e,children:a}){/* @__PURE__ */
6
+ return m(i,{target:n,addressing:r,onHostMessage:e,children:a})}var k=(n,r)=>/* @__PURE__ */g(h,{children:[n,r]});function C({config:n,parts:r,wrap:e=k}){const{data:i,error:d,redirecting:l,ready:g,saveStatus:h,readOnly:u,onChange:C,pendingNav:j,cancelPendingNav:N,discardAndNavigate:G,saveAndNavigate:y}=a(),H=t(()=>o(!u),[u]),A=c("screen",s);return l?/* @__PURE__ */m("div",{className:"sf-msg",children:A.loading}):d?/* @__PURE__ */m("div",{className:"sf-msg sf-msg--error",children:d}):g?i?e(
7
+ /* @__PURE__ */m(f,{config:n,data:i,onChange:C,permissions:H,parts:r,children:/* @__PURE__ */m(v,{})}),j&&/* @__PURE__ */m(p,{saving:"saving"===h,onCancel:N,onDiscard:G,onSave:()=>{y()}})):/* @__PURE__ */m("div",{className:"sf-msg",children:A.loading}):/* @__PURE__ */m("div",{className:"sf-msg",children:A.waitingForAuthorization})}export{C as DocumentScreen,u as ScreenMount};
@@ -0,0 +1 @@
1
+ import{MARKUP_TOOLS as e,MARK_PLACEHOLDERS as t}from"./chunk-546BBOPE.js";var r={formatting:"Formatting",alignment:"Alignment",align:{left:"Left",center:"Center",right:"Right",justify:"Justify"},marks:{...Object.fromEntries(e.map(e=>[e.style,{name:e.name??e.title,title:e.title}])),underline:{name:"Underline",title:"Underline · [words]{underline}"},sup:{name:"Superscript",title:"Superscript · [words]{sup}"},sub:{name:"Subscript",title:"Subscript · [words]{sub}"}},placeholders:t,showMarks:"Show marks",clearStyle:"Clear style",clearStyleEmpty:"Select words first",toolbar:{bold:"Bold",italic:"Italic",underline:"Underline",strike:"Strikethrough",color:"Color",link:"Link",sup:"Superscript",sub:"Subscript",bullet:"Bulleted list",number:"Numbered list",letterCase:"Letter case",caseNone:"Normal",caseUpper:"Uppercase",caseLower:"Lowercase"},colors:{title:"Color",theme:"Theme colors",remove:"Remove",any:"Any color",square:"Saturation and brightness",hue:"Hue",hex:"Hex color"},cells:{fontSize:"Font size",lineHeight:"Line spacing",letterSpacing:"Letter spacing",paragraphSpacing:"Paragraph spacing",tip:({name:e,step:t,unit:r})=>`${e} · step ${t} ${r} · Shift ×10`}};export{r as DEFAULT_COPY_WORDS};
@@ -1 +1 @@
1
- import{useScreenBlockRules as e}from"./chunk-5TRBCPRB.js";import{newNodeId as t,ROOT_ZONE as n}from"./chunk-PLVEGYK6.js";import{useEasel as o,useEaselApi as r}from"./chunk-PYCLHOSA.js";import{useMemo as s}from"react";function i(i={}){const{dispatch:p}=o(e=>e),d=r(),c=!0===i.readOnly,a=e().resolveOnInsert,l=!0===(i.resolveOnInsert??a),m=!0===i.foldIntoHistory;return s(()=>{const e=m?e=>p({...e,recordHistory:!1}):p,o=(n,o,r)=>{const s=t(o);return c||e({type:"insert",componentType:o,destinationZone:n,destinationIndex:r,id:s}),s},r=e=>(l&&!c&&d.resolveNode(e,{trigger:"insert"}),e),s=(t,n,o)=>{c||e({type:"replace",destinationZone:t,destinationIndex:n,data:o})},i=(e,t,n)=>r(o(e,t,n));return{insertComponent:i,insertSection:(e,t)=>i(n,e,t),replaceComponent:s,seedChild:(e,t,n,i)=>{const p=o(e,n,t);s(e,t,{type:n,props:{id:p,...i}}),r(p)},insertNode:(e,t,n)=>{const i=o(e,n.type,t);return s(e,t,{type:n.type,props:{...n.props,id:i}}),r(i)},removeComponent:(t,n)=>{c||e({type:"remove",index:n,zone:t})},reorderComponent:(t,n,o)=>{c||e({type:"reorder",sourceIndex:n,destinationIndex:o,destinationZone:t})},duplicateComponent:(t,n)=>{c||e({type:"duplicate",sourceIndex:n,sourceZone:t})},select:e=>p({type:"setUi",ui:{itemSelector:e}}),setDocument:t=>{c||e({type:"setData",data:t})},commitDocument:(t,n)=>{c||(m?d.batch(()=>{e({type:"setData",data:t}),void 0!==n&&("slot"===n?.kind?d.selectSlot({parentId:n.parentId,slot:n.slot}):d.select(n?n.id:null))}):d.run({data:t,select:n}))}}},[p,c,l,d,m])}export{i as useSectionOps};
1
+ import{useScreenBlockRules as e}from"./chunk-EJ6QAWRH.js";import{newNodeId as t,ROOT_ZONE as n}from"./chunk-PLVEGYK6.js";import{useEasel as o,useEaselApi as r}from"./chunk-PYCLHOSA.js";import{useMemo as s}from"react";function i(i={}){const{dispatch:p}=o(e=>e),d=r(),c=!0===i.readOnly,a=e().resolveOnInsert,l=!0===(i.resolveOnInsert??a),m=!0===i.foldIntoHistory;return s(()=>{const e=m?e=>p({...e,recordHistory:!1}):p,o=(n,o,r)=>{const s=t(o);return c||e({type:"insert",componentType:o,destinationZone:n,destinationIndex:r,id:s}),s},r=e=>(l&&!c&&d.resolveNode(e,{trigger:"insert"}),e),s=(t,n,o)=>{c||e({type:"replace",destinationZone:t,destinationIndex:n,data:o})},i=(e,t,n)=>r(o(e,t,n));return{insertComponent:i,insertSection:(e,t)=>i(n,e,t),replaceComponent:s,seedChild:(e,t,n,i)=>{const p=o(e,n,t);s(e,t,{type:n,props:{id:p,...i}}),r(p)},insertNode:(e,t,n)=>{const i=o(e,n.type,t);return s(e,t,{type:n.type,props:{...n.props,id:i}}),r(i)},removeComponent:(t,n)=>{c||e({type:"remove",index:n,zone:t})},reorderComponent:(t,n,o)=>{c||e({type:"reorder",sourceIndex:n,destinationIndex:o,destinationZone:t})},duplicateComponent:(t,n)=>{c||e({type:"duplicate",sourceIndex:n,sourceZone:t})},select:e=>p({type:"setUi",ui:{itemSelector:e}}),setDocument:t=>{c||e({type:"setData",data:t})},commitDocument:(t,n)=>{c||(m?d.batch(()=>{e({type:"setData",data:t}),void 0!==n&&("slot"===n?.kind?d.selectSlot({parentId:n.parentId,slot:n.slot}):d.select(n?n.id:null))}):d.run({data:t,select:n}))}}},[p,c,l,d,m])}export{i as useSectionOps};
@@ -0,0 +1 @@
1
+ var e={title:"Add",contextBlocks:"Blocks for this place",contextAll:"Sections and blocks",done:"Done",doneDescription:"Close Add and go back",startBlank:"Start blank",templates:"Your templates",inside:({name:e})=>`Inside ${e}`,tile:({name:e})=>`Add ${e}`,hintBlocks:"Drag into the page, or click to add.",hint:"Drag onto the page, or click to add.",searchBlocks:"Search blocks",searchSections:"Search sections",addingTo:({name:e})=>`Adding to ${e}`,addingBefore:({name:e})=>`Adding before ${e}`,addingAtEnd:"Adding at the end of the page",addingHere:"Adding here"},t={loading:"Loading…",waitingForAuthorization:"Waiting for editor authorization…",missingTemplatePage:"Couldn’t open a page in this template.",missingPage:({slug:e})=>`No page with slug "${e}".`,missingDocument:"Couldn’t open this document.",loadFailed:({cause:e})=>`Could not load the document — ${e}`,noun:"page",pageSettings:"Page settings",header:"Header",footer:"Footer",pageSections:"Template · Home page",templateSections:"Template · Template",addSection:"Add section",addSectionBefore:({name:e})=>`Add section before ${e}`,addSectionHere:"Add section here",done:"Done",copied:({name:e})=>`Copied ${e}`,pasteRefused:({name:e})=>`${e} can’t be pasted here.`,add:e,canvasAddBlock:"Add block",railMedia:"Media library",leftPanel:"Left panel",resizeLeftPanel:"Resize left panel",leave:{title:"Unsaved changes",body:"Your most recent edits haven’t finished saving yet. Save them before switching, or leave and discard them.",cancel:"Cancel",discard:"Discard & leave",save:"Save & leave",saving:"Saving…"},bar:{undo:"Undo",redo:"Redo",refresh:"Refresh",refreshTip:"Refresh the preview (reloads the canvas, keeps your place)",notSaving:"Not saving — see the notice above",retry:"Retry now",autoSaveOff:"Auto-save is off — click to turn it back on (saves your held edits)",autoSaveOn:"Auto-save is on — click to pause it",views:"Left panel views"},menu:{undo:"Undo",redo:"Redo",addSection:"Add section",collapseAll:"Collapse all layers",selectAll:"Select all",pinned:"Pinned — can’t be moved or deleted",clipboardRefused:"Your browser won’t let us read the clipboard — press ⌘V"},layers:"Layers",expandAll:"Expand all sections",collapseAll:"Collapse all sections",editFooter:"Edit the site footer",rename:"Rename",deleteNamed:({name:e})=>`Delete ${e}`,hideNamed:({name:e})=>`Hide ${e}`,showNamed:({name:e})=>`Show ${e}`,addBlockHere:"Add block here",sectionFirst:({name:e})=>`“${e}” is already first`,sectionLast:({name:e})=>`“${e}” is already last`,sectionMoved:({name:e,n:t,total:a})=>`Moved “${e}” to position ${t} of ${a}`,sectionAdded:({name:e})=>`Added “${e}” section`,resizeSettingsPanel:"Resize settings panel",sectionSettings:({name:e})=>`${e} settings`,headerSettings:"Header settings",addBlockMenu:"Add block",deviceNote:{tablet:"Tablet uses the desktop settings.",mobile:"Showing the phone settings for this section."}};export{e as DEFAULT_SCREEN_ADD_WORDS,t as DEFAULT_SCREEN_WORDS};
@@ -1 +1 @@
1
- import{panelFieldsOf as t}from"./chunk-ZE7I3PLX.js";import{withoutDeviceGate as o,deviceMetaOf as n}from"./chunk-PWZOS45R.js";import{BUCKET_KEY as r}from"./chunk-R2HLPNQF.js";import{ANCHOR_FIELD_KEYS as e,foldMetaOf as s,MEDIA_FIELD_MARKER as c,TEXT_FIELD_MARKER as p,LINK_FIELD_MARKER as i}from"./chunk-DUVRZ456.js";import{STYLE_KIND as u,fieldKind as f,copyStyle as a,heldStyle as l,planPaste as m,pasteMessage as y}from"./chunk-V7U33NF2.js";var h=/* @__PURE__ */new Set([r.Style,r.Layout]),j=new Set(Object.values(r)),w=new Set(e),b=/* @__PURE__ */new Set(["focal","imageFocal"]),S=[c,p,i];function k(t){return`site:${t??""}`}function g(t){if(!t||"object"!=typeof t)return null;const n=t,r=o(t)??t,e=n[u]??r[u];if("string"==typeof e)return e;const s=n.options??r.options;if(Array.isArray(s)){return`choice:${s.map(t=>String(t?.value)).sort().join("|")}`}return f(r)}function v(t){const n=t,r=o(t);return S.some(t=>t in n||r&&t in r)}function L(o,r){const e=t(o,r)??{},c=[];let p=!1;for(const[t,o]of Object.entries(e))j.has(t)?p=h.has(t):p&&o&&"object"==typeof o&&!t.startsWith("_")&&(s(o)||w.has(t)||b.has(t)||v(o)||"slot"!==o.type&&c.push({path:[t],kind:g(o),counted:"mobile"!==n(o)?.tier}));return c}function d(t,o,n,r,e){a({scope:n,type:r.type,label:e,rows:t(o,r),props:r.props})}function F(t,o,n,r,e){const s=l(n);if(!s)return null;const c=m(s,{type:r.type,rows:t(o,r),props:r.props});return{...c,message:y(c,s.sourceLabel,e)}}function O(t,o,n,r){d(L,t,o,n,r)}function P(t,o,n,r){return F(L,t,o,n,r)}var R={scope:t=>k(t.siteId),rows:(t,o)=>L(t,o),copy:(t,o,n,r)=>O(r,t,o,n),plan:(t,o,n,r)=>P(r,t,o,n)};function Z(t){if(!t)return R;const o=t.rows,n=o?(t,n)=>o(t,n):L;return{scope:t.scope??R.scope,rows:(t,o)=>n(t,o),copy:t.copy??((t,o,r,e)=>d(n,e,t,o,r)),plan:t.plan??((t,o,r,e)=>F(n,e,t,o,r))}}export{O as copyNodeStyle,L as nodeStyleRows,P as planNodePaste,g as shopFieldKind,k as siteStyleScope,Z as styleClipboardOf};
1
+ import{panelFieldsOf as t}from"./chunk-ZE7I3PLX.js";import{withoutDeviceGate as o,deviceMetaOf as n}from"./chunk-VX5GDBRI.js";import{BUCKET_KEY as r}from"./chunk-R2HLPNQF.js";import{ANCHOR_FIELD_KEYS as e,foldMetaOf as s,MEDIA_FIELD_MARKER as c,TEXT_FIELD_MARKER as p,LINK_FIELD_MARKER as i}from"./chunk-DUVRZ456.js";import{STYLE_KIND as u,fieldKind as f,copyStyle as a,heldStyle as l,planPaste as m,pasteMessage as y}from"./chunk-V7U33NF2.js";var h=/* @__PURE__ */new Set([r.Style,r.Layout]),j=new Set(Object.values(r)),w=new Set(e),b=/* @__PURE__ */new Set(["focal","imageFocal"]),k=[c,p,i];function S(t){return`site:${t??""}`}function g(t){if(!t||"object"!=typeof t)return null;const n=t,r=o(t)??t,e=n[u]??r[u];if("string"==typeof e)return e;const s=n.options??r.options;if(Array.isArray(s)){return`choice:${s.map(t=>String(t?.value)).sort().join("|")}`}return f(r)}function v(t){const n=t,r=o(t);return k.some(t=>t in n||r&&t in r)}function L(o,r){const e=t(o,r)??{},c=[];let p=!1;for(const[t,o]of Object.entries(e))j.has(t)?p=h.has(t):p&&o&&"object"==typeof o&&!t.startsWith("_")&&(s(o)||w.has(t)||b.has(t)||v(o)||"slot"!==o.type&&c.push({path:[t],kind:g(o),counted:"mobile"!==n(o)?.tier}));return c}function d(t,o,n,r,e){a({scope:n,type:r.type,label:e,rows:t(o,r),props:r.props})}function F(t,o,n,r,e,s){const c=l(n);if(!c)return null;const p=m(c,{type:r.type,rows:t(o,r),props:r.props});return{...p,message:y(p,c.sourceLabel,e,s)}}function I(t,o,n,r){d(L,t,o,n,r)}function R(t,o,n,r,e){return F(L,t,o,n,r,e)}var V={scope:t=>S(t.siteId),rows:(t,o)=>L(t,o),copy:(t,o,n,r)=>I(r,t,o,n),plan:(t,o,n,r)=>R(r,t,o,n)};function A(t,o){if(!t&&!o)return V;const n=t?.rows,r=n?(t,o)=>n(t,o):L;return{scope:t?.scope??V.scope,rows:(t,o)=>r(t,o),copy:t?.copy??((t,o,n,e)=>d(r,e,t,o,n)),plan:t?.plan??((t,n,e,s)=>F(r,s,t,n,e,o))}}export{I as copyNodeStyle,L as nodeStyleRows,R as planNodePaste,g as shopFieldKind,S as siteStyleScope,A as styleClipboardOf};
@@ -1,9 +1,9 @@
1
- import{DEFAULT_FIELDS_WORDS as e}from"./chunk-FPOKPNO4.js";import{useWords as l}from"./chunk-MFIRYGHW.js";import{SearchableSelect as a,Select as i,Slider as n}from"efficient-shell/ui";import{jsx as r,jsxs as s}from"react/jsx-runtime";import{useId as o,useRef as t}from"react";function u(e,l){return e.find(e=>Object.is(e.value,l))}var d=e=>String(e);function c(n){const{id:o,options:t,placeholder:u,readOnly:c=!1,ariaLabel:v,ariaLabelledBy:m,searchable:p=!1,searchPlaceholder:h,groupCount:b=!1,renderOption:f}=n,g=l("fields",e),N=m?{"aria-labelledby":m}:v?{"aria-label":v}:{},x=t.some(e=>void 0!==e.thumb),y=x||void 0!==f||t.some(e=>void 0!==e.meta),O=e=>""===e?void 0:t[Number(e)],C=(e,l)=>{const a=O(e.value);return a?/* @__PURE__ */s("span",{className:"es-fsel-row",children:[x?/* @__PURE__ */r("span",{className:"es-fsel-thumb","aria-hidden":"true",children:a.thumb?/* @__PURE__ */r("img",{src:a.thumb,alt:"",loading:"lazy"}):null}):null,
2
- /* @__PURE__ */r("span",{className:"es-fsel-label",children:f?f(a,{active:l.active??!1,chosen:l.selected}):a.label}),void 0===a.meta||p?null:/* @__PURE__ */r("span",{className:"es-fsel-meta","aria-hidden":"true",children:a.meta})]}):e.label},j=[];let V=null;if(t.forEach((e,l)=>{const a={value:d(l),label:e.label,...e.disabled?{disabled:!0}:{},...p&&e.meta?{sublabel:e.meta}:{}};void 0===e.group?(V=null,j.push(a)):V&&V.label===e.group?V.options.push(a):(V={label:e.group,options:[a]},j.push(V))}),b)for(const e of j)"options"in e&&(e.label=`${e.label} ${e.options.length}`);const I=e=>e.flatMap(e=>{const l=O(e.value);return l?[l]:[]});if(p){const l={id:o,options:j,placeholder:h??u??g.search??e.search,disabled:c,renderOption:y?C:void 0,...N};if(!0===n.multiple){const e=Array.isArray(n.value)?n.value:[],i=n.onChange;/* @__PURE__ */
1
+ import{DEFAULT_FIELDS_WORDS as e}from"./chunk-FFYXVAAL.js";import{useWords as l}from"./chunk-MFIRYGHW.js";import{SearchableSelect as a,Select as i,Slider as n}from"efficient-shell/ui";import{jsx as r,jsxs as s}from"react/jsx-runtime";import{useId as o,useRef as t}from"react";function u(e,l){return e.find(e=>Object.is(e.value,l))}var d=e=>String(e);function c(n){const{id:o,options:t,placeholder:u,readOnly:c=!1,ariaLabel:v,ariaLabelledBy:m,searchable:p=!1,searchPlaceholder:h,groupCount:b=!1,renderOption:f}=n,g=l("fields",e),N=m?{"aria-labelledby":m}:v?{"aria-label":v}:{},x=t.some(e=>void 0!==e.thumb),y=x||void 0!==f||t.some(e=>void 0!==e.meta),C=e=>""===e?void 0:t[Number(e)],O=(e,l)=>{const a=C(e.value);return a?/* @__PURE__ */s("span",{className:"es-fsel-row",children:[x?/* @__PURE__ */r("span",{className:"es-fsel-thumb","aria-hidden":"true",children:a.thumb?/* @__PURE__ */r("img",{src:a.thumb,alt:"",loading:"lazy"}):null}):null,
2
+ /* @__PURE__ */r("span",{className:"es-fsel-label",children:f?f(a,{active:l.active??!1,chosen:l.selected}):a.label}),void 0===a.meta||p?null:/* @__PURE__ */r("span",{className:"es-fsel-meta","aria-hidden":"true",children:a.meta})]}):e.label},j=[];let V=null;if(t.forEach((e,l)=>{const a={value:d(l),label:e.label,...e.disabled?{disabled:!0}:{},...p&&e.meta?{sublabel:e.meta}:{}};void 0===e.group?(V=null,j.push(a)):V&&V.label===e.group?V.options.push(a):(V={label:e.group,options:[a]},j.push(V))}),b)for(const e of j)"options"in e&&(e.label=`${e.label} ${e.options.length}`);const F=e=>e.flatMap(e=>{const l=C(e.value);return l?[l]:[]});if(p){const l={id:o,options:j,placeholder:h??u??g.search??e.search,disabled:c,renderOption:y?O:void 0,...N};if(!0===n.multiple){const e=Array.isArray(n.value)?n.value:[],i=n.onChange;/* @__PURE__ */
3
3
  return r("div",{className:"es-fsel",children:/* @__PURE__ */r(a,{...l,multiple:!0,value:t.flatMap((l,a)=>e.some(e=>Object.is(e,l.value))?[d(a)]:[]),onChange:e=>i(t.filter((l,a)=>e.includes(d(a))).map(e=>e.value))})})}const i=t.findIndex(e=>Object.is(e.value,n.value)),s=n.onChange;/* @__PURE__ */
4
- return r("div",{className:"es-fsel",children:/* @__PURE__ */r(a,{...l,value:i>=0?d(i):"",clearable:!1,onChange:e=>{const l=O(e);l&&!Object.is(l.value,n.value)&&s(l.value)}})})}const M={id:o,size:"sm",className:"es-fsel-button",options:j,placeholder:u??g.choose,readOnly:c,renderOption:y?C:void 0,...N};if(!0===n.multiple){const e=Array.isArray(n.value)?n.value:[],l=l=>e.some(e=>Object.is(e,l.value)),a=t.flatMap((e,a)=>l(e)?[d(a)]:[]),s=n.onChange;/* @__PURE__ */
5
- return r("div",{className:"es-fsel",children:/* @__PURE__ */r(i,{...M,multiple:!0,value:a,renderValue:n.renderValue?e=>n.renderValue(I(e)):void 0,valueText:n.valueText?e=>n.valueText(I(e)):void 0,onChange:e=>s(t.filter((l,a)=>e.includes(d(a))).map(e=>e.value))})})}const T=t.findIndex(e=>Object.is(e.value,n.value)),F=n.onChange;/* @__PURE__ */
6
- return r("div",{className:"es-fsel",children:/* @__PURE__ */r(i,{...M,value:T>=0?d(T):"",renderValue:n.renderValue?e=>n.renderValue(I(e)[0]):void 0,valueText:n.valueText?e=>n.valueText(I(e)[0]):void 0,onChange:e=>{const l=O(e);l&&!Object.is(l.value,n.value)&&F(l.value)}})})}function v({id:e,label:l,value:a,onChange:i,min:u,max:d,step:c=1,shiftStep:v,styleValue:m,unit:p,sliderMin:h,sliderMax:b,auto:f,readOnly:g=!1}){const N=o(),x=e??N,y="number"==typeof a&&Number.isFinite(a)?a:void 0,O=void 0!==f&&void 0===y,C=!O&&void 0===y&&void 0!==m,j=Number((h-c).toFixed(6)),V=t(!1),I=e=>{V.current="range"===e.target.type},M=e=>{g||e===y||i(e)};/* @__PURE__ */
7
- return s("div",{className:"es-fslider"+(C||O?" is-style":""),onChangeCapture:I,onKeyDownCapture:I,onPointerDownCapture:I,children:[
4
+ return r("div",{className:"es-fsel",children:/* @__PURE__ */r(a,{...l,value:i>=0?d(i):"",clearable:!1,onChange:e=>{const l=C(e);l&&!Object.is(l.value,n.value)&&s(l.value)}})})}const I={id:o,size:"sm",className:"es-fsel-button",options:j,placeholder:u??g.choose,readOnly:c,renderOption:y?O:void 0,...N};if(!0===n.multiple){const e=Array.isArray(n.value)?n.value:[],l=l=>e.some(e=>Object.is(e,l.value)),a=t.flatMap((e,a)=>l(e)?[d(a)]:[]),s=n.onChange;/* @__PURE__ */
5
+ return r("div",{className:"es-fsel",children:/* @__PURE__ */r(i,{...I,multiple:!0,value:a,renderValue:n.renderValue?e=>n.renderValue(F(e)):void 0,valueText:n.valueText?e=>n.valueText(F(e)):void 0,onChange:e=>s(t.filter((l,a)=>e.includes(d(a))).map(e=>e.value))})})}const M=t.findIndex(e=>Object.is(e.value,n.value)),T=n.onChange;/* @__PURE__ */
6
+ return r("div",{className:"es-fsel",children:/* @__PURE__ */r(i,{...I,value:M>=0?d(M):"",renderValue:n.renderValue?e=>n.renderValue(F(e)[0]):void 0,valueText:n.valueText?e=>n.valueText(F(e)[0]):void 0,onChange:e=>{const l=C(e);l&&!Object.is(l.value,n.value)&&T(l.value)}})})}function v({id:e,label:l,value:a,onChange:i,min:u,max:d,step:c=1,shiftStep:v,styleValue:m,unit:p,sliderMin:h,sliderMax:b,auto:f,readOnly:g=!1}){const N=o(),x=e??N,y="number"==typeof a&&Number.isFinite(a)?a:void 0,C=void 0!==f&&void 0===y,O=!C&&void 0===y&&void 0!==m,j=Number((h-c).toFixed(6)),V=t(!1),F=e=>{V.current="range"===e.target.type},I=e=>{g||e===y||i(e)};/* @__PURE__ */
7
+ return s("div",{className:"es-fslider"+(O||C?" is-style":""),onChangeCapture:F,onKeyDownCapture:F,onPointerDownCapture:F,children:[
8
8
  /* @__PURE__ */r("label",{className:"es-fslider-name",htmlFor:x,children:l}),
9
- /* @__PURE__ */r(n,{id:x,label:l,value:y??null,onChange:e=>{if(null===e)return M(void 0);M(void 0!==f&&V.current&&e<h?void 0:e)},min:void 0!==f?j:h,max:b,inputMin:u??-1e9,inputMax:d??Number.POSITIVE_INFINITY,step:c,shiftStep:v,suffix:p&&!O?p:void 0,emptyLabel:f??(void 0===m?"":void 0),placeholderValue:void 0===f?m:void 0,stepFrom:void 0!==f?j:void 0,disabled:g,size:"sm"})]})}export{c as FieldSelect,v as FieldSlider,u as optionFor};
9
+ /* @__PURE__ */r(n,{id:x,label:l,value:y??null,onChange:e=>{if(null===e)return I(void 0);I(void 0!==f&&V.current&&e<h?void 0:e)},min:void 0!==f?j:h,max:b,inputMin:u??-1e9,inputMax:d??Number.POSITIVE_INFINITY,step:c,shiftStep:v,suffix:p&&!C?p:void 0,emptyLabel:f??(void 0===m?"":void 0),placeholderValue:void 0===f?m:void 0,stepFrom:void 0!==f?j:void 0,disabled:g,size:"sm"})]})}export{c as FieldSelect,v as FieldSlider,u as optionFor};
@@ -1 +1 @@
1
- import{DEFAULT_TEXT_STYLES_WORDS as o}from"./chunk-M6F6LS3H.js";import{DEFAULT_PICK_WORDS as r}from"./chunk-ZAOM6PFH.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as t}from"./chunk-6WY6ZXJG.js";import{DEFAULT_SCREEN_WORDS as m}from"./chunk-E2O2MRZR.js";import{DEFAULT_CANVAS_WORDS as n}from"./chunk-AELNNAFM.js";import{DEFAULT_TREE_WORDS as c}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as s}from"./chunk-QTLAVDJE.js";import{DEFAULT_NODE_MENU_WORDS as f}from"./chunk-WK3AFPXY.js";import{DEFAULT_SAVE_WORDS as p}from"./chunk-H6DDIBQ4.js";import{DEFAULT_CHROME_WORDS as e,DEFAULT_NOTICE_WORDS as i}from"./chunk-ZJEBF4NB.js";import{DEFAULT_LOCK_WORDS as u}from"./chunk-RE4LP46F.js";import{DEFAULT_RAIL_WORDS as k}from"./chunk-2OAZYSWJ.js";import{DEFAULT_COPY_WORDS as j}from"./chunk-UH7IGZKF.js";import{DEFAULT_FIELDS_WORDS as h}from"./chunk-FPOKPNO4.js";import{DEFAULT_DRAG_WORDS as l}from"./chunk-O2NLQBFX.js";var F={notice:i,lock:u,save:p,chrome:e,rail:k,tree:c,panel:s,fields:h,pick:r,drag:l,menu:f,styleClipboard:t,copy:j,canvas:n,textStyles:o,screen:m},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 O(o,r){return r?y(o,r):o}export{F as DEFAULT_EASEL_STRINGS,O as mergeEaselStrings};
1
+ import{DEFAULT_TEXT_STYLES_WORDS as o}from"./chunk-M6F6LS3H.js";import{DEFAULT_PICK_WORDS as r}from"./chunk-ZAOM6PFH.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as t}from"./chunk-6WY6ZXJG.js";import{DEFAULT_SCREEN_WORDS as m}from"./chunk-LYALMY55.js";import{DEFAULT_CANVAS_WORDS as n}from"./chunk-AELNNAFM.js";import{DEFAULT_TREE_WORDS as c}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as s}from"./chunk-QTLAVDJE.js";import{DEFAULT_NODE_MENU_WORDS as f}from"./chunk-WK3AFPXY.js";import{DEFAULT_SAVE_WORDS as p}from"./chunk-H6DDIBQ4.js";import{DEFAULT_CHROME_WORDS as e,DEFAULT_NOTICE_WORDS as i}from"./chunk-Y2G7CU6A.js";import{DEFAULT_LOCK_WORDS as u}from"./chunk-RE4LP46F.js";import{DEFAULT_RAIL_WORDS as k}from"./chunk-2OAZYSWJ.js";import{DEFAULT_COPY_WORDS as j}from"./chunk-JZDEIRH4.js";import{DEFAULT_FIELDS_WORDS as h}from"./chunk-FFYXVAAL.js";import{DEFAULT_DRAG_WORDS as l}from"./chunk-O2NLQBFX.js";var A={notice:i,lock:u,save:p,chrome:e,rail:k,tree:c,panel:s,fields:h,pick:r,drag:l,menu:f,styleClipboard:t,copy:j,canvas:n,textStyles:o,screen:m},Y=o=>"object"==typeof o&&null!==o;function a(o,r){const t={};for(const m of Object.keys(o)){const n=o[m],c=r[m];null==c?t[m]=n:Y(n)?t[m]=Y(c)?a(n,c):n:t[m]=typeof c==typeof n?c:n}return t}function F(o,r){return r?a(o,r):o}export{A as DEFAULT_EASEL_STRINGS,F as mergeEaselStrings};
@@ -0,0 +1,4 @@
1
+ import{blockRuns as e}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as r}from"./chunk-EJ6QAWRH.js";import{DEFAULT_SCREEN_WORDS as s}from"./chunk-LYALMY55.js";import{useWords as t}from"./chunk-MFIRYGHW.js";import{DropdownMenu as n}from"efficient-shell/ui";import{jsxs as c,Fragment as i,jsx as o}from"react/jsx-runtime";function l({choices:l,onPick:p}){const{Icon:a}=r(),m=t("screen",s),u=e(l).flatMap(e=>[...e.group?[{type:"label",key:`group:${e.group}`,label:/* @__PURE__ */c(i,{children:[e.group," ",
2
+ /* @__PURE__ */o("span",{className:"sf-menugroup-count",children:e.items.length})]})}]:[],...e.items.map(e=>({key:e.type,label:e.label,icon:/* @__PURE__ */o("span",{className:"sf-chip",children:/* @__PURE__ */o(a,{type:e.type,size:13})}),onSelect:()=>p(e.type)}))]);/* @__PURE__ */
3
+ return o(n,{align:"start",triggerClassName:"sf-add-card",items:u,trigger:/* @__PURE__ */c(i,{children:[
4
+ /* @__PURE__ */o("span",{className:"sf-plus sf-plus--sm",children:"+"}),m.addBlockMenu]})})}export{l as AddBlockRow};
@@ -1,2 +1,2 @@
1
- import{ScreenPartsProvider as t}from"./chunk-5TRBCPRB.js";import{useEaselHost as r}from"./chunk-U3JP4VGF.js";import{createEasel as e,EaselProvider as n}from"./chunk-PYCLHOSA.js";import{useState as o,useEffect as s}from"react";import{jsx as i}from"react/jsx-runtime";function a({config:a,data:c,onChange:m,permissions:p,parts:f,children:u}){const[h]=o(()=>e({config:a,data:c,permissions:p}));s(()=>{h.setConfig(a)},[h,a]),s(()=>{if(!m)return;let t=h.getState().appState.data;return h.subscribe(()=>{const r=h.getState().appState.data;r!==t&&(t=r,m(r))})},[h,m]),s(()=>{p&&h.setPermissions(p)},[h,p]);const d=r();/* @__PURE__ */
1
+ import{ScreenPartsProvider as t}from"./chunk-EJ6QAWRH.js";import{useEaselHost as r}from"./chunk-U3JP4VGF.js";import{createEasel as e,EaselProvider as n}from"./chunk-PYCLHOSA.js";import{useState as o,useEffect as s}from"react";import{jsx as i}from"react/jsx-runtime";function a({config:a,data:c,onChange:m,permissions:p,parts:f,children:u}){const[h]=o(()=>e({config:a,data:c,permissions:p}));s(()=>{h.setConfig(a)},[h,a]),s(()=>{if(!m)return;let t=h.getState().appState.data;return h.subscribe(()=>{const r=h.getState().appState.data;r!==t&&(t=r,m(r))})},[h,m]),s(()=>{p&&h.setPermissions(p)},[h,p]);const d=r();/* @__PURE__ */
2
2
  return i(n,{easel:h,hotkeys:d.ownsDocument,children:/* @__PURE__ */i(t,{parts:f,children:u})})}export{a as ScreenStoreProvider};
@@ -0,0 +1,5 @@
1
+ import{blockTypesIn as e}from"./chunk-5ZBY24K7.js";import{buildPaletteSections as t,pinnedSection as o,paletteWithoutPinned as n,categoryLabel as i}from"./chunk-PA3PNTVV.js";import{sectionTemplatesOf as s}from"./chunk-BVN33R76.js";import{SidePanelHead as r,PanelModeExit as c}from"./chunk-5SOSVTVI.js";import{useEaselSession as l}from"./chunk-O7Q4DDJT.js";import{blockRuns as a}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as p,useScreenBlockRules as m}from"./chunk-EJ6QAWRH.js";import{DEFAULT_SCREEN_WORDS as d}from"./chunk-LYALMY55.js";import{useEasel as f}from"./chunk-PYCLHOSA.js";import{useWords as u}from"./chunk-MFIRYGHW.js";import{AddPanel as k}from"./chunk-6HHHBBSY.js";import{DEFAULT_DRAG_WORDS as h}from"./chunk-O2NLQBFX.js";import{useState as y,useEffect as b,useMemo as j}from"react";import{AddIcon as g}from"efficient-shell/icons/efficient";import{jsx as B,jsxs as O,Fragment as $}from"react/jsx-runtime";var H=e=>`section:${e}`,L=e=>`block:${e}`,v=e=>`template:${e}`;function A({blocks:A,blocksOnly:V,at:x,onAdd:I,itemFor:S,session:Y,siteWide:N,onClose:C,onHide:F,readOnly:Q}){const R=f(e=>e.config),T=p(),{labelAtLevel:w,categoryLabel:D,firstSection:P,Icon:W,Thumbnail:z}=T,{blockIsOffered:E}=m(),J=u("screen",d).add,M=u("drag",h).add,G=l(),[K,X]=y([]);b(()=>{let t=!1;const o=e=>E(e,G);return s(G).list().then(n=>{if(t)return;const i=R.components;X(n.filter(t=>t.node?.type&&i[t.node.type]&&e(t.node).every(o)))}).catch(()=>{}),()=>{t=!0}},[R,G]);const Z=j(()=>t(R,T),[R]),q=e=>({type:H(e.type),label:e.name,cover:/* @__PURE__ */B(z,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:J.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),U=j(()=>{const e=[];if(A&&A.choices.length>0&&a(A.choices).forEach((t,o)=>{e.push({key:`blocks:${o}`,title:0===o?`${J.inside({name:A.parentName})}${t.group?` · ${t.group}`:""}`:t.group??"",tiles:t.items.map(e=>({type:L(e.type),label:e.label,icon:/* @__PURE__ */B(W,{type:e.type,size:18}),title:J.tile({name:e.label})}))})}),V)return e;const t=o(Z,P);t&&e.push({key:"start",title:J.startBlank,tiles:[q(t)]}),K.length>0&&e.push({key:"templates",title:J.templates,tiles:K.map(e=>{return{type:v(e.id),label:e.name,cover:/* @__PURE__ */B(z,{type:e.node.type}),keywords:[(t=e.node.type,w(t,"section",R.components[t]?.label??t)),e.node.type]};var t})});const s=n(Z,P);for(const t of Object.keys(R.categories??{})){const o=s.filter(e=>e.cat===t);0!==o.length&&e.push({key:`category:${t}`,title:i(R,t,D),tiles:o.map(q)})}return e},[A,V,K,Z,R,J]),_=e=>{const t=e.indexOf(":"),o=e.slice(0,t),n=e.slice(t+1);if("section"===o)return{kind:"section",type:n};if("block"===o)return{kind:"block",type:n};if("template"===o){const e=K.find(e=>e.id===n);return e?{kind:"template",template:e}:null}return null};/* @__PURE__ */
2
+ return O($,{children:[
3
+ /* @__PURE__ */B(r,{icon:/* @__PURE__ */B(g,{size:15}),title:J.title,context:V?J.contextBlocks:J.contextAll,actions:/* @__PURE__ */B(c,{label:J.done,description:J.doneDescription,onClick:C}),onHide:F}),
4
+ /* @__PURE__ */O("div",{className:"sf-addside sf-scroll",children:[
5
+ /* @__PURE__ */B(k,{groups:U,session:Y,itemFor:e=>S(_(e)??{kind:"section",type:e}),onInsert:e=>{const t=_(e);t&&I(t)},at:x,hint:V?J.hintBlocks:J.hint,searchLabel:V?J.searchBlocks:J.searchSections,readOnly:Q,words:M}),N&&!V?N:null]})]})}export{A as AddSidePanel,L as blockKey,H as sectionKey,v as templateKey};