efficient-easel 7.2.1 → 8.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 +34 -3
- package/dist/autosave/index.d.ts +5 -5
- package/dist/autosave/index.js +1 -1
- package/dist/chrome/chrome.css +34 -0
- package/dist/chrome/index.d.ts +23 -4
- package/dist/chrome/index.js +1 -1
- package/dist/chunk-246ONJJH.js +58 -0
- package/dist/chunk-3NB2IEXA.js +1 -0
- package/dist/chunk-3QK5R7RR.js +7 -0
- package/dist/chunk-BHRC3ASL.js +1 -0
- package/dist/{chunk-MVQEEWTE.js → chunk-BRDCD4LK.js} +1 -1
- package/dist/{chunk-COCSEEXP.js → chunk-CVUMGA2T.js} +1 -1
- package/dist/{chunk-6TOYXESC.js → chunk-DPKWJTNX.js} +1 -1
- package/dist/chunk-HDUAODXJ.js +4 -0
- package/dist/{chunk-HS5DWUCH.js → chunk-JO6FBCVR.js} +1 -1
- package/dist/chunk-JTUUIVBZ.js +1 -0
- package/dist/{chunk-E4MAYJX5.js → chunk-NCQSBU3O.js} +1 -1
- package/dist/chunk-NDRZP6YR.js +1 -0
- package/dist/{chunk-6Z5VENIE.js → chunk-OGCROOTI.js} +1 -1
- package/dist/chunk-QVUVDBGA.js +23 -0
- package/dist/{chunk-LC62L4P2.js → chunk-R2G64ZNC.js} +1 -1
- package/dist/chunk-RKTF5XLP.js +1 -0
- package/dist/{chunk-JVTSUA2U.js → chunk-SQMUAXUS.js} +1 -1
- package/dist/chunk-THZ46DC5.js +2 -0
- package/dist/{chunk-PFNIVZPN.js → chunk-XTJCKV6Z.js} +1 -1
- package/dist/chunk-ZPXKNO5L.js +5 -0
- package/dist/{engine-DBxp_v6B.d.ts → engine-CvXpFE86.d.ts} +18 -0
- package/dist/{host-CiuzZJXj.d.ts → host-Ud6rLpph.d.ts} +6 -1
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/MediaSidePanel.d.ts +2 -2
- package/dist/screen/components/MediaSidePanel.js +1 -1
- package/dist/screen/components/NodeContextMenu.d.ts +3 -3
- package/dist/screen/components/NodeContextMenu.js +1 -1
- package/dist/screen/components/PageEditGuardNotices.js +1 -1
- package/dist/screen/components/SaveControls.d.ts +85 -0
- package/dist/screen/components/SaveControls.js +1 -0
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenDocumentContext.d.ts +2 -2
- package/dist/screen/components/ScreenDocumentContext.js +1 -1
- package/dist/screen/components/ScreenMount.d.ts +3 -3
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.d.ts +3 -3
- 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 +3 -3
- package/dist/screen/index.d.ts +4 -4
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/document-addressing.d.ts +2 -2
- package/dist/screen/lib/document-switch.d.ts +1 -1
- package/dist/screen/lib/host.d.ts +2 -2
- package/dist/screen/lib/key-scope.d.ts +16 -1
- package/dist/screen/lib/key-scope.js +1 -1
- package/dist/screen/lib/media-panel.d.ts +2 -2
- package/dist/screen/lib/media-picker.d.ts +2 -2
- package/dist/screen/lib/puck/device-fields.js +1 -1
- package/dist/screen/lib/puck/slot-child-name.js +1 -1
- package/dist/screen/lib/puck/style-clipboard.d.ts +3 -3
- package/dist/screen/lib/puck/style-clipboard.js +1 -1
- package/dist/screen/lib/save-status.d.ts +75 -0
- package/dist/screen/lib/save-status.js +1 -0
- package/dist/screen/lib/screen-parts.d.ts +63 -17
- package/dist/screen/screen.css +8 -0
- package/dist/screen/words.d.ts +69 -7
- package/dist/screen/words.js +1 -1
- package/dist/strings/catalogue.d.ts +3 -3
- package/dist/strings/catalogue.js +1 -1
- package/dist/strings/index.d.ts +3 -3
- package/dist/strings/index.js +1 -1
- package/dist/{types-Dt1CFR1S.d.ts → types-DGyDHiJV.d.ts} +13 -1
- package/dist/{words-CvFnwGSr.d.ts → words-pgIK0I6g.d.ts} +2 -2
- package/package.json +13 -3
- package/dist/chunk-4MVZZ56S.js +0 -7
- package/dist/chunk-5F3PKNT7.js +0 -1
- package/dist/chunk-64ZRPAWS.js +0 -2
- package/dist/chunk-BDTITTMW.js +0 -1
- package/dist/chunk-DOHYKMMH.js +0 -1
- package/dist/chunk-G24HQEX4.js +0 -62
- package/dist/chunk-LIH5SH6S.js +0 -5
- package/dist/chunk-TBF5CVPA.js +0 -1
- package/dist/chunk-UB4TLWVJ.js +0 -21
package/README.md
CHANGED
|
@@ -1081,9 +1081,10 @@ slug? }` (`DocumentTarget`), and its `addressing` is a
|
|
|
1081
1081
|
`DocumentAddressing<DocumentTarget>`, which may also say what a missing one
|
|
1082
1082
|
is called (`describeMissing`) and hear that one would not open
|
|
1083
1083
|
(`onLoadFailed`). A document the backend resolves with a `readOnlyReason` is
|
|
1084
|
-
held read-only for good, and the save
|
|
1085
|
-
main button is the layer's
|
|
1086
|
-
|
|
1084
|
+
held read-only for good, and the save icon says why. The top bar's
|
|
1085
|
+
main button is the layer's action handed as data (`mainAction`, 8.0.0, below),
|
|
1086
|
+
or a button of the layer's own (`barMain`), and the save menu offers no
|
|
1087
|
+
Auto-save under `saveSwitch: false`. The words the screen
|
|
1087
1088
|
says while a document opens, or will not, and the edit notice's word for the
|
|
1088
1089
|
document are the `screen` group of `EaselStrings`. A field's media pick may
|
|
1089
1090
|
carry the field's own terms to the host's panel (`options`) and give way to a
|
|
@@ -1169,6 +1170,36 @@ drag's own rule — and the screen's main button says "Done", still publishing
|
|
|
1169
1170
|
what publishes and saving the rest (`screen.done`; `barMain` still replaces
|
|
1170
1171
|
it).
|
|
1171
1172
|
|
|
1173
|
+
THE B3 SAVE BAR (8.0.0, card [DESIGN] A Clearer Save In Both Editors): one bar
|
|
1174
|
+
for both editors. The right cluster is the save icon (`SaveIcon` in
|
|
1175
|
+
`efficient-easel/chrome`: one glyph per save state, its words in the shell
|
|
1176
|
+
`Tooltip`), the layer's `barLead` and `barTrail`, and the main button — the
|
|
1177
|
+
shell's `SplitButton`. A layer hands its main action as data,
|
|
1178
|
+
`ScreenBridges.mainAction`:
|
|
1179
|
+
|
|
1180
|
+
```ts
|
|
1181
|
+
interface ScreenMainAction {
|
|
1182
|
+
label: string; // "Publish", "Save and close"
|
|
1183
|
+
tooltip?: string; // while it can be pressed
|
|
1184
|
+
onPress: () => void;
|
|
1185
|
+
quiet?: { label: string; reason: string } | null; // "Published" / "Everything is live"
|
|
1186
|
+
disabledReason?: string | null; // a reason of the layer's own
|
|
1187
|
+
status?: string | null; // the menu's status row suffix
|
|
1188
|
+
busy?: boolean; // the shell's spinner on the main half
|
|
1189
|
+
}
|
|
1190
|
+
```
|
|
1191
|
+
|
|
1192
|
+
The screen turns the main half off, with its reason, while somebody else
|
|
1193
|
+
holds the document, a save was refused, the document is frozen, the editor
|
|
1194
|
+
is offline, or a save failed and its edit is still held; the chevron always
|
|
1195
|
+
opens the save menu: a status row (the save, " · ", the layer's `status`),
|
|
1196
|
+
Auto-save, and Save now ⌘S (Retry now after a failure or offline). ⌘S /
|
|
1197
|
+
Ctrl+S saves now on the editor's keys, paused or not. "Reload the preview" is
|
|
1198
|
+
an icon button after the device switch. The words are `screen.saveStatus` and
|
|
1199
|
+
`screen.bar.{saveOptions, autoSave, saveNow}`; the rule is
|
|
1200
|
+
`describeSave` (`efficient-easel/screen/lib/save-status`). Without
|
|
1201
|
+
`mainAction` or `barMain`, the screen's Done stands in the same split button.
|
|
1202
|
+
|
|
1172
1203
|
Three more of them (the same day) change it too. The claim that opens a
|
|
1173
1204
|
document fails open on the clock (R7): unanswered after `CLAIM_FAIL_OPEN_MS`
|
|
1174
1205
|
(8 s, `efficient-easel/edit-lock`), the document opens and the edit held for
|
package/dist/autosave/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as Autosave, A as AutosaveSnapshot, b as AutosaveOptions } from '../engine-
|
|
2
|
-
export { c as AutosaveClock, d as createAutosave } from '../engine-
|
|
3
|
-
import { a as SaveIndicator } from '../words-
|
|
4
|
-
export { S as SaveWords, s as saveIndicator } from '../words-
|
|
5
|
-
import '../types-
|
|
1
|
+
import { a as Autosave, A as AutosaveSnapshot, b as AutosaveOptions } from '../engine-CvXpFE86.js';
|
|
2
|
+
export { c as AutosaveClock, d as createAutosave } from '../engine-CvXpFE86.js';
|
|
3
|
+
import { a as SaveIndicator } from '../words-pgIK0I6g.js';
|
|
4
|
+
export { S as SaveWords, s as saveIndicator } from '../words-pgIK0I6g.js';
|
|
5
|
+
import '../types-DGyDHiJV.js';
|
|
6
6
|
import '../types-CsgMwHHa.js';
|
|
7
7
|
import '../wordFit-7XpmhcaW.js';
|
|
8
8
|
import 'react';
|
package/dist/autosave/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{AUTOSAVE_DEBOUNCE_MS,AUTOSAVE_MAX_WAIT_MS,AUTOSAVE_RETRY_DELAYS_MS,AUTOSAVE_UNSAVED_AFTER_MS,autosaveRetryDelay,createAutosave,installTabAwayFlush,useAutosave}from"../chunk-
|
|
1
|
+
export{AUTOSAVE_DEBOUNCE_MS,AUTOSAVE_MAX_WAIT_MS,AUTOSAVE_RETRY_DELAYS_MS,AUTOSAVE_UNSAVED_AFTER_MS,autosaveRetryDelay,createAutosave,installTabAwayFlush,useAutosave}from"../chunk-NDRZP6YR.js";export{saveIndicator}from"../chunk-H6DDIBQ4.js";
|
package/dist/chrome/chrome.css
CHANGED
|
@@ -113,6 +113,40 @@
|
|
|
113
113
|
height: 15px;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
/* ── Save icon (8.0.0) ───────────────────────────────────────────────────────
|
|
117
|
+
One glyph per save state, its words in the shell's Tooltip. Not a button:
|
|
118
|
+
no hover fill, no pointer. The tone is a token of the chrome's, never a
|
|
119
|
+
colour, so it follows the shell's theme, dark included. The focus ring is
|
|
120
|
+
the shell's own token: the icon takes a tab stop so a keyboard reaches its
|
|
121
|
+
Tooltip. */
|
|
122
|
+
.es-saveicon-wrap {
|
|
123
|
+
display: inline-flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
}
|
|
126
|
+
.es-saveicon {
|
|
127
|
+
display: inline-flex;
|
|
128
|
+
align-items: center;
|
|
129
|
+
justify-content: center;
|
|
130
|
+
width: 32px;
|
|
131
|
+
height: 32px;
|
|
132
|
+
border-radius: var(--radius-control, var(--radius-md));
|
|
133
|
+
color: var(--es-muted);
|
|
134
|
+
outline: none;
|
|
135
|
+
}
|
|
136
|
+
.es-saveicon svg {
|
|
137
|
+
width: 20px;
|
|
138
|
+
height: 20px;
|
|
139
|
+
}
|
|
140
|
+
.es-saveicon:focus-visible {
|
|
141
|
+
box-shadow: 0 0 0 2px var(--es-accent-ring);
|
|
142
|
+
}
|
|
143
|
+
.es-saveicon[data-tone='danger'] {
|
|
144
|
+
color: var(--es-danger);
|
|
145
|
+
}
|
|
146
|
+
.es-saveicon[data-tone='warning'] {
|
|
147
|
+
color: var(--es-warning);
|
|
148
|
+
}
|
|
149
|
+
|
|
116
150
|
/* ── Save pill ───────────────────────────────────────────────────────────── */
|
|
117
151
|
.es-savestate {
|
|
118
152
|
display: inline-flex;
|
package/dist/chrome/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { T as TopBarProps,
|
|
3
|
-
export { D as DeviceOption, R as RailWordsShown, S as SaveTone } from '../types-
|
|
2
|
+
import { T as TopBarProps, b as TopBarClusterProps, c as TopBarRailProps, E as EaselIconButtonProps, d as DeviceSwitchProps, e as SaveStateProps, f as SaveStateToggleProps, g as SaveIconProps, a as SaveIconState, h as SaveIconTone, P as PanelResizeHandleProps, I as InspectorHeadProps, i as InspectorIconButtonProps, j as InspectorUpLevelProps, M as MediaPanelHeadProps, k as MediaPickKind, l as EditNoticeProps } from '../types-DGyDHiJV.js';
|
|
3
|
+
export { D as DeviceOption, R as RailWordsShown, S as SaveTone } from '../types-DGyDHiJV.js';
|
|
4
4
|
import { LockWords, EditAccess, SaveConflict } from '../edit-lock/index.js';
|
|
5
5
|
import { N as NoticeWords } from '../words-C1U_dLBh.js';
|
|
6
6
|
export { C as ChromeWords } from '../words-C1U_dLBh.js';
|
|
@@ -67,7 +67,7 @@ declare function TopBarRail({ items, ariaLabel, onWords }: TopBarRailProps): rea
|
|
|
67
67
|
* chrome's sheet reads for the glyph's ink (the shell's IconButton has no
|
|
68
68
|
* pressed look yet — a gap named for the shell); a plain action leaves it off.
|
|
69
69
|
*/
|
|
70
|
-
declare function EaselIconButton({ label, onClick, disabled, state, buttonRef, children }: EaselIconButtonProps): react.JSX.Element;
|
|
70
|
+
declare function EaselIconButton({ label, tip, onClick, disabled, state, buttonRef, children }: EaselIconButtonProps): react.JSX.Element;
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
73
|
* Which device the canvas previews — icon-only, one held down.
|
|
@@ -109,6 +109,25 @@ declare function SaveState({ tone, label, counting, waitMs, ringRef, role }: Sav
|
|
|
109
109
|
*/
|
|
110
110
|
declare function SaveStateToggle({ pressed, title, onToggle, children }: SaveStateToggleProps): react.JSX.Element;
|
|
111
111
|
|
|
112
|
+
/** The tone a state is drawn in. */
|
|
113
|
+
declare const saveIconTone: (state: SaveIconState) => SaveIconTone;
|
|
114
|
+
/**
|
|
115
|
+
* The save icon — one glyph per save state, no word beside it (8.0.0, card
|
|
116
|
+
* [DESIGN] A Clearer Save In Both Editors, design option A).
|
|
117
|
+
*
|
|
118
|
+
* The words are the shell's `Tooltip` (UI-17), on hover and on keyboard focus.
|
|
119
|
+
* It is NOT a button: nothing happens on a press; the save menu is where a
|
|
120
|
+
* person acts. It is a named image (`role="img"`, the words its name) with a
|
|
121
|
+
* tab stop, the shell's own pattern for a graphic a keyboard must be able to
|
|
122
|
+
* read (its charts: `role="img"`, `aria-label`, `tabIndex={0}`), so a
|
|
123
|
+
* keyboard reaches the Tooltip as a mouse does.
|
|
124
|
+
*
|
|
125
|
+
* A screen reader hears a CHANGE of state through a polite live region of its
|
|
126
|
+
* own, which takes the words when the state changes and not when they only
|
|
127
|
+
* tick ("Saved 2 seconds ago" → "3 seconds ago" is not news).
|
|
128
|
+
*/
|
|
129
|
+
declare function SaveIcon({ state, label }: SaveIconProps): react.JSX.Element;
|
|
130
|
+
|
|
112
131
|
/**
|
|
113
132
|
* A drag grip on a side panel's inner edge: the shell's `ResizeHandle`
|
|
114
133
|
* (harness UI-24; since 1.0.0, efficient-easel#199). The splitter role, the
|
|
@@ -275,4 +294,4 @@ type EditNoticeWords = {
|
|
|
275
294
|
*/
|
|
276
295
|
declare function editNotice(access: EditAccess, conflict: SaveConflict | null, noun: string, words?: EditNoticeWords): EditNoticeContent | null;
|
|
277
296
|
|
|
278
|
-
export { DeviceSwitch, DeviceSwitchProps, EaselIconButton, EaselIconButtonProps, EaselTopBar, EditNotice, type EditNoticeAction, type EditNoticeContent, EditNoticeProps, type EditNoticeWords, InspectorHead, InspectorHeadProps, InspectorIconButton, InspectorIconButtonProps, InspectorUpLevel, InspectorUpLevelProps, MediaPanelHead, MediaPanelHeadProps, MediaPickKind, NoticeWords, PanelResizeHandle, PanelResizeHandleProps, SaveState, SaveStateProps, SaveStateToggle, SaveStateToggleProps, TopBarCluster, TopBarClusterProps, TopBarDivider, TopBarProps, TopBarRail, TopBarRailProps, editNotice, mediaPickKind };
|
|
297
|
+
export { DeviceSwitch, DeviceSwitchProps, EaselIconButton, EaselIconButtonProps, EaselTopBar, EditNotice, type EditNoticeAction, type EditNoticeContent, EditNoticeProps, type EditNoticeWords, InspectorHead, InspectorHeadProps, InspectorIconButton, InspectorIconButtonProps, InspectorUpLevel, InspectorUpLevelProps, MediaPanelHead, MediaPanelHeadProps, MediaPickKind, NoticeWords, PanelResizeHandle, PanelResizeHandleProps, SaveIcon, SaveIconProps, SaveIconState, SaveIconTone, SaveState, SaveStateProps, SaveStateToggle, SaveStateToggleProps, TopBarCluster, TopBarClusterProps, TopBarDivider, TopBarProps, TopBarRail, TopBarRailProps, editNotice, mediaPickKind, saveIconTone };
|
package/dist/chrome/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{DEFAULT_PANEL_W,DeviceSwitch,EaselIconButton,EaselTopBar,EditNotice,InspectorHead,InspectorIconButton,InspectorUpLevel,MAX_PANEL_W,MIN_PANEL_W,MediaPanelHead,PanelResizeHandle,SaveState,SaveStateToggle,TopBarCluster,TopBarDivider,TopBarRail,clampPanelWidth,editNotice,mediaPickKind,panelWidthVars,setPanelWidthVars}from"../chunk-
|
|
1
|
+
export{DEFAULT_PANEL_W,DeviceSwitch,EaselIconButton,EaselTopBar,EditNotice,InspectorHead,InspectorIconButton,InspectorUpLevel,MAX_PANEL_W,MIN_PANEL_W,MediaPanelHead,PanelResizeHandle,SaveIcon,SaveState,SaveStateToggle,TopBarCluster,TopBarDivider,TopBarRail,clampPanelWidth,editNotice,mediaPickKind,panelWidthVars,saveIconTone,setPanelWidthVars}from"../chunk-QVUVDBGA.js";import"../chunk-Y2G7CU6A.js";import"../chunk-THWO5YVZ.js";import"../chunk-RE4LP46F.js";import"../chunk-MJM6SFD3.js";import"../chunk-2OAZYSWJ.js";import"../chunk-MFIRYGHW.js";
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import{cloneNodeWithFreshIds as e}from"./chunk-2GVCAIPX.js";import{dedupeSlotChildren as n}from"./chunk-26OOWIJJ.js";import{styleClipboardOf as t}from"./chunk-BRDCD4LK.js";import{markedTreeNodeId as o,revealSelectedTreeRow as r,sameSelector as i}from"./chunk-FGNR22NY.js";import{rootRowName as l,slotChildRowName as s,slotChildRenameProp as d,sectionRenameProp as c}from"./chunk-BHRC3ASL.js";import{scrollPreviewToSection as a,gotoPreviewSlide as p,scrollPreviewToTop as u}from"./chunk-4ES5JGGX.js";import{useEaselKeyTarget as f,useEaselUndoKeys as m,useEaselSaveKey as h,editorRootFocus as g}from"./chunk-3NB2IEXA.js";import{SlotChildActionsProvider as y}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as k,DEFAULT_PANEL_W as S,clampPanelWidth as x}from"./chunk-DPKWJTNX.js";import{usePartBridge as v}from"./chunk-2LBXIYF7.js";import{useSectionOps as w}from"./chunk-2QUWI67X.js";import{useNodeClipboard as b,useNodeContextMenu as z}from"./chunk-R2G64ZNC.js";import{PageEditGuardNotices as B}from"./chunk-NCQSBU3O.js";import{ScreenSaveIcon as C,ScreenMainButton as O}from"./chunk-HDUAODXJ.js";import{useBrowserOffline as I}from"./chunk-RKTF5XLP.js";import{useScreenDocument as N}from"./chunk-THZ46DC5.js";import{requestMediaPick as $}from"./chunk-KG7RJWOK.js";import{heldStyle as A,styleShortcut as P}from"./chunk-V7U33NF2.js";import{AddChildRow as T}from"./chunk-5545A3PC.js";import{AddSidePanel as j}from"./chunk-ZPXKNO5L.js";import{SidePanelHead as M,PanelShowStrip as R}from"./chunk-XTJCKV6Z.js";import{MediaSidePanel as L}from"./chunk-CVUMGA2T.js";import{useScreenSaveSwitch as E,useScreenNodeKeys as V,useScreenPinned as D,useScreenDocumentLabel as H,useScreenCanvasFrame as U,useScreenInspectorPanel as F,useScreenDevices as W,useScreenPickFollowsSelection as G,useScreenLeftView as J,useScreenAdd as X,SELECTION_MODE as K,sameInspectorMode as Y,useScreenBridges as Z,useScreenBlockRules as _,useScreenBlockLook as Q,useScreenStorageNamespace as q,useScreenNotify as ee,useScreenCanvasHead as ne,isSlotMode as te,useScreenStyleClipboard as oe,useScreenDocumentPass as re,useScreenCanvasDrag as ie,ScreenCanvasTargetProvider as le,isPinnedFirst as se,isPinnedLast as de,screenSlotsOf as ce}from"./chunk-E3PD66A3.js";import{ROOT_ZONE as ae,blockNodeActions as pe,TREE_MAX_DEPTH as ue,childSlotsOf as fe,slotFieldsOf as me,slotChildrenIn as he,nestsInTree as ge,newNodeId as ye}from"./chunk-PLVEGYK6.js";import{useMediaPanel as ke,usePanelPick as Se,useCancelPanelPick as xe}from"./chunk-R6WTQWAC.js";import{useEaselHost as ve,useHostEscape as we}from"./chunk-U3JP4VGF.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as be}from"./chunk-6WY6ZXJG.js";import{DEFAULT_SCREEN_WORDS as ze}from"./chunk-JTUUIVBZ.js";import{useEasel as Be,useEaselApi as Ce}from"./chunk-KYG35KKJ.js";import{TreeRow as Oe,Subtree as Ie,LayersTree as Ne,TreeGroupLabel as $e,TreeRowAction as Ae,TreeSeam as Pe}from"./chunk-4JSBIW5H.js";import{DEFAULT_TREE_WORDS as Te}from"./chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as je}from"./chunk-WK3AFPXY.js";import{toItemSelector as Me,useNodeOps as Re,clickPick as Le}from"./chunk-SOZUYCQZ.js";import{LayersIcon as Ee,MediaIcon as Ve}from"./chunk-4VJATVVR.js";import{EaselTopBar as De,TopBarRail as He,TopBarCluster as Ue,EaselIconButton as Fe,TopBarDivider as We,DeviceSwitch as Ge,InspectorIconButton as Je,PanelResizeHandle as Xe,MAX_PANEL_W as Ke,MIN_PANEL_W as Ye,panelWidthVars as Ze}from"./chunk-QVUVDBGA.js";import{DEFAULT_NOTICE_WORDS as _e,DEFAULT_CHROME_WORDS as Qe}from"./chunk-Y2G7CU6A.js";import{holderOf as qe,nameOrSomeone as en}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as nn}from"./chunk-RE4LP46F.js";import{useWords as tn}from"./chunk-MFIRYGHW.js";import{insertSeams as on,CanvasDragLayer as rn,CanvasInsert as ln}from"./chunk-SSORUDHE.js";import{DEFAULT_DRAG_WORDS as sn}from"./chunk-O2NLQBFX.js";import{createDragSession as dn,useTreeDrag as cn,gapToMoveIndex as an}from"./chunk-67GNT6PF.js";import{useCanvasFrame as pn,LIST_SELECTOR as un,BLOCK_SELECTOR as fn,useCanvasEvent as mn}from"./chunk-AWJUYMX7.js";import{zoneKey as hn,ROOT_ID as gn,ROOT_SLOT as yn,parseZoneKey as kn,find as Sn,DataError as xn}from"./chunk-KRXQM65X.js";import{useRef as vn,useMemo as wn,useState as bn,useEffect as zn,useCallback as Bn,useLayoutEffect as Cn,Fragment as On}from"react";import{toast as In}from"efficient-shell/ui";import{UndoIcon as Nn,RedoIcon as $n,RefreshIcon as An,TrashIcon as Pn,EyeOffIcon as Tn,EyeIcon as jn,DuplicateIcon as Mn}from"efficient-shell/icons/efficient";import{jsx as Rn,jsxs as Ln,Fragment as En}from"react/jsx-runtime";function Vn({expand:e}){/* @__PURE__ */
|
|
2
|
+
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(En,e?{children:[
|
|
3
|
+
/* @__PURE__ */Rn("path",{d:"M8 9l4-4 4 4"}),
|
|
4
|
+
/* @__PURE__ */Rn("path",{d:"M8 15l4 4 4-4"})]}:{children:[
|
|
5
|
+
/* @__PURE__ */Rn("path",{d:"M8 4l4 4 4-4"}),
|
|
6
|
+
/* @__PURE__ */Rn("path",{d:"M8 20l4-4 4 4"}),
|
|
7
|
+
/* @__PURE__ */Rn("path",{d:"M5 12h14"})]})})}var Dn=`${un}, ${fn}`;function Hn(e,n,t){const o=t-n;if(o<6)return null;if(o<24)return{top:Math.round((n+t)/2),height:Math.round(o)};return{top:Math.round(Math.min(Math.max(e,n+12),t-12))}}var Un="__rungs";var Fn="screen:band",Wn={duplicate:!0,delete:!0};function Gn(){const un=ve(),{target:Gn,docId:Jn,capabilities:Xn,currentSlug:Kn,siteId:Yn,onPublish:Zn,saveState:_n,saveConflict:Qn,retrySave:qn,toggleAutoSave:et,flushSave:nt,access:tt,saveUnreachable:ot=!1,readOnly:rt,readOnlyReason:it=null}=N(),lt=E(),st=V(),{mediaEditing:dt,hasEditGuard:ct,hasPinnedChrome:at}=Xn,{appState:pt,dispatch:ut,history:ft,selectedItem:mt,getSelectorForId:ht,config:gt}=Be(e=>e),yt=D(),{first:kt,firstGroup:St,lastGroup:xt,isSectionGroup:vt,sectionGroupZone:wt,panelOf:bt}=yt,zt=bt(kt),Bt=e=>se(yt,e),Ct=e=>de(yt,e),Ot="node"===yt.firstRow,It=yt.band??null,Nt=tn("screen",ze),$t=tn("tree",Te),At=tn("drag",sn),Pt=tn("notice",_e),Tt=tn("lock",nn),jt=tn("menu",je),Mt=tn("styleClipboard",be),Rt=tn("chrome",Qe),Lt=H()??`/${Kn}`,Et=U(),Vt=F(),Dt=w({readOnly:rt}),Ht=w({readOnly:rt,foldIntoHistory:!0}),Ut=vn(null),Ft=Ce(),Wt=wn(()=>({...Dt,select:e=>{Ut.current=e,Dt.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=Ft.config;Ut.current=Me(e,t,n)}Dt.commitDocument(e,n)}}),[Dt,Ft]),Gt=pt.ui,Jt=Gt.leftSideBarVisible,Xt=Gt.rightSideBarVisible,{options:Kt,widths:Yt,initial:Zt,fluid:_t,fit:Qt}=W(),[qt,eo]=bn(Zt),no=ke(),to=dt&&null!==no,oo=Se(),ro=xe();G(mt?.props.id);const{read:io,write:lo,forSelection:so}=J(),[co,ao]=bn(io);zn(()=>{lo(co)},[co]);const[po,uo]=bn(0),fo=vn(null),mo=vn(null),ho=pn(mo,{readySelector:Dn}),go=f(mo);m(mo,ho);const yo=I(),ko=qe(tt),So={state:_n,offline:yo||_n.failed&&ot,readOnlyReason:it,editing:ko?Pt.editing({name:en(ko.name,Tt),noun:Nt.noun}):null,conflict:null!=Qn,notSaving:Nt.bar.notSaving},xo=()=>{rt||(_n.failed?qn():nt())};h(mo,ho,xo);const[vo,wo]=bn(!1),bo=vn(!1),zo=vn(!1),[Bo,Co]=bn(null),Oo=X(),Io=e=>Co(null===e?null:{zone:ae,index:e}),[No,$o]=bn([]),[Ao,Po]=bn(K),To="puck"===Ao.kind,jo=vo&&!Bo&&Oo.railTarget?Oo.railTarget(pt.data,{node:mt??null,mode:Ao}):null,Mo=jo?{zone:hn(jo),index:jo.index}:null,Ro=Bo??Mo,Lo=Ro&&Ro.zone===ae?Ro.index:null,Eo=o(Ao,mt?.props.id),[Vo,Do]=bn(null);zn(()=>{Vo&&(r(),Do(null))},[Vo]);const Ho=vn(ht);Ho.current=ht;const Uo=Bn((e,{scroll:n})=>{ao(n=>so(e,n)),n&&Do(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=Ho.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&kr(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),Fo=vn(null);zn(()=>{const e=Fo.current;Fo.current=null;const n=null==mt?.props.id?null:String(mt.props.id);Po(t=>e&&e.id===n?e.mode:"part"===t.kind&&"nodeId"in t&&t.nodeId===n?t:bt(mt?.type)??K);const t=mt?.props.id,o=Ut.current;if(Ut.current=null,!t)return;const r=ht(t);Uo(String(t),{scroll:!i(o,r??null,ae)})},[mt?.props.id,Uo]);const Wo=Bn(e=>{Po(n=>Y(n,e)?n:e),ut({type:"setUi",ui:{rightSideBarVisible:!0}})},[ut]),Go=vn(()=>{});Go.current=(e,n)=>{const t=e?pi(e.zone??ae)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==mt?.props.id?null:String(mt.props.id);Po(e=>Y(e,n)?e:n),o!==r&&(Fo.current={id:o,mode:n},Wt.select(e))};const Jo=Bn((e,n)=>Go.current(e,n),[]),Xo={kind:Ao.kind,mode:Ao,open:Wo,show:e=>Po(e),reveal:()=>{Xt||ut({type:"setUi",ui:{rightSideBarVisible:!0}})},select:Jo},Ko=Z(Xo,{data:pt.data,selected:mt??null,zoneOf:e=>ht(e)?.zone,readOnly:Boolean(rt),select:e=>{Po(K),Wt.select({index:e})},replace:(e,n)=>Wt.replaceComponent(ae,e,n),scrollTo:e=>Ri(e)},{device:qt,refreshes:po},{setView:ao,reveal:()=>{Jt||ut({type:"setUi",ui:{leftSideBarVisible:!0}})}}),Yo=Ko.pinnedSource??!1,Zo=Ko.resolveLeftView?Ko.resolveLeftView(co,to):"media"===co&&to?co:"sections",_o=_(),{isLockedBlock:Qo,duplicateBlocked:qo,nestDepth:er,newSectionNode:nr,canAddTo:tr,blockIsOffered:or}=_o,rr=Q(),{labelAtLevel:ir,Icon:lr,useProducts:sr}=rr,dr=rr.rowName?(e,n,t)=>rr.rowName(e,n,t):void 0,cr=Bn(e=>{ut({type:"setUi",ui:{rightSideBarVisible:!0}}),a(e),Uo(e,{scroll:!0})},[ut,Uo]),{selectNode:ar,openPartId:pr}=v({mode:Ao,setMode:Po,onOpenPart:cr}),[ur,fr]=bn(null);we(null!==ur,()=>fr(null));const mr=k(q()),hr=mr.collapsed,gr=mr.panelWidths,[yr,kr]=bn(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(hr);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
|
|
8
|
+
return new Set}});zn(()=>{try{window.localStorage.setItem(hr,JSON.stringify([...yr]))}catch{}},[yr]);const[Sr,xr]=bn(()=>{if("undefined"==typeof window)return{...S};try{const e=window.localStorage.getItem(gr);if(!e)return{...S};const n=JSON.parse(e);return{left:x(Number(n.left)||S.left),right:x(Number(n.right)||S.right)}}catch{return{...S}}});zn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(gr,JSON.stringify(Sr))}catch{}},300);return()=>clearTimeout(e)},[Sr]);const vr=Bn((e,n)=>xr(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),wr=Bn(e=>vr("left",e),[vr]),br=Bn(e=>vr("right",e),[vr]),zr=e=>yr.has(e),Br=e=>kr(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Cr=vn(!1),Or=vn(null);zn(()=>{if(Cr.current&&!vo){const e=Or.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??mo.current?.querySelector(`button[aria-label="${CSS.escape(Nt.add.title)}"]`))?.focus(),Or.current=null}Cr.current=vo},[vo]),zn(()=>{if(!vo||!go)return;const e=e=>{"Escape"===e.key&&Gi()};return go.addEventListener("keydown",e),()=>go.removeEventListener("keydown",e)},[vo,go]),we(vo,()=>Gi()),zn(()=>{!Jt&&vo&&(wo(!1),Co(null),bo.current=!1)},[Jt]),zn(()=>{if(!oo)return zo.current&&ut({type:"setUi",ui:{leftSideBarVisible:!1}}),void(zo.current=!1);vo&&(wo(!1),Co(null),zo.current=bo.current,bo.current=!1),Jt||(zo.current=!0,ut({type:"setUi",ui:{leftSideBarVisible:!0}}))},[oo]),zn(()=>{!Jt&&oo&&(zo.current=!1,ro())},[Jt]),zn(()=>{if(!oo||!go)return;const e=e=>{"Escape"===e.key&&ro()};return go.addEventListener("keydown",e),()=>go.removeEventListener("keydown",e)},[oo,go]),we(null!==oo,()=>ro());const Ir=ee(),Nr=(e,n="success",t)=>{if(Ir)return void(t?Ir(e,"error"===n?"error":"info",t):Ir(e,"error"===n?"error":"info"));const o={sound:!1,action:t?.action,onClose:t?.onClose};"error"===n?In.error(e,{...o,duration:t?.duration??3200}):In.success(e,{...o,duration:t?.duration??1900})},$r=vn(null),[Ar,Pr]=bn(0),[Tr,jr]=bn(0),Mr=ne(),Rr=vn(null),Lr=e=>Math.max(0,e.clientHeight-(Rr.current?.offsetHeight??0));zn(()=>{const e=$r.current;if(!e)return;const n=()=>{Pr(e.clientWidth),jr(Lr(e))};n();const t=new ResizeObserver(n);return t.observe(e),Rr.current&&t.observe(Rr.current),()=>t.disconnect()},[]),Cn(()=>{$r.current&&(Pr($r.current.clientWidth),jr(Lr($r.current)))},[Sr,Jt,Xt]);const Er=qt===_t?Ar>0?Ar:Yt[_t]:Yt[qt],Vr=Ar>0?Math.min(Ar/Er,"shrink"===Qt?1:2):1,Dr=Er*Vr,Hr=Ar>0&&Dr>Ar+1,Ur={width:Dr,height:Tr||"100%",flex:"none",position:"relative"},Fr={width:Er,height:Tr?Tr/Vr:"100%",maxHeight:"none",transform:1!==Vr?`scale(${Vr})`:void 0,transformOrigin:"top left"},Wr=()=>ut({type:"setUi",ui:{leftSideBarVisible:!Jt}}),Gr=()=>ut({type:"setUi",ui:{rightSideBarVisible:!Xt}}),Jr=e=>{vo&&(wo(!1),Co(null),bo.current=!1,Jt&&co===e)||oo&&(zo.current=!1,ro(),Jt&&co===e)||(Jt&&co===e?Wr():(ao(e),Jt||ut({type:"setUi",ui:{leftSideBarVisible:!0}})))},Xr=()=>{$(un,{accept:"image/*",title:Rt.mediaLibrary})},Kr=()=>{Po(K),Wt.select(null),u()},Yr=()=>{Po(zt??K),Xt||ut({type:"setUi",ui:{rightSideBarVisible:!0}})},Zr=pt.data.content??[],_r=()=>{const e=Zr.findIndex(Bt),n=Zr.findIndex(Ct);return{floor:e>=0?e+1:0,cap:n>=0?n:Zr.length}},Qr=gt,qr=_o.stripCopy,ei=n=>e(n,qr),ni=b(),ti=Re({data:pt.data,config:Qr,readOnly:Boolean(rt),clipboard:ni,strip:qr?e=>qr(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==gn||e.slot!==yn)return{min:0,max:n-1};const{floor:t,cap:o}=_r();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&Po(K);const t=void 0===n||"node"===n?.kind?n:null;Wt.commitDocument(e,t)}}),oi=e=>{const n=Sn(pt.data,gt,e);if(!n)return!1;const t=hn(n.place),o=n.node,r=t===ae?di(o):wi(o);return!!ti.remove(e)&&(Nr(Nt.deleted({name:r}),"success",{duration:8e3,action:{label:Nt.bar.undo,onClick:()=>{ti.restore(n.node,n.place)}}}),!0)},ri={...ti,remove:oi},ii=e=>ir(e,"block",gt.components[e]?.label??e),li=Bn(e=>gt.components[e]?.defaultProps??{},[gt]),si=e=>ir(e,"section",ii(e)),di=e=>l({type:e.type,props:e.props??{}},si(e.type),dr),{nodeAddresses:ci,zoneItems:ai}=wn(()=>{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>=ue)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of fe(gt,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(Zr,ae,0),{nodeAddresses:e,zoneItems:n}},[Zr,gt]),pi=Bn(e=>ai.get(e)??[],[ai]),ui=e=>{const n=ci.get(e);return n?pi(n.zone)[n.index]:void 0},fi=e=>ce(_o,gt,e),mi=e=>{if(!_o.slotsOf||e===ae)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=ui(e.slice(0,n));if(!t)return null;const o=fi(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}},hi=(()=>{if(!te(Ao))return null;const e=`${Ao.nodeId}:${Ao.slot}`;return mi(e)?.slot.panel===Ao.kind?e:null})(),gi=vn(null);zn(()=>{const e=gi.current;if(gi.current=null,!hi||!te(Ao))return;const n=Ao.nodeId;Uo(n,{scroll:e!==hi}),kr(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[Ao]);const yi=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=ci.get(e);n&&(n.zone===ae?Li(n.index):fl(n.zone,n.index,e,ui(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&hi!==i&&(gi.current=i),Jo(null,r),Xt||ut({type:"setUi",ui:{rightSideBarVisible:!0}}),Ri(o)},ki=(e,n,t)=>{const o=`${e}:${n}`;if(kr(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;hi!==o&&(gi.current=o);Jo(null,{kind:t,nodeId:e,slot:n})},Si=(e,n,t)=>{if(rt||!_o.moveSlot)return;const o=ui(e),r=o?fi(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:Un,index:n},s=an(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=_o.moveSlot(e,n,s);"string"==typeof d&&ki(e,d,i.panel)},xi=sr(),vi=wn(()=>{const e=/* @__PURE__ */new Map;for(const n of xi??[])e.set(n.slug,n.name);return e},[xi]),wi=e=>s(e,ii,rr.plainText,e=>vi.get(e),rr.rowName),bi=(e,n)=>{const t=gt.components[e.type]?.fields,o=n===ae||Al(n)?"section":"block",r=n===ae&&(Bt(e)||Ct(e)||vt(e.type)),i="block"===o?d(t):r?null:c(t);return rr.renamePropOf?rr.renamePropOf(e,o,i):i},zi=(e,n,t,o)=>{if(!(!rt&&ur?.zone===e&&ur.index===n))return;const r=(t,o)=>{fr(null),o&&((e,n,t)=>{const o=pi(e)[n];if(!o)return;const r=bi(o,e);r&&Wt.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
|
|
9
|
+
return Rn("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":Nt.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)},Bi=t(oe(),Mt),Ci=Bi.scope({target:Gn,siteId:Yn,docId:Jn}),Oi=gt,Ii=(e,n)=>n===ae?si(e):ii(e),Ni=(e,n,t)=>{const o=Bi.plan(Ci,t,Ii(t.type,e),Oi);o&&(o.changed&&Wt.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),Nr(o.message))},$i=z({nodesIn:pi,nodeAt:(e,n)=>pi(e)[n]??null,labelOf:(e,n)=>n===ae?si(e):ii(e),renamePropOf:bi,beginRename:(e,n)=>fr({zone:e,index:n}),history:{hasPast:ft.hasPast,hasFuture:ft.hasFuture,back:()=>ft.back(),forward:()=>ft.forward()},openAddSection:()=>{Wt.select(null),Fi(null)},openPageSettings:()=>{Wt.select(null),Po(K)},pageSettingsLabel:Nt.pageSettings,words:{menu:jt,styleClipboard:Mt,screen:Nt.menu},readOnly:Boolean(rt),collapseAll:()=>kr(new Set(pi(ae).map(e=>String(e.props.id)))),onPasteRefused:e=>Nr(e?Nt.pasteRefused({name:e.label}):Nt.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>Tl(e,n),menuRows:Ko.menuRows,isLocked:e=>Qo(e.type),duplicateBlocked:e=>qo(pt.data,e),permits:e=>pe(gt,e.type),canAddTo:tr,nodeOps:ri,isPinned:(e,n)=>n===ae&&(Bt(e)||Ct(e)),sectionBand:_r,openAddInside:(e,n)=>{e===ae?Li(n):Wt.select({zone:e,index:n}),Fi(null)},locate:e=>ci.get(e)??null,rowNameOf:(e,n)=>n===ae?di(e):wi(e),selectAt:(e,n,t,o)=>{e===ae?Li(n):fl(e,n,t,o??"")},slotRung:e=>{const n=mi(e);return n?.slot.panel?{label:n.slot.label,select:()=>yi(n.node,n.slot,!1)}:null},style:{held:()=>A(Ci),canCopy:e=>Bi.rows(Oi,e).some(e=>!1!==e.counted),copy:(e,n)=>Bi.copy(Ci,e,Ii(e.type,n),Oi),paste:(e,n,t)=>Ni(e,n,t)},keys:st?{target:go,selected:()=>{const e=pt.ui.itemSelector;return e?{zone:e.zone??ae,index:e.index}:null},held:()=>ni.get(),readOnly:Boolean(rt),onDone:({done:e,name:n})=>{"copied"===e&&Nr(Nt.copied({name:n}))}}:void 0},ho),Ai=vn({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});zn(()=>{Ai.current={copy:(e,n)=>Bi.copy(Ci,e,Ii(e.type,n),Oi),paste:Ni,at:()=>{const e=pt.ui.itemSelector;if(!e)return null;const n=e.zone??ae,t=pi(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(rt)}});const Pi=Bn(e=>{const n=P(e);if(!n)return;const t=Ai.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))},[]);zn(()=>{if(!go)return;const e=e=>Pi(e);return go.addEventListener("keydown",e),()=>go.removeEventListener("keydown",e)},[Pi,go]),mn(ho,"keydown",Pi);const Ti=Zr.map(e=>e.props.id).join("|");zn(()=>{const e=ho?.document??null,n=ho?.window??null;let t=0;const o=[],r=()=>{if(!e)return void $o(e=>e.length?[]:e);const n=Zr.findIndex(Ct),t=n>=0?n:Zr.length,o=n=>{const t=Zr[n]?.props?.id;return null==t?null:e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(fn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=Zr.length>0&&!Bt(Zr[0])?0:1;e<=t;e++){const n=o(e),t=o(e-1),l=n?.getBoundingClientRect()??null,s=t?.getBoundingClientRect()??null;if(!l&&!s)continue;const d=Hn(l&&s?(s.bottom+l.top)/2:l?0===e?l.top+12:l.top:s.bottom,Math.max(0===e?0:-1/0,...r(t).map(e=>e.bottom)),Math.min(1/0,...r(n).map(e=>e.top)));d&&i.push({...d,index:e})}$o(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()}},[ho,Ti,qt,Vr,Jt,Xt,mt?.props.id]);const ji=ho?.document??null,Mi=ho?.window??null;zn(()=>{const e=fo.current;if(!e||!ji||!Mi)return;const n=[],t=()=>{const n=ji.querySelector(`[data-puck-component="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&Mi.scrollTo({left:Mi.scrollX,top:Mi.scrollY+t,behavior:"instant"}),!0};return fo.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[ji,Mi]);const Ri=e=>{Ko.holdCanvasOn?Ko.holdCanvasOn(e):a(e)},Li=e=>{Po(K),Wt.select({index:e}),Ko.sectionPressed?.(Zr[e]);const n=Zr[e]?.props?.id;n&&Ri(n)},Ei=e=>{const{floor:n,cap:t}=_r(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=mt&&Ao.kind!==zt?.kind?Zr.findIndex(e=>e.props.id===mt.props.id):-1;return o(r>=0?r+1:t)},Vi=(e,n)=>{const{floor:t,cap:o}=_r(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(Wt.reorderComponent(ae,e,i),Wt.select({index:i}),{moved:!0,dest:i})},Di=(e,n,t,o)=>{Po(K),Wt.select(o?{index:o.index,zone:o.zone}:{index:e}),a(n),Nr(Nt.sectionAdded({name:t}))},Hi=(e,n)=>{const t=Ei(n),o=nr(e,{nodeDefaults:li,newNodeId:ye,sectionLabel:si,blockIsOffered:or}),r=o?Wt.insertNode(ae,t,o):Wt.insertSection(e,t);return Di(t,r,si(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 fe(gt,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=tr(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},Ui=(e,n,t)=>{const o=Ei(t),r=Wt.insertNode(ae,o,n);return Di(o,r,e),o},Fi=e=>Wi(ae,e),Wi=(e,n)=>{Or.current=document.activeElement??null,oo&&(bo.current=zo.current,zo.current=!1,ro()),Co(null===n?null:{zone:e,index:n}),wo(!0),Jt||(bo.current=!0,ut({type:"setUi",ui:{leftSideBarVisible:!0}}))},Gi=()=>{wo(!1),Co(null),bo.current&&ut({type:"setUi",ui:{leftSideBarVisible:!1}}),bo.current=!1},Ji=(e,n,t)=>{if("section"===e.kind)Wt.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;Wt.insertNode(n,t,ei(e.template.node))}Po(K),Wt.select({index:t,zone:n})},Xi=(e,n)=>rr.rowName?n?Bt(e)?rr.rowName(e,"section",Nt.header):Ct(e)?rr.rowName(e,"section",Nt.footer):vt(e.type)?rr.rowName(e,"section",ii(e.type)):di(e):wi(e):n?si(e.type):ii(e.type),Ki=e=>n=>{e()},Yi=()=>Ko.editPinnedSource?.(),Zi=(e,n,t)=>{if(rt)return null;const o=pi(e)[n];return o&&!pe(gt,o.type).delete?null:/* @__PURE__ */Rn(Ae,{kind:"delete",label:Nt.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=pi(e)[n]?.props?.id;null!=t&&oi(String(t))})(e,n),children:/* @__PURE__ */Rn(Pn,{size:15})})},_i=e=>rr.rowPreview?.(e)||void 0,Qi=e=>rr.rowMarks?.(e)??void 0,qi=(e,n,t)=>rr.rowActions?.(e,n,t)??null,el=(e,n,t,o)=>{if(rt)return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
|
|
10
|
+
return Rn(Ae,{kind:"eye",label:r?Nt.showNamed({name:o}):Nt.hideNamed({name:o}),onClick:()=>tl(e,n,t),children:/* @__PURE__ */Rn(r?Tn:jn,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},nl=e=>{const n=si(Zr[e]?.type??""),t=n?Nt.addSectionBefore({name:n}):Nt.addSectionHere;return ts(ae,e,()=>Fi(e),t)},tl=(e,n,t)=>{Wt.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},ol=e=>me(gt,e),rl=e=>fe(gt,e),il=e=>_o.slotsOf?fi(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:he(e,n.slot)})):[{slot:null,rung:null,kids:rl(e)}],ll=e=>_o.slotsOf?il(e).flatMap(e=>e.kids):rl(e),sl=e=>Boolean(_o.slotsOf)&&fi(e).some(e=>e.rung),dl=(e,n,t)=>null===t?void 0===n?tr(e):tr(e,n):tr(e,n,t),cl=(e,n,t)=>{const o=ge(gt,e.type,n)&&(t||ll(e).length>0||sl(e));return{collapsible:o,folded:o&&zr(String(e.props.id))}},al=(e,n,t)=>il(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>cl(e,r,t(e.type)).collapsible?[String(e.props.id),...al(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),pl=e=>ll(e).length>0||sl(e)||Boolean(tr(e.type)),ul=e=>Boolean(tr(e)),fl=(e,n,t,o)=>{if(Po(K),tr(o)?.spec?.slider){const t=e.split(":")[0];p(t,n),Wt.select({index:n,zone:e}),a(t)}else Wt.select({index:n,zone:e}),Ri(t)},ml=(e,n,t,o,r)=>{const i=`${e}:${n}`;Wt.insertComponent(i,t,o),tr(r)?.spec?.slider?requestAnimationFrame(()=>{p(e,o),Wt.select({index:o,zone:i})}):Wt.select({index:o,zone:i})},hl=(e,n,t)=>{Wt.insertComponent(e,n,t),Po(K),Wt.select({index:t,zone:e})},gl=vn(/* @__PURE__ */new Set);zn(()=>{Zr.forEach(e=>{const n=tr(e.type)?.spec;if(!n)return;const t=e.props.id;if(gl.current.has(t))return;gl.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(li)).forEach((e,t)=>Ht.seedChild(o,t,n.childType,e))})},[Zr,Ht,li]);const yl=vn(/* @__PURE__ */new Set);zn(()=>{Zr.forEach((e,t)=>{const o=e.props.id;if(yl.current.has(o))return;const r=n(e,ol(e.type));yl.current.add(o),r&&Ht.replaceComponent(ae,t,{...e,props:r})})},[Zr,Ht]),re(Ht,gt);const kl=Zr.findIndex(Ct),Sl=kl>=0?Zr[kl]:null,xl=Ot?Zr.findIndex(Bt):-1,vl=xl>=0?Zr[xl]:null,wl=Zr.find(e=>e.type===St)??null,bl=Zr.find(e=>e.type===xt)??null,zl=kl>=0?kl:Zr.length,Bl=[];Zr.forEach(e=>{Ct(e)||(pl(e)&&Bl.push(String(e.props.id)),Bl.push(...al(e,1,ul)))}),Sl&&(Bl.push(String(Sl.props.id)),Bl.push(...al(Sl,1,ul)));const Cl=Bl.length>0&&Bl.every(e=>yr.has(e)),Ol=e=>{const n=rr.blockRowName(e,ii);return rr.rowName?rr.rowName(e,"block",n):n},Il=(e,n,t,o)=>{const r=pi(e)[t];if(!r)return;const i={...kn(e),index:t},l={...kn(n),index:Math.min(Math.max(o,0),pi(n).length)},s=an(i,l);if(e!==n||s!==t)try{ti.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof xn))throw e}},Nl=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of rl(e))n.add(r),t(o)};for(const t of ol(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},$l=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=ci.get(n);if(!e)return null;if(e.zone===ae)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},Al=e=>{const n=e.slice(0,e.indexOf(":")),t=Zr.find(e=>vt(e.type)&&String(e.props.id)===n);return t&&wt(n)===e?t:null},Pl=(e,n,t)=>{if(e.rung){const t=ui(e.rung.nodeId),o=t?fi(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===Un&&n.index>=0&&n.index<=o}if(n.slot===Un)return!1;if(e.add)return Ml(e.add,n);const o=hn(n);if(vt(e.type))return!1;const r=Al(o),i=Al(e.zone);if(r||i)return!(!r||!i)&&(n.index>=0&&n.index<=pi(o).length);if(e.zone===ae||o===ae){if(e.zone!==o)return!1;const{floor:t,cap:r}=_r();return n.index>=t&&n.index<=r}if(n.index<0||n.index>pi(o).length)return!1;if(e.zone===o)return!0;const l=Sl&&!yt.lastIsOpen?String(Sl.props.id):null;return(!l||$l(e.zone)!==l&&$l(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??pi(e)[t];if(!r)return!1;const i=n.split(":")[0],l=ci.get(i),s=l?pi(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&Nl(r).has(n))return!1;const d=tr(s.type,er(pt?.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?.(pi(n),r))})(e.zone,o,e.index,t)},Tl=(e,n)=>{const t=hn(e.from);if(t===hn(n))return!0;const o=e.node;return Pl({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},jl=e=>{const n=e.slice(0,e.indexOf(":")),t=ci.get(n),o=t?pi(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=tr(o.type,er(pt?.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:ii(r.spec.childType)}]:[]),l=mi(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:Xi(o,t.zone===ae)}},Ml=(e,n)=>{const t=hn(n);if("block"!==e.kind){if(Al(t))return n.index>=0&&n.index<=pi(t).length;if(t!==ae)return!1;const{floor:e,cap:o}=_r();return n.index>=e&&n.index<=o}if(t===ae)return!1;const o=jl(t);return!(!o||!o.choices.some(n=>n.type===e.type))&&!o.target.spec?.addBlocked?.(pi(t))},Rl=(e,n)=>{e.rung?Si(e.rung.nodeId,e.index,n.index):e.add?((e,n)=>{if("block"!==e.kind&&Al(hn(n)))return void Ji(e,hn(n),n.index);if("section"===e.kind)return void Hi(e.type,n.index);if("template"===e.kind)return void Ui(e.template.name,ei(e.template.node),n.index);const t=hn(n),o=jl(t);o&&(o.target.spec?ml(o.parentId,o.target.slot,e.type,n.index,o.parent.type):hl(t,e.type,n.index))})(e.add,n):e.zone===ae?Vi(e.index,n.index):Il(e.zone,hn(n),e.index,n.index)},[Ll]=bn(()=>dn()),El=cn({keyOf:e=>e.id,readOnly:Boolean(rt),session:Ll,canDrop:Pl,onDrop:Rl,onStep:(e,n)=>{e.rung?Si(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===ae?((e,n)=>{const t=si(Zr[e]?.type??""),o=Vi(e,n<0?e-1:e+2);if(!o.moved)return void Nr(n<0?Nt.sectionFirst({name:t}):Nt.sectionLast({name:t}));const{floor:r,cap:i}=_r();Nr(Nt.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):Il(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),Vl=Bn(e=>{const{floor:n,cap:t}=_r(),o=[];for(const r of e.nodes){const e=hn(r.place),i=pi(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(Bt(i)||Ct(i)||Qo(i.type))continue;if(vt(i.type))continue;const l=Boolean(Al(e)),s=e===ae||l;e===ae&&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?si(i.type):wi(i),from:r.place})}const r=e.zones.flatMap(e=>{const n=hn(e.list);return n===ae&&0===e.children.length?[{...e,addLabel:Nt.addSection,addAlways:!0}]:e.children.length>0||Boolean(jl(n)?.choices.length)||Boolean(Al(n))?[e]:[]}),i=r.flatMap(e=>{const n=hn(e.list);return n===ae||Al(n)||!jl(n)?.choices.length?[]:on(e,Nt.addBlockHere)});return{sources:o,zones:r,seams:i}},[pt.data]),Dl=null==mt?.props.id?null:String(mt.props.id),Hl=Bn(e=>{const n=gt,t=e=>!e.item.rung&&null!==Sn(pt.data,n,e.item.id),o=e[e.length-1];if(!t(o))return o;const r=n=>e.find(e=>t(e)&&e.item.id===n),i=r(Dl);return i||(r(Le(pt.data,n,o.item.id,Dl))??o)},[pt.data,gt,Dl]),Ul=e=>{Po(K),Wt.select(e.zone===ae?{index:e.index}:{index:e.index,zone:e.zone})},Fl=ie(),Wl=()=>({data:pt.data,device:qt,ops:Wt,inspector:Xo}),Gl=Fl?.model,Jl=wn(()=>Gl?e=>Gl(e,Vl(e),Wl()):Vl,[Gl,Vl,qt]),Xl=Fl?.measure,Kl=Xl?(e,n)=>Xl(e,n,Wl()):void 0,Yl=Fl?.canDrop,Zl=Yl?(e,n)=>Yl(e,n,Pl,Wl()):Pl,_l=Fl?.drop,Ql=_l?(e,n)=>_l(e,n,Rl,Wl()):Rl,ql=Fl?.pick,es=ql?e=>ql(e,Ul,Wl()):Ul,ns=e=>{const n=hn(e),t=mi(n);t&&yi(t.node,t.slot,!1),Wi(n,e.index)},ts=(e,n,t,o)=>/* @__PURE__ */Rn(Pe,{...rt?{}:El.seam({place:{...kn(e),index:n}}),onAdd:rt?void 0:t,label:o},`seam:${e}:${n}`),os={rowClick:Ki,isCollapsed:zr,toggleCollapse:Br},rs=e=>{const n=String(e.props.id),t=Zr.findIndex(e=>String(e.props.id)===n),o=wt(n),r=pi(o),i=zr(n),l=ii(e.type),s=rr.rowName?rr.rowName(e,"section",l):l,d=e=>ts(o,e,()=>Wi(o,e),Nt.addSectionHere);/* @__PURE__ */
|
|
11
|
+
return Ln(En,{children:[
|
|
12
|
+
/* @__PURE__ */Rn(Oe,{words:$t,icon:/* @__PURE__ */Rn(lr,{type:e.type,size:13}),name:s,preview:_i(e),marks:Qi(e),onSelect:()=>Li(t),nameSlot:zi(ae,t,n,s),selected:Eo===n,actions:qi(e,ae,t)??void 0,rowProps:{"data-node-id":n,onClick:Ki(()=>Li(t))},fold:{open:!i,label:"section",onToggle:()=>Br(n)}}),!i&&/* @__PURE__ */Ln(Ie,{children:[r.map((n,t)=>{const r=String(n.props.id),i=di(n),l=pl(n),s=l&&zr(r),c=()=>fl(o,t,r,e.type),{rowProps:a,...p}=El.row({item:{id:r,zone:o,index:t,type:n.type},place:{...kn(o),index:t}},{"data-node-id":r,onClick:Ki(c)});/* @__PURE__ */
|
|
13
|
+
return Ln(On,{children:[d(t),
|
|
14
|
+
/* @__PURE__ */Rn(Oe,{words:$t,icon:/* @__PURE__ */Rn(lr,{type:n.type,size:13}),name:i,preview:_i(n),marks:Qi(n),onSelect:c,nameSlot:zi(o,t,r,i),selected:Eo===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Br(r)}:void 0,actions:/* @__PURE__ */Ln(En,{children:[Zi(o,t,i),qi(n,o,t),el(o,t,n,i)]}),rowProps:a}),l&&!s&&/* @__PURE__ */Rn(Ie,{children:ss(n,2)})]},r)}),d(r.length)]})]})},is=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=El.dragging,d=!zr(l)&&s?.rung?.nodeId!==i,c={...kn(l),index:0},a=s&&!s.rung&&Pl(s,c)?c:void 0,p=()=>yi(e,n,!0),{rowProps:u,...f}=El.row({item:{id:`rung:${l}`,zone:`${i}:${Un}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:Un,index:t},into:a,canDrag:Boolean(_o.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:Ki(p)}),m=rt?null:_o.slotActions?.(e,n.slot);/* @__PURE__ */
|
|
15
|
+
return Ln(On,{children:[n.heading,
|
|
16
|
+
/* @__PURE__ */Rn(Oe,{words:$t,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:hi===l,...f,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>Br(l)},actions:m&&m.length>0?/* @__PURE__ */Rn(En,{children:m.map((t,o)=>/* @__PURE__ */Rn(Ae,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(rt||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&ki(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__ */Rn(Pn,{size:15}):/* @__PURE__ */Rn(Mn,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */Rn(Ie,{children:r})]},l)},ls=(e,n)=>{const t=il(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
|
|
17
|
+
return Rn(En,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=dl(e.type,void 0,t.slot),d=s?`${e.props.id}:${s.slot}`:null,c=null===t.slot?null:`${e.props.id}:${t.slot}`,a=null!==c&&Boolean(jl(c)?.choices.length),p=(e,n)=>a?ts(e,n,()=>Wi(e,n),Nt.addBlockHere):ts(e,n),u=/* @__PURE__ */Ln(En,{children:[i.map(({child:n,zone:t,index:o})=>{const r=Eo===String(n.props.id),{collapsible:i,folded:s}=cl(n,l,ul(n.type)),d=String(n.props.id),c=Ol(n),a=()=>fl(t,o,d,e.type),{rowProps:u,...f}=El.row({item:{id:d,zone:t,index:o,type:n.type},place:{...kn(t),index:o}},{"data-node-id":d,onClick:Ki(a)});/* @__PURE__ */
|
|
18
|
+
return Ln(On,{children:[0===o&&p(t,0),
|
|
19
|
+
/* @__PURE__ */Rn(Oe,{words:$t,icon:/* @__PURE__ */Rn(lr,{type:n.type,size:13}),name:c,preview:_i(n),marks:Qi(n),onSelect:a,nameSlot:zi(t,o,d,c),selected:r,hidden:Boolean(n.props._hidden),...f,fold:i?{open:!s,label:"group",onToggle:()=>Br(d)}:void 0,actions:/* @__PURE__ */Ln(En,{children:[Zi(t,o,c),qi(n,t,o),el(t,o,n,c)]}),rowProps:u}),i&&!s&&/* @__PURE__ */Rn(Ie,{children:ls(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?is(e,t.rung,r++,o,u):/* @__PURE__ */Rn(On,{children:u},t.slot??"")})})},ss=(e,n)=>{const t=er(pt?.data,e.type,String(e.props.id)),o=il(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
|
|
20
|
+
return Rn(En,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=dl(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,m=p?`${u}:${p.slot}`:null,h=(n,t)=>{const o=n===f&&c&&!c.addBlocked?.(a)?()=>ml(e.props.id,c.slot,c.childType,t,e.type):n===m?()=>Wi(n,t):void 0;return ts(n,t,o,n===f&&c?c.addLabel:Nt.addBlockHere)},g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(c&&!c.fixed&&(null===g||g===f)),k=/* @__PURE__ */Ln(En,{children:[l.map(({child:n,zone:t,index:o})=>{const r=Eo===String(n.props.id),i=wi(n),l=String(n.props.id),{collapsible:d,folded:c}=cl(n,s,ul(n.type)),a=ol(n.type),p=1===a.length?`${l}:${a[0]}`:null,u=p?{...kn(p),index:pi(p).length}:void 0,f=El.dragging,m=u&&f&&Pl(f,u)?u:void 0,g=()=>fl(t,o,l,e.type),{rowProps:y,...k}=El.row({item:{id:l,zone:t,index:o,type:n.type},place:{...kn(t),index:o},into:m,canDrag:!Qo(n.type)},{"data-node-id":l,onClick:Ki(g)});/* @__PURE__ */
|
|
21
|
+
return Ln(On,{children:[0===o&&h(t,0),
|
|
22
|
+
/* @__PURE__ */Rn(Oe,{words:$t,icon:/* @__PURE__ */Rn(lr,{type:n.type,size:13}),name:i,preview:_i(n),marks:Qi(n),onSelect:g,nameSlot:zi(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...k,fold:d?{open:!c,label:"group",onToggle:()=>Br(l)}:void 0,actions:Qo(n.type)?qi(n,t,o)??void 0:/* @__PURE__ */Ln(En,{children:[Zi(t,o,i),qi(n,t,o),el(t,o,n,i)]}),rowProps:y}),d&&!c&&/* @__PURE__ */Rn(Ie,{children:ss(n,s+1)}),h(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&c&&
|
|
23
|
+
/* @__PURE__ */Rn(T,{small:!0,label:c.addLabel,blocked:c.addBlocked?.(a)??null,onAdd:()=>ml(e.props.id,c.slot,c.childType,a.length,e.type)}),null===g?m&&!l.some(e=>e.zone===m)?h(m,0):null:0!==l.length||(o.rung?y:g!==m)?null:h(g,0)]});return o.rung?is(e,o.rung,i++,r,k):/* @__PURE__ */Rn(On,{children:k},o.slot??"")})})},ds=(()=>{if(!mt||!To)return null;const e=String(mt.type),n=String(mt.props.id),t=tr(e,er(pt?.data,e,n));if(!t||"footer"===t.source)return null;const o=Zr.some(e=>String(e.props?.id)===n),r=Array.isArray(mt.props[t.slot])?mt.props[t.slot]:[];if(t.spec?.addBlocked?.(r))return null;const i=t.choices??(t.spec?[{type:t.spec.childType,label:ii(t.spec.childType)}]:[]);return 0===i.length?null:{parentName:Xi(mt,o),choices:i,onPick:o=>{t.spec?ml(n,t.slot,o,r.length,e):hl(`${n}:${t.slot}`,o,r.length)}}})(),cs=Ro&&Ro.zone!==ae&&!Al(Ro.zone)?Ro.zone:null,as=!0===Oo.blocksFirst,ps=cs?jl(cs):as&&Ro?null:ds,us=Boolean(Bo&&cs)||as&&Boolean(ps&&ps.choices.length>0),fs=vo||null!==oo,ms=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:Jt&&!fs&&Zo===e.id,onSelect:()=>Jr(e.id)}:e,hs=[{id:"add",label:Nt.add.title,icon:/* @__PURE__ */Rn("span",{className:"sf-rail-plus","aria-hidden":"true",children:"+"}),active:vo,onSelect:()=>vo?Gi():Fi(null)},...(Ko.railLead??[]).map(ms),{id:"sections",label:Nt.layers,icon:/* @__PURE__ */Rn(Ee,{}),active:Jt&&!fs&&"sections"===Zo,onSelect:()=>Jr("sections")},...(Ko.railTrail??[]).map(ms)];to?hs.push({id:"media",label:Nt.railMedia,icon:/* @__PURE__ */Rn(Ve,{}),active:Jt&&!vo&&(null!==oo||"media"===Zo),onSelect:()=>Jr("media")}):dt&&hs.push({id:"media",label:Nt.railMedia,icon:/* @__PURE__ */Rn(Ve,{}),onSelect:Xr});const gs=[...Ko.railLead??[],...Ko.railTrail??[]].find(e=>"panel"in e&&e.id===Zo),ys=Boolean(It?.foldable)&&!Yo,ks=It?.label??(ct?Nt.pageSections:Nt.templateSections),Ss=ys&&zr(Fn),xs=/* @__PURE__ */Ln(En,{children:[Zr.map((e,n)=>{if(Bt(e)||Ct(e)||vt(e.type))return null;const t=Eo===String(e.props.id),o=Boolean(e.props._hidden);rl(e);const r=String(e.props.id),i=Ko.hasOwnRows?.(e)??!1,l=pl(e)||i,s=l&&zr(r),d=ol(e.type),c=1===d.length?`${r}:${d[0]}`:null,a=c?{...kn(c),index:pi(c).length}:void 0,p=El.dragging,u=a&&p&&Pl(p,a)?a:void 0,{rowProps:f,...m}=El.row({item:{id:r,zone:ae,index:n,type:e.type},place:{...kn(ae),index:n},into:u},{"data-node-id":r,onClick:Ki(()=>Li(n))});/* @__PURE__ */
|
|
24
|
+
return Ln(On,{children:[n>0&&nl(n),
|
|
25
|
+
/* @__PURE__ */Rn(Oe,{words:$t,icon:/* @__PURE__ */Rn(lr,{type:e.type,size:13}),name:di(e),preview:_i(e),marks:Qi(e),onSelect:()=>Li(n),nameSlot:zi(ae,n,r,di(e)),selected:t,hidden:o,...m,fold:l?{open:!s,label:"section",onToggle:()=>Br(r)}:void 0,actions:/* @__PURE__ */Ln(En,{children:[Zi(ae,n,di(e)),qi(e,ae,n),el(ae,n,e,di(e))]}),rowProps:f}),pl(e)&&!s&&/* @__PURE__ */Ln(Ie,{children:[ss(e,1),Ko.partRows?.(e,os)]}),i&&!s&&/* @__PURE__ */Rn(Ie,{children:Ko.ownRows?.(e,n,os)})]},String(e.props.id??n))}),!Yo&&zl>0&&nl(zl),It?.addAtEnd&&!Yo&&!rt&&/* @__PURE__ */Rn(T,{small:!0,label:Nt.addSection,blocked:null,onAdd:()=>Fi(zl)})]}),vs=(e,n,t)=>{const o=String(e.props.id),r=ll(e).length>0||sl(e)||Boolean(tr(e.type)),i=r&&zr(o),l="header"===t?Nt.header:Nt.footer,s=rr.rowName?rr.rowName(e,"section",l):l;/* @__PURE__ */
|
|
26
|
+
return Ln(En,{children:[
|
|
27
|
+
/* @__PURE__ */Rn(Oe,{words:$t,icon:/* @__PURE__ */Rn(lr,{type:t,size:13}),name:s,preview:_i(e),marks:Qi(e),onSelect:()=>Li(n),nameSlot:zi(ae,n,o,s),selected:Eo===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Br(o)}:void 0,actions:qi(e,ae,n)??void 0,rowProps:{"data-node-id":o,onClick:Ki(()=>Li(n))}}),r&&!i&&/* @__PURE__ */Rn(Ie,{children:ls(e,1)})]})};return(Ko.wrap??(e=>e))(
|
|
28
|
+
/* @__PURE__ */Rn(le,{target:ho,children:/* @__PURE__ */Ln("div",{ref:mo,className:"sf-editor es-editor",style:Ze(Sr),onContextMenu:$i.onEditorContextMenu,...g(un),children:[
|
|
29
|
+
/* @__PURE__ */Ln(De,{children:[
|
|
30
|
+
/* @__PURE__ */Rn(He,{items:hs,ariaLabel:Nt.bar.views}),
|
|
31
|
+
/* @__PURE__ */Ln(Ue,{children:[
|
|
32
|
+
/* @__PURE__ */Rn(Fe,{label:Nt.bar.undo,disabled:Boolean(rt)||!ft.hasPast,onClick:()=>ft.back(),children:/* @__PURE__ */Rn(Nn,{})}),
|
|
33
|
+
/* @__PURE__ */Rn(Fe,{label:Nt.bar.redo,disabled:Boolean(rt)||!ft.hasFuture,onClick:()=>ft.forward(),children:/* @__PURE__ */Rn($n,{})}),
|
|
34
|
+
/* @__PURE__ */Rn(We,{}),
|
|
35
|
+
/* @__PURE__ */Rn(Ge,{devices:Kt,value:qt,onChange:eo}),
|
|
36
|
+
/* @__PURE__ */Rn(Fe,{label:Nt.bar.refresh,tip:Nt.bar.refreshTip,onClick:()=>{fo.current=(()=>{const e=ho?.document;if(!e)return null;const n=Zr.findIndex(Ct),t=n>=0?n:Zr.length;let o=null;for(let n=0;n<t;n++){const t=Zr[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=mt?.props?.id??Zr[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),uo(e=>e+1)},children:/* @__PURE__ */Rn(An,{})})]}),
|
|
37
|
+
/* @__PURE__ */Ln(Ue,{kind:"right",style:{minWidth:300},children:[
|
|
38
|
+
/* @__PURE__ */Rn(C,{input:So,words:Nt.saveStatus}),Ko.barLead?.(),Ko.barTrail?.(),Ko.mainAction||!Ko.barMain?/* @__PURE__ */Rn(O,{input:So,action:Ko.mainAction??{label:Nt.done,onPress:()=>{Zn(pt.data)}},readOnly:Boolean(rt),saveSwitch:lt,onToggleAutoSave:et,onSaveNow:xo,bar:Nt.bar,words:Nt.saveStatus}):Ko.barMain()]})]}),
|
|
39
|
+
/* @__PURE__ */Rn(B,{}),
|
|
40
|
+
/* @__PURE__ */Ln("div",{className:"sf-body",children:[Jt?/* @__PURE__ */Ln(En,{children:[
|
|
41
|
+
/* @__PURE__ */Rn("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":Nt.leftPanel,children:vo?/* @__PURE__ */Rn(j,{blocks:ps,blocksOnly:us,at:Bo?{label:(e=>{const n=Al(e.zone);if(n)return Nt.add.addingTo({name:rr.rowName?Xi(n,!0):ii(n.type)});if(e.zone===ae){const n=Zr[e.index];return n&&!Ct(n)?Nt.add.addingBefore({name:Xi(n,!0)}):Nt.add.addingAtEnd}const t=jl(e.zone);return t?Nt.add.addingTo({name:t.parentName}):Nt.add.addingHere})(Bo),onClear:()=>Co(null)}:void 0,onAdd:e=>{const n=Ro,t=(e,n)=>{Bo&&Co({zone:e,index:n})};if(n&&"block"!==e.kind&&Al(n.zone))return Ji(e,n.zone,n.index),void t(n.zone,n.index+1);if("section"===e.kind)return(e=>{if(null===Lo)return void Hi(e);const n=Hi(e,Lo);Bo&&Io(n+1)})(e.type);if("template"===e.kind)return((e,n)=>{if(null===Lo)return void Ui(e,n);const t=Ui(e,n,Lo);Bo&&Io(t+1)})(e.template.name,ei(e.template.node));if(n&&n.zone!==ae){const o=jl(n.zone);if(!o)return;return o.target.spec?ml(o.parentId,o.target.slot,e.type,n.index,o.parent.type):hl(n.zone,e.type,n.index),void t(n.zone,n.index+1)}ds?.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:Ll,siteWide:Ko.addPanelRow?.(Gi),onClose:Gi,onHide:Wr,readOnly:Boolean(rt)}):oo&&no?
|
|
42
|
+
/* @__PURE__ */Rn(L,{panel:no,pick:oo,onHide:Wr}):gs?gs.panel({onHide:Wr,notify:Nr}):"media"===Zo&&no?/* @__PURE__ */Rn(L,{panel:no,pick:null,onHide:Wr}):/* @__PURE__ */Ln(En,{children:[
|
|
43
|
+
/* @__PURE__ */Rn(M,{icon:/* @__PURE__ */Rn(Ee,{}),title:Nt.layers,context:Lt,actions:
|
|
44
|
+
/* @__PURE__ */Rn(Je,{label:Cl?Nt.expandAll:Nt.collapseAll,title:0===Bl.length?Nt.nothingToFold:void 0,disabled:0===Bl.length,onClick:()=>kr(e=>{const n=new Set(Bl);return Cl?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...Bl])}),children:/* @__PURE__ */Rn(Vn,{expand:Cl})}),onHide:Wr}),
|
|
45
|
+
/* @__PURE__ */Ln(Ne,{className:"sf-tree sf-scroll",words:$t,children:[
|
|
46
|
+
/* @__PURE__ */Rn(Oe,{words:$t,icon:/* @__PURE__ */Rn(lr,{type:"page",size:13}),name:Nt.pageSettings,onSelect:Kr,selected:!mt&&To,rowProps:{onClick:Ki(Kr)}}),wl&&/* @__PURE__ */Ln(En,{children:[
|
|
47
|
+
/* @__PURE__ */Rn($e,{children:Nt.header}),rs(wl)]}),!Yo&&at&&/* @__PURE__ */Ln(En,{children:[
|
|
48
|
+
/* @__PURE__ */Rn($e,{children:Nt.header}),!Ot&&/* @__PURE__ */Rn(Oe,{words:$t,icon:/* @__PURE__ */Rn(lr,{type:"header",size:13}),name:Nt.header,onSelect:Yr,selected:Ao.kind===zt?.kind,rowProps:{onClick:Ki(Yr)}})]}),!Yo&&vl&&vs(vl,xl,"header"),!Yo&&!ys&&/* @__PURE__ */Rn($e,{children:ks}),ys?/* @__PURE__ */Ln(En,{children:[
|
|
49
|
+
/* @__PURE__ */Rn(Oe,{words:$t,icon:null,name:ks,fold:{open:!Ss,label:ks,onToggle:()=>Br(Fn)}}),!Ss&&/* @__PURE__ */Rn(Ie,{children:xs})]}):xs,at&&/* @__PURE__ */Rn($e,{children:Nt.footer}),Sl&&vs(Sl,kl,"footer"),!Yo&&!Sl&&at&&/* @__PURE__ */Rn(Oe,{words:$t,icon:/* @__PURE__ */Rn(lr,{type:"footer",size:13}),name:Nt.footer,onSelect:Yi,rowProps:{onClick:Ki(Yi),title:Nt.editFooter}}),bl&&rs(bl),Ko.treeFoot?.()]})]})}),
|
|
50
|
+
/* @__PURE__ */Rn(Xe,{side:"left",width:Sr.left,min:Ye,max:Ke,defaultWidth:S.left,label:Nt.resizeLeftPanel,onResize:wr})]}):/* @__PURE__ */Rn(R,{side:"left",onShow:Wr}),
|
|
51
|
+
/* @__PURE__ */Ln("div",{ref:$r,className:"sf-center sf-scroll","data-sf-canvas-head":Mr?"":void 0,style:{overflowX:Hr?"auto":"hidden",overflowY:"hidden"},children:[Mr&&/* @__PURE__ */Rn("div",{ref:Rr,className:"sf-canvas-head",children:/* @__PURE__ */Rn(Mr,{device:qt})}),
|
|
52
|
+
/* @__PURE__ */Rn("div",{className:"sf-frame-scaler",style:Ur,children:/* @__PURE__ */Rn("div",{className:"sf-frame "+(qt===_t?"":`sf-frame--${qt}`),style:Fr,children:/* @__PURE__ */Ln("div",{className:"sf-preview-host",children:[
|
|
53
|
+
/* @__PURE__ */Rn(Et,{},po),
|
|
54
|
+
/* @__PURE__ */Rn(rn,{canvas:ho,session:Ll,model:Jl,measure:Kl,canDrop:Zl,onDrop:Ql,choose:Hl,onPick:es,onZoneAdd:ns,onSeamAdd:ns,zoneAddLabel:Nt.canvasAddBlock,words:At.canvas,readOnly:Boolean(rt),revision:pt.data}),No.length>0&&/* @__PURE__ */Rn("div",{className:"sf-preview-gaps",children:No.map(e=>
|
|
55
|
+
/* @__PURE__ */Rn(ln,{index:e.index,label:Nt.addSectionHere,onInsert:()=>Fi(e.index),className:void 0===e.height?"sf-preview-gap":"sf-preview-gap sf-preview-gap--tight",style:void 0===e.height?{top:e.top}:{top:e.top,height:e.height}},e.index))})]})})})]}),Xt?/* @__PURE__ */Ln(En,{children:[
|
|
56
|
+
/* @__PURE__ */Rn(y,{value:{selectChild:fl,addChild:ml,childRowName:wi,blockRowName:Ol},children:/* @__PURE__ */Rn(Vt,{mode:Ao,onOpenWebsiteSettings:Ko.openSettings??(()=>{}),onOpenSiteStyles:Ko.openStyles,onSelectNode:ar,onNotify:Nr,onHidePanel:Gr,nodeActions:mt?pe(gt,mt.type):Wn})}),
|
|
57
|
+
/* @__PURE__ */Rn(Xe,{side:"right",width:Sr.right,min:Ye,max:Ke,defaultWidth:S.right,label:Nt.resizeSettingsPanel,onResize:br})]}):
|
|
58
|
+
/* @__PURE__ */Rn(R,{side:"right",onShow:Gr})]}),$i.menu]})}))}export{Gn as ScreenChrome};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useEaselHost as n}from"./chunk-U3JP4VGF.js";import{useEaselApi as e,bindUndoKeys as t}from"./chunk-KYG35KKJ.js";import{useState as r,useEffect as o,useRef as u}from"react";function c(e){const t=n(),[u,c]=r(null);return o(()=>c(e.current),[e]),t.ownsDocument?"undefined"==typeof document?null:document:u}function i(r,u){const i=n(),s=e(),f=c(r);o(()=>{if(!i.ownsDocument&&f)return t(f,s,{leaveTyping:!0})},[i,s,f]);const m=u?.document??null;o(()=>{if(!i.ownsDocument&&m)return t(m,s,{leaveTyping:!0})},[i,s,m])}function s(n){return n.ownsDocument?{}:{tabIndex:-1}}function f(n){return!n.altKey&&!n.shiftKey&&(!(!n.metaKey&&!n.ctrlKey)&&("s"===n.key||"S"===n.key||"KeyS"===n.code))}function m(n,e,t){const r=c(n),i=u(t);o(()=>{i.current=t}),o(()=>{if(!r)return;const n=n=>{f(n)&&(n.preventDefault(),i.current())};return r.addEventListener("keydown",n),()=>r.removeEventListener("keydown",n)},[r]);const s=e?.document??null;o(()=>{if(!s)return;const n=n=>{f(n)&&(n.preventDefault(),i.current())};return s.addEventListener("keydown",n),()=>s.removeEventListener("keydown",n)},[s])}export{s as editorRootFocus,f as isSaveShortcut,c as useEaselKeyTarget,m as useEaselSaveKey,i as useEaselUndoKeys};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{clientOnly as r}from"./chunk-GXQCZJOP.js";import{ScreenStoreProvider as n}from"./chunk-BSZ54Q2T.js";import{ScreenChrome as e}from"./chunk-246ONJJH.js";import{ScreenDocumentProvider as i,useScreenDocument as a}from"./chunk-THZ46DC5.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-JTUUIVBZ.js";import{documentPermissions as s}from"./chunk-THWO5YVZ.js";import{useWords as c}from"./chunk-MFIRYGHW.js";import{useMemo as t,useState as d,useRef as l,useEffect as m,useCallback as g}from"react";import{Dialog as h,Button as f}from"efficient-shell/ui";import{jsx as u,jsxs as p,Fragment as v}from"react/jsx-runtime";var k=r(n),C=r(e);function N({onCancel:r,onDiscard:n,onSave:e}){const i=c("screen",o).leave,[a,s]=d(!1),t=l(!0);m(()=>(t.current=!0,()=>{t.current=!1}),[]);const k=g(async()=>{s(!0);try{await e()}finally{t.current&&s(!1)}},[e]);/* @__PURE__ */
|
|
2
|
+
return u(h,{open:!0,role:"alertdialog",size:"sm",title:i.title,onClose:r,footer:/* @__PURE__ */p(v,{children:[
|
|
3
|
+
/* @__PURE__ */u(f,{variant:"secondary",onClick:r,children:i.cancel}),
|
|
4
|
+
/* @__PURE__ */u(f,{variant:"ghost-danger",onClick:n,children:i.discard}),
|
|
5
|
+
/* @__PURE__ */u(f,{variant:"primary",loading:a,onClick:()=>{k()},children:i.save})]}),children:i.body})}function j({target:r,addressing:n,onHostMessage:e,children:a}){/* @__PURE__ */
|
|
6
|
+
return u(i,{target:r,addressing:n,onHostMessage:e,children:a})}var y=(r,n)=>/* @__PURE__ */p(v,{children:[r,n]});function H({config:r,parts:n,wrap:e=y}){const{data:i,error:d,redirecting:l,ready:m,readOnly:g,onChange:h,pendingNav:f,cancelPendingNav:p,discardAndNavigate:v,saveAndNavigate:j}=a(),H=t(()=>s(!g),[g]),Z=c("screen",o);return l?/* @__PURE__ */u("div",{className:"sf-msg",children:Z.loading}):d?/* @__PURE__ */u("div",{className:"sf-msg sf-msg--error",children:d}):m?i?e(
|
|
7
|
+
/* @__PURE__ */u(k,{config:r,data:i,onChange:h,permissions:H,parts:n,children:/* @__PURE__ */u(C,{})}),f&&/* @__PURE__ */u(N,{onCancel:p,onDiscard:v,onSave:j})):/* @__PURE__ */u("div",{className:"sf-msg",children:Z.loading}):/* @__PURE__ */u("div",{className:"sf-msg",children:Z.waitingForAuthorization})}export{H as DocumentScreen,j as ScreenMount};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{hidableText as n}from"./chunk-6W7WLPZH.js";import{textFieldIdentifier as r}from"./chunk-DUVRZ456.js";function t(r,t){const o=n(r.props.name);if(o)return o;const e=n(r.props.altName);if(e)return e;const c=r.props.collection?.name;if(c)return c;const u=r.props.source?.title;if(u)return u;const s=r.props.code;return s?t?.(s)??s:""}function o(n,r,o,e,c){const u=o(t(n,e))||r(n.type);return c?c(n,"block",u):u}function e(n){if(!n)return null;for(const t of["name","altName"])if(r(n[t]))return t;return null}function c(n){const t=n?.name;return void 0===t||r(t)?"name":null}function u(r,t,o){const e=n(r.props?.name).trim()||t;return o?o(r,"section",e):e}export{u as rootRowName,c as sectionRenameProp,t as slotChildName,e as slotChildRenameProp,o as slotChildRowName};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{panelFieldsOf as t}from"./chunk-ZE7I3PLX.js";import{withoutDeviceGate as o,deviceMetaOf as n}from"./chunk-
|
|
1
|
+
import{panelFieldsOf as t}from"./chunk-ZE7I3PLX.js";import{withoutDeviceGate as o,deviceMetaOf as n}from"./chunk-OGCROOTI.js";import{DESIGN_GROUP_KEY as e,BUCKET_KEY as r}from"./chunk-MQNBD6AB.js";import{ANCHOR_FIELD_KEYS as s,foldMetaOf as c,MEDIA_FIELD_MARKER as i,TEXT_FIELD_MARKER as p,LINK_FIELD_MARKER as u}from"./chunk-DUVRZ456.js";import{STYLE_KIND as a,fieldKind as f,copyStyle as l,heldStyle as m,planPaste as h,pasteMessage as y}from"./chunk-V7U33NF2.js";var j=/* @__PURE__ */new Set([e.Size,e.Design,e.Layout,e.Position]),w=new Set(Object.values(e)),b=new Set(Object.values(r)),S=new Set(s),g=/* @__PURE__ */new Set(["focal","imageFocal"]),k=[i,p,u];function O(t){return`site:${t??""}`}function v(t){if(!t||"object"!=typeof t)return null;const n=t,e=o(t)??t,r=n[a]??e[a];if("string"==typeof r)return r;const s=n.options??e.options;if(Array.isArray(s)){return`choice:${s.map(t=>String(t?.value)).sort().join("|")}`}return f(e)}function D(t){const n=t,e=o(t);return k.some(t=>t in n||e&&t in e)}function d(o,e){const s=t(o,e)??{},i=[];let p=!0,u=!1;for(const[t,o]of Object.entries(s))b.has(t)?(p=t===r.Design,u=!1):w.has(t)?p&&(u=j.has(t)):u&&o&&"object"==typeof o&&!t.startsWith("_")&&(c(o)||S.has(t)||g.has(t)||D(o)||"slot"!==o.type&&i.push({path:[t],kind:v(o),counted:"mobile"!==n(o)?.tier}));return i}function A(t,o,n,e,r){l({scope:n,type:e.type,label:r,rows:t(o,e),props:e.props})}function I(t,o,n,e,r,s){const c=m(n);if(!c)return null;const i=h(c,{type:e.type,rows:t(o,e),props:e.props});return{...i,message:y(i,c.sourceLabel,r,s)}}function L(t,o,n,e){A(d,t,o,n,e)}function B(t,o,n,e,r){return I(d,t,o,n,e,r)}var F={scope:t=>O(t.siteId),rows:(t,o)=>d(t,o),copy:(t,o,n,e)=>L(e,t,o,n),plan:(t,o,n,e)=>B(e,t,o,n)};function N(t,o){if(!t&&!o)return F;const n=t?.rows,e=n?(t,o)=>n(t,o):d;return{scope:t?.scope??F.scope,rows:(t,o)=>e(t,o),copy:t?.copy??((t,o,n,r)=>A(e,r,t,o,n)),plan:t?.plan??((t,n,r,s)=>I(e,s,t,n,r,o))}}export{L as copyNodeStyle,d as nodeStyleRows,B as planNodePaste,v as shopFieldKind,O as siteStyleScope,N as styleClipboardOf};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useScreenOwnerName as e}from"./chunk-E3PD66A3.js";import{settlePanelPick as n}from"./chunk-R6WTQWAC.js";import{MediaPanelHead as i,mediaPickKind as c}from"./chunk-
|
|
1
|
+
import{useScreenOwnerName as e}from"./chunk-E3PD66A3.js";import{settlePanelPick as n}from"./chunk-R6WTQWAC.js";import{MediaPanelHead as i,mediaPickKind as c}from"./chunk-QVUVDBGA.js";import{jsxs as o,Fragment as r,jsx as t}from"react/jsx-runtime";function l({panel:l,pick:d,onHide:m}){const p=e();/* @__PURE__ */
|
|
2
2
|
return o(r,{children:[
|
|
3
3
|
/* @__PURE__ */t(i,{context:p,pick:d?{kind:c(d.accept),field:d.title||void 0}:null,onCancel:()=>d&&n(d.requestId,null),onHide:m}),
|
|
4
4
|
/* @__PURE__ */t("div",{className:"sf-media-panel",children:/* @__PURE__ */t(l,{pick:d,onPick:e=>d&&n(d.requestId,e)})})]})}export{l as MediaSidePanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEFAULT_PANEL_W as s,clampPanelWidth as e}from"./chunk-
|
|
1
|
+
import{DEFAULT_PANEL_W as s,clampPanelWidth as e}from"./chunk-QVUVDBGA.js";var a="sf-editor-panel-widths",l="sf-editor-collapsed-sections";function t(s){return s?{panelWidths:`${s}-panel-widths`,collapsed:`${s}-collapsed-sections`}:{panelWidths:a,collapsed:l}}var o={...s},d=s=>e(s);export{l as COLLAPSED_SECTIONS_KEY,o as DEFAULT_PANEL_W,a as PANEL_WIDTHS_KEY,d as clampPanelWidth,t as screenStorageKeys};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{useNow as e,describeSave as t}from"./chunk-RKTF5XLP.js";import{SaveIcon as a}from"./chunk-QVUVDBGA.js";import{SplitButton as n,Kbd as s,CMD_S as i}from"efficient-shell/ui";import{CloudIcon as o,CheckIcon as l}from"efficient-shell/icons/efficient";import{jsx as r,jsxs as d}from"react/jsx-runtime";var c=e=>e.state.failed&&null!=e.state.retryAt||null!=e.state.savedAt;function u({input:n,words:s}){const i=e(c(n)),o=t({...n,now:i},s);/* @__PURE__ */
|
|
2
|
+
return r(a,{state:o.state,label:o.label})}function m({input:a,action:u,readOnly:m,saveSwitch:p,onToggleAutoSave:b,onSaveNow:v,bar:f,words:y}){const h=e(c(a)),k=t({...a,now:h},y),w=k.retry?f.retry:f.saveNow,S=/* @__PURE__ */d("span",{className:"es-savemenu-row",children:[w,
|
|
3
|
+
/* @__PURE__ */r("span",{"aria-hidden":"true",children:/* @__PURE__ */r(s,{keys:i,size:"sm"})})]}),A=[{type:"status",key:"status",label:k.line(u.status)},{type:"divider",key:"divider"},...p?[{type:"checkbox",key:"auto-save",label:f.autoSave,checked:!a.state.paused,disabled:m,onSelect:b}]:[],{key:"save-now",label:S,icon:/* @__PURE__ */r(o,{}),disabled:m,onSelect:v}],g=u.quiet??null,j=k.blocked??u.disabledReason??g?.reason??null;/* @__PURE__ */
|
|
4
|
+
return r(n,{variant:g?"secondary":"primary",leftIcon:g?/* @__PURE__ */r(l,{}):void 0,onClick:()=>u.onPress(),disabled:null!==j,disabledReason:j??void 0,tooltip:u.tooltip,loading:!0===u.busy,menuLabel:f.saveOptions,items:A,menuMinWidth:300,children:g?g.label:u.label})}export{m as ScreenMainButton,u as ScreenSaveIcon};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{blockRuns as e}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as r}from"./chunk-E3PD66A3.js";import{DEFAULT_SCREEN_WORDS as s}from"./chunk-
|
|
1
|
+
import{blockRuns as e}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as r}from"./chunk-E3PD66A3.js";import{DEFAULT_SCREEN_WORDS as s}from"./chunk-JTUUIVBZ.js";import{useWords as t}from"./chunk-MFIRYGHW.js";import{DropdownMenu as n}from"efficient-shell/ui";import{jsxs as c,Fragment as i,jsx as o}from"react/jsx-runtime";function l({choices:l,onPick:p}){const{Icon:a}=r(),m=t("screen",s),u=e(l).flatMap(e=>[...e.group?[{type:"label",key:`group:${e.group}`,label:/* @__PURE__ */c(i,{children:[e.group," ",
|
|
2
2
|
/* @__PURE__ */o("span",{className:"sf-menugroup-count",children:e.items.length})]})}]:[],...e.items.map(e=>({key:e.type,label:e.label,icon:/* @__PURE__ */o("span",{className:"sf-chip",children:/* @__PURE__ */o(a,{type:e.type,size:13})}),onSelect:()=>p(e.type)}))]);/* @__PURE__ */
|
|
3
3
|
return o(n,{align:"start",triggerClassName:"sf-add-card",items:u,trigger:/* @__PURE__ */c(i,{children:[
|
|
4
4
|
/* @__PURE__ */o("span",{className:"sf-plus sf-plus--sm",children:"+"}),m.addBlockMenu]})})}export{l as AddBlockRow};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={title:"Add",contextBlocks:"Blocks for this place",contextAll:"Sections and blocks",done:"Done",doneDescription:"Close Add and go back",startBlank:"Start blank",templates:"Your templates",inside:({name:e})=>`Inside ${e}`,tile:({name:e})=>`Add ${e}`,hintBlocks:"Drag into the page, or click to add.",hint:"Drag onto the page, or click to add.",searchBlocks:"Search blocks",searchSections:"Search sections",addingTo:({name:e})=>`Adding to ${e}`,addingBefore:({name:e})=>`Adding before ${e}`,addingAtEnd:"Adding at the end of the page",addingHere:"Adding here"};var a={savedAgo:function({seconds:e}){const a=Math.max(0,Math.floor(e));if(a<1)return"Saved just now";if(a<60)return`Saved ${a} second${1===a?"":"s"} ago`;const o=Math.floor(a/60);if(o<60)return`Saved ${o} minute${1===o?"":"s"} ago`;const t=Math.floor(o/60);return`Saved ${t} hour${1===t?"":"s"} ago`},saved:"All changes saved",saving:"Saving",pending:"Changes not saved yet — saving in a moment",failedIn:({seconds:e})=>`Not saved — trying again in ${e} s`,failedSoon:"Not saved — trying again soon",offline:"You’re offline — we’ll save when you’re back",pausedHeld:"Auto-save is off — changes not saved",paused:"Auto-save is off",locked:({editing:e})=>`Not saving — ${e}`,blockedOffline:"You’re offline. Try again when you’re back online.",blockedFailed:"Your last changes are not saved yet. Try again when they are.",blockedConflict:"Your last save was refused. See the notice below."},o={loading:"Loading…",waitingForAuthorization:"Waiting for editor authorization…",missingTemplatePage:"Couldn’t open a page in this template.",missingPage:({slug:e})=>`No page with slug "${e}".`,missingDocument:"Couldn’t open this document.",loadFailed:({cause:e})=>`Could not load the document — ${e}`,noun:"page",pageSettings:"Page settings",header:"Header",footer:"Footer",pageSections:"Page",templateSections:"Template",addSection:"Add section",addSectionBefore:({name:e})=>`Add section before ${e}`,addSectionHere:"Add section here",done:"Done",copied:({name:e})=>`Copied ${e}`,pasteRefused:({name:e})=>`${e} can’t be pasted here.`,add:e,canvasAddBlock:"Add block",railMedia:"Media library",leftPanel:"Left panel",resizeLeftPanel:"Resize left panel",leave:{title:"Unsaved changes",body:"Your most recent edits haven’t finished saving yet. Save them before switching, or leave and discard them.",cancel:"Cancel",discard:"Discard & leave",save:"Save & leave",saving:"Saving…"},bar:{undo:"Undo",redo:"Redo",refresh:"Reload the preview",refreshTip:"Reload the preview (keeps your place)",notSaving:"Not saving — see the notice below",retry:"Retry now",autoSaveOff:"Auto-save is off — click to turn it back on (saves your held edits)",autoSaveOn:"Auto-save is on — click to pause it",views:"Left panel views",saveOptions:"Save options",autoSave:"Auto-save",saveNow:"Save now"},saveStatus:a,menu:{undo:"Undo",redo:"Redo",addSection:"Add section",collapseAll:"Collapse all layers",selectAll:"Select all",pinned:"Pinned — can’t be moved or deleted",clipboardRefused:"Your browser won’t let us read the clipboard — press ⌘V"},layers:"Layers",expandAll:"Expand all sections",collapseAll:"Collapse all sections",nothingToFold:"Nothing to fold on this page",editFooter:"Edit the site footer",rename:"Rename",deleteNamed:({name:e})=>`Delete ${e}`,hideNamed:({name:e})=>`Hide ${e}`,showNamed:({name:e})=>`Show ${e}`,addBlockHere:"Add block here",sectionFirst:({name:e})=>`“${e}” is already first`,sectionLast:({name:e})=>`“${e}” is already last`,sectionMoved:({name:e,n:a,total:o})=>`Moved “${e}” to position ${a} of ${o}`,sectionAdded:({name:e})=>`Added “${e}” section`,deleted:({name:e})=>`Deleted “${e}”`,resizeSettingsPanel:"Resize settings panel",sectionSettings:({name:e})=>`${e} settings`,headerSettings:"Header settings",addBlockMenu:"Add block",deviceNote:{tablet:"Tablet uses the desktop settings.",mobile:"Showing the phone settings for this section."}};export{e as DEFAULT_SCREEN_ADD_WORDS,a as DEFAULT_SCREEN_SAVE_STATUS_WORDS,o as DEFAULT_SCREEN_WORDS};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useScreenDocument as n}from"./chunk-
|
|
1
|
+
import{useScreenDocument as n}from"./chunk-THZ46DC5.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-JTUUIVBZ.js";import{EditNotice as r}from"./chunk-QVUVDBGA.js";import{useWords as e}from"./chunk-MFIRYGHW.js";import{jsx as i}from"react/jsx-runtime";function t(){const{capabilities:t,access:c,takeOverEditing:a,viewReadOnly:s,saveConflict:m,reloadFromServer:u}=n(),{noun:l}=e("screen",o);return t.hasEditGuard?/* @__PURE__ */i(r,{access:c,conflict:m,noun:l,onTakeOver:a,onViewReadOnly:s,onReload:u}):null}export{t as PageEditGuardNotices};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{saveIndicator as e}from"./chunk-H6DDIBQ4.js";import{useRef as n,useEffect as t,useState as u,useSyncExternalStore as r,useMemo as l}from"react";var o=1e3,s=3e3,i=5e3,a=[2e3,5e3,15e3,3e4];function c(e,n=a){const t=n.length-1;return n[Number.isFinite(e)?Math.min(Math.max(Math.trunc(e),0),t):t]}var d={now:()=>Date.now(),setTimeout:(e,n)=>globalThis.setTimeout(e,n),clearTimeout:e=>globalThis.clearTimeout(e)};function f(e={}){const n=e.clock??d,t=e.debounceMs??1e3,u=e.maxWaitMs??3e3,r=e.unsavedAfterMs??5e3,l=e.retryDelays??a;let o=e.save??(()=>Promise.reject(new Error("autosave used before setSave"))),s=null,i=null,f=null,m=0,v=null,h=0,p=!1,w=!1,g=!1,b=!1,y=!1,T=!1,M=null,P=null,S=0,E=null,L=null;const D=/* @__PURE__ */new Set;let x=F();function F(){return{pending:null!==s,unsaved:T,failed:p,attempt:h,saved:w,paused:g,stopped:b,savedAt:M,retryAt:P,saving:null!==v&&T}}function N(){if(y)return;const e=F();if(!Object.keys(e).every(n=>e[n]===x[n])){x=e;for(const e of[...D])e()}}function j(){null!==E&&n.clearTimeout(E),E=null,P=null}function k(e){j(),E=n.setTimeout(()=>{E=null,H()},e)}function A(){const e=n.now(),r=Math.min(m+t,(i??e)+u);k(Math.max(0,r-e))}function B(){if(null!==L&&n.clearTimeout(L),L=null,null===i)return void(T=!1);const e=i+r-n.now();T=e<=0,T||(L=n.setTimeout(()=>{L=null,T=!0,N()},e))}function H(){if(v)return v;if(y||b||!s)return Promise.resolve(null===s);j();const t=s,u=S;return f=null,v=Promise.resolve().then(()=>o(t.value)).then(()=>(u!==S||(v=null,w=!0,M=n.now(),p=!1,h=0,s===t?(s=null,i=null):i=f??n.now(),f=null,B(),!s||g||b||y||A(),N()),!0),t=>{if(u!==S)return!1;if(v=null,f=null,b||y)return N(),!1;p=!0;const r=h;if(h=r+1,e.onFailure?.(t,r),!g){const e=c(r,l);k(e),P=n.now()+e}return N(),!1}),N(),v}async function I(){for(;;){if(y||b)return null===s;if(!v&&!s)return!0;if(!await(v??H()))return!1}}return{setSave(e){o=e},push(e){if(y)return;const t=n.now();s={value:e},m=t,v&&null===f&&(f=t),null===i&&(i=t,B()),g||b||v||p||A(),N()},flush:I,retryNow:()=>(h=0,I()),pause(){y||g||(g=!0,j(),N())},resume:()=>y?Promise.resolve(null===s):(g=!1,N(),I()),stop(){y||(b=!0,j(),N())},reset(){y||(S++,v=null,j(),s=null,i=null,f=null,h=0,p=!1,w=!1,M=null,b=!1,B(),N())},hasPending:()=>null!==s,getSnapshot:()=>x,subscribe:e=>(D.add(e),()=>{D.delete(e)}),dispose(){j(),null!==L&&n.clearTimeout(L),L=null,y=!0}}}function m(e,n={document:document,window:window}){const t=n.document,u=n.window,r=()=>{"hidden"===t.visibilityState&&e()},l=()=>e();return t.addEventListener("visibilitychange",r),u.addEventListener("pagehide",l),()=>{t.removeEventListener("visibilitychange",r),u.removeEventListener("pagehide",l)}}function v(e){const n=e.getSnapshot();n.paused||n.stopped||e.flush()}function h(o){const s=n(o);t(()=>{s.current=o});const[i]=u(()=>f({...o,save:e=>s.current.save(e),onFailure:(e,n)=>s.current.onFailure?.(e,n)})),a=r(i.subscribe,i.getSnapshot,i.getSnapshot);t(()=>m(()=>v(i)),[i]);const c=o.warnBeforeUnload??!0;return t(()=>{if(!c)return;const e=e=>{i.hasPending()&&(e.preventDefault(),e.returnValue="")};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[i,c]),t(()=>()=>v(i),[i]),l(()=>({state:a,indicator:e(a),push:i.push,flush:i.flush,retryNow:i.retryNow,pause:i.pause,resume:i.resume,stop:i.stop,reset:i.reset,hasPending:i.hasPending}),[i,a])}export{o as AUTOSAVE_DEBOUNCE_MS,s as AUTOSAVE_MAX_WAIT_MS,a as AUTOSAVE_RETRY_DELAYS_MS,i as AUTOSAVE_UNSAVED_AFTER_MS,c as autosaveRetryDelay,f as createAutosave,m as installTabAwayFlush,h as useAutosave};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{noControlField as e}from"./chunk-7F52SZOI.js";import{usePreviewDevice as n}from"./chunk-BSPCSC45.js";import{DEFAULT_SCREEN_WORDS as r}from"./chunk-
|
|
1
|
+
import{noControlField as e}from"./chunk-7F52SZOI.js";import{usePreviewDevice as n}from"./chunk-BSPCSC45.js";import{DEFAULT_SCREEN_WORDS as r}from"./chunk-JTUUIVBZ.js";import{useWords as t}from"./chunk-MFIRYGHW.js";import{jsx as o}from"react/jsx-runtime";function i(e){return"mobile"===e?"mobile":"desktop"}var c={desktop:null,tablet:r.deviceNote.tablet,mobile:r.deviceNote.mobile},u="data-sf-device-hidden";function d(){/* @__PURE__ */
|
|
2
2
|
return o("span",{hidden:!0,[u]:""})}function s({tier:e,render:r,...t}){return i(n())===e?/* @__PURE__ */o(r,{...t}):/* @__PURE__ */o(d,{})}var m="__device";function f(e){const n=e?.[m];return n??null}function l(e){return f(e)?.inner??e}function a(e,n){const r=n.render;return{...n,[m]:{tier:e,inner:n},render:n=>/* @__PURE__ */o(s,{tier:e,render:r,...n})}}function p(){const e=t("screen",r).deviceNote,i=n(),c="desktop"===i?null:e[i];return c?/* @__PURE__ */o("div",{className:"sf-device-scope",children:c}):/* @__PURE__ */o(d,{})}function v(){return e({type:"custom",render:()=>/* @__PURE__ */o(p,{})},"always")}export{m as DEVICE_FIELD_MARKER,u as DEVICE_HIDDEN_ATTR,c as DEVICE_NOTE,a as deviceField,f as deviceMetaOf,v as deviceNote,i as shownTier,l as withoutDeviceGate};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import{DEFAULT_NOTICE_WORDS as e,DEFAULT_CHROME_WORDS as n}from"./chunk-Y2G7CU6A.js";import{holderOf as i,describeAge as a,nameOrSomeone as t}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as s}from"./chunk-RE4LP46F.js";import{EaselRail as l}from"./chunk-MJM6SFD3.js";import{DEFAULT_RAIL_WORDS as r}from"./chunk-2OAZYSWJ.js";import{useWords as o}from"./chunk-MFIRYGHW.js";import{jsx as c,jsxs as d,Fragment as h}from"react/jsx-runtime";import{Tooltip as u,IconButton as m,Segmented as p,Switch as v,SpinnerRing as f,ResizeHandle as k,Button as b,Banner as g}from"efficient-shell/ui";import{useState as y,useEffect as N}from"react";import{LockIcon as w,CloudPauseIcon as C,CloudSlashIcon as O,CloudAlertIcon as x,CloudArrowUpIcon as z,CloudCheckIcon as R,PanelLeftIcon as B,PanelRightIcon as L,MediaIcon as $,ImageIcon as W}from"efficient-shell/icons/efficient";function j({children:e}){/* @__PURE__ */
|
|
2
|
+
return c("div",{className:"es-topbar",children:e})}function M({kind:e,style:n,children:i}){/* @__PURE__ */
|
|
3
|
+
return c("div",{className:e?`es-cluster es-cluster--${e}`:"es-cluster",style:n,children:i})}function S(){/* @__PURE__ */
|
|
4
|
+
return c("div",{className:"es-divider-v","aria-hidden":"true"})}function P({items:e,ariaLabel:n,onWords:i}){const a=o("rail",r);/* @__PURE__ */
|
|
5
|
+
return c("div",{className:"es-cluster es-cluster--rail es-rail-fit",children:/* @__PURE__ */c(l,{items:e,ariaLabel:n??a.label,orientation:"row",onLabelsShown:i})})}function Y({label:e,tip:n,onClick:i,disabled:a,state:t,buttonRef:s,children:l}){/* @__PURE__ */
|
|
6
|
+
return c(u,{content:n??e,side:"bottom",children:/* @__PURE__ */c(m,{ref:s,"aria-label":e,"aria-pressed":t?"active"===t:void 0,className:"es-iconbtn",disabled:a,onClick:i,children:l})})}function T({devices:e,value:i,onChange:a,ariaLabel:t}){const s=o("chrome",n);/* @__PURE__ */
|
|
7
|
+
return c(p,{className:"es-devseg",size:"sm",label:t??s.device,value:i,onChange:e=>{e!==i&&a(e)},options:e.map(e=>({value:e.id,icon:/* @__PURE__ */c(u,{content:e.label,side:"bottom",children:/* @__PURE__ */c("span",{className:"es-devseg-glyph","aria-hidden":"true",children:e.icon})}),label:/* @__PURE__ */c("span",{className:"es-vh",children:e.label})}))})}var F={idle:"is-quiet",saved:"is-quiet is-saved",saving:"is-saving",error:"is-error",off:"is-off","off-unsaved":"is-off is-unsaved"};function H({tone:e,label:n,counting:i,waitMs:a,ringRef:t,role:s}){/* @__PURE__ */
|
|
8
|
+
return d("span",{className:`es-savestate ${F[e]}`,role:s,"aria-live":"polite",children:[/* @__PURE__ */c("span",i?{ref:t,className:"es-savestate-ring is-counting",style:void 0!==a?{"--es-savewait":`${a}ms`}:void 0,"aria-hidden":"true"}:{className:"es-savestate-dot","aria-hidden":"true"}),n]})}function A({pressed:e,title:n,onToggle:i,children:a}){/* @__PURE__ */
|
|
9
|
+
return c("span",{className:"es-savestate-toggle",children:/* @__PURE__ */c(u,{content:n,side:"bottom",children:/* @__PURE__ */c(v,{size:"sm",checked:!e,"aria-label":n,label:a,onChange:()=>i()})})})}var I={saved:{glyph:()=>/* @__PURE__ */c(R,{}),tone:"muted"},saving:{glyph:()=>/* @__PURE__ */c(f,{className:"",ink:"",style:{width:20,height:20}}),tone:"muted"},pending:{glyph:()=>/* @__PURE__ */c(z,{}),tone:"muted"},failed:{glyph:()=>/* @__PURE__ */c(x,{}),tone:"danger"},offline:{glyph:()=>/* @__PURE__ */c(O,{}),tone:"warning"},paused:{glyph:()=>/* @__PURE__ */c(C,{}),tone:"warning"},locked:{glyph:()=>/* @__PURE__ */c(w,{}),tone:"warning"}},q=e=>I[e].tone;function D({state:e,label:n}){const i=I[e],[a,t]=y(n);return N(()=>t(n),[e]),/* @__PURE__ */d("span",{className:"es-saveicon-wrap",children:[
|
|
10
|
+
/* @__PURE__ */c(u,{content:n,side:"bottom",describe:!1,children:/* @__PURE__ */c("span",{className:"es-saveicon",role:"img","aria-label":n,tabIndex:0,"data-save-state":e,"data-tone":i.tone,children:i.glyph()})}),
|
|
11
|
+
/* @__PURE__ */c("span",{className:"es-vh",role:"status","aria-live":"polite",children:a})]})}function G({side:e,width:i,min:a,max:t,defaultWidth:s,label:l,onResize:r}){const d=o("chrome",n);/* @__PURE__ */
|
|
12
|
+
return c(k,{side:e,width:i,min:a,max:t,defaultWidth:s,label:l,hint:d.resize,onResize:e=>r(e),className:`es-resizer es-resizer--${e}`})}function J({icon:e,name:n,kind:i,actions:a}){/* @__PURE__ */
|
|
13
|
+
return d("div",{className:"es-insp-head",children:[
|
|
14
|
+
/* @__PURE__ */c("span",{className:"es-insp-chip","aria-hidden":"true",children:e}),
|
|
15
|
+
/* @__PURE__ */d("div",{className:"es-insp-titles",children:[
|
|
16
|
+
/* @__PURE__ */c(u,{content:n,describe:!1,side:"bottom",className:"es-insp-name-tip",children:/* @__PURE__ */c("h2",{className:"es-insp-name",children:n})}),
|
|
17
|
+
/* @__PURE__ */c("div",{className:"es-insp-kind",children:i})]}),a?/* @__PURE__ */c("div",{className:"es-insp-actions",children:a}):null]})}function K({label:e,title:n,hasPopup:i,onClick:a,disabled:t,danger:s,expanded:l,buttonRef:r,children:o}){/* @__PURE__ */
|
|
18
|
+
return c(u,{content:n??e,side:"bottom",children:/* @__PURE__ */c(m,{ref:r,variant:s?"ghost-danger":"ghost",className:"es-insp-iconbtn","aria-label":e,"aria-haspopup":i,"aria-expanded":l,disabled:t,onClick:a,children:o})})}function V({name:e,onSelect:i,label:a,inline:t}){const s=o("chrome",n),l=a??s.upLevel,r=/* @__PURE__ */c(u,{content:l,side:"bottom",children:/* @__PURE__ */c(b,{variant:"link",size:"sm",className:"es-insp-up-btn","aria-label":s.upLevelTo({label:l,name:e}),leftIcon:/* @__PURE__ */c("span",{className:"es-insp-up-arrow","aria-hidden":"true",children:"←"}),onClick:i,children:/* @__PURE__ */c("span",{className:"es-insp-up-name",children:e})})});return t?r:/* @__PURE__ */c("div",{className:"es-insp-up",children:r})}function Z({context:e,pick:i,onCancel:a,onHide:t,side:s="left"}){const l=o("chrome",n),r=t?/* @__PURE__ */c(K,{label:l.hidePanelLabel({side:s}),title:l.hidePanel,onClick:t,children:/* @__PURE__ */c("left"===s?B:L,{size:16})}):null;if(!i)/* @__PURE__ */
|
|
19
|
+
return c(J,{icon:/* @__PURE__ */c($,{}),name:l.mediaLibrary,kind:e,actions:r??void 0});const m=l.mediaKinds[i.kind];/* @__PURE__ */
|
|
20
|
+
return c(J,{icon:/* @__PURE__ */c(W,{size:15}),name:l.mediaChoose({kind:m}),kind:i.field?l.mediaFor({field:i.field}):e,actions:/* @__PURE__ */d(h,{children:[
|
|
21
|
+
/* @__PURE__ */c(u,{content:l.mediaKeep({kind:m}),side:"bottom",children:/* @__PURE__ */c(b,{variant:"secondary",size:"sm",className:"es-insp-textbtn",onClick:a,children:l.mediaCancel})}),r?/* @__PURE__ */d(h,{children:[
|
|
22
|
+
/* @__PURE__ */c("span",{className:"es-insp-divider","aria-hidden":"true"}),r]}):null]})})}function E(e){return/svg/i.test(e)?"svg":e.startsWith("video")?"video":"image"}var U={notice:e,lock:s};function Q(e,n,s,l=U){const r=l.notice,o=i(e),c={kind:"reload",label:r.reload};if(n){const e=a(n.secondsAgo,l.lock);return{tone:"warning",urgent:!0,lead:n.savedByYou?r.savedByYou({noun:s,when:e}):r.savedByOther({name:t(n.savedBy,l.lock),noun:s,when:e}),body:r.conflictBody,actions:o?[c,{kind:"take-over",label:r.takeOver,title:r.takeOverWhileDeciding}]:[c]}}if(!o)return null;const d=t(o.name,l.lock),h=a(o.secondsSinceSeen,l.lock);switch(e.kind){case"takenover":return{tone:"warning",urgent:!0,lead:r.tookOver({name:d,noun:s,when:a(o.secondsSinceHeld,l.lock)}),body:r.tookOverBody,actions:[{kind:"take-back",label:r.takeBack},c]};case"readonly":return{tone:"neutral",urgent:!1,lead:r.viewingOnly,body:r.viewingOnlyBody({name:d,noun:s,seen:h}),actions:[{kind:"take-over",label:r.takeOver}]};default:return{tone:"warning",urgent:!1,lead:r.editing({name:d,noun:s}),body:r.editingBody({seen:h}),actions:[{kind:"view-read-only",label:r.viewReadOnly},{kind:"take-over",label:r.takeOver,title:r.takeOverTold}]}}}function X({access:n,conflict:i,noun:a,onTakeOver:t,onViewReadOnly:l,onReload:r}){const d=Q(n,i,a,{notice:o("notice",e),lock:o("lock",s)});if(!d)return null;const h={reload:r,"take-over":t,"take-back":t,"view-read-only":l},m=d.actions.map(e=>e.title?/* @__PURE__ */c(u,{content:e.title,side:"bottom",children:/* @__PURE__ */c(b,{variant:"secondary",size:"sm",onClick:h[e.kind],children:e.label})},e.kind):/* @__PURE__ */c(b,{variant:"secondary",size:"sm",onClick:h[e.kind],children:e.label},e.kind));/* @__PURE__ */
|
|
23
|
+
return c("div",{className:`es-notice is-${d.tone}`,role:d.urgent?"alert":"status",children:/* @__PURE__ */c(g,{tone:"warning"===d.tone?"warning":"info",title:d.lead,action:/* @__PURE__ */c("span",{className:"es-notice-actions",children:m}),children:d.body})})}var _={left:288,right:320},ee=220,ne=560;function ie(e){return Math.min(560,Math.max(220,Math.round(e)))}function ae(e){return{"--es-left-w":`${e.left}px`,"--es-right-w":`${e.right}px`}}function te(e,n){e.style.setProperty("--es-left-w",`${n.left}px`),e.style.setProperty("--es-right-w",`${n.right}px`)}export{_ as DEFAULT_PANEL_W,T as DeviceSwitch,Y as EaselIconButton,j as EaselTopBar,X as EditNotice,J as InspectorHead,K as InspectorIconButton,V as InspectorUpLevel,ne as MAX_PANEL_W,ee as MIN_PANEL_W,Z as MediaPanelHead,G as PanelResizeHandle,D as SaveIcon,H as SaveState,A as SaveStateToggle,M as TopBarCluster,S as TopBarDivider,P as TopBarRail,ie as clampPanelWidth,Q as editNotice,E as mediaPickKind,ae as panelWidthVars,q as saveIconTone,te as setPanelWidthVars};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{styleMenuItems as e}from"./chunk-V7U33NF2.js";import{useEaselSession as n}from"./chunk-O7Q4DDJT.js";import{ROOT_ZONE as t}from"./chunk-PLVEGYK6.js";import{useHostEscape as o}from"./chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as l}from"./chunk-
|
|
1
|
+
import{styleMenuItems as e}from"./chunk-V7U33NF2.js";import{useEaselSession as n}from"./chunk-O7Q4DDJT.js";import{ROOT_ZONE as t}from"./chunk-PLVEGYK6.js";import{useHostEscape as o}from"./chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as l}from"./chunk-JTUUIVBZ.js";import{EaselMenuItems as r,menuLabel as i}from"./chunk-EA2HTX37.js";import{createNodeClipboard as c,nodeMenuItems as s}from"./chunk-OSPUG6S6.js";import{DEFAULT_NODE_MENU_WORDS as a}from"./chunk-WK3AFPXY.js";import{isTypingTarget as d,useCanvasEvent as u,framePointToHost as p}from"./chunk-AWJUYMX7.js";import{zoneKey as f,ROOT_SLOT as m,ROOT_ID as y}from"./chunk-KRXQM65X.js";import{useState as h,useCallback as k,useRef as b,useEffect as v}from"react";import{ContextMenu as g}from"efficient-shell/ui";import{UndoIcon as w,RedoIcon as x,AddIcon as C,PasteIcon as z,SettingsIcon as O,LayersIcon as P,CopyIcon as A}from"efficient-shell/icons/efficient";import{jsx as S}from"react/jsx-runtime";function D(e,n){const o=[],l=/* @__PURE__ */new Set;let r={zone:n.zone,index:n.index};for(;r;){const n=e.nodeAt(r.zone,r.index);if(!n||l.has(n.props.id))break;if(l.add(n.props.id),o.push({zone:r.zone,index:r.index,node:n,parentType:null}),r.zone===t)break;const i=r.zone.lastIndexOf(":");if(i<=0)break;r=e.locate(r.zone.slice(0,i))}for(let e=0;e<o.length-1;e+=1)o[e].parentType=o[e+1].node.type;return o}var K=c(),T=/* @__PURE__ */new WeakMap;function j(e){if(e.claimsPage)return K;const n=e.registry;if(!n)return e.cache("easel:node-clipboard",c);let t=T.get(n);return t||(t=c(),T.set(n,t)),t}function M(){return j(n())}function X(e,n,o){if(n===t){const{floor:n,cap:t}=e.sectionBand();return{parentId:y,slot:m,index:Math.min(Math.max(o,n),t)}}const l=n.lastIndexOf(":");return{parentId:n.slice(0,l),slot:n.slice(l+1),index:o}}function I(e,n,t){const o=e.isPinned(n,t),l=!o&&!e.isLocked(n)&&!e.duplicateBlocked(n),r=e.permits?.(n)??{duplicate:!0,delete:!0};return{copy:!o&&r.duplicate,cut:l&&r.duplicate&&r.delete,delete:l&&r.delete}}function U(e,n,t){const o=e.canPasteAt;if(!o)return f(n.from)===t.zone?X(e,t.zone,t.index+1):null;for(const l of D(e,t)){const t=X(e,l.zone,l.index+1);if(o(n,t))return t}return null}function E(e){if(e.defaultPrevented||e.altKey||e.shiftKey)return null;if(d(e.target))return null;const n=e.target,t=n&&"ownerDocument"in n?n.ownerDocument??n:null,o=t?.getSelection?.();if(o&&!o.isCollapsed&&o.toString().trim())return null;if(!e.metaKey&&!e.ctrlKey)return"Delete"===e.key||"Backspace"===e.key?"delete":null;const l=e.code||(1===e.key.length?`Key${e.key.toUpperCase()}`:"");return"KeyC"===l?"copy":"KeyX"===l?"cut":"KeyV"===l?"paste":null}function B(e,n,t,o){const l=e.nodeAt(t.zone,t.index);if(!l)return null;const r=l.props.id,i=e.labelOf(l.type,t.zone),c=I(e,l,t.zone);if("copy"===n)return c.copy?(e.nodeOps.copy(r,i),{done:"copied",name:i}):null;if(o.readOnly)return null;if("cut"===n)return c.cut?(e.nodeOps.cut(r,i),{done:"cut",name:i}):null;if("delete"===n)return c.delete?(e.nodeOps.remove(r),{done:"deleted",name:i}):null;const s=o.held;if(!s)return null;const a=e.isPinned(l,t.zone)?null:U(e,s,t);return a?(e.nodeOps.paste(a),{done:"pasted",name:s.label}):(e.onPasteRefused(s),{done:"refused",name:s.label})}function L(n,o){const{zone:l,index:r}=o,i=n.nodeAt(l,r);if(!i)return[];const c=i.props.id,a=n.labelOf(i.type,l),d=Boolean(i.props._hidden),u=n.nodeOps,p=n.isPinned(i,l),f=n.isLocked(i),m=!p&&!f&&!n.duplicateBlocked(i),y=n.permits?.(i)??{duplicate:!0,delete:!0},h=I(n,i,l),k=D(n,o),b=u.held,v=b&&!p?U(n,b,o):null,g=!n.readOnly,w=n.style?e({held:g?n.style.held():null,canCopy:n.style.canCopy(i,l),onCopy:()=>n.style?.copy(i,l),onPaste:()=>n.style?.paste(l,r,i),words:n.words?.styleClipboard}):[];return s({title:a,words:n.words?.menu,layer:{group:"pick",items:k.flatMap((e,o)=>{const l={label:n.rowNameOf(e.node,e.zone),checked:0===o,onClick:()=>n.selectAt(e.zone,e.index,e.node.props.id,e.parentType)},r=e.zone===t?null:n.slotRung?.(e.zone)??null;return r?[l,{label:r.label,checked:!1,onClick:r.select}]:[l]})},actions:{addInside:g&&n.canAddTo(i.type)?()=>n.openAddInside(l,r):void 0,duplicate:g&&m&&y.duplicate?()=>u.duplicate(c):void 0,moveUp:g&&u.canStep(c,-1)?()=>u.step(c,-1):void 0,moveDown:g&&u.canStep(c,1)?()=>u.step(c,1):void 0,copy:h.copy?()=>u.copy(c,a):void 0,cut:g&&h.cut?()=>u.cut(c,a):void 0,paste:g&&b&&v?{label:b.label,run:()=>u.paste(v)}:void 0,rename:g&&n.renamePropOf(i,l)?()=>n.beginRename(l,r):void 0,hide:!g||f||p?void 0:{hidden:d,run:()=>u.setProps(c,{_hidden:!d})},delete:g&&m&&y.delete?()=>u.remove(c):void 0},style:w,extras:n.menuRows?.(i,l,r)??void 0,pinnedLine:p?R(n).pinned:void 0})}var R=e=>e.words?.screen??l.menu;function V(e){const n=R(e),o=!e.readOnly,r=[];o&&e.history.hasPast&&r.push({label:n.undo,icon:/* @__PURE__ */S(w,{}),shortcut:"⌘Z",onClick:e.history.back}),o&&e.history.hasFuture&&r.push({label:n.redo,icon:/* @__PURE__ */S(x,{}),shortcut:"⇧⌘Z",onClick:e.history.forward});const i=o?[{label:n.addSection,icon:/* @__PURE__ */S(C,{}),onClick:e.openAddSection}]:[],c=e.nodeOps.held,s=X(e,t,e.sectionBand().cap);if(o&&c&&(e.canPasteAt?e.canPasteAt(c,s):f(c.from)===t)){const n=s,t=e.words?.menu??a;i.push({label:t.pasteNamed({paste:t.paste,label:c.label}),icon:/* @__PURE__ */S(z,{}),shortcut:"⌘V",onClick:()=>e.nodeOps.paste(n)})}const d=[r,i,[{label:e.pageSettingsLabel??l.pageSettings,icon:/* @__PURE__ */S(O,{}),onClick:e.openPageSettings},{label:n.collapseAll,icon:/* @__PURE__ */S(P,{}),onClick:e.collapseAll}]].filter(e=>e.length>0),u={label:"—",onClick:()=>{}};return d.flatMap((e,n)=>n?[u,...e]:e)}function Y(e,n){const t=n.selectionStart??0,o=n.selectionEnd??0,l=n.value.slice(t,o),r=e=>{n.focus(),n.setRangeText(e,t,o,"end"),n.dispatchEvent(new Event("input",{bubbles:!0}))},i=e.words?.menu??a,c=R(e),s=[];l&&(s.push({label:i.copy,icon:/* @__PURE__ */S(A,{}),shortcut:"⌘C",onClick:()=>navigator.clipboard?.writeText(l)}),s.push({label:i.cut,icon:/* @__PURE__ */S(A,{}),shortcut:"⌘X",onClick:()=>{navigator.clipboard?.writeText(l),r("")}})),s.push({label:i.paste,icon:/* @__PURE__ */S(z,{}),shortcut:"⌘V",onClick:()=>{navigator.clipboard?.readText().then(e=>{e&&r(e)}).catch(()=>e.onPasteRefused())}});const d=[s,n.value?[{label:c.selectAll,shortcut:"⌘A",onClick:()=>{n.focus(),n.select()}}]:[]].filter(e=>e.length>0),u={label:"—",onClick:()=>{}};return d.flatMap((e,n)=>n?[u,...e]:e)}function N(e){return e.shiftKey}function F(e,n){const[t,l]=h(null),r=k(()=>l(null),[]);o(null!==t,r);const i=b(e);i.current=e;const c=k(e=>{const n=i.current,t=n.keys;if(!t)return;const o=E(e);if(!o)return;const l=t.selected();if(!l)return;const r=B(n,o,l,{readOnly:t.readOnly,held:t.held()});r&&(e.preventDefault(),t.onDone?.(r))},[]),s=e.keys?.target??null;v(()=>{if(!s)return;const e=e=>c(e);return s.addEventListener("keydown",e),()=>s.removeEventListener("keydown",e)},[s,c]),u(n,"keydown",c);const a=k(n=>{if(N(n))return;const t=n.target;if(t?.closest?.("[data-slot-zone]"))return n.preventDefault(),void l(null);const o=function(e){const n=e?.closest?.("input, textarea");return n&&("INPUT"!==n.tagName||["text","search","url","email","tel","number",""].includes(n.type))?n:null}(t);if(o)return n.preventDefault(),void l({kind:"input",x:n.clientX,y:n.clientY,el:o,owner:t});const r=t?.closest?.("[data-node-id]")?.getAttribute("data-node-id"),i=r?e.locate(r):null;n.preventDefault(),l(i?{kind:"node",x:n.clientX,y:n.clientY,...i,owner:t}:{kind:"empty",x:n.clientX,y:n.clientY,owner:t})},[e]);u(n,"contextmenu",t=>{if(N(t)||!n)return;const o=t.target?.closest?.("[data-puck-component]")??null,r=o?.getAttribute("data-puck-component"),i=r?e.locate(r):null;t.preventDefault();const c=p(n.frame,t.clientX,t.clientY),s=n.frame;l(i?{kind:"node",...c,...i,owner:s}:{kind:"empty",...c,owner:s})}),u(n,"mousedown",r),u(n,"scroll",r,{on:"window"});return{onEditorContextMenu:a,menu:t?/* @__PURE__ */S(J,{host:e,target:t,onClose:r}):null,closeMenu:r}}function J({host:e,target:n,onClose:t}){const o="node"===n.kind?L(e,n):"input"===n.kind?Y(e,n.el):V(e);return 0===o.length?null:/* @__PURE__ */S(g,{at:{x:n.x,y:n.y},owner:n.owner??null,onClose:t,"aria-label":i(o),children:/* @__PURE__ */S(r,{items:o,onClose:t})})}export{K as EASEL_NODE_CLIPBOARD,D as ancestorChain,j as nodeClipboardOf,I as nodeClipboardRules,L as nodeMenuItems,E as nodeShortcut,V as pageMenuItems,U as pastePlace,B as runNodeShortcut,Y as textMenuItems,M as useNodeClipboard,F as useNodeContextMenu};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useState as e,useEffect as n}from"react";function t(e,n){const{state:t,now:o,offline:i,readOnlyReason:d,editing:l,conflict:a,notSaving:r}=e;let s,f;var c;null!==d?(s="locked",f=d):null!==l?(s="locked",f=n.locked({editing:l})):a||t.stopped?(s="locked",f=r):t.paused?(s="paused",f=t.pending?n.pausedHeld:n.paused):i?(s="offline",f=n.offline):t.failed?(s="failed",f=null!=t.retryAt?n.failedIn({seconds:(c=t.retryAt-o,Math.max(1,Math.ceil(c/1e3)))}):n.failedSoon):t.unsaved?(s=t.saving?"saving":"pending",f=t.saving?n.saving:n.pending):(s="saved",f=null!=t.savedAt?n.savedAgo({seconds:(o-t.savedAt)/1e3}):n.saved);const u=null!==d?d:null!==l?l:a||t.stopped?n.blockedConflict:i?n.blockedOffline:t.failed&&t.pending?n.blockedFailed:null,v="saved"===s||"saving"===s;return{state:s,label:f,line:e=>v&&e?`${f} · ${e}`:f,blocked:u,retry:t.failed||i}}function o(t){const[o,i]=e(()=>Date.now());return n(()=>{if(i(Date.now()),!t)return;const e=setInterval(()=>i(Date.now()),1e3);return()=>clearInterval(e)},[t]),o}function i(){const[t,o]=e(!1);return n(()=>{if("undefined"==typeof window||"undefined"==typeof navigator)return;const e=()=>o(!1===navigator.onLine);return e(),window.addEventListener("online",e),window.addEventListener("offline",e),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",e)}},[]),t}export{t as describeSave,i as useBrowserOffline,o as useNow};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEFAULT_TEXT_STYLES_WORDS as o}from"./chunk-M6F6LS3H.js";import{DEFAULT_PICK_WORDS as r}from"./chunk-ZAOM6PFH.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as t}from"./chunk-6WY6ZXJG.js";import{DEFAULT_SCREEN_WORDS as m}from"./chunk-
|
|
1
|
+
import{DEFAULT_TEXT_STYLES_WORDS as o}from"./chunk-M6F6LS3H.js";import{DEFAULT_PICK_WORDS as r}from"./chunk-ZAOM6PFH.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as t}from"./chunk-6WY6ZXJG.js";import{DEFAULT_SCREEN_WORDS as m}from"./chunk-JTUUIVBZ.js";import{DEFAULT_CANVAS_WORDS as n}from"./chunk-TBY3DFKS.js";import{DEFAULT_TREE_WORDS as c}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as s}from"./chunk-KFV7N2DJ.js";import{DEFAULT_NODE_MENU_WORDS as f}from"./chunk-WK3AFPXY.js";import{DEFAULT_SAVE_WORDS as p}from"./chunk-H6DDIBQ4.js";import{DEFAULT_CHROME_WORDS as e,DEFAULT_NOTICE_WORDS as i}from"./chunk-Y2G7CU6A.js";import{DEFAULT_LOCK_WORDS as u}from"./chunk-RE4LP46F.js";import{DEFAULT_RAIL_WORDS as k}from"./chunk-2OAZYSWJ.js";import{DEFAULT_COPY_WORDS as j}from"./chunk-AUT242JK.js";import{DEFAULT_FIELDS_WORDS as h}from"./chunk-FFYXVAAL.js";import{DEFAULT_DRAG_WORDS as l}from"./chunk-O2NLQBFX.js";var F={notice:i,lock:u,save:p,chrome:e,rail:k,tree:c,panel:s,fields:h,pick:r,drag:l,menu:f,styleClipboard:t,copy:j,canvas:n,textStyles:o,screen:m},a=o=>"object"==typeof o&&null!==o;function Y(o,r){const t={};for(const m of Object.keys(o)){const n=o[m],c=r[m];null==c?t[m]=n:a(n)?t[m]=a(c)?Y(n,c):n:t[m]=typeof c==typeof n?c:n}return t}function y(o,r){return r?Y(o,r):o}export{F as DEFAULT_EASEL_STRINGS,y as mergeEaselStrings};
|