efficient-easel 20.0.0 → 20.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ScreenDocumentContext-RxVWWWHq.d.ts → ScreenDocumentContext-CFJeqqKk.d.ts} +27 -2
- package/dist/chunk-276MBG5P.js +2 -0
- package/dist/{chunk-MS2U6MV5.js → chunk-2G6MAXPY.js} +1 -1
- package/dist/{chunk-A42LPWNM.js → chunk-47CD7ULN.js} +1 -1
- package/dist/{chunk-EW6XAMDZ.js → chunk-47PYYMFM.js} +6 -6
- package/dist/{chunk-2A7HLAI5.js → chunk-5THLKXTH.js} +1 -1
- package/dist/{chunk-EZG3TGQ7.js → chunk-77IWWW6X.js} +1 -1
- package/dist/{chunk-SK3P56FS.js → chunk-7LYKFL3Q.js} +13 -13
- package/dist/{chunk-LNHT2KPX.js → chunk-FHCKFOCD.js} +2 -2
- package/dist/{chunk-BW5COX42.js → chunk-H4JCMK36.js} +1 -1
- package/dist/{chunk-KC24D76S.js → chunk-HBBXDGDD.js} +1 -1
- package/dist/{chunk-CBICQ4J3.js → chunk-LEZFSSQN.js} +5 -5
- package/dist/chunk-MQA7OFRA.js +2 -0
- package/dist/{chunk-QALW2ECZ.js → chunk-PEDR7G3K.js} +1 -1
- package/dist/{chunk-NHY5L3SE.js → chunk-PI6RFJR4.js} +1 -1
- package/dist/chunk-RVZJ52EP.js +63 -0
- package/dist/{chunk-VPFNZ7TB.js → chunk-U66YKDAR.js} +1 -1
- package/dist/{chunk-5DPIGWUL.js → chunk-UJ46J7QW.js} +1 -1
- package/dist/{chunk-RYNBSKE7.js → chunk-UNVKPVZW.js} +1 -1
- package/dist/{chunk-RR4VIAHP.js → chunk-WBFLSCTI.js} +3 -3
- package/dist/copy/index.js +12 -12
- package/dist/fields/index.js +1 -1
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/MediaPopup.js +1 -1
- package/dist/screen/components/NodeContextMenu.d.ts +1 -1
- package/dist/screen/components/NodeContextMenu.js +1 -1
- package/dist/screen/components/PageEditGuardNotices.js +1 -1
- package/dist/screen/components/SaveControls.d.ts +1 -1
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenDocumentContext.d.ts +1 -1
- package/dist/screen/components/ScreenDocumentContext.js +1 -1
- package/dist/screen/components/ScreenMount.d.ts +1 -1
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.d.ts +1 -1
- package/dist/screen/components/ScreenStoreProvider.js +1 -1
- package/dist/screen/components/SectionScreenShell.js +16 -16
- package/dist/screen/components/usePartBridge.d.ts +1 -1
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.d.ts +1 -1
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/admin-bridge.js +1 -1
- package/dist/screen/lib/document-addressing.d.ts +1 -1
- package/dist/screen/lib/host-inbound.js +1 -1
- package/dist/screen/lib/host.d.ts +1 -1
- package/dist/screen/lib/host.js +1 -1
- package/dist/screen/lib/key-scope.js +1 -1
- package/dist/screen/lib/media-panel.d.ts +1 -1
- package/dist/screen/lib/media-panel.js +1 -1
- package/dist/screen/lib/media-picker.d.ts +1 -1
- package/dist/screen/lib/media-picker.js +1 -1
- package/dist/screen/lib/puck/style-clipboard.d.ts +1 -1
- package/dist/screen/lib/puck/use-section-ops.js +1 -1
- package/dist/screen/lib/screen-parts.d.ts +1 -1
- package/dist/screen/lib/screen-parts.js +1 -1
- package/dist/strings/index.js +1 -1
- package/dist/text-styles/index.js +21 -21
- package/package.json +1 -1
- package/dist/chunk-BC5KJNHN.js +0 -63
- package/dist/chunk-M62P4IQK.js +0 -2
- package/dist/chunk-U3JP4VGF.js +0 -2
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import{cloneNodeWithFreshIds as e}from"./chunk-2GVCAIPX.js";import{dedupeSlotChildren as n}from"./chunk-26OOWIJJ.js";import{styleClipboardOf as t}from"./chunk-JBOSEHIX.js";import{markedTreeNodeId as o,revealSelectedTreeRow as r,sameSelector as i}from"./chunk-FGNR22NY.js";import{scrollPreviewToSection as l,gotoPreviewSlide as s,scrollPreviewToTop as d}from"./chunk-2E2SXDYQ.js";import{useEaselKeyTarget as a,useEaselUndoKeys as c,useEaselSaveKey as p,editorRootFocus as u}from"./chunk-HBBXDGDD.js";import{SlotChildActionsProvider as h}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as f,DEFAULT_PANEL_W as m,clampPanelWidth as g}from"./chunk-C56MPJBH.js";import{usePartBridge as y}from"./chunk-47CD7ULN.js";import{useSectionOps as v}from"./chunk-PI6RFJR4.js";import{ScreenSaveIcon as k,ScreenMainButton as b}from"./chunk-PY7OOQEZ.js";import{useBrowserOffline as S}from"./chunk-RKTF5XLP.js";import{AddChildRow as w}from"./chunk-5545A3PC.js";import{AddSidePanel as x}from"./chunk-47PYYMFM.js";import{keepsSharedSections as z,sharedSectionsOf as C}from"./chunk-43AEUUNQ.js";import{SidePanelHead as N,PanelShowStrip as I}from"./chunk-SINAM2IT.js";import{offeredChoices as O}from"./chunk-M2Z775ZC.js";import{useScreenSaveSwitch as B,useScreenNodeKeys as P,useScreenPinned as $,useScreenDocumentLabel as M,useScreenCanvasFrame as j,useScreenInspectorPanel as L,useScreenDevices as A,useScreenPickFollowsSelection as T,useScreenLeftView as E,SELECTION_MODE as R,sameInspectorMode as F,useScreenBridges as D,useScreenBlockRules as H,useScreenBlockLook as V,useScreenStorageNamespace as W,useScreenNotify as U,useScreenCanvasHead as J,isSlotMode as Y,useScreenStyleClipboard as G,useScreenDocumentPass as K,useScreenCanvasDrag as Z,ScreenCanvasTargetProvider as Q,isPinnedFirst as X,isPinnedLast as _,screenSlotsOf as q}from"./chunk-LEZFSSQN.js";import{MediaPopup as ee}from"./chunk-2G6MAXPY.js";import{useNodeClipboard as ne,useNodeContextMenu as te}from"./chunk-PEDR7G3K.js";import{PageEditGuardNotices as oe}from"./chunk-UJ46J7QW.js";import{useScreenDocument as re}from"./chunk-276MBG5P.js";import{requestMediaPick as ie}from"./chunk-UNVKPVZW.js";import{useMediaPanel as le,usePanelPick as se,useMediaBrowsing as de,useOpenMediaBrowse as ae,useMediaPlace as ce}from"./chunk-FHCKFOCD.js";import{useEaselSession as pe}from"./chunk-O7Q4DDJT.js";import{useEaselHost as ue,useHostEscape as he}from"./chunk-MQA7OFRA.js";import{LayersIcon as fe,MediaIcon as me}from"./chunk-XFYFKITX.js";import{DEFAULT_SCREEN_WORDS as ge}from"./chunk-23DYNW6S.js";import{heldStyle as ye,styleShortcut as ve}from"./chunk-V7U33NF2.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as ke}from"./chunk-6WY6ZXJG.js";import{rootRowName as be,slotChildRowName as Se,slotChildRenameProp as we,sectionRenameProp as xe}from"./chunk-BHRC3ASL.js";import{ROOT_ZONE as ze,blockNodeActions as Ce,TREE_MAX_DEPTH as Ne,childSlotsOf as Ie,slotFieldsOf as Oe,newNodeId as Be,slotChildrenIn as Pe,nestsInTree as $e}from"./chunk-PLVEGYK6.js";import{useEasel as Me,useEaselApi as je,CanvasPassThroughContext as Le,CanvasSharedContext as Ae}from"./chunk-ROPYFLNZ.js";import{TreeRow as Te,Subtree as Ee,LayersTree as Re,TreeGroupLabel as Fe,TreeRowAction as De,TreeSeam as He}from"./chunk-A6Z4SD3I.js";import{DEFAULT_TREE_WORDS as Ve}from"./chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as We}from"./chunk-WK3AFPXY.js";import{toItemSelector as Ue,useNodeOps as Je,clickPick as Ye}from"./chunk-BSHIQIZC.js";import{EaselTopBar as Ge,TopBarCluster as Ke,EaselIconButton as Ze,TopBarDivider as Qe,DeviceSwitch as Xe,InspectorIconButton as _e,PanelResizeHandle as qe,MAX_PANEL_W as en,MIN_PANEL_W_BY_SIDE as nn,panelWidthVars as tn}from"./chunk-ZG6PVMC3.js";import{DEFAULT_NOTICE_WORDS as on,DEFAULT_CHROME_WORDS as rn}from"./chunk-AJSDWWJW.js";import{holderOf as ln,nameOrSomeone as sn}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as dn}from"./chunk-RE4LP46F.js";import{useWords as an}from"./chunk-MFIRYGHW.js";import{insertSeams as cn,CanvasDragLayer as pn,CanvasInsert as un}from"./chunk-LDEEFLE3.js";import{DEFAULT_DRAG_WORDS as hn}from"./chunk-KAML3KQH.js";import{createDragSession as fn,useTreeDrag as mn,gapToMoveIndex as gn}from"./chunk-3S5N4HLJ.js";import{useCanvasFrame as yn,LIST_SELECTOR as vn,BLOCK_SELECTOR as kn,useCanvasTyping as bn,useCanvasEvent as Sn,nodeIdAt as wn,frameRectToHost as xn,BLOCK_ATTRIBUTE as zn,drawnBox as Cn}from"./chunk-QIDRJH3S.js";import{queryMainCopy as Nn}from"./chunk-LF3FUSCQ.js";import{ROOT_ID as In,ROOT_SLOT as On,zoneKey as Bn,parseZoneKey as Pn,find as $n,DataError as Mn}from"./chunk-K7BTCBWD.js";import{useRef as jn,useMemo as Ln,useState as An,useEffect as Tn,useCallback as En,useLayoutEffect as Rn,Fragment as Fn,useId as Dn}from"react";import{ColoredBadge as Hn,Tabs as Vn,toast as Wn,readMediaFileDrag as Un,Tooltip as Jn,groupColors as Yn,Dialog as Gn,FormField as Kn,Input as Zn,Button as Qn,MEDIA_FILE_DRAG_TYPE as Xn}from"efficient-shell/ui";import{UndoIcon as _n,RedoIcon as qn,RefreshIcon as et,AddIcon as nt,TrashIcon as tt,EyeOffIcon as ot,EyeIcon as rt,SharedIcon as it,DuplicateIcon as lt}from"efficient-shell/icons/efficient";import{jsx as st,jsxs as dt,Fragment as at}from"react/jsx-runtime";var ct="media-file";function pt({name:e,onMake:n,onCancel:t}){const o=an("screen",ge).shared,[r,i]=An(e),[l,s]=An(!1),d=Dn(),a=jn(null),c=async()=>{const e=r.trim();if(e&&!l){s(!0);try{await n(e)}finally{s(!1)}}};/* @__PURE__ */
|
|
2
|
+
return st(Gn,{open:!0,size:"sm",title:o.makeShared,description:o.makeSharedHint,onClose:t,initialFocus:a,footer:/* @__PURE__ */dt(at,{children:[
|
|
3
|
+
/* @__PURE__ */st(Qn,{variant:"secondary",onClick:t,children:o.cancel}),
|
|
4
|
+
/* @__PURE__ */st(Qn,{variant:"primary",loading:l,disabled:!r.trim(),onClick:()=>{c()},children:o.makeShared})]}),children:/* @__PURE__ */st("form",{onSubmit:e=>{e.preventDefault(),c()},children:/* @__PURE__ */st(Kn,{label:o.name,htmlFor:d,children:/* @__PURE__ */st(Zn,{id:d,ref:a,value:r,onChange:e=>i(e.target.value)})})})})}var ut=/* @__PURE__ */new WeakSet;function ht(e,n,t){const o=$n(e,n,t);if(!o)return null;const r=o.path.find(e=>"root"!==e.parentId);return r?r.parentId:t}function ft({canvas:e,tabs:n,onSelect:t}){const o=jn(null),[r,i]=An({}),l=n.map(e=>`${e.id}:${e.below?1:0}`).join("|");return Rn(()=>{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=xn(l,{left:0,top:0,width:r.innerWidth,height:r.innerHeight},e),a={};for(const o of n){const n=Nn(t,`[${zn}="${r.CSS?.escape?r.CSS.escape(o.id):o.id}"]`),i=n?Cn(n):null;if(!i||0===i.height){a[o.id]=null;continue}const s=xn(l,{left:i.left,top:i.top,width:i.width,height:i.height},e),c=s.top+s.height;if(c<d.top||s.top>d.top+d.height){a[o.id]=null;continue}const p=o.below?c+4:Math.max(s.top,d.top)+6;a[o.id]={left:Math.max(s.left,d.left)+6,top:p}}i(a)},a=()=>{s||(s=r.requestAnimationFrame(d))};d(),r.addEventListener("scroll",a,!0),r.addEventListener("resize",a);const c=new r.MutationObserver(a);return c.observe(t.body,{childList:!0,subtree:!0,attributes:!0}),()=>{s&&r.cancelAnimationFrame(s),r.removeEventListener("scroll",a,!0),r.removeEventListener("resize",a),c.disconnect()}},[e,l]),/* @__PURE__ */st("div",{ref:o,className:"es-band-tabs","aria-hidden":"true",children:n.map(e=>{const n=r[e.id];return n?/* @__PURE__ */st("span",{className:"es-band-tab","data-band-tab":e.id,style:{left:n.left,top:n.top},onClick:n=>{n.stopPropagation(),t(e.id)},children:e.reach?
|
|
5
|
+
/* @__PURE__ */st(Jn,{content:e.reach,children:/* @__PURE__ */dt(Hn,{colorClass:Yn("success","solid"),size:"sm",children:[
|
|
6
|
+
/* @__PURE__ */st("span",{className:"es-band-tab-mark",children:/* @__PURE__ */st(it,{size:12})}),e.label]})}):/* @__PURE__ */st(Hn,{colorClass:Yn("info","solid"),size:"sm",children:e.label})},e.id):null})})}function mt({expand:e}){/* @__PURE__ */
|
|
7
|
+
return st("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */dt(at,e?{children:[
|
|
8
|
+
/* @__PURE__ */st("path",{d:"M8 9l4-4 4 4"}),
|
|
9
|
+
/* @__PURE__ */st("path",{d:"M8 15l4 4 4-4"})]}:{children:[
|
|
10
|
+
/* @__PURE__ */st("path",{d:"M8 4l4 4 4-4"}),
|
|
11
|
+
/* @__PURE__ */st("path",{d:"M8 20l4-4 4 4"}),
|
|
12
|
+
/* @__PURE__ */st("path",{d:"M5 12h14"})]})})}var gt=`${vn}, ${kn}`;function yt(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 vt="__rungs";var kt="screen:band",bt={duplicate:!0,delete:!0},St=()=>null;function wt(){const vn=ue(),xn=vn.panels?.Toolbar,zn=(vn.panels?.useRight??St)(),{target:Cn,docId:Dn,capabilities:Jn,currentSlug:Yn,siteId:Gn,onPublish:Kn,saveState:Zn,saveConflict:Qn,retrySave:it,toggleAutoSave:wt,flushSave:xt,access:zt,saveUnreachable:Ct=!1,readOnly:Nt,readOnlyReason:It=null}=re(),Ot=B(),Bt=P(),{mediaEditing:Pt,hasEditGuard:$t,hasPinnedChrome:Mt}=Jn,{appState:jt,dispatch:Lt,history:At,selectedItem:Tt,getSelectorForId:Et,config:Rt}=Me(e=>e),Ft=$(),{first:Dt,firstGroup:Ht,lastGroup:Vt,isSectionGroup:Wt,sectionGroupZone:Ut,panelOf:Jt}=Ft,Yt=Jt(Dt),Gt=e=>X(Ft,e),Kt=e=>_(Ft,e),Zt="node"===Ft.firstRow,Qt=Ft.band??null,Xt=an("screen",ge),_t=an("tree",Ve),qt=an("drag",hn),eo=an("notice",on),no=an("lock",dn),to=an("menu",We),oo=an("styleClipboard",ke),ro=an("chrome",rn),io=M()??`/${Yn}`,lo=j(),so=L(),ao=v({readOnly:Nt}),co=v({readOnly:Nt,foldIntoHistory:!0}),po=jn(null),uo=je(),ho=Ln(()=>({...ao,select:e=>{po.current=e,ao.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=uo.config;po.current=Ue(e,t,n)}ao.commitDocument(e,n)}}),[ao,uo]),fo=jt.ui,mo=fo.leftSideBarVisible,go=fo.rightSideBarVisible,{options:yo,widths:vo,initial:ko,fluid:bo,fit:So}=A(),[wo,xo]=An(ko),zo=le(),Co=Pt&&null!==zo,No=se(),Io=de(),Oo=null!==No||Io,Bo=ae();T(Tt?.props.id);const{read:Po,write:$o,forSelection:Mo}=E(),[jo,Lo]=An(Po);Tn(()=>{$o(jo)},[jo]);const[Ao,To]=An(0),Eo=jn(null),Ro=jn(null),Fo=yn(Ro,{readySelector:gt}),Do=bn(Fo),Ho=a(Ro);c(Ro,Fo);const Vo=S(),Wo=ln(zt),Uo={state:Zn,offline:Vo||Zn.failed&&Ct,readOnlyReason:It,editing:Wo?eo.editing({name:sn(Wo.name,no),noun:Xt.noun}):null,conflict:null!=Qn,notSaving:Xt.bar.notSaving},Jo=()=>{Nt||(Zn.failed?it():xt())};p(Ro,Fo,Jo);const[Yo,Go]=An(!1),Ko=jn(!1),[Zo,Qo]=An(null),[Xo,_o]=An([]),[qo,er]=An(R),nr="puck"===qo.kind,tr=o(qo,Tt?.props.id),[or,rr]=An(null);Tn(()=>{or&&(r(),rr(null))},[or]);const ir=jn(Et);ir.current=Et;const lr=En((e,{scroll:n})=>{Lo(n=>Mo(e,n)),n&&rr(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=ir.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&Ar(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),sr=jn(null);Tn(()=>{const e=sr.current;sr.current=null;const n=null==Tt?.props.id?null:String(Tt.props.id);er(t=>e&&e.id===n?e.mode:"part"===t.kind&&"nodeId"in t&&t.nodeId===n?t:Jt(Tt?.type)??R);const t=Tt?.props.id,o=po.current;if(po.current=null,!t)return;const r=Et(t);lr(String(t),{scroll:!i(o,r??null,ze)})},[Tt?.props.id,lr]);const dr=En(e=>{er(n=>F(n,e)?n:e),Lt({type:"setUi",ui:{rightSideBarVisible:!0}})},[Lt]),ar=jn(()=>{});ar.current=(e,n)=>{const t=e?Mi(e.zone??ze)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==Tt?.props.id?null:String(Tt.props.id);er(e=>F(e,n)?e:n),o!==r&&(sr.current={id:o,mode:n},ho.select(e))};const cr=En((e,n)=>ar.current(e,n),[]),pr={kind:qo.kind,mode:qo,open:dr,show:e=>er(e),reveal:()=>{go||Lt({type:"setUi",ui:{rightSideBarVisible:!0}})},select:cr},ur=D(pr,{data:jt.data,selected:Tt??null,zoneOf:e=>Et(e)?.zone,readOnly:Boolean(Nt),select:e=>{er(R),ho.select({index:e})},replace:(e,n)=>ho.replaceComponent(ze,e,n),scrollTo:e=>l(e)},{device:wo,refreshes:Ao},{setView:Lo,reveal:()=>{mo||Lt({type:"setUi",ui:{leftSideBarVisible:!0}})}}),hr=ur.resolveLeftView?ur.resolveLeftView(jo):"sections",fr=H(),{isLockedBlock:mr,duplicateBlocked:gr,nestDepth:yr,newSectionNode:vr,canAddTo:kr,blockIsOffered:br}=fr,Sr=V(),{labelAtLevel:wr,Icon:xr,useProducts:zr}=Sr,Cr=Sr.rowName?(e,n,t)=>Sr.rowName(e,n,t):void 0,Nr=En(e=>{Lt({type:"setUi",ui:{rightSideBarVisible:!0}}),l(e),lr(e,{scroll:!0})},[Lt,lr]),{selectNode:Ir,openPartId:Or}=y({mode:qo,setMode:er,onOpenPart:Nr}),[Br,Pr]=An(null);he(null!==Br,()=>Pr(null));const $r=f(W()),Mr=$r.collapsed,jr=$r.panelWidths,[Lr,Ar]=An(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(Mr);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
|
|
13
|
+
return new Set}});Tn(()=>{try{window.localStorage.setItem(Mr,JSON.stringify([...Lr]))}catch{}},[Lr]);const[Tr,Er]=An(()=>{if("undefined"==typeof window)return{...m};try{const e=window.localStorage.getItem(jr);if(!e)return{...m};const n=JSON.parse(e);return{left:g(Number(n.left)||m.left,"left"),right:g(Number(n.right)||m.right,"right")}}catch{return{...m}}});Tn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(jr,JSON.stringify(Tr))}catch{}},300);return()=>clearTimeout(e)},[Tr]);const Rr=En((e,n)=>Er(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),Fr=En(e=>Rr("left",e),[Rr]),Dr=En(e=>Rr("right",e),[Rr]),Hr=e=>Lr.has(e),Vr=e=>Ar(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Wr=jn(!1),Ur=jn(null);Tn(()=>{if(Wr.current&&!Yo){const e=Ur.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??Ro.current?.querySelector(`button[aria-label="${CSS.escape(Xt.add.title)}"]`))?.focus(),Ur.current=null}Wr.current=Yo},[Yo]),Tn(()=>{if(!Yo||!Ho)return;const e=e=>{"Escape"===e.key&&cl()};return Ho.addEventListener("keydown",e),()=>Ho.removeEventListener("keydown",e)},[Yo,Ho]),he(Yo,()=>cl()),Tn(()=>{!mo&&Yo&&(Go(!1),Qo(null),Ko.current=!1)},[mo]);const Jr=U(),Yr=(e,n="success",t)=>{if(Jr)return void(t?Jr(e,"error"===n?"error":"info",t):Jr(e,"error"===n?"error":"info"));const o={sound:!1,action:t?.action,onClose:t?.onClose};"error"===n?Wn.error(e,{...o,duration:t?.duration??3200}):Wn.success(e,{...o,duration:t?.duration??1900})},Gr=jn(null),[Kr,Zr]=An(0),[Qr,Xr]=An(0),_r=J(),qr=jn(null),ei=e=>Math.max(0,e.clientHeight-(qr.current?.offsetHeight??0));Tn(()=>{const e=Gr.current;if(!e)return;const n=()=>{Zr(e.clientWidth),Xr(ei(e))};n();const t=new ResizeObserver(n);return t.observe(e),qr.current&&t.observe(qr.current),()=>t.disconnect()},[]),Rn(()=>{Gr.current&&(Zr(Gr.current.clientWidth),Xr(ei(Gr.current)))},[Tr,mo,go]);const ni=wo===bo?Kr>0?Kr:vo[bo]:vo[wo],ti=Kr>0?Math.min(Kr/ni,"shrink"===So?1:2):1,oi=ni*ti,ri=Kr>0&&oi>Kr+1,ii={width:oi,height:Qr||"100%",flex:"none",position:"relative"},li={width:ni,height:Qr?Qr/ti:"100%",maxHeight:"none",transform:1!==ti?`scale(${ti})`:void 0,transformOrigin:"top left"},si=()=>Lt({type:"setUi",ui:{leftSideBarVisible:!mo}}),di=()=>Lt({type:"setUi",ui:{rightSideBarVisible:!go}}),ai=e=>{Yo&&(Go(!1),Qo(null),Ko.current=!1,mo&&jo===e)||(Lo(e),mo||Lt({type:"setUi",ui:{leftSideBarVisible:!0}}))},ci=()=>{ie(vn,{accept:"image/*",title:ro.mediaLibrary})},pi=()=>{er(R),ho.select(null),d()},ui=()=>{er(Yt??R),go||Lt({type:"setUi",ui:{rightSideBarVisible:!0}})},hi=jt.data.content??[],fi=()=>{const e=hi.findIndex(Gt),n=hi.findIndex(Kt);return{floor:e>=0?e+1:0,cap:n>=0?n:hi.length}},mi=Rt,gi=fr.stripCopy,yi=n=>e(n,gi),vi=ne(),ki=Je({data:jt.data,config:mi,readOnly:Boolean(Nt),clipboard:vi,strip:gi?e=>gi(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==In||e.slot!==On)return{min:0,max:n-1};const{floor:t,cap:o}=fi();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&er(R);const t=void 0===n||"node"===n?.kind?n:null;ho.commitDocument(e,t)}}),bi=pe(),[Si,wi]=An(null),xi=e=>{const n=hi.find(n=>String(n.props.id)===e),t=Ft.shared;n&&t&&ki.swap(e,t.detach(n))},zi=e=>{const n=$n(jt.data,Rt,e);if(!n)return!1;const t=Bn(n.place),o=n.node,r=t===ze?Bi(o):Wi(o),i=t===ze?Ft.shared?.usedOn(o):null;return!!ki.remove(e)&&(Yr(i?Xt.shared.removed({count:Math.max(0,i.length-1)}):Xt.deleted({name:r}),"success",{duration:8e3,action:{label:Xt.bar.undo,onClick:()=>{ki.restore(n.node,n.place)}}}),!0)},Ci={...ki,remove:zi},Ni=e=>wr(e,"block",Rt.components[e]?.label??e),Ii=En(e=>Rt.components[e]?.defaultProps??{},[Rt]),Oi=e=>wr(e,"section",Ni(e)),Bi=e=>be({type:e.type,props:e.props??{}},Oi(e.type),Cr),{nodeAddresses:Pi,zoneItems:$i}=Ln(()=>{const e=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map,t=(o,r,i)=>{n.set(r,o),o.forEach((n,o)=>{const l=String(n.props?.id??"");if(l&&e.set(l,{zone:r,index:o}),i>=Ne)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of Ie(Rt,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(hi,ze,0),{nodeAddresses:e,zoneItems:n}},[hi,Rt]),Mi=En(e=>$i.get(e)??[],[$i]),ji=e=>{const n=Pi.get(e);return n?Mi(n.zone)[n.index]:void 0},Li=e=>q(fr,Rt,e),Ai=e=>{if(!fr.slotsOf||e===ze)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=ji(e.slice(0,n));if(!t)return null;const o=Li(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}},Ti=(()=>{if(!Y(qo))return null;const e=`${qo.nodeId}:${qo.slot}`;return Ai(e)?.slot.panel===qo.kind?e:null})(),Ei=jn(null);Tn(()=>{const e=Ei.current;if(Ei.current=null,!Ti||!Y(qo))return;const n=qo.nodeId;lr(n,{scroll:e!==Ti}),Ar(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[qo]);const Ri=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=Pi.get(e);n&&(n.zone===ze?ol(n.index):Pl(n.zone,n.index,e,ji(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&Ti!==i&&(Ei.current=i),cr(null,r),go||Lt({type:"setUi",ui:{rightSideBarVisible:!0}}),l(o)},Fi=(e,n,t)=>{const o=`${e}:${n}`;if(Ar(n=>{if(!n.has(o)&&!n.has(e))return n;const t=new Set(n);return t.delete(o),t.delete(e),t}),!t)return;Ti!==o&&(Ei.current=o);cr(null,{kind:t,nodeId:e,slot:n})},Di=(e,n,t)=>{if(Nt||!fr.moveSlot)return;const o=ji(e),r=o?Li(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:vt,index:n},s=gn(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=fr.moveSlot(e,n,s);"string"==typeof d&&Fi(e,d,i.panel)},Hi=zr(),Vi=Ln(()=>{const e=/* @__PURE__ */new Map;for(const n of Hi??[])e.set(n.slug,n.name);return e},[Hi]),Wi=e=>Se(e,Ni,Sr.plainText,e=>Vi.get(e),Sr.rowName),Ui=(e,n)=>{const t=Rt.components[e.type]?.fields,o=n===ze||ts(n)?"section":"block",r=n===ze&&(Gt(e)||Kt(e)||Wt(e.type)),i="block"===o?we(t):r?null:xe(t);return Sr.renamePropOf?Sr.renamePropOf(e,o,i):i},Ji=(e,n,t,o)=>{if(!(!Nt&&Br?.zone===e&&Br.index===n))return;const r=(t,o)=>{Pr(null),o&&((e,n,t)=>{const o=Mi(e)[n];if(!o)return;const r=Ui(o,e);r&&ho.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
|
|
14
|
+
return st("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":Xt.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)},Yi=t(G(),oo),Gi=Yi.scope({target:Cn,siteId:Gn,docId:Dn}),Ki=Rt,Zi=(e,n)=>n===ze?Oi(e):Ni(e),Qi=(e,n,t)=>{const o=Yi.plan(Gi,t,Zi(t.type,e),Ki);o&&(o.changed&&ho.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),Yr(o.message))},Xi=te({nodesIn:Mi,nodeAt:(e,n)=>Mi(e)[n]??null,labelOf:(e,n)=>n===ze?Oi(e):Ni(e),renamePropOf:Ui,beginRename:(e,n)=>Pr({zone:e,index:n}),history:{hasPast:At.hasPast,hasFuture:At.hasFuture,back:()=>At.back(),forward:()=>At.forward()},openPageSettings:()=>{ho.select(null),er(R)},pageSettingsLabel:Xt.pageSettings,words:{menu:to,styleClipboard:oo,screen:Xt.menu},readOnly:Boolean(Nt),collapseAll:()=>Ar(new Set(Mi(ze).map(e=>String(e.props.id)))),onPasteRefused:e=>Yr(e?Xt.pasteRefused({name:e.label}):Xt.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>is(e,n),menuRows:(e,n,t)=>{const o=ur.menuRows?.(e,n,t)??null,r=((e,n)=>{const t=Ft.shared;if(!t||n!==ze)return null;const o=t.usedOn(e);if(o){const n={pick:[{label:Xt.shared.onPages({count:o.length}),onClick:()=>{},children:o.map(e=>({label:e.title,onClick:()=>t.openPage(e)}))}]};return Nt||mr(e.type,e)?n:{...n,change:[{label:Xt.shared.detach,onClick:()=>xi(e.props.id)}],remove:[{label:Xt.shared.removeFromPage,danger:!0,onClick:()=>{zi(e.props.id)}}]}}return Nt||Gt(e)||Kt(e)||Wt(e.type)?null:z(bi)?{change:[{label:Xt.shared.makeShared,onClick:()=>wi({id:e.props.id,name:Bi(e)})}]}:null})(e,n);if(!r)return o;return Object.fromEntries(["pick","make","change","remove"].map(e=>[e,[...o?.[e]??[],...r[e]??[]]]).filter(([,e])=>e.length>0))},isLocked:e=>mr(e.type,e),duplicateBlocked:e=>gr(jt.data,e),permits:e=>{const n=Ce(Rt,e.type);return Ft.shared?.usedOn(e)?{...n,delete:!1}:n},nodeOps:Ci,isPinned:(e,n)=>n===ze&&(Gt(e)||Kt(e)),sectionBand:fi,locate:e=>Pi.get(e)??null,rowNameOf:(e,n)=>n===ze?Bi(e):Wi(e),selectAt:(e,n,t,o)=>{e===ze?ol(n):Pl(e,n,t,o??"")},slotRung:e=>{const n=Ai(e);return n?.slot.panel?{label:n.slot.label,select:()=>Ri(n.node,n.slot,!1)}:null},style:{held:()=>ye(Gi),canCopy:e=>Yi.rows(Ki,e).some(e=>!1!==e.counted),copy:(e,n)=>Yi.copy(Gi,e,Zi(e.type,n),Ki),paste:(e,n,t)=>Qi(e,n,t)},keys:Bt?{target:Ho,selected:()=>{const e=jt.ui.itemSelector;return e?{zone:e.zone??ze,index:e.index}:null},held:()=>vi.get(),readOnly:Boolean(Nt),onDone:({done:e,name:n})=>{"copied"===e&&Yr(Xt.copied({name:n}))}}:void 0},Fo),_i=jn({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});Tn(()=>{_i.current={copy:(e,n)=>Yi.copy(Gi,e,Zi(e.type,n),Ki),paste:Qi,at:()=>{const e=jt.ui.itemSelector;if(!e)return null;const n=e.zone??ze,t=Mi(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(Nt)}});const qi=En(e=>{const n=ve(e);if(!n)return;const t=_i.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))},[]);Tn(()=>{if(!Ho)return;const e=e=>qi(e);return Ho.addEventListener("keydown",e),()=>Ho.removeEventListener("keydown",e)},[qi,Ho]),Sn(Fo,"keydown",qi);const el=hi.map(e=>e.props.id).join("|");Tn(()=>{const e=Fo?.document??null,n=Fo?.window??null;let t=0;const o=[],r=()=>{if(!e)return void _o(e=>e.length?[]:e);const n=hi.findIndex(Kt),t=n>=0?n:hi.length,o=n=>{const t=hi[n]?.props?.id;return null==t?null:Nn(e,`[data-puck-component="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(kn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=hi.length>0&&!Gt(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=yt(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})}_o(e=>function(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t].top!==n[t].top||e[t].index!==n[t].index||e[t].height!==n[t].height)return!1;return!0}(e,i)?e:i)},i=()=>{cancelAnimationFrame(t),t=requestAnimationFrame(r)};if(!e||!n)return void r();n.addEventListener("scroll",i,{passive:!0});const l=new ResizeObserver(i);return l.observe(e.documentElement),r(),o.push(setTimeout(r,150),setTimeout(r,450)),()=>{cancelAnimationFrame(t),o.forEach(clearTimeout),n.removeEventListener("scroll",i),l.disconnect()}},[Fo,el,wo,ti,mo,go,Tt?.props.id]);const nl=Fo?.document??null,tl=Fo?.window??null;Tn(()=>{const e=Eo.current;if(!e||!nl||!tl)return;const n=[],t=()=>{const n=Nn(nl,`[data-puck-component="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&tl.scrollTo({left:tl.scrollX,top:tl.scrollY+t,behavior:"instant"}),!0};return Eo.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[nl,tl]);const ol=e=>{er(R),ho.select({index:e}),ur.sectionPressed?.(hi[e]);const n=hi[e]?.props?.id;n&&l(n)},rl=e=>{const{floor:n,cap:t}=fi(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=Tt&&qo.kind!==Yt?.kind?hi.findIndex(e=>e.props.id===Tt.props.id):-1;return o(r>=0?r+1:t)},il=(e,n)=>{const{floor:t,cap:o}=fi(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(ho.reorderComponent(ze,e,i),ho.select({index:i}),{moved:!0,dest:i})},ll=(e,n,t,o)=>{er(R),ho.select(o?{index:o.index,zone:o.zone}:{index:e}),l(n),Yr(Xt.sectionAdded({name:t}))},sl=(e,n)=>{const t=rl(n),o=vr(e,{nodeDefaults:Ii,newNodeId:Be,sectionLabel:Oi,blockIsOffered:br}),r=o?ho.insertNode(ze,t,o):ho.insertSection(e,t);return ll(t,r,Oi(e),o?((e,n,t)=>{if(e.type===t)return null;const o={at:null},r=(e,n,i)=>{const l=i.filter(n=>n===e.type).length;for(const{child:s,zone:d,index:a}of Ie(Rt,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=kr(e.type,l,d.slice(d.lastIndexOf(":")+1)),i=r?.choices??(r?.spec?[{type:r.spec.childType,label:r.spec.childType}]:[]);null!==r&&"footer"!==r.source&&`${e.props.id}:${r.slot}`===d&&i.some(e=>e.type===t)&&(o.at={zone:d,index:a,depth:n})}r(s,n+1,[...i,e.type])}};return r({type:e.type,props:{...e.props,id:n}},1,[]),o.at?{zone:o.at.zone,index:o.at.index}:null})(o,r,e):null),t},dl=e=>al(ze,e),al=(e,n)=>{Ur.current=document.activeElement??null,Qo(null===n?null:{zone:e,index:n}),Go(!0),mo||(Ko.current=!0,Lt({type:"setUi",ui:{leftSideBarVisible:!0}}))},cl=()=>{Go(!1),Qo(null),Ko.current&&Lt({type:"setUi",ui:{leftSideBarVisible:!1}}),Ko.current=!1},pl=(e,n)=>Sr.rowName?n?Gt(e)?Sr.rowName(e,"section",Xt.header):Kt(e)?Sr.rowName(e,"section",Xt.footer):Wt(e.type)?Sr.rowName(e,"section",Ni(e.type)):Bi(e):Wi(e):n?Oi(e.type):Ni(e.type),ul=e=>n=>{e()},hl=(e,n,t)=>{if(Nt)return null;const o=Mi(e)[n];return o&&!Ce(Rt,o.type).delete||o&&mr(o.type,o)?null:/* @__PURE__ */st(De,{kind:"delete",label:e===ze&&o&&Ft.shared?.usedOn(o)?Xt.shared.removeFromPage:Xt.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=Mi(e)[n]?.props?.id;null!=t&&zi(String(t))})(e,n),children:/* @__PURE__ */st(tt,{size:15})})},fl=e=>Sr.rowPreview?.(e)||void 0,ml=e=>Sr.rowMarks?.(e)??void 0,gl=(e,n,t)=>Sr.rowActions?.(e,n,t)??null,yl=(e,n,t,o)=>{if(Nt)return null;if(mr(t.type,t))return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
|
|
15
|
+
return st(De,{kind:"eye",label:r?Xt.showNamed({name:o}):Xt.hideNamed({name:o}),onClick:()=>kl(e,n,t),children:/* @__PURE__ */st(r?ot:rt,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},vl=e=>Js(ze,e),kl=(e,n,t)=>{ho.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},bl=e=>Oe(Rt,e),Sl=e=>Ie(Rt,e),wl=e=>fr.slotsOf?Li(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:Pe(e,n.slot)})):[{slot:null,rung:null,kids:Sl(e)}],xl=e=>fr.slotsOf?wl(e).flatMap(e=>e.kids):Sl(e),zl=e=>Boolean(fr.slotsOf)&&Li(e).some(e=>e.rung),Cl=(e,n,t)=>null===t?void 0===n?kr(e):kr(e,n):kr(e,n,t),Nl=(e,n,t)=>{const o=$e(Rt,e.type,n)&&(t||xl(e).length>0||zl(e));return{collapsible:o,folded:o&&Hr(String(e.props.id))}},Il=(e,n,t)=>wl(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}),Ol=e=>xl(e).length>0||zl(e)||Boolean(kr(e.type)),Bl=e=>Boolean(kr(e)),Pl=(e,n,t,o)=>{if(er(R),kr(o)?.spec?.slider){const t=e.split(":")[0];s(t,n),ho.select({index:n,zone:e}),l(t)}else ho.select({index:n,zone:e}),l(t)},$l=(e,n,t,o,r)=>{const i=`${e}:${n}`;ho.insertComponent(i,t,o),kr(r)?.spec?.slider?requestAnimationFrame(()=>{s(e,o),ho.select({index:o,zone:i})}):ho.select({index:o,zone:i})},Ml=jn(/* @__PURE__ */new Set);Tn(()=>{hi.forEach(e=>{const n=kr(e.type)?.spec;if(!n)return;const t=e.props.id;if(Ml.current.has(t))return;Ml.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(Ii)).forEach((e,t)=>co.seedChild(o,t,n.childType,e))})},[hi,co,Ii]);const jl=jn(/* @__PURE__ */new Set);Tn(()=>{hi.forEach((e,t)=>{const o=e.props.id;if(jl.current.has(o))return;const r=n(e,bl(e.type));jl.current.add(o),r&&co.replaceComponent(ze,t,{...e,props:r})})},[hi,co]),K(co,Rt);const Ll=hi.findIndex(Kt),Al=Ll>=0?hi[Ll]:null,Tl=Zt?hi.findIndex(Gt):-1,El=Tl>=0?hi[Tl]:null,Rl=Ft.groupTab,Fl=Ln(()=>Rl?e=>Wt(e.type):void 0,[Rl]),Dl=Boolean(Ft.groupBadge),Hl=Ft.sharedReach,Vl=e=>Hl?.(e)??void 0,Wl=Ln(()=>Hl?new Set(hi.filter(e=>Vl(e)).map(e=>String(e.props.id))):null,[hi,Hl]),Ul=Ln(()=>Wl?e=>Wl.has(e):void 0,[Wl]),Jl=Ft.first?Hl?.({type:Ft.first,props:{id:""}})??void 0:void 0,Yl=Ft.groupBadge?/* @__PURE__ */st("span",{className:"es-tree-group-badge",children:/* @__PURE__ */st(Hn,{tone:"info",size:"xs",children:Ft.groupBadge})}):void 0,Gl=hi.find(e=>e.type===Ht)??null,Kl=hi.find(e=>e.type===Vt)??null,Zl=Ll>=0?Ll:hi.length,Ql=[];hi.forEach(e=>{Kt(e)||(Ol(e)&&Ql.push(String(e.props.id)),Ql.push(...Il(e,1,Bl)))}),Al&&(Ql.push(String(Al.props.id)),Ql.push(...Il(Al,1,Bl)));const Xl=Ql.length>0&&Ql.every(e=>Lr.has(e)),_l=e=>{const n=Sr.blockRowName(e,Ni);return Sr.rowName?Sr.rowName(e,"block",n):n},ql=(e,n,t,o)=>{const r=Mi(e)[t];if(!r)return;const i={...Pn(e),index:t},l={...Pn(n),index:Math.min(Math.max(o,0),Mi(n).length)},s=gn(i,l);if(e!==n||s!==t)try{ki.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof Mn))throw e}},es=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of Sl(e))n.add(r),t(o)};for(const t of bl(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},ns=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Pi.get(n);if(!e)return null;if(e.zone===ze)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},ts=e=>{const n=e.slice(0,e.indexOf(":")),t=hi.find(e=>Wt(e.type)&&String(e.props.id)===n);return t&&Ut(n)===e?t:null},os=(e,n)=>{const t=ts(e);return!t||(!Ft.groupAccepts||Ft.groupAccepts(t.type,n,Mi(e).length))},rs=(e,n,t)=>{if(e.rung){const t=ji(e.rung.nodeId),o=t?Li(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===vt&&n.index>=0&&n.index<=o}if(n.slot===vt)return!1;if(e.add)return ds(e.add,n);const o=Bn(n);if(Wt(e.type))return!1;const r=ts(o),i=ts(e.zone);if(r||i)return!(!r||!i)&&(!(r!==i&&!os(o,e.type))&&(n.index>=0&&n.index<=Mi(o).length));if(e.zone===ze||o===ze){if(e.zone!==o)return!1;const{floor:t,cap:r}=fi();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&&!Ft.lastIsOpen?String(Al.props.id):null;return(!l||ns(e.zone)!==l&&ns(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=Pi.get(i),s=l?Mi(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&es(r).has(n))return!1;const d=kr(s.type,yr(jt?.data,s.type,i),n.slice(n.lastIndexOf(":")+1));return!!d&&(!!(d.choices?d.choices.some(e=>e.type===r.type):d.spec?.childType===r.type)&&!d.spec?.addBlocked?.(Mi(n),r))})(e.zone,o,e.index,t)},is=(e,n)=>{const t=Bn(e.from),o=e.node;return t===Bn(n)?os(t,o.type):rs({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},ls=e=>{const n=e.slice(0,e.indexOf(":")),t=Pi.get(n),o=t?Mi(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=kr(o.type,yr(jt?.data,o.type,n),e.slice(e.lastIndexOf(":")+1));if(!r||`${n}:${r.slot}`!==e)return null;if("footer"===r.source)return null;const i=O(r.choices??(r.spec?[{type:r.spec.childType,label:Ni(r.spec.childType)}]:[])),l=Ai(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:pl(o,t.zone===ze)}},ss=(e,n)=>{if("section"!==e.kind)return e;const t=Bn(n);return t===ze||ts(t)?e:ls(t)?.choices.some(n=>n.type===e.type)?{kind:"block",type:e.type}:e},ds=(e,n)=>{const t=ss(e,n),o=Bn(n);if("shared"===t.kind){if(o!==ze||!Ft.shared?.nodeOf(t.section))return!1;const{floor:e,cap:r}=fi();return n.index>=e&&n.index<=r}if("block"!==t.kind){if(ts(o)){const e="section"===t.kind?t.type:t.template.node.type;return os(o,e)&&n.index>=0&&n.index<=Mi(o).length}if(o!==ze)return!1;const{floor:e,cap:r}=fi();return n.index>=e&&n.index<=r}if(o===ze)return!1;const r=ls(o);return!(!r||!r.choices.some(e=>e.type===t.type))&&!r.target.spec?.addBlocked?.(Mi(o))},as=(e,n)=>{const t=ss(e,n);if("block"!==t.kind&&ts(Bn(n)))return void((e,n,t)=>{const o="section"===e.kind?e.type:"template"===e.kind?e.template.node.type:null;if(o&&os(n,o)){if("section"===e.kind)ho.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;ho.insertNode(n,t,yi(e.template.node))}er(R),ho.select({index:t,zone:n})}})(t,Bn(n),n.index);if("section"===t.kind)return void sl(t.type,n.index);if("template"===t.kind)return void((e,n,t)=>{const o=rl(t),r=ho.insertNode(ze,o,n);ll(o,r,e)})(t.template.name,yi(t.template.node),n.index);if("shared"===t.kind){const e=Ft.shared?.nodeOf(t.section);if(!e)return;const o=rl(n.index);return void(ki.restore(e,{parentId:In,slot:On,index:o})&&ll(o,e.props.id,t.section.title))}const o=Bn(n),r=ls(o);r&&(r.target.spec?$l(r.parentId,r.target.slot,t.type,n.index,r.parent.type):((e,n,t)=>{ho.insertComponent(e,n,t),er(R),ho.select({index:t,zone:e})})(o,t.type,n.index))},cs=(e,n)=>{e.media?function(e){const n=Ds();if(!n||!Es)return;Vs(n).then(n=>{n&&function(e,n){if(!Es)return;const t=Es.create(e,{nodeDefaults:Ii,newNodeId:Be,sectionLabel:Oi,blockIsOffered:br}),o=Bn(n);if(o===ze){const e=rl(n.index),o=ho.insertNode(ze,e,t);return void ll(e,o,Oi(t.type))}ho.insertNode(o,n.index,t),er(R),ho.select({index:n.index,zone:o})}(n,e)})}(n):e.rung?Di(e.rung.nodeId,e.index,n.index):e.add?as(e.add,n):e.zone===ze?il(e.index,n.index):ql(e.zone,Bn(n),e.index,n.index)},[ps]=An(()=>fn()),us=mn({keyOf:e=>e.id,readOnly:Boolean(Nt),session:ps,canDrop:rs,onDrop:cs,onStep:(e,n)=>{e.rung?Di(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===ze?((e,n)=>{const t=Oi(hi[e]?.type??""),o=il(e,n<0?e-1:e+2);if(!o.moved)return void Yr(n<0?Xt.sectionFirst({name:t}):Xt.sectionLast({name:t}));const{floor:r,cap:i}=fi();Yr(Xt.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):ql(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),hs=En(e=>{const{floor:n,cap:t}=fi(),o=[];for(const r of e.nodes){const e=Bn(r.place),i=Mi(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(Gt(i)||Kt(i)||mr(i.type,i))continue;if(Wt(i.type))continue;const l=Boolean(ts(e)),s=e===ze||l;e===ze&&t-n<2||o.push({key:r.id,item:{id:r.id,zone:e,index:r.place.index,type:i.type},box:r.box,label:s?Oi(i.type):Wi(i),from:r.place})}const r=e.zones.flatMap(e=>{const n=Bn(e.list);if(n===ze&&0===e.children.length)return[{...e,addLabel:Xt.addSection,addAlways:!0}];const t=ls(n),o=t?.target.spec?.addLabel;return e.children.length>0||Boolean(t?.choices.length)||Boolean(ts(n))?[o?{...e,addLabel:o}:e]:[]}),i=r.flatMap(e=>{const n=Bn(e.list),t=n===ze||ts(n)?null:ls(n);return t?.choices.length?cn(e,t.target.spec?.addLabel??Xt.addBlockHere):[]});return{sources:o,zones:r,seams:i}},[jt.data]),fs=null==Tt?.props.id?null:String(Tt.props.id),ms=En(e=>{const n=Rt,t=e=>!e.item.rung&&null!==$n(jt.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(fs);return i||(r(Ye(jt.data,n,o.item.id,fs,Fl))??o)},[jt.data,Rt,fs,Fl]),[gs,ys]=An(null),vs=Boolean(Rl||Hl);Sn(Fo,"mouseover",e=>{if(!vs)return;const n=wn(e.target),t=n?ht(jt.data,Rt,n):null;t!==gs&&ys(t)}),Sn(Fo,"mouseout",e=>{vs&&!e.relatedTarget&&ys(null)});const ks=e=>Gt(e)||Kt(e)||Wt(e.type),bs=e=>{const n=Wt(e.type)?Ni(e.type):Gt(e)?Xt.header:Kt(e)?Xt.footer:null;return null===n?Bi(e):Sr.rowName?Sr.rowName(e,"section",n):n},Ss=[];if(vs){const e=fs?ht(jt.data,Rt,fs):null;for(const n of/* @__PURE__ */new Set([e,gs])){const e=n?hi.find(e=>String(e.props.id)===n):void 0;if(!e)continue;const t=Gt(e)||e.type===Ht,o=Vl(e);if(o){Ss.push({id:String(e.props.id),label:bs(e),below:t,reach:o});continue}if(!Rl||!ks(e))continue;const r=Rl(e);r&&Ss.push({id:String(e.props.id),label:r,below:t})}}const ws=pe(),xs=jn(null);Tn(()=>{const e=Ft.changeNotice;if(!e)return;const n=JSON.stringify(hi.filter(ks)),t=xs.current;if(xs.current={doc:Dn,bands:n,index:At.index},!t||t.doc!==Dn||t.bands===n)return;At.hasPast&&At.index>=t.index&&!ut.has(ws)&&(ut.add(ws),Yr(e,"success",{action:{label:Xt.bar.undo,onClick:()=>At.back()},duration:8e3}))},[hi]);const zs=e=>{er(R),ho.select(e.zone===ze?{index:e.index}:{index:e.index,zone:e.zone})},Cs=Z(),Ns=()=>({data:jt.data,device:wo,ops:ho,inspector:pr}),Is=Cs?.model,Os=Ln(()=>Is?e=>Is(e,hs(e),Ns()):hs,[Is,hs,wo]),Bs=Cs?.measure,Ps=Bs?(e,n)=>Bs(e,n,Ns()):void 0,$s=Cs?.canDrop,Ms=$s?(e,n)=>$s(e,n,rs,Ns()):rs,js=Cs?.drop,Ls=js?(e,n)=>js(e,n,cs,Ns()):cs,As=Cs?.pick,Ts=As?e=>As(e,zs,Ns()):zs,Es=Cs?.media??null,Rs=jn(null),Fs=Ln(()=>Es?{id:ct,zone:"",index:-1,type:Es.adds.type,add:{kind:Es.adds.kind,type:Es.adds.type},media:!0}:null,[Es]);Tn(()=>{if(!Fs||Nt||"undefined"==typeof document)return;const e=e=>{(e=>Array.from(e.dataTransfer?.types??[]).includes(Xn))(e)&&(Rs.current=null,ps.start({key:ct,item:Fs}))},n=e=>{ps.get()?.item.media&&(Rs.current=Un(e.dataTransfer))},t=()=>{ps.get()?.item.media&&ps.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)}},[Fs,Nt,ps]);const Ds=()=>{const e=Rs.current;return Rs.current=null,e},Hs=ce(),Vs=async e=>{if(!Hs)return e;const n=await Hs(e);return n?{...e,id:n.id,url:n.url}:null};const Ws=(e,n)=>{if(!Es)return;const t=$n(uo.getState().appState.data,mi,n);if(!t)return;const o=t.node;ho.replaceComponent(Bn(t.place),t.place.index,{...o,props:{...Es.replace(o,e),id:o.props.id}})},Us=e=>{const n=Bn(e),t=Ai(n);t&&Ri(t.node,t.slot,!1),al(n,e.index)},Js=(e,n)=>/* @__PURE__ */st(He,{...Nt?{}:us.seam({place:{...Pn(e),index:n}})},`seam:${e}:${n}`),Ys={rowClick:ul,isCollapsed:Hr,toggleCollapse:Vr},Gs=e=>{const n=String(e.props.id),t=hi.findIndex(e=>String(e.props.id)===n),o=Ut(n),r=Mi(o),i=Hr(n),l=Ni(e.type),s=Sr.rowName?Sr.rowName(e,"section",l):l,d=e=>Js(o,e);/* @__PURE__ */
|
|
16
|
+
return dt(at,{children:[
|
|
17
|
+
/* @__PURE__ */st(Te,{words:_t,icon:/* @__PURE__ */st(xr,{type:e.type,size:13}),name:s,preview:fl(e),marks:ml(e),onSelect:()=>ol(t),nameSlot:Ji(ze,t,n,s),selected:tr===n,badge:Vl(e)?void 0:Yl,shared:Vl(e),actions:gl(e,ze,t)??void 0,rowProps:{"data-node-id":n,onClick:ul(()=>ol(t))},fold:{open:!i,label:"section",onToggle:()=>Vr(n)}}),!i&&/* @__PURE__ */dt(Ee,{children:[r.map((n,t)=>{const r=String(n.props.id),i=Bi(n),l=Ol(n),s=l&&Hr(r),a=()=>Pl(o,t,r,e.type),{rowProps:c,...p}=us.row({item:{id:r,zone:o,index:t,type:n.type},place:{...Pn(o),index:t}},{"data-node-id":r,onClick:ul(a)});/* @__PURE__ */
|
|
18
|
+
return dt(Fn,{children:[d(t),
|
|
19
|
+
/* @__PURE__ */st(Te,{words:_t,icon:/* @__PURE__ */st(xr,{type:n.type,size:13}),name:i,preview:fl(n),marks:ml(n),onSelect:a,nameSlot:Ji(o,t,r,i),selected:tr===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Vr(r)}:void 0,actions:/* @__PURE__ */dt(at,{children:[hl(o,t,i),gl(n,o,t),yl(o,t,n,i)]}),rowProps:c}),l&&!s&&/* @__PURE__ */st(Ee,{children:Qs(n,2)})]},r)}),d(r.length)]})]})},Ks=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=us.dragging,d=!Hr(l)&&s?.rung?.nodeId!==i,a={...Pn(l),index:0},c=s&&!s.rung&&rs(s,a)?a:void 0,p=()=>Ri(e,n,!0),{rowProps:u,...h}=us.row({item:{id:`rung:${l}`,zone:`${i}:${vt}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:vt,index:t},into:c,canDrag:Boolean(fr.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:ul(p)}),f=Nt?null:fr.slotActions?.(e,n.slot);/* @__PURE__ */
|
|
20
|
+
return dt(Fn,{children:[n.heading,
|
|
21
|
+
/* @__PURE__ */st(Te,{words:_t,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:Ti===l,...h,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>Vr(l)},actions:f&&f.length>0?/* @__PURE__ */st(at,{children:f.map((t,o)=>/* @__PURE__ */st(De,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(Nt||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&Fi(o,e,n.panel)},i=t.run();i&&"function"==typeof i.then?i.then(r):r(i)})(e,n,t),children:"delete"===t.kind?/* @__PURE__ */st(tt,{size:15}):/* @__PURE__ */st(lt,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */st(Ee,{children:r})]},l)},Zs=(e,n)=>{const t=wl(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
|
|
22
|
+
return st(at,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=Cl(e.type,void 0,t.slot),d=s?`${e.props.id}:${s.slot}`:null,a=null===t.slot?null:`${e.props.id}:${t.slot}`,c=(e,n)=>Js(e,n),p=/* @__PURE__ */dt(at,{children:[i.map(({child:n,zone:t,index:o})=>{const r=tr===String(n.props.id),{collapsible:i,folded:s}=Nl(n,l,Bl(n.type)),d=String(n.props.id),a=_l(n),p=()=>Pl(t,o,d,e.type),{rowProps:u,...h}=us.row({item:{id:d,zone:t,index:o,type:n.type},place:{...Pn(t),index:o}},{"data-node-id":d,onClick:ul(p)});/* @__PURE__ */
|
|
23
|
+
return dt(Fn,{children:[0===o&&c(t,0),
|
|
24
|
+
/* @__PURE__ */st(Te,{words:_t,icon:/* @__PURE__ */st(xr,{type:n.type,size:13}),name:a,preview:fl(n),marks:ml(n),onSelect:p,nameSlot:Ji(t,o,d,a),selected:r,hidden:Boolean(n.props._hidden),...h,fold:i?{open:!s,label:"group",onToggle:()=>Vr(d)}:void 0,actions:/* @__PURE__ */dt(at,{children:[hl(t,o,a),gl(n,t,o),yl(t,o,n,a)]}),rowProps:u}),i&&!s&&/* @__PURE__ */st(Ee,{children:Zs(n,l+1)}),c(t,o+1)]},String(n.props.id??`${t}-${o}`))}),null===a?d&&!i.some(e=>e.zone===d)?c(d,0):null:0!==i.length||!t.rung&&d!==a?null:c(a,0)]});return t.rung?Ks(e,t.rung,r++,o,p):/* @__PURE__ */st(Fn,{children:p},t.slot??"")})})},Qs=(e,n)=>{const t=yr(jt?.data,e.type,String(e.props.id)),o=wl(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
|
|
25
|
+
return st(at,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=Cl(e.type,t,o.slot),a=d?.spec??null,c=a&&Array.isArray(e.props[a.slot])?e.props[a.slot]:[],p=d&&d.choices?{slot:d.slot,choices:d.choices}:null,u=String(e.props.id),h=a&&!a.fixed?`${u}:${a.slot}`:null,f=p?`${u}:${p.slot}`:null,m=(e,n)=>Js(e,n),g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(a&&!a.fixed&&(null===g||g===h)),v=/* @__PURE__ */dt(at,{children:[l.map(({child:n,zone:t,index:o})=>{const r=tr===String(n.props.id),i=Wi(n),l=String(n.props.id),{collapsible:d,folded:a}=Nl(n,s,Bl(n.type)),c=bl(n.type),p=1===c.length?`${l}:${c[0]}`:null,u=p?{...Pn(p),index:Mi(p).length}:void 0,h=us.dragging,f=u&&h&&rs(h,u)?u:void 0,g=()=>Pl(t,o,l,e.type),{rowProps:y,...v}=us.row({item:{id:l,zone:t,index:o,type:n.type},place:{...Pn(t),index:o},into:f,canDrag:!mr(n.type,n)},{"data-node-id":l,onClick:ul(g)});/* @__PURE__ */
|
|
26
|
+
return dt(Fn,{children:[0===o&&m(t,0),
|
|
27
|
+
/* @__PURE__ */st(Te,{words:_t,icon:/* @__PURE__ */st(xr,{type:n.type,size:13}),name:i,preview:fl(n),marks:ml(n),onSelect:g,nameSlot:Ji(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...v,fold:d?{open:!a,label:"group",onToggle:()=>Vr(l)}:void 0,actions:mr(n.type,n)?gl(n,t,o)??void 0:/* @__PURE__ */dt(at,{children:[hl(t,o,i),gl(n,t,o),yl(t,o,n,i)]}),rowProps:y}),d&&!a&&/* @__PURE__ */st(Ee,{children:Qs(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&a&&
|
|
28
|
+
/* @__PURE__ */st(w,{small:!0,label:a.addLabel,blocked:a.addBlocked?.(c)??null,onAdd:()=>$l(e.props.id,a.slot,a.childType,c.length,e.type)}),null===g?f&&!l.some(e=>e.zone===f)?m(f,0):null:0!==l.length||(o.rung?y:g!==f)?null:m(g,0)]});return o.rung?Ks(e,o.rung,i++,r,v):/* @__PURE__ */st(Fn,{children:v},o.slot??"")})})},Xs=Yo,_s=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:mo&&!Xs&&hr===e.id,onSelect:()=>ai(e.id)}:e,qs=[...(ur.railLead??[]).map(_s),{id:"sections",label:Xt.layers,icon:/* @__PURE__ */st(fe,{}),active:mo&&!Xs&&"sections"===hr,onSelect:()=>ai("sections")},...(ur.railTrail??[]).map(_s)];Co?qs.push({id:"media",label:Xt.railMedia,icon:/* @__PURE__ */st(me,{}),active:Oo,onSelect:Bo}):Pt&&qs.push({id:"media",label:Xt.railMedia,icon:/* @__PURE__ */st(me,{}),onSelect:ci});const ed={value:qs.find(e=>!0===e.active)?.id??"",press:e=>{const n=qs.find(n=>n.id===e);n&&!n.disabled&&!0!==n.active&&n.onSelect?.()},items:qs.map(e=>({id:e.id,icon:e.icon,label:/* @__PURE__ */st("span",{className:"sr-only",children:e.label}),tooltip:e.label,disabled:e.disabled}))},nd=[...ur.railLead??[],...ur.railTrail??[]].find(e=>"panel"in e&&e.id===hr),td=Boolean(Qt?.foldable),od=Qt?.label??($t?Xt.pageSections:Xt.templateSections),rd=td&&Hr(kt),id=/* @__PURE__ */dt(at,{children:[hi.map((e,n)=>{if(Gt(e)||Kt(e)||Wt(e.type))return null;const t=tr===String(e.props.id),o=Boolean(e.props._hidden);Sl(e);const r=String(e.props.id),i=ur.hasOwnRows?.(e)??!1,l=Ol(e)||i,s=l&&Hr(r),d=bl(e.type),a=1===d.length?`${r}:${d[0]}`:null,c=a?{...Pn(a),index:Mi(a).length}:void 0,p=us.dragging,u=c&&p&&rs(p,c)?c:void 0,{rowProps:h,...f}=us.row({item:{id:r,zone:ze,index:n,type:e.type},place:{...Pn(ze),index:n},into:u,canDrag:!mr(e.type,e)},{"data-node-id":r,onClick:ul(()=>ol(n))});/* @__PURE__ */
|
|
29
|
+
return dt(Fn,{children:[n>0&&vl(n),
|
|
30
|
+
/* @__PURE__ */st(Te,{words:_t,icon:/* @__PURE__ */st(xr,{type:e.type,size:13}),name:Bi(e),preview:fl(e),marks:ml(e),shared:Vl(e),onSelect:()=>ol(n),nameSlot:Ji(ze,n,r,Bi(e)),selected:t,hidden:o,...f,fold:l?{open:!s,label:"section",onToggle:()=>Vr(r)}:void 0,actions:/* @__PURE__ */dt(at,{children:[hl(ze,n,Bi(e)),gl(e,ze,n),yl(ze,n,e,Bi(e))]}),rowProps:h}),Ol(e)&&!s&&/* @__PURE__ */dt(Ee,{children:[Qs(e,1),ur.partRows?.(e,Ys)]}),i&&!s&&/* @__PURE__ */st(Ee,{children:ur.ownRows?.(e,n,Ys)})]},String(e.props.id??n))}),Zl>0&&vl(Zl)]}),ld=(e,n,t)=>{const o=String(e.props.id),r=xl(e).length>0||zl(e)||Boolean(kr(e.type)),i=r&&Hr(o),l="header"===t?Xt.header:Xt.footer,s=Sr.rowName?Sr.rowName(e,"section",l):l;/* @__PURE__ */
|
|
31
|
+
return dt(at,{children:[
|
|
32
|
+
/* @__PURE__ */st(Te,{words:_t,icon:/* @__PURE__ */st(xr,{type:t,size:13}),name:s,preview:fl(e),marks:ml(e),badge:Vl(e)?void 0:Yl,shared:Vl(e),onSelect:()=>ol(n),nameSlot:Ji(ze,n,o,s),selected:tr===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Vr(o)}:void 0,actions:gl(e,ze,n)??void 0,rowProps:{"data-node-id":o,onClick:ul(()=>ol(n))}}),r&&!i&&/* @__PURE__ */st(Ee,{children:Zs(e,1)})]})};return(ur.wrap??(e=>e))(
|
|
33
|
+
/* @__PURE__ */st(Q,{target:Fo,children:/* @__PURE__ */dt("div",{ref:Ro,className:"sf-editor es-editor",style:tn(Tr),onContextMenu:Xi.onEditorContextMenu,...u(vn),children:[
|
|
34
|
+
/* @__PURE__ */dt(Ge,{children:[
|
|
35
|
+
/* @__PURE__ */st("div",{className:"es-cluster es-cluster--left","aria-hidden":"true"}),
|
|
36
|
+
/* @__PURE__ */dt(Ke,{children:[
|
|
37
|
+
/* @__PURE__ */st(Ze,{label:Xt.bar.undo,disabled:Boolean(Nt)||!At.hasPast,onClick:()=>At.back(),children:/* @__PURE__ */st(_n,{})}),
|
|
38
|
+
/* @__PURE__ */st(Ze,{label:Xt.bar.redo,disabled:Boolean(Nt)||!At.hasFuture,onClick:()=>At.forward(),children:/* @__PURE__ */st(qn,{})}),
|
|
39
|
+
/* @__PURE__ */st(Qe,{}),
|
|
40
|
+
/* @__PURE__ */st(Xe,{devices:yo,value:wo,onChange:xo}),
|
|
41
|
+
/* @__PURE__ */st(Ze,{label:Xt.bar.refresh,tip:Xt.bar.refreshTip,onClick:()=>{Eo.current=(()=>{const e=Fo?.document;if(!e)return null;const n=hi.findIndex(Kt),t=n>=0?n:hi.length;let o=null;for(let n=0;n<t;n++){const t=hi[n]?.props?.id;if(null==t)continue;const r=Nn(e,`[data-puck-component="${CSS.escape(String(t))}"]`);if(!r)continue;const i=r.getBoundingClientRect().top;i<=4&&(null===o||i>o.offset)&&(o={id:String(t),offset:i})}if(!o){const e=Tt?.props?.id??hi[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),To(e=>e+1)},children:/* @__PURE__ */st(et,{})})]}),
|
|
42
|
+
/* @__PURE__ */dt(Ke,{kind:"right",style:{minWidth:300},children:[xn?/* @__PURE__ */st(xn,{}):null,
|
|
43
|
+
/* @__PURE__ */st(k,{input:Uo,words:Xt.saveStatus}),ur.barLead?.(),ur.barTrail?.(),ur.mainAction||!ur.barMain?/* @__PURE__ */st(b,{input:Uo,action:ur.mainAction??{label:Xt.done,onPress:()=>{Kn(jt.data)}},readOnly:Boolean(Nt),saveSwitch:Ot,onToggleAutoSave:wt,onSaveNow:Jo,bar:Xt.bar,words:Xt.saveStatus}):ur.barMain()]})]}),
|
|
44
|
+
/* @__PURE__ */st(oe,{}),
|
|
45
|
+
/* @__PURE__ */dt("div",{className:"sf-body",children:[mo?/* @__PURE__ */dt(at,{children:[
|
|
46
|
+
/* @__PURE__ */dt("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":Xt.leftPanel,children:[
|
|
47
|
+
/* @__PURE__ */st("div",{className:"es-paneltabs",children:/* @__PURE__ */st(Vn,{variant:"underline",block:!0,"aria-label":Xt.bar.views,value:ed.value,onChange:ed.press,items:ed.items})}),Yo?/* @__PURE__ */st(x,{at:Zo?{label:(e=>{const n=ts(e.zone);if(n)return Xt.add.addingTo({name:Sr.rowName?pl(n,!0):Ni(n.type)});if(e.zone===ze){const n=hi[e.index];return n&&!Kt(n)?Xt.add.addingBefore({name:pl(n,!0)}):Xt.add.addingAtEnd}const t=ls(e.zone);return t?Xt.add.addingTo({name:t.parentName}):Xt.add.addingHere})(Zo),onClear:()=>Qo(null)}:void 0,placeBlocks:Zo&&Zo.zone!==ze?ls(Zo.zone)?.choices:void 0,canTake:Zo?e=>{if(!Zo)return null;const n={...Pn(Zo.zone),index:Zo.index};if(ds(e,n))return null;if("shared"===e.kind&&Zo.zone===ze&&!Ft.shared?.nodeOf(e.section))return Xt.shared.alreadyHere;const t=ts(Zo.zone);if(t)return Xt.add.notInside({name:pl(t,!0)});if(Zo.zone===ze)return Xt.add.onlySections;const o=ls(Zo.zone);return o?Xt.add.notInside({name:o.parentName}):Xt.add.onlySections}:void 0,onPick:Zo?e=>{if(!Zo)return;const n={...Pn(Zo.zone),index:Zo.index};ds(e,n)&&(as(e,n),cl())}:void 0,itemFor:e=>({id:`new:${e.kind}:${"template"===e.kind?e.template.id:"shared"===e.kind?e.section.id:e.type}`,zone:"",index:-1,type:"template"===e.kind?e.template.node.type:"shared"===e.kind?e.section.node.type:e.type,add:e}),session:ps,siteWide:ur.addPanelRow?.(cl),onClose:cl,onHide:si,readOnly:Boolean(Nt)}):nd?nd.panel({onHide:si,notify:Yr}):/* @__PURE__ */dt(at,{children:[
|
|
48
|
+
/* @__PURE__ */st(N,{icon:/* @__PURE__ */st(fe,{}),title:Xt.layers,context:io,actions:/* @__PURE__ */dt(at,{children:[!Nt&&/* @__PURE__ */st(_e,{label:Xt.add.title,onClick:()=>dl(null),children:/* @__PURE__ */st(nt,{size:15})}),
|
|
49
|
+
/* @__PURE__ */st(_e,{label:Xl?Xt.expandAll:Xt.collapseAll,title:0===Ql.length?Xt.nothingToFold:void 0,disabled:0===Ql.length,onClick:()=>Ar(e=>{const n=new Set(Ql);return Xl?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...Ql])}),children:/* @__PURE__ */st(mt,{expand:Xl})})]}),onHide:si}),
|
|
50
|
+
/* @__PURE__ */dt(Re,{className:"sf-tree sf-scroll",words:_t,children:[
|
|
51
|
+
/* @__PURE__ */st(Te,{words:_t,icon:/* @__PURE__ */st(xr,{type:"page",size:13}),name:Xt.pageSettings,onSelect:pi,selected:!Tt&&nr,rowProps:{onClick:ul(pi)}}),Gl&&/* @__PURE__ */dt(at,{children:[!Dl&&/* @__PURE__ */st(Fe,{children:Xt.header}),Gs(Gl)]}),Mt&&!(Dl&&Gl)&&/* @__PURE__ */dt(at,{children:[!Dl&&/* @__PURE__ */st(Fe,{children:Xt.header}),!Zt&&/* @__PURE__ */st(Te,{words:_t,icon:/* @__PURE__ */st(xr,{type:"header",size:13}),name:Xt.header,badge:Jl?void 0:Yl,shared:Jl,onSelect:ui,selected:qo.kind===Yt?.kind,rowProps:{onClick:ul(ui)}})]}),El&&!(Dl&&Gl)&&ld(El,Tl,"header"),!td&&/* @__PURE__ */st(Fe,{children:od}),td?/* @__PURE__ */dt(at,{children:[
|
|
52
|
+
/* @__PURE__ */st(Te,{words:_t,icon:null,name:od,fold:{open:!rd,label:od,onToggle:()=>Vr(kt)}}),!rd&&/* @__PURE__ */st(Ee,{children:id})]}):id,Mt&&!Dl&&/* @__PURE__ */st(Fe,{children:Xt.footer}),Al&&!(Dl&&Kl)&&ld(Al,Ll,"footer"),Kl&&Gs(Kl),ur.treeFoot?.()]})]})]}),
|
|
53
|
+
/* @__PURE__ */st(qe,{side:"left",width:Tr.left,min:nn.left,max:en,defaultWidth:m.left,label:Xt.resizeLeftPanel,onResize:Fr})]}):/* @__PURE__ */st(I,{side:"left",onShow:si}),
|
|
54
|
+
/* @__PURE__ */dt("div",{ref:Gr,className:"sf-center sf-scroll","data-sf-canvas-head":_r?"":void 0,style:{overflowX:ri?"auto":"hidden",overflowY:"hidden"},children:[_r&&/* @__PURE__ */st("div",{ref:qr,className:"sf-canvas-head",children:/* @__PURE__ */st(_r,{device:wo})}),
|
|
55
|
+
/* @__PURE__ */dt("div",{className:"sf-frame-scaler",style:ii,children:[
|
|
56
|
+
/* @__PURE__ */st("div",{className:"sf-frame "+(wo===bo?"":`sf-frame--${wo}`),style:li,children:/* @__PURE__ */dt("div",{className:"sf-preview-host",children:[
|
|
57
|
+
/* @__PURE__ */st(Le.Provider,{value:Fl,children:/* @__PURE__ */st(Ae.Provider,{value:Ul,children:/* @__PURE__ */st(lo,{},Ao)})}),
|
|
58
|
+
/* @__PURE__ */st(pn,{canvas:Fo,session:ps,model:Os,measure:Ps,canDrop:Ms,onDrop:Ls,choose:ms,onPick:Ts,dropOn:Es?{accepts:(e,n)=>{if(!e.media||!Es||n.item.rung)return!1;const t=$n(jt.data,mi,n.item.id);return null!==t&&Es.takes(t.node)},onDrop:(e,n)=>(e=>{const n=Ds();n&&Es&&Vs(n).then(n=>{n&&Ws(n,e.item.id)})})(n),label:()=>Xt.canvasReplaceImage}:void 0,onZoneAdd:Us,onSeamAdd:Us,zoneAddLabel:Xt.canvasAddBlock,words:qt.canvas,readOnly:Boolean(Nt),revision:jt.data}),Xo.length>0&&!Do&&/* @__PURE__ */st("div",{className:"sf-preview-gaps",children:Xo.map(e=>
|
|
59
|
+
/* @__PURE__ */st(un,{index:e.index,label:Xt.addSectionHere,onInsert:()=>dl(e.index),className:void 0===e.height?"sf-preview-gap":"sf-preview-gap sf-preview-gap--tight",style:void 0===e.height?{top:e.top}:{top:e.top,height:e.height}},e.index))})]})}),vs?/* @__PURE__ */st(ft,{canvas:Fo,tabs:Ss,onSelect:e=>{const n=hi.findIndex(n=>String(n.props.id)===e);n>=0&&ol(n)}}):null]})]}),go?/* @__PURE__ */dt(at,{children:[zn?
|
|
60
|
+
/* @__PURE__ */st("div",{className:"es-sidepanel es-sidepanel--right","data-es-host-panel":"",children:zn}):/* @__PURE__ */st(at,{children:/* @__PURE__ */st(h,{value:{selectChild:Pl,addChild:$l,childRowName:Wi,blockRowName:_l},children:/* @__PURE__ */st(so,{mode:qo,onOpenWebsiteSettings:ur.openSettings??(()=>{}),onOpenSiteStyles:ur.openStyles,onSelectNode:Ir,onNotify:Yr,onHidePanel:di,nodeActions:Tt?Ce(Rt,Tt.type):bt})})}),
|
|
61
|
+
/* @__PURE__ */st(qe,{side:"right",width:Tr.right,min:nn.right,max:en,defaultWidth:m.right,label:Xt.resizeSettingsPanel,onResize:Dr})]}):
|
|
62
|
+
/* @__PURE__ */st(I,{side:"right",onShow:di})]}),Xi.menu,
|
|
63
|
+
/* @__PURE__ */st(ee,{}),Si?/* @__PURE__ */st(pt,{name:Si.name,onMake:e=>(async(e,n)=>{const t=hi.find(n=>String(n.props.id)===e),o=Ft.shared;if(!t||!o)return;let r;try{r=await C(bi).create(n,t)}catch{return void Yr(Xt.shared.makeFailed,"error")}o.adopt(t,r),wi(null)})(Si.id,e),onCancel:()=>wi(null)}):null]})}))}export{wt as ScreenChrome};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{applyEaselChromeTheme as e}from"./chunk-LOMEH6DG.js";import{useEaselSession as t}from"./chunk-O7Q4DDJT.js";import{currentEaselSession as n,setSessionBridgedSite as r}from"./chunk-RSCMJIWS.js";import{useEaselHost as o}from"./chunk-
|
|
1
|
+
import{applyEaselChromeTheme as e}from"./chunk-LOMEH6DG.js";import{useEaselSession as t}from"./chunk-O7Q4DDJT.js";import{currentEaselSession as n,setSessionBridgedSite as r}from"./chunk-RSCMJIWS.js";import{useEaselHost as o}from"./chunk-MQA7OFRA.js";import{useState as s,useRef as a,useEffect as c}from"react";var u={canCreatePlatformTemplate:!1};function i(t,o={}){const s=o.session??n();s.auth.token=t.token,s.auth.brandId=t.brandId??null,r(s,t.siteId),(o.stampChromeTheme??!0)&&e(t.theme)}function m(e){const[n,r]=s(null),m=a(null),[l,f]=s(u),d=a(e?.onAuth),k=a(e?.onMessage);c(()=>{d.current=e?.onAuth,k.current=e?.onMessage});const p=o(),h=t();return c(()=>{const e=p.subscribe(e=>{const t=e;if("storefront-editor:auth"===t.type&&"string"==typeof t.token&&t.token){const e=!!m.current;m.current=t.token,r(t.token),i({...t,token:t.token},{stampChromeTheme:p.ownsDocument,session:h}),f((n=t.can)&&"object"==typeof n?{canCreatePlatformTemplate:!0===n.canCreatePlatformTemplate}:u),d.current?.(e)}else k.current?.(e);var n});if(p.send("storefront-editor:ready"),!h.usesBridgedToken)return e;const t=window.setInterval(()=>{m.current?window.clearInterval(t):p.send("storefront-editor:ready")},500);return()=>{e(),window.clearInterval(t)}},[p,h]),{token:n,tokenRef:m,capabilities:l}}export{u as NO_BRIDGED_CAPABILITIES,i as applyAuthGrant,m as useAdminBridge};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useScreenDocument as n}from"./chunk-
|
|
1
|
+
import{useScreenDocument as n}from"./chunk-276MBG5P.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-23DYNW6S.js";import{EditNotice as r}from"./chunk-ZG6PVMC3.js";import{useWords as e}from"./chunk-MFIRYGHW.js";import{jsx as i}from"react/jsx-runtime";function t(){const{capabilities:t,access:c,takeOverEditing:a,viewReadOnly:s,saveConflict:m,reloadFromServer:u}=n(),{noun:l}=e("screen",o);return t.hasEditGuard?/* @__PURE__ */i(r,{access:c,conflict:m,noun:l,onTakeOver:a,onViewReadOnly:s,onReload:u}):null}export{t as PageEditGuardNotices};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mediaPickStoreFor as e}from"./chunk-
|
|
1
|
+
import{mediaPickStoreFor as e}from"./chunk-FHCKFOCD.js";var t=/* @__PURE__ */new Map,n=0;function o(o,i){if(!o.connected)return Promise.resolve(null);const r=(n+=1,`mp-${"undefined"!=typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():String(n)}`),c=e(o);return c?c.request({requestId:r,accept:i.accept,title:i.title,file:i.file??null,...i.options?{options:i.options}:{}}):new Promise(e=>{t.set(r,e),o.send("storefront-editor:open-media-picker",{requestId:r,accept:i.accept,title:i.title,...i.file?{file:i.file}:{}})})}function i(e,n){const o=t.get(e);o&&(t.delete(e),o(n))}export{o as requestMediaPick,i as resolveMediaPick};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{clientOnly as r}from"./chunk-GXQCZJOP.js";import{ScreenChrome as n}from"./chunk-
|
|
1
|
+
import{clientOnly as r}from"./chunk-GXQCZJOP.js";import{ScreenChrome as n}from"./chunk-RVZJ52EP.js";import{ScreenStoreProvider as e}from"./chunk-H4JCMK36.js";import{ScreenDocumentProvider as i,useScreenDocument as a}from"./chunk-276MBG5P.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-23DYNW6S.js";import{documentPermissions as s}from"./chunk-THWO5YVZ.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(e),C=r(n);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
|
-
/* @__PURE__ */u(f,{variant:"primary",loading:a,onClick:()=>{
|
|
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
6
|
return u(i,{target:r,addressing:n,onHostMessage:e,children:a})}var y=(r,n)=>/* @__PURE__ */p(v,{children:[r,n]});function H({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(),H=t(()=>s(!g),[g]),M=c("screen",o);return l?/* @__PURE__ */u("div",{className:"sf-msg",children:M.loading}):d?/* @__PURE__ */u("div",{className:"sf-msg sf-msg--error",children:d}):m?i?e(
|
|
7
|
-
/* @__PURE__ */u(
|
|
7
|
+
/* @__PURE__ */u(k,{config:r,data:i,onChange:h,permissions:H,parts:n,children:/* @__PURE__ */u(C,{})}),f&&/* @__PURE__ */u(N,{onCancel:p,onDiscard:v,onSave:j})):/* @__PURE__ */u("div",{className:"sf-msg",children:M.loading}):/* @__PURE__ */u("div",{className:"sf-msg",children:M.waitingForAuthorization})}export{H as DocumentScreen,j as ScreenMount};
|
package/dist/copy/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{TEXT_STYLE_CASES as e}from"../chunk-YHZSBL2N.js";import{selectionToVisible as t,selectionToSource as n,richLayout as r,createHistory as l,colorRunOf as o,textRange as a,selectionBox as s,placeWindow as c,offsetOrigin as i,visibleArea as u,ColorWindow as d,markPress as p,pasteToMarkup as h,richInput as m,editVisible as f,MARKUP_CLIPBOARD_TYPE as g,markupOfRange as y}from"../chunk-23VM4PMV.js";export{ColorWindow,MARKUP_CLIPBOARD_TYPE,TYPING_BURST_MS,colorRunOf,createHistory,editVisible,markupOfRange,newLine,pasteToMarkup,richInput,richLayout,selectionToSource,selectionToVisible,setBullet,startCanvasTyping,textMap,toSource,toSourceStart,toVisible}from"../chunk-23VM4PMV.js";import{DEFAULT_COPY_WORDS as v}from"../chunk-KRL3IUV3.js";import{FieldNumber as b}from"../chunk-ZOBSIXRD.js";import{FieldSelect as k}from"../chunk-QAJAEWCZ.js";import"../chunk-WRFD4EXD.js";import{SettingsSwitch as x}from"../chunk-OECWLNKJ.js";import{SettingsField as S,SettingsSegmented as w}from"../chunk-VANKQVOW.js";import{useWords as E}from"../chunk-MFIRYGHW.js";import{registerModalEscapeInterceptor as C,textToolbarRows as D,TextToolbar as N,textAlignWords as T,useShellStrings as O,textAlignOptions as L,TEXT_ALIGNS as R,LinkPicker as K,Tooltip as V,IconButton as j}from"efficient-shell/ui";export{TextToolbar}from"efficient-shell/ui";import{useRef as B,useState as M,useLayoutEffect as F,useEffect as W,useId as H}from"react";import{RETIRED_MARKS as $,applyMark as P,marksIn as z,STANDARD_MARKUP as I,listIn as q,colorIn as A,spanFor as U,findLink as Y,tokenizeInline as Z,colorOver as _,setList as G,unlinkAt as J,removeLink as Q,linkOver as X,writeLink as ee}from"efficient-shell/markup";import{jsxs as te,jsx as ne,Fragment as re}from"react/jsx-runtime";import{ParagraphSpacingIcon as le,LetterSpacingIcon as oe,LineSpacingIcon as ae,TextSizeIcon as se,StylesIcon as ce,TypeIcon as ie,AlignmentIcon as ue,ListFormatIcon as de,CaseIcon as pe,ItalicIcon as he,NumberedListIcon as me,ListIcon as fe,ListNoneIcon as ge,CaseLowerIcon as ye,CaseCapitalizedIcon as ve,CaseUpperIcon as be,CaseNormalIcon as ke}from"efficient-shell/icons/efficient";function xe(e,t,n,r,l){for(const o of l){if(o.kind!==n)continue;if(!e.startsWith(o.open,t))continue;const l=t+o.open.length;if(e.startsWith(r,l)&&e.startsWith(o.close,l+r.length))return o}return null}function Se({value:e,rules:t=I,className:n,layerRef:r}){const l=function(e,t){const n=[];let r=0;for(const l of Z(e,t)){if("text"===l.kind){l.text.length>0&&(n.push({kind:"text",text:e.slice(r,r+l.text.length)}),r+=l.text.length);continue}const o=xe(e,r,l.kind,l.text,t);if(!o)return[{kind:"text",text:e}];const a=r+o.open.length,s=a+l.text.length,c=s+o.close.length;n.push({kind:"delimiter",text:e.slice(r,a)}),n.push({kind:l.kind,text:e.slice(a,s)}),n.push({kind:"delimiter",text:e.slice(s,c)}),r=c}return n.map(e=>e.text).join("")!==e?[{kind:"text",text:e}]:n}(e,t);/* @__PURE__ */
|
|
2
2
|
return ne("div",{ref:r,className:["es-gold-layer",n??""].filter(Boolean).join(" "),"aria-hidden":"true",children:l.map((e,t)=>function(e,t){const{kind:n,text:r}=e;switch(n){case"delimiter":/* @__PURE__ */
|
|
3
3
|
return ne("span",{className:"es-gold-delim",children:r},t);case"accent":case"highlight":/* @__PURE__ */
|
|
4
4
|
return ne("em",{className:"es-gold-mark es-gold-accent",children:r},t);case"bold":/* @__PURE__ */
|
|
@@ -10,20 +10,20 @@ return ne("span",{className:"es-gold-text",children:r},t)}}(e,t))})}function we(
|
|
|
10
10
|
return te("div",{className:["es-gold",l?"es-gold-is-multiline":"es-gold-is-single",i?"es-gold-is-off":"",a??""].filter(Boolean).join(" "),children:[
|
|
11
11
|
/* @__PURE__ */ne(Se,{value:e,rules:s,layerRef:d}),o&&""===e?
|
|
12
12
|
/* @__PURE__ */ne("div",{className:"es-gold-placeholder","aria-hidden":"true",children:o}):null,
|
|
13
|
-
/* @__PURE__ */ne("textarea",{ref:u,className:"es-gold-input",disabled:i,value:e,placeholder:o,"aria-label":c,onChange:function(e){h.current=!0,t(e.currentTarget.value)},onFocus:function(){p.current=e,h.current=!1},onBlur:function(){m(e)},onKeyDown:function(t){return"Escape"===t.key?(t.preventDefault(),h.current=!1,void r?.(p.current)):"Enter"!==t.key||l?void 0:(t.preventDefault(),void m(e))},onScroll:function(e){const t=d.current;t&&(t.scrollTop=e.currentTarget.scrollTop,t.scrollLeft=e.currentTarget.scrollLeft)}})]})}function Ee(e,t){const n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}}function Ce(e,t,n,r=P){const{start:l,end:o}=Ee(e,n);return r(e,l,o,t)}function De(e,t,n){const{start:r,end:l}=Ee(e,n),o=r+t.length;return{text:e.slice(0,r)+t+e.slice(l),selectionStart:o,selectionEnd:o}}function Ne(e,t,n,r){switch(t){case"bold":return e.createElement("strong");case"italic":return e.createElement("em");case"strike":return e.createElement("s");case"underline":return e.createElement("u");case"sup":return e.createElement("sup");case"sub":return e.createElement("sub");case"color":{const t=e.createElement("span");return t.className="es-rich-color",r&&(t.dataset.color=r,t.title=r.startsWith("#")?r.toUpperCase():r,t.style.color=r.startsWith("#")?r:`var(--es-color-${r}, inherit)`),t}case"link":{const t=e.createElement("a");return t.className="es-rich-link",n&&(t.title=n),t}default:{const n=e.createElement("span");return n.className="highlight"===t||"accent"===t?"es-rich-emphasis":`es-rich-${t}`,n}}}function Te(e,t,n,r){const l=e.layout.lines;if(n===t)return r>=e.lines.length?e.layout.text.length:l[r].vis;const o=e.lines.findIndex(e=>e===n||e.contains(n));if(-1===o)return 0;const a=t.ownerDocument.createRange();a.setStart(e.lines[o],0);try{a.setEnd(n,r)}catch{return l[o].vis}return l[o].vis+Math.min(a.toString().length,l[o].text.length)}function Oe(e,t){const n=e.layout.lines;let r=n.length-1;for(let e=0;e<n.length;e+=1)if(t<=n[e].vis+n[e].text.length){r=e;break}let l=Math.max(0,t-n[r].vis);const o=e.lines[r].ownerDocument.createTreeWalker(e.lines[r],4);let a=o.nextNode(),s=null;for(;a;){if(l<=a.data.length)return[a,l];l-=a.data.length,s=a,a=o.nextNode()}return s?[s,s.data.length]:[e.lines[r],0]}function Le({value:e,rules:
|
|
13
|
+
/* @__PURE__ */ne("textarea",{ref:u,className:"es-gold-input",disabled:i,value:e,placeholder:o,"aria-label":c,onChange:function(e){h.current=!0,t(e.currentTarget.value)},onFocus:function(){p.current=e,h.current=!1},onBlur:function(){m(e)},onKeyDown:function(t){return"Escape"===t.key?(t.preventDefault(),h.current=!1,void r?.(p.current)):"Enter"!==t.key||l?void 0:(t.preventDefault(),void m(e))},onScroll:function(e){const t=d.current;t&&(t.scrollTop=e.currentTarget.scrollTop,t.scrollLeft=e.currentTarget.scrollLeft)}})]})}function Ee(e,t){const n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}}function Ce(e,t,n,r=P){const{start:l,end:o}=Ee(e,n);return r(e,l,o,t)}function De(e,t,n){const{start:r,end:l}=Ee(e,n),o=r+t.length;return{text:e.slice(0,r)+t+e.slice(l),selectionStart:o,selectionEnd:o}}function Ne(e,t,n,r){switch(t){case"bold":return e.createElement("strong");case"italic":return e.createElement("em");case"strike":return e.createElement("s");case"underline":return e.createElement("u");case"sup":return e.createElement("sup");case"sub":return e.createElement("sub");case"color":{const t=e.createElement("span");return t.className="es-rich-color",r&&(t.dataset.color=r,t.title=r.startsWith("#")?r.toUpperCase():r,t.style.color=r.startsWith("#")?r:`var(--es-color-${r}, inherit)`),t}case"link":{const t=e.createElement("a");return t.className="es-rich-link",n&&(t.title=n),t}default:{const n=e.createElement("span");return n.className="highlight"===t||"accent"===t?"es-rich-emphasis":`es-rich-${t}`,n}}}function Te(e,t,n,r){const l=e.layout.lines;if(n===t)return r>=e.lines.length?e.layout.text.length:l[r].vis;const o=e.lines.findIndex(e=>e===n||e.contains(n));if(-1===o)return 0;const a=t.ownerDocument.createRange();a.setStart(e.lines[o],0);try{a.setEnd(n,r)}catch{return l[o].vis}return l[o].vis+Math.min(a.toString().length,l[o].text.length)}function Oe(e,t){const n=e.layout.lines;let r=n.length-1;for(let e=0;e<n.length;e+=1)if(t<=n[e].vis+n[e].text.length){r=e;break}let l=Math.max(0,t-n[r].vis);const o=e.lines[r].ownerDocument.createTreeWalker(e.lines[r],4);let a=o.nextNode(),s=null;for(;a;){if(l<=a.data.length)return[a,l];l-=a.data.length,s=a,a=o.nextNode()}return s?[s,s.data.length]:[e.lines[r],0]}function Le({value:e,rules:l,multiline:o,readOnly:a=!1,placeholder:s,ariaLabel:c,handle:i,onEdit:u,onSelect:d,onHistory:p,onFormat:v,pending:b,onCommit:k,onCancel:x}){const S=B(null),w=B(null),E=B(null),C=B(null),D=B(null),N=B(e),[T,O]=M(0),L=B({value:e,rules:l,multiline:o,readOnly:a,pending:b,onEdit:u,onHistory:p,onFormat:v});L.current={value:e,rules:l,multiline:o,readOnly:a,pending:b,onEdit:u,onHistory:p,onFormat:v};const R=()=>{const e=S.current,t=w.current,n=e?.ownerDocument.getSelection();if(!(e&&t&&n&&0!==n.rangeCount&&n.anchorNode&&e.contains(n.anchorNode)))return null;const r=Te(t,e,n.anchorNode,n.anchorOffset),l=n.focusNode&&e.contains(n.focusNode)?Te(t,e,n.focusNode,n.focusOffset):r;return r<=l?[r,l]:[l,r]},K=(e,t)=>{const n=S.current,r=w.current;if(!n||!r)return;const[l,o]=Oe(r,e),[a,s]=Oe(r,t);n.ownerDocument.getSelection()?.setBaseAndExtent(l,o,a,s)};i.current={getSource(){const e=R(),t=w.current;if(!e||!t)return null;const[r,l]=n(t.layout,e[0],e[1]);return{start:r,end:l}},setSource(e,t,n){C.current={text:n,src:[e,t]},O(e=>e+1)},focus(){S.current?.focus()},rangeOf(e,n){const r=S.current,l=w.current;if(!r||!l)return null;const[o,a]=t(l.layout,e,n),[s,c]=Oe(l,o),[i,u]=Oe(l,a),d=r.ownerDocument.createRange();return d.setStart(s,c),d.setEnd(i,u),d}},F(()=>{const n=S.current;if(!n||D.current)return;const o=C.current?null:R();w.current=function(e,t){const n=e.ownerDocument;e.replaceChildren();const r=t.lines.map(t=>{const r=n.createElement("div");r.className=null!=t.number?"es-rich-line is-numbered":t.bullet?"es-rich-line is-bullet":"es-rich-line",null!=t.number&&(r.dataset.number=t.number);const l=[],o=()=>l.length?l[l.length-1].el:r;let a=null;for(const e of t.chars){let t=0;for(;t<l.length&&t<e.marks.length&&l[t].id===e.marks[t].id;)t+=1;(l.length>t||e.marks.length>t)&&(a=null),l.length=t;for(let r=t;r<e.marks.length;r+=1){const t=Ne(n,e.marks[r].kind,e.marks[r].href,e.marks[r].color);o().appendChild(t),l.push({id:e.marks[r].id,el:t})}a||(a=n.createTextNode(""),o().appendChild(a)),a.data+=e.ch}return 0===t.chars.length&&r.appendChild(n.createElement("br")),e.appendChild(r),r});return{layout:t,lines:r}}(n,r(e,l)),E.current=e;const a=C.current;if(!a||a.text!==e)return void(o&&n.ownerDocument.activeElement===n&&K(o[0],Math.min(o[1],w.current.layout.text.length)));C.current=null;const s=w.current.layout,[c,i]=a.vis??t(s,a.src[0],a.src[1]);n.ownerDocument.activeElement!==n&&n.focus(),K(c,i)},[e,l,T]);const V=(e,t,r)=>{const l=w.current,[o,a]=n(l.layout,t[0],t[1]);C.current={text:e.text,vis:[e.caret,e.caret]},e.text!==L.current.value?L.current.onEdit(e.text,{start:o,end:a},r):O(e=>e+1)};W(()=>{const e=S.current;if(!e)return;const t=t=>{const{value:n,rules:r,multiline:l,readOnly:o,pending:a}=L.current;if("insertCompositionText"===t.inputType)return;if(t.preventDefault(),o)return;const s=w.current,c=R();if(!s||!c)return;const i="function"==typeof t.getTargetRanges?t.getTargetRanges()[0]:void 0,u=i&&!i.collapsed?[Te(s,e,i.startContainer,i.startOffset),Te(s,e,i.endContainer,i.endOffset)]:null,d=m({value:n,rules:r,multiline:l,inputType:t.inputType,data:t.data??t.dataTransfer?.getData("text/plain")??"",html:t.dataTransfer?.getData("text/html"),doc:e.ownerDocument,sel:c,target:u,pending:a});d&&("history"!==d.kind?"format"!==d.kind?V(d.edit,d.range,d.kind):L.current.onFormat(d.style):L.current.onHistory(d.dir))},n=()=>{D.current||O(e=>e+1)};return e.addEventListener("beforeinput",t),e.addEventListener("input",n),()=>{e.removeEventListener("beforeinput",t),e.removeEventListener("input",n)}},[]),W(()=>{const e=S.current;if(!e)return;const t=e.ownerDocument,n=()=>{const e=i.current?.getSource();e&&d(e)};return t.addEventListener("selectionchange",n),()=>t.removeEventListener("selectionchange",n)});const j=(t,n=!1)=>{const r=R();if(!r||r[0]===r[1])return;t.preventDefault();const o=w.current;t.clipboardData.setData("text/plain",o.layout.text.slice(r[0],r[1])),t.clipboardData.setData(g,y(e,l,r[0],r[1])),n&&!a&&V(f(e,l,r[0],r[1],{text:""}),r,"edit")};/* @__PURE__ */
|
|
14
14
|
return te("div",{className:"es-rich-wrap",children:[s&&""===e?/* @__PURE__ */ne("div",{className:"es-rich-placeholder","aria-hidden":"true",children:s}):null,
|
|
15
|
-
/* @__PURE__ */ne("div",{ref:S,className:`es-rich${o?" is-multiline":" is-single"}${a?" is-off":""}`,contentEditable:!a,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":o,"aria-label":c,"aria-readonly":a||void 0,"aria-placeholder":s,tabIndex:a?-1:0,spellCheck:!0,onFocus:()=>{N.current=e},onBlur:()=>{e!==N.current&&k?.(e),N.current=e},onKeyDown:t=>{if("Escape"===t.key)return t.preventDefault(),x?.(N.current),void(N.current=e);"Enter"!==t.key||o||(t.preventDefault(),e!==N.current&&k?.(e),N.current=e)},onCompositionStart:()=>{const e=R()??[0,0];D.current={from:e[0],to:e[1]}},onCompositionEnd:e=>{const t=D.current;if(D.current=null,!t)return;const{value:n,rules:r,pending:l}=L.current;e.data?V(
|
|
15
|
+
/* @__PURE__ */ne("div",{ref:S,className:`es-rich${o?" is-multiline":" is-single"}${a?" is-off":""}`,contentEditable:!a,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":o,"aria-label":c,"aria-readonly":a||void 0,"aria-placeholder":s,tabIndex:a?-1:0,spellCheck:!0,onFocus:()=>{N.current=e},onBlur:()=>{e!==N.current&&k?.(e),N.current=e},onKeyDown:t=>{if("Escape"===t.key)return t.preventDefault(),x?.(N.current),void(N.current=e);"Enter"!==t.key||o||(t.preventDefault(),e!==N.current&&k?.(e),N.current=e)},onCompositionStart:()=>{const e=R()??[0,0];D.current={from:e[0],to:e[1]}},onCompositionEnd:e=>{const t=D.current;if(D.current=null,!t)return;const{value:n,rules:r,pending:l}=L.current;e.data?V(f(n,r,t.from,t.to,{text:e.data,add:l?.add,drop:l?.drop,color:l?.color}),[t.from,t.to],"type"):O(e=>e+1)},onCopy:e=>j(e),onCut:e=>j(e,!0),onPaste:t=>{if(t.preventDefault(),a)return;const n=R();if(!n)return;const r=t.clipboardData.getData(g),s=r?o?r:r.replace(/\s*\r?\n\s*/g," "):h({html:t.clipboardData.getData("text/html"),text:t.clipboardData.getData("text/plain")},{doc:t.currentTarget.ownerDocument,multiline:o,rules:l});V(f(e,l,n[0],n[1],{markup:s}),n,"edit")}})]})}var Re={fontSize:{key:"fontSize",nameKey:"fontSize",icon:/* @__PURE__ */ne(se,{}),unit:"px",step:1,shiftStep:10,min:5},lineHeight:{key:"lineHeight",nameKey:"lineHeight",icon:/* @__PURE__ */ne(ae,{}),unit:"%",step:1,shiftStep:10,min:50,max:250,scale:100},letterSpacing:{key:"letterSpacing",nameKey:"letterSpacing",icon:/* @__PURE__ */ne(oe,{}),unit:"px",step:.1,shiftStep:1,min:-10},paragraphSpacing:{key:"paragraphSpacing",nameKey:"paragraphSpacing",icon:/* @__PURE__ */ne(le,{}),unit:"px",step:1,shiftStep:10,min:0}};function Ke(e,t){return void 0===e?void 0:Number((e*t).toFixed(6))}function Ve({cells:e,words:t,readOnly:n=!1}){const r=t??v.cells,l=H();/* @__PURE__ */
|
|
16
16
|
return ne("div",{className:"es-copy-cells-fit",children:/* @__PURE__ */ne("div",{className:"es-copy-cells",children:e.map(e=>{const t=e.scale??1,o=e.name??(e.nameKey?r[e.nameKey]:e.key),a=e.unit??"",s=e.step??1,c=`${l}-${e.key}`;/* @__PURE__ */
|
|
17
17
|
return te("div",{className:"es-copy-cell",children:[
|
|
18
18
|
/* @__PURE__ */ne("label",{className:"es-field-label es-copy-cell-name",htmlFor:c,children:o}),
|
|
19
|
-
/* @__PURE__ */ne(
|
|
20
|
-
return te("div",{ref:lt,className:"es-copy"+(
|
|
21
|
-
/* @__PURE__ */ne(N,{className:"es-copy-toolbar","aria-label":R??ie.formatting,offered:dt,pressed:Ye,onMark:e=>_e(e),color:it,linkOpen:null!==Ie,last:ut,alignment:pt,list:ht,letterCase:se,disabled:
|
|
19
|
+
/* @__PURE__ */ne(b,{id:c,value:Ke(e.value,t),styleValue:Ke(e.styleValue,t),onChange:n=>e.onChange(void 0===n?void 0:Number((n/t).toFixed(6))),min:e.min,max:e.max,step:s,shiftStep:e.shiftStep,icon:e.icon,unit:a||void 0,steppers:"compact",readOnly:n,ariaLabel:o,title:r.tip({name:o,step:s,unit:a})})]},e.key)})})})}function je({target:e,onChange:t}){const n=B(null);return F(()=>{const t=n.current,r=e.current;t&&r&&r.value===t.text&&(n.current=null,r.focus(),r.setSelectionRange(t.start,t.end))}),r=>{const l=r(e.current);t(l.text),n.current={start:l.selectionStart,end:l.selectionEnd,text:l.text}}}var Be=/* @__PURE__ */new Set([...$,"clear"]);function Me({value:e,onChange:t,onCommit:n,onCancel:r,multiline:m=!1,placeholder:f,ariaLabel:g,className:y,readOnly:b=!1,rules:k,tools:S=[],writeMark:w,align:T,actions:O,toolbar:L,barLabel:R,renderFooter:V,inputRef:j,barShows:$="always",richText:Z=!0,defaultShowMarks:le=!1,colors:oe,cells:ae,letterCase:se,lastTool:ce}){const ie=E("copy",v),ue=B(null),de=j??ue,[pe,he]=M(!1),[me,fe]=M(null),ge=B(l()).current,ye=B(null);W(()=>{const t=ye.current;t&&e===t.to?ye.current=null:t&&e===t.from||(ye.current=null,ge.reset())},[e,ge]);const ve=n=>{ye.current={from:ye.current?.from??e,to:n},t(n)},be=t=>({text:e,start:t?.selectionStart??me?.start??e.length,end:t?.selectionEnd??me?.end??e.length}),[ke,xe]=M(le),Se=Z&&!(m&&ke),Ee=B(null),Ne=H(),[Te,Oe]=M(null),[Re,Ke]=M(!1),Me=()=>{if(!Se)return de.current;const e=Ee.current?.getSource()??me;return e?{selectionStart:e.start,selectionEnd:e.end}:null},Fe=je({target:de,onChange:ve}),We=e=>(fe({start:e.selectionStart,end:e.selectionEnd}),e),He=(t,n)=>{if(!Se)return void Fe(e=>(n&&ge.record(be(e),"edit",Date.now()),We(t(e))));const r=Me(),l=We(t(r));n&&ge.record(be(r),"edit",Date.now()),Oe(null),l.text!==e&&ve(l.text),Ee.current?.setSource(l.selectionStart,l.selectionEnd,l.text)},$e=e=>He(e,!0),Pe=e=>He(t=>{const n=be(t),r=ge[e](n);return r?{text:r.text,selectionStart:r.start,selectionEnd:r.end}:{text:n.text,selectionStart:n.start,selectionEnd:n.end}},!1),ze=B(null);F(()=>{const t=ze.current;t&&(ze.current=null,Se?Ee.current?.setSource(t.start,t.end,e):(de.current?.focus(),de.current?.setSelectionRange(t.start,t.end),fe(t)))},[Se]);const[Ie,qe]=M(null),Ae=k??I,Ue=("string"==typeof S[0]?S:S.map(e=>e.style)).filter(e=>!Be.has(e)),Ye={};if(me){const t=z(e,me.start,me.end,Ae);for(const e of Ue){const n=t.has(e)||"highlight"===e&&t.has("accent");Ye[e]=!!Te?.add.includes(e)||!Te?.drop.includes(e)&&n}Ye.link=t.has("link")}const Ze=()=>{const t=Me(),n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}},_e=t=>{if("link"!==t&&U(0,t)){const{start:n,end:r}=Ze();if(n===r&&!Se)return void $e(n=>Ce(e,t,n,(e,t,n,r)=>P(e,t,n,r,Ae,ie.placeholders)));const l=p({value:e,rules:Ae,start:n,end:r,style:t,pending:Te});return void("pending"===l.kind?Oe(l.pending):$e(()=>l.result))}if("link"!==t){const n=w??((e,t,n,r)=>P(e,t,n,r,I,ie.placeholders));return void $e(r=>Ce(e,t,r,n))}const n=Me(),r=n?.selectionStart??e.length,l=n?.selectionEnd??r;Ke(!1),qe({start:r,end:l,link:Y(e,r,l)})},Ge=Boolean(me&&me.start!==me.end),Je=me?q(e,me.start,me.end,Ae):null,Qe=me?Te&&void 0!==Te.color&&Te.at===me.start?Te.color:A(e,me.start,me.end,Ae):null,Xe=o(Qe,oe),et=t=>{Se?t?Ee.current?.setSource(t.start,t.end,e):Ee.current?.focus():(de.current?.focus(),t&&de.current?.setSelectionRange(t.start,t.end))},tt=()=>{const e=Ie;qe(null),et(e?{start:e.start,end:e.end}:me)},nt=()=>{const e=lt.current,t=Boolean(e&&e.querySelector(".es-copy-colors")?.contains(e.ownerDocument.activeElement));Ke(!1),t&&et(me)},rt=B(nt);rt.current=nt,W(()=>{if(Re)return C(e=>{const t=lt.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&(rt.current(),!0)},()=>lt.current?.querySelector(".es-copy-colors"))},[Re]);const lt=B(null),ot=Re||null!==Ie;W(()=>{const e=lt.current;if(!ot||!e)return;const t=e.ownerDocument,n=()=>{Ke(!1),qe(null)},r=t=>{e.contains(t.target)||n()};let l;const o=r=>{const o=r.relatedTarget;o?e.contains(o)||n():(clearTimeout(l),l=setTimeout(()=>{const r=t.activeElement;t.hasFocus()&&r&&r!==t.body&&!e.contains(r)&&n()},0))};return t.addEventListener("pointerdown",r,!0),e.addEventListener("focusout",o),()=>{clearTimeout(l),t.removeEventListener("pointerdown",r,!0),e.removeEventListener("focusout",o)}},[ot]);const at=Ie??(Re?me??{start:e.length,end:e.length}:null),st=B(()=>{});st.current=()=>{const e=lt.current,t=e?.querySelector(".rosh-tb-wrap > .es-copy-pop");if(!e||!t||!at)return;const n=Se?null:e.querySelector(".es-gold-layer"),r=Se?Ee.current?.rangeOf(at.start,at.end)??null:n?a(n,at.start,at.end):null,l=r?.endContainer,o=l?1===l.nodeType?l:l.parentElement:null,d=r?s(r,o?.closest(".es-rich-line, .es-gold-layer")??null):null;if(!d)return;const p=c({anchor:d,size:{width:t.offsetWidth,height:t.offsetHeight},within:e.getBoundingClientRect(),clip:u(e),parent:i(t)});t.style.top=`${p.top}px`,t.style.left=`${p.left}px`,t.style.setProperty("--es-pop-point",`${p.point}px`),t.dataset.side=p.above?"above":"below"},F(()=>{const e=lt.current;if(!ot||!e)return;const t=()=>st.current();t();const n=e.ownerDocument.defaultView;n?.addEventListener("resize",t);const r=e.querySelector(".rosh-tb-wrap > .es-copy-pop"),l=n?.ResizeObserver,o=l&&r?new l(t):null;return o&&r&&o.observe(r),()=>{n?.removeEventListener("resize",t),o?.disconnect()}},[ot,Re,Ie,at?.start,at?.end,Se]);const ct="always"===$||pe||null!==Ie||Re,it=oe&&oe.length>0?{run:Xe,open:Re,onToggle:()=>{qe(null),Re?nt():Ke(!0)}}:void 0,ut=ct?ce?ce({className:"rosh-tb-btn",disabled:b,selected:Ge,keepCaret:e=>e.preventDefault(),insert:t=>$e(n=>De(e,t,n))}):"classic"===L?O:void 0:void 0,dt=new Set(Ue),pt=T?{value:T.value,allow:T.allow,onChange:T.onChange,disabled:T.disabled}:void 0,ht={pressed:Je,onList:t=>{const{start:n,end:r}=Ze(),l=q(e,n,r,Ae);$e(()=>G(e,n,r,l===t?null:t,Ae))}},mt=D({offered:dt,color:it,last:ut,alignment:pt,list:ht,letterCase:se});/* @__PURE__ */
|
|
20
|
+
return te("div",{ref:lt,className:"es-copy"+(y?` ${y}`:""),onFocus:()=>he(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||he(!1)},onKeyDown:e=>{const t=e.target===de.current||Boolean(e.target.closest?.(".es-rich"));if(b||!t)return;if(e.altKey||e.metaKey===e.ctrlKey)return;const n=e.key.toLowerCase(),r="KeyZ"===e.code||"z"===n,l=("KeyY"===e.code||"y"===n)&&!e.shiftKey;if(r||l)return e.preventDefault(),e.stopPropagation(),void Pe(l||e.shiftKey?"redo":"undo");const o={b:"bold",i:"italic",u:"underline",k:"link"}[`${e.shiftKey?"shift+":""}${n}`];o&&Ue.includes(o)&&(e.preventDefault(),e.stopPropagation(),_e(o))},onPaste:t=>{const n=de.current;if(b||!n||t.target!==n)return;t.preventDefault();const r=h({html:t.clipboardData.getData("text/html"),text:t.clipboardData.getData("text/plain")},{doc:n.ownerDocument,multiline:m,rules:Ae});$e(t=>De(e,r,t))},style:oe&&oe.length>0?Object.fromEntries(oe.map(e=>[`--es-color-${e.name}`,e.value])):void 0,onSelect:()=>{const t=de.current;t&&t.ownerDocument.activeElement===t&&fe({start:t.selectionStart??e.length,end:t.selectionEnd??e.length})},children:[ct&&(mt.words||mt.paragraph)?
|
|
21
|
+
/* @__PURE__ */ne(N,{className:"es-copy-toolbar","aria-label":R??ie.formatting,offered:dt,pressed:Ye,onMark:e=>_e(e),color:it,linkOpen:null!==Ie,last:ut,alignment:pt,list:ht,letterCase:se,disabled:b,windows:/* @__PURE__ */te(re,{children:[Re&&oe&&oe.length>0?/* @__PURE__ */ne(d,{colors:oe,current:Qe,words:ie.colors??v.colors,onPick:t=>{const{start:n,end:r}=Ze();if(n!==r)$e(()=>_(e,n,r,t,Ae));else{if(!Se)return;Oe({add:Te?.add??[],drop:Te?.drop??[],color:t,at:n})}}}):null,Ie?Ie&&/* @__PURE__ */ne(K,{className:"es-copy-link es-copy-pop",value:Ie.link?.href??"",onApply:t=>{const n=Ie;qe(null),$e(()=>Se?X(e,n.start,n.end,t,Ae):ee(e,n.start,n.end,t))},onRemove:Ie.link?()=>{const t=Ie.link,n=Ie;qe(null),t&&$e(()=>Se?J(e,n.start,n.end,Ae):Q(e,t))}:void 0,onCancel:tt}):null]})}):null,ae&&ae.length>0?/* @__PURE__ */ne(Ve,{cells:ae,words:ie.cells??v.cells,readOnly:b}):null,Se?/* @__PURE__ */ne(Le,{value:e,rules:Ae,multiline:m,readOnly:b,placeholder:f,ariaLabel:g,handle:Ee,pending:Te??void 0,onEdit:(t,n,r)=>{ge.record({text:e,start:n.start,end:n.end},r,Date.now()),Oe(null),ve(t)},onSelect:e=>{fe(t=>t&&t.start===e.start&&t.end===e.end?t:e),!Te||e.start===Te.at&&e.end===Te.at||Oe(null)},onHistory:Pe,onFormat:e=>{Ue.includes(e)&&_e(e)},onCommit:n,onCancel:r}):/* @__PURE__ */ne(we,{value:e,onInput:e=>{ge.record(be(null),"type",Date.now()),ve(e)},onCommit:n,onCancel:r,multiline:m,placeholder:f,ariaLabel:g,rules:k,disabled:b,inputRef:de,className:"es-copy-box"}),V?V({focused:pe,insert:t=>$e(n=>De(e,t,n))}):null,Z&&m?
|
|
22
22
|
/* @__PURE__ */te("div",{className:"es-copy-marks",children:[
|
|
23
|
-
/* @__PURE__ */ne(
|
|
24
|
-
/* @__PURE__ */ne("span",{id:Ne,className:"es-copy-marks-label",children:ie.showMarks??"Show marks"})]}):null]})}var Fe=["none","bullet","number"],We=
|
|
25
|
-
return ne(
|
|
23
|
+
/* @__PURE__ */ne(x,{checked:ke,onChange:()=>{const e=Me();ze.current=e&&null!==e.selectionStart&&null!==e.selectionEnd?{start:e.selectionStart,end:e.selectionEnd}:me,Oe(null),xe(e=>!e)},ariaLabelledBy:Ne,disabled:b}),
|
|
24
|
+
/* @__PURE__ */ne("span",{id:Ne,className:"es-copy-marks-label",children:ie.showMarks??"Show marks"})]}):null]})}var Fe=["none","bullet","number"],We=e,He={none:/* @__PURE__ */ne(ge,{}),bullet:/* @__PURE__ */ne(fe,{}),number:/* @__PURE__ */ne(me,{})},$e={none:/* @__PURE__ */ne(ke,{}),upper:/* @__PURE__ */ne(be,{}),capitalize:/* @__PURE__ */ne(ve,{}),lower:/* @__PURE__ */ne(ye,{})};function Pe({label:e,icon:t,answers:n,names:r,glyphs:l,row:o,readOnly:a}){const s=o.value||o.styleValue||"";/* @__PURE__ */
|
|
25
|
+
return ne(S,{label:e,icon:t,children:/* @__PURE__ */ne(w,{ariaLabel:e,value:s,disabled:a,onChange:e=>{a||o.onChange(function(e,t){return t===e.value||""===e.value&&t===e.styleValue?"":t}(o,e))},options:n.map(e=>({id:e,label:l[e],title:r[e]}))})})}function ze({kept:e,keptHint:t,readOnly:n=!1,style:r,font:l,italic:o,cells:a,align:s,list:c,letterCase:i}){const u=E("copy",v),d=T(O().textToolbar),p=Object.fromEntries(L(R).map(e=>[e.value,e.icon])),h={...v.panel,...u.panel},m=r&&!n?[r.onEditStyles&&{label:h.editStyles,onSelect:r.onEditStyles},r.onUpdateStyle&&{label:h.updateStyle,onSelect:r.onUpdateStyle}].filter(e=>!!e):[],f=!!o&&(o.value??o.styleValue??!1),g=o?/* @__PURE__ */ne(V,{content:h.italic,children:/* @__PURE__ */ne(j,{size:"md",variant:"ghost","aria-label":h.italic,"aria-pressed":f,disabled:n,onClick:()=>{if(n)return;const e=!f;o.onChange(e===(o.styleValue??!1)?void 0:e)},children:/* @__PURE__ */ne(he,{})})}):null;/* @__PURE__ */
|
|
26
26
|
return te("div",{className:"es-tpp",children:[e?/* @__PURE__ */te("div",{className:"es-tpp-kept",children:[
|
|
27
|
-
/* @__PURE__ */ne(Me,{...e,readOnly:n||e.readOnly}),t?/* @__PURE__ */ne("p",{className:"es-field-hint",children:t}):null]}):null,r?/* @__PURE__ */ne(
|
|
28
|
-
/* @__PURE__ */ne("div",{className:"es-tpp-font-select",children:/* @__PURE__ */ne(
|
|
29
|
-
/* @__PURE__ */ne(
|
|
27
|
+
/* @__PURE__ */ne(Me,{...e,readOnly:n||e.readOnly}),t?/* @__PURE__ */ne("p",{className:"es-field-hint",children:t}):null]}):null,r?/* @__PURE__ */ne(S,{label:h.style,icon:/* @__PURE__ */ne(ce,{}),children:/* @__PURE__ */ne(k,{ariaLabel:h.style,value:r.value,options:r.options,onChange:r.onChange,changed:r.changed,footer:m,readOnly:n})}):null,l?/* @__PURE__ */ne(S,{label:h.font,icon:/* @__PURE__ */ne(ie,{}),children:/* @__PURE__ */te("div",{className:"es-tpp-font",children:[
|
|
28
|
+
/* @__PURE__ */ne("div",{className:"es-tpp-font-select",children:/* @__PURE__ */ne(k,{ariaLabel:h.font,value:l.value||void 0,placeholder:l.styleValue,options:l.options,onChange:l.onChange,searchable:l.searchable,readOnly:n})}),g]})}):g?
|
|
29
|
+
/* @__PURE__ */ne(S,{label:h.italic,icon:/* @__PURE__ */ne(ie,{}),children:/* @__PURE__ */ne("div",{className:"es-tpp-font",children:g})}):null,a?.length?/* @__PURE__ */ne(Ve,{cells:a,words:u.cells,readOnly:n}):null,s?/* @__PURE__ */ne(Pe,{label:u.alignment,icon:/* @__PURE__ */ne(ue,{}),answers:R.filter(e=>!s.allow||s.allow.includes(e)),names:d,glyphs:p,row:s,readOnly:n}):null,c?/* @__PURE__ */ne(Pe,{label:h.list,icon:/* @__PURE__ */ne(de,{}),answers:Fe,names:h.lists,glyphs:He,row:c,readOnly:n}):null,i?/* @__PURE__ */ne(Pe,{label:h.capitalization,icon:/* @__PURE__ */ne(pe,{}),answers:We,names:h.cases,glyphs:$e,row:i,readOnly:n}):null]})}export{Re as COPY_CELLS,Me as CopyBox,Ve as CopyCells,Le as RichBox,ze as TextPartPanel,De as insertSelection,Ce as markSelection,je as useCaretEdit};
|
package/dist/fields/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-
|
|
1
|
+
export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-7LYKFL3Q.js";export{fieldIsShown,showWhenOf,shownFields,withShowWhen}from"../chunk-BPXEFVSQ.js";import"../chunk-A6Z4SD3I.js";import"../chunk-K56YDHYQ.js";export{FieldSlider}from"../chunk-ZEH6QLBH.js";export{useResolvedFields}from"../chunk-IWCKVZHS.js";import"../chunk-FIVU2COQ.js";import"../chunk-RC25EGHD.js";import"../chunk-KFV7N2DJ.js";export{FieldNumber}from"../chunk-ZOBSIXRD.js";export{FieldSelect,optionFor}from"../chunk-QAJAEWCZ.js";import"../chunk-WRFD4EXD.js";import"../chunk-VANKQVOW.js";import"../chunk-MFIRYGHW.js";import"../chunk-3S5N4HLJ.js";import"../chunk-P2VEMZH5.js";import"../chunk-K7BTCBWD.js";import"../chunk-L55YIXDC.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{AddBlockRow as default}from"../../chunk-
|
|
1
|
+
export{AddBlockRow as default}from"../../chunk-5THLKXTH.js";import"../../chunk-M2Z775ZC.js";import"../../chunk-LEZFSSQN.js";import"../../chunk-FHCKFOCD.js";import"../../chunk-MQA7OFRA.js";import"../../chunk-23DYNW6S.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-ROPYFLNZ.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-7LYKFL3Q.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-A6Z4SD3I.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-IWCKVZHS.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-BSHIQIZC.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-23VM4PMV.js";import"../../chunk-KRL3IUV3.js";import"../../chunk-ZOBSIXRD.js";import"../../chunk-QAJAEWCZ.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-VANKQVOW.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-3S5N4HLJ.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-QIDRJH3S.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-K7BTCBWD.js";import"../../chunk-L55YIXDC.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{blockKey,AddSidePanel as default,sectionKey,sharedKey,templateKey}from"../../chunk-
|
|
1
|
+
export{blockKey,AddSidePanel as default,sectionKey,sharedKey,templateKey}from"../../chunk-47PYYMFM.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-43AEUUNQ.js";import"../../chunk-SINAM2IT.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-M2Z775ZC.js";import"../../chunk-LEZFSSQN.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-FHCKFOCD.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-MQA7OFRA.js";import"../../chunk-23DYNW6S.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-ROPYFLNZ.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-7LYKFL3Q.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-A6Z4SD3I.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-IWCKVZHS.js";import"../../chunk-ZKY45F5G.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-BSHIQIZC.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-23VM4PMV.js";import"../../chunk-KRL3IUV3.js";import"../../chunk-ZOBSIXRD.js";import"../../chunk-QAJAEWCZ.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-VANKQVOW.js";import"../../chunk-ZG6PVMC3.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-AJSDWWJW.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-LDEEFLE3.js";import"../../chunk-KAML3KQH.js";import"../../chunk-3S5N4HLJ.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-QIDRJH3S.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-K7BTCBWD.js";import"../../chunk-L55YIXDC.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{MediaPopup as default}from"../../chunk-
|
|
1
|
+
export{MediaPopup as default}from"../../chunk-2G6MAXPY.js";import"../../chunk-FHCKFOCD.js";import"../../chunk-MQA7OFRA.js";
|
|
@@ -30,7 +30,7 @@ import '../lib/section-template-types.js';
|
|
|
30
30
|
import '../lib/puck/content-tree.js';
|
|
31
31
|
import '../lib/shared-section-types.js';
|
|
32
32
|
import '../lib/puck/block-choice.js';
|
|
33
|
-
import '../../ScreenDocumentContext-
|
|
33
|
+
import '../../ScreenDocumentContext-CFJeqqKk.js';
|
|
34
34
|
import '../lib/document-contract.js';
|
|
35
35
|
import '../lib/document-switch.js';
|
|
36
36
|
import '../../engine-CvXpFE86.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{EASEL_NODE_CLIPBOARD,ancestorChain,nodeClipboardOf,nodeClipboardRules,nodeMenuItems,nodeShortcut,pageMenuItems,pastePlace,runNodeShortcut,textMenuItems,useNodeClipboard,useNodeContextMenu}from"../../chunk-
|
|
1
|
+
export{EASEL_NODE_CLIPBOARD,ancestorChain,nodeClipboardOf,nodeClipboardRules,nodeMenuItems,nodeShortcut,pageMenuItems,pastePlace,runNodeShortcut,textMenuItems,useNodeClipboard,useNodeContextMenu}from"../../chunk-PEDR7G3K.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-MQA7OFRA.js";import"../../chunk-23DYNW6S.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-ZKY45F5G.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-P5VYGWYO.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-BSHIQIZC.js";import"../../chunk-QIDRJH3S.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-K7BTCBWD.js";import"../../chunk-L55YIXDC.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{PageEditGuardNotices as default}from"../../chunk-
|
|
1
|
+
export{PageEditGuardNotices as default}from"../../chunk-UJ46J7QW.js";import"../../chunk-276MBG5P.js";import"../../chunk-77IWWW6X.js";import"../../chunk-ERR437B5.js";import"../../chunk-UNVKPVZW.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-U66YKDAR.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-FHCKFOCD.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-MQA7OFRA.js";import"../../chunk-23DYNW6S.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-ZG6PVMC3.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-AJSDWWJW.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MFIRYGHW.js";
|
|
@@ -29,7 +29,7 @@ import '../lib/section-template-types.js';
|
|
|
29
29
|
import '../lib/puck/content-tree.js';
|
|
30
30
|
import '../lib/shared-section-types.js';
|
|
31
31
|
import '../lib/puck/block-choice.js';
|
|
32
|
-
import '../../ScreenDocumentContext-
|
|
32
|
+
import '../../ScreenDocumentContext-CFJeqqKk.js';
|
|
33
33
|
import '../lib/document-contract.js';
|
|
34
34
|
import '../lib/document-switch.js';
|
|
35
35
|
import '../lib/admin-bridge.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ScreenChrome as default}from"../../chunk-
|
|
1
|
+
export{ScreenChrome as default}from"../../chunk-RVZJ52EP.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-JBOSEHIX.js";import"../../chunk-FGNR22NY.js";import"../../chunk-LER7RKTO.js";import"../../chunk-FGYJ5DJY.js";import"../../chunk-7F52SZOI.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-2E2SXDYQ.js";import"../../chunk-HBBXDGDD.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-C56MPJBH.js";import"../../chunk-47CD7ULN.js";import"../../chunk-PI6RFJR4.js";import"../../chunk-PY7OOQEZ.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-5545A3PC.js";import"../../chunk-47PYYMFM.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-43AEUUNQ.js";import"../../chunk-SINAM2IT.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-M2Z775ZC.js";import"../../chunk-LEZFSSQN.js";import"../../chunk-2G6MAXPY.js";import"../../chunk-PEDR7G3K.js";import"../../chunk-UJ46J7QW.js";import"../../chunk-276MBG5P.js";import"../../chunk-77IWWW6X.js";import"../../chunk-ERR437B5.js";import"../../chunk-UNVKPVZW.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-U66YKDAR.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-FHCKFOCD.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-MQA7OFRA.js";import"../../chunk-XFYFKITX.js";import"../../chunk-23DYNW6S.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-BHRC3ASL.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-ROPYFLNZ.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-7LYKFL3Q.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-A6Z4SD3I.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-IWCKVZHS.js";import"../../chunk-ZKY45F5G.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-P5VYGWYO.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-BSHIQIZC.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-23VM4PMV.js";import"../../chunk-KRL3IUV3.js";import"../../chunk-ZOBSIXRD.js";import"../../chunk-QAJAEWCZ.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-VANKQVOW.js";import"../../chunk-ZG6PVMC3.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-AJSDWWJW.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-LDEEFLE3.js";import"../../chunk-KAML3KQH.js";import"../../chunk-3S5N4HLJ.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-QIDRJH3S.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-K7BTCBWD.js";import"../../chunk-L55YIXDC.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import 'react';
|
|
2
2
|
import '../../blocks/index.js';
|
|
3
|
-
export {
|
|
3
|
+
export { p as AnyScreenTarget, q as DocumentTarget, r as ScreenDocumentContext, s as ScreenDocumentProvider, t as ScreenDocumentValue, v as ScreenTarget, w as useScreenDocument } from '../../ScreenDocumentContext-CFJeqqKk.js';
|
|
4
4
|
import '../lib/document-contract.js';
|
|
5
5
|
export { SaveStatus } from '../lib/document-switch.js';
|
|
6
6
|
import '../lib/admin-bridge.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ScreenDocumentContext,ScreenDocumentProvider,useScreenDocument}from"../../chunk-
|
|
1
|
+
export{ScreenDocumentContext,ScreenDocumentProvider,useScreenDocument}from"../../chunk-276MBG5P.js";import"../../chunk-77IWWW6X.js";import"../../chunk-ERR437B5.js";import"../../chunk-UNVKPVZW.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-U66YKDAR.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-FHCKFOCD.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-MQA7OFRA.js";import"../../chunk-23DYNW6S.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MFIRYGHW.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { p as AnyScreenTarget, A as AnyDocumentAddressing } from '../../ScreenDocumentContext-CFJeqqKk.js';
|
|
4
4
|
import { ScreenParts } from '../lib/screen-parts.js';
|
|
5
5
|
import '../../blocks/index.js';
|
|
6
6
|
import '../../types-Cq53lL8d.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{DocumentScreen,ScreenMount as default}from"../../chunk-
|
|
1
|
+
export{DocumentScreen,ScreenMount as default}from"../../chunk-WBFLSCTI.js";import"../../chunk-GXQCZJOP.js";import"../../chunk-RVZJ52EP.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-JBOSEHIX.js";import"../../chunk-FGNR22NY.js";import"../../chunk-LER7RKTO.js";import"../../chunk-FGYJ5DJY.js";import"../../chunk-7F52SZOI.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-2E2SXDYQ.js";import"../../chunk-HBBXDGDD.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-C56MPJBH.js";import"../../chunk-47CD7ULN.js";import"../../chunk-PI6RFJR4.js";import"../../chunk-PY7OOQEZ.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-H4JCMK36.js";import"../../chunk-5545A3PC.js";import"../../chunk-47PYYMFM.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-43AEUUNQ.js";import"../../chunk-SINAM2IT.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-M2Z775ZC.js";import"../../chunk-LEZFSSQN.js";import"../../chunk-2G6MAXPY.js";import"../../chunk-PEDR7G3K.js";import"../../chunk-UJ46J7QW.js";import"../../chunk-276MBG5P.js";import"../../chunk-77IWWW6X.js";import"../../chunk-ERR437B5.js";import"../../chunk-UNVKPVZW.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-U66YKDAR.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-FHCKFOCD.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-MQA7OFRA.js";import"../../chunk-XFYFKITX.js";import"../../chunk-23DYNW6S.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-BHRC3ASL.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-ROPYFLNZ.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-7LYKFL3Q.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-A6Z4SD3I.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-IWCKVZHS.js";import"../../chunk-ZKY45F5G.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-P5VYGWYO.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-BSHIQIZC.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-23VM4PMV.js";import"../../chunk-KRL3IUV3.js";import"../../chunk-ZOBSIXRD.js";import"../../chunk-QAJAEWCZ.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-VANKQVOW.js";import"../../chunk-ZG6PVMC3.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-AJSDWWJW.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-LDEEFLE3.js";import"../../chunk-KAML3KQH.js";import"../../chunk-3S5N4HLJ.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-QIDRJH3S.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-K7BTCBWD.js";import"../../chunk-L55YIXDC.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";
|
|
@@ -27,7 +27,7 @@ import '../lib/section-template-types.js';
|
|
|
27
27
|
import '../lib/puck/content-tree.js';
|
|
28
28
|
import '../lib/shared-section-types.js';
|
|
29
29
|
import '../lib/puck/block-choice.js';
|
|
30
|
-
import '../../ScreenDocumentContext-
|
|
30
|
+
import '../../ScreenDocumentContext-CFJeqqKk.js';
|
|
31
31
|
import '../lib/document-contract.js';
|
|
32
32
|
import '../lib/document-switch.js';
|
|
33
33
|
import '../../engine-CvXpFE86.js';
|