efficient-easel 8.2.1 → 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.
- package/README.md +15 -0
- package/dist/chrome/chrome.css +18 -0
- package/dist/chrome/index.d.ts +26 -3
- package/dist/chrome/index.js +1 -1
- package/dist/{chunk-ZVEJ25YG.js → chunk-CKBGJ53M.js} +1 -1
- package/dist/{chunk-35TOFLH6.js → chunk-CXLWPZZK.js} +4 -4
- package/dist/{chunk-SQMUAXUS.js → chunk-GD7QFYER.js} +1 -1
- package/dist/{chunk-AUT242JK.js → chunk-GMXWP5XP.js} +1 -1
- package/dist/{chunk-QVUVDBGA.js → chunk-IE55HNMA.js} +18 -18
- package/dist/chunk-NRC43NHG.js +5 -0
- package/dist/{chunk-NCQSBU3O.js → chunk-P4CL4YQI.js} +1 -1
- package/dist/{chunk-XTJCKV6Z.js → chunk-PPL7GB7D.js} +1 -1
- package/dist/{chunk-DPKWJTNX.js → chunk-TZIIRGVY.js} +1 -1
- package/dist/chunk-W3BK5T4O.js +57 -0
- package/dist/{chunk-HDUAODXJ.js → chunk-W4U4SHKW.js} +3 -3
- package/dist/chunk-Z6PVRXVY.js +1 -0
- package/dist/copy/copy.css +29 -15
- package/dist/copy/index.d.ts +2 -2
- package/dist/copy/index.js +13 -11
- package/dist/screen/components/AddSidePanel.d.ts +5 -1
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/MediaSidePanel.js +1 -1
- package/dist/screen/components/PageEditGuardNotices.js +1 -1
- package/dist/screen/components/SaveControls.js +1 -1
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/SectionScreenShell.js +16 -16
- package/dist/screen/components/SidePanelHead.js +1 -1
- package/dist/screen/components/panel-widths.js +1 -1
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/screen-parts.d.ts +10 -0
- package/dist/strings/catalogue.d.ts +2 -2
- package/dist/strings/catalogue.js +1 -1
- package/dist/strings/index.d.ts +2 -2
- package/dist/strings/index.js +1 -1
- package/dist/{words-C1U_dLBh.d.ts → words-BpiVrsW5.d.ts} +8 -0
- package/dist/{words-BAnsDT16.d.ts → words-DohP5ieg.d.ts} +3 -2
- package/package.json +3 -3
- package/dist/chunk-KSKKRGNQ.js +0 -57
- package/dist/chunk-RMB2VGNY.js +0 -5
- 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
|
package/dist/chrome/chrome.css
CHANGED
|
@@ -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
|
package/dist/chrome/index.d.ts
CHANGED
|
@@ -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 };
|
package/dist/chrome/index.js
CHANGED
|
@@ -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-
|
|
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-FJRAYUCX.js";import{settlePanelPick as n}from"./chunk-R6WTQWAC.js";import{MediaPanelHead as i,mediaPickKind as c}from"./chunk-
|
|
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-EJZ4RIRW.js";import{ScreenChrome as e}from"./chunk-
|
|
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:()=>{k()},children:i.save})]}),children:i.body})}function
|
|
6
|
-
return u(i,{target:r,addressing:n,onHostMessage:e,children:a})}var
|
|
7
|
-
/* @__PURE__ */u(k,{config:r,data:i,onChange:h,permissions:H,parts:n,children:/* @__PURE__ */u(C,{})}),f&&/* @__PURE__ */u(
|
|
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
|
+
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(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 +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-
|
|
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
|
|
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-
|
|
2
|
-
return c("div",{className:"es-topbar",children:e})}function
|
|
3
|
-
return c("div",{className:e?`es-cluster es-cluster--${e}`:"es-cluster",style:n,children:i})}function
|
|
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(
|
|
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(
|
|
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
|
|
9
|
-
return c("span",{className:"es-savestate-toggle",children:/* @__PURE__ */c(
|
|
10
|
-
/* @__PURE__ */c(
|
|
11
|
-
/* @__PURE__ */c("span",{className:"es-vh",role:"status","aria-live":"polite",children:a})]})}function
|
|
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
|
|
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(
|
|
17
|
-
/* @__PURE__ */c("div",{className:"es-insp-kind",children:i})]}),a?/* @__PURE__ */c("div",{className:"es-insp-actions",children:a}):null]})}function
|
|
18
|
-
return c(
|
|
19
|
-
return c(
|
|
20
|
-
return c(
|
|
21
|
-
/* @__PURE__ */c(
|
|
22
|
-
/* @__PURE__ */c("span",{className:"es-insp-divider","aria-hidden":"true"}),r]}):null]})})}function
|
|
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
|
|
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};
|
|
@@ -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-
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import{PanelToggleIcon as e}from"./chunk-KQMML6JM.js";import{InspectorHead as n}from"./chunk-
|
|
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-
|
|
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};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import{cloneNodeWithFreshIds as e}from"./chunk-2GVCAIPX.js";import{dedupeSlotChildren as n}from"./chunk-26OOWIJJ.js";import{styleClipboardOf as t}from"./chunk-BRDCD4LK.js";import{markedTreeNodeId as o,revealSelectedTreeRow as r,sameSelector as i}from"./chunk-FGNR22NY.js";import{rootRowName as l,slotChildRowName as s,slotChildRenameProp as d,sectionRenameProp as c}from"./chunk-BHRC3ASL.js";import{scrollPreviewToSection as a,gotoPreviewSlide as p,scrollPreviewToTop as u}from"./chunk-4ES5JGGX.js";import{useEaselKeyTarget as f,useEaselUndoKeys as h,useEaselSaveKey as m,editorRootFocus as g}from"./chunk-OWW44DVK.js";import{SlotChildActionsProvider as y}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as k,DEFAULT_PANEL_W as S,clampPanelWidth as v}from"./chunk-TZIIRGVY.js";import{usePartBridge as b}from"./chunk-VNN6VB4V.js";import{useSectionOps as x}from"./chunk-NMUS2VVD.js";import{useNodeClipboard as w,useNodeContextMenu as z}from"./chunk-D6N77AOS.js";import{PageEditGuardNotices as B}from"./chunk-P4CL4YQI.js";import{ScreenSaveIcon as C,ScreenMainButton as N}from"./chunk-W4U4SHKW.js";import{useBrowserOffline as I}from"./chunk-RKTF5XLP.js";import{useScreenDocument as O}from"./chunk-THZ46DC5.js";import{requestMediaPick as $}from"./chunk-KG7RJWOK.js";import{heldStyle as P,styleShortcut as A}from"./chunk-V7U33NF2.js";import{AddChildRow as T}from"./chunk-5545A3PC.js";import{AddSidePanel as M}from"./chunk-NRC43NHG.js";import{SidePanelHead as j,PanelShowStrip as L}from"./chunk-PPL7GB7D.js";import{useEaselSession as R}from"./chunk-O7Q4DDJT.js";import{MediaSidePanel as E}from"./chunk-CKBGJ53M.js";import{useScreenSaveSwitch as V,useScreenNodeKeys as F,useScreenPinned as H,useScreenDocumentLabel as D,useScreenCanvasFrame as W,useScreenInspectorPanel as U,useScreenDevices as G,useScreenPickFollowsSelection as J,useScreenLeftView as K,useScreenAdd as X,SELECTION_MODE as Y,sameInspectorMode as q,useScreenBridges as _,useScreenBlockRules as Z,useScreenBlockLook as Q,useScreenStorageNamespace as ee,useScreenNotify as ne,useScreenCanvasHead as te,isSlotMode as oe,useScreenStyleClipboard as re,useScreenDocumentPass as ie,useScreenCanvasDrag as le,ScreenCanvasTargetProvider as se,isPinnedFirst as de,isPinnedLast as ce,screenSlotsOf as ae}from"./chunk-FJRAYUCX.js";import{ROOT_ZONE as pe,blockNodeActions as ue,TREE_MAX_DEPTH as fe,childSlotsOf as he,slotFieldsOf as me,slotChildrenIn as ge,nestsInTree as ye,newNodeId as ke}from"./chunk-PLVEGYK6.js";import{useMediaPanel as Se,usePanelPick as ve,useCancelPanelPick as be}from"./chunk-R6WTQWAC.js";import{useEaselHost as xe,useHostEscape as we}from"./chunk-U3JP4VGF.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as ze}from"./chunk-6WY6ZXJG.js";import{DEFAULT_SCREEN_WORDS as Be}from"./chunk-JTUUIVBZ.js";import{useEasel as Ce,useEaselApi as Ne,CanvasPassThroughContext as Ie}from"./chunk-K5744MTM.js";import{TreeRow as Oe,Subtree as $e,LayersTree as Pe,TreeGroupLabel as Ae,TreeRowAction as Te,TreeSeam as Me}from"./chunk-4JSBIW5H.js";import{DEFAULT_TREE_WORDS as je}from"./chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as Le}from"./chunk-WK3AFPXY.js";import{toItemSelector as Re,useNodeOps as Ee,clickPick as Ve}from"./chunk-ECM5F6JJ.js";import{LayersIcon as Fe,MediaIcon as He}from"./chunk-4VJATVVR.js";import{EaselTopBar as De,TopBarRail as We,TopBarCluster as Ue,EaselIconButton as Ge,TopBarDivider as Je,DeviceSwitch as Ke,InspectorIconButton as Xe,PanelResizeHandle as Ye,MAX_PANEL_W as qe,MIN_PANEL_W as _e,panelWidthVars as Ze}from"./chunk-IE55HNMA.js";import{DEFAULT_NOTICE_WORDS as Qe,DEFAULT_CHROME_WORDS as en}from"./chunk-Z6PVRXVY.js";import{holderOf as nn,nameOrSomeone as tn}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as on}from"./chunk-RE4LP46F.js";import{useWords as rn}from"./chunk-MFIRYGHW.js";import{insertSeams as ln,CanvasDragLayer as sn,CanvasInsert as dn}from"./chunk-FCLW4LEN.js";import{DEFAULT_DRAG_WORDS as cn}from"./chunk-O2NLQBFX.js";import{createDragSession as an,useTreeDrag as pn,gapToMoveIndex as un}from"./chunk-67GNT6PF.js";import{useCanvasFrame as fn,LIST_SELECTOR as hn,BLOCK_SELECTOR as mn,useCanvasEvent as gn,nodeIdAt as yn,frameRectToHost as kn,BLOCK_ATTRIBUTE as Sn,drawnBox as vn}from"./chunk-ILXP5VX5.js";import{zoneKey as bn,ROOT_ID as xn,ROOT_SLOT as wn,parseZoneKey as zn,find as Bn,DataError as Cn}from"./chunk-KRXQM65X.js";import{useRef as Nn,useMemo as In,useState as On,useEffect as $n,useCallback as Pn,useLayoutEffect as An,Fragment as Tn}from"react";import{ColoredBadge as Mn,toast as jn,groupColors as Ln}from"efficient-shell/ui";import{UndoIcon as Rn,RedoIcon as En,RefreshIcon as Vn,TrashIcon as Fn,EyeOffIcon as Hn,EyeIcon as Dn,DuplicateIcon as Wn}from"efficient-shell/icons/efficient";import{jsx as Un,jsxs as Gn,Fragment as Jn}from"react/jsx-runtime";var Kn=/* @__PURE__ */new WeakSet;function Xn(e,n,t){const o=Bn(e,n,t);if(!o)return null;const r=o.path.find(e=>"root"!==e.parentId);return r?r.parentId:t}function Yn({canvas:e,tabs:n,onSelect:t}){const o=Nn(null),[r,i]=On({}),l=n.map(e=>`${e.id}:${e.below?1:0}`).join("|");return An(()=>{const t=e?.document,r=e?.window,l=e?.frame;if(!t||!r||!l||0===n.length)return void i({});let s=0;const d=()=>{s=0;const e=o.current;if(!e)return;const d=kn(l,{left:0,top:0,width:r.innerWidth,height:r.innerHeight},e),c={};for(const o of n){const n=t.querySelector(`[${Sn}="${r.CSS?.escape?r.CSS.escape(o.id):o.id}"]`),i=n?vn(n):null;if(!i||0===i.height){c[o.id]=null;continue}const s=kn(l,{left:i.left,top:i.top,width:i.width,height:i.height},e),a=s.top+s.height;if(a<d.top||s.top>d.top+d.height){c[o.id]=null;continue}const p=o.below?a+4:Math.max(s.top,d.top)+6;c[o.id]={left:Math.max(s.left,d.left)+6,top:p}}i(c)},c=()=>{s||(s=r.requestAnimationFrame(d))};d(),r.addEventListener("scroll",c,!0),r.addEventListener("resize",c);const a=new r.MutationObserver(c);return a.observe(t.body,{childList:!0,subtree:!0,attributes:!0}),()=>{s&&r.cancelAnimationFrame(s),r.removeEventListener("scroll",c,!0),r.removeEventListener("resize",c),a.disconnect()}},[e,l]),/* @__PURE__ */Un("div",{ref:o,className:"es-band-tabs","aria-hidden":"true",children:n.map(e=>{const n=r[e.id];return n?/* @__PURE__ */Un("span",{className:"es-band-tab","data-band-tab":e.id,style:{left:n.left,top:n.top},onClick:n=>{n.stopPropagation(),t(e.id)},children:/* @__PURE__ */Un(Mn,{colorClass:Ln("info","solid"),size:"sm",children:e.label})},e.id):null})})}function qn({expand:e}){/* @__PURE__ */
|
|
2
|
+
return Un("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */Gn(Jn,e?{children:[
|
|
3
|
+
/* @__PURE__ */Un("path",{d:"M8 9l4-4 4 4"}),
|
|
4
|
+
/* @__PURE__ */Un("path",{d:"M8 15l4 4 4-4"})]}:{children:[
|
|
5
|
+
/* @__PURE__ */Un("path",{d:"M8 4l4 4 4-4"}),
|
|
6
|
+
/* @__PURE__ */Un("path",{d:"M8 20l4-4 4 4"}),
|
|
7
|
+
/* @__PURE__ */Un("path",{d:"M5 12h14"})]})})}var _n=`${hn}, ${mn}`;function Zn(e,n,t){const o=t-n;if(o<6)return null;if(o<24)return{top:Math.round((n+t)/2),height:Math.round(o)};return{top:Math.round(Math.min(Math.max(e,n+12),t-12))}}var Qn="__rungs";var et="screen:band",nt={duplicate:!0,delete:!0};function tt(){const hn=xe(),{target:kn,docId:Sn,capabilities:vn,currentSlug:Ln,siteId:tt,onPublish:ot,saveState:rt,saveConflict:it,retrySave:lt,toggleAutoSave:st,flushSave:dt,access:ct,saveUnreachable:at=!1,readOnly:pt,readOnlyReason:ut=null}=O(),ft=V(),ht=F(),{mediaEditing:mt,hasEditGuard:gt,hasPinnedChrome:yt}=vn,{appState:kt,dispatch:St,history:vt,selectedItem:bt,getSelectorForId:xt,config:wt}=Ce(e=>e),zt=H(),{first:Bt,firstGroup:Ct,lastGroup:Nt,isSectionGroup:It,sectionGroupZone:Ot,panelOf:$t}=zt,Pt=$t(Bt),At=e=>de(zt,e),Tt=e=>ce(zt,e),Mt="node"===zt.firstRow,jt=zt.band??null,Lt=rn("screen",Be),Rt=rn("tree",je),Et=rn("drag",cn),Vt=rn("notice",Qe),Ft=rn("lock",on),Ht=rn("menu",Le),Dt=rn("styleClipboard",ze),Wt=rn("chrome",en),Ut=D()??`/${Ln}`,Gt=W(),Jt=U(),Kt=x({readOnly:pt}),Xt=x({readOnly:pt,foldIntoHistory:!0}),Yt=Nn(null),qt=Ne(),_t=In(()=>({...Kt,select:e=>{Yt.current=e,Kt.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=qt.config;Yt.current=Re(e,t,n)}Kt.commitDocument(e,n)}}),[Kt,qt]),Zt=kt.ui,Qt=Zt.leftSideBarVisible,eo=Zt.rightSideBarVisible,{options:no,widths:to,initial:oo,fluid:ro,fit:io}=G(),[lo,so]=On(oo),co=Se(),ao=mt&&null!==co,po=ve(),uo=be();J(bt?.props.id);const{read:fo,write:ho,forSelection:mo}=K(),[go,yo]=On(fo);$n(()=>{ho(go)},[go]);const[ko,So]=On(0),vo=Nn(null),bo=Nn(null),xo=fn(bo,{readySelector:_n}),wo=f(bo);h(bo,xo);const zo=I(),Bo=nn(ct),Co={state:rt,offline:zo||rt.failed&&at,readOnlyReason:ut,editing:Bo?Vt.editing({name:tn(Bo.name,Ft),noun:Lt.noun}):null,conflict:null!=it,notSaving:Lt.bar.notSaving},No=()=>{pt||(rt.failed?lt():dt())};m(bo,xo,No);const[Io,Oo]=On(!1),$o=Nn(!1),Po=Nn(!1),[Ao,To]=On(null),Mo=X(),jo=e=>To(null===e?null:{zone:pe,index:e}),[Lo,Ro]=On([]),[Eo,Vo]=On(Y),Fo="puck"===Eo.kind,Ho=Io&&!Ao&&Mo.railTarget?Mo.railTarget(kt.data,{node:bt??null,mode:Eo}):null,Do=Ho?{zone:bn(Ho),index:Ho.index}:null,Wo=Ao??Do,Uo=Wo&&Wo.zone===pe?Wo.index:null,Go=o(Eo,bt?.props.id),[Jo,Ko]=On(null);$n(()=>{Jo&&(r(),Ko(null))},[Jo]);const Xo=Nn(xt);Xo.current=xt;const Yo=Pn((e,{scroll:n})=>{yo(n=>mo(e,n)),n&&Ko(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=Xo.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&Br(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),qo=Nn(null);$n(()=>{const e=qo.current;qo.current=null;const n=null==bt?.props.id?null:String(bt.props.id);Vo(t=>e&&e.id===n?e.mode:"part"===t.kind&&"nodeId"in t&&t.nodeId===n?t:$t(bt?.type)??Y);const t=bt?.props.id,o=Yt.current;if(Yt.current=null,!t)return;const r=xt(t);Yo(String(t),{scroll:!i(o,r??null,pe)})},[bt?.props.id,Yo]);const _o=Pn(e=>{Vo(n=>q(n,e)?n:e),St({type:"setUi",ui:{rightSideBarVisible:!0}})},[St]),Zo=Nn(()=>{});Zo.current=(e,n)=>{const t=e?ki(e.zone??pe)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==bt?.props.id?null:String(bt.props.id);Vo(e=>q(e,n)?e:n),o!==r&&(qo.current={id:o,mode:n},_t.select(e))};const Qo=Pn((e,n)=>Zo.current(e,n),[]),er={kind:Eo.kind,mode:Eo,open:_o,show:e=>Vo(e),reveal:()=>{eo||St({type:"setUi",ui:{rightSideBarVisible:!0}})},select:Qo},nr=_(er,{data:kt.data,selected:bt??null,zoneOf:e=>xt(e)?.zone,readOnly:Boolean(pt),select:e=>{Vo(Y),_t.select({index:e})},replace:(e,n)=>_t.replaceComponent(pe,e,n),scrollTo:e=>Wi(e)},{device:lo,refreshes:ko},{setView:yo,reveal:()=>{Qt||St({type:"setUi",ui:{leftSideBarVisible:!0}})}}),tr=nr.pinnedSource??!1,or=nr.resolveLeftView?nr.resolveLeftView(go,ao):"media"===go&&ao?go:"sections",rr=Z(),{isLockedBlock:ir,duplicateBlocked:lr,nestDepth:sr,newSectionNode:dr,canAddTo:cr,blockIsOffered:ar}=rr,pr=Q(),{labelAtLevel:ur,Icon:fr,useProducts:hr}=pr,mr=pr.rowName?(e,n,t)=>pr.rowName(e,n,t):void 0,gr=Pn(e=>{St({type:"setUi",ui:{rightSideBarVisible:!0}}),a(e),Yo(e,{scroll:!0})},[St,Yo]),{selectNode:yr,openPartId:kr}=b({mode:Eo,setMode:Vo,onOpenPart:gr}),[Sr,vr]=On(null);we(null!==Sr,()=>vr(null));const br=k(ee()),xr=br.collapsed,wr=br.panelWidths,[zr,Br]=On(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(xr);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
|
|
8
|
+
return new Set}});$n(()=>{try{window.localStorage.setItem(xr,JSON.stringify([...zr]))}catch{}},[zr]);const[Cr,Nr]=On(()=>{if("undefined"==typeof window)return{...S};try{const e=window.localStorage.getItem(wr);if(!e)return{...S};const n=JSON.parse(e);return{left:v(Number(n.left)||S.left),right:v(Number(n.right)||S.right)}}catch{return{...S}}});$n(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(wr,JSON.stringify(Cr))}catch{}},300);return()=>clearTimeout(e)},[Cr]);const Ir=Pn((e,n)=>Nr(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),Or=Pn(e=>Ir("left",e),[Ir]),$r=Pn(e=>Ir("right",e),[Ir]),Pr=e=>zr.has(e),Ar=e=>Br(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Tr=Nn(!1),Mr=Nn(null);$n(()=>{if(Tr.current&&!Io){const e=Mr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??bo.current?.querySelector(`button[aria-label="${CSS.escape(Lt.add.title)}"]`))?.focus(),Mr.current=null}Tr.current=Io},[Io]),$n(()=>{if(!Io||!wo)return;const e=e=>{"Escape"===e.key&&Zi()};return wo.addEventListener("keydown",e),()=>wo.removeEventListener("keydown",e)},[Io,wo]),we(Io,()=>Zi()),$n(()=>{!Qt&&Io&&(Oo(!1),To(null),$o.current=!1)},[Qt]),$n(()=>{if(!po)return Po.current&&St({type:"setUi",ui:{leftSideBarVisible:!1}}),void(Po.current=!1);Io&&(Oo(!1),To(null),Po.current=$o.current,$o.current=!1),Qt||(Po.current=!0,St({type:"setUi",ui:{leftSideBarVisible:!0}}))},[po]),$n(()=>{!Qt&&po&&(Po.current=!1,uo())},[Qt]),$n(()=>{if(!po||!wo)return;const e=e=>{"Escape"===e.key&&uo()};return wo.addEventListener("keydown",e),()=>wo.removeEventListener("keydown",e)},[po,wo]),we(null!==po,()=>uo());const jr=ne(),Lr=(e,n="success",t)=>{if(jr)return void(t?jr(e,"error"===n?"error":"info",t):jr(e,"error"===n?"error":"info"));const o={sound:!1,action:t?.action,onClose:t?.onClose};"error"===n?jn.error(e,{...o,duration:t?.duration??3200}):jn.success(e,{...o,duration:t?.duration??1900})},Rr=Nn(null),[Er,Vr]=On(0),[Fr,Hr]=On(0),Dr=te(),Wr=Nn(null),Ur=e=>Math.max(0,e.clientHeight-(Wr.current?.offsetHeight??0));$n(()=>{const e=Rr.current;if(!e)return;const n=()=>{Vr(e.clientWidth),Hr(Ur(e))};n();const t=new ResizeObserver(n);return t.observe(e),Wr.current&&t.observe(Wr.current),()=>t.disconnect()},[]),An(()=>{Rr.current&&(Vr(Rr.current.clientWidth),Hr(Ur(Rr.current)))},[Cr,Qt,eo]);const Gr=lo===ro?Er>0?Er:to[ro]:to[lo],Jr=Er>0?Math.min(Er/Gr,"shrink"===io?1:2):1,Kr=Gr*Jr,Xr=Er>0&&Kr>Er+1,Yr={width:Kr,height:Fr||"100%",flex:"none",position:"relative"},qr={width:Gr,height:Fr?Fr/Jr:"100%",maxHeight:"none",transform:1!==Jr?`scale(${Jr})`:void 0,transformOrigin:"top left"},_r=()=>St({type:"setUi",ui:{leftSideBarVisible:!Qt}}),Zr=()=>St({type:"setUi",ui:{rightSideBarVisible:!eo}}),Qr=e=>{Io&&(Oo(!1),To(null),$o.current=!1,Qt&&go===e)||po&&(Po.current=!1,uo(),Qt&&go===e)||(Qt&&go===e?_r():(yo(e),Qt||St({type:"setUi",ui:{leftSideBarVisible:!0}})))},ei=()=>{$(hn,{accept:"image/*",title:Wt.mediaLibrary})},ni=()=>{Vo(Y),_t.select(null),u()},ti=()=>{Vo(Pt??Y),eo||St({type:"setUi",ui:{rightSideBarVisible:!0}})},oi=kt.data.content??[],ri=()=>{const e=oi.findIndex(At),n=oi.findIndex(Tt);return{floor:e>=0?e+1:0,cap:n>=0?n:oi.length}},ii=wt,li=rr.stripCopy,si=n=>e(n,li),di=w(),ci=Ee({data:kt.data,config:ii,readOnly:Boolean(pt),clipboard:di,strip:li?e=>li(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==xn||e.slot!==wn)return{min:0,max:n-1};const{floor:t,cap:o}=ri();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&Vo(Y);const t=void 0===n||"node"===n?.kind?n:null;_t.commitDocument(e,t)}}),ai=e=>{const n=Bn(kt.data,wt,e);if(!n)return!1;const t=bn(n.place),o=n.node,r=t===pe?mi(o):Oi(o);return!!ci.remove(e)&&(Lr(Lt.deleted({name:r}),"success",{duration:8e3,action:{label:Lt.bar.undo,onClick:()=>{ci.restore(n.node,n.place)}}}),!0)},pi={...ci,remove:ai},ui=e=>ur(e,"block",wt.components[e]?.label??e),fi=Pn(e=>wt.components[e]?.defaultProps??{},[wt]),hi=e=>ur(e,"section",ui(e)),mi=e=>l({type:e.type,props:e.props??{}},hi(e.type),mr),{nodeAddresses:gi,zoneItems:yi}=In(()=>{const e=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map,t=(o,r,i)=>{n.set(r,o),o.forEach((n,o)=>{const l=String(n.props?.id??"");if(l&&e.set(l,{zone:r,index:o}),i>=fe)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of he(wt,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(oi,pe,0),{nodeAddresses:e,zoneItems:n}},[oi,wt]),ki=Pn(e=>yi.get(e)??[],[yi]),Si=e=>{const n=gi.get(e);return n?ki(n.zone)[n.index]:void 0},vi=e=>ae(rr,wt,e),bi=e=>{if(!rr.slotsOf||e===pe)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=Si(e.slice(0,n));if(!t)return null;const o=vi(t).filter(e=>e.rung),r=o.findIndex(t=>t.slot===e.slice(n+1));return r<0?null:{node:t,slot:o[r],position:r}},xi=(()=>{if(!oe(Eo))return null;const e=`${Eo.nodeId}:${Eo.slot}`;return bi(e)?.slot.panel===Eo.kind?e:null})(),wi=Nn(null);$n(()=>{const e=wi.current;if(wi.current=null,!xi||!oe(Eo))return;const n=Eo.nodeId;Yo(n,{scroll:e!==xi}),Br(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[Eo]);const zi=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=gi.get(e);n&&(n.zone===pe?Ui(n.index):vl(n.zone,n.index,e,Si(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&xi!==i&&(wi.current=i),Qo(null,r),eo||St({type:"setUi",ui:{rightSideBarVisible:!0}}),Wi(o)},Bi=(e,n,t)=>{const o=`${e}:${n}`;if(Br(n=>{if(!n.has(o)&&!n.has(e))return n;const t=new Set(n);return t.delete(o),t.delete(e),t}),!t)return;xi!==o&&(wi.current=o);Qo(null,{kind:t,nodeId:e,slot:n})},Ci=(e,n,t)=>{if(pt||!rr.moveSlot)return;const o=Si(e),r=o?vi(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:Qn,index:n},s=un(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=rr.moveSlot(e,n,s);"string"==typeof d&&Bi(e,d,i.panel)},Ni=hr(),Ii=In(()=>{const e=/* @__PURE__ */new Map;for(const n of Ni??[])e.set(n.slug,n.name);return e},[Ni]),Oi=e=>s(e,ui,pr.plainText,e=>Ii.get(e),pr.rowName),$i=(e,n)=>{const t=wt.components[e.type]?.fields,o=n===pe||Dl(n)?"section":"block",r=n===pe&&(At(e)||Tt(e)||It(e.type)),i="block"===o?d(t):r?null:c(t);return pr.renamePropOf?pr.renamePropOf(e,o,i):i},Pi=(e,n,t,o)=>{if(!(!pt&&Sr?.zone===e&&Sr.index===n))return;const r=(t,o)=>{vr(null),o&&((e,n,t)=>{const o=ki(e)[n];if(!o)return;const r=$i(o,e);r&&_t.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
|
|
9
|
+
return Un("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":Lt.rename,onClick:e=>e.stopPropagation(),onBlur:e=>r(e.currentTarget.value,!0),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),r(e.currentTarget.value,!0)):"Escape"===e.key&&(e.preventDefault(),r("",!1))}},t)},Ai=t(re(),Dt),Ti=Ai.scope({target:kn,siteId:tt,docId:Sn}),Mi=wt,ji=(e,n)=>n===pe?hi(e):ui(e),Li=(e,n,t)=>{const o=Ai.plan(Ti,t,ji(t.type,e),Mi);o&&(o.changed&&_t.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),Lr(o.message))},Ri=z({nodesIn:ki,nodeAt:(e,n)=>ki(e)[n]??null,labelOf:(e,n)=>n===pe?hi(e):ui(e),renamePropOf:$i,beginRename:(e,n)=>vr({zone:e,index:n}),history:{hasPast:vt.hasPast,hasFuture:vt.hasFuture,back:()=>vt.back(),forward:()=>vt.forward()},openAddSection:()=>{_t.select(null),qi(null)},openPageSettings:()=>{_t.select(null),Vo(Y)},pageSettingsLabel:Lt.pageSettings,words:{menu:Ht,styleClipboard:Dt,screen:Lt.menu},readOnly:Boolean(pt),collapseAll:()=>Br(new Set(ki(pe).map(e=>String(e.props.id)))),onPasteRefused:e=>Lr(e?Lt.pasteRefused({name:e.label}):Lt.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>Gl(e,n),menuRows:nr.menuRows,isLocked:e=>ir(e.type),duplicateBlocked:e=>lr(kt.data,e),permits:e=>ue(wt,e.type),canAddTo:cr,nodeOps:pi,isPinned:(e,n)=>n===pe&&(At(e)||Tt(e)),sectionBand:ri,openAddInside:(e,n)=>{e===pe?Ui(n):_t.select({zone:e,index:n}),qi(null)},locate:e=>gi.get(e)??null,rowNameOf:(e,n)=>n===pe?mi(e):Oi(e),selectAt:(e,n,t,o)=>{e===pe?Ui(n):vl(e,n,t,o??"")},slotRung:e=>{const n=bi(e);return n?.slot.panel?{label:n.slot.label,select:()=>zi(n.node,n.slot,!1)}:null},style:{held:()=>P(Ti),canCopy:e=>Ai.rows(Mi,e).some(e=>!1!==e.counted),copy:(e,n)=>Ai.copy(Ti,e,ji(e.type,n),Mi),paste:(e,n,t)=>Li(e,n,t)},keys:ht?{target:wo,selected:()=>{const e=kt.ui.itemSelector;return e?{zone:e.zone??pe,index:e.index}:null},held:()=>di.get(),readOnly:Boolean(pt),onDone:({done:e,name:n})=>{"copied"===e&&Lr(Lt.copied({name:n}))}}:void 0},xo),Ei=Nn({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});$n(()=>{Ei.current={copy:(e,n)=>Ai.copy(Ti,e,ji(e.type,n),Mi),paste:Li,at:()=>{const e=kt.ui.itemSelector;if(!e)return null;const n=e.zone??pe,t=ki(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(pt)}});const Vi=Pn(e=>{const n=A(e);if(!n)return;const t=Ei.current,o=t.at();o&&(e.preventDefault(),"copy"===n?t.copy(o.node,o.zone):t.readOnly||t.paste(o.zone,o.index,o.node))},[]);$n(()=>{if(!wo)return;const e=e=>Vi(e);return wo.addEventListener("keydown",e),()=>wo.removeEventListener("keydown",e)},[Vi,wo]),gn(xo,"keydown",Vi);const Fi=oi.map(e=>e.props.id).join("|");$n(()=>{const e=xo?.document??null,n=xo?.window??null;let t=0;const o=[],r=()=>{if(!e)return void Ro(e=>e.length?[]:e);const n=oi.findIndex(Tt),t=n>=0?n:oi.length,o=n=>{const t=oi[n]?.props?.id;return null==t?null:e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(mn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=oi.length>0&&!At(oi[0])?0:1;e<=t;e++){const n=o(e),t=o(e-1),l=n?.getBoundingClientRect()??null,s=t?.getBoundingClientRect()??null;if(!l&&!s)continue;const d=Zn(l&&s?(s.bottom+l.top)/2:l?0===e?l.top+12:l.top:s.bottom,Math.max(0===e?0:-1/0,...r(t).map(e=>e.bottom)),Math.min(1/0,...r(n).map(e=>e.top)));d&&i.push({...d,index:e})}Ro(e=>function(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t].top!==n[t].top||e[t].index!==n[t].index||e[t].height!==n[t].height)return!1;return!0}(e,i)?e:i)},i=()=>{cancelAnimationFrame(t),t=requestAnimationFrame(r)};if(!e||!n)return void r();n.addEventListener("scroll",i,{passive:!0});const l=new ResizeObserver(i);return l.observe(e.documentElement),r(),o.push(setTimeout(r,150),setTimeout(r,450)),()=>{cancelAnimationFrame(t),o.forEach(clearTimeout),n.removeEventListener("scroll",i),l.disconnect()}},[xo,Fi,lo,Jr,Qt,eo,bt?.props.id]);const Hi=xo?.document??null,Di=xo?.window??null;$n(()=>{const e=vo.current;if(!e||!Hi||!Di)return;const n=[],t=()=>{const n=Hi.querySelector(`[data-puck-component="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&Di.scrollTo({left:Di.scrollX,top:Di.scrollY+t,behavior:"instant"}),!0};return vo.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[Hi,Di]);const Wi=e=>{nr.holdCanvasOn?nr.holdCanvasOn(e):a(e)},Ui=e=>{Vo(Y),_t.select({index:e}),nr.sectionPressed?.(oi[e]);const n=oi[e]?.props?.id;n&&Wi(n)},Gi=e=>{const{floor:n,cap:t}=ri(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=bt&&Eo.kind!==Pt?.kind?oi.findIndex(e=>e.props.id===bt.props.id):-1;return o(r>=0?r+1:t)},Ji=(e,n)=>{const{floor:t,cap:o}=ri(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(_t.reorderComponent(pe,e,i),_t.select({index:i}),{moved:!0,dest:i})},Ki=(e,n,t,o)=>{Vo(Y),_t.select(o?{index:o.index,zone:o.zone}:{index:e}),a(n),Lr(Lt.sectionAdded({name:t}))},Xi=(e,n)=>{const t=Gi(n),o=dr(e,{nodeDefaults:fi,newNodeId:ke,sectionLabel:hi,blockIsOffered:ar}),r=o?_t.insertNode(pe,t,o):_t.insertSection(e,t);return Ki(t,r,hi(e),o?((e,n,t)=>{if(e.type===t)return null;const o={at:null},r=(e,n,i)=>{const l=i.filter(n=>n===e.type).length;for(const{child:s,zone:d,index:c}of he(wt,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=cr(e.type,l,d.slice(d.lastIndexOf(":")+1)),i=r?.choices??(r?.spec?[{type:r.spec.childType,label:r.spec.childType}]:[]);null!==r&&"footer"!==r.source&&`${e.props.id}:${r.slot}`===d&&i.some(e=>e.type===t)&&(o.at={zone:d,index:c,depth:n})}r(s,n+1,[...i,e.type])}};return r({type:e.type,props:{...e.props,id:n}},1,[]),o.at?{zone:o.at.zone,index:o.at.index}:null})(o,r,e):null),t},Yi=(e,n,t)=>{const o=Gi(t),r=_t.insertNode(pe,o,n);return Ki(o,r,e),o},qi=e=>_i(pe,e),_i=(e,n)=>{Mr.current=document.activeElement??null,po&&($o.current=Po.current,Po.current=!1,uo()),To(null===n?null:{zone:e,index:n}),Oo(!0),Qt||($o.current=!0,St({type:"setUi",ui:{leftSideBarVisible:!0}}))},Zi=()=>{Oo(!1),To(null),$o.current&&St({type:"setUi",ui:{leftSideBarVisible:!1}}),$o.current=!1},Qi=(e,n,t)=>{const o="section"===e.kind?e.type:"template"===e.kind?e.template.node.type:null;if(o&&Wl(n,o)){if("section"===e.kind)_t.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;_t.insertNode(n,t,si(e.template.node))}Vo(Y),_t.select({index:t,zone:n})}},el=(e,n)=>pr.rowName?n?At(e)?pr.rowName(e,"section",Lt.header):Tt(e)?pr.rowName(e,"section",Lt.footer):It(e.type)?pr.rowName(e,"section",ui(e.type)):mi(e):Oi(e):n?hi(e.type):ui(e.type),nl=e=>n=>{e()},tl=()=>nr.editPinnedSource?.(),ol=(e,n,t)=>{if(pt)return null;const o=ki(e)[n];return o&&!ue(wt,o.type).delete?null:/* @__PURE__ */Un(Te,{kind:"delete",label:Lt.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=ki(e)[n]?.props?.id;null!=t&&ai(String(t))})(e,n),children:/* @__PURE__ */Un(Fn,{size:15})})},rl=e=>pr.rowPreview?.(e)||void 0,il=e=>pr.rowMarks?.(e)??void 0,ll=(e,n,t)=>pr.rowActions?.(e,n,t)??null,sl=(e,n,t,o)=>{if(pt)return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
|
|
10
|
+
return Un(Te,{kind:"eye",label:r?Lt.showNamed({name:o}):Lt.hideNamed({name:o}),onClick:()=>cl(e,n,t),children:/* @__PURE__ */Un(r?Hn:Dn,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},dl=e=>{const n=hi(oi[e]?.type??""),t=n?Lt.addSectionBefore({name:n}):Lt.addSectionHere;return vs(pe,e,()=>qi(e),t)},cl=(e,n,t)=>{_t.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},al=e=>me(wt,e),pl=e=>he(wt,e),ul=e=>rr.slotsOf?vi(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:ge(e,n.slot)})):[{slot:null,rung:null,kids:pl(e)}],fl=e=>rr.slotsOf?ul(e).flatMap(e=>e.kids):pl(e),hl=e=>Boolean(rr.slotsOf)&&vi(e).some(e=>e.rung),ml=(e,n,t)=>null===t?void 0===n?cr(e):cr(e,n):cr(e,n,t),gl=(e,n,t)=>{const o=ye(wt,e.type,n)&&(t||fl(e).length>0||hl(e));return{collapsible:o,folded:o&&Pr(String(e.props.id))}},yl=(e,n,t)=>ul(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>gl(e,r,t(e.type)).collapsible?[String(e.props.id),...yl(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),kl=e=>fl(e).length>0||hl(e)||Boolean(cr(e.type)),Sl=e=>Boolean(cr(e)),vl=(e,n,t,o)=>{if(Vo(Y),cr(o)?.spec?.slider){const t=e.split(":")[0];p(t,n),_t.select({index:n,zone:e}),a(t)}else _t.select({index:n,zone:e}),Wi(t)},bl=(e,n,t,o,r)=>{const i=`${e}:${n}`;_t.insertComponent(i,t,o),cr(r)?.spec?.slider?requestAnimationFrame(()=>{p(e,o),_t.select({index:o,zone:i})}):_t.select({index:o,zone:i})},xl=(e,n,t)=>{_t.insertComponent(e,n,t),Vo(Y),_t.select({index:t,zone:e})},wl=Nn(/* @__PURE__ */new Set);$n(()=>{oi.forEach(e=>{const n=cr(e.type)?.spec;if(!n)return;const t=e.props.id;if(wl.current.has(t))return;wl.current.add(t);if((Array.isArray(e.props[n.slot])?e.props[n.slot]:[]).length>0)return;if(n.skipSeed?.(e.props))return;const o=`${t}:${n.slot}`,r=n.legacy?.(e.props)??[];(r.length?r:n.seeds(fi)).forEach((e,t)=>Xt.seedChild(o,t,n.childType,e))})},[oi,Xt,fi]);const zl=Nn(/* @__PURE__ */new Set);$n(()=>{oi.forEach((e,t)=>{const o=e.props.id;if(zl.current.has(o))return;const r=n(e,al(e.type));zl.current.add(o),r&&Xt.replaceComponent(pe,t,{...e,props:r})})},[oi,Xt]),ie(Xt,wt);const Bl=oi.findIndex(Tt),Cl=Bl>=0?oi[Bl]:null,Nl=Mt?oi.findIndex(At):-1,Il=Nl>=0?oi[Nl]:null,Ol=zt.groupTab,$l=In(()=>Ol?e=>It(e.type):void 0,[Ol]),Pl=Boolean(zt.groupBadge),Al=zt.groupBadge?/* @__PURE__ */Un("span",{className:"es-tree-group-badge",children:/* @__PURE__ */Un(Mn,{tone:"info",size:"xs",children:zt.groupBadge})}):void 0,Tl=oi.find(e=>e.type===Ct)??null,Ml=oi.find(e=>e.type===Nt)??null,jl=Bl>=0?Bl:oi.length,Ll=[];oi.forEach(e=>{Tt(e)||(kl(e)&&Ll.push(String(e.props.id)),Ll.push(...yl(e,1,Sl)))}),Cl&&(Ll.push(String(Cl.props.id)),Ll.push(...yl(Cl,1,Sl)));const Rl=Ll.length>0&&Ll.every(e=>zr.has(e)),El=e=>{const n=pr.blockRowName(e,ui);return pr.rowName?pr.rowName(e,"block",n):n},Vl=(e,n,t,o)=>{const r=ki(e)[t];if(!r)return;const i={...zn(e),index:t},l={...zn(n),index:Math.min(Math.max(o,0),ki(n).length)},s=un(i,l);if(e!==n||s!==t)try{ci.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof Cn))throw e}},Fl=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of pl(e))n.add(r),t(o)};for(const t of al(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},Hl=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=gi.get(n);if(!e)return null;if(e.zone===pe)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},Dl=e=>{const n=e.slice(0,e.indexOf(":")),t=oi.find(e=>It(e.type)&&String(e.props.id)===n);return t&&Ot(n)===e?t:null},Wl=(e,n)=>{const t=Dl(e);return!t||(!zt.groupAccepts||zt.groupAccepts(t.type,n,ki(e).length))},Ul=(e,n,t)=>{if(e.rung){const t=Si(e.rung.nodeId),o=t?vi(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===Qn&&n.index>=0&&n.index<=o}if(n.slot===Qn)return!1;if(e.add)return Kl(e.add,n);const o=bn(n);if(It(e.type))return!1;const r=Dl(o),i=Dl(e.zone);if(r||i)return!(!r||!i)&&(!(r!==i&&!Wl(o,e.type))&&(n.index>=0&&n.index<=ki(o).length));if(e.zone===pe||o===pe){if(e.zone!==o)return!1;const{floor:t,cap:r}=ri();return n.index>=t&&n.index<=r}if(n.index<0||n.index>ki(o).length)return!1;if(e.zone===o)return!0;const l=Cl&&!zt.lastIsOpen?String(Cl.props.id):null;return(!l||Hl(e.zone)!==l&&Hl(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??ki(e)[t];if(!r)return!1;const i=n.split(":")[0],l=gi.get(i),s=l?ki(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&Fl(r).has(n))return!1;const d=cr(s.type,sr(kt?.data,s.type,i),n.slice(n.lastIndexOf(":")+1));return!!d&&(!!(d.choices?d.choices.some(e=>e.type===r.type):d.spec?.childType===r.type)&&!d.spec?.addBlocked?.(ki(n),r))})(e.zone,o,e.index,t)},Gl=(e,n)=>{const t=bn(e.from),o=e.node;return t===bn(n)?Wl(t,o.type):Ul({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},Jl=e=>{const n=e.slice(0,e.indexOf(":")),t=gi.get(n),o=t?ki(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=cr(o.type,sr(kt?.data,o.type,n),e.slice(e.lastIndexOf(":")+1));if(!r||`${n}:${r.slot}`!==e)return null;if("footer"===r.source)return null;const i=r.choices??(r.spec?[{type:r.spec.childType,label:ui(r.spec.childType)}]:[]),l=bi(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:el(o,t.zone===pe)}},Kl=(e,n)=>{const t=bn(n);if("block"!==e.kind){if(Dl(t)){const o="section"===e.kind?e.type:e.template.node.type;return Wl(t,o)&&n.index>=0&&n.index<=ki(t).length}if(t!==pe)return!1;const{floor:o,cap:r}=ri();return n.index>=o&&n.index<=r}if(t===pe)return!1;const o=Jl(t);return!(!o||!o.choices.some(n=>n.type===e.type))&&!o.target.spec?.addBlocked?.(ki(t))},Xl=(e,n)=>{e.rung?Ci(e.rung.nodeId,e.index,n.index):e.add?((e,n)=>{if("block"!==e.kind&&Dl(bn(n)))return void Qi(e,bn(n),n.index);if("section"===e.kind)return void Xi(e.type,n.index);if("template"===e.kind)return void Yi(e.template.name,si(e.template.node),n.index);const t=bn(n),o=Jl(t);o&&(o.target.spec?bl(o.parentId,o.target.slot,e.type,n.index,o.parent.type):xl(t,e.type,n.index))})(e.add,n):e.zone===pe?Ji(e.index,n.index):Vl(e.zone,bn(n),e.index,n.index)},[Yl]=On(()=>an()),ql=pn({keyOf:e=>e.id,readOnly:Boolean(pt),session:Yl,canDrop:Ul,onDrop:Xl,onStep:(e,n)=>{e.rung?Ci(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===pe?((e,n)=>{const t=hi(oi[e]?.type??""),o=Ji(e,n<0?e-1:e+2);if(!o.moved)return void Lr(n<0?Lt.sectionFirst({name:t}):Lt.sectionLast({name:t}));const{floor:r,cap:i}=ri();Lr(Lt.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):Vl(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),_l=Pn(e=>{const{floor:n,cap:t}=ri(),o=[];for(const r of e.nodes){const e=bn(r.place),i=ki(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(At(i)||Tt(i)||ir(i.type))continue;if(It(i.type))continue;const l=Boolean(Dl(e)),s=e===pe||l;e===pe&&t-n<2||o.push({key:r.id,item:{id:r.id,zone:e,index:r.place.index,type:i.type},box:r.box,label:s?hi(i.type):Oi(i),from:r.place})}const r=e.zones.flatMap(e=>{const n=bn(e.list);return n===pe&&0===e.children.length?[{...e,addLabel:Lt.addSection,addAlways:!0}]:e.children.length>0||Boolean(Jl(n)?.choices.length)||Boolean(Dl(n))?[e]:[]}),i=r.flatMap(e=>{const n=bn(e.list);return n===pe||Dl(n)||!Jl(n)?.choices.length?[]:ln(e,Lt.addBlockHere)});return{sources:o,zones:r,seams:i}},[kt.data]),Zl=null==bt?.props.id?null:String(bt.props.id),Ql=Pn(e=>{const n=wt,t=e=>!e.item.rung&&null!==Bn(kt.data,n,e.item.id),o=e[e.length-1];if(!t(o))return o;const r=n=>e.find(e=>t(e)&&e.item.id===n),i=r(Zl);return i||(r(Ve(kt.data,n,o.item.id,Zl,$l))??o)},[kt.data,wt,Zl,$l]),[es,ns]=On(null);gn(xo,"mouseover",e=>{if(!Ol)return;const n=yn(e.target),t=n?Xn(kt.data,wt,n):null;t!==es&&ns(t)}),gn(xo,"mouseout",e=>{Ol&&!e.relatedTarget&&ns(null)});const ts=e=>At(e)||Tt(e)||It(e.type),os=[];if(Ol){const e=Zl?Xn(kt.data,wt,Zl):null;for(const n of/* @__PURE__ */new Set([e,es])){const e=n?oi.find(e=>String(e.props.id)===n):void 0;if(!e||!ts(e))continue;const t=Ol(e);t&&os.push({id:String(e.props.id),label:t,below:At(e)||e.type===Ct})}}const rs=R(),is=Nn(null);$n(()=>{const e=zt.changeNotice;if(!e)return;const n=JSON.stringify(oi.filter(ts)),t=is.current;if(is.current={doc:Sn,bands:n,index:vt.index},!t||t.doc!==Sn||t.bands===n)return;vt.hasPast&&vt.index>=t.index&&!Kn.has(rs)&&(Kn.add(rs),Lr(e,"success",{action:{label:Lt.bar.undo,onClick:()=>vt.back()},duration:8e3}))},[oi]);const ls=e=>{Vo(Y),_t.select(e.zone===pe?{index:e.index}:{index:e.index,zone:e.zone})},ss=le(),ds=()=>({data:kt.data,device:lo,ops:_t,inspector:er}),cs=ss?.model,as=In(()=>cs?e=>cs(e,_l(e),ds()):_l,[cs,_l,lo]),ps=ss?.measure,us=ps?(e,n)=>ps(e,n,ds()):void 0,fs=ss?.canDrop,hs=fs?(e,n)=>fs(e,n,Ul,ds()):Ul,ms=ss?.drop,gs=ms?(e,n)=>ms(e,n,Xl,ds()):Xl,ys=ss?.pick,ks=ys?e=>ys(e,ls,ds()):ls,Ss=e=>{const n=bn(e),t=bi(n);t&&zi(t.node,t.slot,!1),_i(n,e.index)},vs=(e,n,t,o)=>/* @__PURE__ */Un(Me,{...pt?{}:ql.seam({place:{...zn(e),index:n}}),onAdd:pt?void 0:t,label:o},`seam:${e}:${n}`),bs={rowClick:nl,isCollapsed:Pr,toggleCollapse:Ar},xs=e=>{const n=String(e.props.id),t=oi.findIndex(e=>String(e.props.id)===n),o=Ot(n),r=ki(o),i=Pr(n),l=ui(e.type),s=pr.rowName?pr.rowName(e,"section",l):l,d=e=>vs(o,e,()=>_i(o,e),Lt.addSectionHere);/* @__PURE__ */
|
|
11
|
+
return Gn(Jn,{children:[
|
|
12
|
+
/* @__PURE__ */Un(Oe,{words:Rt,icon:/* @__PURE__ */Un(fr,{type:e.type,size:13}),name:s,preview:rl(e),marks:il(e),onSelect:()=>Ui(t),nameSlot:Pi(pe,t,n,s),selected:Go===n,badge:Al,actions:ll(e,pe,t)??void 0,rowProps:{"data-node-id":n,onClick:nl(()=>Ui(t))},fold:{open:!i,label:"section",onToggle:()=>Ar(n)}}),!i&&/* @__PURE__ */Gn($e,{children:[r.map((n,t)=>{const r=String(n.props.id),i=mi(n),l=kl(n),s=l&&Pr(r),c=()=>vl(o,t,r,e.type),{rowProps:a,...p}=ql.row({item:{id:r,zone:o,index:t,type:n.type},place:{...zn(o),index:t}},{"data-node-id":r,onClick:nl(c)});/* @__PURE__ */
|
|
13
|
+
return Gn(Tn,{children:[d(t),
|
|
14
|
+
/* @__PURE__ */Un(Oe,{words:Rt,icon:/* @__PURE__ */Un(fr,{type:n.type,size:13}),name:i,preview:rl(n),marks:il(n),onSelect:c,nameSlot:Pi(o,t,r,i),selected:Go===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Ar(r)}:void 0,actions:/* @__PURE__ */Gn(Jn,{children:[ol(o,t,i),ll(n,o,t),sl(o,t,n,i)]}),rowProps:a}),l&&!s&&/* @__PURE__ */Un($e,{children:Bs(n,2)})]},r)}),d(r.length)]})]})},ws=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=ql.dragging,d=!Pr(l)&&s?.rung?.nodeId!==i,c={...zn(l),index:0},a=s&&!s.rung&&Ul(s,c)?c:void 0,p=()=>zi(e,n,!0),{rowProps:u,...f}=ql.row({item:{id:`rung:${l}`,zone:`${i}:${Qn}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:Qn,index:t},into:a,canDrag:Boolean(rr.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:nl(p)}),h=pt?null:rr.slotActions?.(e,n.slot);/* @__PURE__ */
|
|
15
|
+
return Gn(Tn,{children:[n.heading,
|
|
16
|
+
/* @__PURE__ */Un(Oe,{words:Rt,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:xi===l,...f,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>Ar(l)},actions:h&&h.length>0?/* @__PURE__ */Un(Jn,{children:h.map((t,o)=>/* @__PURE__ */Un(Te,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(pt||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&Bi(o,e,n.panel)},i=t.run();i&&"function"==typeof i.then?i.then(r):r(i)})(e,n,t),children:"delete"===t.kind?/* @__PURE__ */Un(Fn,{size:15}):/* @__PURE__ */Un(Wn,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */Un($e,{children:r})]},l)},zs=(e,n)=>{const t=ul(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
|
|
17
|
+
return Un(Jn,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=ml(e.type,void 0,t.slot),d=s?`${e.props.id}:${s.slot}`:null,c=null===t.slot?null:`${e.props.id}:${t.slot}`,a=null!==c&&Boolean(Jl(c)?.choices.length),p=(e,n)=>a?vs(e,n,()=>_i(e,n),Lt.addBlockHere):vs(e,n),u=/* @__PURE__ */Gn(Jn,{children:[i.map(({child:n,zone:t,index:o})=>{const r=Go===String(n.props.id),{collapsible:i,folded:s}=gl(n,l,Sl(n.type)),d=String(n.props.id),c=El(n),a=()=>vl(t,o,d,e.type),{rowProps:u,...f}=ql.row({item:{id:d,zone:t,index:o,type:n.type},place:{...zn(t),index:o}},{"data-node-id":d,onClick:nl(a)});/* @__PURE__ */
|
|
18
|
+
return Gn(Tn,{children:[0===o&&p(t,0),
|
|
19
|
+
/* @__PURE__ */Un(Oe,{words:Rt,icon:/* @__PURE__ */Un(fr,{type:n.type,size:13}),name:c,preview:rl(n),marks:il(n),onSelect:a,nameSlot:Pi(t,o,d,c),selected:r,hidden:Boolean(n.props._hidden),...f,fold:i?{open:!s,label:"group",onToggle:()=>Ar(d)}:void 0,actions:/* @__PURE__ */Gn(Jn,{children:[ol(t,o,c),ll(n,t,o),sl(t,o,n,c)]}),rowProps:u}),i&&!s&&/* @__PURE__ */Un($e,{children:zs(n,l+1)}),p(t,o+1)]},String(n.props.id??`${t}-${o}`))}),null===c?d&&!i.some(e=>e.zone===d)?p(d,0):null:0!==i.length||!t.rung&&d!==c?null:p(c,0)]});return t.rung?ws(e,t.rung,r++,o,u):/* @__PURE__ */Un(Tn,{children:u},t.slot??"")})})},Bs=(e,n)=>{const t=sr(kt?.data,e.type,String(e.props.id)),o=ul(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
|
|
20
|
+
return Un(Jn,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=ml(e.type,t,o.slot),c=d?.spec??null,a=c&&Array.isArray(e.props[c.slot])?e.props[c.slot]:[],p=d&&d.choices?{slot:d.slot,choices:d.choices}:null,u=String(e.props.id),f=c&&!c.fixed?`${u}:${c.slot}`:null,h=p?`${u}:${p.slot}`:null,m=(n,t)=>{const o=n===f&&c&&!c.addBlocked?.(a)?()=>bl(e.props.id,c.slot,c.childType,t,e.type):n===h?()=>_i(n,t):void 0;return vs(n,t,o,n===f&&c?c.addLabel:Lt.addBlockHere)},g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(c&&!c.fixed&&(null===g||g===f)),k=/* @__PURE__ */Gn(Jn,{children:[l.map(({child:n,zone:t,index:o})=>{const r=Go===String(n.props.id),i=Oi(n),l=String(n.props.id),{collapsible:d,folded:c}=gl(n,s,Sl(n.type)),a=al(n.type),p=1===a.length?`${l}:${a[0]}`:null,u=p?{...zn(p),index:ki(p).length}:void 0,f=ql.dragging,h=u&&f&&Ul(f,u)?u:void 0,g=()=>vl(t,o,l,e.type),{rowProps:y,...k}=ql.row({item:{id:l,zone:t,index:o,type:n.type},place:{...zn(t),index:o},into:h,canDrag:!ir(n.type)},{"data-node-id":l,onClick:nl(g)});/* @__PURE__ */
|
|
21
|
+
return Gn(Tn,{children:[0===o&&m(t,0),
|
|
22
|
+
/* @__PURE__ */Un(Oe,{words:Rt,icon:/* @__PURE__ */Un(fr,{type:n.type,size:13}),name:i,preview:rl(n),marks:il(n),onSelect:g,nameSlot:Pi(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...k,fold:d?{open:!c,label:"group",onToggle:()=>Ar(l)}:void 0,actions:ir(n.type)?ll(n,t,o)??void 0:/* @__PURE__ */Gn(Jn,{children:[ol(t,o,i),ll(n,t,o),sl(t,o,n,i)]}),rowProps:y}),d&&!c&&/* @__PURE__ */Un($e,{children:Bs(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&c&&
|
|
23
|
+
/* @__PURE__ */Un(T,{small:!0,label:c.addLabel,blocked:c.addBlocked?.(a)??null,onAdd:()=>bl(e.props.id,c.slot,c.childType,a.length,e.type)}),null===g?h&&!l.some(e=>e.zone===h)?m(h,0):null:0!==l.length||(o.rung?y:g!==h)?null:m(g,0)]});return o.rung?ws(e,o.rung,i++,r,k):/* @__PURE__ */Un(Tn,{children:k},o.slot??"")})})},Cs=(()=>{if(!bt||!Fo)return null;const e=String(bt.type),n=String(bt.props.id),t=cr(e,sr(kt?.data,e,n));if(!t||"footer"===t.source)return null;const o=oi.some(e=>String(e.props?.id)===n),r=Array.isArray(bt.props[t.slot])?bt.props[t.slot]:[];if(t.spec?.addBlocked?.(r))return null;const i=t.choices??(t.spec?[{type:t.spec.childType,label:ui(t.spec.childType)}]:[]);return 0===i.length?null:{parentName:el(bt,o),choices:i,onPick:o=>{t.spec?bl(n,t.slot,o,r.length,e):xl(`${n}:${t.slot}`,o,r.length)}}})(),Ns=Wo&&Wo.zone!==pe&&!Dl(Wo.zone)?Wo.zone:null,Is=!0===Mo.blocksFirst,Os=Ns?Jl(Ns):Is&&Wo?null:Cs,$s=Wo&&Dl(Wo.zone)?Wo.zone:null,Ps=$s&&zt.groupAccepts?e=>Wl($s,e):void 0,As=Boolean(Ao&&Ns)||Is&&Boolean(Os&&Os.choices.length>0),Ts=Io||null!==po,Ms=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:Qt&&!Ts&&or===e.id,onSelect:()=>Qr(e.id)}:e,js=[{id:"add",label:Lt.add.title,icon:/* @__PURE__ */Un("span",{className:"sf-rail-plus","aria-hidden":"true",children:"+"}),active:Io,onSelect:()=>Io?Zi():qi(null)},...(nr.railLead??[]).map(Ms),{id:"sections",label:Lt.layers,icon:/* @__PURE__ */Un(Fe,{}),active:Qt&&!Ts&&"sections"===or,onSelect:()=>Qr("sections")},...(nr.railTrail??[]).map(Ms)];ao?js.push({id:"media",label:Lt.railMedia,icon:/* @__PURE__ */Un(He,{}),active:Qt&&!Io&&(null!==po||"media"===or),onSelect:()=>Qr("media")}):mt&&js.push({id:"media",label:Lt.railMedia,icon:/* @__PURE__ */Un(He,{}),onSelect:ei});const Ls=[...nr.railLead??[],...nr.railTrail??[]].find(e=>"panel"in e&&e.id===or),Rs=Boolean(jt?.foldable)&&!tr,Es=jt?.label??(gt?Lt.pageSections:Lt.templateSections),Vs=Rs&&Pr(et),Fs=/* @__PURE__ */Gn(Jn,{children:[oi.map((e,n)=>{if(At(e)||Tt(e)||It(e.type))return null;const t=Go===String(e.props.id),o=Boolean(e.props._hidden);pl(e);const r=String(e.props.id),i=nr.hasOwnRows?.(e)??!1,l=kl(e)||i,s=l&&Pr(r),d=al(e.type),c=1===d.length?`${r}:${d[0]}`:null,a=c?{...zn(c),index:ki(c).length}:void 0,p=ql.dragging,u=a&&p&&Ul(p,a)?a:void 0,{rowProps:f,...h}=ql.row({item:{id:r,zone:pe,index:n,type:e.type},place:{...zn(pe),index:n},into:u},{"data-node-id":r,onClick:nl(()=>Ui(n))});/* @__PURE__ */
|
|
24
|
+
return Gn(Tn,{children:[n>0&&dl(n),
|
|
25
|
+
/* @__PURE__ */Un(Oe,{words:Rt,icon:/* @__PURE__ */Un(fr,{type:e.type,size:13}),name:mi(e),preview:rl(e),marks:il(e),onSelect:()=>Ui(n),nameSlot:Pi(pe,n,r,mi(e)),selected:t,hidden:o,...h,fold:l?{open:!s,label:"section",onToggle:()=>Ar(r)}:void 0,actions:/* @__PURE__ */Gn(Jn,{children:[ol(pe,n,mi(e)),ll(e,pe,n),sl(pe,n,e,mi(e))]}),rowProps:f}),kl(e)&&!s&&/* @__PURE__ */Gn($e,{children:[Bs(e,1),nr.partRows?.(e,bs)]}),i&&!s&&/* @__PURE__ */Un($e,{children:nr.ownRows?.(e,n,bs)})]},String(e.props.id??n))}),!tr&&jl>0&&dl(jl),jt?.addAtEnd&&!tr&&!pt&&/* @__PURE__ */Un(T,{small:!0,label:Lt.addSection,blocked:null,onAdd:()=>qi(jl)})]}),Hs=(e,n,t)=>{const o=String(e.props.id),r=fl(e).length>0||hl(e)||Boolean(cr(e.type)),i=r&&Pr(o),l="header"===t?Lt.header:Lt.footer,s=pr.rowName?pr.rowName(e,"section",l):l;/* @__PURE__ */
|
|
26
|
+
return Gn(Jn,{children:[
|
|
27
|
+
/* @__PURE__ */Un(Oe,{words:Rt,icon:/* @__PURE__ */Un(fr,{type:t,size:13}),name:s,preview:rl(e),marks:il(e),badge:Al,onSelect:()=>Ui(n),nameSlot:Pi(pe,n,o,s),selected:Go===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Ar(o)}:void 0,actions:ll(e,pe,n)??void 0,rowProps:{"data-node-id":o,onClick:nl(()=>Ui(n))}}),r&&!i&&/* @__PURE__ */Un($e,{children:zs(e,1)})]})};return(nr.wrap??(e=>e))(
|
|
28
|
+
/* @__PURE__ */Un(se,{target:xo,children:/* @__PURE__ */Gn("div",{ref:bo,className:"sf-editor es-editor",style:Ze(Cr),onContextMenu:Ri.onEditorContextMenu,...g(hn),children:[
|
|
29
|
+
/* @__PURE__ */Gn(De,{children:[
|
|
30
|
+
/* @__PURE__ */Un(We,{items:js,ariaLabel:Lt.bar.views}),
|
|
31
|
+
/* @__PURE__ */Gn(Ue,{children:[
|
|
32
|
+
/* @__PURE__ */Un(Ge,{label:Lt.bar.undo,disabled:Boolean(pt)||!vt.hasPast,onClick:()=>vt.back(),children:/* @__PURE__ */Un(Rn,{})}),
|
|
33
|
+
/* @__PURE__ */Un(Ge,{label:Lt.bar.redo,disabled:Boolean(pt)||!vt.hasFuture,onClick:()=>vt.forward(),children:/* @__PURE__ */Un(En,{})}),
|
|
34
|
+
/* @__PURE__ */Un(Je,{}),
|
|
35
|
+
/* @__PURE__ */Un(Ke,{devices:no,value:lo,onChange:so}),
|
|
36
|
+
/* @__PURE__ */Un(Ge,{label:Lt.bar.refresh,tip:Lt.bar.refreshTip,onClick:()=>{vo.current=(()=>{const e=xo?.document;if(!e)return null;const n=oi.findIndex(Tt),t=n>=0?n:oi.length;let o=null;for(let n=0;n<t;n++){const t=oi[n]?.props?.id;if(null==t)continue;const r=e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`);if(!r)continue;const i=r.getBoundingClientRect().top;i<=4&&(null===o||i>o.offset)&&(o={id:String(t),offset:i})}if(!o){const e=bt?.props?.id??oi[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),So(e=>e+1)},children:/* @__PURE__ */Un(Vn,{})})]}),
|
|
37
|
+
/* @__PURE__ */Gn(Ue,{kind:"right",style:{minWidth:300},children:[
|
|
38
|
+
/* @__PURE__ */Un(C,{input:Co,words:Lt.saveStatus}),nr.barLead?.(),nr.barTrail?.(),nr.mainAction||!nr.barMain?/* @__PURE__ */Un(N,{input:Co,action:nr.mainAction??{label:Lt.done,onPress:()=>{ot(kt.data)}},readOnly:Boolean(pt),saveSwitch:ft,onToggleAutoSave:st,onSaveNow:No,bar:Lt.bar,words:Lt.saveStatus}):nr.barMain()]})]}),
|
|
39
|
+
/* @__PURE__ */Un(B,{}),
|
|
40
|
+
/* @__PURE__ */Gn("div",{className:"sf-body",children:[Qt?/* @__PURE__ */Gn(Jn,{children:[
|
|
41
|
+
/* @__PURE__ */Un("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":Lt.leftPanel,children:Io?/* @__PURE__ */Un(M,{blocks:Os,blocksOnly:As,sectionAccepts:Ps,at:Ao?{label:(e=>{const n=Dl(e.zone);if(n)return Lt.add.addingTo({name:pr.rowName?el(n,!0):ui(n.type)});if(e.zone===pe){const n=oi[e.index];return n&&!Tt(n)?Lt.add.addingBefore({name:el(n,!0)}):Lt.add.addingAtEnd}const t=Jl(e.zone);return t?Lt.add.addingTo({name:t.parentName}):Lt.add.addingHere})(Ao),onClear:()=>To(null)}:void 0,onAdd:e=>{const n=Wo,t=(e,n)=>{Ao&&To({zone:e,index:n})};if(n&&"block"!==e.kind&&Dl(n.zone))return Qi(e,n.zone,n.index),void t(n.zone,n.index+1);if("section"===e.kind)return(e=>{if(null===Uo)return void Xi(e);const n=Xi(e,Uo);Ao&&jo(n+1)})(e.type);if("template"===e.kind)return((e,n)=>{if(null===Uo)return void Yi(e,n);const t=Yi(e,n,Uo);Ao&&jo(t+1)})(e.template.name,si(e.template.node));if(n&&n.zone!==pe){const o=Jl(n.zone);if(!o)return;return o.target.spec?bl(o.parentId,o.target.slot,e.type,n.index,o.parent.type):xl(n.zone,e.type,n.index),void t(n.zone,n.index+1)}Cs?.onPick(e.type)},itemFor:e=>({id:`new:${e.kind}:${"template"===e.kind?e.template.id:e.type}`,zone:"",index:-1,type:"template"===e.kind?e.template.node.type:e.type,add:e}),session:Yl,siteWide:nr.addPanelRow?.(Zi),onClose:Zi,onHide:_r,readOnly:Boolean(pt)}):po&&co?
|
|
42
|
+
/* @__PURE__ */Un(E,{panel:co,pick:po,onHide:_r}):Ls?Ls.panel({onHide:_r,notify:Lr}):"media"===or&&co?/* @__PURE__ */Un(E,{panel:co,pick:null,onHide:_r}):/* @__PURE__ */Gn(Jn,{children:[
|
|
43
|
+
/* @__PURE__ */Un(j,{icon:/* @__PURE__ */Un(Fe,{}),title:Lt.layers,context:Ut,actions:
|
|
44
|
+
/* @__PURE__ */Un(Xe,{label:Rl?Lt.expandAll:Lt.collapseAll,title:0===Ll.length?Lt.nothingToFold:void 0,disabled:0===Ll.length,onClick:()=>Br(e=>{const n=new Set(Ll);return Rl?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...Ll])}),children:/* @__PURE__ */Un(qn,{expand:Rl})}),onHide:_r}),
|
|
45
|
+
/* @__PURE__ */Gn(Pe,{className:"sf-tree sf-scroll",words:Rt,children:[
|
|
46
|
+
/* @__PURE__ */Un(Oe,{words:Rt,icon:/* @__PURE__ */Un(fr,{type:"page",size:13}),name:Lt.pageSettings,onSelect:ni,selected:!bt&&Fo,rowProps:{onClick:nl(ni)}}),Tl&&/* @__PURE__ */Gn(Jn,{children:[!Pl&&/* @__PURE__ */Un(Ae,{children:Lt.header}),xs(Tl)]}),!tr&&yt&&!(Pl&&Tl)&&/* @__PURE__ */Gn(Jn,{children:[!Pl&&/* @__PURE__ */Un(Ae,{children:Lt.header}),!Mt&&/* @__PURE__ */Un(Oe,{words:Rt,icon:/* @__PURE__ */Un(fr,{type:"header",size:13}),name:Lt.header,badge:Al,onSelect:ti,selected:Eo.kind===Pt?.kind,rowProps:{onClick:nl(ti)}})]}),!tr&&Il&&!(Pl&&Tl)&&Hs(Il,Nl,"header"),!tr&&!Rs&&/* @__PURE__ */Un(Ae,{children:Es}),Rs?/* @__PURE__ */Gn(Jn,{children:[
|
|
47
|
+
/* @__PURE__ */Un(Oe,{words:Rt,icon:null,name:Es,fold:{open:!Vs,label:Es,onToggle:()=>Ar(et)}}),!Vs&&/* @__PURE__ */Un($e,{children:Fs})]}):Fs,yt&&!Pl&&/* @__PURE__ */Un(Ae,{children:Lt.footer}),Cl&&!(Pl&&Ml)&&Hs(Cl,Bl,"footer"),!tr&&!Cl&&yt&&!Pl&&/* @__PURE__ */Un(Oe,{words:Rt,icon:/* @__PURE__ */Un(fr,{type:"footer",size:13}),name:Lt.footer,onSelect:tl,rowProps:{onClick:nl(tl),title:Lt.editFooter}}),Ml&&xs(Ml),nr.treeFoot?.()]})]})}),
|
|
48
|
+
/* @__PURE__ */Un(Ye,{side:"left",width:Cr.left,min:_e,max:qe,defaultWidth:S.left,label:Lt.resizeLeftPanel,onResize:Or})]}):/* @__PURE__ */Un(L,{side:"left",onShow:_r}),
|
|
49
|
+
/* @__PURE__ */Gn("div",{ref:Rr,className:"sf-center sf-scroll","data-sf-canvas-head":Dr?"":void 0,style:{overflowX:Xr?"auto":"hidden",overflowY:"hidden"},children:[Dr&&/* @__PURE__ */Un("div",{ref:Wr,className:"sf-canvas-head",children:/* @__PURE__ */Un(Dr,{device:lo})}),
|
|
50
|
+
/* @__PURE__ */Gn("div",{className:"sf-frame-scaler",style:Yr,children:[
|
|
51
|
+
/* @__PURE__ */Un("div",{className:"sf-frame "+(lo===ro?"":`sf-frame--${lo}`),style:qr,children:/* @__PURE__ */Gn("div",{className:"sf-preview-host",children:[
|
|
52
|
+
/* @__PURE__ */Un(Ie.Provider,{value:$l,children:/* @__PURE__ */Un(Gt,{},ko)}),
|
|
53
|
+
/* @__PURE__ */Un(sn,{canvas:xo,session:Yl,model:as,measure:us,canDrop:hs,onDrop:gs,choose:Ql,onPick:ks,onZoneAdd:Ss,onSeamAdd:Ss,zoneAddLabel:Lt.canvasAddBlock,words:Et.canvas,readOnly:Boolean(pt),revision:kt.data}),Lo.length>0&&/* @__PURE__ */Un("div",{className:"sf-preview-gaps",children:Lo.map(e=>
|
|
54
|
+
/* @__PURE__ */Un(dn,{index:e.index,label:Lt.addSectionHere,onInsert:()=>qi(e.index),className:void 0===e.height?"sf-preview-gap":"sf-preview-gap sf-preview-gap--tight",style:void 0===e.height?{top:e.top}:{top:e.top,height:e.height}},e.index))})]})}),Ol?/* @__PURE__ */Un(Yn,{canvas:xo,tabs:os,onSelect:e=>{const n=oi.findIndex(n=>String(n.props.id)===e);n>=0&&Ui(n)}}):null]})]}),eo?/* @__PURE__ */Gn(Jn,{children:[
|
|
55
|
+
/* @__PURE__ */Un(y,{value:{selectChild:vl,addChild:bl,childRowName:Oi,blockRowName:El},children:/* @__PURE__ */Un(Jt,{mode:Eo,onOpenWebsiteSettings:nr.openSettings??(()=>{}),onOpenSiteStyles:nr.openStyles,onSelectNode:yr,onNotify:Lr,onHidePanel:Zr,nodeActions:bt?ue(wt,bt.type):nt})}),
|
|
56
|
+
/* @__PURE__ */Un(Ye,{side:"right",width:Cr.right,min:_e,max:qe,defaultWidth:S.right,label:Lt.resizeSettingsPanel,onResize:$r})]}):
|
|
57
|
+
/* @__PURE__ */Un(L,{side:"right",onShow:Zr})]}),Ri.menu]})}))}export{tt as ScreenChrome};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useNow as e,describeSave as t}from"./chunk-RKTF5XLP.js";import{SaveIcon as a}from"./chunk-
|
|
1
|
+
import{useNow as e,describeSave as t}from"./chunk-RKTF5XLP.js";import{SaveIcon as a}from"./chunk-IE55HNMA.js";import{SplitButton as n,Kbd as s,CMD_S as i}from"efficient-shell/ui";import{CloudIcon as o,CheckIcon as l}from"efficient-shell/icons/efficient";import{jsx as r,jsxs as d}from"react/jsx-runtime";var c=e=>e.state.failed&&null!=e.state.retryAt||null!=e.state.savedAt;function u({input:n,words:s}){const i=e(c(n)),o=t({...n,now:i},s);/* @__PURE__ */
|
|
2
2
|
return r(a,{state:o.state,label:o.label})}function m({input:a,action:u,readOnly:m,saveSwitch:p,onToggleAutoSave:b,onSaveNow:v,bar:f,words:y}){const h=e(c(a)),k=t({...a,now:h},y),w=k.retry?f.retry:f.saveNow,S=/* @__PURE__ */d("span",{className:"es-savemenu-row",children:[w,
|
|
3
|
-
/* @__PURE__ */r("span",{"aria-hidden":"true",children:/* @__PURE__ */r(s,{keys:i,size:"sm"})})]}),A=[{type:"status",key:"status",label:k.line(u.status)},{type:"divider",key:"divider"},...p?[{type:"checkbox",key:"auto-save",label:f.autoSave,checked:!a.state.paused,disabled:m,onSelect:b}]:[],{key:"save-now",label:S,icon:/* @__PURE__ */r(o,{}),disabled:m,onSelect:v}],
|
|
4
|
-
return r(n,{variant:
|
|
3
|
+
/* @__PURE__ */r("span",{"aria-hidden":"true",children:/* @__PURE__ */r(s,{keys:i,size:"sm"})})]}),A=[{type:"status",key:"status",label:k.line(u.status)},{type:"divider",key:"divider"},...p?[{type:"checkbox",key:"auto-save",label:f.autoSave,checked:!a.state.paused,disabled:m,onSelect:b}]:[],{key:"save-now",label:S,icon:/* @__PURE__ */r(o,{}),disabled:m,onSelect:v}],N=u.quiet??null,g=k.blocked??u.disabledReason??N?.reason??null;/* @__PURE__ */
|
|
4
|
+
return r(n,{variant:N?"secondary":"primary",leftIcon:N?/* @__PURE__ */r(l,{}):void 0,onClick:()=>u.onPress(),disabled:null!==g,disabledReason:g??void 0,tooltip:u.tooltip,loading:!0===u.busy,menuLabel:f.saveOptions,items:A,menuMinWidth:300,children:N?N.label:u.label})}export{m as ScreenMainButton,u as ScreenSaveIcon};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={reload:"Reload the saved version",takeOver:"Take over editing",takeBack:"Take it back",viewReadOnly:"View read-only",savedByYou:({noun:e,when:i})=>`You saved this ${e} in another tab or window ${i}.`,savedByOther:({name:e,noun:i,when:n})=>`${e} saved this ${i} ${n}.`,conflictBody:"Your last change was not saved. It is still on screen here, but this copy is out of date — copy anything you need, then reload to carry on from the saved version.",takeOverWhileDeciding:"Nobody else can save while you decide. Nothing on your screen is lost.",tookOver:({name:e,noun:i,when:n})=>`${e} took over this ${i} ${n}.`,tookOverBody:"Your changes since then are still on screen but are no longer being saved.",viewingOnly:"Viewing only.",viewingOnlyBody:({name:e,noun:i,seen:n})=>`${e} is editing this ${i} (last seen ${n}). Nothing you change here is saved.`,editing:({name:e,noun:i})=>`${e} is editing this ${i}`,editingBody:({seen:e})=>`(last seen ${e}). Nothing you change here will be saved while they are in it.`,takeOverTold:"They are told straight away and stop being able to save."},i={device:"Preview device",upLevel:"Go up one level",upLevelTo:({label:e,name:i})=>`${e} to ${i}`,resize:"Drag to resize · double-click to reset",tierSection:"Section",tierBlock:"Block",partOf:({name:e})=>`Part of ${e}`,mediaLibrary:"Media library",mediaChoose:({kind:e})=>`Choose ${e}`,mediaFor:({field:e})=>`For ${e}`,mediaKinds:{image:"image",video:"video",svg:"SVG logo"},mediaCancel:"Cancel",mediaKeep:({kind:e})=>`Keep the current ${e}`,hidePanel:"Hide panel",hidePanelLabel:({side:e})=>`Hide the ${e} panel`,showPanel:"Show panel",showPanelLabel:({side:e})=>`Show the ${e} panel`};export{i as DEFAULT_CHROME_WORDS,e as DEFAULT_NOTICE_WORDS};
|
package/dist/copy/copy.css
CHANGED
|
@@ -471,24 +471,38 @@
|
|
|
471
471
|
gap: var(--es-space-4, 4px);
|
|
472
472
|
}
|
|
473
473
|
|
|
474
|
-
/* — the number cells (E5b): a
|
|
474
|
+
/* — the number cells (E5b): a grid between the toolbar and the box — */
|
|
475
|
+
/* THE GRID ASKS ITS OWN WIDTH (one text panel v3, wave 2 · E1): the wrapper is
|
|
476
|
+
a size container, so the cells go to ONE column when their row is under
|
|
477
|
+
240px, whatever panel, editor or inset they sit in. Measured at a 220px
|
|
478
|
+
panel (v3 page, 2026-10-15): a 2-up cell cut "160" to "1(" and "48" to "4:".
|
|
479
|
+
The number box itself is the shell's (7.39.0): glyph, the number read from
|
|
480
|
+
the left, the unit, the arrows — so no rule here moves the number or the unit
|
|
481
|
+
(the old compact-stepper override put the unit 1px from the arrows). */
|
|
482
|
+
.es-copy-cells-fit {
|
|
483
|
+
container-type: inline-size;
|
|
484
|
+
margin-bottom: var(--es-copy-gap);
|
|
485
|
+
}
|
|
475
486
|
.es-copy-cells {
|
|
476
487
|
display: grid;
|
|
477
488
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
489
|
+
gap: var(--es-space-8, 8px) var(--es-space-4, 4px);
|
|
490
|
+
}
|
|
491
|
+
@container (width < 240px) {
|
|
492
|
+
.es-copy-cells {
|
|
493
|
+
grid-template-columns: minmax(0, 1fr);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
/* A cell: its name over its box. The name wears the panel's row label
|
|
497
|
+
(`.es-field-label`, panel.css); only where it sits is said here. */
|
|
498
|
+
.es-copy-cell {
|
|
499
|
+
display: flex;
|
|
500
|
+
flex-direction: column;
|
|
478
501
|
gap: var(--es-space-4, 4px);
|
|
479
|
-
|
|
502
|
+
min-width: 0;
|
|
480
503
|
}
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
number stops just before it. Measured in Chrome at a 220px panel (a 95px
|
|
486
|
-
cell, the glyph in front): 17px of number with the shell's room, 29px with
|
|
487
|
-
this — "160" fits. Layout only: the arrows, the unit's ink and the box are
|
|
488
|
-
the shell's. */
|
|
489
|
-
.es-copy-cells .es-fnum:has([data-steppers='compact']) input {
|
|
490
|
-
padding-right: calc(9 * var(--spacing));
|
|
491
|
-
}
|
|
492
|
-
.es-copy-cells .es-fnum:has([data-steppers='compact']) span:has(> .es-fnum-unit) {
|
|
493
|
-
right: calc(4.5 * var(--spacing));
|
|
504
|
+
.es-copy-cell-name {
|
|
505
|
+
overflow: hidden;
|
|
506
|
+
text-overflow: ellipsis;
|
|
507
|
+
white-space: nowrap;
|
|
494
508
|
}
|
package/dist/copy/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { MarkStyle, MarkupTool, WrapResult, InlineRule, MarkedLine } from '../markup/index.js';
|
|
4
|
-
import { C as CopyWords, a as CopyAlign } from '../words-
|
|
5
|
-
export { b as COPY_ALIGNS, c as COPY_ALIGN_FIT, d as COPY_ALIGN_GLYPHS, e as COPY_ALIGN_LABELS, f as copyAlignOptions } from '../words-
|
|
4
|
+
import { C as CopyWords, a as CopyAlign } from '../words-DohP5ieg.js';
|
|
5
|
+
export { b as COPY_ALIGNS, c as COPY_ALIGN_FIT, d as COPY_ALIGN_GLYPHS, e as COPY_ALIGN_LABELS, f as copyAlignOptions } from '../words-DohP5ieg.js';
|
|
6
6
|
import { TextToolbarCase, TextToolbarMark } from 'efficient-shell/ui';
|
|
7
7
|
export { TextToolbar, TextToolbarProps } from 'efficient-shell/ui';
|
|
8
8
|
export { C as CanvasTypingEnd, a as CanvasTypingOptions, b as CanvasTypingSession, T as TextMap, s as startCanvasTyping, t as textMap } from '../canvas-typing-Cnvlsh_V.js';
|