efficient-easel 8.3.0 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +15 -0
  2. package/dist/chrome/chrome.css +18 -0
  3. package/dist/chrome/index.d.ts +26 -3
  4. package/dist/chrome/index.js +1 -1
  5. package/dist/{chunk-NOD4ATKF.js → chunk-CKBGJ53M.js} +1 -1
  6. package/dist/{chunk-ZG5T7RSV.js → chunk-CXLWPZZK.js} +3 -3
  7. package/dist/{chunk-DQZYXC3V.js → chunk-EJZ4RIRW.js} +1 -1
  8. package/dist/{chunk-CWTAS5R6.js → chunk-FJRAYUCX.js} +4 -4
  9. package/dist/{chunk-SQMUAXUS.js → chunk-GD7QFYER.js} +1 -1
  10. package/dist/{chunk-AUT242JK.js → chunk-GMXWP5XP.js} +1 -1
  11. package/dist/{chunk-QVUVDBGA.js → chunk-IE55HNMA.js} +18 -18
  12. package/dist/{chunk-VF6TCI62.js → chunk-NMUS2VVD.js} +1 -1
  13. package/dist/chunk-NRC43NHG.js +5 -0
  14. package/dist/{chunk-NCQSBU3O.js → chunk-P4CL4YQI.js} +1 -1
  15. package/dist/{chunk-UCLVWF5E.js → chunk-PEDDDWSG.js} +11 -11
  16. package/dist/{chunk-XTJCKV6Z.js → chunk-PPL7GB7D.js} +1 -1
  17. package/dist/{chunk-DPKWJTNX.js → chunk-TZIIRGVY.js} +1 -1
  18. package/dist/{chunk-HA33IXEU.js → chunk-VNN6VB4V.js} +1 -1
  19. package/dist/{chunk-7CIFWFP2.js → chunk-W3BK5T4O.js} +50 -50
  20. package/dist/{chunk-HDUAODXJ.js → chunk-W4U4SHKW.js} +3 -3
  21. package/dist/{chunk-IEKQTWQG.js → chunk-X5SPTRG3.js} +1 -1
  22. package/dist/chunk-Z6PVRXVY.js +1 -0
  23. package/dist/copy/copy.css +29 -15
  24. package/dist/copy/index.d.ts +2 -2
  25. package/dist/copy/index.js +13 -11
  26. package/dist/fields/index.js +1 -1
  27. package/dist/screen/components/AddBlockRow.js +1 -1
  28. package/dist/screen/components/AddSidePanel.js +1 -1
  29. package/dist/screen/components/MediaSidePanel.js +1 -1
  30. package/dist/screen/components/PageEditGuardNotices.js +1 -1
  31. package/dist/screen/components/SaveControls.js +1 -1
  32. package/dist/screen/components/ScreenChrome.js +1 -1
  33. package/dist/screen/components/ScreenMount.js +1 -1
  34. package/dist/screen/components/ScreenStoreProvider.js +1 -1
  35. package/dist/screen/components/SectionScreenShell.js +16 -16
  36. package/dist/screen/components/SidePanelHead.js +1 -1
  37. package/dist/screen/components/panel-widths.js +1 -1
  38. package/dist/screen/components/usePartBridge.js +1 -1
  39. package/dist/screen/index.js +1 -1
  40. package/dist/screen/lib/puck/use-section-ops.js +1 -1
  41. package/dist/screen/lib/screen-parts.js +1 -1
  42. package/dist/strings/catalogue.d.ts +2 -2
  43. package/dist/strings/catalogue.js +1 -1
  44. package/dist/strings/index.d.ts +2 -2
  45. package/dist/strings/index.js +1 -1
  46. package/dist/{words-C1U_dLBh.d.ts → words-BpiVrsW5.d.ts} +8 -0
  47. package/dist/{words-BAnsDT16.d.ts → words-DohP5ieg.d.ts} +3 -2
  48. package/package.json +3 -3
  49. package/dist/chunk-KIA6EKAM.js +0 -5
  50. package/dist/chunk-Y2G7CU6A.js +0 -1
package/README.md CHANGED
@@ -375,6 +375,21 @@ it, so a **server-rendered** editor writes the widths through the CSSOM instead:
375
375
  Until that runs, chrome.css draws the panels at `DEFAULT_PANEL_W`. See
376
376
  [Server rendering and a strict Content-Security-Policy](#server-rendering-and-a-strict-content-security-policy).
377
377
 
378
+ **The inspector head's words, and the body's inset (9.0.0).** `headWords()`
379
+ gives the head's two lines the same way in both editors: line 1 is the thing's
380
+ own name (its Layers row's word), line 2 its level.
381
+
382
+ ```tsx
383
+ const { name, kind } = headWords({ name: 'At zero', tier: 'part', of: 'Countdown' });
384
+ // → { name: 'At zero', kind: 'Part of Countdown' } ('section' → 'Section', 'block' → 'Block')
385
+ <InspectorHead icon={icon} name={name} kind={kind} />
386
+ <div className="es-insp-body">{/* the panel's rows */}</div>
387
+ ```
388
+
389
+ `es-insp-body` is the settings body's side inset, owned here: 16px, and 8px
390
+ under a 284px panel. It is opt-in, so a host adds the class and deletes its own
391
+ side padding.
392
+
378
393
  ## The Layers tree — one row at every depth
379
394
 
380
395
  `efficient-easel/tree` (added in 0.42.0) is the Layers tree both editors draw. Every
@@ -347,6 +347,24 @@ span:has(> .es-insp-up-btn) {
347
347
  .es-insp-head,
348
348
  .es-insp-up { padding-inline: 12px; }
349
349
  }
350
+
351
+ /* THE SETTINGS BODY'S ROW INSET, OWNED HERE AND OPT-IN (one text panel v3,
352
+ wave 2 · E1). Each editor padded its own body — the website 16px and 8px
353
+ under a 284px panel (`storefront-editor.css` `.sf-insp-body`, card 66212's
354
+ measured line), the email designer `p-3` plus 16px sides of its own — so the
355
+ same text panel sat at two insets and the email one cut Alignment at 220.
356
+ A host that puts `es-insp-body` on its panel body gets the website's numbers
357
+ and deletes its own; a host that does not is unchanged (no breaking change).
358
+ ONLY THE SIDES: the room above and below stays the host's. The inset is ONE
359
+ name, so anything that must line up with it reads the same value. The side
360
+ panel is the size container (`.es-sidepanel`), so this asks the panel. */
361
+ .es-insp-body {
362
+ --es-insp-pad-x: var(--es-space-16, 16px);
363
+ padding-inline: var(--es-insp-pad-x);
364
+ }
365
+ @container (width < 284px) {
366
+ .es-insp-body { --es-insp-pad-x: var(--es-space-8, 8px); }
367
+ }
350
368
  /* A HEAD WITH A WAY-OUT WORD, UNDER 260px (card [MERGE] One Media Panel Head
351
369
  For Both Editors, GG 2026-10-06). At a 220px panel the chip, Cancel, the
352
370
  hairline and Hide left the titles about 38px: "Choose image" drew "Ch…" in
@@ -1,9 +1,8 @@
1
1
  import * as react from 'react';
2
2
  import { T as TopBarProps, b as TopBarClusterProps, c as TopBarRailProps, E as EaselIconButtonProps, d as DeviceSwitchProps, e as SaveStateProps, f as SaveStateToggleProps, g as SaveIconProps, a as SaveIconState, h as SaveIconTone, P as PanelResizeHandleProps, I as InspectorHeadProps, i as InspectorIconButtonProps, j as InspectorUpLevelProps, M as MediaPanelHeadProps, k as MediaPickKind, l as EditNoticeProps } from '../types-DGyDHiJV.js';
3
3
  export { D as DeviceOption, R as RailWordsShown, S as SaveTone } from '../types-DGyDHiJV.js';
4
+ import { C as ChromeWords, N as NoticeWords } from '../words-BpiVrsW5.js';
4
5
  import { LockWords, EditAccess, SaveConflict } from '../edit-lock/index.js';
5
- import { N as NoticeWords } from '../words-C1U_dLBh.js';
6
- export { C as ChromeWords } from '../words-C1U_dLBh.js';
7
6
  export { D as DEFAULT_PANEL_W, M as MAX_PANEL_W, a as MIN_PANEL_W, P as PanelSide, b as PanelWidths, c as clampPanelWidth, p as panelWidthVars, s as setPanelWidthVars } from '../panelWidths-D9hTLR25.js';
8
7
  import '../types-CsgMwHHa.js';
9
8
  import '../wordFit-7XpmhcaW.js';
@@ -185,6 +184,30 @@ declare function InspectorIconButton({ label, title, hasPopup, onClick, disabled
185
184
  */
186
185
  declare function InspectorUpLevel({ name, onSelect, label, inline }: InspectorUpLevelProps): react.JSX.Element;
187
186
 
187
+ /** Where the selected thing sits: a section, a block, or a part of something. */
188
+ type HeadTier = 'section' | 'block' | 'part';
189
+ /**
190
+ * THE INSPECTOR HEAD'S TWO LINES, worked out once for both editors (one text
191
+ * panel v3, final 2026-10-15; GG's gate 4, which replaces the 2026-09-07 "the
192
+ * head names the style" ruling):
193
+ *
194
+ * line 1 the thing's own name — the same word as its Layers row;
195
+ * line 2 its level: "Section", "Block", or "Part of ‹what it is part of›".
196
+ *
197
+ * The style is NOT in the head: the Style row sits right under it, and the
198
+ * head saying it too would be the same name twice. Pure — no React, no host
199
+ * knowledge — so a host passes the result to `InspectorHead` as `name` and
200
+ * `kind`. `words` is a host's language (`EaselStringsProvider`'s chrome words).
201
+ */
202
+ declare function headWords({ name, tier, of }: {
203
+ name: string;
204
+ tier: HeadTier;
205
+ of?: string;
206
+ }, words?: Partial<Pick<ChromeWords, 'tierSection' | 'tierBlock' | 'partOf'>>): {
207
+ name: string;
208
+ kind: string;
209
+ };
210
+
188
211
  /**
189
212
  * THE MEDIA PANEL'S HEAD — one part for both editors (card [MERGE] One Media
190
213
  * Panel Head For Both Editors, owner ruling 2026-10-06: a part exists once, in
@@ -294,4 +317,4 @@ type EditNoticeWords = {
294
317
  */
295
318
  declare function editNotice(access: EditAccess, conflict: SaveConflict | null, noun: string, words?: EditNoticeWords): EditNoticeContent | null;
296
319
 
297
- export { DeviceSwitch, DeviceSwitchProps, EaselIconButton, EaselIconButtonProps, EaselTopBar, EditNotice, type EditNoticeAction, type EditNoticeContent, EditNoticeProps, type EditNoticeWords, InspectorHead, InspectorHeadProps, InspectorIconButton, InspectorIconButtonProps, InspectorUpLevel, InspectorUpLevelProps, MediaPanelHead, MediaPanelHeadProps, MediaPickKind, NoticeWords, PanelResizeHandle, PanelResizeHandleProps, SaveIcon, SaveIconProps, SaveIconState, SaveIconTone, SaveState, SaveStateProps, SaveStateToggle, SaveStateToggleProps, TopBarCluster, TopBarClusterProps, TopBarDivider, TopBarProps, TopBarRail, TopBarRailProps, editNotice, mediaPickKind, saveIconTone };
320
+ export { ChromeWords, DeviceSwitch, DeviceSwitchProps, EaselIconButton, EaselIconButtonProps, EaselTopBar, EditNotice, type EditNoticeAction, type EditNoticeContent, EditNoticeProps, type EditNoticeWords, type HeadTier, InspectorHead, InspectorHeadProps, InspectorIconButton, InspectorIconButtonProps, InspectorUpLevel, InspectorUpLevelProps, MediaPanelHead, MediaPanelHeadProps, MediaPickKind, NoticeWords, PanelResizeHandle, PanelResizeHandleProps, SaveIcon, SaveIconProps, SaveIconState, SaveIconTone, SaveState, SaveStateProps, SaveStateToggle, SaveStateToggleProps, TopBarCluster, TopBarClusterProps, TopBarDivider, TopBarProps, TopBarRail, TopBarRailProps, editNotice, headWords, mediaPickKind, saveIconTone };
@@ -1 +1 @@
1
- export{DEFAULT_PANEL_W,DeviceSwitch,EaselIconButton,EaselTopBar,EditNotice,InspectorHead,InspectorIconButton,InspectorUpLevel,MAX_PANEL_W,MIN_PANEL_W,MediaPanelHead,PanelResizeHandle,SaveIcon,SaveState,SaveStateToggle,TopBarCluster,TopBarDivider,TopBarRail,clampPanelWidth,editNotice,mediaPickKind,panelWidthVars,saveIconTone,setPanelWidthVars}from"../chunk-QVUVDBGA.js";import"../chunk-Y2G7CU6A.js";import"../chunk-THWO5YVZ.js";import"../chunk-RE4LP46F.js";import"../chunk-MJM6SFD3.js";import"../chunk-2OAZYSWJ.js";import"../chunk-MFIRYGHW.js";
1
+ export{DEFAULT_PANEL_W,DeviceSwitch,EaselIconButton,EaselTopBar,EditNotice,InspectorHead,InspectorIconButton,InspectorUpLevel,MAX_PANEL_W,MIN_PANEL_W,MediaPanelHead,PanelResizeHandle,SaveIcon,SaveState,SaveStateToggle,TopBarCluster,TopBarDivider,TopBarRail,clampPanelWidth,editNotice,headWords,mediaPickKind,panelWidthVars,saveIconTone,setPanelWidthVars}from"../chunk-IE55HNMA.js";import"../chunk-Z6PVRXVY.js";import"../chunk-THWO5YVZ.js";import"../chunk-RE4LP46F.js";import"../chunk-MJM6SFD3.js";import"../chunk-2OAZYSWJ.js";import"../chunk-MFIRYGHW.js";
@@ -1,4 +1,4 @@
1
- import{useScreenOwnerName as e}from"./chunk-CWTAS5R6.js";import{settlePanelPick as n}from"./chunk-R6WTQWAC.js";import{MediaPanelHead as i,mediaPickKind as c}from"./chunk-QVUVDBGA.js";import{jsxs as o,Fragment as r,jsx as t}from"react/jsx-runtime";function l({panel:l,pick:d,onHide:m}){const p=e();/* @__PURE__ */
1
+ import{useScreenOwnerName as e}from"./chunk-FJRAYUCX.js";import{settlePanelPick as n}from"./chunk-R6WTQWAC.js";import{MediaPanelHead as i,mediaPickKind as c}from"./chunk-IE55HNMA.js";import{jsxs as o,Fragment as r,jsx as t}from"react/jsx-runtime";function l({panel:l,pick:d,onHide:m}){const p=e();/* @__PURE__ */
2
2
  return o(r,{children:[
3
3
  /* @__PURE__ */t(i,{context:p,pick:d?{kind:c(d.accept),field:d.title||void 0}:null,onCancel:()=>d&&n(d.requestId,null),onHide:m}),
4
4
  /* @__PURE__ */t("div",{className:"sf-media-panel",children:/* @__PURE__ */t(l,{pick:d,onPick:e=>d&&n(d.requestId,e)})})]})}export{l as MediaSidePanel};
@@ -1,7 +1,7 @@
1
- import{clientOnly as r}from"./chunk-GXQCZJOP.js";import{ScreenStoreProvider as n}from"./chunk-DQZYXC3V.js";import{ScreenChrome as e}from"./chunk-7CIFWFP2.js";import{ScreenDocumentProvider as i,useScreenDocument as a}from"./chunk-THZ46DC5.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-JTUUIVBZ.js";import{documentPermissions as s}from"./chunk-THWO5YVZ.js";import{useWords as c}from"./chunk-MFIRYGHW.js";import{useMemo as t,useState as d,useRef as l,useEffect as m,useCallback as g}from"react";import{Dialog as h,Button as f}from"efficient-shell/ui";import{jsx as u,jsxs as p,Fragment as v}from"react/jsx-runtime";var C=r(n),k=r(e);function j({onCancel:r,onDiscard:n,onSave:e}){const i=c("screen",o).leave,[a,s]=d(!1),t=l(!0);m(()=>(t.current=!0,()=>{t.current=!1}),[]);const C=g(async()=>{s(!0);try{await e()}finally{t.current&&s(!1)}},[e]);/* @__PURE__ */
1
+ import{clientOnly as r}from"./chunk-GXQCZJOP.js";import{ScreenStoreProvider as n}from"./chunk-EJZ4RIRW.js";import{ScreenChrome as e}from"./chunk-W3BK5T4O.js";import{ScreenDocumentProvider as i,useScreenDocument as a}from"./chunk-THZ46DC5.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-JTUUIVBZ.js";import{documentPermissions as s}from"./chunk-THWO5YVZ.js";import{useWords as c}from"./chunk-MFIRYGHW.js";import{useMemo as t,useState as d,useRef as l,useEffect as m,useCallback as g}from"react";import{Dialog as h,Button as f}from"efficient-shell/ui";import{jsx as u,jsxs as p,Fragment as v}from"react/jsx-runtime";var k=r(n),C=r(e);function j({onCancel:r,onDiscard:n,onSave:e}){const i=c("screen",o).leave,[a,s]=d(!1),t=l(!0);m(()=>(t.current=!0,()=>{t.current=!1}),[]);const k=g(async()=>{s(!0);try{await e()}finally{t.current&&s(!1)}},[e]);/* @__PURE__ */
2
2
  return u(h,{open:!0,role:"alertdialog",size:"sm",title:i.title,onClose:r,footer:/* @__PURE__ */p(v,{children:[
3
3
  /* @__PURE__ */u(f,{variant:"secondary",onClick:r,children:i.cancel}),
4
4
  /* @__PURE__ */u(f,{variant:"ghost-danger",onClick:n,children:i.discard}),
5
- /* @__PURE__ */u(f,{variant:"primary",loading:a,onClick:()=>{C()},children:i.save})]}),children:i.body})}function y({target:r,addressing:n,onHostMessage:e,children:a}){/* @__PURE__ */
5
+ /* @__PURE__ */u(f,{variant:"primary",loading:a,onClick:()=>{k()},children:i.save})]}),children:i.body})}function y({target:r,addressing:n,onHostMessage:e,children:a}){/* @__PURE__ */
6
6
  return u(i,{target:r,addressing:n,onHostMessage:e,children:a})}var N=(r,n)=>/* @__PURE__ */p(v,{children:[r,n]});function H({config:r,parts:n,wrap:e=N}){const{data:i,error:d,redirecting:l,ready:m,readOnly:g,onChange:h,pendingNav:f,cancelPendingNav:p,discardAndNavigate:v,saveAndNavigate:y}=a(),H=t(()=>s(!g),[g]),Z=c("screen",o);return l?/* @__PURE__ */u("div",{className:"sf-msg",children:Z.loading}):d?/* @__PURE__ */u("div",{className:"sf-msg sf-msg--error",children:d}):m?i?e(
7
- /* @__PURE__ */u(C,{config:r,data:i,onChange:h,permissions:H,parts:n,children:/* @__PURE__ */u(k,{})}),f&&/* @__PURE__ */u(j,{onCancel:p,onDiscard:v,onSave:y})):/* @__PURE__ */u("div",{className:"sf-msg",children:Z.loading}):/* @__PURE__ */u("div",{className:"sf-msg",children:Z.waitingForAuthorization})}export{H as DocumentScreen,y as ScreenMount};
7
+ /* @__PURE__ */u(k,{config:r,data:i,onChange:h,permissions:H,parts:n,children:/* @__PURE__ */u(C,{})}),f&&/* @__PURE__ */u(j,{onCancel:p,onDiscard:v,onSave:y})):/* @__PURE__ */u("div",{className:"sf-msg",children:Z.loading}):/* @__PURE__ */u("div",{className:"sf-msg",children:Z.waitingForAuthorization})}export{H as DocumentScreen,y as ScreenMount};
@@ -1,2 +1,2 @@
1
- import{ScreenPartsProvider as t}from"./chunk-CWTAS5R6.js";import{useEaselHost as r}from"./chunk-U3JP4VGF.js";import{createEasel as e,EaselProvider as n}from"./chunk-K5744MTM.js";import{useState as o,useEffect as s}from"react";import{jsx as i}from"react/jsx-runtime";function a({config:a,data:c,onChange:m,permissions:p,parts:f,children:u}){const[h]=o(()=>e({config:a,data:c,permissions:p}));s(()=>{h.setConfig(a)},[h,a]),s(()=>{if(!m)return;let t=h.getState().appState.data;return h.subscribe(()=>{const r=h.getState().appState.data;r!==t&&(t=r,m(r))})},[h,m]),s(()=>{p&&h.setPermissions(p)},[h,p]);const d=r();/* @__PURE__ */
1
+ import{ScreenPartsProvider as t}from"./chunk-FJRAYUCX.js";import{useEaselHost as r}from"./chunk-U3JP4VGF.js";import{createEasel as e,EaselProvider as n}from"./chunk-K5744MTM.js";import{useState as o,useEffect as s}from"react";import{jsx as i}from"react/jsx-runtime";function a({config:a,data:c,onChange:m,permissions:p,parts:f,children:u}){const[h]=o(()=>e({config:a,data:c,permissions:p}));s(()=>{h.setConfig(a)},[h,a]),s(()=>{if(!m)return;let t=h.getState().appState.data;return h.subscribe(()=>{const r=h.getState().appState.data;r!==t&&(t=r,m(r))})},[h,m]),s(()=>{p&&h.setPermissions(p)},[h,p]);const d=r();/* @__PURE__ */
2
2
  return i(n,{easel:h,hotkeys:d.ownsDocument,children:/* @__PURE__ */i(t,{parts:f,children:u})})}export{a as ScreenStoreProvider};
@@ -1,5 +1,5 @@
1
- import{slotFieldsOf as n}from"./chunk-PLVEGYK6.js";import{usePickFollowsSelection as e}from"./chunk-R6WTQWAC.js";import{EaselCanvas as t,useSelectedFields as r}from"./chunk-K5744MTM.js";import{Inspector as i}from"./chunk-UCLVWF5E.js";import{createContext as o,useContext as u}from"react";import{DesktopIcon as l}from"efficient-shell/icons/efficient";import{jsx as s}from"react/jsx-runtime";var c={kind:"puck"};function f(n,e){const t=n,r=e,i=Object.keys(t);return i.length===Object.keys(r).length&&i.every(n=>Object.is(t[n],r[n]))}function a(n){const e=n;return"string"==typeof e.nodeId&&"string"==typeof e.slot}function d(e,t,r){const i=e.slotsOf?.(r);return i||n(t,r.type).map(n=>({slot:n,label:n,rung:!1}))}function p(n,e){return n.isFirst?n.isFirst(e):e.type===n.first}function m(n,e){return n.isLast?n.isLast(e):e.type===n.last}var k={},h={},v=()=>k,g=()=>"",y=()=>null,b=()=>{},L={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},O={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},j={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */s(l,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},w={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},C={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function S(){/* @__PURE__ */
1
+ import{slotFieldsOf as n}from"./chunk-PLVEGYK6.js";import{usePickFollowsSelection as e}from"./chunk-R6WTQWAC.js";import{EaselCanvas as t,useSelectedFields as r}from"./chunk-K5744MTM.js";import{Inspector as i}from"./chunk-PEDDDWSG.js";import{createContext as o,useContext as u}from"react";import{DesktopIcon as l}from"efficient-shell/icons/efficient";import{jsx as s}from"react/jsx-runtime";var c={kind:"puck"};function f(n,e){const t=n,r=e,i=Object.keys(t);return i.length===Object.keys(r).length&&i.every(n=>Object.is(t[n],r[n]))}function a(n){const e=n;return"string"==typeof e.nodeId&&"string"==typeof e.slot}function d(e,t,r){const i=e.slotsOf?.(r);return i||n(t,r.type).map(n=>({slot:n,label:n,rung:!1}))}function p(n,e){return n.isFirst?n.isFirst(e):e.type===n.first}function m(n,e){return n.isLast?n.isLast(e):e.type===n.last}var k={},h={},v=()=>k,g=()=>"",y=()=>null,b=()=>{},O={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},j={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},w={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */s(l,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},D={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},L={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function S(){/* @__PURE__ */
2
2
  return s(t,{height:"fill"})}function P(){const{id:n,fields:e,values:t,readOnly:o,onChange:u}=r();/* @__PURE__ */
3
- return s("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */s(i,{fields:e,values:t,onChange:u,readOnly:o,idPrefix:n})})}var D=o({});function G({parts:n,children:e}){/* @__PURE__ */
4
- return s(D.Provider,{value:n,children:e})}function N(){return u(D)}function T(){return(N().useOwnerName??g)()}function x(){return(N().useDocumentLabel??y)()}function B(n,e,t,r){return(N().useBridges??v)(n,e,t,r)}function F(n){return(N().useStandaloneBridges??v)(n)}function I(n,e){(N().useDocumentPass??b)(n,e)}function A(){return N().blockRules??L}function K(){return N().blockLook??O}function R(){return N().devices??j}function V(){return N().leftView??w}function W(){return N().pinned??C}function E(){return N().saveSwitch??!0}function M(n){e(!0===N().pickFollowsSelection,n)}function H(){return N().add??h}function Q(){return N().storageNamespace||void 0}function U(){return N().styleClipboard??null}function Y(){return N().nodeKeys??!0}function Z(){return N().notify??null}function q(){return N().Canvas??S}function z(){return N().CanvasHead??null}function J(){return N().canvasDrag??null}var X=o(null);function $({target:n,children:e}){/* @__PURE__ */
5
- return s(X.Provider,{value:n,children:e})}function _(){return u(X)}function nn(){return N().Inspector??P}export{c as SELECTION_MODE,$ as ScreenCanvasTargetProvider,G as ScreenPartsProvider,p as isPinnedFirst,m as isPinnedLast,a as isSlotMode,f as sameInspectorMode,d as screenSlotsOf,H as useScreenAdd,K as useScreenBlockLook,A as useScreenBlockRules,B as useScreenBridges,J as useScreenCanvasDrag,q as useScreenCanvasFrame,z as useScreenCanvasHead,_ as useScreenCanvasTarget,R as useScreenDevices,x as useScreenDocumentLabel,I as useScreenDocumentPass,nn as useScreenInspectorPanel,V as useScreenLeftView,Y as useScreenNodeKeys,Z as useScreenNotify,T as useScreenOwnerName,N as useScreenParts,M as useScreenPickFollowsSelection,W as useScreenPinned,E as useScreenSaveSwitch,Q as useScreenStorageNamespace,U as useScreenStyleClipboard,F as useStandaloneScreenBridges};
3
+ return s("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */s(i,{fields:e,values:t,onChange:u,readOnly:o,idPrefix:n})})}var C=o({});function G({parts:n,children:e}){/* @__PURE__ */
4
+ return s(C.Provider,{value:n,children:e})}function N(){return u(C)}function T(){return(N().useOwnerName??g)()}function x(){return(N().useDocumentLabel??y)()}function B(n,e,t,r){return(N().useBridges??v)(n,e,t,r)}function I(n){return(N().useStandaloneBridges??v)(n)}function A(n,e){(N().useDocumentPass??b)(n,e)}function F(){return N().blockRules??O}function K(){return N().blockLook??j}function R(){return N().devices??w}function W(){return N().leftView??D}function E(){return N().pinned??L}function M(){return N().saveSwitch??!0}function V(n){e(!0===N().pickFollowsSelection,n)}function H(){return N().add??h}function Q(){return N().storageNamespace||void 0}function Y(){return N().styleClipboard??null}function Z(){return N().nodeKeys??!0}function q(){return N().notify??null}function z(){return N().Canvas??S}function J(){return N().CanvasHead??null}function U(){return N().canvasDrag??null}var X=o(null);function $({target:n,children:e}){/* @__PURE__ */
5
+ return s(X.Provider,{value:n,children:e})}function _(){return u(X)}function nn(){return N().Inspector??P}export{c as SELECTION_MODE,$ as ScreenCanvasTargetProvider,G as ScreenPartsProvider,p as isPinnedFirst,m as isPinnedLast,a as isSlotMode,f as sameInspectorMode,d as screenSlotsOf,H as useScreenAdd,K as useScreenBlockLook,F as useScreenBlockRules,B as useScreenBridges,U as useScreenCanvasDrag,z as useScreenCanvasFrame,J as useScreenCanvasHead,_ as useScreenCanvasTarget,R as useScreenDevices,x as useScreenDocumentLabel,A as useScreenDocumentPass,nn as useScreenInspectorPanel,W as useScreenLeftView,Z as useScreenNodeKeys,q as useScreenNotify,T as useScreenOwnerName,N as useScreenParts,V as useScreenPickFollowsSelection,E as useScreenPinned,M as useScreenSaveSwitch,Q as useScreenStorageNamespace,Y as useScreenStyleClipboard,I as useStandaloneScreenBridges};
@@ -1 +1 @@
1
- import{DEFAULT_TEXT_STYLES_WORDS as o}from"./chunk-M6F6LS3H.js";import{DEFAULT_PICK_WORDS as r}from"./chunk-ZAOM6PFH.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as t}from"./chunk-6WY6ZXJG.js";import{DEFAULT_SCREEN_WORDS as m}from"./chunk-JTUUIVBZ.js";import{DEFAULT_CANVAS_WORDS as n}from"./chunk-TBY3DFKS.js";import{DEFAULT_TREE_WORDS as c}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as s}from"./chunk-KFV7N2DJ.js";import{DEFAULT_NODE_MENU_WORDS as f}from"./chunk-WK3AFPXY.js";import{DEFAULT_SAVE_WORDS as p}from"./chunk-H6DDIBQ4.js";import{DEFAULT_CHROME_WORDS as e,DEFAULT_NOTICE_WORDS as i}from"./chunk-Y2G7CU6A.js";import{DEFAULT_LOCK_WORDS as u}from"./chunk-RE4LP46F.js";import{DEFAULT_RAIL_WORDS as k}from"./chunk-2OAZYSWJ.js";import{DEFAULT_COPY_WORDS as j}from"./chunk-AUT242JK.js";import{DEFAULT_FIELDS_WORDS as h}from"./chunk-FFYXVAAL.js";import{DEFAULT_DRAG_WORDS as l}from"./chunk-O2NLQBFX.js";var F={notice:i,lock:u,save:p,chrome:e,rail:k,tree:c,panel:s,fields:h,pick:r,drag:l,menu:f,styleClipboard:t,copy:j,canvas:n,textStyles:o,screen:m},a=o=>"object"==typeof o&&null!==o;function Y(o,r){const t={};for(const m of Object.keys(o)){const n=o[m],c=r[m];null==c?t[m]=n:a(n)?t[m]=a(c)?Y(n,c):n:t[m]=typeof c==typeof n?c:n}return t}function y(o,r){return r?Y(o,r):o}export{F as DEFAULT_EASEL_STRINGS,y as mergeEaselStrings};
1
+ import{DEFAULT_TEXT_STYLES_WORDS as o}from"./chunk-M6F6LS3H.js";import{DEFAULT_PICK_WORDS as r}from"./chunk-ZAOM6PFH.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as t}from"./chunk-6WY6ZXJG.js";import{DEFAULT_SCREEN_WORDS as m}from"./chunk-JTUUIVBZ.js";import{DEFAULT_CANVAS_WORDS as n}from"./chunk-TBY3DFKS.js";import{DEFAULT_TREE_WORDS as c}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as s}from"./chunk-KFV7N2DJ.js";import{DEFAULT_NODE_MENU_WORDS as f}from"./chunk-WK3AFPXY.js";import{DEFAULT_SAVE_WORDS as p}from"./chunk-H6DDIBQ4.js";import{DEFAULT_CHROME_WORDS as e,DEFAULT_NOTICE_WORDS as i}from"./chunk-Z6PVRXVY.js";import{DEFAULT_LOCK_WORDS as u}from"./chunk-RE4LP46F.js";import{DEFAULT_RAIL_WORDS as k}from"./chunk-2OAZYSWJ.js";import{DEFAULT_COPY_WORDS as j}from"./chunk-GMXWP5XP.js";import{DEFAULT_FIELDS_WORDS as h}from"./chunk-FFYXVAAL.js";import{DEFAULT_DRAG_WORDS as l}from"./chunk-O2NLQBFX.js";var F={notice:i,lock:u,save:p,chrome:e,rail:k,tree:c,panel:s,fields:h,pick:r,drag:l,menu:f,styleClipboard:t,copy:j,canvas:n,textStyles:o,screen:m},a=o=>"object"==typeof o&&null!==o;function Y(o,r){const t={};for(const m of Object.keys(o)){const n=o[m],c=r[m];null==c?t[m]=n:a(n)?t[m]=a(c)?Y(n,c):n:t[m]=typeof c==typeof n?c:n}return t}function y(o,r){return r?Y(o,r):o}export{F as DEFAULT_EASEL_STRINGS,y as mergeEaselStrings};
@@ -1 +1 @@
1
- import{MARKUP_TOOLS as e,MARK_PLACEHOLDERS as t}from"./chunk-546BBOPE.js";var r={formatting:"Formatting",alignment:"Alignment",align:{left:"Left",center:"Center",right:"Right",justify:"Justify"},marks:{...Object.fromEntries(e.map(e=>[e.style,{name:e.name??e.title,title:e.title}])),underline:{name:"Underline",title:"Underline · [words]{underline}"},sup:{name:"Superscript",title:"Superscript · [words]{sup}"},sub:{name:"Subscript",title:"Subscript · [words]{sub}"}},placeholders:t,showMarks:"Show marks",clearStyle:"Clear style",clearStyleEmpty:"Select words first",colors:{title:"Color",theme:"Theme colors",remove:"Remove",any:"Any color",square:"Saturation and brightness",hue:"Hue",hex:"Hex color"},cells:{fontSize:"Font size",lineHeight:"Line spacing",letterSpacing:"Letter spacing",paragraphSpacing:"Paragraph spacing",tip:({name:e,step:t,unit:r})=>`${e} · step ${t} ${r} · Shift ×10`}};export{r as DEFAULT_COPY_WORDS};
1
+ import{MARKUP_TOOLS as e,MARK_PLACEHOLDERS as t}from"./chunk-546BBOPE.js";var r={formatting:"Formatting",alignment:"Alignment",align:{left:"Left",center:"Center",right:"Right",justify:"Justify"},marks:{...Object.fromEntries(e.map(e=>[e.style,{name:e.name??e.title,title:e.title}])),underline:{name:"Underline",title:"Underline · [words]{underline}"},sup:{name:"Superscript",title:"Superscript · [words]{sup}"},sub:{name:"Subscript",title:"Subscript · [words]{sub}"}},placeholders:t,showMarks:"Show marks",clearStyle:"Clear changes",clearStyleEmpty:"Select words first",colors:{title:"Color",theme:"Theme colors",remove:"Remove",any:"Any color",square:"Saturation and brightness",hue:"Hue",hex:"Hex color"},cells:{fontSize:"Font size",lineHeight:"Line spacing",letterSpacing:"Letter spacing",paragraphSpacing:"Paragraph spacing",tip:({name:e,step:t,unit:r})=>`${e} · step ${t} ${r} · Shift ×10`}};export{r as DEFAULT_COPY_WORDS};
@@ -1,23 +1,23 @@
1
- import{DEFAULT_NOTICE_WORDS as e,DEFAULT_CHROME_WORDS as n}from"./chunk-Y2G7CU6A.js";import{holderOf as i,describeAge as a,nameOrSomeone as t}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as s}from"./chunk-RE4LP46F.js";import{EaselRail as l}from"./chunk-MJM6SFD3.js";import{DEFAULT_RAIL_WORDS as r}from"./chunk-2OAZYSWJ.js";import{useWords as o}from"./chunk-MFIRYGHW.js";import{jsx as c,jsxs as d,Fragment as h}from"react/jsx-runtime";import{Tooltip as u,IconButton as m,Segmented as p,Switch as v,SpinnerRing as f,ResizeHandle as k,Button as b,Banner as g}from"efficient-shell/ui";import{useState as y,useEffect as N}from"react";import{LockIcon as w,CloudPauseIcon as C,CloudSlashIcon as O,CloudAlertIcon as x,CloudArrowUpIcon as z,CloudCheckIcon as R,PanelLeftIcon as B,PanelRightIcon as L,MediaIcon as $,ImageIcon as W}from"efficient-shell/icons/efficient";function j({children:e}){/* @__PURE__ */
2
- return c("div",{className:"es-topbar",children:e})}function M({kind:e,style:n,children:i}){/* @__PURE__ */
3
- return c("div",{className:e?`es-cluster es-cluster--${e}`:"es-cluster",style:n,children:i})}function S(){/* @__PURE__ */
1
+ import{DEFAULT_NOTICE_WORDS as e,DEFAULT_CHROME_WORDS as n}from"./chunk-Z6PVRXVY.js";import{holderOf as i,describeAge as a,nameOrSomeone as t}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as s}from"./chunk-RE4LP46F.js";import{EaselRail as l}from"./chunk-MJM6SFD3.js";import{DEFAULT_RAIL_WORDS as r}from"./chunk-2OAZYSWJ.js";import{useWords as o}from"./chunk-MFIRYGHW.js";import{jsx as c,jsxs as d,Fragment as u}from"react/jsx-runtime";import{Tooltip as h,IconButton as m,Segmented as p,Switch as v,SpinnerRing as f,ResizeHandle as k,Button as b,Banner as g}from"efficient-shell/ui";import{useState as y,useEffect as N}from"react";import{LockIcon as w,CloudPauseIcon as O,CloudSlashIcon as C,CloudAlertIcon as x,CloudArrowUpIcon as z,CloudCheckIcon as B,PanelLeftIcon as R,PanelRightIcon as L,MediaIcon as $,ImageIcon as S}from"efficient-shell/icons/efficient";function W({children:e}){/* @__PURE__ */
2
+ return c("div",{className:"es-topbar",children:e})}function j({kind:e,style:n,children:i}){/* @__PURE__ */
3
+ return c("div",{className:e?`es-cluster es-cluster--${e}`:"es-cluster",style:n,children:i})}function M(){/* @__PURE__ */
4
4
  return c("div",{className:"es-divider-v","aria-hidden":"true"})}function P({items:e,ariaLabel:n,onWords:i}){const a=o("rail",r);/* @__PURE__ */
5
5
  return c("div",{className:"es-cluster es-cluster--rail es-rail-fit",children:/* @__PURE__ */c(l,{items:e,ariaLabel:n??a.label,orientation:"row",onLabelsShown:i})})}function Y({label:e,tip:n,onClick:i,disabled:a,state:t,buttonRef:s,children:l}){/* @__PURE__ */
6
- return c(u,{content:n??e,side:"bottom",children:/* @__PURE__ */c(m,{ref:s,"aria-label":e,"aria-pressed":t?"active"===t:void 0,className:"es-iconbtn",disabled:a,onClick:i,children:l})})}function T({devices:e,value:i,onChange:a,ariaLabel:t}){const s=o("chrome",n);/* @__PURE__ */
7
- return c(p,{className:"es-devseg",size:"sm",label:t??s.device,value:i,onChange:e=>{e!==i&&a(e)},options:e.map(e=>({value:e.id,icon:/* @__PURE__ */c(u,{content:e.label,side:"bottom",children:/* @__PURE__ */c("span",{className:"es-devseg-glyph","aria-hidden":"true",children:e.icon})}),label:/* @__PURE__ */c("span",{className:"es-vh",children:e.label})}))})}var F={idle:"is-quiet",saved:"is-quiet is-saved",saving:"is-saving",error:"is-error",off:"is-off","off-unsaved":"is-off is-unsaved"};function H({tone:e,label:n,counting:i,waitMs:a,ringRef:t,role:s}){/* @__PURE__ */
8
- return d("span",{className:`es-savestate ${F[e]}`,role:s,"aria-live":"polite",children:[/* @__PURE__ */c("span",i?{ref:t,className:"es-savestate-ring is-counting",style:void 0!==a?{"--es-savewait":`${a}ms`}:void 0,"aria-hidden":"true"}:{className:"es-savestate-dot","aria-hidden":"true"}),n]})}function A({pressed:e,title:n,onToggle:i,children:a}){/* @__PURE__ */
9
- return c("span",{className:"es-savestate-toggle",children:/* @__PURE__ */c(u,{content:n,side:"bottom",children:/* @__PURE__ */c(v,{size:"sm",checked:!e,"aria-label":n,label:a,onChange:()=>i()})})})}var I={saved:{glyph:()=>/* @__PURE__ */c(R,{}),tone:"muted"},saving:{glyph:()=>/* @__PURE__ */c(f,{className:"",ink:"",style:{width:20,height:20}}),tone:"muted"},pending:{glyph:()=>/* @__PURE__ */c(z,{}),tone:"muted"},failed:{glyph:()=>/* @__PURE__ */c(x,{}),tone:"danger"},offline:{glyph:()=>/* @__PURE__ */c(O,{}),tone:"warning"},paused:{glyph:()=>/* @__PURE__ */c(C,{}),tone:"warning"},locked:{glyph:()=>/* @__PURE__ */c(w,{}),tone:"warning"}},q=e=>I[e].tone;function D({state:e,label:n}){const i=I[e],[a,t]=y(n);return N(()=>t(n),[e]),/* @__PURE__ */d("span",{className:"es-saveicon-wrap",children:[
10
- /* @__PURE__ */c(u,{content:n,side:"bottom",describe:!1,children:/* @__PURE__ */c("span",{className:"es-saveicon",role:"img","aria-label":n,tabIndex:0,"data-save-state":e,"data-tone":i.tone,children:i.glyph()})}),
11
- /* @__PURE__ */c("span",{className:"es-vh",role:"status","aria-live":"polite",children:a})]})}function G({side:e,width:i,min:a,max:t,defaultWidth:s,label:l,onResize:r}){const d=o("chrome",n);/* @__PURE__ */
12
- return c(k,{side:e,width:i,min:a,max:t,defaultWidth:s,label:l,hint:d.resize,onResize:e=>r(e),className:`es-resizer es-resizer--${e}`})}function J({icon:e,name:n,kind:i,actions:a}){/* @__PURE__ */
6
+ return c(h,{content:n??e,side:"bottom",children:/* @__PURE__ */c(m,{ref:s,"aria-label":e,"aria-pressed":t?"active"===t:void 0,className:"es-iconbtn",disabled:a,onClick:i,children:l})})}function T({devices:e,value:i,onChange:a,ariaLabel:t}){const s=o("chrome",n);/* @__PURE__ */
7
+ return c(p,{className:"es-devseg",size:"sm",label:t??s.device,value:i,onChange:e=>{e!==i&&a(e)},options:e.map(e=>({value:e.id,icon:/* @__PURE__ */c(h,{content:e.label,side:"bottom",children:/* @__PURE__ */c("span",{className:"es-devseg-glyph","aria-hidden":"true",children:e.icon})}),label:/* @__PURE__ */c("span",{className:"es-vh",children:e.label})}))})}var F={idle:"is-quiet",saved:"is-quiet is-saved",saving:"is-saving",error:"is-error",off:"is-off","off-unsaved":"is-off is-unsaved"};function H({tone:e,label:n,counting:i,waitMs:a,ringRef:t,role:s}){/* @__PURE__ */
8
+ return d("span",{className:`es-savestate ${F[e]}`,role:s,"aria-live":"polite",children:[/* @__PURE__ */c("span",i?{ref:t,className:"es-savestate-ring is-counting",style:void 0!==a?{"--es-savewait":`${a}ms`}:void 0,"aria-hidden":"true"}:{className:"es-savestate-dot","aria-hidden":"true"}),n]})}function V({pressed:e,title:n,onToggle:i,children:a}){/* @__PURE__ */
9
+ return c("span",{className:"es-savestate-toggle",children:/* @__PURE__ */c(h,{content:n,side:"bottom",children:/* @__PURE__ */c(v,{size:"sm",checked:!e,"aria-label":n,label:a,onChange:()=>i()})})})}var I={saved:{glyph:()=>/* @__PURE__ */c(B,{}),tone:"muted"},saving:{glyph:()=>/* @__PURE__ */c(f,{className:"",ink:"",style:{width:20,height:20}}),tone:"muted"},pending:{glyph:()=>/* @__PURE__ */c(z,{}),tone:"muted"},failed:{glyph:()=>/* @__PURE__ */c(x,{}),tone:"danger"},offline:{glyph:()=>/* @__PURE__ */c(C,{}),tone:"warning"},paused:{glyph:()=>/* @__PURE__ */c(O,{}),tone:"warning"},locked:{glyph:()=>/* @__PURE__ */c(w,{}),tone:"warning"}},Z=e=>I[e].tone;function q({state:e,label:n}){const i=I[e],[a,t]=y(n);return N(()=>t(n),[e]),/* @__PURE__ */d("span",{className:"es-saveicon-wrap",children:[
10
+ /* @__PURE__ */c(h,{content:n,side:"bottom",describe:!1,children:/* @__PURE__ */c("span",{className:"es-saveicon",role:"img","aria-label":n,tabIndex:0,"data-save-state":e,"data-tone":i.tone,children:i.glyph()})}),
11
+ /* @__PURE__ */c("span",{className:"es-vh",role:"status","aria-live":"polite",children:a})]})}function A({side:e,width:i,min:a,max:t,defaultWidth:s,label:l,onResize:r}){const d=o("chrome",n);/* @__PURE__ */
12
+ return c(k,{side:e,width:i,min:a,max:t,defaultWidth:s,label:l,hint:d.resize,onResize:e=>r(e),className:`es-resizer es-resizer--${e}`})}function D({icon:e,name:n,kind:i,actions:a}){/* @__PURE__ */
13
13
  return d("div",{className:"es-insp-head",children:[
14
14
  /* @__PURE__ */c("span",{className:"es-insp-chip","aria-hidden":"true",children:e}),
15
15
  /* @__PURE__ */d("div",{className:"es-insp-titles",children:[
16
- /* @__PURE__ */c(u,{content:n,describe:!1,side:"bottom",className:"es-insp-name-tip",children:/* @__PURE__ */c("h2",{className:"es-insp-name",children:n})}),
17
- /* @__PURE__ */c("div",{className:"es-insp-kind",children:i})]}),a?/* @__PURE__ */c("div",{className:"es-insp-actions",children:a}):null]})}function K({label:e,title:n,hasPopup:i,onClick:a,disabled:t,danger:s,expanded:l,buttonRef:r,children:o}){/* @__PURE__ */
18
- return c(u,{content:n??e,side:"bottom",children:/* @__PURE__ */c(m,{ref:r,variant:s?"ghost-danger":"ghost",className:"es-insp-iconbtn","aria-label":e,"aria-haspopup":i,"aria-expanded":l,disabled:t,onClick:a,children:o})})}function V({name:e,onSelect:i,label:a,inline:t}){const s=o("chrome",n),l=a??s.upLevel,r=/* @__PURE__ */c(u,{content:l,side:"bottom",children:/* @__PURE__ */c(b,{variant:"link",size:"sm",className:"es-insp-up-btn","aria-label":s.upLevelTo({label:l,name:e}),leftIcon:/* @__PURE__ */c("span",{className:"es-insp-up-arrow","aria-hidden":"true",children:"←"}),onClick:i,children:/* @__PURE__ */c("span",{className:"es-insp-up-name",children:e})})});return t?r:/* @__PURE__ */c("div",{className:"es-insp-up",children:r})}function Z({context:e,pick:i,onCancel:a,onHide:t,side:s="left"}){const l=o("chrome",n),r=t?/* @__PURE__ */c(K,{label:l.hidePanelLabel({side:s}),title:l.hidePanel,onClick:t,children:/* @__PURE__ */c("left"===s?B:L,{size:16})}):null;if(!i)/* @__PURE__ */
19
- return c(J,{icon:/* @__PURE__ */c($,{}),name:l.mediaLibrary,kind:e,actions:r??void 0});const m=l.mediaKinds[i.kind];/* @__PURE__ */
20
- return c(J,{icon:/* @__PURE__ */c(W,{size:15}),name:l.mediaChoose({kind:m}),kind:i.field?l.mediaFor({field:i.field}):e,actions:/* @__PURE__ */d(h,{children:[
21
- /* @__PURE__ */c(u,{content:l.mediaKeep({kind:m}),side:"bottom",children:/* @__PURE__ */c(b,{variant:"secondary",size:"sm",className:"es-insp-textbtn",onClick:a,children:l.mediaCancel})}),r?/* @__PURE__ */d(h,{children:[
22
- /* @__PURE__ */c("span",{className:"es-insp-divider","aria-hidden":"true"}),r]}):null]})})}function E(e){return/svg/i.test(e)?"svg":e.startsWith("video")?"video":"image"}var U={notice:e,lock:s};function Q(e,n,s,l=U){const r=l.notice,o=i(e),c={kind:"reload",label:r.reload};if(n){const e=a(n.secondsAgo,l.lock);return{tone:"warning",urgent:!0,lead:n.savedByYou?r.savedByYou({noun:s,when:e}):r.savedByOther({name:t(n.savedBy,l.lock),noun:s,when:e}),body:r.conflictBody,actions:o?[c,{kind:"take-over",label:r.takeOver,title:r.takeOverWhileDeciding}]:[c]}}if(!o)return null;const d=t(o.name,l.lock),h=a(o.secondsSinceSeen,l.lock);switch(e.kind){case"takenover":return{tone:"warning",urgent:!0,lead:r.tookOver({name:d,noun:s,when:a(o.secondsSinceHeld,l.lock)}),body:r.tookOverBody,actions:[{kind:"take-back",label:r.takeBack},c]};case"readonly":return{tone:"neutral",urgent:!1,lead:r.viewingOnly,body:r.viewingOnlyBody({name:d,noun:s,seen:h}),actions:[{kind:"take-over",label:r.takeOver}]};default:return{tone:"warning",urgent:!1,lead:r.editing({name:d,noun:s}),body:r.editingBody({seen:h}),actions:[{kind:"view-read-only",label:r.viewReadOnly},{kind:"take-over",label:r.takeOver,title:r.takeOverTold}]}}}function X({access:n,conflict:i,noun:a,onTakeOver:t,onViewReadOnly:l,onReload:r}){const d=Q(n,i,a,{notice:o("notice",e),lock:o("lock",s)});if(!d)return null;const h={reload:r,"take-over":t,"take-back":t,"view-read-only":l},m=d.actions.map(e=>e.title?/* @__PURE__ */c(u,{content:e.title,side:"bottom",children:/* @__PURE__ */c(b,{variant:"secondary",size:"sm",onClick:h[e.kind],children:e.label})},e.kind):/* @__PURE__ */c(b,{variant:"secondary",size:"sm",onClick:h[e.kind],children:e.label},e.kind));/* @__PURE__ */
23
- return c("div",{className:`es-notice is-${d.tone}`,role:d.urgent?"alert":"status",children:/* @__PURE__ */c(g,{tone:"warning"===d.tone?"warning":"info",title:d.lead,action:/* @__PURE__ */c("span",{className:"es-notice-actions",children:m}),children:d.body})})}var _={left:288,right:320},ee=220,ne=560;function ie(e){return Math.min(560,Math.max(220,Math.round(e)))}function ae(e){return{"--es-left-w":`${e.left}px`,"--es-right-w":`${e.right}px`}}function te(e,n){e.style.setProperty("--es-left-w",`${n.left}px`),e.style.setProperty("--es-right-w",`${n.right}px`)}export{_ as DEFAULT_PANEL_W,T as DeviceSwitch,Y as EaselIconButton,j as EaselTopBar,X as EditNotice,J as InspectorHead,K as InspectorIconButton,V as InspectorUpLevel,ne as MAX_PANEL_W,ee as MIN_PANEL_W,Z as MediaPanelHead,G as PanelResizeHandle,D as SaveIcon,H as SaveState,A as SaveStateToggle,M as TopBarCluster,S as TopBarDivider,P as TopBarRail,ie as clampPanelWidth,Q as editNotice,E as mediaPickKind,ae as panelWidthVars,q as saveIconTone,te as setPanelWidthVars};
16
+ /* @__PURE__ */c(h,{content:n,describe:!1,side:"bottom",className:"es-insp-name-tip",children:/* @__PURE__ */c("h2",{className:"es-insp-name",children:n})}),
17
+ /* @__PURE__ */c("div",{className:"es-insp-kind",children:i})]}),a?/* @__PURE__ */c("div",{className:"es-insp-actions",children:a}):null]})}function J({label:e,title:n,hasPopup:i,onClick:a,disabled:t,danger:s,expanded:l,buttonRef:r,children:o}){/* @__PURE__ */
18
+ return c(h,{content:n??e,side:"bottom",children:/* @__PURE__ */c(m,{ref:r,variant:s?"ghost-danger":"ghost",className:"es-insp-iconbtn","aria-label":e,"aria-haspopup":i,"aria-expanded":l,disabled:t,onClick:a,children:o})})}function K({name:e,onSelect:i,label:a,inline:t}){const s=o("chrome",n),l=a??s.upLevel,r=/* @__PURE__ */c(h,{content:l,side:"bottom",children:/* @__PURE__ */c(b,{variant:"link",size:"sm",className:"es-insp-up-btn","aria-label":s.upLevelTo({label:l,name:e}),leftIcon:/* @__PURE__ */c("span",{className:"es-insp-up-arrow","aria-hidden":"true",children:"←"}),onClick:i,children:/* @__PURE__ */c("span",{className:"es-insp-up-name",children:e})})});return t?r:/* @__PURE__ */c("div",{className:"es-insp-up",children:r})}function E({name:e,tier:i,of:a},t){const s={...n,...t};return{name:e,kind:"section"===i?s.tierSection:"block"===i?s.tierBlock:a?s.partOf({name:a}):s.tierBlock}}function G({context:e,pick:i,onCancel:a,onHide:t,side:s="left"}){const l=o("chrome",n),r=t?/* @__PURE__ */c(J,{label:l.hidePanelLabel({side:s}),title:l.hidePanel,onClick:t,children:/* @__PURE__ */c("left"===s?R:L,{size:16})}):null;if(!i)/* @__PURE__ */
19
+ return c(D,{icon:/* @__PURE__ */c($,{}),name:l.mediaLibrary,kind:e,actions:r??void 0});const m=l.mediaKinds[i.kind];/* @__PURE__ */
20
+ return c(D,{icon:/* @__PURE__ */c(S,{size:15}),name:l.mediaChoose({kind:m}),kind:i.field?l.mediaFor({field:i.field}):e,actions:/* @__PURE__ */d(u,{children:[
21
+ /* @__PURE__ */c(h,{content:l.mediaKeep({kind:m}),side:"bottom",children:/* @__PURE__ */c(b,{variant:"secondary",size:"sm",className:"es-insp-textbtn",onClick:a,children:l.mediaCancel})}),r?/* @__PURE__ */d(u,{children:[
22
+ /* @__PURE__ */c("span",{className:"es-insp-divider","aria-hidden":"true"}),r]}):null]})})}function X(e){return/svg/i.test(e)?"svg":e.startsWith("video")?"video":"image"}var Q={notice:e,lock:s};function U(e,n,s,l=Q){const r=l.notice,o=i(e),c={kind:"reload",label:r.reload};if(n){const e=a(n.secondsAgo,l.lock);return{tone:"warning",urgent:!0,lead:n.savedByYou?r.savedByYou({noun:s,when:e}):r.savedByOther({name:t(n.savedBy,l.lock),noun:s,when:e}),body:r.conflictBody,actions:o?[c,{kind:"take-over",label:r.takeOver,title:r.takeOverWhileDeciding}]:[c]}}if(!o)return null;const d=t(o.name,l.lock),u=a(o.secondsSinceSeen,l.lock);switch(e.kind){case"takenover":return{tone:"warning",urgent:!0,lead:r.tookOver({name:d,noun:s,when:a(o.secondsSinceHeld,l.lock)}),body:r.tookOverBody,actions:[{kind:"take-back",label:r.takeBack},c]};case"readonly":return{tone:"neutral",urgent:!1,lead:r.viewingOnly,body:r.viewingOnlyBody({name:d,noun:s,seen:u}),actions:[{kind:"take-over",label:r.takeOver}]};default:return{tone:"warning",urgent:!1,lead:r.editing({name:d,noun:s}),body:r.editingBody({seen:u}),actions:[{kind:"view-read-only",label:r.viewReadOnly},{kind:"take-over",label:r.takeOver,title:r.takeOverTold}]}}}function _({access:n,conflict:i,noun:a,onTakeOver:t,onViewReadOnly:l,onReload:r}){const d=U(n,i,a,{notice:o("notice",e),lock:o("lock",s)});if(!d)return null;const u={reload:r,"take-over":t,"take-back":t,"view-read-only":l},m=d.actions.map(e=>e.title?/* @__PURE__ */c(h,{content:e.title,side:"bottom",children:/* @__PURE__ */c(b,{variant:"secondary",size:"sm",onClick:u[e.kind],children:e.label})},e.kind):/* @__PURE__ */c(b,{variant:"secondary",size:"sm",onClick:u[e.kind],children:e.label},e.kind));/* @__PURE__ */
23
+ return c("div",{className:`es-notice is-${d.tone}`,role:d.urgent?"alert":"status",children:/* @__PURE__ */c(g,{tone:"warning"===d.tone?"warning":"info",title:d.lead,action:/* @__PURE__ */c("span",{className:"es-notice-actions",children:m}),children:d.body})})}var ee={left:288,right:320},ne=220,ie=560;function ae(e){return Math.min(560,Math.max(220,Math.round(e)))}function te(e){return{"--es-left-w":`${e.left}px`,"--es-right-w":`${e.right}px`}}function se(e,n){e.style.setProperty("--es-left-w",`${n.left}px`),e.style.setProperty("--es-right-w",`${n.right}px`)}export{ee as DEFAULT_PANEL_W,T as DeviceSwitch,Y as EaselIconButton,W as EaselTopBar,_ as EditNotice,D as InspectorHead,J as InspectorIconButton,K as InspectorUpLevel,ie as MAX_PANEL_W,ne as MIN_PANEL_W,G as MediaPanelHead,A as PanelResizeHandle,q as SaveIcon,H as SaveState,V as SaveStateToggle,j as TopBarCluster,M as TopBarDivider,P as TopBarRail,ae as clampPanelWidth,U as editNotice,E as headWords,X as mediaPickKind,te as panelWidthVars,Z as saveIconTone,se as setPanelWidthVars};
@@ -1 +1 @@
1
- import{useScreenBlockRules as e}from"./chunk-CWTAS5R6.js";import{newNodeId as t,ROOT_ZONE as n}from"./chunk-PLVEGYK6.js";import{useEasel as o,useEaselApi as r}from"./chunk-K5744MTM.js";import{useMemo as s}from"react";function i(i={}){const{dispatch:p}=o(e=>e),d=r(),c=!0===i.readOnly,a=e().resolveOnInsert,l=!0===(i.resolveOnInsert??a),m=!0===i.foldIntoHistory;return s(()=>{const e=m?e=>p({...e,recordHistory:!1}):p,o=(n,o,r)=>{const s=t(o);return c||e({type:"insert",componentType:o,destinationZone:n,destinationIndex:r,id:s}),s},r=e=>(l&&!c&&d.resolveNode(e,{trigger:"insert"}),e),s=(t,n,o)=>{c||e({type:"replace",destinationZone:t,destinationIndex:n,data:o})},i=(e,t,n)=>r(o(e,t,n));return{insertComponent:i,insertSection:(e,t)=>i(n,e,t),replaceComponent:s,seedChild:(e,t,n,i)=>{const p=o(e,n,t);s(e,t,{type:n,props:{id:p,...i}}),r(p)},insertNode:(e,t,n)=>{const i=o(e,n.type,t);return s(e,t,{type:n.type,props:{...n.props,id:i}}),r(i)},removeComponent:(t,n)=>{c||e({type:"remove",index:n,zone:t})},reorderComponent:(t,n,o)=>{c||e({type:"reorder",sourceIndex:n,destinationIndex:o,destinationZone:t})},duplicateComponent:(t,n)=>{c||e({type:"duplicate",sourceIndex:n,sourceZone:t})},select:e=>p({type:"setUi",ui:{itemSelector:e}}),setDocument:t=>{c||e({type:"setData",data:t})},commitDocument:(t,n)=>{c||(m?d.batch(()=>{e({type:"setData",data:t}),void 0!==n&&("slot"===n?.kind?d.selectSlot({parentId:n.parentId,slot:n.slot}):d.select(n?n.id:null))}):d.run({data:t,select:n}))}}},[p,c,l,d,m])}export{i as useSectionOps};
1
+ import{useScreenBlockRules as e}from"./chunk-FJRAYUCX.js";import{newNodeId as t,ROOT_ZONE as n}from"./chunk-PLVEGYK6.js";import{useEasel as o,useEaselApi as r}from"./chunk-K5744MTM.js";import{useMemo as s}from"react";function i(i={}){const{dispatch:p}=o(e=>e),d=r(),c=!0===i.readOnly,a=e().resolveOnInsert,l=!0===(i.resolveOnInsert??a),m=!0===i.foldIntoHistory;return s(()=>{const e=m?e=>p({...e,recordHistory:!1}):p,o=(n,o,r)=>{const s=t(o);return c||e({type:"insert",componentType:o,destinationZone:n,destinationIndex:r,id:s}),s},r=e=>(l&&!c&&d.resolveNode(e,{trigger:"insert"}),e),s=(t,n,o)=>{c||e({type:"replace",destinationZone:t,destinationIndex:n,data:o})},i=(e,t,n)=>r(o(e,t,n));return{insertComponent:i,insertSection:(e,t)=>i(n,e,t),replaceComponent:s,seedChild:(e,t,n,i)=>{const p=o(e,n,t);s(e,t,{type:n,props:{id:p,...i}}),r(p)},insertNode:(e,t,n)=>{const i=o(e,n.type,t);return s(e,t,{type:n.type,props:{...n.props,id:i}}),r(i)},removeComponent:(t,n)=>{c||e({type:"remove",index:n,zone:t})},reorderComponent:(t,n,o)=>{c||e({type:"reorder",sourceIndex:n,destinationIndex:o,destinationZone:t})},duplicateComponent:(t,n)=>{c||e({type:"duplicate",sourceIndex:n,sourceZone:t})},select:e=>p({type:"setUi",ui:{itemSelector:e}}),setDocument:t=>{c||e({type:"setData",data:t})},commitDocument:(t,n)=>{c||(m?d.batch(()=>{e({type:"setData",data:t}),void 0!==n&&("slot"===n?.kind?d.selectSlot({parentId:n.parentId,slot:n.slot}):d.select(n?n.id:null))}):d.run({data:t,select:n}))}}},[p,c,l,d,m])}export{i as useSectionOps};
@@ -0,0 +1,5 @@
1
+ import{buildPaletteSections as e,pinnedSection as t,paletteWithoutPinned as o,categoryLabel as n}from"./chunk-PA3PNTVV.js";import{blockTypesIn as i}from"./chunk-5ZBY24K7.js";import{sectionTemplatesOf as s}from"./chunk-BVN33R76.js";import{SidePanelHead as r,PanelModeExit as c}from"./chunk-PPL7GB7D.js";import{useEaselSession as l}from"./chunk-O7Q4DDJT.js";import{blockRuns as a}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as p,useScreenBlockRules as m}from"./chunk-FJRAYUCX.js";import{DEFAULT_SCREEN_WORDS as d}from"./chunk-JTUUIVBZ.js";import{useEasel as f}from"./chunk-K5744MTM.js";import{useWords as u}from"./chunk-MFIRYGHW.js";import{AddPanel as k}from"./chunk-FCLW4LEN.js";import{DEFAULT_DRAG_WORDS as y}from"./chunk-O2NLQBFX.js";import{useState as h,useEffect as b,useMemo as j}from"react";import{AddIcon as g}from"efficient-shell/icons/efficient";import{jsx as B,jsxs as $,Fragment as L}from"react/jsx-runtime";var O=e=>`section:${e}`,v=e=>`block:${e}`,x=e=>`template:${e}`;function A({blocks:A,blocksOnly:F,at:I,sectionAccepts:N,onAdd:V,itemFor:C,session:T,siteWide:D,onClose:H,onHide:P,readOnly:R}){const w=f(e=>e.config),J=p(),{labelAtLevel:M,categoryLabel:Q,firstSection:U,Icon:W,Thumbnail:Y}=J,{blockIsOffered:z}=m(),E=u("screen",d).add,G=u("drag",y).add,K=l(),[S,X]=h([]);b(()=>{let e=!1;const t=e=>z(e,K);return s(K).list().then(o=>{if(e)return;const n=w.components;X(o.filter(e=>e.node?.type&&n[e.node.type]&&i(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[w,K]);const Z=j(()=>e(w,J),[w]),q=e=>({type:O(e.type),label:e.name,cover:/* @__PURE__ */B(Y,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:E.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),_=j(()=>{const e=[];if(A&&A.choices.length>0&&a(A.choices).forEach((t,o)=>{e.push({key:`blocks:${o}`,title:0===o?`${E.inside({name:A.parentName})}${t.group?` · ${t.group}`:""}`:t.group??"",tiles:t.items.map(e=>({type:v(e.type),label:e.label,icon:/* @__PURE__ */B(W,{type:e.type,size:18}),title:E.tile({name:e.label})}))})}),F)return e;const i=e=>!N||N(e),s=t(Z,U);s&&i(s.type)&&e.push({key:"start",title:E.startBlank,tiles:[q(s)]});const r=S.filter(e=>i(e.node.type));r.length>0&&e.push({key:"templates",title:E.templates,tiles:r.map(e=>{return{type:x(e.id),label:e.name,cover:/* @__PURE__ */B(Y,{type:e.node.type}),keywords:[(t=e.node.type,M(t,"section",w.components[t]?.label??t)),e.node.type]};var t})});const c=o(Z,U);for(const t of Object.keys(w.categories??{})){const o=c.filter(e=>e.cat===t&&i(e.type));0!==o.length&&e.push({key:`category:${t}`,title:n(w,t,Q),tiles:o.map(q)})}return e},[A,F,S,Z,w,E,N]),ee=e=>{const t=e.indexOf(":"),o=e.slice(0,t),n=e.slice(t+1);if("section"===o)return{kind:"section",type:n};if("block"===o)return{kind:"block",type:n};if("template"===o){const e=S.find(e=>e.id===n);return e?{kind:"template",template:e}:null}return null};/* @__PURE__ */
2
+ return $(L,{children:[
3
+ /* @__PURE__ */B(r,{icon:/* @__PURE__ */B(g,{size:15}),title:E.title,context:F?E.contextBlocks:E.contextAll,actions:/* @__PURE__ */B(c,{label:E.done,description:E.doneDescription,onClick:H}),onHide:P}),
4
+ /* @__PURE__ */$("div",{className:"sf-addside sf-scroll",children:[
5
+ /* @__PURE__ */B(k,{groups:_,session:T,itemFor:e=>C(ee(e)??{kind:"section",type:e}),onInsert:e=>{const t=ee(e);t&&V(t)},at:I,hint:F?E.hintBlocks:E.hint,searchLabel:F?E.searchBlocks:E.searchSections,readOnly:R,words:G}),D&&!F?D:null]})]})}export{A as AddSidePanel,v as blockKey,O as sectionKey,x as templateKey};
@@ -1 +1 @@
1
- import{useScreenDocument as n}from"./chunk-THZ46DC5.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-JTUUIVBZ.js";import{EditNotice as r}from"./chunk-QVUVDBGA.js";import{useWords as e}from"./chunk-MFIRYGHW.js";import{jsx as i}from"react/jsx-runtime";function t(){const{capabilities:t,access:c,takeOverEditing:a,viewReadOnly:s,saveConflict:m,reloadFromServer:u}=n(),{noun:l}=e("screen",o);return t.hasEditGuard?/* @__PURE__ */i(r,{access:c,conflict:m,noun:l,onTakeOver:a,onViewReadOnly:s,onReload:u}):null}export{t as PageEditGuardNotices};
1
+ import{useScreenDocument as n}from"./chunk-THZ46DC5.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-JTUUIVBZ.js";import{EditNotice as r}from"./chunk-IE55HNMA.js";import{useWords as e}from"./chunk-MFIRYGHW.js";import{jsx as i}from"react/jsx-runtime";function t(){const{capabilities:t,access:c,takeOverEditing:a,viewReadOnly:s,saveConflict:m,reloadFromServer:u}=n(),{noun:l}=e("screen",o);return t.hasEditGuard?/* @__PURE__ */i(r,{access:c,conflict:m,noun:l,onTakeOver:a,onViewReadOnly:s,onReload:u}):null}export{t as PageEditGuardNotices};
@@ -1,21 +1,21 @@
1
- import{TreeSeam as e}from"./chunk-4JSBIW5H.js";import{FieldSelect as n}from"./chunk-OZ72A6MY.js";import{SettingsField as l,SETTINGS_BUCKETS as t,SettingsGroup as a}from"./chunk-GZH4UVDH.js";import{DEFAULT_TREE_WORDS as r}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as o}from"./chunk-KFV7N2DJ.js";import{EaselMenuItems as i}from"./chunk-EA2HTX37.js";import{FieldNumber as s}from"./chunk-66LWADFP.js";import{SettingsSegmented as c}from"./chunk-QLD57GBB.js";import{DEFAULT_FIELDS_WORDS as d}from"./chunk-FFYXVAAL.js";import{useWords as u}from"./chunk-MFIRYGHW.js";import{useTreeDrag as m,gapToMoveIndex as p}from"./chunk-67GNT6PF.js";import{withTip as h}from"./chunk-P2VEMZH5.js";import{Textarea as f,Input as b,SortableList as g,ListRow as v,ContextMenu as y,tabPanelId as k,Tabs as x,tabButtonId as w}from"efficient-shell/ui";export{LinkPicker}from"efficient-shell/ui";import{useRef as N,useState as C,useLayoutEffect as O,useId as $}from"react";import{jsx as j,jsxs as D}from"react/jsx-runtime";import{ChevronIcon as S,LockIcon as I,MoveUpIcon as L,MoveDownIcon as P,DuplicateIcon as F,TrashIcon as A}from"efficient-shell/icons/efficient";function M({id:e,value:n,onChange:l,placeholder:t,multiline:a=!1,rows:r=3,readOnly:o=!1,ariaLabel:i,ariaLabelledBy:s}){const c=n??"";return a?/* @__PURE__ */j(f,{id:e,size:"sm",className:"es-fin",value:c,rows:r,placeholder:t,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>l(e.target.value)}):/* @__PURE__ */j(b,{id:e,size:"sm",className:"es-fin",type:"text",value:c,placeholder:t,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>l(e.target.value)})}function T(e,n,l){const t=e.slice();return t.splice(Math.max(0,Math.min(n,t.length)),0,l),t}function H(e,n,l){const t=e.slice(),[a]=t.splice(n,1);return t.splice(Math.max(0,Math.min(l,t.length)),0,a),t}function z(e,n){return e.filter((e,l)=>l!==n)}function E(e){return null===e||"object"!=typeof e?e:JSON.parse(JSON.stringify(e))}var R='input, textarea, select, button, [contenteditable]:not([contenteditable="false"]), [tabindex]',B={parentId:"list",slot:"items"};function Y({label:n,icon:l,noun:t,items:a,onChange:o,newItem:s,summary:c,itemName:f,thumb:b,min:k=0,max:x,readOnly:w=!1,open:$,onOpen:M,renderItem:Y,renderRow:K,canRemove:V,lockedReason:G,fixed:J=!1,removeOnRow:Z=!0,canDuplicate:W,above:X,head:q=!0}){const Q=u("fields",d).list,U=u("tree",r),_=t??Q.item,ee=!w&&!J&&("number"!=typeof x||a.length<x),ne=a.length<=k,le=e=>!!V&&!V(a[e],e),te=e=>!w&&!J&&Z&&!ne&&!le(e),ae=e=>ee&&(!W||W(a[e],e)),re=(e,n)=>f?f(e,n):Q.itemName({noun:_,n:n+1}),oe=N([]),ie=N(null),[se,ce]=C(null),de=N(null),[ue,me]=C(null),[pe,he]=C("");O(()=>{const e=ie.current;if(!e)return;ie.current=null;const n=oe.current[e.index]?.querySelectorAll(R)[e.nth]??oe.current[e.index];if(n?.focus(),n&&null!==e.start&&"setSelectionRange"in n)try{n.setSelectionRange(e.start,e.end)}catch{}});const fe=(e,n)=>{if(n<0||n>=a.length||n===e)return;const l=oe.current[e],t=l?.ownerDocument.activeElement;if(l&&t&&l.contains(t)){const e=[...l.querySelectorAll(R)].indexOf(t),a=t;ie.current={index:n,nth:e,start:"number"==typeof a.selectionStart?a.selectionStart:null,end:"number"==typeof a.selectionEnd?a.selectionEnd:null}}o(H(a,e,n));const r=function(e,n,l){return null===e?null:e===n?l:n<e&&l>=e?e-1:n>e&&l<=e?e+1:e}($,e,n);r!==$&&M(r),he(Q.moved({n:n+1,total:a.length}))},be=e=>{ee&&(o(T(a,e,s())),K?(ie.current={index:e,nth:0,start:null,end:null},null!==$&&$>=e&&M($+1)):M(e))},ge=e=>{te(e)&&(o(z(a,e)),$===e?M(null):null!==$&&$>e&&M($-1))},ve=m({keyOf:e=>String(e),canDrop:(e,n)=>n.parentId===B.parentId&&n.slot===B.slot,onDrop:(e,n)=>{const l=p({...B,index:e},n);l!==e&&fe(e,l)},onStep:(e,n)=>fe(e,e+n),canStep:(e,n)=>e+n>=0&&e+n<a.length,readOnly:w}),ye=e=>{const n=[];return e>0&&n.push({label:Q.moveUp,icon:/* @__PURE__ */j(L,{size:14}),shortcut:"⌥↑",onClick:()=>fe(e,e-1)}),e<a.length-1&&n.push({label:Q.moveDown,icon:/* @__PURE__ */j(P,{size:14}),shortcut:"⌥↓",onClick:()=>fe(e,e+1)}),ae(e)&&n.push({label:Q.duplicate,icon:/* @__PURE__ */j(F,{size:14}),onClick:()=>(e=>{ae(e)&&(o(T(a,e+1,E(a[e]))),null!==$&&$>e&&M($+1))})(e)}),te(e)&&n.push({label:Q.delete,icon:/* @__PURE__ */j(A,{size:14}),danger:!0,onClick:()=>ge(e)}),n},ke=(e,n,l,t)=>{w||0===ye(e).length||me({index:e,x:n,y:l,owner:t})},xe=e=>n=>{const l=a.slice();l[e]=n,o(l)};/* @__PURE__ */
1
+ import{FieldSelect as e}from"./chunk-OZ72A6MY.js";import{TreeSeam as n}from"./chunk-4JSBIW5H.js";import{SettingsField as l,SETTINGS_BUCKETS as t,SettingsGroup as a}from"./chunk-GZH4UVDH.js";import{DEFAULT_TREE_WORDS as r}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as o}from"./chunk-KFV7N2DJ.js";import{EaselMenuItems as i}from"./chunk-EA2HTX37.js";import{FieldNumber as s}from"./chunk-66LWADFP.js";import{SettingsSegmented as c}from"./chunk-QLD57GBB.js";import{DEFAULT_FIELDS_WORDS as d}from"./chunk-FFYXVAAL.js";import{useWords as u}from"./chunk-MFIRYGHW.js";import{useTreeDrag as m,gapToMoveIndex as p}from"./chunk-67GNT6PF.js";import{withTip as h}from"./chunk-P2VEMZH5.js";import{Textarea as f,Input as b,SortableList as g,ListRow as v,ContextMenu as y,tabPanelId as k,Tabs as x,tabButtonId as w}from"efficient-shell/ui";export{LinkPicker}from"efficient-shell/ui";import{useRef as N,useState as C,useLayoutEffect as O,useId as $}from"react";import{jsx as j,jsxs as D}from"react/jsx-runtime";import{ChevronIcon as S,LockIcon as I,MoveUpIcon as L,MoveDownIcon as P,DuplicateIcon as F,TrashIcon as A}from"efficient-shell/icons/efficient";function M({id:e,value:n,onChange:l,placeholder:t,multiline:a=!1,rows:r=3,readOnly:o=!1,ariaLabel:i,ariaLabelledBy:s}){const c=n??"";return a?/* @__PURE__ */j(f,{id:e,size:"sm",className:"es-fin",value:c,rows:r,placeholder:t,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>l(e.target.value)}):/* @__PURE__ */j(b,{id:e,size:"sm",className:"es-fin",type:"text",value:c,placeholder:t,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>l(e.target.value)})}function T(e,n,l){const t=e.slice();return t.splice(Math.max(0,Math.min(n,t.length)),0,l),t}function H(e,n,l){const t=e.slice(),[a]=t.splice(n,1);return t.splice(Math.max(0,Math.min(l,t.length)),0,a),t}function z(e,n){return e.filter((e,l)=>l!==n)}function E(e){return null===e||"object"!=typeof e?e:JSON.parse(JSON.stringify(e))}var R='input, textarea, select, button, [contenteditable]:not([contenteditable="false"]), [tabindex]',B={parentId:"list",slot:"items"};function Y({label:e,icon:l,noun:t,items:a,onChange:o,newItem:s,summary:c,itemName:f,thumb:b,min:k=0,max:x,readOnly:w=!1,open:$,onOpen:M,renderItem:Y,renderRow:K,canRemove:V,lockedReason:G,fixed:J=!1,removeOnRow:Z=!0,canDuplicate:W,above:X,head:q=!0}){const Q=u("fields",d).list,U=u("tree",r),_=t??Q.item,ee=!w&&!J&&("number"!=typeof x||a.length<x),ne=a.length<=k,le=e=>!!V&&!V(a[e],e),te=e=>!w&&!J&&Z&&!ne&&!le(e),ae=e=>ee&&(!W||W(a[e],e)),re=(e,n)=>f?f(e,n):Q.itemName({noun:_,n:n+1}),oe=N([]),ie=N(null),[se,ce]=C(null),de=N(null),[ue,me]=C(null),[pe,he]=C("");O(()=>{const e=ie.current;if(!e)return;ie.current=null;const n=oe.current[e.index]?.querySelectorAll(R)[e.nth]??oe.current[e.index];if(n?.focus(),n&&null!==e.start&&"setSelectionRange"in n)try{n.setSelectionRange(e.start,e.end)}catch{}});const fe=(e,n)=>{if(n<0||n>=a.length||n===e)return;const l=oe.current[e],t=l?.ownerDocument.activeElement;if(l&&t&&l.contains(t)){const e=[...l.querySelectorAll(R)].indexOf(t),a=t;ie.current={index:n,nth:e,start:"number"==typeof a.selectionStart?a.selectionStart:null,end:"number"==typeof a.selectionEnd?a.selectionEnd:null}}o(H(a,e,n));const r=function(e,n,l){return null===e?null:e===n?l:n<e&&l>=e?e-1:n>e&&l<=e?e+1:e}($,e,n);r!==$&&M(r),he(Q.moved({n:n+1,total:a.length}))},be=e=>{ee&&(o(T(a,e,s())),K?(ie.current={index:e,nth:0,start:null,end:null},null!==$&&$>=e&&M($+1)):M(e))},ge=e=>{te(e)&&(o(z(a,e)),$===e?M(null):null!==$&&$>e&&M($-1))},ve=m({keyOf:e=>String(e),canDrop:(e,n)=>n.parentId===B.parentId&&n.slot===B.slot,onDrop:(e,n)=>{const l=p({...B,index:e},n);l!==e&&fe(e,l)},onStep:(e,n)=>fe(e,e+n),canStep:(e,n)=>e+n>=0&&e+n<a.length,readOnly:w}),ye=e=>{const n=[];return e>0&&n.push({label:Q.moveUp,icon:/* @__PURE__ */j(L,{size:14}),shortcut:"⌥↑",onClick:()=>fe(e,e-1)}),e<a.length-1&&n.push({label:Q.moveDown,icon:/* @__PURE__ */j(P,{size:14}),shortcut:"⌥↓",onClick:()=>fe(e,e+1)}),ae(e)&&n.push({label:Q.duplicate,icon:/* @__PURE__ */j(F,{size:14}),onClick:()=>(e=>{ae(e)&&(o(T(a,e+1,E(a[e]))),null!==$&&$>e&&M($+1))})(e)}),te(e)&&n.push({label:Q.delete,icon:/* @__PURE__ */j(A,{size:14}),danger:!0,onClick:()=>ge(e)}),n},ke=(e,n,l,t)=>{w||0===ye(e).length||me({index:e,x:n,y:l,owner:t})},xe=e=>n=>{const l=a.slice();l[e]=n,o(l)};/* @__PURE__ */
2
2
  return D("div",{className:"es-list",children:[q?/* @__PURE__ */D("div",{className:"es-list-head",children:[
3
- /* @__PURE__ */D("span",{className:"es-list-label",children:[l?/* @__PURE__ */j("span",{className:"es-field-icon","aria-hidden":"true",children:l}):null,n]}),
4
- /* @__PURE__ */j("span",{className:"es-list-count",children:a.length})]}):null,X?/* @__PURE__ */j("div",{className:"es-list-above",children:X}):null,a.length?/* @__PURE__ */D(g,{"aria-label":n,spacing:"comfortable",className:"es-list-rows",rootProps:ve.rootProps(),children:[a.map((n,l)=>{const t=ve.row({item:l,place:{...B,index:l}}),a=t.draggable&&se!==l,r=!K&&$===l,o=!w&&!J&&Z&&le(l),i=["es-list-row",K?"is-inline":"is-item",r?"is-open":"",a?"is-draggable":"",t.dragging?"is-dragging":"",t.drop?`is-drop-${t.drop}`:""].filter(Boolean).join(" ");return[l>0?/* @__PURE__ */j(e,{...ve.seam({place:{...B,index:l}}),onAdd:ee?()=>be(l):void 0,label:Q.addHere({noun:_})},`seam-${l}`):null,
5
- /* @__PURE__ */j(v,{className:i,flat:!!K,active:r,draggable:t.draggable,dragHint:U.dragHint,dragging:t.dragging,drop:"before"===t.drop||"after"===t.drop?t.drop:void 0,onMove:t.draggable?e=>fe(l,"up"===e?l-1:l+1):void 0,rowRef:e=>{oe.current[l]=e},rowProps:{...t.rowProps,draggable:a||void 0,onPointerDown:e=>{const n=e.target.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])'),a=!!n&&n===n.ownerDocument.activeElement;e.currentTarget.draggable=t.draggable&&!a,de.current=n&&!a?n:null,ce(a?l:null)},onDragStart:e=>{const n=de.current;de.current=null,n&&n.ownerDocument.activeElement===n&&n.blur(),t.rowProps.onDragStart?.(e)},onContextMenu:e=>{w||(e.preventDefault(),e.stopPropagation(),ke(l,e.clientX,e.clientY,e.currentTarget))},onKeyDown:e=>{if("ContextMenu"===e.key||e.shiftKey&&"F10"===e.key){e.preventDefault();const n=e.currentTarget.ownerDocument,t=e=>e.preventDefault();n.addEventListener("contextmenu",t,{capture:!0,once:!0}),n.defaultView?.setTimeout(()=>n.removeEventListener("contextmenu",t,{capture:!0}),500);const a=e.currentTarget.getBoundingClientRect();return void ke(l,a.left+24,a.bottom,e.currentTarget)}t.rowProps.onKeyDown?.(e)}},actions:w||J||!Z?void 0:o?h(G?G(n,l):Q.locked,/* @__PURE__ */j("span",{className:"es-list-lock",role:"img","aria-label":G?G(n,l):Q.locked,children:/* @__PURE__ */j(I,{size:13})})):h(Q.deleteItem({noun:_}),/* @__PURE__ */j("button",{type:"button",className:"es-list-x","aria-label":Q.deleteItem({noun:_}),disabled:!te(l),onClick:()=>ge(l),children:"×"})),below:r?/* @__PURE__ */j("div",{className:"es-list-item",children:Y(n,l,xe(l))}):void 0,children:K?/* @__PURE__ */j("div",{className:"es-list-row-main",children:K(n,l,xe(l))}):/* @__PURE__ */D("button",{type:"button",className:"es-list-open","aria-expanded":r,onClick:()=>M(r?null:l),children:[b?/* @__PURE__ */j("span",{className:"es-list-thumb","aria-hidden":"true",children:b(n,l)}):null,
6
- /* @__PURE__ */j("span",{className:"es-list-row-name",children:re(n,l)}),/* @__PURE__ */j("span",c?{className:"es-list-row-summary",children:c(n,l)}:{className:"es-list-row-summary"}),
3
+ /* @__PURE__ */D("span",{className:"es-list-label",children:[l?/* @__PURE__ */j("span",{className:"es-field-icon","aria-hidden":"true",children:l}):null,e]}),
4
+ /* @__PURE__ */j("span",{className:"es-list-count",children:a.length})]}):null,X?/* @__PURE__ */j("div",{className:"es-list-above",children:X}):null,a.length?/* @__PURE__ */D(g,{"aria-label":e,spacing:"comfortable",className:"es-list-rows",rootProps:ve.rootProps(),children:[a.map((e,l)=>{const t=ve.row({item:l,place:{...B,index:l}}),a=t.draggable&&se!==l,r=!K&&$===l,o=!w&&!J&&Z&&le(l),i=["es-list-row",K?"is-inline":"is-item",r?"is-open":"",a?"is-draggable":"",t.dragging?"is-dragging":"",t.drop?`is-drop-${t.drop}`:""].filter(Boolean).join(" ");return[l>0?/* @__PURE__ */j(n,{...ve.seam({place:{...B,index:l}}),onAdd:ee?()=>be(l):void 0,label:Q.addHere({noun:_})},`seam-${l}`):null,
5
+ /* @__PURE__ */j(v,{className:i,flat:!!K,active:r,draggable:t.draggable,dragHint:U.dragHint,dragging:t.dragging,drop:"before"===t.drop||"after"===t.drop?t.drop:void 0,onMove:t.draggable?e=>fe(l,"up"===e?l-1:l+1):void 0,rowRef:e=>{oe.current[l]=e},rowProps:{...t.rowProps,draggable:a||void 0,onPointerDown:e=>{const n=e.target.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])'),a=!!n&&n===n.ownerDocument.activeElement;e.currentTarget.draggable=t.draggable&&!a,de.current=n&&!a?n:null,ce(a?l:null)},onDragStart:e=>{const n=de.current;de.current=null,n&&n.ownerDocument.activeElement===n&&n.blur(),t.rowProps.onDragStart?.(e)},onContextMenu:e=>{w||(e.preventDefault(),e.stopPropagation(),ke(l,e.clientX,e.clientY,e.currentTarget))},onKeyDown:e=>{if("ContextMenu"===e.key||e.shiftKey&&"F10"===e.key){e.preventDefault();const n=e.currentTarget.ownerDocument,t=e=>e.preventDefault();n.addEventListener("contextmenu",t,{capture:!0,once:!0}),n.defaultView?.setTimeout(()=>n.removeEventListener("contextmenu",t,{capture:!0}),500);const a=e.currentTarget.getBoundingClientRect();return void ke(l,a.left+24,a.bottom,e.currentTarget)}t.rowProps.onKeyDown?.(e)}},actions:w||J||!Z?void 0:o?h(G?G(e,l):Q.locked,/* @__PURE__ */j("span",{className:"es-list-lock",role:"img","aria-label":G?G(e,l):Q.locked,children:/* @__PURE__ */j(I,{size:13})})):h(Q.deleteItem({noun:_}),/* @__PURE__ */j("button",{type:"button",className:"es-list-x","aria-label":Q.deleteItem({noun:_}),disabled:!te(l),onClick:()=>ge(l),children:"×"})),below:r?/* @__PURE__ */j("div",{className:"es-list-item",children:Y(e,l,xe(l))}):void 0,children:K?/* @__PURE__ */j("div",{className:"es-list-row-main",children:K(e,l,xe(l))}):/* @__PURE__ */D("button",{type:"button",className:"es-list-open","aria-expanded":r,onClick:()=>M(r?null:l),children:[b?/* @__PURE__ */j("span",{className:"es-list-thumb","aria-hidden":"true",children:b(e,l)}):null,
6
+ /* @__PURE__ */j("span",{className:"es-list-row-name",children:re(e,l)}),/* @__PURE__ */j("span",c?{className:"es-list-row-summary",children:c(e,l)}:{className:"es-list-row-summary"}),
7
7
  /* @__PURE__ */j(S,{size:14,className:"es-list-chev","aria-hidden":"true"})]})},l)]}),
8
- /* @__PURE__ */j(e,{...ve.seam({place:{...B,index:a.length}})})]}):null,w||J?null:/* @__PURE__ */j("button",{type:"button",className:"es-list-add",disabled:!ee,onClick:()=>be(a.length),children:Q.add({noun:_})}),
8
+ /* @__PURE__ */j(n,{...ve.seam({place:{...B,index:a.length}})})]}):null,w||J?null:/* @__PURE__ */j("button",{type:"button",className:"es-list-add",disabled:!ee,onClick:()=>be(a.length),children:Q.add({noun:_})}),
9
9
  /* @__PURE__ */j("span",{className:"es-list-said","aria-live":"polite",children:pe}),ue&&ue.index<a.length?
10
10
  /* @__PURE__ */j(y,{at:{x:ue.x,y:ue.y},owner:ue.owner,onClose:()=>me(null),children:/* @__PURE__ */j(i,{items:ye(ue.index),onClose:()=>me(null)})}):null]})}var K=e=>e<6?e+1:6,V=(e,n)=>"string"==typeof e.label&&e.label?e.label:n;function G({field:e,name:n,id:l,value:t,onChange:r,readOnly:o,context:i,renderers:s,headingLevel:c=3}){const[d,u]=C(!0),m=t&&"object"==typeof t?t:{};/* @__PURE__ */
11
11
  return j(a,{id:`${l}-group`,title:V(e,n),open:d,onToggle:u,level:c,children:Object.entries(e.objectFields).map(([e,t])=>/* @__PURE__ */j(Z,{field:t,name:`${n}.${e}`,id:`${l}-${e}`,value:m[e],onChange:n=>r({...m,[e]:n}),readOnly:o,context:i,renderers:s,headingLevel:K(c)},e))})}function J({field:e,name:n,id:l,value:t,onChange:a,readOnly:r,context:o,renderers:i,openItem:s,onOpenItem:c,headingLevel:d}){const[u,m]=C(null),p=c?s??null:u,h=c??m,f=Array.isArray(t)?t:[],b=e.getItemSummary;/* @__PURE__ */
12
- return j(Y,{label:V(e,n),icon:e.icon,noun:"string"==typeof e.noun?e.noun:void 0,items:f,onChange:a,newItem:()=>E({...e.defaultItemProps??{}}),summary:b?(e,n)=>b(e,n):void 0,min:e.min,max:e.max,readOnly:r,open:p,onOpen:h,renderItem:(t,a,s)=>Object.entries(e.arrayFields).map(([e,c])=>/* @__PURE__ */j(Z,{field:c,name:`${n}[${a}].${e}`,id:`${l}-${a}-${e}`,value:t?.[e],onChange:n=>s({...t,[e]:n}),readOnly:r,context:o,renderers:i,headingLevel:d},e))})}function Z(e){const{field:t,name:a,id:r,value:o,onChange:i,readOnly:d,context:u,renderers:m}=e;if(!t||t.marker||!1===t.visible)return null;const p=m?.[t.type];if(p)return p({field:t,name:a,id:r,value:o,onChange:i,readOnly:d});switch(t.type){case"custom":{const e={...u,field:t,name:a,id:r,value:o,onChange:i,readOnly:d};return t.render(e)}case"text":case"textarea":/* @__PURE__ */
12
+ return j(Y,{label:V(e,n),icon:e.icon,noun:"string"==typeof e.noun?e.noun:void 0,items:f,onChange:a,newItem:()=>E({...e.defaultItemProps??{}}),summary:b?(e,n)=>b(e,n):void 0,min:e.min,max:e.max,readOnly:r,open:p,onOpen:h,renderItem:(t,a,s)=>Object.entries(e.arrayFields).map(([e,c])=>/* @__PURE__ */j(Z,{field:c,name:`${n}[${a}].${e}`,id:`${l}-${a}-${e}`,value:t?.[e],onChange:n=>s({...t,[e]:n}),readOnly:r,context:o,renderers:i,headingLevel:d},e))})}function Z(n){const{field:t,name:a,id:r,value:o,onChange:i,readOnly:d,context:u,renderers:m}=n;if(!t||t.marker||!1===t.visible)return null;const p=m?.[t.type];if(p)return p({field:t,name:a,id:r,value:o,onChange:i,readOnly:d});switch(t.type){case"custom":{const e={...u,field:t,name:a,id:r,value:o,onChange:i,readOnly:d};return t.render(e)}case"text":case"textarea":/* @__PURE__ */
13
13
  return j(l,{label:V(t,a),htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */j(M,{id:r,value:"string"==typeof o?o:null==o?"":String(o),onChange:i,placeholder:t.placeholder,multiline:"textarea"===t.type,readOnly:d})});case"number":/* @__PURE__ */
14
- return j(l,{label:V(t,a),htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */j(s,{id:r,value:"number"==typeof o?o:void 0,onChange:i,min:t.min,max:t.max,step:t.step,placeholder:t.placeholder,readOnly:d})});case"select":{const e=`${r}-label`;/* @__PURE__ */
15
- return j(l,{label:V(t,a),labelId:e,htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */j(n,{id:r,value:o,options:t.options,onChange:i,readOnly:d,ariaLabelledBy:e})})}case"radio":/* @__PURE__ */
14
+ return j(l,{label:V(t,a),htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */j(s,{id:r,value:"number"==typeof o?o:void 0,onChange:i,min:t.min,max:t.max,step:t.step,placeholder:t.placeholder,readOnly:d})});case"select":{const n=`${r}-label`;/* @__PURE__ */
15
+ return j(l,{label:V(t,a),labelId:n,htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */j(e,{id:r,value:o,options:t.options,onChange:i,readOnly:d,ariaLabelledBy:n})})}case"radio":/* @__PURE__ */
16
16
  return j(l,{label:V(t,a),icon:t.icon,hint:t.hint,children:/* @__PURE__ */j(c,{ariaLabel:V(t,a),value:o,options:t.options.map(e=>({id:e.value,label:e.label,icon:e.icon,disabled:e.disabled||d})),onChange:e=>{d||i(e)}})});case"object":/* @__PURE__ */
17
- return j(G,{...e,field:t});case"array":/* @__PURE__ */
18
- return j(J,{...e,field:t});case"slot":return null}}var W=e=>t.includes(e);function X(e){let n,l=t[0];const a=[],r=/* @__PURE__ */new Set;for(const[t,o]of Object.entries(e))o&&(W(o.bucket)&&((o.marker||o.bucket!==l)&&(n=void 0),l=o.bucket),o.marker&&"string"==typeof o.fold?n={key:t,title:o.fold}:o.marker&&!1===o.fold&&(n=void 0),o.marker||!1===o.visible||(a.push(n?{name:t,field:o,bucket:l,fold:n}:{name:t,field:o,bucket:l}),"slot"!==o.type&&r.add(l)));return{rows:a,buckets:t.filter(e=>r.has(e))}}function q(e){return new Map(X(e).rows.map(e=>[e.name,e.bucket]))}function Q(e){const n=[];for(const l of e){const e=n[n.length-1];e&&e.fold?.key===l.fold?.key?e.rows.push(l):n.push({fold:l.fold,rows:[l]})}return n}function U({fields:e,values:n,onChange:l,readOnly:t=!1,context:r,tab:i,onTab:s,tabs:c=!0,tabIcons:d,renderers:m,idPrefix:p,ariaLabel:h,lead:f,children:b,leadFold:g,closedFolds:v,onFold:y,headingLevel:N=3}){const O=u("panel",o),S=$(),I=p??`es-insp${S.replace(/:/g,"")}`,L=X(e),[P,F]=C(void 0),A=i??P,M=A&&L.buckets.includes(A)?A:L.buckets[0],[T,H]=C(null),z=T&&T.panel===I&&L.rows.some(e=>e.name===T.name)?T:null,E=c&&L.buckets.length>1,R=E&&M?k(I,M):`${I}-rows`,[B,Y]=C(()=>/* @__PURE__ */new Set),V=v??B,G=(e,n)=>{/* @__PURE__ */return j(a,{title:e.title,open:!V.has(e.key),onToggle:n=>((e,n)=>{void 0===v&&Y(l=>{const t=new Set(l);return n?t.delete(e):t.add(e),t}),y?.(e,n)})(e.key,n),id:`${I}-fold-${l=e.key,[...l].map(e=>/[A-Za-z0-9_-]/.test(e)?e:`-u${e.codePointAt(0).toString(16)}-`).join("")}`,level:N,children:n});var l},J=e=>E&&e!==M,W=({name:e,field:a,bucket:o,fold:i})=>/* @__PURE__ */j("div",{className:"es-insp-row","data-field":e,"data-bucket":o,hidden:!!J(o)||void 0,children:/* @__PURE__ */j(Z,{field:a,name:e,id:`${I}-${e}`,value:n[e],onChange:n=>l(e,n),readOnly:t,context:r,renderers:m,openItem:z&&z.name===e?z.index:null,onOpenItem:n=>H(null===n?null:{panel:I,name:e,index:n}),headingLevel:i?K(N):N})},e);/* @__PURE__ */
17
+ return j(G,{...n,field:t});case"array":/* @__PURE__ */
18
+ return j(J,{...n,field:t});case"slot":return null}}var W=e=>t.includes(e);function X(e){let n,l=t[0];const a=[],r=/* @__PURE__ */new Set;for(const[t,o]of Object.entries(e))o&&(W(o.bucket)&&((o.marker||o.bucket!==l)&&(n=void 0),l=o.bucket),o.marker&&"string"==typeof o.fold?n={key:t,title:o.fold}:o.marker&&!1===o.fold&&(n=void 0),o.marker||!1===o.visible||(a.push(n?{name:t,field:o,bucket:l,fold:n}:{name:t,field:o,bucket:l}),"slot"!==o.type&&r.add(l)));return{rows:a,buckets:t.filter(e=>r.has(e))}}function q(e){return new Map(X(e).rows.map(e=>[e.name,e.bucket]))}function Q(e){const n=[];for(const l of e){const e=n[n.length-1];e&&e.fold?.key===l.fold?.key?e.rows.push(l):n.push({fold:l.fold,rows:[l]})}return n}function U({fields:e,values:n,onChange:l,readOnly:t=!1,context:r,tab:i,onTab:s,tabs:c=!0,tabIcons:d,renderers:m,idPrefix:p,ariaLabel:h,lead:f,children:b,leadFold:g,closedFolds:v,onFold:y,headingLevel:N=3}){const O=u("panel",o),S=$(),I=p??`es-insp${S.replace(/:/g,"")}`,L=X(e),[P,F]=C(void 0),A=i??P,M=A&&L.buckets.includes(A)?A:L.buckets[0],[T,H]=C(null),z=T&&T.panel===I&&L.rows.some(e=>e.name===T.name)?T:null,E=c&&L.buckets.length>1,R=E&&M?k(I,M):`${I}-rows`,[B,Y]=C(()=>/* @__PURE__ */new Set),V=v??B,G=(e,n)=>{/* @__PURE__ */return j(a,{title:e.title,open:!V.has(e.key),onToggle:n=>((e,n)=>{void 0===v&&Y(l=>{const t=new Set(l);return n?t.delete(e):t.add(e),t}),y?.(e,n)})(e.key,n),id:`${I}-fold-${l=e.key,[...l].map(e=>/[A-Za-z0-9_-]/.test(e)?e:`-u${e.codePointAt(0).toString(16)}-`).join("")}`,level:N,children:n});var l},J=e=>E&&e!==M,W=({name:e,field:a,bucket:o,fold:i})=>/* @__PURE__ */j("div",{className:"es-insp-row","data-field":e,"data-bucket":o,hidden:!!J(o)||void 0,children:/* @__PURE__ */j(Z,{field:a,name:e,id:`${I}-${e}`,value:n[e],onChange:n=>l(e,n),readOnly:t,context:r,renderers:m,openItem:z&&z.name===e?z.index:null,onOpenItem:n=>H(null===n?null:{panel:I,name:e,index:n}),headingLevel:i?K(N):N})},e);/* @__PURE__ */
19
19
  return D("div",{className:"es-insp",children:[E?/* @__PURE__ */j("div",{className:"es-insp-tabs",children:/* @__PURE__ */j(x,{variant:"underline",block:!0,"aria-label":h??O.settings,idPrefix:I,value:M,onChange:e=>{const n=e;void 0===i&&F(n),s?.(n)},items:L.buckets.map(e=>{const n=O.buckets[e],l=d?.[e];return l?{id:e,icon:l,label:/* @__PURE__ */j("span",{className:"sr-only",children:n}),tooltip:n}:{id:e,label:n}})})}):null,
20
20
  /* @__PURE__ */D("div",{className:"es-insp-rows",id:R,role:E?"tabpanel":void 0,"aria-labelledby":E&&M?w(I,M):void 0,children:[f?g?/* @__PURE__ */j("div",{className:"es-insp-band","data-fold":g.key,children:G(g,f)}):f:null,Q(L.rows).map((e,n)=>{if(!e.fold)return e.rows.map(W);const l=e.rows[0].bucket,t=e.rows.every(e=>"slot"===e.field.type);/* @__PURE__ */
21
21
  return j("div",{className:"es-insp-band","data-fold":e.fold.key,"data-bucket":l,hidden:!(!J(l)&&!t)||void 0,children:G(e.fold,e.rows.map(W))},`fold-${e.fold.key}-${n}`)}),b]})]})}export{M as FieldText,U as Inspector,Z as InspectorField,Y as ListField,q as bucketsOf,E as copyItem,T as insertAt,V as labelOf,H as moveTo,X as planFields,z as removeAt};
@@ -1,4 +1,4 @@
1
- import{PanelToggleIcon as e}from"./chunk-KQMML6JM.js";import{InspectorHead as n}from"./chunk-QVUVDBGA.js";import{DEFAULT_CHROME_WORDS as i}from"./chunk-Y2G7CU6A.js";import{useWords as o}from"./chunk-MFIRYGHW.js";import{Tooltip as s,IconButton as t,Button as c}from"efficient-shell/ui";import{jsx as r,jsxs as l,Fragment as d}from"react/jsx-runtime";function a({icon:e,title:i,context:o,actions:s,side:t="left",onHide:c}){/* @__PURE__ */
1
+ import{PanelToggleIcon as e}from"./chunk-KQMML6JM.js";import{InspectorHead as n}from"./chunk-IE55HNMA.js";import{DEFAULT_CHROME_WORDS as i}from"./chunk-Z6PVRXVY.js";import{useWords as o}from"./chunk-MFIRYGHW.js";import{Tooltip as s,IconButton as t,Button as c}from"efficient-shell/ui";import{jsx as r,jsxs as l,Fragment as d}from"react/jsx-runtime";function a({icon:e,title:i,context:o,actions:s,side:t="left",onHide:c}){/* @__PURE__ */
2
2
  return r(n,{icon:e,name:i,kind:o,actions:s||c?/* @__PURE__ */l(d,{children:[s,c?/* @__PURE__ */r(m,{side:t,onHide:c,divider:Boolean(s)}):null]}):void 0})}function m({side:n,onHide:c,divider:a=!1}){const m=o("chrome",i);/* @__PURE__ */
3
3
  return l(d,{children:[a?/* @__PURE__ */r("span",{className:"sf-head-divider","aria-hidden":"true"}):null,
4
4
  /* @__PURE__ */r(s,{content:m.hidePanel,side:"bottom",children:/* @__PURE__ */r(t,{className:"es-insp-iconbtn","aria-label":m.hidePanelLabel({side:n}),onClick:c,children:/* @__PURE__ */r(e,{side:n})})})]})}function h({side:n,onShow:c}){const l=o("chrome",i);/* @__PURE__ */
@@ -1 +1 @@
1
- import{DEFAULT_PANEL_W as s,clampPanelWidth as e}from"./chunk-QVUVDBGA.js";var a="sf-editor-panel-widths",l="sf-editor-collapsed-sections";function t(s){return s?{panelWidths:`${s}-panel-widths`,collapsed:`${s}-collapsed-sections`}:{panelWidths:a,collapsed:l}}var o={...s},d=s=>e(s);export{l as COLLAPSED_SECTIONS_KEY,o as DEFAULT_PANEL_W,a as PANEL_WIDTHS_KEY,d as clampPanelWidth,t as screenStorageKeys};
1
+ import{DEFAULT_PANEL_W as s,clampPanelWidth as e}from"./chunk-IE55HNMA.js";var a="sf-editor-panel-widths",l="sf-editor-collapsed-sections";function t(s){return s?{panelWidths:`${s}-panel-widths`,collapsed:`${s}-collapsed-sections`}:{panelWidths:a,collapsed:l}}var o={...s},d=s=>e(s);export{l as COLLAPSED_SECTIONS_KEY,o as DEFAULT_PANEL_W,a as PANEL_WIDTHS_KEY,d as clampPanelWidth,t as screenStorageKeys};
@@ -1 +1 @@
1
- import{useSectionOps as o}from"./chunk-VF6TCI62.js";import{decodePartId as e,encodePartId as r}from"./chunk-IYT6NN2J.js";import{usePreviewParts as t}from"./chunk-I54UCYOU.js";import{SELECTION_MODE as n}from"./chunk-CWTAS5R6.js";import{useEasel as p}from"./chunk-K5744MTM.js";import{useCallback as d,useEffect as c}from"react";var s=o=>"part"===o.kind;function m({mode:m,setMode:i,onOpenPart:I}){const{getSelectorForId:a}=p(o=>o),u=o(),{setSelectedPartId:f,setSelectHandler:k}=t(),l=d(o=>{const r=e(o);if(!r)return;const{nodeId:t,propKey:p}=r;p?(i(o=>s(o)&&o.nodeId===t&&o.propKey===p?o:{kind:"part",nodeId:t,propKey:p}),I?.(t)):i(o=>"part"===o.kind?n:o)},[i,I]);c(()=>{k(l)},[k,l]);const h=s(m)?r(m.nodeId,m.propKey):null;c(()=>{f(h)},[h,f]);return{selectNode:d(o=>{i(()=>n);const e=a(o);e&&u.select(e)},[i,a,u]),openPartId:h}}export{m as usePartBridge};
1
+ import{useSectionOps as o}from"./chunk-NMUS2VVD.js";import{decodePartId as e,encodePartId as r}from"./chunk-IYT6NN2J.js";import{usePreviewParts as t}from"./chunk-I54UCYOU.js";import{SELECTION_MODE as n}from"./chunk-FJRAYUCX.js";import{useEasel as p}from"./chunk-K5744MTM.js";import{useCallback as d,useEffect as c}from"react";var s=o=>"part"===o.kind;function m({mode:m,setMode:i,onOpenPart:a}){const{getSelectorForId:u}=p(o=>o),I=o(),{setSelectedPartId:f,setSelectHandler:k}=t(),l=d(o=>{const r=e(o);if(!r)return;const{nodeId:t,propKey:p}=r;p?(i(o=>s(o)&&o.nodeId===t&&o.propKey===p?o:{kind:"part",nodeId:t,propKey:p}),a?.(t)):i(o=>"part"===o.kind?n:o)},[i,a]);c(()=>{k(l)},[k,l]);const h=s(m)?r(m.nodeId,m.propKey):null;c(()=>{f(h)},[h,f]);return{selectNode:d(o=>{i(()=>n);const e=u(o);e&&I.select(e)},[i,u,I]),openPartId:h}}export{m as usePartBridge};