efficient-easel 8.3.0 → 10.0.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 +43 -0
- package/dist/chrome/chrome.css +18 -0
- package/dist/chrome/index.d.ts +26 -3
- package/dist/chrome/index.js +1 -1
- package/dist/chunk-26GHWMNN.js +21 -0
- package/dist/{chunk-NOD4ATKF.js → chunk-2AKW6UXX.js} +1 -1
- package/dist/{chunk-IEKQTWQG.js → chunk-4CE7XFCE.js} +1 -1
- package/dist/chunk-65Z5FSAW.js +6 -0
- package/dist/{chunk-7CIFWFP2.js → chunk-BPLCMQ6S.js} +39 -39
- package/dist/{chunk-DQZYXC3V.js → chunk-GKGBKSZ7.js} +1 -1
- package/dist/{chunk-QVUVDBGA.js → chunk-IE55HNMA.js} +18 -18
- package/dist/{chunk-VF6TCI62.js → chunk-K2YSFVOJ.js} +1 -1
- package/dist/chunk-LGDQLTJW.js +5 -0
- package/dist/{chunk-NCQSBU3O.js → chunk-P4CL4YQI.js} +1 -1
- package/dist/{chunk-XTJCKV6Z.js → chunk-PPL7GB7D.js} +1 -1
- package/dist/chunk-Q6AM43CA.js +1 -0
- package/dist/chunk-RC25EGHD.js +5 -0
- package/dist/{chunk-DPKWJTNX.js → chunk-TZIIRGVY.js} +1 -1
- package/dist/{chunk-ZG5T7RSV.js → chunk-U5RF4USK.js} +1 -1
- package/dist/{chunk-HDUAODXJ.js → chunk-W4U4SHKW.js} +3 -3
- package/dist/{chunk-SQMUAXUS.js → chunk-XF2AIO46.js} +1 -1
- package/dist/chunk-XJCMEEBH.js +9 -0
- package/dist/chunk-XO7OUCZV.js +1 -0
- package/dist/chunk-XTDBTCVO.js +5 -0
- package/dist/chunk-XWFH2NHZ.js +4 -0
- package/dist/chunk-Z6PVRXVY.js +1 -0
- package/dist/copy/copy.css +55 -15
- package/dist/copy/index.d.ts +55 -3
- package/dist/copy/index.js +23 -18
- package/dist/easel/index.d.ts +1 -1
- package/dist/fields/index.d.ts +2 -2
- package/dist/fields/index.js +1 -1
- package/dist/panel/index.d.ts +1 -1
- package/dist/panel/index.js +18 -18
- package/dist/panel/panel.css +7 -4
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/MediaSidePanel.js +1 -1
- package/dist/screen/components/PageEditGuardNotices.js +1 -1
- package/dist/screen/components/SaveControls.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/SidePanelHead.js +1 -1
- package/dist/screen/components/panel-widths.js +1 -1
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/puck/use-section-ops.js +1 -1
- package/dist/screen/lib/screen-parts.js +1 -1
- package/dist/strings/catalogue.d.ts +2 -2
- package/dist/strings/catalogue.js +1 -1
- package/dist/strings/index.d.ts +2 -2
- package/dist/strings/index.js +1 -1
- package/dist/text-styles/index.js +13 -13
- package/dist/{types-OUl0mK1k.d.ts → types-C97TAUKi.d.ts} +16 -0
- package/dist/{words-C1U_dLBh.d.ts → words-BpiVrsW5.d.ts} +8 -0
- package/dist/{words-BAnsDT16.d.ts → words-dsex49Jh.d.ts} +27 -2
- package/package.json +3 -3
- package/dist/chunk-AUT242JK.js +0 -1
- package/dist/chunk-CWTAS5R6.js +0 -5
- package/dist/chunk-GZH4UVDH.js +0 -8
- package/dist/chunk-HA33IXEU.js +0 -1
- package/dist/chunk-KIA6EKAM.js +0 -5
- package/dist/chunk-OZ72A6MY.js +0 -9
- package/dist/chunk-QLD57GBB.js +0 -6
- package/dist/chunk-UCLVWF5E.js +0 -21
- package/dist/chunk-Y2G7CU6A.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export{usePartBridge}from"../../chunk-
|
|
1
|
+
export{usePartBridge}from"../../chunk-XO7OUCZV.js";import"../../chunk-K2YSFVOJ.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-LGDQLTJW.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-26GHWMNN.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-RC25EGHD.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-65Z5FSAW.js";import"../../chunk-XJCMEEBH.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
package/dist/screen/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunk-GZO72N3Q.js";export{DocumentScreen,ScreenMount}from"../chunk-
|
|
1
|
+
import"../chunk-GZO72N3Q.js";export{DocumentScreen,ScreenMount}from"../chunk-U5RF4USK.js";import"../chunk-GXQCZJOP.js";export{ScreenStoreProvider}from"../chunk-GKGBKSZ7.js";import"../chunk-BPLCMQ6S.js";import"../chunk-2GVCAIPX.js";import"../chunk-26OOWIJJ.js";import"../chunk-BRDCD4LK.js";import"../chunk-FGNR22NY.js";import"../chunk-ZE7I3PLX.js";import"../chunk-OGCROOTI.js";import"../chunk-7F52SZOI.js";import"../chunk-MQNBD6AB.js";import"../chunk-BHRC3ASL.js";import"../chunk-6W7WLPZH.js";import"../chunk-4ES5JGGX.js";import"../chunk-IQ5TA7AM.js";import"../chunk-DUVRZ456.js";import"../chunk-OWW44DVK.js";import"../chunk-KCBEE2MC.js";import"../chunk-TZIIRGVY.js";import"../chunk-XO7OUCZV.js";import"../chunk-K2YSFVOJ.js";import"../chunk-IYT6NN2J.js";import"../chunk-D6N77AOS.js";import"../chunk-P4CL4YQI.js";import"../chunk-BSPCSC45.js";import"../chunk-I54UCYOU.js";import"../chunk-GOTN2KY4.js";import"../chunk-R5L2E7JX.js";import"../chunk-W4U4SHKW.js";import"../chunk-RKTF5XLP.js";import"../chunk-THZ46DC5.js";import"../chunk-GMCZXMOV.js";import"../chunk-CLOS6SSX.js";import"../chunk-S4AWJX4Q.js";import"../chunk-ERR437B5.js";import"../chunk-KG7RJWOK.js";import"../chunk-VPFNZ7TB.js";import"../chunk-LOMEH6DG.js";export{NO_DOCUMENT_ADDRESSING}from"../chunk-RLBXE4EU.js";import"../chunk-HNKB2ZYR.js";import"../chunk-V7U33NF2.js";import"../chunk-5545A3PC.js";import"../chunk-XTDBTCVO.js";import"../chunk-PA3PNTVV.js";import"../chunk-5ZBY24K7.js";import"../chunk-BVN33R76.js";import"../chunk-PPL7GB7D.js";import"../chunk-KQMML6JM.js";import"../chunk-KCOBHPN6.js";export{EaselSessionProvider,useEaselSession}from"../chunk-O7Q4DDJT.js";export{EFFICIENT_BACKEND,activateEaselSession,backendOf,createEaselSession,currentEaselSession,deactivateEaselSession,efficientClientOpen,isEfficientBackend,provideDefaultBackend,resetAmbientEaselSession,sessionRegistry,setSessionBridgedSite,setSessionDocumentSite}from"../chunk-RSCMJIWS.js";import"../chunk-HQ4VVRIC.js";import"../chunk-2AKW6UXX.js";export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSlotMode,sameInspectorMode,screenSlotsOf,useScreenAdd,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../chunk-LGDQLTJW.js";import"../chunk-PLVEGYK6.js";import"../chunk-R6WTQWAC.js";export{DETACHED_EASEL_HOST,EaselHostContext,EaselHostProvider,createEaselHost,useEaselHost,useHostEscape}from"../chunk-U3JP4VGF.js";import"../chunk-6WY6ZXJG.js";import"../chunk-JTUUIVBZ.js";import"../chunk-K5744MTM.js";import"../chunk-TBY3DFKS.js";import"../chunk-26GHWMNN.js";import"../chunk-XWFH2NHZ.js";import"../chunk-4JSBIW5H.js";import"../chunk-RC25EGHD.js";import"../chunk-K56YDHYQ.js";import"../chunk-KFV7N2DJ.js";import"../chunk-YRLPFZW3.js";import"../chunk-BXMXTO36.js";import"../chunk-EA2HTX37.js";import"../chunk-OSPUG6S6.js";import"../chunk-WK3AFPXY.js";import"../chunk-ECM5F6JJ.js";import"../chunk-4VJATVVR.js";import"../chunk-NDRZP6YR.js";import"../chunk-H6DDIBQ4.js";import"../chunk-IE55HNMA.js";import"../chunk-Z6PVRXVY.js";import"../chunk-THWO5YVZ.js";import"../chunk-RE4LP46F.js";import"../chunk-MJM6SFD3.js";import"../chunk-2OAZYSWJ.js";import"../chunk-WQASXLXS.js";import"../chunk-66LWADFP.js";import"../chunk-65Z5FSAW.js";import"../chunk-XJCMEEBH.js";import"../chunk-FFYXVAAL.js";import"../chunk-546BBOPE.js";import"../chunk-MFIRYGHW.js";import"../chunk-FCLW4LEN.js";import"../chunk-O2NLQBFX.js";import"../chunk-67GNT6PF.js";import"../chunk-ILXP5VX5.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{useSectionOps}from"../../../chunk-
|
|
1
|
+
export{useSectionOps}from"../../../chunk-K2YSFVOJ.js";import"../../../chunk-LGDQLTJW.js";import"../../../chunk-PLVEGYK6.js";import"../../../chunk-R6WTQWAC.js";import"../../../chunk-U3JP4VGF.js";import"../../../chunk-K5744MTM.js";import"../../../chunk-TBY3DFKS.js";import"../../../chunk-26GHWMNN.js";import"../../../chunk-XWFH2NHZ.js";import"../../../chunk-4JSBIW5H.js";import"../../../chunk-RC25EGHD.js";import"../../../chunk-K56YDHYQ.js";import"../../../chunk-KFV7N2DJ.js";import"../../../chunk-YRLPFZW3.js";import"../../../chunk-EA2HTX37.js";import"../../../chunk-ECM5F6JJ.js";import"../../../chunk-WQASXLXS.js";import"../../../chunk-66LWADFP.js";import"../../../chunk-65Z5FSAW.js";import"../../../chunk-XJCMEEBH.js";import"../../../chunk-FFYXVAAL.js";import"../../../chunk-546BBOPE.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-67GNT6PF.js";import"../../../chunk-ILXP5VX5.js";import"../../../chunk-P2VEMZH5.js";import"../../../chunk-KRXQM65X.js";import"../../../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSlotMode,sameInspectorMode,screenSlotsOf,useScreenAdd,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../../chunk-
|
|
1
|
+
export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSlotMode,sameInspectorMode,screenSlotsOf,useScreenAdd,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../../chunk-LGDQLTJW.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-26GHWMNN.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-RC25EGHD.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-65Z5FSAW.js";import"../../chunk-XJCMEEBH.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { S as SaveWords } from '../words-pgIK0I6g.js';
|
|
2
|
-
import { N as NoticeWords, C as ChromeWords } from '../words-
|
|
3
|
-
import { C as CopyWords } from '../words-
|
|
2
|
+
import { N as NoticeWords, C as ChromeWords } from '../words-BpiVrsW5.js';
|
|
3
|
+
import { C as CopyWords } from '../words-dsex49Jh.js';
|
|
4
4
|
import { D as DragWords } from '../words-BDignMl_.js';
|
|
5
5
|
import { LockWords } from '../edit-lock/index.js';
|
|
6
6
|
import { F as FieldsWords } from '../words-vhnV8sM7.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-
|
|
1
|
+
export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-XF2AIO46.js";import"../chunk-M6F6LS3H.js";import"../chunk-ZAOM6PFH.js";import"../chunk-6WY6ZXJG.js";import"../chunk-JTUUIVBZ.js";import"../chunk-TBY3DFKS.js";import"../chunk-K56YDHYQ.js";import"../chunk-KFV7N2DJ.js";import"../chunk-WK3AFPXY.js";import"../chunk-H6DDIBQ4.js";import"../chunk-Z6PVRXVY.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import"../chunk-Q6AM43CA.js";import"../chunk-FFYXVAAL.js";import"../chunk-546BBOPE.js";import"../chunk-O2NLQBFX.js";
|
package/dist/strings/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { DeepPartial, EaselStrings } from './catalogue.js';
|
|
|
2
2
|
export { CanvasWords, DEFAULT_EASEL_STRINGS, RailWords, mergeEaselStrings } from './catalogue.js';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { ReactNode } from 'react';
|
|
5
|
-
export { C as ChromeWords, N as NoticeWords } from '../words-
|
|
6
|
-
export { C as CopyWords } from '../words-
|
|
5
|
+
export { C as ChromeWords, N as NoticeWords } from '../words-BpiVrsW5.js';
|
|
6
|
+
export { C as CopyWords } from '../words-dsex49Jh.js';
|
|
7
7
|
export { D as DragWords } from '../words-BDignMl_.js';
|
|
8
8
|
export { F as FieldsWords } from '../words-vhnV8sM7.js';
|
|
9
9
|
export { LockWords } from '../edit-lock/index.js';
|
package/dist/strings/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{DEFAULT_EASEL_STRINGS as r,mergeEaselStrings as n}from"../chunk-
|
|
1
|
+
import{DEFAULT_EASEL_STRINGS as r,mergeEaselStrings as n}from"../chunk-XF2AIO46.js";export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-XF2AIO46.js";import"../chunk-M6F6LS3H.js";import"../chunk-ZAOM6PFH.js";import"../chunk-6WY6ZXJG.js";import"../chunk-JTUUIVBZ.js";import"../chunk-TBY3DFKS.js";import"../chunk-K56YDHYQ.js";import"../chunk-KFV7N2DJ.js";import"../chunk-WK3AFPXY.js";import"../chunk-H6DDIBQ4.js";import"../chunk-Z6PVRXVY.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import"../chunk-Q6AM43CA.js";import"../chunk-FFYXVAAL.js";import"../chunk-546BBOPE.js";import{stringsContext as o}from"../chunk-MFIRYGHW.js";import"../chunk-O2NLQBFX.js";import{useContext as t,useMemo as c}from"react";import{jsx as i}from"react/jsx-runtime";function s({value:s,locale:u,children:m}){const e=o(),p=t(e),h=p?.strings??r,j=u??p?.locale??"en",k=c(()=>({strings:n(h,s),locale:j}),[h,s,j]);/* @__PURE__ */
|
|
2
2
|
return i(e.Provider,{value:k,children:m})}function u(){return t(o())?.strings??r}function m(){return t(o())?.locale??"en"}export{s as EaselStringsProvider,m as useEaselLocale,u as useEaselStrings};
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import{hexReadout as e,ColourWindow as n,typedHex as t}from"../chunk-FPAVNX3Y.js";import{DEFAULT_TEXT_STYLES_WORDS as s}from"../chunk-M6F6LS3H.js";export{DEFAULT_TEXT_STYLES_WORDS}from"../chunk-M6F6LS3H.js";import"../chunk-ZAOM6PFH.js";import{
|
|
1
|
+
import{hexReadout as e,ColourWindow as n,typedHex as t}from"../chunk-FPAVNX3Y.js";import{DEFAULT_TEXT_STYLES_WORDS as s}from"../chunk-M6F6LS3H.js";export{DEFAULT_TEXT_STYLES_WORDS}from"../chunk-M6F6LS3H.js";import"../chunk-ZAOM6PFH.js";import{FieldSlider as i}from"../chunk-XWFH2NHZ.js";import{FieldSelect as a}from"../chunk-65Z5FSAW.js";import"../chunk-FFYXVAAL.js";import{useWords as l}from"../chunk-MFIRYGHW.js";import{withTip as r}from"../chunk-P2VEMZH5.js";import{hsvToHex as o,Tooltip as d,ColorSwatch as c,IconButton as u}from"efficient-shell/ui";import{useState as m,useRef as f,useId as h,useEffect as p,Fragment as v}from"react";import{ChevronIcon as g,TrashIcon as k,BoldIcon as y,ItalicIcon as b,CaseLowerIcon as x,CaseUpperIcon as w,CaseNormalIcon as S}from"efficient-shell/icons/efficient";import{jsxs as N,jsx as C,Fragment as M}from"react/jsx-runtime";var z=["font","color","size","weight","emphasis","lineSpacing","letterSpacing","paragraphSpacing","letterCase","largestSize"],$=["font","color","size","weight","lineSpacing","letterSpacing","paragraphSpacing","letterCase"],O=["heading","body"],A=7,F={heading:3,body:5},j={min:5,max:void 0,sliderMin:12,sliderMax:72,step:1,shiftStep:10,unit:"px"},L={size:j,weight:{min:100,max:900,sliderMin:300,sliderMax:900,step:100,shiftStep:100,unit:""},lineSpacing:{min:50,max:250,sliderMin:50,sliderMax:250,step:1,shiftStep:10,unit:"%"},letterSpacing:{min:-10,max:void 0,sliderMin:-5,sliderMax:10,step:.1,shiftStep:1,unit:"px"},paragraphSpacing:{min:0,max:void 0,sliderMin:0,sliderMax:48,step:1,shiftStep:10,unit:"px"},largestSize:j},W=(e,n)=>`${"heading"===e?"Heading":"Body"} ${n}`;function H(e=({kind:e,n:n})=>W(e,n)){return O.flatMap(n=>Array.from({length:F[n]},(t,s)=>({id:`${n}-${s+1}`,kind:n,name:e({kind:n,n:s+1}),values:{}})))}function E(e,n,t=A){return e.filter(e=>e.kind===n).length<t}function B(e,n){const t=new RegExp(`^${n}-([1-9]\\d*)$`).exec(e);return t?Number(t[1]):void 0}function D(e){const n=B(e.id,e.kind);return void 0!==n&&n<=F[e.kind]}function I(e,n,t={}){const{max:s=A,name:i=({kind:e,n:n})=>W(e,n),make:a}=t;if(!E(e,n,s))return null;const l=e.filter(e=>e.kind===n);let r=l.length+1;const o=new Set(e.map(e=>e.name));for(;o.has(i({kind:n,n:r}));)r+=1;const d=new Set(e.map(e=>e.id));let c=Math.max(r,...l.map(e=>(B(e.id,n)??0)+1));for(;d.has(`${n}-${c}`);)c+=1;const u=l.at(-1),m=a?a(n,r):{id:`${n}-${c}`,kind:n,name:i({kind:n,n:r}),values:{...u?.values??{}}},f=u?e.indexOf(u)+1:"heading"===n?0:e.length;return{styles:[...e.slice(0,f),m,...e.slice(f)],added:m}}function R(e,n,t={}){const{name:s=({kind:e,n:n})=>W(e,n)}=t,i=e.find(e=>e.id===n);if(!i||D(i))return null;const a=e.filter(e=>e.kind===i.kind),l=a.indexOf(i),r=/* @__PURE__ */new Map;return a.forEach((e,n)=>{n>l&&e.name===s({kind:e.kind,n:n+1})&&r.set(e,s({kind:e.kind,n:n}))}),{styles:e.filter(e=>e!==i).map(e=>r.has(e)?{...e,name:r.get(e)}:e),removed:i}}function T(e,n){const t=e.find(e=>e.id===n);if(t)return t;for(const t of O){const s=B(n,t);if(void 0===s)continue;let i;for(const n of e){const e=n.kind===t?B(n.id,t):void 0;void 0!==e&&e<s&&(!i||e>i.n)&&(i={n:e,style:n})}return i?.style}}function V(e,n,t){return e.map(e=>{if(e.id!==n)return e;const s={...e.values};for(const[e,n]of Object.entries(t))void 0===n?delete s[e]:s[e]=n;return{...e,values:s}})}function X(e){return Math.min(20,Math.max(12,Math.round(.5*e+6)))}function Y(e,n){const t=n.weights;return[t.thin,t.extraLight,t.light,t.regular,t.medium,t.semibold,t.bold,t.extraBold,t.black][Math.min(8,Math.max(0,Math.round(e/100)-1))]}function Z(e,n,t,s={}){const i=n.find(n=>n.value===e.font)?.label??e.font??"",a=void 0===e.size?s.autoSize?t.auto:"":t.px({n:e.size});return t.summary({font:i,size:a,weight:Y(e.weight??400,t)})}var q=`conic-gradient(${[0,60,120,180,240,300,0].map(e=>o({h:e,s:1,v:1})).join(", ")})`;function P({value:t,hex:s,colours:i,label:a,followsWord:l,anyWord:r,onChange:o,readOnly:u=!1}){const[v,g]=m(!1),k=f(null),y=f(null),b=h(),x=void 0!==t&&i.some(e=>e.key===t),w=void 0!==t&&!x;return p(()=>{if(!v)return;const e=k.current?.ownerDocument;if(!e)return;const n=e=>{k.current&&!k.current.contains(e.target)&&g(!1)};return e.addEventListener("click",n,!0),()=>e.removeEventListener("click",n,!0)},[v]),/* @__PURE__ */N("div",{ref:k,className:"es-ts-set","data-ts-setting":"color",children:[
|
|
2
2
|
/* @__PURE__ */N("div",{className:"es-ts-top",children:[
|
|
3
3
|
/* @__PURE__ */C("span",{className:"es-ts-sub",children:a}),
|
|
4
4
|
/* @__PURE__ */C("span",{className:"es-ts-colour-read",children:s?e(s):l})]}),
|
|
5
5
|
/* @__PURE__ */N("div",{className:"es-ts-swatches",role:"group","aria-label":a,children:[i.map(n=>/* @__PURE__ */C(d,{content:`${n.name} · ${e(n.value)}`,children:/* @__PURE__ */C(c,{color:n.value,size:"sm",className:"es-ts-swatch","aria-label":n.name,selected:t===n.key,disabled:u,onClick:()=>o(n.key)})},n.key)),
|
|
6
|
-
/* @__PURE__ */C(d,{content:r,children:/* @__PURE__ */C(c,{ref:y,color:
|
|
7
|
-
return C("div",{className:"es-ts",ref:
|
|
6
|
+
/* @__PURE__ */C(d,{content:r,children:/* @__PURE__ */C(c,{ref:y,color:q,size:"sm",className:"es-ts-swatch es-ts-swatch--any","aria-label":r,selected:w,"aria-expanded":v,"aria-controls":v?b:void 0,disabled:u,onClick:()=>g(e=>!e)})})]}),v?/* @__PURE__ */C(n,{id:b,value:s??"",onChange:e=>o(e),label:a,readOnly:u,onClose:()=>{g(!1),y.current?.focus()}}):null]})}function _({styles:e,onChange:n,fonts:t,colours:i=[],settings:a=$,auto:o=[],fallback:d,sample:c,openId:u,defaultOpenId:y=null,onOpenChange:b,onAdd:x,rowActions:w,onRemove:S,max:M=A,readOnly:F=!1}){const j=l("textStyles",s),L=h(),[W,H]=m(y),B=void 0!==u?u:W,T=e=>{void 0===u&&H(e),b?.(e)},Y=new Set(o),q=z.filter(e=>a.includes(e)),P=f(null),[_,U]=m(null);p(()=>{if(!_||!P.current)return;const e=[...P.current.querySelectorAll(".es-ts-item")].find(e=>e.dataset.tsId===_.id),n=e?e.querySelector(".es-ts-row"):P.current.querySelector(`.es-ts-add[data-ts-kind="${_.kind}"]`);n?.focus(),U(null)},[_]);/* @__PURE__ */
|
|
7
|
+
return C("div",{className:"es-ts",ref:P,children:O.map(s=>{const a=e.filter(e=>e.kind===s),l=`${L}-${s}`,o=!E(e,s,M),u=!F&&!o;/* @__PURE__ */
|
|
8
8
|
return N("section",{className:"es-ts-section","aria-labelledby":l,children:[
|
|
9
|
-
/* @__PURE__ */C("div",{className:"es-ts-group",id:l,children:
|
|
9
|
+
/* @__PURE__ */C("div",{className:"es-ts-group",id:l,children:j.groups[s]}),a.map(s=>{const a=B===s.id,l={...d?.(s)??{},...s.values},o=t.find(e=>e.value===l.font),u=`${L}-open-${s.id}`,m=w?.(s),f=null!=m&&!1!==m,h=Boolean(S)&&!F&&!D(s),p={fontFamily:o?.family,fontSize:`${X(l.size??16)}px`,fontWeight:l.weight,fontStyle:l.italic?"italic":void 0};/* @__PURE__ */
|
|
10
10
|
return N(v,{children:[
|
|
11
11
|
/* @__PURE__ */N("div",{className:"es-ts-item","data-ts-id":s.id,children:[
|
|
12
12
|
/* @__PURE__ */N("button",{type:"button",className:"es-ts-row","aria-expanded":a,"aria-controls":a?u:void 0,onClick:()=>T(a?null:s.id),children:[
|
|
13
13
|
/* @__PURE__ */C("span",{className:"es-ts-chev","aria-hidden":"true",children:/* @__PURE__ */C(g,{size:12})}),
|
|
14
14
|
/* @__PURE__ */C("span",{className:"es-ts-name",style:p,children:s.name}),
|
|
15
|
-
/* @__PURE__ */C("span",{className:"es-ts-meta",children:
|
|
16
|
-
/* @__PURE__ */C("span",{className:"es-ts-add-word",children:
|
|
17
|
-
/* @__PURE__ */C("span",{className:"es-ts-count",children:
|
|
18
|
-
return C("div",{className:"es-ts-slider","data-ts-setting":e,children:/* @__PURE__ */C(
|
|
15
|
+
/* @__PURE__ */C("span",{className:"es-ts-meta",children:Z(l,t,j,{autoSize:Y.has("size")&&void 0===s.values.size})})]}),h||f?/* @__PURE__ */N("div",{className:"es-ts-actions",children:[h?r(j.remove,/* @__PURE__ */C("button",{type:"button",className:"es-ts-del","aria-label":j.removeNamed({name:s.name}),onClick:()=>(t=>{if(F||!S)return;const s=R(e,t.id,{name:j.styleName});if(!s)return;const i=e.filter(e=>e.kind===t.kind),a=i[i.indexOf(t)+1];B===t.id&&T(null),n(s.styles),S(s.removed),U({id:a?.id??null,kind:t.kind})})(s),children:/* @__PURE__ */C(k,{size:14,"aria-hidden":"true"})})):null,f?m:null]}):null]}),a?/* @__PURE__ */C("div",{className:"es-ts-open",id:u,children:/* @__PURE__ */C(K,{style:s,values:l,fonts:t,colours:i,settings:q,autoSet:Y,sample:c??j.sample,words:j,readOnly:F,set:t=>n(V(e,s.id,t))})}):null]},s.id)}),r(!F&&o?j.full({kind:s,max:M}):void 0,/* @__PURE__ */N("button",{type:"button",className:"es-ts-add","data-ts-kind":s,disabled:F,"aria-disabled":!(F||!o)||void 0,"aria-describedby":!F&&o?`${L}-full-${s}`:void 0,onClick:()=>{u&&(t=>{if(F)return;const s=I(e,t,{max:M,name:j.styleName,make:x});s&&n(s.styles)})(s)},children:[
|
|
16
|
+
/* @__PURE__ */C("span",{className:"es-ts-add-word",children:j.add[s]}),
|
|
17
|
+
/* @__PURE__ */C("span",{className:"es-ts-count",children:j.count({n:a.length,max:M})})]})),F||!o?null:/* @__PURE__ */C("span",{id:`${L}-full-${s}`,className:"es-vh",children:j.full({kind:s,max:M})})]},s)})})}var U={none:S,upper:w,lower:x},G={none:"none",upper:"uppercase",lower:"lowercase"};function K({style:e,values:n,fonts:s,colours:a,settings:l,autoSet:o,sample:d,words:c,readOnly:m,set:f}){const h=e.values,p=s.find(e=>e.value===n.font),v=function(e,n){return e?n.find(n=>n.key===e)?.value??t(e)??void 0:void 0}(n.color,a),g=e=>"largestSize"===e||o.has(e),k=e=>g(e)?h[e]:n[e],x=k("size"),w=k("lineSpacing"),S=k("letterSpacing"),z=g("letterCase")?h.letterCase:n.letterCase,$={fontFamily:p?.family,fontSize:void 0===x?void 0:`${x}px`,fontWeight:n.weight,fontStyle:n.italic?"italic":void 0,lineHeight:void 0===w?void 0:String(w/100),letterSpacing:void 0===S?void 0:`${S}px`,color:v,textTransform:z?G[z]:void 0},O=e=>{const t=L[e],s=g(e);/* @__PURE__ */
|
|
18
|
+
return C("div",{className:"es-ts-slider","data-ts-setting":e,children:/* @__PURE__ */C(i,{label:c.settings[e],value:h[e],onChange:n=>f({[e]:n}),min:t.min,max:t.max,step:t.step,shiftStep:t.shiftStep,sliderMin:t.sliderMin,sliderMax:t.sliderMax,unit:t.unit||void 0,styleValue:s?void 0:n[e],auto:s?c.auto:void 0,readOnly:m})},e)};/* @__PURE__ */
|
|
19
19
|
return N(M,{children:[
|
|
20
20
|
/* @__PURE__ */C("div",{className:"es-ts-preview",style:$,"aria-label":c.preview,children:d}),l.map(t=>{switch(t){case"font":/* @__PURE__ */
|
|
21
21
|
return C(J,{value:h.font,fonts:s,words:c,readOnly:m,set:f},t);case"color":/* @__PURE__ */
|
|
22
|
-
return C(Q,{value:h.color,hex:v,colours:
|
|
22
|
+
return C(Q,{value:h.color,hex:v,colours:a,words:c,readOnly:m,set:f},t);case"emphasis":{const e=(n.weight??400)>=600,s=!1!==p?.italic;/* @__PURE__ */
|
|
23
23
|
return N("div",{className:"es-ts-set","data-ts-setting":t,children:[
|
|
24
24
|
/* @__PURE__ */C("span",{className:"es-ts-sub",children:c.settings.emphasis}),
|
|
25
25
|
/* @__PURE__ */N("div",{className:"es-ts-icons",children:[r(c.bold,/* @__PURE__ */C(u,{className:"es-ts-icon","aria-label":c.bold,"aria-pressed":e,disabled:m,onClick:()=>f({weight:e?400:700}),children:/* @__PURE__ */C(y,{size:16})})),m||s?r(c.italic,/* @__PURE__ */C(u,{className:"es-ts-icon","aria-label":c.italic,"aria-pressed":Boolean(n.italic),disabled:m,onClick:()=>f({italic:!n.italic||void 0}),children:/* @__PURE__ */C(b,{size:16})})):/* @__PURE__ */C(u,{className:"es-ts-icon","aria-label":c.italic,"aria-pressed":Boolean(n.italic),"aria-disabled":!0,disabledReason:c.italicMissing,children:/* @__PURE__ */C(b,{size:16})})]})]},t)}case"letterCase":/* @__PURE__ */
|
|
26
|
-
return C(ee,{value:h.letterCase??n.letterCase,auto:g("letterCase"),words:c,readOnly:m,set:f},t);case"largestSize":return"heading"===e.kind?O(t):null;default:return O(t)}})]})}function J({value:e,fonts:n,words:t,readOnly:s,set:
|
|
26
|
+
return C(ee,{value:h.letterCase??n.letterCase,auto:g("letterCase"),words:c,readOnly:m,set:f},t);case"largestSize":return"heading"===e.kind?O(t):null;default:return O(t)}})]})}function J({value:e,fonts:n,words:t,readOnly:s,set:i}){const l=h();/* @__PURE__ */
|
|
27
27
|
return N("div",{className:"es-ts-set","data-ts-setting":"font",children:[
|
|
28
28
|
/* @__PURE__ */C("span",{className:"es-ts-sub",id:l,children:t.settings.font}),
|
|
29
|
-
/* @__PURE__ */C(
|
|
30
|
-
return C(
|
|
29
|
+
/* @__PURE__ */C(a,{value:e,options:n.map(e=>({label:e.label,value:e.value})),onChange:e=>i({font:e}),ariaLabelledBy:l,readOnly:s})]})}function Q({value:e,hex:n,colours:t,words:s,readOnly:i,set:a}){/* @__PURE__ */
|
|
30
|
+
return C(P,{value:e,hex:n,colours:t,label:s.settings.color,followsWord:s.colour.follows,anyWord:s.colour.any,readOnly:i,onChange:e=>a({color:e})})}function ee({value:e,auto:n,words:t,readOnly:s,set:i}){const a=n?["auto","none","upper","lower"]:["none","upper","lower"],l=e??(n?"auto":"none"),o=f([]),d=e=>i({letterCase:"auto"===e?void 0:e});/* @__PURE__ */
|
|
31
31
|
return N("div",{className:"es-ts-set","data-ts-setting":"letterCase",children:[
|
|
32
32
|
/* @__PURE__ */C("span",{className:"es-ts-sub",children:t.settings.letterCase}),
|
|
33
|
-
/* @__PURE__ */C("div",{className:"es-ts-icons",role:"radiogroup","aria-label":t.settings.letterCase,onKeyDown:e=>{const n="ArrowRight"===e.key||"ArrowDown"===e.key?1:"ArrowLeft"===e.key||"ArrowUp"===e.key?-1:0;if(!n||s)return;e.preventDefault();const t=(a.indexOf(l)+n+a.length)%a.length;d(a[t]),o.current[t]?.focus()},children:a.map((e,n)=>{const i=e===l;if("auto"===e)return r(t.case.autoTitle,/* @__PURE__ */C(u,{ref:e=>{o.current[n]=e},role:"radio",pressed:i,className:"es-ts-icon es-ts-icon--word","aria-checked":i,"aria-label":t.case.auto,tabIndex:i?0:-1,disabled:s,onClick:()=>d(e),children:t.case.auto},e));const a=U[e];return r(t.case[e],/* @__PURE__ */C(u,{ref:e=>{o.current[n]=e},role:"radio",pressed:i,className:"es-ts-icon","aria-checked":i,"aria-label":t.case[e],tabIndex:i?0:-1,disabled:s,onClick:()=>d(e),children:/* @__PURE__ */C(a,{size:16})},e))})})]})}export{$ as CAMPAIGN_TEXT_STYLE_SETTINGS,
|
|
33
|
+
/* @__PURE__ */C("div",{className:"es-ts-icons",role:"radiogroup","aria-label":t.settings.letterCase,onKeyDown:e=>{const n="ArrowRight"===e.key||"ArrowDown"===e.key?1:"ArrowLeft"===e.key||"ArrowUp"===e.key?-1:0;if(!n||s)return;e.preventDefault();const t=(a.indexOf(l)+n+a.length)%a.length;d(a[t]),o.current[t]?.focus()},children:a.map((e,n)=>{const i=e===l;if("auto"===e)return r(t.case.autoTitle,/* @__PURE__ */C(u,{ref:e=>{o.current[n]=e},role:"radio",pressed:i,className:"es-ts-icon es-ts-icon--word","aria-checked":i,"aria-label":t.case.auto,tabIndex:i?0:-1,disabled:s,onClick:()=>d(e),children:t.case.auto},e));const a=U[e];return r(t.case[e],/* @__PURE__ */C(u,{ref:e=>{o.current[n]=e},role:"radio",pressed:i,className:"es-ts-icon","aria-checked":i,"aria-label":t.case[e],tabIndex:i?0:-1,disabled:s,onClick:()=>d(e),children:/* @__PURE__ */C(a,{size:16})},e))})})]})}export{$ as CAMPAIGN_TEXT_STYLE_SETTINGS,P as ColourSwatchRow,F as TEXT_STYLE_DEFAULT_COUNT,O as TEXT_STYLE_KINDS,A as TEXT_STYLE_MAX,L as TEXT_STYLE_RANGES,z as TEXT_STYLE_SETTINGS,_ as TextStylesList,I as addTextStyle,E as canAddTextStyle,H as defaultTextStyles,Z as describeTextStyle,D as isDefaultTextStyle,R as removeTextStyle,T as resolveTextStyle,X as textStyleRowSize,V as updateTextStyle,Y as weightWord};
|
|
@@ -89,6 +89,10 @@ interface FieldOption<V = unknown> {
|
|
|
89
89
|
* control never shows it.
|
|
90
90
|
*/
|
|
91
91
|
meta?: string;
|
|
92
|
+
/** The option's SECOND LINE in the open list (the shell Select's
|
|
93
|
+
* `description`): a text style's weight under its name, in the one text
|
|
94
|
+
* panel's Style list (easel 10.0.0). Not with `searchable`. */
|
|
95
|
+
description?: string;
|
|
92
96
|
}
|
|
93
97
|
/**
|
|
94
98
|
* `ariaLabelledBy` / `ariaLabel` name the button AND its open list. Left out,
|
|
@@ -138,6 +142,18 @@ interface FieldSelectOneProps<V = unknown> extends FieldSelectBase<V> {
|
|
|
138
142
|
* Needs efficient-shell 4.180.0; on an older shell the label is still read.
|
|
139
143
|
*/
|
|
140
144
|
valueText?: (chosen: FieldOption<V> | undefined) => string;
|
|
145
|
+
/**
|
|
146
|
+
* Actions under the open list (the shell Select's `footer`, efficient-shell
|
|
147
|
+
* 7.40.0): something to DO from the field, such as the one text panel's
|
|
148
|
+
* Clear changes · Edit styles · Update style. Not with `searchable`.
|
|
149
|
+
*/
|
|
150
|
+
footer?: readonly {
|
|
151
|
+
label: string;
|
|
152
|
+
onSelect: () => void;
|
|
153
|
+
disabled?: boolean;
|
|
154
|
+
}[];
|
|
155
|
+
/** The closed field shows "*" and is described as changed (shell 7.40.0). */
|
|
156
|
+
changed?: boolean;
|
|
141
157
|
}
|
|
142
158
|
/**
|
|
143
159
|
* Several of a set (`multiple`). The value is a list, saved in the order the
|
|
@@ -74,6 +74,14 @@ type ChromeWords = {
|
|
|
74
74
|
}) => string;
|
|
75
75
|
/** `PanelResizeHandle`: the tooltip. */
|
|
76
76
|
resize: string;
|
|
77
|
+
/** `headWords`: line 2 of the inspector head for a section… */
|
|
78
|
+
tierSection: string;
|
|
79
|
+
/** …for a block… */
|
|
80
|
+
tierBlock: string;
|
|
81
|
+
/** …and for a part of something, `name` being what it is part of. */
|
|
82
|
+
partOf: (v: {
|
|
83
|
+
name: string;
|
|
84
|
+
}) => string;
|
|
77
85
|
/** `MediaPanelHead`, browsing: the panel's name. */
|
|
78
86
|
mediaLibrary: string;
|
|
79
87
|
/** `MediaPanelHead`, choosing: the panel's name. `kind` is a `mediaKinds` word. */
|
|
@@ -128,8 +128,9 @@ type CopyWords = {
|
|
|
128
128
|
* (E5a). Optional, so a host's words from before still type; English when
|
|
129
129
|
* left out. */
|
|
130
130
|
showMarks?: string;
|
|
131
|
-
/** Clear
|
|
132
|
-
*
|
|
131
|
+
/** Clear changes (was "Clear style"; one text panel v3, 2026-10-15: one
|
|
132
|
+
* word, the same one the Style list says), on the line under the box (owner
|
|
133
|
+
* ruling 2026-10-07), and its tooltip while nothing is selected. Optional, so a host's words from
|
|
133
134
|
* before still type; English when left out. */
|
|
134
135
|
clearStyle?: string;
|
|
135
136
|
clearStyleEmpty?: string;
|
|
@@ -144,6 +145,30 @@ type CopyWords = {
|
|
|
144
145
|
hue: string;
|
|
145
146
|
hex: string;
|
|
146
147
|
};
|
|
148
|
+
/** The one text panel's rows (`TextPartPanel`, text panel v3) and their
|
|
149
|
+
* answers. "Clear changes" in the Style list is `clearStyle`, one word.
|
|
150
|
+
* Optional, so a host's words from before still type; English when left
|
|
151
|
+
* out. */
|
|
152
|
+
panel?: {
|
|
153
|
+
style: string;
|
|
154
|
+
editStyles: string;
|
|
155
|
+
updateStyle: string;
|
|
156
|
+
font: string;
|
|
157
|
+
italic: string;
|
|
158
|
+
list: string;
|
|
159
|
+
lists: {
|
|
160
|
+
none: string;
|
|
161
|
+
bullet: string;
|
|
162
|
+
number: string;
|
|
163
|
+
};
|
|
164
|
+
capitalization: string;
|
|
165
|
+
cases: {
|
|
166
|
+
none: string;
|
|
167
|
+
upper: string;
|
|
168
|
+
capitalize: string;
|
|
169
|
+
lower: string;
|
|
170
|
+
};
|
|
171
|
+
};
|
|
147
172
|
/** The number cells' names, and the tooltip each one carries. */
|
|
148
173
|
cells?: {
|
|
149
174
|
fontSize: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-easel",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.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",
|
|
@@ -527,7 +527,7 @@
|
|
|
527
527
|
"dist"
|
|
528
528
|
],
|
|
529
529
|
"peerDependencies": {
|
|
530
|
-
"efficient-shell": "^7.
|
|
530
|
+
"efficient-shell": "^7.44.0",
|
|
531
531
|
"react": ">=18",
|
|
532
532
|
"react-dom": ">=18"
|
|
533
533
|
},
|
|
@@ -537,7 +537,7 @@
|
|
|
537
537
|
"@types/node": "^22.0.0",
|
|
538
538
|
"@types/react": "^18.2.0",
|
|
539
539
|
"@types/react-dom": "^18.2.0",
|
|
540
|
-
"efficient-shell": "^7.
|
|
540
|
+
"efficient-shell": "^7.44.0",
|
|
541
541
|
"esbuild": "^0.27.0",
|
|
542
542
|
"jsdom": "^26.1.0",
|
|
543
543
|
"react": "^18.2.0",
|
package/dist/chunk-AUT242JK.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{MARKUP_TOOLS as e,MARK_PLACEHOLDERS as t}from"./chunk-546BBOPE.js";var r={formatting:"Formatting",alignment:"Alignment",align:{left:"Left",center:"Center",right:"Right",justify:"Justify"},marks:{...Object.fromEntries(e.map(e=>[e.style,{name:e.name??e.title,title:e.title}])),underline:{name:"Underline",title:"Underline · [words]{underline}"},sup:{name:"Superscript",title:"Superscript · [words]{sup}"},sub:{name:"Subscript",title:"Subscript · [words]{sub}"}},placeholders:t,showMarks:"Show marks",clearStyle:"Clear style",clearStyleEmpty:"Select words first",colors:{title:"Color",theme:"Theme colors",remove:"Remove",any:"Any color",square:"Saturation and brightness",hue:"Hue",hex:"Hex color"},cells:{fontSize:"Font size",lineHeight:"Line spacing",letterSpacing:"Letter spacing",paragraphSpacing:"Paragraph spacing",tip:({name:e,step:t,unit:r})=>`${e} · step ${t} ${r} · Shift ×10`}};export{r as DEFAULT_COPY_WORDS};
|
package/dist/chunk-CWTAS5R6.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{slotFieldsOf as n}from"./chunk-PLVEGYK6.js";import{usePickFollowsSelection as e}from"./chunk-R6WTQWAC.js";import{EaselCanvas as t,useSelectedFields as r}from"./chunk-K5744MTM.js";import{Inspector as i}from"./chunk-UCLVWF5E.js";import{createContext as o,useContext as u}from"react";import{DesktopIcon as l}from"efficient-shell/icons/efficient";import{jsx as s}from"react/jsx-runtime";var c={kind:"puck"};function f(n,e){const t=n,r=e,i=Object.keys(t);return i.length===Object.keys(r).length&&i.every(n=>Object.is(t[n],r[n]))}function a(n){const e=n;return"string"==typeof e.nodeId&&"string"==typeof e.slot}function d(e,t,r){const i=e.slotsOf?.(r);return i||n(t,r.type).map(n=>({slot:n,label:n,rung:!1}))}function p(n,e){return n.isFirst?n.isFirst(e):e.type===n.first}function m(n,e){return n.isLast?n.isLast(e):e.type===n.last}var k={},h={},v=()=>k,g=()=>"",y=()=>null,b=()=>{},L={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},O={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},j={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */s(l,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},w={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},C={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function S(){/* @__PURE__ */
|
|
2
|
-
return s(t,{height:"fill"})}function P(){const{id:n,fields:e,values:t,readOnly:o,onChange:u}=r();/* @__PURE__ */
|
|
3
|
-
return s("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */s(i,{fields:e,values:t,onChange:u,readOnly:o,idPrefix:n})})}var D=o({});function G({parts:n,children:e}){/* @__PURE__ */
|
|
4
|
-
return s(D.Provider,{value:n,children:e})}function N(){return u(D)}function T(){return(N().useOwnerName??g)()}function x(){return(N().useDocumentLabel??y)()}function B(n,e,t,r){return(N().useBridges??v)(n,e,t,r)}function F(n){return(N().useStandaloneBridges??v)(n)}function I(n,e){(N().useDocumentPass??b)(n,e)}function A(){return N().blockRules??L}function K(){return N().blockLook??O}function R(){return N().devices??j}function V(){return N().leftView??w}function W(){return N().pinned??C}function E(){return N().saveSwitch??!0}function M(n){e(!0===N().pickFollowsSelection,n)}function H(){return N().add??h}function Q(){return N().storageNamespace||void 0}function U(){return N().styleClipboard??null}function Y(){return N().nodeKeys??!0}function Z(){return N().notify??null}function q(){return N().Canvas??S}function z(){return N().CanvasHead??null}function J(){return N().canvasDrag??null}var X=o(null);function $({target:n,children:e}){/* @__PURE__ */
|
|
5
|
-
return s(X.Provider,{value:n,children:e})}function _(){return u(X)}function nn(){return N().Inspector??P}export{c as SELECTION_MODE,$ as ScreenCanvasTargetProvider,G as ScreenPartsProvider,p as isPinnedFirst,m as isPinnedLast,a as isSlotMode,f as sameInspectorMode,d as screenSlotsOf,H as useScreenAdd,K as useScreenBlockLook,A as useScreenBlockRules,B as useScreenBridges,J as useScreenCanvasDrag,q as useScreenCanvasFrame,z as useScreenCanvasHead,_ as useScreenCanvasTarget,R as useScreenDevices,x as useScreenDocumentLabel,I as useScreenDocumentPass,nn as useScreenInspectorPanel,V as useScreenLeftView,Y as useScreenNodeKeys,Z as useScreenNotify,T as useScreenOwnerName,N as useScreenParts,M as useScreenPickFollowsSelection,W as useScreenPinned,E as useScreenSaveSwitch,Q as useScreenStorageNamespace,U as useScreenStyleClipboard,F as useStandaloneScreenBridges};
|
package/dist/chunk-GZH4UVDH.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{SettingsSwitch as e}from"./chunk-QLD57GBB.js";import{jsxs as l,jsx as n,Fragment as a}from"react/jsx-runtime";import{isValidElement as i,cloneElement as s}from"react";function r({title:e,open:a,onToggle:i,count:s,level:r=3,id:c,children:d,className:o}){const t=c?`${c}-body`:void 0;/* @__PURE__ */
|
|
2
|
-
return l("div",{className:o?`es-group ${o}`:"es-group",children:[
|
|
3
|
-
/* @__PURE__ */n(`h${r}`,{className:"es-group-title",children:/* @__PURE__ */l("button",{type:"button",id:c,"aria-expanded":a,"aria-controls":t,className:"es-group-head",onClick:()=>i(!a),children:[e,"number"==typeof s&&s>0?/* @__PURE__ */n("span",{className:"es-group-count",children:s}):null,
|
|
4
|
-
/* @__PURE__ */n("span",{className:"es-group-sign","aria-hidden":"true"})]})}),
|
|
5
|
-
/* @__PURE__ */n("div",{id:t,className:"es-group-body",hidden:!a,children:d})]})}function c(e){return Array.isArray(e)?e.some(c):i(e)}function d(l,n,a){if(!i(l)||l.type!==e)return l;const r=l.props;return r.ariaLabel||r.ariaLabelledBy?l:s(l,a?{ariaLabelledBy:a}:{ariaLabel:n})}function o({label:e,labelId:i,icon:s,value:r,hint:o,changed:t,htmlFor:u,action:h,children:m,className:p}){const f=c(m),N=c(h);if(!f&&!N)return null;const b=["es-field"];f||b.push("is-inline"),t&&b.push("is-changed"),p&&b.push(p);const g=/* @__PURE__ */l(a,{children:[s?/* @__PURE__ */n("span",{className:"es-field-icon","aria-hidden":"true",children:s}):null,
|
|
6
|
-
/* @__PURE__ */n("span",{className:"es-field-label",id:i,children:e})]});/* @__PURE__ */
|
|
7
|
-
return l("div",{className:b.join(" "),children:[
|
|
8
|
-
/* @__PURE__ */l("div",{className:"es-field-head",children:[u?/* @__PURE__ */n("label",{className:"es-field-name",htmlFor:u,children:g}):/* @__PURE__ */n("span",{className:"es-field-name",children:g}),null!=r?/* @__PURE__ */n("span",{className:"es-field-value",children:r}):null,N?d(h,e,i):null]}),f?/* @__PURE__ */n("div",{className:"es-field-ctl",children:m}):null,o?/* @__PURE__ */n("p",{className:"es-field-hint",children:o}):null]})}var t=Object.freeze(["Design","Animation"]),u=Object.freeze(["Content","Size","Design","Layout","Position","Anchor"]);export{u as DESIGN_GROUPS,t as SETTINGS_BUCKETS,o as SettingsField,r as SettingsGroup};
|
package/dist/chunk-HA33IXEU.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useSectionOps as o}from"./chunk-VF6TCI62.js";import{decodePartId as e,encodePartId as r}from"./chunk-IYT6NN2J.js";import{usePreviewParts as t}from"./chunk-I54UCYOU.js";import{SELECTION_MODE as n}from"./chunk-CWTAS5R6.js";import{useEasel as p}from"./chunk-K5744MTM.js";import{useCallback as d,useEffect as c}from"react";var s=o=>"part"===o.kind;function m({mode:m,setMode:i,onOpenPart:I}){const{getSelectorForId:a}=p(o=>o),u=o(),{setSelectedPartId:f,setSelectHandler:k}=t(),l=d(o=>{const r=e(o);if(!r)return;const{nodeId:t,propKey:p}=r;p?(i(o=>s(o)&&o.nodeId===t&&o.propKey===p?o:{kind:"part",nodeId:t,propKey:p}),I?.(t)):i(o=>"part"===o.kind?n:o)},[i,I]);c(()=>{k(l)},[k,l]);const h=s(m)?r(m.nodeId,m.propKey):null;c(()=>{f(h)},[h,f]);return{selectNode:d(o=>{i(()=>n);const e=a(o);e&&u.select(e)},[i,a,u]),openPartId:h}}export{m as usePartBridge};
|
package/dist/chunk-KIA6EKAM.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{buildPaletteSections as e,pinnedSection as t,paletteWithoutPinned as o,categoryLabel as n}from"./chunk-PA3PNTVV.js";import{blockTypesIn as i}from"./chunk-5ZBY24K7.js";import{sectionTemplatesOf as s}from"./chunk-BVN33R76.js";import{SidePanelHead as r,PanelModeExit as c}from"./chunk-XTJCKV6Z.js";import{useEaselSession as l}from"./chunk-O7Q4DDJT.js";import{blockRuns as a}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as p,useScreenBlockRules as m}from"./chunk-CWTAS5R6.js";import{DEFAULT_SCREEN_WORDS as d}from"./chunk-JTUUIVBZ.js";import{useEasel as f}from"./chunk-K5744MTM.js";import{useWords as u}from"./chunk-MFIRYGHW.js";import{AddPanel as k}from"./chunk-FCLW4LEN.js";import{DEFAULT_DRAG_WORDS as y}from"./chunk-O2NLQBFX.js";import{useState as h,useEffect as b,useMemo as j}from"react";import{AddIcon as g}from"efficient-shell/icons/efficient";import{jsx as $,jsxs as B,Fragment as O}from"react/jsx-runtime";var v=e=>`section:${e}`,L=e=>`block:${e}`,T=e=>`template:${e}`;function V({blocks:V,blocksOnly:x,at:A,sectionAccepts:C,onAdd:I,itemFor:N,session:F,siteWide:H,onClose:R,onHide:W,readOnly:w}){const D=f(e=>e.config),J=p(),{labelAtLevel:K,categoryLabel:M,firstSection:Q,Icon:S,Thumbnail:Z}=J,{blockIsOffered:z}=m(),E=u("screen",d).add,P=u("drag",y).add,U=l(),[X,Y]=h([]);b(()=>{let e=!1;const t=e=>z(e,U);return s(U).list().then(o=>{if(e)return;const n=D.components;Y(o.filter(e=>e.node?.type&&n[e.node.type]&&i(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[D,U]);const G=j(()=>e(D,J),[D]),q=e=>({type:v(e.type),label:e.name,cover:/* @__PURE__ */$(Z,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:E.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),_=j(()=>{const e=[];if(V&&V.choices.length>0&&a(V.choices).forEach((t,o)=>{e.push({key:`blocks:${o}`,title:0===o?`${E.inside({name:V.parentName})}${t.group?` · ${t.group}`:""}`:t.group??"",tiles:t.items.map(e=>({type:L(e.type),label:e.label,icon:/* @__PURE__ */$(S,{type:e.type,size:18}),title:E.tile({name:e.label})}))})}),x)return e;const i=e=>!C||C(e),s=t(G,Q);s&&i(s.type)&&e.push({key:"start",title:E.startBlank,tiles:[q(s)]});const r=X.filter(e=>i(e.node.type));r.length>0&&e.push({key:"templates",title:E.templates,tiles:r.map(e=>{return{type:T(e.id),label:e.name,cover:/* @__PURE__ */$(Z,{type:e.node.type}),keywords:[(t=e.node.type,K(t,"section",D.components[t]?.label??t)),e.node.type]};var t})});const c=o(G,Q);for(const t of Object.keys(D.categories??{})){const o=c.filter(e=>e.cat===t&&i(e.type));0!==o.length&&e.push({key:`category:${t}`,title:n(D,t,M),tiles:o.map(q)})}return e},[V,x,X,G,D,E,C]),ee=e=>{const t=e.indexOf(":"),o=e.slice(0,t),n=e.slice(t+1);if("section"===o)return{kind:"section",type:n};if("block"===o)return{kind:"block",type:n};if("template"===o){const e=X.find(e=>e.id===n);return e?{kind:"template",template:e}:null}return null};/* @__PURE__ */
|
|
2
|
-
return B(O,{children:[
|
|
3
|
-
/* @__PURE__ */$(r,{icon:/* @__PURE__ */$(g,{size:15}),title:E.title,context:x?E.contextBlocks:E.contextAll,actions:/* @__PURE__ */$(c,{label:E.done,description:E.doneDescription,onClick:R}),onHide:W}),
|
|
4
|
-
/* @__PURE__ */B("div",{className:"sf-addside sf-scroll",children:[
|
|
5
|
-
/* @__PURE__ */$(k,{groups:_,session:F,itemFor:e=>N(ee(e)??{kind:"section",type:e}),onInsert:e=>{const t=ee(e);t&&I(t)},at:A,hint:x?E.hintBlocks:E.hint,searchLabel:x?E.searchBlocks:E.searchSections,readOnly:w,words:P}),H&&!x?H:null]})]})}export{V as AddSidePanel,L as blockKey,v as sectionKey,T as templateKey};
|
package/dist/chunk-OZ72A6MY.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{DEFAULT_FIELDS_WORDS as e}from"./chunk-FFYXVAAL.js";import{useWords as l}from"./chunk-MFIRYGHW.js";import{SearchableSelect as a,Select as i,Slider as n}from"efficient-shell/ui";import{jsx as r,jsxs as s}from"react/jsx-runtime";import{useId as o,useRef as t}from"react";function u(e,l){return e.find(e=>Object.is(e.value,l))}var d=e=>String(e);function c(n){const{id:o,options:t,placeholder:u,readOnly:c=!1,ariaLabel:v,ariaLabelledBy:m,searchable:p=!1,searchPlaceholder:h,groupCount:b=!1,renderOption:f}=n,g=l("fields",e),N=m?{"aria-labelledby":m}:v?{"aria-label":v}:{},x=t.some(e=>void 0!==e.thumb),y=x||void 0!==f||t.some(e=>void 0!==e.meta),C=e=>""===e?void 0:t[Number(e)],O=(e,l)=>{const a=C(e.value);return a?/* @__PURE__ */s("span",{className:"es-fsel-row",children:[x?/* @__PURE__ */r("span",{className:"es-fsel-thumb","aria-hidden":"true",children:a.thumb?/* @__PURE__ */r("img",{src:a.thumb,alt:"",loading:"lazy"}):null}):null,
|
|
2
|
-
/* @__PURE__ */r("span",{className:"es-fsel-label",children:f?f(a,{active:l.active??!1,chosen:l.selected}):a.label}),void 0===a.meta||p?null:/* @__PURE__ */r("span",{className:"es-fsel-meta","aria-hidden":"true",children:a.meta})]}):e.label},j=[];let V=null;if(t.forEach((e,l)=>{const a={value:d(l),label:e.label,...e.disabled?{disabled:!0}:{},...p&&e.meta?{sublabel:e.meta}:{}};void 0===e.group?(V=null,j.push(a)):V&&V.label===e.group?V.options.push(a):(V={label:e.group,options:[a]},j.push(V))}),b)for(const e of j)"options"in e&&(e.label=`${e.label} ${e.options.length}`);const F=e=>e.flatMap(e=>{const l=C(e.value);return l?[l]:[]});if(p){const l={id:o,options:j,placeholder:h??u??g.search??e.search,disabled:c,renderOption:y?O:void 0,...N};if(!0===n.multiple){const e=Array.isArray(n.value)?n.value:[],i=n.onChange;/* @__PURE__ */
|
|
3
|
-
return r("div",{className:"es-fsel",children:/* @__PURE__ */r(a,{...l,multiple:!0,value:t.flatMap((l,a)=>e.some(e=>Object.is(e,l.value))?[d(a)]:[]),onChange:e=>i(t.filter((l,a)=>e.includes(d(a))).map(e=>e.value))})})}const i=t.findIndex(e=>Object.is(e.value,n.value)),s=n.onChange;/* @__PURE__ */
|
|
4
|
-
return r("div",{className:"es-fsel",children:/* @__PURE__ */r(a,{...l,value:i>=0?d(i):"",clearable:!1,onChange:e=>{const l=C(e);l&&!Object.is(l.value,n.value)&&s(l.value)}})})}const I={id:o,size:"sm",className:"es-fsel-button",options:j,placeholder:u??g.choose,readOnly:c,renderOption:y?O:void 0,...N};if(!0===n.multiple){const e=Array.isArray(n.value)?n.value:[],l=l=>e.some(e=>Object.is(e,l.value)),a=t.flatMap((e,a)=>l(e)?[d(a)]:[]),s=n.onChange;/* @__PURE__ */
|
|
5
|
-
return r("div",{className:"es-fsel",children:/* @__PURE__ */r(i,{...I,multiple:!0,value:a,renderValue:n.renderValue?e=>n.renderValue(F(e)):void 0,valueText:n.valueText?e=>n.valueText(F(e)):void 0,onChange:e=>s(t.filter((l,a)=>e.includes(d(a))).map(e=>e.value))})})}const M=t.findIndex(e=>Object.is(e.value,n.value)),T=n.onChange;/* @__PURE__ */
|
|
6
|
-
return r("div",{className:"es-fsel",children:/* @__PURE__ */r(i,{...I,value:M>=0?d(M):"",renderValue:n.renderValue?e=>n.renderValue(F(e)[0]):void 0,valueText:n.valueText?e=>n.valueText(F(e)[0]):void 0,onChange:e=>{const l=C(e);l&&!Object.is(l.value,n.value)&&T(l.value)}})})}function v({id:e,label:l,value:a,onChange:i,min:u,max:d,step:c=1,shiftStep:v,styleValue:m,unit:p,sliderMin:h,sliderMax:b,auto:f,readOnly:g=!1}){const N=o(),x=e??N,y="number"==typeof a&&Number.isFinite(a)?a:void 0,C=void 0!==f&&void 0===y,O=!C&&void 0===y&&void 0!==m,j=Number((h-c).toFixed(6)),V=t(!1),F=e=>{V.current="range"===e.target.type},I=e=>{g||e===y||i(e)};/* @__PURE__ */
|
|
7
|
-
return s("div",{className:"es-fslider"+(O||C?" is-style":""),onChangeCapture:F,onKeyDownCapture:F,onPointerDownCapture:F,children:[
|
|
8
|
-
/* @__PURE__ */r("label",{className:"es-fslider-name",htmlFor:x,children:l}),
|
|
9
|
-
/* @__PURE__ */r(n,{id:x,label:l,value:y??null,onChange:e=>{if(null===e)return I(void 0);I(void 0!==f&&V.current&&e<h?void 0:e)},min:void 0!==f?j:h,max:b,inputMin:u??-1e9,inputMax:d??Number.POSITIVE_INFINITY,step:c,shiftStep:v,suffix:p&&!C?p:void 0,emptyLabel:f??(void 0===m?"":void 0),placeholderValue:void 0===f?m:void 0,stepFrom:void 0!==f?j:void 0,disabled:g,size:"sm"})]})}export{c as FieldSelect,v as FieldSlider,u as optionFor};
|
package/dist/chunk-QLD57GBB.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{Segmented as e,Switch as a,Tooltip as s}from"efficient-shell/ui";import{jsx as i,jsxs as l}from"react/jsx-runtime";function n({options:a,value:n,onChange:d,ariaLabel:t,fit:r,disabled:c=!1,className:o}){const b=r&&function(e,a){return{"--es-fit-count":e,"--es-fit-labels":`${a.labelsPx}px`,"--es-fit-widest":`${a.widestLabelPx}px`}}(a.length,r),h=a.findIndex(e=>e.id===n);
|
|
2
|
-
/* @__PURE__ */
|
|
3
|
-
return i("div",{className:"es-segs-fit","data-disabled":c||void 0,style:b,children:/* @__PURE__ */i(e,{size:"sm",label:t,className:`es-segs${b?" is-measured":""}${o?` ${o}`:""}`,value:h<0?"":String(h),onChange:e=>d(a[Number(e)].id),options:a.map((e,a)=>{const n=e.title??("string"==typeof e.label?e.label:void 0),d="string"!=typeof e.label,t=a=>n&&(e.icon||d)?/* @__PURE__ */i(s,{content:n,children:a}):a;return{value:String(a),disabled:c||!0===e.disabled,icon:e.icon?t(
|
|
4
|
-
/* @__PURE__ */i("span",{className:"es-seg-icon","aria-hidden":"true",children:e.icon})):void 0,label:d?/* @__PURE__ */l("span",{className:"es-seg-word",children:[t(/* @__PURE__ */i("span",{"aria-hidden":"true",children:e.label})),
|
|
5
|
-
/* @__PURE__ */i("span",{className:"es-vh",children:n})]}):/* @__PURE__ */i("span",{className:"es-seg-word",children:e.label})}})})})}function d({checked:e,onChange:s,disabled:l,id:n,ariaLabel:d,ariaLabelledBy:t,className:r}){/* @__PURE__ */
|
|
6
|
-
return i(a,{size:"sm",id:n,checked:e,"aria-label":d,"aria-labelledby":t,disabled:l,className:r?`es-switch ${r}`:"es-switch",onChange:s})}export{n as SettingsSegmented,d as SettingsSwitch};
|
package/dist/chunk-UCLVWF5E.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import{TreeSeam as e}from"./chunk-4JSBIW5H.js";import{FieldSelect as n}from"./chunk-OZ72A6MY.js";import{SettingsField as l,SETTINGS_BUCKETS as t,SettingsGroup as a}from"./chunk-GZH4UVDH.js";import{DEFAULT_TREE_WORDS as r}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as o}from"./chunk-KFV7N2DJ.js";import{EaselMenuItems as i}from"./chunk-EA2HTX37.js";import{FieldNumber as s}from"./chunk-66LWADFP.js";import{SettingsSegmented as c}from"./chunk-QLD57GBB.js";import{DEFAULT_FIELDS_WORDS as d}from"./chunk-FFYXVAAL.js";import{useWords as u}from"./chunk-MFIRYGHW.js";import{useTreeDrag as m,gapToMoveIndex as p}from"./chunk-67GNT6PF.js";import{withTip as h}from"./chunk-P2VEMZH5.js";import{Textarea as f,Input as b,SortableList as g,ListRow as v,ContextMenu as y,tabPanelId as k,Tabs as x,tabButtonId as w}from"efficient-shell/ui";export{LinkPicker}from"efficient-shell/ui";import{useRef as N,useState as C,useLayoutEffect as O,useId as $}from"react";import{jsx as j,jsxs as D}from"react/jsx-runtime";import{ChevronIcon as S,LockIcon as I,MoveUpIcon as L,MoveDownIcon as P,DuplicateIcon as F,TrashIcon as A}from"efficient-shell/icons/efficient";function M({id:e,value:n,onChange:l,placeholder:t,multiline:a=!1,rows:r=3,readOnly:o=!1,ariaLabel:i,ariaLabelledBy:s}){const c=n??"";return a?/* @__PURE__ */j(f,{id:e,size:"sm",className:"es-fin",value:c,rows:r,placeholder:t,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>l(e.target.value)}):/* @__PURE__ */j(b,{id:e,size:"sm",className:"es-fin",type:"text",value:c,placeholder:t,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>l(e.target.value)})}function T(e,n,l){const t=e.slice();return t.splice(Math.max(0,Math.min(n,t.length)),0,l),t}function H(e,n,l){const t=e.slice(),[a]=t.splice(n,1);return t.splice(Math.max(0,Math.min(l,t.length)),0,a),t}function z(e,n){return e.filter((e,l)=>l!==n)}function E(e){return null===e||"object"!=typeof e?e:JSON.parse(JSON.stringify(e))}var R='input, textarea, select, button, [contenteditable]:not([contenteditable="false"]), [tabindex]',B={parentId:"list",slot:"items"};function Y({label:n,icon:l,noun:t,items:a,onChange:o,newItem:s,summary:c,itemName:f,thumb:b,min:k=0,max:x,readOnly:w=!1,open:$,onOpen:M,renderItem:Y,renderRow:K,canRemove:V,lockedReason:G,fixed:J=!1,removeOnRow:Z=!0,canDuplicate:W,above:X,head:q=!0}){const Q=u("fields",d).list,U=u("tree",r),_=t??Q.item,ee=!w&&!J&&("number"!=typeof x||a.length<x),ne=a.length<=k,le=e=>!!V&&!V(a[e],e),te=e=>!w&&!J&&Z&&!ne&&!le(e),ae=e=>ee&&(!W||W(a[e],e)),re=(e,n)=>f?f(e,n):Q.itemName({noun:_,n:n+1}),oe=N([]),ie=N(null),[se,ce]=C(null),de=N(null),[ue,me]=C(null),[pe,he]=C("");O(()=>{const e=ie.current;if(!e)return;ie.current=null;const n=oe.current[e.index]?.querySelectorAll(R)[e.nth]??oe.current[e.index];if(n?.focus(),n&&null!==e.start&&"setSelectionRange"in n)try{n.setSelectionRange(e.start,e.end)}catch{}});const fe=(e,n)=>{if(n<0||n>=a.length||n===e)return;const l=oe.current[e],t=l?.ownerDocument.activeElement;if(l&&t&&l.contains(t)){const e=[...l.querySelectorAll(R)].indexOf(t),a=t;ie.current={index:n,nth:e,start:"number"==typeof a.selectionStart?a.selectionStart:null,end:"number"==typeof a.selectionEnd?a.selectionEnd:null}}o(H(a,e,n));const r=function(e,n,l){return null===e?null:e===n?l:n<e&&l>=e?e-1:n>e&&l<=e?e+1:e}($,e,n);r!==$&&M(r),he(Q.moved({n:n+1,total:a.length}))},be=e=>{ee&&(o(T(a,e,s())),K?(ie.current={index:e,nth:0,start:null,end:null},null!==$&&$>=e&&M($+1)):M(e))},ge=e=>{te(e)&&(o(z(a,e)),$===e?M(null):null!==$&&$>e&&M($-1))},ve=m({keyOf:e=>String(e),canDrop:(e,n)=>n.parentId===B.parentId&&n.slot===B.slot,onDrop:(e,n)=>{const l=p({...B,index:e},n);l!==e&&fe(e,l)},onStep:(e,n)=>fe(e,e+n),canStep:(e,n)=>e+n>=0&&e+n<a.length,readOnly:w}),ye=e=>{const n=[];return e>0&&n.push({label:Q.moveUp,icon:/* @__PURE__ */j(L,{size:14}),shortcut:"⌥↑",onClick:()=>fe(e,e-1)}),e<a.length-1&&n.push({label:Q.moveDown,icon:/* @__PURE__ */j(P,{size:14}),shortcut:"⌥↓",onClick:()=>fe(e,e+1)}),ae(e)&&n.push({label:Q.duplicate,icon:/* @__PURE__ */j(F,{size:14}),onClick:()=>(e=>{ae(e)&&(o(T(a,e+1,E(a[e]))),null!==$&&$>e&&M($+1))})(e)}),te(e)&&n.push({label:Q.delete,icon:/* @__PURE__ */j(A,{size:14}),danger:!0,onClick:()=>ge(e)}),n},ke=(e,n,l,t)=>{w||0===ye(e).length||me({index:e,x:n,y:l,owner:t})},xe=e=>n=>{const l=a.slice();l[e]=n,o(l)};/* @__PURE__ */
|
|
2
|
-
return D("div",{className:"es-list",children:[q?/* @__PURE__ */D("div",{className:"es-list-head",children:[
|
|
3
|
-
/* @__PURE__ */D("span",{className:"es-list-label",children:[l?/* @__PURE__ */j("span",{className:"es-field-icon","aria-hidden":"true",children:l}):null,n]}),
|
|
4
|
-
/* @__PURE__ */j("span",{className:"es-list-count",children:a.length})]}):null,X?/* @__PURE__ */j("div",{className:"es-list-above",children:X}):null,a.length?/* @__PURE__ */D(g,{"aria-label":n,spacing:"comfortable",className:"es-list-rows",rootProps:ve.rootProps(),children:[a.map((n,l)=>{const t=ve.row({item:l,place:{...B,index:l}}),a=t.draggable&&se!==l,r=!K&&$===l,o=!w&&!J&&Z&&le(l),i=["es-list-row",K?"is-inline":"is-item",r?"is-open":"",a?"is-draggable":"",t.dragging?"is-dragging":"",t.drop?`is-drop-${t.drop}`:""].filter(Boolean).join(" ");return[l>0?/* @__PURE__ */j(e,{...ve.seam({place:{...B,index:l}}),onAdd:ee?()=>be(l):void 0,label:Q.addHere({noun:_})},`seam-${l}`):null,
|
|
5
|
-
/* @__PURE__ */j(v,{className:i,flat:!!K,active:r,draggable:t.draggable,dragHint:U.dragHint,dragging:t.dragging,drop:"before"===t.drop||"after"===t.drop?t.drop:void 0,onMove:t.draggable?e=>fe(l,"up"===e?l-1:l+1):void 0,rowRef:e=>{oe.current[l]=e},rowProps:{...t.rowProps,draggable:a||void 0,onPointerDown:e=>{const n=e.target.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])'),a=!!n&&n===n.ownerDocument.activeElement;e.currentTarget.draggable=t.draggable&&!a,de.current=n&&!a?n:null,ce(a?l:null)},onDragStart:e=>{const n=de.current;de.current=null,n&&n.ownerDocument.activeElement===n&&n.blur(),t.rowProps.onDragStart?.(e)},onContextMenu:e=>{w||(e.preventDefault(),e.stopPropagation(),ke(l,e.clientX,e.clientY,e.currentTarget))},onKeyDown:e=>{if("ContextMenu"===e.key||e.shiftKey&&"F10"===e.key){e.preventDefault();const n=e.currentTarget.ownerDocument,t=e=>e.preventDefault();n.addEventListener("contextmenu",t,{capture:!0,once:!0}),n.defaultView?.setTimeout(()=>n.removeEventListener("contextmenu",t,{capture:!0}),500);const a=e.currentTarget.getBoundingClientRect();return void ke(l,a.left+24,a.bottom,e.currentTarget)}t.rowProps.onKeyDown?.(e)}},actions:w||J||!Z?void 0:o?h(G?G(n,l):Q.locked,/* @__PURE__ */j("span",{className:"es-list-lock",role:"img","aria-label":G?G(n,l):Q.locked,children:/* @__PURE__ */j(I,{size:13})})):h(Q.deleteItem({noun:_}),/* @__PURE__ */j("button",{type:"button",className:"es-list-x","aria-label":Q.deleteItem({noun:_}),disabled:!te(l),onClick:()=>ge(l),children:"×"})),below:r?/* @__PURE__ */j("div",{className:"es-list-item",children:Y(n,l,xe(l))}):void 0,children:K?/* @__PURE__ */j("div",{className:"es-list-row-main",children:K(n,l,xe(l))}):/* @__PURE__ */D("button",{type:"button",className:"es-list-open","aria-expanded":r,onClick:()=>M(r?null:l),children:[b?/* @__PURE__ */j("span",{className:"es-list-thumb","aria-hidden":"true",children:b(n,l)}):null,
|
|
6
|
-
/* @__PURE__ */j("span",{className:"es-list-row-name",children:re(n,l)}),/* @__PURE__ */j("span",c?{className:"es-list-row-summary",children:c(n,l)}:{className:"es-list-row-summary"}),
|
|
7
|
-
/* @__PURE__ */j(S,{size:14,className:"es-list-chev","aria-hidden":"true"})]})},l)]}),
|
|
8
|
-
/* @__PURE__ */j(e,{...ve.seam({place:{...B,index:a.length}})})]}):null,w||J?null:/* @__PURE__ */j("button",{type:"button",className:"es-list-add",disabled:!ee,onClick:()=>be(a.length),children:Q.add({noun:_})}),
|
|
9
|
-
/* @__PURE__ */j("span",{className:"es-list-said","aria-live":"polite",children:pe}),ue&&ue.index<a.length?
|
|
10
|
-
/* @__PURE__ */j(y,{at:{x:ue.x,y:ue.y},owner:ue.owner,onClose:()=>me(null),children:/* @__PURE__ */j(i,{items:ye(ue.index),onClose:()=>me(null)})}):null]})}var K=e=>e<6?e+1:6,V=(e,n)=>"string"==typeof e.label&&e.label?e.label:n;function G({field:e,name:n,id:l,value:t,onChange:r,readOnly:o,context:i,renderers:s,headingLevel:c=3}){const[d,u]=C(!0),m=t&&"object"==typeof t?t:{};/* @__PURE__ */
|
|
11
|
-
return j(a,{id:`${l}-group`,title:V(e,n),open:d,onToggle:u,level:c,children:Object.entries(e.objectFields).map(([e,t])=>/* @__PURE__ */j(Z,{field:t,name:`${n}.${e}`,id:`${l}-${e}`,value:m[e],onChange:n=>r({...m,[e]:n}),readOnly:o,context:i,renderers:s,headingLevel:K(c)},e))})}function J({field:e,name:n,id:l,value:t,onChange:a,readOnly:r,context:o,renderers:i,openItem:s,onOpenItem:c,headingLevel:d}){const[u,m]=C(null),p=c?s??null:u,h=c??m,f=Array.isArray(t)?t:[],b=e.getItemSummary;/* @__PURE__ */
|
|
12
|
-
return j(Y,{label:V(e,n),icon:e.icon,noun:"string"==typeof e.noun?e.noun:void 0,items:f,onChange:a,newItem:()=>E({...e.defaultItemProps??{}}),summary:b?(e,n)=>b(e,n):void 0,min:e.min,max:e.max,readOnly:r,open:p,onOpen:h,renderItem:(t,a,s)=>Object.entries(e.arrayFields).map(([e,c])=>/* @__PURE__ */j(Z,{field:c,name:`${n}[${a}].${e}`,id:`${l}-${a}-${e}`,value:t?.[e],onChange:n=>s({...t,[e]:n}),readOnly:r,context:o,renderers:i,headingLevel:d},e))})}function Z(e){const{field:t,name:a,id:r,value:o,onChange:i,readOnly:d,context:u,renderers:m}=e;if(!t||t.marker||!1===t.visible)return null;const p=m?.[t.type];if(p)return p({field:t,name:a,id:r,value:o,onChange:i,readOnly:d});switch(t.type){case"custom":{const e={...u,field:t,name:a,id:r,value:o,onChange:i,readOnly:d};return t.render(e)}case"text":case"textarea":/* @__PURE__ */
|
|
13
|
-
return j(l,{label:V(t,a),htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */j(M,{id:r,value:"string"==typeof o?o:null==o?"":String(o),onChange:i,placeholder:t.placeholder,multiline:"textarea"===t.type,readOnly:d})});case"number":/* @__PURE__ */
|
|
14
|
-
return j(l,{label:V(t,a),htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */j(s,{id:r,value:"number"==typeof o?o:void 0,onChange:i,min:t.min,max:t.max,step:t.step,placeholder:t.placeholder,readOnly:d})});case"select":{const e=`${r}-label`;/* @__PURE__ */
|
|
15
|
-
return j(l,{label:V(t,a),labelId:e,htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */j(n,{id:r,value:o,options:t.options,onChange:i,readOnly:d,ariaLabelledBy:e})})}case"radio":/* @__PURE__ */
|
|
16
|
-
return j(l,{label:V(t,a),icon:t.icon,hint:t.hint,children:/* @__PURE__ */j(c,{ariaLabel:V(t,a),value:o,options:t.options.map(e=>({id:e.value,label:e.label,icon:e.icon,disabled:e.disabled||d})),onChange:e=>{d||i(e)}})});case"object":/* @__PURE__ */
|
|
17
|
-
return j(G,{...e,field:t});case"array":/* @__PURE__ */
|
|
18
|
-
return j(J,{...e,field:t});case"slot":return null}}var W=e=>t.includes(e);function X(e){let n,l=t[0];const a=[],r=/* @__PURE__ */new Set;for(const[t,o]of Object.entries(e))o&&(W(o.bucket)&&((o.marker||o.bucket!==l)&&(n=void 0),l=o.bucket),o.marker&&"string"==typeof o.fold?n={key:t,title:o.fold}:o.marker&&!1===o.fold&&(n=void 0),o.marker||!1===o.visible||(a.push(n?{name:t,field:o,bucket:l,fold:n}:{name:t,field:o,bucket:l}),"slot"!==o.type&&r.add(l)));return{rows:a,buckets:t.filter(e=>r.has(e))}}function q(e){return new Map(X(e).rows.map(e=>[e.name,e.bucket]))}function Q(e){const n=[];for(const l of e){const e=n[n.length-1];e&&e.fold?.key===l.fold?.key?e.rows.push(l):n.push({fold:l.fold,rows:[l]})}return n}function U({fields:e,values:n,onChange:l,readOnly:t=!1,context:r,tab:i,onTab:s,tabs:c=!0,tabIcons:d,renderers:m,idPrefix:p,ariaLabel:h,lead:f,children:b,leadFold:g,closedFolds:v,onFold:y,headingLevel:N=3}){const O=u("panel",o),S=$(),I=p??`es-insp${S.replace(/:/g,"")}`,L=X(e),[P,F]=C(void 0),A=i??P,M=A&&L.buckets.includes(A)?A:L.buckets[0],[T,H]=C(null),z=T&&T.panel===I&&L.rows.some(e=>e.name===T.name)?T:null,E=c&&L.buckets.length>1,R=E&&M?k(I,M):`${I}-rows`,[B,Y]=C(()=>/* @__PURE__ */new Set),V=v??B,G=(e,n)=>{/* @__PURE__ */return j(a,{title:e.title,open:!V.has(e.key),onToggle:n=>((e,n)=>{void 0===v&&Y(l=>{const t=new Set(l);return n?t.delete(e):t.add(e),t}),y?.(e,n)})(e.key,n),id:`${I}-fold-${l=e.key,[...l].map(e=>/[A-Za-z0-9_-]/.test(e)?e:`-u${e.codePointAt(0).toString(16)}-`).join("")}`,level:N,children:n});var l},J=e=>E&&e!==M,W=({name:e,field:a,bucket:o,fold:i})=>/* @__PURE__ */j("div",{className:"es-insp-row","data-field":e,"data-bucket":o,hidden:!!J(o)||void 0,children:/* @__PURE__ */j(Z,{field:a,name:e,id:`${I}-${e}`,value:n[e],onChange:n=>l(e,n),readOnly:t,context:r,renderers:m,openItem:z&&z.name===e?z.index:null,onOpenItem:n=>H(null===n?null:{panel:I,name:e,index:n}),headingLevel:i?K(N):N})},e);/* @__PURE__ */
|
|
19
|
-
return D("div",{className:"es-insp",children:[E?/* @__PURE__ */j("div",{className:"es-insp-tabs",children:/* @__PURE__ */j(x,{variant:"underline",block:!0,"aria-label":h??O.settings,idPrefix:I,value:M,onChange:e=>{const n=e;void 0===i&&F(n),s?.(n)},items:L.buckets.map(e=>{const n=O.buckets[e],l=d?.[e];return l?{id:e,icon:l,label:/* @__PURE__ */j("span",{className:"sr-only",children:n}),tooltip:n}:{id:e,label:n}})})}):null,
|
|
20
|
-
/* @__PURE__ */D("div",{className:"es-insp-rows",id:R,role:E?"tabpanel":void 0,"aria-labelledby":E&&M?w(I,M):void 0,children:[f?g?/* @__PURE__ */j("div",{className:"es-insp-band","data-fold":g.key,children:G(g,f)}):f:null,Q(L.rows).map((e,n)=>{if(!e.fold)return e.rows.map(W);const l=e.rows[0].bucket,t=e.rows.every(e=>"slot"===e.field.type);/* @__PURE__ */
|
|
21
|
-
return j("div",{className:"es-insp-band","data-fold":e.fold.key,"data-bucket":l,hidden:!(!J(l)&&!t)||void 0,children:G(e.fold,e.rows.map(W))},`fold-${e.fold.key}-${n}`)}),b]})]})}export{M as FieldText,U as Inspector,Z as InspectorField,Y as ListField,q as bucketsOf,E as copyItem,T as insertAt,V as labelOf,H as moveTo,X as planFields,z as removeAt};
|
package/dist/chunk-Y2G7CU6A.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={reload:"Reload the saved version",takeOver:"Take over editing",takeBack:"Take it back",viewReadOnly:"View read-only",savedByYou:({noun:e,when:n})=>`You saved this ${e} in another tab or window ${n}.`,savedByOther:({name:e,noun:n,when:i})=>`${e} saved this ${n} ${i}.`,conflictBody:"Your last change was not saved. It is still on screen here, but this copy is out of date — copy anything you need, then reload to carry on from the saved version.",takeOverWhileDeciding:"Nobody else can save while you decide. Nothing on your screen is lost.",tookOver:({name:e,noun:n,when:i})=>`${e} took over this ${n} ${i}.`,tookOverBody:"Your changes since then are still on screen but are no longer being saved.",viewingOnly:"Viewing only.",viewingOnlyBody:({name:e,noun:n,seen:i})=>`${e} is editing this ${n} (last seen ${i}). Nothing you change here is saved.`,editing:({name:e,noun:n})=>`${e} is editing this ${n}`,editingBody:({seen:e})=>`(last seen ${e}). Nothing you change here will be saved while they are in it.`,takeOverTold:"They are told straight away and stop being able to save."},n={device:"Preview device",upLevel:"Go up one level",upLevelTo:({label:e,name:n})=>`${e} to ${n}`,resize:"Drag to resize · double-click to reset",mediaLibrary:"Media library",mediaChoose:({kind:e})=>`Choose ${e}`,mediaFor:({field:e})=>`For ${e}`,mediaKinds:{image:"image",video:"video",svg:"SVG logo"},mediaCancel:"Cancel",mediaKeep:({kind:e})=>`Keep the current ${e}`,hidePanel:"Hide panel",hidePanelLabel:({side:e})=>`Hide the ${e} panel`,showPanel:"Show panel",showPanelLabel:({side:e})=>`Show the ${e} panel`};export{n as DEFAULT_CHROME_WORDS,e as DEFAULT_NOTICE_WORDS};
|