efficient-easel 6.4.0 → 6.6.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 (63) hide show
  1. package/README.md +6 -0
  2. package/dist/{CanvasDragLayer-O1gVT1AL.d.ts → CanvasDragLayer-CLb7j-CZ.d.ts} +18 -2
  3. package/dist/{canvas-typing-Dec_zyuM.d.ts → canvas-typing-U7TV-iax.d.ts} +16 -1
  4. package/dist/{chunk-3PPA5S2J.js → chunk-4UJ6CPLO.js} +1 -1
  5. package/dist/{chunk-6EKKPFVG.js → chunk-57NRNFLO.js} +1 -1
  6. package/dist/{chunk-NL4OU4UU.js → chunk-5PUEZ22M.js} +1 -1
  7. package/dist/chunk-CIHKZMNR.js +1 -0
  8. package/dist/{chunk-7XHDCQVL.js → chunk-CRWFB7MU.js} +16 -16
  9. package/dist/chunk-DSXKBICS.js +5 -0
  10. package/dist/{chunk-VFI3ONLN.js → chunk-ESQZG7B3.js} +1 -1
  11. package/dist/chunk-HXLF2ZQO.js +62 -0
  12. package/dist/{chunk-ISBKAONU.js → chunk-LVUDUQNL.js} +1 -1
  13. package/dist/chunk-M5VRWM7M.js +11 -0
  14. package/dist/{chunk-F4XCIEXI.js → chunk-Q2L6YTII.js} +1 -1
  15. package/dist/chunk-SSORUDHE.js +18 -0
  16. package/dist/chunk-TBY3DFKS.js +1 -0
  17. package/dist/chunk-TCVTMNYE.js +1 -0
  18. package/dist/{chunk-QPQXKKSC.js → chunk-UY7BCB32.js} +1 -1
  19. package/dist/{chunk-LWQQQ72E.js → chunk-VQOIVFSG.js} +3 -3
  20. package/dist/chunk-ZR4CFNMW.js +5 -0
  21. package/dist/copy/index.d.ts +1 -1
  22. package/dist/copy/index.js +18 -18
  23. package/dist/drag/drag.css +33 -26
  24. package/dist/drag/index.d.ts +34 -3
  25. package/dist/drag/index.js +1 -1
  26. package/dist/easel/index.d.ts +13 -1
  27. package/dist/easel/index.js +1 -1
  28. package/dist/fields/index.js +1 -1
  29. package/dist/screen/components/AddBlockRow.js +1 -1
  30. package/dist/screen/components/AddSidePanel.js +1 -1
  31. package/dist/screen/components/MediaSidePanel.js +1 -1
  32. package/dist/screen/components/NodeContextMenu.d.ts +1 -1
  33. package/dist/screen/components/NodeContextMenu.js +1 -1
  34. package/dist/screen/components/ScreenChrome.js +1 -1
  35. package/dist/screen/components/ScreenMount.d.ts +1 -1
  36. package/dist/screen/components/ScreenMount.js +1 -1
  37. package/dist/screen/components/ScreenStoreProvider.d.ts +1 -1
  38. package/dist/screen/components/ScreenStoreProvider.js +1 -1
  39. package/dist/screen/components/SectionScreenShell.js +16 -16
  40. package/dist/screen/components/usePartBridge.d.ts +1 -1
  41. package/dist/screen/components/usePartBridge.js +1 -1
  42. package/dist/screen/index.d.ts +1 -1
  43. package/dist/screen/index.js +1 -1
  44. package/dist/screen/lib/key-scope.js +1 -1
  45. package/dist/screen/lib/puck/style-clipboard.d.ts +1 -1
  46. package/dist/screen/lib/puck/style-clipboard.js +1 -1
  47. package/dist/screen/lib/puck/use-section-ops.js +1 -1
  48. package/dist/screen/lib/screen-parts.d.ts +1 -1
  49. package/dist/screen/lib/screen-parts.js +1 -1
  50. package/dist/screen/screen.css +6 -127
  51. package/dist/strings/catalogue.d.ts +5 -2
  52. package/dist/strings/catalogue.js +1 -1
  53. package/dist/strings/index.js +1 -1
  54. package/dist/text-styles/index.js +16 -16
  55. package/package.json +1 -1
  56. package/dist/chunk-6XXW6ZW3.js +0 -5
  57. package/dist/chunk-AELNNAFM.js +0 -1
  58. package/dist/chunk-AYNU4FYF.js +0 -14
  59. package/dist/chunk-DSUMM2WF.js +0 -10
  60. package/dist/chunk-JIWPANGM.js +0 -1
  61. package/dist/chunk-NTMY5EXS.js +0 -1
  62. package/dist/chunk-TAF5AECR.js +0 -65
  63. package/dist/chunk-YB4QPUEZ.js +0 -5
@@ -0,0 +1,18 @@
1
+ import{DEFAULT_DRAG_WORDS as e}from"./chunk-O2NLQBFX.js";import{dropEffectFor as t,scrollBoxOf as n,frameScrollBox as l,startAutoScroll as a,isNoOpDrop as r}from"./chunk-67GNT6PF.js";import{useCanvasLayout as o,useCanvasEvent as s,CANVAS_TYPING_EVENT as i,framePointToHost as c,elementScale as d,frameRectToLayer as u,clientPointToLayer as h}from"./chunk-AWJUYMX7.js";import{withTip as f}from"./chunk-P2VEMZH5.js";import{parseZoneKey as p}from"./chunk-KRXQM65X.js";import{useRef as m,useEffect as g,useState as b,useCallback as x,useMemo as y,useSyncExternalStore as v,useId as w,useLayoutEffect as k}from"react";import{Tooltip as N,IconButton as A,Input as z}from"efficient-shell/ui";import{AddIcon as D,CloseIcon as T,SearchIcon as $}from"efficient-shell/icons/efficient";import{jsxs as C,jsx as M}from"react/jsx-runtime";function S({label:e,onInsert:t,style:n,axis:l="y",className:a,index:r}){const o=["es-canvas-insert","x"===l?"is-x":"",a??""].filter(Boolean).join(" ");/* @__PURE__ */
2
+ return C("div",{className:o,style:n,"data-index":r,children:[
3
+ /* @__PURE__ */M("span",{className:"es-canvas-insert-line","aria-hidden":"true"}),
4
+ /* @__PURE__ */M("span",{className:"es-canvas-insert-chip",children:/* @__PURE__ */M(N,{content:e,children:/* @__PURE__ */M(A,{variant:"ghost",size:"sm","aria-label":e,onClick:t,children:/* @__PURE__ */M(D,{})})})})]})}var E=(e,t,n)=>t>=e.left&&t<=e.left+e.width&&n>=e.top&&n<=e.top+e.height,j=e=>e.width*e.height;function L(e,t,n){return e.map((e,t)=>({s:e,at:t})).filter(({s:e})=>E(e.box,t,n)).sort((e,t)=>j(t.s.box)-j(e.s.box)||e.at-t.at).map(({s:e})=>e)}function B(e,t,n){return L(e,t,n).at(-1)??null}function K(e,t,n){const l="x"===e.axis?t:n;let a=0;for(const t of e.children){l>("x"===e.axis?t.left+t.width/2:t.top+t.height/2)&&(a+=1)}return a}function X(e,t){const n=e.children;if("x"===e.axis){const l=n[t-1],a=n[t],r=l&&a?(l.left+l.width+a.left)/2:l?l.left+l.width:a?a.left:e.box.left,o=a??l??e.box;return{left:r-1,top:o.top,width:2,height:o.height}}const l=n[t-1],a=n[t],r=l&&a?(l.top+l.height+a.top)/2:l?l.top+l.height:a?a.top:e.box.top;return{left:e.box.left,top:r-1,width:e.box.width,height:2}}function q(e,t,n,l,a=()=>!1,r=()=>!0){const o=e.filter(e=>E(e.box,t,n)).sort((e,t)=>j(e.box)-j(t.box));for(const e of o){const o=K(e,t,n),s={...e.list,index:o};if(a(s))return null;if(l(s))return{zone:e,to:s,line:X(e,o)};if(!r(s))return null}return null}function O(e,t,n=12){const l=e.children;if(0===l.length)return[];const a=e.box,r="x"===e.axis,o=r?a.left:a.top,s=o+(r?a.width:a.height),i=e=>r?e.left:e.top,c=e=>r?e.left+e.width:e.top+e.height,d=[];for(let u=0;u<=l.length;u++){const h=l[u-1],f=l[u];let p,m;if(h&&f)p=c(h),m=Math.max(i(f)-p,0);else{const e=h?(c(h)+s)/2:(o+i(f))/2;p=Math.min(Math.max(e,o+n),s-n),m=0}const g=r?{left:p,top:a.top,width:m,height:a.height}:{left:a.left,top:p,width:a.width,height:m};d.push({key:`${e.key}:+${u}`,place:{...e.list,index:u},box:g,axis:e.axis,label:t})}return d}function I(e,t=e.key){const n=[];for(let l=1;l<e.children.length;l++){const a=e.children[l-1],r=e.children[l],o=a.top+a.height;n.push({key:`${t}:${l}`,place:{...e.list,index:l},box:{left:e.box.left,top:o,width:e.box.width,height:Math.max(r.top-o,0)}})}return n}var P={nodes:[],zones:[]},F="data-puck-dropzone",R="data-puck-component";function Y(e,t){if(e.length>=2){const[t,n]=e;return Math.abs(n.top-t.top)<Math.min(t.height,n.height)/2&&n.left>t.left?"x":"y"}const n=t.ownerDocument.defaultView?.getComputedStyle(t);return n&&n.display.includes("flex")&&n.flexDirection.startsWith("row")?"x":"y"}function Z(e,t){const{frame:n,document:l}=e,a=e=>u(n,function(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top,width:t.width,height:t.height}}(e),t),r=[],o=[];for(const e of l.querySelectorAll(`[${F}]`)){const t=e.getAttribute(F)??"";let n;try{n=p(t)}catch{continue}const l=[...e.querySelectorAll(`[${R}]`)].filter(t=>t.parentElement?.closest(`[${F}]`)===e),s=l.map(a);o.push({key:t,list:n,box:a(e),axis:Y(s,e),children:s}),l.forEach((e,t)=>{const l=e.getAttribute(R);l&&r.push({id:l,place:{...n,index:t},box:s[t]})})}return{nodes:r,zones:o}}var Q="data-es-empty-cell",V="data-puck-dropzone",W=140;var G=e=>({left:e.left,top:e.top,width:e.width,height:e.height});function H(u){const{canvas:f,session:p,readOnly:w,words:A=e.canvas}=u,z=m(u);g(()=>{z.current=u});const D=m(null),T=o(f),[$,E]=b(0),j=x(()=>E(e=>e+1),[]),[B,K]=b(P);g(()=>{const e=D.current;f&&e&&K((z.current.measure??Z)(f,e))},[f,T,u.revision,$]);const X=u.model,O=y(()=>X(B),[X,B]),I=v(p.subscribe,p.shown,p.shown),F=u.choose,R=(e,t)=>{const n=L(O.sources,e,t);return 0===n.length?null:F?F(n):n[n.length-1]},[Y,W]=b(null),[H,J]=b(null),U=m(null),_=()=>{U.current&&clearTimeout(U.current),U.current=null},ee=()=>{_(),U.current=setTimeout(()=>{p.get()||W(null)},140)};g(()=>_,[]);const te=m(null),ne=m(!1);s(f,i,e=>{ne.current=Boolean(e.detail?.typing),ne.current&&(_(),W(null))}),s(f,"mousemove",e=>{const t=D.current;if(!f||!t)return;const n=c(f.frame,e.clientX,e.clientY,t),l=d(t),a={x:n.x/l,y:n.y/l};if(te.current=a,z.current.readOnly||p.get()||ne.current)return;_();const r=R(a.x,a.y);W(e=>e?.key===r?.key&&e?.box===r?.box?e:r)}),s(f,"mouseout",e=>{e.relatedTarget||(te.current=null,ee())}),s(f,"mouseover",e=>{e.relatedTarget||j()});const le=m(null),ae=x(()=>{le.current?.(),le.current=null,J(null)},[]);g(()=>p.subscribe(()=>{p.get()?j():ae()}),[p,ae,j]),g(()=>ae,[ae]),("undefined"==typeof document?g:k)(()=>{if(p.get())return;const e=te.current;W(t=>w||ne.current?null:e?R(e.x,e.y):t?O.sources.find(e=>e.key===t.key)??null:null)},[O,I,p,w,F]);const re=e=>{const t=p.get(),n=D.current;if(!t||!n)return null;const l=h(n,e.clientX,e.clientY);te.current=l;const a=q(O.zones,l.x,l.y,e=>z.current.canDrop(t.item,e),e=>!!t.from&&r(t.from,e),e=>z.current.fallThrough?.(t.item,e,t.from)??!0);return a?{h:t,t:a}:null},oe={onDragEnter:e=>{if(le.current)return;const t=n(e.currentTarget.parentElement?.parentElement??null),r=f?l(f.document):null,o=[];t&&o.push(a(t)),r&&f&&o.push(a(r,f.frame)),le.current=o.length?()=>o.forEach(e=>e()):null},onDragOver:e=>{const n=re(e);if(!n)return void J(null);e.preventDefault(),e.dataTransfer.dropEffect=t(e.dataTransfer.effectAllowed);const l={zoneKey:n.t.zone.key,line:n.t.line,axis:n.t.zone.axis};J(e=>e&&e.zoneKey===l.zoneKey&&e.line.left===l.line.left&&e.line.top===l.line.top?e:l)},onDragLeave:e=>{const t=e.relatedTarget;t&&e.currentTarget.contains(t)||(te.current=null,J(null))},onDrop:e=>{const t=re(e);t&&(e.preventDefault(),p.end(),ae(),z.current.onDrop(t.h.item,t.t.to))}},se={draggable:!w&&!!Y,onMouseEnter:_,onMouseLeave:()=>!p.get()&&ee(),onDragStart:e=>{if(Y&&!w){p.start({key:Y.key,item:Y.item,from:Y.from}),e.dataTransfer.effectAllowed="move";try{e.dataTransfer.setData("text/plain",Y.key)}catch{}}else e.preventDefault()},onDragEnd:()=>{p.end(),ae()},onClick:()=>{Y&&!w&&z.current.onPick?.(Y.item)}},{seams:ie=[]}=O,ce=O.zones.filter(e=>0===e.children.length),de=u.onZoneAdd&&!w?ce:[],ue=de.map(e=>e.key).join("\n");return g(()=>{const e=f?.document;if(!e)return;const t=new Set(ue?ue.split("\n"):[]);for(const n of e.querySelectorAll(`[${V}]`))n.toggleAttribute(Q,t.has(n.getAttribute(V)??""));return()=>{for(const t of e.querySelectorAll(`[${Q}]`))t.removeAttribute(Q)}},[f,ue,B,T,$]),/* @__PURE__ */C("div",{ref:D,className:"es-canvas-layer",children:[I||!u.onSeamAdd||w?null:ie.map(e=>
5
+ /* @__PURE__ */M(S,{className:"es-canvas-seam",axis:e.axis,index:e.place.index,label:e.label??u.seamLabel??A.addSection,onInsert:()=>u.onSeamAdd?.(e.place),style:"x"===e.axis?{left:e.box.left+e.box.width/2-12,top:e.box.top,width:24,height:e.box.height}:{left:e.box.left,top:e.box.top+e.box.height/2-12,width:e.box.width,height:24}},e.key)),de.length?de.map(e=>/* @__PURE__ */M("button",{type:"button",className:["es-canvas-empty",e.addAlways?"is-always":"",H?.zoneKey===e.key?"is-over":""].filter(Boolean).join(" "),style:G(e.box),onClick:()=>u.onZoneAdd?.({...e.list,index:0}),children:/* @__PURE__ */M("span",{className:"es-canvas-empty-add",children:A.addButton({label:e.addLabel??u.zoneAddLabel??A.addBlock})})},e.key)):null,I?/* @__PURE__ */M("div",{className:"es-canvas-catch",...oe}):null,H&&!ce.some(e=>e.key===H.zoneKey)?/* @__PURE__ */M("div",{className:`es-canvas-line is-${H.axis}`,style:G(H.line)}):null,
6
+ /* @__PURE__ */M("div",{className:"es-canvas-handle-spot",style:Y?{"--es-handle-x":`${Y.box.left+2}px`,"--es-handle-y":`${Math.max(Y.box.top-11,0)}px`}:void 0,children:/* @__PURE__ */M(N,{className:"es-canvas-handle-tip",side:"top",content:!Y||w||I?null:Y.title??A.handle({label:Y.label}),children:/* @__PURE__ */C("div",{className:["es-canvas-handle",Y&&!w?"is-shown":"",I?"is-dragging":""].filter(Boolean).join(" "),...se,children:[
7
+ /* @__PURE__ */M("span",{className:"es-canvas-grip","aria-hidden":"true",children:"⋮⋮"}),Y?.label]})})})]})}var J=e=>e.tiles.length>0&&e.tiles.every(e=>null!=e.cover);function U({groups:t,session:n,itemFor:l,onInsert:a,at:r,hint:o,searchLabel:s,readOnly:i,words:c=e.add}){const d=o??c.hint,u=s??c.search,[h,p]=b(""),m=w(),g=h.trim().toLowerCase(),x=function(e){const t=/* @__PURE__ */new Map;return e.map(e=>{const n=e.key??e.title,l=t.get(n)??0;return t.set(n,l+1),0===l?n:`${n}\0${l}`})}(t),y=t.map((e,t)=>({...e,key:x[t],tiles:g?e.tiles.filter(e=>((e,t)=>e.label.toLowerCase().includes(t)||(e.keywords??[]).some(e=>e.toLowerCase().includes(t)))(e,g)):e.tiles})).filter(e=>e.tiles.length>0),v=(e,t)=>a=>{if(t)a.preventDefault();else{n.start({key:`new:${e}`,item:l(e)}),a.dataTransfer.effectAllowed="copy";try{a.dataTransfer.setData("text/plain",e)}catch{}}};/* @__PURE__ */
8
+ return C("div",{className:"es-add",children:[r?/* @__PURE__ */C("div",{className:"es-add-at",role:"status",children:[
9
+ /* @__PURE__ */M("span",{children:r.label}),f(c.stop,/* @__PURE__ */M("button",{type:"button",className:"es-add-at-clear","aria-label":c.stop,onClick:r.onClear,children:/* @__PURE__ */M(T,{size:12,"aria-hidden":"true"})}))]}):null,
10
+ /* @__PURE__ */M("p",{className:"es-add-hint",children:d}),
11
+ /* @__PURE__ */M("div",{className:"es-add-find",children:/* @__PURE__ */M(z,{id:m,type:"search","aria-label":u,placeholder:c.searchPlaceholder({label:u}),value:h,onChange:e=>p(e.target.value),leftIcon:/* @__PURE__ */M($,{size:16,"aria-hidden":"true"}),rightAdornment:h?/* @__PURE__ */M(A,{size:"sm","aria-label":c.clearSearch,onClick:()=>p(""),children:/* @__PURE__ */M(T,{size:12,"aria-hidden":"true"})}):void 0})}),0===y.length?/* @__PURE__ */C("div",{className:"es-add-empty",role:"status",children:[
12
+ /* @__PURE__ */M("div",{className:"es-add-empty-title",children:c.nothing({query:h.trim()})}),
13
+ /* @__PURE__ */M("div",{className:"es-add-empty-sub",children:c.tryAnother})]}):y.map(e=>/* @__PURE__ */C("section",{className:"es-add-group","aria-label":e.title,children:[
14
+ /* @__PURE__ */C("div",{className:"es-add-group-head",children:[
15
+ /* @__PURE__ */M("span",{className:"es-add-group-title",children:e.title}),
16
+ /* @__PURE__ */M("span",{className:"es-add-group-count",children:e.tiles.length})]}),
17
+ /* @__PURE__ */M("div",{className:J(e)?"es-add-grid is-cards":"es-add-grid",children:e.tiles.map(e=>{const t=Boolean(i||e.disabled),l=i?void 0:e.disabled?e.disabledReason:e.title??c.tile({label:e.label});return f(l,/* @__PURE__ */C("button",{type:"button",className:null!=e.cover?"es-add-tile has-cover":"es-add-tile",draggable:!t,"aria-disabled":t||void 0,"aria-label":c.tile({label:e.label}),onDragStart:v(e.type,t),onDragEnd:()=>n.end(),onClick:()=>!t&&a(e.type),children:[null!=e.cover?/* @__PURE__ */M("span",{className:"es-add-tile-cover","aria-hidden":"true",children:e.cover}):e.icon?/* @__PURE__ */M("span",{className:"es-add-tile-glyph","aria-hidden":"true",children:e.icon}):null,
18
+ /* @__PURE__ */M("span",{className:"es-add-tile-label",children:e.label})]},e.type))})})]},e.key))]})}export{U as AddPanel,H as CanvasDragLayer,S as CanvasInsert,P as EMPTY_MEASURE,W as HANDLE_GRACE_MS,q as canvasTarget,E as contains,K as gapInZone,X as gapLine,O as insertSeams,Z as measureCanvas,B as pickSource,I as seamsBetween,L as sourcesAt};
@@ -0,0 +1 @@
1
+ var o={frame:"Canvas",textTools:"Text tools"};export{o as DEFAULT_CANVAS_WORDS};
@@ -0,0 +1 @@
1
+ import{DEFAULT_TEXT_STYLES_WORDS as o}from"./chunk-M6F6LS3H.js";import{DEFAULT_PICK_WORDS as r}from"./chunk-ZAOM6PFH.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as t}from"./chunk-6WY6ZXJG.js";import{DEFAULT_SCREEN_WORDS as m}from"./chunk-MCHMF32I.js";import{DEFAULT_CANVAS_WORDS as n}from"./chunk-TBY3DFKS.js";import{DEFAULT_TREE_WORDS as c}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as s}from"./chunk-KFV7N2DJ.js";import{DEFAULT_NODE_MENU_WORDS as f}from"./chunk-WK3AFPXY.js";import{DEFAULT_SAVE_WORDS as p}from"./chunk-H6DDIBQ4.js";import{DEFAULT_CHROME_WORDS as e,DEFAULT_NOTICE_WORDS as i}from"./chunk-Y2G7CU6A.js";import{DEFAULT_LOCK_WORDS as u}from"./chunk-RE4LP46F.js";import{DEFAULT_RAIL_WORDS as k}from"./chunk-2OAZYSWJ.js";import{DEFAULT_COPY_WORDS as j}from"./chunk-AUT242JK.js";import{DEFAULT_FIELDS_WORDS as h}from"./chunk-FFYXVAAL.js";import{DEFAULT_DRAG_WORDS as l}from"./chunk-O2NLQBFX.js";var F={notice:i,lock:u,save:p,chrome:e,rail:k,tree:c,panel:s,fields:h,pick:r,drag:l,menu:f,styleClipboard:t,copy:j,canvas:n,textStyles:o,screen:m},a=o=>"object"==typeof o&&null!==o;function Y(o,r){const t={};for(const m of Object.keys(o)){const n=o[m],c=r[m];null==c?t[m]=n:a(n)?t[m]=a(c)?Y(n,c):n:t[m]=typeof c==typeof n?c:n}return t}function y(o,r){return r?Y(o,r):o}export{F as DEFAULT_EASEL_STRINGS,y as mergeEaselStrings};
@@ -1 +1 @@
1
- import{useEaselHost as n}from"./chunk-U3JP4VGF.js";import{useEaselApi as o,bindUndoKeys as t}from"./chunk-DSUMM2WF.js";import{useState as e,useEffect as u}from"react";function r(o){const t=n(),[r,c]=e(null);return u(()=>c(o.current),[o]),t.ownsDocument?"undefined"==typeof document?null:document:r}function c(e,c){const m=n(),i=o(),f=r(e);u(()=>{if(!m.ownsDocument&&f)return t(f,i,{leaveTyping:!0})},[m,i,f]);const s=c?.document??null;u(()=>{if(!m.ownsDocument&&s)return t(s,i,{leaveTyping:!0})},[m,i,s])}function m(n){return n.ownsDocument?{}:{tabIndex:-1}}export{m as editorRootFocus,r as useEaselKeyTarget,c as useEaselUndoKeys};
1
+ import{useEaselHost as n}from"./chunk-U3JP4VGF.js";import{useEaselApi as o,bindUndoKeys as t}from"./chunk-M5VRWM7M.js";import{useState as e,useEffect as u}from"react";function r(o){const t=n(),[r,c]=e(null);return u(()=>c(o.current),[o]),t.ownsDocument?"undefined"==typeof document?null:document:r}function c(e,c){const m=n(),i=o(),f=r(e);u(()=>{if(!m.ownsDocument&&f)return t(f,i,{leaveTyping:!0})},[m,i,f]);const s=c?.document??null;u(()=>{if(!m.ownsDocument&&s)return t(s,i,{leaveTyping:!0})},[m,i,s])}function m(n){return n.ownsDocument?{}:{tabIndex:-1}}export{m as editorRootFocus,r as useEaselKeyTarget,c as useEaselUndoKeys};
@@ -1,7 +1,7 @@
1
- import{clientOnly as n}from"./chunk-GXQCZJOP.js";import{ScreenStoreProvider as r}from"./chunk-3PPA5S2J.js";import{ScreenChrome as e}from"./chunk-TAF5AECR.js";import{ScreenDocumentProvider as i,useScreenDocument as a}from"./chunk-WZMU646D.js";import{DEFAULT_SCREEN_WORDS as s}from"./chunk-MCHMF32I.js";import{documentPermissions as o}from"./chunk-THWO5YVZ.js";import{useWords as c}from"./chunk-MFIRYGHW.js";import{useMemo as t}from"react";import{Dialog as d,Button as l}from"efficient-shell/ui";import{jsx as m,jsxs as g,Fragment as h}from"react/jsx-runtime";var f=n(r),v=n(e);function p({saving:n,onCancel:r,onDiscard:e,onSave:i}){const a=c("screen",s).leave;/* @__PURE__ */
1
+ import{clientOnly as n}from"./chunk-GXQCZJOP.js";import{ScreenStoreProvider as r}from"./chunk-4UJ6CPLO.js";import{ScreenChrome as e}from"./chunk-HXLF2ZQO.js";import{ScreenDocumentProvider as i,useScreenDocument as a}from"./chunk-WZMU646D.js";import{DEFAULT_SCREEN_WORDS as s}from"./chunk-MCHMF32I.js";import{documentPermissions as o}from"./chunk-THWO5YVZ.js";import{useWords as c}from"./chunk-MFIRYGHW.js";import{useMemo as t}from"react";import{Dialog as d,Button as l}from"efficient-shell/ui";import{jsx as m,jsxs as g,Fragment as h}from"react/jsx-runtime";var f=n(r),v=n(e);function p({saving:n,onCancel:r,onDiscard:e,onSave:i}){const a=c("screen",s).leave;/* @__PURE__ */
2
2
  return m(d,{open:!0,role:"alertdialog",size:"sm",title:a.title,onClose:r,footer:/* @__PURE__ */g(h,{children:[
3
3
  /* @__PURE__ */m(l,{variant:"secondary",onClick:r,children:a.cancel}),
4
4
  /* @__PURE__ */m(l,{variant:"ghost-danger",onClick:e,children:a.discard}),
5
5
  /* @__PURE__ */m(l,{variant:"primary",loading:n,onClick:i,children:n?a.saving:a.save})]}),children:a.body})}function u({target:n,addressing:r,onHostMessage:e,children:a}){/* @__PURE__ */
6
- return m(i,{target:n,addressing:r,onHostMessage:e,children:a})}var C=(n,r)=>/* @__PURE__ */g(h,{children:[n,r]});function k({config:n,parts:r,wrap:e=C}){const{data:i,error:d,redirecting:l,ready:g,saveStatus:h,readOnly:u,onChange:k,pendingNav:j,cancelPendingNav:N,discardAndNavigate:A,saveAndNavigate:M}=a(),y=t(()=>o(!u),[u]),H=c("screen",s);return l?/* @__PURE__ */m("div",{className:"sf-msg",children:H.loading}):d?/* @__PURE__ */m("div",{className:"sf-msg sf-msg--error",children:d}):g?i?e(
7
- /* @__PURE__ */m(f,{config:n,data:i,onChange:k,permissions:y,parts:r,children:/* @__PURE__ */m(v,{})}),j&&/* @__PURE__ */m(p,{saving:"saving"===h,onCancel:N,onDiscard:A,onSave:()=>{M()}})):/* @__PURE__ */m("div",{className:"sf-msg",children:H.loading}):/* @__PURE__ */m("div",{className:"sf-msg",children:H.waitingForAuthorization})}export{k as DocumentScreen,u as ScreenMount};
6
+ return m(i,{target:n,addressing:r,onHostMessage:e,children:a})}var C=(n,r)=>/* @__PURE__ */g(h,{children:[n,r]});function k({config:n,parts:r,wrap:e=C}){const{data:i,error:d,redirecting:l,ready:g,saveStatus:h,readOnly:u,onChange:k,pendingNav:j,cancelPendingNav:N,discardAndNavigate:H,saveAndNavigate:M}=a(),y=t(()=>o(!u),[u]),O=c("screen",s);return l?/* @__PURE__ */m("div",{className:"sf-msg",children:O.loading}):d?/* @__PURE__ */m("div",{className:"sf-msg sf-msg--error",children:d}):g?i?e(
7
+ /* @__PURE__ */m(f,{config:n,data:i,onChange:k,permissions:y,parts:r,children:/* @__PURE__ */m(v,{})}),j&&/* @__PURE__ */m(p,{saving:"saving"===h,onCancel:N,onDiscard:H,onSave:()=>{M()}})):/* @__PURE__ */m("div",{className:"sf-msg",children:O.loading}):/* @__PURE__ */m("div",{className:"sf-msg",children:O.waitingForAuthorization})}export{k as DocumentScreen,u as ScreenMount};
@@ -0,0 +1,5 @@
1
+ import{slotFieldsOf as n}from"./chunk-PLVEGYK6.js";import{usePickFollowsSelection as e}from"./chunk-R6WTQWAC.js";import{EaselCanvas as t,useSelectedFields as r}from"./chunk-M5VRWM7M.js";import{Inspector as i}from"./chunk-CRWFB7MU.js";import{createContext as o,useContext as u}from"react";import{DesktopIcon as l}from"efficient-shell/icons/efficient";import{jsx as s}from"react/jsx-runtime";var c={kind:"puck"};function f(n,e){const t=n,r=e,i=Object.keys(t);return i.length===Object.keys(r).length&&i.every(n=>Object.is(t[n],r[n]))}function a(n){const e=n;return"string"==typeof e.nodeId&&"string"==typeof e.slot}function d(e,t,r){const i=e.slotsOf?.(r);return i||n(t,r.type).map(n=>({slot:n,label:n,rung:!1}))}function p(n,e){return n.isFirst?n.isFirst(e):e.type===n.first}function m(n,e){return n.isLast?n.isLast(e):e.type===n.last}var k={},h={},v=()=>k,g=()=>"",y=()=>null,b=()=>{},O={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},j={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},w={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */s(l,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},L={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},C={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function S(){/* @__PURE__ */
2
+ return s(t,{height:"fill"})}function P(){const{id:n,fields:e,values:t,readOnly:o,onChange:u}=r();/* @__PURE__ */
3
+ return s("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */s(i,{fields:e,values:t,onChange:u,readOnly:o,idPrefix:n})})}var B=o({});function D({parts:n,children:e}){/* @__PURE__ */
4
+ return s(B.Provider,{value:n,children:e})}function G(){return u(B)}function N(){return(G().useOwnerName??g)()}function R(){return(G().useDocumentLabel??y)()}function x(n,e,t,r){return(G().useBridges??v)(n,e,t,r)}function F(n){return(G().useStandaloneBridges??v)(n)}function I(n,e){(G().useDocumentPass??b)(n,e)}function M(){return G().blockRules??O}function T(){return G().blockLook??j}function W(){return G().devices??w}function A(){return G().leftView??L}function V(){return G().pinned??C}function K(){return G().saveSwitch??!0}function E(n){e(!0===G().pickFollowsSelection,n)}function H(){return G().add??h}function Q(){return G().storageNamespace||void 0}function U(){return G().styleClipboard??null}function Y(){return G().nodeKeys??!0}function Z(){return G().notify??null}function q(){return G().Canvas??S}function z(){return G().CanvasHead??null}function J(){return G().canvasDrag??null}var X=o(null);function $({target:n,children:e}){/* @__PURE__ */
5
+ return s(X.Provider,{value:n,children:e})}function _(){return u(X)}function nn(){return G().Inspector??P}export{c as SELECTION_MODE,$ as ScreenCanvasTargetProvider,D as ScreenPartsProvider,p as isPinnedFirst,m as isPinnedLast,a as isSlotMode,f as sameInspectorMode,d as screenSlotsOf,H as useScreenAdd,T as useScreenBlockLook,M as useScreenBlockRules,x as useScreenBridges,J as useScreenCanvasDrag,q as useScreenCanvasFrame,z as useScreenCanvasHead,_ as useScreenCanvasTarget,W as useScreenDevices,R as useScreenDocumentLabel,I as useScreenDocumentPass,nn as useScreenInspectorPanel,A as useScreenLeftView,Y as useScreenNodeKeys,Z as useScreenNotify,N as useScreenOwnerName,G as useScreenParts,E as useScreenPickFollowsSelection,V as useScreenPinned,K as useScreenSaveSwitch,Q as useScreenStorageNamespace,U as useScreenStyleClipboard,F as useStandaloneScreenBridges};
@@ -5,7 +5,7 @@ import { C as CopyWords, a as CopyAlign } from '../words-BAnsDT16.js';
5
5
  export { b as COPY_ALIGNS, c as COPY_ALIGN_FIT, d as COPY_ALIGN_GLYPHS, e as COPY_ALIGN_LABELS, f as copyAlignOptions } from '../words-BAnsDT16.js';
6
6
  import { TextToolbarCase, TextToolbarMark } from 'efficient-shell/ui';
7
7
  export { TextToolbar, TextToolbarProps } from 'efficient-shell/ui';
8
- export { C as CanvasTypingEnd, a as CanvasTypingOptions, b as CanvasTypingSession, T as TextMap, s as startCanvasTyping, t as textMap } from '../canvas-typing-Dec_zyuM.js';
8
+ export { C as CanvasTypingEnd, a as CanvasTypingOptions, b as CanvasTypingSession, T as TextMap, s as startCanvasTyping, t as textMap } from '../canvas-typing-U7TV-iax.js';
9
9
 
10
10
  type CellWords = NonNullable<CopyWords['cells']>;
11
11
  interface CopyCell {
@@ -1,18 +1,18 @@
1
- import{DEFAULT_COPY_WORDS as e}from"../chunk-AUT242JK.js";import{selectionToVisible as t,selectionToSource as n,richLayout as r,createHistory as l,pasteToMarkup as o,richInput as a,editVisible as s,MARKUP_CLIPBOARD_TYPE as i,markupOfRange as c}from"../chunk-JIWPANGM.js";export{MARKUP_CLIPBOARD_TYPE,TYPING_BURST_MS,createHistory,editVisible,markupOfRange,newLine,pasteToMarkup,richInput,richLayout,selectionToSource,selectionToVisible,setBullet,startCanvasTyping,textMap,toSource,toSourceStart,toVisible}from"../chunk-JIWPANGM.js";import{FieldNumber as u}from"../chunk-66LWADFP.js";import"../chunk-FFYXVAAL.js";import{GoldTextInput as d}from"../chunk-2FZJWH24.js";import{RETIRED_MARKS as p,applyMark as f,markupTools as h,marksIn as m,STANDARD_MARKUP as g,findLink as y,markedAt as v,listIn as b,colorIn as k,spanFor as x,clearStyle as w,toggleMark as S,colorOver as E,setList as C,unlinkAt as D,removeLink as N,linkOver as L,writeLink as T}from"../chunk-546BBOPE.js";import{SettingsSegmented as M,SettingsSwitch as P}from"../chunk-QLD57GBB.js";import{useWords as R}from"../chunk-MFIRYGHW.js";import{withTip as B}from"../chunk-P2VEMZH5.js";import{Tooltip as O,ColorSwatch as z,ColorPickerPanel as K,Button as F,IconButton as W,registerModalEscapeInterceptor as $,textToolbarRows as j,TextToolbar as H,LinkPicker as A}from"efficient-shell/ui";export{TextToolbar}from"efficient-shell/ui";import{useRef as I,useState as V,useLayoutEffect as U,useEffect as q,useId as Y}from"react";import{AlignJustifyIcon as G,AlignRightIcon as J,AlignCenterIcon as _,AlignLeftIcon as Z,ParagraphSpacingIcon as X,LetterSpacingIcon as Q,TextLinesIcon as ee,TextSizeIcon as te,ClearMarksIcon as ne,LinkIcon as re,QuietIcon as le,EmphasisIcon as oe,StrikeIcon as ae,ItalicIcon as se,BoldIcon as ie}from"efficient-shell/icons/efficient";import{jsx as ce,jsxs as ue,Fragment as de}from"react/jsx-runtime";var pe=["left","center","right","justify"],fe=e.align,he={left:/* @__PURE__ */ce(Z,{}),center:/* @__PURE__ */ce(_,{}),right:/* @__PURE__ */ce(J,{}),justify:/* @__PURE__ */ce(G,{})},me={three:{labelsPx:94.5,widestLabelPx:39.94},four:{labelsPx:140,widestLabelPx:44}};function ge(e,t=fe){return pe.filter(t=>e.includes(t)).map(e=>({id:e,label:t[e],icon:he[e],title:t[e]}))}var ye=/[\u1100-\u11ff\u2e80-\u9fff\uac00-\ud7af\uf900-\ufaff\uff00-\uffef]/;function ve(e){if(e.every(e=>e.label===fe[e.id]))return e.length>3?me.four:me.three;const t=e.map(e=>[...e.label].reduce((e,t)=>e+(ye.test(t)?13:8),0));return{labelsPx:t.reduce((e,t)=>e+t,0),widestLabelPx:Math.max(0,...t)}}function be(e,t){const n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}}function ke(e,t,n,r=f){const{start:l,end:o}=be(e,n);return r(e,l,o,t)}function xe(e,t,n){const{start:r,end:l}=be(e,n),o=r+t.length;return{text:e.slice(0,r)+t+e.slice(l),selectionStart:o,selectionEnd:o}}function we(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 Se(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 Ee(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 Ce({value:e,rules:l,multiline:u,readOnly:d=!1,placeholder:p,ariaLabel:f,handle:h,onEdit:m,onSelect:g,onHistory:y,onFormat:v,pending:b,onCommit:k,onCancel:x}){const w=I(null),S=I(null),E=I(null),C=I(null),D=I(null),N=I(e),[L,T]=V(0),M=I({value:e,rules:l,multiline:u,readOnly:d,pending:b,onEdit:m,onHistory:y,onFormat:v});M.current={value:e,rules:l,multiline:u,readOnly:d,pending:b,onEdit:m,onHistory:y,onFormat:v};const P=()=>{const e=w.current,t=S.current,n=e?.ownerDocument.getSelection();if(!(e&&t&&n&&0!==n.rangeCount&&n.anchorNode&&e.contains(n.anchorNode)))return null;const r=Se(t,e,n.anchorNode,n.anchorOffset),l=n.focusNode&&e.contains(n.focusNode)?Se(t,e,n.focusNode,n.focusOffset):r;return r<=l?[r,l]:[l,r]},R=(e,t)=>{const n=w.current,r=S.current;if(!n||!r)return;const[l,o]=Ee(r,e),[a,s]=Ee(r,t);n.ownerDocument.getSelection()?.setBaseAndExtent(l,o,a,s)};h.current={getSource(){const e=P(),t=S.current;if(!e||!t)return null;const[r,l]=n(t.layout,e[0],e[1]);return{start:r,end:l}},setSource(e,t,n){C.current={text:n,src:[e,t]},T(e=>e+1)},focus(){w.current?.focus()},rangeOf(e,n){const r=w.current,l=S.current;if(!r||!l)return null;const[o,a]=t(l.layout,e,n),[s,i]=Ee(l,o),[c,u]=Ee(l,a),d=r.ownerDocument.createRange();return d.setStart(s,i),d.setEnd(c,u),d}},U(()=>{const n=w.current;if(!n||D.current)return;const o=C.current?null:P();S.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=we(n,e.marks[r].kind,e.marks[r].href,e.marks[r].color);o().appendChild(t),l.push({id:e.marks[r].id,el:t})}a||(a=n.createTextNode(""),o().appendChild(a)),a.data+=e.ch}return 0===t.chars.length&&r.appendChild(n.createElement("br")),e.appendChild(r),r});return{layout:t,lines:r}}(n,r(e,l)),E.current=e;const a=C.current;if(!a||a.text!==e)return void(o&&n.ownerDocument.activeElement===n&&R(o[0],Math.min(o[1],S.current.layout.text.length)));C.current=null;const s=S.current.layout,[i,c]=a.vis??t(s,a.src[0],a.src[1]);n.ownerDocument.activeElement!==n&&n.focus(),R(i,c)},[e,l,L]);const B=(e,t,r)=>{const l=S.current,[o,a]=n(l.layout,t[0],t[1]);C.current={text:e.text,vis:[e.caret,e.caret]},e.text!==M.current.value?M.current.onEdit(e.text,{start:o,end:a},r):T(e=>e+1)};q(()=>{const e=w.current;if(!e)return;const t=t=>{const{value:n,rules:r,multiline:l,readOnly:o,pending:s}=M.current;if("insertCompositionText"===t.inputType)return;if(t.preventDefault(),o)return;const i=S.current,c=P();if(!i||!c)return;const u="function"==typeof t.getTargetRanges?t.getTargetRanges()[0]:void 0,d=u&&!u.collapsed?[Se(i,e,u.startContainer,u.startOffset),Se(i,e,u.endContainer,u.endOffset)]:null,p=a({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:d,pending:s});p&&("history"!==p.kind?"format"!==p.kind?B(p.edit,p.range,p.kind):M.current.onFormat(p.style):M.current.onHistory(p.dir))},n=()=>{D.current||T(e=>e+1)};return e.addEventListener("beforeinput",t),e.addEventListener("input",n),()=>{e.removeEventListener("beforeinput",t),e.removeEventListener("input",n)}},[]),q(()=>{const e=w.current;if(!e)return;const t=e.ownerDocument,n=()=>{const e=h.current?.getSource();e&&g(e)};return t.addEventListener("selectionchange",n),()=>t.removeEventListener("selectionchange",n)});const O=(t,n=!1)=>{const r=P();if(!r||r[0]===r[1])return;t.preventDefault();const o=S.current;t.clipboardData.setData("text/plain",o.layout.text.slice(r[0],r[1])),t.clipboardData.setData(i,c(e,l,r[0],r[1])),n&&!d&&B(s(e,l,r[0],r[1],{text:""}),r,"edit")};/* @__PURE__ */
2
- return ue("div",{className:"es-rich-wrap",children:[p&&""===e?/* @__PURE__ */ce("div",{className:"es-rich-placeholder","aria-hidden":"true",children:p}):null,
3
- /* @__PURE__ */ce("div",{ref:w,className:`es-rich${u?" is-multiline":" is-single"}${d?" is-off":""}`,contentEditable:!d,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":u,"aria-label":f,"aria-readonly":d||void 0,"aria-placeholder":p,tabIndex:d?-1:0,spellCheck:!0,onFocus:()=>{N.current=e},onBlur:()=>{e!==N.current&&k?.(e),N.current=e},onKeyDown:t=>{if("Escape"===t.key)return t.preventDefault(),x?.(N.current),void(N.current=e);"Enter"!==t.key||u||(t.preventDefault(),e!==N.current&&k?.(e),N.current=e)},onCompositionStart:()=>{const e=P()??[0,0];D.current={from:e[0],to:e[1]}},onCompositionEnd:e=>{const t=D.current;if(D.current=null,!t)return;const{value:n,rules:r,pending:l}=M.current;e.data?B(s(n,r,t.from,t.to,{text:e.data,add:l?.add,drop:l?.drop,color:l?.color}),[t.from,t.to],"type"):T(e=>e+1)},onCopy:e=>O(e),onCut:e=>O(e,!0),onPaste:t=>{if(t.preventDefault(),d)return;const n=P();if(!n)return;const r=t.clipboardData.getData(i),a=r?u?r:r.replace(/\s*\r?\n\s*/g," "):o({html:t.clipboardData.getData("text/html"),text:t.clipboardData.getData("text/plain")},{doc:t.currentTarget.ownerDocument,multiline:u,rules:l});B(s(e,l,n[0],n[1],{markup:a}),n,"edit")}})]})}var De={fontSize:{key:"fontSize",nameKey:"fontSize",icon:/* @__PURE__ */ce(te,{}),unit:"px",step:1,shiftStep:10,min:5},lineHeight:{key:"lineHeight",nameKey:"lineHeight",icon:/* @__PURE__ */ce(ee,{}),unit:"%",step:1,shiftStep:10,min:50,max:250,scale:100},letterSpacing:{key:"letterSpacing",nameKey:"letterSpacing",icon:/* @__PURE__ */ce(Q,{}),unit:"px",step:.1,shiftStep:1,min:-10},paragraphSpacing:{key:"paragraphSpacing",nameKey:"paragraphSpacing",icon:/* @__PURE__ */ce(X,{}),unit:"px",step:1,shiftStep:10,min:0}};function Ne(e,t){return void 0===e?void 0:Number((e*t).toFixed(6))}function Le({cells:t,words:n,readOnly:r=!1}){const l=n??e.cells;/* @__PURE__ */
4
- return ce("div",{className:"es-copy-cells",children:t.map(e=>{const t=e.scale??1,n=e.name??(e.nameKey?l[e.nameKey]:e.key),o=e.unit??"",a=e.step??1;/* @__PURE__ */
5
- return ce(u,{value:Ne(e.value,t),styleValue:Ne(e.styleValue,t),onChange:n=>e.onChange(void 0===n?void 0:Number((n/t).toFixed(6))),min:e.min,max:e.max,step:a,shiftStep:e.shiftStep,icon:e.icon,unit:o||void 0,steppers:"compact",readOnly:r,ariaLabel:n,title:l.tip({name:n,step:a,unit:o})},e.key)})})}var Te=e=>e.preventDefault();function Me({colors:e,current:t,words:n,onPick:r}){const l=null===t?null:t.startsWith("#")?t.toLowerCase():e.find(e=>e.name===t)?.value.toLowerCase()??null;/* @__PURE__ */
6
- return ue("div",{className:"es-copy-pop es-copy-colors",role:"dialog","aria-label":n.title,onMouseDown:e=>{"INPUT"!==e.target.tagName&&e.preventDefault()},children:[
7
- /* @__PURE__ */ce("span",{className:"es-copy-pop-label",children:n.theme}),
8
- /* @__PURE__ */ce("div",{className:"es-copy-theme",role:"group","aria-label":n.theme,children:e.map(e=>/* @__PURE__ */ce(O,{content:`${e.label} · ${e.value.toUpperCase()}`,children:/* @__PURE__ */ce(z,{color:e.value,size:"sm",className:"es-copy-theme-swatch","data-color":e.name,"aria-label":e.label,selected:t===e.name,onMouseDown:Te,onClick:()=>r(e.name)})},e.name))}),
9
- /* @__PURE__ */ce("span",{className:"es-copy-pop-label",children:n.any}),
10
- /* @__PURE__ */ce(K,{className:"es-copy-any",value:l??"",onChange:e=>{e!==t&&r(e)},label:n.title,dragWrites:"end"}),
11
- /* @__PURE__ */ce("div",{className:"es-copy-pop-foot",children:/* @__PURE__ */ce(F,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onMouseDown:Te,onClick:()=>r(null),children:n.remove})})]})}var Pe=(e,t,n)=>Math.min(Math.max(e,t),Math.max(t,n));var Re=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom});function Be(e){const t=e.ownerDocument,n=t.documentElement,r={left:0,top:0,right:n.clientWidth,bottom:n.clientHeight},l=t.defaultView?.getComputedStyle.bind(t.defaultView);for(let o=e.parentElement;o&&o!==n&&o!==t.body;o=o.parentElement){const e=l?.(o);if(!e||"visible"===e.overflowX&&"visible"===e.overflowY)continue;const t=o.getBoundingClientRect();if(0===t.width&&0===t.height)continue;const n=t.left+o.clientLeft,a=t.top+o.clientTop;r.left=Math.max(r.left,n),r.top=Math.max(r.top,a),r.right=Math.min(r.right,n+(o.clientWidth||t.width)),r.bottom=Math.min(r.bottom,a+(o.clientHeight||t.height))}return r}function Oe(e){const t=e.offsetParent??e.parentElement;if(!t)return{left:0,top:0};const n=t.getBoundingClientRect();return{left:n.left+t.clientLeft-t.scrollLeft,top:n.top+t.clientTop-t.scrollTop}}var ze=/* @__PURE__ */new Set([...p,"clear"]),Ke={bold:/* @__PURE__ */ce(ie,{size:16}),italic:/* @__PURE__ */ce(se,{size:16}),strike:/* @__PURE__ */ce(ae,{size:16}),highlight:/* @__PURE__ */ce(oe,{size:16}),quiet:/* @__PURE__ */ce(le,{size:16}),link:/* @__PURE__ */ce(re,{size:16}),clear:/* @__PURE__ */ce(ne,{size:16})};function Fe(e){if(!e)return;const t=e.split("+"),n=t.pop().toUpperCase();return["Meta",...t.map(e=>e[0].toUpperCase()+e.slice(1)),n].join("+")}var We={bold:"is-bold",italic:"is-italic",strike:"is-strike"};function $e({tools:t,onApply:n,disabled:r=!1,actions:l,align:o,glyphs:a,ariaLabel:s,pressed:i,open:c=null}){const u=R("copy",e),d=("string"==typeof t[0]?h(t).map(e=>({...e,...u.marks[e.style]})):t).filter(e=>!ze.has(e.style));return 0!==d.length||l||o?/* @__PURE__ */ue("div",{className:"es-copy-bar",role:"group","aria-label":s??u.formatting,children:[d.map(e=>{const t=a?.[e.style]??Ke[e.style],l=c===e.style||Boolean(i?.[e.style]),o="link"===e.style&&Boolean(i);return B(e.title,/* @__PURE__ */ce(W,{onMouseDown:e=>e.preventDefault(),onClick:()=>n(e.style),disabled:r,"aria-label":e.name??e.title,"aria-keyshortcuts":Fe(e.shortcut),"aria-pressed":o||!i&&!c?void 0:l,pressed:o?l:void 0,"aria-haspopup":o?"dialog":void 0,"aria-expanded":o?"link"===c:void 0,className:`es-copy-mark${t?" has-glyph":We[e.style]?` ${We[e.style]}`:""}${l?" is-active":""}`,children:t??e.label},e.style))}),l?/* @__PURE__ */ue(de,{children:[
12
- /* @__PURE__ */ce("span",{className:"es-copy-bar-split","aria-hidden":"true"}),l]}):null,o?/* @__PURE__ */ce("span",{className:"es-copy-bar-end",children:o}):null]}):null}function je({target:e,onChange:t}){const n=I(null);return U(()=>{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 He=["bold","italic","underline","strike","sup","sub"];function Ae({value:t,onChange:n,onCommit:r,onCancel:a,multiline:s=!1,placeholder:i,ariaLabel:c,className:u,readOnly:p=!1,rules:O,tools:z=[],writeMark:K,actions:W,align:G,glyphs:J,barLabel:_,renderFooter:Z,inputRef:X,barShows:Q="always",richText:ee=!0,defaultShowMarks:te=!1,toolbar:re="final",colors:le,cells:oe,letterCase:ae,lastTool:se}){const ie="final"===re,pe=R("copy",e),fe=I(null),he=X??fe,[me,ye]=V(!1),[be,we]=V(null),Se=I(l()).current,Ee=I(null);q(()=>{const e=Ee.current;e&&t===e.to?Ee.current=null:e&&t===e.from||(Ee.current=null,Se.reset())},[t,Se]);const De=e=>{Ee.current={from:Ee.current?.from??t,to:e},n(e)},Ne=e=>({text:t,start:e?.selectionStart??be?.start??t.length,end:e?.selectionEnd??be?.end??t.length}),[Te,Ke]=V(te),Fe=ee&&!(s&&Te),We=I(null),Ae=Y(),[Ie,Ve]=V(null),[Ue,qe]=V(!1),Ye=()=>{if(!Fe)return he.current;const e=We.current?.getSource()??be;return e?{selectionStart:e.start,selectionEnd:e.end}:null},Ge=je({target:he,onChange:De}),Je=e=>(we({start:e.selectionStart,end:e.selectionEnd}),e),_e=(e,n)=>{if(!Fe)return void Ge(t=>(n&&Se.record(Ne(t),"edit",Date.now()),Je(e(t))));const r=Ye(),l=Je(e(r));n&&Se.record(Ne(r),"edit",Date.now()),Ve(null),l.text!==t&&De(l.text),We.current?.setSource(l.selectionStart,l.selectionEnd,l.text)},Ze=e=>_e(e,!0),Xe=e=>_e(t=>{const n=Ne(t),r=Se[e](n);return r?{text:r.text,selectionStart:r.start,selectionEnd:r.end}:{text:n.text,selectionStart:n.start,selectionEnd:n.end}},!1),Qe=I(null);U(()=>{const e=Qe.current;e&&(Qe.current=null,Fe?We.current?.setSource(e.start,e.end,t):(he.current?.focus(),he.current?.setSelectionRange(e.start,e.end),we(e)))},[Fe]);const[et,tt]=V(null),nt=O??g,rt=("string"==typeof z[0]?h(z):z).filter(e=>!ze.has(e.style)),lt=ie?("string"==typeof z[0]?z:z.map(e=>e.style)).filter(e=>!ze.has(e)):rt.map(e=>e.style),ot={};if(be&&(Fe||ie)){const e=m(t,be.start,be.end,nt);for(const t of lt){const n=e.has(t)||"highlight"===t&&e.has("accent");ot[t]=!!Ie?.add.includes(t)||!Ie?.drop.includes(t)&&n}ie&&(ot.link=e.has("link"))}else if(be)for(const e of lt)ot[e]="link"===e?null!==y(t,be.start,be.end):v(t,be.start,be.end,e);const at=()=>{const e=Ye(),n=e?.selectionStart??t.length;return{start:n,end:e?.selectionEnd??n}},st={sup:"sub",sub:"sup"},it=e=>{if(ie&&"link"!==e&&x(0,e)){const{start:n,end:r}=at(),l=st[e];if(n===r){if(!Fe)return void Ze(n=>ke(t,e,n,(e,t,n,r)=>f(e,t,n,r,nt,pe.placeholders)));const o=m(t,n,r,nt),a=Ie&&Ie.at===n?Ie:null,s=o.has(e),i=!!a?.add.includes(e)||!a?.drop.includes(e)&&s;let c=(a?.add??[]).filter(t=>t!==e),u=(a?.drop??[]).filter(t=>t!==e);return i&&s?u.push(e):i||s||c.push(e),!i&&l&&(c=c.filter(e=>e!==l),o.has(l)&&(u=[...u.filter(e=>e!==l),l])),void Ve(c.length||u.length||void 0!==a?.color?{add:c,drop:u,color:a?.color,at:n}:null)}return void Ze(()=>{let o=t,a=n,s=r;if(l&&!m(o,a,s,nt).has(e)&&m(o,a,s,nt).has(l)){const e=S(o,a,s,l,nt);({text:o,selectionStart:a,selectionEnd:s}=e)}return S(o,a,s,e,nt)})}if("clear"===e)return void Ze(n=>ke(t,e,n,(e,t,n)=>f(e,t,n,"clear",nt)));if("link"!==e&&Fe&&x(0,e)){const n=Ye(),r=n?.selectionStart??t.length,l=n?.selectionEnd??r;if(r===l){const n=m(t,r,l,nt),o=n.has(e)||"highlight"===e&&n.has("accent"),a=Ie&&Ie.at===r?Ie:null,s=!!a?.add.includes(e)||!a?.drop.includes(e)&&o,i=(a?.add??[]).filter(t=>t!==e),c=(a?.drop??[]).filter(t=>t!==e);return s&&o?c.push(e):s||o||i.push(e),void Ve(i.length||c.length?{add:i,drop:c,at:r}:null)}return void Ze(n=>S(t,n?.selectionStart??r,n?.selectionEnd??l,e,nt))}if("link"!==e){const n=K??((e,t,n,r)=>f(e,t,n,r,g,pe.placeholders));return void Ze(r=>ke(t,e,r,n))}const n=Ye(),r=n?.selectionStart??t.length,l=n?.selectionEnd??r;qe(!1),tt({start:r,end:l,link:y(t,r,l)})},ct=Boolean(be&&be.start!==be.end),ut=be?b(t,be.start,be.end,nt):null,dt=be?Ie&&void 0!==Ie.color&&Ie.at===be.start?Ie.color:k(t,be.start,be.end,nt):null,pt=dt?dt.startsWith("#")?dt:le?.find(e=>e.name===dt)?.value:void 0,ft=e=>{Fe?e?We.current?.setSource(e.start,e.end,t):We.current?.focus():(he.current?.focus(),e&&he.current?.setSelectionRange(e.start,e.end))},ht=()=>{const e=et;tt(null),ft(e?{start:e.start,end:e.end}:be)},mt=()=>{const e=yt.current,t=Boolean(e&&e.querySelector(".es-copy-colors")?.contains(e.ownerDocument.activeElement));qe(!1),t&&ft(be)},gt=I(mt);gt.current=mt,q(()=>{if(Ue)return $(e=>{const t=yt.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&(gt.current(),!0)},()=>yt.current?.querySelector(".es-copy-colors"))},[Ue]);const yt=I(null),vt=Ue||null!==et;q(()=>{const e=yt.current;if(!vt||!e)return;const t=e.ownerDocument,n=()=>{qe(!1),tt(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)}},[vt]);const bt=et??(Ue?be??{start:t.length,end:t.length}:null),kt=I(()=>{});kt.current=()=>{const e=yt.current,t=e?.querySelector(".rosh-tb-wrap > .es-copy-pop");if(!e||!t||!bt)return;const n=Fe?null:e.querySelector(".es-gold-layer"),r=Fe?We.current?.rangeOf(bt.start,bt.end)??null:n?function(e,t,n){const r=e.ownerDocument,l=r.createTreeWalker(e,4),o=e=>{let t=e,n=null;for(let e=l.nextNode();e;e=l.nextNode()){if(t<=e.data.length)return[e,t];t-=e.data.length,n=e}return n?[n,n.data.length]:null},a=o(t);l.currentNode=e;const s=o(n);if(!a||!s)return null;const i=r.createRange();return i.setStart(a[0],a[1]),i.setEnd(s[0],s[1]),i}(n,bt.start,bt.end):null,l=r?.endContainer,o=l?1===l.nodeType?l:l.parentElement:null,a=r?function(e,t){const n=("function"==typeof e.getClientRects?[...e.getClientRects()]:[]).filter(e=>e.height>0);if(n.length>0){const t="function"==typeof e.getBoundingClientRect?e.getBoundingClientRect():n[0];return t.height>0?Re(t):Re(n[0])}if(!t)return null;const r=t.getBoundingClientRect();return{left:r.left,top:r.top,right:r.left,bottom:r.bottom}}(r,o?.closest(".es-rich-line, .es-gold-layer")??null):null;if(!a)return;const s=function({anchor:e,size:t,within:n,clip:r,parent:l,gap:o=8}){const a=Math.max(n.left,r.left),s=Math.min(n.right,r.right)-t.width,i=Pe(e.left,a,s),c=r.bottom-(e.bottom+o),u=e.top-o-r.top,d=t.height>c&&(t.height<=u||u>c),p=d?e.top-o-t.height:e.bottom+o,f=e.left+Math.min((e.right-e.left)/2,10),h=Pe(f-5-i,10,t.width-10-10);return{top:p-l.top,left:i-l.left,above:d,point:h}}({anchor:a,size:{width:t.offsetWidth,height:t.offsetHeight},within:e.getBoundingClientRect(),clip:Be(e),parent:Oe(t)});t.style.top=`${s.top}px`,t.style.left=`${s.left}px`,t.style.setProperty("--es-pop-point",`${s.point}px`),t.dataset.side=s.above?"above":"below"},U(()=>{const e=yt.current;if(!vt||!e)return;const t=()=>kt.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()}},[vt,Ue,et,bt?.start,bt?.end,Fe]);const xt=e=>et&&/* @__PURE__ */ce(A,{className:e?"es-copy-link es-copy-pop":"es-copy-link",value:et.link?.href??"",onApply:e=>{const n=et;tt(null),Ze(()=>Fe?L(t,n.start,n.end,e,nt):T(t,n.start,n.end,e))},onRemove:et.link?()=>{const e=et.link,n=et;tt(null),e&&Ze(()=>Fe?D(t,n.start,n.end,nt):N(t,e))}:void 0,onCancel:ht}),wt=G?ge(G.allow,pe.align):[],St="always"===Q||me||null!==et||Ue,Et=le&&le.length>0?{run:pt,open:Ue,onToggle:()=>{tt(null),Ue?mt():qe(!0)}}:void 0,Ct=St&&ie&&se?se({className:"rosh-tb-btn",disabled:p,selected:ct,keepCaret:e=>e.preventDefault(),insert:e=>Ze(n=>xe(t,e,n))}):void 0,Dt=new Set(lt),Nt=G?{value:G.value,allow:G.allow,onChange:G.onChange,disabled:G.disabled}:void 0,Lt={pressed:ut,onList:e=>{const{start:n,end:r}=at(),l=b(t,n,r,nt);Ze(()=>C(t,n,r,l===e?null:e,nt))}},Tt=j({offered:Dt,color:Et,last:Ct,alignment:Nt,list:Lt,letterCase:ae}),Mt=ie&&St&&(He.some(e=>Dt.has(e))||Boolean(Et));/* @__PURE__ */
13
- return ue("div",{ref:yt,className:"es-copy"+(u?` ${u}`:""),onFocus:()=>ye(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||ye(!1)},onKeyDown:e=>{const t=e.target===he.current||Boolean(e.target.closest?.(".es-rich"));if(p||!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 Xe(l||e.shiftKey?"redo":"undo");const o=`${e.shiftKey?"shift+":""}${n}`;if(ie){const t={b:"bold",i:"italic",u:"underline",k:"link"}[o];if(!t||!lt.includes(t))return;return e.preventDefault(),e.stopPropagation(),void it(t)}const a=rt.find(e=>e.shortcut===o);a&&(e.preventDefault(),e.stopPropagation(),it(a.style))},onPaste:e=>{const n=he.current;if(p||!n||e.target!==n)return;e.preventDefault();const r=o({html:e.clipboardData.getData("text/html"),text:e.clipboardData.getData("text/plain")},{doc:n.ownerDocument,multiline:s,rules:nt});Ze(e=>xe(t,r,e))},style:le&&le.length>0?Object.fromEntries(le.map(e=>[`--es-color-${e.name}`,e.value])):void 0,onSelect:()=>{const e=he.current;e&&e.ownerDocument.activeElement===e&&we({start:e.selectionStart??t.length,end:e.selectionEnd??t.length})},children:[St&&ie&&(Tt.words||Tt.paragraph)?
14
- /* @__PURE__ */ce(H,{className:"es-copy-toolbar","aria-label":_??pe.formatting,offered:Dt,pressed:ot,onMark:e=>it(e),color:Et,linkOpen:null!==et,last:Ct,alignment:Nt,list:Lt,letterCase:ae,disabled:p,windows:/* @__PURE__ */ue(de,{children:[Ue&&le&&le.length>0?/* @__PURE__ */ce(Me,{colors:le,current:dt,words:pe.colors??e.colors,onPick:e=>{const{start:n,end:r}=at();if(n!==r)Ze(()=>E(t,n,r,e,nt));else{if(!Fe)return;Ve({add:Ie?.add??[],drop:Ie?.drop??[],color:e,at:n})}}}):null,et?xt(!0):null]})}):null,ie&&oe&&oe.length>0?/* @__PURE__ */ce(Le,{cells:oe,words:pe.cells??e.cells,readOnly:p}):null,St&&!ie?/* @__PURE__ */ce($e,{tools:z,disabled:p,actions:W,glyphs:J,ariaLabel:_,pressed:ot,open:et?"link":null,onApply:it,align:G?/* @__PURE__ */ce(M,{options:wt,value:G.value,onChange:G.onChange,ariaLabel:pe.alignment,disabled:p||G.disabled,fit:ve(wt)}):null}):null,Fe?/* @__PURE__ */ce(Ce,{value:t,rules:nt,multiline:s,readOnly:p,placeholder:i,ariaLabel:c,handle:We,pending:Ie??void 0,onEdit:(e,n,r)=>{Se.record({text:t,start:n.start,end:n.end},r,Date.now()),Ve(null),De(e)},onSelect:e=>{we(t=>t&&t.start===e.start&&t.end===e.end?t:e),!Ie||e.start===Ie.at&&e.end===Ie.at||Ve(null)},onHistory:Xe,onFormat:e=>{lt.includes(e)&&it(e)},onCommit:r,onCancel:a}):/* @__PURE__ */ce(d,{value:t,onInput:e=>{Se.record(Ne(null),"type",Date.now()),De(e)},onCommit:r,onCancel:a,multiline:s,placeholder:i,ariaLabel:c,rules:O,disabled:p,inputRef:he,className:"es-copy-box"}),et&&!ie?xt(!1):null,Z?Z({focused:me,insert:e=>Ze(n=>xe(t,e,n))}):null,ee&&s||Mt?
15
- /* @__PURE__ */ue("div",{className:"es-copy-marks",children:[ee&&s?/* @__PURE__ */ue(de,{children:[
16
- /* @__PURE__ */ce(P,{checked:Te,onChange:()=>{const e=Ye();Qe.current=e&&null!==e.selectionStart&&null!==e.selectionEnd?{start:e.selectionStart,end:e.selectionEnd}:be,Ve(null),Ke(e=>!e)},ariaLabelledBy:Ae,disabled:p}),
17
- /* @__PURE__ */ce("span",{id:Ae,className:"es-copy-marks-label",children:pe.showMarks??"Show marks"})]}):null,Mt?B(ct?void 0:pe.clearStyleEmpty??"Select words first",/* @__PURE__ */ue(F,{variant:"secondary",size:"sm",className:"es-copy-clear",disabled:p||!ct,onMouseDown:e=>e.preventDefault(),onClick:()=>{const{start:e,end:n}=at();if(e===n)return;const r=w(t,e,n,nt);r.text!==t&&Ze(()=>r)},children:[
18
- /* @__PURE__ */ce(ne,{size:16}),pe.clearStyle??"Clear style"]})):null]}):null]})}export{pe as COPY_ALIGNS,me as COPY_ALIGN_FIT,he as COPY_ALIGN_GLYPHS,fe as COPY_ALIGN_LABELS,De as COPY_CELLS,Me as ColorWindow,Ae as CopyBox,Le as CopyCells,$e as MarkBar,Ce as RichBox,Fe as ariaShortcut,ge as copyAlignOptions,xe as insertSelection,ke as markSelection,je as useCaretEdit};
1
+ import{DEFAULT_COPY_WORDS as e}from"../chunk-AUT242JK.js";import{selectionToVisible as t,selectionToSource as n,richLayout as r,createHistory as l,markPress as o,pasteToMarkup as a,richInput as s,editVisible as i,MARKUP_CLIPBOARD_TYPE as c,markupOfRange as u}from"../chunk-CIHKZMNR.js";export{MARKUP_CLIPBOARD_TYPE,TYPING_BURST_MS,createHistory,editVisible,markupOfRange,newLine,pasteToMarkup,richInput,richLayout,selectionToSource,selectionToVisible,setBullet,startCanvasTyping,textMap,toSource,toSourceStart,toVisible}from"../chunk-CIHKZMNR.js";import{FieldNumber as d}from"../chunk-66LWADFP.js";import{SettingsSegmented as p,SettingsSwitch as f}from"../chunk-QLD57GBB.js";import"../chunk-FFYXVAAL.js";import{GoldTextInput as h}from"../chunk-2FZJWH24.js";import{RETIRED_MARKS as m,applyMark as g,markupTools as y,marksIn as v,STANDARD_MARKUP as b,findLink as k,markedAt as x,listIn as w,colorIn as S,spanFor as E,clearStyle as C,toggleMark as D,colorOver as N,setList as L,unlinkAt as T,removeLink as M,linkOver as R,writeLink as B}from"../chunk-546BBOPE.js";import{useWords as P}from"../chunk-MFIRYGHW.js";import{withTip as O}from"../chunk-P2VEMZH5.js";import{Tooltip as z,ColorSwatch as K,ColorPickerPanel as H,Button as F,IconButton as $,registerModalEscapeInterceptor as j,textToolbarRows as W,TextToolbar as A,LinkPicker as I}from"efficient-shell/ui";export{TextToolbar}from"efficient-shell/ui";import{useRef as V,useState as U,useLayoutEffect as q,useEffect as Y,useId as Z}from"react";import{AlignJustifyIcon as _,AlignRightIcon as G,AlignCenterIcon as J,AlignLeftIcon as X,ParagraphSpacingIcon as Q,LetterSpacingIcon as ee,TextLinesIcon as te,TextSizeIcon as ne,ClearMarksIcon as re,LinkIcon as le,QuietIcon as oe,EmphasisIcon as ae,StrikeIcon as se,ItalicIcon as ie,BoldIcon as ce}from"efficient-shell/icons/efficient";import{jsx as ue,jsxs as de,Fragment as pe}from"react/jsx-runtime";var fe=["left","center","right","justify"],he=e.align,me={left:/* @__PURE__ */ue(X,{}),center:/* @__PURE__ */ue(J,{}),right:/* @__PURE__ */ue(G,{}),justify:/* @__PURE__ */ue(_,{})},ge={three:{labelsPx:94.5,widestLabelPx:39.94},four:{labelsPx:140,widestLabelPx:44}};function ye(e,t=he){return fe.filter(t=>e.includes(t)).map(e=>({id:e,label:t[e],icon:me[e],title:t[e]}))}var ve=/[\u1100-\u11ff\u2e80-\u9fff\uac00-\ud7af\uf900-\ufaff\uff00-\uffef]/;function be(e){if(e.every(e=>e.label===he[e.id]))return e.length>3?ge.four:ge.three;const t=e.map(e=>[...e.label].reduce((e,t)=>e+(ve.test(t)?13:8),0));return{labelsPx:t.reduce((e,t)=>e+t,0),widestLabelPx:Math.max(0,...t)}}function ke(e,t){const n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}}function xe(e,t,n,r=g){const{start:l,end:o}=ke(e,n);return r(e,l,o,t)}function we(e,t,n){const{start:r,end:l}=ke(e,n),o=r+t.length;return{text:e.slice(0,r)+t+e.slice(l),selectionStart:o,selectionEnd:o}}function Se(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 Ee(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 Ce(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 De({value:e,rules:l,multiline:o,readOnly:d=!1,placeholder:p,ariaLabel:f,handle:h,onEdit:m,onSelect:g,onHistory:y,onFormat:v,pending:b,onCommit:k,onCancel:x}){const w=V(null),S=V(null),E=V(null),C=V(null),D=V(null),N=V(e),[L,T]=U(0),M=V({value:e,rules:l,multiline:o,readOnly:d,pending:b,onEdit:m,onHistory:y,onFormat:v});M.current={value:e,rules:l,multiline:o,readOnly:d,pending:b,onEdit:m,onHistory:y,onFormat:v};const R=()=>{const e=w.current,t=S.current,n=e?.ownerDocument.getSelection();if(!(e&&t&&n&&0!==n.rangeCount&&n.anchorNode&&e.contains(n.anchorNode)))return null;const r=Ee(t,e,n.anchorNode,n.anchorOffset),l=n.focusNode&&e.contains(n.focusNode)?Ee(t,e,n.focusNode,n.focusOffset):r;return r<=l?[r,l]:[l,r]},B=(e,t)=>{const n=w.current,r=S.current;if(!n||!r)return;const[l,o]=Ce(r,e),[a,s]=Ce(r,t);n.ownerDocument.getSelection()?.setBaseAndExtent(l,o,a,s)};h.current={getSource(){const e=R(),t=S.current;if(!e||!t)return null;const[r,l]=n(t.layout,e[0],e[1]);return{start:r,end:l}},setSource(e,t,n){C.current={text:n,src:[e,t]},T(e=>e+1)},focus(){w.current?.focus()},rangeOf(e,n){const r=w.current,l=S.current;if(!r||!l)return null;const[o,a]=t(l.layout,e,n),[s,i]=Ce(l,o),[c,u]=Ce(l,a),d=r.ownerDocument.createRange();return d.setStart(s,i),d.setEnd(c,u),d}},q(()=>{const n=w.current;if(!n||D.current)return;const o=C.current?null:R();S.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=Se(n,e.marks[r].kind,e.marks[r].href,e.marks[r].color);o().appendChild(t),l.push({id:e.marks[r].id,el:t})}a||(a=n.createTextNode(""),o().appendChild(a)),a.data+=e.ch}return 0===t.chars.length&&r.appendChild(n.createElement("br")),e.appendChild(r),r});return{layout:t,lines:r}}(n,r(e,l)),E.current=e;const a=C.current;if(!a||a.text!==e)return void(o&&n.ownerDocument.activeElement===n&&B(o[0],Math.min(o[1],S.current.layout.text.length)));C.current=null;const s=S.current.layout,[i,c]=a.vis??t(s,a.src[0],a.src[1]);n.ownerDocument.activeElement!==n&&n.focus(),B(i,c)},[e,l,L]);const P=(e,t,r)=>{const l=S.current,[o,a]=n(l.layout,t[0],t[1]);C.current={text:e.text,vis:[e.caret,e.caret]},e.text!==M.current.value?M.current.onEdit(e.text,{start:o,end:a},r):T(e=>e+1)};Y(()=>{const e=w.current;if(!e)return;const t=t=>{const{value:n,rules:r,multiline:l,readOnly:o,pending:a}=M.current;if("insertCompositionText"===t.inputType)return;if(t.preventDefault(),o)return;const i=S.current,c=R();if(!i||!c)return;const u="function"==typeof t.getTargetRanges?t.getTargetRanges()[0]:void 0,d=u&&!u.collapsed?[Ee(i,e,u.startContainer,u.startOffset),Ee(i,e,u.endContainer,u.endOffset)]:null,p=s({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:d,pending:a});p&&("history"!==p.kind?"format"!==p.kind?P(p.edit,p.range,p.kind):M.current.onFormat(p.style):M.current.onHistory(p.dir))},n=()=>{D.current||T(e=>e+1)};return e.addEventListener("beforeinput",t),e.addEventListener("input",n),()=>{e.removeEventListener("beforeinput",t),e.removeEventListener("input",n)}},[]),Y(()=>{const e=w.current;if(!e)return;const t=e.ownerDocument,n=()=>{const e=h.current?.getSource();e&&g(e)};return t.addEventListener("selectionchange",n),()=>t.removeEventListener("selectionchange",n)});const O=(t,n=!1)=>{const r=R();if(!r||r[0]===r[1])return;t.preventDefault();const o=S.current;t.clipboardData.setData("text/plain",o.layout.text.slice(r[0],r[1])),t.clipboardData.setData(c,u(e,l,r[0],r[1])),n&&!d&&P(i(e,l,r[0],r[1],{text:""}),r,"edit")};/* @__PURE__ */
2
+ return de("div",{className:"es-rich-wrap",children:[p&&""===e?/* @__PURE__ */ue("div",{className:"es-rich-placeholder","aria-hidden":"true",children:p}):null,
3
+ /* @__PURE__ */ue("div",{ref:w,className:`es-rich${o?" is-multiline":" is-single"}${d?" is-off":""}`,contentEditable:!d,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":o,"aria-label":f,"aria-readonly":d||void 0,"aria-placeholder":p,tabIndex:d?-1:0,spellCheck:!0,onFocus:()=>{N.current=e},onBlur:()=>{e!==N.current&&k?.(e),N.current=e},onKeyDown:t=>{if("Escape"===t.key)return t.preventDefault(),x?.(N.current),void(N.current=e);"Enter"!==t.key||o||(t.preventDefault(),e!==N.current&&k?.(e),N.current=e)},onCompositionStart:()=>{const e=R()??[0,0];D.current={from:e[0],to:e[1]}},onCompositionEnd:e=>{const t=D.current;if(D.current=null,!t)return;const{value:n,rules:r,pending:l}=M.current;e.data?P(i(n,r,t.from,t.to,{text:e.data,add:l?.add,drop:l?.drop,color:l?.color}),[t.from,t.to],"type"):T(e=>e+1)},onCopy:e=>O(e),onCut:e=>O(e,!0),onPaste:t=>{if(t.preventDefault(),d)return;const n=R();if(!n)return;const r=t.clipboardData.getData(c),s=r?o?r:r.replace(/\s*\r?\n\s*/g," "):a({html:t.clipboardData.getData("text/html"),text:t.clipboardData.getData("text/plain")},{doc:t.currentTarget.ownerDocument,multiline:o,rules:l});P(i(e,l,n[0],n[1],{markup:s}),n,"edit")}})]})}var Ne={fontSize:{key:"fontSize",nameKey:"fontSize",icon:/* @__PURE__ */ue(ne,{}),unit:"px",step:1,shiftStep:10,min:5},lineHeight:{key:"lineHeight",nameKey:"lineHeight",icon:/* @__PURE__ */ue(te,{}),unit:"%",step:1,shiftStep:10,min:50,max:250,scale:100},letterSpacing:{key:"letterSpacing",nameKey:"letterSpacing",icon:/* @__PURE__ */ue(ee,{}),unit:"px",step:.1,shiftStep:1,min:-10},paragraphSpacing:{key:"paragraphSpacing",nameKey:"paragraphSpacing",icon:/* @__PURE__ */ue(Q,{}),unit:"px",step:1,shiftStep:10,min:0}};function Le(e,t){return void 0===e?void 0:Number((e*t).toFixed(6))}function Te({cells:t,words:n,readOnly:r=!1}){const l=n??e.cells;/* @__PURE__ */
4
+ return ue("div",{className:"es-copy-cells",children:t.map(e=>{const t=e.scale??1,n=e.name??(e.nameKey?l[e.nameKey]:e.key),o=e.unit??"",a=e.step??1;/* @__PURE__ */
5
+ return ue(d,{value:Le(e.value,t),styleValue:Le(e.styleValue,t),onChange:n=>e.onChange(void 0===n?void 0:Number((n/t).toFixed(6))),min:e.min,max:e.max,step:a,shiftStep:e.shiftStep,icon:e.icon,unit:o||void 0,steppers:"compact",readOnly:r,ariaLabel:n,title:l.tip({name:n,step:a,unit:o})},e.key)})})}var Me=e=>e.preventDefault();function Re({colors:e,current:t,words:n,onPick:r}){const l=null===t?null:t.startsWith("#")?t.toLowerCase():e.find(e=>e.name===t)?.value.toLowerCase()??null;/* @__PURE__ */
6
+ return de("div",{className:"es-copy-pop es-copy-colors",role:"dialog","aria-label":n.title,onMouseDown:e=>{"INPUT"!==e.target.tagName&&e.preventDefault()},children:[
7
+ /* @__PURE__ */ue("span",{className:"es-copy-pop-label",children:n.theme}),
8
+ /* @__PURE__ */ue("div",{className:"es-copy-theme",role:"group","aria-label":n.theme,children:e.map(e=>/* @__PURE__ */ue(z,{content:`${e.label} · ${e.value.toUpperCase()}`,children:/* @__PURE__ */ue(K,{color:e.value,size:"sm",className:"es-copy-theme-swatch","data-color":e.name,"aria-label":e.label,selected:t===e.name,onMouseDown:Me,onClick:()=>r(e.name)})},e.name))}),
9
+ /* @__PURE__ */ue("span",{className:"es-copy-pop-label",children:n.any}),
10
+ /* @__PURE__ */ue(H,{className:"es-copy-any",value:l??"",onChange:e=>{e!==t&&r(e)},label:n.title,dragWrites:"end"}),
11
+ /* @__PURE__ */ue("div",{className:"es-copy-pop-foot",children:/* @__PURE__ */ue(F,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onMouseDown:Me,onClick:()=>r(null),children:n.remove})})]})}var Be=(e,t,n)=>Math.min(Math.max(e,t),Math.max(t,n));var Pe=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom});function Oe(e){const t=e.ownerDocument,n=t.documentElement,r={left:0,top:0,right:n.clientWidth,bottom:n.clientHeight},l=t.defaultView?.getComputedStyle.bind(t.defaultView);for(let o=e.parentElement;o&&o!==n&&o!==t.body;o=o.parentElement){const e=l?.(o);if(!e||"visible"===e.overflowX&&"visible"===e.overflowY)continue;const t=o.getBoundingClientRect();if(0===t.width&&0===t.height)continue;const n=t.left+o.clientLeft,a=t.top+o.clientTop;r.left=Math.max(r.left,n),r.top=Math.max(r.top,a),r.right=Math.min(r.right,n+(o.clientWidth||t.width)),r.bottom=Math.min(r.bottom,a+(o.clientHeight||t.height))}return r}function ze(e){const t=e.offsetParent??e.parentElement;if(!t)return{left:0,top:0};const n=t.getBoundingClientRect();return{left:n.left+t.clientLeft-t.scrollLeft,top:n.top+t.clientTop-t.scrollTop}}var Ke=/* @__PURE__ */new Set([...m,"clear"]),He={bold:/* @__PURE__ */ue(ce,{size:16}),italic:/* @__PURE__ */ue(ie,{size:16}),strike:/* @__PURE__ */ue(se,{size:16}),highlight:/* @__PURE__ */ue(ae,{size:16}),quiet:/* @__PURE__ */ue(oe,{size:16}),link:/* @__PURE__ */ue(le,{size:16}),clear:/* @__PURE__ */ue(re,{size:16})};function Fe(e){if(!e)return;const t=e.split("+"),n=t.pop().toUpperCase();return["Meta",...t.map(e=>e[0].toUpperCase()+e.slice(1)),n].join("+")}var $e={bold:"is-bold",italic:"is-italic",strike:"is-strike"};function je({tools:t,onApply:n,disabled:r=!1,actions:l,align:o,glyphs:a,ariaLabel:s,pressed:i,open:c=null}){const u=P("copy",e),d=("string"==typeof t[0]?y(t).map(e=>({...e,...u.marks[e.style]})):t).filter(e=>!Ke.has(e.style));return 0!==d.length||l||o?/* @__PURE__ */de("div",{className:"es-copy-bar",role:"group","aria-label":s??u.formatting,children:[d.map(e=>{const t=a?.[e.style]??He[e.style],l=c===e.style||Boolean(i?.[e.style]),o="link"===e.style&&Boolean(i);return O(e.title,/* @__PURE__ */ue($,{onMouseDown:e=>e.preventDefault(),onClick:()=>n(e.style),disabled:r,"aria-label":e.name??e.title,"aria-keyshortcuts":Fe(e.shortcut),"aria-pressed":o||!i&&!c?void 0:l,pressed:o?l:void 0,"aria-haspopup":o?"dialog":void 0,"aria-expanded":o?"link"===c:void 0,className:`es-copy-mark${t?" has-glyph":$e[e.style]?` ${$e[e.style]}`:""}${l?" is-active":""}`,children:t??e.label},e.style))}),l?/* @__PURE__ */de(pe,{children:[
12
+ /* @__PURE__ */ue("span",{className:"es-copy-bar-split","aria-hidden":"true"}),l]}):null,o?/* @__PURE__ */ue("span",{className:"es-copy-bar-end",children:o}):null]}):null}function We({target:e,onChange:t}){const n=V(null);return q(()=>{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 Ae=["bold","italic","underline","strike","sup","sub"];function Ie({value:t,onChange:n,onCommit:r,onCancel:s,multiline:i=!1,placeholder:c,ariaLabel:u,className:d,readOnly:m=!1,rules:z,tools:K=[],writeMark:H,actions:$,align:_,glyphs:G,barLabel:J,renderFooter:X,inputRef:Q,barShows:ee="always",richText:te=!0,defaultShowMarks:ne=!1,toolbar:le="final",colors:oe,cells:ae,letterCase:se,lastTool:ie}){const ce="final"===le,fe=P("copy",e),he=V(null),me=Q??he,[ge,ve]=U(!1),[ke,Se]=U(null),Ee=V(l()).current,Ce=V(null);Y(()=>{const e=Ce.current;e&&t===e.to?Ce.current=null:e&&t===e.from||(Ce.current=null,Ee.reset())},[t,Ee]);const Ne=e=>{Ce.current={from:Ce.current?.from??t,to:e},n(e)},Le=e=>({text:t,start:e?.selectionStart??ke?.start??t.length,end:e?.selectionEnd??ke?.end??t.length}),[Me,He]=U(ne),Fe=te&&!(i&&Me),$e=V(null),Ie=Z(),[Ve,Ue]=U(null),[qe,Ye]=U(!1),Ze=()=>{if(!Fe)return me.current;const e=$e.current?.getSource()??ke;return e?{selectionStart:e.start,selectionEnd:e.end}:null},_e=We({target:me,onChange:Ne}),Ge=e=>(Se({start:e.selectionStart,end:e.selectionEnd}),e),Je=(e,n)=>{if(!Fe)return void _e(t=>(n&&Ee.record(Le(t),"edit",Date.now()),Ge(e(t))));const r=Ze(),l=Ge(e(r));n&&Ee.record(Le(r),"edit",Date.now()),Ue(null),l.text!==t&&Ne(l.text),$e.current?.setSource(l.selectionStart,l.selectionEnd,l.text)},Xe=e=>Je(e,!0),Qe=e=>Je(t=>{const n=Le(t),r=Ee[e](n);return r?{text:r.text,selectionStart:r.start,selectionEnd:r.end}:{text:n.text,selectionStart:n.start,selectionEnd:n.end}},!1),et=V(null);q(()=>{const e=et.current;e&&(et.current=null,Fe?$e.current?.setSource(e.start,e.end,t):(me.current?.focus(),me.current?.setSelectionRange(e.start,e.end),Se(e)))},[Fe]);const[tt,nt]=U(null),rt=z??b,lt=("string"==typeof K[0]?y(K):K).filter(e=>!Ke.has(e.style)),ot=ce?("string"==typeof K[0]?K:K.map(e=>e.style)).filter(e=>!Ke.has(e)):lt.map(e=>e.style),at={};if(ke&&(Fe||ce)){const e=v(t,ke.start,ke.end,rt);for(const t of ot){const n=e.has(t)||"highlight"===t&&e.has("accent");at[t]=!!Ve?.add.includes(t)||!Ve?.drop.includes(t)&&n}ce&&(at.link=e.has("link"))}else if(ke)for(const e of ot)at[e]="link"===e?null!==k(t,ke.start,ke.end):x(t,ke.start,ke.end,e);const st=()=>{const e=Ze(),n=e?.selectionStart??t.length;return{start:n,end:e?.selectionEnd??n}},it=e=>{if(ce&&"link"!==e&&E(0,e)){const{start:n,end:r}=st();if(n===r&&!Fe)return void Xe(n=>xe(t,e,n,(e,t,n,r)=>g(e,t,n,r,rt,fe.placeholders)));const l=o({value:t,rules:rt,start:n,end:r,style:e,pending:Ve});return void("pending"===l.kind?Ue(l.pending):Xe(()=>l.result))}if("clear"===e)return void Xe(n=>xe(t,e,n,(e,t,n)=>g(e,t,n,"clear",rt)));if("link"!==e&&Fe&&E(0,e)){const n=Ze(),r=n?.selectionStart??t.length,l=n?.selectionEnd??r;if(r===l){const n=v(t,r,l,rt),o=n.has(e)||"highlight"===e&&n.has("accent"),a=Ve&&Ve.at===r?Ve:null,s=!!a?.add.includes(e)||!a?.drop.includes(e)&&o,i=(a?.add??[]).filter(t=>t!==e),c=(a?.drop??[]).filter(t=>t!==e);return s&&o?c.push(e):s||o||i.push(e),void Ue(i.length||c.length?{add:i,drop:c,at:r}:null)}return void Xe(n=>D(t,n?.selectionStart??r,n?.selectionEnd??l,e,rt))}if("link"!==e){const n=H??((e,t,n,r)=>g(e,t,n,r,b,fe.placeholders));return void Xe(r=>xe(t,e,r,n))}const n=Ze(),r=n?.selectionStart??t.length,l=n?.selectionEnd??r;Ye(!1),nt({start:r,end:l,link:k(t,r,l)})},ct=Boolean(ke&&ke.start!==ke.end),ut=ke?w(t,ke.start,ke.end,rt):null,dt=ke?Ve&&void 0!==Ve.color&&Ve.at===ke.start?Ve.color:S(t,ke.start,ke.end,rt):null,pt=dt?dt.startsWith("#")?dt:oe?.find(e=>e.name===dt)?.value:void 0,ft=e=>{Fe?e?$e.current?.setSource(e.start,e.end,t):$e.current?.focus():(me.current?.focus(),e&&me.current?.setSelectionRange(e.start,e.end))},ht=()=>{const e=tt;nt(null),ft(e?{start:e.start,end:e.end}:ke)},mt=()=>{const e=yt.current,t=Boolean(e&&e.querySelector(".es-copy-colors")?.contains(e.ownerDocument.activeElement));Ye(!1),t&&ft(ke)},gt=V(mt);gt.current=mt,Y(()=>{if(qe)return j(e=>{const t=yt.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&(gt.current(),!0)},()=>yt.current?.querySelector(".es-copy-colors"))},[qe]);const yt=V(null),vt=qe||null!==tt;Y(()=>{const e=yt.current;if(!vt||!e)return;const t=e.ownerDocument,n=()=>{Ye(!1),nt(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)}},[vt]);const bt=tt??(qe?ke??{start:t.length,end:t.length}:null),kt=V(()=>{});kt.current=()=>{const e=yt.current,t=e?.querySelector(".rosh-tb-wrap > .es-copy-pop");if(!e||!t||!bt)return;const n=Fe?null:e.querySelector(".es-gold-layer"),r=Fe?$e.current?.rangeOf(bt.start,bt.end)??null:n?function(e,t,n){const r=e.ownerDocument,l=r.createTreeWalker(e,4),o=e=>{let t=e,n=null;for(let e=l.nextNode();e;e=l.nextNode()){if(t<=e.data.length)return[e,t];t-=e.data.length,n=e}return n?[n,n.data.length]:null},a=o(t);l.currentNode=e;const s=o(n);if(!a||!s)return null;const i=r.createRange();return i.setStart(a[0],a[1]),i.setEnd(s[0],s[1]),i}(n,bt.start,bt.end):null,l=r?.endContainer,o=l?1===l.nodeType?l:l.parentElement:null,a=r?function(e,t){const n=("function"==typeof e.getClientRects?[...e.getClientRects()]:[]).filter(e=>e.height>0);if(n.length>0){const t="function"==typeof e.getBoundingClientRect?e.getBoundingClientRect():n[0];return t.height>0?Pe(t):Pe(n[0])}if(!t)return null;const r=t.getBoundingClientRect();return{left:r.left,top:r.top,right:r.left,bottom:r.bottom}}(r,o?.closest(".es-rich-line, .es-gold-layer")??null):null;if(!a)return;const s=function({anchor:e,size:t,within:n,clip:r,parent:l,gap:o=8}){const a=Math.max(n.left,r.left),s=Math.min(n.right,r.right)-t.width,i=Be(e.left,a,s),c=r.bottom-(e.bottom+o),u=e.top-o-r.top,d=t.height>c&&(t.height<=u||u>c),p=d?e.top-o-t.height:e.bottom+o,f=e.left+Math.min((e.right-e.left)/2,10),h=Be(f-5-i,10,t.width-10-10);return{top:p-l.top,left:i-l.left,above:d,point:h}}({anchor:a,size:{width:t.offsetWidth,height:t.offsetHeight},within:e.getBoundingClientRect(),clip:Oe(e),parent:ze(t)});t.style.top=`${s.top}px`,t.style.left=`${s.left}px`,t.style.setProperty("--es-pop-point",`${s.point}px`),t.dataset.side=s.above?"above":"below"},q(()=>{const e=yt.current;if(!vt||!e)return;const t=()=>kt.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()}},[vt,qe,tt,bt?.start,bt?.end,Fe]);const xt=e=>tt&&/* @__PURE__ */ue(I,{className:e?"es-copy-link es-copy-pop":"es-copy-link",value:tt.link?.href??"",onApply:e=>{const n=tt;nt(null),Xe(()=>Fe?R(t,n.start,n.end,e,rt):B(t,n.start,n.end,e))},onRemove:tt.link?()=>{const e=tt.link,n=tt;nt(null),e&&Xe(()=>Fe?T(t,n.start,n.end,rt):M(t,e))}:void 0,onCancel:ht}),wt=_?ye(_.allow,fe.align):[],St="always"===ee||ge||null!==tt||qe,Et=oe&&oe.length>0?{run:pt,open:qe,onToggle:()=>{nt(null),qe?mt():Ye(!0)}}:void 0,Ct=St&&ce&&ie?ie({className:"rosh-tb-btn",disabled:m,selected:ct,keepCaret:e=>e.preventDefault(),insert:e=>Xe(n=>we(t,e,n))}):void 0,Dt=new Set(ot),Nt=_?{value:_.value,allow:_.allow,onChange:_.onChange,disabled:_.disabled}:void 0,Lt={pressed:ut,onList:e=>{const{start:n,end:r}=st(),l=w(t,n,r,rt);Xe(()=>L(t,n,r,l===e?null:e,rt))}},Tt=W({offered:Dt,color:Et,last:Ct,alignment:Nt,list:Lt,letterCase:se}),Mt=ce&&St&&(Ae.some(e=>Dt.has(e))||Boolean(Et));/* @__PURE__ */
13
+ return de("div",{ref:yt,className:"es-copy"+(d?` ${d}`:""),onFocus:()=>ve(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||ve(!1)},onKeyDown:e=>{const t=e.target===me.current||Boolean(e.target.closest?.(".es-rich"));if(m||!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 Qe(l||e.shiftKey?"redo":"undo");const o=`${e.shiftKey?"shift+":""}${n}`;if(ce){const t={b:"bold",i:"italic",u:"underline",k:"link"}[o];if(!t||!ot.includes(t))return;return e.preventDefault(),e.stopPropagation(),void it(t)}const a=lt.find(e=>e.shortcut===o);a&&(e.preventDefault(),e.stopPropagation(),it(a.style))},onPaste:e=>{const n=me.current;if(m||!n||e.target!==n)return;e.preventDefault();const r=a({html:e.clipboardData.getData("text/html"),text:e.clipboardData.getData("text/plain")},{doc:n.ownerDocument,multiline:i,rules:rt});Xe(e=>we(t,r,e))},style:oe&&oe.length>0?Object.fromEntries(oe.map(e=>[`--es-color-${e.name}`,e.value])):void 0,onSelect:()=>{const e=me.current;e&&e.ownerDocument.activeElement===e&&Se({start:e.selectionStart??t.length,end:e.selectionEnd??t.length})},children:[St&&ce&&(Tt.words||Tt.paragraph)?
14
+ /* @__PURE__ */ue(A,{className:"es-copy-toolbar","aria-label":J??fe.formatting,offered:Dt,pressed:at,onMark:e=>it(e),color:Et,linkOpen:null!==tt,last:Ct,alignment:Nt,list:Lt,letterCase:se,disabled:m,windows:/* @__PURE__ */de(pe,{children:[qe&&oe&&oe.length>0?/* @__PURE__ */ue(Re,{colors:oe,current:dt,words:fe.colors??e.colors,onPick:e=>{const{start:n,end:r}=st();if(n!==r)Xe(()=>N(t,n,r,e,rt));else{if(!Fe)return;Ue({add:Ve?.add??[],drop:Ve?.drop??[],color:e,at:n})}}}):null,tt?xt(!0):null]})}):null,ce&&ae&&ae.length>0?/* @__PURE__ */ue(Te,{cells:ae,words:fe.cells??e.cells,readOnly:m}):null,St&&!ce?/* @__PURE__ */ue(je,{tools:K,disabled:m,actions:$,glyphs:G,ariaLabel:J,pressed:at,open:tt?"link":null,onApply:it,align:_?/* @__PURE__ */ue(p,{options:wt,value:_.value,onChange:_.onChange,ariaLabel:fe.alignment,disabled:m||_.disabled,fit:be(wt)}):null}):null,Fe?/* @__PURE__ */ue(De,{value:t,rules:rt,multiline:i,readOnly:m,placeholder:c,ariaLabel:u,handle:$e,pending:Ve??void 0,onEdit:(e,n,r)=>{Ee.record({text:t,start:n.start,end:n.end},r,Date.now()),Ue(null),Ne(e)},onSelect:e=>{Se(t=>t&&t.start===e.start&&t.end===e.end?t:e),!Ve||e.start===Ve.at&&e.end===Ve.at||Ue(null)},onHistory:Qe,onFormat:e=>{ot.includes(e)&&it(e)},onCommit:r,onCancel:s}):/* @__PURE__ */ue(h,{value:t,onInput:e=>{Ee.record(Le(null),"type",Date.now()),Ne(e)},onCommit:r,onCancel:s,multiline:i,placeholder:c,ariaLabel:u,rules:z,disabled:m,inputRef:me,className:"es-copy-box"}),tt&&!ce?xt(!1):null,X?X({focused:ge,insert:e=>Xe(n=>we(t,e,n))}):null,te&&i||Mt?
15
+ /* @__PURE__ */de("div",{className:"es-copy-marks",children:[te&&i?/* @__PURE__ */de(pe,{children:[
16
+ /* @__PURE__ */ue(f,{checked:Me,onChange:()=>{const e=Ze();et.current=e&&null!==e.selectionStart&&null!==e.selectionEnd?{start:e.selectionStart,end:e.selectionEnd}:ke,Ue(null),He(e=>!e)},ariaLabelledBy:Ie,disabled:m}),
17
+ /* @__PURE__ */ue("span",{id:Ie,className:"es-copy-marks-label",children:fe.showMarks??"Show marks"})]}):null,Mt?O(ct?void 0:fe.clearStyleEmpty??"Select words first",/* @__PURE__ */de(F,{variant:"secondary",size:"sm",className:"es-copy-clear",disabled:m||!ct,onMouseDown:e=>e.preventDefault(),onClick:()=>{const{start:e,end:n}=st();if(e===n)return;const r=C(t,e,n,rt);r.text!==t&&Xe(()=>r)},children:[
18
+ /* @__PURE__ */ue(re,{size:16}),fe.clearStyle??"Clear style"]})):null]}):null]})}export{fe as COPY_ALIGNS,ge as COPY_ALIGN_FIT,me as COPY_ALIGN_GLYPHS,he as COPY_ALIGN_LABELS,Ne as COPY_CELLS,Re as ColorWindow,Ie as CopyBox,Te as CopyCells,je as MarkBar,De as RichBox,Fe as ariaShortcut,ye as copyAlignOptions,we as insertSelection,xe as markSelection,We as useCaretEdit};
@@ -84,50 +84,57 @@
84
84
  pointer-events: none;
85
85
  }
86
86
 
87
- /* "+ Add section", in the gap between two sections, on hover. */
88
- .es-canvas-seam {
87
+ /* A ➕ INSERT POINT (./CanvasInsert, owner 2026-10-14): one look wherever the
88
+ canvas offers to add — between sections and between, before and after the
89
+ blocks of a box. The band only positions the chip and lets every other
90
+ click through; the chip is the shell's ghost IconButton on a small round
91
+ ground of the panel's, so it reads over any page. At rest the chip is clear
92
+ and still takes the pointer; hovered or focused, the chip and a 2px accent
93
+ line across the band show. `.es-canvas-seam` is a hook (the layer's seams). */
94
+ .es-canvas-insert {
89
95
  position: absolute;
90
96
  display: flex;
91
97
  align-items: center;
92
98
  justify-content: center;
93
- pointer-events: auto;
99
+ pointer-events: none;
94
100
  }
95
- .es-canvas-seam::before {
96
- content: "";
101
+ .es-canvas-insert-line {
97
102
  position: absolute;
98
- left: 8px;
99
- right: 8px;
103
+ left: 0;
104
+ right: 0;
100
105
  top: 50%;
101
106
  height: 2px;
102
- margin-top: -1px;
107
+ transform: translateY(-50%);
103
108
  background: var(--es-accent);
104
- border-radius: var(--radius-sm);
105
109
  opacity: 0;
110
+ pointer-events: none;
106
111
  transition: opacity 0.12s;
107
112
  }
108
- .es-canvas-seam-add {
113
+ .es-canvas-insert.is-x .es-canvas-insert-line {
114
+ left: 50%;
115
+ right: auto;
116
+ top: 0;
117
+ bottom: 0;
118
+ width: 2px;
119
+ height: auto;
120
+ transform: translateX(-50%);
121
+ }
122
+ .es-canvas-insert-chip {
109
123
  position: relative;
110
- padding: 2px 12px;
111
- border: none;
124
+ display: inline-flex;
112
125
  border-radius: 999px;
113
- background: var(--es-accent);
114
- color: var(--es-on-accent);
115
- font: 600 11px/16px var(--es-font);
116
- cursor: pointer;
126
+ background: var(--es-panel);
127
+ box-shadow: var(--es-panel-shadow);
128
+ pointer-events: auto;
117
129
  opacity: 0;
118
- transform: scale(0.9);
119
- transition: opacity 0.12s, transform 0.12s;
130
+ transition: opacity 0.12s;
120
131
  }
121
- .es-canvas-seam:hover::before,
122
- .es-canvas-seam:focus-within::before,
123
- .es-canvas-seam:hover .es-canvas-seam-add,
124
- .es-canvas-seam-add:focus-visible {
132
+ .es-canvas-insert:hover .es-canvas-insert-line,
133
+ .es-canvas-insert:focus-within .es-canvas-insert-line,
134
+ .es-canvas-insert:hover .es-canvas-insert-chip,
135
+ .es-canvas-insert:focus-within .es-canvas-insert-chip {
125
136
  opacity: 1;
126
137
  }
127
- .es-canvas-seam:hover .es-canvas-seam-add,
128
- .es-canvas-seam-add:focus-visible {
129
- transform: scale(1);
130
- }
131
138
 
132
139
  /* An empty slot: a cell that adds a block there, and takes a drop. At rest it
133
140
  draws NOTHING — no fill, no border, no label — so what is under it shows as
@@ -1,9 +1,9 @@
1
1
  import * as react from 'react';
2
- import { HTMLAttributes, ReactNode } from 'react';
2
+ import { HTMLAttributes, CSSProperties, ReactNode } from 'react';
3
3
  import { P as Place } from '../types-41704JE4.js';
4
4
  import { D as DragSession } from '../session-DSQFmIvx.js';
5
5
  export { a as DragHeld, c as createDragSession } from '../session-DSQFmIvx.js';
6
- export { B as Box, a as CanvasDragLayer, b as CanvasDragLayerProps, C as CanvasDragModel, c as CanvasDropTarget, d as CanvasSeam, e as CanvasSource, f as CanvasZone, E as EMPTY_MEASURE, H as HANDLE_GRACE_MS, M as MeasuredCanvas, g as MeasuredNode, h as canvasTarget, i as contains, j as gapInZone, k as gapLine, m as measureCanvas, p as pickSource, s as seamsBetween, l as sourcesAt } from '../CanvasDragLayer-O1gVT1AL.js';
6
+ export { B as Box, a as CanvasDragLayer, b as CanvasDragLayerProps, C as CanvasDragModel, c as CanvasDropTarget, d as CanvasSeam, e as CanvasSource, f as CanvasZone, E as EMPTY_MEASURE, H as HANDLE_GRACE_MS, M as MeasuredCanvas, g as MeasuredNode, h as canvasTarget, i as contains, j as gapInZone, k as gapLine, l as insertSeams, m as measureCanvas, p as pickSource, s as seamsBetween, n as sourcesAt } from '../CanvasDragLayer-CLb7j-CZ.js';
7
7
  import { D as DragWords } from '../words-BDignMl_.js';
8
8
  import '../watch-BTYOJpQU.js';
9
9
 
@@ -137,6 +137,37 @@ type TreeDrag<I> = {
137
137
  };
138
138
  declare function useTreeDrag<I>(options: TreeDragOptions<I>): TreeDrag<I>;
139
139
 
140
+ /**
141
+ * A ➕ INSERT POINT ON THE CANVAS (owner 2026-10-14, "two ways to add": click a
142
+ * ➕, pick an item, and it goes exactly there).
143
+ *
144
+ * One look for every place the canvas offers to add — between two sections,
145
+ * above the first, and before, between and after the blocks of a box — so the
146
+ * screen's section gaps and this layer's seams draw the SAME element (GG
147
+ * 2026-10-14, option A): the shell's ghost `IconButton` with the plus, named by
148
+ * the shell's `Tooltip` (harness UI-17, UI-24), the Layers seam "+"'s look. It
149
+ * is a real button in the tab order: with the Layers "+" removed, the canvas
150
+ * ➕ is how a keyboard adds.
151
+ *
152
+ * Only the chip takes the pointer; the band around it positions it and lets
153
+ * every other click through to the canvas. At rest the chip is clear and
154
+ * still hit-tests; hovered or focused, the chip and a 2px accent line across
155
+ * the band show. `axis: 'x'` is a gap between two things side by side: the
156
+ * line runs down instead of across.
157
+ */
158
+ type CanvasInsertProps = {
159
+ /** What the ➕ adds, in the host's words: "Add section here", "Add block here". */
160
+ label: string;
161
+ onInsert: () => void;
162
+ /** Where the band sits, in the layer's own pixels. */
163
+ style?: CSSProperties;
164
+ axis?: 'x' | 'y';
165
+ className?: string;
166
+ /** For hosts and specs to find one point by its place. */
167
+ index?: number;
168
+ };
169
+ declare function CanvasInsert({ label, onInsert, style, axis, className, index }: CanvasInsertProps): react.JSX.Element;
170
+
140
171
  /**
141
172
  * One thing the Add list offers.
142
173
  *
@@ -279,4 +310,4 @@ declare function frameScrollBox(doc: Document): HTMLElement | null;
279
310
  */
280
311
  declare function startAutoScroll(box: HTMLElement, edges?: Element): () => void;
281
312
 
282
- export { AUTO_SCROLL_EDGE, AUTO_SCROLL_MAX_SPEED, type AddGroup, AddPanel, type AddPanelProps, type AddTile, DragSession, DragWords, type DropRow, type DropSide, type DropSpot, type TreeDrag, type TreeDragOptions, type TreeDragRowOptions, type TreeDragRowProps, type TreeDragSeamOptions, type TreeDragSeamProps, autoScrollDelta, autoScrollSpeed, dropEffectFor, dropOnRow, frameScrollBox, gapToMoveIndex, isNoOpDrop, scrollBoxOf, scrollParent, startAutoScroll, stepGap, useTreeDrag };
313
+ export { AUTO_SCROLL_EDGE, AUTO_SCROLL_MAX_SPEED, type AddGroup, AddPanel, type AddPanelProps, type AddTile, CanvasInsert, type CanvasInsertProps, DragSession, DragWords, type DropRow, type DropSide, type DropSpot, type TreeDrag, type TreeDragOptions, type TreeDragRowOptions, type TreeDragRowProps, type TreeDragSeamOptions, type TreeDragSeamProps, autoScrollDelta, autoScrollSpeed, dropEffectFor, dropOnRow, frameScrollBox, gapToMoveIndex, isNoOpDrop, scrollBoxOf, scrollParent, startAutoScroll, stepGap, useTreeDrag };
@@ -1 +1 @@
1
- export{AddPanel,CanvasDragLayer,EMPTY_MEASURE,HANDLE_GRACE_MS,canvasTarget,contains,gapInZone,gapLine,measureCanvas,pickSource,seamsBetween,sourcesAt}from"../chunk-AYNU4FYF.js";import"../chunk-O2NLQBFX.js";export{AUTO_SCROLL_EDGE,AUTO_SCROLL_MAX_SPEED,autoScrollDelta,autoScrollSpeed,createDragSession,dropEffectFor,dropOnRow,frameScrollBox,gapToMoveIndex,isNoOpDrop,scrollBoxOf,scrollParent,startAutoScroll,stepGap,useTreeDrag}from"../chunk-67GNT6PF.js";import"../chunk-AWJUYMX7.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
1
+ export{AddPanel,CanvasDragLayer,CanvasInsert,EMPTY_MEASURE,HANDLE_GRACE_MS,canvasTarget,contains,gapInZone,gapLine,insertSeams,measureCanvas,pickSource,seamsBetween,sourcesAt}from"../chunk-SSORUDHE.js";import"../chunk-O2NLQBFX.js";export{AUTO_SCROLL_EDGE,AUTO_SCROLL_MAX_SPEED,autoScrollDelta,autoScrollSpeed,createDragSession,dropEffectFor,dropOnRow,frameScrollBox,gapToMoveIndex,isNoOpDrop,scrollBoxOf,scrollParent,startAutoScroll,stepGap,useTreeDrag}from"../chunk-67GNT6PF.js";import"../chunk-AWJUYMX7.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
@@ -7,7 +7,8 @@ import { S as SlotAddress, D as Data, P as Place } from '../types-41704JE4.js';
7
7
  import { c as ResolveTrigger, a as ResolveCache, R as ResolvableItem } from '../resolve-D68pb3Bx.js';
8
8
  import * as react from 'react';
9
9
  import { ReactNode, CSSProperties, ComponentType, ReactElement } from 'react';
10
- import { C as CanvasTypingEnd } from '../canvas-typing-Dec_zyuM.js';
10
+ import { TextToolbarProps } from 'efficient-shell/ui';
11
+ import { C as CanvasTypingEnd } from '../canvas-typing-U7TV-iax.js';
11
12
  import { InlineRule } from '../markup/index.js';
12
13
  import { b as NodeOpsHost, C as ClipboardEntry } from '../useNodeOps-CLbZyd43.js';
13
14
  import { I as InspectorFields } from '../types-OUl0mK1k.js';
@@ -341,6 +342,17 @@ interface CanvasTypingTarget {
341
342
  write: (next: string) => void;
342
343
  /** Draw the words afresh (after an IME composition wrote into them). */
343
344
  remount?: () => void;
345
+ /**
346
+ * The text toolbar these words get while they are typed: the tools the
347
+ * panel's text box offers for the same field (its `tools`, and the field's
348
+ * alignment and letter case). The ONE toolbar (efficient-shell `TextToolbar`)
349
+ * floats above the words in the shell's `FloatingBar`. Left out, no bar.
350
+ */
351
+ toolbar?: {
352
+ offered: readonly string[];
353
+ alignment?: TextToolbarProps['alignment'];
354
+ letterCase?: TextToolbarProps['letterCase'];
355
+ };
344
356
  }
345
357
  type CanvasTypingState = {
346
358
  typing: true;
@@ -1 +1 @@
1
- export{CanvasFrame,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useSelectedFields,validSelection}from"../chunk-DSUMM2WF.js";import"../chunk-AELNNAFM.js";import"../chunk-YRLPFZW3.js";import"../chunk-UK2FQOUT.js";import"../chunk-JIWPANGM.js";import"../chunk-546BBOPE.js";import"../chunk-MFIRYGHW.js";import"../chunk-AWJUYMX7.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
1
+ export{CanvasFrame,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useSelectedFields,validSelection}from"../chunk-M5VRWM7M.js";import"../chunk-TBY3DFKS.js";import"../chunk-YRLPFZW3.js";import"../chunk-UK2FQOUT.js";import"../chunk-CIHKZMNR.js";import"../chunk-546BBOPE.js";import"../chunk-MFIRYGHW.js";import"../chunk-AWJUYMX7.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-7XHDCQVL.js";export{FieldSelect,FieldSlider,optionFor}from"../chunk-OZ72A6MY.js";import"../chunk-4JSBIW5H.js";import"../chunk-EA2HTX37.js";import"../chunk-K56YDHYQ.js";export{useResolvedFields}from"../chunk-YRLPFZW3.js";import"../chunk-3ZJSLHHI.js";import"../chunk-KFV7N2DJ.js";export{FieldNumber}from"../chunk-66LWADFP.js";import"../chunk-FFYXVAAL.js";import"../chunk-QLD57GBB.js";import"../chunk-MFIRYGHW.js";import"../chunk-67GNT6PF.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
1
+ export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-CRWFB7MU.js";export{FieldSelect,FieldSlider,optionFor}from"../chunk-OZ72A6MY.js";import"../chunk-4JSBIW5H.js";import"../chunk-3ZJSLHHI.js";import"../chunk-K56YDHYQ.js";import"../chunk-KFV7N2DJ.js";export{useResolvedFields}from"../chunk-YRLPFZW3.js";import"../chunk-EA2HTX37.js";export{FieldNumber}from"../chunk-66LWADFP.js";import"../chunk-QLD57GBB.js";import"../chunk-FFYXVAAL.js";import"../chunk-MFIRYGHW.js";import"../chunk-67GNT6PF.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{AddBlockRow as default}from"../../chunk-VFI3ONLN.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-6XXW6ZW3.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-MCHMF32I.js";import"../../chunk-DSUMM2WF.js";import"../../chunk-AELNNAFM.js";import"../../chunk-7XHDCQVL.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-EA2HTX37.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-3ZJSLHHI.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-JIWPANGM.js";import"../../chunk-66LWADFP.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-QLD57GBB.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{AddBlockRow as default}from"../../chunk-ESQZG7B3.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-ZR4CFNMW.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-MCHMF32I.js";import"../../chunk-M5VRWM7M.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-CRWFB7MU.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-3ZJSLHHI.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-CIHKZMNR.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{blockKey,AddSidePanel as default,sectionKey,templateKey}from"../../chunk-YB4QPUEZ.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-PFNIVZPN.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-6XXW6ZW3.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-MCHMF32I.js";import"../../chunk-DSUMM2WF.js";import"../../chunk-AELNNAFM.js";import"../../chunk-7XHDCQVL.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-EA2HTX37.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-3ZJSLHHI.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-UB4TLWVJ.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-JIWPANGM.js";import"../../chunk-66LWADFP.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-QLD57GBB.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-AYNU4FYF.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{blockKey,AddSidePanel as default,sectionKey,templateKey}from"../../chunk-DSXKBICS.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-PFNIVZPN.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-ZR4CFNMW.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-MCHMF32I.js";import"../../chunk-M5VRWM7M.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-CRWFB7MU.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-3ZJSLHHI.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-UB4TLWVJ.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-CIHKZMNR.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-SSORUDHE.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{MediaSidePanel as default}from"../../chunk-F4XCIEXI.js";import"../../chunk-6XXW6ZW3.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-DSUMM2WF.js";import"../../chunk-AELNNAFM.js";import"../../chunk-7XHDCQVL.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-EA2HTX37.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-3ZJSLHHI.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-UB4TLWVJ.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-JIWPANGM.js";import"../../chunk-66LWADFP.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-QLD57GBB.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{MediaSidePanel as default}from"../../chunk-Q2L6YTII.js";import"../../chunk-ZR4CFNMW.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-M5VRWM7M.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-CRWFB7MU.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-3ZJSLHHI.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-UB4TLWVJ.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-CIHKZMNR.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -22,7 +22,7 @@ import '../../types-CsgMwHHa.js';
22
22
  import '../../wordFit-7XpmhcaW.js';
23
23
  import '../../edit-lock/index.js';
24
24
  import '../../panelWidths-D9hTLR25.js';
25
- import '../../CanvasDragLayer-O1gVT1AL.js';
25
+ import '../../CanvasDragLayer-CLb7j-CZ.js';
26
26
  import '../../session-DSQFmIvx.js';
27
27
  import '../../words-BDignMl_.js';
28
28
  import '../../types-BLRK6_JO.js';
@@ -1 +1 @@
1
- export{EASEL_NODE_CLIPBOARD,ancestorChain,nodeClipboardOf,nodeClipboardRules,nodeMenuItems,nodeShortcut,pageMenuItems,pastePlace,runNodeShortcut,textMenuItems,useNodeClipboard,useNodeContextMenu}from"../../chunk-ISBKAONU.js";import"../../chunk-BXMXTO36.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-MCHMF32I.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{EASEL_NODE_CLIPBOARD,ancestorChain,nodeClipboardOf,nodeClipboardRules,nodeMenuItems,nodeShortcut,pageMenuItems,pastePlace,runNodeShortcut,textMenuItems,useNodeClipboard,useNodeContextMenu}from"../../chunk-LVUDUQNL.js";import"../../chunk-V7U33NF2.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-MCHMF32I.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{ScreenChrome as default}from"../../chunk-TAF5AECR.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-BXQBCW3P.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-PAM3NLFL.js";import"../../chunk-7F52SZOI.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-TBF5CVPA.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-QPQXKKSC.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-6TOYXESC.js";import"../../chunk-NL4OU4UU.js";import"../../chunk-6EKKPFVG.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-ISBKAONU.js";import"../../chunk-HQWQLDCB.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-WZMU646D.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-BXMXTO36.js";import"../../chunk-5545A3PC.js";import"../../chunk-YB4QPUEZ.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-PFNIVZPN.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-F4XCIEXI.js";import"../../chunk-6XXW6ZW3.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-MCHMF32I.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-DSUMM2WF.js";import"../../chunk-AELNNAFM.js";import"../../chunk-7XHDCQVL.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-EA2HTX37.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-3ZJSLHHI.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-4VJATVVR.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-UB4TLWVJ.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-JIWPANGM.js";import"../../chunk-66LWADFP.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-QLD57GBB.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-AYNU4FYF.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{ScreenChrome as default}from"../../chunk-HXLF2ZQO.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-BXQBCW3P.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-PAM3NLFL.js";import"../../chunk-7F52SZOI.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-TBF5CVPA.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-UY7BCB32.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-6TOYXESC.js";import"../../chunk-5PUEZ22M.js";import"../../chunk-57NRNFLO.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-LVUDUQNL.js";import"../../chunk-HQWQLDCB.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-WZMU646D.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-V7U33NF2.js";import"../../chunk-5545A3PC.js";import"../../chunk-DSXKBICS.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-PFNIVZPN.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-Q2L6YTII.js";import"../../chunk-ZR4CFNMW.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-MCHMF32I.js";import"../../chunk-M5VRWM7M.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-CRWFB7MU.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-3ZJSLHHI.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-4VJATVVR.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-UB4TLWVJ.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-CIHKZMNR.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-SSORUDHE.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";