efficient-easel 0.99.1 → 0.100.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 (110) hide show
  1. package/README.md +281 -36
  2. package/dist/autosave/index.d.ts +12 -6
  3. package/dist/blocks/index.d.ts +2 -2
  4. package/dist/canvas/index.d.ts +3 -3
  5. package/dist/canvas/index.js +1 -1
  6. package/dist/chrome/chrome.css +96 -29
  7. package/dist/chrome/index.d.ts +72 -19
  8. package/dist/chrome/index.js +17 -21
  9. package/dist/chunk-3EDSDPIP.js +1 -0
  10. package/dist/chunk-67GNT6PF.js +1 -0
  11. package/dist/{chunk-PI26YXYD.js → chunk-6EIVTKZZ.js} +21 -14
  12. package/dist/chunk-A5UK76FC.js +6 -0
  13. package/dist/chunk-AZT7V4UM.js +10 -0
  14. package/dist/chunk-DICUMYMG.js +12 -0
  15. package/dist/chunk-HDVD27VB.js +1 -0
  16. package/dist/chunk-JQM3V7XQ.js +1 -0
  17. package/dist/{chunk-TDA4HH54.js → chunk-JUQ6YJCG.js} +1 -1
  18. package/dist/chunk-LA54QLP5.js +1 -0
  19. package/dist/chunk-LGKQXSKO.js +16 -0
  20. package/dist/chunk-M6F6LS3H.js +1 -0
  21. package/dist/chunk-MH5GUZFQ.js +9 -0
  22. package/dist/chunk-P6O363EE.js +6 -0
  23. package/dist/chunk-PAELDYYS.js +1 -0
  24. package/dist/{chunk-JYPOOHII.js → chunk-QKVR3K73.js} +3 -3
  25. package/dist/chunk-SAJUCHOX.js +1 -0
  26. package/dist/chunk-TRVZ7C23.js +1 -0
  27. package/dist/chunk-V7GIIXFB.js +16 -0
  28. package/dist/{chunk-IBOFSS56.js → chunk-WZ7TGAAT.js} +1 -1
  29. package/dist/chunk-ZJEBF4NB.js +1 -0
  30. package/dist/copy/copy.css +388 -5
  31. package/dist/copy/index.d.ts +271 -8
  32. package/dist/copy/index.js +31 -10
  33. package/dist/data/index.d.ts +4 -4
  34. package/dist/drag/drag.css +10 -1
  35. package/dist/drag/index.d.ts +102 -11
  36. package/dist/drag/index.js +18 -17
  37. package/dist/{editor/editor.css → easel/easel.css} +16 -1
  38. package/dist/{editor → easel}/index.d.ts +146 -51
  39. package/dist/easel/index.js +9 -0
  40. package/dist/edit-lock/index.d.ts +3 -3
  41. package/dist/edit-lock/index.js +1 -1
  42. package/dist/fields/fields.css +103 -26
  43. package/dist/fields/index.d.ts +51 -13
  44. package/dist/fields/index.js +30 -46
  45. package/dist/gold/index.js +1 -1
  46. package/dist/icons/index.d.ts +10 -1
  47. package/dist/icons/index.js +1 -1
  48. package/dist/index.d.ts +3 -3
  49. package/dist/index.js +1 -1
  50. package/dist/markup/index.d.ts +94 -10
  51. package/dist/markup/index.js +1 -1
  52. package/dist/menu/index.d.ts +61 -6
  53. package/dist/menu/index.js +15 -15
  54. package/dist/menu/menu.css +17 -6
  55. package/dist/node-ops/index.d.ts +9 -9
  56. package/dist/node-ops/index.js +1 -1
  57. package/dist/panel/index.d.ts +73 -5
  58. package/dist/panel/index.js +18 -16
  59. package/dist/panel/panel.css +56 -1
  60. package/dist/pick/index.d.ts +42 -4
  61. package/dist/pick/index.js +7 -14
  62. package/dist/pick/pick.css +14 -0
  63. package/dist/rail/index.d.ts +6 -6
  64. package/dist/rail/index.js +1 -1
  65. package/dist/rail/rail.css +1 -1
  66. package/dist/strings/catalogue.d.ts +24 -40
  67. package/dist/strings/catalogue.js +1 -1
  68. package/dist/strings/index.d.ts +25 -23
  69. package/dist/strings/index.js +2 -2
  70. package/dist/style-clipboard/index.d.ts +5 -5
  71. package/dist/style-clipboard/index.js +1 -1
  72. package/dist/text-styles/index.d.ts +328 -0
  73. package/dist/text-styles/index.js +38 -0
  74. package/dist/text-styles/text-styles.css +309 -0
  75. package/dist/tree/index.d.ts +44 -3
  76. package/dist/tree/index.js +1 -1
  77. package/dist/tree/tree.css +71 -0
  78. package/dist/{types-CnRzp9oc.d.ts → types-DGcCsxs8.d.ts} +79 -12
  79. package/dist/{types-DNrn_w4V.d.ts → types-DWS-s9z-.d.ts} +10 -10
  80. package/dist/{types-pGBXevBU.d.ts → types-Djdq6Xkd.d.ts} +15 -8
  81. package/dist/{types-Dy6oR6Z2.d.ts → types-E3HrTPg2.d.ts} +20 -14
  82. package/dist/{types-C7HFvdtk.d.ts → types-VqL6t5HH.d.ts} +82 -5
  83. package/dist/{watch-DmasQA61.d.ts → watch-BTYOJpQU.d.ts} +19 -2
  84. package/dist/{wordFit-9B9nqyf3.d.ts → wordFit-D4S36PvB.d.ts} +1 -1
  85. package/dist/{words-DagJdwIA.d.ts → words-AHHfiaRY.d.ts} +31 -2
  86. package/dist/{words-D9ChvbNC.d.ts → words-BDignMl_.d.ts} +1 -1
  87. package/dist/{words-Cqmyey0s.d.ts → words-BMzV04b1.d.ts} +2 -2
  88. package/dist/words-CJjUKcV5.d.ts +37 -0
  89. package/dist/words-CRYvAiHX.d.ts +105 -0
  90. package/dist/{words-B2YLaKEr.d.ts → words-CnnHb9jo.d.ts} +1 -1
  91. package/dist/{words-CD3WADyb.d.ts → words-CzoyDNHm.d.ts} +4 -0
  92. package/dist/{words-bOMsUJk9.d.ts → words-DBq7vfHy.d.ts} +59 -6
  93. package/dist/{words-DOhF-4D4.d.ts → words-DMG4dYq2.d.ts} +1 -1
  94. package/dist/{words-BK-npta-.d.ts → words-DgHcY5qB.d.ts} +10 -4
  95. package/dist/{words-B87GIFWH.d.ts → words-is_Vy6hn.d.ts} +1 -1
  96. package/package.json +14 -8
  97. package/dist/chunk-66CKSTXP.js +0 -14
  98. package/dist/chunk-67VZRQLG.js +0 -13
  99. package/dist/chunk-6PS6STGA.js +0 -1
  100. package/dist/chunk-7A7O2JWQ.js +0 -1
  101. package/dist/chunk-H4B72XCJ.js +0 -1
  102. package/dist/chunk-JE63JHKO.js +0 -1
  103. package/dist/chunk-KDIVA6WD.js +0 -1
  104. package/dist/chunk-MCLBHENY.js +0 -1
  105. package/dist/chunk-QB3BZIRA.js +0 -5
  106. package/dist/chunk-SJQG5ENJ.js +0 -1
  107. package/dist/chunk-SUO5627P.js +0 -1
  108. package/dist/chunk-ZT7M24XD.js +0 -1
  109. package/dist/editor/index.js +0 -9
  110. /package/dist/{chunk-GGTPNGFJ.js → chunk-AELNNAFM.js} +0 -0
@@ -1,14 +1,7 @@
1
- import{DEFAULT_PICK_WORDS as e}from"../chunk-ZAOM6PFH.js";import{useId as a,useState as t,useRef as n,useEffect as l}from"react";import{jsxs as r,jsx as i}from"react/jsx-runtime";var s=/^(?:[0-9a-f]{3}|[0-9a-f]{6})$/i,o=7;function c(e){const a=e.trim().replace(/^#/,"");if(!s.test(a))return null;return`#${(3===a.length?[...a].map(e=>e+e).join(""):a).toLowerCase()}`}var u=e=>e.toUpperCase(),h=(e,a,t)=>Math.min(t,Math.max(a,e));function m(e){const a=c(e)??"#000000",t=parseInt(a.slice(1,3),16)/255,n=parseInt(a.slice(3,5),16)/255,l=parseInt(a.slice(5,7),16)/255,r=Math.max(t,n,l),i=r-Math.min(t,n,l);let s=0;return 0!==i&&(s=r===t?(n-l)/i%6*60:r===n?60*((l-t)/i+2):60*((t-n)/i+4)),{h:(s+360)%360,s:0===r?0:i/r,v:r}}function d({h:e,s:a,v:t}){const n=(e%360+360)%360,l=h(a,0,1),r=h(t,0,1),i=r*l,s=i*(1-Math.abs(n/60%2-1)),o=r-i,[c,u,m]=n<60?[i,s,0]:n<120?[s,i,0]:n<180?[0,i,s]:n<240?[0,s,i]:n<300?[s,0,i]:[i,0,s],d=e=>Math.round(255*(e+o)).toString(16).padStart(2,"0");return`#${d(c)}${d(u)}${d(m)}`}function p(e,a,t){return{s:t.width>0?h((e-t.left)/t.width,0,1):0,v:t.height>0?1-h((a-t.top)/t.height,0,1):0}}function v(e,a){return a.width>0?360*h((e-a.left)/a.width,0,1):0}function g(e){if(/^(data|blob):/i.test(e))return"";const a=(e.split(/[?#]/)[0]??"").split("/").filter(Boolean).pop()??"";try{return decodeURIComponent(a)}catch{return a}}function b({value:s,onChange:o,label:h,theme:g,caption:b,id:f,readOnly:y,words:w=e.colour}){const N=a(),[x,C]=t(!1),M=n(null),D=n(null),[A,I]=t(()=>m(s||"#000000")),$=n(s);l(()=>{s!==$.current&&($.current=s,s&&I(m(s)))},[s]);const L=e=>{y||e===s||($.current=e,o(e))},O=e=>{I(m(e)),L(e)},E=e=>{I(e),L(d(e))};l(()=>{if(!x)return;const e=M.current?.ownerDocument;if(!e)return;const a=e=>{M.current&&!M.current.contains(e.target)&&C(!1)};return e.addEventListener("click",a,!0),()=>e.removeEventListener("click",a,!0)},[x]);const K=e=>({onPointerDown:a=>{y||(a.currentTarget.setPointerCapture?.(a.pointerId),e(a))},onPointerMove:a=>{1&a.buttons&&e(a)}}),P=K(e=>E({...A,...p(e.clientX,e.clientY,e.currentTarget.getBoundingClientRect())})),T=K(e=>E({...A,h:v(e.clientX,e.currentTarget.getBoundingClientRect())})),B=e=>`${Math.round(100*e)}%`,R=void 0===b||s&&c(b)===c(s)?null:b,S=R??(s?u(s):w.notSet);/* @__PURE__ */
2
- return r("div",{ref:M,className:"es-pick-colour",children:[
3
- /* @__PURE__ */r("div",{className:"es-pick-colour-row",children:[
4
- /* @__PURE__ */i("button",{ref:D,id:f,type:"button",className:s?"es-pick-swatch":"es-pick-swatch is-unset",style:s?{background:s}:void 0,"aria-label":w.swatch({label:h,shown:S}),"aria-expanded":x,"aria-controls":x?N:void 0,disabled:y,onClick:()=>C(e=>!e)}),null===R?/* @__PURE__ */i(k,{value:s,onChange:O,name:w.hex({label:h}),readOnly:y}):/* @__PURE__ */i("span",{className:"es-pick-caption",children:R})]}),x?/* @__PURE__ */r("div",{id:N,role:"dialog","aria-label":w.dialog({label:h}),className:"es-pick-window",onKeyDown:e=>{"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),C(!1),D.current?.focus())},children:[g&&g.length>0?/* @__PURE__ */i("div",{role:"group","aria-label":w.theme,className:"es-pick-theme",children:g.map(e=>/* @__PURE__ */i("button",{type:"button",className:"es-pick-theme-swatch",style:{background:e.value},title:w.themeSwatchTitle({name:e.name,hex:u(e.value)}),"aria-label":w.themeSwatch({name:e.name,hex:u(e.value)}),"aria-pressed":c(e.value)===s,onClick:()=>O(c(e.value)??e.value)},`${e.name}:${e.value}`))}):null,
5
- /* @__PURE__ */i("div",{className:"es-pick-sv",role:"slider",tabIndex:0,"aria-label":w.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*A.v),"aria-valuetext":w.squareValue({saturation:B(A.s),brightness:B(A.v)}),style:{backgroundColor:d({h:A.h,s:1,v:1})},onKeyDown:e=>{const a=e.shiftKey?.1:.01,t={ArrowLeft:[-a,0],ArrowRight:[a,0],ArrowDown:[0,-a],ArrowUp:[0,a]}[e.key];t&&(e.preventDefault(),E({...A,s:Math.min(1,Math.max(0,A.s+t[0])),v:Math.min(1,Math.max(0,A.v+t[1]))}))},...P,children:/* @__PURE__ */i("span",{className:"es-pick-sv-thumb",style:{left:B(A.s),top:B(1-A.v)}})}),
6
- /* @__PURE__ */i("div",{className:"es-pick-hue",role:"slider",tabIndex:0,"aria-label":w.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(A.h),onKeyDown:e=>{const a=e.shiftKey?10:1,t="ArrowLeft"===e.key||"ArrowDown"===e.key?-a:"ArrowRight"===e.key||"ArrowUp"===e.key?a:null,n="Home"===e.key?0:"End"===e.key?359:null===t?null:Math.min(359,Math.max(0,A.h+t));null!==n&&(e.preventDefault(),E({...A,h:n}))},...T,children:/* @__PURE__ */i("span",{className:"es-pick-hue-thumb",style:{left:A.h/360*100+"%"}})}),
7
- /* @__PURE__ */i(k,{value:s,onChange:O,name:w.hex({label:h}),readOnly:y})]}):null]})}function k({value:e,onChange:a,name:n,readOnly:l}){const[r,s]=t(null);/* @__PURE__ */
8
- return i("input",{type:"text",className:"es-pick-hex",value:r??(e?u(e):""),"aria-label":n,maxLength:7,spellCheck:!1,autoComplete:"off",readOnly:l,onChange:t=>{s(t.target.value);const n=c(t.target.value);null!==n&&n!==e&&a(n)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),e.stopPropagation(),s(null),e.currentTarget.blur())},onBlur:()=>s(null)})}function f({value:a,onChange:n,label:l,openLibrary:s,kind:o="image",placeholder:c,readOnly:u,words:h=e.image}){const[m,d]=t(!1),[p,v]=t(!1),b=Boolean(s)&&!u,k=async()=>{if(s&&!m&&!u){d(!0),v(!1);try{const e=await s();e&&n(e)}catch{v(!0)}finally{d(!1)}}},f=m?/* @__PURE__ */i("p",{className:"es-pick-image-status",role:"status",children:h.choosing}):p?/* @__PURE__ */i("p",{className:"es-pick-image-status is-error",role:"alert",children:h.failed}):null;if(!a)/* @__PURE__ */
9
- return r("div",{className:"es-pick-image",children:[
10
- /* @__PURE__ */r("button",{type:"button",className:"es-pick-image-slot",onClick:k,disabled:!b||m,"aria-label":h.empty({label:l,kind:o,placeholder:c}),children:[
11
- /* @__PURE__ */i("span",{className:"es-pick-image-slot-name",children:c??("video"===o?h.chooseVideo:h.chooseImage)}),b?/* @__PURE__ */i("span",{className:"es-pick-image-slot-hint",children:h.hint}):null]}),f]});const y=g(a),w=y?h.named({label:l,name:y}):l;/* @__PURE__ */
12
- return r("div",{className:"es-pick-image",children:[
13
- /* @__PURE__ */r("figure",{className:"es-pick-image-figure",children:[
14
- /* @__PURE__ */i("div",{className:"es-pick-image-frame",children:"video"===o?/* @__PURE__ */i("video",{src:a,muted:!0,playsInline:!0,preload:"metadata","aria-label":w}):/* @__PURE__ */i("img",{src:a,alt:w})}),y?/* @__PURE__ */i("figcaption",{className:"es-pick-image-name",title:y,children:y}):null]}),b||!u?/* @__PURE__ */r("div",{className:"es-pick-image-actions",children:[b?/* @__PURE__ */i("button",{type:"button",className:"es-pick-image-btn",onClick:k,disabled:m,"aria-label":h.replaceNamed({label:l}),children:h.replace}):null,u?null:/* @__PURE__ */i("button",{type:"button",className:"es-pick-image-btn is-bare",onClick:()=>n(""),disabled:m,"aria-label":h.removeNamed({label:l}),children:h.remove})]}):null,f]})}export{b as ColourPicker,o as HEX_MAX_LENGTH,f as ImageBox,u as hexReadout,m as hexToHsv,d as hsvToHex,v as hueFromPoint,g as mediaName,p as svFromPoint,c as typedHex};
1
+ import{mediaName as e}from"../chunk-AZT7V4UM.js";export{ColourPicker,ColourWindow,HEX_MAX_LENGTH,hexReadout,hexToHsv,hsvToHex,hueFromPoint,mediaName,svFromPoint,typedHex}from"../chunk-AZT7V4UM.js";import{DEFAULT_PICK_WORDS as a}from"../chunk-ZAOM6PFH.js";import{useState as i}from"react";import{jsx as l,jsxs as s}from"react/jsx-runtime";function c({value:c,onChange:n,label:o,openLibrary:r,kind:t="image",placeholder:m,readOnly:d,words:p=a.image}){const[u,h]=i(!1),[b,g]=i(!1),k=Boolean(r)&&!d,N=async()=>{if(r&&!u&&!d){h(!0),g(!1);try{const e=await r();e&&n(e)}catch{g(!0)}finally{h(!1)}}},f=u?/* @__PURE__ */l("p",{className:"es-pick-image-status",role:"status",children:p.choosing}):b?/* @__PURE__ */l("p",{className:"es-pick-image-status is-error",role:"alert",children:p.failed}):null;if(!c)/* @__PURE__ */
2
+ return s("div",{className:"es-pick-image",children:[
3
+ /* @__PURE__ */s("button",{type:"button",className:"es-pick-image-slot",onClick:N,disabled:!k||u,"aria-label":p.empty({label:o,kind:t,placeholder:m}),children:[
4
+ /* @__PURE__ */l("span",{className:"es-pick-image-slot-name",children:m??("video"===t?p.chooseVideo:p.chooseImage)}),k?/* @__PURE__ */l("span",{className:"es-pick-image-slot-hint",children:p.hint}):null]}),f]});const v=e(c),y=v?p.named({label:o,name:v}):o;/* @__PURE__ */
5
+ return s("div",{className:"es-pick-image",children:[
6
+ /* @__PURE__ */s("figure",{className:"es-pick-image-figure",children:[
7
+ /* @__PURE__ */l("div",{className:"es-pick-image-frame",children:"video"===t?/* @__PURE__ */l("video",{src:c,muted:!0,playsInline:!0,preload:"metadata","aria-label":y}):/* @__PURE__ */l("img",{src:c,alt:y})}),v?/* @__PURE__ */l("figcaption",{className:"es-pick-image-name",title:v,children:v}):null]}),k||!d?/* @__PURE__ */s("div",{className:"es-pick-image-actions",children:[k?/* @__PURE__ */l("button",{type:"button",className:"es-pick-image-btn",onClick:N,disabled:u,"aria-label":p.replaceNamed({label:o}),children:p.replace}):null,d?null:/* @__PURE__ */l("button",{type:"button",className:"es-pick-image-btn is-bare",onClick:()=>n(""),disabled:u,"aria-label":p.removeNamed({label:o}),children:p.remove})]}):null,f]})}export{c as ImageBox};
@@ -138,6 +138,20 @@
138
138
  .es-pick-hue-thumb {
139
139
  top: 50%;
140
140
  }
141
+ /* The hex row with its swatch (ColourWindow `swatch`, the text box's colour
142
+ window): the colour, then the hex. */
143
+ .es-pick-hex-row {
144
+ display: flex;
145
+ align-items: center;
146
+ gap: 8px;
147
+ }
148
+ .es-pick-hex-swatch {
149
+ width: 26px;
150
+ height: 26px;
151
+ flex: none;
152
+ border-radius: 6px;
153
+ box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.1);
154
+ }
141
155
 
142
156
  /* ── The image box ──────────────────────────────────────────────────────── */
143
157
  .es-pick-image {
@@ -1,8 +1,8 @@
1
1
  import * as react from 'react';
2
- import { c as EditorRailProps, E as EditorRailButtonProps } from '../types-DNrn_w4V.js';
3
- export { a as EditorRailItem, b as EditorRailOrientation } from '../types-DNrn_w4V.js';
2
+ import { c as EaselRailProps, E as EaselRailButtonProps } from '../types-DWS-s9z-.js';
3
+ export { a as EaselRailItem, b as EaselRailOrientation } from '../types-DWS-s9z-.js';
4
4
  export { AddIcon, LayersIcon, MediaIcon, PageIcon as PagesIcon, IconProps as RailIconProps, SitemapIcon, StylesIcon } from '../icons/index.js';
5
- export { W as WordFit } from '../wordFit-9B9nqyf3.js';
5
+ export { W as WordFit } from '../wordFit-D4S36PvB.js';
6
6
 
7
7
  /**
8
8
  * The shared icon-rail — one slim strip of icon buttons that every EFFICIENT
@@ -43,7 +43,7 @@ export { W as WordFit } from '../wordFit-9B9nqyf3.js';
43
43
  * strings provider — that would be a hook — so a host in another language
44
44
  * passes `ariaLabel`; `TopBarRail` does it from the provider.
45
45
  */
46
- declare function EditorRail({ items, ariaLabel, className, orientation, wordFit, }: EditorRailProps): react.JSX.Element;
46
+ declare function EaselRail({ items, ariaLabel, className, orientation, wordFit, }: EaselRailProps): react.JSX.Element;
47
47
 
48
48
  /**
49
49
  * A single rail button: an icon in a 34×34 square that hovers, highlights when
@@ -53,7 +53,7 @@ declare function EditorRail({ items, ariaLabel, className, orientation, wordFit,
53
53
  * toggle announces its pressed state while an action button (the quick-add "+",
54
54
  * whose item omits `active`) stays a plain button rather than a stuck toggle.
55
55
  */
56
- declare function EditorRailButton({ label, worded, icon, active, disabled, onSelect, className, }: EditorRailButtonProps): react.JSX.Element;
56
+ declare function EaselRailButton({ label, worded, icon, active, disabled, onSelect, className, }: EaselRailButtonProps): react.JSX.Element;
57
57
 
58
58
  /**
59
59
  * Rail design tokens — the ONE source both apps' rails converge on.
@@ -142,4 +142,4 @@ declare const railCssVars: {
142
142
  readonly accentTint: "--es-rail-accent-tint";
143
143
  };
144
144
 
145
- export { EditorRail, EditorRailButton, EditorRailButtonProps, EditorRailProps, type RailTokens, railCssVars, railTokens };
145
+ export { EaselRail, EaselRailButton, EaselRailButtonProps, EaselRailProps, type RailTokens, railCssVars, railTokens };
@@ -1 +1 @@
1
- import"../chunk-OWBO4WKA.js";export{EditorRail,EditorRailButton,railCssVars,railTokens}from"../chunk-IBOFSS56.js";import"../chunk-2OAZYSWJ.js";import"../chunk-BZ5ASXOL.js";export{AddIcon,LayersIcon,MediaIcon,PageIcon as PagesIcon,SitemapIcon,StylesIcon}from"../chunk-PI26YXYD.js";
1
+ import"../chunk-OWBO4WKA.js";export{EaselRail,EaselRailButton,railCssVars,railTokens}from"../chunk-WZ7TGAAT.js";import"../chunk-2OAZYSWJ.js";import"../chunk-BZ5ASXOL.js";export{AddIcon,LayersIcon,MediaIcon,PageIcon as PagesIcon,SitemapIcon,StylesIcon}from"../chunk-6EIVTKZZ.js";
@@ -135,7 +135,7 @@
135
135
  sheet only names the rail's chrome for it — the four inputs below — so a
136
136
  re-padded rail button moves its thresholds with it.
137
137
 
138
- `is-measured` is set by `EditorRail` when it was handed the words' widths
138
+ `is-measured` is set by `EaselRail` when it was handed the words' widths
139
139
  (`TopBarRail` measures them). Without it, and without `panel.css`, the word
140
140
  stays clipped to nothing: an icon-only rail always fits. */
141
141
  .es-rail.es-rail-row.is-measured {
@@ -1,22 +1,24 @@
1
- import { S as SaveWords } from '../words-Cqmyey0s.js';
2
- import { N as NoticeWords, C as ChromeWords } from '../words-DagJdwIA.js';
3
- import { C as CopyWords } from '../words-bOMsUJk9.js';
4
- import { D as DragWords } from '../words-D9ChvbNC.js';
1
+ import { S as SaveWords } from '../words-BMzV04b1.js';
2
+ import { N as NoticeWords, C as ChromeWords } from '../words-AHHfiaRY.js';
3
+ import { C as CopyWords } from '../words-DBq7vfHy.js';
4
+ import { D as DragWords } from '../words-BDignMl_.js';
5
5
  import { LockWords } from '../edit-lock/index.js';
6
- import { F as FieldsWords } from '../words-CD3WADyb.js';
7
- import { N as NodeMenuWords } from '../words-DOhF-4D4.js';
8
- import { S as SettingsBucket } from '../buckets-CuLM47h9.js';
9
- import { P as PickWords } from '../words-B87GIFWH.js';
10
- import { S as StyleClipboardWords } from '../words-B2YLaKEr.js';
11
- import { T as TreeWords } from '../words-BK-npta-.js';
12
- import '../types-CnRzp9oc.js';
13
- import '../types-DNrn_w4V.js';
14
- import '../wordFit-9B9nqyf3.js';
6
+ import { F as FieldsWords } from '../words-CzoyDNHm.js';
7
+ import { N as NodeMenuWords } from '../words-DMG4dYq2.js';
8
+ import { P as PanelWords } from '../words-CJjUKcV5.js';
9
+ import { P as PickWords } from '../words-is_Vy6hn.js';
10
+ import { S as StyleClipboardWords } from '../words-CnnHb9jo.js';
11
+ import { T as TextStylesWords } from '../words-CRYvAiHX.js';
12
+ import { T as TreeWords } from '../words-DgHcY5qB.js';
13
+ import '../types-DGcCsxs8.js';
14
+ import '../types-DWS-s9z-.js';
15
+ import '../wordFit-D4S36PvB.js';
15
16
  import 'react';
16
17
  import '../markup/index.js';
18
+ import '../buckets-CuLM47h9.js';
17
19
 
18
20
  /**
19
- * The editor canvas's own words (`efficient-easel/strings`, 0.95.0). There is
21
+ * The easel canvas's own words (`efficient-easel/strings`, 0.95.0). There is
20
22
  * one: what the frame is called when the host does not name it (`title`).
21
23
  *
22
24
  * A plain module with no import.
@@ -26,26 +28,6 @@ type CanvasWords = {
26
28
  frame: string;
27
29
  };
28
30
 
29
- /**
30
- * The settings panel's own words (`efficient-easel/strings`, 0.95.0): what
31
- * the tab strip is called, and what each tab SAYS.
32
- *
33
- * A bucket's key (`'Content'`, `'Style'`, …) is an identifier — fields name
34
- * their tab with it and `SETTINGS_BUCKETS` orders them — so it never changes
35
- * with the language. `buckets` is the word drawn for each key.
36
- *
37
- * The panel is hook-free, so nothing here is read from the strings provider:
38
- * `SettingsTabs` takes its name as `ariaLabel` and each tab's word as the
39
- * item's `label`, and `Inspector` (which has hooks) passes both.
40
- */
41
-
42
- type PanelWords = {
43
- /** The tab strip's accessible name. */
44
- settings: string;
45
- /** The word each tab shows, by its key. */
46
- buckets: Record<SettingsBucket, string>;
47
- };
48
-
49
31
  /**
50
32
  * The rail's own words. There is one: what the toolbar is called when the host
51
33
  * does not name it (`ariaLabel`). Every other word on the rail is an item's
@@ -79,7 +61,7 @@ type RailWords = {
79
61
  * lane (`tests/*-leaf-safety`), and several are held to a bundle that never
80
62
  * spells a browser global — while one sentence below does ("another tab or
81
63
  * window"). So a module owns its group and its defaults, and this file only
82
- * puts the groups side by side. `DEFAULT_EDITOR_STRINGS.pick` IS the pickers'
64
+ * puts the groups side by side. `DEFAULT_EASEL_STRINGS.pick` IS the pickers'
83
65
  * own default object, not a copy of it.
84
66
  *
85
67
  * ── Framework-free ────────────────────────────────────────────────────────
@@ -91,7 +73,7 @@ type RailWords = {
91
73
  */
92
74
 
93
75
  /** Every word the engine says, by the module that says it. */
94
- interface EditorStrings {
76
+ interface EaselStrings {
95
77
  /** `efficient-easel/chrome` — `EditNotice`: who holds the document, a refused save. */
96
78
  notice: NoticeWords;
97
79
  /** `efficient-easel/edit-lock` — "2 minutes ago", "Someone else". */
@@ -118,11 +100,13 @@ interface EditorStrings {
118
100
  styleClipboard: StyleClipboardWords;
119
101
  /** `efficient-easel/copy` — the formatting bar, alignment, the link window, each mark. */
120
102
  copy: CopyWords;
121
- /** `efficient-easel/editor` — the canvas frame's name. */
103
+ /** `efficient-easel/easel` — the canvas frame's name. */
122
104
  canvas: CanvasWords;
105
+ /** `efficient-easel/text-styles` — the Email styles / Site styles list (E6). */
106
+ textStyles: TextStylesWords;
123
107
  }
124
108
  /** Today's English, word for word. */
125
- declare const DEFAULT_EDITOR_STRINGS: EditorStrings;
109
+ declare const DEFAULT_EASEL_STRINGS: EaselStrings;
126
110
  /**
127
111
  * A catalogue with any part left out. A function entry is taken whole or not
128
112
  * at all: it has no "part" to leave out.
@@ -136,6 +120,6 @@ type DeepPartial<T> = T extends (...args: never[]) => unknown ? T : T extends ob
136
120
  * that has translated half the catalogue shows the other half in English
137
121
  * rather than as nothing. Neither argument is changed.
138
122
  */
139
- declare function mergeEditorStrings(defaults: EditorStrings, partial?: DeepPartial<EditorStrings> | null): EditorStrings;
123
+ declare function mergeEaselStrings(defaults: EaselStrings, partial?: DeepPartial<EaselStrings> | null): EaselStrings;
140
124
 
141
- export { type CanvasWords, ChromeWords, CopyWords, DEFAULT_EDITOR_STRINGS, type DeepPartial, DragWords, type EditorStrings, FieldsWords, LockWords, NodeMenuWords, NoticeWords, type PanelWords, PickWords, type RailWords, SaveWords, StyleClipboardWords, TreeWords, mergeEditorStrings };
125
+ export { type CanvasWords, ChromeWords, CopyWords, DEFAULT_EASEL_STRINGS, type DeepPartial, DragWords, type EaselStrings, FieldsWords, LockWords, NodeMenuWords, NoticeWords, PanelWords, PickWords, type RailWords, SaveWords, StyleClipboardWords, TextStylesWords, TreeWords, mergeEaselStrings };
@@ -1 +1 @@
1
- export{DEFAULT_EDITOR_STRINGS,mergeEditorStrings}from"../chunk-JE63JHKO.js";import"../chunk-ZAOM6PFH.js";import"../chunk-6WY6ZXJG.js";import"../chunk-GGTPNGFJ.js";import"../chunk-SUO5627P.js";import"../chunk-H4B72XCJ.js";import"../chunk-7A7O2JWQ.js";import"../chunk-WK3AFPXY.js";import"../chunk-H6DDIBQ4.js";import"../chunk-KDIVA6WD.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import"../chunk-ZT7M24XD.js";import"../chunk-SJQG5ENJ.js";import"../chunk-O2NLQBFX.js";
1
+ export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-SAJUCHOX.js";import"../chunk-M6F6LS3H.js";import"../chunk-6WY6ZXJG.js";import"../chunk-AELNNAFM.js";import"../chunk-3EDSDPIP.js";import"../chunk-TRVZ7C23.js";import"../chunk-WK3AFPXY.js";import"../chunk-H6DDIBQ4.js";import"../chunk-RE4LP46F.js";import"../chunk-ZJEBF4NB.js";import"../chunk-2OAZYSWJ.js";import"../chunk-JQM3V7XQ.js";import"../chunk-ZAOM6PFH.js";import"../chunk-LA54QLP5.js";import"../chunk-HDVD27VB.js";import"../chunk-O2NLQBFX.js";
@@ -1,24 +1,26 @@
1
- import { DeepPartial, EditorStrings } from './catalogue.js';
2
- export { CanvasWords, DEFAULT_EDITOR_STRINGS, PanelWords, RailWords, mergeEditorStrings } from './catalogue.js';
1
+ import { DeepPartial, EaselStrings } from './catalogue.js';
2
+ export { CanvasWords, DEFAULT_EASEL_STRINGS, RailWords, mergeEaselStrings } from './catalogue.js';
3
3
  import * as react from 'react';
4
4
  import { ReactNode } from 'react';
5
- export { C as ChromeWords, N as NoticeWords } from '../words-DagJdwIA.js';
6
- export { C as CopyWords } from '../words-bOMsUJk9.js';
7
- export { D as DragWords } from '../words-D9ChvbNC.js';
8
- export { F as FieldsWords } from '../words-CD3WADyb.js';
5
+ export { C as ChromeWords, N as NoticeWords } from '../words-AHHfiaRY.js';
6
+ export { C as CopyWords } from '../words-DBq7vfHy.js';
7
+ export { D as DragWords } from '../words-BDignMl_.js';
8
+ export { F as FieldsWords } from '../words-CzoyDNHm.js';
9
9
  export { LockWords } from '../edit-lock/index.js';
10
- export { N as NodeMenuWords } from '../words-DOhF-4D4.js';
11
- export { P as PickWords } from '../words-B87GIFWH.js';
12
- export { S as SaveWords } from '../words-Cqmyey0s.js';
13
- export { S as StyleClipboardWords } from '../words-B2YLaKEr.js';
14
- export { T as TreeWords } from '../words-BK-npta-.js';
15
- import '../buckets-CuLM47h9.js';
10
+ export { N as NodeMenuWords } from '../words-DMG4dYq2.js';
11
+ export { P as PanelWords } from '../words-CJjUKcV5.js';
12
+ export { P as PickWords } from '../words-is_Vy6hn.js';
13
+ export { S as SaveWords } from '../words-BMzV04b1.js';
14
+ export { S as StyleClipboardWords } from '../words-CnnHb9jo.js';
15
+ export { T as TextStylesWords } from '../words-CRYvAiHX.js';
16
+ export { T as TreeWords } from '../words-DgHcY5qB.js';
16
17
  import '../markup/index.js';
17
- import '../types-CnRzp9oc.js';
18
- import '../types-DNrn_w4V.js';
19
- import '../wordFit-9B9nqyf3.js';
18
+ import '../buckets-CuLM47h9.js';
19
+ import '../types-DGcCsxs8.js';
20
+ import '../types-DWS-s9z-.js';
21
+ import '../wordFit-D4S36PvB.js';
20
22
 
21
- interface EditorStringsProviderProps {
23
+ interface EaselStringsProviderProps {
22
24
  /**
23
25
  * The host's words, laid over the ones in reach — the engine's English, or an
24
26
  * outer provider's. Anything left out keeps what was there.
@@ -27,10 +29,10 @@ interface EditorStringsProviderProps {
27
29
  * a `useMemo`): a new object every render is a new catalogue every render,
28
30
  * and everything that reads it draws again.
29
31
  */
30
- value?: DeepPartial<EditorStrings>;
32
+ value?: DeepPartial<EaselStrings>;
31
33
  /**
32
34
  * The language those words are in, as a BCP 47 tag (`'de'`, `'zh-Hant'`). The
33
- * engine does not read it; `useEditorLocale()` hands it to a host's blocks and
35
+ * engine does not read it; `useEaselLocale()` hands it to a host's blocks and
34
36
  * fields, so a number or a date drawn in the editor follows the same language.
35
37
  * Left out: an outer provider's, else `'en'`.
36
38
  */
@@ -45,12 +47,12 @@ interface EditorStringsProviderProps {
45
47
  * primitives, the Layers tree, the pickers, the Add panel, the canvas layer —
46
48
  * and neither do the plain functions (`editNotice`, `saveIndicator`,
47
49
  * `nodeMenuItems`, …). Each takes its group as a prop or an argument instead;
48
- * a host hands it `useEditorStrings()`'s.
50
+ * a host hands it `useEaselStrings()`'s.
49
51
  */
50
- declare function EditorStringsProvider({ value, locale, children }: EditorStringsProviderProps): react.JSX.Element;
52
+ declare function EaselStringsProvider({ value, locale, children }: EaselStringsProviderProps): react.JSX.Element;
51
53
  /** The whole catalogue: the nearest provider's, or the engine's English. */
52
- declare function useEditorStrings(): EditorStrings;
54
+ declare function useEaselStrings(): EaselStrings;
53
55
  /** The nearest provider's locale, or `'en'`. */
54
- declare function useEditorLocale(): string;
56
+ declare function useEaselLocale(): string;
55
57
 
56
- export { DeepPartial, EditorStrings, EditorStringsProvider, type EditorStringsProviderProps, useEditorLocale, useEditorStrings };
58
+ export { DeepPartial, EaselStrings, EaselStringsProvider, type EaselStringsProviderProps, useEaselLocale, useEaselStrings };
@@ -1,2 +1,2 @@
1
- import{DEFAULT_EDITOR_STRINGS as r,mergeEditorStrings as n}from"../chunk-JE63JHKO.js";export{DEFAULT_EDITOR_STRINGS,mergeEditorStrings}from"../chunk-JE63JHKO.js";import"../chunk-ZAOM6PFH.js";import"../chunk-6WY6ZXJG.js";import"../chunk-GGTPNGFJ.js";import"../chunk-SUO5627P.js";import"../chunk-H4B72XCJ.js";import"../chunk-7A7O2JWQ.js";import"../chunk-WK3AFPXY.js";import"../chunk-H6DDIBQ4.js";import"../chunk-KDIVA6WD.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import"../chunk-ZT7M24XD.js";import"../chunk-SJQG5ENJ.js";import{stringsContext as o}from"../chunk-MFIRYGHW.js";import"../chunk-O2NLQBFX.js";import{useContext as t,useMemo as i}from"react";import{jsx as c}from"react/jsx-runtime";function s({value:s,locale:u,children:m}){const e=o(),p=t(e),h=p?.strings??r,j=u??p?.locale??"en",k=i(()=>({strings:n(h,s),locale:j}),[h,s,j]);/* @__PURE__ */
2
- return c(e.Provider,{value:k,children:m})}function u(){return t(o())?.strings??r}function m(){return t(o())?.locale??"en"}export{s as EditorStringsProvider,m as useEditorLocale,u as useEditorStrings};
1
+ import{DEFAULT_EASEL_STRINGS as r,mergeEaselStrings as n}from"../chunk-SAJUCHOX.js";export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-SAJUCHOX.js";import"../chunk-M6F6LS3H.js";import"../chunk-6WY6ZXJG.js";import"../chunk-AELNNAFM.js";import"../chunk-3EDSDPIP.js";import"../chunk-TRVZ7C23.js";import"../chunk-WK3AFPXY.js";import"../chunk-H6DDIBQ4.js";import"../chunk-RE4LP46F.js";import"../chunk-ZJEBF4NB.js";import"../chunk-2OAZYSWJ.js";import"../chunk-JQM3V7XQ.js";import"../chunk-ZAOM6PFH.js";import"../chunk-LA54QLP5.js";import"../chunk-HDVD27VB.js";import{stringsContext as o}from"../chunk-MFIRYGHW.js";import"../chunk-O2NLQBFX.js";import{useContext as t,useMemo as c}from"react";import{jsx as i}from"react/jsx-runtime";function s({value:s,locale:u,children:m}){const e=o(),p=t(e),h=p?.strings??r,j=u??p?.locale??"en",k=c(()=>({strings:n(h,s),locale:j}),[h,s,j]);/* @__PURE__ */
2
+ return i(e.Provider,{value:k,children:m})}function u(){return t(o())?.strings??r}function m(){return t(o())?.locale??"en"}export{s as EaselStringsProvider,m as useEaselLocale,u as useEaselStrings};
@@ -1,5 +1,5 @@
1
- import { E as EditorContextMenuItem } from '../types-pGBXevBU.js';
2
- import { S as StyleClipboardWords } from '../words-B2YLaKEr.js';
1
+ import { E as EaselContextMenuItem } from '../types-Djdq6Xkd.js';
2
+ import { S as StyleClipboardWords } from '../words-CnnHb9jo.js';
3
3
  import 'react';
4
4
 
5
5
  /**
@@ -143,7 +143,7 @@ declare function planPaste(snapshot: StyleSnapshot, target: {
143
143
  }): PastePlan;
144
144
  /** The words a merchant reads after a paste. One copy, so both editors say the
145
145
  * same thing — including, plainly, when nothing matched. `words` is the host's
146
- * language (`useEditorStrings().styleClipboard`, 0.95.0); left out, English. */
146
+ * language (`useEaselStrings().styleClipboard`, 0.95.0); left out, English. */
147
147
  declare function pasteMessage(plan: Pick<PastePlan, 'pasted'>, sourceLabel: string, targetLabel: string, words?: StyleClipboardWords): string;
148
148
  /** The two shortcuts, as a menu draws them. */
149
149
  declare const COPY_STYLE_SHORTCUT = "\u2325\u2318C";
@@ -161,9 +161,9 @@ declare function styleMenuItems(opts: {
161
161
  canCopy: boolean;
162
162
  onCopy: () => void;
163
163
  onPaste: () => void;
164
- /** The rows' words in the host's language (`useEditorStrings().styleClipboard`, 0.95.0). Left out, English. */
164
+ /** The rows' words in the host's language (`useEaselStrings().styleClipboard`, 0.95.0). Left out, English. */
165
165
  words?: StyleClipboardWords;
166
- }): EditorContextMenuItem[];
166
+ }): EaselContextMenuItem[];
167
167
  /**
168
168
  * Is this key press Copy style or Paste style?
169
169
  *
@@ -1 +1 @@
1
- import{DEFAULT_STYLE_CLIPBOARD_WORDS as t}from"../chunk-6WY6ZXJG.js";import{CopyStyleIcon as e,PasteStyleIcon as n}from"../chunk-PI26YXYD.js";import{jsx as o}from"react/jsx-runtime";var r="__styleKind";function u(t,e){return t[r]=e,t}function c(t,e){return`${t}:${e.map(t=>String(t)).sort().join("|")}`}function i(t){if(!t)return null;const e=t.indexOf(":");if(e<0)return null;const n=t.slice(0,e);return s.has(n)?{control:n,values:t.slice(e+1).split("|")}:null}var s=/* @__PURE__ */new Set(["choice","select","radio"]);function l(t){if(!t||"object"!=typeof t)return null;const e=t;return"string"==typeof e[r]?e[r]:"text"===e.type||"textarea"===e.type||"number"===e.type?e.type:"select"!==e.type&&"radio"!==e.type||!Array.isArray(e.options)?null:c(e.type,e.options.map(t=>t?.value))}function a(t){return null!=t&&""!==t}function p(t,e){let n=t;for(const t of e){if(!n||"object"!=typeof n)return;n=n[t]}return n}function f(t){return void 0===t?t:JSON.parse(JSON.stringify(t))}function d(t,e,n){const[o,...r]=e,u={...t};if(0===r.length)return void 0===n?delete u[o]:u[o]=n,u;const c=u[o],i=d(c&&"object"==typeof c?c:{},r,n);return 0===Object.keys(i).length?delete u[o]:u[o]=i,u}var y=t=>t.join("."),h="editor-shell:style-clipboard",g=null,m=!1,v=/* @__PURE__ */new Set;function S(){try{return"undefined"==typeof sessionStorage?null:sessionStorage}catch{return null}}function b(){if(!m){m=!0;try{const t=S()?.getItem(h);t&&(g=JSON.parse(t))}catch{g=null}}}function k(t){b(),g={scope:t.scope,sourceType:t.type,sourceLabel:t.label,rows:t.rows.map(e=>{const n=p(t.props,e.path);return{path:[...e.path],kind:e.kind,counted:!1!==e.counted,value:a(n)?f(n):void 0}})};try{S()?.setItem(h,JSON.stringify(g))}catch{}return v.forEach(t=>t()),g}function N(t){return b(),g&&g.scope===t?g:null}function j(t){return v.add(t),()=>{v.delete(t)}}function C(){g=null,m=!0;try{S()?.removeItem(h)}catch{}v.forEach(t=>t())}function w(t,e,n){if(t.kind===e.kind)return null!==e.kind||n;const o=i(t.kind),r=i(e.kind);return!(!o||!r||o.control!==r.control)&&(!a(t.value)||r.values.includes(String(t.value)))}function O(t,e){const n=t.sourceType===e.type,o=new Map(t.rows.map(t=>[y(t.path),t]));let r=e.props,u=0,c=!1;for(const t of e.rows){const e=o.get(y(t.path));if(!e)continue;if(!w(e,t,n))continue;const i=p(r,t.path),s=void 0===e.value?void 0:f(e.value);JSON.stringify(a(i)?i:void 0)!==JSON.stringify(s)&&(r=d(r,t.path,s),c=!0),!1!==t.counted&&(u+=1)}return{props:r,pasted:u,changed:c}}function E(e,n,o,r=t){return 0===e.pasted?r.nothing({source:n,target:o}):r.pasted({count:e.pasted,source:n})}var J="⌥⌘C",K="⌥⌘V";function T(r){const u=r.words??t,c=[];return r.canCopy&&c.push({label:u.copy,icon:/* @__PURE__ */o(e,{}),shortcut:"⌥⌘C",onClick:r.onCopy}),r.held&&c.push({label:u.paste({source:r.held.sourceLabel}),icon:/* @__PURE__ */o(n,{}),shortcut:"⌥⌘V",onClick:r.onPaste}),c}function x(t){if(!t.altKey||t.shiftKey||!t.metaKey&&!t.ctrlKey)return null;const e=t.target;return e&&(e.isContentEditable||"INPUT"===e.tagName||"TEXTAREA"===e.tagName||"SELECT"===e.tagName)?null:"KeyC"===t.code?"copy":"KeyV"===t.code?"paste":null}export{J as COPY_STYLE_SHORTCUT,K as PASTE_STYLE_SHORTCUT,r as STYLE_KIND,c as choiceKind,C as clearStyle,k as copyStyle,l as fieldKind,N as heldStyle,E as pasteMessage,O as planPaste,T as styleMenuItems,x as styleShortcut,j as subscribeStyle,u as withStyleKind};
1
+ import{DEFAULT_STYLE_CLIPBOARD_WORDS as t}from"../chunk-6WY6ZXJG.js";import{CopyStyleIcon as e,PasteStyleIcon as n}from"../chunk-6EIVTKZZ.js";import{jsx as o}from"react/jsx-runtime";var r="__styleKind";function u(t,e){return t[r]=e,t}function c(t,e){return`${t}:${e.map(t=>String(t)).sort().join("|")}`}function i(t){if(!t)return null;const e=t.indexOf(":");if(e<0)return null;const n=t.slice(0,e);return s.has(n)?{control:n,values:t.slice(e+1).split("|")}:null}var s=/* @__PURE__ */new Set(["choice","select","radio"]);function l(t){if(!t||"object"!=typeof t)return null;const e=t;return"string"==typeof e[r]?e[r]:"text"===e.type||"textarea"===e.type||"number"===e.type?e.type:"select"!==e.type&&"radio"!==e.type||!Array.isArray(e.options)?null:c(e.type,e.options.map(t=>t?.value))}function a(t){return null!=t&&""!==t}function p(t,e){let n=t;for(const t of e){if(!n||"object"!=typeof n)return;n=n[t]}return n}function f(t){return void 0===t?t:JSON.parse(JSON.stringify(t))}function d(t,e,n){const[o,...r]=e,u={...t};if(0===r.length)return void 0===n?delete u[o]:u[o]=n,u;const c=u[o],i=d(c&&"object"==typeof c?c:{},r,n);return 0===Object.keys(i).length?delete u[o]:u[o]=i,u}var y=t=>t.join("."),h="editor-shell:style-clipboard",g=null,m=!1,v=/* @__PURE__ */new Set;function S(){try{return"undefined"==typeof sessionStorage?null:sessionStorage}catch{return null}}function b(){if(!m){m=!0;try{const t=S()?.getItem(h);t&&(g=JSON.parse(t))}catch{g=null}}}function k(t){b(),g={scope:t.scope,sourceType:t.type,sourceLabel:t.label,rows:t.rows.map(e=>{const n=p(t.props,e.path);return{path:[...e.path],kind:e.kind,counted:!1!==e.counted,value:a(n)?f(n):void 0}})};try{S()?.setItem(h,JSON.stringify(g))}catch{}return v.forEach(t=>t()),g}function N(t){return b(),g&&g.scope===t?g:null}function j(t){return v.add(t),()=>{v.delete(t)}}function C(){g=null,m=!0;try{S()?.removeItem(h)}catch{}v.forEach(t=>t())}function w(t,e,n){if(t.kind===e.kind)return null!==e.kind||n;const o=i(t.kind),r=i(e.kind);return!(!o||!r||o.control!==r.control)&&(!a(t.value)||r.values.includes(String(t.value)))}function E(t,e){const n=t.sourceType===e.type,o=new Map(t.rows.map(t=>[y(t.path),t]));let r=e.props,u=0,c=!1;for(const t of e.rows){const e=o.get(y(t.path));if(!e)continue;if(!w(e,t,n))continue;const i=p(r,t.path),s=void 0===e.value?void 0:f(e.value);JSON.stringify(a(i)?i:void 0)!==JSON.stringify(s)&&(r=d(r,t.path,s),c=!0),!1!==t.counted&&(u+=1)}return{props:r,pasted:u,changed:c}}function K(e,n,o,r=t){return 0===e.pasted?r.nothing({source:n,target:o}):r.pasted({count:e.pasted,source:n})}var O="⌥⌘C",J="⌥⌘V";function T(r){const u=r.words??t,c=[];return r.canCopy&&c.push({label:u.copy,icon:/* @__PURE__ */o(e,{}),shortcut:"⌥⌘C",onClick:r.onCopy}),r.held&&c.push({label:u.paste({source:r.held.sourceLabel}),icon:/* @__PURE__ */o(n,{}),shortcut:"⌥⌘V",onClick:r.onPaste}),c}function x(t){if(!t.altKey||t.shiftKey||!t.metaKey&&!t.ctrlKey)return null;const e=t.target;return e&&(e.isContentEditable||"INPUT"===e.tagName||"TEXTAREA"===e.tagName||"SELECT"===e.tagName)?null:"KeyC"===t.code?"copy":"KeyV"===t.code?"paste":null}export{O as COPY_STYLE_SHORTCUT,J as PASTE_STYLE_SHORTCUT,r as STYLE_KIND,c as choiceKind,C as clearStyle,k as copyStyle,l as fieldKind,N as heldStyle,K as pasteMessage,E as planPaste,T as styleMenuItems,x as styleShortcut,j as subscribeStyle,u as withStyleKind};