efficient-easel 6.2.0 → 6.4.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/dist/canvas/index.d.ts +14 -2
- package/dist/canvas/index.js +1 -1
- package/dist/canvas-typing-Dec_zyuM.d.ts +49 -0
- package/dist/{chunk-QBW3RJG5.js → chunk-3PPA5S2J.js} +1 -1
- package/dist/{chunk-EYRQ4XGN.js → chunk-6EKKPFVG.js} +1 -1
- package/dist/chunk-6XXW6ZW3.js +5 -0
- package/dist/{chunk-CRWFB7MU.js → chunk-7XHDCQVL.js} +16 -16
- package/dist/chunk-AWJUYMX7.js +1 -0
- package/dist/chunk-AYNU4FYF.js +14 -0
- package/dist/chunk-DSUMM2WF.js +10 -0
- package/dist/{chunk-3I6DVDUR.js → chunk-F4XCIEXI.js} +1 -1
- package/dist/chunk-ISBKAONU.js +1 -0
- package/dist/chunk-JIWPANGM.js +1 -0
- package/dist/{chunk-ZTG2K3NL.js → chunk-LWQQQ72E.js} +3 -3
- package/dist/chunk-NL4OU4UU.js +1 -0
- package/dist/{chunk-FXJBKKGI.js → chunk-NTMY5EXS.js} +1 -1
- package/dist/{chunk-RKXIB5BN.js → chunk-QPQXKKSC.js} +1 -1
- package/dist/chunk-TAF5AECR.js +65 -0
- package/dist/{chunk-G3D2HWEO.js → chunk-VFI3ONLN.js} +1 -1
- package/dist/chunk-YB4QPUEZ.js +5 -0
- package/dist/copy/index.d.ts +2 -47
- package/dist/copy/index.js +18 -18
- package/dist/drag/index.js +1 -1
- package/dist/easel/easel.css +17 -0
- package/dist/easel/index.d.ts +47 -2
- package/dist/easel/index.js +1 -1
- package/dist/fields/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/MediaSidePanel.js +1 -1
- package/dist/screen/components/NodeContextMenu.js +1 -1
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.js +1 -1
- package/dist/screen/components/SectionScreenShell.js +15 -15
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/key-scope.js +1 -1
- package/dist/screen/lib/puck/style-clipboard.js +1 -1
- package/dist/screen/lib/puck/use-section-ops.js +1 -1
- package/dist/screen/lib/screen-parts.js +1 -1
- package/dist/strings/catalogue.js +1 -1
- package/dist/strings/index.js +1 -1
- package/dist/text-styles/index.js +16 -16
- package/package.json +1 -1
- package/dist/chunk-2DHJC5YS.js +0 -5
- package/dist/chunk-4XIIBGDO.js +0 -9
- package/dist/chunk-7EKLESDL.js +0 -65
- package/dist/chunk-MHU7S7JL.js +0 -1
- package/dist/chunk-MOCX5MQ7.js +0 -14
- package/dist/chunk-MTRFMGBO.js +0 -1
- package/dist/chunk-PAELDYYS.js +0 -1
- package/dist/chunk-YFK74XOM.js +0 -5
- package/dist/chunk-ZNCEOSXO.js +0 -1
package/dist/easel/index.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ import { S as SlotAddress, D as Data, P as Place } from '../types-41704JE4.js';
|
|
|
7
7
|
import { c as ResolveTrigger, a as ResolveCache, R as ResolvableItem } from '../resolve-D68pb3Bx.js';
|
|
8
8
|
import * as react from 'react';
|
|
9
9
|
import { ReactNode, CSSProperties, ComponentType, ReactElement } from 'react';
|
|
10
|
+
import { C as CanvasTypingEnd } from '../canvas-typing-Dec_zyuM.js';
|
|
11
|
+
import { InlineRule } from '../markup/index.js';
|
|
10
12
|
import { b as NodeOpsHost, C as ClipboardEntry } from '../useNodeOps-CLbZyd43.js';
|
|
11
13
|
import { I as InspectorFields } from '../types-OUl0mK1k.js';
|
|
12
14
|
import '../buckets-Tj-nkBpg.js';
|
|
@@ -326,6 +328,40 @@ type CanvasOverlay = ComponentType<{
|
|
|
326
328
|
kind: 'selected' | 'hover';
|
|
327
329
|
children: ReactNode;
|
|
328
330
|
}>;
|
|
331
|
+
/** Words on the canvas a person may type in place: where they are drawn, and how they are written. */
|
|
332
|
+
interface CanvasTypingTarget {
|
|
333
|
+
/** The element the page drew the words in — read again after a redraw. */
|
|
334
|
+
element: () => HTMLElement | null;
|
|
335
|
+
/** The saved string. */
|
|
336
|
+
value: string;
|
|
337
|
+
rules: readonly InlineRule[];
|
|
338
|
+
/** The field has lines: Shift+Enter makes one. */
|
|
339
|
+
multiline: boolean;
|
|
340
|
+
/** The host's ONE writer for these words — the panel's text box's. */
|
|
341
|
+
write: (next: string) => void;
|
|
342
|
+
/** Draw the words afresh (after an IME composition wrote into them). */
|
|
343
|
+
remount?: () => void;
|
|
344
|
+
}
|
|
345
|
+
type CanvasTypingState = {
|
|
346
|
+
typing: true;
|
|
347
|
+
element: HTMLElement;
|
|
348
|
+
} | {
|
|
349
|
+
typing: false;
|
|
350
|
+
why: CanvasTypingEnd;
|
|
351
|
+
};
|
|
352
|
+
/**
|
|
353
|
+
* Typing the words on the canvas in place (Lewis 2026-10-14, for Victor): the
|
|
354
|
+
* canvas owns the gesture — a single click selects, a double-click types — and
|
|
355
|
+
* the host says which words may be typed and how they are written.
|
|
356
|
+
*/
|
|
357
|
+
interface CanvasTyping {
|
|
358
|
+
/** The words under `target` the host lets a person type, or null. */
|
|
359
|
+
at: (target: Element) => CanvasTypingTarget | null;
|
|
360
|
+
/** The words of the selection, for Enter to type them from the keyboard. */
|
|
361
|
+
atSelection?: () => CanvasTypingTarget | null;
|
|
362
|
+
/** Typing started or ended: the host's text toolbar comes to the words, its panel follows. */
|
|
363
|
+
onChange?: (state: CanvasTypingState) => void;
|
|
364
|
+
}
|
|
329
365
|
interface EaselCanvasProps {
|
|
330
366
|
/** Draw in an iframe of the easel's own (default), or straight into the page. */
|
|
331
367
|
frame?: boolean;
|
|
@@ -375,12 +411,21 @@ interface EaselCanvasProps {
|
|
|
375
411
|
overlay?: CanvasOverlay;
|
|
376
412
|
/** Drawn inside the frame, after the document — a host's canvas-only layer. */
|
|
377
413
|
children?: ReactNode;
|
|
414
|
+
/**
|
|
415
|
+
* Type the words on the canvas in place (Lewis 2026-10-14): a double-click
|
|
416
|
+
* on words `typing.at` offers types them where they are; a single click
|
|
417
|
+
* still only selects. While typing, the outlines stand down and one frame
|
|
418
|
+
* is drawn round the words, the whole session is one undo step, and the
|
|
419
|
+
* canvas root carries `data-es-typing`. Left out, a double-click is two
|
|
420
|
+
* clicks, as before.
|
|
421
|
+
*/
|
|
422
|
+
typing?: CanvasTyping;
|
|
378
423
|
}
|
|
379
424
|
/**
|
|
380
425
|
* `<Puck.Preview>`, ours: the document for editing, its outlines, and the
|
|
381
426
|
* clicks that select. Must sit under an `EaselProvider`.
|
|
382
427
|
*/
|
|
383
|
-
declare function EaselCanvas({ frame, className, style, metadata, mirrorStyles, onDocument, height, title, nonce, hotkeys, frameWrapper: FrameWrapper, overlay, children, }: EaselCanvasProps): ReactElement;
|
|
428
|
+
declare function EaselCanvas({ frame, className, style, metadata, mirrorStyles, onDocument, height, title, nonce, hotkeys, frameWrapper: FrameWrapper, overlay, children, typing, }: EaselCanvasProps): ReactElement;
|
|
384
429
|
|
|
385
430
|
/**
|
|
386
431
|
* THE PARTS, ON THE STORE (blueprint step 5.2).
|
|
@@ -475,4 +520,4 @@ declare function bindUndoKeys(doc: Document, easel: Pick<Easel, 'undo' | 'redo'>
|
|
|
475
520
|
leaveTyping?: boolean;
|
|
476
521
|
}): () => void;
|
|
477
522
|
|
|
478
|
-
export { CanvasFrame, type CanvasFrameProps, type CanvasOverlay, type CanvasSlotProps, DEFAULT_UI, type Easel, EaselAction, EaselCanvas, type EaselCanvasProps, EaselConfig, EaselCore, type EaselOptions, EaselProvider, type EaselProviderProps, EaselUi, EaselView, EditDocument, NodeSelection, Permissions, type SelectedFields, bindUndoKeys, createEasel, createUseEasel, recordsByDefault, reduce, uiView, useEasel, useEaselApi, useEaselNodeOps, useSelectedFields, validSelection };
|
|
523
|
+
export { CanvasFrame, type CanvasFrameProps, type CanvasOverlay, type CanvasSlotProps, type CanvasTyping, type CanvasTypingState, type CanvasTypingTarget, DEFAULT_UI, type Easel, EaselAction, EaselCanvas, type EaselCanvasProps, EaselConfig, EaselCore, type EaselOptions, EaselProvider, type EaselProviderProps, EaselUi, EaselView, EditDocument, NodeSelection, Permissions, type SelectedFields, bindUndoKeys, createEasel, createUseEasel, recordsByDefault, reduce, uiView, useEasel, useEaselApi, useEaselNodeOps, useSelectedFields, validSelection };
|
package/dist/easel/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{CanvasFrame,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useSelectedFields,validSelection}from"../chunk-
|
|
1
|
+
export{CanvasFrame,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useSelectedFields,validSelection}from"../chunk-DSUMM2WF.js";import"../chunk-AELNNAFM.js";import"../chunk-YRLPFZW3.js";import"../chunk-UK2FQOUT.js";import"../chunk-JIWPANGM.js";import"../chunk-546BBOPE.js";import"../chunk-MFIRYGHW.js";import"../chunk-AWJUYMX7.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
|
package/dist/fields/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-
|
|
1
|
+
export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-7XHDCQVL.js";export{FieldSelect,FieldSlider,optionFor}from"../chunk-OZ72A6MY.js";import"../chunk-4JSBIW5H.js";import"../chunk-EA2HTX37.js";import"../chunk-K56YDHYQ.js";export{useResolvedFields}from"../chunk-YRLPFZW3.js";import"../chunk-3ZJSLHHI.js";import"../chunk-KFV7N2DJ.js";export{FieldNumber}from"../chunk-66LWADFP.js";import"../chunk-FFYXVAAL.js";import"../chunk-QLD57GBB.js";import"../chunk-MFIRYGHW.js";import"../chunk-67GNT6PF.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{AddIcon,LayersIcon,MediaIcon,PageIcon as PagesIcon,SitemapIcon,StylesIcon,railCssVars,railTokens}from"./chunk-4VJATVVR.js";export{SPACING_SCALE,shellCssVars,shellDarkTokens,shellTokens}from"./chunk-HMXIAMCU.js";export{EaselRail,EaselRailButton}from"./chunk-MJM6SFD3.js";import"./chunk-2OAZYSWJ.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{AddBlockRow as default}from"../../chunk-
|
|
1
|
+
export{AddBlockRow as default}from"../../chunk-VFI3ONLN.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-6XXW6ZW3.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-MCHMF32I.js";import"../../chunk-DSUMM2WF.js";import"../../chunk-AELNNAFM.js";import"../../chunk-7XHDCQVL.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-EA2HTX37.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-3ZJSLHHI.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-JIWPANGM.js";import"../../chunk-66LWADFP.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-QLD57GBB.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{blockKey,AddSidePanel as default,sectionKey,templateKey}from"../../chunk-
|
|
1
|
+
export{blockKey,AddSidePanel as default,sectionKey,templateKey}from"../../chunk-YB4QPUEZ.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-PFNIVZPN.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-6XXW6ZW3.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-MCHMF32I.js";import"../../chunk-DSUMM2WF.js";import"../../chunk-AELNNAFM.js";import"../../chunk-7XHDCQVL.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-EA2HTX37.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-3ZJSLHHI.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-UB4TLWVJ.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-JIWPANGM.js";import"../../chunk-66LWADFP.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-QLD57GBB.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-AYNU4FYF.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{MediaSidePanel as default}from"../../chunk-
|
|
1
|
+
export{MediaSidePanel as default}from"../../chunk-F4XCIEXI.js";import"../../chunk-6XXW6ZW3.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-DSUMM2WF.js";import"../../chunk-AELNNAFM.js";import"../../chunk-7XHDCQVL.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-EA2HTX37.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-3ZJSLHHI.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-UB4TLWVJ.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-JIWPANGM.js";import"../../chunk-66LWADFP.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-QLD57GBB.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{EASEL_NODE_CLIPBOARD,ancestorChain,nodeClipboardOf,nodeClipboardRules,nodeMenuItems,nodeShortcut,pageMenuItems,pastePlace,runNodeShortcut,textMenuItems,useNodeClipboard,useNodeContextMenu}from"../../chunk-
|
|
1
|
+
export{EASEL_NODE_CLIPBOARD,ancestorChain,nodeClipboardOf,nodeClipboardRules,nodeMenuItems,nodeShortcut,pageMenuItems,pastePlace,runNodeShortcut,textMenuItems,useNodeClipboard,useNodeContextMenu}from"../../chunk-ISBKAONU.js";import"../../chunk-BXMXTO36.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-MCHMF32I.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ScreenChrome as default}from"../../chunk-
|
|
1
|
+
export{ScreenChrome as default}from"../../chunk-TAF5AECR.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-BXQBCW3P.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-PAM3NLFL.js";import"../../chunk-7F52SZOI.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-TBF5CVPA.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-QPQXKKSC.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-6TOYXESC.js";import"../../chunk-NL4OU4UU.js";import"../../chunk-6EKKPFVG.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-ISBKAONU.js";import"../../chunk-HQWQLDCB.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-WZMU646D.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-BXMXTO36.js";import"../../chunk-5545A3PC.js";import"../../chunk-YB4QPUEZ.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-PFNIVZPN.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-F4XCIEXI.js";import"../../chunk-6XXW6ZW3.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-MCHMF32I.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-DSUMM2WF.js";import"../../chunk-AELNNAFM.js";import"../../chunk-7XHDCQVL.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-EA2HTX37.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-3ZJSLHHI.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-4VJATVVR.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-UB4TLWVJ.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-JIWPANGM.js";import"../../chunk-66LWADFP.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-QLD57GBB.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-AYNU4FYF.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{DocumentScreen,ScreenMount as default}from"../../chunk-
|
|
1
|
+
export{DocumentScreen,ScreenMount as default}from"../../chunk-LWQQQ72E.js";import"../../chunk-GXQCZJOP.js";import"../../chunk-3PPA5S2J.js";import"../../chunk-TAF5AECR.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-BXQBCW3P.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-PAM3NLFL.js";import"../../chunk-7F52SZOI.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-TBF5CVPA.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-QPQXKKSC.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-6TOYXESC.js";import"../../chunk-NL4OU4UU.js";import"../../chunk-6EKKPFVG.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-ISBKAONU.js";import"../../chunk-HQWQLDCB.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-WZMU646D.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-BXMXTO36.js";import"../../chunk-5545A3PC.js";import"../../chunk-YB4QPUEZ.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-PFNIVZPN.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-F4XCIEXI.js";import"../../chunk-6XXW6ZW3.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-MCHMF32I.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-DSUMM2WF.js";import"../../chunk-AELNNAFM.js";import"../../chunk-7XHDCQVL.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-EA2HTX37.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-3ZJSLHHI.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-4VJATVVR.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-UB4TLWVJ.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-JIWPANGM.js";import"../../chunk-66LWADFP.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-QLD57GBB.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-AYNU4FYF.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ScreenStoreProvider as default}from"../../chunk-
|
|
1
|
+
export{ScreenStoreProvider as default}from"../../chunk-3PPA5S2J.js";import"../../chunk-6XXW6ZW3.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-DSUMM2WF.js";import"../../chunk-AELNNAFM.js";import"../../chunk-7XHDCQVL.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-EA2HTX37.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-3ZJSLHHI.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-JIWPANGM.js";import"../../chunk-66LWADFP.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-QLD57GBB.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import{AddBlockRow as e}from"../../chunk-
|
|
2
|
-
return
|
|
3
|
-
return
|
|
4
|
-
/* @__PURE__ */Z(
|
|
5
|
-
return
|
|
6
|
-
/* @__PURE__ */Z("div",{className:"sf-section-bar",children:/* @__PURE__ */Z(
|
|
7
|
-
/* @__PURE__ */
|
|
8
|
-
/* @__PURE__ */Z("div",{className:"sf-panel-head",children:/* @__PURE__ */Z(
|
|
9
|
-
/* @__PURE__ */Z(
|
|
10
|
-
/* @__PURE__ */Z(
|
|
11
|
-
return
|
|
12
|
-
/* @__PURE__ */Z(
|
|
13
|
-
/* @__PURE__ */
|
|
14
|
-
/* @__PURE__ */Z("span",{className:"sf-plus sf-plus--sm",children:"+"}),
|
|
1
|
+
import{AddBlockRow as e}from"../../chunk-VFI3ONLN.js";import{slotChildRowName as n}from"../../chunk-TBF5CVPA.js";import{scrollPreviewToSection as o,gotoPreviewSlide as r}from"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import{useEaselUndoKeys as t}from"../../chunk-QPQXKKSC.js";import{SlotChildActionsProvider as s}from"../../chunk-KCBEE2MC.js";import{DEFAULT_PANEL_W as i}from"../../chunk-6TOYXESC.js";import{usePartBridge as c}from"../../chunk-NL4OU4UU.js";import{useSectionOps as p}from"../../chunk-6EKKPFVG.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import{useScreenDocument as l}from"../../chunk-WZMU646D.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import{MediaSidePanel as m}from"../../chunk-F4XCIEXI.js";import{SELECTION_MODE as d,useScreenPinned as a,useScreenCanvasFrame as u,useScreenInspectorPanel as h,useScreenPickFollowsSelection as k,sameInspectorMode as f,useStandaloneScreenBridges as j,useScreenBlockLook as N,useScreenBlockRules as y}from"../../chunk-6XXW6ZW3.js";import{nestsInTree as S,slotFieldsOf as C}from"../../chunk-PLVEGYK6.js";import{useMediaPanel as A,usePanelPick as x,useCancelPanelPick as M}from"../../chunk-R6WTQWAC.js";import{useHostEscape as F}from"../../chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as O}from"../../chunk-MCHMF32I.js";import{useEasel as P}from"../../chunk-DSUMM2WF.js";import"../../chunk-AELNNAFM.js";import"../../chunk-7XHDCQVL.js";import"../../chunk-OZ72A6MY.js";import{LayersTree as v,Subtree as L,TreeRow as W,TreeRowAction as B,TreeSeam as g}from"../../chunk-4JSBIW5H.js";import"../../chunk-EA2HTX37.js";import{DEFAULT_TREE_WORDS as w}from"../../chunk-K56YDHYQ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-3ZJSLHHI.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-BDTITTMW.js";import{DEFAULT_SAVE_WORDS as z,saveIndicator as E}from"../../chunk-H6DDIBQ4.js";import{SaveState as b,panelWidthVars as R}from"../../chunk-UB4TLWVJ.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-JIWPANGM.js";import"../../chunk-66LWADFP.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-QLD57GBB.js";import{useWords as T}from"../../chunk-MFIRYGHW.js";import"../../chunk-AYNU4FYF.js";import"../../chunk-O2NLQBFX.js";import{useTreeDrag as X}from"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.js";import{zoneKey as I,parseZoneKey as Y}from"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";import{useState as D,useRef as H,useEffect as K,useCallback as V,Fragment as J}from"react";import{Tooltip as U}from"efficient-shell/ui";import{TrashIcon as G}from"efficient-shell/icons/efficient";import{jsxs as Q,jsx as Z,Fragment as $}from"react/jsx-runtime";var q=e=>n=>{n.target.closest("button, input")||e()},_={rowClick:q};function ee(){const{saveState:ee,readOnly:ne,readOnlyReason:oe=null}=l(),re=p(),{appState:te,selectedItem:se,config:ie}=P(e=>e),[ce,pe]=D(d),le=T("screen",O),me=T("tree",w),de=T("save",z),{first:ae,last:ue,panelOf:he}=a(),ke=he(ae),fe=u(),je=h(),Ne=te.data.content?.[0]??null,ye=Ne?.props.id??null,Se=Ne?.type===ae,Ce=Ne?.type===ue,Ae=H(null),xe=H(null);t(xe);const Me=A(),Fe=x(),Oe=M();k(se?.props.id),K(()=>{const e=xe.current;if(!Fe||!e)return;const n=e=>{"Escape"===e.key&&Oe()};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[Fe]),F(null!==Fe,()=>Oe()),K(()=>{ye&&Ae.current!==ye&&(Ae.current=ye,Se?pe(ke??d):se||re.select({index:0}))},[ye,se,re,Se]);const Pe=V(e=>pe(n=>f(n,e)?n:e),[]),ve=j({kind:ce.kind,mode:ce,open:Pe,show:e=>pe(e),reveal:()=>{},select:(e,n)=>{pe(e=>f(e,n)?e:n),re.select(e)}}),{selectNode:Le}=c({mode:ce,setMode:pe,onOpenPart:o}),We=N(),{labelAtLevel:Be,Icon:ge}=We,{canAddTo:we}=y(),ze=e=>Be(e,"block",ie.components[e]?.label??e),Ee=e=>Be(e,"section",ze(e)),be=!Se&&"puck"===ce.kind&&se?.props.id===ye,Re=Ne?we(Ne.type)?.spec??null:null,Te=Ne&&Re?`${Ne.props.id}:${Re.slot}`:null,Xe=Ne&&Re&&Array.isArray(Ne.props[Re.slot])?Ne.props[Re.slot]:[],Ie=e=>n(e,ze,We.plainText),Ye=(e,n)=>{Ne&&Re&&Te&&(pe(d),Re.slider?(r(String(Ne.props.id),e),re.select({index:e,zone:Te}),o(String(Ne.props.id))):(re.select({index:e,zone:Te}),o(n)))},De=()=>{if(!Ne||!Re||!Te)return;const e=Xe.length;re.insertComponent(Te,Re.childType,e),pe(d),Re.slider?requestAnimationFrame(()=>{r(String(Ne.props.id),e),re.select({index:e,zone:Te})}):re.select({index:e,zone:Te})},He=e=>C(ie,e),Ke=e=>{const{parentId:n,slot:o}=Y(e),r=e=>{if(!e)return null;if(String(e.props.id)===n)return e;for(const n of He(e.type)){const o=Array.isArray(e.props[n])?e.props[n]:[];for(const e of o){const n=r(e);if(n)return n}}return null},t=r(Ne)?.props[o];return Array.isArray(t)?t.length:0},Ve=(e,n,o)=>{const r=Math.min(Math.max(o,0),Ke(e)),t=n<r?r-1:r;t!==n&&(re.reorderComponent(e,n,t),pe(d),re.select({index:t,zone:e}))},Je=X({keyOf:e=>e.id,readOnly:Boolean(ne),canDrop:(e,n)=>I(n)===e.zone&&n.index>=0&&n.index<=Ke(e.zone),onDrop:(e,n)=>Ve(e.zone,e.index,n.index),onStep:(e,n)=>Ve(e.zone,e.index,n<0?e.index-1:e.index+2)}),Ue=(e,n)=>/* @__PURE__ */Z(g,{...ne?{}:Je.seam({place:{...Y(e),index:n}})},`seam:${e}:${n}`),Ge=e=>We.blockRowName(e,ze),Qe=(e,n,r)=>{pe(d),re.select({index:n,zone:e}),o(r)},Ze=(e,n,o)=>{re.insertComponent(e,n,o),pe(d),re.select({index:o,zone:e})},$e=(n,o,r)=>/* @__PURE__ */Z(e,{choices:r,onPick:e=>Ze(n,e,o)}),qe=(e,n)=>{const o=He((r=e).type).flatMap(e=>(Array.isArray(r.props[e])?r.props[e]:[]).map((n,o)=>({child:n,zone:`${r.props.id}:${e}`,index:o})));var r;const t=we(e.type),s=t?.choices??null,i="footer"===t?.source?Ge:Ie;/* @__PURE__ */
|
|
2
|
+
return Q($,{children:[o.map(({child:e,zone:o,index:r})=>{const t=se?.props.id===e.props.id,s=S(ie,e.type,n),c=i(e),p=String(e.props.id),l=()=>Qe(o,r,p),{rowProps:m,...a}=Je.row({item:{id:p,zone:o,index:r},place:{...Y(o),index:r}},{onClick:q(l)});/* @__PURE__ */
|
|
3
|
+
return Q(J,{children:[0===r&&Ue(o,0),
|
|
4
|
+
/* @__PURE__ */Z(W,{words:me,icon:/* @__PURE__ */Z(ge,{type:e.type,size:13}),name:c,selected:t,onSelect:l,...a,actions:/* @__PURE__ */Z(B,{kind:"delete",label:le.deleteNamed({name:c}),onClick:()=>{return e=o,n=r,re.removeComponent(e,n),pe(d),void re.select(null);var e,n},children:/* @__PURE__ */Z(G,{size:13})}),rowProps:m}),s&&/* @__PURE__ */Z(L,{children:qe(e,n+1)}),Ue(o,r+1)]},String(e.props.id??`${o}-${r}`))}),t&&s?$e(`${e.props.id}:${t.slot}`,o.length,s):null]})},_e="HeroSingle"===Ne?.type,en=Boolean(Ne)&&(Boolean(Re)||Ce||Se||_e);/* @__PURE__ */
|
|
5
|
+
return Q("div",{ref:xe,className:"sf-editor es-editor",style:R(i),children:[
|
|
6
|
+
/* @__PURE__ */Z("div",{className:"sf-section-bar",children:/* @__PURE__ */Z(b,null!==oe?{tone:"off",label:oe,role:"status"}:{...E(ee,de),role:"status"})}),
|
|
7
|
+
/* @__PURE__ */Q("div",{className:"sf-body",children:[Fe&&Me?/* @__PURE__ */Z("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:/* @__PURE__ */Z(m,{panel:Me,pick:Fe})}):en&&Ne&&/* @__PURE__ */Q("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:[
|
|
8
|
+
/* @__PURE__ */Z("div",{className:"sf-panel-head",children:/* @__PURE__ */Z(U,{content:Se?le.headerSettings:le.sectionSettings({name:Ee(Ne.type)}),side:"bottom",children:/* @__PURE__ */Z("button",{type:"button",className:"sf-panel-title sf-panel-title--btn "+(be?"is-selected":""),"aria-pressed":be,onClick:()=>{Se?pe(ke??d):(pe(d),re.select({index:0}))},children:Ee(Ne.type)})})}),
|
|
9
|
+
/* @__PURE__ */Z(v,{className:"sf-tree sf-scroll",rootProps:Je.rootProps(),words:me,children:/* @__PURE__ */Z(L,{children:Se?
|
|
10
|
+
/* @__PURE__ */Z(W,{words:me,icon:/* @__PURE__ */Z(ge,{type:"header",size:13}),name:le.headerSettings,selected:ce.kind===ke?.kind,onSelect:()=>pe(ke??d),rowProps:{onClick:q(()=>pe(ke??d))}}):Re?/* @__PURE__ */Q($,{children:[Xe.map((e,n)=>{const o=se?.props.id===e.props.id,r=Ie(e),t=String(e.props.id),s=()=>Ye(n,t),{rowProps:i,...c}=Je.row({item:{id:t,zone:Te,index:n},place:{...Y(Te),index:n}},{onClick:q(s)});/* @__PURE__ */
|
|
11
|
+
return Q(J,{children:[0===n&&Ue(Te,0),
|
|
12
|
+
/* @__PURE__ */Z(W,{words:me,icon:/* @__PURE__ */Z(ge,{type:e.type,size:13}),name:r,selected:o,onSelect:s,...c,actions:/* @__PURE__ */Z(B,{kind:"delete",label:le.deleteNamed({name:r}),onClick:()=>{return e=n,void(Te&&(re.removeComponent(Te,e),pe(d),re.select(null)));var e},children:/* @__PURE__ */Z(G,{size:13})}),rowProps:i}),Ue(Te,n+1)]},String(e.props.id??n))}),
|
|
13
|
+
/* @__PURE__ */Q("button",{type:"button",className:"sf-add-card",onClick:De,children:[
|
|
14
|
+
/* @__PURE__ */Z("span",{className:"sf-plus sf-plus--sm",children:"+"}),Re.addLabel]}),ye?ve.partRows?.(Ne,_):null]}):qe(Ne,1)})})]}),
|
|
15
15
|
/* @__PURE__ */Z("div",{className:"sf-center",children:/* @__PURE__ */Z("div",{className:"sf-preview-host",children:/* @__PURE__ */Z(fe,{})})}),
|
|
16
|
-
/* @__PURE__ */Z(s,{value:{selectChild:(e,n,o,r)=>"section"===we(r)?.source?
|
|
16
|
+
/* @__PURE__ */Z(s,{value:{selectChild:(e,n,o,r)=>"section"===we(r)?.source?Ye(n,o):Qe(e,n,o),addChild:(e,n,o,r,t)=>"section"===we(t)?.source?De():Ze(`${e}:${n}`,o,r),childRowName:Ie,blockRowName:Ge},children:/* @__PURE__ */Z(je,{mode:ce,onOpenWebsiteSettings:ve.openSettings??(()=>{}),onSelectNode:Le,hideNodeActions:!0})})]})]})}export{ee as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{usePartBridge}from"../../chunk-
|
|
1
|
+
export{usePartBridge}from"../../chunk-NL4OU4UU.js";import"../../chunk-6EKKPFVG.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-6XXW6ZW3.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-DSUMM2WF.js";import"../../chunk-AELNNAFM.js";import"../../chunk-7XHDCQVL.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-EA2HTX37.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-3ZJSLHHI.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-JIWPANGM.js";import"../../chunk-66LWADFP.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-QLD57GBB.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
package/dist/screen/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunk-GZO72N3Q.js";export{DocumentScreen,ScreenMount}from"../chunk-
|
|
1
|
+
import"../chunk-GZO72N3Q.js";export{DocumentScreen,ScreenMount}from"../chunk-LWQQQ72E.js";import"../chunk-GXQCZJOP.js";export{ScreenStoreProvider}from"../chunk-3PPA5S2J.js";import"../chunk-TAF5AECR.js";import"../chunk-26OOWIJJ.js";import"../chunk-BXQBCW3P.js";import"../chunk-FGNR22NY.js";import"../chunk-ZE7I3PLX.js";import"../chunk-2GVCAIPX.js";import"../chunk-PAM3NLFL.js";import"../chunk-7F52SZOI.js";import"../chunk-MQNBD6AB.js";import"../chunk-TBF5CVPA.js";import"../chunk-4ES5JGGX.js";import"../chunk-IQ5TA7AM.js";import"../chunk-DUVRZ456.js";import"../chunk-6W7WLPZH.js";import"../chunk-QPQXKKSC.js";import"../chunk-KCBEE2MC.js";import"../chunk-6TOYXESC.js";import"../chunk-NL4OU4UU.js";import"../chunk-6EKKPFVG.js";import"../chunk-IYT6NN2J.js";import"../chunk-ISBKAONU.js";import"../chunk-HQWQLDCB.js";import"../chunk-BSPCSC45.js";import"../chunk-I54UCYOU.js";import"../chunk-GOTN2KY4.js";import"../chunk-R5L2E7JX.js";import"../chunk-WZMU646D.js";import"../chunk-S4AWJX4Q.js";import"../chunk-ERR437B5.js";import"../chunk-KG7RJWOK.js";import"../chunk-GMCZXMOV.js";export{NO_DOCUMENT_ADDRESSING}from"../chunk-RLBXE4EU.js";import"../chunk-HNKB2ZYR.js";import"../chunk-CLOS6SSX.js";import"../chunk-VPFNZ7TB.js";import"../chunk-LOMEH6DG.js";import"../chunk-BXMXTO36.js";import"../chunk-5545A3PC.js";import"../chunk-YB4QPUEZ.js";import"../chunk-5ZBY24K7.js";import"../chunk-PA3PNTVV.js";import"../chunk-BVN33R76.js";import"../chunk-PFNIVZPN.js";import"../chunk-KQMML6JM.js";import"../chunk-KCOBHPN6.js";export{EaselSessionProvider,useEaselSession}from"../chunk-O7Q4DDJT.js";export{EFFICIENT_BACKEND,activateEaselSession,backendOf,createEaselSession,currentEaselSession,deactivateEaselSession,efficientClientOpen,isEfficientBackend,provideDefaultBackend,resetAmbientEaselSession,sessionRegistry,setSessionBridgedSite,setSessionDocumentSite}from"../chunk-RSCMJIWS.js";import"../chunk-HQ4VVRIC.js";import"../chunk-F4XCIEXI.js";export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSlotMode,sameInspectorMode,screenSlotsOf,useScreenAdd,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../chunk-6XXW6ZW3.js";import"../chunk-PLVEGYK6.js";import"../chunk-R6WTQWAC.js";export{DETACHED_EASEL_HOST,EaselHostContext,EaselHostProvider,createEaselHost,useEaselHost,useHostEscape}from"../chunk-U3JP4VGF.js";import"../chunk-MCHMF32I.js";import"../chunk-V7U33NF2.js";import"../chunk-6WY6ZXJG.js";import"../chunk-DSUMM2WF.js";import"../chunk-AELNNAFM.js";import"../chunk-7XHDCQVL.js";import"../chunk-OZ72A6MY.js";import"../chunk-4JSBIW5H.js";import"../chunk-EA2HTX37.js";import"../chunk-K56YDHYQ.js";import"../chunk-YRLPFZW3.js";import"../chunk-OSPUG6S6.js";import"../chunk-WK3AFPXY.js";import"../chunk-UK2FQOUT.js";import"../chunk-3ZJSLHHI.js";import"../chunk-KFV7N2DJ.js";import"../chunk-4VJATVVR.js";import"../chunk-BDTITTMW.js";import"../chunk-H6DDIBQ4.js";import"../chunk-UB4TLWVJ.js";import"../chunk-Y2G7CU6A.js";import"../chunk-THWO5YVZ.js";import"../chunk-RE4LP46F.js";import"../chunk-MJM6SFD3.js";import"../chunk-2OAZYSWJ.js";import"../chunk-JIWPANGM.js";import"../chunk-66LWADFP.js";import"../chunk-FFYXVAAL.js";import"../chunk-546BBOPE.js";import"../chunk-QLD57GBB.js";import"../chunk-MFIRYGHW.js";import"../chunk-AYNU4FYF.js";import"../chunk-O2NLQBFX.js";import"../chunk-67GNT6PF.js";import"../chunk-AWJUYMX7.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{editorRootFocus,useEaselKeyTarget,useEaselUndoKeys}from"../../chunk-
|
|
1
|
+
export{editorRootFocus,useEaselKeyTarget,useEaselUndoKeys}from"../../chunk-QPQXKKSC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-DSUMM2WF.js";import"../../chunk-AELNNAFM.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-JIWPANGM.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{copyNodeStyle,nodeStyleRows,planNodePaste,shopFieldKind,siteStyleScope,styleClipboardOf}from"../../../chunk-BXQBCW3P.js";import"../../../chunk-ZE7I3PLX.js";import"../../../chunk-PAM3NLFL.js";import"../../../chunk-7F52SZOI.js";import"../../../chunk-MQNBD6AB.js";import"../../../chunk-DUVRZ456.js";import"../../../chunk-BSPCSC45.js";import"../../../chunk-
|
|
1
|
+
export{copyNodeStyle,nodeStyleRows,planNodePaste,shopFieldKind,siteStyleScope,styleClipboardOf}from"../../../chunk-BXQBCW3P.js";import"../../../chunk-ZE7I3PLX.js";import"../../../chunk-PAM3NLFL.js";import"../../../chunk-7F52SZOI.js";import"../../../chunk-MQNBD6AB.js";import"../../../chunk-DUVRZ456.js";import"../../../chunk-BSPCSC45.js";import"../../../chunk-MCHMF32I.js";import"../../../chunk-V7U33NF2.js";import"../../../chunk-6WY6ZXJG.js";import"../../../chunk-MFIRYGHW.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{useSectionOps}from"../../../chunk-
|
|
1
|
+
export{useSectionOps}from"../../../chunk-6EKKPFVG.js";import"../../../chunk-6XXW6ZW3.js";import"../../../chunk-PLVEGYK6.js";import"../../../chunk-R6WTQWAC.js";import"../../../chunk-U3JP4VGF.js";import"../../../chunk-DSUMM2WF.js";import"../../../chunk-AELNNAFM.js";import"../../../chunk-7XHDCQVL.js";import"../../../chunk-OZ72A6MY.js";import"../../../chunk-4JSBIW5H.js";import"../../../chunk-EA2HTX37.js";import"../../../chunk-K56YDHYQ.js";import"../../../chunk-YRLPFZW3.js";import"../../../chunk-UK2FQOUT.js";import"../../../chunk-3ZJSLHHI.js";import"../../../chunk-KFV7N2DJ.js";import"../../../chunk-JIWPANGM.js";import"../../../chunk-66LWADFP.js";import"../../../chunk-FFYXVAAL.js";import"../../../chunk-546BBOPE.js";import"../../../chunk-QLD57GBB.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-67GNT6PF.js";import"../../../chunk-AWJUYMX7.js";import"../../../chunk-P2VEMZH5.js";import"../../../chunk-KRXQM65X.js";import"../../../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSlotMode,sameInspectorMode,screenSlotsOf,useScreenAdd,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../../chunk-
|
|
1
|
+
export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSlotMode,sameInspectorMode,screenSlotsOf,useScreenAdd,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../../chunk-6XXW6ZW3.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-DSUMM2WF.js";import"../../chunk-AELNNAFM.js";import"../../chunk-7XHDCQVL.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-EA2HTX37.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-UK2FQOUT.js";import"../../chunk-3ZJSLHHI.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-JIWPANGM.js";import"../../chunk-66LWADFP.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-QLD57GBB.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-
|
|
1
|
+
export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-NTMY5EXS.js";import"../chunk-M6F6LS3H.js";import"../chunk-MCHMF32I.js";import"../chunk-6WY6ZXJG.js";import"../chunk-AELNNAFM.js";import"../chunk-K56YDHYQ.js";import"../chunk-WK3AFPXY.js";import"../chunk-KFV7N2DJ.js";import"../chunk-ZAOM6PFH.js";import"../chunk-H6DDIBQ4.js";import"../chunk-Y2G7CU6A.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import"../chunk-AUT242JK.js";import"../chunk-FFYXVAAL.js";import"../chunk-546BBOPE.js";import"../chunk-O2NLQBFX.js";
|
package/dist/strings/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{DEFAULT_EASEL_STRINGS as r,mergeEaselStrings as n}from"../chunk-
|
|
1
|
+
import{DEFAULT_EASEL_STRINGS as r,mergeEaselStrings as n}from"../chunk-NTMY5EXS.js";export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-NTMY5EXS.js";import"../chunk-M6F6LS3H.js";import"../chunk-MCHMF32I.js";import"../chunk-6WY6ZXJG.js";import"../chunk-AELNNAFM.js";import"../chunk-K56YDHYQ.js";import"../chunk-WK3AFPXY.js";import"../chunk-KFV7N2DJ.js";import"../chunk-ZAOM6PFH.js";import"../chunk-H6DDIBQ4.js";import"../chunk-Y2G7CU6A.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import"../chunk-AUT242JK.js";import"../chunk-FFYXVAAL.js";import"../chunk-546BBOPE.js";import{stringsContext as o}from"../chunk-MFIRYGHW.js";import"../chunk-O2NLQBFX.js";import{useContext as t,useMemo as c}from"react";import{jsx as i}from"react/jsx-runtime";function s({value:s,locale:u,children:m}){const e=o(),p=t(e),h=p?.strings??r,j=u??p?.locale??"en",k=c(()=>({strings:n(h,s),locale:j}),[h,s,j]);/* @__PURE__ */
|
|
2
2
|
return i(e.Provider,{value:k,children:m})}function u(){return t(o())?.strings??r}function m(){return t(o())?.locale??"en"}export{s as EaselStringsProvider,m as useEaselLocale,u as useEaselStrings};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{DEFAULT_TEXT_STYLES_WORDS as e}from"../chunk-M6F6LS3H.js";export{DEFAULT_TEXT_STYLES_WORDS}from"../chunk-M6F6LS3H.js";import{FieldSelect as n,FieldSlider as t}from"../chunk-OZ72A6MY.js";import{hexReadout as s,ColourWindow as i,typedHex as a}from"../chunk-FPAVNX3Y.js";import"../chunk-ZAOM6PFH.js";import"../chunk-FFYXVAAL.js";import{useWords as l}from"../chunk-MFIRYGHW.js";import{withTip as r}from"../chunk-P2VEMZH5.js";import{hsvToHex as o,Tooltip as d,ColorSwatch as c,IconButton as u}from"efficient-shell/ui";import{useState as m,useRef as f,useId as h,useEffect as p,Fragment as v}from"react";import{ChevronIcon as g,TrashIcon as k,BoldIcon as y,ItalicIcon as b,CaseLowerIcon as x,CaseUpperIcon as w,CaseNormalIcon as S}from"efficient-shell/icons/efficient";import{jsxs as N,jsx as C,Fragment as M}from"react/jsx-runtime";var z=["font","color","size","weight","emphasis","lineSpacing","letterSpacing","paragraphSpacing","letterCase","largestSize"],$=["font","color","size","weight","lineSpacing","letterSpacing","paragraphSpacing","letterCase"],O=["heading","body"],A=7,j={heading:3,body:5},F={min:5,max:void 0,sliderMin:12,sliderMax:72,step:1,shiftStep:10,unit:"px"},L={size:F,weight:{min:100,max:900,sliderMin:300,sliderMax:900,step:100,shiftStep:100,unit:""},lineSpacing:{min:50,max:250,sliderMin:50,sliderMax:250,step:1,shiftStep:10,unit:"%"},letterSpacing:{min:-10,max:void 0,sliderMin:-5,sliderMax:10,step:.1,shiftStep:1,unit:"px"},paragraphSpacing:{min:0,max:void 0,sliderMin:0,sliderMax:48,step:1,shiftStep:10,unit:"px"},largestSize:F},E=(e,n)=>`${"heading"===e?"Heading":"Body"} ${n}`;function W(e=({kind:e,n:n})=>E(e,n)){return O.flatMap(n=>Array.from({length:j[n]},(t,s)=>({id:`${n}-${s+1}`,kind:n,name:e({kind:n,n:s+1}),values:{}})))}function H(e,n,t=A){return e.filter(e=>e.kind===n).length<t}function B(e,n){const t=new RegExp(`^${n}-([1-9]\\d*)$`).exec(e);return t?Number(t[1]):void 0}function D(e){const n=B(e.id,e.kind);return void 0!==n&&n<=j[e.kind]}function I(e,n,t={}){const{max:s=A,name:i=({kind:e,n:n})=>E(e,n),make:a}=t;if(!H(e,n,s))return null;const l=e.filter(e=>e.kind===n);let r=l.length+1;const o=new Set(e.map(e=>e.name));for(;o.has(i({kind:n,n:r}));)r+=1;const d=new Set(e.map(e=>e.id));let c=Math.max(r,...l.map(e=>(B(e.id,n)??0)+1));for(;d.has(`${n}-${c}`);)c+=1;const u=l.at(-1),m=a?a(n,r):{id:`${n}-${c}`,kind:n,name:i({kind:n,n:r}),values:{...u?.values??{}}},f=u?e.indexOf(u)+1:"heading"===n?0:e.length;return{styles:[...e.slice(0,f),m,...e.slice(f)],added:m}}function R(e,n,t={}){const{name:s=({kind:e,n:n})=>E(e,n)}=t,i=e.find(e=>e.id===n);if(!i||D(i))return null;const a=e.filter(e=>e.kind===i.kind),l=a.indexOf(i),r=/* @__PURE__ */new Map;return a.forEach((e,n)=>{n>l&&e.name===s({kind:e.kind,n:n+1})&&r.set(e,s({kind:e.kind,n:n}))}),{styles:e.filter(e=>e!==i).map(e=>r.has(e)?{...e,name:r.get(e)}:e),removed:i}}function T(e,n){const t=e.find(e=>e.id===n);if(t)return t;for(const t of O){const s=B(n,t);if(void 0===s)continue;let i;for(const n of e){const e=n.kind===t?B(n.id,t):void 0;void 0!==e&&e<s&&(!i||e>i.n)&&(i={n:e,style:n})}return i?.style}}function Y(e,n,t){return e.map(e=>{if(e.id!==n)return e;const s={...e.values};for(const[e,n]of Object.entries(t))void 0===n?delete s[e]:s[e]=n;return{...e,values:s}})}function V(e){return Math.min(20,Math.max(12,Math.round(.5*e+6)))}function q(e,n){const t=n.weights;return[t.thin,t.extraLight,t.light,t.regular,t.medium,t.semibold,t.bold,t.extraBold,t.black][Math.min(8,Math.max(0,Math.round(e/100)-1))]}function P(e,n,t,s={}){const i=n.find(n=>n.value===e.font)?.label??e.font??"",a=void 0===e.size?s.autoSize?t.auto:"":t.px({n:e.size});return t.summary({font:i,size:a,weight:q(e.weight??400,t)})}var X=`conic-gradient(${[0,60,120,180,240,300,0].map(e=>o({h:e,s:1,v:1})).join(", ")})`;function Z({value:e,hex:n,colours:t,label:a,followsWord:l,anyWord:r,onChange:o,readOnly:u=!1}){const[v,g]=m(!1),k=f(null),y=f(null),b=h(),x=void 0!==e&&t.some(n=>n.key===e),w=void 0!==e&&!x;return p(()=>{if(!v)return;const e=k.current?.ownerDocument;if(!e)return;const n=e=>{k.current&&!k.current.contains(e.target)&&g(!1)};return e.addEventListener("click",n,!0),()=>e.removeEventListener("click",n,!0)},[v]),/* @__PURE__ */N("div",{ref:k,className:"es-ts-set","data-ts-setting":"color",children:[
|
|
2
2
|
/* @__PURE__ */N("div",{className:"es-ts-top",children:[
|
|
3
3
|
/* @__PURE__ */C("span",{className:"es-ts-sub",children:a}),
|
|
4
|
-
/* @__PURE__ */C("span",{className:"es-ts-colour-read",children:s
|
|
5
|
-
/* @__PURE__ */N("div",{className:"es-ts-swatches",role:"group","aria-label":a,children:[
|
|
6
|
-
/* @__PURE__ */C(d,{content:r,children:/* @__PURE__ */C(c,{ref:y,color:X,size:"sm",className:"es-ts-swatch es-ts-swatch--any","aria-label":r,selected:w,"aria-expanded":v,"aria-controls":v?b:void 0,disabled:u,onClick:()=>g(e=>!e)})})]}),v?/* @__PURE__ */C(
|
|
7
|
-
return C("div",{className:"es-ts",ref:Z,children:O.map(
|
|
4
|
+
/* @__PURE__ */C("span",{className:"es-ts-colour-read",children:n?s(n):l})]}),
|
|
5
|
+
/* @__PURE__ */N("div",{className:"es-ts-swatches",role:"group","aria-label":a,children:[t.map(n=>/* @__PURE__ */C(d,{content:`${n.name} · ${s(n.value)}`,children:/* @__PURE__ */C(c,{color:n.value,size:"sm",className:"es-ts-swatch","aria-label":n.name,selected:e===n.key,disabled:u,onClick:()=>o(n.key)})},n.key)),
|
|
6
|
+
/* @__PURE__ */C(d,{content:r,children:/* @__PURE__ */C(c,{ref:y,color:X,size:"sm",className:"es-ts-swatch es-ts-swatch--any","aria-label":r,selected:w,"aria-expanded":v,"aria-controls":v?b:void 0,disabled:u,onClick:()=>g(e=>!e)})})]}),v?/* @__PURE__ */C(i,{id:b,value:n??"",onChange:e=>o(e),label:a,readOnly:u,onClose:()=>{g(!1),y.current?.focus()}}):null]})}function _({styles:n,onChange:t,fonts:s,colours:i=[],settings:a=$,auto:o=[],fallback:d,sample:c,openId:u,defaultOpenId:y=null,onOpenChange:b,onAdd:x,rowActions:w,onRemove:S,max:M=A,readOnly:j=!1}){const F=l("textStyles",e),L=h(),[E,W]=m(y),B=void 0!==u?u:E,T=e=>{void 0===u&&W(e),b?.(e)},q=new Set(o),X=z.filter(e=>a.includes(e)),Z=f(null),[_,U]=m(null);p(()=>{if(!_||!Z.current)return;const e=[...Z.current.querySelectorAll(".es-ts-item")].find(e=>e.dataset.tsId===_.id),n=e?e.querySelector(".es-ts-row"):Z.current.querySelector(`.es-ts-add[data-ts-kind="${_.kind}"]`);n?.focus(),U(null)},[_]);/* @__PURE__ */
|
|
7
|
+
return C("div",{className:"es-ts",ref:Z,children:O.map(e=>{const a=n.filter(n=>n.kind===e),l=`${L}-${e}`,o=!H(n,e,M),u=!j&&!o;/* @__PURE__ */
|
|
8
8
|
return N("section",{className:"es-ts-section","aria-labelledby":l,children:[
|
|
9
|
-
/* @__PURE__ */C("div",{className:"es-ts-group",id:l,children:F.groups[
|
|
9
|
+
/* @__PURE__ */C("div",{className:"es-ts-group",id:l,children:F.groups[e]}),a.map(e=>{const a=B===e.id,l={...d?.(e)??{},...e.values},o=s.find(e=>e.value===l.font),u=`${L}-open-${e.id}`,m=w?.(e),f=null!=m&&!1!==m,h=Boolean(S)&&!j&&!D(e),p={fontFamily:o?.family,fontSize:`${V(l.size??16)}px`,fontWeight:l.weight,fontStyle:l.italic?"italic":void 0};/* @__PURE__ */
|
|
10
10
|
return N(v,{children:[
|
|
11
|
-
/* @__PURE__ */N("div",{className:"es-ts-item","data-ts-id":
|
|
12
|
-
/* @__PURE__ */N("button",{type:"button",className:"es-ts-row","aria-expanded":a,"aria-controls":a?u:void 0,onClick:()=>T(a?null:
|
|
11
|
+
/* @__PURE__ */N("div",{className:"es-ts-item","data-ts-id":e.id,children:[
|
|
12
|
+
/* @__PURE__ */N("button",{type:"button",className:"es-ts-row","aria-expanded":a,"aria-controls":a?u:void 0,onClick:()=>T(a?null:e.id),children:[
|
|
13
13
|
/* @__PURE__ */C("span",{className:"es-ts-chev","aria-hidden":"true",children:/* @__PURE__ */C(g,{size:12})}),
|
|
14
|
-
/* @__PURE__ */C("span",{className:"es-ts-name",style:p,children:
|
|
15
|
-
/* @__PURE__ */C("span",{className:"es-ts-meta",children:P(l,
|
|
16
|
-
/* @__PURE__ */C("span",{className:"es-ts-add-word",children:F.add[
|
|
17
|
-
/* @__PURE__ */C("span",{className:"es-ts-count",children:F.count({n:a.length,max:M})})]})),j||!o?null:/* @__PURE__ */C("span",{id:`${L}-full-${
|
|
18
|
-
return C("div",{className:"es-ts-slider","data-ts-setting":e,children:/* @__PURE__ */C(
|
|
14
|
+
/* @__PURE__ */C("span",{className:"es-ts-name",style:p,children:e.name}),
|
|
15
|
+
/* @__PURE__ */C("span",{className:"es-ts-meta",children:P(l,s,F,{autoSize:q.has("size")&&void 0===e.values.size})})]}),h||f?/* @__PURE__ */N("div",{className:"es-ts-actions",children:[h?r(F.remove,/* @__PURE__ */C("button",{type:"button",className:"es-ts-del","aria-label":F.removeNamed({name:e.name}),onClick:()=>(e=>{if(j||!S)return;const s=R(n,e.id,{name:F.styleName});if(!s)return;const i=n.filter(n=>n.kind===e.kind),a=i[i.indexOf(e)+1];B===e.id&&T(null),t(s.styles),S(s.removed),U({id:a?.id??null,kind:e.kind})})(e),children:/* @__PURE__ */C(k,{size:14,"aria-hidden":"true"})})):null,f?m:null]}):null]}),a?/* @__PURE__ */C("div",{className:"es-ts-open",id:u,children:/* @__PURE__ */C(K,{style:e,values:l,fonts:s,colours:i,settings:X,autoSet:q,sample:c??F.sample,words:F,readOnly:j,set:s=>t(Y(n,e.id,s))})}):null]},e.id)}),r(!j&&o?F.full({kind:e,max:M}):void 0,/* @__PURE__ */N("button",{type:"button",className:"es-ts-add","data-ts-kind":e,disabled:j,"aria-disabled":!(j||!o)||void 0,"aria-describedby":!j&&o?`${L}-full-${e}`:void 0,onClick:()=>{u&&(e=>{if(j)return;const s=I(n,e,{max:M,name:F.styleName,make:x});s&&t(s.styles)})(e)},children:[
|
|
16
|
+
/* @__PURE__ */C("span",{className:"es-ts-add-word",children:F.add[e]}),
|
|
17
|
+
/* @__PURE__ */C("span",{className:"es-ts-count",children:F.count({n:a.length,max:M})})]})),j||!o?null:/* @__PURE__ */C("span",{id:`${L}-full-${e}`,className:"es-vh",children:F.full({kind:e,max:M})})]},e)})})}var U={none:S,upper:w,lower:x},G={none:"none",upper:"uppercase",lower:"lowercase"};function K({style:e,values:n,fonts:s,colours:i,settings:l,autoSet:o,sample:d,words:c,readOnly:m,set:f}){const h=e.values,p=s.find(e=>e.value===n.font),v=function(e,n){return e?n.find(n=>n.key===e)?.value??a(e)??void 0:void 0}(n.color,i),g=e=>"largestSize"===e||o.has(e),k=e=>g(e)?h[e]:n[e],x=k("size"),w=k("lineSpacing"),S=k("letterSpacing"),z=g("letterCase")?h.letterCase:n.letterCase,$={fontFamily:p?.family,fontSize:void 0===x?void 0:`${x}px`,fontWeight:n.weight,fontStyle:n.italic?"italic":void 0,lineHeight:void 0===w?void 0:String(w/100),letterSpacing:void 0===S?void 0:`${S}px`,color:v,textTransform:z?G[z]:void 0},O=e=>{const s=L[e],i=g(e);/* @__PURE__ */
|
|
18
|
+
return C("div",{className:"es-ts-slider","data-ts-setting":e,children:/* @__PURE__ */C(t,{label:c.settings[e],value:h[e],onChange:n=>f({[e]:n}),min:s.min,max:s.max,step:s.step,shiftStep:s.shiftStep,sliderMin:s.sliderMin,sliderMax:s.sliderMax,unit:s.unit||void 0,styleValue:i?void 0:n[e],auto:i?c.auto:void 0,readOnly:m})},e)};/* @__PURE__ */
|
|
19
19
|
return N(M,{children:[
|
|
20
20
|
/* @__PURE__ */C("div",{className:"es-ts-preview",style:$,"aria-label":c.preview,children:d}),l.map(t=>{switch(t){case"font":/* @__PURE__ */
|
|
21
21
|
return C(J,{value:h.font,fonts:s,words:c,readOnly:m,set:f},t);case"color":/* @__PURE__ */
|
|
@@ -23,10 +23,10 @@ return C(Q,{value:h.color,hex:v,colours:i,words:c,readOnly:m,set:f},t);case"emph
|
|
|
23
23
|
return N("div",{className:"es-ts-set","data-ts-setting":t,children:[
|
|
24
24
|
/* @__PURE__ */C("span",{className:"es-ts-sub",children:c.settings.emphasis}),
|
|
25
25
|
/* @__PURE__ */N("div",{className:"es-ts-icons",children:[r(c.bold,/* @__PURE__ */C(u,{className:"es-ts-icon","aria-label":c.bold,"aria-pressed":e,disabled:m,onClick:()=>f({weight:e?400:700}),children:/* @__PURE__ */C(y,{size:16})})),m||s?r(c.italic,/* @__PURE__ */C(u,{className:"es-ts-icon","aria-label":c.italic,"aria-pressed":Boolean(n.italic),disabled:m,onClick:()=>f({italic:!n.italic||void 0}),children:/* @__PURE__ */C(b,{size:16})})):/* @__PURE__ */C(u,{className:"es-ts-icon","aria-label":c.italic,"aria-pressed":Boolean(n.italic),"aria-disabled":!0,disabledReason:c.italicMissing,children:/* @__PURE__ */C(b,{size:16})})]})]},t)}case"letterCase":/* @__PURE__ */
|
|
26
|
-
return C(ee,{value:h.letterCase??n.letterCase,auto:g("letterCase"),words:c,readOnly:m,set:f},t);case"largestSize":return"heading"===e.kind?O(t):null;default:return O(t)}})]})}function J({value:e,fonts:
|
|
26
|
+
return C(ee,{value:h.letterCase??n.letterCase,auto:g("letterCase"),words:c,readOnly:m,set:f},t);case"largestSize":return"heading"===e.kind?O(t):null;default:return O(t)}})]})}function J({value:e,fonts:t,words:s,readOnly:i,set:a}){const l=h();/* @__PURE__ */
|
|
27
27
|
return N("div",{className:"es-ts-set","data-ts-setting":"font",children:[
|
|
28
|
-
/* @__PURE__ */C("span",{className:"es-ts-sub",id:l,children:
|
|
29
|
-
/* @__PURE__ */C(
|
|
28
|
+
/* @__PURE__ */C("span",{className:"es-ts-sub",id:l,children:s.settings.font}),
|
|
29
|
+
/* @__PURE__ */C(n,{value:e,options:t.map(e=>({label:e.label,value:e.value})),onChange:e=>a({font:e}),ariaLabelledBy:l,readOnly:i})]})}function Q({value:e,hex:n,colours:t,words:s,readOnly:i,set:a}){/* @__PURE__ */
|
|
30
30
|
return C(Z,{value:e,hex:n,colours:t,label:s.settings.color,followsWord:s.colour.follows,anyWord:s.colour.any,readOnly:i,onChange:e=>a({color:e})})}function ee({value:e,auto:n,words:t,readOnly:s,set:i}){const a=n?["auto","none","upper","lower"]:["none","upper","lower"],l=e??(n?"auto":"none"),o=f([]),d=e=>i({letterCase:"auto"===e?void 0:e});/* @__PURE__ */
|
|
31
31
|
return N("div",{className:"es-ts-set","data-ts-setting":"letterCase",children:[
|
|
32
32
|
/* @__PURE__ */C("span",{className:"es-ts-sub",children:t.settings.letterCase}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-easel",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.4.0",
|
|
4
4
|
"description": "Efficient Easel: the EFFICIENT editors' shared engine and chrome: the saved document as pure functions, the published renderer, and the editor frame, panels, Layers tree, text grammar and type-in-place box. Published as editor-shell up to 0.66.0 and as efficient-editor up to 0.95.0.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Efficient Pty Ltd",
|
package/dist/chunk-2DHJC5YS.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{blockTypesIn as e}from"./chunk-5ZBY24K7.js";import{buildPaletteSections as t,pinnedSection as o,paletteWithoutPinned as n,categoryLabel as i}from"./chunk-PA3PNTVV.js";import{sectionTemplatesOf as s}from"./chunk-BVN33R76.js";import{SidePanelHead as r,PanelModeExit as c}from"./chunk-PFNIVZPN.js";import{useEaselSession as l}from"./chunk-O7Q4DDJT.js";import{blockRuns as a}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as p,useScreenBlockRules as m}from"./chunk-YFK74XOM.js";import{DEFAULT_SCREEN_WORDS as d}from"./chunk-MCHMF32I.js";import{useEasel as f}from"./chunk-4XIIBGDO.js";import{useWords as u}from"./chunk-MFIRYGHW.js";import{AddPanel as k}from"./chunk-MOCX5MQ7.js";import{DEFAULT_DRAG_WORDS as h}from"./chunk-O2NLQBFX.js";import{useState as y,useEffect as b,useMemo as j}from"react";import{AddIcon as g}from"efficient-shell/icons/efficient";import{jsx as O,jsxs as $,Fragment as B}from"react/jsx-runtime";var I=e=>`section:${e}`,v=e=>`block:${e}`,F=e=>`template:${e}`;function N({blocks:N,blocksOnly:x,at:M,onAdd:V,itemFor:C,session:H,siteWide:L,onClose:A,onHide:D,readOnly:P}){const Q=f(e=>e.config),X=p(),{labelAtLevel:w,categoryLabel:R,firstSection:T,Icon:Y,Thumbnail:z}=X,{blockIsOffered:G}=m(),K=u("screen",d).add,S=u("drag",h).add,W=l(),[Z,E]=y([]);b(()=>{let t=!1;const o=e=>G(e,W);return s(W).list().then(n=>{if(t)return;const i=Q.components;E(n.filter(t=>t.node?.type&&i[t.node.type]&&e(t.node).every(o)))}).catch(()=>{}),()=>{t=!0}},[Q,W]);const J=j(()=>t(Q,X),[Q]),q=e=>({type:I(e.type),label:e.name,cover:/* @__PURE__ */O(z,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:K.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),U=j(()=>{const e=[];if(N&&N.choices.length>0&&a(N.choices).forEach((t,o)=>{e.push({key:`blocks:${o}`,title:0===o?`${K.inside({name:N.parentName})}${t.group?` · ${t.group}`:""}`:t.group??"",tiles:t.items.map(e=>({type:v(e.type),label:e.label,icon:/* @__PURE__ */O(Y,{type:e.type,size:18}),title:K.tile({name:e.label})}))})}),x)return e;const t=o(J,T);t&&e.push({key:"start",title:K.startBlank,tiles:[q(t)]}),Z.length>0&&e.push({key:"templates",title:K.templates,tiles:Z.map(e=>{return{type:F(e.id),label:e.name,cover:/* @__PURE__ */O(z,{type:e.node.type}),keywords:[(t=e.node.type,w(t,"section",Q.components[t]?.label??t)),e.node.type]};var t})});const s=n(J,T);for(const t of Object.keys(Q.categories??{})){const o=s.filter(e=>e.cat===t);0!==o.length&&e.push({key:`category:${t}`,title:i(Q,t,R),tiles:o.map(q)})}return e},[N,x,Z,J,Q,K]),_=e=>{const t=e.indexOf(":"),o=e.slice(0,t),n=e.slice(t+1);if("section"===o)return{kind:"section",type:n};if("block"===o)return{kind:"block",type:n};if("template"===o){const e=Z.find(e=>e.id===n);return e?{kind:"template",template:e}:null}return null};/* @__PURE__ */
|
|
2
|
-
return $(B,{children:[
|
|
3
|
-
/* @__PURE__ */O(r,{icon:/* @__PURE__ */O(g,{size:15}),title:K.title,context:x?K.contextBlocks:K.contextAll,actions:/* @__PURE__ */O(c,{label:K.done,description:K.doneDescription,onClick:A}),onHide:D}),
|
|
4
|
-
/* @__PURE__ */$("div",{className:"sf-addside sf-scroll",children:[
|
|
5
|
-
/* @__PURE__ */O(k,{groups:U,session:H,itemFor:e=>C(_(e)??{kind:"section",type:e}),onInsert:e=>{const t=_(e);t&&V(t)},at:M,hint:x?K.hintBlocks:K.hint,searchLabel:x?K.searchBlocks:K.searchSections,readOnly:P,words:S}),L&&!x?L:null]})]})}export{N as AddSidePanel,v as blockKey,I as sectionKey,F as templateKey};
|
package/dist/chunk-4XIIBGDO.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{DEFAULT_CANVAS_WORDS as e}from"./chunk-AELNNAFM.js";import{useResolvedFields as t}from"./chunk-YRLPFZW3.js";import{toItemSelector as n,fromItemSelector as o,useNodeOps as r,parentStep as i,clickPick as a}from"./chunk-UK2FQOUT.js";import{useWords as s}from"./chunk-MFIRYGHW.js";import{setCanvasNonce as d,isTypingTarget as l}from"./chunk-ZNCEOSXO.js";import{find as c,ROOT_ID as u,getList as p,remove as f,parseZoneKey as h,move as m,duplicate as v,replaceNode as y,createNode as g,insert as k,normalizeData as w,createResolveCache as S,resolveNodeData as b,ROOT_SLOT as I}from"./chunk-KRXQM65X.js";import{topLevelSlotKeys as E,fieldsFrom as C,defaultsFrom as O}from"./chunk-NKB3KVAB.js";import{createContext as x,useEffect as A,useContext as D,useRef as z,useSyncExternalStore as M,useState as Z,useMemo as N,useCallback as $,useLayoutEffect as j}from"react";import{jsx as P,jsxs as L}from"react/jsx-runtime";import{createPortal as R}from"react-dom";function B(e){return!["setData","setUi","set"].includes(e.type)}var K=(e,t,n,o)=>{const r=p(e,t,h(n));return r?.[o]??null},F=(e,t,n,o,r)=>{const i=K(e,t,n,o);if(!i)throw new Error(`${r}: nothing at ${n}[${o}]`);return i};function V(e,t){const{selection:o}=e;return{...e.ui,itemSelector:n(e.data,t,o),selectedSlot:o&&"slot"===o.kind?{parentId:o.parentId,slot:o.slot}:null}}function H(e,t,n){return n?"node"===n.kind?c(e,t,n.id)?n:null:n.parentId===u?p(e,t,n)?n:null:c(e,t,n.parentId)&&p(e,t,n)?n:null:null}function T(e,t,n,r=!1){const{itemSelector:i,selectedSlot:a,...s}=n;let d=e.selection;var l;return"itemSelector"in n&&(d=o(e.data,t,i??null)),"selectedSlot"in n&&(a?d=(l=a)?{kind:"slot",parentId:l.parentId,slot:l.slot}:null:"slot"===d?.kind&&(d=null)),{...e,selection:d,ui:r?s:{...e.ui,...s}}}function U(e,t,n){const o=q(e,t,n);if(o===e)return e;const r=H(o.data,n,o.selection);return r===o.selection?o:{...o,selection:r}}function q(e,t,n){const{data:o}=e;switch(t.type){case"setData":{const n="function"==typeof t.data?t.data(o):t.data;return{...e,data:{...o,...n}}}case"setUi":return T(e,n,"function"==typeof t.ui?t.ui(V(e,n)):t.ui);case"set":{const r={data:o,ui:V(e,n)},i="function"==typeof t.state?t.state(r):t.state;let a=i.data?{...e,data:i.data}:e;return i.ui&&(a=T(a,n,i.ui,!0)),a}case"insert":{const r={...h(t.destinationZone),index:t.destinationIndex},i=g(n,t.componentType,{},t.id?{id:t.id}:{});return{...e,data:k(o,n,r,i)}}case"replace":{const r=F(o,n,t.destinationZone,t.destinationIndex,"replace");if(r.props.id!==t.data.props.id)throw new Error("Can't change the id during a replace action. Use remove and insert for a new node.");return{...e,data:y(o,n,r.props.id,t.data)}}case"replaceRoot":{const n={...o.root,props:{...o.root.props,...t.root.props},readOnly:t.root.readOnly};return{...e,data:{...o,root:n}}}case"duplicate":{const r=F(o,n,t.sourceZone,t.sourceIndex,"duplicate"),i=v(o,n,r.props.id),a=K(i,n,t.sourceZone,t.sourceIndex+1);return{...e,data:i,selection:a?{kind:"node",id:a.props.id}:e.selection}}case"reorder":return q(e,{...t,type:"move",sourceZone:t.destinationZone},n);case"move":{if(t.sourceZone===t.destinationZone&&t.sourceIndex===t.destinationIndex)return e;const r=K(o,n,t.sourceZone,t.sourceIndex);if(!r)return e;const i={...h(t.destinationZone),index:t.destinationIndex};return{...e,data:m(o,n,r.props.id,i)}}case"remove":{const r=F(o,n,t.zone,t.index,"remove");return{...e,data:f(o,n,r.props.id)}}default:return e}}var W={drag:!0,duplicate:!0,delete:!0,edit:!0,insert:!0},Y={leftSideBarVisible:!0,rightSideBarVisible:!0,arrayState:{},componentList:{},isDragging:!1,previewMode:"edit",viewports:{current:{width:360,height:"auto"},options:[],controlsVisible:!0},field:{focus:null}},X=0,Q=()=>`history-${X+=1}`;function G(e){let t=e.config;const r=e.now??(()=>Date.now()),i=e.historyCoalesceMs??250;let a=e.permissions??{};const s=w(e.data,t);let d={data:s,selection:null,ui:{...Y}};if(e.ui){const{itemSelector:n,selectedSlot:r,...i}=e.ui;d={data:s,selection:r?{kind:"slot",...r}:o(s,t,n??null),ui:{...Y,...i}}}let l=[{core:d,at:-1/0,sealed:!0,id:Q()}],u=0;const f=e=>{const t=l[u],n=r();!e&&u===l.length-1&&u>0&&!t.sealed&&n-t.at<i?l=[...l.slice(0,u),{...t,core:d,at:n}]:(l=[...l.slice(0,u+1),{core:d,at:n,sealed:e,id:Q()}],u=l.length-1)},h=/* @__PURE__ */new Set;let m=null,v=null,g=0,k=null,I=!1;const E=()=>{for(const e of[...h])e()},C=()=>{l=[...l.slice(0,u),{...l[u],core:d},...l.slice(u+1)]},O=(t,n)=>{g>0?I=I||n:(n?f(!1):d!==t&&C(),d.data!==t.data&&e.onChange?.(d.data),d!==t&&E())},x=e=>{const n=d;if(d=U(d,e,t),d===n)return;const o=e.recordHistory??B(e);O(n,o&&d.data!==n.data)},A=t=>{0===g&&(k=d,I=!1),g+=1;try{t()}catch(e){throw g-=1,0===g&&k&&(d=k,k=null),e}if(g-=1,g>0||!k)return;const n=k;k=null,I&&d.data!==n.data?f(!0):d!==n&&C(),d.data!==n.data&&e.onChange?.(d.data),d!==n&&E()},D=e=>{const n=d,o=H(d.data,t,e);var r,i;(r=o,i=d.selection,r===i||r&&i&&r.kind===i.kind&&("node"===r.kind&&"node"===i.kind?r.id===i.id:"slot"===r.kind&&"slot"===i.kind&&r.parentId===i.parentId&&r.slot===i.slot))||(d={...d,selection:o},O(n,!1))},z=t=>{const n=d;u=t,d=l[u].core,d.data!==n.data&&e.onChange?.(d.data),d!==n&&E()},M=()=>(e={})=>{const n=e.root?t.root?.permissions:t.components[e.item?.type??e.type??""]?.permissions;return{...W,...a,...n}};let Z=M();const N=S(),$={resolveCache:N,async resolveAll({trigger:e="load",metadata:n}={}){const o=d.data,r={type:"root",props:{...o.root.props??{}}},i=[...o.content,...Object.values(o.zones??{}).flat()],[a,...s]=await Promise.all([b(r,t,{cache:N,trigger:e,metadata:n}),...i.map(o=>b(o,t,{cache:N,trigger:e,metadata:n}))]);A(()=>{const e=d;let n=d.data;s.forEach((e,r)=>{if(!e.didChange)return;const a=i[r].props.id,s=c(n,t,a)?.node;s&&s===c(o,t,a)?.node&&(n=y(n,t,a,e.node))}),a.didChange&&n.root===o.root&&(n={...n,root:{...n.root,props:a.node.props,readOnly:a.node.readOnly??n.root.readOnly}}),n!==d.data&&(d={...d,data:n,selection:H(n,t,d.selection)},O(e,!1))})},async resolveNode(e,{trigger:n="replace",metadata:o}={}){const r=c(d.data,t,e)?.node;if(!r)return!1;const i=await b(r,t,{cache:N,trigger:n,metadata:o});if(!i.didChange)return!1;let a=!1;return A(()=>{const n=d;if(c(d.data,t,e)?.node!==r)return;const o=y(d.data,t,e,i.node);o!==d.data&&(d={...d,data:o,selection:H(o,t,d.selection)},O(n,!1),a=!0)}),a},get config(){return t},getState(){if(m&&v===d)return m;const e=d,o={data:e.data,ui:V(e,t)},r="node"===e.selection?.kind?c(e.data,t,e.selection.id)?.node??null:null;return m={appState:o,selection:e.selection,selectedItem:r,config:t,dispatch:x,history:{back:()=>$.undo(),forward:()=>$.redo(),hasPast:u>0,hasFuture:u<l.length-1,histories:l.map(e=>({id:e.id,state:{data:e.core.data,ui:V(e.core,t)}})),index:u,setHistoryIndex:e=>{e>=0&&e<l.length&&e!==u&&z(e)}},getPermissions:Z,getItemById:n=>c(e.data,t,n)?.node,getItemBySelector:n=>function(e,t,n){const[o,r]=(n.zone??"root:default-zone").split(/:(.*)/s);return p(e,t,{parentId:o,slot:r})?.[n.index]}(e.data,t,n),getSelectorForId:o=>{const r=n(e.data,t,{kind:"node",id:o});return r?{index:r.index,zone:r.zone??"root:default-zone"}:void 0}},v=e,m},subscribe:e=>(h.add(e),()=>{h.delete(e)}),dispatch:x,batch:A,group:()=>{const e=u,t=l[e].id;let n=!0;return{close:()=>{if(!n)return;if(n=!1,l[e]?.id!==t)return;if(u<=e+1)return void(u===e+1&&(l=[...l.slice(0,u),{...l[u],sealed:!0},...l.slice(u+1)]));const o=l[u];l=[...l.slice(0,e+1),{...o,sealed:!0},...l.slice(u+1)],u=e+1}}},select:e=>D(e?{kind:"node",id:e}:null),selectSlot:e=>D(e?{kind:"slot",parentId:e.parentId,slot:e.slot}:null),run(e){A(()=>{const n=d,o=void 0===e.select?d.selection:e.select;d={...d,data:e.data,selection:H(e.data,t,o)},O(n,e.data!==n.data)})},load(e,n={}){const o=d,r=w(e,t);d={...d,data:r,selection:H(r,t,n.selection??d.selection)},n.keepHistory||(l=[{core:d,at:-1/0,sealed:!0,id:Q()}],u=0),d!==o&&E()},undo(){u>0&&z(u-1)},redo(){u<l.length-1&&z(u+1)},setPermissions(e){(function(e,t){if(e===t)return!0;const n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>e[n]===t[n])})(e,a)||(a=e,Z=M(),m=null,E())},setConfig(e){e!==t&&(t=e,Z=M(),m=null,E())}};return $}function J(e,t,n={}){const o=e=>{if(e.altKey)return;if(!(e.metaKey!==e.ctrlKey))return;const o="KeyZ"===e.code,r="KeyY"===e.code&&!e.shiftKey;(o||r)&&(n.leaveTyping&&l(e.target)||!1!==t.getState?.().getPermissions().edit&&(e.preventDefault(),r||e.shiftKey?t.redo():t.undo()))};return e.addEventListener("keydown",o),()=>e.removeEventListener("keydown",o)}var _=x(null),ee=x(!0);function te({easel:e,hotkeys:t=!0,resolveOnMount:n=!0,children:o}){return A(()=>{n&&e.resolveAll()},[e,n]),A(()=>{if(t&&"undefined"!=typeof document)return J(document,e)},[e,t]),/* @__PURE__ */P(_.Provider,{value:e,children:/* @__PURE__ */P(ee.Provider,{value:t,children:o})})}function ne(){const e=D(_);if(!e)throw new Error("useEasel: no <EaselProvider> above this component");return e}function oe(e){const t=ne(),n=z({view:null,selector:null,value:void 0,has:!1}),o=()=>{const o=t.getState(),r=n.current;if(r.has&&r.view===o&&r.selector===e)return r.value;const i=e(o);return r.has&&Object.is(r.value,i)?(n.current={view:o,selector:e,value:r.value,has:!0},r.value):(n.current={view:o,selector:e,value:i,has:!0},i)};return M(t.subscribe,o,o)}function re(){return function(e){return oe(e)}}var ie="data-puck-component",ae="data-puck-dropzone",se={},de="data-es-mirror",le="undefined"==typeof window?A:j;function ce(e,t,n){for(const e of Array.from(t.head.querySelectorAll(`[${de}]`)))e.remove();for(const o of Array.from(e.head.querySelectorAll('style, link[rel="stylesheet"]'))){const e=o.cloneNode(!0);e.setAttribute(de,""),n&&e.setAttribute("nonce",n),t.head.appendChild(e)}}function ue({children:t,id:n="preview-frame",title:o,className:r,style:i,mirrorStyles:a=!0,onDocument:l,height:c="auto",nonce:u}){const p=s("canvas",e),f=z(null),[h,m]=Z(null);return le(()=>{const e=f.current,t=h?.ownerDocument.defaultView;if("auto"!==c||!e||!h||!t)return;const n=()=>{e.style.height=`${Math.ceil(h.getBoundingClientRect().height)}px`};n();const o=t.ResizeObserver,r=o?new o(n):null;return r?.observe(h),()=>r?.disconnect()},[h,c]),le(()=>{let e=f.current?.contentDocument;if(!e)return;"CSS1Compat"!==e.compatMode&&(e.open(),e.write("<!DOCTYPE html><html><head></head><body></body></html>"),e.close(),e=f.current?.contentDocument??e),e.body||e.documentElement.appendChild(e.createElement("body")),e.body.style.margin="0";const t=e.createElement("div");t.setAttribute("data-puck-entry",""),t.id="frame-root","fill"===c&&t.classList.add("es-frame-fill"),e.body.appendChild(t),d(e,u),m(t),l?.(e);let n=null;const o=f.current?.ownerDocument;if(a&&o){ce(o,e,u);const t=o.defaultView;t&&"MutationObserver"in t&&(n=new t.MutationObserver(()=>ce(o,e,u)),n.observe(o.head,{childList:!0,subtree:!0,characterData:!0}))}return()=>{n?.disconnect(),t.remove(),m(null),l?.(null)}},[]),/* @__PURE__ */P("iframe",{ref:f,id:n,title:o??p.frame,className:["es-canvas-frame","fill"===c?"is-fill":"",r??""].filter(Boolean).join(" "),style:i,children:h?R(t,h):null})}var pe=x(null),fe=x(se),he=[];function me({parentId:e,slot:t,className:n,style:o,minEmptyHeight:r=128,minEmptyWidth:i=120}){const a=ne(),s=oe(n=>p(n.appState.data,a.config,{parentId:e,slot:t})??he),d=oe(t=>"node"===t.selection?.kind&&t.selection.id===e&&e!==u),l=oe(n=>"slot"===n.selection?.kind&&n.selection.parentId===e&&n.selection.slot===t),c=D(pe),f=["es-zone"];return s.length&&f.push("has-children"),e===u&&f.push("is-root"),(d||l)&&f.push("is-area-selected"),null!==c&&c===e&&e!==u&&f.push("is-hovering-area"),n&&f.push(n),/* @__PURE__ */P("div",{className:f.join(" "),[ae]:`${e}:${t}`,style:{...o,"--min-empty-height":`${r}px`,"--min-empty-width":`${i}px`},children:s.map(e=>/* @__PURE__ */P(ge,{node:e},e.props.id))})}function ve(e,t,n,o){const r="root"===t?e.root:e.components[t],i={...o};for(const e of E(C(r)))i[e]=function(t={}){/* @__PURE__ */
|
|
2
|
-
return P(me,{parentId:n,slot:e,...t})};return i}function ye(e){return function({zone:t,...n}){/* @__PURE__ */
|
|
3
|
-
return P(me,{parentId:e,slot:t,...n})}}function ge({node:e}){const t=ne().config,n=t.components[e.type],o=e.props.id,r=function(e){const t=z(null);return N(()=>n=>{const o=t.current;o&&o!==n&&(o.removeAttribute(ie),o.removeAttribute("data-puck-dnd")),t.current=n,n&&(n.setAttribute(ie,e),n.setAttribute("data-puck-dnd",e),n.style.position="relative")},[e])}(o),i=D(fe);if(!n?.render)return null;const a=n.render,s=ve(t,e.type,o,{...O(n),...e.props}),d={renderDropZone:ye(o),isEditing:!0,dragRef:n.inline?r:null,metadata:{...i,...n.metadata}};return n.inline?/* @__PURE__ */P(a,{...s,puck:d,editMode:!0}):/* @__PURE__ */P("div",{[ie]:o,"data-puck-dnd":o,style:{position:"relative"},children:/* @__PURE__ */P(a,{...s,puck:d,editMode:!0})})}function ke({metadata:e}){const t=oe(e=>e.config),n=oe(e=>e.appState.data.root).props??{},o=t.root?.render,r=/* @__PURE__ */P(me,{parentId:u,slot:I}),i=o?/* @__PURE__ */P(o,{id:"puck-root",...ve(t,"root",u,n),puck:{renderDropZone:ye(u),isEditing:!0,dragRef:null,metadata:e??{}},editMode:!0,children:r}):r;/* @__PURE__ */
|
|
4
|
-
return P(fe.Provider,{value:e??se,children:i})}function we({id:e,kind:t,overlay:n}){const o=z(null),[r,i]=Z(null);le(()=>{const t=o.current?.ownerDocument,n=t?.defaultView;if(!t||!n||!e)return void i(null);let r=0;const a=()=>{r=0;const a=function(e,t){if(!e||!t)return null;const n=e.getBoundingClientRect(),o=t.getBoundingClientRect();return{top:n.top-o.top,left:n.left-o.left,width:n.width,height:n.height}}(t.querySelector(`[${ie}="${n.CSS?.escape?n.CSS.escape(e):e}"]`),o.current?.parentElement??null);i(e=>{return(t=e)===(n=a)||t&&n&&t.top===n.top&&t.left===n.left&&t.width===n.width&&t.height===n.height?e:a;var t,n})},s=()=>{r||(r=(n.requestAnimationFrame??(e=>n.setTimeout(e,16)))(a))};a();const d="MutationObserver"in n?new n.MutationObserver(s):null;d?.observe(t.body,{childList:!0,subtree:!0,attributes:!0,characterData:!0});const l="ResizeObserver"in n?new n.ResizeObserver(s):null;return l?.observe(t.documentElement),n.addEventListener("resize",s),()=>{d?.disconnect(),l?.disconnect(),n.removeEventListener("resize",s),r&&(n.cancelAnimationFrame??n.clearTimeout)(r)}},[e]);const a=/* @__PURE__ */P("div",{ref:o,"aria-hidden":"true",className:`es-canvas-outline is-${t}`,style:r?{position:"absolute",top:r.top,left:r.left,width:r.width,height:r.height}:{display:"none"}});return n&&e?/* @__PURE__ */P(n,{componentId:e,kind:t,children:a}):a}function Se({frame:e=!0,className:t,style:n,metadata:o,mirrorStyles:r,onDocument:s,height:d,title:l,nonce:c,hotkeys:u,frameWrapper:p,overlay:f,children:h}){const m=ne(),v=D(ee),y=u??v,[g,k]=Z(void 0),w=oe(e=>"node"===e.selection?.kind?e.selection.id:null),[S,b]=Z(null),I=e=>{const t=e.closest?.(`[${ie}]`)?.getAttribute(ie);if(!t)return;const n=m.getState(),o="node"===n.selection?.kind?n.selection.id:null;return a(n.appState.data,m.config,t,o)??t},E=/* @__PURE__ */L("div",{className:"es-canvas-content",style:{position:"relative"},onClick:e=>{const t=e.target;t.closest?.("a[href]")&&e.preventDefault();const n=I(t);void 0===n?t.hasAttribute?.(ae)||m.select(null):m.select(n)},onMouseOver:e=>{const t=I(e.target)??null;t!==S&&b(t)},onMouseLeave:()=>b(null),children:[
|
|
5
|
-
/* @__PURE__ */P(pe.Provider,{value:S,children:/* @__PURE__ */P(ke,{metadata:o})}),
|
|
6
|
-
/* @__PURE__ */L("div",{className:"es-canvas-outlines",style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:[
|
|
7
|
-
/* @__PURE__ */P(we,{id:S&&S!==w?S:null,kind:"hover",overlay:f}),
|
|
8
|
-
/* @__PURE__ */P(we,{id:w,kind:"selected",overlay:f})]}),h]}),C=p?/* @__PURE__ */P(p,{document:g,children:E}):E;A(()=>{if(g&&y)return J(g,m)},[g,y,m]),A(()=>{if(!g)return;const e=e=>{if("Escape"!==e.key||e.defaultPrevented)return;const t=e.target;if(t?.isContentEditable||t?.closest?.("input, textarea, select"))return;const n=m.getState();if("node"!==n.selection?.kind)return;const o=i(n.appState.data,m.config,n.selection);"node"===o?.kind&&m.select(o.id)};return g.addEventListener("keydown",e),()=>g.removeEventListener("keydown",e)},[g,m]);/* @__PURE__ */
|
|
9
|
-
return P("div",{className:"es-canvas"+(t?` ${t}`:""),style:n,"data-puck-preview":"",children:e?/* @__PURE__ */P(ue,{mirrorStyles:r,onDocument:e=>{k(e??void 0),s?.(e)},height:d,title:l,nonce:c,children:C}):/* @__PURE__ */P("div",{id:"preview-frame","data-puck-entry":"",children:C})})}function be(e={}){const t=ne(),n=oe(e=>e.appState.data);return r({...e,data:n,config:t.config,commit:(e,{select:n})=>t.run({data:e,select:n})})}function Ie(){const e=ne(),n=oe(e=>e.config),o=e.resolveCache,r=oe(e=>e.selectedItem),i=oe(e=>e.appState.data.root),a=r?r.props.id:"root",s=i.props??{},d=N(()=>r||{type:"root",props:s},[r,s]),l=r?n.components[r.type]:n.root,u=e.getState(),p=r?c(u.appState.data,n,a):null,f=p&&"root"!==p.place.parentId?p.place.parentId:null,h=f?u.getItemById(f)??null:null,{fields:m}=t({id:a,node:d,block:l,parent:h,appState:u.appState}),v=oe(e=>!1===e.getPermissions(r?{item:r}:{root:!0}).edit),y=$((t,r)=>{(async()=>{const i=e.getState();if("root"!==a){const s=i.getItemById(a),d=i.getSelectorForId(a);if(!s||!d)return;const l={...s,props:{...s.props,[t]:r}},{node:c}=await b(l,n,{cache:o,trigger:"replace"}),u=e.getState().getSelectorForId(a);if(!u)return;return void e.dispatch({type:"replace",destinationZone:u.zone??"root:default-zone",destinationIndex:u.index,data:c})}const s=i.appState.data.root.props??{},{node:d}=await b({type:"root",props:{...s,[t]:r}},n,{cache:o,trigger:"replace"});e.dispatch({type:"replaceRoot",root:{props:d.props,readOnly:d.readOnly},recordHistory:!0})})()},[e,n,o,a]);return{id:a,node:d,fields:m,values:d.props,readOnly:v,onChange:y}}export{ue as CanvasFrame,Y as DEFAULT_UI,Se as EaselCanvas,te as EaselProvider,ke as EditDocument,J as bindUndoKeys,G as createEasel,re as createUseEasel,B as recordsByDefault,U as reduce,V as uiView,oe as useEasel,ne as useEaselApi,be as useEaselNodeOps,Ie as useSelectedFields,H as validSelection};
|