efficient-easel 0.105.1 → 0.106.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 (79) hide show
  1. package/README.md +33 -0
  2. package/dist/chunk-2GVCAIPX.js +1 -0
  3. package/dist/chunk-37OCQYNX.js +65 -0
  4. package/dist/chunk-6WH7FA2M.js +9 -0
  5. package/dist/chunk-C6BJB5AC.js +2 -0
  6. package/dist/{chunk-TTJ54QGG.js → chunk-DX4XELD6.js} +6 -6
  7. package/dist/{chunk-PQXIFBDY.js → chunk-E2O2MRZR.js} +1 -1
  8. package/dist/{chunk-V4LF7D4F.js → chunk-FS5BLARH.js} +1 -1
  9. package/dist/{chunk-QH6LCNOX.js → chunk-I6T4TZ5Q.js} +1 -1
  10. package/dist/{chunk-NYKIQJT2.js → chunk-JWMNPRTT.js} +1 -1
  11. package/dist/chunk-LY4K2ECT.js +1 -0
  12. package/dist/chunk-M7N2V4TG.js +2 -0
  13. package/dist/chunk-MHKBLPQ2.js +1 -0
  14. package/dist/chunk-MS4QRBJ6.js +5 -0
  15. package/dist/chunk-ND55LTCA.js +5 -0
  16. package/dist/{chunk-NWIW7AWH.js → chunk-PBSEUZD6.js} +1 -1
  17. package/dist/{chunk-Q4N7C6CT.js → chunk-UEVTQBM7.js} +3 -3
  18. package/dist/{chunk-BXZ6WLHC.js → chunk-VCQVNPTG.js} +16 -16
  19. package/dist/{chunk-SARZN4M7.js → chunk-VINYARYJ.js} +1 -1
  20. package/dist/chunk-WTMHT7BI.js +1 -0
  21. package/dist/chunk-Z6SOLDWV.js +1 -0
  22. package/dist/copy/index.js +9 -9
  23. package/dist/drag/index.d.ts +10 -0
  24. package/dist/drag/index.js +1 -1
  25. package/dist/easel/index.d.ts +10 -1
  26. package/dist/easel/index.js +1 -1
  27. package/dist/fields/index.js +1 -1
  28. package/dist/{host-BQ_b9Qzk.d.ts → host-CiuzZJXj.d.ts} +11 -1
  29. package/dist/index.js +1 -1
  30. package/dist/screen/components/AddBlockRow.js +1 -1
  31. package/dist/screen/components/AddSidePanel.js +1 -1
  32. package/dist/screen/components/MediaSidePanel.d.ts +1 -1
  33. package/dist/screen/components/MediaSidePanel.js +1 -1
  34. package/dist/screen/components/NodeContextMenu.d.ts +19 -1
  35. package/dist/screen/components/NodeContextMenu.js +1 -1
  36. package/dist/screen/components/PageEditGuardNotices.js +1 -1
  37. package/dist/screen/components/ScreenChrome.js +1 -1
  38. package/dist/screen/components/ScreenDocumentContext.d.ts +1 -1
  39. package/dist/screen/components/ScreenDocumentContext.js +1 -1
  40. package/dist/screen/components/ScreenMount.d.ts +1 -1
  41. package/dist/screen/components/ScreenMount.js +1 -1
  42. package/dist/screen/components/ScreenStoreProvider.d.ts +1 -1
  43. package/dist/screen/components/ScreenStoreProvider.js +1 -1
  44. package/dist/screen/components/SectionScreenShell.js +16 -16
  45. package/dist/screen/components/panel-widths.d.ts +15 -1
  46. package/dist/screen/components/panel-widths.js +1 -1
  47. package/dist/screen/components/usePartBridge.d.ts +1 -1
  48. package/dist/screen/components/usePartBridge.js +1 -1
  49. package/dist/screen/index.d.ts +2 -2
  50. package/dist/screen/index.js +1 -1
  51. package/dist/screen/lib/document-addressing.d.ts +1 -1
  52. package/dist/screen/lib/host.d.ts +1 -1
  53. package/dist/screen/lib/key-scope.d.ts +31 -2
  54. package/dist/screen/lib/key-scope.js +1 -1
  55. package/dist/screen/lib/media-panel.d.ts +1 -1
  56. package/dist/screen/lib/media-picker.d.ts +1 -1
  57. package/dist/screen/lib/puck/section-doc.d.ts +5 -1
  58. package/dist/screen/lib/puck/section-doc.js +1 -1
  59. package/dist/screen/lib/puck/style-clipboard.d.ts +1 -1
  60. package/dist/screen/lib/puck/use-section-ops.js +1 -1
  61. package/dist/screen/lib/screen-parts.d.ts +38 -2
  62. package/dist/screen/lib/screen-parts.js +1 -1
  63. package/dist/screen/screen.css +21 -0
  64. package/dist/screen/words.d.ts +17 -1
  65. package/dist/screen/words.js +1 -1
  66. package/dist/strings/catalogue.js +1 -1
  67. package/dist/strings/index.js +1 -1
  68. package/package.json +1 -1
  69. package/dist/chunk-53G47SWO.js +0 -1
  70. package/dist/chunk-7FBDZTUD.js +0 -2
  71. package/dist/chunk-7V5WZ46F.js +0 -2
  72. package/dist/chunk-FMGFZNPW.js +0 -1
  73. package/dist/chunk-HLEET6NV.js +0 -65
  74. package/dist/chunk-IE4GFYKO.js +0 -1
  75. package/dist/chunk-N7VRF7PR.js +0 -5
  76. package/dist/chunk-P67FP7PG.js +0 -9
  77. package/dist/chunk-VSHV6KJQ.js +0 -5
  78. package/dist/chunk-VSOP4GUM.js +0 -1
  79. package/dist/chunk-ZTTWFAAC.js +0 -1
@@ -1,22 +1,22 @@
1
- import{FieldSelect as e}from"./chunk-EOJNJCMJ.js";import{TreeSeam as n}from"./chunk-ZFDCDJNZ.js";import{SettingsField as l,SETTINGS_BUCKETS as t,SettingsTabs as a,SettingsGroup as r}from"./chunk-ZNS7727Y.js";import{DEFAULT_TREE_WORDS as i}from"./chunk-3EDSDPIP.js";import{DEFAULT_PANEL_WORDS as o}from"./chunk-QTLAVDJE.js";import{EaselContextMenu as s}from"./chunk-KTVH2ZRL.js";import{FieldNumber as c}from"./chunk-EWVJSRRY.js";import{SettingsSegmented as u}from"./chunk-P6O363EE.js";import{DEFAULT_FIELDS_WORDS as d}from"./chunk-FPOKPNO4.js";import{useWords as m}from"./chunk-MFIRYGHW.js";import{useTreeDrag as p,gapToMoveIndex as h}from"./chunk-67GNT6PF.js";import{ChevronIcon as b,LockIcon as f,MoveUpIcon as v,MoveDownIcon as g,DuplicateIcon as y,TrashIcon as x}from"./chunk-L5KW4HG5.js";import{useRef as k,useState as N,useLayoutEffect as O,useId as w}from"react";import{jsx as C,jsxs as I}from"react/jsx-runtime";function S({id:e,value:n,onChange:l,placeholder:t,multiline:a=!1,rows:r=3,readOnly:i=!1,ariaLabel:o,ariaLabelledBy:s}){const c=n??"";return a?/* @__PURE__ */C("textarea",{id:e,className:"es-fin es-fin--area",value:c,rows:r,placeholder:t,readOnly:i,"aria-label":o,"aria-labelledby":s,onChange:e=>l(e.target.value)}):/* @__PURE__ */C("input",{id:e,type:"text",className:"es-fin",value:c,placeholder:t,readOnly:i,"aria-label":o,"aria-labelledby":s,onChange:e=>l(e.target.value)})}function D(e,n,l){const t=e.slice();return t.splice(Math.max(0,Math.min(n,t.length)),0,l),t}function j(e,n,l){const t=e.slice(),[a]=t.splice(n,1);return t.splice(Math.max(0,Math.min(l,t.length)),0,a),t}function $(e,n){return e.filter((e,l)=>l!==n)}function L(e){return null===e||"object"!=typeof e?e:JSON.parse(JSON.stringify(e))}var F='input, textarea, select, button, [contenteditable]:not([contenteditable="false"]), [tabindex]',P={parentId:"list",slot:"items"};function E({label:e,icon:l,noun:t,items:a,onChange:r,newItem:o,summary:c,itemName:u,thumb:w,min:S=0,max:E,readOnly:A=!1,open:M,onOpen:R,renderItem:T,renderRow:J,canRemove:z,lockedReason:H,fixed:K=!1,removeOnRow:B=!0,canDuplicate:V,above:W,head:Y=!0}){const Z=m("fields",d).list,q=m("tree",i),G=t??Z.item,U=!A&&!K&&("number"!=typeof E||a.length<E),Q=a.length<=S,X=e=>!!z&&!z(a[e],e),_=e=>!A&&!K&&B&&!Q&&!X(e),ee=e=>U&&(!V||V(a[e],e)),ne=(e,n)=>u?u(e,n):Z.itemName({noun:G,n:n+1}),le=k([]),te=k(null),[ae,re]=N(null),ie=k(null),[oe,se]=N(null),[ce,ue]=N("");O(()=>{for(const e of le.current){if(!e)continue;null!==e.querySelector(F)||A?e.removeAttribute("tabindex"):e.tabIndex=0}}),O(()=>{const e=te.current;if(!e)return;te.current=null;const n=le.current[e.index]?.querySelectorAll(F)[e.nth]??le.current[e.index];if(n?.focus(),n&&null!==e.start&&"setSelectionRange"in n)try{n.setSelectionRange(e.start,e.end)}catch{}});const de=(e,n)=>{if(n<0||n>=a.length||n===e)return;const l=le.current[e],t=l?.ownerDocument.activeElement;if(l&&t&&l.contains(t)){const e=[...l.querySelectorAll(F)].indexOf(t),a=t;te.current={index:n,nth:e,start:"number"==typeof a.selectionStart?a.selectionStart:null,end:"number"==typeof a.selectionEnd?a.selectionEnd:null}}r(j(a,e,n));const i=function(e,n,l){return null===e?null:e===n?l:n<e&&l>=e?e-1:n>e&&l<=e?e+1:e}(M,e,n);i!==M&&R(i),ue(Z.moved({n:n+1,total:a.length}))},me=e=>{U&&(r(D(a,e,o())),J?(te.current={index:e,nth:0,start:null,end:null},null!==M&&M>=e&&R(M+1)):R(e))},pe=e=>{_(e)&&(r($(a,e)),M===e?R(null):null!==M&&M>e&&R(M-1))},he=p({keyOf:e=>String(e),canDrop:(e,n)=>n.parentId===P.parentId&&n.slot===P.slot,onDrop:(e,n)=>{const l=h({...P,index:e},n);l!==e&&de(e,l)},onStep:(e,n)=>de(e,e+n),canStep:(e,n)=>e+n>=0&&e+n<a.length,readOnly:A}),be=e=>{const n=[];return e>0&&n.push({label:Z.moveUp,icon:/* @__PURE__ */C(v,{size:14}),shortcut:"⌥↑",onClick:()=>de(e,e-1)}),e<a.length-1&&n.push({label:Z.moveDown,icon:/* @__PURE__ */C(g,{size:14}),shortcut:"⌥↓",onClick:()=>de(e,e+1)}),ee(e)&&n.push({label:Z.duplicate,icon:/* @__PURE__ */C(y,{size:14}),onClick:()=>(e=>{ee(e)&&(r(D(a,e+1,L(a[e]))),null!==M&&M>e&&R(M+1))})(e)}),_(e)&&n.push({label:Z.delete,icon:/* @__PURE__ */C(x,{size:14}),danger:!0,onClick:()=>pe(e)}),n},fe=(e,n,l)=>{A||0===be(e).length||se({index:e,x:n,y:l})},ve=e=>n=>{const l=a.slice();l[e]=n,r(l)};/* @__PURE__ */
1
+ import{FieldSelect as e}from"./chunk-EOJNJCMJ.js";import{TreeSeam as n}from"./chunk-ZFDCDJNZ.js";import{DEFAULT_TREE_WORDS as l}from"./chunk-3EDSDPIP.js";import{EaselContextMenu as t}from"./chunk-KTVH2ZRL.js";import{SettingsField as a,SETTINGS_BUCKETS as r,SettingsTabs as i,SettingsGroup as o}from"./chunk-ZNS7727Y.js";import{DEFAULT_PANEL_WORDS as s}from"./chunk-QTLAVDJE.js";import{FieldNumber as c}from"./chunk-EWVJSRRY.js";import{DEFAULT_FIELDS_WORDS as u}from"./chunk-FPOKPNO4.js";import{SettingsSegmented as d}from"./chunk-P6O363EE.js";import{useWords as m}from"./chunk-MFIRYGHW.js";import{useTreeDrag as p,gapToMoveIndex as h}from"./chunk-67GNT6PF.js";import{ChevronIcon as b,LockIcon as f,MoveUpIcon as v,MoveDownIcon as g,DuplicateIcon as y,TrashIcon as x}from"./chunk-L5KW4HG5.js";import{useRef as k,useState as N,useLayoutEffect as O,useId as w}from"react";import{jsx as C,jsxs as I}from"react/jsx-runtime";function S({id:e,value:n,onChange:l,placeholder:t,multiline:a=!1,rows:r=3,readOnly:i=!1,ariaLabel:o,ariaLabelledBy:s}){const c=n??"";return a?/* @__PURE__ */C("textarea",{id:e,className:"es-fin es-fin--area",value:c,rows:r,placeholder:t,readOnly:i,"aria-label":o,"aria-labelledby":s,onChange:e=>l(e.target.value)}):/* @__PURE__ */C("input",{id:e,type:"text",className:"es-fin",value:c,placeholder:t,readOnly:i,"aria-label":o,"aria-labelledby":s,onChange:e=>l(e.target.value)})}function D(e,n,l){const t=e.slice();return t.splice(Math.max(0,Math.min(n,t.length)),0,l),t}function j(e,n,l){const t=e.slice(),[a]=t.splice(n,1);return t.splice(Math.max(0,Math.min(l,t.length)),0,a),t}function $(e,n){return e.filter((e,l)=>l!==n)}function L(e){return null===e||"object"!=typeof e?e:JSON.parse(JSON.stringify(e))}var F='input, textarea, select, button, [contenteditable]:not([contenteditable="false"]), [tabindex]',P={parentId:"list",slot:"items"};function E({label:e,icon:a,noun:r,items:i,onChange:o,newItem:s,summary:c,itemName:d,thumb:w,min:S=0,max:E,readOnly:A=!1,open:M,onOpen:R,renderItem:T,renderRow:J,canRemove:z,lockedReason:H,fixed:K=!1,removeOnRow:B=!0,canDuplicate:V,above:W,head:Y=!0}){const Z=m("fields",u).list,q=m("tree",l),G=r??Z.item,U=!A&&!K&&("number"!=typeof E||i.length<E),Q=i.length<=S,X=e=>!!z&&!z(i[e],e),_=e=>!A&&!K&&B&&!Q&&!X(e),ee=e=>U&&(!V||V(i[e],e)),ne=(e,n)=>d?d(e,n):Z.itemName({noun:G,n:n+1}),le=k([]),te=k(null),[ae,re]=N(null),ie=k(null),[oe,se]=N(null),[ce,ue]=N("");O(()=>{for(const e of le.current){if(!e)continue;null!==e.querySelector(F)||A?e.removeAttribute("tabindex"):e.tabIndex=0}}),O(()=>{const e=te.current;if(!e)return;te.current=null;const n=le.current[e.index]?.querySelectorAll(F)[e.nth]??le.current[e.index];if(n?.focus(),n&&null!==e.start&&"setSelectionRange"in n)try{n.setSelectionRange(e.start,e.end)}catch{}});const de=(e,n)=>{if(n<0||n>=i.length||n===e)return;const l=le.current[e],t=l?.ownerDocument.activeElement;if(l&&t&&l.contains(t)){const e=[...l.querySelectorAll(F)].indexOf(t),a=t;te.current={index:n,nth:e,start:"number"==typeof a.selectionStart?a.selectionStart:null,end:"number"==typeof a.selectionEnd?a.selectionEnd:null}}o(j(i,e,n));const a=function(e,n,l){return null===e?null:e===n?l:n<e&&l>=e?e-1:n>e&&l<=e?e+1:e}(M,e,n);a!==M&&R(a),ue(Z.moved({n:n+1,total:i.length}))},me=e=>{U&&(o(D(i,e,s())),J?(te.current={index:e,nth:0,start:null,end:null},null!==M&&M>=e&&R(M+1)):R(e))},pe=e=>{_(e)&&(o($(i,e)),M===e?R(null):null!==M&&M>e&&R(M-1))},he=p({keyOf:e=>String(e),canDrop:(e,n)=>n.parentId===P.parentId&&n.slot===P.slot,onDrop:(e,n)=>{const l=h({...P,index:e},n);l!==e&&de(e,l)},onStep:(e,n)=>de(e,e+n),canStep:(e,n)=>e+n>=0&&e+n<i.length,readOnly:A}),be=e=>{const n=[];return e>0&&n.push({label:Z.moveUp,icon:/* @__PURE__ */C(v,{size:14}),shortcut:"⌥↑",onClick:()=>de(e,e-1)}),e<i.length-1&&n.push({label:Z.moveDown,icon:/* @__PURE__ */C(g,{size:14}),shortcut:"⌥↓",onClick:()=>de(e,e+1)}),ee(e)&&n.push({label:Z.duplicate,icon:/* @__PURE__ */C(y,{size:14}),onClick:()=>(e=>{ee(e)&&(o(D(i,e+1,L(i[e]))),null!==M&&M>e&&R(M+1))})(e)}),_(e)&&n.push({label:Z.delete,icon:/* @__PURE__ */C(x,{size:14}),danger:!0,onClick:()=>pe(e)}),n},fe=(e,n,l)=>{A||0===be(e).length||se({index:e,x:n,y:l})},ve=e=>n=>{const l=i.slice();l[e]=n,o(l)};/* @__PURE__ */
2
2
  return I("div",{className:"es-list",children:[Y?/* @__PURE__ */I("div",{className:"es-list-head",children:[
3
- /* @__PURE__ */I("span",{className:"es-list-label",children:[l?/* @__PURE__ */C("span",{className:"es-field-icon","aria-hidden":"true",children:l}):null,e]}),
4
- /* @__PURE__ */C("span",{className:"es-list-count",children:a.length})]}):null,W?/* @__PURE__ */C("div",{className:"es-list-above",children:W}):null,a.length?/* @__PURE__ */I("div",{className:"es-list-rows",...he.rootProps(),children:[a.map((e,l)=>{const t=he.row({item:l,place:{...P,index:l}}),a=t.draggable&&ae!==l,r=!J&&M===l,i=!A&&!K&&B&&X(l),o=["es-list-row",J?"is-inline":"is-item",r?"is-open":"",a?"is-draggable":"",t.dragging?"is-dragging":"",t.drop?`is-drop-${t.drop}`:""].filter(Boolean).join(" ");/* @__PURE__ */
3
+ /* @__PURE__ */I("span",{className:"es-list-label",children:[a?/* @__PURE__ */C("span",{className:"es-field-icon","aria-hidden":"true",children:a}):null,e]}),
4
+ /* @__PURE__ */C("span",{className:"es-list-count",children:i.length})]}):null,W?/* @__PURE__ */C("div",{className:"es-list-above",children:W}):null,i.length?/* @__PURE__ */I("div",{className:"es-list-rows",...he.rootProps(),children:[i.map((e,l)=>{const t=he.row({item:l,place:{...P,index:l}}),a=t.draggable&&ae!==l,r=!J&&M===l,i=!A&&!K&&B&&X(l),o=["es-list-row",J?"is-inline":"is-item",r?"is-open":"",a?"is-draggable":"",t.dragging?"is-dragging":"",t.drop?`is-drop-${t.drop}`:""].filter(Boolean).join(" ");/* @__PURE__ */
5
5
  return I("div",{className:"es-list-entry",children:[l>0?/* @__PURE__ */C(n,{...he.seam({place:{...P,index:l}}),onAdd:U?()=>me(l):void 0,label:Z.addHere({noun:G})}):null,
6
6
  /* @__PURE__ */I("div",{...t.rowProps,ref:e=>{le.current[l]=e},className:o,draggable:a||void 0,"aria-keyshortcuts":t.draggable?"Alt+ArrowUp Alt+ArrowDown":void 0,onPointerDown:e=>{const n=e.target.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])'),a=!!n&&n===n.ownerDocument.activeElement;e.currentTarget.draggable=t.draggable&&!a,ie.current=n&&!a?n:null,re(a?l:null)},onDragStart:e=>{const n=ie.current;ie.current=null,n&&n.ownerDocument.activeElement===n&&n.blur(),t.rowProps.onDragStart?.(e)},onContextMenu:e=>{A||(e.preventDefault(),e.stopPropagation(),fe(l,e.clientX,e.clientY))},onKeyDown:e=>{if("ContextMenu"===e.key||e.shiftKey&&"F10"===e.key){e.preventDefault();const n=e.currentTarget.ownerDocument,t=e=>e.preventDefault();n.addEventListener("contextmenu",t,{capture:!0,once:!0}),n.defaultView?.setTimeout(()=>n.removeEventListener("contextmenu",t,{capture:!0}),500);const a=e.currentTarget.getBoundingClientRect();return void fe(l,a.left+24,a.bottom)}t.rowProps.onKeyDown?.(e)},children:[a?/* @__PURE__ */C("span",{className:"es-list-hint","aria-hidden":"true",children:q.dragHint}):null,J?/* @__PURE__ */C("div",{className:"es-list-row-main",children:J(e,l,ve(l))}):/* @__PURE__ */I("button",{type:"button",className:"es-list-open","aria-expanded":r,onClick:()=>R(r?null:l),children:[w?/* @__PURE__ */C("span",{className:"es-list-thumb","aria-hidden":"true",children:w(e,l)}):null,
7
7
  /* @__PURE__ */C("span",{className:"es-list-row-name",children:ne(e,l)}),/* @__PURE__ */C("span",c?{className:"es-list-row-summary",children:c(e,l)}:{className:"es-list-row-summary"}),
8
8
  /* @__PURE__ */C(b,{size:14,className:"es-list-chev","aria-hidden":"true"})]}),A||K||!B?null:i?/* @__PURE__ */C("span",{className:"es-list-lock",role:"img","aria-label":H?H(e,l):Z.locked,title:H?H(e,l):Z.locked,children:/* @__PURE__ */C(f,{size:13})}):/* @__PURE__ */C("button",{type:"button",className:"es-list-x","aria-label":Z.deleteItem({noun:G}),title:Z.deleteItem({noun:G}),disabled:!_(l),onClick:()=>pe(l),children:"×"})]}),r?/* @__PURE__ */C("div",{className:"es-list-item",children:T(e,l,ve(l))}):null]},l)}),
9
- /* @__PURE__ */C(n,{...he.seam({place:{...P,index:a.length}})})]}):null,A||K?null:/* @__PURE__ */C("button",{type:"button",className:"es-list-add",disabled:!U,onClick:()=>me(a.length),children:Z.add({noun:G})}),
10
- /* @__PURE__ */C("span",{className:"es-list-said","aria-live":"polite",children:ce}),oe&&oe.index<a.length?/* @__PURE__ */C(s,{x:oe.x,y:oe.y,items:be(oe.index),onClose:()=>se(null)}):null]})}var A=(e,n)=>"string"==typeof e.label&&e.label?e.label:n;function M({field:e,name:n,id:l,value:t,onChange:a,readOnly:i,context:o,renderers:s}){const[c,u]=N(!0),d=t&&"object"==typeof t?t:{};/* @__PURE__ */
11
- return C(r,{id:`${l}-group`,title:A(e,n),open:c,onToggle:u,children:Object.entries(e.objectFields).map(([e,t])=>/* @__PURE__ */C(T,{field:t,name:`${n}.${e}`,id:`${l}-${e}`,value:d[e],onChange:n=>a({...d,[e]:n}),readOnly:i,context:o,renderers:s},e))})}function R({field:e,name:n,id:l,value:t,onChange:a,readOnly:r,context:i,renderers:o,openItem:s,onOpenItem:c}){const[u,d]=N(null),m=c?s??null:u,p=c??d,h=Array.isArray(t)?t:[],b=e.getItemSummary;/* @__PURE__ */
12
- return C(E,{label:A(e,n),icon:e.icon,noun:"string"==typeof e.noun?e.noun:void 0,items:h,onChange:a,newItem:()=>L({...e.defaultItemProps??{}}),summary:b?(e,n)=>b(e,n):void 0,min:e.min,max:e.max,readOnly:r,open:m,onOpen:p,renderItem:(t,a,s)=>Object.entries(e.arrayFields).map(([e,c])=>/* @__PURE__ */C(T,{field:c,name:`${n}[${a}].${e}`,id:`${l}-${a}-${e}`,value:t?.[e],onChange:n=>s({...t,[e]:n}),readOnly:r,context:i,renderers:o},e))})}function T(n){const{field:t,name:a,id:r,value:i,onChange:o,readOnly:s,context:d,renderers:m}=n;if(!t||t.marker||!1===t.visible)return null;const p=m?.[t.type];if(p)return p({field:t,name:a,id:r,value:i,onChange:o,readOnly:s});switch(t.type){case"custom":{const e={...d,field:t,name:a,id:r,value:i,onChange:o,readOnly:s};return t.render(e)}case"text":case"textarea":/* @__PURE__ */
13
- return C(l,{label:A(t,a),htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */C(S,{id:r,value:"string"==typeof i?i:null==i?"":String(i),onChange:o,placeholder:t.placeholder,multiline:"textarea"===t.type,readOnly:s})});case"number":/* @__PURE__ */
14
- return C(l,{label:A(t,a),htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */C(c,{id:r,value:"number"==typeof i?i:void 0,onChange:o,min:t.min,max:t.max,step:t.step,placeholder:t.placeholder,readOnly:s})});case"select":{const n=`${r}-label`;/* @__PURE__ */
15
- return C(l,{label:A(t,a),labelId:n,htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */C(e,{id:r,value:i,options:t.options,onChange:o,readOnly:s,ariaLabelledBy:n})})}case"radio":/* @__PURE__ */
16
- return C(l,{label:A(t,a),icon:t.icon,hint:t.hint,children:/* @__PURE__ */C(u,{ariaLabel:A(t,a),value:i,options:t.options.map(e=>({id:e.value,label:e.label,icon:e.icon,disabled:e.disabled||s})),onChange:e=>{s||o(e)}})});case"object":/* @__PURE__ */
17
- return C(M,{...n,field:t});case"array":/* @__PURE__ */
18
- return C(R,{...n,field:t});case"slot":return null}}var J=e=>t.includes(e);function z(e){let n=t[0];const l=[],a=/* @__PURE__ */new Set;for(const[t,r]of Object.entries(e))r&&(J(r.bucket)&&(n=r.bucket),r.marker||!1===r.visible||(l.push({name:t,field:r,bucket:n}),"slot"!==r.type&&a.add(n)));return{rows:l,buckets:t.filter(e=>a.has(e))}}function H(e){return new Map(z(e).rows.map(e=>[e.name,e.bucket]))}function K({fields:e,values:n,onChange:l,readOnly:t=!1,context:r,tab:i,onTab:s,tabs:c=!0,tabIcons:u,renderers:d,idPrefix:p,ariaLabel:h,children:b}){const f=m("panel",o),v=w(),g=p??`es-insp${v.replace(/:/g,"")}`,y=z(e),[x,k]=N(void 0),O=i??x,S=O&&y.buckets.includes(O)?O:y.buckets[0],[D,j]=N(null),$=D&&D.panel===g&&y.rows.some(e=>e.name===D.name)?D:null,L=c&&y.buckets.length>1,F=`${g}-rows`,P=e=>`${g}-tab-${e.toLowerCase()}`;/* @__PURE__ */
19
- return I("div",{className:"es-insp",children:[L?/* @__PURE__ */C("div",{className:"es-insp-tabs",children:/* @__PURE__ */C(a,{ariaLabel:h??f.settings,activeId:S,onSelect:e=>{const n=e;void 0===i&&k(n),s?.(n)},items:y.buckets.map(e=>({id:e,label:f.buckets[e],icon:u?.[e],htmlId:P(e),panelId:F}))})}):null,
20
- /* @__PURE__ */I("div",{className:"es-insp-rows",id:F,role:L?"tabpanel":void 0,"aria-labelledby":L&&S?P(S):void 0,children:[y.rows.map(({name:e,field:a,bucket:i})=>/* @__PURE__ */C("div",{className:"es-insp-row","data-field":e,"data-bucket":i,hidden:!(!L||i===S)||void 0,children:/* @__PURE__ */C(T,{field:a,name:e,id:`${g}-${e}`,value:n[e],onChange:n=>l(e,n),readOnly:t,context:r,renderers:d,openItem:$&&$.name===e?$.index:null,onOpenItem:n=>j(null===n?null:{panel:g,name:e,index:n})})},e)),b]})]})}function B(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}function V({value:n,onChange:l,kinds:t,rules:a,filtersFor:r,label:i,readOnly:o}){const s=m("fields",d).link??d.link,[c,u]=N(null),[p,h]=N(null),b=c??a.kindOf(n),f=t.filter(e=>!e.hideWhenEmpty||B(e.target).length>0||e.value===b),v=f.find(e=>"text"===e.target.type),g=f.find(e=>e.value===b)??v??f[0];if(!g)return null;const y="text"!==g.target.type,x=y?a.targetOf(n):n,k=B(g.target),O=k.find(e=>e.value===x),w=e=>({value:e,label:s.unavailable({value:e})}),S="select"===g.target.type&&x&&r?r(x):null,D=S?a.readFilter(n):null,j=D?S?.find(e=>e.param===D.param):void 0,$=p&&p.against===n?p.text:n,L=!y&&""!==$.trim()&&!a.isSafe($),F=e=>{if(!e)return l("");const n=k.find(n=>n.value===e);l(e,n?.label)},P=(e,n)=>n&&!e.some(e=>e.value===n)?[w(n),...e]:[...e];let E;if("text"===g.target.type)E=/* @__PURE__ */C("input",{type:"text",className:"es-fin","aria-label":s.address,"aria-invalid":L||void 0,placeholder:s.addressPlaceholder,value:$,readOnly:o,onChange:e=>(e=>{const t=e.trim();t?a.isSafe(e)?(h({text:e,against:t}),l(t)):h({text:e,against:n}):(h({text:e,against:""}),l(""))})(e.target.value)});else{const n="groups"===g.target.type?g.target.groups.flatMap(e=>e.options.map(n=>({value:n.value,label:n.label,group:e.label}))):g.target.options.map(e=>({value:e.value,label:e.label}));E=/* @__PURE__ */C(e,{ariaLabel:g.label,value:x,options:[{value:"",label:g.target.placeholder},...P(n,x)],searchable:n.length>10,readOnly:o,onChange:F})}/* @__PURE__ */
9
+ /* @__PURE__ */C(n,{...he.seam({place:{...P,index:i.length}})})]}):null,A||K?null:/* @__PURE__ */C("button",{type:"button",className:"es-list-add",disabled:!U,onClick:()=>me(i.length),children:Z.add({noun:G})}),
10
+ /* @__PURE__ */C("span",{className:"es-list-said","aria-live":"polite",children:ce}),oe&&oe.index<i.length?/* @__PURE__ */C(t,{x:oe.x,y:oe.y,items:be(oe.index),onClose:()=>se(null)}):null]})}var A=(e,n)=>"string"==typeof e.label&&e.label?e.label:n;function M({field:e,name:n,id:l,value:t,onChange:a,readOnly:r,context:i,renderers:s}){const[c,u]=N(!0),d=t&&"object"==typeof t?t:{};/* @__PURE__ */
11
+ return C(o,{id:`${l}-group`,title:A(e,n),open:c,onToggle:u,children:Object.entries(e.objectFields).map(([e,t])=>/* @__PURE__ */C(T,{field:t,name:`${n}.${e}`,id:`${l}-${e}`,value:d[e],onChange:n=>a({...d,[e]:n}),readOnly:r,context:i,renderers:s},e))})}function R({field:e,name:n,id:l,value:t,onChange:a,readOnly:r,context:i,renderers:o,openItem:s,onOpenItem:c}){const[u,d]=N(null),m=c?s??null:u,p=c??d,h=Array.isArray(t)?t:[],b=e.getItemSummary;/* @__PURE__ */
12
+ return C(E,{label:A(e,n),icon:e.icon,noun:"string"==typeof e.noun?e.noun:void 0,items:h,onChange:a,newItem:()=>L({...e.defaultItemProps??{}}),summary:b?(e,n)=>b(e,n):void 0,min:e.min,max:e.max,readOnly:r,open:m,onOpen:p,renderItem:(t,a,s)=>Object.entries(e.arrayFields).map(([e,c])=>/* @__PURE__ */C(T,{field:c,name:`${n}[${a}].${e}`,id:`${l}-${a}-${e}`,value:t?.[e],onChange:n=>s({...t,[e]:n}),readOnly:r,context:i,renderers:o},e))})}function T(n){const{field:l,name:t,id:r,value:i,onChange:o,readOnly:s,context:u,renderers:m}=n;if(!l||l.marker||!1===l.visible)return null;const p=m?.[l.type];if(p)return p({field:l,name:t,id:r,value:i,onChange:o,readOnly:s});switch(l.type){case"custom":{const e={...u,field:l,name:t,id:r,value:i,onChange:o,readOnly:s};return l.render(e)}case"text":case"textarea":/* @__PURE__ */
13
+ return C(a,{label:A(l,t),htmlFor:r,icon:l.icon,hint:l.hint,children:/* @__PURE__ */C(S,{id:r,value:"string"==typeof i?i:null==i?"":String(i),onChange:o,placeholder:l.placeholder,multiline:"textarea"===l.type,readOnly:s})});case"number":/* @__PURE__ */
14
+ return C(a,{label:A(l,t),htmlFor:r,icon:l.icon,hint:l.hint,children:/* @__PURE__ */C(c,{id:r,value:"number"==typeof i?i:void 0,onChange:o,min:l.min,max:l.max,step:l.step,placeholder:l.placeholder,readOnly:s})});case"select":{const n=`${r}-label`;/* @__PURE__ */
15
+ return C(a,{label:A(l,t),labelId:n,htmlFor:r,icon:l.icon,hint:l.hint,children:/* @__PURE__ */C(e,{id:r,value:i,options:l.options,onChange:o,readOnly:s,ariaLabelledBy:n})})}case"radio":/* @__PURE__ */
16
+ return C(a,{label:A(l,t),icon:l.icon,hint:l.hint,children:/* @__PURE__ */C(d,{ariaLabel:A(l,t),value:i,options:l.options.map(e=>({id:e.value,label:e.label,icon:e.icon,disabled:e.disabled||s})),onChange:e=>{s||o(e)}})});case"object":/* @__PURE__ */
17
+ return C(M,{...n,field:l});case"array":/* @__PURE__ */
18
+ return C(R,{...n,field:l});case"slot":return null}}var J=e=>r.includes(e);function z(e){let n=r[0];const l=[],t=/* @__PURE__ */new Set;for(const[a,r]of Object.entries(e))r&&(J(r.bucket)&&(n=r.bucket),r.marker||!1===r.visible||(l.push({name:a,field:r,bucket:n}),"slot"!==r.type&&t.add(n)));return{rows:l,buckets:r.filter(e=>t.has(e))}}function H(e){return new Map(z(e).rows.map(e=>[e.name,e.bucket]))}function K({fields:e,values:n,onChange:l,readOnly:t=!1,context:a,tab:r,onTab:o,tabs:c=!0,tabIcons:u,renderers:d,idPrefix:p,ariaLabel:h,children:b}){const f=m("panel",s),v=w(),g=p??`es-insp${v.replace(/:/g,"")}`,y=z(e),[x,k]=N(void 0),O=r??x,S=O&&y.buckets.includes(O)?O:y.buckets[0],[D,j]=N(null),$=D&&D.panel===g&&y.rows.some(e=>e.name===D.name)?D:null,L=c&&y.buckets.length>1,F=`${g}-rows`,P=e=>`${g}-tab-${e.toLowerCase()}`;/* @__PURE__ */
19
+ return I("div",{className:"es-insp",children:[L?/* @__PURE__ */C("div",{className:"es-insp-tabs",children:/* @__PURE__ */C(i,{ariaLabel:h??f.settings,activeId:S,onSelect:e=>{const n=e;void 0===r&&k(n),o?.(n)},items:y.buckets.map(e=>({id:e,label:f.buckets[e],icon:u?.[e],htmlId:P(e),panelId:F}))})}):null,
20
+ /* @__PURE__ */I("div",{className:"es-insp-rows",id:F,role:L?"tabpanel":void 0,"aria-labelledby":L&&S?P(S):void 0,children:[y.rows.map(({name:e,field:r,bucket:i})=>/* @__PURE__ */C("div",{className:"es-insp-row","data-field":e,"data-bucket":i,hidden:!(!L||i===S)||void 0,children:/* @__PURE__ */C(T,{field:r,name:e,id:`${g}-${e}`,value:n[e],onChange:n=>l(e,n),readOnly:t,context:a,renderers:d,openItem:$&&$.name===e?$.index:null,onOpenItem:n=>j(null===n?null:{panel:g,name:e,index:n})})},e)),b]})]})}function B(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}function V({value:n,onChange:l,kinds:t,rules:a,filtersFor:r,label:i,readOnly:o}){const s=m("fields",u).link??u.link,[c,d]=N(null),[p,h]=N(null),b=c??a.kindOf(n),f=t.filter(e=>!e.hideWhenEmpty||B(e.target).length>0||e.value===b),v=f.find(e=>"text"===e.target.type),g=f.find(e=>e.value===b)??v??f[0];if(!g)return null;const y="text"!==g.target.type,x=y?a.targetOf(n):n,k=B(g.target),O=k.find(e=>e.value===x),w=e=>({value:e,label:s.unavailable({value:e})}),S="select"===g.target.type&&x&&r?r(x):null,D=S?a.readFilter(n):null,j=D?S?.find(e=>e.param===D.param):void 0,$=p&&p.against===n?p.text:n,L=!y&&""!==$.trim()&&!a.isSafe($),F=e=>{if(!e)return l("");const n=k.find(n=>n.value===e);l(e,n?.label)},P=(e,n)=>n&&!e.some(e=>e.value===n)?[w(n),...e]:[...e];let E;if("text"===g.target.type)E=/* @__PURE__ */C("input",{type:"text",className:"es-fin","aria-label":s.address,"aria-invalid":L||void 0,placeholder:s.addressPlaceholder,value:$,readOnly:o,onChange:e=>(e=>{const t=e.trim();t?a.isSafe(e)?(h({text:e,against:t}),l(t)):h({text:e,against:n}):(h({text:e,against:""}),l(""))})(e.target.value)});else{const n="groups"===g.target.type?g.target.groups.flatMap(e=>e.options.map(n=>({value:n.value,label:n.label,group:e.label}))):g.target.options.map(e=>({value:e.value,label:e.label}));E=/* @__PURE__ */C(e,{ariaLabel:g.label,value:x,options:[{value:"",label:g.target.placeholder},...P(n,x)],searchable:n.length>10,readOnly:o,onChange:F})}/* @__PURE__ */
21
21
  return I("div",{className:"es-flink",role:i?"group":void 0,"aria-label":i,children:[
22
- /* @__PURE__ */C(e,{ariaLabel:s.linkType,value:g.value,options:f.map(e=>({value:e.value,label:e.label})),readOnly:o,onChange:e=>{u(e),h(null);const n=f.find(n=>n.value===e);if(!n||"text"===n.target.type)return;const t=B(n.target)[0];t?l(t.value,t.label):l("")}}),E,S&&/* @__PURE__ */C(e,{ariaLabel:s.filter,value:D?.param??"",options:[{value:"",label:s.noFilter},...D&&!j?[w(D.param)]:[],...S.map(e=>({value:e.param,label:e.label}))],readOnly:o,onChange:e=>{if(!e)return l(x,O?.label);const n=S?.find(n=>n.param===e),t=n?.values[0];t&&l(a.withFilter(x,{param:e,value:t.value}),t.label)}}),S&&D&&/* @__PURE__ */C(e,{ariaLabel:s.value,value:D.value,options:P((j?.values??[]).map(e=>({value:e.value,label:e.label})),D.value),searchable:(j?.values.length??0)>10,readOnly:o,onChange:e=>{if(!D)return;const n=j?.values.find(n=>n.value===e);l(a.withFilter(x,{param:D.param,value:e}),n?.label)}}),L&&/* @__PURE__ */C("p",{className:"es-flink-error",role:"alert",children:s.unsafe}),g.hint&&/* @__PURE__ */C("p",{className:"es-flink-hint",children:g.hint}),S&&/* @__PURE__ */C("p",{className:"es-flink-hint",children:s.filterHint})]})}export{S as FieldText,K as Inspector,T as InspectorField,V as LinkPicker,E as ListField,H as bucketsOf,L as copyItem,D as insertAt,A as labelOf,j as moveTo,z as planFields,$ as removeAt};
22
+ /* @__PURE__ */C(e,{ariaLabel:s.linkType,value:g.value,options:f.map(e=>({value:e.value,label:e.label})),readOnly:o,onChange:e=>{d(e),h(null);const n=f.find(n=>n.value===e);if(!n||"text"===n.target.type)return;const t=B(n.target)[0];t?l(t.value,t.label):l("")}}),E,S&&/* @__PURE__ */C(e,{ariaLabel:s.filter,value:D?.param??"",options:[{value:"",label:s.noFilter},...D&&!j?[w(D.param)]:[],...S.map(e=>({value:e.param,label:e.label}))],readOnly:o,onChange:e=>{if(!e)return l(x,O?.label);const n=S?.find(n=>n.param===e),t=n?.values[0];t&&l(a.withFilter(x,{param:e,value:t.value}),t.label)}}),S&&D&&/* @__PURE__ */C(e,{ariaLabel:s.value,value:D.value,options:P((j?.values??[]).map(e=>({value:e.value,label:e.label})),D.value),searchable:(j?.values.length??0)>10,readOnly:o,onChange:e=>{if(!D)return;const n=j?.values.find(n=>n.value===e);l(a.withFilter(x,{param:D.param,value:e}),n?.label)}}),L&&/* @__PURE__ */C("p",{className:"es-flink-error",role:"alert",children:s.unsafe}),g.hint&&/* @__PURE__ */C("p",{className:"es-flink-hint",children:g.hint}),S&&/* @__PURE__ */C("p",{className:"es-flink-hint",children:s.filterHint})]})}export{S as FieldText,K as Inspector,T as InspectorField,V as LinkPicker,E as ListField,H as bucketsOf,L as copyItem,D as insertAt,A as labelOf,j as moveTo,z as planFields,$ as removeAt};
@@ -1,2 +1,2 @@
1
- import{ScreenPartsProvider as t}from"./chunk-VSHV6KJQ.js";import{useEaselHost as r}from"./chunk-U3JP4VGF.js";import{createEasel as e,EaselProvider as n}from"./chunk-P67FP7PG.js";import{useState as o,useEffect as s}from"react";import{jsx as i}from"react/jsx-runtime";function a({config:a,data:c,onChange:m,permissions:p,parts:f,children:u}){const[h]=o(()=>e({config:a,data:c,permissions:p}));s(()=>{h.setConfig(a)},[h,a]),s(()=>{if(!m)return;let t=h.getState().appState.data;return h.subscribe(()=>{const r=h.getState().appState.data;r!==t&&(t=r,m(r))})},[h,m]),s(()=>{p&&h.setPermissions(p)},[h,p]);const d=r();/* @__PURE__ */
1
+ import{ScreenPartsProvider as t}from"./chunk-ND55LTCA.js";import{useEaselHost as r}from"./chunk-U3JP4VGF.js";import{createEasel as e,EaselProvider as n}from"./chunk-6WH7FA2M.js";import{useState as o,useEffect as s}from"react";import{jsx as i}from"react/jsx-runtime";function a({config:a,data:c,onChange:m,permissions:p,parts:f,children:u}){const[h]=o(()=>e({config:a,data:c,permissions:p}));s(()=>{h.setConfig(a)},[h,a]),s(()=>{if(!m)return;let t=h.getState().appState.data;return h.subscribe(()=>{const r=h.getState().appState.data;r!==t&&(t=r,m(r))})},[h,m]),s(()=>{p&&h.setPermissions(p)},[h,p]);const d=r();/* @__PURE__ */
2
2
  return i(n,{easel:h,hotkeys:d.ownsDocument,children:/* @__PURE__ */i(t,{parts:f,children:u})})}export{a as ScreenStoreProvider};
@@ -0,0 +1 @@
1
+ import{DEFAULT_PANEL_W as s,clampPanelWidth as e}from"./chunk-YC4TB3CJ.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};
@@ -0,0 +1 @@
1
+ import{DEFAULT_TEXT_STYLES_WORDS as o}from"./chunk-M6F6LS3H.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as r}from"./chunk-6WY6ZXJG.js";import{DEFAULT_NODE_MENU_WORDS as t}from"./chunk-WK3AFPXY.js";import{DEFAULT_SCREEN_WORDS as m}from"./chunk-E2O2MRZR.js";import{DEFAULT_CANVAS_WORDS as n}from"./chunk-AELNNAFM.js";import{DEFAULT_TREE_WORDS as c}from"./chunk-3EDSDPIP.js";import{DEFAULT_PANEL_WORDS as s}from"./chunk-QTLAVDJE.js";import{DEFAULT_SAVE_WORDS as f}from"./chunk-H6DDIBQ4.js";import{DEFAULT_CHROME_WORDS as p,DEFAULT_NOTICE_WORDS as e}from"./chunk-ZJEBF4NB.js";import{DEFAULT_LOCK_WORDS as i}from"./chunk-RE4LP46F.js";import{DEFAULT_RAIL_WORDS as u}from"./chunk-2OAZYSWJ.js";import{DEFAULT_COPY_WORDS as k}from"./chunk-UH7IGZKF.js";import{DEFAULT_PICK_WORDS as j}from"./chunk-ZAOM6PFH.js";import{DEFAULT_FIELDS_WORDS as h}from"./chunk-FPOKPNO4.js";import{DEFAULT_DRAG_WORDS as l}from"./chunk-O2NLQBFX.js";var F={notice:e,lock:i,save:f,chrome:p,rail:u,tree:c,panel:s,fields:h,pick:j,drag:l,menu:t,styleClipboard:r,copy:k,canvas:n,textStyles:o,screen:m},a=o=>"object"==typeof o&&null!==o;function y(o,r){const t={};for(const m of Object.keys(o)){const n=o[m],c=r[m];null==c?t[m]=n:a(n)?t[m]=a(c)?y(n,c):n:t[m]=typeof c==typeof n?c:n}return t}function O(o,r){return r?y(o,r):o}export{F as DEFAULT_EASEL_STRINGS,O as mergeEaselStrings};
@@ -1,4 +1,4 @@
1
- import{ColourWindow as e}from"../chunk-H24N5TMZ.js";import{DEFAULT_COPY_WORDS as t}from"../chunk-UH7IGZKF.js";import{DEFAULT_PICK_WORDS as n}from"../chunk-ZAOM6PFH.js";import{FieldNumber as l}from"../chunk-EWVJSRRY.js";import{SettingsSegmented as r,SettingsSwitch as o}from"../chunk-P6O363EE.js";import"../chunk-FPOKPNO4.js";import{GoldTextInput as a}from"../chunk-2FZJWH24.js";import{RETIRED_MARKS as s,applyMark as i,STANDARD_MARKUP as c,writeMarkedLines as u,sameMarks as d,markedLines as h,spanFor as p,markupTools as f,marksIn as m,findLink as b,markedAt as g,listIn as y,colorIn as v,clearStyle as k,isSafeLinkHref as x,toggleMark as w,colorOver as C,setList as E,unlinkAt as S,removeLink as D,linkOver as N,writeLink as M}from"../chunk-546BBOPE.js";import{useWords as L}from"../chunk-MFIRYGHW.js";import"../chunk-BZ5ASXOL.js";import{AlignJustifyIcon as T,AlignRightIcon as j,AlignCenterIcon as B,AlignLeftIcon as O,ParagraphSpacingIcon as R,LetterSpacingIcon as P,TextLinesIcon as K,TextSizeIcon as F,CaseNormalIcon as H,CaseUpperIcon as W,CaseLowerIcon as $,TextColorIcon as z,ListIcon as I,NumberedListIcon as A,ClearMarksIcon as q,BoldIcon as U,ItalicIcon as V,UnderlineIcon as Z,StrikeIcon as Y,LinkIcon as G,SuperscriptIcon as J,SubscriptIcon as X,QuietIcon as Q,EmphasisIcon as _}from"../chunk-L5KW4HG5.js";import{useRef as ee,useState as te,useLayoutEffect as ne,useEffect as le,useId as re}from"react";import{jsx as oe,jsxs as ae,Fragment as se}from"react/jsx-runtime";var ie=["left","center","right","justify"],ce=t.align,ue={left:/* @__PURE__ */oe(O,{}),center:/* @__PURE__ */oe(B,{}),right:/* @__PURE__ */oe(j,{}),justify:/* @__PURE__ */oe(T,{})},de={three:{labelsPx:94.5,widestLabelPx:39.94},four:{labelsPx:140,widestLabelPx:44}};function he(e,t=ce){return ie.filter(t=>e.includes(t)).map(e=>({id:e,label:t[e],icon:ue[e],title:t[e]}))}var pe=/[\u1100-\u11ff\u2e80-\u9fff\uac00-\ud7af\uf900-\ufaff\uff00-\uffef]/;function fe(e){if(e.every(e=>e.label===ce[e.id]))return e.length>3?de.four:de.three;const t=e.map(e=>[...e.label].reduce((e,t)=>e+(pe.test(t)?13:8),0));return{labelsPx:t.reduce((e,t)=>e+t,0),widestLabelPx:Math.max(0,...t)}}function me(e,t){const n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}}function be(e,t,n,l=i){const{start:r,end:o}=me(e,n);return l(e,r,o,t)}function ge(e,t,n){const{start:l,end:r}=me(e,n),o=l+t.length;return{text:e.slice(0,l)+t+e.slice(r),selectionStart:o,selectionEnd:o}}var ye=/* @__PURE__ */new Set(["script","style","head","title","meta","link","template","noscript","svg","math","object","iframe"]),ve=/* @__PURE__ */new Set(["p","div","li","ul","ol","dl","dt","dd","h1","h2","h3","h4","h5","h6","blockquote","pre","table","thead","tbody","tfoot","tr","section","article","header","footer","aside","nav","figure","figcaption","address","hr"]);function ke(e,t){const n=t.rules??c,l=e.html&&""!==e.html.trim()?function(e,t,n){const l=t.createElement("template");l.innerHTML=e;const r=[[]],o=()=>r[r.length-1],a=()=>{const e=o();for(;e.length>0&&" "===e[e.length-1].ch;)e.pop();e.length>0&&r.push([])},s=(e,t,n,l)=>{if(3===e.nodeType){for(const a of e.textContent??""){const e=/\s/.test(a)?" ":a,s=o();" "===e&&(0===s.length&&r.length>1||" "===s[s.length-1]?.ch)||s.push({ch:e,bold:t,italic:n,href:l})}return}if(1!==e.nodeType&&11!==e.nodeType)return;const i=e,c=1===e.nodeType?i.localName:"";if(ye.has(c))return;if("br"===c)return void r.push([]);let u=t,d=n,h=l;if("b"!==c&&"strong"!==c||(u=!0),"i"!==c&&"em"!==c||(d=!0),"a"===c){const e=(i.getAttribute("href")??"").trim();h=x(e)?e:null}const p=1===e.nodeType?i.style:null;if(p){const e=p.fontWeight;"bold"===e||"bolder"===e||Number(e)>=600?u=!0:("normal"===e||"lighter"===e||""!==e&&Number(e)<600)&&(u=!1),"italic"===p.fontStyle||"oblique"===p.fontStyle?d=!0:"normal"===p.fontStyle&&(d=!1)}const f=ve.has(c);f&&a();for(const t of[...e.childNodes])s(t,u,d,h);f&&a()};s(l.content,!1,!1,null);for(;r.length>1&&0===r[r.length-1].length;)r.pop();return r.map(e=>function(e,t){const n=t=>e.map((n,l)=>n[t]&&(" "!==n.ch||Boolean(e[l-1]?.[t])&&Boolean(e[l+1]?.[t]))),l=[{bold:!0,italic:!0,links:!0},{bold:!0,italic:!1,links:!0},{bold:!1,italic:!1,links:!0},{bold:!1,italic:!1,links:!1}];for(const r of l){const l=xe(e,r.bold?n("bold"):null,r.italic?n("italic"):null,r.links),o=u([l]).text;if(d([l],h(o,t)))return o}return e.map(e=>e.ch).join("")}(e,n))}(e.html,t.doc,n):(e.text??"").replace(/\r\n?/g,"\n").split("\n");return t.multiline?l.join("\n"):1===l.length?l[0]:l.map(e=>e.trim()).filter(e=>""!==e).join(" ")}function xe(e,t,n,l){let r=0,o=null,a=null,s=null;return{bullet:!1,chars:e.map((e,i)=>{const c=l?e.href:null;return o=null===c?null:o&&o.href===c?o:p(++r,"link",c),a=t?.[i]?a??p(++r,"bold"):null,s=n?.[i]?s??p(++r,"italic"):null,{ch:e.ch,at:-1,marks:[o,a,s].filter(e=>null!==e)}})}}var we=/^([0-9]{1,3})\. $/;function Ce(e,t){const n=e.split("\n"),l=h(e,t);let r=0,o=0;const a=l.map((e,t)=>{const l=!e.bullet&&null==e.number&&"- "===n[t],a=null!=e.number||e.bullet?null:we.exec(n[t]),s=e.bullet||l,i=a?a[1]:e.number??null,c=l||a?[]:e.chars,u=c.map(e=>e.ch).join(""),d=null!=i?i.length+2:s?2:0,h={bullet:s,number:i,chars:c,start:r,src:r+d,vis:o,text:u};return r+=n[t].length+1,o+=u.length+1,h});return{lines:a,text:a.map(e=>e.text).join("\n")}}function Ee(e,t){const{lines:n}=e;for(let e=0;e<n.length;e+=1){const l=n[e];if(t<=l.vis+l.text.length||e===n.length-1)return[l,Math.max(0,Math.min(t-l.vis,l.text.length)),e]}return[n[0],0,0]}function Se(e,t){const[n,l]=Ee(e,t);if(0===l)return n.src;let r=0;for(const e of n.chars){if(l<=r+e.ch.length)return e.at+(l-r);r+=e.ch.length}return n.src}function De(e,t){const[n,l]=Ee(e,t);let r=0;for(const e of n.chars){if(l===r)return e.at;r+=e.ch.length}return Se(e,t)}function Ne(e,t){const{lines:n}=e;let l=n[0];for(const e of n)t>=e.start&&(l=e);let r=0;for(const e of l.chars){if(!(t>=e.at+e.ch.length)){t>e.at&&(r+=t-e.at);break}r+=e.ch.length}return l.vis+r}function Me(e,t,n){return[Ne(e,t),Ne(e,n)]}function Le(e,t,n){return t===n?[Se(e,t),Se(e,t)]:[De(e,t),Se(e,n)]}function Te(e,t){let n=0;for(let l=0;l<e.chars.length;l+=1){if(n>=t)return l;n+=e.chars[l].ch.length}return e.chars.length}function je(e,t,n,l,r){const o=Ce(e,t),[a,s,i]=Ee(o,Math.min(n,l)),[c,f,m]=Ee(o,Math.max(n,l)),b=Te(a,s),g=Te(c,f),y=a.chars.slice(0,b),v=c.chars.slice(g),k=n!==l&&a.chars[b]&&(i!==m||b<g)?a.chars[b].marks:function(e,t){const n=e.chars[t-1],l=e.chars[t],r=(e,t)=>{const n=e.findIndex(e=>"link"===e.kind);return-1===n||t?e:e.slice(0,n)};if(n){const e=n.marks.find(e=>"link"===e.kind),t=Boolean(e&&l?.marks.some(t=>t.id===e.id));return r(n.marks,t)}return l?r(l.marks,!1):[]}(a,b);let x=(w=o.lines,Math.max(0,...w.flatMap(e=>e.chars.flatMap(e=>e.marks.map(e=>e.id))))+1);var w;const C=e=>{let n;if(void 0!==r.markup){const e=x;n=h(r.markup,t).map(t=>({bullet:t.bullet,number:t.number??null,chars:t.chars.map(t=>({...t,at:-1,marks:t.marks.map(t=>({...t,id:t.id+e}))}))}))}else{let t=a.number??null;n=(r.text??"").split("\n").map((n,l)=>(l>0&&null!=t&&(t=function(e){return String(Number(e)+1).padStart(e.length,"0")}(t)),{bullet:a.bullet,number:t,chars:[...n].map(t=>({ch:t,at:-1,marks:e??[]}))}))}const l=n.map(e=>e.chars.map(e=>e.ch).join("")).join("\n"),s={bullet:a.bullet,number:a.number??null,chars:[...y,...n[0].chars]},c=n.slice(1);if(c.length>0){const e=c[c.length-1];c[c.length-1]={...e,chars:[...e.chars,...v]}}else s.chars.push(...v);return{lines:[...o.lines.slice(0,i).map(({bullet:e,number:t,chars:n})=>({bullet:e,number:t,chars:n})),s,...c,...o.lines.slice(m+1).map(({bullet:e,number:t,chars:n})=>({bullet:e,number:t,chars:n}))],shown:l}},E=void 0!==r.markup?[null]:[(e=>{let t=e.filter(e=>!r.drop?.some(t=>e.kind===t||"highlight"===t&&"accent"===e.kind));for(const e of r.add??[]){if(t.some(t=>t.kind===e))continue;const n=p(x++,e);n&&(t=[...t,n])}if(void 0!==r.color){t=t.filter(e=>"color"!==e.kind);const e=null===r.color?null:p(x++,"color",r.color);e&&(t=[...t,e])}return t})(k),k,[]];let S="",D="";for(const e of E){const n=C(e),l=u(n.lines).text;if(S=l,D=n.shown,d(n.lines,Ce(l,t).lines))break}return{text:S,caret:Math.min(n,l)+D.length}}function Be(e,t,n,l){const r=Ce(e,t),[o,,a]=Ee(r,n);return n!==l||!o.bullet&&null==o.number||""!==o.text?je(e,t,n,l,{text:"\n"}):Oe(e,t,a,!1,n)}function Oe(e,t,n,l,r){const o=Ce(e,t).lines.map(({bullet:e,number:t,chars:r},o)=>o===n?{bullet:l,number:null,chars:r}:{bullet:e,number:t,chars:r});return{text:u(o).text,caret:r}}function Re(e,t,n,l){const r=Ce(e,t),[o,a,s]=Ee(r,Math.min(n,l)),[i,c,d]=Ee(r,Math.max(n,l)),h=r.lines.slice(s,d+1).map(({bullet:e,number:t,chars:n},l)=>{const r=0===l?Te(o,a):0,u=l===d-s?Te(i,c):n.length;return{bullet:e,number:t,chars:n.slice(r,u)}});return u(h).text}var Pe="application/x-efficient-markup";function Ke(e,t,n,l){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",l&&(t.dataset.color=l,t.title=l.startsWith("#")?l.toUpperCase():l,t.style.color=l.startsWith("#")?l:`var(--es-color-${l}, 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 Fe(e,t,n,l){const r=e.layout.lines;if(n===t)return l>=e.lines.length?e.layout.text.length:r[l].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,l)}catch{return r[o].vis}return r[o].vis+Math.min(a.toString().length,r[o].text.length)}function He(e,t){const n=e.layout.lines;let l=n.length-1;for(let e=0;e<n.length;e+=1)if(t<=n[e].vis+n[e].text.length){l=e;break}let r=Math.max(0,t-n[l].vis);const o=e.lines[l].ownerDocument.createTreeWalker(e.lines[l],4);let a=o.nextNode(),s=null;for(;a;){if(r<=a.data.length)return[a,r];r-=a.data.length,s=a,a=o.nextNode()}return s?[s,s.data.length]:[e.lines[l],0]}function We(e,t,n){if(n<0){const n=e.charCodeAt(t-1);return t-(n>=56320&&n<=57343&&t>=2?2:1)}const l=e.charCodeAt(t);return t+(l>=55296&&l<=56319?2:1)}function $e({value:e,rules:t,multiline:n,readOnly:l=!1,placeholder:r,ariaLabel:o,handle:a,onEdit:s,onSelect:i,onHistory:c,onFormat:u,pending:d,onCommit:h,onCancel:p}){const f=ee(null),m=ee(null),b=ee(null),g=ee(null),y=ee(null),v=ee(e),[k,x]=te(0),w=ee({value:e,rules:t,multiline:n,readOnly:l,pending:d,onEdit:s,onHistory:c,onFormat:u});w.current={value:e,rules:t,multiline:n,readOnly:l,pending:d,onEdit:s,onHistory:c,onFormat:u};const C=()=>{const e=f.current,t=m.current,n=e?.ownerDocument.getSelection();if(!(e&&t&&n&&0!==n.rangeCount&&n.anchorNode&&e.contains(n.anchorNode)))return null;const l=Fe(t,e,n.anchorNode,n.anchorOffset),r=n.focusNode&&e.contains(n.focusNode)?Fe(t,e,n.focusNode,n.focusOffset):l;return l<=r?[l,r]:[r,l]},E=(e,t)=>{const n=f.current,l=m.current;if(!n||!l)return;const[r,o]=He(l,e),[a,s]=He(l,t);n.ownerDocument.getSelection()?.setBaseAndExtent(r,o,a,s)};a.current={getSource(){const e=C(),t=m.current;if(!e||!t)return null;const[n,l]=Le(t.layout,e[0],e[1]);return{start:n,end:l}},setSource(e,t,n){g.current={text:n,src:[e,t]},x(e=>e+1)},focus(){f.current?.focus()},rangeOf(e,t){const n=f.current,l=m.current;if(!n||!l)return null;const[r,o]=Me(l.layout,e,t),[a,s]=He(l,r),[i,c]=He(l,o),u=n.ownerDocument.createRange();return u.setStart(a,s),u.setEnd(i,c),u}},ne(()=>{const n=f.current;if(!n||y.current)return;const l=g.current?null:C();m.current=function(e,t){const n=e.ownerDocument;e.replaceChildren();const l=t.lines.map(t=>{const l=n.createElement("div");l.className=null!=t.number?"es-rich-line is-numbered":t.bullet?"es-rich-line is-bullet":"es-rich-line",null!=t.number&&(l.dataset.number=t.number);const r=[],o=()=>r.length?r[r.length-1].el:l;let a=null;for(const e of t.chars){let t=0;for(;t<r.length&&t<e.marks.length&&r[t].id===e.marks[t].id;)t+=1;(r.length>t||e.marks.length>t)&&(a=null),r.length=t;for(let l=t;l<e.marks.length;l+=1){const t=Ke(n,e.marks[l].kind,e.marks[l].href,e.marks[l].color);o().appendChild(t),r.push({id:e.marks[l].id,el:t})}a||(a=n.createTextNode(""),o().appendChild(a)),a.data+=e.ch}return 0===t.chars.length&&l.appendChild(n.createElement("br")),e.appendChild(l),l});return{layout:t,lines:l}}(n,Ce(e,t)),b.current=e;const r=g.current;if(!r||r.text!==e)return void(l&&n.ownerDocument.activeElement===n&&E(l[0],Math.min(l[1],m.current.layout.text.length)));g.current=null;const o=m.current.layout,[a,s]=r.vis??Me(o,r.src[0],r.src[1]);n.ownerDocument.activeElement!==n&&n.focus(),E(a,s)},[e,t,k]);const S=(e,t,n)=>{const l=m.current,[r,o]=Le(l.layout,t[0],t[1]);g.current={text:e.text,vis:[e.caret,e.caret]},e.text!==w.current.value?w.current.onEdit(e.text,{start:r,end:o},n):x(e=>e+1)};le(()=>{const e=f.current;if(!e)return;const t=t=>{const{value:n,rules:l,multiline:r,readOnly:o,pending:a}=w.current;if("insertCompositionText"===t.inputType)return;if(t.preventDefault(),o)return;const s=m.current,i=C();if(!s||!i)return;let[c,u]=i;const d="function"==typeof t.getTargetRanges?t.getTargetRanges()[0]:void 0;d&&!d.collapsed&&t.inputType.startsWith("delete")&&(c=Fe(s,e,d.startContainer,d.startOffset),u=Fe(s,e,d.endContainer,d.endOffset));const h=s.layout.text,p=t.inputType;if("historyUndo"!==p&&"historyRedo"!==p)if("formatBold"!==p&&"formatItalic"!==p&&"formatStrikeThrough"!==p)if("insertParagraph"!==p&&"insertLineBreak"!==p){if(p.startsWith("insert")){let o=t.data??t.dataTransfer?.getData("text/plain")??"";if("insertFromDrop"===p||"insertFromPaste"===p){const a=ke({html:t.dataTransfer?.getData("text/html"),text:o},{doc:e.ownerDocument,multiline:r,rules:l});return void S(je(n,l,c,u,{markup:a}),[c,u],"edit")}return r||(o=o.replace(/\s*\r?\n\s*/g," ")),void S(je(n,l,c,u,{text:o,add:a?.add,drop:a?.drop,color:a?.color}),[c,u],"type")}if(p.startsWith("delete")){if(c===u){const e=p.includes("Backward"),t=s.layout.lines.findIndex(e=>c>=e.vis&&c<=e.vis+e.text.length),r=s.layout.lines[t];if(e&&r&&c===r.vis&&(r.bullet||null!=r.number))return void S(Oe(n,l,t,!1,c),[c,u],"edit");if(e?0===c:c===h.length)return;e?c=We(h,c,-1):u=We(h,u,1)}S(je(n,l,c,u,{text:""}),[c,u],"type")}}else r&&S(Be(n,l,c,u),[c,u],"edit");else w.current.onFormat("formatBold"===p?"bold":"formatItalic"===p?"italic":"strike");else w.current.onHistory("historyUndo"===p?"undo":"redo")},n=()=>{y.current||x(e=>e+1)};return e.addEventListener("beforeinput",t),e.addEventListener("input",n),()=>{e.removeEventListener("beforeinput",t),e.removeEventListener("input",n)}},[]),le(()=>{const e=f.current;if(!e)return;const t=e.ownerDocument,n=()=>{const e=a.current?.getSource();e&&i(e)};return t.addEventListener("selectionchange",n),()=>t.removeEventListener("selectionchange",n)});const D=(n,r=!1)=>{const o=C();if(!o||o[0]===o[1])return;n.preventDefault();const a=m.current;n.clipboardData.setData("text/plain",a.layout.text.slice(o[0],o[1])),n.clipboardData.setData(Pe,Re(e,t,o[0],o[1])),r&&!l&&S(je(e,t,o[0],o[1],{text:""}),o,"edit")};/* @__PURE__ */
1
+ import{ColourWindow as e}from"../chunk-H24N5TMZ.js";import{DEFAULT_COPY_WORDS as t}from"../chunk-UH7IGZKF.js";import{DEFAULT_PICK_WORDS as n}from"../chunk-ZAOM6PFH.js";import{FieldNumber as l}from"../chunk-EWVJSRRY.js";import"../chunk-FPOKPNO4.js";import{GoldTextInput as r}from"../chunk-2FZJWH24.js";import{RETIRED_MARKS as o,applyMark as a,STANDARD_MARKUP as s,writeMarkedLines as i,sameMarks as c,markedLines as u,spanFor as d,markupTools as h,marksIn as p,findLink as f,markedAt as m,listIn as b,colorIn as g,clearStyle as y,isSafeLinkHref as v,toggleMark as k,colorOver as x,setList as w,unlinkAt as C,removeLink as E,linkOver as S,writeLink as D}from"../chunk-546BBOPE.js";import{SettingsSegmented as N,SettingsSwitch as M}from"../chunk-P6O363EE.js";import{useWords as L}from"../chunk-MFIRYGHW.js";import"../chunk-BZ5ASXOL.js";import{AlignJustifyIcon as T,AlignRightIcon as j,AlignCenterIcon as B,AlignLeftIcon as O,ParagraphSpacingIcon as R,LetterSpacingIcon as P,TextLinesIcon as K,TextSizeIcon as F,CaseNormalIcon as H,CaseUpperIcon as W,CaseLowerIcon as $,TextColorIcon as z,ListIcon as I,NumberedListIcon as A,ClearMarksIcon as q,BoldIcon as U,ItalicIcon as V,UnderlineIcon as Z,StrikeIcon as Y,LinkIcon as G,SuperscriptIcon as J,SubscriptIcon as X,QuietIcon as Q,EmphasisIcon as _}from"../chunk-L5KW4HG5.js";import{useRef as ee,useState as te,useLayoutEffect as ne,useEffect as le,useId as re}from"react";import{jsx as oe,jsxs as ae,Fragment as se}from"react/jsx-runtime";var ie=["left","center","right","justify"],ce=t.align,ue={left:/* @__PURE__ */oe(O,{}),center:/* @__PURE__ */oe(B,{}),right:/* @__PURE__ */oe(j,{}),justify:/* @__PURE__ */oe(T,{})},de={three:{labelsPx:94.5,widestLabelPx:39.94},four:{labelsPx:140,widestLabelPx:44}};function he(e,t=ce){return ie.filter(t=>e.includes(t)).map(e=>({id:e,label:t[e],icon:ue[e],title:t[e]}))}var pe=/[\u1100-\u11ff\u2e80-\u9fff\uac00-\ud7af\uf900-\ufaff\uff00-\uffef]/;function fe(e){if(e.every(e=>e.label===ce[e.id]))return e.length>3?de.four:de.three;const t=e.map(e=>[...e.label].reduce((e,t)=>e+(pe.test(t)?13:8),0));return{labelsPx:t.reduce((e,t)=>e+t,0),widestLabelPx:Math.max(0,...t)}}function me(e,t){const n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}}function be(e,t,n,l=a){const{start:r,end:o}=me(e,n);return l(e,r,o,t)}function ge(e,t,n){const{start:l,end:r}=me(e,n),o=l+t.length;return{text:e.slice(0,l)+t+e.slice(r),selectionStart:o,selectionEnd:o}}var ye=/* @__PURE__ */new Set(["script","style","head","title","meta","link","template","noscript","svg","math","object","iframe"]),ve=/* @__PURE__ */new Set(["p","div","li","ul","ol","dl","dt","dd","h1","h2","h3","h4","h5","h6","blockquote","pre","table","thead","tbody","tfoot","tr","section","article","header","footer","aside","nav","figure","figcaption","address","hr"]);function ke(e,t){const n=t.rules??s,l=e.html&&""!==e.html.trim()?function(e,t,n){const l=t.createElement("template");l.innerHTML=e;const r=[[]],o=()=>r[r.length-1],a=()=>{const e=o();for(;e.length>0&&" "===e[e.length-1].ch;)e.pop();e.length>0&&r.push([])},s=(e,t,n,l)=>{if(3===e.nodeType){for(const a of e.textContent??""){const e=/\s/.test(a)?" ":a,s=o();" "===e&&(0===s.length&&r.length>1||" "===s[s.length-1]?.ch)||s.push({ch:e,bold:t,italic:n,href:l})}return}if(1!==e.nodeType&&11!==e.nodeType)return;const i=e,c=1===e.nodeType?i.localName:"";if(ye.has(c))return;if("br"===c)return void r.push([]);let u=t,d=n,h=l;if("b"!==c&&"strong"!==c||(u=!0),"i"!==c&&"em"!==c||(d=!0),"a"===c){const e=(i.getAttribute("href")??"").trim();h=v(e)?e:null}const p=1===e.nodeType?i.style:null;if(p){const e=p.fontWeight;"bold"===e||"bolder"===e||Number(e)>=600?u=!0:("normal"===e||"lighter"===e||""!==e&&Number(e)<600)&&(u=!1),"italic"===p.fontStyle||"oblique"===p.fontStyle?d=!0:"normal"===p.fontStyle&&(d=!1)}const f=ve.has(c);f&&a();for(const t of[...e.childNodes])s(t,u,d,h);f&&a()};s(l.content,!1,!1,null);for(;r.length>1&&0===r[r.length-1].length;)r.pop();return r.map(e=>function(e,t){const n=t=>e.map((n,l)=>n[t]&&(" "!==n.ch||Boolean(e[l-1]?.[t])&&Boolean(e[l+1]?.[t]))),l=[{bold:!0,italic:!0,links:!0},{bold:!0,italic:!1,links:!0},{bold:!1,italic:!1,links:!0},{bold:!1,italic:!1,links:!1}];for(const r of l){const l=xe(e,r.bold?n("bold"):null,r.italic?n("italic"):null,r.links),o=i([l]).text;if(c([l],u(o,t)))return o}return e.map(e=>e.ch).join("")}(e,n))}(e.html,t.doc,n):(e.text??"").replace(/\r\n?/g,"\n").split("\n");return t.multiline?l.join("\n"):1===l.length?l[0]:l.map(e=>e.trim()).filter(e=>""!==e).join(" ")}function xe(e,t,n,l){let r=0,o=null,a=null,s=null;return{bullet:!1,chars:e.map((e,i)=>{const c=l?e.href:null;return o=null===c?null:o&&o.href===c?o:d(++r,"link",c),a=t?.[i]?a??d(++r,"bold"):null,s=n?.[i]?s??d(++r,"italic"):null,{ch:e.ch,at:-1,marks:[o,a,s].filter(e=>null!==e)}})}}var we=/^([0-9]{1,3})\. $/;function Ce(e,t){const n=e.split("\n"),l=u(e,t);let r=0,o=0;const a=l.map((e,t)=>{const l=!e.bullet&&null==e.number&&"- "===n[t],a=null!=e.number||e.bullet?null:we.exec(n[t]),s=e.bullet||l,i=a?a[1]:e.number??null,c=l||a?[]:e.chars,u=c.map(e=>e.ch).join(""),d=null!=i?i.length+2:s?2:0,h={bullet:s,number:i,chars:c,start:r,src:r+d,vis:o,text:u};return r+=n[t].length+1,o+=u.length+1,h});return{lines:a,text:a.map(e=>e.text).join("\n")}}function Ee(e,t){const{lines:n}=e;for(let e=0;e<n.length;e+=1){const l=n[e];if(t<=l.vis+l.text.length||e===n.length-1)return[l,Math.max(0,Math.min(t-l.vis,l.text.length)),e]}return[n[0],0,0]}function Se(e,t){const[n,l]=Ee(e,t);if(0===l)return n.src;let r=0;for(const e of n.chars){if(l<=r+e.ch.length)return e.at+(l-r);r+=e.ch.length}return n.src}function De(e,t){const[n,l]=Ee(e,t);let r=0;for(const e of n.chars){if(l===r)return e.at;r+=e.ch.length}return Se(e,t)}function Ne(e,t){const{lines:n}=e;let l=n[0];for(const e of n)t>=e.start&&(l=e);let r=0;for(const e of l.chars){if(!(t>=e.at+e.ch.length)){t>e.at&&(r+=t-e.at);break}r+=e.ch.length}return l.vis+r}function Me(e,t,n){return[Ne(e,t),Ne(e,n)]}function Le(e,t,n){return t===n?[Se(e,t),Se(e,t)]:[De(e,t),Se(e,n)]}function Te(e,t){let n=0;for(let l=0;l<e.chars.length;l+=1){if(n>=t)return l;n+=e.chars[l].ch.length}return e.chars.length}function je(e,t,n,l,r){const o=Ce(e,t),[a,s,h]=Ee(o,Math.min(n,l)),[p,f,m]=Ee(o,Math.max(n,l)),b=Te(a,s),g=Te(p,f),y=a.chars.slice(0,b),v=p.chars.slice(g),k=n!==l&&a.chars[b]&&(h!==m||b<g)?a.chars[b].marks:function(e,t){const n=e.chars[t-1],l=e.chars[t],r=(e,t)=>{const n=e.findIndex(e=>"link"===e.kind);return-1===n||t?e:e.slice(0,n)};if(n){const e=n.marks.find(e=>"link"===e.kind),t=Boolean(e&&l?.marks.some(t=>t.id===e.id));return r(n.marks,t)}return l?r(l.marks,!1):[]}(a,b);let x=(w=o.lines,Math.max(0,...w.flatMap(e=>e.chars.flatMap(e=>e.marks.map(e=>e.id))))+1);var w;const C=e=>{let n;if(void 0!==r.markup){const e=x;n=u(r.markup,t).map(t=>({bullet:t.bullet,number:t.number??null,chars:t.chars.map(t=>({...t,at:-1,marks:t.marks.map(t=>({...t,id:t.id+e}))}))}))}else{let t=a.number??null;n=(r.text??"").split("\n").map((n,l)=>(l>0&&null!=t&&(t=function(e){return String(Number(e)+1).padStart(e.length,"0")}(t)),{bullet:a.bullet,number:t,chars:[...n].map(t=>({ch:t,at:-1,marks:e??[]}))}))}const l=n.map(e=>e.chars.map(e=>e.ch).join("")).join("\n"),s={bullet:a.bullet,number:a.number??null,chars:[...y,...n[0].chars]},i=n.slice(1);if(i.length>0){const e=i[i.length-1];i[i.length-1]={...e,chars:[...e.chars,...v]}}else s.chars.push(...v);return{lines:[...o.lines.slice(0,h).map(({bullet:e,number:t,chars:n})=>({bullet:e,number:t,chars:n})),s,...i,...o.lines.slice(m+1).map(({bullet:e,number:t,chars:n})=>({bullet:e,number:t,chars:n}))],shown:l}},E=void 0!==r.markup?[null]:[(e=>{let t=e.filter(e=>!r.drop?.some(t=>e.kind===t||"highlight"===t&&"accent"===e.kind));for(const e of r.add??[]){if(t.some(t=>t.kind===e))continue;const n=d(x++,e);n&&(t=[...t,n])}if(void 0!==r.color){t=t.filter(e=>"color"!==e.kind);const e=null===r.color?null:d(x++,"color",r.color);e&&(t=[...t,e])}return t})(k),k,[]];let S="",D="";for(const e of E){const n=C(e),l=i(n.lines).text;if(S=l,D=n.shown,c(n.lines,Ce(l,t).lines))break}return{text:S,caret:Math.min(n,l)+D.length}}function Be(e,t,n,l){const r=Ce(e,t),[o,,a]=Ee(r,n);return n!==l||!o.bullet&&null==o.number||""!==o.text?je(e,t,n,l,{text:"\n"}):Oe(e,t,a,!1,n)}function Oe(e,t,n,l,r){const o=Ce(e,t).lines.map(({bullet:e,number:t,chars:r},o)=>o===n?{bullet:l,number:null,chars:r}:{bullet:e,number:t,chars:r});return{text:i(o).text,caret:r}}function Re(e,t,n,l){const r=Ce(e,t),[o,a,s]=Ee(r,Math.min(n,l)),[c,u,d]=Ee(r,Math.max(n,l)),h=r.lines.slice(s,d+1).map(({bullet:e,number:t,chars:n},l)=>{const r=0===l?Te(o,a):0,i=l===d-s?Te(c,u):n.length;return{bullet:e,number:t,chars:n.slice(r,i)}});return i(h).text}var Pe="application/x-efficient-markup";function Ke(e,t,n,l){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",l&&(t.dataset.color=l,t.title=l.startsWith("#")?l.toUpperCase():l,t.style.color=l.startsWith("#")?l:`var(--es-color-${l}, 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 Fe(e,t,n,l){const r=e.layout.lines;if(n===t)return l>=e.lines.length?e.layout.text.length:r[l].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,l)}catch{return r[o].vis}return r[o].vis+Math.min(a.toString().length,r[o].text.length)}function He(e,t){const n=e.layout.lines;let l=n.length-1;for(let e=0;e<n.length;e+=1)if(t<=n[e].vis+n[e].text.length){l=e;break}let r=Math.max(0,t-n[l].vis);const o=e.lines[l].ownerDocument.createTreeWalker(e.lines[l],4);let a=o.nextNode(),s=null;for(;a;){if(r<=a.data.length)return[a,r];r-=a.data.length,s=a,a=o.nextNode()}return s?[s,s.data.length]:[e.lines[l],0]}function We(e,t,n){if(n<0){const n=e.charCodeAt(t-1);return t-(n>=56320&&n<=57343&&t>=2?2:1)}const l=e.charCodeAt(t);return t+(l>=55296&&l<=56319?2:1)}function $e({value:e,rules:t,multiline:n,readOnly:l=!1,placeholder:r,ariaLabel:o,handle:a,onEdit:s,onSelect:i,onHistory:c,onFormat:u,pending:d,onCommit:h,onCancel:p}){const f=ee(null),m=ee(null),b=ee(null),g=ee(null),y=ee(null),v=ee(e),[k,x]=te(0),w=ee({value:e,rules:t,multiline:n,readOnly:l,pending:d,onEdit:s,onHistory:c,onFormat:u});w.current={value:e,rules:t,multiline:n,readOnly:l,pending:d,onEdit:s,onHistory:c,onFormat:u};const C=()=>{const e=f.current,t=m.current,n=e?.ownerDocument.getSelection();if(!(e&&t&&n&&0!==n.rangeCount&&n.anchorNode&&e.contains(n.anchorNode)))return null;const l=Fe(t,e,n.anchorNode,n.anchorOffset),r=n.focusNode&&e.contains(n.focusNode)?Fe(t,e,n.focusNode,n.focusOffset):l;return l<=r?[l,r]:[r,l]},E=(e,t)=>{const n=f.current,l=m.current;if(!n||!l)return;const[r,o]=He(l,e),[a,s]=He(l,t);n.ownerDocument.getSelection()?.setBaseAndExtent(r,o,a,s)};a.current={getSource(){const e=C(),t=m.current;if(!e||!t)return null;const[n,l]=Le(t.layout,e[0],e[1]);return{start:n,end:l}},setSource(e,t,n){g.current={text:n,src:[e,t]},x(e=>e+1)},focus(){f.current?.focus()},rangeOf(e,t){const n=f.current,l=m.current;if(!n||!l)return null;const[r,o]=Me(l.layout,e,t),[a,s]=He(l,r),[i,c]=He(l,o),u=n.ownerDocument.createRange();return u.setStart(a,s),u.setEnd(i,c),u}},ne(()=>{const n=f.current;if(!n||y.current)return;const l=g.current?null:C();m.current=function(e,t){const n=e.ownerDocument;e.replaceChildren();const l=t.lines.map(t=>{const l=n.createElement("div");l.className=null!=t.number?"es-rich-line is-numbered":t.bullet?"es-rich-line is-bullet":"es-rich-line",null!=t.number&&(l.dataset.number=t.number);const r=[],o=()=>r.length?r[r.length-1].el:l;let a=null;for(const e of t.chars){let t=0;for(;t<r.length&&t<e.marks.length&&r[t].id===e.marks[t].id;)t+=1;(r.length>t||e.marks.length>t)&&(a=null),r.length=t;for(let l=t;l<e.marks.length;l+=1){const t=Ke(n,e.marks[l].kind,e.marks[l].href,e.marks[l].color);o().appendChild(t),r.push({id:e.marks[l].id,el:t})}a||(a=n.createTextNode(""),o().appendChild(a)),a.data+=e.ch}return 0===t.chars.length&&l.appendChild(n.createElement("br")),e.appendChild(l),l});return{layout:t,lines:l}}(n,Ce(e,t)),b.current=e;const r=g.current;if(!r||r.text!==e)return void(l&&n.ownerDocument.activeElement===n&&E(l[0],Math.min(l[1],m.current.layout.text.length)));g.current=null;const o=m.current.layout,[a,s]=r.vis??Me(o,r.src[0],r.src[1]);n.ownerDocument.activeElement!==n&&n.focus(),E(a,s)},[e,t,k]);const S=(e,t,n)=>{const l=m.current,[r,o]=Le(l.layout,t[0],t[1]);g.current={text:e.text,vis:[e.caret,e.caret]},e.text!==w.current.value?w.current.onEdit(e.text,{start:r,end:o},n):x(e=>e+1)};le(()=>{const e=f.current;if(!e)return;const t=t=>{const{value:n,rules:l,multiline:r,readOnly:o,pending:a}=w.current;if("insertCompositionText"===t.inputType)return;if(t.preventDefault(),o)return;const s=m.current,i=C();if(!s||!i)return;let[c,u]=i;const d="function"==typeof t.getTargetRanges?t.getTargetRanges()[0]:void 0;d&&!d.collapsed&&t.inputType.startsWith("delete")&&(c=Fe(s,e,d.startContainer,d.startOffset),u=Fe(s,e,d.endContainer,d.endOffset));const h=s.layout.text,p=t.inputType;if("historyUndo"!==p&&"historyRedo"!==p)if("formatBold"!==p&&"formatItalic"!==p&&"formatStrikeThrough"!==p)if("insertParagraph"!==p&&"insertLineBreak"!==p){if(p.startsWith("insert")){let o=t.data??t.dataTransfer?.getData("text/plain")??"";if("insertFromDrop"===p||"insertFromPaste"===p){const a=ke({html:t.dataTransfer?.getData("text/html"),text:o},{doc:e.ownerDocument,multiline:r,rules:l});return void S(je(n,l,c,u,{markup:a}),[c,u],"edit")}return r||(o=o.replace(/\s*\r?\n\s*/g," ")),void S(je(n,l,c,u,{text:o,add:a?.add,drop:a?.drop,color:a?.color}),[c,u],"type")}if(p.startsWith("delete")){if(c===u){const e=p.includes("Backward"),t=s.layout.lines.findIndex(e=>c>=e.vis&&c<=e.vis+e.text.length),r=s.layout.lines[t];if(e&&r&&c===r.vis&&(r.bullet||null!=r.number))return void S(Oe(n,l,t,!1,c),[c,u],"edit");if(e?0===c:c===h.length)return;e?c=We(h,c,-1):u=We(h,u,1)}S(je(n,l,c,u,{text:""}),[c,u],"type")}}else r&&S(Be(n,l,c,u),[c,u],"edit");else w.current.onFormat("formatBold"===p?"bold":"formatItalic"===p?"italic":"strike");else w.current.onHistory("historyUndo"===p?"undo":"redo")},n=()=>{y.current||x(e=>e+1)};return e.addEventListener("beforeinput",t),e.addEventListener("input",n),()=>{e.removeEventListener("beforeinput",t),e.removeEventListener("input",n)}},[]),le(()=>{const e=f.current;if(!e)return;const t=e.ownerDocument,n=()=>{const e=a.current?.getSource();e&&i(e)};return t.addEventListener("selectionchange",n),()=>t.removeEventListener("selectionchange",n)});const D=(n,r=!1)=>{const o=C();if(!o||o[0]===o[1])return;n.preventDefault();const a=m.current;n.clipboardData.setData("text/plain",a.layout.text.slice(o[0],o[1])),n.clipboardData.setData(Pe,Re(e,t,o[0],o[1])),r&&!l&&S(je(e,t,o[0],o[1],{text:""}),o,"edit")};/* @__PURE__ */
2
2
  return ae("div",{className:"es-rich-wrap",children:[r&&""===e?/* @__PURE__ */oe("div",{className:"es-rich-placeholder","aria-hidden":"true",children:r}):null,
3
3
  /* @__PURE__ */oe("div",{ref:f,className:`es-rich${n?" is-multiline":" is-single"}${l?" is-off":""}`,contentEditable:!l,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":n,"aria-label":o,"aria-readonly":l||void 0,"aria-placeholder":r,tabIndex:l?-1:0,spellCheck:!0,onFocus:()=>{v.current=e},onBlur:()=>{e!==v.current&&h?.(e),v.current=e},onKeyDown:t=>{if("Escape"===t.key)return t.preventDefault(),p?.(v.current),void(v.current=e);"Enter"!==t.key||n||(t.preventDefault(),e!==v.current&&h?.(e),v.current=e)},onCompositionStart:()=>{const e=C()??[0,0];y.current={from:e[0],to:e[1]}},onCompositionEnd:e=>{const t=y.current;if(y.current=null,!t)return;const{value:n,rules:l,pending:r}=w.current;e.data?S(je(n,l,t.from,t.to,{text:e.data,add:r?.add,drop:r?.drop,color:r?.color}),[t.from,t.to],"type"):x(e=>e+1)},onCopy:e=>D(e),onCut:e=>D(e,!0),onPaste:r=>{if(r.preventDefault(),l)return;const o=C();if(!o)return;const a=r.clipboardData.getData(Pe),s=a?n?a:a.replace(/\s*\r?\n\s*/g," "):ke({html:r.clipboardData.getData("text/html"),text:r.clipboardData.getData("text/plain")},{doc:r.currentTarget.ownerDocument,multiline:n,rules:t});S(je(e,t,o[0],o[1],{markup:s}),o,"edit")}})]})}var ze=1e3;function Ie(e=200){let t=[],n=[],l=null,r=0;return{record(o,a,s){const i="type"===a&&"type"===l&&s-r<1e3;l=a,r=s,n=[],i||(t.push(o),t.length>e&&t.shift())},undo(e){const r=t.pop();return r?(n.push(e),l=null,r):null},redo(e){const r=n.pop();return r?(t.push(e),l=null,r):null},reset(){t=[],n=[],l=null}}}var Ae={fontSize:{key:"fontSize",nameKey:"fontSize",icon:/* @__PURE__ */oe(F,{}),unit:"px",step:1,shiftStep:10,min:5},lineHeight:{key:"lineHeight",nameKey:"lineHeight",icon:/* @__PURE__ */oe(K,{}),unit:"%",step:1,shiftStep:10,min:50,max:250,scale:100},letterSpacing:{key:"letterSpacing",nameKey:"letterSpacing",icon:/* @__PURE__ */oe(P,{}),unit:"px",step:.1,shiftStep:1,min:-10},paragraphSpacing:{key:"paragraphSpacing",nameKey:"paragraphSpacing",icon:/* @__PURE__ */oe(R,{}),unit:"px",step:1,shiftStep:10,min:0}};function qe(e,t){return void 0===e?void 0:Number((e*t).toFixed(6))}function Ue({cells:e,words:n,readOnly:r=!1}){const o=n??t.cells;/* @__PURE__ */
4
4
  return oe("div",{className:"es-copy-cells",children:e.map(e=>{const t=e.scale??1,n=e.name??(e.nameKey?o[e.nameKey]:e.key),a=e.unit??"",s=e.step??1;/* @__PURE__ */
@@ -8,7 +8,7 @@ return ae("div",{className:"es-copy-pop es-copy-colors",role:"dialog","aria-labe
8
8
  /* @__PURE__ */oe("div",{className:"es-pick-theme",role:"group","aria-label":r.theme,children:t.map(e=>/* @__PURE__ */oe("button",{type:"button",className:"es-pick-theme-swatch","data-color":e.name,"aria-label":e.label,title:`${e.label} · ${e.value.toUpperCase()}`,"aria-pressed":l===e.name,style:{background:e.value},onMouseDown:Ve,onClick:()=>o(e.name)},e.name))}),
9
9
  /* @__PURE__ */oe("span",{className:"es-copy-pop-label",children:r.any}),
10
10
  /* @__PURE__ */oe(e,{value:a??"",onChange:e=>{e!==l&&o(e)},label:r.title,swatch:!0,dragWrites:"end",words:{...n.colour,dialog:()=>r.any,square:r.square,hue:r.hue,hex:()=>r.hex}}),
11
- /* @__PURE__ */oe("div",{className:"es-copy-pop-foot",children:/* @__PURE__ */oe("button",{type:"button",className:"es-copy-link-btn is-danger",onMouseDown:Ve,onClick:()=>o(null),children:r.remove})})]})}function Ye({href:e,editing:n,onApply:l,onRemove:r,onClose:o,floating:a=!1}){const s=L("copy",t).link,i=re(),[c,u]=te(e),[d,h]=te(!1),p=ee(null);le(()=>{p.current?.focus(),p.current?.select()},[]);const f=()=>{const e=c.trim();x(e)?l(e):h(!0)};/* @__PURE__ */
11
+ /* @__PURE__ */oe("div",{className:"es-copy-pop-foot",children:/* @__PURE__ */oe("button",{type:"button",className:"es-copy-link-btn is-danger",onMouseDown:Ve,onClick:()=>o(null),children:r.remove})})]})}function Ye({href:e,editing:n,onApply:l,onRemove:r,onClose:o,floating:a=!1}){const s=L("copy",t).link,i=re(),[c,u]=te(e),[d,h]=te(!1),p=ee(null);le(()=>{p.current?.focus(),p.current?.select()},[]);const f=()=>{const e=c.trim();v(e)?l(e):h(!0)};/* @__PURE__ */
12
12
  return ae("div",{role:"dialog","aria-label":s.title,className:"es-copy-link"+(a?" es-copy-pop":""),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),f()):"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),o())},children:[
13
13
  /* @__PURE__ */oe("label",{htmlFor:i,className:"es-copy-link-label",children:s.label}),
14
14
  /* @__PURE__ */oe("input",{ref:p,id:i,type:"text",className:"es-copy-link-input",value:c,placeholder:s.placeholder,spellCheck:!1,autoComplete:"off","aria-invalid":d||void 0,"aria-describedby":d?`${i}-why`:void 0,onChange:e=>{u(e.target.value),h(!1)}}),d?/* @__PURE__ */oe("p",{id:`${i}-why`,role:"alert",className:"es-copy-link-why",children:s.refused}):null,
@@ -21,12 +21,12 @@ return ae("div",{className:"es-tb",role:"toolbar","aria-label":p,children:[
21
21
  /* @__PURE__ */ae("div",{className:"es-tb-row"+(void 0===i?" is-eight":""),children:[f("bold",e.bold,/* @__PURE__ */oe(U,{}),"Meta+B"),f("italic",e.italic,/* @__PURE__ */oe(V,{}),"Meta+I"),f("underline",e.underline,/* @__PURE__ */oe(Z,{}),"Meta+U"),f("strike",e.strike,/* @__PURE__ */oe(Y,{})),a?/* @__PURE__ */oe("button",{type:"button",className:"es-tb-cell es-tb-btn es-tb-color"+(a.open?" is-on":""),"aria-label":e.color,title:e.color,"aria-haspopup":"dialog","aria-expanded":a.open,disabled:h,style:a.run?{"--es-tb-run":a.run}:void 0,onMouseDown:Ge,onClick:a.onToggle,children:/* @__PURE__ */oe(z,{})}):/* @__PURE__ */oe(Je,{}),f("link",e.link,/* @__PURE__ */oe(G,{}),"Meta+K"),f("sup",e.sup,/* @__PURE__ */oe(J,{})),f("sub",e.sub,/* @__PURE__ */oe(X,{})),void 0!==i?i??/* @__PURE__ */oe(Je,{}):null]}),
22
22
  /* @__PURE__ */ae("div",{className:"es-tb-row",children:[
23
23
  /* @__PURE__ */oe("div",{className:"es-tb-group",role:"radiogroup","aria-label":n,children:m.map(([e,n])=>c&&c.allow.includes(e)?/* @__PURE__ */oe("button",{type:"button",role:"radio",className:"es-tb-cell es-tb-btn"+(c.value===e?" is-on":""),"aria-checked":c.value===e,"aria-label":t[e],title:t[e],disabled:h||c.disabled,onMouseDown:Ge,onClick:()=>c.onChange(e),children:n},e):/* @__PURE__ */oe(Je,{},e))}),u&&l.has("bullet")?/* @__PURE__ */oe("button",{type:"button",className:"es-tb-cell es-tb-btn"+("bullet"===u.pressed?" is-on":""),"aria-label":e.bullet,title:e.bullet,"aria-pressed":"bullet"===u.pressed,disabled:h,onMouseDown:Ge,onClick:()=>u.onList("bullet"),children:/* @__PURE__ */oe(I,{})}):/* @__PURE__ */oe(Je,{}),u&&l.has("number")?/* @__PURE__ */oe("button",{type:"button",className:"es-tb-cell es-tb-btn"+("number"===u.pressed?" is-on":""),"aria-label":e.number,title:e.number,"aria-pressed":"number"===u.pressed,disabled:h,onMouseDown:Ge,onClick:()=>u.onList("number"),children:/* @__PURE__ */oe(A,{})}):/* @__PURE__ */oe(Je,{}),
24
- /* @__PURE__ */oe("div",{className:"es-tb-group",role:"radiogroup","aria-label":e.letterCase,children:b.map(([e,t,n])=>d?/* @__PURE__ */oe("button",{type:"button",role:"radio",className:"es-tb-cell es-tb-btn"+(d.value===e?" is-on":""),"aria-checked":d.value===e,"aria-label":t,title:t,disabled:h||d.disabled,onMouseDown:Ge,onClick:()=>d.onChange(d.value===e?"":e),children:n},e):/* @__PURE__ */oe(Je,{},e))})]})]})}var Qe=(e,t,n)=>Math.min(Math.max(e,t),Math.max(t,n));var _e=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom});function et(e){const t=e.ownerDocument,n=t.documentElement,l={left:0,top:0,right:n.clientWidth,bottom:n.clientHeight},r=t.defaultView?.getComputedStyle.bind(t.defaultView);for(let o=e.parentElement;o&&o!==n&&o!==t.body;o=o.parentElement){const e=r?.(o);if(!e||"visible"===e.overflowX&&"visible"===e.overflowY)continue;const t=o.getBoundingClientRect();if(0===t.width&&0===t.height)continue;const n=t.left+o.clientLeft,a=t.top+o.clientTop;l.left=Math.max(l.left,n),l.top=Math.max(l.top,a),l.right=Math.min(l.right,n+(o.clientWidth||t.width)),l.bottom=Math.min(l.bottom,a+(o.clientHeight||t.height))}return l}function tt(e){const t=e.offsetParent??e.parentElement;if(!t)return{left:0,top:0};const n=t.getBoundingClientRect();return{left:n.left+t.clientLeft-t.scrollLeft,top:n.top+t.clientTop-t.scrollTop}}var nt=/* @__PURE__ */new Set([...s,"clear"]),lt={bold:/* @__PURE__ */oe(U,{size:16}),italic:/* @__PURE__ */oe(V,{size:16}),strike:/* @__PURE__ */oe(Y,{size:16}),highlight:/* @__PURE__ */oe(_,{size:16}),quiet:/* @__PURE__ */oe(Q,{size:16}),link:/* @__PURE__ */oe(G,{size:16}),clear:/* @__PURE__ */oe(q,{size:16})};function rt(e){if(!e)return;const t=e.split("+"),n=t.pop().toUpperCase();return["Meta",...t.map(e=>e[0].toUpperCase()+e.slice(1)),n].join("+")}var ot={bold:"is-bold",italic:"is-italic",strike:"is-strike"};function at({tools:e,onApply:n,disabled:l=!1,actions:r,align:o,glyphs:a,ariaLabel:s,pressed:i,open:c=null}){const u=L("copy",t),d=("string"==typeof e[0]?f(e).map(e=>({...e,...u.marks[e.style]})):e).filter(e=>!nt.has(e.style));return 0!==d.length||r||o?/* @__PURE__ */ae("div",{className:"es-copy-bar",role:"group","aria-label":s??u.formatting,children:[d.map(e=>{const t=a?.[e.style]??lt[e.style],r=c===e.style||Boolean(i?.[e.style]);/* @__PURE__ */
24
+ /* @__PURE__ */oe("div",{className:"es-tb-group",role:"radiogroup","aria-label":e.letterCase,children:b.map(([e,t,n])=>d?/* @__PURE__ */oe("button",{type:"button",role:"radio",className:"es-tb-cell es-tb-btn"+(d.value===e?" is-on":""),"aria-checked":d.value===e,"aria-label":t,title:t,disabled:h||d.disabled,onMouseDown:Ge,onClick:()=>d.onChange(d.value===e?"":e),children:n},e):/* @__PURE__ */oe(Je,{},e))})]})]})}var Qe=(e,t,n)=>Math.min(Math.max(e,t),Math.max(t,n));var _e=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom});function et(e){const t=e.ownerDocument,n=t.documentElement,l={left:0,top:0,right:n.clientWidth,bottom:n.clientHeight},r=t.defaultView?.getComputedStyle.bind(t.defaultView);for(let o=e.parentElement;o&&o!==n&&o!==t.body;o=o.parentElement){const e=r?.(o);if(!e||"visible"===e.overflowX&&"visible"===e.overflowY)continue;const t=o.getBoundingClientRect();if(0===t.width&&0===t.height)continue;const n=t.left+o.clientLeft,a=t.top+o.clientTop;l.left=Math.max(l.left,n),l.top=Math.max(l.top,a),l.right=Math.min(l.right,n+(o.clientWidth||t.width)),l.bottom=Math.min(l.bottom,a+(o.clientHeight||t.height))}return l}function tt(e){const t=e.offsetParent??e.parentElement;if(!t)return{left:0,top:0};const n=t.getBoundingClientRect();return{left:n.left+t.clientLeft-t.scrollLeft,top:n.top+t.clientTop-t.scrollTop}}var nt=/* @__PURE__ */new Set([...o,"clear"]),lt={bold:/* @__PURE__ */oe(U,{size:16}),italic:/* @__PURE__ */oe(V,{size:16}),strike:/* @__PURE__ */oe(Y,{size:16}),highlight:/* @__PURE__ */oe(_,{size:16}),quiet:/* @__PURE__ */oe(Q,{size:16}),link:/* @__PURE__ */oe(G,{size:16}),clear:/* @__PURE__ */oe(q,{size:16})};function rt(e){if(!e)return;const t=e.split("+"),n=t.pop().toUpperCase();return["Meta",...t.map(e=>e[0].toUpperCase()+e.slice(1)),n].join("+")}var ot={bold:"is-bold",italic:"is-italic",strike:"is-strike"};function at({tools:e,onApply:n,disabled:l=!1,actions:r,align:o,glyphs:a,ariaLabel:s,pressed:i,open:c=null}){const u=L("copy",t),d=("string"==typeof e[0]?h(e).map(e=>({...e,...u.marks[e.style]})):e).filter(e=>!nt.has(e.style));return 0!==d.length||r||o?/* @__PURE__ */ae("div",{className:"es-copy-bar",role:"group","aria-label":s??u.formatting,children:[d.map(e=>{const t=a?.[e.style]??lt[e.style],r=c===e.style||Boolean(i?.[e.style]);/* @__PURE__ */
25
25
  return oe("button",{type:"button",onMouseDown:e=>e.preventDefault(),onClick:()=>n(e.style),disabled:l,title:e.title,"aria-label":e.name??e.title,"aria-keyshortcuts":rt(e.shortcut),"aria-pressed":i||c?r:void 0,"aria-haspopup":"link"===e.style&&i?"dialog":void 0,"aria-expanded":"link"===e.style&&i?"link"===c:void 0,className:`es-copy-mark${t?" has-glyph":ot[e.style]?` ${ot[e.style]}`:""}${r?" is-active":""}`,children:t??e.label},e.style)}),r?/* @__PURE__ */ae(se,{children:[
26
- /* @__PURE__ */oe("span",{className:"es-copy-bar-split","aria-hidden":"true"}),r]}):null,o?/* @__PURE__ */oe("span",{className:"es-copy-bar-end",children:o}):null]}):null}function st({target:e,onChange:t}){const n=ee(null);return ne(()=>{const t=n.current,l=e.current;t&&l&&l.value===t.text&&(n.current=null,l.focus(),l.setSelectionRange(t.start,t.end))}),l=>{const r=l(e.current);t(r.text),n.current={start:r.selectionStart,end:r.selectionEnd,text:r.text}}}function it({value:e,onChange:n,onCommit:l,onCancel:s,multiline:u=!1,placeholder:d,ariaLabel:h,className:x,readOnly:T=!1,rules:j,tools:B=[],writeMark:O,actions:R,align:P,glyphs:K,barLabel:F,renderFooter:H,inputRef:W,barShows:$="always",richText:z=!0,defaultShowMarks:I=!1,toolbar:A="final",colors:U,cells:V,letterCase:Z,lastTool:Y}){const G="final"===A,J=L("copy",t),X=ee(null),Q=W??X,[_,ie]=te(!1),[ce,ue]=te(null),de=ee(Ie()).current,pe=ee(null);le(()=>{const t=pe.current;t&&e===t.to?pe.current=null:t&&e===t.from||(pe.current=null,de.reset())},[e,de]);const me=t=>{pe.current={from:pe.current?.from??e,to:t},n(t)},ye=t=>({text:e,start:t?.selectionStart??ce?.start??e.length,end:t?.selectionEnd??ce?.end??e.length}),[ve,xe]=te(I),we=z&&!(u&&ve),Ce=ee(null),Ee=re(),[Se,De]=te(null),[Ne,Me]=te(!1),Le=()=>{if(!we)return Q.current;const e=Ce.current?.getSource()??ce;return e?{selectionStart:e.start,selectionEnd:e.end}:null},Te=st({target:Q,onChange:me}),je=e=>(ue({start:e.selectionStart,end:e.selectionEnd}),e),Be=(t,n)=>{if(!we)return void Te(e=>(n&&de.record(ye(e),"edit",Date.now()),je(t(e))));const l=Le(),r=je(t(l));n&&de.record(ye(l),"edit",Date.now()),De(null),r.text!==e&&me(r.text),Ce.current?.setSource(r.selectionStart,r.selectionEnd,r.text)},Oe=e=>Be(e,!0),Re=e=>Be(t=>{const n=ye(t),l=de[e](n);return l?{text:l.text,selectionStart:l.start,selectionEnd:l.end}:{text:n.text,selectionStart:n.start,selectionEnd:n.end}},!1),Pe=ee(null);ne(()=>{const t=Pe.current;t&&(Pe.current=null,we?Ce.current?.setSource(t.start,t.end,e):(Q.current?.focus(),Q.current?.setSelectionRange(t.start,t.end),ue(t)))},[we]);const[Ke,Fe]=te(null),He=j??c,We=("string"==typeof B[0]?f(B):B).filter(e=>!nt.has(e.style)),ze=G?("string"==typeof B[0]?B:B.map(e=>e.style)).filter(e=>!nt.has(e)):We.map(e=>e.style),Ae={};if(ce&&(we||G)){const t=m(e,ce.start,ce.end,He);for(const e of ze){const n=t.has(e)||"highlight"===e&&t.has("accent");Ae[e]=!!Se?.add.includes(e)||!Se?.drop.includes(e)&&n}G&&(Ae.link=t.has("link"))}else if(ce)for(const t of ze)Ae[t]="link"===t?null!==b(e,ce.start,ce.end):g(e,ce.start,ce.end,t);const qe=()=>{const t=Le(),n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}},Ve={sup:"sub",sub:"sup"},Ge=t=>{if(G&&"link"!==t&&p(0,t)){const{start:n,end:l}=qe(),r=Ve[t];if(n===l){if(!we)return void Oe(n=>be(e,t,n,(e,t,n,l)=>i(e,t,n,l,He,J.placeholders)));const o=m(e,n,l,He),a=Se&&Se.at===n?Se:null,s=o.has(t),c=!!a?.add.includes(t)||!a?.drop.includes(t)&&s;let u=(a?.add??[]).filter(e=>e!==t),d=(a?.drop??[]).filter(e=>e!==t);return c&&s?d.push(t):c||s||u.push(t),!c&&r&&(u=u.filter(e=>e!==r),o.has(r)&&(d=[...d.filter(e=>e!==r),r])),void De(u.length||d.length||void 0!==a?.color?{add:u,drop:d,color:a?.color,at:n}:null)}return void Oe(()=>{let o=e,a=n,s=l;if(r&&!m(o,a,s,He).has(t)&&m(o,a,s,He).has(r)){const e=w(o,a,s,r,He);({text:o,selectionStart:a,selectionEnd:s}=e)}return w(o,a,s,t,He)})}if("clear"===t)return void Oe(n=>be(e,t,n,(e,t,n)=>i(e,t,n,"clear",He)));if("link"!==t&&we&&p(0,t)){const n=Le(),l=n?.selectionStart??e.length,r=n?.selectionEnd??l;if(l===r){const n=m(e,l,r,He),o=n.has(t)||"highlight"===t&&n.has("accent"),a=Se&&Se.at===l?Se:null,s=!!a?.add.includes(t)||!a?.drop.includes(t)&&o,i=(a?.add??[]).filter(e=>e!==t),c=(a?.drop??[]).filter(e=>e!==t);return s&&o?c.push(t):s||o||i.push(t),void De(i.length||c.length?{add:i,drop:c,at:l}:null)}return void Oe(n=>w(e,n?.selectionStart??l,n?.selectionEnd??r,t,He))}if("link"!==t){const n=O??((e,t,n,l)=>i(e,t,n,l,c,J.placeholders));return void Oe(l=>be(e,t,l,n))}const n=Le(),l=n?.selectionStart??e.length,r=n?.selectionEnd??l;Me(!1),Fe({start:l,end:r,link:b(e,l,r)})},Je=Boolean(ce&&ce.start!==ce.end),lt=ce?y(e,ce.start,ce.end,He):null,rt=ce?Se&&void 0!==Se.color&&Se.at===ce.start?Se.color:v(e,ce.start,ce.end,He):null,ot=rt?rt.startsWith("#")?rt:U?.find(e=>e.name===rt)?.value:void 0,it=t=>{we?t?Ce.current?.setSource(t.start,t.end,e):Ce.current?.focus():(Q.current?.focus(),t&&Q.current?.setSelectionRange(t.start,t.end))},ct=()=>{const e=Ke;Fe(null),it(e?{start:e.start,end:e.end}:ce)},ut=()=>{const e=dt.current,t=Boolean(e&&e.querySelector(".es-copy-colors")?.contains(e.ownerDocument.activeElement));Me(!1),t&&it(ce)},dt=ee(null),ht=Ne||null!==Ke;le(()=>{const e=dt.current;if(!ht||!e)return;const t=e.ownerDocument,n=()=>{Me(!1),Fe(null)},l=t=>{e.contains(t.target)||n()};let r;const o=l=>{const o=l.relatedTarget;o?e.contains(o)||n():(clearTimeout(r),r=setTimeout(()=>{const l=t.activeElement;t.hasFocus()&&l&&l!==t.body&&!e.contains(l)&&n()},0))};return t.addEventListener("pointerdown",l,!0),e.addEventListener("focusout",o),()=>{clearTimeout(r),t.removeEventListener("pointerdown",l,!0),e.removeEventListener("focusout",o)}},[ht]);const pt=Ke??(Ne?ce??{start:e.length,end:e.length}:null),ft=ee(()=>{});ft.current=()=>{const e=dt.current,t=e?.querySelector(".es-tb-wrap > .es-copy-pop");if(!e||!t||!pt)return;const n=we?null:e.querySelector(".es-gold-layer"),l=we?Ce.current?.rangeOf(pt.start,pt.end)??null:n?function(e,t,n){const l=e.ownerDocument,r=l.createTreeWalker(e,4),o=e=>{let t=e,n=null;for(let e=r.nextNode();e;e=r.nextNode()){if(t<=e.data.length)return[e,t];t-=e.data.length,n=e}return n?[n,n.data.length]:null},a=o(t);r.currentNode=e;const s=o(n);if(!a||!s)return null;const i=l.createRange();return i.setStart(a[0],a[1]),i.setEnd(s[0],s[1]),i}(n,pt.start,pt.end):null,r=l?.endContainer,o=r?1===r.nodeType?r:r.parentElement:null,a=l?function(e,t){const n=("function"==typeof e.getClientRects?[...e.getClientRects()]:[]).filter(e=>e.height>0);if(n.length>0){const t="function"==typeof e.getBoundingClientRect?e.getBoundingClientRect():n[0];return t.height>0?_e(t):_e(n[0])}if(!t)return null;const l=t.getBoundingClientRect();return{left:l.left,top:l.top,right:l.left,bottom:l.bottom}}(l,o?.closest(".es-rich-line, .es-gold-layer")??null):null;if(!a)return;const s=function({anchor:e,size:t,within:n,clip:l,parent:r,gap:o=8}){const a=Math.max(n.left,l.left),s=Math.min(n.right,l.right)-t.width,i=Qe(e.left,a,s),c=l.bottom-(e.bottom+o),u=e.top-o-l.top,d=t.height>c&&(t.height<=u||u>c),h=d?e.top-o-t.height:e.bottom+o,p=e.left+Math.min((e.right-e.left)/2,10),f=Qe(p-5-i,10,t.width-10-10);return{top:h-r.top,left:i-r.left,above:d,point:f}}({anchor:a,size:{width:t.offsetWidth,height:t.offsetHeight},within:e.getBoundingClientRect(),clip:et(e),parent:tt(t)});t.style.top=`${s.top}px`,t.style.left=`${s.left}px`,t.style.setProperty("--es-pop-point",`${s.point}px`),t.dataset.side=s.above?"above":"below"},ne(()=>{const e=dt.current;if(!ht||!e)return;const t=()=>ft.current();t();const n=e.ownerDocument.defaultView;n?.addEventListener("resize",t);const l=e.querySelector(".es-tb-wrap > .es-copy-pop"),r=n?.ResizeObserver,o=r&&l?new r(t):null;return o&&l&&o.observe(l),()=>{n?.removeEventListener("resize",t),o?.disconnect()}},[ht,Ne,Ke,pt?.start,pt?.end,we]);const mt=t=>Ke&&/* @__PURE__ */oe(Ye,{floating:t,href:Ke.link?.href??"",editing:null!==Ke.link,onApply:t=>{const n=Ke;Fe(null),Oe(()=>we?N(e,n.start,n.end,t,He):M(e,n.start,n.end,t))},onRemove:()=>{const t=Ke.link,n=Ke;Fe(null),t&&Oe(()=>we?S(e,n.start,n.end,He):D(e,t))},onClose:ct}),bt=P?he(P.allow,J.align):[],gt="always"===$||_||null!==Ke||Ne;/* @__PURE__ */
27
- return ae("div",{ref:dt,className:"es-copy"+(x?` ${x}`:""),onFocus:()=>ie(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||ie(!1)},onKeyDownCapture:e=>{Ne&&"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),ut())},onKeyDown:e=>{const t=e.target===Q.current||Boolean(e.target.closest?.(".es-rich"));if(T||!t)return;if(e.altKey||e.metaKey===e.ctrlKey)return;const n=e.key.toLowerCase(),l="KeyZ"===e.code||"z"===n,r=("KeyY"===e.code||"y"===n)&&!e.shiftKey;if(l||r)return e.preventDefault(),e.stopPropagation(),void Re(r||e.shiftKey?"redo":"undo");const o=`${e.shiftKey?"shift+":""}${n}`;if(G){const t={b:"bold",i:"italic",u:"underline",k:"link"}[o];if(!t||!ze.includes(t))return;return e.preventDefault(),e.stopPropagation(),void Ge(t)}const a=We.find(e=>e.shortcut===o);a&&(e.preventDefault(),e.stopPropagation(),Ge(a.style))},onPaste:t=>{const n=Q.current;if(T||!n||t.target!==n)return;t.preventDefault();const l=ke({html:t.clipboardData.getData("text/html"),text:t.clipboardData.getData("text/plain")},{doc:n.ownerDocument,multiline:u,rules:He});Oe(t=>ge(e,l,t))},style:U&&U.length>0?Object.fromEntries(U.map(e=>[`--es-color-${e.name}`,e.value])):void 0,onSelect:()=>{const t=Q.current;t&&t.ownerDocument.activeElement===t&&ue({start:t.selectionStart??e.length,end:t.selectionEnd??e.length})},children:[gt&&G?/* @__PURE__ */ae("div",{className:"es-tb-wrap"+(Y?"":" is-eight"),children:[
28
- /* @__PURE__ */oe(Xe,{words:J.toolbar??t.toolbar,align:J.align,alignmentLabel:J.alignment,ariaLabel:F??J.formatting,offered:new Set(ze),pressed:Ae,onMark:e=>Ge(e),color:U&&U.length>0?{run:ot,open:Ne,onToggle:()=>{Fe(null),Ne?ut():Me(!0)}}:void 0,linkOpen:null!==Ke,last:Y?Y({className:"es-tb-cell es-tb-btn",disabled:T,selected:Je,keepCaret:e=>e.preventDefault(),insert:t=>Oe(n=>ge(e,t,n))}):void 0,alignment:P?{value:P.value,allow:P.allow,onChange:P.onChange,disabled:P.disabled}:void 0,list:{pressed:lt,onList:t=>{const{start:n,end:l}=qe(),r=y(e,n,l,He);Oe(()=>E(e,n,l,r===t?null:t,He))}},letterCase:Z,disabled:T}),Ne&&U&&U.length>0?/* @__PURE__ */oe(Ze,{colors:U,current:rt,words:J.colors??t.colors,onPick:t=>{const{start:n,end:l}=qe();if(n!==l)Oe(()=>C(e,n,l,t,He));else{if(!we)return;De({add:Se?.add??[],drop:Se?.drop??[],color:t,at:n})}}}):null,Ke?mt(!0):null]}):null,G&&V&&V.length>0?/* @__PURE__ */oe(Ue,{cells:V,words:J.cells??t.cells,readOnly:T}):null,gt&&!G?/* @__PURE__ */oe(at,{tools:B,disabled:T,actions:R,glyphs:K,ariaLabel:F,pressed:Ae,open:Ke?"link":null,onApply:Ge,align:P?/* @__PURE__ */oe(r,{options:bt,value:P.value,onChange:P.onChange,ariaLabel:J.alignment,disabled:T||P.disabled,fit:fe(bt)}):null}):null,we?/* @__PURE__ */oe($e,{value:e,rules:He,multiline:u,readOnly:T,placeholder:d,ariaLabel:h,handle:Ce,pending:Se??void 0,onEdit:(t,n,l)=>{de.record({text:e,start:n.start,end:n.end},l,Date.now()),De(null),me(t)},onSelect:e=>{ue(t=>t&&t.start===e.start&&t.end===e.end?t:e),!Se||e.start===Se.at&&e.end===Se.at||De(null)},onHistory:Re,onFormat:e=>{ze.includes(e)&&Ge(e)},onCommit:l,onCancel:s}):/* @__PURE__ */oe(a,{value:e,onInput:e=>{de.record(ye(null),"type",Date.now()),me(e)},onCommit:l,onCancel:s,multiline:u,placeholder:d,ariaLabel:h,rules:j,disabled:T,inputRef:Q,className:"es-copy-box"}),Ke&&!G?mt(!1):null,H?H({focused:_,insert:t=>Oe(n=>ge(e,t,n))}):null,z&&u||G&&gt?
29
- /* @__PURE__ */ae("div",{className:"es-copy-marks",children:[z&&u?/* @__PURE__ */ae(se,{children:[
30
- /* @__PURE__ */oe(o,{checked:ve,onChange:()=>{const e=Le();Pe.current=e&&null!==e.selectionStart&&null!==e.selectionEnd?{start:e.selectionStart,end:e.selectionEnd}:ce,De(null),xe(e=>!e)},ariaLabelledBy:Ee,disabled:T}),
31
- /* @__PURE__ */oe("span",{id:Ee,className:"es-copy-marks-label",children:J.showMarks??"Show marks"})]}):null,G&&gt?/* @__PURE__ */ae("button",{type:"button",className:"es-copy-clear",disabled:T||!Je,title:Je?void 0:J.clearStyleEmpty??"Select words first",onMouseDown:e=>e.preventDefault(),onClick:()=>{const{start:t,end:n}=qe();if(t===n)return;const l=k(e,t,n,He);l.text!==e&&Oe(()=>l)},children:[
26
+ /* @__PURE__ */oe("span",{className:"es-copy-bar-split","aria-hidden":"true"}),r]}):null,o?/* @__PURE__ */oe("span",{className:"es-copy-bar-end",children:o}):null]}):null}function st({target:e,onChange:t}){const n=ee(null);return ne(()=>{const t=n.current,l=e.current;t&&l&&l.value===t.text&&(n.current=null,l.focus(),l.setSelectionRange(t.start,t.end))}),l=>{const r=l(e.current);t(r.text),n.current={start:r.selectionStart,end:r.selectionEnd,text:r.text}}}function it({value:e,onChange:n,onCommit:l,onCancel:o,multiline:i=!1,placeholder:c,ariaLabel:u,className:v,readOnly:T=!1,rules:j,tools:B=[],writeMark:O,actions:R,align:P,glyphs:K,barLabel:F,renderFooter:H,inputRef:W,barShows:$="always",richText:z=!0,defaultShowMarks:I=!1,toolbar:A="final",colors:U,cells:V,letterCase:Z,lastTool:Y}){const G="final"===A,J=L("copy",t),X=ee(null),Q=W??X,[_,ie]=te(!1),[ce,ue]=te(null),de=ee(Ie()).current,pe=ee(null);le(()=>{const t=pe.current;t&&e===t.to?pe.current=null:t&&e===t.from||(pe.current=null,de.reset())},[e,de]);const me=t=>{pe.current={from:pe.current?.from??e,to:t},n(t)},ye=t=>({text:e,start:t?.selectionStart??ce?.start??e.length,end:t?.selectionEnd??ce?.end??e.length}),[ve,xe]=te(I),we=z&&!(i&&ve),Ce=ee(null),Ee=re(),[Se,De]=te(null),[Ne,Me]=te(!1),Le=()=>{if(!we)return Q.current;const e=Ce.current?.getSource()??ce;return e?{selectionStart:e.start,selectionEnd:e.end}:null},Te=st({target:Q,onChange:me}),je=e=>(ue({start:e.selectionStart,end:e.selectionEnd}),e),Be=(t,n)=>{if(!we)return void Te(e=>(n&&de.record(ye(e),"edit",Date.now()),je(t(e))));const l=Le(),r=je(t(l));n&&de.record(ye(l),"edit",Date.now()),De(null),r.text!==e&&me(r.text),Ce.current?.setSource(r.selectionStart,r.selectionEnd,r.text)},Oe=e=>Be(e,!0),Re=e=>Be(t=>{const n=ye(t),l=de[e](n);return l?{text:l.text,selectionStart:l.start,selectionEnd:l.end}:{text:n.text,selectionStart:n.start,selectionEnd:n.end}},!1),Pe=ee(null);ne(()=>{const t=Pe.current;t&&(Pe.current=null,we?Ce.current?.setSource(t.start,t.end,e):(Q.current?.focus(),Q.current?.setSelectionRange(t.start,t.end),ue(t)))},[we]);const[Ke,Fe]=te(null),He=j??s,We=("string"==typeof B[0]?h(B):B).filter(e=>!nt.has(e.style)),ze=G?("string"==typeof B[0]?B:B.map(e=>e.style)).filter(e=>!nt.has(e)):We.map(e=>e.style),Ae={};if(ce&&(we||G)){const t=p(e,ce.start,ce.end,He);for(const e of ze){const n=t.has(e)||"highlight"===e&&t.has("accent");Ae[e]=!!Se?.add.includes(e)||!Se?.drop.includes(e)&&n}G&&(Ae.link=t.has("link"))}else if(ce)for(const t of ze)Ae[t]="link"===t?null!==f(e,ce.start,ce.end):m(e,ce.start,ce.end,t);const qe=()=>{const t=Le(),n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}},Ve={sup:"sub",sub:"sup"},Ge=t=>{if(G&&"link"!==t&&d(0,t)){const{start:n,end:l}=qe(),r=Ve[t];if(n===l){if(!we)return void Oe(n=>be(e,t,n,(e,t,n,l)=>a(e,t,n,l,He,J.placeholders)));const o=p(e,n,l,He),s=Se&&Se.at===n?Se:null,i=o.has(t),c=!!s?.add.includes(t)||!s?.drop.includes(t)&&i;let u=(s?.add??[]).filter(e=>e!==t),d=(s?.drop??[]).filter(e=>e!==t);return c&&i?d.push(t):c||i||u.push(t),!c&&r&&(u=u.filter(e=>e!==r),o.has(r)&&(d=[...d.filter(e=>e!==r),r])),void De(u.length||d.length||void 0!==s?.color?{add:u,drop:d,color:s?.color,at:n}:null)}return void Oe(()=>{let o=e,a=n,s=l;if(r&&!p(o,a,s,He).has(t)&&p(o,a,s,He).has(r)){const e=k(o,a,s,r,He);({text:o,selectionStart:a,selectionEnd:s}=e)}return k(o,a,s,t,He)})}if("clear"===t)return void Oe(n=>be(e,t,n,(e,t,n)=>a(e,t,n,"clear",He)));if("link"!==t&&we&&d(0,t)){const n=Le(),l=n?.selectionStart??e.length,r=n?.selectionEnd??l;if(l===r){const n=p(e,l,r,He),o=n.has(t)||"highlight"===t&&n.has("accent"),a=Se&&Se.at===l?Se:null,s=!!a?.add.includes(t)||!a?.drop.includes(t)&&o,i=(a?.add??[]).filter(e=>e!==t),c=(a?.drop??[]).filter(e=>e!==t);return s&&o?c.push(t):s||o||i.push(t),void De(i.length||c.length?{add:i,drop:c,at:l}:null)}return void Oe(n=>k(e,n?.selectionStart??l,n?.selectionEnd??r,t,He))}if("link"!==t){const n=O??((e,t,n,l)=>a(e,t,n,l,s,J.placeholders));return void Oe(l=>be(e,t,l,n))}const n=Le(),l=n?.selectionStart??e.length,r=n?.selectionEnd??l;Me(!1),Fe({start:l,end:r,link:f(e,l,r)})},Je=Boolean(ce&&ce.start!==ce.end),lt=ce?b(e,ce.start,ce.end,He):null,rt=ce?Se&&void 0!==Se.color&&Se.at===ce.start?Se.color:g(e,ce.start,ce.end,He):null,ot=rt?rt.startsWith("#")?rt:U?.find(e=>e.name===rt)?.value:void 0,it=t=>{we?t?Ce.current?.setSource(t.start,t.end,e):Ce.current?.focus():(Q.current?.focus(),t&&Q.current?.setSelectionRange(t.start,t.end))},ct=()=>{const e=Ke;Fe(null),it(e?{start:e.start,end:e.end}:ce)},ut=()=>{const e=dt.current,t=Boolean(e&&e.querySelector(".es-copy-colors")?.contains(e.ownerDocument.activeElement));Me(!1),t&&it(ce)},dt=ee(null),ht=Ne||null!==Ke;le(()=>{const e=dt.current;if(!ht||!e)return;const t=e.ownerDocument,n=()=>{Me(!1),Fe(null)},l=t=>{e.contains(t.target)||n()};let r;const o=l=>{const o=l.relatedTarget;o?e.contains(o)||n():(clearTimeout(r),r=setTimeout(()=>{const l=t.activeElement;t.hasFocus()&&l&&l!==t.body&&!e.contains(l)&&n()},0))};return t.addEventListener("pointerdown",l,!0),e.addEventListener("focusout",o),()=>{clearTimeout(r),t.removeEventListener("pointerdown",l,!0),e.removeEventListener("focusout",o)}},[ht]);const pt=Ke??(Ne?ce??{start:e.length,end:e.length}:null),ft=ee(()=>{});ft.current=()=>{const e=dt.current,t=e?.querySelector(".es-tb-wrap > .es-copy-pop");if(!e||!t||!pt)return;const n=we?null:e.querySelector(".es-gold-layer"),l=we?Ce.current?.rangeOf(pt.start,pt.end)??null:n?function(e,t,n){const l=e.ownerDocument,r=l.createTreeWalker(e,4),o=e=>{let t=e,n=null;for(let e=r.nextNode();e;e=r.nextNode()){if(t<=e.data.length)return[e,t];t-=e.data.length,n=e}return n?[n,n.data.length]:null},a=o(t);r.currentNode=e;const s=o(n);if(!a||!s)return null;const i=l.createRange();return i.setStart(a[0],a[1]),i.setEnd(s[0],s[1]),i}(n,pt.start,pt.end):null,r=l?.endContainer,o=r?1===r.nodeType?r:r.parentElement:null,a=l?function(e,t){const n=("function"==typeof e.getClientRects?[...e.getClientRects()]:[]).filter(e=>e.height>0);if(n.length>0){const t="function"==typeof e.getBoundingClientRect?e.getBoundingClientRect():n[0];return t.height>0?_e(t):_e(n[0])}if(!t)return null;const l=t.getBoundingClientRect();return{left:l.left,top:l.top,right:l.left,bottom:l.bottom}}(l,o?.closest(".es-rich-line, .es-gold-layer")??null):null;if(!a)return;const s=function({anchor:e,size:t,within:n,clip:l,parent:r,gap:o=8}){const a=Math.max(n.left,l.left),s=Math.min(n.right,l.right)-t.width,i=Qe(e.left,a,s),c=l.bottom-(e.bottom+o),u=e.top-o-l.top,d=t.height>c&&(t.height<=u||u>c),h=d?e.top-o-t.height:e.bottom+o,p=e.left+Math.min((e.right-e.left)/2,10),f=Qe(p-5-i,10,t.width-10-10);return{top:h-r.top,left:i-r.left,above:d,point:f}}({anchor:a,size:{width:t.offsetWidth,height:t.offsetHeight},within:e.getBoundingClientRect(),clip:et(e),parent:tt(t)});t.style.top=`${s.top}px`,t.style.left=`${s.left}px`,t.style.setProperty("--es-pop-point",`${s.point}px`),t.dataset.side=s.above?"above":"below"},ne(()=>{const e=dt.current;if(!ht||!e)return;const t=()=>ft.current();t();const n=e.ownerDocument.defaultView;n?.addEventListener("resize",t);const l=e.querySelector(".es-tb-wrap > .es-copy-pop"),r=n?.ResizeObserver,o=r&&l?new r(t):null;return o&&l&&o.observe(l),()=>{n?.removeEventListener("resize",t),o?.disconnect()}},[ht,Ne,Ke,pt?.start,pt?.end,we]);const mt=t=>Ke&&/* @__PURE__ */oe(Ye,{floating:t,href:Ke.link?.href??"",editing:null!==Ke.link,onApply:t=>{const n=Ke;Fe(null),Oe(()=>we?S(e,n.start,n.end,t,He):D(e,n.start,n.end,t))},onRemove:()=>{const t=Ke.link,n=Ke;Fe(null),t&&Oe(()=>we?C(e,n.start,n.end,He):E(e,t))},onClose:ct}),bt=P?he(P.allow,J.align):[],gt="always"===$||_||null!==Ke||Ne;/* @__PURE__ */
27
+ return ae("div",{ref:dt,className:"es-copy"+(v?` ${v}`:""),onFocus:()=>ie(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||ie(!1)},onKeyDownCapture:e=>{Ne&&"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),ut())},onKeyDown:e=>{const t=e.target===Q.current||Boolean(e.target.closest?.(".es-rich"));if(T||!t)return;if(e.altKey||e.metaKey===e.ctrlKey)return;const n=e.key.toLowerCase(),l="KeyZ"===e.code||"z"===n,r=("KeyY"===e.code||"y"===n)&&!e.shiftKey;if(l||r)return e.preventDefault(),e.stopPropagation(),void Re(r||e.shiftKey?"redo":"undo");const o=`${e.shiftKey?"shift+":""}${n}`;if(G){const t={b:"bold",i:"italic",u:"underline",k:"link"}[o];if(!t||!ze.includes(t))return;return e.preventDefault(),e.stopPropagation(),void Ge(t)}const a=We.find(e=>e.shortcut===o);a&&(e.preventDefault(),e.stopPropagation(),Ge(a.style))},onPaste:t=>{const n=Q.current;if(T||!n||t.target!==n)return;t.preventDefault();const l=ke({html:t.clipboardData.getData("text/html"),text:t.clipboardData.getData("text/plain")},{doc:n.ownerDocument,multiline:i,rules:He});Oe(t=>ge(e,l,t))},style:U&&U.length>0?Object.fromEntries(U.map(e=>[`--es-color-${e.name}`,e.value])):void 0,onSelect:()=>{const t=Q.current;t&&t.ownerDocument.activeElement===t&&ue({start:t.selectionStart??e.length,end:t.selectionEnd??e.length})},children:[gt&&G?/* @__PURE__ */ae("div",{className:"es-tb-wrap"+(Y?"":" is-eight"),children:[
28
+ /* @__PURE__ */oe(Xe,{words:J.toolbar??t.toolbar,align:J.align,alignmentLabel:J.alignment,ariaLabel:F??J.formatting,offered:new Set(ze),pressed:Ae,onMark:e=>Ge(e),color:U&&U.length>0?{run:ot,open:Ne,onToggle:()=>{Fe(null),Ne?ut():Me(!0)}}:void 0,linkOpen:null!==Ke,last:Y?Y({className:"es-tb-cell es-tb-btn",disabled:T,selected:Je,keepCaret:e=>e.preventDefault(),insert:t=>Oe(n=>ge(e,t,n))}):void 0,alignment:P?{value:P.value,allow:P.allow,onChange:P.onChange,disabled:P.disabled}:void 0,list:{pressed:lt,onList:t=>{const{start:n,end:l}=qe(),r=b(e,n,l,He);Oe(()=>w(e,n,l,r===t?null:t,He))}},letterCase:Z,disabled:T}),Ne&&U&&U.length>0?/* @__PURE__ */oe(Ze,{colors:U,current:rt,words:J.colors??t.colors,onPick:t=>{const{start:n,end:l}=qe();if(n!==l)Oe(()=>x(e,n,l,t,He));else{if(!we)return;De({add:Se?.add??[],drop:Se?.drop??[],color:t,at:n})}}}):null,Ke?mt(!0):null]}):null,G&&V&&V.length>0?/* @__PURE__ */oe(Ue,{cells:V,words:J.cells??t.cells,readOnly:T}):null,gt&&!G?/* @__PURE__ */oe(at,{tools:B,disabled:T,actions:R,glyphs:K,ariaLabel:F,pressed:Ae,open:Ke?"link":null,onApply:Ge,align:P?/* @__PURE__ */oe(N,{options:bt,value:P.value,onChange:P.onChange,ariaLabel:J.alignment,disabled:T||P.disabled,fit:fe(bt)}):null}):null,we?/* @__PURE__ */oe($e,{value:e,rules:He,multiline:i,readOnly:T,placeholder:c,ariaLabel:u,handle:Ce,pending:Se??void 0,onEdit:(t,n,l)=>{de.record({text:e,start:n.start,end:n.end},l,Date.now()),De(null),me(t)},onSelect:e=>{ue(t=>t&&t.start===e.start&&t.end===e.end?t:e),!Se||e.start===Se.at&&e.end===Se.at||De(null)},onHistory:Re,onFormat:e=>{ze.includes(e)&&Ge(e)},onCommit:l,onCancel:o}):/* @__PURE__ */oe(r,{value:e,onInput:e=>{de.record(ye(null),"type",Date.now()),me(e)},onCommit:l,onCancel:o,multiline:i,placeholder:c,ariaLabel:u,rules:j,disabled:T,inputRef:Q,className:"es-copy-box"}),Ke&&!G?mt(!1):null,H?H({focused:_,insert:t=>Oe(n=>ge(e,t,n))}):null,z&&i||G&&gt?
29
+ /* @__PURE__ */ae("div",{className:"es-copy-marks",children:[z&&i?/* @__PURE__ */ae(se,{children:[
30
+ /* @__PURE__ */oe(M,{checked:ve,onChange:()=>{const e=Le();Pe.current=e&&null!==e.selectionStart&&null!==e.selectionEnd?{start:e.selectionStart,end:e.selectionEnd}:ce,De(null),xe(e=>!e)},ariaLabelledBy:Ee,disabled:T}),
31
+ /* @__PURE__ */oe("span",{id:Ee,className:"es-copy-marks-label",children:J.showMarks??"Show marks"})]}):null,G&&gt?/* @__PURE__ */ae("button",{type:"button",className:"es-copy-clear",disabled:T||!Je,title:Je?void 0:J.clearStyleEmpty??"Select words first",onMouseDown:e=>e.preventDefault(),onClick:()=>{const{start:t,end:n}=qe();if(t===n)return;const l=y(e,t,n,He);l.text!==e&&Oe(()=>l)},children:[
32
32
  /* @__PURE__ */oe(q,{size:16}),J.clearStyle??"Clear style"]}):null]}):null]})}export{ie as COPY_ALIGNS,de as COPY_ALIGN_FIT,ue as COPY_ALIGN_GLYPHS,ce as COPY_ALIGN_LABELS,Ae as COPY_CELLS,Ze as ColorWindow,it as CopyBox,Ue as CopyCells,Pe as MARKUP_CLIPBOARD_TYPE,at as MarkBar,$e as RichBox,ze as TYPING_BURST_MS,Xe as TextToolbar,rt as ariaShortcut,he as copyAlignOptions,Ie as createHistory,je as editVisible,ge as insertSelection,be as markSelection,Re as markupOfRange,Be as newLine,ke as pasteToMarkup,Ce as richLayout,Le as selectionToSource,Me as selectionToVisible,Oe as setBullet,Se as toSource,De as toSourceStart,Ne as toVisible,st as useCaretEdit};
@@ -170,7 +170,17 @@ type AddTile = {
170
170
  * tooltip, in place of "Add …". Left out, a disabled tile has none. */
171
171
  disabledReason?: string;
172
172
  };
173
+ /**
174
+ * One headed group of tiles.
175
+ *
176
+ * `key` (0.106.0) is the group's identity among the others; left out, its
177
+ * `title` is. Two groups may carry one heading — a container's "Media" run
178
+ * and the catalogue's "Media" category, in one panel — so a host that draws
179
+ * both hands each its own key; and a heading that repeats with no key is told
180
+ * apart by how many with that key came before it (`groupKeys`).
181
+ */
173
182
  type AddGroup = {
183
+ key?: string;
174
184
  title: string;
175
185
  tiles: readonly AddTile[];
176
186
  };
@@ -1 +1 @@
1
- export{AddPanel,CanvasDragLayer,EMPTY_MEASURE,HANDLE_GRACE_MS,canvasTarget,contains,gapInZone,gapLine,measureCanvas,pickSource,seamsBetween}from"../chunk-TTJ54QGG.js";import"../chunk-O2NLQBFX.js";export{AUTO_SCROLL_EDGE,AUTO_SCROLL_MAX_SPEED,autoScrollDelta,autoScrollSpeed,createDragSession,dropEffectFor,dropOnRow,frameScrollBox,gapToMoveIndex,isNoOpDrop,scrollBoxOf,scrollParent,startAutoScroll,stepGap,useTreeDrag}from"../chunk-67GNT6PF.js";import"../chunk-PAELDYYS.js";import"../chunk-ZNCEOSXO.js";import"../chunk-L5KW4HG5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
1
+ export{AddPanel,CanvasDragLayer,EMPTY_MEASURE,HANDLE_GRACE_MS,canvasTarget,contains,gapInZone,gapLine,measureCanvas,pickSource,seamsBetween}from"../chunk-DX4XELD6.js";import"../chunk-O2NLQBFX.js";export{AUTO_SCROLL_EDGE,AUTO_SCROLL_MAX_SPEED,autoScrollDelta,autoScrollSpeed,createDragSession,dropEffectFor,dropOnRow,frameScrollBox,gapToMoveIndex,isNoOpDrop,scrollBoxOf,scrollParent,startAutoScroll,stepGap,useTreeDrag}from"../chunk-67GNT6PF.js";import"../chunk-PAELDYYS.js";import"../chunk-ZNCEOSXO.js";import"../chunk-L5KW4HG5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
@@ -450,7 +450,16 @@ declare function useSelectedFields(): SelectedFields;
450
450
  * so a binding made once follows `setPermissions`. A block's own
451
451
  * `permissions.edit` is that block's fields and is not asked. Handed only
452
452
  * `undo` / `redo` (no `getState`), there is nothing to ask and the keys work.
453
+ *
454
+ * ── Left to a field, when the binder says so (0.106.0) ──────────────────────
455
+ * `leaveTyping`: a press where a person TYPES — a text field, a textarea, an
456
+ * editable region (efficient-easel/canvas `isTypingTarget`) — is not taken:
457
+ * it is that field's own undo. The assembled screen binds its keys so, to its
458
+ * own root and to the canvas frame, inside another app's page (lib/key-scope);
459
+ * left out, a press in a field undoes the easel's step, as Puck's did.
453
460
  */
454
- declare function bindUndoKeys(doc: Document, easel: Pick<Easel, 'undo' | 'redo'> & Partial<Pick<Easel, 'getState'>>): () => void;
461
+ declare function bindUndoKeys(doc: Document, easel: Pick<Easel, 'undo' | 'redo'> & Partial<Pick<Easel, 'getState'>>, options?: {
462
+ leaveTyping?: boolean;
463
+ }): () => void;
455
464
 
456
465
  export { CanvasFrame, type CanvasFrameProps, type CanvasOverlay, type CanvasSlotProps, 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,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useSelectedFields,validSelection}from"../chunk-P67FP7PG.js";import"../chunk-AELNNAFM.js";import"../chunk-YRLPFZW3.js";import"../chunk-D2BCHTQR.js";import"../chunk-MFIRYGHW.js";import"../chunk-ZNCEOSXO.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
1
+ export{CanvasFrame,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useSelectedFields,validSelection}from"../chunk-6WH7FA2M.js";import"../chunk-D2BCHTQR.js";import"../chunk-AELNNAFM.js";import"../chunk-YRLPFZW3.js";import"../chunk-MFIRYGHW.js";import"../chunk-ZNCEOSXO.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-BXZ6WLHC.js";export{FieldSelect,FieldSlider,optionFor}from"../chunk-EOJNJCMJ.js";import"../chunk-ZFDCDJNZ.js";import"../chunk-ZNS7727Y.js";import"../chunk-3EDSDPIP.js";import"../chunk-QTLAVDJE.js";export{useResolvedFields}from"../chunk-YRLPFZW3.js";import"../chunk-KTVH2ZRL.js";export{FieldNumber,clampNumber,parseTyped,useNumberEntry}from"../chunk-EWVJSRRY.js";import"../chunk-P6O363EE.js";import"../chunk-FPOKPNO4.js";import"../chunk-MFIRYGHW.js";import"../chunk-BZ5ASXOL.js";import"../chunk-67GNT6PF.js";import"../chunk-L5KW4HG5.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-VCQVNPTG.js";export{FieldSelect,FieldSlider,optionFor}from"../chunk-EOJNJCMJ.js";import"../chunk-ZFDCDJNZ.js";import"../chunk-3EDSDPIP.js";export{useResolvedFields}from"../chunk-YRLPFZW3.js";import"../chunk-KTVH2ZRL.js";import"../chunk-ZNS7727Y.js";import"../chunk-QTLAVDJE.js";export{FieldNumber,clampNumber,parseTyped,useNumberEntry}from"../chunk-EWVJSRRY.js";import"../chunk-FPOKPNO4.js";import"../chunk-P6O363EE.js";import"../chunk-MFIRYGHW.js";import"../chunk-BZ5ASXOL.js";import"../chunk-67GNT6PF.js";import"../chunk-L5KW4HG5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
@@ -286,7 +286,17 @@ type ScreenDocumentValue = {
286
286
  * granted, or never released if it is not — card 1096.
287
287
  *
288
288
  * …or the document itself is FROZEN (`readOnlyReason`): nobody holds it, and
289
- * nobody may write it, ever. */
289
+ * nobody may write it, ever.
290
+ *
291
+ * …or a save was REFUSED (`saveConflict`, 0.106.0): the stored document moved
292
+ * on under somebody else's save, the autosave has stopped, and nothing this
293
+ * editor does is written again until the operator reloads. Until 0.106.0 the
294
+ * canvas, the tree and the inspector went on taking edits nothing would save,
295
+ * and Undo / Redo went on rewinding them; the old campaign designer locked
296
+ * the canvas there, and owner ruling R5 (Victor Mau, 2026-10-09) says the
297
+ * screen's Undo / Redo are DISABLED, not hidden, while this is true. The
298
+ * operator still reads, selects and copies from the screen the notice warns
299
+ * them about. */
290
300
  readOnly: boolean;
291
301
  /** Why the open document may never be written, as the backend said it
292
302
  * (`EaselDocument.readOnlyReason`: a campaign that has been sent), or null
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import"./chunk-OWBO4WKA.js";export{SPACING_SCALE,shellCssVars,shellTokens}from"./chunk-2UX75JDP.js";export{EaselRail,EaselRailButton,railCssVars,railTokens}from"./chunk-WZ7TGAAT.js";import"./chunk-2OAZYSWJ.js";import"./chunk-BZ5ASXOL.js";export{AddIcon,LayersIcon,MediaIcon,PageIcon as PagesIcon,SitemapIcon,StylesIcon}from"./chunk-L5KW4HG5.js";
1
+ export{SPACING_SCALE,shellCssVars,shellTokens}from"./chunk-2UX75JDP.js";import"./chunk-OWBO4WKA.js";export{EaselRail,EaselRailButton,railCssVars,railTokens}from"./chunk-WZ7TGAAT.js";import"./chunk-2OAZYSWJ.js";import"./chunk-BZ5ASXOL.js";export{AddIcon,LayersIcon,MediaIcon,PageIcon as PagesIcon,SitemapIcon,StylesIcon}from"./chunk-L5KW4HG5.js";
@@ -1 +1 @@
1
- export{AddBlockRow as default}from"../../chunk-QH6LCNOX.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-VSHV6KJQ.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-P67FP7PG.js";import"../../chunk-AELNNAFM.js";import"../../chunk-BXZ6WLHC.js";import"../../chunk-EOJNJCMJ.js";import"../../chunk-ZFDCDJNZ.js";import"../../chunk-ZNS7727Y.js";import"../../chunk-3EDSDPIP.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-KTVH2ZRL.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-EWVJSRRY.js";import"../../chunk-P6O363EE.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-BZ5ASXOL.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-L5KW4HG5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{AddBlockRow as default}from"../../chunk-I6T4TZ5Q.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-ND55LTCA.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WH7FA2M.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-AELNNAFM.js";import"../../chunk-VCQVNPTG.js";import"../../chunk-EOJNJCMJ.js";import"../../chunk-ZFDCDJNZ.js";import"../../chunk-3EDSDPIP.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-KTVH2ZRL.js";import"../../chunk-ZNS7727Y.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-EWVJSRRY.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-P6O363EE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-BZ5ASXOL.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-L5KW4HG5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{blockKey,AddSidePanel as default,sectionKey,templateKey}from"../../chunk-N7VRF7PR.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-5ZBBXZPV.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-VSHV6KJQ.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PQXIFBDY.js";import"../../chunk-P67FP7PG.js";import"../../chunk-AELNNAFM.js";import"../../chunk-BXZ6WLHC.js";import"../../chunk-EOJNJCMJ.js";import"../../chunk-ZFDCDJNZ.js";import"../../chunk-ZNS7727Y.js";import"../../chunk-3EDSDPIP.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-KTVH2ZRL.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-YC4TB3CJ.js";import"../../chunk-ZJEBF4NB.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-WZ7TGAAT.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-EWVJSRRY.js";import"../../chunk-P6O363EE.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-BZ5ASXOL.js";import"../../chunk-TTJ54QGG.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-L5KW4HG5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{blockKey,AddSidePanel as default,sectionKey,templateKey}from"../../chunk-MS4QRBJ6.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-5ZBBXZPV.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-ND55LTCA.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-E2O2MRZR.js";import"../../chunk-6WH7FA2M.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-AELNNAFM.js";import"../../chunk-VCQVNPTG.js";import"../../chunk-EOJNJCMJ.js";import"../../chunk-ZFDCDJNZ.js";import"../../chunk-3EDSDPIP.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-KTVH2ZRL.js";import"../../chunk-ZNS7727Y.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YC4TB3CJ.js";import"../../chunk-ZJEBF4NB.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-WZ7TGAAT.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-EWVJSRRY.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-P6O363EE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-BZ5ASXOL.js";import"../../chunk-DX4XELD6.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-L5KW4HG5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { MediaPanelComponent, MediaPickRequest } from '../lib/media-panel.js';
3
- import '../../host-BQ_b9Qzk.js';
3
+ import '../../host-CiuzZJXj.js';
4
4
  import '../../blocks/index.js';
5
5
  import '../../types-E3HrTPg2.js';
6
6
  import '../../data/index.js';
@@ -1 +1 @@
1
- export{MediaSidePanel as default}from"../../chunk-NYKIQJT2.js";import"../../chunk-VSHV6KJQ.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-P67FP7PG.js";import"../../chunk-AELNNAFM.js";import"../../chunk-BXZ6WLHC.js";import"../../chunk-EOJNJCMJ.js";import"../../chunk-ZFDCDJNZ.js";import"../../chunk-ZNS7727Y.js";import"../../chunk-3EDSDPIP.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-KTVH2ZRL.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-YC4TB3CJ.js";import"../../chunk-ZJEBF4NB.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-WZ7TGAAT.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-EWVJSRRY.js";import"../../chunk-P6O363EE.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-BZ5ASXOL.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-L5KW4HG5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{MediaSidePanel as default}from"../../chunk-JWMNPRTT.js";import"../../chunk-ND55LTCA.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WH7FA2M.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-AELNNAFM.js";import"../../chunk-VCQVNPTG.js";import"../../chunk-EOJNJCMJ.js";import"../../chunk-ZFDCDJNZ.js";import"../../chunk-3EDSDPIP.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-KTVH2ZRL.js";import"../../chunk-ZNS7727Y.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YC4TB3CJ.js";import"../../chunk-ZJEBF4NB.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-WZ7TGAAT.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-EWVJSRRY.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-P6O363EE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-BZ5ASXOL.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-L5KW4HG5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -28,7 +28,7 @@ import '../../words-DgHcY5qB.js';
28
28
  import './AddSidePanel.js';
29
29
  import '../lib/section-template-types.js';
30
30
  import '../lib/puck/content-tree.js';
31
- import '../../host-BQ_b9Qzk.js';
31
+ import '../../host-CiuzZJXj.js';
32
32
  import '../lib/document-contract.js';
33
33
  import '../lib/document-switch.js';
34
34
  import '../../engine-DBxp_v6B.js';
@@ -155,6 +155,24 @@ type NodeMenuHost = {
155
155
  openAddSection: () => void;
156
156
  /** Put the panel on the page's own settings. */
157
157
  openPageSettings: () => void;
158
+ /**
159
+ * What the page's menu calls that row (0.106.0): the screen's word for the
160
+ * document's own settings, `EaselStrings.screen.pageSettings` — the Layers
161
+ * tree's first row says it too (the campaign designer's "Email styles").
162
+ * Absent: "Page settings", as the row always said.
163
+ */
164
+ pageSettingsLabel?: string;
165
+ /**
166
+ * NOTHING MAY BE WRITTEN (0.106.0): the document is frozen, somebody else
167
+ * holds it, or a save was refused (`ScreenDocumentValue.readOnly`). The rows
168
+ * that write are withheld, not drawn dead: a node's menu keeps what writes
169
+ * nothing — Select layer, Copy, Copy style — and loses Add inside,
170
+ * Duplicate, Move up / down, Cut, Paste, Rename, Hide, Paste style and
171
+ * Delete; the page's menu loses Undo, Redo (the top bar holds them,
172
+ * disabled), Add section and Paste. The operations under them were refused
173
+ * already; until 0.106.0 their rows were offered all the same. Absent: false.
174
+ */
175
+ readOnly?: boolean;
158
176
  /** Fold every section in the Layers tree. */
159
177
  collapseAll: () => void;
160
178
  /** Say, in the editor's own voice, that the browser refused clipboard reading
@@ -1 +1 @@
1
- export{EASEL_NODE_CLIPBOARD,ancestorChain,nodeClipboardOf,nodeClipboardRules,nodeMenuItems,nodeShortcut,pageMenuItems,pastePlace,runNodeShortcut,textMenuItems,useNodeClipboard,useNodeContextMenu}from"../../chunk-7FBDZTUD.js";import"../../chunk-57DJOKXT.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-RW4XBUUW.js";import"../../chunk-KTVH2ZRL.js";import"../../chunk-2LK54I4E.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-L5KW4HG5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{EASEL_NODE_CLIPBOARD,ancestorChain,nodeClipboardOf,nodeClipboardRules,nodeMenuItems,nodeShortcut,pageMenuItems,pastePlace,runNodeShortcut,textMenuItems,useNodeClipboard,useNodeContextMenu}from"../../chunk-M7N2V4TG.js";import"../../chunk-57DJOKXT.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-2LK54I4E.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-RW4XBUUW.js";import"../../chunk-KTVH2ZRL.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-L5KW4HG5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{PageEditGuardNotices as default}from"../../chunk-V4LF7D4F.js";import"../../chunk-7V5WZ46F.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-3P6AMTOS.js";import"../../chunk-3WSPDAK2.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PQXIFBDY.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-YC4TB3CJ.js";import"../../chunk-ZJEBF4NB.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-WZ7TGAAT.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-BZ5ASXOL.js";import"../../chunk-L5KW4HG5.js";
1
+ export{PageEditGuardNotices as default}from"../../chunk-FS5BLARH.js";import"../../chunk-C6BJB5AC.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-3P6AMTOS.js";import"../../chunk-3WSPDAK2.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-E2O2MRZR.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-YC4TB3CJ.js";import"../../chunk-ZJEBF4NB.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-WZ7TGAAT.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-BZ5ASXOL.js";import"../../chunk-L5KW4HG5.js";
@@ -1 +1 @@
1
- export{ScreenChrome as default}from"../../chunk-HLEET6NV.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-SQTY6CJD.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-IE4GFYKO.js";import"../../chunk-PWZOS45R.js";import"../../chunk-7F52SZOI.js";import"../../chunk-R2HLPNQF.js";import"../../chunk-TBF5CVPA.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-VSOP4GUM.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-5MZ3RNQQ.js";import"../../chunk-ZTTWFAAC.js";import"../../chunk-FMGFZNPW.js";import"../../chunk-NWIW7AWH.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-7FBDZTUD.js";import"../../chunk-V4LF7D4F.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-7V5WZ46F.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-3P6AMTOS.js";import"../../chunk-3WSPDAK2.js";import"../../chunk-57DJOKXT.js";import"../../chunk-3QVB4AG2.js";import"../../chunk-N7VRF7PR.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-5ZBBXZPV.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-NYKIQJT2.js";import"../../chunk-VSHV6KJQ.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-PQXIFBDY.js";import"../../chunk-P67FP7PG.js";import"../../chunk-AELNNAFM.js";import"../../chunk-BXZ6WLHC.js";import"../../chunk-EOJNJCMJ.js";import"../../chunk-ZFDCDJNZ.js";import"../../chunk-ZNS7727Y.js";import"../../chunk-3EDSDPIP.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-RW4XBUUW.js";import"../../chunk-KTVH2ZRL.js";import"../../chunk-2LK54I4E.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-OWBO4WKA.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-YC4TB3CJ.js";import"../../chunk-ZJEBF4NB.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-WZ7TGAAT.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-EWVJSRRY.js";import"../../chunk-P6O363EE.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-BZ5ASXOL.js";import"../../chunk-TTJ54QGG.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-L5KW4HG5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{ScreenChrome as default}from"../../chunk-37OCQYNX.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-SQTY6CJD.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-PWZOS45R.js";import"../../chunk-7F52SZOI.js";import"../../chunk-R2HLPNQF.js";import"../../chunk-TBF5CVPA.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-MHKBLPQ2.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-5MZ3RNQQ.js";import"../../chunk-WTMHT7BI.js";import"../../chunk-LY4K2ECT.js";import"../../chunk-PBSEUZD6.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-M7N2V4TG.js";import"../../chunk-FS5BLARH.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-C6BJB5AC.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-3P6AMTOS.js";import"../../chunk-3WSPDAK2.js";import"../../chunk-57DJOKXT.js";import"../../chunk-3QVB4AG2.js";import"../../chunk-MS4QRBJ6.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-5ZBBXZPV.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-JWMNPRTT.js";import"../../chunk-ND55LTCA.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-2LK54I4E.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-E2O2MRZR.js";import"../../chunk-6WH7FA2M.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-AELNNAFM.js";import"../../chunk-VCQVNPTG.js";import"../../chunk-EOJNJCMJ.js";import"../../chunk-ZFDCDJNZ.js";import"../../chunk-3EDSDPIP.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-RW4XBUUW.js";import"../../chunk-KTVH2ZRL.js";import"../../chunk-ZNS7727Y.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-OWBO4WKA.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-YC4TB3CJ.js";import"../../chunk-ZJEBF4NB.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-WZ7TGAAT.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-EWVJSRRY.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-P6O363EE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-BZ5ASXOL.js";import"../../chunk-DX4XELD6.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-L5KW4HG5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1,6 +1,6 @@
1
1
  import 'react';
2
2
  import '../../blocks/index.js';
3
- export { k as AnyScreenTarget, l as DocumentTarget, m as ScreenDocumentContext, n as ScreenDocumentProvider, o as ScreenDocumentValue, p as ScreenTarget, q as useScreenDocument } from '../../host-BQ_b9Qzk.js';
3
+ export { k as AnyScreenTarget, l as DocumentTarget, m as ScreenDocumentContext, n as ScreenDocumentProvider, o as ScreenDocumentValue, p as ScreenTarget, q as useScreenDocument } from '../../host-CiuzZJXj.js';
4
4
  import '../lib/document-contract.js';
5
5
  export { SaveStatus } from '../lib/document-switch.js';
6
6
  import '../lib/admin-bridge.js';
@@ -1 +1 @@
1
- export{ScreenDocumentContext,ScreenDocumentProvider,useScreenDocument}from"../../chunk-7V5WZ46F.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-3P6AMTOS.js";import"../../chunk-3WSPDAK2.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PQXIFBDY.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MFIRYGHW.js";
1
+ export{ScreenDocumentContext,ScreenDocumentProvider,useScreenDocument}from"../../chunk-C6BJB5AC.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-3P6AMTOS.js";import"../../chunk-3WSPDAK2.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-E2O2MRZR.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MFIRYGHW.js";
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { k as AnyScreenTarget, A as AnyDocumentAddressing } from '../../host-BQ_b9Qzk.js';
3
+ import { k as AnyScreenTarget, A as AnyDocumentAddressing } from '../../host-CiuzZJXj.js';
4
4
  import { ScreenParts } from '../lib/screen-parts.js';
5
5
  import '../../blocks/index.js';
6
6
  import '../../types-E3HrTPg2.js';