efficient-easel 23.2.0 → 24.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/{ScreenDocumentContext-BDLUYzlM.d.ts → ScreenDocumentContext-DPW_6gOC.d.ts} +16 -1
  2. package/dist/{chunk-4RRIYPAV.js → chunk-2AV62DEP.js} +1 -1
  3. package/dist/{chunk-UNVKPVZW.js → chunk-3FIS2FRS.js} +1 -1
  4. package/dist/chunk-4RJBW7VC.js +8 -0
  5. package/dist/chunk-5NHQ452C.js +1 -0
  6. package/dist/{chunk-33P4J2SF.js → chunk-7BW74Y55.js} +1 -1
  7. package/dist/{chunk-VNDPFDO5.js → chunk-CMMR6CJS.js} +1 -1
  8. package/dist/chunk-CZAAGBVL.js +7 -0
  9. package/dist/{chunk-RMQDKVGW.js → chunk-D5GQEUKM.js} +1 -1
  10. package/dist/{chunk-CMBJHSHY.js → chunk-FRAIEWRC.js} +1 -1
  11. package/dist/chunk-G7ISR6DI.js +1 -0
  12. package/dist/{chunk-6QSFJCJT.js → chunk-H4Z2V56N.js} +16 -16
  13. package/dist/{chunk-ZOPYJQFS.js → chunk-HHQZB6IE.js} +41 -41
  14. package/dist/{chunk-77IWWW6X.js → chunk-ISS72IKO.js} +1 -1
  15. package/dist/chunk-K7MMLCTT.js +2 -0
  16. package/dist/chunk-LX23TCTP.js +2 -0
  17. package/dist/{chunk-FHCKFOCD.js → chunk-NCXYC7WI.js} +2 -2
  18. package/dist/{chunk-BIK3AO2V.js → chunk-NQW6XCAY.js} +1 -1
  19. package/dist/{chunk-MYAJ7MGI.js → chunk-PDJ5ZALV.js} +1 -1
  20. package/dist/{chunk-2G6MAXPY.js → chunk-T2RINM7R.js} +1 -1
  21. package/dist/chunk-TOHOGVAE.js +15 -0
  22. package/dist/{chunk-FEF3OQRT.js → chunk-VBOSOH5M.js} +5 -5
  23. package/dist/chunk-Z5BPY2VG.js +5 -0
  24. package/dist/chunk-ZYHKXEND.js +7 -0
  25. package/dist/copy/index.js +10 -10
  26. package/dist/draw/index.js +1 -1
  27. package/dist/easel/index.js +1 -1
  28. package/dist/fields/index.js +1 -1
  29. package/dist/panel/index.js +1 -15
  30. package/dist/panel/panel.css +8 -0
  31. package/dist/screen/components/AddBlockRow.js +1 -1
  32. package/dist/screen/components/AddSidePanel.js +1 -1
  33. package/dist/screen/components/MediaPopup.js +1 -1
  34. package/dist/screen/components/NodeContextMenu.d.ts +1 -1
  35. package/dist/screen/components/NodeContextMenu.js +1 -1
  36. package/dist/screen/components/PageEditGuardNotices.js +1 -1
  37. package/dist/screen/components/SaveControls.d.ts +1 -1
  38. package/dist/screen/components/ScreenChrome.js +1 -1
  39. package/dist/screen/components/ScreenDocumentContext.d.ts +1 -1
  40. package/dist/screen/components/ScreenDocumentContext.js +1 -1
  41. package/dist/screen/components/ScreenMount.d.ts +1 -1
  42. package/dist/screen/components/ScreenMount.js +1 -1
  43. package/dist/screen/components/ScreenStoreProvider.d.ts +1 -1
  44. package/dist/screen/components/ScreenStoreProvider.js +1 -1
  45. package/dist/screen/components/SectionScreenShell.js +17 -17
  46. package/dist/screen/components/usePartBridge.d.ts +1 -1
  47. package/dist/screen/components/usePartBridge.js +1 -1
  48. package/dist/screen/index.d.ts +1 -1
  49. package/dist/screen/index.js +1 -1
  50. package/dist/screen/lib/admin-bridge.js +1 -1
  51. package/dist/screen/lib/document/box-fields.d.ts +389 -0
  52. package/dist/screen/lib/document/box-fields.js +9 -0
  53. package/dist/screen/lib/document/slot-child-name.js +1 -1
  54. package/dist/screen/lib/document/style-clipboard.d.ts +1 -1
  55. package/dist/screen/lib/document/style-clipboard.js +1 -1
  56. package/dist/screen/lib/document/use-section-ops.js +1 -1
  57. package/dist/screen/lib/document-addressing.d.ts +1 -1
  58. package/dist/screen/lib/host-inbound.js +1 -1
  59. package/dist/screen/lib/host.d.ts +1 -1
  60. package/dist/screen/lib/host.js +1 -1
  61. package/dist/screen/lib/key-scope.js +1 -1
  62. package/dist/screen/lib/media-panel.d.ts +1 -1
  63. package/dist/screen/lib/media-panel.js +1 -1
  64. package/dist/screen/lib/media-picker.d.ts +1 -1
  65. package/dist/screen/lib/media-picker.js +1 -1
  66. package/dist/screen/lib/screen-parts.d.ts +1 -1
  67. package/dist/screen/lib/screen-parts.js +1 -1
  68. package/dist/screen/screen.css +32 -0
  69. package/dist/strings/index.js +1 -1
  70. package/dist/text-styles/index.js +21 -21
  71. package/package.json +9 -3
  72. package/dist/chunk-A6ZP5II4.js +0 -2
  73. package/dist/chunk-C57RLYDQ.js +0 -8
  74. package/dist/chunk-DCBSRZ6Z.js +0 -5
  75. package/dist/chunk-J5OSNZPU.js +0 -1
  76. package/dist/chunk-MQA7OFRA.js +0 -2
  77. package/dist/chunk-QWLWSIDH.js +0 -7
  78. package/dist/chunk-S3DUFDQ6.js +0 -6
  79. package/dist/chunk-SSRYU3YG.js +0 -1
@@ -1,4 +1,4 @@
1
- import{toItemSelector as e,fromItemSelector as t,useNodeOps as n,parentStep as o,clickPickPart as r,clickPick as i}from"./chunk-RPMSET77.js";import{DEFAULT_CANVAS_WORDS as l}from"./chunk-TBY3DFKS.js";import{useResolvedFields as s}from"./chunk-AGWKB77Q.js";import{selectionBox as a,placeWindow as c,offsetOrigin as d,colorRunOf as u,ColorWindow as p,startCanvasTyping as f,textMap as h}from"./chunk-HZSZT3BE.js";import{DEFAULT_COPY_WORDS as m}from"./chunk-KRL3IUV3.js";import{useWords as g}from"./chunk-MFIRYGHW.js";import{setCanvasNonce as v,CANVAS_TYPABLE_EVENT as y,related as w,isTypingTarget as b,upsertCanvasStyle as k,removeCanvasStyle as S,WORDS_CLEAR as C,frameRectToHost as I,CANVAS_TYPING_EVENT as D,drawnBox as E}from"./chunk-YU3WHLGI.js";import{queryAllCopies as x}from"./chunk-LF3FUSCQ.js";import{find as O,ROOT_ID as M,getList as A,remove as R,parseZoneKey as z,move as P,duplicate as $,replaceNode as V,createNode as L,insert as j,normalizeData as N,createResolveCache as B,slotsOf as K,resolveNodeData as Z,ROOT_SLOT as F}from"./chunk-TGZCD6IP.js";import{topLevelSlotKeys as T,fieldsFrom as H,drawnBlockCount as W,defaultsFrom as Y}from"./chunk-KXM6YRG2.js";import{createContext as U,useEffect as q,useContext as G,useRef as Q,useSyncExternalStore as X,useState as J,useReducer as _,useMemo as ee,useCallback as te,useLayoutEffect as ne}from"react";import{jsx as oe,jsxs as re,Fragment as ie}from"react/jsx-runtime";import{createPortal as le}from"react-dom";import{registerModalEscapeInterceptor as se,FloatingBar as ae,TextToolbar as ce,LinkPicker as de}from"efficient-shell/ui";function ue(e){return!["setData","setUi","set"].includes(e.type)}var pe=(e,t,n,o)=>{const r=A(e,t,z(n));return r?.[o]??null},fe=(e,t,n,o,r)=>{const i=pe(e,t,n,o);if(!i)throw new Error(`${r}: nothing at ${n}[${o}]`);return i};function he(t,n){const{selection:o}=t;return{...t.ui,itemSelector:e(t.data,n,o),selectedSlot:o&&"slot"===o.kind?{parentId:o.parentId,slot:o.slot}:null}}function me(e,t,n){return n?"node"===n.kind?O(e,t,n.id)?n:null:n.parentId===M?A(e,t,n)?n:null:O(e,t,n.parentId)&&A(e,t,n)?n:null:null}function ge(e,n,o,r=!1){const{itemSelector:i,selectedSlot:l,...s}=o;let a=e.selection;var c;return"itemSelector"in o&&(a=t(e.data,n,i??null)),"selectedSlot"in o&&(l?a=(c=l)?{kind:"slot",parentId:c.parentId,slot:c.slot}:null:"slot"===a?.kind&&(a=null)),{...e,selection:a,ui:r?s:{...e.ui,...s}}}function ve(e,t,n){const o=ye(e,t,n);if(o===e)return e;const r=me(o.data,n,o.selection);return r===o.selection?o:{...o,selection:r}}function ye(e,t,n){const{data:o}=e;switch(t.type){case"setData":{const n="function"==typeof t.data?t.data(o):t.data;return{...e,data:{...o,...n}}}case"setUi":return ge(e,n,"function"==typeof t.ui?t.ui(he(e,n)):t.ui);case"set":{const r={data:o,ui:he(e,n)},i="function"==typeof t.state?t.state(r):t.state;let l=i.data?{...e,data:i.data}:e;return i.ui&&(l=ge(l,n,i.ui,!0)),l}case"insert":{const r={...z(t.destinationZone),index:t.destinationIndex},i=L(n,t.componentType,{},t.id?{id:t.id}:{});return{...e,data:j(o,n,r,i)}}case"replace":{const r=fe(o,n,t.destinationZone,t.destinationIndex,"replace");if(r.props.id!==t.data.props.id)throw new Error("Can't change the id during a replace action. Use remove and insert for a new node.");return{...e,data:V(o,n,r.props.id,t.data)}}case"replaceRoot":{const n={...o.root,props:{...o.root.props,...t.root.props},readOnly:t.root.readOnly};return{...e,data:{...o,root:n}}}case"duplicate":{const r=fe(o,n,t.sourceZone,t.sourceIndex,"duplicate"),i=$(o,n,r.props.id),l=pe(i,n,t.sourceZone,t.sourceIndex+1);return{...e,data:i,selection:l?{kind:"node",id:l.props.id}:e.selection}}case"reorder":return ye(e,{...t,type:"move",sourceZone:t.destinationZone},n);case"move":{if(t.sourceZone===t.destinationZone&&t.sourceIndex===t.destinationIndex)return e;const r=pe(o,n,t.sourceZone,t.sourceIndex);if(!r)return e;const i={...z(t.destinationZone),index:t.destinationIndex};return{...e,data:P(o,n,r.props.id,i)}}case"remove":{const r=fe(o,n,t.zone,t.index,"remove");return{...e,data:R(o,n,r.props.id)}}default:return e}}var we={drag:!0,duplicate:!0,delete:!0,edit:!0,insert:!0},be={leftSideBarVisible:!0,rightSideBarVisible:!0,arrayState:{},componentList:{},isDragging:!1,previewMode:"edit",viewports:{current:{width:360,height:"auto"},options:[],controlsVisible:!0},field:{focus:null}},ke=0,Se=()=>`history-${ke+=1}`;function Ce(n){let o=n.config;const r=n.now??(()=>Date.now()),i=n.historyCoalesceMs??250;let l=n.permissions??{};const s=N(n.data,o);let a=s,c={data:s,selection:null,ui:{...be}};if(n.ui){const{itemSelector:e,selectedSlot:r,...i}=n.ui;c={data:s,selection:r?{kind:"slot",...r}:t(s,o,e??null),ui:{...be,...i}}}let d=[{core:c,at:-1/0,sealed:!0,id:Se()}],u=0;const p=e=>{const t=d[u],n=r();!e&&u===d.length-1&&u>0&&!t.sealed&&n-t.at<i?d=[...d.slice(0,u),{...t,core:c,at:n}]:(d=[...d.slice(0,u+1),{core:c,at:n,sealed:e,id:Se()}],u=d.length-1)},f=/* @__PURE__ */new Set;let h=null,m=null,g=0,v=null,y=!1;const w=()=>{for(const e of[...f])e()},b=()=>{d=[...d.slice(0,u),{...d[u],core:c},...d.slice(u+1)]},k=(e,t)=>{g>0?y=y||t:(t?p(!1):c!==e&&b(),c.data!==e.data&&n.onChange?.(c.data),c!==e&&w())},S=e=>{const t=c;if(c=ve(c,e,o),c===t)return;const n=e.recordHistory??ue(e);k(t,n&&c.data!==t.data)},C=e=>{0===g&&(v=c,y=!1),g+=1;try{e()}catch(e){throw g-=1,0===g&&v&&(c=v,v=null),e}if(g-=1,g>0||!v)return;const t=v;v=null,y&&c.data!==t.data?p(!0):c!==t&&b(),c.data!==t.data&&n.onChange?.(c.data),c!==t&&w()},I=e=>{const t=c,n=me(c.data,o,e);var r,i;(r=n,i=c.selection,r===i||r&&i&&r.kind===i.kind&&("node"===r.kind&&"node"===i.kind?r.id===i.id:"slot"===r.kind&&"slot"===i.kind&&r.parentId===i.parentId&&r.slot===i.slot))||(c={...c,selection:n},k(t,!1))},D=e=>{const t=c;u=e,c=d[u].core,c.data!==t.data&&n.onChange?.(c.data),c!==t&&w()},E=()=>(e={})=>{const t=e.root?o.root?.permissions:o.components[e.item?.type??e.type??""]?.permissions;return{...we,...l,...t}};let x=E();const M=B(),R={resolveCache:M,async resolveAll({trigger:e="load",metadata:t}={}){const n=c.data,r={type:"root",props:{...n.root.props??{}}},i=[...n.content,...Object.values(n.zones??{}).flat()],[l,...s]=await Promise.all([Z(r,o,{cache:M,trigger:e,metadata:t}),...i.map(n=>Z(n,o,{cache:M,trigger:e,metadata:t}))]);C(()=>{const t=c;let r=c.data;s.forEach((e,t)=>{if(!e.didChange)return;const l=i[t].props.id,s=O(r,o,l)?.node;s&&s===O(n,o,l)?.node&&(r=V(r,o,l,e.node))}),l.didChange&&r.root===n.root&&(r={...r,root:{...r.root,props:l.node.props,readOnly:l.node.readOnly??r.root.readOnly}}),r!==c.data&&("load"===e&&c.data===a&&(a=r),c={...c,data:r,selection:me(r,o,c.selection)},k(t,!1))})},async resolveNode(e,{trigger:t="replace",metadata:n}={}){const r=O(c.data,o,e)?.node;if(!r)return!1;const i=await Z(r,o,{cache:M,trigger:t,metadata:n});if(!i.didChange)return!1;let l=!1;return C(()=>{const t=c;if(O(c.data,o,e)?.node!==r)return;const n=V(c.data,o,e,i.node);n!==c.data&&(c={...c,data:n,selection:me(n,o,c.selection)},k(t,!1),l=!0)}),l},get config(){return o},get loaded(){return a},getState(){if(h&&m===c)return h;const t=c,n={data:t.data,ui:he(t,o)},r="node"===t.selection?.kind?O(t.data,o,t.selection.id)?.node??null:null;return h={appState:n,selection:t.selection,selectedItem:r,config:o,dispatch:S,history:{back:()=>R.undo(),forward:()=>R.redo(),hasPast:u>0,hasFuture:u<d.length-1,histories:d.map(e=>({id:e.id,state:{data:e.core.data,ui:he(e.core,o)}})),index:u,setHistoryIndex:e=>{e>=0&&e<d.length&&e!==u&&D(e)}},getPermissions:x,getItemById:e=>O(t.data,o,e)?.node,getItemBySelector:e=>function(e,t,n){const[o,r]=(n.zone??"root:default-zone").split(/:(.*)/s);return A(e,t,{parentId:o,slot:r})?.[n.index]}(t.data,o,e),getSelectorForId:n=>{const r=e(t.data,o,{kind:"node",id:n});return r?{index:r.index,zone:r.zone??"root:default-zone"}:void 0}},m=t,h},subscribe:e=>(f.add(e),()=>{f.delete(e)}),dispatch:S,batch:C,group:()=>{const e=u,t=d[e].id;let n=!0;return{close:()=>{if(!n)return;if(n=!1,d[e]?.id!==t)return;if(u<=e+1)return void(u===e+1&&(d=[...d.slice(0,u),{...d[u],sealed:!0},...d.slice(u+1)]));const o=d[u];d=[...d.slice(0,e+1),{...o,sealed:!0},...d.slice(u+1)],u=e+1}}},select:e=>I(e?{kind:"node",id:e}:null),selectSlot:e=>I(e?{kind:"slot",parentId:e.parentId,slot:e.slot}:null),run(e){C(()=>{const t=c,n=void 0===e.select?c.selection:e.select;c={...c,data:e.data,selection:me(e.data,o,n)},k(t,e.data!==t.data)})},load(e,t={}){const n=c,r=N(e,o);c={...c,data:r,selection:me(r,o,t.selection??c.selection)},a=r,t.keepHistory||(d=[{core:c,at:-1/0,sealed:!0,id:Se()}],u=0),c!==n&&w()},undo(){u>0&&D(u-1)},redo(){u<d.length-1&&D(u+1)},setPermissions(e){(function(e,t){if(e===t)return!0;const n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>e[n]===t[n])})(e,l)||(l=e,x=E(),h=null,w())},setConfig(e){e!==o&&(o=e,x=E(),h=null,w())}};return R}function Ie(e,t,n={}){const o=e=>{if(e.altKey)return;if(!(e.metaKey!==e.ctrlKey))return;const o="KeyZ"===e.code,r="KeyY"===e.code&&!e.shiftKey;(o||r)&&(n.leaveTyping&&b(e.target)||!1!==t.getState?.().getPermissions().edit&&(e.preventDefault(),r||e.shiftKey?t.redo():t.undo()))};return e.addEventListener("keydown",o),()=>e.removeEventListener("keydown",o)}var De=U(null),Ee=U(!0);function xe({easel:e,hotkeys:t=!0,resolveOnMount:n=!0,children:o}){return q(()=>{n&&e.resolveAll()},[e,n]),q(()=>{if(t&&"undefined"!=typeof document)return Ie(document,e)},[e,t]),/* @__PURE__ */oe(De.Provider,{value:e,children:/* @__PURE__ */oe(Ee.Provider,{value:t,children:o})})}function Oe(){const e=G(De);if(!e)throw new Error("useEasel: no <EaselProvider> above this component");return e}function Me(e){const t=Oe(),n=Q({view:null,selector:null,value:void 0,has:!1}),o=()=>{const o=t.getState(),r=n.current;if(r.has&&r.view===o&&r.selector===e)return r.value;const i=e(o);return r.has&&Object.is(r.value,i)?(n.current={view:o,selector:e,value:r.value,has:!0},r.value):(n.current={view:o,selector:e,value:i,has:!0},i)};return X(t.subscribe,o,o)}function Ae(){return function(e){return Me(e)}}var Re=["--es-accent","--es-accent-tint","--es-accent-tint-strong","--es-accent-line","--es-accent-text","--es-accent-ring","--es-accent-shadow","--es-on-accent","--status-success-solid","--elevation-panel"],ze="host-tokens";function Pe(e,t){const n=function(e){const t=e.ownerDocument.defaultView;if(!t)return"";const n=t.getComputedStyle(e),o=[];for(const e of Re){const t=n.getPropertyValue(e).trim();t&&o.push(`${e}: ${t};`)}return o.length?`:root { ${o.join(" ")} }`:""}(e);n?k(t,ze,n):S(t,ze)}var $e="data-easel-block",Ve="data-easel-dropzone",Le={},je="data-es-mirror",Ne="undefined"==typeof window?q:ne;function Be(e,t,n){for(const e of Array.from(t.head.querySelectorAll(`[${je}]`)))e.remove();for(const o of Array.from(e.head.querySelectorAll('style, link[rel="stylesheet"]'))){const e=o.cloneNode(!0);e.setAttribute(je,""),n&&e.setAttribute("nonce",n),t.head.appendChild(e)}}function Ke({children:e,id:t="preview-frame",title:n,className:o,style:r,mirrorStyles:i=!0,onDocument:s,height:a="auto",nonce:c}){const d=g("canvas",l),u=Q(null),[p,f]=J(null);return Ne(()=>{const e=u.current,t=p?.ownerDocument.defaultView;if("auto"!==a||!e||!p||!t)return;const n=()=>{e.style.height=`${Math.ceil(p.getBoundingClientRect().height)}px`};n();const o=t.ResizeObserver,r=o?new o(n):null;return r?.observe(p),()=>r?.disconnect()},[p,a]),Ne(()=>{let e=u.current?.contentDocument;if(!e)return;"CSS1Compat"!==e.compatMode&&(e.open(),e.write("<!DOCTYPE html><html><head></head><body></body></html>"),e.close(),e=u.current?.contentDocument??e),e.body||e.documentElement.appendChild(e.createElement("body")),e.body.style.margin="0";const t=e.createElement("div");t.setAttribute("data-easel-entry",""),t.id="frame-root","fill"===a&&t.classList.add("es-frame-fill"),e.body.appendChild(t),v(e,c),f(t),s?.(e);let n=null;const o=u.current?.ownerDocument;if(i&&o){Be(o,e,c);const t=o.defaultView;t&&"MutationObserver"in t&&(n=new t.MutationObserver(()=>Be(o,e,c)),n.observe(o.head,{childList:!0,subtree:!0,characterData:!0}))}let r=null;const l=u.current;if(l&&o){Pe(l,e);const t=o.defaultView;if(t&&"MutationObserver"in t){r=new t.MutationObserver(()=>Pe(l,e)),r.observe(o.head,{childList:!0,subtree:!0,characterData:!0});const n={attributes:!0,attributeFilter:["class","style","data-theme"]};for(const e of[o.documentElement,o.body,l.closest(".es-editor")])e&&r.observe(e,n)}}return()=>{n?.disconnect(),r?.disconnect(),t.remove(),f(null),s?.(null)}},[]),/* @__PURE__ */oe("iframe",{ref:u,id:t,title:n??d.frame,className:["es-canvas-frame","fill"===a?"is-fill":"",o??""].filter(Boolean).join(" "),style:r,children:p?le(e,p):null})}var Ze=U(null),Fe=U(Le),Te=[];function He({parentId:e,slot:t,className:n,style:o,minEmptyHeight:r=128,minEmptyWidth:i=120}){const l=Oe(),s=Me(n=>A(n.appState.data,l.config,{parentId:e,slot:t})??Te),a=Me(t=>"node"===t.selection?.kind&&t.selection.id===e&&e!==M),c=Me(n=>"slot"===n.selection?.kind&&n.selection.parentId===e&&n.selection.slot===t),d=G(Ze),u=["es-zone"];return s.length&&u.push("has-children"),e===M&&u.push("is-root"),(a||c)&&u.push("is-area-selected"),null!==d&&d===e&&e!==M&&u.push("is-hovering-area"),n&&u.push(n),/* @__PURE__ */oe("div",{className:u.join(" "),[Ve]:`${e}:${t}`,style:{...o,"--min-empty-height":`${r}px`,"--min-empty-width":`${i}px`},children:s.map(e=>/* @__PURE__ */oe(Je,{node:e},e.props.id))})}function We(e,t,n,o){const r=ee(()=>{const n={};for(const o of T(H(e)))n[o]=Object.assign(function(e={}){/* @__PURE__ */
1
+ import{DEFAULT_CANVAS_WORDS as e}from"./chunk-TBY3DFKS.js";import{useResolvedFields as t}from"./chunk-AGWKB77Q.js";import{toItemSelector as n,fromItemSelector as o,useNodeOps as r,parentStep as i,clickPickPart as l,clickPick as s}from"./chunk-RPMSET77.js";import{selectionBox as a,placeWindow as c,offsetOrigin as d,colorRunOf as u,ColorWindow as p,startCanvasTyping as f,textMap as h}from"./chunk-HZSZT3BE.js";import{DEFAULT_COPY_WORDS as m}from"./chunk-KRL3IUV3.js";import{useWords as g}from"./chunk-MFIRYGHW.js";import{setCanvasNonce as v,CANVAS_TYPABLE_EVENT as y,related as w,isTypingTarget as b,upsertCanvasStyle as k,removeCanvasStyle as S,WORDS_CLEAR as C,frameRectToHost as I,CANVAS_TYPING_EVENT as D,drawnBox as E}from"./chunk-YU3WHLGI.js";import{queryAllCopies as x}from"./chunk-LF3FUSCQ.js";import{find as O,ROOT_ID as M,getList as A,remove as R,parseZoneKey as z,move as P,duplicate as $,replaceNode as V,createNode as L,insert as j,normalizeData as N,createResolveCache as B,slotsOf as K,resolveNodeData as Z,ROOT_SLOT as F}from"./chunk-TGZCD6IP.js";import{topLevelSlotKeys as T,fieldsFrom as H,drawnBlockCount as W,defaultsFrom as Y}from"./chunk-KXM6YRG2.js";import{createContext as U,useEffect as q,useContext as G,useRef as Q,useSyncExternalStore as X,useState as J,useReducer as _,useMemo as ee,useCallback as te,useLayoutEffect as ne}from"react";import{jsx as oe,jsxs as re,Fragment as ie}from"react/jsx-runtime";import{createPortal as le}from"react-dom";import{registerModalEscapeInterceptor as se,FloatingBar as ae,TextToolbar as ce,LinkPicker as de}from"efficient-shell/ui";function ue(e){return!["setData","setUi","set"].includes(e.type)}var pe=(e,t,n,o)=>{const r=A(e,t,z(n));return r?.[o]??null},fe=(e,t,n,o,r)=>{const i=pe(e,t,n,o);if(!i)throw new Error(`${r}: nothing at ${n}[${o}]`);return i};function he(e,t){const{selection:o}=e;return{...e.ui,itemSelector:n(e.data,t,o),selectedSlot:o&&"slot"===o.kind?{parentId:o.parentId,slot:o.slot}:null}}function me(e,t,n){return n?"node"===n.kind?O(e,t,n.id)?n:null:n.parentId===M?A(e,t,n)?n:null:O(e,t,n.parentId)&&A(e,t,n)?n:null:null}function ge(e,t,n,r=!1){const{itemSelector:i,selectedSlot:l,...s}=n;let a=e.selection;var c;return"itemSelector"in n&&(a=o(e.data,t,i??null)),"selectedSlot"in n&&(l?a=(c=l)?{kind:"slot",parentId:c.parentId,slot:c.slot}:null:"slot"===a?.kind&&(a=null)),{...e,selection:a,ui:r?s:{...e.ui,...s}}}function ve(e,t,n){const o=ye(e,t,n);if(o===e)return e;const r=me(o.data,n,o.selection);return r===o.selection?o:{...o,selection:r}}function ye(e,t,n){const{data:o}=e;switch(t.type){case"setData":{const n="function"==typeof t.data?t.data(o):t.data;return{...e,data:{...o,...n}}}case"setUi":return ge(e,n,"function"==typeof t.ui?t.ui(he(e,n)):t.ui);case"set":{const r={data:o,ui:he(e,n)},i="function"==typeof t.state?t.state(r):t.state;let l=i.data?{...e,data:i.data}:e;return i.ui&&(l=ge(l,n,i.ui,!0)),l}case"insert":{const r={...z(t.destinationZone),index:t.destinationIndex},i=L(n,t.componentType,{},t.id?{id:t.id}:{});return{...e,data:j(o,n,r,i)}}case"replace":{const r=fe(o,n,t.destinationZone,t.destinationIndex,"replace");if(r.props.id!==t.data.props.id)throw new Error("Can't change the id during a replace action. Use remove and insert for a new node.");return{...e,data:V(o,n,r.props.id,t.data)}}case"replaceRoot":{const n={...o.root,props:{...o.root.props,...t.root.props},readOnly:t.root.readOnly};return{...e,data:{...o,root:n}}}case"duplicate":{const r=fe(o,n,t.sourceZone,t.sourceIndex,"duplicate"),i=$(o,n,r.props.id),l=pe(i,n,t.sourceZone,t.sourceIndex+1);return{...e,data:i,selection:l?{kind:"node",id:l.props.id}:e.selection}}case"reorder":return ye(e,{...t,type:"move",sourceZone:t.destinationZone},n);case"move":{if(t.sourceZone===t.destinationZone&&t.sourceIndex===t.destinationIndex)return e;const r=pe(o,n,t.sourceZone,t.sourceIndex);if(!r)return e;const i={...z(t.destinationZone),index:t.destinationIndex};return{...e,data:P(o,n,r.props.id,i)}}case"remove":{const r=fe(o,n,t.zone,t.index,"remove");return{...e,data:R(o,n,r.props.id)}}default:return e}}var we={drag:!0,duplicate:!0,delete:!0,edit:!0,insert:!0},be={leftSideBarVisible:!0,rightSideBarVisible:!0,arrayState:{},componentList:{},isDragging:!1,previewMode:"edit",viewports:{current:{width:360,height:"auto"},options:[],controlsVisible:!0},field:{focus:null}},ke=0,Se=()=>`history-${ke+=1}`;function Ce(e){let t=e.config;const r=e.now??(()=>Date.now()),i=e.historyCoalesceMs??250;let l=e.permissions??{};const s=N(e.data,t);let a=s,c={data:s,selection:null,ui:{...be}};if(e.ui){const{itemSelector:n,selectedSlot:r,...i}=e.ui;c={data:s,selection:r?{kind:"slot",...r}:o(s,t,n??null),ui:{...be,...i}}}let d=[{core:c,at:-1/0,sealed:!0,id:Se()}],u=0;const p=e=>{const t=d[u],n=r();!e&&u===d.length-1&&u>0&&!t.sealed&&n-t.at<i?d=[...d.slice(0,u),{...t,core:c,at:n}]:(d=[...d.slice(0,u+1),{core:c,at:n,sealed:e,id:Se()}],u=d.length-1)},f=/* @__PURE__ */new Set;let h=null,m=null,g=0,v=null,y=!1;const w=()=>{for(const e of[...f])e()},b=()=>{d=[...d.slice(0,u),{...d[u],core:c},...d.slice(u+1)]},k=(t,n)=>{g>0?y=y||n:(n?p(!1):c!==t&&b(),c.data!==t.data&&e.onChange?.(c.data),c!==t&&w())},S=e=>{const n=c;if(c=ve(c,e,t),c===n)return;const o=e.recordHistory??ue(e);k(n,o&&c.data!==n.data)},C=t=>{0===g&&(v=c,y=!1),g+=1;try{t()}catch(e){throw g-=1,0===g&&v&&(c=v,v=null),e}if(g-=1,g>0||!v)return;const n=v;v=null,y&&c.data!==n.data?p(!0):c!==n&&b(),c.data!==n.data&&e.onChange?.(c.data),c!==n&&w()},I=e=>{const n=c,o=me(c.data,t,e);var r,i;(r=o,i=c.selection,r===i||r&&i&&r.kind===i.kind&&("node"===r.kind&&"node"===i.kind?r.id===i.id:"slot"===r.kind&&"slot"===i.kind&&r.parentId===i.parentId&&r.slot===i.slot))||(c={...c,selection:o},k(n,!1))},D=t=>{const n=c;u=t,c=d[u].core,c.data!==n.data&&e.onChange?.(c.data),c!==n&&w()},E=()=>(e={})=>{const n=e.root?t.root?.permissions:t.components[e.item?.type??e.type??""]?.permissions;return{...we,...l,...n}};let x=E();const M=B(),R={resolveCache:M,async resolveAll({trigger:e="load",metadata:n}={}){const o=c.data,r={type:"root",props:{...o.root.props??{}}},i=[...o.content,...Object.values(o.zones??{}).flat()],[l,...s]=await Promise.all([Z(r,t,{cache:M,trigger:e,metadata:n}),...i.map(o=>Z(o,t,{cache:M,trigger:e,metadata:n}))]);C(()=>{const n=c;let r=c.data;s.forEach((e,n)=>{if(!e.didChange)return;const l=i[n].props.id,s=O(r,t,l)?.node;s&&s===O(o,t,l)?.node&&(r=V(r,t,l,e.node))}),l.didChange&&r.root===o.root&&(r={...r,root:{...r.root,props:l.node.props,readOnly:l.node.readOnly??r.root.readOnly}}),r!==c.data&&("load"===e&&c.data===a&&(a=r),c={...c,data:r,selection:me(r,t,c.selection)},k(n,!1))})},async resolveNode(e,{trigger:n="replace",metadata:o}={}){const r=O(c.data,t,e)?.node;if(!r)return!1;const i=await Z(r,t,{cache:M,trigger:n,metadata:o});if(!i.didChange)return!1;let l=!1;return C(()=>{const n=c;if(O(c.data,t,e)?.node!==r)return;const o=V(c.data,t,e,i.node);o!==c.data&&(c={...c,data:o,selection:me(o,t,c.selection)},k(n,!1),l=!0)}),l},get config(){return t},get loaded(){return a},getState(){if(h&&m===c)return h;const e=c,o={data:e.data,ui:he(e,t)},r="node"===e.selection?.kind?O(e.data,t,e.selection.id)?.node??null:null;return h={appState:o,selection:e.selection,selectedItem:r,config:t,dispatch:S,history:{back:()=>R.undo(),forward:()=>R.redo(),hasPast:u>0,hasFuture:u<d.length-1,histories:d.map(e=>({id:e.id,state:{data:e.core.data,ui:he(e.core,t)}})),index:u,setHistoryIndex:e=>{e>=0&&e<d.length&&e!==u&&D(e)}},getPermissions:x,getItemById:n=>O(e.data,t,n)?.node,getItemBySelector:n=>function(e,t,n){const[o,r]=(n.zone??"root:default-zone").split(/:(.*)/s);return A(e,t,{parentId:o,slot:r})?.[n.index]}(e.data,t,n),getSelectorForId:o=>{const r=n(e.data,t,{kind:"node",id:o});return r?{index:r.index,zone:r.zone??"root:default-zone"}:void 0}},m=e,h},subscribe:e=>(f.add(e),()=>{f.delete(e)}),dispatch:S,batch:C,group:()=>{const e=u,t=d[e].id;let n=!0;return{close:()=>{if(!n)return;if(n=!1,d[e]?.id!==t)return;if(u<=e+1)return void(u===e+1&&(d=[...d.slice(0,u),{...d[u],sealed:!0},...d.slice(u+1)]));const o=d[u];d=[...d.slice(0,e+1),{...o,sealed:!0},...d.slice(u+1)],u=e+1}}},select:e=>I(e?{kind:"node",id:e}:null),selectSlot:e=>I(e?{kind:"slot",parentId:e.parentId,slot:e.slot}:null),run(e){C(()=>{const n=c,o=void 0===e.select?c.selection:e.select;c={...c,data:e.data,selection:me(e.data,t,o)},k(n,e.data!==n.data)})},load(e,n={}){const o=c,r=N(e,t);c={...c,data:r,selection:me(r,t,n.selection??c.selection)},a=r,n.keepHistory||(d=[{core:c,at:-1/0,sealed:!0,id:Se()}],u=0),c!==o&&w()},undo(){u>0&&D(u-1)},redo(){u<d.length-1&&D(u+1)},setPermissions(e){(function(e,t){if(e===t)return!0;const n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>e[n]===t[n])})(e,l)||(l=e,x=E(),h=null,w())},setConfig(e){e!==t&&(t=e,x=E(),h=null,w())}};return R}function Ie(e,t,n={}){const o=e=>{if(e.altKey)return;if(!(e.metaKey!==e.ctrlKey))return;const o="KeyZ"===e.code,r="KeyY"===e.code&&!e.shiftKey;(o||r)&&(n.leaveTyping&&b(e.target)||!1!==t.getState?.().getPermissions().edit&&(e.preventDefault(),r||e.shiftKey?t.redo():t.undo()))};return e.addEventListener("keydown",o),()=>e.removeEventListener("keydown",o)}var De=U(null),Ee=U(!0);function xe({easel:e,hotkeys:t=!0,resolveOnMount:n=!0,children:o}){return q(()=>{n&&e.resolveAll()},[e,n]),q(()=>{if(t&&"undefined"!=typeof document)return Ie(document,e)},[e,t]),/* @__PURE__ */oe(De.Provider,{value:e,children:/* @__PURE__ */oe(Ee.Provider,{value:t,children:o})})}function Oe(){const e=G(De);if(!e)throw new Error("useEasel: no <EaselProvider> above this component");return e}function Me(e){const t=Oe(),n=Q({view:null,selector:null,value:void 0,has:!1}),o=()=>{const o=t.getState(),r=n.current;if(r.has&&r.view===o&&r.selector===e)return r.value;const i=e(o);return r.has&&Object.is(r.value,i)?(n.current={view:o,selector:e,value:r.value,has:!0},r.value):(n.current={view:o,selector:e,value:i,has:!0},i)};return X(t.subscribe,o,o)}function Ae(){return function(e){return Me(e)}}var Re=["--es-accent","--es-accent-tint","--es-accent-tint-strong","--es-accent-line","--es-accent-text","--es-accent-ring","--es-accent-shadow","--es-on-accent","--status-success-solid","--elevation-panel"],ze="host-tokens";function Pe(e,t){const n=function(e){const t=e.ownerDocument.defaultView;if(!t)return"";const n=t.getComputedStyle(e),o=[];for(const e of Re){const t=n.getPropertyValue(e).trim();t&&o.push(`${e}: ${t};`)}return o.length?`:root { ${o.join(" ")} }`:""}(e);n?k(t,ze,n):S(t,ze)}var $e="data-easel-block",Ve="data-easel-dropzone",Le={},je="data-es-mirror",Ne="undefined"==typeof window?q:ne;function Be(e,t,n){for(const e of Array.from(t.head.querySelectorAll(`[${je}]`)))e.remove();for(const o of Array.from(e.head.querySelectorAll('style, link[rel="stylesheet"]'))){const e=o.cloneNode(!0);e.setAttribute(je,""),n&&e.setAttribute("nonce",n),t.head.appendChild(e)}}function Ke({children:t,id:n="preview-frame",title:o,className:r,style:i,mirrorStyles:l=!0,onDocument:s,height:a="auto",nonce:c}){const d=g("canvas",e),u=Q(null),[p,f]=J(null);return Ne(()=>{const e=u.current,t=p?.ownerDocument.defaultView;if("auto"!==a||!e||!p||!t)return;const n=()=>{e.style.height=`${Math.ceil(p.getBoundingClientRect().height)}px`};n();const o=t.ResizeObserver,r=o?new o(n):null;return r?.observe(p),()=>r?.disconnect()},[p,a]),Ne(()=>{let e=u.current?.contentDocument;if(!e)return;"CSS1Compat"!==e.compatMode&&(e.open(),e.write("<!DOCTYPE html><html><head></head><body></body></html>"),e.close(),e=u.current?.contentDocument??e),e.body||e.documentElement.appendChild(e.createElement("body")),e.body.style.margin="0";const t=e.createElement("div");t.setAttribute("data-easel-entry",""),t.id="frame-root","fill"===a&&t.classList.add("es-frame-fill"),e.body.appendChild(t),v(e,c),f(t),s?.(e);let n=null;const o=u.current?.ownerDocument;if(l&&o){Be(o,e,c);const t=o.defaultView;t&&"MutationObserver"in t&&(n=new t.MutationObserver(()=>Be(o,e,c)),n.observe(o.head,{childList:!0,subtree:!0,characterData:!0}))}let r=null;const i=u.current;if(i&&o){Pe(i,e);const t=o.defaultView;if(t&&"MutationObserver"in t){r=new t.MutationObserver(()=>Pe(i,e)),r.observe(o.head,{childList:!0,subtree:!0,characterData:!0});const n={attributes:!0,attributeFilter:["class","style","data-theme"]};for(const e of[o.documentElement,o.body,i.closest(".es-editor")])e&&r.observe(e,n)}}return()=>{n?.disconnect(),r?.disconnect(),t.remove(),f(null),s?.(null)}},[]),/* @__PURE__ */oe("iframe",{ref:u,id:n,title:o??d.frame,className:["es-canvas-frame","fill"===a?"is-fill":"",r??""].filter(Boolean).join(" "),style:i,children:p?le(t,p):null})}var Ze=U(null),Fe=U(Le),Te=[];function He({parentId:e,slot:t,className:n,style:o,minEmptyHeight:r=128,minEmptyWidth:i=120}){const l=Oe(),s=Me(n=>A(n.appState.data,l.config,{parentId:e,slot:t})??Te),a=Me(t=>"node"===t.selection?.kind&&t.selection.id===e&&e!==M),c=Me(n=>"slot"===n.selection?.kind&&n.selection.parentId===e&&n.selection.slot===t),d=G(Ze),u=["es-zone"];return s.length&&u.push("has-children"),e===M&&u.push("is-root"),(a||c)&&u.push("is-area-selected"),null!==d&&d===e&&e!==M&&u.push("is-hovering-area"),n&&u.push(n),/* @__PURE__ */oe("div",{className:u.join(" "),[Ve]:`${e}:${t}`,style:{...o,"--min-empty-height":`${r}px`,"--min-empty-width":`${i}px`},children:s.map(e=>/* @__PURE__ */oe(Je,{node:e},e.props.id))})}function We(e,t,n,o){const r=ee(()=>{const n={};for(const o of T(H(e)))n[o]=Object.assign(function(e={}){/* @__PURE__ */
2
2
  return oe(He,{parentId:t,slot:o,...e})},{blockCount:0});return n},[e,t]);for(const e of Object.keys(r))r[e].blockCount=W(n[e],o);return r}function Ye(e){return ee(()=>function({zone:t,...n}){/* @__PURE__ */
3
3
  return oe(He,{parentId:e,slot:t,...n})},[e])}var Ue=["top","bottom","zIndex"];function qe(e,t,n){e.style[t]!==n&&(e.style[t]=n)}function Ge(e){const t=function(e){const t=e?.ownerDocument.defaultView?.getComputedStyle(e);if(!t||"sticky"!==t.position)return null;const n=e=>"auto"===e?"":e;return{top:n(t.top),bottom:n(t.bottom),zIndex:n(t.zIndex)}}(function(e){const t=e.ownerDocument.defaultView;let n=null;for(const o of Array.from(e.children))if("none"!==t?.getComputedStyle(o).display){if(n)return null;n=o}return n}(e));qe(e,"position",t?"sticky":"relative");for(const n of Ue)qe(e,n,t?.[n]??"");return!!t}var Qe="data-es-canvas-relative";function Xe(e){e.hasAttribute(Qe)&&("relative"===e.style.position&&(e.style.position=""),e.removeAttribute(Qe));const t=e.ownerDocument.defaultView?.getComputedStyle(e).position;return t&&"static"!==t?"sticky"===t:(e.style.position||(e.style.position="relative",e.setAttribute(Qe,"")),!1)}function Je({node:e}){const t=Oe().config,n=t.components[e.type],o=e.props.id,r=Q(null),i=function(e,t){return ee(()=>n=>{const o=t.current;o&&o!==n&&(o.removeAttribute($e),o.removeAttribute("data-easel-dnd")),t.current=n,n&&(n.setAttribute($e,e),n.setAttribute("data-easel-dnd",e),Xe(n))},[e,t])}(o,r),l=Q(null),s=!!n?.inline;!function(e,t){const n=Q(!1),o=Q(()=>{});o.current=()=>{const o=e(),i=n.current;n.current=!!o&&t(o),i!==n.current&&r.current()};const r=Q(()=>{});Ne(()=>o.current()),Ne(()=>{const t=e(),i=t?.ownerDocument.defaultView;if(!t||!i)return;const l=()=>o.current();i.addEventListener("resize",l);const s=i.ResizeObserver,a=s?new s(l):null;a?.observe(t);let c=null;return r.current=()=>{c?.disconnect(),c=null;const e=t.ownerDocument.documentElement;n.current&&e&&i.MutationObserver&&(c=new i.MutationObserver(l),c.observe(e,{attributes:!0}))},r.current(),()=>{i.removeEventListener("resize",l),a?.disconnect(),c?.disconnect(),r.current=()=>{}}},[])}(()=>s?r.current:l.current,e=>s?Xe(e):Ge(e));const a=G(Fe),c=We(n,o,e.props,t.components),d=Ye(o);if(!n?.render)return null;const u=n.render,p={...Y(n),...e.props,...c},f={renderDropZone:d,isEditing:!0,dragRef:n.inline?i:null,metadata:{...a,...n.metadata}};return n.inline?/* @__PURE__ */oe(u,{...p,editor:f,editMode:!0}):
4
4
  /* @__PURE__ */oe("div",{ref:l,[$e]:o,"data-easel-dnd":o,style:{position:"relative"},children:/* @__PURE__ */oe(u,{...p,editor:f,editMode:!0})})}function _e({metadata:e}){const t=Me(e=>e.config),n=Me(e=>e.appState.data.root).props??{},o=t.root?.render,r=We(t.root,M,n,t.components),i=Ye(M),l=/* @__PURE__ */oe(He,{parentId:M,slot:F}),s=o?/* @__PURE__ */oe(o,{id:"page-root",...n,...r,editor:{renderDropZone:i,isEditing:!0,dragRef:null,metadata:e??{}},editMode:!0,children:l}):l;/* @__PURE__ */
@@ -8,9 +8,9 @@ return oe("div",{ref:n,"aria-hidden":"true",className:"es-canvas-outline is-sele
8
8
  /* @__PURE__ */oe("div",{ref:o,"aria-hidden":"true",className:c,style:s?d(s):{display:"none"}}),a.map((e,t)=>/* @__PURE__ */oe("div",{"aria-hidden":"true",className:c,style:d(e)},t))]});return n&&e?/* @__PURE__ */oe(n,{componentId:e,kind:t,children:u}):u}function ut(e,t,n){const o=h(e,n),r=o.text.length,i=e.ownerDocument;if(!t)return[r,r];let l=null;const s=i.caretPositionFromPoint?.(t.x,t.y);if(s&&e.contains(s.offsetNode))l=o.at(s.offsetNode,s.offset);else{const n=i.caretRangeFromPoint?.(t.x,t.y);n&&e.contains(n.startContainer)&&(l=o.at(n.startContainer,n.startOffset))}if(null===l)return[r,r];const a=o.text;let c=l,d=l;for(;c>0&&!/\s/.test(a[c-1]);)c-=1;for(;d<a.length&&!/\s/.test(a[d]);)d+=1;return[c,d]}function pt({s:e,element:t,toolbar:n,label:o,keys:r}){const i=g("copy",m),l=e.pressed(),s=new Set(n.offered),f=n.colors&&n.colors.length>0?n.colors:null,h=Q(null),[v,y]=J(!1),[w,b]=J(null),k=v||null!==w,S=()=>{e.hold(),y(!1),b({href:e.pressed().href})},C=()=>{y(!1),b(null),e.resume()};ne(()=>{r.current={escape:()=>!!k&&(C(),!0),link:()=>!!s.has("link")&&(S(),!0)}}),ne(()=>()=>{r.current=null},[r]);const D=Q(C);D.current=C,q(()=>{if(v)return se(e=>{const t=h.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&(D.current(),!0)},()=>h.current?.querySelector(".es-copy-colors"))},[v]),q(()=>{const n=h.current;if(!k||!n)return;const o=/* @__PURE__ */new Set([n.ownerDocument]),r=t();r&&o.add(r.ownerDocument);const i=o=>{const r=o.target;if(r&&n.contains(r))return;y(!1),b(null);const i=t();r&&i&&i.contains(r)?e.release():e.stop("outside")};for(const e of o)e.addEventListener("pointerdown",i,!0);return()=>{for(const e of o)e.removeEventListener("pointerdown",i,!0)}},[k,e,t]),ne(()=>{const e=h.current,n=e?.querySelector(".rosh-tb-wrap > .es-copy-pop"),o=t();if(!(k&&e&&n&&o))return;const r=o.ownerDocument.defaultView?.getSelection()??null,i=r&&r.rangeCount>0&&o.contains(r.getRangeAt(0).startContainer)?r.getRangeAt(0):null,l=(i?a(i,o):null)??(()=>{const e=o.getBoundingClientRect();return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}})(),s=o.ownerDocument.defaultView?.frameElement,u=s?I(s,{left:l.left,top:l.top,width:l.right-l.left,height:l.bottom-l.top}):{left:l.left,top:l.top,width:l.right-l.left,height:l.bottom-l.top},p=o.getBoundingClientRect(),f=s?I(s,{left:p.left,top:p.top,width:p.width,height:p.height}):{left:p.left,top:p.top,width:p.width,height:p.height},m=(e.closest("[data-floating-bar]")??e).getBoundingClientRect(),g={left:u.left,right:u.left+u.width,top:Math.min(u.top,f.top-6,m.top),bottom:Math.max(u.top+u.height,f.top+f.height+6,m.bottom)},v=e.ownerDocument.documentElement,y=(s??o.closest(".es-canvas")??o).getBoundingClientRect(),w={left:Math.max(0,y.left),top:Math.max(0,y.top),right:Math.min(v.clientWidth||y.right,y.right),bottom:Math.min(v.clientHeight||y.bottom,y.bottom)};if(w.right<=w.left||w.bottom<=w.top||0===n.offsetWidth)return;const b=c({anchor:g,size:{width:n.offsetWidth,height:n.offsetHeight},within:{left:y.left,top:y.top,right:y.right,bottom:y.bottom},clip:w,parent:d(n)});n.style.top=`${b.top}px`,n.style.left=`${b.left}px`,n.style.setProperty("--es-pop-point",`${b.point}px`),n.dataset.side=b.above?"above":"below"});const E=f?{run:u(l.color,f),open:v,onToggle:()=>{b(null),v?C():(e.hold(),y(!0))}}:void 0;/* @__PURE__ */
9
9
  return oe(ae,{anchor:()=>{const e=t();if(!e)return null;const n=e.getBoundingClientRect(),o=e.ownerDocument.defaultView?.frameElement,r=o?I(o,{left:n.left,top:n.top,width:n.width,height:n.height}):{left:n.left,top:n.top,width:n.width,height:n.height};return{left:r.left-6,top:r.top-6,right:r.left+r.width+6,bottom:r.top+r.height+6}},bounds:()=>{const e=t(),n=e?.ownerDocument.defaultView?.frameElement,o=(n??e?.closest(".es-canvas")??e)?.getBoundingClientRect();return o?{left:o.left,top:o.top,right:o.right,bottom:o.bottom}:{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}},"aria-label":o,children:/* @__PURE__ */oe("div",{ref:h,children:/* @__PURE__ */oe(ce,{layout:"row",offered:s,pressed:l.marks,onMark:t=>{"link"===t?S():e.press(t)},color:E,linkOpen:null!==w,list:{pressed:l.list,onList:t=>e.list(t)},clear:l.clearable?{onClear:()=>e.clear()}:void 0,alignment:n.alignment,letterCase:n.letterCase,last:n.lastTool?.({className:"rosh-tb-btn",disabled:!1,selected:l.selected,keepCaret:t=>{t.preventDefault(),e.hold()},insert:t=>e.insert(t)}),windows:/* @__PURE__ */re(ie,{children:[v&&f?/* @__PURE__ */oe(p,{colors:f,current:l.color,words:i.colors??m.colors,onPick:t=>e.color(t)}):null,w?
10
10
  /* @__PURE__ */oe(de,{className:"es-copy-link es-copy-pop",value:w.href??"",onApply:t=>{b(null),e.link(t)},onRemove:null!==w.href?()=>{b(null),e.link(null)}:void 0,onCancel:C}):null]})})})})}function ft({element:e,which:t}){const n=Q(null),o=st(n,()=>e(),t);/* @__PURE__ */
11
- return oe("div",{ref:n,"aria-hidden":"true",className:"es-canvas-outline is-typing",style:o?{position:"absolute",top:o.top,left:o.left,width:o.width,height:o.height,...it}:{display:"none"}})}function ht({frame:e=!0,className:t,style:n,metadata:s,mirrorStyles:a,onDocument:c,height:d,title:u,nonce:p,hotkeys:h,frameWrapper:m,overlay:v,children:b,typing:k,passThrough:S}){const C=Oe(),I=G(et),E=S??I,x=G(Ee),M=g("canvas",l),A=h??x,[R,z]=J(void 0),P=Me(e=>"node"===e.selection?.kind?e.selection.id:null),[$,V]=J(null),[L,j]=J(null),N=G(ot),[,B]=_(e=>e+1,0),Z=e=>{N?.select(e),B()},[F,T]=J(null),H=Q(null),[,W]=J(0),Y=Q(k);Y.current=k;const U=Q(null),X=Q(null),ee=()=>{if(!P)return null;const e=Y.current?.atSelection?.()?.element()??null;if(!e)return null;const t=X.current?.ownerDocument;if(N){const n=N.selected()&&t?N.selectedPart?.(t)??null:null;return n&&w(n.element,e)?n.element:null}const n=O(C.getState().appState.data,C.config,P);return n&&0===K(n.node,C.config).length?e:null},te=Me(e=>e.appState.data),ne=N?.selected()??null;q(()=>{const e=X.current?.ownerDocument,t=e?.defaultView?.CustomEvent;if(!e||!t)return;const n=P&&!F&&Y.current?.atSelection?.()?P:null,o=n?ee():null;e.dispatchEvent(new t(y,{detail:o?{id:n,words:o}:{id:n}}))},[P,F,te,ne]);const ie=e=>{const t=X.current?.ownerDocument,n=t?.defaultView?.CustomEvent;t&&n&&t.dispatchEvent(new n(D,{detail:{typing:e}}))},le=(e,t)=>{H.current?.s.stop("stop");const n=e.element();if(!n)return!1;const o=C.group(),r=e.element,i=f({element:r,value:e.value,rules:e.rules,multiline:e.multiline,skip:e.skip,caret:ut(n,t,e.skip),write:e.write,remount:e.remount,onSelect:()=>W(e=>e+1),onEscape:()=>U.current?.escape()??!1,onLinkKey:()=>U.current?.link()??!1,end:e=>{o.close(),H.current?.element===r&&(H.current=null),T(null),ie(!1),Y.current?.onChange?.({typing:!1,why:e})}});if(!i)return o.close(),!1;const l=n.closest?.(`[${$e}]`)?.getAttribute($e);return l&&C.select(l),H.current={s:i,element:r,target:e},T(()=>r),V(null),ie(!0),Y.current?.onChange?.({typing:!0,element:n}),!0};q(()=>()=>H.current?.s.stop("stop"),[]);const se=e=>{const t=H.current?.element();return Boolean(t&&t.contains(e))},ae=(e,t)=>nt(C.getState().appState.data,C.config,e,t),ce=e=>{const t=e.closest?.(`[${$e}]`)?.getAttribute($e);if(!t)return;const n=C.getState(),o="node"===n.selection?.kind?n.selection.id:null,l=N?.partAt(e,t)??null;if(l){const e=r(n.appState.data,C.config,t,l.id,o,N?.selected()??null,E);if(e)return{node:e.node,part:e.part?l:null}}return{node:i(n.appState.data,C.config,t,o,E)??t,part:null}},de=e=>{if("Enter"!==e.key||e.defaultPrevented||e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return;if(H.current)return;const t=e.target;if(t?.isContentEditable||t?.closest?.("input, textarea, select, button"))return;const n=Y.current?.atSelection?.();n&&le(n,null)&&e.preventDefault()},ue=X.current?.ownerDocument??null,pe=N?.selected()&&ue&&P?N.selectedPart?.(ue)??null:null,fe=pe&&P&&ae(P,pe)?pe.element:null,he=F?null:ee(),me=/* @__PURE__ */re("div",{ref:X,className:"es-canvas-content",style:{position:"relative"},onClick:e=>{const t=e.target;if(t.closest?.("a[href]")&&e.preventDefault(),H.current){if(se(t))return;H.current.s.stop("outside")}const n=t.ownerDocument?.getSelection?.();n&&n.rangeCount>0&&n.isCollapsed&&n.removeAllRanges();const o=ce(t);if(void 0!==o)return C.select(o.node),void(N&&(o.part?.id??null)!==N.selected()&&Z(o.part?.id??null));t.hasAttribute?.(Ve)||(C.select(null),N?.selected()&&Z(null))},onDoubleClick:e=>{const t=Y.current;if(!t||se(e.target))return;const n=t.at(e.target);n&&le(n,{x:e.clientX,y:e.clientY})&&e.preventDefault()},onKeyDown:e=>de(e),onMouseOver:e=>{if(H.current)return;const t=ce(e.target),n=!!t?.part&&ae(t.node,t.part),o=t?.part&&n&&t.part.id!==N?.selected()?t.part:null,r=!t||t.part&&n?null:t.node;r!==$&&V(r),o?.id===L?.id&&o?.element===L?.element||j(o)},onMouseLeave:()=>{V(null),j(null)},children:[
12
- /* @__PURE__ */oe(Ze.Provider,{value:$,children:/* @__PURE__ */oe(_e,{metadata:s})}),
11
+ return oe("div",{ref:n,"aria-hidden":"true",className:"es-canvas-outline is-typing",style:o?{position:"absolute",top:o.top,left:o.left,width:o.width,height:o.height,...it}:{display:"none"}})}function ht({frame:t=!0,className:n,style:o,metadata:r,mirrorStyles:a,onDocument:c,height:d,title:u,nonce:p,hotkeys:h,frameWrapper:m,overlay:v,children:b,typing:k,passThrough:S}){const C=Oe(),I=G(et),E=S??I,x=G(Ee),M=g("canvas",e),A=h??x,[R,z]=J(void 0),P=Me(e=>"node"===e.selection?.kind?e.selection.id:null),[$,V]=J(null),[L,j]=J(null),N=G(ot),[,B]=_(e=>e+1,0),Z=e=>{N?.select(e),B()},[F,T]=J(null),H=Q(null),[,W]=J(0),Y=Q(k);Y.current=k;const U=Q(null),X=Q(null),ee=()=>{if(!P)return null;const e=Y.current?.atSelection?.()?.element()??null;if(!e)return null;const t=X.current?.ownerDocument;if(N){const n=N.selected()&&t?N.selectedPart?.(t)??null:null;return n&&w(n.element,e)?n.element:null}const n=O(C.getState().appState.data,C.config,P);return n&&0===K(n.node,C.config).length?e:null},te=Me(e=>e.appState.data),ne=N?.selected()??null;q(()=>{const e=X.current?.ownerDocument,t=e?.defaultView?.CustomEvent;if(!e||!t)return;const n=P&&!F&&Y.current?.atSelection?.()?P:null,o=n?ee():null;e.dispatchEvent(new t(y,{detail:o?{id:n,words:o}:{id:n}}))},[P,F,te,ne]);const ie=e=>{const t=X.current?.ownerDocument,n=t?.defaultView?.CustomEvent;t&&n&&t.dispatchEvent(new n(D,{detail:{typing:e}}))},le=(e,t)=>{H.current?.s.stop("stop");const n=e.element();if(!n)return!1;const o=C.group(),r=e.element,i=f({element:r,value:e.value,rules:e.rules,multiline:e.multiline,skip:e.skip,caret:ut(n,t,e.skip),write:e.write,remount:e.remount,onSelect:()=>W(e=>e+1),onEscape:()=>U.current?.escape()??!1,onLinkKey:()=>U.current?.link()??!1,end:e=>{o.close(),H.current?.element===r&&(H.current=null),T(null),ie(!1),Y.current?.onChange?.({typing:!1,why:e})}});if(!i)return o.close(),!1;const l=n.closest?.(`[${$e}]`)?.getAttribute($e);return l&&C.select(l),H.current={s:i,element:r,target:e},T(()=>r),V(null),ie(!0),Y.current?.onChange?.({typing:!0,element:n}),!0};q(()=>()=>H.current?.s.stop("stop"),[]);const se=e=>{const t=H.current?.element();return Boolean(t&&t.contains(e))},ae=(e,t)=>nt(C.getState().appState.data,C.config,e,t),ce=e=>{const t=e.closest?.(`[${$e}]`)?.getAttribute($e);if(!t)return;const n=C.getState(),o="node"===n.selection?.kind?n.selection.id:null,r=N?.partAt(e,t)??null;if(r){const e=l(n.appState.data,C.config,t,r.id,o,N?.selected()??null,E);if(e)return{node:e.node,part:e.part?r:null}}return{node:s(n.appState.data,C.config,t,o,E)??t,part:null}},de=e=>{if("Enter"!==e.key||e.defaultPrevented||e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return;if(H.current)return;const t=e.target;if(t?.isContentEditable||t?.closest?.("input, textarea, select, button"))return;const n=Y.current?.atSelection?.();n&&le(n,null)&&e.preventDefault()},ue=X.current?.ownerDocument??null,pe=N?.selected()&&ue&&P?N.selectedPart?.(ue)??null:null,fe=pe&&P&&ae(P,pe)?pe.element:null,he=F?null:ee(),me=/* @__PURE__ */re("div",{ref:X,className:"es-canvas-content",style:{position:"relative"},onClick:e=>{const t=e.target;if(t.closest?.("a[href]")&&e.preventDefault(),H.current){if(se(t))return;H.current.s.stop("outside")}const n=t.ownerDocument?.getSelection?.();n&&n.rangeCount>0&&n.isCollapsed&&n.removeAllRanges();const o=ce(t);if(void 0!==o)return C.select(o.node),void(N&&(o.part?.id??null)!==N.selected()&&Z(o.part?.id??null));t.hasAttribute?.(Ve)||(C.select(null),N?.selected()&&Z(null))},onDoubleClick:e=>{const t=Y.current;if(!t||se(e.target))return;const n=t.at(e.target);n&&le(n,{x:e.clientX,y:e.clientY})&&e.preventDefault()},onKeyDown:e=>de(e),onMouseOver:e=>{if(H.current)return;const t=ce(e.target),n=!!t?.part&&ae(t.node,t.part),o=t?.part&&n&&t.part.id!==N?.selected()?t.part:null,r=!t||t.part&&n?null:t.node;r!==$&&V(r),o?.id===L?.id&&o?.element===L?.element||j(o)},onMouseLeave:()=>{V(null),j(null)},children:[
12
+ /* @__PURE__ */oe(Ze.Provider,{value:$,children:/* @__PURE__ */oe(_e,{metadata:r})}),
13
13
  /* @__PURE__ */re("div",{className:"es-canvas-outlines",style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:[
14
14
  /* @__PURE__ */oe(dt,{id:!F&&$&&$!==P?$:null,kind:"hover",overlay:v}),N?/* @__PURE__ */oe(rt,{element:F||!L||L.id===N.selected()?null:L.element}):null,he||fe?/* @__PURE__ */oe(lt,{element:F?null:he??fe,words:null!==he}):null,
15
- /* @__PURE__ */oe(dt,{id:F||fe||he?null:P,kind:"selected",overlay:v}),F?/* @__PURE__ */oe(ft,{element:()=>{const e=F?.()??null;return e?pe&&w(pe.element,e)?pe.element:e:null},which:pe?.element??F}):null]}),b]}),ge=m?/* @__PURE__ */oe(m,{document:R,children:me}):me;q(()=>{if(R&&A)return Ie(R,C)},[R,A,C]),q(()=>{if(!R)return;const e=e=>{if("Enter"===e.key)return void de(e);if("Escape"!==e.key||e.defaultPrevented)return;const t=e.target;if(t?.isContentEditable||t?.closest?.("input, textarea, select"))return;const n=C.getState();if("node"!==n.selection?.kind)return;if(N?.selected())return void Z(null);const r=o(n.appState.data,C.config,n.selection);"node"===r?.kind&&C.select(r.id)};return R.addEventListener("keydown",e),()=>R.removeEventListener("keydown",e)},[R,C,N]);/* @__PURE__ */
16
- return re("div",{className:"es-canvas"+(t?` ${t}`:""),style:n,"data-easel-preview":"","data-es-typing":F?"":void 0,children:[F&&H.current?.target.toolbar?/* @__PURE__ */oe(pt,{s:H.current.s,element:H.current.element,toolbar:H.current.target.toolbar,label:M.textTools,keys:U}):null,e?/* @__PURE__ */oe(Ke,{mirrorStyles:a,onDocument:e=>{z(e??void 0),c?.(e)},height:d,title:u,nonce:p,children:ge}):/* @__PURE__ */oe("div",{id:"preview-frame","data-easel-entry":"",children:ge})]})}function mt(e={}){const t=Oe(),o=Me(e=>e.appState.data);return n({...e,data:o,config:t.config,commit:(e,{select:n})=>t.run({data:e,select:n})})}function gt(){return yt(Me(e=>e.selectedItem))}function vt(){return yt(null)}function yt(e){const t=Oe(),n=Me(e=>e.config),o=t.resolveCache,r=Me(e=>e.appState.data.root),i=e?e.props.id:"root",l=r.props??{},a=ee(()=>e||{type:"root",props:l},[e,l]),c=e?n.components[e.type]:n.root,d=t.getState(),u=e?O(d.appState.data,n,i):null,p=u&&"root"!==u.place.parentId?u.place.parentId:null,f=p?d.getItemById(p)??null:null,{fields:h}=s({id:i,node:a,block:c,parent:f,appState:d.appState}),m=Me(t=>!1===t.getPermissions(e?{item:e}:{root:!0}).edit),g=te(e=>{(async()=>{const r=t.getState();if("root"!==i){const l=r.getItemById(i),s=r.getSelectorForId(i);if(!l||!s)return;const a={...l,props:{...l.props,...e}},{node:c}=await Z(a,n,{cache:o,trigger:"replace"}),d=t.getState().getSelectorForId(i);if(!d)return;return void t.dispatch({type:"replace",destinationZone:d.zone??"root:default-zone",destinationIndex:d.index,data:c})}const l=r.appState.data.root.props??{},{node:s}=await Z({type:"root",props:{...l,...e}},n,{cache:o,trigger:"replace"});t.dispatch({type:"replaceRoot",root:{props:s.props,readOnly:s.readOnly},recordHistory:!0})})()},[t,n,o,i]),v=te((e,t)=>g({[e]:t}),[g]);return{id:i,node:a,fields:h,values:a.props,readOnly:m,onChange:v,onChangeMany:g}}export{Ke as CanvasFrame,ot as CanvasPartsContext,et as CanvasPassThroughContext,tt as CanvasSharedContext,be as DEFAULT_UI,ht as EaselCanvas,xe as EaselProvider,_e as EditDocument,Ie as bindUndoKeys,Ce as createEasel,Ae as createUseEasel,nt as partHasOwnBox,ue as recordsByDefault,ve as reduce,he as uiView,Me as useEasel,Oe as useEaselApi,mt as useEaselNodeOps,vt as useRootFields,gt as useSelectedFields,me as validSelection};
15
+ /* @__PURE__ */oe(dt,{id:F||fe||he?null:P,kind:"selected",overlay:v}),F?/* @__PURE__ */oe(ft,{element:()=>{const e=F?.()??null;return e?pe&&w(pe.element,e)?pe.element:e:null},which:pe?.element??F}):null]}),b]}),ge=m?/* @__PURE__ */oe(m,{document:R,children:me}):me;q(()=>{if(R&&A)return Ie(R,C)},[R,A,C]),q(()=>{if(!R)return;const e=e=>{if("Enter"===e.key)return void de(e);if("Escape"!==e.key||e.defaultPrevented)return;const t=e.target;if(t?.isContentEditable||t?.closest?.("input, textarea, select"))return;const n=C.getState();if("node"!==n.selection?.kind)return;if(N?.selected())return void Z(null);const o=i(n.appState.data,C.config,n.selection);"node"===o?.kind&&C.select(o.id)};return R.addEventListener("keydown",e),()=>R.removeEventListener("keydown",e)},[R,C,N]);/* @__PURE__ */
16
+ return re("div",{className:"es-canvas"+(n?` ${n}`:""),style:o,"data-easel-preview":"","data-es-typing":F?"":void 0,children:[F&&H.current?.target.toolbar?/* @__PURE__ */oe(pt,{s:H.current.s,element:H.current.element,toolbar:H.current.target.toolbar,label:M.textTools,keys:U}):null,t?/* @__PURE__ */oe(Ke,{mirrorStyles:a,onDocument:e=>{z(e??void 0),c?.(e)},height:d,title:u,nonce:p,children:ge}):/* @__PURE__ */oe("div",{id:"preview-frame","data-easel-entry":"",children:ge})]})}function mt(e={}){const t=Oe(),n=Me(e=>e.appState.data);return r({...e,data:n,config:t.config,commit:(e,{select:n})=>t.run({data:e,select:n})})}function gt(){return yt(Me(e=>e.selectedItem))}function vt(){return yt(null)}function yt(e){const n=Oe(),o=Me(e=>e.config),r=n.resolveCache,i=Me(e=>e.appState.data.root),l=e?e.props.id:"root",s=i.props??{},a=ee(()=>e||{type:"root",props:s},[e,s]),c=e?o.components[e.type]:o.root,d=n.getState(),u=e?O(d.appState.data,o,l):null,p=u&&"root"!==u.place.parentId?u.place.parentId:null,f=p?d.getItemById(p)??null:null,{fields:h}=t({id:l,node:a,block:c,parent:f,appState:d.appState}),m=Me(t=>!1===t.getPermissions(e?{item:e}:{root:!0}).edit),g=te(e=>{(async()=>{const t=n.getState();if("root"!==l){const i=t.getItemById(l),s=t.getSelectorForId(l);if(!i||!s)return;const a={...i,props:{...i.props,...e}},{node:c}=await Z(a,o,{cache:r,trigger:"replace"}),d=n.getState().getSelectorForId(l);if(!d)return;return void n.dispatch({type:"replace",destinationZone:d.zone??"root:default-zone",destinationIndex:d.index,data:c})}const i=t.appState.data.root.props??{},{node:s}=await Z({type:"root",props:{...i,...e}},o,{cache:r,trigger:"replace"});n.dispatch({type:"replaceRoot",root:{props:s.props,readOnly:s.readOnly},recordHistory:!0})})()},[n,o,r,l]),v=te((e,t)=>g({[e]:t}),[g]);return{id:l,node:a,fields:h,values:a.props,readOnly:m,onChange:v,onChangeMany:g}}export{Ke as CanvasFrame,ot as CanvasPartsContext,et as CanvasPassThroughContext,tt as CanvasSharedContext,be as DEFAULT_UI,ht as EaselCanvas,xe as EaselProvider,_e as EditDocument,Ie as bindUndoKeys,Ce as createEasel,Ae as createUseEasel,nt as partHasOwnBox,ue as recordsByDefault,ve as reduce,he as uiView,Me as useEasel,Oe as useEaselApi,mt as useEaselNodeOps,vt as useRootFields,gt as useSelectedFields,me as validSelection};
@@ -0,0 +1,5 @@
1
+ import{usePickFollowsSelection as n}from"./chunk-NCXYC7WI.js";import{slotFieldsOf as e,slotChildrenIn as t}from"./chunk-TCAAOYQY.js";import{EaselCanvas as r,useSelectedFields as o}from"./chunk-VBOSOH5M.js";import{Inspector as i}from"./chunk-H4Z2V56N.js";import{fieldIsShown as u}from"./chunk-BPXEFVSQ.js";import{createContext as l,useContext as s}from"react";import{DesktopIcon as c}from"efficient-shell/icons/efficient";import{jsx as f}from"react/jsx-runtime";var a={kind:"selection"};function d(n){return"selection"===n.kind}function p(n,e){if(d(n)&&d(e))return!0;const t=n,r=e,o=Object.keys(t);return o.length===Object.keys(r).length&&o.every(n=>Object.is(t[n],r[n]))}function m(n){const e=n;return"string"==typeof e.nodeId&&"string"==typeof e.slot}function k(n,t){const r=n.components?.[t.type]?.fields??{};return e(n,t.type).filter(n=>u(r[n],{values:t.props}))}function h(n,e){return k(n,e).flatMap(n=>t(e,n))}function v(n,e,t){const r=n.slotsOf?.(t);return r||k(e,t).map(n=>({slot:n,label:n,rung:!1}))}function y(n,e){return n.isFirst?n.isFirst(e):e.type===n.first}function g(n,e){return n.isLast?n.isLast(e):e.type===n.last}var b={},O=()=>b,j=()=>"",S=()=>null,w=()=>{},C={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},L={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},N={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */f(c,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},B={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},P={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function D(){/* @__PURE__ */
2
+ return f(r,{height:"fill"})}function I(){const{id:n,fields:e,values:t,readOnly:r,onChange:u}=o();/* @__PURE__ */
3
+ return f("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */f(i,{fields:e,values:t,onChange:u,readOnly:r,idPrefix:n})})}var x=l({});function A({parts:n,children:e}){/* @__PURE__ */
4
+ return f(x.Provider,{value:n,children:e})}function F(){return s(x)}function G(){return(F().useOwnerName??j)()}function T(){return(F().useDocumentLabel??S)()}function V(n,e,t,r){return(F().useBridges??O)(n,e,t,r)}function H(n){return(F().useStandaloneBridges??O)(n)}function Y(n,e){(F().useDocumentPass??w)(n,e)}function M(){return F().blockRules??C}function Q(){return F().blockLook??L}function R(){return F().devices??N}function X(){return F().leftView??B}function Z(){return F().pinned??P}function E(){return F().saveSwitch??!0}function K(e){n(!0===F().pickFollowsSelection,e)}function W(){return F().storageNamespace||void 0}function q(){return F().styleClipboard??null}function z(){return F().nodeKeys??!0}function J(){return F().notify??null}function U(){return F().Canvas??D}function $(){return F().CanvasHead??null}function _(){return F().canvasDrag??null}var nn=l(null);function en({target:n,children:e}){/* @__PURE__ */
5
+ return f(nn.Provider,{value:n,children:e})}function tn(){return s(nn)}function rn(){return F().Inspector??I}export{a as SELECTION_MODE,en as ScreenCanvasTargetProvider,A as ScreenPartsProvider,y as isPinnedFirst,g as isPinnedLast,d as isSelectionMode,m as isSlotMode,p as sameInspectorMode,v as screenSlotsOf,h as shownChildSlotsOf,k as shownSlotFieldsOf,Q as useScreenBlockLook,M as useScreenBlockRules,V as useScreenBridges,_ as useScreenCanvasDrag,U as useScreenCanvasFrame,$ as useScreenCanvasHead,tn as useScreenCanvasTarget,R as useScreenDevices,T as useScreenDocumentLabel,Y as useScreenDocumentPass,rn as useScreenInspectorPanel,X as useScreenLeftView,z as useScreenNodeKeys,J as useScreenNotify,G as useScreenOwnerName,F as useScreenParts,K as useScreenPickFollowsSelection,Z as useScreenPinned,E as useScreenSaveSwitch,W as useScreenStorageNamespace,q as useScreenStyleClipboard,H as useStandaloneScreenBridges};
@@ -0,0 +1,7 @@
1
+ import{clientOnly as r}from"./chunk-GXQCZJOP.js";import{ScreenChrome as n}from"./chunk-HHQZB6IE.js";import{ScreenStoreProvider as e}from"./chunk-CMMR6CJS.js";import{ScreenDocumentProvider as i,useScreenDocument as a}from"./chunk-K7MMLCTT.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-IYHO4XQX.js";import{documentPermissions as s}from"./chunk-THWO5YVZ.js";import{useWords as c}from"./chunk-MFIRYGHW.js";import{useMemo as t,useState as d,useRef as l,useEffect as m,useCallback as g}from"react";import{Dialog as h,Button as f}from"efficient-shell/ui";import{jsx as u,jsxs as p,Fragment as v}from"react/jsx-runtime";var C=r(e),k=r(n);function j({onCancel:r,onDiscard:n,onSave:e}){const i=c("screen",o).leave,[a,s]=d(!1),t=l(!0);m(()=>(t.current=!0,()=>{t.current=!1}),[]);const C=g(async()=>{s(!0);try{await e()}finally{t.current&&s(!1)}},[e]);/* @__PURE__ */
2
+ return u(h,{open:!0,role:"alertdialog",size:"sm",title:i.title,onClose:r,footer:/* @__PURE__ */p(v,{children:[
3
+ /* @__PURE__ */u(f,{variant:"secondary",onClick:r,children:i.cancel}),
4
+ /* @__PURE__ */u(f,{variant:"ghost-danger",onClick:n,children:i.discard}),
5
+ /* @__PURE__ */u(f,{variant:"primary",loading:a,onClick:()=>{C()},children:i.save})]}),children:i.body})}function y({target:r,addressing:n,onHostMessage:e,children:a}){/* @__PURE__ */
6
+ return u(i,{target:r,addressing:n,onHostMessage:e,children:a})}var N=(r,n)=>/* @__PURE__ */p(v,{children:[r,n]});function H({config:r,parts:n,wrap:e=N}){const{data:i,error:d,redirecting:l,ready:m,readOnly:g,onChange:h,pendingNav:f,cancelPendingNav:p,discardAndNavigate:v,saveAndNavigate:y}=a(),H=t(()=>s(!g),[g]),M=c("screen",o);return l?/* @__PURE__ */u("div",{className:"sf-msg",children:M.loading}):d?/* @__PURE__ */u("div",{className:"sf-msg sf-msg--error",children:d}):m?i?e(
7
+ /* @__PURE__ */u(C,{config:r,data:i,onChange:h,permissions:H,parts:n,children:/* @__PURE__ */u(k,{})}),f&&/* @__PURE__ */u(j,{onCancel:p,onDiscard:v,onSave:y})):/* @__PURE__ */u("div",{className:"sf-msg",children:M.loading}):/* @__PURE__ */u("div",{className:"sf-msg",children:M.waitingForAuthorization})}export{H as DocumentScreen,y as ScreenMount};
@@ -1,4 +1,4 @@
1
- import{TEXT_STYLE_CASES as e}from"../chunk-YHZSBL2N.js";import{selectionToVisible as t,selectionToSource as n,richLayout as r,createHistory as l,colorRunOf as o,textRange as a,selectionBox as s,placeWindow as c,offsetOrigin as i,visibleArea as u,clearRangeOf as d,ColorWindow as p,markPress as h,pasteToMarkup as m,richInput as f,editVisible as g,MARKUP_CLIPBOARD_TYPE as y,markupOfRange as v}from"../chunk-HZSZT3BE.js";export{ColorWindow,MARKUP_CLIPBOARD_TYPE,TYPING_BURST_MS,clearRangeOf,colorRunOf,createHistory,editVisible,markupOfRange,newLine,pasteToMarkup,richInput,richLayout,selectionToSource,selectionToVisible,setBullet,startCanvasTyping,textMap,toSource,toSourceStart,toVisible}from"../chunk-HZSZT3BE.js";import{DEFAULT_COPY_WORDS as b}from"../chunk-KRL3IUV3.js";import{FieldNumber as k}from"../chunk-Y2T3JX7K.js";import{FieldSelect as x}from"../chunk-KFWNGPW3.js";import"../chunk-JACEEVVF.js";import{SettingsSwitch as S}from"../chunk-OECWLNKJ.js";import{SettingsField as E,SettingsSegmented as w}from"../chunk-S3DUFDQ6.js";import{useWords as C}from"../chunk-MFIRYGHW.js";import{registerModalEscapeInterceptor as N,textToolbarRows as D,TextToolbar as T,textAlignWords as O,useShellStrings as L,textAlignOptions as R,TEXT_ALIGNS as K,LinkPicker as B,Tooltip as F,IconButton as j}from"efficient-shell/ui";export{TextToolbar}from"efficient-shell/ui";import{useRef as H,useState as V,useLayoutEffect as W,useEffect as $,useId as M}from"react";import{RETIRED_MARKS as z,applyMark as P,marksIn as I,STANDARD_MARKUP as q,listIn as U,colorIn as Y,clearStyle as Z,spanFor as A,findLink as _,tokenizeInline as G,colorOver as J,setList as Q,unlinkAt as X,removeLink as ee,linkOver as te,writeLink as ne}from"efficient-shell/markup";import{jsxs as re,jsx as le,Fragment as oe}from"react/jsx-runtime";import{ParagraphSpacingIcon as ae,LetterSpacingIcon as se,LineSpacingIcon as ce,TextSizeIcon as ie,StylesIcon as ue,TypeIcon as de,AlignmentIcon as pe,ListFormatIcon as he,CaseIcon as me,ItalicIcon as fe,NumberedListIcon as ge,ListIcon as ye,ListNoneIcon as ve,CaseLowerIcon as be,CaseCapitalizedIcon as ke,CaseUpperIcon as xe,CaseNormalIcon as Se}from"efficient-shell/icons/efficient";function Ee(e,t,n,r,l){for(const o of l){if(o.kind!==n)continue;if(!e.startsWith(o.open,t))continue;const l=t+o.open.length;if(e.startsWith(r,l)&&e.startsWith(o.close,l+r.length))return o}return null}function we({value:e,rules:t=q,className:n,layerRef:r}){const l=function(e,t){const n=[];let r=0;for(const l of G(e,t)){if("text"===l.kind){l.text.length>0&&(n.push({kind:"text",text:e.slice(r,r+l.text.length)}),r+=l.text.length);continue}const o=Ee(e,r,l.kind,l.text,t);if(!o)return[{kind:"text",text:e}];const a=r+o.open.length,s=a+l.text.length,c=s+o.close.length;n.push({kind:"delimiter",text:e.slice(r,a)}),n.push({kind:l.kind,text:e.slice(a,s)}),n.push({kind:"delimiter",text:e.slice(s,c)}),r=c}return n.map(e=>e.text).join("")!==e?[{kind:"text",text:e}]:n}(e,t);/* @__PURE__ */
1
+ import{TEXT_STYLE_CASES as e}from"../chunk-YHZSBL2N.js";import{selectionToVisible as t,selectionToSource as n,richLayout as r,createHistory as l,colorRunOf as o,textRange as a,selectionBox as s,placeWindow as c,offsetOrigin as i,visibleArea as u,clearRangeOf as d,ColorWindow as p,markPress as h,pasteToMarkup as m,richInput as f,editVisible as g,MARKUP_CLIPBOARD_TYPE as y,markupOfRange as v}from"../chunk-HZSZT3BE.js";export{ColorWindow,MARKUP_CLIPBOARD_TYPE,TYPING_BURST_MS,clearRangeOf,colorRunOf,createHistory,editVisible,markupOfRange,newLine,pasteToMarkup,richInput,richLayout,selectionToSource,selectionToVisible,setBullet,startCanvasTyping,textMap,toSource,toSourceStart,toVisible}from"../chunk-HZSZT3BE.js";import{DEFAULT_COPY_WORDS as b}from"../chunk-KRL3IUV3.js";import{FieldNumber as k}from"../chunk-Y2T3JX7K.js";import{FieldSelect as x}from"../chunk-KFWNGPW3.js";import"../chunk-JACEEVVF.js";import{SettingsSwitch as S}from"../chunk-OECWLNKJ.js";import{SettingsField as E,SettingsSegmented as w}from"../chunk-CZAAGBVL.js";import{useWords as C}from"../chunk-MFIRYGHW.js";import{registerModalEscapeInterceptor as N,textToolbarRows as D,TextToolbar as T,textAlignWords as L,useShellStrings as O,textAlignOptions as R,TEXT_ALIGNS as K,LinkPicker as B,Tooltip as j,IconButton as F}from"efficient-shell/ui";export{TextToolbar}from"efficient-shell/ui";import{useRef as H,useState as V,useLayoutEffect as W,useEffect as $,useId as M}from"react";import{RETIRED_MARKS as z,applyMark as P,marksIn as I,STANDARD_MARKUP as q,listIn as A,colorIn as Z,clearStyle as U,spanFor as Y,findLink as G,tokenizeInline as _,colorOver as J,setList as X,unlinkAt as Q,removeLink as ee,linkOver as te,writeLink as ne}from"efficient-shell/markup";import{jsxs as re,jsx as le,Fragment as oe}from"react/jsx-runtime";import{ParagraphSpacingIcon as ae,LetterSpacingIcon as se,LineSpacingIcon as ce,TextSizeIcon as ie,StylesIcon as ue,TypeIcon as de,AlignmentIcon as pe,ListFormatIcon as he,CaseIcon as me,ItalicIcon as fe,NumberedListIcon as ge,ListIcon as ye,ListNoneIcon as ve,CaseLowerIcon as be,CaseCapitalizedIcon as ke,CaseUpperIcon as xe,CaseNormalIcon as Se}from"efficient-shell/icons/efficient";function Ee(e,t,n,r,l){for(const o of l){if(o.kind!==n)continue;if(!e.startsWith(o.open,t))continue;const l=t+o.open.length;if(e.startsWith(r,l)&&e.startsWith(o.close,l+r.length))return o}return null}function we({value:e,rules:t=q,className:n,layerRef:r}){const l=function(e,t){const n=[];let r=0;for(const l of _(e,t)){if("text"===l.kind){l.text.length>0&&(n.push({kind:"text",text:e.slice(r,r+l.text.length)}),r+=l.text.length);continue}const o=Ee(e,r,l.kind,l.text,t);if(!o)return[{kind:"text",text:e}];const a=r+o.open.length,s=a+l.text.length,c=s+o.close.length;n.push({kind:"delimiter",text:e.slice(r,a)}),n.push({kind:l.kind,text:e.slice(a,s)}),n.push({kind:"delimiter",text:e.slice(s,c)}),r=c}return n.map(e=>e.text).join("")!==e?[{kind:"text",text:e}]:n}(e,t);/* @__PURE__ */
2
2
  return le("div",{ref:r,className:["es-gold-layer",n??""].filter(Boolean).join(" "),"aria-hidden":"true",children:l.map((e,t)=>function(e,t){const{kind:n,text:r}=e;switch(n){case"delimiter":/* @__PURE__ */
3
3
  return le("span",{className:"es-gold-delim",children:r},t);case"accent":case"highlight":/* @__PURE__ */
4
4
  return le("em",{className:"es-gold-mark es-gold-accent",children:r},t);case"bold":/* @__PURE__ */
@@ -10,20 +10,20 @@ return le("span",{className:"es-gold-text",children:r},t)}}(e,t))})}function Ce(
10
10
  return re("div",{className:["es-gold",l?"es-gold-is-multiline":"es-gold-is-single",i?"es-gold-is-off":"",a??""].filter(Boolean).join(" "),children:[
11
11
  /* @__PURE__ */le(we,{value:e,rules:s,layerRef:d}),o&&""===e?
12
12
  /* @__PURE__ */le("div",{className:"es-gold-placeholder","aria-hidden":"true",children:o}):null,
13
- /* @__PURE__ */le("textarea",{ref:u,className:"es-gold-input",disabled:i,value:e,placeholder:o,"aria-label":c,onChange:function(e){h.current=!0,t(e.currentTarget.value)},onFocus:function(){p.current=e,h.current=!1},onBlur:function(){m(e)},onKeyDown:function(t){return"Escape"===t.key?(t.preventDefault(),h.current=!1,void r?.(p.current)):"Enter"!==t.key||l?void 0:(t.preventDefault(),void m(e))},onScroll:function(e){const t=d.current;t&&(t.scrollTop=e.currentTarget.scrollTop,t.scrollLeft=e.currentTarget.scrollLeft)}})]})}function Ne(e,t){const n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}}function De(e,t,n,r=P){const{start:l,end:o}=Ne(e,n);return r(e,l,o,t)}function Te(e,t,n){const{start:r,end:l}=Ne(e,n),o=r+t.length;return{text:e.slice(0,r)+t+e.slice(l),selectionStart:o,selectionEnd:o}}function Oe(e,t,n,r){switch(t){case"bold":return e.createElement("strong");case"italic":return e.createElement("em");case"strike":return e.createElement("s");case"underline":return e.createElement("u");case"sup":return e.createElement("sup");case"sub":return e.createElement("sub");case"color":{const t=e.createElement("span");return t.className="es-rich-color",r&&(t.dataset.color=r,t.title=r.startsWith("#")?r.toUpperCase():r,t.style.color=r.startsWith("#")?r:`var(--es-color-${r}, inherit)`),t}case"link":{const t=e.createElement("a");return t.className="es-rich-link",n&&(t.title=n),t}default:{const n=e.createElement("span");return n.className="highlight"===t||"accent"===t?"es-rich-emphasis":`es-rich-${t}`,n}}}function Le(e,t,n,r){const l=e.layout.lines;if(n===t)return r>=e.lines.length?e.layout.text.length:l[r].vis;const o=e.lines.findIndex(e=>e===n||e.contains(n));if(-1===o)return 0;const a=t.ownerDocument.createRange();a.setStart(e.lines[o],0);try{a.setEnd(n,r)}catch{return l[o].vis}return l[o].vis+Math.min(a.toString().length,l[o].text.length)}function Re(e,t){const n=e.layout.lines;let r=n.length-1;for(let e=0;e<n.length;e+=1)if(t<=n[e].vis+n[e].text.length){r=e;break}let l=Math.max(0,t-n[r].vis);const o=e.lines[r].ownerDocument.createTreeWalker(e.lines[r],4);let a=o.nextNode(),s=null;for(;a;){if(l<=a.data.length)return[a,l];l-=a.data.length,s=a,a=o.nextNode()}return s?[s,s.data.length]:[e.lines[r],0]}function Ke({value:e,rules:l,multiline:o,readOnly:a=!1,placeholder:s,ariaLabel:c,handle:i,onEdit:u,onSelect:d,onHistory:p,onFormat:h,pending:b,onCommit:k,onCancel:x}){const S=H(null),E=H(null),w=H(null),C=H(null),N=H(null),D=H(e),[T,O]=V(0),L=H({value:e,rules:l,multiline:o,readOnly:a,pending:b,onEdit:u,onHistory:p,onFormat:h});L.current={value:e,rules:l,multiline:o,readOnly:a,pending:b,onEdit:u,onHistory:p,onFormat:h};const R=()=>{const e=S.current,t=E.current,n=e?.ownerDocument.getSelection();if(!(e&&t&&n&&0!==n.rangeCount&&n.anchorNode&&e.contains(n.anchorNode)))return null;const r=Le(t,e,n.anchorNode,n.anchorOffset),l=n.focusNode&&e.contains(n.focusNode)?Le(t,e,n.focusNode,n.focusOffset):r;return r<=l?[r,l]:[l,r]},K=(e,t)=>{const n=S.current,r=E.current;if(!n||!r)return;const[l,o]=Re(r,e),[a,s]=Re(r,t);n.ownerDocument.getSelection()?.setBaseAndExtent(l,o,a,s)};i.current={getSource(){const e=R(),t=E.current;if(!e||!t)return null;const[r,l]=n(t.layout,e[0],e[1]);return{start:r,end:l}},setSource(e,t,n){C.current={text:n,src:[e,t]},O(e=>e+1)},focus(){S.current?.focus()},rangeOf(e,n){const r=S.current,l=E.current;if(!r||!l)return null;const[o,a]=t(l.layout,e,n),[s,c]=Re(l,o),[i,u]=Re(l,a),d=r.ownerDocument.createRange();return d.setStart(s,c),d.setEnd(i,u),d}},W(()=>{const n=S.current;if(!n||N.current)return;const o=C.current?null:R();E.current=function(e,t){const n=e.ownerDocument;e.replaceChildren();const r=t.lines.map(t=>{const r=n.createElement("div");r.className=null!=t.number?"es-rich-line is-numbered":t.bullet?"es-rich-line is-bullet":"es-rich-line",null!=t.number&&(r.dataset.number=t.number);const l=[],o=()=>l.length?l[l.length-1].el:r;let a=null;for(const e of t.chars){let t=0;for(;t<l.length&&t<e.marks.length&&l[t].id===e.marks[t].id;)t+=1;(l.length>t||e.marks.length>t)&&(a=null),l.length=t;for(let r=t;r<e.marks.length;r+=1){const t=Oe(n,e.marks[r].kind,e.marks[r].href,e.marks[r].color);o().appendChild(t),l.push({id:e.marks[r].id,el:t})}a||(a=n.createTextNode(""),o().appendChild(a)),a.data+=e.ch}return 0===t.chars.length&&r.appendChild(n.createElement("br")),e.appendChild(r),r});return{layout:t,lines:r}}(n,r(e,l)),w.current=e;const a=C.current;if(!a||a.text!==e)return void(o&&n.ownerDocument.activeElement===n&&K(o[0],Math.min(o[1],E.current.layout.text.length)));C.current=null;const s=E.current.layout,[c,i]=a.vis??t(s,a.src[0],a.src[1]);n.ownerDocument.activeElement!==n&&n.focus(),K(c,i)},[e,l,T]);const B=(e,t,r)=>{const l=E.current,[o,a]=n(l.layout,t[0],t[1]);C.current={text:e.text,vis:[e.caret,e.caret]},e.text!==L.current.value?L.current.onEdit(e.text,{start:o,end:a},r):O(e=>e+1)};$(()=>{const e=S.current;if(!e)return;const t=t=>{const{value:n,rules:r,multiline:l,readOnly:o,pending:a}=L.current;if("insertCompositionText"===t.inputType)return;if(t.preventDefault(),o)return;const s=E.current,c=R();if(!s||!c)return;const i="function"==typeof t.getTargetRanges?t.getTargetRanges()[0]:void 0,u=i&&!i.collapsed?[Le(s,e,i.startContainer,i.startOffset),Le(s,e,i.endContainer,i.endOffset)]:null,d=f({value:n,rules:r,multiline:l,inputType:t.inputType,data:t.data??t.dataTransfer?.getData("text/plain")??"",html:t.dataTransfer?.getData("text/html"),doc:e.ownerDocument,sel:c,target:u,pending:a});d&&("history"!==d.kind?"format"!==d.kind?B(d.edit,d.range,d.kind):L.current.onFormat(d.style):L.current.onHistory(d.dir))},n=()=>{N.current||O(e=>e+1)};return e.addEventListener("beforeinput",t),e.addEventListener("input",n),()=>{e.removeEventListener("beforeinput",t),e.removeEventListener("input",n)}},[]),$(()=>{const e=S.current;if(!e)return;const t=e.ownerDocument,n=()=>{const e=i.current?.getSource();e&&d(e)};return t.addEventListener("selectionchange",n),()=>t.removeEventListener("selectionchange",n)});const F=(t,n=!1)=>{const r=R();if(!r||r[0]===r[1])return;t.preventDefault();const o=E.current;t.clipboardData.setData("text/plain",o.layout.text.slice(r[0],r[1])),t.clipboardData.setData(y,v(e,l,r[0],r[1])),n&&!a&&B(g(e,l,r[0],r[1],{text:""}),r,"edit")};/* @__PURE__ */
13
+ /* @__PURE__ */le("textarea",{ref:u,className:"es-gold-input",disabled:i,value:e,placeholder:o,"aria-label":c,onChange:function(e){h.current=!0,t(e.currentTarget.value)},onFocus:function(){p.current=e,h.current=!1},onBlur:function(){m(e)},onKeyDown:function(t){return"Escape"===t.key?(t.preventDefault(),h.current=!1,void r?.(p.current)):"Enter"!==t.key||l?void 0:(t.preventDefault(),void m(e))},onScroll:function(e){const t=d.current;t&&(t.scrollTop=e.currentTarget.scrollTop,t.scrollLeft=e.currentTarget.scrollLeft)}})]})}function Ne(e,t){const n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}}function De(e,t,n,r=P){const{start:l,end:o}=Ne(e,n);return r(e,l,o,t)}function Te(e,t,n){const{start:r,end:l}=Ne(e,n),o=r+t.length;return{text:e.slice(0,r)+t+e.slice(l),selectionStart:o,selectionEnd:o}}function Le(e,t,n,r){switch(t){case"bold":return e.createElement("strong");case"italic":return e.createElement("em");case"strike":return e.createElement("s");case"underline":return e.createElement("u");case"sup":return e.createElement("sup");case"sub":return e.createElement("sub");case"color":{const t=e.createElement("span");return t.className="es-rich-color",r&&(t.dataset.color=r,t.title=r.startsWith("#")?r.toUpperCase():r,t.style.color=r.startsWith("#")?r:`var(--es-color-${r}, inherit)`),t}case"link":{const t=e.createElement("a");return t.className="es-rich-link",n&&(t.title=n),t}default:{const n=e.createElement("span");return n.className="highlight"===t||"accent"===t?"es-rich-emphasis":`es-rich-${t}`,n}}}function Oe(e,t,n,r){const l=e.layout.lines;if(n===t)return r>=e.lines.length?e.layout.text.length:l[r].vis;const o=e.lines.findIndex(e=>e===n||e.contains(n));if(-1===o)return 0;const a=t.ownerDocument.createRange();a.setStart(e.lines[o],0);try{a.setEnd(n,r)}catch{return l[o].vis}return l[o].vis+Math.min(a.toString().length,l[o].text.length)}function Re(e,t){const n=e.layout.lines;let r=n.length-1;for(let e=0;e<n.length;e+=1)if(t<=n[e].vis+n[e].text.length){r=e;break}let l=Math.max(0,t-n[r].vis);const o=e.lines[r].ownerDocument.createTreeWalker(e.lines[r],4);let a=o.nextNode(),s=null;for(;a;){if(l<=a.data.length)return[a,l];l-=a.data.length,s=a,a=o.nextNode()}return s?[s,s.data.length]:[e.lines[r],0]}function Ke({value:e,rules:l,multiline:o,readOnly:a=!1,placeholder:s,ariaLabel:c,handle:i,onEdit:u,onSelect:d,onHistory:p,onFormat:h,pending:b,onCommit:k,onCancel:x}){const S=H(null),E=H(null),w=H(null),C=H(null),N=H(null),D=H(e),[T,L]=V(0),O=H({value:e,rules:l,multiline:o,readOnly:a,pending:b,onEdit:u,onHistory:p,onFormat:h});O.current={value:e,rules:l,multiline:o,readOnly:a,pending:b,onEdit:u,onHistory:p,onFormat:h};const R=()=>{const e=S.current,t=E.current,n=e?.ownerDocument.getSelection();if(!(e&&t&&n&&0!==n.rangeCount&&n.anchorNode&&e.contains(n.anchorNode)))return null;const r=Oe(t,e,n.anchorNode,n.anchorOffset),l=n.focusNode&&e.contains(n.focusNode)?Oe(t,e,n.focusNode,n.focusOffset):r;return r<=l?[r,l]:[l,r]},K=(e,t)=>{const n=S.current,r=E.current;if(!n||!r)return;const[l,o]=Re(r,e),[a,s]=Re(r,t);n.ownerDocument.getSelection()?.setBaseAndExtent(l,o,a,s)};i.current={getSource(){const e=R(),t=E.current;if(!e||!t)return null;const[r,l]=n(t.layout,e[0],e[1]);return{start:r,end:l}},setSource(e,t,n){C.current={text:n,src:[e,t]},L(e=>e+1)},focus(){S.current?.focus()},rangeOf(e,n){const r=S.current,l=E.current;if(!r||!l)return null;const[o,a]=t(l.layout,e,n),[s,c]=Re(l,o),[i,u]=Re(l,a),d=r.ownerDocument.createRange();return d.setStart(s,c),d.setEnd(i,u),d}},W(()=>{const n=S.current;if(!n||N.current)return;const o=C.current?null:R();E.current=function(e,t){const n=e.ownerDocument;e.replaceChildren();const r=t.lines.map(t=>{const r=n.createElement("div");r.className=null!=t.number?"es-rich-line is-numbered":t.bullet?"es-rich-line is-bullet":"es-rich-line",null!=t.number&&(r.dataset.number=t.number);const l=[],o=()=>l.length?l[l.length-1].el:r;let a=null;for(const e of t.chars){let t=0;for(;t<l.length&&t<e.marks.length&&l[t].id===e.marks[t].id;)t+=1;(l.length>t||e.marks.length>t)&&(a=null),l.length=t;for(let r=t;r<e.marks.length;r+=1){const t=Le(n,e.marks[r].kind,e.marks[r].href,e.marks[r].color);o().appendChild(t),l.push({id:e.marks[r].id,el:t})}a||(a=n.createTextNode(""),o().appendChild(a)),a.data+=e.ch}return 0===t.chars.length&&r.appendChild(n.createElement("br")),e.appendChild(r),r});return{layout:t,lines:r}}(n,r(e,l)),w.current=e;const a=C.current;if(!a||a.text!==e)return void(o&&n.ownerDocument.activeElement===n&&K(o[0],Math.min(o[1],E.current.layout.text.length)));C.current=null;const s=E.current.layout,[c,i]=a.vis??t(s,a.src[0],a.src[1]);n.ownerDocument.activeElement!==n&&n.focus(),K(c,i)},[e,l,T]);const B=(e,t,r)=>{const l=E.current,[o,a]=n(l.layout,t[0],t[1]);C.current={text:e.text,vis:[e.caret,e.caret]},e.text!==O.current.value?O.current.onEdit(e.text,{start:o,end:a},r):L(e=>e+1)};$(()=>{const e=S.current;if(!e)return;const t=t=>{const{value:n,rules:r,multiline:l,readOnly:o,pending:a}=O.current;if("insertCompositionText"===t.inputType)return;if(t.preventDefault(),o)return;const s=E.current,c=R();if(!s||!c)return;const i="function"==typeof t.getTargetRanges?t.getTargetRanges()[0]:void 0,u=i&&!i.collapsed?[Oe(s,e,i.startContainer,i.startOffset),Oe(s,e,i.endContainer,i.endOffset)]:null,d=f({value:n,rules:r,multiline:l,inputType:t.inputType,data:t.data??t.dataTransfer?.getData("text/plain")??"",html:t.dataTransfer?.getData("text/html"),doc:e.ownerDocument,sel:c,target:u,pending:a});d&&("history"!==d.kind?"format"!==d.kind?B(d.edit,d.range,d.kind):O.current.onFormat(d.style):O.current.onHistory(d.dir))},n=()=>{N.current||L(e=>e+1)};return e.addEventListener("beforeinput",t),e.addEventListener("input",n),()=>{e.removeEventListener("beforeinput",t),e.removeEventListener("input",n)}},[]),$(()=>{const e=S.current;if(!e)return;const t=e.ownerDocument,n=()=>{const e=i.current?.getSource();e&&d(e)};return t.addEventListener("selectionchange",n),()=>t.removeEventListener("selectionchange",n)});const j=(t,n=!1)=>{const r=R();if(!r||r[0]===r[1])return;t.preventDefault();const o=E.current;t.clipboardData.setData("text/plain",o.layout.text.slice(r[0],r[1])),t.clipboardData.setData(y,v(e,l,r[0],r[1])),n&&!a&&B(g(e,l,r[0],r[1],{text:""}),r,"edit")};/* @__PURE__ */
14
14
  return re("div",{className:"es-rich-wrap",children:[s&&""===e?/* @__PURE__ */le("div",{className:"es-rich-placeholder","aria-hidden":"true",children:s}):null,
15
- /* @__PURE__ */le("div",{ref:S,className:`es-rich${o?" is-multiline":" is-single"}${a?" is-off":""}`,contentEditable:!a,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":o,"aria-label":c,"aria-readonly":a||void 0,"aria-placeholder":s,tabIndex:a?-1:0,spellCheck:!0,onFocus:()=>{D.current=e},onBlur:()=>{e!==D.current&&k?.(e),D.current=e},onKeyDown:t=>{if("Escape"===t.key)return t.preventDefault(),x?.(D.current),void(D.current=e);"Enter"!==t.key||o||(t.preventDefault(),e!==D.current&&k?.(e),D.current=e)},onCompositionStart:()=>{const e=R()??[0,0];N.current={from:e[0],to:e[1]}},onCompositionEnd:e=>{const t=N.current;if(N.current=null,!t)return;const{value:n,rules:r,pending:l}=L.current;e.data?B(g(n,r,t.from,t.to,{text:e.data,add:l?.add,drop:l?.drop,color:l?.color}),[t.from,t.to],"type"):O(e=>e+1)},onCopy:e=>F(e),onCut:e=>F(e,!0),onPaste:t=>{if(t.preventDefault(),a)return;const n=R();if(!n)return;const r=t.clipboardData.getData(y),s=r?o?r:r.replace(/\s*\r?\n\s*/g," "):m({html:t.clipboardData.getData("text/html"),text:t.clipboardData.getData("text/plain")},{doc:t.currentTarget.ownerDocument,multiline:o,rules:l});B(g(e,l,n[0],n[1],{markup:s}),n,"edit")}})]})}var Be={fontSize:{key:"fontSize",nameKey:"fontSize",icon:/* @__PURE__ */le(ie,{}),unit:"px",step:1,shiftStep:10,min:5},lineHeight:{key:"lineHeight",nameKey:"lineHeight",icon:/* @__PURE__ */le(ce,{}),unit:"%",step:1,shiftStep:10,min:50,max:250,scale:100},letterSpacing:{key:"letterSpacing",nameKey:"letterSpacing",icon:/* @__PURE__ */le(se,{}),unit:"px",step:.1,shiftStep:1,min:-10},paragraphSpacing:{key:"paragraphSpacing",nameKey:"paragraphSpacing",icon:/* @__PURE__ */le(ae,{}),unit:"px",step:1,shiftStep:10,min:0}};function Fe(e,t){return void 0===e?void 0:Number((e*t).toFixed(6))}function je({cells:e,words:t,readOnly:n=!1}){const r=t??b.cells,l=M();/* @__PURE__ */
15
+ /* @__PURE__ */le("div",{ref:S,className:`es-rich${o?" is-multiline":" is-single"}${a?" is-off":""}`,contentEditable:!a,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":o,"aria-label":c,"aria-readonly":a||void 0,"aria-placeholder":s,tabIndex:a?-1:0,spellCheck:!0,onFocus:()=>{D.current=e},onBlur:()=>{e!==D.current&&k?.(e),D.current=e},onKeyDown:t=>{if("Escape"===t.key)return t.preventDefault(),x?.(D.current),void(D.current=e);"Enter"!==t.key||o||(t.preventDefault(),e!==D.current&&k?.(e),D.current=e)},onCompositionStart:()=>{const e=R()??[0,0];N.current={from:e[0],to:e[1]}},onCompositionEnd:e=>{const t=N.current;if(N.current=null,!t)return;const{value:n,rules:r,pending:l}=O.current;e.data?B(g(n,r,t.from,t.to,{text:e.data,add:l?.add,drop:l?.drop,color:l?.color}),[t.from,t.to],"type"):L(e=>e+1)},onCopy:e=>j(e),onCut:e=>j(e,!0),onPaste:t=>{if(t.preventDefault(),a)return;const n=R();if(!n)return;const r=t.clipboardData.getData(y),s=r?o?r:r.replace(/\s*\r?\n\s*/g," "):m({html:t.clipboardData.getData("text/html"),text:t.clipboardData.getData("text/plain")},{doc:t.currentTarget.ownerDocument,multiline:o,rules:l});B(g(e,l,n[0],n[1],{markup:s}),n,"edit")}})]})}var Be={fontSize:{key:"fontSize",nameKey:"fontSize",icon:/* @__PURE__ */le(ie,{}),unit:"px",step:1,shiftStep:10,min:5},lineHeight:{key:"lineHeight",nameKey:"lineHeight",icon:/* @__PURE__ */le(ce,{}),unit:"%",step:1,shiftStep:10,min:50,max:250,scale:100},letterSpacing:{key:"letterSpacing",nameKey:"letterSpacing",icon:/* @__PURE__ */le(se,{}),unit:"px",step:.1,shiftStep:1,min:-10},paragraphSpacing:{key:"paragraphSpacing",nameKey:"paragraphSpacing",icon:/* @__PURE__ */le(ae,{}),unit:"px",step:1,shiftStep:10,min:0}};function je(e,t){return void 0===e?void 0:Number((e*t).toFixed(6))}function Fe({cells:e,words:t,readOnly:n=!1}){const r=t??b.cells,l=M();/* @__PURE__ */
16
16
  return le("div",{className:"es-copy-cells-fit",children:/* @__PURE__ */le("div",{className:"es-copy-cells",children:e.map(e=>{const t=e.scale??1,o=e.name??(e.nameKey?r[e.nameKey]:e.key),a=e.unit??"",s=e.step??1,c=`${l}-${e.key}`;/* @__PURE__ */
17
17
  return re("div",{className:"es-copy-cell",children:[
18
18
  /* @__PURE__ */le("label",{className:"es-field-label es-copy-cell-name",htmlFor:c,children:o}),
19
- /* @__PURE__ */le(k,{id:c,value:Fe(e.value,t),styleValue:Fe(e.styleValue,t),onChange:n=>e.onChange(void 0===n?void 0:Number((n/t).toFixed(6))),min:e.min,max:e.max,step:s,shiftStep:e.shiftStep,icon:e.icon,unit:a||void 0,steppers:"compact",readOnly:n,ariaLabel:o,title:r.tip({name:o,step:s,unit:a})})]},e.key)})})})}function He({target:e,onChange:t}){const n=H(null);return W(()=>{const t=n.current,r=e.current;t&&r&&r.value===t.text&&(n.current=null,r.focus(),r.setSelectionRange(t.start,t.end))}),r=>{const l=r(e.current);t(l.text),n.current={start:l.selectionStart,end:l.selectionEnd,text:l.text}}}var Ve=/* @__PURE__ */new Set([...z,"clear"]);function We({value:e,onChange:t,onCommit:n,onCancel:r,multiline:f=!1,placeholder:g,ariaLabel:y,className:v,readOnly:k=!1,rules:x,tools:E=[],writeMark:w,align:O,actions:L,toolbar:R,barLabel:K,renderFooter:F,inputRef:j,barShows:z="always",richText:G=!0,defaultShowMarks:ae=!1,colors:se,cells:ce,letterCase:ie,lastTool:ue}){const de=C("copy",b),pe=H(null),he=j??pe,[me,fe]=V(!1),[ge,ye]=V(null),ve=H(l()).current,be=H(null);$(()=>{const t=be.current;t&&e===t.to?be.current=null:t&&e===t.from||(be.current=null,ve.reset())},[e,ve]);const ke=n=>{be.current={from:be.current?.from??e,to:n},t(n)},xe=t=>({text:e,start:t?.selectionStart??ge?.start??e.length,end:t?.selectionEnd??ge?.end??e.length}),[Se,Ee]=V(ae),we=G&&!(f&&Se),Ne=H(null),Oe=M(),[Le,Re]=V(null),[Be,Fe]=V(!1),We=()=>{if(!we)return he.current;const e=Ne.current?.getSource()??ge;return e?{selectionStart:e.start,selectionEnd:e.end}:null},$e=He({target:he,onChange:ke}),Me=e=>(ye({start:e.selectionStart,end:e.selectionEnd}),e),ze=(t,n)=>{if(!we)return void $e(e=>(n&&ve.record(xe(e),"edit",Date.now()),Me(t(e))));const r=We(),l=Me(t(r));n&&ve.record(xe(r),"edit",Date.now()),Re(null),l.text!==e&&ke(l.text),Ne.current?.setSource(l.selectionStart,l.selectionEnd,l.text)},Pe=e=>ze(e,!0),Ie=e=>ze(t=>{const n=xe(t),r=ve[e](n);return r?{text:r.text,selectionStart:r.start,selectionEnd:r.end}:{text:n.text,selectionStart:n.start,selectionEnd:n.end}},!1),qe=H(null);W(()=>{const t=qe.current;t&&(qe.current=null,we?Ne.current?.setSource(t.start,t.end,e):(he.current?.focus(),he.current?.setSelectionRange(t.start,t.end),ye(t)))},[we]);const[Ue,Ye]=V(null),Ze=x??q,Ae=("string"==typeof E[0]?E:E.map(e=>e.style)).filter(e=>!Ve.has(e)),_e={};if(ge){const t=I(e,ge.start,ge.end,Ze);for(const e of Ae){const n=t.has(e)||"highlight"===e&&t.has("accent");_e[e]=!!Le?.add.includes(e)||!Le?.drop.includes(e)&&n}_e.link=t.has("link")}const Ge=()=>{const t=We(),n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}},Je=t=>{if("link"!==t&&A(0,t)){const{start:n,end:r}=Ge();if(n===r&&!we)return void Pe(n=>De(e,t,n,(e,t,n,r)=>P(e,t,n,r,Ze,de.placeholders)));const l=h({value:e,rules:Ze,start:n,end:r,style:t,pending:Le});return void("pending"===l.kind?Re(l.pending):Pe(()=>l.result))}if("link"!==t){const n=w??((e,t,n,r)=>P(e,t,n,r,q,de.placeholders));return void Pe(r=>De(e,t,r,n))}const n=We(),r=n?.selectionStart??e.length,l=n?.selectionEnd??r;Fe(!1),Ye({start:r,end:l,link:_(e,r,l)})},Qe=Boolean(ge&&ge.start!==ge.end),Xe=ge?U(e,ge.start,ge.end,Ze):null,et=ge?Le&&void 0!==Le.color&&Le.at===ge.start?Le.color:Y(e,ge.start,ge.end,Ze):null,tt=o(et,se),nt=t=>{we?t?Ne.current?.setSource(t.start,t.end,e):Ne.current?.focus():(he.current?.focus(),t&&he.current?.setSelectionRange(t.start,t.end))},rt=()=>{const e=Ue;Ye(null),nt(e?{start:e.start,end:e.end}:ge)},lt=()=>{const e=at.current,t=Boolean(e&&e.querySelector(".es-copy-colors")?.contains(e.ownerDocument.activeElement));Fe(!1),t&&nt(ge)},ot=H(lt);ot.current=lt,$(()=>{if(Be)return N(e=>{const t=at.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&(ot.current(),!0)},()=>at.current?.querySelector(".es-copy-colors"))},[Be]);const at=H(null),st=Be||null!==Ue;$(()=>{const e=at.current;if(!st||!e)return;const t=e.ownerDocument,n=()=>{Fe(!1),Ye(null)},r=t=>{e.contains(t.target)||n()};let l;const o=r=>{const o=r.relatedTarget;o?e.contains(o)||n():(clearTimeout(l),l=setTimeout(()=>{const r=t.activeElement;t.hasFocus()&&r&&r!==t.body&&!e.contains(r)&&n()},0))};return t.addEventListener("pointerdown",r,!0),e.addEventListener("focusout",o),()=>{clearTimeout(l),t.removeEventListener("pointerdown",r,!0),e.removeEventListener("focusout",o)}},[st]);const ct=Ue??(Be?ge??{start:e.length,end:e.length}:null),it=H(()=>{});it.current=()=>{const e=at.current,t=e?.querySelector(".rosh-tb-wrap > .es-copy-pop");if(!e||!t||!ct)return;const n=we?null:e.querySelector(".es-gold-layer"),r=we?Ne.current?.rangeOf(ct.start,ct.end)??null:n?a(n,ct.start,ct.end):null,l=r?.endContainer,o=l?1===l.nodeType?l:l.parentElement:null,d=r?s(r,o?.closest(".es-rich-line, .es-gold-layer")??null):null;if(!d)return;const p=c({anchor:d,size:{width:t.offsetWidth,height:t.offsetHeight},within:e.getBoundingClientRect(),clip:u(e),parent:i(t)});t.style.top=`${p.top}px`,t.style.left=`${p.left}px`,t.style.setProperty("--es-pop-point",`${p.point}px`),t.dataset.side=p.above?"above":"below"},W(()=>{const e=at.current;if(!st||!e)return;const t=()=>it.current();t();const n=e.ownerDocument.defaultView;n?.addEventListener("resize",t);const r=e.querySelector(".rosh-tb-wrap > .es-copy-pop"),l=n?.ResizeObserver,o=l&&r?new l(t):null;return o&&r&&o.observe(r),()=>{n?.removeEventListener("resize",t),o?.disconnect()}},[st,Be,Ue,ct?.start,ct?.end,we]);const ut="always"===z||me||null!==Ue||Be,dt=se&&se.length>0?{run:tt,open:Be,onToggle:()=>{Ye(null),Be?lt():Fe(!0)}}:void 0,pt=ut?ue?ue({className:"rosh-tb-btn",disabled:k,selected:Qe,keepCaret:e=>e.preventDefault(),insert:t=>Pe(n=>Te(e,t,n))}):"classic"===R?L:void 0:void 0,ht=new Set(Ae),mt=O?{value:O.value,allow:O.allow,onChange:O.onChange,disabled:O.disabled}:void 0,ft={pressed:Xe,onList:t=>{const{start:n,end:r}=Ge(),l=U(e,n,r,Ze);Pe(()=>Q(e,n,r,l===t?null:t,Ze))}},gt=d(ge,e.length),yt=k||Z(e,gt.start,gt.end,Ze).text===e?void 0:{onClear:()=>{const{start:t,end:n}=d(Ge(),e.length);Pe(()=>Z(e,t,n,Ze))}},vt=D({offered:ht,color:dt,last:pt,alignment:mt,list:ft,letterCase:ie,clear:yt});/* @__PURE__ */
20
- return re("div",{ref:at,className:"es-copy"+(v?` ${v}`:""),onFocus:()=>fe(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||fe(!1)},onKeyDown:e=>{const t=e.target===he.current||Boolean(e.target.closest?.(".es-rich"));if(k||!t)return;if(e.altKey||e.metaKey===e.ctrlKey)return;const n=e.key.toLowerCase(),r="KeyZ"===e.code||"z"===n,l=("KeyY"===e.code||"y"===n)&&!e.shiftKey;if(r||l)return e.preventDefault(),e.stopPropagation(),void Ie(l||e.shiftKey?"redo":"undo");const o={b:"bold",i:"italic",u:"underline",k:"link"}[`${e.shiftKey?"shift+":""}${n}`];o&&Ae.includes(o)&&(e.preventDefault(),e.stopPropagation(),Je(o))},onPaste:t=>{const n=he.current;if(k||!n||t.target!==n)return;t.preventDefault();const r=m({html:t.clipboardData.getData("text/html"),text:t.clipboardData.getData("text/plain")},{doc:n.ownerDocument,multiline:f,rules:Ze});Pe(t=>Te(e,r,t))},style:se&&se.length>0?Object.fromEntries(se.map(e=>[`--es-color-${e.name}`,e.value])):void 0,onSelect:()=>{const t=he.current;t&&t.ownerDocument.activeElement===t&&ye({start:t.selectionStart??e.length,end:t.selectionEnd??e.length})},children:[ut&&(vt.words||vt.paragraph)?
21
- /* @__PURE__ */le(T,{className:"es-copy-toolbar","aria-label":K??de.formatting,offered:ht,pressed:_e,onMark:e=>Je(e),color:dt,linkOpen:null!==Ue,last:pt,alignment:mt,list:ft,letterCase:ie,clear:yt,disabled:k,windows:/* @__PURE__ */re(oe,{children:[Be&&se&&se.length>0?/* @__PURE__ */le(p,{colors:se,current:et,words:de.colors??b.colors,onPick:t=>{const{start:n,end:r}=Ge();if(n!==r)Pe(()=>J(e,n,r,t,Ze));else{if(!we)return;Re({add:Le?.add??[],drop:Le?.drop??[],color:t,at:n})}}}):null,Ue?Ue&&/* @__PURE__ */le(B,{className:"es-copy-link es-copy-pop",value:Ue.link?.href??"",onApply:t=>{const n=Ue;Ye(null),Pe(()=>we?te(e,n.start,n.end,t,Ze):ne(e,n.start,n.end,t))},onRemove:Ue.link?()=>{const t=Ue.link,n=Ue;Ye(null),t&&Pe(()=>we?X(e,n.start,n.end,Ze):ee(e,t))}:void 0,onCancel:rt}):null]})}):null,ce&&ce.length>0?/* @__PURE__ */le(je,{cells:ce,words:de.cells??b.cells,readOnly:k}):null,we?/* @__PURE__ */le(Ke,{value:e,rules:Ze,multiline:f,readOnly:k,placeholder:g,ariaLabel:y,handle:Ne,pending:Le??void 0,onEdit:(t,n,r)=>{ve.record({text:e,start:n.start,end:n.end},r,Date.now()),Re(null),ke(t)},onSelect:e=>{ye(t=>t&&t.start===e.start&&t.end===e.end?t:e),!Le||e.start===Le.at&&e.end===Le.at||Re(null)},onHistory:Ie,onFormat:e=>{Ae.includes(e)&&Je(e)},onCommit:n,onCancel:r}):/* @__PURE__ */le(Ce,{value:e,onInput:e=>{ve.record(xe(null),"type",Date.now()),ke(e)},onCommit:n,onCancel:r,multiline:f,placeholder:g,ariaLabel:y,rules:x,disabled:k,inputRef:he,className:"es-copy-box"}),F?F({focused:me,insert:t=>Pe(n=>Te(e,t,n))}):null,G&&f?
19
+ /* @__PURE__ */le(k,{id:c,value:je(e.value,t),styleValue:je(e.styleValue,t),onChange:n=>e.onChange(void 0===n?void 0:Number((n/t).toFixed(6))),min:e.min,max:e.max,step:s,shiftStep:e.shiftStep,icon:e.icon,unit:a||void 0,steppers:"compact",readOnly:n,ariaLabel:o,title:r.tip({name:o,step:s,unit:a})})]},e.key)})})})}function He({target:e,onChange:t}){const n=H(null);return W(()=>{const t=n.current,r=e.current;t&&r&&r.value===t.text&&(n.current=null,r.focus(),r.setSelectionRange(t.start,t.end))}),r=>{const l=r(e.current);t(l.text),n.current={start:l.selectionStart,end:l.selectionEnd,text:l.text}}}var Ve=/* @__PURE__ */new Set([...z,"clear"]);function We({value:e,onChange:t,onCommit:n,onCancel:r,multiline:f=!1,placeholder:g,ariaLabel:y,className:v,readOnly:k=!1,rules:x,tools:E=[],writeMark:w,align:L,actions:O,toolbar:R,barLabel:K,renderFooter:j,inputRef:F,barShows:z="always",richText:_=!0,defaultShowMarks:ae=!1,colors:se,cells:ce,letterCase:ie,lastTool:ue}){const de=C("copy",b),pe=H(null),he=F??pe,[me,fe]=V(!1),[ge,ye]=V(null),ve=H(l()).current,be=H(null);$(()=>{const t=be.current;t&&e===t.to?be.current=null:t&&e===t.from||(be.current=null,ve.reset())},[e,ve]);const ke=n=>{be.current={from:be.current?.from??e,to:n},t(n)},xe=t=>({text:e,start:t?.selectionStart??ge?.start??e.length,end:t?.selectionEnd??ge?.end??e.length}),[Se,Ee]=V(ae),we=_&&!(f&&Se),Ne=H(null),Le=M(),[Oe,Re]=V(null),[Be,je]=V(!1),We=()=>{if(!we)return he.current;const e=Ne.current?.getSource()??ge;return e?{selectionStart:e.start,selectionEnd:e.end}:null},$e=He({target:he,onChange:ke}),Me=e=>(ye({start:e.selectionStart,end:e.selectionEnd}),e),ze=(t,n)=>{if(!we)return void $e(e=>(n&&ve.record(xe(e),"edit",Date.now()),Me(t(e))));const r=We(),l=Me(t(r));n&&ve.record(xe(r),"edit",Date.now()),Re(null),l.text!==e&&ke(l.text),Ne.current?.setSource(l.selectionStart,l.selectionEnd,l.text)},Pe=e=>ze(e,!0),Ie=e=>ze(t=>{const n=xe(t),r=ve[e](n);return r?{text:r.text,selectionStart:r.start,selectionEnd:r.end}:{text:n.text,selectionStart:n.start,selectionEnd:n.end}},!1),qe=H(null);W(()=>{const t=qe.current;t&&(qe.current=null,we?Ne.current?.setSource(t.start,t.end,e):(he.current?.focus(),he.current?.setSelectionRange(t.start,t.end),ye(t)))},[we]);const[Ae,Ze]=V(null),Ue=x??q,Ye=("string"==typeof E[0]?E:E.map(e=>e.style)).filter(e=>!Ve.has(e)),Ge={};if(ge){const t=I(e,ge.start,ge.end,Ue);for(const e of Ye){const n=t.has(e)||"highlight"===e&&t.has("accent");Ge[e]=!!Oe?.add.includes(e)||!Oe?.drop.includes(e)&&n}Ge.link=t.has("link")}const _e=()=>{const t=We(),n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}},Je=t=>{if("link"!==t&&Y(0,t)){const{start:n,end:r}=_e();if(n===r&&!we)return void Pe(n=>De(e,t,n,(e,t,n,r)=>P(e,t,n,r,Ue,de.placeholders)));const l=h({value:e,rules:Ue,start:n,end:r,style:t,pending:Oe});return void("pending"===l.kind?Re(l.pending):Pe(()=>l.result))}if("link"!==t){const n=w??((e,t,n,r)=>P(e,t,n,r,q,de.placeholders));return void Pe(r=>De(e,t,r,n))}const n=We(),r=n?.selectionStart??e.length,l=n?.selectionEnd??r;je(!1),Ze({start:r,end:l,link:G(e,r,l)})},Xe=Boolean(ge&&ge.start!==ge.end),Qe=ge?A(e,ge.start,ge.end,Ue):null,et=ge?Oe&&void 0!==Oe.color&&Oe.at===ge.start?Oe.color:Z(e,ge.start,ge.end,Ue):null,tt=o(et,se),nt=t=>{we?t?Ne.current?.setSource(t.start,t.end,e):Ne.current?.focus():(he.current?.focus(),t&&he.current?.setSelectionRange(t.start,t.end))},rt=()=>{const e=Ae;Ze(null),nt(e?{start:e.start,end:e.end}:ge)},lt=()=>{const e=at.current,t=Boolean(e&&e.querySelector(".es-copy-colors")?.contains(e.ownerDocument.activeElement));je(!1),t&&nt(ge)},ot=H(lt);ot.current=lt,$(()=>{if(Be)return N(e=>{const t=at.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&(ot.current(),!0)},()=>at.current?.querySelector(".es-copy-colors"))},[Be]);const at=H(null),st=Be||null!==Ae;$(()=>{const e=at.current;if(!st||!e)return;const t=e.ownerDocument,n=()=>{je(!1),Ze(null)},r=t=>{e.contains(t.target)||n()};let l;const o=r=>{const o=r.relatedTarget;o?e.contains(o)||n():(clearTimeout(l),l=setTimeout(()=>{const r=t.activeElement;t.hasFocus()&&r&&r!==t.body&&!e.contains(r)&&n()},0))};return t.addEventListener("pointerdown",r,!0),e.addEventListener("focusout",o),()=>{clearTimeout(l),t.removeEventListener("pointerdown",r,!0),e.removeEventListener("focusout",o)}},[st]);const ct=Ae??(Be?ge??{start:e.length,end:e.length}:null),it=H(()=>{});it.current=()=>{const e=at.current,t=e?.querySelector(".rosh-tb-wrap > .es-copy-pop");if(!e||!t||!ct)return;const n=we?null:e.querySelector(".es-gold-layer"),r=we?Ne.current?.rangeOf(ct.start,ct.end)??null:n?a(n,ct.start,ct.end):null,l=r?.endContainer,o=l?1===l.nodeType?l:l.parentElement:null,d=r?s(r,o?.closest(".es-rich-line, .es-gold-layer")??null):null;if(!d)return;const p=c({anchor:d,size:{width:t.offsetWidth,height:t.offsetHeight},within:e.getBoundingClientRect(),clip:u(e),parent:i(t)});t.style.top=`${p.top}px`,t.style.left=`${p.left}px`,t.style.setProperty("--es-pop-point",`${p.point}px`),t.dataset.side=p.above?"above":"below"},W(()=>{const e=at.current;if(!st||!e)return;const t=()=>it.current();t();const n=e.ownerDocument.defaultView;n?.addEventListener("resize",t);const r=e.querySelector(".rosh-tb-wrap > .es-copy-pop"),l=n?.ResizeObserver,o=l&&r?new l(t):null;return o&&r&&o.observe(r),()=>{n?.removeEventListener("resize",t),o?.disconnect()}},[st,Be,Ae,ct?.start,ct?.end,we]);const ut="always"===z||me||null!==Ae||Be,dt=se&&se.length>0?{run:tt,open:Be,onToggle:()=>{Ze(null),Be?lt():je(!0)}}:void 0,pt=ut?ue?ue({className:"rosh-tb-btn",disabled:k,selected:Xe,keepCaret:e=>e.preventDefault(),insert:t=>Pe(n=>Te(e,t,n))}):"classic"===R?O:void 0:void 0,ht=new Set(Ye),mt=L?{value:L.value,allow:L.allow,onChange:L.onChange,disabled:L.disabled}:void 0,ft={pressed:Qe,onList:t=>{const{start:n,end:r}=_e(),l=A(e,n,r,Ue);Pe(()=>X(e,n,r,l===t?null:t,Ue))}},gt=d(ge,e.length),yt=k||U(e,gt.start,gt.end,Ue).text===e?void 0:{onClear:()=>{const{start:t,end:n}=d(_e(),e.length);Pe(()=>U(e,t,n,Ue))}},vt=D({offered:ht,color:dt,last:pt,alignment:mt,list:ft,letterCase:ie,clear:yt});/* @__PURE__ */
20
+ return re("div",{ref:at,className:"es-copy"+(v?` ${v}`:""),onFocus:()=>fe(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||fe(!1)},onKeyDown:e=>{const t=e.target===he.current||Boolean(e.target.closest?.(".es-rich"));if(k||!t)return;if(e.altKey||e.metaKey===e.ctrlKey)return;const n=e.key.toLowerCase(),r="KeyZ"===e.code||"z"===n,l=("KeyY"===e.code||"y"===n)&&!e.shiftKey;if(r||l)return e.preventDefault(),e.stopPropagation(),void Ie(l||e.shiftKey?"redo":"undo");const o={b:"bold",i:"italic",u:"underline",k:"link"}[`${e.shiftKey?"shift+":""}${n}`];o&&Ye.includes(o)&&(e.preventDefault(),e.stopPropagation(),Je(o))},onPaste:t=>{const n=he.current;if(k||!n||t.target!==n)return;t.preventDefault();const r=m({html:t.clipboardData.getData("text/html"),text:t.clipboardData.getData("text/plain")},{doc:n.ownerDocument,multiline:f,rules:Ue});Pe(t=>Te(e,r,t))},style:se&&se.length>0?Object.fromEntries(se.map(e=>[`--es-color-${e.name}`,e.value])):void 0,onSelect:()=>{const t=he.current;t&&t.ownerDocument.activeElement===t&&ye({start:t.selectionStart??e.length,end:t.selectionEnd??e.length})},children:[ut&&(vt.words||vt.paragraph)?
21
+ /* @__PURE__ */le(T,{className:"es-copy-toolbar","aria-label":K??de.formatting,offered:ht,pressed:Ge,onMark:e=>Je(e),color:dt,linkOpen:null!==Ae,last:pt,alignment:mt,list:ft,letterCase:ie,clear:yt,disabled:k,windows:/* @__PURE__ */re(oe,{children:[Be&&se&&se.length>0?/* @__PURE__ */le(p,{colors:se,current:et,words:de.colors??b.colors,onPick:t=>{const{start:n,end:r}=_e();if(n!==r)Pe(()=>J(e,n,r,t,Ue));else{if(!we)return;Re({add:Oe?.add??[],drop:Oe?.drop??[],color:t,at:n})}}}):null,Ae?Ae&&/* @__PURE__ */le(B,{className:"es-copy-link es-copy-pop",value:Ae.link?.href??"",onApply:t=>{const n=Ae;Ze(null),Pe(()=>we?te(e,n.start,n.end,t,Ue):ne(e,n.start,n.end,t))},onRemove:Ae.link?()=>{const t=Ae.link,n=Ae;Ze(null),t&&Pe(()=>we?Q(e,n.start,n.end,Ue):ee(e,t))}:void 0,onCancel:rt}):null]})}):null,ce&&ce.length>0?/* @__PURE__ */le(Fe,{cells:ce,words:de.cells??b.cells,readOnly:k}):null,we?/* @__PURE__ */le(Ke,{value:e,rules:Ue,multiline:f,readOnly:k,placeholder:g,ariaLabel:y,handle:Ne,pending:Oe??void 0,onEdit:(t,n,r)=>{ve.record({text:e,start:n.start,end:n.end},r,Date.now()),Re(null),ke(t)},onSelect:e=>{ye(t=>t&&t.start===e.start&&t.end===e.end?t:e),!Oe||e.start===Oe.at&&e.end===Oe.at||Re(null)},onHistory:Ie,onFormat:e=>{Ye.includes(e)&&Je(e)},onCommit:n,onCancel:r}):/* @__PURE__ */le(Ce,{value:e,onInput:e=>{ve.record(xe(null),"type",Date.now()),ke(e)},onCommit:n,onCancel:r,multiline:f,placeholder:g,ariaLabel:y,rules:x,disabled:k,inputRef:he,className:"es-copy-box"}),j?j({focused:me,insert:t=>Pe(n=>Te(e,t,n))}):null,_&&f?
22
22
  /* @__PURE__ */re("div",{className:"es-copy-marks",children:[
23
- /* @__PURE__ */le(S,{checked:Se,onChange:()=>{const e=We();qe.current=e&&null!==e.selectionStart&&null!==e.selectionEnd?{start:e.selectionStart,end:e.selectionEnd}:ge,Re(null),Ee(e=>!e)},ariaLabelledBy:Oe,disabled:k}),
24
- /* @__PURE__ */le("span",{id:Oe,className:"es-copy-marks-label",children:de.showMarks??"Show marks"})]}):null]})}var $e=["none","bullet","number"],Me=e,ze={none:/* @__PURE__ */le(ve,{}),bullet:/* @__PURE__ */le(ye,{}),number:/* @__PURE__ */le(ge,{})},Pe={none:/* @__PURE__ */le(Se,{}),upper:/* @__PURE__ */le(xe,{}),capitalize:/* @__PURE__ */le(ke,{}),lower:/* @__PURE__ */le(be,{})};function Ie({label:e,icon:t,answers:n,names:r,glyphs:l,row:o,readOnly:a}){const s=o.value||o.styleValue||"";/* @__PURE__ */
25
- return le(E,{label:e,icon:t,children:/* @__PURE__ */le(w,{ariaLabel:e,value:s,disabled:a,onChange:e=>{a||o.onChange(function(e,t){return t===e.value||""===e.value&&t===e.styleValue?"":t}(o,e))},options:n.map(e=>({id:e,label:l[e],title:r[e]}))})})}function qe({kept:e,keptHint:t,readOnly:n=!1,style:r,font:l,italic:o,cells:a,align:s,list:c,letterCase:i}){const u=C("copy",b),d=O(L().textToolbar),p=Object.fromEntries(R(K).map(e=>[e.value,e.icon])),h={...b.panel,...u.panel},m=r&&!n?[r.onEditStyles&&{label:h.editStyles,onSelect:r.onEditStyles},r.onUpdateStyle&&{label:h.updateStyle,onSelect:r.onUpdateStyle}].filter(e=>!!e):[],f=!!o&&(o.value??o.styleValue??!1),g=o?/* @__PURE__ */le(F,{content:h.italic,children:/* @__PURE__ */le(j,{size:"md",variant:"ghost","aria-label":h.italic,"aria-pressed":f,disabled:n,onClick:()=>{if(n)return;const e=!f;o.onChange(e===(o.styleValue??!1)?void 0:e)},children:/* @__PURE__ */le(fe,{})})}):null;/* @__PURE__ */
23
+ /* @__PURE__ */le(S,{checked:Se,onChange:()=>{const e=We();qe.current=e&&null!==e.selectionStart&&null!==e.selectionEnd?{start:e.selectionStart,end:e.selectionEnd}:ge,Re(null),Ee(e=>!e)},ariaLabelledBy:Le,disabled:k}),
24
+ /* @__PURE__ */le("span",{id:Le,className:"es-copy-marks-label",children:de.showMarks??"Show marks"})]}):null]})}var $e=["none","bullet","number"],Me=e,ze={none:/* @__PURE__ */le(ve,{}),bullet:/* @__PURE__ */le(ye,{}),number:/* @__PURE__ */le(ge,{})},Pe={none:/* @__PURE__ */le(Se,{}),upper:/* @__PURE__ */le(xe,{}),capitalize:/* @__PURE__ */le(ke,{}),lower:/* @__PURE__ */le(be,{})};function Ie({label:e,icon:t,answers:n,names:r,glyphs:l,row:o,readOnly:a}){const s=o.value||o.styleValue||"";/* @__PURE__ */
25
+ return le(E,{label:e,icon:t,children:/* @__PURE__ */le(w,{ariaLabel:e,value:s,disabled:a,onChange:e=>{a||o.onChange(function(e,t){return t===e.value||""===e.value&&t===e.styleValue?"":t}(o,e))},options:n.map(e=>({id:e,label:l[e],title:r[e]}))})})}function qe({kept:e,keptHint:t,readOnly:n=!1,style:r,font:l,italic:o,cells:a,align:s,list:c,letterCase:i}){const u=C("copy",b),d=L(O().textToolbar),p=Object.fromEntries(R(K).map(e=>[e.value,e.icon])),h={...b.panel,...u.panel},m=r&&!n?[r.onEditStyles&&{label:h.editStyles,onSelect:r.onEditStyles},r.onUpdateStyle&&{label:h.updateStyle,onSelect:r.onUpdateStyle}].filter(e=>!!e):[],f=!!o&&(o.value??o.styleValue??!1),g=o?/* @__PURE__ */le(j,{content:h.italic,children:/* @__PURE__ */le(F,{size:"md",variant:"ghost","aria-label":h.italic,"aria-pressed":f,disabled:n,onClick:()=>{if(n)return;const e=!f;o.onChange(e===(o.styleValue??!1)?void 0:e)},children:/* @__PURE__ */le(fe,{})})}):null;/* @__PURE__ */
26
26
  return re("div",{className:"es-tpp",children:[e?/* @__PURE__ */re("div",{className:"es-tpp-kept",children:[
27
27
  /* @__PURE__ */le(We,{...e,readOnly:n||e.readOnly}),t?/* @__PURE__ */le("p",{className:"es-field-hint",children:t}):null]}):null,r?/* @__PURE__ */le(E,{label:h.style,icon:/* @__PURE__ */le(ue,{}),children:/* @__PURE__ */le(x,{ariaLabel:h.style,value:r.value,options:r.options,onChange:r.onChange,changed:r.changed,footer:m,readOnly:n})}):null,l?/* @__PURE__ */le(E,{label:h.font,icon:/* @__PURE__ */le(de,{}),children:/* @__PURE__ */re("div",{className:"es-tpp-font",children:[
28
28
  /* @__PURE__ */le("div",{className:"es-tpp-font-select",children:/* @__PURE__ */le(x,{ariaLabel:h.font,value:l.value||void 0,placeholder:l.styleValue,options:l.options,onChange:l.onChange,searchable:l.searchable,readOnly:n})}),g]})}):g?
29
- /* @__PURE__ */le(E,{label:h.italic,icon:/* @__PURE__ */le(de,{}),children:/* @__PURE__ */le("div",{className:"es-tpp-font",children:g})}):null,a?.length?/* @__PURE__ */le(je,{cells:a,words:u.cells,readOnly:n}):null,s?/* @__PURE__ */le(Ie,{label:u.alignment,icon:/* @__PURE__ */le(pe,{}),answers:K.filter(e=>!s.allow||s.allow.includes(e)),names:d,glyphs:p,row:s,readOnly:n}):null,c?/* @__PURE__ */le(Ie,{label:h.list,icon:/* @__PURE__ */le(he,{}),answers:$e,names:h.lists,glyphs:ze,row:c,readOnly:n}):null,i?/* @__PURE__ */le(Ie,{label:h.capitalization,icon:/* @__PURE__ */le(me,{}),answers:Me,names:h.cases,glyphs:Pe,row:i,readOnly:n}):null]})}export{Be as COPY_CELLS,We as CopyBox,je as CopyCells,Ke as RichBox,qe as TextPartPanel,Te as insertSelection,De as markSelection,He as useCaretEdit};
29
+ /* @__PURE__ */le(E,{label:h.italic,icon:/* @__PURE__ */le(de,{}),children:/* @__PURE__ */le("div",{className:"es-tpp-font",children:g})}):null,a?.length?/* @__PURE__ */le(Fe,{cells:a,words:u.cells,readOnly:n}):null,s?/* @__PURE__ */le(Ie,{label:u.alignment,icon:/* @__PURE__ */le(pe,{}),answers:K.filter(e=>!s.allow||s.allow.includes(e)),names:d,glyphs:p,row:s,readOnly:n}):null,c?/* @__PURE__ */le(Ie,{label:h.list,icon:/* @__PURE__ */le(he,{}),answers:$e,names:h.lists,glyphs:ze,row:c,readOnly:n}):null,i?/* @__PURE__ */le(Ie,{label:h.capitalization,icon:/* @__PURE__ */le(me,{}),answers:Me,names:h.cases,glyphs:Pe,row:i,readOnly:n}):null]})}export{Be as COPY_CELLS,We as CopyBox,Fe as CopyCells,Ke as RichBox,qe as TextPartPanel,Te as insertSelection,De as markSelection,He as useCaretEdit};
@@ -1 +1 @@
1
- export{SCALAR_TEXT_CONTROLS,TEXT_CONTROL_KINDS}from"../chunk-I6SK6ZDT.js";export{AUTO_RULES,FOLLOW_RULES,VIEW_DESKTOP_MIN,VIEW_TABLET_MIN,VIEW_TIERS,VIEW_TIER_LABEL,isAuto,phoneKey,resolveViewValue,tabletKey,viewTierForWidth}from"../chunk-E52W3M5I.js";export{rootRowName,sectionRenameProp,slotChildName,slotChildRenameProp,slotChildRowName}from"../chunk-SSRYU3YG.js";export{HERO_SLIDER_GOTO_EVENT}from"../chunk-AJ2SUSET.js";export{ANCHOR_FIELD_KEYS,FOLD_FIELD_MARKER,LINK_FIELD_MARKER,MEDIA_FIELD_MARKER,SCAFFOLD_FIELD_MARKER,TEXT_FIELD_MARKER,foldMetaOf,textFieldIdentifier}from"../chunk-ANPOR6EY.js";export{hidableText,readHidable}from"../chunk-6UAEFOJ4.js";export{PART_SEP,decodePartId,encodePartId}from"../chunk-R4AUZVA3.js";export{FOOTER_TYPE,HEADER_TYPE,ROOT_ZONE,TREE_MAX_DEPTH,blockNodeActions,childSlotsOf,locateNode,missingPinnedTypes,nestsInTree,newNodeId,pinnedDuplicateIds,pinnedDuplicateIndices,slotChildrenIn,slotFieldsOf}from"../chunk-TCAAOYQY.js";export{TEXT_STYLE_CASES,TEXT_STYLE_CASE_CSS,isTextStyleCase,textStyleCaseCss,textStyleCaseOfCss}from"../chunk-YHZSBL2N.js";export{REPEAT_ATTRIBUTE,REPEAT_INDEX_ATTRIBUTE}from"../chunk-LF3FUSCQ.js";
1
+ export{SCALAR_TEXT_CONTROLS,TEXT_CONTROL_KINDS}from"../chunk-I6SK6ZDT.js";export{AUTO_RULES,FOLLOW_RULES,VIEW_DESKTOP_MIN,VIEW_TABLET_MIN,VIEW_TIERS,VIEW_TIER_LABEL,isAuto,phoneKey,resolveViewValue,tabletKey,viewTierForWidth}from"../chunk-E52W3M5I.js";export{rootRowName,sectionRenameProp,slotChildName,slotChildRenameProp,slotChildRowName}from"../chunk-5NHQ452C.js";export{hidableText,readHidable}from"../chunk-6UAEFOJ4.js";export{HERO_SLIDER_GOTO_EVENT}from"../chunk-AJ2SUSET.js";export{ANCHOR_FIELD_KEYS,FOLD_FIELD_MARKER,LINK_FIELD_MARKER,MEDIA_FIELD_MARKER,SCAFFOLD_FIELD_MARKER,TEXT_FIELD_MARKER,foldMetaOf,textFieldIdentifier}from"../chunk-ANPOR6EY.js";export{PART_SEP,decodePartId,encodePartId}from"../chunk-R4AUZVA3.js";export{FOOTER_TYPE,HEADER_TYPE,ROOT_ZONE,TREE_MAX_DEPTH,blockNodeActions,childSlotsOf,locateNode,missingPinnedTypes,nestsInTree,newNodeId,pinnedDuplicateIds,pinnedDuplicateIndices,slotChildrenIn,slotFieldsOf}from"../chunk-TCAAOYQY.js";export{TEXT_STYLE_CASES,TEXT_STYLE_CASE_CSS,isTextStyleCase,textStyleCaseCss,textStyleCaseOfCss}from"../chunk-YHZSBL2N.js";export{REPEAT_ATTRIBUTE,REPEAT_INDEX_ATTRIBUTE}from"../chunk-LF3FUSCQ.js";
@@ -1 +1 @@
1
- export{CanvasFrame,CanvasPartsContext,CanvasPassThroughContext,CanvasSharedContext,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,partHasOwnBox,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useRootFields,useSelectedFields,validSelection}from"../chunk-FEF3OQRT.js";import"../chunk-RPMSET77.js";import"../chunk-TBY3DFKS.js";import"../chunk-AGWKB77Q.js";import"../chunk-HZSZT3BE.js";import"../chunk-KRL3IUV3.js";import"../chunk-MFIRYGHW.js";import"../chunk-YU3WHLGI.js";import"../chunk-LF3FUSCQ.js";import"../chunk-TGZCD6IP.js";import"../chunk-KXM6YRG2.js";
1
+ export{CanvasFrame,CanvasPartsContext,CanvasPassThroughContext,CanvasSharedContext,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,partHasOwnBox,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useRootFields,useSelectedFields,validSelection}from"../chunk-VBOSOH5M.js";import"../chunk-TBY3DFKS.js";import"../chunk-AGWKB77Q.js";import"../chunk-RPMSET77.js";import"../chunk-HZSZT3BE.js";import"../chunk-KRL3IUV3.js";import"../chunk-MFIRYGHW.js";import"../chunk-YU3WHLGI.js";import"../chunk-LF3FUSCQ.js";import"../chunk-TGZCD6IP.js";import"../chunk-KXM6YRG2.js";
@@ -1 +1 @@
1
- export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,fieldShownInView,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-6QSFJCJT.js";export{fieldIsShown,showWhenOf,shownFields,withShowWhen}from"../chunk-BPXEFVSQ.js";import"../chunk-YCSZAP7T.js";import"../chunk-WHS6Y55E.js";import"../chunk-K56YDHYQ.js";export{FieldSlider}from"../chunk-ZEH6QLBH.js";export{useResolvedFields}from"../chunk-AGWKB77Q.js";import"../chunk-FIVU2COQ.js";import"../chunk-FM6JO4WF.js";import"../chunk-KFV7N2DJ.js";export{FieldNumber}from"../chunk-Y2T3JX7K.js";export{FieldSelect,optionFor}from"../chunk-KFWNGPW3.js";import"../chunk-JACEEVVF.js";import"../chunk-S3DUFDQ6.js";import"../chunk-MFIRYGHW.js";import"../chunk-6NJHYXJM.js";import"../chunk-P2VEMZH5.js";import"../chunk-TGZCD6IP.js";import"../chunk-KXM6YRG2.js";
1
+ export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,fieldShownInView,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-H4Z2V56N.js";export{fieldIsShown,showWhenOf,shownFields,withShowWhen}from"../chunk-BPXEFVSQ.js";import"../chunk-YCSZAP7T.js";import"../chunk-WHS6Y55E.js";import"../chunk-K56YDHYQ.js";export{FieldSlider}from"../chunk-ZEH6QLBH.js";export{useResolvedFields}from"../chunk-AGWKB77Q.js";import"../chunk-FIVU2COQ.js";import"../chunk-FM6JO4WF.js";import"../chunk-KFV7N2DJ.js";export{FieldNumber}from"../chunk-Y2T3JX7K.js";export{FieldSelect,optionFor}from"../chunk-KFWNGPW3.js";import"../chunk-JACEEVVF.js";import"../chunk-CZAAGBVL.js";import"../chunk-MFIRYGHW.js";import"../chunk-6NJHYXJM.js";import"../chunk-P2VEMZH5.js";import"../chunk-TGZCD6IP.js";import"../chunk-KXM6YRG2.js";
@@ -1,15 +1 @@
1
- export{DESIGN_GROUPS,SETTINGS_BUCKETS,SettingsGroup}from"../chunk-FM6JO4WF.js";import{DEFAULT_PANEL_WORDS as e}from"../chunk-KFV7N2DJ.js";export{SettingsSwitch}from"../chunk-OECWLNKJ.js";import{SettingsField as l,SettingsSegmented as n}from"../chunk-S3DUFDQ6.js";export{SettingsField,SettingsSegmented}from"../chunk-S3DUFDQ6.js";import{AccordionHeading as a,SettingReset as t,Tooltip as i}from"efficient-shell/ui";export{BorderInput as SettingsBorder,CornersInput as SettingsCorners,AlignmentGrid as SettingsPlacement,SidesInput as SettingsSides,SidesEachToggle as SettingsSidesEach,borderSides,borderStartEach,sidesStartEach}from"efficient-shell/ui";import{jsx as s,jsxs as d,Fragment as o}from"react/jsx-runtime";import{BackgroundIcon as r,WidthIcon as c}from"efficient-shell/icons/efficient";function u({title:e,level:l=3,id:n,className:t}){/* @__PURE__ */
2
- return s(a,{title:e,level:l,id:n,className:t?`es-panel-band ${t}`:"es-panel-band"})}function h({title:e,level:l=4,id:n,className:t}){/* @__PURE__ */
3
- return s(a,{tier:"row",title:e,level:l,id:n,className:t})}function b({label:l,changed:n,onReset:a,detail:i,disabled:d,defaultAction:o,words:r,className:c}){const u={...e,...r},h=u.resetName({label:l});/* @__PURE__ */
4
- return s(t,{label:l,changed:n,onReset:a,detail:i,disabled:d,defaultAction:o,name:h,tip:i?u.resetTitle({label:l,detail:i}):h,className:c})}function m({name:e,preview:l,offPage:n,status:a,onOpen:t,id:r,className:c}){const u=null!=l;/* @__PURE__ */
5
- return d("button",{type:"button",id:r,className:c?`es-drill ${c}`:"es-drill",onClick:t,children:[
6
- /* @__PURE__ */d(i,{content:u?/* @__PURE__ */d(o,{children:[e,
7
- /* @__PURE__ */s("br",{}),l]}):e,describe:!1,className:"es-drill-text",children:[
8
- /* @__PURE__ */s("span",{className:"es-drill-name",children:e}),u?/* @__PURE__ */s("span",{className:n?"es-drill-preview is-offpage":"es-drill-preview",children:l}):null]}),a?/* @__PURE__ */s("span",{className:"es-drill-status",children:a}):null,
9
- /* @__PURE__ */s("span",{className:"es-drill-chev","aria-hidden":"true"})]})}function f({label:e,onPress:l,disabled:n,note:a,done:t,doneLabel:i,icon:o,id:r,className:c}){const u=void 0===i?e:i,h=t?u:e,b=null!=a,m=b&&r?`${r}-note`:void 0;/* @__PURE__ */
10
- return d("div",{className:c?`es-action-wrap ${c}`:"es-action-wrap",children:[
11
- /* @__PURE__ */d("button",{type:"button",id:r,className:t?"es-action is-done":"es-action",disabled:n,"aria-describedby":m,onClick:l,children:[o?/* @__PURE__ */s("span",{className:"es-action-icon","aria-hidden":"true",children:o}):null,
12
- /* @__PURE__ */s("span",{className:"es-action-label",children:h})]}),b?/* @__PURE__ */s("p",{id:m,className:"es-action-note",children:a}):null,
13
- /* @__PURE__ */s("span",{className:"es-action-live",role:"status","aria-live":"polite",children:t?u:null})]})}var p=["full","content"],g={label:"Background",full:"Full width",content:"Content width"};function N({value:e,changed:a,detail:t,onChange:i,onReset:d,disabled:o=!1,hint:c,labelId:u,words:h,resetWords:m}){const f={...g,...h};/* @__PURE__ */
14
- return s(l,{label:f.label,labelId:u,icon:/* @__PURE__ */s(r,{}),changed:a,hint:c,action:/* @__PURE__ */s(b,{words:m,label:f.label,changed:a,detail:t,onReset:d}),children:/* @__PURE__ */s(n,{options:p.map(e=>({id:e,label:"full"===e?f.full:f.content})),value:e,onChange:i,ariaLabel:f.label,disabled:o})})}var S={label:"Content",full:"Full width",content:"Content width"};function v({mode:e,onMode:a,number:t,changed:i,detail:o,onReset:r,fullClosed:u=!1,disabled:h=!1,hint:m,labelId:f,words:g,resetWords:N}){const v={...S,...g},w=void 0!==e&&a?/* @__PURE__ */s(n,{options:p.map(e=>({id:e,label:"full"===e?v.full:v.content,disabled:"full"===e&&u})),value:e,onChange:a,ariaLabel:v.label,disabled:h}):null;/* @__PURE__ */
15
- return s(l,{label:v.label,labelId:f,icon:/* @__PURE__ */s(c,{}),changed:i,hint:m,action:/* @__PURE__ */s(b,{words:N,label:v.label,changed:i,detail:o,onReset:r}),children:w&&t?/* @__PURE__ */d("div",{className:"es-width-stack",children:[w,t]}):w??t??null})}export{p as BACKGROUND_WIDTHS,g as DEFAULT_BACKGROUND_WIDTH_WORDS,S as DEFAULT_CONTENT_WIDTH_WORDS,f as SettingsAction,N as SettingsBackgroundWidth,v as SettingsContentWidth,b as SettingsDefaultReset,m as SettingsDrill,u as SettingsGroupHead,h as SettingsGroupSub};
1
+ export{BACKGROUND_WIDTHS,DEFAULT_BACKGROUND_WIDTH_WORDS,DEFAULT_CONTENT_WIDTH_WORDS,SettingsAction,SettingsBackgroundWidth,BorderInput as SettingsBorder,SettingsContentWidth,CornersInput as SettingsCorners,SettingsDefaultReset,SettingsDrill,SettingsGroupHead,SettingsGroupSub,AlignmentGrid as SettingsPlacement,SidesInput as SettingsSides,SidesEachToggle as SettingsSidesEach,borderSides,borderStartEach,sidesStartEach}from"../chunk-TOHOGVAE.js";export{DESIGN_GROUPS,SETTINGS_BUCKETS,SettingsGroup}from"../chunk-FM6JO4WF.js";import"../chunk-KFV7N2DJ.js";export{SettingsSwitch}from"../chunk-OECWLNKJ.js";export{SettingsField,SettingsSegmented}from"../chunk-CZAAGBVL.js";
@@ -283,6 +283,14 @@
283
283
 
284
284
  .es-seg-icon svg { width: var(--es-chip-icon); height: var(--es-chip-icon); display: block; }
285
285
 
286
+ /* A DRAWN LABEL IS A GLYPH, NOT A WORD (Lewis 2026-10-28, the Box icon rows).
287
+ In a text line the mark sat on the baseline: 2px above the chip's middle, at
288
+ its own 18px. Out of the line, it is centred in the chip, and it is the size
289
+ the icon slot draws (`--es-chip-icon`). */
290
+ .es-seg-drawn { display: flex; align-items: center; }
291
+ .es-seg-mark { display: flex; }
292
+ .es-seg-mark svg { width: var(--es-chip-icon); height: var(--es-chip-icon); display: block; }
293
+
286
294
  /* ── the segmented control: the same chip, a different promise ─────────────── */
287
295
 
288
296
  /* WHY NOT A TAB STRIP (card 66248). A tab strip (the shell's `Tabs`) is a
@@ -1 +1 @@
1
- export{AddBlockRow as default}from"../../chunk-4RRIYPAV.js";import"../../chunk-RUQOIQWI.js";import"../../chunk-DCBSRZ6Z.js";import"../../chunk-FHCKFOCD.js";import"../../chunk-MQA7OFRA.js";import"../../chunk-IYHO4XQX.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-FEF3OQRT.js";import"../../chunk-RPMSET77.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-6QSFJCJT.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import"../../chunk-WHS6Y55E.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-AGWKB77Q.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-FM6JO4WF.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-HZSZT3BE.js";import"../../chunk-KRL3IUV3.js";import"../../chunk-Y2T3JX7K.js";import"../../chunk-KFWNGPW3.js";import"../../chunk-JACEEVVF.js";import"../../chunk-S3DUFDQ6.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-6NJHYXJM.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-YU3WHLGI.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-TGZCD6IP.js";import"../../chunk-KXM6YRG2.js";
1
+ export{AddBlockRow as default}from"../../chunk-2AV62DEP.js";import"../../chunk-RUQOIQWI.js";import"../../chunk-Z5BPY2VG.js";import"../../chunk-NCXYC7WI.js";import"../../chunk-LX23TCTP.js";import"../../chunk-IYHO4XQX.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-VBOSOH5M.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-H4Z2V56N.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import"../../chunk-WHS6Y55E.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-AGWKB77Q.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-RPMSET77.js";import"../../chunk-FM6JO4WF.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-HZSZT3BE.js";import"../../chunk-KRL3IUV3.js";import"../../chunk-Y2T3JX7K.js";import"../../chunk-KFWNGPW3.js";import"../../chunk-JACEEVVF.js";import"../../chunk-CZAAGBVL.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-6NJHYXJM.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-YU3WHLGI.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-TGZCD6IP.js";import"../../chunk-KXM6YRG2.js";
@@ -1 +1 @@
1
- export{blockKey,AddSidePanel as default,sectionKey,sharedKey,templateKey}from"../../chunk-C57RLYDQ.js";import"../../chunk-VKPOH6MK.js";import"../../chunk-IZGFJWH4.js";import"../../chunk-N7E6264U.js";import"../../chunk-N3MJOHAG.js";import"../../chunk-5PXVT7JY.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-RUQOIQWI.js";import"../../chunk-DCBSRZ6Z.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-FHCKFOCD.js";import"../../chunk-YM4UEGBV.js";import"../../chunk-SNF5764Q.js";import"../../chunk-MQA7OFRA.js";import"../../chunk-IYHO4XQX.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-FEF3OQRT.js";import"../../chunk-RPMSET77.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-6QSFJCJT.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import"../../chunk-WHS6Y55E.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-AGWKB77Q.js";import"../../chunk-ZKY45F5G.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-FM6JO4WF.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-WYTPBF3Q.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-AJSDWWJW.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-HZSZT3BE.js";import"../../chunk-KRL3IUV3.js";import"../../chunk-Y2T3JX7K.js";import"../../chunk-KFWNGPW3.js";import"../../chunk-JACEEVVF.js";import"../../chunk-S3DUFDQ6.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-LN43DP2A.js";import"../../chunk-TQ5Y6S2X.js";import"../../chunk-6NJHYXJM.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-YU3WHLGI.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-TGZCD6IP.js";import"../../chunk-KXM6YRG2.js";
1
+ export{blockKey,AddSidePanel as default,sectionKey,sharedKey,templateKey}from"../../chunk-4RJBW7VC.js";import"../../chunk-VKPOH6MK.js";import"../../chunk-IZGFJWH4.js";import"../../chunk-N7E6264U.js";import"../../chunk-N3MJOHAG.js";import"../../chunk-5PXVT7JY.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-RUQOIQWI.js";import"../../chunk-Z5BPY2VG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-NCXYC7WI.js";import"../../chunk-YM4UEGBV.js";import"../../chunk-SNF5764Q.js";import"../../chunk-LX23TCTP.js";import"../../chunk-IYHO4XQX.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-VBOSOH5M.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-H4Z2V56N.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import"../../chunk-WHS6Y55E.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-AGWKB77Q.js";import"../../chunk-ZKY45F5G.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-RPMSET77.js";import"../../chunk-FM6JO4WF.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-WYTPBF3Q.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-AJSDWWJW.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-HZSZT3BE.js";import"../../chunk-KRL3IUV3.js";import"../../chunk-Y2T3JX7K.js";import"../../chunk-KFWNGPW3.js";import"../../chunk-JACEEVVF.js";import"../../chunk-CZAAGBVL.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-LN43DP2A.js";import"../../chunk-TQ5Y6S2X.js";import"../../chunk-6NJHYXJM.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-YU3WHLGI.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-TGZCD6IP.js";import"../../chunk-KXM6YRG2.js";
@@ -1 +1 @@
1
- export{MediaPopup as default}from"../../chunk-2G6MAXPY.js";import"../../chunk-FHCKFOCD.js";import"../../chunk-MQA7OFRA.js";
1
+ export{MediaPopup as default}from"../../chunk-T2RINM7R.js";import"../../chunk-NCXYC7WI.js";import"../../chunk-LX23TCTP.js";
@@ -30,7 +30,7 @@ import '../lib/section-template-types.js';
30
30
  import '../lib/document/content-tree.js';
31
31
  import '../lib/shared-section-types.js';
32
32
  import '../lib/document/block-choice.js';
33
- import '../../ScreenDocumentContext-BDLUYzlM.js';
33
+ import '../../ScreenDocumentContext-DPW_6gOC.js';
34
34
  import '../lib/document-contract.js';
35
35
  import '../lib/document-switch.js';
36
36
  import '../../engine-CvXpFE86.js';
@@ -1 +1 @@
1
- export{EASEL_NODE_CLIPBOARD,ancestorChain,nodeClipboardOf,nodeClipboardRules,nodeMenuItems,nodeShortcut,pageMenuItems,pastePlace,runNodeShortcut,textMenuItems,useNodeClipboard,useNodeContextMenu}from"../../chunk-J5OSNZPU.js";import"../../chunk-V7U33NF2.js";import"../../chunk-YM4UEGBV.js";import"../../chunk-SNF5764Q.js";import"../../chunk-MQA7OFRA.js";import"../../chunk-P5VYGWYO.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-IYHO4XQX.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-RPMSET77.js";import"../../chunk-ZKY45F5G.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-YU3WHLGI.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-TGZCD6IP.js";import"../../chunk-KXM6YRG2.js";
1
+ export{EASEL_NODE_CLIPBOARD,ancestorChain,nodeClipboardOf,nodeClipboardRules,nodeMenuItems,nodeShortcut,pageMenuItems,pastePlace,runNodeShortcut,textMenuItems,useNodeClipboard,useNodeContextMenu}from"../../chunk-G7ISR6DI.js";import"../../chunk-YM4UEGBV.js";import"../../chunk-SNF5764Q.js";import"../../chunk-LX23TCTP.js";import"../../chunk-IYHO4XQX.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-ZKY45F5G.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-P5VYGWYO.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-RPMSET77.js";import"../../chunk-YU3WHLGI.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-TGZCD6IP.js";import"../../chunk-KXM6YRG2.js";
@@ -1 +1 @@
1
- export{PageEditGuardNotices as default}from"../../chunk-CMBJHSHY.js";import"../../chunk-A6ZP5II4.js";import"../../chunk-77IWWW6X.js";import"../../chunk-ERR437B5.js";import"../../chunk-UNVKPVZW.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-BIK3AO2V.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-FHCKFOCD.js";import"../../chunk-YM4UEGBV.js";import"../../chunk-SNF5764Q.js";import"../../chunk-MQA7OFRA.js";import"../../chunk-IYHO4XQX.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-WYTPBF3Q.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-AJSDWWJW.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MFIRYGHW.js";
1
+ export{PageEditGuardNotices as default}from"../../chunk-FRAIEWRC.js";import"../../chunk-K7MMLCTT.js";import"../../chunk-ISS72IKO.js";import"../../chunk-ERR437B5.js";import"../../chunk-3FIS2FRS.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-NQW6XCAY.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-NCXYC7WI.js";import"../../chunk-YM4UEGBV.js";import"../../chunk-SNF5764Q.js";import"../../chunk-LX23TCTP.js";import"../../chunk-IYHO4XQX.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-WYTPBF3Q.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-AJSDWWJW.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MFIRYGHW.js";
@@ -29,7 +29,7 @@ import '../lib/section-template-types.js';
29
29
  import '../lib/document/content-tree.js';
30
30
  import '../lib/shared-section-types.js';
31
31
  import '../lib/document/block-choice.js';
32
- import '../../ScreenDocumentContext-BDLUYzlM.js';
32
+ import '../../ScreenDocumentContext-DPW_6gOC.js';
33
33
  import '../lib/document-contract.js';
34
34
  import '../lib/document-switch.js';
35
35
  import '../lib/admin-bridge.js';
@@ -1 +1 @@
1
- export{ScreenChrome as default}from"../../chunk-ZOPYJQFS.js";import"../../chunk-OXZDSOZV.js";import"../../chunk-7OCEPOEJ.js";import"../../chunk-DSKNJXB4.js";import"../../chunk-UMBNBCL4.js";import"../../chunk-5XL2RXFU.js";import"../../chunk-2FYFAAAK.js";import"../../chunk-22I55W37.js";import"../../chunk-3QB2ZQXK.js";import"../../chunk-DDH2DYQP.js";import"../../chunk-MYAJ7MGI.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-Y53EKN35.js";import"../../chunk-33P4J2SF.js";import"../../chunk-RMQDKVGW.js";import"../../chunk-55KKGABA.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-5545A3PC.js";import"../../chunk-C57RLYDQ.js";import"../../chunk-VKPOH6MK.js";import"../../chunk-IZGFJWH4.js";import"../../chunk-N7E6264U.js";import"../../chunk-N3MJOHAG.js";import"../../chunk-5PXVT7JY.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-RUQOIQWI.js";import"../../chunk-DCBSRZ6Z.js";import"../../chunk-2G6MAXPY.js";import"../../chunk-J5OSNZPU.js";import"../../chunk-V7U33NF2.js";import"../../chunk-CMBJHSHY.js";import"../../chunk-A6ZP5II4.js";import"../../chunk-77IWWW6X.js";import"../../chunk-ERR437B5.js";import"../../chunk-UNVKPVZW.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-BIK3AO2V.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-FHCKFOCD.js";import"../../chunk-YM4UEGBV.js";import"../../chunk-SNF5764Q.js";import"../../chunk-MQA7OFRA.js";import"../../chunk-P5VYGWYO.js";import"../../chunk-XFYFKITX.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-IYHO4XQX.js";import"../../chunk-SSRYU3YG.js";import"../../chunk-AJ2SUSET.js";import"../../chunk-ANPOR6EY.js";import"../../chunk-6UAEFOJ4.js";import"../../chunk-R4AUZVA3.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-FEF3OQRT.js";import"../../chunk-RPMSET77.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-6QSFJCJT.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import"../../chunk-WHS6Y55E.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-AGWKB77Q.js";import"../../chunk-ZKY45F5G.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-FM6JO4WF.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-WYTPBF3Q.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-AJSDWWJW.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-HZSZT3BE.js";import"../../chunk-KRL3IUV3.js";import"../../chunk-Y2T3JX7K.js";import"../../chunk-KFWNGPW3.js";import"../../chunk-JACEEVVF.js";import"../../chunk-S3DUFDQ6.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-LN43DP2A.js";import"../../chunk-TQ5Y6S2X.js";import"../../chunk-6NJHYXJM.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-YU3WHLGI.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-TGZCD6IP.js";import"../../chunk-KXM6YRG2.js";import"../../chunk-BSPCSC45.js";import"../../chunk-467WWV4I.js";import"../../chunk-TIAWIOGD.js";import"../../chunk-MGVI67QV.js";
1
+ export{ScreenChrome as default}from"../../chunk-HHQZB6IE.js";import"../../chunk-OXZDSOZV.js";import"../../chunk-7OCEPOEJ.js";import"../../chunk-DSKNJXB4.js";import"../../chunk-UMBNBCL4.js";import"../../chunk-5XL2RXFU.js";import"../../chunk-2FYFAAAK.js";import"../../chunk-22I55W37.js";import"../../chunk-3QB2ZQXK.js";import"../../chunk-DDH2DYQP.js";import"../../chunk-PDJ5ZALV.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-Y53EKN35.js";import"../../chunk-7BW74Y55.js";import"../../chunk-D5GQEUKM.js";import"../../chunk-55KKGABA.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-5545A3PC.js";import"../../chunk-4RJBW7VC.js";import"../../chunk-VKPOH6MK.js";import"../../chunk-IZGFJWH4.js";import"../../chunk-N7E6264U.js";import"../../chunk-N3MJOHAG.js";import"../../chunk-5PXVT7JY.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-RUQOIQWI.js";import"../../chunk-Z5BPY2VG.js";import"../../chunk-T2RINM7R.js";import"../../chunk-G7ISR6DI.js";import"../../chunk-FRAIEWRC.js";import"../../chunk-K7MMLCTT.js";import"../../chunk-ISS72IKO.js";import"../../chunk-ERR437B5.js";import"../../chunk-3FIS2FRS.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-NQW6XCAY.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-NCXYC7WI.js";import"../../chunk-YM4UEGBV.js";import"../../chunk-SNF5764Q.js";import"../../chunk-LX23TCTP.js";import"../../chunk-XFYFKITX.js";import"../../chunk-IYHO4XQX.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-5NHQ452C.js";import"../../chunk-6UAEFOJ4.js";import"../../chunk-AJ2SUSET.js";import"../../chunk-ANPOR6EY.js";import"../../chunk-R4AUZVA3.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-VBOSOH5M.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-H4Z2V56N.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import"../../chunk-WHS6Y55E.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-AGWKB77Q.js";import"../../chunk-ZKY45F5G.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-P5VYGWYO.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-RPMSET77.js";import"../../chunk-FM6JO4WF.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-WYTPBF3Q.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-AJSDWWJW.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-HZSZT3BE.js";import"../../chunk-KRL3IUV3.js";import"../../chunk-Y2T3JX7K.js";import"../../chunk-KFWNGPW3.js";import"../../chunk-JACEEVVF.js";import"../../chunk-CZAAGBVL.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-LN43DP2A.js";import"../../chunk-TQ5Y6S2X.js";import"../../chunk-6NJHYXJM.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-YU3WHLGI.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-TGZCD6IP.js";import"../../chunk-KXM6YRG2.js";import"../../chunk-BSPCSC45.js";import"../../chunk-467WWV4I.js";import"../../chunk-TIAWIOGD.js";import"../../chunk-MGVI67QV.js";
@@ -1,6 +1,6 @@
1
1
  import 'react';
2
2
  import '../../blocks/index.js';
3
- export { p as AnyScreenTarget, q as DocumentTarget, r as ScreenDocumentContext, s as ScreenDocumentProvider, t as ScreenDocumentValue, v as ScreenTarget, w as useScreenDocument } from '../../ScreenDocumentContext-BDLUYzlM.js';
3
+ export { q as AnyScreenTarget, r as DocumentTarget, s as ScreenDocumentContext, t as ScreenDocumentProvider, v as ScreenDocumentValue, w as ScreenTarget, x as useScreenDocument } from '../../ScreenDocumentContext-DPW_6gOC.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-A6ZP5II4.js";import"../../chunk-77IWWW6X.js";import"../../chunk-ERR437B5.js";import"../../chunk-UNVKPVZW.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-BIK3AO2V.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-FHCKFOCD.js";import"../../chunk-YM4UEGBV.js";import"../../chunk-SNF5764Q.js";import"../../chunk-MQA7OFRA.js";import"../../chunk-IYHO4XQX.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MFIRYGHW.js";
1
+ export{ScreenDocumentContext,ScreenDocumentProvider,useScreenDocument}from"../../chunk-K7MMLCTT.js";import"../../chunk-ISS72IKO.js";import"../../chunk-ERR437B5.js";import"../../chunk-3FIS2FRS.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-NQW6XCAY.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-NCXYC7WI.js";import"../../chunk-YM4UEGBV.js";import"../../chunk-SNF5764Q.js";import"../../chunk-LX23TCTP.js";import"../../chunk-IYHO4XQX.js";import"../../chunk-NDRZP6YR.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 { p as AnyScreenTarget, A as AnyDocumentAddressing } from '../../ScreenDocumentContext-BDLUYzlM.js';
3
+ import { q as AnyScreenTarget, A as AnyDocumentAddressing } from '../../ScreenDocumentContext-DPW_6gOC.js';
4
4
  import { ScreenParts } from '../lib/screen-parts.js';
5
5
  import '../../blocks/index.js';
6
6
  import '../../types-BljCVdzR.js';
@@ -1 +1 @@
1
- export{DocumentScreen,ScreenMount as default}from"../../chunk-QWLWSIDH.js";import"../../chunk-GXQCZJOP.js";import"../../chunk-ZOPYJQFS.js";import"../../chunk-OXZDSOZV.js";import"../../chunk-7OCEPOEJ.js";import"../../chunk-DSKNJXB4.js";import"../../chunk-UMBNBCL4.js";import"../../chunk-5XL2RXFU.js";import"../../chunk-2FYFAAAK.js";import"../../chunk-22I55W37.js";import"../../chunk-3QB2ZQXK.js";import"../../chunk-DDH2DYQP.js";import"../../chunk-MYAJ7MGI.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-Y53EKN35.js";import"../../chunk-33P4J2SF.js";import"../../chunk-RMQDKVGW.js";import"../../chunk-55KKGABA.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-VNDPFDO5.js";import"../../chunk-5545A3PC.js";import"../../chunk-C57RLYDQ.js";import"../../chunk-VKPOH6MK.js";import"../../chunk-IZGFJWH4.js";import"../../chunk-N7E6264U.js";import"../../chunk-N3MJOHAG.js";import"../../chunk-5PXVT7JY.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-RUQOIQWI.js";import"../../chunk-DCBSRZ6Z.js";import"../../chunk-2G6MAXPY.js";import"../../chunk-J5OSNZPU.js";import"../../chunk-V7U33NF2.js";import"../../chunk-CMBJHSHY.js";import"../../chunk-A6ZP5II4.js";import"../../chunk-77IWWW6X.js";import"../../chunk-ERR437B5.js";import"../../chunk-UNVKPVZW.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-BIK3AO2V.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-FHCKFOCD.js";import"../../chunk-YM4UEGBV.js";import"../../chunk-SNF5764Q.js";import"../../chunk-MQA7OFRA.js";import"../../chunk-P5VYGWYO.js";import"../../chunk-XFYFKITX.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-IYHO4XQX.js";import"../../chunk-SSRYU3YG.js";import"../../chunk-AJ2SUSET.js";import"../../chunk-ANPOR6EY.js";import"../../chunk-6UAEFOJ4.js";import"../../chunk-R4AUZVA3.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-FEF3OQRT.js";import"../../chunk-RPMSET77.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-6QSFJCJT.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import"../../chunk-WHS6Y55E.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-AGWKB77Q.js";import"../../chunk-ZKY45F5G.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-FM6JO4WF.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-WYTPBF3Q.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-AJSDWWJW.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-HZSZT3BE.js";import"../../chunk-KRL3IUV3.js";import"../../chunk-Y2T3JX7K.js";import"../../chunk-KFWNGPW3.js";import"../../chunk-JACEEVVF.js";import"../../chunk-S3DUFDQ6.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-LN43DP2A.js";import"../../chunk-TQ5Y6S2X.js";import"../../chunk-6NJHYXJM.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-YU3WHLGI.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-TGZCD6IP.js";import"../../chunk-KXM6YRG2.js";import"../../chunk-BSPCSC45.js";import"../../chunk-467WWV4I.js";import"../../chunk-TIAWIOGD.js";import"../../chunk-MGVI67QV.js";
1
+ export{DocumentScreen,ScreenMount as default}from"../../chunk-ZYHKXEND.js";import"../../chunk-GXQCZJOP.js";import"../../chunk-HHQZB6IE.js";import"../../chunk-OXZDSOZV.js";import"../../chunk-7OCEPOEJ.js";import"../../chunk-DSKNJXB4.js";import"../../chunk-UMBNBCL4.js";import"../../chunk-5XL2RXFU.js";import"../../chunk-2FYFAAAK.js";import"../../chunk-22I55W37.js";import"../../chunk-3QB2ZQXK.js";import"../../chunk-DDH2DYQP.js";import"../../chunk-PDJ5ZALV.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-Y53EKN35.js";import"../../chunk-7BW74Y55.js";import"../../chunk-D5GQEUKM.js";import"../../chunk-55KKGABA.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-CMMR6CJS.js";import"../../chunk-5545A3PC.js";import"../../chunk-4RJBW7VC.js";import"../../chunk-VKPOH6MK.js";import"../../chunk-IZGFJWH4.js";import"../../chunk-N7E6264U.js";import"../../chunk-N3MJOHAG.js";import"../../chunk-5PXVT7JY.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-RUQOIQWI.js";import"../../chunk-Z5BPY2VG.js";import"../../chunk-T2RINM7R.js";import"../../chunk-G7ISR6DI.js";import"../../chunk-FRAIEWRC.js";import"../../chunk-K7MMLCTT.js";import"../../chunk-ISS72IKO.js";import"../../chunk-ERR437B5.js";import"../../chunk-3FIS2FRS.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-NQW6XCAY.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-NCXYC7WI.js";import"../../chunk-YM4UEGBV.js";import"../../chunk-SNF5764Q.js";import"../../chunk-LX23TCTP.js";import"../../chunk-XFYFKITX.js";import"../../chunk-IYHO4XQX.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-5NHQ452C.js";import"../../chunk-6UAEFOJ4.js";import"../../chunk-AJ2SUSET.js";import"../../chunk-ANPOR6EY.js";import"../../chunk-R4AUZVA3.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-VBOSOH5M.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-H4Z2V56N.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import"../../chunk-WHS6Y55E.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-AGWKB77Q.js";import"../../chunk-ZKY45F5G.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-P5VYGWYO.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-RPMSET77.js";import"../../chunk-FM6JO4WF.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-WYTPBF3Q.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-AJSDWWJW.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-HZSZT3BE.js";import"../../chunk-KRL3IUV3.js";import"../../chunk-Y2T3JX7K.js";import"../../chunk-KFWNGPW3.js";import"../../chunk-JACEEVVF.js";import"../../chunk-CZAAGBVL.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-LN43DP2A.js";import"../../chunk-TQ5Y6S2X.js";import"../../chunk-6NJHYXJM.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-YU3WHLGI.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-TGZCD6IP.js";import"../../chunk-KXM6YRG2.js";import"../../chunk-BSPCSC45.js";import"../../chunk-467WWV4I.js";import"../../chunk-TIAWIOGD.js";import"../../chunk-MGVI67QV.js";
@@ -27,7 +27,7 @@ import '../lib/section-template-types.js';
27
27
  import '../lib/document/content-tree.js';
28
28
  import '../lib/shared-section-types.js';
29
29
  import '../lib/document/block-choice.js';
30
- import '../../ScreenDocumentContext-BDLUYzlM.js';
30
+ import '../../ScreenDocumentContext-DPW_6gOC.js';
31
31
  import '../lib/document-contract.js';
32
32
  import '../lib/document-switch.js';
33
33
  import '../../engine-CvXpFE86.js';