efficient-easel 26.16.0 → 27.1.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 +9 -8
- package/dist/blocks/index.d.ts +1 -1
- package/dist/canvas/index.d.ts +2 -1
- package/dist/canvas/index.js +1 -1
- package/dist/chrome/index.js +1 -1
- package/dist/{chunk-PVBDKBJB.js → chunk-2EEYFRQM.js} +1 -1
- package/dist/{chunk-6DUCOSHW.js → chunk-3FANFZ4D.js} +1 -1
- package/dist/{chunk-CWELHADJ.js → chunk-3OOYGEJY.js} +1 -1
- package/dist/chunk-53QUHEHK.js +1 -0
- package/dist/{chunk-JIP5JNRB.js → chunk-5HYVOOH3.js} +1 -1
- package/dist/chunk-6GJEOER4.js +1 -0
- package/dist/{chunk-6ATIYLUL.js → chunk-6V6LC7QV.js} +1 -1
- package/dist/{chunk-KO47WAWR.js → chunk-7YXWWMBM.js} +1 -1
- package/dist/{chunk-GR3XRILS.js → chunk-A5USZ6Z6.js} +1 -1
- package/dist/{chunk-Y2T3JX7K.js → chunk-ANBPE45L.js} +1 -1
- package/dist/{chunk-KFWNGPW3.js → chunk-C63IB4VW.js} +5 -5
- package/dist/chunk-DIOTWSCO.js +1 -0
- package/dist/chunk-DTEYSPJE.js +64 -0
- package/dist/{chunk-C4TJN6GR.js → chunk-G2VZ4DET.js} +1 -1
- package/dist/{chunk-YYD257TD.js → chunk-G7J6SGMF.js} +1 -1
- package/dist/chunk-GJ427TZL.js +8 -0
- package/dist/chunk-J5VPNHOW.js +1 -0
- package/dist/{chunk-QZJKWKGH.js → chunk-JUJEVGLY.js} +1 -1
- package/dist/chunk-L36E2WCO.js +19 -0
- package/dist/chunk-LAJYMOY3.js +1 -0
- package/dist/{chunk-K53PQAMP.js → chunk-LDHUPZBK.js} +1 -1
- package/dist/{chunk-SBVIW3KJ.js → chunk-MTWQYLJE.js} +1 -1
- package/dist/chunk-OB4KI2AN.js +2 -0
- package/dist/{chunk-5U6DUZE2.js → chunk-P3HXHLES.js} +4 -4
- package/dist/{chunk-3XECMGXX.js → chunk-QEEW4X64.js} +1 -1
- package/dist/{chunk-JDQSRKJG.js → chunk-QPNNWQ24.js} +1 -1
- package/dist/{chunk-BFJAEQZ6.js → chunk-RTMDZJNE.js} +1 -1
- package/dist/chunk-SDSBXW3V.js +26 -0
- package/dist/chunk-SEC6NV6Y.js +18 -0
- package/dist/{chunk-W2S2VJOQ.js → chunk-SEH3Q3EL.js} +1 -1
- package/dist/chunk-TDEBPOWV.js +3 -0
- package/dist/{chunk-QTHQPJWA.js → chunk-TF6NAIV7.js} +1 -1
- package/dist/{chunk-6EDVZBUO.js → chunk-TQUEVJOO.js} +1 -1
- package/dist/chunk-TUIBPB77.js +5 -0
- package/dist/chunk-UMTUKSE6.js +1 -0
- package/dist/chunk-VNUXFD4X.js +1 -0
- package/dist/{chunk-VBEVZZTV.js → chunk-VTY7OQB5.js} +11 -11
- package/dist/chunk-WL57KM5C.js +17 -0
- package/dist/{chunk-H4TUOPI7.js → chunk-WW24O7HT.js} +1 -1
- package/dist/chunk-XESNAMI3.js +4 -0
- package/dist/chunk-XT75WETI.js +1 -0
- package/dist/{chunk-MGEXTIZH.js → chunk-XV5D4V2T.js} +1 -1
- package/dist/{chunk-CLAADE4J.js → chunk-XWTQTANN.js} +5 -5
- package/dist/chunk-YDTEYXQW.js +1 -0
- package/dist/chunk-ZNLODQD4.js +3 -0
- package/dist/copy/index.d.ts +1 -1
- package/dist/copy/index.js +13 -13
- package/dist/data/index.d.ts +2 -1
- package/dist/data/index.js +1 -1
- package/dist/drag/index.js +1 -1
- package/dist/draw/index.js +1 -1
- package/dist/easel/index.d.ts +2 -2
- package/dist/easel/index.js +1 -1
- package/dist/edit-lock/index.js +1 -1
- package/dist/fields/fields.css +8 -0
- package/dist/fields/index.d.ts +89 -18
- package/dist/fields/index.js +1 -1
- package/dist/node-ops/index.js +1 -1
- package/dist/panel/index.js +1 -1
- package/dist/phone-order-CRKvsTsz.d.ts +141 -0
- package/dist/{rowMarks-CO5TpfLY.d.ts → rowMarks-D2cO7UTi.d.ts} +5 -5
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddSidePanel.d.ts +1 -1
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/NodeContextMenu.d.ts +1 -1
- package/dist/screen/components/NodeContextMenu.js +1 -1
- package/dist/screen/components/PageEditGuardNotices.js +1 -1
- package/dist/screen/components/SaveControls.d.ts +1 -1
- package/dist/screen/components/SaveControls.js +1 -1
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenDocumentContext.d.ts +1 -1
- package/dist/screen/components/ScreenDocumentContext.js +1 -1
- package/dist/screen/components/ScreenMount.d.ts +1 -1
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.d.ts +1 -1
- package/dist/screen/components/ScreenStoreProvider.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/components/usePartBridge.d.ts +1 -1
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.d.ts +1 -1
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/admin-bridge.d.ts +1 -1
- package/dist/screen/lib/content/view-tiers.d.ts +11 -1
- package/dist/screen/lib/content/view-tiers.js +1 -1
- package/dist/screen/lib/document/block-set-host.js +1 -1
- package/dist/screen/lib/document/block-size-fields.d.ts +1 -1
- package/dist/screen/lib/document/block-size-fields.js +1 -1
- package/dist/screen/lib/document/block-types-in.js +1 -1
- package/dist/screen/lib/document/box-fields.d.ts +42 -14
- package/dist/screen/lib/document/box-fields.js +1 -1
- package/dist/screen/lib/document/button-fields.d.ts +1 -1
- package/dist/screen/lib/document/button-fields.js +1 -1
- package/dist/screen/lib/document/device-fields.d.ts +10 -17
- package/dist/screen/lib/document/device-fields.js +1 -1
- package/dist/screen/lib/document/image-fields.d.ts +1 -1
- package/dist/screen/lib/document/image-fields.js +5 -5
- package/dist/screen/lib/document/palette-sections.d.ts +1 -1
- package/dist/screen/lib/document/panel-no-control-mark.d.ts +2 -2
- package/dist/screen/lib/document/section-doc.d.ts +1 -1
- package/dist/screen/lib/document/section-doc.js +1 -1
- package/dist/screen/lib/document/shadow-fields.d.ts +1 -1
- package/dist/screen/lib/document/shadow-fields.js +2 -2
- package/dist/screen/lib/document/style-clipboard.d.ts +1 -1
- package/dist/screen/lib/document/style-clipboard.js +1 -1
- package/dist/screen/lib/document/style-fields.d.ts +1 -1
- package/dist/screen/lib/document/style-fields.js +1 -1
- package/dist/screen/lib/document/use-section-ops.d.ts +1 -1
- package/dist/screen/lib/document/use-section-ops.js +1 -1
- package/dist/screen/lib/document-addressing.d.ts +1 -1
- package/dist/screen/lib/document-hooks.d.ts +1 -1
- package/dist/screen/lib/document-switch.js +1 -1
- package/dist/screen/lib/failure.js +1 -1
- package/dist/screen/lib/host-inbound.js +1 -1
- package/dist/screen/lib/host.d.ts +1 -1
- package/dist/screen/lib/key-scope.js +1 -1
- package/dist/screen/lib/media-panel.d.ts +1 -1
- package/dist/screen/lib/media-picker.d.ts +1 -1
- package/dist/screen/lib/media-picker.js +1 -1
- package/dist/screen/lib/page-lock.d.ts +1 -1
- package/dist/screen/lib/page-lock.js +1 -1
- package/dist/screen/lib/screen-parts.d.ts +1 -11
- package/dist/screen/lib/screen-parts.js +1 -1
- package/dist/screen/lib/section-templates.d.ts +1 -1
- package/dist/screen/lib/session-context.d.ts +1 -1
- package/dist/screen/lib/session.d.ts +1 -1
- package/dist/screen/lib/shared-sections.d.ts +1 -1
- package/dist/screen/screen.css +0 -6
- package/dist/screen/words.d.ts +1 -3
- package/dist/screen/words.js +1 -1
- package/dist/strings/index.d.ts +1 -1
- package/dist/strings/index.js +2 -2
- package/dist/style-clipboard/index.js +1 -1
- package/dist/text-styles/index.d.ts +6 -5
- package/dist/text-styles/index.js +37 -37
- package/dist/text-styles/model.d.ts +24 -14
- package/dist/text-styles/model.js +1 -1
- package/dist/{types-CVHwspYM.d.ts → types-DcyH17ij.d.ts} +2 -0
- package/dist/{words-CFkb8XtN.d.ts → words-dNm6REMa.d.ts} +21 -0
- package/package.json +1 -1
- package/dist/chunk-3W2O22DZ.js +0 -19
- package/dist/chunk-BLE3U2GS.js +0 -2
- package/dist/chunk-CPIWSFGR.js +0 -2
- package/dist/chunk-E52W3M5I.js +0 -1
- package/dist/chunk-EUFDQ4KL.js +0 -1
- package/dist/chunk-JACEEVVF.js +0 -1
- package/dist/chunk-JQQFB7EZ.js +0 -1
- package/dist/chunk-LWFE6QDN.js +0 -20
- package/dist/chunk-OGG6FMBA.js +0 -17
- package/dist/chunk-RN5AYO53.js +0 -1
- package/dist/chunk-RQO3UDKP.js +0 -8
- package/dist/chunk-SQTVXE5D.js +0 -18
- package/dist/chunk-T5U2UZO6.js +0 -64
- package/dist/chunk-TOKMFZPB.js +0 -1
- package/dist/chunk-TXNCWF67.js +0 -4
- package/dist/chunk-U4TG43PD.js +0 -1
- package/dist/chunk-XFI3UPB2.js +0 -1
- package/dist/chunk-YHZSBL2N.js +0 -1
- package/dist/chunk-YTF65TZA.js +0 -5
- package/dist/chunk-ZEH6QLBH.js +0 -4
- package/dist/resolve-Bz4mszpL.d.ts +0 -57
package/README.md
CHANGED
|
@@ -684,9 +684,9 @@ by `AUTO_RULES[kind]`; Phone's parent is Tablet, Tablet's is Desktop. The kinds:
|
|
|
684
684
|
40), `columns` (at most 2, then 1), `stack` (Phone stacked), `textSize`
|
|
685
685
|
(x0.85 and x0.7, to 1px), `heightMode` (Phone: px → fit, Screen % stays),
|
|
686
686
|
`heightPx` (x0.75) and `same`. The breakpoints are `VIEW_TABLET_MIN` 720 and
|
|
687
|
-
`VIEW_DESKTOP_MIN` 1100. A text style
|
|
688
|
-
|
|
689
|
-
|
|
687
|
+
`VIEW_DESKTOP_MIN` 1100. A text style keeps Size, Line spacing, Letter spacing, Paragraph spacing and
|
|
688
|
+
Largest size per view (`<key>Tablet`, `<key>Phone`; absent = the next wider view).
|
|
689
|
+
The website's rendering reads the engine in later releases. Never store what `resolveViewValue` returns for
|
|
690
690
|
an auto view.
|
|
691
691
|
|
|
692
692
|
Nothing moved: each name is re-exported from the module that defines it, and
|
|
@@ -1074,8 +1074,11 @@ const easel = createEasel<EaselConfig>({ config, data, onChange: (doc) => autosa
|
|
|
1074
1074
|
is not planned or drawn (it would write the desktop value). A heading mark, a
|
|
1075
1075
|
slot and a field that draws no control anywhere stay; the `Inspector`'s `lead`
|
|
1076
1076
|
is not drawn. `fieldShownInView(field, device, siblings?)`
|
|
1077
|
-
is the one answer, exported from `efficient-easel/fields`.
|
|
1078
|
-
|
|
1077
|
+
is the one answer, exported from `efficient-easel/fields`. The tablet view is
|
|
1078
|
+
the same with `deviceField("tablet", …)`. Desktop and no device: every row, as
|
|
1079
|
+
before. `phoneTwinFields(key, row, VIEW_KEY_ACCESS)` gives a row its tablet and
|
|
1080
|
+
phone values under `<key>Tablet` and `<key>Phone`; `rowViewState`,
|
|
1081
|
+
`innerRowCount` and `viewReadsIn` are the census a host's guard reads. A kept key (a field with `reachedBy`:
|
|
1079
1082
|
`keptByRow`, a padding side, Position's y) is shown in the phone view only
|
|
1080
1083
|
if its row is shown (`siblings` is the fields it sits among; `planFields`
|
|
1081
1084
|
passes them); with no siblings it is hidden on the phone. `planFields` also
|
|
@@ -1278,9 +1281,7 @@ the Footer is drawn; `pinned.band` names the sections between the pins, folds
|
|
|
1278
1281
|
them under a row of their own and ends them with an "Add section" row; and
|
|
1279
1282
|
`useDocumentLabel` is the head's context line. A row's name, its quieter
|
|
1280
1283
|
words, its marks and buttons of the layer's own are `blockLook.rowName`,
|
|
1281
|
-
`rowPreview`, `rowMarks` and `rowActions
|
|
1282
|
-
block a small tab above it on the canvas while it is selected or under the
|
|
1283
|
-
pointer ("Designs shown" for a number filled from a live count). A block config's
|
|
1284
|
+
`rowPreview`, `rowMarks` and `rowActions`. A block config's
|
|
1284
1285
|
`permissions.delete` / `duplicate` set to `false` takes the action off the
|
|
1285
1286
|
block's rows and its menu, and the inspector is handed the answer for its
|
|
1286
1287
|
head (`nodeActions`). The frame's words (the pinned labels,
|
package/dist/blocks/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ReactElement, FC, CSSProperties, ReactNode, JSX } from 'react';
|
|
|
2
2
|
import { P as Permissions, A as AppState } from '../types-BljCVdzR.js';
|
|
3
3
|
import '../data/index.js';
|
|
4
4
|
import '../types-Dq180WRV.js';
|
|
5
|
-
import '../
|
|
5
|
+
import '../phone-order-CRKvsTsz.js';
|
|
6
6
|
import '../plan-D0DgSLnY.js';
|
|
7
7
|
|
|
8
8
|
/**
|
package/dist/canvas/index.d.ts
CHANGED
|
@@ -98,7 +98,8 @@ declare function useCanvasStyle(canvas: CanvasTarget | null, key: string, css: s
|
|
|
98
98
|
/**
|
|
99
99
|
* A number that changes whenever the canvas may have MOVED — its document
|
|
100
100
|
* scrolled or resized, its content resized, a block added, removed or moved in
|
|
101
|
-
* it,
|
|
101
|
+
* it, a transition or an animation ended in it, the host page scrolled or
|
|
102
|
+
* resized, or the canvas itself replaced — plus
|
|
102
103
|
* two settle passes after each new canvas (fonts and images land after the
|
|
103
104
|
* first paint). An overlay re-measures when it
|
|
104
105
|
* changes, instead of each surface wiring its own listeners and timers.
|
package/dist/canvas/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{BLOCK_SELECTOR,CANVAS_SELECTOR,CANVAS_TYPABLE_EVENT,CANVAS_TYPING_EVENT,LIST_SELECTOR,isFrameReady,useCanvasEvent,useCanvasFrame,useCanvasLayout,useCanvasStyle,useCanvasTyping,watchCanvasFrame}from"../chunk-
|
|
1
|
+
export{BLOCK_SELECTOR,CANVAS_SELECTOR,CANVAS_TYPABLE_EVENT,CANVAS_TYPING_EVENT,LIST_SELECTOR,isFrameReady,useCanvasEvent,useCanvasFrame,useCanvasLayout,useCanvasStyle,useCanvasTyping,watchCanvasFrame}from"../chunk-6GJEOER4.js";export{BLOCK_ATTRIBUTE,WORDS_CLEAR,clientPointToLayer,drawnBox,elementScale,fitCanvas,framePointToHost,frameRectToHost,frameRectToLayer,frameScale,isTypingTarget,nodeIdAt,related,removeCanvasStyle,setCanvasNonce,upsertCanvasStyle}from"../chunk-FR7EEKFF.js";export{REPEAT_ATTRIBUTE,REPEAT_INDEX_ATTRIBUTE,isRepeatCopy,mainCopyOf,queryAllCopies,queryMainCopy,repeatWrapperAt}from"../chunk-7UFKEX72.js";
|
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,MIN_PANEL_W_BY_SIDE,PanelResizeHandle,SaveIcon,SaveState,SaveStateToggle,TopBarCluster,TopBarDivider,TopBarRail,clampPanelWidth,editNotice,headWords,panelWidthVars,saveIconTone,setPanelWidthVars}from"../chunk-
|
|
1
|
+
export{DEFAULT_PANEL_W,DeviceSwitch,EaselIconButton,EaselTopBar,EditNotice,InspectorHead,InspectorIconButton,InspectorUpLevel,MAX_PANEL_W,MIN_PANEL_W,MIN_PANEL_W_BY_SIDE,PanelResizeHandle,SaveIcon,SaveState,SaveStateToggle,TopBarCluster,TopBarDivider,TopBarRail,clampPanelWidth,editNotice,headWords,panelWidthVars,saveIconTone,setPanelWidthVars}from"../chunk-VTY7OQB5.js";import"../chunk-MJM6SFD3.js";import"../chunk-AJSDWWJW.js";import"../chunk-2OAZYSWJ.js";import"../chunk-G7J6SGMF.js";import"../chunk-RE4LP46F.js";import"../chunk-MFIRYGHW.js";import"../chunk-YDTEYXQW.js";import"../chunk-KXM6YRG2.js";
|
|
@@ -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-VTY7OQB5.js";import{SplitButton as l,Kbd as i,CMD_S as n}from"efficient-shell/ui";import{CloudIcon as s,CheckIcon as o}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:l,words:i}){const n=e(c(l)),s=t({...l,now:n},i);/* @__PURE__ */
|
|
2
2
|
return r(a,{state:s.state,label:s.label})}function m({input:a,action:u,readOnly:m,saveSwitch:y,onToggleAutoSave:b,onSaveNow:p,bar:v,words:f}){const k=e(c(a)),h=t({...a,now:k},f),w=h.retry?v.retry:v.saveNow,g=/* @__PURE__ */d("span",{className:"es-savemenu-row",children:[w,
|
|
3
3
|
/* @__PURE__ */r("span",{"aria-hidden":"true",children:/* @__PURE__ */r(i,{keys:n,size:"sm"})})]}),S=[{type:"status",key:"status",label:h.line(u.status)},...(u.goingLive??[]).map((e,t)=>({type:"status",key:`going-live-${t}`,label:e})),{type:"divider",key:"divider"},...y?[{type:"checkbox",key:"auto-save",label:v.autoSave,checked:!a.state.paused,disabled:m,onSelect:b}]:[],{key:"save-now",label:g,icon:/* @__PURE__ */r(s,{}),disabled:m,onSelect:p},...u.menuItems?.length?[{type:"divider",key:"layer-divider"},...u.menuItems.map(e=>({key:`layer-${e.key}`,label:e.label,icon:e.icon,disabled:e.disabled,onSelect:e.onSelect}))]:[]],j=u.quiet??null,x=h.blocked??u.disabledReason??j?.reason??null;/* @__PURE__ */
|
|
4
4
|
return r(l,{variant:j?"secondary":"primary",leftIcon:j?/* @__PURE__ */r(o,{}):void 0,onClick:()=>u.onPress(),disabled:null!==x,disabledReason:x??void 0,tooltip:u.tooltip,loading:!0===u.busy,menuLabel:v.saveOptions,items:S,menuMinWidth:300,children:j?j.label:u.label})}export{m as ScreenMainButton,u as ScreenSaveIcon};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useScreenBlockRules as e}from"./chunk-
|
|
1
|
+
import{useScreenBlockRules as e}from"./chunk-TUIBPB77.js";import{newNodeId as t,ROOT_ZONE as n}from"./chunk-TCAAOYQY.js";import{useEasel as o,useEaselApi as r}from"./chunk-L36E2WCO.js";import{useMemo as s}from"react";function i(i={}){const{dispatch:p}=o(e=>e),d=r(),c=!0===i.readOnly,a=e().resolveOnInsert,l=!0===(i.resolveOnInsert??a),m=!0===i.foldIntoHistory;return s(()=>{const e=m?e=>p({...e,recordHistory:!1}):p,o=(n,o,r)=>{const s=t(o);return c||e({type:"insert",componentType:o,destinationZone:n,destinationIndex:r,id:s}),s},r=e=>(l&&!c&&d.resolveNode(e,{trigger:"insert"}),e),s=(t,n,o)=>{c||e({type:"replace",destinationZone:t,destinationIndex:n,data:o})},i=(e,t,n)=>r(o(e,t,n));return{insertComponent:i,insertSection:(e,t)=>i(n,e,t),replaceComponent:s,seedChild:(e,t,n,i)=>{const p=o(e,n,t);s(e,t,{type:n,props:{id:p,...i}}),r(p)},insertNode:(e,t,n)=>{const i=o(e,n.type,t);return s(e,t,{type:n.type,props:{...n.props,id:i}}),r(i)},removeComponent:(t,n)=>{c||e({type:"remove",index:n,zone:t})},reorderComponent:(t,n,o)=>{c||e({type:"reorder",sourceIndex:n,destinationIndex:o,destinationZone:t})},duplicateComponent:(t,n)=>{c||e({type:"duplicate",sourceIndex:n,sourceZone:t})},select:e=>p({type:"setUi",ui:{itemSelector:e}}),setDocument:t=>{c||e({type:"setData",data:t})},commitDocument:(t,n)=>{c||(m?d.batch(()=>{e({type:"setData",data:t}),void 0!==n&&("slot"===n?.kind?d.selectSlot({parentId:n.parentId,slot:n.slot}):d.select(n?n.id:null))}):d.run({data:t,select:n}))}}},[p,c,l,d,m])}export{i as useSectionOps};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEFAULT_STYLE_CLIPBOARD_WORDS as t}from"./chunk-6WY6ZXJG.js";import{clone as e}from"./chunk-
|
|
1
|
+
import{DEFAULT_STYLE_CLIPBOARD_WORDS as t}from"./chunk-6WY6ZXJG.js";import{clone as e}from"./chunk-YDTEYXQW.js";import{CopyStyleIcon as n,PasteStyleIcon as o}from"efficient-shell/icons/efficient";import{jsx as r}from"react/jsx-runtime";var c="__styleKind";function u(t,e){return t[c]=e,t}function i(t,e){return`${t}:${e.map(t=>String(t)).sort().join("|")}`}function s(t){if(!t)return null;const e=t.indexOf(":");if(e<0)return null;const n=t.slice(0,e);return l.has(n)?{control:n,values:t.slice(e+1).split("|")}:null}var l=/* @__PURE__ */new Set(["choice","select","radio"]);function a(t){if(!t||"object"!=typeof t)return null;const e=t;return"string"==typeof e[c]?e[c]:"text"===e.type||"textarea"===e.type||"number"===e.type?e.type:"select"!==e.type&&"radio"!==e.type||!Array.isArray(e.options)?null:i(e.type,e.options.map(t=>t?.value))}function p(t){return null!=t&&""!==t}function f(t,e){let n=t;for(const t of e){if(!n||"object"!=typeof n)return;n=n[t]}return n}function d(t,e,n){const[o,...r]=e,c={...t};if(0===r.length)return void 0===n?delete c[o]:c[o]=n,c;const u=c[o],i=d(u&&"object"==typeof u?u:{},r,n);return 0===Object.keys(i).length?delete c[o]:c[o]=i,c}var y=t=>t.join("."),h="editor-shell:style-clipboard",m=null,g=!1,v=/* @__PURE__ */new Set;function b(){try{return"undefined"==typeof sessionStorage?null:sessionStorage}catch{return null}}function k(){if(!g){g=!0;try{const t=b()?.getItem(h);t&&(m=JSON.parse(t))}catch{m=null}}}function S(t){k(),m={scope:t.scope,sourceType:t.type,sourceLabel:t.label,rows:t.rows.map(n=>{const o=f(t.props,n.path);return{path:[...n.path],kind:n.kind,counted:!1!==n.counted,value:p(o)?e(o):void 0}})};try{b()?.setItem(h,JSON.stringify(m))}catch{}return v.forEach(t=>t()),m}function j(t){return k(),m&&m.scope===t?m:null}function C(t){return v.add(t),()=>{v.delete(t)}}function w(){m=null,g=!0;try{b()?.removeItem(h)}catch{}v.forEach(t=>t())}function E(t,e,n){if(t.kind===e.kind)return null!==e.kind||n;const o=s(t.kind),r=s(e.kind);return!(!o||!r||o.control!==r.control)&&(!p(t.value)||r.values.includes(String(t.value)))}function N(t,n){const o=t.sourceType===n.type,r=new Map(t.rows.map(t=>[y(t.path),t]));let c=n.props,u=0,i=!1;for(const t of n.rows){const n=r.get(y(t.path));if(!n)continue;if(!E(n,t,o))continue;const s=f(c,t.path),l=void 0===n.value?void 0:e(n.value);JSON.stringify(p(s)?s:void 0)!==JSON.stringify(l)&&(c=d(c,t.path,l),i=!0),!1!==t.counted&&(u+=1)}return{props:c,pasted:u,changed:i}}function K(e,n,o,r=t){return 0===e.pasted?r.nothing({source:n,target:o}):r.pasted({count:e.pasted,source:n})}var T="⌥⌘C",O="⌥⌘V";function x(e){const c=e.words??t,u=[];return e.canCopy&&u.push({label:c.copy,icon:/* @__PURE__ */r(n,{}),shortcut:"⌥⌘C",onClick:e.onCopy}),e.held&&u.push({label:c.paste({source:e.held.sourceLabel}),icon:/* @__PURE__ */r(o,{}),shortcut:"⌥⌘V",onClick:e.onPaste}),u}function J(t){if(!t.altKey||t.shiftKey||!t.metaKey&&!t.ctrlKey)return null;const e=t.target;return e&&(e.isContentEditable||"INPUT"===e.tagName||"TEXTAREA"===e.tagName||"SELECT"===e.tagName)?null:"KeyC"===t.code?"copy":"KeyV"===t.code?"paste":null}export{T as COPY_STYLE_SHORTCUT,O as PASTE_STYLE_SHORTCUT,c as STYLE_KIND,i as choiceKind,w as clearStyle,S as copyStyle,a as fieldKind,j as heldStyle,K as pasteMessage,N as planPaste,x as styleMenuItems,J as styleShortcut,C as subscribeStyle,u as withStyleKind};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{resolveViewValue as n,FOLLOW_RULES as e}from"./chunk-DIOTWSCO.js";var i=["none","upper","capitalize","lower"],t={none:"none",upper:"uppercase",capitalize:"capitalize",lower:"lowercase"};function a(n){return i.includes(n)}function r(n){return a(n)?t[n]:void 0}function o(n){return i.find(e=>t[e]===n)}var s=["size","lineSpacing","letterSpacing","paragraphSpacing","largestSize"];function d(n,e){return`${n}${"tablet"===e?"Tablet":"Phone"}`}function l(i,t){if("desktop"===t)return i;let a=i;for(const r of s){const o=n("same",i[r],i[d(r,"tablet")],i[d(r,"phone")],e),s="phone"===t?o.phone:o.tablet;null!=s&&s!==i[r]&&(a={...a,[r]:s})}return a}var u=["font","color","size","weight","emphasis","lineSpacing","letterSpacing","paragraphSpacing","letterCase","largestSize"],c=["font","color","size","weight","lineSpacing","letterSpacing","paragraphSpacing","letterCase"],p=["heading","body"],f=7,h={heading:3,body:5},m={min:5,max:void 0,sliderMin:12,sliderMax:72,step:1,shiftStep:10,unit:"px"},g={size:m,weight:{min:100,max:900,sliderMin:300,sliderMax:900,step:100,shiftStep:100,unit:""},lineSpacing:{min:50,max:250,sliderMin:50,sliderMax:250,step:1,shiftStep:10,unit:"%"},letterSpacing:{min:-10,max:void 0,sliderMin:-5,sliderMax:10,step:.1,shiftStep:1,unit:"px"},paragraphSpacing:{min:0,max:void 0,sliderMin:0,sliderMax:48,step:1,shiftStep:10,unit:"px"},largestSize:m},x=(n,e)=>`${"heading"===n?"Heading":"Body"} ${e}`;function S(n=({kind:n,n:e})=>x(n,e)){return p.flatMap(e=>Array.from({length:h[e]},(i,t)=>({id:`${e}-${t+1}`,kind:e,name:n({kind:e,n:t+1}),values:{}})))}function k(n,e,i=f){return n.filter(n=>n.kind===e).length<i}function v(n,e){const i=new RegExp(`^${e}-([1-9]\\d*)$`).exec(n);return i?Number(i[1]):void 0}function M(n){const e=v(n.id,n.kind);return void 0!==e&&e<=h[n.kind]}function z(n,e,i={}){const{max:t=f,name:a=({kind:n,n:e})=>x(n,e),make:r}=i;if(!k(n,e,t))return null;const o=n.filter(n=>n.kind===e);let s=o.length+1;const d=new Set(n.map(n=>n.name));for(;d.has(a({kind:e,n:s}));)s+=1;const l=new Set(n.map(n=>n.id));let u=Math.max(s,...o.map(n=>(v(n.id,e)??0)+1));for(;l.has(`${e}-${u}`);)u+=1;const c=o.at(-1),p=r?r(e,s):{id:`${e}-${u}`,kind:e,name:a({kind:e,n:s}),values:{...c?.values??{}}},h=c?n.indexOf(c)+1:"heading"===e?0:n.length;return{styles:[...n.slice(0,h),p,...n.slice(h)],added:p}}function w(n,e,i={}){const{name:t=({kind:n,n:e})=>x(n,e)}=i,a=n.find(n=>n.id===e);if(!a||M(a))return null;const r=n.filter(n=>n.kind===a.kind),o=r.indexOf(a),s=/* @__PURE__ */new Map;return r.forEach((n,e)=>{e>o&&n.name===t({kind:n.kind,n:e+1})&&s.set(n,t({kind:n.kind,n:e}))}),{styles:n.filter(n=>n!==a).map(n=>s.has(n)?{...n,name:s.get(n)}:n),removed:a}}function b(n,e){const i=n.find(n=>n.id===e);if(i)return i;for(const i of p){const t=v(e,i);if(void 0===t)continue;let a;for(const e of n){const n=e.kind===i?v(e.id,i):void 0;void 0!==n&&n<t&&(!a||n>a.n)&&(a={n:n,style:e})}return a?.style}}function $(n,e,i){return n.map(n=>{if(n.id!==e)return n;const t={...n.values};for(const[n,e]of Object.entries(i))void 0===e?delete t[n]:t[n]=e;return{...n,values:t}})}function y(n){return Math.min(20,Math.max(12,Math.round(.5*n+6)))}function O(n,e){const i=e.weights;return[i.thin,i.extraLight,i.light,i.regular,i.medium,i.semibold,i.bold,i.extraBold,i.black][Math.min(8,Math.max(0,Math.round(n/100)-1))]}function C(n,e,i,t={}){const a=e.find(e=>e.value===n.font)?.label??n.font??"",r=void 0===n.size?t.autoSize?i.auto:"":i.px({n:n.size});return i.summary({font:a,size:r,weight:O(n.weight??400,i)})}export{c as CAMPAIGN_TEXT_STYLE_SETTINGS,i as TEXT_STYLE_CASES,t as TEXT_STYLE_CASE_CSS,h as TEXT_STYLE_DEFAULT_COUNT,p as TEXT_STYLE_KINDS,f as TEXT_STYLE_MAX,g as TEXT_STYLE_RANGES,u as TEXT_STYLE_SETTINGS,s as TEXT_STYLE_VIEW_NUMBERS,z as addTextStyle,k as canAddTextStyle,S as defaultTextStyles,C as describeTextStyle,M as isDefaultTextStyle,a as isTextStyleCase,w as removeTextStyle,b as resolveTextStyle,r as textStyleCaseCss,o as textStyleCaseOfCss,y as textStyleRowSize,d as textStyleViewKey,l as textStyleViewValues,$ as updateTextStyle,O as weightWord};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mediaPickStoreFor as e}from"./chunk-NCXYC7WI.js";import{newId as t}from"./chunk-
|
|
1
|
+
import{mediaPickStoreFor as e}from"./chunk-NCXYC7WI.js";import{newId as t}from"./chunk-YDTEYXQW.js";var o=/* @__PURE__ */new Map;function i(i,n){if(!i.connected)return Promise.resolve(null);const r=t("mp"),c=e(i);return c?c.request({requestId:r,accept:n.accept,title:n.title,file:n.file??null,...n.options?{options:n.options}:{}}):new Promise(e=>{o.set(r,e),i.send("storefront-editor:open-media-picker",{requestId:r,accept:n.accept,title:n.title,...n.file?{file:n.file}:{}})})}function n(e,t){const i=o.get(e);i&&(o.delete(e),i(t))}export{i as requestMediaPick,n as resolveMediaPick};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{removeCanvasStyle as e,upsertCanvasStyle as n}from"./chunk-FR7EEKFF.js";import{useState as t,useEffect as o,useRef as r}from"react";var c=["transitionend","transitioncancel","animationend","animationcancel"];function s(e,n){for(const t of c)e.addEventListener(t,n,!0);return()=>{for(const t of c)e.removeEventListener(t,n,!0)}}var i="[data-easel-block]",u="[data-easel-dropzone]",l="iframe#preview-frame";function a(e){const n=e.contentDocument;if(!n||!e.contentWindow||"loading"===n.readyState||!n.body)return!1;if(e.hasAttribute("srcdoc"))return"about:srcdoc"===n.URL;const t=e.getAttribute("src");return!t||"about:blank"===t||"about:blank"!==n.URL}function d(e,n,{selector:t=l,readySelector:o}={}){let r=null,c=null,s=!1,i=!1,u=null;const d=()=>{u?.observer.disconnect(),u=null},m=()=>{if(i)return;let e=null;if(r&&a(r)){const n=r.contentDocument;(e=>{if(!o||e.querySelector(o))return d(),!0;if(u?.doc!==e){d();const n=e.defaultView?.MutationObserver;if(n){const t=new n(()=>m());t.observe(e,{childList:!0,subtree:!0}),u={doc:e,observer:t}}}return!1})(n)&&(e={frame:r,document:n,window:r.contentWindow})}else d();(e===c||!!e&&!!c&&e.frame===c.frame&&e.document===c.document)&&s||(s=!0,c=e,n(c))},f=()=>m(),v=()=>{const n=e.querySelector?.(t);n!==r?(r?.removeEventListener("load",f),r=n,r?.addEventListener("load",f),m()):m()},b=e.ownerDocument?.defaultView??e.defaultView,w=b?.MutationObserver,E=w?new w(e=>(e=>null!==r&&!r.isConnected||e.some(e=>[...e.addedNodes,...e.removedNodes].some(e=>"IFRAME"===e.nodeName||!!e.querySelector?.("iframe"))))(e)&&v()):null;return E?.observe(e,{childList:!0,subtree:!0}),v(),()=>{i=!0,E?.disconnect(),d(),r?.removeEventListener("load",f),r=null}}function m(e,{selector:n,readySelector:r}={}){const[c,s]=t(null);return o(()=>{const t=e.current;if(!t)return;const o=d(t,s,{selector:n,readySelector:r});return()=>{o(),s(null)}},[e,n,r]),c}var f="easel:canvas-typing",v="easel:canvas-typable";function b(e,n,t,{on:c="document",capture:s=!1}={}){const i=r(t);i.current=t;const u=e?.document??null,l=e?.window??null;o(()=>{const e="window"===c?l:u;if(!e)return;const t=e=>i.current(e);return e.addEventListener(n,t,s),()=>e.removeEventListener(n,t,s)},[u,l,n,c,s])}function w(e){const[n,o]=t(!1);return b(e,f,e=>o(Boolean(e.detail?.typing))),n}function E(t,r,c){const s=t?.document??null;o(()=>{if(!s)return;if(!c)return void e(s,r);const t=n(s,r,c),o=s.defaultView?.MutationObserver,i=o?new o(()=>{t.isConnected||n(s,r,c)}):null;return i?.observe(s.head??s.documentElement,{childList:!0}),()=>{i?.disconnect(),e(s,r)}},[s,r,c])}function L(e,{settle:n=[150,450]}={}){const[r,c]=t(0),i=e?.frame??null,u=e?.document??null,l=e?.window??null,a=n.join(",");return o(()=>{if(!i||!u||!l)return;const e=i.ownerDocument.defaultView;let t=!1,o=0;const r=()=>{if(t)return;t=!0;const n=()=>{t=!1,c(e=>e+1)};e?.requestAnimationFrame?o=e.requestAnimationFrame(n):n()},a=[],d=(e,n)=>{e.addEventListener(n,r,!0),a.push(()=>e.removeEventListener(n,r,!0))};d(u,"scroll"),d(l,"resize"),e&&(d(e,"scroll"),d(e,"resize"));const m=e?.ResizeObserver;if(m){const e=new m(r);e.observe(i),u.documentElement&&e.observe(u.documentElement),a.push(()=>e.disconnect())}const f=u.defaultView?.MutationObserver,v=u.body??u.documentElement;if(f&&v){const e=new f(r);e.observe(u===i.ownerDocument?i:v,{childList:!0,subtree:!0}),a.push(()=>e.disconnect())}const b=u.fonts;b&&d(b,"loadingdone"),a.push(s(l,r));const w=n.map(e=>setTimeout(r,e));return r(),()=>{for(const e of a)e();for(const e of w)clearTimeout(e);o&&e?.cancelAnimationFrame&&e.cancelAnimationFrame(o)}},[i,u,l,a]),r}export{i as BLOCK_SELECTOR,l as CANVAS_SELECTOR,v as CANVAS_TYPABLE_EVENT,f as CANVAS_TYPING_EVENT,u as LIST_SELECTOR,a as isFrameReady,s as onMotionEnd,b as useCanvasEvent,m as useCanvasFrame,L as useCanvasLayout,E as useCanvasStyle,w as useCanvasTyping,d as watchCanvasFrame};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{accessForNewDocument as e}from"./chunk-
|
|
1
|
+
import{accessForNewDocument as e}from"./chunk-G7J6SGMF.js";function n(e){return e.failed?"error":e.pending?"saving":e.saved?"saved":"idle"}function t(e){return"idle"}function r(n,t){t.resetAutosave(),t.setVersion(null),t.setSaveConflict(null),t.setAccess(e(n))}export{r as resetForDocumentSwitch,t as saveStatusForNewDocument,n as saveStatusOf};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readHostFailure as e,isBackendError as n,STATUS_UNREACHABLE as s}from"./chunk-KCOBHPN6.js";import{EDIT_LOCK_TAKEN as t}from"./chunk-
|
|
1
|
+
import{readHostFailure as e,isBackendError as n,STATUS_UNREACHABLE as s}from"./chunk-KCOBHPN6.js";import{EDIT_LOCK_TAKEN as t}from"./chunk-G7J6SGMF.js";var a="page_changed_elsewhere",d={unauthorized:401,"changed-elsewhere":409,"lock-taken":409,"not-found":404,invalid:400,unavailable:s};function o(s,o){const c=e(s,o);if(c)return{status:c.status,data:c.data};if(!n(s))return null;const u=e(s.cause,o);if(u)return{status:u.status,data:u.data};const r=d[s.kind];return"changed-elsewhere"===s.kind?{status:r,data:{code:a,saved_by:s.conflict?.savedBy??"",saved_by_you:!0===s.conflict?.savedByYou,seconds_ago:s.conflict?.secondsAgo??0}}:"lock-taken"===s.kind?{status:r,data:{code:t,holder_name:s.holder?.name??"",seconds_since_seen:s.holder?.secondsSinceSeen??0,seconds_since_held:s.holder?.secondsSinceHeld??0}}:{status:r,data:null}}function c(e,n){return 401===o(e,n)?.status}export{a as PAGE_CONFLICT_CODE,c as isExpiredSession,o as readEaselFailure};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PAGE_CONFLICT_CODE as e,readEaselFailure as r}from"./chunk-
|
|
1
|
+
import{PAGE_CONFLICT_CODE as e,readEaselFailure as r}from"./chunk-7YXWWMBM.js";import{createEditLock as o}from"./chunk-G7J6SGMF.js";var c=o({readFailure:r,conflictCode:e});function i(i){return i.hostFailures?i.cache("easel:edit-lock",()=>o({readFailure:e=>r(e,i),conflictCode:e})):c}export{i as editLockOf,c as pageEditLock};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEFAULT_FIELDS_WORDS as e}from"./chunk-
|
|
1
|
+
import{DEFAULT_FIELDS_WORDS as e}from"./chunk-UMTUKSE6.js";import{useWords as i}from"./chunk-MFIRYGHW.js";import{ShellStringsProvider as n,InputNumber as s,Tooltip as a}from"efficient-shell/ui";import{jsx as l}from"react/jsx-runtime";function r({id:r,value:t,onChange:m,min:o,max:c,step:u=1,shiftStep:d,styleValue:p,icon:f,unit:h,steppers:b=!1,placeholder:v,readOnly:x=!1,ariaLabel:y,ariaLabelledBy:N,title:S}){const g=i("fields",e),j="number"==typeof t&&Number.isFinite(t)?t:null,k=/* @__PURE__ */l("div",{className:`es-fnum${f?" es-fnum--icon":""}${null===j&&void 0!==p?" is-style":""}`,children:/* @__PURE__ */l(n,{value:{number:{increase:g.more,decrease:g.less}},children:/* @__PURE__ */l(s,{id:r,size:"md",className:"es-fnum-box",value:j,onChange:e=>m(e??void 0),min:o,max:c,step:u,shiftStep:d,readOnly:x,steppers:b,snap:!0,placeholder:void 0!==p?String(p):v,prefix:f?/* @__PURE__ */l("span",{className:"es-fnum-icon",children:f}):void 0,suffix:h?/* @__PURE__ */l("span",{className:"es-fnum-unit",children:h}):void 0,"aria-label":y,"aria-labelledby":N})})});return S?/* @__PURE__ */l(a,{content:S,children:k}):k}export{r as FieldNumber};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{DEFAULT_FIELDS_WORDS as e}from"./chunk-
|
|
2
|
-
/* @__PURE__ */s("span",{className:"es-fsel-label",children:b?b(a,{active:l.active??!1,chosen:l.selected}):a.label}),void 0===a.meta||m?null:/* @__PURE__ */s("span",{className:"es-fsel-meta","aria-hidden":"true",children:a.meta})]}):e.label},
|
|
1
|
+
import{DEFAULT_FIELDS_WORDS as e}from"./chunk-UMTUKSE6.js";import{useWords as l}from"./chunk-MFIRYGHW.js";import{SearchableSelect as a,Select as n}from"efficient-shell/ui";import{jsx as s,jsxs as i}from"react/jsx-runtime";function r(e,l){return e.find(e=>Object.is(e.value,l))}var o=e=>String(e);function t(r){const{id:t,options:u,placeholder:d,readOnly:c=!1,ariaLabel:v,ariaLabelledBy:h,searchable:m=!1,searchPlaceholder:p,groupCount:f=!1,renderOption:b}=r,g=l("fields",e),O=h?{"aria-labelledby":h}:v?{"aria-label":v}:{},j=u.some(e=>void 0!==e.thumb),x=j||void 0!==b||u.some(e=>void 0!==e.meta),N=e=>""===e?void 0:u[Number(e)],y=(e,l)=>{const a=N(e.value);return a?/* @__PURE__ */i("span",{className:"es-fsel-row",children:[j?/* @__PURE__ */s("span",{className:"es-fsel-thumb","aria-hidden":"true",children:a.thumb?/* @__PURE__ */s("img",{src:a.thumb,alt:"",loading:"lazy"}):null}):null,
|
|
2
|
+
/* @__PURE__ */s("span",{className:"es-fsel-label",children:b?b(a,{active:l.active??!1,chosen:l.selected}):a.label}),void 0===a.meta||m?null:/* @__PURE__ */s("span",{className:"es-fsel-meta","aria-hidden":"true",children:a.meta})]}):e.label},C=[];let T=null;if(u.forEach((e,l)=>{const a={value:o(l),label:e.label,...e.disabled?{disabled:!0}:{},...m&&e.meta?{sublabel:e.meta}:{},...!m&&e.description?{description:e.description}:{}};void 0===e.group?(T=null,C.push(a)):T&&T.label===e.group?T.options.push(a):(T={label:e.group,options:[a]},C.push(T))}),f)for(const e of C)"options"in e&&(e.label=`${e.label} ${e.options.length}`);const V=e=>e.flatMap(e=>{const l=N(e.value);return l?[l]:[]});if(m){const l={id:t,options:C,placeholder:p??d??g.search??e.search,disabled:c,renderOption:x?y:void 0,...O};if(!0===r.multiple){const e=Array.isArray(r.value)?r.value:[],n=r.onChange;/* @__PURE__ */
|
|
3
3
|
return s("div",{className:"es-fsel",children:/* @__PURE__ */s(a,{...l,multiple:!0,value:u.flatMap((l,a)=>e.some(e=>Object.is(e,l.value))?[o(a)]:[]),onChange:e=>n(u.filter((l,a)=>e.includes(o(a))).map(e=>e.value))})})}const n=u.findIndex(e=>Object.is(e.value,r.value)),i=r.onChange;/* @__PURE__ */
|
|
4
|
-
return s("div",{className:"es-fsel",children:/* @__PURE__ */s(a,{...l,value:n>=0?o(n):"",clearable:!1,onChange:e=>{const l=
|
|
5
|
-
return s("div",{className:"es-fsel",children:/* @__PURE__ */s(n,{...
|
|
6
|
-
return s("div",{className:"es-fsel",children:/* @__PURE__ */s(n,{...
|
|
4
|
+
return s("div",{className:"es-fsel",children:/* @__PURE__ */s(a,{...l,value:n>=0?o(n):"",clearable:!1,onChange:e=>{const l=N(e);l&&!Object.is(l.value,r.value)&&i(l.value)}})})}const M={id:t,size:"md",className:"es-fsel-button",options:C,placeholder:d??g.choose,readOnly:c,renderOption:x?y:void 0,...O};if(!0===r.multiple){const e=Array.isArray(r.value)?r.value:[],l=l=>e.some(e=>Object.is(e,l.value)),a=u.flatMap((e,a)=>l(e)?[o(a)]:[]),i=r.onChange;/* @__PURE__ */
|
|
5
|
+
return s("div",{className:"es-fsel",children:/* @__PURE__ */s(n,{...M,multiple:!0,value:a,renderValue:r.renderValue?e=>r.renderValue(V(e)):void 0,valueText:r.valueText?e=>r.valueText(V(e)):void 0,onChange:e=>i(u.filter((l,a)=>e.includes(o(a))).map(e=>e.value))})})}const A=u.findIndex(e=>Object.is(e.value,r.value)),I=r.onChange;/* @__PURE__ */
|
|
6
|
+
return s("div",{className:"es-fsel",children:/* @__PURE__ */s(n,{...M,value:A>=0?o(A):"",renderValue:r.renderValue?e=>r.renderValue(V(e)[0]):void 0,valueText:r.valueText?e=>r.valueText(V(e)[0]):void 0,footer:r.footer?.length?[...r.footer]:void 0,changed:r.changed,onChange:e=>{const l=N(e);l&&!Object.is(l.value,r.value)&&I(l.value)}})})}export{t as FieldSelect,r as optionFor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=["desktop","tablet","mobile"],e={desktop:"Desktop",tablet:"Tablet",mobile:"Phone"},n=720,o=1100;function r(t){return t>=1100?"desktop":t>=720?"tablet":"mobile"}function a(t){return`${t}Tablet`}function u(t){return`${t}Phone`}function b(t){return null==t}var p=t=>e=>"number"==typeof e?e*t:e,h=t=>t;var l={spacing:{tablet:p(.75),phone:p(2/3),round:function(t){const e=Math.ceil(Math.abs(t)/4-.5);return 4*(t<0?-e:e)+0}},columns:{tablet:t=>"number"==typeof t?Math.min(t,2):t,phone:t=>"number"==typeof t?1:t},stack:{tablet:h,phone:t=>void 0===t?t:"stacked"},textSize:{tablet:p(.85),phone:p(.7/.85),round:Math.round},heightMode:{tablet:h,phone:t=>"px"===t?"fit":t},heightPx:{tablet:p(.75),phone:h,round:Math.round},same:{tablet:h,phone:h}},i=Object.fromEntries(Object.keys(l).map(t=>[t,{tablet:h,phone:h}]));function c(t,e,n,o,r=l){const a=r[t],u=t=>a.round&&"number"==typeof t?a.round(t):t,p=b(n)?a.tablet(e):n,h=b(o)?a.phone(p):o;return{desktop:e,tablet:b(n)?u(p):n,phone:b(o)?u(h):o}}function s(t,e){return c("same",t,e,void 0,i).phone}export{l as AUTO_RULES,i as FOLLOW_RULES,o as VIEW_DESKTOP_MIN,n as VIEW_TABLET_MIN,t as VIEW_TIERS,e as VIEW_TIER_LABEL,b as isAuto,u as phoneKey,c as resolveViewValue,a as tabletKey,s as viewFollows,r as viewTierForWidth};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import{markedTreeNodeId as e,revealSelectedTreeRow as n,sameSelector as t}from"./chunk-UMBNBCL4.js";import{cloneNodeWithFreshIds as o}from"./chunk-OXZDSOZV.js";import{dedupeSlotChildren as r}from"./chunk-7OCEPOEJ.js";import{styleClipboardOf as i}from"./chunk-VNUXFD4X.js";import{scrollPreviewToSection as l,gotoPreviewSlide as s}from"./chunk-LUOY3A3Q.js";import{useEaselKeyTarget as d,useEaselUndoKeys as a,useEaselSaveKey as c,editorRootFocus as p}from"./chunk-RTMDZJNE.js";import{SlotChildActionsProvider as u}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as f,DEFAULT_PANEL_W as h,clampPanelWidth as m}from"./chunk-TQUEVJOO.js";import{usePartBridge as g}from"./chunk-J5VPNHOW.js";import{useSectionOps as y}from"./chunk-3FANFZ4D.js";import{PageEditGuardNotices as b}from"./chunk-XV5D4V2T.js";import{ScreenSaveIcon as v,ScreenMainButton as k}from"./chunk-2EEYFRQM.js";import{useBrowserOffline as S}from"./chunk-RKTF5XLP.js";import{useScreenDocument as w}from"./chunk-OB4KI2AN.js";import{requestMediaPick as x}from"./chunk-5HYVOOH3.js";import{AddChildRow as z}from"./chunk-5545A3PC.js";import{AddSidePanel as C}from"./chunk-GJ427TZL.js";import{keepsSharedSections as O,sharedSectionsOf as N}from"./chunk-N3MJOHAG.js";import{PanelHideButton as I,SidePanelHead as B,PanelShowStrip as P}from"./chunk-MTWQYLJE.js";import{offeredChoices as $}from"./chunk-RUQOIQWI.js";import{useScreenSaveSwitch as E,useScreenNodeKeys as M,useScreenPinned as T,useScreenDocumentLabel as j,useScreenCanvasFrame as L,useScreenInspectorPanel as A,useScreenDevices as R,useScreenPickFollowsSelection as F,useScreenLeftView as D,SELECTION_MODE as V,isSelectionMode as W,sameInspectorMode as H,useScreenBridges as Y,useScreenBlockRules as U,useScreenBlockLook as J,useScreenStorageNamespace as X,useScreenNotify as G,useScreenCanvasHead as Q,isSlotMode as K,useScreenStyleClipboard as Z,useScreenDocumentPass as _,useScreenCanvasDrag as q,ScreenCanvasTargetProvider as ee,isPinnedFirst as ne,isPinnedLast as te,screenSlotsOf as oe,shownChildSlotsOf as re}from"./chunk-TUIBPB77.js";import{MediaPopup as ie}from"./chunk-T2RINM7R.js";import{useMediaPanel as le,usePanelPick as se,useMediaBrowsing as de,useOpenMediaBrowse as ae,useMediaPlace as ce}from"./chunk-NCXYC7WI.js";import{useNodeClipboard as pe,useNodeContextMenu as ue}from"./chunk-WW24O7HT.js";import{useEaselSession as fe}from"./chunk-YM4UEGBV.js";import{useEaselHost as he,useHostEscape as me}from"./chunk-LX23TCTP.js";import{LayersIcon as ge,MediaIcon as ye}from"./chunk-XFYFKITX.js";import{DEFAULT_SCREEN_WORDS as be}from"./chunk-G2VZ4DET.js";import{heldStyle as ve,styleShortcut as ke}from"./chunk-3OOYGEJY.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as Se}from"./chunk-6WY6ZXJG.js";import{rootRowName as we,slotChildRowName as xe,slotChildRenameProp as ze,sectionRenameProp as Ce}from"./chunk-5NHQ452C.js";import{ROOT_ZONE as Oe,blockNodeActions as Ne,TREE_MAX_DEPTH as Ie,childSlotsOf as Be,slotFieldsOf as Pe,newNodeId as $e,slotChildrenIn as Ee,nestsInTree as Me}from"./chunk-TCAAOYQY.js";import{useEasel as Te,useEaselApi as je,useSettledAction as Le,subscribeLateWrites as Ae,CanvasPartsContext as Re,partHasOwnBox as Fe,CanvasPassThroughContext as De,CanvasSharedContext as Ve}from"./chunk-L36E2WCO.js";import{TreeRow as We,Subtree as He,LayersTree as Ye,TreeGroupLabel as Ue,TreeRowAction as Je,TreeSeam as Xe}from"./chunk-WHS6Y55E.js";import{DEFAULT_TREE_WORDS as Ge}from"./chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as Qe}from"./chunk-WK3AFPXY.js";import{toItemSelector as Ke,useNodeOps as Ze,clickPick as _e}from"./chunk-TF6NAIV7.js";import{EaselTopBar as qe,EaselIconButton as en,TopBarCluster as nn,DeviceSwitch as tn,InspectorIconButton as on,PanelResizeHandle as rn,MAX_PANEL_W as ln,MIN_PANEL_W_BY_SIDE as sn,panelWidthVars as dn}from"./chunk-VTY7OQB5.js";import{DEFAULT_NOTICE_WORDS as an,DEFAULT_CHROME_WORDS as cn}from"./chunk-AJSDWWJW.js";import{holderOf as pn,nameOrSomeone as un}from"./chunk-G7J6SGMF.js";import{DEFAULT_LOCK_WORDS as fn}from"./chunk-RE4LP46F.js";import{useWords as hn}from"./chunk-MFIRYGHW.js";import{insertSeams as mn,CanvasDragLayer as gn,CanvasInsert as yn}from"./chunk-SEC6NV6Y.js";import{DEFAULT_DRAG_WORDS as bn}from"./chunk-TQ5Y6S2X.js";import{createDragSession as vn,useTreeDrag as kn,gapToMoveIndex as Sn}from"./chunk-QEEW4X64.js";import{ROOT_ID as wn,ROOT_SLOT as xn,zoneKey as zn,parseZoneKey as Cn,find as On,DataError as Nn}from"./chunk-YDTEYXQW.js";import{useCanvasFrame as In,LIST_SELECTOR as Bn,BLOCK_SELECTOR as Pn,useCanvasTyping as $n,useCanvasEvent as En,onMotionEnd as Mn}from"./chunk-6GJEOER4.js";import{nodeIdAt as Tn,frameRectToHost as jn,BLOCK_ATTRIBUTE as Ln,drawnBox as An}from"./chunk-FR7EEKFF.js";import{queryMainCopy as Rn}from"./chunk-7UFKEX72.js";import{useRef as Fn,useMemo as Dn,useState as Vn,useEffect as Wn,useCallback as Hn,useLayoutEffect as Yn,useContext as Un,Fragment as Jn,useId as Xn}from"react";import{ColoredBadge as Gn,Button as Qn,Tabs as Kn,toast as Zn,readMediaFileDrag as _n,Tooltip as qn,groupColors as et,Dialog as nt,FormField as tt,Input as ot,MEDIA_FILE_DRAG_TYPE as rt}from"efficient-shell/ui";import{UndoIcon as it,RedoIcon as lt,RefreshIcon as st,AddIcon as dt,TrashIcon as at,EyeOffIcon as ct,EyeIcon as pt,SharedIcon as ut,DuplicateIcon as ft}from"efficient-shell/icons/efficient";import{jsx as ht,jsxs as mt,Fragment as gt}from"react/jsx-runtime";var yt="media-file";function bt({name:e,onMake:n,onCancel:t}){const o=hn("screen",be).shared,[r,i]=Vn(e),[l,s]=Vn(!1),d=Xn(),a=Fn(null),c=async()=>{const e=r.trim();if(e&&!l){s(!0);try{await n(e)}finally{s(!1)}}};/* @__PURE__ */
|
|
2
|
+
return ht(nt,{open:!0,size:"sm",title:o.makeShared,description:o.makeSharedHint,onClose:t,initialFocus:a,footer:/* @__PURE__ */mt(gt,{children:[
|
|
3
|
+
/* @__PURE__ */ht(Qn,{variant:"secondary",onClick:t,children:o.cancel}),
|
|
4
|
+
/* @__PURE__ */ht(Qn,{variant:"primary",loading:l,disabled:!r.trim(),onClick:()=>{c()},children:o.makeShared})]}),children:/* @__PURE__ */ht("form",{onSubmit:e=>{e.preventDefault(),c()},children:/* @__PURE__ */ht(tt,{label:o.name,htmlFor:d,children:/* @__PURE__ */ht(ot,{id:d,ref:a,value:r,onChange:e=>i(e.target.value)})})})})}var vt=/* @__PURE__ */new WeakSet;function kt(e,n,t){const o=On(e,n,t);if(!o)return null;const r=o.path.find(e=>"root"!==e.parentId);return r?r.parentId:t}function St(e,n,t){const o=o=>o>=t.left&&o+e.width<=t.left+t.width&&n.every(n=>n.right<=o||n.left>=o+e.width||n.bottom<=e.top||n.top>=e.top+e.height);if(n.every(n=>n.right<=e.left||n.left>=e.left+e.width||n.bottom<=e.top||n.top>=e.top+e.height))return e.left;const r=n.map(e=>e.right+4).filter(n=>n>e.left&&o(n));if(r.length)return Math.min(...r);const i=n.map(n=>n.left-4-e.width).filter(n=>n<e.left&&o(n));return i.length?Math.max(...i):e.left}function wt({canvas:e,tabs:n,onSelect:t,onPointer:o}){const r=Fn(null),[i,l]=Vn({}),s=Fn({id:null,places:{},measure:null});s.current.places=i;const d=!(null===s.current.id||n.some(e=>e.id===s.current.id)&&i[s.current.id]);Wn(()=>{d&&(s.current.id=null,o(null))},[d,o]),Wn(()=>()=>{null!==s.current.id&&o(null)},[o]);const a=n.map(e=>`${e.id}:${e.below?1:0}:${e.label}:${e.reach??""}`).join("|");return Yn(()=>{const t=e?.document,o=e?.window,i=e?.frame;if(!t||!o||!i||0===n.length)return void l(e=>0===Object.keys(e).length?e:{});let d=0;const a=()=>{d=0;const e=r.current;if(!e)return;const a=jn(i,{left:0,top:0,width:o.innerWidth,height:o.innerHeight},e),p={};let u=!1;const f=e.getBoundingClientRect(),h=[...e.parentElement?.querySelectorAll(".es-canvas-handle.is-shown:not(.is-dragging), .es-canvas-tag, .es-canvas-hint")??[]].map(e=>{const n=e.getBoundingClientRect();return{left:n.left-f.left,top:n.top-f.top,right:n.right-f.left,bottom:n.bottom-f.top}});for(const r of n){const n=o.CSS?.escape?o.CSS.escape(r.id):JSON.stringify(r.id).slice(1,-1),l=Rn(t,`[${Ln}="${n}"]`),d=l?An(l):null;if(!d||0===d.height){p[r.id]=null;continue}const c=jn(i,{left:d.left,top:d.top,width:d.width,height:d.height},e),f=c.top+c.height;if(f<a.top||c.top>a.top+a.height){p[r.id]=null;continue}const m=r.below?f+4:Math.max(c.top,a.top)+6,g=e.querySelector(`[data-band-tab="${n}"]`);g||(u=!0);const y=Math.max(c.left,a.left)+6,b=g?.offsetHeight??0,v=g?.offsetWidth??0,k=s.current.id===r.id?s.current.places[r.id]:null,S=k?k.left:St({left:y,top:m,width:v,height:b},h,a);v>0&&b>0&&h.push({left:S,top:m,right:S+v,bottom:m+b}),p[r.id]={left:S,top:m}}l(e=>function(e,n){const t=Object.keys(e);return t.length===Object.keys(n).length&&t.every(t=>{const o=e[t],r=n[t];return o===r||!!o&&!!r&&o.left===r.left&&o.top===r.top})}(e,p)?e:p),u&&c()},c=()=>{d||(d=o.requestAnimationFrame(a))};s.current.measure=c,a(),o.addEventListener("scroll",c,!0),o.addEventListener("resize",c);const p=Mn(o,c),u=new o.MutationObserver(c);u.observe(t.body,{childList:!0,subtree:!0,attributes:!0});const f=r.current?.parentElement,h=f?.ownerDocument.defaultView?.MutationObserver,m=h?new h(c):null;return f&&m?.observe(f,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","style"]}),()=>{d&&o.cancelAnimationFrame(d),o.removeEventListener("scroll",c,!0),o.removeEventListener("resize",c),p(),u.disconnect(),m?.disconnect(),s.current.measure=null}},[e,a]),/* @__PURE__ */ht("div",{ref:r,className:"es-band-tabs","aria-hidden":"true",children:n.map(e=>{const n=i[e.id];return n?/* @__PURE__ */ht("span",{className:"es-band-tab","data-band-tab":e.id,style:{left:n.left,top:n.top},onMouseEnter:()=>{s.current.id=e.id,o(e.id)},onMouseLeave:()=>{s.current.id=null,o(null),s.current.measure?.()},onClick:n=>{n.stopPropagation(),t(e.id)},children:e.reach?
|
|
5
|
+
/* @__PURE__ */ht(qn,{content:e.reach,children:/* @__PURE__ */mt(Gn,{colorClass:et("success","solid"),size:"sm",children:[
|
|
6
|
+
/* @__PURE__ */ht("span",{className:"es-band-tab-mark",children:/* @__PURE__ */ht(ut,{size:12})}),e.label]})}):/* @__PURE__ */ht(Gn,{colorClass:et("info","solid"),size:"sm",children:e.label})},e.id):null})})}function xt({expand:e}){/* @__PURE__ */
|
|
7
|
+
return ht("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */mt(gt,e?{children:[
|
|
8
|
+
/* @__PURE__ */ht("path",{d:"M8 9l4-4 4 4"}),
|
|
9
|
+
/* @__PURE__ */ht("path",{d:"M8 15l4 4 4-4"})]}:{children:[
|
|
10
|
+
/* @__PURE__ */ht("path",{d:"M8 4l4 4 4-4"}),
|
|
11
|
+
/* @__PURE__ */ht("path",{d:"M8 20l4-4 4 4"}),
|
|
12
|
+
/* @__PURE__ */ht("path",{d:"M5 12h14"})]})})}var zt=`${Bn}, ${Pn}`;function Ct(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 Ot="__rungs",Nt=e=>"template"===e.kind?e.template.id:"shared"===e.kind?e.section.id:"preset"===e.kind?e.preset.key:e.type;var It="screen:band",Bt={duplicate:!0,delete:!0},Pt=()=>null;function $t(){const Bn=he(),jn=Bn.panels?.Toolbar,Ln=(Bn.panels?.useRight??Pt)(),{target:An,docId:Xn,capabilities:qn,currentSlug:et,siteId:nt,onPublish:tt,saveState:ot,saveConflict:ut,retrySave:St,toggleAutoSave:$t,flushSave:Et,access:Mt,saveUnreachable:Tt=!1,readOnly:jt,readOnlyReason:Lt=null}=w(),At=E(),Rt=M(),{mediaEditing:Ft,hasEditGuard:Dt,hasPinnedChrome:Vt}=qn,{appState:Wt,dispatch:Ht,history:Yt,selectedItem:Ut,getSelectorForId:Jt,config:Xt}=Te(e=>e),Gt=T(),{first:Qt,firstGroup:Kt,lastGroup:Zt,isSectionGroup:_t,sectionGroupZone:qt,panelOf:eo}=Gt,no=eo(Qt),to=e=>ne(Gt,e),oo=e=>te(Gt,e),ro="node"===Gt.firstRow,io=Gt.band??null,lo=hn("screen",be),so=hn("tree",Ge),ao=hn("drag",bn),co=hn("notice",an),po=hn("lock",fn),uo=hn("menu",Qe),fo=hn("styleClipboard",Se),ho=hn("chrome",cn),mo=j()??`/${et}`,go=L(),yo=A(),bo=y({readOnly:jt}),vo=y({readOnly:jt,foldIntoHistory:!0}),ko=Fn(null),So=je(),wo=Dn(()=>({...bo,select:e=>{ko.current=e,bo.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=So.config;ko.current=Ke(e,t,n)}bo.commitDocument(e,n)}}),[bo,So]),xo=Wt.ui,zo=xo.leftSideBarVisible,Co=xo.rightSideBarVisible,{options:Oo,widths:No,initial:Io,fluid:Bo,fit:Po}=R(),[$o,Eo]=Vn(Io),Mo=le(),To=Ft&&null!==Mo;se(),de();const jo=ae();F(Ut?.props.id);const{read:Lo,write:Ao,forSelection:Ro}=D(),[Fo,Do]=Vn(Lo);Wn(()=>{Ao(Fo)},[Fo]);const[Vo,Wo]=Vn(0),Ho=Fn(null),Yo=Fn(null),Uo=In(Yo,{readySelector:zt}),Jo=$n(Uo),Xo=d(Yo);a(Yo,Uo);const Go=S(),Qo=pn(Mt),Ko={state:ot,offline:Go||ot.failed&&Tt,readOnlyReason:Lt,editing:Qo?co.editing({name:un(Qo.name,po),noun:lo.noun}):null,conflict:null!=ut,notSaving:lo.bar.notSaving},Zo=Le({onPress:()=>{jt||(ot.failed?St():Et())}}).onPress;c(Yo,Uo,Zo);const[_o,qo]=Vn(!1),er=Fn(!1),[nr,tr]=Vn(null),[or,rr]=Vn([]),[ir,lr]=Vn(V);W(ir);const sr=e(ir,Ut?.props.id),[dr,ar]=Vn(null);Wn(()=>{dr&&(n(),ar(null))},[dr]);const cr=Fn(Jt);cr.current=Jt;const pr=Hn((e,{scroll:n})=>{Do(n=>Ro(e,n)),n&&ar(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=cr.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&Vr(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),ur=Fn(null);Wn(()=>{const e=ur.current;ur.current=null;const n=null==Ut?.props.id?null:String(Ut.props.id);lr(t=>e&&e.id===n?e.mode:"part"===t.kind&&"nodeId"in t&&t.nodeId===n?t:eo(Ut?.type)??V);const o=Ut?.props.id,r=ko.current;if(ko.current=null,!o)return;const i=Jt(o);pr(String(o),{scroll:!t(r,i??null,Oe)})},[Ut?.props.id,pr]);const fr=Hn(e=>{lr(n=>H(n,e)?n:e),Ht({type:"setUi",ui:{rightSideBarVisible:!0}})},[Ht]),hr=Fn(()=>{});hr.current=(e,n)=>{const t=e?Ri(e.zone??Oe)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==Ut?.props.id?null:String(Ut.props.id);lr(e=>H(e,n)?e:n),o!==r&&(ur.current={id:o,mode:n},wo.select(e))};const mr=Hn((e,n)=>hr.current(e,n),[]),gr={kind:ir.kind,mode:ir,open:fr,show:e=>lr(e),reveal:()=>{Co||Ht({type:"setUi",ui:{rightSideBarVisible:!0}})},select:mr},yr=Y(gr,{data:Wt.data,selected:Ut??null,zoneOf:e=>Jt(e)?.zone,readOnly:Boolean(jt),select:e=>{lr(V),wo.select({index:e})},replace:(e,n)=>wo.replaceComponent(Oe,e,n),scrollTo:e=>l(e)},{device:$o,refreshes:Vo},{setView:Do,reveal:()=>{zo||Ht({type:"setUi",ui:{leftSideBarVisible:!0}})}}),br=yr.resolveLeftView?yr.resolveLeftView(Fo):"sections",vr=U(),{isLockedBlock:kr,duplicateBlocked:Sr,nestDepth:wr,newSectionNode:xr,canAddTo:zr,blockIsOffered:Cr}=vr,Or=e=>({id:String(e.props.id??""),data:Wt?.data}),Nr=J(),{labelAtLevel:Ir,Icon:Br,useProducts:Pr}=Nr,$r=Nr.rowName?(e,n,t)=>Nr.rowName(e,n,t):void 0,Er=Hn(e=>{Ht({type:"setUi",ui:{rightSideBarVisible:!0}}),l(e),pr(e,{scroll:!0})},[Ht,pr]),{selectNode:Mr,openPartId:Tr}=g({mode:ir,setMode:lr,onOpenPart:Er}),[jr,Lr]=Vn(null);me(null!==jr,()=>Lr(null));const Ar=f(X()),Rr=Ar.collapsed,Fr=Ar.panelWidths,[Dr,Vr]=Vn(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(Rr);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
|
|
13
|
+
return new Set}});Wn(()=>{try{window.localStorage.setItem(Rr,JSON.stringify([...Dr]))}catch{}},[Dr]);const[Wr,Hr]=Vn(()=>{if("undefined"==typeof window)return{...h};try{const e=window.localStorage.getItem(Fr);if(!e)return{...h};const n=JSON.parse(e);return{left:m(Number(n.left)||h.left,"left"),right:m(Number(n.right)||h.right,"right")}}catch{return{...h}}});Wn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(Fr,JSON.stringify(Wr))}catch{}},300);return()=>clearTimeout(e)},[Wr]);const Yr=Hn((e,n)=>Hr(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),Ur=Hn(e=>Yr("left",e),[Yr]),Jr=Hn(e=>Yr("right",e),[Yr]),Xr=e=>Dr.has(e),Gr=e=>Vr(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Qr=Fn(!1),Kr=Fn(null);Wn(()=>{if(Qr.current&&!_o){const e=Kr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??Yo.current?.querySelector(`button[aria-label="${CSS.escape(lo.add.title)}"]`))?.focus(),Kr.current=null}Qr.current=_o},[_o]),Wn(()=>{if(!_o||!Xo)return;const e=e=>{"Escape"===e.key&&yl()};return Xo.addEventListener("keydown",e),()=>Xo.removeEventListener("keydown",e)},[_o,Xo]),me(_o,()=>yl()),Wn(()=>{!zo&&_o&&(qo(!1),tr(null),er.current=!1)},[zo]);const Zr=G(),_r=(e,n="success",t)=>{if(Zr)return void(t?Zr(e,"error"===n?"error":"info",t):Zr(e,"error"===n?"error":"info"));const o={sound:!1,action:t?.action,onClose:t?.onClose};"error"===n?Zn.error(e,{...o,duration:t?.duration??3200}):Zn.success(e,{...o,duration:t?.duration??1900})},qr=Le(yr.mainAction??{label:lo.done,onPress:()=>{tt(So.getState().appState.data)}}),ei=Fn(_r);ei.current=_r,Wn(()=>Ae(So,()=>ei.current(lo.writeLate,"error")),[So,lo]);const ni=Fn(null),[ti,oi]=Vn(0),[ri,ii]=Vn(0),li=Q(),si=Fn(null),di=e=>Math.max(0,e.clientHeight-(si.current?.offsetHeight??0));Wn(()=>{const e=ni.current;if(!e)return;const n=()=>{oi(e.clientWidth),ii(di(e))};n();const t=new ResizeObserver(n);return t.observe(e),si.current&&t.observe(si.current),()=>t.disconnect()},[]),Yn(()=>{ni.current&&(oi(ni.current.clientWidth),ii(di(ni.current)))},[Wr,zo,Co]);const ai=$o===Bo?ti>0?ti:No[Bo]:No[$o],ci=ti>0?Math.min(ti/ai,"shrink"===Po?1:2):1,pi=ai*ci,ui=ti>0&&pi>ti+1,fi={width:pi,height:ri||"100%",flex:"none",position:"relative"},hi={width:ai,height:ri?ri/ci:"100%",maxHeight:"none",transform:1!==ci?`scale(${ci})`:void 0,transformOrigin:"top left"},mi=()=>Ht({type:"setUi",ui:{leftSideBarVisible:!zo}}),gi=()=>Ht({type:"setUi",ui:{rightSideBarVisible:!Co}}),yi=e=>{_o&&(qo(!1),tr(null),er.current=!1,zo&&Fo===e)||(Do(e),zo||Ht({type:"setUi",ui:{leftSideBarVisible:!0}}))},bi=()=>{lr(no??V),Co||Ht({type:"setUi",ui:{rightSideBarVisible:!0}})},vi=Wt.data.content??[],ki=()=>{const e=vi.findIndex(to),n=vi.findIndex(oo);return{floor:e>=0?e+1:0,cap:n>=0?n:vi.length}},Si=Xt,wi=vr.stripCopy,xi=e=>o(e,wi),zi=pe(),Ci=Ze({data:Wt.data,config:Si,readOnly:Boolean(jt),clipboard:zi,strip:wi?e=>wi(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==wn||e.slot!==xn)return{min:0,max:n-1};const{floor:t,cap:o}=ki();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&lr(V);const t=void 0===n||"node"===n?.kind?n:null;wo.commitDocument(e,t)}}),Oi=fe(),[Ni,Ii]=Vn(null),Bi=e=>{const n=vi.find(n=>String(n.props.id)===e),t=Gt.shared;n&&t&&Ci.swap(e,t.detach(n))},Pi=e=>{const n=On(Wt.data,Xt,e);if(!n)return!1;const t=zn(n.place),o=n.node,r=t===Oe?ji(o):Ki(o),i=t===Oe?Gt.shared?.usedOn(o):null;return!!Ci.remove(e)&&(_r(i?lo.shared.removed({count:Math.max(0,i.length-1)}):lo.deleted({name:r}),"success",{duration:8e3,action:{label:lo.bar.undo,onClick:()=>{Ci.restore(n.node,n.place)}}}),!0)},$i={...Ci,remove:Pi},Ei=e=>Ir(e,"block",Xt.components[e]?.label??e),Mi=Hn(e=>Xt.components[e]?.defaultProps??{},[Xt]),Ti=e=>Ir(e,"section",Ei(e)),ji=e=>we({type:e.type,props:e.props??{}},Ti(e.type),$r),{nodeAddresses:Li,zoneItems:Ai}=Dn(()=>{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>=Ie)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of Be(Xt,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(vi,Oe,0),{nodeAddresses:e,zoneItems:n}},[vi,Xt]),Ri=Hn(e=>Ai.get(e)??[],[Ai]),Fi=e=>{const n=Li.get(e);return n?Ri(n.zone)[n.index]:void 0},Di=e=>oe(vr,Xt,e),Vi=e=>{if(!vr.slotsOf||e===Oe)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=Fi(e.slice(0,n));if(!t)return null;const o=Di(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}},Wi=(()=>{if(!K(ir))return null;const e=`${ir.nodeId}:${ir.slot}`;return Vi(e)?.slot.panel===ir.kind?e:null})(),Hi=Fn(null);Wn(()=>{const e=Hi.current;if(Hi.current=null,!Wi||!K(ir))return;const n=ir.nodeId;pr(n,{scroll:e!==Wi}),Vr(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[ir]);const Yi=e=>{const n=Li.get(e);n&&(n.zone===Oe?cl(n.index):Al(n.zone,n.index,e,Fi(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))},Ui=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void Yi(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&Wi!==i&&(Hi.current=i),mr(null,r),Co||Ht({type:"setUi",ui:{rightSideBarVisible:!0}}),l(o)},Ji=(e,n,t)=>{const o=`${e}:${n}`;if(Vr(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;Wi!==o&&(Hi.current=o);mr(null,{kind:t,nodeId:e,slot:n})},Xi=(e,n,t)=>{if(jt||!vr.moveSlot)return;const o=Fi(e),r=o?Di(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:Ot,index:n},s=Sn(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=vr.moveSlot(e,n,s);"string"==typeof d&&Ji(e,d,i.panel)},Gi=Pr(),Qi=Dn(()=>{const e=/* @__PURE__ */new Map;for(const n of Gi??[])e.set(n.slug,n.name);return e},[Gi]),Ki=e=>xe(e,Ei,Nr.plainText,e=>Qi.get(e),Nr.rowName),Zi=(e,n)=>{const t=Xt.components[e.type]?.fields,o=n===Oe||as(n)?"section":"block",r=n===Oe&&(to(e)||oo(e)||_t(e.type)),i="block"===o?ze(t):r?null:Ce(t);return Nr.renamePropOf?Nr.renamePropOf(e,o,i):i},_i=(e,n,t,o)=>{if(!(!jt&&jr?.zone===e&&jr.index===n))return;const r=(t,o)=>{Lr(null),o&&((e,n,t)=>{const o=Ri(e)[n];if(!o)return;const r=Zi(o,e);r&&wo.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
|
|
14
|
+
return ht("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":lo.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)},qi=i(Z(),fo),el=qi.scope({target:An,siteId:nt,docId:Xn}),nl=Xt,tl=(e,n)=>n===Oe?Ti(e):Ei(e),ol=(e,n,t)=>{const o=qi.plan(el,t,tl(t.type,e),nl);o&&(o.changed&&wo.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),_r(o.message))},rl=ue({nodesIn:Ri,nodeAt:(e,n)=>Ri(e)[n]??null,labelOf:(e,n)=>n===Oe?Ti(e):Ei(e),renamePropOf:Zi,beginRename:(e,n)=>Lr({zone:e,index:n}),history:{hasPast:Yt.hasPast,hasFuture:Yt.hasFuture,back:()=>Yt.back(),forward:()=>Yt.forward()},openPageStyles:yr.openPageStyles,pageStylesLabel:lo.pageStyles,words:{menu:uo,styleClipboard:fo,screen:lo.menu},readOnly:Boolean(jt),collapseAll:()=>Vr(new Set(Ri(Oe).map(e=>String(e.props.id)))),onPasteRefused:e=>_r(e?lo.pasteRefused({name:e.label}):lo.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>us(e,n),copyItem:yr.onCopyItem,menuRows:(e,n,t)=>{const o=yr.menuRows?.(e,n,t)??null,r=((e,n)=>{const t=Gt.shared;if(!t||n!==Oe)return null;const o=t.usedOn(e);if(o){const n={pick:[{label:lo.shared.onPages({count:o.length}),onClick:()=>{},children:o.map(e=>({label:e.title,onClick:()=>t.openPage(e)}))}]};return jt||kr(e.type,e)?n:{...n,change:[{label:lo.shared.detach,onClick:()=>Bi(e.props.id)}],remove:[{label:lo.shared.removeFromPage,danger:!0,onClick:()=>{Pi(e.props.id)}}]}}return jt||to(e)||oo(e)||_t(e.type)?null:O(Oi)?{change:[{label:lo.shared.makeShared,onClick:()=>Ii({id:e.props.id,name:ji(e)})}]}:null})(e,n);if(!r)return o;return Object.fromEntries(["pick","make","change","remove"].map(e=>[e,[...o?.[e]??[],...r[e]??[]]]).filter(([,e])=>e.length>0))},isLocked:e=>kr(e.type,e),duplicateBlocked:e=>Sr(Wt.data,e),permits:e=>{const n=Ne(Xt,e.type);return Gt.shared?.usedOn(e)?{...n,delete:!1}:n},nodeOps:$i,isPinned:(e,n)=>n===Oe&&(to(e)||oo(e)),sectionBand:ki,locate:e=>Li.get(e)??null,rowNameOf:(e,n)=>n===Oe?ji(e):Ki(e),selectAt:(e,n,t,o)=>{e===Oe?cl(n):Al(e,n,t,o??"")},slotRung:e=>{const n=Vi(e);return n?.slot.panel?{label:n.slot.label,select:()=>Ui(n.node,n.slot,!1)}:null},style:{held:()=>ve(el),canCopy:e=>qi.rows(nl,e).some(e=>!1!==e.counted),copy:(e,n)=>qi.copy(el,e,tl(e.type,n),nl),paste:(e,n,t)=>ol(e,n,t)},keys:Rt?{target:Xo,selected:()=>{const e=Wt.ui.itemSelector;return e?{zone:e.zone??Oe,index:e.index}:null},held:()=>zi.get(),readOnly:Boolean(jt),onDone:({done:e,name:n})=>{"copied"===e&&_r(lo.copied({name:n}))}}:void 0},Uo),il=Fn({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});Wn(()=>{il.current={copy:(e,n)=>qi.copy(el,e,tl(e.type,n),nl),paste:ol,at:()=>{const e=Wt.ui.itemSelector;if(!e)return null;const n=e.zone??Oe,t=Ri(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(jt)}});const ll=Hn(e=>{const n=ke(e);if(!n)return;const t=il.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))},[]);Wn(()=>{if(!Xo)return;const e=e=>ll(e);return Xo.addEventListener("keydown",e),()=>Xo.removeEventListener("keydown",e)},[ll,Xo]),En(Uo,"keydown",ll);const sl=vi.map(e=>e.props.id).join("|");Wn(()=>{const e=Uo?.document??null,n=Uo?.window??null;let t=0;const o=[],r=()=>{if(!e)return void rr(e=>e.length?[]:e);const n=vi.findIndex(oo),t=n>=0?n:vi.length,o=n=>{const t=vi[n]?.props?.id;return null==t?null:Rn(e,`[data-easel-block="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(Pn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=vi.length>0&&!to(vi[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=Ct(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})}rr(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=Mn(n,i),s=new ResizeObserver(i);return s.observe(e.documentElement),r(),o.push(setTimeout(r,150),setTimeout(r,450)),()=>{cancelAnimationFrame(t),o.forEach(clearTimeout),n.removeEventListener("scroll",i),l(),s.disconnect()}},[Uo,sl,$o,ci,zo,Co,Ut?.props.id]);const dl=Uo?.document??null,al=Uo?.window??null;Wn(()=>{const e=Ho.current;if(!e||!dl||!al)return;const n=[],t=()=>{const n=Rn(dl,`[data-easel-block="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&al.scrollTo({left:al.scrollX,top:al.scrollY+t,behavior:"instant"}),!0};return Ho.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[dl,al]);const cl=e=>{lr(V),wo.select({index:e}),yr.sectionPressed?.(vi[e]);const n=vi[e]?.props?.id;n&&l(n)},pl=e=>{const{floor:n,cap:t}=ki(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=Ut&&ir.kind!==no?.kind?vi.findIndex(e=>e.props.id===Ut.props.id):-1;return o(r>=0?r+1:t)},ul=(e,n)=>{const{floor:t,cap:o}=ki(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(wo.reorderComponent(Oe,e,i),wo.select({index:i}),{moved:!0,dest:i})},fl=(e,n,t,o)=>{lr(V),wo.select(o?{index:o.index,zone:o.zone}:{index:e}),l(n),_r(lo.sectionAdded({name:t}))},hl=(e,n)=>{const t=pl(n),o=xr(e,{nodeDefaults:Mi,newNodeId:$e,sectionLabel:Ti,blockIsOffered:Cr}),r=o?wo.insertNode(Oe,t,o):wo.insertSection(e,t);return fl(t,r,Ti(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:a}of Be(Xt,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=zr(e.type,l,d.slice(d.lastIndexOf(":")+1),Or(e)),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:a,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},ml=e=>gl(Oe,e),gl=(e,n)=>{Kr.current=document.activeElement??null,tr(null===n?null:{zone:e,index:n}),qo(!0),zo||(er.current=!0,Ht({type:"setUi",ui:{leftSideBarVisible:!0}}))},yl=()=>{qo(!1),tr(null),er.current&&Ht({type:"setUi",ui:{leftSideBarVisible:!1}}),er.current=!1},bl=(e,n)=>Nr.rowName?n?to(e)?Nr.rowName(e,"section",lo.header):oo(e)?Nr.rowName(e,"section",lo.footer):_t(e.type)?Nr.rowName(e,"section",Ei(e.type)):ji(e):Ki(e):n?Ti(e.type):Ei(e.type),vl=e=>n=>{e()},kl=(e,n,t)=>{if(jt)return null;const o=Ri(e)[n];return o&&!Ne(Xt,o.type).delete||o&&kr(o.type,o)?null:/* @__PURE__ */ht(Je,{kind:"delete",label:e===Oe&&o&&Gt.shared?.usedOn(o)?lo.shared.removeFromPage:lo.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=Ri(e)[n]?.props?.id;null!=t&&Pi(String(t))})(e,n),children:/* @__PURE__ */ht(at,{size:15})})},Sl=e=>Nr.rowPreview?.(e)||void 0,wl=e=>Nr.rowMarks?.(e)??void 0,xl=(e,n,t)=>Nr.rowActions?.(e,n,t)??null,zl=(e,n,t,o)=>{if(jt)return null;if(kr(t.type,t))return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
|
|
15
|
+
return ht(Je,{kind:"eye",label:r?lo.showNamed({name:o}):lo.hideNamed({name:o}),onClick:()=>Ol(e,n,t),children:/* @__PURE__ */ht(r?ct:pt,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},Cl=e=>id(Oe,e),Ol=(e,n,t)=>{wo.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},Nl=e=>Pe(Xt,e),Il=e=>Be(Xt,e),Bl=e=>vr.slotsOf?Di(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:Ee(e,n.slot)})):[{slot:null,rung:null,kids:re(Xt,e)}],Pl=e=>vr.slotsOf?Bl(e).flatMap(e=>e.kids):re(Xt,e),$l=e=>Boolean(vr.slotsOf)&&Di(e).some(e=>e.rung),El=(e,n,t)=>zr(e.type,n,t??void 0,Or(e)),Ml=(e,n,t)=>{const o=Me(Xt,e.type,n)&&(t||Pl(e).length>0||$l(e));return{collapsible:o,folded:o&&Xr(String(e.props.id))}},Tl=(e,n,t)=>Bl(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>Ml(e,r,t(e.type)).collapsible?[String(e.props.id),...Tl(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),jl=e=>Pl(e).length>0||$l(e)||Boolean(zr(e.type)),Ll=e=>Boolean(zr(e)),Al=(e,n,t,o)=>{if(lr(V),zr(o)?.spec?.slider){const t=e.split(":")[0];s(t,n),wo.select({index:n,zone:e}),l(t)}else wo.select({index:n,zone:e}),l(t)},Rl=(e,n,t,o,r)=>{const i=`${e}:${n}`;wo.insertComponent(i,t,o),zr(r)?.spec?.slider?requestAnimationFrame(()=>{s(e,o),wo.select({index:o,zone:i})}):wo.select({index:o,zone:i})},Fl=Fn(/* @__PURE__ */new Set);Wn(()=>{vi.forEach(e=>{const n=zr(e.type)?.spec;if(!n)return;const t=e.props.id;if(Fl.current.has(t))return;Fl.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(Mi)).forEach((e,t)=>vo.seedChild(o,t,n.childType,e))})},[vi,vo,Mi]);const Dl=Fn(/* @__PURE__ */new Set);Wn(()=>{vi.forEach((e,n)=>{const t=e.props.id;if(Dl.current.has(t))return;const o=r(e,Nl(e.type));Dl.current.add(t),o&&vo.replaceComponent(Oe,n,{...e,props:o})})},[vi,vo]),_(vo,Xt);const Vl=vi.findIndex(oo),Wl=Vl>=0?vi[Vl]:null,Hl=ro?vi.findIndex(to):-1,Yl=Hl>=0?vi[Hl]:null,Ul=Gt.groupTab,Jl=Dn(()=>Ul?e=>_t(e.type):void 0,[Ul]),Xl=Boolean(Gt.groupBadge),Gl=Gt.sharedReach,Ql=e=>Gl?.(e)??void 0,Kl=Dn(()=>Gl?new Set(vi.filter(e=>Ql(e)).map(e=>String(e.props.id))):null,[vi,Gl]),Zl=Dn(()=>Kl?e=>Kl.has(e):void 0,[Kl]),_l=Gt.first?Gl?.({type:Gt.first,props:{id:""}})??void 0:void 0,ql=Gt.groupBadge?/* @__PURE__ */ht("span",{className:"es-tree-group-badge",children:/* @__PURE__ */ht(Gn,{tone:"info",size:"xs",children:Gt.groupBadge})}):void 0,es=vi.find(e=>e.type===Kt)??null,ns=vi.find(e=>e.type===Zt)??null,ts=Vl>=0?Vl:vi.length,os=[];vi.forEach(e=>{oo(e)||(jl(e)&&os.push(String(e.props.id)),os.push(...Tl(e,1,Ll)))}),Wl&&(os.push(String(Wl.props.id)),os.push(...Tl(Wl,1,Ll)));const rs=os.length>0&&os.every(e=>Dr.has(e)),is=e=>{const n=Nr.blockRowName(e,Ei);return Nr.rowName?Nr.rowName(e,"block",n):n},ls=(e,n,t,o)=>{const r=Ri(e)[t];if(!r)return;const i={...Cn(e),index:t},l={...Cn(n),index:Math.min(Math.max(o,0),Ri(n).length)},s=Sn(i,l);if(e!==n||s!==t)try{Ci.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof Nn))throw e}},ss=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of Il(e))n.add(r),t(o)};for(const t of Nl(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},ds=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Li.get(n);if(!e)return null;if(e.zone===Oe)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},as=e=>{const n=e.slice(0,e.indexOf(":")),t=vi.find(e=>_t(e.type)&&String(e.props.id)===n);return t&&qt(n)===e?t:null},cs=(e,n)=>{const t=as(e);return!t||(!Gt.groupAccepts||Gt.groupAccepts(t.type,n,Ri(e).length))},ps=(e,n,t)=>{if(e.rung){const t=Fi(e.rung.nodeId),o=t?Di(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===Ot&&n.index>=0&&n.index<=o}if(n.slot===Ot)return!1;if(e.add)return ms(e.add,n);const o=zn(n);if(_t(e.type))return!1;const r=as(o),i=as(e.zone);if(r||i)return!(!r||!i)&&(!(r!==i&&!cs(o,e.type))&&(n.index>=0&&n.index<=Ri(o).length));if(e.zone===Oe||o===Oe){if(e.zone!==o)return!1;const{floor:t,cap:r}=ki();return n.index>=t&&n.index<=r}if(n.index<0||n.index>Ri(o).length)return!1;if(e.zone===o)return!0;const l=Wl&&!Gt.lastIsOpen?String(Wl.props.id):null;return(!l||ds(e.zone)!==l&&ds(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??Ri(e)[t];if(!r)return!1;const i=n.split(":")[0],l=Li.get(i),s=l?Ri(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&ss(r).has(n))return!1;const d=zr(s.type,wr(Wt?.data,s.type,i),n.slice(n.lastIndexOf(":")+1),Or(s));return!!d&&(!!(d.choices?d.choices.some(e=>e.type===r.type):d.spec?.childType===r.type)&&!d.spec?.addBlocked?.(Ri(n),r))})(e.zone,o,e.index,t)},us=(e,n)=>{const t=zn(e.from),o=e.node;return t===zn(n)?cs(t,o.type):ps({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},fs=e=>{const n=e.slice(0,e.indexOf(":")),t=Li.get(n),o=t?Ri(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=zr(o.type,wr(Wt?.data,o.type,n),e.slice(e.lastIndexOf(":")+1),Or(o));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:Ei(r.spec.childType)}]:[])),l=Vi(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:bl(o,t.zone===Oe)}},hs=(e,n)=>{if("section"!==e.kind)return e;const t=zn(n);return t===Oe||as(t)?e:fs(t)?.choices.some(n=>n.type===e.type)?{kind:"block",type:e.type}:e},ms=(e,n)=>{const t=hs(e,n),o=zn(n);if("shared"===t.kind){if(o!==Oe||!Gt.shared?.nodeOf(t.section))return!1;const{floor:e,cap:r}=ki();return n.index>=e&&n.index<=r}if("block"!==t.kind){if(as(o)){if("preset"===t.kind)return!1;const e="section"===t.kind?t.type:t.template.node.type;return cs(o,e)&&n.index>=0&&n.index<=Ri(o).length}if(o!==Oe)return!1;const{floor:e,cap:r}=ki();return n.index>=e&&n.index<=r}if(o===Oe)return!1;const r=fs(o);return!(!r||!r.choices.some(e=>e.type===t.type))&&!r.target.spec?.addBlocked?.(Ri(o))},gs=(e,n)=>{const t=hs(e,n);if("block"!==t.kind&&as(zn(n)))return void((e,n,t)=>{const o="section"===e.kind?e.type:"template"===e.kind?e.template.node.type:null;if(o&&cs(n,o)){if("section"===e.kind)wo.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;wo.insertNode(n,t,xi(e.template.node))}lr(V),wo.select({index:t,zone:n})}})(t,zn(n),n.index);if("section"===t.kind)return void hl(t.type,n.index);if("template"===t.kind)return void((e,n,t)=>{const o=pl(t),r=wo.insertNode(Oe,o,n);fl(o,r,e)})(t.template.name,xi(t.template.node),n.index);if("preset"===t.kind)return void((e,n,t)=>{const o=n({nodeDefaults:Mi,newNodeId:$e,sectionLabel:Ti,blockIsOffered:Cr});if(!o)return;const r=pl(t),i=wo.insertNode(Oe,r,o);fl(r,i,e)})(t.preset.label,t.preset.insert,n.index);if("shared"===t.kind){const e=Gt.shared?.nodeOf(t.section);if(!e)return;const o=pl(n.index);return void(Ci.restore(e,{parentId:wn,slot:xn,index:o})&&fl(o,e.props.id,t.section.title))}const o=zn(n),r=fs(o);r&&(r.target.spec?Rl(r.parentId,r.target.slot,t.type,n.index,r.parent.type):((e,n,t)=>{wo.insertComponent(e,n,t),lr(V),wo.select({index:t,zone:e})})(o,t.type,n.index))},ys=(e,n)=>{e.media?function(e){const n=ed();if(!n||!Zs)return;td(n).then(n=>{n&&function(e,n){if(!Zs)return;const t=Zs.create(e,{nodeDefaults:Mi,newNodeId:$e,sectionLabel:Ti,blockIsOffered:Cr}),o=zn(n);if(o===Oe){const e=pl(n.index),o=wo.insertNode(Oe,e,t);return void fl(e,o,Ti(t.type))}wo.insertNode(o,n.index,t),lr(V),wo.select({index:n.index,zone:o})}(n,e)})}(n):e.rung?Xi(e.rung.nodeId,e.index,n.index):e.add?gs(e.add,n):e.zone===Oe?ul(e.index,n.index):ls(e.zone,zn(n),e.index,n.index)},[bs]=Vn(()=>vn()),vs=kn({keyOf:e=>e.id,readOnly:Boolean(jt),session:bs,canDrop:ps,onDrop:ys,onStep:(e,n)=>{e.rung?Xi(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===Oe?((e,n)=>{const t=Ti(vi[e]?.type??""),o=ul(e,n<0?e-1:e+2);if(!o.moved)return void _r(n<0?lo.sectionFirst({name:t}):lo.sectionLast({name:t}));const{floor:r,cap:i}=ki();_r(lo.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):ls(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),ks=Hn(e=>{const{floor:n,cap:t}=ki(),o=[];for(const r of e.nodes){const e=zn(r.place),i=Ri(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(to(i)||oo(i)||kr(i.type,i))continue;if(_t(i.type))continue;const l=Boolean(as(e)),s=e===Oe||l;e===Oe&&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?Ti(i.type):Ki(i),from:r.place})}const r=e.zones.flatMap(e=>{const n=zn(e.list);if(n===Oe&&0===e.children.length)return[{...e,addLabel:lo.addSection,addAlways:!0}];const t=fs(n),o=t?.target.spec?.addLabel;return e.children.length>0||Boolean(t?.choices.length)||Boolean(as(n))?[o?{...e,addLabel:o}:e]:[]}),i=r.flatMap(e=>{const n=zn(e.list),t=n===Oe||as(n)?null:fs(n);return t?.choices.length?mn(e,t.target.spec?.addLabel??lo.addBlockHere):[]});return{sources:o,zones:r,seams:i}},[Wt.data]),Ss=null==Ut?.props.id?null:String(Ut.props.id),ws=Un(Re),xs=ws?.selected()&&Uo?.document&&Ss?ws.selectedPart?.(Uo.document)??null:null,zs=xs&&Ss&&Fe(Wt.data,Xt,Ss,xs)?xs:null,Cs=zs?.label?{element:zs.element,label:zs.label}:null,Os=null!==zs,Ns=Hn(e=>{const n=Xt,t=e=>!e.item.rung&&null!==On(Wt.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(Ss);return i?Os?null:i:r(_e(Wt.data,n,o.item.id,Ss,Jl))??o},[Wt.data,Xt,Ss,Jl,Os]),[Is,Bs]=Vn(null),[Ps,$s]=Vn(null),Es=Boolean(Ul||Gl);En(Uo,"mouseover",e=>{if(!Es)return;const n=Tn(e.target),t=n?kt(Wt.data,Xt,n):null;t!==Is&&Bs(t)}),En(Uo,"mouseout",e=>{Es&&!e.relatedTarget&&Bs(null)});const Ms=e=>to(e)||oo(e)||_t(e.type),Ts=e=>{const n=_t(e.type)?Ei(e.type):to(e)?lo.header:oo(e)?lo.footer:null;return null===n?ji(e):Nr.rowName?Nr.rowName(e,"section",n):n},js=[];if(Es){const e=Ss?kt(Wt.data,Xt,Ss):null;for(const n of/* @__PURE__ */new Set([e,Is,Ps])){const e=n?vi.find(e=>String(e.props.id)===n):void 0;if(!e)continue;const t=to(e)||e.type===Kt,o=Ql(e);if(o){js.push({id:String(e.props.id),label:Ts(e),below:t,reach:o});continue}if(!Ul||!Ms(e))continue;const r=Ul(e);r&&js.push({id:String(e.props.id),label:r,below:t})}}const Ls=fe(),As=Fn(null);Wn(()=>{const e=Gt.changeNotice;if(!e)return;const n=JSON.stringify(vi.filter(Ms)),t=As.current;if(As.current={doc:Xn,bands:n,index:Yt.index},!t||t.doc!==Xn||t.bands===n)return;Yt.hasPast&&Yt.index>=t.index&&!vt.has(Ls)&&(vt.add(Ls),_r(e,"success",{action:{label:lo.bar.undo,onClick:()=>Yt.back()},duration:8e3}))},[vi]);const Rs=e=>{lr(V),wo.select(e.zone===Oe?{index:e.index}:{index:e.index,zone:e.zone})},Fs=q(),Ds=()=>({data:Wt.data,device:$o,ops:wo,inspector:gr}),Vs=Fs?.model,Ws=Dn(()=>Vs?e=>Vs(e,ks(e),Ds()):ks,[Vs,ks,$o]),Hs=Fs?.measure,Ys=Hs?(e,n)=>Hs(e,n,Ds()):void 0,Us=Fs?.canDrop,Js=Us?(e,n)=>Us(e,n,ps,Ds()):ps,Xs=Fs?.drop,Gs=Xs?(e,n)=>Xs(e,n,ys,Ds()):ys,Qs=Fs?.pick,Ks=Qs?e=>Qs(e,Rs,Ds()):Rs,Zs=Fs?.media??null,_s=Fn(null),qs=Dn(()=>Zs?{id:yt,zone:"",index:-1,type:Zs.adds.type,add:{kind:Zs.adds.kind,type:Zs.adds.type},media:!0}:null,[Zs]);Wn(()=>{if(!qs||jt||"undefined"==typeof document)return;const e=e=>{(e=>Array.from(e.dataTransfer?.types??[]).includes(rt))(e)&&(_s.current=null,bs.start({key:yt,item:qs}))},n=e=>{bs.get()?.item.media&&(_s.current=_n(e.dataTransfer))},t=()=>{bs.get()?.item.media&&bs.end()};return document.addEventListener("dragstart",e),document.addEventListener("drop",n,!0),document.addEventListener("dragend",t,!0),()=>{document.removeEventListener("dragstart",e),document.removeEventListener("drop",n,!0),document.removeEventListener("dragend",t,!0)}},[qs,jt,bs]);const ed=()=>{const e=_s.current;return _s.current=null,e},nd=ce(),td=async e=>{if(!nd)return e;const n=await nd(e);return n?{...e,id:n.id,url:n.url}:null};const od=(e,n)=>{if(!Zs)return;const t=On(So.getState().appState.data,Si,n);if(!t)return;const o=t.node;wo.replaceComponent(zn(t.place),t.place.index,{...o,props:{...Zs.replace(o,e),id:o.props.id}})},rd=e=>{const n=zn(e),t=Vi(n);t&&Ui(t.node,t.slot,!1),gl(n,e.index)},id=(e,n)=>/* @__PURE__ */ht(Xe,{...jt?{}:vs.seam({place:{...Cn(e),index:n}})},`seam:${e}:${n}`),ld={rowClick:vl,isCollapsed:Xr,toggleCollapse:Gr},sd=e=>{const n=String(e.props.id),t=vi.findIndex(e=>String(e.props.id)===n),o=qt(n),r=Ri(o),i=Xr(n),l=Ei(e.type),s=Nr.rowName?Nr.rowName(e,"section",l):l,d=e=>id(o,e);/* @__PURE__ */
|
|
16
|
+
return mt(gt,{children:[
|
|
17
|
+
/* @__PURE__ */ht(We,{words:so,icon:/* @__PURE__ */ht(Br,{type:e.type,size:13}),name:s,preview:Sl(e),marks:wl(e),onSelect:()=>cl(t),nameSlot:_i(Oe,t,n,s),selected:sr===n,badge:Ql(e)?void 0:ql,shared:Ql(e),actions:xl(e,Oe,t)??void 0,rowProps:{"data-node-id":n,onClick:vl(()=>cl(t))},fold:{open:!i,label:"section",onToggle:()=>Gr(n)}}),!i&&/* @__PURE__ */mt(He,{children:[r.map((n,t)=>{const r=String(n.props.id),i=ji(n),l=jl(n),s=l&&Xr(r),a=()=>Al(o,t,r,e.type),{rowProps:c,...p}=vs.row({item:{id:r,zone:o,index:t,type:n.type},place:{...Cn(o),index:t}},{"data-node-id":r,onClick:vl(a)});/* @__PURE__ */
|
|
18
|
+
return mt(Jn,{children:[d(t),
|
|
19
|
+
/* @__PURE__ */ht(We,{words:so,icon:/* @__PURE__ */ht(Br,{type:n.type,size:13}),name:i,preview:Sl(n),marks:wl(n),onSelect:a,nameSlot:_i(o,t,r,i),selected:sr===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Gr(r)}:void 0,actions:/* @__PURE__ */mt(gt,{children:[kl(o,t,i),xl(n,o,t),zl(o,t,n,i)]}),rowProps:c}),l&&!s&&/* @__PURE__ */ht(He,{children:cd(n,2)})]},r)}),d(r.length)]})]})},dd=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=vs.dragging,d=!Xr(l)&&s?.rung?.nodeId!==i,a={...Cn(l),index:0},c=s&&!s.rung&&ps(s,a)?a:void 0,p=()=>Ui(e,n,!0),{rowProps:u,...f}=vs.row({item:{id:`rung:${l}`,zone:`${i}:${Ot}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:Ot,index:t},into:c,canDrag:Boolean(vr.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:vl(p)}),h=jt?null:vr.slotActions?.(e,n.slot);/* @__PURE__ */
|
|
20
|
+
return mt(Jn,{children:[n.heading,
|
|
21
|
+
/* @__PURE__ */ht(We,{words:so,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:Wi===l,...f,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>Gr(l)},actions:h&&h.length>0?/* @__PURE__ */ht(gt,{children:h.map((t,o)=>/* @__PURE__ */ht(Je,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(jt||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&Ji(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__ */ht(at,{size:15}):/* @__PURE__ */ht(ft,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */ht(He,{children:r})]},l)},ad=(e,n)=>{const t=Bl(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
|
|
22
|
+
return ht(gt,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=El(e,void 0,t.slot),d=s?`${e.props.id}:${s.slot}`:null,a=null===t.slot?null:`${e.props.id}:${t.slot}`,c=(e,n)=>id(e,n),p=/* @__PURE__ */mt(gt,{children:[i.map(({child:n,zone:t,index:o})=>{const r=sr===String(n.props.id),{collapsible:i,folded:s}=Ml(n,l,Ll(n.type)),d=String(n.props.id),a=is(n),p=()=>Al(t,o,d,e.type),{rowProps:u,...f}=vs.row({item:{id:d,zone:t,index:o,type:n.type},place:{...Cn(t),index:o}},{"data-node-id":d,onClick:vl(p)});/* @__PURE__ */
|
|
23
|
+
return mt(Jn,{children:[0===o&&c(t,0),
|
|
24
|
+
/* @__PURE__ */ht(We,{words:so,icon:/* @__PURE__ */ht(Br,{type:n.type,size:13}),name:a,preview:Sl(n),marks:wl(n),onSelect:p,nameSlot:_i(t,o,d,a),selected:r,hidden:Boolean(n.props._hidden),...f,fold:i?{open:!s,label:"group",onToggle:()=>Gr(d)}:void 0,actions:/* @__PURE__ */mt(gt,{children:[kl(t,o,a),xl(n,t,o),zl(t,o,n,a)]}),rowProps:u}),i&&!s&&/* @__PURE__ */ht(He,{children:ad(n,l+1)}),c(t,o+1)]},String(n.props.id??`${t}-${o}`))}),null===a?d&&!i.some(e=>e.zone===d)?c(d,0):null:0!==i.length||!t.rung&&d!==a?null:c(a,0)]});return t.rung?dd(e,t.rung,r++,o,p):/* @__PURE__ */ht(Jn,{children:p},t.slot??"")})})},cd=(e,n)=>{const t=wr(Wt?.data,e.type,String(e.props.id)),o=Bl(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
|
|
25
|
+
return ht(gt,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=El(e,t,o.slot),a=d?.spec??null,c=a&&Array.isArray(e.props[a.slot])?e.props[a.slot]:[],p=d&&d.choices?{slot:d.slot,choices:d.choices}:null,u=String(e.props.id),f=a&&!a.fixed?`${u}:${a.slot}`:null,h=p?`${u}:${p.slot}`:null,m=(e,n)=>id(e,n),g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(a&&!a.fixed&&(null===g||g===f)),b=/* @__PURE__ */mt(gt,{children:[l.map(({child:n,zone:t,index:o})=>{const r=sr===String(n.props.id),i=Ki(n),l=String(n.props.id),{collapsible:d,folded:a}=Ml(n,s,Ll(n.type)),c=Nl(n.type),p=1===c.length?`${l}:${c[0]}`:null,u=p?{...Cn(p),index:Ri(p).length}:void 0,f=vs.dragging,h=u&&f&&ps(f,u)?u:void 0,g=()=>Al(t,o,l,e.type),{rowProps:y,...b}=vs.row({item:{id:l,zone:t,index:o,type:n.type},place:{...Cn(t),index:o},into:h,canDrag:!kr(n.type,n)},{"data-node-id":l,onClick:vl(g)});/* @__PURE__ */
|
|
26
|
+
return mt(Jn,{children:[0===o&&m(t,0),
|
|
27
|
+
/* @__PURE__ */ht(We,{words:so,icon:/* @__PURE__ */ht(Br,{type:n.type,size:13}),name:i,preview:Sl(n),marks:wl(n),onSelect:g,nameSlot:_i(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...b,fold:d?{open:!a,label:"group",onToggle:()=>Gr(l)}:void 0,actions:kr(n.type,n)?xl(n,t,o)??void 0:/* @__PURE__ */mt(gt,{children:[kl(t,o,i),xl(n,t,o),zl(t,o,n,i)]}),rowProps:y}),d&&!a&&/* @__PURE__ */ht(He,{children:cd(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&a&&
|
|
28
|
+
/* @__PURE__ */ht(z,{small:!0,label:a.addLabel,blocked:a.addBlocked?.(c)??null,onAdd:()=>Rl(e.props.id,a.slot,a.childType,c.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?dd(e,o.rung,i++,r,b):/* @__PURE__ */ht(Jn,{children:b},o.slot??"")})})},pd=_o,ud=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:zo&&!pd&&br===e.id,onSelect:()=>yi(e.id)}:e,fd=[...(yr.railLead??[]).map(ud),{id:"sections",label:lo.layers,icon:/* @__PURE__ */ht(ge,{}),active:zo&&!pd&&"sections"===br,onSelect:()=>yi("sections")},...(yr.railTrail??[]).map(ud)],hd=To?{onPress:jo}:Ft?{onPress:()=>{x(Bn,{accept:"image/*",title:ho.mediaLibrary})}}:null,md={value:fd.find(e=>!0===e.active)?.id??"",press:e=>{const n=fd.find(n=>n.id===e);n&&!n.disabled&&!0!==n.active&&n.onSelect?.()},items:fd.map(e=>({id:e.id,icon:e.icon,label:/* @__PURE__ */ht("span",{className:"sr-only",children:e.label}),tooltip:e.label,disabled:e.disabled}))},gd=[...yr.railLead??[],...yr.railTrail??[]].find(e=>"panel"in e&&e.id===br),yd=Boolean(io?.foldable),bd=io?.label??(Dt?lo.pageSections:lo.templateSections),vd=yd&&Xr(It),kd=/* @__PURE__ */mt(gt,{children:[vi.map((e,n)=>{if(to(e)||oo(e)||_t(e.type))return null;const t=sr===String(e.props.id),o=Boolean(e.props._hidden);Il(e);const r=String(e.props.id),i=yr.hasOwnRows?.(e)??!1,l=jl(e)||i,s=l&&Xr(r),d=Nl(e.type),a=1===d.length?`${r}:${d[0]}`:null,c=a?{...Cn(a),index:Ri(a).length}:void 0,p=vs.dragging,u=c&&p&&ps(p,c)?c:void 0,{rowProps:f,...h}=vs.row({item:{id:r,zone:Oe,index:n,type:e.type},place:{...Cn(Oe),index:n},into:u,canDrag:!kr(e.type,e)},{"data-node-id":r,onClick:vl(()=>cl(n))});/* @__PURE__ */
|
|
29
|
+
return mt(Jn,{children:[n>0&&Cl(n),
|
|
30
|
+
/* @__PURE__ */ht(We,{words:so,icon:/* @__PURE__ */ht(Br,{type:e.type,size:13}),name:ji(e),preview:Sl(e),marks:wl(e),shared:Ql(e),onSelect:()=>cl(n),nameSlot:_i(Oe,n,r,ji(e)),selected:t,hidden:o,...h,fold:l?{open:!s,label:"section",onToggle:()=>Gr(r)}:void 0,actions:/* @__PURE__ */mt(gt,{children:[kl(Oe,n,ji(e)),xl(e,Oe,n),zl(Oe,n,e,ji(e))]}),rowProps:f}),jl(e)&&!s&&/* @__PURE__ */mt(He,{children:[cd(e,1),yr.partRows?.(e,ld)]}),i&&!s&&/* @__PURE__ */ht(He,{children:yr.ownRows?.(e,n,ld)})]},String(e.props.id??n))}),ts>0&&Cl(ts)]}),Sd=(e,n,t)=>{const o=String(e.props.id),r=Pl(e).length>0||$l(e)||Boolean(zr(e.type)),i=r&&Xr(o),l="header"===t?lo.header:lo.footer,s=Nr.rowName?Nr.rowName(e,"section",l):l;/* @__PURE__ */
|
|
31
|
+
return mt(gt,{children:[
|
|
32
|
+
/* @__PURE__ */ht(We,{words:so,icon:/* @__PURE__ */ht(Br,{type:t,size:13}),name:s,preview:Sl(e),marks:wl(e),badge:Ql(e)?void 0:ql,shared:Ql(e),onSelect:()=>cl(n),nameSlot:_i(Oe,n,o,s),selected:sr===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Gr(o)}:void 0,actions:xl(e,Oe,n)??void 0,rowProps:{"data-node-id":o,onClick:vl(()=>cl(n))}}),r&&!i&&/* @__PURE__ */ht(He,{children:ad(e,1)})]})};return(yr.wrap??(e=>e))(
|
|
33
|
+
/* @__PURE__ */ht(ee,{target:Uo,children:/* @__PURE__ */mt("div",{ref:Yo,className:"sf-editor es-editor",style:dn(Wr),onContextMenu:rl.onEditorContextMenu,...p(Bn),children:[
|
|
34
|
+
/* @__PURE__ */mt(qe,{children:[
|
|
35
|
+
/* @__PURE__ */mt("div",{className:"es-cluster es-cluster--left",children:[hd?/* @__PURE__ */ht(Qn,{variant:"secondary",className:"es-barbtn",leftIcon:/* @__PURE__ */ht(ye,{}),onClick:hd.onPress,children:lo.railMedia}):null,
|
|
36
|
+
/* @__PURE__ */ht(en,{label:lo.bar.undo,disabled:Boolean(jt)||!Yt.hasPast,onClick:()=>Yt.back(),children:/* @__PURE__ */ht(it,{})}),
|
|
37
|
+
/* @__PURE__ */ht(en,{label:lo.bar.redo,disabled:Boolean(jt)||!Yt.hasFuture,onClick:()=>Yt.forward(),children:/* @__PURE__ */ht(lt,{})})]}),
|
|
38
|
+
/* @__PURE__ */mt(nn,{children:[
|
|
39
|
+
/* @__PURE__ */ht(tn,{devices:Oo,value:$o,onChange:Eo}),
|
|
40
|
+
/* @__PURE__ */ht(en,{label:lo.bar.refresh,tip:lo.bar.refreshTip,onClick:()=>{Ho.current=(()=>{const e=Uo?.document;if(!e)return null;const n=vi.findIndex(oo),t=n>=0?n:vi.length;let o=null;for(let n=0;n<t;n++){const t=vi[n]?.props?.id;if(null==t)continue;const r=Rn(e,`[data-easel-block="${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=Ut?.props?.id??vi[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),Wo(e=>e+1)},children:/* @__PURE__ */ht(st,{})}),yr.barView?.()]}),
|
|
41
|
+
/* @__PURE__ */mt(nn,{kind:"right",style:{minWidth:300},children:[
|
|
42
|
+
/* @__PURE__ */ht(v,{input:Ko,words:lo.saveStatus}),jn?/* @__PURE__ */ht(jn,{}):null,yr.barLead?.(),yr.barTrail?.(),yr.mainAction||!yr.barMain?/* @__PURE__ */ht(k,{input:Ko,action:qr,readOnly:Boolean(jt),saveSwitch:At,onToggleAutoSave:$t,onSaveNow:Zo,bar:lo.bar,words:lo.saveStatus}):yr.barMain()]})]}),
|
|
43
|
+
/* @__PURE__ */ht(b,{}),
|
|
44
|
+
/* @__PURE__ */mt("div",{className:"sf-body",children:[zo?/* @__PURE__ */mt(gt,{children:[
|
|
45
|
+
/* @__PURE__ */mt("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":lo.leftPanel,children:[
|
|
46
|
+
/* @__PURE__ */mt("div",{className:"es-paneltabs es-paneltabs--with-hide",children:[
|
|
47
|
+
/* @__PURE__ */ht(I,{side:"left",onHide:mi}),
|
|
48
|
+
/* @__PURE__ */ht("span",{className:"es-paneltabs-divider","aria-hidden":"true"}),
|
|
49
|
+
/* @__PURE__ */ht(Kn,{variant:"underline",block:!0,"aria-label":lo.bar.views,value:md.value,onChange:md.press,items:md.items})]}),_o?/* @__PURE__ */ht(C,{at:nr?{label:(e=>{const n=as(e.zone);if(n)return lo.add.addingTo({name:Nr.rowName?bl(n,!0):Ei(n.type)});if(e.zone===Oe){const n=vi[e.index];return n&&!oo(n)?lo.add.addingBefore({name:bl(n,!0)}):lo.add.addingAtEnd}const t=fs(e.zone);return t?lo.add.addingTo({name:t.parentName}):lo.add.addingHere})(nr),onClear:()=>tr(null)}:void 0,placeBlocks:nr&&nr.zone!==Oe?fs(nr.zone)?.choices:void 0,canTake:nr?e=>{if(!nr)return null;const n={...Cn(nr.zone),index:nr.index};if(ms(e,n))return null;if("shared"===e.kind&&nr.zone===Oe&&!Gt.shared?.nodeOf(e.section))return lo.shared.alreadyHere;const t=as(nr.zone);if(t)return lo.add.notInside({name:bl(t,!0)});if(nr.zone===Oe)return lo.add.onlySections;const o=fs(nr.zone);return o?lo.add.notInside({name:o.parentName}):lo.add.onlySections}:void 0,onPick:nr?e=>{if(!nr)return;const n={...Cn(nr.zone),index:nr.index};ms(e,n)&&(gs(e,n),yl())}:void 0,itemFor:e=>({id:`new:${e.kind}:${Nt(e)}`,zone:"",index:-1,type:"template"===e.kind?e.template.node.type:"shared"===e.kind?e.section.node.type:Nt(e),add:e}),session:bs,siteWide:yr.addPanelRow?.(yl),onClose:yl,readOnly:Boolean(jt)}):gd?gd.panel({onHide:mi,notify:_r}):/* @__PURE__ */mt(gt,{children:[
|
|
50
|
+
/* @__PURE__ */ht(B,{icon:/* @__PURE__ */ht(ge,{}),title:lo.layers,context:mo,actions:/* @__PURE__ */mt(gt,{children:[!jt&&/* @__PURE__ */ht(on,{label:lo.add.title,onClick:()=>ml(null),children:/* @__PURE__ */ht(dt,{size:15})}),
|
|
51
|
+
/* @__PURE__ */ht(on,{label:rs?lo.expandAll:lo.collapseAll,title:0===os.length?lo.nothingToFold:void 0,disabled:0===os.length,onClick:()=>Vr(e=>{const n=new Set(os);return rs?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...os])}),children:/* @__PURE__ */ht(xt,{expand:rs})})]})}),
|
|
52
|
+
/* @__PURE__ */mt(Ye,{className:"sf-tree sf-scroll",words:so,children:[es&&/* @__PURE__ */mt(gt,{children:[!Xl&&/* @__PURE__ */ht(Ue,{children:lo.header}),sd(es)]}),Vt&&!(Xl&&es)&&/* @__PURE__ */mt(gt,{children:[!Xl&&/* @__PURE__ */ht(Ue,{children:lo.header}),!ro&&/* @__PURE__ */ht(We,{words:so,icon:/* @__PURE__ */ht(Br,{type:"header",size:13}),name:lo.header,badge:_l?void 0:ql,shared:_l,onSelect:bi,selected:ir.kind===no?.kind,rowProps:{onClick:vl(bi)}})]}),Yl&&!(Xl&&es)&&Sd(Yl,Hl,"header"),!yd&&/* @__PURE__ */ht(Ue,{children:bd}),yd?/* @__PURE__ */mt(gt,{children:[
|
|
53
|
+
/* @__PURE__ */ht(We,{words:so,icon:null,name:bd,fold:{open:!vd,label:bd,onToggle:()=>Gr(It)}}),!vd&&/* @__PURE__ */ht(He,{children:kd})]}):kd,Vt&&!Xl&&/* @__PURE__ */ht(Ue,{children:lo.footer}),Wl&&!(Xl&&ns)&&Sd(Wl,Vl,"footer"),ns&&sd(ns),yr.treeFoot?.()]})]})]}),
|
|
54
|
+
/* @__PURE__ */ht(rn,{side:"left",width:Wr.left,min:sn.left,max:ln,defaultWidth:h.left,label:lo.resizeLeftPanel,onResize:Ur})]}):/* @__PURE__ */ht(P,{side:"left",onShow:mi}),
|
|
55
|
+
/* @__PURE__ */mt("div",{ref:ni,className:"sf-center sf-scroll","data-sf-canvas-head":li?"":void 0,style:{overflowX:ui?"auto":"hidden",overflowY:"hidden"},children:[li&&/* @__PURE__ */ht("div",{ref:si,className:"sf-canvas-head",children:/* @__PURE__ */ht(li,{device:$o})}),
|
|
56
|
+
/* @__PURE__ */mt("div",{className:"sf-frame-scaler",style:fi,children:[
|
|
57
|
+
/* @__PURE__ */ht("div",{className:"sf-frame "+($o===Bo?"":`sf-frame--${$o}`),style:hi,children:/* @__PURE__ */mt("div",{className:"sf-preview-host",children:[
|
|
58
|
+
/* @__PURE__ */ht(De.Provider,{value:Jl,children:/* @__PURE__ */ht(Ve.Provider,{value:Zl,children:/* @__PURE__ */ht(go,{},Vo)})}),
|
|
59
|
+
/* @__PURE__ */ht(gn,{canvas:Uo,session:bs,model:Ws,measure:Ys,canDrop:Js,onDrop:Gs,choose:Ns,tag:Cs,onPick:Ks,dropOn:Zs?{accepts:(e,n)=>{if(!e.media||!Zs||n.item.rung)return!1;const t=On(Wt.data,Si,n.item.id);return null!==t&&Zs.takes(t.node)},onDrop:(e,n)=>(e=>{const n=ed();n&&Zs&&td(n).then(n=>{n&&od(n,e.item.id)})})(n),label:()=>lo.canvasReplaceImage}:void 0,onZoneAdd:rd,onSeamAdd:rd,zoneAddLabel:lo.canvasAddBlock,words:ao.canvas,readOnly:Boolean(jt),revision:Wt.data}),or.length>0&&!Jo&&/* @__PURE__ */ht("div",{className:"sf-preview-gaps",children:or.map(e=>
|
|
60
|
+
/* @__PURE__ */ht(yn,{index:e.index,label:lo.addSectionHere,onInsert:()=>ml(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))})]})}),Es?/* @__PURE__ */ht(wt,{canvas:Uo,tabs:js,onSelect:Yi,onPointer:$s}):null]})]}),Co?/* @__PURE__ */mt(gt,{children:[Ln?
|
|
61
|
+
/* @__PURE__ */ht("div",{className:"es-sidepanel es-sidepanel--right","data-es-host-panel":"",children:Ln}):/* @__PURE__ */ht(gt,{children:/* @__PURE__ */ht(u,{value:{selectChild:Al,addChild:Rl,childRowName:Ki,blockRowName:is},children:/* @__PURE__ */ht(yo,{mode:ir,onOpenWebsiteSettings:yr.openSettings??(()=>{}),onOpenSiteStyles:yr.openStyles,onOpenPageStyles:yr.openPageStyles,onSelectNode:Mr,onNotify:_r,onHidePanel:gi,nodeActions:Ut?Ne(Xt,Ut.type):Bt})})}),
|
|
62
|
+
/* @__PURE__ */ht(rn,{side:"right",width:Wr.right,min:sn.right,max:ln,defaultWidth:h.right,label:lo.resizeSettingsPanel,onResize:Jr})]}):
|
|
63
|
+
/* @__PURE__ */ht(P,{side:"right",onShow:gi})]}),rl.menu,
|
|
64
|
+
/* @__PURE__ */ht(ie,{}),Ni?/* @__PURE__ */ht(bt,{name:Ni.name,onMake:e=>(async(e,n)=>{const t=vi.find(n=>String(n.props.id)===e),o=Gt.shared;if(!t||!o)return;let r;try{r=await N(Oi).create(n,t)}catch{return void _r(lo.shared.makeFailed,"error")}o.adopt(t,r),Ii(null)})(Ni.id,e),onCancel:()=>Ii(null)}):null]})}))}export{$t as ScreenChrome};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e={title:"Add",contextAll:"Sections and blocks",done:"Done",doneDescription:"Close Add and go back",templates:"Your templates",tile:({name:e})=>`Add ${e}`,hint:"Drag onto the page.",search:"Search",onlySections:"Only sections go here",notInside:({name:e})=>`Cannot go inside ${e}`,addingTo:({name:e})=>`Adding to ${e}`,addingBefore:({name:e})=>`Adding before ${e}`,addingAtEnd:"Adding at the end of the page",addingHere:"Adding here"},a=e=>1===e?"1 page":`${e} pages`,t={group:"Shared sections",onPages:({count:e})=>`On ${a(e)}`,makeShared:"Make shared",makeSharedHint:"Use this section on other pages from Add. Change it once, and every page changes.",name:"Name",cancel:"Cancel",makeFailed:"Could not make it shared. Try again.",detach:"Detach from shared",removeFromPage:"Remove from this page",removed:({count:e})=>e>0?`Removed from this page · still on ${a(e)}`:"Removed from this page",deleteShared:"Delete shared section",deleteTitle:({name:e})=>`Delete “${e}”?`,deleteMessage:({count:e})=>0===e?"No page uses it. Nothing on the website changes.":1===e?"The page that uses it keeps its own copy. Nothing disappears from the website.":`The ${e} pages that use it each keep their own copy. Nothing disappears from the website.`,deleteFailed:"Could not delete it. Try again.",alreadyHere:"Already on this page"};var o={savedAgo:function({seconds:e}){const a=Math.max(0,Math.floor(e));if(a<1)return"Saved just now";if(a<60)return`Saved ${a} second${1===a?"":"s"} ago`;const t=Math.floor(a/60);if(t<60)return`Saved ${t} minute${1===t?"":"s"} ago`;const o=Math.floor(t/60);return`Saved ${o} hour${1===o?"":"s"} ago`},saved:"All changes saved",saving:"Saving",pending:"Changes not saved yet — saving in a moment",failedIn:({seconds:e})=>`Not saved — trying again in ${e} s`,failedSoon:"Not saved — trying again soon",offline:"You’re offline — we’ll save when you’re back",pausedHeld:"Auto-save is off — changes not saved",paused:"Auto-save is off",locked:({editing:e})=>`Not saving — ${e}`,blockedOffline:"You’re offline. Try again when you’re back online.",blockedFailed:"Your last changes are not saved yet. Try again when they are.",blockedConflict:"Your last save was refused. See the notice below."},n={blockCount:({count:e})=>`${e} ${1===e?"block":"blocks"}`,loading:"Loading",waitingForAuthorization:"Waiting for editor authorization",missingTemplatePage:"Couldn’t open a page in this template.",missingPage:({slug:e})=>`No page with slug "${e}".`,missingDocument:"Couldn’t open this document.",loadFailed:({cause:e})=>`Could not load the document — ${e}`,noun:"page",pageStyles:"This page",header:"Header",footer:"Footer",pageSections:"Page",templateSections:"Template",addSection:"Add section",addSectionHere:"Add section here",done:"Done",copied:({name:e})=>`Copied ${e}`,pasteRefused:({name:e})=>`${e} can’t be pasted here.`,writeLate:"That took too long. Your change is kept, but the last step did not finish.",add:e,shared:t,canvasAddBlock:"Add block",canvasReplaceImage:"Replace image",railMedia:"Media library",leftPanel:"Left panel",resizeLeftPanel:"Resize left panel",leave:{title:"Unsaved changes",body:"Your most recent edits haven’t finished saving yet. Save them before switching, or leave and discard them.",cancel:"Cancel",discard:"Discard & leave",save:"Save & leave",saving:"Saving"},bar:{undo:"Undo",redo:"Redo",refresh:"Reload the preview",refreshTip:"Reload the preview (keeps your place)",notSaving:"Not saving — see the notice below",retry:"Retry now",autoSaveOff:"Auto-save is off — click to turn it back on (saves your held edits)",autoSaveOn:"Auto-save is on — click to pause it",views:"Left panel views",saveOptions:"Save options",autoSave:"Auto-save",saveNow:"Save now"},saveStatus:o,menu:{undo:"Undo",redo:"Redo",collapseAll:"Collapse all layers",selectAll:"Select all",pinned:"Pinned — can’t be moved or deleted",clipboardRefused:"Your browser won’t let us read the clipboard — press ⌘V",itemAddAfter:"Add item after",itemMoveEarlier:"Move item earlier",itemMoveLater:"Move item later",itemDelete:"Delete item"},layers:"Layers",expandAll:"Expand all sections",collapseAll:"Collapse all sections",nothingToFold:"Nothing to fold on this page",rename:"Rename",deleteNamed:({name:e})=>`Delete ${e}`,hideNamed:({name:e})=>`Hide ${e}`,showNamed:({name:e})=>`Show ${e}`,addBlockHere:"Add block here",sectionFirst:({name:e})=>`“${e}” is already first`,sectionLast:({name:e})=>`“${e}” is already last`,sectionMoved:({name:e,n:a,total:t})=>`Moved “${e}” to position ${a} of ${t}`,sectionAdded:({name:e})=>`Added “${e}” section`,deleted:({name:e})=>`Deleted “${e}”`,resizeSettingsPanel:"Resize settings panel",sectionSettings:({name:e})=>`${e} settings`,headerSettings:"Header settings",addBlockMenu:"Add block",deviceNote:{
|
|
1
|
+
var e={title:"Add",contextAll:"Sections and blocks",done:"Done",doneDescription:"Close Add and go back",templates:"Your templates",tile:({name:e})=>`Add ${e}`,hint:"Drag onto the page.",search:"Search",onlySections:"Only sections go here",notInside:({name:e})=>`Cannot go inside ${e}`,addingTo:({name:e})=>`Adding to ${e}`,addingBefore:({name:e})=>`Adding before ${e}`,addingAtEnd:"Adding at the end of the page",addingHere:"Adding here"},a=e=>1===e?"1 page":`${e} pages`,t={group:"Shared sections",onPages:({count:e})=>`On ${a(e)}`,makeShared:"Make shared",makeSharedHint:"Use this section on other pages from Add. Change it once, and every page changes.",name:"Name",cancel:"Cancel",makeFailed:"Could not make it shared. Try again.",detach:"Detach from shared",removeFromPage:"Remove from this page",removed:({count:e})=>e>0?`Removed from this page · still on ${a(e)}`:"Removed from this page",deleteShared:"Delete shared section",deleteTitle:({name:e})=>`Delete “${e}”?`,deleteMessage:({count:e})=>0===e?"No page uses it. Nothing on the website changes.":1===e?"The page that uses it keeps its own copy. Nothing disappears from the website.":`The ${e} pages that use it each keep their own copy. Nothing disappears from the website.`,deleteFailed:"Could not delete it. Try again.",alreadyHere:"Already on this page"};var o={savedAgo:function({seconds:e}){const a=Math.max(0,Math.floor(e));if(a<1)return"Saved just now";if(a<60)return`Saved ${a} second${1===a?"":"s"} ago`;const t=Math.floor(a/60);if(t<60)return`Saved ${t} minute${1===t?"":"s"} ago`;const o=Math.floor(t/60);return`Saved ${o} hour${1===o?"":"s"} ago`},saved:"All changes saved",saving:"Saving",pending:"Changes not saved yet — saving in a moment",failedIn:({seconds:e})=>`Not saved — trying again in ${e} s`,failedSoon:"Not saved — trying again soon",offline:"You’re offline — we’ll save when you’re back",pausedHeld:"Auto-save is off — changes not saved",paused:"Auto-save is off",locked:({editing:e})=>`Not saving — ${e}`,blockedOffline:"You’re offline. Try again when you’re back online.",blockedFailed:"Your last changes are not saved yet. Try again when they are.",blockedConflict:"Your last save was refused. See the notice below."},n={blockCount:({count:e})=>`${e} ${1===e?"block":"blocks"}`,loading:"Loading",waitingForAuthorization:"Waiting for editor authorization",missingTemplatePage:"Couldn’t open a page in this template.",missingPage:({slug:e})=>`No page with slug "${e}".`,missingDocument:"Couldn’t open this document.",loadFailed:({cause:e})=>`Could not load the document — ${e}`,noun:"page",pageStyles:"This page",header:"Header",footer:"Footer",pageSections:"Page",templateSections:"Template",addSection:"Add section",addSectionHere:"Add section here",done:"Done",copied:({name:e})=>`Copied ${e}`,pasteRefused:({name:e})=>`${e} can’t be pasted here.`,writeLate:"That took too long. Your change is kept, but the last step did not finish.",add:e,shared:t,canvasAddBlock:"Add block",canvasReplaceImage:"Replace image",railMedia:"Media library",leftPanel:"Left panel",resizeLeftPanel:"Resize left panel",leave:{title:"Unsaved changes",body:"Your most recent edits haven’t finished saving yet. Save them before switching, or leave and discard them.",cancel:"Cancel",discard:"Discard & leave",save:"Save & leave",saving:"Saving"},bar:{undo:"Undo",redo:"Redo",refresh:"Reload the preview",refreshTip:"Reload the preview (keeps your place)",notSaving:"Not saving — see the notice below",retry:"Retry now",autoSaveOff:"Auto-save is off — click to turn it back on (saves your held edits)",autoSaveOn:"Auto-save is on — click to pause it",views:"Left panel views",saveOptions:"Save options",autoSave:"Auto-save",saveNow:"Save now"},saveStatus:o,menu:{undo:"Undo",redo:"Redo",collapseAll:"Collapse all layers",selectAll:"Select all",pinned:"Pinned — can’t be moved or deleted",clipboardRefused:"Your browser won’t let us read the clipboard — press ⌘V",itemAddAfter:"Add item after",itemMoveEarlier:"Move item earlier",itemMoveLater:"Move item later",itemDelete:"Delete item"},layers:"Layers",expandAll:"Expand all sections",collapseAll:"Collapse all sections",nothingToFold:"Nothing to fold on this page",rename:"Rename",deleteNamed:({name:e})=>`Delete ${e}`,hideNamed:({name:e})=>`Hide ${e}`,showNamed:({name:e})=>`Show ${e}`,addBlockHere:"Add block here",sectionFirst:({name:e})=>`“${e}” is already first`,sectionLast:({name:e})=>`“${e}” is already last`,sectionMoved:({name:e,n:a,total:t})=>`Moved “${e}” to position ${a} of ${t}`,sectionAdded:({name:e})=>`Added “${e}” section`,deleted:({name:e})=>`Deleted “${e}”`,resizeSettingsPanel:"Resize settings panel",sectionSettings:({name:e})=>`${e} settings`,headerSettings:"Header settings",addBlockMenu:"Add block",deviceNote:{mobile:"Showing the phone settings for this section."}},s={focus:"Image focus",onDesktop:e=>`${e} on desktop`,pasteLink:"or paste an image URL",pasteName:"Image URL",template:"Templates don’t store images. This slot stays a placeholder. Each website picks its own after it’s created.",templateVideo:"Templates don’t store videos. This slot stays a placeholder. Each website picks its own after it’s created."};export{s as DEFAULT_IMAGE_ROW_WORDS,e as DEFAULT_SCREEN_ADD_WORDS,o as DEFAULT_SCREEN_SAVE_STATUS_WORDS,t as DEFAULT_SCREEN_SHARED_WORDS,n as DEFAULT_SCREEN_WORDS};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEFAULT_LOCK_WORDS as e}from"./chunk-RE4LP46F.js";import{newId as n}from"./chunk-
|
|
1
|
+
import{DEFAULT_LOCK_WORDS as e}from"./chunk-RE4LP46F.js";import{newId as n}from"./chunk-YDTEYXQW.js";var t=e=>"editing"===e.kind;function r(e){return e?{kind:"checking"}:{kind:"editing"}}var c=e=>"blocked"===e.kind||"readonly"===e.kind||"takenover"===e.kind?e.holder:null;function s(e){if(!e||"object"!=typeof e)return null;const n=e;return"string"!=typeof n.holder_name?null:{name:n.holder_name,secondsSinceSeen:"number"==typeof n.seconds_since_seen?n.seconds_since_seen:0,secondsSinceHeld:"number"==typeof n.seconds_since_held?n.seconds_since_held:0}}var a=e=>e?{edit:!0,insert:!0,delete:!0,duplicate:!0,drag:!1}:{edit:!1,insert:!1,delete:!1,duplicate:!1,drag:!1};function o(n,t=e){if(!Number.isFinite(n)||n<45)return t.justNow;const r=Math.round(n/60);if(r<60)return t.minutesAgo({count:r});const c=Math.round(r/60);return t.hoursAgo({count:c})}var i=(n,t=e)=>n.trim()||t.someone;function d(){return n("tab").slice(0,64)}var u="edit_lock_taken";function l(e,n,r){return!(t(e)||!t(n))&&(r.pending&&r.autoSaveEnabled&&!r.saveConflict)}function f(e,n,r){return!(null===c(e)||!t(n))&&(!r.pending&&!r.saveConflict)}function k(e,n){return e!==n&&Date.parse(e)>=Date.parse(n)}async function h(e){if(!e.ours)return!1;const n=await e.stored().catch(()=>null);return!(!n||!k(n,e.ours)||e.hasPending())&&(e.reload(),!0)}var b=8e3,g=3e4;function _(e){if(e.cancelled())return!1;const n=e.currentAccess();if("checking"!==n.kind)return!1;const t={kind:"editing"};return e.setAccess(t),l(n,t,e.heldWrite())&&e.releaseHeldWrite(),!0}function m(e){const{readFailure:n,conflictCode:t}=e,r=e=>{const t=n(e);return t&&409===t.status?s(t.data):null},c=e=>{const n=r(e);return n?{kind:"blocked",holder:n}:{kind:"editing"}},a=(e,n)=>{const t=r(e);return t?{kind:"blocked",holder:t}:n},o=(e,n)=>{const t=r(e);return t?{kind:"takenover",holder:t}:n},i=e=>{const t=n(e);return null!==t&&(401===t.status||403===t.status)};return{accessAfterClaimFailure:c,accessAfterTakeoverFailure:a,accessAfterHeartbeatFailure:o,isAuthRejection:i,readSaveConflict:e=>{const r=n(e);if(!r||409!==r.status)return null;if(!r.data||"object"!=typeof r.data)return null;const c=r.data;return c.code!==t?null:{savedBy:"string"==typeof c.saved_by?c.saved_by:"",savedByYou:!0===c.saved_by_you,secondsAgo:"number"==typeof c.seconds_ago?c.seconds_ago:0}},readLockTaken:e=>{const t=n(e);return t&&409===t.status&&t.data&&"object"==typeof t.data?t.data.code!==u?null:s(t.data)??{name:"",secondsSinceSeen:0,secondsSinceHeld:0}:null},makeClaimBeat:e=>{let n=!1;return async t=>{let r,s;try{const c=await e.claim(t);if(e.cancelled())return;r=e.currentAccess(),s={kind:"editing"},!n&&c.heartbeat_seconds>0&&(n=!0,e.startHeartbeat(1e3*c.heartbeat_seconds))}catch(n){if(e.cancelled())return;r=e.currentAccess(),s=t?a(n,r):"checking"===r.kind?c(n):o(n,r),i(n)&&e.stopHeartbeat()}e.setAccess(s);const d=e.heldWrite();l(r,s,d)?e.releaseHeldWrite():t&&f(r,s,d)&&e.reloadIfMoved?.()}}}}export{b as CLAIM_FAIL_OPEN_MS,u as EDIT_LOCK_TAKEN,g as FAIL_OPEN_RETRY_MS,r as accessForNewDocument,t as canWriteDocument,m as createEditLock,o as describeAge,a as documentPermissions,k as documentVersionMoved,c as holderOf,i as nameOrSomeone,d as newEaselClientId,_ as openUnansweredClaim,s as readLockHolder,h as reloadIfVersionMoved,l as shouldReleaseHeldWrite,f as shouldReloadAfterTakeover};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{buildPaletteSections as e,pinnedSection as t,categoryLabel as n}from"./chunk-GDO4QJ4G.js";import{blockTypesIn as o}from"./chunk-IZGFJWH4.js";import{sectionTemplatesOf as r}from"./chunk-N7E6264U.js";import{sharedSectionsOf as l}from"./chunk-N3MJOHAG.js";import{SidePanelHead as i,PanelModeExit as s}from"./chunk-MTWQYLJE.js";import{blockRuns as c}from"./chunk-RUQOIQWI.js";import{useScreenBlockLook as a,useScreenBlockRules as p,useScreenPinned as d}from"./chunk-TUIBPB77.js";import{useEaselSession as m}from"./chunk-YM4UEGBV.js";import{DEFAULT_SCREEN_WORDS as f}from"./chunk-G2VZ4DET.js";import{useEasel as u}from"./chunk-L36E2WCO.js";import{easelMenuEntries as y}from"./chunk-FIVU2COQ.js";import{useWords as h}from"./chunk-MFIRYGHW.js";import{AddPanel as k}from"./chunk-SEC6NV6Y.js";import{DEFAULT_DRAG_WORDS as g}from"./chunk-TQ5Y6S2X.js";import{useState as b,useEffect as v,useMemo as j,useRef as C}from"react";import{SharedIcon as w,AddIcon as E}from"efficient-shell/icons/efficient";import{ContextMenu as O,toast as I,Dialog as T,Button as $}from"efficient-shell/ui";import{jsx as x,jsxs as F,Fragment as G}from"react/jsx-runtime";function M({name:e,pages:t,onDelete:n,onCancel:o}){const r=h("screen",f).shared,[l,i]=b(!1),s=C(null);/* @__PURE__ */
|
|
2
|
+
return x(T,{open:!0,role:"alertdialog",size:"sm",title:r.deleteTitle({name:e}),onClose:o,initialFocus:s,footer:/* @__PURE__ */F(G,{children:[
|
|
3
|
+
/* @__PURE__ */x($,{ref:s,variant:"secondary",onClick:o,children:r.cancel}),
|
|
4
|
+
/* @__PURE__ */x($,{variant:"danger",loading:l,onClick:()=>{(async()=>{i(!0);try{await n()}finally{i(!1)}})()},children:r.deleteShared})]}),children:r.deleteMessage({count:t})})}var W=e=>`section:${e}`,B=e=>`block:${e}`,L=e=>`template:${e}`,Q=e=>`shared:${e}`,S=e=>`preset:${e}`;function D({at:C,placeBlocks:T,canTake:$,onPick:D,itemFor:H,session:N,siteWide:U,onClose:Y,onHide:z,readOnly:A}){const J=u(e=>e.config),V=a(),{labelAtLevel:P,categoryLabel:R,firstSection:Z,Icon:_,Thumbnail:X}=V,{blockIsOffered:q,canAddTo:K}=p(),ee=h("screen",f).add,te=h("drag",g).add,ne=m(),[oe,re]=b([]);v(()=>{let e=!1;const t=e=>q(e,ne);return r(ne).list().then(n=>{if(e)return;const r=J.components;re(n.filter(e=>e.node?.type&&r[e.node.type]&&o(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[J,ne]);const le=d().shared,ie=h("screen",f).shared,[se,ce]=b([]),[ae,pe]=b(0);v(()=>{if(!le)return;let e=!1;const t=e=>q(e,ne);return l(ne).list().then(n=>{if(e)return;const r=J.components;ce(n.filter(e=>e.node?.type&&r[e.node.type]&&o(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[J,ne,ae]);const[de,me]=b(null),[fe,ue]=b(null),ye=j(()=>e(J,V),[J]),he=e=>P(e,"section",J.components[e]?.label??e),ke=e=>({type:e.preset?S(e.preset.key):W(e.type),label:e.name,cover:/* @__PURE__ */x(X,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:ee.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),ge=e=>{const t=e.indexOf(":"),n=e.slice(0,t),o=e.slice(t+1);if("section"===n)return{kind:"section",type:o};if("block"===n)return{kind:"block",type:o};if("template"===n){const e=oe.find(e=>e.id===o);return e?{kind:"template",template:e}:null}if("shared"===n){const e=se.find(e=>e.id===o);return e?{kind:"shared",section:e}:null}if("preset"===n){const e=ye.find(e=>e.preset?.key===o)?.preset;return e?{kind:"preset",preset:e}:null}return null},be=e=>/* @__PURE__ */x("span",{className:"es-add-glyph-cover",children:/* @__PURE__ */x(_,{type:e,size:26})}),ve=j(()=>{const e=t(ye,Z),o=/* @__PURE__ */new Map,r=e=>{e.retired||o.has(e.type)||!q(e.type,ne)||o.set(e.type,e)};for(const t of e?[e]:ye.filter(e=>!e.preset)){const e=K(t.type)?.choices??[];e.forEach(r),e.forEach(e=>K(e.type,1)?.choices?.forEach(r))}T?.forEach(r);const l=new Set(ye.filter(e=>!e.preset).map(e=>e.type)),i=[...o.values()].filter(e=>!l.has(e.type)),s=e=>({type:B(e.type),label:e.label,cover:be(e.type),title:ee.tile({name:e.label}),keywords:[e.group??"",e.type].filter(Boolean)}),a=e=>!e.preset&&o.has(e.type)?{...ke(e),cover:be(e.type)}:ke(e),p=[];se.length>0&&p.push({key:"shared",title:ie.group,tiles:se.map(e=>({type:Q(e.id),label:e.title,cover:/* @__PURE__ */x(X,{type:e.node.type}),mark:/* @__PURE__ */x(w,{size:12}),title:ie.onPages({count:e.used_on.length}),keywords:[he(e.node.type),e.node.type]}))}),oe.length>0&&p.push({key:"templates",title:ee.templates,tiles:oe.map(e=>({type:L(e.id),label:e.name,cover:/* @__PURE__ */x(X,{type:e.node.type}),keywords:[he(e.node.type),e.node.type]}))});const d=i.filter(e=>!e.group);let m=!1;for(const t of Object.keys(J.categories??{})){const o=ye.filter(e=>e.cat===t);if(0===o.length)continue;const r=e&&o.some(t=>t.type===e.type)?e:null,l=(r?[r,...o.filter(e=>e.type!==r.type)]:o).map(a);r&&!m&&(l.splice(1,0,...d.map(s)),m=!0),p.push({key:`category:${t}`,title:n(J,t,R),tiles:l})}const f=p.find(e=>e.key?.startsWith("category:"));if(!m&&f&&d.length>0&&(f.tiles=[...f.tiles,...d.map(s)],m=!0),c(i.filter(e=>e.group||!m)).forEach((e,t)=>{p.push({key:`blocks:${t}`,title:e.group??"",tiles:e.items.map(s)})}),!$)return p;const u=p.map(e=>({...e,tiles:e.tiles.map(e=>{const t=ge(e.type),n=t?$(t):null;return n?{...e,disabled:!0,disabledReason:n}:e})})),y=e=>e.tiles.some(e=>!e.disabled);return[...u.filter(y),...u.filter(e=>!y(e))]},[oe,se,ie,ye,J,ee,$,T,ne]);/* @__PURE__ */
|
|
5
|
+
return F(G,{children:[
|
|
6
|
+
/* @__PURE__ */x(i,{icon:/* @__PURE__ */x(E,{size:15}),title:ee.title,context:ee.contextAll,actions:/* @__PURE__ */x(s,{label:ee.done,description:ee.doneDescription,onClick:Y}),onHide:z}),
|
|
7
|
+
/* @__PURE__ */F("div",{className:"sf-addside sf-scroll",children:[
|
|
8
|
+
/* @__PURE__ */x(k,{groups:ve,session:N,itemFor:e=>H(ge(e)??{kind:"section",type:e}),onInsert:D?e=>{const t=ge(e);t&&D(t)}:void 0,onTileMenu:(e,t)=>{const n=ge(e);return"shared"===n?.kind&&!A&&(me({section:n.section,...t}),!0)},at:C,hint:ee.hint,searchLabel:ee.search,readOnly:A,words:te}),U??null]}),de?/* @__PURE__ */x(O,{at:{x:de.x,y:de.y},owner:de.owner,onClose:()=>me(null),"aria-label":de.section.title,items:y([{label:ie.deleteShared,danger:!0,onClick:()=>{ue(de.section),me(null)}}])}):null,fe?/* @__PURE__ */x(M,{name:fe.title,pages:fe.used_on.length,onDelete:()=>(async e=>{try{await l(ne).remove(e.id)}catch{return void I.error(ie.deleteFailed)}ue(null),le?.removed?.(e),ce(t=>t.filter(t=>t.id!==e.id)),pe(e=>e+1)})(fe),onCancel:()=>ue(null)}):null]})}export{D as AddSidePanel,B as blockKey,S as presetKey,W as sectionKey,Q as sharedKey,L as templateKey};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useSectionOps as o}from"./chunk-3FANFZ4D.js";import{SELECTION_MODE as e}from"./chunk-TUIBPB77.js";import{decodePartId as r,encodePartId as t}from"./chunk-R4AUZVA3.js";import{useEasel as n}from"./chunk-L36E2WCO.js";import{usePreviewParts as p}from"./chunk-467WWV4I.js";import{useCallback as d,useEffect as c}from"react";var s=o=>"part"===o.kind;function m({mode:m,setMode:i,onOpenPart:a}){const{getSelectorForId:u}=n(o=>o),I=o(),{setSelectedPartId:f,setSelectHandler:k}=p(),l=d(o=>{const t=r(o);if(!t)return;const{nodeId:n,propKey:p}=t;p?(i(o=>s(o)&&o.nodeId===n&&o.propKey===p?o:{kind:"part",nodeId:n,propKey:p}),a?.(n)):i(o=>"part"===o.kind?e:o)},[i,a]);c(()=>{k(l)},[k,l]);const h=s(m)?t(m.nodeId,m.propKey):null;c(()=>{f(h)},[h,f]);return{selectNode:d(o=>{i(()=>e);const r=u(o);r&&I.select(r)},[i,u,I]),openPartId:h}}export{m as usePartBridge};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{resolveMediaPick as e}from"./chunk-
|
|
1
|
+
import{resolveMediaPick as e}from"./chunk-5HYVOOH3.js";function t(t){const r=t;switch(r?.type){case"storefront-editor:media-picked":{const r=t;return r.requestId&&e(r.requestId,r.media??null),!0}case"storefront-editor:media-pick-cancelled":{const r=t;return r.requestId&&e(r.requestId,null),!0}default:return!1}}export{t as routeSharedHostMessage};
|