efficient-easel 16.0.0 → 17.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/README.md +23 -64
  2. package/dist/autosave/index.d.ts +4 -4
  3. package/dist/blocks/index.d.ts +2 -2
  4. package/dist/chrome/index.d.ts +3 -3
  5. package/dist/chrome/index.js +1 -1
  6. package/dist/{chunk-UVQR7W6I.js → chunk-3ERZNZ5S.js} +1 -1
  7. package/dist/{chunk-3Z2MVLCD.js → chunk-4ES5JGGX.js} +1 -1
  8. package/dist/{chunk-2H3W5OLQ.js → chunk-4UBYPRAS.js} +1 -1
  9. package/dist/chunk-7TOQCTHV.js +4 -0
  10. package/dist/chunk-BU2YSTLJ.js +14 -0
  11. package/dist/{chunk-VVPZMWJE.js → chunk-EL4F3IN7.js} +1 -1
  12. package/dist/chunk-EXCIHRAE.js +4 -0
  13. package/dist/{chunk-NBDMTIU2.js → chunk-FJL3MYPA.js} +2 -2
  14. package/dist/{chunk-IE55HNMA.js → chunk-GWIVPLOX.js} +11 -11
  15. package/dist/chunk-INIPQLPR.js +1 -0
  16. package/dist/{chunk-HM7S7H5H.js → chunk-JSH3XKEF.js} +1 -1
  17. package/dist/chunk-M2Z775ZC.js +1 -0
  18. package/dist/chunk-MI54XTWD.js +5 -0
  19. package/dist/chunk-MTNBJPXX.js +2 -0
  20. package/dist/{chunk-N2BVA6TS.js → chunk-NFLO4I2N.js} +1 -1
  21. package/dist/{chunk-P3XVBLZ6.js → chunk-OLRLHE5K.js} +4 -4
  22. package/dist/chunk-SHS6WCLL.js +1 -0
  23. package/dist/{chunk-PQRYAW2G.js → chunk-SPQOPWCL.js} +3 -3
  24. package/dist/{chunk-TZIIRGVY.js → chunk-U277UX5I.js} +1 -1
  25. package/dist/{chunk-63ZDVAVE.js → chunk-V63ERBLW.js} +1 -1
  26. package/dist/chunk-WR3EVON3.js +57 -0
  27. package/dist/{chunk-62VPYC7F.js → chunk-XDZHKYQX.js} +1 -1
  28. package/dist/chunk-XLUVTPKK.js +1 -0
  29. package/dist/{chunk-KFPCMMRK.js → chunk-Z72CYM3L.js} +1 -1
  30. package/dist/copy/index.js +23 -11
  31. package/dist/draw/client.js +1 -1
  32. package/dist/draw/index.js +1 -1
  33. package/dist/easel/index.d.ts +35 -6
  34. package/dist/easel/index.js +1 -1
  35. package/dist/fields/index.js +1 -1
  36. package/dist/gold/gold.css +1 -1
  37. package/dist/{host-DGmdCaNL.d.ts → host-Cxbhp0zg.d.ts} +0 -4
  38. package/dist/icons/index.d.ts +0 -2
  39. package/dist/node-ops/index.d.ts +2 -2
  40. package/dist/node-ops/index.js +1 -1
  41. package/dist/{plan-CGREINRO.d.ts → plan-2BLk7pWs.d.ts} +19 -1
  42. package/dist/rail/index.d.ts +2 -2
  43. package/dist/screen/components/AddBlockRow.js +1 -1
  44. package/dist/screen/components/AddSidePanel.js +1 -1
  45. package/dist/screen/components/MediaSidePanel.d.ts +3 -3
  46. package/dist/screen/components/MediaSidePanel.js +1 -1
  47. package/dist/screen/components/NodeContextMenu.d.ts +6 -6
  48. package/dist/screen/components/NodeContextMenu.js +1 -1
  49. package/dist/screen/components/PageEditGuardNotices.js +1 -1
  50. package/dist/screen/components/SaveControls.d.ts +7 -5
  51. package/dist/screen/components/SaveControls.js +1 -1
  52. package/dist/screen/components/ScreenChrome.js +1 -1
  53. package/dist/screen/components/ScreenDocumentContext.d.ts +3 -3
  54. package/dist/screen/components/ScreenDocumentContext.js +1 -1
  55. package/dist/screen/components/ScreenMount.d.ts +5 -5
  56. package/dist/screen/components/ScreenMount.js +1 -1
  57. package/dist/screen/components/ScreenStoreProvider.d.ts +5 -5
  58. package/dist/screen/components/ScreenStoreProvider.js +1 -1
  59. package/dist/screen/components/SectionScreenShell.js +15 -15
  60. package/dist/screen/components/SidePanelHead.js +1 -1
  61. package/dist/screen/components/panel-widths.js +1 -1
  62. package/dist/screen/components/usePartBridge.d.ts +5 -5
  63. package/dist/screen/components/usePartBridge.js +1 -1
  64. package/dist/screen/index.d.ts +6 -6
  65. package/dist/screen/index.js +1 -1
  66. package/dist/screen/lib/admin-bridge.d.ts +2 -2
  67. package/dist/screen/lib/document-addressing.d.ts +3 -3
  68. package/dist/screen/lib/document-hooks.d.ts +2 -2
  69. package/dist/screen/lib/host-chrome.d.ts +0 -10
  70. package/dist/screen/lib/host.d.ts +3 -3
  71. package/dist/screen/lib/key-scope.js +1 -1
  72. package/dist/screen/lib/media-panel.d.ts +3 -3
  73. package/dist/screen/lib/media-picker.d.ts +3 -3
  74. package/dist/screen/lib/page-lock.d.ts +2 -2
  75. package/dist/screen/lib/puck/block-choice.d.ts +13 -1
  76. package/dist/screen/lib/puck/block-choice.js +1 -1
  77. package/dist/screen/lib/puck/device-fields.js +1 -1
  78. package/dist/screen/lib/puck/palette-sections.d.ts +2 -2
  79. package/dist/screen/lib/puck/preview-dom.js +1 -1
  80. package/dist/screen/lib/puck/section-doc.d.ts +2 -2
  81. package/dist/screen/lib/puck/style-clipboard.d.ts +5 -5
  82. package/dist/screen/lib/puck/style-clipboard.js +1 -1
  83. package/dist/screen/lib/puck/use-section-ops.d.ts +2 -2
  84. package/dist/screen/lib/puck/use-section-ops.js +1 -1
  85. package/dist/screen/lib/save-status.d.ts +2 -2
  86. package/dist/screen/lib/screen-parts.d.ts +26 -28
  87. package/dist/screen/lib/screen-parts.js +1 -1
  88. package/dist/screen/lib/section-templates.d.ts +2 -2
  89. package/dist/screen/lib/session-context.d.ts +2 -2
  90. package/dist/screen/lib/session.d.ts +2 -2
  91. package/dist/screen/words.d.ts +0 -2
  92. package/dist/screen/words.js +1 -1
  93. package/dist/shell/shell.css +6 -1
  94. package/dist/strings/index.d.ts +134 -20
  95. package/dist/strings/index.js +2 -2
  96. package/dist/text-styles/index.js +20 -20
  97. package/dist/{types-CsgMwHHa.d.ts → types-Cy7rdmXt.d.ts} +1 -1
  98. package/dist/{types-DGyDHiJV.d.ts → types-DT8ywrFQ.d.ts} +1 -1
  99. package/dist/{types-NQozKWEz.d.ts → types-kR_4wYBw.d.ts} +1 -1
  100. package/dist/{useNodeOps-BHRkUFfG.d.ts → useNodeOps-B0XZ8Bl8.d.ts} +1 -1
  101. package/dist/{words-pgIK0I6g.d.ts → words-DkWcK1rh.d.ts} +2 -2
  102. package/package.json +2 -41
  103. package/dist/chunk-ECM5F6JJ.js +0 -1
  104. package/dist/chunk-GGC72GS4.js +0 -1
  105. package/dist/chunk-H4UMY7QF.js +0 -13
  106. package/dist/chunk-HMXIAMCU.js +0 -1
  107. package/dist/chunk-HQ4VVRIC.js +0 -1
  108. package/dist/chunk-JD5HXBEX.js +0 -1
  109. package/dist/chunk-N2B32EZB.js +0 -5
  110. package/dist/chunk-OK7OH2ZN.js +0 -4
  111. package/dist/chunk-RQBIFINA.js +0 -57
  112. package/dist/chunk-RSKHAHPJ.js +0 -4
  113. package/dist/chunk-SMM3ST7A.js +0 -13
  114. package/dist/chunk-XT6DOSHO.js +0 -1
  115. package/dist/chunk-ZZ64CEC2.js +0 -2
  116. package/dist/gold/index.d.ts +0 -283
  117. package/dist/gold/index.js +0 -1
  118. package/dist/icons/meanings.d.ts +0 -1
  119. package/dist/icons/meanings.js +0 -1
  120. package/dist/index.d.ts +0 -6
  121. package/dist/index.js +0 -1
  122. package/dist/markup/index.d.ts +0 -1
  123. package/dist/markup/index.js +0 -1
  124. package/dist/shell/index.d.ts +0 -195
  125. package/dist/shell/index.js +0 -1
  126. package/dist/strings/catalogue.d.ts +0 -139
  127. package/dist/strings/catalogue.js +0 -1
@@ -1,5 +1,5 @@
1
- import{usePickFollowsSelection as n}from"./chunk-R6WTQWAC.js";import{slotFieldsOf as e}from"./chunk-PLVEGYK6.js";import{EaselCanvas as t,useSelectedFields as r}from"./chunk-SMM3ST7A.js";import{Inspector as i}from"./chunk-N3LYD2LK.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(n,t,r){const i=n.slotsOf?.(r);return i||e(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=()=>k,v=()=>"",g=()=>null,y=()=>{},b={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},L={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},O={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__ */
1
+ import{usePickFollowsSelection as n}from"./chunk-R6WTQWAC.js";import{slotFieldsOf as e}from"./chunk-PLVEGYK6.js";import{EaselCanvas as t,useSelectedFields as r}from"./chunk-BU2YSTLJ.js";import{Inspector as i}from"./chunk-N3LYD2LK.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(n,t,r){const i=n.slotsOf?.(r);return i||e(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=()=>k,v=()=>"",g=()=>null,y=()=>{},b={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},L={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},O={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */s(l,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},j={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},w={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function S(){/* @__PURE__ */
2
2
  return s(t,{height:"fill"})}function C(){const{id:n,fields:e,values:t,readOnly:o,onChange:u}=r();/* @__PURE__ */
3
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 D=o({});function N({parts:n,children:e}){/* @__PURE__ */
4
- return s(D.Provider,{value:n,children:e})}function P(){return u(D)}function G(){return(P().useOwnerName??v)()}function T(){return(P().useDocumentLabel??g)()}function x(n,e,t,r){return(P().useBridges??h)(n,e,t,r)}function A(n){return(P().useStandaloneBridges??h)(n)}function B(n,e){(P().useDocumentPass??y)(n,e)}function I(){return P().blockRules??b}function F(){return P().blockLook??L}function K(){return P().devices??O}function R(){return P().leftView??S}function M(){return P().pinned??j}function V(){return P().saveSwitch??!0}function W(e){n(!0===P().pickFollowsSelection,e)}function Y(){return P().storageNamespace||void 0}function E(){return P().styleClipboard??null}function H(){return P().nodeKeys??!0}function Q(){return P().notify??null}function Z(){return P().Canvas??w}function q(){return P().CanvasHead??null}function z(){return P().canvasDrag??null}var J=o(null);function U({target:n,children:e}){/* @__PURE__ */
5
- return s(J.Provider,{value:n,children:e})}function X(){return u(J)}function $(){return P().Inspector??C}export{c as SELECTION_MODE,U as ScreenCanvasTargetProvider,N as ScreenPartsProvider,p as isPinnedFirst,m as isPinnedLast,a as isSlotMode,f as sameInspectorMode,d as screenSlotsOf,F as useScreenBlockLook,I as useScreenBlockRules,x as useScreenBridges,z as useScreenCanvasDrag,Z as useScreenCanvasFrame,q as useScreenCanvasHead,X as useScreenCanvasTarget,K as useScreenDevices,T as useScreenDocumentLabel,B as useScreenDocumentPass,$ as useScreenInspectorPanel,R as useScreenLeftView,H as useScreenNodeKeys,Q as useScreenNotify,G as useScreenOwnerName,P as useScreenParts,W as useScreenPickFollowsSelection,M as useScreenPinned,V as useScreenSaveSwitch,Y as useScreenStorageNamespace,E as useScreenStyleClipboard,A as useStandaloneScreenBridges};
4
+ return s(D.Provider,{value:n,children:e})}function P(){return u(D)}function B(){return(P().useOwnerName??v)()}function G(){return(P().useDocumentLabel??g)()}function T(n,e,t,r){return(P().useBridges??h)(n,e,t,r)}function x(n){return(P().useStandaloneBridges??h)(n)}function I(n,e){(P().useDocumentPass??y)(n,e)}function A(){return P().blockRules??b}function F(){return P().blockLook??L}function K(){return P().devices??O}function R(){return P().leftView??j}function Y(){return P().pinned??w}function V(){return P().saveSwitch??!0}function W(e){n(!0===P().pickFollowsSelection,e)}function E(){return P().storageNamespace||void 0}function H(){return P().styleClipboard??null}function J(){return P().nodeKeys??!0}function Q(){return P().notify??null}function U(){return P().Canvas??S}function Z(){return P().CanvasHead??null}function q(){return P().canvasDrag??null}var z=o(null);function M({target:n,children:e}){/* @__PURE__ */
5
+ return s(z.Provider,{value:n,children:e})}function X(){return u(z)}function $(){return P().Inspector??C}export{c as SELECTION_MODE,M as ScreenCanvasTargetProvider,N as ScreenPartsProvider,p as isPinnedFirst,m as isPinnedLast,a as isSlotMode,f as sameInspectorMode,d as screenSlotsOf,F as useScreenBlockLook,A as useScreenBlockRules,T as useScreenBridges,q as useScreenCanvasDrag,U as useScreenCanvasFrame,Z as useScreenCanvasHead,X as useScreenCanvasTarget,K as useScreenDevices,G as useScreenDocumentLabel,I as useScreenDocumentPass,$ as useScreenInspectorPanel,R as useScreenLeftView,J as useScreenNodeKeys,Q as useScreenNotify,B as useScreenOwnerName,P as useScreenParts,W as useScreenPickFollowsSelection,Y as useScreenPinned,V as useScreenSaveSwitch,E as useScreenStorageNamespace,H as useScreenStyleClipboard,x as useStandaloneScreenBridges};
@@ -1 +1 @@
1
- import{DEFAULT_PANEL_W as s,clampPanelWidth as e}from"./chunk-IE55HNMA.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-GWIVPLOX.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-PQRYAW2G.js";import{settlePanelPick as n}from"./chunk-R6WTQWAC.js";import{MediaPanelHead as i,mediaPickKind as c}from"./chunk-IE55HNMA.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-SPQOPWCL.js";import{settlePanelPick as n}from"./chunk-R6WTQWAC.js";import{MediaPanelHead as i,mediaPickKind as c}from"./chunk-GWIVPLOX.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,57 @@
1
+ import{dedupeSlotChildren as e}from"./chunk-26OOWIJJ.js";import{styleClipboardOf as n}from"./chunk-XLUVTPKK.js";import{markedTreeNodeId as t,revealSelectedTreeRow as o,sameSelector as r}from"./chunk-FGNR22NY.js";import{cloneNodeWithFreshIds as i}from"./chunk-2GVCAIPX.js";import{scrollPreviewToSection as l,gotoPreviewSlide as s,scrollPreviewToTop as d}from"./chunk-4ES5JGGX.js";import{useEaselKeyTarget as c,useEaselUndoKeys as a,useEaselSaveKey as p,editorRootFocus as u}from"./chunk-JSH3XKEF.js";import{SlotChildActionsProvider as f}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as h,DEFAULT_PANEL_W as m,clampPanelWidth as g}from"./chunk-U277UX5I.js";import{usePartBridge as y}from"./chunk-INIPQLPR.js";import{useSectionOps as S}from"./chunk-NFLO4I2N.js";import{ScreenSaveIcon as k,ScreenMainButton as b}from"./chunk-7TOQCTHV.js";import{useBrowserOffline as v}from"./chunk-RKTF5XLP.js";import{AddChildRow as w}from"./chunk-5545A3PC.js";import{AddSidePanel as x}from"./chunk-MI54XTWD.js";import{SidePanelHead as z,PanelShowStrip as C}from"./chunk-XDZHKYQX.js";import{offeredChoices as B}from"./chunk-M2Z775ZC.js";import{MediaSidePanel as I}from"./chunk-V63ERBLW.js";import{useScreenSaveSwitch as N,useScreenNodeKeys as O,useScreenPinned as P,useScreenDocumentLabel as $,useScreenCanvasFrame as T,useScreenInspectorPanel as L,useScreenDevices as M,useScreenPickFollowsSelection as j,useScreenLeftView as A,SELECTION_MODE as R,sameInspectorMode as E,useScreenBridges as V,useScreenBlockRules as F,useScreenBlockLook as W,useScreenStorageNamespace as H,useScreenNotify as D,useScreenCanvasHead as U,isSlotMode as X,useScreenStyleClipboard as J,useScreenDocumentPass as G,useScreenCanvasDrag as K,ScreenCanvasTargetProvider as Y,isPinnedFirst as Z,isPinnedLast as q,screenSlotsOf as Q}from"./chunk-SPQOPWCL.js";import{useNodeClipboard as _,useNodeContextMenu as ee}from"./chunk-3ERZNZ5S.js";import{PageEditGuardNotices as ne}from"./chunk-4UBYPRAS.js";import{useScreenDocument as te}from"./chunk-MTNBJPXX.js";import{requestMediaPick as oe}from"./chunk-KG7RJWOK.js";import{useMediaPanel as re,usePanelPick as ie,useCancelPanelPick as le}from"./chunk-R6WTQWAC.js";import{useEaselSession as se}from"./chunk-O7Q4DDJT.js";import{useEaselHost as de,useHostEscape as ce}from"./chunk-U3JP4VGF.js";import{LayersIcon as ae,MediaIcon as pe}from"./chunk-4VJATVVR.js";import{DEFAULT_SCREEN_WORDS as ue}from"./chunk-EL4F3IN7.js";import{heldStyle as fe,styleShortcut as he}from"./chunk-V7U33NF2.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as me}from"./chunk-6WY6ZXJG.js";import{rootRowName as ge,slotChildRowName as ye,slotChildRenameProp as Se,sectionRenameProp as ke}from"./chunk-TBF5CVPA.js";import{ROOT_ZONE as be,blockNodeActions as ve,TREE_MAX_DEPTH as we,childSlotsOf as xe,slotFieldsOf as ze,slotChildrenIn as Ce,nestsInTree as Be,newNodeId as Ie}from"./chunk-PLVEGYK6.js";import{useEasel as Ne,useEaselApi as Oe,CanvasPassThroughContext as Pe}from"./chunk-BU2YSTLJ.js";import{TreeRow as $e,Subtree as Te,LayersTree as Le,TreeGroupLabel as Me,TreeRowAction as je,TreeSeam as Ae}from"./chunk-4JSBIW5H.js";import{DEFAULT_TREE_WORDS as Re}from"./chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as Ee}from"./chunk-WK3AFPXY.js";import{toItemSelector as Ve,useNodeOps as Fe,clickPick as We}from"./chunk-SHS6WCLL.js";import{EaselTopBar as He,TopBarRail as De,TopBarCluster as Ue,EaselIconButton as Xe,TopBarDivider as Je,DeviceSwitch as Ge,InspectorIconButton as Ke,PanelResizeHandle as Ye,MAX_PANEL_W as Ze,MIN_PANEL_W as qe,panelWidthVars as Qe}from"./chunk-GWIVPLOX.js";import{DEFAULT_NOTICE_WORDS as _e,DEFAULT_CHROME_WORDS as en}from"./chunk-Z6PVRXVY.js";import{holderOf as nn,nameOrSomeone as tn}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as on}from"./chunk-RE4LP46F.js";import{useWords as rn}from"./chunk-MFIRYGHW.js";import{insertSeams as ln,CanvasDragLayer as sn,CanvasInsert as dn}from"./chunk-POSLNRTO.js";import{DEFAULT_DRAG_WORDS as cn}from"./chunk-KAML3KQH.js";import{createDragSession as an,useTreeDrag as pn,gapToMoveIndex as un}from"./chunk-67GNT6PF.js";import{useCanvasFrame as fn,LIST_SELECTOR as hn,BLOCK_SELECTOR as mn,useCanvasTyping as gn,useCanvasEvent as yn,nodeIdAt as Sn,frameRectToHost as kn,BLOCK_ATTRIBUTE as bn,drawnBox as vn}from"./chunk-X4T6JT3M.js";import{ROOT_ID as wn,ROOT_SLOT as xn,zoneKey as zn,parseZoneKey as Cn,find as Bn,DataError as In}from"./chunk-KRXQM65X.js";import{useRef as Nn,useMemo as On,useState as Pn,useEffect as $n,useCallback as Tn,useLayoutEffect as Ln,Fragment as Mn}from"react";import{ColoredBadge as jn,toast as An,groupColors as Rn}from"efficient-shell/ui";import{UndoIcon as En,RedoIcon as Vn,RefreshIcon as Fn,AddIcon as Wn,TrashIcon as Hn,EyeOffIcon as Dn,EyeIcon as Un,DuplicateIcon as Xn}from"efficient-shell/icons/efficient";import{jsx as Jn,jsxs as Gn,Fragment as Kn}from"react/jsx-runtime";var Yn=/* @__PURE__ */new WeakSet;function Zn(e,n,t){const o=Bn(e,n,t);if(!o)return null;const r=o.path.find(e=>"root"!==e.parentId);return r?r.parentId:t}function qn({canvas:e,tabs:n,onSelect:t}){const o=Nn(null),[r,i]=Pn({}),l=n.map(e=>`${e.id}:${e.below?1:0}`).join("|");return Ln(()=>{const t=e?.document,r=e?.window,l=e?.frame;if(!t||!r||!l||0===n.length)return void i({});let s=0;const d=()=>{s=0;const e=o.current;if(!e)return;const d=kn(l,{left:0,top:0,width:r.innerWidth,height:r.innerHeight},e),c={};for(const o of n){const n=t.querySelector(`[${bn}="${r.CSS?.escape?r.CSS.escape(o.id):o.id}"]`),i=n?vn(n):null;if(!i||0===i.height){c[o.id]=null;continue}const s=kn(l,{left:i.left,top:i.top,width:i.width,height:i.height},e),a=s.top+s.height;if(a<d.top||s.top>d.top+d.height){c[o.id]=null;continue}const p=o.below?a+4:Math.max(s.top,d.top)+6;c[o.id]={left:Math.max(s.left,d.left)+6,top:p}}i(c)},c=()=>{s||(s=r.requestAnimationFrame(d))};d(),r.addEventListener("scroll",c,!0),r.addEventListener("resize",c);const a=new r.MutationObserver(c);return a.observe(t.body,{childList:!0,subtree:!0,attributes:!0}),()=>{s&&r.cancelAnimationFrame(s),r.removeEventListener("scroll",c,!0),r.removeEventListener("resize",c),a.disconnect()}},[e,l]),/* @__PURE__ */Jn("div",{ref:o,className:"es-band-tabs","aria-hidden":"true",children:n.map(e=>{const n=r[e.id];return n?/* @__PURE__ */Jn("span",{className:"es-band-tab","data-band-tab":e.id,style:{left:n.left,top:n.top},onClick:n=>{n.stopPropagation(),t(e.id)},children:/* @__PURE__ */Jn(jn,{colorClass:Rn("info","solid"),size:"sm",children:e.label})},e.id):null})})}function Qn({expand:e}){/* @__PURE__ */
2
+ return Jn("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */Gn(Kn,e?{children:[
3
+ /* @__PURE__ */Jn("path",{d:"M8 9l4-4 4 4"}),
4
+ /* @__PURE__ */Jn("path",{d:"M8 15l4 4 4-4"})]}:{children:[
5
+ /* @__PURE__ */Jn("path",{d:"M8 4l4 4 4-4"}),
6
+ /* @__PURE__ */Jn("path",{d:"M8 20l4-4 4 4"}),
7
+ /* @__PURE__ */Jn("path",{d:"M5 12h14"})]})})}var _n=`${hn}, ${mn}`;function et(e,n,t){const o=t-n;if(o<6)return null;if(o<24)return{top:Math.round((n+t)/2),height:Math.round(o)};return{top:Math.round(Math.min(Math.max(e,n+12),t-12))}}var nt="__rungs";var tt="screen:band",ot={duplicate:!0,delete:!0};function rt(){const hn=de(),{target:kn,docId:bn,capabilities:vn,currentSlug:Rn,siteId:rt,onPublish:it,saveState:lt,saveConflict:st,retrySave:dt,toggleAutoSave:ct,flushSave:at,access:pt,saveUnreachable:ut=!1,readOnly:ft,readOnlyReason:ht=null}=te(),mt=N(),gt=O(),{mediaEditing:yt,hasEditGuard:St,hasPinnedChrome:kt}=vn,{appState:bt,dispatch:vt,history:wt,selectedItem:xt,getSelectorForId:zt,config:Ct}=Ne(e=>e),Bt=P(),{first:It,firstGroup:Nt,lastGroup:Ot,isSectionGroup:Pt,sectionGroupZone:$t,panelOf:Tt}=Bt,Lt=Tt(It),Mt=e=>Z(Bt,e),jt=e=>q(Bt,e),At="node"===Bt.firstRow,Rt=Bt.band??null,Et=rn("screen",ue),Vt=rn("tree",Re),Ft=rn("drag",cn),Wt=rn("notice",_e),Ht=rn("lock",on),Dt=rn("menu",Ee),Ut=rn("styleClipboard",me),Xt=rn("chrome",en),Jt=$()??`/${Rn}`,Gt=T(),Kt=L(),Yt=S({readOnly:ft}),Zt=S({readOnly:ft,foldIntoHistory:!0}),qt=Nn(null),Qt=Oe(),_t=On(()=>({...Yt,select:e=>{qt.current=e,Yt.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=Qt.config;qt.current=Ve(e,t,n)}Yt.commitDocument(e,n)}}),[Yt,Qt]),eo=bt.ui,no=eo.leftSideBarVisible,to=eo.rightSideBarVisible,{options:oo,widths:ro,initial:io,fluid:lo,fit:so}=M(),[co,ao]=Pn(io),po=re(),uo=yt&&null!==po,fo=ie(),ho=le();j(xt?.props.id);const{read:mo,write:go,forSelection:yo}=A(),[So,ko]=Pn(mo);$n(()=>{go(So)},[So]);const[bo,vo]=Pn(0),wo=Nn(null),xo=Nn(null),zo=fn(xo,{readySelector:_n}),Co=gn(zo),Bo=c(xo);a(xo,zo);const Io=v(),No=nn(pt),Oo={state:lt,offline:Io||lt.failed&&ut,readOnlyReason:ht,editing:No?Wt.editing({name:tn(No.name,Ht),noun:Et.noun}):null,conflict:null!=st,notSaving:Et.bar.notSaving},Po=()=>{ft||(lt.failed?dt():at())};p(xo,zo,Po);const[$o,To]=Pn(!1),Lo=Nn(!1),Mo=Nn(!1),[jo,Ao]=Pn(null),[Ro,Eo]=Pn([]),[Vo,Fo]=Pn(R),Wo="puck"===Vo.kind,Ho=t(Vo,xt?.props.id),[Do,Uo]=Pn(null);$n(()=>{Do&&(o(),Uo(null))},[Do]);const Xo=Nn(zt);Xo.current=zt;const Jo=Tn((e,{scroll:n})=>{ko(n=>yo(e,n)),n&&Uo(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=Xo.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&vr(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),Go=Nn(null);$n(()=>{const e=Go.current;Go.current=null;const n=null==xt?.props.id?null:String(xt.props.id);Fo(t=>e&&e.id===n?e.mode:"part"===t.kind&&"nodeId"in t&&t.nodeId===n?t:Tt(xt?.type)??R);const t=xt?.props.id,o=qt.current;if(qt.current=null,!t)return;const i=zt(t);Jo(String(t),{scroll:!r(o,i??null,be)})},[xt?.props.id,Jo]);const Ko=Tn(e=>{Fo(n=>E(n,e)?n:e),vt({type:"setUi",ui:{rightSideBarVisible:!0}})},[vt]),Yo=Nn(()=>{});Yo.current=(e,n)=>{const t=e?hi(e.zone??be)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==xt?.props.id?null:String(xt.props.id);Fo(e=>E(e,n)?e:n),o!==r&&(Go.current={id:o,mode:n},_t.select(e))};const Zo=Tn((e,n)=>Yo.current(e,n),[]),qo={kind:Vo.kind,mode:Vo,open:Ko,show:e=>Fo(e),reveal:()=>{to||vt({type:"setUi",ui:{rightSideBarVisible:!0}})},select:Zo},Qo=V(qo,{data:bt.data,selected:xt??null,zoneOf:e=>zt(e)?.zone,readOnly:Boolean(ft),select:e=>{Fo(R),_t.select({index:e})},replace:(e,n)=>_t.replaceComponent(be,e,n),scrollTo:e=>l(e)},{device:co,refreshes:bo},{setView:ko,reveal:()=>{no||vt({type:"setUi",ui:{leftSideBarVisible:!0}})}}),_o=Qo.resolveLeftView?Qo.resolveLeftView(So,uo):"media"===So&&uo?So:"sections",er=F(),{isLockedBlock:nr,duplicateBlocked:tr,nestDepth:or,newSectionNode:rr,canAddTo:ir,blockIsOffered:lr}=er,sr=W(),{labelAtLevel:dr,Icon:cr,useProducts:ar}=sr,pr=sr.rowName?(e,n,t)=>sr.rowName(e,n,t):void 0,ur=Tn(e=>{vt({type:"setUi",ui:{rightSideBarVisible:!0}}),l(e),Jo(e,{scroll:!0})},[vt,Jo]),{selectNode:fr,openPartId:hr}=y({mode:Vo,setMode:Fo,onOpenPart:ur}),[mr,gr]=Pn(null);ce(null!==mr,()=>gr(null));const yr=h(H()),Sr=yr.collapsed,kr=yr.panelWidths,[br,vr]=Pn(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(Sr);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
8
+ return new Set}});$n(()=>{try{window.localStorage.setItem(Sr,JSON.stringify([...br]))}catch{}},[br]);const[wr,xr]=Pn(()=>{if("undefined"==typeof window)return{...m};try{const e=window.localStorage.getItem(kr);if(!e)return{...m};const n=JSON.parse(e);return{left:g(Number(n.left)||m.left),right:g(Number(n.right)||m.right)}}catch{return{...m}}});$n(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(kr,JSON.stringify(wr))}catch{}},300);return()=>clearTimeout(e)},[wr]);const zr=Tn((e,n)=>xr(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),Cr=Tn(e=>zr("left",e),[zr]),Br=Tn(e=>zr("right",e),[zr]),Ir=e=>br.has(e),Nr=e=>vr(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Or=Nn(!1),Pr=Nn(null);$n(()=>{if(Or.current&&!$o){const e=Pr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??xo.current?.querySelector(`button[aria-label="${CSS.escape(Et.add.title)}"]`))?.focus(),Pr.current=null}Or.current=$o},[$o]),$n(()=>{if(!$o||!Bo)return;const e=e=>{"Escape"===e.key&&Ji()};return Bo.addEventListener("keydown",e),()=>Bo.removeEventListener("keydown",e)},[$o,Bo]),ce($o,()=>Ji()),$n(()=>{!no&&$o&&(To(!1),Ao(null),Lo.current=!1)},[no]),$n(()=>{if(!fo)return Mo.current&&vt({type:"setUi",ui:{leftSideBarVisible:!1}}),void(Mo.current=!1);$o&&(To(!1),Ao(null),Mo.current=Lo.current,Lo.current=!1),no||(Mo.current=!0,vt({type:"setUi",ui:{leftSideBarVisible:!0}}))},[fo]),$n(()=>{!no&&fo&&(Mo.current=!1,ho())},[no]),$n(()=>{if(!fo||!Bo)return;const e=e=>{"Escape"===e.key&&ho()};return Bo.addEventListener("keydown",e),()=>Bo.removeEventListener("keydown",e)},[fo,Bo]),ce(null!==fo,()=>ho());const $r=D(),Tr=(e,n="success",t)=>{if($r)return void(t?$r(e,"error"===n?"error":"info",t):$r(e,"error"===n?"error":"info"));const o={sound:!1,action:t?.action,onClose:t?.onClose};"error"===n?An.error(e,{...o,duration:t?.duration??3200}):An.success(e,{...o,duration:t?.duration??1900})},Lr=Nn(null),[Mr,jr]=Pn(0),[Ar,Rr]=Pn(0),Er=U(),Vr=Nn(null),Fr=e=>Math.max(0,e.clientHeight-(Vr.current?.offsetHeight??0));$n(()=>{const e=Lr.current;if(!e)return;const n=()=>{jr(e.clientWidth),Rr(Fr(e))};n();const t=new ResizeObserver(n);return t.observe(e),Vr.current&&t.observe(Vr.current),()=>t.disconnect()},[]),Ln(()=>{Lr.current&&(jr(Lr.current.clientWidth),Rr(Fr(Lr.current)))},[wr,no,to]);const Wr=co===lo?Mr>0?Mr:ro[lo]:ro[co],Hr=Mr>0?Math.min(Mr/Wr,"shrink"===so?1:2):1,Dr=Wr*Hr,Ur=Mr>0&&Dr>Mr+1,Xr={width:Dr,height:Ar||"100%",flex:"none",position:"relative"},Jr={width:Wr,height:Ar?Ar/Hr:"100%",maxHeight:"none",transform:1!==Hr?`scale(${Hr})`:void 0,transformOrigin:"top left"},Gr=()=>vt({type:"setUi",ui:{leftSideBarVisible:!no}}),Kr=()=>vt({type:"setUi",ui:{rightSideBarVisible:!to}}),Yr=e=>{$o&&(To(!1),Ao(null),Lo.current=!1,no&&So===e)||fo&&(Mo.current=!1,ho(),no&&So===e)||(no&&So===e?Gr():(ko(e),no||vt({type:"setUi",ui:{leftSideBarVisible:!0}})))},Zr=()=>{oe(hn,{accept:"image/*",title:Xt.mediaLibrary})},qr=()=>{Fo(R),_t.select(null),d()},Qr=()=>{Fo(Lt??R),to||vt({type:"setUi",ui:{rightSideBarVisible:!0}})},_r=bt.data.content??[],ei=()=>{const e=_r.findIndex(Mt),n=_r.findIndex(jt);return{floor:e>=0?e+1:0,cap:n>=0?n:_r.length}},ni=Ct,ti=er.stripCopy,oi=e=>i(e,ti),ri=_(),ii=Fe({data:bt.data,config:ni,readOnly:Boolean(ft),clipboard:ri,strip:ti?e=>ti(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==wn||e.slot!==xn)return{min:0,max:n-1};const{floor:t,cap:o}=ei();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&Fo(R);const t=void 0===n||"node"===n?.kind?n:null;_t.commitDocument(e,t)}}),li=e=>{const n=Bn(bt.data,Ct,e);if(!n)return!1;const t=zn(n.place),o=n.node,r=t===be?pi(o):Ci(o);return!!ii.remove(e)&&(Tr(Et.deleted({name:r}),"success",{duration:8e3,action:{label:Et.bar.undo,onClick:()=>{ii.restore(n.node,n.place)}}}),!0)},si={...ii,remove:li},di=e=>dr(e,"block",Ct.components[e]?.label??e),ci=Tn(e=>Ct.components[e]?.defaultProps??{},[Ct]),ai=e=>dr(e,"section",di(e)),pi=e=>ge({type:e.type,props:e.props??{}},ai(e.type),pr),{nodeAddresses:ui,zoneItems:fi}=On(()=>{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>=we)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of xe(Ct,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(_r,be,0),{nodeAddresses:e,zoneItems:n}},[_r,Ct]),hi=Tn(e=>fi.get(e)??[],[fi]),mi=e=>{const n=ui.get(e);return n?hi(n.zone)[n.index]:void 0},gi=e=>Q(er,Ct,e),yi=e=>{if(!er.slotsOf||e===be)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=mi(e.slice(0,n));if(!t)return null;const o=gi(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}},Si=(()=>{if(!X(Vo))return null;const e=`${Vo.nodeId}:${Vo.slot}`;return yi(e)?.slot.panel===Vo.kind?e:null})(),ki=Nn(null);$n(()=>{const e=ki.current;if(ki.current=null,!Si||!X(Vo))return;const n=Vo.nodeId;Jo(n,{scroll:e!==Si}),vr(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[Vo]);const bi=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=ui.get(e);n&&(n.zone===be?Vi(n.index):ul(n.zone,n.index,e,mi(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&Si!==i&&(ki.current=i),Zo(null,r),to||vt({type:"setUi",ui:{rightSideBarVisible:!0}}),l(o)},vi=(e,n,t)=>{const o=`${e}:${n}`;if(vr(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;Si!==o&&(ki.current=o);Zo(null,{kind:t,nodeId:e,slot:n})},wi=(e,n,t)=>{if(ft||!er.moveSlot)return;const o=mi(e),r=o?gi(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:nt,index:n},s=un(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=er.moveSlot(e,n,s);"string"==typeof d&&vi(e,d,i.panel)},xi=ar(),zi=On(()=>{const e=/* @__PURE__ */new Map;for(const n of xi??[])e.set(n.slug,n.name);return e},[xi]),Ci=e=>ye(e,di,sr.plainText,e=>zi.get(e),sr.rowName),Bi=(e,n)=>{const t=Ct.components[e.type]?.fields,o=n===be||Ll(n)?"section":"block",r=n===be&&(Mt(e)||jt(e)||Pt(e.type)),i="block"===o?Se(t):r?null:ke(t);return sr.renamePropOf?sr.renamePropOf(e,o,i):i},Ii=(e,n,t,o)=>{if(!(!ft&&mr?.zone===e&&mr.index===n))return;const r=(t,o)=>{gr(null),o&&((e,n,t)=>{const o=hi(e)[n];if(!o)return;const r=Bi(o,e);r&&_t.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
9
+ return Jn("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":Et.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)},Ni=n(J(),Ut),Oi=Ni.scope({target:kn,siteId:rt,docId:bn}),Pi=Ct,$i=(e,n)=>n===be?ai(e):di(e),Ti=(e,n,t)=>{const o=Ni.plan(Oi,t,$i(t.type,e),Pi);o&&(o.changed&&_t.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),Tr(o.message))},Li=ee({nodesIn:hi,nodeAt:(e,n)=>hi(e)[n]??null,labelOf:(e,n)=>n===be?ai(e):di(e),renamePropOf:Bi,beginRename:(e,n)=>gr({zone:e,index:n}),history:{hasPast:wt.hasPast,hasFuture:wt.hasFuture,back:()=>wt.back(),forward:()=>wt.forward()},openPageSettings:()=>{_t.select(null),Fo(R)},pageSettingsLabel:Et.pageSettings,words:{menu:Dt,styleClipboard:Ut,screen:Et.menu},readOnly:Boolean(ft),collapseAll:()=>vr(new Set(hi(be).map(e=>String(e.props.id)))),onPasteRefused:e=>Tr(e?Et.pasteRefused({name:e.label}):Et.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>Al(e,n),menuRows:Qo.menuRows,isLocked:e=>nr(e.type),duplicateBlocked:e=>tr(bt.data,e),permits:e=>ve(Ct,e.type),nodeOps:si,isPinned:(e,n)=>n===be&&(Mt(e)||jt(e)),sectionBand:ei,locate:e=>ui.get(e)??null,rowNameOf:(e,n)=>n===be?pi(e):Ci(e),selectAt:(e,n,t,o)=>{e===be?Vi(n):ul(e,n,t,o??"")},slotRung:e=>{const n=yi(e);return n?.slot.panel?{label:n.slot.label,select:()=>bi(n.node,n.slot,!1)}:null},style:{held:()=>fe(Oi),canCopy:e=>Ni.rows(Pi,e).some(e=>!1!==e.counted),copy:(e,n)=>Ni.copy(Oi,e,$i(e.type,n),Pi),paste:(e,n,t)=>Ti(e,n,t)},keys:gt?{target:Bo,selected:()=>{const e=bt.ui.itemSelector;return e?{zone:e.zone??be,index:e.index}:null},held:()=>ri.get(),readOnly:Boolean(ft),onDone:({done:e,name:n})=>{"copied"===e&&Tr(Et.copied({name:n}))}}:void 0},zo),Mi=Nn({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});$n(()=>{Mi.current={copy:(e,n)=>Ni.copy(Oi,e,$i(e.type,n),Pi),paste:Ti,at:()=>{const e=bt.ui.itemSelector;if(!e)return null;const n=e.zone??be,t=hi(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(ft)}});const ji=Tn(e=>{const n=he(e);if(!n)return;const t=Mi.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))},[]);$n(()=>{if(!Bo)return;const e=e=>ji(e);return Bo.addEventListener("keydown",e),()=>Bo.removeEventListener("keydown",e)},[ji,Bo]),yn(zo,"keydown",ji);const Ai=_r.map(e=>e.props.id).join("|");$n(()=>{const e=zo?.document??null,n=zo?.window??null;let t=0;const o=[],r=()=>{if(!e)return void Eo(e=>e.length?[]:e);const n=_r.findIndex(jt),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(mn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=_r.length>0&&!Mt(_r[0])?0: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=et(l&&s?(s.bottom+l.top)/2:l?0===e?l.top+12:l.top:s.bottom,Math.max(0===e?0:-1/0,...r(t).map(e=>e.bottom)),Math.min(1/0,...r(n).map(e=>e.top)));d&&i.push({...d,index:e})}Eo(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()}},[zo,Ai,co,Hr,no,to,xt?.props.id]);const Ri=zo?.document??null,Ei=zo?.window??null;$n(()=>{const e=wo.current;if(!e||!Ri||!Ei)return;const n=[],t=()=>{const n=Ri.querySelector(`[data-puck-component="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&Ei.scrollTo({left:Ei.scrollX,top:Ei.scrollY+t,behavior:"instant"}),!0};return wo.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[Ri,Ei]);const Vi=e=>{Fo(R),_t.select({index:e}),Qo.sectionPressed?.(_r[e]);const n=_r[e]?.props?.id;n&&l(n)},Fi=e=>{const{floor:n,cap:t}=ei(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=xt&&Vo.kind!==Lt?.kind?_r.findIndex(e=>e.props.id===xt.props.id):-1;return o(r>=0?r+1:t)},Wi=(e,n)=>{const{floor:t,cap:o}=ei(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(_t.reorderComponent(be,e,i),_t.select({index:i}),{moved:!0,dest:i})},Hi=(e,n,t,o)=>{Fo(R),_t.select(o?{index:o.index,zone:o.zone}:{index:e}),l(n),Tr(Et.sectionAdded({name:t}))},Di=(e,n)=>{const t=Fi(n),o=rr(e,{nodeDefaults:ci,newNodeId:Ie,sectionLabel:ai,blockIsOffered:lr}),r=o?_t.insertNode(be,t,o):_t.insertSection(e,t);return Hi(t,r,ai(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 xe(Ct,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=ir(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},Ui=e=>Xi(be,e),Xi=(e,n)=>{Pr.current=document.activeElement??null,fo&&(Lo.current=Mo.current,Mo.current=!1,ho()),Ao(null===n?null:{zone:e,index:n}),To(!0),no||(Lo.current=!0,vt({type:"setUi",ui:{leftSideBarVisible:!0}}))},Ji=()=>{To(!1),Ao(null),Lo.current&&vt({type:"setUi",ui:{leftSideBarVisible:!1}}),Lo.current=!1},Gi=(e,n)=>sr.rowName?n?Mt(e)?sr.rowName(e,"section",Et.header):jt(e)?sr.rowName(e,"section",Et.footer):Pt(e.type)?sr.rowName(e,"section",di(e.type)):pi(e):Ci(e):n?ai(e.type):di(e.type),Ki=e=>n=>{e()},Yi=(e,n,t)=>{if(ft)return null;const o=hi(e)[n];return o&&!ve(Ct,o.type).delete?null:/* @__PURE__ */Jn(je,{kind:"delete",label:Et.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=hi(e)[n]?.props?.id;null!=t&&li(String(t))})(e,n),children:/* @__PURE__ */Jn(Hn,{size:15})})},Zi=e=>sr.rowPreview?.(e)||void 0,qi=e=>sr.rowMarks?.(e)??void 0,Qi=(e,n,t)=>sr.rowActions?.(e,n,t)??null,_i=(e,n,t,o)=>{if(ft)return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
10
+ return Jn(je,{kind:"eye",label:r?Et.showNamed({name:o}):Et.hideNamed({name:o}),onClick:()=>nl(e,n,t),children:/* @__PURE__ */Jn(r?Dn:Un,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},el=e=>fs(be,e),nl=(e,n,t)=>{_t.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},tl=e=>ze(Ct,e),ol=e=>xe(Ct,e),rl=e=>er.slotsOf?gi(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:Ce(e,n.slot)})):[{slot:null,rung:null,kids:ol(e)}],il=e=>er.slotsOf?rl(e).flatMap(e=>e.kids):ol(e),ll=e=>Boolean(er.slotsOf)&&gi(e).some(e=>e.rung),sl=(e,n,t)=>null===t?void 0===n?ir(e):ir(e,n):ir(e,n,t),dl=(e,n,t)=>{const o=Be(Ct,e.type,n)&&(t||il(e).length>0||ll(e));return{collapsible:o,folded:o&&Ir(String(e.props.id))}},cl=(e,n,t)=>rl(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>dl(e,r,t(e.type)).collapsible?[String(e.props.id),...cl(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),al=e=>il(e).length>0||ll(e)||Boolean(ir(e.type)),pl=e=>Boolean(ir(e)),ul=(e,n,t,o)=>{if(Fo(R),ir(o)?.spec?.slider){const t=e.split(":")[0];s(t,n),_t.select({index:n,zone:e}),l(t)}else _t.select({index:n,zone:e}),l(t)},fl=(e,n,t,o,r)=>{const i=`${e}:${n}`;_t.insertComponent(i,t,o),ir(r)?.spec?.slider?requestAnimationFrame(()=>{s(e,o),_t.select({index:o,zone:i})}):_t.select({index:o,zone:i})},hl=Nn(/* @__PURE__ */new Set);$n(()=>{_r.forEach(e=>{const n=ir(e.type)?.spec;if(!n)return;const t=e.props.id;if(hl.current.has(t))return;hl.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(ci)).forEach((e,t)=>Zt.seedChild(o,t,n.childType,e))})},[_r,Zt,ci]);const ml=Nn(/* @__PURE__ */new Set);$n(()=>{_r.forEach((n,t)=>{const o=n.props.id;if(ml.current.has(o))return;const r=e(n,tl(n.type));ml.current.add(o),r&&Zt.replaceComponent(be,t,{...n,props:r})})},[_r,Zt]),G(Zt,Ct);const gl=_r.findIndex(jt),yl=gl>=0?_r[gl]:null,Sl=At?_r.findIndex(Mt):-1,kl=Sl>=0?_r[Sl]:null,bl=Bt.groupTab,vl=On(()=>bl?e=>Pt(e.type):void 0,[bl]),wl=Boolean(Bt.groupBadge),xl=Bt.groupBadge?/* @__PURE__ */Jn("span",{className:"es-tree-group-badge",children:/* @__PURE__ */Jn(jn,{tone:"info",size:"xs",children:Bt.groupBadge})}):void 0,zl=_r.find(e=>e.type===Nt)??null,Cl=_r.find(e=>e.type===Ot)??null,Bl=gl>=0?gl:_r.length,Il=[];_r.forEach(e=>{jt(e)||(al(e)&&Il.push(String(e.props.id)),Il.push(...cl(e,1,pl)))}),yl&&(Il.push(String(yl.props.id)),Il.push(...cl(yl,1,pl)));const Nl=Il.length>0&&Il.every(e=>br.has(e)),Ol=e=>{const n=sr.blockRowName(e,di);return sr.rowName?sr.rowName(e,"block",n):n},Pl=(e,n,t,o)=>{const r=hi(e)[t];if(!r)return;const i={...Cn(e),index:t},l={...Cn(n),index:Math.min(Math.max(o,0),hi(n).length)},s=un(i,l);if(e!==n||s!==t)try{ii.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof In))throw e}},$l=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of ol(e))n.add(r),t(o)};for(const t of tl(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},Tl=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=ui.get(n);if(!e)return null;if(e.zone===be)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},Ll=e=>{const n=e.slice(0,e.indexOf(":")),t=_r.find(e=>Pt(e.type)&&String(e.props.id)===n);return t&&$t(n)===e?t:null},Ml=(e,n)=>{const t=Ll(e);return!t||(!Bt.groupAccepts||Bt.groupAccepts(t.type,n,hi(e).length))},jl=(e,n,t)=>{if(e.rung){const t=mi(e.rung.nodeId),o=t?gi(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===nt&&n.index>=0&&n.index<=o}if(n.slot===nt)return!1;if(e.add)return Vl(e.add,n);const o=zn(n);if(Pt(e.type))return!1;const r=Ll(o),i=Ll(e.zone);if(r||i)return!(!r||!i)&&(!(r!==i&&!Ml(o,e.type))&&(n.index>=0&&n.index<=hi(o).length));if(e.zone===be||o===be){if(e.zone!==o)return!1;const{floor:t,cap:r}=ei();return n.index>=t&&n.index<=r}if(n.index<0||n.index>hi(o).length)return!1;if(e.zone===o)return!0;const l=yl&&!Bt.lastIsOpen?String(yl.props.id):null;return(!l||Tl(e.zone)!==l&&Tl(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??hi(e)[t];if(!r)return!1;const i=n.split(":")[0],l=ui.get(i),s=l?hi(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&$l(r).has(n))return!1;const d=ir(s.type,or(bt?.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?.(hi(n),r))})(e.zone,o,e.index,t)},Al=(e,n)=>{const t=zn(e.from),o=e.node;return t===zn(n)?Ml(t,o.type):jl({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},Rl=e=>{const n=e.slice(0,e.indexOf(":")),t=ui.get(n),o=t?hi(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=ir(o.type,or(bt?.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=B(r.choices??(r.spec?[{type:r.spec.childType,label:di(r.spec.childType)}]:[])),l=yi(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:Gi(o,t.zone===be)}},El=(e,n)=>{if("section"!==e.kind)return e;const t=zn(n);return t===be||Ll(t)?e:Rl(t)?.choices.some(n=>n.type===e.type)?{kind:"block",type:e.type}:e},Vl=(e,n)=>{const t=El(e,n),o=zn(n);if("block"!==t.kind){if(Ll(o)){const e="section"===t.kind?t.type:t.template.node.type;return Ml(o,e)&&n.index>=0&&n.index<=hi(o).length}if(o!==be)return!1;const{floor:e,cap:r}=ei();return n.index>=e&&n.index<=r}if(o===be)return!1;const r=Rl(o);return!(!r||!r.choices.some(e=>e.type===t.type))&&!r.target.spec?.addBlocked?.(hi(o))},Fl=(e,n)=>{const t=El(e,n);if("block"!==t.kind&&Ll(zn(n)))return void((e,n,t)=>{const o="section"===e.kind?e.type:"template"===e.kind?e.template.node.type:null;if(o&&Ml(n,o)){if("section"===e.kind)_t.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;_t.insertNode(n,t,oi(e.template.node))}Fo(R),_t.select({index:t,zone:n})}})(t,zn(n),n.index);if("section"===t.kind)return void Di(t.type,n.index);if("template"===t.kind)return void((e,n,t)=>{const o=Fi(t),r=_t.insertNode(be,o,n);Hi(o,r,e)})(t.template.name,oi(t.template.node),n.index);const o=zn(n),r=Rl(o);r&&(r.target.spec?fl(r.parentId,r.target.slot,t.type,n.index,r.parent.type):((e,n,t)=>{_t.insertComponent(e,n,t),Fo(R),_t.select({index:t,zone:e})})(o,t.type,n.index))},Wl=(e,n)=>{e.rung?wi(e.rung.nodeId,e.index,n.index):e.add?Fl(e.add,n):e.zone===be?Wi(e.index,n.index):Pl(e.zone,zn(n),e.index,n.index)},[Hl]=Pn(()=>an()),Dl=pn({keyOf:e=>e.id,readOnly:Boolean(ft),session:Hl,canDrop:jl,onDrop:Wl,onStep:(e,n)=>{e.rung?wi(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===be?((e,n)=>{const t=ai(_r[e]?.type??""),o=Wi(e,n<0?e-1:e+2);if(!o.moved)return void Tr(n<0?Et.sectionFirst({name:t}):Et.sectionLast({name:t}));const{floor:r,cap:i}=ei();Tr(Et.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):Pl(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),Ul=Tn(e=>{const{floor:n,cap:t}=ei(),o=[];for(const r of e.nodes){const e=zn(r.place),i=hi(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(Mt(i)||jt(i)||nr(i.type))continue;if(Pt(i.type))continue;const l=Boolean(Ll(e)),s=e===be||l;e===be&&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?ai(i.type):Ci(i),from:r.place})}const r=e.zones.flatMap(e=>{const n=zn(e.list);if(n===be&&0===e.children.length)return[{...e,addLabel:Et.addSection,addAlways:!0}];const t=Rl(n),o=t?.target.spec?.addLabel;return e.children.length>0||Boolean(t?.choices.length)||Boolean(Ll(n))?[o?{...e,addLabel:o}:e]:[]}),i=r.flatMap(e=>{const n=zn(e.list),t=n===be||Ll(n)?null:Rl(n);return t?.choices.length?ln(e,t.target.spec?.addLabel??Et.addBlockHere):[]});return{sources:o,zones:r,seams:i}},[bt.data]),Xl=null==xt?.props.id?null:String(xt.props.id),Jl=Tn(e=>{const n=Ct,t=e=>!e.item.rung&&null!==Bn(bt.data,n,e.item.id),o=e[e.length-1];if(!t(o))return o;const r=n=>e.find(e=>t(e)&&e.item.id===n),i=r(Xl);return i||(r(We(bt.data,n,o.item.id,Xl,vl))??o)},[bt.data,Ct,Xl,vl]),[Gl,Kl]=Pn(null);yn(zo,"mouseover",e=>{if(!bl)return;const n=Sn(e.target),t=n?Zn(bt.data,Ct,n):null;t!==Gl&&Kl(t)}),yn(zo,"mouseout",e=>{bl&&!e.relatedTarget&&Kl(null)});const Yl=e=>Mt(e)||jt(e)||Pt(e.type),Zl=[];if(bl){const e=Xl?Zn(bt.data,Ct,Xl):null;for(const n of/* @__PURE__ */new Set([e,Gl])){const e=n?_r.find(e=>String(e.props.id)===n):void 0;if(!e||!Yl(e))continue;const t=bl(e);t&&Zl.push({id:String(e.props.id),label:t,below:Mt(e)||e.type===Nt})}}const ql=se(),Ql=Nn(null);$n(()=>{const e=Bt.changeNotice;if(!e)return;const n=JSON.stringify(_r.filter(Yl)),t=Ql.current;if(Ql.current={doc:bn,bands:n,index:wt.index},!t||t.doc!==bn||t.bands===n)return;wt.hasPast&&wt.index>=t.index&&!Yn.has(ql)&&(Yn.add(ql),Tr(e,"success",{action:{label:Et.bar.undo,onClick:()=>wt.back()},duration:8e3}))},[_r]);const _l=e=>{Fo(R),_t.select(e.zone===be?{index:e.index}:{index:e.index,zone:e.zone})},es=K(),ns=()=>({data:bt.data,device:co,ops:_t,inspector:qo}),ts=es?.model,os=On(()=>ts?e=>ts(e,Ul(e),ns()):Ul,[ts,Ul,co]),rs=es?.measure,is=rs?(e,n)=>rs(e,n,ns()):void 0,ls=es?.canDrop,ss=ls?(e,n)=>ls(e,n,jl,ns()):jl,ds=es?.drop,cs=ds?(e,n)=>ds(e,n,Wl,ns()):Wl,as=es?.pick,ps=as?e=>as(e,_l,ns()):_l,us=e=>{const n=zn(e),t=yi(n);t&&bi(t.node,t.slot,!1),Xi(n,e.index)},fs=(e,n)=>/* @__PURE__ */Jn(Ae,{...ft?{}:Dl.seam({place:{...Cn(e),index:n}})},`seam:${e}:${n}`),hs={rowClick:Ki,isCollapsed:Ir,toggleCollapse:Nr},ms=e=>{const n=String(e.props.id),t=_r.findIndex(e=>String(e.props.id)===n),o=$t(n),r=hi(o),i=Ir(n),l=di(e.type),s=sr.rowName?sr.rowName(e,"section",l):l,d=e=>fs(o,e);/* @__PURE__ */
11
+ return Gn(Kn,{children:[
12
+ /* @__PURE__ */Jn($e,{words:Vt,icon:/* @__PURE__ */Jn(cr,{type:e.type,size:13}),name:s,preview:Zi(e),marks:qi(e),onSelect:()=>Vi(t),nameSlot:Ii(be,t,n,s),selected:Ho===n,badge:xl,actions:Qi(e,be,t)??void 0,rowProps:{"data-node-id":n,onClick:Ki(()=>Vi(t))},fold:{open:!i,label:"section",onToggle:()=>Nr(n)}}),!i&&/* @__PURE__ */Gn(Te,{children:[r.map((n,t)=>{const r=String(n.props.id),i=pi(n),l=al(n),s=l&&Ir(r),c=()=>ul(o,t,r,e.type),{rowProps:a,...p}=Dl.row({item:{id:r,zone:o,index:t,type:n.type},place:{...Cn(o),index:t}},{"data-node-id":r,onClick:Ki(c)});/* @__PURE__ */
13
+ return Gn(Mn,{children:[d(t),
14
+ /* @__PURE__ */Jn($e,{words:Vt,icon:/* @__PURE__ */Jn(cr,{type:n.type,size:13}),name:i,preview:Zi(n),marks:qi(n),onSelect:c,nameSlot:Ii(o,t,r,i),selected:Ho===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Nr(r)}:void 0,actions:/* @__PURE__ */Gn(Kn,{children:[Yi(o,t,i),Qi(n,o,t),_i(o,t,n,i)]}),rowProps:a}),l&&!s&&/* @__PURE__ */Jn(Te,{children:Ss(n,2)})]},r)}),d(r.length)]})]})},gs=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=Dl.dragging,d=!Ir(l)&&s?.rung?.nodeId!==i,c={...Cn(l),index:0},a=s&&!s.rung&&jl(s,c)?c:void 0,p=()=>bi(e,n,!0),{rowProps:u,...f}=Dl.row({item:{id:`rung:${l}`,zone:`${i}:${nt}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:nt,index:t},into:a,canDrag:Boolean(er.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:Ki(p)}),h=ft?null:er.slotActions?.(e,n.slot);/* @__PURE__ */
15
+ return Gn(Mn,{children:[n.heading,
16
+ /* @__PURE__ */Jn($e,{words:Vt,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:Si===l,...f,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>Nr(l)},actions:h&&h.length>0?/* @__PURE__ */Jn(Kn,{children:h.map((t,o)=>/* @__PURE__ */Jn(je,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(ft||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&vi(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__ */Jn(Hn,{size:15}):/* @__PURE__ */Jn(Xn,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */Jn(Te,{children:r})]},l)},ys=(e,n)=>{const t=rl(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
17
+ return Jn(Kn,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=sl(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=(e,n)=>fs(e,n),p=/* @__PURE__ */Gn(Kn,{children:[i.map(({child:n,zone:t,index:o})=>{const r=Ho===String(n.props.id),{collapsible:i,folded:s}=dl(n,l,pl(n.type)),d=String(n.props.id),c=Ol(n),p=()=>ul(t,o,d,e.type),{rowProps:u,...f}=Dl.row({item:{id:d,zone:t,index:o,type:n.type},place:{...Cn(t),index:o}},{"data-node-id":d,onClick:Ki(p)});/* @__PURE__ */
18
+ return Gn(Mn,{children:[0===o&&a(t,0),
19
+ /* @__PURE__ */Jn($e,{words:Vt,icon:/* @__PURE__ */Jn(cr,{type:n.type,size:13}),name:c,preview:Zi(n),marks:qi(n),onSelect:p,nameSlot:Ii(t,o,d,c),selected:r,hidden:Boolean(n.props._hidden),...f,fold:i?{open:!s,label:"group",onToggle:()=>Nr(d)}:void 0,actions:/* @__PURE__ */Gn(Kn,{children:[Yi(t,o,c),Qi(n,t,o),_i(t,o,n,c)]}),rowProps:u}),i&&!s&&/* @__PURE__ */Jn(Te,{children:ys(n,l+1)}),a(t,o+1)]},String(n.props.id??`${t}-${o}`))}),null===c?d&&!i.some(e=>e.zone===d)?a(d,0):null:0!==i.length||!t.rung&&d!==c?null:a(c,0)]});return t.rung?gs(e,t.rung,r++,o,p):/* @__PURE__ */Jn(Mn,{children:p},t.slot??"")})})},Ss=(e,n)=>{const t=or(bt?.data,e.type,String(e.props.id)),o=rl(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
20
+ return Jn(Kn,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=sl(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=(e,n)=>fs(e,n),g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(c&&!c.fixed&&(null===g||g===f)),S=/* @__PURE__ */Gn(Kn,{children:[l.map(({child:n,zone:t,index:o})=>{const r=Ho===String(n.props.id),i=Ci(n),l=String(n.props.id),{collapsible:d,folded:c}=dl(n,s,pl(n.type)),a=tl(n.type),p=1===a.length?`${l}:${a[0]}`:null,u=p?{...Cn(p),index:hi(p).length}:void 0,f=Dl.dragging,h=u&&f&&jl(f,u)?u:void 0,g=()=>ul(t,o,l,e.type),{rowProps:y,...S}=Dl.row({item:{id:l,zone:t,index:o,type:n.type},place:{...Cn(t),index:o},into:h,canDrag:!nr(n.type)},{"data-node-id":l,onClick:Ki(g)});/* @__PURE__ */
21
+ return Gn(Mn,{children:[0===o&&m(t,0),
22
+ /* @__PURE__ */Jn($e,{words:Vt,icon:/* @__PURE__ */Jn(cr,{type:n.type,size:13}),name:i,preview:Zi(n),marks:qi(n),onSelect:g,nameSlot:Ii(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...S,fold:d?{open:!c,label:"group",onToggle:()=>Nr(l)}:void 0,actions:nr(n.type)?Qi(n,t,o)??void 0:/* @__PURE__ */Gn(Kn,{children:[Yi(t,o,i),Qi(n,t,o),_i(t,o,n,i)]}),rowProps:y}),d&&!c&&/* @__PURE__ */Jn(Te,{children:Ss(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&c&&
23
+ /* @__PURE__ */Jn(w,{small:!0,label:c.addLabel,blocked:c.addBlocked?.(a)??null,onAdd:()=>fl(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?gs(e,o.rung,i++,r,S):/* @__PURE__ */Jn(Mn,{children:S},o.slot??"")})})},ks=$o||null!==fo,bs=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:no&&!ks&&_o===e.id,onSelect:()=>Yr(e.id)}:e,vs=[...(Qo.railLead??[]).map(bs),{id:"sections",label:Et.layers,icon:/* @__PURE__ */Jn(ae,{}),active:no&&!ks&&"sections"===_o,onSelect:()=>Yr("sections")},...(Qo.railTrail??[]).map(bs)];uo?vs.push({id:"media",label:Et.railMedia,icon:/* @__PURE__ */Jn(pe,{}),active:no&&!$o&&(null!==fo||"media"===_o),onSelect:()=>Yr("media")}):yt&&vs.push({id:"media",label:Et.railMedia,icon:/* @__PURE__ */Jn(pe,{}),onSelect:Zr});const ws=[...Qo.railLead??[],...Qo.railTrail??[]].find(e=>"panel"in e&&e.id===_o),xs=Boolean(Rt?.foldable),zs=Rt?.label??(St?Et.pageSections:Et.templateSections),Cs=xs&&Ir(tt),Bs=/* @__PURE__ */Gn(Kn,{children:[_r.map((e,n)=>{if(Mt(e)||jt(e)||Pt(e.type))return null;const t=Ho===String(e.props.id),o=Boolean(e.props._hidden);ol(e);const r=String(e.props.id),i=Qo.hasOwnRows?.(e)??!1,l=al(e)||i,s=l&&Ir(r),d=tl(e.type),c=1===d.length?`${r}:${d[0]}`:null,a=c?{...Cn(c),index:hi(c).length}:void 0,p=Dl.dragging,u=a&&p&&jl(p,a)?a:void 0,{rowProps:f,...h}=Dl.row({item:{id:r,zone:be,index:n,type:e.type},place:{...Cn(be),index:n},into:u},{"data-node-id":r,onClick:Ki(()=>Vi(n))});/* @__PURE__ */
24
+ return Gn(Mn,{children:[n>0&&el(n),
25
+ /* @__PURE__ */Jn($e,{words:Vt,icon:/* @__PURE__ */Jn(cr,{type:e.type,size:13}),name:pi(e),preview:Zi(e),marks:qi(e),onSelect:()=>Vi(n),nameSlot:Ii(be,n,r,pi(e)),selected:t,hidden:o,...h,fold:l?{open:!s,label:"section",onToggle:()=>Nr(r)}:void 0,actions:/* @__PURE__ */Gn(Kn,{children:[Yi(be,n,pi(e)),Qi(e,be,n),_i(be,n,e,pi(e))]}),rowProps:f}),al(e)&&!s&&/* @__PURE__ */Gn(Te,{children:[Ss(e,1),Qo.partRows?.(e,hs)]}),i&&!s&&/* @__PURE__ */Jn(Te,{children:Qo.ownRows?.(e,n,hs)})]},String(e.props.id??n))}),Bl>0&&el(Bl)]}),Is=(e,n,t)=>{const o=String(e.props.id),r=il(e).length>0||ll(e)||Boolean(ir(e.type)),i=r&&Ir(o),l="header"===t?Et.header:Et.footer,s=sr.rowName?sr.rowName(e,"section",l):l;/* @__PURE__ */
26
+ return Gn(Kn,{children:[
27
+ /* @__PURE__ */Jn($e,{words:Vt,icon:/* @__PURE__ */Jn(cr,{type:t,size:13}),name:s,preview:Zi(e),marks:qi(e),badge:xl,onSelect:()=>Vi(n),nameSlot:Ii(be,n,o,s),selected:Ho===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Nr(o)}:void 0,actions:Qi(e,be,n)??void 0,rowProps:{"data-node-id":o,onClick:Ki(()=>Vi(n))}}),r&&!i&&/* @__PURE__ */Jn(Te,{children:ys(e,1)})]})};return(Qo.wrap??(e=>e))(
28
+ /* @__PURE__ */Jn(Y,{target:zo,children:/* @__PURE__ */Gn("div",{ref:xo,className:"sf-editor es-editor",style:Qe(wr),onContextMenu:Li.onEditorContextMenu,...u(hn),children:[
29
+ /* @__PURE__ */Gn(He,{children:[
30
+ /* @__PURE__ */Jn(De,{items:vs,ariaLabel:Et.bar.views}),
31
+ /* @__PURE__ */Gn(Ue,{children:[
32
+ /* @__PURE__ */Jn(Xe,{label:Et.bar.undo,disabled:Boolean(ft)||!wt.hasPast,onClick:()=>wt.back(),children:/* @__PURE__ */Jn(En,{})}),
33
+ /* @__PURE__ */Jn(Xe,{label:Et.bar.redo,disabled:Boolean(ft)||!wt.hasFuture,onClick:()=>wt.forward(),children:/* @__PURE__ */Jn(Vn,{})}),
34
+ /* @__PURE__ */Jn(Je,{}),
35
+ /* @__PURE__ */Jn(Ge,{devices:oo,value:co,onChange:ao}),
36
+ /* @__PURE__ */Jn(Xe,{label:Et.bar.refresh,tip:Et.bar.refreshTip,onClick:()=>{wo.current=(()=>{const e=zo?.document;if(!e)return null;const n=_r.findIndex(jt),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=xt?.props?.id??_r[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),vo(e=>e+1)},children:/* @__PURE__ */Jn(Fn,{})})]}),
37
+ /* @__PURE__ */Gn(Ue,{kind:"right",style:{minWidth:300},children:[
38
+ /* @__PURE__ */Jn(k,{input:Oo,words:Et.saveStatus}),Qo.barLead?.(),Qo.barTrail?.(),Qo.mainAction||!Qo.barMain?/* @__PURE__ */Jn(b,{input:Oo,action:Qo.mainAction??{label:Et.done,onPress:()=>{it(bt.data)}},readOnly:Boolean(ft),saveSwitch:mt,onToggleAutoSave:ct,onSaveNow:Po,bar:Et.bar,words:Et.saveStatus}):Qo.barMain()]})]}),
39
+ /* @__PURE__ */Jn(ne,{}),
40
+ /* @__PURE__ */Gn("div",{className:"sf-body",children:[no?/* @__PURE__ */Gn(Kn,{children:[
41
+ /* @__PURE__ */Jn("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":Et.leftPanel,children:$o?/* @__PURE__ */Jn(x,{at:jo?{label:(e=>{const n=Ll(e.zone);if(n)return Et.add.addingTo({name:sr.rowName?Gi(n,!0):di(n.type)});if(e.zone===be){const n=_r[e.index];return n&&!jt(n)?Et.add.addingBefore({name:Gi(n,!0)}):Et.add.addingAtEnd}const t=Rl(e.zone);return t?Et.add.addingTo({name:t.parentName}):Et.add.addingHere})(jo),onClear:()=>Ao(null)}:void 0,placeBlocks:jo&&jo.zone!==be?Rl(jo.zone)?.choices:void 0,canTake:jo?e=>{if(!jo)return null;const n={...Cn(jo.zone),index:jo.index};if(Vl(e,n))return null;const t=Ll(jo.zone);if(t)return Et.add.notInside({name:Gi(t,!0)});if(jo.zone===be)return Et.add.onlySections;const o=Rl(jo.zone);return o?Et.add.notInside({name:o.parentName}):Et.add.onlySections}:void 0,onPick:jo?e=>{if(!jo)return;const n={...Cn(jo.zone),index:jo.index};Vl(e,n)&&(Fl(e,n),Ji())}:void 0,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:Hl,siteWide:Qo.addPanelRow?.(Ji),onClose:Ji,onHide:Gr,readOnly:Boolean(ft)}):fo&&po?
42
+ /* @__PURE__ */Jn(I,{panel:po,pick:fo,onHide:Gr}):ws?ws.panel({onHide:Gr,notify:Tr}):"media"===_o&&po?/* @__PURE__ */Jn(I,{panel:po,pick:null,onHide:Gr}):/* @__PURE__ */Gn(Kn,{children:[
43
+ /* @__PURE__ */Jn(z,{icon:/* @__PURE__ */Jn(ae,{}),title:Et.layers,context:Jt,actions:/* @__PURE__ */Gn(Kn,{children:[!ft&&/* @__PURE__ */Jn(Ke,{label:Et.add.title,onClick:()=>Ui(null),children:/* @__PURE__ */Jn(Wn,{size:15})}),
44
+ /* @__PURE__ */Jn(Ke,{label:Nl?Et.expandAll:Et.collapseAll,title:0===Il.length?Et.nothingToFold:void 0,disabled:0===Il.length,onClick:()=>vr(e=>{const n=new Set(Il);return Nl?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...Il])}),children:/* @__PURE__ */Jn(Qn,{expand:Nl})})]}),onHide:Gr}),
45
+ /* @__PURE__ */Gn(Le,{className:"sf-tree sf-scroll",words:Vt,children:[
46
+ /* @__PURE__ */Jn($e,{words:Vt,icon:/* @__PURE__ */Jn(cr,{type:"page",size:13}),name:Et.pageSettings,onSelect:qr,selected:!xt&&Wo,rowProps:{onClick:Ki(qr)}}),zl&&/* @__PURE__ */Gn(Kn,{children:[!wl&&/* @__PURE__ */Jn(Me,{children:Et.header}),ms(zl)]}),kt&&!(wl&&zl)&&/* @__PURE__ */Gn(Kn,{children:[!wl&&/* @__PURE__ */Jn(Me,{children:Et.header}),!At&&/* @__PURE__ */Jn($e,{words:Vt,icon:/* @__PURE__ */Jn(cr,{type:"header",size:13}),name:Et.header,badge:xl,onSelect:Qr,selected:Vo.kind===Lt?.kind,rowProps:{onClick:Ki(Qr)}})]}),kl&&!(wl&&zl)&&Is(kl,Sl,"header"),!xs&&/* @__PURE__ */Jn(Me,{children:zs}),xs?/* @__PURE__ */Gn(Kn,{children:[
47
+ /* @__PURE__ */Jn($e,{words:Vt,icon:null,name:zs,fold:{open:!Cs,label:zs,onToggle:()=>Nr(tt)}}),!Cs&&/* @__PURE__ */Jn(Te,{children:Bs})]}):Bs,kt&&!wl&&/* @__PURE__ */Jn(Me,{children:Et.footer}),yl&&!(wl&&Cl)&&Is(yl,gl,"footer"),Cl&&ms(Cl),Qo.treeFoot?.()]})]})}),
48
+ /* @__PURE__ */Jn(Ye,{side:"left",width:wr.left,min:qe,max:Ze,defaultWidth:m.left,label:Et.resizeLeftPanel,onResize:Cr})]}):/* @__PURE__ */Jn(C,{side:"left",onShow:Gr}),
49
+ /* @__PURE__ */Gn("div",{ref:Lr,className:"sf-center sf-scroll","data-sf-canvas-head":Er?"":void 0,style:{overflowX:Ur?"auto":"hidden",overflowY:"hidden"},children:[Er&&/* @__PURE__ */Jn("div",{ref:Vr,className:"sf-canvas-head",children:/* @__PURE__ */Jn(Er,{device:co})}),
50
+ /* @__PURE__ */Gn("div",{className:"sf-frame-scaler",style:Xr,children:[
51
+ /* @__PURE__ */Jn("div",{className:"sf-frame "+(co===lo?"":`sf-frame--${co}`),style:Jr,children:/* @__PURE__ */Gn("div",{className:"sf-preview-host",children:[
52
+ /* @__PURE__ */Jn(Pe.Provider,{value:vl,children:/* @__PURE__ */Jn(Gt,{},bo)}),
53
+ /* @__PURE__ */Jn(sn,{canvas:zo,session:Hl,model:os,measure:is,canDrop:ss,onDrop:cs,choose:Jl,onPick:ps,onZoneAdd:us,onSeamAdd:us,zoneAddLabel:Et.canvasAddBlock,words:Ft.canvas,readOnly:Boolean(ft),revision:bt.data}),Ro.length>0&&!Co&&/* @__PURE__ */Jn("div",{className:"sf-preview-gaps",children:Ro.map(e=>
54
+ /* @__PURE__ */Jn(dn,{index:e.index,label:Et.addSectionHere,onInsert:()=>Ui(e.index),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}},e.index))})]})}),bl?/* @__PURE__ */Jn(qn,{canvas:zo,tabs:Zl,onSelect:e=>{const n=_r.findIndex(n=>String(n.props.id)===e);n>=0&&Vi(n)}}):null]})]}),to?/* @__PURE__ */Gn(Kn,{children:[
55
+ /* @__PURE__ */Jn(f,{value:{selectChild:ul,addChild:fl,childRowName:Ci,blockRowName:Ol},children:/* @__PURE__ */Jn(Kt,{mode:Vo,onOpenWebsiteSettings:Qo.openSettings??(()=>{}),onOpenSiteStyles:Qo.openStyles,onSelectNode:fr,onNotify:Tr,onHidePanel:Kr,nodeActions:xt?ve(Ct,xt.type):ot})}),
56
+ /* @__PURE__ */Jn(Ye,{side:"right",width:wr.right,min:qe,max:Ze,defaultWidth:m.right,label:Et.resizeSettingsPanel,onResize:Br})]}):
57
+ /* @__PURE__ */Jn(C,{side:"right",onShow:Kr})]}),Li.menu]})}))}export{rt as ScreenChrome};
@@ -1,4 +1,4 @@
1
- import{PanelToggleIcon as e}from"./chunk-UMDQ6CLQ.js";import{InspectorHead as n}from"./chunk-IE55HNMA.js";import{DEFAULT_CHROME_WORDS as i}from"./chunk-Z6PVRXVY.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__ */
1
+ import{PanelToggleIcon as e}from"./chunk-UMDQ6CLQ.js";import{InspectorHead as n}from"./chunk-GWIVPLOX.js";import{DEFAULT_CHROME_WORDS as i}from"./chunk-Z6PVRXVY.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
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
3
  return l(d,{children:[a?/* @__PURE__ */r("span",{className:"sf-head-divider","aria-hidden":"true"}):null,
4
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__ */
@@ -0,0 +1 @@
1
+ import{panelFieldsOf as t}from"./chunk-LER7RKTO.js";import{withoutDeviceGate as o,deviceMetaOf as n}from"./chunk-FJL3MYPA.js";import{DESIGN_GROUP_KEY as e,BUCKET_KEY as r}from"./chunk-MQNBD6AB.js";import{STYLE_KIND as s,fieldKind as c,copyStyle as i,heldStyle as p,planPaste as u,pasteMessage as a}from"./chunk-V7U33NF2.js";import{ANCHOR_FIELD_KEYS as f,foldMetaOf as l,MEDIA_FIELD_MARKER as m,TEXT_FIELD_MARKER as h,LINK_FIELD_MARKER as y}from"./chunk-DUVRZ456.js";var j=/* @__PURE__ */new Set([e.Size,e.Design,e.Layout,e.Position]),w=new Set(Object.values(e)),b=new Set(Object.values(r)),S=new Set(f),g=/* @__PURE__ */new Set(["focal","imageFocal"]),k=[m,h,y];function v(t){return`site:${t??""}`}function A(t){if(!t||"object"!=typeof t)return null;const n=t,e=o(t)??t,r=n[s]??e[s];if("string"==typeof r)return r;const i=n.options??e.options;if(Array.isArray(i)){return`choice:${i.map(t=>String(t?.value)).sort().join("|")}`}return c(e)}function D(t){const n=t,e=o(t);return k.some(t=>t in n||e&&t in e)}function L(o,e){const s=t(o,e)??{},c=[];let i=!0,p=!1;for(const[t,o]of Object.entries(s))b.has(t)?(i=t===r.Design,p=!1):w.has(t)?i&&(p=j.has(t)):p&&o&&"object"==typeof o&&!t.startsWith("_")&&(l(o)||S.has(t)||g.has(t)||D(o)||"slot"!==o.type&&c.push({path:[t],kind:A(o),counted:"mobile"!==n(o)?.tier}));return c}function O(t,o,n,e,r){i({scope:n,type:e.type,label:r,rows:t(o,e),props:e.props})}function d(t,o,n,e,r,s){const c=p(n);if(!c)return null;const i=u(c,{type:e.type,rows:t(o,e),props:e.props});return{...i,message:a(i,c.sourceLabel,r,s)}}function F(t,o,n,e){O(L,t,o,n,e)}function R(t,o,n,e,r){return d(L,t,o,n,e,r)}var B={scope:t=>v(t.siteId),rows:(t,o)=>L(t,o),copy:(t,o,n,e)=>F(e,t,o,n),plan:(t,o,n,e)=>R(e,t,o,n)};function M(t,o){if(!t&&!o)return B;const n=t?.rows,e=n?(t,o)=>n(t,o):L;return{scope:t?.scope??B.scope,rows:(t,o)=>e(t,o),copy:t?.copy??((t,o,n,r)=>O(e,r,t,o,n)),plan:t?.plan??((t,n,r,s)=>d(e,s,t,n,r,o))}}export{F as copyNodeStyle,L as nodeStyleRows,R as planNodePaste,A as shopFieldKind,v as siteStyleScope,M as styleClipboardOf};
@@ -1,2 +1,2 @@
1
- import{ScreenPartsProvider as t}from"./chunk-PQRYAW2G.js";import{useEaselHost as r}from"./chunk-U3JP4VGF.js";import{createEasel as e,EaselProvider as n}from"./chunk-SMM3ST7A.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-SPQOPWCL.js";import{useEaselHost as r}from"./chunk-U3JP4VGF.js";import{createEasel as e,EaselProvider as n}from"./chunk-BU2YSTLJ.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};
@@ -1,17 +1,29 @@
1
- import{TEXT_STYLE_CASES as e}from"../chunk-YHZSBL2N.js";import{selectionToVisible as t,selectionToSource as n,richLayout as r,createHistory as l,colorRunOf as o,textRange as a,selectionBox as s,placeWindow as c,offsetOrigin as i,visibleArea as u,ColorWindow as d,markPress as p,pasteToMarkup as m,richInput as h,editVisible as f,MARKUP_CLIPBOARD_TYPE as g,markupOfRange as y}from"../chunk-23VM4PMV.js";export{ColorWindow,MARKUP_CLIPBOARD_TYPE,TYPING_BURST_MS,colorRunOf,createHistory,editVisible,markupOfRange,newLine,pasteToMarkup,richInput,richLayout,selectionToSource,selectionToVisible,setBullet,startCanvasTyping,textMap,toSource,toSourceStart,toVisible}from"../chunk-23VM4PMV.js";import{DEFAULT_COPY_WORDS as v}from"../chunk-B4JN227A.js";import{FieldNumber as b}from"../chunk-2XMHLXMA.js";import{FieldSelect as S}from"../chunk-G3GWAP5R.js";import"../chunk-WRFD4EXD.js";import{SettingsSwitch as k,SettingsField as x,SettingsSegmented as w}from"../chunk-36LVP5WD.js";import{GoldTextInput as E}from"../chunk-H4UMY7QF.js";import{useWords as C}from"../chunk-MFIRYGHW.js";import{registerModalEscapeInterceptor as D,textToolbarRows as N,TextToolbar as L,LinkPicker as O,Tooltip as T,IconButton as R}from"efficient-shell/ui";export{TextToolbar}from"efficient-shell/ui";import{useRef as M,useState as P,useLayoutEffect as K,useEffect as V,useId as F}from"react";import{RETIRED_MARKS as H,applyMark as j,marksIn as B,STANDARD_MARKUP as $,listIn as z,colorIn as W,spanFor as A,findLink as I,colorOver as U,setList as Y,unlinkAt as q,removeLink as G,linkOver as _,writeLink as X}from"efficient-shell/markup";import{jsxs as Z,jsx as J,Fragment as Q}from"react/jsx-runtime";import{ParagraphSpacingIcon as ee,LetterSpacingIcon as te,LineSpacingIcon as ne,TextSizeIcon as re,AlignJustifyIcon as le,AlignRightIcon as oe,AlignCenterIcon as ae,AlignLeftIcon as se,StylesIcon as ce,TypeIcon as ie,AlignmentIcon as ue,ListFormatIcon as de,CaseIcon as pe,ItalicIcon as me,NumberedListIcon as he,ListIcon as fe,ListNoneIcon as ge,CaseLowerIcon as ye,CaseCapitalizedIcon as ve,CaseUpperIcon as be,CaseNormalIcon as Se}from"efficient-shell/icons/efficient";function ke(e,t){const n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}}function xe(e,t,n,r=j){const{start:l,end:o}=ke(e,n);return r(e,l,o,t)}function we(e,t,n){const{start:r,end:l}=ke(e,n),o=r+t.length;return{text:e.slice(0,r)+t+e.slice(l),selectionStart:o,selectionEnd:o}}function Ee(e,t,n,r){switch(t){case"bold":return e.createElement("strong");case"italic":return e.createElement("em");case"strike":return e.createElement("s");case"underline":return e.createElement("u");case"sup":return e.createElement("sup");case"sub":return e.createElement("sub");case"color":{const t=e.createElement("span");return t.className="es-rich-color",r&&(t.dataset.color=r,t.title=r.startsWith("#")?r.toUpperCase():r,t.style.color=r.startsWith("#")?r:`var(--es-color-${r}, inherit)`),t}case"link":{const t=e.createElement("a");return t.className="es-rich-link",n&&(t.title=n),t}default:{const n=e.createElement("span");return n.className="highlight"===t||"accent"===t?"es-rich-emphasis":`es-rich-${t}`,n}}}function Ce(e,t,n,r){const l=e.layout.lines;if(n===t)return r>=e.lines.length?e.layout.text.length:l[r].vis;const o=e.lines.findIndex(e=>e===n||e.contains(n));if(-1===o)return 0;const a=t.ownerDocument.createRange();a.setStart(e.lines[o],0);try{a.setEnd(n,r)}catch{return l[o].vis}return l[o].vis+Math.min(a.toString().length,l[o].text.length)}function De(e,t){const n=e.layout.lines;let r=n.length-1;for(let e=0;e<n.length;e+=1)if(t<=n[e].vis+n[e].text.length){r=e;break}let l=Math.max(0,t-n[r].vis);const o=e.lines[r].ownerDocument.createTreeWalker(e.lines[r],4);let a=o.nextNode(),s=null;for(;a;){if(l<=a.data.length)return[a,l];l-=a.data.length,s=a,a=o.nextNode()}return s?[s,s.data.length]:[e.lines[r],0]}function Ne({value:e,rules:l,multiline:o,readOnly:a=!1,placeholder:s,ariaLabel:c,handle:i,onEdit:u,onSelect:d,onHistory:p,onFormat:v,pending:b,onCommit:S,onCancel:k}){const x=M(null),w=M(null),E=M(null),C=M(null),D=M(null),N=M(e),[L,O]=P(0),T=M({value:e,rules:l,multiline:o,readOnly:a,pending:b,onEdit:u,onHistory:p,onFormat:v});T.current={value:e,rules:l,multiline:o,readOnly:a,pending:b,onEdit:u,onHistory:p,onFormat:v};const R=()=>{const e=x.current,t=w.current,n=e?.ownerDocument.getSelection();if(!(e&&t&&n&&0!==n.rangeCount&&n.anchorNode&&e.contains(n.anchorNode)))return null;const r=Ce(t,e,n.anchorNode,n.anchorOffset),l=n.focusNode&&e.contains(n.focusNode)?Ce(t,e,n.focusNode,n.focusOffset):r;return r<=l?[r,l]:[l,r]},F=(e,t)=>{const n=x.current,r=w.current;if(!n||!r)return;const[l,o]=De(r,e),[a,s]=De(r,t);n.ownerDocument.getSelection()?.setBaseAndExtent(l,o,a,s)};i.current={getSource(){const e=R(),t=w.current;if(!e||!t)return null;const[r,l]=n(t.layout,e[0],e[1]);return{start:r,end:l}},setSource(e,t,n){C.current={text:n,src:[e,t]},O(e=>e+1)},focus(){x.current?.focus()},rangeOf(e,n){const r=x.current,l=w.current;if(!r||!l)return null;const[o,a]=t(l.layout,e,n),[s,c]=De(l,o),[i,u]=De(l,a),d=r.ownerDocument.createRange();return d.setStart(s,c),d.setEnd(i,u),d}},K(()=>{const n=x.current;if(!n||D.current)return;const o=C.current?null:R();w.current=function(e,t){const n=e.ownerDocument;e.replaceChildren();const r=t.lines.map(t=>{const r=n.createElement("div");r.className=null!=t.number?"es-rich-line is-numbered":t.bullet?"es-rich-line is-bullet":"es-rich-line",null!=t.number&&(r.dataset.number=t.number);const l=[],o=()=>l.length?l[l.length-1].el:r;let a=null;for(const e of t.chars){let t=0;for(;t<l.length&&t<e.marks.length&&l[t].id===e.marks[t].id;)t+=1;(l.length>t||e.marks.length>t)&&(a=null),l.length=t;for(let r=t;r<e.marks.length;r+=1){const t=Ee(n,e.marks[r].kind,e.marks[r].href,e.marks[r].color);o().appendChild(t),l.push({id:e.marks[r].id,el:t})}a||(a=n.createTextNode(""),o().appendChild(a)),a.data+=e.ch}return 0===t.chars.length&&r.appendChild(n.createElement("br")),e.appendChild(r),r});return{layout:t,lines:r}}(n,r(e,l)),E.current=e;const a=C.current;if(!a||a.text!==e)return void(o&&n.ownerDocument.activeElement===n&&F(o[0],Math.min(o[1],w.current.layout.text.length)));C.current=null;const s=w.current.layout,[c,i]=a.vis??t(s,a.src[0],a.src[1]);n.ownerDocument.activeElement!==n&&n.focus(),F(c,i)},[e,l,L]);const H=(e,t,r)=>{const l=w.current,[o,a]=n(l.layout,t[0],t[1]);C.current={text:e.text,vis:[e.caret,e.caret]},e.text!==T.current.value?T.current.onEdit(e.text,{start:o,end:a},r):O(e=>e+1)};V(()=>{const e=x.current;if(!e)return;const t=t=>{const{value:n,rules:r,multiline:l,readOnly:o,pending:a}=T.current;if("insertCompositionText"===t.inputType)return;if(t.preventDefault(),o)return;const s=w.current,c=R();if(!s||!c)return;const i="function"==typeof t.getTargetRanges?t.getTargetRanges()[0]:void 0,u=i&&!i.collapsed?[Ce(s,e,i.startContainer,i.startOffset),Ce(s,e,i.endContainer,i.endOffset)]:null,d=h({value:n,rules:r,multiline:l,inputType:t.inputType,data:t.data??t.dataTransfer?.getData("text/plain")??"",html:t.dataTransfer?.getData("text/html"),doc:e.ownerDocument,sel:c,target:u,pending:a});d&&("history"!==d.kind?"format"!==d.kind?H(d.edit,d.range,d.kind):T.current.onFormat(d.style):T.current.onHistory(d.dir))},n=()=>{D.current||O(e=>e+1)};return e.addEventListener("beforeinput",t),e.addEventListener("input",n),()=>{e.removeEventListener("beforeinput",t),e.removeEventListener("input",n)}},[]),V(()=>{const e=x.current;if(!e)return;const t=e.ownerDocument,n=()=>{const e=i.current?.getSource();e&&d(e)};return t.addEventListener("selectionchange",n),()=>t.removeEventListener("selectionchange",n)});const j=(t,n=!1)=>{const r=R();if(!r||r[0]===r[1])return;t.preventDefault();const o=w.current;t.clipboardData.setData("text/plain",o.layout.text.slice(r[0],r[1])),t.clipboardData.setData(g,y(e,l,r[0],r[1])),n&&!a&&H(f(e,l,r[0],r[1],{text:""}),r,"edit")};/* @__PURE__ */
1
+ import{TEXT_STYLE_CASES as e}from"../chunk-YHZSBL2N.js";import{selectionToVisible as t,selectionToSource as n,richLayout as r,createHistory as l,colorRunOf as o,textRange as a,selectionBox as s,placeWindow as c,offsetOrigin as i,visibleArea as u,ColorWindow as d,markPress as p,pasteToMarkup as h,richInput as m,editVisible as f,MARKUP_CLIPBOARD_TYPE as g,markupOfRange as y}from"../chunk-23VM4PMV.js";export{ColorWindow,MARKUP_CLIPBOARD_TYPE,TYPING_BURST_MS,colorRunOf,createHistory,editVisible,markupOfRange,newLine,pasteToMarkup,richInput,richLayout,selectionToSource,selectionToVisible,setBullet,startCanvasTyping,textMap,toSource,toSourceStart,toVisible}from"../chunk-23VM4PMV.js";import{DEFAULT_COPY_WORDS as v}from"../chunk-B4JN227A.js";import{FieldNumber as b}from"../chunk-2XMHLXMA.js";import{FieldSelect as k}from"../chunk-G3GWAP5R.js";import"../chunk-WRFD4EXD.js";import{SettingsSwitch as x,SettingsField as S,SettingsSegmented as w}from"../chunk-36LVP5WD.js";import{useWords as E}from"../chunk-MFIRYGHW.js";import{registerModalEscapeInterceptor as C,textToolbarRows as D,TextToolbar as N,LinkPicker as L,Tooltip as T,IconButton as O}from"efficient-shell/ui";export{TextToolbar}from"efficient-shell/ui";import{useRef as R,useState as K,useLayoutEffect as M,useEffect as P,useId as j}from"react";import{RETIRED_MARKS as B,applyMark as V,marksIn as F,STANDARD_MARKUP as H,listIn as W,colorIn as $,spanFor as z,findLink as I,tokenizeInline as q,colorOver as A,setList as U,unlinkAt as Y,removeLink as G,linkOver as _,writeLink as X}from"efficient-shell/markup";import{jsxs as Z,jsx as J,Fragment as Q}from"react/jsx-runtime";import{ParagraphSpacingIcon as ee,LetterSpacingIcon as te,LineSpacingIcon as ne,TextSizeIcon as re,AlignJustifyIcon as le,AlignRightIcon as oe,AlignCenterIcon as ae,AlignLeftIcon as se,StylesIcon as ce,TypeIcon as ie,AlignmentIcon as ue,ListFormatIcon as de,CaseIcon as pe,ItalicIcon as he,NumberedListIcon as me,ListIcon as fe,ListNoneIcon as ge,CaseLowerIcon as ye,CaseCapitalizedIcon as ve,CaseUpperIcon as be,CaseNormalIcon as ke}from"efficient-shell/icons/efficient";function xe(e,t,n,r,l){for(const o of l){if(o.kind!==n)continue;if(!e.startsWith(o.open,t))continue;const l=t+o.open.length;if(e.startsWith(r,l)&&e.startsWith(o.close,l+r.length))return o}return null}function Se({value:e,rules:t=H,className:n,layerRef:r}){const l=function(e,t){const n=[];let r=0;for(const l of q(e,t)){if("text"===l.kind){l.text.length>0&&(n.push({kind:"text",text:e.slice(r,r+l.text.length)}),r+=l.text.length);continue}const o=xe(e,r,l.kind,l.text,t);if(!o)return[{kind:"text",text:e}];const a=r+o.open.length,s=a+l.text.length,c=s+o.close.length;n.push({kind:"delimiter",text:e.slice(r,a)}),n.push({kind:l.kind,text:e.slice(a,s)}),n.push({kind:"delimiter",text:e.slice(s,c)}),r=c}return n.map(e=>e.text).join("")!==e?[{kind:"text",text:e}]:n}(e,t);/* @__PURE__ */
2
+ return J("div",{ref:r,className:["es-gold-layer",n??""].filter(Boolean).join(" "),"aria-hidden":"true",children:l.map((e,t)=>function(e,t){const{kind:n,text:r}=e;switch(n){case"delimiter":/* @__PURE__ */
3
+ return J("span",{className:"es-gold-delim",children:r},t);case"accent":case"highlight":/* @__PURE__ */
4
+ return J("em",{className:"es-gold-mark es-gold-accent",children:r},t);case"bold":/* @__PURE__ */
5
+ return J("strong",{className:"es-gold-mark es-gold-bold",children:r},t);case"italic":/* @__PURE__ */
6
+ return J("em",{className:"es-gold-mark es-gold-italic",children:r},t);case"strike":/* @__PURE__ */
7
+ return J("s",{className:"es-gold-mark es-gold-strike",children:r},t);case"quiet":/* @__PURE__ */
8
+ return J("span",{className:"es-gold-mark es-gold-quiet",children:r},t);default:/* @__PURE__ */
9
+ return J("span",{className:"es-gold-text",children:r},t)}}(e,t))})}function we({value:e,onInput:t,onCommit:n,onCancel:r,multiline:l=!1,placeholder:o,className:a,rules:s=H,ariaLabel:c,disabled:i=!1,inputRef:u}){const d=R(null),p=R(e),h=R(!1);function m(e){h.current&&(h.current=!1,n?.(e))}/* @__PURE__ */
10
+ return Z("div",{className:["es-gold",l?"es-gold-is-multiline":"es-gold-is-single",i?"es-gold-is-off":"",a??""].filter(Boolean).join(" "),children:[
11
+ /* @__PURE__ */J(Se,{value:e,rules:s,layerRef:d}),o&&""===e?
12
+ /* @__PURE__ */J("div",{className:"es-gold-placeholder","aria-hidden":"true",children:o}):null,
13
+ /* @__PURE__ */J("textarea",{ref:u,className:"es-gold-input",disabled:i,value:e,placeholder:o,"aria-label":c,onChange:function(e){h.current=!0,t(e.currentTarget.value)},onFocus:function(){p.current=e,h.current=!1},onBlur:function(){m(e)},onKeyDown:function(t){return"Escape"===t.key?(t.preventDefault(),h.current=!1,void r?.(p.current)):"Enter"!==t.key||l?void 0:(t.preventDefault(),void m(e))},onScroll:function(e){const t=d.current;t&&(t.scrollTop=e.currentTarget.scrollTop,t.scrollLeft=e.currentTarget.scrollLeft)}})]})}function Ee(e,t){const n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}}function Ce(e,t,n,r=V){const{start:l,end:o}=Ee(e,n);return r(e,l,o,t)}function De(e,t,n){const{start:r,end:l}=Ee(e,n),o=r+t.length;return{text:e.slice(0,r)+t+e.slice(l),selectionStart:o,selectionEnd:o}}function Ne(e,t,n,r){switch(t){case"bold":return e.createElement("strong");case"italic":return e.createElement("em");case"strike":return e.createElement("s");case"underline":return e.createElement("u");case"sup":return e.createElement("sup");case"sub":return e.createElement("sub");case"color":{const t=e.createElement("span");return t.className="es-rich-color",r&&(t.dataset.color=r,t.title=r.startsWith("#")?r.toUpperCase():r,t.style.color=r.startsWith("#")?r:`var(--es-color-${r}, inherit)`),t}case"link":{const t=e.createElement("a");return t.className="es-rich-link",n&&(t.title=n),t}default:{const n=e.createElement("span");return n.className="highlight"===t||"accent"===t?"es-rich-emphasis":`es-rich-${t}`,n}}}function Le(e,t,n,r){const l=e.layout.lines;if(n===t)return r>=e.lines.length?e.layout.text.length:l[r].vis;const o=e.lines.findIndex(e=>e===n||e.contains(n));if(-1===o)return 0;const a=t.ownerDocument.createRange();a.setStart(e.lines[o],0);try{a.setEnd(n,r)}catch{return l[o].vis}return l[o].vis+Math.min(a.toString().length,l[o].text.length)}function Te(e,t){const n=e.layout.lines;let r=n.length-1;for(let e=0;e<n.length;e+=1)if(t<=n[e].vis+n[e].text.length){r=e;break}let l=Math.max(0,t-n[r].vis);const o=e.lines[r].ownerDocument.createTreeWalker(e.lines[r],4);let a=o.nextNode(),s=null;for(;a;){if(l<=a.data.length)return[a,l];l-=a.data.length,s=a,a=o.nextNode()}return s?[s,s.data.length]:[e.lines[r],0]}function Oe({value:e,rules:l,multiline:o,readOnly:a=!1,placeholder:s,ariaLabel:c,handle:i,onEdit:u,onSelect:d,onHistory:p,onFormat:v,pending:b,onCommit:k,onCancel:x}){const S=R(null),w=R(null),E=R(null),C=R(null),D=R(null),N=R(e),[L,T]=K(0),O=R({value:e,rules:l,multiline:o,readOnly:a,pending:b,onEdit:u,onHistory:p,onFormat:v});O.current={value:e,rules:l,multiline:o,readOnly:a,pending:b,onEdit:u,onHistory:p,onFormat:v};const j=()=>{const e=S.current,t=w.current,n=e?.ownerDocument.getSelection();if(!(e&&t&&n&&0!==n.rangeCount&&n.anchorNode&&e.contains(n.anchorNode)))return null;const r=Le(t,e,n.anchorNode,n.anchorOffset),l=n.focusNode&&e.contains(n.focusNode)?Le(t,e,n.focusNode,n.focusOffset):r;return r<=l?[r,l]:[l,r]},B=(e,t)=>{const n=S.current,r=w.current;if(!n||!r)return;const[l,o]=Te(r,e),[a,s]=Te(r,t);n.ownerDocument.getSelection()?.setBaseAndExtent(l,o,a,s)};i.current={getSource(){const e=j(),t=w.current;if(!e||!t)return null;const[r,l]=n(t.layout,e[0],e[1]);return{start:r,end:l}},setSource(e,t,n){C.current={text:n,src:[e,t]},T(e=>e+1)},focus(){S.current?.focus()},rangeOf(e,n){const r=S.current,l=w.current;if(!r||!l)return null;const[o,a]=t(l.layout,e,n),[s,c]=Te(l,o),[i,u]=Te(l,a),d=r.ownerDocument.createRange();return d.setStart(s,c),d.setEnd(i,u),d}},M(()=>{const n=S.current;if(!n||D.current)return;const o=C.current?null:j();w.current=function(e,t){const n=e.ownerDocument;e.replaceChildren();const r=t.lines.map(t=>{const r=n.createElement("div");r.className=null!=t.number?"es-rich-line is-numbered":t.bullet?"es-rich-line is-bullet":"es-rich-line",null!=t.number&&(r.dataset.number=t.number);const l=[],o=()=>l.length?l[l.length-1].el:r;let a=null;for(const e of t.chars){let t=0;for(;t<l.length&&t<e.marks.length&&l[t].id===e.marks[t].id;)t+=1;(l.length>t||e.marks.length>t)&&(a=null),l.length=t;for(let r=t;r<e.marks.length;r+=1){const t=Ne(n,e.marks[r].kind,e.marks[r].href,e.marks[r].color);o().appendChild(t),l.push({id:e.marks[r].id,el:t})}a||(a=n.createTextNode(""),o().appendChild(a)),a.data+=e.ch}return 0===t.chars.length&&r.appendChild(n.createElement("br")),e.appendChild(r),r});return{layout:t,lines:r}}(n,r(e,l)),E.current=e;const a=C.current;if(!a||a.text!==e)return void(o&&n.ownerDocument.activeElement===n&&B(o[0],Math.min(o[1],w.current.layout.text.length)));C.current=null;const s=w.current.layout,[c,i]=a.vis??t(s,a.src[0],a.src[1]);n.ownerDocument.activeElement!==n&&n.focus(),B(c,i)},[e,l,L]);const V=(e,t,r)=>{const l=w.current,[o,a]=n(l.layout,t[0],t[1]);C.current={text:e.text,vis:[e.caret,e.caret]},e.text!==O.current.value?O.current.onEdit(e.text,{start:o,end:a},r):T(e=>e+1)};P(()=>{const e=S.current;if(!e)return;const t=t=>{const{value:n,rules:r,multiline:l,readOnly:o,pending:a}=O.current;if("insertCompositionText"===t.inputType)return;if(t.preventDefault(),o)return;const s=w.current,c=j();if(!s||!c)return;const i="function"==typeof t.getTargetRanges?t.getTargetRanges()[0]:void 0,u=i&&!i.collapsed?[Le(s,e,i.startContainer,i.startOffset),Le(s,e,i.endContainer,i.endOffset)]:null,d=m({value:n,rules:r,multiline:l,inputType:t.inputType,data:t.data??t.dataTransfer?.getData("text/plain")??"",html:t.dataTransfer?.getData("text/html"),doc:e.ownerDocument,sel:c,target:u,pending:a});d&&("history"!==d.kind?"format"!==d.kind?V(d.edit,d.range,d.kind):O.current.onFormat(d.style):O.current.onHistory(d.dir))},n=()=>{D.current||T(e=>e+1)};return e.addEventListener("beforeinput",t),e.addEventListener("input",n),()=>{e.removeEventListener("beforeinput",t),e.removeEventListener("input",n)}},[]),P(()=>{const e=S.current;if(!e)return;const t=e.ownerDocument,n=()=>{const e=i.current?.getSource();e&&d(e)};return t.addEventListener("selectionchange",n),()=>t.removeEventListener("selectionchange",n)});const F=(t,n=!1)=>{const r=j();if(!r||r[0]===r[1])return;t.preventDefault();const o=w.current;t.clipboardData.setData("text/plain",o.layout.text.slice(r[0],r[1])),t.clipboardData.setData(g,y(e,l,r[0],r[1])),n&&!a&&V(f(e,l,r[0],r[1],{text:""}),r,"edit")};/* @__PURE__ */
2
14
  return Z("div",{className:"es-rich-wrap",children:[s&&""===e?/* @__PURE__ */J("div",{className:"es-rich-placeholder","aria-hidden":"true",children:s}):null,
3
- /* @__PURE__ */J("div",{ref:x,className:`es-rich${o?" is-multiline":" is-single"}${a?" is-off":""}`,contentEditable:!a,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":o,"aria-label":c,"aria-readonly":a||void 0,"aria-placeholder":s,tabIndex:a?-1:0,spellCheck:!0,onFocus:()=>{N.current=e},onBlur:()=>{e!==N.current&&S?.(e),N.current=e},onKeyDown:t=>{if("Escape"===t.key)return t.preventDefault(),k?.(N.current),void(N.current=e);"Enter"!==t.key||o||(t.preventDefault(),e!==N.current&&S?.(e),N.current=e)},onCompositionStart:()=>{const e=R()??[0,0];D.current={from:e[0],to:e[1]}},onCompositionEnd:e=>{const t=D.current;if(D.current=null,!t)return;const{value:n,rules:r,pending:l}=T.current;e.data?H(f(n,r,t.from,t.to,{text:e.data,add:l?.add,drop:l?.drop,color:l?.color}),[t.from,t.to],"type"):O(e=>e+1)},onCopy:e=>j(e),onCut:e=>j(e,!0),onPaste:t=>{if(t.preventDefault(),a)return;const n=R();if(!n)return;const r=t.clipboardData.getData(g),s=r?o?r:r.replace(/\s*\r?\n\s*/g," "):m({html:t.clipboardData.getData("text/html"),text:t.clipboardData.getData("text/plain")},{doc:t.currentTarget.ownerDocument,multiline:o,rules:l});H(f(e,l,n[0],n[1],{markup:s}),n,"edit")}})]})}var Le={fontSize:{key:"fontSize",nameKey:"fontSize",icon:/* @__PURE__ */J(re,{}),unit:"px",step:1,shiftStep:10,min:5},lineHeight:{key:"lineHeight",nameKey:"lineHeight",icon:/* @__PURE__ */J(ne,{}),unit:"%",step:1,shiftStep:10,min:50,max:250,scale:100},letterSpacing:{key:"letterSpacing",nameKey:"letterSpacing",icon:/* @__PURE__ */J(te,{}),unit:"px",step:.1,shiftStep:1,min:-10},paragraphSpacing:{key:"paragraphSpacing",nameKey:"paragraphSpacing",icon:/* @__PURE__ */J(ee,{}),unit:"px",step:1,shiftStep:10,min:0}};function Oe(e,t){return void 0===e?void 0:Number((e*t).toFixed(6))}function Te({cells:e,words:t,readOnly:n=!1}){const r=t??v.cells,l=F();/* @__PURE__ */
15
+ /* @__PURE__ */J("div",{ref:S,className:`es-rich${o?" is-multiline":" is-single"}${a?" is-off":""}`,contentEditable:!a,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":o,"aria-label":c,"aria-readonly":a||void 0,"aria-placeholder":s,tabIndex:a?-1:0,spellCheck:!0,onFocus:()=>{N.current=e},onBlur:()=>{e!==N.current&&k?.(e),N.current=e},onKeyDown:t=>{if("Escape"===t.key)return t.preventDefault(),x?.(N.current),void(N.current=e);"Enter"!==t.key||o||(t.preventDefault(),e!==N.current&&k?.(e),N.current=e)},onCompositionStart:()=>{const e=j()??[0,0];D.current={from:e[0],to:e[1]}},onCompositionEnd:e=>{const t=D.current;if(D.current=null,!t)return;const{value:n,rules:r,pending:l}=O.current;e.data?V(f(n,r,t.from,t.to,{text:e.data,add:l?.add,drop:l?.drop,color:l?.color}),[t.from,t.to],"type"):T(e=>e+1)},onCopy:e=>F(e),onCut:e=>F(e,!0),onPaste:t=>{if(t.preventDefault(),a)return;const n=j();if(!n)return;const r=t.clipboardData.getData(g),s=r?o?r:r.replace(/\s*\r?\n\s*/g," "):h({html:t.clipboardData.getData("text/html"),text:t.clipboardData.getData("text/plain")},{doc:t.currentTarget.ownerDocument,multiline:o,rules:l});V(f(e,l,n[0],n[1],{markup:s}),n,"edit")}})]})}var Re={fontSize:{key:"fontSize",nameKey:"fontSize",icon:/* @__PURE__ */J(re,{}),unit:"px",step:1,shiftStep:10,min:5},lineHeight:{key:"lineHeight",nameKey:"lineHeight",icon:/* @__PURE__ */J(ne,{}),unit:"%",step:1,shiftStep:10,min:50,max:250,scale:100},letterSpacing:{key:"letterSpacing",nameKey:"letterSpacing",icon:/* @__PURE__ */J(te,{}),unit:"px",step:.1,shiftStep:1,min:-10},paragraphSpacing:{key:"paragraphSpacing",nameKey:"paragraphSpacing",icon:/* @__PURE__ */J(ee,{}),unit:"px",step:1,shiftStep:10,min:0}};function Ke(e,t){return void 0===e?void 0:Number((e*t).toFixed(6))}function Me({cells:e,words:t,readOnly:n=!1}){const r=t??v.cells,l=j();/* @__PURE__ */
4
16
  return J("div",{className:"es-copy-cells-fit",children:/* @__PURE__ */J("div",{className:"es-copy-cells",children:e.map(e=>{const t=e.scale??1,o=e.name??(e.nameKey?r[e.nameKey]:e.key),a=e.unit??"",s=e.step??1,c=`${l}-${e.key}`;/* @__PURE__ */
5
17
  return Z("div",{className:"es-copy-cell",children:[
6
18
  /* @__PURE__ */J("label",{className:"es-field-label es-copy-cell-name",htmlFor:c,children:o}),
7
- /* @__PURE__ */J(b,{id:c,value:Oe(e.value,t),styleValue:Oe(e.styleValue,t),onChange:n=>e.onChange(void 0===n?void 0:Number((n/t).toFixed(6))),min:e.min,max:e.max,step:s,shiftStep:e.shiftStep,icon:e.icon,unit:a||void 0,steppers:"compact",readOnly:n,ariaLabel:o,title:r.tip({name:o,step:s,unit:a})})]},e.key)})})})}function Re({target:e,onChange:t}){const n=M(null);return K(()=>{const t=n.current,r=e.current;t&&r&&r.value===t.text&&(n.current=null,r.focus(),r.setSelectionRange(t.start,t.end))}),r=>{const l=r(e.current);t(l.text),n.current={start:l.selectionStart,end:l.selectionEnd,text:l.text}}}var Me=/* @__PURE__ */new Set([...H,"clear"]);function Pe({value:e,onChange:t,onCommit:n,onCancel:r,multiline:h=!1,placeholder:f,ariaLabel:g,className:y,readOnly:b=!1,rules:S,tools:x=[],writeMark:w,align:T,actions:R,toolbar:H,barLabel:ee,renderFooter:te,inputRef:ne,barShows:re="always",richText:le=!0,defaultShowMarks:oe=!1,colors:ae,cells:se,letterCase:ce,lastTool:ie}){const ue=C("copy",v),de=M(null),pe=ne??de,[me,he]=P(!1),[fe,ge]=P(null),ye=M(l()).current,ve=M(null);V(()=>{const t=ve.current;t&&e===t.to?ve.current=null:t&&e===t.from||(ve.current=null,ye.reset())},[e,ye]);const be=n=>{ve.current={from:ve.current?.from??e,to:n},t(n)},Se=t=>({text:e,start:t?.selectionStart??fe?.start??e.length,end:t?.selectionEnd??fe?.end??e.length}),[ke,Ee]=P(oe),Ce=le&&!(h&&ke),De=M(null),Le=F(),[Oe,Pe]=P(null),[Ke,Ve]=P(!1),Fe=()=>{if(!Ce)return pe.current;const e=De.current?.getSource()??fe;return e?{selectionStart:e.start,selectionEnd:e.end}:null},He=Re({target:pe,onChange:be}),je=e=>(ge({start:e.selectionStart,end:e.selectionEnd}),e),Be=(t,n)=>{if(!Ce)return void He(e=>(n&&ye.record(Se(e),"edit",Date.now()),je(t(e))));const r=Fe(),l=je(t(r));n&&ye.record(Se(r),"edit",Date.now()),Pe(null),l.text!==e&&be(l.text),De.current?.setSource(l.selectionStart,l.selectionEnd,l.text)},$e=e=>Be(e,!0),ze=e=>Be(t=>{const n=Se(t),r=ye[e](n);return r?{text:r.text,selectionStart:r.start,selectionEnd:r.end}:{text:n.text,selectionStart:n.start,selectionEnd:n.end}},!1),We=M(null);K(()=>{const t=We.current;t&&(We.current=null,Ce?De.current?.setSource(t.start,t.end,e):(pe.current?.focus(),pe.current?.setSelectionRange(t.start,t.end),ge(t)))},[Ce]);const[Ae,Ie]=P(null),Ue=S??$,Ye=("string"==typeof x[0]?x:x.map(e=>e.style)).filter(e=>!Me.has(e)),qe={};if(fe){const t=B(e,fe.start,fe.end,Ue);for(const e of Ye){const n=t.has(e)||"highlight"===e&&t.has("accent");qe[e]=!!Oe?.add.includes(e)||!Oe?.drop.includes(e)&&n}qe.link=t.has("link")}const Ge=()=>{const t=Fe(),n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}},_e=t=>{if("link"!==t&&A(0,t)){const{start:n,end:r}=Ge();if(n===r&&!Ce)return void $e(n=>xe(e,t,n,(e,t,n,r)=>j(e,t,n,r,Ue,ue.placeholders)));const l=p({value:e,rules:Ue,start:n,end:r,style:t,pending:Oe});return void("pending"===l.kind?Pe(l.pending):$e(()=>l.result))}if("link"!==t){const n=w??((e,t,n,r)=>j(e,t,n,r,$,ue.placeholders));return void $e(r=>xe(e,t,r,n))}const n=Fe(),r=n?.selectionStart??e.length,l=n?.selectionEnd??r;Ve(!1),Ie({start:r,end:l,link:I(e,r,l)})},Xe=Boolean(fe&&fe.start!==fe.end),Ze=fe?z(e,fe.start,fe.end,Ue):null,Je=fe?Oe&&void 0!==Oe.color&&Oe.at===fe.start?Oe.color:W(e,fe.start,fe.end,Ue):null,Qe=o(Je,ae),et=t=>{Ce?t?De.current?.setSource(t.start,t.end,e):De.current?.focus():(pe.current?.focus(),t&&pe.current?.setSelectionRange(t.start,t.end))},tt=()=>{const e=Ae;Ie(null),et(e?{start:e.start,end:e.end}:fe)},nt=()=>{const e=lt.current,t=Boolean(e&&e.querySelector(".es-copy-colors")?.contains(e.ownerDocument.activeElement));Ve(!1),t&&et(fe)},rt=M(nt);rt.current=nt,V(()=>{if(Ke)return D(e=>{const t=lt.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&(rt.current(),!0)},()=>lt.current?.querySelector(".es-copy-colors"))},[Ke]);const lt=M(null),ot=Ke||null!==Ae;V(()=>{const e=lt.current;if(!ot||!e)return;const t=e.ownerDocument,n=()=>{Ve(!1),Ie(null)},r=t=>{e.contains(t.target)||n()};let l;const o=r=>{const o=r.relatedTarget;o?e.contains(o)||n():(clearTimeout(l),l=setTimeout(()=>{const r=t.activeElement;t.hasFocus()&&r&&r!==t.body&&!e.contains(r)&&n()},0))};return t.addEventListener("pointerdown",r,!0),e.addEventListener("focusout",o),()=>{clearTimeout(l),t.removeEventListener("pointerdown",r,!0),e.removeEventListener("focusout",o)}},[ot]);const at=Ae??(Ke?fe??{start:e.length,end:e.length}:null),st=M(()=>{});st.current=()=>{const e=lt.current,t=e?.querySelector(".rosh-tb-wrap > .es-copy-pop");if(!e||!t||!at)return;const n=Ce?null:e.querySelector(".es-gold-layer"),r=Ce?De.current?.rangeOf(at.start,at.end)??null:n?a(n,at.start,at.end):null,l=r?.endContainer,o=l?1===l.nodeType?l:l.parentElement:null,d=r?s(r,o?.closest(".es-rich-line, .es-gold-layer")??null):null;if(!d)return;const p=c({anchor:d,size:{width:t.offsetWidth,height:t.offsetHeight},within:e.getBoundingClientRect(),clip:u(e),parent:i(t)});t.style.top=`${p.top}px`,t.style.left=`${p.left}px`,t.style.setProperty("--es-pop-point",`${p.point}px`),t.dataset.side=p.above?"above":"below"},K(()=>{const e=lt.current;if(!ot||!e)return;const t=()=>st.current();t();const n=e.ownerDocument.defaultView;n?.addEventListener("resize",t);const r=e.querySelector(".rosh-tb-wrap > .es-copy-pop"),l=n?.ResizeObserver,o=l&&r?new l(t):null;return o&&r&&o.observe(r),()=>{n?.removeEventListener("resize",t),o?.disconnect()}},[ot,Ke,Ae,at?.start,at?.end,Ce]);const ct="always"===re||me||null!==Ae||Ke,it=ae&&ae.length>0?{run:Qe,open:Ke,onToggle:()=>{Ie(null),Ke?nt():Ve(!0)}}:void 0,ut=ct?ie?ie({className:"rosh-tb-btn",disabled:b,selected:Xe,keepCaret:e=>e.preventDefault(),insert:t=>$e(n=>we(e,t,n))}):"classic"===H?R:void 0:void 0,dt=new Set(Ye),pt=T?{value:T.value,allow:T.allow,onChange:T.onChange,disabled:T.disabled}:void 0,mt={pressed:Ze,onList:t=>{const{start:n,end:r}=Ge(),l=z(e,n,r,Ue);$e(()=>Y(e,n,r,l===t?null:t,Ue))}},ht=N({offered:dt,color:it,last:ut,alignment:pt,list:mt,letterCase:ce});/* @__PURE__ */
8
- return Z("div",{ref:lt,className:"es-copy"+(y?` ${y}`:""),onFocus:()=>he(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||he(!1)},onKeyDown:e=>{const t=e.target===pe.current||Boolean(e.target.closest?.(".es-rich"));if(b||!t)return;if(e.altKey||e.metaKey===e.ctrlKey)return;const n=e.key.toLowerCase(),r="KeyZ"===e.code||"z"===n,l=("KeyY"===e.code||"y"===n)&&!e.shiftKey;if(r||l)return e.preventDefault(),e.stopPropagation(),void ze(l||e.shiftKey?"redo":"undo");const o={b:"bold",i:"italic",u:"underline",k:"link"}[`${e.shiftKey?"shift+":""}${n}`];o&&Ye.includes(o)&&(e.preventDefault(),e.stopPropagation(),_e(o))},onPaste:t=>{const n=pe.current;if(b||!n||t.target!==n)return;t.preventDefault();const r=m({html:t.clipboardData.getData("text/html"),text:t.clipboardData.getData("text/plain")},{doc:n.ownerDocument,multiline:h,rules:Ue});$e(t=>we(e,r,t))},style:ae&&ae.length>0?Object.fromEntries(ae.map(e=>[`--es-color-${e.name}`,e.value])):void 0,onSelect:()=>{const t=pe.current;t&&t.ownerDocument.activeElement===t&&ge({start:t.selectionStart??e.length,end:t.selectionEnd??e.length})},children:[ct&&(ht.words||ht.paragraph)?
9
- /* @__PURE__ */J(L,{className:"es-copy-toolbar","aria-label":ee??ue.formatting,offered:dt,pressed:qe,onMark:e=>_e(e),color:it,linkOpen:null!==Ae,last:ut,alignment:pt,list:mt,letterCase:ce,disabled:b,windows:/* @__PURE__ */Z(Q,{children:[Ke&&ae&&ae.length>0?/* @__PURE__ */J(d,{colors:ae,current:Je,words:ue.colors??v.colors,onPick:t=>{const{start:n,end:r}=Ge();if(n!==r)$e(()=>U(e,n,r,t,Ue));else{if(!Ce)return;Pe({add:Oe?.add??[],drop:Oe?.drop??[],color:t,at:n})}}}):null,Ae?Ae&&/* @__PURE__ */J(O,{className:"es-copy-link es-copy-pop",value:Ae.link?.href??"",onApply:t=>{const n=Ae;Ie(null),$e(()=>Ce?_(e,n.start,n.end,t,Ue):X(e,n.start,n.end,t))},onRemove:Ae.link?()=>{const t=Ae.link,n=Ae;Ie(null),t&&$e(()=>Ce?q(e,n.start,n.end,Ue):G(e,t))}:void 0,onCancel:tt}):null]})}):null,se&&se.length>0?/* @__PURE__ */J(Te,{cells:se,words:ue.cells??v.cells,readOnly:b}):null,Ce?/* @__PURE__ */J(Ne,{value:e,rules:Ue,multiline:h,readOnly:b,placeholder:f,ariaLabel:g,handle:De,pending:Oe??void 0,onEdit:(t,n,r)=>{ye.record({text:e,start:n.start,end:n.end},r,Date.now()),Pe(null),be(t)},onSelect:e=>{ge(t=>t&&t.start===e.start&&t.end===e.end?t:e),!Oe||e.start===Oe.at&&e.end===Oe.at||Pe(null)},onHistory:ze,onFormat:e=>{Ye.includes(e)&&_e(e)},onCommit:n,onCancel:r}):/* @__PURE__ */J(E,{value:e,onInput:e=>{ye.record(Se(null),"type",Date.now()),be(e)},onCommit:n,onCancel:r,multiline:h,placeholder:f,ariaLabel:g,rules:S,disabled:b,inputRef:pe,className:"es-copy-box"}),te?te({focused:me,insert:t=>$e(n=>we(e,t,n))}):null,le&&h?
19
+ /* @__PURE__ */J(b,{id:c,value:Ke(e.value,t),styleValue:Ke(e.styleValue,t),onChange:n=>e.onChange(void 0===n?void 0:Number((n/t).toFixed(6))),min:e.min,max:e.max,step:s,shiftStep:e.shiftStep,icon:e.icon,unit:a||void 0,steppers:"compact",readOnly:n,ariaLabel:o,title:r.tip({name:o,step:s,unit:a})})]},e.key)})})})}function Pe({target:e,onChange:t}){const n=R(null);return M(()=>{const t=n.current,r=e.current;t&&r&&r.value===t.text&&(n.current=null,r.focus(),r.setSelectionRange(t.start,t.end))}),r=>{const l=r(e.current);t(l.text),n.current={start:l.selectionStart,end:l.selectionEnd,text:l.text}}}var je=/* @__PURE__ */new Set([...B,"clear"]);function Be({value:e,onChange:t,onCommit:n,onCancel:r,multiline:m=!1,placeholder:f,ariaLabel:g,className:y,readOnly:b=!1,rules:k,tools:S=[],writeMark:w,align:T,actions:O,toolbar:B,barLabel:q,renderFooter:ee,inputRef:te,barShows:ne="always",richText:re=!0,defaultShowMarks:le=!1,colors:oe,cells:ae,letterCase:se,lastTool:ce}){const ie=E("copy",v),ue=R(null),de=te??ue,[pe,he]=K(!1),[me,fe]=K(null),ge=R(l()).current,ye=R(null);P(()=>{const t=ye.current;t&&e===t.to?ye.current=null:t&&e===t.from||(ye.current=null,ge.reset())},[e,ge]);const ve=n=>{ye.current={from:ye.current?.from??e,to:n},t(n)},be=t=>({text:e,start:t?.selectionStart??me?.start??e.length,end:t?.selectionEnd??me?.end??e.length}),[ke,xe]=K(le),Se=re&&!(m&&ke),Ee=R(null),Ne=j(),[Le,Te]=K(null),[Re,Ke]=K(!1),Be=()=>{if(!Se)return de.current;const e=Ee.current?.getSource()??me;return e?{selectionStart:e.start,selectionEnd:e.end}:null},Ve=Pe({target:de,onChange:ve}),Fe=e=>(fe({start:e.selectionStart,end:e.selectionEnd}),e),He=(t,n)=>{if(!Se)return void Ve(e=>(n&&ge.record(be(e),"edit",Date.now()),Fe(t(e))));const r=Be(),l=Fe(t(r));n&&ge.record(be(r),"edit",Date.now()),Te(null),l.text!==e&&ve(l.text),Ee.current?.setSource(l.selectionStart,l.selectionEnd,l.text)},We=e=>He(e,!0),$e=e=>He(t=>{const n=be(t),r=ge[e](n);return r?{text:r.text,selectionStart:r.start,selectionEnd:r.end}:{text:n.text,selectionStart:n.start,selectionEnd:n.end}},!1),ze=R(null);M(()=>{const t=ze.current;t&&(ze.current=null,Se?Ee.current?.setSource(t.start,t.end,e):(de.current?.focus(),de.current?.setSelectionRange(t.start,t.end),fe(t)))},[Se]);const[Ie,qe]=K(null),Ae=k??H,Ue=("string"==typeof S[0]?S:S.map(e=>e.style)).filter(e=>!je.has(e)),Ye={};if(me){const t=F(e,me.start,me.end,Ae);for(const e of Ue){const n=t.has(e)||"highlight"===e&&t.has("accent");Ye[e]=!!Le?.add.includes(e)||!Le?.drop.includes(e)&&n}Ye.link=t.has("link")}const Ge=()=>{const t=Be(),n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}},_e=t=>{if("link"!==t&&z(0,t)){const{start:n,end:r}=Ge();if(n===r&&!Se)return void We(n=>Ce(e,t,n,(e,t,n,r)=>V(e,t,n,r,Ae,ie.placeholders)));const l=p({value:e,rules:Ae,start:n,end:r,style:t,pending:Le});return void("pending"===l.kind?Te(l.pending):We(()=>l.result))}if("link"!==t){const n=w??((e,t,n,r)=>V(e,t,n,r,H,ie.placeholders));return void We(r=>Ce(e,t,r,n))}const n=Be(),r=n?.selectionStart??e.length,l=n?.selectionEnd??r;Ke(!1),qe({start:r,end:l,link:I(e,r,l)})},Xe=Boolean(me&&me.start!==me.end),Ze=me?W(e,me.start,me.end,Ae):null,Je=me?Le&&void 0!==Le.color&&Le.at===me.start?Le.color:$(e,me.start,me.end,Ae):null,Qe=o(Je,oe),et=t=>{Se?t?Ee.current?.setSource(t.start,t.end,e):Ee.current?.focus():(de.current?.focus(),t&&de.current?.setSelectionRange(t.start,t.end))},tt=()=>{const e=Ie;qe(null),et(e?{start:e.start,end:e.end}:me)},nt=()=>{const e=lt.current,t=Boolean(e&&e.querySelector(".es-copy-colors")?.contains(e.ownerDocument.activeElement));Ke(!1),t&&et(me)},rt=R(nt);rt.current=nt,P(()=>{if(Re)return C(e=>{const t=lt.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&(rt.current(),!0)},()=>lt.current?.querySelector(".es-copy-colors"))},[Re]);const lt=R(null),ot=Re||null!==Ie;P(()=>{const e=lt.current;if(!ot||!e)return;const t=e.ownerDocument,n=()=>{Ke(!1),qe(null)},r=t=>{e.contains(t.target)||n()};let l;const o=r=>{const o=r.relatedTarget;o?e.contains(o)||n():(clearTimeout(l),l=setTimeout(()=>{const r=t.activeElement;t.hasFocus()&&r&&r!==t.body&&!e.contains(r)&&n()},0))};return t.addEventListener("pointerdown",r,!0),e.addEventListener("focusout",o),()=>{clearTimeout(l),t.removeEventListener("pointerdown",r,!0),e.removeEventListener("focusout",o)}},[ot]);const at=Ie??(Re?me??{start:e.length,end:e.length}:null),st=R(()=>{});st.current=()=>{const e=lt.current,t=e?.querySelector(".rosh-tb-wrap > .es-copy-pop");if(!e||!t||!at)return;const n=Se?null:e.querySelector(".es-gold-layer"),r=Se?Ee.current?.rangeOf(at.start,at.end)??null:n?a(n,at.start,at.end):null,l=r?.endContainer,o=l?1===l.nodeType?l:l.parentElement:null,d=r?s(r,o?.closest(".es-rich-line, .es-gold-layer")??null):null;if(!d)return;const p=c({anchor:d,size:{width:t.offsetWidth,height:t.offsetHeight},within:e.getBoundingClientRect(),clip:u(e),parent:i(t)});t.style.top=`${p.top}px`,t.style.left=`${p.left}px`,t.style.setProperty("--es-pop-point",`${p.point}px`),t.dataset.side=p.above?"above":"below"},M(()=>{const e=lt.current;if(!ot||!e)return;const t=()=>st.current();t();const n=e.ownerDocument.defaultView;n?.addEventListener("resize",t);const r=e.querySelector(".rosh-tb-wrap > .es-copy-pop"),l=n?.ResizeObserver,o=l&&r?new l(t):null;return o&&r&&o.observe(r),()=>{n?.removeEventListener("resize",t),o?.disconnect()}},[ot,Re,Ie,at?.start,at?.end,Se]);const ct="always"===ne||pe||null!==Ie||Re,it=oe&&oe.length>0?{run:Qe,open:Re,onToggle:()=>{qe(null),Re?nt():Ke(!0)}}:void 0,ut=ct?ce?ce({className:"rosh-tb-btn",disabled:b,selected:Xe,keepCaret:e=>e.preventDefault(),insert:t=>We(n=>De(e,t,n))}):"classic"===B?O:void 0:void 0,dt=new Set(Ue),pt=T?{value:T.value,allow:T.allow,onChange:T.onChange,disabled:T.disabled}:void 0,ht={pressed:Ze,onList:t=>{const{start:n,end:r}=Ge(),l=W(e,n,r,Ae);We(()=>U(e,n,r,l===t?null:t,Ae))}},mt=D({offered:dt,color:it,last:ut,alignment:pt,list:ht,letterCase:se});/* @__PURE__ */
20
+ return Z("div",{ref:lt,className:"es-copy"+(y?` ${y}`:""),onFocus:()=>he(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||he(!1)},onKeyDown:e=>{const t=e.target===de.current||Boolean(e.target.closest?.(".es-rich"));if(b||!t)return;if(e.altKey||e.metaKey===e.ctrlKey)return;const n=e.key.toLowerCase(),r="KeyZ"===e.code||"z"===n,l=("KeyY"===e.code||"y"===n)&&!e.shiftKey;if(r||l)return e.preventDefault(),e.stopPropagation(),void $e(l||e.shiftKey?"redo":"undo");const o={b:"bold",i:"italic",u:"underline",k:"link"}[`${e.shiftKey?"shift+":""}${n}`];o&&Ue.includes(o)&&(e.preventDefault(),e.stopPropagation(),_e(o))},onPaste:t=>{const n=de.current;if(b||!n||t.target!==n)return;t.preventDefault();const r=h({html:t.clipboardData.getData("text/html"),text:t.clipboardData.getData("text/plain")},{doc:n.ownerDocument,multiline:m,rules:Ae});We(t=>De(e,r,t))},style:oe&&oe.length>0?Object.fromEntries(oe.map(e=>[`--es-color-${e.name}`,e.value])):void 0,onSelect:()=>{const t=de.current;t&&t.ownerDocument.activeElement===t&&fe({start:t.selectionStart??e.length,end:t.selectionEnd??e.length})},children:[ct&&(mt.words||mt.paragraph)?
21
+ /* @__PURE__ */J(N,{className:"es-copy-toolbar","aria-label":q??ie.formatting,offered:dt,pressed:Ye,onMark:e=>_e(e),color:it,linkOpen:null!==Ie,last:ut,alignment:pt,list:ht,letterCase:se,disabled:b,windows:/* @__PURE__ */Z(Q,{children:[Re&&oe&&oe.length>0?/* @__PURE__ */J(d,{colors:oe,current:Je,words:ie.colors??v.colors,onPick:t=>{const{start:n,end:r}=Ge();if(n!==r)We(()=>A(e,n,r,t,Ae));else{if(!Se)return;Te({add:Le?.add??[],drop:Le?.drop??[],color:t,at:n})}}}):null,Ie?Ie&&/* @__PURE__ */J(L,{className:"es-copy-link es-copy-pop",value:Ie.link?.href??"",onApply:t=>{const n=Ie;qe(null),We(()=>Se?_(e,n.start,n.end,t,Ae):X(e,n.start,n.end,t))},onRemove:Ie.link?()=>{const t=Ie.link,n=Ie;qe(null),t&&We(()=>Se?Y(e,n.start,n.end,Ae):G(e,t))}:void 0,onCancel:tt}):null]})}):null,ae&&ae.length>0?/* @__PURE__ */J(Me,{cells:ae,words:ie.cells??v.cells,readOnly:b}):null,Se?/* @__PURE__ */J(Oe,{value:e,rules:Ae,multiline:m,readOnly:b,placeholder:f,ariaLabel:g,handle:Ee,pending:Le??void 0,onEdit:(t,n,r)=>{ge.record({text:e,start:n.start,end:n.end},r,Date.now()),Te(null),ve(t)},onSelect:e=>{fe(t=>t&&t.start===e.start&&t.end===e.end?t:e),!Le||e.start===Le.at&&e.end===Le.at||Te(null)},onHistory:$e,onFormat:e=>{Ue.includes(e)&&_e(e)},onCommit:n,onCancel:r}):/* @__PURE__ */J(we,{value:e,onInput:e=>{ge.record(be(null),"type",Date.now()),ve(e)},onCommit:n,onCancel:r,multiline:m,placeholder:f,ariaLabel:g,rules:k,disabled:b,inputRef:de,className:"es-copy-box"}),ee?ee({focused:pe,insert:t=>We(n=>De(e,t,n))}):null,re&&m?
10
22
  /* @__PURE__ */Z("div",{className:"es-copy-marks",children:[
11
- /* @__PURE__ */J(k,{checked:ke,onChange:()=>{const e=Fe();We.current=e&&null!==e.selectionStart&&null!==e.selectionEnd?{start:e.selectionStart,end:e.selectionEnd}:fe,Pe(null),Ee(e=>!e)},ariaLabelledBy:Le,disabled:b}),
12
- /* @__PURE__ */J("span",{id:Le,className:"es-copy-marks-label",children:ue.showMarks??"Show marks"})]}):null]})}var Ke=["left","center","right","justify"],Ve=v.align,Fe={left:/* @__PURE__ */J(se,{}),center:/* @__PURE__ */J(ae,{}),right:/* @__PURE__ */J(oe,{}),justify:/* @__PURE__ */J(le,{})},He={three:{labelsPx:94.5,widestLabelPx:39.94},four:{labelsPx:140,widestLabelPx:44}};function je(e,t=Ve){return Ke.filter(t=>e.includes(t)).map(e=>({id:e,label:t[e],icon:Fe[e],title:t[e]}))}var Be=["none","bullet","number"],$e=e,ze={none:/* @__PURE__ */J(ge,{}),bullet:/* @__PURE__ */J(fe,{}),number:/* @__PURE__ */J(he,{})},We={none:/* @__PURE__ */J(Se,{}),upper:/* @__PURE__ */J(be,{}),capitalize:/* @__PURE__ */J(ve,{}),lower:/* @__PURE__ */J(ye,{})};function Ae({label:e,icon:t,answers:n,names:r,glyphs:l,row:o,readOnly:a}){const s=o.value||o.styleValue||"";/* @__PURE__ */
13
- return J(x,{label:e,icon:t,children:/* @__PURE__ */J(w,{ariaLabel:e,value:s,disabled:a,onChange:e=>{a||o.onChange(function(e,t){return t===e.value||""===e.value&&t===e.styleValue?"":t}(o,e))},options:n.map(e=>({id:e,label:l[e],title:r[e]}))})})}function Ie({kept:e,keptHint:t,readOnly:n=!1,style:r,font:l,italic:o,cells:a,align:s,list:c,letterCase:i}){const u=C("copy",v),d={...v.panel,...u.panel},p=r&&!n?[r.onEditStyles&&{label:d.editStyles,onSelect:r.onEditStyles},r.onUpdateStyle&&{label:d.updateStyle,onSelect:r.onUpdateStyle}].filter(e=>!!e):[],m=!!o&&(o.value??o.styleValue??!1),h=o?/* @__PURE__ */J(T,{content:d.italic,children:/* @__PURE__ */J(R,{size:"sm",variant:"ghost","aria-label":d.italic,"aria-pressed":m,disabled:n,onClick:()=>{if(n)return;const e=!m;o.onChange(e===(o.styleValue??!1)?void 0:e)},children:/* @__PURE__ */J(me,{})})}):null;/* @__PURE__ */
23
+ /* @__PURE__ */J(x,{checked:ke,onChange:()=>{const e=Be();ze.current=e&&null!==e.selectionStart&&null!==e.selectionEnd?{start:e.selectionStart,end:e.selectionEnd}:me,Te(null),xe(e=>!e)},ariaLabelledBy:Ne,disabled:b}),
24
+ /* @__PURE__ */J("span",{id:Ne,className:"es-copy-marks-label",children:ie.showMarks??"Show marks"})]}):null]})}var Ve=["left","center","right","justify"],Fe=v.align,He={left:/* @__PURE__ */J(se,{}),center:/* @__PURE__ */J(ae,{}),right:/* @__PURE__ */J(oe,{}),justify:/* @__PURE__ */J(le,{})},We={three:{labelsPx:94.5,widestLabelPx:39.94},four:{labelsPx:140,widestLabelPx:44}};function $e(e,t=Fe){return Ve.filter(t=>e.includes(t)).map(e=>({id:e,label:t[e],icon:He[e],title:t[e]}))}var ze=["none","bullet","number"],Ie=e,qe={none:/* @__PURE__ */J(ge,{}),bullet:/* @__PURE__ */J(fe,{}),number:/* @__PURE__ */J(me,{})},Ae={none:/* @__PURE__ */J(ke,{}),upper:/* @__PURE__ */J(be,{}),capitalize:/* @__PURE__ */J(ve,{}),lower:/* @__PURE__ */J(ye,{})};function Ue({label:e,icon:t,answers:n,names:r,glyphs:l,row:o,readOnly:a}){const s=o.value||o.styleValue||"";/* @__PURE__ */
25
+ return J(S,{label:e,icon:t,children:/* @__PURE__ */J(w,{ariaLabel:e,value:s,disabled:a,onChange:e=>{a||o.onChange(function(e,t){return t===e.value||""===e.value&&t===e.styleValue?"":t}(o,e))},options:n.map(e=>({id:e,label:l[e],title:r[e]}))})})}function Ye({kept:e,keptHint:t,readOnly:n=!1,style:r,font:l,italic:o,cells:a,align:s,list:c,letterCase:i}){const u=E("copy",v),d={...v.panel,...u.panel},p=r&&!n?[r.onEditStyles&&{label:d.editStyles,onSelect:r.onEditStyles},r.onUpdateStyle&&{label:d.updateStyle,onSelect:r.onUpdateStyle}].filter(e=>!!e):[],h=!!o&&(o.value??o.styleValue??!1),m=o?/* @__PURE__ */J(T,{content:d.italic,children:/* @__PURE__ */J(O,{size:"sm",variant:"ghost","aria-label":d.italic,"aria-pressed":h,disabled:n,onClick:()=>{if(n)return;const e=!h;o.onChange(e===(o.styleValue??!1)?void 0:e)},children:/* @__PURE__ */J(he,{})})}):null;/* @__PURE__ */
14
26
  return Z("div",{className:"es-tpp",children:[e?/* @__PURE__ */Z("div",{className:"es-tpp-kept",children:[
15
- /* @__PURE__ */J(Pe,{...e,readOnly:n||e.readOnly}),t?/* @__PURE__ */J("p",{className:"es-field-hint",children:t}):null]}):null,r?/* @__PURE__ */J(x,{label:d.style,icon:/* @__PURE__ */J(ce,{}),children:/* @__PURE__ */J(S,{ariaLabel:d.style,value:r.value,options:r.options,onChange:r.onChange,changed:r.changed,footer:p,readOnly:n})}):null,l?/* @__PURE__ */J(x,{label:d.font,icon:/* @__PURE__ */J(ie,{}),children:/* @__PURE__ */Z("div",{className:"es-tpp-font",children:[
16
- /* @__PURE__ */J("div",{className:"es-tpp-font-select",children:/* @__PURE__ */J(S,{ariaLabel:d.font,value:l.value||void 0,placeholder:l.styleValue,options:l.options,onChange:l.onChange,searchable:l.searchable,readOnly:n})}),h]})}):h?
17
- /* @__PURE__ */J(x,{label:d.italic,icon:/* @__PURE__ */J(ie,{}),children:/* @__PURE__ */J("div",{className:"es-tpp-font",children:h})}):null,a?.length?/* @__PURE__ */J(Te,{cells:a,words:u.cells,readOnly:n}):null,s?/* @__PURE__ */J(Ae,{label:u.alignment,icon:/* @__PURE__ */J(ue,{}),answers:Ke.filter(e=>!s.allow||s.allow.includes(e)),names:u.align,glyphs:Fe,row:s,readOnly:n}):null,c?/* @__PURE__ */J(Ae,{label:d.list,icon:/* @__PURE__ */J(de,{}),answers:Be,names:d.lists,glyphs:ze,row:c,readOnly:n}):null,i?/* @__PURE__ */J(Ae,{label:d.capitalization,icon:/* @__PURE__ */J(pe,{}),answers:$e,names:d.cases,glyphs:We,row:i,readOnly:n}):null]})}export{Ke as COPY_ALIGNS,He as COPY_ALIGN_FIT,Fe as COPY_ALIGN_GLYPHS,Ve as COPY_ALIGN_LABELS,Le as COPY_CELLS,Pe as CopyBox,Te as CopyCells,Ne as RichBox,Ie as TextPartPanel,je as copyAlignOptions,we as insertSelection,xe as markSelection,Re as useCaretEdit};
27
+ /* @__PURE__ */J(Be,{...e,readOnly:n||e.readOnly}),t?/* @__PURE__ */J("p",{className:"es-field-hint",children:t}):null]}):null,r?/* @__PURE__ */J(S,{label:d.style,icon:/* @__PURE__ */J(ce,{}),children:/* @__PURE__ */J(k,{ariaLabel:d.style,value:r.value,options:r.options,onChange:r.onChange,changed:r.changed,footer:p,readOnly:n})}):null,l?/* @__PURE__ */J(S,{label:d.font,icon:/* @__PURE__ */J(ie,{}),children:/* @__PURE__ */Z("div",{className:"es-tpp-font",children:[
28
+ /* @__PURE__ */J("div",{className:"es-tpp-font-select",children:/* @__PURE__ */J(k,{ariaLabel:d.font,value:l.value||void 0,placeholder:l.styleValue,options:l.options,onChange:l.onChange,searchable:l.searchable,readOnly:n})}),m]})}):m?
29
+ /* @__PURE__ */J(S,{label:d.italic,icon:/* @__PURE__ */J(ie,{}),children:/* @__PURE__ */J("div",{className:"es-tpp-font",children:m})}):null,a?.length?/* @__PURE__ */J(Me,{cells:a,words:u.cells,readOnly:n}):null,s?/* @__PURE__ */J(Ue,{label:u.alignment,icon:/* @__PURE__ */J(ue,{}),answers:Ve.filter(e=>!s.allow||s.allow.includes(e)),names:u.align,glyphs:He,row:s,readOnly:n}):null,c?/* @__PURE__ */J(Ue,{label:d.list,icon:/* @__PURE__ */J(de,{}),answers:ze,names:d.lists,glyphs:qe,row:c,readOnly:n}):null,i?/* @__PURE__ */J(Ue,{label:d.capitalization,icon:/* @__PURE__ */J(pe,{}),answers:Ie,names:d.cases,glyphs:Ae,row:i,readOnly:n}):null]})}export{Ve as COPY_ALIGNS,We as COPY_ALIGN_FIT,He as COPY_ALIGN_GLYPHS,Fe as COPY_ALIGN_LABELS,Re as COPY_CELLS,Be as CopyBox,Me as CopyCells,Oe as RichBox,Ye as TextPartPanel,$e as copyAlignOptions,De as insertSelection,Ce as markSelection,Pe as useCaretEdit};
@@ -1 +1 @@
1
- export{UiIcon}from"../chunk-OG2SKSSK.js";export{PreviewPartsProvider,usePreviewParts}from"../chunk-I54UCYOU.js";export{createPreviewSelectionContext,useSelectHandler}from"../chunk-GOTN2KY4.js";import"../chunk-R5L2E7JX.js";export{PreviewDeviceContext,usePreviewDevice}from"../chunk-BSPCSC45.js";
1
+ export{UiIcon}from"../chunk-OG2SKSSK.js";export{PreviewDeviceContext,usePreviewDevice}from"../chunk-BSPCSC45.js";export{PreviewPartsProvider,usePreviewParts}from"../chunk-I54UCYOU.js";export{createPreviewSelectionContext,useSelectHandler}from"../chunk-GOTN2KY4.js";import"../chunk-R5L2E7JX.js";
@@ -1 +1 @@
1
- export{SCALAR_TEXT_CONTROLS,TEXT_CONTROL_KINDS}from"../chunk-PIND6KE7.js";export{VIEW_DESKTOP_MIN,VIEW_TABLET_MIN,VIEW_TIERS,VIEW_TIER_LABEL,viewTierForWidth}from"../chunk-DWIOHQG7.js";export{HERO_SLIDER_GOTO_EVENT}from"../chunk-IQ5TA7AM.js";export{rootRowName,sectionRenameProp,slotChildName,slotChildRenameProp,slotChildRowName}from"../chunk-TBF5CVPA.js";export{ANCHOR_FIELD_KEYS,FOLD_FIELD_MARKER,LINK_FIELD_MARKER,MEDIA_FIELD_MARKER,SCAFFOLD_FIELD_MARKER,TEXT_FIELD_MARKER,foldMetaOf,textFieldIdentifier}from"../chunk-DUVRZ456.js";export{hidableText,readHidable}from"../chunk-6W7WLPZH.js";export{PART_SEP,decodePartId,encodePartId}from"../chunk-IYT6NN2J.js";export{FOOTER_TYPE,HEADER_TYPE,ROOT_ZONE,TREE_MAX_DEPTH,blockNodeActions,childSlotsOf,locateNode,missingPinnedTypes,nestsInTree,newNodeId,pinnedDuplicateIds,pinnedDuplicateIndices,slotChildrenIn,slotFieldsOf}from"../chunk-PLVEGYK6.js";export{TEXT_STYLE_CASES,TEXT_STYLE_CASE_CSS,isTextStyleCase,textStyleCaseCss,textStyleCaseOfCss}from"../chunk-YHZSBL2N.js";
1
+ export{SCALAR_TEXT_CONTROLS,TEXT_CONTROL_KINDS}from"../chunk-PIND6KE7.js";export{VIEW_DESKTOP_MIN,VIEW_TABLET_MIN,VIEW_TIERS,VIEW_TIER_LABEL,viewTierForWidth}from"../chunk-DWIOHQG7.js";export{rootRowName,sectionRenameProp,slotChildName,slotChildRenameProp,slotChildRowName}from"../chunk-TBF5CVPA.js";export{HERO_SLIDER_GOTO_EVENT}from"../chunk-IQ5TA7AM.js";export{ANCHOR_FIELD_KEYS,FOLD_FIELD_MARKER,LINK_FIELD_MARKER,MEDIA_FIELD_MARKER,SCAFFOLD_FIELD_MARKER,TEXT_FIELD_MARKER,foldMetaOf,textFieldIdentifier}from"../chunk-DUVRZ456.js";export{hidableText,readHidable}from"../chunk-6W7WLPZH.js";export{PART_SEP,decodePartId,encodePartId}from"../chunk-IYT6NN2J.js";export{FOOTER_TYPE,HEADER_TYPE,ROOT_ZONE,TREE_MAX_DEPTH,blockNodeActions,childSlotsOf,locateNode,missingPinnedTypes,nestsInTree,newNodeId,pinnedDuplicateIds,pinnedDuplicateIndices,slotChildrenIn,slotFieldsOf}from"../chunk-PLVEGYK6.js";export{TEXT_STYLE_CASES,TEXT_STYLE_CASE_CSS,isTextStyleCase,textStyleCaseCss,textStyleCaseOfCss}from"../chunk-YHZSBL2N.js";
@@ -1,8 +1,8 @@
1
1
  import { DataInput } from '../data/index.js';
2
- import { N as NodeSelection, P as PassThrough } from '../plan-CGREINRO.js';
3
- export { I as ItemSelector } from '../plan-CGREINRO.js';
4
- import { E as EaselConfig, a as EaselView, b as EaselAction, P as Permissions, c as EaselCore, d as EaselUi } from '../types-NQozKWEz.js';
5
- export { A as AppState, e as EaselHistory, H as HistoryEntry, S as SetDataPatch } from '../types-NQozKWEz.js';
2
+ import { N as NodeSelection, P as PassThrough } from '../plan-2BLk7pWs.js';
3
+ export { I as ItemSelector } from '../plan-2BLk7pWs.js';
4
+ import { E as EaselConfig, a as EaselView, b as EaselAction, P as Permissions, c as EaselCore, d as EaselUi } from '../types-kR_4wYBw.js';
5
+ export { A as AppState, e as EaselHistory, H as HistoryEntry, S as SetDataPatch } from '../types-kR_4wYBw.js';
6
6
  import { S as SlotAddress, D as Data, P as Place, N as Node } from '../types-41704JE4.js';
7
7
  import { c as ResolveTrigger, a as ResolveCache, R as ResolvableItem } from '../resolve-D68pb3Bx.js';
8
8
  import * as react from 'react';
@@ -10,7 +10,7 @@ import { ReactNode, CSSProperties, ComponentType, ReactElement } from 'react';
10
10
  import { TextToolbarProps } from 'efficient-shell/ui';
11
11
  import { C as CopyBoxLastTool, a as CopyThemeColor, b as CanvasTypingEnd } from '../canvas-typing-BsNigaCa.js';
12
12
  import { InlineRule } from 'efficient-shell/markup';
13
- import { b as NodeOpsHost, C as ClipboardEntry } from '../useNodeOps-BHRkUFfG.js';
13
+ import { b as NodeOpsHost, C as ClipboardEntry } from '../useNodeOps-B0XZ8Bl8.js';
14
14
  import { I as InspectorFields } from '../types-CDX6vd6A.js';
15
15
  import '../words-D-yhjdOg.js';
16
16
  import '../buckets-Tj-nkBpg.js';
@@ -330,6 +330,35 @@ declare function EditDocument({ metadata }: {
330
330
  * Absent: every container is a step, as before.
331
331
  */
332
332
  declare const CanvasPassThroughContext: react.Context<PassThrough | undefined>;
333
+ /**
334
+ * A PART a host draws inside one of its blocks — a run of words, a picture —
335
+ * and where it is drawn.
336
+ */
337
+ interface CanvasPart {
338
+ id: string;
339
+ element: Element;
340
+ }
341
+ /**
342
+ * THE HOST'S PARTS ON THE CLICK CHAIN (W0, click-through plan 2026-10-12; card
343
+ * [MERGE] One Text Block And Click Through Parts). A host that lets a merchant
344
+ * select a part of a block says which part is under the pointer, and the canvas
345
+ * puts it on the chain after its block: one rule for the click, the hover
346
+ * outline and Escape (`clickPickPart`). Before this the website caught a click
347
+ * on its parts itself and stopped it, so the canvas never saw it.
348
+ *
349
+ * Absent: a click picks blocks only, as before.
350
+ */
351
+ interface CanvasParts {
352
+ /** The part drawn at `target` that block `ownerId` OWNS, or null. Asked of
353
+ * the innermost block under the pointer only, so an outer block never
354
+ * claims an inner block's part. */
355
+ partAt(target: Element, ownerId: string): CanvasPart | null;
356
+ /** The part the host has selected now, or null. */
357
+ selected(): string | null;
358
+ /** Select `partId` (its block is already the selection), or let it go. */
359
+ select(partId: string | null): void;
360
+ }
361
+ declare const CanvasPartsContext: react.Context<CanvasParts | undefined>;
333
362
  /** What a host may wrap an outline in — Puck's `componentOverlay`: render
334
363
  * `children` to draw it, or nothing to hide it (a text part open on the
335
364
  * block, say). */
@@ -571,4 +600,4 @@ declare function bindUndoKeys(doc: Document, easel: Pick<Easel, 'undo' | 'redo'>
571
600
  leaveTyping?: boolean;
572
601
  }): () => void;
573
602
 
574
- export { CanvasFrame, type CanvasFrameProps, type CanvasOverlay, CanvasPassThroughContext, type CanvasSlotProps, type CanvasTyping, type CanvasTypingState, type CanvasTypingTarget, DEFAULT_UI, type Easel, EaselAction, EaselCanvas, type EaselCanvasProps, EaselConfig, EaselCore, type EaselOptions, EaselProvider, type EaselProviderProps, EaselUi, EaselView, EditDocument, NodeSelection, Permissions, type SelectedFields, bindUndoKeys, createEasel, createUseEasel, recordsByDefault, reduce, uiView, useEasel, useEaselApi, useEaselNodeOps, useSelectedFields, validSelection };
603
+ export { CanvasFrame, type CanvasFrameProps, type CanvasOverlay, type CanvasPart, type CanvasParts, CanvasPartsContext, CanvasPassThroughContext, type CanvasSlotProps, type CanvasTyping, type CanvasTypingState, type CanvasTypingTarget, DEFAULT_UI, type Easel, EaselAction, EaselCanvas, type EaselCanvasProps, EaselConfig, EaselCore, type EaselOptions, EaselProvider, type EaselProviderProps, EaselUi, EaselView, EditDocument, NodeSelection, Permissions, type SelectedFields, bindUndoKeys, createEasel, createUseEasel, recordsByDefault, reduce, uiView, useEasel, useEaselApi, useEaselNodeOps, useSelectedFields, validSelection };
@@ -1 +1 @@
1
- export{CanvasFrame,CanvasPassThroughContext,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useSelectedFields,validSelection}from"../chunk-SMM3ST7A.js";import"../chunk-TBY3DFKS.js";import"../chunk-ECM5F6JJ.js";import"../chunk-YRLPFZW3.js";import"../chunk-23VM4PMV.js";import"../chunk-B4JN227A.js";import"../chunk-MFIRYGHW.js";import"../chunk-X4T6JT3M.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
1
+ export{CanvasFrame,CanvasPartsContext,CanvasPassThroughContext,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useSelectedFields,validSelection}from"../chunk-BU2YSTLJ.js";import"../chunk-TBY3DFKS.js";import"../chunk-YRLPFZW3.js";import"../chunk-SHS6WCLL.js";import"../chunk-23VM4PMV.js";import"../chunk-B4JN227A.js";import"../chunk-MFIRYGHW.js";import"../chunk-X4T6JT3M.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-N3LYD2LK.js";export{fieldIsShown,showWhenOf,shownFields,withShowWhen}from"../chunk-BPXEFVSQ.js";export{FieldSlider}from"../chunk-XWFH2NHZ.js";import"../chunk-4JSBIW5H.js";import"../chunk-K56YDHYQ.js";import"../chunk-BALFHI3G.js";import"../chunk-RC25EGHD.js";import"../chunk-KFV7N2DJ.js";export{useResolvedFields}from"../chunk-YRLPFZW3.js";export{FieldNumber}from"../chunk-2XMHLXMA.js";export{FieldSelect,optionFor}from"../chunk-G3GWAP5R.js";import"../chunk-WRFD4EXD.js";import"../chunk-36LVP5WD.js";import"../chunk-MFIRYGHW.js";import"../chunk-67GNT6PF.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
1
+ export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-N3LYD2LK.js";export{fieldIsShown,showWhenOf,shownFields,withShowWhen}from"../chunk-BPXEFVSQ.js";import"../chunk-4JSBIW5H.js";import"../chunk-K56YDHYQ.js";export{FieldSlider}from"../chunk-XWFH2NHZ.js";export{useResolvedFields}from"../chunk-YRLPFZW3.js";import"../chunk-BALFHI3G.js";import"../chunk-RC25EGHD.js";import"../chunk-KFV7N2DJ.js";export{FieldNumber}from"../chunk-2XMHLXMA.js";export{FieldSelect,optionFor}from"../chunk-G3GWAP5R.js";import"../chunk-WRFD4EXD.js";import"../chunk-36LVP5WD.js";import"../chunk-MFIRYGHW.js";import"../chunk-67GNT6PF.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
@@ -18,7 +18,7 @@
18
18
  */
19
19
 
20
20
  .es-gold {
21
- /* — tokens (see tokens.ts / goldCssVars) — */
21
+ /* — tokens: this sheet is their one source — */
22
22
  --es-gold-accent: var(--gold, #c9a461);
23
23
  --es-gold-quiet: var(--es-muted, var(--ink-faint));
24
24
  --es-gold-caret: var(--es-text, var(--ink-strongest));
@@ -142,7 +142,6 @@ type ScreenTarget = {
142
142
  kind: "page";
143
143
  slug: string;
144
144
  siteId?: string;
145
- originSlug?: string;
146
145
  } | {
147
146
  kind: "template";
148
147
  id: string;
@@ -230,9 +229,6 @@ type ScreenDocumentValue = {
230
229
  * read-only origin backdrop in footer focus) without reaching into Puck's store.
231
230
  * Lean accessor (ISP) — never exposes the ref. */
232
231
  getLiveData: () => Data | null;
233
- /** FOOTER FOCUS: the slug of the page the footer was opened from, or null. Rides
234
- * the nav target, so it's atomic with the retarget (never stale). */
235
- footerOriginSlug: string | null;
236
232
  error: string | null;
237
233
  /** True while the template-entry bounce is redirecting to the Home page. */
238
234
  redirecting: boolean;
@@ -1,4 +1,2 @@
1
1
  export * from 'efficient-shell/icons/efficient-glyphs';
2
2
  export { EfficientIconName as IconName, EfficientIconProps as IconProps } from 'efficient-shell/icons/efficient-glyphs';
3
- import 'efficient-shell/icons/efficient-meanings';
4
- import 'efficient-shell/markup';
@@ -1,5 +1,5 @@
1
- export { A as AfterRemove, I as ItemSelector, N as NodeSelection, P as PassThrough, a as Planned, S as StepBounds, c as canStep, b as clickPick, f as fromItemSelector, n as nextInChain, d as nodeChain, p as parentStep, e as planDuplicate, g as planMove, h as planPaste, i as planRemove, j as planRestore, k as planSetProps, l as planStep, t as toItemSelector } from '../plan-CGREINRO.js';
2
- export { C as ClipboardEntry, N as NodeClipboard, a as NodeOps, b as NodeOpsHost, c as createNodeClipboard, u as useNodeOps } from '../useNodeOps-BHRkUFfG.js';
1
+ export { A as AfterRemove, I as ItemSelector, N as NodeSelection, P as PassThrough, a as Planned, S as StepBounds, c as canStep, b as clickPick, d as clickPickPart, f as fromItemSelector, n as nextInChain, e as nodeChain, p as parentStep, g as planDuplicate, h as planMove, i as planPaste, j as planRemove, k as planRestore, l as planSetProps, m as planStep, t as toItemSelector } from '../plan-2BLk7pWs.js';
2
+ export { C as ClipboardEntry, N as NodeClipboard, a as NodeOps, b as NodeOpsHost, c as createNodeClipboard, u as useNodeOps } from '../useNodeOps-B0XZ8Bl8.js';
3
3
  import { ReactNode } from 'react';
4
4
  import { E as EaselContextMenuItem } from '../types-BsyPh6EW.js';
5
5
  import { N as NodeMenuWords } from '../words-DMG4dYq2.js';
@@ -1 +1 @@
1
- export{createNodeClipboard,nodeMenuItems}from"../chunk-OSPUG6S6.js";import"../chunk-WK3AFPXY.js";export{canStep,clickPick,fromItemSelector,nextInChain,nodeChain,parentStep,planDuplicate,planMove,planPaste,planRemove,planRestore,planSetProps,planStep,toItemSelector,useNodeOps}from"../chunk-ECM5F6JJ.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
1
+ export{createNodeClipboard,nodeMenuItems}from"../chunk-OSPUG6S6.js";import"../chunk-WK3AFPXY.js";export{canStep,clickPick,clickPickPart,fromItemSelector,nextInChain,nodeChain,parentStep,planDuplicate,planMove,planPaste,planRemove,planRestore,planSetProps,planStep,toItemSelector,useNodeOps}from"../chunk-SHS6WCLL.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";