efficient-easel 0.104.0 → 0.105.1
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 +59 -1
- package/dist/CanvasDragLayer-zgYT1xwY.d.ts +168 -0
- package/dist/chrome/index.js +1 -1
- package/dist/{chunk-KVNRNDUC.js → chunk-3P6AMTOS.js} +1 -1
- package/dist/{chunk-QCBWT2XE.js → chunk-53G47SWO.js} +1 -1
- package/dist/{chunk-IWAPPEL4.js → chunk-5ZBBXZPV.js} +1 -1
- package/dist/chunk-7FBDZTUD.js +2 -0
- package/dist/chunk-7V5WZ46F.js +2 -0
- package/dist/{chunk-4EUWOGZF.js → chunk-CLOS6SSX.js} +1 -1
- package/dist/{chunk-TTENU2HX.js → chunk-FMGFZNPW.js} +1 -1
- package/dist/{chunk-ZOJEFIP4.js → chunk-GMCZXMOV.js} +1 -1
- package/dist/chunk-HLEET6NV.js +65 -0
- package/dist/{chunk-OYX47SL7.js → chunk-HNKB2ZYR.js} +1 -1
- package/dist/{chunk-R2MUSGPS.js → chunk-IE4GFYKO.js} +1 -1
- package/dist/{chunk-UB7JVPK4.js → chunk-KG7RJWOK.js} +1 -1
- package/dist/chunk-N7VRF7PR.js +5 -0
- package/dist/chunk-NWIW7AWH.js +1 -0
- package/dist/{chunk-PYNQRX56.js → chunk-NYKIQJT2.js} +1 -1
- package/dist/chunk-PA3PNTVV.js +1 -0
- package/dist/chunk-PLVEGYK6.js +1 -0
- package/dist/chunk-PQXIFBDY.js +1 -0
- package/dist/{chunk-BBRY7KI4.js → chunk-Q4N7C6CT.js} +3 -3
- package/dist/{chunk-NEQIEYYO.js → chunk-QH6LCNOX.js} +1 -1
- package/dist/{chunk-Z6BAZFSW.js → chunk-R6WTQWAC.js} +2 -2
- package/dist/{chunk-QDEZQ5A6.js → chunk-S4AWJX4Q.js} +1 -1
- package/dist/{chunk-YODRYAZX.js → chunk-SARZN4M7.js} +1 -1
- package/dist/chunk-SQTY6CJD.js +1 -0
- package/dist/{chunk-QOPY2LQM.js → chunk-TBF5CVPA.js} +1 -1
- package/dist/chunk-THWO5YVZ.js +1 -0
- package/dist/chunk-U3JP4VGF.js +2 -0
- package/dist/{chunk-LXEOVUAV.js → chunk-V4LF7D4F.js} +1 -1
- package/dist/chunk-VSHV6KJQ.js +5 -0
- package/dist/{chunk-OM67AJQC.js → chunk-VSOP4GUM.js} +1 -1
- package/dist/{chunk-6DJHRLCU.js → chunk-YC4TB3CJ.js} +9 -9
- package/dist/chunk-ZTTWFAAC.js +1 -0
- package/dist/drag/index.d.ts +4 -164
- package/dist/edit-lock/index.d.ts +55 -1
- package/dist/edit-lock/index.js +1 -1
- package/dist/{host-DJ8Gzsx7.d.ts → host-BQ_b9Qzk.d.ts} +27 -1
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/MediaSidePanel.d.ts +1 -1
- package/dist/screen/components/MediaSidePanel.js +1 -1
- package/dist/screen/components/NodeContextMenu.d.ts +167 -9
- package/dist/screen/components/NodeContextMenu.js +1 -1
- package/dist/screen/components/PageEditGuardNotices.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 +10 -2
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.d.ts +18 -6
- 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 +18 -6
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.d.ts +13 -5
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/admin-bridge.js +1 -1
- package/dist/screen/lib/document-addressing.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/host.js +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-panel.js +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.js +1 -1
- package/dist/screen/lib/puck/content-tree.d.ts +8 -1
- package/dist/screen/lib/puck/content-tree.js +1 -1
- package/dist/screen/lib/puck/palette-sections.d.ts +7 -0
- package/dist/screen/lib/puck/palette-sections.js +1 -1
- package/dist/screen/lib/puck/section-doc.js +1 -1
- package/dist/screen/lib/puck/slot-child-name.d.ts +25 -1
- package/dist/screen/lib/puck/slot-child-name.js +1 -1
- package/dist/screen/lib/puck/style-clipboard.d.ts +53 -1
- package/dist/screen/lib/puck/style-clipboard.js +1 -1
- package/dist/screen/lib/puck/use-section-ops.d.ts +14 -12
- package/dist/screen/lib/puck/use-section-ops.js +1 -1
- package/dist/screen/lib/screen-parts.d.ts +471 -8
- package/dist/screen/lib/screen-parts.js +1 -1
- package/dist/screen/screen.css +18 -0
- package/dist/screen/words.d.ts +73 -2
- package/dist/screen/words.js +1 -1
- package/dist/strings/catalogue.d.ts +4 -2
- package/dist/strings/catalogue.js +1 -1
- package/dist/strings/index.d.ts +1 -1
- package/dist/strings/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-5D2XAZKH.js +0 -62
- package/dist/chunk-7755VWRT.js +0 -4
- package/dist/chunk-7GVLSNFW.js +0 -1
- package/dist/chunk-A2LFBOUF.js +0 -1
- package/dist/chunk-D6324C3E.js +0 -5
- package/dist/chunk-GENAF3P6.js +0 -1
- package/dist/chunk-HMWJB3HF.js +0 -1
- package/dist/chunk-JUQ6YJCG.js +0 -1
- package/dist/chunk-LEGAPYPC.js +0 -1
- package/dist/chunk-LRTIMWZG.js +0 -2
- package/dist/chunk-Q2HPBMG5.js +0 -1
- package/dist/chunk-R5ZVNJLJ.js +0 -2
- package/dist/chunk-SERF2FAU.js +0 -1
package/dist/screen/words.d.ts
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
* `screen`): what it says while a document opens, what it says when one will
|
|
4
4
|
* not, the word it calls the document in the edit notice, and the words of
|
|
5
5
|
* the Layers tree's frame round the document's nodes (0.103.0): its first
|
|
6
|
-
* row, the pinned groups, the band of sections and the band's "+".
|
|
6
|
+
* row, the pinned groups, the band of sections and the band's "+". And
|
|
7
|
+
* (0.105.0) the Add panel's words (`add`), the main button's, and what the
|
|
8
|
+
* block keys say when a block is copied or will not paste.
|
|
7
9
|
*
|
|
8
10
|
* They came with the screen from the website editor, written into the
|
|
9
11
|
* provider, the mount and the notice; a second host (the campaign designer)
|
|
@@ -19,6 +21,57 @@
|
|
|
19
21
|
* that is the layer's to say (`DocumentAddressing.describeMissing`): these are
|
|
20
22
|
* the words the screen says when the layer says none.
|
|
21
23
|
*/
|
|
24
|
+
/**
|
|
25
|
+
* THE ADD PANEL'S WORDS (0.105.0, seam E9): its head, its groups, the line
|
|
26
|
+
* under its search and where the next thing goes. They were written into
|
|
27
|
+
* components/AddSidePanel and the chrome's `addAtLabel` in a website's words
|
|
28
|
+
* ("Drag onto the page", "Adding at the end of the page"); the campaign
|
|
29
|
+
* designer adds blocks to an email. The defaults are those words, word for
|
|
30
|
+
* word.
|
|
31
|
+
*/
|
|
32
|
+
type ScreenAddWords = {
|
|
33
|
+
/** The panel head's title. */
|
|
34
|
+
title: string;
|
|
35
|
+
/** …its context line where only a place's blocks are offered… */
|
|
36
|
+
contextBlocks: string;
|
|
37
|
+
/** …and everywhere else. */
|
|
38
|
+
contextAll: string;
|
|
39
|
+
/** The head's way out, back to the view underneath, and what it does. */
|
|
40
|
+
done: string;
|
|
41
|
+
doneDescription: string;
|
|
42
|
+
/** The group of the section offered first (`blockLook.firstSection`). */
|
|
43
|
+
startBlank: string;
|
|
44
|
+
/** The group of the saved sections. */
|
|
45
|
+
templates: string;
|
|
46
|
+
/** The first heading over a container's blocks, naming it. */
|
|
47
|
+
inside: (v: {
|
|
48
|
+
name: string;
|
|
49
|
+
}) => string;
|
|
50
|
+
/** A tile's title, naming what it adds. */
|
|
51
|
+
tile: (v: {
|
|
52
|
+
name: string;
|
|
53
|
+
}) => string;
|
|
54
|
+
/** The line under the search where only a place's blocks are offered… */
|
|
55
|
+
hintBlocks: string;
|
|
56
|
+
/** …and everywhere else. */
|
|
57
|
+
hint: string;
|
|
58
|
+
/** The search box's name where only blocks are offered, and elsewhere. */
|
|
59
|
+
searchBlocks: string;
|
|
60
|
+
searchSections: string;
|
|
61
|
+
/** Where the next thing goes: into a container… */
|
|
62
|
+
addingTo: (v: {
|
|
63
|
+
name: string;
|
|
64
|
+
}) => string;
|
|
65
|
+
/** …before a section… */
|
|
66
|
+
addingBefore: (v: {
|
|
67
|
+
name: string;
|
|
68
|
+
}) => string;
|
|
69
|
+
/** …after the last one… */
|
|
70
|
+
addingAtEnd: string;
|
|
71
|
+
/** …and anywhere the screen cannot name. */
|
|
72
|
+
addingHere: string;
|
|
73
|
+
};
|
|
74
|
+
declare const DEFAULT_SCREEN_ADD_WORDS: ScreenAddWords;
|
|
22
75
|
type ScreenWords = {
|
|
23
76
|
/** While the document is on its way, and while an entry may still bounce. */
|
|
24
77
|
loading: string;
|
|
@@ -59,7 +112,25 @@ type ScreenWords = {
|
|
|
59
112
|
}) => string;
|
|
60
113
|
/** …and in a gap with no section after it. */
|
|
61
114
|
addSectionHere: string;
|
|
115
|
+
/**
|
|
116
|
+
* The top bar's main button (0.105.0). Owner ruling R3 (Victor Mau,
|
|
117
|
+
* 2026-10-09): BOTH editors' main button says Done. It still publishes a
|
|
118
|
+
* document that publishes and saves one that does not; only its word is
|
|
119
|
+
* one, where it said "Publish" or "Save".
|
|
120
|
+
*/
|
|
121
|
+
done: string;
|
|
122
|
+
/** ⌘C on the selected block (0.105.0): the one of the block keys with
|
|
123
|
+
* nothing to see on the page, so it says so. */
|
|
124
|
+
copied: (v: {
|
|
125
|
+
name: string;
|
|
126
|
+
}) => string;
|
|
127
|
+
/** ⌘V where the held block has nowhere to go (0.105.0). */
|
|
128
|
+
pasteRefused: (v: {
|
|
129
|
+
name: string;
|
|
130
|
+
}) => string;
|
|
131
|
+
/** The Add panel's words (0.105.0). */
|
|
132
|
+
add: ScreenAddWords;
|
|
62
133
|
};
|
|
63
134
|
declare const DEFAULT_SCREEN_WORDS: ScreenWords;
|
|
64
135
|
|
|
65
|
-
export { DEFAULT_SCREEN_WORDS, type ScreenWords };
|
|
136
|
+
export { DEFAULT_SCREEN_ADD_WORDS, DEFAULT_SCREEN_WORDS, type ScreenAddWords, type ScreenWords };
|
package/dist/screen/words.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{DEFAULT_SCREEN_WORDS}from"../chunk-
|
|
1
|
+
export{DEFAULT_SCREEN_ADD_WORDS,DEFAULT_SCREEN_WORDS}from"../chunk-PQXIFBDY.js";
|
|
@@ -8,6 +8,7 @@ import { N as NodeMenuWords } from '../words-DMG4dYq2.js';
|
|
|
8
8
|
import { P as PanelWords } from '../words-BGrHZAJJ.js';
|
|
9
9
|
import { P as PickWords } from '../words-is_Vy6hn.js';
|
|
10
10
|
import { ScreenWords } from '../screen/words.js';
|
|
11
|
+
export { ScreenAddWords } from '../screen/words.js';
|
|
11
12
|
import { S as StyleClipboardWords } from '../words-CnnHb9jo.js';
|
|
12
13
|
import { T as TextStylesWords } from '../words-CRYvAiHX.js';
|
|
13
14
|
import { T as TreeWords } from '../words-DgHcY5qB.js';
|
|
@@ -110,8 +111,9 @@ interface EaselStrings {
|
|
|
110
111
|
canvas: CanvasWords;
|
|
111
112
|
/** `efficient-easel/text-styles` — the Email styles / Site styles list (E6). */
|
|
112
113
|
textStyles: TextStylesWords;
|
|
113
|
-
/** `efficient-easel/screen` — a document opening, one that will not,
|
|
114
|
-
* notice's word for the document
|
|
114
|
+
/** `efficient-easel/screen` — a document opening, one that will not, the
|
|
115
|
+
* notice's word for the document, the Layers tree's frame, the Add panel,
|
|
116
|
+
* the main button and the block keys. */
|
|
115
117
|
screen: ScreenWords;
|
|
116
118
|
}
|
|
117
119
|
/** Today's English, word for word. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-
|
|
1
|
+
export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-53G47SWO.js";import"../chunk-M6F6LS3H.js";import"../chunk-6WY6ZXJG.js";import"../chunk-PQXIFBDY.js";import"../chunk-AELNNAFM.js";import"../chunk-3EDSDPIP.js";import"../chunk-QTLAVDJE.js";import"../chunk-WK3AFPXY.js";import"../chunk-H6DDIBQ4.js";import"../chunk-ZJEBF4NB.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import"../chunk-UH7IGZKF.js";import"../chunk-ZAOM6PFH.js";import"../chunk-FPOKPNO4.js";import"../chunk-546BBOPE.js";import"../chunk-O2NLQBFX.js";
|
package/dist/strings/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export { N as NodeMenuWords } from '../words-DMG4dYq2.js';
|
|
|
11
11
|
export { P as PanelWords } from '../words-BGrHZAJJ.js';
|
|
12
12
|
export { P as PickWords } from '../words-is_Vy6hn.js';
|
|
13
13
|
export { S as SaveWords } from '../words-D_Lnw1Gr.js';
|
|
14
|
-
export { ScreenWords } from '../screen/words.js';
|
|
14
|
+
export { ScreenAddWords, ScreenWords } from '../screen/words.js';
|
|
15
15
|
export { S as StyleClipboardWords } from '../words-CnnHb9jo.js';
|
|
16
16
|
export { T as TextStylesWords } from '../words-CRYvAiHX.js';
|
|
17
17
|
export { T as TreeWords } from '../words-DgHcY5qB.js';
|
package/dist/strings/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{DEFAULT_EASEL_STRINGS as r,mergeEaselStrings as n}from"../chunk-
|
|
1
|
+
import{DEFAULT_EASEL_STRINGS as r,mergeEaselStrings as n}from"../chunk-53G47SWO.js";export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-53G47SWO.js";import"../chunk-M6F6LS3H.js";import"../chunk-6WY6ZXJG.js";import"../chunk-PQXIFBDY.js";import"../chunk-AELNNAFM.js";import"../chunk-3EDSDPIP.js";import"../chunk-QTLAVDJE.js";import"../chunk-WK3AFPXY.js";import"../chunk-H6DDIBQ4.js";import"../chunk-ZJEBF4NB.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import"../chunk-UH7IGZKF.js";import"../chunk-ZAOM6PFH.js";import"../chunk-FPOKPNO4.js";import"../chunk-546BBOPE.js";import{stringsContext as o}from"../chunk-MFIRYGHW.js";import"../chunk-O2NLQBFX.js";import{useContext as t,useMemo as c}from"react";import{jsx as i}from"react/jsx-runtime";function s({value:s,locale:u,children:m}){const e=o(),p=t(e),h=p?.strings??r,j=u??p?.locale??"en",k=c(()=>({strings:n(h,s),locale:j}),[h,s,j]);/* @__PURE__ */
|
|
2
2
|
return i(e.Provider,{value:k,children:m})}function u(){return t(o())?.strings??r}function m(){return t(o())?.locale??"en"}export{s as EaselStringsProvider,m as useEaselLocale,u as useEaselStrings};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-easel",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.105.1",
|
|
4
4
|
"description": "Efficient Easel: the EFFICIENT editors' shared engine and chrome: the saved document as pure functions, the published renderer, and the editor frame, panels, Layers tree, text grammar and type-in-place box. Published as editor-shell up to 0.66.0 and as efficient-editor up to 0.95.0.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Efficient Pty Ltd",
|
package/dist/chunk-5D2XAZKH.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import{dedupeSlotChildren as e}from"./chunk-26OOWIJJ.js";import{siteStyleScope as n,copyNodeStyle as t,nodeStyleRows as o,planNodePaste as r}from"./chunk-Q2HPBMG5.js";import{markedTreeNodeId as i,revealSelectedTreeRow as l,sameSelector as s}from"./chunk-FGNR22NY.js";import{cloneNodeWithFreshIds as d}from"./chunk-R2MUSGPS.js";import{rootRowName as c,slotChildRowName as a,slotChildRenameProp as p}from"./chunk-QOPY2LQM.js";import{scrollPreviewToSection as u,gotoPreviewSlide as f,scrollPreviewToTop as h}from"./chunk-4ES5JGGX.js";import{useEaselKeyTarget as m,useEaselUndoKeys as y}from"./chunk-OM67AJQC.js";import{SlotChildActionsProvider as g}from"./chunk-KCBEE2MC.js";import{UiIcon as k}from"./chunk-5MZ3RNQQ.js";import{DEFAULT_PANEL_W as S,PANEL_WIDTHS_KEY as b,clampPanelWidth as v}from"./chunk-SERF2FAU.js";import{usePartBridge as w}from"./chunk-TTENU2HX.js";import{useSectionOps as x}from"./chunk-A2LFBOUF.js";import{useNodeClipboard as z,useNodeContextMenu as C}from"./chunk-HMWJB3HF.js";import{ROOT_ZONE as N,blockNodeActions as B,TREE_MAX_DEPTH as A,childSlotsOf as P,slotFieldsOf as T,nestsInTree as O,newNodeId as $}from"./chunk-7GVLSNFW.js";import{PageEditGuardNotices as R}from"./chunk-LXEOVUAV.js";import{useScreenDocument as j}from"./chunk-LRTIMWZG.js";import{requestMediaPick as M}from"./chunk-UB7JVPK4.js";import{heldStyle as E,styleShortcut as L}from"./chunk-57DJOKXT.js";import{AddChildRow as I}from"./chunk-3QVB4AG2.js";import{AddSidePanel as V}from"./chunk-D6324C3E.js";import{SidePanelHead as F,PanelShowStrip as D}from"./chunk-IWAPPEL4.js";import{MediaSidePanel as H}from"./chunk-PYNQRX56.js";import{useScreenSaveSwitch as G,useScreenPinned as U,useScreenDocumentLabel as W,useScreenCanvasFrame as J,useScreenInspectorPanel as Q,useScreenDevices as Y,useScreenPickFollowsSelection as X,useScreenLeftView as Z,SELECTION_MODE as _,sameInspectorMode as q,useScreenBridges as K,useScreenBlockRules as ee,useScreenBlockLook as ne,useScreenDocumentPass as te,isPinnedFirst as oe,isPinnedLast as re}from"./chunk-7755VWRT.js";import{useMediaPanel as ie,usePanelPick as le,useCancelPanelPick as se}from"./chunk-Z6BAZFSW.js";import{useEaselHost as de}from"./chunk-R5ZVNJLJ.js";import{DEFAULT_SCREEN_WORDS as ce}from"./chunk-LEGAPYPC.js";import{useEasel as ae}from"./chunk-P67FP7PG.js";import{TreeRow as pe,Subtree as ue,LayersTree as fe,TreeGroupLabel as he,TreeRowAction as me,TreeSeam as ye}from"./chunk-ZFDCDJNZ.js";import{useNodeOps as ge,toItemSelector as ke}from"./chunk-D2BCHTQR.js";import{saveIndicator as Se}from"./chunk-H6DDIBQ4.js";import{EaselTopBar as be,TopBarRail as ve,TopBarCluster as we,EaselIconButton as xe,TopBarDivider as ze,DeviceSwitch as Ce,InspectorIconButton as Ne,PanelResizeHandle as Be,MAX_PANEL_W as Ae,MIN_PANEL_W as Pe,panelWidthVars as Te,SaveState as Oe,SaveStateToggle as $e}from"./chunk-6DJHRLCU.js";import{useWords as Re}from"./chunk-MFIRYGHW.js";import{CanvasDragLayer as je}from"./chunk-TTJ54QGG.js";import{createDragSession as Me,useTreeDrag as Ee,gapToMoveIndex as Le}from"./chunk-67GNT6PF.js";import{useCanvasFrame as Ie,BLOCK_SELECTOR as Ve,useCanvasEvent as Fe}from"./chunk-PAELDYYS.js";import{LayersIcon as De,UndoIcon as He,RedoIcon as Ge,TrashIcon as Ue,MediaIcon as We}from"./chunk-L5KW4HG5.js";import{ROOT_ID as Je,ROOT_SLOT as Qe,zoneKey as Ye,parseZoneKey as Xe,DataError as Ze}from"./chunk-KRXQM65X.js";import{useRef as _e,useMemo as qe,useState as Ke,useEffect as en,useCallback as nn,useLayoutEffect as tn,Fragment as on}from"react";import{jsx as rn,jsxs as ln,Fragment as sn}from"react/jsx-runtime";function dn({saveState:e,notSaving:n,readOnlyReason:t,toggle:o,onToggle:r,onRetry:i}){if(null!==t)/* @__PURE__ */return rn(Oe,{tone:"off",label:t,role:"status"});if(n)/* @__PURE__ */
|
|
2
|
-
return rn(Oe,{tone:e.pending?"off-unsaved":"off",label:"Not saving — see the notice above",role:"status"});const{tone:l,label:s}=Se(e),d=e.failed&&!e.paused&&/* @__PURE__ */rn("button",{type:"button",className:"es-btn-ghost",onClick:i,children:"Retry now"});/* @__PURE__ */
|
|
3
|
-
return ln(sn,o?{children:[
|
|
4
|
-
/* @__PURE__ */rn($e,{pressed:e.paused,onToggle:r,title:e.paused?"Auto-save is off — click to turn it back on (saves your held edits)":"Auto-save is on — click to pause it",children:/* @__PURE__ */rn(Oe,{tone:l,label:s})}),d]}:{children:[
|
|
5
|
-
/* @__PURE__ */rn(Oe,{tone:l,label:s,role:"status"}),d]})}function cn({expand:e}){/* @__PURE__ */
|
|
6
|
-
return rn("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */ln(sn,e?{children:[
|
|
7
|
-
/* @__PURE__ */rn("path",{d:"M8 9l4-4 4 4"}),
|
|
8
|
-
/* @__PURE__ */rn("path",{d:"M8 15l4 4 4-4"})]}:{children:[
|
|
9
|
-
/* @__PURE__ */rn("path",{d:"M8 4l4 4 4-4"}),
|
|
10
|
-
/* @__PURE__ */rn("path",{d:"M8 20l4-4 4 4"}),
|
|
11
|
-
/* @__PURE__ */rn("path",{d:"M5 12h14"})]})})}var an="screen:band",pn={duplicate:!0,delete:!0};function un(){const Se=de(),{capabilities:Oe,currentSlug:$e,siteId:un,onPublish:fn,saveState:hn,saveConflict:mn,retrySave:yn,toggleAutoSave:gn,readOnly:kn,readOnlyReason:Sn=null}=j(),bn=G(),{canPublish:vn,mediaEditing:wn,hasEditGuard:xn,hasPinnedChrome:zn}=Oe,{appState:Cn,dispatch:Nn,history:Bn,selectedItem:An,getSelectorForId:Pn,config:Tn}=ae(e=>e),On=U(),{first:$n,firstGroup:Rn,lastGroup:jn,isSectionGroup:Mn,sectionGroupZone:En,panelOf:Ln}=On,In=Ln($n),Vn=e=>oe(On,e),Fn=e=>re(On,e),Dn="node"===On.firstRow,Hn=On.band??null,Gn=Re("screen",ce),Un=W()??`/${$e}`,Wn=J(),Jn=Q(),Qn=x({readOnly:kn}),Yn=_e(null),Xn=qe(()=>({...Qn,select:e=>{Yn.current=e,Qn.select(e)}}),[Qn]),Zn=Cn.ui,_n=Zn.leftSideBarVisible,qn=Zn.rightSideBarVisible,{options:Kn,widths:et,initial:nt,fluid:tt}=Y(),[ot,rt]=Ke(nt),it=ie(),lt=wn&&null!==it,st=le(),dt=se();X(An?.props.id);const{read:ct,write:at,forSelection:pt}=Z(),[ut,ft]=Ke(ct);en(()=>{at(ut)},[ut]);const[ht,mt]=Ke(0),yt=_e(null),gt=_e(null),kt=Ie(gt,{readySelector:Ve}),St=m(gt);y(gt);const[bt,vt]=Ke(!1),wt=_e(!1),xt=_e(!1),[zt,Ct]=Ke(null),Nt=zt&&zt.zone===N?zt.index:null,Bt=e=>Ct(null===e?null:{zone:N,index:e}),[At,Pt]=Ke([]),[Tt,Ot]=Ke(_),$t="puck"===Tt.kind,Rt=i(Tt,An?.props.id),[jt,Mt]=Ke(null);en(()=>{jt&&(l(),Mt(null))},[jt]);const Et=_e(Pn);Et.current=Pn;const Lt=nn((e,{scroll:n})=>{ft(n=>pt(e,n)),n&&Mt(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=Et.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),o=n}0!==t.length&&lo(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]);en(()=>{Ot(Ln(An?.type)??_);const e=An?.props.id,n=Yn.current;if(Yn.current=null,!e)return;const t=Pn(e);Lt(String(e),{scroll:!s(n,t??null,N)})},[An?.props.id,Lt]);const It=nn(e=>{Ot(n=>q(n,e)?n:e),Nn({type:"setUi",ui:{rightSideBarVisible:!0}})},[Nn]),Vt=K({kind:Tt.kind,mode:Tt,open:It,show:e=>Ot(e),reveal:()=>{qn||Nn({type:"setUi",ui:{rightSideBarVisible:!0}})}},{data:Cn.data,selected:An??null,zoneOf:e=>Pn(e)?.zone,readOnly:Boolean(kn),select:e=>{Ot(_),Xn.select({index:e})},replace:(e,n)=>Xn.replaceComponent(N,e,n),scrollTo:e=>fr(e)},{device:ot,refreshes:ht},{setView:ft,reveal:()=>{_n||Nn({type:"setUi",ui:{leftSideBarVisible:!0}})}}),Ft=Vt.pinnedSource??!1,Dt=Vt.resolveLeftView?Vt.resolveLeftView(ut,lt):"media"===ut&<?ut:"sections",{isLockedBlock:Ht,duplicateBlocked:Gt,nestDepth:Ut,newSectionNode:Wt,canAddTo:Jt,blockIsOffered:Qt}=ee(),Yt=ne(),{labelAtLevel:Xt,Icon:Zt,useProducts:_t}=Yt,qt=Yt.rowName?(e,n,t)=>Yt.rowName(e,n,t):void 0,Kt=nn(e=>{Nn({type:"setUi",ui:{rightSideBarVisible:!0}}),u(e),Lt(e,{scroll:!0})},[Nn,Lt]),{selectNode:eo,openPartId:no}=w({mode:Tt,setMode:Ot,onOpenPart:Kt}),[to,oo]=Ke(null),ro="sf-editor-collapsed-sections",[io,lo]=Ke(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(ro);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
|
|
12
|
-
return new Set}});en(()=>{try{window.localStorage.setItem(ro,JSON.stringify([...io]))}catch{}},[io]);const[so,co]=Ke(()=>{if("undefined"==typeof window)return{...S};try{const e=window.localStorage.getItem(b);if(!e)return{...S};const n=JSON.parse(e);return{left:v(Number(n.left)||S.left),right:v(Number(n.right)||S.right)}}catch{return{...S}}});en(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(b,JSON.stringify(so))}catch{}},300);return()=>clearTimeout(e)},[so]);const ao=nn((e,n)=>co(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),po=nn(e=>ao("left",e),[ao]),uo=nn(e=>ao("right",e),[ao]),fo=e=>io.has(e),ho=e=>lo(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),mo=_e(!1),yo=_e(null);en(()=>{if(mo.current&&!bt){const e=yo.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??gt.current?.querySelector('button[aria-label="Add"]'))?.focus(),yo.current=null}mo.current=bt},[bt]),en(()=>{if(!bt||!St)return;const e=e=>{"Escape"===e.key&&wr()};return St.addEventListener("keydown",e),()=>St.removeEventListener("keydown",e)},[bt,St]),en(()=>{!_n&&bt&&(vt(!1),Ct(null),wt.current=!1)},[_n]),en(()=>{if(!st)return xt.current&&Nn({type:"setUi",ui:{leftSideBarVisible:!1}}),void(xt.current=!1);bt&&(vt(!1),Ct(null),xt.current=wt.current,wt.current=!1),_n||(xt.current=!0,Nn({type:"setUi",ui:{leftSideBarVisible:!0}}))},[st]),en(()=>{!_n&&st&&(xt.current=!1,dt())},[_n]),en(()=>{if(!st||!St)return;const e=e=>{"Escape"===e.key&&dt()};return St.addEventListener("keydown",e),()=>St.removeEventListener("keydown",e)},[st,St]);const[go,ko]=Ke(null),[So,bo]=Ke(0),vo=_e(null),wo=(e,n="success")=>{ko({msg:e,tone:n}),bo(e=>e+1),vo.current&&clearTimeout(vo.current),vo.current=setTimeout(()=>ko(null),"error"===n?3200:1900)};en(()=>()=>{vo.current&&clearTimeout(vo.current)},[]);const xo=_e(null),[zo,Co]=Ke(0),[No,Bo]=Ke(0);en(()=>{const e=xo.current;if(!e)return;const n=()=>{Co(e.clientWidth),Bo(e.clientHeight)};n();const t=new ResizeObserver(n);return t.observe(e),()=>t.disconnect()},[]),tn(()=>{xo.current&&(Co(xo.current.clientWidth),Bo(xo.current.clientHeight))},[so,_n,qn]);const Ao=ot===tt?zo>0?zo:et[tt]:et[ot],Po=zo>0?Math.min(zo/Ao,2):1,To=Ao*Po,Oo=zo>0&&To>zo+1,$o={width:To,height:No||"100%",flex:"none",position:"relative"},Ro={width:Ao,height:No?No/Po:"100%",maxHeight:"none",transform:1!==Po?`scale(${Po})`:void 0,transformOrigin:"top left"},jo=()=>Nn({type:"setUi",ui:{leftSideBarVisible:!_n}}),Mo=()=>Nn({type:"setUi",ui:{rightSideBarVisible:!qn}}),Eo=e=>{bt&&(vt(!1),Ct(null),wt.current=!1,_n&&ut===e)||st&&(xt.current=!1,dt(),_n&&ut===e)||(_n&&ut===e?jo():(ft(e),_n||Nn({type:"setUi",ui:{leftSideBarVisible:!0}})))},Lo=()=>{M(Se,{accept:"image/*",title:"Media library"})},Io=()=>{Ot(_),Xn.select(null),h()},Vo=()=>{Ot(In??_),qn||Nn({type:"setUi",ui:{rightSideBarVisible:!0}})},Fo=Cn.data.content??[],Do=()=>{const e=Fo.findIndex(Vn),n=Fo.findIndex(Fn);return{floor:e>=0?e+1:0,cap:n>=0?n:Fo.length}},Ho=Tn,Go=z(),Uo=ge({data:Cn.data,config:Ho,readOnly:Boolean(kn),clipboard:Go,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==Je||e.slot!==Qe)return{min:0,max:n-1};const{floor:t,cap:o}=Do();return{min:t,max:o-1}},commit:(e,{select:n})=>{if(void 0!==n){Ot(_);const t="node"===n?.kind?ke(e,Ho,n):null;Xn.select(t&&t.zone===N?{index:t.index}:t)}Xn.commitDocument(e)}}),Wo=e=>Tn.components[e]?.label??e,Jo=nn(e=>Tn.components[e]?.defaultProps??{},[Tn]),Qo=e=>Xt(e,"section",Wo(e)),Yo=e=>c({type:e.type,props:e.props??{}},Qo(e.type),qt),{nodeAddresses:Xo,zoneItems:Zo}=qe(()=>{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>=A)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of P(Tn,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(Fo,N,0),{nodeAddresses:e,zoneItems:n}},[Fo,Tn]),_o=nn(e=>Zo.get(e)??[],[Zo]),qo=_t(),Ko=qe(()=>{const e=/* @__PURE__ */new Map;for(const n of qo??[])e.set(n.slug,n.name);return e},[qo]),er=e=>a(e,Wo,Yt.plainText,e=>Ko.get(e),Yt.rowName),nr=(e,n)=>n===N?null:p(Tn.components[e.type]?.fields),tr=(e,n,t,o)=>{if(!(to?.zone===e&&to.index===n))return;const r=(t,o)=>{oo(null),o&&((e,n,t)=>{const o=_o(e)[n];if(!o)return;const r=nr(o,e);r&&Xn.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
|
|
13
|
-
return rn("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":"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)},or=n(un),rr=Tn,ir=(e,n)=>n===N?Qo(e):Wo(e),lr=(e,n,t)=>{const o=r(rr,or,t,ir(t.type,e));o&&(o.changed&&Xn.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),wo(o.message))},sr=C({nodesIn:_o,nodeAt:(e,n)=>_o(e)[n]??null,labelOf:(e,n)=>n===N?Qo(e):Wo(e),renamePropOf:nr,beginRename:(e,n)=>oo({zone:e,index:n}),history:{hasPast:Bn.hasPast,hasFuture:Bn.hasFuture,back:()=>Bn.back(),forward:()=>Bn.forward()},openAddSection:()=>{Xn.select(null),br(null)},openPageSettings:()=>{Xn.select(null),Ot(_)},collapseAll:()=>lo(new Set(_o(N).map(e=>String(e.props.id)))),onPasteRefused:()=>wo("Your browser won’t let us read the clipboard — press ⌘V","error"),isLocked:e=>Ht(e.type),duplicateBlocked:e=>Gt(Cn.data,e),permits:e=>B(Tn,e.type),canAddTo:Jt,nodeOps:Uo,isPinned:(e,n)=>n===N&&(Vn(e)||Fn(e)),sectionBand:Do,openAddInside:(e,n)=>{e===N?hr(n):Xn.select({zone:e,index:n}),br(null)},locate:e=>Xo.get(e)??null,rowNameOf:(e,n)=>n===N?Yo(e):er(e),selectAt:(e,n,t,o)=>{e===N?hr(n):Vr(e,n,t,o??"")},style:{held:()=>E(or),canCopy:e=>o(rr,e).some(e=>!1!==e.counted),copy:(e,n)=>t(rr,or,e,ir(e.type,n)),paste:(e,n,t)=>lr(e,n,t)}},kt),dr=_e({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});en(()=>{dr.current={copy:(e,n)=>t(rr,or,e,ir(e.type,n)),paste:lr,at:()=>{const e=Cn.ui.itemSelector;if(!e)return null;const n=e.zone??N,t=_o(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(kn)}});const cr=nn(e=>{const n=L(e);if(!n)return;const t=dr.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))},[]);en(()=>{if(!St)return;const e=e=>cr(e);return St.addEventListener("keydown",e),()=>St.removeEventListener("keydown",e)},[cr,St]),Fe(kt,"keydown",cr);const ar=Fo.map(e=>e.props.id).join("|");en(()=>{const e=kt?.document??null,n=kt?.window??null;let t=0;const o=[],r=()=>{if(!e)return void Pt(e=>e.length?[]:e);const n=Fo.findIndex(Fn),t=n>=0?n:Fo.length,o=n=>{const t=Fo[n]?.props?.id;if(null==t)return null;const o=e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`);return o?o.getBoundingClientRect():null},r=[];for(let e=1;e<=t;e++){const n=o(e),t=o(e-1);(n||t)&&r.push({top:Math.round(n?n.top:t.bottom),index:e})}Pt(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)return!1;return!0}(e,r)?e:r)},i=()=>{cancelAnimationFrame(t),t=requestAnimationFrame(r)};if(!e||!n)return void r();n.addEventListener("scroll",i,{passive:!0});const l=new ResizeObserver(i);return l.observe(e.documentElement),r(),o.push(setTimeout(r,150),setTimeout(r,450)),()=>{cancelAnimationFrame(t),o.forEach(clearTimeout),n.removeEventListener("scroll",i),l.disconnect()}},[kt,ar,ot,Po,_n,qn,An?.props.id]);const pr=kt?.document??null,ur=kt?.window??null;en(()=>{const e=yt.current;if(!e||!pr||!ur)return;const n=[],t=()=>{const n=pr.querySelector(`[data-puck-component="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&ur.scrollTo({left:ur.scrollX,top:ur.scrollY+t,behavior:"instant"}),!0};return yt.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[pr,ur]);const fr=e=>{Vt.holdCanvasOn?Vt.holdCanvasOn(e):u(e)},hr=e=>{Ot(_),Xn.select({index:e}),Vt.sectionPressed?.(Fo[e]);const n=Fo[e]?.props?.id;n&&fr(n)},mr=e=>{const{floor:n,cap:t}=Do(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=An&&Tt.kind!==In?.kind?Fo.findIndex(e=>e.props.id===An.props.id):-1;return o(r>=0?r+1:t)},yr=(e,n)=>{const{floor:t,cap:o}=Do(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(Xn.reorderComponent(N,e,i),Xn.select({index:i}),{moved:!0,dest:i})},gr=(e,n,t)=>{Ot(_),Xn.select({index:e}),u(n),wo(`Added “${t}” section`)},kr=(e,n)=>{const t=mr(n),o=Wt(e,{nodeDefaults:Jo,newNodeId:$,sectionLabel:Qo,blockIsOffered:Qt}),r=o?Xn.insertNode(N,t,o):Xn.insertSection(e,t);return gr(t,r,Qo(e)),t},Sr=(e,n,t)=>{const o=mr(t),r=Xn.insertNode(N,o,n);return gr(o,r,e),o},br=e=>vr(N,e),vr=(e,n)=>{yo.current=document.activeElement??null,st&&(wt.current=xt.current,xt.current=!1,dt()),Ct(null===n?null:{zone:e,index:n}),vt(!0),_n||(wt.current=!0,Nn({type:"setUi",ui:{leftSideBarVisible:!0}}))},wr=()=>{vt(!1),Ct(null),wt.current&&Nn({type:"setUi",ui:{leftSideBarVisible:!1}}),wt.current=!1},xr=(e,n,t)=>{if("section"===e.kind)Xn.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;Xn.insertNode(n,t,d(e.template.node))}Ot(_),Xn.select({index:t,zone:n})},zr=e=>n=>{n.target.closest(".es-tree-select")||e()},Cr=()=>Vt.editPinnedSource?.(),Nr=(e,n,t)=>{const o=_o(e)[n];return o&&!B(Tn,o.type).delete?null:/* @__PURE__ */rn(me,{kind:"delete",label:`Delete ${t}`,onClick:()=>((e,n)=>{const t=_o(e)[n]?.props?.id;null!=t&&Uo.remove(String(t))})(e,n),children:/* @__PURE__ */rn(Ue,{size:15})})},Br=e=>Yt.rowPreview?.(e)||void 0,Ar=e=>Yt.rowMarks?.(e)??void 0,Pr=(e,n,t)=>Yt.rowActions?.(e,n,t)??null,Tr=(e,n,t,o)=>{const r=Boolean(t.props._hidden);/* @__PURE__ */
|
|
14
|
-
return rn(me,{kind:"eye",label:r?`Show ${o}`:`Hide ${o}`,onClick:()=>$r(e,n,t),children:/* @__PURE__ */rn(k,r?{name:"eye-off",size:14}:{name:"eye",size:14})})},Or=e=>{const n=Qo(Fo[e]?.type??""),t=n?Gn.addSectionBefore({name:n}):Gn.addSectionHere;return pi(N,e,()=>br(e),t)},$r=(e,n,t)=>{Xn.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},Rr=e=>T(Tn,e),jr=e=>P(Tn,e),Mr=(e,n,t)=>{const o=O(Tn,e.type,n)&&(t||jr(e).length>0);return{collapsible:o,folded:o&&fo(String(e.props.id))}},Er=(e,n,t)=>jr(e).flatMap(({child:e})=>Mr(e,n,t(e.type)).collapsible?[String(e.props.id),...Er(e,n+1,t)]:[]),Lr=e=>jr(e).length>0||Boolean(Jt(e.type)),Ir=e=>Boolean(Jt(e)),Vr=(e,n,t,o)=>{if(Ot(_),Jt(o)?.spec?.slider){const t=e.split(":")[0];f(t,n),Xn.select({index:n,zone:e}),u(t)}else Xn.select({index:n,zone:e}),fr(t)},Fr=(e,n,t,o,r)=>{const i=`${e}:${n}`;Xn.insertComponent(i,t,o),Jt(r)?.spec?.slider?requestAnimationFrame(()=>{f(e,o),Xn.select({index:o,zone:i})}):Xn.select({index:o,zone:i})},Dr=(e,n,t)=>{Xn.insertComponent(e,n,t),Ot(_),Xn.select({index:t,zone:e})},Hr=_e(/* @__PURE__ */new Set);en(()=>{Fo.forEach(e=>{const n=Jt(e.type)?.spec;if(!n)return;const t=e.props.id;if(Hr.current.has(t))return;Hr.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(Jo)).forEach((e,t)=>Xn.seedChild(o,t,n.childType,e))})},[Fo,Xn,Jo]);const Gr=_e(/* @__PURE__ */new Set);en(()=>{Fo.forEach((n,t)=>{const o=n.props.id;if(Gr.current.has(o))return;const r=e(n,Rr(n.type));Gr.current.add(o),r&&Xn.replaceComponent(N,t,{...n,props:r})})},[Fo,Xn]),te(Xn,Tn);const Ur=Fo.findIndex(Fn),Wr=Ur>=0?Fo[Ur]:null,Jr=Dn?Fo.findIndex(Vn):-1,Qr=Jr>=0?Fo[Jr]:null,Yr=Fo.find(e=>e.type===Rn)??null,Xr=Fo.find(e=>e.type===jn)??null,Zr=Ur>=0?Ur:Fo.length,_r=[];Fo.forEach(e=>{Fn(e)||(Lr(e)&&_r.push(String(e.props.id)),_r.push(...Er(e,1,Ir)))}),Wr&&(_r.push(String(Wr.props.id)),_r.push(...Er(Wr,1,Ir)));const qr=_r.length>0&&_r.every(e=>io.has(e)),Kr=e=>{const n=Yt.blockRowName(e,Wo);return Yt.rowName?Yt.rowName(e,"block",n):n},ei=(e,n,t,o)=>{const r=_o(e)[t];if(!r)return;const i={...Xe(e),index:t},l={...Xe(n),index:Math.min(Math.max(o,0),_o(n).length)},s=Le(i,l);if(e!==n||s!==t)try{Uo.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof Ze))throw e}},ni=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of jr(e))n.add(r),t(o)};for(const t of Rr(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},ti=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Xo.get(n);if(!e)return null;if(e.zone===N)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},oi=e=>{const n=e.slice(0,e.indexOf(":")),t=Fo.find(e=>Mn(e.type)&&String(e.props.id)===n);return t&&En(n)===e?t:null},ri=(e,n)=>{if(e.add)return li(e.add,n);const t=Ye(n);if(Mn(e.type))return!1;const o=oi(t),r=oi(e.zone);if(o||r)return!(!o||!r)&&(n.index>=0&&n.index<=_o(t).length);if(e.zone===N||t===N){if(e.zone!==t)return!1;const{floor:o,cap:r}=Do();return n.index>=o&&n.index<=r}if(n.index<0||n.index>_o(t).length)return!1;if(e.zone===t)return!0;const i=Wr?String(Wr.props.id):null;return(!i||ti(e.zone)!==i&&ti(t)!==i)&&((e,n,t)=>{if(e===n)return!0;const o=_o(e)[t];if(!o)return!1;const r=n.split(":")[0],i=Xo.get(r),l=i?_o(i.zone)[i.index]:void 0;if(!l)return!1;if(ni(o).has(n))return!1;const s=Jt(l.type,Ut(Cn?.data,l.type,r));return!!s&&(!!(s.choices?s.choices.some(e=>e.type===o.type):s.spec?.childType===o.type)&&!s.spec?.addBlocked?.(_o(n),o))})(e.zone,t,e.index)},ii=e=>{const n=e.slice(0,e.indexOf(":")),t=Xo.get(n),o=t?_o(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=Jt(o.type,Ut(Cn?.data,o.type,n));if(!r||`${n}:${r.slot}`!==e)return null;if("footer"===r.source)return null;return{parent:o,parentId:n,target:r,choices:r.choices??(r.spec?[{type:r.spec.childType,label:Wo(r.spec.childType)}]:[]),parentName:t.zone===N?Qo(o.type):Wo(o.type)}},li=(e,n)=>{const t=Ye(n);if("block"!==e.kind){if(oi(t))return n.index>=0&&n.index<=_o(t).length;if(t!==N)return!1;const{floor:e,cap:o}=Do();return n.index>=e&&n.index<=o}if(t===N)return!1;const o=ii(t);return!(!o||!o.choices.some(n=>n.type===e.type))&&!o.target.spec?.addBlocked?.(_o(t))},si=(e,n)=>{e.add?((e,n)=>{if("block"!==e.kind&&oi(Ye(n)))return void xr(e,Ye(n),n.index);if("section"===e.kind)return void kr(e.type,n.index);if("template"===e.kind)return void Sr(e.template.name,d(e.template.node),n.index);const t=Ye(n),o=ii(t);o&&(o.target.spec?Fr(o.parentId,o.target.slot,e.type,n.index,o.parent.type):Dr(t,e.type,n.index))})(e.add,n):e.zone===N?yr(e.index,n.index):ei(e.zone,Ye(n),e.index,n.index)},[di]=Ke(()=>Me()),ci=Ee({keyOf:e=>e.id,readOnly:Boolean(kn),session:di,canDrop:ri,onDrop:si,onStep:(e,n)=>{e.zone===N?((e,n)=>{const t=Qo(Fo[e]?.type??""),o=yr(e,n<0?e-1:e+2);if(!o.moved)return void wo(`“${t}” is already ${n<0?"first":"last"}`);const{floor:r,cap:i}=Do();wo(`Moved “${t}” to position ${o.dest-r+1} of ${i-r}`)})(e.index,n):ei(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),ai=nn(e=>{const{floor:n,cap:t}=Do(),o=[];for(const r of e.nodes){const e=Ye(r.place),i=_o(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(Vn(i)||Fn(i)||Ht(i.type))continue;if(Mn(i.type))continue;const l=Boolean(oi(e)),s=e===N||l;e===N&&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?Qo(i.type):er(i),from:r.place})}return{sources:o,zones:e.zones.filter(e=>e.children.length>0||Boolean(ii(Ye(e.list))?.choices.length)||Boolean(oi(Ye(e.list))))}},[Cn.data]),pi=(e,n,t,o)=>/* @__PURE__ */rn(ye,{...kn?{}:ci.seam({place:{...Xe(e),index:n}}),onAdd:kn?void 0:t,label:o},`seam:${e}:${n}`),ui={rowClick:zr,isCollapsed:fo,toggleCollapse:ho},fi=e=>{const n=String(e.props.id),t=Fo.findIndex(e=>String(e.props.id)===n),o=En(n),r=_o(o),i=fo(n),l=Wo(e.type),s=Yt.rowName?Yt.rowName(e,"section",l):l,d=e=>pi(o,e,()=>vr(o,e),Gn.addSectionHere);/* @__PURE__ */
|
|
15
|
-
return ln(sn,{children:[
|
|
16
|
-
/* @__PURE__ */rn(pe,{icon:/* @__PURE__ */rn(Zt,{type:e.type,size:13}),name:s,preview:Br(e),marks:Ar(e),onSelect:()=>hr(t),selected:Rt===n,actions:Pr(e,N,t)??void 0,rowProps:{"data-node-id":n,onClick:zr(()=>hr(t))},fold:{open:!i,label:"section",onToggle:()=>ho(n)}}),!i&&/* @__PURE__ */ln(ue,{children:[r.map((n,t)=>{const r=String(n.props.id),i=Yo(n),l=Lr(n),s=l&&fo(r),c=()=>Vr(o,t,r,e.type),{rowProps:a,...p}=ci.row({item:{id:r,zone:o,index:t,type:n.type},place:{...Xe(o),index:t}},{"data-node-id":r,onClick:zr(c)});/* @__PURE__ */
|
|
17
|
-
return ln(on,{children:[d(t),
|
|
18
|
-
/* @__PURE__ */rn(pe,{icon:/* @__PURE__ */rn(Zt,{type:n.type,size:13}),name:i,preview:Br(n),marks:Ar(n),onSelect:c,selected:Rt===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>ho(r)}:void 0,actions:/* @__PURE__ */ln(sn,{children:[Nr(o,t,i),Pr(n,o,t),Tr(o,t,n,i)]}),rowProps:a}),l&&!s&&/* @__PURE__ */rn(ue,{children:mi(n,2)})]},r)}),d(r.length)]})]})},hi=(e,n)=>{const t=jr(e),o=(e,n)=>pi(e,n),r=Jt(e.type),i=r?`${e.props.id}:${r.slot}`:null;/* @__PURE__ */
|
|
19
|
-
return ln(sn,{children:[t.map(({child:t,zone:r,index:i})=>{const l=Rt===String(t.props.id),{collapsible:s,folded:d}=Mr(t,n,Ir(t.type)),c=String(t.props.id),a=Kr(t),p=()=>Vr(r,i,c,e.type),{rowProps:u,...f}=ci.row({item:{id:c,zone:r,index:i,type:t.type},place:{...Xe(r),index:i}},{"data-node-id":c,onClick:zr(p)});/* @__PURE__ */
|
|
20
|
-
return ln(on,{children:[0===i&&o(r,0),
|
|
21
|
-
/* @__PURE__ */rn(pe,{icon:/* @__PURE__ */rn(Zt,{type:t.type,size:13}),name:a,preview:Br(t),marks:Ar(t),onSelect:p,selected:l,hidden:Boolean(t.props._hidden),...f,fold:s?{open:!d,label:"group",onToggle:()=>ho(c)}:void 0,actions:/* @__PURE__ */ln(sn,{children:[Nr(r,i,a),Pr(t,r,i),Tr(r,i,t,a)]}),rowProps:u}),s&&!d&&/* @__PURE__ */rn(ue,{children:hi(t,n+1)}),o(r,i+1)]},String(t.props.id??`${r}-${i}`))}),i&&!t.some(e=>e.zone===i)?o(i,0):null]})},mi=(e,n)=>{const t=jr(e),o=Jt(e.type,Ut(Cn?.data,e.type,String(e.props.id))),r=o?.spec??null,i=r&&Array.isArray(e.props[r.slot])?e.props[r.slot]:[],l=o&&o.choices?{slot:o.slot,choices:o.choices}:null,s=String(e.props.id),d=r&&!r.fixed?`${s}:${r.slot}`:null,c=l?`${s}:${l.slot}`:null,a=(n,t)=>{const o=n===d&&r&&!r.addBlocked?.(i)?()=>Fr(e.props.id,r.slot,r.childType,t,e.type):n===c?()=>vr(n,t):void 0;return pi(n,t,o,n===d&&r?r.addLabel:"Add block here")};/* @__PURE__ */
|
|
22
|
-
return ln(sn,{children:[t.map(({child:t,zone:o,index:r})=>{const i=Rt===String(t.props.id),l=er(t),s=String(t.props.id),{collapsible:d,folded:c}=Mr(t,n,Ir(t.type)),p=Rr(t.type),u=1===p.length?`${s}:${p[0]}`:null,f=u?{...Xe(u),index:_o(u).length}:void 0,h=ci.dragging,m=f&&h&&ri(h,f)?f:void 0,y=()=>Vr(o,r,s,e.type),{rowProps:g,...k}=ci.row({item:{id:s,zone:o,index:r,type:t.type},place:{...Xe(o),index:r},into:m,canDrag:!Ht(t.type)},{"data-node-id":s,onClick:zr(y)});/* @__PURE__ */
|
|
23
|
-
return ln(on,{children:[0===r&&a(o,0),
|
|
24
|
-
/* @__PURE__ */rn(pe,{icon:/* @__PURE__ */rn(Zt,{type:t.type,size:13}),name:l,preview:Br(t),marks:Ar(t),onSelect:y,nameSlot:tr(o,r,s,l),selected:i,hidden:Boolean(t.props._hidden),...k,fold:d?{open:!c,label:"group",onToggle:()=>ho(s)}:void 0,actions:Ht(t.type)?Pr(t,o,r)??void 0:/* @__PURE__ */ln(sn,{children:[Nr(o,r,l),Pr(t,o,r),Tr(o,r,t,l)]}),rowProps:g}),d&&!c&&/* @__PURE__ */rn(ue,{children:mi(t,n+1)}),a(o,r+1)]},String(t.props.id??`${o}-${r}`))}),r&&!r.fixed&&
|
|
25
|
-
/* @__PURE__ */rn(I,{small:!0,label:r.addLabel,blocked:r.addBlocked?.(i)??null,onAdd:()=>Fr(e.props.id,r.slot,r.childType,i.length,e.type)}),c&&!t.some(e=>e.zone===c)?a(c,0):null]})},yi=(()=>{if(!An||!$t)return null;const e=String(An.type),n=String(An.props.id),t=Jt(e,Ut(Cn?.data,e,n));if(!t||"footer"===t.source)return null;const o=Fo.some(e=>String(e.props?.id)===n),r=Array.isArray(An.props[t.slot])?An.props[t.slot]:[];if(t.spec?.addBlocked?.(r))return null;const i=t.choices??(t.spec?[{type:t.spec.childType,label:Wo(t.spec.childType)}]:[]);return 0===i.length?null:{parentName:o?Qo(e):Wo(e),choices:i,onPick:o=>{t.spec?Fr(n,t.slot,o,r.length,e):Dr(`${n}:${t.slot}`,o,r.length)}}})(),gi=bt||null!==st,ki=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:_n&&!gi&&Dt===e.id,onSelect:()=>Eo(e.id)}:e,Si=[{id:"add",label:"Add",icon:/* @__PURE__ */rn("span",{className:"sf-rail-plus","aria-hidden":"true",children:"+"}),active:bt,onSelect:()=>bt?wr():br(null)},...(Vt.railLead??[]).map(ki),{id:"sections",label:"Layers",icon:/* @__PURE__ */rn(De,{}),active:_n&&!gi&&"sections"===Dt,onSelect:()=>Eo("sections")},...(Vt.railTrail??[]).map(ki)];lt?Si.push({id:"media",label:"Media library",icon:/* @__PURE__ */rn(We,{}),active:_n&&!bt&&(null!==st||"media"===Dt),onSelect:()=>Eo("media")}):wn&&Si.push({id:"media",label:"Media library",icon:/* @__PURE__ */rn(We,{}),onSelect:Lo});const bi=[...Vt.railLead??[],...Vt.railTrail??[]].find(e=>"panel"in e&&e.id===Dt),vi=Boolean(Hn?.foldable)&&!Ft,wi=Hn?.label??(xn?Gn.pageSections:Gn.templateSections),xi=vi&&fo(an),zi=/* @__PURE__ */ln(sn,{children:[Fo.map((e,n)=>{if(Vn(e)||Fn(e)||Mn(e.type))return null;const t=Rt===String(e.props.id),o=Boolean(e.props._hidden);jr(e);const r=String(e.props.id),i=Vt.hasOwnRows?.(e)??!1,l=Lr(e)||i,s=l&&fo(r),{rowProps:d,...c}=ci.row({item:{id:r,zone:N,index:n,type:e.type},place:{...Xe(N),index:n}},{"data-node-id":r,onClick:zr(()=>hr(n))});/* @__PURE__ */
|
|
26
|
-
return ln(on,{children:[n>0&&Or(n),
|
|
27
|
-
/* @__PURE__ */rn(pe,{icon:/* @__PURE__ */rn(Zt,{type:e.type,size:13}),name:Yo(e),preview:Br(e),marks:Ar(e),onSelect:()=>hr(n),selected:t,hidden:o,...c,fold:l?{open:!s,label:"section",onToggle:()=>ho(r)}:void 0,actions:/* @__PURE__ */ln(sn,{children:[Nr(N,n,Yo(e)),Pr(e,N,n),Tr(N,n,e,Yo(e))]}),rowProps:d}),Lr(e)&&!s&&/* @__PURE__ */ln(ue,{children:[mi(e,1),Vt.partRows?.(e,ui)]}),i&&!s&&/* @__PURE__ */rn(ue,{children:Vt.ownRows?.(e,n,ui)})]},String(e.props.id??n))}),!Ft&&Zr>0&&Or(Zr),Hn?.addAtEnd&&!Ft&&!kn&&/* @__PURE__ */rn(I,{small:!0,label:Gn.addSection,blocked:null,onAdd:()=>br(Zr)})]}),Ci=(e,n,t)=>{const o=String(e.props.id),r=jr(e).length>0||Boolean(Jt(e.type)),i=r&&fo(o),l="header"===t?Gn.header:Gn.footer,s=Yt.rowName?Yt.rowName(e,"section",l):l;/* @__PURE__ */
|
|
28
|
-
return ln(sn,{children:[
|
|
29
|
-
/* @__PURE__ */rn(pe,{icon:/* @__PURE__ */rn(Zt,{type:t,size:13}),name:s,preview:Br(e),marks:Ar(e),onSelect:()=>hr(n),selected:Rt===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>ho(o)}:void 0,actions:Pr(e,N,n)??void 0,rowProps:{onClick:zr(()=>hr(n))}}),r&&!i&&/* @__PURE__ */rn(ue,{children:hi(e,1)})]})};return(Vt.wrap??(e=>e))(
|
|
30
|
-
/* @__PURE__ */ln("div",{ref:gt,className:"sf-editor es-editor",style:Te(so),onContextMenu:sr.onEditorContextMenu,children:[
|
|
31
|
-
/* @__PURE__ */ln(be,{children:[
|
|
32
|
-
/* @__PURE__ */rn(ve,{items:Si,ariaLabel:"Left panel views"}),
|
|
33
|
-
/* @__PURE__ */ln(we,{children:[
|
|
34
|
-
/* @__PURE__ */rn(xe,{label:"Undo",disabled:!Bn.hasPast,onClick:()=>Bn.back(),children:/* @__PURE__ */rn(He,{})}),
|
|
35
|
-
/* @__PURE__ */rn(xe,{label:"Redo",disabled:!Bn.hasFuture,onClick:()=>Bn.forward(),children:/* @__PURE__ */rn(Ge,{})}),
|
|
36
|
-
/* @__PURE__ */rn(ze,{}),
|
|
37
|
-
/* @__PURE__ */rn(Ce,{devices:Kn,value:ot,onChange:rt})]}),
|
|
38
|
-
/* @__PURE__ */ln(we,{kind:"right",style:{minWidth:300},children:[
|
|
39
|
-
/* @__PURE__ */rn(dn,{saveState:hn,notSaving:Boolean(kn)||null!=mn,readOnlyReason:Sn,toggle:bn,onToggle:gn,onRetry:yn}),Vt.barLead?.(),
|
|
40
|
-
/* @__PURE__ */rn("button",{type:"button",className:"es-btn-ghost",title:"Refresh the preview (reloads the canvas, keeps your place)",onClick:()=>{yt.current=(()=>{const e=kt?.document;if(!e)return null;const n=Fo.findIndex(Fn),t=n>=0?n:Fo.length;let o=null;for(let n=0;n<t;n++){const t=Fo[n]?.props?.id;if(null==t)continue;const r=e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`);if(!r)continue;const i=r.getBoundingClientRect().top;i<=4&&(null===o||i>o.offset)&&(o={id:String(t),offset:i})}if(!o){const e=An?.props?.id??Fo[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),mt(e=>e+1)},children:"Refresh"}),Vt.barTrail?.(),Vt.barMain?Vt.barMain():/* @__PURE__ */rn("button",{type:"button",className:"es-btn-primary",disabled:null!==Sn,onClick:()=>{fn(Cn.data)},children:vn?"Publish":"Save"})]})]}),
|
|
41
|
-
/* @__PURE__ */rn(R,{}),
|
|
42
|
-
/* @__PURE__ */ln("div",{className:"sf-body",children:[_n?/* @__PURE__ */ln(sn,{children:[
|
|
43
|
-
/* @__PURE__ */rn("div",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:bt?/* @__PURE__ */rn(V,{blocks:zt&&zt.zone!==N&&!oi(zt.zone)?ii(zt.zone):yi,blocksOnly:Boolean(zt&&zt.zone!==N&&!oi(zt.zone)),at:zt?{label:(e=>{const n=oi(e.zone);if(n)return`Adding to ${Wo(n.type)}`;if(e.zone===N){const n=Fo[e.index];return n&&!Fn(n)?`Adding before ${Qo(n.type)}`:"Adding at the end of the page"}const t=ii(e.zone);return t?`Adding to ${t.parentName}`:"Adding here"})(zt),onClear:()=>Ct(null)}:void 0,onAdd:e=>{if(zt&&"block"!==e.kind&&oi(zt.zone))return xr(e,zt.zone,zt.index),void Ct({zone:zt.zone,index:zt.index+1});if("section"===e.kind)return(e=>{if(null===Nt)return void kr(e);const n=kr(e,Nt);Bt(n+1)})(e.type);if("template"===e.kind)return((e,n)=>{if(null===Nt)return void Sr(e,n);const t=Sr(e,n,Nt);Bt(t+1)})(e.template.name,d(e.template.node));if(zt&&zt.zone!==N){const n=ii(zt.zone);if(!n)return;return n.target.spec?Fr(n.parentId,n.target.slot,e.type,zt.index,n.parent.type):Dr(zt.zone,e.type,zt.index),void Ct({zone:zt.zone,index:zt.index+1})}yi?.onPick(e.type)},itemFor:e=>({id:`new:${e.kind}:${"template"===e.kind?e.template.id:e.type}`,zone:"",index:-1,type:"template"===e.kind?e.template.node.type:e.type,add:e}),session:di,siteWide:Vt.addPanelRow?.(wr),onClose:wr,onHide:jo,readOnly:Boolean(kn)}):st&&it?
|
|
44
|
-
/* @__PURE__ */rn(H,{panel:it,pick:st,onHide:jo}):bi?bi.panel({onHide:jo,notify:wo}):"media"===Dt&&it?/* @__PURE__ */rn(H,{panel:it,pick:null,onHide:jo}):/* @__PURE__ */ln(sn,{children:[
|
|
45
|
-
/* @__PURE__ */rn(F,{icon:/* @__PURE__ */rn(De,{}),title:"Layers",context:Un,actions:_r.length>0?/* @__PURE__ */rn(Ne,{label:qr?"Expand all sections":"Collapse all sections",onClick:()=>lo(e=>{const n=new Set(_r);return qr?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,..._r])}),children:/* @__PURE__ */rn(cn,{expand:qr})}):void 0,onHide:jo}),
|
|
46
|
-
/* @__PURE__ */ln(fe,{className:"sf-tree sf-scroll",children:[
|
|
47
|
-
/* @__PURE__ */rn(pe,{icon:/* @__PURE__ */rn(Zt,{type:"page",size:13}),name:Gn.pageSettings,onSelect:Io,selected:!An&&$t,rowProps:{onClick:zr(Io)}}),Yr&&/* @__PURE__ */ln(sn,{children:[
|
|
48
|
-
/* @__PURE__ */rn(he,{children:Gn.header}),fi(Yr)]}),!Ft&&zn&&/* @__PURE__ */ln(sn,{children:[
|
|
49
|
-
/* @__PURE__ */rn(he,{children:Gn.header}),!Dn&&/* @__PURE__ */rn(pe,{icon:/* @__PURE__ */rn(Zt,{type:"header",size:13}),name:Gn.header,onSelect:Vo,selected:Tt.kind===In?.kind,rowProps:{onClick:zr(Vo)}})]}),!Ft&&Qr&&Ci(Qr,Jr,"header"),!Ft&&!vi&&/* @__PURE__ */rn(he,{children:wi}),vi?/* @__PURE__ */ln(sn,{children:[
|
|
50
|
-
/* @__PURE__ */rn(pe,{icon:null,name:wi,fold:{open:!xi,label:wi,onToggle:()=>ho(an)}}),!xi&&/* @__PURE__ */rn(ue,{children:zi})]}):zi,zn&&/* @__PURE__ */rn(he,{children:Gn.footer}),Wr&&Ci(Wr,Ur,"footer"),!Ft&&!Wr&&zn&&/* @__PURE__ */rn(pe,{icon:/* @__PURE__ */rn(Zt,{type:"footer",size:13}),name:Gn.footer,onSelect:Cr,rowProps:{onClick:zr(Cr),title:"Edit the site footer"}}),Xr&&fi(Xr),Vt.treeFoot?.()]})]})}),
|
|
51
|
-
/* @__PURE__ */rn(Be,{side:"left",width:so.left,min:Pe,max:Ae,defaultWidth:S.left,label:"Resize Sections panel",onResize:po})]}):/* @__PURE__ */rn(D,{side:"left",onShow:jo}),
|
|
52
|
-
/* @__PURE__ */rn("div",{ref:xo,className:"sf-center sf-scroll",style:{overflowX:Oo?"auto":"hidden",overflowY:"hidden"},children:/* @__PURE__ */rn("div",{className:"sf-frame-scaler",style:$o,children:/* @__PURE__ */rn("div",{className:"sf-frame "+(ot===tt?"":`sf-frame--${ot}`),style:Ro,children:/* @__PURE__ */ln("div",{className:"sf-preview-host",children:[
|
|
53
|
-
/* @__PURE__ */rn(Wn,{},ht),
|
|
54
|
-
/* @__PURE__ */rn(je,{canvas:kt,session:di,model:ai,canDrop:ri,onDrop:si,onPick:e=>{Ot(_),Xn.select(e.zone===N?{index:e.index}:{index:e.index,zone:e.zone})},onZoneAdd:e=>vr(Ye(e),0),readOnly:Boolean(kn),revision:Cn.data}),At.length>0&&/* @__PURE__ */rn("div",{className:"sf-preview-gaps","aria-hidden":"true",children:At.map(e=>/* @__PURE__ */ln("button",{type:"button",tabIndex:-1,className:"sf-preview-gap",style:{top:e.top},title:"Add section here",onClick:()=>br(e.index),children:[
|
|
55
|
-
/* @__PURE__ */rn("span",{className:"sf-preview-gap-line"}),
|
|
56
|
-
/* @__PURE__ */ln("span",{className:"sf-preview-gap-pill",children:[
|
|
57
|
-
/* @__PURE__ */rn("span",{className:"sf-preview-gap-plus",children:"+"}),
|
|
58
|
-
/* @__PURE__ */rn("span",{className:"sf-preview-gap-label",children:"Add section"})]})]},e.index))})]})})})}),qn?/* @__PURE__ */ln(sn,{children:[
|
|
59
|
-
/* @__PURE__ */rn(g,{value:{selectChild:Vr,addChild:Fr,childRowName:er,blockRowName:Kr},children:/* @__PURE__ */rn(Jn,{mode:Tt,onOpenWebsiteSettings:Vt.openSettings??(()=>{}),onOpenSiteStyles:Vt.openStyles,onSelectNode:eo,onNotify:wo,onHidePanel:Mo,nodeActions:An?B(Tn,An.type):pn})}),
|
|
60
|
-
/* @__PURE__ */rn(Be,{side:"right",width:so.right,min:Pe,max:Ae,defaultWidth:S.right,label:"Resize settings panel",onResize:uo})]}):
|
|
61
|
-
/* @__PURE__ */rn(D,{side:"right",onShow:Mo})]}),go&&/* @__PURE__ */ln("div",{className:"sf-toast "+("error"===go.tone?"sf-toast--error":""),role:"status",children:[
|
|
62
|
-
/* @__PURE__ */rn("span",{className:"sf-toast-check","aria-hidden":"true",children:"error"===go.tone?"!":"✓"}),go.msg]},So),sr.menu]}))}export{un as ScreenChrome};
|
package/dist/chunk-7755VWRT.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{usePickFollowsSelection as n}from"./chunk-Z6BAZFSW.js";import{EaselCanvas as e,useSelectedFields as t}from"./chunk-P67FP7PG.js";import{Inspector as r}from"./chunk-BXZ6WLHC.js";import{DesktopIcon as i}from"./chunk-L5KW4HG5.js";import{createContext as o,useContext as u}from"react";import{jsx as l}from"react/jsx-runtime";var s={kind:"puck"};function c(n,e){const t=n,r=e,i=Object.keys(t);return i.length===Object.keys(r).length&&i.every(n=>Object.is(t[n],r[n]))}function a(n,e){return n.isFirst?n.isFirst(e):e.type===n.first}function f(n,e){return n.isLast?n.isLast(e):e.type===n.last}var d={},p=()=>d,k=()=>"",m=()=>null,h=()=>{},v={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},b={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},g={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */l(i,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},y={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},L={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function j(){/* @__PURE__ */
|
|
2
|
-
return l(e,{height:"fill"})}function w(){const{id:n,fields:e,values:i,readOnly:o,onChange:u}=t();/* @__PURE__ */
|
|
3
|
-
return l("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */l(r,{fields:e,values:i,onChange:u,readOnly:o,idPrefix:n})})}var O=o({});function S({parts:n,children:e}){/* @__PURE__ */
|
|
4
|
-
return l(O.Provider,{value:n,children:e})}function P(){return u(O)}function B(){return(P().useOwnerName??k)()}function G(){return(P().useDocumentLabel??m)()}function F(n,e,t,r){return(P().useBridges??p)(n,e,t,r)}function x(n){return(P().useStandaloneBridges??p)(n)}function C(n,e){(P().useDocumentPass??h)(n,e)}function D(){return P().blockRules??v}function N(){return P().blockLook??b}function Z(){return P().devices??g}function A(){return P().leftView??y}function I(){return P().pinned??L}function T(){return P().saveSwitch??!0}function W(e){n(!0===P().pickFollowsSelection,e)}function H(){return P().Canvas??j}function R(){return P().Inspector??w}export{s as SELECTION_MODE,S as ScreenPartsProvider,a as isPinnedFirst,f as isPinnedLast,c as sameInspectorMode,N as useScreenBlockLook,D as useScreenBlockRules,F as useScreenBridges,H as useScreenCanvasFrame,Z as useScreenDevices,G as useScreenDocumentLabel,C as useScreenDocumentPass,R as useScreenInspectorPanel,A as useScreenLeftView,B as useScreenOwnerName,P as useScreenParts,W as useScreenPickFollowsSelection,I as useScreenPinned,T as useScreenSaveSwitch,x as useStandaloneScreenBridges};
|
package/dist/chunk-7GVLSNFW.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function n(n,t){const e=n.components?.[t]?.fields??{};return Object.keys(e).filter(n=>"slot"===e[n]?.type)}function t(n,t){const e=n.components?.[t]?.permissions;return{duplicate:!1!==e?.duplicate,delete:!1!==e?.delete}}function e(t,e){return n(t,e.type).flatMap(n=>(Array.isArray(e.props[n])?e.props[n]:[]).map((t,r)=>({child:t,zone:`${e.props.id}:${n}`,index:r})))}function r(n,t,r){const o=(t,i,u,p)=>{if(!t||"object"!=typeof t||!t.props)return null;if(t.props.id===r)return{item:t,zone:i,index:u};if(p>=12)return null;for(const{child:r,zone:i,index:u}of e(n,t)){const n=o(r,i,u,p+1);if(n)return n}return null};for(let n=0;n<t.length;n+=1){const e=o(t[n],c,n,0);if(e)return e}return null}var o=6;function i(t,e,r){return r<6&&n(t,e).length>0}var u=n=>`${n}-${crypto.randomUUID()}`,p="Header",s="Footer",c="root:default-zone",f=[p,s];function l(n){const t=/* @__PURE__ */new Set,e=[];return n.forEach((n,r)=>{const o=n?.type;void 0!==o&&f.includes(o)&&(t.has(o)?e.push(r):t.add(o))}),e}function d(n){return l(n).map(t=>n[t]?.props?.id).filter(n=>"string"==typeof n)}function a(n,t){const e=(n,t)=>n.some(n=>n?.type===t);return f.filter(r=>!e(n,r)&&!e(t,r))}export{s as FOOTER_TYPE,p as HEADER_TYPE,c as ROOT_ZONE,o as TREE_MAX_DEPTH,t as blockNodeActions,e as childSlotsOf,r as locateNode,a as missingPinnedTypes,i as nestsInTree,u as newNodeId,d as pinnedDuplicateIds,l as pinnedDuplicateIndices,n as slotFieldsOf};
|
package/dist/chunk-A2LFBOUF.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{newNodeId as e,ROOT_ZONE as t}from"./chunk-7GVLSNFW.js";import{useScreenBlockRules as n}from"./chunk-7755VWRT.js";import{useEasel as o,useEaselApi as r}from"./chunk-P67FP7PG.js";import{useMemo as s}from"react";function i(i={}){const{dispatch:p}=o(e=>e),d=r(),c=!0===i.readOnly,a=n().resolveOnInsert,m=!0===(i.resolveOnInsert??a);return s(()=>{const n=(t,n,o)=>{const r=e(n);return c||p({type:"insert",componentType:n,destinationZone:t,destinationIndex:o,id:r}),r},o=e=>(m&&!c&&d.resolveNode(e,{trigger:"insert"}),e),r=(e,t,n)=>{c||p({type:"replace",destinationZone:e,destinationIndex:t,data:n})},s=(e,t,r)=>o(n(e,t,r));return{insertComponent:s,insertSection:(e,n)=>s(t,e,n),replaceComponent:r,seedChild:(e,t,s,i)=>{const p=n(e,s,t);r(e,t,{type:s,props:{id:p,...i}}),o(p)},insertNode:(e,t,s)=>{const i=n(e,s.type,t);return r(e,t,{type:s.type,props:{...s.props,id:i}}),o(i)},removeComponent:(e,t)=>{c||p({type:"remove",index:t,zone:e})},reorderComponent:(e,t,n)=>{c||p({type:"reorder",sourceIndex:t,destinationIndex:n,destinationZone:e})},duplicateComponent:(e,t)=>{c||p({type:"duplicate",sourceIndex:t,sourceZone:e})},select:e=>p({type:"setUi",ui:{itemSelector:e}}),setDocument:e=>{c||p({type:"setData",data:e})},commitDocument:e=>{c||p({type:"setData",data:()=>e,recordHistory:!0})}}},[p,c,m,d])}export{i as useSectionOps};
|
package/dist/chunk-D6324C3E.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{blockTypesIn as e}from"./chunk-5ZBY24K7.js";import{buildPaletteSections as t,pinnedSection as o,paletteWithoutPinned as n,categoryLabel as r}from"./chunk-GENAF3P6.js";import{sectionTemplatesOf as s}from"./chunk-BVN33R76.js";import{SidePanelHead as i,PanelModeExit as c}from"./chunk-IWAPPEL4.js";import{useEaselSession as l}from"./chunk-O7Q4DDJT.js";import{blockRuns as a}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as p,useScreenBlockRules as d}from"./chunk-7755VWRT.js";import{useEasel as m}from"./chunk-P67FP7PG.js";import{AddPanel as u}from"./chunk-TTJ54QGG.js";import{AddIcon as f}from"./chunk-L5KW4HG5.js";import{useState as h,useEffect as k,useMemo as y}from"react";import{jsx as b,jsxs as g,Fragment as j}from"react/jsx-runtime";var $=e=>`section:${e}`,A=e=>`block:${e}`,v=e=>`template:${e}`;function O({blocks:O,blocksOnly:I,at:L,onAdd:P,itemFor:D,session:G,siteWide:S,onClose:T,onHide:x,readOnly:B}){const C=m(e=>e.config),F=p(),{labelAtLevel:H,categoryLabel:N,firstSection:V,Icon:W,Thumbnail:E}=F,{blockIsOffered:Q}=d(),R=l(),[w,z]=h([]);k(()=>{let t=!1;const o=e=>Q(e,R);return s(R).list().then(n=>{if(t)return;const r=C.components;z(n.filter(t=>t.node?.type&&r[t.node.type]&&e(t.node).every(o)))}).catch(()=>{}),()=>{t=!0}},[C,R]);const J=y(()=>t(C,F),[C]),K=e=>({type:$(e.type),label:e.name,cover:/* @__PURE__ */b(E,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:`Add ${e.name}`,keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),Y=y(()=>{const e=[];if(O&&O.choices.length>0&&a(O.choices).forEach((t,o)=>{e.push({title:0===o?`Inside ${O.parentName}${t.group?` · ${t.group}`:""}`:t.group??"",tiles:t.items.map(e=>({type:A(e.type),label:e.label,icon:/* @__PURE__ */b(W,{type:e.type,size:18}),title:`Add ${e.label}`}))})}),I)return e;const t=o(J,V);t&&e.push({title:"Start blank",tiles:[K(t)]}),w.length>0&&e.push({title:"Your templates",tiles:w.map(e=>{return{type:v(e.id),label:e.name,cover:/* @__PURE__ */b(E,{type:e.node.type}),keywords:[(t=e.node.type,H(t,"section",C.components[t]?.label??t)),e.node.type]};var t})});const s=n(J,V);for(const t of Object.keys(C.categories??{})){const o=s.filter(e=>e.cat===t);0!==o.length&&e.push({title:r(C,t,N),tiles:o.map(K)})}return e},[O,I,w,J,C]),Z=e=>{const t=e.indexOf(":"),o=e.slice(0,t),n=e.slice(t+1);if("section"===o)return{kind:"section",type:n};if("block"===o)return{kind:"block",type:n};if("template"===o){const e=w.find(e=>e.id===n);return e?{kind:"template",template:e}:null}return null};/* @__PURE__ */
|
|
2
|
-
return g(j,{children:[
|
|
3
|
-
/* @__PURE__ */b(i,{icon:/* @__PURE__ */b(f,{size:15}),title:"Add",context:I?"Blocks for this place":"Sections and blocks",actions:/* @__PURE__ */b(c,{label:"Done",description:"Close Add and go back",onClick:T}),onHide:x}),
|
|
4
|
-
/* @__PURE__ */g("div",{className:"sf-addside sf-scroll",children:[
|
|
5
|
-
/* @__PURE__ */b(u,{groups:Y,session:G,itemFor:e=>D(Z(e)??{kind:"section",type:e}),onInsert:e=>{const t=Z(e);t&&P(t)},at:L,hint:I?"Drag into the page, or click to add.":"Drag onto the page, or click to add.",searchLabel:I?"Search blocks":"Search sections",readOnly:B}),S&&!I?S:null]})]})}export{O as AddSidePanel,A as blockKey,$ as sectionKey,v as templateKey};
|
package/dist/chunk-GENAF3P6.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e,n){const o=e.categories??{},c=e.components,r=[];for(const[s,i]of Object.entries(o))for(const o of i?.components??[]){const i=c[o];if(!i)continue;const a=i.label??o,l=n.labelAtLevel(o,"section",a);r.push({type:o,cat:s,catLabel:t(e,s,n.categoryLabel),name:l,desc:n.descriptions[o]??"",...l===a?{}:{alias:a}})}return r}function t(e,t,n){return n(t)??e.categories?.[t]?.title??t}function n(e,t){return!t||`${e.name} ${e.alias??""} ${e.desc} ${e.type} ${e.catLabel}`.toLowerCase().includes(t)}function o(e,t){return e.find(e=>e.type===t)??null}function c(e,t){return e.filter(e=>e.type!==t)}export{e as buildPaletteSections,t as categoryLabel,n as matchesQuery,c as paletteWithoutPinned,o as pinnedSection};
|
package/dist/chunk-HMWJB3HF.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ROOT_ZONE as e}from"./chunk-7GVLSNFW.js";import{styleMenuItems as n}from"./chunk-57DJOKXT.js";import{useEaselSession as t}from"./chunk-O7Q4DDJT.js";import{EaselContextMenu as o}from"./chunk-KTVH2ZRL.js";import{createNodeClipboard as i,nodeMenuItems as l}from"./chunk-2LK54I4E.js";import{useCanvasEvent as c}from"./chunk-PAELDYYS.js";import{framePointToHost as r}from"./chunk-ZNCEOSXO.js";import{UndoIcon as s,RedoIcon as a,AddIcon as d,PasteIcon as p,SettingsIcon as u,LayersIcon as f,CopyIcon as m}from"./chunk-L5KW4HG5.js";import{zoneKey as h,ROOT_SLOT as k,ROOT_ID as y}from"./chunk-KRXQM65X.js";import{useState as b,useCallback as v}from"react";import{jsx as x}from"react/jsx-runtime";function C(n,t){const o=[],i=/* @__PURE__ */new Set;let l={zone:t.zone,index:t.index};for(;l;){const t=n.nodeAt(l.zone,l.index);if(!t||i.has(t.props.id))break;if(i.add(t.props.id),o.push({zone:l.zone,index:l.index,node:t,parentType:null}),l.zone===e)break;const c=l.zone.lastIndexOf(":");if(c<=0)break;l=n.locate(l.zone.slice(0,c))}for(let e=0;e<o.length-1;e+=1)o[e].parentType=o[e+1].node.type;return o}var g=i(),P=/* @__PURE__ */new WeakMap;function A(e){if(e.claimsPage)return g;const n=e.registry;if(!n)return e.cache("easel:node-clipboard",i);let t=P.get(n);return t||(t=i(),P.set(n,t)),t}function O(){return A(t())}function T(n,t,o){if(t===e){const{floor:e,cap:t}=n.sectionBand();return{parentId:y,slot:k,index:Math.min(Math.max(o,e),t)}}const i=t.lastIndexOf(":");return{parentId:t.slice(0,i),slot:t.slice(i+1),index:o}}function w(e,t){const{zone:o,index:i}=t,c=e.nodeAt(o,i);if(!c)return[];const r=c.props.id,s=e.labelOf(c.type,o),a=Boolean(c.props._hidden),d=e.nodeOps,p=e.isPinned(c,o),u=e.isLocked(c),f=!p&&!u&&!e.duplicateBlocked(c),m=e.permits?.(c)??{duplicate:!0,delete:!0},k=C(e,t),y=d.held,b=y&&!p&&h(y.from)===o?T(e,o,i+1):null,v=e.style?n({held:e.style.held(),canCopy:e.style.canCopy(c,o),onCopy:()=>e.style?.copy(c,o),onPaste:()=>e.style?.paste(o,i,c)}):[];return l({title:s,layer:{group:"pick",items:k.map((n,t)=>({label:e.rowNameOf(n.node,n.zone),checked:0===t,onClick:()=>e.selectAt(n.zone,n.index,n.node.props.id,n.parentType)}))},actions:{addInside:e.canAddTo(c.type)?()=>e.openAddInside(o,i):void 0,duplicate:f&&m.duplicate?()=>d.duplicate(r):void 0,moveUp:d.canStep(r,-1)?()=>d.step(r,-1):void 0,moveDown:d.canStep(r,1)?()=>d.step(r,1):void 0,copy:!p&&m.duplicate?()=>d.copy(r,s):void 0,cut:f&&m.duplicate&&m.delete?()=>d.cut(r,s):void 0,paste:y&&b?{label:y.label,run:()=>d.paste(b)}:void 0,rename:e.renamePropOf(c,o)?()=>e.beginRename(o,i):void 0,hide:u||p?void 0:{hidden:a,run:()=>d.setProps(r,{_hidden:!a})},delete:f&&m.delete?()=>d.remove(r):void 0},style:v,pinnedLine:p?"Pinned — can’t be moved or deleted":void 0})}function z(n){const t=[];n.history.hasPast&&t.push({label:"Undo",icon:/* @__PURE__ */x(s,{}),shortcut:"⌘Z",onClick:n.history.back}),n.history.hasFuture&&t.push({label:"Redo",icon:/* @__PURE__ */x(a,{}),shortcut:"⇧⌘Z",onClick:n.history.forward});const o=[{label:"Add section",icon:/* @__PURE__ */x(d,{}),onClick:n.openAddSection}],i=n.nodeOps.held;if(i&&h(i.from)===e){const t=T(n,e,n.sectionBand().cap);o.push({label:`Paste ${i.label}`,icon:/* @__PURE__ */x(p,{}),shortcut:"⌘V",onClick:()=>n.nodeOps.paste(t)})}const l=[t,o,[{label:"Page settings",icon:/* @__PURE__ */x(u,{}),onClick:n.openPageSettings},{label:"Collapse all layers",icon:/* @__PURE__ */x(f,{}),onClick:n.collapseAll}]].filter(e=>e.length>0),c={label:"—",onClick:()=>{}};return l.flatMap((e,n)=>n?[c,...e]:e)}function j(e,n){const t=n.selectionStart??0,o=n.selectionEnd??0,i=n.value.slice(t,o),l=e=>{n.focus(),n.setRangeText(e,t,o,"end"),n.dispatchEvent(new Event("input",{bubbles:!0}))},c=[];i&&(c.push({label:"Copy",icon:/* @__PURE__ */x(m,{}),shortcut:"⌘C",onClick:()=>navigator.clipboard?.writeText(i)}),c.push({label:"Cut",icon:/* @__PURE__ */x(m,{}),shortcut:"⌘X",onClick:()=>{navigator.clipboard?.writeText(i),l("")}})),c.push({label:"Paste",icon:/* @__PURE__ */x(p,{}),shortcut:"⌘V",onClick:()=>{navigator.clipboard?.readText().then(e=>{e&&l(e)}).catch(()=>e.onPasteRefused())}});const r=[c,n.value?[{label:"Select all",shortcut:"⌘A",onClick:()=>{n.focus(),n.select()}}]:[]].filter(e=>e.length>0),s={label:"—",onClick:()=>{}};return r.flatMap((e,n)=>n?[s,...e]:e)}function M(e){return e.shiftKey}function S(e,n){const[t,i]=b(null),l=v(()=>i(null),[]),s=v(n=>{if(M(n))return;const t=n.target,o=function(e){const n=e?.closest?.("input, textarea");return n?n instanceof HTMLInputElement&&!["text","search","url","email","tel","number",""].includes(n.type)?null:n:null}(t);if(o)return n.preventDefault(),void i({kind:"input",x:n.clientX,y:n.clientY,el:o});const l=t?.closest?.("[data-node-id]")?.getAttribute("data-node-id"),c=l?e.locate(l):null;n.preventDefault(),i(c?{kind:"node",x:n.clientX,y:n.clientY,...c}:{kind:"empty",x:n.clientX,y:n.clientY})},[e]);c(n,"contextmenu",t=>{if(M(t)||!n)return;const o=t.target?.closest?.("[data-puck-component]")??null,l=o?.getAttribute("data-puck-component"),c=l?e.locate(l):null;t.preventDefault();const s=r(n.frame,t.clientX,t.clientY);i(c?{kind:"node",...s,...c}:{kind:"empty",...s})}),c(n,"mousedown",l),c(n,"scroll",l,{on:"window"});return{onEditorContextMenu:s,menu:t?/* @__PURE__ */x(o,{x:t.x,y:t.y,items:"node"===t.kind?w(e,t):"input"===t.kind?j(e,t.el):z(e),onClose:l}):null,closeMenu:l}}export{g as EASEL_NODE_CLIPBOARD,C as ancestorChain,A as nodeClipboardOf,w as nodeMenuItems,z as pageMenuItems,j as textMenuItems,O as useNodeClipboard,S as useNodeContextMenu};
|
package/dist/chunk-JUQ6YJCG.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{DEFAULT_LOCK_WORDS as e}from"./chunk-RE4LP46F.js";var n=e=>"editing"===e.kind;function t(e){return e?{kind:"checking"}:{kind:"editing"}}var r=e=>"blocked"===e.kind||"readonly"===e.kind||"takenover"===e.kind?e.holder:null;function o(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 s(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 o=Math.round(r/60);return t.hoursAgo({count:o})}var c=(n,t=e)=>n.trim()||t.someone;function d(){return`tab-${"undefined"!=typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():Math.random().toString(36).slice(2)}`.slice(0,64)}var i="edit_lock_taken";function u(e,t,r){return!(n(e)||!n(t))&&(r.pending&&r.autoSaveEnabled&&!r.saveConflict)}function l(e,t,o){return!(null===r(e)||!n(t))&&(!o.pending&&!o.saveConflict)}function f(e,n){return e!==n&&Date.parse(e)>=Date.parse(n)}async function k(e){if(!e.ours)return!1;const n=await e.stored().catch(()=>null);return!(!n||!f(n,e.ours)||e.hasPending())&&(e.reload(),!0)}function h(e){const{readFailure:n,conflictCode:t}=e,r=e=>{const t=n(e);return t&&409===t.status?o(t.data):null},a=e=>{const n=r(e);return n?{kind:"blocked",holder:n}:{kind:"editing"}},s=(e,n)=>{const t=r(e);return t?{kind:"blocked",holder:t}:n},c=(e,n)=>{const t=r(e);return t?{kind:"takenover",holder:t}:n},d=e=>{const t=n(e);return null!==t&&(401===t.status||403===t.status)};return{accessAfterClaimFailure:a,accessAfterTakeoverFailure:s,accessAfterHeartbeatFailure:c,isAuthRejection:d,readSaveConflict:e=>{const r=n(e);if(!r||409!==r.status)return null;if(!r.data||"object"!=typeof r.data)return null;const o=r.data;return o.code!==t?null:{savedBy:"string"==typeof o.saved_by?o.saved_by:"",savedByYou:!0===o.saved_by_you,secondsAgo:"number"==typeof o.seconds_ago?o.seconds_ago:0}},readLockTaken:e=>{const t=n(e);return t&&409===t.status&&t.data&&"object"==typeof t.data?t.data.code!==i?null:o(t.data)??{name:"",secondsSinceSeen:0,secondsSinceHeld:0}:null},makeClaimBeat:e=>{let n=!1;return async t=>{let r,o;try{const a=await e.claim(t);if(e.cancelled())return;r=e.currentAccess(),o={kind:"editing"},!n&&a.heartbeat_seconds>0&&(n=!0,e.startHeartbeat(1e3*a.heartbeat_seconds))}catch(n){if(e.cancelled())return;r=e.currentAccess(),o=t?s(n,r):"checking"===r.kind?a(n):c(n,r),d(n)&&e.stopHeartbeat()}e.setAccess(o);const i=e.heldWrite();u(r,o,i)?e.releaseHeldWrite():t&&l(r,o,i)&&e.reloadIfMoved?.()}}}}export{i as EDIT_LOCK_TAKEN,t as accessForNewDocument,n as canWriteDocument,h as createEditLock,s as describeAge,a as documentPermissions,f as documentVersionMoved,r as holderOf,c as nameOrSomeone,d as newEaselClientId,o as readLockHolder,k as reloadIfVersionMoved,u as shouldReleaseHeldWrite,l as shouldReloadAfterTakeover};
|
package/dist/chunk-LEGAPYPC.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={loading:"Loading…",waitingForAuthorization:"Waiting for editor authorization…",missingTemplatePage:"Couldn’t open a page in this template.",missingPage:({slug:e})=>`No storefront page with slug "${e}".`,missingDocument:"Couldn’t open this document.",loadFailed:({cause:e})=>`Could not load the document — ${e}`,noun:"page",pageSettings:"Page settings",header:"Header",footer:"Footer",pageSections:"Template · Home page",templateSections:"Template · Template",addSection:"Add section",addSectionBefore:({name:e})=>`Add section before ${e}`,addSectionHere:"Add section here"};export{e as DEFAULT_SCREEN_WORDS};
|
package/dist/chunk-LRTIMWZG.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{routeSharedHostMessage as e}from"./chunk-QDEZQ5A6.js";import{describeLoadFailure as r,hostLoadRefusal as n}from"./chunk-ERR437B5.js";import{editLockOf as t}from"./chunk-ZOJEFIP4.js";import{NO_DOCUMENT_ADDRESSING as o}from"./chunk-RLBXE4EU.js";import{saveStatusOf as u,resetForDocumentSwitch as a}from"./chunk-OYX47SL7.js";import{isExpiredSession as s}from"./chunk-4EUWOGZF.js";import{useAdminBridge as i}from"./chunk-KVNRNDUC.js";import{useEaselSession as c}from"./chunk-O7Q4DDJT.js";import{backendOf as l,setSessionDocumentSite as d}from"./chunk-RSCMJIWS.js";import{useEaselHost as f}from"./chunk-R5ZVNJLJ.js";import{DEFAULT_SCREEN_WORDS as g}from"./chunk-LEGAPYPC.js";import{useAutosave as k}from"./chunk-BDTITTMW.js";import{canWriteDocument as m,newEaselClientId as v,reloadIfVersionMoved as p,holderOf as h}from"./chunk-JUQ6YJCG.js";import{useWords as y}from"./chunk-MFIRYGHW.js";import{createContext as w,useContext as S,useState as b,useMemo as I,useCallback as P,useEffect as j,useRef as E}from"react";import{jsx as R}from"react/jsx-runtime";var C={content:[],root:{},zones:{}};var O=w(null);function B(){const e=S(O);if(!e)throw new Error("useStorefrontDocument must be used within StorefrontDocumentProvider");return e}function D({target:w,addressing:S=o,onHostMessage:B,children:D}){const A=S,{homeSlug:L,entryMayBounce:T,entryBounce:F,onSwitch:H,tellsHost:M,adapterFor:N,migrateRenamedProps:J,describeMissing:V,onLoadFailed:W}=A,[U,Y]=b(w),G=f(),Q=c(),Z=I(()=>l(Q),[Q]),x=I(()=>t(Q),[Q]),K="template"===U.kind,X="template"===U.kind?U.id:null,z="template"===U.kind?U.pageSlug??L??"":"document"===U.kind?U.slug??"":U.slug,_="page"===U.kind?U.siteId??null:null,q=Q.blocks,$=I(()=>N(U,Z,q),[N,Z,q,U.kind,"template"===U.kind?U.id:"document"===U.kind?U.record:U.siteId]),ee=$.capabilities,re=P(e=>Q.documentHooks?.stored?.(e)??e,[Q]),ne="page"===U.kind?U.originSlug??null:null;j(()=>{d(Q,_)},[Q,_]);const te=E(U);j(()=>{te.current=U},[U]);const{token:oe,tokenRef:ue,capabilities:ae}=i({onMessage:r=>{if(B?.(r)||e(r))return;const n=r;if("storefront-editor:navigate"===n?.type){const e=r;e?.target&&Sr(e.target)}}}),se=!Q.usesBridgedToken||null!==oe,ie=$.lock,ce=Boolean(Z.lock),[le,de]=b(null),[fe,ge]=b(null),[ke,me]=b(null),[ve,pe]=b(null),he=y("screen",g),ye=ve?function(e,r){if(null!==e.sentence)return e.sentence;if(!e.missing)return r.loadFailed({cause:e.cause});switch(e.target.kind){case"template":return r.missingTemplatePage;case"document":return r.missingDocument;default:return r.missingPage({slug:e.slug})}}(ve,he):null,[we,Se]=b(null),be=E(null),Ie=E(null),[Pe,je]=b(!1),Ee=E(null),[Re,Ce]=b(null),Oe=E(null),[Be,De]=b(null),Ae=E(null);j(()=>{Ae.current=Be},[Be]);const[Le,Te]=b(ee.hasEditLock?{kind:"checking"}:{kind:"editing"}),Fe=E(Le);j(()=>{Fe.current=Le},[Le]);const He=E(()=>Promise.resolve(!1)),Me=P(e=>{Ie.current=e,je(!0)},[]),Ne=k({save:async({id:e,data:r})=>{if(m(Fe.current)){if(!await He.current(e,r)){if(!m(Fe.current))return void Me({id:e,data:r});throw new Error("page save did not land")}}else Me({id:e,data:r})},onFailure:(e,r)=>{0===r&&G.send("storefront-editor:save-failed")}}),{state:Je,push:Ve,flush:We,pause:Ue,resume:Ye,stop:Ge,reset:Qe,retryNow:Ze,hasPending:xe}=Ne,Ke=E(Je);j(()=>{Ke.current=Je},[Je]);const Xe=u(Je),ze=P(()=>{const e=Ie.current;e&&(Ie.current=null,je(!1),Ve(e))},[Ve]),_e=E("");_e.current||(_e.current=v());const[qe,$e]=b(0),er=E(!1),[rr,nr]=b(T(w)),tr=E(!1);j(()=>{if(tr.current)return;tr.current=!0;const e=G.address.search(),r=F(w,e);r?G.address.load(r):T(w)&&nr(!1)},[w,G]);const or=G.send;j(()=>{if(!se)return;let e=!1;const t=te.current,o=$.resolve(z),u=Q.documentHooks?.opening?.({slug:z,isTemplate:K,capabilities:ee});return o.then(async r=>{if(e)return;if(!r)return"page"===t.kind&&null!==L&&z!==L?void G.address.load({kind:"page",slug:L,siteId:_??void 0}):(pe({target:t,slug:z,missing:!0,sentence:V?.(t)??null}),void W?.(t,null));const n=r.readOnlyReason?r.readOnlyReason:null;be.current=n,Se(n),de(r.id),ge(r.kind??null),Oe.current=r.version??null;const o=r.layout,a=o&&Object.keys(o).length?o:C,s=J(a),i=u?await u(s):s;e||me(i)}).catch(o=>{e||(console.error("[storefront-editor] document load failed",o),pe({target:t,slug:z,missing:!1,sentence:n(o,{slug:z},Q),cause:r(o,Q)}),W?.(t,o))}),()=>{e=!0}},[se,oe,K,$,z]);const ur=P(e=>new Promise(r=>{const n=Date.now(),t=setInterval(()=>{const o=ue.current;o&&o!==e?(clearInterval(t),r(o)):Date.now()-n>6e3&&(clearInterval(t),r(null))},200)}),[]),ar=P(async e=>{const r=ue.current;if(!r&&Q.usesBridgedToken)return{ok:!1,error:new Error("no editor token")};try{return{ok:!0,value:await e(r??"")}}catch(n){if(s(n,Q)){or("storefront-editor:auth-expired");const n=r?await ur(r):null;if(n)try{return{ok:!0,value:await e(n)}}catch(e){return{ok:!1,error:e}}}return{ok:!1,error:n}}},[or,ur,Q]),sr=P(async e=>{const r=ue.current?await ar(e):{ok:!1};return r.ok||or("storefront-editor:save-failed"),r.ok},[or,ar]),ir=P(async(e,r,n=!1)=>{if(null!==be.current)return!1;if(!m(Fe.current))return!1;if(Ae.current)return!1;const t=await ar(()=>$.saveLayout(e,r,Oe.current,_e.current));if(t.ok)return Oe.current=t.value.version??Oe.current,!0;const o=x.readLockTaken(t.error);if(o){const e={kind:"takenover",holder:o};return Fe.current=e,Te(e),!1}const u=x.readSaveConflict(t.error);if(u){if(u.savedByYou&&!n&&$.rereadVersion){const n=await ar(()=>$.rereadVersion(e));if(n.ok&&n.value)return Oe.current=n.value,He.current(e,r,!0)}Ge(),Ae.current=u,De(u)}return!1},[$,ar,Ge]);j(()=>{He.current=ir},[ir]);const cr=P(e=>{if(null!==be.current)return;if(or("storefront-editor:dirty"),!le)return;const r=re(e);Ee.current=r,m(Fe.current)?Ve({id:le,data:r}):Me({id:le,data:r})},[le,or,Me,Ve,re]),lr=P(async()=>{m(Fe.current)&&ze();return await We()&&null==Ie.current},[ze,We]),dr=E(lr);j(()=>{dr.current=lr},[lr]);const fr=E(ar);j(()=>{fr.current=ar},[ar]);const gr=P(()=>{G.address.reload()},[G]),kr=E(()=>Promise.resolve(!1));j(()=>{kr.current=()=>{const e=$.rereadVersion;return le&&e?p({ours:Oe.current,stored:async()=>{const r=await fr.current(()=>e(le));return r.ok?r.value:null},hasPending:()=>null!=Ie.current||xe(),reload:gr}):Promise.resolve(!1)}},[$,le,xe,gr]);const mr=null!==we;j(()=>{if(!ie||!le||!se||mr)return;let e=!1,r=null;const n=_e.current,t=x.makeClaimBeat({claim:async e=>{const r=await fr.current(()=>ie.claim(le,n,e));if(r.ok)return{heartbeat_seconds:r.value.heartbeatSeconds};throw r.error},cancelled:()=>e,currentAccess:()=>Fe.current,heldWrite:()=>({pending:null!=Ie.current||xe(),autoSaveEnabled:!Ke.current.paused,saveConflict:null!=Ae.current}),setAccess:e=>{Fe.current=e,Te(e)},releaseHeldWrite:()=>{dr.current()},startHeartbeat:e=>{r=setInterval(()=>{t(!1)},e)},stopHeartbeat:()=>{r&&(clearInterval(r),r=null)},reloadIfMoved:()=>{kr.current()}}),o=er.current;return er.current=!1,o||Te({kind:"checking"}),t(o),()=>{e=!0,r&&clearInterval(r),ie.release(le,n).catch(()=>{})}},[le,ie,se,oe,qe,mr]);const vr=P(()=>{ie&&le&&(er.current=!0,$e(e=>e+1))},[le,ie]),pr=P(()=>{Te(e=>{const r="blocked"===e.kind||"takenover"===e.kind?e.holder:null;return r?{kind:"readonly",holder:r}:e})},[]),hr=P(()=>{Ke.current.paused?(m(Fe.current)&&ze(),Ye()):Ue()},[ze,Ue,Ye]),yr=P(()=>{Ze()},[Ze]),wr=P(e=>{Ee.current=null,a("template"!==e.kind&&ce,{resetAutosave:()=>{Qe(),Ie.current=null,je(!1)},setVersion:e=>{Oe.current=e},setSaveConflict:De,setAccess:Te}),H(e),Y(e),be.current=null,Se(null),de(null),ge(null),me(null),pe(null),G.address.show(e),"document"!==e.kind&&M(e)&&G.send("storefront-editor:navigated",{target:e})},[Qe,G,ce,H,M]),Sr=P(e=>{if(function(e,r,n){if(e.kind!==r.kind)return!1;if("template"===e.kind){const t=r;return e.id===t.id&&(e.pageSlug??n)===(t.pageSlug??n)}if("document"===e.kind){const n=r;return e.record===n.record&&(e.slug??"")===(n.slug??"")}const t=r;return e.slug===t.slug&&e.siteId===t.siteId}(e,te.current,L))return;const r=null!=Ie.current;if(!r&&!xe())return void wr(e);const n=Ke.current;r||n.paused||n.failed||n.stopped?Ce(e):We().then(r=>{r?wr(e):Ce(e)})},[wr,xe,We,L]),br=P(()=>Ce(null),[]),Ir=P(()=>{Ce(e=>(e&&wr(e),null))},[wr]),Pr=P(async()=>{const e=Re;if(!e)return;await lr()&&(Ce(null),wr(e))},[Re,lr,wr]),jr=P(async e=>{if(null!==be.current)return;if(!le)return;if(!m(Fe.current)||Ae.current)return;const r=re(e);if(!await ir(le,r))return void(Ae.current||or("storefront-editor:save-failed"));const n=$.publish;if(!ee.canPublish||!n)return void or("storefront-editor:saved");const t=await ar(()=>n(le,Oe.current??void 0));t.ok?(Oe.current=t.value.version??Oe.current,or("storefront-editor:published")):or("storefront-editor:save-failed")},[le,$,ee.canPublish,or,ir,ar,re]);/* @__PURE__ */
|
|
2
|
-
return R(O.Provider,{value:{target:U,adapter:$,capabilities:ee,templateId:X,currentSlug:z,currentKind:fe,siteId:_,ready:se,token:oe,tokenRef:ue,notifyParent:or,bridgeCapabilities:ae,runAuthed:sr,docId:le,data:ke,getLiveData:()=>Ee.current??ke,footerOriginSlug:ne,error:ye,redirecting:rr,saveStatus:Xe,saveState:Je,autoSaveEnabled:!Je.paused,autoSaveStoppedByConflict:Je.stopped,hasUnsavedEdits:Je.pending||Pe,toggleAutoSave:hr,retrySave:yr,onChange:cr,flushSave:lr,onPublish:jr,access:Le,readOnly:null!==h(Le)||null!==we,readOnlyReason:we,takeOverEditing:vr,viewReadOnly:pr,saveConflict:Be,reloadFromServer:gr,navigate:Sr,pendingNav:Re,cancelPendingNav:br,discardAndNavigate:Ir,saveAndNavigate:Pr},children:D})}export{O as ScreenDocumentContext,D as ScreenDocumentProvider,B as useScreenDocument};
|
package/dist/chunk-Q2HPBMG5.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{panelFieldsOf as t}from"./chunk-ZE7I3PLX.js";import{withoutDeviceGate as o,deviceMetaOf as e}from"./chunk-PWZOS45R.js";import{BUCKET_KEY as n}from"./chunk-R2HLPNQF.js";import{ANCHOR_FIELD_KEYS as r,foldMetaOf as s,MEDIA_FIELD_MARKER as i,TEXT_FIELD_MARKER as c,LINK_FIELD_MARKER as p}from"./chunk-DUVRZ456.js";import{STYLE_KIND as u,fieldKind as f,copyStyle as a,heldStyle as l,planPaste as m,pasteMessage as h}from"./chunk-57DJOKXT.js";var y=/* @__PURE__ */new Set([n.Style,n.Layout]),j=new Set(Object.values(n)),b=new Set(r),S=/* @__PURE__ */new Set(["focal","imageFocal"]),k=[i,c,p];function w(t){return`site:${t??""}`}function g(t){if(!t||"object"!=typeof t)return null;const e=t,n=o(t)??t,r=e[u]??n[u];if("string"==typeof r)return r;const s=e.options??n.options;if(Array.isArray(s)){return`choice:${s.map(t=>String(t?.value)).sort().join("|")}`}return f(n)}function L(t){const e=t,n=o(t);return k.some(t=>t in e||n&&t in n)}function O(o,n){const r=t(o,n)??{},i=[];let c=!1;for(const[t,o]of Object.entries(r))j.has(t)?c=y.has(t):c&&o&&"object"==typeof o&&!t.startsWith("_")&&(s(o)||b.has(t)||S.has(t)||L(o)||"slot"!==o.type&&i.push({path:[t],kind:g(o),counted:"mobile"!==e(o)?.tier}));return i}function v(t,o,e,n){a({scope:o,type:e.type,label:n,rows:O(t,e),props:e.props})}function P(t,o,e,n){const r=l(o);if(!r)return null;const s=m(r,{type:e.type,rows:O(t,e),props:e.props});return{...s,message:h(s,r.sourceLabel,n)}}export{v as copyNodeStyle,O as nodeStyleRows,P as planNodePaste,g as shopFieldKind,w as siteStyleScope};
|
package/dist/chunk-R5ZVNJLJ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createContext as e,useContext as r}from"react";import{jsx as n}from"react/jsx-runtime";var o={connected:!1,ownsDocument:!0,send:()=>{},subscribe:()=>()=>{},address:{search:()=>"",show:()=>{},load:()=>{},reload:()=>{}}},s=e(o);function t({host:e,children:r}){/* @__PURE__ */
|
|
2
|
-
return n(s.Provider,{value:e,children:r})}function d(){return r(s)}function c(e){const r=/* @__PURE__ */new Set;return{host:{connected:!0,ownsDocument:!1,send:(r,n)=>{e.onMessage({type:r,...n})},subscribe:e=>(r.add(e),()=>{r.delete(e)}),address:e.address},deliver:e=>{for(const n of[...r])n(e)}}}export{o as DETACHED_EASEL_HOST,s as EaselHostContext,t as EaselHostProvider,c as createEaselHost,d as useEaselHost};
|
package/dist/chunk-SERF2FAU.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{DEFAULT_PANEL_W as a,clampPanelWidth as r}from"./chunk-6DJHRLCU.js";var s="sf-editor-panel-widths",t={...a},e=a=>r(a);export{t as DEFAULT_PANEL_W,s as PANEL_WIDTHS_KEY,e as clampPanelWidth};
|