efficient-easel 9.0.0 → 10.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 (50) hide show
  1. package/README.md +28 -0
  2. package/dist/chunk-26GHWMNN.js +21 -0
  3. package/dist/{chunk-CKBGJ53M.js → chunk-2AKW6UXX.js} +1 -1
  4. package/dist/{chunk-X5SPTRG3.js → chunk-4CE7XFCE.js} +1 -1
  5. package/dist/chunk-65Z5FSAW.js +6 -0
  6. package/dist/{chunk-W3BK5T4O.js → chunk-BPLCMQ6S.js} +50 -50
  7. package/dist/{chunk-EJZ4RIRW.js → chunk-GKGBKSZ7.js} +1 -1
  8. package/dist/{chunk-NMUS2VVD.js → chunk-K2YSFVOJ.js} +1 -1
  9. package/dist/{chunk-FJRAYUCX.js → chunk-LGDQLTJW.js} +5 -5
  10. package/dist/{chunk-GMXWP5XP.js → chunk-Q6AM43CA.js} +1 -1
  11. package/dist/chunk-RC25EGHD.js +5 -0
  12. package/dist/{chunk-CXLWPZZK.js → chunk-U5RF4USK.js} +3 -3
  13. package/dist/{chunk-GD7QFYER.js → chunk-XF2AIO46.js} +1 -1
  14. package/dist/chunk-XJCMEEBH.js +9 -0
  15. package/dist/{chunk-VNN6VB4V.js → chunk-XO7OUCZV.js} +1 -1
  16. package/dist/chunk-XTDBTCVO.js +5 -0
  17. package/dist/chunk-XWFH2NHZ.js +4 -0
  18. package/dist/copy/copy.css +26 -0
  19. package/dist/copy/index.d.ts +55 -3
  20. package/dist/copy/index.js +23 -20
  21. package/dist/easel/index.d.ts +1 -1
  22. package/dist/fields/index.d.ts +2 -2
  23. package/dist/fields/index.js +1 -1
  24. package/dist/panel/index.d.ts +1 -1
  25. package/dist/panel/index.js +18 -18
  26. package/dist/panel/panel.css +7 -4
  27. package/dist/screen/components/AddBlockRow.js +1 -1
  28. package/dist/screen/components/AddSidePanel.js +1 -1
  29. package/dist/screen/components/MediaSidePanel.js +1 -1
  30. package/dist/screen/components/ScreenChrome.js +1 -1
  31. package/dist/screen/components/ScreenMount.js +1 -1
  32. package/dist/screen/components/ScreenStoreProvider.js +1 -1
  33. package/dist/screen/components/SectionScreenShell.js +15 -15
  34. package/dist/screen/components/usePartBridge.js +1 -1
  35. package/dist/screen/index.js +1 -1
  36. package/dist/screen/lib/puck/use-section-ops.js +1 -1
  37. package/dist/screen/lib/screen-parts.js +1 -1
  38. package/dist/strings/catalogue.d.ts +1 -1
  39. package/dist/strings/catalogue.js +1 -1
  40. package/dist/strings/index.d.ts +1 -1
  41. package/dist/strings/index.js +1 -1
  42. package/dist/text-styles/index.js +13 -13
  43. package/dist/{types-OUl0mK1k.d.ts → types-C97TAUKi.d.ts} +16 -0
  44. package/dist/{words-DohP5ieg.d.ts → words-dsex49Jh.d.ts} +24 -0
  45. package/package.json +3 -3
  46. package/dist/chunk-GZH4UVDH.js +0 -8
  47. package/dist/chunk-NRC43NHG.js +0 -5
  48. package/dist/chunk-OZ72A6MY.js +0 -9
  49. package/dist/chunk-PEDDDWSG.js +0 -21
  50. package/dist/chunk-QLD57GBB.js +0 -6
@@ -1 +1 @@
1
- import{DEFAULT_TEXT_STYLES_WORDS as o}from"./chunk-M6F6LS3H.js";import{DEFAULT_PICK_WORDS as r}from"./chunk-ZAOM6PFH.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as t}from"./chunk-6WY6ZXJG.js";import{DEFAULT_SCREEN_WORDS as m}from"./chunk-JTUUIVBZ.js";import{DEFAULT_CANVAS_WORDS as n}from"./chunk-TBY3DFKS.js";import{DEFAULT_TREE_WORDS as c}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as s}from"./chunk-KFV7N2DJ.js";import{DEFAULT_NODE_MENU_WORDS as f}from"./chunk-WK3AFPXY.js";import{DEFAULT_SAVE_WORDS as p}from"./chunk-H6DDIBQ4.js";import{DEFAULT_CHROME_WORDS as e,DEFAULT_NOTICE_WORDS as i}from"./chunk-Z6PVRXVY.js";import{DEFAULT_LOCK_WORDS as u}from"./chunk-RE4LP46F.js";import{DEFAULT_RAIL_WORDS as k}from"./chunk-2OAZYSWJ.js";import{DEFAULT_COPY_WORDS as j}from"./chunk-GMXWP5XP.js";import{DEFAULT_FIELDS_WORDS as h}from"./chunk-FFYXVAAL.js";import{DEFAULT_DRAG_WORDS as l}from"./chunk-O2NLQBFX.js";var F={notice:i,lock:u,save:p,chrome:e,rail:k,tree:c,panel:s,fields:h,pick:r,drag:l,menu:f,styleClipboard:t,copy:j,canvas:n,textStyles:o,screen:m},a=o=>"object"==typeof o&&null!==o;function Y(o,r){const t={};for(const m of Object.keys(o)){const n=o[m],c=r[m];null==c?t[m]=n:a(n)?t[m]=a(c)?Y(n,c):n:t[m]=typeof c==typeof n?c:n}return t}function y(o,r){return r?Y(o,r):o}export{F as DEFAULT_EASEL_STRINGS,y as mergeEaselStrings};
1
+ import{DEFAULT_TEXT_STYLES_WORDS as o}from"./chunk-M6F6LS3H.js";import{DEFAULT_PICK_WORDS as r}from"./chunk-ZAOM6PFH.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as t}from"./chunk-6WY6ZXJG.js";import{DEFAULT_SCREEN_WORDS as m}from"./chunk-JTUUIVBZ.js";import{DEFAULT_CANVAS_WORDS as n}from"./chunk-TBY3DFKS.js";import{DEFAULT_TREE_WORDS as c}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as s}from"./chunk-KFV7N2DJ.js";import{DEFAULT_NODE_MENU_WORDS as f}from"./chunk-WK3AFPXY.js";import{DEFAULT_SAVE_WORDS as p}from"./chunk-H6DDIBQ4.js";import{DEFAULT_CHROME_WORDS as e,DEFAULT_NOTICE_WORDS as i}from"./chunk-Z6PVRXVY.js";import{DEFAULT_LOCK_WORDS as u}from"./chunk-RE4LP46F.js";import{DEFAULT_RAIL_WORDS as k}from"./chunk-2OAZYSWJ.js";import{DEFAULT_COPY_WORDS as j}from"./chunk-Q6AM43CA.js";import{DEFAULT_FIELDS_WORDS as h}from"./chunk-FFYXVAAL.js";import{DEFAULT_DRAG_WORDS as l}from"./chunk-O2NLQBFX.js";var F={notice:i,lock:u,save:p,chrome:e,rail:k,tree:c,panel:s,fields:h,pick:r,drag:l,menu:f,styleClipboard:t,copy:j,canvas:n,textStyles:o,screen:m},a=o=>"object"==typeof o&&null!==o;function Y(o,r){const t={};for(const m of Object.keys(o)){const n=o[m],c=r[m];null==c?t[m]=n:a(n)?t[m]=a(c)?Y(n,c):n:t[m]=typeof c==typeof n?c:n}return t}function y(o,r){return r?Y(o,r):o}export{F as DEFAULT_EASEL_STRINGS,y as mergeEaselStrings};
@@ -0,0 +1,9 @@
1
+ import{Segmented as e,Switch as a,Tooltip as l}from"efficient-shell/ui";import{jsx as s,jsxs as i,Fragment as n}from"react/jsx-runtime";import{isValidElement as r,cloneElement as d}from"react";function c({options:a,value:n,onChange:r,ariaLabel:d,fit:c,disabled:t=!1,className:o}){const h=c&&function(e,a){return{"--es-fit-count":e,"--es-fit-labels":`${a.labelsPx}px`,"--es-fit-widest":`${a.widestLabelPx}px`}}(a.length,c),u=a.findIndex(e=>e.id===n);
2
+ /* @__PURE__ */
3
+ return s("div",{className:"es-segs-fit","data-disabled":t||void 0,style:h,children:/* @__PURE__ */s(e,{size:"sm",label:d,className:`es-segs${h?" is-measured":""}${o?` ${o}`:""}`,value:u<0?"":String(u),onChange:e=>r(a[Number(e)].id),options:a.map((e,a)=>{const n=e.title??("string"==typeof e.label?e.label:void 0),r="string"!=typeof e.label,d=a=>n&&(e.icon||r)?/* @__PURE__ */s(l,{content:n,children:a}):a;return{value:String(a),disabled:t||!0===e.disabled,icon:e.icon?d(
4
+ /* @__PURE__ */s("span",{className:"es-seg-icon","aria-hidden":"true",children:e.icon})):void 0,label:r?/* @__PURE__ */i("span",{className:"es-seg-word",children:[d(/* @__PURE__ */s("span",{"aria-hidden":"true",children:e.label})),
5
+ /* @__PURE__ */s("span",{className:"es-vh",children:n})]}):/* @__PURE__ */s("span",{className:"es-seg-word",children:e.label})}})})})}function t({checked:e,onChange:l,disabled:i,id:n,ariaLabel:r,ariaLabelledBy:d,className:c}){/* @__PURE__ */
6
+ return s(a,{size:"sm",id:n,checked:e,"aria-label":r,"aria-labelledby":d,disabled:i,className:c?`es-switch ${c}`:"es-switch",onChange:l})}function o(e){return Array.isArray(e)?e.some(o):r(e)}function h(e,a,l){if(!r(e)||e.type!==t)return e;const s=e.props;return s.ariaLabel||s.ariaLabelledBy?e:d(e,l?{ariaLabelledBy:l}:{ariaLabel:a})}function u({label:e,labelId:a,icon:l,value:r,hint:d,changed:c,htmlFor:t,action:u,children:m,className:b}){const f=o(m),p=o(u);if(!f&&!p)return null;const N=["es-field"];f||N.push("is-inline"),c&&N.push("is-changed"),b&&N.push(b);const g=/* @__PURE__ */i(n,{children:[l?/* @__PURE__ */s("span",{className:"es-field-icon","aria-hidden":"true",children:l}):null,
7
+ /* @__PURE__ */s("span",{className:"es-field-label",id:a,children:e})]});/* @__PURE__ */
8
+ return i("div",{className:N.join(" "),children:[
9
+ /* @__PURE__ */i("div",{className:"es-field-head",children:[t?/* @__PURE__ */s("label",{className:"es-field-name",htmlFor:t,children:g}):/* @__PURE__ */s("span",{className:"es-field-name",children:g}),null!=r?/* @__PURE__ */s("span",{className:"es-field-value",children:r}):null,p?h(u,e,a):null]}),f?/* @__PURE__ */s("div",{className:"es-field-ctl",children:m}):null,d?/* @__PURE__ */s("p",{className:"es-field-hint",children:d}):null]})}export{u as SettingsField,c as SettingsSegmented,t as SettingsSwitch};
@@ -1 +1 @@
1
- import{useSectionOps as o}from"./chunk-NMUS2VVD.js";import{decodePartId as e,encodePartId as r}from"./chunk-IYT6NN2J.js";import{usePreviewParts as t}from"./chunk-I54UCYOU.js";import{SELECTION_MODE as n}from"./chunk-FJRAYUCX.js";import{useEasel as p}from"./chunk-K5744MTM.js";import{useCallback as d,useEffect as c}from"react";var s=o=>"part"===o.kind;function m({mode:m,setMode:i,onOpenPart:a}){const{getSelectorForId:u}=p(o=>o),I=o(),{setSelectedPartId:f,setSelectHandler:k}=t(),l=d(o=>{const r=e(o);if(!r)return;const{nodeId:t,propKey:p}=r;p?(i(o=>s(o)&&o.nodeId===t&&o.propKey===p?o:{kind:"part",nodeId:t,propKey:p}),a?.(t)):i(o=>"part"===o.kind?n:o)},[i,a]);c(()=>{k(l)},[k,l]);const h=s(m)?r(m.nodeId,m.propKey):null;c(()=>{f(h)},[h,f]);return{selectNode:d(o=>{i(()=>n);const e=u(o);e&&I.select(e)},[i,u,I]),openPartId:h}}export{m as usePartBridge};
1
+ import{useSectionOps as o}from"./chunk-K2YSFVOJ.js";import{decodePartId as e,encodePartId as r}from"./chunk-IYT6NN2J.js";import{usePreviewParts as t}from"./chunk-I54UCYOU.js";import{SELECTION_MODE as n}from"./chunk-LGDQLTJW.js";import{useEasel as p}from"./chunk-K5744MTM.js";import{useCallback as d,useEffect as c}from"react";var s=o=>"part"===o.kind;function m({mode:m,setMode:i,onOpenPart:a}){const{getSelectorForId:u}=p(o=>o),I=o(),{setSelectedPartId:f,setSelectHandler:k}=t(),l=d(o=>{const r=e(o);if(!r)return;const{nodeId:t,propKey:p}=r;p?(i(o=>s(o)&&o.nodeId===t&&o.propKey===p?o:{kind:"part",nodeId:t,propKey:p}),a?.(t)):i(o=>"part"===o.kind?n:o)},[i,a]);c(()=>{k(l)},[k,l]);const K=s(m)?r(m.nodeId,m.propKey):null;c(()=>{f(K)},[K,f]);return{selectNode:d(o=>{i(()=>n);const e=u(o);e&&I.select(e)},[i,u,I]),openPartId:K}}export{m as usePartBridge};
@@ -0,0 +1,5 @@
1
+ import{buildPaletteSections as e,pinnedSection as t,paletteWithoutPinned as o,categoryLabel as n}from"./chunk-PA3PNTVV.js";import{blockTypesIn as i}from"./chunk-5ZBY24K7.js";import{sectionTemplatesOf as s}from"./chunk-BVN33R76.js";import{SidePanelHead as r,PanelModeExit as c}from"./chunk-PPL7GB7D.js";import{useEaselSession as l}from"./chunk-O7Q4DDJT.js";import{blockRuns as a}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as p,useScreenBlockRules as m}from"./chunk-LGDQLTJW.js";import{DEFAULT_SCREEN_WORDS as d}from"./chunk-JTUUIVBZ.js";import{useEasel as f}from"./chunk-K5744MTM.js";import{useWords as u}from"./chunk-MFIRYGHW.js";import{AddPanel as k}from"./chunk-FCLW4LEN.js";import{DEFAULT_DRAG_WORDS as y}from"./chunk-O2NLQBFX.js";import{useState as h,useEffect as b,useMemo as j}from"react";import{AddIcon as g}from"efficient-shell/icons/efficient";import{jsx as B,jsxs as L,Fragment as $}from"react/jsx-runtime";var O=e=>`section:${e}`,v=e=>`block:${e}`,x=e=>`template:${e}`;function I({blocks:I,blocksOnly:N,at:T,sectionAccepts:V,onAdd:A,itemFor:D,session:F,siteWide:C,onClose:H,onHide:P,readOnly:Q}){const W=f(e=>e.config),w=p(),{labelAtLevel:G,categoryLabel:J,firstSection:M,Icon:R,Thumbnail:z}=w,{blockIsOffered:E}=m(),K=u("screen",d).add,S=u("drag",y).add,U=l(),[Y,Z]=h([]);b(()=>{let e=!1;const t=e=>E(e,U);return s(U).list().then(o=>{if(e)return;const n=W.components;Z(o.filter(e=>e.node?.type&&n[e.node.type]&&i(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[W,U]);const X=j(()=>e(W,w),[W]),q=e=>({type:O(e.type),label:e.name,cover:/* @__PURE__ */B(z,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:K.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),_=j(()=>{const e=[];if(I&&I.choices.length>0&&a(I.choices).forEach((t,o)=>{e.push({key:`blocks:${o}`,title:0===o?`${K.inside({name:I.parentName})}${t.group?` · ${t.group}`:""}`:t.group??"",tiles:t.items.map(e=>({type:v(e.type),label:e.label,icon:/* @__PURE__ */B(R,{type:e.type,size:18}),title:K.tile({name:e.label})}))})}),N)return e;const i=e=>!V||V(e),s=t(X,M);s&&i(s.type)&&e.push({key:"start",title:K.startBlank,tiles:[q(s)]});const r=Y.filter(e=>i(e.node.type));r.length>0&&e.push({key:"templates",title:K.templates,tiles:r.map(e=>{return{type:x(e.id),label:e.name,cover:/* @__PURE__ */B(z,{type:e.node.type}),keywords:[(t=e.node.type,G(t,"section",W.components[t]?.label??t)),e.node.type]};var t})});const c=o(X,M);for(const t of Object.keys(W.categories??{})){const o=c.filter(e=>e.cat===t&&i(e.type));0!==o.length&&e.push({key:`category:${t}`,title:n(W,t,J),tiles:o.map(q)})}return e},[I,N,Y,X,W,K,V]),ee=e=>{const t=e.indexOf(":"),o=e.slice(0,t),n=e.slice(t+1);if("section"===o)return{kind:"section",type:n};if("block"===o)return{kind:"block",type:n};if("template"===o){const e=Y.find(e=>e.id===n);return e?{kind:"template",template:e}:null}return null};/* @__PURE__ */
2
+ return L($,{children:[
3
+ /* @__PURE__ */B(r,{icon:/* @__PURE__ */B(g,{size:15}),title:K.title,context:N?K.contextBlocks:K.contextAll,actions:/* @__PURE__ */B(c,{label:K.done,description:K.doneDescription,onClick:H}),onHide:P}),
4
+ /* @__PURE__ */L("div",{className:"sf-addside sf-scroll",children:[
5
+ /* @__PURE__ */B(k,{groups:_,session:F,itemFor:e=>D(ee(e)??{kind:"section",type:e}),onInsert:e=>{const t=ee(e);t&&A(t)},at:T,hint:N?K.hintBlocks:K.hint,searchLabel:N?K.searchBlocks:K.searchSections,readOnly:Q,words:S}),C&&!N?C:null]})]})}export{I as AddSidePanel,v as blockKey,O as sectionKey,x as templateKey};
@@ -0,0 +1,4 @@
1
+ import{Slider as e}from"efficient-shell/ui";import{useId as i,useRef as o}from"react";import{jsxs as t,jsx as r}from"react/jsx-runtime";function n({id:n,label:l,value:a,onChange:d,min:s,max:u,step:m=1,shiftStep:v,styleValue:p,unit:f,sliderMin:c,sliderMax:h,auto:b,readOnly:x=!1}){const y=i(),N=n??y,C="number"==typeof a&&Number.isFinite(a)?a:void 0,g=void 0!==b&&void 0===C,F=!g&&void 0===C&&void 0!==p,I=Number((c-m).toFixed(6)),M=o(!1),S=e=>{M.current="range"===e.target.type},V=e=>{x||e===C||d(e)};/* @__PURE__ */
2
+ return t("div",{className:"es-fslider"+(F||g?" is-style":""),onChangeCapture:S,onKeyDownCapture:S,onPointerDownCapture:S,children:[
3
+ /* @__PURE__ */r("label",{className:"es-fslider-name",htmlFor:N,children:l}),
4
+ /* @__PURE__ */r(e,{id:N,label:l,value:C??null,onChange:e=>{if(null===e)return V(void 0);V(void 0!==b&&M.current&&e<c?void 0:e)},min:void 0!==b?I:c,max:h,inputMin:s??-1e9,inputMax:u??Number.POSITIVE_INFINITY,step:m,shiftStep:v,suffix:f&&!g?f:void 0,emptyLabel:b??(void 0===p?"":void 0),placeholderValue:void 0===b?p:void 0,stepFrom:void 0!==b?I:void 0,disabled:x,size:"sm"})]})}export{n as FieldSlider};
@@ -506,3 +506,29 @@
506
506
  text-overflow: ellipsis;
507
507
  white-space: nowrap;
508
508
  }
509
+
510
+ /* — the one text panel (`TextPartPanel`, text panel v3; wave 2 · E2) — */
511
+ /* The rows are the panel's own `SettingsField`s (panel.css); only what is the
512
+ text panel's is said here. The cells sit between Font and Alignment at the
513
+ panel's row rhythm, the same room a row has above it. */
514
+ .es-tpp > .es-copy-cells-fit {
515
+ margin-top: max(var(--es-row-gap), var(--es-rhythm-between));
516
+ margin-bottom: 0;
517
+ }
518
+ .es-tpp-kept {
519
+ margin-bottom: var(--es-space-8, 8px);
520
+ }
521
+ /* `Font [Inter ▾] [I]`: the font takes the row, the Italic button its end. */
522
+ .es-tpp-font {
523
+ display: flex;
524
+ align-items: center;
525
+ gap: var(--es-space-4, 4px);
526
+ /* `.es-field-ctl` is a flex row: without a width this row sizes to its
527
+ content and the font box stops short of the I (measured at 320 and 220). */
528
+ width: 100%;
529
+ min-width: 0;
530
+ }
531
+ .es-tpp-font-select {
532
+ flex: 1;
533
+ min-width: 0;
534
+ }
@@ -1,11 +1,13 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
3
  import { MarkStyle, MarkupTool, WrapResult, InlineRule, MarkedLine } from '../markup/index.js';
4
- import { C as CopyWords, a as CopyAlign } from '../words-DohP5ieg.js';
5
- export { b as COPY_ALIGNS, c as COPY_ALIGN_FIT, d as COPY_ALIGN_GLYPHS, e as COPY_ALIGN_LABELS, f as copyAlignOptions } from '../words-DohP5ieg.js';
4
+ import { C as CopyWords, a as CopyAlign } from '../words-dsex49Jh.js';
5
+ export { b as COPY_ALIGNS, c as COPY_ALIGN_FIT, d as COPY_ALIGN_GLYPHS, e as COPY_ALIGN_LABELS, f as copyAlignOptions } from '../words-dsex49Jh.js';
6
6
  import { TextToolbarCase, TextToolbarMark } from 'efficient-shell/ui';
7
7
  export { TextToolbar, TextToolbarProps } from 'efficient-shell/ui';
8
+ import { g as FieldOption } from '../types-C97TAUKi.js';
8
9
  export { C as CanvasTypingEnd, a as CanvasTypingOptions, b as CanvasTypingSession, T as TextMap, s as startCanvasTyping, t as textMap } from '../canvas-typing-Cnvlsh_V.js';
10
+ import '../buckets-Tj-nkBpg.js';
9
11
 
10
12
  type CellWords = NonNullable<CopyWords['cells']>;
11
13
  interface CopyCell {
@@ -398,6 +400,56 @@ interface CopyBoxProps {
398
400
 
399
401
  declare function CopyBox({ value, onChange, onCommit, onCancel, multiline, placeholder, ariaLabel, className, readOnly, rules, tools, writeMark, actions, align, glyphs, barLabel, renderFooter, inputRef, barShows, richText, defaultShowMarks, toolbar, colors, cells, letterCase, lastTool, }: CopyBoxProps): react.JSX.Element;
400
402
 
403
+ /** Whether the lines are a list, and which kind. */
404
+ type TextList = 'none' | 'bullet' | 'number';
405
+ /** How the letters are drawn: as typed, all capitals, each word capitalized, all small. */
406
+ type TextCase = 'none' | 'upper' | 'capitalize' | 'lower';
407
+ /** A strip row: the box's own answer (`''` = follows the style) and the style's. */
408
+ interface TextPartStrip<V extends string> {
409
+ value: V | '';
410
+ styleValue?: V;
411
+ onChange: (next: V | '') => void;
412
+ }
413
+ interface TextPartPanelProps {
414
+ /** The kept box, on top: a `CopyBox` for words the canvas cannot take. */
415
+ kept?: CopyBoxProps;
416
+ style?: {
417
+ value: string;
418
+ /** The site's (or the email's) text styles. `description` is the second
419
+ * line, the style's weight. */
420
+ options: readonly FieldOption<string>[];
421
+ onChange: (next: string) => void;
422
+ /** This box differs from its style: the field shows "*". */
423
+ changed?: boolean;
424
+ /** Footer actions; one the host does not hand is not drawn. */
425
+ onClearChanges?: () => void;
426
+ onEditStyles?: () => void;
427
+ onUpdateStyle?: () => void;
428
+ };
429
+ font?: {
430
+ /** The box's own font, `''` while it follows the style. */
431
+ value: string;
432
+ styleValue?: string;
433
+ options: readonly FieldOption<string>[];
434
+ onChange: (next: string) => void;
435
+ /** A long list (the website's fonts): the field is a search. */
436
+ searchable?: boolean;
437
+ };
438
+ /** The Italic button at the end of the Font row. `undefined` follows the style. */
439
+ italic?: {
440
+ value: boolean | undefined;
441
+ styleValue?: boolean;
442
+ onChange: (next: boolean | undefined) => void;
443
+ };
444
+ cells?: readonly CopyCell[];
445
+ align?: TextPartStrip<CopyAlign> & {
446
+ allow?: readonly CopyAlign[];
447
+ };
448
+ list?: TextPartStrip<TextList>;
449
+ letterCase?: TextPartStrip<TextCase>;
450
+ }
451
+ declare function TextPartPanel({ kept, style, font, italic, cells, align, list, letterCase }: TextPartPanelProps): react.JSX.Element;
452
+
401
453
  interface PasteData {
402
454
  /** The clipboard's `text/html`, when there is one. */
403
455
  html?: string;
@@ -648,4 +700,4 @@ interface CaretEdit {
648
700
  */
649
701
  declare function useCaretEdit({ target, onChange }: CaretEdit): (edit: (el: HTMLInputElement | HTMLTextAreaElement | null) => WrapResult) => void;
650
702
 
651
- export { COPY_CELLS, type CaretEdit, ColorWindow, CopyAlign, CopyBox, type CopyBoxAlign, type CopyBoxFooter, type CopyBoxLastTool, type CopyBoxProps, type CopyCase, type CopyCell, type CopyCellPreset, CopyCells, type CopyThemeColor, CopyWords, type History, MARKUP_CLIPBOARD_TYPE, MarkBar, type MarkBarProps, type MarkWriter, type PasteData, type PasteOptions, RichBox, type RichBoxProps, type RichEdit, type RichHandle, type RichInputEvent, type RichInputResult, type RichInsert, type RichLayout, type RichLine, type RichPending, type SelectionSource, type Snapshot, TYPING_BURST_MS, type TextAreaHandle, type TextBoxHandle, type ToolbarMark, ariaShortcut, createHistory, editVisible, insertSelection, markSelection, markupOfRange, newLine, pasteToMarkup, richInput, richLayout, selectionToSource, selectionToVisible, setBullet, toSource, toSourceStart, toVisible, useCaretEdit };
703
+ export { COPY_CELLS, type CaretEdit, ColorWindow, CopyAlign, CopyBox, type CopyBoxAlign, type CopyBoxFooter, type CopyBoxLastTool, type CopyBoxProps, type CopyCase, type CopyCell, type CopyCellPreset, CopyCells, type CopyThemeColor, CopyWords, type History, MARKUP_CLIPBOARD_TYPE, MarkBar, type MarkBarProps, type MarkWriter, type PasteData, type PasteOptions, RichBox, type RichBoxProps, type RichEdit, type RichHandle, type RichInputEvent, type RichInputResult, type RichInsert, type RichLayout, type RichLine, type RichPending, type SelectionSource, type Snapshot, TYPING_BURST_MS, type TextAreaHandle, type TextBoxHandle, type TextCase, type TextList, TextPartPanel, type TextPartPanelProps, type TextPartStrip, type ToolbarMark, ariaShortcut, createHistory, editVisible, insertSelection, markSelection, markupOfRange, newLine, pasteToMarkup, richInput, richLayout, selectionToSource, selectionToVisible, setBullet, toSource, toSourceStart, toVisible, useCaretEdit };
@@ -1,20 +1,23 @@
1
- import{DEFAULT_COPY_WORDS as e}from"../chunk-GMXWP5XP.js";import{selectionToVisible as t,selectionToSource as n,richLayout as r,createHistory as l,markPress as o,pasteToMarkup as a,richInput as s,editVisible as i,MARKUP_CLIPBOARD_TYPE as c,markupOfRange as u}from"../chunk-WQASXLXS.js";export{MARKUP_CLIPBOARD_TYPE,TYPING_BURST_MS,createHistory,editVisible,markupOfRange,newLine,pasteToMarkup,richInput,richLayout,selectionToSource,selectionToVisible,setBullet,startCanvasTyping,textMap,toSource,toSourceStart,toVisible}from"../chunk-WQASXLXS.js";import{FieldNumber as d}from"../chunk-66LWADFP.js";import{SettingsSegmented as p,SettingsSwitch as f}from"../chunk-QLD57GBB.js";import"../chunk-FFYXVAAL.js";import{GoldTextInput as h}from"../chunk-2FZJWH24.js";import{RETIRED_MARKS as m,applyMark as g,markupTools as y,marksIn as v,STANDARD_MARKUP as b,findLink as k,markedAt as x,listIn as w,colorIn as S,spanFor as E,clearStyle as C,toggleMark as D,colorOver as N,setList as L,unlinkAt as T,removeLink as M,linkOver as P,writeLink as R}from"../chunk-546BBOPE.js";import{useWords as B}from"../chunk-MFIRYGHW.js";import{withTip as O}from"../chunk-P2VEMZH5.js";import{Tooltip as z,ColorSwatch as $,ColorPickerPanel as F,Button as K,IconButton as W,registerModalEscapeInterceptor as j,textToolbarRows as H,TextToolbar as A,LinkPicker as V}from"efficient-shell/ui";export{TextToolbar}from"efficient-shell/ui";import{useRef as I,useState as X,useLayoutEffect as U,useEffect as q,useId as Y}from"react";import{AlignJustifyIcon as G,AlignRightIcon as _,AlignCenterIcon as Q,AlignLeftIcon as Z,ParagraphSpacingIcon as J,LetterSpacingIcon as ee,LineSpacingIcon as te,TextSizeIcon as ne,ClearMarksIcon as re,LinkIcon as le,QuietIcon as oe,EmphasisIcon as ae,StrikeIcon as se,ItalicIcon as ie,BoldIcon as ce}from"efficient-shell/icons/efficient";import{jsx as ue,jsxs as de,Fragment as pe}from"react/jsx-runtime";var fe=["left","center","right","justify"],he=e.align,me={left:/* @__PURE__ */ue(Z,{}),center:/* @__PURE__ */ue(Q,{}),right:/* @__PURE__ */ue(_,{}),justify:/* @__PURE__ */ue(G,{})},ge={three:{labelsPx:94.5,widestLabelPx:39.94},four:{labelsPx:140,widestLabelPx:44}};function ye(e,t=he){return fe.filter(t=>e.includes(t)).map(e=>({id:e,label:t[e],icon:me[e],title:t[e]}))}var ve=/[\u1100-\u11ff\u2e80-\u9fff\uac00-\ud7af\uf900-\ufaff\uff00-\uffef]/;function be(e){if(e.every(e=>e.label===he[e.id]))return e.length>3?ge.four:ge.three;const t=e.map(e=>[...e.label].reduce((e,t)=>e+(ve.test(t)?13:8),0));return{labelsPx:t.reduce((e,t)=>e+t,0),widestLabelPx:Math.max(0,...t)}}function ke(e,t){const n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}}function xe(e,t,n,r=g){const{start:l,end:o}=ke(e,n);return r(e,l,o,t)}function we(e,t,n){const{start:r,end:l}=ke(e,n),o=r+t.length;return{text:e.slice(0,r)+t+e.slice(l),selectionStart:o,selectionEnd:o}}function Se(e,t,n,r){switch(t){case"bold":return e.createElement("strong");case"italic":return e.createElement("em");case"strike":return e.createElement("s");case"underline":return e.createElement("u");case"sup":return e.createElement("sup");case"sub":return e.createElement("sub");case"color":{const t=e.createElement("span");return t.className="es-rich-color",r&&(t.dataset.color=r,t.title=r.startsWith("#")?r.toUpperCase():r,t.style.color=r.startsWith("#")?r:`var(--es-color-${r}, inherit)`),t}case"link":{const t=e.createElement("a");return t.className="es-rich-link",n&&(t.title=n),t}default:{const n=e.createElement("span");return n.className="highlight"===t||"accent"===t?"es-rich-emphasis":`es-rich-${t}`,n}}}function Ee(e,t,n,r){const l=e.layout.lines;if(n===t)return r>=e.lines.length?e.layout.text.length:l[r].vis;const o=e.lines.findIndex(e=>e===n||e.contains(n));if(-1===o)return 0;const a=t.ownerDocument.createRange();a.setStart(e.lines[o],0);try{a.setEnd(n,r)}catch{return l[o].vis}return l[o].vis+Math.min(a.toString().length,l[o].text.length)}function Ce(e,t){const n=e.layout.lines;let r=n.length-1;for(let e=0;e<n.length;e+=1)if(t<=n[e].vis+n[e].text.length){r=e;break}let l=Math.max(0,t-n[r].vis);const o=e.lines[r].ownerDocument.createTreeWalker(e.lines[r],4);let a=o.nextNode(),s=null;for(;a;){if(l<=a.data.length)return[a,l];l-=a.data.length,s=a,a=o.nextNode()}return s?[s,s.data.length]:[e.lines[r],0]}function De({value:e,rules:l,multiline:o,readOnly:d=!1,placeholder:p,ariaLabel:f,handle:h,onEdit:m,onSelect:g,onHistory:y,onFormat:v,pending:b,onCommit:k,onCancel:x}){const w=I(null),S=I(null),E=I(null),C=I(null),D=I(null),N=I(e),[L,T]=X(0),M=I({value:e,rules:l,multiline:o,readOnly:d,pending:b,onEdit:m,onHistory:y,onFormat:v});M.current={value:e,rules:l,multiline:o,readOnly:d,pending:b,onEdit:m,onHistory:y,onFormat:v};const P=()=>{const e=w.current,t=S.current,n=e?.ownerDocument.getSelection();if(!(e&&t&&n&&0!==n.rangeCount&&n.anchorNode&&e.contains(n.anchorNode)))return null;const r=Ee(t,e,n.anchorNode,n.anchorOffset),l=n.focusNode&&e.contains(n.focusNode)?Ee(t,e,n.focusNode,n.focusOffset):r;return r<=l?[r,l]:[l,r]},R=(e,t)=>{const n=w.current,r=S.current;if(!n||!r)return;const[l,o]=Ce(r,e),[a,s]=Ce(r,t);n.ownerDocument.getSelection()?.setBaseAndExtent(l,o,a,s)};h.current={getSource(){const e=P(),t=S.current;if(!e||!t)return null;const[r,l]=n(t.layout,e[0],e[1]);return{start:r,end:l}},setSource(e,t,n){C.current={text:n,src:[e,t]},T(e=>e+1)},focus(){w.current?.focus()},rangeOf(e,n){const r=w.current,l=S.current;if(!r||!l)return null;const[o,a]=t(l.layout,e,n),[s,i]=Ce(l,o),[c,u]=Ce(l,a),d=r.ownerDocument.createRange();return d.setStart(s,i),d.setEnd(c,u),d}},U(()=>{const n=w.current;if(!n||D.current)return;const o=C.current?null:P();S.current=function(e,t){const n=e.ownerDocument;e.replaceChildren();const r=t.lines.map(t=>{const r=n.createElement("div");r.className=null!=t.number?"es-rich-line is-numbered":t.bullet?"es-rich-line is-bullet":"es-rich-line",null!=t.number&&(r.dataset.number=t.number);const l=[],o=()=>l.length?l[l.length-1].el:r;let a=null;for(const e of t.chars){let t=0;for(;t<l.length&&t<e.marks.length&&l[t].id===e.marks[t].id;)t+=1;(l.length>t||e.marks.length>t)&&(a=null),l.length=t;for(let r=t;r<e.marks.length;r+=1){const t=Se(n,e.marks[r].kind,e.marks[r].href,e.marks[r].color);o().appendChild(t),l.push({id:e.marks[r].id,el:t})}a||(a=n.createTextNode(""),o().appendChild(a)),a.data+=e.ch}return 0===t.chars.length&&r.appendChild(n.createElement("br")),e.appendChild(r),r});return{layout:t,lines:r}}(n,r(e,l)),E.current=e;const a=C.current;if(!a||a.text!==e)return void(o&&n.ownerDocument.activeElement===n&&R(o[0],Math.min(o[1],S.current.layout.text.length)));C.current=null;const s=S.current.layout,[i,c]=a.vis??t(s,a.src[0],a.src[1]);n.ownerDocument.activeElement!==n&&n.focus(),R(i,c)},[e,l,L]);const B=(e,t,r)=>{const l=S.current,[o,a]=n(l.layout,t[0],t[1]);C.current={text:e.text,vis:[e.caret,e.caret]},e.text!==M.current.value?M.current.onEdit(e.text,{start:o,end:a},r):T(e=>e+1)};q(()=>{const e=w.current;if(!e)return;const t=t=>{const{value:n,rules:r,multiline:l,readOnly:o,pending:a}=M.current;if("insertCompositionText"===t.inputType)return;if(t.preventDefault(),o)return;const i=S.current,c=P();if(!i||!c)return;const u="function"==typeof t.getTargetRanges?t.getTargetRanges()[0]:void 0,d=u&&!u.collapsed?[Ee(i,e,u.startContainer,u.startOffset),Ee(i,e,u.endContainer,u.endOffset)]:null,p=s({value:n,rules:r,multiline:l,inputType:t.inputType,data:t.data??t.dataTransfer?.getData("text/plain")??"",html:t.dataTransfer?.getData("text/html"),doc:e.ownerDocument,sel:c,target:d,pending:a});p&&("history"!==p.kind?"format"!==p.kind?B(p.edit,p.range,p.kind):M.current.onFormat(p.style):M.current.onHistory(p.dir))},n=()=>{D.current||T(e=>e+1)};return e.addEventListener("beforeinput",t),e.addEventListener("input",n),()=>{e.removeEventListener("beforeinput",t),e.removeEventListener("input",n)}},[]),q(()=>{const e=w.current;if(!e)return;const t=e.ownerDocument,n=()=>{const e=h.current?.getSource();e&&g(e)};return t.addEventListener("selectionchange",n),()=>t.removeEventListener("selectionchange",n)});const O=(t,n=!1)=>{const r=P();if(!r||r[0]===r[1])return;t.preventDefault();const o=S.current;t.clipboardData.setData("text/plain",o.layout.text.slice(r[0],r[1])),t.clipboardData.setData(c,u(e,l,r[0],r[1])),n&&!d&&B(i(e,l,r[0],r[1],{text:""}),r,"edit")};/* @__PURE__ */
2
- return de("div",{className:"es-rich-wrap",children:[p&&""===e?/* @__PURE__ */ue("div",{className:"es-rich-placeholder","aria-hidden":"true",children:p}):null,
3
- /* @__PURE__ */ue("div",{ref:w,className:`es-rich${o?" is-multiline":" is-single"}${d?" is-off":""}`,contentEditable:!d,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":o,"aria-label":f,"aria-readonly":d||void 0,"aria-placeholder":p,tabIndex:d?-1:0,spellCheck:!0,onFocus:()=>{N.current=e},onBlur:()=>{e!==N.current&&k?.(e),N.current=e},onKeyDown:t=>{if("Escape"===t.key)return t.preventDefault(),x?.(N.current),void(N.current=e);"Enter"!==t.key||o||(t.preventDefault(),e!==N.current&&k?.(e),N.current=e)},onCompositionStart:()=>{const e=P()??[0,0];D.current={from:e[0],to:e[1]}},onCompositionEnd:e=>{const t=D.current;if(D.current=null,!t)return;const{value:n,rules:r,pending:l}=M.current;e.data?B(i(n,r,t.from,t.to,{text:e.data,add:l?.add,drop:l?.drop,color:l?.color}),[t.from,t.to],"type"):T(e=>e+1)},onCopy:e=>O(e),onCut:e=>O(e,!0),onPaste:t=>{if(t.preventDefault(),d)return;const n=P();if(!n)return;const r=t.clipboardData.getData(c),s=r?o?r:r.replace(/\s*\r?\n\s*/g," "):a({html:t.clipboardData.getData("text/html"),text:t.clipboardData.getData("text/plain")},{doc:t.currentTarget.ownerDocument,multiline:o,rules:l});B(i(e,l,n[0],n[1],{markup:s}),n,"edit")}})]})}var Ne={fontSize:{key:"fontSize",nameKey:"fontSize",icon:/* @__PURE__ */ue(ne,{}),unit:"px",step:1,shiftStep:10,min:5},lineHeight:{key:"lineHeight",nameKey:"lineHeight",icon:/* @__PURE__ */ue(te,{}),unit:"%",step:1,shiftStep:10,min:50,max:250,scale:100},letterSpacing:{key:"letterSpacing",nameKey:"letterSpacing",icon:/* @__PURE__ */ue(ee,{}),unit:"px",step:.1,shiftStep:1,min:-10},paragraphSpacing:{key:"paragraphSpacing",nameKey:"paragraphSpacing",icon:/* @__PURE__ */ue(J,{}),unit:"px",step:1,shiftStep:10,min:0}};function Le(e,t){return void 0===e?void 0:Number((e*t).toFixed(6))}function Te({cells:t,words:n,readOnly:r=!1}){const l=n??e.cells,o=Y();/* @__PURE__ */
4
- return ue("div",{className:"es-copy-cells-fit",children:/* @__PURE__ */ue("div",{className:"es-copy-cells",children:t.map(e=>{const t=e.scale??1,n=e.name??(e.nameKey?l[e.nameKey]:e.key),a=e.unit??"",s=e.step??1,i=`${o}-${e.key}`;/* @__PURE__ */
5
- return de("div",{className:"es-copy-cell",children:[
6
- /* @__PURE__ */ue("label",{className:"es-field-label es-copy-cell-name",htmlFor:i,children:n}),
7
- /* @__PURE__ */ue(d,{id:i,value:Le(e.value,t),styleValue:Le(e.styleValue,t),onChange:n=>e.onChange(void 0===n?void 0:Number((n/t).toFixed(6))),min:e.min,max:e.max,step:s,shiftStep:e.shiftStep,icon:e.icon,unit:a||void 0,steppers:"compact",readOnly:r,ariaLabel:n,title:l.tip({name:n,step:s,unit:a})})]},e.key)})})})}var Me=e=>e.preventDefault();function Pe({colors:e,current:t,words:n,onPick:r}){const l=null===t?null:t.startsWith("#")?t.toLowerCase():e.find(e=>e.name===t)?.value.toLowerCase()??null;/* @__PURE__ */
8
- return de("div",{className:"es-copy-pop es-copy-colors",role:"dialog","aria-label":n.title,onMouseDown:e=>{"INPUT"!==e.target.tagName&&e.preventDefault()},children:[
9
- /* @__PURE__ */ue("span",{className:"es-copy-pop-label",children:n.theme}),
10
- /* @__PURE__ */ue("div",{className:"es-copy-theme",role:"group","aria-label":n.theme,children:e.map(e=>/* @__PURE__ */ue(z,{content:`${e.label} · ${e.value.toUpperCase()}`,children:/* @__PURE__ */ue($,{color:e.value,size:"sm",className:"es-copy-theme-swatch","data-color":e.name,"aria-label":e.label,selected:t===e.name,onMouseDown:Me,onClick:()=>r(e.name)})},e.name))}),
11
- /* @__PURE__ */ue("span",{className:"es-copy-pop-label",children:n.any}),
12
- /* @__PURE__ */ue(F,{className:"es-copy-any",value:l??"",onChange:e=>{e!==t&&r(e)},label:n.title,dragWrites:"end"}),
13
- /* @__PURE__ */ue("div",{className:"es-copy-pop-foot",children:/* @__PURE__ */ue(K,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onMouseDown:Me,onClick:()=>r(null),children:n.remove})})]})}var Re=(e,t,n)=>Math.min(Math.max(e,t),Math.max(t,n));var Be=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom});function Oe(e){const t=e.ownerDocument,n=t.documentElement,r={left:0,top:0,right:n.clientWidth,bottom:n.clientHeight},l=t.defaultView?.getComputedStyle.bind(t.defaultView);for(let o=e.parentElement;o&&o!==n&&o!==t.body;o=o.parentElement){const e=l?.(o);if(!e||"visible"===e.overflowX&&"visible"===e.overflowY)continue;const t=o.getBoundingClientRect();if(0===t.width&&0===t.height)continue;const n=t.left+o.clientLeft,a=t.top+o.clientTop;r.left=Math.max(r.left,n),r.top=Math.max(r.top,a),r.right=Math.min(r.right,n+(o.clientWidth||t.width)),r.bottom=Math.min(r.bottom,a+(o.clientHeight||t.height))}return r}function ze(e){const t=e.offsetParent??e.parentElement;if(!t)return{left:0,top:0};const n=t.getBoundingClientRect();return{left:n.left+t.clientLeft-t.scrollLeft,top:n.top+t.clientTop-t.scrollTop}}var $e=/* @__PURE__ */new Set([...m,"clear"]),Fe={bold:/* @__PURE__ */ue(ce,{size:16}),italic:/* @__PURE__ */ue(ie,{size:16}),strike:/* @__PURE__ */ue(se,{size:16}),highlight:/* @__PURE__ */ue(ae,{size:16}),quiet:/* @__PURE__ */ue(oe,{size:16}),link:/* @__PURE__ */ue(le,{size:16}),clear:/* @__PURE__ */ue(re,{size:16})};function Ke(e){if(!e)return;const t=e.split("+"),n=t.pop().toUpperCase();return["Meta",...t.map(e=>e[0].toUpperCase()+e.slice(1)),n].join("+")}var We={bold:"is-bold",italic:"is-italic",strike:"is-strike"};function je({tools:t,onApply:n,disabled:r=!1,actions:l,align:o,glyphs:a,ariaLabel:s,pressed:i,open:c=null}){const u=B("copy",e),d=("string"==typeof t[0]?y(t).map(e=>({...e,...u.marks[e.style]})):t).filter(e=>!$e.has(e.style));return 0!==d.length||l||o?/* @__PURE__ */de("div",{className:"es-copy-bar",role:"group","aria-label":s??u.formatting,children:[d.map(e=>{const t=a?.[e.style]??Fe[e.style],l=c===e.style||Boolean(i?.[e.style]),o="link"===e.style&&Boolean(i);return O(e.title,/* @__PURE__ */ue(W,{onMouseDown:e=>e.preventDefault(),onClick:()=>n(e.style),disabled:r,"aria-label":e.name??e.title,"aria-keyshortcuts":Ke(e.shortcut),"aria-pressed":o||!i&&!c?void 0:l,pressed:o?l:void 0,"aria-haspopup":o?"dialog":void 0,"aria-expanded":o?"link"===c:void 0,className:`es-copy-mark${t?" has-glyph":We[e.style]?` ${We[e.style]}`:""}${l?" is-active":""}`,children:t??e.label},e.style))}),l?/* @__PURE__ */de(pe,{children:[
14
- /* @__PURE__ */ue("span",{className:"es-copy-bar-split","aria-hidden":"true"}),l]}):null,o?/* @__PURE__ */ue("span",{className:"es-copy-bar-end",children:o}):null]}):null}function He({target:e,onChange:t}){const n=I(null);return U(()=>{const t=n.current,r=e.current;t&&r&&r.value===t.text&&(n.current=null,r.focus(),r.setSelectionRange(t.start,t.end))}),r=>{const l=r(e.current);t(l.text),n.current={start:l.selectionStart,end:l.selectionEnd,text:l.text}}}var Ae=["bold","italic","underline","strike","sup","sub"];function Ve({value:t,onChange:n,onCommit:r,onCancel:s,multiline:i=!1,placeholder:c,ariaLabel:u,className:d,readOnly:m=!1,rules:z,tools:$=[],writeMark:F,actions:W,align:G,glyphs:_,barLabel:Q,renderFooter:Z,inputRef:J,barShows:ee="always",richText:te=!0,defaultShowMarks:ne=!1,toolbar:le="final",colors:oe,cells:ae,letterCase:se,lastTool:ie}){const ce="final"===le,fe=B("copy",e),he=I(null),me=J??he,[ge,ve]=X(!1),[ke,Se]=X(null),Ee=I(l()).current,Ce=I(null);q(()=>{const e=Ce.current;e&&t===e.to?Ce.current=null:e&&t===e.from||(Ce.current=null,Ee.reset())},[t,Ee]);const Ne=e=>{Ce.current={from:Ce.current?.from??t,to:e},n(e)},Le=e=>({text:t,start:e?.selectionStart??ke?.start??t.length,end:e?.selectionEnd??ke?.end??t.length}),[Me,Fe]=X(ne),Ke=te&&!(i&&Me),We=I(null),Ve=Y(),[Ie,Xe]=X(null),[Ue,qe]=X(!1),Ye=()=>{if(!Ke)return me.current;const e=We.current?.getSource()??ke;return e?{selectionStart:e.start,selectionEnd:e.end}:null},Ge=He({target:me,onChange:Ne}),_e=e=>(Se({start:e.selectionStart,end:e.selectionEnd}),e),Qe=(e,n)=>{if(!Ke)return void Ge(t=>(n&&Ee.record(Le(t),"edit",Date.now()),_e(e(t))));const r=Ye(),l=_e(e(r));n&&Ee.record(Le(r),"edit",Date.now()),Xe(null),l.text!==t&&Ne(l.text),We.current?.setSource(l.selectionStart,l.selectionEnd,l.text)},Ze=e=>Qe(e,!0),Je=e=>Qe(t=>{const n=Le(t),r=Ee[e](n);return r?{text:r.text,selectionStart:r.start,selectionEnd:r.end}:{text:n.text,selectionStart:n.start,selectionEnd:n.end}},!1),et=I(null);U(()=>{const e=et.current;e&&(et.current=null,Ke?We.current?.setSource(e.start,e.end,t):(me.current?.focus(),me.current?.setSelectionRange(e.start,e.end),Se(e)))},[Ke]);const[tt,nt]=X(null),rt=z??b,lt=("string"==typeof $[0]?y($):$).filter(e=>!$e.has(e.style)),ot=ce?("string"==typeof $[0]?$:$.map(e=>e.style)).filter(e=>!$e.has(e)):lt.map(e=>e.style),at={};if(ke&&(Ke||ce)){const e=v(t,ke.start,ke.end,rt);for(const t of ot){const n=e.has(t)||"highlight"===t&&e.has("accent");at[t]=!!Ie?.add.includes(t)||!Ie?.drop.includes(t)&&n}ce&&(at.link=e.has("link"))}else if(ke)for(const e of ot)at[e]="link"===e?null!==k(t,ke.start,ke.end):x(t,ke.start,ke.end,e);const st=()=>{const e=Ye(),n=e?.selectionStart??t.length;return{start:n,end:e?.selectionEnd??n}},it=e=>{if(ce&&"link"!==e&&E(0,e)){const{start:n,end:r}=st();if(n===r&&!Ke)return void Ze(n=>xe(t,e,n,(e,t,n,r)=>g(e,t,n,r,rt,fe.placeholders)));const l=o({value:t,rules:rt,start:n,end:r,style:e,pending:Ie});return void("pending"===l.kind?Xe(l.pending):Ze(()=>l.result))}if("clear"===e)return void Ze(n=>xe(t,e,n,(e,t,n)=>g(e,t,n,"clear",rt)));if("link"!==e&&Ke&&E(0,e)){const n=Ye(),r=n?.selectionStart??t.length,l=n?.selectionEnd??r;if(r===l){const n=v(t,r,l,rt),o=n.has(e)||"highlight"===e&&n.has("accent"),a=Ie&&Ie.at===r?Ie:null,s=!!a?.add.includes(e)||!a?.drop.includes(e)&&o,i=(a?.add??[]).filter(t=>t!==e),c=(a?.drop??[]).filter(t=>t!==e);return s&&o?c.push(e):s||o||i.push(e),void Xe(i.length||c.length?{add:i,drop:c,at:r}:null)}return void Ze(n=>D(t,n?.selectionStart??r,n?.selectionEnd??l,e,rt))}if("link"!==e){const n=F??((e,t,n,r)=>g(e,t,n,r,b,fe.placeholders));return void Ze(r=>xe(t,e,r,n))}const n=Ye(),r=n?.selectionStart??t.length,l=n?.selectionEnd??r;qe(!1),nt({start:r,end:l,link:k(t,r,l)})},ct=Boolean(ke&&ke.start!==ke.end),ut=ke?w(t,ke.start,ke.end,rt):null,dt=ke?Ie&&void 0!==Ie.color&&Ie.at===ke.start?Ie.color:S(t,ke.start,ke.end,rt):null,pt=dt?dt.startsWith("#")?dt:oe?.find(e=>e.name===dt)?.value:void 0,ft=e=>{Ke?e?We.current?.setSource(e.start,e.end,t):We.current?.focus():(me.current?.focus(),e&&me.current?.setSelectionRange(e.start,e.end))},ht=()=>{const e=tt;nt(null),ft(e?{start:e.start,end:e.end}:ke)},mt=()=>{const e=yt.current,t=Boolean(e&&e.querySelector(".es-copy-colors")?.contains(e.ownerDocument.activeElement));qe(!1),t&&ft(ke)},gt=I(mt);gt.current=mt,q(()=>{if(Ue)return j(e=>{const t=yt.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&(gt.current(),!0)},()=>yt.current?.querySelector(".es-copy-colors"))},[Ue]);const yt=I(null),vt=Ue||null!==tt;q(()=>{const e=yt.current;if(!vt||!e)return;const t=e.ownerDocument,n=()=>{qe(!1),nt(null)},r=t=>{e.contains(t.target)||n()};let l;const o=r=>{const o=r.relatedTarget;o?e.contains(o)||n():(clearTimeout(l),l=setTimeout(()=>{const r=t.activeElement;t.hasFocus()&&r&&r!==t.body&&!e.contains(r)&&n()},0))};return t.addEventListener("pointerdown",r,!0),e.addEventListener("focusout",o),()=>{clearTimeout(l),t.removeEventListener("pointerdown",r,!0),e.removeEventListener("focusout",o)}},[vt]);const bt=tt??(Ue?ke??{start:t.length,end:t.length}:null),kt=I(()=>{});kt.current=()=>{const e=yt.current,t=e?.querySelector(".rosh-tb-wrap > .es-copy-pop");if(!e||!t||!bt)return;const n=Ke?null:e.querySelector(".es-gold-layer"),r=Ke?We.current?.rangeOf(bt.start,bt.end)??null:n?function(e,t,n){const r=e.ownerDocument,l=r.createTreeWalker(e,4),o=e=>{let t=e,n=null;for(let e=l.nextNode();e;e=l.nextNode()){if(t<=e.data.length)return[e,t];t-=e.data.length,n=e}return n?[n,n.data.length]:null},a=o(t);l.currentNode=e;const s=o(n);if(!a||!s)return null;const i=r.createRange();return i.setStart(a[0],a[1]),i.setEnd(s[0],s[1]),i}(n,bt.start,bt.end):null,l=r?.endContainer,o=l?1===l.nodeType?l:l.parentElement:null,a=r?function(e,t){const n=("function"==typeof e.getClientRects?[...e.getClientRects()]:[]).filter(e=>e.height>0);if(n.length>0){const t="function"==typeof e.getBoundingClientRect?e.getBoundingClientRect():n[0];return t.height>0?Be(t):Be(n[0])}if(!t)return null;const r=t.getBoundingClientRect();return{left:r.left,top:r.top,right:r.left,bottom:r.bottom}}(r,o?.closest(".es-rich-line, .es-gold-layer")??null):null;if(!a)return;const s=function({anchor:e,size:t,within:n,clip:r,parent:l,gap:o=8}){const a=Math.max(n.left,r.left),s=Math.min(n.right,r.right)-t.width,i=Re(e.left,a,s),c=r.bottom-(e.bottom+o),u=e.top-o-r.top,d=t.height>c&&(t.height<=u||u>c),p=d?e.top-o-t.height:e.bottom+o,f=e.left+Math.min((e.right-e.left)/2,10),h=Re(f-5-i,10,t.width-10-10);return{top:p-l.top,left:i-l.left,above:d,point:h}}({anchor:a,size:{width:t.offsetWidth,height:t.offsetHeight},within:e.getBoundingClientRect(),clip:Oe(e),parent:ze(t)});t.style.top=`${s.top}px`,t.style.left=`${s.left}px`,t.style.setProperty("--es-pop-point",`${s.point}px`),t.dataset.side=s.above?"above":"below"},U(()=>{const e=yt.current;if(!vt||!e)return;const t=()=>kt.current();t();const n=e.ownerDocument.defaultView;n?.addEventListener("resize",t);const r=e.querySelector(".rosh-tb-wrap > .es-copy-pop"),l=n?.ResizeObserver,o=l&&r?new l(t):null;return o&&r&&o.observe(r),()=>{n?.removeEventListener("resize",t),o?.disconnect()}},[vt,Ue,tt,bt?.start,bt?.end,Ke]);const xt=e=>tt&&/* @__PURE__ */ue(V,{className:e?"es-copy-link es-copy-pop":"es-copy-link",value:tt.link?.href??"",onApply:e=>{const n=tt;nt(null),Ze(()=>Ke?P(t,n.start,n.end,e,rt):R(t,n.start,n.end,e))},onRemove:tt.link?()=>{const e=tt.link,n=tt;nt(null),e&&Ze(()=>Ke?T(t,n.start,n.end,rt):M(t,e))}:void 0,onCancel:ht}),wt=G?ye(G.allow,fe.align):[],St="always"===ee||ge||null!==tt||Ue,Et=oe&&oe.length>0?{run:pt,open:Ue,onToggle:()=>{nt(null),Ue?mt():qe(!0)}}:void 0,Ct=St&&ce&&ie?ie({className:"rosh-tb-btn",disabled:m,selected:ct,keepCaret:e=>e.preventDefault(),insert:e=>Ze(n=>we(t,e,n))}):void 0,Dt=new Set(ot),Nt=G?{value:G.value,allow:G.allow,onChange:G.onChange,disabled:G.disabled}:void 0,Lt={pressed:ut,onList:e=>{const{start:n,end:r}=st(),l=w(t,n,r,rt);Ze(()=>L(t,n,r,l===e?null:e,rt))}},Tt=H({offered:Dt,color:Et,last:Ct,alignment:Nt,list:Lt,letterCase:se}),Mt=ce&&St&&(Ae.some(e=>Dt.has(e))||Boolean(Et));/* @__PURE__ */
15
- return de("div",{ref:yt,className:"es-copy"+(d?` ${d}`:""),onFocus:()=>ve(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||ve(!1)},onKeyDown:e=>{const t=e.target===me.current||Boolean(e.target.closest?.(".es-rich"));if(m||!t)return;if(e.altKey||e.metaKey===e.ctrlKey)return;const n=e.key.toLowerCase(),r="KeyZ"===e.code||"z"===n,l=("KeyY"===e.code||"y"===n)&&!e.shiftKey;if(r||l)return e.preventDefault(),e.stopPropagation(),void Je(l||e.shiftKey?"redo":"undo");const o=`${e.shiftKey?"shift+":""}${n}`;if(ce){const t={b:"bold",i:"italic",u:"underline",k:"link"}[o];if(!t||!ot.includes(t))return;return e.preventDefault(),e.stopPropagation(),void it(t)}const a=lt.find(e=>e.shortcut===o);a&&(e.preventDefault(),e.stopPropagation(),it(a.style))},onPaste:e=>{const n=me.current;if(m||!n||e.target!==n)return;e.preventDefault();const r=a({html:e.clipboardData.getData("text/html"),text:e.clipboardData.getData("text/plain")},{doc:n.ownerDocument,multiline:i,rules:rt});Ze(e=>we(t,r,e))},style:oe&&oe.length>0?Object.fromEntries(oe.map(e=>[`--es-color-${e.name}`,e.value])):void 0,onSelect:()=>{const e=me.current;e&&e.ownerDocument.activeElement===e&&Se({start:e.selectionStart??t.length,end:e.selectionEnd??t.length})},children:[St&&ce&&(Tt.words||Tt.paragraph)?
16
- /* @__PURE__ */ue(A,{className:"es-copy-toolbar","aria-label":Q??fe.formatting,offered:Dt,pressed:at,onMark:e=>it(e),color:Et,linkOpen:null!==tt,last:Ct,alignment:Nt,list:Lt,letterCase:se,disabled:m,windows:/* @__PURE__ */de(pe,{children:[Ue&&oe&&oe.length>0?/* @__PURE__ */ue(Pe,{colors:oe,current:dt,words:fe.colors??e.colors,onPick:e=>{const{start:n,end:r}=st();if(n!==r)Ze(()=>N(t,n,r,e,rt));else{if(!Ke)return;Xe({add:Ie?.add??[],drop:Ie?.drop??[],color:e,at:n})}}}):null,tt?xt(!0):null]})}):null,ce&&ae&&ae.length>0?/* @__PURE__ */ue(Te,{cells:ae,words:fe.cells??e.cells,readOnly:m}):null,St&&!ce?/* @__PURE__ */ue(je,{tools:$,disabled:m,actions:W,glyphs:_,ariaLabel:Q,pressed:at,open:tt?"link":null,onApply:it,align:G?/* @__PURE__ */ue(p,{options:wt,value:G.value,onChange:G.onChange,ariaLabel:fe.alignment,disabled:m||G.disabled,fit:be(wt)}):null}):null,Ke?/* @__PURE__ */ue(De,{value:t,rules:rt,multiline:i,readOnly:m,placeholder:c,ariaLabel:u,handle:We,pending:Ie??void 0,onEdit:(e,n,r)=>{Ee.record({text:t,start:n.start,end:n.end},r,Date.now()),Xe(null),Ne(e)},onSelect:e=>{Se(t=>t&&t.start===e.start&&t.end===e.end?t:e),!Ie||e.start===Ie.at&&e.end===Ie.at||Xe(null)},onHistory:Je,onFormat:e=>{ot.includes(e)&&it(e)},onCommit:r,onCancel:s}):/* @__PURE__ */ue(h,{value:t,onInput:e=>{Ee.record(Le(null),"type",Date.now()),Ne(e)},onCommit:r,onCancel:s,multiline:i,placeholder:c,ariaLabel:u,rules:z,disabled:m,inputRef:me,className:"es-copy-box"}),tt&&!ce?xt(!1):null,Z?Z({focused:ge,insert:e=>Ze(n=>we(t,e,n))}):null,te&&i||Mt?
17
- /* @__PURE__ */de("div",{className:"es-copy-marks",children:[te&&i?/* @__PURE__ */de(pe,{children:[
18
- /* @__PURE__ */ue(f,{checked:Me,onChange:()=>{const e=Ye();et.current=e&&null!==e.selectionStart&&null!==e.selectionEnd?{start:e.selectionStart,end:e.selectionEnd}:ke,Xe(null),Fe(e=>!e)},ariaLabelledBy:Ve,disabled:m}),
19
- /* @__PURE__ */ue("span",{id:Ve,className:"es-copy-marks-label",children:fe.showMarks??"Show marks"})]}):null,Mt?O(ct?void 0:fe.clearStyleEmpty??"Select words first",/* @__PURE__ */de(K,{variant:"secondary",size:"sm",className:"es-copy-clear",disabled:m||!ct,onMouseDown:e=>e.preventDefault(),onClick:()=>{const{start:e,end:n}=st();if(e===n)return;const r=C(t,e,n,rt);r.text!==t&&Ze(()=>r)},children:[
20
- /* @__PURE__ */ue(re,{size:16}),fe.clearStyle??e.clearStyle]})):null]}):null]})}export{fe as COPY_ALIGNS,ge as COPY_ALIGN_FIT,me as COPY_ALIGN_GLYPHS,he as COPY_ALIGN_LABELS,Ne as COPY_CELLS,Pe as ColorWindow,Ve as CopyBox,Te as CopyCells,je as MarkBar,De as RichBox,Ke as ariaShortcut,ye as copyAlignOptions,we as insertSelection,xe as markSelection,He as useCaretEdit};
1
+ import{DEFAULT_COPY_WORDS as e}from"../chunk-Q6AM43CA.js";import{selectionToVisible as t,selectionToSource as n,richLayout as r,createHistory as l,markPress as o,pasteToMarkup as a,richInput as s,editVisible as i,MARKUP_CLIPBOARD_TYPE as c,markupOfRange as u}from"../chunk-WQASXLXS.js";export{MARKUP_CLIPBOARD_TYPE,TYPING_BURST_MS,createHistory,editVisible,markupOfRange,newLine,pasteToMarkup,richInput,richLayout,selectionToSource,selectionToVisible,setBullet,startCanvasTyping,textMap,toSource,toSourceStart,toVisible}from"../chunk-WQASXLXS.js";import{FieldNumber as d}from"../chunk-66LWADFP.js";import{FieldSelect as p}from"../chunk-65Z5FSAW.js";import{SettingsSegmented as h,SettingsSwitch as f,SettingsField as m}from"../chunk-XJCMEEBH.js";import"../chunk-FFYXVAAL.js";import{GoldTextInput as g}from"../chunk-2FZJWH24.js";import{RETIRED_MARKS as y,applyMark as v,markupTools as b,marksIn as w,STANDARD_MARKUP as k,findLink as S,markedAt as x,listIn as C,colorIn as E,spanFor as D,clearStyle as N,toggleMark as L,colorOver as T,setList as M,unlinkAt as R,removeLink as z,linkOver as P,writeLink as B}from"../chunk-546BBOPE.js";import{useWords as O}from"../chunk-MFIRYGHW.js";import{withTip as F}from"../chunk-P2VEMZH5.js";import{Tooltip as $,ColorSwatch as K,ColorPickerPanel as W,Button as j,IconButton as H,registerModalEscapeInterceptor as V,textToolbarRows as A,TextToolbar as U,LinkPicker as I}from"efficient-shell/ui";export{TextToolbar}from"efficient-shell/ui";import{useRef as X,useState as q,useLayoutEffect as Y,useEffect as Z,useId as _}from"react";import{AlignJustifyIcon as Q,AlignRightIcon as G,AlignCenterIcon as J,AlignLeftIcon as ee,ParagraphSpacingIcon as te,LetterSpacingIcon as ne,LineSpacingIcon as re,TextSizeIcon as le,ClearMarksIcon as oe,StylesIcon as ae,ItalicIcon as se,TypeIcon as ie,AlignmentIcon as ce,ListFormatIcon as ue,CaseIcon as de,LinkIcon as pe,QuietIcon as he,EmphasisIcon as fe,StrikeIcon as me,BoldIcon as ge,NumberedListIcon as ye,ListIcon as ve,ListNoneIcon as be,CaseLowerIcon as we,CaseCapitalizedIcon as ke,CaseUpperIcon as Se,CaseNormalIcon as xe}from"efficient-shell/icons/efficient";import{jsx as Ce,jsxs as Ee,Fragment as De}from"react/jsx-runtime";var Ne=["left","center","right","justify"],Le=e.align,Te={left:/* @__PURE__ */Ce(ee,{}),center:/* @__PURE__ */Ce(J,{}),right:/* @__PURE__ */Ce(G,{}),justify:/* @__PURE__ */Ce(Q,{})},Me={three:{labelsPx:94.5,widestLabelPx:39.94},four:{labelsPx:140,widestLabelPx:44}};function Re(e,t=Le){return Ne.filter(t=>e.includes(t)).map(e=>({id:e,label:t[e],icon:Te[e],title:t[e]}))}var ze=/[\u1100-\u11ff\u2e80-\u9fff\uac00-\ud7af\uf900-\ufaff\uff00-\uffef]/;function Pe(e){if(e.every(e=>e.label===Le[e.id]))return e.length>3?Me.four:Me.three;const t=e.map(e=>[...e.label].reduce((e,t)=>e+(ze.test(t)?13:8),0));return{labelsPx:t.reduce((e,t)=>e+t,0),widestLabelPx:Math.max(0,...t)}}function Be(e,t){const n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}}function Oe(e,t,n,r=v){const{start:l,end:o}=Be(e,n);return r(e,l,o,t)}function Fe(e,t,n){const{start:r,end:l}=Be(e,n),o=r+t.length;return{text:e.slice(0,r)+t+e.slice(l),selectionStart:o,selectionEnd:o}}function $e(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 Ke(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 We(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 je({value:e,rules:l,multiline:o,readOnly:d=!1,placeholder:p,ariaLabel:h,handle:f,onEdit:m,onSelect:g,onHistory:y,onFormat:v,pending:b,onCommit:w,onCancel:k}){const S=X(null),x=X(null),C=X(null),E=X(null),D=X(null),N=X(e),[L,T]=q(0),M=X({value:e,rules:l,multiline:o,readOnly:d,pending:b,onEdit:m,onHistory:y,onFormat:v});M.current={value:e,rules:l,multiline:o,readOnly:d,pending:b,onEdit:m,onHistory:y,onFormat:v};const R=()=>{const e=S.current,t=x.current,n=e?.ownerDocument.getSelection();if(!(e&&t&&n&&0!==n.rangeCount&&n.anchorNode&&e.contains(n.anchorNode)))return null;const r=Ke(t,e,n.anchorNode,n.anchorOffset),l=n.focusNode&&e.contains(n.focusNode)?Ke(t,e,n.focusNode,n.focusOffset):r;return r<=l?[r,l]:[l,r]},z=(e,t)=>{const n=S.current,r=x.current;if(!n||!r)return;const[l,o]=We(r,e),[a,s]=We(r,t);n.ownerDocument.getSelection()?.setBaseAndExtent(l,o,a,s)};f.current={getSource(){const e=R(),t=x.current;if(!e||!t)return null;const[r,l]=n(t.layout,e[0],e[1]);return{start:r,end:l}},setSource(e,t,n){E.current={text:n,src:[e,t]},T(e=>e+1)},focus(){S.current?.focus()},rangeOf(e,n){const r=S.current,l=x.current;if(!r||!l)return null;const[o,a]=t(l.layout,e,n),[s,i]=We(l,o),[c,u]=We(l,a),d=r.ownerDocument.createRange();return d.setStart(s,i),d.setEnd(c,u),d}},Y(()=>{const n=S.current;if(!n||D.current)return;const o=E.current?null:R();x.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=$e(n,e.marks[r].kind,e.marks[r].href,e.marks[r].color);o().appendChild(t),l.push({id:e.marks[r].id,el:t})}a||(a=n.createTextNode(""),o().appendChild(a)),a.data+=e.ch}return 0===t.chars.length&&r.appendChild(n.createElement("br")),e.appendChild(r),r});return{layout:t,lines:r}}(n,r(e,l)),C.current=e;const a=E.current;if(!a||a.text!==e)return void(o&&n.ownerDocument.activeElement===n&&z(o[0],Math.min(o[1],x.current.layout.text.length)));E.current=null;const s=x.current.layout,[i,c]=a.vis??t(s,a.src[0],a.src[1]);n.ownerDocument.activeElement!==n&&n.focus(),z(i,c)},[e,l,L]);const P=(e,t,r)=>{const l=x.current,[o,a]=n(l.layout,t[0],t[1]);E.current={text:e.text,vis:[e.caret,e.caret]},e.text!==M.current.value?M.current.onEdit(e.text,{start:o,end:a},r):T(e=>e+1)};Z(()=>{const e=S.current;if(!e)return;const t=t=>{const{value:n,rules:r,multiline:l,readOnly:o,pending:a}=M.current;if("insertCompositionText"===t.inputType)return;if(t.preventDefault(),o)return;const i=x.current,c=R();if(!i||!c)return;const u="function"==typeof t.getTargetRanges?t.getTargetRanges()[0]:void 0,d=u&&!u.collapsed?[Ke(i,e,u.startContainer,u.startOffset),Ke(i,e,u.endContainer,u.endOffset)]:null,p=s({value:n,rules:r,multiline:l,inputType:t.inputType,data:t.data??t.dataTransfer?.getData("text/plain")??"",html:t.dataTransfer?.getData("text/html"),doc:e.ownerDocument,sel:c,target:d,pending:a});p&&("history"!==p.kind?"format"!==p.kind?P(p.edit,p.range,p.kind):M.current.onFormat(p.style):M.current.onHistory(p.dir))},n=()=>{D.current||T(e=>e+1)};return e.addEventListener("beforeinput",t),e.addEventListener("input",n),()=>{e.removeEventListener("beforeinput",t),e.removeEventListener("input",n)}},[]),Z(()=>{const e=S.current;if(!e)return;const t=e.ownerDocument,n=()=>{const e=f.current?.getSource();e&&g(e)};return t.addEventListener("selectionchange",n),()=>t.removeEventListener("selectionchange",n)});const B=(t,n=!1)=>{const r=R();if(!r||r[0]===r[1])return;t.preventDefault();const o=x.current;t.clipboardData.setData("text/plain",o.layout.text.slice(r[0],r[1])),t.clipboardData.setData(c,u(e,l,r[0],r[1])),n&&!d&&P(i(e,l,r[0],r[1],{text:""}),r,"edit")};/* @__PURE__ */
2
+ return Ee("div",{className:"es-rich-wrap",children:[p&&""===e?/* @__PURE__ */Ce("div",{className:"es-rich-placeholder","aria-hidden":"true",children:p}):null,
3
+ /* @__PURE__ */Ce("div",{ref:S,className:`es-rich${o?" is-multiline":" is-single"}${d?" is-off":""}`,contentEditable:!d,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":o,"aria-label":h,"aria-readonly":d||void 0,"aria-placeholder":p,tabIndex:d?-1:0,spellCheck:!0,onFocus:()=>{N.current=e},onBlur:()=>{e!==N.current&&w?.(e),N.current=e},onKeyDown:t=>{if("Escape"===t.key)return t.preventDefault(),k?.(N.current),void(N.current=e);"Enter"!==t.key||o||(t.preventDefault(),e!==N.current&&w?.(e),N.current=e)},onCompositionStart:()=>{const e=R()??[0,0];D.current={from:e[0],to:e[1]}},onCompositionEnd:e=>{const t=D.current;if(D.current=null,!t)return;const{value:n,rules:r,pending:l}=M.current;e.data?P(i(n,r,t.from,t.to,{text:e.data,add:l?.add,drop:l?.drop,color:l?.color}),[t.from,t.to],"type"):T(e=>e+1)},onCopy:e=>B(e),onCut:e=>B(e,!0),onPaste:t=>{if(t.preventDefault(),d)return;const n=R();if(!n)return;const r=t.clipboardData.getData(c),s=r?o?r:r.replace(/\s*\r?\n\s*/g," "):a({html:t.clipboardData.getData("text/html"),text:t.clipboardData.getData("text/plain")},{doc:t.currentTarget.ownerDocument,multiline:o,rules:l});P(i(e,l,n[0],n[1],{markup:s}),n,"edit")}})]})}var He={fontSize:{key:"fontSize",nameKey:"fontSize",icon:/* @__PURE__ */Ce(le,{}),unit:"px",step:1,shiftStep:10,min:5},lineHeight:{key:"lineHeight",nameKey:"lineHeight",icon:/* @__PURE__ */Ce(re,{}),unit:"%",step:1,shiftStep:10,min:50,max:250,scale:100},letterSpacing:{key:"letterSpacing",nameKey:"letterSpacing",icon:/* @__PURE__ */Ce(ne,{}),unit:"px",step:.1,shiftStep:1,min:-10},paragraphSpacing:{key:"paragraphSpacing",nameKey:"paragraphSpacing",icon:/* @__PURE__ */Ce(te,{}),unit:"px",step:1,shiftStep:10,min:0}};function Ve(e,t){return void 0===e?void 0:Number((e*t).toFixed(6))}function Ae({cells:t,words:n,readOnly:r=!1}){const l=n??e.cells,o=_();/* @__PURE__ */
4
+ return Ce("div",{className:"es-copy-cells-fit",children:/* @__PURE__ */Ce("div",{className:"es-copy-cells",children:t.map(e=>{const t=e.scale??1,n=e.name??(e.nameKey?l[e.nameKey]:e.key),a=e.unit??"",s=e.step??1,i=`${o}-${e.key}`;/* @__PURE__ */
5
+ return Ee("div",{className:"es-copy-cell",children:[
6
+ /* @__PURE__ */Ce("label",{className:"es-field-label es-copy-cell-name",htmlFor:i,children:n}),
7
+ /* @__PURE__ */Ce(d,{id:i,value:Ve(e.value,t),styleValue:Ve(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:r,ariaLabel:n,title:l.tip({name:n,step:s,unit:a})})]},e.key)})})})}var Ue=e=>e.preventDefault();function Ie({colors:e,current:t,words:n,onPick:r}){const l=null===t?null:t.startsWith("#")?t.toLowerCase():e.find(e=>e.name===t)?.value.toLowerCase()??null;/* @__PURE__ */
8
+ return Ee("div",{className:"es-copy-pop es-copy-colors",role:"dialog","aria-label":n.title,onMouseDown:e=>{"INPUT"!==e.target.tagName&&e.preventDefault()},children:[
9
+ /* @__PURE__ */Ce("span",{className:"es-copy-pop-label",children:n.theme}),
10
+ /* @__PURE__ */Ce("div",{className:"es-copy-theme",role:"group","aria-label":n.theme,children:e.map(e=>/* @__PURE__ */Ce($,{content:`${e.label} · ${e.value.toUpperCase()}`,children:/* @__PURE__ */Ce(K,{color:e.value,size:"sm",className:"es-copy-theme-swatch","data-color":e.name,"aria-label":e.label,selected:t===e.name,onMouseDown:Ue,onClick:()=>r(e.name)})},e.name))}),
11
+ /* @__PURE__ */Ce("span",{className:"es-copy-pop-label",children:n.any}),
12
+ /* @__PURE__ */Ce(W,{className:"es-copy-any",value:l??"",onChange:e=>{e!==t&&r(e)},label:n.title,dragWrites:"end"}),
13
+ /* @__PURE__ */Ce("div",{className:"es-copy-pop-foot",children:/* @__PURE__ */Ce(j,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onMouseDown:Ue,onClick:()=>r(null),children:n.remove})})]})}var Xe=(e,t,n)=>Math.min(Math.max(e,t),Math.max(t,n));var qe=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom});function Ye(e){const t=e.ownerDocument,n=t.documentElement,r={left:0,top:0,right:n.clientWidth,bottom:n.clientHeight},l=t.defaultView?.getComputedStyle.bind(t.defaultView);for(let o=e.parentElement;o&&o!==n&&o!==t.body;o=o.parentElement){const e=l?.(o);if(!e||"visible"===e.overflowX&&"visible"===e.overflowY)continue;const t=o.getBoundingClientRect();if(0===t.width&&0===t.height)continue;const n=t.left+o.clientLeft,a=t.top+o.clientTop;r.left=Math.max(r.left,n),r.top=Math.max(r.top,a),r.right=Math.min(r.right,n+(o.clientWidth||t.width)),r.bottom=Math.min(r.bottom,a+(o.clientHeight||t.height))}return r}function Ze(e){const t=e.offsetParent??e.parentElement;if(!t)return{left:0,top:0};const n=t.getBoundingClientRect();return{left:n.left+t.clientLeft-t.scrollLeft,top:n.top+t.clientTop-t.scrollTop}}var _e=/* @__PURE__ */new Set([...y,"clear"]),Qe={bold:/* @__PURE__ */Ce(ge,{size:16}),italic:/* @__PURE__ */Ce(se,{size:16}),strike:/* @__PURE__ */Ce(me,{size:16}),highlight:/* @__PURE__ */Ce(fe,{size:16}),quiet:/* @__PURE__ */Ce(he,{size:16}),link:/* @__PURE__ */Ce(pe,{size:16}),clear:/* @__PURE__ */Ce(oe,{size:16})};function Ge(e){if(!e)return;const t=e.split("+"),n=t.pop().toUpperCase();return["Meta",...t.map(e=>e[0].toUpperCase()+e.slice(1)),n].join("+")}var Je={bold:"is-bold",italic:"is-italic",strike:"is-strike"};function et({tools:t,onApply:n,disabled:r=!1,actions:l,align:o,glyphs:a,ariaLabel:s,pressed:i,open:c=null}){const u=O("copy",e),d=("string"==typeof t[0]?b(t).map(e=>({...e,...u.marks[e.style]})):t).filter(e=>!_e.has(e.style));return 0!==d.length||l||o?/* @__PURE__ */Ee("div",{className:"es-copy-bar",role:"group","aria-label":s??u.formatting,children:[d.map(e=>{const t=a?.[e.style]??Qe[e.style],l=c===e.style||Boolean(i?.[e.style]),o="link"===e.style&&Boolean(i);return F(e.title,/* @__PURE__ */Ce(H,{onMouseDown:e=>e.preventDefault(),onClick:()=>n(e.style),disabled:r,"aria-label":e.name??e.title,"aria-keyshortcuts":Ge(e.shortcut),"aria-pressed":o||!i&&!c?void 0:l,pressed:o?l:void 0,"aria-haspopup":o?"dialog":void 0,"aria-expanded":o?"link"===c:void 0,className:`es-copy-mark${t?" has-glyph":Je[e.style]?` ${Je[e.style]}`:""}${l?" is-active":""}`,children:t??e.label},e.style))}),l?/* @__PURE__ */Ee(De,{children:[
14
+ /* @__PURE__ */Ce("span",{className:"es-copy-bar-split","aria-hidden":"true"}),l]}):null,o?/* @__PURE__ */Ce("span",{className:"es-copy-bar-end",children:o}):null]}):null}function tt({target:e,onChange:t}){const n=X(null);return Y(()=>{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 nt=["bold","italic","underline","strike","sup","sub"];function rt({value:t,onChange:n,onCommit:r,onCancel:s,multiline:i=!1,placeholder:c,ariaLabel:u,className:d,readOnly:p=!1,rules:m,tools:y=[],writeMark:$,actions:K,align:W,glyphs:H,barLabel:Q,renderFooter:G,inputRef:J,barShows:ee="always",richText:te=!0,defaultShowMarks:ne=!1,toolbar:re="final",colors:le,cells:ae,letterCase:se,lastTool:ie}){const ce="final"===re,ue=O("copy",e),de=X(null),pe=J??de,[he,fe]=q(!1),[me,ge]=q(null),ye=X(l()).current,ve=X(null);Z(()=>{const e=ve.current;e&&t===e.to?ve.current=null:e&&t===e.from||(ve.current=null,ye.reset())},[t,ye]);const be=e=>{ve.current={from:ve.current?.from??t,to:e},n(e)},we=e=>({text:t,start:e?.selectionStart??me?.start??t.length,end:e?.selectionEnd??me?.end??t.length}),[ke,Se]=q(ne),xe=te&&!(i&&ke),Ne=X(null),Le=_(),[Te,Me]=q(null),[ze,Be]=q(!1),$e=()=>{if(!xe)return pe.current;const e=Ne.current?.getSource()??me;return e?{selectionStart:e.start,selectionEnd:e.end}:null},Ke=tt({target:pe,onChange:be}),We=e=>(ge({start:e.selectionStart,end:e.selectionEnd}),e),He=(e,n)=>{if(!xe)return void Ke(t=>(n&&ye.record(we(t),"edit",Date.now()),We(e(t))));const r=$e(),l=We(e(r));n&&ye.record(we(r),"edit",Date.now()),Me(null),l.text!==t&&be(l.text),Ne.current?.setSource(l.selectionStart,l.selectionEnd,l.text)},Ve=e=>He(e,!0),Ue=e=>He(t=>{const n=we(t),r=ye[e](n);return r?{text:r.text,selectionStart:r.start,selectionEnd:r.end}:{text:n.text,selectionStart:n.start,selectionEnd:n.end}},!1),Qe=X(null);Y(()=>{const e=Qe.current;e&&(Qe.current=null,xe?Ne.current?.setSource(e.start,e.end,t):(pe.current?.focus(),pe.current?.setSelectionRange(e.start,e.end),ge(e)))},[xe]);const[Ge,Je]=q(null),rt=m??k,lt=("string"==typeof y[0]?b(y):y).filter(e=>!_e.has(e.style)),ot=ce?("string"==typeof y[0]?y:y.map(e=>e.style)).filter(e=>!_e.has(e)):lt.map(e=>e.style),at={};if(me&&(xe||ce)){const e=w(t,me.start,me.end,rt);for(const t of ot){const n=e.has(t)||"highlight"===t&&e.has("accent");at[t]=!!Te?.add.includes(t)||!Te?.drop.includes(t)&&n}ce&&(at.link=e.has("link"))}else if(me)for(const e of ot)at[e]="link"===e?null!==S(t,me.start,me.end):x(t,me.start,me.end,e);const st=()=>{const e=$e(),n=e?.selectionStart??t.length;return{start:n,end:e?.selectionEnd??n}},it=e=>{if(ce&&"link"!==e&&D(0,e)){const{start:n,end:r}=st();if(n===r&&!xe)return void Ve(n=>Oe(t,e,n,(e,t,n,r)=>v(e,t,n,r,rt,ue.placeholders)));const l=o({value:t,rules:rt,start:n,end:r,style:e,pending:Te});return void("pending"===l.kind?Me(l.pending):Ve(()=>l.result))}if("clear"===e)return void Ve(n=>Oe(t,e,n,(e,t,n)=>v(e,t,n,"clear",rt)));if("link"!==e&&xe&&D(0,e)){const n=$e(),r=n?.selectionStart??t.length,l=n?.selectionEnd??r;if(r===l){const n=w(t,r,l,rt),o=n.has(e)||"highlight"===e&&n.has("accent"),a=Te&&Te.at===r?Te:null,s=!!a?.add.includes(e)||!a?.drop.includes(e)&&o,i=(a?.add??[]).filter(t=>t!==e),c=(a?.drop??[]).filter(t=>t!==e);return s&&o?c.push(e):s||o||i.push(e),void Me(i.length||c.length?{add:i,drop:c,at:r}:null)}return void Ve(n=>L(t,n?.selectionStart??r,n?.selectionEnd??l,e,rt))}if("link"!==e){const n=$??((e,t,n,r)=>v(e,t,n,r,k,ue.placeholders));return void Ve(r=>Oe(t,e,r,n))}const n=$e(),r=n?.selectionStart??t.length,l=n?.selectionEnd??r;Be(!1),Je({start:r,end:l,link:S(t,r,l)})},ct=Boolean(me&&me.start!==me.end),ut=me?C(t,me.start,me.end,rt):null,dt=me?Te&&void 0!==Te.color&&Te.at===me.start?Te.color:E(t,me.start,me.end,rt):null,pt=dt?dt.startsWith("#")?dt:le?.find(e=>e.name===dt)?.value:void 0,ht=e=>{xe?e?Ne.current?.setSource(e.start,e.end,t):Ne.current?.focus():(pe.current?.focus(),e&&pe.current?.setSelectionRange(e.start,e.end))},ft=()=>{const e=Ge;Je(null),ht(e?{start:e.start,end:e.end}:me)},mt=()=>{const e=yt.current,t=Boolean(e&&e.querySelector(".es-copy-colors")?.contains(e.ownerDocument.activeElement));Be(!1),t&&ht(me)},gt=X(mt);gt.current=mt,Z(()=>{if(ze)return V(e=>{const t=yt.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&(gt.current(),!0)},()=>yt.current?.querySelector(".es-copy-colors"))},[ze]);const yt=X(null),vt=ze||null!==Ge;Z(()=>{const e=yt.current;if(!vt||!e)return;const t=e.ownerDocument,n=()=>{Be(!1),Je(null)},r=t=>{e.contains(t.target)||n()};let l;const o=r=>{const o=r.relatedTarget;o?e.contains(o)||n():(clearTimeout(l),l=setTimeout(()=>{const r=t.activeElement;t.hasFocus()&&r&&r!==t.body&&!e.contains(r)&&n()},0))};return t.addEventListener("pointerdown",r,!0),e.addEventListener("focusout",o),()=>{clearTimeout(l),t.removeEventListener("pointerdown",r,!0),e.removeEventListener("focusout",o)}},[vt]);const bt=Ge??(ze?me??{start:t.length,end:t.length}:null),wt=X(()=>{});wt.current=()=>{const e=yt.current,t=e?.querySelector(".rosh-tb-wrap > .es-copy-pop");if(!e||!t||!bt)return;const n=xe?null:e.querySelector(".es-gold-layer"),r=xe?Ne.current?.rangeOf(bt.start,bt.end)??null:n?function(e,t,n){const r=e.ownerDocument,l=r.createTreeWalker(e,4),o=e=>{let t=e,n=null;for(let e=l.nextNode();e;e=l.nextNode()){if(t<=e.data.length)return[e,t];t-=e.data.length,n=e}return n?[n,n.data.length]:null},a=o(t);l.currentNode=e;const s=o(n);if(!a||!s)return null;const i=r.createRange();return i.setStart(a[0],a[1]),i.setEnd(s[0],s[1]),i}(n,bt.start,bt.end):null,l=r?.endContainer,o=l?1===l.nodeType?l:l.parentElement:null,a=r?function(e,t){const n=("function"==typeof e.getClientRects?[...e.getClientRects()]:[]).filter(e=>e.height>0);if(n.length>0){const t="function"==typeof e.getBoundingClientRect?e.getBoundingClientRect():n[0];return t.height>0?qe(t):qe(n[0])}if(!t)return null;const r=t.getBoundingClientRect();return{left:r.left,top:r.top,right:r.left,bottom:r.bottom}}(r,o?.closest(".es-rich-line, .es-gold-layer")??null):null;if(!a)return;const s=function({anchor:e,size:t,within:n,clip:r,parent:l,gap:o=8}){const a=Math.max(n.left,r.left),s=Math.min(n.right,r.right)-t.width,i=Xe(e.left,a,s),c=r.bottom-(e.bottom+o),u=e.top-o-r.top,d=t.height>c&&(t.height<=u||u>c),p=d?e.top-o-t.height:e.bottom+o,h=e.left+Math.min((e.right-e.left)/2,10),f=Xe(h-5-i,10,t.width-10-10);return{top:p-l.top,left:i-l.left,above:d,point:f}}({anchor:a,size:{width:t.offsetWidth,height:t.offsetHeight},within:e.getBoundingClientRect(),clip:Ye(e),parent:Ze(t)});t.style.top=`${s.top}px`,t.style.left=`${s.left}px`,t.style.setProperty("--es-pop-point",`${s.point}px`),t.dataset.side=s.above?"above":"below"},Y(()=>{const e=yt.current;if(!vt||!e)return;const t=()=>wt.current();t();const n=e.ownerDocument.defaultView;n?.addEventListener("resize",t);const r=e.querySelector(".rosh-tb-wrap > .es-copy-pop"),l=n?.ResizeObserver,o=l&&r?new l(t):null;return o&&r&&o.observe(r),()=>{n?.removeEventListener("resize",t),o?.disconnect()}},[vt,ze,Ge,bt?.start,bt?.end,xe]);const kt=e=>Ge&&/* @__PURE__ */Ce(I,{className:e?"es-copy-link es-copy-pop":"es-copy-link",value:Ge.link?.href??"",onApply:e=>{const n=Ge;Je(null),Ve(()=>xe?P(t,n.start,n.end,e,rt):B(t,n.start,n.end,e))},onRemove:Ge.link?()=>{const e=Ge.link,n=Ge;Je(null),e&&Ve(()=>xe?R(t,n.start,n.end,rt):z(t,e))}:void 0,onCancel:ft}),St=W?Re(W.allow,ue.align):[],xt="always"===ee||he||null!==Ge||ze,Ct=le&&le.length>0?{run:pt,open:ze,onToggle:()=>{Je(null),ze?mt():Be(!0)}}:void 0,Et=xt&&ce&&ie?ie({className:"rosh-tb-btn",disabled:p,selected:ct,keepCaret:e=>e.preventDefault(),insert:e=>Ve(n=>Fe(t,e,n))}):void 0,Dt=new Set(ot),Nt=W?{value:W.value,allow:W.allow,onChange:W.onChange,disabled:W.disabled}:void 0,Lt={pressed:ut,onList:e=>{const{start:n,end:r}=st(),l=C(t,n,r,rt);Ve(()=>M(t,n,r,l===e?null:e,rt))}},Tt=A({offered:Dt,color:Ct,last:Et,alignment:Nt,list:Lt,letterCase:se}),Mt=ce&&xt&&(nt.some(e=>Dt.has(e))||Boolean(Ct));/* @__PURE__ */
15
+ return Ee("div",{ref:yt,className:"es-copy"+(d?` ${d}`:""),onFocus:()=>fe(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||fe(!1)},onKeyDown:e=>{const t=e.target===pe.current||Boolean(e.target.closest?.(".es-rich"));if(p||!t)return;if(e.altKey||e.metaKey===e.ctrlKey)return;const n=e.key.toLowerCase(),r="KeyZ"===e.code||"z"===n,l=("KeyY"===e.code||"y"===n)&&!e.shiftKey;if(r||l)return e.preventDefault(),e.stopPropagation(),void Ue(l||e.shiftKey?"redo":"undo");const o=`${e.shiftKey?"shift+":""}${n}`;if(ce){const t={b:"bold",i:"italic",u:"underline",k:"link"}[o];if(!t||!ot.includes(t))return;return e.preventDefault(),e.stopPropagation(),void it(t)}const a=lt.find(e=>e.shortcut===o);a&&(e.preventDefault(),e.stopPropagation(),it(a.style))},onPaste:e=>{const n=pe.current;if(p||!n||e.target!==n)return;e.preventDefault();const r=a({html:e.clipboardData.getData("text/html"),text:e.clipboardData.getData("text/plain")},{doc:n.ownerDocument,multiline:i,rules:rt});Ve(e=>Fe(t,r,e))},style:le&&le.length>0?Object.fromEntries(le.map(e=>[`--es-color-${e.name}`,e.value])):void 0,onSelect:()=>{const e=pe.current;e&&e.ownerDocument.activeElement===e&&ge({start:e.selectionStart??t.length,end:e.selectionEnd??t.length})},children:[xt&&ce&&(Tt.words||Tt.paragraph)?
16
+ /* @__PURE__ */Ce(U,{className:"es-copy-toolbar","aria-label":Q??ue.formatting,offered:Dt,pressed:at,onMark:e=>it(e),color:Ct,linkOpen:null!==Ge,last:Et,alignment:Nt,list:Lt,letterCase:se,disabled:p,windows:/* @__PURE__ */Ee(De,{children:[ze&&le&&le.length>0?/* @__PURE__ */Ce(Ie,{colors:le,current:dt,words:ue.colors??e.colors,onPick:e=>{const{start:n,end:r}=st();if(n!==r)Ve(()=>T(t,n,r,e,rt));else{if(!xe)return;Me({add:Te?.add??[],drop:Te?.drop??[],color:e,at:n})}}}):null,Ge?kt(!0):null]})}):null,ce&&ae&&ae.length>0?/* @__PURE__ */Ce(Ae,{cells:ae,words:ue.cells??e.cells,readOnly:p}):null,xt&&!ce?/* @__PURE__ */Ce(et,{tools:y,disabled:p,actions:K,glyphs:H,ariaLabel:Q,pressed:at,open:Ge?"link":null,onApply:it,align:W?/* @__PURE__ */Ce(h,{options:St,value:W.value,onChange:W.onChange,ariaLabel:ue.alignment,disabled:p||W.disabled,fit:Pe(St)}):null}):null,xe?/* @__PURE__ */Ce(je,{value:t,rules:rt,multiline:i,readOnly:p,placeholder:c,ariaLabel:u,handle:Ne,pending:Te??void 0,onEdit:(e,n,r)=>{ye.record({text:t,start:n.start,end:n.end},r,Date.now()),Me(null),be(e)},onSelect:e=>{ge(t=>t&&t.start===e.start&&t.end===e.end?t:e),!Te||e.start===Te.at&&e.end===Te.at||Me(null)},onHistory:Ue,onFormat:e=>{ot.includes(e)&&it(e)},onCommit:r,onCancel:s}):/* @__PURE__ */Ce(g,{value:t,onInput:e=>{ye.record(we(null),"type",Date.now()),be(e)},onCommit:r,onCancel:s,multiline:i,placeholder:c,ariaLabel:u,rules:m,disabled:p,inputRef:pe,className:"es-copy-box"}),Ge&&!ce?kt(!1):null,G?G({focused:he,insert:e=>Ve(n=>Fe(t,e,n))}):null,te&&i||Mt?
17
+ /* @__PURE__ */Ee("div",{className:"es-copy-marks",children:[te&&i?/* @__PURE__ */Ee(De,{children:[
18
+ /* @__PURE__ */Ce(f,{checked:ke,onChange:()=>{const e=$e();Qe.current=e&&null!==e.selectionStart&&null!==e.selectionEnd?{start:e.selectionStart,end:e.selectionEnd}:me,Me(null),Se(e=>!e)},ariaLabelledBy:Le,disabled:p}),
19
+ /* @__PURE__ */Ce("span",{id:Le,className:"es-copy-marks-label",children:ue.showMarks??"Show marks"})]}):null,Mt?F(ct?void 0:ue.clearStyleEmpty??"Select words first",/* @__PURE__ */Ee(j,{variant:"secondary",size:"sm",className:"es-copy-clear",disabled:p||!ct,onMouseDown:e=>e.preventDefault(),onClick:()=>{const{start:e,end:n}=st();if(e===n)return;const r=N(t,e,n,rt);r.text!==t&&Ve(()=>r)},children:[
20
+ /* @__PURE__ */Ce(oe,{size:16}),ue.clearStyle??e.clearStyle]})):null]}):null]})}var lt=["none","bullet","number"],ot=["none","upper","capitalize","lower"],at={none:/* @__PURE__ */Ce(be,{}),bullet:/* @__PURE__ */Ce(ve,{}),number:/* @__PURE__ */Ce(ye,{})},st={none:/* @__PURE__ */Ce(xe,{}),upper:/* @__PURE__ */Ce(Se,{}),capitalize:/* @__PURE__ */Ce(ke,{}),lower:/* @__PURE__ */Ce(we,{})};function it({label:e,icon:t,answers:n,names:r,glyphs:l,row:o}){const a=o.value||o.styleValue||"";/* @__PURE__ */
21
+ return Ce(m,{label:e,icon:t,children:/* @__PURE__ */Ce(h,{ariaLabel:e,value:a,onChange:e=>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 ct({kept:t,style:n,font:r,italic:l,cells:o,align:a,list:s,letterCase:i}){const c=O("copy",e),u={...e.panel,...c.panel},d=c.clearStyle??e.clearStyle,h=n?[n.onClearChanges&&{label:d,onSelect:n.onClearChanges},n.onEditStyles&&{label:u.editStyles,onSelect:n.onEditStyles},n.onUpdateStyle&&{label:u.updateStyle,onSelect:n.onUpdateStyle}].filter(e=>!!e):[],f=!!l&&(l.value??l.styleValue??!1);/* @__PURE__ */
22
+ return Ee("div",{className:"es-tpp",children:[t?/* @__PURE__ */Ce("div",{className:"es-tpp-kept",children:/* @__PURE__ */Ce(rt,{...t})}):null,n?/* @__PURE__ */Ce(m,{label:u.style,icon:/* @__PURE__ */Ce(ae,{}),children:/* @__PURE__ */Ce(p,{ariaLabel:u.style,value:n.value,options:n.options,onChange:n.onChange,changed:n.changed,footer:h})}):null,r?/* @__PURE__ */Ce(m,{label:u.font,icon:/* @__PURE__ */Ce(ie,{}),children:/* @__PURE__ */Ee("div",{className:"es-tpp-font",children:[
23
+ /* @__PURE__ */Ce("div",{className:"es-tpp-font-select",children:/* @__PURE__ */Ce(p,{ariaLabel:u.font,value:r.value||void 0,placeholder:r.styleValue,options:r.options,onChange:r.onChange,searchable:r.searchable})}),l?/* @__PURE__ */Ce($,{content:u.italic,children:/* @__PURE__ */Ce(H,{size:"sm",variant:"ghost","aria-label":u.italic,"aria-pressed":f,onClick:()=>{const e=!f;l.onChange(e===(l.styleValue??!1)?void 0:e)},children:/* @__PURE__ */Ce(se,{})})}):null]})}):null,o?.length?/* @__PURE__ */Ce(Ae,{cells:o,words:c.cells}):null,a?/* @__PURE__ */Ce(it,{label:c.alignment,icon:/* @__PURE__ */Ce(ce,{}),answers:Ne.filter(e=>!a.allow||a.allow.includes(e)),names:c.align,glyphs:Te,row:a}):null,s?/* @__PURE__ */Ce(it,{label:u.list,icon:/* @__PURE__ */Ce(ue,{}),answers:lt,names:u.lists,glyphs:at,row:s}):null,i?/* @__PURE__ */Ce(it,{label:u.capitalization,icon:/* @__PURE__ */Ce(de,{}),answers:ot,names:u.cases,glyphs:st,row:i}):null]})}export{Ne as COPY_ALIGNS,Me as COPY_ALIGN_FIT,Te as COPY_ALIGN_GLYPHS,Le as COPY_ALIGN_LABELS,He as COPY_CELLS,Ie as ColorWindow,rt as CopyBox,Ae as CopyCells,et as MarkBar,je as RichBox,ct as TextPartPanel,Ge as ariaShortcut,Re as copyAlignOptions,Fe as insertSelection,Oe as markSelection,tt as useCaretEdit};
@@ -11,7 +11,7 @@ import { TextToolbarProps } from 'efficient-shell/ui';
11
11
  import { C as CanvasTypingEnd } from '../canvas-typing-Cnvlsh_V.js';
12
12
  import { InlineRule } from '../markup/index.js';
13
13
  import { b as NodeOpsHost, C as ClipboardEntry } from '../useNodeOps-BHRkUFfG.js';
14
- import { I as InspectorFields } from '../types-OUl0mK1k.js';
14
+ import { I as InspectorFields } from '../types-C97TAUKi.js';
15
15
  import '../buckets-Tj-nkBpg.js';
16
16
 
17
17
  interface EaselOptions<C extends EaselConfig = EaselConfig> {
@@ -2,8 +2,8 @@ import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
3
  import { S as SettingsBucket } from '../buckets-Tj-nkBpg.js';
4
4
  export { D as DesignGroup } from '../buckets-Tj-nkBpg.js';
5
- import { a as InspectorFieldDef, F as FieldRenderer, I as InspectorFields, b as FieldTextProps, c as FieldNumberProps, d as FieldSliderProps, e as FieldSelectManyProps, f as FieldSelectOneProps, g as FieldOption } from '../types-OUl0mK1k.js';
6
- export { A as ArrayFieldDef, C as CustomFieldDef, h as CustomFieldRenderProps, i as FieldSelectProps, N as NumberFieldDef, O as ObjectFieldDef, R as RadioFieldDef, S as SelectFieldDef, j as SlotFieldDef, T as TextFieldDef, k as TextareaFieldDef } from '../types-OUl0mK1k.js';
5
+ import { a as InspectorFieldDef, F as FieldRenderer, I as InspectorFields, b as FieldTextProps, c as FieldNumberProps, d as FieldSliderProps, e as FieldSelectManyProps, f as FieldSelectOneProps, g as FieldOption } from '../types-C97TAUKi.js';
6
+ export { A as ArrayFieldDef, C as CustomFieldDef, h as CustomFieldRenderProps, i as FieldSelectProps, N as NumberFieldDef, O as ObjectFieldDef, R as RadioFieldDef, S as SelectFieldDef, j as SlotFieldDef, T as TextFieldDef, k as TextareaFieldDef } from '../types-C97TAUKi.js';
7
7
  import { R as ResolvableItem } from '../resolve-D68pb3Bx.js';
8
8
  export { F as FieldsWords } from '../words-vhnV8sM7.js';
9
9
  export { LinkFilter, LinkFilterField, LinkKindChoice, LinkOption, LinkOptionGroup, LinkPicker, LinkPickerProps, LinkRules, LinkTarget } from 'efficient-shell/ui';
@@ -1 +1 @@
1
- export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-PEDDDWSG.js";export{FieldSelect,FieldSlider,optionFor}from"../chunk-OZ72A6MY.js";import"../chunk-4JSBIW5H.js";import"../chunk-GZH4UVDH.js";import"../chunk-K56YDHYQ.js";import"../chunk-KFV7N2DJ.js";export{useResolvedFields}from"../chunk-YRLPFZW3.js";import"../chunk-EA2HTX37.js";export{FieldNumber}from"../chunk-66LWADFP.js";import"../chunk-QLD57GBB.js";import"../chunk-FFYXVAAL.js";import"../chunk-MFIRYGHW.js";import"../chunk-67GNT6PF.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
1
+ export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-26GHWMNN.js";export{FieldSlider}from"../chunk-XWFH2NHZ.js";import"../chunk-4JSBIW5H.js";import"../chunk-RC25EGHD.js";import"../chunk-K56YDHYQ.js";import"../chunk-KFV7N2DJ.js";export{useResolvedFields}from"../chunk-YRLPFZW3.js";import"../chunk-EA2HTX37.js";export{FieldNumber}from"../chunk-66LWADFP.js";export{FieldSelect,optionFor}from"../chunk-65Z5FSAW.js";import"../chunk-XJCMEEBH.js";import"../chunk-FFYXVAAL.js";import"../chunk-MFIRYGHW.js";import"../chunk-67GNT6PF.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
@@ -2,7 +2,7 @@ import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
3
  import { W as WordFit } from '../wordFit-7XpmhcaW.js';
4
4
  import { P as PanelWords } from '../words-zH1H0WFw.js';
5
- export { CornerOption as SettingsCornerPoint, CornersInput as SettingsCorners, CornersInputProps as SettingsCornersProps, AlignmentGrid as SettingsPlacement, AlignmentPoint as SettingsPlacementPoint, AlignmentGridProps as SettingsPlacementProps } from 'efficient-shell/ui';
5
+ export { BorderInput as SettingsBorder, BorderLineStyle as SettingsBorderLineStyle, BorderInputProps as SettingsBorderProps, BorderValue as SettingsBorderValue, CornerOption as SettingsCornerPoint, CornersInput as SettingsCorners, CornersInputProps as SettingsCornersProps, AlignmentGrid as SettingsPlacement, AlignmentPoint as SettingsPlacementPoint, AlignmentGridProps as SettingsPlacementProps, SidesInput as SettingsSides, SidesEachToggle as SettingsSidesEach, SidesInputProps as SettingsSidesProps, SidesValue as SettingsSidesValue, borderSides, borderStartEach, sidesStartEach } from 'efficient-shell/ui';
6
6
  export { a as DESIGN_GROUPS, D as DesignGroup, b as SETTINGS_BUCKETS, S as SettingsBucket } from '../buckets-Tj-nkBpg.js';
7
7
 
8
8
  /**
@@ -1,19 +1,19 @@
1
- export{DESIGN_GROUPS,SETTINGS_BUCKETS,SettingsField,SettingsGroup}from"../chunk-GZH4UVDH.js";import{DEFAULT_PANEL_WORDS as e}from"../chunk-KFV7N2DJ.js";export{SettingsSegmented,SettingsSwitch}from"../chunk-QLD57GBB.js";import{withTip as n}from"../chunk-P2VEMZH5.js";import{Tabs as t,CountBadge as i,Tooltip as l}from"efficient-shell/ui";export{CornersInput as SettingsCorners,AlignmentGrid as SettingsPlacement}from"efficient-shell/ui";import{jsx as s,jsxs as a,Fragment as r}from"react/jsx-runtime";import{RevertIcon as c}from"efficient-shell/icons/efficient";function d(e){const n=e[0];if(!n?.htmlId||!n.htmlId.endsWith(`-tab-${n.id}`))return;const t=n.htmlId.slice(0,-`-tab-${n.id}`.length);return e.every(e=>e.htmlId===`${t}-tab-${e.id}`)?t:void 0}function o({items:n,activeId:l,onSelect:c,ariaLabel:o=e.settings,idPrefix:u,className:m}){
1
+ export{DESIGN_GROUPS,SETTINGS_BUCKETS,SettingsGroup}from"../chunk-RC25EGHD.js";import{DEFAULT_PANEL_WORDS as e}from"../chunk-KFV7N2DJ.js";export{SettingsField,SettingsSegmented,SettingsSwitch}from"../chunk-XJCMEEBH.js";import{withTip as t}from"../chunk-P2VEMZH5.js";import{Tabs as s,CountBadge as i,Tooltip as n}from"efficient-shell/ui";export{BorderInput as SettingsBorder,CornersInput as SettingsCorners,AlignmentGrid as SettingsPlacement,SidesInput as SettingsSides,SidesEachToggle as SettingsSidesEach,borderSides,borderStartEach,sidesStartEach}from"efficient-shell/ui";import{jsx as a,jsxs as l,Fragment as r}from"react/jsx-runtime";import{RevertIcon as d}from"efficient-shell/icons/efficient";function c(e){const t=e[0];if(!t?.htmlId||!t.htmlId.endsWith(`-tab-${t.id}`))return;const s=t.htmlId.slice(0,-`-tab-${t.id}`.length);return e.every(e=>e.htmlId===`${s}-tab-${e.id}`)?s:void 0}function o({items:t,activeId:n,onSelect:d,ariaLabel:o=e.settings,idPrefix:u,className:m}){
2
2
  /* @__PURE__ */
3
- return s("div",{className:"es-tabs-fit",children:/* @__PURE__ */s(t,{variant:"pill","aria-label":o,idPrefix:u??d(n),className:m?`es-tabs ${m}`:"es-tabs",value:l,onChange:c,items:n.map(e=>{const n="number"==typeof e.badge&&e.badge>0?/* @__PURE__ */s(i,{count:e.badge,tone:"accent"}):null;return e.icon?{id:e.id,tooltip:e.label,label:/* @__PURE__ */a(r,{children:[
4
- /* @__PURE__ */a("span",{className:"es-tab-tip",children:[
5
- /* @__PURE__ */s("span",{className:"es-tab-icon","aria-hidden":"true",children:e.icon}),
6
- /* @__PURE__ */s("span",{className:"es-tab-word has-icon",children:e.label})]}),n]})}:{id:e.id,label:/* @__PURE__ */a(r,{children:[
7
- /* @__PURE__ */s("span",{className:"es-tab-word",children:e.label}),n]})}})})})}function u({title:e,level:n=3,id:t,className:i}){/* @__PURE__ */
8
- return s(`h${n}`,{id:t,className:i?`es-group-head ${i}`:"es-group-head",children:e})}function m({title:e,level:n=4,id:t,className:i}){/* @__PURE__ */
9
- return s(`h${n}`,{id:t,className:i?`es-group-sub ${i}`:"es-group-sub",children:e})}function b({label:t,changed:i,onReset:l,detail:a,disabled:r,defaultAction:d,words:o,className:u}){const m={...e,...o},b=["es-default-reset"];if(i&&b.push("is-changed"),u&&b.push(u),!i&&d)return b.push("is-pressable"),n(d.title,/* @__PURE__ */s("button",{type:"button",className:b.join(" "),"aria-label":d.title,disabled:r,onClick:d.onPress,children:d.icon}));if(!i)/* @__PURE__ */
10
- return s("span",{className:b.join(" "),"aria-hidden":"true"});const N=m.resetName({label:t});return n(a?m.resetTitle({label:t,detail:a}):N,/* @__PURE__ */s("button",{type:"button",className:b.join(" "),"aria-label":N,"aria-description":a||void 0,disabled:r,onClick:e=>{l(),function(e){const n=e.currentTarget,t=n.closest(".es-field");let i=t?.querySelector(h(".es-field-ctl"))??t?.querySelector(h(".es-field-head"))??null,l=t?null:n.parentElement;for(let e=0;!i&&l&&e<f;e+=1,l=l.parentElement)i=[...l.querySelectorAll(p)].find(e=>e!==n)??null;i?.focus()}(e)},children:/* @__PURE__ */s(c,{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(", "),h=e=>p.split(", ").map(n=>`${e} ${n}`).join(", "),f=4;function N({name:e,preview:n,offPage:t,status:i,onOpen:c,id:d,className:o}){const u=null!=n;/* @__PURE__ */
11
- return a("button",{type:"button",id:d,className:o?`es-drill ${o}`:"es-drill",onClick:c,children:[
12
- /* @__PURE__ */a(l,{content:u?/* @__PURE__ */a(r,{children:[e,
13
- /* @__PURE__ */s("br",{}),n]}):e,describe:!1,className:"es-drill-text",children:[
14
- /* @__PURE__ */s("span",{className:"es-drill-name",children:e}),u?/* @__PURE__ */s("span",{className:t?"es-drill-preview is-offpage":"es-drill-preview",children:n}):null]}),i?/* @__PURE__ */s("span",{className:"es-drill-status",children:i}):null,
15
- /* @__PURE__ */s("span",{className:"es-drill-chev","aria-hidden":"true"})]})}function g({label:e,onPress:n,disabled:t,note:i,done:l,doneLabel:r,icon:c,id:d,className:o}){const u=void 0===r?e:r,m=l?u:e,b=null!=i,p=b&&d?`${d}-note`:void 0;/* @__PURE__ */
16
- return a("div",{className:o?`es-action-wrap ${o}`:"es-action-wrap",children:[
17
- /* @__PURE__ */a("button",{type:"button",id:d,className:l?"es-action is-done":"es-action",disabled:t,"aria-describedby":p,onClick:n,children:[c?/* @__PURE__ */s("span",{className:"es-action-icon","aria-hidden":"true",children:c}):null,
18
- /* @__PURE__ */s("span",{className:"es-action-label",children:m})]}),b?/* @__PURE__ */s("p",{id:p,className:"es-action-note",children:i}):null,
19
- /* @__PURE__ */s("span",{className:"es-action-live",role:"status","aria-live":"polite",children:l?u:null})]})}export{g as SettingsAction,b as SettingsDefaultReset,N as SettingsDrill,u as SettingsGroupHead,m as SettingsGroupSub,o as SettingsTabs};
3
+ return a("div",{className:"es-tabs-fit",children:/* @__PURE__ */a(s,{variant:"pill","aria-label":o,idPrefix:u??c(t),className:m?`es-tabs ${m}`:"es-tabs",value:n,onChange:d,items:t.map(e=>{const t="number"==typeof e.badge&&e.badge>0?/* @__PURE__ */a(i,{count:e.badge,tone:"accent"}):null;return e.icon?{id:e.id,tooltip:e.label,label:/* @__PURE__ */l(r,{children:[
4
+ /* @__PURE__ */l("span",{className:"es-tab-tip",children:[
5
+ /* @__PURE__ */a("span",{className:"es-tab-icon","aria-hidden":"true",children:e.icon}),
6
+ /* @__PURE__ */a("span",{className:"es-tab-word has-icon",children:e.label})]}),t]})}:{id:e.id,label:/* @__PURE__ */l(r,{children:[
7
+ /* @__PURE__ */a("span",{className:"es-tab-word",children:e.label}),t]})}})})})}function u({title:e,level:t=3,id:s,className:i}){/* @__PURE__ */
8
+ return a(`h${t}`,{id:s,className:i?`es-group-head ${i}`:"es-group-head",children:e})}function m({title:e,level:t=4,id:s,className:i}){/* @__PURE__ */
9
+ return a(`h${t}`,{id:s,className:i?`es-group-sub ${i}`:"es-group-sub",children:e})}function h({label:s,changed:i,onReset:n,detail:l,disabled:r,defaultAction:c,words:o,className:u}){const m={...e,...o},h=["es-default-reset"];if(i&&h.push("is-changed"),u&&h.push(u),!i&&c)return h.push("is-pressable"),t(c.title,/* @__PURE__ */a("button",{type:"button",className:h.join(" "),"aria-label":c.title,disabled:r,onClick:c.onPress,children:c.icon}));if(!i)/* @__PURE__ */
10
+ return a("span",{className:h.join(" "),"aria-hidden":"true"});const N=m.resetName({label:s});return t(l?m.resetTitle({label:s,detail:l}):N,/* @__PURE__ */a("button",{type:"button",className:h.join(" "),"aria-label":N,"aria-description":l||void 0,disabled:r,onClick:e=>{n(),function(e){const t=e.currentTarget,s=t.closest(".es-field");let i=s?.querySelector(p(".es-field-ctl"))??s?.querySelector(p(".es-field-head"))??null,n=s?null:t.parentElement;for(let e=0;!i&&n&&e<f;e+=1,n=n.parentElement)i=[...n.querySelectorAll(b)].find(e=>e!==t)??null;i?.focus()}(e)},children:/* @__PURE__ */a(d,{size:15})}))}var b=['input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","button:not([disabled]):not(.es-default-reset)",'[tabindex]:not([tabindex="-1"])'].join(", "),p=e=>b.split(", ").map(t=>`${e} ${t}`).join(", "),f=4;function N({name:e,preview:t,offPage:s,status:i,onOpen:d,id:c,className:o}){const u=null!=t;/* @__PURE__ */
11
+ return l("button",{type:"button",id:c,className:o?`es-drill ${o}`:"es-drill",onClick:d,children:[
12
+ /* @__PURE__ */l(n,{content:u?/* @__PURE__ */l(r,{children:[e,
13
+ /* @__PURE__ */a("br",{}),t]}):e,describe:!1,className:"es-drill-text",children:[
14
+ /* @__PURE__ */a("span",{className:"es-drill-name",children:e}),u?/* @__PURE__ */a("span",{className:s?"es-drill-preview is-offpage":"es-drill-preview",children:t}):null]}),i?/* @__PURE__ */a("span",{className:"es-drill-status",children:i}):null,
15
+ /* @__PURE__ */a("span",{className:"es-drill-chev","aria-hidden":"true"})]})}function g({label:e,onPress:t,disabled:s,note:i,done:n,doneLabel:r,icon:d,id:c,className:o}){const u=void 0===r?e:r,m=n?u:e,h=null!=i,b=h&&c?`${c}-note`:void 0;/* @__PURE__ */
16
+ return l("div",{className:o?`es-action-wrap ${o}`:"es-action-wrap",children:[
17
+ /* @__PURE__ */l("button",{type:"button",id:c,className:n?"es-action is-done":"es-action",disabled:s,"aria-describedby":b,onClick:t,children:[d?/* @__PURE__ */a("span",{className:"es-action-icon","aria-hidden":"true",children:d}):null,
18
+ /* @__PURE__ */a("span",{className:"es-action-label",children:m})]}),h?/* @__PURE__ */a("p",{id:b,className:"es-action-note",children:i}):null,
19
+ /* @__PURE__ */a("span",{className:"es-action-live",role:"status","aria-live":"polite",children:n?u:null})]})}export{g as SettingsAction,h as SettingsDefaultReset,N as SettingsDrill,u as SettingsGroupHead,m as SettingsGroupSub,o as SettingsTabs};
@@ -889,10 +889,13 @@ button.es-group-head:hover { background: var(--es-chip-bg); }
889
889
  outline-offset: 1px;
890
890
  }
891
891
 
892
- /* A pressable part explains itself in the shell's Tooltip, whose wrapper is
893
- then the head's item: the rules below place either. */
894
- .es-field-name + .es-default-reset,
895
- .es-field-name + span:has(> .es-default-reset) { margin-left: auto; }
892
+ /* WHATEVER A HOST PUTS IN `action` SITS AT THE ROW'S RIGHT END: the Default /
893
+ Reset part (or the shell Tooltip wrapper round it), a switch, the `Each side`
894
+ toggle of the Padding and Border rows. ONE rule for all of them (plan E-P,
895
+ 2026-10-16), where the Default / Reset part had two of its own. A value, when
896
+ drawn, already takes the free space (`.es-field-value`), and the action
897
+ follows it. */
898
+ .es-field-name + :not(.es-field-value) { margin-left: auto; }
896
899
 
897
900
  /* THE GREY VALUE IS THE "DEFAULT" WORD NOW (option E): a row whose slot is
898
901
  empty draws its value grey, and the value takes the text colour once the
@@ -1 +1 @@
1
- export{AddBlockRow as default}from"../../chunk-X5SPTRG3.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-FJRAYUCX.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-JTUUIVBZ.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-PEDDDWSG.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{AddBlockRow as default}from"../../chunk-4CE7XFCE.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-LGDQLTJW.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-JTUUIVBZ.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-26GHWMNN.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-RC25EGHD.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-65Z5FSAW.js";import"../../chunk-XJCMEEBH.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{blockKey,AddSidePanel as default,sectionKey,templateKey}from"../../chunk-NRC43NHG.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-PPL7GB7D.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-FJRAYUCX.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-JTUUIVBZ.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-PEDDDWSG.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-FCLW4LEN.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{blockKey,AddSidePanel as default,sectionKey,templateKey}from"../../chunk-XTDBTCVO.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-PPL7GB7D.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-LGDQLTJW.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-JTUUIVBZ.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-26GHWMNN.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-RC25EGHD.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-65Z5FSAW.js";import"../../chunk-XJCMEEBH.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-FCLW4LEN.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{MediaSidePanel as default}from"../../chunk-CKBGJ53M.js";import"../../chunk-FJRAYUCX.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-PEDDDWSG.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{MediaSidePanel as default}from"../../chunk-2AKW6UXX.js";import"../../chunk-LGDQLTJW.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-26GHWMNN.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-RC25EGHD.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-65Z5FSAW.js";import"../../chunk-XJCMEEBH.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{ScreenChrome as default}from"../../chunk-W3BK5T4O.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-BRDCD4LK.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-OGCROOTI.js";import"../../chunk-7F52SZOI.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-BHRC3ASL.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-OWW44DVK.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-TZIIRGVY.js";import"../../chunk-VNN6VB4V.js";import"../../chunk-NMUS2VVD.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-D6N77AOS.js";import"../../chunk-P4CL4YQI.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-W4U4SHKW.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-THZ46DC5.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-V7U33NF2.js";import"../../chunk-5545A3PC.js";import"../../chunk-NRC43NHG.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-PPL7GB7D.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-CKBGJ53M.js";import"../../chunk-FJRAYUCX.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-JTUUIVBZ.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-PEDDDWSG.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-4VJATVVR.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-FCLW4LEN.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{ScreenChrome as default}from"../../chunk-BPLCMQ6S.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-BRDCD4LK.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-OGCROOTI.js";import"../../chunk-7F52SZOI.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-BHRC3ASL.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-OWW44DVK.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-TZIIRGVY.js";import"../../chunk-XO7OUCZV.js";import"../../chunk-K2YSFVOJ.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-D6N77AOS.js";import"../../chunk-P4CL4YQI.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-W4U4SHKW.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-THZ46DC5.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-V7U33NF2.js";import"../../chunk-5545A3PC.js";import"../../chunk-XTDBTCVO.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-PPL7GB7D.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-2AKW6UXX.js";import"../../chunk-LGDQLTJW.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-JTUUIVBZ.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-26GHWMNN.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-RC25EGHD.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-4VJATVVR.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-65Z5FSAW.js";import"../../chunk-XJCMEEBH.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-FCLW4LEN.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";