efficient-easel 0.99.2 → 0.100.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 +233 -17
- package/dist/autosave/index.d.ts +11 -5
- package/dist/blocks/index.d.ts +1 -1
- package/dist/canvas/index.d.ts +2 -2
- package/dist/canvas/index.js +1 -1
- package/dist/chrome/chrome.css +96 -29
- package/dist/chrome/index.d.ts +67 -18
- package/dist/chrome/index.js +17 -21
- package/dist/chunk-3EDSDPIP.js +1 -0
- package/dist/chunk-67GNT6PF.js +1 -0
- package/dist/{chunk-PI26YXYD.js → chunk-6EIVTKZZ.js} +21 -14
- package/dist/chunk-A5UK76FC.js +6 -0
- package/dist/chunk-AZT7V4UM.js +10 -0
- package/dist/chunk-DICUMYMG.js +12 -0
- package/dist/chunk-HDVD27VB.js +1 -0
- package/dist/chunk-JQM3V7XQ.js +1 -0
- package/dist/chunk-JUQ6YJCG.js +1 -0
- package/dist/chunk-LA54QLP5.js +1 -0
- package/dist/chunk-LGKQXSKO.js +16 -0
- package/dist/chunk-M6F6LS3H.js +1 -0
- package/dist/chunk-MH5GUZFQ.js +9 -0
- package/dist/chunk-P6O363EE.js +6 -0
- package/dist/chunk-PAELDYYS.js +1 -0
- package/dist/{chunk-JYPOOHII.js → chunk-QKVR3K73.js} +3 -3
- package/dist/chunk-SAJUCHOX.js +1 -0
- package/dist/chunk-TRVZ7C23.js +1 -0
- package/dist/chunk-V7GIIXFB.js +16 -0
- package/dist/chunk-WZ7TGAAT.js +3 -0
- package/dist/chunk-ZJEBF4NB.js +1 -0
- package/dist/copy/copy.css +388 -5
- package/dist/copy/index.d.ts +268 -5
- package/dist/copy/index.js +31 -10
- package/dist/drag/drag.css +10 -1
- package/dist/drag/index.d.ts +99 -8
- package/dist/drag/index.js +18 -17
- package/dist/easel/easel.css +15 -0
- package/dist/easel/index.d.ts +104 -33
- package/dist/easel/index.js +9 -1
- package/dist/edit-lock/index.d.ts +1 -3
- package/dist/edit-lock/index.js +1 -1
- package/dist/fields/fields.css +103 -26
- package/dist/fields/index.d.ts +47 -9
- package/dist/fields/index.js +30 -46
- package/dist/gold/index.js +1 -1
- package/dist/icons/index.d.ts +10 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/markup/index.d.ts +94 -10
- package/dist/markup/index.js +1 -1
- package/dist/menu/index.d.ts +58 -5
- package/dist/menu/index.js +15 -15
- package/dist/menu/menu.css +17 -6
- package/dist/node-ops/index.d.ts +1 -1
- package/dist/node-ops/index.js +1 -1
- package/dist/panel/index.d.ts +72 -4
- package/dist/panel/index.js +18 -16
- package/dist/panel/panel.css +56 -1
- package/dist/pick/index.d.ts +39 -1
- package/dist/pick/index.js +7 -14
- package/dist/pick/pick.css +14 -0
- package/dist/rail/index.d.ts +3 -7
- package/dist/rail/index.js +1 -1
- package/dist/strings/catalogue.d.ts +13 -35
- package/dist/strings/catalogue.js +1 -1
- package/dist/strings/index.d.ts +12 -18
- package/dist/strings/index.js +2 -2
- package/dist/style-clipboard/index.d.ts +1 -1
- package/dist/style-clipboard/index.js +1 -1
- package/dist/text-styles/index.d.ts +328 -0
- package/dist/text-styles/index.js +38 -0
- package/dist/text-styles/text-styles.css +309 -0
- package/dist/tree/index.d.ts +43 -2
- package/dist/tree/index.js +1 -1
- package/dist/tree/tree.css +71 -0
- package/dist/{types-p9j2Fac7.d.ts → types-DGcCsxs8.d.ts} +72 -7
- package/dist/{types-Bs_gVkVI.d.ts → types-DWS-s9z-.d.ts} +1 -9
- package/dist/{types-DO-b0LNj.d.ts → types-Djdq6Xkd.d.ts} +9 -8
- package/dist/{types-BOSGNvil.d.ts → types-E3HrTPg2.d.ts} +7 -13
- package/dist/{types-C7HFvdtk.d.ts → types-VqL6t5HH.d.ts} +82 -5
- package/dist/{watch-B5RTR-WX.d.ts → watch-BTYOJpQU.d.ts} +18 -1
- package/dist/{words-DagJdwIA.d.ts → words-AHHfiaRY.d.ts} +31 -2
- package/dist/{words-c-3h9xQQ.d.ts → words-BMzV04b1.d.ts} +1 -1
- package/dist/words-CJjUKcV5.d.ts +37 -0
- package/dist/words-CRYvAiHX.d.ts +105 -0
- package/dist/{words-CD3WADyb.d.ts → words-CzoyDNHm.d.ts} +4 -0
- package/dist/{words-C74EUpFr.d.ts → words-DBq7vfHy.d.ts} +57 -4
- package/dist/{words-N4ebT88_.d.ts → words-DgHcY5qB.d.ts} +9 -3
- package/package.json +8 -8
- package/dist/chunk-66CKSTXP.js +0 -14
- package/dist/chunk-672FAEKU.js +0 -1
- package/dist/chunk-67VZRQLG.js +0 -13
- package/dist/chunk-6PS6STGA.js +0 -1
- package/dist/chunk-7A7O2JWQ.js +0 -1
- package/dist/chunk-7JTL3P6P.js +0 -1
- package/dist/chunk-F2PIG3AA.js +0 -10
- package/dist/chunk-H4B72XCJ.js +0 -1
- package/dist/chunk-KDIVA6WD.js +0 -1
- package/dist/chunk-MCLBHENY.js +0 -1
- package/dist/chunk-QB3BZIRA.js +0 -5
- package/dist/chunk-SJQG5ENJ.js +0 -1
- package/dist/chunk-SUO5627P.js +0 -1
- package/dist/chunk-XUE5O62R.js +0 -3
- package/dist/chunk-ZT7M24XD.js +0 -1
- package/dist/editor/index.d.ts +0 -10
- package/dist/editor/index.js +0 -1
- /package/dist/{chunk-2PHD4L6A.js → chunk-OWBO4WKA.js} +0 -0
package/dist/chrome/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { T as TopBarProps, a as TopBarClusterProps, b as TopBarRailProps, E as EaselIconButtonProps, 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-
|
|
3
|
-
export {
|
|
2
|
+
import { T as TopBarProps, a as TopBarClusterProps, b as TopBarRailProps, E as EaselIconButtonProps, D as DeviceSwitchProps, c as SaveStateProps, d as SaveStateToggleProps, P as PanelResizeHandleProps, I as InspectorHeadProps, e as InspectorIconButtonProps, f as InspectorUpLevelProps, M as MediaPanelHeadProps, g as MediaPickKind, h as EditNoticeProps } from '../types-DGcCsxs8.js';
|
|
3
|
+
export { i as DEFAULT_PANEL_W, j as DeviceOption, k as MAX_PANEL_W, l as MIN_PANEL_W, m as PanelSide, n as PanelWidths, R as RailWordsShown, S as SaveTone, o as clampPanelWidth, p as panelWidthVars, s as setPanelWidthVars } from '../types-DGcCsxs8.js';
|
|
4
4
|
import { LockWords, EditAccess, SaveConflict } from '../edit-lock/index.js';
|
|
5
|
-
import { N as NoticeWords } from '../words-
|
|
6
|
-
export { C as ChromeWords } from '../words-
|
|
7
|
-
import '../types-
|
|
5
|
+
import { N as NoticeWords } from '../words-AHHfiaRY.js';
|
|
6
|
+
export { C as ChromeWords } from '../words-AHHfiaRY.js';
|
|
7
|
+
import '../types-DWS-s9z-.js';
|
|
8
8
|
import '../wordFit-D4S36PvB.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -28,8 +28,6 @@ declare function TopBarCluster({ kind, style, children }: TopBarClusterProps): r
|
|
|
28
28
|
* looking at (device, panels). A second one splits the very run this order makes.
|
|
29
29
|
*/
|
|
30
30
|
declare function TopBarDivider(): react.JSX.Element;
|
|
31
|
-
/** @deprecated The name before the Easel rename: `EaselTopBar`. */
|
|
32
|
-
declare const EditorTopBar: typeof EaselTopBar;
|
|
33
31
|
|
|
34
32
|
/**
|
|
35
33
|
* The rail in the top bar: the left column of the bar (exactly the left panel's
|
|
@@ -54,8 +52,16 @@ declare const EditorTopBar: typeof EaselTopBar;
|
|
|
54
52
|
* rail in the page) once, again when the labels change, and once the web fonts
|
|
55
53
|
* have loaded. On a server, and anywhere a canvas cannot measure, there is no
|
|
56
54
|
* measurement and the rail is icon-only, which always fits.
|
|
55
|
+
*
|
|
56
|
+
* AND A HOST MAY ASK WHICH STATE IT IS IN (`onWords`; second host, 2026-10-07).
|
|
57
|
+
* A longer language drops its words sooner — German "Zurück" and "Ebenen"
|
|
58
|
+
* where English has "Back" and "Layers" — and because the choosing is CSS's, a
|
|
59
|
+
* host had no way to see that it had happened. The answer is READ BACK from
|
|
60
|
+
* what the stylesheet drew (a clipped word is 0 wide), never worked out a
|
|
61
|
+
* second time here, so there is still one rule. Only a host that asks pays for
|
|
62
|
+
* it: one ResizeObserver on the column.
|
|
57
63
|
*/
|
|
58
|
-
declare function TopBarRail({ items, ariaLabel }: TopBarRailProps): react.JSX.Element;
|
|
64
|
+
declare function TopBarRail({ items, ariaLabel, onWords }: TopBarRailProps): react.JSX.Element;
|
|
59
65
|
|
|
60
66
|
/**
|
|
61
67
|
* A 30px glyph button in the top bar — undo, redo, the panel toggles.
|
|
@@ -65,8 +71,6 @@ declare function TopBarRail({ items, ariaLabel }: TopBarRailProps): react.JSX.El
|
|
|
65
71
|
* say. `state` is for a toggle; a plain action leaves it off.
|
|
66
72
|
*/
|
|
67
73
|
declare function EaselIconButton({ label, onClick, disabled, state, buttonRef, children }: EaselIconButtonProps): react.JSX.Element;
|
|
68
|
-
/** @deprecated The name before the Easel rename: `EaselIconButton`. */
|
|
69
|
-
declare const EditorIconButton: typeof EaselIconButton;
|
|
70
74
|
|
|
71
75
|
/**
|
|
72
76
|
* Which device the canvas previews — icon-only, one button held down.
|
|
@@ -137,17 +141,62 @@ declare function InspectorHead({ icon, name, kind, actions }: InspectorHeadProps
|
|
|
137
141
|
/** A 28px glyph button in the inspector head. Named, like every icon-only button. */
|
|
138
142
|
declare function InspectorIconButton({ label, title, hasPopup, onClick, disabled, danger, expanded, buttonRef, children, }: InspectorIconButtonProps): react.JSX.Element;
|
|
139
143
|
/**
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
+
* ← GO UP ONE LEVEL — a blue text link naming the level above what is open,
|
|
145
|
+
* selecting it when pressed. Lifted from the campaign designer's UpLevelControl
|
|
146
|
+
* (card 66042), where it moved off the canvas so a merchant could climb TWICE
|
|
147
|
+
* (Block → Column → Section).
|
|
148
|
+
*
|
|
149
|
+
* ONE LOOK IN BOTH EDITORS (Lewis, 2026-10-06, card [MERGE] One Up-One-Level
|
|
150
|
+
* Link In Both Editors). There were three: this row ("↰ Columns", a filled
|
|
151
|
+
* hover row), the website part panel's "‹ Back" and the Locations panel's
|
|
152
|
+
* "← Locations". He picked the Locations panel's: the arrow and the parent's
|
|
153
|
+
* name in the accent colour, no box, no fill, no hover change. The arrow is
|
|
154
|
+
* drawn here, so a host passes no glyph, and the words are always WHERE IT
|
|
155
|
+
* GOES — the parent's name, never "Back".
|
|
144
156
|
*
|
|
145
|
-
* The
|
|
146
|
-
* is the part that reads as the thing to press. The host renders nothing when
|
|
157
|
+
* The whole link is the button, arrow and name. The host renders nothing when
|
|
147
158
|
* there is no level above (efficient-easel/node-ops `parentStep` says so) — a
|
|
148
159
|
* dead control would be permanent furniture on the level selected most.
|
|
160
|
+
*
|
|
161
|
+
* `inline` drops the panel-top inset, for a level inside the panel body (an
|
|
162
|
+
* open list item, a sub-panel): the link is the same, only where it sits
|
|
163
|
+
* differs.
|
|
164
|
+
*/
|
|
165
|
+
declare function InspectorUpLevel({ name, onSelect, label, inline }: InspectorUpLevelProps): react.JSX.Element;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* THE MEDIA PANEL'S HEAD — one part for both editors (card [MERGE] One Media
|
|
169
|
+
* Panel Head For Both Editors, owner ruling 2026-10-06: a part exists once, in
|
|
170
|
+
* efficient-easel).
|
|
171
|
+
*
|
|
172
|
+
* The Media Library under it was already one component, the admin portal's,
|
|
173
|
+
* drawn narrow in a left panel. Its head was drawn twice: by the campaign
|
|
174
|
+
* designer (`EmailMediaPanel`) and by the website editor (`MediaSidePanel` on
|
|
175
|
+
* its `SidePanelHead`). Both were this shape on `InspectorHead`; where they
|
|
176
|
+
* differed, the website editor's won (GG, 2026-10-06):
|
|
177
|
+
*
|
|
178
|
+
* browsing [media] Media library │ [hide]
|
|
179
|
+
* <the site or campaign>
|
|
180
|
+
* picking [image] Choose image [Cancel] │ [hide]
|
|
181
|
+
* For Background image
|
|
182
|
+
*
|
|
183
|
+
* • choosing is a MODE over the panel, so the head says so and names its way
|
|
184
|
+
* out in a WORD. Cancel leaves the field as it was; what the panel shows
|
|
185
|
+
* next is the host's to decide (both go back to the view before);
|
|
186
|
+
* • the kind word is what the field can hold: image, video or SVG logo
|
|
187
|
+
* ({@link mediaPickKind} reads it from the field's `accept`);
|
|
188
|
+
* • a pick with no field name keeps the browsing context line;
|
|
189
|
+
* • Hide panel is always last, after a hairline when Cancel is there, and is
|
|
190
|
+
* not drawn at all where the panel cannot be hidden (no `onHide`). There
|
|
191
|
+
* is no ✕ in a panel head: ✕ closes windows.
|
|
192
|
+
*/
|
|
193
|
+
declare function MediaPanelHead({ context, pick, onCancel, onHide, side }: MediaPanelHeadProps): react.JSX.Element;
|
|
194
|
+
/**
|
|
195
|
+
* What a field can hold, from the `accept` it asks with: `image/svg+xml` is an
|
|
196
|
+
* SVG logo, `video/*` a video, anything else an image. The website editor's
|
|
197
|
+
* rule (`pickNoun`), lifted with its head.
|
|
149
198
|
*/
|
|
150
|
-
declare function
|
|
199
|
+
declare function mediaPickKind(accept: string): MediaPickKind;
|
|
151
200
|
|
|
152
201
|
/**
|
|
153
202
|
* The bar that says why edits are not being saved — somebody else holds the
|
|
@@ -220,4 +269,4 @@ type EditNoticeWords = {
|
|
|
220
269
|
*/
|
|
221
270
|
declare function editNotice(access: EditAccess, conflict: SaveConflict | null, noun: string, words?: EditNoticeWords): EditNoticeContent | null;
|
|
222
271
|
|
|
223
|
-
export { DeviceSwitch, DeviceSwitchProps, EaselIconButton, EaselIconButtonProps, EaselTopBar, EditNotice, type EditNoticeAction, type EditNoticeContent, EditNoticeProps, type EditNoticeWords,
|
|
272
|
+
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 };
|
package/dist/chrome/index.js
CHANGED
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
import{
|
|
2
|
-
return
|
|
3
|
-
return
|
|
4
|
-
return
|
|
5
|
-
return
|
|
6
|
-
return
|
|
7
|
-
return
|
|
8
|
-
return
|
|
9
|
-
return
|
|
10
|
-
return
|
|
11
|
-
|
|
12
|
-
/* @__PURE__ */
|
|
13
|
-
/* @__PURE__ */
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
/* @__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 T={left:288,right:320},A=220,I=560;function W(e){return Math.min(560,Math.max(220,Math.round(e)))}function q(e){return{"--es-left-w":`${e.left}px`,"--es-right-w":`${e.right}px`}}export{T as DEFAULT_PANEL_W,O as DeviceSwitch,x as EaselIconButton,f as EaselTopBar,z as EditNotice,C as EditorIconButton,y as EditorTopBar,$ as InspectorHead,B as InspectorIconButton,D as InspectorUpLevel,I as MAX_PANEL_W,A as MIN_PANEL_W,R as PanelResizeHandle,S as SaveState,L as SaveStateToggle,k as TopBarCluster,g as TopBarDivider,N as TopBarRail,W as clampPanelWidth,j as editNotice,q as panelWidthVars};
|
|
1
|
+
import{holderOf as e,describeAge as t,nameOrSomeone as n}from"../chunk-JUQ6YJCG.js";import{DEFAULT_LOCK_WORDS as r}from"../chunk-RE4LP46F.js";import{InspectorIconButton as i,InspectorHead as o}from"../chunk-MH5GUZFQ.js";export{InspectorHead,InspectorIconButton,InspectorUpLevel}from"../chunk-MH5GUZFQ.js";import{DEFAULT_NOTICE_WORDS as a,DEFAULT_CHROME_WORDS as s}from"../chunk-ZJEBF4NB.js";import{railTokens as l,EaselRail as c}from"../chunk-WZ7TGAAT.js";import{DEFAULT_RAIL_WORDS as d}from"../chunk-2OAZYSWJ.js";import{useWords as u}from"../chunk-MFIRYGHW.js";import"../chunk-BZ5ASXOL.js";import{PanelLeftIcon as m,PanelRightIcon as v,MediaIcon as f,ImageIcon as h}from"../chunk-6EIVTKZZ.js";import{jsx as p,jsxs as b,Fragment as k}from"react/jsx-runtime";import{useRef as g,useState as y,useCallback as w,useEffect as x,useLayoutEffect as C}from"react";function N({children:e}){/* @__PURE__ */
|
|
2
|
+
return p("div",{className:"es-topbar",children:e})}function O({kind:e,style:t,children:n}){/* @__PURE__ */
|
|
3
|
+
return p("div",{className:e?`es-cluster es-cluster--${e}`:"es-cluster",style:t,children:n})}function P(){/* @__PURE__ */
|
|
4
|
+
return p("div",{className:"es-divider-v","aria-hidden":"true"})}var B="undefined"==typeof window?x:C;function L({items:e,ariaLabel:t,onWords:n}){const r=u("rail",d),i=g(null),[o,a]=y(void 0),[s,m]=y(null),v=JSON.stringify(e.map(e=>e.label));B(()=>{const t=i.current?.querySelector(".es-rail");if(!t)return;const n=document.createElement("canvas").getContext?.("2d")??null,r=()=>{if(m(v),!n)return a(void 0);const r=function(e,t,n){const r=parseFloat(getComputedStyle(e).getPropertyValue(t));return Number.isFinite(r)?r:n}(t,"--es-rail-word-size",l.wordFontSize),i=getComputedStyle(t).getPropertyValue("--es-rail-word-weight").trim()||String(l.wordFontWeight),o=getComputedStyle(t.querySelector(".es-rail-btn")??t).fontFamily;n.font=`${i} ${r}px ${o}`;const s=e.map(e=>n.measureText(e.label).width),c=e=>Math.ceil(4*e)/4;a({labelsPx:c(s.reduce((e,t)=>e+t,0)),widestLabelPx:c(Math.max(0,...s))})};r();let o=!0;return document.fonts?.ready.then(()=>o&&r()),()=>{o=!1}},[v]);const f=g(n);f.current=n;const h=g(null),b=Boolean(n),k=e.map(e=>e.active?"1":"0").join("");return B(()=>{const e=i.current;if(!b||!e||s!==v)return;const t=()=>{const t=Array.from(e.querySelectorAll(".es-rail-word")),n=t.filter(e=>e.getBoundingClientRect().width>0).length,r=t.length>0&&n===t.length?"all":n>0?"chosen":"none";r!==h.current&&(h.current=r,f.current?.(r))};t();const n=e.ownerDocument.defaultView?.ResizeObserver,r=n?new n(t):null;return r?.observe(e),()=>r?.disconnect()},[b,s,v,o,k]),/* @__PURE__ */p("div",{ref:i,className:"es-cluster es-cluster--rail es-rail-fit",children:/* @__PURE__ */p(c,{items:e,ariaLabel:t??r.label,orientation:"row",wordFit:o})})}function M({label:e,onClick:t,disabled:n,state:r,buttonRef:i,children:o}){/* @__PURE__ */
|
|
5
|
+
return p("button",{ref:i,type:"button",className:r?`es-iconbtn es-iconbtn--${r}`:"es-iconbtn",title:e,"aria-label":e,disabled:n,onClick:t,children:o})}function S({devices:e,value:t,onChange:n,ariaLabel:r}){const i=u("chrome",s);/* @__PURE__ */
|
|
6
|
+
return p("div",{className:"es-devseg",role:"group","aria-label":r??i.device,children:e.map(e=>{const r=e.id===t;/* @__PURE__ */
|
|
7
|
+
return p("button",{type:"button",title:e.label,"aria-label":e.label,"aria-pressed":r,className:r?"is-active":void 0,onClick:()=>{r||n(e.id)},children:e.icon},e.id)})})}var $={idle:"is-quiet",saved:"is-quiet is-saved",saving:"is-saving",error:"is-error",off:"is-off","off-unsaved":"is-off is-unsaved"};function j({tone:e,label:t,counting:n,waitMs:r,ringRef:i,role:o}){/* @__PURE__ */
|
|
8
|
+
return b("span",{className:`es-savestate ${$[e]}`,role:o,"aria-live":"polite",children:[/* @__PURE__ */p("span",n?{ref:i,className:"es-savestate-ring is-counting",style:void 0!==r?{"--es-savewait":`${r}ms`}:void 0,"aria-hidden":"true"}:{className:"es-savestate-dot","aria-hidden":"true"}),t]})}function F({pressed:e,title:t,onToggle:n,children:r}){/* @__PURE__ */
|
|
9
|
+
return p("button",{type:"button",className:"es-savestate-toggle","aria-pressed":e,title:t,onClick:n,children:r})}var z="es-col-resizing";function R({side:e,width:t,min:n,max:r,defaultWidth:i,label:o,onResize:a}){const l=u("chrome",s),c=g(null),d=w((t,i)=>{const o="left"===e?t+i:t-i;return Math.round(Math.min(r,Math.max(n,o)))},[e,n,r]),m=w(e=>{c.current&&(c.current=null,document.body.classList.remove(z),e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))},[]),v=w(e=>{0===e.button&&(c.current={x:e.clientX,w:t,moved:!1},e.currentTarget.setPointerCapture(e.pointerId),document.body.classList.add(z))},[t]),f=w(e=>{const t=c.current;if(!t)return;if(0===e.buttons)return void m(e);const n=e.clientX-t.x;if(!t.moved){if(Math.abs(n)<3)return;t.moved=!0}a(d(t.w,n))},[a,d,m]),h=w(e=>{"ArrowLeft"===e.key?(e.preventDefault(),a(e=>d(e,-16))):"ArrowRight"===e.key?(e.preventDefault(),a(e=>d(e,16))):"Home"===e.key&&(e.preventDefault(),a(i))},[a,d,i]);return x(()=>()=>document.body.classList.remove(z),[]),/* @__PURE__ */p("div",{className:`es-resizer es-resizer--${e}`,role:"separator",tabIndex:0,"aria-orientation":"vertical","aria-label":o,"aria-valuenow":t,"aria-valuemin":n,"aria-valuemax":r,title:l.resize,onPointerDown:v,onPointerMove:f,onPointerUp:m,onPointerCancel:m,onLostPointerCapture:m,onDoubleClick:()=>a(i),onKeyDown:h,children:/* @__PURE__ */p("span",{className:"es-resizer-bar","aria-hidden":"true"})})}function I({context:e,pick:t,onCancel:n,onHide:r,side:a="left"}){const l=u("chrome",s),c=r?/* @__PURE__ */p(i,{label:l.hidePanelLabel({side:a}),title:l.hidePanel,onClick:r,children:/* @__PURE__ */p("left"===a?m:v,{size:16})}):null;if(!t)/* @__PURE__ */
|
|
10
|
+
return p(o,{icon:/* @__PURE__ */p(f,{}),name:l.mediaLibrary,kind:e,actions:c??void 0});const d=l.mediaKinds[t.kind];/* @__PURE__ */
|
|
11
|
+
return p(o,{icon:/* @__PURE__ */p(h,{size:15}),name:l.mediaChoose({kind:d}),kind:t.field?l.mediaFor({field:t.field}):e,actions:/* @__PURE__ */b(k,{children:[
|
|
12
|
+
/* @__PURE__ */p("button",{type:"button",className:"es-btn-ghost es-insp-textbtn",title:l.mediaKeep({kind:d}),onClick:n,children:l.mediaCancel}),c?/* @__PURE__ */b(k,{children:[
|
|
13
|
+
/* @__PURE__ */p("span",{className:"es-insp-divider","aria-hidden":"true"}),c]}):null]})})}function T(e){return/svg/i.test(e)?"svg":e.startsWith("video")?"video":"image"}var A={notice:a,lock:r};function D(r,i,o,a=A){const s=a.notice,l=e(r),c={kind:"reload",label:s.reload};if(i){const e=t(i.secondsAgo,a.lock);return{tone:"warning",urgent:!0,lead:i.savedByYou?s.savedByYou({noun:o,when:e}):s.savedByOther({name:n(i.savedBy,a.lock),noun:o,when:e}),body:s.conflictBody,actions:l?[c,{kind:"take-over",label:s.takeOver,title:s.takeOverWhileDeciding}]:[c]}}if(!l)return null;const d=n(l.name,a.lock),u=t(l.secondsSinceSeen,a.lock);switch(r.kind){case"takenover":return{tone:"warning",urgent:!0,lead:s.tookOver({name:d,noun:o,when:t(l.secondsSinceHeld,a.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:o,seen:u}),actions:[{kind:"take-over",label:s.takeOver}]};default:return{tone:"warning",urgent:!1,lead:s.editing({name:d,noun:o}),body:s.editingBody({seen:u}),actions:[{kind:"view-read-only",label:s.viewReadOnly},{kind:"take-over",label:s.takeOver,title:s.takeOverTold}]}}}function W({access:e,conflict:t,noun:n,onTakeOver:i,onViewReadOnly:o,onReload:s}){const l=D(e,t,n,{notice:u("notice",a),lock:u("lock",r)});if(!l)return null;const c={reload:s,"take-over":i,"take-back":i,"view-read-only":o};/* @__PURE__ */
|
|
14
|
+
return b("div",{className:`es-notice is-${l.tone}`,role:l.urgent?"alert":"status",children:[
|
|
15
|
+
/* @__PURE__ */b("span",{className:"es-notice-text",children:[
|
|
16
|
+
/* @__PURE__ */p("strong",{children:l.lead})," ",l.body]}),
|
|
17
|
+
/* @__PURE__ */p("span",{className:"es-notice-actions",children:l.actions.map(e=>/* @__PURE__ */p("button",{type:"button",className:"es-notice-btn",title:e.title,onClick:c[e.kind],children:e.label},e.kind))})]})}var Z={left:288,right:320},H=220,q=560;function G(e){return Math.min(560,Math.max(220,Math.round(e)))}function J(e){return{"--es-left-w":`${e.left}px`,"--es-right-w":`${e.right}px`}}function U(e,t){e.style.setProperty("--es-left-w",`${t.left}px`),e.style.setProperty("--es-right-w",`${t.right}px`)}export{Z as DEFAULT_PANEL_W,S as DeviceSwitch,M as EaselIconButton,N as EaselTopBar,W as EditNotice,q as MAX_PANEL_W,H as MIN_PANEL_W,I as MediaPanelHead,R as PanelResizeHandle,j as SaveState,F as SaveStateToggle,O as TopBarCluster,P as TopBarDivider,L as TopBarRail,G as clampPanelWidth,D as editNotice,T as mediaPickKind,J as panelWidthVars,U as setPanelWidthVars};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={dragHint:"Drag to move · ⌥↑ ⌥↓",collapse:"Collapse",expand:"Expand",collapseNamed:({label:e})=>`Collapse ${e}`,expandNamed:({label:e})=>`Expand ${e}`,emptySlot:"No blocks yet",addBlock:"Add a block",dropHere:"Drop here"};export{e as DEFAULT_TREE_WORDS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{zoneKey as e}from"./chunk-KRXQM65X.js";import{useRef as t,useEffect as n,useState as r,useSyncExternalStore as o,useCallback as i}from"react";var l=56,c=16;function a(e){const t=Math.max(e,0);return t>=l?0:Math.ceil(16*(1-t/l))}function u(e,t,n){if(e<t-l||e>n+l)return 0;const r=e-t,o=n-e;return r<l&&r<=o?-a(r):o<l?a(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.scrollingElement??e.documentElement;return t&&t.scrollHeight>t.clientHeight?t:null}function g(e,t=e){const n=t.ownerDocument,r=n.defaultView;if(!r)return()=>{};let o=null,i=0;const l=e=>{o=e.clientY},c=()=>{if(null!==o){const n=t.getBoundingClientRect(),r=u(o,n.top,n.bottom);r&&(e.scrollTop+=r)}i=r.requestAnimationFrame(c)};return n.addEventListener("dragover",l,!0),i=r.requestAnimationFrame(c),()=>{n.removeEventListener("dragover",l,!0),r.cancelAnimationFrame(i)}}function p(e){return/move|all|uninitialized/i.test(e)?"move":"copy"}function m(){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 v(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 D=(t,n)=>e(t)===e(n);function w(e,t){return D(e,t)&&(t.index===e.index||t.index===e.index+1)}function y(e,t){return D(e,t)&&e.index<t.index?t.index-1:t.index}function x(e,t){return{...e,index:t<0?e.index-1:e.index+2}}function h(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 T(l){const c=t(l);n(()=>{c.current=l});const[a]=r(()=>m()),u=l.session??a,d=o(u.subscribe,u.shown,u.shown),[D,y]=r(null),x=t(null),T=i(()=>{x.current?.(),x.current=null},[]),b=i(()=>{T(),u.end(),y(null)},[u,T]);n(()=>u.subscribe(()=>{u.get()||(T(),y(null))}),[u,T]),n(()=>T,[T]);const k=i((e,t)=>{y(n=>n&&n.key===e&&n.side===t?n:{key:e,side:t})},[]),E=i(e=>{y(t=>t&&t.key===e?null:t)},[]),A=(e,t,n,r)=>!("into"===n?r===e.key:void 0!==e.from&&w(e.from,t))&&c.current.canDrop(e.item,t);return{dragging:d?.item??null,row:(e,t)=>{const{keyOf:n,readOnly:r}=c.current,o=n(e.item),i=!r&&!e.pinned&&!1!==e.canDrag,l=t=>{const n=t.currentTarget.getBoundingClientRect();return v(e,t.clientY,n.top,n.height)},a={draggable:i||void 0,onDragStart:i?t=>{const n=t.currentTarget;u.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);T(),x.current=i?g(i):null}:void 0,onDragEnd:i?()=>b():void 0,onDragOver:e=>{const t=u.get();if(!t)return;const n=l(e);A(t,n.to,n.side,o)?(e.preventDefault(),e.dataTransfer.dropEffect=p(e.dataTransfer.effectAllowed),k(o,n.side)):E(o)},onDrop:e=>{const t=u.get();if(!t)return;const n=l(e);A(t,n.to,n.side,o)&&(e.preventDefault(),b(),c.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}=c.current,o="ArrowUp"===t.key?-1:1;n&&!1!==r?.(e.item,o)&&n(e.item,o)}};return{draggable:i,dragging:d?.key===o,drop:D?.key===o?D.side:void 0,rowProps:h(a,t)}},seam:(t,n)=>{const r=(o=t.place,`seam:${e(o)}:${o.index}`);var o;const i={onDragOver:e=>{const n=u.get();n&&(A(n,t.place,"before",r)?(e.preventDefault(),e.dataTransfer.dropEffect=p(e.dataTransfer.effectAllowed),k(r,"before")):E(r))},onDrop:e=>{const n=u.get();n&&A(n,t.place,"before",r)&&(e.preventDefault(),b(),c.current.onDrop(n.item,t.place))}};return{drop:D?.key===r,seamProps:h(i,n)}},rootProps:e=>h({onDragEnter:e=>{if(!u.get()||x.current)return;const t=f(e.currentTarget);x.current=t?g(t):null},onDragLeave:e=>{const t=e.relatedTarget;t&&e.currentTarget.contains(t)||y(null)}},e)}}export{l as AUTO_SCROLL_EDGE,c as AUTO_SCROLL_MAX_SPEED,u as autoScrollDelta,a as autoScrollSpeed,m as createDragSession,p as dropEffectFor,v as dropOnRow,d as frameScrollBox,y as gapToMoveIndex,w as isNoOpDrop,f as scrollBoxOf,s as scrollParent,g as startAutoScroll,x as stepGap,T as useTreeDrag};
|