efficient-easel 0.97.0 → 0.98.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 +2 -2
  2. package/dist/autosave/index.d.ts +4 -4
  3. package/dist/{buckets-1vRlQceY.d.ts → buckets-CuLM47h9.d.ts} +1 -1
  4. package/dist/chrome/chrome.css +25 -16
  5. package/dist/chrome/index.d.ts +6 -6
  6. package/dist/chrome/index.js +6 -6
  7. package/dist/chunk-2UX75JDP.js +1 -0
  8. package/dist/{chunk-STFMZJKU.js → chunk-66CKSTXP.js} +6 -6
  9. package/dist/{chunk-YIMRTIBN.js → chunk-IBOFSS56.js} +1 -1
  10. package/dist/chunk-PI26YXYD.js +462 -0
  11. package/dist/copy/copy.css +5 -5
  12. package/dist/copy/index.d.ts +5 -5
  13. package/dist/copy/index.js +10 -10
  14. package/dist/drag/drag.css +15 -15
  15. package/dist/drag/index.js +5 -5
  16. package/dist/edit-lock/index.d.ts +1 -1
  17. package/dist/editor/index.d.ts +2 -2
  18. package/dist/fields/fields.css +126 -12
  19. package/dist/fields/index.d.ts +59 -11
  20. package/dist/fields/index.js +40 -33
  21. package/dist/gold/index.d.ts +1 -1
  22. package/dist/icons/index.d.ts +26 -5
  23. package/dist/icons/index.js +1 -1
  24. package/dist/index.d.ts +1 -1
  25. package/dist/index.js +1 -1
  26. package/dist/menu/menu.css +4 -4
  27. package/dist/node-ops/index.js +1 -1
  28. package/dist/panel/index.d.ts +10 -10
  29. package/dist/panel/panel.css +34 -25
  30. package/dist/pick/pick.css +8 -8
  31. package/dist/rail/index.d.ts +2 -2
  32. package/dist/rail/index.js +1 -1
  33. package/dist/rail/rail.css +1 -1
  34. package/dist/render/index.d.ts +1 -1
  35. package/dist/shell/index.d.ts +24 -4
  36. package/dist/shell/index.js +1 -1
  37. package/dist/shell/shell.css +12 -2
  38. package/dist/strings/catalogue.d.ts +4 -4
  39. package/dist/strings/index.d.ts +4 -4
  40. package/dist/style-clipboard/index.js +1 -1
  41. package/dist/tree/index.d.ts +1 -1
  42. package/dist/tree/index.js +1 -1
  43. package/dist/tree/tree.css +11 -11
  44. package/dist/{types-CEqUFH2j.d.ts → types-C7HFvdtk.d.ts} +26 -4
  45. package/dist/{types-CuNiSnX6.d.ts → types-CnRzp9oc.d.ts} +1 -1
  46. package/dist/{words-CsRWXkY4.d.ts → words-Cqmyey0s.d.ts} +2 -2
  47. package/dist/{words-DfxEp_RH.d.ts → words-bOMsUJk9.d.ts} +1 -1
  48. package/package.json +1 -1
  49. package/dist/chunk-FI23ALVJ.js +0 -1
  50. package/dist/chunk-YNZZYHA4.js +0 -450
@@ -15,7 +15,7 @@
15
15
  */
16
16
 
17
17
  .es-copy {
18
- --es-copy-gap: 4px;
18
+ --es-copy-gap: var(--es-space-8, 8px);
19
19
  /* efficient-shell's IconButton at its default size, md (design v5, 0.94.0). */
20
20
  --es-copy-mark-size: 32px;
21
21
  --es-copy-mark-ink: var(--es-text-muted, #6b7280);
@@ -26,7 +26,7 @@
26
26
  --es-copy-field-bg: var(--es-field-bg, #ffffff);
27
27
  /** The field's inner inset. On the SURFACES, never on the box — see
28
28
  * `.es-copy-box` below for the caret bug that rule exists to stop. */
29
- --es-copy-field-pad: 4px 6px;
29
+ --es-copy-field-pad: 4px 8px;
30
30
  --es-copy-field-ring: var(--es-accent, #2563eb);
31
31
  --es-copy-radius: 4px;
32
32
 
@@ -92,7 +92,7 @@
92
92
  .es-copy-mark {
93
93
  height: var(--es-copy-mark-size);
94
94
  min-width: var(--es-copy-mark-size);
95
- padding: 0 5px;
95
+ padding: 0 4px;
96
96
  border: 0;
97
97
  border-radius: 6px;
98
98
  background: transparent;
@@ -227,7 +227,7 @@
227
227
  box-sizing: border-box;
228
228
  width: 100%;
229
229
  height: 32px;
230
- padding: 0 10px;
230
+ padding: 0 12px;
231
231
  border: 1px solid var(--es-copy-field-border);
232
232
  border-radius: var(--es-field-radius, 6px);
233
233
  background: var(--es-copy-field-bg);
@@ -260,7 +260,7 @@
260
260
 
261
261
  .es-copy-link-btn {
262
262
  height: 28px;
263
- padding: 0 10px;
263
+ padding: 0 12px;
264
264
  border: 1px solid var(--es-btn-border, var(--es-copy-field-border));
265
265
  border-radius: var(--es-field-radius, 6px);
266
266
  background: var(--es-raised, #fff);
@@ -1,8 +1,8 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
3
  import { MarkStyle, MarkupTool, WrapResult, InlineRule } from '../markup/index.js';
4
- import { a as CopyAlign } from '../words-DfxEp_RH.js';
5
- export { b as COPY_ALIGNS, c as COPY_ALIGN_FIT, d as COPY_ALIGN_GLYPHS, e as COPY_ALIGN_LABELS, C as CopyWords, f as copyAlignOptions } from '../words-DfxEp_RH.js';
4
+ import { a as CopyAlign } from '../words-bOMsUJk9.js';
5
+ export { b as COPY_ALIGNS, c as COPY_ALIGN_FIT, d as COPY_ALIGN_GLYPHS, e as COPY_ALIGN_LABELS, C as CopyWords, f as copyAlignOptions } from '../words-bOMsUJk9.js';
6
6
 
7
7
  /** `'b'` → `Meta+B`, `'shift+x'` → `Meta+Shift+X` — the ARIA spelling of a
8
8
  * shortcut. Meta is what the tooltips promise (⌘); Ctrl works too. */
@@ -16,7 +16,7 @@ interface MarkBarProps {
16
16
  *
17
17
  * `MarkStyle[]` resolved against the shared grammar's `MARKUP_TOOLS`, in
18
18
  * that order. What the campaign designer passes.
19
- * `MarkupTool[]` used verbatim. What `efficient-shop` passes.
19
+ * `MarkupTool[]` used verbatim. What `efficient-storefront` passes.
20
20
  *
21
21
  * ⚠️ WHY VERBATIM DESCRIPTORS HAD TO EXIST. The storefront offered SEVEN
22
22
  * marks: the grammar's four, plus its three word styles (`@@`, `++`, `^^`),
@@ -49,7 +49,7 @@ interface MarkBarProps {
49
49
  * how they LOOK is the host's, "because this bar has to belong to the
50
50
  * storefront inspector's chrome and the campaign designer's bar has to belong
51
51
  * to the portal's". Colour was delegated by tokens on day one; the DRAWING was
52
- * not, and a letter is a drawing. `efficient-shop` renders each mark as a 14px
52
+ * not, and a letter is a drawing. `efficient-storefront` renders each mark as a 14px
53
53
  * stroked SVG at the weight of its other inspector glyphs, on the stated
54
54
  * ground that the row should read "as part of the field rather than as
55
55
  * pasted-in icons" — so without this it could not adopt the bar without losing
@@ -69,7 +69,7 @@ interface MarkBarProps {
69
69
  *
70
70
  * A bar bound to one box needs nothing more. A bar SHARED by several rows has
71
71
  * to say which row it is aimed at, because the visible cue — the marked row —
72
- * is not readable. `efficient-shop` has that case today.
72
+ * is not readable. `efficient-storefront` has that case today.
73
73
  */
74
74
  ariaLabel?: string;
75
75
  /**
@@ -1,10 +1,10 @@
1
- import{DEFAULT_COPY_WORDS as e}from"../chunk-2LUSK32B.js";import{SettingsSegmented as t}from"../chunk-QB3BZIRA.js";import{GoldTextInput as n}from"../chunk-CERTFXCV.js";import{applyMark as l,STANDARD_MARKUP as r,writeMarkedLines as o,sameMarks as i,markedLines as a,spanFor as s,markupTools as c,findLink as u,markedAt as d,removeLink as p,writeLink as h,isSafeLinkHref as f}from"../chunk-6OPSJGAI.js";import{useWords as m}from"../chunk-MFIRYGHW.js";import"../chunk-BZ5ASXOL.js";import{AlignSeparateIcon as y,AlignRightIcon as b,AlignCenterIcon as g,AlignLeftIcon as k,ClearMarksIcon as v,LinkIcon as x,QuietIcon as C,EmphasisIcon as w,StrikeIcon as S,ItalicIcon as N,BoldIcon as D}from"../chunk-YNZZYHA4.js";import{useRef as j,useLayoutEffect as E,useState as L,useEffect as K,useId as P}from"react";import{jsx as A,jsxs as T,Fragment as z}from"react/jsx-runtime";var B=["left","center","right","justify"],R=e.align,$={left:/* @__PURE__ */A(k,{}),center:/* @__PURE__ */A(g,{}),right:/* @__PURE__ */A(b,{}),justify:/* @__PURE__ */A(y,{})},M={three:{labelsPx:94.5,widestLabelPx:39.94},four:{labelsPx:140,widestLabelPx:44}};function F(e,t=R){return B.filter(t=>e.includes(t)).map(e=>({id:e,label:t[e],icon:$[e],title:t[e]}))}var Z=/[\u1100-\u11ff\u2e80-\u9fff\uac00-\ud7af\uf900-\ufaff\uff00-\uffef]/;function I(e){if(e.every(e=>e.label===R[e.id]))return e.length>3?M.four:M.three;const t=e.map(e=>[...e.label].reduce((e,t)=>e+(Z.test(t)?13:8),0));return{labelsPx:t.reduce((e,t)=>e+t,0),widestLabelPx:Math.max(0,...t)}}function Y(e,t){const n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}}function q(e,t,n,r=l){const{start:o,end:i}=Y(e,n);return r(e,o,i,t)}function H(e,t,n){const{start:l,end:r}=Y(e,n),o=l+t.length;return{text:e.slice(0,l)+t+e.slice(r),selectionStart:o,selectionEnd:o}}var O=1e3;function U(e=200){let t=[],n=[],l=null,r=0;return{record(o,i,a){const s="type"===i&&"type"===l&&a-r<1e3;l=i,r=a,n=[],s||(t.push(o),t.length>e&&t.shift())},undo(e){const r=t.pop();return r?(n.push(e),l=null,r):null},redo(e){const r=n.pop();return r?(t.push(e),l=null,r):null},reset(){t=[],n=[],l=null}}}function G({href:t,editing:n,onApply:l,onRemove:r,onClose:o}){const i=m("copy",e).link,a=P(),[s,c]=L(t),[u,d]=L(!1),p=j(null);K(()=>{p.current?.focus(),p.current?.select()},[]);const h=()=>{const e=s.trim();f(e)?l(e):d(!0)};/* @__PURE__ */
2
- return T("div",{role:"dialog","aria-label":i.title,className:"es-copy-link",onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),h()):"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),o())},children:[
3
- /* @__PURE__ */A("label",{htmlFor:a,className:"es-copy-link-label",children:i.label}),
4
- /* @__PURE__ */A("input",{ref:p,id:a,type:"text",className:"es-copy-link-input",value:s,placeholder:i.placeholder,spellCheck:!1,autoComplete:"off","aria-invalid":u||void 0,"aria-describedby":u?`${a}-why`:void 0,onChange:e=>{c(e.target.value),d(!1)}}),u?/* @__PURE__ */A("p",{id:`${a}-why`,role:"alert",className:"es-copy-link-why",children:i.refused}):null,
5
- /* @__PURE__ */T("div",{className:"es-copy-link-actions",children:[n?/* @__PURE__ */A("button",{type:"button",className:"es-copy-link-btn",onClick:r,children:i.remove}):null,
6
- /* @__PURE__ */A("button",{type:"button",className:"es-copy-link-btn is-primary",onClick:h,disabled:""===s.trim(),children:i.apply})]})]})}var W=/* @__PURE__ */new Set(["script","style","head","title","meta","link","template","noscript","svg","math","object","iframe"]),X=/* @__PURE__ */new Set(["p","div","li","ul","ol","dl","dt","dd","h1","h2","h3","h4","h5","h6","blockquote","pre","table","thead","tbody","tfoot","tr","section","article","header","footer","aside","nav","figure","figcaption","address","hr"]);function J(e,t){const n=t.rules??r,l=e.html&&""!==e.html.trim()?function(e,t,n){const l=t.createElement("template");l.innerHTML=e;const r=[[]],s=()=>r[r.length-1],c=()=>{const e=s();for(;e.length>0&&" "===e[e.length-1].ch;)e.pop();e.length>0&&r.push([])},u=(e,t,n,l)=>{if(3===e.nodeType){for(const r of e.textContent??""){const e=/\s/.test(r)?" ":r,o=s();(" "!==e||0!==o.length&&" "!==o[o.length-1].ch)&&o.push({ch:e,bold:t,italic:n,href:l})}return}if(1!==e.nodeType&&11!==e.nodeType)return;const o=e,i=1===e.nodeType?o.localName:"";if(W.has(i))return;if("br"===i)return void r.push([]);let a=t,d=n,p=l;if("b"!==i&&"strong"!==i||(a=!0),"i"!==i&&"em"!==i||(d=!0),"a"===i){const e=(o.getAttribute("href")??"").trim();p=f(e)?e:null}const h=1===e.nodeType?o.style:null;if(h){const e=h.fontWeight;"bold"===e||"bolder"===e||Number(e)>=600?a=!0:("normal"===e||"lighter"===e||""!==e&&Number(e)<600)&&(a=!1),"italic"===h.fontStyle||"oblique"===h.fontStyle?d=!0:"normal"===h.fontStyle&&(d=!1)}const m=X.has(i);m&&c();for(const t of[...e.childNodes])u(t,a,d,p);m&&c()};u(l.content,!1,!1,null);for(;r.length>1&&0===r[r.length-1].length;)r.pop();return r.map(e=>function(e,t){const n=t=>e.map((n,l)=>n[t]&&(" "!==n.ch||Boolean(e[l-1]?.[t])&&Boolean(e[l+1]?.[t]))),l=[{bold:!0,italic:!0,links:!0},{bold:!0,italic:!1,links:!0},{bold:!1,italic:!1,links:!0},{bold:!1,italic:!1,links:!1}];for(const r of l){const l=Q(e,r.bold?n("bold"):null,r.italic?n("italic"):null,r.links),s=o([l]).text;if(i([l],a(s,t)))return s}return e.map(e=>e.ch).join("")}(e,n))}(e.html,t.doc,n):(e.text??"").replace(/\r\n?/g,"\n").split("\n");return t.multiline?l.join("\n"):l.map(e=>e.trim()).filter(e=>""!==e).join(" ")}function Q(e,t,n,l){let r=0,o=null,i=null,a=null;return{bullet:!1,chars:e.map((e,c)=>{const u=l?e.href:null;return o=null===u?null:o&&o.href===u?o:s(++r,"link",u),i=t?.[c]?i??s(++r,"bold"):null,a=n?.[c]?a??s(++r,"italic"):null,{ch:e.ch,at:-1,marks:[o,i,a].filter(e=>null!==e)}})}}var V={bold:/* @__PURE__ */A(D,{size:16}),italic:/* @__PURE__ */A(N,{size:16}),strike:/* @__PURE__ */A(S,{size:16}),highlight:/* @__PURE__ */A(w,{size:16}),quiet:/* @__PURE__ */A(C,{size:16}),link:/* @__PURE__ */A(x,{size:16}),clear:/* @__PURE__ */A(v,{size:16})};function _(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 ee={bold:"is-bold",italic:"is-italic",strike:"is-strike"};function te({tools:t,onApply:n,disabled:l=!1,actions:r,align:o,glyphs:i,ariaLabel:a,pressed:s,open:u=null}){const d=m("copy",e),p="string"==typeof t[0]?c(t).map(e=>({...e,...d.marks[e.style]})):t;return 0!==p.length||r||o?/* @__PURE__ */T("div",{className:"es-copy-bar",role:"group","aria-label":a??d.formatting,children:[p.map(e=>{const t=i?.[e.style]??V[e.style],r=u===e.style||Boolean(s?.[e.style]);/* @__PURE__ */
7
- return A("button",{type:"button",onMouseDown:e=>e.preventDefault(),onClick:()=>n(e.style),disabled:l,title:e.title,"aria-label":e.name??e.title,"aria-keyshortcuts":_(e.shortcut),"aria-pressed":s||u?r:void 0,"aria-haspopup":"link"===e.style&&s?"dialog":void 0,"aria-expanded":"link"===e.style&&s?"link"===u:void 0,className:`es-copy-mark${t?" has-glyph":ee[e.style]?` ${ee[e.style]}`:""}${r?" is-active":""}`,children:t??e.label},e.style)}),r?/* @__PURE__ */T(z,{children:[
8
- /* @__PURE__ */A("span",{className:"es-copy-bar-split","aria-hidden":"true"}),r]}):null,o?/* @__PURE__ */A("span",{className:"es-copy-bar-end",children:o}):null]}):null}function ne({target:e,onChange:t}){const n=j(null);return E(()=>{const t=n.current,l=e.current;t&&l&&l.value===t.text&&(n.current=null,l.focus(),l.setSelectionRange(t.start,t.end))}),l=>{const r=l(e.current);t(r.text),n.current={start:r.selectionStart,end:r.selectionEnd,text:r.text}}}function le({value:o,onChange:i,onCommit:a,onCancel:s,multiline:f=!1,placeholder:y,ariaLabel:b,className:g,readOnly:k=!1,rules:v,tools:x=[],writeMark:C,actions:w,align:S,glyphs:N,barLabel:D,renderFooter:E,inputRef:P,barShows:z="always"}){const B=m("copy",e),R=j(null),$=P??R,[M,Z]=L(!1),[Y,O]=L(null),W=j(U()).current,X=j(null);K(()=>{const e=X.current;e&&o===e.to?X.current=null:e&&o===e.from||(X.current=null,W.reset())},[o,W]);const Q=e=>{X.current={from:X.current?.from??o,to:e},i(e)},V=e=>({text:o,start:e?.selectionStart??Y?.start??o.length,end:e?.selectionEnd??Y?.end??o.length}),_=ne({target:$,onChange:Q}),ee=e=>(O({start:e.selectionStart,end:e.selectionEnd}),e),le=e=>_(t=>(W.record(V(t),"edit",Date.now()),ee(e(t)))),[re,oe]=L(null),ie=v??r,ae="string"==typeof x[0]?c(x):x,se=ae.map(e=>e.style),ce={};if(Y)for(const e of se)ce[e]="link"===e?null!==u(o,Y.start,Y.end):d(o,Y.start,Y.end,e);const ue=e=>{if("clear"===e)return void le(t=>q(o,e,t,(e,t,n)=>l(e,t,n,"clear",ie)));if("link"!==e){const t=C??((e,t,n,o)=>l(e,t,n,o,r,B.placeholders));return void le(n=>q(o,e,n,t))}const t=$.current,n=t?.selectionStart??o.length,i=t?.selectionEnd??n;oe({start:n,end:i,link:u(o,n,i)})},de=S?F(S.allow,B.align):[];/* @__PURE__ */
9
- return T("div",{className:"es-copy"+(g?` ${g}`:""),onFocus:()=>Z(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||Z(!1)},onKeyDown:e=>{if(k||e.target!==$.current)return;if(e.altKey||e.metaKey===e.ctrlKey)return;const t=e.key.toLowerCase(),n="KeyZ"===e.code||"z"===t,l=("KeyY"===e.code||"y"===t)&&!e.shiftKey;if(n||l)return e.preventDefault(),e.stopPropagation(),r=l||e.shiftKey?"redo":"undo",void _(e=>{const t=V(e),n=W[r](t);return ee(n?{text:n.text,selectionStart:n.start,selectionEnd:n.end}:{text:t.text,selectionStart:t.start,selectionEnd:t.end})});var r;const o=`${e.shiftKey?"shift+":""}${t}`,i=ae.find(e=>e.shortcut===o);i&&(e.preventDefault(),e.stopPropagation(),ue(i.style))},onPaste:e=>{const t=$.current;if(k||!t||e.target!==t)return;e.preventDefault();const n=J({html:e.clipboardData.getData("text/html"),text:e.clipboardData.getData("text/plain")},{doc:t.ownerDocument,multiline:f,rules:ie});le(e=>H(o,n,e))},onSelect:()=>{const e=$.current;e&&e.ownerDocument.activeElement===e&&O({start:e.selectionStart??o.length,end:e.selectionEnd??o.length})},children:["always"===z||M||null!==re?/* @__PURE__ */A(te,{tools:x,disabled:k,actions:w,glyphs:N,ariaLabel:D,pressed:ce,open:re?"link":null,onApply:ue,align:S?/* @__PURE__ */A(t,{options:de,value:S.value,onChange:S.onChange,ariaLabel:B.alignment,disabled:k||S.disabled,fit:I(de)}):null}):null,
10
- /* @__PURE__ */A(n,{value:o,onInput:e=>{W.record(V(null),"type",Date.now()),Q(e)},onCommit:a,onCancel:s,multiline:f,placeholder:y,ariaLabel:b,rules:v,disabled:k,inputRef:$,className:"es-copy-box"}),re?/* @__PURE__ */A(G,{href:re.link?.href??"",editing:null!==re.link,onApply:e=>{const t=re;oe(null),le(()=>h(o,t.start,t.end,e))},onRemove:()=>{const e=re.link;oe(null),e&&le(()=>p(o,e))},onClose:()=>{oe(null),$.current?.focus()}}):null,E?E({focused:M,insert:e=>le(t=>H(o,e,t))}):null]})}export{B as COPY_ALIGNS,M as COPY_ALIGN_FIT,$ as COPY_ALIGN_GLYPHS,R as COPY_ALIGN_LABELS,le as CopyBox,te as MarkBar,O as TYPING_BURST_MS,_ as ariaShortcut,F as copyAlignOptions,U as createHistory,H as insertSelection,q as markSelection,J as pasteToMarkup,ne as useCaretEdit};
1
+ import{DEFAULT_COPY_WORDS as e}from"../chunk-2LUSK32B.js";import{SettingsSegmented as t}from"../chunk-QB3BZIRA.js";import{GoldTextInput as n}from"../chunk-CERTFXCV.js";import{applyMark as l,STANDARD_MARKUP as r,writeMarkedLines as o,sameMarks as i,markedLines as a,spanFor as s,markupTools as c,findLink as u,markedAt as d,removeLink as p,writeLink as h,isSafeLinkHref as f}from"../chunk-6OPSJGAI.js";import{useWords as m}from"../chunk-MFIRYGHW.js";import"../chunk-BZ5ASXOL.js";import{AlignSeparateIcon as y,AlignRightIcon as b,AlignCenterIcon as g,AlignLeftIcon as k,ClearMarksIcon as v,LinkIcon as x,QuietIcon as C,EmphasisIcon as w,StrikeIcon as S,ItalicIcon as D,BoldIcon as N}from"../chunk-PI26YXYD.js";import{useRef as j,useLayoutEffect as E,useState as L,useEffect as P,useId as K}from"react";import{jsx as T,jsxs as z,Fragment as A}from"react/jsx-runtime";var B=["left","center","right","justify"],R=e.align,$={left:/* @__PURE__ */T(k,{}),center:/* @__PURE__ */T(g,{}),right:/* @__PURE__ */T(b,{}),justify:/* @__PURE__ */T(y,{})},M={three:{labelsPx:94.5,widestLabelPx:39.94},four:{labelsPx:140,widestLabelPx:44}};function F(e,t=R){return B.filter(t=>e.includes(t)).map(e=>({id:e,label:t[e],icon:$[e],title:t[e]}))}var I=/[\u1100-\u11ff\u2e80-\u9fff\uac00-\ud7af\uf900-\ufaff\uff00-\uffef]/;function Y(e){if(e.every(e=>e.label===R[e.id]))return e.length>3?M.four:M.three;const t=e.map(e=>[...e.label].reduce((e,t)=>e+(I.test(t)?13:8),0));return{labelsPx:t.reduce((e,t)=>e+t,0),widestLabelPx:Math.max(0,...t)}}function q(e,t){const n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}}function O(e,t,n,r=l){const{start:o,end:i}=q(e,n);return r(e,o,i,t)}function U(e,t,n){const{start:l,end:r}=q(e,n),o=l+t.length;return{text:e.slice(0,l)+t+e.slice(r),selectionStart:o,selectionEnd:o}}var X=1e3;function Z(e=200){let t=[],n=[],l=null,r=0;return{record(o,i,a){const s="type"===i&&"type"===l&&a-r<1e3;l=i,r=a,n=[],s||(t.push(o),t.length>e&&t.shift())},undo(e){const r=t.pop();return r?(n.push(e),l=null,r):null},redo(e){const r=n.pop();return r?(t.push(e),l=null,r):null},reset(){t=[],n=[],l=null}}}function G({href:t,editing:n,onApply:l,onRemove:r,onClose:o}){const i=m("copy",e).link,a=K(),[s,c]=L(t),[u,d]=L(!1),p=j(null);P(()=>{p.current?.focus(),p.current?.select()},[]);const h=()=>{const e=s.trim();f(e)?l(e):d(!0)};/* @__PURE__ */
2
+ return z("div",{role:"dialog","aria-label":i.title,className:"es-copy-link",onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),h()):"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),o())},children:[
3
+ /* @__PURE__ */T("label",{htmlFor:a,className:"es-copy-link-label",children:i.label}),
4
+ /* @__PURE__ */T("input",{ref:p,id:a,type:"text",className:"es-copy-link-input",value:s,placeholder:i.placeholder,spellCheck:!1,autoComplete:"off","aria-invalid":u||void 0,"aria-describedby":u?`${a}-why`:void 0,onChange:e=>{c(e.target.value),d(!1)}}),u?/* @__PURE__ */T("p",{id:`${a}-why`,role:"alert",className:"es-copy-link-why",children:i.refused}):null,
5
+ /* @__PURE__ */z("div",{className:"es-copy-link-actions",children:[n?/* @__PURE__ */T("button",{type:"button",className:"es-copy-link-btn",onClick:r,children:i.remove}):null,
6
+ /* @__PURE__ */T("button",{type:"button",className:"es-copy-link-btn is-primary",onClick:h,disabled:""===s.trim(),children:i.apply})]})]})}var H=/* @__PURE__ */new Set(["script","style","head","title","meta","link","template","noscript","svg","math","object","iframe"]),W=/* @__PURE__ */new Set(["p","div","li","ul","ol","dl","dt","dd","h1","h2","h3","h4","h5","h6","blockquote","pre","table","thead","tbody","tfoot","tr","section","article","header","footer","aside","nav","figure","figcaption","address","hr"]);function J(e,t){const n=t.rules??r,l=e.html&&""!==e.html.trim()?function(e,t,n){const l=t.createElement("template");l.innerHTML=e;const r=[[]],s=()=>r[r.length-1],c=()=>{const e=s();for(;e.length>0&&" "===e[e.length-1].ch;)e.pop();e.length>0&&r.push([])},u=(e,t,n,l)=>{if(3===e.nodeType){for(const r of e.textContent??""){const e=/\s/.test(r)?" ":r,o=s();(" "!==e||0!==o.length&&" "!==o[o.length-1].ch)&&o.push({ch:e,bold:t,italic:n,href:l})}return}if(1!==e.nodeType&&11!==e.nodeType)return;const o=e,i=1===e.nodeType?o.localName:"";if(H.has(i))return;if("br"===i)return void r.push([]);let a=t,d=n,p=l;if("b"!==i&&"strong"!==i||(a=!0),"i"!==i&&"em"!==i||(d=!0),"a"===i){const e=(o.getAttribute("href")??"").trim();p=f(e)?e:null}const h=1===e.nodeType?o.style:null;if(h){const e=h.fontWeight;"bold"===e||"bolder"===e||Number(e)>=600?a=!0:("normal"===e||"lighter"===e||""!==e&&Number(e)<600)&&(a=!1),"italic"===h.fontStyle||"oblique"===h.fontStyle?d=!0:"normal"===h.fontStyle&&(d=!1)}const m=W.has(i);m&&c();for(const t of[...e.childNodes])u(t,a,d,p);m&&c()};u(l.content,!1,!1,null);for(;r.length>1&&0===r[r.length-1].length;)r.pop();return r.map(e=>function(e,t){const n=t=>e.map((n,l)=>n[t]&&(" "!==n.ch||Boolean(e[l-1]?.[t])&&Boolean(e[l+1]?.[t]))),l=[{bold:!0,italic:!0,links:!0},{bold:!0,italic:!1,links:!0},{bold:!1,italic:!1,links:!0},{bold:!1,italic:!1,links:!1}];for(const r of l){const l=Q(e,r.bold?n("bold"):null,r.italic?n("italic"):null,r.links),s=o([l]).text;if(i([l],a(s,t)))return s}return e.map(e=>e.ch).join("")}(e,n))}(e.html,t.doc,n):(e.text??"").replace(/\r\n?/g,"\n").split("\n");return t.multiline?l.join("\n"):l.map(e=>e.trim()).filter(e=>""!==e).join(" ")}function Q(e,t,n,l){let r=0,o=null,i=null,a=null;return{bullet:!1,chars:e.map((e,c)=>{const u=l?e.href:null;return o=null===u?null:o&&o.href===u?o:s(++r,"link",u),i=t?.[c]?i??s(++r,"bold"):null,a=n?.[c]?a??s(++r,"italic"):null,{ch:e.ch,at:-1,marks:[o,i,a].filter(e=>null!==e)}})}}var V={bold:/* @__PURE__ */T(N,{size:16}),italic:/* @__PURE__ */T(D,{size:16}),strike:/* @__PURE__ */T(S,{size:16}),highlight:/* @__PURE__ */T(w,{size:16}),quiet:/* @__PURE__ */T(C,{size:16}),link:/* @__PURE__ */T(x,{size:16}),clear:/* @__PURE__ */T(v,{size:16})};function _(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 ee={bold:"is-bold",italic:"is-italic",strike:"is-strike"};function te({tools:t,onApply:n,disabled:l=!1,actions:r,align:o,glyphs:i,ariaLabel:a,pressed:s,open:u=null}){const d=m("copy",e),p="string"==typeof t[0]?c(t).map(e=>({...e,...d.marks[e.style]})):t;return 0!==p.length||r||o?/* @__PURE__ */z("div",{className:"es-copy-bar",role:"group","aria-label":a??d.formatting,children:[p.map(e=>{const t=i?.[e.style]??V[e.style],r=u===e.style||Boolean(s?.[e.style]);/* @__PURE__ */
7
+ return T("button",{type:"button",onMouseDown:e=>e.preventDefault(),onClick:()=>n(e.style),disabled:l,title:e.title,"aria-label":e.name??e.title,"aria-keyshortcuts":_(e.shortcut),"aria-pressed":s||u?r:void 0,"aria-haspopup":"link"===e.style&&s?"dialog":void 0,"aria-expanded":"link"===e.style&&s?"link"===u:void 0,className:`es-copy-mark${t?" has-glyph":ee[e.style]?` ${ee[e.style]}`:""}${r?" is-active":""}`,children:t??e.label},e.style)}),r?/* @__PURE__ */z(A,{children:[
8
+ /* @__PURE__ */T("span",{className:"es-copy-bar-split","aria-hidden":"true"}),r]}):null,o?/* @__PURE__ */T("span",{className:"es-copy-bar-end",children:o}):null]}):null}function ne({target:e,onChange:t}){const n=j(null);return E(()=>{const t=n.current,l=e.current;t&&l&&l.value===t.text&&(n.current=null,l.focus(),l.setSelectionRange(t.start,t.end))}),l=>{const r=l(e.current);t(r.text),n.current={start:r.selectionStart,end:r.selectionEnd,text:r.text}}}function le({value:o,onChange:i,onCommit:a,onCancel:s,multiline:f=!1,placeholder:y,ariaLabel:b,className:g,readOnly:k=!1,rules:v,tools:x=[],writeMark:C,actions:w,align:S,glyphs:D,barLabel:N,renderFooter:E,inputRef:K,barShows:A="always"}){const B=m("copy",e),R=j(null),$=K??R,[M,I]=L(!1),[q,X]=L(null),H=j(Z()).current,W=j(null);P(()=>{const e=W.current;e&&o===e.to?W.current=null:e&&o===e.from||(W.current=null,H.reset())},[o,H]);const Q=e=>{W.current={from:W.current?.from??o,to:e},i(e)},V=e=>({text:o,start:e?.selectionStart??q?.start??o.length,end:e?.selectionEnd??q?.end??o.length}),_=ne({target:$,onChange:Q}),ee=e=>(X({start:e.selectionStart,end:e.selectionEnd}),e),le=e=>_(t=>(H.record(V(t),"edit",Date.now()),ee(e(t)))),[re,oe]=L(null),ie=v??r,ae="string"==typeof x[0]?c(x):x,se=ae.map(e=>e.style),ce={};if(q)for(const e of se)ce[e]="link"===e?null!==u(o,q.start,q.end):d(o,q.start,q.end,e);const ue=e=>{if("clear"===e)return void le(t=>O(o,e,t,(e,t,n)=>l(e,t,n,"clear",ie)));if("link"!==e){const t=C??((e,t,n,o)=>l(e,t,n,o,r,B.placeholders));return void le(n=>O(o,e,n,t))}const t=$.current,n=t?.selectionStart??o.length,i=t?.selectionEnd??n;oe({start:n,end:i,link:u(o,n,i)})},de=S?F(S.allow,B.align):[];/* @__PURE__ */
9
+ return z("div",{className:"es-copy"+(g?` ${g}`:""),onFocus:()=>I(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||I(!1)},onKeyDown:e=>{if(k||e.target!==$.current)return;if(e.altKey||e.metaKey===e.ctrlKey)return;const t=e.key.toLowerCase(),n="KeyZ"===e.code||"z"===t,l=("KeyY"===e.code||"y"===t)&&!e.shiftKey;if(n||l)return e.preventDefault(),e.stopPropagation(),r=l||e.shiftKey?"redo":"undo",void _(e=>{const t=V(e),n=H[r](t);return ee(n?{text:n.text,selectionStart:n.start,selectionEnd:n.end}:{text:t.text,selectionStart:t.start,selectionEnd:t.end})});var r;const o=`${e.shiftKey?"shift+":""}${t}`,i=ae.find(e=>e.shortcut===o);i&&(e.preventDefault(),e.stopPropagation(),ue(i.style))},onPaste:e=>{const t=$.current;if(k||!t||e.target!==t)return;e.preventDefault();const n=J({html:e.clipboardData.getData("text/html"),text:e.clipboardData.getData("text/plain")},{doc:t.ownerDocument,multiline:f,rules:ie});le(e=>U(o,n,e))},onSelect:()=>{const e=$.current;e&&e.ownerDocument.activeElement===e&&X({start:e.selectionStart??o.length,end:e.selectionEnd??o.length})},children:["always"===A||M||null!==re?/* @__PURE__ */T(te,{tools:x,disabled:k,actions:w,glyphs:D,ariaLabel:N,pressed:ce,open:re?"link":null,onApply:ue,align:S?/* @__PURE__ */T(t,{options:de,value:S.value,onChange:S.onChange,ariaLabel:B.alignment,disabled:k||S.disabled,fit:Y(de)}):null}):null,
10
+ /* @__PURE__ */T(n,{value:o,onInput:e=>{H.record(V(null),"type",Date.now()),Q(e)},onCommit:a,onCancel:s,multiline:f,placeholder:y,ariaLabel:b,rules:v,disabled:k,inputRef:$,className:"es-copy-box"}),re?/* @__PURE__ */T(G,{href:re.link?.href??"",editing:null!==re.link,onApply:e=>{const t=re;oe(null),le(()=>h(o,t.start,t.end,e))},onRemove:()=>{const e=re.link;oe(null),e&&le(()=>p(o,e))},onClose:()=>{oe(null),$.current?.focus()}}):null,E?E({focused:M,insert:e=>le(t=>U(o,e,t))}):null]})}export{B as COPY_ALIGNS,M as COPY_ALIGN_FIT,$ as COPY_ALIGN_GLYPHS,R as COPY_ALIGN_LABELS,le as CopyBox,te as MarkBar,X as TYPING_BURST_MS,_ as ariaShortcut,F as copyAlignOptions,Z as createHistory,U as insertSelection,O as markSelection,J as pasteToMarkup,ne as useCaretEdit};
@@ -23,7 +23,7 @@
23
23
  align-items: center;
24
24
  gap: 4px;
25
25
  height: 22px;
26
- padding: 0 8px 0 6px;
26
+ padding: 0 8px;
27
27
  border-radius: 11px;
28
28
  background: var(--es-toast-bg);
29
29
  color: var(--es-on-accent);
@@ -91,7 +91,7 @@
91
91
  }
92
92
  .es-canvas-seam-add {
93
93
  position: relative;
94
- padding: 2px 10px;
94
+ padding: 2px 12px;
95
95
  border: none;
96
96
  border-radius: 999px;
97
97
  background: var(--es-accent);
@@ -150,8 +150,8 @@
150
150
  align-items: center;
151
151
  justify-content: space-between;
152
152
  gap: 8px;
153
- margin: 0 0 10px;
154
- padding: 7px 8px 7px 11px;
153
+ margin: 0 0 12px;
154
+ padding: 8px 8px 8px 12px;
155
155
  border-radius: 8px;
156
156
  background: var(--es-accent-tint);
157
157
  color: var(--es-accent-text);
@@ -175,14 +175,14 @@
175
175
  background: var(--es-accent-tint-strong);
176
176
  }
177
177
  .es-add-hint {
178
- margin: 0 0 10px;
178
+ margin: 0 0 12px;
179
179
  font-size: 12.5px;
180
180
  color: var(--es-muted);
181
181
  }
182
182
  .es-add-search {
183
183
  display: flex;
184
184
  align-items: center;
185
- gap: 9px;
185
+ gap: 8px;
186
186
  margin-bottom: 16px;
187
187
  padding: 0 12px;
188
188
  height: 38px;
@@ -237,13 +237,13 @@
237
237
  color: var(--es-text);
238
238
  }
239
239
  .es-add-group + .es-add-group {
240
- margin-top: 22px;
240
+ margin-top: 16px;
241
241
  }
242
242
  .es-add-group-head {
243
243
  display: flex;
244
244
  align-items: baseline;
245
245
  gap: 8px;
246
- margin-bottom: 11px;
246
+ margin-bottom: 12px;
247
247
  }
248
248
  .es-add-group-title {
249
249
  font-size: 11px;
@@ -259,16 +259,16 @@
259
259
  .es-add-grid {
260
260
  display: grid;
261
261
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
262
- gap: 6px;
262
+ gap: 8px;
263
263
  }
264
264
  .es-add-tile {
265
265
  display: flex;
266
266
  flex-direction: column;
267
267
  align-items: center;
268
268
  justify-content: center;
269
- gap: 6px;
269
+ gap: 8px;
270
270
  min-height: 64px;
271
- padding: 9px 6px;
271
+ padding: 8px;
272
272
  border: 1px solid var(--es-line);
273
273
  border-radius: 7px;
274
274
  background: var(--es-panel);
@@ -317,9 +317,9 @@
317
317
  .es-add-tile.has-cover {
318
318
  align-items: stretch;
319
319
  justify-content: flex-start;
320
- gap: 5px;
320
+ gap: 4px;
321
321
  min-height: 0;
322
- padding: 5px 5px 7px;
322
+ padding: 4px 4px 8px;
323
323
  text-align: left;
324
324
  }
325
325
  /* The containing block for the host's picture: a cover drawn to FILL its box
@@ -345,8 +345,8 @@
345
345
  display: flex;
346
346
  flex-direction: column;
347
347
  align-items: center;
348
- gap: 9px;
349
- padding: 48px 12px;
348
+ gap: 8px;
349
+ padding: 32px 12px;
350
350
  text-align: center;
351
351
  color: var(--es-muted);
352
352
  }
@@ -1,7 +1,7 @@
1
- import{DEFAULT_DRAG_WORDS as e}from"../chunk-O2NLQBFX.js";import{scrollBoxOf as t,startAutoScroll as n,isNoOpDrop as l}from"../chunk-6PS6STGA.js";export{AUTO_SCROLL_EDGE,AUTO_SCROLL_MAX_SPEED,autoScrollDelta,autoScrollSpeed,createDragSession,dropOnRow,gapToMoveIndex,isNoOpDrop,scrollBoxOf,scrollParent,startAutoScroll,stepGap,useTreeDrag}from"../chunk-6PS6STGA.js";import{useCanvasLayout as a,useCanvasEvent as r}from"../chunk-MCLBHENY.js";import{framePointToHost as o,elementScale as s,frameRectToLayer as i,clientPointToLayer as c}from"../chunk-ZNCEOSXO.js";import{CloseIcon as d,SearchIcon as u}from"../chunk-YNZZYHA4.js";import{parseZoneKey as h}from"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";import{useRef as p,useEffect as m,useState as f,useCallback as g,useMemo as b,useSyncExternalStore as y,useId as v}from"react";import{jsxs as x,jsx as k}from"react/jsx-runtime";var w=(e,t,n)=>t>=e.left&&t<=e.left+e.width&&n>=e.top&&n<=e.top+e.height,N=e=>e.width*e.height;function D(e,t,n){let l=null;for(const a of e)w(a.box,t,n)&&(!l||N(a.box)<=N(l.box))&&(l=a);return l}function S(e,t,n){const l="x"===e.axis?t:n;let a=0;for(const t of e.children){l>("x"===e.axis?t.left+t.width/2:t.top+t.height/2)&&(a+=1)}return a}function A(e,t){const n=e.children;if("x"===e.axis){const l=n[t-1],a=n[t],r=l&&a?(l.left+l.width+a.left)/2:l?l.left+l.width:a?a.left:e.box.left,o=a??l??e.box;return{left:r-1,top:o.top,width:2,height:o.height}}const l=n[t-1],a=n[t],r=l&&a?(l.top+l.height+a.top)/2:l?l.top+l.height:a?a.top:e.box.top;return{left:e.box.left,top:r-1,width:e.box.width,height:2}}function T(e,t,n,l,a=()=>!1){const r=e.filter(e=>w(e.box,t,n)).sort((e,t)=>N(e.box)-N(t.box));for(const e of r){const r=S(e,t,n),o={...e.list,index:r};if(a(o))return null;if(l(o))return{zone:e,to:o,line:A(e,r)}}return null}function z(e,t=e.key){const n=[];for(let l=1;l<e.children.length;l++){const a=e.children[l-1],r=e.children[l],o=a.top+a.height;n.push({key:`${t}:${l}`,place:{...e.list,index:l},box:{left:e.box.left,top:o,width:e.box.width,height:Math.max(r.top-o,0)}})}return n}var C={nodes:[],zones:[]},E="data-puck-dropzone",L="data-puck-component";function O(e,t){if(e.length>=2){const[t,n]=e;return Math.abs(n.top-t.top)<Math.min(t.height,n.height)/2&&n.left>t.left?"x":"y"}const n=t.ownerDocument.defaultView?.getComputedStyle(t);return n&&n.display.includes("flex")&&n.flexDirection.startsWith("row")?"x":"y"}function j(e,t){const{frame:n,document:l}=e,a=e=>i(n,function(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top,width:t.width,height:t.height}}(e),t),r=[],o=[];for(const e of l.querySelectorAll(`[${E}]`)){const t=e.getAttribute(E)??"";let n;try{n=h(t)}catch{continue}const l=[...e.querySelectorAll(`[${L}]`)].filter(t=>t.parentElement?.closest(`[${E}]`)===e),s=l.map(a);o.push({key:t,list:n,box:a(e),axis:O(s,e),children:s}),l.forEach((e,t)=>{const l=e.getAttribute(L);l&&r.push({id:l,place:{...n,index:t},box:s[t]})})}return{nodes:r,zones:o}}var B=140,M=e=>({left:e.left,top:e.top,width:e.width,height:e.height});function K(i){const{canvas:d,session:u,readOnly:h,words:v=e.canvas}=i,w=p(i);m(()=>{w.current=i});const N=p(null),S=a(d),[A,z]=f(0),E=g(()=>z(e=>e+1),[]),[L,O]=f(C);m(()=>{const e=N.current;d&&e&&O((w.current.measure??j)(d,e))},[d,S,i.revision,A]);const B=i.model,K=b(()=>B(L),[B,L]),X=y(u.subscribe,u.shown,u.shown),[$,P]=f(null),[R,Y]=f(null),Z=p(null),_=()=>{Z.current&&clearTimeout(Z.current),Z.current=null},G=()=>{_(),Z.current=setTimeout(()=>{u.get()||P(null)},140)};m(()=>_,[]),r(d,"mousemove",e=>{const t=N.current;if(!d||!t||w.current.readOnly||u.get())return;_();const n=o(d.frame,e.clientX,e.clientY,t),l=s(t),a=D(K.sources,n.x/l,n.y/l);P(e=>e?.key===a?.key&&e?.box===a?.box?e:a)}),r(d,"mouseout",e=>{e.relatedTarget||G()}),r(d,"mouseover",e=>{e.relatedTarget||E()});const q=p(null),F=g(()=>{q.current?.(),q.current=null,Y(null)},[]);m(()=>u.subscribe(()=>{u.get()?E():F()}),[u,F,E]),m(()=>F,[F]);const H=e=>{const t=u.get(),n=N.current;if(!t||!n)return null;const a=c(n,e.clientX,e.clientY),r=T(K.zones,a.x,a.y,e=>w.current.canDrop(t.item,e),e=>!!t.from&&l(t.from,e));return r?{h:t,t:r}:null},I={onDragEnter:e=>{if(q.current)return;const l=t(e.currentTarget.parentElement?.parentElement??null);q.current=l?n(l):null},onDragOver:e=>{const t=H(e);if(!t)return void Y(null);e.preventDefault(),e.dataTransfer.dropEffect=/move|all|uninitialized/i.test(e.dataTransfer.effectAllowed)?"move":"copy";const n={zoneKey:t.t.zone.key,line:t.t.line,axis:t.t.zone.axis};Y(e=>e&&e.zoneKey===n.zoneKey&&e.line.left===n.line.left&&e.line.top===n.line.top?e:n)},onDragLeave:e=>{const t=e.relatedTarget;t&&e.currentTarget.contains(t)||Y(null)},onDrop:e=>{const t=H(e);t&&(e.preventDefault(),u.end(),F(),w.current.onDrop(t.h.item,t.t.to))}},Q={draggable:!h&&!!$,onMouseEnter:_,onMouseLeave:()=>!u.get()&&G(),onDragStart:e=>{if($&&!h){u.start({key:$.key,item:$.item,from:$.from}),e.dataTransfer.effectAllowed="move";try{e.dataTransfer.setData("text/plain",$.key)}catch{}}else e.preventDefault()},onDragEnd:()=>{u.end(),F()},onClick:()=>{$&&!h&&w.current.onPick?.($.item)}},{seams:U=[]}=K,V=K.zones.filter(e=>0===e.children.length);/* @__PURE__ */
2
- return x("div",{ref:N,className:"es-canvas-layer",children:[X||!i.onSeamAdd||h?null:U.map(e=>/* @__PURE__ */k("div",{className:"es-canvas-seam",style:{left:e.box.left,top:e.box.top+e.box.height/2-8,width:e.box.width,height:16},children:/* @__PURE__ */k("button",{type:"button",className:"es-canvas-seam-add",onClick:()=>i.onSeamAdd?.(e.place),children:v.addButton({label:i.seamLabel??v.addSection})})},e.key)),i.onZoneAdd&&!h?V.map(e=>/* @__PURE__ */k("button",{type:"button",className:R?.zoneKey===e.key?"es-canvas-empty is-over":"es-canvas-empty",style:M(e.box),onClick:()=>i.onZoneAdd?.({...e.list,index:0}),children:v.addButton({label:i.zoneAddLabel??v.addBlock})},e.key)):null,X?/* @__PURE__ */k("div",{className:"es-canvas-catch",...I}):null,R&&!V.some(e=>e.key===R.zoneKey)?/* @__PURE__ */k("div",{className:`es-canvas-line is-${R.axis}`,style:M(R.line)}):null,
3
- /* @__PURE__ */x("div",{className:["es-canvas-handle",$&&!h?"is-shown":"",X?"is-dragging":""].filter(Boolean).join(" "),style:$?{left:$.box.left+2,top:Math.max($.box.top-11,0)}:void 0,title:$?$.title??v.handle({label:$.label}):void 0,...Q,children:[
4
- /* @__PURE__ */k("span",{className:"es-canvas-grip","aria-hidden":"true",children:"⋮⋮"}),$?.label]})]})}var X=e=>e.tiles.length>0&&e.tiles.every(e=>null!=e.cover);function $({groups:t,session:n,itemFor:l,onInsert:a,at:r,hint:o,searchLabel:s,readOnly:i,words:c=e.add}){const h=o??c.hint,p=s??c.search,[m,g]=f(""),b=v(),y=m.trim().toLowerCase(),w=t.map(e=>({...e,tiles:y?e.tiles.filter(e=>((e,t)=>e.label.toLowerCase().includes(t)||(e.keywords??[]).some(e=>e.toLowerCase().includes(t)))(e,y)):e.tiles})).filter(e=>e.tiles.length>0);/* @__PURE__ */
1
+ import{DEFAULT_DRAG_WORDS as e}from"../chunk-O2NLQBFX.js";import{scrollBoxOf as t,startAutoScroll as n,isNoOpDrop as l}from"../chunk-6PS6STGA.js";export{AUTO_SCROLL_EDGE,AUTO_SCROLL_MAX_SPEED,autoScrollDelta,autoScrollSpeed,createDragSession,dropOnRow,gapToMoveIndex,isNoOpDrop,scrollBoxOf,scrollParent,startAutoScroll,stepGap,useTreeDrag}from"../chunk-6PS6STGA.js";import{useCanvasLayout as a,useCanvasEvent as r}from"../chunk-MCLBHENY.js";import{framePointToHost as o,elementScale as s,frameRectToLayer as i,clientPointToLayer as c}from"../chunk-ZNCEOSXO.js";import{CloseIcon as d,SearchIcon as u}from"../chunk-PI26YXYD.js";import{parseZoneKey as h}from"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";import{useRef as p,useEffect as m,useState as f,useCallback as g,useMemo as b,useSyncExternalStore as y,useId as v}from"react";import{jsxs as x,jsx as k}from"react/jsx-runtime";var w=(e,t,n)=>t>=e.left&&t<=e.left+e.width&&n>=e.top&&n<=e.top+e.height,N=e=>e.width*e.height;function D(e,t,n){let l=null;for(const a of e)w(a.box,t,n)&&(!l||N(a.box)<=N(l.box))&&(l=a);return l}function S(e,t,n){const l="x"===e.axis?t:n;let a=0;for(const t of e.children){l>("x"===e.axis?t.left+t.width/2:t.top+t.height/2)&&(a+=1)}return a}function A(e,t){const n=e.children;if("x"===e.axis){const l=n[t-1],a=n[t],r=l&&a?(l.left+l.width+a.left)/2:l?l.left+l.width:a?a.left:e.box.left,o=a??l??e.box;return{left:r-1,top:o.top,width:2,height:o.height}}const l=n[t-1],a=n[t],r=l&&a?(l.top+l.height+a.top)/2:l?l.top+l.height:a?a.top:e.box.top;return{left:e.box.left,top:r-1,width:e.box.width,height:2}}function T(e,t,n,l,a=()=>!1){const r=e.filter(e=>w(e.box,t,n)).sort((e,t)=>N(e.box)-N(t.box));for(const e of r){const r=S(e,t,n),o={...e.list,index:r};if(a(o))return null;if(l(o))return{zone:e,to:o,line:A(e,r)}}return null}function z(e,t=e.key){const n=[];for(let l=1;l<e.children.length;l++){const a=e.children[l-1],r=e.children[l],o=a.top+a.height;n.push({key:`${t}:${l}`,place:{...e.list,index:l},box:{left:e.box.left,top:o,width:e.box.width,height:Math.max(r.top-o,0)}})}return n}var C={nodes:[],zones:[]},E="data-puck-dropzone",L="data-puck-component";function O(e,t){if(e.length>=2){const[t,n]=e;return Math.abs(n.top-t.top)<Math.min(t.height,n.height)/2&&n.left>t.left?"x":"y"}const n=t.ownerDocument.defaultView?.getComputedStyle(t);return n&&n.display.includes("flex")&&n.flexDirection.startsWith("row")?"x":"y"}function j(e,t){const{frame:n,document:l}=e,a=e=>i(n,function(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top,width:t.width,height:t.height}}(e),t),r=[],o=[];for(const e of l.querySelectorAll(`[${E}]`)){const t=e.getAttribute(E)??"";let n;try{n=h(t)}catch{continue}const l=[...e.querySelectorAll(`[${L}]`)].filter(t=>t.parentElement?.closest(`[${E}]`)===e),s=l.map(a);o.push({key:t,list:n,box:a(e),axis:O(s,e),children:s}),l.forEach((e,t)=>{const l=e.getAttribute(L);l&&r.push({id:l,place:{...n,index:t},box:s[t]})})}return{nodes:r,zones:o}}var B=140,M=e=>({left:e.left,top:e.top,width:e.width,height:e.height});function K(i){const{canvas:d,session:u,readOnly:h,words:v=e.canvas}=i,w=p(i);m(()=>{w.current=i});const N=p(null),S=a(d),[A,z]=f(0),E=g(()=>z(e=>e+1),[]),[L,O]=f(C);m(()=>{const e=N.current;d&&e&&O((w.current.measure??j)(d,e))},[d,S,i.revision,A]);const B=i.model,K=b(()=>B(L),[B,L]),X=y(u.subscribe,u.shown,u.shown),[P,$]=f(null),[R,Y]=f(null),_=p(null),G=()=>{_.current&&clearTimeout(_.current),_.current=null},q=()=>{G(),_.current=setTimeout(()=>{u.get()||$(null)},140)};m(()=>G,[]),r(d,"mousemove",e=>{const t=N.current;if(!d||!t||w.current.readOnly||u.get())return;G();const n=o(d.frame,e.clientX,e.clientY,t),l=s(t),a=D(K.sources,n.x/l,n.y/l);$(e=>e?.key===a?.key&&e?.box===a?.box?e:a)}),r(d,"mouseout",e=>{e.relatedTarget||q()}),r(d,"mouseover",e=>{e.relatedTarget||E()});const I=p(null),Z=g(()=>{I.current?.(),I.current=null,Y(null)},[]);m(()=>u.subscribe(()=>{u.get()?E():Z()}),[u,Z,E]),m(()=>Z,[Z]);const F=e=>{const t=u.get(),n=N.current;if(!t||!n)return null;const a=c(n,e.clientX,e.clientY),r=T(K.zones,a.x,a.y,e=>w.current.canDrop(t.item,e),e=>!!t.from&&l(t.from,e));return r?{h:t,t:r}:null},Q={onDragEnter:e=>{if(I.current)return;const l=t(e.currentTarget.parentElement?.parentElement??null);I.current=l?n(l):null},onDragOver:e=>{const t=F(e);if(!t)return void Y(null);e.preventDefault(),e.dataTransfer.dropEffect=/move|all|uninitialized/i.test(e.dataTransfer.effectAllowed)?"move":"copy";const n={zoneKey:t.t.zone.key,line:t.t.line,axis:t.t.zone.axis};Y(e=>e&&e.zoneKey===n.zoneKey&&e.line.left===n.line.left&&e.line.top===n.line.top?e:n)},onDragLeave:e=>{const t=e.relatedTarget;t&&e.currentTarget.contains(t)||Y(null)},onDrop:e=>{const t=F(e);t&&(e.preventDefault(),u.end(),Z(),w.current.onDrop(t.h.item,t.t.to))}},U={draggable:!h&&!!P,onMouseEnter:G,onMouseLeave:()=>!u.get()&&q(),onDragStart:e=>{if(P&&!h){u.start({key:P.key,item:P.item,from:P.from}),e.dataTransfer.effectAllowed="move";try{e.dataTransfer.setData("text/plain",P.key)}catch{}}else e.preventDefault()},onDragEnd:()=>{u.end(),Z()},onClick:()=>{P&&!h&&w.current.onPick?.(P.item)}},{seams:V=[]}=K,H=K.zones.filter(e=>0===e.children.length);/* @__PURE__ */
2
+ return x("div",{ref:N,className:"es-canvas-layer",children:[X||!i.onSeamAdd||h?null:V.map(e=>/* @__PURE__ */k("div",{className:"es-canvas-seam",style:{left:e.box.left,top:e.box.top+e.box.height/2-8,width:e.box.width,height:16},children:/* @__PURE__ */k("button",{type:"button",className:"es-canvas-seam-add",onClick:()=>i.onSeamAdd?.(e.place),children:v.addButton({label:i.seamLabel??v.addSection})})},e.key)),i.onZoneAdd&&!h?H.map(e=>/* @__PURE__ */k("button",{type:"button",className:R?.zoneKey===e.key?"es-canvas-empty is-over":"es-canvas-empty",style:M(e.box),onClick:()=>i.onZoneAdd?.({...e.list,index:0}),children:v.addButton({label:i.zoneAddLabel??v.addBlock})},e.key)):null,X?/* @__PURE__ */k("div",{className:"es-canvas-catch",...Q}):null,R&&!H.some(e=>e.key===R.zoneKey)?/* @__PURE__ */k("div",{className:`es-canvas-line is-${R.axis}`,style:M(R.line)}):null,
3
+ /* @__PURE__ */x("div",{className:["es-canvas-handle",P&&!h?"is-shown":"",X?"is-dragging":""].filter(Boolean).join(" "),style:P?{left:P.box.left+2,top:Math.max(P.box.top-11,0)}:void 0,title:P?P.title??v.handle({label:P.label}):void 0,...U,children:[
4
+ /* @__PURE__ */k("span",{className:"es-canvas-grip","aria-hidden":"true",children:"⋮⋮"}),P?.label]})]})}var X=e=>e.tiles.length>0&&e.tiles.every(e=>null!=e.cover);function P({groups:t,session:n,itemFor:l,onInsert:a,at:r,hint:o,searchLabel:s,readOnly:i,words:c=e.add}){const h=o??c.hint,p=s??c.search,[m,g]=f(""),b=v(),y=m.trim().toLowerCase(),w=t.map(e=>({...e,tiles:y?e.tiles.filter(e=>((e,t)=>e.label.toLowerCase().includes(t)||(e.keywords??[]).some(e=>e.toLowerCase().includes(t)))(e,y)):e.tiles})).filter(e=>e.tiles.length>0);/* @__PURE__ */
5
5
  return x("div",{className:"es-add",children:[r?/* @__PURE__ */x("div",{className:"es-add-at",role:"status",children:[
6
6
  /* @__PURE__ */k("span",{children:r.label}),
7
7
  /* @__PURE__ */k("button",{type:"button",className:"es-add-at-clear","aria-label":c.stop,title:c.stop,onClick:r.onClear,children:/* @__PURE__ */k(d,{size:12,"aria-hidden":"true"})})]}):null,
@@ -15,4 +15,4 @@ return x("div",{className:"es-add",children:[r?/* @__PURE__ */x("div",{className
15
15
  /* @__PURE__ */k("span",{className:"es-add-group-title",children:e.title}),
16
16
  /* @__PURE__ */k("span",{className:"es-add-group-count",children:e.tiles.length})]}),
17
17
  /* @__PURE__ */k("div",{className:X(e)?"es-add-grid is-cards":"es-add-grid",children:e.tiles.map(e=>{/* @__PURE__ */return x("button",{type:"button",className:null!=e.cover?"es-add-tile has-cover":"es-add-tile",draggable:!i,"aria-disabled":i||void 0,"aria-label":c.tile({label:e.label}),title:i?void 0:e.title??c.tile({label:e.label}),onDragStart:(t=e.type,e=>{if(i)e.preventDefault();else{n.start({key:`new:${t}`,item:l(t)}),e.dataTransfer.effectAllowed="copy";try{e.dataTransfer.setData("text/plain",t)}catch{}}}),onDragEnd:()=>n.end(),onClick:()=>!i&&a(e.type),children:[null!=e.cover?/* @__PURE__ */k("span",{className:"es-add-tile-cover","aria-hidden":"true",children:e.cover}):e.icon?/* @__PURE__ */k("span",{className:"es-add-tile-glyph","aria-hidden":"true",children:e.icon}):null,
18
- /* @__PURE__ */k("span",{className:"es-add-tile-label",children:e.label})]},e.type);var t})})]},e.title))]})}export{$ as AddPanel,K as CanvasDragLayer,C as EMPTY_MEASURE,B as HANDLE_GRACE_MS,T as canvasTarget,w as contains,S as gapInZone,A as gapLine,j as measureCanvas,D as pickSource,z as seamsBetween};
18
+ /* @__PURE__ */k("span",{className:"es-add-tile-label",children:e.label})]},e.type);var t})})]},e.title))]})}export{P as AddPanel,K as CanvasDragLayer,C as EMPTY_MEASURE,B as HANDLE_GRACE_MS,T as canvasTarget,w as contains,S as gapInZone,A as gapLine,j as measureCanvas,D as pickSource,z as seamsBetween};
@@ -29,7 +29,7 @@ type LockWords = {
29
29
  *
30
30
  * * `efficient-admin-portal/src/components/email/campaignEditLock.ts` — the
31
31
  * campaign designer's copy, which alone had the TAKE-OVER half;
32
- * * `efficient-shop/lib/editor-page-lock.ts` — the storefront editor's copy,
32
+ * * `efficient-storefront/lib/editor-page-lock.ts` — the storefront editor's copy,
33
33
  * which alone had the claim/heartbeat driver, the auth-rejection rule and
34
34
  * the "a template has no lock" rule.
35
35
  *
@@ -8,8 +8,8 @@ import { c as ResolveTrigger, a as ResolveCache, R as ResolvableItem } from '../
8
8
  import * as react from 'react';
9
9
  import { ReactNode, CSSProperties, ComponentType, ReactElement } from 'react';
10
10
  import { b as NodeOpsHost, C as ClipboardEntry } from '../useNodeOps-BF0fQsif.js';
11
- import { I as InspectorFields } from '../types-CEqUFH2j.js';
12
- import '../buckets-1vRlQceY.js';
11
+ import { I as InspectorFields } from '../types-C7HFvdtk.js';
12
+ import '../buckets-CuLM47h9.js';
13
13
 
14
14
  interface EditorOptions<C extends EditorConfig = EditorConfig> {
15
15
  config: C;
@@ -18,7 +18,7 @@
18
18
  width: 100%;
19
19
  min-width: 0;
20
20
  height: 32px;
21
- padding: 0 10px;
21
+ padding: 0 12px;
22
22
  border: 1px solid var(--es-input-border);
23
23
  border-radius: var(--es-field-radius);
24
24
  background: var(--es-field-bg);
@@ -41,22 +41,136 @@
41
41
  .es-fin--area {
42
42
  height: auto;
43
43
  min-height: 64px;
44
- padding: 8px 10px;
44
+ padding: 8px 12px;
45
45
  resize: vertical;
46
46
  }
47
47
 
48
- /* ── a number: the box, its unit, − and + ─────────────────────────────────── */
48
+ /* ── a number: the cell (plan step E4) ─────────────────────────────────────
49
+ icon · number · unit · two stacked arrows, in ONE box with react-os-shell's
50
+ Input look (32px tall, the shell's border and radius, 14px text). The ring
51
+ is on the whole cell while the number inside has focus, as the design draws
52
+ it: react-os-shell's blue-400 line and a 2px ring at 30%.
53
+
54
+ SPACING IS THE SCALE ONLY (2 / 4 / 8 / 12 / 16 / 32), read from the
55
+ `--es-space-*` tokens. The fallback after each is the same step, for a host
56
+ whose sheet is older than the scale. */
49
57
 
50
58
  .es-fnum {
59
+ box-sizing: border-box;
51
60
  display: flex;
52
- align-items: center;
53
- gap: 8px;
61
+ align-items: stretch;
62
+ gap: var(--es-space-4, 4px);
54
63
  width: 100%;
55
64
  min-width: 0;
65
+ height: 32px;
66
+ padding-inline: var(--es-space-8, 8px);
67
+ border: 1px solid var(--es-input-border);
68
+ border-radius: var(--es-field-radius);
69
+ background: var(--es-field-bg);
70
+ color: var(--es-field-text);
71
+ }
72
+ .es-fnum--arrows { padding-inline-end: 0; }
73
+ .es-fnum:hover:not(.is-readonly):not(:focus-within) { border-color: var(--es-muted); }
74
+ .es-fnum:focus-within {
75
+ border-color: var(--es-focus-line, #60a5fa);
76
+ box-shadow: 0 0 0 2px var(--es-focus-ring, rgba(96, 165, 250, 0.3));
77
+ }
78
+ .es-fnum.is-readonly { background: var(--es-track-bg); color: var(--es-muted); }
79
+
80
+ .es-fnum-icon { display: flex; align-items: center; flex: none; color: var(--es-field-placeholder); }
81
+ .es-fnum-icon svg { width: 14px; height: 14px; }
82
+
83
+ .es-fnum-box {
84
+ flex: 1 1 auto;
85
+ min-width: 0;
86
+ width: 100%;
87
+ padding: 0;
88
+ border: 0;
89
+ outline: none;
90
+ background: none;
91
+ color: inherit;
92
+ font: inherit;
93
+ font-size: 14px;
94
+ font-variant-numeric: tabular-nums;
95
+ }
96
+ .es-fnum-box::placeholder { color: var(--es-field-placeholder); opacity: 1; }
97
+ /* A grey number follows the style: what shows is the style's, not the cell's. */
98
+ .es-fnum.is-style .es-fnum-box { color: var(--es-field-placeholder); }
99
+
100
+ .es-fnum-unit { align-self: center; flex: none; font-size: 12px; color: var(--es-muted); white-space: nowrap; }
101
+
102
+ .es-fnum-arrows {
103
+ display: flex;
104
+ flex-direction: column;
105
+ flex: none;
106
+ width: 18px;
107
+ border-left: 1px solid var(--es-line);
108
+ }
109
+ .es-fnum-arrow {
110
+ flex: 1 1 0;
111
+ display: flex;
112
+ align-items: center;
113
+ justify-content: center;
114
+ min-height: 0;
115
+ padding: 0;
116
+ border: 0;
117
+ background: none;
118
+ color: var(--es-icon);
119
+ cursor: pointer;
120
+ touch-action: none;
121
+ }
122
+ .es-fnum-arrow--up {
123
+ border-bottom: 1px solid var(--es-line);
124
+ border-top-right-radius: calc(var(--es-field-radius) - 1px);
125
+ }
126
+ .es-fnum-arrow--down { border-bottom-right-radius: calc(var(--es-field-radius) - 1px); }
127
+ .es-fnum-arrow:hover:not(:disabled) { background: var(--es-hover); color: var(--es-text); }
128
+ .es-fnum-arrow:disabled { color: var(--es-disabled); cursor: default; }
129
+ .es-fnum-arrow svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
130
+
131
+ /* ── a slider row (Site styles, Email styles; plan step E4) ────────────────
132
+ The name left and the value right on one line, the slider under them. The
133
+ value is a quiet box until it is hovered or has focus. */
134
+
135
+ .es-fslider { display: flex; flex-direction: column; gap: var(--es-space-4, 4px); min-width: 0; }
136
+ .es-fslider-top {
137
+ display: flex;
138
+ align-items: baseline;
139
+ justify-content: space-between;
140
+ gap: var(--es-space-8, 8px);
141
+ min-width: 0;
56
142
  }
57
- .es-fnum-box { flex: 0 1 96px; }
58
- .es-fnum-unit { font-size: 12px; color: var(--es-muted); }
59
- .es-fnum-steps { display: flex; gap: 4px; margin-left: auto; }
143
+ .es-fslider-name {
144
+ min-width: 0;
145
+ overflow: hidden;
146
+ text-overflow: ellipsis;
147
+ white-space: nowrap;
148
+ font-size: 12px;
149
+ font-weight: 500;
150
+ color: var(--es-text-secondary);
151
+ }
152
+ .es-fslider-read { display: inline-flex; align-items: baseline; gap: var(--es-space-2, 2px); flex: none; }
153
+ .es-fslider-value {
154
+ box-sizing: content-box;
155
+ width: 5ch;
156
+ padding: var(--es-space-2, 2px) var(--es-space-4, 4px);
157
+ border: 0;
158
+ border-radius: 4px;
159
+ outline: none;
160
+ background: none;
161
+ color: var(--es-field-text);
162
+ font: inherit;
163
+ font-size: 12.5px;
164
+ font-variant-numeric: tabular-nums;
165
+ text-align: right;
166
+ cursor: text;
167
+ }
168
+ .es-fslider-value:hover { background: var(--es-hover); }
169
+ .es-fslider-value:focus { background: var(--es-field-bg); box-shadow: inset 0 0 0 1px var(--es-focus-line, #60a5fa); }
170
+ .es-fslider-value::placeholder { color: var(--es-field-placeholder); opacity: 1; }
171
+ .es-fslider.is-style .es-fslider-value { color: var(--es-field-placeholder); }
172
+ .es-fslider-unit { font-size: 12px; color: var(--es-field-placeholder); }
173
+ .es-fslider-range { width: 100%; height: 18px; margin: 0; accent-color: var(--es-accent); }
60
174
 
61
175
  .es-fbtn {
62
176
  height: 28px;
@@ -116,7 +230,7 @@
116
230
  }
117
231
  .es-fsel-list:focus { outline: none; }
118
232
  .es-fsel-option {
119
- padding: 7px 8px;
233
+ padding: 8px;
120
234
  border-radius: var(--es-field-radius);
121
235
  font-size: 12px;
122
236
  color: var(--es-text);
@@ -155,7 +269,7 @@
155
269
  justify-content: space-between;
156
270
  gap: 8px;
157
271
  }
158
- .es-list-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--es-text); }
272
+ .es-list-label { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--es-text); }
159
273
  .es-list-count { font-size: 11px; color: var(--es-muted); }
160
274
  /* The rows are Layers' rows (tree.css); the list lets them reach the panel's
161
275
  edges the way Layers' do, so a row's hover reads as the same row. */
@@ -181,9 +295,9 @@
181
295
  align-self: flex-start;
182
296
  display: inline-flex;
183
297
  align-items: center;
184
- gap: 6px;
298
+ gap: 8px;
185
299
  height: 28px;
186
- padding: 0 8px 0 6px;
300
+ padding: 0 8px;
187
301
  border: 0;
188
302
  border-radius: var(--es-field-radius);
189
303
  background: var(--es-hover);
@@ -1,8 +1,8 @@
1
1
  import * as react from 'react';
2
- import { ReactNode } from 'react';
3
- import { S as SettingsBucket } from '../buckets-1vRlQceY.js';
4
- import { I as InspectorFields, a as InspectorFieldDef, F as FieldRenderer, b as FieldTextProps, c as FieldNumberProps, d as FieldSelectProps, e as FieldOption } from '../types-CEqUFH2j.js';
5
- export { A as ArrayFieldDef, C as CustomFieldDef, f as CustomFieldRenderProps, N as NumberFieldDef, O as ObjectFieldDef, R as RadioFieldDef, S as SelectFieldDef, g as SlotFieldDef, T as TextFieldDef, h as TextareaFieldDef } from '../types-CEqUFH2j.js';
2
+ import { ReactNode, KeyboardEvent } from 'react';
3
+ import { S as SettingsBucket } from '../buckets-CuLM47h9.js';
4
+ import { I as InspectorFields, a as InspectorFieldDef, F as FieldRenderer, b as FieldTextProps, c as FieldNumberProps, d as FieldSliderProps, e as FieldSelectProps, f as FieldOption } from '../types-C7HFvdtk.js';
5
+ export { A as ArrayFieldDef, C as CustomFieldDef, g as CustomFieldRenderProps, N as NumberFieldDef, O as ObjectFieldDef, R as RadioFieldDef, S as SelectFieldDef, h as SlotFieldDef, T as TextFieldDef, i as TextareaFieldDef } from '../types-C7HFvdtk.js';
6
6
  import { R as ResolvableItem } from '../resolve-D68pb3Bx.js';
7
7
  export { F as FieldsWords } from '../words-CD3WADyb.js';
8
8
  import '../types-41704JE4.js';
@@ -243,17 +243,65 @@ declare function FieldText({ id, value, onChange, placeholder, multiline, rows,
243
243
  declare function clampNumber(n: number, min?: number, max?: number): number;
244
244
  /** What a typed string means as a number: null for nothing or not-a-number. */
245
245
  declare function parseTyped(text: string): number | null;
246
+ interface NumberEntryOptions {
247
+ value: number | undefined;
248
+ onChange: (value: number | undefined) => void;
249
+ min?: number;
250
+ max?: number;
251
+ step?: number;
252
+ shiftStep?: number;
253
+ styleValue?: number;
254
+ readOnly?: boolean;
255
+ }
246
256
  /**
247
- * A number value (blueprint step 4.1): the shell box, an optional unit after it
248
- * and − / + beside it.
257
+ * What a typed number box does, shared by the number cell and the slider
258
+ * row's value, so the two cannot drift.
249
259
  *
250
260
  * It keeps the TYPED TEXT while you type, so "1." and "-" are allowed on the way
251
261
  * to a number, and writes only when the text is a number. It writes as you type
252
- * (the canvas follows), clamps to `min` / `max` when you leave the box, and
253
- * arrow keys and the two buttons move by `step` (default 1). An empty box writes
254
- * `undefined`: the setting goes back to the block's own.
262
+ * (the canvas follows). Enter or leaving the box clamps to `min` / `max`; Esc
263
+ * puts back the value the box had when you came in. ↑↓ move by `step`, Shift
264
+ * by `shiftStep` (ten steps unless the host says). An empty box writes
265
+ * `undefined`: the setting goes back to the style, whose number `styleValue`
266
+ * then shows, grey, and is where a step starts from.
267
+ */
268
+ declare function useNumberEntry({ value, onChange, min, max, step, shiftStep, styleValue, readOnly }: NumberEntryOptions): {
269
+ inputProps: {
270
+ value: string;
271
+ readOnly: boolean;
272
+ placeholder: string | undefined;
273
+ onFocus: () => void;
274
+ onChange: (e: {
275
+ target: {
276
+ value: string;
277
+ };
278
+ }) => void;
279
+ onBlur: () => void;
280
+ onKeyDown: (e: KeyboardEvent<HTMLInputElement>) => void;
281
+ };
282
+ nudge: (dir: 1 | -1, big?: boolean) => void;
283
+ set: (n: number | undefined) => void;
284
+ /** Nothing of its own: the style's number shows, grey. */
285
+ isStyle: boolean;
286
+ };
287
+ /**
288
+ * A number value (blueprint step 4.1; the cell, plan step E4): one box holding
289
+ * an optional icon, the number, an optional unit and, with `steppers`, two
290
+ * small stacked arrows. What the typing, the keys and the arrows do is
291
+ * {@link useNumberEntry}'s.
292
+ */
293
+ declare function FieldNumber({ id, value, onChange, min, max, step, shiftStep, styleValue, icon, unit, steppers, placeholder, readOnly, ariaLabel, ariaLabelledBy, }: FieldNumberProps): react.JSX.Element;
294
+
295
+ /**
296
+ * A slider row (plan step E4), for Site styles and Email styles: the name on
297
+ * the left and the value on the right on one line, the slider under them.
298
+ *
299
+ * The value is typed and takes ↑↓ (Shift = ten steps), exactly as the number
300
+ * cell does — it is the same {@link useNumberEntry} — and may go past the
301
+ * slider's own travel (`sliderMin` / `sliderMax`); only `min` / `max` hold it.
302
+ * The slider then rests at its end. A grey value follows the style.
255
303
  */
256
- declare function FieldNumber({ id, value, onChange, min, max, step, unit, steppers, placeholder, readOnly, ariaLabel, ariaLabelledBy, }: FieldNumberProps): react.JSX.Element;
304
+ declare function FieldSlider({ id, label, value, onChange, min, max, step, shiftStep, styleValue, unit, sliderMin, sliderMax, readOnly, }: FieldSliderProps): react.JSX.Element;
257
305
 
258
306
  /** The option a stored value names: equal by `Object.is`, so `0`, `false` and `''` are values too. */
259
307
  declare function optionFor<V>(options: readonly FieldOption<V>[], value: V | undefined): FieldOption<V> | undefined;
@@ -270,4 +318,4 @@ declare function optionFor<V>(options: readonly FieldOption<V>[], value: V | und
270
318
  */
271
319
  declare function FieldSelect<V>({ id, value, options, onChange, placeholder, readOnly, ariaLabel, ariaLabelledBy, }: FieldSelectProps<V>): react.JSX.Element;
272
320
 
273
- export { FieldNumber, FieldNumberProps, FieldOption, type FieldPlan, FieldRenderer, FieldSelect, FieldSelectProps, FieldText, FieldTextProps, type FieldsBlock, Inspector, InspectorField, InspectorFieldDef, type InspectorFieldProps, InspectorFields, type InspectorProps, ListField, type ListFieldProps, type PlannedRow, type ResolvedFieldsInput, SettingsBucket, bucketsOf, clampNumber, copyItem, insertAt, labelOf, moveTo, optionFor, parseTyped, planFields, removeAt, useResolvedFields };
321
+ export { FieldNumber, FieldNumberProps, FieldOption, type FieldPlan, FieldRenderer, FieldSelect, FieldSelectProps, FieldSlider, FieldSliderProps, FieldText, FieldTextProps, type FieldsBlock, Inspector, InspectorField, InspectorFieldDef, type InspectorFieldProps, InspectorFields, type InspectorProps, ListField, type ListFieldProps, type NumberEntryOptions, type PlannedRow, type ResolvedFieldsInput, SettingsBucket, bucketsOf, clampNumber, copyItem, insertAt, labelOf, moveTo, optionFor, parseTyped, planFields, removeAt, useNumberEntry, useResolvedFields };