efficient-easel 26.15.0 → 27.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 +9 -8
- package/dist/{canvas-typing--FlIZwbT.d.ts → canvas-typing-CD1aeYnk.d.ts} +7 -0
- package/dist/chunk-2262JGFV.js +5 -0
- package/dist/{chunk-NUJEHA6A.js → chunk-3W2O22DZ.js} +10 -10
- package/dist/chunk-53QUHEHK.js +1 -0
- package/dist/{chunk-7U4HEUZM.js → chunk-5JNVMCCB.js} +1 -1
- package/dist/{chunk-5OYP3C2K.js → chunk-5OWAV3MH.js} +1 -1
- package/dist/chunk-76MUJIZE.js +17 -0
- package/dist/{chunk-YMK3MZJK.js → chunk-AAZIMKLQ.js} +1 -1
- package/dist/{chunk-PG7G7ELT.js → chunk-BFJAEQZ6.js} +1 -1
- package/dist/chunk-DAKKPW2Z.js +1 -0
- package/dist/chunk-DIOTWSCO.js +1 -0
- package/dist/chunk-FW35PCK7.js +1 -0
- package/dist/{chunk-C4TJN6GR.js → chunk-G2VZ4DET.js} +1 -1
- package/dist/{chunk-WMC6FE3G.js → chunk-HG65R6IN.js} +14 -14
- package/dist/chunk-L2WK5JYB.js +2 -0
- package/dist/chunk-L7PSERQH.js +8 -0
- package/dist/{chunk-3BQT7FC7.js → chunk-MNQDOSAX.js} +2 -2
- package/dist/{chunk-H4TUOPI7.js → chunk-NTG5ODKZ.js} +1 -1
- package/dist/{chunk-2EDOL4IW.js → chunk-O4OWODU2.js} +35 -35
- package/dist/chunk-TDEBPOWV.js +3 -0
- package/dist/{chunk-3ZGOVNVH.js → chunk-TYTMUHUK.js} +1 -1
- package/dist/chunk-W3UZNKGS.js +7 -0
- package/dist/{chunk-CLAADE4J.js → chunk-XWTQTANN.js} +5 -5
- package/dist/{chunk-MGEXTIZH.js → chunk-YES5F7OS.js} +1 -1
- package/dist/chunk-ZFEAWEFS.js +4 -0
- package/dist/chunk-ZNLODQD4.js +3 -0
- package/dist/copy/index.d.ts +3 -3
- package/dist/copy/index.js +12 -12
- package/dist/draw/index.js +1 -1
- package/dist/easel/index.d.ts +2 -2
- package/dist/easel/index.js +1 -1
- package/dist/fields/index.d.ts +43 -16
- package/dist/fields/index.js +1 -1
- package/dist/panel/index.js +1 -1
- package/dist/{rowMarks-CO5TpfLY.d.ts → rowMarks-D2cO7UTi.d.ts} +5 -5
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/NodeContextMenu.js +1 -1
- package/dist/screen/components/PageEditGuardNotices.js +1 -1
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenDocumentContext.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 +17 -17
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/content/view-tiers.d.ts +11 -1
- package/dist/screen/lib/content/view-tiers.js +1 -1
- package/dist/screen/lib/document/block-set-host.js +1 -1
- package/dist/screen/lib/document/block-size-fields.js +1 -1
- package/dist/screen/lib/document/box-fields.d.ts +41 -13
- package/dist/screen/lib/document/box-fields.js +1 -1
- package/dist/screen/lib/document/button-fields.js +1 -1
- package/dist/screen/lib/document/device-fields.d.ts +10 -17
- package/dist/screen/lib/document/device-fields.js +1 -1
- package/dist/screen/lib/document/image-fields.js +5 -5
- package/dist/screen/lib/document/panel-no-control-mark.d.ts +2 -2
- package/dist/screen/lib/document/shadow-fields.js +2 -2
- package/dist/screen/lib/document/style-clipboard.js +1 -1
- 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.d.ts +0 -10
- package/dist/screen/lib/screen-parts.js +1 -1
- package/dist/screen/screen.css +0 -6
- package/dist/screen/words.d.ts +1 -3
- package/dist/screen/words.js +1 -1
- package/dist/strings/index.js +2 -2
- package/dist/text-styles/index.d.ts +6 -5
- package/dist/text-styles/index.js +37 -37
- package/dist/text-styles/model.d.ts +24 -14
- package/dist/text-styles/model.js +1 -1
- package/dist/{types-CVHwspYM.d.ts → types-DcyH17ij.d.ts} +2 -0
- package/package.json +1 -1
- package/dist/chunk-BLE3U2GS.js +0 -2
- package/dist/chunk-CPIWSFGR.js +0 -2
- package/dist/chunk-E52W3M5I.js +0 -1
- package/dist/chunk-IHOTVWDE.js +0 -7
- package/dist/chunk-K6TDOXHR.js +0 -17
- package/dist/chunk-L4DFCNDQ.js +0 -5
- package/dist/chunk-M4SOZEZR.js +0 -4
- package/dist/chunk-RWGOCHH7.js +0 -1
- package/dist/chunk-U4TG43PD.js +0 -1
- package/dist/chunk-VVHDUTAE.js +0 -8
- package/dist/chunk-YHZSBL2N.js +0 -1
- package/dist/chunk-ZEH6QLBH.js +0 -4
package/README.md
CHANGED
|
@@ -684,9 +684,9 @@ by `AUTO_RULES[kind]`; Phone's parent is Tablet, Tablet's is Desktop. The kinds:
|
|
|
684
684
|
40), `columns` (at most 2, then 1), `stack` (Phone stacked), `textSize`
|
|
685
685
|
(x0.85 and x0.7, to 1px), `heightMode` (Phone: px → fit, Screen % stays),
|
|
686
686
|
`heightPx` (x0.75) and `same`. The breakpoints are `VIEW_TABLET_MIN` 720 and
|
|
687
|
-
`VIEW_DESKTOP_MIN` 1100. A text style
|
|
688
|
-
|
|
689
|
-
|
|
687
|
+
`VIEW_DESKTOP_MIN` 1100. A text style keeps Size, Line spacing, Letter spacing, Paragraph spacing and
|
|
688
|
+
Largest size per view (`<key>Tablet`, `<key>Phone`; absent = the next wider view).
|
|
689
|
+
The website's rendering reads the engine in later releases. Never store what `resolveViewValue` returns for
|
|
690
690
|
an auto view.
|
|
691
691
|
|
|
692
692
|
Nothing moved: each name is re-exported from the module that defines it, and
|
|
@@ -1074,8 +1074,11 @@ const easel = createEasel<EaselConfig>({ config, data, onChange: (doc) => autosa
|
|
|
1074
1074
|
is not planned or drawn (it would write the desktop value). A heading mark, a
|
|
1075
1075
|
slot and a field that draws no control anywhere stay; the `Inspector`'s `lead`
|
|
1076
1076
|
is not drawn. `fieldShownInView(field, device, siblings?)`
|
|
1077
|
-
is the one answer, exported from `efficient-easel/fields`.
|
|
1078
|
-
|
|
1077
|
+
is the one answer, exported from `efficient-easel/fields`. The tablet view is
|
|
1078
|
+
the same with `deviceField("tablet", …)`. Desktop and no device: every row, as
|
|
1079
|
+
before. `phoneTwinFields(key, row, VIEW_KEY_ACCESS)` gives a row its tablet and
|
|
1080
|
+
phone values under `<key>Tablet` and `<key>Phone`; `rowViewState`,
|
|
1081
|
+
`innerRowCount` and `viewReadsIn` are the census a host's guard reads. A kept key (a field with `reachedBy`:
|
|
1079
1082
|
`keptByRow`, a padding side, Position's y) is shown in the phone view only
|
|
1080
1083
|
if its row is shown (`siblings` is the fields it sits among; `planFields`
|
|
1081
1084
|
passes them); with no siblings it is hidden on the phone. `planFields` also
|
|
@@ -1278,9 +1281,7 @@ the Footer is drawn; `pinned.band` names the sections between the pins, folds
|
|
|
1278
1281
|
them under a row of their own and ends them with an "Add section" row; and
|
|
1279
1282
|
`useDocumentLabel` is the head's context line. A row's name, its quieter
|
|
1280
1283
|
words, its marks and buttons of the layer's own are `blockLook.rowName`,
|
|
1281
|
-
`rowPreview`, `rowMarks` and `rowActions
|
|
1282
|
-
block a small tab above it on the canvas while it is selected or under the
|
|
1283
|
-
pointer ("Designs shown" for a number filled from a live count). A block config's
|
|
1284
|
+
`rowPreview`, `rowMarks` and `rowActions`. A block config's
|
|
1284
1285
|
`permissions.delete` / `duplicate` set to `false` takes the action off the
|
|
1285
1286
|
block's rows and its menu, and the inspector is handed the answer for its
|
|
1286
1287
|
head (`nodeActions`). The frame's words (the pinned labels,
|
|
@@ -350,6 +350,13 @@ interface CanvasTypingOptions {
|
|
|
350
350
|
caret: [number, number];
|
|
351
351
|
/** The host's ONE writer — the same the panel's text box writes through. */
|
|
352
352
|
write: (next: string) => void;
|
|
353
|
+
/**
|
|
354
|
+
* Whether a write can land now (the canvas says no while the edit lock is on).
|
|
355
|
+
* Left out, always. An IME composition is the one edit the browser makes
|
|
356
|
+
* itself; with this false the composed letters are taken off the words and
|
|
357
|
+
* nothing is written.
|
|
358
|
+
*/
|
|
359
|
+
editable?: () => boolean;
|
|
353
360
|
/** Typing ended; the words are what was last written. */
|
|
354
361
|
end: (why: CanvasTypingEnd) => void;
|
|
355
362
|
/** The browser wrote into the words (a composition): draw them afresh. */
|
|
@@ -0,0 +1,5 @@
|
|
|
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-3W2O22DZ.js";import{Inspector as i}from"./chunk-HG65R6IN.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=()=>{},S={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},L={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},N={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},I={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function P(){/* @__PURE__ */
|
|
2
|
+
return f(r,{height:"fill"})}function B(){const{id:n,fields:e,values:t,readOnly:r,onChange:u}=o();/* @__PURE__ */
|
|
3
|
+
return f("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */f(i,{fields:e,values:t,onChange:u,readOnly:r,idPrefix:n})})}var G=l({});function x({parts:n,children:e}){/* @__PURE__ */
|
|
4
|
+
return f(G.Provider,{value:n,children:e})}function A(){return s(G)}function F(){return(A().useOwnerName??j)()}function T(){return(A().useDocumentLabel??w)()}function R(n,e,t,r){return(A().useBridges??O)(n,e,t,r)}function Y(n){return(A().useStandaloneBridges??O)(n)}function H(n,e){(A().useDocumentPass??C)(n,e)}function Q(){return A().blockRules??S}function V(){return A().blockLook??L}function W(){return A().devices??N}function X(){return A().leftView??D}function Z(){return A().pinned??I}function E(){return A().saveSwitch??!0}function K(e){n(!0===A().pickFollowsSelection,e)}function M(){return A().storageNamespace||void 0}function q(){return A().styleClipboard??null}function z(){return A().nodeKeys??!0}function J(){return A().notify??null}function U(){return A().Canvas??P}function $(){return A().CanvasHead??null}function _(){return A().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 A().Inspector??B}export{a as SELECTION_MODE,en as ScreenCanvasTargetProvider,x 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,V as useScreenBlockLook,Q as useScreenBlockRules,R as useScreenBridges,_ as useScreenCanvasDrag,U as useScreenCanvasFrame,$ as useScreenCanvasHead,tn as useScreenCanvasTarget,W as useScreenDevices,T as useScreenDocumentLabel,H as useScreenDocumentPass,rn as useScreenInspectorPanel,X as useScreenLeftView,z as useScreenNodeKeys,J as useScreenNotify,F as useScreenOwnerName,A as useScreenParts,K as useScreenPickFollowsSelection,Z as useScreenPinned,E as useScreenSaveSwitch,M as useScreenStorageNamespace,q as useScreenStyleClipboard,Y as useStandaloneScreenBridges};
|
|
@@ -1,19 +1,19 @@
|
|
|
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 y}from"./chunk-3BQT7FC7.js";import{DEFAULT_COPY_WORDS as v}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 x,isTypingTarget as C,upsertCanvasStyle as E,removeCanvasStyle as I,WORDS_CLEAR as A,frameRectToHost as D,drawnBox as M}from"./chunk-FR7EEKFF.js";import{queryAllCopies as O}from"./chunk-7UFKEX72.js";import{find as $,ROOT_ID as P,getList as j,remove as z,parseZoneKey as R,move as L,duplicate as B,replaceNode as N,createNode as V,insert as K,normalizeData as T,createResolveCache as F,slotsOf as Z,deepEqual as H,ROOT_SLOT as W,resolveNodeData as q}from"./chunk-EUFDQ4KL.js";import{topLevelSlotKeys as Q,fieldsFrom as Y,drawnBlockCount as U,defaultsFrom as X}from"./chunk-KXM6YRG2.js";import{createContext as G,useEffect as J,useContext as _,useRef as ee,useSyncExternalStore as te,useState as ne,useReducer as oe,useCallback as re,createElement as le,useMemo as ie,useLayoutEffect as se}from"react";import{jsx as ae,jsxs as ce,Fragment as ue}from"react/jsx-runtime";import{createPortal as de}from"react-dom";import{registerModalEscapeInterceptor as pe,FloatingBar as fe,TextToolbar as he,LinkPicker as me}from"efficient-shell/ui";function ge(e){return!["setData","setUi","set"].includes(e.type)}var ye=(e,t,n,o)=>{const r=j(e,t,R(n));return r?.[o]??null},ve=(e,t,n,o,r)=>{const l=ye(e,t,n,o);if(!l)throw new Error(`${r}: nothing at ${n}[${o}]`);return l};function we(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 be(e,t,n){return n?"node"===n.kind?$(e,t,n.id)?n:null:n.parentId===P?j(e,t,n)?n:null:$(e,t,n.parentId)&&j(e,t,n)?n:null:null}function ke(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 Se(e,t,n){const o=xe(e,t,n);if(o===e)return e;const r=be(o.data,n,o.selection);return r===o.selection?o:{...o,selection:r}}function xe(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 ke(e,n,"function"==typeof t.ui?t.ui(we(e,n)):t.ui);case"set":{const r={data:o,ui:we(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=ke(i,n,l.ui,!0)),i}case"insert":{const r={...R(t.destinationZone),index:t.destinationIndex},l=V(n,t.componentType,{},t.id?{id:t.id}:{});return{...e,data:K(o,n,r,l)}}case"replace":{const r=ve(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:N(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=ve(o,n,t.sourceZone,t.sourceIndex,"duplicate"),l=B(o,n,r.props.id),i=ye(l,n,t.sourceZone,t.sourceIndex+1);return{...e,data:l,selection:i?{kind:"node",id:i.props.id}:e.selection}}case"reorder":return xe(e,{...t,type:"move",sourceZone:t.destinationZone},n);case"move":{if(t.sourceZone===t.destinationZone&&t.sourceIndex===t.destinationIndex)return e;const r=ye(o,n,t.sourceZone,t.sourceIndex);if(!r)return e;const l={...R(t.destinationZone),index:t.destinationIndex};return{...e,data:L(o,n,r.props.id,l)}}case"remove":{const r=ve(o,n,t.zone,t.index,"remove");return{...e,data:z(o,n,r.props.id)}}default:return e}}var Ce={drag:!0,duplicate:!0,delete:!0,edit:!0,insert:!0},Ee={leftSideBarVisible:!0,rightSideBarVisible:!0,arrayState:{},componentList:{},isDragging:!1,previewMode:"edit",viewports:{current:{width:360,height:"auto"},options:[],controlsVisible:!0},field:{focus:null}},Ie=0,Ae=()=>`history-${Ie+=1}`;function De(e){let t=e.config;const n=e.now??(()=>Date.now()),o=e.historyCoalesceMs??250;let i=e.permissions??{};const s=T(e.data,t);let a=s,c={data:s,selection:null,ui:{...Ee}};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:{...Ee,...r}}}let u=[{core:c,at:-1/0,sealed:!0,id:Ae()}],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:Ae()}],d=u.length-1)},f=/* @__PURE__ */new Set;let h=null,m=null,g=0,y=null,v=!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?v=v||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=Se(c,e,t),c===n)return;const o=e.recordHistory??ge(e);k(n,o&&c.data!==n.data)},x=t=>{0===g&&(y=c,v=!1),g+=1;try{t()}catch(e){throw g-=1,0===g&&y&&(c=y,y=null),e}if(g-=1,g>0||!y)return;const n=y;y=null,v&&c.data!==n.data?p(!0):c!==n&&b(),c.data!==n.data&&e.onChange?.(c.data),c!==n&&w()},C=e=>{const n=c,o=be(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))},E=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{...Ce,...i,...n}};let A=I();const D=F(),M={resolveCache:D,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([q(r,t,{cache:D,trigger:e,metadata:n}),...l.map(o=>q(o,t,{cache:D,trigger:e,metadata:n}))]);x(()=>{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=N(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:be(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 q(r,t,{cache:D,trigger:n,metadata:o});if(!l.didChange)return!1;let i=!1;return x(()=>{const n=c;if($(c.data,t,e)?.node!==r)return;const o=N(c.data,t,e,l.node);o!==c.data&&(c={...c,data:o,selection:be(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:we(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:()=>M.undo(),forward:()=>M.redo(),hasPast:d>0,hasFuture:d<u.length-1,histories:u.map(e=>({id:e.id,state:{data:e.core.data,ui:we(e.core,t)}})),index:d,setHistoryIndex:e=>{e>=0&&e<u.length&&e!==d&&E(e)}},getPermissions:A,getItemById:n=>$(e.data,t,n)?.node,getItemBySelector:n=>function(e,t,n){const[o,r]=(n.zone??"root:default-zone").split(/:(.*)/s);return j(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:x,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=>C(e?{kind:"node",id:e}:null),selectSlot:e=>C(e?{kind:"slot",parentId:e.parentId,slot:e.slot}:null),run(e){x(()=>{const n=c,o=void 0===e.select?c.selection:e.select;c={...c,data:e.data,selection:be(e.data,t,o)},k(n,e.data!==n.data)})},load(e,n={}){const o=c,r=T(e,t);c={...c,data:r,selection:be(r,t,n.selection??c.selection)},a=r,n.keepHistory||(u=[{core:c,at:-1/0,sealed:!0,id:Ae()}],d=0),c!==o&&w()},undo(){d>0&&E(d-1)},redo(){d<u.length-1&&E(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,A=I(),h=null,w())},setConfig(e){e!==t&&(t=e,A=I(),h=null,w())}};return M}function Me(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&&C(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 Oe=G(null),$e=G(!0);function Pe({easel:e,hotkeys:t=!0,resolveOnMount:n=!0,children:o}){return J(()=>{n&&e.resolveAll()},[e,n]),J(()=>{if(t&&"undefined"!=typeof document)return Me(document,e)},[e,t]),/* @__PURE__ */ae(Oe.Provider,{value:e,children:/* @__PURE__ */ae($e.Provider,{value:t,children:o})})}function je(){const e=_(Oe);if(!e)throw new Error("useEasel: no <EaselProvider> above this component");return e}function ze(e){const t=je(),n=ee({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 te(t.subscribe,o,o)}function Re(){return function(e){return ze(e)}}var Le=["--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"],Be="host-tokens";function Ne(e,t){const n=function(e){const t=e.ownerDocument.defaultView;if(!t)return"";const n=t.getComputedStyle(e),o=[];for(const e of Le){const t=n.getPropertyValue(e).trim();t&&o.push(`${e}: ${t};`)}return o.length?`:root { ${o.join(" ")} }`:""}(e);n?E(t,Be,n):I(t,Be)}var Ve="data-easel-block",Ke="data-easel-dropzone",Te={},Fe="data-es-mirror",Ze="undefined"==typeof window?J:se;function He(e,t,n){for(const e of Array.from(t.head.querySelectorAll(`[${Fe}]`)))e.remove();for(const o of Array.from(e.head.querySelectorAll('style, link[rel="stylesheet"]'))){const e=o.cloneNode(!0);e.setAttribute(Fe,""),n&&e.setAttribute("nonce",n),t.head.appendChild(e)}}function We({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=ee(null),[p,f]=ne(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){He(o,e,c);const t=o.defaultView;t&&"MutationObserver"in t&&(n=new t.MutationObserver(()=>He(o,e,c)),n.observe(o.head,{childList:!0,subtree:!0,characterData:!0}))}let r=null;const l=d.current;if(l&&o){Ne(l,e);const t=o.defaultView;if(t&&"MutationObserver"in t){r=new t.MutationObserver(()=>Ne(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__ */ae("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?de(e,p):null})}var qe=G(null),Qe=G(Te),Ye=[];function Ue({parentId:e,slot:t,className:n,style:o,minEmptyHeight:r=128,minEmptyWidth:l=120}){const i=je(),s=ze(n=>j(n.appState.data,i.config,{parentId:e,slot:t})??Ye),a=ze(t=>"node"===t.selection?.kind&&t.selection.id===e&&e!==P),c=ze(n=>"slot"===n.selection?.kind&&n.selection.parentId===e&&n.selection.slot===t),u=_(qe),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__ */ae("div",{className:d.join(" "),[Ke]:`${e}:${t}`,style:{...o,"--min-empty-height":`${r}px`,"--min-empty-width":`${l}px`},children:s.map(e=>/* @__PURE__ */ae(ot,{node:e},e.props.id))})}function Xe(e,t,n,o){const r=ie(()=>{const n={};for(const o of Q(Y(e)))n[o]=Object.assign(function(e={}){/* @__PURE__ */
|
|
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 y}from"./chunk-MNQDOSAX.js";import{DEFAULT_COPY_WORDS as v}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 x,isTypingTarget as C,upsertCanvasStyle as I,removeCanvasStyle as E,WORDS_CLEAR as A,frameRectToHost as M,drawnBox as D}from"./chunk-FR7EEKFF.js";import{queryAllCopies as O}from"./chunk-7UFKEX72.js";import{find as $,ROOT_ID as P,getList as j,remove as z,parseZoneKey as R,move as L,duplicate as N,replaceNode as B,createNode as V,insert as K,normalizeData as T,createResolveCache as F,slotsOf as Z,deepEqual as H,ROOT_SLOT as W,resolveNodeData as q}from"./chunk-EUFDQ4KL.js";import{topLevelSlotKeys as Q,fieldsFrom as Y,drawnBlockCount as U,defaultsFrom as X}from"./chunk-KXM6YRG2.js";import{createContext as G,useEffect as J,useContext as _,useRef as ee,useSyncExternalStore as te,useState as ne,useReducer as oe,useCallback as re,createElement as le,useMemo as ie,useLayoutEffect as se}from"react";import{jsx as ae,jsxs as ce,Fragment as ue}from"react/jsx-runtime";import{createPortal as de}from"react-dom";import{registerModalEscapeInterceptor as pe,FloatingBar as fe,TextToolbar as he,LinkPicker as me}from"efficient-shell/ui";function ge(e){return!["setData","setUi","set"].includes(e.type)}var ye=(e,t,n,o)=>{const r=j(e,t,R(n));return r?.[o]??null},ve=(e,t,n,o,r)=>{const l=ye(e,t,n,o);if(!l)throw new Error(`${r}: nothing at ${n}[${o}]`);return l};function we(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 be(e,t,n){return n?"node"===n.kind?$(e,t,n.id)?n:null:n.parentId===P?j(e,t,n)?n:null:$(e,t,n.parentId)&&j(e,t,n)?n:null:null}function ke(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 Se(e,t,n){const o=xe(e,t,n);if(o===e)return e;const r=be(o.data,n,o.selection);return r===o.selection?o:{...o,selection:r}}function xe(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 ke(e,n,"function"==typeof t.ui?t.ui(we(e,n)):t.ui);case"set":{const r={data:o,ui:we(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=ke(i,n,l.ui,!0)),i}case"insert":{const r={...R(t.destinationZone),index:t.destinationIndex},l=V(n,t.componentType,{},t.id?{id:t.id}:{});return{...e,data:K(o,n,r,l)}}case"replace":{const r=ve(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:B(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=ve(o,n,t.sourceZone,t.sourceIndex,"duplicate"),l=N(o,n,r.props.id),i=ye(l,n,t.sourceZone,t.sourceIndex+1);return{...e,data:l,selection:i?{kind:"node",id:i.props.id}:e.selection}}case"reorder":return xe(e,{...t,type:"move",sourceZone:t.destinationZone},n);case"move":{if(t.sourceZone===t.destinationZone&&t.sourceIndex===t.destinationIndex)return e;const r=ye(o,n,t.sourceZone,t.sourceIndex);if(!r)return e;const l={...R(t.destinationZone),index:t.destinationIndex};return{...e,data:L(o,n,r.props.id,l)}}case"remove":{const r=ve(o,n,t.zone,t.index,"remove");return{...e,data:z(o,n,r.props.id)}}default:return e}}var Ce={drag:!0,duplicate:!0,delete:!0,edit:!0,insert:!0},Ie={leftSideBarVisible:!0,rightSideBarVisible:!0,arrayState:{},componentList:{},isDragging:!1,previewMode:"edit",viewports:{current:{width:360,height:"auto"},options:[],controlsVisible:!0},field:{focus:null}},Ee=0,Ae=()=>`history-${Ee+=1}`;function Me(e){let t=e.config;const n=e.now??(()=>Date.now()),o=e.historyCoalesceMs??250;let i=e.permissions??{};const s=T(e.data,t);let a=s,c={data:s,selection:null,ui:{...Ie}};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:{...Ie,...r}}}let u=[{core:c,at:-1/0,sealed:!0,id:Ae()}],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:Ae()}],d=u.length-1)},f=/* @__PURE__ */new Set;let h=null,m=null,g=0,y=null,v=!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?v=v||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=Se(c,e,t),c===n)return;const o=e.recordHistory??ge(e);k(n,o&&c.data!==n.data)},x=t=>{0===g&&(y=c,v=!1),g+=1;try{t()}catch(e){throw g-=1,0===g&&y&&(c=y,y=null),e}if(g-=1,g>0||!y)return;const n=y;y=null,v&&c.data!==n.data?p(!0):c!==n&&b(),c.data!==n.data&&e.onChange?.(c.data),c!==n&&w()},C=e=>{const n=c,o=be(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))},I=t=>{const n=c;d=t,c=u[d].core,c.data!==n.data&&e.onChange?.(c.data),c!==n&&w()},E=()=>(e={})=>{const n=e.root?t.root?.permissions:t.components[e.item?.type??e.type??""]?.permissions;return{...Ce,...i,...n}};let A=E();const M=F(),D={resolveCache:M,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([q(r,t,{cache:M,trigger:e,metadata:n}),...l.map(o=>q(o,t,{cache:M,trigger:e,metadata:n}))]);x(()=>{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=B(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:be(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 q(r,t,{cache:M,trigger:n,metadata:o});if(!l.didChange)return!1;let i=!1;return x(()=>{const n=c;if($(c.data,t,e)?.node!==r)return;const o=B(c.data,t,e,l.node);o!==c.data&&(c={...c,data:o,selection:be(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:we(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:()=>D.undo(),forward:()=>D.redo(),hasPast:d>0,hasFuture:d<u.length-1,histories:u.map(e=>({id:e.id,state:{data:e.core.data,ui:we(e.core,t)}})),index:d,setHistoryIndex:e=>{e>=0&&e<u.length&&e!==d&&I(e)}},getPermissions:A,getItemById:n=>$(e.data,t,n)?.node,getItemBySelector:n=>function(e,t,n){const[o,r]=(n.zone??"root:default-zone").split(/:(.*)/s);return j(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:x,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=>C(e?{kind:"node",id:e}:null),selectSlot:e=>C(e?{kind:"slot",parentId:e.parentId,slot:e.slot}:null),run(e){x(()=>{const n=c,o=void 0===e.select?c.selection:e.select;c={...c,data:e.data,selection:be(e.data,t,o)},k(n,e.data!==n.data)})},load(e,n={}){const o=c,r=T(e,t);c={...c,data:r,selection:be(r,t,n.selection??c.selection)},a=r,n.keepHistory||(u=[{core:c,at:-1/0,sealed:!0,id:Ae()}],d=0),c!==o&&w()},undo(){d>0&&I(d-1)},redo(){d<u.length-1&&I(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,A=E(),h=null,w())},setConfig(e){e!==t&&(t=e,A=E(),h=null,w())}};return D}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&&C(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 Oe=G(null),$e=G(!0);function Pe({easel:e,hotkeys:t=!0,resolveOnMount:n=!0,children:o}){return J(()=>{n&&e.resolveAll()},[e,n]),J(()=>{if(t&&"undefined"!=typeof document)return De(document,e)},[e,t]),/* @__PURE__ */ae(Oe.Provider,{value:e,children:/* @__PURE__ */ae($e.Provider,{value:t,children:o})})}function je(){const e=_(Oe);if(!e)throw new Error("useEasel: no <EaselProvider> above this component");return e}function ze(e){const t=je(),n=ee({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 te(t.subscribe,o,o)}function Re(){return function(e){return ze(e)}}var Le=["--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 Be(e,t){const n=function(e){const t=e.ownerDocument.defaultView;if(!t)return"";const n=t.getComputedStyle(e),o=[];for(const e of Le){const t=n.getPropertyValue(e).trim();t&&o.push(`${e}: ${t};`)}return o.length?`:root { ${o.join(" ")} }`:""}(e);n?I(t,Ne,n):E(t,Ne)}var Ve="data-easel-block",Ke="data-easel-dropzone",Te={},Fe="data-es-mirror",Ze="undefined"==typeof window?J:se;function He(e,t,n){for(const e of Array.from(t.head.querySelectorAll(`[${Fe}]`)))e.remove();for(const o of Array.from(e.head.querySelectorAll('style, link[rel="stylesheet"]'))){const e=o.cloneNode(!0);e.setAttribute(Fe,""),n&&e.setAttribute("nonce",n),t.head.appendChild(e)}}function We({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=ee(null),[p,f]=ne(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){He(o,e,c);const t=o.defaultView;t&&"MutationObserver"in t&&(n=new t.MutationObserver(()=>He(o,e,c)),n.observe(o.head,{childList:!0,subtree:!0,characterData:!0}))}let r=null;const l=d.current;if(l&&o){Be(l,e);const t=o.defaultView;if(t&&"MutationObserver"in t){r=new t.MutationObserver(()=>Be(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__ */ae("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?de(e,p):null})}var qe=G(null),Qe=G(Te),Ye=[];function Ue({parentId:e,slot:t,className:n,style:o,minEmptyHeight:r=128,minEmptyWidth:l=120}){const i=je(),s=ze(n=>j(n.appState.data,i.config,{parentId:e,slot:t})??Ye),a=ze(t=>"node"===t.selection?.kind&&t.selection.id===e&&e!==P),c=ze(n=>"slot"===n.selection?.kind&&n.selection.parentId===e&&n.selection.slot===t),u=_(qe),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__ */ae("div",{className:d.join(" "),[Ke]:`${e}:${t}`,style:{...o,"--min-empty-height":`${r}px`,"--min-empty-width":`${l}px`},children:s.map(e=>/* @__PURE__ */ae(ot,{node:e},e.props.id))})}function Xe(e,t,n,o){const r=ie(()=>{const n={};for(const o of Q(Y(e)))n[o]=Object.assign(function(e={}){/* @__PURE__ */
|
|
2
2
|
return ae(Ue,{parentId:t,slot:o,...e})},{blockCount:0});return n},[e,t]);for(const e of Object.keys(r))r[e].blockCount=U(n[e],o);return r}function Ge(e){return ie(()=>function({zone:t,...n}){/* @__PURE__ */
|
|
3
3
|
return ae(Ue,{parentId:e,slot:t,...n})},[e])}var Je=["top","bottom","zIndex"];function _e(e,t,n){e.style[t]!==n&&(e.style[t]=n)}function et(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));_e(e,"position",t?"sticky":"relative");for(const n of Je)_e(e,n,t?.[n]??"");return!!t}var tt="data-es-canvas-relative";function nt(e){e.hasAttribute(tt)&&("relative"===e.style.position&&(e.style.position=""),e.removeAttribute(tt));const t=e.ownerDocument.defaultView?.getComputedStyle(e).position;return t&&"static"!==t?"sticky"===t:(e.style.position||(e.style.position="relative",e.setAttribute(tt,"")),!1)}function ot({node:e}){const t=je().config,n=t.components[e.type],o=e.props.id,r=ee(null),l=function(e,t){return ie(()=>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),nt(n))},[e,t])}(o,r),i=ee(null),s=!!n?.inline;!function(e,t){const n=ee(!1),o=ee(()=>{});o.current=()=>{const o=e(),l=n.current;n.current=!!o&&t(o),l!==n.current&&r.current()};const r=ee(()=>{});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?nt(e):et(e));const a=_(Qe),c=Xe(n,o,e.props,t.components),u=Ge(o);if(!n?.render)return null;const d=n.render,p={...X(n),...e.props,...c},f={renderDropZone:u,isEditing:!0,dragRef:n.inline?l:null,metadata:{...a,...n.metadata}};return n.inline?/* @__PURE__ */ae(d,{...p,editor:f,editMode:!0}):
|
|
4
4
|
/* @__PURE__ */ae("div",{ref:i,[Ve]:o,"data-easel-dnd":o,style:{position:"relative"},children:/* @__PURE__ */ae(d,{...p,editor:f,editMode:!0})})}function rt({metadata:e}){const t=ze(e=>e.config),n=ze(e=>e.appState.data.root).props??{},o=t.root?.render,r=Xe(t.root,P,n,t.components),l=Ge(P),i=/* @__PURE__ */ae(Ue,{parentId:P,slot:W}),s=o?/* @__PURE__ */ae(o,{id:"page-root",...n,...r,editor:{renderDropZone:l,isEditing:!0,dragRef:null,metadata:e??{}},editMode:!0,children:i}):i;/* @__PURE__ */
|
|
5
5
|
return ae(Qe.Provider,{value:e??Te,children:s})}var lt=G(void 0),it=G(void 0);function st(e,t,n,o){const r=$(e,t,n);return!!r&&(Z(r.node,t).length>0||!1===o.whole)}var at=G(void 0),ct="data-es-chrome",ut=G(void 0);function dt(e){const t=e?.closest?.(`[${ct}]`)??null,n=t?.getAttribute(ct);return t&&n?{id:n,element:t}:null}function pt({element:e,clip:t=!1}){const n=ee(null),o=mt(n,e?()=>e:null,e),r=_(St);/* @__PURE__ */
|
|
6
6
|
return ae("div",{ref:n,"aria-hidden":"true",className:"es-canvas-outline is-hover is-hover-part",style:o?{position:"absolute",top:o.top,left:o.left,width:o.width,height:o.height,clipPath:t?kt(o,r):void 0}:{display:"none"}})}var ft={"--es-words-clear":`${A}px`};function ht({element:e,words:t=!1,clip:n=!1}){const o=ee(null),r=mt(o,e?()=>e:null,e),l=_(St);/* @__PURE__ */
|
|
7
|
-
return ae("div",{ref:o,"aria-hidden":"true",className:"es-canvas-outline is-selected is-selected-part"+(t?" is-words":""),style:r?{position:"absolute",top:r.top,left:r.left,width:r.width,height:r.height,clipPath:n?kt(r,l):void 0,...ft}:{display:"none"}})}function mt(e,t,n){return yt(e,t?e=>{const n=t(e);return n?[n]:[]}:null,n)[0]??null}var gt=[];function yt(e,t,n){const[o,r]=ne(gt),l=ee(t);return l.current=t,Ze(()=>{const t=e.current?.ownerDocument,n=t?.defaultView;if(!t||!n||!l.current)return void r(gt);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=
|
|
7
|
+
return ae("div",{ref:o,"aria-hidden":"true",className:"es-canvas-outline is-selected is-selected-part"+(t?" is-words":""),style:r?{position:"absolute",top:r.top,left:r.left,width:r.width,height:r.height,clipPath:n?kt(r,l):void 0,...ft}:{display:"none"}})}function mt(e,t,n){return yt(e,t?e=>{const n=t(e);return n?[n]:[]}:null,n)[0]??null}var gt=[];function yt(e,t,n){const[o,r]=ne(gt),l=ee(t);return l.current=t,Ze(()=>{const t=e.current?.ownerDocument,n=t?.defaultView;if(!t||!n||!l.current)return void r(gt);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=D(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:gt;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}var vt=A+2,wt=vt+2,bt=1;function kt(e,t){const n=e.left+e.width,o=e.top+e.height,r=t.map(t=>{const r=t.left+t.width,l=t.top+t.height;if(!(r>e.left-vt&&t.left<n+vt&&l>e.top-vt&&t.top<o+vt))return null;const i=Math.max(t.left<=e.left&&r>e.left?Math.min(t.left,e.left-bt):t.left,e.left-wt)-e.left,s=Math.max(t.top<=e.top&&l>e.top?Math.min(t.top,e.top-bt):t.top,e.top-wt)-e.top,a=Math.min(r>=n&&t.left<n?Math.max(r,n+bt):r,n+wt)-e.left,c=Math.min(l>=o&&t.top<o?Math.max(l,o+bt):l,o+wt)-e.top;return a>i&&c>s?{x:i,y:s,w:a-i,h:c-s}:null}).filter(e=>null!==e);if(!r.length)return;const l=function(e){if(e.length<2)return e;const t=Array.from(new Set(e.flatMap(e=>[e.x,e.x+e.w]))).sort((e,t)=>e-t),n=Array.from(new Set(e.flatMap(e=>[e.y,e.y+e.h]))).sort((e,t)=>e-t),o=[];for(let r=0;r<n.length-1;r++){const l=o=>e.some(e=>e.x<=t[o]&&t[o+1]<=e.x+e.w&&e.y<=n[r]&&n[r+1]<=e.y+e.h);for(let e=0;e<t.length-1;e++){if(!l(e))continue;let i=e+1;for(;i<t.length-1&&l(i);)i++;const s={x:t[e],y:n[r],w:t[i]-t[e],h:n[r+1]-n[r]},a=o.find(e=>e.x===s.x&&e.w===s.w&&e.y+e.h===s.y);a?a.h+=s.h:o.push(s),e=i-1}}return o}(r);return`path(evenodd, "${`M${-wt} ${-wt}h${e.width+2*wt}v${e.height+2*wt}h${-(e.width+2*wt)}z`}${l.map(e=>`M${e.x} ${e.y}h${e.w}v${e.h}h${-e.w}z`).join("")}")`}var St=G([]);function xt({children:e}){const t=ee(null),n=_(ut),o=yt(t,n?e=>Array.from(e.querySelectorAll(`[${ct}]`)):null,n?1:0);/* @__PURE__ */
|
|
8
8
|
return ce("div",{className:"es-canvas-outlines",style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:[
|
|
9
9
|
/* @__PURE__ */ae("span",{ref:t,hidden:!0,"aria-hidden":"true"}),
|
|
10
10
|
/* @__PURE__ */ae(St.Provider,{value:o,children:e})]})}function Ct({id:e,kind:t,overlay:n}){const o=ee(null),r=_(it),l=null!==e&&!0===r?.(e),i=yt(o,e?t=>O(t,`[${Ve}="${t.defaultView?.CSS?.escape?t.defaultView.CSS.escape(e):e}"]`):null,e),[s,...a]=i,c=_(St),u=`es-canvas-outline is-${t}${l?" is-shared":""}`,d=e=>({position:"absolute",top:e.top,left:e.left,width:e.width,height:e.height,clipPath:kt(e,c)}),p=/* @__PURE__ */ce(ue,{children:[
|
|
11
|
-
/* @__PURE__ */ae("div",{ref:o,"aria-hidden":"true",className:u,style:s?d(s):{display:"none"}}),a.map((e,t)=>/* @__PURE__ */ae("div",{"aria-hidden":"true",className:u,style:d(e)},t))]});return n&&e?/* @__PURE__ */ae(n,{componentId:e,kind:t,children:p}):p}function
|
|
12
|
-
return ae(fe,{anchor:()=>{const e=t();if(!e)return null;const n=e.getBoundingClientRect(),o=e.ownerDocument.defaultView?.frameElement,r=o?
|
|
13
|
-
/* @__PURE__ */ae(me,{className:"es-copy-link es-copy-pop",value:
|
|
14
|
-
return ae("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,clipPath:kt(o,r),...ft}:{display:"none"}})}function
|
|
15
|
-
/* @__PURE__ */ae(qe.Provider,{value:
|
|
11
|
+
/* @__PURE__ */ae("div",{ref:o,"aria-hidden":"true",className:u,style:s?d(s):{display:"none"}}),a.map((e,t)=>/* @__PURE__ */ae("div",{"aria-hidden":"true",className:u,style:d(e)},t))]});return n&&e?/* @__PURE__ */ae(n,{componentId:e,kind:t,children:p}):p}function It(e,n){return Array.from(e.querySelectorAll(`[${Ve}]`)).find(o=>o.getAttribute(Ve)===n&&t(o)?.wrapper===e)??null}function Et(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 At(e,t){const n=t?.closest?.(`[${Ve}]`)?.getAttribute(Ve)??null;return!1===e.getPermissions(n?{item:e.getItemById(n)}:{root:!0}).edit}function Mt({s:e,element:t,toolbar:n,label:o,keys:r}){const l=w("copy",v),i=ze(e=>At(e,t())),s=e.pressed(),a=new Set(n.offered),c=n.colors&&n.colors.length>0?n.colors:null,m=ee(null),[g,y]=ne(!1),[b,k]=ne(null),S=g||null!==b,x=()=>{e.hold(),y(!1),k({href:e.pressed().href})},C=()=>{y(!1),k(null),e.resume()};se(()=>{r.current={escape:()=>!!S&&(C(),!0),link:()=>!!a.has("link")&&(x(),!0)}}),se(()=>()=>{r.current=null},[r]);const I=ee(C);I.current=C,J(()=>{if(g)return pe(e=>{const t=m.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&(I.current(),!0)},()=>m.current?.querySelector(".es-copy-colors"))},[g]),J(()=>{const n=m.current;if(!S||!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;y(!1),k(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)}},[S,e,t]),se(()=>{const e=m.current,n=e?.querySelector(".rosh-tb-wrap > .es-copy-pop"),o=t();if(!(S&&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?M(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},c=o.getBoundingClientRect(),f=s?M(s,{left:c.left,top:c.top,width:c.width,height:c.height}):{left:c.left,top:c.top,width:c.width,height:c.height},h=(e.closest("[data-floating-bar]")??e).getBoundingClientRect(),g={left:a.left,right:a.left+a.width,top:Math.min(a.top,f.top-6,h.top),bottom:Math.max(a.top+a.height,f.top+f.height+6,h.bottom)},y=e.ownerDocument.documentElement,v=(s??o.closest(".es-canvas")??o).getBoundingClientRect(),w={left:Math.max(0,v.left),top:Math.max(0,v.top),right:Math.min(y.clientWidth||v.right,v.right),bottom:Math.min(y.clientHeight||v.bottom,v.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:v.left,top:v.top,right:v.right,bottom:v.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 E=c?{run:f(s.color,c),open:g,onToggle:()=>{k(null),g?C():(e.hold(),y(!0))}}:void 0;/* @__PURE__ */
|
|
12
|
+
return ae(fe,{anchor:()=>{const e=t();if(!e)return null;const n=e.getBoundingClientRect(),o=e.ownerDocument.defaultView?.frameElement,r=o?M(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__ */ae("div",{ref:m,children:/* @__PURE__ */ae(he,{layout:"row",offered:a,pressed:s.marks,onMark:t=>{"link"===t?x():e.press(t)},color:E,linkOpen:null!==b,list:{pressed:s.list,onList:t=>e.list(t)},clear:s.clearable?{onClear:()=>e.clear()}:void 0,alignment:n.alignment,letterCase:n.letterCase,last:n.lastTool?.({className:"rosh-tb-btn",disabled:i,selected:s.selected,keepCaret:t=>{t.preventDefault(),e.hold()},insert:t=>e.insert(t),style:s.style,applyStyle:t=>e.textStyle(t)}),windows:/* @__PURE__ */ce(ue,{children:[g&&c?/* @__PURE__ */ae(h,{colors:c,current:s.color,words:l.colors??v.colors,onPick:t=>e.color(t)}):null,b?
|
|
13
|
+
/* @__PURE__ */ae(me,{className:"es-copy-link es-copy-pop",value:b.href??"",onApply:t=>{k(null),e.link(t)},onRemove:null!==b.href?()=>{k(null),e.link(null)}:void 0,onCancel:C}):null]})})})})}function Dt({element:e,which:t}){const n=ee(null),o=mt(n,()=>e(),t),r=_(St);/* @__PURE__ */
|
|
14
|
+
return ae("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,clipPath:kt(o,r),...ft}:{display:"none"}})}function Ot({frame:o=!0,className:r,style:l,metadata:i,mirrorStyles:u,onDocument:d,height:p,title:f,nonce:h,hotkeys:v,frameWrapper:S,overlay:C,children:I,typing:E,passThrough:A}){const M=je(),D=_(lt),O=A??D,P=_($e),j=w("canvas",n),z=v??P,[R,L]=ne(void 0),N=ze(e=>"node"===e.selection?.kind?e.selection.id:null),[B,V]=ne(null),[K,T]=ne(null),F=_(at),H=_(ut),[W,q]=ne(null),[,Q]=oe(e=>e+1,0),[,Y]=oe(e=>e+1,0),U=e=>{F?.select(e),Y()},[X,G]=ne(null),te=ee(null),re=ze(e=>!!X&&At(e,X()));J(()=>{re&&te.current?.s.stop("stop")},[re]);const le=ee(null),[,ie]=ne(0),se=ee(E);se.current=E;const ue=ee(null),de=ee(null),pe=()=>{if(!N)return null;const e=se.current?.atSelection?.()?.element()??null;if(!e)return null;const t=de.current?.ownerDocument;if(F){const n=F.selected()&&t?F.selectedPart?.(t)??null:null;return n&&x(n.element,e)?n.element:null}const n=$(M.getState().appState.data,M.config,N);return n&&0===Z(n.node,M.config).length?e:null},fe=ze(e=>e.appState.data),he=F?.selected()??null;J(()=>{const e=de.current?.ownerDocument,t=e?.defaultView?.CustomEvent;if(!e||!t)return;const n=N&&!X&&se.current?.atSelection?.()?N:null,o=n?pe():null;e.dispatchEvent(new t(b,{detail:o?{id:n,words:o}:{id:n}}))},[N,X,fe,he]);const me=e=>{const t=de.current?.ownerDocument,n=t?.defaultView?.CustomEvent;t&&n&&t.dispatchEvent(new n(k,{detail:{typing:e}}))},ge=(e,t)=>{te.current?.s.stop("stop");const n=e.element();if(!n)return!1;const o=e.element,r=()=>At(M.getState(),o());if(r())return!1;const l=ye(e,n),i=l?.write??e.write,s=M.group(),a=m({element:o,value:l?.value??e.value,rules:e.rules,multiline:e.multiline,skip:e.skip,caret:Et(n,t,e.skip),editable:()=>!r(),write:e=>{r()?queueMicrotask(()=>te.current?.s.stop("stop")):i(e)},remount:e.remount,onSelect:()=>ie(e=>e+1),onEscape:()=>ue.current?.escape()??!1,onLinkKey:()=>ue.current?.link()??!1,end:e=>{s.close(),te.current?.element===o&&(te.current=null),G(null),me(!1),se.current?.onChange?.({typing:!1,why:e})}});if(!a)return s.close(),!1;const c=n.closest?.(`[${Ve}]`)?.getAttribute(Ve);return c&&M.select(c),te.current={s:a,element:o,target:e},G(()=>o),V(null),me(!0),se.current?.onChange?.({typing:!0,element:n}),!0},ye=(e,n)=>{const o=e.key;if(!o||!se.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=se.current.copyValue?.({...s,nodeId:i,key:o}),c=g(n,e.skip).text,u=a??(y(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=se.current?.onCopyText;n&&!1!==n({...d,text:t})||e.write(t)}}};J(()=>()=>te.current?.s.stop("stop"),[]);const ve=e=>{const t=te.current?.element();return Boolean(t&&t.contains(e))},we=(e,t)=>st(M.getState().appState.data,M.config,e,t),be=e=>{const t=e.closest?.(`[${Ve}]`)?.getAttribute(Ve);if(!t)return;const n=M.getState(),o="node"===n.selection?.kind?n.selection.id:null,r=F?.partAt(e,t)??null;if(r){const e=a(n.appState.data,M.config,t,r.id,o,F?.selected()??null,O);if(e)return{node:e.node,part:e.part?r:null}}return{node:c(n.appState.data,M.config,t,o,O)??t,part:null}},ke=e=>{if("Enter"!==e.key||e.defaultPrevented||e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return;if(te.current)return;const t=e.target;if(t?.isContentEditable||t?.closest?.("input, textarea, select, button"))return;const n=Se(),o=void 0===n?se.current?.atSelection?.():n;o&&ge(o,null)&&e.preventDefault()},Se=()=>{const t=se.current,n=le.current;if(!t?.onCopyText||!n?.copy||n.node!==N)return;const o=de.current,r=o?e(o,n.copy):null,l=r?It(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},xe=(e,n)=>{if(!se.current?.onCopyText)return null;const o=t(e);return o&&It(o.wrapper,n)?o.copy:null},Ce=de.current?.ownerDocument??null,Ie=F?.selected()&&Ce&&N?F.selectedPart?.(Ce)??null:null,Ee=Ie&&N&&we(N,Ie)?Ie.element:null,Ae=H?.selected()??null,Me=Ae&&Ce?Array.from(Ce.querySelectorAll(`[${ct}]`)).find(e=>e.getAttribute(ct)===Ae)??null:null,Oe=X?null:pe(),Pe=/* @__PURE__ */ce("div",{ref:de,className:"es-canvas-content",style:{position:"relative"},onClick:e=>{const t=e.target;if(t.closest?.("a[href]")&&e.preventDefault(),te.current){if(ve(t))return;te.current.s.stop("outside")}const n=t.ownerDocument?.getSelection?.();n&&n.rangeCount>0&&n.isCollapsed&&n.removeAllRanges();const o=H?dt(t):null;if(H&&o)return H.select(o.id),q(null),void Q();const r=be(t);if(le.current=void 0!==r?{node:r.node,copy:xe(t,r.node)}:null,void 0!==r)return M.select(r.node),void(F&&(r.part?.id??null)!==F.selected()&&U(r.part?.id??null));t.hasAttribute?.(Ke)||(M.select(null),F?.selected()&&U(null))},onDoubleClick:e=>{const t=se.current;if(!t||ve(e.target))return;const n=t.at(e.target);n&&ge(n,{x:e.clientX,y:e.clientY})&&e.preventDefault()},onKeyDown:e=>ke(e),onMouseOver:e=>{if(te.current)return;const t=H?dt(e.target):null;if(t?.element!==W?.element&&q(t),t)return null!==B&&V(null),void(null!==K&&T(null));const n=be(e.target),o=!!n?.part&&we(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!==B&&V(l),r?.id===K?.id&&r?.element===K?.element||T(r)},onMouseLeave:()=>{V(null),T(null),q(null)},children:[
|
|
15
|
+
/* @__PURE__ */ae(qe.Provider,{value:B,children:/* @__PURE__ */ae(rt,{metadata:i})}),
|
|
16
16
|
/* @__PURE__ */ce(xt,{children:[
|
|
17
|
-
/* @__PURE__ */ae(Ct,{id:!X&&
|
|
18
|
-
/* @__PURE__ */ae(Ct,{id:X||Ee||
|
|
19
|
-
return ce("div",{className:"es-canvas"+(r?` ${r}`:""),style:l,"data-easel-preview":"","data-es-typing":X?"":void 0,children:[X&&te.current?.target.toolbar?/* @__PURE__ */ae(
|
|
17
|
+
/* @__PURE__ */ae(Ct,{id:!X&&B&&B!==N?B:null,kind:"hover",overlay:C}),F?/* @__PURE__ */ae(pt,{clip:!0,element:X||!K||K.id===F.selected()?null:K.element}):null,Oe||Ee?/* @__PURE__ */ae(ht,{clip:!0,element:X?null:Oe??Ee,words:null!==Oe}):null,H?/* @__PURE__ */ae(pt,{element:X||!W||W.element===Me?null:W.element}):null,Me?/* @__PURE__ */ae(ht,{element:X?null:Me}):null,
|
|
18
|
+
/* @__PURE__ */ae(Ct,{id:X||Ee||Oe||Me?null:N,kind:"selected",overlay:C}),X?/* @__PURE__ */ae(Dt,{element:()=>{const e=X?.()??null;return e?Ie&&x(Ie.element,e)?Ie.element:e:null},which:Ie?.element??X}):null]}),I]}),Re=S?/* @__PURE__ */ae(S,{document:R,children:Pe}):Pe;J(()=>{if(R&&z)return De(R,M)},[R,z,M]),J(()=>{if(!R)return;const e=e=>{if("Enter"===e.key)return void ke(e);if("Escape"!==e.key||e.defaultPrevented)return;const t=e.target;if(t?.isContentEditable||t?.closest?.("input, textarea, select"))return;const n=M.getState();if("node"!==n.selection?.kind)return;if(F?.selected())return void U(null);const o=s(n.appState.data,M.config,n.selection);"node"===o?.kind&&M.select(o.id)};return R.addEventListener("keydown",e),()=>R.removeEventListener("keydown",e)},[R,M,F]);/* @__PURE__ */
|
|
19
|
+
return ce("div",{className:"es-canvas"+(r?` ${r}`:""),style:l,"data-easel-preview":"","data-es-typing":X?"":void 0,children:[X&&te.current?.target.toolbar?/* @__PURE__ */ae(Mt,{s:te.current.s,element:te.current.element,toolbar:te.current.target.toolbar,label:j.textTools,keys:ue}):null,o?/* @__PURE__ */ae(We,{mirrorStyles:u,onDocument:e=>{L(e??void 0),d?.(e)},height:p,title:f,nonce:h,children:Re}):/* @__PURE__ */ae("div",{id:"preview-frame","data-easel-entry":"",children:Re})]})}function $t(e={}){const t=je(),n=ze(e=>e.appState.data);return i({...e,data:n,config:t.config,commit:(e,{select:n})=>t.run({data:e,select:n})})}var Pt=/* @__PURE__ */new WeakMap,jt=[];function zt(e){let t=Pt.get(e);return t||(t={nodes:/* @__PURE__ */new Map,shown:/* @__PURE__ */new Map,listeners:/* @__PURE__ */new Set,lateListeners:/* @__PURE__ */new Set,settled:[]},Pt.set(e,t)),t}function Rt(e,t){const n=e.nodes.get(t),o=n?[...n.running,...n.next]:jt;o.length?e.shown.set(t,o):e.shown.delete(t),e.listeners.forEach(e=>e())}function Lt(e,t,n,o){const r=zt(e),l=r.nodes.get(t);l?l.next=[...l.next,n]:r.nodes.set(t,{running:jt,next:[n]}),Rt(r,t),l||Promise.resolve().then(()=>Nt(r,t,o))}function Nt(e,t,n){const o=e.nodes.get(t);if(!o)return;if(!o.next.length)return e.nodes.delete(t),Rt(e,t),void(e.nodes.size||e.settled.splice(0).forEach(e=>e()));const r=o.next;o.running=r,o.next=jt;let l=!0;const i=()=>{l=!1,clearTimeout(a),o.running=jt,Rt(e,t)};let s=!1;const a=setTimeout(()=>{s=!0,i();try{n.landWithoutAnswer(r)&&(e.lateListeners.forEach(e=>e()),Promise.reject(new Error(`A write to ${t} landed without its resolver's answer after 60000 ms.`)))}catch(e){Promise.reject(e)}Nt(e,t,n)},6e4);n.run(r,{live:()=>l,landing:i}).catch(e=>{if(!s)throw e}).finally(()=>{s||(l&&i(),Nt(e,t,n))})}function Bt(e){const t=zt(e);return t.nodes.size?new Promise(e=>t.settled.push(e)):Promise.resolve()}function Vt(){const e=je(),t=ee([]),n=ee(!1),[o,r]=ne(!1),[,l]=oe(e=>e+1,0);J(()=>{t.current.splice(0).forEach(e=>e())});return{run:re(o=>{n.current||(n.current=!0,r(!0),Bt(e).then(()=>new Promise(e=>{t.current.push(e),l()})).then(()=>{n.current=!1,r(!1),o()}))},[e]),waiting:o}}function Kt(e){const t=Vt(),n=ee(e);return n.current=e,{...e,busy:!0===e.busy||t.waiting,onPress:()=>t.run(()=>n.current.onPress())}}function Tt(e,t){const{lateListeners:n}=zt(e);return n.add(t),()=>{n.delete(t)}}var Ft=e=>"object"==typeof e&&null!==e&&Object.getPrototypeOf(e)===Object.prototype;function Zt(e,t,n){if(t===e)return n;if(Array.isArray(e)&&Array.isArray(t)&&Array.isArray(n)){if(e.length!==n.length||e.some((e,t)=>n.includes(e)&&n[t]!==e))return t;const o=e.length===t.length&&1===t.filter((t,n)=>t!==e[n]).length;return t.map((t,r)=>{if(t===e[r])return n[r];const l=Ft(t)?e.indexOf(t):-1;return l>=0?n[l]:o?Zt(e[r],t,n[r]):t})}if(Ft(e)&&Ft(t)&&Ft(n)){const o={...n};for(const n of Object.keys(e))n in t||delete o[n];for(const r of Object.keys(t))o[r]=Zt(e[r],t[r],n[r]);return o}return t}function Ht(e,t){let n=null;for(const o of e){const e="function"==typeof o?o({...t,...n}):o;e&&(n={...n,...e})}return n}function Wt(e,t){if(!e.length)return t;try{return{...t,...Ht(e,t)}}catch{return t}}function qt(){return Gt(ze(e=>e.selectedItem))}function Qt(){const e=_(Yt);try{return function(e){const t=ze(e=>e.selectedItem);return Gt("root"===e?null:t)}(e)}catch{return null}}var Yt=G("selected");function Ut({children:e}){return le(Yt.Provider,{value:"root"},e)}function Xt(){return Gt(null)}function Gt(e){const t=je(),n=ze(e=>e.config),r=t.resolveCache,l=ze(e=>e.appState.data.root),i=e?e.props.id:"root",s=l.props??{},a=ie(()=>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=ze(t=>!1===t.getPermissions(e?{item:e}:{root:!0}).edit),g=re(e=>{Lt(t,i,e,{landWithoutAnswer:e=>{const n=t.getState();if("root"===i){const o=n.appState.data.root.props??{},r=Ht(e,o);return!!r&&(t.dispatch({type:"replaceRoot",root:{props:{...o,...r},readOnly:n.appState.data.root.readOnly},recordHistory:!0}),!0)}const o=n.getItemById(i),r=n.getSelectorForId(i);if(!o||!r)return!1;const l=Ht(e,o.props);return!!l&&(t.dispatch({type:"replace",destinationZone:r.zone??"root:default-zone",destinationIndex:r.index,data:{...o,props:{...o.props,...l}}}),!0)},run:async(e,{live:n,landing:o})=>{for(let l=1;;l+=1){const s=t.getState(),a={...r,lastChange:Object.create(r.lastChange)},c=()=>{o(),Object.assign(r.lastChange,a.lastChange)};if("root"!==i){const o=s.getItemById(i);if(!o)return;const r=Ht(e,o.props);if(!r)return;const u={...o,props:{...o.props,...r}},{node:d}=await q(u,t.config,{cache:a,trigger:"replace"});if(!n())return;const p=t.getState(),f=p.getSelectorForId(i);if(!f)return;if(p.getItemById(i)!==o&&l<5)continue;return c(),void t.dispatch({type:"replace",destinationZone:f.zone??"root:default-zone",destinationIndex:f.index,data:d})}const u=s.appState.data.root.props??{},d=Ht(e,u);if(!d)return;const{node:p}=await q({type:"root",props:{...u,...d}},t.config,{cache:a,trigger:"replace"});if(!n())return;if(!(t.getState().appState.data.root.props!==s.appState.data.root.props&&l<5))return c(),void t.dispatch({type:"replaceRoot",root:{props:p.props,readOnly:p.readOnly},recordHistory:!0})}}})},[t,r,i]),y=re(e=>{const{listeners:n}=zt(t);return n.add(e),()=>{n.delete(e)}},[t]),v=re(()=>zt(t).shown.get(i)??jt,[t,i]),w=te(y,v,v),b=ie(()=>Wt(w,a.props),[w,a.props]),k=ee({id:i,values:b});k.current={id:i,values:b};const S=re((e,n)=>{const o=t.getState(),r=("root"===i?o.appState.data.root.props:o.getItemById(i)?.props)??{},l=Wt(zt(t).shown.get(i)??jt,r),s=k.current,a=(s.id===i?s.values:l)[e];H(n,a)&&!H(l[e],a)?g({[e]:n}):g(t=>({[e]:Zt(a,n,t[e])}))},[t,i,g]);return{id:i,node:a,fields:h,values:b,readOnly:m,onChange:S,onChangeMany:g}}export{ct as CHROME_ATTR,ut as CanvasChromeContext,We as CanvasFrame,at as CanvasPartsContext,lt as CanvasPassThroughContext,it as CanvasSharedContext,Ie as DEFAULT_UI,Ot as EaselCanvas,Pe as EaselProvider,rt as EditDocument,Ut as RootHostScope,De as bindUndoKeys,Me as createEasel,Re as createUseEasel,st as partHasOwnBox,ge as recordsByDefault,Se as reduce,Tt as subscribeLateWrites,we as uiView,ze as useEasel,je as useEaselApi,$t as useEaselNodeOps,Xt as useRootFields,qt as useSelectedFields,Qt as useSelectedHost,Kt as useSettledAction,Vt as useSettledPress,be as validSelection,Bt as writesSettled};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{resolveViewValue as n,FOLLOW_RULES as e}from"./chunk-DIOTWSCO.js";var i=["none","upper","capitalize","lower"],t={none:"none",upper:"uppercase",capitalize:"capitalize",lower:"lowercase"};function a(n){return i.includes(n)}function r(n){return a(n)?t[n]:void 0}function o(n){return i.find(e=>t[e]===n)}var s=["size","lineSpacing","letterSpacing","paragraphSpacing","largestSize"];function d(n,e){return`${n}${"tablet"===e?"Tablet":"Phone"}`}function l(i,t){if("desktop"===t)return i;let a=i;for(const r of s){const o=n("same",i[r],i[d(r,"tablet")],i[d(r,"phone")],e),s="phone"===t?o.phone:o.tablet;null!=s&&s!==i[r]&&(a={...a,[r]:s})}return a}var u=["font","color","size","weight","emphasis","lineSpacing","letterSpacing","paragraphSpacing","letterCase","largestSize"],c=["font","color","size","weight","lineSpacing","letterSpacing","paragraphSpacing","letterCase"],p=["heading","body"],f=7,h={heading:3,body:5},m={min:5,max:void 0,sliderMin:12,sliderMax:72,step:1,shiftStep:10,unit:"px"},g={size:m,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:m},x=(n,e)=>`${"heading"===n?"Heading":"Body"} ${e}`;function S(n=({kind:n,n:e})=>x(n,e)){return p.flatMap(e=>Array.from({length:h[e]},(i,t)=>({id:`${e}-${t+1}`,kind:e,name:n({kind:e,n:t+1}),values:{}})))}function k(n,e,i=f){return n.filter(n=>n.kind===e).length<i}function v(n,e){const i=new RegExp(`^${e}-([1-9]\\d*)$`).exec(n);return i?Number(i[1]):void 0}function M(n){const e=v(n.id,n.kind);return void 0!==e&&e<=h[n.kind]}function z(n,e,i={}){const{max:t=f,name:a=({kind:n,n:e})=>x(n,e),make:r}=i;if(!k(n,e,t))return null;const o=n.filter(n=>n.kind===e);let s=o.length+1;const d=new Set(n.map(n=>n.name));for(;d.has(a({kind:e,n:s}));)s+=1;const l=new Set(n.map(n=>n.id));let u=Math.max(s,...o.map(n=>(v(n.id,e)??0)+1));for(;l.has(`${e}-${u}`);)u+=1;const c=o.at(-1),p=r?r(e,s):{id:`${e}-${u}`,kind:e,name:a({kind:e,n:s}),values:{...c?.values??{}}},h=c?n.indexOf(c)+1:"heading"===e?0:n.length;return{styles:[...n.slice(0,h),p,...n.slice(h)],added:p}}function w(n,e,i={}){const{name:t=({kind:n,n:e})=>x(n,e)}=i,a=n.find(n=>n.id===e);if(!a||M(a))return null;const r=n.filter(n=>n.kind===a.kind),o=r.indexOf(a),s=/* @__PURE__ */new Map;return r.forEach((n,e)=>{e>o&&n.name===t({kind:n.kind,n:e+1})&&s.set(n,t({kind:n.kind,n:e}))}),{styles:n.filter(n=>n!==a).map(n=>s.has(n)?{...n,name:s.get(n)}:n),removed:a}}function b(n,e){const i=n.find(n=>n.id===e);if(i)return i;for(const i of p){const t=v(e,i);if(void 0===t)continue;let a;for(const e of n){const n=e.kind===i?v(e.id,i):void 0;void 0!==n&&n<t&&(!a||n>a.n)&&(a={n:n,style:e})}return a?.style}}function $(n,e,i){return n.map(n=>{if(n.id!==e)return n;const t={...n.values};for(const[n,e]of Object.entries(i))void 0===e?delete t[n]:t[n]=e;return{...n,values:t}})}function y(n){return Math.min(20,Math.max(12,Math.round(.5*n+6)))}function O(n,e){const i=e.weights;return[i.thin,i.extraLight,i.light,i.regular,i.medium,i.semibold,i.bold,i.extraBold,i.black][Math.min(8,Math.max(0,Math.round(n/100)-1))]}function C(n,e,i,t={}){const a=e.find(e=>e.value===n.font)?.label??n.font??"",r=void 0===n.size?t.autoSize?i.auto:"":i.px({n:n.size});return i.summary({font:a,size:r,weight:O(n.weight??400,i)})}export{c as CAMPAIGN_TEXT_STYLE_SETTINGS,i as TEXT_STYLE_CASES,t as TEXT_STYLE_CASE_CSS,h as TEXT_STYLE_DEFAULT_COUNT,p as TEXT_STYLE_KINDS,f as TEXT_STYLE_MAX,g as TEXT_STYLE_RANGES,u as TEXT_STYLE_SETTINGS,s as TEXT_STYLE_VIEW_NUMBERS,z as addTextStyle,k as canAddTextStyle,S as defaultTextStyles,C as describeTextStyle,M as isDefaultTextStyle,a as isTextStyleCase,w as removeTextStyle,b as resolveTextStyle,r as textStyleCaseCss,o as textStyleCaseOfCss,y as textStyleRowSize,d as textStyleViewKey,l as textStyleViewValues,$ as updateTextStyle,O as weightWord};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{blockRuns as e,offeredChoices as s}from"./chunk-RUQOIQWI.js";import{useScreenBlockLook as t}from"./chunk-
|
|
1
|
+
import{blockRuns as e,offeredChoices as s}from"./chunk-RUQOIQWI.js";import{useScreenBlockLook as t}from"./chunk-2262JGFV.js";import{DEFAULT_SCREEN_WORDS as l}from"./chunk-G2VZ4DET.js";import{useWords as r}from"./chunk-MFIRYGHW.js";import{ItemCount as n,DropdownMenu as c}from"efficient-shell/ui";import{jsxs as a,jsx as o,Fragment as i}from"react/jsx-runtime";function m({choices:m,onPick:p}){const{Icon:u}=t(),f=r("screen",l),h=e(s(m)).flatMap(e=>[...e.group?[{type:"label",key:`group:${e.group}`,label:/* @__PURE__ */a("span",{className:"flex w-full items-center gap-2",children:[
|
|
2
2
|
/* @__PURE__ */o("span",{children:e.group}),
|
|
3
3
|
/* @__PURE__ */o(n,{count:e.items.length,label:f.blockCount({count:e.items.length}),className:"ml-auto"})]})}]:[],...e.items.map(e=>({key:e.type,label:e.label,icon:/* @__PURE__ */o("span",{className:"sf-chip",children:/* @__PURE__ */o(u,{type:e.type,size:13})}),onSelect:()=>p(e.type)}))]);/* @__PURE__ */
|
|
4
4
|
return o(c,{align:"start",triggerClassName:"sf-add-card",items:h,trigger:/* @__PURE__ */a(i,{children:[
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useSectionOps as o}from"./chunk-
|
|
1
|
+
import{useSectionOps as o}from"./chunk-TYTMUHUK.js";import{SELECTION_MODE as e}from"./chunk-2262JGFV.js";import{decodePartId as r,encodePartId as t}from"./chunk-R4AUZVA3.js";import{useEasel as n}from"./chunk-3W2O22DZ.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};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import{sidesStartEach as e,SidesInput as n,SidesEachToggle as t}from"./chunk-XWTQTANN.js";import{SettingsDefaultReset as l}from"./chunk-2T22IY3J.js";import{deviceField as o}from"./chunk-ZNLODQD4.js";import{noControlField as a,NoControlMark as i}from"./chunk-22I55W37.js";import{describedAs as r}from"./chunk-LX23TCTP.js";import{withStyleKind as s}from"./chunk-CWELHADJ.js";import{foldMetaOf as u,FOLD_FIELD_MARKER as c}from"./chunk-ANPOR6EY.js";import{useSelectedHost as d,useEasel as p}from"./chunk-3W2O22DZ.js";import{DEFAULT_PANEL_WORDS as f}from"./chunk-56ID6FKZ.js";import{SettingsSwitch as b}from"./chunk-OECWLNKJ.js";import{phoneKey as m,tabletKey as h,viewFollows as v,isAuto as g}from"./chunk-DIOTWSCO.js";import{FieldSelect as y}from"./chunk-KFWNGPW3.js";import{SettingsSegmented as w}from"./chunk-DX3VILZ3.js";import{SettingsField as k}from"./chunk-MIX7EGRG.js";import{useWords as x}from"./chunk-MFIRYGHW.js";import{useState as C}from"react";import{AlignmentIcon as j,BoxJustifyIcon as F,WrapIcon as O,ArrowRightIcon as L,GapIcon as K,WidthIcon as S,PlacementIcon as P,NudgeIcon as V,DesktopIcon as E,BoxXEndIcon as A,BoxXCenterIcon as R,BoxXStartIcon as W,PaddingAllIcon as I,BoxYBetweenIcon as M,BoxYStretchIcon as N,BoxYEndIcon as T,BoxYCenterIcon as B,BoxYStartIcon as $,BoxXBetweenIcon as D,BoxXStretchIcon as G,BoxItemAlignmentIcon as J}from"efficient-shell/icons/efficient";import{textAlignOptions as H,AlignmentGrid as X,PositionInput as _,Slider as z}from"efficient-shell/ui";import{jsx as Y,Fragment as Z,jsxs as Q}from"react/jsx-runtime";var U=e=>e;function q(e,n,t="desktop"){return e("tablet"===t?"{value} on tablet":"{value} on desktop").replace("{value}",n)}var ee=()=>{};function ne(){return null}function te(e){if(!e.trim())throw new Error("noGlyph() needs a reason naming the ruling that decided it.");/* @__PURE__ */
|
|
2
|
+
return Y(ne,{},e)}function le(e){return e.type===ne}function oe(e){return le(e)?void 0:e}function ae(e){for(const[n,t]of Object.entries(e))t&&"object"==typeof t&&!u(t)&&s(t,`section:${n}`);return e}function ie(e,n){return{type:"custom",[c]:{label:e,level:n},marker:!0,fold:e,render:()=>/* @__PURE__ */Y(Z,{})}}function re(e){return ie(e,2)}function se(e){return ie(e,1)}var ue=[{label:"Start",value:"start"},{label:"Center",value:"center"},{label:"Space between",value:"between"},{label:"End",value:"end"}],ce=[{label:"Start",value:"start"},{label:"Center",value:"center"},{label:"End",value:"end"},{label:"Stretch",value:"stretch"}],de="Wrap",pe=[{label:"Wrap",value:"wrap"},{label:"No wrap",value:"nowrap"}],fe="Direction",be=[{label:"Stacked",value:"column"},{label:"One row",value:"row"}],me={min:-32,max:64,step:2,builtIn:0},he={min:30,max:100,step:5,fallback:60},ve=["top-left","top-center","top-right","left","center","right","bottom-left","bottom-center","bottom-right"],ge="bottom-left",ye={"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"},we=ve.map(e=>({value:e,label:ye[e]}));function ke(e,n=ge){return ve.includes(e)?e:n}var xe=40,Ce=e=>"number"==typeof e?e:null;function je(e,n,t){const l={};for(const o of["x","y"])t[o]!==n[o]&&(l[e[o]]=t[o]??void 0);return l}var Fe=["top","right","bottom","left"],Oe={top:"sectionPaddingTop",right:"sectionPaddingRight",bottom:"sectionPaddingBottom",left:"sectionPaddingLeft"},Le=e=>"number"==typeof e?e:null;function Ke(e,n,t){const l={};for(const o of Fe)t[o]!==n[o]&&(l[e[o]]=t[o]??void 0);return l}function Se(e){if("number"==typeof e)return{top:e,right:e,bottom:e,left:e};const n=e&&"object"==typeof e?e:{};return Object.fromEntries(Fe.map(e=>[e,Le(n[e])]))}function Pe(e){const n={};for(const t of Fe)"number"==typeof e[t]&&(n[t]=e[t]);return Object.keys(n).length?n:void 0}function Ve(e,n={}){const t=n=>{const t=n[e];return t&&"object"==typeof t?t:{}},l=e=>Object.hasOwn(n,e)?n[e]:e;return{read:(e,n)=>t(e)[l(n)],write:(n,o,a)=>{const i={...t(n)};return void 0===a?delete i[l(o)]:i[l(o)]=a,{[e]:Object.keys(i).length?i:void 0}}}}function Ee(e,n,t){const l=Ae(e),o=d();if(t)return[t.value,t.onChange];const a=o?.values??{};return[e.read(a,n),e=>l([[n,e]])]}function Ae(e){const n=d();return t=>{n&&n.onChangeMany(n=>{let l={};for(const[o,a]of t)l={...l,...e.write({...n,...l},o,a)};return l})}}var Re={read:(e,n)=>e[n],write:(e,n,t)=>({[n]:t})},We={fieldKey:m,ownField:!0,read:(e,n)=>e[m(n)],write:(e,n,t)=>({[m(n)]:t})},Ie={fieldKey:h,ownField:!0,read:(e,n)=>e[h(n)],write:(e,n,t)=>({[h(n)]:t})},Me={...We,tablet:Ie};function Ne(e){return{...Ve(e),fieldKey:n=>`_${e}_${n}`}}function Te({row:e,desktopKey:n,access:t,wider:l,props:o}){const a=d(),i=a?.values??{},r=l?.read(i,n),s=v(i[n],r),u=g(r)?"desktop":"tablet",[c,p]=Ee(t,n);return t.ownField?e.render({...o,follows:s,followsView:u,twinAccess:t,widerAccess:l}):e.render({...o,value:c,storedValue:c,follows:s,followsView:u,twinAccess:t,widerAccess:l,onChange:p})}function Be(e,n,t=We,l={}){const a=l.phoneRow??n,i=(n,t)=>({...a,render:l=>/* @__PURE__ */Y(Te,{row:a,desktopKey:e,access:n,wider:t,props:l})}),r=t.tablet;return{[e]:o("desktop",n),...r?{[r.fieldKey(e)]:o("tablet",i(r))}:{},[t.fieldKey(e)]:o("mobile",i(t,r))}}var $e=["left","center","right"];function De(e,{options:n,value:t,onChange:l,ariaLabel:o,disabled:a=!1}){/* @__PURE__ */
|
|
3
|
+
return Y(w,{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:l,ariaLabel:e(o),disabled:a})}function Ge(e,{label:n,value:t,onChange:l,points:o}){const a=o.find(e=>e.disabled),i=o.map(n=>({...n,label:e(n.label),...n.title?{title:e(n.title)}:null}));/* @__PURE__ */
|
|
4
|
+
return Y(k,{label:e(n),icon:/* @__PURE__ */Y(P,{}),hint:a?.title?e(a.title):void 0,children:/* @__PURE__ */Y(X,{label:e(n),value:t,points:i,onChange:l})})}function Je({say:e,label:n,value:t,onChange:l,pointsFor:o}){const{appState:a,selectedItem:i}=p(e=>e),r=i?.props?.id?String(i.props.id):void 0;return Ge(e,{label:n,value:t,onChange:l,points:o(a?.data,r)})}function He({say:e,o:n}){const t=d(),o=x("panel",f),a=t?.values??{},i={x:Ce(a[n.keys.x]),y:Ce(a[n.keys.y])},r=e(n.label??"Position"),s=Boolean(i.x||i.y),u=e=>{const l=je(n.keys,i,e);Object.keys(l).length&&t?.onChangeMany(l)},c=/* @__PURE__ */Y(_,{label:r,value:i,onChange:u,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}),p=/* @__PURE__ */Y(l,{words:o,label:r,changed:s,detail:"0 px, 0 px",onReset:()=>u({x:null,y:null})});return null===n.label?/* @__PURE__ */Q("div",{className:"sf-position-line",children:[c,p]}):/* @__PURE__ */Y(k,{label:r,icon:/* @__PURE__ */Y(V,{}),changed:s,action:p,children:c})}var Xe={x:{start:/* @__PURE__ */Y(W,{}),center:/* @__PURE__ */Y(R,{}),end:/* @__PURE__ */Y(A,{}),stretch:/* @__PURE__ */Y(G,{}),between:/* @__PURE__ */Y(D,{})},y:{start:/* @__PURE__ */Y($,{}),center:/* @__PURE__ */Y(B,{}),end:/* @__PURE__ */Y(T,{}),stretch:/* @__PURE__ */Y(N,{}),between:/* @__PURE__ */Y(M,{})}},_e=e=>"row"===e?"row":"column";function ze({say:e,kind:n,label:t,options:l,value:o,onChange:a,o:i}){const r=d(),s="justify"===n==("row"===(i.runs??_e)(r?.values?.[i.directionKey??"direction"]))?"x":"y";return De(e,{options:l.map(e=>({label:e.label,value:e.value,picture:Xe[s][e.value]})),value:o,onChange:a,ariaLabel:t})}function Ye(e,n){const t=(e.useFallback??ee)(n);return Object.fromEntries(Fe.map(n=>[n,t?.[n]??e.fallback[n]]))}function Ze({say:e,tier:n,o:t,props:l}){const o=Ye(t,l),a=d(),i=a?.values??{},r="mobile"===n?t.phoneKeys:"tablet"===n?t.tabletKeys:t.keys,s=Object.fromEntries(Fe.map(e=>[e,Le(i[r[e]])])),u="desktop"===n?null:Object.fromEntries(Fe.map(e=>[e,v(Le(i[t.keys[e]]),"mobile"===n?Le(i[t.tabletKeys[e]]):null)]));/* @__PURE__ */
|
|
5
|
+
return Y(Ue,{say:e,o:t,fallback:o,value:s,follows:u,followsView:"mobile"===n&&Fe.some(e=>null!==Le(i[t.tabletKeys[e]]))?"tablet":"desktop",readOnly:l.readOnly,onChange:e=>{const n=Ke(r,s,e);Object.keys(n).length&&a?.onChangeMany(n)}})}function Qe({say:e,o:n,props:t}){const l=Ye(n,t);/* @__PURE__ */
|
|
6
|
+
return Y(Ue,{say:e,o:n,fallback:l,value:Se(t.value),follows:"follows"in t?Se(t.follows):null,followsView:t.followsView,readOnly:t.readOnly,onChange:e=>t.onChange(Pe(e))})}function Ue({say:o,o:a,fallback:i,value:r,follows:s,followsView:u,readOnly:c,onChange:d}){const p=Object.fromEntries(Fe.map(e=>[e,String(s?.[e]??i[e])])),[b,m]=C(()=>e(r,p)),h=x("panel",f),v=Fe.map(e=>p[e]),g=`${1===new Set(v).size?v[0]:v.join(" / ")}px`;/* @__PURE__ */
|
|
7
|
+
return Y(k,{label:o(a.label),icon:a.icon??/* @__PURE__ */Y(I,{}),action:/* @__PURE__ */Q(Z,{children:[
|
|
8
|
+
/* @__PURE__ */Y(t,{each:b,label:o("Each side"),onChange:m,disabled:c}),
|
|
9
|
+
/* @__PURE__ */Y(l,{words:h,label:o(a.label),changed:Fe.some(e=>"number"==typeof r[e]),detail:s?q(o,g,u):g,disabled:c,onReset:()=>d({top:null,right:null,bottom:null,left:null})})]}),children:/* @__PURE__ */Y(n,{label:o(a.label),each:b,value:r,placeholder:p,min:a.min,max:a.max,step:a.step,readOnly:c,onChange:d,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"}})})}var qe=e=>""===e||"px"===e?e:` ${e}`;function en({label:e,value:n,onChange:t,min:o,max:a,step:i=1,unit:r="",hint:s,emptyLabel:u,inputMax:c,readOnly:d=!1,clears:p,detail:f,resetWords:b}){const m="number"==typeof n,h=p?/* @__PURE__ */Y(l,{label:e,changed:m,detail:f??u??(void 0===s?void 0:`${s}${qe(r)}`),disabled:d,onReset:()=>t(void 0),...b?{words:b}:{}}):void 0;return{track:/* @__PURE__ */Y("div",{className:"sf-slider",children:/* @__PURE__ */Y(z,{min:o,max:a,step:i,value:n,suffix:r||void 0,showInput:!0,label:e,disabled:d,...p&&void 0!==s?{placeholderValue:s}:{},...u?{emptyLabel:u}:{},...void 0!==c?{inputMax:c}:{},size:"sm",boxSize:"md",className:"sf-slider-track",onChange:e=>{null===e?p&&m&&t(void 0):e!==n&&t(e)}})}),reset:h}}function nn({caption:e,label:n,value:t,hint:l,emptyLabel:o,...a}){const i=void 0!==l||void 0!==o,r="number"==typeof t,{track:s,reset:u}=en({...a,label:n,value:r?t:i?null:a.min,hint:l,emptyLabel:o,clears:i});/* @__PURE__ */
|
|
10
|
+
return Y(k,{label:e??n,action:u,children:s})}function tn({draw:e,props:n,useMax:t,useHint:l}){return e(n,{max:(t??ee)(n),hint:(l??ee)(n)})}function ln(e=U){function n(n,t,l,o,a,i,s="",u){const c="function"==typeof u?{action:u}:u??{},{action:d,clear:p}=c,f=(r,u)=>{const f="storedValue"in r?r.storedValue:r.value,b="follows"in r,m=b&&!1!==p?.phoneFollows,h=b||void 0!==p,v="number"==typeof r.value,g=void 0===p?i:u.hint??("function"==typeof p.hint?p.hint(r):p.hint)??i,y=m&&"number"==typeof r.follows?r.follows:g,w=qe(s),x=!p?.emptyLabel||m&&"number"==typeof r.follows?void 0:p.emptyLabel,C=x??`${y}${w}`,j="function"==typeof c.hint?c.hint(r):c.hint,{track:F,reset:O}=en({label:e(n),value:v?r.value:h?null:i,onChange:e=>r.onChange(e),min:l,max:u.max??o,step:a,unit:s,hint:h?y:void 0,emptyLabel:x,inputMax:c.inputMax,readOnly:!0===r.readOnly,clears:h,detail:m?q(e,C,r.followsView):C});/* @__PURE__ */
|
|
11
|
+
return Y(k,{label:e(n),icon:oe(t),hint:void 0===j?void 0:e(j),action:h?O:d?d(f,r.onChange):void 0,children:F})},b=c.useMax,m=p?.useHint;return{type:"custom",...r({},{type:"number",label:n}),render:b||m?e=>/* @__PURE__ */Y(tn,{draw:f,props:e,useMax:b,useHint:m}):e=>f(e,{})}}function t(n){return De(e,n)}function s(n,o,a,i,s={}){const u=a.map(e=>"string"==typeof e?{label:e,value:e}:e);return{type:"custom",...r({},{type:"radio",label:n,options:u.map(e=>({value:e.value,label:e.label}))}),render:a=>{const{value:r,onChange:c,field:d}=a,p=u.some(e=>e.value===r),f=!0===a.readOnly;if("follows"in a&&!u.some(e=>""===e.value)){const d=s.phoneRest?s.phoneRest(a.follows):a.follows,b=u.find(e=>e.value===d)??u.find(e=>e.value===i);/* @__PURE__ */
|
|
12
|
+
return Y(k,{label:e(n),icon:oe(o),action:/* @__PURE__ */Y(l,{label:e(n),changed:p,detail:q(e,e(b?.label??""),a.followsView),disabled:f,onReset:()=>c(void 0)}),children:t({options:u,value:p?r:b?.value??i,onChange:c,ariaLabel:n,disabled:f})})}const b="follows"in a&&s.followsLabel?s.followsLabel(a.follows):void 0;/* @__PURE__ */
|
|
13
|
+
return Y(k,{label:e(n),icon:oe(o),action:"follows"in a&&s.followsLabel?/* @__PURE__ */Y(l,{label:e(n),changed:null!=r&&""!==r,detail:void 0===b?void 0:q(e,e(b),a.followsView),disabled:f,onReset:()=>c(void 0)}):void 0,children:t({options:u,value:p?r:r||d?.currentValue||i,onChange:c,ariaLabel:n,disabled:f})})}}}function u(e,n){return n.phone?e.unshift({label:"Match desktop",value:"",picture:/* @__PURE__ */Y(E,{})}):n.inherit&&e.unshift({label:n.inherit,value:""}),e}function c(e,n){return n.inherit||n.phone?{...e,render:n=>e.render({...n,onChange:e=>n.onChange(""===e?void 0:e)})}:e}function d(e,n,t,l){if(l.access){const o=l.inherit?"":l.fallback??"left",a=t({...l,phone:!1}),i=e=>{const n="string"==typeof e&&""!==e&&a.some(n=>n.value===e)?e:o;return a.find(e=>e.value===n)?.label};return Be(e,n(l,o),l.access,{phoneRow:n({...l,phone:!0},"",i)})}return{[e]:o("desktop",n(l)),[m(e)]:o("mobile",n({...l,phone:!0},""))}}function p(e){return u(H(e.allow??$e).map(e=>({label:e.label,value:e.value,picture:e.icon})),e)}function f(e,n=e.fallback??"left",t){return c(s(e.label??"Text alignment",/* @__PURE__ */Y(j,{}),p(e),n,t?{followsLabel:t}:{}),e)}function v(e){const n={left:Xe.x.start,center:Xe.x.center,right:Xe.x.end};return u(H((e.allow??$e).filter(e=>e in n)).map(e=>({label:e.label,value:e.value,picture:n[e.value]})),e)}function g(e,n=e.fallback??"left",t){return c(s(e.label??"Block alignment",/* @__PURE__ */Y(F,{}),v(e),n,t?{followsLabel:t}:{}),e)}function w(n,t,l,o,a,i){return{type:"custom",options:o,fallback:a,...r({},{type:"radio",label:t,options:o.map(e=>({value:e.value,label:e.label}))}),render:({value:r,onChange:s,field:u})=>{const c=u.options??o,d=u.fallback??a,p=c.some(e=>e.value===r)?r:d;/* @__PURE__ */
|
|
14
|
+
return Y(k,{label:e(t),icon:oe(l),children:/* @__PURE__ */Y(ze,{say:e,kind:n,label:t,options:c,value:p,onChange:s,o:i})})}}}function x(e={}){return w("justify","Justify",/* @__PURE__ */Y(F,{}),ue,ue[0].value,e)}function C(e={}){return w("align","Item alignment",/* @__PURE__ */Y(J,{}),ce,"stretch",e)}function P(){const n=de;return{type:"custom",options:pe,fallback:pe[1].value,...r({},{type:"radio",label:n,options:pe.map(e=>({value:e.value,label:e.label}))}),render:({value:t,onChange:l,id:o,name:a})=>{const i=`${o??a??n}-label`;/* @__PURE__ */
|
|
15
|
+
return Y(k,{label:e(n),labelId:i,icon:/* @__PURE__ */Y(O,{}),action:/* @__PURE__ */Y(b,{checked:(r=t,!0===r||"wrap"===r),onChange:e=>l(e?pe[0].value:pe[1].value),ariaLabelledBy:i})});var r}}}function V({offered:e,fallback:n,resolve:t}){const l=t??(t=>e.some(e=>e.value===t)?t:n),o=s(fe,
|
|
16
|
+
/* @__PURE__ */Y(L,{}),e.map(e=>({label:e.label,value:e.value})),l(void 0));return{type:"custom",render:e=>o.render({...e,value:l(e.value),onChange:n=>e.onChange(n)})}}function A({min:e,max:t,step:l,builtIn:o,resolve:a,action:i,mark:r}){const s=n("Gap",/* @__PURE__ */Y(K,{}),e,t,l,o,"px",i),u=a??(e=>"number"==typeof e?e:o);return{...r,type:"custom",render:e=>s.render({...e,value:u(e.value,e.field),storedValue:e.value,onChange:n=>e.onChange(n)})}}function R(n,{fallback:t=ge,pointsFor:l}={}){return{type:"custom",render:({value:o,onChange:a})=>{const i=ke(o,t);return l?/* @__PURE__ */Y(Je,{say:e,label:n,value:i,onChange:a,pointsFor:l}):Ge(e,{label:n,value:i,onChange:a,points:we})}}}function W(n){return{[n.keys.x]:{type:"custom",render:()=>/* @__PURE__ */Y(He,{say:e,o:n})},[n.keys.y]:{...a({type:"custom",render:()=>/* @__PURE__ */Y(i,{})},"always"),reachedBy:n.keys.x}}}function I(n={}){const t={...Oe,...n.keys},l={keys:t,tabletKeys:Object.fromEntries(Fe.map(e=>[e,h(t[e])])),phoneKeys:Object.fromEntries(Fe.map(e=>[e,m(t[e])])),fallback:{top:0,right:0,bottom:0,left:0,...n.fallback},useFallback:n.useFallback,label:n.label??"Padding",icon:n.icon,min:n.min??0,max:n.max??200,step:n.step??4},r=!1!==n.phone,s=!1===n.group?{}:{_gSpacing:re("Padding")};if(n.object){const t={type:"custom",render:n=>/* @__PURE__ */Y(Qe,{say:e,o:l,props:n})};return ae({...s,...r?Be(n.object.key,t,n.object.phone):{[n.object.key]:t}})}const u=r&&!0===n.tablet,c=n=>{const t={type:"custom",render:t=>/* @__PURE__ */Y(Ze,{say:e,tier:n,o:l,props:t})};return r?o(n,t):t},d=()=>a({type:"custom",render:()=>/* @__PURE__ */Y(i,{})},"always"),p=Fe.filter(e=>"top"!==e);return ae({...s,[l.keys.top]:c("desktop"),...u?{[l.tabletKeys.top]:c("tablet")}:{},...r?{[l.phoneKeys.top]:c("mobile")}:{},...Object.fromEntries(p.map(e=>[l.keys[e],{...d(),reachedBy:l.keys.top}])),...u?Object.fromEntries(p.map(e=>[l.tabletKeys[e],o("tablet",d())])):{},...r?Object.fromEntries(p.map(e=>[l.phoneKeys[e],o("mobile",d())])):{}})}return{slider:n,select:function(n,t,o,a,i){const{note:s,phoneRest:u}="string"==typeof i?{note:i,phoneRest:void 0}:i??{};return{type:"custom",options:o,fallback:a,...s?{note:s}:{},...r({},{type:"select",label:n}),render:i=>{const{value:r,onChange:c,field:d}=i,p=d.options??o,f=d.fallback??a,b=p.some(e=>e.value===r),m="follows"in i,h=m?u?u(i.follows):i.follows:void 0,v=m?p.find(e=>e.value===h)??p.find(e=>e.value===f):void 0,g=b?r:v?.value??f,w=!0===i.readOnly;/* @__PURE__ */
|
|
17
|
+
return Y(k,{label:e(n),icon:oe(t),action:m?/* @__PURE__ */Y(l,{label:e(n),changed:null!=r&&""!==r,detail:v?q(e,e(v.label),i.followsView):void 0,disabled:w,onReset:()=>c(void 0)}):void 0,children:/* @__PURE__ */Y(y,{value:g,ariaLabel:e(n),readOnly:w,onChange:c,options:[...s?[{label:e(s),value:"\0note",disabled:!0}]:[],...p.map(n=>({label:e(n.label),value:n.value}))]})})}}},Segmented:t,segmented:s,boxJustifyField:x,boxAlignField:C,boxWrapField:P,directionField:V,gapField:A,placementField:R,PlacementGridView:function(n){return Ge(e,n)},positionFields:W,sidesPaddingFields:I,alignmentField:function(e={},n=e.fallback??"left"){return f(e,n)},alignmentFields:function(e="align",n={}){return d(e,f,p,n)},AlignmentStrip:function({opts:e={},value:n,onChange:l,ariaLabel:o,disabled:a=!1}){return t({options:p(e),value:n,onChange:l,ariaLabel:o,disabled:a})},blockAlignmentField:function(e={},n=e.fallback??"left"){return g(e,n)},blockAlignmentFields:function(e="align",n={}){return d(e,g,v,n)},BlockAlignmentStrip:function({opts:e={},value:n,onChange:l,ariaLabel:o,disabled:a=!1}){return t({options:v(e),value:n,onChange:l,ariaLabel:o,disabled:a})},boxFieldSet:function(e={}){const t=e.width??he,l=e.nudge?.limit??40,o=e.direction??{offered:be,fallback:"column"},a=o.resolve??(e=>o.offered.some(n=>n.value===e)?e:o.fallback),i={runs:e=>"row"===a(e)?"row":"column"};return{_gLayout:re("Layout"),placement:R("Placement",e.placement),width:n("Width",/* @__PURE__ */Y(S,{}),t.min,t.max,t.step,t.fallback,"%"),direction:V(o),gap:A(e.gap??me),justify:x(i),align:C(i),wrap:P(),_gNudge:re("Nudge"),...W({keys:e.nudge?.keys??{x:"nudgeX",y:"nudgeY"},min:-l,max:l,label:null}),...I(e.padding)}}}}var{slider:on,select:an,Segmented:rn,segmented:sn,boxJustifyField:un,boxAlignField:cn,boxWrapField:dn,directionField:pn,gapField:fn,placementField:bn,PlacementGridView:mn,positionFields:hn,sidesPaddingFields:vn,alignmentField:gn,alignmentFields:yn,AlignmentStrip:wn,blockAlignmentField:kn,blockAlignmentFields:xn,BlockAlignmentStrip:Cn,boxFieldSet:jn}=ln();export{ye as ANCHOR_LABELS,wn as AlignmentStrip,ce as BOX_ALIGN_POINTS,be as BOX_DIRECTIONS,fe as BOX_DIRECTION_LABEL,me as BOX_GAP,ue as BOX_JUSTIFY_POINTS,xe as BOX_NUDGE_LIMIT,ve as BOX_PLACEMENTS,ge as BOX_PLACEMENT_DEFAULT,he as BOX_WIDTH,de as BOX_WRAP_LABEL,pe as BOX_WRAP_POINTS,Cn as BlockAlignmentStrip,Re as FLAT_ACCESS,we as OPEN_PLACEMENT_POINTS,We as PHONE_KEY_ACCESS,mn as PlacementGridView,Oe as SIDE_PAD_KEYS,rn as Segmented,nn as SliderControl,Me as VIEW_KEY_ACCESS,gn as alignmentField,yn as alignmentFields,kn as blockAlignmentField,xn as blockAlignmentFields,cn as boxAlignField,ln as boxFieldBuilders,jn as boxFieldSet,un as boxJustifyField,dn as boxWrapField,pn as directionField,fn as gapField,re as group,oe as iconOf,le as isNoGlyph,te as noGlyph,ke as normaliseBoxPlacement,Ve as objectAccess,q as onDesktopWords,Ne as phoneObjectAccess,Be as phoneTwinFields,bn as placementField,hn as positionFields,je as positionPatch,se as section,sn as segmented,an as select,ae as sharedStyleKinds,Se as sidesFromObject,vn as sidesPaddingFields,Ke as sidesPaddingPatch,Pe as sidesToObject,on as slider,Ae as useAccessPatch,Ee as useAccessValue};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ScreenPartsProvider as t}from"./chunk-
|
|
1
|
+
import{ScreenPartsProvider as t}from"./chunk-2262JGFV.js";import{useEaselHost as e}from"./chunk-LX23TCTP.js";import{createEasel as r,EaselProvider as o}from"./chunk-3W2O22DZ.js";import{useState as n,useEffect as s}from"react";import{jsx as a}from"react/jsx-runtime";function i({config:i,data:c,onChange:m,permissions:p,parts:f,children:u}){const[d]=n(()=>r({config:i,data:c,permissions:p}));s(()=>{d.setConfig(i)},[d,i]),s(()=>{if(!m)return;let t=d.getState().appState.data,e=!1;return d.subscribe(()=>{const r=d.getState().appState.data;r!==t&&(t=r,(e||r!==d.loaded)&&(e=!0,m(r)))})},[d,m]),s(()=>{p&&d.setPermissions(p)},[d,p]);const h=e();/* @__PURE__ */
|
|
2
2
|
return a(o,{easel:d,hotkeys:h.ownsDocument,children:/* @__PURE__ */a(t,{parts:f,children:u})})}export{i as ScreenStoreProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEaselHost as n}from"./chunk-LX23TCTP.js";import{useEaselApi as e,bindUndoKeys as t}from"./chunk-
|
|
1
|
+
import{useEaselHost as n}from"./chunk-LX23TCTP.js";import{useEaselApi as e,bindUndoKeys as t}from"./chunk-3W2O22DZ.js";import{useState as r,useEffect as o,useRef as u}from"react";function c(e){const t=n(),[u,c]=r(null);return o(()=>c(e.current),[e]),t.ownsDocument?"undefined"==typeof document?null:document:u}function i(r,u){const i=n(),s=e(),f=c(r);o(()=>{if(!i.ownsDocument&&f)return t(f,s,{leaveTyping:!0})},[i,s,f]);const m=u?.document??null;o(()=>{if(!i.ownsDocument&&m)return t(m,s,{leaveTyping:!0})},[i,s,m])}function s(n){return n.ownsDocument?{}:{tabIndex:-1}}function f(n){return!n.altKey&&!n.shiftKey&&(!(!n.metaKey&&!n.ctrlKey)&&("s"===n.key||"S"===n.key||"KeyS"===n.code))}function m(n,e,t){const r=c(n),i=u(t);o(()=>{i.current=t}),o(()=>{if(!r)return;const n=n=>{f(n)&&(n.preventDefault(),i.current())};return r.addEventListener("keydown",n),()=>r.removeEventListener("keydown",n)},[r]);const s=e?.document??null;o(()=>{if(!s)return;const n=n=>{f(n)&&(n.preventDefault(),i.current())};return s.addEventListener("keydown",n),()=>s.removeEventListener("keydown",n)},[s])}export{s as editorRootFocus,f as isSaveShortcut,c as useEaselKeyTarget,m as useEaselSaveKey,i as useEaselUndoKeys};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{styleFieldBuilders as e,keptByRow as s}from"./chunk-ZFEAWEFS.js";import{boxFieldBuilders as o,PHONE_KEY_ACCESS as l,phoneTwinFields as r,section as i}from"./chunk-76MUJIZE.js";import{deviceField as t}from"./chunk-ZNLODQD4.js";import{BUTTON_STYLE_KEYS as c,BUTTON_PAD_KEYS as n}from"./chunk-PLTTPHK5.js";import{TextColorIcon as u,GroundIcon as d}from"efficient-shell/icons/efficient";import{jsx as f}from"react/jsx-runtime";function a(a){const p=o(a.say),F=e(a.say),y=c,m=a.style,k=a.phone??l;return{...a.padding&&{_dSize:i("Size"),...p.sidesPaddingFields({keys:n,group:!1,...a.padding})},_dDesign:i("Design"),[y.fill]:F.colourField({key:y.fill,access:m,label:"Fill color",icon:/* @__PURE__ */f(d,{}),useFollows:a.follows.useFill,usePresets:a.usePresets,resetTo:a.resetTo,opacity:{key:y.fillOpacity,useUnset:a.follows.useFillOpacity}}),[y.fillOpacity]:s(y.fill),[y.border]:F.borderField({key:y.border,access:m,useFollows:a.follows.useBorder}),[y.text]:F.colourField({key:y.text,access:m,label:"Text color",icon:/* @__PURE__ */f(u,{}),useFollows:a.follows.useText,usePresets:a.usePresets,resetTo:a.resetTo}),[y.corners]:F.cornersField({key:y.corners,access:m,sidesKey:y.cornerSides,useFollows:a.follows.useCorners,useFollowsSides:a.follows.useCornerSides}),[y.cornerSides]:s(y.corners),_dLayout:i("Layout"),...r("align",p.blockAlignmentField({phone:!0},""),k),align:t("desktop",p.blockAlignmentField())}}export{a as buttonFieldSet};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=["desktop","tablet","mobile"],e={desktop:"Desktop",tablet:"Tablet",mobile:"Phone"},n=720,o=1100;function r(t){return t>=1100?"desktop":t>=720?"tablet":"mobile"}function a(t){return`${t}Tablet`}function u(t){return`${t}Phone`}function b(t){return null==t}var p=t=>e=>"number"==typeof e?e*t:e,h=t=>t;var l={spacing:{tablet:p(.75),phone:p(2/3),round:function(t){const e=Math.ceil(Math.abs(t)/4-.5);return 4*(t<0?-e:e)+0}},columns:{tablet:t=>"number"==typeof t?Math.min(t,2):t,phone:t=>"number"==typeof t?1:t},stack:{tablet:h,phone:t=>void 0===t?t:"stacked"},textSize:{tablet:p(.85),phone:p(.7/.85),round:Math.round},heightMode:{tablet:h,phone:t=>"px"===t?"fit":t},heightPx:{tablet:p(.75),phone:h,round:Math.round},same:{tablet:h,phone:h}},i=Object.fromEntries(Object.keys(l).map(t=>[t,{tablet:h,phone:h}]));function c(t,e,n,o,r=l){const a=r[t],u=t=>a.round&&"number"==typeof t?a.round(t):t,p=b(n)?a.tablet(e):n,h=b(o)?a.phone(p):o;return{desktop:e,tablet:b(n)?u(p):n,phone:b(o)?u(h):o}}function s(t,e){return c("same",t,e,void 0,i).phone}export{l as AUTO_RULES,i as FOLLOW_RULES,o as VIEW_DESKTOP_MIN,n as VIEW_TABLET_MIN,t as VIEW_TIERS,e as VIEW_TIER_LABEL,b as isAuto,u as phoneKey,c as resolveViewValue,a as tabletKey,s as viewFollows,r as viewTierForWidth};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{panelFieldsOf as t}from"./chunk-5XL2RXFU.js";import{DESIGN_GROUP_KEY as o,BUCKET_KEY as n}from"./chunk-3QB2ZQXK.js";import{withoutDeviceGate as e}from"./chunk-ZNLODQD4.js";import{STYLE_KIND as r,fieldKind as s,copyStyle as i,heldStyle as c,planPaste as p,pasteMessage as u}from"./chunk-CWELHADJ.js";import{ANCHOR_FIELD_KEYS as a,foldMetaOf as f,MEDIA_FIELD_MARKER as l,TEXT_FIELD_MARKER as m,LINK_FIELD_MARKER as h}from"./chunk-ANPOR6EY.js";import{deviceMetaOf as y}from"./chunk-YCSZAP7T.js";var j=/* @__PURE__ */new Set([o.Size,o.Design,o.Layout,o.Position]),w=new Set(Object.values(o)),b=new Set(Object.values(n)),S=new Set(a),k=/* @__PURE__ */new Set(["focal","imageFocal"]),g=[l,m,h];function v(t){return`site:${t??""}`}function A(t){if(!t||"object"!=typeof t)return null;const o=t,n=e(t)??t,i=o[r]??n[r];if("string"==typeof i)return i;const c=o.options??n.options;if(Array.isArray(c)){return`choice:${c.map(t=>String(t?.value)).sort().join("|")}`}return s(n)}function D(t){const o=t,n=e(t);return g.some(t=>t in o||n&&t in n)}function L(o,e){const r=t(o,e)??{},s=[];let i=!0,c=!1;for(const[t,o]of Object.entries(r))b.has(t)?(i=t===n.Design,c=!1):w.has(t)?i&&(c=j.has(t)):c&&o&&"object"==typeof o&&!t.startsWith("_")&&(f(o)||S.has(t)||k.has(t)||D(o)||"slot"!==o.type&&s.push({path:[t],kind:A(o),counted:"mobile"!==y(o)?.tier&&"tablet"!==y(o)?.tier}));return s}function O(t,o,n,e,r){i({scope:n,type:e.type,label:r,rows:t(o,e),props:e.props})}function d(t,o,n,e,r,s){const i=c(n);if(!i)return null;const a=p(i,{type:e.type,rows:t(o,e),props:e.props});return{...a,message:u(a,i.sourceLabel,r,s)}}function P(t,o,n,e){O(L,t,o,n,e)}function Q(t,o,n,e,r){return d(L,t,o,n,e,r)}var X={scope:t=>v(t.siteId),rows:(t,o)=>L(t,o),copy:(t,o,n,e)=>P(e,t,o,n),plan:(t,o,n,e)=>Q(e,t,o,n)};function Z(t,o){if(!t&&!o)return X;const n=t?.rows,e=n?(t,o)=>n(t,o):L;return{scope:t?.scope??X.scope,rows:(t,o)=>e(t,o),copy:t?.copy??((t,o,n,r)=>O(e,r,t,o,n)),plan:t?.plan??((t,n,r,s)=>d(e,s,t,n,r,o))}}export{P as copyNodeStyle,L as nodeStyleRows,Q as planNodePaste,A as shopFieldKind,v as siteStyleScope,Z as styleClipboardOf};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e={title:"Add",contextAll:"Sections and blocks",done:"Done",doneDescription:"Close Add and go back",templates:"Your templates",tile:({name:e})=>`Add ${e}`,hint:"Drag onto the page.",search:"Search",onlySections:"Only sections go here",notInside:({name:e})=>`Cannot go inside ${e}`,addingTo:({name:e})=>`Adding to ${e}`,addingBefore:({name:e})=>`Adding before ${e}`,addingAtEnd:"Adding at the end of the page",addingHere:"Adding here"},a=e=>1===e?"1 page":`${e} pages`,t={group:"Shared sections",onPages:({count:e})=>`On ${a(e)}`,makeShared:"Make shared",makeSharedHint:"Use this section on other pages from Add. Change it once, and every page changes.",name:"Name",cancel:"Cancel",makeFailed:"Could not make it shared. Try again.",detach:"Detach from shared",removeFromPage:"Remove from this page",removed:({count:e})=>e>0?`Removed from this page · still on ${a(e)}`:"Removed from this page",deleteShared:"Delete shared section",deleteTitle:({name:e})=>`Delete “${e}”?`,deleteMessage:({count:e})=>0===e?"No page uses it. Nothing on the website changes.":1===e?"The page that uses it keeps its own copy. Nothing disappears from the website.":`The ${e} pages that use it each keep their own copy. Nothing disappears from the website.`,deleteFailed:"Could not delete it. Try again.",alreadyHere:"Already on this page"};var o={savedAgo:function({seconds:e}){const a=Math.max(0,Math.floor(e));if(a<1)return"Saved just now";if(a<60)return`Saved ${a} second${1===a?"":"s"} ago`;const t=Math.floor(a/60);if(t<60)return`Saved ${t} minute${1===t?"":"s"} ago`;const o=Math.floor(t/60);return`Saved ${o} hour${1===o?"":"s"} ago`},saved:"All changes saved",saving:"Saving",pending:"Changes not saved yet — saving in a moment",failedIn:({seconds:e})=>`Not saved — trying again in ${e} s`,failedSoon:"Not saved — trying again soon",offline:"You’re offline — we’ll save when you’re back",pausedHeld:"Auto-save is off — changes not saved",paused:"Auto-save is off",locked:({editing:e})=>`Not saving — ${e}`,blockedOffline:"You’re offline. Try again when you’re back online.",blockedFailed:"Your last changes are not saved yet. Try again when they are.",blockedConflict:"Your last save was refused. See the notice below."},n={blockCount:({count:e})=>`${e} ${1===e?"block":"blocks"}`,loading:"Loading",waitingForAuthorization:"Waiting for editor authorization",missingTemplatePage:"Couldn’t open a page in this template.",missingPage:({slug:e})=>`No page with slug "${e}".`,missingDocument:"Couldn’t open this document.",loadFailed:({cause:e})=>`Could not load the document — ${e}`,noun:"page",pageStyles:"This page",header:"Header",footer:"Footer",pageSections:"Page",templateSections:"Template",addSection:"Add section",addSectionHere:"Add section here",done:"Done",copied:({name:e})=>`Copied ${e}`,pasteRefused:({name:e})=>`${e} can’t be pasted here.`,writeLate:"That took too long. Your change is kept, but the last step did not finish.",add:e,shared:t,canvasAddBlock:"Add block",canvasReplaceImage:"Replace image",railMedia:"Media library",leftPanel:"Left panel",resizeLeftPanel:"Resize left panel",leave:{title:"Unsaved changes",body:"Your most recent edits haven’t finished saving yet. Save them before switching, or leave and discard them.",cancel:"Cancel",discard:"Discard & leave",save:"Save & leave",saving:"Saving"},bar:{undo:"Undo",redo:"Redo",refresh:"Reload the preview",refreshTip:"Reload the preview (keeps your place)",notSaving:"Not saving — see the notice below",retry:"Retry now",autoSaveOff:"Auto-save is off — click to turn it back on (saves your held edits)",autoSaveOn:"Auto-save is on — click to pause it",views:"Left panel views",saveOptions:"Save options",autoSave:"Auto-save",saveNow:"Save now"},saveStatus:o,menu:{undo:"Undo",redo:"Redo",collapseAll:"Collapse all layers",selectAll:"Select all",pinned:"Pinned — can’t be moved or deleted",clipboardRefused:"Your browser won’t let us read the clipboard — press ⌘V",itemAddAfter:"Add item after",itemMoveEarlier:"Move item earlier",itemMoveLater:"Move item later",itemDelete:"Delete item"},layers:"Layers",expandAll:"Expand all sections",collapseAll:"Collapse all sections",nothingToFold:"Nothing to fold on this page",rename:"Rename",deleteNamed:({name:e})=>`Delete ${e}`,hideNamed:({name:e})=>`Hide ${e}`,showNamed:({name:e})=>`Show ${e}`,addBlockHere:"Add block here",sectionFirst:({name:e})=>`“${e}” is already first`,sectionLast:({name:e})=>`“${e}” is already last`,sectionMoved:({name:e,n:a,total:t})=>`Moved “${e}” to position ${a} of ${t}`,sectionAdded:({name:e})=>`Added “${e}” section`,deleted:({name:e})=>`Deleted “${e}”`,resizeSettingsPanel:"Resize settings panel",sectionSettings:({name:e})=>`${e} settings`,headerSettings:"Header settings",addBlockMenu:"Add block",deviceNote:{
|
|
1
|
+
var e={title:"Add",contextAll:"Sections and blocks",done:"Done",doneDescription:"Close Add and go back",templates:"Your templates",tile:({name:e})=>`Add ${e}`,hint:"Drag onto the page.",search:"Search",onlySections:"Only sections go here",notInside:({name:e})=>`Cannot go inside ${e}`,addingTo:({name:e})=>`Adding to ${e}`,addingBefore:({name:e})=>`Adding before ${e}`,addingAtEnd:"Adding at the end of the page",addingHere:"Adding here"},a=e=>1===e?"1 page":`${e} pages`,t={group:"Shared sections",onPages:({count:e})=>`On ${a(e)}`,makeShared:"Make shared",makeSharedHint:"Use this section on other pages from Add. Change it once, and every page changes.",name:"Name",cancel:"Cancel",makeFailed:"Could not make it shared. Try again.",detach:"Detach from shared",removeFromPage:"Remove from this page",removed:({count:e})=>e>0?`Removed from this page · still on ${a(e)}`:"Removed from this page",deleteShared:"Delete shared section",deleteTitle:({name:e})=>`Delete “${e}”?`,deleteMessage:({count:e})=>0===e?"No page uses it. Nothing on the website changes.":1===e?"The page that uses it keeps its own copy. Nothing disappears from the website.":`The ${e} pages that use it each keep their own copy. Nothing disappears from the website.`,deleteFailed:"Could not delete it. Try again.",alreadyHere:"Already on this page"};var o={savedAgo:function({seconds:e}){const a=Math.max(0,Math.floor(e));if(a<1)return"Saved just now";if(a<60)return`Saved ${a} second${1===a?"":"s"} ago`;const t=Math.floor(a/60);if(t<60)return`Saved ${t} minute${1===t?"":"s"} ago`;const o=Math.floor(t/60);return`Saved ${o} hour${1===o?"":"s"} ago`},saved:"All changes saved",saving:"Saving",pending:"Changes not saved yet — saving in a moment",failedIn:({seconds:e})=>`Not saved — trying again in ${e} s`,failedSoon:"Not saved — trying again soon",offline:"You’re offline — we’ll save when you’re back",pausedHeld:"Auto-save is off — changes not saved",paused:"Auto-save is off",locked:({editing:e})=>`Not saving — ${e}`,blockedOffline:"You’re offline. Try again when you’re back online.",blockedFailed:"Your last changes are not saved yet. Try again when they are.",blockedConflict:"Your last save was refused. See the notice below."},n={blockCount:({count:e})=>`${e} ${1===e?"block":"blocks"}`,loading:"Loading",waitingForAuthorization:"Waiting for editor authorization",missingTemplatePage:"Couldn’t open a page in this template.",missingPage:({slug:e})=>`No page with slug "${e}".`,missingDocument:"Couldn’t open this document.",loadFailed:({cause:e})=>`Could not load the document — ${e}`,noun:"page",pageStyles:"This page",header:"Header",footer:"Footer",pageSections:"Page",templateSections:"Template",addSection:"Add section",addSectionHere:"Add section here",done:"Done",copied:({name:e})=>`Copied ${e}`,pasteRefused:({name:e})=>`${e} can’t be pasted here.`,writeLate:"That took too long. Your change is kept, but the last step did not finish.",add:e,shared:t,canvasAddBlock:"Add block",canvasReplaceImage:"Replace image",railMedia:"Media library",leftPanel:"Left panel",resizeLeftPanel:"Resize left panel",leave:{title:"Unsaved changes",body:"Your most recent edits haven’t finished saving yet. Save them before switching, or leave and discard them.",cancel:"Cancel",discard:"Discard & leave",save:"Save & leave",saving:"Saving"},bar:{undo:"Undo",redo:"Redo",refresh:"Reload the preview",refreshTip:"Reload the preview (keeps your place)",notSaving:"Not saving — see the notice below",retry:"Retry now",autoSaveOff:"Auto-save is off — click to turn it back on (saves your held edits)",autoSaveOn:"Auto-save is on — click to pause it",views:"Left panel views",saveOptions:"Save options",autoSave:"Auto-save",saveNow:"Save now"},saveStatus:o,menu:{undo:"Undo",redo:"Redo",collapseAll:"Collapse all layers",selectAll:"Select all",pinned:"Pinned — can’t be moved or deleted",clipboardRefused:"Your browser won’t let us read the clipboard — press ⌘V",itemAddAfter:"Add item after",itemMoveEarlier:"Move item earlier",itemMoveLater:"Move item later",itemDelete:"Delete item"},layers:"Layers",expandAll:"Expand all sections",collapseAll:"Collapse all sections",nothingToFold:"Nothing to fold on this page",rename:"Rename",deleteNamed:({name:e})=>`Delete ${e}`,hideNamed:({name:e})=>`Hide ${e}`,showNamed:({name:e})=>`Show ${e}`,addBlockHere:"Add block here",sectionFirst:({name:e})=>`“${e}” is already first`,sectionLast:({name:e})=>`“${e}” is already last`,sectionMoved:({name:e,n:a,total:t})=>`Moved “${e}” to position ${a} of ${t}`,sectionAdded:({name:e})=>`Added “${e}” section`,deleted:({name:e})=>`Deleted “${e}”`,resizeSettingsPanel:"Resize settings panel",sectionSettings:({name:e})=>`${e} settings`,headerSettings:"Header settings",addBlockMenu:"Add block",deviceNote:{mobile:"Showing the phone settings for this section."}},s={focus:"Image focus",onDesktop:e=>`${e} on desktop`,pasteLink:"or paste an image URL",pasteName:"Image URL",template:"Templates don’t store images. This slot stays a placeholder. Each website picks its own after it’s created.",templateVideo:"Templates don’t store videos. This slot stays a placeholder. Each website picks its own after it’s created."};export{s as DEFAULT_IMAGE_ROW_WORDS,e as DEFAULT_SCREEN_ADD_WORDS,o as DEFAULT_SCREEN_SAVE_STATUS_WORDS,t as DEFAULT_SCREEN_SHARED_WORDS,n as DEFAULT_SCREEN_WORDS};
|