efficient-easel 26.1.0 → 26.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/README.md +17 -3
- package/dist/{chunk-6BOOYHHK.js → chunk-2C2IUWBH.js} +4 -4
- package/dist/chunk-6F6OAL3C.js +13 -0
- package/dist/chunk-BTQ3FJKT.js +1 -0
- package/dist/chunk-C4HXU4HJ.js +1 -0
- package/dist/{chunk-R76XMEKT.js → chunk-C7IFWSUA.js} +6 -6
- package/dist/chunk-FWPKYUGM.js +5 -0
- package/dist/{chunk-BA5X67LQ.js → chunk-JYVQ62TL.js} +1 -1
- package/dist/chunk-LKP5V3GT.js +1 -0
- package/dist/{chunk-UCZQWQNS.js → chunk-OKJ6KH24.js} +1 -1
- package/dist/{chunk-QAVA4V2C.js → chunk-R76RCEEC.js} +1 -1
- package/dist/chunk-RKLDSLU6.js +4 -0
- package/dist/{chunk-WOA775T4.js → chunk-UQAN4BIP.js} +1 -1
- package/dist/chunk-X3EMJ2EX.js +1 -0
- package/dist/{chunk-7PGO4K5M.js → chunk-XC4PINYS.js} +8 -8
- package/dist/{chunk-VXAGXHKI.js → chunk-XVQNVPIK.js} +35 -35
- package/dist/{chunk-5QUIXGQU.js → chunk-Y5M64LEB.js} +1 -1
- package/dist/chunk-YAFMYW4J.js +16 -0
- package/dist/draw/index.d.ts +2 -0
- package/dist/draw/index.js +1 -1
- package/dist/easel/index.d.ts +16 -1
- package/dist/easel/index.js +1 -1
- package/dist/fields/index.d.ts +5 -1
- package/dist/fields/index.js +1 -1
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddSidePanel.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 +16 -16
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/content/block-size.d.ts +74 -0
- package/dist/screen/lib/content/block-size.js +1 -0
- package/dist/screen/lib/content/style-keys.d.ts +35 -0
- package/dist/screen/lib/content/style-keys.js +1 -0
- package/dist/screen/lib/document/block-set-host.js +1 -1
- package/dist/screen/lib/document/block-size-fields.d.ts +48 -0
- package/dist/screen/lib/document/block-size-fields.js +1 -0
- package/dist/screen/lib/document/box-fields.d.ts +24 -5
- package/dist/screen/lib/document/box-fields.js +1 -1
- package/dist/screen/lib/document/button-fields.d.ts +6 -18
- package/dist/screen/lib/document/button-fields.js +1 -1
- package/dist/screen/lib/document/image-fields.js +4 -4
- package/dist/screen/lib/document/style-clipboard.js +1 -1
- package/dist/screen/lib/document/style-fields.d.ts +3 -3
- package/dist/screen/lib/document/style-fields.js +1 -1
- package/dist/screen/lib/document/use-section-ops.js +1 -1
- package/dist/screen/lib/key-scope.js +1 -1
- package/dist/screen/lib/screen-parts.js +1 -1
- package/package.json +19 -1
- package/dist/chunk-5OKOCRXT.js +0 -11
- package/dist/chunk-BBD3FLU3.js +0 -16
- package/dist/chunk-IMAN6IP5.js +0 -4
- package/dist/chunk-LSGKADNV.js +0 -5
- package/dist/chunk-O4DQ6O6W.js +0 -1
- package/dist/chunk-TTCUC2Q3.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{SettingsDefaultReset as e}from"../../../chunk-2T22IY3J.js";import{ScreenDocumentContext as n}from"../../../chunk-BYONFJVQ.js";import"../../../chunk-QZJKWKGH.js";import"../../../chunk-ERR437B5.js";import{requestMediaPick as o}from"../../../chunk-JIP5JNRB.js";import"../../../chunk-GR3XRILS.js";import"../../../chunk-RLBXE4EU.js";import"../../../chunk-6ATIYLUL.js";import"../../../chunk-KO47WAWR.js";import"../../../chunk-NQW6XCAY.js";import"../../../chunk-LOMEH6DG.js";import"../../../chunk-KCOBHPN6.js";import"../../../chunk-NCXYC7WI.js";import"../../../chunk-YM4UEGBV.js";import"../../../chunk-SNF5764Q.js";import{useEaselHost as t}from"../../../chunk-LX23TCTP.js";import{DEFAULT_IMAGE_ROW_WORDS as r}from"../../../chunk-Q3VAJMXS.js";import{phoneKey as i}from"../../../chunk-E52W3M5I.js";import{MEDIA_FIELD_MARKER as c}from"../../../chunk-ANPOR6EY.js";import{useSelectedHost as s}from"../../../chunk-
|
|
2
|
-
return g(j,{size:"md",type:"url",inputMode:"url",autoComplete:"off",spellCheck:!1,value:c,placeholder:"https://…","aria-label":t,onChange:o=>{const t=o.target.value;i(n=>({text:t,from:!n||e!==n.text&&e!==n.from?e:n.from})),n(t)},onBlur:e=>{const t=e.target.value,r=o?o(t):t;r!==t&&n(r),i(null)},onKeyDown:e=>{"Enter"===e.key&&e.currentTarget.blur()}})}function R({label:c,icon:j,hint:R,value:
|
|
3
|
-
return g(m,{label:c,icon:j,hint:R,children:/* @__PURE__ */g("div",{className:"es-image-row-note",children:
|
|
1
|
+
import{SettingsDefaultReset as e}from"../../../chunk-2T22IY3J.js";import{ScreenDocumentContext as n}from"../../../chunk-BYONFJVQ.js";import"../../../chunk-QZJKWKGH.js";import"../../../chunk-ERR437B5.js";import{requestMediaPick as o}from"../../../chunk-JIP5JNRB.js";import"../../../chunk-GR3XRILS.js";import"../../../chunk-RLBXE4EU.js";import"../../../chunk-6ATIYLUL.js";import"../../../chunk-KO47WAWR.js";import"../../../chunk-NQW6XCAY.js";import"../../../chunk-LOMEH6DG.js";import"../../../chunk-KCOBHPN6.js";import"../../../chunk-NCXYC7WI.js";import"../../../chunk-YM4UEGBV.js";import"../../../chunk-SNF5764Q.js";import{useEaselHost as t}from"../../../chunk-LX23TCTP.js";import{DEFAULT_IMAGE_ROW_WORDS as r}from"../../../chunk-Q3VAJMXS.js";import{phoneKey as i}from"../../../chunk-E52W3M5I.js";import{MEDIA_FIELD_MARKER as c}from"../../../chunk-ANPOR6EY.js";import{useSelectedHost as s}from"../../../chunk-YAFMYW4J.js";import"../../../chunk-JQQFB7EZ.js";import"../../../chunk-TBY3DFKS.js";import{DEFAULT_PANEL_WORDS as a}from"../../../chunk-56ID6FKZ.js";import"../../../chunk-K53PQAMP.js";import"../../../chunk-QTHQPJWA.js";import"../../../chunk-NDRZP6YR.js";import"../../../chunk-H6DDIBQ4.js";import"../../../chunk-YYD257TD.js";import"../../../chunk-RE4LP46F.js";import"../../../chunk-HZSZT3BE.js";import"../../../chunk-PMRN5Z3T.js";import{SettingsField as m}from"../../../chunk-MIX7EGRG.js";import{useWords as l}from"../../../chunk-MFIRYGHW.js";import"../../../chunk-TOKMFZPB.js";import"../../../chunk-FR7EEKFF.js";import"../../../chunk-7UFKEX72.js";import"../../../chunk-EUFDQ4KL.js";import"../../../chunk-KXM6YRG2.js";import{usePreviewDevice as u}from"../../../chunk-BSPCSC45.js";import{useContext as p,useState as h}from"react";import{FOCAL_DEFAULT as f}from"efficient-shell/format";import{MediaUploadField as k,Button as d,Input as j}from"efficient-shell/ui";import{jsx as g,jsxs as v}from"react/jsx-runtime";function y(e){return"string"==typeof e?e:e&&"object"==typeof e&&"string"==typeof e.src?e.src:""}function C({src:e,onChange:n,tidy:o,name:t}){const[r,i]=h(null),c=!r||e!==r.text&&e!==r.from?e:r.text;/* @__PURE__ */
|
|
2
|
+
return g(j,{size:"md",type:"url",inputMode:"url",autoComplete:"off",spellCheck:!1,value:c,placeholder:"https://…","aria-label":t,onChange:o=>{const t=o.target.value;i(n=>({text:t,from:!n||e!==n.text&&e!==n.from?e:n.from})),n(t)},onBlur:e=>{const t=e.target.value,r=o?o(t):t;r!==t&&n(r),i(null)},onKeyDown:e=>{"Enter"===e.key&&e.currentTarget.blur()}})}function R({label:c,icon:j,hint:R,value:E,onChange:B,name:b,readOnly:F,canPick:K=!0,kind:M="image",accept:P,acceptHint:Y,pickOptions:L,maxSizeBytes:N,height:Q,placeholder:D,removeLabel:O,paste:S,focusKey:T,focusWhen:I,frameKey:W,note:w}){const H=l("imageRow",r),J=l("panel",a),X=t(),x=s(),A=p(n),G="video"===M,Z=function(e,n){const o=s(),t="mobile"===u();if(!e||!o)return null;const r=o.values??{};if(n&&!n(r))return null;const c="string"==typeof r[e]&&r[e]?String(r[e]):f,a=i(e),m="string"==typeof r[a]&&r[a]?String(r[a]):void 0;return{phone:t,desktop:c,own:m,focus:t?m??c:c,set:n=>o.onChange(t?a:e,n),clear:()=>o.onChange(a,void 0)}}(G?void 0:T,I),[U,z]=h(!1),V=!0===F||!0===x?.readOnly,q=K&&!V;if(A&&!A.capabilities.mediaEditing)/* @__PURE__ */
|
|
3
|
+
return g(m,{label:c,icon:j,hint:R,children:/* @__PURE__ */g("div",{className:"es-image-row-note",children:G?H.templateVideo:H.template})});const $=W&&b?{video:b,frame:W}:null,_=$?e=>e?B(e):x?.onChangeMany({[$.video]:"",[$.frame]:""}):B,ee=$?e=>x?.onChangeMany({[$.video]:e,[$.frame]:""}):B,ne=y(E),oe=Z?.phone&&ne?/* @__PURE__ */g(e,{words:J,label:H.focus,changed:Boolean(Z.own),detail:H.onDesktop(Z.desktop),onReset:Z.clear,disabled:V}):void 0,te=S&&!V&&(S.open||U);/* @__PURE__ */
|
|
4
4
|
return g(m,{label:c,icon:j,hint:R,action:oe,children:/* @__PURE__ */v("div",{className:"es-image-row",children:[
|
|
5
|
-
/* @__PURE__ */g(k,{value:ne,onChange:_,onPick:e=>{if(q)return $&&!
|
|
5
|
+
/* @__PURE__ */g(k,{value:ne,onChange:_,onPick:e=>{if(q)return $&&!x?Promise.resolve(null):o(X,{accept:P??(G?"video/*":"image/*"),title:c,...e?{file:e}:{},...L?{options:L}:{}}).then(e=>e&&$?(x?.onChangeMany({[$.video]:e.url,[$.frame]:e.posterUrl??""}),null):e?.url??null)},accept:P??(G?"video/*":"image/*"),acceptHint:Y,kind:M,maxSizeBytes:N,height:Q,placeholder:D,removeLabel:O,allowReplace:q,allowRemove:!V,disabled:V||!q&&!ne,focusLabel:H.focus,...Z&&!V?{focus:Z.focus,onFocusChange:Z.set}:Z?{focus:Z.focus}:{}}),w?.(ne),S&&!V?te?/* @__PURE__ */g(C,{src:ne,onChange:ee,tidy:S.tidy,name:H.pasteName}):/* @__PURE__ */g(d,{variant:"link",size:"sm",onClick:()=>z(!0),children:H.pasteLink}):null]})})}function E(e,n,o={}){return{type:"custom",[c]:!0,render:t=>/* @__PURE__ */g(R,{...o,label:e,icon:n,value:t.value,onChange:e=>t.onChange(e),name:t.name,readOnly:t.readOnly})}}export{R as ImageRow,E as imageField,y as imageValueSrc};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{copyNodeStyle,nodeStyleRows,planNodePaste,shopFieldKind,siteStyleScope,styleClipboardOf}from"../../../chunk-
|
|
1
|
+
export{copyNodeStyle,nodeStyleRows,planNodePaste,shopFieldKind,siteStyleScope,styleClipboardOf}from"../../../chunk-JYVQ62TL.js";import"../../../chunk-5XL2RXFU.js";import"../../../chunk-3QB2ZQXK.js";import"../../../chunk-7GGNFLHT.js";import"../../../chunk-22I55W37.js";import"../../../chunk-Q3VAJMXS.js";import"../../../chunk-CWELHADJ.js";import"../../../chunk-6WY6ZXJG.js";import"../../../chunk-ANPOR6EY.js";import"../../../chunk-BPXEFVSQ.js";import"../../../chunk-YCSZAP7T.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-EUFDQ4KL.js";import"../../../chunk-KXM6YRG2.js";import"../../../chunk-BSPCSC45.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { ColorPreset } from 'efficient-shell/ui';
|
|
3
|
+
export { CORNER_SIDES } from '../content/style-keys.js';
|
|
3
4
|
import { ValueAccess, BoxField, BoxFieldSay } from './box-fields.js';
|
|
4
5
|
import 'efficient-shell/format';
|
|
5
6
|
import '../../../ScreenDocumentContext-DPW_6gOC.js';
|
|
@@ -84,8 +85,7 @@ interface BorderFieldOptions extends Stored {
|
|
|
84
85
|
/** The Solid / Dashed / Dotted strip. Default false: the line is solid. */
|
|
85
86
|
styles?: boolean;
|
|
86
87
|
}
|
|
87
|
-
|
|
88
|
-
declare const CORNER_SIDES: readonly ["tl", "tr", "br", "bl"];
|
|
88
|
+
|
|
89
89
|
/** The largest corner a row offers, px (the site's own scale). */
|
|
90
90
|
declare const CORNER_RADIUS_MAX = 40;
|
|
91
91
|
interface CornersFieldOptions extends Stored {
|
|
@@ -106,4 +106,4 @@ declare const colourField: (o: ColourFieldOptions) => BoxField<unknown>;
|
|
|
106
106
|
declare const borderField: (o: BorderFieldOptions) => BoxField<unknown>;
|
|
107
107
|
declare const cornersField: (o: CornersFieldOptions) => BoxField<unknown>;
|
|
108
108
|
|
|
109
|
-
export { BORDER_WIDTH_MAX, type BorderFieldOptions, CORNER_RADIUS_MAX,
|
|
109
|
+
export { BORDER_WIDTH_MAX, type BorderFieldOptions, CORNER_RADIUS_MAX, type ColourFieldOptions, type CornersFieldOptions, borderField, colourField, cornersField, keptByRow, styleFieldBuilders };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{BORDER_WIDTH_MAX,CORNER_RADIUS_MAX,
|
|
1
|
+
export{BORDER_WIDTH_MAX,CORNER_RADIUS_MAX,borderField,colourField,cornersField,keptByRow,styleFieldBuilders}from"../../../chunk-RKLDSLU6.js";import"../../../chunk-6F6OAL3C.js";import"../../../chunk-CLAADE4J.js";import"../../../chunk-2T22IY3J.js";import"../../../chunk-7GGNFLHT.js";import"../../../chunk-22I55W37.js";import"../../../chunk-LX23TCTP.js";import"../../../chunk-Q3VAJMXS.js";import"../../../chunk-CWELHADJ.js";import"../../../chunk-6WY6ZXJG.js";export{CORNER_SIDES}from"../../../chunk-BTQ3FJKT.js";import"../../../chunk-E52W3M5I.js";import"../../../chunk-ANPOR6EY.js";import"../../../chunk-YAFMYW4J.js";import"../../../chunk-JQQFB7EZ.js";import"../../../chunk-TBY3DFKS.js";import"../../../chunk-YCSZAP7T.js";import"../../../chunk-FM6JO4WF.js";import"../../../chunk-56ID6FKZ.js";import"../../../chunk-K53PQAMP.js";import"../../../chunk-QTHQPJWA.js";import"../../../chunk-OECWLNKJ.js";import"../../../chunk-HZSZT3BE.js";import"../../../chunk-PMRN5Z3T.js";import"../../../chunk-KFWNGPW3.js";import"../../../chunk-MIX7EGRG.js";import"../../../chunk-DX3VILZ3.js";import"../../../chunk-JACEEVVF.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-TOKMFZPB.js";import"../../../chunk-FR7EEKFF.js";import"../../../chunk-7UFKEX72.js";import"../../../chunk-EUFDQ4KL.js";import"../../../chunk-KXM6YRG2.js";import"../../../chunk-BSPCSC45.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{useSectionOps}from"../../../chunk-
|
|
1
|
+
export{useSectionOps}from"../../../chunk-UQAN4BIP.js";import"../../../chunk-FWPKYUGM.js";import"../../../chunk-NCXYC7WI.js";import"../../../chunk-LX23TCTP.js";import"../../../chunk-TCAAOYQY.js";import"../../../chunk-YAFMYW4J.js";import"../../../chunk-JQQFB7EZ.js";import"../../../chunk-TBY3DFKS.js";import"../../../chunk-C7IFWSUA.js";import"../../../chunk-BPXEFVSQ.js";import"../../../chunk-YCSZAP7T.js";import"../../../chunk-ZEH6QLBH.js";import"../../../chunk-WHS6Y55E.js";import"../../../chunk-FM6JO4WF.js";import"../../../chunk-K56YDHYQ.js";import"../../../chunk-56ID6FKZ.js";import"../../../chunk-K53PQAMP.js";import"../../../chunk-FIVU2COQ.js";import"../../../chunk-QTHQPJWA.js";import"../../../chunk-HZSZT3BE.js";import"../../../chunk-PMRN5Z3T.js";import"../../../chunk-Y2T3JX7K.js";import"../../../chunk-KFWNGPW3.js";import"../../../chunk-MIX7EGRG.js";import"../../../chunk-DX3VILZ3.js";import"../../../chunk-JACEEVVF.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-3XECMGXX.js";import"../../../chunk-P2VEMZH5.js";import"../../../chunk-TOKMFZPB.js";import"../../../chunk-FR7EEKFF.js";import"../../../chunk-7UFKEX72.js";import"../../../chunk-EUFDQ4KL.js";import"../../../chunk-KXM6YRG2.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{editorRootFocus,isSaveShortcut,useEaselKeyTarget,useEaselSaveKey,useEaselUndoKeys}from"../../chunk-
|
|
1
|
+
export{editorRootFocus,isSaveShortcut,useEaselKeyTarget,useEaselSaveKey,useEaselUndoKeys}from"../../chunk-OKJ6KH24.js";import"../../chunk-LX23TCTP.js";import"../../chunk-YAFMYW4J.js";import"../../chunk-JQQFB7EZ.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-K53PQAMP.js";import"../../chunk-QTHQPJWA.js";import"../../chunk-HZSZT3BE.js";import"../../chunk-PMRN5Z3T.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-TOKMFZPB.js";import"../../chunk-FR7EEKFF.js";import"../../chunk-7UFKEX72.js";import"../../chunk-EUFDQ4KL.js";import"../../chunk-KXM6YRG2.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-FWPKYUGM.js";import"../../chunk-NCXYC7WI.js";import"../../chunk-LX23TCTP.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-YAFMYW4J.js";import"../../chunk-JQQFB7EZ.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-C7IFWSUA.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-WHS6Y55E.js";import"../../chunk-FM6JO4WF.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-56ID6FKZ.js";import"../../chunk-K53PQAMP.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-QTHQPJWA.js";import"../../chunk-HZSZT3BE.js";import"../../chunk-PMRN5Z3T.js";import"../../chunk-Y2T3JX7K.js";import"../../chunk-KFWNGPW3.js";import"../../chunk-MIX7EGRG.js";import"../../chunk-DX3VILZ3.js";import"../../chunk-JACEEVVF.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-3XECMGXX.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-TOKMFZPB.js";import"../../chunk-FR7EEKFF.js";import"../../chunk-7UFKEX72.js";import"../../chunk-EUFDQ4KL.js";import"../../chunk-KXM6YRG2.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-easel",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.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",
|
|
@@ -31,6 +31,8 @@
|
|
|
31
31
|
"./screen/components/PreviewDeviceContext",
|
|
32
32
|
"./screen/components/UiIcon",
|
|
33
33
|
"./screen/lib/content/view-tiers",
|
|
34
|
+
"./screen/lib/content/block-size",
|
|
35
|
+
"./screen/lib/content/style-keys",
|
|
34
36
|
"./screen/lib/document/content-tree",
|
|
35
37
|
"./screen/lib/document/hidable",
|
|
36
38
|
"./screen/lib/document/slot-child-name"
|
|
@@ -97,6 +99,7 @@
|
|
|
97
99
|
"./screen/lib/document/block-types-in",
|
|
98
100
|
"./screen/lib/document/block-set-host",
|
|
99
101
|
"./screen/lib/document/button-fields",
|
|
102
|
+
"./screen/lib/document/block-size-fields",
|
|
100
103
|
"./screen/lib/document/style-fields",
|
|
101
104
|
"./screen/lib/document/box-fields",
|
|
102
105
|
"./screen/lib/document/device-fields",
|
|
@@ -393,6 +396,16 @@
|
|
|
393
396
|
"import": "./dist/screen/lib/client-only.js",
|
|
394
397
|
"default": "./dist/screen/lib/client-only.js"
|
|
395
398
|
},
|
|
399
|
+
"./screen/lib/content/block-size": {
|
|
400
|
+
"types": "./dist/screen/lib/content/block-size.d.ts",
|
|
401
|
+
"import": "./dist/screen/lib/content/block-size.js",
|
|
402
|
+
"default": "./dist/screen/lib/content/block-size.js"
|
|
403
|
+
},
|
|
404
|
+
"./screen/lib/content/style-keys": {
|
|
405
|
+
"types": "./dist/screen/lib/content/style-keys.d.ts",
|
|
406
|
+
"import": "./dist/screen/lib/content/style-keys.js",
|
|
407
|
+
"default": "./dist/screen/lib/content/style-keys.js"
|
|
408
|
+
},
|
|
396
409
|
"./screen/lib/content/view-tiers": {
|
|
397
410
|
"types": "./dist/screen/lib/content/view-tiers.d.ts",
|
|
398
411
|
"import": "./dist/screen/lib/content/view-tiers.js",
|
|
@@ -438,6 +451,11 @@
|
|
|
438
451
|
"import": "./dist/screen/lib/document/content-tree.js",
|
|
439
452
|
"default": "./dist/screen/lib/document/content-tree.js"
|
|
440
453
|
},
|
|
454
|
+
"./screen/lib/document/block-size-fields": {
|
|
455
|
+
"types": "./dist/screen/lib/document/block-size-fields.d.ts",
|
|
456
|
+
"import": "./dist/screen/lib/document/block-size-fields.js",
|
|
457
|
+
"default": "./dist/screen/lib/document/block-size-fields.js"
|
|
458
|
+
},
|
|
441
459
|
"./screen/lib/document/button-fields": {
|
|
442
460
|
"types": "./dist/screen/lib/document/button-fields.d.ts",
|
|
443
461
|
"import": "./dist/screen/lib/document/button-fields.js",
|
package/dist/chunk-5OKOCRXT.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{sidesStartEach as e,SidesInput as n,SidesEachToggle as t}from"./chunk-CLAADE4J.js";import{SettingsDefaultReset as o}from"./chunk-2T22IY3J.js";import{deviceField as l}from"./chunk-7GGNFLHT.js";import{noControlField as a,NoControlMark as r}from"./chunk-22I55W37.js";import{describedAs as i}from"./chunk-LX23TCTP.js";import{withStyleKind as u}from"./chunk-CWELHADJ.js";import{phoneKey as s}from"./chunk-E52W3M5I.js";import{foldMetaOf as c,FOLD_FIELD_MARKER as d}from"./chunk-ANPOR6EY.js";import{useSelectedHost as p,useEaselApi as f,useEasel as m}from"./chunk-BBD3FLU3.js";import{DEFAULT_PANEL_WORDS as b}from"./chunk-56ID6FKZ.js";import{SettingsSwitch as h}from"./chunk-OECWLNKJ.js";import{FieldSelect as g}from"./chunk-KFWNGPW3.js";import{SettingsField as v}from"./chunk-MIX7EGRG.js";import{SettingsSegmented as y}from"./chunk-DX3VILZ3.js";import{useWords as k}from"./chunk-MFIRYGHW.js";import{useState as C}from"react";import{AlignmentIcon as w,BoxJustifyIcon as x,WrapIcon as j,GapIcon as F,WidthIcon as L,PlacementIcon as O,NudgeIcon as S,DesktopIcon as P,BoxXEndIcon as E,BoxXCenterIcon as I,BoxXStartIcon as A,PaddingAllIcon as B,BoxYBetweenIcon as K,BoxYStretchIcon as W,BoxYEndIcon as G,BoxYCenterIcon as M,BoxYStartIcon as N,BoxXBetweenIcon as T,BoxXStretchIcon as R,BoxItemAlignmentIcon as V}from"efficient-shell/icons/efficient";import{Slider as D,textAlignOptions as J,AlignmentGrid as $,PositionInput as _}from"efficient-shell/ui";import{jsx as X,Fragment as Y,jsxs as z}from"react/jsx-runtime";var H=e=>e;function U(){return null}function Z(e){if(!e.trim())throw new Error("noGlyph() needs a reason naming the ruling that decided it.");/* @__PURE__ */
|
|
2
|
-
return X(U,{},e)}function q(e){return e.type===U}function Q(e){return q(e)?void 0:e}function ee(e){for(const[n,t]of Object.entries(e))t&&"object"==typeof t&&!c(t)&&u(t,`section:${n}`);return e}function ne(e,n){return{type:"custom",[d]:{label:e,level:n},marker:!0,fold:e,render:()=>/* @__PURE__ */X(Y,{})}}function te(e){return ne(e,2)}function oe(e){return ne(e,1)}var le=[{label:"Start",value:"start"},{label:"Center",value:"center"},{label:"Space between",value:"between"},{label:"End",value:"end"}],ae=[{label:"Start",value:"start"},{label:"Center",value:"center"},{label:"End",value:"end"},{label:"Stretch",value:"stretch"}],re="Wrap",ie=[{label:"Wrap",value:"wrap"},{label:"No wrap",value:"nowrap"}],ue="Direction",se=[{label:"Stacked",value:"column"},{label:"One row",value:"row"}],ce={min:-32,max:64,step:2,builtIn:0},de={min:30,max:100,step:5,fallback:60},pe=["top-left","top-center","top-right","left","center","right","bottom-left","bottom-center","bottom-right"],fe="bottom-left",me={"top-left":"Top left","top-center":"Top center","top-right":"Top right",left:"Left",center:"Center",right:"Right","bottom-left":"Bottom left","bottom-center":"Bottom center","bottom-right":"Bottom right"},be=pe.map(e=>({value:e,label:me[e]}));function he(e,n=fe){return pe.includes(e)?e:n}var ge=40,ve=e=>"number"==typeof e?e:null;function ye(e,n,t){const o={};for(const l of["x","y"])t[l]!==n[l]&&(o[e[l]]=t[l]??void 0);return o}var ke=["top","right","bottom","left"],Ce={top:"sectionPaddingTop",right:"sectionPaddingRight",bottom:"sectionPaddingBottom",left:"sectionPaddingLeft"},we=e=>"number"==typeof e?e:null;function xe(e,n,t){const o={};for(const l of ke)t[l]!==n[l]&&(o[e[l]]=t[l]??void 0);return o}function je(e){if("number"==typeof e)return{top:e,right:e,bottom:e,left:e};const n=e&&"object"==typeof e?e:{};return Object.fromEntries(ke.map(e=>[e,we(n[e])]))}function Fe(e){const n={};for(const t of ke)"number"==typeof e[t]&&(n[t]=e[t]);return Object.keys(n).length?n:void 0}function Le(e,n={}){const t=n=>{const t=n[e];return t&&"object"==typeof t?t:{}},o=e=>Object.hasOwn(n,e)?n[e]:e;return{read:(e,n)=>t(e)[o(n)],write:(n,l,a)=>{const r={...t(n)};return void 0===a?delete r[o(l)]:r[o(l)]=a,{[e]:Object.keys(r).length?r:void 0}}}}function Oe(e,n,t){const o=Se(e),l=p();if(t)return[t.value,t.onChange];const a=l?.values??{};return[e.read(a,n),e=>o([[n,e]])]}function Se(e){const n=p(),t=function(){try{return f()}catch{return null}}();return o=>{if(!n)return;const l=t?.getState(),a=(l?"root"===n.id?l.appState.data.root.props:l.getItemById(n.id)?.props:void 0)??n.values??{};let r={};for(const[n,t]of o)r={...r,...e.write({...a,...r},n,t)};n.onChangeMany(r)}}var Pe={read:(e,n)=>e[n],write:(e,n,t)=>({[n]:t})},Ee={fieldKey:s,ownField:!0,read:(e,n)=>e[s(n)],write:(e,n,t)=>({[s(n)]:t})};function Ie(e){return{...Le(e),fieldKey:n=>`_${e}_${n}`}}function Ae({row:e,desktopKey:n,access:t,props:o}){const l=p(),a=l?.values?.[n],[r,i]=Oe(t,n);return t.ownField?e.render({...o,follows:a}):e.render({...o,value:r,storedValue:r,follows:a,onChange:i})}function Be(e,n,t=Ee){const o={...n,render:o=>/* @__PURE__ */X(Ae,{row:n,desktopKey:e,access:t,props:o})};return{[e]:l("desktop",n),[t.fieldKey(e)]:l("mobile",o)}}var Ke=["left","center","right"];function We(e,{options:n,value:t,onChange:o,ariaLabel:l,disabled:a=!1}){/* @__PURE__ */
|
|
3
|
-
return X(y,{options:n.map(n=>n.picture?{id:n.value,label:n.picture,title:e(n.title??n.label)}:{id:n.value,label:e(n.label),title:void 0===n.title?void 0:e(n.title)}),value:t,onChange:o,ariaLabel:e(l),disabled:a})}function Ge(e,{label:n,value:t,onChange:o,points:l}){const a=l.find(e=>e.disabled),r=l.map(n=>({...n,label:e(n.label),...n.title?{title:e(n.title)}:null}));/* @__PURE__ */
|
|
4
|
-
return X(v,{label:e(n),icon:/* @__PURE__ */X(O,{}),hint:a?.title?e(a.title):void 0,children:/* @__PURE__ */X($,{label:e(n),value:t,points:r,onChange:o})})}function Me({say:e,label:n,value:t,onChange:o,pointsFor:l}){const{appState:a,selectedItem:r}=m(e=>e),i=r?.props?.id?String(r.props.id):void 0;return Ge(e,{label:n,value:t,onChange:o,points:l(a?.data,i)})}function Ne({say:e,o:n}){const t=p(),l=k("panel",b),a=t?.values??{},r={x:ve(a[n.keys.x]),y:ve(a[n.keys.y])},i=e(n.label??"Position"),u=Boolean(r.x||r.y),s=e=>{const o=ye(n.keys,r,e);Object.keys(o).length&&t?.onChangeMany(o)},c=/* @__PURE__ */X(_,{label:i,value:r,onChange:s,words:{x:e("Left and right"),y:e("Up and down"),unit:"px"},placeholder:{x:"0",y:"0"},min:n.min,max:n.max,step:n.step??1}),d=/* @__PURE__ */X(o,{words:l,label:i,changed:u,detail:"0 px, 0 px",onReset:()=>s({x:null,y:null})});return null===n.label?/* @__PURE__ */z("div",{className:"sf-position-line",children:[c,d]}):/* @__PURE__ */X(v,{label:i,icon:/* @__PURE__ */X(S,{}),changed:u,action:d,children:c})}var Te={x:{start:/* @__PURE__ */X(A,{}),center:/* @__PURE__ */X(I,{}),end:/* @__PURE__ */X(E,{}),stretch:/* @__PURE__ */X(R,{}),between:/* @__PURE__ */X(T,{})},y:{start:/* @__PURE__ */X(N,{}),center:/* @__PURE__ */X(M,{}),end:/* @__PURE__ */X(G,{}),stretch:/* @__PURE__ */X(W,{}),between:/* @__PURE__ */X(K,{})}},Re=e=>"row"===e?"row":"column";function Ve({say:e,kind:n,label:t,options:o,value:l,onChange:a,o:r}){const i=p(),u="justify"===n==("row"===(r.runs??Re)(i?.values?.[r.directionKey??"direction"]))?"x":"y";return We(e,{options:o.map(e=>({label:e.label,value:e.value,picture:Te[u][e.value]})),value:l,onChange:a,ariaLabel:t})}function De({say:e,tier:n,o:t}){const o=p(),l=o?.values??{},a="mobile"===n?t.phoneKeys:t.keys,r=Object.fromEntries(ke.map(e=>[e,we(l[a[e]])])),i="mobile"===n?Object.fromEntries(ke.map(e=>[e,we(l[t.keys[e]])])):null;/* @__PURE__ */
|
|
5
|
-
return X($e,{say:e,o:t,value:r,follows:i,onChange:e=>{const n=xe(a,r,e);Object.keys(n).length&&o?.onChangeMany(n)}})}function Je({say:e,o:n,props:t}){/* @__PURE__ */
|
|
6
|
-
return X($e,{say:e,o:n,value:je(t.value),follows:"follows"in t?je(t.follows):null,readOnly:t.readOnly,onChange:e=>t.onChange(Fe(e))})}function $e({say:o,o:l,value:a,follows:r,readOnly:i,onChange:u}){const s=Object.fromEntries(ke.map(e=>[e,String(r?.[e]??l.fallback[e])])),[c,d]=C(()=>e(a,s));/* @__PURE__ */
|
|
7
|
-
return X(v,{label:o("Padding"),icon:/* @__PURE__ */X(B,{}),action:/* @__PURE__ */X(t,{each:c,label:o("Each side"),onChange:d,disabled:i}),children:/* @__PURE__ */X(n,{label:o("Padding"),each:c,value:a,placeholder:s,min:l.min,max:l.max,step:l.step,readOnly:i,onChange:u,words:{sides:{top:o("Padding top"),right:o("Padding right"),bottom:o("Padding bottom"),left:o("Padding left")},vertical:o("Top and bottom"),horizontal:o("Left and right"),unit:"px"}})})}function _e(e=H){function n(n,t,l,a,r,u,s="",c){const d="function"==typeof c?{action:c}:c??{},{action:p,clear:f}=d;return{type:"custom",...i({},{type:"number",label:n}),render:i=>{const c="storedValue"in i?i.storedValue:i.value,m="follows"in i,b=m||void 0!==f,h="number"==typeof i.value,g=m&&"number"==typeof i.follows?i.follows:void 0===f?u:"function"==typeof f.hint?f.hint(i):f.hint,y=h?i.value:b?null:u,k=""===s||"px"===s?s:` ${s}`,C=!f?.emptyLabel||m&&"number"==typeof i.follows?void 0:f.emptyLabel,w=C??`${g}${k}`,x=m?e("{value} on desktop").replace("{value}",w):w,j=!0===i.readOnly;/* @__PURE__ */
|
|
8
|
-
return X(v,{label:e(n),icon:Q(t),action:b?/* @__PURE__ */X(o,{label:e(n),changed:h,detail:x,disabled:j,onReset:()=>i.onChange(void 0)}):p?p(c,i.onChange):void 0,children:/* @__PURE__ */X("div",{className:"sf-slider",children:/* @__PURE__ */X(D,{min:l,max:a,step:r,value:y,suffix:s||void 0,showInput:!0,label:e(n),disabled:j,...b?{placeholderValue:g}:{},...C?{emptyLabel:C}:{},...void 0!==d.inputMax?{inputMax:d.inputMax}:{},size:"sm",boxSize:"md",className:"sf-slider-track",onChange:e=>{null===e?b&&h&&i.onChange(void 0):e!==y&&i.onChange(e)}})})})}}}function t(n){return We(e,n)}function u(n,o,l,a){const r=l.map(e=>"string"==typeof e?{label:e,value:e}:e);return{type:"custom",...i({},{type:"radio",label:n,options:r.map(e=>({value:e.value,label:e.label}))}),render:({value:l,onChange:i,field:u})=>/* @__PURE__ */X(v,{label:e(n),icon:Q(o),children:t({options:r,value:r.some(e=>e.value===l)?l:l||u?.currentValue||a,onChange:i,ariaLabel:n})})}}function c(e,n){return n.phone?e.unshift({label:"Match desktop",value:"",picture:/* @__PURE__ */X(P,{})}):n.inherit&&e.unshift({label:n.inherit,value:""}),e}function d(e,n){return n.inherit||n.phone?{...e,render:n=>e.render({...n,onChange:e=>n.onChange(""===e?void 0:e)})}:e}function p(e,n,t){return{[e]:l("desktop",n(t)),[s(e)]:l("mobile",n({...t,phone:!0},""))}}function f(e){return c(J(e.allow??Ke).map(e=>({label:e.label,value:e.value,picture:e.icon})),e)}function m(e={},n=e.fallback??"left"){return d(u(e.label??"Text alignment",/* @__PURE__ */X(w,{}),f(e),n),e)}function b(e){const n={left:Te.x.start,center:Te.x.center,right:Te.x.end};return c(J((e.allow??Ke).filter(e=>e in n)).map(e=>({label:e.label,value:e.value,picture:n[e.value]})),e)}function y(e={},n=e.fallback??"left"){return d(u(e.label??"Block alignment",/* @__PURE__ */X(x,{}),b(e),n),e)}function k(n,t,o,l,a,r){return{type:"custom",options:l,fallback:a,...i({},{type:"radio",label:t,options:l.map(e=>({value:e.value,label:e.label}))}),render:({value:i,onChange:u,field:s})=>{const c=s.options??l,d=s.fallback??a,p=c.some(e=>e.value===i)?i:d;/* @__PURE__ */
|
|
9
|
-
return X(v,{label:e(t),icon:Q(o),children:/* @__PURE__ */X(Ve,{say:e,kind:n,label:t,options:c,value:p,onChange:u,o:r})})}}}function C(e={}){return k("justify","Justify",/* @__PURE__ */X(x,{}),le,le[0].value,e)}function O(e={}){return k("align","Item alignment",/* @__PURE__ */X(V,{}),ae,"stretch",e)}function S(){const n=re;return{type:"custom",options:ie,fallback:ie[1].value,...i({},{type:"radio",label:n,options:ie.map(e=>({value:e.value,label:e.label}))}),render:({value:t,onChange:o,id:l,name:a})=>{const r=`${l??a??n}-label`;/* @__PURE__ */
|
|
10
|
-
return X(v,{label:e(n),labelId:r,icon:/* @__PURE__ */X(j,{}),action:/* @__PURE__ */X(h,{checked:(i=t,!0===i||"wrap"===i),onChange:e=>o(e?ie[0].value:ie[1].value),ariaLabelledBy:r})});var i}}}function E({offered:e,fallback:n,resolve:t}){const o=t??(t=>e.some(e=>e.value===t)?t:n),l=u(ue,Z("`Direction` names how a container’s children run — a MODIFIER, not a thing. doc/naming.md N10.1 gives the idea a dash in its Glyph column; the shell’s own `direction` meaning says the bare row is CORRECT and not an omission (SS seat, 2026-09-11)."),e.map(e=>({label:e.label,value:e.value})),o(void 0));return{type:"custom",render:e=>l.render({...e,value:o(e.value),onChange:n=>e.onChange(n)})}}function I({min:e,max:t,step:o,builtIn:l,resolve:a,action:r,mark:i}){const u=n("Gap",/* @__PURE__ */X(F,{}),e,t,o,l,"px",r),s=a??(e=>"number"==typeof e?e:l);return{...i,type:"custom",render:e=>u.render({...e,value:s(e.value,e.field),storedValue:e.value,onChange:n=>e.onChange(n)})}}function A(n,{fallback:t=fe,pointsFor:o}={}){return{type:"custom",render:({value:l,onChange:a})=>{const r=he(l,t);return o?/* @__PURE__ */X(Me,{say:e,label:n,value:r,onChange:a,pointsFor:o}):Ge(e,{label:n,value:r,onChange:a,points:be})}}}function B(n){return{[n.keys.x]:{type:"custom",render:()=>/* @__PURE__ */X(Ne,{say:e,o:n})},[n.keys.y]:{...a({type:"custom",render:()=>/* @__PURE__ */X(r,{})},"always"),reachedBy:n.keys.x}}}function K(n={}){const t={...Ce,...n.keys},o={keys:t,phoneKeys:Object.fromEntries(ke.map(e=>[e,s(t[e])])),fallback:{top:0,right:0,bottom:0,left:0,...n.fallback},min:n.min??0,max:n.max??200,step:n.step??4},i=!1!==n.phone,u=!1===n.group?{}:{_gSpacing:te("Padding")};if(n.object){const t={type:"custom",render:n=>/* @__PURE__ */X(Je,{say:e,o:o,props:n})};return ee({...u,...i?Be(n.object.key,t,n.object.phone):{[n.object.key]:t}})}const c=n=>{const t={type:"custom",render:()=>/* @__PURE__ */X(De,{say:e,tier:n,o:o})};return i?l(n,t):t},d=()=>a({type:"custom",render:()=>/* @__PURE__ */X(r,{})},"always"),p=ke.filter(e=>"top"!==e);return ee({...u,[o.keys.top]:c("desktop"),...i?{[o.phoneKeys.top]:c("mobile")}:{},...Object.fromEntries(p.map(e=>[o.keys[e],{...d(),reachedBy:o.keys.top}])),...i?Object.fromEntries(p.map(e=>[o.phoneKeys[e],l("mobile",d())])):{}})}return{slider:n,select:function(n,t,o,l,a){return{type:"custom",options:o,fallback:l,...a?{note:a}:{},...i({},{type:"select",label:n}),render:({value:r,onChange:i,field:u})=>{const s=u.options??o,c=u.fallback??l,d=s.some(e=>e.value===r)?r:c;/* @__PURE__ */
|
|
11
|
-
return X(v,{label:e(n),icon:Q(t),children:/* @__PURE__ */X(g,{value:d,ariaLabel:e(n),onChange:i,options:[...a?[{label:e(a),value:"\0note",disabled:!0}]:[],...s.map(n=>({label:e(n.label),value:n.value}))]})})}}},Segmented:t,segmented:u,boxJustifyField:C,boxAlignField:O,boxWrapField:S,directionField:E,gapField:I,placementField:A,PlacementGridView:function(n){return Ge(e,n)},positionFields:B,sidesPaddingFields:K,alignmentField:m,alignmentFields:function(e="align",n={}){return p(e,m,n)},AlignmentStrip:function({opts:e={},value:n,onChange:o,ariaLabel:l,disabled:a=!1}){return t({options:f(e),value:n,onChange:o,ariaLabel:l,disabled:a})},blockAlignmentField:y,blockAlignmentFields:function(e="align",n={}){return p(e,y,n)},BlockAlignmentStrip:function({opts:e={},value:n,onChange:o,ariaLabel:l,disabled:a=!1}){return t({options:b(e),value:n,onChange:o,ariaLabel:l,disabled:a})},boxFieldSet:function(e={}){const t=e.width??de,o=e.nudge?.limit??40,l=e.direction??{offered:se,fallback:"column"},a=l.resolve??(e=>l.offered.some(n=>n.value===e)?e:l.fallback),r={runs:e=>"row"===a(e)?"row":"column"};return{_gLayout:te("Layout"),placement:A("Placement",e.placement),width:n("Width",/* @__PURE__ */X(L,{}),t.min,t.max,t.step,t.fallback,"%"),direction:E(l),gap:I(e.gap??ce),justify:C(r),align:O(r),wrap:S(),_gNudge:te("Nudge"),...B({keys:e.nudge?.keys??{x:"nudgeX",y:"nudgeY"},min:-o,max:o,label:null}),...K(e.padding)}}}}var{slider:Xe,select:Ye,Segmented:ze,segmented:He,boxJustifyField:Ue,boxAlignField:Ze,boxWrapField:qe,directionField:Qe,gapField:en,placementField:nn,PlacementGridView:tn,positionFields:on,sidesPaddingFields:ln,alignmentField:an,alignmentFields:rn,AlignmentStrip:un,blockAlignmentField:sn,blockAlignmentFields:cn,BlockAlignmentStrip:dn,boxFieldSet:pn}=_e();export{me as ANCHOR_LABELS,un as AlignmentStrip,ae as BOX_ALIGN_POINTS,se as BOX_DIRECTIONS,ue as BOX_DIRECTION_LABEL,ce as BOX_GAP,le as BOX_JUSTIFY_POINTS,ge as BOX_NUDGE_LIMIT,pe as BOX_PLACEMENTS,fe as BOX_PLACEMENT_DEFAULT,de as BOX_WIDTH,re as BOX_WRAP_LABEL,ie as BOX_WRAP_POINTS,dn as BlockAlignmentStrip,Pe as FLAT_ACCESS,be as OPEN_PLACEMENT_POINTS,Ee as PHONE_KEY_ACCESS,tn as PlacementGridView,Ce as SIDE_PAD_KEYS,ze as Segmented,an as alignmentField,rn as alignmentFields,sn as blockAlignmentField,cn as blockAlignmentFields,Ze as boxAlignField,_e as boxFieldBuilders,pn as boxFieldSet,Ue as boxJustifyField,qe as boxWrapField,Qe as directionField,en as gapField,te as group,Q as iconOf,q as isNoGlyph,Z as noGlyph,he as normaliseBoxPlacement,Le as objectAccess,Ie as phoneObjectAccess,Be as phoneTwinFields,nn as placementField,on as positionFields,ye as positionPatch,oe as section,He as segmented,Ye as select,ee as sharedStyleKinds,je as sidesFromObject,ln as sidesPaddingFields,xe as sidesPaddingPatch,Fe as sidesToObject,Xe as slider,Se as useAccessPatch,Oe as useAccessValue};
|
package/dist/chunk-BBD3FLU3.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{findCopy as e,repeatCopyWithWrapper as t}from"./chunk-JQQFB7EZ.js";import{DEFAULT_CANVAS_WORDS as n}from"./chunk-TBY3DFKS.js";import{useResolvedFields as o}from"./chunk-K53PQAMP.js";import{toItemSelector as r,fromItemSelector as l,useNodeOps as i,parentStep as s,clickPickPart as a,clickPick as c}from"./chunk-QTHQPJWA.js";import{selectionBox as u,placeWindow as d,offsetOrigin as p,colorRunOf as f,ColorWindow as h,startCanvasTyping as m,textMap as g,richLayout as v}from"./chunk-HZSZT3BE.js";import{DEFAULT_COPY_WORDS as y}from"./chunk-PMRN5Z3T.js";import{useWords as w}from"./chunk-MFIRYGHW.js";import{CANVAS_TYPABLE_EVENT as b,CANVAS_TYPING_EVENT as k}from"./chunk-TOKMFZPB.js";import{setCanvasNonce as S,related as C,isTypingTarget as E,upsertCanvasStyle as x,removeCanvasStyle as I,WORDS_CLEAR as D,frameRectToHost as A,drawnBox as O}from"./chunk-FR7EEKFF.js";import{queryAllCopies as M}from"./chunk-7UFKEX72.js";import{find as $,ROOT_ID as P,getList as R,remove as z,parseZoneKey as N,move as j,duplicate as V,replaceNode as L,createNode as B,insert as K,normalizeData as Z,createResolveCache as F,slotsOf as T,resolveNodeData as H,ROOT_SLOT as W}from"./chunk-EUFDQ4KL.js";import{topLevelSlotKeys as q,fieldsFrom as Q,drawnBlockCount as Y,defaultsFrom as U}from"./chunk-KXM6YRG2.js";import{createContext as X,useEffect as G,useContext as J,useRef as _,useSyncExternalStore as ee,useState as te,useReducer as ne,useMemo as oe,useCallback as re,useLayoutEffect as le}from"react";import{jsx as ie,jsxs as se,Fragment as ae}from"react/jsx-runtime";import{createPortal as ce}from"react-dom";import{registerModalEscapeInterceptor as ue,FloatingBar as de,TextToolbar as pe,LinkPicker as fe}from"efficient-shell/ui";function he(e){return!["setData","setUi","set"].includes(e.type)}var me=(e,t,n,o)=>{const r=R(e,t,N(n));return r?.[o]??null},ge=(e,t,n,o,r)=>{const l=me(e,t,n,o);if(!l)throw new Error(`${r}: nothing at ${n}[${o}]`);return l};function ve(e,t){const{selection:n}=e;return{...e.ui,itemSelector:r(e.data,t,n),selectedSlot:n&&"slot"===n.kind?{parentId:n.parentId,slot:n.slot}:null}}function ye(e,t,n){return n?"node"===n.kind?$(e,t,n.id)?n:null:n.parentId===P?R(e,t,n)?n:null:$(e,t,n.parentId)&&R(e,t,n)?n:null:null}function we(e,t,n,o=!1){const{itemSelector:r,selectedSlot:i,...s}=n;let a=e.selection;var c;return"itemSelector"in n&&(a=l(e.data,t,r??null)),"selectedSlot"in n&&(i?a=(c=i)?{kind:"slot",parentId:c.parentId,slot:c.slot}:null:"slot"===a?.kind&&(a=null)),{...e,selection:a,ui:o?s:{...e.ui,...s}}}function be(e,t,n){const o=ke(e,t,n);if(o===e)return e;const r=ye(o.data,n,o.selection);return r===o.selection?o:{...o,selection:r}}function ke(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 we(e,n,"function"==typeof t.ui?t.ui(ve(e,n)):t.ui);case"set":{const r={data:o,ui:ve(e,n)},l="function"==typeof t.state?t.state(r):t.state;let i=l.data?{...e,data:l.data}:e;return l.ui&&(i=we(i,n,l.ui,!0)),i}case"insert":{const r={...N(t.destinationZone),index:t.destinationIndex},l=B(n,t.componentType,{},t.id?{id:t.id}:{});return{...e,data:K(o,n,r,l)}}case"replace":{const r=ge(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:L(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=ge(o,n,t.sourceZone,t.sourceIndex,"duplicate"),l=V(o,n,r.props.id),i=me(l,n,t.sourceZone,t.sourceIndex+1);return{...e,data:l,selection:i?{kind:"node",id:i.props.id}:e.selection}}case"reorder":return ke(e,{...t,type:"move",sourceZone:t.destinationZone},n);case"move":{if(t.sourceZone===t.destinationZone&&t.sourceIndex===t.destinationIndex)return e;const r=me(o,n,t.sourceZone,t.sourceIndex);if(!r)return e;const l={...N(t.destinationZone),index:t.destinationIndex};return{...e,data:j(o,n,r.props.id,l)}}case"remove":{const r=ge(o,n,t.zone,t.index,"remove");return{...e,data:z(o,n,r.props.id)}}default:return e}}var Se={drag:!0,duplicate:!0,delete:!0,edit:!0,insert:!0},Ce={leftSideBarVisible:!0,rightSideBarVisible:!0,arrayState:{},componentList:{},isDragging:!1,previewMode:"edit",viewports:{current:{width:360,height:"auto"},options:[],controlsVisible:!0},field:{focus:null}},Ee=0,xe=()=>`history-${Ee+=1}`;function Ie(e){let t=e.config;const n=e.now??(()=>Date.now()),o=e.historyCoalesceMs??250;let i=e.permissions??{};const s=Z(e.data,t);let a=s,c={data:s,selection:null,ui:{...Ce}};if(e.ui){const{itemSelector:n,selectedSlot:o,...r}=e.ui;c={data:s,selection:o?{kind:"slot",...o}:l(s,t,n??null),ui:{...Ce,...r}}}let u=[{core:c,at:-1/0,sealed:!0,id:xe()}],d=0;const p=e=>{const t=u[d],r=n();!e&&d===u.length-1&&d>0&&!t.sealed&&r-t.at<o?u=[...u.slice(0,d),{...t,core:c,at:r}]:(u=[...u.slice(0,d+1),{core:c,at:r,sealed:e,id:xe()}],d=u.length-1)},f=/* @__PURE__ */new Set;let h=null,m=null,g=0,v=null,y=!1;const w=()=>{for(const e of[...f])e()},b=()=>{u=[...u.slice(0,d),{...u[d],core:c},...u.slice(d+1)]},k=(t,n)=>{g>0?y=y||n:(n?p(!1):c!==t&&b(),c.data!==t.data&&e.onChange?.(c.data),c!==t&&w())},S=e=>{const n=c;if(c=be(c,e,t),c===n)return;const o=e.recordHistory??he(e);k(n,o&&c.data!==n.data)},C=t=>{0===g&&(v=c,y=!1),g+=1;try{t()}catch(e){throw g-=1,0===g&&v&&(c=v,v=null),e}if(g-=1,g>0||!v)return;const n=v;v=null,y&&c.data!==n.data?p(!0):c!==n&&b(),c.data!==n.data&&e.onChange?.(c.data),c!==n&&w()},E=e=>{const n=c,o=ye(c.data,t,e);var r,l;(r=o,l=c.selection,r===l||r&&l&&r.kind===l.kind&&("node"===r.kind&&"node"===l.kind?r.id===l.id:"slot"===r.kind&&"slot"===l.kind&&r.parentId===l.parentId&&r.slot===l.slot))||(c={...c,selection:o},k(n,!1))},x=t=>{const n=c;d=t,c=u[d].core,c.data!==n.data&&e.onChange?.(c.data),c!==n&&w()},I=()=>(e={})=>{const n=e.root?t.root?.permissions:t.components[e.item?.type??e.type??""]?.permissions;return{...Se,...i,...n}};let D=I();const A=F(),O={resolveCache:A,async resolveAll({trigger:e="load",metadata:n}={}){const o=c.data,r={type:"root",props:{...o.root.props??{}}},l=[...o.content,...Object.values(o.zones??{}).flat()],[i,...s]=await Promise.all([H(r,t,{cache:A,trigger:e,metadata:n}),...l.map(o=>H(o,t,{cache:A,trigger:e,metadata:n}))]);C(()=>{const n=c;let r=c.data;s.forEach((e,n)=>{if(!e.didChange)return;const i=l[n].props.id,s=$(r,t,i)?.node;s&&s===$(o,t,i)?.node&&(r=L(r,t,i,e.node))}),i.didChange&&r.root===o.root&&(r={...r,root:{...r.root,props:i.node.props,readOnly:i.node.readOnly??r.root.readOnly}}),r!==c.data&&("load"===e&&c.data===a&&(a=r),c={...c,data:r,selection:ye(r,t,c.selection)},k(n,!1))})},async resolveNode(e,{trigger:n="replace",metadata:o}={}){const r=$(c.data,t,e)?.node;if(!r)return!1;const l=await H(r,t,{cache:A,trigger:n,metadata:o});if(!l.didChange)return!1;let i=!1;return C(()=>{const n=c;if($(c.data,t,e)?.node!==r)return;const o=L(c.data,t,e,l.node);o!==c.data&&(c={...c,data:o,selection:ye(o,t,c.selection)},k(n,!1),i=!0)}),i},get config(){return t},get loaded(){return a},getState(){if(h&&m===c)return h;const e=c,n={data:e.data,ui:ve(e,t)},o="node"===e.selection?.kind?$(e.data,t,e.selection.id)?.node??null:null;return h={appState:n,selection:e.selection,selectedItem:o,config:t,dispatch:S,history:{back:()=>O.undo(),forward:()=>O.redo(),hasPast:d>0,hasFuture:d<u.length-1,histories:u.map(e=>({id:e.id,state:{data:e.core.data,ui:ve(e.core,t)}})),index:d,setHistoryIndex:e=>{e>=0&&e<u.length&&e!==d&&x(e)}},getPermissions:D,getItemById:n=>$(e.data,t,n)?.node,getItemBySelector:n=>function(e,t,n){const[o,r]=(n.zone??"root:default-zone").split(/:(.*)/s);return R(e,t,{parentId:o,slot:r})?.[n.index]}(e.data,t,n),getSelectorForId:n=>{const o=r(e.data,t,{kind:"node",id:n});return o?{index:o.index,zone:o.zone??"root:default-zone"}:void 0}},m=e,h},subscribe:e=>(f.add(e),()=>{f.delete(e)}),dispatch:S,batch:C,group:()=>{const e=d,t=u[e].id;let n=!0;return{close:()=>{if(!n)return;if(n=!1,u[e]?.id!==t)return;if(d<=e+1)return void(d===e+1&&(u=[...u.slice(0,d),{...u[d],sealed:!0},...u.slice(d+1)]));const o=u[d];u=[...u.slice(0,e+1),{...o,sealed:!0},...u.slice(d+1)],d=e+1}}},select:e=>E(e?{kind:"node",id:e}:null),selectSlot:e=>E(e?{kind:"slot",parentId:e.parentId,slot:e.slot}:null),run(e){C(()=>{const n=c,o=void 0===e.select?c.selection:e.select;c={...c,data:e.data,selection:ye(e.data,t,o)},k(n,e.data!==n.data)})},load(e,n={}){const o=c,r=Z(e,t);c={...c,data:r,selection:ye(r,t,n.selection??c.selection)},a=r,n.keepHistory||(u=[{core:c,at:-1/0,sealed:!0,id:xe()}],d=0),c!==o&&w()},undo(){d>0&&x(d-1)},redo(){d<u.length-1&&x(d+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,i)||(i=e,D=I(),h=null,w())},setConfig(e){e!==t&&(t=e,D=I(),h=null,w())}};return O}function De(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&&E(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 Ae=X(null),Oe=X(!0);function Me({easel:e,hotkeys:t=!0,resolveOnMount:n=!0,children:o}){return G(()=>{n&&e.resolveAll()},[e,n]),G(()=>{if(t&&"undefined"!=typeof document)return De(document,e)},[e,t]),/* @__PURE__ */ie(Ae.Provider,{value:e,children:/* @__PURE__ */ie(Oe.Provider,{value:t,children:o})})}function $e(){const e=J(Ae);if(!e)throw new Error("useEasel: no <EaselProvider> above this component");return e}function Pe(e){const t=$e(),n=_({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 l=e(o);return r.has&&Object.is(r.value,l)?(n.current={view:o,selector:e,value:r.value,has:!0},r.value):(n.current={view:o,selector:e,value:l,has:!0},l)};return ee(t.subscribe,o,o)}function Re(){return function(e){return Pe(e)}}var ze=["--es-accent","--es-accent-tint","--es-accent-tint-strong","--es-accent-line","--es-accent-text","--es-accent-ring","--es-accent-shadow","--es-on-accent","--status-success-solid","--elevation-panel"],Ne="host-tokens";function je(e,t){const n=function(e){const t=e.ownerDocument.defaultView;if(!t)return"";const n=t.getComputedStyle(e),o=[];for(const e of ze){const t=n.getPropertyValue(e).trim();t&&o.push(`${e}: ${t};`)}return o.length?`:root { ${o.join(" ")} }`:""}(e);n?x(t,Ne,n):I(t,Ne)}var Ve="data-easel-block",Le="data-easel-dropzone",Be={},Ke="data-es-mirror",Ze="undefined"==typeof window?G:le;function Fe(e,t,n){for(const e of Array.from(t.head.querySelectorAll(`[${Ke}]`)))e.remove();for(const o of Array.from(e.head.querySelectorAll('style, link[rel="stylesheet"]'))){const e=o.cloneNode(!0);e.setAttribute(Ke,""),n&&e.setAttribute("nonce",n),t.head.appendChild(e)}}function Te({children:e,id:t="preview-frame",title:o,className:r,style:l,mirrorStyles:i=!0,onDocument:s,height:a="auto",nonce:c}){const u=w("canvas",n),d=_(null),[p,f]=te(null);return Ze(()=>{const e=d.current,t=p?.ownerDocument.defaultView;if("auto"!==a||!e||!p||!t)return;const n=()=>{e.style.height=`${Math.ceil(p.getBoundingClientRect().height)}px`};n();const o=t.ResizeObserver,r=o?new o(n):null;return r?.observe(p),()=>r?.disconnect()},[p,a]),Ze(()=>{let e=d.current?.contentDocument;if(!e)return;"CSS1Compat"!==e.compatMode&&(e.open(),e.write("<!DOCTYPE html><html><head></head><body></body></html>"),e.close(),e=d.current?.contentDocument??e),e.body||e.documentElement.appendChild(e.createElement("body")),e.body.style.margin="0";const t=e.createElement("div");t.setAttribute("data-easel-entry",""),t.id="frame-root","fill"===a&&t.classList.add("es-frame-fill"),e.body.appendChild(t),S(e,c),f(t),s?.(e);let n=null;const o=d.current?.ownerDocument;if(i&&o){Fe(o,e,c);const t=o.defaultView;t&&"MutationObserver"in t&&(n=new t.MutationObserver(()=>Fe(o,e,c)),n.observe(o.head,{childList:!0,subtree:!0,characterData:!0}))}let r=null;const l=d.current;if(l&&o){je(l,e);const t=o.defaultView;if(t&&"MutationObserver"in t){r=new t.MutationObserver(()=>je(l,e)),r.observe(o.head,{childList:!0,subtree:!0,characterData:!0});const n={attributes:!0,attributeFilter:["class","style","data-theme"]};for(const e of[o.documentElement,o.body,l.closest(".es-editor")])e&&r.observe(e,n)}}return()=>{n?.disconnect(),r?.disconnect(),t.remove(),f(null),s?.(null)}},[]),/* @__PURE__ */ie("iframe",{ref:d,id:t,title:o??u.frame,className:["es-canvas-frame","fill"===a?"is-fill":"",r??""].filter(Boolean).join(" "),style:l,children:p?ce(e,p):null})}var He=X(null),We=X(Be),qe=[];function Qe({parentId:e,slot:t,className:n,style:o,minEmptyHeight:r=128,minEmptyWidth:l=120}){const i=$e(),s=Pe(n=>R(n.appState.data,i.config,{parentId:e,slot:t})??qe),a=Pe(t=>"node"===t.selection?.kind&&t.selection.id===e&&e!==P),c=Pe(n=>"slot"===n.selection?.kind&&n.selection.parentId===e&&n.selection.slot===t),u=J(He),d=["es-zone"];return s.length&&d.push("has-children"),e===P&&d.push("is-root"),(a||c)&&d.push("is-area-selected"),null!==u&&u===e&&e!==P&&d.push("is-hovering-area"),n&&d.push(n),/* @__PURE__ */ie("div",{className:d.join(" "),[Le]:`${e}:${t}`,style:{...o,"--min-empty-height":`${r}px`,"--min-empty-width":`${l}px`},children:s.map(e=>/* @__PURE__ */ie(tt,{node:e},e.props.id))})}function Ye(e,t,n,o){const r=oe(()=>{const n={};for(const o of q(Q(e)))n[o]=Object.assign(function(e={}){/* @__PURE__ */
|
|
2
|
-
return ie(Qe,{parentId:t,slot:o,...e})},{blockCount:0});return n},[e,t]);for(const e of Object.keys(r))r[e].blockCount=Y(n[e],o);return r}function Ue(e){return oe(()=>function({zone:t,...n}){/* @__PURE__ */
|
|
3
|
-
return ie(Qe,{parentId:e,slot:t,...n})},[e])}var Xe=["top","bottom","zIndex"];function Ge(e,t,n){e.style[t]!==n&&(e.style[t]=n)}function Je(e){const t=function(e){const t=e?.ownerDocument.defaultView?.getComputedStyle(e);if(!t||"sticky"!==t.position)return null;const n=e=>"auto"===e?"":e;return{top:n(t.top),bottom:n(t.bottom),zIndex:n(t.zIndex)}}(function(e){const t=e.ownerDocument.defaultView;let n=null;for(const o of Array.from(e.children))if("none"!==t?.getComputedStyle(o).display){if(n)return null;n=o}return n}(e));Ge(e,"position",t?"sticky":"relative");for(const n of Xe)Ge(e,n,t?.[n]??"");return!!t}var _e="data-es-canvas-relative";function et(e){e.hasAttribute(_e)&&("relative"===e.style.position&&(e.style.position=""),e.removeAttribute(_e));const t=e.ownerDocument.defaultView?.getComputedStyle(e).position;return t&&"static"!==t?"sticky"===t:(e.style.position||(e.style.position="relative",e.setAttribute(_e,"")),!1)}function tt({node:e}){const t=$e().config,n=t.components[e.type],o=e.props.id,r=_(null),l=function(e,t){return oe(()=>n=>{const o=t.current;o&&o!==n&&(o.removeAttribute(Ve),o.removeAttribute("data-easel-dnd")),t.current=n,n&&(n.setAttribute(Ve,e),n.setAttribute("data-easel-dnd",e),et(n))},[e,t])}(o,r),i=_(null),s=!!n?.inline;!function(e,t){const n=_(!1),o=_(()=>{});o.current=()=>{const o=e(),l=n.current;n.current=!!o&&t(o),l!==n.current&&r.current()};const r=_(()=>{});Ze(()=>o.current()),Ze(()=>{const t=e(),l=t?.ownerDocument.defaultView;if(!t||!l)return;const i=()=>o.current();l.addEventListener("resize",i);const s=l.ResizeObserver,a=s?new s(i):null;a?.observe(t);let c=null;return r.current=()=>{c?.disconnect(),c=null;const e=t.ownerDocument.documentElement;n.current&&e&&l.MutationObserver&&(c=new l.MutationObserver(i),c.observe(e,{attributes:!0}))},r.current(),()=>{l.removeEventListener("resize",i),a?.disconnect(),c?.disconnect(),r.current=()=>{}}},[])}(()=>s?r.current:i.current,e=>s?et(e):Je(e));const a=J(We),c=Ye(n,o,e.props,t.components),u=Ue(o);if(!n?.render)return null;const d=n.render,p={...U(n),...e.props,...c},f={renderDropZone:u,isEditing:!0,dragRef:n.inline?l:null,metadata:{...a,...n.metadata}};return n.inline?/* @__PURE__ */ie(d,{...p,editor:f,editMode:!0}):
|
|
4
|
-
/* @__PURE__ */ie("div",{ref:i,[Ve]:o,"data-easel-dnd":o,style:{position:"relative"},children:/* @__PURE__ */ie(d,{...p,editor:f,editMode:!0})})}function nt({metadata:e}){const t=Pe(e=>e.config),n=Pe(e=>e.appState.data.root).props??{},o=t.root?.render,r=Ye(t.root,P,n,t.components),l=Ue(P),i=/* @__PURE__ */ie(Qe,{parentId:P,slot:W}),s=o?/* @__PURE__ */ie(o,{id:"page-root",...n,...r,editor:{renderDropZone:l,isEditing:!0,dragRef:null,metadata:e??{}},editMode:!0,children:i}):i;/* @__PURE__ */
|
|
5
|
-
return ie(We.Provider,{value:e??Be,children:s})}var ot=X(void 0),rt=X(void 0);function lt(e,t,n,o){const r=$(e,t,n);return!!r&&(T(r.node,t).length>0||!1===o.whole)}var it=X(void 0),st="data-es-chrome",at=X(void 0);function ct(e){const t=e?.closest?.(`[${st}]`)??null,n=t?.getAttribute(st);return t&&n?{id:n,element:t}:null}function ut({element:e}){const t=_(null),n=ft(t,e?()=>e:null,e);/* @__PURE__ */
|
|
6
|
-
return ie("div",{ref:t,"aria-hidden":"true",className:"es-canvas-outline is-hover is-hover-part",style:n?{position:"absolute",top:n.top,left:n.left,width:n.width,height:n.height}:{display:"none"}})}var dt={"--es-words-clear":`${D}px`};function pt({element:e,words:t=!1}){const n=_(null),o=ft(n,e?()=>e:null,e);/* @__PURE__ */
|
|
7
|
-
return ie("div",{ref:n,"aria-hidden":"true",className:"es-canvas-outline is-selected is-selected-part"+(t?" is-words":""),style:o?{position:"absolute",top:o.top,left:o.left,width:o.width,height:o.height,...dt}:{display:"none"}})}function ft(e,t,n){return mt(e,t?e=>{const n=t(e);return n?[n]:[]}:null,n)[0]??null}var ht=[];function mt(e,t,n){const[o,r]=te(ht),l=_(t);return l.current=t,Ze(()=>{const t=e.current?.ownerDocument,n=t?.defaultView;if(!t||!n||!l.current)return void r(ht);let o=0;const i=()=>{o=0;const n=e.current?.parentElement??null,i=(l.current?l.current(t):[]).map(e=>function(e,t){if(!e||!t)return null;const n=O(e),o=t.getBoundingClientRect();return{top:n.top-o.top,left:n.left-o.left,width:n.width,height:n.height}}(e,n)).filter(e=>null!==e);r(e=>{return(t=e)===(n=i)||t.length===n.length&&t.every((e,t)=>function(e,t){return e===t||!!e&&!!t&&e.top===t.top&&e.left===t.left&&e.width===t.width&&e.height===t.height}(e,n[t]))?e:i.length?i:ht;var t,n})},s=()=>{o||(o=(n.requestAnimationFrame??(e=>n.setTimeout(e,16)))(i))};i();const a="MutationObserver"in n?new n.MutationObserver(s):null;a?.observe(t.body,{childList:!0,subtree:!0,attributes:!0,characterData:!0});const c="ResizeObserver"in n?new n.ResizeObserver(s):null;return c?.observe(t.documentElement),n.addEventListener("resize",s),n.addEventListener("scroll",s,{capture:!0,passive:!0}),()=>{a?.disconnect(),c?.disconnect(),n.removeEventListener("resize",s),n.removeEventListener("scroll",s,{capture:!0}),o&&(n.cancelAnimationFrame??n.clearTimeout)(o)}},[n]),o}function gt({id:e,kind:t,overlay:n}){const o=_(null),r=J(rt),l=null!==e&&!0===r?.(e),i=mt(o,e?t=>M(t,`[${Ve}="${t.defaultView?.CSS?.escape?t.defaultView.CSS.escape(e):e}"]`):null,e),[s,...a]=i,c=`es-canvas-outline is-${t}${l?" is-shared":""}`,u=e=>({position:"absolute",top:e.top,left:e.left,width:e.width,height:e.height}),d=/* @__PURE__ */se(ae,{children:[
|
|
8
|
-
/* @__PURE__ */ie("div",{ref:o,"aria-hidden":"true",className:c,style:s?u(s):{display:"none"}}),a.map((e,t)=>/* @__PURE__ */ie("div",{"aria-hidden":"true",className:c,style:u(e)},t))]});return n&&e?/* @__PURE__ */ie(n,{componentId:e,kind:t,children:d}):d}function vt(e,n){return Array.from(e.querySelectorAll(`[${Ve}]`)).find(o=>o.getAttribute(Ve)===n&&t(o)?.wrapper===e)??null}function yt(e,t,n){const o=g(e,n),r=o.text.length,l=e.ownerDocument;if(!t)return[r,r];let i=null;const s=l.caretPositionFromPoint?.(t.x,t.y);if(s&&e.contains(s.offsetNode))i=o.at(s.offsetNode,s.offset);else{const n=l.caretRangeFromPoint?.(t.x,t.y);n&&e.contains(n.startContainer)&&(i=o.at(n.startContainer,n.startOffset))}if(null===i)return[r,r];const a=o.text;let c=i,u=i;for(;c>0&&!/\s/.test(a[c-1]);)c-=1;for(;u<a.length&&!/\s/.test(a[u]);)u+=1;return[c,u]}function wt({s:e,element:t,toolbar:n,label:o,keys:r}){const l=w("copy",y),i=e.pressed(),s=new Set(n.offered),a=n.colors&&n.colors.length>0?n.colors:null,c=_(null),[m,g]=te(!1),[v,b]=te(null),k=m||null!==v,S=()=>{e.hold(),g(!1),b({href:e.pressed().href})},C=()=>{g(!1),b(null),e.resume()};le(()=>{r.current={escape:()=>!!k&&(C(),!0),link:()=>!!s.has("link")&&(S(),!0)}}),le(()=>()=>{r.current=null},[r]);const E=_(C);E.current=C,G(()=>{if(m)return ue(e=>{const t=c.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&(E.current(),!0)},()=>c.current?.querySelector(".es-copy-colors"))},[m]),G(()=>{const n=c.current;if(!k||!n)return;const o=/* @__PURE__ */new Set([n.ownerDocument]),r=t();r&&o.add(r.ownerDocument);const l=o=>{const r=o.target;if(r&&n.contains(r))return;g(!1),b(null);const l=t();r&&l&&l.contains(r)?e.release():e.stop("outside")};for(const e of o)e.addEventListener("pointerdown",l,!0);return()=>{for(const e of o)e.removeEventListener("pointerdown",l,!0)}},[k,e,t]),le(()=>{const e=c.current,n=e?.querySelector(".rosh-tb-wrap > .es-copy-pop"),o=t();if(!(k&&e&&n&&o))return;const r=o.ownerDocument.defaultView?.getSelection()??null,l=r&&r.rangeCount>0&&o.contains(r.getRangeAt(0).startContainer)?r.getRangeAt(0):null,i=(l?u(l,o):null)??(()=>{const e=o.getBoundingClientRect();return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}})(),s=o.ownerDocument.defaultView?.frameElement,a=s?A(s,{left:i.left,top:i.top,width:i.right-i.left,height:i.bottom-i.top}):{left:i.left,top:i.top,width:i.right-i.left,height:i.bottom-i.top},f=o.getBoundingClientRect(),h=s?A(s,{left:f.left,top:f.top,width:f.width,height:f.height}):{left:f.left,top:f.top,width:f.width,height:f.height},m=(e.closest("[data-floating-bar]")??e).getBoundingClientRect(),g={left:a.left,right:a.left+a.width,top:Math.min(a.top,h.top-6,m.top),bottom:Math.max(a.top+a.height,h.top+h.height+6,m.bottom)},v=e.ownerDocument.documentElement,y=(s??o.closest(".es-canvas")??o).getBoundingClientRect(),w={left:Math.max(0,y.left),top:Math.max(0,y.top),right:Math.min(v.clientWidth||y.right,y.right),bottom:Math.min(v.clientHeight||y.bottom,y.bottom)};if(w.right<=w.left||w.bottom<=w.top||0===n.offsetWidth)return;const b=d({anchor:g,size:{width:n.offsetWidth,height:n.offsetHeight},within:{left:y.left,top:y.top,right:y.right,bottom:y.bottom},clip:w,parent:p(n)});n.style.top=`${b.top}px`,n.style.left=`${b.left}px`,n.style.setProperty("--es-pop-point",`${b.point}px`),n.dataset.side=b.above?"above":"below"});const x=a?{run:f(i.color,a),open:m,onToggle:()=>{b(null),m?C():(e.hold(),g(!0))}}:void 0;/* @__PURE__ */
|
|
9
|
-
return ie(de,{anchor:()=>{const e=t();if(!e)return null;const n=e.getBoundingClientRect(),o=e.ownerDocument.defaultView?.frameElement,r=o?A(o,{left:n.left,top:n.top,width:n.width,height:n.height}):{left:n.left,top:n.top,width:n.width,height:n.height};return{left:r.left-6,top:r.top-6,right:r.left+r.width+6,bottom:r.top+r.height+6}},bounds:()=>{const e=t(),n=e?.ownerDocument.defaultView?.frameElement,o=(n??e?.closest(".es-canvas")??e)?.getBoundingClientRect();return o?{left:o.left,top:o.top,right:o.right,bottom:o.bottom}:{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}},"aria-label":o,children:/* @__PURE__ */ie("div",{ref:c,children:/* @__PURE__ */ie(pe,{layout:"row",offered:s,pressed:i.marks,onMark:t=>{"link"===t?S():e.press(t)},color:x,linkOpen:null!==v,list:{pressed:i.list,onList:t=>e.list(t)},clear:i.clearable?{onClear:()=>e.clear()}:void 0,alignment:n.alignment,letterCase:n.letterCase,last:n.lastTool?.({className:"rosh-tb-btn",disabled:!1,selected:i.selected,keepCaret:t=>{t.preventDefault(),e.hold()},insert:t=>e.insert(t)}),windows:/* @__PURE__ */se(ae,{children:[m&&a?/* @__PURE__ */ie(h,{colors:a,current:i.color,words:l.colors??y.colors,onPick:t=>e.color(t)}):null,v?
|
|
10
|
-
/* @__PURE__ */ie(fe,{className:"es-copy-link es-copy-pop",value:v.href??"",onApply:t=>{b(null),e.link(t)},onRemove:null!==v.href?()=>{b(null),e.link(null)}:void 0,onCancel:C}):null]})})})})}function bt({element:e,which:t}){const n=_(null),o=ft(n,()=>e(),t);/* @__PURE__ */
|
|
11
|
-
return ie("div",{ref:n,"aria-hidden":"true",className:"es-canvas-outline is-typing",style:o?{position:"absolute",top:o.top,left:o.left,width:o.width,height:o.height,...dt}:{display:"none"}})}function kt({frame:o=!0,className:r,style:l,metadata:i,mirrorStyles:u,onDocument:d,height:p,title:f,nonce:h,hotkeys:y,frameWrapper:S,overlay:E,children:x,typing:I,passThrough:D}){const A=$e(),O=J(ot),M=D??O,P=J(Oe),R=w("canvas",n),z=y??P,[N,j]=te(void 0),V=Pe(e=>"node"===e.selection?.kind?e.selection.id:null),[L,B]=te(null),[K,Z]=te(null),F=J(it),H=J(at),[W,q]=te(null),[,Q]=ne(e=>e+1,0),[,Y]=ne(e=>e+1,0),U=e=>{F?.select(e),Y()},[X,ee]=te(null),oe=_(null),re=_(null),[,le]=te(0),ae=_(I);ae.current=I;const ce=_(null),ue=_(null),de=()=>{if(!V)return null;const e=ae.current?.atSelection?.()?.element()??null;if(!e)return null;const t=ue.current?.ownerDocument;if(F){const n=F.selected()&&t?F.selectedPart?.(t)??null:null;return n&&C(n.element,e)?n.element:null}const n=$(A.getState().appState.data,A.config,V);return n&&0===T(n.node,A.config).length?e:null},pe=Pe(e=>e.appState.data),fe=F?.selected()??null;G(()=>{const e=ue.current?.ownerDocument,t=e?.defaultView?.CustomEvent;if(!e||!t)return;const n=V&&!X&&ae.current?.atSelection?.()?V:null,o=n?de():null;e.dispatchEvent(new t(b,{detail:o?{id:n,words:o}:{id:n}}))},[V,X,pe,fe]);const he=e=>{const t=ue.current?.ownerDocument,n=t?.defaultView?.CustomEvent;t&&n&&t.dispatchEvent(new n(k,{detail:{typing:e}}))},me=(e,t)=>{oe.current?.s.stop("stop");const n=e.element();if(!n)return!1;const o=ge(e,n),r=A.group(),l=e.element,i=m({element:l,value:o?.value??e.value,rules:e.rules,multiline:e.multiline,skip:e.skip,caret:yt(n,t,e.skip),write:o?.write??e.write,remount:e.remount,onSelect:()=>le(e=>e+1),onEscape:()=>ce.current?.escape()??!1,onLinkKey:()=>ce.current?.link()??!1,end:e=>{r.close(),oe.current?.element===l&&(oe.current=null),ee(null),he(!1),ae.current?.onChange?.({typing:!1,why:e})}});if(!i)return r.close(),!1;const s=n.closest?.(`[${Ve}]`)?.getAttribute(Ve);return s&&A.select(s),oe.current={s:i,element:l,target:e},ee(()=>l),B(null),he(!0),ae.current?.onChange?.({typing:!0,element:n}),!0},ge=(e,n)=>{const o=e.key;if(!o||!ae.current?.onCopyText)return null;const r=t(n),l=n.closest?.(`[${Ve}]`),i=l?.getAttribute(Ve);if(!r||!i||!r.wrapper.contains(l))return null;const{copy:s}=r,a=ae.current.copyValue?.({...s,nodeId:i,key:o}),c=g(n,e.skip).text,u=a??(v(e.value,e.rules).text===c?e.value:c),d={ownerId:s.ownerId,slot:s.slot,index:s.index,...s.outer?{outer:s.outer}:{},nodeId:i,key:o};return{value:u,write:t=>{const n=ae.current?.onCopyText;n&&!1!==n({...d,text:t})||e.write(t)}}};G(()=>()=>oe.current?.s.stop("stop"),[]);const ve=e=>{const t=oe.current?.element();return Boolean(t&&t.contains(e))},ye=(e,t)=>lt(A.getState().appState.data,A.config,e,t),we=e=>{const t=e.closest?.(`[${Ve}]`)?.getAttribute(Ve);if(!t)return;const n=A.getState(),o="node"===n.selection?.kind?n.selection.id:null,r=F?.partAt(e,t)??null;if(r){const e=a(n.appState.data,A.config,t,r.id,o,F?.selected()??null,M);if(e)return{node:e.node,part:e.part?r:null}}return{node:c(n.appState.data,A.config,t,o,M)??t,part:null}},be=e=>{if("Enter"!==e.key||e.defaultPrevented||e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return;if(oe.current)return;const t=e.target;if(t?.isContentEditable||t?.closest?.("input, textarea, select, button"))return;const n=ke(),o=void 0===n?ae.current?.atSelection?.():n;o&&me(o,null)&&e.preventDefault()},ke=()=>{const t=ae.current,n=re.current;if(!t?.onCopyText||!n?.copy||n.node!==V)return;const o=ue.current,r=o?e(o,n.copy):null,l=r?vt(r,n.node):null;if(!l)return null;const i=t.atSelection?.()??null,s=i?.element()??null;if(!i||!s)return null;if(l.contains(s))return i;const a=function(e,t){const n=e.closest(`[${Ve}]`);if(!n||n.getAttribute(Ve)!==t.getAttribute(Ve))return null;const o=[];for(let t=e;t!==n;t=t.parentElement)o.unshift(Array.prototype.indexOf.call(t.parentElement.children,t));let r=t;for(const e of o)r=r?.children[e];return r&&r.tagName===e.tagName?r:null}(s,l);return a?t.at(a):null},Se=(e,n)=>{if(!ae.current?.onCopyText)return null;const o=t(e);return o&&vt(o.wrapper,n)?o.copy:null},Ce=ue.current?.ownerDocument??null,Ee=F?.selected()&&Ce&&V?F.selectedPart?.(Ce)??null:null,xe=Ee&&V&&ye(V,Ee)?Ee.element:null,Ie=H?.selected()??null,Ae=Ie&&Ce?Array.from(Ce.querySelectorAll(`[${st}]`)).find(e=>e.getAttribute(st)===Ie)??null:null,Me=X?null:de(),Re=/* @__PURE__ */se("div",{ref:ue,className:"es-canvas-content",style:{position:"relative"},onClick:e=>{const t=e.target;if(t.closest?.("a[href]")&&e.preventDefault(),oe.current){if(ve(t))return;oe.current.s.stop("outside")}const n=t.ownerDocument?.getSelection?.();n&&n.rangeCount>0&&n.isCollapsed&&n.removeAllRanges();const o=H?ct(t):null;if(H&&o)return H.select(o.id),q(null),void Q();const r=we(t);if(re.current=void 0!==r?{node:r.node,copy:Se(t,r.node)}:null,void 0!==r)return A.select(r.node),void(F&&(r.part?.id??null)!==F.selected()&&U(r.part?.id??null));t.hasAttribute?.(Le)||(A.select(null),F?.selected()&&U(null))},onDoubleClick:e=>{const t=ae.current;if(!t||ve(e.target))return;const n=t.at(e.target);n&&me(n,{x:e.clientX,y:e.clientY})&&e.preventDefault()},onKeyDown:e=>be(e),onMouseOver:e=>{if(oe.current)return;const t=H?ct(e.target):null;if(t?.element!==W?.element&&q(t),t)return null!==L&&B(null),void(null!==K&&Z(null));const n=we(e.target),o=!!n?.part&&ye(n.node,n.part),r=n?.part&&o&&n.part.id!==F?.selected()?n.part:null,l=!n||n.part&&o?null:n.node;l!==L&&B(l),r?.id===K?.id&&r?.element===K?.element||Z(r)},onMouseLeave:()=>{B(null),Z(null),q(null)},children:[
|
|
12
|
-
/* @__PURE__ */ie(He.Provider,{value:L,children:/* @__PURE__ */ie(nt,{metadata:i})}),
|
|
13
|
-
/* @__PURE__ */se("div",{className:"es-canvas-outlines",style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:[
|
|
14
|
-
/* @__PURE__ */ie(gt,{id:!X&&L&&L!==V?L:null,kind:"hover",overlay:E}),F?/* @__PURE__ */ie(ut,{element:X||!K||K.id===F.selected()?null:K.element}):null,Me||xe?/* @__PURE__ */ie(pt,{element:X?null:Me??xe,words:null!==Me}):null,H?/* @__PURE__ */ie(ut,{element:X||!W||W.element===Ae?null:W.element}):null,Ae?/* @__PURE__ */ie(pt,{element:X?null:Ae}):null,
|
|
15
|
-
/* @__PURE__ */ie(gt,{id:X||xe||Me||Ae?null:V,kind:"selected",overlay:E}),X?/* @__PURE__ */ie(bt,{element:()=>{const e=X?.()??null;return e?Ee&&C(Ee.element,e)?Ee.element:e:null},which:Ee?.element??X}):null]}),x]}),ze=S?/* @__PURE__ */ie(S,{document:N,children:Re}):Re;G(()=>{if(N&&z)return De(N,A)},[N,z,A]),G(()=>{if(!N)return;const e=e=>{if("Enter"===e.key)return void be(e);if("Escape"!==e.key||e.defaultPrevented)return;const t=e.target;if(t?.isContentEditable||t?.closest?.("input, textarea, select"))return;const n=A.getState();if("node"!==n.selection?.kind)return;if(F?.selected())return void U(null);const o=s(n.appState.data,A.config,n.selection);"node"===o?.kind&&A.select(o.id)};return N.addEventListener("keydown",e),()=>N.removeEventListener("keydown",e)},[N,A,F]);/* @__PURE__ */
|
|
16
|
-
return se("div",{className:"es-canvas"+(r?` ${r}`:""),style:l,"data-easel-preview":"","data-es-typing":X?"":void 0,children:[X&&oe.current?.target.toolbar?/* @__PURE__ */ie(wt,{s:oe.current.s,element:oe.current.element,toolbar:oe.current.target.toolbar,label:R.textTools,keys:ce}):null,o?/* @__PURE__ */ie(Te,{mirrorStyles:u,onDocument:e=>{j(e??void 0),d?.(e)},height:p,title:f,nonce:h,children:ze}):/* @__PURE__ */ie("div",{id:"preview-frame","data-easel-entry":"",children:ze})]})}function St(e={}){const t=$e(),n=Pe(e=>e.appState.data);return i({...e,data:n,config:t.config,commit:(e,{select:n})=>t.run({data:e,select:n})})}function Ct(){return It(Pe(e=>e.selectedItem))}function Et(){try{return Ct()}catch{return null}}function xt(){return It(null)}function It(e){const t=$e(),n=Pe(e=>e.config),r=t.resolveCache,l=Pe(e=>e.appState.data.root),i=e?e.props.id:"root",s=l.props??{},a=oe(()=>e||{type:"root",props:s},[e,s]),c=e?n.components[e.type]:n.root,u=t.getState(),d=e?$(u.appState.data,n,i):null,p=d&&"root"!==d.place.parentId?d.place.parentId:null,f=p?u.getItemById(p)??null:null,{fields:h}=o({id:i,node:a,block:c,parent:f,appState:u.appState}),m=Pe(t=>!1===t.getPermissions(e?{item:e}:{root:!0}).edit),g=re(e=>{(async()=>{const o=t.getState();if("root"!==i){const l=o.getItemById(i),s=o.getSelectorForId(i);if(!l||!s)return;const a={...l,props:{...l.props,...e}},{node:c}=await H(a,n,{cache:r,trigger:"replace"}),u=t.getState().getSelectorForId(i);if(!u)return;return void t.dispatch({type:"replace",destinationZone:u.zone??"root:default-zone",destinationIndex:u.index,data:c})}const l=o.appState.data.root.props??{},{node:s}=await H({type:"root",props:{...l,...e}},n,{cache:r,trigger:"replace"});t.dispatch({type:"replaceRoot",root:{props:s.props,readOnly:s.readOnly},recordHistory:!0})})()},[t,n,r,i]),v=re((e,t)=>g({[e]:t}),[g]);return{id:i,node:a,fields:h,values:a.props,readOnly:m,onChange:v,onChangeMany:g}}export{st as CHROME_ATTR,at as CanvasChromeContext,Te as CanvasFrame,it as CanvasPartsContext,ot as CanvasPassThroughContext,rt as CanvasSharedContext,Ce as DEFAULT_UI,kt as EaselCanvas,Me as EaselProvider,nt as EditDocument,De as bindUndoKeys,Ie as createEasel,Re as createUseEasel,lt as partHasOwnBox,he as recordsByDefault,be as reduce,ve as uiView,Pe as useEasel,$e as useEaselApi,St as useEaselNodeOps,xt as useRootFields,Ct as useSelectedFields,Et as useSelectedHost,ye as validSelection};
|
package/dist/chunk-IMAN6IP5.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{useAccessPatch as e,FLAT_ACCESS as r,useAccessValue as o}from"./chunk-5OKOCRXT.js";import{CornersInput as t,BorderInput as s,SettingsColour as l}from"./chunk-CLAADE4J.js";import{SettingsDefaultReset as n}from"./chunk-2T22IY3J.js";import{noControlField as i,NoControlMark as a}from"./chunk-22I55W37.js";import{DEFAULT_PANEL_WORDS as c,DEFAULT_COLOUR_ROW_WORDS as d}from"./chunk-56ID6FKZ.js";import{SettingsField as u}from"./chunk-MIX7EGRG.js";import{useWords as p}from"./chunk-MFIRYGHW.js";import{CornerIcon as y,BorderAllIcon as h}from"efficient-shell/icons/efficient";import{jsx as f}from"react/jsx-runtime";var m=e=>e;function b(e,t){const s=e.access?void 0:{value:t.value,onChange:t.onChange};return o(e.access??r,e.key,s)}function g(e,t){return o(e.access??r,t??"")}function v(e){return{...i({type:"custom",render:()=>/* @__PURE__ */f(a,{})},"always"),reachedBy:e}}function w({o:o,say:t,props:s}){const n=p("colourRow",d),i=p("panel",c),a=o.useFollows(),u=o.usePresets?.(),y=o.opacity?.useUnset?.()??100,[h,m]=b(o,s),[v,w]=g(o,o.opacity?.key),C=e(o.access??r),k="string"==typeof h?h:"",j="number"==typeof v,B=o.access?void 0:"";/* @__PURE__ */
|
|
2
|
-
return f(l,{label:t(o.label),icon:o.icon,value:k,onChange:e=>m(""===e?B:e),inherited:a,presets:u,changed:""!==k||j,onReset:()=>{j&&o.opacity?C([[o.key,B],[o.opacity.key,void 0]]):m(B)},resetTo:o.resetTo?o.resetTo(a.toUpperCase()):a.toUpperCase(),...o.opacity?{opacity:j?v:y,onOpacityChange:e=>w(e)}:{},readOnly:s.readOnly,words:n,resetWords:i})}var C=20;function k({o:e,say:r,props:o}){const t=e.useFollows(),[l,n]=b(e,o),i=l&&"object"==typeof l?l:{},a=t.width,c={width:r("Border width"),sides:{top:r("Border top"),right:r("Border right"),bottom:r("Border bottom"),left:r("Border left")},style:r("Border style"),styles:{solid:r("Solid"),dashed:r("Dashed"),dotted:r("Dotted")},color:r("Border color"),unit:"px"};/* @__PURE__ */
|
|
3
|
-
return f(u,{label:r("Border"),icon:/* @__PURE__ */f(h,{}),children:/* @__PURE__ */f(s,{label:r("Border"),value:i,each:!1,onChange:r=>n(function(e){const r=Object.fromEntries(Object.entries(e).filter(([,e])=>null!=e&&""!==e));return Object.keys(r).length?r:void 0}(e.styles?{width:r.width,color:r.color,style:r.style}:{width:r.width,color:r.color})),placeholder:{sides:{top:a,right:a,bottom:a,left:a},style:"solid",color:t.color},presets:[t.color],words:c,styles:e.styles??!1,max:20,readOnly:o.readOnly})})}var j=["tl","tr","br","bl"],B=40;function F({o:o,say:s,props:l}){const i=p("panel",c),a=o.useFollows(),[d,h]=b(o,l),[m,v]=g(o,o.sidesKey),w=e(o.access??r),C=o.access?void 0:null,k="number"==typeof d&&Number.isFinite(d)?d:null,B=Array.isArray(m)?j.filter(e=>m.includes(e)):[...j],F=[{value:"tl",label:s("Top left")},{value:"tr",label:s("Top right")},{value:"bl",label:s("Bottom left")},{value:"br",label:s("Bottom right")}];/* @__PURE__ */
|
|
4
|
-
return f(u,{label:s("Corners"),icon:/* @__PURE__ */f(y,{}),changed:null!==k||Array.isArray(m),action:/* @__PURE__ */f(n,{label:s("Corners"),changed:null!==k||Array.isArray(m),detail:`${a}px`,onReset:()=>Array.isArray(m)?w([[o.key,C],[o.sidesKey,C]]):h(C),words:i}),children:/* @__PURE__ */f(t,{label:s("Corners"),value:B,corners:F,onChange:e=>{const r=j.filter(r=>e.includes(r));v(r.length===j.length?C:r)},radius:k,onRadiusChange:e=>h(e??C),radiusMin:0,radiusMax:40,radiusStep:o.step??1,radiusPlaceholder:String(a),disabled:l.readOnly})})}function O(e=m){return{colourField:r=>({type:"custom",render:o=>/* @__PURE__ */f(w,{o:r,say:e,props:o})}),borderField:r=>({type:"custom",render:o=>/* @__PURE__ */f(k,{o:r,say:e,props:o})}),cornersField:r=>({type:"custom",render:o=>/* @__PURE__ */f(F,{o:r,say:e,props:o})})}}var{colourField:A,borderField:R,cornersField:T}=O();export{C as BORDER_WIDTH_MAX,B as CORNER_RADIUS_MAX,j as CORNER_SIDES,R as borderField,A as colourField,T as cornersField,v as keptByRow,O as styleFieldBuilders};
|
package/dist/chunk-LSGKADNV.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-BBD3FLU3.js";import{Inspector as i}from"./chunk-R76XMEKT.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={},O=()=>b,j=()=>"",w=()=>null,C=()=>{},L={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},S={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},B={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */f(c,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},D={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 I=l({});function T({parts:n,children:e}){/* @__PURE__ */
|
|
4
|
-
return f(I.Provider,{value:n,children:e})}function x(){return s(I)}function A(){return(x().useOwnerName??j)()}function G(){return(x().useDocumentLabel??w)()}function R(n,e,t,r){return(x().useBridges??O)(n,e,t,r)}function X(n){return(x().useStandaloneBridges??O)(n)}function Y(n,e){(x().useDocumentPass??C)(n,e)}function E(){return x().blockRules??L}function K(){return x().blockLook??S}function M(){return x().devices??B}function Q(){return x().leftView??D}function V(){return x().pinned??N}function H(){return x().saveSwitch??!0}function U(e){n(!0===x().pickFollowsSelection,e)}function W(){return x().storageNamespace||void 0}function Z(){return x().styleClipboard??null}function q(){return x().nodeKeys??!0}function z(){return x().notify??null}function J(){return x().Canvas??P}function $(){return x().CanvasHead??null}function _(){return x().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 x().Inspector??F}export{a as SELECTION_MODE,en as ScreenCanvasTargetProvider,T 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,K as useScreenBlockLook,E as useScreenBlockRules,R as useScreenBridges,_ as useScreenCanvasDrag,J as useScreenCanvasFrame,$ as useScreenCanvasHead,tn as useScreenCanvasTarget,M as useScreenDevices,G as useScreenDocumentLabel,Y as useScreenDocumentPass,rn as useScreenInspectorPanel,Q as useScreenLeftView,q as useScreenNodeKeys,z as useScreenNotify,A as useScreenOwnerName,x as useScreenParts,U as useScreenPickFollowsSelection,V as useScreenPinned,H as useScreenSaveSwitch,W as useScreenStorageNamespace,Z as useScreenStyleClipboard,X as useStandaloneScreenBridges};
|
package/dist/chunk-O4DQ6O6W.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useSectionOps as o}from"./chunk-WOA775T4.js";import{SELECTION_MODE as e}from"./chunk-LSGKADNV.js";import{decodePartId as r,encodePartId as t}from"./chunk-R4AUZVA3.js";import{useEasel as n}from"./chunk-BBD3FLU3.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-TTCUC2Q3.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{styleFieldBuilders as e,keptByRow as o}from"./chunk-IMAN6IP5.js";import{boxFieldBuilders as s,PHONE_KEY_ACCESS as t,phoneTwinFields as l,section as r}from"./chunk-5OKOCRXT.js";import{deviceField as i}from"./chunk-7GGNFLHT.js";import{TextColorIcon as n,GroundIcon as c}from"efficient-shell/icons/efficient";import{jsx as d}from"react/jsx-runtime";var u={fill:"buttonColor",fillOpacity:"buttonFillOpacity",border:"buttonBorder",text:"buttonTextColor",corners:"buttonCorners",cornerSides:"buttonCornerSides"},a={top:"buttonPaddingTop",right:"buttonPaddingRight",bottom:"buttonPaddingBottom",left:"buttonPaddingLeft"};function f(f){const b=s(f.say),p=e(f.say),y=u,F=f.style,g=f.phone??t;return{_dSize:r("Size"),...b.sidesPaddingFields({keys:a,group:!1,...f.padding}),_dDesign:r("Design"),[y.fill]:p.colourField({key:y.fill,access:F,label:"Fill color",icon:/* @__PURE__ */d(c,{}),useFollows:f.follows.useFill,usePresets:f.usePresets,resetTo:f.resetTo,opacity:{key:y.fillOpacity,useUnset:f.follows.useFillOpacity}}),[y.fillOpacity]:o(y.fill),[y.border]:p.borderField({key:y.border,access:F,useFollows:f.follows.useBorder}),[y.text]:p.colourField({key:y.text,access:F,label:"Text color",icon:/* @__PURE__ */d(n,{}),useFollows:f.follows.useText,usePresets:f.usePresets,resetTo:f.resetTo}),[y.corners]:p.cornersField({key:y.corners,access:F,sidesKey:y.cornerSides,useFollows:f.follows.useCorners}),[y.cornerSides]:o(y.corners),_dLayout:r("Layout"),...l("align",b.blockAlignmentField({phone:!0},""),g),align:i("desktop",b.blockAlignmentField())}}export{a as BUTTON_PAD_KEYS,u as BUTTON_STYLE_KEYS,f as buttonFieldSet};
|