efficient-easel 0.0.0 → 0.96.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/LICENSE +10 -0
- package/README.md +723 -4
- package/dist/autosave/index.d.ts +101 -0
- package/dist/autosave/index.js +1 -0
- package/dist/blocks/index.d.ts +295 -0
- package/dist/blocks/index.js +0 -0
- package/dist/buckets-1vRlQceY.d.ts +13 -0
- package/dist/canvas/index.d.ts +194 -0
- package/dist/canvas/index.js +1 -0
- package/dist/chrome/chrome.css +570 -0
- package/dist/chrome/index.d.ts +219 -0
- package/dist/chrome/index.js +21 -0
- package/dist/chunk-2LUSK32B.js +1 -0
- package/dist/chunk-2OAZYSWJ.js +1 -0
- package/dist/chunk-67VZRQLG.js +13 -0
- package/dist/chunk-6JDII7N3.js +1 -0
- package/dist/chunk-6OPSJGAI.js +1 -0
- package/dist/chunk-6WY6ZXJG.js +1 -0
- package/dist/chunk-7A7O2JWQ.js +1 -0
- package/dist/chunk-BZ5ASXOL.js +1 -0
- package/dist/chunk-CERTFXCV.js +13 -0
- package/dist/chunk-EFTTSIMK.js +1 -0
- package/dist/chunk-FI23ALVJ.js +1 -0
- package/dist/chunk-FJE4IDBQ.js +1 -0
- package/dist/chunk-GGTPNGFJ.js +1 -0
- package/dist/chunk-H4B72XCJ.js +1 -0
- package/dist/chunk-H6DDIBQ4.js +1 -0
- package/dist/chunk-KDIVA6WD.js +1 -0
- package/dist/chunk-LPRQDDQO.js +1 -0
- package/dist/chunk-MCLBHENY.js +1 -0
- package/dist/chunk-MFIRYGHW.js +1 -0
- package/dist/chunk-NKB3KVAB.js +1 -0
- package/dist/chunk-O2NLQBFX.js +1 -0
- package/dist/chunk-OGZFDJ6G.js +1 -0
- package/dist/chunk-OWBO4WKA.js +0 -0
- package/dist/chunk-QB3BZIRA.js +5 -0
- package/dist/chunk-RE4LP46F.js +1 -0
- package/dist/chunk-STFMZJKU.js +14 -0
- package/dist/chunk-SUO5627P.js +1 -0
- package/dist/chunk-TDA4HH54.js +1 -0
- package/dist/chunk-WK3AFPXY.js +1 -0
- package/dist/chunk-YIMRTIBN.js +3 -0
- package/dist/chunk-YNZZYHA4.js +450 -0
- package/dist/chunk-ZAOM6PFH.js +1 -0
- package/dist/chunk-ZNCEOSXO.js +1 -0
- package/dist/copy/copy.css +282 -0
- package/dist/copy/index.d.ts +336 -0
- package/dist/copy/index.js +10 -0
- package/dist/data/index.d.ts +208 -0
- package/dist/data/index.js +1 -0
- package/dist/drag/drag.css +360 -0
- package/dist/drag/index.d.ts +379 -0
- package/dist/drag/index.js +18 -0
- package/dist/edit-lock/index.d.ts +354 -0
- package/dist/edit-lock/index.js +1 -0
- package/dist/editor/editor.css +58 -0
- package/dist/editor/index.d.ts +361 -0
- package/dist/editor/index.js +9 -0
- package/dist/fields/fields.css +207 -0
- package/dist/fields/index.d.ts +273 -0
- package/dist/fields/index.js +46 -0
- package/dist/gold/gold.css +196 -0
- package/dist/gold/index.d.ts +280 -0
- package/dist/gold/index.js +1 -0
- package/dist/icons/index.d.ts +474 -0
- package/dist/icons/index.js +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +1 -0
- package/dist/markup/index.d.ts +452 -0
- package/dist/markup/index.js +1 -0
- package/dist/menu/index.d.ts +49 -0
- package/dist/menu/index.js +15 -0
- package/dist/menu/menu.css +254 -0
- package/dist/node-ops/index.d.ts +91 -0
- package/dist/node-ops/index.js +1 -0
- package/dist/panel/index.d.ts +1088 -0
- package/dist/panel/index.js +16 -0
- package/dist/panel/panel.css +1460 -0
- package/dist/pick/index.d.ts +153 -0
- package/dist/pick/index.js +14 -0
- package/dist/pick/pick.css +235 -0
- package/dist/plan-DtNw2VuI.d.ts +88 -0
- package/dist/rail/index.d.ts +145 -0
- package/dist/rail/index.js +1 -0
- package/dist/rail/rail.css +175 -0
- package/dist/render/index.d.ts +117 -0
- package/dist/render/index.js +5 -0
- package/dist/resolve-DpH8YQOA.d.ts +57 -0
- package/dist/shell/index.d.ts +159 -0
- package/dist/shell/index.js +1 -0
- package/dist/shell/shell.css +122 -0
- package/dist/strings/catalogue.d.ts +141 -0
- package/dist/strings/catalogue.js +1 -0
- package/dist/strings/index.d.ts +56 -0
- package/dist/strings/index.js +2 -0
- package/dist/style-clipboard/index.d.ts +184 -0
- package/dist/style-clipboard/index.js +1 -0
- package/dist/tree/index.d.ts +173 -0
- package/dist/tree/index.js +1 -0
- package/dist/tree/tree.css +618 -0
- package/dist/types-CEqUFH2j.d.ts +129 -0
- package/dist/types-CuNiSnX6.d.ts +204 -0
- package/dist/types-DNrn_w4V.d.ts +88 -0
- package/dist/types-DziKCwsN.d.ts +105 -0
- package/dist/types-_Vayx8ov.d.ts +153 -0
- package/dist/types-pGBXevBU.d.ts +131 -0
- package/dist/useNodeOps-6IAej9jy.d.ts +68 -0
- package/dist/watch-DmasQA61.d.ts +60 -0
- package/dist/wordFit-9B9nqyf3.d.ts +35 -0
- package/dist/words-B2YLaKEr.d.ts +30 -0
- package/dist/words-B87GIFWH.d.ts +86 -0
- package/dist/words-BK-npta-.d.ts +27 -0
- package/dist/words-CD3WADyb.d.ts +51 -0
- package/dist/words-CsRWXkY4.d.ts +129 -0
- package/dist/words-D9ChvbNC.d.ts +52 -0
- package/dist/words-DOhF-4D4.d.ts +35 -0
- package/dist/words-DagJdwIA.d.ts +78 -0
- package/dist/words-DfxEp_RH.d.ts +142 -0
- package/package.json +202 -3
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { T as TopBarProps, a as TopBarClusterProps, b as TopBarRailProps, E as EditorIconButtonProps, D as DeviceSwitchProps, c as SaveStateProps, d as SaveStateToggleProps, P as PanelResizeHandleProps, I as InspectorHeadProps, e as InspectorIconButtonProps, f as InspectorUpLevelProps, g as EditNoticeProps } from '../types-CuNiSnX6.js';
|
|
3
|
+
export { h as DEFAULT_PANEL_W, i as DeviceOption, M as MAX_PANEL_W, j as MIN_PANEL_W, k as PanelSide, l as PanelWidths, S as SaveTone, m as clampPanelWidth, p as panelWidthVars } from '../types-CuNiSnX6.js';
|
|
4
|
+
import { LockWords, EditAccess, SaveConflict } from '../edit-lock/index.js';
|
|
5
|
+
import { N as NoticeWords } from '../words-DagJdwIA.js';
|
|
6
|
+
export { C as ChromeWords } from '../words-DagJdwIA.js';
|
|
7
|
+
import '../types-DNrn_w4V.js';
|
|
8
|
+
import '../wordFit-9B9nqyf3.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The editor's top bar — 52px, white, a soft shadow, three clusters.
|
|
12
|
+
*
|
|
13
|
+
* Lifted from the website editor's `.sf-topbar` (efficient-shop). Its order is a
|
|
14
|
+
* decision, not a layout accident, so it is written here once:
|
|
15
|
+
*
|
|
16
|
+
* rail what the LEFT panel contains (Add, Layers, styles…). Exactly the left
|
|
17
|
+
* panel's width, so the column reads top of the screen down.
|
|
18
|
+
* centre what you DID (undo, redo) | divider | what you are LOOKING AT (the
|
|
19
|
+
* device, which side panels are open). One divider, never two.
|
|
20
|
+
* right what you DO next: the save state, ghost buttons, one primary button.
|
|
21
|
+
*
|
|
22
|
+
* Hook-free, directive-free: a server component may import it.
|
|
23
|
+
*/
|
|
24
|
+
declare function EditorTopBar({ children }: TopBarProps): react.JSX.Element;
|
|
25
|
+
declare function TopBarCluster({ kind, style, children }: TopBarClusterProps): react.JSX.Element;
|
|
26
|
+
/**
|
|
27
|
+
* The bar's ONE divider: between what you did (undo / redo) and what you are
|
|
28
|
+
* looking at (device, panels). A second one splits the very run this order makes.
|
|
29
|
+
*/
|
|
30
|
+
declare function TopBarDivider(): react.JSX.Element;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The rail in the top bar: the left column of the bar (exactly the left panel's
|
|
34
|
+
* width, carrying its hairline — `.es-cluster--rail`) holding an `EditorRail` in
|
|
35
|
+
* `orientation="row"`, wearing its words by THE SETTINGS TABS' RULE (owner,
|
|
36
|
+
* 2026-09-18: "the rule must be the same as the top tabs of the right settings
|
|
37
|
+
* panel"):
|
|
38
|
+
*
|
|
39
|
+
* every word when every button fits with its word;
|
|
40
|
+
* chosen word otherwise the glyphs plus the open panel's word;
|
|
41
|
+
* glyphs only when even that does not fit.
|
|
42
|
+
*
|
|
43
|
+
* THE WIDTH IS CSS'S QUESTION, NOT THIS COMPONENT'S. The column is a container
|
|
44
|
+
* (`.es-rail-fit`), and the word-fit rule in `panel.css` — the one the
|
|
45
|
+
* segmented control reads — compares it with the words' widths as the person
|
|
46
|
+
* drags the panel, with no script running. 0.48.0 decided the same thing here
|
|
47
|
+
* in JS, all-or-nothing, re-measuring the column on every resize; that rule is
|
|
48
|
+
* gone, so there is one.
|
|
49
|
+
*
|
|
50
|
+
* WHAT IS LEFT HERE IS THE ONE THING CSS CANNOT DO: say how wide a word is. The
|
|
51
|
+
* words are measured on a canvas in the rail's own type (no hidden copy of the
|
|
52
|
+
* rail in the page) once, again when the labels change, and once the web fonts
|
|
53
|
+
* have loaded. On a server, and anywhere a canvas cannot measure, there is no
|
|
54
|
+
* measurement and the rail is icon-only, which always fits.
|
|
55
|
+
*/
|
|
56
|
+
declare function TopBarRail({ items, ariaLabel }: TopBarRailProps): react.JSX.Element;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* A 30px glyph button in the top bar — undo, redo, the panel toggles.
|
|
60
|
+
*
|
|
61
|
+
* The label is the tooltip AND the accessible name, and it is required: an
|
|
62
|
+
* icon-only button has no other name, and "button" is all a screen reader would
|
|
63
|
+
* say. `state` is for a toggle; a plain action leaves it off.
|
|
64
|
+
*/
|
|
65
|
+
declare function EditorIconButton({ label, onClick, disabled, state, buttonRef, children }: EditorIconButtonProps): react.JSX.Element;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Which device the canvas previews — icon-only, one button held down.
|
|
69
|
+
*
|
|
70
|
+
* Lifted from `efficient-shop/components/DeviceSwitch.tsx`. It takes its devices
|
|
71
|
+
* as a list because the two editors do not preview the same set: the website
|
|
72
|
+
* has Desktop / Tablet / Mobile, an email has Desktop / Phone. The drawing, the
|
|
73
|
+
* size and the pressed state are what must match, and those live here.
|
|
74
|
+
*
|
|
75
|
+
* NOT `SettingsSegmented`, deliberately (card 66083): that control edits a value
|
|
76
|
+
* a merchant STORES and draws words. This is toolbar chrome — glyphs sized to
|
|
77
|
+
* the icon buttons around it, editing only transient view state.
|
|
78
|
+
*
|
|
79
|
+
* `aria-pressed` carries the current device. Before card 66083 only a background
|
|
80
|
+
* colour did, so the strip read as unnamed buttons with no current value.
|
|
81
|
+
*/
|
|
82
|
+
declare function DeviceSwitch<Id extends string>({ devices, value, onChange, ariaLabel, }: DeviceSwitchProps<Id>): react.JSX.Element;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The save pill — a dot (or an emptying ring) and, when there is something to
|
|
86
|
+
* say, a few words.
|
|
87
|
+
*
|
|
88
|
+
* Lifted from the website editor's `.sf-savestate`. The words belong to each
|
|
89
|
+
* editor; the dot, its colours, its footprint and the ring are shared, so the
|
|
90
|
+
* two editors say "saved" with the same mark.
|
|
91
|
+
*
|
|
92
|
+
* The ring empties ONCE over `waitMs` and holds empty (`forwards`) until the
|
|
93
|
+
* save lands. It restarts by CSS, not by React: the host keeps `ringRef` and
|
|
94
|
+
* re-adds `is-counting` on a keystroke, so typing never re-renders the chrome.
|
|
95
|
+
* Reduced motion: a steady ring, no countdown.
|
|
96
|
+
*/
|
|
97
|
+
declare function SaveState({ tone, label, counting, waitMs, ringRef, role }: SaveStateProps): react.JSX.Element;
|
|
98
|
+
/**
|
|
99
|
+
* The pill as the autosave on / off switch. A bare `<button>` — a native button
|
|
100
|
+
* ignores author background and border on some platforms — so the inner
|
|
101
|
+
* `SaveState` carries every visual and this adds hover and a focus ring.
|
|
102
|
+
*/
|
|
103
|
+
declare function SaveStateToggle({ pressed, title, onToggle, children }: SaveStateToggleProps): react.JSX.Element;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* A drag grip on a side panel's inner edge.
|
|
107
|
+
*
|
|
108
|
+
* Lifted from `efficient-shop/components/PanelResizeHandle.tsx`; the campaign
|
|
109
|
+
* designer carried its own copy of the same idea. It owns NO width: the editor
|
|
110
|
+
* holds and persists it, and the grip only reports a new clamped width through
|
|
111
|
+
* `onResize`. The host renders it as an absolute child of the panel row, pinned
|
|
112
|
+
* over the panel↔canvas seam, so the panels' `overflow: hidden` never clips it.
|
|
113
|
+
*
|
|
114
|
+
* ARIA window splitter: a focusable `separator` with aria-value*, arrows nudge,
|
|
115
|
+
* Home resets, double-click resets.
|
|
116
|
+
*
|
|
117
|
+
* This leaf HAS hooks and touches `document.body` — in handlers and an effect
|
|
118
|
+
* cleanup only, never at module-eval or render. A server component may import
|
|
119
|
+
* the module and must render it inside the host's client boundary.
|
|
120
|
+
*/
|
|
121
|
+
declare function PanelResizeHandle({ side, width, min, max, defaultWidth, label, onResize }: PanelResizeHandleProps): react.JSX.Element;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* The top of the settings panel: a type chip, the selected thing's name, its
|
|
125
|
+
* kind, and its actions (duplicate, delete…).
|
|
126
|
+
*
|
|
127
|
+
* Lifted from the website editor's `.sf-insp-head` (SectionEditor.tsx). The name
|
|
128
|
+
* is the panel's `h2` (card 66127): without a heading a screen-reader user can
|
|
129
|
+
* neither jump to the panel nor hear what it is. `.es-insp-name` states its own
|
|
130
|
+
* margin, size and weight, so being an h2 moves nothing on screen.
|
|
131
|
+
*/
|
|
132
|
+
declare function InspectorHead({ icon, name, kind, actions }: InspectorHeadProps): react.JSX.Element;
|
|
133
|
+
/** A 28px glyph button in the inspector head. Named, like every icon-only button. */
|
|
134
|
+
declare function InspectorIconButton({ label, title, hasPopup, onClick, disabled, danger, expanded, buttonRef, children, }: InspectorIconButtonProps): react.JSX.Element;
|
|
135
|
+
/**
|
|
136
|
+
* ↰ GO UP ONE LEVEL — one row at the top of the settings panel, naming the
|
|
137
|
+
* level above what is selected and selecting it when pressed. Lifted from the
|
|
138
|
+
* campaign designer's UpLevelControl (card 66042), where it moved off the
|
|
139
|
+
* canvas so a merchant could climb TWICE (Block → Column → Section).
|
|
140
|
+
*
|
|
141
|
+
* The WHOLE row is the button, glyph and name: the name of where you are going
|
|
142
|
+
* is the part that reads as the thing to press. The host renders nothing when
|
|
143
|
+
* there is no level above (efficient-easel/node-ops `parentStep` says so) — a
|
|
144
|
+
* dead control would be permanent furniture on the level selected most.
|
|
145
|
+
*/
|
|
146
|
+
declare function InspectorUpLevel({ name, onSelect, icon, label }: InspectorUpLevelProps): react.JSX.Element;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* The bar that says why edits are not being saved — somebody else holds the
|
|
150
|
+
* document, or a save was refused. Never a dialog (blueprint 2.5): the operator
|
|
151
|
+
* has to be able to read and copy from the screen it is warning them about.
|
|
152
|
+
*
|
|
153
|
+
* The host places it (under the top bar, above the canvas) and owns the
|
|
154
|
+
* handlers; the words are `editNotice`'s. Renders nothing when there is nothing
|
|
155
|
+
* to say, so a host can mount it unconditionally.
|
|
156
|
+
*
|
|
157
|
+
* The sentences are in the language of the strings provider above it
|
|
158
|
+
* (`efficient-easel/strings`), English with none. `noun` is the host's, and is
|
|
159
|
+
* the host's to translate.
|
|
160
|
+
*/
|
|
161
|
+
declare function EditNotice({ access, conflict, noun, onTakeOver, onViewReadOnly, onReload }: EditNoticeProps): react.JSX.Element | null;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* What to tell the operator when their edits cannot be saved — somebody else is
|
|
165
|
+
* in the document, or a save was refused — as words, for `EditNotice` to draw
|
|
166
|
+
* (blueprint step 2.5).
|
|
167
|
+
*
|
|
168
|
+
* The two editors said this differently: the campaign designer in a strip under
|
|
169
|
+
* its top bar (`EditLockBanner`, efficient-admin-portal
|
|
170
|
+
* `src/components/email/CampaignDesigner.tsx`), the website editor in modal
|
|
171
|
+
* dialogs over the canvas (`PageEditGuardNotices`, efficient-shop
|
|
172
|
+
* `components/PageEditGuardNotices.tsx`), which said "choosing one for both is a
|
|
173
|
+
* design ruling nobody has made". The blueprint made it: a bar, never a dialog,
|
|
174
|
+
* the save conflict included. A dialog stops the operator reading the very
|
|
175
|
+
* screen it tells them to copy from.
|
|
176
|
+
*
|
|
177
|
+
* The rules both kept, and keep here:
|
|
178
|
+
* - a refused save outranks the lock — it is the one that has already cost work;
|
|
179
|
+
* - it names a person, says how long ago in words the SERVER measured, and
|
|
180
|
+
* never blames a colleague for what you did in your own second tab;
|
|
181
|
+
* - every state offers a way on (the lock is advisory), and nothing here
|
|
182
|
+
* throws work away except the button that says it will.
|
|
183
|
+
*/
|
|
184
|
+
|
|
185
|
+
type EditNoticeAction = 'reload' | 'take-over' | 'take-back' | 'view-read-only';
|
|
186
|
+
type EditNoticeContent = {
|
|
187
|
+
/** `warning` for a state that is costing (or about to cost) edits; `neutral` otherwise. */
|
|
188
|
+
tone: 'warning' | 'neutral';
|
|
189
|
+
/** Work is at risk right now: read out at once (`role="alert"`). */
|
|
190
|
+
urgent: boolean;
|
|
191
|
+
/** The sentence that names what happened — drawn bold. */
|
|
192
|
+
lead: string;
|
|
193
|
+
/** What it means for the operator's work. */
|
|
194
|
+
body: string;
|
|
195
|
+
actions: {
|
|
196
|
+
kind: EditNoticeAction;
|
|
197
|
+
label: string;
|
|
198
|
+
title?: string;
|
|
199
|
+
}[];
|
|
200
|
+
};
|
|
201
|
+
/**
|
|
202
|
+
* The two groups of words a notice is written in: its own sentences, and the
|
|
203
|
+
* edit lock's "2 minutes ago" / "Someone else". The whole catalogue fits —
|
|
204
|
+
* `editNotice(access, conflict, noun, useEditorStrings())`.
|
|
205
|
+
*/
|
|
206
|
+
type EditNoticeWords = {
|
|
207
|
+
notice: NoticeWords;
|
|
208
|
+
lock: LockWords;
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* The notice for this access and conflict, or `null` when there is nothing to
|
|
212
|
+
* say. `noun` is what the document is called in a sentence: `'email'`, `'page'`.
|
|
213
|
+
*
|
|
214
|
+
* `words` is the host's language (0.95.0); left out, the notice is the English
|
|
215
|
+
* it always was.
|
|
216
|
+
*/
|
|
217
|
+
declare function editNotice(access: EditAccess, conflict: SaveConflict | null, noun: string, words?: EditNoticeWords): EditNoticeContent | null;
|
|
218
|
+
|
|
219
|
+
export { DeviceSwitch, DeviceSwitchProps, EditNotice, type EditNoticeAction, type EditNoticeContent, EditNoticeProps, type EditNoticeWords, EditorIconButton, EditorIconButtonProps, EditorTopBar, InspectorHead, InspectorHeadProps, InspectorIconButton, InspectorIconButtonProps, InspectorUpLevel, InspectorUpLevelProps, NoticeWords, PanelResizeHandle, PanelResizeHandleProps, SaveState, SaveStateProps, SaveStateToggle, SaveStateToggleProps, TopBarCluster, TopBarClusterProps, TopBarDivider, TopBarProps, TopBarRail, editNotice };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import{DEFAULT_NOTICE_WORDS as e,DEFAULT_CHROME_WORDS as n}from"../chunk-KDIVA6WD.js";import{holderOf as t,describeAge as i,nameOrSomeone as a}from"../chunk-TDA4HH54.js";import{DEFAULT_LOCK_WORDS as r}from"../chunk-RE4LP46F.js";import{railTokens as o,EditorRail as s}from"../chunk-YIMRTIBN.js";import{DEFAULT_RAIL_WORDS as l}from"../chunk-2OAZYSWJ.js";import{useWords as c}from"../chunk-MFIRYGHW.js";import"../chunk-BZ5ASXOL.js";import{jsx as d,jsxs as u}from"react/jsx-runtime";import{useRef as m,useState as p,useCallback as v,useEffect as h,useLayoutEffect as b}from"react";function f({children:e}){/* @__PURE__ */
|
|
2
|
+
return d("div",{className:"es-topbar",children:e})}function k({kind:e,style:n,children:t}){/* @__PURE__ */
|
|
3
|
+
return d("div",{className:e?`es-cluster es-cluster--${e}`:"es-cluster",style:n,children:t})}function g(){/* @__PURE__ */
|
|
4
|
+
return d("div",{className:"es-divider-v","aria-hidden":"true"})}var y="undefined"==typeof window?h:b;function w({items:e,ariaLabel:n}){const t=c("rail",l),i=m(null),[a,r]=p(void 0),u=JSON.stringify(e.map(e=>e.label));return y(()=>{const n=i.current?.querySelector(".es-rail");if(!n)return;const t=document.createElement("canvas").getContext?.("2d")??null,a=()=>{if(!t)return r(void 0);const i=function(e,n,t){const i=parseFloat(getComputedStyle(e).getPropertyValue(n));return Number.isFinite(i)?i:t}(n,"--es-rail-word-size",o.wordFontSize),a=getComputedStyle(n).getPropertyValue("--es-rail-word-weight").trim()||String(o.wordFontWeight),s=getComputedStyle(n.querySelector(".es-rail-btn")??n).fontFamily;t.font=`${a} ${i}px ${s}`;const l=e.map(e=>t.measureText(e.label).width),c=e=>Math.ceil(4*e)/4;r({labelsPx:c(l.reduce((e,n)=>e+n,0)),widestLabelPx:c(Math.max(0,...l))})};a();let s=!0;return document.fonts?.ready.then(()=>s&&a()),()=>{s=!1}},[u]),/* @__PURE__ */d("div",{ref:i,className:"es-cluster es-cluster--rail es-rail-fit",children:/* @__PURE__ */d(s,{items:e,ariaLabel:n??t.label,orientation:"row",wordFit:a})})}function N({label:e,onClick:n,disabled:t,state:i,buttonRef:a,children:r}){/* @__PURE__ */
|
|
5
|
+
return d("button",{ref:a,type:"button",className:i?`es-iconbtn es-iconbtn--${i}`:"es-iconbtn",title:e,"aria-label":e,disabled:t,onClick:n,children:r})}function x({devices:e,value:t,onChange:i,ariaLabel:a}){const r=c("chrome",n);/* @__PURE__ */
|
|
6
|
+
return d("div",{className:"es-devseg",role:"group","aria-label":a??r.device,children:e.map(e=>{const n=e.id===t;/* @__PURE__ */
|
|
7
|
+
return d("button",{type:"button",title:e.label,"aria-label":e.label,"aria-pressed":n,className:n?"is-active":void 0,onClick:()=>{n||i(e.id)},children:e.icon},e.id)})})}var C={idle:"is-quiet",saved:"is-quiet is-saved",saving:"is-saving",error:"is-error",off:"is-off","off-unsaved":"is-off is-unsaved"};function O({tone:e,label:n,counting:t,waitMs:i,ringRef:a,role:r}){/* @__PURE__ */
|
|
8
|
+
return u("span",{className:`es-savestate ${C[e]}`,role:r,"aria-live":"polite",children:[/* @__PURE__ */d("span",t?{ref:a,className:"es-savestate-ring is-counting",style:void 0!==i?{"--es-savewait":`${i}ms`}:void 0,"aria-hidden":"true"}:{className:"es-savestate-dot","aria-hidden":"true"}),n]})}function P({pressed:e,title:n,onToggle:t,children:i}){/* @__PURE__ */
|
|
9
|
+
return d("button",{type:"button",className:"es-savestate-toggle","aria-pressed":e,title:n,onClick:t,children:i})}var S="es-col-resizing";function L({side:e,width:t,min:i,max:a,defaultWidth:r,label:o,onResize:s}){const l=c("chrome",n),u=m(null),p=v((n,t)=>{const r="left"===e?n+t:n-t;return Math.round(Math.min(a,Math.max(i,r)))},[e,i,a]),b=v(e=>{u.current&&(u.current=null,document.body.classList.remove(S),e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))},[]),f=v(e=>{0===e.button&&(u.current={x:e.clientX,w:t,moved:!1},e.currentTarget.setPointerCapture(e.pointerId),document.body.classList.add(S))},[t]),k=v(e=>{const n=u.current;if(!n)return;if(0===e.buttons)return void b(e);const t=e.clientX-n.x;if(!n.moved){if(Math.abs(t)<3)return;n.moved=!0}s(p(n.w,t))},[s,p,b]),g=v(e=>{"ArrowLeft"===e.key?(e.preventDefault(),s(e=>p(e,-16))):"ArrowRight"===e.key?(e.preventDefault(),s(e=>p(e,16))):"Home"===e.key&&(e.preventDefault(),s(r))},[s,p,r]);return h(()=>()=>document.body.classList.remove(S),[]),/* @__PURE__ */d("div",{className:`es-resizer es-resizer--${e}`,role:"separator",tabIndex:0,"aria-orientation":"vertical","aria-label":o,"aria-valuenow":t,"aria-valuemin":i,"aria-valuemax":a,title:l.resize,onPointerDown:f,onPointerMove:k,onPointerUp:b,onPointerCancel:b,onLostPointerCapture:b,onDoubleClick:()=>s(r),onKeyDown:g,children:/* @__PURE__ */d("span",{className:"es-resizer-bar","aria-hidden":"true"})})}function M({icon:e,name:n,kind:t,actions:i}){/* @__PURE__ */
|
|
10
|
+
return u("div",{className:"es-insp-head",children:[
|
|
11
|
+
/* @__PURE__ */d("span",{className:"es-insp-chip","aria-hidden":"true",children:e}),
|
|
12
|
+
/* @__PURE__ */u("div",{className:"es-insp-titles",children:[
|
|
13
|
+
/* @__PURE__ */d("h2",{className:"es-insp-name",children:n}),
|
|
14
|
+
/* @__PURE__ */d("div",{className:"es-insp-kind",children:t})]}),i?/* @__PURE__ */d("div",{className:"es-insp-actions",children:i}):null]})}function B({label:e,title:n,hasPopup:t,onClick:i,disabled:a,danger:r,expanded:o,buttonRef:s,children:l}){/* @__PURE__ */
|
|
15
|
+
return d("button",{ref:s,type:"button",className:r?"es-insp-iconbtn es-insp-iconbtn--danger":"es-insp-iconbtn",title:n??e,"aria-label":e,"aria-haspopup":t,"aria-expanded":o,disabled:a,onClick:i,children:l})}function R({name:e,onSelect:t,icon:i,label:a}){const r=c("chrome",n),o=a??r.upLevel;/* @__PURE__ */
|
|
16
|
+
return d("div",{className:"es-insp-up",children:/* @__PURE__ */u("button",{type:"button",className:"es-insp-up-btn",title:o,"aria-label":r.upLevelTo({label:o,name:e}),onClick:t,children:[i?/* @__PURE__ */d("span",{className:"es-insp-up-icon","aria-hidden":"true",children:i}):null,
|
|
17
|
+
/* @__PURE__ */d("span",{className:"es-insp-up-name",children:e})]})})}var $={notice:e,lock:r};function D(e,n,r,o=$){const s=o.notice,l=t(e),c={kind:"reload",label:s.reload};if(n){const e=i(n.secondsAgo,o.lock);return{tone:"warning",urgent:!0,lead:n.savedByYou?s.savedByYou({noun:r,when:e}):s.savedByOther({name:a(n.savedBy,o.lock),noun:r,when:e}),body:s.conflictBody,actions:l?[c,{kind:"take-over",label:s.takeOver,title:s.takeOverWhileDeciding}]:[c]}}if(!l)return null;const d=a(l.name,o.lock),u=i(l.secondsSinceSeen,o.lock);switch(e.kind){case"takenover":return{tone:"warning",urgent:!0,lead:s.tookOver({name:d,noun:r,when:i(l.secondsSinceHeld,o.lock)}),body:s.tookOverBody,actions:[{kind:"take-back",label:s.takeBack},c]};case"readonly":return{tone:"neutral",urgent:!1,lead:s.viewingOnly,body:s.viewingOnlyBody({name:d,noun:r,seen:u}),actions:[{kind:"take-over",label:s.takeOver}]};default:return{tone:"warning",urgent:!1,lead:s.editing({name:d,noun:r}),body:s.editingBody({seen:u}),actions:[{kind:"view-read-only",label:s.viewReadOnly},{kind:"take-over",label:s.takeOver,title:s.takeOverTold}]}}}function T({access:n,conflict:t,noun:i,onTakeOver:a,onViewReadOnly:o,onReload:s}){const l=D(n,t,i,{notice:c("notice",e),lock:c("lock",r)});if(!l)return null;const m={reload:s,"take-over":a,"take-back":a,"view-read-only":o};/* @__PURE__ */
|
|
18
|
+
return u("div",{className:`es-notice is-${l.tone}`,role:l.urgent?"alert":"status",children:[
|
|
19
|
+
/* @__PURE__ */u("span",{className:"es-notice-text",children:[
|
|
20
|
+
/* @__PURE__ */d("strong",{children:l.lead})," ",l.body]}),
|
|
21
|
+
/* @__PURE__ */d("span",{className:"es-notice-actions",children:l.actions.map(e=>/* @__PURE__ */d("button",{type:"button",className:"es-notice-btn",title:e.title,onClick:m[e.kind],children:e.label},e.kind))})]})}var j={left:288,right:320},z=220,F=560;function I(e){return Math.min(560,Math.max(220,Math.round(e)))}function A(e){return{"--es-left-w":`${e.left}px`,"--es-right-w":`${e.right}px`}}export{j as DEFAULT_PANEL_W,x as DeviceSwitch,T as EditNotice,N as EditorIconButton,f as EditorTopBar,M as InspectorHead,B as InspectorIconButton,R as InspectorUpLevel,F as MAX_PANEL_W,z as MIN_PANEL_W,L as PanelResizeHandle,O as SaveState,P as SaveStateToggle,k as TopBarCluster,g as TopBarDivider,w as TopBarRail,I as clampPanelWidth,D as editNotice,A as panelWidthVars};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{MARKUP_TOOLS as e,MARK_PLACEHOLDERS as t}from"./chunk-6OPSJGAI.js";var i={formatting:"Formatting",alignment:"Alignment",align:{left:"Left",center:"Center",right:"Right",justify:"Justify"},link:{title:"Link",label:"Link to",placeholder:"https://… or /page",refused:"Use a web address (https://…), a page on this site (/…), mailto: or tel:.",remove:"Remove link",apply:"Apply"},marks:Object.fromEntries(e.map(e=>[e.style,{name:e.name??e.title,title:e.title}])),placeholders:t};export{i as DEFAULT_COPY_WORDS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r={label:"Editor"};export{r as DEFAULT_RAIL_WORDS};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{DEFAULT_PANEL_WORDS as e}from"./chunk-7A7O2JWQ.js";import{jsx as a,jsxs as l,Fragment as i}from"react/jsx-runtime";import{isValidElement as n,cloneElement as s}from"react";function r({items:i,activeId:n,onSelect:s,ariaLabel:r=e.settings,className:t}){
|
|
2
|
+
/* @__PURE__ */
|
|
3
|
+
return a("div",{className:"es-tabs-fit",children:/* @__PURE__ */a("div",{role:"tablist","aria-label":r,"aria-orientation":"horizontal",className:t?`es-tabs ${t}`:"es-tabs",children:i.map(e=>{const i=e.id===n,r=`es-tab${e.icon?" has-icon":""}${i?" is-active":""}`;/* @__PURE__ */
|
|
4
|
+
return l("button",{type:"button",role:"tab",id:e.htmlId,title:e.label,"aria-label":e.label,"aria-selected":i,"aria-controls":e.panelId,className:r,onClick:()=>s(e.id),children:[e.icon?/* @__PURE__ */a("span",{className:"es-tab-icon","aria-hidden":"true",children:e.icon}):null,
|
|
5
|
+
/* @__PURE__ */a("span",{className:"es-tab-word",children:e.label}),"number"==typeof e.badge&&e.badge>0?/* @__PURE__ */a("span",{className:"es-tab-badge",children:e.badge}):null]},e.id)})})})}function t({checked:e,onChange:l,disabled:i,id:n,ariaLabel:s,ariaLabelledBy:r,className:t}){/* @__PURE__ */
|
|
6
|
+
return a("button",{type:"button",role:"switch",id:n,"aria-checked":e,"aria-label":s,"aria-labelledby":r,disabled:i,className:t?`es-switch ${t}`:"es-switch",onClick:()=>l(!e)})}function c(e){return Array.isArray(e)?e.some(c):n(e)}function d(e,a,l){if(!n(e)||e.type!==t)return e;const i=e.props;return i.ariaLabel||i.ariaLabelledBy?e:s(e,l?{ariaLabelledBy:l}:{ariaLabel:a})}function o({label:e,labelId:n,icon:s,value:r,hint:t,changed:o,htmlFor:u,action:h,children:b,className:m}){const p=c(b),N=c(h);if(!p&&!N)return null;const f=["es-field"];p||f.push("is-inline"),o&&f.push("is-changed"),m&&f.push(m);const g=/* @__PURE__ */l(i,{children:[s?/* @__PURE__ */a("span",{className:"es-field-icon","aria-hidden":"true",children:s}):null,
|
|
7
|
+
/* @__PURE__ */a("span",{className:"es-field-label",id:n,children:e})]});/* @__PURE__ */
|
|
8
|
+
return l("div",{className:f.join(" "),children:[
|
|
9
|
+
/* @__PURE__ */l("div",{className:"es-field-head",children:[u?/* @__PURE__ */a("label",{className:"es-field-name",htmlFor:u,children:g}):/* @__PURE__ */a("span",{className:"es-field-name",children:g}),null!=r?/* @__PURE__ */a("span",{className:"es-field-value",children:r}):null,N?d(h,e,n):null]}),p?/* @__PURE__ */a("div",{className:"es-field-ctl",children:b}):null,t?/* @__PURE__ */a("p",{className:"es-field-hint",children:t}):null]})}function u({title:e,open:i,onToggle:n,count:s,id:r,children:t,className:c}){const d=r?`${r}-body`:void 0;/* @__PURE__ */
|
|
10
|
+
return l("div",{className:c?`es-group ${c}`:"es-group",children:[
|
|
11
|
+
/* @__PURE__ */l("button",{type:"button",id:r,"aria-expanded":i,"aria-controls":d,className:"es-group-head",onClick:()=>n(!i),children:[e,"number"==typeof s&&s>0?/* @__PURE__ */a("span",{className:"es-group-count",children:s}):null,
|
|
12
|
+
/* @__PURE__ */a("span",{className:"es-group-sign","aria-hidden":"true"})]}),
|
|
13
|
+
/* @__PURE__ */a("div",{id:d,className:"es-group-body",hidden:!i,children:t})]})}var h=Object.freeze(["Content","Style","Layout","Animation"]);export{h as SETTINGS_BUCKETS,o as SettingsField,u as SettingsGroup,t as SettingsSwitch,r as SettingsTabs};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{zoneKey as e}from"./chunk-LPRQDDQO.js";import{useRef as t,useEffect as n,useState as r,useSyncExternalStore as o,useCallback as i}from"react";var c=56,l=16;function u(e){const t=Math.max(e,0);return t>=c?0:Math.ceil(16*(1-t/c))}function a(e,t,n){if(e<t-c||e>n+c)return 0;const r=e-t,o=n-e;return r<c&&r<=o?-u(r):o<c?u(o):0}function s(e){const t=e?.ownerDocument?.defaultView;for(let n=e?.parentElement??null;n;n=n.parentElement){const e=t?.getComputedStyle(n).overflowY;if(("auto"===e||"scroll"===e)&&n.scrollHeight>n.clientHeight)return n}return null}function f(e){const t=e?.ownerDocument?.defaultView?.getComputedStyle(e).overflowY;return e&&("auto"===t||"scroll"===t)&&e.scrollHeight>e.clientHeight?e:s(e)}function d(e){const t=e.ownerDocument,n=t.defaultView;if(!n)return()=>{};let r=null,o=0;const i=e=>{r=e.clientY},c=()=>{if(null!==r){const t=e.getBoundingClientRect(),n=a(r,t.top,t.bottom);n&&(e.scrollTop+=n)}o=n.requestAnimationFrame(c)};return t.addEventListener("dragover",i,!0),o=n.requestAnimationFrame(c),()=>{t.removeEventListener("dragover",i,!0),n.cancelAnimationFrame(o)}}function g(){let e=null,t=null;const n=/* @__PURE__ */new Set,r=()=>{if(t!==e){t=e;for(const e of[...n])e()}};return{get:()=>e,shown:()=>t,start(t){e=t,globalThis.setTimeout(r,0)},end(){null===e&&null===t||(e=null,r())},subscribe:e=>(n.add(e),()=>{n.delete(e)})}}function p(e,t,n,r){if(e.into)return{side:"into",to:e.into};return"first"===e.pinned||"last"!==e.pinned&&t>n+r/2?{side:"after",to:{...e.place,index:e.place.index+1}}:{side:"before",to:{...e.place,index:e.place.index}}}var m=(t,n)=>e(t)===e(n);function v(e,t){return m(e,t)&&(t.index===e.index||t.index===e.index+1)}function D(e,t){return m(e,t)&&e.index<t.index?t.index-1:t.index}function y(e,t){return{...e,index:t<0?e.index-1:e.index+2}}function w(e,t){if(!t)return e;const n={...t,...e};for(const[r,o]of Object.entries(e)){const e=t[r];"function"==typeof o&&"function"==typeof e&&(n[r]=t=>{o(t),e(t)})}return n}function x(c){const l=t(c);n(()=>{l.current=c});const[u]=r(()=>g()),a=c.session??u,m=o(a.subscribe,a.shown,a.shown),[D,y]=r(null),x=t(null),b=i(()=>{x.current?.(),x.current=null},[]),h=i(()=>{b(),a.end(),y(null)},[a,b]);n(()=>a.subscribe(()=>{a.get()||(b(),y(null))}),[a,b]),n(()=>b,[b]);const T=i((e,t)=>{y(n=>n&&n.key===e&&n.side===t?n:{key:e,side:t})},[]),k=i(e=>{y(t=>t&&t.key===e?null:t)},[]),E=(e,t,n,r)=>!("into"===n?r===e.key:void 0!==e.from&&v(e.from,t))&&l.current.canDrop(e.item,t);return{dragging:m?.item??null,row:(e,t)=>{const{keyOf:n,readOnly:r}=l.current,o=n(e.item),i=!r&&!e.pinned&&!1!==e.canDrag,c=t=>{const n=t.currentTarget.getBoundingClientRect();return p(e,t.clientY,n.top,n.height)},u={draggable:i||void 0,onDragStart:i?t=>{const n=t.currentTarget;a.start({key:o,item:e.item,from:e.place}),t.dataTransfer.effectAllowed="move";try{t.dataTransfer.setData("text/plain",o)}catch{}n.classList.add("is-lifting");const r=n.getBoundingClientRect();t.dataTransfer.setDragImage?.(n,t.clientX-r.left,t.clientY-r.top),n.ownerDocument.defaultView?.setTimeout(()=>n.classList.remove("is-lifting"),0);const i=s(n);b(),x.current=i?d(i):null}:void 0,onDragEnd:i?()=>h():void 0,onDragOver:e=>{const t=a.get();if(!t)return;const n=c(e);E(t,n.to,n.side,o)?(e.preventDefault(),e.dataTransfer.dropEffect="move",T(o,n.side)):k(o)},onDrop:e=>{const t=a.get();if(!t)return;const n=c(e);E(t,n.to,n.side,o)&&(e.preventDefault(),h(),l.current.onDrop(t.item,n.to))},onKeyDown:t=>{if("ArrowUp"!==t.key&&"ArrowDown"!==t.key)return;if(!t.altKey||t.ctrlKey||t.metaKey||t.shiftKey)return;if(t.preventDefault(),t.repeat||!i)return;const{onStep:n,canStep:r}=l.current,o="ArrowUp"===t.key?-1:1;n&&!1!==r?.(e.item,o)&&n(e.item,o)}};return{draggable:i,dragging:m?.key===o,drop:D?.key===o?D.side:void 0,rowProps:w(u,t)}},seam:(t,n)=>{const r=(o=t.place,`seam:${e(o)}:${o.index}`);var o;const i={onDragOver:e=>{const n=a.get();n&&(E(n,t.place,"before",r)?(e.preventDefault(),e.dataTransfer.dropEffect="move",T(r,"before")):k(r))},onDrop:e=>{const n=a.get();n&&E(n,t.place,"before",r)&&(e.preventDefault(),h(),l.current.onDrop(n.item,t.place))}};return{drop:D?.key===r,seamProps:w(i,n)}},rootProps:e=>w({onDragEnter:e=>{if(!a.get()||x.current)return;const t=f(e.currentTarget);x.current=t?d(t):null},onDragLeave:e=>{const t=e.relatedTarget;t&&e.currentTarget.contains(t)||y(null)}},e)}}export{c as AUTO_SCROLL_EDGE,l as AUTO_SCROLL_MAX_SPEED,a as autoScrollDelta,u as autoScrollSpeed,g as createDragSession,p as dropOnRow,D as gapToMoveIndex,v as isNoOpDrop,f as scrollBoxOf,s as scrollParent,d as startAutoScroll,y as stepGap,x as useTreeDrag};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={bold:{fence:"**",placeholder:"bold text"},italic:{fence:"_",placeholder:"italic text"},strike:{fence:"~~",placeholder:"struck out"},code:{fence:"`",placeholder:"code"},highlight:{fence:"==",placeholder:"highlighted text"},quiet:{fence:"^^",placeholder:"quiet text"}},t={bold:e.bold.placeholder,italic:e.italic.placeholder,strike:e.strike.placeholder,code:e.code.placeholder,highlight:e.highlight.placeholder,quiet:e.quiet.placeholder,link:"link text"},n={bullet:()=>"- ",number:e=>`${e+1}. `,quote:()=>"> "};function l(l,i,r,s,o=u,c=t){if("clear"===s)return Q(l,i,r,o);const a=l.slice(i,r);if("link"===s){const e=a||c.link,t=`[${e}](https://)`;return{text:l.slice(0,i)+t+l.slice(r),selectionStart:i+e.length+3,selectionEnd:i+t.length-1}}const h=n[s];if(h){const e=l.lastIndexOf("\n",Math.max(i-1,0))+1,t=l.indexOf("\n",r),n=-1===t?l.length:t,s=l.slice(e,n).split("\n"),o=s.every((e,t)=>e.startsWith(h(t))),c=s.map((e,t)=>o?e.slice(h(t).length):h(t)+e).join("\n");return{text:l.slice(0,e)+c+l.slice(n),selectionStart:e,selectionEnd:e+c.length}}const{fence:d}=e[s],f=c[s],k=l.slice(Math.max(0,i-d.length),i),p=l.slice(r,r+d.length);if(k===d&&p===d)return{text:l.slice(0,i-d.length)+a+l.slice(r+d.length),selectionStart:i-d.length,selectionEnd:i-d.length+a.length};const g=a||f;return{text:l.slice(0,i)+d+g+d+l.slice(r),selectionStart:i+d.length,selectionEnd:i+d.length+g.length}}function i(t,n,l,i){const r=e[i];if(!r)return!1;const{fence:s}=r;return n>=s.length&&t.slice(n-s.length,n)===s&&t.slice(l,l+s.length)===s}function r(e,t,n){const l=0===t?0:e.lastIndexOf("\n",t-1)+1;for(let i=e.lastIndexOf("[",t);i>=l;i=0===i?-1:e.lastIndexOf("[",i-1)){const t=S(e,i);if(t&&n<=t.end)return{start:i,end:t.end,label:t.label,href:t.href}}return null}function s(e,t,n,l){const i=r(e,t,n),s=i?i.start:t,o=i?i.end:n,c=`[${i?i.label:e.slice(t,n)||l}](${l})`,a=s+c.length;return{text:e.slice(0,s)+c+e.slice(o),selectionStart:a,selectionEnd:a}}function o(e,t){return{text:e.slice(0,t.start)+t.label+e.slice(t.end),selectionStart:t.start,selectionEnd:t.start+t.label.length}}var c=[{style:"bold",label:"B",name:"Strong",title:"Strong · **words** · ⌘B",shortcut:"b"},{style:"italic",label:"I",name:"Italic",title:"Italic · _words_ · ⌘I",shortcut:"i"},{style:"strike",label:"S",name:"Strikethrough",title:"Strikethrough · ~~words~~"},{style:"highlight",label:"◆",name:"Emphasis",title:"Emphasis · ==words=="},{style:"quiet",label:"a",name:"Quiet",title:"Quiet · ^^words^^"},{style:"code",label:"‹›",name:"Code",title:"Code"},{style:"link",label:"🔗",name:"Link",title:"Link · [words](https://…) · ⌘K",shortcut:"k"},{style:"bullet",label:"•",name:"Bulleted list",title:"Bulleted list"},{style:"number",label:"1.",name:"Numbered list",title:"Numbered list"},{style:"quote",label:"❝",name:"Quote",title:"Quote"},{style:"clear",label:"T×",name:"Clear marks",title:"Clear marks · ⌘⇧X",shortcut:"shift+x"}],a={bold:"Strong",highlight:"Emphasis",quiet:"Quiet"};function h(e){return c.filter(t=>e.includes(t.style))}var u=[{open:"**",close:"**",kind:"bold"},{open:"==",close:"==",kind:"highlight"},{open:"~~",close:"~~",kind:"strike"},{open:"_",close:"_",kind:"italic",wordBoundary:!0},{open:"^^",close:"^^",kind:"quiet"},{open:"@@",close:"@@",kind:"highlight"},{open:"++",close:"++",kind:"bold"}],d=c.map(e=>e.style).filter(e=>u.some(t=>t.kind===e)),f=[...u,{open:"*",close:"*",kind:"accent"}],k=[...u,{open:"*",close:"*",kind:"accent"},{open:"#",close:"#",kind:"bold",notBefore:"0123456789"},{open:"[",close:"]",kind:"italic",notBefore:"("}];function p(e){return!/\s/.test(e)&&!/[!-\/:-@[-`{-~]/.test(e)}function g(e,t){const n=[];let l="",i=0;for(;i<e.length;){const r=m(e,i,t);r?(n.push({kind:"text",text:l}),l="",n.push({kind:r.rule.kind,text:r.inner}),i=r.end):(l+=e[i],i+=1)}return n.push({kind:"text",text:l}),n}function m(e,t,n){for(const l of n){if(!e.startsWith(l.open,t))continue;if(l.wordBoundary&&t>0&&p(e[t-1]))continue;const n=t+l.open.length,i=e.indexOf(l.close,n);if(i<n+1)continue;const r=e.slice(n,i);if(r.includes(l.close[0]))continue;if(r.includes("\n"))continue;const s=i+l.close.length,o=e[s];if((!l.notBefore||void 0===o||!l.notBefore.includes(o))&&(!l.wordBoundary||void 0===o||!p(o)))return{rule:l,inner:r,end:s}}return null}function x(e,t){return g(e,t).map(e=>e.text).join("")}var b=["http","https","mailto","tel"];function y(e){if(""===e||/[\s\u0000-\u001f\u007f]/.test(e))return!1;const t=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e);return!t||b.includes(t[1].toLowerCase())}function S(e,t){if("["!==e[t])return null;const n=e.indexOf("]",t+1);if(n<t+2||"("!==e[n+1])return null;const l=e.slice(t+1,n);if(l.includes("["))return null;const i=e.indexOf(")",n+2);if(-1===i)return null;const r=e.slice(n+2,i);return y(r)?{label:l,href:r,end:i+1}:null}var v=2;function w(e,t,n){const l=[];let i="";const r=()=>{i&&l.push({kind:"text",text:i}),i=""},s=e=>n+1<v?w(e,t,n+1):[{kind:"text",text:e}];let o=0;for(;o<e.length;){const n=S(e,o);if(n){r(),l.push({kind:"link",href:n.href,children:s(n.label)}),o=n.end;continue}const c=m(e,o,t);c?(r(),l.push({kind:c.rule.kind,open:c.rule.open,close:c.rule.close,children:s(c.inner)}),o=c.end):(i+=e[o],o+=1)}return r(),l}function E(e,t){return e.split("\n").map(e=>{const n=e.startsWith("- ")&&""!==e.slice(2).trim();return{bullet:n,children:w(n?e.slice(2):e,t,0)}})}function B(e){return e.map(e=>"text"===e.kind?e.text:"link"===e.kind?`[${B(e.children)}](${e.href})`:e.open+B(e.children)+e.close).join("")}function q(e){return e.map(e=>(e.bullet?"- ":"")+B(e.children)).join("\n")}function O(t,n,l){if("link"===n)return void 0===l?null:{id:t,kind:"link",open:"[",close:`](${l})`,href:l};const i=e[n];return i&&"code"!==n?{id:t,kind:n,open:i.fence,close:i.fence}:null}function I(e,t){let n=0,l=0;return e.split("\n").map(e=>{const[i]=E(e,t);let r=l+(i.bullet?2:0);l+=e.length+1;const s=[],o=(e,t)=>{for(const l of e){if("text"===l.kind){for(const e of l.text)s.push({ch:e,marks:t,at:r}),r+=e.length;continue}const e="link"===l.kind?O(++n,"link",l.href):{id:++n,kind:l.kind,open:l.open,close:l.close};r+=e.open.length,o(l.children,[...t,e]),r+=e.close.length}};return o(i.children,[]),{bullet:i.bullet,chars:s}})}function $(e){let t="";const n=[];return e.forEach((e,l)=>{l>0&&(t+="\n"),e.bullet&&(t+="- ");const i=[],r=[];for(const n of e.chars){let e=0;for(;e<i.length&&e<n.marks.length&&i[e].id===n.marks[e].id;)e+=1;for(;i.length>e;)t+=i.pop().close;for(let l=e;l<n.marks.length;l+=1)t+=n.marks[l].open,i.push(n.marks[l]);r.push(t.length),t+=n.ch}for(;i.length>0;)t+=i.pop().close;n.push(r)}),{text:t,at:n}}function C(e,t){return e.length===t.length&&e.every((e,n)=>{const l=t[n];return e.bullet===l.bullet&&e.chars.length===l.chars.length&&e.chars.every((e,t)=>{const n=l.chars[t];return e.ch===n.ch&&e.marks.length===n.marks.length&&e.marks.every((e,t)=>e.kind===n.marks[t].kind&&e.href===n.marks[t].href)})})}function Q(e,t,n,l=u){const i=I(e,l),r=i.flatMap(e=>e.chars),s={text:e,selectionStart:t,selectionEnd:n},o=e=>i.map(t=>({bullet:t.bullet,chars:t.chars.map(t=>({...t,marks:t.marks.filter(n=>"link"===n.kind||!e(t,n))}))})),c=e=>{const t=$(e);return C(e,I(t.text,l))?t:null},a=(e,t)=>{let n=r.indexOf(t);for(let t=0;t<e.at.length;t+=1){if(n<e.at[t].length)return e.at[t][n];n-=e.at[t].length}return 0};if(t===n){const e=[...r].reverse().find(e=>e.at<t),n=r.find(e=>e.at>=t),l=new Set([...e?.marks??[],...n?.marks??[]].map(e=>e.id));if(![...l].some(e=>r.some(t=>t.marks.some(t=>t.id===e&&"link"!==t.kind))))return s;const i=c(o((e,t)=>l.has(t.id)));if(!i)return s;const h=n?a(i,n):e?a(i,e)+e.ch.length:0;return{text:i.text,selectionStart:h,selectionEnd:h}}const h=new Set(r.filter(e=>e.at>=t&&e.at<n));if(0===h.size)return s;const d=new Set([...h].flatMap(e=>e.marks.map(e=>e.id))),f=c(o(e=>h.has(e)))??c(o((e,t)=>d.has(t.id)));if(!f)return s;const k=r.find(e=>h.has(e)),p=[...r].reverse().find(e=>h.has(e));return{text:f.text,selectionStart:a(f,k),selectionEnd:a(f,p)+p.ch.length}}export{k as CAMPAIGN_MARKUP,d as COPY_FIELD_TOOLS,c as MARKUP_TOOLS,a as MARK_NAMES,t as MARK_PLACEHOLDERS,u as STANDARD_MARKUP,f as STOREFRONT_MARKUP,l as applyMark,Q as clearMarks,r as findLink,y as isSafeLinkHref,i as markedAt,I as markedLines,h as markupTools,E as parseMarkup,o as removeLink,C as sameMarks,q as serializeMarkup,O as spanFor,x as stripInline,g as tokenizeInline,s as writeLink,$ as writeMarkedLines};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t={copy:"Copy style",paste:({source:t})=>`Paste style from ${t}`,nothing:({source:t,target:s})=>`Nothing to paste. ${s} has none of ${t}'s style settings.`,pasted:({count:t,source:s})=>`Pasted ${t} setting${1===t?"":"s"} from ${s}.`};export{t as DEFAULT_STYLE_CLIPBOARD_WORDS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t={settings:"Settings",buckets:{Content:"Content",Style:"Style",Layout:"Layout",Animation:"Animation"}};export{t as DEFAULT_PANEL_WORDS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t){return{"--es-fit-count":e,"--es-fit-labels":`${t.labelsPx}px`,"--es-fit-widest":`${t.widestLabelPx}px`}}export{e as wordFitVars};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{tokenizeInline as e,STANDARD_MARKUP as t}from"./chunk-6OPSJGAI.js";import{jsx as n,jsxs as l}from"react/jsx-runtime";import{useRef as r}from"react";function s(t,n){const l=[];let r=0;for(const s of e(t,n)){if("text"===s.kind){s.text.length>0&&(l.push({kind:"text",text:t.slice(r,r+s.text.length)}),r+=s.text.length);continue}const e=i(t,r,s.kind,s.text,n);if(!e)return[{kind:"text",text:t}];const o=r+e.open.length,c=o+s.text.length,a=c+e.close.length;l.push({kind:"delimiter",text:t.slice(r,o)}),l.push({kind:s.kind,text:t.slice(o,c)}),l.push({kind:"delimiter",text:t.slice(c,a)}),r=a}return l.map(e=>e.text).join("")!==t?[{kind:"text",text:t}]:l}function i(e,t,n,l,r){for(const s of r){if(s.kind!==n)continue;if(!e.startsWith(s.open,t))continue;const r=t+s.open.length;if(e.startsWith(l,r)&&e.startsWith(s.close,r+l.length))return s}return null}function o({value:e,rules:l=t,className:r,layerRef:i}){const o=s(e,l);/* @__PURE__ */
|
|
2
|
+
return n("div",{ref:i,className:["es-gold-layer",r??""].filter(Boolean).join(" "),"aria-hidden":"true",children:o.map((e,t)=>function(e,t){const{kind:l,text:r}=e;switch(l){case"delimiter":/* @__PURE__ */
|
|
3
|
+
return n("span",{className:"es-gold-delim",children:r},t);case"accent":case"highlight":/* @__PURE__ */
|
|
4
|
+
return n("em",{className:"es-gold-mark es-gold-accent",children:r},t);case"bold":/* @__PURE__ */
|
|
5
|
+
return n("strong",{className:"es-gold-mark es-gold-bold",children:r},t);case"italic":/* @__PURE__ */
|
|
6
|
+
return n("em",{className:"es-gold-mark es-gold-italic",children:r},t);case"strike":/* @__PURE__ */
|
|
7
|
+
return n("s",{className:"es-gold-mark es-gold-strike",children:r},t);case"quiet":/* @__PURE__ */
|
|
8
|
+
return n("span",{className:"es-gold-mark es-gold-quiet",children:r},t);default:/* @__PURE__ */
|
|
9
|
+
return n("span",{className:"es-gold-text",children:r},t)}}(e,t))})}function c({value:e,onInput:s,onCommit:i,onCancel:c,multiline:a=!1,placeholder:u,className:d,rules:f=t,ariaLabel:m,disabled:h=!1,inputRef:g}){const p=r(null),k=r(e),x=r(!1);function v(e){x.current&&(x.current=!1,i?.(e))}/* @__PURE__ */
|
|
10
|
+
return l("div",{className:["es-gold",a?"es-gold-is-multiline":"es-gold-is-single",h?"es-gold-is-off":"",d??""].filter(Boolean).join(" "),children:[
|
|
11
|
+
/* @__PURE__ */n(o,{value:e,rules:f,layerRef:p}),u&&""===e?
|
|
12
|
+
/* @__PURE__ */n("div",{className:"es-gold-placeholder","aria-hidden":"true",children:u}):null,
|
|
13
|
+
/* @__PURE__ */n("textarea",{ref:g,className:"es-gold-input",disabled:h,value:e,placeholder:u,"aria-label":m,onChange:function(e){x.current=!0,s(e.currentTarget.value)},onFocus:function(){k.current=e,x.current=!1},onBlur:function(){v(e)},onKeyDown:function(t){return"Escape"===t.key?(t.preventDefault(),x.current=!1,void c?.(k.current)):"Enter"!==t.key||a?void 0:(t.preventDefault(),void v(e))},onScroll:function(e){const t=p.current;t&&(t.scrollTop=e.currentTarget.scrollTop,t.scrollLeft=e.currentTarget.scrollLeft)}})]})}export{o as GoldLayer,c as GoldTextInput,s as goldSegments};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{find as t,remove as e,getList as n,newId as r,duplicate as o,move as a,copyNode as c,insert as l,setProps as d}from"./chunk-LPRQDDQO.js";import{useRef as s,useSyncExternalStore as i,useCallback as p,useMemo as u}from"react";var f=t=>({kind:"node",id:t});function m(r,o,a,c="none"){const l=t(r,o,a),d=e(r,o,a);if("none"===c||!l)return{data:d,select:null};const s=n(r,o,l.place)??[],i=s[l.place.index+1]??s[l.place.index-1];return i?.props?.id?{data:d,select:f(i.props.id)}:"root"!==l.place.parentId?{data:d,select:f(l.place.parentId)}:{data:d,select:null}}function x(e,n,a,c={}){const l=t(e,n,a)?.node,d=c.id??r(l?.type??"Node");return{data:o(e,n,a,{strip:c.strip,id:d}),select:f(d)}}function I(t,e,n,r){return{data:a(t,e,n,r),select:f(n)}}var v=(t,e)=>({min:0,max:e-1});function b(e,r,o,a,c=v){const l=t(e,r,o);if(!l)return!1;const d=n(e,r,l.place)?.length??0,{min:s,max:i}=c(l.place,d),p=l.place.index+a;return l.place.index>=s&&l.place.index<=i&&p>=s&&p<=i}function g(e,n,r,o,a=v){if(!b(e,n,r,o,a))return null;const c=t(e,n,r);return I(e,n,r,{...c.place,index:c.place.index+o})}function k(t,e,n,r,o={}){const a=c(n,e,{strip:o.strip});return{data:l(t,e,r,a),select:f(a.props.id)}}function y(t,e,n,r){return{data:d(t,e,n,r),select:void 0}}function O(e,n,r,o=()=>!1){if(!r)return null;if("slot"===r.kind)return t(e,n,r.parentId)?f(r.parentId):null;const a=t(e,n,r.id);if(!a||"root"===a.place.parentId)return null;const c=t(e,n,a.place.parentId);return c?o(c.node,a.place.slot)?{kind:"slot",parentId:c.node.props.id,slot:a.place.slot}:f(c.node.props.id):null}function h(e,n,r){if(!r||"node"!==r.kind)return null;const o=t(e,n,r.id);return o?{zone:`${o.place.parentId}:${o.place.slot}`,index:o.place.index}:null}function z(t,e,r){if(!r)return null;const[o,a]=(r.zone??"root:default-zone").split(/:(.*)/s),c={parentId:o,slot:a},l=n(t,e,c)?.[r.index];return l?.props?.id?f(l.props.id):null}var R={get:()=>null,set:()=>{},subscribe:()=>()=>{}};function B(e){const n=s(e);n.current=e;const r=e.clipboard??R,o=i(r.subscribe,r.get,r.get),a=p(t=>{const e=n.current;if(e.readOnly)return!1;const r=t(e.data,e.config);return!!r&&((r.data!==e.data||void 0!==r.select)&&(e.commit(r.data,{select:r.select}),n.current={...e,data:r.data},!0))},[]);return u(()=>{const e=()=>n.current,r=(n,r)=>{const o=t(e().data,e().config,n);return o?{node:o.node,label:r,from:{parentId:o.place.parentId,slot:o.place.slot}}:null};return{held:o,remove:t=>a((n,r)=>m(n,r,t,e().afterRemove)),duplicate:t=>a((n,r)=>x(n,r,t,{strip:e().strip})),move:(t,e)=>a((n,r)=>I(n,r,t,e)),step:(t,n)=>a((r,o)=>g(r,o,t,n,e().stepBounds)),canStep:(t,n)=>b(e().data,e().config,t,n,e().stepBounds),setProps:(t,e)=>a((n,r)=>y(n,r,t,e)),copy:(t,n)=>{const o=r(t,n);return o&&(e().clipboard??R).set(o),!!o},cut:(t,n)=>{if(e().readOnly)return!1;const o=r(t,n);return!!o&&((e().clipboard??R).set(o),a((n,r)=>m(n,r,t,e().afterRemove)))},paste:t=>{const n=(e().clipboard??R).get();return!!n&&a((r,o)=>k(r,o,n.node,t,{strip:e().strip}))},parentOf:t=>O(e().data,e().config,t,e().slotIsLevel)}},[o,a])}export{b as canStep,z as fromItemSelector,O as parentStep,x as planDuplicate,I as planMove,k as planPaste,m as planRemove,y as planSetProps,g as planStep,h as toItemSelector,B as useNodeOps};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={accent:"#2563eb",accentTint:"#eff6ff",accentTintStrong:"#dbeafe",accentLine:"#bfdbfe",accentText:"#1d4ed8",accentRing:"rgba(37, 99, 235, 0.25)",accentShadow:"rgba(37, 99, 235, 0.35)",onAccent:"#ffffff",appBg:"#f9fafb",previewBg:"#f3f4f6",panel:"#ffffff",raised:"#ffffff",topbarBg:"#ffffff",frameBg:"#ffffff",hover:"#f3f4f6",hatch:"rgba(0, 0, 0, 0.018)",addcardVeil:"rgba(248, 249, 250, 0.66)",fieldBg:"#ffffff",trackBg:"#f3f4f6",inputBorder:"#d1d5db",fieldText:"#1f2937",fieldPlaceholder:"#9ca3af",knob:"#ffffff",text:"#111827",textStrong:"#030712",textSecondary:"#374151",muted:"#6b7280",icon:"#6b7280",disabled:"#9ca3af",divider:"#e5e7eb",line:"#e5e7eb",btnBorder:"#d1d5db",btnText:"#374151",chipBg:"#f3f4f6",chipFg:"#6b7280",brandSquare:"#111827",deviceBorder:"#e5e7eb",toastBg:"#111827",toggleOff:"#d1d5db",scrollbar:"#d1d5db",scrollbarHover:"#9ca3af",danger:"#dc2626",dangerStrong:"#b91c1c",dangerTint:"#fef2f2",warning:"#b45309",previewTint:"#fef3c7",success:"#15803d",panelRadius:12,rowRadius:8,fieldRadius:6,panelGap:10,panelShadow:"0 1px 2px rgba(0, 0, 0, 0.05), 0 10px 30px rgba(0, 0, 0, 0.06)",topbarShadow:"0 1px 3px rgba(0, 0, 0, 0.06)",raisedShadow:"0 1px 2px rgba(16, 24, 40, 0.1)",font:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif'},a={accent:"--es-accent",accentTint:"--es-accent-tint",accentTintStrong:"--es-accent-tint-strong",accentLine:"--es-accent-line",accentText:"--es-accent-text",accentRing:"--es-accent-ring",accentShadow:"--es-accent-shadow",onAccent:"--es-on-accent",appBg:"--es-app-bg",previewBg:"--es-preview-bg",panel:"--es-panel",raised:"--es-raised",topbarBg:"--es-topbar-bg",frameBg:"--es-frame-bg",hover:"--es-hover",hatch:"--es-hatch",addcardVeil:"--es-addcard-veil",fieldBg:"--es-field-bg",trackBg:"--es-track-bg",inputBorder:"--es-input-border",fieldText:"--es-field-text",fieldPlaceholder:"--es-field-placeholder",knob:"--es-knob",text:"--es-text",textStrong:"--es-text-strong",textSecondary:"--es-text-secondary",muted:"--es-muted",icon:"--es-icon",disabled:"--es-disabled",divider:"--es-divider",line:"--es-line",btnBorder:"--es-btn-border",btnText:"--es-btn-text",chipBg:"--es-chip-bg",chipFg:"--es-chip-fg",brandSquare:"--es-brand-square",deviceBorder:"--es-device-border",toastBg:"--es-toast-bg",toggleOff:"--es-toggle-off",scrollbar:"--es-scrollbar",scrollbarHover:"--es-scrollbar-hover",danger:"--es-danger",dangerStrong:"--es-danger-strong",dangerTint:"--es-danger-tint",warning:"--es-warning",previewTint:"--es-preview-tint",success:"--es-success",panelRadius:"--es-panel-radius",rowRadius:"--es-row-radius",fieldRadius:"--es-field-radius",panelGap:"--es-panel-gap",panelShadow:"--es-panel-shadow",topbarShadow:"--es-topbar-shadow",raisedShadow:"--es-raised-shadow",font:"--es-font"};export{a as shellCssVars,e as shellTokens};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{changedProps as e}from"./chunk-LPRQDDQO.js";import{useState as t,useRef as r,useEffect as n}from"react";function i({id:i,node:l,block:d,parent:o=null,appState:a=null}){const u=d?.fields??{},[s,c]=t(()=>({id:i,fields:u,loading:!1})),p=r(null),f=r(null),g=r({parent:o,appState:a,id:i});return g.current={parent:o,appState:a,id:i},n(()=>{if(!l||!d)return;const t=f.current!==i;f.current=i;let r=s.fields;t&&(r=u,p.current=null,c({id:i,fields:u,loading:!1}));const n=d.resolveFields;if(!n)return void(t||c(e=>({...e,fields:u})));let o=!1;const a=p.current&&(p.current.props?.id??"root")===(l.props?.id??"root")?p.current:null,m=setTimeout(()=>{o||c(e=>e.id===i?{...e,loading:!0}:e)},50);return Promise.resolve(n(l,{changed:e(l,a),fields:u,lastFields:r,lastData:a,appState:g.current.appState,parent:g.current.parent})).then(e=>{clearTimeout(m),o||g.current.id!==i||(p.current=l,c({id:i,fields:e,loading:!1}))}),()=>{o=!0,clearTimeout(m)}},[i,l,d]),s.id===i?{fields:s.fields,loading:s.loading}:{fields:u,loading:!1}}export{i as useResolvedFields};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a={frame:"Canvas"};export{a as DEFAULT_CANVAS_WORDS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a={dragHint:"Drag to move · ⌥↑ ⌥↓",collapse:"Collapse",expand:"Expand",collapseNamed:({label:a})=>`Collapse ${a}`,expandNamed:({label:a})=>`Expand ${a}`};export{a as DEFAULT_TREE_WORDS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={stopped:"Auto-save stopped · not saved",pausedUnsaved:"Auto-save off · unsaved",paused:"Auto-save off",failed:"Save failed",unsaved:"Unsaved changes"};function a(a,d=e){return a.stopped?{tone:"off-unsaved",label:d.stopped}:a.paused?a.pending?{tone:"off-unsaved",label:d.pausedUnsaved}:{tone:"off",label:d.paused}:a.failed?{tone:"error",label:d.failed}:a.unsaved?{tone:"saving",label:d.unsaved}:{tone:a.saved?"saved":"idle",label:""}}export{e as DEFAULT_SAVE_WORDS,a as saveIndicator};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={reload:"Reload the saved version",takeOver:"Take over editing",takeBack:"Take it back",viewReadOnly:"View read-only",savedByYou:({noun:e,when:n})=>`You saved this ${e} in another tab or window ${n}.`,savedByOther:({name:e,noun:n,when:o})=>`${e} saved this ${n} ${o}.`,conflictBody:"Your last change was not saved. It is still on screen here, but this copy is out of date — copy anything you need, then reload to carry on from the saved version.",takeOverWhileDeciding:"Nobody else can save while you decide. Nothing on your screen is lost.",tookOver:({name:e,noun:n,when:o})=>`${e} took over this ${n} ${o}.`,tookOverBody:"Your changes since then are still on screen but are no longer being saved.",viewingOnly:"Viewing only.",viewingOnlyBody:({name:e,noun:n,seen:o})=>`${e} is editing this ${n} (last seen ${o}). Nothing you change here is saved.`,editing:({name:e,noun:n})=>`${e} is editing this ${n}`,editingBody:({seen:e})=>`(last seen ${e}). Nothing you change here will be saved while they are in it.`,takeOverTold:"They are told straight away and stop being able to save."},n={device:"Preview device",upLevel:"Go up one level",upLevelTo:({label:e,name:n})=>`${e} to ${n}`,resize:"Drag to resize · double-click to reset"};export{n as DEFAULT_CHROME_WORDS,e as DEFAULT_NOTICE_WORDS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isRecord as n,fieldsFrom as t,blockOf as o,topLevelSlotKeys as e,slotLocations as r,setIn as s,fieldsOf as c,defaultsFrom as i,isNode as p}from"./chunk-NKB3KVAB.js";var f=()=>({lastChange:{}});function l(n,t){if(n===t)return!0;if(!n||!t||"object"!=typeof n||"object"!=typeof t)return n!=n&&t!=t;if(Array.isArray(n)!==Array.isArray(t))return!1;if(Array.isArray(n)){const o=t;if(n.length!==o.length)return!1;for(let t=0;t<n.length;t++)if(!l(n[t],o[t]))return!1;return!0}const o=Object.keys(n),e=Object.keys(t);if(o.length!==e.length)return!1;for(const e of o){if(!Object.prototype.hasOwnProperty.call(t,e))return!1;if(!l(n[e],t[e]))return!1}return!0}function a(n,t){if(!n)return{};const o=n.props??{},e=t?.props??{},r={};for(const n of Object.keys(o))r[n]=!l(e[n],o[n]);return r}async function d(c,i,p={}){const{metadata:u={},trigger:y="replace",cache:h=f(),onResolveStart:g,onResolveEnd:w}=p,m=function(n,t){return n.type&&"root"!==n.type?t.components[n.type]:t.root}(c,i);let $={...c};const x=Boolean(m?.resolveData&&c.props),I=n(c.props)&&"id"in c.props?String(c.props.id):"root";if(x){const n=h.lastChange[I];if("force"!==y&&n&&l(c,n.item))return{node:n.resolved,didChange:!1};const t=a(c,n?.item??null);g?.(c);const o=await m.resolveData(c,{changed:t,lastData:n?.item??null,metadata:{...u,...m.metadata??{}},trigger:y})??{};$.props={...c.props,...o.props??{}},o.readOnly&&Object.keys(o.readOnly).length&&($.readOnly=o.readOnly)}const b=t(c.type&&"root"!==c.type?o(i,c.type):i.root);if(m)for(const n of e(b))void 0===$.props[n]&&($={...$,props:{...$.props,[n]:[]}});for(const n of r($.props,b)){if(!n.present)continue;const t=await Promise.all(n.content.map(async n=>(await d(n,i,{metadata:u,trigger:y,cache:h,onResolveStart:g,onResolveEnd:w})).node));$={...$,props:s($.props,n.segments,t)}}return x&&w?.($),h.lastChange[I]={item:c,resolved:$},{node:$,didChange:!l(c,$)}}var u="root",y="default-zone",h={parentId:u,slot:y},g=({parentId:n,slot:t})=>`${n}:${t}`;function w(n){const t=n.indexOf(":");if(-1===t)throw new $("no-slot",`"${n}" is not a zone key`);return{parentId:n.slice(0,t),slot:n.slice(t+1)}}var m=n=>n.parentId===u&&n.slot===y,$=class extends Error{code;constructor(n,t){super(t),this.name="DataError",this.code=n}};function x(n){try{const t=globalThis.crypto;if(t&&"function"==typeof t.randomUUID)return`${n}-${t.randomUUID()}`}catch{}return`${n}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function I(n,t){return r(n.props,c(t,n.type)).map(({slot:n,content:t})=>({slot:n,content:t}))}function b(n,o){return r(z(n),t(o.root))}function z(t){return n(t.root?.props)?t.root.props:{}}function O(n,t,o){const e=(n,t,e,r,s)=>{if(!Array.isArray(n))return n;const c=[...e,t];let f=null;return n.forEach((e,l)=>{if(!p(e))return;const a={place:{...t,index:l},path:c,parent:r,depth:s};let d=o(e,a)??e;if(d!==e&&d.props.id!==e.props.id)throw new $("id-change",`walk: ${e.props.id} came back as ${d.props.id}`);d=i(d,c,s+1),d!==e&&(f??=[...n],f[l]=d)}),f??n},i=(n,o,i)=>{let p=n.props;for(const f of r(n.props,c(t,n.type))){if(!f.present)continue;const t=e(f.content,{parentId:n.props.id,slot:f.slot},o,n,i);t!==f.content&&(p=s(p,f.segments,t))}return p===n.props?n:{...n,props:p}};let f=n;const l=e(n.content,h,[],null,0);l!==n.content&&(f={...f,content:l});let a=z(f);for(const n of b(f,t)){if(!n.present)continue;const t=e(n.content,{parentId:u,slot:n.slot},[],null,0);t!==n.content&&(a=s(a,n.segments,t))}a!==z(f)&&(f={...f,root:{...f.root,props:a}});const d=f.zones;if(d){let n=d;for(const t of Object.keys(d)){const o=k(t);if(!o)continue;const r=e(d[t],o,[],null,0);r!==d[t]&&(n={...n,[t]:r})}n!==d&&(f={...f,zones:n})}return f}function k(n){const t=n.indexOf(":");return-1===t?null:{parentId:n.slice(0,t),slot:n.slice(t+1)}}function A(n,t,o){let e=null;const r={};try{O(n,t,(n,t)=>{if(n.props.id===o)throw e={node:n,place:t.place,path:t.path},r})}catch(n){if(n!==r)throw n}return e}function j(n,t,o){if(m(o))return Array.isArray(n.content)?n.content:[];const e=n.zones?.[g(o)];if(o.parentId===u){const r=b(n,t).find(n=>n.slot===o.slot);return r?r.content:e??null}const s=A(n,t,o.parentId);if(s){const n=r(s.node.props,c(t,s.node.type)).find(n=>n.slot===o.slot);if(n)return n.content}return e??null}function v(n,t){const o=/* @__PURE__ */new Set;return O(n,t,n=>{o.add(n.props.id)}),o}function S(n,t){const o=/* @__PURE__ */new Set([n.props.id]),e=n=>{for(const{content:r}of I(n,t))for(const n of r)p(n)&&(o.add(n.props.id),e(n))};return e(n),o}function D(n,t,o,e){if(m(o)){const t=Array.isArray(n.content)?n.content:[];return{...n,content:e(t)}}const i=g(o),p=!!n.zones&&Array.isArray(n.zones[i]);if(o.parentId===u){const r=b(n,t).find(n=>n.slot===o.slot);if(r){const t=s(z(n),r.segments,e(r.content));return{...n,root:{...n.root,props:t}}}}else{const i=A(n,t,o.parentId);if(i){const p=r(i.node.props,c(t,i.node.type)).find(n=>n.slot===o.slot);if(p)return N(n,t,i,n=>({...n,props:s(n.props,p.segments,e(p.content))}))}else if(!p)throw new $("not-found",`no node ${o.parentId}`)}if(p)return{...n,zones:{...n.zones,[i]:e(n.zones[i])}};throw new $("no-slot",`no slot "${o.slot}" on ${o.parentId}`)}function N(n,t,o,e){return D(n,t,o.place,n=>{const t=[...n];return t[o.place.index]=e(n[o.place.index]),t})}function E(n,t,o){const e=A(n,t,o);if(!e)throw new $("not-found",`no node ${o}`);return e}function C(n,t,o){const e=j(n,t,o);if(e)return e;if(o.parentId!==u&&!A(n,t,o.parentId))throw new $("not-found",`no node ${o.parentId}`);throw new $("no-slot",`no slot "${o.slot}" on ${o.parentId}`)}function R(n,t,o){if(!Number.isInteger(n)||n<0||n>t)throw new $("bad-index",`${o}: index ${n} is outside 0…${t}`)}function U(n,c){const i=o(c,n.type);if(!i)return n;const p=t(i);let f=n.props;for(const n of e(p))null==f[n]&&(f={...f,[n]:[]});for(const n of r(f,p)){if(!n.present)continue;const t=B(n.content,c);t!==n.content&&(f=s(f,n.segments,t))}return f===n.props?n:{...n,props:f}}function B(t,o){let e=null;return t.forEach((r,s)=>{if(!n(r)||"string"!=typeof r.type)return;let c=r;if(n(c.props)){if("string"!=typeof c.props.id||""===c.props.id){const{id:n,...t}=c.props;c={...c,props:{id:x(c.type),...t}}}}else c={...c,props:{id:x(c.type)}};const i=U(c,o);i!==r&&(e??=[...t],e[s]=i)}),e??t}function P(n,o){const c=t(o.root);let i=n.props;for(const n of e(c))null==i[n]&&(i={...i,[n]:[]});for(const n of r(i,c)){if(!n.present)continue;const t=B(n.content,o);t!==n.content&&(i=s(i,n.segments,t))}return i===n.props?n:{...n,props:i}}function J(t,o){let e=n(t)?t:{};const r=e.root;if(n(r)){if(!n(r.props)){const n=Object.keys(r).filter(n=>"props"!==n);e={...e,root:n.length?{props:{...M(r,n)}}:{props:{}}}}}else e={...e,root:{props:{}}};const s=i(o.root);if(s){const n=Object.keys(s).filter(n=>!(n in e.root.props));if(n.length){const t=T(M(s,n));e={...e,root:{...e.root,props:{...e.root.props,...t}}}}}const c=P(e.root,o);c!==e.root&&(e={...e,root:c}),Array.isArray(e.content)||(e={...e,content:[]});const p=B(e.content,o);return p!==e.content&&(e={...e,content:p}),e=n(e.zones)?function(n,t){let o=n;for(const e of Object.keys(n.zones??{})){const n=o.zones[e];if(!Array.isArray(n)||0===n.length)continue;const r=k(e);if(!r||m(r))continue;const s=K(o,t,r);if(!s||s.content.length>0)continue;const{[e]:c,...i}=o.zones;o=D({...o,zones:i},t,r,()=>B(n,t))}const e=o.zones;let r=e;for(const n of Object.keys(e)){if(!Array.isArray(e[n]))continue;const o=B(e[n],t);o!==e[n]&&(r={...r,[n]:o})}return r===e?o:{...o,zones:r}}(e,o):{...e,zones:{}},e}function K(n,t,o){if(o.parentId===u)return b(n,t).find(n=>n.slot===o.slot);const e=A(n,t,o.parentId);return e?r(e.node.props,c(t,e.node.type)).find(n=>n.slot===o.slot):void 0}function M(n,t){const o={};for(const e of t)o[e]=n[e];return o}function T(n){return void 0===n?n:JSON.parse(JSON.stringify(n))}function V(n,t,o={},e={}){const r=n.components[t];if(!r)throw new $("unknown-type",`no block type "${t}" in the config`);return U({type:t,props:{...T(i(r)??{}),...T(o),id:e.id??x(t)}},n)}function q(t,o,e,r){if(!p(r))throw new $("unknown-type","insert: not a node");const s=C(t,o,e);R(e.index,s.length,"insert");const c=U(n(r.props)&&"string"==typeof r.props.id&&r.props.id?r:{...r,props:{...r.props,id:x(r.type)}},o),i=v(t,o);for(const n of S(c,o))if(i.has(n))throw new $("duplicate-id",`insert: ${n} is already in the document`);return D(t,o,e,n=>[...n.slice(0,e.index),c,...n.slice(e.index)])}function F(n,t,o){const e=E(n,t,o);let r=D(n,t,e.place,n=>[...n.slice(0,e.place.index),...n.slice(e.place.index+1)]);if(r.zones&&Object.keys(r.zones).length){const n=S(e.node,t),o=Object.keys(r.zones).filter(t=>!n.has(t.split(":")[0]));o.length!==Object.keys(r.zones).length&&(r={...r,zones:M(r.zones,o)})}return r}function G(n,t,o,e){const r=E(n,t,o);if(S(r.node,t).has(e.parentId))throw new $("cycle",`move: ${o} cannot go inside itself`);if(r.place.parentId===e.parentId&&r.place.slot===e.slot){const o=C(n,t,e);return R(e.index,o.length-1,"move"),e.index===r.place.index?n:D(n,t,e,n=>{const t=[...n],[o]=t.splice(r.place.index,1);return t.splice(e.index,0,o),t})}R(e.index,C(n,t,e).length,"move");const s=D(n,t,r.place,n=>[...n.slice(0,r.place.index),...n.slice(r.place.index+1)]);return D(s,t,e,n=>[...n.slice(0,e.index),r.node,...n.slice(e.index)])}function H(n,t,o,e={}){const r=E(n,t,o),s=Q(T(r.node),t,e.strip,e.id);return D(n,t,r.place,n=>[...n.slice(0,r.place.index+1),s,...n.slice(r.place.index+1)])}function L(n,t,o={}){return Q(T(n),t,o.strip,o.id)}function Q(n,t,o,e){let i={...n,props:{...n.props,id:e??x(n.type)}};if(o){const n=o(i);if(n.props.id!==i.props.id)throw new $("id-change","duplicate: strip must not change the id");i=n}let f=i.props;for(const n of r(f,c(t,i.type))){if(!n.present)continue;const e=n.content.map(n=>p(n)?Q(n,t,o):n);f=s(f,n.segments,e)}return U({...i,props:f},t)}function W(n,t,o,e){if("id"in e&&e.id!==o)throw new $("id-change",`setProps: ${o} cannot become ${String(e.id)}`);const r=E(n,t,o);return Z(r.node.props,e)?N(n,t,r,n=>U({...n,props:{...n.props,...e,id:o}},t)):n}function X(n,t,o,e){if(!p(e))throw new $("unknown-type","replaceNode: not a node");if(e.props.id!==o)throw new $("id-change",`replaceNode: ${o} cannot become ${String(e.props.id)}`);const r=E(n,t,o),s=U(e,t),c=v(n,t);for(const n of S(r.node,t))c.delete(n);for(const n of S(s,t))if(c.has(n))throw new $("duplicate-id",`replaceNode: ${n} is already in the document`);return N(n,t,r,()=>s)}function Y(n,t,o){const e=z(n);if(!Z(e,o))return n;const r=P({...n.root,props:{...e,...o}},t);return{...n,root:r}}function Z(n,t){return Object.keys(t).some(o=>!(o in n)||!Object.is(n[o],t[o]))}export{$ as DataError,u as ROOT_ID,h as ROOT_LIST,y as ROOT_SLOT,a as changedProps,L as copyNode,V as createNode,f as createResolveCache,l as deepEqual,H as duplicate,A as find,j as getList,q as insert,G as move,x as newId,J as normalizeData,w as parseZoneKey,F as remove,X as replaceNode,d as resolveNodeData,W as setProps,Y as setRoot,I as slotsOf,O as walk,g as zoneKey};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{removeCanvasStyle as e,upsertCanvasStyle as n}from"./chunk-ZNCEOSXO.js";import{useState as t,useEffect as o,useRef as r}from"react";var c="[data-puck-component]",u="iframe#preview-frame";function s(e){const n=e.contentDocument;if(!n||!e.contentWindow||"loading"===n.readyState||!n.body)return!1;if(e.hasAttribute("srcdoc"))return"about:srcdoc"===n.URL;const t=e.getAttribute("src");return!t||"about:blank"===t||"about:blank"!==n.URL}function i(e,n,{selector:t=u,readySelector:o}={}){let r=null,c=null,i=!1,l=!1,d=null;const a=()=>{d?.observer.disconnect(),d=null},m=()=>{if(l)return;let e=null;if(r&&s(r)){const n=r.contentDocument;(e=>{if(!o||e.querySelector(o))return a(),!0;if(d?.doc!==e){a();const n=e.defaultView?.MutationObserver;if(n){const t=new n(()=>m());t.observe(e,{childList:!0,subtree:!0}),d={doc:e,observer:t}}}return!1})(n)&&(e={frame:r,document:n,window:r.contentWindow})}else a();(e===c||!!e&&!!c&&e.frame===c.frame&&e.document===c.document)&&i||(i=!0,c=e,n(c))},f=()=>m(),v=()=>{const n=e.querySelector?.(t);n!==r?(r?.removeEventListener("load",f),r=n,r?.addEventListener("load",f),m()):m()},b=e.ownerDocument?.defaultView??e.defaultView,w=b?.MutationObserver,E=w?new w(e=>(e=>null!==r&&!r.isConnected||e.some(e=>[...e.addedNodes,...e.removedNodes].some(e=>"IFRAME"===e.nodeName||!!e.querySelector?.("iframe"))))(e)&&v()):null;return E?.observe(e,{childList:!0,subtree:!0}),v(),()=>{l=!0,E?.disconnect(),a(),r?.removeEventListener("load",f),r=null}}function l(e,{selector:n,readySelector:r}={}){const[c,u]=t(null);return o(()=>{const t=e.current;if(!t)return;const o=i(t,u,{selector:n,readySelector:r});return()=>{o(),u(null)}},[e,n,r]),c}function d(e,n,t,{on:c="document",capture:u=!1}={}){const s=r(t);s.current=t;const i=e?.document??null,l=e?.window??null;o(()=>{const e="window"===c?l:i;if(!e)return;const t=e=>s.current(e);return e.addEventListener(n,t,u),()=>e.removeEventListener(n,t,u)},[i,l,n,c,u])}function a(t,r,c){const u=t?.document??null;o(()=>{if(!u)return;if(!c)return void e(u,r);const t=n(u,r,c),o=u.defaultView?.MutationObserver,s=o?new o(()=>{t.isConnected||n(u,r,c)}):null;return s?.observe(u.head??u.documentElement,{childList:!0}),()=>{s?.disconnect(),e(u,r)}},[u,r,c])}function m(e,{settle:n=[150,450]}={}){const[r,c]=t(0),u=e?.frame??null,s=e?.document??null,i=e?.window??null,l=n.join(",");return o(()=>{if(!u||!s||!i)return;const e=u.ownerDocument.defaultView;let t=!1,o=0;const r=()=>{if(t)return;t=!0;const n=()=>{t=!1,c(e=>e+1)};e?.requestAnimationFrame?o=e.requestAnimationFrame(n):n()},l=[],d=(e,n)=>{e.addEventListener(n,r,!0),l.push(()=>e.removeEventListener(n,r,!0))};d(s,"scroll"),d(i,"resize"),e&&(d(e,"scroll"),d(e,"resize"));const a=e?.ResizeObserver;if(a){const e=new a(r);e.observe(u),s.documentElement&&e.observe(s.documentElement),l.push(()=>e.disconnect())}const m=s.defaultView?.MutationObserver,f=s.body??s.documentElement;if(m&&f){const e=new m(r);e.observe(s===u.ownerDocument?u:f,{childList:!0,subtree:!0}),l.push(()=>e.disconnect())}const v=s.fonts;v&&d(v,"loadingdone");const b=n.map(e=>setTimeout(r,e));return r(),()=>{for(const e of l)e();for(const e of b)clearTimeout(e);o&&e?.cancelAnimationFrame&&e.cancelAnimationFrame(o)}},[u,s,i,l]),r}export{c as BLOCK_SELECTOR,u as CANVAS_SELECTOR,s as isFrameReady,d as useCanvasEvent,l as useCanvasFrame,m as useCanvasLayout,a as useCanvasStyle,i as watchCanvasFrame};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext as r,useContext as n}from"react";var t;function o(){return t??=r(null)}function u(r,t){const u=n(o());return u?u.strings[r]:t}export{o as stringsContext,u as useWords};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=t=>!!t&&"object"==typeof t&&!Array.isArray(t),r=r=>t(r)&&"string"==typeof r.type&&t(r.props);function n(t){let r="";for(const n of t)r+="number"==typeof n?`[${n}]`:""===r?n:`.${n}`;return r}function e(t,r){return"root"===r?t.root:t.components[r]}function o(t){return t?.fields??{}}function s(t){return t?.defaultProps}function c(t,r){return o(e(t,r))}function f(t){return Object.keys(t).filter(r=>"slot"===t[r]?.type)}function i(t,r){const n=[];return u(t,r,[],n),n}function u(r,e,o,s){for(const c of Object.keys(e)){const f=e[c];if(!f)continue;const i=[...o,c],y=r[c];if("slot"===f.type){const t=Array.isArray(y);s.push({slot:n(i),segments:i,content:t?y:[],present:t})}else if("object"===f.type&&f.objectFields&&t(y))u(y,f.objectFields,i,s);else if("array"===f.type&&f.arrayFields&&Array.isArray(y)){const r=f.arrayFields;y.forEach((n,e)=>{t(n)&&u(n,r,[...i,e],s)})}}}function y(t,r){let n=t;for(const t of r){if(null==n||"object"!=typeof n)return;n=n[t]}return n}function a(r,n,e){if(0===n.length)return e;const[o,...s]=n;if("number"==typeof o){const t=Array.isArray(r)?[...r]:[];return t[o]=a(t[o],s,e),t}const c=t(r)?r:{};return{...c,[o]:a(c[o],s,e)}}export{e as blockOf,s as defaultsFrom,o as fieldsFrom,c as fieldsOf,y as getIn,r as isNode,t as isRecord,a as setIn,i as slotLocations,f as topLevelSlotKeys};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={add:{stop:"Stop adding here",hint:"Drag onto the page, or click to add.",search:"Search blocks",searchPlaceholder:({label:e})=>`${e}…`,clearSearch:"Clear search",nothing:({query:e})=>`Nothing matches “${e}”`,tryAnother:"Try another word.",tile:({label:e})=>`Add ${e}`},canvas:{addSection:"Add section",addBlock:"Add block",addButton:({label:e})=>`+ ${e}`,handle:({label:e})=>`Drag to move this ${e.toLowerCase()}`}};export{e as DEFAULT_DRAG_WORDS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DEFAULT_PICK_WORDS as o}from"./chunk-ZAOM6PFH.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as r}from"./chunk-6WY6ZXJG.js";import{DEFAULT_CANVAS_WORDS as t}from"./chunk-GGTPNGFJ.js";import{DEFAULT_FIELDS_WORDS as m}from"./chunk-SUO5627P.js";import{DEFAULT_TREE_WORDS as n}from"./chunk-H4B72XCJ.js";import{DEFAULT_PANEL_WORDS as c}from"./chunk-7A7O2JWQ.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 s,DEFAULT_NOTICE_WORDS as i}from"./chunk-KDIVA6WD.js";import{DEFAULT_LOCK_WORDS as u}from"./chunk-RE4LP46F.js";import{DEFAULT_RAIL_WORDS as e}from"./chunk-2OAZYSWJ.js";import{DEFAULT_COPY_WORDS as k}from"./chunk-2LUSK32B.js";import{DEFAULT_DRAG_WORDS as j}from"./chunk-O2NLQBFX.js";var h={notice:i,lock:u,save:p,chrome:s,rail:e,tree:n,panel:c,fields:m,pick:o,drag:j,menu:f,styleClipboard:r,copy:k,canvas:t},l=o=>"object"==typeof o&&null!==o;function a(o,r){const t={};for(const m of Object.keys(o)){const n=o[m],c=r[m];null==c?t[m]=n:l(n)?t[m]=l(c)?a(n,c):n:t[m]=typeof c==typeof n?c:n}return t}function y(o,r){return r?a(o,r):o}export{h as DEFAULT_EDITOR_STRINGS,y as mergeEditorStrings};
|
|
File without changes
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{wordFitVars as e}from"./chunk-BZ5ASXOL.js";import{jsx as a,jsxs as s}from"react/jsx-runtime";function i({options:i,value:l,onChange:n,ariaLabel:t,fit:r,disabled:d=!1,className:o}){const c=r&&e(i.length,r);
|
|
2
|
+
/* @__PURE__ */
|
|
3
|
+
return a("div",{className:"es-segs-fit",children:/* @__PURE__ */a("div",{role:"group","aria-label":t,"data-disabled":d||void 0,className:`es-segs${c?" is-measured":""}${o?` ${o}`:""}`,style:c,children:i.map(e=>{const i=e.id===l,t=e.title??("string"==typeof e.label?e.label:void 0),r=d||!0===e.disabled,o=`es-seg${e.icon?" has-icon":""}${i?" is-active":""}`;/* @__PURE__ */
|
|
4
|
+
return s("button",{type:"button",title:t,"aria-label":t,"aria-pressed":i,disabled:r,className:o,onClick:()=>n(e.id),children:[e.icon?/* @__PURE__ */a("span",{className:"es-seg-icon","aria-hidden":"true",children:e.icon}):null,
|
|
5
|
+
/* @__PURE__ */a("span",{className:"es-seg-word",children:e.label})]},String(e.id))})})})}export{i as SettingsSegmented};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o={justNow:"just now",minutesAgo:({count:o})=>`${o} minute${1===o?"":"s"} ago`,hoursAgo:({count:o})=>`${o} hour${1===o?"":"s"} ago`,someone:"Someone else"};export{o as DEFAULT_LOCK_WORDS};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{DEFAULT_TREE_WORDS as e}from"./chunk-H4B72XCJ.js";import{ChevronIcon as a}from"./chunk-YNZZYHA4.js";import{jsx as r,jsxs as l,Fragment as n}from"react/jsx-runtime";function s({className:e,children:a,rootProps:l}){/* @__PURE__ */
|
|
2
|
+
return r("div",{...l,className:e?`es-tree ${e}`:"es-tree",children:a})}function t({children:e}){/* @__PURE__ */
|
|
3
|
+
return r("div",{className:"es-tree-group",children:e})}function i({children:e}){/* @__PURE__ */
|
|
4
|
+
return r("div",{className:"es-subtree",children:e})}var d=e.dragHint;function c({icon:s,name:t,preview:i,selected:d,hidden:c,draggable:o,dragHint:p,dragging:h,drop:m,fold:u,handle:b,actions:N,nameSlot:g,onSelect:k,marks:f,badge:v,trailing:y,children:w,rowProps:x,words:A=e}){const C=["es-tree-row",d?"is-selected":"",c?"is-hidden":"",o?"is-draggable":"",h?"is-dragging":"",m?`is-drop-${m}`:""].filter(Boolean).join(" "),j=/* @__PURE__ */l(n,{children:[
|
|
5
|
+
/* @__PURE__ */l("span",{className:"es-tree-name",children:[t,i?/* @__PURE__ */r("span",{className:"es-tree-preview",children:i}):null]}),f?.map(e=>/* @__PURE__ */r("span",{className:"es-tree-mark",title:e.label,"aria-label":e.label,role:"img",children:e.icon},e.key)),null!=v&&!1!==v?/* @__PURE__ */r("span",{className:"es-tree-badge",children:v}):null]});/* @__PURE__ */
|
|
6
|
+
return l("div",{...x,className:C,children:[o?
|
|
7
|
+
/* @__PURE__ */l(n,{children:[
|
|
8
|
+
/* @__PURE__ */r("span",{className:"es-tree-grip","aria-hidden":"true",children:"⋮"}),
|
|
9
|
+
/* @__PURE__ */r("span",{className:"es-tree-hint","aria-hidden":"true",children:p??A.dragHint})]}):b?/* @__PURE__ */r("button",{type:"button",className:"es-tree-handle",...b,children:"⋮⋮"}):null,u?/* @__PURE__ */r("button",{type:"button",className:"es-tree-caret","aria-label":u.open?A.collapseNamed({label:u.label}):A.expandNamed({label:u.label}),"aria-expanded":u.open,title:u.open?A.collapse:A.expand,onClick:e=>{e.stopPropagation(),u.onToggle()},children:/* @__PURE__ */r(a,{size:11,strokeWidth:2.6,className:u.open?"es-tree-chev is-open":"es-tree-chev"})}):/* @__PURE__ */r("span",{className:"es-tree-caret-spacer","aria-hidden":"true"}),
|
|
10
|
+
/* @__PURE__ */r("span",{className:"es-tree-chip","aria-hidden":"true",children:s}),
|
|
11
|
+
/* @__PURE__ */l("span",{className:"es-tree-name-box",children:[g??(k?
|
|
12
|
+
/* @__PURE__ */r("button",{type:"button",className:"es-tree-select","aria-current":d?"true":void 0,"aria-keyshortcuts":o?"Alt+ArrowUp Alt+ArrowDown":void 0,onClick:k,children:j}):j),N?/* @__PURE__ */r("span",{className:"es-tree-actions",children:N}):null]}),y?/* @__PURE__ */r("span",{className:"es-tree-trailing",title:y.label,"aria-label":y.label,role:"img",children:y.icon}):null,w]})}function o({kind:e,label:a,onClick:l,pressed:n,disabled:s,children:t}){/* @__PURE__ */
|
|
13
|
+
return r("button",{type:"button",className:"delete"===e?"es-tree-del":"eye"===e?"es-tree-eye":"es-tree-act",title:a,"aria-label":a,"aria-pressed":n,disabled:s,onClick:e=>{e.stopPropagation(),l()},children:t})}function p({drop:e,onAdd:a,label:l,seamProps:n}){const s=["es-tree-seam",e?"is-drop":"",a?"has-add":""].filter(Boolean).join(" ");/* @__PURE__ */
|
|
14
|
+
return r("div",{...n,className:s,children:a?/* @__PURE__ */r("button",{type:"button",className:"es-tree-seam-add","aria-label":l,title:l,onClick:a,children:"+"}):null})}export{s as LayersTree,i as Subtree,d as TREE_DRAG_HINT,t as TreeGroupLabel,c as TreeRow,o as TreeRowAction,p as TreeSeam};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={less:"Less",more:"More",choose:"Choose…",list:{item:"item",itemName:({noun:e,n:t})=>{return`${o=e,o?o[0].toUpperCase()+o.slice(1):o} ${t}`;var o},position:({n:e,total:t})=>`${e} of ${t}`,duplicate:"Duplicate",duplicateItem:({noun:e})=>`Duplicate ${e}`,deleteItem:({noun:e})=>`Delete ${e}`,add:({noun:e})=>`+ Add ${e}`,addHere:({noun:e})=>`Add ${e} here`}};export{e as DEFAULT_FIELDS_WORDS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DEFAULT_LOCK_WORDS as e}from"./chunk-RE4LP46F.js";var n=e=>"editing"===e.kind;function t(e){return e?{kind:"checking"}:{kind:"editing"}}var r=e=>"blocked"===e.kind||"readonly"===e.kind||"takenover"===e.kind?e.holder:null;function o(e){if(!e||"object"!=typeof e)return null;const n=e;return"string"!=typeof n.holder_name?null:{name:n.holder_name,secondsSinceSeen:"number"==typeof n.seconds_since_seen?n.seconds_since_seen:0,secondsSinceHeld:"number"==typeof n.seconds_since_held?n.seconds_since_held:0}}var a=e=>e?{edit:!0,insert:!0,delete:!0,duplicate:!0,drag:!1}:{edit:!1,insert:!1,delete:!1,duplicate:!1,drag:!1};function s(n,t=e){if(!Number.isFinite(n)||n<45)return t.justNow;const r=Math.round(n/60);if(r<60)return t.minutesAgo({count:r});const o=Math.round(r/60);return t.hoursAgo({count:o})}var c=(n,t=e)=>n.trim()||t.someone;function d(){return`tab-${"undefined"!=typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():Math.random().toString(36).slice(2)}`.slice(0,64)}var i="edit_lock_taken";function u(e,t,r){return!(n(e)||!n(t))&&(r.pending&&r.autoSaveEnabled&&!r.saveConflict)}function l(e,t,o){return!(null===r(e)||!n(t))&&(!o.pending&&!o.saveConflict)}function f(e,n){return e!==n&&Date.parse(e)>=Date.parse(n)}async function k(e){if(!e.ours)return!1;const n=await e.stored().catch(()=>null);return!(!n||!f(n,e.ours)||e.hasPending())&&(e.reload(),!0)}function h(e){const{readFailure:n,conflictCode:t}=e,r=e=>{const t=n(e);return t&&409===t.status?o(t.data):null},a=e=>{const n=r(e);return n?{kind:"blocked",holder:n}:{kind:"editing"}},s=(e,n)=>{const t=r(e);return t?{kind:"blocked",holder:t}:n},c=(e,n)=>{const t=r(e);return t?{kind:"takenover",holder:t}:n},d=e=>{const t=n(e);return null!==t&&(401===t.status||403===t.status)};return{accessAfterClaimFailure:a,accessAfterTakeoverFailure:s,accessAfterHeartbeatFailure:c,isAuthRejection:d,readSaveConflict:e=>{const r=n(e);if(!r||409!==r.status)return null;if(!r.data||"object"!=typeof r.data)return null;const o=r.data;return o.code!==t?null:{savedBy:"string"==typeof o.saved_by?o.saved_by:"",savedByYou:!0===o.saved_by_you,secondsAgo:"number"==typeof o.seconds_ago?o.seconds_ago:0}},readLockTaken:e=>{const t=n(e);return t&&409===t.status&&t.data&&"object"==typeof t.data?t.data.code!==i?null:o(t.data)??{name:"",secondsSinceSeen:0,secondsSinceHeld:0}:null},makeClaimBeat:e=>{let n=!1;return async t=>{let r,o;try{const a=await e.claim(t);if(e.cancelled())return;r=e.currentAccess(),o={kind:"editing"},!n&&a.heartbeat_seconds>0&&(n=!0,e.startHeartbeat(1e3*a.heartbeat_seconds))}catch(n){if(e.cancelled())return;r=e.currentAccess(),o=t?s(n,r):"checking"===r.kind?a(n):c(n,r),d(n)&&e.stopHeartbeat()}e.setAccess(o);const i=e.heldWrite();u(r,o,i)?e.releaseHeldWrite():t&&l(r,o,i)&&e.reloadIfMoved?.()}}}}export{i as EDIT_LOCK_TAKEN,t as accessForNewDocument,n as canWriteDocument,h as createEditLock,s as describeAge,a as documentPermissions,f as documentVersionMoved,r as holderOf,c as nameOrSomeone,d as newEditorClientId,o as readLockHolder,k as reloadIfVersionMoved,u as shouldReleaseHeldWrite,l as shouldReloadAfterTakeover};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={layer:"Select layer",addInside:"Add block inside",duplicate:"Duplicate",moveUp:"Move up",moveDown:"Move down",copy:"Copy",cut:"Cut",paste:"Paste",rename:"Rename",hide:"Hide",show:"Show",upLevel:"Go up one level",delete:"Delete",pasteNamed:({paste:e,label:a})=>`${e} ${a}`};export{e as DEFAULT_NODE_MENU_WORDS};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{DEFAULT_RAIL_WORDS as a}from"./chunk-2OAZYSWJ.js";import{wordFitVars as i}from"./chunk-BZ5ASXOL.js";import{jsxs as e,jsx as r}from"react/jsx-runtime";function o({label:a,worded:i,icon:o,active:l,disabled:t,onSelect:n,className:d}){const s=["es-rail-btn",l?"is-active":"",d??""].filter(Boolean).join(" ");/* @__PURE__ */
|
|
2
|
+
return e("button",{type:"button",className:s,title:a,"aria-label":a,"aria-pressed":"boolean"==typeof l?l:void 0,disabled:t,onClick:t?void 0:n,children:[o,i?/* @__PURE__ */r("span",{className:"es-rail-word","aria-hidden":"true",children:a}):null]})}function l({items:e,ariaLabel:l=a.label,className:t,orientation:n="column",wordFit:d}){const s="row"===n,c=s&&d?d:void 0;/* @__PURE__ */
|
|
3
|
+
return r("div",{className:["es-rail",s?"es-rail-row":"",c?"is-measured":"",t??""].filter(Boolean).join(" "),role:"toolbar","aria-orientation":s?"horizontal":"vertical","aria-label":l,style:c&&i(e.length,c),children:e.map(a=>/* @__PURE__ */r(o,{label:a.label,worded:Boolean(c),icon:a.icon,active:a.active,disabled:a.disabled,onSelect:a.onSelect},a.id))})}var t={railWidth:46,railPaddingY:8,railGap:4,railRadius:12,buttonSize:34,buttonRadius:9,iconSize:18,wordPaddingX:8,wordGap:6,wordFontSize:12,wordFontWeight:500,transition:"background 0.12s, color 0.12s",disabledOpacity:.35,color:{background:"#ffffff",shadow:"0 1px 2px rgba(0, 0, 0, 0.05), 0 10px 30px rgba(0, 0, 0, 0.06)",idle:"#6b7280",hoverBg:"#f3f4f6",hoverFg:"#111827",accent:"#2563eb",accentTint:"#eff6ff"}},n={railWidth:"--es-rail-w",railPaddingY:"--es-rail-pad-y",railGap:"--es-rail-gap",railRadius:"--es-rail-radius",buttonSize:"--es-rail-btn-size",buttonRadius:"--es-rail-btn-radius",iconSize:"--es-rail-icon-size",wordPaddingX:"--es-rail-word-pad-x",wordGap:"--es-rail-word-gap",wordFontSize:"--es-rail-word-size",wordFontWeight:"--es-rail-word-weight",background:"--es-rail-bg",shadow:"--es-rail-shadow",idle:"--es-rail-fg",hoverBg:"--es-rail-hover-bg",hoverFg:"--es-rail-hover-fg",accent:"--es-rail-accent",accentTint:"--es-rail-accent-tint"};export{l as EditorRail,o as EditorRailButton,n as railCssVars,t as railTokens};
|