efficient-easel 23.1.0 → 24.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 +4 -1
- package/dist/{ScreenDocumentContext-BDLUYzlM.d.ts → ScreenDocumentContext-DPW_6gOC.d.ts} +16 -1
- package/dist/autosave/index.d.ts +3 -3
- package/dist/chrome/chrome.css +16 -0
- package/dist/chrome/index.d.ts +9 -3
- package/dist/chrome/index.js +1 -1
- package/dist/{chunk-JWOBAEBH.js → chunk-2AV62DEP.js} +1 -1
- package/dist/{chunk-UNVKPVZW.js → chunk-3FIS2FRS.js} +1 -1
- package/dist/chunk-4RJBW7VC.js +8 -0
- package/dist/{chunk-PY7OOQEZ.js → chunk-55KKGABA.js} +1 -1
- package/dist/chunk-5NHQ452C.js +1 -0
- package/dist/{chunk-SINAM2IT.js → chunk-5PXVT7JY.js} +1 -1
- package/dist/chunk-7BW74Y55.js +1 -0
- package/dist/{chunk-VHFLOHGQ.js → chunk-CMMR6CJS.js} +1 -1
- package/dist/chunk-CZAAGBVL.js +7 -0
- package/dist/{chunk-LSTOOYG7.js → chunk-D5GQEUKM.js} +1 -1
- package/dist/{chunk-GKG3M5QK.js → chunk-FRAIEWRC.js} +1 -1
- package/dist/{chunk-AT4DDMJS.js → chunk-G7ISR6DI.js} +1 -1
- package/dist/{chunk-6QSFJCJT.js → chunk-H4Z2V56N.js} +16 -16
- package/dist/chunk-HHQZB6IE.js +64 -0
- package/dist/{chunk-77IWWW6X.js → chunk-ISS72IKO.js} +1 -1
- package/dist/chunk-K7MMLCTT.js +2 -0
- package/dist/chunk-LX23TCTP.js +2 -0
- package/dist/{chunk-FHCKFOCD.js → chunk-NCXYC7WI.js} +2 -2
- package/dist/{chunk-BIK3AO2V.js → chunk-NQW6XCAY.js} +1 -1
- package/dist/{chunk-T3LAGI43.js → chunk-PDJ5ZALV.js} +1 -1
- package/dist/{chunk-2G6MAXPY.js → chunk-T2RINM7R.js} +1 -1
- package/dist/chunk-TOHOGVAE.js +15 -0
- package/dist/chunk-WYTPBF3Q.js +20 -0
- package/dist/{chunk-C56MPJBH.js → chunk-Y53EKN35.js} +1 -1
- package/dist/chunk-Z5BPY2VG.js +5 -0
- package/dist/{chunk-HNV6HUSQ.js → chunk-ZYHKXEND.js} +4 -4
- package/dist/copy/index.js +10 -10
- package/dist/draw/index.js +1 -1
- package/dist/fields/index.js +1 -1
- package/dist/panel/index.js +1 -15
- package/dist/panel/panel.css +12 -0
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/MediaPopup.js +1 -1
- package/dist/screen/components/NodeContextMenu.d.ts +2 -2
- package/dist/screen/components/NodeContextMenu.js +1 -1
- package/dist/screen/components/PageEditGuardNotices.js +1 -1
- package/dist/screen/components/SaveControls.d.ts +2 -2
- package/dist/screen/components/SaveControls.js +1 -1
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenDocumentContext.d.ts +1 -1
- package/dist/screen/components/ScreenDocumentContext.js +1 -1
- package/dist/screen/components/ScreenMount.d.ts +3 -3
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.d.ts +2 -2
- package/dist/screen/components/ScreenStoreProvider.js +1 -1
- package/dist/screen/components/SectionScreenShell.js +17 -17
- package/dist/screen/components/SidePanelHead.js +1 -1
- package/dist/screen/components/panel-widths.js +1 -1
- package/dist/screen/components/usePartBridge.d.ts +2 -2
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.d.ts +3 -3
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/admin-bridge.js +1 -1
- package/dist/screen/lib/document/box-fields.d.ts +389 -0
- package/dist/screen/lib/document/box-fields.js +9 -0
- package/dist/screen/lib/document/slot-child-name.js +1 -1
- package/dist/screen/lib/document/style-clipboard.d.ts +2 -2
- package/dist/screen/lib/document/use-section-ops.js +1 -1
- package/dist/screen/lib/document-addressing.d.ts +1 -1
- package/dist/screen/lib/host-inbound.js +1 -1
- package/dist/screen/lib/host.d.ts +1 -1
- package/dist/screen/lib/host.js +1 -1
- package/dist/screen/lib/key-scope.js +1 -1
- package/dist/screen/lib/media-panel.d.ts +1 -1
- package/dist/screen/lib/media-panel.js +1 -1
- package/dist/screen/lib/media-picker.d.ts +1 -1
- package/dist/screen/lib/media-picker.js +1 -1
- package/dist/screen/lib/save-status.d.ts +1 -1
- package/dist/screen/lib/screen-parts.d.ts +24 -6
- package/dist/screen/lib/screen-parts.js +1 -1
- package/dist/screen/screen.css +32 -0
- package/dist/strings/index.d.ts +2 -2
- package/dist/{types-B3iSHX-w.d.ts → types-SrGNzYeO.d.ts} +6 -0
- package/dist/{words-Cm8PMYn0.d.ts → words-BAx3u2dD.d.ts} +1 -1
- package/package.json +9 -3
- package/dist/chunk-A6ZP5II4.js +0 -2
- package/dist/chunk-JPCOBNYW.js +0 -1
- package/dist/chunk-MQA7OFRA.js +0 -2
- package/dist/chunk-NQ7NRYTK.js +0 -8
- package/dist/chunk-S3DUFDQ6.js +0 -6
- package/dist/chunk-SSRYU3YG.js +0 -1
- package/dist/chunk-TGSK5VII.js +0 -5
- package/dist/chunk-Z6V22QRZ.js +0 -64
- package/dist/chunk-ZG6PVMC3.js +0 -19
package/dist/screen/screen.css
CHANGED
|
@@ -892,3 +892,35 @@
|
|
|
892
892
|
gap: 4px;
|
|
893
893
|
padding-left: 12px;
|
|
894
894
|
}
|
|
895
|
+
|
|
896
|
+
/* THE BOX FIELD SET'S SLIDER BOX AND POSITION LINE (screen/lib/document/box-fields;
|
|
897
|
+
moved from efficient-web-builder's storefront-editor.css with the builders,
|
|
898
|
+
names kept). `.sf-slider` is the box the shell's `Slider` sits in. The notch
|
|
899
|
+
a website row ticks on the track stays the website's (`.has-notch`). */
|
|
900
|
+
.sf-slider {
|
|
901
|
+
display: flex;
|
|
902
|
+
align-items: center;
|
|
903
|
+
gap: 12px;
|
|
904
|
+
}
|
|
905
|
+
/* …and it takes the whole row wherever `SettingsField` stacks it (card 66247:
|
|
906
|
+
the slider fills the row). As a flex item with no `flex` it would size to
|
|
907
|
+
its content, a bare range, whatever width the panel is dragged to. */
|
|
908
|
+
.es-field-ctl > .sf-slider {
|
|
909
|
+
flex: 1;
|
|
910
|
+
min-width: 0;
|
|
911
|
+
}
|
|
912
|
+
.sf-slider > .sf-slider-track {
|
|
913
|
+
flex: 1;
|
|
914
|
+
min-width: 0;
|
|
915
|
+
}
|
|
916
|
+
/* A Position row with no word of its own: the two boxes straight in the band,
|
|
917
|
+
the reset at the end of their line. */
|
|
918
|
+
.sf-position-line {
|
|
919
|
+
display: flex;
|
|
920
|
+
align-items: center;
|
|
921
|
+
gap: 8px;
|
|
922
|
+
}
|
|
923
|
+
.sf-position-line > :first-child {
|
|
924
|
+
flex: 1;
|
|
925
|
+
min-width: 0;
|
|
926
|
+
}
|
package/dist/strings/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as SaveWords } from '../words-
|
|
1
|
+
import { a as SaveWords } from '../words-BAx3u2dD.js';
|
|
2
2
|
import { N as NoticeWords, C as ChromeWords } from '../words-DYu4iBrR.js';
|
|
3
3
|
import { C as CopyWords } from '../words-Cf5VT2Ic.js';
|
|
4
4
|
import { D as DragWords } from '../words-SD4neL0n.js';
|
|
@@ -14,7 +14,7 @@ import { T as TextStylesWords } from '../words-B5Gb7KFq.js';
|
|
|
14
14
|
import { T as TreeWords } from '../words-Cl9xMUYY.js';
|
|
15
15
|
import * as react from 'react';
|
|
16
16
|
import { ReactNode } from 'react';
|
|
17
|
-
import '../types-
|
|
17
|
+
import '../types-SrGNzYeO.js';
|
|
18
18
|
import '../types-Cy7rdmXt.js';
|
|
19
19
|
import '../wordFit-7XpmhcaW.js';
|
|
20
20
|
import '../panelWidths-DgQXiPXU.js';
|
|
@@ -133,6 +133,12 @@ type InspectorUpLevelProps = {
|
|
|
133
133
|
* above the inspector head.
|
|
134
134
|
*/
|
|
135
135
|
inline?: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* The open level's name, drawn under the link — for a level the inspector
|
|
138
|
+
* head does not name ("Map" under "← Los Angeles"). Omit it where the head
|
|
139
|
+
* already names what is open: a third copy of the name is noise.
|
|
140
|
+
*/
|
|
141
|
+
title?: string;
|
|
136
142
|
};
|
|
137
143
|
type InspectorIconButtonProps = {
|
|
138
144
|
/** Accessible name, and the tooltip unless `title` says something else. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-easel",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "24.0.0",
|
|
4
4
|
"description": "Efficient Easel: the EFFICIENT editors' shared engine and chrome: the saved document as pure functions, the published renderer, and the editor frame, panels, Layers tree, text grammar and type-in-place box. Published as editor-shell up to 0.66.0 and as efficient-editor up to 0.95.0.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Efficient Pty Ltd",
|
|
@@ -94,6 +94,7 @@
|
|
|
94
94
|
"./screen/lib/document/add-target-types",
|
|
95
95
|
"./screen/lib/document/block-choice",
|
|
96
96
|
"./screen/lib/document/block-types-in",
|
|
97
|
+
"./screen/lib/document/box-fields",
|
|
97
98
|
"./screen/lib/document/device-fields",
|
|
98
99
|
"./screen/lib/document/field-buckets",
|
|
99
100
|
"./screen/lib/document/field-markers",
|
|
@@ -427,6 +428,11 @@
|
|
|
427
428
|
"import": "./dist/screen/lib/document/content-tree.js",
|
|
428
429
|
"default": "./dist/screen/lib/document/content-tree.js"
|
|
429
430
|
},
|
|
431
|
+
"./screen/lib/document/box-fields": {
|
|
432
|
+
"types": "./dist/screen/lib/document/box-fields.d.ts",
|
|
433
|
+
"import": "./dist/screen/lib/document/box-fields.js",
|
|
434
|
+
"default": "./dist/screen/lib/document/box-fields.js"
|
|
435
|
+
},
|
|
430
436
|
"./screen/lib/document/device-fields": {
|
|
431
437
|
"types": "./dist/screen/lib/document/device-fields.d.ts",
|
|
432
438
|
"import": "./dist/screen/lib/document/device-fields.js",
|
|
@@ -627,7 +633,7 @@
|
|
|
627
633
|
"dist"
|
|
628
634
|
],
|
|
629
635
|
"peerDependencies": {
|
|
630
|
-
"efficient-shell": "^10.
|
|
636
|
+
"efficient-shell": "^10.20.0",
|
|
631
637
|
"react": ">=18",
|
|
632
638
|
"react-dom": ">=18"
|
|
633
639
|
},
|
|
@@ -637,7 +643,7 @@
|
|
|
637
643
|
"@types/node": "^22.0.0",
|
|
638
644
|
"@types/react": "^18.2.0",
|
|
639
645
|
"@types/react-dom": "^18.2.0",
|
|
640
|
-
"efficient-shell": "^10.
|
|
646
|
+
"efficient-shell": "^10.20.0",
|
|
641
647
|
"esbuild": "^0.27.0",
|
|
642
648
|
"jsdom": "^26.1.0",
|
|
643
649
|
"react": "^18.2.0",
|
package/dist/chunk-A6ZP5II4.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{routeSharedHostMessage as e}from"./chunk-77IWWW6X.js";import{describeLoadFailure as r,hostLoadRefusal as n}from"./chunk-ERR437B5.js";import{editLockOf as t}from"./chunk-GMCZXMOV.js";import{NO_DOCUMENT_ADDRESSING as o}from"./chunk-RLBXE4EU.js";import{saveStatusOf as u,resetForDocumentSwitch as a}from"./chunk-HNKB2ZYR.js";import{isExpiredSession as s,readEaselFailure as i}from"./chunk-CLOS6SSX.js";import{useAdminBridge as l}from"./chunk-BIK3AO2V.js";import{STATUS_UNREACHABLE as c}from"./chunk-KCOBHPN6.js";import{useEaselSession as d}from"./chunk-YM4UEGBV.js";import{backendOf as f,setSessionDocumentSite as m}from"./chunk-SNF5764Q.js";import{useEaselHost as k}from"./chunk-MQA7OFRA.js";import{DEFAULT_SCREEN_WORDS as v}from"./chunk-IYHO4XQX.js";import{useAutosave as g}from"./chunk-NDRZP6YR.js";import{canWriteDocument as p,newEaselClientId as h,reloadIfVersionMoved as y,openUnansweredClaim as w,FAIL_OPEN_RETRY_MS as b,CLAIM_FAIL_OPEN_MS as S,holderOf as I}from"./chunk-THWO5YVZ.js";import{useWords as P}from"./chunk-MFIRYGHW.js";import{createContext as j,useContext as R,useState as B,useMemo as O,useCallback as E,useEffect as H,useRef as A}from"react";import{jsx as C}from"react/jsx-runtime";var M={content:[],root:{},zones:{}};var N=j(null);function T(){const e=R(N);if(!e)throw new Error("useStorefrontDocument must be used within StorefrontDocumentProvider");return e}function F({target:j,addressing:R=o,onHostMessage:T,children:F}){const V=R,{homeSlug:D,entryMayBounce:L,entryBounce:W,onSwitch:Y,tellsHost:X,adapterFor:K,migrateRenamedProps:U,describeMissing:Z,onLoadFailed:x}=V,[G,Q]=B(j),z=k(),_=d(),q=O(()=>f(_),[_]),J=O(()=>t(_),[_]),$="template"===G.kind,ee="template"===G.kind?G.id:null,re="template"===G.kind?G.pageSlug??D??"":"document"===G.kind?G.slug??"":G.slug,ne="page"===G.kind?G.siteId??null:null,te=_.blocks,oe=O(()=>K(G,q,te),[K,q,te,G.kind,"template"===G.kind?G.id:"document"===G.kind?G.record:G.siteId]),ue=oe.capabilities,ae=E(e=>_.documentHooks?.stored?.(e)??e,[_]);H(()=>{m(_,ne)},[_,ne]);const se=A(G);H(()=>{se.current=G},[G]);const{token:ie,tokenRef:le,capabilities:ce}=l({onMessage:r=>{if(T?.(r)||e(r))return;const n=r;if("storefront-editor:navigate"===n?.type){const e=r;e?.target&&Br(e.target)}}}),de=!_.usesBridgedToken||null!==ie,fe=oe.lock,me=Boolean(q.lock),[ke,ve]=B(null),[ge,pe]=B(null),[he,ye]=B(null),[we,be]=B(null),Se=P("screen",v),Ie=we?function(e,r){if(null!==e.sentence)return e.sentence;if(!e.missing)return r.loadFailed({cause:e.cause});switch(e.target.kind){case"template":return r.missingTemplatePage;case"document":return r.missingDocument;default:return r.missingPage({slug:e.slug})}}(we,Se):null,[Pe,je]=B(null),Re=A(null),Be=A(null),[Oe,Ee]=B(!1),He=A(null),[Ae,Ce]=B(null),Me=A(null),[Ne,Te]=B(null),[Fe,Ve]=B(!1),De=A(null);H(()=>{De.current=Ne},[Ne]);const[Le,We]=B(ue.hasEditLock?{kind:"checking"}:{kind:"editing"}),Ye=A(Le);H(()=>{Ye.current=Le},[Le]);const Xe=A(()=>Promise.resolve(!1)),Ke=E(e=>{Be.current=e,Ee(!0)},[]),Ue=g({save:async({id:e,data:r})=>{if(p(Ye.current)){if(!await Xe.current(e,r)){if(!p(Ye.current))return void Ke({id:e,data:r});throw new Error("page save did not land")}}else Ke({id:e,data:r})},onFailure:(e,r)=>{0===r&&z.send("storefront-editor:save-failed")}}),{state:Ze,push:xe,flush:Ge,pause:Qe,resume:ze,stop:_e,reset:qe,retryNow:Je,hasPending:$e}=Ue,er=A(Ze);H(()=>{er.current=Ze},[Ze]);const rr=u(Ze),nr=E(()=>{const e=Be.current;e&&(Be.current=null,Ee(!1),xe(e))},[xe]),tr=A("");tr.current||(tr.current=h());const[or,ur]=B(0),ar=A(!1),[sr,ir]=B(L(j)),lr=A(!1);H(()=>{if(lr.current)return;lr.current=!0;const e=z.address.search(),r=W(j,e);r?z.address.load(r):L(j)&&ir(!1)},[j,z]);const cr=z.send;H(()=>{if(!de)return;let e=!1;const t=se.current,o=oe.resolve(re),u=_.documentHooks?.opening?.({slug:re,isTemplate:$,capabilities:ue});return o.then(async r=>{if(e)return;if(!r)return"page"===t.kind&&null!==D&&re!==D?void z.address.load({kind:"page",slug:D,siteId:ne??void 0}):(be({target:t,slug:re,missing:!0,sentence:Z?.(t)??null}),void x?.(t,null));const n=r.readOnlyReason?r.readOnlyReason:null;Re.current=n,je(n),ve(r.id),pe(r.kind??null),Me.current=r.version??null;const o=r.layout,a=o&&Object.keys(o).length?o:M,s=U(a),i=u?await u(s):s;e||ye(i)}).catch(o=>{e||(console.error("[storefront-editor] document load failed",o),be({target:t,slug:re,missing:!1,sentence:n(o,{slug:re},_),cause:r(o,_)}),x?.(t,o))}),()=>{e=!0}},[de,ie,$,oe,re]);const dr=E(e=>new Promise(r=>{const n=Date.now(),t=setInterval(()=>{const o=le.current;o&&o!==e?(clearInterval(t),r(o)):Date.now()-n>6e3&&(clearInterval(t),r(null))},200)}),[]),fr=E(async e=>{const r=le.current;if(!r&&_.usesBridgedToken)return{ok:!1,error:new Error("no editor token")};try{return{ok:!0,value:await e(r??"")}}catch(n){if(s(n,_)){cr("storefront-editor:auth-expired");const n=r?await dr(r):null;if(n)try{return{ok:!0,value:await e(n)}}catch(e){return{ok:!1,error:e}}}return{ok:!1,error:n}}},[cr,dr,_]),mr=E(async e=>{const r=le.current?await fr(e):{ok:!1};return r.ok||cr("storefront-editor:save-failed"),r.ok},[cr,fr]),kr=E(async(e,r,n=!1)=>{if(null!==Re.current)return!1;if(!p(Ye.current))return!1;if(De.current)return!1;const t=await fr(()=>oe.saveLayout(e,r,Me.current,tr.current));if(t.ok)return Me.current=t.value.version??Me.current,Ve(!1),!0;const o=J.readLockTaken(t.error);if(o){const e={kind:"takenover",holder:o};return Ye.current=e,We(e),!1}const u=J.readSaveConflict(t.error);if(u){if(u.savedByYou&&!n&&oe.rereadVersion){const n=await fr(()=>oe.rereadVersion(e));if(n.ok&&n.value)return Me.current=n.value,Xe.current(e,r,!0)}_e(),De.current=u,Te(u)}return Ve(i(t.error,_)?.status===c),!1},[oe,fr,_e,_]);H(()=>{Xe.current=kr},[kr]);const vr=E(e=>{if(null!==Re.current)return;if(cr("storefront-editor:dirty"),!ke)return;const r=ae(e);He.current=r,p(Ye.current)?xe({id:ke,data:r}):Ke({id:ke,data:r})},[ke,cr,Ke,xe,ae]),gr=E(async()=>{p(Ye.current)&&nr();return await Ge()&&null==Be.current},[nr,Ge]),pr=A(gr);H(()=>{pr.current=gr},[gr]);const hr=A(fr);H(()=>{hr.current=fr},[fr]);const yr=E(()=>{z.address.reload()},[z]),wr=A(()=>Promise.resolve(!1));H(()=>{wr.current=()=>{const e=oe.rereadVersion;return ke&&e?y({ours:Me.current,stored:async()=>{const r=await hr.current(()=>e(ke));return r.ok?r.value:null},hasPending:()=>null!=Be.current||$e(),reload:yr}):Promise.resolve(!1)}},[oe,ke,$e,yr]);const br=null!==Pe;H(()=>{if(!fe||!ke||!de||br)return;let e=!1,r=null,n=null;const t=tr.current,o={claim:async e=>{const r=await hr.current(()=>fe.claim(ke,t,e));if(r.ok)return{heartbeat_seconds:r.value.heartbeatSeconds};throw r.error},cancelled:()=>e,currentAccess:()=>Ye.current,heldWrite:()=>({pending:null!=Be.current||$e(),autoSaveEnabled:!er.current.paused,saveConflict:null!=De.current}),setAccess:e=>{Ye.current=e,We(e)},releaseHeldWrite:()=>{pr.current()},startHeartbeat:e=>{r&&clearInterval(r),r=setInterval(()=>{u(!1)},e)},stopHeartbeat:()=>{r&&(clearInterval(r),r=null)},reloadIfMoved:()=>{wr.current()}},u=J.makeClaimBeat(o),a=ar.current;return ar.current=!1,a||(We({kind:"checking"}),n=setTimeout(()=>{n=null,w(o)&&o.startHeartbeat(b)},S)),u(a).finally(()=>{n&&clearTimeout(n),n=null}),()=>{e=!0,n&&clearTimeout(n),r&&clearInterval(r),fe.release(ke,t).catch(()=>{})}},[ke,fe,de,ie,or,br]);const Sr=E(()=>{fe&&ke&&(ar.current=!0,ur(e=>e+1))},[ke,fe]),Ir=E(()=>{We(e=>{const r="blocked"===e.kind||"takenover"===e.kind?e.holder:null;return r?{kind:"readonly",holder:r}:e})},[]),Pr=E(()=>{er.current.paused?(p(Ye.current)&&nr(),ze()):Qe()},[nr,Qe,ze]),jr=E(()=>{Je()},[Je]),Rr=E(e=>{He.current=null,a("template"!==e.kind&&me,{resetAutosave:()=>{qe(),Be.current=null,Ee(!1)},setVersion:e=>{Me.current=e},setSaveConflict:Te,setAccess:We}),Y(e),Q(e),Re.current=null,je(null),ve(null),pe(null),ye(null),be(null),z.address.show(e),"document"!==e.kind&&X(e)&&z.send("storefront-editor:navigated",{target:e})},[qe,z,me,Y,X]),Br=E(e=>{if(function(e,r,n){if(e.kind!==r.kind)return!1;if("template"===e.kind){const t=r;return e.id===t.id&&(e.pageSlug??n)===(t.pageSlug??n)}if("document"===e.kind){const n=r;return e.record===n.record&&(e.slug??"")===(n.slug??"")}const t=r;return e.slug===t.slug&&e.siteId===t.siteId}(e,se.current,D))return;const r=null!=Be.current;if(!r&&!$e())return void Rr(e);const n=er.current;r||n.paused||n.failed||n.stopped?Ce(e):Ge().then(r=>{r?Rr(e):Ce(e)})},[Rr,$e,Ge,D]),Or=E(()=>Ce(null),[]),Er=E(()=>{Ce(e=>(e&&Rr(e),null))},[Rr]),Hr=E(async()=>{const e=Ae;if(!e)return;await gr()&&(Ce(null),Rr(e))},[Ae,gr,Rr]),Ar=E(async e=>{if(null!==Re.current)return;if(!ke)return;if(!p(Ye.current)||De.current)return;const r=ae(e);if(!await kr(ke,r))return void(De.current||cr("storefront-editor:save-failed"));const n=oe.publish;if(!ue.canPublish||!n)return void cr("storefront-editor:saved");const t=await fr(()=>n(ke,Me.current??void 0));if(!t.ok){const{error:e}=t;return void cr("storefront-editor:publish-failed",{reason:e instanceof Error&&e.message?e.message:null})}Me.current=t.value.version??Me.current,cr("storefront-editor:published")},[ke,oe,ue.canPublish,cr,kr,fr,ae]);/* @__PURE__ */
|
|
2
|
-
return C(N.Provider,{value:{target:G,adapter:oe,capabilities:ue,templateId:ee,currentSlug:re,currentKind:ge,siteId:ne,ready:de,token:ie,tokenRef:le,notifyParent:cr,bridgeCapabilities:ce,runAuthed:mr,docId:ke,data:he,getLiveData:()=>He.current??he,error:Ie,redirecting:sr,saveStatus:rr,saveState:Ze,autoSaveEnabled:!Ze.paused,autoSaveStoppedByConflict:Ze.stopped,hasUnsavedEdits:Ze.pending||Oe,toggleAutoSave:Pr,retrySave:jr,onChange:vr,flushSave:gr,onPublish:Ar,access:Le,readOnly:null!==I(Le)||null!==Pe||null!==Ne,readOnlyReason:Pe,takeOverEditing:Sr,viewReadOnly:Ir,saveConflict:Ne,saveUnreachable:Fe,reloadFromServer:yr,navigate:Br,pendingNav:Ae,cancelPendingNav:Or,discardAndNavigate:Er,saveAndNavigate:Hr},children:F})}export{N as ScreenDocumentContext,F as ScreenDocumentProvider,T as useScreenDocument};
|
package/dist/chunk-JPCOBNYW.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useSectionOps as o}from"./chunk-LSTOOYG7.js";import{SELECTION_MODE as e}from"./chunk-TGSK5VII.js";import{decodePartId as r,encodePartId as t}from"./chunk-R4AUZVA3.js";import{useEasel as n}from"./chunk-VBOSOH5M.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:I}){const{getSelectorForId:a}=n(o=>o),u=o(),{setSelectedPartId:f,setSelectHandler:k}=p(),l=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}),I?.(n)):i(o=>"part"===o.kind?e:o)},[i,I]);c(()=>{k(l)},[k,l]);const S=s(m)?t(m.nodeId,m.propKey):null;c(()=>{f(S)},[S,f]);return{selectNode:d(o=>{i(()=>e);const r=a(o);r&&u.select(r)},[i,a,u]),openPartId:S}}export{m as usePartBridge};
|
package/dist/chunk-MQA7OFRA.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createContext as e,useContext as n,useRef as r,useEffect as c}from"react";import{jsx as s}from"react/jsx-runtime";var t={connected:!1,ownsDocument:!0,send:()=>{},subscribe:()=>()=>{},address:{search:()=>"",show:()=>{},load:()=>{},reload:()=>{}}},o=e(t);function a({host:e,children:n}){/* @__PURE__ */
|
|
2
|
-
return s(o.Provider,{value:e,children:n})}function d(){return n(o)}function i(e,n){const s=d(),t=r(n);t.current=n,c(()=>{if(e&&s.claimEscape)return s.claimEscape(e=>"Escape"===e.key&&(t.current(),!0))},[e,s])}function l(e){const n=/* @__PURE__ */new Set;return{host:{connected:!0,ownsDocument:!1,send:(n,r)=>{e.onMessage({type:n,...r})},subscribe:e=>(n.add(e),()=>{n.delete(e)}),address:e.address,...e.claimEscape?{claimEscape:e.claimEscape}:null,...e.panels?{panels:e.panels}:null},deliver:e=>{for(const r of[...n])r(e)}}}export{t as DETACHED_EASEL_HOST,o as EaselHostContext,a as EaselHostProvider,l as createEaselHost,d as useEaselHost,i as useHostEscape};
|
package/dist/chunk-NQ7NRYTK.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{buildPaletteSections as e,pinnedSection as t,categoryLabel as n}from"./chunk-VKPOH6MK.js";import{blockTypesIn as o}from"./chunk-IZGFJWH4.js";import{sectionTemplatesOf as l}from"./chunk-N7E6264U.js";import{sharedSectionsOf as r}from"./chunk-N3MJOHAG.js";import{SidePanelHead as i,PanelModeExit as s}from"./chunk-SINAM2IT.js";import{blockRuns as c}from"./chunk-RUQOIQWI.js";import{useScreenBlockLook as a,useScreenBlockRules as d,useScreenPinned as p}from"./chunk-TGSK5VII.js";import{useEaselSession as m}from"./chunk-YM4UEGBV.js";import{DEFAULT_SCREEN_WORDS as f}from"./chunk-IYHO4XQX.js";import{useEasel as u}from"./chunk-VBOSOH5M.js";import{easelMenuEntries as y}from"./chunk-FIVU2COQ.js";import{useWords as h}from"./chunk-MFIRYGHW.js";import{AddPanel as k}from"./chunk-LN43DP2A.js";import{DEFAULT_DRAG_WORDS as g}from"./chunk-TQ5Y6S2X.js";import{useState as b,useEffect as v,useMemo as j,useRef as I}from"react";import{SharedIcon as O,AddIcon as w}from"efficient-shell/icons/efficient";import{ContextMenu as C,toast as M,Dialog as H,Button as S}from"efficient-shell/ui";import{jsx as T,jsxs as $,Fragment as x}from"react/jsx-runtime";function E({name:e,pages:t,onDelete:n,onCancel:o}){const l=h("screen",f).shared,[r,i]=b(!1),s=I(null);/* @__PURE__ */
|
|
2
|
-
return T(H,{open:!0,role:"alertdialog",size:"sm",title:l.deleteTitle({name:e}),onClose:o,initialFocus:s,footer:/* @__PURE__ */$(x,{children:[
|
|
3
|
-
/* @__PURE__ */T(S,{ref:s,variant:"secondary",onClick:o,children:l.cancel}),
|
|
4
|
-
/* @__PURE__ */T(S,{variant:"danger",loading:r,onClick:()=>{(async()=>{i(!0);try{await n()}finally{i(!1)}})()},children:l.deleteShared})]}),children:l.deleteMessage({count:t})})}var F=e=>`section:${e}`,A=e=>`block:${e}`,N=e=>`template:${e}`,B=e=>`shared:${e}`;function G({at:I,placeBlocks:H,canTake:S,onPick:G,itemFor:L,session:Q,siteWide:V,onClose:W,onHide:z,readOnly:D}){const P=u(e=>e.config),U=a(),{labelAtLevel:Y,categoryLabel:K,firstSection:R,Icon:X,Thumbnail:J}=U,{blockIsOffered:_,canAddTo:Z}=d(),q=h("screen",f).add,ee=h("drag",g).add,te=m(),[ne,oe]=b([]);v(()=>{let e=!1;const t=e=>_(e,te);return l(te).list().then(n=>{if(e)return;const l=P.components;oe(n.filter(e=>e.node?.type&&l[e.node.type]&&o(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[P,te]);const le=p().shared,re=h("screen",f).shared,[ie,se]=b([]),[ce,ae]=b(0);v(()=>{if(!le)return;let e=!1;const t=e=>_(e,te);return r(te).list().then(n=>{if(e)return;const l=P.components;se(n.filter(e=>e.node?.type&&l[e.node.type]&&o(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[P,te,ce]);const[de,pe]=b(null),[me,fe]=b(null),ue=j(()=>e(P,U),[P]),ye=e=>Y(e,"section",P.components[e]?.label??e),he=e=>({type:F(e.type),label:e.name,cover:/* @__PURE__ */T(J,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:q.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),ke=e=>{const t=e.indexOf(":"),n=e.slice(0,t),o=e.slice(t+1);if("section"===n)return{kind:"section",type:o};if("block"===n)return{kind:"block",type:o};if("template"===n){const e=ne.find(e=>e.id===o);return e?{kind:"template",template:e}:null}if("shared"===n){const e=ie.find(e=>e.id===o);return e?{kind:"shared",section:e}:null}return null},ge=e=>/* @__PURE__ */T("span",{className:"es-add-glyph-cover",children:/* @__PURE__ */T(X,{type:e,size:26})}),be=j(()=>{const e=t(ue,R),o=/* @__PURE__ */new Map,l=e=>{e.retired||o.has(e.type)||!_(e.type,te)||o.set(e.type,e)};for(const t of e?[e]:ue){const e=Z(t.type)?.choices??[];e.forEach(l),e.forEach(e=>Z(e.type,1)?.choices?.forEach(l))}H?.forEach(l);const r=new Set(ue.map(e=>e.type)),i=[...o.values()].filter(e=>!r.has(e.type)),s=e=>({type:A(e.type),label:e.label,cover:ge(e.type),title:q.tile({name:e.label}),keywords:[e.group??"",e.type].filter(Boolean)}),a=e=>o.has(e.type)?{...he(e),cover:ge(e.type)}:he(e),d=[];ie.length>0&&d.push({key:"shared",title:re.group,tiles:ie.map(e=>({type:B(e.id),label:e.title,cover:/* @__PURE__ */T(J,{type:e.node.type}),mark:/* @__PURE__ */T(O,{size:12}),title:re.onPages({count:e.used_on.length}),keywords:[ye(e.node.type),e.node.type]}))}),ne.length>0&&d.push({key:"templates",title:q.templates,tiles:ne.map(e=>({type:N(e.id),label:e.name,cover:/* @__PURE__ */T(J,{type:e.node.type}),keywords:[ye(e.node.type),e.node.type]}))});const p=i.filter(e=>!e.group);let m=!1;for(const t of Object.keys(P.categories??{})){const o=ue.filter(e=>e.cat===t);if(0===o.length)continue;const l=e&&o.some(t=>t.type===e.type)?e:null,r=(l?[l,...o.filter(e=>e.type!==l.type)]:o).map(a);l&&!m&&(r.splice(1,0,...p.map(s)),m=!0),d.push({key:`category:${t}`,title:n(P,t,K),tiles:r})}const f=d.find(e=>e.key?.startsWith("category:"));if(!m&&f&&p.length>0&&(f.tiles=[...f.tiles,...p.map(s)],m=!0),c(i.filter(e=>e.group||!m)).forEach((e,t)=>{d.push({key:`blocks:${t}`,title:e.group??"",tiles:e.items.map(s)})}),!S)return d;const u=d.map(e=>({...e,tiles:e.tiles.map(e=>{const t=ke(e.type),n=t?S(t):null;return n?{...e,disabled:!0,disabledReason:n}:e})})),y=e=>e.tiles.some(e=>!e.disabled);return[...u.filter(y),...u.filter(e=>!y(e))]},[ne,ie,re,ue,P,q,S,H,te]);/* @__PURE__ */
|
|
5
|
-
return $(x,{children:[
|
|
6
|
-
/* @__PURE__ */T(i,{icon:/* @__PURE__ */T(w,{size:15}),title:q.title,context:q.contextAll,actions:/* @__PURE__ */T(s,{label:q.done,description:q.doneDescription,onClick:W}),onHide:z}),
|
|
7
|
-
/* @__PURE__ */$("div",{className:"sf-addside sf-scroll",children:[
|
|
8
|
-
/* @__PURE__ */T(k,{groups:be,session:Q,itemFor:e=>L(ke(e)??{kind:"section",type:e}),onInsert:G?e=>{const t=ke(e);t&&G(t)}:void 0,onTileMenu:(e,t)=>{const n=ke(e);return"shared"===n?.kind&&!D&&(pe({section:n.section,...t}),!0)},at:I,hint:q.hint,searchLabel:q.search,readOnly:D,words:ee}),V??null]}),de?/* @__PURE__ */T(C,{at:{x:de.x,y:de.y},owner:de.owner,onClose:()=>pe(null),"aria-label":de.section.title,items:y([{label:re.deleteShared,danger:!0,onClick:()=>{fe(de.section),pe(null)}}])}):null,me?/* @__PURE__ */T(E,{name:me.title,pages:me.used_on.length,onDelete:()=>(async e=>{try{await r(te).remove(e.id)}catch{return void M.error(re.deleteFailed)}fe(null),le?.removed?.(e),se(t=>t.filter(t=>t.id!==e.id)),ae(e=>e+1)})(me),onCancel:()=>fe(null)}):null]})}export{G as AddSidePanel,A as blockKey,F as sectionKey,B as sharedKey,N as templateKey};
|
package/dist/chunk-S3DUFDQ6.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{SettingRow as e,Segmented as a,Tooltip as i}from"efficient-shell/ui";import{jsx as s,jsxs as l}from"react/jsx-runtime";function n({label:a,labelId:i,icon:l,value:n,hint:t,changed:c,htmlFor:d,action:o,children:r,className:b}){/* @__PURE__ */
|
|
2
|
-
return s(e,{size:"compact",label:a,labelId:i,icon:l,readout:n,description:t,changed:c,controlId:d,action:o,value:r,className:b})}function t({options:e,value:n,onChange:t,ariaLabel:c,fit:d,disabled:o=!1,className:r}){const b=d&&function(e,a){return{"--es-fit-count":e,"--es-fit-labels":`${a.labelsPx}px`,"--es-fit-widest":`${a.widestLabelPx}px`}}(e.length,d),m=e.findIndex(e=>e.id===n);
|
|
3
|
-
/* @__PURE__ */
|
|
4
|
-
return s("div",{className:"es-segs-fit","data-disabled":o||void 0,style:b,children:/* @__PURE__ */s(a,{size:"sm",label:c,className:`es-segs${b?" is-measured":""}${r?` ${r}`:""}`,value:m<0?"":String(m),onChange:a=>t(e[Number(a)].id),options:e.map((e,a)=>{const n=e.title??("string"==typeof e.label?e.label:void 0),t="string"!=typeof e.label,c=a=>n&&(e.icon||t)?/* @__PURE__ */s(i,{content:n,children:a}):a;return{value:String(a),disabled:o||!0===e.disabled,icon:e.icon?c(
|
|
5
|
-
/* @__PURE__ */s("span",{className:"es-seg-icon","aria-hidden":"true",children:e.icon})):void 0,label:t?/* @__PURE__ */l("span",{className:"es-seg-word",children:[c(/* @__PURE__ */s("span",{"aria-hidden":"true",children:e.label})),
|
|
6
|
-
/* @__PURE__ */s("span",{className:"es-vh",children:n})]}):/* @__PURE__ */s("span",{className:"es-seg-word",children:e.label})}})})})}export{n as SettingsField,t as SettingsSegmented};
|
package/dist/chunk-SSRYU3YG.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{textFieldIdentifier as n}from"./chunk-ANPOR6EY.js";import{hidableText as r}from"./chunk-6UAEFOJ4.js";function t(n,t){const o=r(n.props.name);if(o)return o;const e=r(n.props.altName);if(e)return e;const c=n.props.collection?.name;if(c)return c;const u=n.props.source?.title;if(u)return u;const s=n.props.code;return s?t?.(s)??s:""}function o(n,r,o,e,c){const u=o(t(n,e))||r(n.type);return c?c(n,"block",u):u}function e(r){if(!r)return null;for(const t of["name","altName"])if(n(r[t]))return t;return null}function c(r){const t=r?.name;return void 0===t||n(t)?"name":null}function u(n,t,o){const e=r(n.props?.name).trim()||t;return o?o(n,"section",e):e}export{u as rootRowName,c as sectionRenameProp,t as slotChildName,e as slotChildRenameProp,o as slotChildRowName};
|
package/dist/chunk-TGSK5VII.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{usePickFollowsSelection as n}from"./chunk-FHCKFOCD.js";import{slotFieldsOf as e}from"./chunk-TCAAOYQY.js";import{EaselCanvas as t,useSelectedFields as r}from"./chunk-VBOSOH5M.js";import{Inspector as i}from"./chunk-6QSFJCJT.js";import{createContext as o,useContext as u}from"react";import{DesktopIcon as l}from"efficient-shell/icons/efficient";import{jsx as s}from"react/jsx-runtime";var c={kind:"selection"};function f(n){return"selection"===n.kind}function a(n,e){if(f(n)&&f(e))return!0;const t=n,r=e,i=Object.keys(t);return i.length===Object.keys(r).length&&i.every(n=>Object.is(t[n],r[n]))}function d(n){const e=n;return"string"==typeof e.nodeId&&"string"==typeof e.slot}function p(n,t,r){const i=n.slotsOf?.(r);return i||e(t,r.type).map(n=>({slot:n,label:n,rung:!1}))}function m(n,e){return n.isFirst?n.isFirst(e):e.type===n.first}function k(n,e){return n.isLast?n.isLast(e):e.type===n.last}var h={},v=()=>h,g=()=>"",y=()=>null,b=()=>{},O={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},C={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},S={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */s(l,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},j={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},w={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function L(){/* @__PURE__ */
|
|
2
|
-
return s(t,{height:"fill"})}function D(){const{id:n,fields:e,values:t,readOnly:o,onChange:u}=r();/* @__PURE__ */
|
|
3
|
-
return s("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */s(i,{fields:e,values:t,onChange:u,readOnly:o,idPrefix:n})})}var F=o({});function B({parts:n,children:e}){/* @__PURE__ */
|
|
4
|
-
return s(F.Provider,{value:n,children:e})}function N(){return u(F)}function P(){return(N().useOwnerName??g)()}function T(){return(N().useDocumentLabel??y)()}function x(n,e,t,r){return(N().useBridges??v)(n,e,t,r)}function A(n){return(N().useStandaloneBridges??v)(n)}function G(n,e){(N().useDocumentPass??b)(n,e)}function I(){return N().blockRules??O}function H(){return N().blockLook??C}function J(){return N().devices??S}function K(){return N().leftView??j}function Q(){return N().pinned??w}function R(){return N().saveSwitch??!0}function V(e){n(!0===N().pickFollowsSelection,e)}function Y(){return N().storageNamespace||void 0}function M(){return N().styleClipboard??null}function Z(){return N().nodeKeys??!0}function q(){return N().notify??null}function z(){return N().Canvas??L}function E(){return N().CanvasHead??null}function U(){return N().canvasDrag??null}var W=o(null);function X({target:n,children:e}){/* @__PURE__ */
|
|
5
|
-
return s(W.Provider,{value:n,children:e})}function $(){return u(W)}function _(){return N().Inspector??D}export{c as SELECTION_MODE,X as ScreenCanvasTargetProvider,B as ScreenPartsProvider,m as isPinnedFirst,k as isPinnedLast,f as isSelectionMode,d as isSlotMode,a as sameInspectorMode,p as screenSlotsOf,H as useScreenBlockLook,I as useScreenBlockRules,x as useScreenBridges,U as useScreenCanvasDrag,z as useScreenCanvasFrame,E as useScreenCanvasHead,$ as useScreenCanvasTarget,J as useScreenDevices,T as useScreenDocumentLabel,G as useScreenDocumentPass,_ as useScreenInspectorPanel,K as useScreenLeftView,Z as useScreenNodeKeys,q as useScreenNotify,P as useScreenOwnerName,N as useScreenParts,V as useScreenPickFollowsSelection,Q as useScreenPinned,R as useScreenSaveSwitch,Y as useScreenStorageNamespace,M as useScreenStyleClipboard,A as useStandaloneScreenBridges};
|
package/dist/chunk-Z6V22QRZ.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import{cloneNodeWithFreshIds as e}from"./chunk-OXZDSOZV.js";import{dedupeSlotChildren as n}from"./chunk-7OCEPOEJ.js";import{styleClipboardOf as t}from"./chunk-DSKNJXB4.js";import{markedTreeNodeId as o,revealSelectedTreeRow as r,sameSelector as i}from"./chunk-UMBNBCL4.js";import{scrollPreviewToSection as l,gotoPreviewSlide as s}from"./chunk-DDH2DYQP.js";import{useEaselKeyTarget as d,useEaselUndoKeys as a,useEaselSaveKey as c,editorRootFocus as p}from"./chunk-T3LAGI43.js";import{SlotChildActionsProvider as u}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as h,DEFAULT_PANEL_W as f,clampPanelWidth as m}from"./chunk-C56MPJBH.js";import{usePartBridge as g}from"./chunk-JPCOBNYW.js";import{useSectionOps as y}from"./chunk-LSTOOYG7.js";import{ScreenSaveIcon as v,ScreenMainButton as b}from"./chunk-PY7OOQEZ.js";import{useBrowserOffline as k}from"./chunk-RKTF5XLP.js";import{AddChildRow as S}from"./chunk-5545A3PC.js";import{AddSidePanel as w}from"./chunk-NQ7NRYTK.js";import{keepsSharedSections as x,sharedSectionsOf as z}from"./chunk-N3MJOHAG.js";import{PanelHideButton as C,SidePanelHead as O,PanelShowStrip as N}from"./chunk-SINAM2IT.js";import{offeredChoices as I}from"./chunk-RUQOIQWI.js";import{useScreenSaveSwitch as B,useScreenNodeKeys as P,useScreenPinned as M,useScreenDocumentLabel as $,useScreenCanvasFrame as T,useScreenInspectorPanel as j,useScreenDevices as A,useScreenPickFollowsSelection as L,useScreenLeftView as E,SELECTION_MODE as R,isSelectionMode as D,sameInspectorMode as F,useScreenBridges as H,useScreenBlockRules as V,useScreenBlockLook as Y,useScreenStorageNamespace as W,useScreenNotify as U,useScreenCanvasHead as G,isSlotMode as J,useScreenStyleClipboard as X,useScreenDocumentPass as K,useScreenCanvasDrag as Q,ScreenCanvasTargetProvider as Z,isPinnedFirst as _,isPinnedLast as q,screenSlotsOf as ee}from"./chunk-TGSK5VII.js";import{MediaPopup as ne}from"./chunk-2G6MAXPY.js";import{useNodeClipboard as te,useNodeContextMenu as oe}from"./chunk-AT4DDMJS.js";import{PageEditGuardNotices as re}from"./chunk-GKG3M5QK.js";import{useScreenDocument as ie}from"./chunk-A6ZP5II4.js";import{requestMediaPick as le}from"./chunk-UNVKPVZW.js";import{useMediaPanel as se,usePanelPick as de,useMediaBrowsing as ae,useOpenMediaBrowse as ce,useMediaPlace as pe}from"./chunk-FHCKFOCD.js";import{useEaselSession as ue}from"./chunk-YM4UEGBV.js";import{useEaselHost as he,useHostEscape as fe}from"./chunk-MQA7OFRA.js";import{LayersIcon as me,MediaIcon as ge}from"./chunk-XFYFKITX.js";import{DEFAULT_SCREEN_WORDS as ye}from"./chunk-IYHO4XQX.js";import{heldStyle as ve,styleShortcut as be}from"./chunk-V7U33NF2.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as ke}from"./chunk-6WY6ZXJG.js";import{rootRowName as Se,slotChildRowName as we,slotChildRenameProp as xe,sectionRenameProp as ze}from"./chunk-SSRYU3YG.js";import{ROOT_ZONE as Ce,blockNodeActions as Oe,TREE_MAX_DEPTH as Ne,childSlotsOf as Ie,slotFieldsOf as Be,newNodeId as Pe,slotChildrenIn as Me,nestsInTree as $e}from"./chunk-TCAAOYQY.js";import{useEasel as Te,useEaselApi as je,CanvasPartsContext as Ae,partHasOwnBox as Le,CanvasPassThroughContext as Ee,CanvasSharedContext as Re}from"./chunk-VBOSOH5M.js";import{TreeRow as De,Subtree as Fe,LayersTree as He,TreeGroupLabel as Ve,TreeRowAction as Ye,TreeSeam as We}from"./chunk-WHS6Y55E.js";import{DEFAULT_TREE_WORDS as Ue}from"./chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as Ge}from"./chunk-WK3AFPXY.js";import{toItemSelector as Je,useNodeOps as Xe,clickPick as Ke}from"./chunk-RPMSET77.js";import{EaselTopBar as Qe,EaselIconButton as Ze,TopBarCluster as _e,DeviceSwitch as qe,InspectorIconButton as en,PanelResizeHandle as nn,MAX_PANEL_W as tn,MIN_PANEL_W_BY_SIDE as on,panelWidthVars as rn}from"./chunk-ZG6PVMC3.js";import{DEFAULT_NOTICE_WORDS as ln,DEFAULT_CHROME_WORDS as sn}from"./chunk-AJSDWWJW.js";import{holderOf as dn,nameOrSomeone as an}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as cn}from"./chunk-RE4LP46F.js";import{useWords as pn}from"./chunk-MFIRYGHW.js";import{insertSeams as un,CanvasDragLayer as hn,CanvasInsert as fn}from"./chunk-LN43DP2A.js";import{DEFAULT_DRAG_WORDS as mn}from"./chunk-TQ5Y6S2X.js";import{createDragSession as gn,useTreeDrag as yn,gapToMoveIndex as vn}from"./chunk-6NJHYXJM.js";import{useCanvasFrame as bn,LIST_SELECTOR as kn,BLOCK_SELECTOR as Sn,useCanvasTyping as wn,useCanvasEvent as xn,nodeIdAt as zn,frameRectToHost as Cn,BLOCK_ATTRIBUTE as On,drawnBox as Nn}from"./chunk-YU3WHLGI.js";import{queryMainCopy as In}from"./chunk-LF3FUSCQ.js";import{ROOT_ID as Bn,ROOT_SLOT as Pn,zoneKey as Mn,parseZoneKey as $n,find as Tn,DataError as jn}from"./chunk-TGZCD6IP.js";import{useRef as An,useMemo as Ln,useState as En,useEffect as Rn,useCallback as Dn,useLayoutEffect as Fn,useContext as Hn,Fragment as Vn,useId as Yn}from"react";import{ColoredBadge as Wn,Button as Un,Tabs as Gn,toast as Jn,readMediaFileDrag as Xn,Tooltip as Kn,groupColors as Qn,Dialog as Zn,FormField as _n,Input as qn,MEDIA_FILE_DRAG_TYPE as et}from"efficient-shell/ui";import{UndoIcon as nt,RedoIcon as tt,RefreshIcon as ot,AddIcon as rt,TrashIcon as it,EyeOffIcon as lt,EyeIcon as st,SharedIcon as dt,DuplicateIcon as at}from"efficient-shell/icons/efficient";import{jsx as ct,jsxs as pt,Fragment as ut}from"react/jsx-runtime";var ht="media-file";function ft({name:e,onMake:n,onCancel:t}){const o=pn("screen",ye).shared,[r,i]=En(e),[l,s]=En(!1),d=Yn(),a=An(null),c=async()=>{const e=r.trim();if(e&&!l){s(!0);try{await n(e)}finally{s(!1)}}};/* @__PURE__ */
|
|
2
|
-
return ct(Zn,{open:!0,size:"sm",title:o.makeShared,description:o.makeSharedHint,onClose:t,initialFocus:a,footer:/* @__PURE__ */pt(ut,{children:[
|
|
3
|
-
/* @__PURE__ */ct(Un,{variant:"secondary",onClick:t,children:o.cancel}),
|
|
4
|
-
/* @__PURE__ */ct(Un,{variant:"primary",loading:l,disabled:!r.trim(),onClick:()=>{c()},children:o.makeShared})]}),children:/* @__PURE__ */ct("form",{onSubmit:e=>{e.preventDefault(),c()},children:/* @__PURE__ */ct(_n,{label:o.name,htmlFor:d,children:/* @__PURE__ */ct(qn,{id:d,ref:a,value:r,onChange:e=>i(e.target.value)})})})})}var mt=/* @__PURE__ */new WeakSet;function gt(e,n,t){const o=Tn(e,n,t);if(!o)return null;const r=o.path.find(e=>"root"!==e.parentId);return r?r.parentId:t}function yt({canvas:e,tabs:n,onSelect:t}){const o=An(null),[r,i]=En({}),l=n.map(e=>`${e.id}:${e.below?1:0}`).join("|");return Fn(()=>{const t=e?.document,r=e?.window,l=e?.frame;if(!t||!r||!l||0===n.length)return void i({});let s=0;const d=()=>{s=0;const e=o.current;if(!e)return;const d=Cn(l,{left:0,top:0,width:r.innerWidth,height:r.innerHeight},e),a={};for(const o of n){const n=In(t,`[${On}="${r.CSS?.escape?r.CSS.escape(o.id):o.id}"]`),i=n?Nn(n):null;if(!i||0===i.height){a[o.id]=null;continue}const s=Cn(l,{left:i.left,top:i.top,width:i.width,height:i.height},e),c=s.top+s.height;if(c<d.top||s.top>d.top+d.height){a[o.id]=null;continue}const p=o.below?c+4:Math.max(s.top,d.top)+6;a[o.id]={left:Math.max(s.left,d.left)+6,top:p}}i(a)},a=()=>{s||(s=r.requestAnimationFrame(d))};d(),r.addEventListener("scroll",a,!0),r.addEventListener("resize",a);const c=new r.MutationObserver(a);return c.observe(t.body,{childList:!0,subtree:!0,attributes:!0}),()=>{s&&r.cancelAnimationFrame(s),r.removeEventListener("scroll",a,!0),r.removeEventListener("resize",a),c.disconnect()}},[e,l]),/* @__PURE__ */ct("div",{ref:o,className:"es-band-tabs","aria-hidden":"true",children:n.map(e=>{const n=r[e.id];return n?/* @__PURE__ */ct("span",{className:"es-band-tab","data-band-tab":e.id,style:{left:n.left,top:n.top},onClick:n=>{n.stopPropagation(),t(e.id)},children:e.reach?
|
|
5
|
-
/* @__PURE__ */ct(Kn,{content:e.reach,children:/* @__PURE__ */pt(Wn,{colorClass:Qn("success","solid"),size:"sm",children:[
|
|
6
|
-
/* @__PURE__ */ct("span",{className:"es-band-tab-mark",children:/* @__PURE__ */ct(dt,{size:12})}),e.label]})}):/* @__PURE__ */ct(Wn,{colorClass:Qn("info","solid"),size:"sm",children:e.label})},e.id):null})})}function vt({expand:e}){/* @__PURE__ */
|
|
7
|
-
return ct("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */pt(ut,e?{children:[
|
|
8
|
-
/* @__PURE__ */ct("path",{d:"M8 9l4-4 4 4"}),
|
|
9
|
-
/* @__PURE__ */ct("path",{d:"M8 15l4 4 4-4"})]}:{children:[
|
|
10
|
-
/* @__PURE__ */ct("path",{d:"M8 4l4 4 4-4"}),
|
|
11
|
-
/* @__PURE__ */ct("path",{d:"M8 20l4-4 4 4"}),
|
|
12
|
-
/* @__PURE__ */ct("path",{d:"M5 12h14"})]})})}var bt=`${kn}, ${Sn}`;function kt(e,n,t){const o=t-n;if(o<6)return null;if(o<24)return{top:Math.round((n+t)/2),height:Math.round(o)};return{top:Math.round(Math.min(Math.max(e,n+12),t-12))}}var St="__rungs";var wt="screen:band",xt={duplicate:!0,delete:!0},zt=()=>null;function Ct(){const kn=he(),Cn=kn.panels?.Toolbar,On=(kn.panels?.useRight??zt)(),{target:Nn,docId:Yn,capabilities:Kn,currentSlug:Qn,siteId:Zn,onPublish:_n,saveState:qn,saveConflict:dt,retrySave:Ct,toggleAutoSave:Ot,flushSave:Nt,access:It,saveUnreachable:Bt=!1,readOnly:Pt,readOnlyReason:Mt=null}=ie(),$t=B(),Tt=P(),{mediaEditing:jt,hasEditGuard:At,hasPinnedChrome:Lt}=Kn,{appState:Et,dispatch:Rt,history:Dt,selectedItem:Ft,getSelectorForId:Ht,config:Vt}=Te(e=>e),Yt=M(),{first:Wt,firstGroup:Ut,lastGroup:Gt,isSectionGroup:Jt,sectionGroupZone:Xt,panelOf:Kt}=Yt,Qt=Kt(Wt),Zt=e=>_(Yt,e),_t=e=>q(Yt,e),qt="node"===Yt.firstRow,eo=Yt.band??null,no=pn("screen",ye),to=pn("tree",Ue),oo=pn("drag",mn),ro=pn("notice",ln),io=pn("lock",cn),lo=pn("menu",Ge),so=pn("styleClipboard",ke),ao=pn("chrome",sn),co=$()??`/${Qn}`,po=T(),uo=j(),ho=y({readOnly:Pt}),fo=y({readOnly:Pt,foldIntoHistory:!0}),mo=An(null),go=je(),yo=Ln(()=>({...ho,select:e=>{mo.current=e,ho.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=go.config;mo.current=Je(e,t,n)}ho.commitDocument(e,n)}}),[ho,go]),vo=Et.ui,bo=vo.leftSideBarVisible,ko=vo.rightSideBarVisible,{options:So,widths:wo,initial:xo,fluid:zo,fit:Co}=A(),[Oo,No]=En(xo),Io=se(),Bo=jt&&null!==Io;de(),ae();const Po=ce();L(Ft?.props.id);const{read:Mo,write:$o,forSelection:To}=E(),[jo,Ao]=En(Mo);Rn(()=>{$o(jo)},[jo]);const[Lo,Eo]=En(0),Ro=An(null),Do=An(null),Fo=bn(Do,{readySelector:bt}),Ho=wn(Fo),Vo=d(Do);a(Do,Fo);const Yo=k(),Wo=dn(It),Uo={state:qn,offline:Yo||qn.failed&&Bt,readOnlyReason:Mt,editing:Wo?ro.editing({name:an(Wo.name,io),noun:no.noun}):null,conflict:null!=dt,notSaving:no.bar.notSaving},Go=()=>{Pt||(qn.failed?Ct():Nt())};c(Do,Fo,Go);const[Jo,Xo]=En(!1),Ko=An(!1),[Qo,Zo]=En(null),[_o,qo]=En([]),[er,nr]=En(R);D(er);const tr=o(er,Ft?.props.id),[or,rr]=En(null);Rn(()=>{or&&(r(),rr(null))},[or]);const ir=An(Ht);ir.current=Ht;const lr=Dn((e,{scroll:n})=>{Ao(n=>To(e,n)),n&&rr(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=ir.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&Ar(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),sr=An(null);Rn(()=>{const e=sr.current;sr.current=null;const n=null==Ft?.props.id?null:String(Ft.props.id);nr(t=>e&&e.id===n?e.mode:"part"===t.kind&&"nodeId"in t&&t.nodeId===n?t:Kt(Ft?.type)??R);const t=Ft?.props.id,o=mo.current;if(mo.current=null,!t)return;const r=Ht(t);lr(String(t),{scroll:!i(o,r??null,Ce)})},[Ft?.props.id,lr]);const dr=Dn(e=>{nr(n=>F(n,e)?n:e),Rt({type:"setUi",ui:{rightSideBarVisible:!0}})},[Rt]),ar=An(()=>{});ar.current=(e,n)=>{const t=e?Pi(e.zone??Ce)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==Ft?.props.id?null:String(Ft.props.id);nr(e=>F(e,n)?e:n),o!==r&&(sr.current={id:o,mode:n},yo.select(e))};const cr=Dn((e,n)=>ar.current(e,n),[]),pr={kind:er.kind,mode:er,open:dr,show:e=>nr(e),reveal:()=>{ko||Rt({type:"setUi",ui:{rightSideBarVisible:!0}})},select:cr},ur=H(pr,{data:Et.data,selected:Ft??null,zoneOf:e=>Ht(e)?.zone,readOnly:Boolean(Pt),select:e=>{nr(R),yo.select({index:e})},replace:(e,n)=>yo.replaceComponent(Ce,e,n),scrollTo:e=>l(e)},{device:Oo,refreshes:Lo},{setView:Ao,reveal:()=>{bo||Rt({type:"setUi",ui:{leftSideBarVisible:!0}})}}),hr=ur.resolveLeftView?ur.resolveLeftView(jo):"sections",fr=V(),{isLockedBlock:mr,duplicateBlocked:gr,nestDepth:yr,newSectionNode:vr,canAddTo:br,blockIsOffered:kr}=fr,Sr=Y(),{labelAtLevel:wr,Icon:xr,useProducts:zr}=Sr,Cr=Sr.rowName?(e,n,t)=>Sr.rowName(e,n,t):void 0,Or=Dn(e=>{Rt({type:"setUi",ui:{rightSideBarVisible:!0}}),l(e),lr(e,{scroll:!0})},[Rt,lr]),{selectNode:Nr,openPartId:Ir}=g({mode:er,setMode:nr,onOpenPart:Or}),[Br,Pr]=En(null);fe(null!==Br,()=>Pr(null));const Mr=h(W()),$r=Mr.collapsed,Tr=Mr.panelWidths,[jr,Ar]=En(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem($r);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
|
|
13
|
-
return new Set}});Rn(()=>{try{window.localStorage.setItem($r,JSON.stringify([...jr]))}catch{}},[jr]);const[Lr,Er]=En(()=>{if("undefined"==typeof window)return{...f};try{const e=window.localStorage.getItem(Tr);if(!e)return{...f};const n=JSON.parse(e);return{left:m(Number(n.left)||f.left,"left"),right:m(Number(n.right)||f.right,"right")}}catch{return{...f}}});Rn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(Tr,JSON.stringify(Lr))}catch{}},300);return()=>clearTimeout(e)},[Lr]);const Rr=Dn((e,n)=>Er(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),Dr=Dn(e=>Rr("left",e),[Rr]),Fr=Dn(e=>Rr("right",e),[Rr]),Hr=e=>jr.has(e),Vr=e=>Ar(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Yr=An(!1),Wr=An(null);Rn(()=>{if(Yr.current&&!Jo){const e=Wr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??Do.current?.querySelector(`button[aria-label="${CSS.escape(no.add.title)}"]`))?.focus(),Wr.current=null}Yr.current=Jo},[Jo]),Rn(()=>{if(!Jo||!Vo)return;const e=e=>{"Escape"===e.key&&dl()};return Vo.addEventListener("keydown",e),()=>Vo.removeEventListener("keydown",e)},[Jo,Vo]),fe(Jo,()=>dl()),Rn(()=>{!bo&&Jo&&(Xo(!1),Zo(null),Ko.current=!1)},[bo]);const Ur=U(),Gr=(e,n="success",t)=>{if(Ur)return void(t?Ur(e,"error"===n?"error":"info",t):Ur(e,"error"===n?"error":"info"));const o={sound:!1,action:t?.action,onClose:t?.onClose};"error"===n?Jn.error(e,{...o,duration:t?.duration??3200}):Jn.success(e,{...o,duration:t?.duration??1900})},Jr=An(null),[Xr,Kr]=En(0),[Qr,Zr]=En(0),_r=G(),qr=An(null),ei=e=>Math.max(0,e.clientHeight-(qr.current?.offsetHeight??0));Rn(()=>{const e=Jr.current;if(!e)return;const n=()=>{Kr(e.clientWidth),Zr(ei(e))};n();const t=new ResizeObserver(n);return t.observe(e),qr.current&&t.observe(qr.current),()=>t.disconnect()},[]),Fn(()=>{Jr.current&&(Kr(Jr.current.clientWidth),Zr(ei(Jr.current)))},[Lr,bo,ko]);const ni=Oo===zo?Xr>0?Xr:wo[zo]:wo[Oo],ti=Xr>0?Math.min(Xr/ni,"shrink"===Co?1:2):1,oi=ni*ti,ri=Xr>0&&oi>Xr+1,ii={width:oi,height:Qr||"100%",flex:"none",position:"relative"},li={width:ni,height:Qr?Qr/ti:"100%",maxHeight:"none",transform:1!==ti?`scale(${ti})`:void 0,transformOrigin:"top left"},si=()=>Rt({type:"setUi",ui:{leftSideBarVisible:!bo}}),di=()=>Rt({type:"setUi",ui:{rightSideBarVisible:!ko}}),ai=e=>{Jo&&(Xo(!1),Zo(null),Ko.current=!1,bo&&jo===e)||(Ao(e),bo||Rt({type:"setUi",ui:{leftSideBarVisible:!0}}))},ci=()=>{nr(Qt??R),ko||Rt({type:"setUi",ui:{rightSideBarVisible:!0}})},pi=Et.data.content??[],ui=()=>{const e=pi.findIndex(Zt),n=pi.findIndex(_t);return{floor:e>=0?e+1:0,cap:n>=0?n:pi.length}},hi=Vt,fi=fr.stripCopy,mi=n=>e(n,fi),gi=te(),yi=Xe({data:Et.data,config:hi,readOnly:Boolean(Pt),clipboard:gi,strip:fi?e=>fi(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==Bn||e.slot!==Pn)return{min:0,max:n-1};const{floor:t,cap:o}=ui();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&nr(R);const t=void 0===n||"node"===n?.kind?n:null;yo.commitDocument(e,t)}}),vi=ue(),[bi,ki]=En(null),Si=e=>{const n=pi.find(n=>String(n.props.id)===e),t=Yt.shared;n&&t&&yi.swap(e,t.detach(n))},wi=e=>{const n=Tn(Et.data,Vt,e);if(!n)return!1;const t=Mn(n.place),o=n.node,r=t===Ce?Ni(o):Hi(o),i=t===Ce?Yt.shared?.usedOn(o):null;return!!yi.remove(e)&&(Gr(i?no.shared.removed({count:Math.max(0,i.length-1)}):no.deleted({name:r}),"success",{duration:8e3,action:{label:no.bar.undo,onClick:()=>{yi.restore(n.node,n.place)}}}),!0)},xi={...yi,remove:wi},zi=e=>wr(e,"block",Vt.components[e]?.label??e),Ci=Dn(e=>Vt.components[e]?.defaultProps??{},[Vt]),Oi=e=>wr(e,"section",zi(e)),Ni=e=>Se({type:e.type,props:e.props??{}},Oi(e.type),Cr),{nodeAddresses:Ii,zoneItems:Bi}=Ln(()=>{const e=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map,t=(o,r,i)=>{n.set(r,o),o.forEach((n,o)=>{const l=String(n.props?.id??"");if(l&&e.set(l,{zone:r,index:o}),i>=Ne)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of Ie(Vt,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(pi,Ce,0),{nodeAddresses:e,zoneItems:n}},[pi,Vt]),Pi=Dn(e=>Bi.get(e)??[],[Bi]),Mi=e=>{const n=Ii.get(e);return n?Pi(n.zone)[n.index]:void 0},$i=e=>ee(fr,Vt,e),Ti=e=>{if(!fr.slotsOf||e===Ce)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=Mi(e.slice(0,n));if(!t)return null;const o=$i(t).filter(e=>e.rung),r=o.findIndex(t=>t.slot===e.slice(n+1));return r<0?null:{node:t,slot:o[r],position:r}},ji=(()=>{if(!J(er))return null;const e=`${er.nodeId}:${er.slot}`;return Ti(e)?.slot.panel===er.kind?e:null})(),Ai=An(null);Rn(()=>{const e=Ai.current;if(Ai.current=null,!ji||!J(er))return;const n=er.nodeId;lr(n,{scroll:e!==ji}),Ar(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[er]);const Li=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=Ii.get(e);n&&(n.zone===Ce?nl(n.index):Il(n.zone,n.index,e,Mi(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&ji!==i&&(Ai.current=i),cr(null,r),ko||Rt({type:"setUi",ui:{rightSideBarVisible:!0}}),l(o)},Ei=(e,n,t)=>{const o=`${e}:${n}`;if(Ar(n=>{if(!n.has(o)&&!n.has(e))return n;const t=new Set(n);return t.delete(o),t.delete(e),t}),!t)return;ji!==o&&(Ai.current=o);cr(null,{kind:t,nodeId:e,slot:n})},Ri=(e,n,t)=>{if(Pt||!fr.moveSlot)return;const o=Mi(e),r=o?$i(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:St,index:n},s=vn(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=fr.moveSlot(e,n,s);"string"==typeof d&&Ei(e,d,i.panel)},Di=zr(),Fi=Ln(()=>{const e=/* @__PURE__ */new Map;for(const n of Di??[])e.set(n.slug,n.name);return e},[Di]),Hi=e=>we(e,zi,Sr.plainText,e=>Fi.get(e),Sr.rowName),Vi=(e,n)=>{const t=Vt.components[e.type]?.fields,o=n===Ce||es(n)?"section":"block",r=n===Ce&&(Zt(e)||_t(e)||Jt(e.type)),i="block"===o?xe(t):r?null:ze(t);return Sr.renamePropOf?Sr.renamePropOf(e,o,i):i},Yi=(e,n,t,o)=>{if(!(!Pt&&Br?.zone===e&&Br.index===n))return;const r=(t,o)=>{Pr(null),o&&((e,n,t)=>{const o=Pi(e)[n];if(!o)return;const r=Vi(o,e);r&&yo.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
|
|
14
|
-
return ct("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":no.rename,onClick:e=>e.stopPropagation(),onBlur:e=>r(e.currentTarget.value,!0),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),r(e.currentTarget.value,!0)):"Escape"===e.key&&(e.preventDefault(),r("",!1))}},t)},Wi=t(X(),so),Ui=Wi.scope({target:Nn,siteId:Zn,docId:Yn}),Gi=Vt,Ji=(e,n)=>n===Ce?Oi(e):zi(e),Xi=(e,n,t)=>{const o=Wi.plan(Ui,t,Ji(t.type,e),Gi);o&&(o.changed&&yo.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),Gr(o.message))},Ki=oe({nodesIn:Pi,nodeAt:(e,n)=>Pi(e)[n]??null,labelOf:(e,n)=>n===Ce?Oi(e):zi(e),renamePropOf:Vi,beginRename:(e,n)=>Pr({zone:e,index:n}),history:{hasPast:Dt.hasPast,hasFuture:Dt.hasFuture,back:()=>Dt.back(),forward:()=>Dt.forward()},openPageStyles:ur.openPageStyles,pageStylesLabel:no.pageStyles,words:{menu:lo,styleClipboard:so,screen:no.menu},readOnly:Boolean(Pt),collapseAll:()=>Ar(new Set(Pi(Ce).map(e=>String(e.props.id)))),onPasteRefused:e=>Gr(e?no.pasteRefused({name:e.label}):no.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>os(e,n),menuRows:(e,n,t)=>{const o=ur.menuRows?.(e,n,t)??null,r=((e,n)=>{const t=Yt.shared;if(!t||n!==Ce)return null;const o=t.usedOn(e);if(o){const n={pick:[{label:no.shared.onPages({count:o.length}),onClick:()=>{},children:o.map(e=>({label:e.title,onClick:()=>t.openPage(e)}))}]};return Pt||mr(e.type,e)?n:{...n,change:[{label:no.shared.detach,onClick:()=>Si(e.props.id)}],remove:[{label:no.shared.removeFromPage,danger:!0,onClick:()=>{wi(e.props.id)}}]}}return Pt||Zt(e)||_t(e)||Jt(e.type)?null:x(vi)?{change:[{label:no.shared.makeShared,onClick:()=>ki({id:e.props.id,name:Ni(e)})}]}:null})(e,n);if(!r)return o;return Object.fromEntries(["pick","make","change","remove"].map(e=>[e,[...o?.[e]??[],...r[e]??[]]]).filter(([,e])=>e.length>0))},isLocked:e=>mr(e.type,e),duplicateBlocked:e=>gr(Et.data,e),permits:e=>{const n=Oe(Vt,e.type);return Yt.shared?.usedOn(e)?{...n,delete:!1}:n},nodeOps:xi,isPinned:(e,n)=>n===Ce&&(Zt(e)||_t(e)),sectionBand:ui,locate:e=>Ii.get(e)??null,rowNameOf:(e,n)=>n===Ce?Ni(e):Hi(e),selectAt:(e,n,t,o)=>{e===Ce?nl(n):Il(e,n,t,o??"")},slotRung:e=>{const n=Ti(e);return n?.slot.panel?{label:n.slot.label,select:()=>Li(n.node,n.slot,!1)}:null},style:{held:()=>ve(Ui),canCopy:e=>Wi.rows(Gi,e).some(e=>!1!==e.counted),copy:(e,n)=>Wi.copy(Ui,e,Ji(e.type,n),Gi),paste:(e,n,t)=>Xi(e,n,t)},keys:Tt?{target:Vo,selected:()=>{const e=Et.ui.itemSelector;return e?{zone:e.zone??Ce,index:e.index}:null},held:()=>gi.get(),readOnly:Boolean(Pt),onDone:({done:e,name:n})=>{"copied"===e&&Gr(no.copied({name:n}))}}:void 0},Fo),Qi=An({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});Rn(()=>{Qi.current={copy:(e,n)=>Wi.copy(Ui,e,Ji(e.type,n),Gi),paste:Xi,at:()=>{const e=Et.ui.itemSelector;if(!e)return null;const n=e.zone??Ce,t=Pi(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(Pt)}});const Zi=Dn(e=>{const n=be(e);if(!n)return;const t=Qi.current,o=t.at();o&&(e.preventDefault(),"copy"===n?t.copy(o.node,o.zone):t.readOnly||t.paste(o.zone,o.index,o.node))},[]);Rn(()=>{if(!Vo)return;const e=e=>Zi(e);return Vo.addEventListener("keydown",e),()=>Vo.removeEventListener("keydown",e)},[Zi,Vo]),xn(Fo,"keydown",Zi);const _i=pi.map(e=>e.props.id).join("|");Rn(()=>{const e=Fo?.document??null,n=Fo?.window??null;let t=0;const o=[],r=()=>{if(!e)return void qo(e=>e.length?[]:e);const n=pi.findIndex(_t),t=n>=0?n:pi.length,o=n=>{const t=pi[n]?.props?.id;return null==t?null:In(e,`[data-easel-block="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(Sn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=pi.length>0&&!Zt(pi[0])?0:1;e<=t;e++){const n=o(e),t=o(e-1),l=n?.getBoundingClientRect()??null,s=t?.getBoundingClientRect()??null;if(!l&&!s)continue;const d=kt(l&&s?(s.bottom+l.top)/2:l?0===e?l.top+12:l.top:s.bottom,Math.max(0===e?0:-1/0,...r(t).map(e=>e.bottom)),Math.min(1/0,...r(n).map(e=>e.top)));d&&i.push({...d,index:e})}qo(e=>function(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t].top!==n[t].top||e[t].index!==n[t].index||e[t].height!==n[t].height)return!1;return!0}(e,i)?e:i)},i=()=>{cancelAnimationFrame(t),t=requestAnimationFrame(r)};if(!e||!n)return void r();n.addEventListener("scroll",i,{passive:!0});const l=new ResizeObserver(i);return l.observe(e.documentElement),r(),o.push(setTimeout(r,150),setTimeout(r,450)),()=>{cancelAnimationFrame(t),o.forEach(clearTimeout),n.removeEventListener("scroll",i),l.disconnect()}},[Fo,_i,Oo,ti,bo,ko,Ft?.props.id]);const qi=Fo?.document??null,el=Fo?.window??null;Rn(()=>{const e=Ro.current;if(!e||!qi||!el)return;const n=[],t=()=>{const n=In(qi,`[data-easel-block="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&el.scrollTo({left:el.scrollX,top:el.scrollY+t,behavior:"instant"}),!0};return Ro.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[qi,el]);const nl=e=>{nr(R),yo.select({index:e}),ur.sectionPressed?.(pi[e]);const n=pi[e]?.props?.id;n&&l(n)},tl=e=>{const{floor:n,cap:t}=ui(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=Ft&&er.kind!==Qt?.kind?pi.findIndex(e=>e.props.id===Ft.props.id):-1;return o(r>=0?r+1:t)},ol=(e,n)=>{const{floor:t,cap:o}=ui(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(yo.reorderComponent(Ce,e,i),yo.select({index:i}),{moved:!0,dest:i})},rl=(e,n,t,o)=>{nr(R),yo.select(o?{index:o.index,zone:o.zone}:{index:e}),l(n),Gr(no.sectionAdded({name:t}))},il=(e,n)=>{const t=tl(n),o=vr(e,{nodeDefaults:Ci,newNodeId:Pe,sectionLabel:Oi,blockIsOffered:kr}),r=o?yo.insertNode(Ce,t,o):yo.insertSection(e,t);return rl(t,r,Oi(e),o?((e,n,t)=>{if(e.type===t)return null;const o={at:null},r=(e,n,i)=>{const l=i.filter(n=>n===e.type).length;for(const{child:s,zone:d,index:a}of Ie(Vt,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=br(e.type,l,d.slice(d.lastIndexOf(":")+1)),i=r?.choices??(r?.spec?[{type:r.spec.childType,label:r.spec.childType}]:[]);null!==r&&"footer"!==r.source&&`${e.props.id}:${r.slot}`===d&&i.some(e=>e.type===t)&&(o.at={zone:d,index:a,depth:n})}r(s,n+1,[...i,e.type])}};return r({type:e.type,props:{...e.props,id:n}},1,[]),o.at?{zone:o.at.zone,index:o.at.index}:null})(o,r,e):null),t},ll=e=>sl(Ce,e),sl=(e,n)=>{Wr.current=document.activeElement??null,Zo(null===n?null:{zone:e,index:n}),Xo(!0),bo||(Ko.current=!0,Rt({type:"setUi",ui:{leftSideBarVisible:!0}}))},dl=()=>{Xo(!1),Zo(null),Ko.current&&Rt({type:"setUi",ui:{leftSideBarVisible:!1}}),Ko.current=!1},al=(e,n)=>Sr.rowName?n?Zt(e)?Sr.rowName(e,"section",no.header):_t(e)?Sr.rowName(e,"section",no.footer):Jt(e.type)?Sr.rowName(e,"section",zi(e.type)):Ni(e):Hi(e):n?Oi(e.type):zi(e.type),cl=e=>n=>{e()},pl=(e,n,t)=>{if(Pt)return null;const o=Pi(e)[n];return o&&!Oe(Vt,o.type).delete||o&&mr(o.type,o)?null:/* @__PURE__ */ct(Ye,{kind:"delete",label:e===Ce&&o&&Yt.shared?.usedOn(o)?no.shared.removeFromPage:no.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=Pi(e)[n]?.props?.id;null!=t&&wi(String(t))})(e,n),children:/* @__PURE__ */ct(it,{size:15})})},ul=e=>Sr.rowPreview?.(e)||void 0,hl=e=>Sr.rowMarks?.(e)??void 0,fl=(e,n,t)=>Sr.rowActions?.(e,n,t)??null,ml=(e,n,t,o)=>{if(Pt)return null;if(mr(t.type,t))return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
|
|
15
|
-
return ct(Ye,{kind:"eye",label:r?no.showNamed({name:o}):no.hideNamed({name:o}),onClick:()=>yl(e,n,t),children:/* @__PURE__ */ct(r?lt:st,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},gl=e=>Xs(Ce,e),yl=(e,n,t)=>{yo.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},vl=e=>Be(Vt,e),bl=e=>Ie(Vt,e),kl=e=>fr.slotsOf?$i(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:Me(e,n.slot)})):[{slot:null,rung:null,kids:bl(e)}],Sl=e=>fr.slotsOf?kl(e).flatMap(e=>e.kids):bl(e),wl=e=>Boolean(fr.slotsOf)&&$i(e).some(e=>e.rung),xl=(e,n,t)=>null===t?void 0===n?br(e):br(e,n):br(e,n,t),zl=(e,n,t)=>{const o=$e(Vt,e.type,n)&&(t||Sl(e).length>0||wl(e));return{collapsible:o,folded:o&&Hr(String(e.props.id))}},Cl=(e,n,t)=>kl(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>zl(e,r,t(e.type)).collapsible?[String(e.props.id),...Cl(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),Ol=e=>Sl(e).length>0||wl(e)||Boolean(br(e.type)),Nl=e=>Boolean(br(e)),Il=(e,n,t,o)=>{if(nr(R),br(o)?.spec?.slider){const t=e.split(":")[0];s(t,n),yo.select({index:n,zone:e}),l(t)}else yo.select({index:n,zone:e}),l(t)},Bl=(e,n,t,o,r)=>{const i=`${e}:${n}`;yo.insertComponent(i,t,o),br(r)?.spec?.slider?requestAnimationFrame(()=>{s(e,o),yo.select({index:o,zone:i})}):yo.select({index:o,zone:i})},Pl=An(/* @__PURE__ */new Set);Rn(()=>{pi.forEach(e=>{const n=br(e.type)?.spec;if(!n)return;const t=e.props.id;if(Pl.current.has(t))return;Pl.current.add(t);if((Array.isArray(e.props[n.slot])?e.props[n.slot]:[]).length>0)return;if(n.skipSeed?.(e.props))return;const o=`${t}:${n.slot}`,r=n.legacy?.(e.props)??[];(r.length?r:n.seeds(Ci)).forEach((e,t)=>fo.seedChild(o,t,n.childType,e))})},[pi,fo,Ci]);const Ml=An(/* @__PURE__ */new Set);Rn(()=>{pi.forEach((e,t)=>{const o=e.props.id;if(Ml.current.has(o))return;const r=n(e,vl(e.type));Ml.current.add(o),r&&fo.replaceComponent(Ce,t,{...e,props:r})})},[pi,fo]),K(fo,Vt);const $l=pi.findIndex(_t),Tl=$l>=0?pi[$l]:null,jl=qt?pi.findIndex(Zt):-1,Al=jl>=0?pi[jl]:null,Ll=Yt.groupTab,El=Ln(()=>Ll?e=>Jt(e.type):void 0,[Ll]),Rl=Boolean(Yt.groupBadge),Dl=Yt.sharedReach,Fl=e=>Dl?.(e)??void 0,Hl=Ln(()=>Dl?new Set(pi.filter(e=>Fl(e)).map(e=>String(e.props.id))):null,[pi,Dl]),Vl=Ln(()=>Hl?e=>Hl.has(e):void 0,[Hl]),Yl=Yt.first?Dl?.({type:Yt.first,props:{id:""}})??void 0:void 0,Wl=Yt.groupBadge?/* @__PURE__ */ct("span",{className:"es-tree-group-badge",children:/* @__PURE__ */ct(Wn,{tone:"info",size:"xs",children:Yt.groupBadge})}):void 0,Ul=pi.find(e=>e.type===Ut)??null,Gl=pi.find(e=>e.type===Gt)??null,Jl=$l>=0?$l:pi.length,Xl=[];pi.forEach(e=>{_t(e)||(Ol(e)&&Xl.push(String(e.props.id)),Xl.push(...Cl(e,1,Nl)))}),Tl&&(Xl.push(String(Tl.props.id)),Xl.push(...Cl(Tl,1,Nl)));const Kl=Xl.length>0&&Xl.every(e=>jr.has(e)),Ql=e=>{const n=Sr.blockRowName(e,zi);return Sr.rowName?Sr.rowName(e,"block",n):n},Zl=(e,n,t,o)=>{const r=Pi(e)[t];if(!r)return;const i={...$n(e),index:t},l={...$n(n),index:Math.min(Math.max(o,0),Pi(n).length)},s=vn(i,l);if(e!==n||s!==t)try{yi.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof jn))throw e}},_l=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of bl(e))n.add(r),t(o)};for(const t of vl(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},ql=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Ii.get(n);if(!e)return null;if(e.zone===Ce)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},es=e=>{const n=e.slice(0,e.indexOf(":")),t=pi.find(e=>Jt(e.type)&&String(e.props.id)===n);return t&&Xt(n)===e?t:null},ns=(e,n)=>{const t=es(e);return!t||(!Yt.groupAccepts||Yt.groupAccepts(t.type,n,Pi(e).length))},ts=(e,n,t)=>{if(e.rung){const t=Mi(e.rung.nodeId),o=t?$i(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===St&&n.index>=0&&n.index<=o}if(n.slot===St)return!1;if(e.add)return ls(e.add,n);const o=Mn(n);if(Jt(e.type))return!1;const r=es(o),i=es(e.zone);if(r||i)return!(!r||!i)&&(!(r!==i&&!ns(o,e.type))&&(n.index>=0&&n.index<=Pi(o).length));if(e.zone===Ce||o===Ce){if(e.zone!==o)return!1;const{floor:t,cap:r}=ui();return n.index>=t&&n.index<=r}if(n.index<0||n.index>Pi(o).length)return!1;if(e.zone===o)return!0;const l=Tl&&!Yt.lastIsOpen?String(Tl.props.id):null;return(!l||ql(e.zone)!==l&&ql(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??Pi(e)[t];if(!r)return!1;const i=n.split(":")[0],l=Ii.get(i),s=l?Pi(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&_l(r).has(n))return!1;const d=br(s.type,yr(Et?.data,s.type,i),n.slice(n.lastIndexOf(":")+1));return!!d&&(!!(d.choices?d.choices.some(e=>e.type===r.type):d.spec?.childType===r.type)&&!d.spec?.addBlocked?.(Pi(n),r))})(e.zone,o,e.index,t)},os=(e,n)=>{const t=Mn(e.from),o=e.node;return t===Mn(n)?ns(t,o.type):ts({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},rs=e=>{const n=e.slice(0,e.indexOf(":")),t=Ii.get(n),o=t?Pi(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=br(o.type,yr(Et?.data,o.type,n),e.slice(e.lastIndexOf(":")+1));if(!r||`${n}:${r.slot}`!==e)return null;if("footer"===r.source)return null;const i=I(r.choices??(r.spec?[{type:r.spec.childType,label:zi(r.spec.childType)}]:[])),l=Ti(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:al(o,t.zone===Ce)}},is=(e,n)=>{if("section"!==e.kind)return e;const t=Mn(n);return t===Ce||es(t)?e:rs(t)?.choices.some(n=>n.type===e.type)?{kind:"block",type:e.type}:e},ls=(e,n)=>{const t=is(e,n),o=Mn(n);if("shared"===t.kind){if(o!==Ce||!Yt.shared?.nodeOf(t.section))return!1;const{floor:e,cap:r}=ui();return n.index>=e&&n.index<=r}if("block"!==t.kind){if(es(o)){const e="section"===t.kind?t.type:t.template.node.type;return ns(o,e)&&n.index>=0&&n.index<=Pi(o).length}if(o!==Ce)return!1;const{floor:e,cap:r}=ui();return n.index>=e&&n.index<=r}if(o===Ce)return!1;const r=rs(o);return!(!r||!r.choices.some(e=>e.type===t.type))&&!r.target.spec?.addBlocked?.(Pi(o))},ss=(e,n)=>{const t=is(e,n);if("block"!==t.kind&&es(Mn(n)))return void((e,n,t)=>{const o="section"===e.kind?e.type:"template"===e.kind?e.template.node.type:null;if(o&&ns(n,o)){if("section"===e.kind)yo.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;yo.insertNode(n,t,mi(e.template.node))}nr(R),yo.select({index:t,zone:n})}})(t,Mn(n),n.index);if("section"===t.kind)return void il(t.type,n.index);if("template"===t.kind)return void((e,n,t)=>{const o=tl(t),r=yo.insertNode(Ce,o,n);rl(o,r,e)})(t.template.name,mi(t.template.node),n.index);if("shared"===t.kind){const e=Yt.shared?.nodeOf(t.section);if(!e)return;const o=tl(n.index);return void(yi.restore(e,{parentId:Bn,slot:Pn,index:o})&&rl(o,e.props.id,t.section.title))}const o=Mn(n),r=rs(o);r&&(r.target.spec?Bl(r.parentId,r.target.slot,t.type,n.index,r.parent.type):((e,n,t)=>{yo.insertComponent(e,n,t),nr(R),yo.select({index:t,zone:e})})(o,t.type,n.index))},ds=(e,n)=>{e.media?function(e){const n=Ys();if(!n||!Fs)return;Us(n).then(n=>{n&&function(e,n){if(!Fs)return;const t=Fs.create(e,{nodeDefaults:Ci,newNodeId:Pe,sectionLabel:Oi,blockIsOffered:kr}),o=Mn(n);if(o===Ce){const e=tl(n.index),o=yo.insertNode(Ce,e,t);return void rl(e,o,Oi(t.type))}yo.insertNode(o,n.index,t),nr(R),yo.select({index:n.index,zone:o})}(n,e)})}(n):e.rung?Ri(e.rung.nodeId,e.index,n.index):e.add?ss(e.add,n):e.zone===Ce?ol(e.index,n.index):Zl(e.zone,Mn(n),e.index,n.index)},[as]=En(()=>gn()),cs=yn({keyOf:e=>e.id,readOnly:Boolean(Pt),session:as,canDrop:ts,onDrop:ds,onStep:(e,n)=>{e.rung?Ri(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===Ce?((e,n)=>{const t=Oi(pi[e]?.type??""),o=ol(e,n<0?e-1:e+2);if(!o.moved)return void Gr(n<0?no.sectionFirst({name:t}):no.sectionLast({name:t}));const{floor:r,cap:i}=ui();Gr(no.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):Zl(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),ps=Dn(e=>{const{floor:n,cap:t}=ui(),o=[];for(const r of e.nodes){const e=Mn(r.place),i=Pi(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(Zt(i)||_t(i)||mr(i.type,i))continue;if(Jt(i.type))continue;const l=Boolean(es(e)),s=e===Ce||l;e===Ce&&t-n<2||o.push({key:r.id,item:{id:r.id,zone:e,index:r.place.index,type:i.type},box:r.box,label:s?Oi(i.type):Hi(i),from:r.place})}const r=e.zones.flatMap(e=>{const n=Mn(e.list);if(n===Ce&&0===e.children.length)return[{...e,addLabel:no.addSection,addAlways:!0}];const t=rs(n),o=t?.target.spec?.addLabel;return e.children.length>0||Boolean(t?.choices.length)||Boolean(es(n))?[o?{...e,addLabel:o}:e]:[]}),i=r.flatMap(e=>{const n=Mn(e.list),t=n===Ce||es(n)?null:rs(n);return t?.choices.length?un(e,t.target.spec?.addLabel??no.addBlockHere):[]});return{sources:o,zones:r,seams:i}},[Et.data]),us=null==Ft?.props.id?null:String(Ft.props.id),hs=Hn(Ae),fs=hs?.selected()&&Fo?.document&&us?hs.selectedPart?.(Fo.document)??null:null,ms=fs&&us&&Le(Et.data,Vt,us,fs)?fs:null,gs=ms?.label?{element:ms.element,label:ms.label}:null,ys=null!==ms,vs=Dn(e=>{const n=Vt,t=e=>!e.item.rung&&null!==Tn(Et.data,n,e.item.id),o=e[e.length-1];if(!t(o))return o;const r=n=>e.find(e=>t(e)&&e.item.id===n),i=r(us);return i?ys?null:i:r(Ke(Et.data,n,o.item.id,us,El))??o},[Et.data,Vt,us,El,ys]),[bs,ks]=En(null),Ss=Boolean(Ll||Dl);xn(Fo,"mouseover",e=>{if(!Ss)return;const n=zn(e.target),t=n?gt(Et.data,Vt,n):null;t!==bs&&ks(t)}),xn(Fo,"mouseout",e=>{Ss&&!e.relatedTarget&&ks(null)});const ws=e=>Zt(e)||_t(e)||Jt(e.type),xs=e=>{const n=Jt(e.type)?zi(e.type):Zt(e)?no.header:_t(e)?no.footer:null;return null===n?Ni(e):Sr.rowName?Sr.rowName(e,"section",n):n},zs=[];if(Ss){const e=us?gt(Et.data,Vt,us):null;for(const n of/* @__PURE__ */new Set([e,bs])){const e=n?pi.find(e=>String(e.props.id)===n):void 0;if(!e)continue;const t=Zt(e)||e.type===Ut,o=Fl(e);if(o){zs.push({id:String(e.props.id),label:xs(e),below:t,reach:o});continue}if(!Ll||!ws(e))continue;const r=Ll(e);r&&zs.push({id:String(e.props.id),label:r,below:t})}}const Cs=ue(),Os=An(null);Rn(()=>{const e=Yt.changeNotice;if(!e)return;const n=JSON.stringify(pi.filter(ws)),t=Os.current;if(Os.current={doc:Yn,bands:n,index:Dt.index},!t||t.doc!==Yn||t.bands===n)return;Dt.hasPast&&Dt.index>=t.index&&!mt.has(Cs)&&(mt.add(Cs),Gr(e,"success",{action:{label:no.bar.undo,onClick:()=>Dt.back()},duration:8e3}))},[pi]);const Ns=e=>{nr(R),yo.select(e.zone===Ce?{index:e.index}:{index:e.index,zone:e.zone})},Is=Q(),Bs=()=>({data:Et.data,device:Oo,ops:yo,inspector:pr}),Ps=Is?.model,Ms=Ln(()=>Ps?e=>Ps(e,ps(e),Bs()):ps,[Ps,ps,Oo]),$s=Is?.measure,Ts=$s?(e,n)=>$s(e,n,Bs()):void 0,js=Is?.canDrop,As=js?(e,n)=>js(e,n,ts,Bs()):ts,Ls=Is?.drop,Es=Ls?(e,n)=>Ls(e,n,ds,Bs()):ds,Rs=Is?.pick,Ds=Rs?e=>Rs(e,Ns,Bs()):Ns,Fs=Is?.media??null,Hs=An(null),Vs=Ln(()=>Fs?{id:ht,zone:"",index:-1,type:Fs.adds.type,add:{kind:Fs.adds.kind,type:Fs.adds.type},media:!0}:null,[Fs]);Rn(()=>{if(!Vs||Pt||"undefined"==typeof document)return;const e=e=>{(e=>Array.from(e.dataTransfer?.types??[]).includes(et))(e)&&(Hs.current=null,as.start({key:ht,item:Vs}))},n=e=>{as.get()?.item.media&&(Hs.current=Xn(e.dataTransfer))},t=()=>{as.get()?.item.media&&as.end()};return document.addEventListener("dragstart",e),document.addEventListener("drop",n,!0),document.addEventListener("dragend",t,!0),()=>{document.removeEventListener("dragstart",e),document.removeEventListener("drop",n,!0),document.removeEventListener("dragend",t,!0)}},[Vs,Pt,as]);const Ys=()=>{const e=Hs.current;return Hs.current=null,e},Ws=pe(),Us=async e=>{if(!Ws)return e;const n=await Ws(e);return n?{...e,id:n.id,url:n.url}:null};const Gs=(e,n)=>{if(!Fs)return;const t=Tn(go.getState().appState.data,hi,n);if(!t)return;const o=t.node;yo.replaceComponent(Mn(t.place),t.place.index,{...o,props:{...Fs.replace(o,e),id:o.props.id}})},Js=e=>{const n=Mn(e),t=Ti(n);t&&Li(t.node,t.slot,!1),sl(n,e.index)},Xs=(e,n)=>/* @__PURE__ */ct(We,{...Pt?{}:cs.seam({place:{...$n(e),index:n}})},`seam:${e}:${n}`),Ks={rowClick:cl,isCollapsed:Hr,toggleCollapse:Vr},Qs=e=>{const n=String(e.props.id),t=pi.findIndex(e=>String(e.props.id)===n),o=Xt(n),r=Pi(o),i=Hr(n),l=zi(e.type),s=Sr.rowName?Sr.rowName(e,"section",l):l,d=e=>Xs(o,e);/* @__PURE__ */
|
|
16
|
-
return pt(ut,{children:[
|
|
17
|
-
/* @__PURE__ */ct(De,{words:to,icon:/* @__PURE__ */ct(xr,{type:e.type,size:13}),name:s,preview:ul(e),marks:hl(e),onSelect:()=>nl(t),nameSlot:Yi(Ce,t,n,s),selected:tr===n,badge:Fl(e)?void 0:Wl,shared:Fl(e),actions:fl(e,Ce,t)??void 0,rowProps:{"data-node-id":n,onClick:cl(()=>nl(t))},fold:{open:!i,label:"section",onToggle:()=>Vr(n)}}),!i&&/* @__PURE__ */pt(Fe,{children:[r.map((n,t)=>{const r=String(n.props.id),i=Ni(n),l=Ol(n),s=l&&Hr(r),a=()=>Il(o,t,r,e.type),{rowProps:c,...p}=cs.row({item:{id:r,zone:o,index:t,type:n.type},place:{...$n(o),index:t}},{"data-node-id":r,onClick:cl(a)});/* @__PURE__ */
|
|
18
|
-
return pt(Vn,{children:[d(t),
|
|
19
|
-
/* @__PURE__ */ct(De,{words:to,icon:/* @__PURE__ */ct(xr,{type:n.type,size:13}),name:i,preview:ul(n),marks:hl(n),onSelect:a,nameSlot:Yi(o,t,r,i),selected:tr===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Vr(r)}:void 0,actions:/* @__PURE__ */pt(ut,{children:[pl(o,t,i),fl(n,o,t),ml(o,t,n,i)]}),rowProps:c}),l&&!s&&/* @__PURE__ */ct(Fe,{children:qs(n,2)})]},r)}),d(r.length)]})]})},Zs=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=cs.dragging,d=!Hr(l)&&s?.rung?.nodeId!==i,a={...$n(l),index:0},c=s&&!s.rung&&ts(s,a)?a:void 0,p=()=>Li(e,n,!0),{rowProps:u,...h}=cs.row({item:{id:`rung:${l}`,zone:`${i}:${St}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:St,index:t},into:c,canDrag:Boolean(fr.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:cl(p)}),f=Pt?null:fr.slotActions?.(e,n.slot);/* @__PURE__ */
|
|
20
|
-
return pt(Vn,{children:[n.heading,
|
|
21
|
-
/* @__PURE__ */ct(De,{words:to,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:ji===l,...h,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>Vr(l)},actions:f&&f.length>0?/* @__PURE__ */ct(ut,{children:f.map((t,o)=>/* @__PURE__ */ct(Ye,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(Pt||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&Ei(o,e,n.panel)},i=t.run();i&&"function"==typeof i.then?i.then(r):r(i)})(e,n,t),children:"delete"===t.kind?/* @__PURE__ */ct(it,{size:15}):/* @__PURE__ */ct(at,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */ct(Fe,{children:r})]},l)},_s=(e,n)=>{const t=kl(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
|
|
22
|
-
return ct(ut,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=xl(e.type,void 0,t.slot),d=s?`${e.props.id}:${s.slot}`:null,a=null===t.slot?null:`${e.props.id}:${t.slot}`,c=(e,n)=>Xs(e,n),p=/* @__PURE__ */pt(ut,{children:[i.map(({child:n,zone:t,index:o})=>{const r=tr===String(n.props.id),{collapsible:i,folded:s}=zl(n,l,Nl(n.type)),d=String(n.props.id),a=Ql(n),p=()=>Il(t,o,d,e.type),{rowProps:u,...h}=cs.row({item:{id:d,zone:t,index:o,type:n.type},place:{...$n(t),index:o}},{"data-node-id":d,onClick:cl(p)});/* @__PURE__ */
|
|
23
|
-
return pt(Vn,{children:[0===o&&c(t,0),
|
|
24
|
-
/* @__PURE__ */ct(De,{words:to,icon:/* @__PURE__ */ct(xr,{type:n.type,size:13}),name:a,preview:ul(n),marks:hl(n),onSelect:p,nameSlot:Yi(t,o,d,a),selected:r,hidden:Boolean(n.props._hidden),...h,fold:i?{open:!s,label:"group",onToggle:()=>Vr(d)}:void 0,actions:/* @__PURE__ */pt(ut,{children:[pl(t,o,a),fl(n,t,o),ml(t,o,n,a)]}),rowProps:u}),i&&!s&&/* @__PURE__ */ct(Fe,{children:_s(n,l+1)}),c(t,o+1)]},String(n.props.id??`${t}-${o}`))}),null===a?d&&!i.some(e=>e.zone===d)?c(d,0):null:0!==i.length||!t.rung&&d!==a?null:c(a,0)]});return t.rung?Zs(e,t.rung,r++,o,p):/* @__PURE__ */ct(Vn,{children:p},t.slot??"")})})},qs=(e,n)=>{const t=yr(Et?.data,e.type,String(e.props.id)),o=kl(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
|
|
25
|
-
return ct(ut,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=xl(e.type,t,o.slot),a=d?.spec??null,c=a&&Array.isArray(e.props[a.slot])?e.props[a.slot]:[],p=d&&d.choices?{slot:d.slot,choices:d.choices}:null,u=String(e.props.id),h=a&&!a.fixed?`${u}:${a.slot}`:null,f=p?`${u}:${p.slot}`:null,m=(e,n)=>Xs(e,n),g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(a&&!a.fixed&&(null===g||g===h)),v=/* @__PURE__ */pt(ut,{children:[l.map(({child:n,zone:t,index:o})=>{const r=tr===String(n.props.id),i=Hi(n),l=String(n.props.id),{collapsible:d,folded:a}=zl(n,s,Nl(n.type)),c=vl(n.type),p=1===c.length?`${l}:${c[0]}`:null,u=p?{...$n(p),index:Pi(p).length}:void 0,h=cs.dragging,f=u&&h&&ts(h,u)?u:void 0,g=()=>Il(t,o,l,e.type),{rowProps:y,...v}=cs.row({item:{id:l,zone:t,index:o,type:n.type},place:{...$n(t),index:o},into:f,canDrag:!mr(n.type,n)},{"data-node-id":l,onClick:cl(g)});/* @__PURE__ */
|
|
26
|
-
return pt(Vn,{children:[0===o&&m(t,0),
|
|
27
|
-
/* @__PURE__ */ct(De,{words:to,icon:/* @__PURE__ */ct(xr,{type:n.type,size:13}),name:i,preview:ul(n),marks:hl(n),onSelect:g,nameSlot:Yi(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...v,fold:d?{open:!a,label:"group",onToggle:()=>Vr(l)}:void 0,actions:mr(n.type,n)?fl(n,t,o)??void 0:/* @__PURE__ */pt(ut,{children:[pl(t,o,i),fl(n,t,o),ml(t,o,n,i)]}),rowProps:y}),d&&!a&&/* @__PURE__ */ct(Fe,{children:qs(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&a&&
|
|
28
|
-
/* @__PURE__ */ct(S,{small:!0,label:a.addLabel,blocked:a.addBlocked?.(c)??null,onAdd:()=>Bl(e.props.id,a.slot,a.childType,c.length,e.type)}),null===g?f&&!l.some(e=>e.zone===f)?m(f,0):null:0!==l.length||(o.rung?y:g!==f)?null:m(g,0)]});return o.rung?Zs(e,o.rung,i++,r,v):/* @__PURE__ */ct(Vn,{children:v},o.slot??"")})})},ed=Jo,nd=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:bo&&!ed&&hr===e.id,onSelect:()=>ai(e.id)}:e,td=[...(ur.railLead??[]).map(nd),{id:"sections",label:no.layers,icon:/* @__PURE__ */ct(me,{}),active:bo&&!ed&&"sections"===hr,onSelect:()=>ai("sections")},...(ur.railTrail??[]).map(nd)],od=Bo?{onPress:Po}:jt?{onPress:()=>{le(kn,{accept:"image/*",title:ao.mediaLibrary})}}:null,rd={value:td.find(e=>!0===e.active)?.id??"",press:e=>{const n=td.find(n=>n.id===e);n&&!n.disabled&&!0!==n.active&&n.onSelect?.()},items:td.map(e=>({id:e.id,icon:e.icon,label:/* @__PURE__ */ct("span",{className:"sr-only",children:e.label}),tooltip:e.label,disabled:e.disabled}))},id=[...ur.railLead??[],...ur.railTrail??[]].find(e=>"panel"in e&&e.id===hr),ld=Boolean(eo?.foldable),sd=eo?.label??(At?no.pageSections:no.templateSections),dd=ld&&Hr(wt),ad=/* @__PURE__ */pt(ut,{children:[pi.map((e,n)=>{if(Zt(e)||_t(e)||Jt(e.type))return null;const t=tr===String(e.props.id),o=Boolean(e.props._hidden);bl(e);const r=String(e.props.id),i=ur.hasOwnRows?.(e)??!1,l=Ol(e)||i,s=l&&Hr(r),d=vl(e.type),a=1===d.length?`${r}:${d[0]}`:null,c=a?{...$n(a),index:Pi(a).length}:void 0,p=cs.dragging,u=c&&p&&ts(p,c)?c:void 0,{rowProps:h,...f}=cs.row({item:{id:r,zone:Ce,index:n,type:e.type},place:{...$n(Ce),index:n},into:u,canDrag:!mr(e.type,e)},{"data-node-id":r,onClick:cl(()=>nl(n))});/* @__PURE__ */
|
|
29
|
-
return pt(Vn,{children:[n>0&&gl(n),
|
|
30
|
-
/* @__PURE__ */ct(De,{words:to,icon:/* @__PURE__ */ct(xr,{type:e.type,size:13}),name:Ni(e),preview:ul(e),marks:hl(e),shared:Fl(e),onSelect:()=>nl(n),nameSlot:Yi(Ce,n,r,Ni(e)),selected:t,hidden:o,...f,fold:l?{open:!s,label:"section",onToggle:()=>Vr(r)}:void 0,actions:/* @__PURE__ */pt(ut,{children:[pl(Ce,n,Ni(e)),fl(e,Ce,n),ml(Ce,n,e,Ni(e))]}),rowProps:h}),Ol(e)&&!s&&/* @__PURE__ */pt(Fe,{children:[qs(e,1),ur.partRows?.(e,Ks)]}),i&&!s&&/* @__PURE__ */ct(Fe,{children:ur.ownRows?.(e,n,Ks)})]},String(e.props.id??n))}),Jl>0&&gl(Jl)]}),cd=(e,n,t)=>{const o=String(e.props.id),r=Sl(e).length>0||wl(e)||Boolean(br(e.type)),i=r&&Hr(o),l="header"===t?no.header:no.footer,s=Sr.rowName?Sr.rowName(e,"section",l):l;/* @__PURE__ */
|
|
31
|
-
return pt(ut,{children:[
|
|
32
|
-
/* @__PURE__ */ct(De,{words:to,icon:/* @__PURE__ */ct(xr,{type:t,size:13}),name:s,preview:ul(e),marks:hl(e),badge:Fl(e)?void 0:Wl,shared:Fl(e),onSelect:()=>nl(n),nameSlot:Yi(Ce,n,o,s),selected:tr===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Vr(o)}:void 0,actions:fl(e,Ce,n)??void 0,rowProps:{"data-node-id":o,onClick:cl(()=>nl(n))}}),r&&!i&&/* @__PURE__ */ct(Fe,{children:_s(e,1)})]})};return(ur.wrap??(e=>e))(
|
|
33
|
-
/* @__PURE__ */ct(Z,{target:Fo,children:/* @__PURE__ */pt("div",{ref:Do,className:"sf-editor es-editor",style:rn(Lr),onContextMenu:Ki.onEditorContextMenu,...p(kn),children:[
|
|
34
|
-
/* @__PURE__ */pt(Qe,{children:[
|
|
35
|
-
/* @__PURE__ */pt("div",{className:"es-cluster es-cluster--left",children:[od?/* @__PURE__ */ct(Un,{variant:"secondary",className:"es-barbtn",leftIcon:/* @__PURE__ */ct(ge,{}),onClick:od.onPress,children:no.railMedia}):null,
|
|
36
|
-
/* @__PURE__ */ct(Ze,{label:no.bar.undo,disabled:Boolean(Pt)||!Dt.hasPast,onClick:()=>Dt.back(),children:/* @__PURE__ */ct(nt,{})}),
|
|
37
|
-
/* @__PURE__ */ct(Ze,{label:no.bar.redo,disabled:Boolean(Pt)||!Dt.hasFuture,onClick:()=>Dt.forward(),children:/* @__PURE__ */ct(tt,{})})]}),
|
|
38
|
-
/* @__PURE__ */pt(_e,{children:[
|
|
39
|
-
/* @__PURE__ */ct(qe,{devices:So,value:Oo,onChange:No}),
|
|
40
|
-
/* @__PURE__ */ct(Ze,{label:no.bar.refresh,tip:no.bar.refreshTip,onClick:()=>{Ro.current=(()=>{const e=Fo?.document;if(!e)return null;const n=pi.findIndex(_t),t=n>=0?n:pi.length;let o=null;for(let n=0;n<t;n++){const t=pi[n]?.props?.id;if(null==t)continue;const r=In(e,`[data-easel-block="${CSS.escape(String(t))}"]`);if(!r)continue;const i=r.getBoundingClientRect().top;i<=4&&(null===o||i>o.offset)&&(o={id:String(t),offset:i})}if(!o){const e=Ft?.props?.id??pi[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),Eo(e=>e+1)},children:/* @__PURE__ */ct(ot,{})}),ur.barView?.()]}),
|
|
41
|
-
/* @__PURE__ */pt(_e,{kind:"right",style:{minWidth:300},children:[
|
|
42
|
-
/* @__PURE__ */ct(v,{input:Uo,words:no.saveStatus}),Cn?/* @__PURE__ */ct(Cn,{}):null,ur.barLead?.(),ur.barTrail?.(),ur.mainAction||!ur.barMain?/* @__PURE__ */ct(b,{input:Uo,action:ur.mainAction??{label:no.done,onPress:()=>{_n(Et.data)}},readOnly:Boolean(Pt),saveSwitch:$t,onToggleAutoSave:Ot,onSaveNow:Go,bar:no.bar,words:no.saveStatus}):ur.barMain()]})]}),
|
|
43
|
-
/* @__PURE__ */ct(re,{}),
|
|
44
|
-
/* @__PURE__ */pt("div",{className:"sf-body",children:[bo?/* @__PURE__ */pt(ut,{children:[
|
|
45
|
-
/* @__PURE__ */pt("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":no.leftPanel,children:[
|
|
46
|
-
/* @__PURE__ */pt("div",{className:"es-paneltabs es-paneltabs--with-hide",children:[
|
|
47
|
-
/* @__PURE__ */ct(C,{side:"left",onHide:si}),
|
|
48
|
-
/* @__PURE__ */ct("span",{className:"es-paneltabs-divider","aria-hidden":"true"}),
|
|
49
|
-
/* @__PURE__ */ct(Gn,{variant:"underline",block:!0,"aria-label":no.bar.views,value:rd.value,onChange:rd.press,items:rd.items})]}),Jo?/* @__PURE__ */ct(w,{at:Qo?{label:(e=>{const n=es(e.zone);if(n)return no.add.addingTo({name:Sr.rowName?al(n,!0):zi(n.type)});if(e.zone===Ce){const n=pi[e.index];return n&&!_t(n)?no.add.addingBefore({name:al(n,!0)}):no.add.addingAtEnd}const t=rs(e.zone);return t?no.add.addingTo({name:t.parentName}):no.add.addingHere})(Qo),onClear:()=>Zo(null)}:void 0,placeBlocks:Qo&&Qo.zone!==Ce?rs(Qo.zone)?.choices:void 0,canTake:Qo?e=>{if(!Qo)return null;const n={...$n(Qo.zone),index:Qo.index};if(ls(e,n))return null;if("shared"===e.kind&&Qo.zone===Ce&&!Yt.shared?.nodeOf(e.section))return no.shared.alreadyHere;const t=es(Qo.zone);if(t)return no.add.notInside({name:al(t,!0)});if(Qo.zone===Ce)return no.add.onlySections;const o=rs(Qo.zone);return o?no.add.notInside({name:o.parentName}):no.add.onlySections}:void 0,onPick:Qo?e=>{if(!Qo)return;const n={...$n(Qo.zone),index:Qo.index};ls(e,n)&&(ss(e,n),dl())}:void 0,itemFor:e=>({id:`new:${e.kind}:${"template"===e.kind?e.template.id:"shared"===e.kind?e.section.id:e.type}`,zone:"",index:-1,type:"template"===e.kind?e.template.node.type:"shared"===e.kind?e.section.node.type:e.type,add:e}),session:as,siteWide:ur.addPanelRow?.(dl),onClose:dl,readOnly:Boolean(Pt)}):id?id.panel({onHide:si,notify:Gr}):/* @__PURE__ */pt(ut,{children:[
|
|
50
|
-
/* @__PURE__ */ct(O,{icon:/* @__PURE__ */ct(me,{}),title:no.layers,context:co,actions:/* @__PURE__ */pt(ut,{children:[!Pt&&/* @__PURE__ */ct(en,{label:no.add.title,onClick:()=>ll(null),children:/* @__PURE__ */ct(rt,{size:15})}),
|
|
51
|
-
/* @__PURE__ */ct(en,{label:Kl?no.expandAll:no.collapseAll,title:0===Xl.length?no.nothingToFold:void 0,disabled:0===Xl.length,onClick:()=>Ar(e=>{const n=new Set(Xl);return Kl?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...Xl])}),children:/* @__PURE__ */ct(vt,{expand:Kl})})]})}),
|
|
52
|
-
/* @__PURE__ */pt(He,{className:"sf-tree sf-scroll",words:to,children:[Ul&&/* @__PURE__ */pt(ut,{children:[!Rl&&/* @__PURE__ */ct(Ve,{children:no.header}),Qs(Ul)]}),Lt&&!(Rl&&Ul)&&/* @__PURE__ */pt(ut,{children:[!Rl&&/* @__PURE__ */ct(Ve,{children:no.header}),!qt&&/* @__PURE__ */ct(De,{words:to,icon:/* @__PURE__ */ct(xr,{type:"header",size:13}),name:no.header,badge:Yl?void 0:Wl,shared:Yl,onSelect:ci,selected:er.kind===Qt?.kind,rowProps:{onClick:cl(ci)}})]}),Al&&!(Rl&&Ul)&&cd(Al,jl,"header"),!ld&&/* @__PURE__ */ct(Ve,{children:sd}),ld?/* @__PURE__ */pt(ut,{children:[
|
|
53
|
-
/* @__PURE__ */ct(De,{words:to,icon:null,name:sd,fold:{open:!dd,label:sd,onToggle:()=>Vr(wt)}}),!dd&&/* @__PURE__ */ct(Fe,{children:ad})]}):ad,Lt&&!Rl&&/* @__PURE__ */ct(Ve,{children:no.footer}),Tl&&!(Rl&&Gl)&&cd(Tl,$l,"footer"),Gl&&Qs(Gl),ur.treeFoot?.()]})]})]}),
|
|
54
|
-
/* @__PURE__ */ct(nn,{side:"left",width:Lr.left,min:on.left,max:tn,defaultWidth:f.left,label:no.resizeLeftPanel,onResize:Dr})]}):/* @__PURE__ */ct(N,{side:"left",onShow:si}),
|
|
55
|
-
/* @__PURE__ */pt("div",{ref:Jr,className:"sf-center sf-scroll","data-sf-canvas-head":_r?"":void 0,style:{overflowX:ri?"auto":"hidden",overflowY:"hidden"},children:[_r&&/* @__PURE__ */ct("div",{ref:qr,className:"sf-canvas-head",children:/* @__PURE__ */ct(_r,{device:Oo})}),
|
|
56
|
-
/* @__PURE__ */pt("div",{className:"sf-frame-scaler",style:ii,children:[
|
|
57
|
-
/* @__PURE__ */ct("div",{className:"sf-frame "+(Oo===zo?"":`sf-frame--${Oo}`),style:li,children:/* @__PURE__ */pt("div",{className:"sf-preview-host",children:[
|
|
58
|
-
/* @__PURE__ */ct(Ee.Provider,{value:El,children:/* @__PURE__ */ct(Re.Provider,{value:Vl,children:/* @__PURE__ */ct(po,{},Lo)})}),
|
|
59
|
-
/* @__PURE__ */ct(hn,{canvas:Fo,session:as,model:Ms,measure:Ts,canDrop:As,onDrop:Es,choose:vs,tag:gs,onPick:Ds,dropOn:Fs?{accepts:(e,n)=>{if(!e.media||!Fs||n.item.rung)return!1;const t=Tn(Et.data,hi,n.item.id);return null!==t&&Fs.takes(t.node)},onDrop:(e,n)=>(e=>{const n=Ys();n&&Fs&&Us(n).then(n=>{n&&Gs(n,e.item.id)})})(n),label:()=>no.canvasReplaceImage}:void 0,onZoneAdd:Js,onSeamAdd:Js,zoneAddLabel:no.canvasAddBlock,words:oo.canvas,readOnly:Boolean(Pt),revision:Et.data}),_o.length>0&&!Ho&&/* @__PURE__ */ct("div",{className:"sf-preview-gaps",children:_o.map(e=>
|
|
60
|
-
/* @__PURE__ */ct(fn,{index:e.index,label:no.addSectionHere,onInsert:()=>ll(e.index),className:void 0===e.height?"sf-preview-gap":"sf-preview-gap sf-preview-gap--tight",style:void 0===e.height?{top:e.top}:{top:e.top,height:e.height}},e.index))})]})}),Ss?/* @__PURE__ */ct(yt,{canvas:Fo,tabs:zs,onSelect:e=>{const n=pi.findIndex(n=>String(n.props.id)===e);n>=0&&nl(n)}}):null]})]}),ko?/* @__PURE__ */pt(ut,{children:[On?
|
|
61
|
-
/* @__PURE__ */ct("div",{className:"es-sidepanel es-sidepanel--right","data-es-host-panel":"",children:On}):/* @__PURE__ */ct(ut,{children:/* @__PURE__ */ct(u,{value:{selectChild:Il,addChild:Bl,childRowName:Hi,blockRowName:Ql},children:/* @__PURE__ */ct(uo,{mode:er,onOpenWebsiteSettings:ur.openSettings??(()=>{}),onOpenSiteStyles:ur.openStyles,onOpenPageStyles:ur.openPageStyles,onSelectNode:Nr,onNotify:Gr,onHidePanel:di,nodeActions:Ft?Oe(Vt,Ft.type):xt})})}),
|
|
62
|
-
/* @__PURE__ */ct(nn,{side:"right",width:Lr.right,min:on.right,max:tn,defaultWidth:f.right,label:no.resizeSettingsPanel,onResize:Fr})]}):
|
|
63
|
-
/* @__PURE__ */ct(N,{side:"right",onShow:di})]}),Ki.menu,
|
|
64
|
-
/* @__PURE__ */ct(ne,{}),bi?/* @__PURE__ */ct(ft,{name:bi.name,onMake:e=>(async(e,n)=>{const t=pi.find(n=>String(n.props.id)===e),o=Yt.shared;if(!t||!o)return;let r;try{r=await z(vi).create(n,t)}catch{return void Gr(no.shared.makeFailed,"error")}o.adopt(t,r),ki(null)})(bi.id,e),onCancel:()=>ki(null)}):null]})}))}export{Ct as ScreenChrome};
|
package/dist/chunk-ZG6PVMC3.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import{EaselRail as e}from"./chunk-MJM6SFD3.js";import{DEFAULT_NOTICE_WORDS as n,DEFAULT_CHROME_WORDS as i}from"./chunk-AJSDWWJW.js";import{DEFAULT_RAIL_WORDS as a}from"./chunk-2OAZYSWJ.js";import{holderOf as t,describeAge as s,nameOrSomeone as l}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as r}from"./chunk-RE4LP46F.js";import{useWords as o}from"./chunk-MFIRYGHW.js";import{jsx as c,jsxs as d}from"react/jsx-runtime";import{Tooltip as u,IconButton as h,Segmented as m,Switch as p,SpinnerRing as v,ResizeHandle as f,Button as k,Banner as b}from"efficient-shell/ui";import{useState as g,useEffect as y}from"react";import{LockIcon as w,CloudPauseIcon as N,CloudSlashIcon as O,CloudAlertIcon as x,CloudArrowUpIcon as B,CloudCheckIcon as z}from"efficient-shell/icons/efficient";function C({children:e}){/* @__PURE__ */
|
|
2
|
-
return c("div",{className:"es-topbar",children:e})}function R({kind:e,style:n,children:i}){/* @__PURE__ */
|
|
3
|
-
return c("div",{className:e?`es-cluster es-cluster--${e}`:"es-cluster",style:n,children:i})}function W(){/* @__PURE__ */
|
|
4
|
-
return c("div",{className:"es-divider-v","aria-hidden":"true"})}function S({items:n,ariaLabel:i,onWords:t}){const s=o("rail",a);/* @__PURE__ */
|
|
5
|
-
return c("div",{className:"es-cluster es-cluster--rail es-rail-fit",children:/* @__PURE__ */c(e,{items:n,ariaLabel:i??s.label,orientation:"row",onLabelsShown:t})})}function $({label:e,tip:n,onClick:i,disabled:a,state:t,buttonRef:s,children:l}){/* @__PURE__ */
|
|
6
|
-
return c(u,{content:n??e,side:"bottom",children:/* @__PURE__ */c(h,{ref:s,"aria-label":e,"aria-pressed":t?"active"===t:void 0,className:"es-iconbtn",disabled:a,onClick:i,children:l})})}function j({devices:e,value:n,onChange:a,ariaLabel:t}){const s=o("chrome",i);/* @__PURE__ */
|
|
7
|
-
return c(m,{className:"es-devseg",size:"sm",label:t??s.device,value:n,onChange:e=>{e!==n&&a(e)},options:e.map(e=>({value:e.id,icon:/* @__PURE__ */c(u,{content:e.label,side:"bottom",children:/* @__PURE__ */c("span",{className:"es-devseg-glyph","aria-hidden":"true",children:e.icon})}),label:/* @__PURE__ */c("span",{className:"es-vh",children:e.label})}))})}var L={idle:"is-quiet",saved:"is-quiet is-saved",saving:"is-saving",error:"is-error",off:"is-off","off-unsaved":"is-off is-unsaved"};function M({tone:e,label:n,counting:i,waitMs:a,ringRef:t,role:s}){/* @__PURE__ */
|
|
8
|
-
return d("span",{className:`es-savestate ${L[e]}`,role:s,"aria-live":"polite",children:[/* @__PURE__ */c("span",i?{ref:t,className:"es-savestate-ring is-counting",style:void 0!==a?{"--es-savewait":`${a}ms`}:void 0,"aria-hidden":"true"}:{className:"es-savestate-dot","aria-hidden":"true"}),n]})}function T({pressed:e,title:n,onToggle:i,children:a}){/* @__PURE__ */
|
|
9
|
-
return c("span",{className:"es-savestate-toggle",children:/* @__PURE__ */c(u,{content:n,side:"bottom",children:/* @__PURE__ */c(p,{size:"sm",checked:!e,"aria-label":n,label:a,onChange:()=>i()})})})}var Y={saved:{glyph:()=>/* @__PURE__ */c(z,{}),tone:"muted"},saving:{glyph:()=>/* @__PURE__ */c(v,{className:"",ink:"",style:{width:20,height:20}}),tone:"muted"},pending:{glyph:()=>/* @__PURE__ */c(B,{}),tone:"muted"},failed:{glyph:()=>/* @__PURE__ */c(x,{}),tone:"danger"},offline:{glyph:()=>/* @__PURE__ */c(O,{}),tone:"warning"},paused:{glyph:()=>/* @__PURE__ */c(N,{}),tone:"warning"},locked:{glyph:()=>/* @__PURE__ */c(w,{}),tone:"warning"}},J=e=>Y[e].tone;function P({state:e,label:n}){const i=Y[e],[a,t]=g(n);return y(()=>t(n),[e]),/* @__PURE__ */d("span",{className:"es-saveicon-wrap",children:[
|
|
10
|
-
/* @__PURE__ */c(u,{content:n,side:"bottom",describe:!1,children:/* @__PURE__ */c("span",{className:"es-saveicon",role:"img","aria-label":n,tabIndex:0,"data-save-state":e,"data-tone":i.tone,children:i.glyph()})}),
|
|
11
|
-
/* @__PURE__ */c("span",{className:"es-vh",role:"status","aria-live":"polite",children:a})]})}function A({side:e,width:n,min:a,max:t,defaultWidth:s,label:l,onResize:r}){const d=o("chrome",i);/* @__PURE__ */
|
|
12
|
-
return c(f,{side:e,width:n,min:a,max:t,defaultWidth:s,label:l,hint:d.resize,onResize:e=>r(e),className:`es-resizer es-resizer--${e}`})}function D({icon:e,name:n,kind:i,actions:a}){/* @__PURE__ */
|
|
13
|
-
return d("div",{className:"es-insp-head",children:[
|
|
14
|
-
/* @__PURE__ */c("span",{className:"es-insp-chip","aria-hidden":"true",children:e}),
|
|
15
|
-
/* @__PURE__ */d("div",{className:"es-insp-titles",children:[
|
|
16
|
-
/* @__PURE__ */c(u,{content:n,describe:!1,side:"bottom",className:"es-insp-name-tip",children:/* @__PURE__ */c("h2",{className:"es-insp-name",children:n})}),
|
|
17
|
-
/* @__PURE__ */c("div",{className:"es-insp-kind",children:i})]}),a?/* @__PURE__ */c("div",{className:"es-insp-actions",children:a}):null]})}function F({label:e,title:n,hasPopup:i,onClick:a,disabled:t,danger:s,expanded:l,buttonRef:r,children:o}){/* @__PURE__ */
|
|
18
|
-
return c(u,{content:n??e,side:"bottom",children:/* @__PURE__ */c(h,{ref:r,variant:s?"ghost-danger":"ghost",className:"es-insp-iconbtn","aria-label":e,"aria-haspopup":i,"aria-expanded":l,disabled:t,onClick:a,children:o})})}function H({name:e,onSelect:n,label:a,inline:t}){const s=o("chrome",i),l=a??s.upLevel,r=/* @__PURE__ */c(u,{content:l,side:"bottom",children:/* @__PURE__ */c(k,{variant:"link",size:"sm",className:"es-insp-up-btn","aria-label":s.upLevelTo({label:l,name:e}),leftIcon:/* @__PURE__ */c("span",{className:"es-insp-up-arrow","aria-hidden":"true",children:"←"}),onClick:n,children:/* @__PURE__ */c("span",{className:"es-insp-up-name",children:e})})});return t?r:/* @__PURE__ */c("div",{className:"es-insp-up",children:r})}function I({name:e,tier:n,of:a},t){const s={...i,...t};return{name:e,kind:"section"===n?s.tierSection:"block"===n?s.tierBlock:a?s.partOf({name:a}):s.tierBlock}}var q={notice:n,lock:r};function V(e,n,i,a=q){const r=a.notice,o=t(e),c={kind:"reload",label:r.reload};if(n){const e=s(n.secondsAgo,a.lock);return{tone:"warning",urgent:!0,lead:n.savedByYou?r.savedByYou({noun:i,when:e}):r.savedByOther({name:l(n.savedBy,a.lock),noun:i,when:e}),body:r.conflictBody,actions:o?[c,{kind:"take-over",label:r.takeOver,title:r.takeOverWhileDeciding}]:[c]}}if(!o)return null;const d=l(o.name,a.lock),u=s(o.secondsSinceSeen,a.lock);switch(e.kind){case"takenover":return{tone:"warning",urgent:!0,lead:r.tookOver({name:d,noun:i,when:s(o.secondsSinceHeld,a.lock)}),body:r.tookOverBody,actions:[{kind:"take-back",label:r.takeBack},c]};case"readonly":return{tone:"neutral",urgent:!1,lead:r.viewingOnly,body:r.viewingOnlyBody({name:d,noun:i,seen:u}),actions:[{kind:"take-over",label:r.takeOver}]};default:return{tone:"warning",urgent:!1,lead:r.editing({name:d,noun:i}),body:r.editingBody({seen:u}),actions:[{kind:"view-read-only",label:r.viewReadOnly},{kind:"take-over",label:r.takeOver,title:r.takeOverTold}]}}}function Z({access:e,conflict:i,noun:a,onTakeOver:t,onViewReadOnly:s,onReload:l}){const d=V(e,i,a,{notice:o("notice",n),lock:o("lock",r)});if(!d)return null;const h={reload:l,"take-over":t,"take-back":t,"view-read-only":s},m=d.actions.map(e=>e.title?/* @__PURE__ */c(u,{content:e.title,side:"bottom",children:/* @__PURE__ */c(k,{variant:"secondary",size:"sm",onClick:h[e.kind],children:e.label})},e.kind):/* @__PURE__ */c(k,{variant:"secondary",size:"sm",onClick:h[e.kind],children:e.label},e.kind));/* @__PURE__ */
|
|
19
|
-
return c("div",{className:`es-notice is-${d.tone}`,role:d.urgent?"alert":"status",children:/* @__PURE__ */c(b,{tone:"warning"===d.tone?"warning":"info",title:d.lead,action:/* @__PURE__ */c("span",{className:"es-notice-actions",children:m}),children:d.body})})}var E={left:288,right:320},G={left:240,right:220},K=G.right,Q=560;function U(e,n){const i=n?G[n]:K;return Math.min(560,Math.max(i,Math.round(e)))}function X(e){return{"--es-left-w":`${e.left}px`,"--es-right-w":`${e.right}px`}}function _(e,n){e.style.setProperty("--es-left-w",`${n.left}px`),e.style.setProperty("--es-right-w",`${n.right}px`)}export{E as DEFAULT_PANEL_W,j as DeviceSwitch,$ as EaselIconButton,C as EaselTopBar,Z as EditNotice,D as InspectorHead,F as InspectorIconButton,H as InspectorUpLevel,Q as MAX_PANEL_W,K as MIN_PANEL_W,G as MIN_PANEL_W_BY_SIDE,A as PanelResizeHandle,P as SaveIcon,M as SaveState,T as SaveStateToggle,R as TopBarCluster,W as TopBarDivider,S as TopBarRail,U as clampPanelWidth,V as editNotice,I as headWords,X as panelWidthVars,J as saveIconTone,_ as setPanelWidthVars};
|