efficient-easel 0.106.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +70 -29
- package/dist/{LinkPicker-W2Rtxetz.d.ts → LinkPicker-hPEr1MJx.d.ts} +6 -4
- package/dist/autosave/index.d.ts +5 -5
- package/dist/chrome/chrome.css +50 -273
- package/dist/chrome/index.d.ts +61 -56
- package/dist/chrome/index.js +1 -1
- package/dist/chunk-4GNPKHV4.js +64 -0
- package/dist/chunk-5545A3PC.js +4 -0
- package/dist/chunk-7SQF6LZL.js +1 -0
- package/dist/chunk-BXMXTO36.js +1 -0
- package/dist/{chunk-JWMNPRTT.js → chunk-CKEPQNSQ.js} +1 -1
- package/dist/{chunk-LY4K2ECT.js → chunk-DJMMTWFP.js} +1 -1
- package/dist/chunk-EA2HTX37.js +5 -0
- package/dist/{chunk-VINYARYJ.js → chunk-FEK3S6HN.js} +1 -1
- package/dist/chunk-FPAVNX3Y.js +6 -0
- package/dist/chunk-HMJS344F.js +1 -0
- package/dist/chunk-JLTZQ4US.js +1 -0
- package/dist/chunk-JMGPPXNQ.js +24 -0
- package/dist/chunk-K56YDHYQ.js +1 -0
- package/dist/chunk-LOMEH6DG.js +1 -0
- package/dist/{chunk-FS5BLARH.js → chunk-MAEXP3KE.js} +1 -1
- package/dist/chunk-MJM6SFD3.js +3 -0
- package/dist/chunk-NLRW4BGG.js +8 -0
- package/dist/chunk-OJAJVH7S.js +5 -0
- package/dist/chunk-ONRYLR2D.js +2 -0
- package/dist/{chunk-WTMHT7BI.js → chunk-ORR3Q4WV.js} +1 -1
- package/dist/chunk-OTEXGJDU.js +5 -0
- package/dist/chunk-P2VEMZH5.js +1 -0
- package/dist/{chunk-MHKBLPQ2.js → chunk-PT6V53OO.js} +1 -1
- package/dist/{chunk-6WH7FA2M.js → chunk-PYCLHOSA.js} +2 -2
- package/dist/chunk-Q27BB5ZC.js +14 -0
- package/dist/chunk-QLD57GBB.js +6 -0
- package/dist/{chunk-PBSEUZD6.js → chunk-QMNML7XH.js} +1 -1
- package/dist/chunk-QR4DLZ3P.js +5 -0
- package/dist/chunk-TJ7YIRWQ.js +21 -0
- package/dist/{chunk-3P6AMTOS.js → chunk-VPFNZ7TB.js} +1 -1
- package/dist/chunk-W3XX2CNW.js +16 -0
- package/dist/chunk-X6DQWK2C.js +1 -0
- package/dist/chunk-XWR5YVA7.js +9 -0
- package/dist/chunk-YABL4EWX.js +7 -0
- package/dist/chunk-ZNNATBDC.js +1 -0
- package/dist/chunk-ZP4G3X44.js +4 -0
- package/dist/copy/copy.css +66 -177
- package/dist/copy/index.d.ts +0 -2
- package/dist/copy/index.js +31 -32
- package/dist/drag/drag.css +31 -11
- package/dist/drag/index.js +1 -1
- package/dist/easel/index.js +1 -1
- package/dist/fields/fields.css +35 -304
- package/dist/fields/index.d.ts +87 -95
- package/dist/fields/index.js +1 -1
- package/dist/gold/gold.css +3 -3
- package/dist/gold/index.d.ts +6 -5
- package/dist/gold/index.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/menu/index.d.ts +49 -93
- package/dist/menu/index.js +1 -1
- package/dist/menu/menu.css +37 -246
- package/dist/node-ops/index.d.ts +1 -1
- package/dist/panel/index.d.ts +46 -72
- package/dist/panel/index.js +17 -18
- package/dist/panel/panel.css +143 -372
- package/dist/pick/index.d.ts +52 -33
- package/dist/pick/index.js +7 -7
- package/dist/pick/pick.css +19 -150
- package/dist/rail/index.d.ts +48 -90
- package/dist/rail/index.js +1 -1
- package/dist/rail/rail.css +21 -108
- package/dist/screen/components/AddBlockRow.d.ts +8 -2
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddChildRow.d.ts +4 -3
- package/dist/screen/components/AddChildRow.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 +12 -8
- 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 +7 -7
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.d.ts +7 -7
- package/dist/screen/components/ScreenStoreProvider.js +1 -1
- package/dist/screen/components/SectionScreenShell.js +16 -16
- package/dist/screen/components/SidePanelHead.d.ts +4 -2
- package/dist/screen/components/SidePanelHead.js +1 -1
- package/dist/screen/components/UiIcon.d.ts +10 -26
- package/dist/screen/components/UiIcon.js +2 -1
- package/dist/screen/components/panel-widths.js +1 -1
- package/dist/screen/components/usePartBridge.d.ts +7 -7
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.d.ts +7 -7
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/admin-bridge.d.ts +1 -1
- package/dist/screen/lib/admin-bridge.js +1 -1
- package/dist/screen/lib/chrome-theme.d.ts +20 -12
- package/dist/screen/lib/chrome-theme.js +1 -1
- package/dist/screen/lib/document-addressing.d.ts +1 -1
- package/dist/screen/lib/host-chrome.d.ts +1 -1
- package/dist/screen/lib/host.d.ts +1 -1
- package/dist/screen/lib/key-scope.js +1 -1
- package/dist/screen/lib/links/link-filters.d.ts +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/page-lock.d.ts +1 -1
- package/dist/screen/lib/puck/style-clipboard.d.ts +7 -7
- package/dist/screen/lib/puck/use-section-ops.js +1 -1
- package/dist/screen/lib/screen-parts.d.ts +9 -8
- 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/screen.css +33 -206
- package/dist/shell/index.d.ts +134 -118
- package/dist/shell/index.js +1 -1
- package/dist/shell/shell.css +130 -88
- package/dist/strings/catalogue.d.ts +5 -5
- package/dist/strings/catalogue.js +1 -1
- package/dist/strings/index.d.ts +5 -5
- package/dist/strings/index.js +1 -1
- package/dist/style-clipboard/index.d.ts +1 -1
- package/dist/text-styles/index.d.ts +12 -3
- package/dist/text-styles/index.js +33 -38
- package/dist/text-styles/text-styles.css +39 -71
- package/dist/tree/index.d.ts +49 -44
- package/dist/tree/index.js +1 -1
- package/dist/tree/tree.css +31 -653
- package/dist/{types-DJDBtdB2.d.ts → types-BqGnUVX5.d.ts} +32 -32
- package/dist/types-BsyPh6EW.d.ts +99 -0
- package/dist/{types-DWS-s9z-.d.ts → types-CsgMwHHa.d.ts} +14 -11
- package/dist/{types-CqY85foL.d.ts → types-Dt1CFR1S.d.ts} +4 -2
- package/dist/{wordFit-D4S36PvB.d.ts → wordFit-7XpmhcaW.d.ts} +3 -5
- package/dist/words-Cl9xMUYY.d.ts +41 -0
- package/dist/{words-D_Lnw1Gr.d.ts → words-CvFnwGSr.d.ts} +1 -1
- package/package.json +5 -1
- package/dist/chunk-2UX75JDP.js +0 -1
- package/dist/chunk-37OCQYNX.js +0 -65
- package/dist/chunk-3EDSDPIP.js +0 -1
- package/dist/chunk-3QVB4AG2.js +0 -3
- package/dist/chunk-3WSPDAK2.js +0 -1
- package/dist/chunk-5MZ3RNQQ.js +0 -13
- package/dist/chunk-5ZBBXZPV.js +0 -6
- package/dist/chunk-BZ5ASXOL.js +0 -1
- package/dist/chunk-C6BJB5AC.js +0 -2
- package/dist/chunk-DX4XELD6.js +0 -18
- package/dist/chunk-EOJNJCMJ.js +0 -16
- package/dist/chunk-EWVJSRRY.js +0 -6
- package/dist/chunk-H24N5TMZ.js +0 -11
- package/dist/chunk-I6T4TZ5Q.js +0 -8
- package/dist/chunk-KTVH2ZRL.js +0 -15
- package/dist/chunk-M7N2V4TG.js +0 -2
- package/dist/chunk-MS4QRBJ6.js +0 -5
- package/dist/chunk-ND55LTCA.js +0 -5
- package/dist/chunk-OWBO4WKA.js +0 -0
- package/dist/chunk-P6O363EE.js +0 -6
- package/dist/chunk-RW4XBUUW.js +0 -1
- package/dist/chunk-UEVTQBM7.js +0 -10
- package/dist/chunk-VCQVNPTG.js +0 -22
- package/dist/chunk-WZ7TGAAT.js +0 -3
- package/dist/chunk-YC4TB3CJ.js +0 -25
- package/dist/chunk-Z6SOLDWV.js +0 -1
- package/dist/chunk-ZFDCDJNZ.js +0 -16
- package/dist/chunk-ZNS7727Y.js +0 -12
- package/dist/types-Djdq6Xkd.d.ts +0 -138
- package/dist/words-DgHcY5qB.d.ts +0 -33
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode, HTMLAttributes
|
|
2
|
-
import { T as TreeWords } from './words-
|
|
1
|
+
import { ReactNode, HTMLAttributes } from 'react';
|
|
2
|
+
import { T as TreeWords } from './words-Cl9xMUYY.js';
|
|
3
3
|
|
|
4
4
|
type LayersTreeProps = {
|
|
5
5
|
/** Extra classes — a host's scroll-bar class, for instance. */
|
|
@@ -7,6 +7,10 @@ type LayersTreeProps = {
|
|
|
7
7
|
children?: ReactNode;
|
|
8
8
|
/** Attributes for the tree's root — `efficient-easel/drag`'s `rootProps()`. */
|
|
9
9
|
rootProps?: HTMLAttributes<HTMLDivElement>;
|
|
10
|
+
/** The tree's accessible name (`role="tree"`). Default `words.name`: "Layers". */
|
|
11
|
+
ariaLabel?: string;
|
|
12
|
+
/** The tree's words in the host's language: `useEaselStrings().tree`. Left out, English. */
|
|
13
|
+
words?: TreeWords;
|
|
10
14
|
};
|
|
11
15
|
type TreeGroupLabelProps = {
|
|
12
16
|
children: ReactNode;
|
|
@@ -22,7 +26,7 @@ type TreeRowFold = {
|
|
|
22
26
|
onToggle: () => void;
|
|
23
27
|
};
|
|
24
28
|
type TreeRowProps = {
|
|
25
|
-
/** A
|
|
29
|
+
/** A small glyph for the row's type. */
|
|
26
30
|
icon: ReactNode;
|
|
27
31
|
/** The row's name — the type's label, or a name the person gave it. */
|
|
28
32
|
name: ReactNode;
|
|
@@ -37,9 +41,8 @@ type TreeRowProps = {
|
|
|
37
41
|
hidden?: boolean;
|
|
38
42
|
/**
|
|
39
43
|
* The row can be picked up — whole, by `efficient-easel/drag` (0.74.0). It says
|
|
40
|
-
* so
|
|
41
|
-
*
|
|
42
|
-
* moves. A draggable row draws no `handle`: the row IS the handle.
|
|
44
|
+
* so with the grab cursor, a faint ⋮ at its left and a hint after 0.7 s ("Drag
|
|
45
|
+
* to move · ⌥↑ ⌥↓") on hover, and the row lifted while it moves (tree.css).
|
|
43
46
|
*/
|
|
44
47
|
draggable?: boolean;
|
|
45
48
|
/** The hint a draggable row shows after 0.7 s. Default `words.dragHint`: "Drag to move · ⌥↑ ⌥↓". */
|
|
@@ -48,61 +51,58 @@ type TreeRowProps = {
|
|
|
48
51
|
dragging?: boolean;
|
|
49
52
|
/** Where a drop would land relative to this row, while a drag is over it. */
|
|
50
53
|
drop?: 'before' | 'after' | 'into';
|
|
51
|
-
/** Present when the row folds; the row leads with its caret. Absent: the caret column is held open. */
|
|
52
|
-
fold?: TreeRowFold;
|
|
53
54
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* and never made unreachable.
|
|
57
|
-
*
|
|
58
|
-
* @deprecated since 0.74.0 — a row driven by `efficient-easel/drag` is picked
|
|
59
|
-
* up whole (`draggable`), and a draggable row draws no handle. Kept until both
|
|
60
|
-
* editors have moved (blueprint 3.3 / 3.4).
|
|
55
|
+
* Present when the row folds: `aria-expanded`, the caret, and ArrowRight /
|
|
56
|
+
* ArrowLeft open and close it. Absent: the caret column is held open.
|
|
61
57
|
*/
|
|
62
|
-
|
|
58
|
+
fold?: TreeRowFold;
|
|
63
59
|
/** `TreeRowAction`s — laid over the END of the name, shown on hover and focus. */
|
|
64
60
|
actions?: ReactNode;
|
|
65
|
-
/** Stands in for the name — a rename box.
|
|
61
|
+
/** Stands in for the name — a rename box (`es-tree-rename`). Keys typed in it are its own. */
|
|
66
62
|
nameSlot?: ReactNode;
|
|
67
63
|
/**
|
|
68
|
-
* Selects the row
|
|
69
|
-
*
|
|
70
|
-
*
|
|
64
|
+
* Selects the row: a click on it, Enter or Space while it has focus (the row
|
|
65
|
+
* is the `treeitem`; `aria-selected` says which is selected). With a
|
|
66
|
+
* `rowProps.onClick` as well, a click is that onClick's alone — one click,
|
|
67
|
+
* one selection.
|
|
71
68
|
*/
|
|
72
69
|
onSelect?: () => void;
|
|
73
70
|
/** Named state glyphs drawn right after the name — "Hidden on phones". */
|
|
74
71
|
marks?: ReadonlyArray<TreeRowMark>;
|
|
75
72
|
/** A count or position pill after the name — "1 of 2". */
|
|
76
73
|
badge?: ReactNode;
|
|
77
|
-
/** A non-interactive mark
|
|
74
|
+
/** A non-interactive named mark — the Lock on a pinned section. Drawn after the marks. */
|
|
78
75
|
trailing?: {
|
|
79
76
|
label: string;
|
|
80
77
|
icon: ReactNode;
|
|
81
78
|
};
|
|
82
|
-
/** Drawn
|
|
79
|
+
/** Drawn after the name, the marks and `trailing` — a count, say. The drop line is the row's own (`drop`). */
|
|
83
80
|
children?: ReactNode;
|
|
81
|
+
/** The depth, from 1 (`aria-level`). Left out: the nearest `Subtree`'s, counted. */
|
|
82
|
+
level?: number;
|
|
84
83
|
/** Attributes for the row itself: onClick, drag-over handlers, data-*. */
|
|
85
84
|
rowProps?: HTMLAttributes<HTMLDivElement> & Record<`data-${string}`, string | number | undefined>;
|
|
86
85
|
/**
|
|
87
|
-
* The row's own words — the drag hint
|
|
88
|
-
*
|
|
89
|
-
*
|
|
86
|
+
* The row's own words — the drag hint — in the host's language:
|
|
87
|
+
* `useEaselStrings().tree` (0.95.0). Left out, English. `dragHint` above still
|
|
88
|
+
* wins for its one line.
|
|
90
89
|
*/
|
|
91
90
|
words?: TreeWords;
|
|
92
91
|
};
|
|
93
92
|
type TreeRowMark = {
|
|
94
93
|
key: string;
|
|
95
|
-
/** Tooltip and accessible name — the mark is a picture of a state. */
|
|
94
|
+
/** Tooltip (the shell's) and accessible name — the mark is a picture of a state. */
|
|
96
95
|
label: string;
|
|
97
96
|
icon: ReactNode;
|
|
98
97
|
};
|
|
99
98
|
type TreeRowActionProps = {
|
|
100
99
|
/**
|
|
101
|
-
* `delete` is the
|
|
102
|
-
* (a phone toggle, "Duplicate
|
|
100
|
+
* `delete` is the trash, in the shell's danger tone (`ghost-danger`); `eye`
|
|
101
|
+
* shows or hides; `plain` is any other action (a phone toggle, "Duplicate
|
|
102
|
+
* column") in the neutral one.
|
|
103
103
|
*/
|
|
104
104
|
kind: 'delete' | 'eye' | 'plain';
|
|
105
|
-
/** For a toggle: whether it is on. Adds aria-pressed and keeps
|
|
105
|
+
/** For a toggle: whether it is on. Adds aria-pressed and keeps the row's actions showing at rest. */
|
|
106
106
|
pressed?: boolean;
|
|
107
107
|
disabled?: boolean;
|
|
108
108
|
/** Tooltip and accessible name — "Delete Text", "Show Section". */
|
|
@@ -111,7 +111,7 @@ type TreeRowActionProps = {
|
|
|
111
111
|
children: ReactNode;
|
|
112
112
|
};
|
|
113
113
|
type TreeEmptySlotProps = {
|
|
114
|
-
/** A drag is over the slot and may land in it: it lights up and says "Drop here". */
|
|
114
|
+
/** A drag is over the slot and may land in it: it lights up and says the shell's "Drop here". */
|
|
115
115
|
drop?: boolean;
|
|
116
116
|
/** Present: the box is a button that adds here (it opens the Add panel at this place). */
|
|
117
117
|
onAdd?: () => void;
|
|
@@ -123,10 +123,10 @@ type TreeEmptySlotProps = {
|
|
|
123
123
|
/**
|
|
124
124
|
* The drag handlers — `efficient-easel/drag`'s
|
|
125
125
|
* `seam({ place: { ...list, index: 0 } }).seamProps`: an empty list has one
|
|
126
|
-
* place, its start.
|
|
126
|
+
* place, its start. They go on the shell slot's root (`slotProps`).
|
|
127
127
|
*/
|
|
128
128
|
seamProps?: HTMLAttributes<HTMLDivElement>;
|
|
129
|
-
/** The box's
|
|
129
|
+
/** The box's words at rest in the host's language: `useEaselStrings().tree`. Left out, English. */
|
|
130
130
|
words?: TreeWords;
|
|
131
131
|
};
|
|
132
132
|
type TreeSeamProps = {
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { ReactNode, CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
/** One row of the menu.
|
|
4
|
+
*
|
|
5
|
+
* Carried over unchanged from `efficient-admin-portal`'s `RowContextMenuItem`
|
|
6
|
+
* (card 66039), because the campaign designer's registry is typed against it and
|
|
7
|
+
* what the menus OFFER is not this card's to move. A `label` of `'—'` renders a
|
|
8
|
+
* separator; `header: true` renders a caption, and the FIRST such caption names
|
|
9
|
+
* the menu for assistive tech. */
|
|
10
|
+
interface EaselContextMenuItem {
|
|
11
|
+
label: string;
|
|
12
|
+
onClick: () => void;
|
|
13
|
+
danger?: boolean;
|
|
14
|
+
header?: boolean;
|
|
15
|
+
/** A SUBMENU: this item opens a flyout of these instead of acting itself.
|
|
16
|
+
* One level only — a child carrying its own `children` is drawn as a plain
|
|
17
|
+
* item, which is all any caller has needed and keeps the flyout from becoming
|
|
18
|
+
* a tree nobody can navigate with a mouse. */
|
|
19
|
+
children?: EaselContextMenuItem[];
|
|
20
|
+
/** Draw a tick beside this item — for a submenu whose entries are STATES
|
|
21
|
+
* rather than actions, so it can say which one you are already on. */
|
|
22
|
+
checked?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* A glyph for the row, drawn before the label.
|
|
25
|
+
*
|
|
26
|
+
* ⚠️ A TYPE SLOT, NOT A LOOKUP. The box renders what it is handed and does
|
|
27
|
+
* not know what a glyph means — it must never import the icon set, or the
|
|
28
|
+
* leaf stops being a leaf (`tests/menu-leaf-safety.test.ts` (a) fails if it
|
|
29
|
+
* tries). Hosts pass an element from `efficient-easel/icons`, whose four
|
|
30
|
+
* menu glyphs — copy, paste, move-up, move-down — shipped in 0.30.0 for
|
|
31
|
+
* exactly this row.
|
|
32
|
+
*
|
|
33
|
+
* OMIT IT AND NOTHING IS DRAWN — not an empty span. That is what keeps the
|
|
34
|
+
* admin portal's three shipped surfaces byte-identical, and it is pinned by
|
|
35
|
+
* `tests/menu-layer.test.tsx` (g).
|
|
36
|
+
*/
|
|
37
|
+
icon?: ReactNode;
|
|
38
|
+
/**
|
|
39
|
+
* The keyboard shortcut, drawn right-aligned after the label (the `.k`
|
|
40
|
+
* column of the approved drawing).
|
|
41
|
+
*
|
|
42
|
+
* Display text, not a binding — the box neither registers nor honours it;
|
|
43
|
+
* the host owns the key handling. `aria-hidden`, like the tick and the
|
|
44
|
+
* chevron: "Duplicate ⌘D" read aloud is worse than "Duplicate".
|
|
45
|
+
*
|
|
46
|
+
* OMIT IT AND NOTHING IS DRAWN. Same guard as `icon`.
|
|
47
|
+
*/
|
|
48
|
+
shortcut?: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* What the box was dressed in, up to 0.106.0.
|
|
52
|
+
*
|
|
53
|
+
* @deprecated since 1.0.0 (efficient-easel#199, harness UI-24): the box is the
|
|
54
|
+
* shell's `ContextMenu` and wears the shell's look, so a skin is accepted and
|
|
55
|
+
* IGNORED. The type stays so a host that still passes one compiles; delete
|
|
56
|
+
* the host's skin when it next touches the menu.
|
|
57
|
+
*/
|
|
58
|
+
interface EaselContextMenuSkin {
|
|
59
|
+
menu?: string;
|
|
60
|
+
menuSub?: string;
|
|
61
|
+
item?: string;
|
|
62
|
+
itemDanger?: string;
|
|
63
|
+
divider?: string;
|
|
64
|
+
header?: string;
|
|
65
|
+
label?: string;
|
|
66
|
+
labelSub?: string;
|
|
67
|
+
icon?: string;
|
|
68
|
+
shortcut?: string;
|
|
69
|
+
chevron?: string;
|
|
70
|
+
tick?: string;
|
|
71
|
+
surface?: CSSProperties;
|
|
72
|
+
itemStyle?: CSSProperties;
|
|
73
|
+
}
|
|
74
|
+
interface EaselContextMenuProps {
|
|
75
|
+
/** Where the pointer was, in the viewport. The shell's `ContextMenu` places
|
|
76
|
+
* the box from here and keeps it inside the owning window (UI-11). */
|
|
77
|
+
x: number;
|
|
78
|
+
y: number;
|
|
79
|
+
items: EaselContextMenuItem[];
|
|
80
|
+
onClose: () => void;
|
|
81
|
+
/**
|
|
82
|
+
* What was right-clicked (or the editor's root). The menu stays inside the
|
|
83
|
+
* shell window that holds it; left out, inside the viewport.
|
|
84
|
+
*/
|
|
85
|
+
owner?: Element | null;
|
|
86
|
+
/** @deprecated since 1.0.0 — ignored: the shell's menu scrolls when it is
|
|
87
|
+
* taller than its window. */
|
|
88
|
+
maxHeight?: number;
|
|
89
|
+
/** @deprecated since 1.0.0 — ignored: the menu wears the shell's look. */
|
|
90
|
+
skin?: EaselContextMenuSkin;
|
|
91
|
+
/**
|
|
92
|
+
* @deprecated since 1.0.0 — the menu is always portalled to `<body>` by the
|
|
93
|
+
* shell, and kept inside the window that holds this element, so it is read
|
|
94
|
+
* as `owner` when `owner` is not given.
|
|
95
|
+
*/
|
|
96
|
+
portalTo?: HTMLElement | null;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export type { EaselContextMenuItem as E, EaselContextMenuProps as a, EaselContextMenuSkin as b };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as WordFit } from './wordFit-
|
|
1
|
+
import { W as WordFit } from './wordFit-7XpmhcaW.js';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -17,7 +17,7 @@ import { ReactNode } from 'react';
|
|
|
17
17
|
interface EaselRailItem {
|
|
18
18
|
/** Stable identity — used as the React key and to correlate selection. */
|
|
19
19
|
id: string;
|
|
20
|
-
/** Accessible name; becomes both the `aria-label` and the
|
|
20
|
+
/** Accessible name; becomes both the `aria-label` and the button's `Tooltip`. */
|
|
21
21
|
label: string;
|
|
22
22
|
/**
|
|
23
23
|
* The glyph. Pass one of the icons this package ships
|
|
@@ -63,26 +63,29 @@ interface EaselRailProps {
|
|
|
63
63
|
*/
|
|
64
64
|
orientation?: EaselRailOrientation;
|
|
65
65
|
/**
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
*
|
|
66
|
+
* Told which words a ROW rail draws — `'all'`, `'chosen'` (the open panel's
|
|
67
|
+
* word) or `'none'` — once the shell has measured them and again when that
|
|
68
|
+
* changes (efficient-shell's `IconRail` `onLabelsShown`). A host whose longer
|
|
69
|
+
* language lost its words can say so.
|
|
70
|
+
*/
|
|
71
|
+
onLabelsShown?: (shown: 'all' | 'chosen' | 'none') => void;
|
|
72
|
+
/**
|
|
73
|
+
* @deprecated since 1.0.0 — accepted and ignored. A row rail's words are the
|
|
74
|
+
* shell's, measured by the shell (`IconRail` `labelsFit`).
|
|
74
75
|
*/
|
|
75
76
|
wordFit?: WordFit;
|
|
76
77
|
}
|
|
77
78
|
interface EaselRailButtonProps {
|
|
78
79
|
label: string;
|
|
79
|
-
/**
|
|
80
|
+
/** @deprecated since 1.0.0 — accepted and ignored: a worded row rail is the shell's (`EaselRail`). */
|
|
80
81
|
worded?: boolean;
|
|
81
82
|
icon: ReactNode;
|
|
82
83
|
active?: boolean;
|
|
83
84
|
disabled?: boolean;
|
|
84
85
|
onSelect?: () => void;
|
|
85
86
|
className?: string;
|
|
87
|
+
/** Where its tooltip goes: away from the rail. Default `right` (a column). */
|
|
88
|
+
tooltipSide?: 'top' | 'bottom' | 'left' | 'right';
|
|
86
89
|
}
|
|
87
90
|
|
|
88
91
|
export type { EaselRailButtonProps as E, EaselRailItem as a, EaselRailOrientation as b, EaselRailProps as c };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as EaselRailItem } from './types-
|
|
1
|
+
import { a as EaselRailItem } from './types-CsgMwHHa.js';
|
|
2
2
|
import { ReactNode, Ref, CSSProperties } from 'react';
|
|
3
3
|
import { EditAccess, SaveConflict } from './edit-lock/index.js';
|
|
4
4
|
import { P as PanelSide } from './panelWidths-D9hTLR25.js';
|
|
@@ -92,7 +92,9 @@ type PanelResizeHandleProps = {
|
|
|
92
92
|
defaultWidth: number;
|
|
93
93
|
/** What this grip resizes, for a screen reader. Required: a default can only lie. */
|
|
94
94
|
label: string;
|
|
95
|
-
/**
|
|
95
|
+
/** The new width, clamped to `min`–`max` and rounded. Since 1.0.0 it is
|
|
96
|
+
* always a number (the shell's handle); the updater form stays in the type
|
|
97
|
+
* so a host's handler written for both still compiles. */
|
|
96
98
|
onResize: (width: number | ((prev: number) => number)) => void;
|
|
97
99
|
};
|
|
98
100
|
type InspectorHeadProps = {
|
|
@@ -3,11 +3,9 @@
|
|
|
3
3
|
* about a strip whose words belong to the host, measured by whoever owns the
|
|
4
4
|
* words.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* the top-bar rail `TopBarRail` measures the words in the browser and
|
|
10
|
-
* hands `EaselRail` the result.
|
|
6
|
+
* `SettingsSegmented` uses it: the host passes its measured `fit`, and ONE
|
|
7
|
+
* rule (`panel.css`, "word fit") reads it. (The top-bar rail used it too until
|
|
8
|
+
* efficient-shell 4.165.0 measured a worded `IconRail` itself.)
|
|
11
9
|
*
|
|
12
10
|
* Both numbers are the width of TEXT ONLY, in the strip's own type, and neither
|
|
13
11
|
* includes any padding, glyph or gap: those are the strip's, and the sheet adds
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Layers tree's own words (`efficient-easel/strings`, 0.95.0): its name, the
|
|
3
|
+
* drag hint and an empty slot's. A row's name, its marks and its actions are
|
|
4
|
+
* the host's.
|
|
5
|
+
*
|
|
6
|
+
* The tree does not read the strings provider: `LayersTree`, `TreeRow` and
|
|
7
|
+
* `TreeEmptySlot` take these as their `words` prop and a host passes
|
|
8
|
+
* `useEaselStrings().tree`.
|
|
9
|
+
*
|
|
10
|
+
* Since the rows became the shell's (UI-24) the caret is the shell's, silent
|
|
11
|
+
* (`aria-expanded` on the row says it), so `collapse` / `expand` and their
|
|
12
|
+
* `…Named` are no longer drawn; and an empty slot under a drag says the shell's
|
|
13
|
+
* own "Drop here", so `dropHere` is not either. They stay typed so a host's
|
|
14
|
+
* words still fit.
|
|
15
|
+
*/
|
|
16
|
+
type TreeWords = {
|
|
17
|
+
/** The tree's accessible name. Optional, so a host's words from before still type. */
|
|
18
|
+
name?: string;
|
|
19
|
+
/** What a draggable row says after 0.7 s on it. */
|
|
20
|
+
dragHint: string;
|
|
21
|
+
/** Not drawn since the rows are the shell's (above). */
|
|
22
|
+
collapse: string;
|
|
23
|
+
/** Not drawn since the rows are the shell's (above). */
|
|
24
|
+
expand: string;
|
|
25
|
+
/** Not drawn since the rows are the shell's (above). */
|
|
26
|
+
collapseNamed: (v: {
|
|
27
|
+
label: string;
|
|
28
|
+
}) => string;
|
|
29
|
+
/** Not drawn since the rows are the shell's (above). */
|
|
30
|
+
expandNamed: (v: {
|
|
31
|
+
label: string;
|
|
32
|
+
}) => string;
|
|
33
|
+
/** What an empty slot says when it offers nothing: a read-only tree. */
|
|
34
|
+
emptySlot?: string;
|
|
35
|
+
/** What an empty slot's button says. */
|
|
36
|
+
addBlock?: string;
|
|
37
|
+
/** Not drawn: the shell's slot says its own (above). */
|
|
38
|
+
dropHere?: string;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export type { TreeWords as T };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-easel",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
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",
|
|
@@ -517,18 +517,22 @@
|
|
|
517
517
|
"dist"
|
|
518
518
|
],
|
|
519
519
|
"peerDependencies": {
|
|
520
|
+
"efficient-shell": "^4.165.0",
|
|
520
521
|
"react": ">=18",
|
|
521
522
|
"react-dom": ">=18"
|
|
522
523
|
},
|
|
523
524
|
"devDependencies": {
|
|
525
|
+
"@tailwindcss/cli": "^4.2.4",
|
|
524
526
|
"@types/jsdom": "^28.0.3",
|
|
525
527
|
"@types/node": "^22.0.0",
|
|
526
528
|
"@types/react": "^18.2.0",
|
|
527
529
|
"@types/react-dom": "^18.2.0",
|
|
530
|
+
"efficient-shell": "^4.165.0",
|
|
528
531
|
"esbuild": "^0.27.0",
|
|
529
532
|
"jsdom": "^26.1.0",
|
|
530
533
|
"react": "^18.2.0",
|
|
531
534
|
"react-dom": "^18.2.0",
|
|
535
|
+
"tailwindcss": "^4.2.4",
|
|
532
536
|
"terser": "^5.51.2",
|
|
533
537
|
"tsup": "^8.0.0",
|
|
534
538
|
"typescript": "^5.3.0"
|
package/dist/chunk-2UX75JDP.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={accent:"#2563eb",accentTint:"#eff6ff",accentTintStrong:"#dbeafe",accentLine:"#bfdbfe",accentText:"#1d4ed8",accentRing:"rgba(37, 99, 235, 0.25)",accentShadow:"rgba(37, 99, 235, 0.35)",onAccent:"#ffffff",appBg:"#f9fafb",previewBg:"#f3f4f6",panel:"#ffffff",raised:"#ffffff",topbarBg:"#ffffff",frameBg:"#ffffff",hover:"#f3f4f6",hatch:"rgba(0, 0, 0, 0.018)",addcardVeil:"rgba(248, 249, 250, 0.66)",fieldBg:"#ffffff",trackBg:"#f3f4f6",inputBorder:"#d1d5db",fieldText:"#1f2937",fieldPlaceholder:"#9ca3af",knob:"#ffffff",text:"#111827",textStrong:"#030712",textSecondary:"#374151",muted:"#6b7280",icon:"#6b7280",disabled:"#9ca3af",divider:"#e5e7eb",line:"#e5e7eb",btnBorder:"#d1d5db",btnText:"#374151",chipBg:"#f3f4f6",chipFg:"#6b7280",brandSquare:"#111827",deviceBorder:"#e5e7eb",toastBg:"#111827",toggleOff:"#d1d5db",scrollbar:"#d1d5db",scrollbarHover:"#9ca3af",danger:"#dc2626",dangerStrong:"#b91c1c",dangerTint:"#fef2f2",warning:"#b45309",previewTint:"#fef3c7",success:"#15803d",panelRadius:12,rowRadius:8,fieldRadius:6,panelGap:12,space2:2,space4:4,space8:8,space12:12,space16:16,space32:32,panelShadow:"0 1px 2px rgba(0, 0, 0, 0.05), 0 10px 30px rgba(0, 0, 0, 0.06)",topbarShadow:"0 1px 3px rgba(0, 0, 0, 0.06)",raisedShadow:"0 1px 2px rgba(16, 24, 40, 0.1)",font:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif'},a=[e.space2,e.space4,e.space8,e.space12,e.space16,e.space32],s={accent:"--es-accent",accentTint:"--es-accent-tint",accentTintStrong:"--es-accent-tint-strong",accentLine:"--es-accent-line",accentText:"--es-accent-text",accentRing:"--es-accent-ring",accentShadow:"--es-accent-shadow",onAccent:"--es-on-accent",appBg:"--es-app-bg",previewBg:"--es-preview-bg",panel:"--es-panel",raised:"--es-raised",topbarBg:"--es-topbar-bg",frameBg:"--es-frame-bg",hover:"--es-hover",hatch:"--es-hatch",addcardVeil:"--es-addcard-veil",fieldBg:"--es-field-bg",trackBg:"--es-track-bg",inputBorder:"--es-input-border",fieldText:"--es-field-text",fieldPlaceholder:"--es-field-placeholder",knob:"--es-knob",text:"--es-text",textStrong:"--es-text-strong",textSecondary:"--es-text-secondary",muted:"--es-muted",icon:"--es-icon",disabled:"--es-disabled",divider:"--es-divider",line:"--es-line",btnBorder:"--es-btn-border",btnText:"--es-btn-text",chipBg:"--es-chip-bg",chipFg:"--es-chip-fg",brandSquare:"--es-brand-square",deviceBorder:"--es-device-border",toastBg:"--es-toast-bg",toggleOff:"--es-toggle-off",scrollbar:"--es-scrollbar",scrollbarHover:"--es-scrollbar-hover",danger:"--es-danger",dangerStrong:"--es-danger-strong",dangerTint:"--es-danger-tint",warning:"--es-warning",previewTint:"--es-preview-tint",success:"--es-success",panelRadius:"--es-panel-radius",rowRadius:"--es-row-radius",fieldRadius:"--es-field-radius",panelGap:"--es-panel-gap",space2:"--es-space-2",space4:"--es-space-4",space8:"--es-space-8",space12:"--es-space-12",space16:"--es-space-16",space32:"--es-space-32",panelShadow:"--es-panel-shadow",topbarShadow:"--es-topbar-shadow",raisedShadow:"--es-raised-shadow",font:"--es-font"};export{a as SPACING_SCALE,s as shellCssVars,e as shellTokens};
|
package/dist/chunk-37OCQYNX.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import{dedupeSlotChildren as e}from"./chunk-26OOWIJJ.js";import{styleClipboardOf as n}from"./chunk-SQTY6CJD.js";import{markedTreeNodeId as t,revealSelectedTreeRow as o,sameSelector as r}from"./chunk-FGNR22NY.js";import{cloneNodeWithFreshIds as i}from"./chunk-2GVCAIPX.js";import{rootRowName as l,slotChildRowName as s,slotChildRenameProp as d,sectionRenameProp as c}from"./chunk-TBF5CVPA.js";import{scrollPreviewToSection as a,gotoPreviewSlide as p,scrollPreviewToTop as u}from"./chunk-4ES5JGGX.js";import{useEaselKeyTarget as f,useEaselUndoKeys as h,editorRootFocus as m}from"./chunk-MHKBLPQ2.js";import{SlotChildActionsProvider as g}from"./chunk-KCBEE2MC.js";import{UiIcon as y}from"./chunk-5MZ3RNQQ.js";import{screenStorageKeys as k,DEFAULT_PANEL_W as S,clampPanelWidth as v}from"./chunk-WTMHT7BI.js";import{usePartBridge as x}from"./chunk-LY4K2ECT.js";import{useSectionOps as b}from"./chunk-PBSEUZD6.js";import{useNodeClipboard as w,useNodeContextMenu as z}from"./chunk-M7N2V4TG.js";import{PageEditGuardNotices as B}from"./chunk-FS5BLARH.js";import{useScreenDocument as C}from"./chunk-C6BJB5AC.js";import{requestMediaPick as N}from"./chunk-KG7RJWOK.js";import{heldStyle as $,styleShortcut as T}from"./chunk-57DJOKXT.js";import{AddChildRow as O}from"./chunk-3QVB4AG2.js";import{AddSidePanel as I}from"./chunk-MS4QRBJ6.js";import{SidePanelHead as P,PanelShowStrip as A}from"./chunk-5ZBBXZPV.js";import{MediaSidePanel as M}from"./chunk-JWMNPRTT.js";import{useScreenSaveSwitch as R,useScreenNodeKeys as j,useScreenPinned as E,useScreenDocumentLabel as L,useScreenCanvasFrame as D,useScreenInspectorPanel as V,useScreenDevices as H,useScreenPickFollowsSelection as F,useScreenLeftView as W,useScreenAdd as G,SELECTION_MODE as J,sameInspectorMode as U,useScreenBridges as Y,useScreenBlockRules as K,useScreenBlockLook as Q,useScreenStorageNamespace as X,useScreenNotify as Z,useScreenCanvasHead as _,isSlotMode as q,useScreenStyleClipboard as ee,useScreenDocumentPass as ne,useScreenCanvasDrag as te,ScreenCanvasTargetProvider as oe,isPinnedFirst as re,isPinnedLast as ie,screenSlotsOf as le}from"./chunk-ND55LTCA.js";import{ROOT_ZONE as se,blockNodeActions as de,TREE_MAX_DEPTH as ce,childSlotsOf as ae,slotFieldsOf as pe,slotChildrenIn as ue,nestsInTree as fe,newNodeId as he}from"./chunk-PLVEGYK6.js";import{useMediaPanel as me,usePanelPick as ge,useCancelPanelPick as ye}from"./chunk-R6WTQWAC.js";import{useEaselHost as ke,useHostEscape as Se}from"./chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as ve}from"./chunk-E2O2MRZR.js";import{useEasel as xe,useEaselApi as be}from"./chunk-6WH7FA2M.js";import{toItemSelector as we,useNodeOps as ze}from"./chunk-D2BCHTQR.js";import{TreeRow as Be,Subtree as Ce,LayersTree as Ne,TreeGroupLabel as $e,TreeRowAction as Te,TreeSeam as Oe}from"./chunk-ZFDCDJNZ.js";import{saveIndicator as Ie}from"./chunk-H6DDIBQ4.js";import{EaselTopBar as Pe,TopBarRail as Ae,TopBarCluster as Me,EaselIconButton as Re,TopBarDivider as je,DeviceSwitch as Ee,InspectorIconButton as Le,PanelResizeHandle as De,MAX_PANEL_W as Ve,MIN_PANEL_W as He,panelWidthVars as Fe,SaveState as We,SaveStateToggle as Ge}from"./chunk-YC4TB3CJ.js";import{useWords as Je}from"./chunk-MFIRYGHW.js";import{CanvasDragLayer as Ue}from"./chunk-DX4XELD6.js";import{createDragSession as Ye,useTreeDrag as Ke,gapToMoveIndex as Qe}from"./chunk-67GNT6PF.js";import{useCanvasFrame as Xe,BLOCK_SELECTOR as Ze,useCanvasEvent as _e}from"./chunk-PAELDYYS.js";import{LayersIcon as qe,MediaIcon as en,UndoIcon as nn,RedoIcon as tn,TrashIcon as on,DuplicateIcon as rn}from"./chunk-L5KW4HG5.js";import{zoneKey as ln,ROOT_ID as sn,ROOT_SLOT as dn,parseZoneKey as cn,DataError as an}from"./chunk-KRXQM65X.js";import{useRef as pn,useMemo as un,useState as fn,useEffect as hn,useCallback as mn,useLayoutEffect as gn,Fragment as yn}from"react";import{jsx as kn,jsxs as Sn,Fragment as vn}from"react/jsx-runtime";function xn({saveState:e,notSaving:n,readOnlyReason:t,toggle:o,onToggle:r,onRetry:i}){if(null!==t)/* @__PURE__ */return kn(We,{tone:"off",label:t,role:"status"});if(n)/* @__PURE__ */
|
|
2
|
-
return kn(We,{tone:e.pending?"off-unsaved":"off",label:"Not saving — see the notice above",role:"status"});const{tone:l,label:s}=Ie(e),d=e.failed&&!e.paused&&/* @__PURE__ */kn("button",{type:"button",className:"es-btn-ghost",onClick:i,children:"Retry now"});/* @__PURE__ */
|
|
3
|
-
return Sn(vn,o?{children:[
|
|
4
|
-
/* @__PURE__ */kn(Ge,{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__ */kn(We,{tone:l,label:s})}),d]}:{children:[
|
|
5
|
-
/* @__PURE__ */kn(We,{tone:l,label:s,role:"status"}),d]})}function bn({expand:e}){/* @__PURE__ */
|
|
6
|
-
return kn("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */Sn(vn,e?{children:[
|
|
7
|
-
/* @__PURE__ */kn("path",{d:"M8 9l4-4 4 4"}),
|
|
8
|
-
/* @__PURE__ */kn("path",{d:"M8 15l4 4 4-4"})]}:{children:[
|
|
9
|
-
/* @__PURE__ */kn("path",{d:"M8 4l4 4 4-4"}),
|
|
10
|
-
/* @__PURE__ */kn("path",{d:"M8 20l4-4 4 4"}),
|
|
11
|
-
/* @__PURE__ */kn("path",{d:"M5 12h14"})]})})}function wn(e,n,t){const o=t-n;if(o<6)return null;if(o<26)return{top:Math.round((n+t)/2),height:Math.round(o)};return{top:Math.round(Math.min(Math.max(e,n+13),t-13))}}var zn="__rungs";var Bn="screen:band",Cn={duplicate:!0,delete:!0};function Nn(){const Ie=ke(),{target:We,docId:Ge,capabilities:Nn,currentSlug:$n,siteId:Tn,onPublish:On,saveState:In,saveConflict:Pn,retrySave:An,toggleAutoSave:Mn,readOnly:Rn,readOnlyReason:jn=null}=C(),En=R(),Ln=j(),{mediaEditing:Dn,hasEditGuard:Vn,hasPinnedChrome:Hn}=Nn,{appState:Fn,dispatch:Wn,history:Gn,selectedItem:Jn,getSelectorForId:Un,config:Yn}=xe(e=>e),Kn=E(),{first:Qn,firstGroup:Xn,lastGroup:Zn,isSectionGroup:_n,sectionGroupZone:qn,panelOf:et}=Kn,nt=et(Qn),tt=e=>re(Kn,e),ot=e=>ie(Kn,e),rt="node"===Kn.firstRow,it=Kn.band??null,lt=Je("screen",ve),st=L()??`/${$n}`,dt=D(),ct=V(),at=b({readOnly:Rn}),pt=pn(null),ut=be(),ft=un(()=>({...at,select:e=>{pt.current=e,at.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=ut.config;pt.current=we(e,t,n)}at.commitDocument(e,n)}}),[at,ut]),ht=Fn.ui,mt=ht.leftSideBarVisible,gt=ht.rightSideBarVisible,{options:yt,widths:kt,initial:St,fluid:vt,fit:xt}=H(),[bt,wt]=fn(St),zt=me(),Bt=Dn&&null!==zt,Ct=ge(),Nt=ye();F(Jn?.props.id);const{read:$t,write:Tt,forSelection:Ot}=W(),[It,Pt]=fn($t);hn(()=>{Tt(It)},[It]);const[At,Mt]=fn(0),Rt=pn(null),jt=pn(null),Et=Xe(jt,{readySelector:Ze}),Lt=f(jt);h(jt,Et);const[Dt,Vt]=fn(!1),Ht=pn(!1),Ft=pn(!1),[Wt,Gt]=fn(null),Jt=G(),Ut=e=>Gt(null===e?null:{zone:se,index:e}),[Yt,Kt]=fn([]),[Qt,Xt]=fn(J),Zt="puck"===Qt.kind,_t=Dt&&!Wt&&Jt.railTarget?Jt.railTarget(Fn.data,{node:Jn??null,mode:Qt}):null,qt=_t?{zone:ln(_t),index:_t.index}:null,eo=Wt??qt,no=eo&&eo.zone===se?eo.index:null,to=t(Qt,Jn?.props.id),[oo,ro]=fn(null);hn(()=>{oo&&(o(),ro(null))},[oo]);const io=pn(Un);io.current=Un;const lo=mn((e,{scroll:n})=>{Pt(n=>Ot(e,n)),n&&ro(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=io.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&Eo(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),so=pn(null);hn(()=>{const e=so.current;so.current=null;const n=null==Jn?.props.id?null:String(Jn.props.id);Xt(e&&e.id===n?e.mode:et(Jn?.type)??J);const t=Jn?.props.id,o=pt.current;if(pt.current=null,!t)return;const i=Un(t);lo(String(t),{scroll:!r(o,i??null,se)})},[Jn?.props.id,lo]);const co=mn(e=>{Xt(n=>U(n,e)?n:e),Wn({type:"setUi",ui:{rightSideBarVisible:!0}})},[Wn]),ao=pn(()=>{});ao.current=(e,n)=>{const t=e?Ar(e.zone??se)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==Jn?.props.id?null:String(Jn.props.id);Xt(e=>U(e,n)?e:n),o!==r&&(so.current={id:o,mode:n},ft.select(e))};const po=mn((e,n)=>ao.current(e,n),[]),uo={kind:Qt.kind,mode:Qt,open:co,show:e=>Xt(e),reveal:()=>{gt||Wn({type:"setUi",ui:{rightSideBarVisible:!0}})},select:po},fo=Y(uo,{data:Fn.data,selected:Jn??null,zoneOf:e=>Un(e)?.zone,readOnly:Boolean(Rn),select:e=>{Xt(J),ft.select({index:e})},replace:(e,n)=>ft.replaceComponent(se,e,n),scrollTo:e=>ri(e)},{device:bt,refreshes:At},{setView:Pt,reveal:()=>{mt||Wn({type:"setUi",ui:{leftSideBarVisible:!0}})}}),ho=fo.pinnedSource??!1,mo=fo.resolveLeftView?fo.resolveLeftView(It,Bt):"media"===It&&Bt?It:"sections",go=K(),{isLockedBlock:yo,duplicateBlocked:ko,nestDepth:So,newSectionNode:vo,canAddTo:xo,blockIsOffered:bo}=go,wo=Q(),{labelAtLevel:zo,Icon:Bo,useProducts:Co}=wo,No=wo.rowName?(e,n,t)=>wo.rowName(e,n,t):void 0,$o=mn(e=>{Wn({type:"setUi",ui:{rightSideBarVisible:!0}}),a(e),lo(e,{scroll:!0})},[Wn,lo]),{selectNode:To,openPartId:Oo}=x({mode:Qt,setMode:Xt,onOpenPart:$o}),[Io,Po]=fn(null);Se(null!==Io,()=>Po(null));const Ao=k(X()),Mo=Ao.collapsed,Ro=Ao.panelWidths,[jo,Eo]=fn(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(Mo);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
|
|
12
|
-
return new Set}});hn(()=>{try{window.localStorage.setItem(Mo,JSON.stringify([...jo]))}catch{}},[jo]);const[Lo,Do]=fn(()=>{if("undefined"==typeof window)return{...S};try{const e=window.localStorage.getItem(Ro);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}}});hn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(Ro,JSON.stringify(Lo))}catch{}},300);return()=>clearTimeout(e)},[Lo]);const Vo=mn((e,n)=>Do(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),Ho=mn(e=>Vo("left",e),[Vo]),Fo=mn(e=>Vo("right",e),[Vo]),Wo=e=>jo.has(e),Go=e=>Eo(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Jo=pn(!1),Uo=pn(null);hn(()=>{if(Jo.current&&!Dt){const e=Uo.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??jt.current?.querySelector(`button[aria-label="${CSS.escape(lt.add.title)}"]`))?.focus(),Uo.current=null}Jo.current=Dt},[Dt]),hn(()=>{if(!Dt||!Lt)return;const e=e=>{"Escape"===e.key&&fi()};return Lt.addEventListener("keydown",e),()=>Lt.removeEventListener("keydown",e)},[Dt,Lt]),Se(Dt,()=>fi()),hn(()=>{!mt&&Dt&&(Vt(!1),Gt(null),Ht.current=!1)},[mt]),hn(()=>{if(!Ct)return Ft.current&&Wn({type:"setUi",ui:{leftSideBarVisible:!1}}),void(Ft.current=!1);Dt&&(Vt(!1),Gt(null),Ft.current=Ht.current,Ht.current=!1),mt||(Ft.current=!0,Wn({type:"setUi",ui:{leftSideBarVisible:!0}}))},[Ct]),hn(()=>{!mt&&Ct&&(Ft.current=!1,Nt())},[mt]),hn(()=>{if(!Ct||!Lt)return;const e=e=>{"Escape"===e.key&&Nt()};return Lt.addEventListener("keydown",e),()=>Lt.removeEventListener("keydown",e)},[Ct,Lt]),Se(null!==Ct,()=>Nt());const Yo=Z(),[Ko,Qo]=fn(null),[Xo,Zo]=fn(0),_o=pn(null),qo=(e,n="success")=>{Yo?Yo(e,"error"===n?"error":"info"):(Qo({msg:e,tone:n}),Zo(e=>e+1),_o.current&&clearTimeout(_o.current),_o.current=setTimeout(()=>Qo(null),"error"===n?3200:1900))};hn(()=>()=>{_o.current&&clearTimeout(_o.current)},[]);const er=pn(null),[nr,tr]=fn(0),[or,rr]=fn(0),ir=_(),lr=pn(null),sr=e=>Math.max(0,e.clientHeight-(lr.current?.offsetHeight??0));hn(()=>{const e=er.current;if(!e)return;const n=()=>{tr(e.clientWidth),rr(sr(e))};n();const t=new ResizeObserver(n);return t.observe(e),lr.current&&t.observe(lr.current),()=>t.disconnect()},[]),gn(()=>{er.current&&(tr(er.current.clientWidth),rr(sr(er.current)))},[Lo,mt,gt]);const dr=bt===vt?nr>0?nr:kt[vt]:kt[bt],cr=nr>0?Math.min(nr/dr,"shrink"===xt?1:2):1,ar=dr*cr,pr=nr>0&&ar>nr+1,ur={width:ar,height:or||"100%",flex:"none",position:"relative"},fr={width:dr,height:or?or/cr:"100%",maxHeight:"none",transform:1!==cr?`scale(${cr})`:void 0,transformOrigin:"top left"},hr=()=>Wn({type:"setUi",ui:{leftSideBarVisible:!mt}}),mr=()=>Wn({type:"setUi",ui:{rightSideBarVisible:!gt}}),gr=e=>{Dt&&(Vt(!1),Gt(null),Ht.current=!1,mt&&It===e)||Ct&&(Ft.current=!1,Nt(),mt&&It===e)||(mt&&It===e?hr():(Pt(e),mt||Wn({type:"setUi",ui:{leftSideBarVisible:!0}})))},yr=()=>{N(Ie,{accept:"image/*",title:"Media library"})},kr=()=>{Xt(J),ft.select(null),u()},Sr=()=>{Xt(nt??J),gt||Wn({type:"setUi",ui:{rightSideBarVisible:!0}})},vr=Fn.data.content??[],xr=()=>{const e=vr.findIndex(tt),n=vr.findIndex(ot);return{floor:e>=0?e+1:0,cap:n>=0?n:vr.length}},br=Yn,wr=go.stripCopy,zr=e=>i(e,wr),Br=w(),Cr=ze({data:Fn.data,config:br,readOnly:Boolean(Rn),clipboard:Br,strip:wr?e=>wr(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==sn||e.slot!==dn)return{min:0,max:n-1};const{floor:t,cap:o}=xr();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&Xt(J);const t=void 0===n||"node"===n?.kind?n:null;ft.commitDocument(e,t)}}),Nr=e=>Yn.components[e]?.label??e,$r=mn(e=>Yn.components[e]?.defaultProps??{},[Yn]),Tr=e=>zo(e,"section",Nr(e)),Or=e=>l({type:e.type,props:e.props??{}},Tr(e.type),No),{nodeAddresses:Ir,zoneItems:Pr}=un(()=>{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>=ce)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of ae(Yn,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(vr,se,0),{nodeAddresses:e,zoneItems:n}},[vr,Yn]),Ar=mn(e=>Pr.get(e)??[],[Pr]),Mr=e=>{const n=Ir.get(e);return n?Ar(n.zone)[n.index]:void 0},Rr=e=>le(go,Yn,e),jr=e=>{if(!go.slotsOf||e===se)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=Mr(e.slice(0,n));if(!t)return null;const o=Rr(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}},Er=(()=>{if(!q(Qt))return null;const e=`${Qt.nodeId}:${Qt.slot}`;return jr(e)?.slot.panel===Qt.kind?e:null})(),Lr=pn(null);hn(()=>{const e=Lr.current;if(Lr.current=null,!Er||!q(Qt))return;const n=Qt.nodeId;lo(n,{scroll:e!==Er}),Eo(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[Qt]);const Dr=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=Ir.get(e);n&&(n.zone===se?ii(n.index):Ri(n.zone,n.index,e,Mr(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&Er!==i&&(Lr.current=i),po(null,r),gt||Wn({type:"setUi",ui:{rightSideBarVisible:!0}}),ri(o)},Vr=(e,n,t)=>{const o=`${e}:${n}`;if(Eo(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;Er!==o&&(Lr.current=o);po(null,{kind:t,nodeId:e,slot:n})},Hr=(e,n,t)=>{if(Rn||!go.moveSlot)return;const o=Mr(e),r=o?Rr(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:zn,index:n},s=Qe(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=go.moveSlot(e,n,s);"string"==typeof d&&Vr(e,d,i.panel)},Fr=Co(),Wr=un(()=>{const e=/* @__PURE__ */new Map;for(const n of Fr??[])e.set(n.slug,n.name);return e},[Fr]),Gr=e=>s(e,Nr,wo.plainText,e=>Wr.get(e),wo.rowName),Jr=(e,n)=>{const t=Yn.components[e.type]?.fields,o=n===se||qi(n)?"section":"block",r=n===se&&(tt(e)||ot(e)||_n(e.type)),i="block"===o?d(t):r?null:c(t);return wo.renamePropOf?wo.renamePropOf(e,o,i):i},Ur=(e,n,t,o)=>{if(!(!Rn&&Io?.zone===e&&Io.index===n))return;const r=(t,o)=>{Po(null),o&&((e,n,t)=>{const o=Ar(e)[n];if(!o)return;const r=Jr(o,e);r&&ft.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
|
|
13
|
-
return kn("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)},Yr=n(ee()),Kr=Yr.scope({target:We,siteId:Tn,docId:Ge}),Qr=Yn,Xr=(e,n)=>n===se?Tr(e):Nr(e),Zr=(e,n,t)=>{const o=Yr.plan(Kr,t,Xr(t.type,e),Qr);o&&(o.changed&&ft.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),qo(o.message))},_r=z({nodesIn:Ar,nodeAt:(e,n)=>Ar(e)[n]??null,labelOf:(e,n)=>n===se?Tr(e):Nr(e),renamePropOf:Jr,beginRename:(e,n)=>Po({zone:e,index:n}),history:{hasPast:Gn.hasPast,hasFuture:Gn.hasFuture,back:()=>Gn.back(),forward:()=>Gn.forward()},openAddSection:()=>{ft.select(null),pi(null)},openPageSettings:()=>{ft.select(null),Xt(J)},pageSettingsLabel:lt.pageSettings,readOnly:Boolean(Rn),collapseAll:()=>Eo(new Set(Ar(se).map(e=>String(e.props.id)))),onPasteRefused:e=>qo(e?lt.pasteRefused({name:e.label}):"Your browser won’t let us read the clipboard — press ⌘V","error"),canPasteAt:(e,n)=>nl(e,n),menuRows:fo.menuRows,isLocked:e=>yo(e.type),duplicateBlocked:e=>ko(Fn.data,e),permits:e=>de(Yn,e.type),canAddTo:xo,nodeOps:Cr,isPinned:(e,n)=>n===se&&(tt(e)||ot(e)),sectionBand:xr,openAddInside:(e,n)=>{e===se?ii(n):ft.select({zone:e,index:n}),pi(null)},locate:e=>Ir.get(e)??null,rowNameOf:(e,n)=>n===se?Or(e):Gr(e),selectAt:(e,n,t,o)=>{e===se?ii(n):Ri(e,n,t,o??"")},slotRung:e=>{const n=jr(e);return n?.slot.panel?{label:n.slot.label,select:()=>Dr(n.node,n.slot,!1)}:null},style:{held:()=>$(Kr),canCopy:e=>Yr.rows(Qr,e).some(e=>!1!==e.counted),copy:(e,n)=>Yr.copy(Kr,e,Xr(e.type,n),Qr),paste:(e,n,t)=>Zr(e,n,t)},keys:Ln?{target:Lt,selected:()=>{const e=Fn.ui.itemSelector;return e?{zone:e.zone??se,index:e.index}:null},held:()=>Br.get(),readOnly:Boolean(Rn),onDone:({done:e,name:n})=>{"copied"===e&&qo(lt.copied({name:n}))}}:void 0},Et),qr=pn({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});hn(()=>{qr.current={copy:(e,n)=>Yr.copy(Kr,e,Xr(e.type,n),Qr),paste:Zr,at:()=>{const e=Fn.ui.itemSelector;if(!e)return null;const n=e.zone??se,t=Ar(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(Rn)}});const ei=mn(e=>{const n=T(e);if(!n)return;const t=qr.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))},[]);hn(()=>{if(!Lt)return;const e=e=>ei(e);return Lt.addEventListener("keydown",e),()=>Lt.removeEventListener("keydown",e)},[ei,Lt]),_e(Et,"keydown",ei);const ni=vr.map(e=>e.props.id).join("|");hn(()=>{const e=Et?.document??null,n=Et?.window??null;let t=0;const o=[],r=()=>{if(!e)return void Kt(e=>e.length?[]:e);const n=vr.findIndex(ot),t=n>=0?n:vr.length,o=n=>{const t=vr[n]?.props?.id;return null==t?null:e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(Ze)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=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=wn(l&&s?(s.bottom+l.top)/2:l?l.top:s.bottom,Math.max(-1/0,...r(t).map(e=>e.bottom)),Math.min(1/0,...r(n).map(e=>e.top)));d&&i.push({...d,index:e})}Kt(e=>function(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t].top!==n[t].top||e[t].index!==n[t].index||e[t].height!==n[t].height)return!1;return!0}(e,i)?e:i)},i=()=>{cancelAnimationFrame(t),t=requestAnimationFrame(r)};if(!e||!n)return void r();n.addEventListener("scroll",i,{passive:!0});const l=new ResizeObserver(i);return l.observe(e.documentElement),r(),o.push(setTimeout(r,150),setTimeout(r,450)),()=>{cancelAnimationFrame(t),o.forEach(clearTimeout),n.removeEventListener("scroll",i),l.disconnect()}},[Et,ni,bt,cr,mt,gt,Jn?.props.id]);const ti=Et?.document??null,oi=Et?.window??null;hn(()=>{const e=Rt.current;if(!e||!ti||!oi)return;const n=[],t=()=>{const n=ti.querySelector(`[data-puck-component="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&oi.scrollTo({left:oi.scrollX,top:oi.scrollY+t,behavior:"instant"}),!0};return Rt.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[ti,oi]);const ri=e=>{fo.holdCanvasOn?fo.holdCanvasOn(e):a(e)},ii=e=>{Xt(J),ft.select({index:e}),fo.sectionPressed?.(vr[e]);const n=vr[e]?.props?.id;n&&ri(n)},li=e=>{const{floor:n,cap:t}=xr(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=Jn&&Qt.kind!==nt?.kind?vr.findIndex(e=>e.props.id===Jn.props.id):-1;return o(r>=0?r+1:t)},si=(e,n)=>{const{floor:t,cap:o}=xr(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(ft.reorderComponent(se,e,i),ft.select({index:i}),{moved:!0,dest:i})},di=(e,n,t,o)=>{Xt(J),ft.select(o?{index:o.index,zone:o.zone}:{index:e}),a(n),qo(`Added “${t}” section`)},ci=(e,n)=>{const t=li(n),o=vo(e,{nodeDefaults:$r,newNodeId:he,sectionLabel:Tr,blockIsOffered:bo}),r=o?ft.insertNode(se,t,o):ft.insertSection(e,t);return di(t,r,Tr(e),o?((e,n,t)=>{if(e.type===t)return null;const o={at:null},r=(e,n,i)=>{const l=i.filter(n=>n===e.type).length;for(const{child:s,zone:d,index:c}of ae(Yn,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=xo(e.type,l,d.slice(d.lastIndexOf(":")+1)),i=r?.choices??(r?.spec?[{type:r.spec.childType,label:r.spec.childType}]:[]);null!==r&&"footer"!==r.source&&`${e.props.id}:${r.slot}`===d&&i.some(e=>e.type===t)&&(o.at={zone:d,index:c,depth:n})}r(s,n+1,[...i,e.type])}};return r({type:e.type,props:{...e.props,id:n}},1,[]),o.at?{zone:o.at.zone,index:o.at.index}:null})(o,r,e):null),t},ai=(e,n,t)=>{const o=li(t),r=ft.insertNode(se,o,n);return di(o,r,e),o},pi=e=>ui(se,e),ui=(e,n)=>{Uo.current=document.activeElement??null,Ct&&(Ht.current=Ft.current,Ft.current=!1,Nt()),Gt(null===n?null:{zone:e,index:n}),Vt(!0),mt||(Ht.current=!0,Wn({type:"setUi",ui:{leftSideBarVisible:!0}}))},fi=()=>{Vt(!1),Gt(null),Ht.current&&Wn({type:"setUi",ui:{leftSideBarVisible:!1}}),Ht.current=!1},hi=(e,n,t)=>{if("section"===e.kind)ft.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;ft.insertNode(n,t,zr(e.template.node))}Xt(J),ft.select({index:t,zone:n})},mi=(e,n)=>wo.rowName?n?tt(e)?wo.rowName(e,"section",lt.header):ot(e)?wo.rowName(e,"section",lt.footer):_n(e.type)?wo.rowName(e,"section",Nr(e.type)):Or(e):Gr(e):n?Tr(e.type):Nr(e.type),gi=e=>n=>{n.target.closest(".es-tree-select")||e()},yi=()=>fo.editPinnedSource?.(),ki=(e,n,t)=>{if(Rn)return null;const o=Ar(e)[n];return o&&!de(Yn,o.type).delete?null:/* @__PURE__ */kn(Te,{kind:"delete",label:`Delete ${t}`,onClick:()=>((e,n)=>{const t=Ar(e)[n]?.props?.id;null!=t&&Cr.remove(String(t))})(e,n),children:/* @__PURE__ */kn(on,{size:15})})},Si=e=>wo.rowPreview?.(e)||void 0,vi=e=>wo.rowMarks?.(e)??void 0,xi=(e,n,t)=>wo.rowActions?.(e,n,t)??null,bi=(e,n,t,o)=>{if(Rn)return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
|
|
14
|
-
return kn(Te,{kind:"eye",label:r?`Show ${o}`:`Hide ${o}`,onClick:()=>zi(e,n,t),children:/* @__PURE__ */kn(y,r?{name:"eye-off",size:14}:{name:"eye",size:14})})},wi=e=>{const n=Tr(vr[e]?.type??""),t=n?lt.addSectionBefore({name:n}):lt.addSectionHere;return xl(se,e,()=>pi(e),t)},zi=(e,n,t)=>{ft.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},Bi=e=>pe(Yn,e),Ci=e=>ae(Yn,e),Ni=e=>go.slotsOf?Rr(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:ue(e,n.slot)})):[{slot:null,rung:null,kids:Ci(e)}],$i=e=>go.slotsOf?Ni(e).flatMap(e=>e.kids):Ci(e),Ti=e=>Boolean(go.slotsOf)&&Rr(e).some(e=>e.rung),Oi=(e,n,t)=>null===t?void 0===n?xo(e):xo(e,n):xo(e,n,t),Ii=(e,n,t)=>{const o=fe(Yn,e.type,n)&&(t||$i(e).length>0||Ti(e));return{collapsible:o,folded:o&&Wo(String(e.props.id))}},Pi=(e,n,t)=>Ni(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>Ii(e,r,t(e.type)).collapsible?[String(e.props.id),...Pi(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),Ai=e=>$i(e).length>0||Ti(e)||Boolean(xo(e.type)),Mi=e=>Boolean(xo(e)),Ri=(e,n,t,o)=>{if(Xt(J),xo(o)?.spec?.slider){const t=e.split(":")[0];p(t,n),ft.select({index:n,zone:e}),a(t)}else ft.select({index:n,zone:e}),ri(t)},ji=(e,n,t,o,r)=>{const i=`${e}:${n}`;ft.insertComponent(i,t,o),xo(r)?.spec?.slider?requestAnimationFrame(()=>{p(e,o),ft.select({index:o,zone:i})}):ft.select({index:o,zone:i})},Ei=(e,n,t)=>{ft.insertComponent(e,n,t),Xt(J),ft.select({index:t,zone:e})},Li=pn(/* @__PURE__ */new Set);hn(()=>{vr.forEach(e=>{const n=xo(e.type)?.spec;if(!n)return;const t=e.props.id;if(Li.current.has(t))return;Li.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($r)).forEach((e,t)=>ft.seedChild(o,t,n.childType,e))})},[vr,ft,$r]);const Di=pn(/* @__PURE__ */new Set);hn(()=>{vr.forEach((n,t)=>{const o=n.props.id;if(Di.current.has(o))return;const r=e(n,Bi(n.type));Di.current.add(o),r&&ft.replaceComponent(se,t,{...n,props:r})})},[vr,ft]),ne(ft,Yn);const Vi=vr.findIndex(ot),Hi=Vi>=0?vr[Vi]:null,Fi=rt?vr.findIndex(tt):-1,Wi=Fi>=0?vr[Fi]:null,Gi=vr.find(e=>e.type===Xn)??null,Ji=vr.find(e=>e.type===Zn)??null,Ui=Vi>=0?Vi:vr.length,Yi=[];vr.forEach(e=>{ot(e)||(Ai(e)&&Yi.push(String(e.props.id)),Yi.push(...Pi(e,1,Mi)))}),Hi&&(Yi.push(String(Hi.props.id)),Yi.push(...Pi(Hi,1,Mi)));const Ki=Yi.length>0&&Yi.every(e=>jo.has(e)),Qi=e=>{const n=wo.blockRowName(e,Nr);return wo.rowName?wo.rowName(e,"block",n):n},Xi=(e,n,t,o)=>{const r=Ar(e)[t];if(!r)return;const i={...cn(e),index:t},l={...cn(n),index:Math.min(Math.max(o,0),Ar(n).length)},s=Qe(i,l);if(e!==n||s!==t)try{Cr.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof an))throw e}},Zi=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of Ci(e))n.add(r),t(o)};for(const t of Bi(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},_i=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Ir.get(n);if(!e)return null;if(e.zone===se)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},qi=e=>{const n=e.slice(0,e.indexOf(":")),t=vr.find(e=>_n(e.type)&&String(e.props.id)===n);return t&&qn(n)===e?t:null},el=(e,n,t)=>{if(e.rung){const t=Mr(e.rung.nodeId),o=t?Rr(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===zn&&n.index>=0&&n.index<=o}if(n.slot===zn)return!1;if(e.add)return ol(e.add,n);const o=ln(n);if(_n(e.type))return!1;const r=qi(o),i=qi(e.zone);if(r||i)return!(!r||!i)&&(n.index>=0&&n.index<=Ar(o).length);if(e.zone===se||o===se){if(e.zone!==o)return!1;const{floor:t,cap:r}=xr();return n.index>=t&&n.index<=r}if(n.index<0||n.index>Ar(o).length)return!1;if(e.zone===o)return!0;const l=Hi&&!Kn.lastIsOpen?String(Hi.props.id):null;return(!l||_i(e.zone)!==l&&_i(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??Ar(e)[t];if(!r)return!1;const i=n.split(":")[0],l=Ir.get(i),s=l?Ar(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&Zi(r).has(n))return!1;const d=xo(s.type,So(Fn?.data,s.type,i),n.slice(n.lastIndexOf(":")+1));return!!d&&(!!(d.choices?d.choices.some(e=>e.type===r.type):d.spec?.childType===r.type)&&!d.spec?.addBlocked?.(Ar(n),r))})(e.zone,o,e.index,t)},nl=(e,n)=>{const t=ln(e.from);if(t===ln(n))return!0;const o=e.node;return el({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},tl=e=>{const n=e.slice(0,e.indexOf(":")),t=Ir.get(n),o=t?Ar(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=xo(o.type,So(Fn?.data,o.type,n),e.slice(e.lastIndexOf(":")+1));if(!r||`${n}:${r.slot}`!==e)return null;if("footer"===r.source)return null;const i=r.choices??(r.spec?[{type:r.spec.childType,label:Nr(r.spec.childType)}]:[]),l=jr(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:mi(o,t.zone===se)}},ol=(e,n)=>{const t=ln(n);if("block"!==e.kind){if(qi(t))return n.index>=0&&n.index<=Ar(t).length;if(t!==se)return!1;const{floor:e,cap:o}=xr();return n.index>=e&&n.index<=o}if(t===se)return!1;const o=tl(t);return!(!o||!o.choices.some(n=>n.type===e.type))&&!o.target.spec?.addBlocked?.(Ar(t))},rl=(e,n)=>{e.rung?Hr(e.rung.nodeId,e.index,n.index):e.add?((e,n)=>{if("block"!==e.kind&&qi(ln(n)))return void hi(e,ln(n),n.index);if("section"===e.kind)return void ci(e.type,n.index);if("template"===e.kind)return void ai(e.template.name,zr(e.template.node),n.index);const t=ln(n),o=tl(t);o&&(o.target.spec?ji(o.parentId,o.target.slot,e.type,n.index,o.parent.type):Ei(t,e.type,n.index))})(e.add,n):e.zone===se?si(e.index,n.index):Xi(e.zone,ln(n),e.index,n.index)},[il]=fn(()=>Ye()),ll=Ke({keyOf:e=>e.id,readOnly:Boolean(Rn),session:il,canDrop:el,onDrop:rl,onStep:(e,n)=>{e.rung?Hr(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===se?((e,n)=>{const t=Tr(vr[e]?.type??""),o=si(e,n<0?e-1:e+2);if(!o.moved)return void qo(`“${t}” is already ${n<0?"first":"last"}`);const{floor:r,cap:i}=xr();qo(`Moved “${t}” to position ${o.dest-r+1} of ${i-r}`)})(e.index,n):Xi(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),sl=mn(e=>{const{floor:n,cap:t}=xr(),o=[];for(const r of e.nodes){const e=ln(r.place),i=Ar(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(tt(i)||ot(i)||yo(i.type))continue;if(_n(i.type))continue;const l=Boolean(qi(e)),s=e===se||l;e===se&&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?Tr(i.type):Gr(i),from:r.place})}return{sources:o,zones:e.zones.filter(e=>e.children.length>0||Boolean(tl(ln(e.list))?.choices.length)||Boolean(qi(ln(e.list))))}},[Fn.data]),dl=e=>{Xt(J),ft.select(e.zone===se?{index:e.index}:{index:e.index,zone:e.zone})},cl=te(),al=()=>({data:Fn.data,device:bt,ops:ft,inspector:uo}),pl=cl?.model,ul=un(()=>pl?e=>pl(e,sl(e),al()):sl,[pl,sl,bt]),fl=cl?.measure,hl=fl?(e,n)=>fl(e,n,al()):void 0,ml=cl?.canDrop,gl=ml?(e,n)=>ml(e,n,el,al()):el,yl=cl?.drop,kl=yl?(e,n)=>yl(e,n,rl,al()):rl,Sl=cl?.pick,vl=Sl?e=>Sl(e,dl,al()):dl,xl=(e,n,t,o)=>/* @__PURE__ */kn(Oe,{...Rn?{}:ll.seam({place:{...cn(e),index:n}}),onAdd:Rn?void 0:t,label:o},`seam:${e}:${n}`),bl={rowClick:gi,isCollapsed:Wo,toggleCollapse:Go},wl=e=>{const n=String(e.props.id),t=vr.findIndex(e=>String(e.props.id)===n),o=qn(n),r=Ar(o),i=Wo(n),l=Nr(e.type),s=wo.rowName?wo.rowName(e,"section",l):l,d=e=>xl(o,e,()=>ui(o,e),lt.addSectionHere);/* @__PURE__ */
|
|
15
|
-
return Sn(vn,{children:[
|
|
16
|
-
/* @__PURE__ */kn(Be,{icon:/* @__PURE__ */kn(Bo,{type:e.type,size:13}),name:s,preview:Si(e),marks:vi(e),onSelect:()=>ii(t),nameSlot:Ur(se,t,n,s),selected:to===n,actions:xi(e,se,t)??void 0,rowProps:{"data-node-id":n,onClick:gi(()=>ii(t))},fold:{open:!i,label:"section",onToggle:()=>Go(n)}}),!i&&/* @__PURE__ */Sn(Ce,{children:[r.map((n,t)=>{const r=String(n.props.id),i=Or(n),l=Ai(n),s=l&&Wo(r),c=()=>Ri(o,t,r,e.type),{rowProps:a,...p}=ll.row({item:{id:r,zone:o,index:t,type:n.type},place:{...cn(o),index:t}},{"data-node-id":r,onClick:gi(c)});/* @__PURE__ */
|
|
17
|
-
return Sn(yn,{children:[d(t),
|
|
18
|
-
/* @__PURE__ */kn(Be,{icon:/* @__PURE__ */kn(Bo,{type:n.type,size:13}),name:i,preview:Si(n),marks:vi(n),onSelect:c,nameSlot:Ur(o,t,r,i),selected:to===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Go(r)}:void 0,actions:/* @__PURE__ */Sn(vn,{children:[ki(o,t,i),xi(n,o,t),bi(o,t,n,i)]}),rowProps:a}),l&&!s&&/* @__PURE__ */kn(Ce,{children:Cl(n,2)})]},r)}),d(r.length)]})]})},zl=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=ll.dragging,d=!Wo(l)&&s?.rung?.nodeId!==i,c={...cn(l),index:0},a=s&&!s.rung&&el(s,c)?c:void 0,p=()=>Dr(e,n,!0),{rowProps:u,...f}=ll.row({item:{id:`rung:${l}`,zone:`${i}:${zn}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:zn,index:t},into:a,canDrag:Boolean(go.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:gi(p)}),h=Rn?null:go.slotActions?.(e,n.slot);/* @__PURE__ */
|
|
19
|
-
return Sn(yn,{children:[n.heading,
|
|
20
|
-
/* @__PURE__ */kn(Be,{icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:Er===l,...f,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>Go(l)},actions:h&&h.length>0?/* @__PURE__ */kn(vn,{children:h.map((t,o)=>/* @__PURE__ */kn(Te,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(Rn||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&Vr(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__ */kn(on,{size:15}):/* @__PURE__ */kn(rn,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */kn(Ce,{children:r})]},l)},Bl=(e,n)=>{const t=Ni(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
|
|
21
|
-
return kn(vn,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=Oi(e.type,void 0,t.slot),d=s?`${e.props.id}:${s.slot}`:null,c=null===t.slot?null:`${e.props.id}:${t.slot}`,a=null!==c&&Boolean(tl(c)?.choices.length),p=(e,n)=>a?xl(e,n,()=>ui(e,n),"Add block here"):xl(e,n),u=/* @__PURE__ */Sn(vn,{children:[i.map(({child:n,zone:t,index:o})=>{const r=to===String(n.props.id),{collapsible:i,folded:s}=Ii(n,l,Mi(n.type)),d=String(n.props.id),c=Qi(n),a=()=>Ri(t,o,d,e.type),{rowProps:u,...f}=ll.row({item:{id:d,zone:t,index:o,type:n.type},place:{...cn(t),index:o}},{"data-node-id":d,onClick:gi(a)});/* @__PURE__ */
|
|
22
|
-
return Sn(yn,{children:[0===o&&p(t,0),
|
|
23
|
-
/* @__PURE__ */kn(Be,{icon:/* @__PURE__ */kn(Bo,{type:n.type,size:13}),name:c,preview:Si(n),marks:vi(n),onSelect:a,nameSlot:Ur(t,o,d,c),selected:r,hidden:Boolean(n.props._hidden),...f,fold:i?{open:!s,label:"group",onToggle:()=>Go(d)}:void 0,actions:/* @__PURE__ */Sn(vn,{children:[ki(t,o,c),xi(n,t,o),bi(t,o,n,c)]}),rowProps:u}),i&&!s&&/* @__PURE__ */kn(Ce,{children:Bl(n,l+1)}),p(t,o+1)]},String(n.props.id??`${t}-${o}`))}),null===c?d&&!i.some(e=>e.zone===d)?p(d,0):null:0!==i.length||!t.rung&&d!==c?null:p(c,0)]});return t.rung?zl(e,t.rung,r++,o,u):/* @__PURE__ */kn(yn,{children:u},t.slot??"")})})},Cl=(e,n)=>{const t=So(Fn?.data,e.type,String(e.props.id)),o=Ni(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
|
|
24
|
-
return kn(vn,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=Oi(e.type,t,o.slot),c=d?.spec??null,a=c&&Array.isArray(e.props[c.slot])?e.props[c.slot]:[],p=d&&d.choices?{slot:d.slot,choices:d.choices}:null,u=String(e.props.id),f=c&&!c.fixed?`${u}:${c.slot}`:null,h=p?`${u}:${p.slot}`:null,m=(n,t)=>{const o=n===f&&c&&!c.addBlocked?.(a)?()=>ji(e.props.id,c.slot,c.childType,t,e.type):n===h?()=>ui(n,t):void 0;return xl(n,t,o,n===f&&c?c.addLabel:"Add block here")},g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(c&&!c.fixed&&(null===g||g===f)),k=/* @__PURE__ */Sn(vn,{children:[l.map(({child:n,zone:t,index:o})=>{const r=to===String(n.props.id),i=Gr(n),l=String(n.props.id),{collapsible:d,folded:c}=Ii(n,s,Mi(n.type)),a=Bi(n.type),p=1===a.length?`${l}:${a[0]}`:null,u=p?{...cn(p),index:Ar(p).length}:void 0,f=ll.dragging,h=u&&f&&el(f,u)?u:void 0,g=()=>Ri(t,o,l,e.type),{rowProps:y,...k}=ll.row({item:{id:l,zone:t,index:o,type:n.type},place:{...cn(t),index:o},into:h,canDrag:!yo(n.type)},{"data-node-id":l,onClick:gi(g)});/* @__PURE__ */
|
|
25
|
-
return Sn(yn,{children:[0===o&&m(t,0),
|
|
26
|
-
/* @__PURE__ */kn(Be,{icon:/* @__PURE__ */kn(Bo,{type:n.type,size:13}),name:i,preview:Si(n),marks:vi(n),onSelect:g,nameSlot:Ur(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...k,fold:d?{open:!c,label:"group",onToggle:()=>Go(l)}:void 0,actions:yo(n.type)?xi(n,t,o)??void 0:/* @__PURE__ */Sn(vn,{children:[ki(t,o,i),xi(n,t,o),bi(t,o,n,i)]}),rowProps:y}),d&&!c&&/* @__PURE__ */kn(Ce,{children:Cl(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&c&&
|
|
27
|
-
/* @__PURE__ */kn(O,{small:!0,label:c.addLabel,blocked:c.addBlocked?.(a)??null,onAdd:()=>ji(e.props.id,c.slot,c.childType,a.length,e.type)}),null===g?h&&!l.some(e=>e.zone===h)?m(h,0):null:0!==l.length||(o.rung?y:g!==h)?null:m(g,0)]});return o.rung?zl(e,o.rung,i++,r,k):/* @__PURE__ */kn(yn,{children:k},o.slot??"")})})},Nl=(()=>{if(!Jn||!Zt)return null;const e=String(Jn.type),n=String(Jn.props.id),t=xo(e,So(Fn?.data,e,n));if(!t||"footer"===t.source)return null;const o=vr.some(e=>String(e.props?.id)===n),r=Array.isArray(Jn.props[t.slot])?Jn.props[t.slot]:[];if(t.spec?.addBlocked?.(r))return null;const i=t.choices??(t.spec?[{type:t.spec.childType,label:Nr(t.spec.childType)}]:[]);return 0===i.length?null:{parentName:mi(Jn,o),choices:i,onPick:o=>{t.spec?ji(n,t.slot,o,r.length,e):Ei(`${n}:${t.slot}`,o,r.length)}}})(),$l=eo&&eo.zone!==se&&!qi(eo.zone)?eo.zone:null,Tl=!0===Jt.blocksFirst,Ol=$l?tl($l):Tl&&eo?null:Nl,Il=Boolean(Wt&&$l)||Tl&&Boolean(Ol&&Ol.choices.length>0),Pl=Dt||null!==Ct,Al=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:mt&&!Pl&&mo===e.id,onSelect:()=>gr(e.id)}:e,Ml=[{id:"add",label:lt.add.title,icon:/* @__PURE__ */kn("span",{className:"sf-rail-plus","aria-hidden":"true",children:"+"}),active:Dt,onSelect:()=>Dt?fi():pi(null)},...(fo.railLead??[]).map(Al),{id:"sections",label:"Layers",icon:/* @__PURE__ */kn(qe,{}),active:mt&&!Pl&&"sections"===mo,onSelect:()=>gr("sections")},...(fo.railTrail??[]).map(Al)];Bt?Ml.push({id:"media",label:lt.railMedia,icon:/* @__PURE__ */kn(en,{}),active:mt&&!Dt&&(null!==Ct||"media"===mo),onSelect:()=>gr("media")}):Dn&&Ml.push({id:"media",label:lt.railMedia,icon:/* @__PURE__ */kn(en,{}),onSelect:yr});const Rl=[...fo.railLead??[],...fo.railTrail??[]].find(e=>"panel"in e&&e.id===mo),jl=Boolean(it?.foldable)&&!ho,El=it?.label??(Vn?lt.pageSections:lt.templateSections),Ll=jl&&Wo(Bn),Dl=/* @__PURE__ */Sn(vn,{children:[vr.map((e,n)=>{if(tt(e)||ot(e)||_n(e.type))return null;const t=to===String(e.props.id),o=Boolean(e.props._hidden);Ci(e);const r=String(e.props.id),i=fo.hasOwnRows?.(e)??!1,l=Ai(e)||i,s=l&&Wo(r),{rowProps:d,...c}=ll.row({item:{id:r,zone:se,index:n,type:e.type},place:{...cn(se),index:n}},{"data-node-id":r,onClick:gi(()=>ii(n))});/* @__PURE__ */
|
|
28
|
-
return Sn(yn,{children:[n>0&&wi(n),
|
|
29
|
-
/* @__PURE__ */kn(Be,{icon:/* @__PURE__ */kn(Bo,{type:e.type,size:13}),name:Or(e),preview:Si(e),marks:vi(e),onSelect:()=>ii(n),nameSlot:Ur(se,n,r,Or(e)),selected:t,hidden:o,...c,fold:l?{open:!s,label:"section",onToggle:()=>Go(r)}:void 0,actions:/* @__PURE__ */Sn(vn,{children:[ki(se,n,Or(e)),xi(e,se,n),bi(se,n,e,Or(e))]}),rowProps:d}),Ai(e)&&!s&&/* @__PURE__ */Sn(Ce,{children:[Cl(e,1),fo.partRows?.(e,bl)]}),i&&!s&&/* @__PURE__ */kn(Ce,{children:fo.ownRows?.(e,n,bl)})]},String(e.props.id??n))}),!ho&&Ui>0&&wi(Ui),it?.addAtEnd&&!ho&&!Rn&&/* @__PURE__ */kn(O,{small:!0,label:lt.addSection,blocked:null,onAdd:()=>pi(Ui)})]}),Vl=(e,n,t)=>{const o=String(e.props.id),r=$i(e).length>0||Ti(e)||Boolean(xo(e.type)),i=r&&Wo(o),l="header"===t?lt.header:lt.footer,s=wo.rowName?wo.rowName(e,"section",l):l;/* @__PURE__ */
|
|
30
|
-
return Sn(vn,{children:[
|
|
31
|
-
/* @__PURE__ */kn(Be,{icon:/* @__PURE__ */kn(Bo,{type:t,size:13}),name:s,preview:Si(e),marks:vi(e),onSelect:()=>ii(n),nameSlot:Ur(se,n,o,s),selected:to===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Go(o)}:void 0,actions:xi(e,se,n)??void 0,rowProps:{"data-node-id":o,onClick:gi(()=>ii(n))}}),r&&!i&&/* @__PURE__ */kn(Ce,{children:Bl(e,1)})]})};return(fo.wrap??(e=>e))(
|
|
32
|
-
/* @__PURE__ */kn(oe,{target:Et,children:/* @__PURE__ */Sn("div",{ref:jt,className:"sf-editor es-editor",style:Fe(Lo),onContextMenu:_r.onEditorContextMenu,...m(Ie),children:[
|
|
33
|
-
/* @__PURE__ */Sn(Pe,{children:[
|
|
34
|
-
/* @__PURE__ */kn(Ae,{items:Ml,ariaLabel:"Left panel views"}),
|
|
35
|
-
/* @__PURE__ */Sn(Me,{children:[
|
|
36
|
-
/* @__PURE__ */kn(Re,{label:"Undo",disabled:Boolean(Rn)||!Gn.hasPast,onClick:()=>Gn.back(),children:/* @__PURE__ */kn(nn,{})}),
|
|
37
|
-
/* @__PURE__ */kn(Re,{label:"Redo",disabled:Boolean(Rn)||!Gn.hasFuture,onClick:()=>Gn.forward(),children:/* @__PURE__ */kn(tn,{})}),
|
|
38
|
-
/* @__PURE__ */kn(je,{}),
|
|
39
|
-
/* @__PURE__ */kn(Ee,{devices:yt,value:bt,onChange:wt})]}),
|
|
40
|
-
/* @__PURE__ */Sn(Me,{kind:"right",style:{minWidth:300},children:[
|
|
41
|
-
/* @__PURE__ */kn(xn,{saveState:In,notSaving:Boolean(Rn)||null!=Pn,readOnlyReason:jn,toggle:En,onToggle:Mn,onRetry:An}),fo.barLead?.(),
|
|
42
|
-
/* @__PURE__ */kn("button",{type:"button",className:"es-btn-ghost",title:"Refresh the preview (reloads the canvas, keeps your place)",onClick:()=>{Rt.current=(()=>{const e=Et?.document;if(!e)return null;const n=vr.findIndex(ot),t=n>=0?n:vr.length;let o=null;for(let n=0;n<t;n++){const t=vr[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=Jn?.props?.id??vr[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),Mt(e=>e+1)},children:"Refresh"}),fo.barTrail?.(),fo.barMain?fo.barMain():/* @__PURE__ */kn("button",{type:"button",className:"es-btn-primary",disabled:null!==jn,onClick:()=>{On(Fn.data)},children:lt.done})]})]}),
|
|
43
|
-
/* @__PURE__ */kn(B,{}),
|
|
44
|
-
/* @__PURE__ */Sn("div",{className:"sf-body",children:[mt?/* @__PURE__ */Sn(vn,{children:[
|
|
45
|
-
/* @__PURE__ */kn("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":lt.leftPanel,children:Dt?/* @__PURE__ */kn(I,{blocks:Ol,blocksOnly:Il,at:Wt?{label:(e=>{const n=qi(e.zone);if(n)return lt.add.addingTo({name:wo.rowName?mi(n,!0):Nr(n.type)});if(e.zone===se){const n=vr[e.index];return n&&!ot(n)?lt.add.addingBefore({name:mi(n,!0)}):lt.add.addingAtEnd}const t=tl(e.zone);return t?lt.add.addingTo({name:t.parentName}):lt.add.addingHere})(Wt),onClear:()=>Gt(null)}:void 0,onAdd:e=>{const n=eo,t=(e,n)=>{Wt&&Gt({zone:e,index:n})};if(n&&"block"!==e.kind&&qi(n.zone))return hi(e,n.zone,n.index),void t(n.zone,n.index+1);if("section"===e.kind)return(e=>{if(null===no)return void ci(e);const n=ci(e,no);Wt&&Ut(n+1)})(e.type);if("template"===e.kind)return((e,n)=>{if(null===no)return void ai(e,n);const t=ai(e,n,no);Wt&&Ut(t+1)})(e.template.name,zr(e.template.node));if(n&&n.zone!==se){const o=tl(n.zone);if(!o)return;return o.target.spec?ji(o.parentId,o.target.slot,e.type,n.index,o.parent.type):Ei(n.zone,e.type,n.index),void t(n.zone,n.index+1)}Nl?.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:il,siteWide:fo.addPanelRow?.(fi),onClose:fi,onHide:hr,readOnly:Boolean(Rn)}):Ct&&zt?
|
|
46
|
-
/* @__PURE__ */kn(M,{panel:zt,pick:Ct,onHide:hr}):Rl?Rl.panel({onHide:hr,notify:qo}):"media"===mo&&zt?/* @__PURE__ */kn(M,{panel:zt,pick:null,onHide:hr}):/* @__PURE__ */Sn(vn,{children:[
|
|
47
|
-
/* @__PURE__ */kn(P,{icon:/* @__PURE__ */kn(qe,{}),title:"Layers",context:st,actions:Yi.length>0?/* @__PURE__ */kn(Le,{label:Ki?"Expand all sections":"Collapse all sections",onClick:()=>Eo(e=>{const n=new Set(Yi);return Ki?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...Yi])}),children:/* @__PURE__ */kn(bn,{expand:Ki})}):void 0,onHide:hr}),
|
|
48
|
-
/* @__PURE__ */Sn(Ne,{className:"sf-tree sf-scroll",children:[
|
|
49
|
-
/* @__PURE__ */kn(Be,{icon:/* @__PURE__ */kn(Bo,{type:"page",size:13}),name:lt.pageSettings,onSelect:kr,selected:!Jn&&Zt,rowProps:{onClick:gi(kr)}}),Gi&&/* @__PURE__ */Sn(vn,{children:[
|
|
50
|
-
/* @__PURE__ */kn($e,{children:lt.header}),wl(Gi)]}),!ho&&Hn&&/* @__PURE__ */Sn(vn,{children:[
|
|
51
|
-
/* @__PURE__ */kn($e,{children:lt.header}),!rt&&/* @__PURE__ */kn(Be,{icon:/* @__PURE__ */kn(Bo,{type:"header",size:13}),name:lt.header,onSelect:Sr,selected:Qt.kind===nt?.kind,rowProps:{onClick:gi(Sr)}})]}),!ho&&Wi&&Vl(Wi,Fi,"header"),!ho&&!jl&&/* @__PURE__ */kn($e,{children:El}),jl?/* @__PURE__ */Sn(vn,{children:[
|
|
52
|
-
/* @__PURE__ */kn(Be,{icon:null,name:El,fold:{open:!Ll,label:El,onToggle:()=>Go(Bn)}}),!Ll&&/* @__PURE__ */kn(Ce,{children:Dl})]}):Dl,Hn&&/* @__PURE__ */kn($e,{children:lt.footer}),Hi&&Vl(Hi,Vi,"footer"),!ho&&!Hi&&Hn&&/* @__PURE__ */kn(Be,{icon:/* @__PURE__ */kn(Bo,{type:"footer",size:13}),name:lt.footer,onSelect:yi,rowProps:{onClick:gi(yi),title:"Edit the site footer"}}),Ji&&wl(Ji),fo.treeFoot?.()]})]})}),
|
|
53
|
-
/* @__PURE__ */kn(De,{side:"left",width:Lo.left,min:He,max:Ve,defaultWidth:S.left,label:lt.resizeLeftPanel,onResize:Ho})]}):/* @__PURE__ */kn(A,{side:"left",onShow:hr}),
|
|
54
|
-
/* @__PURE__ */Sn("div",{ref:er,className:"sf-center sf-scroll","data-sf-canvas-head":ir?"":void 0,style:{overflowX:pr?"auto":"hidden",overflowY:"hidden"},children:[ir&&/* @__PURE__ */kn("div",{ref:lr,className:"sf-canvas-head",children:/* @__PURE__ */kn(ir,{device:bt})}),
|
|
55
|
-
/* @__PURE__ */kn("div",{className:"sf-frame-scaler",style:ur,children:/* @__PURE__ */kn("div",{className:"sf-frame "+(bt===vt?"":`sf-frame--${bt}`),style:fr,children:/* @__PURE__ */Sn("div",{className:"sf-preview-host",children:[
|
|
56
|
-
/* @__PURE__ */kn(dt,{},At),
|
|
57
|
-
/* @__PURE__ */kn(Ue,{canvas:Et,session:il,model:ul,measure:hl,canDrop:gl,onDrop:kl,onPick:vl,onZoneAdd:e=>{const n=ln(e),t=jr(n);t&&Dr(t.node,t.slot,!1),ui(n,0)},zoneAddLabel:lt.canvasAddBlock,readOnly:Boolean(Rn),revision:Fn.data}),Yt.length>0&&/* @__PURE__ */kn("div",{className:"sf-preview-gaps","aria-hidden":"true",children:Yt.map(e=>/* @__PURE__ */Sn("button",{type:"button",tabIndex:-1,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},title:"Add section here",onClick:()=>pi(e.index),children:[
|
|
58
|
-
/* @__PURE__ */kn("span",{className:"sf-preview-gap-line"}),
|
|
59
|
-
/* @__PURE__ */Sn("span",{className:"sf-preview-gap-pill",children:[
|
|
60
|
-
/* @__PURE__ */kn("span",{className:"sf-preview-gap-plus",children:"+"}),
|
|
61
|
-
/* @__PURE__ */kn("span",{className:"sf-preview-gap-label",children:"Add section"})]})]},e.index))})]})})})]}),gt?/* @__PURE__ */Sn(vn,{children:[
|
|
62
|
-
/* @__PURE__ */kn(g,{value:{selectChild:Ri,addChild:ji,childRowName:Gr,blockRowName:Qi},children:/* @__PURE__ */kn(ct,{mode:Qt,onOpenWebsiteSettings:fo.openSettings??(()=>{}),onOpenSiteStyles:fo.openStyles,onSelectNode:To,onNotify:qo,onHidePanel:mr,nodeActions:Jn?de(Yn,Jn.type):Cn})}),
|
|
63
|
-
/* @__PURE__ */kn(De,{side:"right",width:Lo.right,min:He,max:Ve,defaultWidth:S.right,label:"Resize settings panel",onResize:Fo})]}):
|
|
64
|
-
/* @__PURE__ */kn(A,{side:"right",onShow:mr})]}),Ko&&/* @__PURE__ */Sn("div",{className:"sf-toast "+("error"===Ko.tone?"sf-toast--error":""),role:"status",children:[
|
|
65
|
-
/* @__PURE__ */kn("span",{className:"sf-toast-check","aria-hidden":"true",children:"error"===Ko.tone?"!":"✓"}),Ko.msg]},Xo),_r.menu]})}))}export{Nn as ScreenChrome};
|
package/dist/chunk-3EDSDPIP.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={dragHint:"Drag to move · ⌥↑ ⌥↓",collapse:"Collapse",expand:"Expand",collapseNamed:({label:e})=>`Collapse ${e}`,expandNamed:({label:e})=>`Expand ${e}`,emptySlot:"No blocks yet",addBlock:"Add a block",dropHere:"Drop here"};export{e as DEFAULT_TREE_WORDS};
|
package/dist/chunk-3QVB4AG2.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{jsxs as l,jsx as s}from"react/jsx-runtime";function e({label:e,blocked:t,onAdd:n,small:a=!1}){/* @__PURE__ */
|
|
2
|
-
return l("button",{type:"button",className:"sf-add-card",disabled:null!==t,title:t??void 0,onClick:n,children:[
|
|
3
|
-
/* @__PURE__ */s("span",{className:a?"sf-plus sf-plus--sm":"sf-plus",children:"+"}),e]})}export{e as AddChildRow};
|
package/dist/chunk-3WSPDAK2.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function t(t){"undefined"!=typeof document&&document.documentElement.setAttribute("data-editor-theme","light")}export{t as applyEaselChromeTheme};
|
package/dist/chunk-5MZ3RNQQ.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as r,Fragment as a}from"react/jsx-runtime";var t={eye:/* @__PURE__ */r(a,{children:[
|
|
2
|
-
/* @__PURE__ */e("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7S2 12 2 12z"}),
|
|
3
|
-
/* @__PURE__ */e("circle",{cx:"12",cy:"12",r:"2.6"})]}),"eye-off":/* @__PURE__ */e("path",{d:"M3 3l18 18M10.6 10.6a2 2 0 002.8 2.8M9.4 5.2A9.7 9.7 0 0112 5c7 0 10 7 10 7a16 16 0 01-3.6 4.4M6.1 6.1A16 16 0 002 12s3 7 10 7a9.6 9.6 0 004.1-.9"}),search:/* @__PURE__ */r(a,{children:[
|
|
4
|
-
/* @__PURE__ */e("circle",{cx:"11",cy:"11",r:"7"}),
|
|
5
|
-
/* @__PURE__ */e("path",{d:"M21 21l-3.8-3.8"})]}),"external-link":/* @__PURE__ */r(a,{children:[
|
|
6
|
-
/* @__PURE__ */e("path",{d:"M14 4h6v6"}),
|
|
7
|
-
/* @__PURE__ */e("path",{d:"M20 4l-9 9"}),
|
|
8
|
-
/* @__PURE__ */e("path",{d:"M19 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h5"})]}),pencil:/* @__PURE__ */r(a,{children:[
|
|
9
|
-
/* @__PURE__ */e("path",{d:"M12 20h9"}),
|
|
10
|
-
/* @__PURE__ */e("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z"})]}),trash:/* @__PURE__ */r(a,{children:[
|
|
11
|
-
/* @__PURE__ */e("path",{d:"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m2 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}),
|
|
12
|
-
/* @__PURE__ */e("path",{d:"M10 11v6M14 11v6"})]}),"chevron-right":/* @__PURE__ */e("path",{d:"M9 6l6 6-6 6"})};function h({name:r,size:a,strokeWidth:h=1.8,rounded:d=!1,className:i,style:n}){/* @__PURE__ */
|
|
13
|
-
return e("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:h,strokeLinecap:d?"round":void 0,strokeLinejoin:d?"round":void 0,className:i,style:n,"aria-hidden":"true",children:t[r]})}export{h as UiIcon};
|