efficient-easel 26.6.1 → 26.8.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/dist/{chunk-M42IJ4HT.js → chunk-AVTC2WMN.js} +3 -3
- package/dist/chunk-CRITA6CA.js +1 -0
- package/dist/chunk-ETNX2ASF.js +4 -0
- package/dist/{chunk-TGFPW4YU.js → chunk-N7TLQQ3R.js} +1 -1
- package/dist/{chunk-3JIBSQZI.js → chunk-PL2L6G3B.js} +5 -5
- package/dist/chunk-PLTTPHK5.js +1 -0
- package/dist/draw/index.d.ts +1 -1
- package/dist/draw/index.js +1 -1
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/content/style-keys.d.ts +32 -2
- package/dist/screen/lib/content/style-keys.js +1 -1
- package/dist/screen/lib/document/block-set-host.js +1 -1
- package/dist/screen/lib/document/button-fields.js +1 -1
- package/dist/screen/lib/document/shadow-fields.d.ts +74 -0
- package/dist/screen/lib/document/shadow-fields.js +2 -0
- package/dist/screen/lib/document/shadow-values.d.ts +17 -0
- package/dist/screen/lib/document/shadow-values.js +1 -0
- package/dist/screen/lib/document/style-fields.d.ts +3 -1
- package/dist/screen/lib/document/style-fields.js +1 -1
- package/package.json +14 -2
- package/dist/chunk-BAI7MIH4.js +0 -1
- package/dist/chunk-EZXQJN6V.js +0 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{clientOnly as r}from"./chunk-GXQCZJOP.js";import{ScreenStoreProvider as n}from"./chunk-GQXH7DQV.js";import{ScreenChrome as e}from"./chunk-
|
|
1
|
+
import{clientOnly as r}from"./chunk-GXQCZJOP.js";import{ScreenStoreProvider as n}from"./chunk-GQXH7DQV.js";import{ScreenChrome as e}from"./chunk-PL2L6G3B.js";import{ScreenDocumentProvider as i,useScreenDocument as a}from"./chunk-BYONFJVQ.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-Q3VAJMXS.js";import{documentPermissions as s}from"./chunk-YYD257TD.js";import{useWords as c}from"./chunk-MFIRYGHW.js";import{useMemo as t,useState as d,useRef as l,useEffect as m,useCallback as g}from"react";import{Dialog as h,Button as f}from"efficient-shell/ui";import{jsx as u,jsxs as p,Fragment as v}from"react/jsx-runtime";var k=r(n),C=r(e);function N({onCancel:r,onDiscard:n,onSave:e}){const i=c("screen",o).leave,[a,s]=d(!1),t=l(!0);m(()=>(t.current=!0,()=>{t.current=!1}),[]);const k=g(async()=>{s(!0);try{await e()}finally{t.current&&s(!1)}},[e]);/* @__PURE__ */
|
|
2
2
|
return u(h,{open:!0,role:"alertdialog",size:"sm",title:i.title,onClose:r,footer:/* @__PURE__ */p(v,{children:[
|
|
3
3
|
/* @__PURE__ */u(f,{variant:"secondary",onClick:r,children:i.cancel}),
|
|
4
4
|
/* @__PURE__ */u(f,{variant:"ghost-danger",onClick:n,children:i.discard}),
|
|
5
5
|
/* @__PURE__ */u(f,{variant:"primary",loading:a,onClick:()=>{k()},children:i.save})]}),children:i.body})}function j({target:r,addressing:n,onHostMessage:e,children:a}){/* @__PURE__ */
|
|
6
|
-
return u(i,{target:r,addressing:n,onHostMessage:e,children:a})}var y=(r,n)=>/* @__PURE__ */p(v,{children:[r,n]});function
|
|
7
|
-
/* @__PURE__ */u(k,{config:r,data:i,onChange:h,permissions:
|
|
6
|
+
return u(i,{target:r,addressing:n,onHostMessage:e,children:a})}var y=(r,n)=>/* @__PURE__ */p(v,{children:[r,n]});function D({config:r,parts:n,wrap:e=y}){const{data:i,error:d,redirecting:l,ready:m,readOnly:g,onChange:h,pendingNav:f,cancelPendingNav:p,discardAndNavigate:v,saveAndNavigate:j}=a(),D=t(()=>s(!g),[g]),Q=c("screen",o);return l?/* @__PURE__ */u("div",{className:"sf-msg",children:Q.loading}):d?/* @__PURE__ */u("div",{className:"sf-msg sf-msg--error",children:d}):m?i?e(
|
|
7
|
+
/* @__PURE__ */u(k,{config:r,data:i,onChange:h,permissions:D,parts:n,children:/* @__PURE__ */u(C,{})}),f&&/* @__PURE__ */u(N,{onCancel:p,onDiscard:v,onSave:j})):/* @__PURE__ */u("div",{className:"sf-msg",children:Q.loading}):/* @__PURE__ */u("div",{className:"sf-msg",children:Q.waitingForAuthorization})}export{D as DocumentScreen,j as ScreenMount};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var n=["none","soft","lifted"],e="none",o="#141416";function t(e){return n.includes(e)?e:null}export{e as DEFAULT_SHADOW,o as DEFAULT_SHADOW_COLOR,n as SHADOWS,t as shadowValue};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{useAccessPatch as e,FLAT_ACCESS as o,onDesktopWords as r,useAccessValue as t}from"./chunk-EEIDFHOG.js";import{CornersInput as s,BorderInput as l,SettingsColour as n}from"./chunk-CLAADE4J.js";import{SettingsDefaultReset as i}from"./chunk-2T22IY3J.js";import{noControlField as c,NoControlMark as a}from"./chunk-22I55W37.js";import{normalizeCornerSides as d,CORNER_SIDES as u}from"./chunk-PLTTPHK5.js";import{DEFAULT_PANEL_WORDS as p,DEFAULT_COLOUR_ROW_WORDS as y}from"./chunk-56ID6FKZ.js";import{SettingsField as h}from"./chunk-MIX7EGRG.js";import{useWords as f}from"./chunk-MFIRYGHW.js";import{CornerIcon as m,BorderAllIcon as b}from"efficient-shell/icons/efficient";import{jsx as w}from"react/jsx-runtime";var g=e=>e;function v(e,o){const r=o.twinAccess;return r?{key:e.key,access:r,ownField:r.ownField}:e}function k(e,r){const s=!e.access||e.ownField?{value:r.value,onChange:r.onChange}:void 0;return t(e.access??o,e.key,s)}function F(e,r){return t(e.access??o,r??"")}function j(e){return{...c({type:"custom",render:()=>/* @__PURE__ */w(a,{})},"always"),reachedBy:e}}function C({o:t,say:s,props:l}){const i=f("colourRow",y),c=f("panel",p),a=t.useFollows(),d=t.usePresets?.(),u=t.opacity?.useUnset?.()??100,h=v(t,l),[m,b]=k(h,l),[g,j]=F(h,t.opacity?.key),C=e(h.access??o),B="string"==typeof m?m:"",O="number"==typeof g,A="follows"in l,T=(A&&"string"==typeof l.follows&&""!==l.follows?l.follows:void 0)??a,x=t.access||A?void 0:"";/* @__PURE__ */
|
|
2
|
+
return w(n,{label:s(t.label),icon:t.icon,hint:t.hint,value:B,onChange:e=>b(""===e?x:e),inherited:T,presets:d,changed:""!==B||O,onReset:()=>{O&&t.opacity?C([[t.key,x],[t.opacity.key,void 0]]):b(x)},resetTo:A?r(s,T.toUpperCase()):t.resetTo?t.resetTo(a.toUpperCase()):a.toUpperCase(),...t.opacity?{opacity:O?g:u,onOpacityChange:e=>j(e)}:{},readOnly:l.readOnly,words:i,resetWords:c})}var B=20;function O({o:e,say:o,props:t}){const s=e.useFollows(),[n,c]=k(v(e,t),t),a=n&&"object"==typeof n?n:{},d="follows"in t,u=d&&t.follows&&"object"==typeof t.follows?t.follows:{},p="number"==typeof u.width?u.width:s.width,y="string"==typeof u.color&&""!==u.color?u.color:s.color,f=Object.keys(a).length>0,m={width:o("Border width"),sides:{top:o("Border top"),right:o("Border right"),bottom:o("Border bottom"),left:o("Border left")},style:o("Border style"),styles:{solid:o("Solid"),dashed:o("Dashed"),dotted:o("Dotted")},color:o("Border color"),unit:"px"};/* @__PURE__ */
|
|
3
|
+
return w(h,{label:o("Border"),icon:/* @__PURE__ */w(b,{}),action:d?/* @__PURE__ */w(i,{label:o("Border"),changed:f,detail:r(o,`${p}px`),disabled:t.readOnly,onReset:()=>c(void 0)}):void 0,children:/* @__PURE__ */w(l,{label:o("Border"),value:a,each:!1,onChange:o=>c(function(e){const o=Object.fromEntries(Object.entries(e).filter(([,e])=>null!=e&&""!==e));return Object.keys(o).length?o:void 0}(e.styles?{width:o.width,color:o.color,style:o.style}:{width:o.width,color:o.color})),placeholder:{sides:{top:p,right:p,bottom:p,left:p},style:u.style??"solid",color:y},presets:[y],words:m,styles:e.styles??!1,max:20,readOnly:t.readOnly})})}var A=40,T=()=>null;function x({o:r,say:t,props:l}){const n=f("panel",p),c=r.useFollows(),[a,y]=k(r,l),[b,g]=F(r,r.sidesKey),v=e(r.access??o),j=r.access?void 0:null,C="number"==typeof a&&Number.isFinite(a)?a:null,B=d((r.useFollowsSides??T)())??[...u],O=d(b)??B,A=[{value:"tl",label:t("Top left")},{value:"tr",label:t("Top right")},{value:"bl",label:t("Bottom left")},{value:"br",label:t("Bottom right")}];/* @__PURE__ */
|
|
4
|
+
return w(h,{label:t("Corners"),icon:/* @__PURE__ */w(m,{}),changed:null!==C||Array.isArray(b),action:/* @__PURE__ */w(i,{label:t("Corners"),changed:null!==C||Array.isArray(b),detail:`${c}px`,onReset:()=>Array.isArray(b)?v([[r.key,j],[r.sidesKey,j]]):y(j),words:n}),children:/* @__PURE__ */w(s,{label:t("Corners"),value:O,corners:A,onChange:e=>{const o=u.filter(o=>e.includes(o)),r=o.length===B.length&&o.every(e=>B.includes(e));g(r?j:o)},radius:C,onRadiusChange:e=>y(e??j),radiusMin:0,radiusMax:40,radiusStep:r.step??1,radiusPlaceholder:String(c),disabled:l.readOnly})})}function R(e=g){return{colourField:o=>({type:"custom",render:r=>/* @__PURE__ */w(C,{o:o,say:e,props:r})}),borderField:o=>({type:"custom",render:r=>/* @__PURE__ */w(O,{o:o,say:e,props:r})}),cornersField:o=>({type:"custom",render:r=>/* @__PURE__ */w(x,{o:o,say:e,props:r})})}}var{colourField:I,borderField:D,cornersField:E}=R();export{B as BORDER_WIDTH_MAX,A as CORNER_RADIUS_MAX,D as borderField,I as colourField,E as cornersField,j as keptByRow,R as styleFieldBuilders};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{styleFieldBuilders as e,keptByRow as s}from"./chunk-
|
|
1
|
+
import{styleFieldBuilders as e,keptByRow as s}from"./chunk-ETNX2ASF.js";import{boxFieldBuilders as o,PHONE_KEY_ACCESS as l,phoneTwinFields as r,section as i}from"./chunk-EEIDFHOG.js";import{deviceField as t}from"./chunk-7GGNFLHT.js";import{BUTTON_STYLE_KEYS as c,BUTTON_PAD_KEYS as n}from"./chunk-PLTTPHK5.js";import{TextColorIcon as u,GroundIcon as d}from"efficient-shell/icons/efficient";import{jsx as f}from"react/jsx-runtime";function a(a){const F=o(a.say),p=e(a.say),y=c,m=a.style,k=a.phone??l;return{_dSize:i("Size"),...F.sidesPaddingFields({keys:n,group:!1,...a.padding}),_dDesign:i("Design"),[y.fill]:p.colourField({key:y.fill,access:m,label:"Fill color",icon:/* @__PURE__ */f(d,{}),useFollows:a.follows.useFill,usePresets:a.usePresets,resetTo:a.resetTo,opacity:{key:y.fillOpacity,useUnset:a.follows.useFillOpacity}}),[y.fillOpacity]:s(y.fill),[y.border]:p.borderField({key:y.border,access:m,useFollows:a.follows.useBorder}),[y.text]:p.colourField({key:y.text,access:m,label:"Text color",icon:/* @__PURE__ */f(u,{}),useFollows:a.follows.useText,usePresets:a.usePresets,resetTo:a.resetTo}),[y.corners]:p.cornersField({key:y.corners,access:m,sidesKey:y.cornerSides,useFollows:a.follows.useCorners,useFollowsSides:a.follows.useCornerSides}),[y.cornerSides]:s(y.corners),_dLayout:i("Layout"),...r("align",F.blockAlignmentField({phone:!0},""),k),align:t("desktop",F.blockAlignmentField())}}export{a as buttonFieldSet};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{markedTreeNodeId as e,revealSelectedTreeRow as n,sameSelector as t}from"./chunk-UMBNBCL4.js";import{cloneNodeWithFreshIds as o}from"./chunk-OXZDSOZV.js";import{dedupeSlotChildren as r}from"./chunk-7OCEPOEJ.js";import{styleClipboardOf as i}from"./chunk-JYVQ62TL.js";import{scrollPreviewToSection as l,gotoPreviewSlide as s}from"./chunk-LUOY3A3Q.js";import{useEaselKeyTarget as d,useEaselUndoKeys as a,useEaselSaveKey as c,editorRootFocus as p}from"./chunk-CVS3RPO6.js";import{SlotChildActionsProvider as u}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as f,DEFAULT_PANEL_W as h,clampPanelWidth as m}from"./chunk-6EDVZBUO.js";import{usePartBridge as g}from"./chunk-A2B6FLZP.js";import{useSectionOps as y}from"./chunk-YBDSG4BV.js";import{PageEditGuardNotices as v}from"./chunk-TOEJCZUO.js";import{ScreenSaveIcon as b,ScreenMainButton as k}from"./chunk-PVBDKBJB.js";import{useBrowserOffline as S}from"./chunk-RKTF5XLP.js";import{useScreenDocument as w}from"./chunk-BYONFJVQ.js";import{requestMediaPick as x}from"./chunk-JIP5JNRB.js";import{AddChildRow as z}from"./chunk-5545A3PC.js";import{AddSidePanel as C}from"./chunk-2QXMDK67.js";import{keepsSharedSections as O,sharedSectionsOf as B}from"./chunk-N3MJOHAG.js";import{PanelHideButton as N,SidePanelHead as I,PanelShowStrip as P}from"./chunk-SBVIW3KJ.js";import{offeredChoices as T}from"./chunk-RUQOIQWI.js";import{useScreenSaveSwitch as $,useScreenNodeKeys as M,useScreenPinned as j,useScreenDocumentLabel as E,useScreenCanvasFrame as L,useScreenInspectorPanel as A,useScreenDevices as R,useScreenPickFollowsSelection as D,useScreenLeftView as F,SELECTION_MODE as V,isSelectionMode as H,sameInspectorMode as W,useScreenBridges as J,useScreenBlockRules as Y,useScreenBlockLook as U,useScreenStorageNamespace as X,useScreenNotify as Q,useScreenCanvasHead as K,isSlotMode as G,useScreenStyleClipboard as Z,useScreenDocumentPass as _,useScreenCanvasDrag as q,ScreenCanvasTargetProvider as ee,isPinnedFirst as ne,isPinnedLast as te,screenSlotsOf as oe,shownChildSlotsOf as re}from"./chunk-ODHJRBJV.js";import{MediaPopup as ie}from"./chunk-T2RINM7R.js";import{useMediaPanel as le,usePanelPick as se,useMediaBrowsing as de,useOpenMediaBrowse as ae,useMediaPlace as ce}from"./chunk-NCXYC7WI.js";import{useNodeClipboard as pe,useNodeContextMenu as ue}from"./chunk-STQDOTHF.js";import{useEaselSession as fe}from"./chunk-YM4UEGBV.js";import{useEaselHost as he,useHostEscape as me}from"./chunk-LX23TCTP.js";import{LayersIcon as ge,MediaIcon as ye}from"./chunk-XFYFKITX.js";import{DEFAULT_SCREEN_WORDS as ve}from"./chunk-Q3VAJMXS.js";import{heldStyle as be,styleShortcut as ke}from"./chunk-CWELHADJ.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as Se}from"./chunk-6WY6ZXJG.js";import{rootRowName as we,slotChildRowName as xe,slotChildRenameProp as ze,sectionRenameProp as Ce}from"./chunk-5NHQ452C.js";import{ROOT_ZONE as Oe,blockNodeActions as Be,TREE_MAX_DEPTH as Ne,childSlotsOf as Ie,slotFieldsOf as Pe,newNodeId as Te,slotChildrenIn as $e,nestsInTree as Me}from"./chunk-TCAAOYQY.js";import{useEasel as je,useEaselApi as Ee,CanvasPartsContext as Le,partHasOwnBox as Ae,CanvasPassThroughContext as Re,CanvasSharedContext as De}from"./chunk-EVYIDHCK.js";import{TreeRow as Fe,Subtree as Ve,LayersTree as He,TreeGroupLabel as We,TreeRowAction as Je,TreeSeam as Ye}from"./chunk-WHS6Y55E.js";import{DEFAULT_TREE_WORDS as Ue}from"./chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as Xe}from"./chunk-WK3AFPXY.js";import{toItemSelector as Qe,useNodeOps as Ke,clickPick as Ge}from"./chunk-QTHQPJWA.js";import{EaselTopBar as Ze,EaselIconButton as _e,TopBarCluster as qe,DeviceSwitch as en,InspectorIconButton as nn,PanelResizeHandle as tn,MAX_PANEL_W as on,MIN_PANEL_W_BY_SIDE as rn,panelWidthVars as ln}from"./chunk-VBEVZZTV.js";import{DEFAULT_NOTICE_WORDS as sn,DEFAULT_CHROME_WORDS as dn}from"./chunk-AJSDWWJW.js";import{holderOf as an,nameOrSomeone as cn}from"./chunk-YYD257TD.js";import{DEFAULT_LOCK_WORDS as pn}from"./chunk-RE4LP46F.js";import{useWords as un}from"./chunk-MFIRYGHW.js";import{insertSeams as fn,CanvasDragLayer as hn,CanvasInsert as mn}from"./chunk-SQTVXE5D.js";import{DEFAULT_DRAG_WORDS as gn}from"./chunk-TQ5Y6S2X.js";import{createDragSession as yn,useTreeDrag as vn,gapToMoveIndex as bn}from"./chunk-3XECMGXX.js";import{useCanvasFrame as kn,LIST_SELECTOR as Sn,BLOCK_SELECTOR as wn,useCanvasTyping as xn,useCanvasEvent as zn}from"./chunk-TOKMFZPB.js";import{nodeIdAt as Cn,frameRectToHost as On,BLOCK_ATTRIBUTE as Bn,drawnBox as Nn}from"./chunk-FR7EEKFF.js";import{queryMainCopy as In}from"./chunk-7UFKEX72.js";import{ROOT_ID as Pn,ROOT_SLOT as Tn,zoneKey as $n,parseZoneKey as Mn,find as jn,DataError as En}from"./chunk-EUFDQ4KL.js";import{useRef as Ln,useMemo as An,useState as Rn,useEffect as Dn,useCallback as Fn,useLayoutEffect as Vn,useContext as Hn,Fragment as Wn,useId as Jn}from"react";import{ColoredBadge as Yn,Button as Un,Tabs as Xn,toast as Qn,readMediaFileDrag as Kn,Tooltip as Gn,groupColors as Zn,Dialog as _n,FormField as qn,Input as et,MEDIA_FILE_DRAG_TYPE as nt}from"efficient-shell/ui";import{UndoIcon as tt,RedoIcon as ot,RefreshIcon as rt,AddIcon as it,TrashIcon as lt,EyeOffIcon as st,EyeIcon as dt,SharedIcon as at,DuplicateIcon as ct}from"efficient-shell/icons/efficient";import{jsx as pt,jsxs as ut,Fragment as ft}from"react/jsx-runtime";var ht="media-file";function mt({name:e,onMake:n,onCancel:t}){const o=un("screen",ve).shared,[r,i]=Rn(e),[l,s]=Rn(!1),d=Jn(),a=Ln(null),c=async()=>{const e=r.trim();if(e&&!l){s(!0);try{await n(e)}finally{s(!1)}}};/* @__PURE__ */
|
|
2
2
|
return pt(_n,{open:!0,size:"sm",title:o.makeShared,description:o.makeSharedHint,onClose:t,initialFocus:a,footer:/* @__PURE__ */ut(ft,{children:[
|
|
3
3
|
/* @__PURE__ */pt(Un,{variant:"secondary",onClick:t,children:o.cancel}),
|
|
4
4
|
/* @__PURE__ */pt(Un,{variant:"primary",loading:l,disabled:!r.trim(),onClick:()=>{c()},children:o.makeShared})]}),children:/* @__PURE__ */pt("form",{onSubmit:e=>{e.preventDefault(),c()},children:/* @__PURE__ */pt(qn,{label:o.name,htmlFor:d,children:/* @__PURE__ */pt(et,{id:d,ref:a,value:r,onChange:e=>i(e.target.value)})})})})}var gt=/* @__PURE__ */new WeakSet;function yt(e,n,t){const o=jn(e,n,t);if(!o)return null;const r=o.path.find(e=>"root"!==e.parentId);return r?r.parentId:t}function vt({canvas:e,tabs:n,onSelect:t}){const o=Ln(null),[r,i]=Rn({}),l=n.map(e=>`${e.id}:${e.below?1:e.above?2:0}`).join("|");return Vn(()=>{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=On(l,{left:0,top:0,width:r.innerWidth,height:r.innerHeight},e),a={};for(const o of n){const n=In(t,`[${Bn}="${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=On(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=!0===o.above&&s.top-4>d.top,u=o.below?c+4:p?s.top-4:Math.max(s.top,d.top)+6;a[o.id]={left:Math.max(s.left,d.left)+(o.above?0:6),top:u,above: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__ */pt("div",{ref:o,className:"es-band-tabs","aria-hidden":"true",children:n.map(e=>{const n=r[e.id];return n?/* @__PURE__ */pt("span",{className:"es-band-tab"+(n.above?" is-above":""),"data-band-tab":e.id,style:{left:n.left,top:n.top},onClick:n=>{n.stopPropagation(),t(e.id)},children:e.reach?
|
|
@@ -9,10 +9,10 @@ return pt("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"
|
|
|
9
9
|
/* @__PURE__ */pt("path",{d:"M8 15l4 4 4-4"})]}:{children:[
|
|
10
10
|
/* @__PURE__ */pt("path",{d:"M8 4l4 4 4-4"}),
|
|
11
11
|
/* @__PURE__ */pt("path",{d:"M8 20l4-4 4 4"}),
|
|
12
|
-
/* @__PURE__ */pt("path",{d:"M5 12h14"})]})})}var kt=`${Sn}, ${wn}`;function St(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 wt="__rungs",xt=e=>"template"===e.kind?e.template.id:"shared"===e.kind?e.section.id:"preset"===e.kind?e.preset.key:e.type;var zt="screen:band",Ct={duplicate:!0,delete:!0},Ot=()=>null;function Bt(){const Sn=he(),On=Sn.panels?.Toolbar,Bn=(Sn.panels?.useRight??Ot)(),{target:Nn,docId:Jn,capabilities:Gn,currentSlug:Zn,siteId:_n,onPublish:qn,saveState:et,saveConflict:at,retrySave:Bt,toggleAutoSave:Nt,flushSave:It,access:Pt,saveUnreachable:Tt=!1,readOnly:$t,readOnlyReason:Mt=null}=w(),jt=$(),Et=M(),{mediaEditing:Lt,hasEditGuard:At,hasPinnedChrome:Rt}=Gn,{appState:Dt,dispatch:Ft,history:Vt,selectedItem:Ht,getSelectorForId:Wt,config:Jt}=je(e=>e),Yt=j(),{first:Ut,firstGroup:Xt,lastGroup:Qt,isSectionGroup:Kt,sectionGroupZone:Gt,panelOf:Zt}=Yt,_t=Zt(Ut),qt=e=>ne(Yt,e),eo=e=>te(Yt,e),no="node"===Yt.firstRow,to=Yt.band??null,oo=un("screen",ve),ro=un("tree",Ue),io=un("drag",gn),lo=un("notice",sn),so=un("lock",pn),ao=un("menu",Xe),co=un("styleClipboard",Se),po=un("chrome",dn),uo=E()??`/${Zn}`,fo=L(),ho=A(),mo=y({readOnly:$t}),go=y({readOnly:$t,foldIntoHistory:!0}),yo=Ln(null),vo=Ee(),bo=An(()=>({...mo,select:e=>{yo.current=e,mo.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=vo.config;yo.current=Qe(e,t,n)}mo.commitDocument(e,n)}}),[mo,vo]),ko=Dt.ui,So=ko.leftSideBarVisible,wo=ko.rightSideBarVisible,{options:xo,widths:zo,initial:Co,fluid:Oo,fit:Bo}=R(),[No,Io]=Rn(Co),Po=le(),To=Lt&&null!==Po;se(),de();const $o=ae();D(Ht?.props.id);const{read:Mo,write:jo,forSelection:Eo}=F(),[Lo,Ao]=Rn(Mo);Dn(()=>{jo(Lo)},[Lo]);const[Ro,Do]=Rn(0),Fo=Ln(null),Vo=Ln(null),Ho=kn(Vo,{readySelector:kt}),Wo=xn(Ho),Jo=d(Vo);a(Vo,Ho);const Yo=S(),Uo=an(Pt),Xo={state:et,offline:Yo||et.failed&&Tt,readOnlyReason:Mt,editing:Uo?lo.editing({name:cn(Uo.name,so),noun:oo.noun}):null,conflict:null!=at,notSaving:oo.bar.notSaving},Qo=()=>{$t||(et.failed?Bt():It())};c(Vo,Ho,Qo);const[Ko,Go]=Rn(!1),Zo=Ln(!1),[_o,qo]=Rn(null),[er,nr]=Rn([]),[tr,or]=Rn(V);H(tr);const rr=
|
|
13
|
-
return new Set}});Dn(()=>{try{window.localStorage.setItem(Er,JSON.stringify([...Ar]))}catch{}},[Ar]);const[Dr,Fr]=Rn(()=>{if("undefined"==typeof window)return{...h};try{const e=window.localStorage.getItem(Lr);if(!e)return{...h};const n=JSON.parse(e);return{left:m(Number(n.left)||h.left,"left"),right:m(Number(n.right)||h.right,"right")}}catch{return{...h}}});Dn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(Lr,JSON.stringify(Dr))}catch{}},300);return()=>clearTimeout(e)},[Dr]);const Vr=Fn((e,n)=>Fr(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),Hr=Fn(e=>Vr("left",e),[Vr]),Wr=Fn(e=>Vr("right",e),[Vr]),Jr=e=>Ar.has(e),Yr=e=>Rr(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Ur=Ln(!1),Xr=Ln(null);Dn(()=>{if(Ur.current&&!Ko){const e=Xr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??Vo.current?.querySelector(`button[aria-label="${CSS.escape(oo.add.title)}"]`))?.focus(),Xr.current=null}Ur.current=Ko},[Ko]),Dn(()=>{if(!Ko||!Jo)return;const e=e=>{"Escape"===e.key&&ul()};return Jo.addEventListener("keydown",e),()=>Jo.removeEventListener("keydown",e)},[Ko,Jo]),me(Ko,()=>ul()),Dn(()=>{!So&&Ko&&(Go(!1),qo(null),Zo.current=!1)},[So]);const Qr=Q(),Kr=(e,n="success",t)=>{if(Qr)return void(t?Qr(e,"error"===n?"error":"info",t):Qr(e,"error"===n?"error":"info"));const o={sound:!1,action:t?.action,onClose:t?.onClose};"error"===n?Qn.error(e,{...o,duration:t?.duration??3200}):Qn.success(e,{...o,duration:t?.duration??1900})},Gr=Ln(null),[Zr,_r]=Rn(0),[qr,ei]=Rn(0),ni=K(),ti=Ln(null),oi=e=>Math.max(0,e.clientHeight-(ti.current?.offsetHeight??0));Dn(()=>{const e=Gr.current;if(!e)return;const n=()=>{_r(e.clientWidth),ei(oi(e))};n();const t=new ResizeObserver(n);return t.observe(e),ti.current&&t.observe(ti.current),()=>t.disconnect()},[]),Vn(()=>{Gr.current&&(_r(Gr.current.clientWidth),ei(oi(Gr.current)))},[Dr,So,wo]);const ri=No===Oo?Zr>0?Zr:zo[Oo]:zo[No],ii=Zr>0?Math.min(Zr/ri,"shrink"===Bo?1:2):1,li=ri*ii,si=Zr>0&&li>Zr+1,di={width:li,height:qr||"100%",flex:"none",position:"relative"},ai={width:ri,height:qr?qr/ii:"100%",maxHeight:"none",transform:1!==ii?`scale(${ii})`:void 0,transformOrigin:"top left"},ci=()=>Ft({type:"setUi",ui:{leftSideBarVisible:!So}}),pi=()=>Ft({type:"setUi",ui:{rightSideBarVisible:!wo}}),ui=e=>{Ko&&(Go(!1),qo(null),Zo.current=!1,So&&Lo===e)||(Ao(e),So||Ft({type:"setUi",ui:{leftSideBarVisible:!0}}))},fi=()=>{or(_t??V),wo||Ft({type:"setUi",ui:{rightSideBarVisible:!0}})},hi=Dt.data.content??[],mi=()=>{const e=hi.findIndex(qt),n=hi.findIndex(eo);return{floor:e>=0?e+1:0,cap:n>=0?n:hi.length}},gi=Jt,yi=gr.stripCopy,vi=
|
|
14
|
-
return pt("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":oo.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)},Qi=
|
|
15
|
-
return pt(Je,{kind:"eye",label:r?oo.showNamed({name:o}):oo.hideNamed({name:o}),onClick:()=>Sl(e,n,t),children:/* @__PURE__ */pt(r?st:dt,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},kl=e=>nd(Oe,e),Sl=(e,n,t)=>{bo.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},wl=e=>Pe(Jt,e),xl=e=>Ie(Jt,e),zl=e=>gr.slotsOf?Ei(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:$e(e,n.slot)})):[{slot:null,rung:null,kids:re(Jt,e)}],Cl=e=>gr.slotsOf?zl(e).flatMap(e=>e.kids):re(Jt,e),Ol=e=>Boolean(gr.slotsOf)&&Ei(e).some(e=>e.rung),Bl=(e,n,t)=>Sr(e.type,n,t??void 0,xr(e)),Nl=(e,n,t)=>{const o=Me(Jt,e.type,n)&&(t||Cl(e).length>0||Ol(e));return{collapsible:o,folded:o&&Jr(String(e.props.id))}},Il=(e,n,t)=>zl(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>Nl(e,r,t(e.type)).collapsible?[String(e.props.id),...Il(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),Pl=e=>Cl(e).length>0||Ol(e)||Boolean(Sr(e.type)),Tl=e=>Boolean(Sr(e)),$l=(e,n,t,o)=>{if(or(V),Sr(o)?.spec?.slider){const t=e.split(":")[0];s(t,n),bo.select({index:n,zone:e}),l(t)}else bo.select({index:n,zone:e}),l(t)},Ml=(e,n,t,o,r)=>{const i=`${e}:${n}`;bo.insertComponent(i,t,o),Sr(r)?.spec?.slider?requestAnimationFrame(()=>{s(e,o),bo.select({index:o,zone:i})}):bo.select({index:o,zone:i})},jl=Ln(/* @__PURE__ */new Set);Dn(()=>{hi.forEach(e=>{const n=Sr(e.type)?.spec;if(!n)return;const t=e.props.id;if(jl.current.has(t))return;jl.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(Ni)).forEach((e,t)=>go.seedChild(o,t,n.childType,e))})},[hi,go,Ni]);const El=Ln(/* @__PURE__ */new Set);Dn(()=>{hi.forEach((e,t)=>{const o=e.props.id;if(El.current.has(o))return;const r=n(e,wl(e.type));El.current.add(o),r&&go.replaceComponent(Oe,t,{...e,props:r})})},[hi,go]),_(go,Jt);const Ll=hi.findIndex(eo),Al=Ll>=0?hi[Ll]:null,Rl=no?hi.findIndex(qt):-1,Dl=Rl>=0?hi[Rl]:null,Fl=Yt.groupTab,Vl=An(()=>Fl?e=>Kt(e.type):void 0,[Fl]),Hl=Boolean(Yt.groupBadge),Wl=Yt.sharedReach,Jl=e=>Wl?.(e)??void 0,Yl=An(()=>Wl?new Set(hi.filter(e=>Jl(e)).map(e=>String(e.props.id))):null,[hi,Wl]),Ul=An(()=>Yl?e=>Yl.has(e):void 0,[Yl]),Xl=Yt.first?Wl?.({type:Yt.first,props:{id:""}})??void 0:void 0,Ql=Yt.groupBadge?/* @__PURE__ */pt("span",{className:"es-tree-group-badge",children:/* @__PURE__ */pt(Yn,{tone:"info",size:"xs",children:Yt.groupBadge})}):void 0,Kl=hi.find(e=>e.type===Xt)??null,Gl=hi.find(e=>e.type===Qt)??null,Zl=Ll>=0?Ll:hi.length,_l=[];hi.forEach(e=>{eo(e)||(Pl(e)&&_l.push(String(e.props.id)),_l.push(...Il(e,1,Tl)))}),Al&&(_l.push(String(Al.props.id)),_l.push(...Il(Al,1,Tl)));const ql=_l.length>0&&_l.every(e=>Ar.has(e)),es=e=>{const n=zr.blockRowName(e,Bi);return zr.rowName?zr.rowName(e,"block",n):n},ns=(e,n,t,o)=>{const r=Mi(e)[t];if(!r)return;const i={...Mn(e),index:t},l={...Mn(n),index:Math.min(Math.max(o,0),Mi(n).length)},s=bn(i,l);if(e!==n||s!==t)try{ki.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof En))throw e}},ts=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of xl(e))n.add(r),t(o)};for(const t of wl(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},os=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Ti.get(n);if(!e)return null;if(e.zone===Oe)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},rs=e=>{const n=e.slice(0,e.indexOf(":")),t=hi.find(e=>Kt(e.type)&&String(e.props.id)===n);return t&&Gt(n)===e?t:null},is=(e,n)=>{const t=rs(e);return!t||(!Yt.groupAccepts||Yt.groupAccepts(t.type,n,Mi(e).length))},ls=(e,n,t)=>{if(e.rung){const t=ji(e.rung.nodeId),o=t?Ei(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===wt&&n.index>=0&&n.index<=o}if(n.slot===wt)return!1;if(e.add)return cs(e.add,n);const o=$n(n);if(Kt(e.type))return!1;const r=rs(o),i=rs(e.zone);if(r||i)return!(!r||!i)&&(!(r!==i&&!is(o,e.type))&&(n.index>=0&&n.index<=Mi(o).length));if(e.zone===Oe||o===Oe){if(e.zone!==o)return!1;const{floor:t,cap:r}=mi();return n.index>=t&&n.index<=r}if(n.index<0||n.index>Mi(o).length)return!1;if(e.zone===o)return!0;const l=Al&&!Yt.lastIsOpen?String(Al.props.id):null;return(!l||os(e.zone)!==l&&os(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??Mi(e)[t];if(!r)return!1;const i=n.split(":")[0],l=Ti.get(i),s=l?Mi(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&ts(r).has(n))return!1;const d=Sr(s.type,br(Dt?.data,s.type,i),n.slice(n.lastIndexOf(":")+1),xr(s));return!!d&&(!!(d.choices?d.choices.some(e=>e.type===r.type):d.spec?.childType===r.type)&&!d.spec?.addBlocked?.(Mi(n),r))})(e.zone,o,e.index,t)},ss=(e,n)=>{const t=$n(e.from),o=e.node;return t===$n(n)?is(t,o.type):ls({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},ds=e=>{const n=e.slice(0,e.indexOf(":")),t=Ti.get(n),o=t?Mi(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=Sr(o.type,br(Dt?.data,o.type,n),e.slice(e.lastIndexOf(":")+1),xr(o));if(!r||`${n}:${r.slot}`!==e)return null;if("footer"===r.source)return null;const i=T(r.choices??(r.spec?[{type:r.spec.childType,label:Bi(r.spec.childType)}]:[])),l=Li(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:fl(o,t.zone===Oe)}},as=(e,n)=>{if("section"!==e.kind)return e;const t=$n(n);return t===Oe||rs(t)?e:ds(t)?.choices.some(n=>n.type===e.type)?{kind:"block",type:e.type}:e},cs=(e,n)=>{const t=as(e,n),o=$n(n);if("shared"===t.kind){if(o!==Oe||!Yt.shared?.nodeOf(t.section))return!1;const{floor:e,cap:r}=mi();return n.index>=e&&n.index<=r}if("block"!==t.kind){if(rs(o)){if("preset"===t.kind)return!1;const e="section"===t.kind?t.type:t.template.node.type;return is(o,e)&&n.index>=0&&n.index<=Mi(o).length}if(o!==Oe)return!1;const{floor:e,cap:r}=mi();return n.index>=e&&n.index<=r}if(o===Oe)return!1;const r=ds(o);return!(!r||!r.choices.some(e=>e.type===t.type))&&!r.target.spec?.addBlocked?.(Mi(o))},ps=(e,n)=>{const t=as(e,n);if("block"!==t.kind&&rs($n(n)))return void((e,n,t)=>{const o="section"===e.kind?e.type:"template"===e.kind?e.template.node.type:null;if(o&&is(n,o)){if("section"===e.kind)bo.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;bo.insertNode(n,t,vi(e.template.node))}or(V),bo.select({index:t,zone:n})}})(t,$n(n),n.index);if("section"===t.kind)return void al(t.type,n.index);if("template"===t.kind)return void((e,n,t)=>{const o=ll(t),r=bo.insertNode(Oe,o,n);dl(o,r,e)})(t.template.name,vi(t.template.node),n.index);if("preset"===t.kind)return void((e,n,t)=>{const o=n({nodeDefaults:Ni,newNodeId:Te,sectionLabel:Ii,blockIsOffered:wr});if(!o)return;const r=ll(t),i=bo.insertNode(Oe,r,o);dl(r,i,e)})(t.preset.label,t.preset.insert,n.index);if("shared"===t.kind){const e=Yt.shared?.nodeOf(t.section);if(!e)return;const o=ll(n.index);return void(ki.restore(e,{parentId:Pn,slot:Tn,index:o})&&dl(o,e.props.id,t.section.title))}const o=$n(n),r=ds(o);r&&(r.target.spec?Ml(r.parentId,r.target.slot,t.type,n.index,r.parent.type):((e,n,t)=>{bo.insertComponent(e,n,t),or(V),bo.select({index:t,zone:e})})(o,t.type,n.index))},us=(e,n)=>{e.media?function(e){const n=Gs();if(!n||!Xs)return;_s(n).then(n=>{n&&function(e,n){if(!Xs)return;const t=Xs.create(e,{nodeDefaults:Ni,newNodeId:Te,sectionLabel:Ii,blockIsOffered:wr}),o=$n(n);if(o===Oe){const e=ll(n.index),o=bo.insertNode(Oe,e,t);return void dl(e,o,Ii(t.type))}bo.insertNode(o,n.index,t),or(V),bo.select({index:n.index,zone:o})}(n,e)})}(n):e.rung?Hi(e.rung.nodeId,e.index,n.index):e.add?ps(e.add,n):e.zone===Oe?sl(e.index,n.index):ns(e.zone,$n(n),e.index,n.index)},[fs]=Rn(()=>yn()),hs=vn({keyOf:e=>e.id,readOnly:Boolean($t),session:fs,canDrop:ls,onDrop:us,onStep:(e,n)=>{e.rung?Hi(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===Oe?((e,n)=>{const t=Ii(hi[e]?.type??""),o=sl(e,n<0?e-1:e+2);if(!o.moved)return void Kr(n<0?oo.sectionFirst({name:t}):oo.sectionLast({name:t}));const{floor:r,cap:i}=mi();Kr(oo.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):ns(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),ms=Fn(e=>{const{floor:n,cap:t}=mi(),o=[];for(const r of e.nodes){const e=$n(r.place),i=Mi(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(qt(i)||eo(i)||yr(i.type,i))continue;if(Kt(i.type))continue;const l=Boolean(rs(e)),s=e===Oe||l;e===Oe&&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?Ii(i.type):Yi(i),from:r.place})}const r=e.zones.flatMap(e=>{const n=$n(e.list);if(n===Oe&&0===e.children.length)return[{...e,addLabel:oo.addSection,addAlways:!0}];const t=ds(n),o=t?.target.spec?.addLabel;return e.children.length>0||Boolean(t?.choices.length)||Boolean(rs(n))?[o?{...e,addLabel:o}:e]:[]}),i=r.flatMap(e=>{const n=$n(e.list),t=n===Oe||rs(n)?null:ds(n);return t?.choices.length?fn(e,t.target.spec?.addLabel??oo.addBlockHere):[]});return{sources:o,zones:r,seams:i}},[Dt.data]),gs=null==Ht?.props.id?null:String(Ht.props.id),ys=Hn(Le),vs=ys?.selected()&&Ho?.document&&gs?ys.selectedPart?.(Ho.document)??null:null,bs=vs&&gs&&Ae(Dt.data,Jt,gs,vs)?vs:null,ks=bs?.label?{element:bs.element,label:bs.label}:null,Ss=null!==bs,ws=Fn(e=>{const n=Jt,t=e=>!e.item.rung&&null!==jn(Dt.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(gs);return i?Ss?null:i:r(Ge(Dt.data,n,o.item.id,gs,Vl))??o},[Dt.data,Jt,gs,Vl,Ss]),[xs,zs]=Rn(null),[Cs,Os]=Rn(null),Bs=zr.canvasTab,Ns=Boolean(Fl||Wl||Bs);zn(Ho,"mouseover",e=>{if(!Ns)return;const n=Cn(e.target),t=n?yt(Dt.data,Jt,n):null;t!==xs&&zs(t),Bs&&n!==Cs&&Os(n)}),zn(Ho,"mouseout",e=>{Ns&&!e.relatedTarget&&(zs(null),Os(null))});const Is=e=>qt(e)||eo(e)||Kt(e.type),Ps=e=>{const n=Kt(e.type)?Bi(e.type):qt(e)?oo.header:eo(e)?oo.footer:null;return null===n?Pi(e):zr.rowName?zr.rowName(e,"section",n):n},Ts=[];if(Ns){const e=gs?yt(Dt.data,Jt,gs):null;for(const n of/* @__PURE__ */new Set([e,xs])){const e=n?hi.find(e=>String(e.props.id)===n):void 0;if(!e)continue;const t=qt(e)||e.type===Xt,o=Jl(e);if(o){Ts.push({id:String(e.props.id),label:Ps(e),below:t,reach:o});continue}if(!Fl||!Is(e))continue;const r=Fl(e);r&&Ts.push({id:String(e.props.id),label:r,below:t})}for(const e of Bs?/* @__PURE__ */new Set([gs,Cs]):[]){const n=e?ji(e):void 0,t=n?Bs(n):null;t&&!Ts.some(n=>n.id===e)&&Ts.push({id:e,label:t,below:!1,above:!0})}}const $s=fe(),Ms=Ln(null);Dn(()=>{const e=Yt.changeNotice;if(!e)return;const n=JSON.stringify(hi.filter(Is)),t=Ms.current;if(Ms.current={doc:Jn,bands:n,index:Vt.index},!t||t.doc!==Jn||t.bands===n)return;Vt.hasPast&&Vt.index>=t.index&&!gt.has($s)&&(gt.add($s),Kr(e,"success",{action:{label:oo.bar.undo,onClick:()=>Vt.back()},duration:8e3}))},[hi]);const js=e=>{or(V),bo.select(e.zone===Oe?{index:e.index}:{index:e.index,zone:e.zone})},Es=q(),Ls=()=>({data:Dt.data,device:No,ops:bo,inspector:fr}),As=Es?.model,Rs=An(()=>As?e=>As(e,ms(e),Ls()):ms,[As,ms,No]),Ds=Es?.measure,Fs=Ds?(e,n)=>Ds(e,n,Ls()):void 0,Vs=Es?.canDrop,Hs=Vs?(e,n)=>Vs(e,n,ls,Ls()):ls,Ws=Es?.drop,Js=Ws?(e,n)=>Ws(e,n,us,Ls()):us,Ys=Es?.pick,Us=Ys?e=>Ys(e,js,Ls()):js,Xs=Es?.media??null,Qs=Ln(null),Ks=An(()=>Xs?{id:ht,zone:"",index:-1,type:Xs.adds.type,add:{kind:Xs.adds.kind,type:Xs.adds.type},media:!0}:null,[Xs]);Dn(()=>{if(!Ks||$t||"undefined"==typeof document)return;const e=e=>{(e=>Array.from(e.dataTransfer?.types??[]).includes(nt))(e)&&(Qs.current=null,fs.start({key:ht,item:Ks}))},n=e=>{fs.get()?.item.media&&(Qs.current=Kn(e.dataTransfer))},t=()=>{fs.get()?.item.media&&fs.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)}},[Ks,$t,fs]);const Gs=()=>{const e=Qs.current;return Qs.current=null,e},Zs=ce(),_s=async e=>{if(!Zs)return e;const n=await Zs(e);return n?{...e,id:n.id,url:n.url}:null};const qs=(e,n)=>{if(!Xs)return;const t=jn(vo.getState().appState.data,gi,n);if(!t)return;const o=t.node;bo.replaceComponent($n(t.place),t.place.index,{...o,props:{...Xs.replace(o,e),id:o.props.id}})},ed=e=>{const n=$n(e),t=Li(n);t&&Fi(t.node,t.slot,!1),pl(n,e.index)},nd=(e,n)=>/* @__PURE__ */pt(Ye,{...$t?{}:hs.seam({place:{...Mn(e),index:n}})},`seam:${e}:${n}`),td={rowClick:hl,isCollapsed:Jr,toggleCollapse:Yr},od=e=>{const n=String(e.props.id),t=hi.findIndex(e=>String(e.props.id)===n),o=Gt(n),r=Mi(o),i=Jr(n),l=Bi(e.type),s=zr.rowName?zr.rowName(e,"section",l):l,d=e=>nd(o,e);/* @__PURE__ */
|
|
12
|
+
/* @__PURE__ */pt("path",{d:"M5 12h14"})]})})}var kt=`${Sn}, ${wn}`;function St(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 wt="__rungs",xt=e=>"template"===e.kind?e.template.id:"shared"===e.kind?e.section.id:"preset"===e.kind?e.preset.key:e.type;var zt="screen:band",Ct={duplicate:!0,delete:!0},Ot=()=>null;function Bt(){const Sn=he(),On=Sn.panels?.Toolbar,Bn=(Sn.panels?.useRight??Ot)(),{target:Nn,docId:Jn,capabilities:Gn,currentSlug:Zn,siteId:_n,onPublish:qn,saveState:et,saveConflict:at,retrySave:Bt,toggleAutoSave:Nt,flushSave:It,access:Pt,saveUnreachable:Tt=!1,readOnly:$t,readOnlyReason:Mt=null}=w(),jt=$(),Et=M(),{mediaEditing:Lt,hasEditGuard:At,hasPinnedChrome:Rt}=Gn,{appState:Dt,dispatch:Ft,history:Vt,selectedItem:Ht,getSelectorForId:Wt,config:Jt}=je(e=>e),Yt=j(),{first:Ut,firstGroup:Xt,lastGroup:Qt,isSectionGroup:Kt,sectionGroupZone:Gt,panelOf:Zt}=Yt,_t=Zt(Ut),qt=e=>ne(Yt,e),eo=e=>te(Yt,e),no="node"===Yt.firstRow,to=Yt.band??null,oo=un("screen",ve),ro=un("tree",Ue),io=un("drag",gn),lo=un("notice",sn),so=un("lock",pn),ao=un("menu",Xe),co=un("styleClipboard",Se),po=un("chrome",dn),uo=E()??`/${Zn}`,fo=L(),ho=A(),mo=y({readOnly:$t}),go=y({readOnly:$t,foldIntoHistory:!0}),yo=Ln(null),vo=Ee(),bo=An(()=>({...mo,select:e=>{yo.current=e,mo.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=vo.config;yo.current=Qe(e,t,n)}mo.commitDocument(e,n)}}),[mo,vo]),ko=Dt.ui,So=ko.leftSideBarVisible,wo=ko.rightSideBarVisible,{options:xo,widths:zo,initial:Co,fluid:Oo,fit:Bo}=R(),[No,Io]=Rn(Co),Po=le(),To=Lt&&null!==Po;se(),de();const $o=ae();D(Ht?.props.id);const{read:Mo,write:jo,forSelection:Eo}=F(),[Lo,Ao]=Rn(Mo);Dn(()=>{jo(Lo)},[Lo]);const[Ro,Do]=Rn(0),Fo=Ln(null),Vo=Ln(null),Ho=kn(Vo,{readySelector:kt}),Wo=xn(Ho),Jo=d(Vo);a(Vo,Ho);const Yo=S(),Uo=an(Pt),Xo={state:et,offline:Yo||et.failed&&Tt,readOnlyReason:Mt,editing:Uo?lo.editing({name:cn(Uo.name,so),noun:oo.noun}):null,conflict:null!=at,notSaving:oo.bar.notSaving},Qo=()=>{$t||(et.failed?Bt():It())};c(Vo,Ho,Qo);const[Ko,Go]=Rn(!1),Zo=Ln(!1),[_o,qo]=Rn(null),[er,nr]=Rn([]),[tr,or]=Rn(V);H(tr);const rr=e(tr,Ht?.props.id),[ir,lr]=Rn(null);Dn(()=>{ir&&(n(),lr(null))},[ir]);const sr=Ln(Wt);sr.current=Wt;const dr=Fn((e,{scroll:n})=>{Ao(n=>Eo(e,n)),n&&lr(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=sr.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&Rr(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),ar=Ln(null);Dn(()=>{const e=ar.current;ar.current=null;const n=null==Ht?.props.id?null:String(Ht.props.id);or(t=>e&&e.id===n?e.mode:"part"===t.kind&&"nodeId"in t&&t.nodeId===n?t:Zt(Ht?.type)??V);const o=Ht?.props.id,r=yo.current;if(yo.current=null,!o)return;const i=Wt(o);dr(String(o),{scroll:!t(r,i??null,Oe)})},[Ht?.props.id,dr]);const cr=Fn(e=>{or(n=>W(n,e)?n:e),Ft({type:"setUi",ui:{rightSideBarVisible:!0}})},[Ft]),pr=Ln(()=>{});pr.current=(e,n)=>{const t=e?Mi(e.zone??Oe)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==Ht?.props.id?null:String(Ht.props.id);or(e=>W(e,n)?e:n),o!==r&&(ar.current={id:o,mode:n},bo.select(e))};const ur=Fn((e,n)=>pr.current(e,n),[]),fr={kind:tr.kind,mode:tr,open:cr,show:e=>or(e),reveal:()=>{wo||Ft({type:"setUi",ui:{rightSideBarVisible:!0}})},select:ur},hr=J(fr,{data:Dt.data,selected:Ht??null,zoneOf:e=>Wt(e)?.zone,readOnly:Boolean($t),select:e=>{or(V),bo.select({index:e})},replace:(e,n)=>bo.replaceComponent(Oe,e,n),scrollTo:e=>l(e)},{device:No,refreshes:Ro},{setView:Ao,reveal:()=>{So||Ft({type:"setUi",ui:{leftSideBarVisible:!0}})}}),mr=hr.resolveLeftView?hr.resolveLeftView(Lo):"sections",gr=Y(),{isLockedBlock:yr,duplicateBlocked:vr,nestDepth:br,newSectionNode:kr,canAddTo:Sr,blockIsOffered:wr}=gr,xr=e=>({id:String(e.props.id??""),data:Dt?.data}),zr=U(),{labelAtLevel:Cr,Icon:Or,useProducts:Br}=zr,Nr=zr.rowName?(e,n,t)=>zr.rowName(e,n,t):void 0,Ir=Fn(e=>{Ft({type:"setUi",ui:{rightSideBarVisible:!0}}),l(e),dr(e,{scroll:!0})},[Ft,dr]),{selectNode:Pr,openPartId:Tr}=g({mode:tr,setMode:or,onOpenPart:Ir}),[$r,Mr]=Rn(null);me(null!==$r,()=>Mr(null));const jr=f(X()),Er=jr.collapsed,Lr=jr.panelWidths,[Ar,Rr]=Rn(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(Er);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
|
|
13
|
+
return new Set}});Dn(()=>{try{window.localStorage.setItem(Er,JSON.stringify([...Ar]))}catch{}},[Ar]);const[Dr,Fr]=Rn(()=>{if("undefined"==typeof window)return{...h};try{const e=window.localStorage.getItem(Lr);if(!e)return{...h};const n=JSON.parse(e);return{left:m(Number(n.left)||h.left,"left"),right:m(Number(n.right)||h.right,"right")}}catch{return{...h}}});Dn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(Lr,JSON.stringify(Dr))}catch{}},300);return()=>clearTimeout(e)},[Dr]);const Vr=Fn((e,n)=>Fr(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),Hr=Fn(e=>Vr("left",e),[Vr]),Wr=Fn(e=>Vr("right",e),[Vr]),Jr=e=>Ar.has(e),Yr=e=>Rr(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Ur=Ln(!1),Xr=Ln(null);Dn(()=>{if(Ur.current&&!Ko){const e=Xr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??Vo.current?.querySelector(`button[aria-label="${CSS.escape(oo.add.title)}"]`))?.focus(),Xr.current=null}Ur.current=Ko},[Ko]),Dn(()=>{if(!Ko||!Jo)return;const e=e=>{"Escape"===e.key&&ul()};return Jo.addEventListener("keydown",e),()=>Jo.removeEventListener("keydown",e)},[Ko,Jo]),me(Ko,()=>ul()),Dn(()=>{!So&&Ko&&(Go(!1),qo(null),Zo.current=!1)},[So]);const Qr=Q(),Kr=(e,n="success",t)=>{if(Qr)return void(t?Qr(e,"error"===n?"error":"info",t):Qr(e,"error"===n?"error":"info"));const o={sound:!1,action:t?.action,onClose:t?.onClose};"error"===n?Qn.error(e,{...o,duration:t?.duration??3200}):Qn.success(e,{...o,duration:t?.duration??1900})},Gr=Ln(null),[Zr,_r]=Rn(0),[qr,ei]=Rn(0),ni=K(),ti=Ln(null),oi=e=>Math.max(0,e.clientHeight-(ti.current?.offsetHeight??0));Dn(()=>{const e=Gr.current;if(!e)return;const n=()=>{_r(e.clientWidth),ei(oi(e))};n();const t=new ResizeObserver(n);return t.observe(e),ti.current&&t.observe(ti.current),()=>t.disconnect()},[]),Vn(()=>{Gr.current&&(_r(Gr.current.clientWidth),ei(oi(Gr.current)))},[Dr,So,wo]);const ri=No===Oo?Zr>0?Zr:zo[Oo]:zo[No],ii=Zr>0?Math.min(Zr/ri,"shrink"===Bo?1:2):1,li=ri*ii,si=Zr>0&&li>Zr+1,di={width:li,height:qr||"100%",flex:"none",position:"relative"},ai={width:ri,height:qr?qr/ii:"100%",maxHeight:"none",transform:1!==ii?`scale(${ii})`:void 0,transformOrigin:"top left"},ci=()=>Ft({type:"setUi",ui:{leftSideBarVisible:!So}}),pi=()=>Ft({type:"setUi",ui:{rightSideBarVisible:!wo}}),ui=e=>{Ko&&(Go(!1),qo(null),Zo.current=!1,So&&Lo===e)||(Ao(e),So||Ft({type:"setUi",ui:{leftSideBarVisible:!0}}))},fi=()=>{or(_t??V),wo||Ft({type:"setUi",ui:{rightSideBarVisible:!0}})},hi=Dt.data.content??[],mi=()=>{const e=hi.findIndex(qt),n=hi.findIndex(eo);return{floor:e>=0?e+1:0,cap:n>=0?n:hi.length}},gi=Jt,yi=gr.stripCopy,vi=e=>o(e,yi),bi=pe(),ki=Ke({data:Dt.data,config:gi,readOnly:Boolean($t),clipboard:bi,strip:yi?e=>yi(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==Pn||e.slot!==Tn)return{min:0,max:n-1};const{floor:t,cap:o}=mi();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&or(V);const t=void 0===n||"node"===n?.kind?n:null;bo.commitDocument(e,t)}}),Si=fe(),[wi,xi]=Rn(null),zi=e=>{const n=hi.find(n=>String(n.props.id)===e),t=Yt.shared;n&&t&&ki.swap(e,t.detach(n))},Ci=e=>{const n=jn(Dt.data,Jt,e);if(!n)return!1;const t=$n(n.place),o=n.node,r=t===Oe?Pi(o):Yi(o),i=t===Oe?Yt.shared?.usedOn(o):null;return!!ki.remove(e)&&(Kr(i?oo.shared.removed({count:Math.max(0,i.length-1)}):oo.deleted({name:r}),"success",{duration:8e3,action:{label:oo.bar.undo,onClick:()=>{ki.restore(n.node,n.place)}}}),!0)},Oi={...ki,remove:Ci},Bi=e=>Cr(e,"block",Jt.components[e]?.label??e),Ni=Fn(e=>Jt.components[e]?.defaultProps??{},[Jt]),Ii=e=>Cr(e,"section",Bi(e)),Pi=e=>we({type:e.type,props:e.props??{}},Ii(e.type),Nr),{nodeAddresses:Ti,zoneItems:$i}=An(()=>{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(Jt,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(hi,Oe,0),{nodeAddresses:e,zoneItems:n}},[hi,Jt]),Mi=Fn(e=>$i.get(e)??[],[$i]),ji=e=>{const n=Ti.get(e);return n?Mi(n.zone)[n.index]:void 0},Ei=e=>oe(gr,Jt,e),Li=e=>{if(!gr.slotsOf||e===Oe)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=ji(e.slice(0,n));if(!t)return null;const o=Ei(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}},Ai=(()=>{if(!G(tr))return null;const e=`${tr.nodeId}:${tr.slot}`;return Li(e)?.slot.panel===tr.kind?e:null})(),Ri=Ln(null);Dn(()=>{const e=Ri.current;if(Ri.current=null,!Ai||!G(tr))return;const n=tr.nodeId;dr(n,{scroll:e!==Ai}),Rr(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[tr]);const Di=e=>{const n=Ti.get(e);n&&(n.zone===Oe?il(n.index):$l(n.zone,n.index,e,ji(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))},Fi=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void Di(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&Ai!==i&&(Ri.current=i),ur(null,r),wo||Ft({type:"setUi",ui:{rightSideBarVisible:!0}}),l(o)},Vi=(e,n,t)=>{const o=`${e}:${n}`;if(Rr(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;Ai!==o&&(Ri.current=o);ur(null,{kind:t,nodeId:e,slot:n})},Hi=(e,n,t)=>{if($t||!gr.moveSlot)return;const o=ji(e),r=o?Ei(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:wt,index:n},s=bn(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=gr.moveSlot(e,n,s);"string"==typeof d&&Vi(e,d,i.panel)},Wi=Br(),Ji=An(()=>{const e=/* @__PURE__ */new Map;for(const n of Wi??[])e.set(n.slug,n.name);return e},[Wi]),Yi=e=>xe(e,Bi,zr.plainText,e=>Ji.get(e),zr.rowName),Ui=(e,n)=>{const t=Jt.components[e.type]?.fields,o=n===Oe||rs(n)?"section":"block",r=n===Oe&&(qt(e)||eo(e)||Kt(e.type)),i="block"===o?ze(t):r?null:Ce(t);return zr.renamePropOf?zr.renamePropOf(e,o,i):i},Xi=(e,n,t,o)=>{if(!(!$t&&$r?.zone===e&&$r.index===n))return;const r=(t,o)=>{Mr(null),o&&((e,n,t)=>{const o=Mi(e)[n];if(!o)return;const r=Ui(o,e);r&&bo.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
|
|
14
|
+
return pt("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":oo.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)},Qi=i(Z(),co),Ki=Qi.scope({target:Nn,siteId:_n,docId:Jn}),Gi=Jt,Zi=(e,n)=>n===Oe?Ii(e):Bi(e),_i=(e,n,t)=>{const o=Qi.plan(Ki,t,Zi(t.type,e),Gi);o&&(o.changed&&bo.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),Kr(o.message))},qi=ue({nodesIn:Mi,nodeAt:(e,n)=>Mi(e)[n]??null,labelOf:(e,n)=>n===Oe?Ii(e):Bi(e),renamePropOf:Ui,beginRename:(e,n)=>Mr({zone:e,index:n}),history:{hasPast:Vt.hasPast,hasFuture:Vt.hasFuture,back:()=>Vt.back(),forward:()=>Vt.forward()},openPageStyles:hr.openPageStyles,pageStylesLabel:oo.pageStyles,words:{menu:ao,styleClipboard:co,screen:oo.menu},readOnly:Boolean($t),collapseAll:()=>Rr(new Set(Mi(Oe).map(e=>String(e.props.id)))),onPasteRefused:e=>Kr(e?oo.pasteRefused({name:e.label}):oo.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>ss(e,n),copyItem:hr.onCopyItem,menuRows:(e,n,t)=>{const o=hr.menuRows?.(e,n,t)??null,r=((e,n)=>{const t=Yt.shared;if(!t||n!==Oe)return null;const o=t.usedOn(e);if(o){const n={pick:[{label:oo.shared.onPages({count:o.length}),onClick:()=>{},children:o.map(e=>({label:e.title,onClick:()=>t.openPage(e)}))}]};return $t||yr(e.type,e)?n:{...n,change:[{label:oo.shared.detach,onClick:()=>zi(e.props.id)}],remove:[{label:oo.shared.removeFromPage,danger:!0,onClick:()=>{Ci(e.props.id)}}]}}return $t||qt(e)||eo(e)||Kt(e.type)?null:O(Si)?{change:[{label:oo.shared.makeShared,onClick:()=>xi({id:e.props.id,name:Pi(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=>yr(e.type,e),duplicateBlocked:e=>vr(Dt.data,e),permits:e=>{const n=Be(Jt,e.type);return Yt.shared?.usedOn(e)?{...n,delete:!1}:n},nodeOps:Oi,isPinned:(e,n)=>n===Oe&&(qt(e)||eo(e)),sectionBand:mi,locate:e=>Ti.get(e)??null,rowNameOf:(e,n)=>n===Oe?Pi(e):Yi(e),selectAt:(e,n,t,o)=>{e===Oe?il(n):$l(e,n,t,o??"")},slotRung:e=>{const n=Li(e);return n?.slot.panel?{label:n.slot.label,select:()=>Fi(n.node,n.slot,!1)}:null},style:{held:()=>be(Ki),canCopy:e=>Qi.rows(Gi,e).some(e=>!1!==e.counted),copy:(e,n)=>Qi.copy(Ki,e,Zi(e.type,n),Gi),paste:(e,n,t)=>_i(e,n,t)},keys:Et?{target:Jo,selected:()=>{const e=Dt.ui.itemSelector;return e?{zone:e.zone??Oe,index:e.index}:null},held:()=>bi.get(),readOnly:Boolean($t),onDone:({done:e,name:n})=>{"copied"===e&&Kr(oo.copied({name:n}))}}:void 0},Ho),el=Ln({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});Dn(()=>{el.current={copy:(e,n)=>Qi.copy(Ki,e,Zi(e.type,n),Gi),paste:_i,at:()=>{const e=Dt.ui.itemSelector;if(!e)return null;const n=e.zone??Oe,t=Mi(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean($t)}});const nl=Fn(e=>{const n=ke(e);if(!n)return;const t=el.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))},[]);Dn(()=>{if(!Jo)return;const e=e=>nl(e);return Jo.addEventListener("keydown",e),()=>Jo.removeEventListener("keydown",e)},[nl,Jo]),zn(Ho,"keydown",nl);const tl=hi.map(e=>e.props.id).join("|");Dn(()=>{const e=Ho?.document??null,n=Ho?.window??null;let t=0;const o=[],r=()=>{if(!e)return void nr(e=>e.length?[]:e);const n=hi.findIndex(eo),t=n>=0?n:hi.length,o=n=>{const t=hi[n]?.props?.id;return null==t?null:In(e,`[data-easel-block="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(wn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=hi.length>0&&!qt(hi[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=St(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})}nr(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()}},[Ho,tl,No,ii,So,wo,Ht?.props.id]);const ol=Ho?.document??null,rl=Ho?.window??null;Dn(()=>{const e=Fo.current;if(!e||!ol||!rl)return;const n=[],t=()=>{const n=In(ol,`[data-easel-block="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&rl.scrollTo({left:rl.scrollX,top:rl.scrollY+t,behavior:"instant"}),!0};return Fo.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[ol,rl]);const il=e=>{or(V),bo.select({index:e}),hr.sectionPressed?.(hi[e]);const n=hi[e]?.props?.id;n&&l(n)},ll=e=>{const{floor:n,cap:t}=mi(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=Ht&&tr.kind!==_t?.kind?hi.findIndex(e=>e.props.id===Ht.props.id):-1;return o(r>=0?r+1:t)},sl=(e,n)=>{const{floor:t,cap:o}=mi(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(bo.reorderComponent(Oe,e,i),bo.select({index:i}),{moved:!0,dest:i})},dl=(e,n,t,o)=>{or(V),bo.select(o?{index:o.index,zone:o.zone}:{index:e}),l(n),Kr(oo.sectionAdded({name:t}))},al=(e,n)=>{const t=ll(n),o=kr(e,{nodeDefaults:Ni,newNodeId:Te,sectionLabel:Ii,blockIsOffered:wr}),r=o?bo.insertNode(Oe,t,o):bo.insertSection(e,t);return dl(t,r,Ii(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(Jt,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=Sr(e.type,l,d.slice(d.lastIndexOf(":")+1),xr(e)),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},cl=e=>pl(Oe,e),pl=(e,n)=>{Xr.current=document.activeElement??null,qo(null===n?null:{zone:e,index:n}),Go(!0),So||(Zo.current=!0,Ft({type:"setUi",ui:{leftSideBarVisible:!0}}))},ul=()=>{Go(!1),qo(null),Zo.current&&Ft({type:"setUi",ui:{leftSideBarVisible:!1}}),Zo.current=!1},fl=(e,n)=>zr.rowName?n?qt(e)?zr.rowName(e,"section",oo.header):eo(e)?zr.rowName(e,"section",oo.footer):Kt(e.type)?zr.rowName(e,"section",Bi(e.type)):Pi(e):Yi(e):n?Ii(e.type):Bi(e.type),hl=e=>n=>{e()},ml=(e,n,t)=>{if($t)return null;const o=Mi(e)[n];return o&&!Be(Jt,o.type).delete||o&&yr(o.type,o)?null:/* @__PURE__ */pt(Je,{kind:"delete",label:e===Oe&&o&&Yt.shared?.usedOn(o)?oo.shared.removeFromPage:oo.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=Mi(e)[n]?.props?.id;null!=t&&Ci(String(t))})(e,n),children:/* @__PURE__ */pt(lt,{size:15})})},gl=e=>zr.rowPreview?.(e)||void 0,yl=e=>zr.rowMarks?.(e)??void 0,vl=(e,n,t)=>zr.rowActions?.(e,n,t)??null,bl=(e,n,t,o)=>{if($t)return null;if(yr(t.type,t))return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
|
|
15
|
+
return pt(Je,{kind:"eye",label:r?oo.showNamed({name:o}):oo.hideNamed({name:o}),onClick:()=>Sl(e,n,t),children:/* @__PURE__ */pt(r?st:dt,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},kl=e=>nd(Oe,e),Sl=(e,n,t)=>{bo.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},wl=e=>Pe(Jt,e),xl=e=>Ie(Jt,e),zl=e=>gr.slotsOf?Ei(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:$e(e,n.slot)})):[{slot:null,rung:null,kids:re(Jt,e)}],Cl=e=>gr.slotsOf?zl(e).flatMap(e=>e.kids):re(Jt,e),Ol=e=>Boolean(gr.slotsOf)&&Ei(e).some(e=>e.rung),Bl=(e,n,t)=>Sr(e.type,n,t??void 0,xr(e)),Nl=(e,n,t)=>{const o=Me(Jt,e.type,n)&&(t||Cl(e).length>0||Ol(e));return{collapsible:o,folded:o&&Jr(String(e.props.id))}},Il=(e,n,t)=>zl(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>Nl(e,r,t(e.type)).collapsible?[String(e.props.id),...Il(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),Pl=e=>Cl(e).length>0||Ol(e)||Boolean(Sr(e.type)),Tl=e=>Boolean(Sr(e)),$l=(e,n,t,o)=>{if(or(V),Sr(o)?.spec?.slider){const t=e.split(":")[0];s(t,n),bo.select({index:n,zone:e}),l(t)}else bo.select({index:n,zone:e}),l(t)},Ml=(e,n,t,o,r)=>{const i=`${e}:${n}`;bo.insertComponent(i,t,o),Sr(r)?.spec?.slider?requestAnimationFrame(()=>{s(e,o),bo.select({index:o,zone:i})}):bo.select({index:o,zone:i})},jl=Ln(/* @__PURE__ */new Set);Dn(()=>{hi.forEach(e=>{const n=Sr(e.type)?.spec;if(!n)return;const t=e.props.id;if(jl.current.has(t))return;jl.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(Ni)).forEach((e,t)=>go.seedChild(o,t,n.childType,e))})},[hi,go,Ni]);const El=Ln(/* @__PURE__ */new Set);Dn(()=>{hi.forEach((e,n)=>{const t=e.props.id;if(El.current.has(t))return;const o=r(e,wl(e.type));El.current.add(t),o&&go.replaceComponent(Oe,n,{...e,props:o})})},[hi,go]),_(go,Jt);const Ll=hi.findIndex(eo),Al=Ll>=0?hi[Ll]:null,Rl=no?hi.findIndex(qt):-1,Dl=Rl>=0?hi[Rl]:null,Fl=Yt.groupTab,Vl=An(()=>Fl?e=>Kt(e.type):void 0,[Fl]),Hl=Boolean(Yt.groupBadge),Wl=Yt.sharedReach,Jl=e=>Wl?.(e)??void 0,Yl=An(()=>Wl?new Set(hi.filter(e=>Jl(e)).map(e=>String(e.props.id))):null,[hi,Wl]),Ul=An(()=>Yl?e=>Yl.has(e):void 0,[Yl]),Xl=Yt.first?Wl?.({type:Yt.first,props:{id:""}})??void 0:void 0,Ql=Yt.groupBadge?/* @__PURE__ */pt("span",{className:"es-tree-group-badge",children:/* @__PURE__ */pt(Yn,{tone:"info",size:"xs",children:Yt.groupBadge})}):void 0,Kl=hi.find(e=>e.type===Xt)??null,Gl=hi.find(e=>e.type===Qt)??null,Zl=Ll>=0?Ll:hi.length,_l=[];hi.forEach(e=>{eo(e)||(Pl(e)&&_l.push(String(e.props.id)),_l.push(...Il(e,1,Tl)))}),Al&&(_l.push(String(Al.props.id)),_l.push(...Il(Al,1,Tl)));const ql=_l.length>0&&_l.every(e=>Ar.has(e)),es=e=>{const n=zr.blockRowName(e,Bi);return zr.rowName?zr.rowName(e,"block",n):n},ns=(e,n,t,o)=>{const r=Mi(e)[t];if(!r)return;const i={...Mn(e),index:t},l={...Mn(n),index:Math.min(Math.max(o,0),Mi(n).length)},s=bn(i,l);if(e!==n||s!==t)try{ki.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof En))throw e}},ts=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of xl(e))n.add(r),t(o)};for(const t of wl(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},os=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Ti.get(n);if(!e)return null;if(e.zone===Oe)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},rs=e=>{const n=e.slice(0,e.indexOf(":")),t=hi.find(e=>Kt(e.type)&&String(e.props.id)===n);return t&&Gt(n)===e?t:null},is=(e,n)=>{const t=rs(e);return!t||(!Yt.groupAccepts||Yt.groupAccepts(t.type,n,Mi(e).length))},ls=(e,n,t)=>{if(e.rung){const t=ji(e.rung.nodeId),o=t?Ei(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===wt&&n.index>=0&&n.index<=o}if(n.slot===wt)return!1;if(e.add)return cs(e.add,n);const o=$n(n);if(Kt(e.type))return!1;const r=rs(o),i=rs(e.zone);if(r||i)return!(!r||!i)&&(!(r!==i&&!is(o,e.type))&&(n.index>=0&&n.index<=Mi(o).length));if(e.zone===Oe||o===Oe){if(e.zone!==o)return!1;const{floor:t,cap:r}=mi();return n.index>=t&&n.index<=r}if(n.index<0||n.index>Mi(o).length)return!1;if(e.zone===o)return!0;const l=Al&&!Yt.lastIsOpen?String(Al.props.id):null;return(!l||os(e.zone)!==l&&os(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??Mi(e)[t];if(!r)return!1;const i=n.split(":")[0],l=Ti.get(i),s=l?Mi(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&ts(r).has(n))return!1;const d=Sr(s.type,br(Dt?.data,s.type,i),n.slice(n.lastIndexOf(":")+1),xr(s));return!!d&&(!!(d.choices?d.choices.some(e=>e.type===r.type):d.spec?.childType===r.type)&&!d.spec?.addBlocked?.(Mi(n),r))})(e.zone,o,e.index,t)},ss=(e,n)=>{const t=$n(e.from),o=e.node;return t===$n(n)?is(t,o.type):ls({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},ds=e=>{const n=e.slice(0,e.indexOf(":")),t=Ti.get(n),o=t?Mi(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=Sr(o.type,br(Dt?.data,o.type,n),e.slice(e.lastIndexOf(":")+1),xr(o));if(!r||`${n}:${r.slot}`!==e)return null;if("footer"===r.source)return null;const i=T(r.choices??(r.spec?[{type:r.spec.childType,label:Bi(r.spec.childType)}]:[])),l=Li(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:fl(o,t.zone===Oe)}},as=(e,n)=>{if("section"!==e.kind)return e;const t=$n(n);return t===Oe||rs(t)?e:ds(t)?.choices.some(n=>n.type===e.type)?{kind:"block",type:e.type}:e},cs=(e,n)=>{const t=as(e,n),o=$n(n);if("shared"===t.kind){if(o!==Oe||!Yt.shared?.nodeOf(t.section))return!1;const{floor:e,cap:r}=mi();return n.index>=e&&n.index<=r}if("block"!==t.kind){if(rs(o)){if("preset"===t.kind)return!1;const e="section"===t.kind?t.type:t.template.node.type;return is(o,e)&&n.index>=0&&n.index<=Mi(o).length}if(o!==Oe)return!1;const{floor:e,cap:r}=mi();return n.index>=e&&n.index<=r}if(o===Oe)return!1;const r=ds(o);return!(!r||!r.choices.some(e=>e.type===t.type))&&!r.target.spec?.addBlocked?.(Mi(o))},ps=(e,n)=>{const t=as(e,n);if("block"!==t.kind&&rs($n(n)))return void((e,n,t)=>{const o="section"===e.kind?e.type:"template"===e.kind?e.template.node.type:null;if(o&&is(n,o)){if("section"===e.kind)bo.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;bo.insertNode(n,t,vi(e.template.node))}or(V),bo.select({index:t,zone:n})}})(t,$n(n),n.index);if("section"===t.kind)return void al(t.type,n.index);if("template"===t.kind)return void((e,n,t)=>{const o=ll(t),r=bo.insertNode(Oe,o,n);dl(o,r,e)})(t.template.name,vi(t.template.node),n.index);if("preset"===t.kind)return void((e,n,t)=>{const o=n({nodeDefaults:Ni,newNodeId:Te,sectionLabel:Ii,blockIsOffered:wr});if(!o)return;const r=ll(t),i=bo.insertNode(Oe,r,o);dl(r,i,e)})(t.preset.label,t.preset.insert,n.index);if("shared"===t.kind){const e=Yt.shared?.nodeOf(t.section);if(!e)return;const o=ll(n.index);return void(ki.restore(e,{parentId:Pn,slot:Tn,index:o})&&dl(o,e.props.id,t.section.title))}const o=$n(n),r=ds(o);r&&(r.target.spec?Ml(r.parentId,r.target.slot,t.type,n.index,r.parent.type):((e,n,t)=>{bo.insertComponent(e,n,t),or(V),bo.select({index:t,zone:e})})(o,t.type,n.index))},us=(e,n)=>{e.media?function(e){const n=Gs();if(!n||!Xs)return;_s(n).then(n=>{n&&function(e,n){if(!Xs)return;const t=Xs.create(e,{nodeDefaults:Ni,newNodeId:Te,sectionLabel:Ii,blockIsOffered:wr}),o=$n(n);if(o===Oe){const e=ll(n.index),o=bo.insertNode(Oe,e,t);return void dl(e,o,Ii(t.type))}bo.insertNode(o,n.index,t),or(V),bo.select({index:n.index,zone:o})}(n,e)})}(n):e.rung?Hi(e.rung.nodeId,e.index,n.index):e.add?ps(e.add,n):e.zone===Oe?sl(e.index,n.index):ns(e.zone,$n(n),e.index,n.index)},[fs]=Rn(()=>yn()),hs=vn({keyOf:e=>e.id,readOnly:Boolean($t),session:fs,canDrop:ls,onDrop:us,onStep:(e,n)=>{e.rung?Hi(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===Oe?((e,n)=>{const t=Ii(hi[e]?.type??""),o=sl(e,n<0?e-1:e+2);if(!o.moved)return void Kr(n<0?oo.sectionFirst({name:t}):oo.sectionLast({name:t}));const{floor:r,cap:i}=mi();Kr(oo.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):ns(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),ms=Fn(e=>{const{floor:n,cap:t}=mi(),o=[];for(const r of e.nodes){const e=$n(r.place),i=Mi(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(qt(i)||eo(i)||yr(i.type,i))continue;if(Kt(i.type))continue;const l=Boolean(rs(e)),s=e===Oe||l;e===Oe&&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?Ii(i.type):Yi(i),from:r.place})}const r=e.zones.flatMap(e=>{const n=$n(e.list);if(n===Oe&&0===e.children.length)return[{...e,addLabel:oo.addSection,addAlways:!0}];const t=ds(n),o=t?.target.spec?.addLabel;return e.children.length>0||Boolean(t?.choices.length)||Boolean(rs(n))?[o?{...e,addLabel:o}:e]:[]}),i=r.flatMap(e=>{const n=$n(e.list),t=n===Oe||rs(n)?null:ds(n);return t?.choices.length?fn(e,t.target.spec?.addLabel??oo.addBlockHere):[]});return{sources:o,zones:r,seams:i}},[Dt.data]),gs=null==Ht?.props.id?null:String(Ht.props.id),ys=Hn(Le),vs=ys?.selected()&&Ho?.document&&gs?ys.selectedPart?.(Ho.document)??null:null,bs=vs&&gs&&Ae(Dt.data,Jt,gs,vs)?vs:null,ks=bs?.label?{element:bs.element,label:bs.label}:null,Ss=null!==bs,ws=Fn(e=>{const n=Jt,t=e=>!e.item.rung&&null!==jn(Dt.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(gs);return i?Ss?null:i:r(Ge(Dt.data,n,o.item.id,gs,Vl))??o},[Dt.data,Jt,gs,Vl,Ss]),[xs,zs]=Rn(null),[Cs,Os]=Rn(null),Bs=zr.canvasTab,Ns=Boolean(Fl||Wl||Bs);zn(Ho,"mouseover",e=>{if(!Ns)return;const n=Cn(e.target),t=n?yt(Dt.data,Jt,n):null;t!==xs&&zs(t),Bs&&n!==Cs&&Os(n)}),zn(Ho,"mouseout",e=>{Ns&&!e.relatedTarget&&(zs(null),Os(null))});const Is=e=>qt(e)||eo(e)||Kt(e.type),Ps=e=>{const n=Kt(e.type)?Bi(e.type):qt(e)?oo.header:eo(e)?oo.footer:null;return null===n?Pi(e):zr.rowName?zr.rowName(e,"section",n):n},Ts=[];if(Ns){const e=gs?yt(Dt.data,Jt,gs):null;for(const n of/* @__PURE__ */new Set([e,xs])){const e=n?hi.find(e=>String(e.props.id)===n):void 0;if(!e)continue;const t=qt(e)||e.type===Xt,o=Jl(e);if(o){Ts.push({id:String(e.props.id),label:Ps(e),below:t,reach:o});continue}if(!Fl||!Is(e))continue;const r=Fl(e);r&&Ts.push({id:String(e.props.id),label:r,below:t})}for(const e of Bs?/* @__PURE__ */new Set([gs,Cs]):[]){const n=e?ji(e):void 0,t=n?Bs(n):null;t&&!Ts.some(n=>n.id===e)&&Ts.push({id:e,label:t,below:!1,above:!0})}}const $s=fe(),Ms=Ln(null);Dn(()=>{const e=Yt.changeNotice;if(!e)return;const n=JSON.stringify(hi.filter(Is)),t=Ms.current;if(Ms.current={doc:Jn,bands:n,index:Vt.index},!t||t.doc!==Jn||t.bands===n)return;Vt.hasPast&&Vt.index>=t.index&&!gt.has($s)&&(gt.add($s),Kr(e,"success",{action:{label:oo.bar.undo,onClick:()=>Vt.back()},duration:8e3}))},[hi]);const js=e=>{or(V),bo.select(e.zone===Oe?{index:e.index}:{index:e.index,zone:e.zone})},Es=q(),Ls=()=>({data:Dt.data,device:No,ops:bo,inspector:fr}),As=Es?.model,Rs=An(()=>As?e=>As(e,ms(e),Ls()):ms,[As,ms,No]),Ds=Es?.measure,Fs=Ds?(e,n)=>Ds(e,n,Ls()):void 0,Vs=Es?.canDrop,Hs=Vs?(e,n)=>Vs(e,n,ls,Ls()):ls,Ws=Es?.drop,Js=Ws?(e,n)=>Ws(e,n,us,Ls()):us,Ys=Es?.pick,Us=Ys?e=>Ys(e,js,Ls()):js,Xs=Es?.media??null,Qs=Ln(null),Ks=An(()=>Xs?{id:ht,zone:"",index:-1,type:Xs.adds.type,add:{kind:Xs.adds.kind,type:Xs.adds.type},media:!0}:null,[Xs]);Dn(()=>{if(!Ks||$t||"undefined"==typeof document)return;const e=e=>{(e=>Array.from(e.dataTransfer?.types??[]).includes(nt))(e)&&(Qs.current=null,fs.start({key:ht,item:Ks}))},n=e=>{fs.get()?.item.media&&(Qs.current=Kn(e.dataTransfer))},t=()=>{fs.get()?.item.media&&fs.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)}},[Ks,$t,fs]);const Gs=()=>{const e=Qs.current;return Qs.current=null,e},Zs=ce(),_s=async e=>{if(!Zs)return e;const n=await Zs(e);return n?{...e,id:n.id,url:n.url}:null};const qs=(e,n)=>{if(!Xs)return;const t=jn(vo.getState().appState.data,gi,n);if(!t)return;const o=t.node;bo.replaceComponent($n(t.place),t.place.index,{...o,props:{...Xs.replace(o,e),id:o.props.id}})},ed=e=>{const n=$n(e),t=Li(n);t&&Fi(t.node,t.slot,!1),pl(n,e.index)},nd=(e,n)=>/* @__PURE__ */pt(Ye,{...$t?{}:hs.seam({place:{...Mn(e),index:n}})},`seam:${e}:${n}`),td={rowClick:hl,isCollapsed:Jr,toggleCollapse:Yr},od=e=>{const n=String(e.props.id),t=hi.findIndex(e=>String(e.props.id)===n),o=Gt(n),r=Mi(o),i=Jr(n),l=Bi(e.type),s=zr.rowName?zr.rowName(e,"section",l):l,d=e=>nd(o,e);/* @__PURE__ */
|
|
16
16
|
return ut(ft,{children:[
|
|
17
17
|
/* @__PURE__ */pt(Fe,{words:ro,icon:/* @__PURE__ */pt(Or,{type:e.type,size:13}),name:s,preview:gl(e),marks:yl(e),onSelect:()=>il(t),nameSlot:Xi(Oe,t,n,s),selected:rr===n,badge:Jl(e)?void 0:Ql,shared:Jl(e),actions:vl(e,Oe,t)??void 0,rowProps:{"data-node-id":n,onClick:hl(()=>il(t))},fold:{open:!i,label:"section",onToggle:()=>Yr(n)}}),!i&&/* @__PURE__ */ut(Ve,{children:[r.map((n,t)=>{const r=String(n.props.id),i=Pi(n),l=Pl(n),s=l&&Jr(r),a=()=>$l(o,t,r,e.type),{rowProps:c,...p}=hs.row({item:{id:r,zone:o,index:t,type:n.type},place:{...Mn(o),index:t}},{"data-node-id":r,onClick:hl(a)});/* @__PURE__ */
|
|
18
18
|
return ut(Wn,{children:[d(t),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t={fill:"buttonColor",fillOpacity:"buttonFillOpacity",border:"buttonBorder",text:"buttonTextColor",corners:"buttonCorners",cornerSides:"buttonCornerSides"},o={top:"buttonPaddingTop",right:"buttonPaddingRight",bottom:"buttonPaddingBottom",left:"buttonPaddingLeft"},r=["tl","tr","br","bl"];function n(t){if(!Array.isArray(t))return null;const o=t.filter(t=>r.includes(t));return r.filter(t=>o.includes(t))}function e(t){const o=n(t);return null!==o&&o.length<r.length}var i=t=>"number"==typeof t&&Number.isFinite(t)&&t>=0?t:void 0;function u(t){return"number"==typeof t&&Number.isFinite(t)?Math.round(Math.min(Math.max(t,0),100)):void 0}function l(t){if("string"==typeof t)return t?{width:1,color:t}:void 0;if(!t||"object"!=typeof t)return;const{width:o,color:r}=t,n=i(o),e={...void 0!==n?{width:n}:{},..."string"==typeof r&&r?{color:r}:{}};return Object.keys(e).length?e:void 0}function d(t){if(!t||"object"!=typeof t||Array.isArray(t))return;const o={};for(const r of["top","right","bottom","left"]){const n=i(t[r]);void 0!==n&&(o[r]=n)}return Object.keys(o).length?o:void 0}export{o as BUTTON_PAD_KEYS,t as BUTTON_STYLE_KEYS,r as CORNER_SIDES,l as buttonBorderOf,u as buttonFillOpacityOf,d as buttonPadSidesOf,e as hasCornerSubset,n as normalizeCornerSides};
|
package/dist/draw/index.d.ts
CHANGED
|
@@ -9,5 +9,5 @@ export { HERO_SLIDER_GOTO_EVENT, HeroSliderGotoDetail } from '../screen/lib/docu
|
|
|
9
9
|
export { B as BLOCK_ATTRIBUTE, R as REPEAT_ATTRIBUTE, a as REPEAT_INDEX_ATTRIBUTE } from '../dom-BpxMcHFP.js';
|
|
10
10
|
export { TEXT_STYLE_CASES, TEXT_STYLE_CASE_CSS, TextStyleCase, TextStyleCaseCss, isTextStyleCase, textStyleCaseCss, textStyleCaseOfCss } from '../text-styles/model.js';
|
|
11
11
|
export { BLOCK_FIXED_WIDTH, BLOCK_SIZE_KEYS, BLOCK_WIDTH_FIT_DEFAULT, BLOCK_WIDTH_FIT_POINTS, BLOCK_WIDTH_LIMIT, BlockSizeKey, BlockWidthFit, TEXT_FIT_MIN_FONT, TEXT_FIT_POINTS, TextFit, parseBlockWidthFit, parseTextFit } from '../screen/lib/content/block-size.js';
|
|
12
|
-
export { BUTTON_PAD_KEYS, BUTTON_STYLE_KEYS, CORNER_SIDES, CornerSide, hasCornerSubset, normalizeCornerSides } from '../screen/lib/content/style-keys.js';
|
|
12
|
+
export { BUTTON_PAD_KEYS, BUTTON_STYLE_KEYS, ButtonBorder, ButtonPadSides, CORNER_SIDES, CornerSide, buttonBorderOf, buttonFillOpacityOf, buttonPadSidesOf, hasCornerSubset, normalizeCornerSides } from '../screen/lib/content/style-keys.js';
|
|
13
13
|
import '../words-B5Gb7KFq.js';
|
package/dist/draw/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{SCALAR_TEXT_CONTROLS,TEXT_CONTROL_KINDS}from"../chunk-I6SK6ZDT.js";export{BUTTON_PAD_KEYS,BUTTON_STYLE_KEYS,CORNER_SIDES,hasCornerSubset,normalizeCornerSides}from"../chunk-
|
|
1
|
+
export{SCALAR_TEXT_CONTROLS,TEXT_CONTROL_KINDS}from"../chunk-I6SK6ZDT.js";export{BUTTON_PAD_KEYS,BUTTON_STYLE_KEYS,CORNER_SIDES,buttonBorderOf,buttonFillOpacityOf,buttonPadSidesOf,hasCornerSubset,normalizeCornerSides}from"../chunk-PLTTPHK5.js";export{BLOCK_FIXED_WIDTH,BLOCK_SIZE_KEYS,BLOCK_WIDTH_FIT_DEFAULT,BLOCK_WIDTH_FIT_POINTS,BLOCK_WIDTH_LIMIT,TEXT_FIT_MIN_FONT,TEXT_FIT_POINTS,parseBlockWidthFit,parseTextFit}from"../chunk-X3EMJ2EX.js";export{AUTO_RULES,FOLLOW_RULES,VIEW_DESKTOP_MIN,VIEW_TABLET_MIN,VIEW_TIERS,VIEW_TIER_LABEL,isAuto,phoneKey,resolveViewValue,tabletKey,viewTierForWidth}from"../chunk-E52W3M5I.js";export{rootRowName,sectionRenameProp,slotChildName,slotChildRenameProp,slotChildRowName}from"../chunk-5NHQ452C.js";export{HERO_SLIDER_GOTO_EVENT}from"../chunk-AJ2SUSET.js";export{hidableText,readHidable}from"../chunk-6UAEFOJ4.js";export{ANCHOR_FIELD_KEYS,FOLD_FIELD_MARKER,LINK_FIELD_MARKER,MEDIA_FIELD_MARKER,SCAFFOLD_FIELD_MARKER,TEXT_FIELD_MARKER,foldMetaOf,textFieldIdentifier}from"../chunk-ANPOR6EY.js";export{PART_SEP,decodePartId,encodePartId}from"../chunk-R4AUZVA3.js";export{FOOTER_TYPE,HEADER_TYPE,ROOT_ZONE,TREE_MAX_DEPTH,blockNodeActions,childSlotsOf,locateNode,missingPinnedTypes,nestsInTree,newNodeId,pinnedDuplicateIds,pinnedDuplicateIndices,slotChildrenIn,slotFieldsOf}from"../chunk-TCAAOYQY.js";export{TEXT_STYLE_CASES,TEXT_STYLE_CASE_CSS,isTextStyleCase,textStyleCaseCss,textStyleCaseOfCss}from"../chunk-YHZSBL2N.js";export{BLOCK_ATTRIBUTE}from"../chunk-FR7EEKFF.js";export{REPEAT_ATTRIBUTE,REPEAT_INDEX_ATTRIBUTE}from"../chunk-7UFKEX72.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ScreenChrome as default}from"../../chunk-
|
|
1
|
+
export{ScreenChrome as default}from"../../chunk-PL2L6G3B.js";import"../../chunk-UMBNBCL4.js";import"../../chunk-OXZDSOZV.js";import"../../chunk-7OCEPOEJ.js";import"../../chunk-JYVQ62TL.js";import"../../chunk-5XL2RXFU.js";import"../../chunk-3QB2ZQXK.js";import"../../chunk-7GGNFLHT.js";import"../../chunk-22I55W37.js";import"../../chunk-LUOY3A3Q.js";import"../../chunk-CVS3RPO6.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-6EDVZBUO.js";import"../../chunk-A2B6FLZP.js";import"../../chunk-YBDSG4BV.js";import"../../chunk-TOEJCZUO.js";import"../../chunk-PVBDKBJB.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-BYONFJVQ.js";import"../../chunk-QZJKWKGH.js";import"../../chunk-ERR437B5.js";import"../../chunk-JIP5JNRB.js";import"../../chunk-GR3XRILS.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-6ATIYLUL.js";import"../../chunk-KO47WAWR.js";import"../../chunk-NQW6XCAY.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-5545A3PC.js";import"../../chunk-2QXMDK67.js";import"../../chunk-GDO4QJ4G.js";import"../../chunk-IZGFJWH4.js";import"../../chunk-N7E6264U.js";import"../../chunk-N3MJOHAG.js";import"../../chunk-SBVIW3KJ.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-RUQOIQWI.js";import"../../chunk-ODHJRBJV.js";import"../../chunk-T2RINM7R.js";import"../../chunk-NCXYC7WI.js";import"../../chunk-STQDOTHF.js";import"../../chunk-YM4UEGBV.js";import"../../chunk-SNF5764Q.js";import"../../chunk-LX23TCTP.js";import"../../chunk-XFYFKITX.js";import"../../chunk-Q3VAJMXS.js";import"../../chunk-CWELHADJ.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-5NHQ452C.js";import"../../chunk-AJ2SUSET.js";import"../../chunk-6UAEFOJ4.js";import"../../chunk-ANPOR6EY.js";import"../../chunk-R4AUZVA3.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-EVYIDHCK.js";import"../../chunk-JQQFB7EZ.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-C7IFWSUA.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-WHS6Y55E.js";import"../../chunk-FM6JO4WF.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-56ID6FKZ.js";import"../../chunk-K53PQAMP.js";import"../../chunk-ZKY45F5G.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-P5VYGWYO.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-QTHQPJWA.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-VBEVZZTV.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-AJSDWWJW.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-YYD257TD.js";import"../../chunk-RE4LP46F.js";import"../../chunk-HZSZT3BE.js";import"../../chunk-PMRN5Z3T.js";import"../../chunk-Y2T3JX7K.js";import"../../chunk-KFWNGPW3.js";import"../../chunk-MIX7EGRG.js";import"../../chunk-DX3VILZ3.js";import"../../chunk-JACEEVVF.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-SQTVXE5D.js";import"../../chunk-TQ5Y6S2X.js";import"../../chunk-3XECMGXX.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-TOKMFZPB.js";import"../../chunk-FR7EEKFF.js";import"../../chunk-7UFKEX72.js";import"../../chunk-EUFDQ4KL.js";import"../../chunk-KXM6YRG2.js";import"../../chunk-BSPCSC45.js";import"../../chunk-467WWV4I.js";import"../../chunk-TIAWIOGD.js";import"../../chunk-MGVI67QV.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{DocumentScreen,ScreenMount as default}from"../../chunk-
|
|
1
|
+
export{DocumentScreen,ScreenMount as default}from"../../chunk-AVTC2WMN.js";import"../../chunk-GXQCZJOP.js";import"../../chunk-GQXH7DQV.js";import"../../chunk-PL2L6G3B.js";import"../../chunk-UMBNBCL4.js";import"../../chunk-OXZDSOZV.js";import"../../chunk-7OCEPOEJ.js";import"../../chunk-JYVQ62TL.js";import"../../chunk-5XL2RXFU.js";import"../../chunk-3QB2ZQXK.js";import"../../chunk-7GGNFLHT.js";import"../../chunk-22I55W37.js";import"../../chunk-LUOY3A3Q.js";import"../../chunk-CVS3RPO6.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-6EDVZBUO.js";import"../../chunk-A2B6FLZP.js";import"../../chunk-YBDSG4BV.js";import"../../chunk-TOEJCZUO.js";import"../../chunk-PVBDKBJB.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-BYONFJVQ.js";import"../../chunk-QZJKWKGH.js";import"../../chunk-ERR437B5.js";import"../../chunk-JIP5JNRB.js";import"../../chunk-GR3XRILS.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-6ATIYLUL.js";import"../../chunk-KO47WAWR.js";import"../../chunk-NQW6XCAY.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-5545A3PC.js";import"../../chunk-2QXMDK67.js";import"../../chunk-GDO4QJ4G.js";import"../../chunk-IZGFJWH4.js";import"../../chunk-N7E6264U.js";import"../../chunk-N3MJOHAG.js";import"../../chunk-SBVIW3KJ.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-RUQOIQWI.js";import"../../chunk-ODHJRBJV.js";import"../../chunk-T2RINM7R.js";import"../../chunk-NCXYC7WI.js";import"../../chunk-STQDOTHF.js";import"../../chunk-YM4UEGBV.js";import"../../chunk-SNF5764Q.js";import"../../chunk-LX23TCTP.js";import"../../chunk-XFYFKITX.js";import"../../chunk-Q3VAJMXS.js";import"../../chunk-CWELHADJ.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-5NHQ452C.js";import"../../chunk-AJ2SUSET.js";import"../../chunk-6UAEFOJ4.js";import"../../chunk-ANPOR6EY.js";import"../../chunk-R4AUZVA3.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-EVYIDHCK.js";import"../../chunk-JQQFB7EZ.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-C7IFWSUA.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-WHS6Y55E.js";import"../../chunk-FM6JO4WF.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-56ID6FKZ.js";import"../../chunk-K53PQAMP.js";import"../../chunk-ZKY45F5G.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-P5VYGWYO.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-QTHQPJWA.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-VBEVZZTV.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-AJSDWWJW.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-YYD257TD.js";import"../../chunk-RE4LP46F.js";import"../../chunk-HZSZT3BE.js";import"../../chunk-PMRN5Z3T.js";import"../../chunk-Y2T3JX7K.js";import"../../chunk-KFWNGPW3.js";import"../../chunk-MIX7EGRG.js";import"../../chunk-DX3VILZ3.js";import"../../chunk-JACEEVVF.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-SQTVXE5D.js";import"../../chunk-TQ5Y6S2X.js";import"../../chunk-3XECMGXX.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-TOKMFZPB.js";import"../../chunk-FR7EEKFF.js";import"../../chunk-7UFKEX72.js";import"../../chunk-EUFDQ4KL.js";import"../../chunk-KXM6YRG2.js";import"../../chunk-BSPCSC45.js";import"../../chunk-467WWV4I.js";import"../../chunk-TIAWIOGD.js";import"../../chunk-MGVI67QV.js";
|
package/dist/screen/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunk-GZO72N3Q.js";export{DocumentScreen,ScreenMount}from"../chunk-
|
|
1
|
+
import"../chunk-GZO72N3Q.js";export{DocumentScreen,ScreenMount}from"../chunk-AVTC2WMN.js";import"../chunk-GXQCZJOP.js";export{ScreenStoreProvider}from"../chunk-GQXH7DQV.js";import"../chunk-PL2L6G3B.js";import"../chunk-UMBNBCL4.js";import"../chunk-OXZDSOZV.js";import"../chunk-7OCEPOEJ.js";import"../chunk-JYVQ62TL.js";import"../chunk-5XL2RXFU.js";import"../chunk-3QB2ZQXK.js";import"../chunk-7GGNFLHT.js";import"../chunk-22I55W37.js";import"../chunk-LUOY3A3Q.js";import"../chunk-CVS3RPO6.js";import"../chunk-KCBEE2MC.js";import"../chunk-6EDVZBUO.js";import"../chunk-A2B6FLZP.js";import"../chunk-YBDSG4BV.js";import"../chunk-TOEJCZUO.js";import"../chunk-PVBDKBJB.js";import"../chunk-RKTF5XLP.js";import"../chunk-BYONFJVQ.js";import"../chunk-QZJKWKGH.js";import"../chunk-ERR437B5.js";import"../chunk-JIP5JNRB.js";import"../chunk-GR3XRILS.js";export{NO_DOCUMENT_ADDRESSING}from"../chunk-RLBXE4EU.js";import"../chunk-6ATIYLUL.js";import"../chunk-KO47WAWR.js";import"../chunk-NQW6XCAY.js";import"../chunk-LOMEH6DG.js";import"../chunk-5545A3PC.js";import"../chunk-2QXMDK67.js";import"../chunk-GDO4QJ4G.js";import"../chunk-IZGFJWH4.js";import"../chunk-N7E6264U.js";import"../chunk-N3MJOHAG.js";import"../chunk-SBVIW3KJ.js";import"../chunk-UMDQ6CLQ.js";import"../chunk-KCOBHPN6.js";import"../chunk-RUQOIQWI.js";export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSelectionMode,isSlotMode,sameInspectorMode,screenSlotsOf,shownChildSlotsOf,shownSlotFieldsOf,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../chunk-ODHJRBJV.js";import"../chunk-T2RINM7R.js";import"../chunk-NCXYC7WI.js";import"../chunk-STQDOTHF.js";export{EaselSessionProvider,useEaselSession}from"../chunk-YM4UEGBV.js";export{EFFICIENT_BACKEND,activateEaselSession,backendOf,createEaselSession,currentEaselSession,deactivateEaselSession,efficientClientOpen,isEfficientBackend,provideDefaultBackend,resetAmbientEaselSession,sessionRegistry,setSessionBridgedSite,setSessionDocumentSite}from"../chunk-SNF5764Q.js";export{DETACHED_EASEL_HOST,EaselHostContext,EaselHostProvider,FIELD_DESCRIPTION_MARKER,createEaselHost,describedAs,useEaselHost,useHostEscape}from"../chunk-LX23TCTP.js";import"../chunk-XFYFKITX.js";import"../chunk-Q3VAJMXS.js";import"../chunk-CWELHADJ.js";import"../chunk-6WY6ZXJG.js";import"../chunk-5NHQ452C.js";import"../chunk-AJ2SUSET.js";import"../chunk-6UAEFOJ4.js";import"../chunk-ANPOR6EY.js";import"../chunk-R4AUZVA3.js";import"../chunk-TCAAOYQY.js";import"../chunk-EVYIDHCK.js";import"../chunk-JQQFB7EZ.js";import"../chunk-TBY3DFKS.js";import"../chunk-C7IFWSUA.js";import"../chunk-BPXEFVSQ.js";import"../chunk-YCSZAP7T.js";import"../chunk-ZEH6QLBH.js";import"../chunk-WHS6Y55E.js";import"../chunk-FM6JO4WF.js";import"../chunk-K56YDHYQ.js";import"../chunk-56ID6FKZ.js";import"../chunk-K53PQAMP.js";import"../chunk-ZKY45F5G.js";import"../chunk-FIVU2COQ.js";import"../chunk-P5VYGWYO.js";import"../chunk-WK3AFPXY.js";import"../chunk-QTHQPJWA.js";import"../chunk-NDRZP6YR.js";import"../chunk-H6DDIBQ4.js";import"../chunk-VBEVZZTV.js";import"../chunk-MJM6SFD3.js";import"../chunk-AJSDWWJW.js";import"../chunk-2OAZYSWJ.js";import"../chunk-YYD257TD.js";import"../chunk-RE4LP46F.js";import"../chunk-HZSZT3BE.js";import"../chunk-PMRN5Z3T.js";import"../chunk-Y2T3JX7K.js";import"../chunk-KFWNGPW3.js";import"../chunk-MIX7EGRG.js";import"../chunk-DX3VILZ3.js";import"../chunk-JACEEVVF.js";import"../chunk-MFIRYGHW.js";import"../chunk-SQTVXE5D.js";import"../chunk-TQ5Y6S2X.js";import"../chunk-3XECMGXX.js";import"../chunk-P2VEMZH5.js";import"../chunk-TOKMFZPB.js";import"../chunk-FR7EEKFF.js";import"../chunk-7UFKEX72.js";import"../chunk-EUFDQ4KL.js";import"../chunk-KXM6YRG2.js";import"../chunk-BSPCSC45.js";import"../chunk-467WWV4I.js";import"../chunk-TIAWIOGD.js";import"../chunk-MGVI67QV.js";
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
* published render code reads the same objects through `efficient-easel/draw`,
|
|
10
10
|
* so it keeps no copy of its own.
|
|
11
11
|
*
|
|
12
|
-
* PURE: no React, no import. What each value DRAWS stays the host's.
|
|
12
|
+
* PURE: no React, no import. What each value DRAWS stays the host's. The
|
|
13
|
+
* stored look of a button (Fill opacity, Border, Padding) is read here too.
|
|
13
14
|
*/
|
|
14
15
|
/** The keys the Button's style rows store, as the website stores them. */
|
|
15
16
|
declare const BUTTON_STYLE_KEYS: {
|
|
@@ -43,5 +44,34 @@ declare function normalizeCornerSides(value: unknown): CornerSide[] | null;
|
|
|
43
44
|
/** `true` when a stored set switches at least one corner off: the only case
|
|
44
45
|
* that draws differently from all four. */
|
|
45
46
|
declare function hasCornerSubset(value: unknown): boolean;
|
|
47
|
+
/** A stored Fill opacity: a finite number, held to 0-100 and rounded to a
|
|
48
|
+
* whole number. Anything else is nothing stored. */
|
|
49
|
+
declare function buttonFillOpacityOf(stored: unknown): number | undefined;
|
|
50
|
+
/** A button's border as the Border row stores it. */
|
|
51
|
+
interface ButtonBorder {
|
|
52
|
+
width?: number;
|
|
53
|
+
color?: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A stored button border, as the Border row's `{ width, color }`: only the
|
|
57
|
+
* parts that hold a value (a width of 0 or more, a colour that is not empty).
|
|
58
|
+
* An old colour string (the email's first button card) is a 1px border of
|
|
59
|
+
* that colour; a reader, not a data move. Nothing set is `undefined`.
|
|
60
|
+
*/
|
|
61
|
+
declare function buttonBorderOf(stored: unknown): ButtonBorder | undefined;
|
|
62
|
+
/** A button's own padding, per side; a side not set is absent. */
|
|
63
|
+
interface ButtonPadSides {
|
|
64
|
+
top?: number;
|
|
65
|
+
right?: number;
|
|
66
|
+
bottom?: number;
|
|
67
|
+
left?: number;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* A stored button padding `{ top, right, bottom, left }`: the sides that hold
|
|
71
|
+
* a finite number of 0 or more, as stored. `undefined` when no side is set,
|
|
72
|
+
* so a button saved before draws what it drew. The website keeps the sides on
|
|
73
|
+
* flat keys ({@link BUTTON_PAD_KEYS}); it hands them in as one object.
|
|
74
|
+
*/
|
|
75
|
+
declare function buttonPadSidesOf(stored: unknown): ButtonPadSides | undefined;
|
|
46
76
|
|
|
47
|
-
export { BUTTON_PAD_KEYS, BUTTON_STYLE_KEYS, CORNER_SIDES, type CornerSide, hasCornerSubset, normalizeCornerSides };
|
|
77
|
+
export { BUTTON_PAD_KEYS, BUTTON_STYLE_KEYS, type ButtonBorder, type ButtonPadSides, CORNER_SIDES, type CornerSide, buttonBorderOf, buttonFillOpacityOf, buttonPadSidesOf, hasCornerSubset, normalizeCornerSides };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{BUTTON_PAD_KEYS,BUTTON_STYLE_KEYS,CORNER_SIDES,hasCornerSubset,normalizeCornerSides}from"../../../chunk-
|
|
1
|
+
export{BUTTON_PAD_KEYS,BUTTON_STYLE_KEYS,CORNER_SIDES,buttonBorderOf,buttonFillOpacityOf,buttonPadSidesOf,hasCornerSubset,normalizeCornerSides}from"../../../chunk-PLTTPHK5.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{buttonFieldSet as e}from"../../../chunk-
|
|
1
|
+
import{buttonFieldSet as e}from"../../../chunk-N7TLQQ3R.js";import"../../../chunk-ETNX2ASF.js";import{boxFieldSet as o}from"../../../chunk-EEIDFHOG.js";import"../../../chunk-CLAADE4J.js";import"../../../chunk-2T22IY3J.js";import"../../../chunk-7GGNFLHT.js";import"../../../chunk-22I55W37.js";import"../../../chunk-LX23TCTP.js";import"../../../chunk-Q3VAJMXS.js";import"../../../chunk-CWELHADJ.js";import"../../../chunk-6WY6ZXJG.js";import"../../../chunk-PLTTPHK5.js";import{phoneKey as t}from"../../../chunk-E52W3M5I.js";import{foldMetaOf as n}from"../../../chunk-ANPOR6EY.js";import"../../../chunk-EVYIDHCK.js";import"../../../chunk-JQQFB7EZ.js";import"../../../chunk-TBY3DFKS.js";import"../../../chunk-YCSZAP7T.js";import"../../../chunk-FM6JO4WF.js";import"../../../chunk-56ID6FKZ.js";import"../../../chunk-K53PQAMP.js";import"../../../chunk-QTHQPJWA.js";import"../../../chunk-OECWLNKJ.js";import"../../../chunk-HZSZT3BE.js";import"../../../chunk-PMRN5Z3T.js";import"../../../chunk-KFWNGPW3.js";import"../../../chunk-MIX7EGRG.js";import"../../../chunk-DX3VILZ3.js";import"../../../chunk-JACEEVVF.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-TOKMFZPB.js";import"../../../chunk-FR7EEKFF.js";import"../../../chunk-7UFKEX72.js";import"../../../chunk-EUFDQ4KL.js";import"../../../chunk-KXM6YRG2.js";import"../../../chunk-BSPCSC45.js";function s(e){return Object.keys(e).filter(o=>{return t=e[o],!(null!==n(t));var t})}function r(e,o){const t=o.off??{},s=o.keys??{};for(const[e,o]of Object.entries(t))if(!o.trim())throw new Error(`blockSetFor: off row "${e}" needs a reason.`);for(const o of[...Object.keys(t),...Object.keys(s)]){if(!Object.hasOwn(e,o))throw new Error(`blockSetFor: the set has no row "${o}".`);if(Object.hasOwn(t,o)&&Object.hasOwn(s,o))throw new Error(`blockSetFor: row "${o}" is both off and renamed.`)}const r={};let i=[];for(const[o,c]of Object.entries(e)){const a=n(c);if(a){i=i.filter(([,e])=>n(e).level<a.level),i.push([o,c]);continue}if(Object.hasOwn(t,o))continue;for(const[e,o]of i)r[e]=o;i=[];const u=Object.hasOwn(s,o)?s[o]:o;if(Object.hasOwn(r,u)||u!==o&&Object.hasOwn(e,u))throw new Error(`blockSetFor: renamed key "${u}" is already a row.`);r[u]=c}return r}function i(e){const o=e.build();r(o,e.email),r(o,e.website);const t=s(o),n=e=>new Set(Object.keys(e.off??{})),i=n(e.email),c=n(e.website),a=[];for(const o of t)i.has(o)&&!c.has(o)&&a.push({row:o,only:"website",reason:e.email.off[o]}),c.has(o)&&!i.has(o)&&a.push({row:o,only:"email",reason:e.website.off[o]});return a}var c=["button","image","box","divider","logo","text","section","social"],a={useFill:()=>"",useText:()=>"",useBorder:()=>({width:0,color:""}),useCorners:()=>0},u={button:{build:()=>e({follows:a,padding:{fallback:{}}}),email:{editor:"email"},website:{editor:"website"}},box:{build:()=>o(),email:{editor:"email",keys:{gap:"itemGap"},off:Object.fromEntries(["sectionPaddingTop","sectionPaddingRight","sectionPaddingBottom","sectionPaddingLeft"].map(e=>[t(e),"email: a Banner Box draws in the desktop view only (admin inBannerFields)"]))},website:{editor:"website"}}},h={button:"the set is in easel; admin (A-B) and web-builder (W-B) still build their own rows (plan group 1)",image:"no easel set yet (plan group 2)",box:"the set is in easel and the email Banner Box imports it; the website Flex builds its own rows (plan group 3)",divider:"no easel set yet (plan group 4)",logo:"no easel set yet (plan group 5)",text:"no easel set yet (plan group 6)",section:"no easel set yet (plan group 7)",social:"no easel set yet (plan group 7)"};export{c as BLOCK_KINDS,h as BLOCK_SETS_STILL_TWO_COPIES,u as BLOCK_SET_PAIRS,i as blockSetDifferences,r as blockSetFor,s as blockSetRowKeys};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{buttonFieldSet}from"../../../chunk-
|
|
1
|
+
export{buttonFieldSet}from"../../../chunk-N7TLQQ3R.js";import"../../../chunk-ETNX2ASF.js";import"../../../chunk-EEIDFHOG.js";import"../../../chunk-CLAADE4J.js";import"../../../chunk-2T22IY3J.js";import"../../../chunk-7GGNFLHT.js";import"../../../chunk-22I55W37.js";import"../../../chunk-LX23TCTP.js";import"../../../chunk-Q3VAJMXS.js";import"../../../chunk-CWELHADJ.js";import"../../../chunk-6WY6ZXJG.js";export{BUTTON_PAD_KEYS,BUTTON_STYLE_KEYS}from"../../../chunk-PLTTPHK5.js";import"../../../chunk-E52W3M5I.js";import"../../../chunk-ANPOR6EY.js";import"../../../chunk-EVYIDHCK.js";import"../../../chunk-JQQFB7EZ.js";import"../../../chunk-TBY3DFKS.js";import"../../../chunk-YCSZAP7T.js";import"../../../chunk-FM6JO4WF.js";import"../../../chunk-56ID6FKZ.js";import"../../../chunk-K53PQAMP.js";import"../../../chunk-QTHQPJWA.js";import"../../../chunk-OECWLNKJ.js";import"../../../chunk-HZSZT3BE.js";import"../../../chunk-PMRN5Z3T.js";import"../../../chunk-KFWNGPW3.js";import"../../../chunk-MIX7EGRG.js";import"../../../chunk-DX3VILZ3.js";import"../../../chunk-JACEEVVF.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-TOKMFZPB.js";import"../../../chunk-FR7EEKFF.js";import"../../../chunk-7UFKEX72.js";import"../../../chunk-EUFDQ4KL.js";import"../../../chunk-KXM6YRG2.js";import"../../../chunk-BSPCSC45.js";
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BoxField, BoxFieldSay } from './box-fields.js';
|
|
3
|
+
import { Shadow } from './shadow-values.js';
|
|
4
|
+
export { DEFAULT_SHADOW, DEFAULT_SHADOW_COLOR, SHADOWS, shadowValue } from './shadow-values.js';
|
|
5
|
+
import 'efficient-shell/format';
|
|
6
|
+
import 'efficient-shell/ui';
|
|
7
|
+
import '../../../types-BusXrvDU.js';
|
|
8
|
+
import '../../../wordFit-7XpmhcaW.js';
|
|
9
|
+
import '../../../words-BrN08Fup.js';
|
|
10
|
+
import '../../../buckets-_MGDYJlb.js';
|
|
11
|
+
import '../../../ScreenDocumentContext-DPW_6gOC.js';
|
|
12
|
+
import '../../../blocks/index.js';
|
|
13
|
+
import '../../../types-BljCVdzR.js';
|
|
14
|
+
import '../../../data/index.js';
|
|
15
|
+
import '../../../types-Dq180WRV.js';
|
|
16
|
+
import '../../../resolve-Bz4mszpL.js';
|
|
17
|
+
import '../../../plan-D0DgSLnY.js';
|
|
18
|
+
import '../document-contract.js';
|
|
19
|
+
import '../document-switch.js';
|
|
20
|
+
import '../../../engine-CvXpFE86.js';
|
|
21
|
+
import '../../../edit-lock/index.js';
|
|
22
|
+
import '../admin-bridge.js';
|
|
23
|
+
import '../session.js';
|
|
24
|
+
import '../backend-error.js';
|
|
25
|
+
import '../host-chrome.js';
|
|
26
|
+
import '../links/link-filters.js';
|
|
27
|
+
import '../document-hooks.js';
|
|
28
|
+
import '../section-template-types.js';
|
|
29
|
+
import './content-tree.js';
|
|
30
|
+
import '../shared-section-types.js';
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* THE ONE SHADOW ROW of both editors, and the colour row under it.
|
|
34
|
+
*
|
|
35
|
+
* The website's Card shadow (web-builder `CardShadowField`,
|
|
36
|
+
* `ShadowColourField`) and the email Image's Shadow drew the same choice in
|
|
37
|
+
* two copies: None, Soft, Lifted, and the colour the shadow is cast in. The
|
|
38
|
+
* rows are easel's: the shell's `IconPicker` with a miniature of each rung
|
|
39
|
+
* (the website's look, Lewis 2026-10-29: the IconPicker is the one control
|
|
40
|
+
* for a choice of a shape), and easel's colour row under it.
|
|
41
|
+
*
|
|
42
|
+
* What is stored does not change: a rung word, and a `#rrggbb`. An unset row
|
|
43
|
+
* stores nothing and shows the rung the host draws while unset (`builtIn`:
|
|
44
|
+
* `none` in an email, `soft` on the website) in grey, with "Default".
|
|
45
|
+
*
|
|
46
|
+
* The rungs' real sizes are each host's (the shop's CSS, the email bake's
|
|
47
|
+
* `overlay_layout.SHADOWS`); the miniatures here only keep their order and
|
|
48
|
+
* their distance apart at chip scale.
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
interface ShadowFieldOptions {
|
|
52
|
+
label: string;
|
|
53
|
+
icon?: ReactNode;
|
|
54
|
+
/** The rung the host draws while the row is unset. Default `none`. */
|
|
55
|
+
builtIn?: Shadow;
|
|
56
|
+
hint?: ReactNode;
|
|
57
|
+
}
|
|
58
|
+
interface ShadowColourFieldOptions {
|
|
59
|
+
label: string;
|
|
60
|
+
/** The row's own key. Default `shadowColor`. */
|
|
61
|
+
key?: string;
|
|
62
|
+
/** The colour an unset row follows. Default {@link DEFAULT_SHADOW_COLOR}. */
|
|
63
|
+
follows?: string;
|
|
64
|
+
hint?: ReactNode;
|
|
65
|
+
}
|
|
66
|
+
/** The two shadow rows, in the host's words. */
|
|
67
|
+
declare function shadowFieldBuilders(say?: BoxFieldSay): {
|
|
68
|
+
shadowField: (o: ShadowFieldOptions) => BoxField<unknown>;
|
|
69
|
+
shadowColourField: (o: ShadowColourFieldOptions) => BoxField<unknown>;
|
|
70
|
+
};
|
|
71
|
+
declare const shadowField: (o: ShadowFieldOptions) => BoxField<unknown>;
|
|
72
|
+
declare const shadowColourField: (o: ShadowColourFieldOptions) => BoxField<unknown>;
|
|
73
|
+
|
|
74
|
+
export { Shadow, type ShadowColourFieldOptions, type ShadowFieldOptions, shadowColourField, shadowField, shadowFieldBuilders };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{DEFAULT_SHADOW_COLOR as o,DEFAULT_SHADOW as n,shadowValue as r,SHADOWS as i}from"../../../chunk-CRITA6CA.js";export{DEFAULT_SHADOW,DEFAULT_SHADOW_COLOR,SHADOWS,shadowValue}from"../../../chunk-CRITA6CA.js";import{styleFieldBuilders as t}from"../../../chunk-ETNX2ASF.js";import"../../../chunk-EEIDFHOG.js";import"../../../chunk-CLAADE4J.js";import{SettingsDefaultReset as s}from"../../../chunk-2T22IY3J.js";import"../../../chunk-7GGNFLHT.js";import"../../../chunk-22I55W37.js";import"../../../chunk-LX23TCTP.js";import"../../../chunk-Q3VAJMXS.js";import"../../../chunk-CWELHADJ.js";import"../../../chunk-6WY6ZXJG.js";import"../../../chunk-PLTTPHK5.js";import"../../../chunk-E52W3M5I.js";import"../../../chunk-ANPOR6EY.js";import"../../../chunk-EVYIDHCK.js";import"../../../chunk-JQQFB7EZ.js";import"../../../chunk-TBY3DFKS.js";import"../../../chunk-YCSZAP7T.js";import"../../../chunk-FM6JO4WF.js";import{DEFAULT_PANEL_WORDS as e}from"../../../chunk-56ID6FKZ.js";import"../../../chunk-K53PQAMP.js";import"../../../chunk-QTHQPJWA.js";import"../../../chunk-OECWLNKJ.js";import"../../../chunk-HZSZT3BE.js";import"../../../chunk-PMRN5Z3T.js";import"../../../chunk-KFWNGPW3.js";import{SettingsField as p}from"../../../chunk-MIX7EGRG.js";import"../../../chunk-DX3VILZ3.js";import"../../../chunk-JACEEVVF.js";import{useWords as c}from"../../../chunk-MFIRYGHW.js";import"../../../chunk-TOKMFZPB.js";import"../../../chunk-FR7EEKFF.js";import"../../../chunk-7UFKEX72.js";import"../../../chunk-EUFDQ4KL.js";import"../../../chunk-KXM6YRG2.js";import"../../../chunk-BSPCSC45.js";import{ShadowIcon as h}from"efficient-shell/icons/efficient";import{IconPicker as u}from"efficient-shell/ui";import{jsx as l}from"react/jsx-runtime";var m={none:"None",soft:"Soft",lifted:"Lifted"},a={none:"none",soft:"0 1px 1px rgba(20, 20, 22, 0.10), 0 2px 4px -1px rgba(20, 20, 22, 0.14)",lifted:"0 1px 2px rgba(20, 20, 22, 0.10), 0 4px 7px -2px rgba(20, 20, 22, 0.30)"},k={display:"block",flex:"none",boxSizing:"border-box",width:16,height:11};function j({o:o,say:t,props:j}){const d=c("panel",e),f=o.builtIn??n,F=r(j.value),b=F??f,C=t(o.label);/* @__PURE__ */
|
|
2
|
+
return l(p,{label:C,icon:o.icon??/* @__PURE__ */l(h,{}),value:t(m[b]),changed:null!==F,hint:o.hint,action:/* @__PURE__ */l(s,{words:d,label:C,changed:null!==F,detail:t(m[f]),onReset:()=>j.onChange(void 0),disabled:j.readOnly}),children:/* @__PURE__ */l(u,{label:C,value:b,options:i.map(o=>({value:o,label:t(m[o]),icon:/* @__PURE__ */l("span",{"data-shadow-chip":"",className:"border border-line bg-surface",style:{...k,boxShadow:a[o]}})})),onChange:o=>j.onChange(o),disabled:j.readOnly})})}function d(n=o=>o){const{colourField:r}=t(n);return{shadowField:o=>({type:"custom",render:r=>/* @__PURE__ */l(j,{o:o,say:n,props:r})}),shadowColourField:n=>{const i=n.follows??o;return r({key:n.key??"shadowColor",label:n.label,icon:/* @__PURE__ */l(h,{}),hint:n.hint,useFollows:()=>i})}}}var{shadowField:f,shadowColourField:F}=d();export{F as shadowColourField,f as shadowField,d as shadowFieldBuilders};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shadow choice's VALUES, for both editors and any page that draws a
|
|
3
|
+
* shadow (no React, no import: the `render` entry group): the rungs and the
|
|
4
|
+
* one default colour. The rows are `./shadow-fields`.
|
|
5
|
+
*/
|
|
6
|
+
/** The rungs, flattest first, so the row reads as one axis. */
|
|
7
|
+
declare const SHADOWS: readonly ["none", "soft", "lifted"];
|
|
8
|
+
type Shadow = (typeof SHADOWS)[number];
|
|
9
|
+
/** The rung an unset row is in, unless the host says otherwise. */
|
|
10
|
+
declare const DEFAULT_SHADOW: Shadow;
|
|
11
|
+
/** The colour a shadow is cast in while its row is unset: one value for both
|
|
12
|
+
* editors and the email bake (efficient-backend `overlay_layout`). */
|
|
13
|
+
declare const DEFAULT_SHADOW_COLOR = "#141416";
|
|
14
|
+
/** A stored rung, or `null` for anything else (unset, or a word it does not know). */
|
|
15
|
+
declare function shadowValue(value: unknown): Shadow | null;
|
|
16
|
+
|
|
17
|
+
export { DEFAULT_SHADOW, DEFAULT_SHADOW_COLOR, SHADOWS, type Shadow, shadowValue };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{DEFAULT_SHADOW,DEFAULT_SHADOW_COLOR,SHADOWS,shadowValue}from"../../../chunk-CRITA6CA.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { ColorPreset } from 'efficient-shell/ui';
|
|
3
3
|
import { CornerSide } from '../content/style-keys.js';
|
|
4
4
|
export { CORNER_SIDES } from '../content/style-keys.js';
|
|
@@ -78,6 +78,8 @@ interface ColourFieldOptions extends Stored {
|
|
|
78
78
|
/** What Reset's tooltip says it goes back to, in the host's words
|
|
79
79
|
* (`#2E2E2E from Styles`). The bare hex when left out. */
|
|
80
80
|
resetTo?: (hex: string) => string;
|
|
81
|
+
/** Drawn under the control line. */
|
|
82
|
+
hint?: ReactNode;
|
|
81
83
|
}
|
|
82
84
|
/** The widest border a row offers, px (the website's answer 4). */
|
|
83
85
|
declare const BORDER_WIDTH_MAX = 20;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{BORDER_WIDTH_MAX,CORNER_RADIUS_MAX,borderField,colourField,cornersField,keptByRow,styleFieldBuilders}from"../../../chunk-
|
|
1
|
+
export{BORDER_WIDTH_MAX,CORNER_RADIUS_MAX,borderField,colourField,cornersField,keptByRow,styleFieldBuilders}from"../../../chunk-ETNX2ASF.js";import"../../../chunk-EEIDFHOG.js";import"../../../chunk-CLAADE4J.js";import"../../../chunk-2T22IY3J.js";import"../../../chunk-7GGNFLHT.js";import"../../../chunk-22I55W37.js";import"../../../chunk-LX23TCTP.js";import"../../../chunk-Q3VAJMXS.js";import"../../../chunk-CWELHADJ.js";import"../../../chunk-6WY6ZXJG.js";export{CORNER_SIDES}from"../../../chunk-PLTTPHK5.js";import"../../../chunk-E52W3M5I.js";import"../../../chunk-ANPOR6EY.js";import"../../../chunk-EVYIDHCK.js";import"../../../chunk-JQQFB7EZ.js";import"../../../chunk-TBY3DFKS.js";import"../../../chunk-YCSZAP7T.js";import"../../../chunk-FM6JO4WF.js";import"../../../chunk-56ID6FKZ.js";import"../../../chunk-K53PQAMP.js";import"../../../chunk-QTHQPJWA.js";import"../../../chunk-OECWLNKJ.js";import"../../../chunk-HZSZT3BE.js";import"../../../chunk-PMRN5Z3T.js";import"../../../chunk-KFWNGPW3.js";import"../../../chunk-MIX7EGRG.js";import"../../../chunk-DX3VILZ3.js";import"../../../chunk-JACEEVVF.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-TOKMFZPB.js";import"../../../chunk-FR7EEKFF.js";import"../../../chunk-7UFKEX72.js";import"../../../chunk-EUFDQ4KL.js";import"../../../chunk-KXM6YRG2.js";import"../../../chunk-BSPCSC45.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-easel",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.8.0",
|
|
4
4
|
"description": "Efficient Easel: the EFFICIENT editors' shared engine and chrome: the saved document as pure functions, the published renderer, and the editor frame, panels, Layers tree, text grammar and type-in-place box. Published as editor-shell up to 0.66.0 and as efficient-editor up to 0.95.0.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Efficient Pty Ltd",
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
"./screen/lib/content/style-keys",
|
|
36
36
|
"./screen/lib/document/content-tree",
|
|
37
37
|
"./screen/lib/document/hidable",
|
|
38
|
-
"./screen/lib/document/slot-child-name"
|
|
38
|
+
"./screen/lib/document/slot-child-name",
|
|
39
|
+
"./screen/lib/document/shadow-values"
|
|
39
40
|
],
|
|
40
41
|
"editor": [
|
|
41
42
|
"./rail",
|
|
@@ -106,6 +107,7 @@
|
|
|
106
107
|
"./screen/lib/document/field-buckets",
|
|
107
108
|
"./screen/lib/document/field-markers",
|
|
108
109
|
"./screen/lib/document/image-fields",
|
|
110
|
+
"./screen/lib/document/shadow-fields",
|
|
109
111
|
"./screen/lib/document/palette-sections",
|
|
110
112
|
"./screen/lib/document/panel-fields",
|
|
111
113
|
"./screen/lib/document/panel-no-control-mark",
|
|
@@ -481,6 +483,16 @@
|
|
|
481
483
|
"import": "./dist/screen/lib/document/image-fields.js",
|
|
482
484
|
"default": "./dist/screen/lib/document/image-fields.js"
|
|
483
485
|
},
|
|
486
|
+
"./screen/lib/document/shadow-fields": {
|
|
487
|
+
"types": "./dist/screen/lib/document/shadow-fields.d.ts",
|
|
488
|
+
"import": "./dist/screen/lib/document/shadow-fields.js",
|
|
489
|
+
"default": "./dist/screen/lib/document/shadow-fields.js"
|
|
490
|
+
},
|
|
491
|
+
"./screen/lib/document/shadow-values": {
|
|
492
|
+
"types": "./dist/screen/lib/document/shadow-values.d.ts",
|
|
493
|
+
"import": "./dist/screen/lib/document/shadow-values.js",
|
|
494
|
+
"default": "./dist/screen/lib/document/shadow-values.js"
|
|
495
|
+
},
|
|
484
496
|
"./screen/lib/document/device-fields": {
|
|
485
497
|
"types": "./dist/screen/lib/document/device-fields.d.ts",
|
|
486
498
|
"import": "./dist/screen/lib/document/device-fields.js",
|
package/dist/chunk-BAI7MIH4.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t={fill:"buttonColor",fillOpacity:"buttonFillOpacity",border:"buttonBorder",text:"buttonTextColor",corners:"buttonCorners",cornerSides:"buttonCornerSides"},n={top:"buttonPaddingTop",right:"buttonPaddingRight",bottom:"buttonPaddingBottom",left:"buttonPaddingLeft"},o=["tl","tr","br","bl"];function r(t){if(!Array.isArray(t))return null;const n=t.filter(t=>o.includes(t));return o.filter(t=>n.includes(t))}function e(t){const n=r(t);return null!==n&&n.length<o.length}export{n as BUTTON_PAD_KEYS,t as BUTTON_STYLE_KEYS,o as CORNER_SIDES,e as hasCornerSubset,r as normalizeCornerSides};
|
package/dist/chunk-EZXQJN6V.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{useAccessPatch as e,FLAT_ACCESS as o,onDesktopWords as r,useAccessValue as t}from"./chunk-EEIDFHOG.js";import{CornersInput as s,BorderInput as l,SettingsColour as n}from"./chunk-CLAADE4J.js";import{SettingsDefaultReset as i}from"./chunk-2T22IY3J.js";import{noControlField as c,NoControlMark as a}from"./chunk-22I55W37.js";import{normalizeCornerSides as d,CORNER_SIDES as u}from"./chunk-BAI7MIH4.js";import{DEFAULT_PANEL_WORDS as p,DEFAULT_COLOUR_ROW_WORDS as y}from"./chunk-56ID6FKZ.js";import{SettingsField as f}from"./chunk-MIX7EGRG.js";import{useWords as h}from"./chunk-MFIRYGHW.js";import{CornerIcon as m,BorderAllIcon as b}from"efficient-shell/icons/efficient";import{jsx as w}from"react/jsx-runtime";var g=e=>e;function v(e,o){const r=o.twinAccess;return r?{key:e.key,access:r,ownField:r.ownField}:e}function k(e,r){const s=!e.access||e.ownField?{value:r.value,onChange:r.onChange}:void 0;return t(e.access??o,e.key,s)}function F(e,r){return t(e.access??o,r??"")}function j(e){return{...c({type:"custom",render:()=>/* @__PURE__ */w(a,{})},"always"),reachedBy:e}}function B({o:t,say:s,props:l}){const i=h("colourRow",y),c=h("panel",p),a=t.useFollows(),d=t.usePresets?.(),u=t.opacity?.useUnset?.()??100,f=v(t,l),[m,b]=k(f,l),[g,j]=F(f,t.opacity?.key),B=e(f.access??o),C="string"==typeof m?m:"",O="number"==typeof g,A="follows"in l,I=(A&&"string"==typeof l.follows&&""!==l.follows?l.follows:void 0)??a,x=t.access||A?void 0:"";/* @__PURE__ */
|
|
2
|
-
return w(n,{label:s(t.label),icon:t.icon,value:C,onChange:e=>b(""===e?x:e),inherited:I,presets:d,changed:""!==C||O,onReset:()=>{O&&t.opacity?B([[t.key,x],[t.opacity.key,void 0]]):b(x)},resetTo:A?r(s,I.toUpperCase()):t.resetTo?t.resetTo(a.toUpperCase()):a.toUpperCase(),...t.opacity?{opacity:O?g:u,onOpacityChange:e=>j(e)}:{},readOnly:l.readOnly,words:i,resetWords:c})}var C=20;function O({o:e,say:o,props:t}){const s=e.useFollows(),[n,c]=k(v(e,t),t),a=n&&"object"==typeof n?n:{},d="follows"in t,u=d&&t.follows&&"object"==typeof t.follows?t.follows:{},p="number"==typeof u.width?u.width:s.width,y="string"==typeof u.color&&""!==u.color?u.color:s.color,h=Object.keys(a).length>0,m={width:o("Border width"),sides:{top:o("Border top"),right:o("Border right"),bottom:o("Border bottom"),left:o("Border left")},style:o("Border style"),styles:{solid:o("Solid"),dashed:o("Dashed"),dotted:o("Dotted")},color:o("Border color"),unit:"px"};/* @__PURE__ */
|
|
3
|
-
return w(f,{label:o("Border"),icon:/* @__PURE__ */w(b,{}),action:d?/* @__PURE__ */w(i,{label:o("Border"),changed:h,detail:r(o,`${p}px`),disabled:t.readOnly,onReset:()=>c(void 0)}):void 0,children:/* @__PURE__ */w(l,{label:o("Border"),value:a,each:!1,onChange:o=>c(function(e){const o=Object.fromEntries(Object.entries(e).filter(([,e])=>null!=e&&""!==e));return Object.keys(o).length?o:void 0}(e.styles?{width:o.width,color:o.color,style:o.style}:{width:o.width,color:o.color})),placeholder:{sides:{top:p,right:p,bottom:p,left:p},style:u.style??"solid",color:y},presets:[y],words:m,styles:e.styles??!1,max:20,readOnly:t.readOnly})})}var A=40,I=()=>null;function x({o:r,say:t,props:l}){const n=h("panel",p),c=r.useFollows(),[a,y]=k(r,l),[b,g]=F(r,r.sidesKey),v=e(r.access??o),j=r.access?void 0:null,B="number"==typeof a&&Number.isFinite(a)?a:null,C=d((r.useFollowsSides??I)())??[...u],O=d(b)??C,A=[{value:"tl",label:t("Top left")},{value:"tr",label:t("Top right")},{value:"bl",label:t("Bottom left")},{value:"br",label:t("Bottom right")}];/* @__PURE__ */
|
|
4
|
-
return w(f,{label:t("Corners"),icon:/* @__PURE__ */w(m,{}),changed:null!==B||Array.isArray(b),action:/* @__PURE__ */w(i,{label:t("Corners"),changed:null!==B||Array.isArray(b),detail:`${c}px`,onReset:()=>Array.isArray(b)?v([[r.key,j],[r.sidesKey,j]]):y(j),words:n}),children:/* @__PURE__ */w(s,{label:t("Corners"),value:O,corners:A,onChange:e=>{const o=u.filter(o=>e.includes(o)),r=o.length===C.length&&o.every(e=>C.includes(e));g(r?j:o)},radius:B,onRadiusChange:e=>y(e??j),radiusMin:0,radiusMax:40,radiusStep:r.step??1,radiusPlaceholder:String(c),disabled:l.readOnly})})}function R(e=g){return{colourField:o=>({type:"custom",render:r=>/* @__PURE__ */w(B,{o:o,say:e,props:r})}),borderField:o=>({type:"custom",render:r=>/* @__PURE__ */w(O,{o:o,say:e,props:r})}),cornersField:o=>({type:"custom",render:r=>/* @__PURE__ */w(x,{o:o,say:e,props:r})})}}var{colourField:T,borderField:D,cornersField:E}=R();export{C as BORDER_WIDTH_MAX,A as CORNER_RADIUS_MAX,D as borderField,T as colourField,E as cornersField,j as keptByRow,R as styleFieldBuilders};
|