efficient-easel 0.102.0 → 0.103.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -3
- package/dist/{chunk-TEZ6V6PA.js → chunk-3M3A3DN2.js} +1 -1
- package/dist/chunk-4MXFKJUY.js +1 -0
- package/dist/{chunk-D7M6IRPJ.js → chunk-66ICOE3I.js} +1 -1
- package/dist/chunk-6UJ3Y6FC.js +1 -0
- package/dist/{chunk-E7GGVILG.js → chunk-GXN65JMA.js} +1 -1
- package/dist/chunk-HDKTR5TZ.js +62 -0
- package/dist/chunk-LG436UTD.js +1 -0
- package/dist/{chunk-VLSTGOVD.js → chunk-MSBF7IW3.js} +1 -1
- package/dist/{chunk-5464H65G.js → chunk-NBJ2YY6Y.js} +1 -1
- package/dist/chunk-OORDMLL4.js +5 -0
- package/dist/chunk-Q2HPBMG5.js +1 -0
- package/dist/chunk-YJXEHK6I.js +2 -0
- package/dist/chunk-Z3KBLIEH.js +10 -0
- package/dist/chunk-ZWK3CBRU.js +1 -0
- package/dist/{host-B-byaQxg.d.ts → host-DJ8Gzsx7.d.ts} +93 -21
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/MediaSidePanel.d.ts +1 -1
- package/dist/screen/components/MediaSidePanel.js +1 -1
- package/dist/screen/components/PageEditGuardNotices.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 +5 -4
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.js +1 -1
- package/dist/screen/components/SectionScreenShell.js +16 -16
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.d.ts +2 -2
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/document-addressing.d.ts +1 -1
- package/dist/screen/lib/document-contract.d.ts +7 -0
- package/dist/screen/lib/host.d.ts +1 -1
- package/dist/screen/lib/media-panel.d.ts +1 -1
- package/dist/screen/lib/media-picker.d.ts +1 -1
- package/dist/screen/lib/puck/device-fields.d.ts +4 -2
- package/dist/screen/lib/puck/style-clipboard.js +1 -1
- package/dist/screen/lib/screen-parts.d.ts +22 -1
- package/dist/screen/lib/screen-parts.js +1 -1
- package/dist/screen/lib/section-templates.js +1 -1
- package/dist/screen/screen.css +14 -0
- package/dist/screen/words.d.ts +42 -0
- package/dist/screen/words.js +1 -0
- package/dist/strings/catalogue.d.ts +9 -2
- package/dist/strings/catalogue.js +1 -1
- package/dist/strings/index.d.ts +1 -0
- package/dist/strings/index.js +1 -1
- package/package.json +6 -1
- package/dist/chunk-3U4GP5VA.js +0 -10
- package/dist/chunk-7RNTMJER.js +0 -5
- package/dist/chunk-F2FPZIZV.js +0 -62
- package/dist/chunk-FT35FX7D.js +0 -2
- package/dist/chunk-J4RAY75C.js +0 -1
- package/dist/chunk-PP44LCJM.js +0 -1
- package/dist/chunk-UH7TGWHR.js +0 -1
- package/dist/chunk-UVWVYMMZ.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ScreenChrome as default}from"../../chunk-
|
|
1
|
+
export{ScreenChrome as default}from"../../chunk-HDKTR5TZ.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-Q2HPBMG5.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-AKFJK65Z.js";import"../../chunk-PWZOS45R.js";import"../../chunk-7F52SZOI.js";import"../../chunk-R2HLPNQF.js";import"../../chunk-HWW4XJOH.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-OM67AJQC.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-5MZ3RNQQ.js";import"../../chunk-SERF2FAU.js";import"../../chunk-GXN65JMA.js";import"../../chunk-VV5ADNBR.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-F6CCTEIX.js";import"../../chunk-FUDHI5I4.js";import"../../chunk-LG436UTD.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-YJXEHK6I.js";import"../../chunk-7MU3RJ6S.js";import"../../chunk-A7ZJII7O.js";import"../../chunk-6FY3PZS3.js";import"../../chunk-AKZWUV5Z.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-OYX47SL7.js";import"../../chunk-HMX55DYT.js";import"../../chunk-Q3SQBNJB.js";import"../../chunk-3WSPDAK2.js";import"../../chunk-R5ZVNJLJ.js";import"../../chunk-57DJOKXT.js";import"../../chunk-3QVB4AG2.js";import"../../chunk-OORDMLL4.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-GENAF3P6.js";import"../../chunk-4MXFKJUY.js";import"../../chunk-IWAPPEL4.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KDYIMJTZ.js";import"../../chunk-6TZTKAB5.js";import"../../chunk-AJBJ74ME.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-3M3A3DN2.js";import"../../chunk-ZZ7VLIHQ.js";import"../../chunk-NBJ2YY6Y.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-ZWK3CBRU.js";import"../../chunk-P67FP7PG.js";import"../../chunk-AELNNAFM.js";import"../../chunk-BXZ6WLHC.js";import"../../chunk-EOJNJCMJ.js";import"../../chunk-ZFDCDJNZ.js";import"../../chunk-ZNS7727Y.js";import"../../chunk-3EDSDPIP.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-RW4XBUUW.js";import"../../chunk-KTVH2ZRL.js";import"../../chunk-2LK54I4E.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-OWBO4WKA.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-6DJHRLCU.js";import"../../chunk-ZJEBF4NB.js";import"../../chunk-JUQ6YJCG.js";import"../../chunk-RE4LP46F.js";import"../../chunk-WZ7TGAAT.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-EWVJSRRY.js";import"../../chunk-P6O363EE.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-BZ5ASXOL.js";import"../../chunk-TTJ54QGG.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-L5KW4HG5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import 'react';
|
|
2
2
|
import '../../blocks/index.js';
|
|
3
|
-
export { k as
|
|
3
|
+
export { j as AnyScreenTarget, k as DocumentTarget, l as ScreenDocumentContext, m as ScreenDocumentProvider, n as ScreenDocumentValue, o as ScreenTarget, p as useScreenDocument } from '../../host-DJ8Gzsx7.js';
|
|
4
4
|
import '../lib/document-contract.js';
|
|
5
5
|
export { SaveStatus } from '../lib/document-switch.js';
|
|
6
6
|
import '../lib/admin-bridge.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ScreenDocumentContext,ScreenDocumentProvider,useScreenDocument}from"../../chunk-
|
|
1
|
+
export{ScreenDocumentContext,ScreenDocumentProvider,useScreenDocument}from"../../chunk-YJXEHK6I.js";import"../../chunk-7MU3RJ6S.js";import"../../chunk-A7ZJII7O.js";import"../../chunk-6FY3PZS3.js";import"../../chunk-AKZWUV5Z.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-OYX47SL7.js";import"../../chunk-HMX55DYT.js";import"../../chunk-Q3SQBNJB.js";import"../../chunk-3WSPDAK2.js";import"../../chunk-R5ZVNJLJ.js";import"../../chunk-KDYIMJTZ.js";import"../../chunk-6TZTKAB5.js";import"../../chunk-AJBJ74ME.js";import"../../chunk-ZZ7VLIHQ.js";import"../../chunk-ZWK3CBRU.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-JUQ6YJCG.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MFIRYGHW.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { j as
|
|
3
|
+
import { j as AnyScreenTarget, A as AnyDocumentAddressing } from '../../host-DJ8Gzsx7.js';
|
|
4
4
|
import { ScreenParts } from '../lib/screen-parts.js';
|
|
5
5
|
import '../../blocks/index.js';
|
|
6
6
|
import '../../types-E3HrTPg2.js';
|
|
@@ -40,9 +40,10 @@ import '../lib/puck/slot-section-spec.js';
|
|
|
40
40
|
* the provider holds one document that nothing stores.
|
|
41
41
|
*/
|
|
42
42
|
declare function ScreenMount({ target, addressing, onHostMessage, children, }: {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
/** A website's page or template, or a host's own document (0.103.0). */
|
|
44
|
+
target: AnyScreenTarget;
|
|
45
|
+
/** ONE object for the life of the mount, for the kind of target `target` is. */
|
|
46
|
+
addressing?: AnyDocumentAddressing;
|
|
46
47
|
/** The layer's own host messages (the website's: lib/website-host-inbound). */
|
|
47
48
|
onHostMessage?: (raw: unknown) => boolean;
|
|
48
49
|
children?: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{DocumentScreen,ScreenMount as default}from"../../chunk-
|
|
1
|
+
export{DocumentScreen,ScreenMount as default}from"../../chunk-Z3KBLIEH.js";import"../../chunk-GXQCZJOP.js";import"../../chunk-MSBF7IW3.js";import"../../chunk-HDKTR5TZ.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-Q2HPBMG5.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-AKFJK65Z.js";import"../../chunk-PWZOS45R.js";import"../../chunk-7F52SZOI.js";import"../../chunk-R2HLPNQF.js";import"../../chunk-HWW4XJOH.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-OM67AJQC.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-5MZ3RNQQ.js";import"../../chunk-SERF2FAU.js";import"../../chunk-GXN65JMA.js";import"../../chunk-VV5ADNBR.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-F6CCTEIX.js";import"../../chunk-FUDHI5I4.js";import"../../chunk-LG436UTD.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-YJXEHK6I.js";import"../../chunk-7MU3RJ6S.js";import"../../chunk-A7ZJII7O.js";import"../../chunk-6FY3PZS3.js";import"../../chunk-AKZWUV5Z.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-OYX47SL7.js";import"../../chunk-HMX55DYT.js";import"../../chunk-Q3SQBNJB.js";import"../../chunk-3WSPDAK2.js";import"../../chunk-R5ZVNJLJ.js";import"../../chunk-57DJOKXT.js";import"../../chunk-3QVB4AG2.js";import"../../chunk-OORDMLL4.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-GENAF3P6.js";import"../../chunk-4MXFKJUY.js";import"../../chunk-IWAPPEL4.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KDYIMJTZ.js";import"../../chunk-6TZTKAB5.js";import"../../chunk-AJBJ74ME.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-3M3A3DN2.js";import"../../chunk-ZZ7VLIHQ.js";import"../../chunk-NBJ2YY6Y.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-ZWK3CBRU.js";import"../../chunk-P67FP7PG.js";import"../../chunk-AELNNAFM.js";import"../../chunk-BXZ6WLHC.js";import"../../chunk-EOJNJCMJ.js";import"../../chunk-ZFDCDJNZ.js";import"../../chunk-ZNS7727Y.js";import"../../chunk-3EDSDPIP.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-RW4XBUUW.js";import"../../chunk-KTVH2ZRL.js";import"../../chunk-2LK54I4E.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-OWBO4WKA.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-6DJHRLCU.js";import"../../chunk-ZJEBF4NB.js";import"../../chunk-JUQ6YJCG.js";import"../../chunk-RE4LP46F.js";import"../../chunk-WZ7TGAAT.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-EWVJSRRY.js";import"../../chunk-P6O363EE.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-BZ5ASXOL.js";import"../../chunk-TTJ54QGG.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-L5KW4HG5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ScreenStoreProvider as default}from"../../chunk-
|
|
1
|
+
export{ScreenStoreProvider as default}from"../../chunk-MSBF7IW3.js";import"../../chunk-R5ZVNJLJ.js";import"../../chunk-NBJ2YY6Y.js";import"../../chunk-P67FP7PG.js";import"../../chunk-AELNNAFM.js";import"../../chunk-BXZ6WLHC.js";import"../../chunk-EOJNJCMJ.js";import"../../chunk-ZFDCDJNZ.js";import"../../chunk-ZNS7727Y.js";import"../../chunk-3EDSDPIP.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-KTVH2ZRL.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-EWVJSRRY.js";import"../../chunk-P6O363EE.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-BZ5ASXOL.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-L5KW4HG5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import{AddBlockRow as e}from"../../chunk-
|
|
2
|
-
return w(W,{children:[o.map(({child:e,zone:o,index:r})=>{const t=
|
|
3
|
-
return w(b,{children:[0===r&&
|
|
4
|
-
/* @__PURE__ */
|
|
5
|
-
return w("div",{ref:
|
|
6
|
-
/* @__PURE__ */
|
|
7
|
-
/* @__PURE__ */w("div",{className:"sf-body",children:[je
|
|
8
|
-
/* @__PURE__ */
|
|
9
|
-
/* @__PURE__ */
|
|
10
|
-
/* @__PURE__ */
|
|
11
|
-
return w(b,{children:[0===n&&
|
|
12
|
-
/* @__PURE__ */
|
|
13
|
-
/* @__PURE__ */w("button",{type:"button",className:"sf-add-card",onClick:
|
|
14
|
-
/* @__PURE__ */
|
|
15
|
-
/* @__PURE__ */
|
|
16
|
-
/* @__PURE__ */
|
|
1
|
+
import{AddBlockRow as e}from"../../chunk-66ICOE3I.js";import{slotChildRowName as n}from"../../chunk-HWW4XJOH.js";import{scrollPreviewToSection as o,gotoPreviewSlide as r}from"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import{useEaselUndoKeys as t}from"../../chunk-OM67AJQC.js";import{SlotChildActionsProvider as s}from"../../chunk-KCBEE2MC.js";import{DEFAULT_PANEL_W as i}from"../../chunk-SERF2FAU.js";import{usePartBridge as c}from"../../chunk-GXN65JMA.js";import{useSectionOps as p}from"../../chunk-VV5ADNBR.js";import"../../chunk-IYT6NN2J.js";import{nestsInTree as l,slotFieldsOf as d}from"../../chunk-FUDHI5I4.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import{useScreenDocument as m}from"../../chunk-YJXEHK6I.js";import"../../chunk-7MU3RJ6S.js";import"../../chunk-A7ZJII7O.js";import"../../chunk-6FY3PZS3.js";import"../../chunk-AKZWUV5Z.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-OYX47SL7.js";import"../../chunk-HMX55DYT.js";import"../../chunk-Q3SQBNJB.js";import"../../chunk-3WSPDAK2.js";import"../../chunk-R5ZVNJLJ.js";import"../../chunk-KDYIMJTZ.js";import"../../chunk-6TZTKAB5.js";import"../../chunk-AJBJ74ME.js";import"../../chunk-HQ4VVRIC.js";import{MediaSidePanel as a}from"../../chunk-3M3A3DN2.js";import{useMediaPanel as u,usePanelPick as h,cancelPanelPick as k}from"../../chunk-ZZ7VLIHQ.js";import{SELECTION_MODE as j,useScreenPinned as f,useScreenCanvasFrame as N,useScreenInspectorPanel as y,sameInspectorMode as A,useStandaloneScreenBridges as S,useScreenBlockLook as C,useScreenBlockRules as J}from"../../chunk-NBJ2YY6Y.js";import"../../chunk-ZWK3CBRU.js";import{useEasel as x}from"../../chunk-P67FP7PG.js";import"../../chunk-AELNNAFM.js";import"../../chunk-BXZ6WLHC.js";import"../../chunk-EOJNJCMJ.js";import{LayersTree as E,Subtree as P,TreeRow as O,TreeRowAction as R,TreeSeam as Z}from"../../chunk-ZFDCDJNZ.js";import"../../chunk-ZNS7727Y.js";import"../../chunk-3EDSDPIP.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-KTVH2ZRL.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-BDTITTMW.js";import{saveIndicator as g}from"../../chunk-H6DDIBQ4.js";import{SaveState as v,panelWidthVars as B}from"../../chunk-6DJHRLCU.js";import"../../chunk-ZJEBF4NB.js";import"../../chunk-JUQ6YJCG.js";import"../../chunk-RE4LP46F.js";import"../../chunk-WZ7TGAAT.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-EWVJSRRY.js";import"../../chunk-P6O363EE.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-BZ5ASXOL.js";import"../../chunk-TTJ54QGG.js";import"../../chunk-O2NLQBFX.js";import{useTreeDrag as D}from"../../chunk-67GNT6PF.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import{TrashIcon as T}from"../../chunk-L5KW4HG5.js";import{zoneKey as L,parseZoneKey as z}from"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";import{useState as I,useRef as Y,useEffect as H,useCallback as M,Fragment as b}from"react";import{jsxs as w,jsx as F,Fragment as W}from"react/jsx-runtime";var $=e=>n=>{n.target.closest(".es-tree-select, button")||e()},K={rowClick:$};function X(){const{saveState:X,readOnly:Q,readOnlyReason:G=null}=m(),V=p(),{appState:U,selectedItem:q,config:_}=x(e=>e),[ee,ne]=I(j),[oe,re]=I(null),{first:te,last:se,panelOf:ie}=f(),ce=ie(te),pe=N(),le=y(),de=U.data.content?.[0]??null,me=de?.props.id??null,ae=de?.type===te,ue=de?.type===se,he=Y(null),ke=Y(null);t(ke);const je=u(),fe=h();H(()=>{const e=ke.current;if(!fe||!e)return;const n=e=>{"Escape"===e.key&&k()};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[fe]),H(()=>{me&&he.current!==me&&(he.current=me,ae?ne(ce??j):q||V.select({index:0}))},[me,q,V,ae]);const Ne=M(e=>ne(n=>A(n,e)?n:e),[]),ye=S({kind:ee.kind,mode:ee,open:Ne,show:e=>ne(e),reveal:()=>{}}),{selectNode:Ae}=c({mode:ee,setMode:ne,onOpenPart:o}),Se=C(),{labelAtLevel:Ce,Icon:Je}=Se,{canAddTo:xe}=J(),Ee=e=>_.components[e]?.label??e,Pe=e=>Ce(e,"section",Ee(e)),Oe=!ae&&"puck"===ee.kind&&q?.props.id===me,Re=de?xe(de.type)?.spec??null:null,Ze=de&&Re?`${de.props.id}:${Re.slot}`:null,ge=de&&Re&&Array.isArray(de.props[Re.slot])?de.props[Re.slot]:[],ve=e=>n(e,Ee,Se.plainText),Be=(e,n)=>{de&&Re&&Ze&&(ne(j),Re.slider?(r(String(de.props.id),e),V.select({index:e,zone:Ze}),o(String(de.props.id))):(V.select({index:e,zone:Ze}),o(n)))},De=()=>{if(!de||!Re||!Ze)return;const e=ge.length;V.insertComponent(Ze,Re.childType,e),ne(j),Re.slider?requestAnimationFrame(()=>{r(String(de.props.id),e),V.select({index:e,zone:Ze})}):V.select({index:e,zone:Ze})},Te=e=>d(_,e),Le=e=>{const{parentId:n,slot:o}=z(e),r=e=>{if(!e)return null;if(String(e.props.id)===n)return e;for(const n of Te(e.type)){const o=Array.isArray(e.props[n])?e.props[n]:[];for(const e of o){const n=r(e);if(n)return n}}return null},t=r(de)?.props[o];return Array.isArray(t)?t.length:0},ze=(e,n,o)=>{const r=Math.min(Math.max(o,0),Le(e)),t=n<r?r-1:r;t!==n&&(V.reorderComponent(e,n,t),ne(j),V.select({index:t,zone:e}))},Ie=D({keyOf:e=>e.id,readOnly:Boolean(Q),canDrop:(e,n)=>L(n)===e.zone&&n.index>=0&&n.index<=Le(e.zone),onDrop:(e,n)=>ze(e.zone,e.index,n.index),onStep:(e,n)=>ze(e.zone,e.index,n<0?e.index-1:e.index+2)}),Ye=(e,n)=>/* @__PURE__ */F(Z,{...Q?{}:Ie.seam({place:{...z(e),index:n}})},`seam:${e}:${n}`),He=e=>Se.blockRowName(e,Ee),Me=(e,n,r)=>{ne(j),V.select({index:n,zone:e}),o(r)},be=(e,n,o)=>{V.insertComponent(e,n,o),ne(j),V.select({index:o,zone:e}),re(null)},we=(n,o,r)=>/* @__PURE__ */F(e,{choices:r,open:oe===n,onToggle:()=>re(oe===n?null:n),onPick:e=>be(n,e,o)}),Fe=(e,n)=>{const o=Te((r=e).type).flatMap(e=>(Array.isArray(r.props[e])?r.props[e]:[]).map((n,o)=>({child:n,zone:`${r.props.id}:${e}`,index:o})));var r;const t=xe(e.type),s=t?.choices??null,i="footer"===t?.source?He:ve;/* @__PURE__ */
|
|
2
|
+
return w(W,{children:[o.map(({child:e,zone:o,index:r})=>{const t=q?.props.id===e.props.id,s=l(_,e.type,n),c=i(e),p=String(e.props.id),d=()=>Me(o,r,p),{rowProps:m,...a}=Ie.row({item:{id:p,zone:o,index:r},place:{...z(o),index:r}},{onClick:$(d)});/* @__PURE__ */
|
|
3
|
+
return w(b,{children:[0===r&&Ye(o,0),
|
|
4
|
+
/* @__PURE__ */F(O,{icon:/* @__PURE__ */F(Je,{type:e.type,size:13}),name:c,selected:t,onSelect:d,...a,actions:/* @__PURE__ */F(R,{kind:"delete",label:`Delete ${c}`,onClick:()=>{return e=o,n=r,V.removeComponent(e,n),ne(j),void V.select(null);var e,n},children:/* @__PURE__ */F(T,{size:13})}),rowProps:m}),s&&/* @__PURE__ */F(P,{children:Fe(e,n+1)}),Ye(o,r+1)]},String(e.props.id??`${o}-${r}`))}),t&&s?we(`${e.props.id}:${t.slot}`,o.length,s):null]})},We="HeroSingle"===de?.type,$e=Boolean(de)&&(Boolean(Re)||ue||ae||We);/* @__PURE__ */
|
|
5
|
+
return w("div",{ref:ke,className:"sf-editor es-editor",style:B(i),children:[
|
|
6
|
+
/* @__PURE__ */F("div",{className:"sf-section-bar",children:/* @__PURE__ */F(v,null!==G?{tone:"off",label:G,role:"status"}:{...g(X),role:"status"})}),
|
|
7
|
+
/* @__PURE__ */w("div",{className:"sf-body",children:[fe&&je?/* @__PURE__ */F("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:/* @__PURE__ */F(a,{panel:je,pick:fe})}):$e&&de&&/* @__PURE__ */w("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:[
|
|
8
|
+
/* @__PURE__ */F("div",{className:"sf-panel-head",children:/* @__PURE__ */F("button",{type:"button",className:"sf-panel-title sf-panel-title--btn "+(Oe?"is-selected":""),"aria-pressed":Oe,title:ae?"Header settings":`${Pe(de.type)} settings`,onClick:()=>{ae?ne(ce??j):(ne(j),V.select({index:0}))},children:Pe(de.type)})}),
|
|
9
|
+
/* @__PURE__ */F(E,{className:"sf-tree sf-scroll",rootProps:Ie.rootProps(),children:/* @__PURE__ */F(P,{children:ae?
|
|
10
|
+
/* @__PURE__ */F(O,{icon:/* @__PURE__ */F(Je,{type:"header",size:13}),name:"Header settings",selected:ee.kind===ce?.kind,onSelect:()=>ne(ce??j),rowProps:{onClick:$(()=>ne(ce??j))}}):Re?/* @__PURE__ */w(W,{children:[ge.map((e,n)=>{const o=q?.props.id===e.props.id,r=ve(e),t=String(e.props.id),s=()=>Be(n,t),{rowProps:i,...c}=Ie.row({item:{id:t,zone:Ze,index:n},place:{...z(Ze),index:n}},{onClick:$(s)});/* @__PURE__ */
|
|
11
|
+
return w(b,{children:[0===n&&Ye(Ze,0),
|
|
12
|
+
/* @__PURE__ */F(O,{icon:/* @__PURE__ */F(Je,{type:e.type,size:13}),name:r,selected:o,onSelect:s,...c,actions:/* @__PURE__ */F(R,{kind:"delete",label:`Delete ${r}`,onClick:()=>{return e=n,void(Ze&&(V.removeComponent(Ze,e),ne(j),V.select(null)));var e},children:/* @__PURE__ */F(T,{size:13})}),rowProps:i}),Ye(Ze,n+1)]},String(e.props.id??n))}),
|
|
13
|
+
/* @__PURE__ */w("button",{type:"button",className:"sf-add-card",onClick:De,children:[
|
|
14
|
+
/* @__PURE__ */F("span",{className:"sf-plus sf-plus--sm",children:"+"}),Re.addLabel]}),me?ye.partRows?.(de,K):null]}):Fe(de,1)})})]}),
|
|
15
|
+
/* @__PURE__ */F("div",{className:"sf-center",children:/* @__PURE__ */F("div",{className:"sf-preview-host",children:/* @__PURE__ */F(pe,{})})}),
|
|
16
|
+
/* @__PURE__ */F(s,{value:{selectChild:(e,n,o,r)=>"section"===xe(r)?.source?Be(n,o):Me(e,n,o),addChild:(e,n,o,r,t)=>"section"===xe(t)?.source?De():be(`${e}:${n}`,o,r),childRowName:ve,blockRowName:He},children:/* @__PURE__ */F(le,{mode:ee,onOpenWebsiteSettings:ye.openSettings??(()=>{}),onSelectNode:Ae,hideNodeActions:!0})})]})]})}export{X as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{usePartBridge}from"../../chunk-
|
|
1
|
+
export{usePartBridge}from"../../chunk-GXN65JMA.js";import"../../chunk-VV5ADNBR.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-FUDHI5I4.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-NBJ2YY6Y.js";import"../../chunk-P67FP7PG.js";import"../../chunk-AELNNAFM.js";import"../../chunk-BXZ6WLHC.js";import"../../chunk-EOJNJCMJ.js";import"../../chunk-ZFDCDJNZ.js";import"../../chunk-ZNS7727Y.js";import"../../chunk-3EDSDPIP.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-KTVH2ZRL.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-EWVJSRRY.js";import"../../chunk-P6O363EE.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-BZ5ASXOL.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-L5KW4HG5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
package/dist/screen/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { DocumentScreen, default as ScreenMount } from './components/ScreenMount.js';
|
|
2
2
|
export { default as ScreenStoreProvider } from './components/ScreenStoreProvider.js';
|
|
3
|
-
export { NodeDefaults, SELECTION_MODE, ScreenBlockLook, ScreenBlockRules, ScreenBridges, ScreenCanvas, ScreenDevices, ScreenDocumentOps, ScreenInspector, ScreenInspectorMode, ScreenInspectorPanelProps, ScreenLeftPanel, ScreenLeftView, ScreenLeftViewFrame, ScreenLeftViewRules, ScreenNewNode, ScreenNode, ScreenNodeLevel, ScreenNodeMaker, ScreenPartMode, ScreenParts, ScreenPartsProvider, ScreenPinnedNodes, ScreenRailItem, ScreenTree, ScreenTreeFolds, ScreenTreeRows, sameInspectorMode, useScreenBlockLook, useScreenBlockRules, useScreenBridges, useScreenCanvasFrame, useScreenDevices, useScreenDocumentPass, useScreenInspectorPanel, useScreenLeftView, useScreenOwnerName, useScreenParts, useScreenPinned, useStandaloneScreenBridges } from './lib/screen-parts.js';
|
|
3
|
+
export { NodeDefaults, SELECTION_MODE, ScreenBlockLook, ScreenBlockRules, ScreenBridges, ScreenCanvas, ScreenDevices, ScreenDocumentOps, ScreenInspector, ScreenInspectorMode, ScreenInspectorPanelProps, ScreenLeftPanel, ScreenLeftView, ScreenLeftViewFrame, ScreenLeftViewRules, ScreenNewNode, ScreenNode, ScreenNodeLevel, ScreenNodeMaker, ScreenPartMode, ScreenParts, ScreenPartsProvider, ScreenPinnedNodes, ScreenRailItem, ScreenTree, ScreenTreeFolds, ScreenTreeRows, sameInspectorMode, useScreenBlockLook, useScreenBlockRules, useScreenBridges, useScreenCanvasFrame, useScreenDevices, useScreenDocumentPass, useScreenInspectorPanel, useScreenLeftView, useScreenOwnerName, useScreenParts, useScreenPinned, useScreenSaveSwitch, useStandaloneScreenBridges } from './lib/screen-parts.js';
|
|
4
4
|
export { EFFICIENT_BACKEND, EaselSession, SessionBackend, SessionBlocks, activateEaselSession, backendOf, createEaselSession, currentEaselSession, deactivateEaselSession, efficientClientOpen, isEfficientBackend, provideDefaultBackend, resetAmbientEaselSession, sessionRegistry, setSessionBridgedSite, setSessionDocumentSite } from './lib/session.js';
|
|
5
5
|
export { EaselSessionProvider, useEaselSession } from './lib/session-context.js';
|
|
6
|
-
export { D as DETACHED_EASEL_HOST, a as DocumentAddressing, E as EaselHost, b as EaselHostAddress, c as EaselHostContext, d as EaselHostProvider, e as EaselMessageType, f as EaselToHostMessage, H as HostPickedMedia, g as HostToEaselMessage, I as InboundHostMessage, N as NO_DOCUMENT_ADDRESSING, S as SectionScreenTarget, h as SendToHost, i as createEaselHost, u as useEaselHost } from '../host-
|
|
6
|
+
export { A as AnyDocumentAddressing, D as DETACHED_EASEL_HOST, a as DocumentAddressing, E as EaselHost, b as EaselHostAddress, c as EaselHostContext, d as EaselHostProvider, e as EaselMessageType, f as EaselToHostMessage, H as HostPickedMedia, g as HostToEaselMessage, I as InboundHostMessage, N as NO_DOCUMENT_ADDRESSING, S as SectionScreenTarget, h as SendToHost, i as createEaselHost, u as useEaselHost } from '../host-DJ8Gzsx7.js';
|
|
7
7
|
export { EaselCapabilities, EaselDocument, EaselDocumentAdapter, EaselPageRow, SiteRecord, SiteRecordPatch, WebsiteEditLock } from './lib/document-contract.js';
|
|
8
8
|
import 'react';
|
|
9
9
|
import '../blocks/index.js';
|
package/dist/screen/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunk-GZO72N3Q.js";export{DocumentScreen,ScreenMount}from"../chunk-
|
|
1
|
+
import"../chunk-GZO72N3Q.js";export{DocumentScreen,ScreenMount}from"../chunk-Z3KBLIEH.js";import"../chunk-GXQCZJOP.js";export{ScreenStoreProvider}from"../chunk-MSBF7IW3.js";import"../chunk-HDKTR5TZ.js";import"../chunk-26OOWIJJ.js";import"../chunk-Q2HPBMG5.js";import"../chunk-FGNR22NY.js";import"../chunk-ZE7I3PLX.js";import"../chunk-AKFJK65Z.js";import"../chunk-PWZOS45R.js";import"../chunk-7F52SZOI.js";import"../chunk-R2HLPNQF.js";import"../chunk-HWW4XJOH.js";import"../chunk-4ES5JGGX.js";import"../chunk-IQ5TA7AM.js";import"../chunk-DUVRZ456.js";import"../chunk-6W7WLPZH.js";import"../chunk-OM67AJQC.js";import"../chunk-KCBEE2MC.js";import"../chunk-5MZ3RNQQ.js";import"../chunk-SERF2FAU.js";import"../chunk-GXN65JMA.js";import"../chunk-VV5ADNBR.js";import"../chunk-IYT6NN2J.js";import"../chunk-F6CCTEIX.js";import"../chunk-FUDHI5I4.js";import"../chunk-LG436UTD.js";import"../chunk-BSPCSC45.js";import"../chunk-I54UCYOU.js";import"../chunk-GOTN2KY4.js";import"../chunk-R5L2E7JX.js";import"../chunk-YJXEHK6I.js";import"../chunk-7MU3RJ6S.js";import"../chunk-A7ZJII7O.js";import"../chunk-6FY3PZS3.js";import"../chunk-AKZWUV5Z.js";export{NO_DOCUMENT_ADDRESSING}from"../chunk-RLBXE4EU.js";import"../chunk-OYX47SL7.js";import"../chunk-HMX55DYT.js";import"../chunk-Q3SQBNJB.js";import"../chunk-3WSPDAK2.js";export{DETACHED_EASEL_HOST,EaselHostContext,EaselHostProvider,createEaselHost,useEaselHost}from"../chunk-R5ZVNJLJ.js";import"../chunk-57DJOKXT.js";import"../chunk-3QVB4AG2.js";import"../chunk-OORDMLL4.js";import"../chunk-5ZBY24K7.js";import"../chunk-GENAF3P6.js";import"../chunk-4MXFKJUY.js";import"../chunk-IWAPPEL4.js";import"../chunk-KQMML6JM.js";import"../chunk-KDYIMJTZ.js";export{EaselSessionProvider,useEaselSession}from"../chunk-6TZTKAB5.js";export{EFFICIENT_BACKEND,activateEaselSession,backendOf,createEaselSession,currentEaselSession,deactivateEaselSession,efficientClientOpen,isEfficientBackend,provideDefaultBackend,resetAmbientEaselSession,sessionRegistry,setSessionBridgedSite,setSessionDocumentSite}from"../chunk-AJBJ74ME.js";import"../chunk-HQ4VVRIC.js";import"../chunk-3M3A3DN2.js";import"../chunk-ZZ7VLIHQ.js";export{SELECTION_MODE,ScreenPartsProvider,sameInspectorMode,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasFrame,useScreenDevices,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenOwnerName,useScreenParts,useScreenPinned,useScreenSaveSwitch,useStandaloneScreenBridges}from"../chunk-NBJ2YY6Y.js";import"../chunk-6WY6ZXJG.js";import"../chunk-ZWK3CBRU.js";import"../chunk-P67FP7PG.js";import"../chunk-AELNNAFM.js";import"../chunk-BXZ6WLHC.js";import"../chunk-EOJNJCMJ.js";import"../chunk-ZFDCDJNZ.js";import"../chunk-ZNS7727Y.js";import"../chunk-3EDSDPIP.js";import"../chunk-QTLAVDJE.js";import"../chunk-YRLPFZW3.js";import"../chunk-RW4XBUUW.js";import"../chunk-KTVH2ZRL.js";import"../chunk-2LK54I4E.js";import"../chunk-WK3AFPXY.js";import"../chunk-D2BCHTQR.js";import"../chunk-OWBO4WKA.js";import"../chunk-BDTITTMW.js";import"../chunk-H6DDIBQ4.js";import"../chunk-6DJHRLCU.js";import"../chunk-ZJEBF4NB.js";import"../chunk-JUQ6YJCG.js";import"../chunk-RE4LP46F.js";import"../chunk-WZ7TGAAT.js";import"../chunk-2OAZYSWJ.js";import"../chunk-EWVJSRRY.js";import"../chunk-P6O363EE.js";import"../chunk-FPOKPNO4.js";import"../chunk-MFIRYGHW.js";import"../chunk-BZ5ASXOL.js";import"../chunk-TTJ54QGG.js";import"../chunk-O2NLQBFX.js";import"../chunk-67GNT6PF.js";import"../chunk-PAELDYYS.js";import"../chunk-ZNCEOSXO.js";import"../chunk-L5KW4HG5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a as DocumentAddressing, N as NO_DOCUMENT_ADDRESSING } from '../../host-
|
|
1
|
+
export { A as AnyDocumentAddressing, a as DocumentAddressing, N as NO_DOCUMENT_ADDRESSING } from '../../host-DJ8Gzsx7.js';
|
|
2
2
|
import './document-contract.js';
|
|
3
3
|
import './session.js';
|
|
4
4
|
import 'react';
|
|
@@ -167,6 +167,13 @@ type EaselDocument = {
|
|
|
167
167
|
* second editor's autosave is refused instead of erasing this one's work.
|
|
168
168
|
* `null` for a record type with no version check (a template page). */
|
|
169
169
|
version?: string | null;
|
|
170
|
+
/** Why this document may NEVER be written, in words for the operator — "Read-only
|
|
171
|
+
* — this campaign is sent": a record that is the account of something that
|
|
172
|
+
* already happened (0.103.0). Carried, the editor holds the document
|
|
173
|
+
* read-only for good: its saves are refused, its edit lock is never claimed,
|
|
174
|
+
* and the save pill's place says this. Absent (every website document), it
|
|
175
|
+
* is writable as it always was. */
|
|
176
|
+
readOnlyReason?: string;
|
|
170
177
|
};
|
|
171
178
|
interface EaselDocumentAdapter {
|
|
172
179
|
capabilities: EaselCapabilities;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
export { D as DETACHED_EASEL_HOST, E as EaselHost, b as EaselHostAddress, c as EaselHostContext, d as EaselHostProvider, e as EaselMessageType, f as EaselToHostMessage, H as HostPickedMedia, g as HostToEaselMessage, I as InboundHostMessage, S as SectionScreenTarget, h as SendToHost, i as createEaselHost, u as useEaselHost } from '../../host-
|
|
2
|
+
export { D as DETACHED_EASEL_HOST, E as EaselHost, b as EaselHostAddress, c as EaselHostContext, d as EaselHostProvider, e as EaselMessageType, f as EaselToHostMessage, H as HostPickedMedia, g as HostToEaselMessage, I as InboundHostMessage, S as SectionScreenTarget, h as SendToHost, i as createEaselHost, u as useEaselHost } from '../../host-DJ8Gzsx7.js';
|
|
3
3
|
import '../../blocks/index.js';
|
|
4
4
|
import '../../types-E3HrTPg2.js';
|
|
5
5
|
import '../../data/index.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ComponentType, ReactNode } from 'react';
|
|
3
|
-
import { H as HostPickedMedia } from '../../host-
|
|
3
|
+
import { H as HostPickedMedia } from '../../host-DJ8Gzsx7.js';
|
|
4
4
|
import '../../blocks/index.js';
|
|
5
5
|
import '../../types-E3HrTPg2.js';
|
|
6
6
|
import '../../data/index.js';
|
|
@@ -38,7 +38,7 @@ import '../content/view-tiers.js';
|
|
|
38
38
|
* WHY THE HIDDEN FIELD LEAVES NO GAP. Puck wraps every top-level field in its
|
|
39
39
|
* own padded `_PuckFields-field_` box before it calls `render`, so a field that
|
|
40
40
|
* renders nothing would still cost ~37px of empty panel. The gate instead paints
|
|
41
|
-
* a zero-size marker and `
|
|
41
|
+
* a zero-size marker and this package's `screen.css` collapses the
|
|
42
42
|
* wrapper that contains one — the same "reach the wrapper Puck owns" trick the
|
|
43
43
|
* fold reflow in `controls.tsx` already relies on, expressed as one CSS rule
|
|
44
44
|
* instead of a second DOM pass (so it cannot race the fold's).
|
|
@@ -64,7 +64,9 @@ declare function shownTier(device: PreviewDevice): DeviceTier;
|
|
|
64
64
|
*/
|
|
65
65
|
declare const DEVICE_NOTE: Readonly<Record<PreviewDevice, string | null>>;
|
|
66
66
|
/** The attribute the stylesheet looks for to collapse a gated-off field's Puck
|
|
67
|
-
* wrapper. Declared here, matched once in `
|
|
67
|
+
* wrapper. Declared here, matched once in this package's `screen.css`, which
|
|
68
|
+
* every host that mounts the screen loads (it sat in the website's sheet until
|
|
69
|
+
* 0.103.0, so a second host's hidden rows kept their space). */
|
|
68
70
|
declare const DEVICE_HIDDEN_ATTR = "data-sf-device-hidden";
|
|
69
71
|
/** A house control's render, seen from outside: the builders in `controls.tsx`
|
|
70
72
|
* each type their own props, so the gate takes the widest shape that can be
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{copyNodeStyle,nodeStyleRows,planNodePaste,shopFieldKind,siteStyleScope}from"../../../chunk-
|
|
1
|
+
export{copyNodeStyle,nodeStyleRows,planNodePaste,shopFieldKind,siteStyleScope}from"../../../chunk-Q2HPBMG5.js";import"../../../chunk-ZE7I3PLX.js";import"../../../chunk-PWZOS45R.js";import"../../../chunk-7F52SZOI.js";import"../../../chunk-R2HLPNQF.js";import"../../../chunk-DUVRZ456.js";import"../../../chunk-BSPCSC45.js";import"../../../chunk-57DJOKXT.js";import"../../../chunk-6WY6ZXJG.js";import"../../../chunk-L5KW4HG5.js";
|
|
@@ -305,6 +305,15 @@ interface ScreenBridges {
|
|
|
305
305
|
/** …and `barTrail` stands between Refresh and the main button: a way out to
|
|
306
306
|
* where the document is read. */
|
|
307
307
|
barTrail?: () => ReactNode;
|
|
308
|
+
/**
|
|
309
|
+
* …and `barMain` IS the main button, in its place at the end of the cluster
|
|
310
|
+
* (0.103.0): the layer's own way to finish with the document — the campaign
|
|
311
|
+
* designer's Done — where the screen draws Publish (a document that
|
|
312
|
+
* publishes) or Save. What comes back is placed as it is, nothing round it,
|
|
313
|
+
* and returning nothing leaves the place empty. Absent, the screen draws its
|
|
314
|
+
* own button, as it always has.
|
|
315
|
+
*/
|
|
316
|
+
barMain?: () => ReactNode;
|
|
308
317
|
/**
|
|
309
318
|
* The layer's own buttons in the rail. The screen draws the rail as Add, its
|
|
310
319
|
* own Layers and the host's Media library; a layer has two places in it.
|
|
@@ -662,6 +671,15 @@ interface ScreenParts {
|
|
|
662
671
|
* sections, and which are edited in a panel of the layer's. Data and three
|
|
663
672
|
* plain functions, and handed here for the reason the rules are. */
|
|
664
673
|
pinned?: ScreenPinnedNodes;
|
|
674
|
+
/**
|
|
675
|
+
* Is the save pill also the autosave's on / off switch (0.103.0)? The screen
|
|
676
|
+
* draws the pill as a button that pauses the autosave and resumes it; a
|
|
677
|
+
* layer whose editor always saves (the campaign designer) says false, and the
|
|
678
|
+
* pill is the same words and the same dot with nothing to press. "Retry now"
|
|
679
|
+
* stays beside a failed save either way. Absent, true: the switch, as the
|
|
680
|
+
* website has it.
|
|
681
|
+
*/
|
|
682
|
+
saveSwitch?: boolean;
|
|
665
683
|
/**
|
|
666
684
|
* THE CANVAS the screen frames: the engine's, as the layer dresses it — the
|
|
667
685
|
* layer's own sheet and theme in the frame, its own say over the outline
|
|
@@ -717,6 +735,9 @@ declare function useScreenLeftView(): ScreenLeftViewRules;
|
|
|
717
735
|
/** Which node types the layer pins in the top-level list, and which are its
|
|
718
736
|
* groups of sections. With no layer, none. */
|
|
719
737
|
declare function useScreenPinned(): ScreenPinnedNodes;
|
|
738
|
+
/** Whether the save pill is the autosave's switch. With no layer, it is, as
|
|
739
|
+
* the screen has always drawn it. */
|
|
740
|
+
declare function useScreenSaveSwitch(): boolean;
|
|
720
741
|
/** The canvas the layer dresses for the screen to frame. With no layer, the
|
|
721
742
|
* engine's plain one. */
|
|
722
743
|
declare function useScreenCanvasFrame(): ComponentType;
|
|
@@ -724,4 +745,4 @@ declare function useScreenCanvasFrame(): ComponentType;
|
|
|
724
745
|
* engine's plain rows for the selection. */
|
|
725
746
|
declare function useScreenInspectorPanel(): ComponentType<ScreenInspectorPanelProps>;
|
|
726
747
|
|
|
727
|
-
export { type NodeDefaults, SELECTION_MODE, type ScreenBlockLook, type ScreenBlockRules, type ScreenBridges, type ScreenCanvas, type ScreenDevices, type ScreenDocumentOps, type ScreenInspector, type ScreenInspectorMode, type ScreenInspectorPanelProps, type ScreenLeftPanel, type ScreenLeftView, type ScreenLeftViewFrame, type ScreenLeftViewRules, type ScreenNewNode, type ScreenNode, type ScreenNodeLevel, type ScreenNodeMaker, type ScreenPartMode, type ScreenParts, ScreenPartsProvider, type ScreenPinnedNodes, type ScreenRailItem, type ScreenTree, type ScreenTreeFolds, type ScreenTreeRows, sameInspectorMode, useScreenBlockLook, useScreenBlockRules, useScreenBridges, useScreenCanvasFrame, useScreenDevices, useScreenDocumentPass, useScreenInspectorPanel, useScreenLeftView, useScreenOwnerName, useScreenParts, useScreenPinned, useStandaloneScreenBridges };
|
|
748
|
+
export { type NodeDefaults, SELECTION_MODE, type ScreenBlockLook, type ScreenBlockRules, type ScreenBridges, type ScreenCanvas, type ScreenDevices, type ScreenDocumentOps, type ScreenInspector, type ScreenInspectorMode, type ScreenInspectorPanelProps, type ScreenLeftPanel, type ScreenLeftView, type ScreenLeftViewFrame, type ScreenLeftViewRules, type ScreenNewNode, type ScreenNode, type ScreenNodeLevel, type ScreenNodeMaker, type ScreenPartMode, type ScreenParts, ScreenPartsProvider, type ScreenPinnedNodes, type ScreenRailItem, type ScreenTree, type ScreenTreeFolds, type ScreenTreeRows, sameInspectorMode, useScreenBlockLook, useScreenBlockRules, useScreenBridges, useScreenCanvasFrame, useScreenDevices, useScreenDocumentPass, useScreenInspectorPanel, useScreenLeftView, useScreenOwnerName, useScreenParts, useScreenPinned, useScreenSaveSwitch, useStandaloneScreenBridges };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{SELECTION_MODE,ScreenPartsProvider,sameInspectorMode,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasFrame,useScreenDevices,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenOwnerName,useScreenParts,useScreenPinned,useStandaloneScreenBridges}from"../../chunk-
|
|
1
|
+
export{SELECTION_MODE,ScreenPartsProvider,sameInspectorMode,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasFrame,useScreenDevices,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenOwnerName,useScreenParts,useScreenPinned,useScreenSaveSwitch,useStandaloneScreenBridges}from"../../chunk-NBJ2YY6Y.js";import"../../chunk-P67FP7PG.js";import"../../chunk-AELNNAFM.js";import"../../chunk-BXZ6WLHC.js";import"../../chunk-EOJNJCMJ.js";import"../../chunk-ZFDCDJNZ.js";import"../../chunk-ZNS7727Y.js";import"../../chunk-3EDSDPIP.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-KTVH2ZRL.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-EWVJSRRY.js";import"../../chunk-P6O363EE.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-BZ5ASXOL.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-L5KW4HG5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{sectionTemplates}from"../../chunk-
|
|
1
|
+
export{sectionTemplates}from"../../chunk-4MXFKJUY.js";import"../../chunk-KDYIMJTZ.js";import"../../chunk-AJBJ74ME.js";
|
package/dist/screen/screen.css
CHANGED
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
* the screen (that repo's doc/adr/0004): a rule is here when every `sf-` class
|
|
9
9
|
* it names is drawn by the screen, so every host that mounts the screen gets
|
|
10
10
|
* it; a rule that names a class only a host draws stays in that host's sheet.
|
|
11
|
+
* A `data-sf-*` marker the screen's own modules paint counts the same way: the
|
|
12
|
+
* rule that gives it its meaning is here (0.103.0), since a marker no sheet
|
|
13
|
+
* reads is a box that still takes its space. `tests/screen-css-closure` mounts
|
|
14
|
+
* the screen with easel's sheets alone and holds every class and marker it
|
|
15
|
+
* draws to a rule in them.
|
|
11
16
|
* The `sf-` names are kept: the hosts' sheets and their guards address them.
|
|
12
17
|
*
|
|
13
18
|
* Load it after the other easel sheets and before a host's own sheet, which is
|
|
@@ -953,6 +958,15 @@
|
|
|
953
958
|
line-height: 1;
|
|
954
959
|
}
|
|
955
960
|
|
|
961
|
+
/* ── Device-aware fields (lib/puck/device-fields.tsx) ─────────────────────────
|
|
962
|
+
A control that belongs to a device the canvas is not showing paints a
|
|
963
|
+
zero-size marker instead of itself, and its row (efficient-easel's public
|
|
964
|
+
`.es-insp-row`, blueprint 4.4) collapses when it holds one, so no gap is left.
|
|
965
|
+
One declarative rule; the row's own "nothing drawn" case is `:empty`. */
|
|
966
|
+
.es-insp-row:has(> [data-sf-device-hidden]) {
|
|
967
|
+
display: none !important;
|
|
968
|
+
}
|
|
969
|
+
|
|
956
970
|
/* ── NO DIVIDER HAIRLINES IN THIS PANEL (card 66334) ──────────────────────────
|
|
957
971
|
The owner asked for these lines to go twice. Deleting our own was only part of
|
|
958
972
|
it: the rule below is drawn by a PACKAGE, it is the majority of what is
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The assembled screen's own words (`efficient-easel/strings`, group
|
|
3
|
+
* `screen`): what it says while a document opens, what it says when one will
|
|
4
|
+
* not, and the word it calls the document in the edit notice.
|
|
5
|
+
*
|
|
6
|
+
* They came with the screen from the website editor, written into the
|
|
7
|
+
* provider, the mount and the notice; a second host (the campaign designer)
|
|
8
|
+
* opens campaigns, not storefront pages, and says so in its own words. So the
|
|
9
|
+
* defaults are the website's English, word for word, and a host lays its own
|
|
10
|
+
* over them with `EaselStringsProvider`.
|
|
11
|
+
*
|
|
12
|
+
* A plain module with no import: the catalogue reads it, and the catalogue
|
|
13
|
+
* imports nothing (`tests/strings-leaf-safety.test.ts`). Anything with a value
|
|
14
|
+
* in it is a function.
|
|
15
|
+
*
|
|
16
|
+
* What a sentence for a MISSING document is can also depend on the target, and
|
|
17
|
+
* that is the layer's to say (`DocumentAddressing.describeMissing`): these are
|
|
18
|
+
* the words the screen says when the layer says none.
|
|
19
|
+
*/
|
|
20
|
+
type ScreenWords = {
|
|
21
|
+
/** While the document is on its way, and while an entry may still bounce. */
|
|
22
|
+
loading: string;
|
|
23
|
+
/** Before the console's sign-in has reached an editor that needs it. */
|
|
24
|
+
waitingForAuthorization: string;
|
|
25
|
+
/** A website template's page that could not be opened. */
|
|
26
|
+
missingTemplatePage: string;
|
|
27
|
+
/** A website page that is not there, by the slug it was asked for. */
|
|
28
|
+
missingPage: (v: {
|
|
29
|
+
slug: string;
|
|
30
|
+
}) => string;
|
|
31
|
+
/** A host's own document (`{ kind: "document" }`) that is not there. */
|
|
32
|
+
missingDocument: string;
|
|
33
|
+
/** A load that failed: the plain lead-in, then what came back (`cause`). */
|
|
34
|
+
loadFailed: (v: {
|
|
35
|
+
cause: string;
|
|
36
|
+
}) => string;
|
|
37
|
+
/** What the document is called in the edit notice's sentences ("this page"). */
|
|
38
|
+
noun: string;
|
|
39
|
+
};
|
|
40
|
+
declare const DEFAULT_SCREEN_WORDS: ScreenWords;
|
|
41
|
+
|
|
42
|
+
export { DEFAULT_SCREEN_WORDS, type ScreenWords };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{DEFAULT_SCREEN_WORDS}from"../chunk-ZWK3CBRU.js";
|
|
@@ -7,6 +7,7 @@ import { F as FieldsWords } from '../words-D8kf071T.js';
|
|
|
7
7
|
import { N as NodeMenuWords } from '../words-DMG4dYq2.js';
|
|
8
8
|
import { P as PanelWords } from '../words-BGrHZAJJ.js';
|
|
9
9
|
import { P as PickWords } from '../words-is_Vy6hn.js';
|
|
10
|
+
import { ScreenWords } from '../screen/words.js';
|
|
10
11
|
import { S as StyleClipboardWords } from '../words-CnnHb9jo.js';
|
|
11
12
|
import { T as TextStylesWords } from '../words-CRYvAiHX.js';
|
|
12
13
|
import { T as TreeWords } from '../words-DgHcY5qB.js';
|
|
@@ -51,7 +52,10 @@ type RailWords = {
|
|
|
51
52
|
* Every word and sentence this package itself draws or returns — visible text,
|
|
52
53
|
* `aria-label`s, tooltips, placeholders — is an entry here, grouped by the
|
|
53
54
|
* module that says it. What a HOST supplies (a block's name, a field's label, a
|
|
54
|
-
* tile's caption, the document's noun) was never the engine's and is not here
|
|
55
|
+
* tile's caption, the document's noun) was never the engine's and is not here —
|
|
56
|
+
* with one exception: the assembled screen (`efficient-easel/screen`) draws the
|
|
57
|
+
* edit notice itself, so the noun it says it with is a word of its own group,
|
|
58
|
+
* the website's "page" until a host says another.
|
|
55
59
|
*
|
|
56
60
|
* - A plain word is a `string`.
|
|
57
61
|
* - Anything with a value in it, or a count that can be one or many, is a
|
|
@@ -106,6 +110,9 @@ interface EaselStrings {
|
|
|
106
110
|
canvas: CanvasWords;
|
|
107
111
|
/** `efficient-easel/text-styles` — the Email styles / Site styles list (E6). */
|
|
108
112
|
textStyles: TextStylesWords;
|
|
113
|
+
/** `efficient-easel/screen` — a document opening, one that will not, and the
|
|
114
|
+
* notice's word for the document. */
|
|
115
|
+
screen: ScreenWords;
|
|
109
116
|
}
|
|
110
117
|
/** Today's English, word for word. */
|
|
111
118
|
declare const DEFAULT_EASEL_STRINGS: EaselStrings;
|
|
@@ -124,4 +131,4 @@ type DeepPartial<T> = T extends (...args: never[]) => unknown ? T : T extends ob
|
|
|
124
131
|
*/
|
|
125
132
|
declare function mergeEaselStrings(defaults: EaselStrings, partial?: DeepPartial<EaselStrings> | null): EaselStrings;
|
|
126
133
|
|
|
127
|
-
export { type CanvasWords, ChromeWords, CopyWords, DEFAULT_EASEL_STRINGS, type DeepPartial, DragWords, type EaselStrings, FieldsWords, LockWords, NodeMenuWords, NoticeWords, PanelWords, PickWords, type RailWords, SaveWords, StyleClipboardWords, TextStylesWords, TreeWords, mergeEaselStrings };
|
|
134
|
+
export { type CanvasWords, ChromeWords, CopyWords, DEFAULT_EASEL_STRINGS, type DeepPartial, DragWords, type EaselStrings, FieldsWords, LockWords, NodeMenuWords, NoticeWords, PanelWords, PickWords, type RailWords, SaveWords, ScreenWords, StyleClipboardWords, TextStylesWords, TreeWords, mergeEaselStrings };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-
|
|
1
|
+
export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-6UJ3Y6FC.js";import"../chunk-M6F6LS3H.js";import"../chunk-6WY6ZXJG.js";import"../chunk-ZWK3CBRU.js";import"../chunk-AELNNAFM.js";import"../chunk-3EDSDPIP.js";import"../chunk-QTLAVDJE.js";import"../chunk-WK3AFPXY.js";import"../chunk-H6DDIBQ4.js";import"../chunk-ZJEBF4NB.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import"../chunk-UH7IGZKF.js";import"../chunk-ZAOM6PFH.js";import"../chunk-FPOKPNO4.js";import"../chunk-546BBOPE.js";import"../chunk-O2NLQBFX.js";
|
package/dist/strings/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export { N as NodeMenuWords } from '../words-DMG4dYq2.js';
|
|
|
11
11
|
export { P as PanelWords } from '../words-BGrHZAJJ.js';
|
|
12
12
|
export { P as PickWords } from '../words-is_Vy6hn.js';
|
|
13
13
|
export { S as SaveWords } from '../words-D_Lnw1Gr.js';
|
|
14
|
+
export { ScreenWords } from '../screen/words.js';
|
|
14
15
|
export { S as StyleClipboardWords } from '../words-CnnHb9jo.js';
|
|
15
16
|
export { T as TextStylesWords } from '../words-CRYvAiHX.js';
|
|
16
17
|
export { T as TreeWords } from '../words-DgHcY5qB.js';
|
package/dist/strings/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{DEFAULT_EASEL_STRINGS as r,mergeEaselStrings as n}from"../chunk-
|
|
1
|
+
import{DEFAULT_EASEL_STRINGS as r,mergeEaselStrings as n}from"../chunk-6UJ3Y6FC.js";export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-6UJ3Y6FC.js";import"../chunk-M6F6LS3H.js";import"../chunk-6WY6ZXJG.js";import"../chunk-ZWK3CBRU.js";import"../chunk-AELNNAFM.js";import"../chunk-3EDSDPIP.js";import"../chunk-QTLAVDJE.js";import"../chunk-WK3AFPXY.js";import"../chunk-H6DDIBQ4.js";import"../chunk-ZJEBF4NB.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import"../chunk-UH7IGZKF.js";import"../chunk-ZAOM6PFH.js";import"../chunk-FPOKPNO4.js";import"../chunk-546BBOPE.js";import{stringsContext as o}from"../chunk-MFIRYGHW.js";import"../chunk-O2NLQBFX.js";import{useContext as t,useMemo as c}from"react";import{jsx as i}from"react/jsx-runtime";function s({value:s,locale:u,children:m}){const e=o(),p=t(e),h=p?.strings??r,j=u??p?.locale??"en",k=c(()=>({strings:n(h,s),locale:j}),[h,s,j]);/* @__PURE__ */
|
|
2
2
|
return i(e.Provider,{value:k,children:m})}function u(){return t(o())?.strings??r}function m(){return t(o())?.locale??"en"}export{s as EaselStringsProvider,m as useEaselLocale,u as useEaselStrings};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-easel",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.103.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",
|
|
@@ -506,6 +506,11 @@
|
|
|
506
506
|
"types": "./dist/screen/lib/session-context.d.ts",
|
|
507
507
|
"import": "./dist/screen/lib/session-context.js",
|
|
508
508
|
"default": "./dist/screen/lib/session-context.js"
|
|
509
|
+
},
|
|
510
|
+
"./screen/words": {
|
|
511
|
+
"types": "./dist/screen/words.d.ts",
|
|
512
|
+
"import": "./dist/screen/words.js",
|
|
513
|
+
"default": "./dist/screen/words.js"
|
|
509
514
|
}
|
|
510
515
|
},
|
|
511
516
|
"files": [
|
package/dist/chunk-3U4GP5VA.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{clientOnly as e}from"./chunk-GXQCZJOP.js";import{ScreenChrome as n}from"./chunk-F2FPZIZV.js";import{ScreenDocumentProvider as t,useScreenDocument as a}from"./chunk-FT35FX7D.js";import{ScreenStoreProvider as i}from"./chunk-VLSTGOVD.js";import{documentPermissions as r}from"./chunk-JUQ6YJCG.js";import{useMemo as s}from"react";import{jsx as d,jsxs as o,Fragment as c}from"react/jsx-runtime";var l=e(i),m=e(n);function g({saving:e,onCancel:n,onDiscard:t,onSave:a}){/* @__PURE__ */
|
|
2
|
-
return d("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/30 p-4",role:"dialog","aria-modal":"true","aria-labelledby":"sf-leave-title",children:/* @__PURE__ */o("div",{className:"w-full max-w-sm rounded-lg bg-white p-5 shadow-xl",children:[
|
|
3
|
-
/* @__PURE__ */d("h2",{id:"sf-leave-title",className:"text-[15px] font-semibold text-zinc-900",children:"Unsaved changes"}),
|
|
4
|
-
/* @__PURE__ */d("p",{className:"mt-2 text-[13px] leading-relaxed text-zinc-600",children:"Your most recent edits haven’t finished saving yet. Save them before switching, or leave and discard them."}),
|
|
5
|
-
/* @__PURE__ */o("div",{className:"mt-4 flex justify-end gap-2",children:[
|
|
6
|
-
/* @__PURE__ */d("button",{type:"button",onClick:n,className:"rounded-md border border-zinc-300 px-3 py-[7px] text-[13px] font-medium text-zinc-700 transition-colors hover:bg-zinc-100",children:"Cancel"}),
|
|
7
|
-
/* @__PURE__ */d("button",{type:"button",onClick:t,className:"rounded-md border border-red-200 px-3 py-[7px] text-[13px] font-medium text-red-600 transition-colors hover:bg-red-50",children:"Discard & leave"}),
|
|
8
|
-
/* @__PURE__ */d("button",{type:"button",onClick:a,disabled:e,className:"rounded-md bg-blue-600 px-3 py-[7px] text-[13px] font-medium text-white transition-colors hover:bg-blue-700 disabled:opacity-60",children:e?"Saving…":"Save & leave"})]})]})})}function h({target:e,addressing:n,onHostMessage:a,children:i}){/* @__PURE__ */
|
|
9
|
-
return d(t,{target:e,addressing:n,onHostMessage:a,children:i})}var p=(e,n)=>/* @__PURE__ */o(c,{children:[e,n]});function u({config:e,parts:n,wrap:t=p}){const{data:i,error:o,redirecting:c,ready:h,saveStatus:u,readOnly:v,onChange:f,pendingNav:x,cancelPendingNav:b,discardAndNavigate:N,saveAndNavigate:y}=a(),C=s(()=>r(!v),[v]);return c?/* @__PURE__ */d("div",{className:"sf-msg",children:"Loading…"}):o?/* @__PURE__ */d("div",{className:"sf-msg sf-msg--error",children:o}):h?i?t(
|
|
10
|
-
/* @__PURE__ */d(l,{config:e,data:i,onChange:f,permissions:C,parts:n,children:/* @__PURE__ */d(m,{})}),x&&/* @__PURE__ */d(g,{saving:"saving"===u,onCancel:b,onDiscard:N,onSave:()=>{y()}})):/* @__PURE__ */d("div",{className:"sf-msg",children:"Loading…"}):/* @__PURE__ */d("div",{className:"sf-msg",children:"Waiting for editor authorization…"})}export{u as DocumentScreen,h as ScreenMount};
|
package/dist/chunk-7RNTMJER.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{blockTypesIn as e}from"./chunk-5ZBY24K7.js";import{buildPaletteSections as t,pinnedSection as o,paletteWithoutPinned as n,categoryLabel as r}from"./chunk-GENAF3P6.js";import{sectionTemplates as s}from"./chunk-J4RAY75C.js";import{SidePanelHead as i,PanelModeExit as c}from"./chunk-IWAPPEL4.js";import{useEaselSession as l}from"./chunk-6TZTKAB5.js";import{blockRuns as a}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as p,useScreenBlockRules as d}from"./chunk-5464H65G.js";import{useEasel as m}from"./chunk-P67FP7PG.js";import{AddPanel as u}from"./chunk-TTJ54QGG.js";import{AddIcon as f}from"./chunk-L5KW4HG5.js";import{useState as h,useEffect as k,useMemo as y}from"react";import{jsx as b,jsxs as g,Fragment as j}from"react/jsx-runtime";var A=e=>`section:${e}`,$=e=>`block:${e}`,v=e=>`template:${e}`;function G({blocks:G,blocksOnly:I,at:L,onAdd:O,itemFor:P,session:C,siteWide:H,onClose:S,onHide:T,readOnly:x}){const B=m(e=>e.config),F=p(),{labelAtLevel:D,categoryLabel:E,firstSection:K,Icon:N,Thumbnail:W}=F,{blockIsOffered:Y}=d(),w=l(),[z,J]=h([]);k(()=>{let t=!1;const o=e=>Y(e,w);return s.list().then(n=>{if(t)return;const r=B.components;J(n.filter(t=>t.node?.type&&r[t.node.type]&&e(t.node).every(o)))}).catch(()=>{}),()=>{t=!0}},[B,w]);const Q=y(()=>t(B,F),[B]),R=e=>({type:A(e.type),label:e.name,cover:/* @__PURE__ */b(W,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:`Add ${e.name}`,keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),V=y(()=>{const e=[];if(G&&G.choices.length>0&&a(G.choices).forEach((t,o)=>{e.push({title:0===o?`Inside ${G.parentName}${t.group?` · ${t.group}`:""}`:t.group??"",tiles:t.items.map(e=>({type:$(e.type),label:e.label,icon:/* @__PURE__ */b(N,{type:e.type,size:18}),title:`Add ${e.label}`}))})}),I)return e;const t=o(Q,K);t&&e.push({title:"Start blank",tiles:[R(t)]}),z.length>0&&e.push({title:"Your templates",tiles:z.map(e=>{return{type:v(e.id),label:e.name,cover:/* @__PURE__ */b(W,{type:e.node.type}),keywords:[(t=e.node.type,D(t,"section",B.components[t]?.label??t)),e.node.type]};var t})});const s=n(Q,K);for(const t of Object.keys(B.categories??{})){const o=s.filter(e=>e.cat===t);0!==o.length&&e.push({title:r(B,t,E),tiles:o.map(R)})}return e},[G,I,z,Q,B]),Z=e=>{const t=e.indexOf(":"),o=e.slice(0,t),n=e.slice(t+1);if("section"===o)return{kind:"section",type:n};if("block"===o)return{kind:"block",type:n};if("template"===o){const e=z.find(e=>e.id===n);return e?{kind:"template",template:e}:null}return null};/* @__PURE__ */
|
|
2
|
-
return g(j,{children:[
|
|
3
|
-
/* @__PURE__ */b(i,{icon:/* @__PURE__ */b(f,{size:15}),title:"Add",context:I?"Blocks for this place":"Sections and blocks",actions:/* @__PURE__ */b(c,{label:"Done",description:"Close Add and go back",onClick:S}),onHide:T}),
|
|
4
|
-
/* @__PURE__ */g("div",{className:"sf-addside sf-scroll",children:[
|
|
5
|
-
/* @__PURE__ */b(u,{groups:V,session:C,itemFor:e=>P(Z(e)??{kind:"section",type:e}),onInsert:e=>{const t=Z(e);t&&O(t)},at:L,hint:I?"Drag into the page, or click to add.":"Drag onto the page, or click to add.",searchLabel:I?"Search blocks":"Search sections",readOnly:x}),H&&!I?H:null]})]})}export{G as AddSidePanel,$ as blockKey,A as sectionKey,v as templateKey};
|