efficient-easel 19.2.0 → 20.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/README.md +40 -3
  2. package/dist/{ScreenDocumentContext-D55vIrG3.d.ts → ScreenDocumentContext-RxVWWWHq.d.ts} +104 -1
  3. package/dist/blocks/index.d.ts +13 -2
  4. package/dist/canvas/index.d.ts +2 -0
  5. package/dist/canvas/index.js +1 -1
  6. package/dist/{chunk-RTCNJRF6.js → chunk-2A7HLAI5.js} +1 -1
  7. package/dist/chunk-2E2SXDYQ.js +1 -0
  8. package/dist/{chunk-67GNT6PF.js → chunk-3S5N4HLJ.js} +1 -1
  9. package/dist/chunk-A42LPWNM.js +1 -0
  10. package/dist/chunk-BC5KJNHN.js +63 -0
  11. package/dist/{chunk-X3TYRF5V.js → chunk-BSHIQIZC.js} +1 -1
  12. package/dist/{chunk-45NZSAND.js → chunk-BW5COX42.js} +1 -1
  13. package/dist/chunk-CBICQ4J3.js +5 -0
  14. package/dist/chunk-EW6XAMDZ.js +8 -0
  15. package/dist/chunk-FIVU2COQ.js +2 -0
  16. package/dist/chunk-HK6I3NVO.js +1 -0
  17. package/dist/{chunk-YRLPFZW3.js → chunk-IWCKVZHS.js} +1 -1
  18. package/dist/{chunk-KRXQM65X.js → chunk-K7BTCBWD.js} +1 -1
  19. package/dist/{chunk-BQMZ2YAF.js → chunk-KC24D76S.js} +1 -1
  20. package/dist/chunk-L55YIXDC.js +1 -0
  21. package/dist/chunk-LDEEFLE3.js +18 -0
  22. package/dist/chunk-LF3FUSCQ.js +1 -0
  23. package/dist/chunk-NHY5L3SE.js +1 -0
  24. package/dist/chunk-OECWLNKJ.js +2 -0
  25. package/dist/chunk-P5VYGWYO.js +1 -0
  26. package/dist/{chunk-G3GWAP5R.js → chunk-QAJAEWCZ.js} +1 -1
  27. package/dist/chunk-QALW2ECZ.js +1 -0
  28. package/dist/chunk-ROPYFLNZ.js +15 -0
  29. package/dist/{chunk-6U6AISPX.js → chunk-RR4VIAHP.js} +4 -4
  30. package/dist/chunk-SK3P56FS.js +21 -0
  31. package/dist/chunk-VANKQVOW.js +8 -0
  32. package/dist/chunk-XFYFKITX.js +1 -0
  33. package/dist/{chunk-XWFH2NHZ.js → chunk-ZEH6QLBH.js} +2 -2
  34. package/dist/{chunk-WXFZD7WC.js → chunk-ZKY45F5G.js} +1 -1
  35. package/dist/{chunk-2XMHLXMA.js → chunk-ZOBSIXRD.js} +1 -1
  36. package/dist/copy/copy.css +1 -1
  37. package/dist/copy/index.js +14 -14
  38. package/dist/data/index.js +1 -1
  39. package/dist/drag/index.js +1 -1
  40. package/dist/draw/index.d.ts +2 -1
  41. package/dist/draw/index.js +1 -1
  42. package/dist/easel/index.js +1 -1
  43. package/dist/fields/index.js +1 -1
  44. package/dist/gold/gold.css +4 -1
  45. package/dist/menu/index.d.ts +3 -3
  46. package/dist/menu/index.js +1 -1
  47. package/dist/node-ops/index.d.ts +11 -7
  48. package/dist/node-ops/index.js +1 -1
  49. package/dist/panel/index.d.ts +7 -8
  50. package/dist/panel/index.js +9 -9
  51. package/dist/panel/panel.css +21 -12
  52. package/dist/rail/index.d.ts +2 -2
  53. package/dist/rail/index.js +1 -1
  54. package/dist/rail/rail.css +1 -1
  55. package/dist/render/index.d.ts +12 -3
  56. package/dist/render/index.js +5 -5
  57. package/dist/repeat-Czi-6zPX.d.ts +49 -0
  58. package/dist/screen/components/AddBlockRow.js +1 -1
  59. package/dist/screen/components/AddSidePanel.js +1 -1
  60. package/dist/screen/components/NodeContextMenu.d.ts +2 -2
  61. package/dist/screen/components/NodeContextMenu.js +1 -1
  62. package/dist/screen/components/SaveControls.d.ts +2 -2
  63. package/dist/screen/components/ScreenChrome.js +1 -1
  64. package/dist/screen/components/ScreenDocumentContext.d.ts +1 -1
  65. package/dist/screen/components/ScreenMount.d.ts +2 -2
  66. package/dist/screen/components/ScreenMount.js +1 -1
  67. package/dist/screen/components/ScreenStoreProvider.d.ts +2 -2
  68. package/dist/screen/components/ScreenStoreProvider.js +1 -1
  69. package/dist/screen/components/SectionScreenShell.js +17 -17
  70. package/dist/screen/components/usePartBridge.d.ts +2 -2
  71. package/dist/screen/components/usePartBridge.js +1 -1
  72. package/dist/screen/index.d.ts +2 -2
  73. package/dist/screen/index.js +1 -1
  74. package/dist/screen/lib/content/view-tiers.d.ts +81 -1
  75. package/dist/screen/lib/content/view-tiers.js +1 -1
  76. package/dist/screen/lib/document-addressing.d.ts +1 -1
  77. package/dist/screen/lib/document-contract.d.ts +12 -5
  78. package/dist/screen/lib/host.d.ts +1 -1
  79. package/dist/screen/lib/key-scope.js +1 -1
  80. package/dist/screen/lib/media-panel.d.ts +1 -1
  81. package/dist/screen/lib/media-picker.d.ts +1 -1
  82. package/dist/screen/lib/puck/preview-dom.js +1 -1
  83. package/dist/screen/lib/puck/style-clipboard.d.ts +2 -2
  84. package/dist/screen/lib/puck/style-clipboard.js +1 -1
  85. package/dist/screen/lib/puck/use-section-ops.js +1 -1
  86. package/dist/screen/lib/screen-parts.d.ts +2 -2
  87. package/dist/screen/lib/screen-parts.js +1 -1
  88. package/dist/shell/shell.css +4 -2
  89. package/dist/strings/index.js +2 -2
  90. package/dist/style-clipboard/index.d.ts +1 -1
  91. package/dist/text-styles/index.js +36 -36
  92. package/dist/text-styles/model.d.ts +8 -0
  93. package/dist/{types-BsyPh6EW.d.ts → types-BbOBWXMP.d.ts} +3 -0
  94. package/package.json +3 -3
  95. package/dist/chunk-36LVP5WD.js +0 -9
  96. package/dist/chunk-3Z2MVLCD.js +0 -1
  97. package/dist/chunk-4VJATVVR.js +0 -1
  98. package/dist/chunk-BALFHI3G.js +0 -2
  99. package/dist/chunk-DWIOHQG7.js +0 -1
  100. package/dist/chunk-EFQCH7CO.js +0 -1
  101. package/dist/chunk-I2BCNLLV.js +0 -5
  102. package/dist/chunk-LFHMDGLE.js +0 -8
  103. package/dist/chunk-LOXB5OVK.js +0 -63
  104. package/dist/chunk-NKB3KVAB.js +0 -1
  105. package/dist/chunk-OD4WIIER.js +0 -1
  106. package/dist/chunk-OSPUG6S6.js +0 -1
  107. package/dist/chunk-UAS2LEW2.js +0 -1
  108. package/dist/chunk-UZXGXMNO.js +0 -14
  109. package/dist/chunk-Z2V3TTAR.js +0 -18
  110. package/dist/chunk-ZFFWO2AF.js +0 -21
  111. /package/dist/{chunk-X4T6JT3M.js → chunk-QIDRJH3S.js} +0 -0
@@ -1,4 +1,4 @@
1
- import{selectionToVisible as e,selectionToSource as t,richLayout as n,createHistory as r,colorRunOf as l,textRange as o,selectionBox as a,placeWindow as s,offsetOrigin as c,visibleArea as i,ColorWindow as u,markPress as d,pasteToMarkup as p,richInput as h,editVisible as m,MARKUP_CLIPBOARD_TYPE as f,markupOfRange as g}from"../chunk-23VM4PMV.js";export{ColorWindow,MARKUP_CLIPBOARD_TYPE,TYPING_BURST_MS,colorRunOf,createHistory,editVisible,markupOfRange,newLine,pasteToMarkup,richInput,richLayout,selectionToSource,selectionToVisible,setBullet,startCanvasTyping,textMap,toSource,toSourceStart,toVisible}from"../chunk-23VM4PMV.js";import{DEFAULT_COPY_WORDS as y}from"../chunk-KRL3IUV3.js";import{FieldNumber as v}from"../chunk-2XMHLXMA.js";import{FieldSelect as b}from"../chunk-G3GWAP5R.js";import"../chunk-WRFD4EXD.js";import{SettingsSwitch as k,SettingsField as x,SettingsSegmented as S}from"../chunk-36LVP5WD.js";import{useWords as w}from"../chunk-MFIRYGHW.js";import{TEXT_STYLE_CASES as E}from"../chunk-YHZSBL2N.js";import{registerModalEscapeInterceptor as C,textToolbarRows as D,TextToolbar as N,textAlignWords as T,useShellStrings as L,textAlignOptions as O,TEXT_ALIGNS as R,LinkPicker as K,Tooltip as M,IconButton as V}from"efficient-shell/ui";export{TextToolbar}from"efficient-shell/ui";import{useRef as j,useState as B,useLayoutEffect as F,useEffect as H,useId as P}from"react";import{RETIRED_MARKS as W,applyMark as $,marksIn as z,STANDARD_MARKUP as I,listIn as q,colorIn as A,spanFor as U,findLink as Y,tokenizeInline as G,colorOver as _,setList as X,unlinkAt as Z,removeLink as J,linkOver as Q,writeLink as ee}from"efficient-shell/markup";import{jsxs as te,jsx as ne,Fragment as re}from"react/jsx-runtime";import{ParagraphSpacingIcon as le,LetterSpacingIcon as oe,LineSpacingIcon as ae,TextSizeIcon as se,StylesIcon as ce,TypeIcon as ie,AlignmentIcon as ue,ListFormatIcon as de,CaseIcon as pe,ItalicIcon as he,NumberedListIcon as me,ListIcon as fe,ListNoneIcon as ge,CaseLowerIcon as ye,CaseCapitalizedIcon as ve,CaseUpperIcon as be,CaseNormalIcon as ke}from"efficient-shell/icons/efficient";function xe(e,t,n,r,l){for(const o of l){if(o.kind!==n)continue;if(!e.startsWith(o.open,t))continue;const l=t+o.open.length;if(e.startsWith(r,l)&&e.startsWith(o.close,l+r.length))return o}return null}function Se({value:e,rules:t=I,className:n,layerRef:r}){const l=function(e,t){const n=[];let r=0;for(const l of G(e,t)){if("text"===l.kind){l.text.length>0&&(n.push({kind:"text",text:e.slice(r,r+l.text.length)}),r+=l.text.length);continue}const o=xe(e,r,l.kind,l.text,t);if(!o)return[{kind:"text",text:e}];const a=r+o.open.length,s=a+l.text.length,c=s+o.close.length;n.push({kind:"delimiter",text:e.slice(r,a)}),n.push({kind:l.kind,text:e.slice(a,s)}),n.push({kind:"delimiter",text:e.slice(s,c)}),r=c}return n.map(e=>e.text).join("")!==e?[{kind:"text",text:e}]:n}(e,t);/* @__PURE__ */
1
+ import{SettingsSwitch as e}from"../chunk-OECWLNKJ.js";import{TEXT_STYLE_CASES as t}from"../chunk-YHZSBL2N.js";import{selectionToVisible as n,selectionToSource as r,richLayout as l,createHistory as o,colorRunOf as a,textRange as s,selectionBox as c,placeWindow as i,offsetOrigin as u,visibleArea as d,ColorWindow as p,markPress as h,pasteToMarkup as m,richInput as f,editVisible as g,MARKUP_CLIPBOARD_TYPE as y,markupOfRange as v}from"../chunk-23VM4PMV.js";export{ColorWindow,MARKUP_CLIPBOARD_TYPE,TYPING_BURST_MS,colorRunOf,createHistory,editVisible,markupOfRange,newLine,pasteToMarkup,richInput,richLayout,selectionToSource,selectionToVisible,setBullet,startCanvasTyping,textMap,toSource,toSourceStart,toVisible}from"../chunk-23VM4PMV.js";import{DEFAULT_COPY_WORDS as b}from"../chunk-KRL3IUV3.js";import{FieldNumber as k}from"../chunk-ZOBSIXRD.js";import{SettingsField as x,SettingsSegmented as S}from"../chunk-VANKQVOW.js";import{FieldSelect as w}from"../chunk-QAJAEWCZ.js";import"../chunk-WRFD4EXD.js";import{useWords as E}from"../chunk-MFIRYGHW.js";import{registerModalEscapeInterceptor as C,textToolbarRows as D,TextToolbar as N,textAlignWords as T,useShellStrings as O,textAlignOptions as L,TEXT_ALIGNS as R,LinkPicker as K,Tooltip as V,IconButton as j}from"efficient-shell/ui";export{TextToolbar}from"efficient-shell/ui";import{useRef as B,useState as M,useLayoutEffect as F,useEffect as W,useId as H}from"react";import{RETIRED_MARKS as $,applyMark as P,marksIn as z,STANDARD_MARKUP as I,listIn as q,colorIn as A,spanFor as U,findLink as Y,tokenizeInline as Z,colorOver as _,setList as G,unlinkAt as J,removeLink as Q,linkOver as X,writeLink as ee}from"efficient-shell/markup";import{jsxs as te,jsx as ne,Fragment as re}from"react/jsx-runtime";import{ParagraphSpacingIcon as le,LetterSpacingIcon as oe,LineSpacingIcon as ae,TextSizeIcon as se,StylesIcon as ce,TypeIcon as ie,AlignmentIcon as ue,ListFormatIcon as de,CaseIcon as pe,ItalicIcon as he,NumberedListIcon as me,ListIcon as fe,ListNoneIcon as ge,CaseLowerIcon as ye,CaseCapitalizedIcon as ve,CaseUpperIcon as be,CaseNormalIcon as ke}from"efficient-shell/icons/efficient";function xe(e,t,n,r,l){for(const o of l){if(o.kind!==n)continue;if(!e.startsWith(o.open,t))continue;const l=t+o.open.length;if(e.startsWith(r,l)&&e.startsWith(o.close,l+r.length))return o}return null}function Se({value:e,rules:t=I,className:n,layerRef:r}){const l=function(e,t){const n=[];let r=0;for(const l of Z(e,t)){if("text"===l.kind){l.text.length>0&&(n.push({kind:"text",text:e.slice(r,r+l.text.length)}),r+=l.text.length);continue}const o=xe(e,r,l.kind,l.text,t);if(!o)return[{kind:"text",text:e}];const a=r+o.open.length,s=a+l.text.length,c=s+o.close.length;n.push({kind:"delimiter",text:e.slice(r,a)}),n.push({kind:l.kind,text:e.slice(a,s)}),n.push({kind:"delimiter",text:e.slice(s,c)}),r=c}return n.map(e=>e.text).join("")!==e?[{kind:"text",text:e}]:n}(e,t);/* @__PURE__ */
2
2
  return ne("div",{ref:r,className:["es-gold-layer",n??""].filter(Boolean).join(" "),"aria-hidden":"true",children:l.map((e,t)=>function(e,t){const{kind:n,text:r}=e;switch(n){case"delimiter":/* @__PURE__ */
3
3
  return ne("span",{className:"es-gold-delim",children:r},t);case"accent":case"highlight":/* @__PURE__ */
4
4
  return ne("em",{className:"es-gold-mark es-gold-accent",children:r},t);case"bold":/* @__PURE__ */
@@ -6,24 +6,24 @@ return ne("strong",{className:"es-gold-mark es-gold-bold",children:r},t);case"it
6
6
  return ne("em",{className:"es-gold-mark es-gold-italic",children:r},t);case"strike":/* @__PURE__ */
7
7
  return ne("s",{className:"es-gold-mark es-gold-strike",children:r},t);case"quiet":/* @__PURE__ */
8
8
  return ne("span",{className:"es-gold-mark es-gold-quiet",children:r},t);default:/* @__PURE__ */
9
- return ne("span",{className:"es-gold-text",children:r},t)}}(e,t))})}function we({value:e,onInput:t,onCommit:n,onCancel:r,multiline:l=!1,placeholder:o,className:a,rules:s=I,ariaLabel:c,disabled:i=!1,inputRef:u}){const d=j(null),p=j(e),h=j(!1);function m(e){h.current&&(h.current=!1,n?.(e))}/* @__PURE__ */
9
+ return ne("span",{className:"es-gold-text",children:r},t)}}(e,t))})}function we({value:e,onInput:t,onCommit:n,onCancel:r,multiline:l=!1,placeholder:o,className:a,rules:s=I,ariaLabel:c,disabled:i=!1,inputRef:u}){const d=B(null),p=B(e),h=B(!1);function m(e){h.current&&(h.current=!1,n?.(e))}/* @__PURE__ */
10
10
  return te("div",{className:["es-gold",l?"es-gold-is-multiline":"es-gold-is-single",i?"es-gold-is-off":"",a??""].filter(Boolean).join(" "),children:[
11
11
  /* @__PURE__ */ne(Se,{value:e,rules:s,layerRef:d}),o&&""===e?
12
12
  /* @__PURE__ */ne("div",{className:"es-gold-placeholder","aria-hidden":"true",children:o}):null,
13
- /* @__PURE__ */ne("textarea",{ref:u,className:"es-gold-input",disabled:i,value:e,placeholder:o,"aria-label":c,onChange:function(e){h.current=!0,t(e.currentTarget.value)},onFocus:function(){p.current=e,h.current=!1},onBlur:function(){m(e)},onKeyDown:function(t){return"Escape"===t.key?(t.preventDefault(),h.current=!1,void r?.(p.current)):"Enter"!==t.key||l?void 0:(t.preventDefault(),void m(e))},onScroll:function(e){const t=d.current;t&&(t.scrollTop=e.currentTarget.scrollTop,t.scrollLeft=e.currentTarget.scrollLeft)}})]})}function Ee(e,t){const n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}}function Ce(e,t,n,r=$){const{start:l,end:o}=Ee(e,n);return r(e,l,o,t)}function De(e,t,n){const{start:r,end:l}=Ee(e,n),o=r+t.length;return{text:e.slice(0,r)+t+e.slice(l),selectionStart:o,selectionEnd:o}}function Ne(e,t,n,r){switch(t){case"bold":return e.createElement("strong");case"italic":return e.createElement("em");case"strike":return e.createElement("s");case"underline":return e.createElement("u");case"sup":return e.createElement("sup");case"sub":return e.createElement("sub");case"color":{const t=e.createElement("span");return t.className="es-rich-color",r&&(t.dataset.color=r,t.title=r.startsWith("#")?r.toUpperCase():r,t.style.color=r.startsWith("#")?r:`var(--es-color-${r}, inherit)`),t}case"link":{const t=e.createElement("a");return t.className="es-rich-link",n&&(t.title=n),t}default:{const n=e.createElement("span");return n.className="highlight"===t||"accent"===t?"es-rich-emphasis":`es-rich-${t}`,n}}}function Te(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 Le(e,t){const n=e.layout.lines;let r=n.length-1;for(let e=0;e<n.length;e+=1)if(t<=n[e].vis+n[e].text.length){r=e;break}let l=Math.max(0,t-n[r].vis);const o=e.lines[r].ownerDocument.createTreeWalker(e.lines[r],4);let a=o.nextNode(),s=null;for(;a;){if(l<=a.data.length)return[a,l];l-=a.data.length,s=a,a=o.nextNode()}return s?[s,s.data.length]:[e.lines[r],0]}function Oe({value:r,rules:l,multiline:o,readOnly:a=!1,placeholder:s,ariaLabel:c,handle:i,onEdit:u,onSelect:d,onHistory:y,onFormat:v,pending:b,onCommit:k,onCancel:x}){const S=j(null),w=j(null),E=j(null),C=j(null),D=j(null),N=j(r),[T,L]=B(0),O=j({value:r,rules:l,multiline:o,readOnly:a,pending:b,onEdit:u,onHistory:y,onFormat:v});O.current={value:r,rules:l,multiline:o,readOnly:a,pending:b,onEdit:u,onHistory:y,onFormat:v};const R=()=>{const e=S.current,t=w.current,n=e?.ownerDocument.getSelection();if(!(e&&t&&n&&0!==n.rangeCount&&n.anchorNode&&e.contains(n.anchorNode)))return null;const r=Te(t,e,n.anchorNode,n.anchorOffset),l=n.focusNode&&e.contains(n.focusNode)?Te(t,e,n.focusNode,n.focusOffset):r;return r<=l?[r,l]:[l,r]},K=(e,t)=>{const n=S.current,r=w.current;if(!n||!r)return;const[l,o]=Le(r,e),[a,s]=Le(r,t);n.ownerDocument.getSelection()?.setBaseAndExtent(l,o,a,s)};i.current={getSource(){const e=R(),n=w.current;if(!e||!n)return null;const[r,l]=t(n.layout,e[0],e[1]);return{start:r,end:l}},setSource(e,t,n){C.current={text:n,src:[e,t]},L(e=>e+1)},focus(){S.current?.focus()},rangeOf(t,n){const r=S.current,l=w.current;if(!r||!l)return null;const[o,a]=e(l.layout,t,n),[s,c]=Le(l,o),[i,u]=Le(l,a),d=r.ownerDocument.createRange();return d.setStart(s,c),d.setEnd(i,u),d}},F(()=>{const t=S.current;if(!t||D.current)return;const o=C.current?null:R();w.current=function(e,t){const n=e.ownerDocument;e.replaceChildren();const r=t.lines.map(t=>{const r=n.createElement("div");r.className=null!=t.number?"es-rich-line is-numbered":t.bullet?"es-rich-line is-bullet":"es-rich-line",null!=t.number&&(r.dataset.number=t.number);const l=[],o=()=>l.length?l[l.length-1].el:r;let a=null;for(const e of t.chars){let t=0;for(;t<l.length&&t<e.marks.length&&l[t].id===e.marks[t].id;)t+=1;(l.length>t||e.marks.length>t)&&(a=null),l.length=t;for(let r=t;r<e.marks.length;r+=1){const t=Ne(n,e.marks[r].kind,e.marks[r].href,e.marks[r].color);o().appendChild(t),l.push({id:e.marks[r].id,el:t})}a||(a=n.createTextNode(""),o().appendChild(a)),a.data+=e.ch}return 0===t.chars.length&&r.appendChild(n.createElement("br")),e.appendChild(r),r});return{layout:t,lines:r}}(t,n(r,l)),E.current=r;const a=C.current;if(!a||a.text!==r)return void(o&&t.ownerDocument.activeElement===t&&K(o[0],Math.min(o[1],w.current.layout.text.length)));C.current=null;const s=w.current.layout,[c,i]=a.vis??e(s,a.src[0],a.src[1]);t.ownerDocument.activeElement!==t&&t.focus(),K(c,i)},[r,l,T]);const M=(e,n,r)=>{const l=w.current,[o,a]=t(l.layout,n[0],n[1]);C.current={text:e.text,vis:[e.caret,e.caret]},e.text!==O.current.value?O.current.onEdit(e.text,{start:o,end:a},r):L(e=>e+1)};H(()=>{const e=S.current;if(!e)return;const t=t=>{const{value:n,rules:r,multiline:l,readOnly:o,pending:a}=O.current;if("insertCompositionText"===t.inputType)return;if(t.preventDefault(),o)return;const s=w.current,c=R();if(!s||!c)return;const i="function"==typeof t.getTargetRanges?t.getTargetRanges()[0]:void 0,u=i&&!i.collapsed?[Te(s,e,i.startContainer,i.startOffset),Te(s,e,i.endContainer,i.endOffset)]:null,d=h({value:n,rules:r,multiline:l,inputType:t.inputType,data:t.data??t.dataTransfer?.getData("text/plain")??"",html:t.dataTransfer?.getData("text/html"),doc:e.ownerDocument,sel:c,target:u,pending:a});d&&("history"!==d.kind?"format"!==d.kind?M(d.edit,d.range,d.kind):O.current.onFormat(d.style):O.current.onHistory(d.dir))},n=()=>{D.current||L(e=>e+1)};return e.addEventListener("beforeinput",t),e.addEventListener("input",n),()=>{e.removeEventListener("beforeinput",t),e.removeEventListener("input",n)}},[]),H(()=>{const e=S.current;if(!e)return;const t=e.ownerDocument,n=()=>{const e=i.current?.getSource();e&&d(e)};return t.addEventListener("selectionchange",n),()=>t.removeEventListener("selectionchange",n)});const V=(e,t=!1)=>{const n=R();if(!n||n[0]===n[1])return;e.preventDefault();const o=w.current;e.clipboardData.setData("text/plain",o.layout.text.slice(n[0],n[1])),e.clipboardData.setData(f,g(r,l,n[0],n[1])),t&&!a&&M(m(r,l,n[0],n[1],{text:""}),n,"edit")};/* @__PURE__ */
14
- return te("div",{className:"es-rich-wrap",children:[s&&""===r?/* @__PURE__ */ne("div",{className:"es-rich-placeholder","aria-hidden":"true",children:s}):null,
15
- /* @__PURE__ */ne("div",{ref:S,className:`es-rich${o?" is-multiline":" is-single"}${a?" is-off":""}`,contentEditable:!a,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":o,"aria-label":c,"aria-readonly":a||void 0,"aria-placeholder":s,tabIndex:a?-1:0,spellCheck:!0,onFocus:()=>{N.current=r},onBlur:()=>{r!==N.current&&k?.(r),N.current=r},onKeyDown:e=>{if("Escape"===e.key)return e.preventDefault(),x?.(N.current),void(N.current=r);"Enter"!==e.key||o||(e.preventDefault(),r!==N.current&&k?.(r),N.current=r)},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}=O.current;e.data?M(m(n,r,t.from,t.to,{text:e.data,add:l?.add,drop:l?.drop,color:l?.color}),[t.from,t.to],"type"):L(e=>e+1)},onCopy:e=>V(e),onCut:e=>V(e,!0),onPaste:e=>{if(e.preventDefault(),a)return;const t=R();if(!t)return;const n=e.clipboardData.getData(f),s=n?o?n:n.replace(/\s*\r?\n\s*/g," "):p({html:e.clipboardData.getData("text/html"),text:e.clipboardData.getData("text/plain")},{doc:e.currentTarget.ownerDocument,multiline:o,rules:l});M(m(r,l,t[0],t[1],{markup:s}),t,"edit")}})]})}var Re={fontSize:{key:"fontSize",nameKey:"fontSize",icon:/* @__PURE__ */ne(se,{}),unit:"px",step:1,shiftStep:10,min:5},lineHeight:{key:"lineHeight",nameKey:"lineHeight",icon:/* @__PURE__ */ne(ae,{}),unit:"%",step:1,shiftStep:10,min:50,max:250,scale:100},letterSpacing:{key:"letterSpacing",nameKey:"letterSpacing",icon:/* @__PURE__ */ne(oe,{}),unit:"px",step:.1,shiftStep:1,min:-10},paragraphSpacing:{key:"paragraphSpacing",nameKey:"paragraphSpacing",icon:/* @__PURE__ */ne(le,{}),unit:"px",step:1,shiftStep:10,min:0}};function Ke(e,t){return void 0===e?void 0:Number((e*t).toFixed(6))}function Me({cells:e,words:t,readOnly:n=!1}){const r=t??y.cells,l=P();/* @__PURE__ */
13
+ /* @__PURE__ */ne("textarea",{ref:u,className:"es-gold-input",disabled:i,value:e,placeholder:o,"aria-label":c,onChange:function(e){h.current=!0,t(e.currentTarget.value)},onFocus:function(){p.current=e,h.current=!1},onBlur:function(){m(e)},onKeyDown:function(t){return"Escape"===t.key?(t.preventDefault(),h.current=!1,void r?.(p.current)):"Enter"!==t.key||l?void 0:(t.preventDefault(),void m(e))},onScroll:function(e){const t=d.current;t&&(t.scrollTop=e.currentTarget.scrollTop,t.scrollLeft=e.currentTarget.scrollLeft)}})]})}function Ee(e,t){const n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}}function Ce(e,t,n,r=P){const{start:l,end:o}=Ee(e,n);return r(e,l,o,t)}function De(e,t,n){const{start:r,end:l}=Ee(e,n),o=r+t.length;return{text:e.slice(0,r)+t+e.slice(l),selectionStart:o,selectionEnd:o}}function Ne(e,t,n,r){switch(t){case"bold":return e.createElement("strong");case"italic":return e.createElement("em");case"strike":return e.createElement("s");case"underline":return e.createElement("u");case"sup":return e.createElement("sup");case"sub":return e.createElement("sub");case"color":{const t=e.createElement("span");return t.className="es-rich-color",r&&(t.dataset.color=r,t.title=r.startsWith("#")?r.toUpperCase():r,t.style.color=r.startsWith("#")?r:`var(--es-color-${r}, inherit)`),t}case"link":{const t=e.createElement("a");return t.className="es-rich-link",n&&(t.title=n),t}default:{const n=e.createElement("span");return n.className="highlight"===t||"accent"===t?"es-rich-emphasis":`es-rich-${t}`,n}}}function Te(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 Oe(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 Le({value:e,rules:t,multiline:o,readOnly:a=!1,placeholder:s,ariaLabel:c,handle:i,onEdit:u,onSelect:d,onHistory:p,onFormat:h,pending:b,onCommit:k,onCancel:x}){const S=B(null),w=B(null),E=B(null),C=B(null),D=B(null),N=B(e),[T,O]=M(0),L=B({value:e,rules:t,multiline:o,readOnly:a,pending:b,onEdit:u,onHistory:p,onFormat:h});L.current={value:e,rules:t,multiline:o,readOnly:a,pending:b,onEdit:u,onHistory:p,onFormat:h};const R=()=>{const e=S.current,t=w.current,n=e?.ownerDocument.getSelection();if(!(e&&t&&n&&0!==n.rangeCount&&n.anchorNode&&e.contains(n.anchorNode)))return null;const r=Te(t,e,n.anchorNode,n.anchorOffset),l=n.focusNode&&e.contains(n.focusNode)?Te(t,e,n.focusNode,n.focusOffset):r;return r<=l?[r,l]:[l,r]},K=(e,t)=>{const n=S.current,r=w.current;if(!n||!r)return;const[l,o]=Oe(r,e),[a,s]=Oe(r,t);n.ownerDocument.getSelection()?.setBaseAndExtent(l,o,a,s)};i.current={getSource(){const e=R(),t=w.current;if(!e||!t)return null;const[n,l]=r(t.layout,e[0],e[1]);return{start:n,end:l}},setSource(e,t,n){C.current={text:n,src:[e,t]},O(e=>e+1)},focus(){S.current?.focus()},rangeOf(e,t){const r=S.current,l=w.current;if(!r||!l)return null;const[o,a]=n(l.layout,e,t),[s,c]=Oe(l,o),[i,u]=Oe(l,a),d=r.ownerDocument.createRange();return d.setStart(s,c),d.setEnd(i,u),d}},F(()=>{const r=S.current;if(!r||D.current)return;const o=C.current?null:R();w.current=function(e,t){const n=e.ownerDocument;e.replaceChildren();const r=t.lines.map(t=>{const r=n.createElement("div");r.className=null!=t.number?"es-rich-line is-numbered":t.bullet?"es-rich-line is-bullet":"es-rich-line",null!=t.number&&(r.dataset.number=t.number);const l=[],o=()=>l.length?l[l.length-1].el:r;let a=null;for(const e of t.chars){let t=0;for(;t<l.length&&t<e.marks.length&&l[t].id===e.marks[t].id;)t+=1;(l.length>t||e.marks.length>t)&&(a=null),l.length=t;for(let r=t;r<e.marks.length;r+=1){const t=Ne(n,e.marks[r].kind,e.marks[r].href,e.marks[r].color);o().appendChild(t),l.push({id:e.marks[r].id,el:t})}a||(a=n.createTextNode(""),o().appendChild(a)),a.data+=e.ch}return 0===t.chars.length&&r.appendChild(n.createElement("br")),e.appendChild(r),r});return{layout:t,lines:r}}(r,l(e,t)),E.current=e;const a=C.current;if(!a||a.text!==e)return void(o&&r.ownerDocument.activeElement===r&&K(o[0],Math.min(o[1],w.current.layout.text.length)));C.current=null;const s=w.current.layout,[c,i]=a.vis??n(s,a.src[0],a.src[1]);r.ownerDocument.activeElement!==r&&r.focus(),K(c,i)},[e,t,T]);const V=(e,t,n)=>{const l=w.current,[o,a]=r(l.layout,t[0],t[1]);C.current={text:e.text,vis:[e.caret,e.caret]},e.text!==L.current.value?L.current.onEdit(e.text,{start:o,end:a},n):O(e=>e+1)};W(()=>{const e=S.current;if(!e)return;const t=t=>{const{value:n,rules:r,multiline:l,readOnly:o,pending:a}=L.current;if("insertCompositionText"===t.inputType)return;if(t.preventDefault(),o)return;const s=w.current,c=R();if(!s||!c)return;const i="function"==typeof t.getTargetRanges?t.getTargetRanges()[0]:void 0,u=i&&!i.collapsed?[Te(s,e,i.startContainer,i.startOffset),Te(s,e,i.endContainer,i.endOffset)]:null,d=f({value:n,rules:r,multiline:l,inputType:t.inputType,data:t.data??t.dataTransfer?.getData("text/plain")??"",html:t.dataTransfer?.getData("text/html"),doc:e.ownerDocument,sel:c,target:u,pending:a});d&&("history"!==d.kind?"format"!==d.kind?V(d.edit,d.range,d.kind):L.current.onFormat(d.style):L.current.onHistory(d.dir))},n=()=>{D.current||O(e=>e+1)};return e.addEventListener("beforeinput",t),e.addEventListener("input",n),()=>{e.removeEventListener("beforeinput",t),e.removeEventListener("input",n)}},[]),W(()=>{const e=S.current;if(!e)return;const t=e.ownerDocument,n=()=>{const e=i.current?.getSource();e&&d(e)};return t.addEventListener("selectionchange",n),()=>t.removeEventListener("selectionchange",n)});const j=(n,r=!1)=>{const l=R();if(!l||l[0]===l[1])return;n.preventDefault();const o=w.current;n.clipboardData.setData("text/plain",o.layout.text.slice(l[0],l[1])),n.clipboardData.setData(y,v(e,t,l[0],l[1])),r&&!a&&V(g(e,t,l[0],l[1],{text:""}),l,"edit")};/* @__PURE__ */
14
+ return te("div",{className:"es-rich-wrap",children:[s&&""===e?/* @__PURE__ */ne("div",{className:"es-rich-placeholder","aria-hidden":"true",children:s}):null,
15
+ /* @__PURE__ */ne("div",{ref:S,className:`es-rich${o?" is-multiline":" is-single"}${a?" is-off":""}`,contentEditable:!a,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":o,"aria-label":c,"aria-readonly":a||void 0,"aria-placeholder":s,tabIndex:a?-1:0,spellCheck:!0,onFocus:()=>{N.current=e},onBlur:()=>{e!==N.current&&k?.(e),N.current=e},onKeyDown:t=>{if("Escape"===t.key)return t.preventDefault(),x?.(N.current),void(N.current=e);"Enter"!==t.key||o||(t.preventDefault(),e!==N.current&&k?.(e),N.current=e)},onCompositionStart:()=>{const e=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}=L.current;e.data?V(g(n,r,t.from,t.to,{text:e.data,add:l?.add,drop:l?.drop,color:l?.color}),[t.from,t.to],"type"):O(e=>e+1)},onCopy:e=>j(e),onCut:e=>j(e,!0),onPaste:n=>{if(n.preventDefault(),a)return;const r=R();if(!r)return;const l=n.clipboardData.getData(y),s=l?o?l:l.replace(/\s*\r?\n\s*/g," "):m({html:n.clipboardData.getData("text/html"),text:n.clipboardData.getData("text/plain")},{doc:n.currentTarget.ownerDocument,multiline:o,rules:t});V(g(e,t,r[0],r[1],{markup:s}),r,"edit")}})]})}var Re={fontSize:{key:"fontSize",nameKey:"fontSize",icon:/* @__PURE__ */ne(se,{}),unit:"px",step:1,shiftStep:10,min:5},lineHeight:{key:"lineHeight",nameKey:"lineHeight",icon:/* @__PURE__ */ne(ae,{}),unit:"%",step:1,shiftStep:10,min:50,max:250,scale:100},letterSpacing:{key:"letterSpacing",nameKey:"letterSpacing",icon:/* @__PURE__ */ne(oe,{}),unit:"px",step:.1,shiftStep:1,min:-10},paragraphSpacing:{key:"paragraphSpacing",nameKey:"paragraphSpacing",icon:/* @__PURE__ */ne(le,{}),unit:"px",step:1,shiftStep:10,min:0}};function Ke(e,t){return void 0===e?void 0:Number((e*t).toFixed(6))}function Ve({cells:e,words:t,readOnly:n=!1}){const r=t??b.cells,l=H();/* @__PURE__ */
16
16
  return ne("div",{className:"es-copy-cells-fit",children:/* @__PURE__ */ne("div",{className:"es-copy-cells",children:e.map(e=>{const t=e.scale??1,o=e.name??(e.nameKey?r[e.nameKey]:e.key),a=e.unit??"",s=e.step??1,c=`${l}-${e.key}`;/* @__PURE__ */
17
17
  return te("div",{className:"es-copy-cell",children:[
18
18
  /* @__PURE__ */ne("label",{className:"es-field-label es-copy-cell-name",htmlFor:c,children:o}),
19
- /* @__PURE__ */ne(v,{id:c,value:Ke(e.value,t),styleValue:Ke(e.styleValue,t),onChange:n=>e.onChange(void 0===n?void 0:Number((n/t).toFixed(6))),min:e.min,max:e.max,step:s,shiftStep:e.shiftStep,icon:e.icon,unit:a||void 0,steppers:"compact",readOnly:n,ariaLabel:o,title:r.tip({name:o,step:s,unit:a})})]},e.key)})})})}function Ve({target:e,onChange:t}){const n=j(null);return F(()=>{const t=n.current,r=e.current;t&&r&&r.value===t.text&&(n.current=null,r.focus(),r.setSelectionRange(t.start,t.end))}),r=>{const l=r(e.current);t(l.text),n.current={start:l.selectionStart,end:l.selectionEnd,text:l.text}}}var je=/* @__PURE__ */new Set([...W,"clear"]);function Be({value:e,onChange:t,onCommit:n,onCancel:h,multiline:m=!1,placeholder:f,ariaLabel:g,className:v,readOnly:b=!1,rules:x,tools:S=[],writeMark:E,align:T,actions:L,toolbar:O,barLabel:R,renderFooter:M,inputRef:V,barShows:W="always",richText:G=!0,defaultShowMarks:le=!1,colors:oe,cells:ae,letterCase:se,lastTool:ce}){const ie=w("copy",y),ue=j(null),de=V??ue,[pe,he]=B(!1),[me,fe]=B(null),ge=j(r()).current,ye=j(null);H(()=>{const t=ye.current;t&&e===t.to?ye.current=null:t&&e===t.from||(ye.current=null,ge.reset())},[e,ge]);const ve=n=>{ye.current={from:ye.current?.from??e,to:n},t(n)},be=t=>({text:e,start:t?.selectionStart??me?.start??e.length,end:t?.selectionEnd??me?.end??e.length}),[ke,xe]=B(le),Se=G&&!(m&&ke),Ee=j(null),Ne=P(),[Te,Le]=B(null),[Re,Ke]=B(!1),Be=()=>{if(!Se)return de.current;const e=Ee.current?.getSource()??me;return e?{selectionStart:e.start,selectionEnd:e.end}:null},Fe=Ve({target:de,onChange:ve}),He=e=>(fe({start:e.selectionStart,end:e.selectionEnd}),e),Pe=(t,n)=>{if(!Se)return void Fe(e=>(n&&ge.record(be(e),"edit",Date.now()),He(t(e))));const r=Be(),l=He(t(r));n&&ge.record(be(r),"edit",Date.now()),Le(null),l.text!==e&&ve(l.text),Ee.current?.setSource(l.selectionStart,l.selectionEnd,l.text)},We=e=>Pe(e,!0),$e=e=>Pe(t=>{const n=be(t),r=ge[e](n);return r?{text:r.text,selectionStart:r.start,selectionEnd:r.end}:{text:n.text,selectionStart:n.start,selectionEnd:n.end}},!1),ze=j(null);F(()=>{const t=ze.current;t&&(ze.current=null,Se?Ee.current?.setSource(t.start,t.end,e):(de.current?.focus(),de.current?.setSelectionRange(t.start,t.end),fe(t)))},[Se]);const[Ie,qe]=B(null),Ae=x??I,Ue=("string"==typeof S[0]?S:S.map(e=>e.style)).filter(e=>!je.has(e)),Ye={};if(me){const t=z(e,me.start,me.end,Ae);for(const e of Ue){const n=t.has(e)||"highlight"===e&&t.has("accent");Ye[e]=!!Te?.add.includes(e)||!Te?.drop.includes(e)&&n}Ye.link=t.has("link")}const Ge=()=>{const t=Be(),n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}},_e=t=>{if("link"!==t&&U(0,t)){const{start:n,end:r}=Ge();if(n===r&&!Se)return void We(n=>Ce(e,t,n,(e,t,n,r)=>$(e,t,n,r,Ae,ie.placeholders)));const l=d({value:e,rules:Ae,start:n,end:r,style:t,pending:Te});return void("pending"===l.kind?Le(l.pending):We(()=>l.result))}if("link"!==t){const n=E??((e,t,n,r)=>$(e,t,n,r,I,ie.placeholders));return void We(r=>Ce(e,t,r,n))}const n=Be(),r=n?.selectionStart??e.length,l=n?.selectionEnd??r;Ke(!1),qe({start:r,end:l,link:Y(e,r,l)})},Xe=Boolean(me&&me.start!==me.end),Ze=me?q(e,me.start,me.end,Ae):null,Je=me?Te&&void 0!==Te.color&&Te.at===me.start?Te.color:A(e,me.start,me.end,Ae):null,Qe=l(Je,oe),et=t=>{Se?t?Ee.current?.setSource(t.start,t.end,e):Ee.current?.focus():(de.current?.focus(),t&&de.current?.setSelectionRange(t.start,t.end))},tt=()=>{const e=Ie;qe(null),et(e?{start:e.start,end:e.end}:me)},nt=()=>{const e=lt.current,t=Boolean(e&&e.querySelector(".es-copy-colors")?.contains(e.ownerDocument.activeElement));Ke(!1),t&&et(me)},rt=j(nt);rt.current=nt,H(()=>{if(Re)return C(e=>{const t=lt.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&(rt.current(),!0)},()=>lt.current?.querySelector(".es-copy-colors"))},[Re]);const lt=j(null),ot=Re||null!==Ie;H(()=>{const e=lt.current;if(!ot||!e)return;const t=e.ownerDocument,n=()=>{Ke(!1),qe(null)},r=t=>{e.contains(t.target)||n()};let l;const o=r=>{const o=r.relatedTarget;o?e.contains(o)||n():(clearTimeout(l),l=setTimeout(()=>{const r=t.activeElement;t.hasFocus()&&r&&r!==t.body&&!e.contains(r)&&n()},0))};return t.addEventListener("pointerdown",r,!0),e.addEventListener("focusout",o),()=>{clearTimeout(l),t.removeEventListener("pointerdown",r,!0),e.removeEventListener("focusout",o)}},[ot]);const at=Ie??(Re?me??{start:e.length,end:e.length}:null),st=j(()=>{});st.current=()=>{const e=lt.current,t=e?.querySelector(".rosh-tb-wrap > .es-copy-pop");if(!e||!t||!at)return;const n=Se?null:e.querySelector(".es-gold-layer"),r=Se?Ee.current?.rangeOf(at.start,at.end)??null:n?o(n,at.start,at.end):null,l=r?.endContainer,u=l?1===l.nodeType?l:l.parentElement:null,d=r?a(r,u?.closest(".es-rich-line, .es-gold-layer")??null):null;if(!d)return;const p=s({anchor:d,size:{width:t.offsetWidth,height:t.offsetHeight},within:e.getBoundingClientRect(),clip:i(e),parent:c(t)});t.style.top=`${p.top}px`,t.style.left=`${p.left}px`,t.style.setProperty("--es-pop-point",`${p.point}px`),t.dataset.side=p.above?"above":"below"},F(()=>{const e=lt.current;if(!ot||!e)return;const t=()=>st.current();t();const n=e.ownerDocument.defaultView;n?.addEventListener("resize",t);const r=e.querySelector(".rosh-tb-wrap > .es-copy-pop"),l=n?.ResizeObserver,o=l&&r?new l(t):null;return o&&r&&o.observe(r),()=>{n?.removeEventListener("resize",t),o?.disconnect()}},[ot,Re,Ie,at?.start,at?.end,Se]);const ct="always"===W||pe||null!==Ie||Re,it=oe&&oe.length>0?{run:Qe,open:Re,onToggle:()=>{qe(null),Re?nt():Ke(!0)}}:void 0,ut=ct?ce?ce({className:"rosh-tb-btn",disabled:b,selected:Xe,keepCaret:e=>e.preventDefault(),insert:t=>We(n=>De(e,t,n))}):"classic"===O?L:void 0:void 0,dt=new Set(Ue),pt=T?{value:T.value,allow:T.allow,onChange:T.onChange,disabled:T.disabled}:void 0,ht={pressed:Ze,onList:t=>{const{start:n,end:r}=Ge(),l=q(e,n,r,Ae);We(()=>X(e,n,r,l===t?null:t,Ae))}},mt=D({offered:dt,color:it,last:ut,alignment:pt,list:ht,letterCase:se});/* @__PURE__ */
20
- return te("div",{ref:lt,className:"es-copy"+(v?` ${v}`:""),onFocus:()=>he(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||he(!1)},onKeyDown:e=>{const t=e.target===de.current||Boolean(e.target.closest?.(".es-rich"));if(b||!t)return;if(e.altKey||e.metaKey===e.ctrlKey)return;const n=e.key.toLowerCase(),r="KeyZ"===e.code||"z"===n,l=("KeyY"===e.code||"y"===n)&&!e.shiftKey;if(r||l)return e.preventDefault(),e.stopPropagation(),void $e(l||e.shiftKey?"redo":"undo");const o={b:"bold",i:"italic",u:"underline",k:"link"}[`${e.shiftKey?"shift+":""}${n}`];o&&Ue.includes(o)&&(e.preventDefault(),e.stopPropagation(),_e(o))},onPaste:t=>{const n=de.current;if(b||!n||t.target!==n)return;t.preventDefault();const r=p({html:t.clipboardData.getData("text/html"),text:t.clipboardData.getData("text/plain")},{doc:n.ownerDocument,multiline:m,rules:Ae});We(t=>De(e,r,t))},style:oe&&oe.length>0?Object.fromEntries(oe.map(e=>[`--es-color-${e.name}`,e.value])):void 0,onSelect:()=>{const t=de.current;t&&t.ownerDocument.activeElement===t&&fe({start:t.selectionStart??e.length,end:t.selectionEnd??e.length})},children:[ct&&(mt.words||mt.paragraph)?
21
- /* @__PURE__ */ne(N,{className:"es-copy-toolbar","aria-label":R??ie.formatting,offered:dt,pressed:Ye,onMark:e=>_e(e),color:it,linkOpen:null!==Ie,last:ut,alignment:pt,list:ht,letterCase:se,disabled:b,windows:/* @__PURE__ */te(re,{children:[Re&&oe&&oe.length>0?/* @__PURE__ */ne(u,{colors:oe,current:Je,words:ie.colors??y.colors,onPick:t=>{const{start:n,end:r}=Ge();if(n!==r)We(()=>_(e,n,r,t,Ae));else{if(!Se)return;Le({add:Te?.add??[],drop:Te?.drop??[],color:t,at:n})}}}):null,Ie?Ie&&/* @__PURE__ */ne(K,{className:"es-copy-link es-copy-pop",value:Ie.link?.href??"",onApply:t=>{const n=Ie;qe(null),We(()=>Se?Q(e,n.start,n.end,t,Ae):ee(e,n.start,n.end,t))},onRemove:Ie.link?()=>{const t=Ie.link,n=Ie;qe(null),t&&We(()=>Se?Z(e,n.start,n.end,Ae):J(e,t))}:void 0,onCancel:tt}):null]})}):null,ae&&ae.length>0?/* @__PURE__ */ne(Me,{cells:ae,words:ie.cells??y.cells,readOnly:b}):null,Se?/* @__PURE__ */ne(Oe,{value:e,rules:Ae,multiline:m,readOnly:b,placeholder:f,ariaLabel:g,handle:Ee,pending:Te??void 0,onEdit:(t,n,r)=>{ge.record({text:e,start:n.start,end:n.end},r,Date.now()),Le(null),ve(t)},onSelect:e=>{fe(t=>t&&t.start===e.start&&t.end===e.end?t:e),!Te||e.start===Te.at&&e.end===Te.at||Le(null)},onHistory:$e,onFormat:e=>{Ue.includes(e)&&_e(e)},onCommit:n,onCancel:h}):/* @__PURE__ */ne(we,{value:e,onInput:e=>{ge.record(be(null),"type",Date.now()),ve(e)},onCommit:n,onCancel:h,multiline:m,placeholder:f,ariaLabel:g,rules:x,disabled:b,inputRef:de,className:"es-copy-box"}),M?M({focused:pe,insert:t=>We(n=>De(e,t,n))}):null,G&&m?
19
+ /* @__PURE__ */ne(k,{id:c,value:Ke(e.value,t),styleValue:Ke(e.styleValue,t),onChange:n=>e.onChange(void 0===n?void 0:Number((n/t).toFixed(6))),min:e.min,max:e.max,step:s,shiftStep:e.shiftStep,icon:e.icon,unit:a||void 0,steppers:"compact",readOnly:n,ariaLabel:o,title:r.tip({name:o,step:s,unit:a})})]},e.key)})})})}function je({target:e,onChange:t}){const n=B(null);return F(()=>{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 Be=/* @__PURE__ */new Set([...$,"clear"]);function Me({value:t,onChange:n,onCommit:r,onCancel:l,multiline:f=!1,placeholder:g,ariaLabel:y,className:v,readOnly:k=!1,rules:x,tools:S=[],writeMark:w,align:T,actions:O,toolbar:L,barLabel:R,renderFooter:V,inputRef:j,barShows:$="always",richText:Z=!0,defaultShowMarks:le=!1,colors:oe,cells:ae,letterCase:se,lastTool:ce}){const ie=E("copy",b),ue=B(null),de=j??ue,[pe,he]=M(!1),[me,fe]=M(null),ge=B(o()).current,ye=B(null);W(()=>{const e=ye.current;e&&t===e.to?ye.current=null:e&&t===e.from||(ye.current=null,ge.reset())},[t,ge]);const ve=e=>{ye.current={from:ye.current?.from??t,to:e},n(e)},be=e=>({text:t,start:e?.selectionStart??me?.start??t.length,end:e?.selectionEnd??me?.end??t.length}),[ke,xe]=M(le),Se=Z&&!(f&&ke),Ee=B(null),Ne=H(),[Te,Oe]=M(null),[Re,Ke]=M(!1),Me=()=>{if(!Se)return de.current;const e=Ee.current?.getSource()??me;return e?{selectionStart:e.start,selectionEnd:e.end}:null},Fe=je({target:de,onChange:ve}),We=e=>(fe({start:e.selectionStart,end:e.selectionEnd}),e),He=(e,n)=>{if(!Se)return void Fe(t=>(n&&ge.record(be(t),"edit",Date.now()),We(e(t))));const r=Me(),l=We(e(r));n&&ge.record(be(r),"edit",Date.now()),Oe(null),l.text!==t&&ve(l.text),Ee.current?.setSource(l.selectionStart,l.selectionEnd,l.text)},$e=e=>He(e,!0),Pe=e=>He(t=>{const n=be(t),r=ge[e](n);return r?{text:r.text,selectionStart:r.start,selectionEnd:r.end}:{text:n.text,selectionStart:n.start,selectionEnd:n.end}},!1),ze=B(null);F(()=>{const e=ze.current;e&&(ze.current=null,Se?Ee.current?.setSource(e.start,e.end,t):(de.current?.focus(),de.current?.setSelectionRange(e.start,e.end),fe(e)))},[Se]);const[Ie,qe]=M(null),Ae=x??I,Ue=("string"==typeof S[0]?S:S.map(e=>e.style)).filter(e=>!Be.has(e)),Ye={};if(me){const e=z(t,me.start,me.end,Ae);for(const t of Ue){const n=e.has(t)||"highlight"===t&&e.has("accent");Ye[t]=!!Te?.add.includes(t)||!Te?.drop.includes(t)&&n}Ye.link=e.has("link")}const Ze=()=>{const e=Me(),n=e?.selectionStart??t.length;return{start:n,end:e?.selectionEnd??n}},_e=e=>{if("link"!==e&&U(0,e)){const{start:n,end:r}=Ze();if(n===r&&!Se)return void $e(n=>Ce(t,e,n,(e,t,n,r)=>P(e,t,n,r,Ae,ie.placeholders)));const l=h({value:t,rules:Ae,start:n,end:r,style:e,pending:Te});return void("pending"===l.kind?Oe(l.pending):$e(()=>l.result))}if("link"!==e){const n=w??((e,t,n,r)=>P(e,t,n,r,I,ie.placeholders));return void $e(r=>Ce(t,e,r,n))}const n=Me(),r=n?.selectionStart??t.length,l=n?.selectionEnd??r;Ke(!1),qe({start:r,end:l,link:Y(t,r,l)})},Ge=Boolean(me&&me.start!==me.end),Je=me?q(t,me.start,me.end,Ae):null,Qe=me?Te&&void 0!==Te.color&&Te.at===me.start?Te.color:A(t,me.start,me.end,Ae):null,Xe=a(Qe,oe),et=e=>{Se?e?Ee.current?.setSource(e.start,e.end,t):Ee.current?.focus():(de.current?.focus(),e&&de.current?.setSelectionRange(e.start,e.end))},tt=()=>{const e=Ie;qe(null),et(e?{start:e.start,end:e.end}:me)},nt=()=>{const e=lt.current,t=Boolean(e&&e.querySelector(".es-copy-colors")?.contains(e.ownerDocument.activeElement));Ke(!1),t&&et(me)},rt=B(nt);rt.current=nt,W(()=>{if(Re)return C(e=>{const t=lt.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&(rt.current(),!0)},()=>lt.current?.querySelector(".es-copy-colors"))},[Re]);const lt=B(null),ot=Re||null!==Ie;W(()=>{const e=lt.current;if(!ot||!e)return;const t=e.ownerDocument,n=()=>{Ke(!1),qe(null)},r=t=>{e.contains(t.target)||n()};let l;const o=r=>{const o=r.relatedTarget;o?e.contains(o)||n():(clearTimeout(l),l=setTimeout(()=>{const r=t.activeElement;t.hasFocus()&&r&&r!==t.body&&!e.contains(r)&&n()},0))};return t.addEventListener("pointerdown",r,!0),e.addEventListener("focusout",o),()=>{clearTimeout(l),t.removeEventListener("pointerdown",r,!0),e.removeEventListener("focusout",o)}},[ot]);const at=Ie??(Re?me??{start:t.length,end:t.length}:null),st=B(()=>{});st.current=()=>{const e=lt.current,t=e?.querySelector(".rosh-tb-wrap > .es-copy-pop");if(!e||!t||!at)return;const n=Se?null:e.querySelector(".es-gold-layer"),r=Se?Ee.current?.rangeOf(at.start,at.end)??null:n?s(n,at.start,at.end):null,l=r?.endContainer,o=l?1===l.nodeType?l:l.parentElement:null,a=r?c(r,o?.closest(".es-rich-line, .es-gold-layer")??null):null;if(!a)return;const p=i({anchor:a,size:{width:t.offsetWidth,height:t.offsetHeight},within:e.getBoundingClientRect(),clip:d(e),parent:u(t)});t.style.top=`${p.top}px`,t.style.left=`${p.left}px`,t.style.setProperty("--es-pop-point",`${p.point}px`),t.dataset.side=p.above?"above":"below"},F(()=>{const e=lt.current;if(!ot||!e)return;const t=()=>st.current();t();const n=e.ownerDocument.defaultView;n?.addEventListener("resize",t);const r=e.querySelector(".rosh-tb-wrap > .es-copy-pop"),l=n?.ResizeObserver,o=l&&r?new l(t):null;return o&&r&&o.observe(r),()=>{n?.removeEventListener("resize",t),o?.disconnect()}},[ot,Re,Ie,at?.start,at?.end,Se]);const ct="always"===$||pe||null!==Ie||Re,it=oe&&oe.length>0?{run:Xe,open:Re,onToggle:()=>{qe(null),Re?nt():Ke(!0)}}:void 0,ut=ct?ce?ce({className:"rosh-tb-btn",disabled:k,selected:Ge,keepCaret:e=>e.preventDefault(),insert:e=>$e(n=>De(t,e,n))}):"classic"===L?O:void 0:void 0,dt=new Set(Ue),pt=T?{value:T.value,allow:T.allow,onChange:T.onChange,disabled:T.disabled}:void 0,ht={pressed:Je,onList:e=>{const{start:n,end:r}=Ze(),l=q(t,n,r,Ae);$e(()=>G(t,n,r,l===e?null:e,Ae))}},mt=D({offered:dt,color:it,last:ut,alignment:pt,list:ht,letterCase:se});/* @__PURE__ */
20
+ return te("div",{ref:lt,className:"es-copy"+(v?` ${v}`:""),onFocus:()=>he(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||he(!1)},onKeyDown:e=>{const t=e.target===de.current||Boolean(e.target.closest?.(".es-rich"));if(k||!t)return;if(e.altKey||e.metaKey===e.ctrlKey)return;const n=e.key.toLowerCase(),r="KeyZ"===e.code||"z"===n,l=("KeyY"===e.code||"y"===n)&&!e.shiftKey;if(r||l)return e.preventDefault(),e.stopPropagation(),void Pe(l||e.shiftKey?"redo":"undo");const o={b:"bold",i:"italic",u:"underline",k:"link"}[`${e.shiftKey?"shift+":""}${n}`];o&&Ue.includes(o)&&(e.preventDefault(),e.stopPropagation(),_e(o))},onPaste:e=>{const n=de.current;if(k||!n||e.target!==n)return;e.preventDefault();const r=m({html:e.clipboardData.getData("text/html"),text:e.clipboardData.getData("text/plain")},{doc:n.ownerDocument,multiline:f,rules:Ae});$e(e=>De(t,r,e))},style:oe&&oe.length>0?Object.fromEntries(oe.map(e=>[`--es-color-${e.name}`,e.value])):void 0,onSelect:()=>{const e=de.current;e&&e.ownerDocument.activeElement===e&&fe({start:e.selectionStart??t.length,end:e.selectionEnd??t.length})},children:[ct&&(mt.words||mt.paragraph)?
21
+ /* @__PURE__ */ne(N,{className:"es-copy-toolbar","aria-label":R??ie.formatting,offered:dt,pressed:Ye,onMark:e=>_e(e),color:it,linkOpen:null!==Ie,last:ut,alignment:pt,list:ht,letterCase:se,disabled:k,windows:/* @__PURE__ */te(re,{children:[Re&&oe&&oe.length>0?/* @__PURE__ */ne(p,{colors:oe,current:Qe,words:ie.colors??b.colors,onPick:e=>{const{start:n,end:r}=Ze();if(n!==r)$e(()=>_(t,n,r,e,Ae));else{if(!Se)return;Oe({add:Te?.add??[],drop:Te?.drop??[],color:e,at:n})}}}):null,Ie?Ie&&/* @__PURE__ */ne(K,{className:"es-copy-link es-copy-pop",value:Ie.link?.href??"",onApply:e=>{const n=Ie;qe(null),$e(()=>Se?X(t,n.start,n.end,e,Ae):ee(t,n.start,n.end,e))},onRemove:Ie.link?()=>{const e=Ie.link,n=Ie;qe(null),e&&$e(()=>Se?J(t,n.start,n.end,Ae):Q(t,e))}:void 0,onCancel:tt}):null]})}):null,ae&&ae.length>0?/* @__PURE__ */ne(Ve,{cells:ae,words:ie.cells??b.cells,readOnly:k}):null,Se?/* @__PURE__ */ne(Le,{value:t,rules:Ae,multiline:f,readOnly:k,placeholder:g,ariaLabel:y,handle:Ee,pending:Te??void 0,onEdit:(e,n,r)=>{ge.record({text:t,start:n.start,end:n.end},r,Date.now()),Oe(null),ve(e)},onSelect:e=>{fe(t=>t&&t.start===e.start&&t.end===e.end?t:e),!Te||e.start===Te.at&&e.end===Te.at||Oe(null)},onHistory:Pe,onFormat:e=>{Ue.includes(e)&&_e(e)},onCommit:r,onCancel:l}):/* @__PURE__ */ne(we,{value:t,onInput:e=>{ge.record(be(null),"type",Date.now()),ve(e)},onCommit:r,onCancel:l,multiline:f,placeholder:g,ariaLabel:y,rules:x,disabled:k,inputRef:de,className:"es-copy-box"}),V?V({focused:pe,insert:e=>$e(n=>De(t,e,n))}):null,Z&&f?
22
22
  /* @__PURE__ */te("div",{className:"es-copy-marks",children:[
23
- /* @__PURE__ */ne(k,{checked:ke,onChange:()=>{const e=Be();ze.current=e&&null!==e.selectionStart&&null!==e.selectionEnd?{start:e.selectionStart,end:e.selectionEnd}:me,Le(null),xe(e=>!e)},ariaLabelledBy:Ne,disabled:b}),
24
- /* @__PURE__ */ne("span",{id:Ne,className:"es-copy-marks-label",children:ie.showMarks??"Show marks"})]}):null]})}var Fe=["none","bullet","number"],He=E,Pe={none:/* @__PURE__ */ne(ge,{}),bullet:/* @__PURE__ */ne(fe,{}),number:/* @__PURE__ */ne(me,{})},We={none:/* @__PURE__ */ne(ke,{}),upper:/* @__PURE__ */ne(be,{}),capitalize:/* @__PURE__ */ne(ve,{}),lower:/* @__PURE__ */ne(ye,{})};function $e({label:e,icon:t,answers:n,names:r,glyphs:l,row:o,readOnly:a}){const s=o.value||o.styleValue||"";/* @__PURE__ */
25
- return ne(x,{label:e,icon:t,children:/* @__PURE__ */ne(S,{ariaLabel:e,value:s,disabled:a,onChange:e=>{a||o.onChange(function(e,t){return t===e.value||""===e.value&&t===e.styleValue?"":t}(o,e))},options:n.map(e=>({id:e,label:l[e],title:r[e]}))})})}function ze({kept:e,keptHint:t,readOnly:n=!1,style:r,font:l,italic:o,cells:a,align:s,list:c,letterCase:i}){const u=w("copy",y),d=T(L().textToolbar),p=Object.fromEntries(O(R).map(e=>[e.value,e.icon])),h={...y.panel,...u.panel},m=r&&!n?[r.onEditStyles&&{label:h.editStyles,onSelect:r.onEditStyles},r.onUpdateStyle&&{label:h.updateStyle,onSelect:r.onUpdateStyle}].filter(e=>!!e):[],f=!!o&&(o.value??o.styleValue??!1),g=o?/* @__PURE__ */ne(M,{content:h.italic,children:/* @__PURE__ */ne(V,{size:"sm",variant:"ghost","aria-label":h.italic,"aria-pressed":f,disabled:n,onClick:()=>{if(n)return;const e=!f;o.onChange(e===(o.styleValue??!1)?void 0:e)},children:/* @__PURE__ */ne(he,{})})}):null;/* @__PURE__ */
23
+ /* @__PURE__ */ne(e,{checked:ke,onChange:()=>{const e=Me();ze.current=e&&null!==e.selectionStart&&null!==e.selectionEnd?{start:e.selectionStart,end:e.selectionEnd}:me,Oe(null),xe(e=>!e)},ariaLabelledBy:Ne,disabled:k}),
24
+ /* @__PURE__ */ne("span",{id:Ne,className:"es-copy-marks-label",children:ie.showMarks??"Show marks"})]}):null]})}var Fe=["none","bullet","number"],We=t,He={none:/* @__PURE__ */ne(ge,{}),bullet:/* @__PURE__ */ne(fe,{}),number:/* @__PURE__ */ne(me,{})},$e={none:/* @__PURE__ */ne(ke,{}),upper:/* @__PURE__ */ne(be,{}),capitalize:/* @__PURE__ */ne(ve,{}),lower:/* @__PURE__ */ne(ye,{})};function Pe({label:e,icon:t,answers:n,names:r,glyphs:l,row:o,readOnly:a}){const s=o.value||o.styleValue||"";/* @__PURE__ */
25
+ return ne(x,{label:e,icon:t,children:/* @__PURE__ */ne(S,{ariaLabel:e,value:s,disabled:a,onChange:e=>{a||o.onChange(function(e,t){return t===e.value||""===e.value&&t===e.styleValue?"":t}(o,e))},options:n.map(e=>({id:e,label:l[e],title:r[e]}))})})}function ze({kept:e,keptHint:t,readOnly:n=!1,style:r,font:l,italic:o,cells:a,align:s,list:c,letterCase:i}){const u=E("copy",b),d=T(O().textToolbar),p=Object.fromEntries(L(R).map(e=>[e.value,e.icon])),h={...b.panel,...u.panel},m=r&&!n?[r.onEditStyles&&{label:h.editStyles,onSelect:r.onEditStyles},r.onUpdateStyle&&{label:h.updateStyle,onSelect:r.onUpdateStyle}].filter(e=>!!e):[],f=!!o&&(o.value??o.styleValue??!1),g=o?/* @__PURE__ */ne(V,{content:h.italic,children:/* @__PURE__ */ne(j,{size:"md",variant:"ghost","aria-label":h.italic,"aria-pressed":f,disabled:n,onClick:()=>{if(n)return;const e=!f;o.onChange(e===(o.styleValue??!1)?void 0:e)},children:/* @__PURE__ */ne(he,{})})}):null;/* @__PURE__ */
26
26
  return te("div",{className:"es-tpp",children:[e?/* @__PURE__ */te("div",{className:"es-tpp-kept",children:[
27
- /* @__PURE__ */ne(Be,{...e,readOnly:n||e.readOnly}),t?/* @__PURE__ */ne("p",{className:"es-field-hint",children:t}):null]}):null,r?/* @__PURE__ */ne(x,{label:h.style,icon:/* @__PURE__ */ne(ce,{}),children:/* @__PURE__ */ne(b,{ariaLabel:h.style,value:r.value,options:r.options,onChange:r.onChange,changed:r.changed,footer:m,readOnly:n})}):null,l?/* @__PURE__ */ne(x,{label:h.font,icon:/* @__PURE__ */ne(ie,{}),children:/* @__PURE__ */te("div",{className:"es-tpp-font",children:[
28
- /* @__PURE__ */ne("div",{className:"es-tpp-font-select",children:/* @__PURE__ */ne(b,{ariaLabel:h.font,value:l.value||void 0,placeholder:l.styleValue,options:l.options,onChange:l.onChange,searchable:l.searchable,readOnly:n})}),g]})}):g?
29
- /* @__PURE__ */ne(x,{label:h.italic,icon:/* @__PURE__ */ne(ie,{}),children:/* @__PURE__ */ne("div",{className:"es-tpp-font",children:g})}):null,a?.length?/* @__PURE__ */ne(Me,{cells:a,words:u.cells,readOnly:n}):null,s?/* @__PURE__ */ne($e,{label:u.alignment,icon:/* @__PURE__ */ne(ue,{}),answers:R.filter(e=>!s.allow||s.allow.includes(e)),names:d,glyphs:p,row:s,readOnly:n}):null,c?/* @__PURE__ */ne($e,{label:h.list,icon:/* @__PURE__ */ne(de,{}),answers:Fe,names:h.lists,glyphs:Pe,row:c,readOnly:n}):null,i?/* @__PURE__ */ne($e,{label:h.capitalization,icon:/* @__PURE__ */ne(pe,{}),answers:He,names:h.cases,glyphs:We,row:i,readOnly:n}):null]})}export{Re as COPY_CELLS,Be as CopyBox,Me as CopyCells,Oe as RichBox,ze as TextPartPanel,De as insertSelection,Ce as markSelection,Ve as useCaretEdit};
27
+ /* @__PURE__ */ne(Me,{...e,readOnly:n||e.readOnly}),t?/* @__PURE__ */ne("p",{className:"es-field-hint",children:t}):null]}):null,r?/* @__PURE__ */ne(x,{label:h.style,icon:/* @__PURE__ */ne(ce,{}),children:/* @__PURE__ */ne(w,{ariaLabel:h.style,value:r.value,options:r.options,onChange:r.onChange,changed:r.changed,footer:m,readOnly:n})}):null,l?/* @__PURE__ */ne(x,{label:h.font,icon:/* @__PURE__ */ne(ie,{}),children:/* @__PURE__ */te("div",{className:"es-tpp-font",children:[
28
+ /* @__PURE__ */ne("div",{className:"es-tpp-font-select",children:/* @__PURE__ */ne(w,{ariaLabel:h.font,value:l.value||void 0,placeholder:l.styleValue,options:l.options,onChange:l.onChange,searchable:l.searchable,readOnly:n})}),g]})}):g?
29
+ /* @__PURE__ */ne(x,{label:h.italic,icon:/* @__PURE__ */ne(ie,{}),children:/* @__PURE__ */ne("div",{className:"es-tpp-font",children:g})}):null,a?.length?/* @__PURE__ */ne(Ve,{cells:a,words:u.cells,readOnly:n}):null,s?/* @__PURE__ */ne(Pe,{label:u.alignment,icon:/* @__PURE__ */ne(ue,{}),answers:R.filter(e=>!s.allow||s.allow.includes(e)),names:d,glyphs:p,row:s,readOnly:n}):null,c?/* @__PURE__ */ne(Pe,{label:h.list,icon:/* @__PURE__ */ne(de,{}),answers:Fe,names:h.lists,glyphs:He,row:c,readOnly:n}):null,i?/* @__PURE__ */ne(Pe,{label:h.capitalization,icon:/* @__PURE__ */ne(pe,{}),answers:We,names:h.cases,glyphs:$e,row:i,readOnly:n}):null]})}export{Re as COPY_CELLS,Me as CopyBox,Ve as CopyCells,Le as RichBox,ze as TextPartPanel,De as insertSelection,Ce as markSelection,je as useCaretEdit};
@@ -1 +1 @@
1
- export{DataError,ROOT_ID,ROOT_LIST,ROOT_SLOT,applyTranslation,changedProps,copyNode,copyTranslation,createNode,createResolveCache,deepEqual,duplicate,extractTranslation,find,getList,insert,mapIds,move,newId,normalizeData,parseZoneKey,pruneTranslation,rebaseTranslation,remove,replaceNode,resolveNodeData,setProps,setRoot,slotsOf,translatablePaths,translationFingerprint,translationStatus,walk,zoneKey}from"../chunk-KRXQM65X.js";export{getIn}from"../chunk-NKB3KVAB.js";
1
+ export{DataError,ROOT_ID,ROOT_LIST,ROOT_SLOT,applyTranslation,changedProps,copyNode,copyTranslation,createNode,createResolveCache,deepEqual,duplicate,extractTranslation,find,getList,insert,mapIds,move,newId,normalizeData,parseZoneKey,pruneTranslation,rebaseTranslation,remove,replaceNode,resolveNodeData,setProps,setRoot,slotsOf,translatablePaths,translationFingerprint,translationStatus,walk,zoneKey}from"../chunk-K7BTCBWD.js";export{getIn}from"../chunk-L55YIXDC.js";
@@ -1 +1 @@
1
- export{AddPanel,CanvasDragLayer,CanvasInsert,EMPTY_MEASURE,HANDLE_GRACE_MS,canvasTarget,contains,gapInZone,gapLine,insertSeams,measureCanvas,pickSource,seamsBetween,sourcesAt}from"../chunk-Z2V3TTAR.js";import"../chunk-KAML3KQH.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-P2VEMZH5.js";import"../chunk-X4T6JT3M.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-LDEEFLE3.js";import"../chunk-KAML3KQH.js";export{AUTO_SCROLL_EDGE,AUTO_SCROLL_MAX_SPEED,autoScrollDelta,autoScrollSpeed,createDragSession,dropEffectFor,dropOnRow,frameScrollBox,gapToMoveIndex,isNoOpDrop,scrollBoxOf,scrollParent,startAutoScroll,stepGap,useTreeDrag}from"../chunk-3S5N4HLJ.js";import"../chunk-P2VEMZH5.js";import"../chunk-QIDRJH3S.js";import"../chunk-LF3FUSCQ.js";import"../chunk-K7BTCBWD.js";import"../chunk-L55YIXDC.js";
@@ -4,7 +4,8 @@ export { ANCHOR_FIELD_KEYS, EdgeCell, FOLD_FIELD_MARKER, FoldFieldMeta, LINK_FIE
4
4
  export { SCALAR_TEXT_CONTROLS, ScalarTextControlKind, TEXT_CONTROL_KINDS, TextControlKind } from '../screen/lib/puck/text-control-kinds.js';
5
5
  export { RowNameRule, rootRowName, sectionRenameProp, slotChildName, slotChildRenameProp, slotChildRowName } from '../screen/lib/puck/slot-child-name.js';
6
6
  export { FOOTER_TYPE, HEADER_TYPE, NodeLocation, ROOT_ZONE, SlotConfigView, TREE_MAX_DEPTH, TreeItem, blockNodeActions, childSlotsOf, locateNode, missingPinnedTypes, nestsInTree, newNodeId, pinnedDuplicateIds, pinnedDuplicateIndices, slotChildrenIn, slotFieldsOf } from '../screen/lib/puck/content-tree.js';
7
- export { VIEW_DESKTOP_MIN, VIEW_TABLET_MIN, VIEW_TIERS, VIEW_TIER_LABEL, ViewTier, viewTierForWidth } from '../screen/lib/content/view-tiers.js';
7
+ export { AUTO_RULES, AutoRule, VIEW_DESKTOP_MIN, VIEW_TABLET_MIN, VIEW_TIERS, VIEW_TIER_LABEL, ViewTier, ViewValueKind, ViewValues, isAuto, phoneKey, resolveViewValue, tabletKey, viewTierForWidth } from '../screen/lib/content/view-tiers.js';
8
8
  export { HERO_SLIDER_GOTO_EVENT, HeroSliderGotoDetail } from '../screen/lib/puck/preview-events.js';
9
+ export { R as REPEAT_ATTRIBUTE, a as REPEAT_INDEX_ATTRIBUTE } from '../repeat-Czi-6zPX.js';
9
10
  export { TEXT_STYLE_CASES, TEXT_STYLE_CASE_CSS, TextStyleCase, TextStyleCaseCss, isTextStyleCase, textStyleCaseCss, textStyleCaseOfCss } from '../text-styles/model.js';
10
11
  import '../words-gIDCeRv3.js';
@@ -1 +1 @@
1
- export{SCALAR_TEXT_CONTROLS,TEXT_CONTROL_KINDS}from"../chunk-PIND6KE7.js";export{VIEW_DESKTOP_MIN,VIEW_TABLET_MIN,VIEW_TIERS,VIEW_TIER_LABEL,viewTierForWidth}from"../chunk-DWIOHQG7.js";export{rootRowName,sectionRenameProp,slotChildName,slotChildRenameProp,slotChildRowName}from"../chunk-BHRC3ASL.js";export{hidableText,readHidable}from"../chunk-6W7WLPZH.js";export{HERO_SLIDER_GOTO_EVENT}from"../chunk-IQ5TA7AM.js";export{ANCHOR_FIELD_KEYS,FOLD_FIELD_MARKER,LINK_FIELD_MARKER,MEDIA_FIELD_MARKER,SCAFFOLD_FIELD_MARKER,TEXT_FIELD_MARKER,foldMetaOf,textFieldIdentifier}from"../chunk-DUVRZ456.js";export{PART_SEP,decodePartId,encodePartId}from"../chunk-IYT6NN2J.js";export{FOOTER_TYPE,HEADER_TYPE,ROOT_ZONE,TREE_MAX_DEPTH,blockNodeActions,childSlotsOf,locateNode,missingPinnedTypes,nestsInTree,newNodeId,pinnedDuplicateIds,pinnedDuplicateIndices,slotChildrenIn,slotFieldsOf}from"../chunk-PLVEGYK6.js";export{TEXT_STYLE_CASES,TEXT_STYLE_CASE_CSS,isTextStyleCase,textStyleCaseCss,textStyleCaseOfCss}from"../chunk-YHZSBL2N.js";
1
+ export{SCALAR_TEXT_CONTROLS,TEXT_CONTROL_KINDS}from"../chunk-PIND6KE7.js";export{AUTO_RULES,VIEW_DESKTOP_MIN,VIEW_TABLET_MIN,VIEW_TIERS,VIEW_TIER_LABEL,isAuto,phoneKey,resolveViewValue,tabletKey,viewTierForWidth}from"../chunk-HK6I3NVO.js";export{rootRowName,sectionRenameProp,slotChildName,slotChildRenameProp,slotChildRowName}from"../chunk-BHRC3ASL.js";export{hidableText,readHidable}from"../chunk-6W7WLPZH.js";export{HERO_SLIDER_GOTO_EVENT}from"../chunk-IQ5TA7AM.js";export{ANCHOR_FIELD_KEYS,FOLD_FIELD_MARKER,LINK_FIELD_MARKER,MEDIA_FIELD_MARKER,SCAFFOLD_FIELD_MARKER,TEXT_FIELD_MARKER,foldMetaOf,textFieldIdentifier}from"../chunk-DUVRZ456.js";export{PART_SEP,decodePartId,encodePartId}from"../chunk-IYT6NN2J.js";export{FOOTER_TYPE,HEADER_TYPE,ROOT_ZONE,TREE_MAX_DEPTH,blockNodeActions,childSlotsOf,locateNode,missingPinnedTypes,nestsInTree,newNodeId,pinnedDuplicateIds,pinnedDuplicateIndices,slotChildrenIn,slotFieldsOf}from"../chunk-PLVEGYK6.js";export{TEXT_STYLE_CASES,TEXT_STYLE_CASE_CSS,isTextStyleCase,textStyleCaseCss,textStyleCaseOfCss}from"../chunk-YHZSBL2N.js";export{REPEAT_ATTRIBUTE,REPEAT_INDEX_ATTRIBUTE}from"../chunk-LF3FUSCQ.js";
@@ -1 +1 @@
1
- export{CanvasFrame,CanvasPartsContext,CanvasPassThroughContext,CanvasSharedContext,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useSelectedFields,validSelection}from"../chunk-UZXGXMNO.js";import"../chunk-TBY3DFKS.js";import"../chunk-YRLPFZW3.js";import"../chunk-X3TYRF5V.js";import"../chunk-X4T6JT3M.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";import"../chunk-23VM4PMV.js";import"../chunk-KRL3IUV3.js";import"../chunk-MFIRYGHW.js";
1
+ export{CanvasFrame,CanvasPartsContext,CanvasPassThroughContext,CanvasSharedContext,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useSelectedFields,validSelection}from"../chunk-ROPYFLNZ.js";import"../chunk-TBY3DFKS.js";import"../chunk-IWCKVZHS.js";import"../chunk-BSHIQIZC.js";import"../chunk-23VM4PMV.js";import"../chunk-KRL3IUV3.js";import"../chunk-MFIRYGHW.js";import"../chunk-QIDRJH3S.js";import"../chunk-LF3FUSCQ.js";import"../chunk-K7BTCBWD.js";import"../chunk-L55YIXDC.js";
@@ -1 +1 @@
1
- export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-ZFFWO2AF.js";export{fieldIsShown,showWhenOf,shownFields,withShowWhen}from"../chunk-BPXEFVSQ.js";import"../chunk-A6Z4SD3I.js";import"../chunk-K56YDHYQ.js";export{FieldSlider}from"../chunk-XWFH2NHZ.js";import"../chunk-67GNT6PF.js";export{useResolvedFields}from"../chunk-YRLPFZW3.js";import"../chunk-BALFHI3G.js";import"../chunk-RC25EGHD.js";import"../chunk-KFV7N2DJ.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";export{FieldNumber}from"../chunk-2XMHLXMA.js";export{FieldSelect,optionFor}from"../chunk-G3GWAP5R.js";import"../chunk-WRFD4EXD.js";import"../chunk-36LVP5WD.js";import"../chunk-MFIRYGHW.js";
1
+ export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-SK3P56FS.js";export{fieldIsShown,showWhenOf,shownFields,withShowWhen}from"../chunk-BPXEFVSQ.js";import"../chunk-A6Z4SD3I.js";import"../chunk-RC25EGHD.js";import"../chunk-K56YDHYQ.js";import"../chunk-KFV7N2DJ.js";export{FieldSlider}from"../chunk-ZEH6QLBH.js";export{useResolvedFields}from"../chunk-IWCKVZHS.js";import"../chunk-FIVU2COQ.js";export{FieldNumber}from"../chunk-ZOBSIXRD.js";import"../chunk-VANKQVOW.js";export{FieldSelect,optionFor}from"../chunk-QAJAEWCZ.js";import"../chunk-WRFD4EXD.js";import"../chunk-MFIRYGHW.js";import"../chunk-3S5N4HLJ.js";import"../chunk-P2VEMZH5.js";import"../chunk-K7BTCBWD.js";import"../chunk-L55YIXDC.js";
@@ -19,7 +19,10 @@
19
19
 
20
20
  .es-gold {
21
21
  /* — tokens: this sheet is their one source — */
22
- --es-gold-accent: var(--gold, #c9a461);
22
+ /* The emphasis colour is the PAGE's accent, as the published page draws it
23
+ (the storefront renamed --gold to --accent). Where the page has no accent,
24
+ emphasis takes the text's own colour: no house gold. */
25
+ --es-gold-accent: var(--accent, currentColor);
23
26
  --es-gold-quiet: var(--es-muted, var(--ink-faint));
24
27
  --es-gold-caret: var(--es-text, var(--ink-strongest));
25
28
  --es-gold-placeholder: var(--es-field-placeholder, var(--ink-faintest));
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
- import { a as EaselContextMenuProps, E as EaselContextMenuItem } from '../types-BsyPh6EW.js';
3
- export { b as EaselContextMenuSkin } from '../types-BsyPh6EW.js';
2
+ import { a as EaselContextMenuProps, E as EaselContextMenuItem } from '../types-BbOBWXMP.js';
3
+ export { b as EaselContextMenuSkin } from '../types-BbOBWXMP.js';
4
4
  import { DropdownMenuEntry } from 'efficient-shell/ui';
5
5
 
6
6
  /**
@@ -41,7 +41,7 @@ declare function EaselContextMenu({ x, y, items, onClose, owner, portalTo }: Eas
41
41
  * are not offered. A flyout whose entries carry `checked` is a
42
42
  * set of states (the layer a "Select layer" ladder is on), so
43
43
  * its entries are `radio`s;
44
- * otherwise an `item`, `danger` kept.
44
+ * otherwise an `item`, `danger` and `disabled` kept.
45
45
  *
46
46
  * Choosing an entry closes the menu, then runs its `onClick` (the shell's
47
47
  * order). Easel draws no row: only the glyph and the shortcut, which the
@@ -1 +1 @@
1
- export{EaselContextMenu}from"../chunk-WXFZD7WC.js";export{easelMenuEntries,menuLabel}from"../chunk-BALFHI3G.js";
1
+ export{EaselContextMenu}from"../chunk-ZKY45F5G.js";export{easelMenuEntries,menuLabel}from"../chunk-FIVU2COQ.js";
@@ -1,7 +1,7 @@
1
1
  export { A as AfterRemove, I as ItemSelector, N as NodeSelection, P as PassThrough, a as Planned, S as StepBounds, c as canStep, b as clickPick, d as clickPickPart, f as fromItemSelector, n as nextInChain, e as nodeChain, p as parentStep, g as planDuplicate, h as planMove, i as planPaste, j as planRemove, k as planRestore, l as planSetProps, m as planStep, o as planSwap, t as toItemSelector } from '../plan-CZS902DV.js';
2
2
  export { C as ClipboardEntry, N as NodeClipboard, a as NodeOps, b as NodeOpsHost, c as createNodeClipboard, u as useNodeOps } from '../useNodeOps-fIDWzftn.js';
3
3
  import { ReactNode } from 'react';
4
- import { E as EaselContextMenuItem } from '../types-BsyPh6EW.js';
4
+ import { E as EaselContextMenuItem } from '../types-BbOBWXMP.js';
5
5
  import { N as NodeMenuWords } from '../words-DMG4dYq2.js';
6
6
  import '../types-41704JE4.js';
7
7
 
@@ -23,10 +23,12 @@ import '../types-41704JE4.js';
23
23
  * remove : Delete
24
24
  *
25
25
  * WHAT IS OFFERED IS THE HOST'S CALL, BY PRESENCE. A row appears when the host
26
- * passes its action and is omitted when it does not — never drawn disabled,
27
- * the rule both editors already follow. So the pinned Header and Footer, a
28
- * locked block, a read-only campaign are all answered upstream, where the host
29
- * knows why; a pinned block with nothing to offer gets `pinnedLine`.
26
+ * passes its action and is omitted when it does not, the rule both editors
27
+ * already follow. So the pinned Header and Footer, a locked block, a read-only
28
+ * campaign are all answered upstream, where the host knows why; a pinned block
29
+ * with nothing to offer gets `pinnedLine`. ONE exception, the MOVE pair (Lewis
30
+ * 2026-10-23): a host passes `null` for the way a node cannot go (Move up on
31
+ * the first), and that row is drawn greyed, so the pair reads as a pair.
30
32
  *
31
33
  * Every row's label, icon and shortcut can be overridden (`rows`), so each
32
34
  * editor keeps its own words ("Hide from email", "Delete section") until the
@@ -50,8 +52,10 @@ interface NodeMenuOptions {
50
52
  actions: {
51
53
  addInside?: () => void;
52
54
  duplicate?: () => void;
53
- moveUp?: () => void;
54
- moveDown?: () => void;
55
+ /** `null`: offered, greyed — the node can move, but not this way. */
56
+ moveUp?: (() => void) | null;
57
+ /** `null`: offered, greyed — the node can move, but not this way. */
58
+ moveDown?: (() => void) | null;
55
59
  copy?: () => void;
56
60
  cut?: () => void;
57
61
  /** `label` names what is held: "Paste ‹label›". */
@@ -1 +1 @@
1
- export{createNodeClipboard,nodeMenuItems}from"../chunk-OSPUG6S6.js";import"../chunk-WK3AFPXY.js";export{canStep,clickPick,clickPickPart,fromItemSelector,nextInChain,nodeChain,parentStep,planDuplicate,planMove,planPaste,planRemove,planRestore,planSetProps,planStep,planSwap,toItemSelector,useNodeOps}from"../chunk-X3TYRF5V.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
1
+ export{createNodeClipboard,nodeMenuItems}from"../chunk-P5VYGWYO.js";import"../chunk-WK3AFPXY.js";export{canStep,clickPick,clickPickPart,fromItemSelector,nextInChain,nodeChain,parentStep,planDuplicate,planMove,planPaste,planRemove,planRestore,planSetProps,planStep,planSwap,toItemSelector,useNodeOps}from"../chunk-BSHIQIZC.js";import"../chunk-K7BTCBWD.js";import"../chunk-L55YIXDC.js";
@@ -737,20 +737,19 @@ declare function SettingsField({ label, labelId, icon, value, hint, changed, htm
737
737
  * IT IS THE SHELL'S `Switch` (harness UI-24, efficient-easel#199 step 4): a
738
738
  * real `<button role="switch">`, so Space and Enter are a click with no key
739
739
  * handler of ours, and its look is the kit's, in both themes. This name stays
740
- * because both editors' hosts import it, and `SettingsField` recognises it in
741
- * its `action` slot; nothing here draws a switch any more.
740
+ * because both editors' hosts import it; nothing here draws a switch any more.
742
741
  *
743
742
  * It cannot exist without a NAME. `SettingsSwitchProps` demands `ariaLabel` or
744
743
  * `ariaLabelledBy` and forbids both at once, so an unnamed switch — which a
745
744
  * screen reader reads out as "switch, on" and nothing more — is a compile error
746
745
  * instead of something a docstring asks you to remember.
747
746
  *
748
- * ONE-WAY DEPENDENCY. `SettingsField` imports this module so it can recognise a
749
- * switch in its `action` slot and hand it the field's label as a name. This
750
- * module must NEVER import `SettingsField` back — that would close a cycle
751
- * between two siblings in the same folder. It imports `./types` and the
752
- * shell's kit, nothing else, and `tests/settings-switch.test.tsx` (o) keeps it
753
- * that way.
747
+ * A LEAF. It imports `./types` and the shell's kit, nothing else, and
748
+ * `tests/settings-switch.test.tsx` (o) keeps it that way. `SettingsField` does
749
+ * not name it: the switch is named by its own props (above). `SettingsField`
750
+ * used to fill a missing name (`nameSwitch`). The type above made that fill
751
+ * unreachable for typed code, so it went (card [MOVE] Last Panel Parts And
752
+ * Icons Into The Shell, step E1).
754
753
  *
755
754
  * CONTROLLED: `checked` comes from the host and the switch only ever ASKS to
756
755
  * be flipped. Hook-free and directive-free here; the shell's kit entry is a
@@ -1,15 +1,15 @@
1
- export{DESIGN_GROUPS,SETTINGS_BUCKETS,SettingsGroup}from"../chunk-RC25EGHD.js";import{DEFAULT_PANEL_WORDS as e}from"../chunk-KFV7N2DJ.js";import{withTip as l}from"../chunk-P2VEMZH5.js";import{SettingsField as n,SettingsSegmented as t}from"../chunk-36LVP5WD.js";export{SettingsField,SettingsSegmented,SettingsSwitch}from"../chunk-36LVP5WD.js";import{jsx as a,jsxs as i,Fragment as s}from"react/jsx-runtime";import{RevertIcon as d,BackgroundIcon as o,WidthIcon as r}from"efficient-shell/icons/efficient";import{Tooltip as c}from"efficient-shell/ui";export{BorderInput as SettingsBorder,CornersInput as SettingsCorners,AlignmentGrid as SettingsPlacement,SidesInput as SettingsSides,SidesEachToggle as SettingsSidesEach,borderSides,borderStartEach,sidesStartEach}from"efficient-shell/ui";function u({title:e,level:l=3,id:n,className:t}){/* @__PURE__ */
1
+ export{DESIGN_GROUPS,SETTINGS_BUCKETS,SettingsGroup}from"../chunk-RC25EGHD.js";import{DEFAULT_PANEL_WORDS as e}from"../chunk-KFV7N2DJ.js";export{SettingsSwitch}from"../chunk-OECWLNKJ.js";import{SettingsField as l,SettingsSegmented as n}from"../chunk-VANKQVOW.js";export{SettingsField,SettingsSegmented}from"../chunk-VANKQVOW.js";import{withTip as t}from"../chunk-P2VEMZH5.js";import{jsx as a,jsxs as i,Fragment as s}from"react/jsx-runtime";import{RevertIcon as o,BackgroundIcon as d,WidthIcon as r}from"efficient-shell/icons/efficient";import{Tooltip as c}from"efficient-shell/ui";export{BorderInput as SettingsBorder,CornersInput as SettingsCorners,AlignmentGrid as SettingsPlacement,SidesInput as SettingsSides,SidesEachToggle as SettingsSidesEach,borderSides,borderStartEach,sidesStartEach}from"efficient-shell/ui";function u({title:e,level:l=3,id:n,className:t}){/* @__PURE__ */
2
2
  return a(`h${l}`,{id:n,className:t?`es-group-head ${t}`:"es-group-head",children:e})}function h({title:e,level:l=4,id:n,className:t}){/* @__PURE__ */
3
- return a(`h${l}`,{id:n,className:t?`es-group-sub ${t}`:"es-group-sub",children:e})}function b({label:n,changed:t,onReset:i,detail:s,disabled:o,defaultAction:r,words:c,className:u}){const h={...e,...c},b=["es-default-reset"];if(t&&b.push("is-changed"),u&&b.push(u),!t&&r)return b.push("is-pressable"),l(r.title,/* @__PURE__ */a("button",{type:"button",className:b.join(" "),"aria-label":r.title,disabled:o,onClick:r.onPress,children:r.icon}));if(!t)/* @__PURE__ */
4
- return a("span",{className:b.join(" "),"aria-hidden":"true"});const g=h.resetName({label:n});return l(s?h.resetTitle({label:n,detail:s}):g,/* @__PURE__ */a("button",{type:"button",className:b.join(" "),"aria-label":g,"aria-description":s||void 0,disabled:o,onClick:e=>{i(),function(e){const l=e.currentTarget,n=l.closest(".es-field");let t=n?.querySelector(m(".es-field-ctl"))??n?.querySelector(m(".es-field-head"))??null,a=n?null:l.parentElement;for(let e=0;!t&&a&&e<f;e+=1,a=a.parentElement)t=[...a.querySelectorAll(p)].find(e=>e!==l)??null;t?.focus()}(e)},children:/* @__PURE__ */a(d,{size:15})}))}var p=['input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","button:not([disabled]):not(.es-default-reset)",'[tabindex]:not([tabindex="-1"])'].join(", "),m=e=>p.split(", ").map(l=>`${e} ${l}`).join(", "),f=4;function g({name:e,preview:l,offPage:n,status:t,onOpen:d,id:o,className:r}){const u=null!=l;/* @__PURE__ */
5
- return i("button",{type:"button",id:o,className:r?`es-drill ${r}`:"es-drill",onClick:d,children:[
3
+ return a(`h${l}`,{id:n,className:t?`es-group-sub ${t}`:"es-group-sub",children:e})}function b({label:l,changed:n,onReset:i,detail:s,disabled:d,defaultAction:r,words:c,className:u}){const h={...e,...c},b=["es-default-reset"];if(n&&b.push("is-changed"),u&&b.push(u),!n&&r)return b.push("is-pressable"),t(r.title,/* @__PURE__ */a("button",{type:"button",className:b.join(" "),"aria-label":r.title,disabled:d,onClick:r.onPress,children:r.icon}));if(!n)/* @__PURE__ */
4
+ return a("span",{className:b.join(" "),"aria-hidden":"true"});const g=h.resetName({label:l});return t(s?h.resetTitle({label:l,detail:s}):g,/* @__PURE__ */a("button",{type:"button",className:b.join(" "),"aria-label":g,"aria-description":s||void 0,disabled:d,onClick:e=>{i(),function(e){const l=e.currentTarget,n=l.closest(".es-field");let t=n?.querySelector(m(".es-field-ctl"))??n?.querySelector(m(".es-field-head"))??null,a=n?null:l.parentElement;for(let e=0;!t&&a&&e<f;e+=1,a=a.parentElement)t=[...a.querySelectorAll(p)].find(e=>e!==l)??null;t?.focus()}(e)},children:/* @__PURE__ */a(o,{size:15})}))}var p=['input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","button:not([disabled]):not(.es-default-reset)",'[tabindex]:not([tabindex="-1"])'].join(", "),m=e=>p.split(", ").map(l=>`${e} ${l}`).join(", "),f=4;function g({name:e,preview:l,offPage:n,status:t,onOpen:o,id:d,className:r}){const u=null!=l;/* @__PURE__ */
5
+ return i("button",{type:"button",id:d,className:r?`es-drill ${r}`:"es-drill",onClick:o,children:[
6
6
  /* @__PURE__ */i(c,{content:u?/* @__PURE__ */i(s,{children:[e,
7
7
  /* @__PURE__ */a("br",{}),l]}):e,describe:!1,className:"es-drill-text",children:[
8
8
  /* @__PURE__ */a("span",{className:"es-drill-name",children:e}),u?/* @__PURE__ */a("span",{className:n?"es-drill-preview is-offpage":"es-drill-preview",children:l}):null]}),t?/* @__PURE__ */a("span",{className:"es-drill-status",children:t}):null,
9
- /* @__PURE__ */a("span",{className:"es-drill-chev","aria-hidden":"true"})]})}function N({label:e,onPress:l,disabled:n,note:t,done:s,doneLabel:d,icon:o,id:r,className:c}){const u=void 0===d?e:d,h=s?u:e,b=null!=t,p=b&&r?`${r}-note`:void 0;/* @__PURE__ */
9
+ /* @__PURE__ */a("span",{className:"es-drill-chev","aria-hidden":"true"})]})}function N({label:e,onPress:l,disabled:n,note:t,done:s,doneLabel:o,icon:d,id:r,className:c}){const u=void 0===o?e:o,h=s?u:e,b=null!=t,p=b&&r?`${r}-note`:void 0;/* @__PURE__ */
10
10
  return i("div",{className:c?`es-action-wrap ${c}`:"es-action-wrap",children:[
11
- /* @__PURE__ */i("button",{type:"button",id:r,className:s?"es-action is-done":"es-action",disabled:n,"aria-describedby":p,onClick:l,children:[o?/* @__PURE__ */a("span",{className:"es-action-icon","aria-hidden":"true",children:o}):null,
11
+ /* @__PURE__ */i("button",{type:"button",id:r,className:s?"es-action is-done":"es-action",disabled:n,"aria-describedby":p,onClick:l,children:[d?/* @__PURE__ */a("span",{className:"es-action-icon","aria-hidden":"true",children:d}):null,
12
12
  /* @__PURE__ */a("span",{className:"es-action-label",children:h})]}),b?/* @__PURE__ */a("p",{id:p,className:"es-action-note",children:t}):null,
13
- /* @__PURE__ */a("span",{className:"es-action-live",role:"status","aria-live":"polite",children:s?u:null})]})}var S=["full","content"],v={label:"Background",full:"Full width",content:"Content width"};function w({value:e,changed:l,detail:i,onChange:s,onReset:d,disabled:r=!1,hint:c,labelId:u,words:h,resetWords:p}){const m={...v,...h};/* @__PURE__ */
14
- return a(n,{label:m.label,labelId:u,icon:/* @__PURE__ */a(o,{}),changed:l,hint:c,action:/* @__PURE__ */a(b,{words:p,label:m.label,changed:l,detail:i,onReset:d}),children:/* @__PURE__ */a(t,{options:S.map(e=>({id:e,label:"full"===e?m.full:m.content})),value:e,onChange:s,ariaLabel:m.label,disabled:r})})}var C={label:"Content",full:"Full width",content:"Content width"};function j({mode:e,onMode:l,number:s,changed:d,detail:o,onReset:c,fullClosed:u=!1,disabled:h=!1,hint:p,labelId:m,words:f,resetWords:g}){const N={...C,...f},v=void 0!==e&&l?/* @__PURE__ */a(t,{options:S.map(e=>({id:e,label:"full"===e?N.full:N.content,disabled:"full"===e&&u})),value:e,onChange:l,ariaLabel:N.label,disabled:h}):null;/* @__PURE__ */
15
- return a(n,{label:N.label,labelId:m,icon:/* @__PURE__ */a(r,{}),changed:d,hint:p,action:/* @__PURE__ */a(b,{words:g,label:N.label,changed:d,detail:o,onReset:c}),children:v&&s?/* @__PURE__ */i("div",{className:"es-width-stack",children:[v,s]}):v??s??null})}export{S as BACKGROUND_WIDTHS,v as DEFAULT_BACKGROUND_WIDTH_WORDS,C as DEFAULT_CONTENT_WIDTH_WORDS,N as SettingsAction,w as SettingsBackgroundWidth,j as SettingsContentWidth,b as SettingsDefaultReset,g as SettingsDrill,u as SettingsGroupHead,h as SettingsGroupSub};
13
+ /* @__PURE__ */a("span",{className:"es-action-live",role:"status","aria-live":"polite",children:s?u:null})]})}var S=["full","content"],v={label:"Background",full:"Full width",content:"Content width"};function w({value:e,changed:t,detail:i,onChange:s,onReset:o,disabled:r=!1,hint:c,labelId:u,words:h,resetWords:p}){const m={...v,...h};/* @__PURE__ */
14
+ return a(l,{label:m.label,labelId:u,icon:/* @__PURE__ */a(d,{}),changed:t,hint:c,action:/* @__PURE__ */a(b,{words:p,label:m.label,changed:t,detail:i,onReset:o}),children:/* @__PURE__ */a(n,{options:S.map(e=>({id:e,label:"full"===e?m.full:m.content})),value:e,onChange:s,ariaLabel:m.label,disabled:r})})}var C={label:"Content",full:"Full width",content:"Content width"};function j({mode:e,onMode:t,number:s,changed:o,detail:d,onReset:c,fullClosed:u=!1,disabled:h=!1,hint:p,labelId:m,words:f,resetWords:g}){const N={...C,...f},v=void 0!==e&&t?/* @__PURE__ */a(n,{options:S.map(e=>({id:e,label:"full"===e?N.full:N.content,disabled:"full"===e&&u})),value:e,onChange:t,ariaLabel:N.label,disabled:h}):null;/* @__PURE__ */
15
+ return a(l,{label:N.label,labelId:m,icon:/* @__PURE__ */a(r,{}),changed:o,hint:p,action:/* @__PURE__ */a(b,{words:g,label:N.label,changed:o,detail:d,onReset:c}),children:v&&s?/* @__PURE__ */i("div",{className:"es-width-stack",children:[v,s]}):v??s??null})}export{S as BACKGROUND_WIDTHS,v as DEFAULT_BACKGROUND_WIDTH_WORDS,C as DEFAULT_CONTENT_WIDTH_WORDS,N as SettingsAction,w as SettingsBackgroundWidth,j as SettingsContentWidth,b as SettingsDefaultReset,g as SettingsDrill,u as SettingsGroupHead,h as SettingsGroupSub};
@@ -240,16 +240,19 @@
240
240
 
241
241
  FULL WIDTH, ONE ROW. A track is a filled row, and every other filled row
242
242
  here runs the full width of the body's content box; a segmented control is
243
- one row by definition, so it never wraps. A SEGMENT TAKES ITS OWN WIDTH, THEN
244
- SHARES WHAT IS LEFT (`1 1 auto`, not equal segments: three equal segments
245
- need a 267px track against the 281px the shop's default panel gives). */
243
+ one row by definition, so it never wraps. EVERY SEGMENT IS AN EQUAL SHARE
244
+ (`1 1 0`; Lewis 2026-10-23, "like Show on", replacing his earlier natural
245
+ width). An equal share may be narrower than its word, so `min-width: 0`, and
246
+ the word drops before that happens ("word fit" below: the widest word times
247
+ the count, not the sum). */
246
248
  .es-segs {
247
249
  display: flex;
248
250
  flex-wrap: nowrap;
249
251
  width: 100%;
250
252
  }
251
253
  .es-segs > button {
252
- flex: 1 1 auto;
254
+ flex: 1 1 0;
255
+ min-width: 0;
253
256
  white-space: nowrap;
254
257
  }
255
258
  /* The glyph in the chip: 16px of drawing, the same size a field's icon takes,
@@ -387,16 +390,19 @@
387
390
  .es-segs.is-measured {
388
391
  --es-fit-strip: calc(2 * var(--es-fit-ends) + (var(--es-fit-count) - 1) * var(--es-fit-gap));
389
392
 
393
+ /* EQUAL SHARES (Lewis 2026-10-23): each chip gets the same share of the
394
+ track, so a word fits only when the WIDEST word fits in one share. Every
395
+ word therefore needs `count × widest`, never less than the sum; and the
396
+ chosen chip is no wider than the others, so its word needs the same room.
397
+ The two tiers meet: the words go together. */
390
398
  --es-fit-words-from: calc(
391
399
  var(--es-fit-strip) +
392
400
  var(--es-fit-count) * (var(--es-fit-chip) + var(--es-fit-word-gap)) +
393
- var(--es-fit-labels)
401
+ max(var(--es-fit-labels), var(--es-fit-count) * var(--es-fit-widest))
394
402
  );
395
403
  --es-fit-chosen-from: calc(
396
404
  var(--es-fit-strip) +
397
- var(--es-fit-count) * var(--es-fit-chip) +
398
- var(--es-fit-word-gap) +
399
- var(--es-fit-widest)
405
+ var(--es-fit-count) * (var(--es-fit-chip) + var(--es-fit-word-gap) + var(--es-fit-widest))
400
406
  );
401
407
  }
402
408
 
@@ -508,13 +514,16 @@
508
514
  /* SQUARE (Lewis 2026-10-14, again 2026-10-23): a band, not a pill.
509
515
  `tests/panel-group-band-full-bleed.test.ts` fails on any radius here. */
510
516
  border-radius: 0;
511
- /* A menu row tall (Lewis's row heights, 2026-10-12): 36, whatever the
512
- words' line height. */
513
- min-height: var(--row-height-menu, 36px);
517
+ /* 32 TALL, ONE STEP UNDER THE 36 MENU ROW (Lewis 2026-10-23: the full-bleed
518
+ band was too tall). The shell's medium control height. The 4 above and
519
+ below keeps the words and a 16px icon inside 32, so the padding never
520
+ makes the band taller; the words and the − / + stay centred
521
+ (`align-items`). `tests/panel-group-band-full-bleed.test.ts` (d). */
522
+ min-height: var(--control-height-md, 32px);
514
523
  /* Its words start where a tree row's do: the shell's `TreeRow` pads `px-2`,
515
524
  two of the shell's `--spacing` steps, and so does this (the Layers panel
516
525
  drew a heading at 12px over rows at 8px: two text columns). */
517
- padding: 8px calc(2 * var(--spacing));
526
+ padding: 4px calc(2 * var(--spacing));
518
527
  /* A heading needs more air above it than the settings it heads have between
519
528
  them (38px), or it reads as one more row. Floored on `--es-row-gap` so it
520
529
  rises with the rest of the panel (card 66203). */
@@ -79,8 +79,8 @@ declare const railTokens: {
79
79
  readonly color: {
80
80
  /** Rail card background: the shell's surface. */
81
81
  readonly background: "var(--surface)";
82
- /** Rail card shadow, black at an alpha (no shell elevation token yet). */
83
- readonly shadow: "0 1px 2px rgba(0, 0, 0, 0.05), 0 10px 30px rgba(0, 0, 0, 0.06)";
82
+ /** Rail card shadow: the shell's panel elevation, the side panel's own. */
83
+ readonly shadow: "var(--elevation-panel)";
84
84
  };
85
85
  };
86
86
  type RailTokens = typeof railTokens;
@@ -1 +1 @@
1
- export{AddIcon,LayersIcon,MediaIcon,PageIcon as PagesIcon,SitemapIcon,StylesIcon,railCssVars,railTokens}from"../chunk-4VJATVVR.js";export{EaselRail,EaselRailButton}from"../chunk-MJM6SFD3.js";import"../chunk-2OAZYSWJ.js";
1
+ export{AddIcon,LayersIcon,MediaIcon,PageIcon as PagesIcon,SitemapIcon,StylesIcon,railCssVars,railTokens}from"../chunk-XFYFKITX.js";export{EaselRail,EaselRailButton}from"../chunk-MJM6SFD3.js";import"../chunk-2OAZYSWJ.js";
@@ -26,7 +26,7 @@
26
26
  --es-rail-btn-size: 36px;
27
27
  --es-rail-icon-size: 18px;
28
28
  --es-rail-bg: var(--surface);
29
- --es-rail-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 10px 30px rgba(0, 0, 0, 0.06);
29
+ --es-rail-shadow: var(--elevation-panel);
30
30
 
31
31
  flex: none;
32
32
  width: var(--es-rail-w);
@@ -25,7 +25,9 @@ import { B as BlockShape, D as Data } from '../types-41704JE4.js';
25
25
  *
26
26
  * - a block's `render` receives its props, plus `puck`, plus each SLOT as a
27
27
  * component: `render: ({ content: Content }) => <Content className="…" />`.
28
- * A slot draws `<div className style>` around its blocks, as Puck's does;
28
+ * A slot draws `<div className style>` around its blocks, as Puck's does,
29
+ * and says how many it draws in `Content.blockCount` (the editor's
30
+ * canvas gives the same number);
29
31
  * - the root's `render` receives the root props, `puck`, `title` (`''` when
30
32
  * unset), `editMode: false`, `id: 'puck-root'`, and the page as `children`;
31
33
  * - a block type the config does not know draws nothing.
@@ -63,8 +65,15 @@ interface SlotProps {
63
65
  minEmptyHeight?: number;
64
66
  collisionAxis?: unknown;
65
67
  }
66
- /** A slot, as a block's `render` receives it. */
67
- type SlotComponent = (props?: SlotProps) => ReactElement;
68
+ /**
69
+ * A slot, as a block's `render` receives it. `blockCount` is how many blocks
70
+ * it draws (a type the config does not know is not counted) — so a block can
71
+ * choose what to draw without calling the slot. The editor's canvas gives the
72
+ * same number for the same document.
73
+ */
74
+ type SlotComponent = ((props?: SlotProps) => ReactElement) & {
75
+ readonly blockCount: number;
76
+ };
68
77
  interface DropZoneProps extends SlotProps {
69
78
  zone: string;
70
79
  }
@@ -1,5 +1,5 @@
1
- import{isRecord as t,fieldsFrom as n,slotLocations as e,setIn as r,isNode as o}from"../chunk-NKB3KVAB.js";import{jsx as a}from"react/jsx-runtime";function c({config:e,data:r,metadata:o={},className:c}){const s=Array.isArray(r?.content)?r.content:[],l=t(r?.root)?r.root:{},p="props"in l?l.props:l,m={config:e,content:s,zones:t(r?.zones)?r.zones:{},metadata:o},f={...p,puck:{renderDropZone:d(m,"root"),isEditing:!1,dragRef:null,metadata:o},title:p?.title||"",editMode:!1,id:"puck-root"},y=i(m,n(e.root),f),g=s.map(t=>u(m,t)),k=/* @__PURE__ */a("div",c?{className:c,children:g}:{children:g}),N=e.root?.render;return N?/* @__PURE__ */a(N,{...y,children:k}):k}function i(t,n,o){let a=o;for(const c of e(o,n))a=r(a,c.segments,s(t,c.content));return a}function s(t,e){return function(r={}){/* @__PURE__ */
2
- return a("div",{className:r.className,style:r.style,children:e.map(e=>function(t,e){if(!o(e))return null;const r=t.config.components[e.type];if(!r)return null;const c=i(t,n(r),e.props),s=r.render,u={...c.puck,metadata:t.metadata||{}};/* @__PURE__ */
3
- return a(s,{...c,puck:u},c.id)}(t,e))})}}function u(t,e){if(!o(e))return null;const r=t.config.components[e.type];if(!r)return null;const c=i(t,n(r),e.props),s=r.render,u={...c.puck,renderDropZone:d(t,c.id),metadata:{...t.metadata,...r.metadata}};/* @__PURE__ */
4
- return a(s,{...c,puck:u},c.id)}function d(t,n){return function({zone:e,className:r,style:o}){const c=`${n}:${e}`,i="root:default-zone"===c?t.content:t.zones[c],s=Array.isArray(i)?i:[];/* @__PURE__ */
5
- return a("div",{className:r,style:o,children:s.map(n=>u(t,n))})}}export{c as Render};
1
+ import{isRecord as n,fieldsFrom as t,slotLocations as e,setIn as o,drawnBlockCount as r,isNode as a}from"../chunk-L55YIXDC.js";import{jsx as c}from"react/jsx-runtime";function s({config:e,data:o,metadata:r={},className:a}){const s=Array.isArray(o?.content)?o.content:[],u=n(o?.root)?o.root:{},p="props"in u?u.props:u,m={config:e,content:s,zones:n(o?.zones)?o.zones:{},metadata:r},f={...p,puck:{renderDropZone:l(m,"root"),isEditing:!1,dragRef:null,metadata:r},title:p?.title||"",editMode:!1,id:"puck-root"},y=i(m,t(e.root),f),g=s.map(n=>d(m,n)),k=/* @__PURE__ */c("div",a?{className:a,children:g}:{children:g}),h=e.root?.render;return h?/* @__PURE__ */c(h,{...y,children:k}):k}function i(n,t,r){let a=r;for(const c of e(r,t))a=o(a,c.segments,u(n,c.content));return a}function u(n,e){return Object.assign(function(o={}){/* @__PURE__ */
2
+ return c("div",{className:o.className,style:o.style,children:e.map(e=>function(n,e){if(!a(e))return null;const o=n.config.components[e.type];if(!o)return null;const r=i(n,t(o),e.props),s=o.render,u={...r.puck,metadata:n.metadata||{}};/* @__PURE__ */
3
+ return c(s,{...r,puck:u},r.id)}(n,e))})},{blockCount:r(e,n.config.components)})}function d(n,e){if(!a(e))return null;const o=n.config.components[e.type];if(!o)return null;const r=i(n,t(o),e.props),s=o.render,u={...r.puck,renderDropZone:l(n,r.id),metadata:{...n.metadata,...o.metadata}};/* @__PURE__ */
4
+ return c(s,{...r,puck:u},r.id)}function l(n,t){return function({zone:e,className:o,style:r}){const a=`${t}:${e}`,s="root:default-zone"===a?n.content:n.zones[a],i=Array.isArray(s)?s:[];/* @__PURE__ */
5
+ return c("div",{className:o,style:r,children:i.map(t=>d(n,t))})}}export{s as Render};
@@ -0,0 +1,49 @@
1
+ /**
2
+ * A TEMPLATE DRAWN MANY TIMES (section parts plan §3.2, row B5, 2026-10-23).
3
+ *
4
+ * A data block (a product grid, a list of posts) holds ONE `template` slot of
5
+ * real blocks and draws it once per data row. So the same block ids are in the
6
+ * canvas several times. The host wraps each drawn copy:
7
+ *
8
+ * <div data-sf-repeat="<ownerId>:template" data-sf-repeat-index={i}>
9
+ *
10
+ * Index 0 is the MAIN copy. The blocks inside keep their real
11
+ * `data-puck-component` / `data-puck-dnd` ids in every copy, so a click on any
12
+ * copy selects the template block. What the canvas does with the copies:
13
+ * - the hover and the selected outline are drawn on every copy;
14
+ * - only the main copy's lists are drop targets (the others are pictures);
15
+ * - a lookup of one element by id reads the main copy.
16
+ *
17
+ * The two names are written HERE, once. The website draws the wrappers with
18
+ * them (it imports them from `efficient-easel/draw`, a render entry), so the
19
+ * string is never typed twice. Pure DOM, no import, nothing run at import.
20
+ *
21
+ * A page with no `data-sf-repeat` gets the same answers as before: every
22
+ * helper below falls back to the first match.
23
+ */
24
+ /** The wrapper round one drawn copy of a template: `"<ownerId>:<slot>"`. */
25
+ declare const REPEAT_ATTRIBUTE = "data-sf-repeat";
26
+ /** Which copy the wrapper holds: `"0"` is the main copy. */
27
+ declare const REPEAT_INDEX_ATTRIBUTE = "data-sf-repeat-index";
28
+ /**
29
+ * Is `el` in a copy that is NOT the main one — inside (or itself) a wrapper
30
+ * whose index is not 0, at any depth (a template inside a copy of an outer
31
+ * template is a copy too)? False for a block in no wrapper at all.
32
+ */
33
+ declare function isRepeatCopy(el: Element): boolean;
34
+ /** The main copy among `matches`: the first that is not a copy, else the first. */
35
+ declare function mainCopyOf<T extends Element>(matches: Iterable<T>): T | null;
36
+ /**
37
+ * `root.querySelector(selector)`, but the main copy when a template is drawn
38
+ * many times. With no `data-sf-repeat` it is exactly `querySelector`.
39
+ */
40
+ declare function queryMainCopy<T extends Element = Element>(root: ParentNode, selector: string): T | null;
41
+ /**
42
+ * The element for `selector` in every drawn copy: the main copy first, then
43
+ * each other copy in page order. With no `data-sf-repeat` it is the first
44
+ * match alone, as `querySelector` answers — a second element with the same id
45
+ * that is not a drawn copy is never added.
46
+ */
47
+ declare function queryAllCopies<T extends Element = Element>(root: ParentNode, selector: string): T[];
48
+
49
+ export { REPEAT_ATTRIBUTE as R, REPEAT_INDEX_ATTRIBUTE as a, queryMainCopy as b, isRepeatCopy as i, mainCopyOf as m, queryAllCopies as q };