efficient-easel 11.3.0 → 11.8.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 (106) hide show
  1. package/README.md +20 -41
  2. package/dist/{canvas-typing-DvoqQINU.d.ts → canvas-typing-CC0wA-ys.d.ts} +16 -105
  3. package/dist/chrome/chrome.css +5 -5
  4. package/dist/{chunk-66LWADFP.js → chunk-2XMHLXMA.js} +1 -1
  5. package/dist/chunk-33C6ALT5.js +1 -0
  6. package/dist/{chunk-XJCMEEBH.js → chunk-36LVP5WD.js} +7 -7
  7. package/dist/{chunk-SJPKSE5G.js → chunk-5IUS6PM6.js} +12 -12
  8. package/dist/{chunk-FPAVNX3Y.js → chunk-5XUMLKQF.js} +3 -3
  9. package/dist/{chunk-PPL7GB7D.js → chunk-62VPYC7F.js} +1 -1
  10. package/dist/chunk-643PVCEG.js +1 -0
  11. package/dist/{chunk-TWFM6GNK.js → chunk-6IT5H37Y.js} +1 -1
  12. package/dist/{chunk-AFSSKGTD.js → chunk-6TJ2CIMY.js} +1 -1
  13. package/dist/{chunk-4ACVXF5V.js → chunk-7BRKNQF7.js} +1 -1
  14. package/dist/chunk-A6PY6C3C.js +1 -0
  15. package/dist/{chunk-XWK7WZQS.js → chunk-ATF2T5CI.js} +1 -1
  16. package/dist/chunk-AYWN5NRH.js +1 -0
  17. package/dist/chunk-DE35IQ4T.js +57 -0
  18. package/dist/{chunk-PPHUWGLZ.js → chunk-EC2I7SIY.js} +1 -1
  19. package/dist/{chunk-DGAXQTDW.js → chunk-FHLYUIJJ.js} +1 -1
  20. package/dist/{chunk-65Z5FSAW.js → chunk-G3GWAP5R.js} +5 -5
  21. package/dist/{chunk-2FZJWH24.js → chunk-H4UMY7QF.js} +1 -1
  22. package/dist/chunk-H6IXH4A3.js +1 -0
  23. package/dist/{chunk-EXKKLTXH.js → chunk-HRUMNRYI.js} +1 -1
  24. package/dist/chunk-JHYKRGRA.js +5 -0
  25. package/dist/chunk-JRRYFSCY.js +5 -0
  26. package/dist/chunk-KEWQZYUF.js +7 -0
  27. package/dist/{chunk-IFS5P7CO.js → chunk-LZS7JZK5.js} +1 -1
  28. package/dist/{chunk-FGJSCWUN.js → chunk-NY7HHUGB.js} +2 -2
  29. package/dist/chunk-PS5BWS4I.js +2 -0
  30. package/dist/{chunk-47RGVCPH.js → chunk-QFVRMARS.js} +12 -12
  31. package/dist/chunk-TBF5CVPA.js +1 -0
  32. package/dist/{chunk-26GHWMNN.js → chunk-UBAYMWCX.js} +19 -19
  33. package/dist/chunk-UMDQ6CLQ.js +2 -0
  34. package/dist/{chunk-ZXGQT75B.js → chunk-URC5Y5G2.js} +1 -1
  35. package/dist/chunk-VVPZMWJE.js +1 -0
  36. package/dist/chunk-WRFD4EXD.js +1 -0
  37. package/dist/chunk-YHZSBL2N.js +1 -0
  38. package/dist/copy/copy.css +8 -108
  39. package/dist/copy/index.d.ts +39 -9
  40. package/dist/copy/index.js +18 -19
  41. package/dist/drag/drag.css +8 -8
  42. package/dist/drag/index.js +1 -1
  43. package/dist/easel/index.d.ts +3 -3
  44. package/dist/easel/index.js +1 -1
  45. package/dist/fields/fields.css +8 -8
  46. package/dist/fields/index.js +1 -1
  47. package/dist/gold/index.d.ts +3 -3
  48. package/dist/gold/index.js +1 -1
  49. package/dist/icons/index.d.ts +1 -0
  50. package/dist/markup/index.d.ts +1 -629
  51. package/dist/markup/index.js +1 -1
  52. package/dist/menu/menu.css +1 -1
  53. package/dist/panel/index.js +1 -1
  54. package/dist/panel/panel.css +12 -12
  55. package/dist/pick/index.js +1 -1
  56. package/dist/pick/pick.css +7 -7
  57. package/dist/screen/components/AddBlockRow.js +1 -1
  58. package/dist/screen/components/AddSidePanel.js +1 -1
  59. package/dist/screen/components/MediaSidePanel.js +1 -1
  60. package/dist/screen/components/NodeContextMenu.js +1 -1
  61. package/dist/screen/components/PageEditGuardNotices.js +1 -1
  62. package/dist/screen/components/PanelToggleIcon.d.ts +6 -5
  63. package/dist/screen/components/PanelToggleIcon.js +1 -1
  64. package/dist/screen/components/ScreenChrome.js +1 -1
  65. package/dist/screen/components/ScreenDocumentContext.js +1 -1
  66. package/dist/screen/components/ScreenMount.js +1 -1
  67. package/dist/screen/components/ScreenStoreProvider.js +1 -1
  68. package/dist/screen/components/SectionScreenShell.js +16 -16
  69. package/dist/screen/components/SidePanelHead.js +1 -1
  70. package/dist/screen/components/usePartBridge.js +1 -1
  71. package/dist/screen/index.js +1 -1
  72. package/dist/screen/lib/key-scope.js +1 -1
  73. package/dist/screen/lib/puck/device-fields.js +1 -1
  74. package/dist/screen/lib/puck/slot-child-name.js +1 -1
  75. package/dist/screen/lib/puck/style-clipboard.js +1 -1
  76. package/dist/screen/lib/puck/use-section-ops.js +1 -1
  77. package/dist/screen/lib/screen-parts.js +1 -1
  78. package/dist/screen/screen.css +16 -16
  79. package/dist/screen/words.js +1 -1
  80. package/dist/shell/shell.css +10 -8
  81. package/dist/strings/catalogue.d.ts +2 -2
  82. package/dist/strings/catalogue.js +1 -1
  83. package/dist/strings/index.d.ts +2 -2
  84. package/dist/strings/index.js +1 -1
  85. package/dist/text-styles/index.d.ts +4 -231
  86. package/dist/text-styles/index.js +35 -35
  87. package/dist/text-styles/model.d.ts +259 -0
  88. package/dist/text-styles/model.js +1 -0
  89. package/dist/text-styles/text-styles.css +6 -6
  90. package/dist/{words-dsex49Jh.d.ts → words-CiuKuiy0.d.ts} +12 -6
  91. package/package.json +6 -1
  92. package/dist/chunk-546BBOPE.js +0 -1
  93. package/dist/chunk-AZOCY74V.js +0 -57
  94. package/dist/chunk-BHRC3ASL.js +0 -1
  95. package/dist/chunk-BPFPM3L4.js +0 -7
  96. package/dist/chunk-DD7A6RRL.js +0 -5
  97. package/dist/chunk-EQFBUNEB.js +0 -1
  98. package/dist/chunk-FAAZZXIS.js +0 -1
  99. package/dist/chunk-FFYXVAAL.js +0 -1
  100. package/dist/chunk-GCCBEY2W.js +0 -2
  101. package/dist/chunk-GG4FGBFR.js +0 -1
  102. package/dist/chunk-KQMML6JM.js +0 -4
  103. package/dist/chunk-Q6AM43CA.js +0 -1
  104. package/dist/chunk-U7KFFC7N.js +0 -5
  105. package/dist/chunk-VWXUMVCD.js +0 -1
  106. package/dist/chunk-ZAOM6PFH.js +0 -1
@@ -1,18 +1,18 @@
1
- import{DEFAULT_DRAG_WORDS as e}from"./chunk-GG4FGBFR.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-ILXP5VX5.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 z,Input as A}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__ */
1
+ import{DEFAULT_DRAG_WORDS as e}from"./chunk-AYWN5NRH.js";import{dropEffectFor as t,scrollBoxOf as n,frameScrollBox as l,startAutoScroll as a,isNoOpDrop as r}from"./chunk-67GNT6PF.js";import{withTip as o}from"./chunk-P2VEMZH5.js";import{useCanvasLayout as s,useCanvasEvent as i,CANVAS_TYPING_EVENT as c,framePointToHost as d,elementScale as u,frameRectToLayer as h,clientPointToLayer as f}from"./chunk-ILXP5VX5.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
2
  return C("div",{className:o,style:n,"data-index":r,children:[
3
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(z,{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 I(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 P(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 F={nodes:[],zones:[]},G="data-puck-dropzone",O="data-puck-component";function R(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 V(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(`[${G}]`)){const t=e.getAttribute(G)??"";let n;try{n=p(t)}catch{continue}const l=[...e.querySelectorAll(`[${O}]`)].filter(t=>t.parentElement?.closest(`[${G}]`)===e),s=l.map(a);o.push({key:t,list:n,box:a(e),axis:R(s,e),children:s}),l.forEach((e,t)=>{const l=e.getAttribute(O);l&&r.push({id:l,place:{...n,index:t},box:s[t]})})}return{nodes:r,zones:o}}var Z="data-es-empty-cell",Y="data-puck-dropzone",H=140;var Q=e=>({left:e.left,top:e.top,width:e.width,height:e.height});function W(u){const{canvas:f,session:p,readOnly:w,words:z=e.canvas}=u,A=m(u);g(()=>{A.current=u});const D=m(null),T=o(f),[$,E]=b(0),j=x(()=>E(e=>e+1),[]),[B,K]=b(F);g(()=>{const e=D.current;f&&e&&K((A.current.measure??V)(f,e))},[f,T,u.revision,$]);const X=u.model,I=y(()=>X(B),[X,B]),P=v(p.subscribe,p.shown,p.shown),G=u.choose,O=(e,t)=>{const n=L(I.sources,e,t);return 0===n.length?null:G?G(n):n[n.length-1]},[R,H]=b(null),[W,J]=b(null),U=m(null),_=()=>{U.current&&clearTimeout(U.current),U.current=null},ee=()=>{_(),U.current=setTimeout(()=>{p.get()||H(null)},140)};g(()=>_,[]);const te=m(null),ne=m(!1);s(f,i,e=>{ne.current=Boolean(e.detail?.typing),ne.current&&(_(),H(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,A.current.readOnly||p.get()||ne.current)return;_();const r=O(a.x,a.y);H(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;H(t=>w||ne.current?null:e?O(e.x,e.y):t?I.sources.find(e=>e.key===t.key)??null:null)},[I,P,p,w,G]);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(I.zones,l.x,l.y,e=>A.current.canDrop(t.item,e),e=>!!t.from&&r(t.from,e),e=>A.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(),A.current.onDrop(t.h.item,t.t.to))}},se={draggable:!w&&!!R,onMouseEnter:_,onMouseLeave:()=>!p.get()&&ee(),onDragStart:e=>{if(R&&!w){p.start({key:R.key,item:R.item,from:R.from}),e.dataTransfer.effectAllowed="move";try{e.dataTransfer.setData("text/plain",R.key)}catch{}}else e.preventDefault()},onDragEnd:()=>{p.end(),ae()},onClick:()=>{R&&!w&&A.current.onPick?.(R.item)}},{seams:ie=[]}=I,ce=I.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(`[${Y}]`))n.toggleAttribute(Z,t.has(n.getAttribute(Y)??""));return()=>{for(const t of e.querySelectorAll(`[${Z}]`))t.removeAttribute(Z)}},[f,ue,B,T,$]),/* @__PURE__ */C("div",{ref:D,className:"es-canvas-layer",children:[P||!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??z.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":"",W?.zoneKey===e.key?"is-over":""].filter(Boolean).join(" "),style:Q(e.box),onClick:()=>u.onZoneAdd?.({...e.list,index:0}),children:/* @__PURE__ */M("span",{className:"es-canvas-empty-add",children:z.addButton({label:e.addLabel??u.zoneAddLabel??z.addBlock})})},e.key)):null,P?/* @__PURE__ */M("div",{className:"es-canvas-catch",...oe}):null,W&&!ce.some(e=>e.key===W.zoneKey)?/* @__PURE__ */M("div",{className:`es-canvas-line is-${W.axis}`,style:Q(W.line)}):null,
6
- /* @__PURE__ */M("div",{className:"es-canvas-handle-spot",style:R?{"--es-handle-x":`${R.box.left+2}px`,"--es-handle-y":`${Math.max(R.box.top-11,0)}px`}:void 0,children:/* @__PURE__ */M(N,{className:"es-canvas-handle-tip",side:"top",content:!R||w||P?null:R.title??z.handle({label:R.label}),children:/* @__PURE__ */C("div",{className:["es-canvas-handle",R&&!w?"is-shown":"",P?"is-dragging":""].filter(Boolean).join(" "),...se,children:[
7
- /* @__PURE__ */M("span",{className:"es-canvas-grip","aria-hidden":"true",children:"⋮⋮"}),R?.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__ */
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 I(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 P(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 O={nodes:[],zones:[]},R="data-puck-dropzone",V="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=>h(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(`[${R}]`)){const t=e.getAttribute(R)??"";let n;try{n=p(t)}catch{continue}const l=[...e.querySelectorAll(`[${V}]`)].filter(t=>t.parentElement?.closest(`[${R}]`)===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(V);l&&r.push({id:l,place:{...n,index:t},box:s[t]})})}return{nodes:r,zones:o}}var F="data-es-empty-cell",H="data-puck-dropzone",W=140;var G=e=>({left:e.left,top:e.top,width:e.width,height:e.height});function Q(o){const{canvas:h,session:p,readOnly:w,words:A=e.canvas}=o,z=m(o);g(()=>{z.current=o});const D=m(null),T=s(h),[$,E]=b(0),j=x(()=>E(e=>e+1),[]),[B,K]=b(O);g(()=>{const e=D.current;h&&e&&K((z.current.measure??Z)(h,e))},[h,T,o.revision,$]);const X=o.model,I=y(()=>X(B),[X,B]),P=v(p.subscribe,p.shown,p.shown),R=o.choose,V=(e,t)=>{const n=L(I.sources,e,t);return 0===n.length?null:R?R(n):n[n.length-1]},[Y,W]=b(null),[Q,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);i(h,c,e=>{ne.current=Boolean(e.detail?.typing),ne.current&&(_(),W(null))}),i(h,"mousemove",e=>{const t=D.current;if(!h||!t)return;const n=d(h.frame,e.clientX,e.clientY,t),l=u(t),a={x:n.x/l,y:n.y/l};if(te.current=a,z.current.readOnly||p.get()||ne.current)return;_();const r=V(a.x,a.y);W(e=>e?.key===r?.key&&e?.box===r?.box?e:r)}),i(h,"mouseout",e=>{e.relatedTarget||(te.current=null,ee())}),i(h,"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?V(e.x,e.y):t?I.sources.find(e=>e.key===t.key)??null:null)},[I,P,p,w,R]);const re=e=>{const t=p.get(),n=D.current;if(!t||!n)return null;const l=f(n,e.clientX,e.clientY);te.current=l;const a=q(I.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=h?l(h.document):null,o=[];t&&o.push(a(t)),r&&h&&o.push(a(r,h.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=[]}=I,ce=I.zones.filter(e=>0===e.children.length),de=o.onZoneAdd&&!w?ce:[],ue=de.map(e=>e.key).join("\n");return g(()=>{const e=h?.document;if(!e)return;const t=new Set(ue?ue.split("\n"):[]);for(const n of e.querySelectorAll(`[${H}]`))n.toggleAttribute(F,t.has(n.getAttribute(H)??""));return()=>{for(const t of e.querySelectorAll(`[${F}]`))t.removeAttribute(F)}},[h,ue,B,T,$]),/* @__PURE__ */C("div",{ref:D,className:"es-canvas-layer",children:[P||!o.onSeamAdd||w?null:ie.map(e=>
5
+ /* @__PURE__ */M(S,{className:"es-canvas-seam",axis:e.axis,index:e.place.index,label:e.label??o.seamLabel??A.addSection,onInsert:()=>o.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":"",Q?.zoneKey===e.key?"is-over":""].filter(Boolean).join(" "),style:G(e.box),onClick:()=>o.onZoneAdd?.({...e.list,index:0}),children:/* @__PURE__ */M("span",{className:"es-canvas-empty-add",children:A.addButton({label:e.addLabel??o.zoneAddLabel??A.addBlock})})},e.key)):null,P?/* @__PURE__ */M("div",{className:"es-canvas-catch",...oe}):null,Q&&!ce.some(e=>e.key===Q.zoneKey)?/* @__PURE__ */M("div",{className:`es-canvas-line is-${Q.axis}`,style:G(Q.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||P?null:Y.title??A.handle({label:Y.label}),children:/* @__PURE__ */C("div",{className:["es-canvas-handle",Y&&!w?"is-shown":"",P?"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:s,searchLabel:i,readOnly:c,words:d=e.add}){const u=s??d.hint,h=i??d.search,[f,p]=b(""),m=w(),g=f.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
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(A,{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(z,{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:[
9
+ /* @__PURE__ */M("span",{children:r.label}),o(d.stop,/* @__PURE__ */M("button",{type:"button",className:"es-add-at-clear","aria-label":d.stop,onClick:r.onClear,children:/* @__PURE__ */M(T,{size:12,"aria-hidden":"true"})}))]}):null,
10
+ /* @__PURE__ */M("p",{className:"es-add-hint",children:u}),
11
+ /* @__PURE__ */M("div",{className:"es-add-find",children:/* @__PURE__ */M(z,{id:m,type:"search","aria-label":h,placeholder:d.searchPlaceholder({label:h}),value:f,onChange:e=>p(e.target.value),leftIcon:/* @__PURE__ */M($,{size:16,"aria-hidden":"true"}),rightAdornment:f?/* @__PURE__ */M(A,{size:"sm","aria-label":d.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:d.nothing({query:f.trim()})}),
13
+ /* @__PURE__ */M("div",{className:"es-add-empty-sub",children:d.tryAnother})]}):y.map(e=>/* @__PURE__ */C("section",{className:"es-add-group","aria-label":e.title,children:[
14
14
  /* @__PURE__ */C("div",{className:"es-add-group-head",children:[
15
15
  /* @__PURE__ */M("span",{className:"es-add-group-title",children:e.title}),
16
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,W as CanvasDragLayer,S as CanvasInsert,F as EMPTY_MEASURE,H as HANDLE_GRACE_MS,q as canvasTarget,E as contains,K as gapInZone,X as gapLine,I as insertSeams,V as measureCanvas,B as pickSource,P as seamsBetween,L as sourcesAt};
17
+ /* @__PURE__ */M("div",{className:J(e)?"es-add-grid is-cards":"es-add-grid",children:e.tiles.map(e=>{const t=Boolean(c||e.disabled),l=c?void 0:e.disabled?e.disabledReason:e.title??d.tile({label:e.label});return o(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":d.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,Q as CanvasDragLayer,S as CanvasInsert,O as EMPTY_MEASURE,W as HANDLE_GRACE_MS,q as canvasTarget,E as contains,K as gapInZone,X as gapLine,I as insertSeams,Z as measureCanvas,B as pickSource,P as seamsBetween,L as sourcesAt};
@@ -0,0 +1 @@
1
+ import{textFieldIdentifier as n}from"./chunk-DUVRZ456.js";import{hidableText as r}from"./chunk-6W7WLPZH.js";function t(n,t){const o=r(n.props.name);if(o)return o;const e=r(n.props.altName);if(e)return e;const c=n.props.collection?.name;if(c)return c;const u=n.props.source?.title;if(u)return u;const s=n.props.code;return s?t?.(s)??s:""}function o(n,r,o,e,c){const u=o(t(n,e))||r(n.type);return c?c(n,"block",u):u}function e(r){if(!r)return null;for(const t of["name","altName"])if(n(r[t]))return t;return null}function c(r){const t=r?.name;return void 0===t||n(t)?"name":null}function u(n,t,o){const e=r(n.props?.name).trim()||t;return o?o(n,"section",e):e}export{u as rootRowName,c as sectionRenameProp,t as slotChildName,e as slotChildRenameProp,o as slotChildRowName};
@@ -1,21 +1,21 @@
1
- import{TreeSeam as e}from"./chunk-4JSBIW5H.js";import{SETTINGS_BUCKETS as n,SettingsGroup as l}from"./chunk-RC25EGHD.js";import{DEFAULT_TREE_WORDS as t}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as a}from"./chunk-KFV7N2DJ.js";import{EaselMenuItems as r}from"./chunk-EA2HTX37.js";import{FieldNumber as o}from"./chunk-66LWADFP.js";import{FieldSelect as i}from"./chunk-65Z5FSAW.js";import{SettingsField as s,SettingsSegmented as c}from"./chunk-XJCMEEBH.js";import{DEFAULT_FIELDS_WORDS as d}from"./chunk-FFYXVAAL.js";import{useWords as u}from"./chunk-MFIRYGHW.js";import{useTreeDrag as m,gapToMoveIndex as p}from"./chunk-67GNT6PF.js";import{withTip as h}from"./chunk-P2VEMZH5.js";import{Textarea as f,Input as b,SortableList as g,ListRow as v,ContextMenu as y,tabPanelId as k,Tabs as x,tabButtonId as w}from"efficient-shell/ui";export{LinkPicker}from"efficient-shell/ui";import{useRef as N,useState as C,useLayoutEffect as O,useId as $}from"react";import{jsx as j,jsxs as S}from"react/jsx-runtime";import{ChevronIcon as D,LockIcon as I,MoveUpIcon as F,MoveDownIcon as L,DuplicateIcon as P,TrashIcon as A}from"efficient-shell/icons/efficient";function E({id:e,value:n,onChange:l,placeholder:t,multiline:a=!1,rows:r=3,readOnly:o=!1,ariaLabel:i,ariaLabelledBy:s}){const c=n??"";return a?/* @__PURE__ */j(f,{id:e,size:"sm",className:"es-fin",value:c,rows:r,placeholder:t,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>l(e.target.value)}):/* @__PURE__ */j(b,{id:e,size:"sm",className:"es-fin",type:"text",value:c,placeholder:t,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>l(e.target.value)})}function M(e,n,l){const t=e.slice();return t.splice(Math.max(0,Math.min(n,t.length)),0,l),t}function T(e,n,l){const t=e.slice(),[a]=t.splice(n,1);return t.splice(Math.max(0,Math.min(l,t.length)),0,a),t}function H(e,n){return e.filter((e,l)=>l!==n)}function R(e){return null===e||"object"!=typeof e?e:JSON.parse(JSON.stringify(e))}var z='input, textarea, select, button, [contenteditable]:not([contenteditable="false"]), [tabindex]',B={parentId:"list",slot:"items"};function J({label:n,icon:l,noun:a,items:o,onChange:i,newItem:s,summary:c,itemName:f,thumb:b,min:k=0,max:x,readOnly:w=!1,open:$,onOpen:E,renderItem:J,renderRow:K,canRemove:Y,lockedReason:V,fixed:W=!1,removeOnRow:X=!0,canDuplicate:G,above:Z,head:q=!0}){const Q=u("fields",d).list,U=u("tree",t),_=a??Q.item,ee=!w&&!W&&("number"!=typeof x||o.length<x),ne=o.length<=k,le=e=>!!Y&&!Y(o[e],e),te=e=>!w&&!W&&X&&!ne&&!le(e),ae=e=>ee&&(!G||G(o[e],e)),re=(e,n)=>f?f(e,n):Q.itemName({noun:_,n:n+1}),oe=N([]),ie=N(null),[se,ce]=C(null),de=N(null),[ue,me]=C(null),[pe,he]=C("");O(()=>{const e=ie.current;if(!e)return;ie.current=null;const n=oe.current[e.index]?.querySelectorAll(z)[e.nth]??oe.current[e.index];if(n?.focus(),n&&null!==e.start&&"setSelectionRange"in n)try{n.setSelectionRange(e.start,e.end)}catch{}});const fe=(e,n)=>{if(n<0||n>=o.length||n===e)return;const l=oe.current[e],t=l?.ownerDocument.activeElement;if(l&&t&&l.contains(t)){const e=[...l.querySelectorAll(z)].indexOf(t),a=t;ie.current={index:n,nth:e,start:"number"==typeof a.selectionStart?a.selectionStart:null,end:"number"==typeof a.selectionEnd?a.selectionEnd:null}}i(T(o,e,n));const a=function(e,n,l){return null===e?null:e===n?l:n<e&&l>=e?e-1:n>e&&l<=e?e+1:e}($,e,n);a!==$&&E(a),he(Q.moved({n:n+1,total:o.length}))},be=e=>{ee&&(i(M(o,e,s())),K?(ie.current={index:e,nth:0,start:null,end:null},null!==$&&$>=e&&E($+1)):E(e))},ge=e=>{te(e)&&(i(H(o,e)),$===e?E(null):null!==$&&$>e&&E($-1))},ve=m({keyOf:e=>String(e),canDrop:(e,n)=>n.parentId===B.parentId&&n.slot===B.slot,onDrop:(e,n)=>{const l=p({...B,index:e},n);l!==e&&fe(e,l)},onStep:(e,n)=>fe(e,e+n),canStep:(e,n)=>e+n>=0&&e+n<o.length,readOnly:w}),ye=e=>{const n=[];return e>0&&n.push({label:Q.moveUp,icon:/* @__PURE__ */j(F,{size:14}),shortcut:"⌥↑",onClick:()=>fe(e,e-1)}),e<o.length-1&&n.push({label:Q.moveDown,icon:/* @__PURE__ */j(L,{size:14}),shortcut:"⌥↓",onClick:()=>fe(e,e+1)}),ae(e)&&n.push({label:Q.duplicate,icon:/* @__PURE__ */j(P,{size:14}),onClick:()=>(e=>{ae(e)&&(i(M(o,e+1,R(o[e]))),null!==$&&$>e&&E($+1))})(e)}),te(e)&&n.push({label:Q.delete,icon:/* @__PURE__ */j(A,{size:14}),danger:!0,onClick:()=>ge(e)}),n},ke=(e,n,l,t)=>{w||0===ye(e).length||me({index:e,x:n,y:l,owner:t})},xe=e=>n=>{const l=o.slice();l[e]=n,i(l)};/* @__PURE__ */
2
- return S("div",{className:"es-list",children:[q?/* @__PURE__ */S("div",{className:"es-list-head",children:[
3
- /* @__PURE__ */S("span",{className:"es-list-label",children:[l?/* @__PURE__ */j("span",{className:"es-field-icon","aria-hidden":"true",children:l}):null,n]}),
4
- /* @__PURE__ */j("span",{className:"es-list-count",children:o.length})]}):null,Z?/* @__PURE__ */j("div",{className:"es-list-above",children:Z}):null,o.length?/* @__PURE__ */S(g,{"aria-label":n,spacing:"comfortable",className:"es-list-rows",rootProps:ve.rootProps(),children:[o.map((n,l)=>{const t=ve.row({item:l,place:{...B,index:l}}),a=t.draggable&&se!==l,r=!K&&$===l,o=!w&&!W&&X&&le(l),i=["es-list-row",K?"is-inline":"is-item",r?"is-open":"",a?"is-draggable":"",t.dragging?"is-dragging":"",t.drop?`is-drop-${t.drop}`:""].filter(Boolean).join(" ");return[l>0?/* @__PURE__ */j(e,{...ve.seam({place:{...B,index:l}}),onAdd:ee?()=>be(l):void 0,label:Q.addHere({noun:_})},`seam-${l}`):null,
5
- /* @__PURE__ */j(v,{className:i,flat:!!K,active:r,draggable:t.draggable,dragHint:U.dragHint,dragging:t.dragging,drop:"before"===t.drop||"after"===t.drop?t.drop:void 0,onMove:t.draggable?e=>fe(l,"up"===e?l-1:l+1):void 0,rowRef:e=>{oe.current[l]=e},rowProps:{...t.rowProps,draggable:a||void 0,onPointerDown:e=>{const n=e.target.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])'),a=!!n&&n===n.ownerDocument.activeElement;e.currentTarget.draggable=t.draggable&&!a,de.current=n&&!a?n:null,ce(a?l:null)},onDragStart:e=>{const n=de.current;de.current=null,n&&n.ownerDocument.activeElement===n&&n.blur(),t.rowProps.onDragStart?.(e)},onContextMenu:e=>{w||(e.preventDefault(),e.stopPropagation(),ke(l,e.clientX,e.clientY,e.currentTarget))},onKeyDown:e=>{if("ContextMenu"===e.key||e.shiftKey&&"F10"===e.key){e.preventDefault();const n=e.currentTarget.ownerDocument,t=e=>e.preventDefault();n.addEventListener("contextmenu",t,{capture:!0,once:!0}),n.defaultView?.setTimeout(()=>n.removeEventListener("contextmenu",t,{capture:!0}),500);const a=e.currentTarget.getBoundingClientRect();return void ke(l,a.left+24,a.bottom,e.currentTarget)}t.rowProps.onKeyDown?.(e)}},actions:w||W||!X?void 0:o?h(V?V(n,l):Q.locked,/* @__PURE__ */j("span",{className:"es-list-lock",role:"img","aria-label":V?V(n,l):Q.locked,children:/* @__PURE__ */j(I,{size:13})})):h(Q.deleteItem({noun:_}),/* @__PURE__ */j("button",{type:"button",className:"es-list-x","aria-label":Q.deleteItem({noun:_}),disabled:!te(l),onClick:()=>ge(l),children:"×"})),below:r?/* @__PURE__ */j("div",{className:"es-list-item",children:J(n,l,xe(l))}):void 0,children:K?/* @__PURE__ */j("div",{className:"es-list-row-main",children:K(n,l,xe(l))}):/* @__PURE__ */S("button",{type:"button",className:"es-list-open","aria-expanded":r,onClick:()=>E(r?null:l),children:[b?/* @__PURE__ */j("span",{className:"es-list-thumb","aria-hidden":"true",children:b(n,l)}):null,
1
+ import{TreeSeam as e}from"./chunk-4JSBIW5H.js";import{SETTINGS_BUCKETS as n,SettingsGroup as l}from"./chunk-RC25EGHD.js";import{DEFAULT_TREE_WORDS as t}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as a}from"./chunk-KFV7N2DJ.js";import{EaselMenuItems as r}from"./chunk-EA2HTX37.js";import{FieldNumber as o}from"./chunk-2XMHLXMA.js";import{FieldSelect as i}from"./chunk-G3GWAP5R.js";import{SettingsField as s,SettingsSegmented as c}from"./chunk-36LVP5WD.js";import{DEFAULT_FIELDS_WORDS as d}from"./chunk-WRFD4EXD.js";import{useWords as u}from"./chunk-MFIRYGHW.js";import{useTreeDrag as m,gapToMoveIndex as p}from"./chunk-67GNT6PF.js";import{withTip as h}from"./chunk-P2VEMZH5.js";import{Textarea as f,Input as b,SortableList as g,ListRow as v,ContextMenu as y,tabPanelId as k,Tabs as x,tabButtonId as w}from"efficient-shell/ui";export{LinkPicker}from"efficient-shell/ui";import{useRef as N,useState as C,useLayoutEffect as O,useId as $}from"react";import{jsx as j,jsxs as D}from"react/jsx-runtime";import{ChevronIcon as S,LockIcon as I,MoveUpIcon as P,MoveDownIcon as L,DuplicateIcon as F,TrashIcon as M}from"efficient-shell/icons/efficient";function R({id:e,value:n,onChange:l,placeholder:t,multiline:a=!1,rows:r=3,readOnly:o=!1,ariaLabel:i,ariaLabelledBy:s}){const c=n??"";return a?/* @__PURE__ */j(f,{id:e,size:"sm",className:"es-fin",value:c,rows:r,placeholder:t,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>l(e.target.value)}):/* @__PURE__ */j(b,{id:e,size:"sm",className:"es-fin",type:"text",value:c,placeholder:t,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>l(e.target.value)})}function E(e,n,l){const t=e.slice();return t.splice(Math.max(0,Math.min(n,t.length)),0,l),t}function T(e,n,l){const t=e.slice(),[a]=t.splice(n,1);return t.splice(Math.max(0,Math.min(l,t.length)),0,a),t}function A(e,n){return e.filter((e,l)=>l!==n)}function H(e){return null===e||"object"!=typeof e?e:JSON.parse(JSON.stringify(e))}var z='input, textarea, select, button, [contenteditable]:not([contenteditable="false"]), [tabindex]',B={parentId:"list",slot:"items"};function G({label:n,icon:l,noun:a,items:o,onChange:i,newItem:s,summary:c,itemName:f,thumb:b,min:k=0,max:x,readOnly:w=!1,open:$,onOpen:R,renderItem:G,renderRow:K,canRemove:W,lockedReason:X,fixed:J=!1,removeOnRow:V=!0,canDuplicate:Y,above:q,head:Z=!0}){const Q=u("fields",d).list,U=u("tree",t),_=a??Q.item,ee=!w&&!J&&("number"!=typeof x||o.length<x),ne=o.length<=k,le=e=>!!W&&!W(o[e],e),te=e=>!w&&!J&&V&&!ne&&!le(e),ae=e=>ee&&(!Y||Y(o[e],e)),re=(e,n)=>f?f(e,n):Q.itemName({noun:_,n:n+1}),oe=N([]),ie=N(null),[se,ce]=C(null),de=N(null),[ue,me]=C(null),[pe,he]=C("");O(()=>{const e=ie.current;if(!e)return;ie.current=null;const n=oe.current[e.index]?.querySelectorAll(z)[e.nth]??oe.current[e.index];if(n?.focus(),n&&null!==e.start&&"setSelectionRange"in n)try{n.setSelectionRange(e.start,e.end)}catch{}});const fe=(e,n)=>{if(n<0||n>=o.length||n===e)return;const l=oe.current[e],t=l?.ownerDocument.activeElement;if(l&&t&&l.contains(t)){const e=[...l.querySelectorAll(z)].indexOf(t),a=t;ie.current={index:n,nth:e,start:"number"==typeof a.selectionStart?a.selectionStart:null,end:"number"==typeof a.selectionEnd?a.selectionEnd:null}}i(T(o,e,n));const a=function(e,n,l){return null===e?null:e===n?l:n<e&&l>=e?e-1:n>e&&l<=e?e+1:e}($,e,n);a!==$&&R(a),he(Q.moved({n:n+1,total:o.length}))},be=e=>{ee&&(i(E(o,e,s())),K?(ie.current={index:e,nth:0,start:null,end:null},null!==$&&$>=e&&R($+1)):R(e))},ge=e=>{te(e)&&(i(A(o,e)),$===e?R(null):null!==$&&$>e&&R($-1))},ve=m({keyOf:e=>String(e),canDrop:(e,n)=>n.parentId===B.parentId&&n.slot===B.slot,onDrop:(e,n)=>{const l=p({...B,index:e},n);l!==e&&fe(e,l)},onStep:(e,n)=>fe(e,e+n),canStep:(e,n)=>e+n>=0&&e+n<o.length,readOnly:w}),ye=e=>{const n=[];return e>0&&n.push({label:Q.moveUp,icon:/* @__PURE__ */j(P,{size:14}),shortcut:"⌥↑",onClick:()=>fe(e,e-1)}),e<o.length-1&&n.push({label:Q.moveDown,icon:/* @__PURE__ */j(L,{size:14}),shortcut:"⌥↓",onClick:()=>fe(e,e+1)}),ae(e)&&n.push({label:Q.duplicate,icon:/* @__PURE__ */j(F,{size:14}),onClick:()=>(e=>{ae(e)&&(i(E(o,e+1,H(o[e]))),null!==$&&$>e&&R($+1))})(e)}),te(e)&&n.push({label:Q.delete,icon:/* @__PURE__ */j(M,{size:14}),danger:!0,onClick:()=>ge(e)}),n},ke=(e,n,l,t)=>{w||0===ye(e).length||me({index:e,x:n,y:l,owner:t})},xe=e=>n=>{const l=o.slice();l[e]=n,i(l)};/* @__PURE__ */
2
+ return D("div",{className:"es-list",children:[Z?/* @__PURE__ */D("div",{className:"es-list-head",children:[
3
+ /* @__PURE__ */D("span",{className:"es-list-label",children:[l?/* @__PURE__ */j("span",{className:"es-field-icon","aria-hidden":"true",children:l}):null,n]}),
4
+ /* @__PURE__ */j("span",{className:"es-list-count",children:o.length})]}):null,q?/* @__PURE__ */j("div",{className:"es-list-above",children:q}):null,o.length?/* @__PURE__ */D(g,{"aria-label":n,spacing:"comfortable",className:"es-list-rows",rootProps:ve.rootProps(),children:[o.map((n,l)=>{const t=ve.row({item:l,place:{...B,index:l}}),a=t.draggable&&se!==l,r=!K&&$===l,o=!w&&!J&&V&&le(l),i=["es-list-row",K?"is-inline":"is-item",r?"is-open":"",a?"is-draggable":"",t.dragging?"is-dragging":"",t.drop?`is-drop-${t.drop}`:""].filter(Boolean).join(" ");return[l>0?/* @__PURE__ */j(e,{...ve.seam({place:{...B,index:l}}),onAdd:ee?()=>be(l):void 0,label:Q.addHere({noun:_})},`seam-${l}`):null,
5
+ /* @__PURE__ */j(v,{className:i,flat:!!K,active:r,draggable:t.draggable,dragHint:U.dragHint,dragging:t.dragging,drop:"before"===t.drop||"after"===t.drop?t.drop:void 0,onMove:t.draggable?e=>fe(l,"up"===e?l-1:l+1):void 0,rowRef:e=>{oe.current[l]=e},rowProps:{...t.rowProps,draggable:a||void 0,onPointerDown:e=>{const n=e.target.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])'),a=!!n&&n===n.ownerDocument.activeElement;e.currentTarget.draggable=t.draggable&&!a,de.current=n&&!a?n:null,ce(a?l:null)},onDragStart:e=>{const n=de.current;de.current=null,n&&n.ownerDocument.activeElement===n&&n.blur(),t.rowProps.onDragStart?.(e)},onContextMenu:e=>{w||(e.preventDefault(),e.stopPropagation(),ke(l,e.clientX,e.clientY,e.currentTarget))},onKeyDown:e=>{if("ContextMenu"===e.key||e.shiftKey&&"F10"===e.key){e.preventDefault();const n=e.currentTarget.ownerDocument,t=e=>e.preventDefault();n.addEventListener("contextmenu",t,{capture:!0,once:!0}),n.defaultView?.setTimeout(()=>n.removeEventListener("contextmenu",t,{capture:!0}),500);const a=e.currentTarget.getBoundingClientRect();return void ke(l,a.left+24,a.bottom,e.currentTarget)}t.rowProps.onKeyDown?.(e)}},actions:w||J||!V?void 0:o?h(X?X(n,l):Q.locked,/* @__PURE__ */j("span",{className:"es-list-lock",role:"img","aria-label":X?X(n,l):Q.locked,children:/* @__PURE__ */j(I,{size:13})})):h(Q.deleteItem({noun:_}),/* @__PURE__ */j("button",{type:"button",className:"es-list-x","aria-label":Q.deleteItem({noun:_}),disabled:!te(l),onClick:()=>ge(l),children:"×"})),below:r?/* @__PURE__ */j("div",{className:"es-list-item",children:G(n,l,xe(l))}):void 0,children:K?/* @__PURE__ */j("div",{className:"es-list-row-main",children:K(n,l,xe(l))}):/* @__PURE__ */D("button",{type:"button",className:"es-list-open","aria-expanded":r,onClick:()=>R(r?null:l),children:[b?/* @__PURE__ */j("span",{className:"es-list-thumb","aria-hidden":"true",children:b(n,l)}):null,
6
6
  /* @__PURE__ */j("span",{className:"es-list-row-name",children:re(n,l)}),/* @__PURE__ */j("span",c?{className:"es-list-row-summary",children:c(n,l)}:{className:"es-list-row-summary"}),
7
- /* @__PURE__ */j(D,{size:14,className:"es-list-chev","aria-hidden":"true"})]})},l)]}),
8
- /* @__PURE__ */j(e,{...ve.seam({place:{...B,index:o.length}})})]}):null,w||W?null:/* @__PURE__ */j("button",{type:"button",className:"es-list-add",disabled:!ee,onClick:()=>be(o.length),children:Q.add({noun:_})}),
7
+ /* @__PURE__ */j(S,{size:14,className:"es-list-chev","aria-hidden":"true"})]})},l)]}),
8
+ /* @__PURE__ */j(e,{...ve.seam({place:{...B,index:o.length}})})]}):null,w||J?null:/* @__PURE__ */j("button",{type:"button",className:"es-list-add",disabled:!ee,onClick:()=>be(o.length),children:Q.add({noun:_})}),
9
9
  /* @__PURE__ */j("span",{className:"es-list-said","aria-live":"polite",children:pe}),ue&&ue.index<o.length?
10
- /* @__PURE__ */j(y,{at:{x:ue.x,y:ue.y},owner:ue.owner,onClose:()=>me(null),children:/* @__PURE__ */j(r,{items:ye(ue.index),onClose:()=>me(null)})}):null]})}var K=e=>e<6?e+1:6,Y=(e,n)=>"string"==typeof e.label&&e.label?e.label:n;function V({field:e,name:n,id:t,value:a,onChange:r,readOnly:o,context:i,renderers:s,headingLevel:c=3}){const[d,u]=C(!0),m=a&&"object"==typeof a?a:{};/* @__PURE__ */
11
- return j(l,{id:`${t}-group`,title:Y(e,n),open:d,onToggle:u,level:c,children:Object.entries(e.objectFields).map(([e,l])=>/* @__PURE__ */j(X,{field:l,name:`${n}.${e}`,id:`${t}-${e}`,value:m[e],onChange:n=>r({...m,[e]:n}),readOnly:o,context:i,renderers:s,headingLevel:K(c)},e))})}function W({field:e,name:n,id:l,value:t,onChange:a,readOnly:r,context:o,renderers:i,openItem:s,onOpenItem:c,headingLevel:d}){const[u,m]=C(null),p=c?s??null:u,h=c??m,f=Array.isArray(t)?t:[],b=e.getItemSummary;/* @__PURE__ */
12
- return j(J,{label:Y(e,n),icon:e.icon,noun:"string"==typeof e.noun?e.noun:void 0,items:f,onChange:a,newItem:()=>R({...e.defaultItemProps??{}}),summary:b?(e,n)=>b(e,n):void 0,min:e.min,max:e.max,readOnly:r,open:p,onOpen:h,renderItem:(t,a,s)=>Object.entries(e.arrayFields).map(([e,c])=>/* @__PURE__ */j(X,{field:c,name:`${n}[${a}].${e}`,id:`${l}-${a}-${e}`,value:t?.[e],onChange:n=>s({...t,[e]:n}),readOnly:r,context:o,renderers:i,headingLevel:d},e))})}function X(e){const{field:n,name:l,id:t,value:a,onChange:r,readOnly:d,context:u,renderers:m}=e;if(!n||n.marker||!1===n.visible)return null;const p=m?.[n.type];if(p)return p({field:n,name:l,id:t,value:a,onChange:r,readOnly:d});switch(n.type){case"custom":{const e={...u,field:n,name:l,id:t,value:a,onChange:r,readOnly:d};return n.render(e)}case"text":case"textarea":/* @__PURE__ */
13
- return j(s,{label:Y(n,l),htmlFor:t,icon:n.icon,hint:n.hint,children:/* @__PURE__ */j(E,{id:t,value:"string"==typeof a?a:null==a?"":String(a),onChange:r,placeholder:n.placeholder,multiline:"textarea"===n.type,readOnly:d})});case"number":/* @__PURE__ */
14
- return j(s,{label:Y(n,l),htmlFor:t,icon:n.icon,hint:n.hint,children:/* @__PURE__ */j(o,{id:t,value:"number"==typeof a?a:void 0,onChange:r,min:n.min,max:n.max,step:n.step,placeholder:n.placeholder,readOnly:d})});case"select":{const e=`${t}-label`;/* @__PURE__ */
15
- return j(s,{label:Y(n,l),labelId:e,htmlFor:t,icon:n.icon,hint:n.hint,children:/* @__PURE__ */j(i,{id:t,value:a,options:n.options,onChange:r,readOnly:d,ariaLabelledBy:e})})}case"radio":/* @__PURE__ */
16
- return j(s,{label:Y(n,l),icon:n.icon,hint:n.hint,children:/* @__PURE__ */j(c,{ariaLabel:Y(n,l),value:a,options:n.options.map(e=>({id:e.value,label:e.label,icon:e.icon,disabled:e.disabled||d})),onChange:e=>{d||r(e)}})});case"object":/* @__PURE__ */
17
- return j(V,{...e,field:n});case"array":/* @__PURE__ */
18
- return j(W,{...e,field:n});case"slot":return null}}var G=e=>n.includes(e);function Z(e){let l,t=n[0];const a=[],r=/* @__PURE__ */new Set;for(const[n,o]of Object.entries(e))o&&(G(o.bucket)&&((o.marker||o.bucket!==t)&&(l=void 0),t=o.bucket),o.marker&&"string"==typeof o.fold?l={key:n,title:o.fold}:o.marker&&!1===o.fold&&(l=void 0),o.marker||!1===o.visible||(a.push(l?{name:n,field:o,bucket:t,fold:l}:{name:n,field:o,bucket:t}),"slot"!==o.type&&r.add(t)));return{rows:a,buckets:n.filter(e=>r.has(e))}}function q(e){return new Map(Z(e).rows.map(e=>[e.name,e.bucket]))}function Q(e){const n=[];for(const l of e){const e=n[n.length-1];e&&e.fold?.key===l.fold?.key?e.rows.push(l):n.push({fold:l.fold,rows:[l]})}return n}function U({fields:e,values:n,onChange:t,readOnly:r=!1,context:o,tab:i,onTab:s,tabs:c=!0,tabIcons:d,renderers:m,idPrefix:p,ariaLabel:h,lead:f,children:b,leadFold:g,closedFolds:v,onFold:y,headingLevel:N=3}){const O=u("panel",a),D=$(),I=p??`es-insp${D.replace(/:/g,"")}`,F=Z(e),[L,P]=C(void 0),A=i??L,E=A&&F.buckets.includes(A)?A:F.buckets[0],[M,T]=C(null),H=M&&M.panel===I&&F.rows.some(e=>e.name===M.name)?M:null,R=c&&F.buckets.length>1,z=R&&E?k(I,E):`${I}-rows`,[B,J]=C(()=>/* @__PURE__ */new Set),Y=v??B,V=(e,n)=>{/* @__PURE__ */return j(l,{title:e.title,open:!Y.has(e.key),onToggle:n=>((e,n)=>{void 0===v&&J(l=>{const t=new Set(l);return n?t.delete(e):t.add(e),t}),y?.(e,n)})(e.key,n),id:`${I}-fold-${t=e.key,[...t].map(e=>/[A-Za-z0-9_-]/.test(e)?e:`-u${e.codePointAt(0).toString(16)}-`).join("")}`,level:N,children:n});var t},W=e=>R&&e!==E,G=({name:e,field:l,bucket:a,fold:i})=>/* @__PURE__ */j("div",{className:"es-insp-row","data-field":e,"data-bucket":a,hidden:!!W(a)||void 0,children:/* @__PURE__ */j(X,{field:l,name:e,id:`${I}-${e}`,value:n[e],onChange:n=>t(e,n),readOnly:r,context:o,renderers:m,openItem:H&&H.name===e?H.index:null,onOpenItem:n=>T(null===n?null:{panel:I,name:e,index:n}),headingLevel:i?K(N):N})},e);/* @__PURE__ */
19
- return S("div",{className:"es-insp",children:[R?/* @__PURE__ */j("div",{className:"es-insp-tabs",children:/* @__PURE__ */j(x,{variant:"underline",block:!0,"aria-label":h??O.settings,idPrefix:I,value:E,onChange:e=>{const n=e;void 0===i&&P(n),s?.(n)},items:F.buckets.map(e=>{const n=O.buckets[e],l=d?.[e];return l?{id:e,icon:l,label:/* @__PURE__ */j("span",{className:"sr-only",children:n}),tooltip:n}:{id:e,label:n}})})}):null,
20
- /* @__PURE__ */S("div",{className:"es-insp-rows",id:z,role:R?"tabpanel":void 0,"aria-labelledby":R&&E?w(I,E):void 0,children:[f?g?/* @__PURE__ */j("div",{className:"es-insp-band","data-fold":g.key,children:V(g,f)}):f:null,Q(F.rows).map((e,n)=>{if(!e.fold)return e.rows.map(G);const l=e.rows[0].bucket,t=e.rows.every(e=>"slot"===e.field.type);/* @__PURE__ */
21
- return j("div",{className:"es-insp-band","data-fold":e.fold.key,"data-bucket":l,hidden:!(!W(l)&&!t)||void 0,children:V(e.fold,e.rows.map(G))},`fold-${e.fold.key}-${n}`)}),b]})]})}export{E as FieldText,U as Inspector,X as InspectorField,J as ListField,q as bucketsOf,R as copyItem,M as insertAt,Y as labelOf,T as moveTo,Z as planFields,H as removeAt};
10
+ /* @__PURE__ */j(y,{at:{x:ue.x,y:ue.y},owner:ue.owner,onClose:()=>me(null),children:/* @__PURE__ */j(r,{items:ye(ue.index),onClose:()=>me(null)})}):null]})}var K=e=>e<6?e+1:6,W=(e,n)=>"string"==typeof e.label&&e.label?e.label:n;function X({field:e,name:n,id:t,value:a,onChange:r,readOnly:o,context:i,renderers:s,headingLevel:c=3}){const[d,u]=C(!0),m=a&&"object"==typeof a?a:{};/* @__PURE__ */
11
+ return j(l,{id:`${t}-group`,title:W(e,n),open:d,onToggle:u,level:c,children:Object.entries(e.objectFields).map(([e,l])=>/* @__PURE__ */j(V,{field:l,name:`${n}.${e}`,id:`${t}-${e}`,value:m[e],onChange:n=>r({...m,[e]:n}),readOnly:o,context:i,renderers:s,headingLevel:K(c)},e))})}function J({field:e,name:n,id:l,value:t,onChange:a,readOnly:r,context:o,renderers:i,openItem:s,onOpenItem:c,headingLevel:d}){const[u,m]=C(null),p=c?s??null:u,h=c??m,f=Array.isArray(t)?t:[],b=e.getItemSummary;/* @__PURE__ */
12
+ return j(G,{label:W(e,n),icon:e.icon,noun:"string"==typeof e.noun?e.noun:void 0,items:f,onChange:a,newItem:()=>H({...e.defaultItemProps??{}}),summary:b?(e,n)=>b(e,n):void 0,min:e.min,max:e.max,readOnly:r,open:p,onOpen:h,renderItem:(t,a,s)=>Object.entries(e.arrayFields).map(([e,c])=>/* @__PURE__ */j(V,{field:c,name:`${n}[${a}].${e}`,id:`${l}-${a}-${e}`,value:t?.[e],onChange:n=>s({...t,[e]:n}),readOnly:r,context:o,renderers:i,headingLevel:d},e))})}function V(e){const{field:n,name:l,id:t,value:a,onChange:r,readOnly:d,context:u,renderers:m}=e;if(!n||n.marker||!1===n.visible)return null;const p=m?.[n.type];if(p)return p({field:n,name:l,id:t,value:a,onChange:r,readOnly:d});switch(n.type){case"custom":{const e={...u,field:n,name:l,id:t,value:a,onChange:r,readOnly:d};return n.render(e)}case"text":case"textarea":/* @__PURE__ */
13
+ return j(s,{label:W(n,l),htmlFor:t,icon:n.icon,hint:n.hint,children:/* @__PURE__ */j(R,{id:t,value:"string"==typeof a?a:null==a?"":String(a),onChange:r,placeholder:n.placeholder,multiline:"textarea"===n.type,readOnly:d})});case"number":/* @__PURE__ */
14
+ return j(s,{label:W(n,l),htmlFor:t,icon:n.icon,hint:n.hint,children:/* @__PURE__ */j(o,{id:t,value:"number"==typeof a?a:void 0,onChange:r,min:n.min,max:n.max,step:n.step,placeholder:n.placeholder,readOnly:d})});case"select":{const e=`${t}-label`;/* @__PURE__ */
15
+ return j(s,{label:W(n,l),labelId:e,htmlFor:t,icon:n.icon,hint:n.hint,children:/* @__PURE__ */j(i,{id:t,value:a,options:n.options,onChange:r,readOnly:d,ariaLabelledBy:e})})}case"radio":/* @__PURE__ */
16
+ return j(s,{label:W(n,l),icon:n.icon,hint:n.hint,children:/* @__PURE__ */j(c,{ariaLabel:W(n,l),value:a,options:n.options.map(e=>({id:e.value,label:e.label,icon:e.icon,disabled:e.disabled||d})),onChange:e=>{d||r(e)}})});case"object":/* @__PURE__ */
17
+ return j(X,{...e,field:n});case"array":/* @__PURE__ */
18
+ return j(J,{...e,field:n});case"slot":return null}}var Y=e=>n.includes(e);function q(e){let l,t=n[0];const a=[],r=/* @__PURE__ */new Set;for(const[n,o]of Object.entries(e))o&&(Y(o.bucket)&&((o.marker||o.bucket!==t)&&(l=void 0),t=o.bucket),o.marker&&"string"==typeof o.fold?l={key:n,title:o.fold}:o.marker&&!1===o.fold&&(l=void 0),o.marker||!1===o.visible||(a.push(l?{name:n,field:o,bucket:t,fold:l}:{name:n,field:o,bucket:t}),"slot"!==o.type&&r.add(t)));return{rows:a,buckets:n.filter(e=>r.has(e))}}function Z(e){return new Map(q(e).rows.map(e=>[e.name,e.bucket]))}function Q(e){const n=[];for(const l of e){const e=n[n.length-1];e&&e.fold?.key===l.fold?.key?e.rows.push(l):n.push({fold:l.fold,rows:[l]})}return n}function U({fields:e,values:n,onChange:t,readOnly:r=!1,context:o,tab:i,onTab:s,tabs:c=!0,tabIcons:d,renderers:m,idPrefix:p,ariaLabel:h,lead:f,children:b,leadFold:g,closedFolds:v,onFold:y,headingLevel:N=3}){const O=u("panel",a),S=$(),I=p??`es-insp${S.replace(/:/g,"")}`,P=q(e),[L,F]=C(void 0),M=i??L,R=M&&P.buckets.includes(M)?M:P.buckets[0],[E,T]=C(null),A=E&&E.panel===I&&P.rows.some(e=>e.name===E.name)?E:null,H=c&&P.buckets.length>1,z=H&&R?k(I,R):`${I}-rows`,[B,G]=C(()=>/* @__PURE__ */new Set),W=v??B,X=(e,n)=>{/* @__PURE__ */return j(l,{title:e.title,open:!W.has(e.key),onToggle:n=>((e,n)=>{void 0===v&&G(l=>{const t=new Set(l);return n?t.delete(e):t.add(e),t}),y?.(e,n)})(e.key,n),id:`${I}-fold-${t=e.key,[...t].map(e=>/[A-Za-z0-9_-]/.test(e)?e:`-u${e.codePointAt(0).toString(16)}-`).join("")}`,level:N,children:n});var t},J=e=>H&&e!==R,Y=({name:e,field:l,bucket:a,fold:i})=>/* @__PURE__ */j("div",{className:"es-insp-row","data-field":e,"data-bucket":a,hidden:!!J(a)||void 0,children:/* @__PURE__ */j(V,{field:l,name:e,id:`${I}-${e}`,value:n[e],onChange:n=>t(e,n),readOnly:r,context:o,renderers:m,openItem:A&&A.name===e?A.index:null,onOpenItem:n=>T(null===n?null:{panel:I,name:e,index:n}),headingLevel:i?K(N):N})},e);/* @__PURE__ */
19
+ return D("div",{className:"es-insp",children:[H?/* @__PURE__ */j("div",{className:"es-insp-tabs",children:/* @__PURE__ */j(x,{variant:"underline",block:!0,"aria-label":h??O.settings,idPrefix:I,value:R,onChange:e=>{const n=e;void 0===i&&F(n),s?.(n)},items:P.buckets.map(e=>{const n=O.buckets[e],l=d?.[e];return l?{id:e,icon:l,label:/* @__PURE__ */j("span",{className:"sr-only",children:n}),tooltip:n}:{id:e,label:n}})})}):null,
20
+ /* @__PURE__ */D("div",{className:"es-insp-rows",id:z,role:H?"tabpanel":void 0,"aria-labelledby":H&&R?w(I,R):void 0,children:[f?g?/* @__PURE__ */j("div",{className:"es-insp-band","data-fold":g.key,children:X(g,f)}):f:null,Q(P.rows).map((e,n)=>{if(!e.fold)return e.rows.map(Y);const l=e.rows[0].bucket,t=e.rows.every(e=>"slot"===e.field.type);/* @__PURE__ */
21
+ return j("div",{className:"es-insp-band","data-fold":e.fold.key,"data-bucket":l,hidden:!(!J(l)&&!t)||void 0,children:X(e.fold,e.rows.map(Y))},`fold-${e.fold.key}-${n}`)}),b]})]})}export{R as FieldText,U as Inspector,V as InspectorField,G as ListField,Z as bucketsOf,H as copyItem,E as insertAt,W as labelOf,T as moveTo,q as planFields,A as removeAt};
@@ -0,0 +1,2 @@
1
+ import{PanelLeftIcon as e,PanelRightIcon as i}from"efficient-shell/icons/efficient";import{jsx as t}from"react/jsx-runtime";function r({side:r}){/* @__PURE__ */
2
+ return t("left"===r?e:i,{size:16})}export{r as PanelToggleIcon};
@@ -1,4 +1,4 @@
1
- import{useScreenOwnerName as e}from"./chunk-U7KFFC7N.js";import{settlePanelPick as n}from"./chunk-R6WTQWAC.js";import{MediaPanelHead as i,mediaPickKind as c}from"./chunk-IE55HNMA.js";import{jsxs as o,Fragment as r,jsx as t}from"react/jsx-runtime";function l({panel:l,pick:d,onHide:m}){const p=e();/* @__PURE__ */
1
+ import{useScreenOwnerName as e}from"./chunk-JRRYFSCY.js";import{settlePanelPick as n}from"./chunk-R6WTQWAC.js";import{MediaPanelHead as i,mediaPickKind as c}from"./chunk-IE55HNMA.js";import{jsxs as o,Fragment as r,jsx as t}from"react/jsx-runtime";function l({panel:l,pick:d,onHide:m}){const p=e();/* @__PURE__ */
2
2
  return o(r,{children:[
3
3
  /* @__PURE__ */t(i,{context:p,pick:d?{kind:c(d.accept),field:d.title||void 0}:null,onCancel:()=>d&&n(d.requestId,null),onHide:m}),
4
4
  /* @__PURE__ */t("div",{className:"sf-media-panel",children:/* @__PURE__ */t(l,{pick:d,onPick:e=>d&&n(d.requestId,e)})})]})}export{l as MediaSidePanel};
@@ -0,0 +1 @@
1
+ var e={title:"Add",contextAll:"Sections and blocks",done:"Done",doneDescription:"Close Add and go back",templates:"Your templates",tile:({name:e})=>`Add ${e}`,hint:"Drag onto the page.",search:"Search",onlySections:"Only sections go here",notInside:({name:e})=>`Cannot go inside ${e}`,addingTo:({name:e})=>`Adding to ${e}`,addingBefore:({name:e})=>`Adding before ${e}`,addingAtEnd:"Adding at the end of the page",addingHere:"Adding here"};var a={savedAgo:function({seconds:e}){const a=Math.max(0,Math.floor(e));if(a<1)return"Saved just now";if(a<60)return`Saved ${a} second${1===a?"":"s"} ago`;const o=Math.floor(a/60);if(o<60)return`Saved ${o} minute${1===o?"":"s"} ago`;const n=Math.floor(o/60);return`Saved ${n} hour${1===n?"":"s"} ago`},saved:"All changes saved",saving:"Saving",pending:"Changes not saved yet — saving in a moment",failedIn:({seconds:e})=>`Not saved — trying again in ${e} s`,failedSoon:"Not saved — trying again soon",offline:"You’re offline — we’ll save when you’re back",pausedHeld:"Auto-save is off — changes not saved",paused:"Auto-save is off",locked:({editing:e})=>`Not saving — ${e}`,blockedOffline:"You’re offline. Try again when you’re back online.",blockedFailed:"Your last changes are not saved yet. Try again when they are.",blockedConflict:"Your last save was refused. See the notice below."},o={loading:"Loading",waitingForAuthorization:"Waiting for editor authorization",missingTemplatePage:"Couldn’t open a page in this template.",missingPage:({slug:e})=>`No page with slug "${e}".`,missingDocument:"Couldn’t open this document.",loadFailed:({cause:e})=>`Could not load the document — ${e}`,noun:"page",pageSettings:"Page settings",header:"Header",footer:"Footer",pageSections:"Page",templateSections:"Template",addSection:"Add section",addSectionHere:"Add section here",done:"Done",copied:({name:e})=>`Copied ${e}`,pasteRefused:({name:e})=>`${e} can’t be pasted here.`,add:e,canvasAddBlock:"Add block",railMedia:"Media library",leftPanel:"Left panel",resizeLeftPanel:"Resize left panel",leave:{title:"Unsaved changes",body:"Your most recent edits haven’t finished saving yet. Save them before switching, or leave and discard them.",cancel:"Cancel",discard:"Discard & leave",save:"Save & leave",saving:"Saving"},bar:{undo:"Undo",redo:"Redo",refresh:"Reload the preview",refreshTip:"Reload the preview (keeps your place)",notSaving:"Not saving — see the notice below",retry:"Retry now",autoSaveOff:"Auto-save is off — click to turn it back on (saves your held edits)",autoSaveOn:"Auto-save is on — click to pause it",views:"Left panel views",saveOptions:"Save options",autoSave:"Auto-save",saveNow:"Save now"},saveStatus:a,menu:{undo:"Undo",redo:"Redo",collapseAll:"Collapse all layers",selectAll:"Select all",pinned:"Pinned — can’t be moved or deleted",clipboardRefused:"Your browser won’t let us read the clipboard — press ⌘V"},layers:"Layers",expandAll:"Expand all sections",collapseAll:"Collapse all sections",nothingToFold:"Nothing to fold on this page",editFooter:"Edit the site footer",rename:"Rename",deleteNamed:({name:e})=>`Delete ${e}`,hideNamed:({name:e})=>`Hide ${e}`,showNamed:({name:e})=>`Show ${e}`,addBlockHere:"Add block here",sectionFirst:({name:e})=>`“${e}” is already first`,sectionLast:({name:e})=>`“${e}” is already last`,sectionMoved:({name:e,n:a,total:o})=>`Moved “${e}” to position ${a} of ${o}`,sectionAdded:({name:e})=>`Added “${e}” section`,deleted:({name:e})=>`Deleted “${e}”`,resizeSettingsPanel:"Resize settings panel",sectionSettings:({name:e})=>`${e} settings`,headerSettings:"Header settings",addBlockMenu:"Add block",deviceNote:{tablet:"Tablet uses the desktop settings.",mobile:"Showing the phone settings for this section."}};export{e as DEFAULT_SCREEN_ADD_WORDS,a as DEFAULT_SCREEN_SAVE_STATUS_WORDS,o as DEFAULT_SCREEN_WORDS};
@@ -0,0 +1 @@
1
+ var e={less:"Less",more:"More",choose:"Choose",search:"Search",noMatches:"No matches",list:{item:"item",itemName:({noun:e,n:o})=>{return`${t=e,t?t[0].toUpperCase()+t.slice(1):t} ${o}`;var t},position:({n:e,total:o})=>`${e} of ${o}`,duplicate:"Duplicate",duplicateItem:({noun:e})=>`Duplicate ${e}`,deleteItem:({noun:e})=>`Delete ${e}`,add:({noun:e})=>`+ Add ${e}`,addHere:({noun:e})=>`Add ${e} here`,moveUp:"Move up",moveDown:"Move down",delete:"Delete",locked:"This one cannot be removed",moved:({n:e,total:o})=>`Moved to ${e} of ${o}`}};export{e as DEFAULT_FIELDS_WORDS};
@@ -0,0 +1 @@
1
+ var n=["none","upper","capitalize","lower"],e={none:"none",upper:"uppercase",capitalize:"capitalize",lower:"lowercase"};function i(e){return n.includes(e)}function t(n){return i(n)?e[n]:void 0}function a(i){return n.find(n=>e[n]===i)}var r=["font","color","size","weight","emphasis","lineSpacing","letterSpacing","paragraphSpacing","letterCase","largestSize"],o=["font","color","size","weight","lineSpacing","letterSpacing","paragraphSpacing","letterCase"],d=["heading","body"],s=7,l={heading:3,body:5},u={min:5,max:void 0,sliderMin:12,sliderMax:72,step:1,shiftStep:10,unit:"px"},c={size:u,weight:{min:100,max:900,sliderMin:300,sliderMax:900,step:100,shiftStep:100,unit:""},lineSpacing:{min:50,max:250,sliderMin:50,sliderMax:250,step:1,shiftStep:10,unit:"%"},letterSpacing:{min:-10,max:void 0,sliderMin:-5,sliderMax:10,step:.1,shiftStep:1,unit:"px"},paragraphSpacing:{min:0,max:void 0,sliderMin:0,sliderMax:48,step:1,shiftStep:10,unit:"px"},largestSize:u},f=(n,e)=>`${"heading"===n?"Heading":"Body"} ${e}`;function p(n=({kind:n,n:e})=>f(n,e)){return d.flatMap(e=>Array.from({length:l[e]},(i,t)=>({id:`${e}-${t+1}`,kind:e,name:n({kind:e,n:t+1}),values:{}})))}function m(n,e,i=s){return n.filter(n=>n.kind===e).length<i}function h(n,e){const i=new RegExp(`^${e}-([1-9]\\d*)$`).exec(n);return i?Number(i[1]):void 0}function g(n){const e=h(n.id,n.kind);return void 0!==e&&e<=l[n.kind]}function x(n,e,i={}){const{max:t=s,name:a=({kind:n,n:e})=>f(n,e),make:r}=i;if(!m(n,e,t))return null;const o=n.filter(n=>n.kind===e);let d=o.length+1;const l=new Set(n.map(n=>n.name));for(;l.has(a({kind:e,n:d}));)d+=1;const u=new Set(n.map(n=>n.id));let c=Math.max(d,...o.map(n=>(h(n.id,e)??0)+1));for(;u.has(`${e}-${c}`);)c+=1;const p=o.at(-1),g=r?r(e,d):{id:`${e}-${c}`,kind:e,name:a({kind:e,n:d}),values:{...p?.values??{}}},x=p?n.indexOf(p)+1:"heading"===e?0:n.length;return{styles:[...n.slice(0,x),g,...n.slice(x)],added:g}}function k(n,e,i={}){const{name:t=({kind:n,n:e})=>f(n,e)}=i,a=n.find(n=>n.id===e);if(!a||g(a))return null;const r=n.filter(n=>n.kind===a.kind),o=r.indexOf(a),d=/* @__PURE__ */new Map;return r.forEach((n,e)=>{e>o&&n.name===t({kind:n.kind,n:e+1})&&d.set(n,t({kind:n.kind,n:e}))}),{styles:n.filter(n=>n!==a).map(n=>d.has(n)?{...n,name:d.get(n)}:n),removed:a}}function v(n,e){const i=n.find(n=>n.id===e);if(i)return i;for(const i of d){const t=h(e,i);if(void 0===t)continue;let a;for(const e of n){const n=e.kind===i?h(e.id,i):void 0;void 0!==n&&n<t&&(!a||n>a.n)&&(a={n:n,style:e})}return a?.style}}function M(n,e,i){return n.map(n=>{if(n.id!==e)return n;const t={...n.values};for(const[n,e]of Object.entries(i))void 0===e?delete t[n]:t[n]=e;return{...n,values:t}})}function S(n){return Math.min(20,Math.max(12,Math.round(.5*n+6)))}function w(n,e){const i=e.weights;return[i.thin,i.extraLight,i.light,i.regular,i.medium,i.semibold,i.bold,i.extraBold,i.black][Math.min(8,Math.max(0,Math.round(n/100)-1))]}function z(n,e,i,t={}){const a=e.find(e=>e.value===n.font)?.label??n.font??"",r=void 0===n.size?t.autoSize?i.auto:"":i.px({n:n.size});return i.summary({font:a,size:r,weight:w(n.weight??400,i)})}export{o as CAMPAIGN_TEXT_STYLE_SETTINGS,n as TEXT_STYLE_CASES,e as TEXT_STYLE_CASE_CSS,l as TEXT_STYLE_DEFAULT_COUNT,d as TEXT_STYLE_KINDS,s as TEXT_STYLE_MAX,c as TEXT_STYLE_RANGES,r as TEXT_STYLE_SETTINGS,x as addTextStyle,m as canAddTextStyle,p as defaultTextStyles,z as describeTextStyle,g as isDefaultTextStyle,i as isTextStyleCase,k as removeTextStyle,v as resolveTextStyle,t as textStyleCaseCss,a as textStyleCaseOfCss,S as textStyleRowSize,M as updateTextStyle,w as weightWord};
@@ -1,10 +1,10 @@
1
1
  /*
2
2
  * efficient-easel — the copy control's own chrome.
3
3
  *
4
- * Only the BAR and the frame are dressed here. The box inside it is
5
- * `efficient-easel/gold.css` and the direction strip is the panel grammar's own
6
- * chip (`efficient-easel/panel.css`) — this sheet must never restate either, or
7
- * there are two places a chip can change.
4
+ * Only the frame, the windows and the line under the box are dressed here.
5
+ * The box inside it is `efficient-easel/gold.css` and the bar is the shell's
6
+ * `TextToolbar` (`efficient-shell/ui`, harness UI-24) — this sheet must never
7
+ * restate either, or there are two places a part can change.
8
8
  *
9
9
  * Declared on `.es-copy`, never on `:root`, for the reason gold.css gives: a
10
10
  * sheet imported by an editor must not leak a variable into the page being
@@ -16,9 +16,6 @@
16
16
 
17
17
  .es-copy {
18
18
  --es-copy-gap: var(--es-space-8, 8px);
19
- /* efficient-shell's IconButton at its default size, md (design v5, 0.94.0). */
20
- --es-copy-mark-size: var(--control-height-md, 32px);
21
- --es-copy-rule: var(--es-border, var(--line));
22
19
  --es-copy-field-border: var(--es-field-border, var(--line-strong));
23
20
  --es-copy-field-bg: var(--es-field-bg, var(--surface));
24
21
  /** The field's inner inset. On the SURFACES, never on the box — see
@@ -36,85 +33,10 @@
36
33
  --es-copy-radius: var(--radius-md);
37
34
 
38
35
  display: block;
39
- /* A container, so a host can query the box's own width. Never on
40
- `.es-copy-bar`: that would contain the very box whose children measure. */
36
+ /* A container, so a host can query the box's own width. */
41
37
  container-type: inline-size;
42
38
  }
43
39
 
44
- /* — the bar — */
45
-
46
- .es-copy-bar {
47
- display: flex;
48
- flex-wrap: wrap;
49
- align-items: center;
50
- gap: 2px;
51
- margin-bottom: var(--es-copy-gap);
52
- }
53
-
54
- /*
55
- * The direction sits on ITS OWN LINE, under the marks (0.94.0, design v5:
56
- * "下面一行是对齐"). Until 0.93 it sat at the far end of the marks' row; seven
57
- * 32px buttons leave no room beside them at any panel width, and a strip
58
- * squeezed into the remainder is a strip drawn broken. The marks act on the
59
- * SELECTION and this on the whole text, so a line of its own also says they
60
- * are different kinds of thing.
61
- *
62
- * ⚠️ THE FLEX VALUES ARE NOT TASTE. THE STRIP IS 0px WIDE WITHOUT THEM.
63
- *
64
- * `.es-segs-fit` is `container-type: inline-size` + `flex: none` (panel.css).
65
- * In a flex parent `flex: none` means "size to your own content", and size
66
- * containment means there IS no content width to size to. Both declarations
67
- * are right where they were written and they collide in any flex slot — which
68
- * this is. `panel.css` carries the full account under card 66516 and the same
69
- * exception for `.es-field-ctl`; it is not restated here, only obeyed.
70
- *
71
- * So the wrapper takes a basis from the bar, and hands one to the fit wrapper
72
- * inside it. `min-width: 0` on both because a flex item's automatic minimum is
73
- * its content size, which containment makes meaningless.
74
- */
75
- .es-copy-bar-end {
76
- display: flex;
77
- align-items: center;
78
- flex: 1 1 100%;
79
- min-width: 0;
80
- }
81
-
82
- /* Not the whole line (design v14: the Segmented "does not fill a row"). A
83
- FIXED basis, never `auto`: this wrapper is a size container, so `auto` is
84
- its content width, which containment makes 0. */
85
- .es-copy-bar-end > .es-segs-fit {
86
- flex: 0 1 240px;
87
- min-width: 0;
88
- }
89
-
90
- .es-copy-bar-split {
91
- width: 1px;
92
- align-self: stretch;
93
- margin: 2px 4px;
94
- background: var(--es-copy-rule);
95
- }
96
-
97
- /* A mark button is efficient-shell's IconButton (harness UI-24): its look, its
98
- hover, its disabled fade and — since efficient-shell 4.164.0 — its pressed
99
- look from `aria-pressed` are the kit's; this bar used to draw a copy of each.
100
- What stays is its size in this bar, the room a letter needs and the letter
101
- styling below. */
102
- .es-copy-mark {
103
- height: var(--es-copy-mark-size);
104
- min-width: var(--es-copy-mark-size);
105
- width: auto;
106
- padding: 0 4px;
107
- font-size: 11px;
108
- line-height: 1;
109
- }
110
-
111
- /* The glyph looks like what it does. Safe here and NOT in the gold layer: a
112
- button is not sitting over a caret, so a wider glyph moves nothing. A
113
- drawing — the set's glyph or the host's own — gets none of it. */
114
- .es-copy-mark.is-bold { font-weight: 700; }
115
- .es-copy-mark.is-italic { font-style: italic; }
116
- .es-copy-mark.is-strike { text-decoration: line-through; }
117
-
118
40
  /* — the frame around the box — */
119
41
 
120
42
  /*
@@ -338,35 +260,13 @@
338
260
  margin-top: var(--es-space-12, 12px);
339
261
  }
340
262
 
341
- /* Words never break inside: in a narrow box (a 220px panel) Clear style
342
- moves to a line of its own, still at the right end. */
263
+ /* Words never break inside. */
343
264
  .es-copy-marks-label {
344
- font-size: 14px;
265
+ font-size: var(--text-sm, 14px);
345
266
  white-space: nowrap;
346
267
  color: var(--es-text-secondary, var(--ink));
347
268
  }
348
269
 
349
- /*
350
- * CLEAR STYLE (owner ruling 2026-10-07, mockup
351
- * https://claude.ai/artifact/GiyeV3xazepzArKGVkFM8T): a text button at the
352
- * right end of the line under the box — beside Show marks, or alone under a
353
- * one-line box (GG, 2026-10-07) — with the clear-marks glyph. Off until words
354
- * are selected in the box.
355
- *
356
- * It is the shell's secondary Button, small (Lewis 2026-10-13: ghost is for
357
- * toolbars and rows of icons; a lone text button is secondary; UI-24). The
358
- * shell owns its look; this sheet only places it on the line.
359
- */
360
- .es-copy-clear {
361
- margin-left: auto;
362
- }
363
-
364
- /* Off, it explains itself in the shell's Tooltip, whose wrapper is then the
365
- line's last item: the wrapper takes the push to the end. */
366
- .es-copy-marks > span:has(> .es-copy-clear) {
367
- margin-left: auto;
368
- }
369
-
370
270
  /* — the final toolbar (E5b, design final 2026-10-06) — */
371
271
 
372
272
  /*
@@ -445,7 +345,7 @@
445
345
  }
446
346
 
447
347
  .es-copy-pop-label {
448
- font-size: 12px;
348
+ font-size: var(--text-xs, 12px);
449
349
  font-weight: 500;
450
350
  color: var(--es-text-secondary, var(--ink));
451
351
  }
@@ -1,19 +1,49 @@
1
1
  import * as react from 'react';
2
- import { c as CopyBoxProps, d as CopyCell, T as TextBoxHandle } from '../canvas-typing-DvoqQINU.js';
3
- export { e as COPY_CELLS, b as CanvasTypingEnd, f as CanvasTypingOptions, g as CanvasTypingSession, h as ColorWindow, i as CopyBoxAlign, j as CopyBoxFooter, C as CopyBoxLastTool, k as CopyCase, l as CopyCellPreset, m as CopyCells, a as CopyThemeColor, M as MarkBar, n as MarkBarProps, o as MarkWriter, S as SelectionSource, p as TextAreaHandle, q as TextMap, r as ToolbarMark, s as ariaShortcut, t as colorRunOf, u as insertSelection, v as markSelection, w as startCanvasTyping, x as textMap } from '../canvas-typing-DvoqQINU.js';
2
+ import { ReactNode } from 'react';
3
+ import { c as CopyBoxProps, d as CopyCell, T as TextBoxHandle } from '../canvas-typing-CC0wA-ys.js';
4
+ export { e as COPY_CELLS, b as CanvasTypingEnd, f as CanvasTypingOptions, g as CanvasTypingSession, h as ColorWindow, i as CopyBoxAlign, j as CopyBoxFooter, C as CopyBoxLastTool, k as CopyCase, l as CopyCellPreset, m as CopyCells, a as CopyThemeColor, M as MarkWriter, S as SelectionSource, n as TextAreaHandle, o as TextMap, p as ToolbarMark, q as colorRunOf, r as insertSelection, s as markSelection, t as startCanvasTyping, u as textMap } from '../canvas-typing-CC0wA-ys.js';
5
+ import { MarkStyle, MarkupTool, InlineRule, MarkedLine, WrapResult } from 'efficient-shell/markup';
4
6
  export { TextToolbar, TextToolbarProps } from 'efficient-shell/ui';
5
7
  import { F as FieldOption } from '../types-Dkx1VAIQ.js';
6
- import { a as CopyAlign } from '../words-dsex49Jh.js';
7
- export { b as COPY_ALIGNS, c as COPY_ALIGN_FIT, d as COPY_ALIGN_GLYPHS, e as COPY_ALIGN_LABELS, C as CopyWords, f as copyAlignOptions } from '../words-dsex49Jh.js';
8
- import { InlineRule, MarkStyle, MarkedLine, WrapResult } from '../markup/index.js';
8
+ import { a as CopyAlign } from '../words-CiuKuiy0.js';
9
+ export { b as COPY_ALIGNS, c as COPY_ALIGN_FIT, d as COPY_ALIGN_GLYPHS, e as COPY_ALIGN_LABELS, C as CopyWords, f as copyAlignOptions } from '../words-CiuKuiy0.js';
10
+ import { TextStyleCase } from '../text-styles/model.js';
9
11
  import '../buckets-Tj-nkBpg.js';
12
+ import '../words-gIDCeRv3.js';
10
13
 
11
- declare function CopyBox({ value, onChange, onCommit, onCancel, multiline, placeholder, ariaLabel, className, readOnly, rules, tools, writeMark, actions, align, glyphs, barLabel, renderFooter, inputRef, barShows, richText, defaultShowMarks, toolbar, colors, cells, letterCase, lastTool, }: CopyBoxProps): react.JSX.Element;
14
+ declare function CopyBox({ value, onChange, onCommit, onCancel, multiline, placeholder, ariaLabel, className, readOnly, rules, tools, writeMark, align, actions, toolbar, barLabel, renderFooter, inputRef, barShows, richText, defaultShowMarks, colors, cells, letterCase, lastTool, }: CopyBoxProps): react.JSX.Element;
15
+
16
+ /** `'b'` → `Meta+B`, `'shift+x'` → `Meta+Shift+X` — the ARIA spelling of a
17
+ * shortcut.
18
+ * @deprecated The toolbar spells its own shortcuts. Removed in 12.0.0. */
19
+ declare function ariaShortcut(shortcut: string | undefined): string | undefined;
20
+ /** @deprecated Draw `TextToolbar` (`efficient-shell/ui`). Removed in 12.0.0. */
21
+ interface MarkBarProps {
22
+ /** The marks to offer: styles, or a host's descriptors (only `style` is read). */
23
+ tools: readonly MarkStyle[] | readonly MarkupTool[];
24
+ onApply: (style: MarkStyle) => void;
25
+ disabled?: boolean;
26
+ /** One control of the host's, drawn in row 1's last cell. */
27
+ actions?: ReactNode;
28
+ /** Not drawn: the toolbar's alignment is a value. */
29
+ align?: ReactNode;
30
+ /** Not drawn: the drawings are the shell set's. */
31
+ glyphs?: Partial<Record<MarkStyle, ReactNode>>;
32
+ /** The toolbar's accessible name; "Formatting" (`EaselStrings.copy.formatting`) by default. */
33
+ ariaLabel?: string;
34
+ /** The marks the selection already wears. */
35
+ pressed?: Partial<Record<MarkStyle, boolean>>;
36
+ /** The style whose own window is open (`'link'` lights the link button). */
37
+ open?: MarkStyle | null;
38
+ }
39
+ /** @deprecated Draw `TextToolbar` (`efficient-shell/ui`). Removed in 12.0.0. */
40
+ declare function MarkBar({ tools, onApply, disabled, actions, ariaLabel, pressed, open }: MarkBarProps): react.JSX.Element;
12
41
 
13
42
  /** Whether the lines are a list, and which kind. */
14
43
  type TextList = 'none' | 'bullet' | 'number';
15
- /** How the letters are drawn: as typed, all capitals, each word capitalized, all small. */
16
- type TextCase = 'none' | 'upper' | 'capitalize' | 'lower';
44
+ /** How the letters are drawn: as typed, all capitals, each word capitalized,
45
+ * all small. The text styles' own case (../text-styles/model), one list. */
46
+ type TextCase = TextStyleCase;
17
47
  /** A strip row: the box's own answer (`''` = follows the style) and the style's. */
18
48
  interface TextPartStrip<V extends string> {
19
49
  value: V | '';
@@ -321,4 +351,4 @@ interface CaretEdit {
321
351
  */
322
352
  declare function useCaretEdit({ target, onChange }: CaretEdit): (edit: (el: HTMLInputElement | HTMLTextAreaElement | null) => WrapResult) => void;
323
353
 
324
- export { type CaretEdit, CopyAlign, CopyBox, CopyBoxProps, CopyCell, type History, MARKUP_CLIPBOARD_TYPE, type PasteData, type PasteOptions, RichBox, type RichBoxProps, type RichEdit, type RichHandle, type RichInputEvent, type RichInputResult, type RichInsert, type RichLayout, type RichLine, type RichPending, type Snapshot, TYPING_BURST_MS, TextBoxHandle, type TextCase, type TextList, TextPartPanel, type TextPartPanelProps, type TextPartStrip, createHistory, editVisible, markupOfRange, newLine, pasteToMarkup, richInput, richLayout, selectionToSource, selectionToVisible, setBullet, toSource, toSourceStart, toVisible, useCaretEdit };
354
+ export { type CaretEdit, CopyAlign, CopyBox, CopyBoxProps, CopyCell, type History, MARKUP_CLIPBOARD_TYPE, MarkBar, type MarkBarProps, type PasteData, type PasteOptions, RichBox, type RichBoxProps, type RichEdit, type RichHandle, type RichInputEvent, type RichInputResult, type RichInsert, type RichLayout, type RichLine, type RichPending, type Snapshot, TYPING_BURST_MS, TextBoxHandle, type TextCase, type TextList, TextPartPanel, type TextPartPanelProps, type TextPartStrip, ariaShortcut, createHistory, editVisible, markupOfRange, newLine, pasteToMarkup, richInput, richLayout, selectionToSource, selectionToVisible, setBullet, toSource, toSourceStart, toVisible, useCaretEdit };