efficient-easel 23.0.0 → 23.1.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 +7 -0
- package/dist/chunk-22I55W37.js +2 -0
- package/dist/chunk-2FYFAAAK.js +2 -0
- package/dist/chunk-6QSFJCJT.js +21 -0
- package/dist/chunk-DSKNJXB4.js +1 -0
- package/dist/{chunk-3P735WOM.js → chunk-HNV6HUSQ.js} +1 -1
- package/dist/chunk-JPCOBNYW.js +1 -0
- package/dist/{chunk-HLMQ34GP.js → chunk-JWOBAEBH.js} +1 -1
- package/dist/{chunk-FOOK54T2.js → chunk-LSTOOYG7.js} +1 -1
- package/dist/{chunk-FF54HWSE.js → chunk-NQ7NRYTK.js} +8 -8
- package/dist/{chunk-YHEYJKQL.js → chunk-T3LAGI43.js} +1 -1
- package/dist/chunk-TGSK5VII.js +5 -0
- package/dist/chunk-VBOSOH5M.js +16 -0
- package/dist/{chunk-XJ23ULBP.js → chunk-VHFLOHGQ.js} +1 -1
- package/dist/chunk-YCSZAP7T.js +1 -0
- package/dist/{chunk-VZUXOZGP.js → chunk-Z6V22QRZ.js} +30 -30
- package/dist/easel/easel.css +12 -9
- package/dist/easel/index.js +1 -1
- package/dist/fields/index.d.ts +35 -1
- package/dist/fields/index.js +1 -1
- package/dist/rowMarks-CO5TpfLY.d.ts +44 -0
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenMount.d.ts +1 -1
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.js +1 -1
- package/dist/screen/components/SectionScreenShell.js +17 -17
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/document/device-fields.d.ts +7 -21
- package/dist/screen/lib/document/device-fields.js +1 -1
- package/dist/screen/lib/document/panel-no-control-mark.d.ts +3 -7
- package/dist/screen/lib/document/panel-no-control-mark.js +1 -1
- package/dist/screen/lib/document/style-clipboard.js +1 -1
- package/dist/screen/lib/document/use-section-ops.js +1 -1
- package/dist/screen/lib/key-scope.js +1 -1
- package/dist/screen/lib/screen-parts.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-4YUC7B7E.js +0 -2
- package/dist/chunk-6F5GO337.js +0 -1
- package/dist/chunk-G3HAKQUF.js +0 -1
- package/dist/chunk-GXRS52JD.js +0 -5
- package/dist/chunk-INRERJU4.js +0 -2
- package/dist/chunk-KXTXYINN.js +0 -16
- package/dist/chunk-MXECWHRJ.js +0 -21
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{cloneNodeWithFreshIds as e}from"./chunk-OXZDSOZV.js";import{dedupeSlotChildren as n}from"./chunk-7OCEPOEJ.js";import{styleClipboardOf as t}from"./chunk-
|
|
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
2
|
return ct(Zn,{open:!0,size:"sm",title:o.makeShared,description:o.makeSharedHint,onClose:t,initialFocus:a,footer:/* @__PURE__ */pt(ut,{children:[
|
|
3
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=
|
|
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
5
|
/* @__PURE__ */ct(Kn,{content:e.reach,children:/* @__PURE__ */pt(Wn,{colorClass:Qn("success","solid"),size:"sm",children:[
|
|
6
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
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:[
|
|
@@ -9,56 +9,56 @@ return ct("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"
|
|
|
9
9
|
/* @__PURE__ */ct("path",{d:"M8 15l4 4 4-4"})]}:{children:[
|
|
10
10
|
/* @__PURE__ */ct("path",{d:"M8 4l4 4 4-4"}),
|
|
11
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:
|
|
13
|
-
return new Set}});
|
|
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:
|
|
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=>Pe(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(F),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)},Pl=(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})},Bl=An(/* @__PURE__ */new Set);Fn(()=>{pi.forEach(e=>{const n=br(e.type)?.spec;if(!n)return;const t=e.props.id;if(Bl.current.has(t))return;Bl.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);Fn(()=>{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),jl=$l>=0?pi[$l]:null,Tl=qt?pi.findIndex(Zt):-1,Al=Tl>=0?pi[Tl]:null,Ll=Yt.groupTab,El=Ln(()=>Ll?e=>Jt(e.type):void 0,[Ll]),Fl=Boolean(Yt.groupBadge),Rl=Yt.sharedReach,Dl=e=>Rl?.(e)??void 0,Hl=Ln(()=>Rl?new Set(pi.filter(e=>Dl(e)).map(e=>String(e.props.id))):null,[pi,Rl]),Vl=Ln(()=>Hl?e=>Hl.has(e):void 0,[Hl]),Yl=Yt.first?Rl?.({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)))}),jl&&(Xl.push(String(jl.props.id)),Xl.push(...Cl(jl,1,Nl)));const Kl=Xl.length>0&&Xl.every(e=>Tr.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=Bi(e)[t];if(!r)return;const i={...$n(e),index:t},l={...$n(n),index:Math.min(Math.max(o,0),Bi(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 Tn))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,Bi(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<=Bi(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>Bi(o).length)return!1;if(e.zone===o)return!0;const l=jl&&!Yt.lastIsOpen?String(jl.props.id):null;return(!l||ql(e.zone)!==l&&ql(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??Bi(e)[t];if(!r)return!1;const i=n.split(":")[0],l=Ii.get(i),s=l?Bi(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?.(Bi(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?Bi(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=ji(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<=Bi(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?.(Bi(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(F),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:Pn,slot:Bn,index:o})&&rl(o,e.props.id,t.section.title))}const o=Mn(n),r=rs(o);r&&(r.target.spec?Pl(r.parentId,r.target.slot,t.type,n.index,r.parent.type):((e,n,t)=>{yo.insertComponent(e,n,t),nr(F),yo.select({index:t,zone:e})})(o,t.type,n.index))},ds=(e,n)=>{e.media?function(e){const n=Ys();if(!n||!Ds)return;Us(n).then(n=>{n&&function(e,n){if(!Ds)return;const t=Ds.create(e,{nodeDefaults:Ci,newNodeId:Be,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(F),yo.select({index:n.index,zone:o})}(n,e)})}(n):e.rung?Fi(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(Bt),session:as,canDrop:ts,onDrop:ds,onStep:(e,n)=>{e.rung?Fi(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=Rn(e=>{const{floor:n,cap:t}=ui(),o=[];for(const r of e.nodes){const e=Mn(r.place),i=Bi(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==Dt?.props.id?null:String(Dt.props.id),hs=Hn(Ae),fs=hs?.selected()&&Do?.document&&us?hs.selectedPart?.(Do.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=Rn(e=>{const n=Vt,t=e=>!e.item.rung&&null!==jn(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||Rl);xn(Do,"mouseover",e=>{if(!Ss)return;const n=zn(e.target),t=n?gt(Et.data,Vt,n):null;t!==bs&&ks(t)}),xn(Do,"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=Dl(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);Fn(()=>{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:Rt.index},!t||t.doc!==Yn||t.bands===n)return;Rt.hasPast&&Rt.index>=t.index&&!mt.has(Cs)&&(mt.add(Cs),Gr(e,"success",{action:{label:no.bar.undo,onClick:()=>Rt.back()},duration:8e3}))},[pi]);const Ns=e=>{nr(F),yo.select(e.zone===Ce?{index:e.index}:{index:e.index,zone:e.zone})},Is=Q(),Ps=()=>({data:Et.data,device:Oo,ops:yo,inspector:pr}),Bs=Is?.model,Ms=Ln(()=>Bs?e=>Bs(e,ps(e),Ps()):ps,[Bs,ps,Oo]),$s=Is?.measure,js=$s?(e,n)=>$s(e,n,Ps()):void 0,Ts=Is?.canDrop,As=Ts?(e,n)=>Ts(e,n,ts,Ps()):ts,Ls=Is?.drop,Es=Ls?(e,n)=>Ls(e,n,ds,Ps()):ds,Fs=Is?.pick,Rs=Fs?e=>Fs(e,Ns,Ps()):Ns,Ds=Is?.media??null,Hs=An(null),Vs=Ln(()=>Ds?{id:ht,zone:"",index:-1,type:Ds.adds.type,add:{kind:Ds.adds.kind,type:Ds.adds.type},media:!0}:null,[Ds]);Fn(()=>{if(!Vs||Bt||"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,Bt,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(!Ds)return;const t=jn(go.getState().appState.data,hi,n);if(!t)return;const o=t.node;yo.replaceComponent(Mn(t.place),t.place.index,{...o,props:{...Ds.replace(o,e),id:o.props.id}})},Js=e=>{const n=Mn(e),t=ji(n);t&&Li(t.node,t.slot,!1),sl(n,e.index)},Xs=(e,n)=>/* @__PURE__ */ct(We,{...Bt?{}: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=Bi(o),i=Hr(n),l=zi(e.type),s=Sr.rowName?Sr.rowName(e,"section",l):l,d=e=>Xs(o,e);/* @__PURE__ */
|
|
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
16
|
return pt(ut,{children:[
|
|
17
|
-
/* @__PURE__ */ct(
|
|
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
18
|
return pt(Vn,{children:[d(t),
|
|
19
|
-
/* @__PURE__ */ct(
|
|
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
20
|
return pt(Vn,{children:[n.heading,
|
|
21
|
-
/* @__PURE__ */ct(
|
|
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
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
23
|
return pt(Vn,{children:[0===o&&c(t,0),
|
|
24
|
-
/* @__PURE__ */ct(
|
|
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:
|
|
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
26
|
return pt(Vn,{children:[0===o&&m(t,0),
|
|
27
|
-
/* @__PURE__ */ct(
|
|
28
|
-
/* @__PURE__ */ct(S,{small:!0,label:a.addLabel,blocked:a.addBlocked?.(c)??null,onAdd:()=>
|
|
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
29
|
return pt(Vn,{children:[n>0&&gl(n),
|
|
30
|
-
/* @__PURE__ */ct(
|
|
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
31
|
return pt(ut,{children:[
|
|
32
|
-
/* @__PURE__ */ct(
|
|
33
|
-
/* @__PURE__ */ct(Z,{target:
|
|
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
34
|
/* @__PURE__ */pt(Qe,{children:[
|
|
35
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(
|
|
37
|
-
/* @__PURE__ */ct(Ze,{label:no.bar.redo,disabled:Boolean(
|
|
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
38
|
/* @__PURE__ */pt(_e,{children:[
|
|
39
39
|
/* @__PURE__ */ct(qe,{devices:So,value:Oo,onChange:No}),
|
|
40
|
-
/* @__PURE__ */ct(Ze,{label:no.bar.refresh,tip:no.bar.refreshTip,onClick:()=>{
|
|
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
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(
|
|
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
43
|
/* @__PURE__ */ct(re,{}),
|
|
44
44
|
/* @__PURE__ */pt("div",{className:"sf-body",children:[bo?/* @__PURE__ */pt(ut,{children:[
|
|
45
45
|
/* @__PURE__ */pt("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":no.leftPanel,children:[
|
|
46
46
|
/* @__PURE__ */pt("div",{className:"es-paneltabs es-paneltabs--with-hide",children:[
|
|
47
47
|
/* @__PURE__ */ct(C,{side:"left",onHide:si}),
|
|
48
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(
|
|
50
|
-
/* @__PURE__ */ct(O,{icon:/* @__PURE__ */ct(me,{}),title:no.layers,context:co,actions:/* @__PURE__ */pt(ut,{children:[!
|
|
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
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:[!
|
|
53
|
-
/* @__PURE__ */ct(
|
|
54
|
-
/* @__PURE__ */ct(nn,{side:"left",width:Lr.left,min:on.left,max:tn,defaultWidth:f.left,label:no.resizeLeftPanel,onResize:
|
|
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
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
56
|
/* @__PURE__ */pt("div",{className:"sf-frame-scaler",style:ii,children:[
|
|
57
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(
|
|
59
|
-
/* @__PURE__ */ct(hn,{canvas:
|
|
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:
|
|
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:
|
|
62
|
-
/* @__PURE__ */ct(nn,{side:"right",width:Lr.right,min:on.right,max:tn,defaultWidth:f.right,label:no.resizeSettingsPanel,onResize:
|
|
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
63
|
/* @__PURE__ */ct(N,{side:"right",onShow:di})]}),Ki.menu,
|
|
64
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/easel/easel.css
CHANGED
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
.es-zone:empty,
|
|
83
83
|
.es-zone.is-area-selected:not(.is-root),
|
|
84
84
|
.es-zone.is-hovering-area:not(.is-root) {
|
|
85
|
-
background: color-mix(in srgb, var(--es-accent
|
|
86
|
-
outline: 2px dashed color-mix(in srgb, var(--es-accent
|
|
85
|
+
background: color-mix(in srgb, var(--es-accent) 6%, transparent);
|
|
86
|
+
outline: 2px dashed color-mix(in srgb, var(--es-accent) 35%, transparent);
|
|
87
87
|
}
|
|
88
88
|
/* …except an empty list the drag layer draws its "+ Add block" cell over
|
|
89
89
|
(`data-es-empty-cell`, efficient-easel/drag): at rest that slot draws
|
|
@@ -96,10 +96,12 @@
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
/* The outline colour, declared ONCE for the selection, the hover and the
|
|
99
|
-
words being typed
|
|
100
|
-
the canvas frame,
|
|
99
|
+
words being typed: the chrome's accent, no colour of our own. The outlines
|
|
100
|
+
draw inside the canvas frame, a document of its own: `--es-accent` reaches
|
|
101
|
+
it as the frame's `:root` sheet (`canvas/host-tokens`, read off the chrome),
|
|
102
|
+
so the canvas follows the shell's accent. */
|
|
101
103
|
.es-canvas-outline {
|
|
102
|
-
--es-canvas-outline-colour: var(--es-accent
|
|
104
|
+
--es-canvas-outline-colour: var(--es-accent);
|
|
103
105
|
pointer-events: none;
|
|
104
106
|
box-sizing: border-box;
|
|
105
107
|
z-index: 2147483000;
|
|
@@ -114,9 +116,9 @@
|
|
|
114
116
|
}
|
|
115
117
|
/* A node many pages use live (`CanvasSharedContext`; Shared section design v4,
|
|
116
118
|
Lewis 2026-10-21): its selected and hover outlines in the shell's success
|
|
117
|
-
colour, as its Layers row and tab are.
|
|
118
|
-
|
|
119
|
-
our own (harness UI-24). */
|
|
119
|
+
colour, as its Layers row and tab are. `--status-success-solid` reaches the
|
|
120
|
+
frame the same way (`canvas/host-tokens`); without it, the accent. No
|
|
121
|
+
colour of our own (harness UI-24). */
|
|
120
122
|
.es-canvas-outline.is-shared {
|
|
121
123
|
--es-canvas-outline-colour: var(--status-success-solid, var(--es-accent));
|
|
122
124
|
}
|
|
@@ -125,7 +127,8 @@
|
|
|
125
127
|
colour, 4px clear of them, with the selection outline's square corners. It
|
|
126
128
|
is measured from the words' bounding box, so words on three lines get one
|
|
127
129
|
rectangle, not a line round each. Its colour is the one outline colour
|
|
128
|
-
above:
|
|
130
|
+
above: a frame without the chrome's token (`canvas/host-tokens`) draws no
|
|
131
|
+
outline. */
|
|
129
132
|
.es-canvas-outline.is-typing,
|
|
130
133
|
.es-canvas-outline.is-selected.is-words {
|
|
131
134
|
outline: 2px solid var(--es-canvas-outline-colour);
|
package/dist/easel/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{CanvasFrame,CanvasPartsContext,CanvasPassThroughContext,CanvasSharedContext,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,partHasOwnBox,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useRootFields,useSelectedFields,validSelection}from"../chunk-
|
|
1
|
+
export{CanvasFrame,CanvasPartsContext,CanvasPassThroughContext,CanvasSharedContext,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,partHasOwnBox,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useRootFields,useSelectedFields,validSelection}from"../chunk-VBOSOH5M.js";import"../chunk-TBY3DFKS.js";import"../chunk-AGWKB77Q.js";import"../chunk-RPMSET77.js";import"../chunk-HZSZT3BE.js";import"../chunk-KRL3IUV3.js";import"../chunk-MFIRYGHW.js";import"../chunk-YU3WHLGI.js";import"../chunk-LF3FUSCQ.js";import"../chunk-TGZCD6IP.js";import"../chunk-KXM6YRG2.js";
|
package/dist/fields/index.d.ts
CHANGED
|
@@ -162,6 +162,11 @@ interface FieldPlan {
|
|
|
162
162
|
* `bucket` ends nothing: it is a key the host keeps and nothing more. One level only — a band in a band
|
|
163
163
|
* cannot be said. A band whose rows are all hidden draws nothing
|
|
164
164
|
* (`Inspector`).
|
|
165
|
+
*
|
|
166
|
+
* THE VIEW (Lewis, 2026-10-27). When `show.context.device` is `"mobile"` (the phone
|
|
167
|
+
* view), a row without a phone value is not planned either: it would write the
|
|
168
|
+
* desktop value under the phone's name (`fieldShownInView`). Its `bucket` and
|
|
169
|
+
* `fold` still count, as for a show-when row.
|
|
165
170
|
*/
|
|
166
171
|
declare function planFields(fields: InspectorFields, show?: ShowWhenInput): FieldPlan;
|
|
167
172
|
/**
|
|
@@ -259,6 +264,35 @@ interface InspectorProps {
|
|
|
259
264
|
*/
|
|
260
265
|
declare function Inspector({ fields, values, onChange, readOnly, context, showWhenContext, tab, onTab, tabs, tabIcons, renderers, idPrefix, ariaLabel, lead, children, leadFold, closedFolds, onFold, headingLevel, }: InspectorProps): react.JSX.Element;
|
|
261
266
|
|
|
267
|
+
/**
|
|
268
|
+
* IS THIS ROW DRAWN IN THIS VIEW? — the one gate (Lewis, 2026-10-27).
|
|
269
|
+
*
|
|
270
|
+
* In the phone view the panel draws only rows that have a phone value of their
|
|
271
|
+
* own: a `deviceField("mobile", …)`, which is a phone twin or a phone-only row,
|
|
272
|
+
* or a `deviceField("each", …)`, one row that writes the view's own value.
|
|
273
|
+
* Every other row writes the DESKTOP value, so drawing it under the phone view
|
|
274
|
+
* lets a merchant move the desktop while they look at the phone. The phone and
|
|
275
|
+
* the desktop are set apart and do not disturb each other.
|
|
276
|
+
*
|
|
277
|
+
* The answer comes from the one mark `deviceField` stamps (`deviceMetaOf`). It
|
|
278
|
+
* is not a list, and not a second filter beside the gate: a row is either
|
|
279
|
+
* gated to the phone or it is not a phone row.
|
|
280
|
+
*
|
|
281
|
+
* Never hidden by it, because they are not setting rows: a heading or tab mark
|
|
282
|
+
* (`marker`), a slot (it draws nothing; its name has a tab), and a field that
|
|
283
|
+
* draws no control anywhere (`noControlField(…, "always")`: the device note). Every other view (desktop, tablet, or no
|
|
284
|
+
* view named) draws every row, as before: tablet shows the desktop values.
|
|
285
|
+
*
|
|
286
|
+
* A host says which view it is in by `showWhenContext.device`; `"mobile"` is
|
|
287
|
+
* the phone. A host with no such fact (the campaign designer today) sees no
|
|
288
|
+
* change until it passes one.
|
|
289
|
+
*
|
|
290
|
+
* The `Inspector`'s `lead` (the host's own entry rows above the planned rows:
|
|
291
|
+
* the website's text boxes) is one more ungated row, so it is asked the same
|
|
292
|
+
* way: `fieldShownInView(LEAD_ROW, device)`. It is never a phone value.
|
|
293
|
+
*/
|
|
294
|
+
declare function fieldShownInView(field: unknown, device: unknown): boolean;
|
|
295
|
+
|
|
262
296
|
/** What a block may declare about its fields. */
|
|
263
297
|
interface FieldsBlock {
|
|
264
298
|
fields?: object;
|
|
@@ -518,4 +552,4 @@ declare function optionFor<V>(options: readonly FieldOption<V>[], value: V | und
|
|
|
518
552
|
declare function FieldSelect<V>(props: FieldSelectManyProps<V>): ReactNode;
|
|
519
553
|
declare function FieldSelect<V>(props: FieldSelectOneProps<V>): ReactNode;
|
|
520
554
|
|
|
521
|
-
export { FieldNumber, FieldNumberProps, FieldOption, type FieldPlan, FieldRenderer, FieldSelect, FieldSelectManyProps, FieldSelectOneProps, FieldSlider, FieldSliderProps, FieldText, FieldTextProps, type FieldsBlock, Inspector, InspectorField, InspectorFieldDef, type InspectorFieldProps, InspectorFields, type InspectorProps, ListField, type ListFieldProps, type PlannedFold, type PlannedRow, type ResolvedFieldsInput, SettingsBucket, type ShowWhenInput, bucketsOf, copyItem, fieldIsShown, insertAt, labelOf, moveTo, optionFor, planFields, removeAt, shownFields, useResolvedFields };
|
|
555
|
+
export { FieldNumber, FieldNumberProps, FieldOption, type FieldPlan, FieldRenderer, FieldSelect, FieldSelectManyProps, FieldSelectOneProps, FieldSlider, FieldSliderProps, FieldText, FieldTextProps, type FieldsBlock, Inspector, InspectorField, InspectorFieldDef, type InspectorFieldProps, InspectorFields, type InspectorProps, ListField, type ListFieldProps, type PlannedFold, type PlannedRow, type ResolvedFieldsInput, SettingsBucket, type ShowWhenInput, bucketsOf, copyItem, fieldIsShown, fieldShownInView, insertAt, labelOf, moveTo, optionFor, planFields, removeAt, shownFields, useResolvedFields };
|
package/dist/fields/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-
|
|
1
|
+
export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,fieldShownInView,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-6QSFJCJT.js";export{fieldIsShown,showWhenOf,shownFields,withShowWhen}from"../chunk-BPXEFVSQ.js";import"../chunk-YCSZAP7T.js";import"../chunk-WHS6Y55E.js";import"../chunk-K56YDHYQ.js";export{FieldSlider}from"../chunk-ZEH6QLBH.js";export{useResolvedFields}from"../chunk-AGWKB77Q.js";import"../chunk-FIVU2COQ.js";import"../chunk-FM6JO4WF.js";import"../chunk-KFV7N2DJ.js";export{FieldNumber}from"../chunk-Y2T3JX7K.js";export{FieldSelect,optionFor}from"../chunk-KFWNGPW3.js";import"../chunk-JACEEVVF.js";import"../chunk-S3DUFDQ6.js";import"../chunk-MFIRYGHW.js";import"../chunk-6NJHYXJM.js";import"../chunk-P2VEMZH5.js";import"../chunk-TGZCD6IP.js";import"../chunk-KXM6YRG2.js";
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The two marks a field carries about WHERE it is drawn, read by the plan
|
|
3
|
+
* (`./plan`, `./viewRows`) and stamped by the screen's builders.
|
|
4
|
+
*
|
|
5
|
+
* They live here, in the lowest module that needs to read them, because the
|
|
6
|
+
* settings panel (`fields`) cannot import the screen above it. The screen's
|
|
7
|
+
* own paths (`screen/lib/document/device-fields`, `…/panel-no-control-mark`)
|
|
8
|
+
* re-export them under the names hosts already import: one definition, no copy.
|
|
9
|
+
*/
|
|
10
|
+
/** The two tiers a stored value can belong to. Tablet is not one: it shows the
|
|
11
|
+
* desktop values (`screen/lib/document/device-fields` `shownTier`). */
|
|
12
|
+
type DeviceTier = 'desktop' | 'mobile';
|
|
13
|
+
/** Marker carried by every gated field, in the same style as the fold marker:
|
|
14
|
+
* the tier and the field it wraps live ON the field object, never only inside
|
|
15
|
+
* the render closure. Without it a gated control is opaque to every static
|
|
16
|
+
* walk. The editor ignores extra keys. */
|
|
17
|
+
declare const DEVICE_FIELD_MARKER: "__device";
|
|
18
|
+
/**
|
|
19
|
+
* Which views a gated row is drawn in. A {@link DeviceTier} draws the row in
|
|
20
|
+
* that tier's view only. `'each'` draws it in EACH view, where it writes THAT
|
|
21
|
+
* view's own value (Lewis 2026-10-27: the phone and the desktop are set apart
|
|
22
|
+
* and do not disturb each other): one row that holds a desktop value and a phone
|
|
23
|
+
* value of one setting, as the email's text panel and coupon lines do. The gate
|
|
24
|
+
* hands its control the tier it writes now (`screen/lib/document/device-fields`).
|
|
25
|
+
*/
|
|
26
|
+
type DeviceFieldTier = DeviceTier | 'each';
|
|
27
|
+
/** The payload on {@link DEVICE_FIELD_MARKER}. */
|
|
28
|
+
type DeviceFieldMeta = {
|
|
29
|
+
tier: DeviceFieldTier;
|
|
30
|
+
inner: unknown;
|
|
31
|
+
};
|
|
32
|
+
/** Read a field's device payload, or null when it is not gated. The ONE place
|
|
33
|
+
* that knows the marker's shape. */
|
|
34
|
+
declare function deviceMetaOf(field: unknown): DeviceFieldMeta | null;
|
|
35
|
+
/** A field that draws no control, and says so (card 66201). Stamped by
|
|
36
|
+
* `noControlField` (`screen/lib/document/panel-no-control-mark`). */
|
|
37
|
+
declare const NO_CONTROL_FIELD: "__noControl";
|
|
38
|
+
/** The payload on {@link NO_CONTROL_FIELD}. */
|
|
39
|
+
type NoControlFieldMeta = 'always' | 'authored-copy';
|
|
40
|
+
/** Read a field's no-control payload, or `null` when it draws a control of its
|
|
41
|
+
* own. The ONE place that knows the marker's shape. */
|
|
42
|
+
declare function noControlMetaOf(field: unknown): NoControlFieldMeta | null;
|
|
43
|
+
|
|
44
|
+
export { type DeviceFieldTier as D, type NoControlFieldMeta as N, type DeviceTier as a, DEVICE_FIELD_MARKER as b, type DeviceFieldMeta as c, deviceMetaOf as d, NO_CONTROL_FIELD as e, noControlMetaOf as n };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{AddBlockRow as default}from"../../chunk-
|
|
1
|
+
export{AddBlockRow as default}from"../../chunk-JWOBAEBH.js";import"../../chunk-RUQOIQWI.js";import"../../chunk-TGSK5VII.js";import"../../chunk-FHCKFOCD.js";import"../../chunk-MQA7OFRA.js";import"../../chunk-IYHO4XQX.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-VBOSOH5M.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-6QSFJCJT.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import"../../chunk-WHS6Y55E.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-AGWKB77Q.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-RPMSET77.js";import"../../chunk-FM6JO4WF.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-HZSZT3BE.js";import"../../chunk-KRL3IUV3.js";import"../../chunk-Y2T3JX7K.js";import"../../chunk-KFWNGPW3.js";import"../../chunk-JACEEVVF.js";import"../../chunk-S3DUFDQ6.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-6NJHYXJM.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-YU3WHLGI.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-TGZCD6IP.js";import"../../chunk-KXM6YRG2.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{blockKey,AddSidePanel as default,sectionKey,sharedKey,templateKey}from"../../chunk-
|
|
1
|
+
export{blockKey,AddSidePanel as default,sectionKey,sharedKey,templateKey}from"../../chunk-NQ7NRYTK.js";import"../../chunk-VKPOH6MK.js";import"../../chunk-IZGFJWH4.js";import"../../chunk-N7E6264U.js";import"../../chunk-N3MJOHAG.js";import"../../chunk-SINAM2IT.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-RUQOIQWI.js";import"../../chunk-TGSK5VII.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-FHCKFOCD.js";import"../../chunk-YM4UEGBV.js";import"../../chunk-SNF5764Q.js";import"../../chunk-MQA7OFRA.js";import"../../chunk-IYHO4XQX.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-VBOSOH5M.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-6QSFJCJT.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import"../../chunk-WHS6Y55E.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-AGWKB77Q.js";import"../../chunk-ZKY45F5G.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-RPMSET77.js";import"../../chunk-FM6JO4WF.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-ZG6PVMC3.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-AJSDWWJW.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-HZSZT3BE.js";import"../../chunk-KRL3IUV3.js";import"../../chunk-Y2T3JX7K.js";import"../../chunk-KFWNGPW3.js";import"../../chunk-JACEEVVF.js";import"../../chunk-S3DUFDQ6.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-LN43DP2A.js";import"../../chunk-TQ5Y6S2X.js";import"../../chunk-6NJHYXJM.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-YU3WHLGI.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-TGZCD6IP.js";import"../../chunk-KXM6YRG2.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ScreenChrome as default}from"../../chunk-
|
|
1
|
+
export{ScreenChrome as default}from"../../chunk-Z6V22QRZ.js";import"../../chunk-OXZDSOZV.js";import"../../chunk-7OCEPOEJ.js";import"../../chunk-DSKNJXB4.js";import"../../chunk-UMBNBCL4.js";import"../../chunk-5XL2RXFU.js";import"../../chunk-2FYFAAAK.js";import"../../chunk-22I55W37.js";import"../../chunk-3QB2ZQXK.js";import"../../chunk-DDH2DYQP.js";import"../../chunk-T3LAGI43.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-C56MPJBH.js";import"../../chunk-JPCOBNYW.js";import"../../chunk-LSTOOYG7.js";import"../../chunk-PY7OOQEZ.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-5545A3PC.js";import"../../chunk-NQ7NRYTK.js";import"../../chunk-VKPOH6MK.js";import"../../chunk-IZGFJWH4.js";import"../../chunk-N7E6264U.js";import"../../chunk-N3MJOHAG.js";import"../../chunk-SINAM2IT.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-RUQOIQWI.js";import"../../chunk-TGSK5VII.js";import"../../chunk-2G6MAXPY.js";import"../../chunk-AT4DDMJS.js";import"../../chunk-GKG3M5QK.js";import"../../chunk-A6ZP5II4.js";import"../../chunk-77IWWW6X.js";import"../../chunk-ERR437B5.js";import"../../chunk-UNVKPVZW.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-BIK3AO2V.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-FHCKFOCD.js";import"../../chunk-YM4UEGBV.js";import"../../chunk-SNF5764Q.js";import"../../chunk-MQA7OFRA.js";import"../../chunk-XFYFKITX.js";import"../../chunk-IYHO4XQX.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-SSRYU3YG.js";import"../../chunk-AJ2SUSET.js";import"../../chunk-ANPOR6EY.js";import"../../chunk-6UAEFOJ4.js";import"../../chunk-R4AUZVA3.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-VBOSOH5M.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-6QSFJCJT.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import"../../chunk-WHS6Y55E.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-AGWKB77Q.js";import"../../chunk-ZKY45F5G.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-P5VYGWYO.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-RPMSET77.js";import"../../chunk-FM6JO4WF.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-ZG6PVMC3.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-AJSDWWJW.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-HZSZT3BE.js";import"../../chunk-KRL3IUV3.js";import"../../chunk-Y2T3JX7K.js";import"../../chunk-KFWNGPW3.js";import"../../chunk-JACEEVVF.js";import"../../chunk-S3DUFDQ6.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-LN43DP2A.js";import"../../chunk-TQ5Y6S2X.js";import"../../chunk-6NJHYXJM.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-YU3WHLGI.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-TGZCD6IP.js";import"../../chunk-KXM6YRG2.js";import"../../chunk-BSPCSC45.js";import"../../chunk-467WWV4I.js";import"../../chunk-TIAWIOGD.js";import"../../chunk-MGVI67QV.js";
|
|
@@ -83,6 +83,6 @@ declare function DocumentScreen({ config, parts, wrap, }: {
|
|
|
83
83
|
* where the screen is drawn, and not a component: what it returns is mounted
|
|
84
84
|
* in this component's place, with nothing between. */
|
|
85
85
|
wrap?: (screen: ReactNode, leavePrompt: ReactNode) => ReactNode;
|
|
86
|
-
}): string | number | boolean |
|
|
86
|
+
}): string | number | boolean | react.JSX.Element | Iterable<ReactNode> | null | undefined;
|
|
87
87
|
|
|
88
88
|
export { DocumentScreen, ScreenMount as default };
|