efficient-easel 27.2.0 → 27.3.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/{AddSidePanel-DoCx-ZrM.d.ts → AddSidePanel-DwfZOS5C.d.ts} +11 -3
- package/dist/blocks/index.d.ts +1 -1
- package/dist/{canvas-typing-CD1aeYnk.d.ts → canvas-typing-B33ssbpU.d.ts} +22 -3
- package/dist/chunk-2DFSODES.js +1 -0
- package/dist/{chunk-I4Z75MCX.js → chunk-2ODVRWRM.js} +1 -1
- package/dist/{chunk-SR2535CN.js → chunk-36AWYQLN.js} +17 -17
- package/dist/{chunk-JI7GUM3C.js → chunk-4JPAVKV6.js} +1 -1
- package/dist/{chunk-ZSP4ZAQ2.js → chunk-7WONGRN3.js} +40 -40
- package/dist/chunk-AI5IQV4A.js +2 -0
- package/dist/chunk-BDYS3UAD.js +5 -0
- package/dist/{chunk-3RGHXL5V.js → chunk-DFLPDOZF.js} +1 -1
- package/dist/chunk-IHYRYSP2.js +7 -0
- package/dist/chunk-JEKFHCKS.js +8 -0
- package/dist/{chunk-XGTO4LHI.js → chunk-JNNBGI6Y.js} +1 -1
- package/dist/chunk-KRONK73U.js +1 -0
- package/dist/{chunk-HGTDDSFJ.js → chunk-NMLAW6FI.js} +17 -17
- package/dist/chunk-OHHODU7N.js +26 -0
- package/dist/{chunk-MMHYTIUY.js → chunk-PMDIDRDB.js} +4 -4
- package/dist/{chunk-DQSRGKSM.js → chunk-SEC6NV6Y.js} +4 -4
- package/dist/{chunk-2Y4CAWZQ.js → chunk-TWXA55SR.js} +3 -3
- package/dist/chunk-WW24O7HT.js +1 -0
- package/dist/chunk-XT75WETI.js +1 -0
- package/dist/copy/index.d.ts +3 -3
- package/dist/copy/index.js +29 -29
- package/dist/data/index.d.ts +1 -1
- package/dist/drag/index.js +1 -1
- package/dist/easel/index.d.ts +10 -2
- package/dist/easel/index.js +1 -1
- package/dist/fields/index.d.ts +1 -1
- package/dist/fields/index.js +1 -1
- package/dist/panel/index.d.ts +5 -0
- package/dist/panel/index.js +1 -1
- package/dist/{phone-order-CRKvsTsz.d.ts → phone-order-BCM_f8A1.d.ts} +7 -1
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddSidePanel.d.ts +2 -2
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/NodeContextMenu.d.ts +2 -2
- package/dist/screen/components/NodeContextMenu.js +1 -1
- package/dist/screen/components/SaveControls.d.ts +2 -2
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenDocumentContext.d.ts +1 -1
- package/dist/screen/components/ScreenMount.d.ts +2 -2
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.d.ts +2 -2
- package/dist/screen/components/ScreenStoreProvider.js +1 -1
- package/dist/screen/components/SectionScreenShell.js +16 -16
- package/dist/screen/components/usePartBridge.d.ts +2 -2
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.d.ts +2 -2
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/admin-bridge.d.ts +1 -1
- package/dist/screen/lib/document/add-target-types.d.ts +2 -2
- package/dist/screen/lib/document/block-set-host.js +1 -1
- package/dist/screen/lib/document/block-size-fields.d.ts +1 -1
- package/dist/screen/lib/document/block-size-fields.js +1 -1
- package/dist/screen/lib/document/box-fields.d.ts +1 -1
- package/dist/screen/lib/document/box-fields.js +1 -1
- package/dist/screen/lib/document/button-fields.d.ts +1 -1
- package/dist/screen/lib/document/button-fields.js +1 -1
- package/dist/screen/lib/document/image-fields.d.ts +1 -1
- package/dist/screen/lib/document/image-fields.js +4 -4
- package/dist/screen/lib/document/new-child.d.ts +2 -2
- package/dist/screen/lib/document/palette-sections.d.ts +2 -2
- package/dist/screen/lib/document/section-doc.d.ts +1 -1
- package/dist/screen/lib/document/shadow-fields.d.ts +1 -1
- package/dist/screen/lib/document/shadow-fields.js +2 -2
- package/dist/screen/lib/document/slot-section-spec.d.ts +2 -2
- package/dist/screen/lib/document/style-clipboard.d.ts +2 -2
- package/dist/screen/lib/document/style-clipboard.js +1 -1
- package/dist/screen/lib/document/style-fields.d.ts +1 -1
- package/dist/screen/lib/document/style-fields.js +1 -1
- package/dist/screen/lib/document/use-section-ops.d.ts +37 -3
- package/dist/screen/lib/document/use-section-ops.js +1 -1
- package/dist/screen/lib/document-addressing.d.ts +1 -1
- package/dist/screen/lib/document-hooks.d.ts +1 -1
- package/dist/screen/lib/host.d.ts +1 -1
- package/dist/screen/lib/key-scope.js +1 -1
- package/dist/screen/lib/media-panel.d.ts +1 -1
- package/dist/screen/lib/media-picker.d.ts +1 -1
- package/dist/screen/lib/page-lock.d.ts +1 -1
- package/dist/screen/lib/screen-parts.d.ts +2 -2
- package/dist/screen/lib/screen-parts.js +1 -1
- package/dist/screen/lib/section-templates.d.ts +1 -1
- package/dist/screen/lib/session-context.d.ts +1 -1
- package/dist/screen/lib/session.d.ts +1 -1
- package/dist/screen/lib/shared-sections.d.ts +1 -1
- package/dist/text-styles/index.js +11 -11
- package/package.json +4 -4
- package/dist/chunk-D4TH4QQR.js +0 -2
- package/dist/chunk-DCBUJ36Q.js +0 -5
- package/dist/chunk-LK56FUFT.js +0 -1
- package/dist/chunk-M5UCPD66.js +0 -1
- package/dist/chunk-MNQDOSAX.js +0 -7
- package/dist/chunk-OSF2H3LO.js +0 -1
- package/dist/chunk-PTTQWCD7.js +0 -1
- package/dist/chunk-SDSBXW3V.js +0 -26
- package/dist/chunk-YCYGY54I.js +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
export{useSectionOps}from"../../../chunk-
|
|
1
|
+
export{useSectionOps}from"../../../chunk-KRONK73U.js";import"../../../chunk-BDYS3UAD.js";import"../../../chunk-NCXYC7WI.js";import"../../../chunk-LX23TCTP.js";import"../../../chunk-TCAAOYQY.js";import"../../../chunk-NMLAW6FI.js";import"../../../chunk-XT75WETI.js";import"../../../chunk-TBY3DFKS.js";import"../../../chunk-OHHODU7N.js";import"../../../chunk-BPXEFVSQ.js";import"../../../chunk-YCSZAP7T.js";import"../../../chunk-TDEBPOWV.js";import"../../../chunk-WHS6Y55E.js";import"../../../chunk-AI5IQV4A.js";import"../../../chunk-K56YDHYQ.js";import"../../../chunk-56ID6FKZ.js";import"../../../chunk-LDHUPZBK.js";import"../../../chunk-FIVU2COQ.js";import"../../../chunk-TF6NAIV7.js";import"../../../chunk-IHYRYSP2.js";import"../../../chunk-PMRN5Z3T.js";import"../../../chunk-ANBPE45L.js";import"../../../chunk-C63IB4VW.js";import"../../../chunk-DX3VILZ3.js";import"../../../chunk-MIX7EGRG.js";import"../../../chunk-UMTUKSE6.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-QEEW4X64.js";import"../../../chunk-P2VEMZH5.js";import"../../../chunk-YDTEYXQW.js";import"../../../chunk-KXM6YRG2.js";import"../../../chunk-6GJEOER4.js";import"../../../chunk-FR7EEKFF.js";import"../../../chunk-7UFKEX72.js";
|
|
@@ -6,7 +6,7 @@ import '../../blocks/index.js';
|
|
|
6
6
|
import '../../types-BljCVdzR.js';
|
|
7
7
|
import '../../data/index.js';
|
|
8
8
|
import '../../types-Dq180WRV.js';
|
|
9
|
-
import '../../phone-order-
|
|
9
|
+
import '../../phone-order-BCM_f8A1.js';
|
|
10
10
|
import '../../plan-D0DgSLnY.js';
|
|
11
11
|
import './document-switch.js';
|
|
12
12
|
import '../../engine-CvXpFE86.js';
|
|
@@ -4,7 +4,7 @@ import '../../blocks/index.js';
|
|
|
4
4
|
import '../../types-BljCVdzR.js';
|
|
5
5
|
import '../../data/index.js';
|
|
6
6
|
import '../../types-Dq180WRV.js';
|
|
7
|
-
import '../../phone-order-
|
|
7
|
+
import '../../phone-order-BCM_f8A1.js';
|
|
8
8
|
import '../../plan-D0DgSLnY.js';
|
|
9
9
|
import './document-contract.js';
|
|
10
10
|
import './document-switch.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{editorRootFocus,isSaveShortcut,useEaselKeyTarget,useEaselSaveKey,useEaselUndoKeys}from"../../chunk-
|
|
1
|
+
export{editorRootFocus,isSaveShortcut,useEaselKeyTarget,useEaselSaveKey,useEaselUndoKeys}from"../../chunk-DFLPDOZF.js";import"../../chunk-LX23TCTP.js";import"../../chunk-NMLAW6FI.js";import"../../chunk-XT75WETI.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-LDHUPZBK.js";import"../../chunk-TF6NAIV7.js";import"../../chunk-IHYRYSP2.js";import"../../chunk-PMRN5Z3T.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-YDTEYXQW.js";import"../../chunk-KXM6YRG2.js";import"../../chunk-6GJEOER4.js";import"../../chunk-FR7EEKFF.js";import"../../chunk-7UFKEX72.js";
|
|
@@ -5,7 +5,7 @@ import '../../blocks/index.js';
|
|
|
5
5
|
import '../../types-BljCVdzR.js';
|
|
6
6
|
import '../../data/index.js';
|
|
7
7
|
import '../../types-Dq180WRV.js';
|
|
8
|
-
import '../../phone-order-
|
|
8
|
+
import '../../phone-order-BCM_f8A1.js';
|
|
9
9
|
import '../../plan-D0DgSLnY.js';
|
|
10
10
|
import './document-contract.js';
|
|
11
11
|
import './document-switch.js';
|
|
@@ -4,7 +4,7 @@ import '../../blocks/index.js';
|
|
|
4
4
|
import '../../types-BljCVdzR.js';
|
|
5
5
|
import '../../data/index.js';
|
|
6
6
|
import '../../types-Dq180WRV.js';
|
|
7
|
-
import '../../phone-order-
|
|
7
|
+
import '../../phone-order-BCM_f8A1.js';
|
|
8
8
|
import '../../plan-D0DgSLnY.js';
|
|
9
9
|
import './document-contract.js';
|
|
10
10
|
import './document-switch.js';
|
|
@@ -5,7 +5,7 @@ import 'react';
|
|
|
5
5
|
import '../../types-BljCVdzR.js';
|
|
6
6
|
import '../../data/index.js';
|
|
7
7
|
import '../../types-Dq180WRV.js';
|
|
8
|
-
import '../../phone-order-
|
|
8
|
+
import '../../phone-order-BCM_f8A1.js';
|
|
9
9
|
import '../../plan-D0DgSLnY.js';
|
|
10
10
|
import './backend-error.js';
|
|
11
11
|
import './host-chrome.js';
|
|
@@ -9,7 +9,7 @@ import '../../types-BbOBWXMP.js';
|
|
|
9
9
|
import '../../types-Cy7rdmXt.js';
|
|
10
10
|
import '../../style-clipboard/index.js';
|
|
11
11
|
import '../../types-CoUTWUwB.js';
|
|
12
|
-
export { C as CopyItemAction, a as CopyItemRequest, N as NodeDefaults, S as SELECTION_MODE, b as ScreenBlockLook, c as ScreenBlockRules, d as ScreenBridges, e as ScreenCanvas, f as ScreenCanvasDrag, g as ScreenCanvasDragContext, h as ScreenCanvasHeadProps, i as ScreenCanvasTargetProvider, j as ScreenDevices, k as ScreenDocumentOps, l as ScreenDragItem, m as ScreenInspector, n as ScreenInspectorMode, o as ScreenInspectorPanelProps, p as ScreenLeftPanel, q as ScreenLeftView, r as ScreenLeftViewFrame, s as ScreenLeftViewRules, t as ScreenMainAction, u as ScreenMediaDrop, v as ScreenMediaFile, w as ScreenMenuItem, x as ScreenMenuRows, y as ScreenNewNode, z as ScreenNode, A as ScreenNodeActions, B as ScreenNodeAt, D as ScreenNodeLevel, E as ScreenNodeMaker, F as ScreenPartMode, G as ScreenParts, H as ScreenPartsProvider,
|
|
12
|
+
export { C as CopyItemAction, a as CopyItemRequest, I as InsertNodeOptions, N as NodeDefaults, S as SELECTION_MODE, b as ScreenBlockLook, c as ScreenBlockRules, d as ScreenBridges, e as ScreenCanvas, f as ScreenCanvasDrag, g as ScreenCanvasDragContext, h as ScreenCanvasHeadProps, i as ScreenCanvasTargetProvider, j as ScreenDevices, k as ScreenDocumentOps, l as ScreenDragItem, m as ScreenInspector, n as ScreenInspectorMode, o as ScreenInspectorPanelProps, p as ScreenLeftPanel, q as ScreenLeftView, r as ScreenLeftViewFrame, s as ScreenLeftViewRules, t as ScreenMainAction, u as ScreenMediaDrop, v as ScreenMediaFile, w as ScreenMenuItem, x as ScreenMenuRows, y as ScreenNewNode, z as ScreenNode, A as ScreenNodeActions, B as ScreenNodeAt, D as ScreenNodeLevel, E as ScreenNodeMaker, F as ScreenPartMode, G as ScreenParts, H as ScreenPartsProvider, J as ScreenPinnedBand, K as ScreenPinnedNodes, L as ScreenRailItem, M as ScreenSelector, O as ScreenSharedSections, P as ScreenSlot, Q as ScreenSlotAction, R as ScreenSlotMode, T as ScreenStyleClipboard, U as ScreenStyleDocument, V as ScreenStylePastePlan, W as ScreenToastExtra, X as ScreenTree, Y as ScreenTreeFolds, Z as ScreenTreeRows, _ as isPinnedFirst, $ as isPinnedLast, a0 as isSelectionMode, a1 as isSlotMode, a2 as sameInspectorMode, a3 as screenSlotsOf, a4 as shownChildSlotsOf, a5 as shownSlotFieldsOf, a6 as useScreenBlockLook, a7 as useScreenBlockRules, a8 as useScreenBridges, a9 as useScreenCanvasDrag, aa as useScreenCanvasFrame, ab as useScreenCanvasHead, ac as useScreenCanvasTarget, ad as useScreenDevices, ae as useScreenDocumentLabel, af as useScreenDocumentPass, ag as useScreenInspectorPanel, ah as useScreenLeftView, ai as useScreenNodeKeys, aj as useScreenNotify, ak as useScreenOwnerName, al as useScreenParts, am as useScreenPickFollowsSelection, an as useScreenPinned, ao as useScreenSaveSwitch, ap as useScreenStorageNamespace, aq as useScreenStyleClipboard, ar as useStandaloneScreenBridges } from '../../AddSidePanel-DwfZOS5C.js';
|
|
13
13
|
import '../../ScreenDocumentContext-JQr4hTeP.js';
|
|
14
14
|
import './host-chrome.js';
|
|
15
15
|
import './session.js';
|
|
@@ -17,7 +17,7 @@ import './shared-section-types.js';
|
|
|
17
17
|
import './document/content-tree.js';
|
|
18
18
|
import '../../types-BljCVdzR.js';
|
|
19
19
|
import '../../data/index.js';
|
|
20
|
-
import '../../phone-order-
|
|
20
|
+
import '../../phone-order-BCM_f8A1.js';
|
|
21
21
|
import '../../plan-D0DgSLnY.js';
|
|
22
22
|
import '../../edit-lock/index.js';
|
|
23
23
|
import '../../panelWidths-DgQXiPXU.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSelectionMode,isSlotMode,sameInspectorMode,screenSlotsOf,shownChildSlotsOf,shownSlotFieldsOf,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,isSelectionMode,isSlotMode,sameInspectorMode,screenSlotsOf,shownChildSlotsOf,shownSlotFieldsOf,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../../chunk-BDYS3UAD.js";import"../../chunk-NCXYC7WI.js";import"../../chunk-LX23TCTP.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-NMLAW6FI.js";import"../../chunk-XT75WETI.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-OHHODU7N.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import"../../chunk-TDEBPOWV.js";import"../../chunk-WHS6Y55E.js";import"../../chunk-AI5IQV4A.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-56ID6FKZ.js";import"../../chunk-LDHUPZBK.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-TF6NAIV7.js";import"../../chunk-IHYRYSP2.js";import"../../chunk-PMRN5Z3T.js";import"../../chunk-ANBPE45L.js";import"../../chunk-C63IB4VW.js";import"../../chunk-DX3VILZ3.js";import"../../chunk-MIX7EGRG.js";import"../../chunk-UMTUKSE6.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-QEEW4X64.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-YDTEYXQW.js";import"../../chunk-KXM6YRG2.js";import"../../chunk-6GJEOER4.js";import"../../chunk-FR7EEKFF.js";import"../../chunk-7UFKEX72.js";
|
|
@@ -6,7 +6,7 @@ import 'react';
|
|
|
6
6
|
import '../../types-BljCVdzR.js';
|
|
7
7
|
import '../../data/index.js';
|
|
8
8
|
import '../../types-Dq180WRV.js';
|
|
9
|
-
import '../../phone-order-
|
|
9
|
+
import '../../phone-order-BCM_f8A1.js';
|
|
10
10
|
import '../../plan-D0DgSLnY.js';
|
|
11
11
|
import './backend-error.js';
|
|
12
12
|
import '../../edit-lock/index.js';
|
|
@@ -5,7 +5,7 @@ import '../../blocks/index.js';
|
|
|
5
5
|
import '../../types-BljCVdzR.js';
|
|
6
6
|
import '../../data/index.js';
|
|
7
7
|
import '../../types-Dq180WRV.js';
|
|
8
|
-
import '../../phone-order-
|
|
8
|
+
import '../../phone-order-BCM_f8A1.js';
|
|
9
9
|
import '../../plan-D0DgSLnY.js';
|
|
10
10
|
import './backend-error.js';
|
|
11
11
|
import '../../edit-lock/index.js';
|
|
@@ -9,7 +9,7 @@ import 'react';
|
|
|
9
9
|
import '../../types-BljCVdzR.js';
|
|
10
10
|
import '../../data/index.js';
|
|
11
11
|
import '../../types-Dq180WRV.js';
|
|
12
|
-
import '../../phone-order-
|
|
12
|
+
import '../../phone-order-BCM_f8A1.js';
|
|
13
13
|
import '../../plan-D0DgSLnY.js';
|
|
14
14
|
import '../../edit-lock/index.js';
|
|
15
15
|
import './links/link-filters.js';
|
|
@@ -6,7 +6,7 @@ import 'react';
|
|
|
6
6
|
import '../../types-BljCVdzR.js';
|
|
7
7
|
import '../../data/index.js';
|
|
8
8
|
import '../../types-Dq180WRV.js';
|
|
9
|
-
import '../../phone-order-
|
|
9
|
+
import '../../phone-order-BCM_f8A1.js';
|
|
10
10
|
import '../../plan-D0DgSLnY.js';
|
|
11
11
|
import './backend-error.js';
|
|
12
12
|
import '../../edit-lock/index.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{hexReadout as e,typedHex as s}from"../chunk-4FFDGEWA.js";import{SettingsDefaultReset as t}from"../chunk-2T22IY3J.js";import{DEFAULT_TEXT_STYLES_WORDS as a}from"../chunk-OGH6CC3E.js";export{DEFAULT_TEXT_STYLES_WORDS}from"../chunk-OGH6CC3E.js";import{FieldSlider as l}from"../chunk-TDEBPOWV.js";import{DEFAULT_PANEL_WORDS as i}from"../chunk-56ID6FKZ.js";import{TEXT_STYLE_KINDS as n,canAddTextStyle as r,TEXT_STYLE_MAX as o,isDefaultTextStyle as d,CAMPAIGN_TEXT_STYLE_SETTINGS as c,TEXT_STYLE_SETTINGS as u,textStyleViewValues as m,textStyleRowSize as h,describeTextStyle as p,updateTextStyle as f,textStyleCaseCss as v,TEXT_STYLE_VIEW_NUMBERS as g,TEXT_STYLE_CASES as y,addTextStyle as S,removeTextStyle as b,TEXT_STYLE_RANGES as T,textStyleViewKey as k}from"../chunk-53QUHEHK.js";export{CAMPAIGN_TEXT_STYLE_SETTINGS,TEXT_STYLE_CASES,TEXT_STYLE_CASE_CSS,TEXT_STYLE_DEFAULT_COUNT,TEXT_STYLE_KINDS,TEXT_STYLE_MAX,TEXT_STYLE_RANGES,TEXT_STYLE_SETTINGS,TEXT_STYLE_VIEW_NUMBERS,addTextStyle,canAddTextStyle,defaultTextStyles,describeTextStyle,isDefaultTextStyle,isTextStyleCase,removeTextStyle,resolveTextStyle,textStyleCaseCss,textStyleCaseOfCss,textStyleRowSize,textStyleViewKey,textStyleViewValues,updateTextStyle,weightWord}from"../chunk-53QUHEHK.js";import{viewFollows as N,isAuto as C}from"../chunk-DIOTWSCO.js";import{FieldSelect as x}from"../chunk-C63IB4VW.js";import{SettingsSegmented as E}from"../chunk-DX3VILZ3.js";import{SettingsField as w}from"../chunk-MIX7EGRG.js";import"../chunk-UMTUKSE6.js";import{useWords as O}from"../chunk-MFIRYGHW.js";import{withTip as _}from"../chunk-P2VEMZH5.js";import{hsvToHex as z,Tooltip as j,ColorSwatch as L,Popover as M,ColorPickerPanel as I,colorSwatchClasses as $,IconButton as W,Button as A}from"efficient-shell/ui";import{useId as X,useState as Y,useRef as D,useEffect as G,Fragment as V}from"react";import{TrashIcon as F,ChevronIcon as H,BoldIcon as R,ItalicIcon as U,CaseLowerIcon as B,CaseCapitalizedIcon as K,CaseUpperIcon as q,CaseNormalIcon as P}from"efficient-shell/icons/efficient";import{jsxs as Z,jsx as Q,Fragment as J}from"react/jsx-runtime";var ee=`conic-gradient(${[0,60,120,180,240,300,0].map(e=>z({h:e,s:1,v:1})).join(", ")})`;function se({value:s,hex:t,colours:a,label:l,followsWord:i,anyWord:n,onChange:r,readOnly:o=!1}){const d=void 0!==s&&a.some(e=>e.key===s),c=void 0!==s&&!d;/* @__PURE__ */
|
|
2
2
|
return Z("div",{className:"es-ts-set","data-ts-setting":"color",children:[
|
|
3
3
|
/* @__PURE__ */Z("div",{className:"es-ts-top",children:[
|
|
4
4
|
/* @__PURE__ */Q("span",{className:"es-ts-sub",children:l}),
|
|
5
|
-
/* @__PURE__ */Q("span",{className:"es-ts-colour-read",children:t?
|
|
6
|
-
/* @__PURE__ */Z("div",{className:"es-ts-swatches",role:"group","aria-label":l,children:[a.map(t=>/* @__PURE__ */Q(j,{content:`${t.name} · ${
|
|
5
|
+
/* @__PURE__ */Q("span",{className:"es-ts-colour-read",children:t?e(t):i})]}),
|
|
6
|
+
/* @__PURE__ */Z("div",{className:"es-ts-swatches",role:"group","aria-label":l,children:[a.map(t=>/* @__PURE__ */Q(j,{content:`${t.name} · ${e(t.value)}`,children:/* @__PURE__ */Q(L,{color:t.value,size:"sm",className:"es-ts-swatch","aria-label":t.name,selected:s===t.key,disabled:o,onClick:()=>r(t.key)})},t.key)),
|
|
7
7
|
/* @__PURE__ */Q(j,{content:n,children:/* @__PURE__ */Q(M,{trigger:/* @__PURE__ */Q("span",{"aria-hidden":"true",className:"absolute inset-0",style:{background:ee}}),triggerLabel:n,triggerClassName:$({size:"sm",selected:c,className:"es-ts-swatch es-ts-swatch--any"}),"aria-label":l,disabled:o,children:/* @__PURE__ */Q(I,{className:"es-pick-window",value:t??"",onChange:e=>r(e),label:l,disabled:o})})})]})]})}function te({styles:e,onChange:s,fonts:t,colours:l=[],settings:i=c,auto:u=[],fallback:m,sample:h,openId:p,defaultOpenId:f=null,onOpenChange:v,onAdd:g,rowActions:y,onRemove:T,max:k=o,device:N="desktop",readOnly:C=!1}){const x=O("textStyles",a),E=X(),[w,z]=Y(f),j=void 0!==p?p:w,L=e=>{void 0===p&&z(e),v?.(e)},M=D(null),[I,$]=Y(null);G(()=>{if(!I||!M.current)return;const e=[...M.current.querySelectorAll(".es-ts-item")].find(e=>e.dataset.tsId===I.id),s=e?e.querySelector(".es-ts-row"):M.current.querySelector(`.es-ts-add[data-ts-kind="${I.kind}"]`);s?.focus(),$(null)},[I]);/* @__PURE__ */
|
|
8
8
|
return Q("div",{className:"es-ts",ref:M,children:n.map(a=>{const n=e.filter(e=>e.kind===a),o=!r(e,a,k),c=!C&&!o;/* @__PURE__ */
|
|
9
9
|
return Z(ae,{label:x.groups[a],children:[n.map(a=>{const n=y?.(a),r=null!=n&&!1!==n,o=Boolean(T)&&!C&&!d(a);/* @__PURE__ */
|
|
@@ -17,17 +17,17 @@ return Z(V,{children:[
|
|
|
17
17
|
/* @__PURE__ */Z("button",{type:"button",className:"es-ts-row","aria-expanded":o,"aria-controls":o?T:void 0,onClick:()=>d(!o),children:[
|
|
18
18
|
/* @__PURE__ */Q("span",{className:"es-ts-chev","aria-hidden":"true",children:/* @__PURE__ */Q(H,{size:12})}),
|
|
19
19
|
/* @__PURE__ */Q("span",{className:"es-ts-name",style:w,children:e.name}),
|
|
20
|
-
/* @__PURE__ */Q("span",{className:"es-ts-meta",children:p(x,s,b,{autoSize:k.has("size")&&void 0===x.size})})]}),g?/* @__PURE__ */Q("div",{className:"es-ts-actions",children:g}):null]}),o?/* @__PURE__ */Q("div",{className:"es-ts-open",id:T,children:/* @__PURE__ */Q(ne,{style:e,values:C,fonts:s,colours:t,settings:N,autoSet:k,sample:r??b.sample,words:b,device:y,readOnly:S,set:s=>v(f([e],e.id,s)[0])})}):null]})}var ie={none:P,upper:q,capitalize:K,lower:B};function ne({style:
|
|
20
|
+
/* @__PURE__ */Q("span",{className:"es-ts-meta",children:p(x,s,b,{autoSize:k.has("size")&&void 0===x.size})})]}),g?/* @__PURE__ */Q("div",{className:"es-ts-actions",children:g}):null]}),o?/* @__PURE__ */Q("div",{className:"es-ts-open",id:T,children:/* @__PURE__ */Q(ne,{style:e,values:C,fonts:s,colours:t,settings:N,autoSet:k,sample:r??b.sample,words:b,device:y,readOnly:S,set:s=>v(f([e],e.id,s)[0])})}):null]})}var ie={none:P,upper:q,capitalize:K,lower:B};function ne({style:e,values:a,fonts:n,colours:r,settings:o,autoSet:d,sample:c,words:u,device:h,readOnly:p,set:f}){const y=e.values,S=O("panel",i),b=n.find(e=>e.value===a.font),x=function(e,t){return e?t.find(s=>s.key===e)?.value??s(e)??void 0:void 0}(a.color,r),E=e=>"largestSize"===e||d.has(e),z=e=>E(e)?y[e]:a[e],j=m(y,h),L=j.size??z("size"),M=j.lineSpacing??z("lineSpacing"),I=j.letterSpacing??z("letterSpacing"),$=E("letterCase")?y.letterCase:a.letterCase,A={fontFamily:b?.family,fontSize:void 0===L?void 0:`${L}px`,fontWeight:a.weight,fontStyle:a.italic?"italic":void 0,lineHeight:void 0===M?void 0:String(M/100),letterSpacing:void 0===I?void 0:`${I}px`,color:x,textTransform:v($)},X=e=>{const s=T[e],t=E(e);/* @__PURE__ */
|
|
21
21
|
return Q("div",{className:"es-ts-slider","data-ts-setting":e,children:/* @__PURE__ */Q(l,{label:u.settings[e],value:y[e],onChange:s=>f({[e]:s}),min:s.min,max:s.max,step:s.step,shiftStep:s.shiftStep,sliderMin:s.sliderMin,sliderMax:s.sliderMax,unit:s.unit||void 0,styleValue:t?void 0:a[e],auto:t?u.auto:void 0,readOnly:p})},e)};/* @__PURE__ */
|
|
22
22
|
return Z(J,{children:[
|
|
23
|
-
/* @__PURE__ */Q("div",{className:"es-ts-preview",style:A,"aria-label":u.preview,children:c}),o.map(
|
|
24
|
-
return Q("div",{className:"es-ts-slider","data-ts-setting":
|
|
25
|
-
return Q(re,{value:y.font,fonts:n,words:u,readOnly:p,set:f},
|
|
26
|
-
return Q(oe,{value:y.color,hex:x,colours:r,words:u,readOnly:p,set:f},
|
|
27
|
-
return Z("div",{className:"es-ts-set","data-ts-setting":
|
|
23
|
+
/* @__PURE__ */Q("div",{className:"es-ts-preview",style:A,"aria-label":u.preview,children:c}),o.map(s=>{if("desktop"!==h)return g.includes(s)?"largestSize"===s&&"heading"!==e.kind?null:((e,s)=>{const a=T[e],i=k(e,s),n=N(z(e),"phone"===s?y[k(e,"tablet")]:void 0),r=!C(y[i]);/* @__PURE__ */
|
|
24
|
+
return Q("div",{className:"es-ts-slider","data-ts-setting":e,"data-ts-device":s,children:/* @__PURE__ */Q(w,{label:u.settings[e],changed:r,action:/* @__PURE__ */Q(t,{label:u.settings[e],changed:r,disabled:p,onReset:()=>f({[i]:void 0}),detail:void 0===n?u.auto:`${n}${a.unit}`,words:S}),children:/* @__PURE__ */Q(l,{bare:!0,label:u.settings[e],value:y[i],onChange:e=>f({[i]:e}),min:a.min,max:a.max,step:a.step,shiftStep:a.shiftStep,sliderMin:a.sliderMin,sliderMax:a.sliderMax,unit:a.unit||void 0,styleValue:n,auto:void 0===n?u.auto:void 0,readOnly:p})})},e)})(s,h):null;switch(s){case"font":/* @__PURE__ */
|
|
25
|
+
return Q(re,{value:y.font,fonts:n,words:u,readOnly:p,set:f},s);case"color":/* @__PURE__ */
|
|
26
|
+
return Q(oe,{value:y.color,hex:x,colours:r,words:u,readOnly:p,set:f},s);case"emphasis":{const e=(a.weight??400)>=600,t=!1!==b?.italic;/* @__PURE__ */
|
|
27
|
+
return Z("div",{className:"es-ts-set","data-ts-setting":s,children:[
|
|
28
28
|
/* @__PURE__ */Q("span",{className:"es-ts-sub",children:u.settings.emphasis}),
|
|
29
|
-
/* @__PURE__ */Z("div",{className:"es-ts-icons",children:[_(u.bold,/* @__PURE__ */Q(W,{className:"es-ts-icon","aria-label":u.bold,"aria-pressed":e,disabled:p,onClick:()=>f({weight:e?400:700}),children:/* @__PURE__ */Q(R,{size:16})})),p||
|
|
30
|
-
return Q(de,{value:y.letterCase??a.letterCase,auto:E("letterCase"),words:u,readOnly:p,set:f},
|
|
29
|
+
/* @__PURE__ */Z("div",{className:"es-ts-icons",children:[_(u.bold,/* @__PURE__ */Q(W,{className:"es-ts-icon","aria-label":u.bold,"aria-pressed":e,disabled:p,onClick:()=>f({weight:e?400:700}),children:/* @__PURE__ */Q(R,{size:16})})),p||t?_(u.italic,/* @__PURE__ */Q(W,{className:"es-ts-icon","aria-label":u.italic,"aria-pressed":Boolean(a.italic),disabled:p,onClick:()=>f({italic:!a.italic||void 0}),children:/* @__PURE__ */Q(U,{size:16})})):/* @__PURE__ */Q(W,{className:"es-ts-icon","aria-label":u.italic,"aria-pressed":Boolean(a.italic),"aria-disabled":!0,disabledReason:u.italicMissing,children:/* @__PURE__ */Q(U,{size:16})})]})]},s)}case"letterCase":/* @__PURE__ */
|
|
30
|
+
return Q(de,{value:y.letterCase??a.letterCase,auto:E("letterCase"),words:u,readOnly:p,set:f},s);case"largestSize":return"heading"===e.kind?X(s):null;default:return X(s)}})]})}function re({value:e,fonts:s,words:t,readOnly:a,set:l}){const i=X();/* @__PURE__ */
|
|
31
31
|
return Z("div",{className:"es-ts-set","data-ts-setting":"font",children:[
|
|
32
32
|
/* @__PURE__ */Q("span",{className:"es-ts-sub",id:i,children:t.settings.font}),
|
|
33
33
|
/* @__PURE__ */Q(x,{value:e,options:s.map(e=>({label:e.label,value:e.value})),onChange:e=>l({font:e}),ariaLabelledBy:i,readOnly:a})]})}function oe({value:e,hex:s,colours:t,words:a,readOnly:l,set:i}){/* @__PURE__ */
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-easel",
|
|
3
|
-
"version": "27.
|
|
3
|
+
"version": "27.3.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",
|
|
7
|
-
"homepage": "https://github.com/
|
|
7
|
+
"homepage": "https://github.com/eff-erp/efficient-easel#readme",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
|
-
"url": "git+https://github.com/
|
|
10
|
+
"url": "git+https://github.com/eff-erp/efficient-easel.git"
|
|
11
11
|
},
|
|
12
12
|
"bugs": {
|
|
13
|
-
"url": "https://github.com/
|
|
13
|
+
"url": "https://github.com/eff-erp/efficient-easel/issues"
|
|
14
14
|
},
|
|
15
15
|
"publishConfig": {
|
|
16
16
|
"access": "public"
|
package/dist/chunk-D4TH4QQR.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Accordion as e}from"efficient-shell/ui";import{jsx as n}from"react/jsx-runtime";var t=Object.freeze(["Design","Animation"]),o=Object.freeze(["Content","Size","Design","Layout","Position","Anchor"]);function i({title:t,open:o,onToggle:i,count:l,level:r=3,id:s,children:a,className:c}){const d=s??"group";/* @__PURE__ */
|
|
2
|
-
return n(e,{level:r,keepMounted:!0,openIds:o?[d]:[],onOpenChange:e=>i(e.includes(d)),items:[{id:d,headId:s,title:t,count:l,className:c?`es-panel-band ${c}`:"es-panel-band",content:a}]})}export{o as DESIGN_GROUPS,t as SETTINGS_BUCKETS,i as SettingsGroup};
|
package/dist/chunk-DCBUJ36Q.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{usePickFollowsSelection as n}from"./chunk-NCXYC7WI.js";import{slotFieldsOf as e,slotChildrenIn as t}from"./chunk-TCAAOYQY.js";import{EaselCanvas as r,useSelectedFields as o}from"./chunk-HGTDDSFJ.js";import{Inspector as i}from"./chunk-SDSBXW3V.js";import{fieldIsShown as u}from"./chunk-BPXEFVSQ.js";import{createContext as l,useContext as s}from"react";import{DesktopIcon as c}from"efficient-shell/icons/efficient";import{jsx as f}from"react/jsx-runtime";var a={kind:"selection"};function d(n){return"selection"===n.kind}function p(n,e){if(d(n)&&d(e))return!0;const t=n,r=e,o=Object.keys(t);return o.length===Object.keys(r).length&&o.every(n=>Object.is(t[n],r[n]))}function m(n){const e=n;return"string"==typeof e.nodeId&&"string"==typeof e.slot}function k(n,t){const r=n.components?.[t.type]?.fields??{};return e(n,t.type).filter(n=>u(r[n],{values:t.props}))}function h(n,e){return k(n,e).flatMap(n=>t(e,n))}function v(n,e,t){const r=n.slotsOf?.(t);return r||k(e,t).map(n=>({slot:n,label:n,rung:!1}))}function y(n,e){return n.isFirst?n.isFirst(e):e.type===n.first}function g(n,e){return n.isLast?n.isLast(e):e.type===n.last}var b={},S=()=>b,O=()=>"",j=()=>null,w=()=>{},C={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},D={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},L={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */f(c,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},B={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},N={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function P(){/* @__PURE__ */
|
|
2
|
-
return f(r,{height:"fill"})}function F(){const{id:n,fields:e,values:t,readOnly:r,onChange:u}=o();/* @__PURE__ */
|
|
3
|
-
return f("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */f(i,{fields:e,values:t,onChange:u,readOnly:r,idPrefix:n})})}var G=l({});function I({parts:n,children:e}){/* @__PURE__ */
|
|
4
|
-
return f(G.Provider,{value:n,children:e})}function T(){return s(G)}function x(){return(T().useOwnerName??O)()}function A(){return(T().useDocumentLabel??j)()}function V(n,e,t,r){return(T().useBridges??S)(n,e,t,r)}function X(n){return(T().useStandaloneBridges??S)(n)}function Y(n,e){(T().useDocumentPass??w)(n,e)}function H(){return T().blockRules??C}function Q(){return T().blockLook??D}function R(){return T().devices??L}function W(){return T().leftView??B}function E(){return T().pinned??N}function J(){return T().saveSwitch??!0}function K(e){n(!0===T().pickFollowsSelection,e)}function M(){return T().storageNamespace||void 0}function Z(){return T().styleClipboard??null}function q(){return T().nodeKeys??!0}function z(){return T().notify??null}function U(){return T().Canvas??P}function $(){return T().CanvasHead??null}function _(){return T().canvasDrag??null}var nn=l(null);function en({target:n,children:e}){/* @__PURE__ */
|
|
5
|
-
return f(nn.Provider,{value:n,children:e})}function tn(){return s(nn)}function rn(){return T().Inspector??F}export{a as SELECTION_MODE,en as ScreenCanvasTargetProvider,I as ScreenPartsProvider,y as isPinnedFirst,g as isPinnedLast,d as isSelectionMode,m as isSlotMode,p as sameInspectorMode,v as screenSlotsOf,h as shownChildSlotsOf,k as shownSlotFieldsOf,Q as useScreenBlockLook,H as useScreenBlockRules,V as useScreenBridges,_ as useScreenCanvasDrag,U as useScreenCanvasFrame,$ as useScreenCanvasHead,tn as useScreenCanvasTarget,R as useScreenDevices,A as useScreenDocumentLabel,Y as useScreenDocumentPass,rn as useScreenInspectorPanel,W as useScreenLeftView,q as useScreenNodeKeys,z as useScreenNotify,x as useScreenOwnerName,T as useScreenParts,K as useScreenPickFollowsSelection,E as useScreenPinned,J as useScreenSaveSwitch,M as useScreenStorageNamespace,Z as useScreenStyleClipboard,X as useStandaloneScreenBridges};
|
package/dist/chunk-LK56FUFT.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{repeatWrapperAt as t,REPEAT_ATTRIBUTE as e,REPEAT_INDEX_ATTRIBUTE as r}from"./chunk-7UFKEX72.js";import{parseZoneKey as n}from"./chunk-YDTEYXQW.js";var o=`[${e}][${r}]`;function l(l){const c=t(l);if(!c)return null;let i;try{i=n(c.zone)}catch{return null}if(!i.parentId||!i.slot)return null;const{wrapper:a,zone:p,index:f}=c;let s=a.parentElement;for(let t=a.parentElement;t;t=t.parentElement)if(t.getAttribute("data-easel-block")===i.parentId){s=t;break}const d=/* @__PURE__ */new Set;for(const t of Array.from(s?.querySelectorAll(o)??[]))t.getAttribute(e)===p&&d.add(t.getAttribute(r)??"");const m={ownerId:i.parentId,slot:i.slot,index:f,count:Math.max(d.size,f+1)},y=a.parentElement?u(a.parentElement):null;return y&&(m.outer=y),{copy:m,wrapper:a}}function u(t){return l(t)?.copy??null}function c(t,e){return t&&e?t.ownerId===e.ownerId&&t.slot===e.slot&&t.index===e.index&&c(t.outer,e.outer):t===e}function i(t,e){for(const n of Array.from(t.querySelectorAll(o))){if(n.getAttribute(r)!==String(e.index))continue;const t=l(n);if(t?.wrapper===n&&c(t.copy,e))return n}return null}export{i as findCopy,u as repeatCopyAt,l as repeatCopyWithWrapper};
|
package/dist/chunk-M5UCPD66.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useEaselSession as e}from"./chunk-YM4UEGBV.js";import{useHostEscape as n}from"./chunk-LX23TCTP.js";import{styleMenuItems as t}from"./chunk-3OOYGEJY.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-G2VZ4DET.js";import{ROOT_ZONE as l}from"./chunk-TCAAOYQY.js";import{repeatCopyAt as r}from"./chunk-LK56FUFT.js";import{createNodeClipboard as i,nodeMenuItems as c}from"./chunk-P5VYGWYO.js";import{DEFAULT_NODE_MENU_WORDS as s}from"./chunk-WK3AFPXY.js";import{easelMenuEntries as a,menuLabel as u}from"./chunk-FIVU2COQ.js";import{useCanvasEvent as d}from"./chunk-6GJEOER4.js";import{isTypingTarget as p,framePointToHost as f}from"./chunk-FR7EEKFF.js";import{zoneKey as m,ROOT_SLOT as y,ROOT_ID as h}from"./chunk-YDTEYXQW.js";import{useState as k,useCallback as b,useRef as v,useEffect as x}from"react";import{ContextMenu as g}from"efficient-shell/ui";import{TrashIcon as w,AddIcon as C,MoveUpIcon as O,MoveDownIcon as z,UndoIcon as P,RedoIcon as A,PasteIcon as E,StylesIcon as j,LayersIcon as T,CopyIcon as Y}from"efficient-shell/icons/efficient";import{jsx as D}from"react/jsx-runtime";function K(e,n){const t=[],o=/* @__PURE__ */new Set;let r={zone:n.zone,index:n.index};for(;r;){const n=e.nodeAt(r.zone,r.index);if(!n||o.has(n.props.id))break;if(o.add(n.props.id),t.push({zone:r.zone,index:r.index,node:n,parentType:null}),r.zone===l)break;const i=r.zone.lastIndexOf(":");if(i<=0)break;r=e.locate(r.zone.slice(0,i))}for(let e=0;e<t.length-1;e+=1)t[e].parentType=t[e+1].node.type;return t}var M=i(),I=/* @__PURE__ */new WeakMap;function L(e){if(e.claimsPage)return M;const n=e.registry;if(!n)return e.cache("easel:node-clipboard",i);let t=I.get(n);return t||(t=i(),I.set(n,t)),t}function S(){return L(e())}function X(e,n,t){if(n===l){const{floor:n,cap:o}=e.sectionBand();return{parentId:h,slot:y,index:Math.min(Math.max(t,n),o)}}const o=n.lastIndexOf(":");return{parentId:n.slice(0,o),slot:n.slice(o+1),index:t}}function F(e,n,t){const o=e.isPinned(n,t),l=!o&&!e.isLocked(n)&&!e.duplicateBlocked(n),r=e.permits?.(n)??{duplicate:!0,delete:!0};return{copy:!o&&r.duplicate,cut:l&&r.duplicate&&r.delete,delete:l&&r.delete}}function R(e,n,t){const o=e.canPasteAt;if(!o)return m(n.from)===t.zone?X(e,t.zone,t.index+1):null;for(const l of K(e,t)){const t=X(e,l.zone,l.index+1);if(o(n,t))return t}return null}function V(e){if(e.defaultPrevented||e.altKey||e.shiftKey)return null;if(p(e.target))return null;const n=e.target,t=n&&"ownerDocument"in n?n.ownerDocument??n:null,o=t?.getSelection?.();if(o&&!o.isCollapsed&&o.toString().trim())return null;if(!e.metaKey&&!e.ctrlKey)return"Delete"===e.key?"delete":null;const l=e.code||(1===e.key.length?`Key${e.key.toUpperCase()}`:"");return"KeyC"===l?"copy":"KeyX"===l?"cut":"KeyV"===l?"paste":null}function B(e,n,t,o){const l=e.nodeAt(t.zone,t.index);if(!l)return null;const r=l.props.id,i=e.labelOf(l.type,t.zone),c=F(e,l,t.zone);if("copy"===n)return c.copy?(e.nodeOps.copy(r,i),{done:"copied",name:i}):null;if(o.readOnly)return null;if("cut"===n)return c.cut?(e.nodeOps.cut(r,i),{done:"cut",name:i}):null;if("delete"===n)return c.delete?(e.nodeOps.remove(r),{done:"deleted",name:i}):null;const s=o.held;if(!s)return null;const a=e.isPinned(l,t.zone)?null:R(e,s,t);return a?(e.nodeOps.paste(a),{done:"pasted",name:s.label}):(e.onPasteRefused(s),{done:"refused",name:s.label})}function U(e,n){const{zone:o,index:r}=n,i=e.nodeAt(o,r);if(!i)return[];const s=i.props.id,a=e.labelOf(i.type,o),u=Boolean(i.props._hidden),d=e.nodeOps,p=e.isPinned(i,o),f=e.isLocked(i),m=!p&&!f&&!e.duplicateBlocked(i),y=e.permits?.(i)??{duplicate:!0,delete:!0},h=F(e,i,o),k=K(e,n),b=d.held,v=b&&!p?R(e,b,n):null,x=!e.readOnly,g=e.style?t({held:x?e.style.held():null,canCopy:e.style.canCopy(i,o),onCopy:()=>e.style?.copy(i,o),onPaste:()=>e.style?.paste(o,r,i),words:e.words?.styleClipboard}):[];return c({title:a,words:e.words?.menu,layer:{group:"pick",items:k.flatMap((n,t)=>{const o={label:e.rowNameOf(n.node,n.zone),checked:0===t,onClick:()=>e.selectAt(n.zone,n.index,n.node.props.id,n.parentType)},r=n.zone===l?null:e.slotRung?.(n.zone)??null;return r?[o,{label:r.label,checked:!1,onClick:r.select}]:[o]})},actions:{duplicate:x&&m&&y.duplicate?()=>d.duplicate(s):void 0,...W(x&&!p,e=>d.canStep(s,e),e=>d.step(s,e)),copy:h.copy?()=>d.copy(s,a):void 0,cut:x&&h.cut?()=>d.cut(s,a):void 0,paste:x&&b&&v?{label:b.label,run:()=>d.paste(v)}:void 0,rename:x&&e.renamePropOf(i,o)?()=>e.beginRename(o,r):void 0,hide:!x||f||p?void 0:{hidden:u,run:()=>d.setProps(s,{_hidden:!u})},delete:x&&m&&y.delete?()=>d.remove(s):void 0},style:g,extras:N(x?G(e,n.copy):null,e.menuRows?.(i,o,r)),pinnedLine:p?Q(e).pinned:void 0})}function G(e,n){const t=e.copyItem;if(!t||!n)return null;const l=Q(e),r=o.menu,i=e=>l[e]??r[e]??"",c={ownerId:n.ownerId,slot:n.slot,index:n.index,...n.outer?{outer:n.outer}:{}},s=e=>()=>t({...c,action:e});return{make:[{label:i("itemAddAfter"),icon:/* @__PURE__ */D(C,{}),onClick:s("addAfter")},{label:i("itemMoveEarlier"),icon:/* @__PURE__ */D(O,{}),onClick:s("moveEarlier"),disabled:n.index<=0},{label:i("itemMoveLater"),icon:/* @__PURE__ */D(z,{}),onClick:s("moveLater"),disabled:n.index>=n.count-1}],remove:[{label:i("itemDelete"),icon:/* @__PURE__ */D(w,{}),danger:!0,onClick:s("delete")}]}}function N(e,n){if(!e)return n??void 0;if(!n)return e;return Object.fromEntries(["pick","make","change","remove"].map(t=>[t,[...e[t]??[],...n[t]??[]]]).filter(([,e])=>e.length>0))}function W(e,n,t){return e?{moveUp:n(-1)?()=>t(-1):null,moveDown:n(1)?()=>t(1):null}:{}}var Q=e=>e.words?.screen??o.menu;function Z(e){const n=Q(e),t=!e.readOnly,r=[];t&&e.history.hasPast&&r.push({label:n.undo,icon:/* @__PURE__ */D(P,{}),shortcut:"⌘Z",onClick:e.history.back}),t&&e.history.hasFuture&&r.push({label:n.redo,icon:/* @__PURE__ */D(A,{}),shortcut:"⇧⌘Z",onClick:e.history.forward});const i=[],c=e.nodeOps.held,a=X(e,l,e.sectionBand().cap);if(t&&c&&(e.canPasteAt?e.canPasteAt(c,a):m(c.from)===l)){const n=a,t=e.words?.menu??s;i.push({label:t.pasteNamed({paste:t.paste,label:c.label}),icon:/* @__PURE__ */D(E,{}),shortcut:"⌘V",onClick:()=>e.nodeOps.paste(n)})}const u=[r,i,[...e.openPageStyles?[{label:e.pageStylesLabel??o.pageStyles,icon:/* @__PURE__ */D(j,{}),onClick:e.openPageStyles}]:[],{label:n.collapseAll,icon:/* @__PURE__ */D(T,{}),onClick:e.collapseAll}]].filter(e=>e.length>0),d={label:"—",onClick:()=>{}};return u.flatMap((e,n)=>n?[d,...e]:e)}function J(e,n){const t=n.selectionStart??0,o=n.selectionEnd??0,l=n.value.slice(t,o),r=e=>{n.focus(),n.setRangeText(e,t,o,"end"),n.dispatchEvent(new Event("input",{bubbles:!0}))},i=e.words?.menu??s,c=Q(e),a=[];l&&(a.push({label:i.copy,icon:/* @__PURE__ */D(Y,{}),shortcut:"⌘C",onClick:()=>navigator.clipboard?.writeText(l)}),a.push({label:i.cut,icon:/* @__PURE__ */D(Y,{}),shortcut:"⌘X",onClick:()=>{navigator.clipboard?.writeText(l),r("")}})),a.push({label:i.paste,icon:/* @__PURE__ */D(E,{}),shortcut:"⌘V",onClick:()=>{navigator.clipboard?.readText().then(e=>{e&&r(e)}).catch(()=>e.onPasteRefused())}});const u=[a,n.value?[{label:c.selectAll,shortcut:"⌘A",onClick:()=>{n.focus(),n.select()}}]:[]].filter(e=>e.length>0),d={label:"—",onClick:()=>{}};return u.flatMap((e,n)=>n?[d,...e]:e)}function _(e){return e.shiftKey}function $(e,t){const[o,l]=k(null),i=b(()=>l(null),[]);n(null!==o,i);const c=v(e);c.current=e;const s=b(e=>{const n=c.current,t=n.keys;if(!t)return;const o=V(e);if(!o)return;const l=t.selected();if(!l)return;const r=B(n,o,l,{readOnly:t.readOnly,held:t.held()});r&&(e.preventDefault(),t.onDone?.(r))},[]),a=e.keys?.target??null;x(()=>{if(!a)return;const e=e=>s(e);return a.addEventListener("keydown",e),()=>a.removeEventListener("keydown",e)},[a,s]),d(t,"keydown",s);const u=b(n=>{if(_(n))return;const t=n.target;if(t?.closest?.("[data-slot-zone]"))return n.preventDefault(),void l(null);const o=function(e){const n=e?.closest?.("input, textarea");return n&&("INPUT"!==n.tagName||["text","search","url","email","tel","number",""].includes(n.type))?n:null}(t);if(o)return n.preventDefault(),void l({kind:"input",x:n.clientX,y:n.clientY,el:o,owner:t});const r=t?.closest?.("[data-node-id]")?.getAttribute("data-node-id"),i=r?e.locate(r):null;n.preventDefault(),l(i?{kind:"node",x:n.clientX,y:n.clientY,...i,owner:t}:{kind:"empty",x:n.clientX,y:n.clientY,owner:t})},[e]);d(t,"contextmenu",n=>{if(_(n)||!t)return;const o=n.target?.closest?.("[data-easel-block]")??null,i=o?.getAttribute("data-easel-block"),c=i?e.locate(i):null;n.preventDefault();const s=f(t.frame,n.clientX,n.clientY),a=t.frame,u=o?r(o):null;l(c?{kind:"node",...s,...c,copy:u,owner:a}:{kind:"empty",...s,owner:a})}),d(t,"mousedown",i),d(t,"scroll",i,{on:"window"});return{onEditorContextMenu:u,menu:o?/* @__PURE__ */D(q,{host:e,target:o,onClose:i}):null,closeMenu:i}}function q({host:e,target:n,onClose:t}){const o="node"===n.kind?U(e,n):"input"===n.kind?J(e,n.el):Z(e);return 0===o.length?null:/* @__PURE__ */D(g,{at:{x:n.x,y:n.y},owner:n.owner??null,onClose:t,"aria-label":u(o),items:a(o)})}export{M as EASEL_NODE_CLIPBOARD,K as ancestorChain,L as nodeClipboardOf,F as nodeClipboardRules,U as nodeMenuItems,V as nodeShortcut,Z as pageMenuItems,R as pastePlace,B as runNodeShortcut,J as textMenuItems,S as useNodeClipboard,$ as useNodeContextMenu};
|
package/dist/chunk-MNQDOSAX.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{STANDARD_MARKUP as t,writeMarkedLines as e,sameMarks as n,markedLines as r,spanFor as l,marksIn as o,toggleMark as i,styleIn as a,styleOver as s,listIn as c,setList as u,colorOver as d,unlinkAt as f,linkOver as h,colorIn as p,findLink as m,clearStyle as g,isSafeLinkHref as b}from"efficient-shell/markup";import{Tooltip as v,ColorSwatch as k,ColorPickerPanel as y,Button as x}from"efficient-shell/ui";import{jsxs as w,jsx as D}from"react/jsx-runtime";function N(t,e){return t&&t.start!==t.end?t:{start:0,end:e}}var T=/* @__PURE__ */new Set(["script","style","head","title","meta","link","template","noscript","svg","math","object","iframe"]),M=/* @__PURE__ */new Set(["p","div","li","ul","ol","dl","dt","dd","h1","h2","h3","h4","h5","h6","blockquote","pre","table","thead","tbody","tfoot","tr","section","article","header","footer","aside","nav","figure","figcaption","address","hr"]);function C(l,o){const i=o.rules??t,a=l.html&&""!==l.html.trim()?function(t,l,o){const i=l.createElement("template");i.innerHTML=t;const a=[[]],s=()=>a[a.length-1],c=()=>{const t=s();for(;t.length>0&&" "===t[t.length-1].ch;)t.pop();t.length>0&&a.push([])},u=(t,e,n,r)=>{if(3===t.nodeType){for(const l of t.textContent??""){const t=/\s/.test(l)?" ":l,o=s();" "===t&&(0===o.length&&a.length>1||" "===o[o.length-1]?.ch)||o.push({ch:t,bold:e,italic:n,href:r})}return}if(1!==t.nodeType&&11!==t.nodeType)return;const l=t,o=1===t.nodeType?l.localName:"";if(T.has(o))return;if("br"===o)return void a.push([]);let i=e,d=n,f=r;if("b"!==o&&"strong"!==o||(i=!0),"i"!==o&&"em"!==o||(d=!0),"a"===o){const t=(l.getAttribute("href")??"").trim();f=b(t)?t:null}const h=1===t.nodeType?l.style:null;if(h){const t=h.fontWeight;"bold"===t||"bolder"===t||Number(t)>=600?i=!0:("normal"===t||"lighter"===t||""!==t&&Number(t)<600)&&(i=!1),"italic"===h.fontStyle||"oblique"===h.fontStyle?d=!0:"normal"===h.fontStyle&&(d=!1)}const p=M.has(o);p&&c();for(const e of[...t.childNodes])u(e,i,d,f);p&&c()};u(i.content,!1,!1,null);for(;a.length>1&&0===a[a.length-1].length;)a.pop();return a.map(t=>function(t,l){const o=e=>t.map((n,r)=>n[e]&&(" "!==n.ch||Boolean(t[r-1]?.[e])&&Boolean(t[r+1]?.[e]))),i=[{bold:!0,italic:!0,links:!0},{bold:!0,italic:!1,links:!0},{bold:!1,italic:!1,links:!0},{bold:!1,italic:!1,links:!1}];for(const a of i){const i=S(t,a.bold?o("bold"):null,a.italic?o("italic"):null,a.links),s=e([i]).text;if(n([i],r(s,l)))return s}return t.map(t=>t.ch).join("")}(t,o))}(l.html,o.doc,i):(l.text??"").replace(/\r\n?/g,"\n").split("\n");return o.multiline?a.join("\n"):1===a.length?a[0]:a.map(t=>t.trim()).filter(t=>""!==t).join(" ")}function S(t,e,n,r){let o=0,i=null,a=null,s=null;return{bullet:!1,chars:t.map((t,c)=>{const u=r?t.href:null;return i=null===u?null:i&&i.href===u?i:l(++o,"link",u),a=e?.[c]?a??l(++o,"bold"):null,s=n?.[c]?s??l(++o,"italic"):null,{ch:t.ch,at:-1,marks:[i,a,s].filter(t=>null!==t)}})}}var A="application/x-efficient-markup",E=/^([0-9]{1,3})\. $/;function B(t,e){const n=t.split("\n"),l=r(t,e);let o=0,i=0;const a=l.map((t,e)=>{const r=!t.bullet&&null==t.number&&"- "===n[e],l=null!=t.number||t.bullet?null:E.exec(n[e]),a=t.bullet||r,s=l?l[1]:t.number??null,c=r||l?[]:t.chars,u=c.map(t=>t.ch).join(""),d=null!=s?s.length+2:a?2:0,f={bullet:a,number:s,chars:c,start:o,src:o+d,vis:i,text:u};return o+=n[e].length+1,i+=u.length+1,f});return{lines:a,text:a.map(t=>t.text).join("\n")}}function R(t,e){const{lines:n}=t;for(let t=0;t<n.length;t+=1){const r=n[t];if(e<=r.vis+r.text.length||t===n.length-1)return[r,Math.max(0,Math.min(e-r.vis,r.text.length)),t]}return[n[0],0,0]}function W(t,e){const[n,r]=R(t,e);if(0===r)return n.src;let l=0;for(const t of n.chars){if(r<=l+t.ch.length)return t.at+(r-l);l+=t.ch.length}return n.src}function L(t,e){const[n,r]=R(t,e);let l=0;for(const t of n.chars){if(r===l)return t.at;l+=t.ch.length}return W(t,e)}function K(t,e){const{lines:n}=t;let r=n[0];for(const t of n)e>=t.start&&(r=t);let l=0;for(const t of r.chars){if(!(e>=t.at+t.ch.length)){e>t.at&&(l+=e-t.at);break}l+=t.ch.length}return r.vis+l}function P(t,e,n){return[K(t,e),K(t,n)]}function j(t,e,n){return e===n?[W(t,e),W(t,e)]:[L(t,e),W(t,n)]}function V(t,e){let n=0;for(let r=0;r<t.chars.length;r+=1){if(n>=e)return r;n+=t.chars[r].ch.length}return t.chars.length}function q(t,o,i,a,s){const c=B(t,o),[u,d,f]=R(c,Math.min(i,a)),[h,p,m]=R(c,Math.max(i,a)),g=V(u,d),b=V(h,p),v=u.chars.slice(0,g),k=h.chars.slice(b),y=i!==a&&u.chars[g]&&(f!==m||g<b)?u.chars[g].marks:function(t,e){const n=t.chars[e-1],r=t.chars[e],l=(t,e)=>{const n=t.findIndex(t=>"link"===t.kind);return-1===n||e?t:t.slice(0,n)};if(n){const t=n.marks.find(t=>"link"===t.kind),e=Boolean(t&&r?.marks.some(e=>e.id===t.id));return l(n.marks,e)}return r?l(r.marks,!1):[]}(u,g);let x=(w=c.lines,Math.max(0,...w.flatMap(t=>t.chars.flatMap(t=>t.marks.map(t=>t.id))))+1);var w;const D=t=>{let e;if(void 0!==s.markup){const t=x;e=r(s.markup,o).map(e=>({bullet:e.bullet,number:e.number??null,chars:e.chars.map(e=>({...e,at:-1,marks:e.marks.map(e=>({...e,id:e.id+t}))}))}))}else{let n=u.number??null;e=(s.text??"").split("\n").map((e,r)=>(r>0&&null!=n&&(n=function(t){return String(Number(t)+1).padStart(t.length,"0")}(n)),{bullet:u.bullet,number:n,chars:[...e].map(e=>({ch:e,at:-1,marks:t??[]}))}))}const n=e.map(t=>t.chars.map(t=>t.ch).join("")).join("\n"),l={bullet:u.bullet,number:u.number??null,chars:[...v,...e[0].chars]},i=e.slice(1);if(i.length>0){const t=i[i.length-1];i[i.length-1]={...t,chars:[...t.chars,...k]}}else l.chars.push(...k);return{lines:[...c.lines.slice(0,f).map(({bullet:t,number:e,chars:n})=>({bullet:t,number:e,chars:n})),l,...i,...c.lines.slice(m+1).map(({bullet:t,number:e,chars:n})=>({bullet:t,number:e,chars:n}))],shown:n}},N=void 0!==s.markup?[null]:[(t=>{let e=t.filter(t=>!s.drop?.some(e=>t.kind===e||"highlight"===e&&"accent"===t.kind));for(const t of s.add??[]){if(e.some(e=>e.kind===t))continue;const n=l(x++,t);n&&(e=[...e,n])}if(void 0!==s.color){e=e.filter(t=>"color"!==t.kind);const t=null===s.color?null:l(x++,"color",s.color);t&&(e=[...e,t])}return e})(y),y,[]];let T="",M="";for(const t of N){const r=D(t),l=e(r.lines).text;if(T=l,M=r.shown,n(r.lines,B(l,o).lines))break}return{text:T,caret:Math.min(i,a)+M.length}}function F(t,e,n,r){const l=B(t,e),[o,,i]=R(l,n);return n!==r||!o.bullet&&null==o.number||""!==o.text?q(t,e,n,r,{text:"\n"}):I(t,e,i,!1,n)}function I(t,n,r,l,o){const i=B(t,n).lines.map(({bullet:t,number:e,chars:n},o)=>o===r?{bullet:l,number:null,chars:n}:{bullet:t,number:e,chars:n});return{text:e(i).text,caret:o}}function O(t,n,r,l){const o=B(t,n),[i,a,s]=R(o,Math.min(r,l)),[c,u,d]=R(o,Math.max(r,l)),f=o.lines.slice(s,d+1).map(({bullet:t,number:e,chars:n},r)=>{const l=0===r?V(i,a):0,o=r===d-s?V(c,u):n.length;return{bullet:t,number:e,chars:n.slice(l,o)}});return e(f).text}function z(t,e,n){if(n<0){const n=t.charCodeAt(e-1);return e-(n>=56320&&n<=57343&&e>=2?2:1)}const r=t.charCodeAt(e);return e+(r>=55296&&r<=56319?2:1)}function U(t){const{value:e,rules:n,multiline:r,inputType:l,pending:o}=t;let[i,a]=t.sel;t.target&&t.target[0]!==t.target[1]&&l.startsWith("delete")&&([i,a]=t.target);const s=[i,a];if("historyUndo"===l||"historyRedo"===l)return{kind:"history",dir:"historyUndo"===l?"undo":"redo"};if("formatBold"===l||"formatItalic"===l||"formatStrikeThrough"===l)return{kind:"format",style:"formatBold"===l?"bold":"formatItalic"===l?"italic":"strike"};if("insertParagraph"===l||"insertLineBreak"===l)return r?{kind:"edit",edit:F(e,n,i,a),range:s}:null;if(l.startsWith("insert")){if("insertTranspose"===l)return null;let c=t.data??"";if("insertFromDrop"===l||"insertFromPaste"===l){const l=C({html:t.html??void 0,text:c},{doc:t.doc,multiline:r,rules:n});return{kind:"edit",edit:q(e,n,i,a,{markup:l}),range:s}}return r||(c=c.replace(/\s*\r?\n\s*/g," ")),{kind:"type",edit:q(e,n,i,a,{text:c,add:o?.add,drop:o?.drop,color:o?.color}),range:s}}if(l.startsWith("delete")){const t=B(e,n),r=t.text;if(i===a){const o=l.includes("Backward"),c=t.lines.findIndex(t=>i>=t.vis&&i<=t.vis+t.text.length),u=t.lines[c];if(o&&u&&i===u.vis&&(u.bullet||null!=u.number))return{kind:"edit",edit:I(e,n,c,!1,i),range:s};if(o?0===i:i===r.length)return null;o?i=z(r,i,-1):a=z(r,a,1)}return{kind:"type",edit:q(e,n,i,a,{text:""}),range:[i,a]}}return null}var $=1e3;function H(t=200){let e=[],n=[],r=null,l=0;return{record(o,i,a){const s="type"===i&&"type"===r&&a-l<1e3;r=i,l=a,n=[],s||(e.push(o),e.length>t&&e.shift())},undo(t){const l=e.pop();return l?(n.push(t),r=null,l):null},redo(t){const l=n.pop();return l?(e.push(t),r=null,l):null},reset(){e=[],n=[],r=null}}}var X=t=>t.preventDefault();function Y(t,e){if(t)return t.startsWith("#")?t:e?.find(e=>e.name===t)?.value}function Z({colors:t,current:e,words:n,onPick:r}){const l=null===e?null:e.startsWith("#")?e.toLowerCase():t.find(t=>t.name===e)?.value.toLowerCase()??null;/* @__PURE__ */
|
|
2
|
-
return w("div",{className:"es-copy-pop es-copy-colors",role:"dialog","aria-label":n.title,onMouseDown:t=>{"INPUT"!==t.target.tagName&&t.preventDefault()},children:[
|
|
3
|
-
/* @__PURE__ */D("span",{className:"es-copy-pop-label",children:n.theme}),
|
|
4
|
-
/* @__PURE__ */D("div",{className:"es-copy-theme",role:"group","aria-label":n.theme,children:t.map(t=>/* @__PURE__ */D(v,{content:`${t.label} · ${t.value.toUpperCase()}`,children:/* @__PURE__ */D(k,{color:t.value,size:"sm",className:"es-copy-theme-swatch","data-color":t.name,"aria-label":t.label,selected:e===t.name,onMouseDown:X,onClick:()=>r(t.name)})},t.name))}),
|
|
5
|
-
/* @__PURE__ */D("span",{className:"es-copy-pop-label",children:n.any}),
|
|
6
|
-
/* @__PURE__ */D(y,{className:"es-copy-any",value:l??"",onChange:t=>{t!==e&&r(t)},label:n.title,dragWrites:"end"}),
|
|
7
|
-
/* @__PURE__ */D("div",{className:"es-copy-pop-foot",children:/* @__PURE__ */D(x,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onMouseDown:X,onClick:()=>r(null),children:n.remove})})]})}var G={sup:"sub",sub:"sup"};function J(t){const{value:e,rules:n,start:r,end:l,style:a,pending:s}=t,c=G[a];if(r===l){const t=o(e,r,l,n),i=s&&s.at===r?s:null,u=t.has(a),d=!!i?.add.includes(a)||!i?.drop.includes(a)&&u;let f=(i?.add??[]).filter(t=>t!==a),h=(i?.drop??[]).filter(t=>t!==a);return d&&u?h.push(a):d||u||f.push(a),!d&&c&&(f=f.filter(t=>t!==c),t.has(c)&&(h=[...h.filter(t=>t!==c),c])),{kind:"pending",pending:f.length||h.length||void 0!==i?.color?{add:f,drop:h,color:i?.color,at:r}:null}}let u=e,d=r,f=l;if(c&&!o(u,d,f,n).has(a)&&o(u,d,f,n).has(c)){const t=i(u,d,f,c,n);({text:u,selectionStart:d,selectionEnd:f}=t)}return{kind:"edit",result:i(u,d,f,a,n)}}function Q(t){if(null!==t.id&&a(t.value,t.start,t.end,t.rules)===t.id)return null;const e=s(t.value,t.start,t.end,t.id,t.rules);return e.text===t.value?null:e}var _=/^(block|list-item|flex|grid|table|flow-root)$/;function tt(t){const e=t.ownerDocument.defaultView;return!!e&&_.test(e.getComputedStyle(t).display)}function et(t,e){const n=[],r=/* @__PURE__ */new Map,l=/* @__PURE__ */new Map;let o="",i=!1;const a=()=>{i&&(o+="\n",i=!1)},s=t=>{for(const c of Array.from(t.childNodes)){if(3===c.nodeType){c.data.length>0&&a(),r.set(c,o.length),n.push({node:c,start:o.length,length:c.data.length}),o+=c.data,l.set(c,o.length);continue}if(1!==c.nodeType)continue;const t=c;if(e&&t.matches(e)){r.set(t,o.length),l.set(t,o.length);continue}if("BR"===t.tagName){a(),r.set(t,o.length),o+="\n",l.set(t,o.length);continue}const u=tt(t);u&&((i||o.length>0&&!o.endsWith("\n"))&&(o+="\n"),i=!1),r.set(t,o.length);const d=o.length;s(t),u&&o.length===d&&!i&&n.push({node:t,start:d,length:0}),l.set(t,o.length),u&&(i=!0)}};r.set(t,0),s(t),l.set(t,o.length);return{text:o,at:(t,e)=>{if(3===t.nodeType)return(r.get(t)??0)+Math.min(e,t.data.length);const n=t.childNodes;return e<n.length?r.get(n[e])??l.get(t)??0:l.get(t)??o.length},dom:e=>{for(let t=0;t<n.length;t+=1){const r=n[t],l=r.start+r.length;if(e<r.start)return[r.node,0];if(e<l||e===l&&(t===n.length-1||n[t+1].start>e))return 3===r.node.nodeType?[r.node,e-r.start]:[r.node,0]}const r=n[n.length-1];return r?3===r.node.nodeType?[r.node,r.length]:[r.node,0]:[t,0]}}}function nt(t){const e=t.element();if(!e)return null;let n=t.value;const r=t.rules;if(et(e,t.skip).text!==B(n,r).text)return null;const l=t.now??(()=>Date.now()),i=H();let s=e,b=!1,v=null,k=null,y=[t.caret[0],t.caret[1]],x=null,w=!1,D=!1;const T=()=>{D||t.onSelect?.()},M={contenteditable:e.getAttribute("contenteditable"),spellcheck:e.getAttribute("spellcheck")},S=()=>s.ownerDocument,E=()=>S().defaultView?.getSelection()??null,R=()=>{if(!k)return!0;ct();const e=et(s,t.skip);if(e.text!==B(n,r).text)return!1;const[l,o]=k,[i,a]=e.dom(l),[c,u]=e.dom(o);return w||S().activeElement===s||s.focus({preventScroll:!0}),E()?.setBaseAndExtent(i,a,c,u),y=k,W=k,k=null,T(),!0};let W=null;const L=()=>{if(!W)return!1;const t=E(),e=t?.anchorNode??null;return!(e&&e.isConnected&&s.contains(e))||e===s&&0===t.anchorOffset&&(0!==W[0]||0!==W[1])},K=()=>{k=W,R()},V=()=>{R(),S().activeElement===s&&L()&&K();const e=E();if(!(e&&e.anchorNode&&e.focusNode&&s.contains(e.anchorNode)&&s.contains(e.focusNode)))return y;const n=et(s,t.skip),r=n.at(e.anchorNode,e.anchorOffset),l=n.at(e.focusNode,e.focusOffset);return y=r<=l?[r,l]:[l,r],y},F=t=>{const e=S().defaultView;t<=0||!e?W=null:e.requestAnimationFrame(()=>{b||k||(ct(),S().activeElement===s?(L()&&(K(),T()),F(t-1)):W=null)})},I=(t,e)=>{k=[t,e];const n=t=>{if(b)return;if(R())return void F(3);const e=S().defaultView;t>0&&e&&e.requestAnimationFrame(()=>n(t-1))};n(30)},z=(e,r,o)=>{e.text!==n?(i.record({text:n,start:r[0],end:r[1]},o,l()),n=e.text,t.write(n),I(e.caret,e.caret),T()):I(e.caret,e.caret)},$=t=>j(B(n,r),t[0],t[1]),X=(t,e)=>{const l=N({start:t,end:e},n.length);return g(n,l.start,l.end,r)},Y=(e,o)=>{if(e.text===n)return;i.record({text:n,start:o[0],end:o[1]},"edit",l()),n=e.text,t.write(n);const[a,s]=P(B(n,r),e.selectionStart,e.selectionEnd);I(a,s),T()},Z=t=>{if(b)return;const e=V(),[l,o]=$(e),i=J({value:n,rules:r,start:l,end:o,style:t,pending:x});if("pending"===i.kind)return x=i.pending,void T();Y(i.result,e)},G=e=>{n=e.text,t.write(n),I(e.start,e.end)},_=e=>{if(b)return;b=!0,ut.removeEventListener("selectionchange",dt),v&&tt&&t.editable&&!t.editable()&&(nt(tt),tt=null,v=null,ot()),st(s);const n=E();n&&n.rangeCount>0&&s.contains(n.anchorNode)&&s.contains(n.focusNode)&&n.removeAllRanges(),t.end(e)};let tt=null;const nt=t=>{const e=new Set(t.map(([t])=>t)),n=s.ownerDocument.createTreeWalker(s,4),r=[];for(let t=n.nextNode();t;t=n.nextNode())e.has(t)||r.push(t);for(const t of r)t.parentNode?.removeChild(t);for(const[e,n]of t)e.data!==n&&(e.data=n)},rt=(t,e)=>{const l=V();!b&&l[0]!==l[1]&&t.clipboardData&&(t.preventDefault(),t.clipboardData.setData("text/plain",B(n,r).text.slice(l[0],l[1])),t.clipboardData.setData(A,O(n,r,l[0],l[1])),e&&z(q(n,r,l[0],l[1],{text:""}),l,"edit"))},lt=t=>t.preventDefault(),ot=()=>{t.remount?.()},it=[["keydown",e=>{if(b||e.isComposing)return;const r=e.metaKey||e.ctrlKey;if("Escape"!==e.key){if(r&&!e.altKey&&!e.shiftKey&&("k"===e.key||"K"===e.key)&&t.onLinkKey?.())return e.preventDefault(),void e.stopPropagation();if(r&&!e.altKey&&!e.shiftKey&&("KeyA"===e.code||"a"===e.key||"A"===e.key))return e.preventDefault(),e.stopPropagation(),I(0,et(s,t.skip).text.length),void T();if("Enter"===e.key&&(!e.shiftKey||r))return e.preventDefault(),e.stopPropagation(),void _("enter");if(r&&("z"===e.key||"Z"===e.key||"y"===e.key)){e.preventDefault(),e.stopPropagation();const t=V(),r={text:n,start:t[0],end:t[1]},l="y"===e.key||e.shiftKey?i.redo(r):i.undo(r);l&&G(l)}}else{if(e.preventDefault(),e.stopPropagation(),t.onEscape?.())return;_("escape")}}],["beforeinput",e=>{if(b)return;if("insertCompositionText"===e.inputType)return;e.preventDefault();const l=V(),o=et(s,t.skip),a="function"==typeof e.getTargetRanges?e.getTargetRanges()[0]:void 0,c=a&&!a.collapsed?[o.at(a.startContainer,a.startOffset),o.at(a.endContainer,a.endOffset)]:null,u=U({value:n,rules:r,multiline:t.multiline,inputType:e.inputType,data:e.data??e.dataTransfer?.getData("text/plain")??"",html:e.dataTransfer?.getData("text/html"),doc:S(),sel:l,target:c,pending:x&&x.at===$(l)[0]?x:null});if(u){if("type"!==u.kind&&"edit"!==u.kind||(x=null),"history"===u.kind){const t={text:n,start:l[0],end:l[1]},e="undo"===u.dir?i.undo(t):i.redo(t);return void(e&&G(e))}"format"!==u.kind?z(u.edit,u.range,u.kind):Z(u.style)}}],["compositionstart",()=>{v=V(),tt=(()=>{const t=[],e=s.ownerDocument.createTreeWalker(s,4);for(let n=e.nextNode();n;n=e.nextNode())t.push([n,n.data]);return t})()}],["compositionend",e=>{const o=v;if(v=null,!b&&o){if(t.editable&&!t.editable())return tt&&nt(tt),tt=null,void ot();if(tt=null,e.data){const a=q(n,r,o[0],o[1],{text:e.data});i.record({text:n,start:o[0],end:o[1]},"type",l()),n=a.text,t.write(n),ot(),I(a.caret,a.caret)}else ot(),I(o[0],o[0])}}],["paste",e=>{if(b)return;e.preventDefault();const l=V(),o=e.clipboardData,i=o?.getData(A)??"",a=i?t.multiline?i:i.replace(/\s*\r?\n\s*/g," "):C({html:o?.getData("text/html")??"",text:o?.getData("text/plain")??""},{doc:S(),multiline:t.multiline,rules:r});z(q(n,r,l[0],l[1],{markup:a}),l,"edit")}],["copy",t=>rt(t,!1)],["cut",t=>rt(t,!0)],["drop",lt],["dragstart",lt],["blur",e=>{if(b||null!==v||w)return;const n=e.target,r=n.ownerDocument.defaultView,l=()=>{b||(n.isConnected&&n===t.element()?w||n.ownerDocument.activeElement===n||_("blur"):I(y[0],y[1]))};r?.requestAnimationFrame?r.requestAnimationFrame(l):setTimeout(l,0)}],["focus",()=>{w=!1}]];function at(t){t.setAttribute("contenteditable","true"),t.setAttribute("spellcheck","false"),t.setAttribute("data-es-typing","");for(const[e,n]of it)t.addEventListener(e,n)}function st(t){for(const[e,n]of it)t.removeEventListener(e,n);null===M.contenteditable?t.removeAttribute("contenteditable"):t.setAttribute("contenteditable",M.contenteditable),null===M.spellcheck?t.removeAttribute("spellcheck"):t.setAttribute("spellcheck",M.spellcheck),t.removeAttribute("data-es-typing")}function ct(){const e=t.element();e&&e!==s&&(st(s),s=e,at(s))}const ut=s.ownerDocument;function dt(){b||T()}return ut.addEventListener("selectionchange",dt),at(s),s.focus({preventScroll:!0}),I(t.caret[0],t.caret[1]),{get value(){return n},update(t){if(t===n)return;const e=B(t,r).text.length,[l,o]=V();n=t,i.reset(),I(Math.min(l,e),Math.min(o,e))},stop(t="stop"){_(t)},pressed(){let t;D=!0;try{t=V()}finally{D=!1}const[e,l]=$(t),i=o(n,e,l,r),s={};for(const t of["bold","italic","underline","strike","sup","sub","link"]){const n=i.has(t),r=x&&x.at===e?x:null;s[t]=!!r?.add.includes(t)||!r?.drop.includes(t)&&n}const u=x&&x.at===e&&void 0!==x.color?x:null;return{marks:s,list:c(n,e,l,r),selected:l>e,href:m(n,e,l)?.href??null,color:u?u.color??null:p(n,e,l,r),style:l>e?a(n,e,l,r):null,clearable:X(e,l).text!==n}},press:Z,insert(t){if(b)return;w=!1;const e=V(),[r,l]=$(e),o=r+t.length;Y({text:n.slice(0,r)+t+n.slice(l),selectionStart:o,selectionEnd:o},e),ct(),s.focus({preventScroll:!0})},hold(){b||(V(),w=!0)},release(){w=!1},resume(){b||(w=!1,ct(),s.focus({preventScroll:!0}),I(y[0],y[1]))},link(t){if(b)return;w=!1;const e=V(),[l,o]=$(e),i=null===t?f(n,l,o,r):h(n,l,o,t,r),a=i.text===n;Y(i,e),ct(),s.focus({preventScroll:!0}),a&&I(e[0],e[1])},color(t){if(b)return;const e=V(),[l,o]=$(e);if(l===o){const e=x&&x.at===l?x:null;return x={add:e?.add??[],drop:e?.drop??[],color:t,at:l},void T()}Y(d(n,l,o,t,r),e)},textStyle(t){if(b)return;w=!1;const e=V(),[l,o]=$(e),i=Q({value:n,start:l,end:o,id:t,rules:r});i&&Y(i,e),ct(),s.focus({preventScroll:!0}),i||I(e[0],e[1])},clear(){if(b)return;const t=V(),[e,n]=$(t);Y(X(e,n),t)},list(e){if(b||!t.multiline)return;const l=V(),[o,i]=$(l),a=c(n,o,i,r);Y(u(n,o,i,a===e?null:e,r),l)}}}var rt=(t,e,n)=>Math.min(Math.max(t,e),Math.max(e,n));function lt({anchor:t,size:e,within:n,clip:r,parent:l,gap:o=8}){const i=Math.max(n.left,r.left),a=Math.min(n.right,r.right)-e.width,s=rt(t.left,i,a),c=r.bottom-(t.bottom+o),u=t.top-o-r.top,d=e.height>c&&(e.height<=u||u>c),f=d?t.top-o-e.height:t.bottom+o,h=t.left+Math.min((t.right-t.left)/2,10),p=rt(h-5-s,10,e.width-10-10);return{top:f-l.top,left:s-l.left,above:d,point:p}}var ot=t=>({left:t.left,top:t.top,right:t.right,bottom:t.bottom});function it(t,e){const n=("function"==typeof t.getClientRects?[...t.getClientRects()]:[]).filter(t=>t.height>0);if(n.length>0){const e="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():n[0];return e.height>0?ot(e):ot(n[0])}if(!e)return null;const r=e.getBoundingClientRect();return{left:r.left,top:r.top,right:r.left,bottom:r.bottom}}function at(t){const e=t.ownerDocument,n=e.documentElement,r={left:0,top:0,right:n.clientWidth,bottom:n.clientHeight},l=e.defaultView?.getComputedStyle.bind(e.defaultView);for(let o=t.parentElement;o&&o!==n&&o!==e.body;o=o.parentElement){const t=l?.(o);if(!t||"visible"===t.overflowX&&"visible"===t.overflowY)continue;const e=o.getBoundingClientRect();if(0===e.width&&0===e.height)continue;const n=e.left+o.clientLeft,i=e.top+o.clientTop;r.left=Math.max(r.left,n),r.top=Math.max(r.top,i),r.right=Math.min(r.right,n+(o.clientWidth||e.width)),r.bottom=Math.min(r.bottom,i+(o.clientHeight||e.height))}return r}function st(t){const e=t.offsetParent??t.parentElement;if(!e)return{left:0,top:0};const n=e.getBoundingClientRect();return{left:n.left+e.clientLeft-e.scrollLeft,top:n.top+e.clientTop-e.scrollTop}}function ct(t,e,n){const r=t.ownerDocument,l=r.createTreeWalker(t,4),o=t=>{let e=t,n=null;for(let t=l.nextNode();t;t=l.nextNode()){if(e<=t.data.length)return[t,e];e-=t.data.length,n=t}return n?[n,n.data.length]:null},i=o(e);l.currentNode=t;const a=o(n);if(!i||!a)return null;const s=r.createRange();return s.setStart(i[0],i[1]),s.setEnd(a[0],a[1]),s}export{Z as ColorWindow,A as MARKUP_CLIPBOARD_TYPE,$ as TYPING_BURST_MS,N as clearRangeOf,Y as colorRunOf,H as createHistory,q as editVisible,J as markPress,O as markupOfRange,F as newLine,st as offsetOrigin,C as pasteToMarkup,lt as placeWindow,U as richInput,B as richLayout,it as selectionBox,j as selectionToSource,P as selectionToVisible,I as setBullet,nt as startCanvasTyping,Q as styleChange,et as textMap,ct as textRange,W as toSource,L as toSourceStart,K as toVisible,at as visibleArea};
|
package/dist/chunk-OSF2H3LO.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useSectionOps as o}from"./chunk-PTTQWCD7.js";import{SELECTION_MODE as e}from"./chunk-DCBUJ36Q.js";import{decodePartId as r,encodePartId as t}from"./chunk-R4AUZVA3.js";import{useEasel as n}from"./chunk-HGTDDSFJ.js";import{usePreviewParts as p}from"./chunk-467WWV4I.js";import{useCallback as d,useEffect as c}from"react";var s=o=>"part"===o.kind;function m({mode:m,setMode:i,onOpenPart:a}){const{getSelectorForId:u}=n(o=>o),f=o(),{setSelectedPartId:k,setSelectHandler:l}=p(),I=d(o=>{const t=r(o);if(!t)return;const{nodeId:n,propKey:p}=t;p?(i(o=>s(o)&&o.nodeId===n&&o.propKey===p?o:{kind:"part",nodeId:n,propKey:p}),a?.(n)):i(o=>"part"===o.kind?e:o)},[i,a]);c(()=>{l(I)},[l,I]);const h=s(m)?t(m.nodeId,m.propKey):null;c(()=>{k(h)},[h,k]);return{selectNode:d(o=>{i(()=>e);const r=u(o);r&&f.select(r)},[i,u,f]),openPartId:h}}export{m as usePartBridge};
|
package/dist/chunk-PTTQWCD7.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useScreenBlockRules as e}from"./chunk-DCBUJ36Q.js";import{newNodeId as t,ROOT_ZONE as n}from"./chunk-TCAAOYQY.js";import{useEasel as o,useEaselApi as r}from"./chunk-HGTDDSFJ.js";import{useMemo as s}from"react";function i(i={}){const{dispatch:p}=o(e=>e),d=r(),c=!0===i.readOnly,a=e().resolveOnInsert,l=!0===(i.resolveOnInsert??a),m=!0===i.foldIntoHistory;return s(()=>{const e=m?e=>p({...e,recordHistory:!1}):p,o=(n,o,r)=>{const s=t(o);return c||e({type:"insert",componentType:o,destinationZone:n,destinationIndex:r,id:s}),s},r=e=>(l&&!c&&d.resolveNode(e,{trigger:"insert"}),e),s=(t,n,o)=>{c||e({type:"replace",destinationZone:t,destinationIndex:n,data:o})},i=(e,t,n)=>r(o(e,t,n));return{insertComponent:i,insertSection:(e,t)=>i(n,e,t),replaceComponent:s,seedChild:(e,t,n,i)=>{const p=o(e,n,t);s(e,t,{type:n,props:{id:p,...i}}),r(p)},insertNode:(e,t,n)=>{const i=o(e,n.type,t);return s(e,t,{type:n.type,props:{...n.props,id:i}}),r(i)},removeComponent:(t,n)=>{c||e({type:"remove",index:n,zone:t})},reorderComponent:(t,n,o)=>{c||e({type:"reorder",sourceIndex:n,destinationIndex:o,destinationZone:t})},duplicateComponent:(t,n)=>{c||e({type:"duplicate",sourceIndex:n,sourceZone:t})},select:e=>p({type:"setUi",ui:{itemSelector:e}}),setDocument:t=>{c||e({type:"setData",data:t})},commitDocument:(t,n)=>{c||(m?d.batch(()=>{e({type:"setData",data:t}),void 0!==n&&("slot"===n?.kind?d.selectSlot({parentId:n.parentId,slot:n.slot}):d.select(n?n.id:null))}):d.run({data:t,select:n}))}}},[p,c,l,d,m])}export{i as useSectionOps};
|
package/dist/chunk-SDSBXW3V.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import{fieldIsShown as e,shownFields as n}from"./chunk-BPXEFVSQ.js";import{deviceMetaOf as t,noControlMetaOf as l}from"./chunk-YCSZAP7T.js";import{TreeSeam as r}from"./chunk-WHS6Y55E.js";import{SETTINGS_BUCKETS as o,SettingsGroup as a}from"./chunk-D4TH4QQR.js";import{DEFAULT_TREE_WORDS as i}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as s}from"./chunk-56ID6FKZ.js";import{easelMenuEntries as c}from"./chunk-FIVU2COQ.js";import{FieldNumber as d}from"./chunk-ANBPE45L.js";import{FieldSelect as u}from"./chunk-C63IB4VW.js";import{SettingsSegmented as m}from"./chunk-DX3VILZ3.js";import{SettingsField as h}from"./chunk-MIX7EGRG.js";import{DEFAULT_FIELDS_WORDS as p}from"./chunk-UMTUKSE6.js";import{useWords as f}from"./chunk-MFIRYGHW.js";import{useTreeDrag as b,gapToMoveIndex as v}from"./chunk-QEEW4X64.js";import{withTip as g}from"./chunk-P2VEMZH5.js";import{normalizePhoneOrder as y,isCustomPhoneOrder as k,settlePhoneOrder as w,clone as x}from"./chunk-YDTEYXQW.js";import{Textarea as C,Input as O,ItemCount as N,SortableList as D,ListRow as j,IconButton as I,ContextMenu as S,tabPanelId as $,Tabs as P,tabButtonId as L,Button as E}from"efficient-shell/ui";export{LinkPicker}from"efficient-shell/ui";import{useRef as T,useState as F,useLayoutEffect as M,useId as R}from"react";import{jsx as z,jsxs as W,Fragment as B}from"react/jsx-runtime";import{LockIcon as A,CloseIcon as H,ListIcon as Y,MoveUpIcon as K,MoveDownIcon as Q,DuplicateIcon as V,TrashIcon as X}from"efficient-shell/icons/efficient";function Z({id:e,value:n,onChange:t,placeholder:l,multiline:r=!1,rows:o=3,readOnly:a=!1,ariaLabel:i,ariaLabelledBy:s}){const c=n??"";return r?/* @__PURE__ */z(C,{id:e,size:"sm",className:"es-fin",value:c,rows:o,placeholder:l,readOnly:a,"aria-label":i,"aria-labelledby":s,onChange:e=>t(e.target.value)}):/* @__PURE__ */z(O,{id:e,size:"md",className:"es-fin",type:"text",value:c,placeholder:l,readOnly:a,"aria-label":i,"aria-labelledby":s,onChange:e=>t(e.target.value)})}function U(e,n,t){const l=e.slice();return l.splice(Math.max(0,Math.min(n,l.length)),0,t),l}function G(e,n,t){const l=e.slice(),[r]=l.splice(n,1);return l.splice(Math.max(0,Math.min(t,l.length)),0,r),l}function q(e,n){return e.filter((e,t)=>t!==n)}var _='input, textarea, select, button, [contenteditable]:not([contenteditable="false"]), [tabindex]',J={parentId:"list",slot:"items"};function ee({label:e,icon:n,noun:t,items:l,onChange:o,newItem:a,summary:s,itemName:d,thumb:u,min:m=0,max:h,readOnly:y=!1,open:k,onOpen:w,renderItem:C,renderRow:O,canRemove:$,lockedReason:P,fixed:L=!1,removeOnRow:E=!0,canDuplicate:R,above:Y,head:Z=!0}){const ee=f("fields",p).list,ne=f("tree",i),te=t??ee.item,le=!y&&!L&&("number"!=typeof h||l.length<h),re=l.length<=m,oe=e=>!!$&&!$(l[e],e),ae=e=>!y&&!L&&E&&!re&&!oe(e),ie=e=>le&&(!R||R(l[e],e)),se=(e,n)=>d?d(e,n):ee.itemName({noun:te,n:n+1}),ce=T([]),de=T(null),[ue,me]=F(null),he=T(null),[pe,fe]=F(null),[be,ve]=F("");M(()=>{const e=de.current;if(!e)return;de.current=null;const n=ce.current[e.index]?.querySelectorAll(_)[e.nth]??ce.current[e.index];if(n?.focus(),n&&null!==e.start&&"setSelectionRange"in n)try{n.setSelectionRange(e.start,e.end)}catch{}});const ge=(e,n)=>{if(n<0||n>=l.length||n===e)return;const t=ce.current[e],r=t?.ownerDocument.activeElement;if(t&&r&&t.contains(r)){const e=[...t.querySelectorAll(_)].indexOf(r),l=r;de.current={index:n,nth:e,start:"number"==typeof l.selectionStart?l.selectionStart:null,end:"number"==typeof l.selectionEnd?l.selectionEnd:null}}o(G(l,e,n));const a=function(e,n,t){return null===e?null:e===n?t:n<e&&t>=e?e-1:n>e&&t<=e?e+1:e}(k,e,n);a!==k&&w(a),ve(ee.moved({n:n+1,total:l.length}))},ye=e=>{le&&(o(U(l,e,a())),O?(de.current={index:e,nth:0,start:null,end:null},null!==k&&k>=e&&w(k+1)):w(e))},ke=e=>{ae(e)&&(o(q(l,e)),k===e?w(null):null!==k&&k>e&&w(k-1))},we=b({keyOf:e=>String(e),canDrop:(e,n)=>n.parentId===J.parentId&&n.slot===J.slot,onDrop:(e,n)=>{const t=v({...J,index:e},n);t!==e&&ge(e,t)},onStep:(e,n)=>ge(e,e+n),canStep:(e,n)=>e+n>=0&&e+n<l.length,readOnly:y}),xe=e=>{const n=[];return e>0&&n.push({label:ee.moveUp,icon:/* @__PURE__ */z(K,{size:14}),shortcut:"⌥↑",onClick:()=>ge(e,e-1)}),e<l.length-1&&n.push({label:ee.moveDown,icon:/* @__PURE__ */z(Q,{size:14}),shortcut:"⌥↓",onClick:()=>ge(e,e+1)}),ie(e)&&n.push({label:ee.duplicate,icon:/* @__PURE__ */z(V,{size:14}),onClick:()=>(e=>{ie(e)&&(o(U(l,e+1,x(l[e]))),null!==k&&k>e&&w(k+1))})(e)}),ae(e)&&n.push({label:ee.delete,icon:/* @__PURE__ */z(X,{size:14}),danger:!0,onClick:()=>ke(e)}),n},Ce=(e,n,t,l)=>{y||0===xe(e).length||fe({index:e,x:n,y:t,owner:l})},Oe=e=>n=>{const t=l.slice();t[e]=n,o(t)};/* @__PURE__ */
|
|
2
|
-
return W("div",{className:"es-list",children:[Z?/* @__PURE__ */W("div",{className:"es-list-head",children:[
|
|
3
|
-
/* @__PURE__ */W("span",{className:"es-list-label",children:[n?/* @__PURE__ */z("span",{className:"es-field-icon","aria-hidden":"true",children:n}):null,e]}),
|
|
4
|
-
/* @__PURE__ */z(N,{count:l.length,label:ee.count({noun:te,n:l.length}),showZero:!0})]}):null,Y?/* @__PURE__ */z("div",{className:"es-list-above",children:Y}):null,l.length?/* @__PURE__ */W(D,{"aria-label":e,spacing:"comfortable",className:"es-list-rows",rootProps:we.rootProps(),children:[l.map((e,n)=>{const t=we.row({item:n,place:{...J,index:n}}),l=t.draggable&&ue!==n,o=!O&&k===n,a=!y&&!L&&E&&oe(n),i=["es-list-row",O?"is-inline":"is-item",o?"is-open":"",l?"is-draggable":"",t.dragging?"is-dragging":"",t.drop?`is-drop-${t.drop}`:""].filter(Boolean).join(" ");return[n>0?/* @__PURE__ */z(r,{...we.seam({place:{...J,index:n}}),onAdd:le?()=>ye(n):void 0,label:ee.addHere({noun:te})},`seam-${n}`):null,
|
|
5
|
-
/* @__PURE__ */z(j,{className:i,flat:!!O,active:o,title:O?void 0:/* @__PURE__ */W(B,{children:[
|
|
6
|
-
/* @__PURE__ */z("span",{className:"es-list-row-name",children:se(e,n)}),s?/* @__PURE__ */z("span",{className:"es-list-row-summary",children:s(e,n)}):null]}),thumb:!O&&u?u(e,n):void 0,expanded:O?void 0:o,onToggle:O?void 0:()=>w(o?null:n),draggable:t.draggable,dragHint:ne.dragHint,dragging:t.dragging,drop:"before"===t.drop||"after"===t.drop?t.drop:void 0,onMove:t.draggable?e=>ge(n,"up"===e?n-1:n+1):void 0,rowRef:e=>{ce.current[n]=e},rowProps:{...t.rowProps,draggable:l||void 0,onPointerDown:e=>{const l=e.target.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])'),r=!!l&&l===l.ownerDocument.activeElement;e.currentTarget.draggable=t.draggable&&!r,he.current=l&&!r?l:null,me(r?n:null)},onDragStart:e=>{const n=he.current;he.current=null,n&&n.ownerDocument.activeElement===n&&n.blur(),t.rowProps.onDragStart?.(e)},onContextMenu:e=>{y||(e.preventDefault(),e.stopPropagation(),Ce(n,e.clientX,e.clientY,e.currentTarget))},onKeyDown:e=>{if("ContextMenu"===e.key||e.shiftKey&&"F10"===e.key){e.preventDefault();const t=e.currentTarget.ownerDocument,l=e=>e.preventDefault();t.addEventListener("contextmenu",l,{capture:!0,once:!0}),t.defaultView?.setTimeout(()=>t.removeEventListener("contextmenu",l,{capture:!0}),500);const r=e.currentTarget.getBoundingClientRect();return void Ce(n,r.left+24,r.bottom,e.currentTarget)}t.rowProps.onKeyDown?.(e)}},actions:y||L||!E?void 0:a?g(P?P(e,n):ee.locked,/* @__PURE__ */z("span",{className:"es-list-lock",role:"img","aria-label":P?P(e,n):ee.locked,children:/* @__PURE__ */z(A,{size:13})})):g(ee.deleteItem({noun:te}),/* @__PURE__ */z(I,{size:"sm",className:"es-list-x","aria-label":ee.deleteItem({noun:te}),disabled:!ae(n),onClick:()=>ke(n),children:/* @__PURE__ */z(H,{size:14,"aria-hidden":"true"})})),below:o?/* @__PURE__ */z("div",{className:"es-list-item",children:C(e,n,Oe(n))}):void 0,children:O?/* @__PURE__ */z("div",{className:"es-list-row-main",children:O(e,n,Oe(n))}):null},n)]}),
|
|
7
|
-
/* @__PURE__ */z(r,{...we.seam({place:{...J,index:l.length}})})]}):null,y||L?null:/* @__PURE__ */z("button",{type:"button",className:"es-list-add",disabled:!le,onClick:()=>ye(l.length),children:ee.add({noun:te})}),
|
|
8
|
-
/* @__PURE__ */z("span",{className:"es-list-said","aria-live":"polite",children:be}),pe&&pe.index<l.length?
|
|
9
|
-
/* @__PURE__ */z(S,{at:{x:pe.x,y:pe.y},owner:pe.owner,onClose:()=>fe(null),items:c(xe(pe.index))}):null]})}var ne=e=>e<6?e+1:6,te=(e,n)=>"string"==typeof e.label&&e.label?e.label:n;function le({field:e,name:t,id:l,value:r,onChange:o,readOnly:i,context:s,showWhenContext:c,renderers:d,headingLevel:u=3}){const[m,h]=F(!0),p=r&&"object"==typeof r?r:{};/* @__PURE__ */
|
|
10
|
-
return z(a,{id:`${l}-group`,title:te(e,t),open:m,onToggle:h,level:u,children:Object.entries(n(e.objectFields,{values:p,context:c})).map(([e,n])=>/* @__PURE__ */z(oe,{field:n,name:`${t}.${e}`,id:`${l}-${e}`,value:p[e],onChange:n=>o({...p,[e]:n}),readOnly:i,context:s,showWhenContext:c,renderers:d,headingLevel:ne(u)},e))})}function re({field:e,name:t,id:l,value:r,onChange:o,readOnly:a,context:i,showWhenContext:s,renderers:c,openItem:d,onOpenItem:u,headingLevel:m}){const[h,p]=F(null),f=u?d??null:h,b=u??p,v=Array.isArray(r)?r:[],g=e.getItemSummary;/* @__PURE__ */
|
|
11
|
-
return z(ee,{label:te(e,t),icon:e.icon,noun:"string"==typeof e.noun?e.noun:void 0,items:v,onChange:o,newItem:()=>x({...e.defaultItemProps??{}}),summary:g?(e,n)=>g(e,n):void 0,min:e.min,max:e.max,readOnly:a,open:f,onOpen:b,renderItem:(r,o,d)=>Object.entries(n(e.arrayFields,{values:r,context:s})).map(([e,n])=>/* @__PURE__ */z(oe,{field:n,name:`${t}[${o}].${e}`,id:`${l}-${o}-${e}`,value:r?.[e],onChange:n=>d({...r,[e]:n}),readOnly:a,context:i,showWhenContext:s,renderers:c,headingLevel:m},e))})}function oe(e){const{field:n,name:t,id:l,value:r,onChange:o,readOnly:a,context:i,renderers:s}=e;if(!n||n.marker||!1===n.visible)return null;const c=s?.[n.type];if(c)return c({field:n,name:t,id:l,value:r,onChange:o,readOnly:a});switch(n.type){case"custom":{const e={...i,field:n,name:t,id:l,value:r,onChange:o,readOnly:a};return n.render(e)}case"text":case"textarea":/* @__PURE__ */
|
|
12
|
-
return z(h,{label:te(n,t),htmlFor:l,icon:n.icon,hint:n.hint,children:/* @__PURE__ */z(Z,{id:l,value:"string"==typeof r?r:null==r?"":String(r),onChange:o,placeholder:n.placeholder,multiline:"textarea"===n.type,readOnly:a})});case"number":/* @__PURE__ */
|
|
13
|
-
return z(h,{label:te(n,t),htmlFor:l,icon:n.icon,hint:n.hint,children:/* @__PURE__ */z(d,{id:l,value:"number"==typeof r?r:void 0,onChange:o,min:n.min,max:n.max,step:n.step,placeholder:n.placeholder,readOnly:a})});case"select":{const e=`${l}-label`;/* @__PURE__ */
|
|
14
|
-
return z(h,{label:te(n,t),labelId:e,htmlFor:l,icon:n.icon,hint:n.hint,children:/* @__PURE__ */z(u,{id:l,value:r,options:n.options,onChange:o,readOnly:a,ariaLabelledBy:e})})}case"radio":/* @__PURE__ */
|
|
15
|
-
return z(h,{label:te(n,t),icon:n.icon,hint:n.hint,children:/* @__PURE__ */z(m,{ariaLabel:te(n,t),value:r,options:n.options.map(e=>({id:e.value,label:e.label,icon:e.icon,disabled:e.disabled||a})),onChange:e=>{a||o(e)}})});case"object":/* @__PURE__ */
|
|
16
|
-
return z(le,{...e,field:n});case"array":/* @__PURE__ */
|
|
17
|
-
return z(re,{...e,field:n});case"slot":return null}}function ae(e,n,r){if("mobile"!==n&&"tablet"!==n)return!0;const o=e;if(o&&"string"==typeof o.reachedBy){const t=r?.[o.reachedBy];return void 0!==t&&t!==e&&ae(t,n)}if(!o||o.marker||"slot"===o.type)return!0;const a=t(e)?.tier;return a?a===n||"each"===a:"always"===l(e)}var ie={},se=e=>o.includes(e);function ce(n,t){let l,r=o[0];const a=[],i=/* @__PURE__ */new Set;for(const[o,s]of Object.entries(n))s&&(se(s.bucket)&&((s.marker||s.bucket!==r)&&(l=void 0),r=s.bucket),s.marker&&"string"==typeof s.fold?l={key:o,title:s.fold}:s.marker&&!1===s.fold&&(l=void 0),s.marker||!1===s.visible||t&&!e(s,t)||t&&!ue(s,n,t)||t&&!ae(s,t.context?.device,n)||(a.push(l?{name:o,field:s,bucket:r,fold:l}:{name:o,field:s,bucket:r}),"slot"!==s.type&&i.add(r)));return{rows:a,buckets:o.filter(e=>i.has(e))}}function de(e){return new Map(ce(e).rows.map(e=>[e.name,e.bucket]))}function ue(n,t,l){const r=n.reachedBy;if("string"!=typeof r)return!0;const o=t[r];return!!o&&!1!==o.visible&&e(o,l)}function me(e){const n=[];for(const t of e){const e=n[n.length-1];e&&e.fold?.key===t.fold?.key?e.rows.push(t):n.push({fold:t.fold,rows:[t]})}return n}function he({fields:e,values:n,onChange:t,readOnly:l=!1,context:r,showWhenContext:i,tab:c,onTab:d,tabs:u=!0,allTabs:m=!1,tabIcons:h,renderers:p,idPrefix:b,ariaLabel:v,lead:g,children:y,leadFold:k,closedFolds:w,onFold:x,headingLevel:C=3}){const O=f("panel",s),N=R(),D=b??`es-insp${N.replace(/:/g,"")}`,j=ce(e,{values:n,context:i}),[I,S]=F(void 0),E=I&&(I.panel===D||j.buckets.includes(I.tab))?I.tab:void 0,T=c??E,M=m?o:j.buckets,B=T&&M.includes(T)?T:j.buckets[0]??M[0],[A,H]=F(null),Y=A&&A.panel===D&&j.rows.some(e=>e.name===A.name)?A:null,K=u&&M.length>1,Q=K&&B?$(D,B):`${D}-rows`,[V,X]=F(()=>/* @__PURE__ */new Set),Z=w??V,U=(e,n)=>{/* @__PURE__ */return z(a,{title:e.title,open:!Z.has(e.key),onToggle:n=>((e,n)=>{void 0===w&&X(t=>{const l=new Set(t);return n?l.delete(e):l.add(e),l}),x?.(e,n)})(e.key,n),id:`${D}-fold-${t=e.key,[...t].map(e=>/[A-Za-z0-9_-]/.test(e)?e:`-u${e.codePointAt(0).toString(16)}-`).join("")}`,level:C,children:n});var t},G=e=>K&&e!==B,q=({name:e,field:o,bucket:a,fold:s})=>/* @__PURE__ */z("div",{className:"es-insp-row","data-field":e,"data-bucket":a,hidden:!!G(a)||void 0,children:/* @__PURE__ */z(oe,{field:o,name:e,id:`${D}-${e}`,value:n[e],onChange:n=>t(e,n),readOnly:l,context:r,showWhenContext:i,renderers:p,openItem:Y&&Y.name===e?Y.index:null,onOpenItem:n=>H(null===n?null:{panel:D,name:e,index:n}),headingLevel:s?ne(C):C})},e);/* @__PURE__ */
|
|
18
|
-
return W("div",{className:"es-insp",children:[K?/* @__PURE__ */z("div",{className:"es-insp-tabs",children:/* @__PURE__ */z(P,{variant:"underline",block:!0,"aria-label":v??O.settings,idPrefix:D,value:B,onChange:e=>{const n=e;void 0===c&&S({panel:D,tab:n}),d?.(n)},items:M.map(e=>{const n=O.buckets[e],t=h?.[e];return t?{id:e,icon:t,label:/* @__PURE__ */z("span",{className:"sr-only",children:n}),tooltip:n}:{id:e,label:n}})})}):null,
|
|
19
|
-
/* @__PURE__ */W("div",{className:"es-insp-rows",id:Q,role:K?"tabpanel":void 0,"aria-labelledby":K&&B?L(D,B):void 0,children:[g&&ae(ie,i?.device)?k?/* @__PURE__ */z("div",{className:"es-insp-band","data-fold":k.key,children:U(k,g)}):g:null,me(j.rows).map((e,n)=>{if(!e.fold)return e.rows.map(q);const t=e.rows[0].bucket,l=e.rows.every(e=>"slot"===e.field.type);/* @__PURE__ */
|
|
20
|
-
return z("div",{className:"es-insp-band","data-fold":e.fold.key,"data-bucket":t,hidden:!(!G(t)&&!l)||void 0,children:U(e.fold,e.rows.map(q))},`fold-${e.fold.key}-${n}`)}),y]})]})}function pe(e,n,l=ae){const r=t(e)?.tier,o=t=>l(e,t,n)&&r!==t&&"each"!==r?1:0;return{phoneShared:o("mobile"),tabletShared:o("tablet")}}function fe(e){const{arrayFields:n,objectFields:t}=e;return Object.values(n??t??{}).reduce((e,n)=>e+1+fe(n),0)}var be=/\buse(?:PreviewDevice\(\)|(?:Context)?\(PreviewDeviceContext\))|\b(?:previewD|d)evice\s*(?:[!=]==?|\?)|(?:[!=]==?)\s*(?:previewD|d)evice\b|switch\s*\(\s*(?:previewD|d)evice\b|shownTier\(\w+\)\s*[!=]==|\btier\s*[!=]==\s*"(?:mobile|tablet|desktop|each)"|context:\s*"device"/g;function ve(e){return e.match(be)??[]}function ge({value:e,count:n,onChange:t,readOnly:l,noun:r,itemLabel:o,hint:a,children:i}){const s=f("fields",p).phoneOrder??p.phoneOrder;if(!(n>=2))return null;const c=y(e,n),d=k(c);/* @__PURE__ */
|
|
21
|
-
return z(h,{label:s.label,icon:/* @__PURE__ */z(Y,{}),hint:a??s.hint({noun:r}),value:n,children:/* @__PURE__ */W("div",{className:"es-phone-order",children:[
|
|
22
|
-
/* @__PURE__ */z(ee,{label:s.label,head:!1,noun:r,items:c,onChange:e=>t(w(e,n)),newItem:()=>0,fixed:!0,readOnly:l,open:null,onOpen:()=>{},renderItem:()=>null,itemName:e=>o(e),renderRow:(e,n)=>/* @__PURE__ */W("span",{className:"es-phone-order-row",children:[
|
|
23
|
-
/* @__PURE__ */z("span",{className:"es-phone-order-pos","aria-hidden":"true",children:n+1}),
|
|
24
|
-
/* @__PURE__ */z("span",{className:"es-phone-order-name",children:o(e)})]})}),
|
|
25
|
-
/* @__PURE__ */z("p",{className:"es-phone-order-note",children:d?s.desktopKept:s.followsDesktop({noun:r})}),d&&i,d&&!l&&
|
|
26
|
-
/* @__PURE__ */z(E,{variant:"secondary",size:"md",block:!0,onClick:()=>t(void 0),children:s.matchDesktop})]})})}export{Z as FieldText,he as Inspector,oe as InspectorField,ee as ListField,ge as PhoneOrderField,de as bucketsOf,ae as fieldShownInView,fe as innerRowCount,U as insertAt,te as labelOf,G as moveTo,ce as planFields,q as removeAt,pe as rowViewState,ve as viewReadsIn};
|
package/dist/chunk-YCYGY54I.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{buildPaletteSections as e,pinnedSection as t,categoryLabel as n}from"./chunk-GDO4QJ4G.js";import{blockTypesIn as o}from"./chunk-IZGFJWH4.js";import{sectionTemplatesOf as r}from"./chunk-N7E6264U.js";import{sharedSectionsOf as l}from"./chunk-N3MJOHAG.js";import{SidePanelHead as i,PanelModeExit as s}from"./chunk-MTWQYLJE.js";import{blockRuns as c}from"./chunk-RUQOIQWI.js";import{useScreenBlockLook as a,useScreenBlockRules as p,useScreenPinned as d}from"./chunk-DCBUJ36Q.js";import{useEaselSession as m}from"./chunk-YM4UEGBV.js";import{DEFAULT_SCREEN_WORDS as f}from"./chunk-G2VZ4DET.js";import{useEasel as y}from"./chunk-HGTDDSFJ.js";import{easelMenuEntries as u}from"./chunk-FIVU2COQ.js";import{useWords as h}from"./chunk-MFIRYGHW.js";import{AddPanel as k}from"./chunk-DQSRGKSM.js";import{DEFAULT_DRAG_WORDS as g}from"./chunk-TQ5Y6S2X.js";import{useState as b,useEffect as v,useMemo as j,useRef as w}from"react";import{SharedIcon as C,AddIcon as D}from"efficient-shell/icons/efficient";import{ContextMenu as E,toast as G,Dialog as O,Button as T}from"efficient-shell/ui";import{jsx as $,jsxs as F,Fragment as I}from"react/jsx-runtime";function M({name:e,pages:t,onDelete:n,onCancel:o}){const r=h("screen",f).shared,[l,i]=b(!1),s=w(null);/* @__PURE__ */
|
|
2
|
-
return $(O,{open:!0,role:"alertdialog",size:"sm",title:r.deleteTitle({name:e}),onClose:o,initialFocus:s,footer:/* @__PURE__ */F(I,{children:[
|
|
3
|
-
/* @__PURE__ */$(T,{ref:s,variant:"secondary",onClick:o,children:r.cancel}),
|
|
4
|
-
/* @__PURE__ */$(T,{variant:"danger",loading:l,onClick:()=>{(async()=>{i(!0);try{await n()}finally{i(!1)}})()},children:r.deleteShared})]}),children:r.deleteMessage({count:t})})}var Q=e=>`section:${e}`,S=e=>`block:${e}`,x=e=>`template:${e}`,H=e=>`shared:${e}`,J=e=>`preset:${e}`;function W({at:w,placeBlocks:O,placeNames:T,canTake:W,onPick:B,itemFor:L,session:N,siteWide:U,onClose:z,onHide:A,readOnly:R}){const Y=y(e=>e.config),V=a(),{labelAtLevel:P,categoryLabel:Z,firstSection:_,Icon:K,Thumbnail:X}=V,{blockIsOffered:q,canAddTo:ee}=p(),te=h("screen",f).add,ne=h("drag",g).add,oe=m(),[re,le]=b([]);v(()=>{let e=!1;const t=e=>q(e,oe);return r(oe).list().then(n=>{if(e)return;const r=Y.components;le(n.filter(e=>e.node?.type&&r[e.node.type]&&o(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[Y,oe]);const ie=d().shared,se=h("screen",f).shared,[ce,ae]=b([]),[pe,de]=b(0);v(()=>{if(!ie)return;let e=!1;const t=e=>q(e,oe);return l(oe).list().then(n=>{if(e)return;const r=Y.components;ae(n.filter(e=>e.node?.type&&r[e.node.type]&&o(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[Y,oe,pe]);const[me,fe]=b(null),[ye,ue]=b(null),he=j(()=>e(Y,V),[Y]),ke=e=>P(e,"section",Y.components[e]?.label??e),ge=e=>({type:e.preset?J(e.preset.key):Q(e.type),label:e.name,cover:/* @__PURE__ */$(X,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:te.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),be=e=>{const t=e.indexOf(":"),n=e.slice(0,t),o=e.slice(t+1);if("section"===n)return{kind:"section",type:o};if("block"===n)return{kind:"block",type:o};if("template"===n){const e=re.find(e=>e.id===o);return e?{kind:"template",template:e}:null}if("shared"===n){const e=ce.find(e=>e.id===o);return e?{kind:"shared",section:e}:null}if("preset"===n){const e=he.find(e=>e.preset?.key===o)?.preset;return e?{kind:"preset",preset:e}:null}return null},ve=e=>/* @__PURE__ */$("span",{className:"es-add-glyph-cover",children:/* @__PURE__ */$(K,{type:e,size:26})}),je=j(()=>{const e=t(he,_),o=/* @__PURE__ */new Map,r=e=>{e.retired||o.has(e.type)||!q(e.type,oe)||o.set(e.type,e)};for(const t of e?[e]:he.filter(e=>!e.preset)){const e=ee(t.type)?.choices??[];e.forEach(r),e.forEach(e=>ee(e.type,1)?.choices?.forEach(r))}O?.forEach(r);const l=new Set(he.filter(e=>!e.preset).map(e=>e.type)),i=[...o.values()].filter(e=>!l.has(e.type)),s=(e,t,n)=>{const o=T?.get(t);return o&&o!==n?{...e,label:o,title:te.tile({name:o}),keywords:[n,...e.keywords??[]]}:e},a=e=>s({type:S(e.type),label:e.label,cover:ve(e.type),title:te.tile({name:e.label}),keywords:[e.group??"",e.type].filter(Boolean)},e.type,e.label),p=e=>!e.preset&&o.has(e.type)?s({...ge(e),cover:ve(e.type)},e.type,e.name):ge(e),d=[];ce.length>0&&d.push({key:"shared",title:se.group,tiles:ce.map(e=>({type:H(e.id),label:e.title,cover:/* @__PURE__ */$(X,{type:e.node.type}),mark:/* @__PURE__ */$(C,{size:12}),title:se.onPages({count:e.used_on.length}),keywords:[ke(e.node.type),e.node.type]}))}),re.length>0&&d.push({key:"templates",title:te.templates,tiles:re.map(e=>({type:x(e.id),label:e.name,cover:/* @__PURE__ */$(X,{type:e.node.type}),keywords:[ke(e.node.type),e.node.type]}))});const m=i.filter(e=>!e.group);let f=!1;for(const t of Object.keys(Y.categories??{})){const o=he.filter(e=>e.cat===t);if(0===o.length)continue;const r=e&&o.some(t=>t.type===e.type)?e:null,l=(r?[r,...o.filter(e=>e.type!==r.type)]:o).map(p);r&&!f&&(l.splice(1,0,...m.map(a)),f=!0),d.push({key:`category:${t}`,title:n(Y,t,Z),tiles:l})}const y=d.find(e=>e.key?.startsWith("category:"));if(!f&&y&&m.length>0&&(y.tiles=[...y.tiles,...m.map(a)],f=!0),c(i.filter(e=>e.group||!f)).forEach((e,t)=>{d.push({key:`blocks:${t}`,title:e.group??"",tiles:e.items.map(a)})}),!W)return d;const u=d.map(e=>({...e,tiles:e.tiles.map(e=>{const t=be(e.type),n=t?W(t):null;return n?{...e,disabled:!0,disabledReason:n}:e})})),h=e=>e.tiles.some(e=>!e.disabled);return[...u.filter(h),...u.filter(e=>!h(e))]},[re,ce,se,he,Y,te,W,O,T,oe]);/* @__PURE__ */
|
|
5
|
-
return F(I,{children:[
|
|
6
|
-
/* @__PURE__ */$(i,{icon:/* @__PURE__ */$(D,{size:15}),title:te.title,context:te.contextAll,actions:/* @__PURE__ */$(s,{label:te.done,description:te.doneDescription,onClick:z}),onHide:A}),
|
|
7
|
-
/* @__PURE__ */F("div",{className:"sf-addside sf-scroll",children:[
|
|
8
|
-
/* @__PURE__ */$(k,{groups:je,session:N,itemFor:e=>L(be(e)??{kind:"section",type:e}),onInsert:B?e=>{const t=be(e);t&&B(t)}:void 0,onTileMenu:(e,t)=>{const n=be(e);return"shared"===n?.kind&&!R&&(fe({section:n.section,...t}),!0)},at:w,hint:te.hint,searchLabel:te.search,readOnly:R,words:ne}),U??null]}),me?/* @__PURE__ */$(E,{at:{x:me.x,y:me.y},owner:me.owner,onClose:()=>fe(null),"aria-label":me.section.title,items:u([{label:se.deleteShared,danger:!0,onClick:()=>{ue(me.section),fe(null)}}])}):null,ye?/* @__PURE__ */$(M,{name:ye.title,pages:ye.used_on.length,onDelete:()=>(async e=>{try{await l(oe).remove(e.id)}catch{return void G.error(se.deleteFailed)}ue(null),ie?.removed?.(e),ae(t=>t.filter(t=>t.id!==e.id)),de(e=>e+1)})(ye),onCancel:()=>ue(null)}):null]})}export{W as AddSidePanel,S as blockKey,J as presetKey,Q as sectionKey,H as sharedKey,x as templateKey};
|