efficient-easel 0.103.0 → 0.105.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +92 -7
- package/dist/CanvasDragLayer-zgYT1xwY.d.ts +168 -0
- package/dist/chrome/index.js +1 -1
- package/dist/chunk-3P6AMTOS.js +1 -0
- package/dist/chunk-4XQUWGIV.js +65 -0
- package/dist/{chunk-6UJ3Y6FC.js → chunk-53G47SWO.js} +1 -1
- package/dist/{chunk-IWAPPEL4.js → chunk-5ZBBXZPV.js} +1 -1
- package/dist/chunk-7FBDZTUD.js +2 -0
- package/dist/chunk-7V5WZ46F.js +2 -0
- package/dist/chunk-BVN33R76.js +1 -0
- package/dist/chunk-CLOS6SSX.js +1 -0
- package/dist/chunk-ERR437B5.js +1 -0
- package/dist/chunk-GMCZXMOV.js +1 -0
- package/dist/{chunk-OYX47SL7.js → chunk-HNKB2ZYR.js} +1 -1
- package/dist/{chunk-AKFJK65Z.js → chunk-IE4GFYKO.js} +1 -1
- package/dist/{chunk-KDYIMJTZ.js → chunk-KCOBHPN6.js} +1 -1
- package/dist/chunk-KG7RJWOK.js +1 -0
- package/dist/chunk-N7VRF7PR.js +5 -0
- package/dist/chunk-NYKIQJT2.js +4 -0
- package/dist/{chunk-6TZTKAB5.js → chunk-O7Q4DDJT.js} +1 -1
- package/dist/chunk-PA3PNTVV.js +1 -0
- package/dist/chunk-PLVEGYK6.js +1 -0
- package/dist/chunk-PQXIFBDY.js +1 -0
- package/dist/{chunk-66ICOE3I.js → chunk-QH6LCNOX.js} +1 -1
- package/dist/chunk-R6WTQWAC.js +2 -0
- package/dist/{chunk-Z3KBLIEH.js → chunk-RQHC4TD6.js} +3 -3
- package/dist/chunk-RSCMJIWS.js +1 -0
- package/dist/{chunk-7MU3RJ6S.js → chunk-S4AWJX4Q.js} +1 -1
- package/dist/{chunk-MSBF7IW3.js → chunk-SARZN4M7.js} +2 -2
- package/dist/chunk-SQTY6CJD.js +1 -0
- package/dist/chunk-TBF5CVPA.js +1 -0
- package/dist/chunk-THWO5YVZ.js +1 -0
- package/dist/chunk-TLZG2FCF.js +1 -0
- package/dist/chunk-U3JP4VGF.js +2 -0
- package/dist/{chunk-LG436UTD.js → chunk-V4LF7D4F.js} +1 -1
- package/dist/chunk-VSHV6KJQ.js +5 -0
- package/dist/{chunk-OM67AJQC.js → chunk-VSOP4GUM.js} +1 -1
- package/dist/{chunk-6DJHRLCU.js → chunk-YC4TB3CJ.js} +9 -9
- package/dist/{chunk-GXN65JMA.js → chunk-YN4KND5F.js} +1 -1
- package/dist/chunk-ZTTWFAAC.js +1 -0
- package/dist/drag/index.d.ts +4 -164
- package/dist/edit-lock/index.d.ts +55 -1
- package/dist/edit-lock/index.js +1 -1
- package/dist/{host-DJ8Gzsx7.d.ts → host-BQ_b9Qzk.d.ts} +27 -1
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/MediaSidePanel.d.ts +3 -2
- package/dist/screen/components/MediaSidePanel.js +1 -1
- package/dist/screen/components/NodeContextMenu.d.ts +208 -5
- package/dist/screen/components/NodeContextMenu.js +1 -1
- package/dist/screen/components/PageEditGuardNotices.js +1 -1
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenDocumentContext.d.ts +2 -1
- package/dist/screen/components/ScreenDocumentContext.js +1 -1
- package/dist/screen/components/ScreenMount.d.ts +14 -3
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.d.ts +20 -5
- package/dist/screen/components/ScreenStoreProvider.js +1 -1
- package/dist/screen/components/SectionScreenShell.js +16 -16
- package/dist/screen/components/SidePanelHead.js +1 -1
- package/dist/screen/components/panel-widths.js +1 -1
- package/dist/screen/components/usePartBridge.d.ts +20 -5
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.d.ts +17 -6
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/admin-bridge.d.ts +2 -0
- package/dist/screen/lib/admin-bridge.js +1 -1
- package/dist/screen/lib/backend-error.d.ts +20 -5
- package/dist/screen/lib/backend-error.js +1 -1
- package/dist/screen/lib/document-addressing.d.ts +2 -1
- package/dist/screen/lib/document-switch.js +1 -1
- package/dist/screen/lib/failure.d.ts +6 -2
- package/dist/screen/lib/failure.js +1 -1
- package/dist/screen/lib/host-inbound.js +1 -1
- package/dist/screen/lib/host.d.ts +3 -2
- package/dist/screen/lib/host.js +1 -1
- package/dist/screen/lib/key-scope.js +1 -1
- package/dist/screen/lib/load-error.d.ts +9 -3
- package/dist/screen/lib/load-error.js +1 -1
- package/dist/screen/lib/media-panel.d.ts +81 -17
- package/dist/screen/lib/media-panel.js +1 -1
- package/dist/screen/lib/media-picker.d.ts +14 -2
- package/dist/screen/lib/media-picker.js +1 -1
- package/dist/screen/lib/page-lock.d.ts +45 -1
- package/dist/screen/lib/page-lock.js +1 -1
- package/dist/screen/lib/puck/content-tree.d.ts +27 -1
- package/dist/screen/lib/puck/content-tree.js +1 -1
- package/dist/screen/lib/puck/palette-sections.d.ts +7 -0
- package/dist/screen/lib/puck/palette-sections.js +1 -1
- package/dist/screen/lib/puck/section-doc.js +1 -1
- package/dist/screen/lib/puck/slot-child-name.d.ts +42 -3
- package/dist/screen/lib/puck/slot-child-name.js +1 -1
- package/dist/screen/lib/puck/style-clipboard.d.ts +53 -1
- package/dist/screen/lib/puck/style-clipboard.js +1 -1
- package/dist/screen/lib/puck/use-section-ops.d.ts +6 -0
- package/dist/screen/lib/puck/use-section-ops.js +1 -1
- package/dist/screen/lib/screen-parts.d.ts +619 -10
- package/dist/screen/lib/screen-parts.js +1 -1
- package/dist/screen/lib/section-templates.d.ts +25 -1
- package/dist/screen/lib/section-templates.js +1 -1
- package/dist/screen/lib/session-context.d.ts +5 -1
- package/dist/screen/lib/session-context.js +1 -1
- package/dist/screen/lib/session.d.ts +58 -5
- package/dist/screen/lib/session.js +1 -1
- package/dist/screen/screen.css +18 -0
- package/dist/screen/words.d.ts +96 -2
- package/dist/screen/words.js +1 -1
- package/dist/strings/catalogue.d.ts +4 -2
- package/dist/strings/catalogue.js +1 -1
- package/dist/strings/index.d.ts +1 -1
- package/dist/strings/index.js +1 -1
- package/dist/tree/index.d.ts +4 -142
- package/dist/types-DJDBtdB2.d.ts +143 -0
- package/package.json +1 -1
- package/dist/chunk-3M3A3DN2.js +0 -4
- package/dist/chunk-4MXFKJUY.js +0 -1
- package/dist/chunk-6FY3PZS3.js +0 -1
- package/dist/chunk-A7ZJII7O.js +0 -1
- package/dist/chunk-AJBJ74ME.js +0 -1
- package/dist/chunk-AKZWUV5Z.js +0 -1
- package/dist/chunk-F6CCTEIX.js +0 -1
- package/dist/chunk-FUDHI5I4.js +0 -1
- package/dist/chunk-GENAF3P6.js +0 -1
- package/dist/chunk-HDKTR5TZ.js +0 -62
- package/dist/chunk-HMX55DYT.js +0 -1
- package/dist/chunk-HWW4XJOH.js +0 -1
- package/dist/chunk-JUQ6YJCG.js +0 -1
- package/dist/chunk-NBJ2YY6Y.js +0 -4
- package/dist/chunk-OORDMLL4.js +0 -5
- package/dist/chunk-Q2HPBMG5.js +0 -1
- package/dist/chunk-Q3SQBNJB.js +0 -1
- package/dist/chunk-R5ZVNJLJ.js +0 -2
- package/dist/chunk-SERF2FAU.js +0 -1
- package/dist/chunk-VV5ADNBR.js +0 -1
- package/dist/chunk-YJXEHK6I.js +0 -2
- package/dist/chunk-ZWK3CBRU.js +0 -1
- package/dist/chunk-ZZ7VLIHQ.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,n){const o=e.categories??{},c=e.components,i=[];for(const[s,r]of Object.entries(o))if(!1!==r?.visible)for(const o of r?.components??[]){const r=c[o];if(!r)continue;const a=r.label??o,l=n.labelAtLevel(o,"section",a);i.push({type:o,cat:s,catLabel:t(e,s,n.categoryLabel),name:l,desc:n.descriptions[o]??"",...l===a?{}:{alias:a}})}return i}function t(e,t,n){return n(t)??e.categories?.[t]?.title??t}function n(e,t){return!t||`${e.name} ${e.alias??""} ${e.desc} ${e.type} ${e.catLabel}`.toLowerCase().includes(t)}function o(e,t){return e.find(e=>e.type===t)??null}function c(e,t){return e.filter(e=>e.type!==t)}export{e as buildPaletteSections,t as categoryLabel,n as matchesQuery,c as paletteWithoutPinned,o as pinnedSection};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function n(n,t){const e=n.components?.[t]?.fields??{};return Object.keys(e).filter(n=>"slot"===e[n]?.type)}function t(n,t){const e=n.components?.[t]?.permissions;return{duplicate:!1!==e?.duplicate,delete:!1!==e?.delete}}function e(t,e){return n(t,e.type).flatMap(n=>r(e,n))}function r(n,t){return(Array.isArray(n.props[t])?n.props[t]:[]).map((e,r)=>({child:e,zone:`${n.props.id}:${t}`,index:r}))}function o(n,t,r){const o=(t,i,u,c)=>{if(!t||"object"!=typeof t||!t.props)return null;if(t.props.id===r)return{item:t,zone:i,index:u};if(c>=12)return null;for(const{child:r,zone:i,index:u}of e(n,t)){const n=o(r,i,u,c+1);if(n)return n}return null};for(let n=0;n<t.length;n+=1){const e=o(t[n],f,n,0);if(e)return e}return null}var i=6;function u(t,e,r){return r<6&&n(t,e).length>0}var c=n=>`${n}-${crypto.randomUUID()}`,p="Header",s="Footer",f="root:default-zone",l=[p,s];function d(n){const t=/* @__PURE__ */new Set,e=[];return n.forEach((n,r)=>{const o=n?.type;void 0!==o&&l.includes(o)&&(t.has(o)?e.push(r):t.add(o))}),e}function a(n){return d(n).map(t=>n[t]?.props?.id).filter(n=>"string"==typeof n)}function y(n,t){const e=(n,t)=>n.some(n=>n?.type===t);return l.filter(r=>!e(n,r)&&!e(t,r))}export{s as FOOTER_TYPE,p as HEADER_TYPE,f as ROOT_ZONE,i as TREE_MAX_DEPTH,t as blockNodeActions,e as childSlotsOf,o as locateNode,y as missingPinnedTypes,u as nestsInTree,c as newNodeId,a as pinnedDuplicateIds,d as pinnedDuplicateIndices,r as slotChildrenIn,n as slotFieldsOf};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={title:"Add",contextBlocks:"Blocks for this place",contextAll:"Sections and blocks",done:"Done",doneDescription:"Close Add and go back",startBlank:"Start blank",templates:"Your templates",inside:({name:e})=>`Inside ${e}`,tile:({name:e})=>`Add ${e}`,hintBlocks:"Drag into the page, or click to add.",hint:"Drag onto the page, or click to add.",searchBlocks:"Search blocks",searchSections:"Search sections",addingTo:({name:e})=>`Adding to ${e}`,addingBefore:({name:e})=>`Adding before ${e}`,addingAtEnd:"Adding at the end of the page",addingHere:"Adding here"},t={loading:"Loading…",waitingForAuthorization:"Waiting for editor authorization…",missingTemplatePage:"Couldn’t open a page in this template.",missingPage:({slug:e})=>`No storefront page with slug "${e}".`,missingDocument:"Couldn’t open this document.",loadFailed:({cause:e})=>`Could not load the document — ${e}`,noun:"page",pageSettings:"Page settings",header:"Header",footer:"Footer",pageSections:"Template · Home page",templateSections:"Template · Template",addSection:"Add section",addSectionBefore:({name:e})=>`Add section before ${e}`,addSectionHere:"Add section here",done:"Done",copied:({name:e})=>`Copied ${e}`,pasteRefused:({name:e})=>`${e} can’t be pasted here.`,add:e};export{e as DEFAULT_SCREEN_ADD_WORDS,t as DEFAULT_SCREEN_WORDS};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{blockRuns as e}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as n}from"./chunk-
|
|
1
|
+
import{blockRuns as e}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as n}from"./chunk-VSHV6KJQ.js";import{useState as s,Fragment as a}from"react";import{jsxs as r,Fragment as c,jsx as o}from"react/jsx-runtime";function l({choices:l,onPick:t,open:m,onToggle:i}){const[p,u]=s(!1),{Icon:d}=n(),h=m??p;/* @__PURE__ */
|
|
2
2
|
return r(c,{children:[
|
|
3
3
|
/* @__PURE__ */r("button",{type:"button",className:"sf-add-card","aria-expanded":h,onClick:i??(()=>u(e=>!e)),children:[
|
|
4
4
|
/* @__PURE__ */o("span",{className:"sf-plus sf-plus--sm",children:"+"}),"Add block"]}),h&&/* @__PURE__ */o("div",{className:"sf-blockmenu",role:"menu",children:e(l).map(e=>/* @__PURE__ */r(a,{children:[e.group&&/* @__PURE__ */r("div",{className:"sf-menugroup-head",role:"presentation",children:[
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{useEaselHost as e}from"./chunk-U3JP4VGF.js";import{createContext as n,useState as t,useEffect as r,useMemo as l,useContext as o,useSyncExternalStore as u,useRef as c}from"react";import{jsx as s}from"react/jsx-runtime";var i=/* @__PURE__ */new Set,f=()=>{for(const e of[...i])e()};function a(){let e=null;const n=/* @__PURE__ */new Set,t=()=>{for(const e of[...n])e();f()},r=(n,r)=>{if(!e||e.request.requestId!==n)return;const{resolve:l}=e;e=null,t(),l(r)};return{current:()=>e?.request??null,request:n=>new Promise(r=>{const l=e;e={request:n,resolve:r},t(),l?.resolve(null)}),settle:r,cancel:()=>{e&&r(e.request.requestId,null)},subscribe:e=>(n.add(e),()=>{n.delete(e)})}}var d=[],p=null,h=a(),v=()=>d[d.length-1]??p,m=()=>v()?.store??h,q=n(null);function b({panel:n,children:o}){const u=e(),[c]=t(()=>({panel:n,host:u,store:a()}));c.panel=n,c.host=u,d.includes(c)||(p=c),r(()=>{const e=d.indexOf(c);return e>=0&&d.splice(e,1),d.push(c),p?.host===c.host&&(p=null),f(),()=>{const e=d.indexOf(c);e>=0&&d.splice(e,1),p===c&&(p=null),c.store.cancel(),f()}},[c]);const i=l(()=>({panel:n,store:c.store}),[n,c]);/* @__PURE__ */
|
|
2
|
+
return s(q.Provider,{value:i,children:o})}function x(){return o(q)?.panel??null}function j(e){let n=null;for(let t=d.length-1;t>=0&&!n;t-=1)d[t].host===e&&(n=d[t]);n||p?.host!==e||(n=p);const t=n??v();return t?.panel?t.store:null}function w(){return null!=v()?.panel}function O(e){return m().request(e)}function P(e,n){for(const{store:t}of[...d])t.settle(e,n);p?.store.settle(e,n),h.settle(e,n)}function g(){m().cancel()}var I={current:()=>m().current(),subscribe:e=>(i.add(e),()=>{i.delete(e)}),cancel:()=>m().cancel()};function S(){return o(q)?.store??I}var k=()=>null;function F(){const e=S();return u(e.subscribe,e.current,k)}function G(){return S().cancel}function J(e,n){const t=S(),l=c(n);r(()=>{Object.is(l.current,n)||(l.current=n,e&&t.cancel())},[e,n,t])}export{b as MediaPanelProvider,g as cancelPanelPick,a as createMediaPickStore,w as hasMediaPanel,j as mediaPickStoreFor,O as requestPanelPick,P as settlePanelPick,G as useCancelPanelPick,x as useMediaPanel,F as usePanelPick,J as usePickFollowsSelection};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{clientOnly as e}from"./chunk-GXQCZJOP.js";import{ScreenStoreProvider as n}from"./chunk-
|
|
1
|
+
import{clientOnly as e}from"./chunk-GXQCZJOP.js";import{ScreenStoreProvider as n}from"./chunk-SARZN4M7.js";import{ScreenChrome as r}from"./chunk-4XQUWGIV.js";import{ScreenDocumentProvider as t,useScreenDocument as a}from"./chunk-7V5WZ46F.js";import{DEFAULT_SCREEN_WORDS as i}from"./chunk-PQXIFBDY.js";import{documentPermissions as s}from"./chunk-THWO5YVZ.js";import{useWords as o}from"./chunk-MFIRYGHW.js";import{useMemo as d}from"react";import{jsx as c,jsxs as l,Fragment as m}from"react/jsx-runtime";var g=e(n),h=e(r);function p({saving:e,onCancel:n,onDiscard:r,onSave:t}){/* @__PURE__ */
|
|
2
2
|
return c("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/30 p-4",role:"dialog","aria-modal":"true","aria-labelledby":"sf-leave-title",children:/* @__PURE__ */l("div",{className:"w-full max-w-sm rounded-lg bg-white p-5 shadow-xl",children:[
|
|
3
3
|
/* @__PURE__ */c("h2",{id:"sf-leave-title",className:"text-[15px] font-semibold text-zinc-900",children:"Unsaved changes"}),
|
|
4
4
|
/* @__PURE__ */c("p",{className:"mt-2 text-[13px] leading-relaxed text-zinc-600",children:"Your most recent edits haven’t finished saving yet. Save them before switching, or leave and discard them."}),
|
|
@@ -6,5 +6,5 @@ return c("div",{className:"fixed inset-0 z-[200] flex items-center justify-cente
|
|
|
6
6
|
/* @__PURE__ */c("button",{type:"button",onClick:n,className:"rounded-md border border-zinc-300 px-3 py-[7px] text-[13px] font-medium text-zinc-700 transition-colors hover:bg-zinc-100",children:"Cancel"}),
|
|
7
7
|
/* @__PURE__ */c("button",{type:"button",onClick:r,className:"rounded-md border border-red-200 px-3 py-[7px] text-[13px] font-medium text-red-600 transition-colors hover:bg-red-50",children:"Discard & leave"}),
|
|
8
8
|
/* @__PURE__ */c("button",{type:"button",onClick:t,disabled:e,className:"rounded-md bg-blue-600 px-3 py-[7px] text-[13px] font-medium text-white transition-colors hover:bg-blue-700 disabled:opacity-60",children:e?"Saving…":"Save & leave"})]})]})})}function u({target:e,addressing:n,onHostMessage:r,children:a}){/* @__PURE__ */
|
|
9
|
-
return c(t,{target:e,addressing:n,onHostMessage:r,children:a})}var v=(e,n)=>/* @__PURE__ */l(m,{children:[e,n]});function f({config:e,parts:n,wrap:r=v}){const{data:t,error:l,redirecting:m,ready:u,saveStatus:f,readOnly:x,onChange:b,pendingNav:N,cancelPendingNav:y,discardAndNavigate:k,saveAndNavigate:
|
|
10
|
-
/* @__PURE__ */c(g,{config:e,data:t,onChange:b,permissions:
|
|
9
|
+
return c(t,{target:e,addressing:n,onHostMessage:r,children:a})}var v=(e,n)=>/* @__PURE__ */l(m,{children:[e,n]});function f({config:e,parts:n,wrap:r=v}){const{data:t,error:l,redirecting:m,ready:u,saveStatus:f,readOnly:x,onChange:b,pendingNav:N,cancelPendingNav:y,discardAndNavigate:k,saveAndNavigate:j}=a(),C=d(()=>s(!x),[x]),w=o("screen",i);return m?/* @__PURE__ */c("div",{className:"sf-msg",children:w.loading}):l?/* @__PURE__ */c("div",{className:"sf-msg sf-msg--error",children:l}):u?t?r(
|
|
10
|
+
/* @__PURE__ */c(g,{config:e,data:t,onChange:b,permissions:C,parts:n,children:/* @__PURE__ */c(h,{})}),N&&/* @__PURE__ */c(p,{saving:"saving"===f,onCancel:y,onDiscard:k,onSave:()=>{j()}})):/* @__PURE__ */c("div",{className:"sf-msg",children:w.loading}):/* @__PURE__ */c("div",{className:"sf-msg",children:w.waitingForAuthorization})}export{f as DocumentScreen,u as ScreenMount};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=/* @__PURE__ */Symbol.for("efficient-web.efficient-backend");function n(n){return!!n&&!0===n[e]}function t(e){return e?.trim()||null}var r=null,i=/* @__PURE__ */new WeakMap,o=/* @__PURE__ */new WeakMap;function l(e){r=e}function u(e=k()){if(e.hostBackend)return e.hostBackend;let n=i.get(e);if(!n){const t=o.get(e)??r;if(!t)throw new Error("efficient-web-builder: this editor was given no backend, and its host named no default one. Pass `backend`, or load the host's default backend first (the storefront's is lib/efficient-backend).");n=t(e),i.set(e,n)}return n}function s(e){if(!e.registry)throw new Error("efficient-web-builder: this editor was mounted with no block registry. Pass `registry` to createEditorSession (the storefront's is lib/puck/config).");return e.registry}function d(e={}){const t=e.backend??null,r=null===t?e.defaultBackend??null:null,i=/* @__PURE__ */new Map,l={documentId:null,bridgedId:null},s={hostBackend:t,usesBridgedToken:null===t||n(t),blocks:e.blocks??null,registry:e.registry??null,chrome:e.chrome??null,documentHooks:e.documentHooks??null,claimsPage:e.claimsPage??!0,hostFailures:e.hostFailures??null,auth:{token:null,brandId:null},site:l,siteId:()=>l.documentId??l.bridgedId,cache:(e,n)=>(i.has(e)||i.set(e,n()),i.get(e)),forget(e){void 0===e?i.clear():i.delete(e)}};return r&&(o.set(s,r),Object.defineProperty(s,"usesBridgedToken",{get:()=>n(u(s)),enumerable:!0})),s}function c(e,n){e.site.documentId=t(n)}function a(e,n){e.site.bridgedId=t(n)}var f=d(),b=null,g=/* @__PURE__ */new Set;function k(){return b??f}function h(e){e.claimsPage&&(g.delete(e),b=e)}function m(e){e.claimsPage&&(g.add(e),queueMicrotask(()=>{g.delete(e)&&b===e&&(b=null)}))}function w(){return k().usesBridgedToken}function y(){f=d()}export{e as EFFICIENT_BACKEND,h as activateEaselSession,u as backendOf,d as createEaselSession,k as currentEaselSession,m as deactivateEaselSession,w as efficientClientOpen,n as isEfficientBackend,l as provideDefaultBackend,y as resetAmbientEaselSession,s as sessionRegistry,a as setSessionBridgedSite,c as setSessionDocumentSite};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{resolveMediaPick as e}from"./chunk-
|
|
1
|
+
import{resolveMediaPick as e}from"./chunk-KG7RJWOK.js";function t(t){const r=t;switch(r?.type){case"storefront-editor:media-picked":{const r=t;return r.requestId&&e(r.requestId,r.media??null),!0}case"storefront-editor:media-pick-cancelled":{const r=t;return r.requestId&&e(r.requestId,null),!0}default:return!1}}export{t as routeSharedHostMessage};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
return i(n,{easel:h,hotkeys:d.ownsDocument,children:/* @__PURE__ */i(
|
|
1
|
+
import{ScreenPartsProvider as t}from"./chunk-VSHV6KJQ.js";import{useEaselHost as r}from"./chunk-U3JP4VGF.js";import{createEasel as e,EaselProvider as n}from"./chunk-P67FP7PG.js";import{useState as o,useEffect as s}from"react";import{jsx as i}from"react/jsx-runtime";function a({config:a,data:c,onChange:m,permissions:p,parts:f,children:u}){const[h]=o(()=>e({config:a,data:c,permissions:p}));s(()=>{h.setConfig(a)},[h,a]),s(()=>{if(!m)return;let t=h.getState().appState.data;return h.subscribe(()=>{const r=h.getState().appState.data;r!==t&&(t=r,m(r))})},[h,m]),s(()=>{p&&h.setPermissions(p)},[h,p]);const d=r();/* @__PURE__ */
|
|
2
|
+
return i(n,{easel:h,hotkeys:d.ownsDocument,children:/* @__PURE__ */i(t,{parts:f,children:u})})}export{a as ScreenStoreProvider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{panelFieldsOf as t}from"./chunk-ZE7I3PLX.js";import{withoutDeviceGate as o,deviceMetaOf as n}from"./chunk-PWZOS45R.js";import{BUCKET_KEY as r}from"./chunk-R2HLPNQF.js";import{ANCHOR_FIELD_KEYS as e,foldMetaOf as s,MEDIA_FIELD_MARKER as c,TEXT_FIELD_MARKER as p,LINK_FIELD_MARKER as i}from"./chunk-DUVRZ456.js";import{STYLE_KIND as u,fieldKind as f,copyStyle as a,heldStyle as l,planPaste as m,pasteMessage as y}from"./chunk-57DJOKXT.js";var h=/* @__PURE__ */new Set([r.Style,r.Layout]),j=new Set(Object.values(r)),w=new Set(e),b=/* @__PURE__ */new Set(["focal","imageFocal"]),S=[c,p,i];function k(t){return`site:${t??""}`}function g(t){if(!t||"object"!=typeof t)return null;const n=t,r=o(t)??t,e=n[u]??r[u];if("string"==typeof e)return e;const s=n.options??r.options;if(Array.isArray(s)){return`choice:${s.map(t=>String(t?.value)).sort().join("|")}`}return f(r)}function v(t){const n=t,r=o(t);return S.some(t=>t in n||r&&t in r)}function L(o,r){const e=t(o,r)??{},c=[];let p=!1;for(const[t,o]of Object.entries(e))j.has(t)?p=h.has(t):p&&o&&"object"==typeof o&&!t.startsWith("_")&&(s(o)||w.has(t)||b.has(t)||v(o)||"slot"!==o.type&&c.push({path:[t],kind:g(o),counted:"mobile"!==n(o)?.tier}));return c}function O(t,o,n,r,e){a({scope:n,type:r.type,label:e,rows:t(o,r),props:r.props})}function d(t,o,n,r,e){const s=l(n);if(!s)return null;const c=m(s,{type:r.type,rows:t(o,r),props:r.props});return{...c,message:y(c,s.sourceLabel,e)}}function P(t,o,n,r){O(L,t,o,n,r)}function R(t,o,n,r){return d(L,t,o,n,r)}var Z={scope:t=>k(t.siteId),rows:(t,o)=>L(t,o),copy:(t,o,n,r)=>P(r,t,o,n),plan:(t,o,n,r)=>R(r,t,o,n)};function A(t){if(!t)return Z;const o=t.rows,n=o?(t,n)=>o(t,n):L;return{scope:t.scope??Z.scope,rows:(t,o)=>n(t,o),copy:t.copy??((t,o,r,e)=>O(n,e,t,o,r)),plan:t.plan??((t,o,r,e)=>d(n,e,t,o,r))}}export{P as copyNodeStyle,L as nodeStyleRows,R as planNodePaste,g as shopFieldKind,k as siteStyleScope,A as styleClipboardOf};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{textFieldIdentifier as n}from"./chunk-DUVRZ456.js";import{hidableText as r}from"./chunk-6W7WLPZH.js";function t(n,t){const o=r(n.props.name);if(o)return o;const e=r(n.props.altName);if(e)return e;const c=n.props.collection?.name;if(c)return c;const u=n.props.source?.title;if(u)return u;const s=n.props.code;return s?t?.(s)??s:""}function o(n,r,o,e,c){const u=o(t(n,e))||r(n.type);return c?c(n,"block",u):u}function e(r){if(!r)return null;for(const t of["name","altName"])if(n(r[t]))return t;return null}function c(r){const t=r?.name;return void 0===t||n(t)?"name":null}function u(n,t,o){const e=r(n.props?.name).trim()||t;return o?o(n,"section",e):e}export{u as rootRowName,c as sectionRenameProp,t as slotChildName,e as slotChildRenameProp,o as slotChildRowName};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DEFAULT_LOCK_WORDS as e}from"./chunk-RE4LP46F.js";var n=e=>"editing"===e.kind;function t(e){return e?{kind:"checking"}:{kind:"editing"}}var r=e=>"blocked"===e.kind||"readonly"===e.kind||"takenover"===e.kind?e.holder:null;function c(e){if(!e||"object"!=typeof e)return null;const n=e;return"string"!=typeof n.holder_name?null:{name:n.holder_name,secondsSinceSeen:"number"==typeof n.seconds_since_seen?n.seconds_since_seen:0,secondsSinceHeld:"number"==typeof n.seconds_since_held?n.seconds_since_held:0}}var s=e=>e?{edit:!0,insert:!0,delete:!0,duplicate:!0,drag:!1}:{edit:!1,insert:!1,delete:!1,duplicate:!1,drag:!1};function o(n,t=e){if(!Number.isFinite(n)||n<45)return t.justNow;const r=Math.round(n/60);if(r<60)return t.minutesAgo({count:r});const c=Math.round(r/60);return t.hoursAgo({count:c})}var a=(n,t=e)=>n.trim()||t.someone;function i(){return`tab-${"undefined"!=typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():Math.random().toString(36).slice(2)}`.slice(0,64)}var d="edit_lock_taken";function u(e,t,r){return!(n(e)||!n(t))&&(r.pending&&r.autoSaveEnabled&&!r.saveConflict)}function l(e,t,c){return!(null===r(e)||!n(t))&&(!c.pending&&!c.saveConflict)}function f(e,n){return e!==n&&Date.parse(e)>=Date.parse(n)}async function k(e){if(!e.ours)return!1;const n=await e.stored().catch(()=>null);return!(!n||!f(n,e.ours)||e.hasPending())&&(e.reload(),!0)}var h=8e3,y=3e4;function g(e){if(e.cancelled())return!1;const n=e.currentAccess();if("checking"!==n.kind)return!1;const t={kind:"editing"};return e.setAccess(t),u(n,t,e.heldWrite())&&e.releaseHeldWrite(),!0}function p(e){const{readFailure:n,conflictCode:t}=e,r=e=>{const t=n(e);return t&&409===t.status?c(t.data):null},s=e=>{const n=r(e);return n?{kind:"blocked",holder:n}:{kind:"editing"}},o=(e,n)=>{const t=r(e);return t?{kind:"blocked",holder:t}:n},a=(e,n)=>{const t=r(e);return t?{kind:"takenover",holder:t}:n},i=e=>{const t=n(e);return null!==t&&(401===t.status||403===t.status)};return{accessAfterClaimFailure:s,accessAfterTakeoverFailure:o,accessAfterHeartbeatFailure:a,isAuthRejection:i,readSaveConflict:e=>{const r=n(e);if(!r||409!==r.status)return null;if(!r.data||"object"!=typeof r.data)return null;const c=r.data;return c.code!==t?null:{savedBy:"string"==typeof c.saved_by?c.saved_by:"",savedByYou:!0===c.saved_by_you,secondsAgo:"number"==typeof c.seconds_ago?c.seconds_ago:0}},readLockTaken:e=>{const t=n(e);return t&&409===t.status&&t.data&&"object"==typeof t.data?t.data.code!==d?null:c(t.data)??{name:"",secondsSinceSeen:0,secondsSinceHeld:0}:null},makeClaimBeat:e=>{let n=!1;return async t=>{let r,c;try{const s=await e.claim(t);if(e.cancelled())return;r=e.currentAccess(),c={kind:"editing"},!n&&s.heartbeat_seconds>0&&(n=!0,e.startHeartbeat(1e3*s.heartbeat_seconds))}catch(n){if(e.cancelled())return;r=e.currentAccess(),c=t?o(n,r):"checking"===r.kind?s(n):a(n,r),i(n)&&e.stopHeartbeat()}e.setAccess(c);const d=e.heldWrite();u(r,c,d)?e.releaseHeldWrite():t&&l(r,c,d)&&e.reloadIfMoved?.()}}}}export{h as CLAIM_FAIL_OPEN_MS,d as EDIT_LOCK_TAKEN,y as FAIL_OPEN_RETRY_MS,t as accessForNewDocument,n as canWriteDocument,p as createEditLock,o as describeAge,s as documentPermissions,f as documentVersionMoved,r as holderOf,a as nameOrSomeone,i as newEaselClientId,g as openUnansweredClaim,c as readLockHolder,k as reloadIfVersionMoved,u as shouldReleaseHeldWrite,l as shouldReloadAfterTakeover};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useScreenBlockRules as e}from"./chunk-VSHV6KJQ.js";import{newNodeId as t,ROOT_ZONE as n}from"./chunk-PLVEGYK6.js";import{useEasel as o,useEaselApi as r}from"./chunk-P67FP7PG.js";import{useMemo as s}from"react";function i(i={}){const{dispatch:p}=o(e=>e),d=r(),c=!0===i.readOnly,a=e().resolveOnInsert,m=!0===(i.resolveOnInsert??a);return s(()=>{const e=(e,n,o)=>{const r=t(n);return c||p({type:"insert",componentType:n,destinationZone:e,destinationIndex:o,id:r}),r},o=e=>(m&&!c&&d.resolveNode(e,{trigger:"insert"}),e),r=(e,t,n)=>{c||p({type:"replace",destinationZone:e,destinationIndex:t,data:n})},s=(t,n,r)=>o(e(t,n,r));return{insertComponent:s,insertSection:(e,t)=>s(n,e,t),replaceComponent:r,seedChild:(t,n,s,i)=>{const p=e(t,s,n);r(t,n,{type:s,props:{id:p,...i}}),o(p)},insertNode:(t,n,s)=>{const i=e(t,s.type,n);return r(t,n,{type:s.type,props:{...s.props,id:i}}),o(i)},removeComponent:(e,t)=>{c||p({type:"remove",index:t,zone:e})},reorderComponent:(e,t,n)=>{c||p({type:"reorder",sourceIndex:t,destinationIndex:n,destinationZone:e})},duplicateComponent:(e,t)=>{c||p({type:"duplicate",sourceIndex:t,sourceZone:e})},select:e=>p({type:"setUi",ui:{itemSelector:e}}),setDocument:e=>{c||p({type:"setData",data:e})},commitDocument:e=>{c||p({type:"setData",data:()=>e,recordHistory:!0})}}},[p,c,m,d])}export{i as useSectionOps};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createContext as e,useContext as r,useRef as c,useEffect as n}from"react";import{jsx as s}from"react/jsx-runtime";var t={connected:!1,ownsDocument:!0,send:()=>{},subscribe:()=>()=>{},address:{search:()=>"",show:()=>{},load:()=>{},reload:()=>{}}},o=e(t);function a({host:e,children:r}){/* @__PURE__ */
|
|
2
|
+
return s(o.Provider,{value:e,children:r})}function d(){return r(o)}function i(e,r){const s=d(),t=c(r);t.current=r,n(()=>{if(e&&s.claimEscape)return s.claimEscape(e=>"Escape"===e.key&&(t.current(),!0))},[e,s])}function u(e){const r=/* @__PURE__ */new Set;return{host:{connected:!0,ownsDocument:!1,send:(r,c)=>{e.onMessage({type:r,...c})},subscribe:e=>(r.add(e),()=>{r.delete(e)}),address:e.address,...e.claimEscape?{claimEscape:e.claimEscape}:null},deliver:e=>{for(const c of[...r])c(e)}}}export{t as DETACHED_EASEL_HOST,o as EaselHostContext,a as EaselHostProvider,u as createEaselHost,d as useEaselHost,i as useHostEscape};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useScreenDocument as n}from"./chunk-
|
|
1
|
+
import{useScreenDocument as n}from"./chunk-7V5WZ46F.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-PQXIFBDY.js";import{EditNotice as r}from"./chunk-YC4TB3CJ.js";import{useWords as e}from"./chunk-MFIRYGHW.js";import{jsx as i}from"react/jsx-runtime";function t(){const{capabilities:t,access:c,takeOverEditing:a,viewReadOnly:s,saveConflict:m,reloadFromServer:u}=n(),{noun:l}=e("screen",o);return t.hasEditGuard?/* @__PURE__ */i(r,{access:c,conflict:m,noun:l,onTakeOver:a,onViewReadOnly:s,onReload:u}):null}export{t as PageEditGuardNotices};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{slotFieldsOf as n}from"./chunk-PLVEGYK6.js";import{usePickFollowsSelection as e}from"./chunk-R6WTQWAC.js";import{EaselCanvas as t,useSelectedFields as r}from"./chunk-P67FP7PG.js";import{Inspector as o}from"./chunk-BXZ6WLHC.js";import{DesktopIcon as u}from"./chunk-L5KW4HG5.js";import{createContext as i,useContext as l}from"react";import{jsx as s}from"react/jsx-runtime";var c={kind:"puck"};function f(n,e){const t=n,r=e,o=Object.keys(t);return o.length===Object.keys(r).length&&o.every(n=>Object.is(t[n],r[n]))}function a(n){const e=n;return"string"==typeof e.nodeId&&"string"==typeof e.slot}function d(e,t,r){const o=e.slotsOf?.(r);return o||n(t,r.type).map(n=>({slot:n,label:n,rung:!1}))}function p(n,e){return n.isFirst?n.isFirst(e):e.type===n.first}function k(n,e){return n.isLast?n.isLast(e):e.type===n.last}var m={},h={},v=()=>m,y=()=>"",b=()=>null,g=()=>{},L={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},j={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},O={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */s(u,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},P={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},w={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function C(){/* @__PURE__ */
|
|
2
|
+
return s(t,{height:"fill"})}function G(){const{id:n,fields:e,values:t,readOnly:u,onChange:i}=r();/* @__PURE__ */
|
|
3
|
+
return s("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */s(o,{fields:e,values:t,onChange:i,readOnly:u,idPrefix:n})})}var S=i({});function B({parts:n,children:e}){/* @__PURE__ */
|
|
4
|
+
return s(S.Provider,{value:n,children:e})}function D(){return l(S)}function x(){return(D().useOwnerName??y)()}function F(){return(D().useDocumentLabel??b)()}function I(n,e,t,r){return(D().useBridges??v)(n,e,t,r)}function N(n){return(D().useStandaloneBridges??v)(n)}function T(n,e){(D().useDocumentPass??g)(n,e)}function W(){return D().blockRules??L}function A(){return D().blockLook??j}function H(){return D().devices??O}function K(){return D().leftView??P}function R(){return D().pinned??w}function V(){return D().saveSwitch??!0}function Z(n){e(!0===D().pickFollowsSelection,n)}function E(){return D().add??h}function Q(){return D().styleClipboard??null}function X(){return D().nodeKeys??!0}function Y(){return D().notify??null}function q(){return D().Canvas??C}function z(){return D().CanvasHead??null}function J(){return D().canvasDrag??null}var M=i(null);function U({target:n,children:e}){/* @__PURE__ */
|
|
5
|
+
return s(M.Provider,{value:n,children:e})}function $(){return l(M)}function _(){return D().Inspector??G}export{c as SELECTION_MODE,U as ScreenCanvasTargetProvider,B as ScreenPartsProvider,p as isPinnedFirst,k as isPinnedLast,a as isSlotMode,f as sameInspectorMode,d as screenSlotsOf,E as useScreenAdd,A as useScreenBlockLook,W as useScreenBlockRules,I as useScreenBridges,J as useScreenCanvasDrag,q as useScreenCanvasFrame,z as useScreenCanvasHead,$ as useScreenCanvasTarget,H as useScreenDevices,F as useScreenDocumentLabel,T as useScreenDocumentPass,_ as useScreenInspectorPanel,K as useScreenLeftView,X as useScreenNodeKeys,Y as useScreenNotify,x as useScreenOwnerName,D as useScreenParts,Z as useScreenPickFollowsSelection,R as useScreenPinned,V as useScreenSaveSwitch,Q as useScreenStyleClipboard,N as useStandaloneScreenBridges};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEaselHost as n}from"./chunk-
|
|
1
|
+
import{useEaselHost as n}from"./chunk-U3JP4VGF.js";import{useEaselApi as o,bindUndoKeys as t}from"./chunk-P67FP7PG.js";import{useState as r,useEffect as u}from"react";function c(o){const t=n(),[c,e]=r(null);return u(()=>e(o.current),[o]),t.ownsDocument?"undefined"==typeof document?null:document:c}function e(r){const e=n(),m=o(),f=c(r);u(()=>{if(!e.ownsDocument&&f)return t(f,m)},[e,m,f])}export{c as useEaselKeyTarget,e as useEaselUndoKeys};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{DEFAULT_NOTICE_WORDS as e,DEFAULT_CHROME_WORDS as n}from"./chunk-ZJEBF4NB.js";import{holderOf as t,describeAge as i,nameOrSomeone as r}from"./chunk-
|
|
1
|
+
import{DEFAULT_NOTICE_WORDS as e,DEFAULT_CHROME_WORDS as n}from"./chunk-ZJEBF4NB.js";import{holderOf as t,describeAge as i,nameOrSomeone as r}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as a}from"./chunk-RE4LP46F.js";import{railTokens as o,EaselRail as s}from"./chunk-WZ7TGAAT.js";import{DEFAULT_RAIL_WORDS as l}from"./chunk-2OAZYSWJ.js";import{useWords as c}from"./chunk-MFIRYGHW.js";import{PanelLeftIcon as d,PanelRightIcon as u,MediaIcon as m,ImageIcon as h}from"./chunk-L5KW4HG5.js";import{jsx as p,jsxs as v,Fragment as f}from"react/jsx-runtime";import{useRef as b,useState as k,useCallback as g,useEffect as y,useLayoutEffect as w}from"react";function N({children:e}){/* @__PURE__ */
|
|
2
2
|
return p("div",{className:"es-topbar",children:e})}function C({kind:e,style:n,children:t}){/* @__PURE__ */
|
|
3
3
|
return p("div",{className:e?`es-cluster es-cluster--${e}`:"es-cluster",style:n,children:t})}function x(){/* @__PURE__ */
|
|
4
4
|
return p("div",{className:"es-divider-v","aria-hidden":"true"})}var P="undefined"==typeof window?y:w;function O({items:e,ariaLabel:n,onWords:t}){const i=c("rail",l),r=b(null),[a,d]=k(void 0),[u,m]=k(null),h=JSON.stringify(e.map(e=>e.label));P(()=>{const n=r.current?.querySelector(".es-rail");if(!n)return;const t=document.createElement("canvas").getContext?.("2d")??null,i=()=>{if(m(h),!t)return d(void 0);const i=function(e,n,t){const i=parseFloat(getComputedStyle(e).getPropertyValue(n));return Number.isFinite(i)?i:t}(n,"--es-rail-word-size",o.wordFontSize),r=getComputedStyle(n).getPropertyValue("--es-rail-word-weight").trim()||String(o.wordFontWeight),a=getComputedStyle(n.querySelector(".es-rail-btn")??n).fontFamily;t.font=`${r} ${i}px ${a}`;const s=e.map(e=>t.measureText(e.label).width),l=e=>Math.ceil(4*e)/4;d({labelsPx:l(s.reduce((e,n)=>e+n,0)),widestLabelPx:l(Math.max(0,...s))})};i();let a=!0;return document.fonts?.ready.then(()=>a&&i()),()=>{a=!1}},[h]);const v=b(t);v.current=t;const f=b(null),g=Boolean(t),y=e.map(e=>e.active?"1":"0").join("");return P(()=>{const e=r.current;if(!g||!e||u!==h)return;const n=()=>{const n=Array.from(e.querySelectorAll(".es-rail-word")),t=n.filter(e=>e.getBoundingClientRect().width>0).length,i=n.length>0&&t===n.length?"all":t>0?"chosen":"none";i!==f.current&&(f.current=i,v.current?.(i))};n();const t=e.ownerDocument.defaultView?.ResizeObserver,i=t?new t(n):null;return i?.observe(e),()=>i?.disconnect()},[g,u,h,a,y]),/* @__PURE__ */p("div",{ref:r,className:"es-cluster es-cluster--rail es-rail-fit",children:/* @__PURE__ */p(s,{items:e,ariaLabel:n??i.label,orientation:"row",wordFit:a})})}function L({label:e,onClick:n,disabled:t,state:i,buttonRef:r,children:a}){/* @__PURE__ */
|
|
@@ -6,20 +6,20 @@ return p("button",{ref:r,type:"button",className:i?`es-iconbtn es-iconbtn--${i}`
|
|
|
6
6
|
return p("div",{className:"es-devseg",role:"group","aria-label":r??a.device,children:e.map(e=>{const n=e.id===t;/* @__PURE__ */
|
|
7
7
|
return p("button",{type:"button",title:e.label,"aria-label":e.label,"aria-pressed":n,className:n?"is-active":void 0,onClick:()=>{n||i(e.id)},children:e.icon},e.id)})})}var B={idle:"is-quiet",saved:"is-quiet is-saved",saving:"is-saving",error:"is-error",off:"is-off","off-unsaved":"is-off is-unsaved"};function $({tone:e,label:n,counting:t,waitMs:i,ringRef:r,role:a}){/* @__PURE__ */
|
|
8
8
|
return v("span",{className:`es-savestate ${B[e]}`,role:a,"aria-live":"polite",children:[/* @__PURE__ */p("span",t?{ref:r,className:"es-savestate-ring is-counting",style:void 0!==i?{"--es-savewait":`${i}ms`}:void 0,"aria-hidden":"true"}:{className:"es-savestate-dot","aria-hidden":"true"}),n]})}function M({pressed:e,title:n,onToggle:t,children:i}){/* @__PURE__ */
|
|
9
|
-
return p("button",{type:"button",className:"es-savestate-toggle","aria-pressed":e,title:n,onClick:t,children:i})}var R="es-col-resizing";function z({side:e,width:t,min:i,max:r,defaultWidth:a,label:o,onResize:s}){const l=c("chrome",n),d=b(null),u=g((n,t)=>{const a="left"===e?n+t:n-t;return Math.round(Math.min(r,Math.max(i,a)))},[e,i,r]),m=g(e=>{d.current&&(d.current=null,document.body.classList.remove(R),e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))},[]),h=g(e=>{0===e.button&&(d.current={x:e.clientX,w:t,moved:!1},e.currentTarget.setPointerCapture(e.pointerId),document.body.classList.add(R))},[t]),v=g(e=>{const n=d.current;if(!n)return;if(0===e.buttons)return void m(e);const t=e.clientX-n.x;if(!n.moved){if(Math.abs(t)<3)return;n.moved=!0}s(u(n.w,t))},[s,u,m]),f=g(e=>{"ArrowLeft"===e.key?(e.preventDefault(),s(e=>u(e,-16))):"ArrowRight"===e.key?(e.preventDefault(),s(e=>u(e,16))):"Home"===e.key&&(e.preventDefault(),s(a))},[s,u,a]);return y(()=>()=>document.body.classList.remove(R),[]),/* @__PURE__ */p("div",{className:`es-resizer es-resizer--${e}`,role:"separator",tabIndex:0,"aria-orientation":"vertical","aria-label":o,"aria-valuenow":t,"aria-valuemin":i,"aria-valuemax":r,title:l.resize,onPointerDown:h,onPointerMove:v,onPointerUp:m,onPointerCancel:m,onLostPointerCapture:m,onDoubleClick:()=>s(a),onKeyDown:f,children:/* @__PURE__ */p("span",{className:"es-resizer-bar","aria-hidden":"true"})})}function
|
|
9
|
+
return p("button",{type:"button",className:"es-savestate-toggle","aria-pressed":e,title:n,onClick:t,children:i})}var R="es-col-resizing";function z({side:e,width:t,min:i,max:r,defaultWidth:a,label:o,onResize:s}){const l=c("chrome",n),d=b(null),u=g((n,t)=>{const a="left"===e?n+t:n-t;return Math.round(Math.min(r,Math.max(i,a)))},[e,i,r]),m=g(e=>{d.current&&(d.current=null,document.body.classList.remove(R),e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))},[]),h=g(e=>{0===e.button&&(d.current={x:e.clientX,w:t,moved:!1},e.currentTarget.setPointerCapture(e.pointerId),document.body.classList.add(R))},[t]),v=g(e=>{const n=d.current;if(!n)return;if(0===e.buttons)return void m(e);const t=e.clientX-n.x;if(!n.moved){if(Math.abs(t)<3)return;n.moved=!0}s(u(n.w,t))},[s,u,m]),f=g(e=>{"ArrowLeft"===e.key?(e.preventDefault(),s(e=>u(e,-16))):"ArrowRight"===e.key?(e.preventDefault(),s(e=>u(e,16))):"Home"===e.key&&(e.preventDefault(),s(a))},[s,u,a]);return y(()=>()=>document.body.classList.remove(R),[]),/* @__PURE__ */p("div",{className:`es-resizer es-resizer--${e}`,role:"separator",tabIndex:0,"aria-orientation":"vertical","aria-label":o,"aria-valuenow":t,"aria-valuemin":i,"aria-valuemax":r,title:l.resize,onPointerDown:h,onPointerMove:v,onPointerUp:m,onPointerCancel:m,onLostPointerCapture:m,onDoubleClick:()=>s(a),onKeyDown:f,children:/* @__PURE__ */p("span",{className:"es-resizer-bar","aria-hidden":"true"})})}function T({icon:e,name:n,kind:t,actions:i}){/* @__PURE__ */
|
|
10
10
|
return v("div",{className:"es-insp-head",children:[
|
|
11
11
|
/* @__PURE__ */p("span",{className:"es-insp-chip","aria-hidden":"true",children:e}),
|
|
12
12
|
/* @__PURE__ */v("div",{className:"es-insp-titles",children:[
|
|
13
13
|
/* @__PURE__ */p("h2",{className:"es-insp-name",children:n}),
|
|
14
|
-
/* @__PURE__ */p("div",{className:"es-insp-kind",children:t})]}),i?/* @__PURE__ */p("div",{className:"es-insp-actions",children:i}):null]})}function
|
|
15
|
-
return p("button",{ref:s,type:"button",className:a?"es-insp-iconbtn es-insp-iconbtn--danger":"es-insp-iconbtn",title:n??e,"aria-label":e,"aria-haspopup":t,"aria-expanded":o,disabled:r,onClick:i,children:l})}function
|
|
14
|
+
/* @__PURE__ */p("div",{className:"es-insp-kind",children:t})]}),i?/* @__PURE__ */p("div",{className:"es-insp-actions",children:i}):null]})}function F({label:e,title:n,hasPopup:t,onClick:i,disabled:r,danger:a,expanded:o,buttonRef:s,children:l}){/* @__PURE__ */
|
|
15
|
+
return p("button",{ref:s,type:"button",className:a?"es-insp-iconbtn es-insp-iconbtn--danger":"es-insp-iconbtn",title:n??e,"aria-label":e,"aria-haspopup":t,"aria-expanded":o,disabled:r,onClick:i,children:l})}function W({name:e,onSelect:t,label:i,inline:r}){const a=c("chrome",n),o=i??a.upLevel,s=/* @__PURE__ */v("button",{type:"button",className:"es-insp-up-btn",title:o,"aria-label":a.upLevelTo({label:o,name:e}),onClick:t,children:[
|
|
16
16
|
/* @__PURE__ */p("span",{className:"es-insp-up-arrow","aria-hidden":"true",children:"←"}),
|
|
17
|
-
/* @__PURE__ */p("span",{className:"es-insp-up-name",children:e})]});return r?s:/* @__PURE__ */p("div",{className:"es-insp-up",children:s})}function
|
|
18
|
-
return p(
|
|
19
|
-
return p(
|
|
17
|
+
/* @__PURE__ */p("span",{className:"es-insp-up-name",children:e})]});return r?s:/* @__PURE__ */p("div",{className:"es-insp-up",children:s})}function j({context:e,pick:t,onCancel:i,onHide:r,side:a="left"}){const o=c("chrome",n),s=r?/* @__PURE__ */p(F,{label:o.hidePanelLabel({side:a}),title:o.hidePanel,onClick:r,children:/* @__PURE__ */p("left"===a?d:u,{size:16})}):null;if(!t)/* @__PURE__ */
|
|
18
|
+
return p(T,{icon:/* @__PURE__ */p(m,{}),name:o.mediaLibrary,kind:e,actions:s??void 0});const l=o.mediaKinds[t.kind];/* @__PURE__ */
|
|
19
|
+
return p(T,{icon:/* @__PURE__ */p(h,{size:15}),name:o.mediaChoose({kind:l}),kind:t.field?o.mediaFor({field:t.field}):e,actions:/* @__PURE__ */v(f,{children:[
|
|
20
20
|
/* @__PURE__ */p("button",{type:"button",className:"es-btn-ghost es-insp-textbtn",title:o.mediaKeep({kind:l}),onClick:i,children:o.mediaCancel}),s?/* @__PURE__ */v(f,{children:[
|
|
21
|
-
/* @__PURE__ */p("span",{className:"es-insp-divider","aria-hidden":"true"}),s]}):null]})})}function A(e){return/svg/i.test(e)?"svg":e.startsWith("video")?"video":"image"}var D={notice:e,lock:a};function
|
|
21
|
+
/* @__PURE__ */p("span",{className:"es-insp-divider","aria-hidden":"true"}),s]}):null]})})}function A(e){return/svg/i.test(e)?"svg":e.startsWith("video")?"video":"image"}var D={notice:e,lock:a};function H(e,n,a,o=D){const s=o.notice,l=t(e),c={kind:"reload",label:s.reload};if(n){const e=i(n.secondsAgo,o.lock);return{tone:"warning",urgent:!0,lead:n.savedByYou?s.savedByYou({noun:a,when:e}):s.savedByOther({name:r(n.savedBy,o.lock),noun:a,when:e}),body:s.conflictBody,actions:l?[c,{kind:"take-over",label:s.takeOver,title:s.takeOverWhileDeciding}]:[c]}}if(!l)return null;const d=r(l.name,o.lock),u=i(l.secondsSinceSeen,o.lock);switch(e.kind){case"takenover":return{tone:"warning",urgent:!0,lead:s.tookOver({name:d,noun:a,when:i(l.secondsSinceHeld,o.lock)}),body:s.tookOverBody,actions:[{kind:"take-back",label:s.takeBack},c]};case"readonly":return{tone:"neutral",urgent:!1,lead:s.viewingOnly,body:s.viewingOnlyBody({name:d,noun:a,seen:u}),actions:[{kind:"take-over",label:s.takeOver}]};default:return{tone:"warning",urgent:!1,lead:s.editing({name:d,noun:a}),body:s.editingBody({seen:u}),actions:[{kind:"view-read-only",label:s.viewReadOnly},{kind:"take-over",label:s.takeOver,title:s.takeOverTold}]}}}function q({access:n,conflict:t,noun:i,onTakeOver:r,onViewReadOnly:o,onReload:s}){const l=H(n,t,i,{notice:c("notice",e),lock:c("lock",a)});if(!l)return null;const d={reload:s,"take-over":r,"take-back":r,"view-read-only":o};/* @__PURE__ */
|
|
22
22
|
return v("div",{className:`es-notice is-${l.tone}`,role:l.urgent?"alert":"status",children:[
|
|
23
23
|
/* @__PURE__ */v("span",{className:"es-notice-text",children:[
|
|
24
24
|
/* @__PURE__ */p("strong",{children:l.lead})," ",l.body]}),
|
|
25
|
-
/* @__PURE__ */p("span",{className:"es-notice-actions",children:l.actions.map(e=>/* @__PURE__ */p("button",{type:"button",className:"es-notice-btn",title:e.title,onClick:d[e.kind],children:e.label},e.kind))})]})}var I={left:288,right:320},
|
|
25
|
+
/* @__PURE__ */p("span",{className:"es-notice-actions",children:l.actions.map(e=>/* @__PURE__ */p("button",{type:"button",className:"es-notice-btn",title:e.title,onClick:d[e.kind],children:e.label},e.kind))})]})}var I={left:288,right:320},V=220,Y=560;function K(e){return Math.min(560,Math.max(220,Math.round(e)))}function Z(e){return{"--es-left-w":`${e.left}px`,"--es-right-w":`${e.right}px`}}function E(e,n){e.style.setProperty("--es-left-w",`${n.left}px`),e.style.setProperty("--es-right-w",`${n.right}px`)}export{I as DEFAULT_PANEL_W,S as DeviceSwitch,L as EaselIconButton,N as EaselTopBar,q as EditNotice,T as InspectorHead,F as InspectorIconButton,W as InspectorUpLevel,Y as MAX_PANEL_W,V as MIN_PANEL_W,j as MediaPanelHead,z as PanelResizeHandle,$ as SaveState,M as SaveStateToggle,C as TopBarCluster,x as TopBarDivider,O as TopBarRail,K as clampPanelWidth,H as editNotice,A as mediaPickKind,Z as panelWidthVars,E as setPanelWidthVars};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useSectionOps as o}from"./chunk-
|
|
1
|
+
import{useSectionOps as o}from"./chunk-TLZG2FCF.js";import{decodePartId as e,encodePartId as r}from"./chunk-IYT6NN2J.js";import{usePreviewParts as t}from"./chunk-I54UCYOU.js";import{SELECTION_MODE as n}from"./chunk-VSHV6KJQ.js";import{useEasel as p}from"./chunk-P67FP7PG.js";import{useCallback as d,useEffect as c}from"react";var s=o=>"part"===o.kind;function m({mode:m,setMode:i,onOpenPart:a}){const{getSelectorForId:u}=p(o=>o),I=o(),{setSelectedPartId:f,setSelectHandler:k}=t(),l=d(o=>{const r=e(o);if(!r)return;const{nodeId:t,propKey:p}=r;p?(i(o=>s(o)&&o.nodeId===t&&o.propKey===p?o:{kind:"part",nodeId:t,propKey:p}),a?.(t)):i(o=>"part"===o.kind?n:o)},[i,a]);c(()=>{k(l)},[k,l]);const P=s(m)?r(m.nodeId,m.propKey):null;c(()=>{f(P)},[P,f]);return{selectNode:d(o=>{i(()=>n);const e=u(o);e&&I.select(e)},[i,u,I]),openPartId:P}}export{m as usePartBridge};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DEFAULT_PANEL_W as a,clampPanelWidth as r}from"./chunk-YC4TB3CJ.js";var s="sf-editor-panel-widths",t={...a},e=a=>r(a);export{t as DEFAULT_PANEL_W,s as PANEL_WIDTHS_KEY,e as clampPanelWidth};
|
package/dist/drag/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
-
import { P as Place
|
|
3
|
+
import { P as Place } from '../types-41704JE4.js';
|
|
4
4
|
import { D as DragSession } from '../session-DSQFmIvx.js';
|
|
5
5
|
export { a as DragHeld, c as createDragSession } from '../session-DSQFmIvx.js';
|
|
6
|
-
|
|
6
|
+
export { B as Box, a as CanvasDragLayer, b as CanvasDragLayerProps, C as CanvasDragModel, c as CanvasDropTarget, d as CanvasSeam, e as CanvasSource, f as CanvasZone, E as EMPTY_MEASURE, H as HANDLE_GRACE_MS, M as MeasuredCanvas, g as MeasuredNode, h as canvasTarget, i as contains, j as gapInZone, k as gapLine, m as measureCanvas, p as pickSource, s as seamsBetween } from '../CanvasDragLayer-zgYT1xwY.js';
|
|
7
7
|
import { D as DragWords } from '../words-BDignMl_.js';
|
|
8
|
+
import '../watch-BTYOJpQU.js';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Where a drop lands — the engine's one hit rule, as pure functions (blueprint
|
|
@@ -136,167 +137,6 @@ type TreeDrag<I> = {
|
|
|
136
137
|
};
|
|
137
138
|
declare function useTreeDrag<I>(options: TreeDragOptions<I>): TreeDrag<I>;
|
|
138
139
|
|
|
139
|
-
/**
|
|
140
|
-
* Where a drop on the CANVAS lands — pure functions over measured boxes
|
|
141
|
-
* (blueprint step 3.2). The tree's rule (./hit) is about rows in a list; the
|
|
142
|
-
* canvas is boxes inside boxes, laid out down the page or across it, so it
|
|
143
|
-
* needs its own — the campaign designer's overlay, made general:
|
|
144
|
-
*
|
|
145
|
-
* - ONE HANDLE: the smallest box under the pointer wins, so hovering an image
|
|
146
|
-
* offers the image, not the section it sits in (their corners are a few
|
|
147
|
-
* pixels apart); a parent is picked up by hovering its own padding.
|
|
148
|
-
* - THE ZONE: the innermost list under the pointer that will take the drop. A
|
|
149
|
-
* refused inner zone falls through to the next one out — a section dragged
|
|
150
|
-
* over a column lands between sections, not nowhere. (Decided again on
|
|
151
|
-
* 2026-10-07; see `canvasTarget`.)
|
|
152
|
-
* - THE GAP: along the zone's own axis — down a column, ACROSS a row of
|
|
153
|
-
* columns — counted against the children's midpoints; the line is drawn in
|
|
154
|
-
* the middle of that gap, horizontal or vertical to match.
|
|
155
|
-
*
|
|
156
|
-
* All boxes are in ONE coordinate space: the layer drawn over the canvas.
|
|
157
|
-
*/
|
|
158
|
-
|
|
159
|
-
type Box = {
|
|
160
|
-
left: number;
|
|
161
|
-
top: number;
|
|
162
|
-
width: number;
|
|
163
|
-
height: number;
|
|
164
|
-
};
|
|
165
|
-
/** Something on the canvas that can be picked up. */
|
|
166
|
-
type CanvasSource<I> = {
|
|
167
|
-
key: string;
|
|
168
|
-
item: I;
|
|
169
|
-
box: Box;
|
|
170
|
-
/** What the handle calls it — "Image", "Section". */
|
|
171
|
-
label: string;
|
|
172
|
-
/** The handle's tooltip. Default "Drag to move this image". */
|
|
173
|
-
title?: string;
|
|
174
|
-
/** Where it sits now — a drop back there is a no-op. */
|
|
175
|
-
from?: Place;
|
|
176
|
-
};
|
|
177
|
-
/** A list on the canvas that takes drops: a slot, laid out one way. */
|
|
178
|
-
type CanvasZone = {
|
|
179
|
-
key: string;
|
|
180
|
-
list: SlotAddress;
|
|
181
|
-
box: Box;
|
|
182
|
-
/** 'y': children stack down; 'x': they sit across (columns). */
|
|
183
|
-
axis: 'x' | 'y';
|
|
184
|
-
/** The children, in order. */
|
|
185
|
-
children: Box[];
|
|
186
|
-
};
|
|
187
|
-
/** The gap between two sections, offered as a place to add one. */
|
|
188
|
-
type CanvasSeam = {
|
|
189
|
-
key: string;
|
|
190
|
-
place: Place;
|
|
191
|
-
box: Box;
|
|
192
|
-
};
|
|
193
|
-
declare const contains: (b: Box, x: number, y: number) => boolean;
|
|
194
|
-
/** The smallest source under the point — the innermost thing. */
|
|
195
|
-
declare function pickSource<I>(sources: readonly CanvasSource<I>[], x: number, y: number): CanvasSource<I> | null;
|
|
196
|
-
/** The gap the point means in a zone: children whose middle it has passed. */
|
|
197
|
-
declare function gapInZone(zone: CanvasZone, x: number, y: number): number;
|
|
198
|
-
/** The drop line for a gap: 2px, in the middle of the space between two children. */
|
|
199
|
-
declare function gapLine(zone: CanvasZone, gap: number): Box;
|
|
200
|
-
type CanvasTarget = {
|
|
201
|
-
zone: CanvasZone;
|
|
202
|
-
to: Place;
|
|
203
|
-
line: Box;
|
|
204
|
-
} | null;
|
|
205
|
-
/**
|
|
206
|
-
* Where a drop at the point lands: the innermost zone under it that takes it.
|
|
207
|
-
* `accept` answers for the place; a refused zone falls through to the one
|
|
208
|
-
* outside it. A drop that would leave the thing where it is lands NOWHERE — it
|
|
209
|
-
* does not fall through to an outer list, which would move it somewhere the
|
|
210
|
-
* pointer is not.
|
|
211
|
-
*
|
|
212
|
-
* ── THE FALL-THROUGH STAYS, AND A HOST MAY END IT (second host, 2026-10-07) ──
|
|
213
|
-
* A host reported it as a surprise: a Columns block dragged onto a column,
|
|
214
|
-
* which refuses columns, landed at the top level instead of being refused; and
|
|
215
|
-
* a block picked up INSIDE a container, held over a part of that container
|
|
216
|
-
* that will not take it, left the container for the page.
|
|
217
|
-
*
|
|
218
|
-
* It stays the rule, for three reasons. A page is covered by its inner lists:
|
|
219
|
-
* without the fall-through a section could be dropped only on the few pixels
|
|
220
|
-
* of the page's own list that show between sections. Both editors this was
|
|
221
|
-
* built for have shipped on it. And it is not silent: the line is drawn where
|
|
222
|
-
* the drop WILL land before the button is let go, across the page for a drop
|
|
223
|
-
* the page takes.
|
|
224
|
-
*
|
|
225
|
-
* But what surprises is the host's to know — the engine never learns what a
|
|
226
|
-
* column is — so the host may answer for each refusal: `fallThrough(refused)`
|
|
227
|
-
* is asked with the place that just refused, and `false` ends it there. The
|
|
228
|
-
* drop lands nowhere, no line is drawn, and the browser shows it refused.
|
|
229
|
-
* Left out, every refusal falls through, as before.
|
|
230
|
-
*/
|
|
231
|
-
declare function canvasTarget(zones: readonly CanvasZone[], x: number, y: number, accept: (to: Place) => boolean, isNoOp?: (to: Place) => boolean, fallThrough?: (refused: Place) => boolean): CanvasTarget;
|
|
232
|
-
/** The seams between a zone's children — where "+ Add section" goes. */
|
|
233
|
-
declare function seamsBetween(zone: CanvasZone, keyPrefix?: string): CanvasSeam[];
|
|
234
|
-
|
|
235
|
-
type MeasuredNode = {
|
|
236
|
-
id: string;
|
|
237
|
-
place: Place;
|
|
238
|
-
box: Box;
|
|
239
|
-
};
|
|
240
|
-
type MeasuredCanvas = {
|
|
241
|
-
nodes: MeasuredNode[];
|
|
242
|
-
zones: CanvasZone[];
|
|
243
|
-
};
|
|
244
|
-
declare const EMPTY_MEASURE: MeasuredCanvas;
|
|
245
|
-
declare function measureCanvas(canvas: CanvasTarget$1, layer: Element): MeasuredCanvas;
|
|
246
|
-
|
|
247
|
-
type CanvasDragModel<I> = {
|
|
248
|
-
/** What may be picked up. Leave out what cannot move — a pinned section, a block with nowhere to go. */
|
|
249
|
-
sources: CanvasSource<I>[];
|
|
250
|
-
/** The lists that take drops. */
|
|
251
|
-
zones: CanvasZone[];
|
|
252
|
-
/** The gaps offered as "+ Add section" (see `seamsBetween`). */
|
|
253
|
-
seams?: CanvasSeam[];
|
|
254
|
-
};
|
|
255
|
-
type CanvasDragLayerProps<I> = {
|
|
256
|
-
canvas: CanvasTarget$1 | null;
|
|
257
|
-
session: DragSession<I>;
|
|
258
|
-
/** Turn what was measured into what may be picked up and dropped on. */
|
|
259
|
-
model: (measured: MeasuredCanvas) => CanvasDragModel<I>;
|
|
260
|
-
canDrop: (item: I, to: Place) => boolean;
|
|
261
|
-
onDrop: (item: I, to: Place) => void;
|
|
262
|
-
/**
|
|
263
|
-
* A drop the innermost list under the pointer refuses is offered to the next
|
|
264
|
-
* list out: a section held over a column lands between sections, and the
|
|
265
|
-
* line shows where (./canvasHit). Answer `false` here to END it at the list
|
|
266
|
-
* that refused — nothing is drawn and nothing lands — for a drop where
|
|
267
|
-
* falling through would surprise: a Columns block over a column, or a block
|
|
268
|
-
* leaving the container it was picked up in.
|
|
269
|
-
*
|
|
270
|
-
* Asked only about a place `canDrop` has just refused: `refused` is that
|
|
271
|
-
* place, `from` where the thing was picked up (absent for a new one, from
|
|
272
|
-
* the Add list). Left out, every refusal falls through.
|
|
273
|
-
*/
|
|
274
|
-
fallThrough?: (item: I, refused: Place, from?: Place) => boolean;
|
|
275
|
-
/** The handle CLICKED, not dragged: select what it names. Absent: a click does nothing. */
|
|
276
|
-
onPick?: (item: I) => void;
|
|
277
|
-
/** "+ Add section" in a seam: open the Add panel at that place. */
|
|
278
|
-
onSeamAdd?: (place: Place) => void;
|
|
279
|
-
seamLabel?: string;
|
|
280
|
-
/** "+ Add block" in an empty slot: open the Add panel there. */
|
|
281
|
-
onZoneAdd?: (place: Place) => void;
|
|
282
|
-
zoneAddLabel?: string;
|
|
283
|
-
readOnly?: boolean;
|
|
284
|
-
/** Re-measure when this changes — the document's revision. Layout changes re-measure by themselves. */
|
|
285
|
-
revision?: unknown;
|
|
286
|
-
/** How the canvas is measured. Default: Puck's markers (./measure). */
|
|
287
|
-
measure?: (canvas: CanvasTarget$1, layer: Element) => MeasuredCanvas;
|
|
288
|
-
/**
|
|
289
|
-
* The layer's own words in the host's language:
|
|
290
|
-
* `useEaselStrings().drag.canvas` (0.95.0). Left out, English. `seamLabel`
|
|
291
|
-
* and `zoneAddLabel` above still win for their one word. A prop, not the
|
|
292
|
-
* strings provider: drag imports only its own lane.
|
|
293
|
-
*/
|
|
294
|
-
words?: DragWords['canvas'];
|
|
295
|
-
};
|
|
296
|
-
/** How long the handle waits for the pointer on its way from the frame. */
|
|
297
|
-
declare const HANDLE_GRACE_MS = 140;
|
|
298
|
-
declare function CanvasDragLayer<I>(props: CanvasDragLayerProps<I>): react.JSX.Element;
|
|
299
|
-
|
|
300
140
|
/**
|
|
301
141
|
* One thing the Add list offers.
|
|
302
142
|
*
|
|
@@ -429,4 +269,4 @@ declare function frameScrollBox(doc: Document): HTMLElement | null;
|
|
|
429
269
|
*/
|
|
430
270
|
declare function startAutoScroll(box: HTMLElement, edges?: Element): () => void;
|
|
431
271
|
|
|
432
|
-
export { AUTO_SCROLL_EDGE, AUTO_SCROLL_MAX_SPEED, type AddGroup, AddPanel, type AddPanelProps, type AddTile,
|
|
272
|
+
export { AUTO_SCROLL_EDGE, AUTO_SCROLL_MAX_SPEED, type AddGroup, AddPanel, type AddPanelProps, type AddTile, DragSession, DragWords, type DropRow, type DropSide, type DropSpot, type TreeDrag, type TreeDragOptions, type TreeDragRowOptions, type TreeDragRowProps, type TreeDragSeamOptions, type TreeDragSeamProps, autoScrollDelta, autoScrollSpeed, dropEffectFor, dropOnRow, frameScrollBox, gapToMoveIndex, isNoOpDrop, scrollBoxOf, scrollParent, startAutoScroll, stepGap, useTreeDrag };
|
|
@@ -316,6 +316,60 @@ declare function reloadIfVersionMoved(d: {
|
|
|
316
316
|
hasPending: () => boolean;
|
|
317
317
|
reload: () => void;
|
|
318
318
|
}): Promise<boolean>;
|
|
319
|
+
/**
|
|
320
|
+
* How long the claim that OPENS a document may go unanswered before the editor
|
|
321
|
+
* decides nobody else holds it and lets the operator write (owner ruling R7,
|
|
322
|
+
* Victor Mau, 2026-10-09: the 8 s fail-open, for both editors).
|
|
323
|
+
*
|
|
324
|
+
* WHY A CLOCK AT ALL. `checking` holds every write and draws no notice, so it
|
|
325
|
+
* must end. A refused claim ends it (`accessAfterClaimFailure` fails open on
|
|
326
|
+
* anything but a 409 naming a holder), but a claim can also HANG — a proxy
|
|
327
|
+
* holding the socket, a laptop waking with a request half-sent — and a hang
|
|
328
|
+
* never rejects, so no `catch` ever runs: the operator types into a canvas
|
|
329
|
+
* that saves nothing and says nothing. The clock is the same fail-open
|
|
330
|
+
* judgement as a refused claim, on time instead of on an error.
|
|
331
|
+
*
|
|
332
|
+
* WHY 8 SECONDS. The campaign designer's own timeout, chosen there and kept
|
|
333
|
+
* (its `CLAIM_TIMEOUT_MS`): generous, because a slow claim is normal on a
|
|
334
|
+
* waking laptop or a busy backend and opening early would just race the real
|
|
335
|
+
* answer; bounded, because past a few seconds of typing into a canvas that
|
|
336
|
+
* keeps nothing, the operator is losing work they cannot see. The save-time
|
|
337
|
+
* version check stands behind every write either way.
|
|
338
|
+
*
|
|
339
|
+
* ONE NUMBER: the screen arms it (efficient-easel/screen, `openUnansweredClaim`
|
|
340
|
+
* below), and a host that once raced its own claim against the same 8 s can
|
|
341
|
+
* import this instead of keeping a copy.
|
|
342
|
+
*/
|
|
343
|
+
declare const CLAIM_FAIL_OPEN_MS = 8000;
|
|
344
|
+
/**
|
|
345
|
+
* How often a document opened on the clock tries its claim again, until a
|
|
346
|
+
* claim answers (R7: "the heartbeat keeps trying").
|
|
347
|
+
*
|
|
348
|
+
* The heartbeat's interval is the SERVER's (`heartbeat_seconds`, so it never
|
|
349
|
+
* drifts out of step with the expiry it is paired with), and a claim that never
|
|
350
|
+
* answered never named one. Until one does, the editor still has to tell the
|
|
351
|
+
* backend it is here, or the next person walks in unwarned; so it beats at the
|
|
352
|
+
* backends' own interval today (`EDIT_HEARTBEAT_SECONDS`, 30 s), and the first
|
|
353
|
+
* claim that answers starts the server's interval in its place.
|
|
354
|
+
*/
|
|
355
|
+
declare const FAIL_OPEN_RETRY_MS = 30000;
|
|
356
|
+
/**
|
|
357
|
+
* The claim that opened a document has not answered within
|
|
358
|
+
* {@link CLAIM_FAIL_OPEN_MS}: grant the document, as a claim that FAILS OPEN
|
|
359
|
+
* would, and send the write that was held for it. Answers whether it did —
|
|
360
|
+
* only a document still `checking` is opened. A claim that answered in time
|
|
361
|
+
* has moved it on (to `editing`, or `blocked` by a 409), a TAKE-OVER never
|
|
362
|
+
* moves to `checking` at all (it keeps the state it was pressed from, which is
|
|
363
|
+
* what a hung take-over must keep too), and a document the editor has left is
|
|
364
|
+
* not granted.
|
|
365
|
+
*
|
|
366
|
+
* What happens next is the beat's. The caller keeps beating
|
|
367
|
+
* ({@link FAIL_OPEN_RETRY_MS}), and the late answer of the claim that hung is
|
|
368
|
+
* still heard, but as a HEARTBEAT's: the document is `editing` by then, so a
|
|
369
|
+
* 409 naming a holder moves it to `takenover` and the edits made since are held
|
|
370
|
+
* from then on, exactly as a later beat finding somebody else in it would.
|
|
371
|
+
*/
|
|
372
|
+
declare function openUnansweredClaim(deps: Pick<ClaimBeatDeps, 'cancelled' | 'currentAccess' | 'heldWrite' | 'setAccess' | 'releaseHeldWrite'>): boolean;
|
|
319
373
|
/** A failed request reduced to the only two things any decision here needs. */
|
|
320
374
|
type EditLockFailure = {
|
|
321
375
|
status: number;
|
|
@@ -351,4 +405,4 @@ type EditLock = {
|
|
|
351
405
|
/** Bind the decisions to one editor's HTTP client and document type. */
|
|
352
406
|
declare function createEditLock(adapter: EditLockAdapter): EditLock;
|
|
353
407
|
|
|
354
|
-
export { type ClaimBeatDeps, type DocumentPermissions, EDIT_LOCK_TAKEN, type EditAccess, type EditLock, type EditLockAdapter, type EditLockBody, type EditLockFailure, type HeldWrite, type LockHolder, type LockWords, type SaveConflict, accessForNewDocument, canWriteDocument, createEditLock, describeAge, documentPermissions, documentVersionMoved, holderOf, nameOrSomeone, newEaselClientId, readLockHolder, reloadIfVersionMoved, shouldReleaseHeldWrite, shouldReloadAfterTakeover };
|
|
408
|
+
export { CLAIM_FAIL_OPEN_MS, type ClaimBeatDeps, type DocumentPermissions, EDIT_LOCK_TAKEN, type EditAccess, type EditLock, type EditLockAdapter, type EditLockBody, type EditLockFailure, FAIL_OPEN_RETRY_MS, type HeldWrite, type LockHolder, type LockWords, type SaveConflict, accessForNewDocument, canWriteDocument, createEditLock, describeAge, documentPermissions, documentVersionMoved, holderOf, nameOrSomeone, newEaselClientId, openUnansweredClaim, readLockHolder, reloadIfVersionMoved, shouldReleaseHeldWrite, shouldReloadAfterTakeover };
|
package/dist/edit-lock/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{EDIT_LOCK_TAKEN,accessForNewDocument,canWriteDocument,createEditLock,describeAge,documentPermissions,documentVersionMoved,holderOf,nameOrSomeone,newEaselClientId,readLockHolder,reloadIfVersionMoved,shouldReleaseHeldWrite,shouldReloadAfterTakeover}from"../chunk-
|
|
1
|
+
export{CLAIM_FAIL_OPEN_MS,EDIT_LOCK_TAKEN,FAIL_OPEN_RETRY_MS,accessForNewDocument,canWriteDocument,createEditLock,describeAge,documentPermissions,documentVersionMoved,holderOf,nameOrSomeone,newEaselClientId,openUnansweredClaim,readLockHolder,reloadIfVersionMoved,shouldReleaseHeldWrite,shouldReloadAfterTakeover}from"../chunk-THWO5YVZ.js";import"../chunk-RE4LP46F.js";
|
|
@@ -520,6 +520,20 @@ interface EaselHost {
|
|
|
520
520
|
/** Listen to the host. Returns the unsubscribe. */
|
|
521
521
|
subscribe(listener: (message: InboundHostMessage) => void): () => void;
|
|
522
522
|
readonly address: EaselHostAddress;
|
|
523
|
+
/**
|
|
524
|
+
* TAKE ESCAPE BEFORE THE HOST DOES (0.105.0, seam E10). An embedder whose own
|
|
525
|
+
* window closes on Escape — the admin's shell windows close from a capture
|
|
526
|
+
* listener on the page, registered before the editor mounted, so a listener
|
|
527
|
+
* the editor adds can never get there first — hands the way to claim it: the
|
|
528
|
+
* shell's `registerModalEscapeInterceptor`. While something of the screen's
|
|
529
|
+
* that Escape closes is open (its right-click menu, Add, a field's media
|
|
530
|
+
* pick, a Layers row's rename box), the screen claims Escape with a handler
|
|
531
|
+
* that closes that thing and answers true, the press used; it lets go when
|
|
532
|
+
* the thing closes. Claims are offered most recent first, so Escape closes
|
|
533
|
+
* the thing on top. Returns the release. Absent: no claim, and the screen's
|
|
534
|
+
* own listeners close those things, as they always have.
|
|
535
|
+
*/
|
|
536
|
+
claimEscape?(handler: (e: KeyboardEvent) => boolean): () => void;
|
|
523
537
|
}
|
|
524
538
|
/** The host of a surface nobody embeds: nothing sent, nothing heard, an address
|
|
525
539
|
* that stays put. */
|
|
@@ -531,6 +545,15 @@ declare function EaselHostProvider({ host, children }: {
|
|
|
531
545
|
}): react.JSX.Element;
|
|
532
546
|
/** The host of the editor this component renders in. */
|
|
533
547
|
declare function useEaselHost(): EaselHost;
|
|
548
|
+
/**
|
|
549
|
+
* Claim Escape from the host while `open` is true (`EaselHost.claimEscape`),
|
|
550
|
+
* and run `onEscape` when it is pressed: the menu, Add, a media pick and a
|
|
551
|
+
* rename box each call this for themselves. The handler read is the latest
|
|
552
|
+
* one; the claim is made when `open` turns true and released when it turns
|
|
553
|
+
* false, or the component goes. With a host that has no way to claim, nothing
|
|
554
|
+
* is done here.
|
|
555
|
+
*/
|
|
556
|
+
declare function useHostEscape(open: boolean, onEscape: () => void): void;
|
|
534
557
|
/**
|
|
535
558
|
* A host for an embedder that mounts the editor in its own page — the admin
|
|
536
559
|
* portal's native editor window. `onMessage` receives everything the editor
|
|
@@ -544,9 +567,12 @@ declare function useEaselHost(): EaselHost;
|
|
|
544
567
|
declare function createEaselHost(options: {
|
|
545
568
|
onMessage: (message: EaselToHostMessage) => void;
|
|
546
569
|
address: EaselHostAddress;
|
|
570
|
+
/** How the screen takes Escape before the embedder's window does
|
|
571
|
+
* (`EaselHost.claimEscape`, 0.105.0). Left out, it claims nothing. */
|
|
572
|
+
claimEscape?: (handler: (e: KeyboardEvent) => boolean) => () => void;
|
|
547
573
|
}): {
|
|
548
574
|
host: EaselHost;
|
|
549
575
|
deliver: (message: HostToEaselMessage) => void;
|
|
550
576
|
};
|
|
551
577
|
|
|
552
|
-
export { type AnyDocumentAddressing as A, DETACHED_EASEL_HOST as D, type EaselHost as E, type HostPickedMedia as H, type InboundHostMessage as I, NO_DOCUMENT_ADDRESSING as N, type SectionScreenTarget as S, type DocumentAddressing as a, type EaselHostAddress as b, EaselHostContext as c, EaselHostProvider as d, type EaselMessageType as e, type EaselToHostMessage as f, type HostToEaselMessage as g, type SendToHost as h, createEaselHost as i, type AnyScreenTarget as
|
|
578
|
+
export { type AnyDocumentAddressing as A, DETACHED_EASEL_HOST as D, type EaselHost as E, type HostPickedMedia as H, type InboundHostMessage as I, NO_DOCUMENT_ADDRESSING as N, type SectionScreenTarget as S, type DocumentAddressing as a, type EaselHostAddress as b, EaselHostContext as c, EaselHostProvider as d, type EaselMessageType as e, type EaselToHostMessage as f, type HostToEaselMessage as g, type SendToHost as h, createEaselHost as i, useHostEscape as j, type AnyScreenTarget as k, type DocumentTarget as l, ScreenDocumentContext as m, ScreenDocumentProvider as n, type ScreenDocumentValue as o, type ScreenTarget as p, useScreenDocument as q, useEaselHost as u };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{AddBlockRow as default}from"../../chunk-
|
|
1
|
+
export{AddBlockRow as default}from"../../chunk-QH6LCNOX.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-VSHV6KJQ.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-P67FP7PG.js";import"../../chunk-AELNNAFM.js";import"../../chunk-BXZ6WLHC.js";import"../../chunk-EOJNJCMJ.js";import"../../chunk-ZFDCDJNZ.js";import"../../chunk-ZNS7727Y.js";import"../../chunk-3EDSDPIP.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-KTVH2ZRL.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-EWVJSRRY.js";import"../../chunk-P6O363EE.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-BZ5ASXOL.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-L5KW4HG5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{blockKey,AddSidePanel as default,sectionKey,templateKey}from"../../chunk-
|
|
1
|
+
export{blockKey,AddSidePanel as default,sectionKey,templateKey}from"../../chunk-N7VRF7PR.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-5ZBBXZPV.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-VSHV6KJQ.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PQXIFBDY.js";import"../../chunk-P67FP7PG.js";import"../../chunk-AELNNAFM.js";import"../../chunk-BXZ6WLHC.js";import"../../chunk-EOJNJCMJ.js";import"../../chunk-ZFDCDJNZ.js";import"../../chunk-ZNS7727Y.js";import"../../chunk-3EDSDPIP.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-KTVH2ZRL.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-YC4TB3CJ.js";import"../../chunk-ZJEBF4NB.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-WZ7TGAAT.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-EWVJSRRY.js";import"../../chunk-P6O363EE.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-BZ5ASXOL.js";import"../../chunk-TTJ54QGG.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-L5KW4HG5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { MediaPanelComponent, MediaPickRequest } from '../lib/media-panel.js';
|
|
3
|
-
import '../../host-
|
|
3
|
+
import '../../host-BQ_b9Qzk.js';
|
|
4
4
|
import '../../blocks/index.js';
|
|
5
5
|
import '../../types-E3HrTPg2.js';
|
|
6
6
|
import '../../data/index.js';
|
|
@@ -9,6 +9,8 @@ import '../../resolve-D68pb3Bx.js';
|
|
|
9
9
|
import '../../plan-DChbUXdS.js';
|
|
10
10
|
import '../lib/document-contract.js';
|
|
11
11
|
import '../lib/session.js';
|
|
12
|
+
import '../lib/backend-error.js';
|
|
13
|
+
import '../../edit-lock/index.js';
|
|
12
14
|
import '../lib/host-chrome.js';
|
|
13
15
|
import '../lib/links/link-filters.js';
|
|
14
16
|
import '../../LinkPicker-W2Rtxetz.js';
|
|
@@ -17,7 +19,6 @@ import '../lib/section-template-types.js';
|
|
|
17
19
|
import '../lib/puck/content-tree.js';
|
|
18
20
|
import '../lib/document-switch.js';
|
|
19
21
|
import '../../engine-DBxp_v6B.js';
|
|
20
|
-
import '../../edit-lock/index.js';
|
|
21
22
|
import '../lib/admin-bridge.js';
|
|
22
23
|
|
|
23
24
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{MediaSidePanel as default}from"../../chunk-
|
|
1
|
+
export{MediaSidePanel as default}from"../../chunk-NYKIQJT2.js";import"../../chunk-VSHV6KJQ.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-P67FP7PG.js";import"../../chunk-AELNNAFM.js";import"../../chunk-BXZ6WLHC.js";import"../../chunk-EOJNJCMJ.js";import"../../chunk-ZFDCDJNZ.js";import"../../chunk-ZNS7727Y.js";import"../../chunk-3EDSDPIP.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-KTVH2ZRL.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-YC4TB3CJ.js";import"../../chunk-ZJEBF4NB.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-WZ7TGAAT.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-EWVJSRRY.js";import"../../chunk-P6O363EE.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-BZ5ASXOL.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-L5KW4HG5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|