efficient-easel 20.1.0 → 20.2.1
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/chrome/chrome.css +2 -1
- package/dist/{chunk-PEDR7G3K.js → chunk-6FWAE2RN.js} +1 -1
- package/dist/{chunk-WBFLSCTI.js → chunk-7YVEYQDE.js} +3 -3
- package/dist/{chunk-ROPYFLNZ.js → chunk-EFHV56BO.js} +13 -13
- package/dist/{chunk-HBBXDGDD.js → chunk-I7BROL77.js} +1 -1
- package/dist/{chunk-H4JCMK36.js → chunk-JQXD3TDE.js} +1 -1
- package/dist/{chunk-5THLKXTH.js → chunk-L2Y3PF2R.js} +1 -1
- package/dist/{chunk-LDEEFLE3.js → chunk-LQV5FZTQ.js} +4 -4
- package/dist/chunk-MEHLY5Q4.js +1 -0
- package/dist/chunk-PAOZMXEI.js +5 -0
- package/dist/chunk-R5KEFI55.js +8 -0
- package/dist/{chunk-2E2SXDYQ.js → chunk-TNGOL65V.js} +1 -1
- package/dist/chunk-WEIE2FBC.js +1 -0
- package/dist/chunk-XJ2WXGFJ.js +65 -0
- package/dist/copy/index.js +13 -13
- package/dist/drag/index.js +1 -1
- package/dist/easel/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.d.ts +5 -6
- package/dist/screen/components/NodeContextMenu.js +1 -1
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.js +1 -1
- package/dist/screen/components/SectionScreenShell.js +15 -15
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/key-scope.js +1 -1
- package/dist/screen/lib/puck/preview-dom.js +1 -1
- package/dist/screen/lib/puck/style-clipboard.js +1 -1
- package/dist/screen/lib/puck/use-section-ops.js +1 -1
- package/dist/screen/lib/screen-parts.d.ts +5 -0
- package/dist/screen/lib/screen-parts.js +1 -1
- package/dist/screen/screen.css +37 -0
- package/dist/strings/index.js +1 -1
- package/dist/text-styles/index.js +21 -21
- package/package.json +1 -1
- package/dist/chunk-47CD7ULN.js +0 -1
- package/dist/chunk-47PYYMFM.js +0 -8
- package/dist/chunk-LEZFSSQN.js +0 -5
- package/dist/chunk-PI6RFJR4.js +0 -1
- package/dist/chunk-RVZJ52EP.js +0 -63
|
@@ -0,0 +1,65 @@
|
|
|
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-TNGOL65V.js";import{useEaselKeyTarget as a,useEaselUndoKeys as c,useEaselSaveKey as p,editorRootFocus as u}from"./chunk-I7BROL77.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-MEHLY5Q4.js";import{useSectionOps as v}from"./chunk-WEIE2FBC.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-R5KEFI55.js";import{keepsSharedSections as z,sharedSectionsOf as C}from"./chunk-43AEUUNQ.js";import{PanelHideButton as I,SidePanelHead as N,PanelShowStrip as O}from"./chunk-SINAM2IT.js";import{offeredChoices as B}from"./chunk-M2Z775ZC.js";import{useScreenSaveSwitch as P,useScreenNodeKeys as $,useScreenPinned as M,useScreenDocumentLabel as j,useScreenCanvasFrame as A,useScreenInspectorPanel as L,useScreenDevices as T,useScreenPickFollowsSelection as E,useScreenLeftView as R,SELECTION_MODE as F,sameInspectorMode as D,useScreenBridges as H,useScreenBlockRules as V,useScreenBlockLook as W,useScreenStorageNamespace as U,useScreenNotify as J,useScreenCanvasHead as Y,isSlotMode as G,useScreenStyleClipboard as K,useScreenDocumentPass as Q,useScreenCanvasDrag as Z,ScreenCanvasTargetProvider as X,isPinnedFirst as _,isPinnedLast as q,screenSlotsOf as ee}from"./chunk-PAOZMXEI.js";import{MediaPopup as ne}from"./chunk-2G6MAXPY.js";import{useNodeClipboard as te,useNodeContextMenu as oe}from"./chunk-6FWAE2RN.js";import{PageEditGuardNotices as re}from"./chunk-UJ46J7QW.js";import{useScreenDocument as ie}from"./chunk-276MBG5P.js";import{requestMediaPick as le}from"./chunk-UNVKPVZW.js";import{useMediaPanel as se,usePanelPick as de,useMediaBrowsing as ae,useOpenMediaBrowse as ce,useMediaPlace as pe}from"./chunk-FHCKFOCD.js";import{useEaselSession as ue}from"./chunk-O7Q4DDJT.js";import{useEaselHost as he,useHostEscape as fe}from"./chunk-MQA7OFRA.js";import{LayersIcon as me,MediaIcon as ge}from"./chunk-XFYFKITX.js";import{DEFAULT_SCREEN_WORDS as ye}from"./chunk-23DYNW6S.js";import{heldStyle as ve,styleShortcut as ke}from"./chunk-V7U33NF2.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as be}from"./chunk-6WY6ZXJG.js";import{useEasel as Se,useEaselApi as we,CanvasPassThroughContext as xe,CanvasSharedContext as ze}from"./chunk-EFHV56BO.js";import{TreeRow as Ce,Subtree as Ie,LayersTree as Ne,TreeGroupLabel as Oe,TreeRowAction as Be,TreeSeam as Pe}from"./chunk-A6Z4SD3I.js";import{DEFAULT_TREE_WORDS as $e}from"./chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as Me}from"./chunk-WK3AFPXY.js";import{toItemSelector as je,useNodeOps as Ae,clickPick as Le}from"./chunk-BSHIQIZC.js";import{EaselTopBar as Te,EaselIconButton as Ee,TopBarCluster as Re,DeviceSwitch as Fe,InspectorIconButton as De,PanelResizeHandle as He,MAX_PANEL_W as Ve,MIN_PANEL_W_BY_SIDE as We,panelWidthVars as Ue}from"./chunk-ZG6PVMC3.js";import{DEFAULT_NOTICE_WORDS as Je,DEFAULT_CHROME_WORDS as Ye}from"./chunk-AJSDWWJW.js";import{holderOf as Ge,nameOrSomeone as Ke}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as Qe}from"./chunk-RE4LP46F.js";import{useWords as Ze}from"./chunk-MFIRYGHW.js";import{insertSeams as Xe,CanvasDragLayer as _e,CanvasInsert as qe}from"./chunk-LQV5FZTQ.js";import{DEFAULT_DRAG_WORDS as en}from"./chunk-KAML3KQH.js";import{createDragSession as nn,useTreeDrag as tn,gapToMoveIndex as on}from"./chunk-3S5N4HLJ.js";import{ROOT_ID as rn,ROOT_SLOT as ln,zoneKey as sn,parseZoneKey as dn,find as an,DataError as cn}from"./chunk-K7BTCBWD.js";import{useCanvasFrame as pn,LIST_SELECTOR as un,BLOCK_SELECTOR as hn,useCanvasTyping as fn,useCanvasEvent as mn,nodeIdAt as gn,frameRectToHost as yn,BLOCK_ATTRIBUTE as vn,drawnBox as kn}from"./chunk-QIDRJH3S.js";import{rootRowName as bn,slotChildRowName as Sn,slotChildRenameProp as wn,sectionRenameProp as xn}from"./chunk-BHRC3ASL.js";import{ROOT_ZONE as zn,blockNodeActions as Cn,TREE_MAX_DEPTH as In,childSlotsOf as Nn,slotFieldsOf as On,newNodeId as Bn,slotChildrenIn as Pn,nestsInTree as $n}from"./chunk-PLVEGYK6.js";import{queryMainCopy as Mn}from"./chunk-LF3FUSCQ.js";import{useRef as jn,useMemo as An,useState as Ln,useEffect as Tn,useCallback as En,useLayoutEffect as Rn,Fragment as Fn,useId as Dn}from"react";import{ColoredBadge as Hn,Button as Vn,Tabs as Wn,toast as Un,readMediaFileDrag as Jn,Tooltip as Yn,groupColors as Gn,Dialog as Kn,FormField as Qn,Input as Zn,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=Ze("screen",ye).shared,[r,i]=Ln(e),[l,s]=Ln(!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(Kn,{open:!0,size:"sm",title:o.makeShared,description:o.makeSharedHint,onClose:t,initialFocus:a,footer:/* @__PURE__ */dt(at,{children:[
|
|
3
|
+
/* @__PURE__ */st(Vn,{variant:"secondary",onClick:t,children:o.cancel}),
|
|
4
|
+
/* @__PURE__ */st(Vn,{variant:"primary",loading:l,disabled:!r.trim(),onClick:()=>{c()},children:o.makeShared})]}),children:/* @__PURE__ */st("form",{onSubmit:e=>{e.preventDefault(),c()},children:/* @__PURE__ */st(Qn,{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=an(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]=Ln({}),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=yn(l,{left:0,top:0,width:r.innerWidth,height:r.innerHeight},e),a={};for(const o of n){const n=Mn(t,`[${vn}="${r.CSS?.escape?r.CSS.escape(o.id):o.id}"]`),i=n?kn(n):null;if(!i||0===i.height){a[o.id]=null;continue}const s=yn(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(Yn,{content:e.reach,children:/* @__PURE__ */dt(Hn,{colorClass:Gn("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:Gn("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=`${un}, ${hn}`;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 un=he(),yn=un.panels?.Toolbar,vn=(un.panels?.useRight??St)(),{target:kn,docId:Dn,capabilities:Yn,currentSlug:Gn,siteId:Kn,onPublish:Qn,saveState:Zn,saveConflict:it,retrySave:wt,toggleAutoSave:xt,flushSave:zt,access:Ct,saveUnreachable:It=!1,readOnly:Nt,readOnlyReason:Ot=null}=ie(),Bt=P(),Pt=$(),{mediaEditing:$t,hasEditGuard:Mt,hasPinnedChrome:jt}=Yn,{appState:At,dispatch:Lt,history:Tt,selectedItem:Et,getSelectorForId:Rt,config:Ft}=Se(e=>e),Dt=M(),{first:Ht,firstGroup:Vt,lastGroup:Wt,isSectionGroup:Ut,sectionGroupZone:Jt,panelOf:Yt}=Dt,Gt=Yt(Ht),Kt=e=>_(Dt,e),Qt=e=>q(Dt,e),Zt="node"===Dt.firstRow,Xt=Dt.band??null,_t=Ze("screen",ye),qt=Ze("tree",$e),eo=Ze("drag",en),no=Ze("notice",Je),to=Ze("lock",Qe),oo=Ze("menu",Me),ro=Ze("styleClipboard",be),io=Ze("chrome",Ye),lo=j()??`/${Gn}`,so=A(),ao=L(),co=v({readOnly:Nt}),po=v({readOnly:Nt,foldIntoHistory:!0}),uo=jn(null),ho=we(),fo=An(()=>({...co,select:e=>{uo.current=e,co.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=ho.config;uo.current=je(e,t,n)}co.commitDocument(e,n)}}),[co,ho]),mo=At.ui,go=mo.leftSideBarVisible,yo=mo.rightSideBarVisible,{options:vo,widths:ko,initial:bo,fluid:So,fit:wo}=T(),[xo,zo]=Ln(bo),Co=se(),Io=$t&&null!==Co;de(),ae();const No=ce();E(Et?.props.id);const{read:Oo,write:Bo,forSelection:Po}=R(),[$o,Mo]=Ln(Oo);Tn(()=>{Bo($o)},[$o]);const[jo,Ao]=Ln(0),Lo=jn(null),To=jn(null),Eo=pn(To,{readySelector:gt}),Ro=fn(Eo),Fo=a(To);c(To,Eo);const Do=S(),Ho=Ge(Ct),Vo={state:Zn,offline:Do||Zn.failed&&It,readOnlyReason:Ot,editing:Ho?no.editing({name:Ke(Ho.name,to),noun:_t.noun}):null,conflict:null!=it,notSaving:_t.bar.notSaving},Wo=()=>{Nt||(Zn.failed?wt():zt())};p(To,Eo,Wo);const[Uo,Jo]=Ln(!1),Yo=jn(!1),[Go,Ko]=Ln(null),[Qo,Zo]=Ln([]),[Xo,_o]=Ln(F),qo="puck"===Xo.kind,er=o(Xo,Et?.props.id),[nr,tr]=Ln(null);Tn(()=>{nr&&(r(),tr(null))},[nr]);const or=jn(Rt);or.current=Rt;const rr=En((e,{scroll:n})=>{Mo(n=>Po(e,n)),n&&tr(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=or.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&jr(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),ir=jn(null);Tn(()=>{const e=ir.current;ir.current=null;const n=null==Et?.props.id?null:String(Et.props.id);_o(t=>e&&e.id===n?e.mode:"part"===t.kind&&"nodeId"in t&&t.nodeId===n?t:Yt(Et?.type)??F);const t=Et?.props.id,o=uo.current;if(uo.current=null,!t)return;const r=Rt(t);rr(String(t),{scroll:!i(o,r??null,zn)})},[Et?.props.id,rr]);const lr=En(e=>{_o(n=>D(n,e)?n:e),Lt({type:"setUi",ui:{rightSideBarVisible:!0}})},[Lt]),sr=jn(()=>{});sr.current=(e,n)=>{const t=e?Bi(e.zone??zn)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==Et?.props.id?null:String(Et.props.id);_o(e=>D(e,n)?e:n),o!==r&&(ir.current={id:o,mode:n},fo.select(e))};const dr=En((e,n)=>sr.current(e,n),[]),ar={kind:Xo.kind,mode:Xo,open:lr,show:e=>_o(e),reveal:()=>{yo||Lt({type:"setUi",ui:{rightSideBarVisible:!0}})},select:dr},cr=H(ar,{data:At.data,selected:Et??null,zoneOf:e=>Rt(e)?.zone,readOnly:Boolean(Nt),select:e=>{_o(F),fo.select({index:e})},replace:(e,n)=>fo.replaceComponent(zn,e,n),scrollTo:e=>l(e)},{device:xo,refreshes:jo},{setView:Mo,reveal:()=>{go||Lt({type:"setUi",ui:{leftSideBarVisible:!0}})}}),pr=cr.resolveLeftView?cr.resolveLeftView($o):"sections",ur=V(),{isLockedBlock:hr,duplicateBlocked:fr,nestDepth:mr,newSectionNode:gr,canAddTo:yr,blockIsOffered:vr}=ur,kr=W(),{labelAtLevel:br,Icon:Sr,useProducts:wr}=kr,xr=kr.rowName?(e,n,t)=>kr.rowName(e,n,t):void 0,zr=En(e=>{Lt({type:"setUi",ui:{rightSideBarVisible:!0}}),l(e),rr(e,{scroll:!0})},[Lt,rr]),{selectNode:Cr,openPartId:Ir}=y({mode:Xo,setMode:_o,onOpenPart:zr}),[Nr,Or]=Ln(null);fe(null!==Nr,()=>Or(null));const Br=f(U()),Pr=Br.collapsed,$r=Br.panelWidths,[Mr,jr]=Ln(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(Pr);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
|
|
13
|
+
return new Set}});Tn(()=>{try{window.localStorage.setItem(Pr,JSON.stringify([...Mr]))}catch{}},[Mr]);const[Ar,Lr]=Ln(()=>{if("undefined"==typeof window)return{...m};try{const e=window.localStorage.getItem($r);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($r,JSON.stringify(Ar))}catch{}},300);return()=>clearTimeout(e)},[Ar]);const Tr=En((e,n)=>Lr(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),Er=En(e=>Tr("left",e),[Tr]),Rr=En(e=>Tr("right",e),[Tr]),Fr=e=>Mr.has(e),Dr=e=>jr(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Hr=jn(!1),Vr=jn(null);Tn(()=>{if(Hr.current&&!Uo){const e=Vr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??To.current?.querySelector(`button[aria-label="${CSS.escape(_t.add.title)}"]`))?.focus(),Vr.current=null}Hr.current=Uo},[Uo]),Tn(()=>{if(!Uo||!Fo)return;const e=e=>{"Escape"===e.key&&sl()};return Fo.addEventListener("keydown",e),()=>Fo.removeEventListener("keydown",e)},[Uo,Fo]),fe(Uo,()=>sl()),Tn(()=>{!go&&Uo&&(Jo(!1),Ko(null),Yo.current=!1)},[go]);const Wr=J(),Ur=(e,n="success",t)=>{if(Wr)return void(t?Wr(e,"error"===n?"error":"info",t):Wr(e,"error"===n?"error":"info"));const o={sound:!1,action:t?.action,onClose:t?.onClose};"error"===n?Un.error(e,{...o,duration:t?.duration??3200}):Un.success(e,{...o,duration:t?.duration??1900})},Jr=jn(null),[Yr,Gr]=Ln(0),[Kr,Qr]=Ln(0),Zr=Y(),Xr=jn(null),_r=e=>Math.max(0,e.clientHeight-(Xr.current?.offsetHeight??0));Tn(()=>{const e=Jr.current;if(!e)return;const n=()=>{Gr(e.clientWidth),Qr(_r(e))};n();const t=new ResizeObserver(n);return t.observe(e),Xr.current&&t.observe(Xr.current),()=>t.disconnect()},[]),Rn(()=>{Jr.current&&(Gr(Jr.current.clientWidth),Qr(_r(Jr.current)))},[Ar,go,yo]);const qr=xo===So?Yr>0?Yr:ko[So]:ko[xo],ei=Yr>0?Math.min(Yr/qr,"shrink"===wo?1:2):1,ni=qr*ei,ti=Yr>0&&ni>Yr+1,oi={width:ni,height:Kr||"100%",flex:"none",position:"relative"},ri={width:qr,height:Kr?Kr/ei:"100%",maxHeight:"none",transform:1!==ei?`scale(${ei})`:void 0,transformOrigin:"top left"},ii=()=>Lt({type:"setUi",ui:{leftSideBarVisible:!go}}),li=()=>Lt({type:"setUi",ui:{rightSideBarVisible:!yo}}),si=e=>{Uo&&(Jo(!1),Ko(null),Yo.current=!1,go&&$o===e)||(Mo(e),go||Lt({type:"setUi",ui:{leftSideBarVisible:!0}}))},di=()=>{_o(F),fo.select(null),d()},ai=()=>{_o(Gt??F),yo||Lt({type:"setUi",ui:{rightSideBarVisible:!0}})},ci=At.data.content??[],pi=()=>{const e=ci.findIndex(Kt),n=ci.findIndex(Qt);return{floor:e>=0?e+1:0,cap:n>=0?n:ci.length}},ui=Ft,hi=ur.stripCopy,fi=n=>e(n,hi),mi=te(),gi=Ae({data:At.data,config:ui,readOnly:Boolean(Nt),clipboard:mi,strip:hi?e=>hi(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==rn||e.slot!==ln)return{min:0,max:n-1};const{floor:t,cap:o}=pi();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&_o(F);const t=void 0===n||"node"===n?.kind?n:null;fo.commitDocument(e,t)}}),yi=ue(),[vi,ki]=Ln(null),bi=e=>{const n=ci.find(n=>String(n.props.id)===e),t=Dt.shared;n&&t&&gi.swap(e,t.detach(n))},Si=e=>{const n=an(At.data,Ft,e);if(!n)return!1;const t=sn(n.place),o=n.node,r=t===zn?Ii(o):Di(o),i=t===zn?Dt.shared?.usedOn(o):null;return!!gi.remove(e)&&(Ur(i?_t.shared.removed({count:Math.max(0,i.length-1)}):_t.deleted({name:r}),"success",{duration:8e3,action:{label:_t.bar.undo,onClick:()=>{gi.restore(n.node,n.place)}}}),!0)},wi={...gi,remove:Si},xi=e=>br(e,"block",Ft.components[e]?.label??e),zi=En(e=>Ft.components[e]?.defaultProps??{},[Ft]),Ci=e=>br(e,"section",xi(e)),Ii=e=>bn({type:e.type,props:e.props??{}},Ci(e.type),xr),{nodeAddresses:Ni,zoneItems:Oi}=An(()=>{const e=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map,t=(o,r,i)=>{n.set(r,o),o.forEach((n,o)=>{const l=String(n.props?.id??"");if(l&&e.set(l,{zone:r,index:o}),i>=In)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of Nn(Ft,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(ci,zn,0),{nodeAddresses:e,zoneItems:n}},[ci,Ft]),Bi=En(e=>Oi.get(e)??[],[Oi]),Pi=e=>{const n=Ni.get(e);return n?Bi(n.zone)[n.index]:void 0},$i=e=>ee(ur,Ft,e),Mi=e=>{if(!ur.slotsOf||e===zn)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=Pi(e.slice(0,n));if(!t)return null;const o=$i(t).filter(e=>e.rung),r=o.findIndex(t=>t.slot===e.slice(n+1));return r<0?null:{node:t,slot:o[r],position:r}},ji=(()=>{if(!G(Xo))return null;const e=`${Xo.nodeId}:${Xo.slot}`;return Mi(e)?.slot.panel===Xo.kind?e:null})(),Ai=jn(null);Tn(()=>{const e=Ai.current;if(Ai.current=null,!ji||!G(Xo))return;const n=Xo.nodeId;rr(n,{scroll:e!==ji}),jr(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[Xo]);const Li=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=Ni.get(e);n&&(n.zone===zn?el(n.index):Nl(n.zone,n.index,e,Pi(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&ji!==i&&(Ai.current=i),dr(null,r),yo||Lt({type:"setUi",ui:{rightSideBarVisible:!0}}),l(o)},Ti=(e,n,t)=>{const o=`${e}:${n}`;if(jr(n=>{if(!n.has(o)&&!n.has(e))return n;const t=new Set(n);return t.delete(o),t.delete(e),t}),!t)return;ji!==o&&(Ai.current=o);dr(null,{kind:t,nodeId:e,slot:n})},Ei=(e,n,t)=>{if(Nt||!ur.moveSlot)return;const o=Pi(e),r=o?$i(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:vt,index:n},s=on(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=ur.moveSlot(e,n,s);"string"==typeof d&&Ti(e,d,i.panel)},Ri=wr(),Fi=An(()=>{const e=/* @__PURE__ */new Map;for(const n of Ri??[])e.set(n.slug,n.name);return e},[Ri]),Di=e=>Sn(e,xi,kr.plainText,e=>Fi.get(e),kr.rowName),Hi=(e,n)=>{const t=Ft.components[e.type]?.fields,o=n===zn||ql(n)?"section":"block",r=n===zn&&(Kt(e)||Qt(e)||Ut(e.type)),i="block"===o?wn(t):r?null:xn(t);return kr.renamePropOf?kr.renamePropOf(e,o,i):i},Vi=(e,n,t,o)=>{if(!(!Nt&&Nr?.zone===e&&Nr.index===n))return;const r=(t,o)=>{Or(null),o&&((e,n,t)=>{const o=Bi(e)[n];if(!o)return;const r=Hi(o,e);r&&fo.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":_t.rename,onClick:e=>e.stopPropagation(),onBlur:e=>r(e.currentTarget.value,!0),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),r(e.currentTarget.value,!0)):"Escape"===e.key&&(e.preventDefault(),r("",!1))}},t)},Wi=t(K(),ro),Ui=Wi.scope({target:kn,siteId:Kn,docId:Dn}),Ji=Ft,Yi=(e,n)=>n===zn?Ci(e):xi(e),Gi=(e,n,t)=>{const o=Wi.plan(Ui,t,Yi(t.type,e),Ji);o&&(o.changed&&fo.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),Ur(o.message))},Ki=oe({nodesIn:Bi,nodeAt:(e,n)=>Bi(e)[n]??null,labelOf:(e,n)=>n===zn?Ci(e):xi(e),renamePropOf:Hi,beginRename:(e,n)=>Or({zone:e,index:n}),history:{hasPast:Tt.hasPast,hasFuture:Tt.hasFuture,back:()=>Tt.back(),forward:()=>Tt.forward()},openPageSettings:()=>{fo.select(null),_o(F)},pageSettingsLabel:_t.pageSettings,words:{menu:oo,styleClipboard:ro,screen:_t.menu},readOnly:Boolean(Nt),collapseAll:()=>jr(new Set(Bi(zn).map(e=>String(e.props.id)))),onPasteRefused:e=>Ur(e?_t.pasteRefused({name:e.label}):_t.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>ts(e,n),menuRows:(e,n,t)=>{const o=cr.menuRows?.(e,n,t)??null,r=((e,n)=>{const t=Dt.shared;if(!t||n!==zn)return null;const o=t.usedOn(e);if(o){const n={pick:[{label:_t.shared.onPages({count:o.length}),onClick:()=>{},children:o.map(e=>({label:e.title,onClick:()=>t.openPage(e)}))}]};return Nt||hr(e.type,e)?n:{...n,change:[{label:_t.shared.detach,onClick:()=>bi(e.props.id)}],remove:[{label:_t.shared.removeFromPage,danger:!0,onClick:()=>{Si(e.props.id)}}]}}return Nt||Kt(e)||Qt(e)||Ut(e.type)?null:z(yi)?{change:[{label:_t.shared.makeShared,onClick:()=>ki({id:e.props.id,name:Ii(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=>hr(e.type,e),duplicateBlocked:e=>fr(At.data,e),permits:e=>{const n=Cn(Ft,e.type);return Dt.shared?.usedOn(e)?{...n,delete:!1}:n},nodeOps:wi,isPinned:(e,n)=>n===zn&&(Kt(e)||Qt(e)),sectionBand:pi,locate:e=>Ni.get(e)??null,rowNameOf:(e,n)=>n===zn?Ii(e):Di(e),selectAt:(e,n,t,o)=>{e===zn?el(n):Nl(e,n,t,o??"")},slotRung:e=>{const n=Mi(e);return n?.slot.panel?{label:n.slot.label,select:()=>Li(n.node,n.slot,!1)}:null},style:{held:()=>ve(Ui),canCopy:e=>Wi.rows(Ji,e).some(e=>!1!==e.counted),copy:(e,n)=>Wi.copy(Ui,e,Yi(e.type,n),Ji),paste:(e,n,t)=>Gi(e,n,t)},keys:Pt?{target:Fo,selected:()=>{const e=At.ui.itemSelector;return e?{zone:e.zone??zn,index:e.index}:null},held:()=>mi.get(),readOnly:Boolean(Nt),onDone:({done:e,name:n})=>{"copied"===e&&Ur(_t.copied({name:n}))}}:void 0},Eo),Qi=jn({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});Tn(()=>{Qi.current={copy:(e,n)=>Wi.copy(Ui,e,Yi(e.type,n),Ji),paste:Gi,at:()=>{const e=At.ui.itemSelector;if(!e)return null;const n=e.zone??zn,t=Bi(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(Nt)}});const Zi=En(e=>{const n=ke(e);if(!n)return;const t=Qi.current,o=t.at();o&&(e.preventDefault(),"copy"===n?t.copy(o.node,o.zone):t.readOnly||t.paste(o.zone,o.index,o.node))},[]);Tn(()=>{if(!Fo)return;const e=e=>Zi(e);return Fo.addEventListener("keydown",e),()=>Fo.removeEventListener("keydown",e)},[Zi,Fo]),mn(Eo,"keydown",Zi);const Xi=ci.map(e=>e.props.id).join("|");Tn(()=>{const e=Eo?.document??null,n=Eo?.window??null;let t=0;const o=[],r=()=>{if(!e)return void Zo(e=>e.length?[]:e);const n=ci.findIndex(Qt),t=n>=0?n:ci.length,o=n=>{const t=ci[n]?.props?.id;return null==t?null:Mn(e,`[data-puck-component="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(hn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=ci.length>0&&!Kt(ci[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})}Zo(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()}},[Eo,Xi,xo,ei,go,yo,Et?.props.id]);const _i=Eo?.document??null,qi=Eo?.window??null;Tn(()=>{const e=Lo.current;if(!e||!_i||!qi)return;const n=[],t=()=>{const n=Mn(_i,`[data-puck-component="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&qi.scrollTo({left:qi.scrollX,top:qi.scrollY+t,behavior:"instant"}),!0};return Lo.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[_i,qi]);const el=e=>{_o(F),fo.select({index:e}),cr.sectionPressed?.(ci[e]);const n=ci[e]?.props?.id;n&&l(n)},nl=e=>{const{floor:n,cap:t}=pi(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=Et&&Xo.kind!==Gt?.kind?ci.findIndex(e=>e.props.id===Et.props.id):-1;return o(r>=0?r+1:t)},tl=(e,n)=>{const{floor:t,cap:o}=pi(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(fo.reorderComponent(zn,e,i),fo.select({index:i}),{moved:!0,dest:i})},ol=(e,n,t,o)=>{_o(F),fo.select(o?{index:o.index,zone:o.zone}:{index:e}),l(n),Ur(_t.sectionAdded({name:t}))},rl=(e,n)=>{const t=nl(n),o=gr(e,{nodeDefaults:zi,newNodeId:Bn,sectionLabel:Ci,blockIsOffered:vr}),r=o?fo.insertNode(zn,t,o):fo.insertSection(e,t);return ol(t,r,Ci(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 Nn(Ft,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=yr(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},il=e=>ll(zn,e),ll=(e,n)=>{Vr.current=document.activeElement??null,Ko(null===n?null:{zone:e,index:n}),Jo(!0),go||(Yo.current=!0,Lt({type:"setUi",ui:{leftSideBarVisible:!0}}))},sl=()=>{Jo(!1),Ko(null),Yo.current&&Lt({type:"setUi",ui:{leftSideBarVisible:!1}}),Yo.current=!1},dl=(e,n)=>kr.rowName?n?Kt(e)?kr.rowName(e,"section",_t.header):Qt(e)?kr.rowName(e,"section",_t.footer):Ut(e.type)?kr.rowName(e,"section",xi(e.type)):Ii(e):Di(e):n?Ci(e.type):xi(e.type),al=e=>n=>{e()},cl=(e,n,t)=>{if(Nt)return null;const o=Bi(e)[n];return o&&!Cn(Ft,o.type).delete||o&&hr(o.type,o)?null:/* @__PURE__ */st(Be,{kind:"delete",label:e===zn&&o&&Dt.shared?.usedOn(o)?_t.shared.removeFromPage:_t.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=Bi(e)[n]?.props?.id;null!=t&&Si(String(t))})(e,n),children:/* @__PURE__ */st(tt,{size:15})})},pl=e=>kr.rowPreview?.(e)||void 0,ul=e=>kr.rowMarks?.(e)??void 0,hl=(e,n,t)=>kr.rowActions?.(e,n,t)??null,fl=(e,n,t,o)=>{if(Nt)return null;if(hr(t.type,t))return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
|
|
15
|
+
return st(Be,{kind:"eye",label:r?_t.showNamed({name:o}):_t.hideNamed({name:o}),onClick:()=>gl(e,n,t),children:/* @__PURE__ */st(r?ot:rt,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},ml=e=>Vs(zn,e),gl=(e,n,t)=>{fo.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},yl=e=>On(Ft,e),vl=e=>Nn(Ft,e),kl=e=>ur.slotsOf?$i(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:Pn(e,n.slot)})):[{slot:null,rung:null,kids:vl(e)}],bl=e=>ur.slotsOf?kl(e).flatMap(e=>e.kids):vl(e),Sl=e=>Boolean(ur.slotsOf)&&$i(e).some(e=>e.rung),wl=(e,n,t)=>null===t?void 0===n?yr(e):yr(e,n):yr(e,n,t),xl=(e,n,t)=>{const o=$n(Ft,e.type,n)&&(t||bl(e).length>0||Sl(e));return{collapsible:o,folded:o&&Fr(String(e.props.id))}},zl=(e,n,t)=>kl(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>xl(e,r,t(e.type)).collapsible?[String(e.props.id),...zl(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),Cl=e=>bl(e).length>0||Sl(e)||Boolean(yr(e.type)),Il=e=>Boolean(yr(e)),Nl=(e,n,t,o)=>{if(_o(F),yr(o)?.spec?.slider){const t=e.split(":")[0];s(t,n),fo.select({index:n,zone:e}),l(t)}else fo.select({index:n,zone:e}),l(t)},Ol=(e,n,t,o,r)=>{const i=`${e}:${n}`;fo.insertComponent(i,t,o),yr(r)?.spec?.slider?requestAnimationFrame(()=>{s(e,o),fo.select({index:o,zone:i})}):fo.select({index:o,zone:i})},Bl=jn(/* @__PURE__ */new Set);Tn(()=>{ci.forEach(e=>{const n=yr(e.type)?.spec;if(!n)return;const t=e.props.id;if(Bl.current.has(t))return;Bl.current.add(t);if((Array.isArray(e.props[n.slot])?e.props[n.slot]:[]).length>0)return;if(n.skipSeed?.(e.props))return;const o=`${t}:${n.slot}`,r=n.legacy?.(e.props)??[];(r.length?r:n.seeds(zi)).forEach((e,t)=>po.seedChild(o,t,n.childType,e))})},[ci,po,zi]);const Pl=jn(/* @__PURE__ */new Set);Tn(()=>{ci.forEach((e,t)=>{const o=e.props.id;if(Pl.current.has(o))return;const r=n(e,yl(e.type));Pl.current.add(o),r&&po.replaceComponent(zn,t,{...e,props:r})})},[ci,po]),Q(po,Ft);const $l=ci.findIndex(Qt),Ml=$l>=0?ci[$l]:null,jl=Zt?ci.findIndex(Kt):-1,Al=jl>=0?ci[jl]:null,Ll=Dt.groupTab,Tl=An(()=>Ll?e=>Ut(e.type):void 0,[Ll]),El=Boolean(Dt.groupBadge),Rl=Dt.sharedReach,Fl=e=>Rl?.(e)??void 0,Dl=An(()=>Rl?new Set(ci.filter(e=>Fl(e)).map(e=>String(e.props.id))):null,[ci,Rl]),Hl=An(()=>Dl?e=>Dl.has(e):void 0,[Dl]),Vl=Dt.first?Rl?.({type:Dt.first,props:{id:""}})??void 0:void 0,Wl=Dt.groupBadge?/* @__PURE__ */st("span",{className:"es-tree-group-badge",children:/* @__PURE__ */st(Hn,{tone:"info",size:"xs",children:Dt.groupBadge})}):void 0,Ul=ci.find(e=>e.type===Vt)??null,Jl=ci.find(e=>e.type===Wt)??null,Yl=$l>=0?$l:ci.length,Gl=[];ci.forEach(e=>{Qt(e)||(Cl(e)&&Gl.push(String(e.props.id)),Gl.push(...zl(e,1,Il)))}),Ml&&(Gl.push(String(Ml.props.id)),Gl.push(...zl(Ml,1,Il)));const Kl=Gl.length>0&&Gl.every(e=>Mr.has(e)),Ql=e=>{const n=kr.blockRowName(e,xi);return kr.rowName?kr.rowName(e,"block",n):n},Zl=(e,n,t,o)=>{const r=Bi(e)[t];if(!r)return;const i={...dn(e),index:t},l={...dn(n),index:Math.min(Math.max(o,0),Bi(n).length)},s=on(i,l);if(e!==n||s!==t)try{gi.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof cn))throw e}},Xl=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of vl(e))n.add(r),t(o)};for(const t of yl(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},_l=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Ni.get(n);if(!e)return null;if(e.zone===zn)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},ql=e=>{const n=e.slice(0,e.indexOf(":")),t=ci.find(e=>Ut(e.type)&&String(e.props.id)===n);return t&&Jt(n)===e?t:null},es=(e,n)=>{const t=ql(e);return!t||(!Dt.groupAccepts||Dt.groupAccepts(t.type,n,Bi(e).length))},ns=(e,n,t)=>{if(e.rung){const t=Pi(e.rung.nodeId),o=t?$i(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 is(e.add,n);const o=sn(n);if(Ut(e.type))return!1;const r=ql(o),i=ql(e.zone);if(r||i)return!(!r||!i)&&(!(r!==i&&!es(o,e.type))&&(n.index>=0&&n.index<=Bi(o).length));if(e.zone===zn||o===zn){if(e.zone!==o)return!1;const{floor:t,cap:r}=pi();return n.index>=t&&n.index<=r}if(n.index<0||n.index>Bi(o).length)return!1;if(e.zone===o)return!0;const l=Ml&&!Dt.lastIsOpen?String(Ml.props.id):null;return(!l||_l(e.zone)!==l&&_l(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??Bi(e)[t];if(!r)return!1;const i=n.split(":")[0],l=Ni.get(i),s=l?Bi(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&Xl(r).has(n))return!1;const d=yr(s.type,mr(At?.data,s.type,i),n.slice(n.lastIndexOf(":")+1));return!!d&&(!!(d.choices?d.choices.some(e=>e.type===r.type):d.spec?.childType===r.type)&&!d.spec?.addBlocked?.(Bi(n),r))})(e.zone,o,e.index,t)},ts=(e,n)=>{const t=sn(e.from),o=e.node;return t===sn(n)?es(t,o.type):ns({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},os=e=>{const n=e.slice(0,e.indexOf(":")),t=Ni.get(n),o=t?Bi(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=yr(o.type,mr(At?.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=B(r.choices??(r.spec?[{type:r.spec.childType,label:xi(r.spec.childType)}]:[])),l=Mi(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:dl(o,t.zone===zn)}},rs=(e,n)=>{if("section"!==e.kind)return e;const t=sn(n);return t===zn||ql(t)?e:os(t)?.choices.some(n=>n.type===e.type)?{kind:"block",type:e.type}:e},is=(e,n)=>{const t=rs(e,n),o=sn(n);if("shared"===t.kind){if(o!==zn||!Dt.shared?.nodeOf(t.section))return!1;const{floor:e,cap:r}=pi();return n.index>=e&&n.index<=r}if("block"!==t.kind){if(ql(o)){const e="section"===t.kind?t.type:t.template.node.type;return es(o,e)&&n.index>=0&&n.index<=Bi(o).length}if(o!==zn)return!1;const{floor:e,cap:r}=pi();return n.index>=e&&n.index<=r}if(o===zn)return!1;const r=os(o);return!(!r||!r.choices.some(e=>e.type===t.type))&&!r.target.spec?.addBlocked?.(Bi(o))},ls=(e,n)=>{const t=rs(e,n);if("block"!==t.kind&&ql(sn(n)))return void((e,n,t)=>{const o="section"===e.kind?e.type:"template"===e.kind?e.template.node.type:null;if(o&&es(n,o)){if("section"===e.kind)fo.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;fo.insertNode(n,t,fi(e.template.node))}_o(F),fo.select({index:t,zone:n})}})(t,sn(n),n.index);if("section"===t.kind)return void rl(t.type,n.index);if("template"===t.kind)return void((e,n,t)=>{const o=nl(t),r=fo.insertNode(zn,o,n);ol(o,r,e)})(t.template.name,fi(t.template.node),n.index);if("shared"===t.kind){const e=Dt.shared?.nodeOf(t.section);if(!e)return;const o=nl(n.index);return void(gi.restore(e,{parentId:rn,slot:ln,index:o})&&ol(o,e.props.id,t.section.title))}const o=sn(n),r=os(o);r&&(r.target.spec?Ol(r.parentId,r.target.slot,t.type,n.index,r.parent.type):((e,n,t)=>{fo.insertComponent(e,n,t),_o(F),fo.select({index:t,zone:e})})(o,t.type,n.index))},ss=(e,n)=>{e.media?function(e){const n=Es();if(!n||!As)return;Fs(n).then(n=>{n&&function(e,n){if(!As)return;const t=As.create(e,{nodeDefaults:zi,newNodeId:Bn,sectionLabel:Ci,blockIsOffered:vr}),o=sn(n);if(o===zn){const e=nl(n.index),o=fo.insertNode(zn,e,t);return void ol(e,o,Ci(t.type))}fo.insertNode(o,n.index,t),_o(F),fo.select({index:n.index,zone:o})}(n,e)})}(n):e.rung?Ei(e.rung.nodeId,e.index,n.index):e.add?ls(e.add,n):e.zone===zn?tl(e.index,n.index):Zl(e.zone,sn(n),e.index,n.index)},[ds]=Ln(()=>nn()),as=tn({keyOf:e=>e.id,readOnly:Boolean(Nt),session:ds,canDrop:ns,onDrop:ss,onStep:(e,n)=>{e.rung?Ei(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===zn?((e,n)=>{const t=Ci(ci[e]?.type??""),o=tl(e,n<0?e-1:e+2);if(!o.moved)return void Ur(n<0?_t.sectionFirst({name:t}):_t.sectionLast({name:t}));const{floor:r,cap:i}=pi();Ur(_t.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):Zl(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),cs=En(e=>{const{floor:n,cap:t}=pi(),o=[];for(const r of e.nodes){const e=sn(r.place),i=Bi(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(Kt(i)||Qt(i)||hr(i.type,i))continue;if(Ut(i.type))continue;const l=Boolean(ql(e)),s=e===zn||l;e===zn&&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?Ci(i.type):Di(i),from:r.place})}const r=e.zones.flatMap(e=>{const n=sn(e.list);if(n===zn&&0===e.children.length)return[{...e,addLabel:_t.addSection,addAlways:!0}];const t=os(n),o=t?.target.spec?.addLabel;return e.children.length>0||Boolean(t?.choices.length)||Boolean(ql(n))?[o?{...e,addLabel:o}:e]:[]}),i=r.flatMap(e=>{const n=sn(e.list),t=n===zn||ql(n)?null:os(n);return t?.choices.length?Xe(e,t.target.spec?.addLabel??_t.addBlockHere):[]});return{sources:o,zones:r,seams:i}},[At.data]),ps=null==Et?.props.id?null:String(Et.props.id),us=En(e=>{const n=Ft,t=e=>!e.item.rung&&null!==an(At.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(ps);return i||(r(Le(At.data,n,o.item.id,ps,Tl))??o)},[At.data,Ft,ps,Tl]),[hs,fs]=Ln(null),ms=Boolean(Ll||Rl);mn(Eo,"mouseover",e=>{if(!ms)return;const n=gn(e.target),t=n?ht(At.data,Ft,n):null;t!==hs&&fs(t)}),mn(Eo,"mouseout",e=>{ms&&!e.relatedTarget&&fs(null)});const gs=e=>Kt(e)||Qt(e)||Ut(e.type),ys=e=>{const n=Ut(e.type)?xi(e.type):Kt(e)?_t.header:Qt(e)?_t.footer:null;return null===n?Ii(e):kr.rowName?kr.rowName(e,"section",n):n},vs=[];if(ms){const e=ps?ht(At.data,Ft,ps):null;for(const n of/* @__PURE__ */new Set([e,hs])){const e=n?ci.find(e=>String(e.props.id)===n):void 0;if(!e)continue;const t=Kt(e)||e.type===Vt,o=Fl(e);if(o){vs.push({id:String(e.props.id),label:ys(e),below:t,reach:o});continue}if(!Ll||!gs(e))continue;const r=Ll(e);r&&vs.push({id:String(e.props.id),label:r,below:t})}}const ks=ue(),bs=jn(null);Tn(()=>{const e=Dt.changeNotice;if(!e)return;const n=JSON.stringify(ci.filter(gs)),t=bs.current;if(bs.current={doc:Dn,bands:n,index:Tt.index},!t||t.doc!==Dn||t.bands===n)return;Tt.hasPast&&Tt.index>=t.index&&!ut.has(ks)&&(ut.add(ks),Ur(e,"success",{action:{label:_t.bar.undo,onClick:()=>Tt.back()},duration:8e3}))},[ci]);const Ss=e=>{_o(F),fo.select(e.zone===zn?{index:e.index}:{index:e.index,zone:e.zone})},ws=Z(),xs=()=>({data:At.data,device:xo,ops:fo,inspector:ar}),zs=ws?.model,Cs=An(()=>zs?e=>zs(e,cs(e),xs()):cs,[zs,cs,xo]),Is=ws?.measure,Ns=Is?(e,n)=>Is(e,n,xs()):void 0,Os=ws?.canDrop,Bs=Os?(e,n)=>Os(e,n,ns,xs()):ns,Ps=ws?.drop,$s=Ps?(e,n)=>Ps(e,n,ss,xs()):ss,Ms=ws?.pick,js=Ms?e=>Ms(e,Ss,xs()):Ss,As=ws?.media??null,Ls=jn(null),Ts=An(()=>As?{id:ct,zone:"",index:-1,type:As.adds.type,add:{kind:As.adds.kind,type:As.adds.type},media:!0}:null,[As]);Tn(()=>{if(!Ts||Nt||"undefined"==typeof document)return;const e=e=>{(e=>Array.from(e.dataTransfer?.types??[]).includes(Xn))(e)&&(Ls.current=null,ds.start({key:ct,item:Ts}))},n=e=>{ds.get()?.item.media&&(Ls.current=Jn(e.dataTransfer))},t=()=>{ds.get()?.item.media&&ds.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)}},[Ts,Nt,ds]);const Es=()=>{const e=Ls.current;return Ls.current=null,e},Rs=pe(),Fs=async e=>{if(!Rs)return e;const n=await Rs(e);return n?{...e,id:n.id,url:n.url}:null};const Ds=(e,n)=>{if(!As)return;const t=an(ho.getState().appState.data,ui,n);if(!t)return;const o=t.node;fo.replaceComponent(sn(t.place),t.place.index,{...o,props:{...As.replace(o,e),id:o.props.id}})},Hs=e=>{const n=sn(e),t=Mi(n);t&&Li(t.node,t.slot,!1),ll(n,e.index)},Vs=(e,n)=>/* @__PURE__ */st(Pe,{...Nt?{}:as.seam({place:{...dn(e),index:n}})},`seam:${e}:${n}`),Ws={rowClick:al,isCollapsed:Fr,toggleCollapse:Dr},Us=e=>{const n=String(e.props.id),t=ci.findIndex(e=>String(e.props.id)===n),o=Jt(n),r=Bi(o),i=Fr(n),l=xi(e.type),s=kr.rowName?kr.rowName(e,"section",l):l,d=e=>Vs(o,e);/* @__PURE__ */
|
|
16
|
+
return dt(at,{children:[
|
|
17
|
+
/* @__PURE__ */st(Ce,{words:qt,icon:/* @__PURE__ */st(Sr,{type:e.type,size:13}),name:s,preview:pl(e),marks:ul(e),onSelect:()=>el(t),nameSlot:Vi(zn,t,n,s),selected:er===n,badge:Fl(e)?void 0:Wl,shared:Fl(e),actions:hl(e,zn,t)??void 0,rowProps:{"data-node-id":n,onClick:al(()=>el(t))},fold:{open:!i,label:"section",onToggle:()=>Dr(n)}}),!i&&/* @__PURE__ */dt(Ie,{children:[r.map((n,t)=>{const r=String(n.props.id),i=Ii(n),l=Cl(n),s=l&&Fr(r),a=()=>Nl(o,t,r,e.type),{rowProps:c,...p}=as.row({item:{id:r,zone:o,index:t,type:n.type},place:{...dn(o),index:t}},{"data-node-id":r,onClick:al(a)});/* @__PURE__ */
|
|
18
|
+
return dt(Fn,{children:[d(t),
|
|
19
|
+
/* @__PURE__ */st(Ce,{words:qt,icon:/* @__PURE__ */st(Sr,{type:n.type,size:13}),name:i,preview:pl(n),marks:ul(n),onSelect:a,nameSlot:Vi(o,t,r,i),selected:er===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Dr(r)}:void 0,actions:/* @__PURE__ */dt(at,{children:[cl(o,t,i),hl(n,o,t),fl(o,t,n,i)]}),rowProps:c}),l&&!s&&/* @__PURE__ */st(Ie,{children:Gs(n,2)})]},r)}),d(r.length)]})]})},Js=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=as.dragging,d=!Fr(l)&&s?.rung?.nodeId!==i,a={...dn(l),index:0},c=s&&!s.rung&&ns(s,a)?a:void 0,p=()=>Li(e,n,!0),{rowProps:u,...h}=as.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(ur.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:al(p)}),f=Nt?null:ur.slotActions?.(e,n.slot);/* @__PURE__ */
|
|
20
|
+
return dt(Fn,{children:[n.heading,
|
|
21
|
+
/* @__PURE__ */st(Ce,{words:qt,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:ji===l,...h,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>Dr(l)},actions:f&&f.length>0?/* @__PURE__ */st(at,{children:f.map((t,o)=>/* @__PURE__ */st(Be,{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&&Ti(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(Ie,{children:r})]},l)},Ys=(e,n)=>{const t=kl(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=wl(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)=>Vs(e,n),p=/* @__PURE__ */dt(at,{children:[i.map(({child:n,zone:t,index:o})=>{const r=er===String(n.props.id),{collapsible:i,folded:s}=xl(n,l,Il(n.type)),d=String(n.props.id),a=Ql(n),p=()=>Nl(t,o,d,e.type),{rowProps:u,...h}=as.row({item:{id:d,zone:t,index:o,type:n.type},place:{...dn(t),index:o}},{"data-node-id":d,onClick:al(p)});/* @__PURE__ */
|
|
23
|
+
return dt(Fn,{children:[0===o&&c(t,0),
|
|
24
|
+
/* @__PURE__ */st(Ce,{words:qt,icon:/* @__PURE__ */st(Sr,{type:n.type,size:13}),name:a,preview:pl(n),marks:ul(n),onSelect:p,nameSlot:Vi(t,o,d,a),selected:r,hidden:Boolean(n.props._hidden),...h,fold:i?{open:!s,label:"group",onToggle:()=>Dr(d)}:void 0,actions:/* @__PURE__ */dt(at,{children:[cl(t,o,a),hl(n,t,o),fl(t,o,n,a)]}),rowProps:u}),i&&!s&&/* @__PURE__ */st(Ie,{children:Ys(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?Js(e,t.rung,r++,o,p):/* @__PURE__ */st(Fn,{children:p},t.slot??"")})})},Gs=(e,n)=>{const t=mr(At?.data,e.type,String(e.props.id)),o=kl(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=wl(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)=>Vs(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=er===String(n.props.id),i=Di(n),l=String(n.props.id),{collapsible:d,folded:a}=xl(n,s,Il(n.type)),c=yl(n.type),p=1===c.length?`${l}:${c[0]}`:null,u=p?{...dn(p),index:Bi(p).length}:void 0,h=as.dragging,f=u&&h&&ns(h,u)?u:void 0,g=()=>Nl(t,o,l,e.type),{rowProps:y,...v}=as.row({item:{id:l,zone:t,index:o,type:n.type},place:{...dn(t),index:o},into:f,canDrag:!hr(n.type,n)},{"data-node-id":l,onClick:al(g)});/* @__PURE__ */
|
|
26
|
+
return dt(Fn,{children:[0===o&&m(t,0),
|
|
27
|
+
/* @__PURE__ */st(Ce,{words:qt,icon:/* @__PURE__ */st(Sr,{type:n.type,size:13}),name:i,preview:pl(n),marks:ul(n),onSelect:g,nameSlot:Vi(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...v,fold:d?{open:!a,label:"group",onToggle:()=>Dr(l)}:void 0,actions:hr(n.type,n)?hl(n,t,o)??void 0:/* @__PURE__ */dt(at,{children:[cl(t,o,i),hl(n,t,o),fl(t,o,n,i)]}),rowProps:y}),d&&!a&&/* @__PURE__ */st(Ie,{children:Gs(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:()=>Ol(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?Js(e,o.rung,i++,r,v):/* @__PURE__ */st(Fn,{children:v},o.slot??"")})})},Ks=Uo,Qs=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:go&&!Ks&&pr===e.id,onSelect:()=>si(e.id)}:e,Zs=[...(cr.railLead??[]).map(Qs),{id:"sections",label:_t.layers,icon:/* @__PURE__ */st(me,{}),active:go&&!Ks&&"sections"===pr,onSelect:()=>si("sections")},...(cr.railTrail??[]).map(Qs)],Xs=Io?{onPress:No}:$t?{onPress:()=>{le(un,{accept:"image/*",title:io.mediaLibrary})}}:null,_s={value:Zs.find(e=>!0===e.active)?.id??"",press:e=>{const n=Zs.find(n=>n.id===e);n&&!n.disabled&&!0!==n.active&&n.onSelect?.()},items:Zs.map(e=>({id:e.id,icon:e.icon,label:/* @__PURE__ */st("span",{className:"sr-only",children:e.label}),tooltip:e.label,disabled:e.disabled}))},qs=[...cr.railLead??[],...cr.railTrail??[]].find(e=>"panel"in e&&e.id===pr),ed=Boolean(Xt?.foldable),nd=Xt?.label??(Mt?_t.pageSections:_t.templateSections),td=ed&&Fr(kt),od=/* @__PURE__ */dt(at,{children:[ci.map((e,n)=>{if(Kt(e)||Qt(e)||Ut(e.type))return null;const t=er===String(e.props.id),o=Boolean(e.props._hidden);vl(e);const r=String(e.props.id),i=cr.hasOwnRows?.(e)??!1,l=Cl(e)||i,s=l&&Fr(r),d=yl(e.type),a=1===d.length?`${r}:${d[0]}`:null,c=a?{...dn(a),index:Bi(a).length}:void 0,p=as.dragging,u=c&&p&&ns(p,c)?c:void 0,{rowProps:h,...f}=as.row({item:{id:r,zone:zn,index:n,type:e.type},place:{...dn(zn),index:n},into:u,canDrag:!hr(e.type,e)},{"data-node-id":r,onClick:al(()=>el(n))});/* @__PURE__ */
|
|
29
|
+
return dt(Fn,{children:[n>0&&ml(n),
|
|
30
|
+
/* @__PURE__ */st(Ce,{words:qt,icon:/* @__PURE__ */st(Sr,{type:e.type,size:13}),name:Ii(e),preview:pl(e),marks:ul(e),shared:Fl(e),onSelect:()=>el(n),nameSlot:Vi(zn,n,r,Ii(e)),selected:t,hidden:o,...f,fold:l?{open:!s,label:"section",onToggle:()=>Dr(r)}:void 0,actions:/* @__PURE__ */dt(at,{children:[cl(zn,n,Ii(e)),hl(e,zn,n),fl(zn,n,e,Ii(e))]}),rowProps:h}),Cl(e)&&!s&&/* @__PURE__ */dt(Ie,{children:[Gs(e,1),cr.partRows?.(e,Ws)]}),i&&!s&&/* @__PURE__ */st(Ie,{children:cr.ownRows?.(e,n,Ws)})]},String(e.props.id??n))}),Yl>0&&ml(Yl)]}),rd=(e,n,t)=>{const o=String(e.props.id),r=bl(e).length>0||Sl(e)||Boolean(yr(e.type)),i=r&&Fr(o),l="header"===t?_t.header:_t.footer,s=kr.rowName?kr.rowName(e,"section",l):l;/* @__PURE__ */
|
|
31
|
+
return dt(at,{children:[
|
|
32
|
+
/* @__PURE__ */st(Ce,{words:qt,icon:/* @__PURE__ */st(Sr,{type:t,size:13}),name:s,preview:pl(e),marks:ul(e),badge:Fl(e)?void 0:Wl,shared:Fl(e),onSelect:()=>el(n),nameSlot:Vi(zn,n,o,s),selected:er===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Dr(o)}:void 0,actions:hl(e,zn,n)??void 0,rowProps:{"data-node-id":o,onClick:al(()=>el(n))}}),r&&!i&&/* @__PURE__ */st(Ie,{children:Ys(e,1)})]})};return(cr.wrap??(e=>e))(
|
|
33
|
+
/* @__PURE__ */st(X,{target:Eo,children:/* @__PURE__ */dt("div",{ref:To,className:"sf-editor es-editor",style:Ue(Ar),onContextMenu:Ki.onEditorContextMenu,...u(un),children:[
|
|
34
|
+
/* @__PURE__ */dt(Te,{children:[
|
|
35
|
+
/* @__PURE__ */dt("div",{className:"es-cluster es-cluster--left",children:[Xs?/* @__PURE__ */st(Vn,{variant:"secondary",className:"es-barbtn",leftIcon:/* @__PURE__ */st(ge,{}),onClick:Xs.onPress,children:_t.railMedia}):null,
|
|
36
|
+
/* @__PURE__ */st(Ee,{label:_t.bar.undo,disabled:Boolean(Nt)||!Tt.hasPast,onClick:()=>Tt.back(),children:/* @__PURE__ */st(_n,{})}),
|
|
37
|
+
/* @__PURE__ */st(Ee,{label:_t.bar.redo,disabled:Boolean(Nt)||!Tt.hasFuture,onClick:()=>Tt.forward(),children:/* @__PURE__ */st(qn,{})})]}),
|
|
38
|
+
/* @__PURE__ */dt(Re,{children:[
|
|
39
|
+
/* @__PURE__ */st(Fe,{devices:vo,value:xo,onChange:zo}),
|
|
40
|
+
/* @__PURE__ */st(Ee,{label:_t.bar.refresh,tip:_t.bar.refreshTip,onClick:()=>{Lo.current=(()=>{const e=Eo?.document;if(!e)return null;const n=ci.findIndex(Qt),t=n>=0?n:ci.length;let o=null;for(let n=0;n<t;n++){const t=ci[n]?.props?.id;if(null==t)continue;const r=Mn(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=Et?.props?.id??ci[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),Ao(e=>e+1)},children:/* @__PURE__ */st(et,{})}),cr.barView?.()]}),
|
|
41
|
+
/* @__PURE__ */dt(Re,{kind:"right",style:{minWidth:300},children:[
|
|
42
|
+
/* @__PURE__ */st(k,{input:Vo,words:_t.saveStatus}),yn?/* @__PURE__ */st(yn,{}):null,cr.barLead?.(),cr.barTrail?.(),cr.mainAction||!cr.barMain?/* @__PURE__ */st(b,{input:Vo,action:cr.mainAction??{label:_t.done,onPress:()=>{Qn(At.data)}},readOnly:Boolean(Nt),saveSwitch:Bt,onToggleAutoSave:xt,onSaveNow:Wo,bar:_t.bar,words:_t.saveStatus}):cr.barMain()]})]}),
|
|
43
|
+
/* @__PURE__ */st(re,{}),
|
|
44
|
+
/* @__PURE__ */dt("div",{className:"sf-body",children:[go?/* @__PURE__ */dt(at,{children:[
|
|
45
|
+
/* @__PURE__ */dt("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":_t.leftPanel,children:[
|
|
46
|
+
/* @__PURE__ */dt("div",{className:"es-paneltabs es-paneltabs--with-hide",children:[
|
|
47
|
+
/* @__PURE__ */st(I,{side:"left",onHide:ii}),
|
|
48
|
+
/* @__PURE__ */st("span",{className:"es-paneltabs-divider","aria-hidden":"true"}),
|
|
49
|
+
/* @__PURE__ */st(Wn,{variant:"underline",block:!0,"aria-label":_t.bar.views,value:_s.value,onChange:_s.press,items:_s.items})]}),Uo?/* @__PURE__ */st(x,{at:Go?{label:(e=>{const n=ql(e.zone);if(n)return _t.add.addingTo({name:kr.rowName?dl(n,!0):xi(n.type)});if(e.zone===zn){const n=ci[e.index];return n&&!Qt(n)?_t.add.addingBefore({name:dl(n,!0)}):_t.add.addingAtEnd}const t=os(e.zone);return t?_t.add.addingTo({name:t.parentName}):_t.add.addingHere})(Go),onClear:()=>Ko(null)}:void 0,placeBlocks:Go&&Go.zone!==zn?os(Go.zone)?.choices:void 0,canTake:Go?e=>{if(!Go)return null;const n={...dn(Go.zone),index:Go.index};if(is(e,n))return null;if("shared"===e.kind&&Go.zone===zn&&!Dt.shared?.nodeOf(e.section))return _t.shared.alreadyHere;const t=ql(Go.zone);if(t)return _t.add.notInside({name:dl(t,!0)});if(Go.zone===zn)return _t.add.onlySections;const o=os(Go.zone);return o?_t.add.notInside({name:o.parentName}):_t.add.onlySections}:void 0,onPick:Go?e=>{if(!Go)return;const n={...dn(Go.zone),index:Go.index};is(e,n)&&(ls(e,n),sl())}: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:ds,siteWide:cr.addPanelRow?.(sl),onClose:sl,readOnly:Boolean(Nt)}):qs?qs.panel({onHide:ii,notify:Ur}):/* @__PURE__ */dt(at,{children:[
|
|
50
|
+
/* @__PURE__ */st(N,{icon:/* @__PURE__ */st(me,{}),title:_t.layers,context:lo,actions:/* @__PURE__ */dt(at,{children:[!Nt&&/* @__PURE__ */st(De,{label:_t.add.title,onClick:()=>il(null),children:/* @__PURE__ */st(nt,{size:15})}),
|
|
51
|
+
/* @__PURE__ */st(De,{label:Kl?_t.expandAll:_t.collapseAll,title:0===Gl.length?_t.nothingToFold:void 0,disabled:0===Gl.length,onClick:()=>jr(e=>{const n=new Set(Gl);return Kl?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...Gl])}),children:/* @__PURE__ */st(mt,{expand:Kl})})]})}),
|
|
52
|
+
/* @__PURE__ */dt(Ne,{className:"sf-tree sf-scroll",words:qt,children:[
|
|
53
|
+
/* @__PURE__ */st(Ce,{words:qt,icon:/* @__PURE__ */st(Sr,{type:"page",size:13}),name:_t.pageSettings,onSelect:di,selected:!Et&&qo,rowProps:{onClick:al(di)}}),Ul&&/* @__PURE__ */dt(at,{children:[!El&&/* @__PURE__ */st(Oe,{children:_t.header}),Us(Ul)]}),jt&&!(El&&Ul)&&/* @__PURE__ */dt(at,{children:[!El&&/* @__PURE__ */st(Oe,{children:_t.header}),!Zt&&/* @__PURE__ */st(Ce,{words:qt,icon:/* @__PURE__ */st(Sr,{type:"header",size:13}),name:_t.header,badge:Vl?void 0:Wl,shared:Vl,onSelect:ai,selected:Xo.kind===Gt?.kind,rowProps:{onClick:al(ai)}})]}),Al&&!(El&&Ul)&&rd(Al,jl,"header"),!ed&&/* @__PURE__ */st(Oe,{children:nd}),ed?/* @__PURE__ */dt(at,{children:[
|
|
54
|
+
/* @__PURE__ */st(Ce,{words:qt,icon:null,name:nd,fold:{open:!td,label:nd,onToggle:()=>Dr(kt)}}),!td&&/* @__PURE__ */st(Ie,{children:od})]}):od,jt&&!El&&/* @__PURE__ */st(Oe,{children:_t.footer}),Ml&&!(El&&Jl)&&rd(Ml,$l,"footer"),Jl&&Us(Jl),cr.treeFoot?.()]})]})]}),
|
|
55
|
+
/* @__PURE__ */st(He,{side:"left",width:Ar.left,min:We.left,max:Ve,defaultWidth:m.left,label:_t.resizeLeftPanel,onResize:Er})]}):/* @__PURE__ */st(O,{side:"left",onShow:ii}),
|
|
56
|
+
/* @__PURE__ */dt("div",{ref:Jr,className:"sf-center sf-scroll","data-sf-canvas-head":Zr?"":void 0,style:{overflowX:ti?"auto":"hidden",overflowY:"hidden"},children:[Zr&&/* @__PURE__ */st("div",{ref:Xr,className:"sf-canvas-head",children:/* @__PURE__ */st(Zr,{device:xo})}),
|
|
57
|
+
/* @__PURE__ */dt("div",{className:"sf-frame-scaler",style:oi,children:[
|
|
58
|
+
/* @__PURE__ */st("div",{className:"sf-frame "+(xo===So?"":`sf-frame--${xo}`),style:ri,children:/* @__PURE__ */dt("div",{className:"sf-preview-host",children:[
|
|
59
|
+
/* @__PURE__ */st(xe.Provider,{value:Tl,children:/* @__PURE__ */st(ze.Provider,{value:Hl,children:/* @__PURE__ */st(so,{},jo)})}),
|
|
60
|
+
/* @__PURE__ */st(_e,{canvas:Eo,session:ds,model:Cs,measure:Ns,canDrop:Bs,onDrop:$s,choose:us,onPick:js,dropOn:As?{accepts:(e,n)=>{if(!e.media||!As||n.item.rung)return!1;const t=an(At.data,ui,n.item.id);return null!==t&&As.takes(t.node)},onDrop:(e,n)=>(e=>{const n=Es();n&&As&&Fs(n).then(n=>{n&&Ds(n,e.item.id)})})(n),label:()=>_t.canvasReplaceImage}:void 0,onZoneAdd:Hs,onSeamAdd:Hs,zoneAddLabel:_t.canvasAddBlock,words:eo.canvas,readOnly:Boolean(Nt),revision:At.data}),Qo.length>0&&!Ro&&/* @__PURE__ */st("div",{className:"sf-preview-gaps",children:Qo.map(e=>
|
|
61
|
+
/* @__PURE__ */st(qe,{index:e.index,label:_t.addSectionHere,onInsert:()=>il(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))})]})}),ms?/* @__PURE__ */st(ft,{canvas:Eo,tabs:vs,onSelect:e=>{const n=ci.findIndex(n=>String(n.props.id)===e);n>=0&&el(n)}}):null]})]}),yo?/* @__PURE__ */dt(at,{children:[vn?
|
|
62
|
+
/* @__PURE__ */st("div",{className:"es-sidepanel es-sidepanel--right","data-es-host-panel":"",children:vn}):/* @__PURE__ */st(at,{children:/* @__PURE__ */st(h,{value:{selectChild:Nl,addChild:Ol,childRowName:Di,blockRowName:Ql},children:/* @__PURE__ */st(ao,{mode:Xo,onOpenWebsiteSettings:cr.openSettings??(()=>{}),onOpenSiteStyles:cr.openStyles,onSelectNode:Cr,onNotify:Ur,onHidePanel:li,nodeActions:Et?Cn(Ft,Et.type):bt})})}),
|
|
63
|
+
/* @__PURE__ */st(He,{side:"right",width:Ar.right,min:We.right,max:Ve,defaultWidth:m.right,label:_t.resizeSettingsPanel,onResize:Rr})]}):
|
|
64
|
+
/* @__PURE__ */st(O,{side:"right",onShow:li})]}),Ki.menu,
|
|
65
|
+
/* @__PURE__ */st(ne,{}),vi?/* @__PURE__ */st(pt,{name:vi.name,onMake:e=>(async(e,n)=>{const t=ci.find(n=>String(n.props.id)===e),o=Dt.shared;if(!t||!o)return;let r;try{r=await C(yi).create(n,t)}catch{return void Ur(_t.shared.makeFailed,"error")}o.adopt(t,r),ki(null)})(vi.id,e),onCancel:()=>ki(null)}):null]})}))}export{wt as ScreenChrome};
|
package/dist/copy/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{selectionToVisible as e,selectionToSource as t,richLayout as n,createHistory as r,colorRunOf as l,textRange as o,selectionBox as a,placeWindow as s,offsetOrigin as c,visibleArea as i,ColorWindow as u,markPress as d,pasteToMarkup as p,richInput as h,editVisible as m,MARKUP_CLIPBOARD_TYPE as f,markupOfRange as g}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 y}from"../chunk-KRL3IUV3.js";import{FieldNumber as v}from"../chunk-ZOBSIXRD.js";import{FieldSelect as b}from"../chunk-QAJAEWCZ.js";import"../chunk-WRFD4EXD.js";import{SettingsSwitch as k}from"../chunk-OECWLNKJ.js";import{SettingsField as x,SettingsSegmented as S}from"../chunk-VANKQVOW.js";import{useWords as w}from"../chunk-MFIRYGHW.js";import{TEXT_STYLE_CASES as E}from"../chunk-YHZSBL2N.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:
|
|
14
|
-
return te("div",{className:"es-rich-wrap",children:[s&&""===
|
|
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=
|
|
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:r,rules:l,multiline:o,readOnly:a=!1,placeholder:s,ariaLabel:c,handle:i,onEdit:u,onSelect:d,onHistory:y,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(r),[T,O]=M(0),L=B({value:r,rules:l,multiline:o,readOnly:a,pending:b,onEdit:u,onHistory:y,onFormat:v});L.current={value:r,rules:l,multiline:o,readOnly:a,pending:b,onEdit:u,onHistory:y,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(),n=w.current;if(!e||!n)return null;const[r,l]=t(n.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(t,n){const r=S.current,l=w.current;if(!r||!l)return null;const[o,a]=e(l.layout,t,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 t=S.current;if(!t||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}}(t,n(r,l)),E.current=r;const a=C.current;if(!a||a.text!==r)return void(o&&t.ownerDocument.activeElement===t&&K(o[0],Math.min(o[1],w.current.layout.text.length)));C.current=null;const s=w.current.layout,[c,i]=a.vis??e(s,a.src[0],a.src[1]);t.ownerDocument.activeElement!==t&&t.focus(),K(c,i)},[r,l,T]);const V=(e,n,r)=>{const l=w.current,[o,a]=t(l.layout,n[0],n[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=h({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=(e,t=!1)=>{const n=R();if(!n||n[0]===n[1])return;e.preventDefault();const o=w.current;e.clipboardData.setData("text/plain",o.layout.text.slice(n[0],n[1])),e.clipboardData.setData(f,g(r,l,n[0],n[1])),t&&!a&&V(m(r,l,n[0],n[1],{text:""}),n,"edit")};/* @__PURE__ */
|
|
14
|
+
return te("div",{className:"es-rich-wrap",children:[s&&""===r?/* @__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=r},onBlur:()=>{r!==N.current&&k?.(r),N.current=r},onKeyDown:e=>{if("Escape"===e.key)return e.preventDefault(),x?.(N.current),void(N.current=r);"Enter"!==e.key||o||(e.preventDefault(),r!==N.current&&k?.(r),N.current=r)},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(m(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:e=>{if(e.preventDefault(),a)return;const t=R();if(!t)return;const n=e.clipboardData.getData(f),s=n?o?n:n.replace(/\s*\r?\n\s*/g," "):p({html:e.clipboardData.getData("text/html"),text:e.clipboardData.getData("text/plain")},{doc:e.currentTarget.ownerDocument,multiline:o,rules:l});V(m(r,l,t[0],t[1],{markup:s}),t,"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??y.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:b,windows:/* @__PURE__ */te(re,{children:[Re&&oe&&oe.length>0?/* @__PURE__ */ne(
|
|
19
|
+
/* @__PURE__ */ne(v,{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:h,multiline:m=!1,placeholder:f,ariaLabel:g,className:v,readOnly:b=!1,rules:x,tools:S=[],writeMark:E,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=w("copy",y),ue=B(null),de=j??ue,[pe,he]=M(!1),[me,fe]=M(null),ge=B(r()).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=x??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=d({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=E??((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=l(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?o(n,at.start,at.end):null,l=r?.endContainer,u=l?1===l.nodeType?l:l.parentElement:null,d=r?a(r,u?.closest(".es-rich-line, .es-gold-layer")??null):null;if(!d)return;const p=s({anchor:d,size:{width:t.offsetWidth,height:t.offsetHeight},within:e.getBoundingClientRect(),clip:i(e),parent:c(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"+(v?` ${v}`:""),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=p({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(u,{colors:oe,current:Qe,words:ie.colors??y.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??y.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:h}):/* @__PURE__ */ne(we,{value:e,onInput:e=>{ge.record(be(null),"type",Date.now()),ve(e)},onCommit:n,onCancel:h,multiline:m,placeholder:f,ariaLabel:g,rules:x,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(k,{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(x,{label:e,icon:t,children:/* @__PURE__ */ne(S,{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=w("copy",y),d=T(O().textToolbar),p=Object.fromEntries(L(R).map(e=>[e.value,e.icon])),h={...y.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(x,{label:h.style,icon:/* @__PURE__ */ne(ce,{}),children:/* @__PURE__ */ne(b,{ariaLabel:h.style,value:r.value,options:r.options,onChange:r.onChange,changed:r.changed,footer:m,readOnly:n})}):null,l?/* @__PURE__ */ne(x,{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(b,{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(x,{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/drag/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{AddPanel,CanvasDragLayer,CanvasInsert,EMPTY_MEASURE,HANDLE_GRACE_MS,canvasTarget,contains,gapInZone,gapLine,insertSeams,measureCanvas,pickSource,seamsBetween,sourcesAt}from"../chunk-
|
|
1
|
+
export{AddPanel,CanvasDragLayer,CanvasInsert,EMPTY_MEASURE,HANDLE_GRACE_MS,canvasTarget,contains,gapInZone,gapLine,insertSeams,measureCanvas,pickSource,seamsBetween,sourcesAt}from"../chunk-LQV5FZTQ.js";import"../chunk-KAML3KQH.js";export{AUTO_SCROLL_EDGE,AUTO_SCROLL_MAX_SPEED,autoScrollDelta,autoScrollSpeed,createDragSession,dropEffectFor,dropOnRow,frameScrollBox,gapToMoveIndex,isNoOpDrop,scrollBoxOf,scrollParent,startAutoScroll,stepGap,useTreeDrag}from"../chunk-3S5N4HLJ.js";import"../chunk-P2VEMZH5.js";import"../chunk-K7BTCBWD.js";import"../chunk-L55YIXDC.js";import"../chunk-QIDRJH3S.js";import"../chunk-LF3FUSCQ.js";
|
package/dist/easel/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{CanvasFrame,CanvasPartsContext,CanvasPassThroughContext,CanvasSharedContext,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useSelectedFields,validSelection}from"../chunk-
|
|
1
|
+
export{CanvasFrame,CanvasPartsContext,CanvasPassThroughContext,CanvasSharedContext,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useSelectedFields,validSelection}from"../chunk-EFHV56BO.js";import"../chunk-TBY3DFKS.js";import"../chunk-IWCKVZHS.js";import"../chunk-BSHIQIZC.js";import"../chunk-23VM4PMV.js";import"../chunk-KRL3IUV3.js";import"../chunk-MFIRYGHW.js";import"../chunk-K7BTCBWD.js";import"../chunk-L55YIXDC.js";import"../chunk-QIDRJH3S.js";import"../chunk-LF3FUSCQ.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{AddBlockRow as default}from"../../chunk-
|
|
1
|
+
export{AddBlockRow as default}from"../../chunk-L2Y3PF2R.js";import"../../chunk-M2Z775ZC.js";import"../../chunk-PAOZMXEI.js";import"../../chunk-FHCKFOCD.js";import"../../chunk-MQA7OFRA.js";import"../../chunk-23DYNW6S.js";import"../../chunk-EFHV56BO.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-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-BSHIQIZC.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-K7BTCBWD.js";import"../../chunk-L55YIXDC.js";import"../../chunk-QIDRJH3S.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-LF3FUSCQ.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-R5KEFI55.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-PAOZMXEI.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-EFHV56BO.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-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-BSHIQIZC.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-LQV5FZTQ.js";import"../../chunk-KAML3KQH.js";import"../../chunk-3S5N4HLJ.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-K7BTCBWD.js";import"../../chunk-L55YIXDC.js";import"../../chunk-QIDRJH3S.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-LF3FUSCQ.js";
|
|
@@ -6,12 +6,11 @@ import * as react from 'react';
|
|
|
6
6
|
* in the left panel was too small; it pops up).
|
|
7
7
|
*
|
|
8
8
|
* The host's component is drawn always and is told what to be: choosing for a
|
|
9
|
-
* field (`pick`), browsing from the
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* one
|
|
13
|
-
*
|
|
14
|
-
* and ends the browse.
|
|
9
|
+
* field (`pick`), browsing from the top bar's Media library button
|
|
10
|
+
* (`browsing`), or closed (neither). The host decides how to show its library:
|
|
11
|
+
* the admin portal draws nothing here and answers with its one Media Library
|
|
12
|
+
* window (owner 2026-10-25: one window, one place). A pick answers the field
|
|
13
|
+
* it was asked for; `onClose` leaves the field as it was and ends the browse.
|
|
15
14
|
*
|
|
16
15
|
* Nothing is drawn where the host supplied no popup: fields then ask the host
|
|
17
16
|
* for its window (lib/media-picker).
|
|
@@ -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-6FWAE2RN.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-ZKY45F5G.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-P5VYGWYO.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-BSHIQIZC.js";import"../../chunk-K7BTCBWD.js";import"../../chunk-L55YIXDC.js";import"../../chunk-QIDRJH3S.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-LF3FUSCQ.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ScreenChrome as default}from"../../chunk-
|
|
1
|
+
export{ScreenChrome as default}from"../../chunk-XJ2WXGFJ.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-TNGOL65V.js";import"../../chunk-I7BROL77.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-C56MPJBH.js";import"../../chunk-MEHLY5Q4.js";import"../../chunk-WEIE2FBC.js";import"../../chunk-PY7OOQEZ.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-5545A3PC.js";import"../../chunk-R5KEFI55.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-PAOZMXEI.js";import"../../chunk-2G6MAXPY.js";import"../../chunk-6FWAE2RN.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-EFHV56BO.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-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-P5VYGWYO.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-BSHIQIZC.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-LQV5FZTQ.js";import"../../chunk-KAML3KQH.js";import"../../chunk-3S5N4HLJ.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-K7BTCBWD.js";import"../../chunk-L55YIXDC.js";import"../../chunk-QIDRJH3S.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.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-LF3FUSCQ.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{DocumentScreen,ScreenMount as default}from"../../chunk-
|
|
1
|
+
export{DocumentScreen,ScreenMount as default}from"../../chunk-7YVEYQDE.js";import"../../chunk-GXQCZJOP.js";import"../../chunk-XJ2WXGFJ.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-TNGOL65V.js";import"../../chunk-I7BROL77.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-C56MPJBH.js";import"../../chunk-MEHLY5Q4.js";import"../../chunk-WEIE2FBC.js";import"../../chunk-PY7OOQEZ.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-JQXD3TDE.js";import"../../chunk-5545A3PC.js";import"../../chunk-R5KEFI55.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-PAOZMXEI.js";import"../../chunk-2G6MAXPY.js";import"../../chunk-6FWAE2RN.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-EFHV56BO.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-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-P5VYGWYO.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-BSHIQIZC.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-LQV5FZTQ.js";import"../../chunk-KAML3KQH.js";import"../../chunk-3S5N4HLJ.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-K7BTCBWD.js";import"../../chunk-L55YIXDC.js";import"../../chunk-QIDRJH3S.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.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-LF3FUSCQ.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ScreenStoreProvider as default}from"../../chunk-
|
|
1
|
+
export{ScreenStoreProvider as default}from"../../chunk-JQXD3TDE.js";import"../../chunk-PAOZMXEI.js";import"../../chunk-FHCKFOCD.js";import"../../chunk-MQA7OFRA.js";import"../../chunk-EFHV56BO.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-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-BSHIQIZC.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-K7BTCBWD.js";import"../../chunk-L55YIXDC.js";import"../../chunk-QIDRJH3S.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-LF3FUSCQ.js";
|