efficient-easel 0.105.1 → 1.0.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 +103 -29
- package/dist/{LinkPicker-W2Rtxetz.d.ts → LinkPicker-hPEr1MJx.d.ts} +6 -4
- package/dist/autosave/index.d.ts +5 -5
- package/dist/chrome/chrome.css +50 -273
- package/dist/chrome/index.d.ts +61 -56
- package/dist/chrome/index.js +1 -1
- package/dist/chunk-2GVCAIPX.js +1 -0
- package/dist/chunk-4GNPKHV4.js +64 -0
- package/dist/chunk-5545A3PC.js +4 -0
- package/dist/chunk-7SQF6LZL.js +1 -0
- package/dist/chunk-BXMXTO36.js +1 -0
- package/dist/{chunk-NYKIQJT2.js → chunk-CKEPQNSQ.js} +1 -1
- package/dist/chunk-DJMMTWFP.js +1 -0
- package/dist/{chunk-PQXIFBDY.js → chunk-E2O2MRZR.js} +1 -1
- package/dist/chunk-EA2HTX37.js +5 -0
- package/dist/{chunk-SARZN4M7.js → chunk-FEK3S6HN.js} +1 -1
- package/dist/chunk-FPAVNX3Y.js +6 -0
- package/dist/chunk-HMJS344F.js +1 -0
- package/dist/chunk-JLTZQ4US.js +1 -0
- package/dist/chunk-JMGPPXNQ.js +24 -0
- package/dist/chunk-K56YDHYQ.js +1 -0
- package/dist/chunk-LOMEH6DG.js +1 -0
- package/dist/{chunk-V4LF7D4F.js → chunk-MAEXP3KE.js} +1 -1
- package/dist/chunk-MJM6SFD3.js +3 -0
- package/dist/chunk-NLRW4BGG.js +8 -0
- package/dist/chunk-OJAJVH7S.js +5 -0
- package/dist/chunk-ONRYLR2D.js +2 -0
- package/dist/chunk-ORR3Q4WV.js +1 -0
- package/dist/chunk-OTEXGJDU.js +5 -0
- package/dist/chunk-P2VEMZH5.js +1 -0
- package/dist/chunk-PT6V53OO.js +1 -0
- package/dist/chunk-PYCLHOSA.js +9 -0
- package/dist/chunk-Q27BB5ZC.js +14 -0
- package/dist/chunk-QLD57GBB.js +6 -0
- package/dist/{chunk-NWIW7AWH.js → chunk-QMNML7XH.js} +1 -1
- package/dist/chunk-QR4DLZ3P.js +5 -0
- package/dist/chunk-TJ7YIRWQ.js +21 -0
- package/dist/{chunk-3P6AMTOS.js → chunk-VPFNZ7TB.js} +1 -1
- package/dist/chunk-W3XX2CNW.js +16 -0
- package/dist/chunk-X6DQWK2C.js +1 -0
- package/dist/chunk-XWR5YVA7.js +9 -0
- package/dist/chunk-YABL4EWX.js +7 -0
- package/dist/chunk-ZNNATBDC.js +1 -0
- package/dist/chunk-ZP4G3X44.js +4 -0
- package/dist/copy/copy.css +66 -177
- package/dist/copy/index.d.ts +0 -2
- package/dist/copy/index.js +31 -32
- package/dist/drag/drag.css +31 -11
- package/dist/drag/index.d.ts +10 -0
- package/dist/drag/index.js +1 -1
- package/dist/easel/index.d.ts +10 -1
- package/dist/easel/index.js +1 -1
- package/dist/fields/fields.css +35 -304
- package/dist/fields/index.d.ts +87 -95
- package/dist/fields/index.js +1 -1
- package/dist/gold/gold.css +3 -3
- package/dist/gold/index.d.ts +6 -5
- package/dist/gold/index.js +1 -1
- package/dist/{host-BQ_b9Qzk.d.ts → host-CiuzZJXj.d.ts} +11 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/menu/index.d.ts +49 -93
- package/dist/menu/index.js +1 -1
- package/dist/menu/menu.css +37 -246
- package/dist/node-ops/index.d.ts +1 -1
- package/dist/panel/index.d.ts +46 -72
- package/dist/panel/index.js +17 -18
- package/dist/panel/panel.css +143 -372
- package/dist/pick/index.d.ts +52 -33
- package/dist/pick/index.js +7 -7
- package/dist/pick/pick.css +19 -150
- package/dist/rail/index.d.ts +48 -90
- package/dist/rail/index.js +1 -1
- package/dist/rail/rail.css +21 -108
- package/dist/screen/components/AddBlockRow.d.ts +8 -2
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddChildRow.d.ts +4 -3
- package/dist/screen/components/AddChildRow.js +1 -1
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/MediaSidePanel.d.ts +2 -2
- package/dist/screen/components/MediaSidePanel.js +1 -1
- package/dist/screen/components/NodeContextMenu.d.ts +31 -9
- 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 -2
- package/dist/screen/components/ScreenDocumentContext.js +1 -1
- package/dist/screen/components/ScreenMount.d.ts +8 -8
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.d.ts +8 -8
- package/dist/screen/components/ScreenStoreProvider.js +1 -1
- package/dist/screen/components/SectionScreenShell.js +16 -16
- package/dist/screen/components/SidePanelHead.d.ts +4 -2
- package/dist/screen/components/SidePanelHead.js +1 -1
- package/dist/screen/components/UiIcon.d.ts +10 -26
- package/dist/screen/components/UiIcon.js +2 -1
- package/dist/screen/components/panel-widths.d.ts +15 -1
- package/dist/screen/components/panel-widths.js +1 -1
- package/dist/screen/components/usePartBridge.d.ts +8 -8
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.d.ts +9 -9
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/admin-bridge.d.ts +1 -1
- package/dist/screen/lib/admin-bridge.js +1 -1
- package/dist/screen/lib/chrome-theme.d.ts +20 -12
- package/dist/screen/lib/chrome-theme.js +1 -1
- package/dist/screen/lib/document-addressing.d.ts +2 -2
- package/dist/screen/lib/host-chrome.d.ts +1 -1
- package/dist/screen/lib/host.d.ts +2 -2
- package/dist/screen/lib/key-scope.d.ts +31 -2
- package/dist/screen/lib/key-scope.js +1 -1
- package/dist/screen/lib/links/link-filters.d.ts +1 -1
- package/dist/screen/lib/media-panel.d.ts +2 -2
- package/dist/screen/lib/media-picker.d.ts +2 -2
- package/dist/screen/lib/page-lock.d.ts +1 -1
- package/dist/screen/lib/puck/section-doc.d.ts +5 -1
- package/dist/screen/lib/puck/section-doc.js +1 -1
- package/dist/screen/lib/puck/style-clipboard.d.ts +8 -8
- package/dist/screen/lib/puck/use-section-ops.js +1 -1
- package/dist/screen/lib/screen-parts.d.ts +47 -10
- package/dist/screen/lib/screen-parts.js +1 -1
- package/dist/screen/lib/section-templates.d.ts +1 -1
- package/dist/screen/lib/session-context.d.ts +1 -1
- package/dist/screen/lib/session.d.ts +1 -1
- package/dist/screen/screen.css +54 -206
- package/dist/screen/words.d.ts +17 -1
- package/dist/screen/words.js +1 -1
- package/dist/shell/index.d.ts +134 -118
- package/dist/shell/index.js +1 -1
- package/dist/shell/shell.css +130 -88
- package/dist/strings/catalogue.d.ts +5 -5
- package/dist/strings/catalogue.js +1 -1
- package/dist/strings/index.d.ts +5 -5
- package/dist/strings/index.js +1 -1
- package/dist/style-clipboard/index.d.ts +1 -1
- package/dist/text-styles/index.d.ts +12 -3
- package/dist/text-styles/index.js +33 -38
- package/dist/text-styles/text-styles.css +39 -71
- package/dist/tree/index.d.ts +49 -44
- package/dist/tree/index.js +1 -1
- package/dist/tree/tree.css +31 -653
- package/dist/{types-DJDBtdB2.d.ts → types-BqGnUVX5.d.ts} +32 -32
- package/dist/types-BsyPh6EW.d.ts +99 -0
- package/dist/{types-DWS-s9z-.d.ts → types-CsgMwHHa.d.ts} +14 -11
- package/dist/{types-CqY85foL.d.ts → types-Dt1CFR1S.d.ts} +4 -2
- package/dist/{wordFit-D4S36PvB.d.ts → wordFit-7XpmhcaW.d.ts} +3 -5
- package/dist/words-Cl9xMUYY.d.ts +41 -0
- package/dist/{words-D_Lnw1Gr.d.ts → words-CvFnwGSr.d.ts} +1 -1
- package/package.json +5 -1
- package/dist/chunk-2UX75JDP.js +0 -1
- package/dist/chunk-3EDSDPIP.js +0 -1
- package/dist/chunk-3QVB4AG2.js +0 -3
- package/dist/chunk-3WSPDAK2.js +0 -1
- package/dist/chunk-53G47SWO.js +0 -1
- package/dist/chunk-5MZ3RNQQ.js +0 -13
- package/dist/chunk-5ZBBXZPV.js +0 -6
- package/dist/chunk-7FBDZTUD.js +0 -2
- package/dist/chunk-7V5WZ46F.js +0 -2
- package/dist/chunk-BXZ6WLHC.js +0 -22
- package/dist/chunk-BZ5ASXOL.js +0 -1
- package/dist/chunk-EOJNJCMJ.js +0 -16
- package/dist/chunk-EWVJSRRY.js +0 -6
- package/dist/chunk-FMGFZNPW.js +0 -1
- package/dist/chunk-H24N5TMZ.js +0 -11
- package/dist/chunk-HLEET6NV.js +0 -65
- package/dist/chunk-IE4GFYKO.js +0 -1
- package/dist/chunk-KTVH2ZRL.js +0 -15
- package/dist/chunk-N7VRF7PR.js +0 -5
- package/dist/chunk-OWBO4WKA.js +0 -0
- package/dist/chunk-P67FP7PG.js +0 -9
- package/dist/chunk-P6O363EE.js +0 -6
- package/dist/chunk-Q4N7C6CT.js +0 -10
- package/dist/chunk-QH6LCNOX.js +0 -8
- package/dist/chunk-RW4XBUUW.js +0 -1
- package/dist/chunk-TTJ54QGG.js +0 -18
- package/dist/chunk-VSHV6KJQ.js +0 -5
- package/dist/chunk-VSOP4GUM.js +0 -1
- package/dist/chunk-WZ7TGAAT.js +0 -3
- package/dist/chunk-YC4TB3CJ.js +0 -25
- package/dist/chunk-ZFDCDJNZ.js +0 -16
- package/dist/chunk-ZNS7727Y.js +0 -12
- package/dist/chunk-ZTTWFAAC.js +0 -1
- package/dist/types-Djdq6Xkd.d.ts +0 -138
- package/dist/words-DgHcY5qB.d.ts +0 -33
package/dist/chunk-EWVJSRRY.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{DEFAULT_FIELDS_WORDS as e}from"./chunk-FPOKPNO4.js";import{useWords as n}from"./chunk-MFIRYGHW.js";import{useState as r,useRef as t,useEffect as i}from"react";import{jsxs as l,jsx as u}from"react/jsx-runtime";function a(e,n,r){let t=e;return"number"==typeof n&&t<n&&(t=n),"number"==typeof r&&t>r&&(t=r),t}function o(e){const n=e.trim().replace(",",".");if(""===n||"-"===n||"."===n||"-."===n)return null;const r=Number(n);return Number.isFinite(r)?r:null}function s(e){const n=String(e),r=n.indexOf(".");return r<0?0:n.length-r-1}function c({value:e,onChange:n,min:l,max:u,step:c=1,shiftStep:d,styleValue:p,readOnly:m=!1}){const f="number"==typeof e&&Number.isFinite(e)?e:void 0,v=void 0===f?"":String(f),[y,h]=r(v),b=t(f),g=t(f);i(()=>{b.current=f,h(e=>o(e)===(f??null)?e:v)},[f,v]);const w=e=>{m||(b.current=e,n(e))},x=e=>{m||(h(void 0===e?"":String(e)),e!==b.current&&w(e))},N=(e,n=!1)=>{if(m)return;const r=a(function(e,n){const r=Math.max(s(e),s(n));return Number((e+n).toFixed(r))}(b.current??p??l??0,e*(n?d??10*c:c)),l,u);h(String(r)),w(r)},S=()=>{const e=o(y);null!==e?x(a(e,l,u)):h(void 0===b.current?"":String(b.current))};return{inputProps:{value:y,readOnly:m,placeholder:void 0===p?void 0:String(p),onFocus:()=>{g.current=b.current},onChange:e=>{const n=e.target.value;if(h(n),""===n.trim())w(void 0);else{const e=o(n);null!==e&&w(e)}},onBlur:S,onKeyDown:e=>{"ArrowUp"===e.key||"ArrowDown"===e.key?(e.preventDefault(),N("ArrowUp"===e.key?1:-1,e.shiftKey)):"Enter"===e.key?(e.preventDefault(),S(),g.current=b.current):"Escape"===e.key&&(e.preventDefault(),x(g.current))}},nudge:N,set:x,isStyle:void 0!==p&&""===y.trim()}}function d({dir:e,label:n,disabled:r,nudge:l}){const a=t(null),o=t(l);o.current=l;const s=t({}),c=()=>{const e=s.current;void 0!==e.wait&&clearTimeout(e.wait),void 0!==e.every&&clearInterval(e.every),e.off?.(),s.current={}};i(()=>{const e=a.current;return e?.addEventListener("pointerleave",c),e?.addEventListener("pointercancel",c),()=>{e?.removeEventListener("pointerleave",c),e?.removeEventListener("pointercancel",c),c()}},[]);/* @__PURE__ */
|
|
2
|
-
return u("button",{ref:a,type:"button",tabIndex:-1,className:"es-fnum-arrow es-fnum-arrow--"+(e>0?"up":"down"),"aria-label":n,disabled:r,onPointerDown:n=>{if(0!==n.button||r)return;n.preventDefault(),c();const t=n.shiftKey;o.current(e,t);const i=n.currentTarget.ownerDocument;i.addEventListener("pointerup",c),s.current={off:()=>i.removeEventListener("pointerup",c),wait:setTimeout(()=>{s.current.every=setInterval(()=>o.current(e,t),60)},350)}},onClick:n=>{0===n.detail&&o.current(e,n.shiftKey)},children:/* @__PURE__ */u("svg",{viewBox:"0 0 10 10","aria-hidden":"true",focusable:"false",children:/* @__PURE__ */u("path",{d:e>0?"M2.5 6.25 5 3.75l2.5 2.5":"M2.5 3.75 5 6.25l2.5-2.5"})})})}function p({id:r,value:t,onChange:i,min:a,max:o,step:s=1,shiftStep:p,styleValue:m,icon:f,unit:v,steppers:y=!1,placeholder:h,readOnly:b=!1,ariaLabel:g,ariaLabelledBy:w,title:x}){const N=n("fields",e),{inputProps:S,nudge:k,isStyle:D}=c({value:t,onChange:i,min:a,max:o,step:s,shiftStep:p,styleValue:m,readOnly:b});/* @__PURE__ */
|
|
3
|
-
return l("div",{className:`es-fnum${y?" es-fnum--arrows":""}${D?" is-style":""}${b?" is-readonly":""}`,title:x,children:[f?/* @__PURE__ */u("span",{className:"es-fnum-icon","aria-hidden":"true",children:f}):null,
|
|
4
|
-
/* @__PURE__ */u("input",{id:r,type:"text",inputMode:"decimal",className:"es-fnum-box","aria-label":g,"aria-labelledby":w,...S,placeholder:S.placeholder??h}),v?/* @__PURE__ */u("span",{className:"es-fnum-unit",children:v}):null,y?/* @__PURE__ */l("span",{className:"es-fnum-arrows",children:[
|
|
5
|
-
/* @__PURE__ */u(d,{dir:1,label:N.more,disabled:b,nudge:k}),
|
|
6
|
-
/* @__PURE__ */u(d,{dir:-1,label:N.less,disabled:b,nudge:k})]}):null]})}export{p as FieldNumber,a as clampNumber,o as parseTyped,c as useNumberEntry};
|
package/dist/chunk-FMGFZNPW.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useSectionOps as o}from"./chunk-NWIW7AWH.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:I}){const{getSelectorForId:a}=p(o=>o),u=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}),I?.(t)):i(o=>"part"===o.kind?n:o)},[i,I]);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=a(o);e&&u.select(e)},[i,a,u]),openPartId:P}}export{m as usePartBridge};
|
package/dist/chunk-H24N5TMZ.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{DEFAULT_PICK_WORDS as e}from"./chunk-ZAOM6PFH.js";import{useId as t,useState as n,useRef as r,useLayoutEffect as a,useEffect as l}from"react";import{jsxs as o,jsx as i}from"react/jsx-runtime";var s=/^(?:[0-9a-f]{3}|[0-9a-f]{6})$/i,c=7;function u(e){const t=e.trim().replace(/^#/,"");if(!s.test(t))return null;return`#${(3===t.length?[...t].map(e=>e+e).join(""):t).toLowerCase()}`}var d=e=>e.toUpperCase(),h=(e,t,n)=>Math.min(n,Math.max(t,e));function p(e){const t=u(e)??"#000000",n=parseInt(t.slice(1,3),16)/255,r=parseInt(t.slice(3,5),16)/255,a=parseInt(t.slice(5,7),16)/255,l=Math.max(n,r,a),o=l-Math.min(n,r,a);let i=0;return 0!==o&&(i=l===n?(r-a)/o%6*60:l===r?60*((a-n)/o+2):60*((n-r)/o+4)),{h:(i+360)%360,s:0===l?0:o/l,v:l}}function m({h:e,s:t,v:n}){const r=(e%360+360)%360,a=h(t,0,1),l=h(n,0,1),o=l*a,i=o*(1-Math.abs(r/60%2-1)),s=l-o,[c,u,d]=r<60?[o,i,0]:r<120?[i,o,0]:r<180?[0,o,i]:r<240?[0,i,o]:r<300?[i,0,o]:[o,0,i],p=e=>Math.round(255*(e+s)).toString(16).padStart(2,"0");return`#${p(c)}${p(u)}${p(d)}`}function v(e,t,n){return{s:n.width>0?h((e-n.left)/n.width,0,1):0,v:n.height>0?1-h((t-n.top)/n.height,0,1):0}}function g(e,t){return t.width>0?360*h((e-t.left)/t.width,0,1):0}function f(e){if(/^(data|blob):/i.test(e))return"";const t=(e.split(/[?#]/)[0]??"").split("/").filter(Boolean).pop()??"";try{return decodeURIComponent(t)}catch{return t}}function w({value:s,onChange:c,label:h,theme:p,caption:m,inherited:v,after:g,id:f,readOnly:w,words:b=e.colour}){const x=t(),[C,M]=n(!1),E=r(null),N=r(null),D=r(null),L=()=>{const e=E.current?.parentElement;return e?.classList.contains("es-field-head")?e.querySelector(":scope > .es-field-name .es-field-label"):e?.classList.contains("es-pick-line")?e.querySelector(":scope > .es-pick-line-label"):null},R=()=>D.current?.querySelector(".es-pick-hexwrap > *")??null,B=e=>e.scrollWidth>e.clientWidth+1,O=e=>{e&&(B(e)?e.dataset.clipped="true":delete e.dataset.clipped)},P=r(()=>{});P.current=()=>{O(L()),T||O(R())};const[A,S]=n(null),[T,I]=n(null);a(()=>P.current()),l(()=>{const e=E.current?.parentElement,t=e?.ownerDocument.defaultView;if(!e||!t?.ResizeObserver)return;const n=new t.ResizeObserver(()=>P.current());return n.observe(e),()=>n.disconnect()},[]),l(()=>{const e=E.current?.parentElement;if(!e)return;const t=e=>{const t=e;if(!t)return null;const n=L(),r=R();return n&&(t===n||n.contains(t))?n:r&&t===r?r:null},n=e=>{const n=t(e.target),r=$();if(!n||!r||n.ownerDocument.activeElement===n||!B(n))return;const a=n.getBoundingClientRect(),l=r.getBoundingClientRect(),o="INPUT"===n.tagName?n.value:n.textContent??"";S({text:o,left:a.left-l.left,top:a.top-l.top})},r=e=>{t(e.target)&&S(null)};return e.addEventListener("pointerover",n),e.addEventListener("pointerout",r),()=>{e.removeEventListener("pointerover",n),e.removeEventListener("pointerout",r)}},[]);const $=()=>{const e=E.current?.parentElement;return e&&(e.classList.contains("es-field-head")||e.classList.contains("es-pick-line"))?e:D.current};l(()=>{if(!C)return;const e=E.current?.ownerDocument;if(!e)return;const t=e=>{E.current&&!E.current.contains(e.target)&&M(!1)};return e.addEventListener("click",t,!0),()=>e.removeEventListener("click",t,!0)},[C]);const U=s?null:u(v??""),K=void 0===m||s&&u(m)===u(s)?null:m,q=K??(s?d(s):U?d(U):b.notSet),j=s||U;/* @__PURE__ */
|
|
2
|
-
return o("div",{ref:E,className:"es-pick-colour",children:[
|
|
3
|
-
/* @__PURE__ */o("div",{ref:D,className:"es-pick-colour-row","data-editing":T??void 0,onFocus:e=>{const t=e.target,n=$();if(!n||!t.classList.contains("es-pick-hex"))return;S(null),t.style.setProperty("--es-pick-edit-room",n.getBoundingClientRect().right-t.getBoundingClientRect().left+"px");const r=t.parentElement?.nextElementSibling,a=!!r&&t.getBoundingClientRect().right>r.getBoundingClientRect().left-2;I(a?"over":"room")},onBlur:e=>{const t=e.target;t.classList.contains("es-pick-hex")&&(t.style.removeProperty("--es-pick-edit-room"),I(null))},children:[
|
|
4
|
-
/* @__PURE__ */i("button",{ref:N,id:f,type:"button",className:s?"es-pick-swatch":U?"es-pick-swatch is-inherited":"es-pick-swatch is-unset",style:j?{background:j}:void 0,"aria-label":b.swatch({label:h,shown:q}),"aria-expanded":C,"aria-controls":C?x:void 0,disabled:w,onClick:()=>M(e=>!e)}),
|
|
5
|
-
/* @__PURE__ */i("span",{className:"es-pick-hexwrap",children:null===K?/* @__PURE__ */i(y,{value:s,follows:U?d(U):void 0,onChange:e=>{w||e===s||c(e)},name:b.hex({label:h}),readOnly:w}):/* @__PURE__ */i("span",{className:"es-pick-caption",children:K})}),g,A?/* @__PURE__ */i("span",{className:"es-pick-tag","aria-hidden":"true",style:{left:A.left,top:A.top},children:A.text}):null]}),C?/* @__PURE__ */i(k,{id:x,value:s,onChange:c,label:h,theme:p,inherited:v,readOnly:w,words:b,onClose:()=>{M(!1),N.current?.focus()}}):null]})}function k({value:t,onChange:a,label:s,theme:c,onClose:h,id:f,inherited:w,readOnly:k,words:b=e.colour,swatch:x=!1,dragWrites:C="live"}){const M=u(w??""),[E,N]=n(()=>p(t||M||"#000000")),D=r(t);l(()=>{t!==D.current&&(D.current=t,t?N(p(t)):M&&N(p(M)))},[t]);const L=e=>{k||e===t||(D.current=e,a(e))},R=e=>{N(p(e)),L(e)},B=e=>{N(e),L(m(e))},[O,P]=n(!1),A=r(E);A.current=E;const S=e=>({onPointerDown:t=>{if(k)return;t.currentTarget.setPointerCapture?.(t.pointerId);const n=e(t,A.current);"end"===C?(P(!0),N(n)):B(n)},onPointerMove:t=>{if(!(1&t.buttons))return;const n=e(t,A.current);"end"===C?N(n):B(n)},onPointerUp:t=>{"end"===C&&O&&(P(!1),B(e(t,A.current)))}}),T=S((e,t)=>({...t,...v(e.clientX,e.clientY,e.currentTarget.getBoundingClientRect())})),I=S((e,t)=>({...t,h:g(e.clientX,e.currentTarget.getBoundingClientRect())})),$=O?m(E):t,U=!t&&M?d(M):void 0,K=e=>`${Math.round(100*e)}%`;/* @__PURE__ */
|
|
6
|
-
return o("div",{id:f,role:"dialog","aria-label":b.dialog({label:s}),className:"es-pick-window",onKeyDown:e=>{"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),h?.())},children:[c&&c.length>0?/* @__PURE__ */i("div",{role:"group","aria-label":b.theme,className:"es-pick-theme",children:c.map(e=>/* @__PURE__ */i("button",{type:"button",className:"es-pick-theme-swatch",style:{background:e.value},title:b.themeSwatchTitle({name:e.name,hex:d(e.value)}),"aria-label":b.themeSwatch({name:e.name,hex:d(e.value)}),"aria-pressed":u(e.value)===t,onClick:()=>R(u(e.value)??e.value)},`${e.name}:${e.value}`))}):null,
|
|
7
|
-
/* @__PURE__ */i("div",{className:"es-pick-sv",role:"slider",tabIndex:0,"aria-label":b.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*E.v),"aria-valuetext":b.squareValue({saturation:K(E.s),brightness:K(E.v)}),style:{backgroundColor:m({h:E.h,s:1,v:1})},onKeyDown:e=>{const t=e.shiftKey?.1:.01,n={ArrowLeft:[-t,0],ArrowRight:[t,0],ArrowDown:[0,-t],ArrowUp:[0,t]}[e.key];n&&(e.preventDefault(),B({...E,s:Math.min(1,Math.max(0,E.s+n[0])),v:Math.min(1,Math.max(0,E.v+n[1]))}))},...T,children:/* @__PURE__ */i("span",{className:"es-pick-sv-thumb",style:{left:K(E.s),top:K(1-E.v)}})}),
|
|
8
|
-
/* @__PURE__ */i("div",{className:"es-pick-hue",role:"slider",tabIndex:0,"aria-label":b.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(E.h),onKeyDown:e=>{const t=e.shiftKey?10:1,n="ArrowLeft"===e.key||"ArrowDown"===e.key?-t:"ArrowRight"===e.key||"ArrowUp"===e.key?t:null,r="Home"===e.key?0:"End"===e.key?359:null===n?null:Math.min(359,Math.max(0,E.h+n));null!==r&&(e.preventDefault(),B({...E,h:r}))},...I,children:/* @__PURE__ */i("span",{className:"es-pick-hue-thumb",style:{left:E.h/360*100+"%"}})}),x?/* @__PURE__ */o("div",{className:"es-pick-hex-row",children:[
|
|
9
|
-
/* @__PURE__ */i("span",{className:"es-pick-hex-swatch","aria-hidden":"true",style:{background:$||m(E)}}),
|
|
10
|
-
/* @__PURE__ */i(y,{value:$,onChange:R,name:b.hex({label:s}),placeholder:U,readOnly:k})]}):/* @__PURE__ */i(y,{value:$,onChange:R,name:b.hex({label:s}),placeholder:U,readOnly:k})]})}function y({value:e,follows:t,onChange:a,name:l,placeholder:o,readOnly:s}){const[c,h]=n(null),p=r(!1);/* @__PURE__ */
|
|
11
|
-
return i("input",{type:"text",className:!e&&t?"es-pick-hex is-inherited":"es-pick-hex",value:c??(e?d(e):t??""),"aria-label":l,placeholder:o,maxLength:7,spellCheck:!1,autoComplete:"off",readOnly:s,onChange:t=>{h(t.target.value);const n=u(t.target.value);null!==n&&n!==e&&a(n)},onFocus:e=>e.currentTarget.select(),onMouseDown:e=>{p.current=e.currentTarget.ownerDocument.activeElement!==e.currentTarget},onMouseUp:e=>{p.current&&e.preventDefault(),p.current=!1},onKeyDown:e=>{"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),e.stopPropagation(),h(null),e.currentTarget.blur())},onBlur:()=>h(null)})}export{w as ColourPicker,k as ColourWindow,c as HEX_MAX_LENGTH,d as hexReadout,p as hexToHsv,m as hsvToHex,g as hueFromPoint,f as mediaName,v as svFromPoint,u as typedHex};
|
package/dist/chunk-HLEET6NV.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import{dedupeSlotChildren as e}from"./chunk-26OOWIJJ.js";import{styleClipboardOf as n}from"./chunk-SQTY6CJD.js";import{markedTreeNodeId as t,revealSelectedTreeRow as o,sameSelector as r}from"./chunk-FGNR22NY.js";import{cloneNodeWithFreshIds as i}from"./chunk-IE4GFYKO.js";import{rootRowName as l,slotChildRowName as s,slotChildRenameProp as d,sectionRenameProp as c}from"./chunk-TBF5CVPA.js";import{scrollPreviewToSection as a,gotoPreviewSlide as p,scrollPreviewToTop as u}from"./chunk-4ES5JGGX.js";import{useEaselKeyTarget as f,useEaselUndoKeys as h}from"./chunk-VSOP4GUM.js";import{SlotChildActionsProvider as m}from"./chunk-KCBEE2MC.js";import{UiIcon as g}from"./chunk-5MZ3RNQQ.js";import{DEFAULT_PANEL_W as y,PANEL_WIDTHS_KEY as k,clampPanelWidth as S}from"./chunk-ZTTWFAAC.js";import{usePartBridge as v}from"./chunk-FMGFZNPW.js";import{useSectionOps as b}from"./chunk-NWIW7AWH.js";import{useNodeClipboard as x,useNodeContextMenu as w}from"./chunk-7FBDZTUD.js";import{PageEditGuardNotices as z}from"./chunk-V4LF7D4F.js";import{useScreenDocument as B}from"./chunk-7V5WZ46F.js";import{requestMediaPick as C}from"./chunk-KG7RJWOK.js";import{heldStyle as N,styleShortcut as $}from"./chunk-57DJOKXT.js";import{AddChildRow as I}from"./chunk-3QVB4AG2.js";import{AddSidePanel as O}from"./chunk-N7VRF7PR.js";import{SidePanelHead as T,PanelShowStrip as P}from"./chunk-5ZBBXZPV.js";import{MediaSidePanel as A}from"./chunk-NYKIQJT2.js";import{useScreenSaveSwitch as R,useScreenNodeKeys as j,useScreenPinned as M,useScreenDocumentLabel as E,useScreenCanvasFrame as V,useScreenInspectorPanel as D,useScreenDevices as F,useScreenPickFollowsSelection as L,useScreenLeftView as G,useScreenAdd as H,SELECTION_MODE as W,sameInspectorMode as U,useScreenBridges as J,useScreenBlockRules as Y,useScreenBlockLook as Q,useScreenNotify as K,useScreenCanvasHead as Z,isSlotMode as _,useScreenStyleClipboard as X,useScreenDocumentPass as q,useScreenCanvasDrag as ee,ScreenCanvasTargetProvider as ne,isPinnedFirst as te,isPinnedLast as oe,screenSlotsOf as re}from"./chunk-VSHV6KJQ.js";import{ROOT_ZONE as ie,blockNodeActions as le,TREE_MAX_DEPTH as se,childSlotsOf as de,slotFieldsOf as ce,slotChildrenIn as ae,nestsInTree as pe,newNodeId as ue}from"./chunk-PLVEGYK6.js";import{useMediaPanel as fe,usePanelPick as he,useCancelPanelPick as me}from"./chunk-R6WTQWAC.js";import{useEaselHost as ge,useHostEscape as ye}from"./chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as ke}from"./chunk-PQXIFBDY.js";import{useEasel as Se,useEaselApi as ve}from"./chunk-P67FP7PG.js";import{TreeRow as be,Subtree as xe,LayersTree as we,TreeGroupLabel as ze,TreeRowAction as Be,TreeSeam as Ce}from"./chunk-ZFDCDJNZ.js";import{toItemSelector as Ne,useNodeOps as $e}from"./chunk-D2BCHTQR.js";import{saveIndicator as Ie}from"./chunk-H6DDIBQ4.js";import{EaselTopBar as Oe,TopBarRail as Te,TopBarCluster as Pe,EaselIconButton as Ae,TopBarDivider as Re,DeviceSwitch as je,InspectorIconButton as Me,PanelResizeHandle as Ee,MAX_PANEL_W as Ve,MIN_PANEL_W as De,panelWidthVars as Fe,SaveState as Le,SaveStateToggle as Ge}from"./chunk-YC4TB3CJ.js";import{useWords as He}from"./chunk-MFIRYGHW.js";import{CanvasDragLayer as We}from"./chunk-TTJ54QGG.js";import{createDragSession as Ue,useTreeDrag as Je,gapToMoveIndex as Ye}from"./chunk-67GNT6PF.js";import{useCanvasFrame as Qe,BLOCK_SELECTOR as Ke,useCanvasEvent as Ze}from"./chunk-PAELDYYS.js";import{LayersIcon as _e,UndoIcon as Xe,RedoIcon as qe,TrashIcon as en,MediaIcon as nn,DuplicateIcon as tn}from"./chunk-L5KW4HG5.js";import{zoneKey as on,ROOT_ID as rn,ROOT_SLOT as ln,parseZoneKey as sn,DataError as dn}from"./chunk-KRXQM65X.js";import{useRef as cn,useMemo as an,useState as pn,useEffect as un,useCallback as fn,useLayoutEffect as hn,Fragment as mn}from"react";import{jsx as gn,jsxs as yn,Fragment as kn}from"react/jsx-runtime";function Sn({saveState:e,notSaving:n,readOnlyReason:t,toggle:o,onToggle:r,onRetry:i}){if(null!==t)/* @__PURE__ */return gn(Le,{tone:"off",label:t,role:"status"});if(n)/* @__PURE__ */
|
|
2
|
-
return gn(Le,{tone:e.pending?"off-unsaved":"off",label:"Not saving — see the notice above",role:"status"});const{tone:l,label:s}=Ie(e),d=e.failed&&!e.paused&&/* @__PURE__ */gn("button",{type:"button",className:"es-btn-ghost",onClick:i,children:"Retry now"});/* @__PURE__ */
|
|
3
|
-
return yn(kn,o?{children:[
|
|
4
|
-
/* @__PURE__ */gn(Ge,{pressed:e.paused,onToggle:r,title:e.paused?"Auto-save is off — click to turn it back on (saves your held edits)":"Auto-save is on — click to pause it",children:/* @__PURE__ */gn(Le,{tone:l,label:s})}),d]}:{children:[
|
|
5
|
-
/* @__PURE__ */gn(Le,{tone:l,label:s,role:"status"}),d]})}function vn({expand:e}){/* @__PURE__ */
|
|
6
|
-
return gn("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */yn(kn,e?{children:[
|
|
7
|
-
/* @__PURE__ */gn("path",{d:"M8 9l4-4 4 4"}),
|
|
8
|
-
/* @__PURE__ */gn("path",{d:"M8 15l4 4 4-4"})]}:{children:[
|
|
9
|
-
/* @__PURE__ */gn("path",{d:"M8 4l4 4 4-4"}),
|
|
10
|
-
/* @__PURE__ */gn("path",{d:"M8 20l4-4 4 4"}),
|
|
11
|
-
/* @__PURE__ */gn("path",{d:"M5 12h14"})]})})}var bn="__rungs";var xn="screen:band",wn={duplicate:!0,delete:!0};function zn(){const Ie=ge(),{target:Le,docId:Ge,capabilities:zn,currentSlug:Bn,siteId:Cn,onPublish:Nn,saveState:$n,saveConflict:In,retrySave:On,toggleAutoSave:Tn,readOnly:Pn,readOnlyReason:An=null}=B(),Rn=R(),jn=j(),{mediaEditing:Mn,hasEditGuard:En,hasPinnedChrome:Vn}=zn,{appState:Dn,dispatch:Fn,history:Ln,selectedItem:Gn,getSelectorForId:Hn,config:Wn}=Se(e=>e),Un=M(),{first:Jn,firstGroup:Yn,lastGroup:Qn,isSectionGroup:Kn,sectionGroupZone:Zn,panelOf:_n}=Un,Xn=_n(Jn),qn=e=>te(Un,e),et=e=>oe(Un,e),nt="node"===Un.firstRow,tt=Un.band??null,ot=He("screen",ke),rt=E()??`/${Bn}`,it=V(),lt=D(),st=b({readOnly:Pn}),dt=cn(null),ct=ve(),at=an(()=>({...st,select:e=>{dt.current=e,st.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=ct.config;dt.current=Ne(e,t,n)}st.commitDocument(e,n)}}),[st,ct]),pt=Dn.ui,ut=pt.leftSideBarVisible,ft=pt.rightSideBarVisible,{options:ht,widths:mt,initial:gt,fluid:yt,fit:kt}=F(),[St,vt]=pn(gt),bt=fe(),xt=Mn&&null!==bt,wt=he(),zt=me();L(Gn?.props.id);const{read:Bt,write:Ct,forSelection:Nt}=G(),[$t,It]=pn(Bt);un(()=>{Ct($t)},[$t]);const[Ot,Tt]=pn(0),Pt=cn(null),At=cn(null),Rt=Qe(At,{readySelector:Ke}),jt=f(At);h(At);const[Mt,Et]=pn(!1),Vt=cn(!1),Dt=cn(!1),[Ft,Lt]=pn(null),Gt=H(),Ht=e=>Lt(null===e?null:{zone:ie,index:e}),[Wt,Ut]=pn([]),[Jt,Yt]=pn(W),Qt="puck"===Jt.kind,Kt=Mt&&!Ft&&Gt.railTarget?Gt.railTarget(Dn.data,{node:Gn??null,mode:Jt}):null,Zt=Kt?{zone:on(Kt),index:Kt.index}:null,_t=Ft??Zt,Xt=_t&&_t.zone===ie?_t.index:null,qt=t(Jt,Gn?.props.id),[eo,no]=pn(null);un(()=>{eo&&(o(),no(null))},[eo]);const to=cn(Hn);to.current=Hn;const oo=fn((e,{scroll:n})=>{It(n=>Nt(e,n)),n&&no(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=to.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&Po(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),ro=cn(null);un(()=>{const e=ro.current;ro.current=null;const n=null==Gn?.props.id?null:String(Gn.props.id);Yt(e&&e.id===n?e.mode:_n(Gn?.type)??W);const t=Gn?.props.id,o=dt.current;if(dt.current=null,!t)return;const i=Hn(t);oo(String(t),{scroll:!r(o,i??null,ie)})},[Gn?.props.id,oo]);const io=fn(e=>{Yt(n=>U(n,e)?n:e),Fn({type:"setUi",ui:{rightSideBarVisible:!0}})},[Fn]),lo=cn(()=>{});lo.current=(e,n)=>{const t=e?Cr(e.zone??ie)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==Gn?.props.id?null:String(Gn.props.id);Yt(e=>U(e,n)?e:n),o!==r&&(ro.current={id:o,mode:n},at.select(e))};const so=fn((e,n)=>lo.current(e,n),[]),co={kind:Jt.kind,mode:Jt,open:io,show:e=>Yt(e),reveal:()=>{ft||Fn({type:"setUi",ui:{rightSideBarVisible:!0}})},select:so},ao=J(co,{data:Dn.data,selected:Gn??null,zoneOf:e=>Hn(e)?.zone,readOnly:Boolean(Pn),select:e=>{Yt(W),at.select({index:e})},replace:(e,n)=>at.replaceComponent(ie,e,n),scrollTo:e=>_r(e)},{device:St,refreshes:Ot},{setView:It,reveal:()=>{ut||Fn({type:"setUi",ui:{leftSideBarVisible:!0}})}}),po=ao.pinnedSource??!1,uo=ao.resolveLeftView?ao.resolveLeftView($t,xt):"media"===$t&&xt?$t:"sections",fo=Y(),{isLockedBlock:ho,duplicateBlocked:mo,nestDepth:go,newSectionNode:yo,canAddTo:ko,blockIsOffered:So}=fo,vo=Q(),{labelAtLevel:bo,Icon:xo,useProducts:wo}=vo,zo=vo.rowName?(e,n,t)=>vo.rowName(e,n,t):void 0,Bo=fn(e=>{Fn({type:"setUi",ui:{rightSideBarVisible:!0}}),a(e),oo(e,{scroll:!0})},[Fn,oo]),{selectNode:Co,openPartId:No}=v({mode:Jt,setMode:Yt,onOpenPart:Bo}),[$o,Io]=pn(null);ye(null!==$o,()=>Io(null));const Oo="sf-editor-collapsed-sections",[To,Po]=pn(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(Oo);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
|
|
12
|
-
return new Set}});un(()=>{try{window.localStorage.setItem(Oo,JSON.stringify([...To]))}catch{}},[To]);const[Ao,Ro]=pn(()=>{if("undefined"==typeof window)return{...y};try{const e=window.localStorage.getItem(k);if(!e)return{...y};const n=JSON.parse(e);return{left:S(Number(n.left)||y.left),right:S(Number(n.right)||y.right)}}catch{return{...y}}});un(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(k,JSON.stringify(Ao))}catch{}},300);return()=>clearTimeout(e)},[Ao]);const jo=fn((e,n)=>Ro(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),Mo=fn(e=>jo("left",e),[jo]),Eo=fn(e=>jo("right",e),[jo]),Vo=e=>To.has(e),Do=e=>Po(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Fo=cn(!1),Lo=cn(null);un(()=>{if(Fo.current&&!Mt){const e=Lo.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??At.current?.querySelector(`button[aria-label="${CSS.escape(ot.add.title)}"]`))?.focus(),Lo.current=null}Fo.current=Mt},[Mt]),un(()=>{if(!Mt||!jt)return;const e=e=>{"Escape"===e.key&&li()};return jt.addEventListener("keydown",e),()=>jt.removeEventListener("keydown",e)},[Mt,jt]),ye(Mt,()=>li()),un(()=>{!ut&&Mt&&(Et(!1),Lt(null),Vt.current=!1)},[ut]),un(()=>{if(!wt)return Dt.current&&Fn({type:"setUi",ui:{leftSideBarVisible:!1}}),void(Dt.current=!1);Mt&&(Et(!1),Lt(null),Dt.current=Vt.current,Vt.current=!1),ut||(Dt.current=!0,Fn({type:"setUi",ui:{leftSideBarVisible:!0}}))},[wt]),un(()=>{!ut&&wt&&(Dt.current=!1,zt())},[ut]),un(()=>{if(!wt||!jt)return;const e=e=>{"Escape"===e.key&&zt()};return jt.addEventListener("keydown",e),()=>jt.removeEventListener("keydown",e)},[wt,jt]),ye(null!==wt,()=>zt());const Go=K(),[Ho,Wo]=pn(null),[Uo,Jo]=pn(0),Yo=cn(null),Qo=(e,n="success")=>{Go?Go(e,"error"===n?"error":"info"):(Wo({msg:e,tone:n}),Jo(e=>e+1),Yo.current&&clearTimeout(Yo.current),Yo.current=setTimeout(()=>Wo(null),"error"===n?3200:1900))};un(()=>()=>{Yo.current&&clearTimeout(Yo.current)},[]);const Ko=cn(null),[Zo,_o]=pn(0),[Xo,qo]=pn(0),er=Z(),nr=cn(null),tr=e=>Math.max(0,e.clientHeight-(nr.current?.offsetHeight??0));un(()=>{const e=Ko.current;if(!e)return;const n=()=>{_o(e.clientWidth),qo(tr(e))};n();const t=new ResizeObserver(n);return t.observe(e),nr.current&&t.observe(nr.current),()=>t.disconnect()},[]),hn(()=>{Ko.current&&(_o(Ko.current.clientWidth),qo(tr(Ko.current)))},[Ao,ut,ft]);const or=St===yt?Zo>0?Zo:mt[yt]:mt[St],rr=Zo>0?Math.min(Zo/or,"shrink"===kt?1:2):1,ir=or*rr,lr=Zo>0&&ir>Zo+1,sr={width:ir,height:Xo||"100%",flex:"none",position:"relative"},dr={width:or,height:Xo?Xo/rr:"100%",maxHeight:"none",transform:1!==rr?`scale(${rr})`:void 0,transformOrigin:"top left"},cr=()=>Fn({type:"setUi",ui:{leftSideBarVisible:!ut}}),ar=()=>Fn({type:"setUi",ui:{rightSideBarVisible:!ft}}),pr=e=>{Mt&&(Et(!1),Lt(null),Vt.current=!1,ut&&$t===e)||wt&&(Dt.current=!1,zt(),ut&&$t===e)||(ut&&$t===e?cr():(It(e),ut||Fn({type:"setUi",ui:{leftSideBarVisible:!0}})))},ur=()=>{C(Ie,{accept:"image/*",title:"Media library"})},fr=()=>{Yt(W),at.select(null),u()},hr=()=>{Yt(Xn??W),ft||Fn({type:"setUi",ui:{rightSideBarVisible:!0}})},mr=Dn.data.content??[],gr=()=>{const e=mr.findIndex(qn),n=mr.findIndex(et);return{floor:e>=0?e+1:0,cap:n>=0?n:mr.length}},yr=Wn,kr=x(),Sr=$e({data:Dn.data,config:yr,readOnly:Boolean(Pn),clipboard:kr,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==rn||e.slot!==ln)return{min:0,max:n-1};const{floor:t,cap:o}=gr();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&Yt(W);const t=void 0===n||"node"===n?.kind?n:null;at.commitDocument(e,t)}}),vr=e=>Wn.components[e]?.label??e,br=fn(e=>Wn.components[e]?.defaultProps??{},[Wn]),xr=e=>bo(e,"section",vr(e)),wr=e=>l({type:e.type,props:e.props??{}},xr(e.type),zo),{nodeAddresses:zr,zoneItems:Br}=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>=se)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of de(Wn,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(mr,ie,0),{nodeAddresses:e,zoneItems:n}},[mr,Wn]),Cr=fn(e=>Br.get(e)??[],[Br]),Nr=e=>{const n=zr.get(e);return n?Cr(n.zone)[n.index]:void 0},$r=e=>re(fo,Wn,e),Ir=e=>{if(!fo.slotsOf||e===ie)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=Nr(e.slice(0,n));if(!t)return null;const o=$r(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}},Or=(()=>{if(!_(Jt))return null;const e=`${Jt.nodeId}:${Jt.slot}`;return Ir(e)?.slot.panel===Jt.kind?e:null})(),Tr=cn(null);un(()=>{const e=Tr.current;if(Tr.current=null,!Or||!_(Jt))return;const n=Jt.nodeId;oo(n,{scroll:e!==Or}),Po(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[Jt]);const Pr=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=zr.get(e);n&&(n.zone===ie?Xr(n.index):Ni(n.zone,n.index,e,Nr(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&Or!==i&&(Tr.current=i),so(null,r),ft||Fn({type:"setUi",ui:{rightSideBarVisible:!0}}),_r(o)},Ar=(e,n,t)=>{const o=`${e}:${n}`;if(Po(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;Or!==o&&(Tr.current=o);so(null,{kind:t,nodeId:e,slot:n})},Rr=(e,n,t)=>{if(Pn||!fo.moveSlot)return;const o=Nr(e),r=o?$r(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:bn,index:n},s=Ye(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=fo.moveSlot(e,n,s);"string"==typeof d&&Ar(e,d,i.panel)},jr=wo(),Mr=an(()=>{const e=/* @__PURE__ */new Map;for(const n of jr??[])e.set(n.slug,n.name);return e},[jr]),Er=e=>s(e,vr,vo.plainText,e=>Mr.get(e),vo.rowName),Vr=(e,n)=>{const t=Wn.components[e.type]?.fields,o=n===ie||Ui(n)?"section":"block",r=n===ie&&(qn(e)||et(e)||Kn(e.type)),i="block"===o?d(t):r?null:c(t);return vo.renamePropOf?vo.renamePropOf(e,o,i):i},Dr=(e,n,t,o)=>{if(!($o?.zone===e&&$o.index===n))return;const r=(t,o)=>{Io(null),o&&((e,n,t)=>{const o=Cr(e)[n];if(!o)return;const r=Vr(o,e);r&&at.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
|
|
13
|
-
return gn("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":"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)},Fr=n(X()),Lr=Fr.scope({target:Le,siteId:Cn,docId:Ge}),Gr=Wn,Hr=(e,n)=>n===ie?xr(e):vr(e),Wr=(e,n,t)=>{const o=Fr.plan(Lr,t,Hr(t.type,e),Gr);o&&(o.changed&&at.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),Qo(o.message))},Ur=w({nodesIn:Cr,nodeAt:(e,n)=>Cr(e)[n]??null,labelOf:(e,n)=>n===ie?xr(e):vr(e),renamePropOf:Vr,beginRename:(e,n)=>Io({zone:e,index:n}),history:{hasPast:Ln.hasPast,hasFuture:Ln.hasFuture,back:()=>Ln.back(),forward:()=>Ln.forward()},openAddSection:()=>{at.select(null),ri(null)},openPageSettings:()=>{at.select(null),Yt(W)},collapseAll:()=>Po(new Set(Cr(ie).map(e=>String(e.props.id)))),onPasteRefused:e=>Qo(e?ot.pasteRefused({name:e.label}):"Your browser won’t let us read the clipboard — press ⌘V","error"),canPasteAt:(e,n)=>Yi(e,n),menuRows:ao.menuRows,isLocked:e=>ho(e.type),duplicateBlocked:e=>mo(Dn.data,e),permits:e=>le(Wn,e.type),canAddTo:ko,nodeOps:Sr,isPinned:(e,n)=>n===ie&&(qn(e)||et(e)),sectionBand:gr,openAddInside:(e,n)=>{e===ie?Xr(n):at.select({zone:e,index:n}),ri(null)},locate:e=>zr.get(e)??null,rowNameOf:(e,n)=>n===ie?wr(e):Er(e),selectAt:(e,n,t,o)=>{e===ie?Xr(n):Ni(e,n,t,o??"")},slotRung:e=>{const n=Ir(e);return n?.slot.panel?{label:n.slot.label,select:()=>Pr(n.node,n.slot,!1)}:null},style:{held:()=>N(Lr),canCopy:e=>Fr.rows(Gr,e).some(e=>!1!==e.counted),copy:(e,n)=>Fr.copy(Lr,e,Hr(e.type,n),Gr),paste:(e,n,t)=>Wr(e,n,t)},keys:jn?{target:jt,selected:()=>{const e=Dn.ui.itemSelector;return e?{zone:e.zone??ie,index:e.index}:null},held:()=>kr.get(),readOnly:Boolean(Pn),onDone:({done:e,name:n})=>{"copied"===e&&Qo(ot.copied({name:n}))}}:void 0},Rt),Jr=cn({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});un(()=>{Jr.current={copy:(e,n)=>Fr.copy(Lr,e,Hr(e.type,n),Gr),paste:Wr,at:()=>{const e=Dn.ui.itemSelector;if(!e)return null;const n=e.zone??ie,t=Cr(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(Pn)}});const Yr=fn(e=>{const n=$(e);if(!n)return;const t=Jr.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))},[]);un(()=>{if(!jt)return;const e=e=>Yr(e);return jt.addEventListener("keydown",e),()=>jt.removeEventListener("keydown",e)},[Yr,jt]),Ze(Rt,"keydown",Yr);const Qr=mr.map(e=>e.props.id).join("|");un(()=>{const e=Rt?.document??null,n=Rt?.window??null;let t=0;const o=[],r=()=>{if(!e)return void Ut(e=>e.length?[]:e);const n=mr.findIndex(et),t=n>=0?n:mr.length,o=n=>{const t=mr[n]?.props?.id;if(null==t)return null;const o=e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`);return o?o.getBoundingClientRect():null},r=[];for(let e=1;e<=t;e++){const n=o(e),t=o(e-1);(n||t)&&r.push({top:Math.round(n?n.top:t.bottom),index:e})}Ut(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)return!1;return!0}(e,r)?e:r)},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()}},[Rt,Qr,St,rr,ut,ft,Gn?.props.id]);const Kr=Rt?.document??null,Zr=Rt?.window??null;un(()=>{const e=Pt.current;if(!e||!Kr||!Zr)return;const n=[],t=()=>{const n=Kr.querySelector(`[data-puck-component="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&Zr.scrollTo({left:Zr.scrollX,top:Zr.scrollY+t,behavior:"instant"}),!0};return Pt.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[Kr,Zr]);const _r=e=>{ao.holdCanvasOn?ao.holdCanvasOn(e):a(e)},Xr=e=>{Yt(W),at.select({index:e}),ao.sectionPressed?.(mr[e]);const n=mr[e]?.props?.id;n&&_r(n)},qr=e=>{const{floor:n,cap:t}=gr(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=Gn&&Jt.kind!==Xn?.kind?mr.findIndex(e=>e.props.id===Gn.props.id):-1;return o(r>=0?r+1:t)},ei=(e,n)=>{const{floor:t,cap:o}=gr(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(at.reorderComponent(ie,e,i),at.select({index:i}),{moved:!0,dest:i})},ni=(e,n,t)=>{Yt(W),at.select({index:e}),a(n),Qo(`Added “${t}” section`)},ti=(e,n)=>{const t=qr(n),o=yo(e,{nodeDefaults:br,newNodeId:ue,sectionLabel:xr,blockIsOffered:So}),r=o?at.insertNode(ie,t,o):at.insertSection(e,t);return ni(t,r,xr(e)),t},oi=(e,n,t)=>{const o=qr(t),r=at.insertNode(ie,o,n);return ni(o,r,e),o},ri=e=>ii(ie,e),ii=(e,n)=>{Lo.current=document.activeElement??null,wt&&(Vt.current=Dt.current,Dt.current=!1,zt()),Lt(null===n?null:{zone:e,index:n}),Et(!0),ut||(Vt.current=!0,Fn({type:"setUi",ui:{leftSideBarVisible:!0}}))},li=()=>{Et(!1),Lt(null),Vt.current&&Fn({type:"setUi",ui:{leftSideBarVisible:!1}}),Vt.current=!1},si=(e,n,t)=>{if("section"===e.kind)at.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;at.insertNode(n,t,i(e.template.node))}Yt(W),at.select({index:t,zone:n})},di=e=>n=>{n.target.closest(".es-tree-select")||e()},ci=()=>ao.editPinnedSource?.(),ai=(e,n,t)=>{const o=Cr(e)[n];return o&&!le(Wn,o.type).delete?null:/* @__PURE__ */gn(Be,{kind:"delete",label:`Delete ${t}`,onClick:()=>((e,n)=>{const t=Cr(e)[n]?.props?.id;null!=t&&Sr.remove(String(t))})(e,n),children:/* @__PURE__ */gn(en,{size:15})})},pi=e=>vo.rowPreview?.(e)||void 0,ui=e=>vo.rowMarks?.(e)??void 0,fi=(e,n,t)=>vo.rowActions?.(e,n,t)??null,hi=(e,n,t,o)=>{const r=Boolean(t.props._hidden);/* @__PURE__ */
|
|
14
|
-
return gn(Be,{kind:"eye",label:r?`Show ${o}`:`Hide ${o}`,onClick:()=>gi(e,n,t),children:/* @__PURE__ */gn(g,r?{name:"eye-off",size:14}:{name:"eye",size:14})})},mi=e=>{const n=xr(mr[e]?.type??""),t=n?ot.addSectionBefore({name:n}):ot.addSectionHere;return fl(ie,e,()=>ri(e),t)},gi=(e,n,t)=>{at.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},yi=e=>ce(Wn,e),ki=e=>de(Wn,e),Si=e=>fo.slotsOf?$r(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:ae(e,n.slot)})):[{slot:null,rung:null,kids:ki(e)}],vi=e=>fo.slotsOf?Si(e).flatMap(e=>e.kids):ki(e),bi=e=>Boolean(fo.slotsOf)&&$r(e).some(e=>e.rung),xi=(e,n,t)=>null===t?void 0===n?ko(e):ko(e,n):ko(e,n,t),wi=(e,n,t)=>{const o=pe(Wn,e.type,n)&&(t||vi(e).length>0||bi(e));return{collapsible:o,folded:o&&Vo(String(e.props.id))}},zi=(e,n,t)=>Si(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>wi(e,r,t(e.type)).collapsible?[String(e.props.id),...zi(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),Bi=e=>vi(e).length>0||bi(e)||Boolean(ko(e.type)),Ci=e=>Boolean(ko(e)),Ni=(e,n,t,o)=>{if(Yt(W),ko(o)?.spec?.slider){const t=e.split(":")[0];p(t,n),at.select({index:n,zone:e}),a(t)}else at.select({index:n,zone:e}),_r(t)},$i=(e,n,t,o,r)=>{const i=`${e}:${n}`;at.insertComponent(i,t,o),ko(r)?.spec?.slider?requestAnimationFrame(()=>{p(e,o),at.select({index:o,zone:i})}):at.select({index:o,zone:i})},Ii=(e,n,t)=>{at.insertComponent(e,n,t),Yt(W),at.select({index:t,zone:e})},Oi=cn(/* @__PURE__ */new Set);un(()=>{mr.forEach(e=>{const n=ko(e.type)?.spec;if(!n)return;const t=e.props.id;if(Oi.current.has(t))return;Oi.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(br)).forEach((e,t)=>at.seedChild(o,t,n.childType,e))})},[mr,at,br]);const Ti=cn(/* @__PURE__ */new Set);un(()=>{mr.forEach((n,t)=>{const o=n.props.id;if(Ti.current.has(o))return;const r=e(n,yi(n.type));Ti.current.add(o),r&&at.replaceComponent(ie,t,{...n,props:r})})},[mr,at]),q(at,Wn);const Pi=mr.findIndex(et),Ai=Pi>=0?mr[Pi]:null,Ri=nt?mr.findIndex(qn):-1,ji=Ri>=0?mr[Ri]:null,Mi=mr.find(e=>e.type===Yn)??null,Ei=mr.find(e=>e.type===Qn)??null,Vi=Pi>=0?Pi:mr.length,Di=[];mr.forEach(e=>{et(e)||(Bi(e)&&Di.push(String(e.props.id)),Di.push(...zi(e,1,Ci)))}),Ai&&(Di.push(String(Ai.props.id)),Di.push(...zi(Ai,1,Ci)));const Fi=Di.length>0&&Di.every(e=>To.has(e)),Li=e=>{const n=vo.blockRowName(e,vr);return vo.rowName?vo.rowName(e,"block",n):n},Gi=(e,n,t,o)=>{const r=Cr(e)[t];if(!r)return;const i={...sn(e),index:t},l={...sn(n),index:Math.min(Math.max(o,0),Cr(n).length)},s=Ye(i,l);if(e!==n||s!==t)try{Sr.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof dn))throw e}},Hi=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of ki(e))n.add(r),t(o)};for(const t of yi(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},Wi=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=zr.get(n);if(!e)return null;if(e.zone===ie)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},Ui=e=>{const n=e.slice(0,e.indexOf(":")),t=mr.find(e=>Kn(e.type)&&String(e.props.id)===n);return t&&Zn(n)===e?t:null},Ji=(e,n,t)=>{if(e.rung){const t=Nr(e.rung.nodeId),o=t?$r(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===bn&&n.index>=0&&n.index<=o}if(n.slot===bn)return!1;if(e.add)return Ki(e.add,n);const o=on(n);if(Kn(e.type))return!1;const r=Ui(o),i=Ui(e.zone);if(r||i)return!(!r||!i)&&(n.index>=0&&n.index<=Cr(o).length);if(e.zone===ie||o===ie){if(e.zone!==o)return!1;const{floor:t,cap:r}=gr();return n.index>=t&&n.index<=r}if(n.index<0||n.index>Cr(o).length)return!1;if(e.zone===o)return!0;const l=Ai?String(Ai.props.id):null;return(!l||Wi(e.zone)!==l&&Wi(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??Cr(e)[t];if(!r)return!1;const i=n.split(":")[0],l=zr.get(i),s=l?Cr(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&Hi(r).has(n))return!1;const d=ko(s.type,go(Dn?.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?.(Cr(n),r))})(e.zone,o,e.index,t)},Yi=(e,n)=>{const t=on(e.from);if(t===on(n))return!0;const o=e.node;return Ji({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},Qi=e=>{const n=e.slice(0,e.indexOf(":")),t=zr.get(n),o=t?Cr(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=ko(o.type,go(Dn?.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=r.choices??(r.spec?[{type:r.spec.childType,label:vr(r.spec.childType)}]:[]),l=Ir(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:t.zone===ie?xr(o.type):vr(o.type)}},Ki=(e,n)=>{const t=on(n);if("block"!==e.kind){if(Ui(t))return n.index>=0&&n.index<=Cr(t).length;if(t!==ie)return!1;const{floor:e,cap:o}=gr();return n.index>=e&&n.index<=o}if(t===ie)return!1;const o=Qi(t);return!(!o||!o.choices.some(n=>n.type===e.type))&&!o.target.spec?.addBlocked?.(Cr(t))},Zi=(e,n)=>{e.rung?Rr(e.rung.nodeId,e.index,n.index):e.add?((e,n)=>{if("block"!==e.kind&&Ui(on(n)))return void si(e,on(n),n.index);if("section"===e.kind)return void ti(e.type,n.index);if("template"===e.kind)return void oi(e.template.name,i(e.template.node),n.index);const t=on(n),o=Qi(t);o&&(o.target.spec?$i(o.parentId,o.target.slot,e.type,n.index,o.parent.type):Ii(t,e.type,n.index))})(e.add,n):e.zone===ie?ei(e.index,n.index):Gi(e.zone,on(n),e.index,n.index)},[_i]=pn(()=>Ue()),Xi=Je({keyOf:e=>e.id,readOnly:Boolean(Pn),session:_i,canDrop:Ji,onDrop:Zi,onStep:(e,n)=>{e.rung?Rr(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===ie?((e,n)=>{const t=xr(mr[e]?.type??""),o=ei(e,n<0?e-1:e+2);if(!o.moved)return void Qo(`“${t}” is already ${n<0?"first":"last"}`);const{floor:r,cap:i}=gr();Qo(`Moved “${t}” to position ${o.dest-r+1} of ${i-r}`)})(e.index,n):Gi(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),qi=fn(e=>{const{floor:n,cap:t}=gr(),o=[];for(const r of e.nodes){const e=on(r.place),i=Cr(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(qn(i)||et(i)||ho(i.type))continue;if(Kn(i.type))continue;const l=Boolean(Ui(e)),s=e===ie||l;e===ie&&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?xr(i.type):Er(i),from:r.place})}return{sources:o,zones:e.zones.filter(e=>e.children.length>0||Boolean(Qi(on(e.list))?.choices.length)||Boolean(Ui(on(e.list))))}},[Dn.data]),el=e=>{Yt(W),at.select(e.zone===ie?{index:e.index}:{index:e.index,zone:e.zone})},nl=ee(),tl=()=>({data:Dn.data,device:St,ops:at,inspector:co}),ol=nl?.model,rl=an(()=>ol?e=>ol(e,qi(e),tl()):qi,[ol,qi,St]),il=nl?.measure,ll=il?(e,n)=>il(e,n,tl()):void 0,sl=nl?.canDrop,dl=sl?(e,n)=>sl(e,n,Ji,tl()):Ji,cl=nl?.drop,al=cl?(e,n)=>cl(e,n,Zi,tl()):Zi,pl=nl?.pick,ul=pl?e=>pl(e,el,tl()):el,fl=(e,n,t,o)=>/* @__PURE__ */gn(Ce,{...Pn?{}:Xi.seam({place:{...sn(e),index:n}}),onAdd:Pn?void 0:t,label:o},`seam:${e}:${n}`),hl={rowClick:di,isCollapsed:Vo,toggleCollapse:Do},ml=e=>{const n=String(e.props.id),t=mr.findIndex(e=>String(e.props.id)===n),o=Zn(n),r=Cr(o),i=Vo(n),l=vr(e.type),s=vo.rowName?vo.rowName(e,"section",l):l,d=e=>fl(o,e,()=>ii(o,e),ot.addSectionHere);/* @__PURE__ */
|
|
15
|
-
return yn(kn,{children:[
|
|
16
|
-
/* @__PURE__ */gn(be,{icon:/* @__PURE__ */gn(xo,{type:e.type,size:13}),name:s,preview:pi(e),marks:ui(e),onSelect:()=>Xr(t),nameSlot:Dr(ie,t,n,s),selected:qt===n,actions:fi(e,ie,t)??void 0,rowProps:{"data-node-id":n,onClick:di(()=>Xr(t))},fold:{open:!i,label:"section",onToggle:()=>Do(n)}}),!i&&/* @__PURE__ */yn(xe,{children:[r.map((n,t)=>{const r=String(n.props.id),i=wr(n),l=Bi(n),s=l&&Vo(r),c=()=>Ni(o,t,r,e.type),{rowProps:a,...p}=Xi.row({item:{id:r,zone:o,index:t,type:n.type},place:{...sn(o),index:t}},{"data-node-id":r,onClick:di(c)});/* @__PURE__ */
|
|
17
|
-
return yn(mn,{children:[d(t),
|
|
18
|
-
/* @__PURE__ */gn(be,{icon:/* @__PURE__ */gn(xo,{type:n.type,size:13}),name:i,preview:pi(n),marks:ui(n),onSelect:c,nameSlot:Dr(o,t,r,i),selected:qt===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Do(r)}:void 0,actions:/* @__PURE__ */yn(kn,{children:[ai(o,t,i),fi(n,o,t),hi(o,t,n,i)]}),rowProps:a}),l&&!s&&/* @__PURE__ */gn(xe,{children:kl(n,2)})]},r)}),d(r.length)]})]})},gl=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=Xi.dragging,d=!Vo(l)&&s?.rung?.nodeId!==i,c={...sn(l),index:0},a=s&&!s.rung&&Ji(s,c)?c:void 0,p=()=>Pr(e,n,!0),{rowProps:u,...f}=Xi.row({item:{id:`rung:${l}`,zone:`${i}:${bn}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:bn,index:t},into:a,canDrag:Boolean(fo.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:di(p)}),h=Pn?null:fo.slotActions?.(e,n.slot);/* @__PURE__ */
|
|
19
|
-
return yn(mn,{children:[n.heading,
|
|
20
|
-
/* @__PURE__ */gn(be,{icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:Or===l,...f,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>Do(l)},actions:h&&h.length>0?/* @__PURE__ */gn(kn,{children:h.map((t,o)=>/* @__PURE__ */gn(Be,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(Pn||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&Ar(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__ */gn(en,{size:15}):/* @__PURE__ */gn(tn,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */gn(xe,{children:r})]},l)},yl=(e,n)=>{const t=Si(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
|
|
21
|
-
return gn(kn,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=xi(e.type,void 0,t.slot),d=s?`${e.props.id}:${s.slot}`:null,c=null===t.slot?null:`${e.props.id}:${t.slot}`,a=null!==c&&Boolean(Qi(c)?.choices.length),p=(e,n)=>a?fl(e,n,()=>ii(e,n),"Add block here"):fl(e,n),u=/* @__PURE__ */yn(kn,{children:[i.map(({child:n,zone:t,index:o})=>{const r=qt===String(n.props.id),{collapsible:i,folded:s}=wi(n,l,Ci(n.type)),d=String(n.props.id),c=Li(n),a=()=>Ni(t,o,d,e.type),{rowProps:u,...f}=Xi.row({item:{id:d,zone:t,index:o,type:n.type},place:{...sn(t),index:o}},{"data-node-id":d,onClick:di(a)});/* @__PURE__ */
|
|
22
|
-
return yn(mn,{children:[0===o&&p(t,0),
|
|
23
|
-
/* @__PURE__ */gn(be,{icon:/* @__PURE__ */gn(xo,{type:n.type,size:13}),name:c,preview:pi(n),marks:ui(n),onSelect:a,nameSlot:Dr(t,o,d,c),selected:r,hidden:Boolean(n.props._hidden),...f,fold:i?{open:!s,label:"group",onToggle:()=>Do(d)}:void 0,actions:/* @__PURE__ */yn(kn,{children:[ai(t,o,c),fi(n,t,o),hi(t,o,n,c)]}),rowProps:u}),i&&!s&&/* @__PURE__ */gn(xe,{children:yl(n,l+1)}),p(t,o+1)]},String(n.props.id??`${t}-${o}`))}),null===c?d&&!i.some(e=>e.zone===d)?p(d,0):null:0!==i.length||!t.rung&&d!==c?null:p(c,0)]});return t.rung?gl(e,t.rung,r++,o,u):/* @__PURE__ */gn(mn,{children:u},t.slot??"")})})},kl=(e,n)=>{const t=go(Dn?.data,e.type,String(e.props.id)),o=Si(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
|
|
24
|
-
return gn(kn,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=xi(e.type,t,o.slot),c=d?.spec??null,a=c&&Array.isArray(e.props[c.slot])?e.props[c.slot]:[],p=d&&d.choices?{slot:d.slot,choices:d.choices}:null,u=String(e.props.id),f=c&&!c.fixed?`${u}:${c.slot}`:null,h=p?`${u}:${p.slot}`:null,m=(n,t)=>{const o=n===f&&c&&!c.addBlocked?.(a)?()=>$i(e.props.id,c.slot,c.childType,t,e.type):n===h?()=>ii(n,t):void 0;return fl(n,t,o,n===f&&c?c.addLabel:"Add block here")},g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(c&&!c.fixed&&(null===g||g===f)),k=/* @__PURE__ */yn(kn,{children:[l.map(({child:n,zone:t,index:o})=>{const r=qt===String(n.props.id),i=Er(n),l=String(n.props.id),{collapsible:d,folded:c}=wi(n,s,Ci(n.type)),a=yi(n.type),p=1===a.length?`${l}:${a[0]}`:null,u=p?{...sn(p),index:Cr(p).length}:void 0,f=Xi.dragging,h=u&&f&&Ji(f,u)?u:void 0,g=()=>Ni(t,o,l,e.type),{rowProps:y,...k}=Xi.row({item:{id:l,zone:t,index:o,type:n.type},place:{...sn(t),index:o},into:h,canDrag:!ho(n.type)},{"data-node-id":l,onClick:di(g)});/* @__PURE__ */
|
|
25
|
-
return yn(mn,{children:[0===o&&m(t,0),
|
|
26
|
-
/* @__PURE__ */gn(be,{icon:/* @__PURE__ */gn(xo,{type:n.type,size:13}),name:i,preview:pi(n),marks:ui(n),onSelect:g,nameSlot:Dr(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...k,fold:d?{open:!c,label:"group",onToggle:()=>Do(l)}:void 0,actions:ho(n.type)?fi(n,t,o)??void 0:/* @__PURE__ */yn(kn,{children:[ai(t,o,i),fi(n,t,o),hi(t,o,n,i)]}),rowProps:y}),d&&!c&&/* @__PURE__ */gn(xe,{children:kl(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&c&&
|
|
27
|
-
/* @__PURE__ */gn(I,{small:!0,label:c.addLabel,blocked:c.addBlocked?.(a)??null,onAdd:()=>$i(e.props.id,c.slot,c.childType,a.length,e.type)}),null===g?h&&!l.some(e=>e.zone===h)?m(h,0):null:0!==l.length||(o.rung?y:g!==h)?null:m(g,0)]});return o.rung?gl(e,o.rung,i++,r,k):/* @__PURE__ */gn(mn,{children:k},o.slot??"")})})},Sl=(()=>{if(!Gn||!Qt)return null;const e=String(Gn.type),n=String(Gn.props.id),t=ko(e,go(Dn?.data,e,n));if(!t||"footer"===t.source)return null;const o=mr.some(e=>String(e.props?.id)===n),r=Array.isArray(Gn.props[t.slot])?Gn.props[t.slot]:[];if(t.spec?.addBlocked?.(r))return null;const i=t.choices??(t.spec?[{type:t.spec.childType,label:vr(t.spec.childType)}]:[]);return 0===i.length?null:{parentName:o?xr(e):vr(e),choices:i,onPick:o=>{t.spec?$i(n,t.slot,o,r.length,e):Ii(`${n}:${t.slot}`,o,r.length)}}})(),vl=_t&&_t.zone!==ie&&!Ui(_t.zone)?_t.zone:null,bl=!0===Gt.blocksFirst,xl=vl?Qi(vl):bl&&_t?null:Sl,wl=Boolean(Ft&&vl)||bl&&Boolean(xl&&xl.choices.length>0),zl=Mt||null!==wt,Bl=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:ut&&!zl&&uo===e.id,onSelect:()=>pr(e.id)}:e,Cl=[{id:"add",label:ot.add.title,icon:/* @__PURE__ */gn("span",{className:"sf-rail-plus","aria-hidden":"true",children:"+"}),active:Mt,onSelect:()=>Mt?li():ri(null)},...(ao.railLead??[]).map(Bl),{id:"sections",label:"Layers",icon:/* @__PURE__ */gn(_e,{}),active:ut&&!zl&&"sections"===uo,onSelect:()=>pr("sections")},...(ao.railTrail??[]).map(Bl)];xt?Cl.push({id:"media",label:"Media library",icon:/* @__PURE__ */gn(nn,{}),active:ut&&!Mt&&(null!==wt||"media"===uo),onSelect:()=>pr("media")}):Mn&&Cl.push({id:"media",label:"Media library",icon:/* @__PURE__ */gn(nn,{}),onSelect:ur});const Nl=[...ao.railLead??[],...ao.railTrail??[]].find(e=>"panel"in e&&e.id===uo),$l=Boolean(tt?.foldable)&&!po,Il=tt?.label??(En?ot.pageSections:ot.templateSections),Ol=$l&&Vo(xn),Tl=/* @__PURE__ */yn(kn,{children:[mr.map((e,n)=>{if(qn(e)||et(e)||Kn(e.type))return null;const t=qt===String(e.props.id),o=Boolean(e.props._hidden);ki(e);const r=String(e.props.id),i=ao.hasOwnRows?.(e)??!1,l=Bi(e)||i,s=l&&Vo(r),{rowProps:d,...c}=Xi.row({item:{id:r,zone:ie,index:n,type:e.type},place:{...sn(ie),index:n}},{"data-node-id":r,onClick:di(()=>Xr(n))});/* @__PURE__ */
|
|
28
|
-
return yn(mn,{children:[n>0&&mi(n),
|
|
29
|
-
/* @__PURE__ */gn(be,{icon:/* @__PURE__ */gn(xo,{type:e.type,size:13}),name:wr(e),preview:pi(e),marks:ui(e),onSelect:()=>Xr(n),nameSlot:Dr(ie,n,r,wr(e)),selected:t,hidden:o,...c,fold:l?{open:!s,label:"section",onToggle:()=>Do(r)}:void 0,actions:/* @__PURE__ */yn(kn,{children:[ai(ie,n,wr(e)),fi(e,ie,n),hi(ie,n,e,wr(e))]}),rowProps:d}),Bi(e)&&!s&&/* @__PURE__ */yn(xe,{children:[kl(e,1),ao.partRows?.(e,hl)]}),i&&!s&&/* @__PURE__ */gn(xe,{children:ao.ownRows?.(e,n,hl)})]},String(e.props.id??n))}),!po&&Vi>0&&mi(Vi),tt?.addAtEnd&&!po&&!Pn&&/* @__PURE__ */gn(I,{small:!0,label:ot.addSection,blocked:null,onAdd:()=>ri(Vi)})]}),Pl=(e,n,t)=>{const o=String(e.props.id),r=vi(e).length>0||bi(e)||Boolean(ko(e.type)),i=r&&Vo(o),l="header"===t?ot.header:ot.footer,s=vo.rowName?vo.rowName(e,"section",l):l;/* @__PURE__ */
|
|
30
|
-
return yn(kn,{children:[
|
|
31
|
-
/* @__PURE__ */gn(be,{icon:/* @__PURE__ */gn(xo,{type:t,size:13}),name:s,preview:pi(e),marks:ui(e),onSelect:()=>Xr(n),nameSlot:Dr(ie,n,o,s),selected:qt===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Do(o)}:void 0,actions:fi(e,ie,n)??void 0,rowProps:{onClick:di(()=>Xr(n))}}),r&&!i&&/* @__PURE__ */gn(xe,{children:yl(e,1)})]})};return(ao.wrap??(e=>e))(
|
|
32
|
-
/* @__PURE__ */gn(ne,{target:Rt,children:/* @__PURE__ */yn("div",{ref:At,className:"sf-editor es-editor",style:Fe(Ao),onContextMenu:Ur.onEditorContextMenu,children:[
|
|
33
|
-
/* @__PURE__ */yn(Oe,{children:[
|
|
34
|
-
/* @__PURE__ */gn(Te,{items:Cl,ariaLabel:"Left panel views"}),
|
|
35
|
-
/* @__PURE__ */yn(Pe,{children:[
|
|
36
|
-
/* @__PURE__ */gn(Ae,{label:"Undo",disabled:!Ln.hasPast,onClick:()=>Ln.back(),children:/* @__PURE__ */gn(Xe,{})}),
|
|
37
|
-
/* @__PURE__ */gn(Ae,{label:"Redo",disabled:!Ln.hasFuture,onClick:()=>Ln.forward(),children:/* @__PURE__ */gn(qe,{})}),
|
|
38
|
-
/* @__PURE__ */gn(Re,{}),
|
|
39
|
-
/* @__PURE__ */gn(je,{devices:ht,value:St,onChange:vt})]}),
|
|
40
|
-
/* @__PURE__ */yn(Pe,{kind:"right",style:{minWidth:300},children:[
|
|
41
|
-
/* @__PURE__ */gn(Sn,{saveState:$n,notSaving:Boolean(Pn)||null!=In,readOnlyReason:An,toggle:Rn,onToggle:Tn,onRetry:On}),ao.barLead?.(),
|
|
42
|
-
/* @__PURE__ */gn("button",{type:"button",className:"es-btn-ghost",title:"Refresh the preview (reloads the canvas, keeps your place)",onClick:()=>{Pt.current=(()=>{const e=Rt?.document;if(!e)return null;const n=mr.findIndex(et),t=n>=0?n:mr.length;let o=null;for(let n=0;n<t;n++){const t=mr[n]?.props?.id;if(null==t)continue;const r=e.querySelector(`[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=Gn?.props?.id??mr[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),Tt(e=>e+1)},children:"Refresh"}),ao.barTrail?.(),ao.barMain?ao.barMain():/* @__PURE__ */gn("button",{type:"button",className:"es-btn-primary",disabled:null!==An,onClick:()=>{Nn(Dn.data)},children:ot.done})]})]}),
|
|
43
|
-
/* @__PURE__ */gn(z,{}),
|
|
44
|
-
/* @__PURE__ */yn("div",{className:"sf-body",children:[ut?/* @__PURE__ */yn(kn,{children:[
|
|
45
|
-
/* @__PURE__ */gn("div",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:Mt?/* @__PURE__ */gn(O,{blocks:xl,blocksOnly:wl,at:Ft?{label:(e=>{const n=Ui(e.zone);if(n)return ot.add.addingTo({name:vr(n.type)});if(e.zone===ie){const n=mr[e.index];return n&&!et(n)?ot.add.addingBefore({name:xr(n.type)}):ot.add.addingAtEnd}const t=Qi(e.zone);return t?ot.add.addingTo({name:t.parentName}):ot.add.addingHere})(Ft),onClear:()=>Lt(null)}:void 0,onAdd:e=>{const n=_t,t=(e,n)=>{Ft&&Lt({zone:e,index:n})};if(n&&"block"!==e.kind&&Ui(n.zone))return si(e,n.zone,n.index),void t(n.zone,n.index+1);if("section"===e.kind)return(e=>{if(null===Xt)return void ti(e);const n=ti(e,Xt);Ft&&Ht(n+1)})(e.type);if("template"===e.kind)return((e,n)=>{if(null===Xt)return void oi(e,n);const t=oi(e,n,Xt);Ft&&Ht(t+1)})(e.template.name,i(e.template.node));if(n&&n.zone!==ie){const o=Qi(n.zone);if(!o)return;return o.target.spec?$i(o.parentId,o.target.slot,e.type,n.index,o.parent.type):Ii(n.zone,e.type,n.index),void t(n.zone,n.index+1)}Sl?.onPick(e.type)},itemFor:e=>({id:`new:${e.kind}:${"template"===e.kind?e.template.id:e.type}`,zone:"",index:-1,type:"template"===e.kind?e.template.node.type:e.type,add:e}),session:_i,siteWide:ao.addPanelRow?.(li),onClose:li,onHide:cr,readOnly:Boolean(Pn)}):wt&&bt?
|
|
46
|
-
/* @__PURE__ */gn(A,{panel:bt,pick:wt,onHide:cr}):Nl?Nl.panel({onHide:cr,notify:Qo}):"media"===uo&&bt?/* @__PURE__ */gn(A,{panel:bt,pick:null,onHide:cr}):/* @__PURE__ */yn(kn,{children:[
|
|
47
|
-
/* @__PURE__ */gn(T,{icon:/* @__PURE__ */gn(_e,{}),title:"Layers",context:rt,actions:Di.length>0?/* @__PURE__ */gn(Me,{label:Fi?"Expand all sections":"Collapse all sections",onClick:()=>Po(e=>{const n=new Set(Di);return Fi?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...Di])}),children:/* @__PURE__ */gn(vn,{expand:Fi})}):void 0,onHide:cr}),
|
|
48
|
-
/* @__PURE__ */yn(we,{className:"sf-tree sf-scroll",children:[
|
|
49
|
-
/* @__PURE__ */gn(be,{icon:/* @__PURE__ */gn(xo,{type:"page",size:13}),name:ot.pageSettings,onSelect:fr,selected:!Gn&&Qt,rowProps:{onClick:di(fr)}}),Mi&&/* @__PURE__ */yn(kn,{children:[
|
|
50
|
-
/* @__PURE__ */gn(ze,{children:ot.header}),ml(Mi)]}),!po&&Vn&&/* @__PURE__ */yn(kn,{children:[
|
|
51
|
-
/* @__PURE__ */gn(ze,{children:ot.header}),!nt&&/* @__PURE__ */gn(be,{icon:/* @__PURE__ */gn(xo,{type:"header",size:13}),name:ot.header,onSelect:hr,selected:Jt.kind===Xn?.kind,rowProps:{onClick:di(hr)}})]}),!po&&ji&&Pl(ji,Ri,"header"),!po&&!$l&&/* @__PURE__ */gn(ze,{children:Il}),$l?/* @__PURE__ */yn(kn,{children:[
|
|
52
|
-
/* @__PURE__ */gn(be,{icon:null,name:Il,fold:{open:!Ol,label:Il,onToggle:()=>Do(xn)}}),!Ol&&/* @__PURE__ */gn(xe,{children:Tl})]}):Tl,Vn&&/* @__PURE__ */gn(ze,{children:ot.footer}),Ai&&Pl(Ai,Pi,"footer"),!po&&!Ai&&Vn&&/* @__PURE__ */gn(be,{icon:/* @__PURE__ */gn(xo,{type:"footer",size:13}),name:ot.footer,onSelect:ci,rowProps:{onClick:di(ci),title:"Edit the site footer"}}),Ei&&ml(Ei),ao.treeFoot?.()]})]})}),
|
|
53
|
-
/* @__PURE__ */gn(Ee,{side:"left",width:Ao.left,min:De,max:Ve,defaultWidth:y.left,label:"Resize Sections panel",onResize:Mo})]}):/* @__PURE__ */gn(P,{side:"left",onShow:cr}),
|
|
54
|
-
/* @__PURE__ */yn("div",{ref:Ko,className:"sf-center sf-scroll","data-sf-canvas-head":er?"":void 0,style:{overflowX:lr?"auto":"hidden",overflowY:"hidden"},children:[er&&/* @__PURE__ */gn("div",{ref:nr,className:"sf-canvas-head",children:/* @__PURE__ */gn(er,{device:St})}),
|
|
55
|
-
/* @__PURE__ */gn("div",{className:"sf-frame-scaler",style:sr,children:/* @__PURE__ */gn("div",{className:"sf-frame "+(St===yt?"":`sf-frame--${St}`),style:dr,children:/* @__PURE__ */yn("div",{className:"sf-preview-host",children:[
|
|
56
|
-
/* @__PURE__ */gn(it,{},Ot),
|
|
57
|
-
/* @__PURE__ */gn(We,{canvas:Rt,session:_i,model:rl,measure:ll,canDrop:dl,onDrop:al,onPick:ul,onZoneAdd:e=>ii(on(e),0),readOnly:Boolean(Pn),revision:Dn.data}),Wt.length>0&&/* @__PURE__ */gn("div",{className:"sf-preview-gaps","aria-hidden":"true",children:Wt.map(e=>/* @__PURE__ */yn("button",{type:"button",tabIndex:-1,className:"sf-preview-gap",style:{top:e.top},title:"Add section here",onClick:()=>ri(e.index),children:[
|
|
58
|
-
/* @__PURE__ */gn("span",{className:"sf-preview-gap-line"}),
|
|
59
|
-
/* @__PURE__ */yn("span",{className:"sf-preview-gap-pill",children:[
|
|
60
|
-
/* @__PURE__ */gn("span",{className:"sf-preview-gap-plus",children:"+"}),
|
|
61
|
-
/* @__PURE__ */gn("span",{className:"sf-preview-gap-label",children:"Add section"})]})]},e.index))})]})})})]}),ft?/* @__PURE__ */yn(kn,{children:[
|
|
62
|
-
/* @__PURE__ */gn(m,{value:{selectChild:Ni,addChild:$i,childRowName:Er,blockRowName:Li},children:/* @__PURE__ */gn(lt,{mode:Jt,onOpenWebsiteSettings:ao.openSettings??(()=>{}),onOpenSiteStyles:ao.openStyles,onSelectNode:Co,onNotify:Qo,onHidePanel:ar,nodeActions:Gn?le(Wn,Gn.type):wn})}),
|
|
63
|
-
/* @__PURE__ */gn(Ee,{side:"right",width:Ao.right,min:De,max:Ve,defaultWidth:y.right,label:"Resize settings panel",onResize:Eo})]}):
|
|
64
|
-
/* @__PURE__ */gn(P,{side:"right",onShow:ar})]}),Ho&&/* @__PURE__ */yn("div",{className:"sf-toast "+("error"===Ho.tone?"sf-toast--error":""),role:"status",children:[
|
|
65
|
-
/* @__PURE__ */gn("span",{className:"sf-toast-check","aria-hidden":"true",children:"error"===Ho.tone?"!":"✓"}),Ho.msg]},Uo),Ur.menu]})}))}export{zn as ScreenChrome};
|
package/dist/chunk-IE4GFYKO.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{newNodeId as t}from"./chunk-PLVEGYK6.js";function o(t){return{root:{props:{}},content:[t],zones:{}}}function n(t){return(t.content??[])[0]??null}function r(t){return Array.isArray(t)&&t.length>0&&t.every(t=>!!t&&"object"==typeof t&&"string"==typeof t.type&&"object"==typeof t.props)}function e(o){const n={...o.props,id:t(o.type)};for(const[t,o]of Object.entries(n))r(o)&&(n[t]=o.map(e));return{type:o.type,props:n}}export{e as cloneNodeWithFreshIds,n as docToNode,o as nodeToDoc};
|
package/dist/chunk-KTVH2ZRL.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import{useRef as e,useState as n,useLayoutEffect as t,useEffect as l}from"react";import{createPortal as r}from"react-dom";import{jsxs as i,Fragment as a,jsx as o}from"react/jsx-runtime";var c={menu:"es-editor es-menu",menuSub:"es-editor es-menu",item:"es-menu-item",itemDanger:"es-menu-item is-danger",divider:"es-menu-divider",header:"es-menu-header",icon:"es-menu-icon",shortcut:"es-menu-shortcut",label:"es-menu-label",labelSub:"es-menu-label es-menu-label-sub",chevron:"es-menu-chevron",tick:"es-menu-tick"};function u({x:u,y:s,items:d,onClose:m,maxHeight:h,skin:b,portalTo:y}){const p=e(null),g=e(null),[f,w]=n(null),[v,x]=n({x:u,y:s}),[N,k]=n({x:u,y:s});if(N.x===u&&N.y===s||(k({x:u,y:s}),x({x:u,y:s})),t(()=>{const e=p.current;if(!e)return;const{width:n,height:t}=e.getBoundingClientRect(),l=window.innerWidth,r=window.innerHeight;let i=s;s+t>r-8&&(i=s-t>=8?s-t:Math.max(8,r-t-8));let a=u;u+n>l-8&&(a=u-n>=8?u-n:Math.max(8,l-n-8)),a===v.x&&i===v.y||x({x:a,y:i})},[u,s,d,v.x,v.y]),l(()=>{const e=document.activeElement;return p.current?.querySelector('[role="menuitem"]')?.focus(),()=>e?.focus?.()},[]),l(()=>{const e=e=>{const n=e.target;g.current?.contains(n)||p.current&&!p.current.contains(n)&&m()},n=e=>{"Escape"===e.key&&m()},t=setTimeout(()=>{window.addEventListener("mousedown",e),window.addEventListener("contextmenu",e),window.addEventListener("keydown",n)},0);return()=>{clearTimeout(t),window.removeEventListener("mousedown",e),window.removeEventListener("contextmenu",e),window.removeEventListener("keydown",n)}},[m]),0===d.length)return null;const C=b??c,E=e=>e.danger?C.itemDanger:C.item,S=({on:e})=>/* @__PURE__ */o("span",{className:C.tick,"aria-hidden":"true",children:e?"✓":""}),L=({of:e})=>null==e.icon?null:/* @__PURE__ */o("span",{className:C.icon,"aria-hidden":"true",children:e.icon}),T=({of:e})=>null==e.shortcut?null:/* @__PURE__ */o("span",{className:C.shortcut,"aria-hidden":"true",children:e.shortcut}),B=e=>null!=e.icon||null!=e.shortcut,M=(e,n,t)=>{if(!e.children?.length)return void w(null);const l=t.getBoundingClientRect(),r=p.current,i=r?parseFloat(getComputedStyle(r).minWidth):NaN,a=Number.isFinite(i)&&i>0?i:r?.getBoundingClientRect().width??0,o=l.right+a>window.innerWidth-8?l.left-a:l.right;w({i:n,x:Math.max(8,o),y:l.top})},F=f?d[f.i]:null,H=e=>({...C.surface,...e});return r(
|
|
2
|
-
/* @__PURE__ */i(a,{children:[
|
|
3
|
-
/* @__PURE__ */o("div",{ref:p,"data-es-menu":"",role:"menu","aria-label":d.find(e=>e.header)?.label,className:C.menu,style:H({left:v.x,top:v.y,maxHeight:h||void 0}),children:d.map((e,n)=>"—"===e.label?
|
|
4
|
-
/* @__PURE__ */o("div",{role:"separator",className:C.divider},n):e.header?/* @__PURE__ */o("div",{className:C.header,children:e.label},n):e.children?.length?/* @__PURE__ */i("button",{type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":f?.i===n,onMouseEnter:t=>M(e,n,t.currentTarget),onFocus:t=>M(e,n,t.currentTarget),onClick:t=>M(e,n,t.currentTarget),className:E(e),style:C.itemStyle,children:[
|
|
5
|
-
/* @__PURE__ */o(L,{of:e}),
|
|
6
|
-
/* @__PURE__ */o("span",{className:C.label,children:e.label}),
|
|
7
|
-
/* @__PURE__ */o(T,{of:e}),
|
|
8
|
-
/* @__PURE__ */o("span",{"aria-hidden":"true",className:C.chevron,children:"›"})]},n):/* @__PURE__ */o("button",{type:"button",role:"menuitem",onMouseEnter:()=>w(null),onClick:()=>{e.onClick(),m()},className:E(e),style:C.itemStyle,children:B(e)?/* @__PURE__ */i(a,{children:[
|
|
9
|
-
/* @__PURE__ */o(L,{of:e}),
|
|
10
|
-
/* @__PURE__ */o("span",{className:C.label,children:e.label}),
|
|
11
|
-
/* @__PURE__ */o(T,{of:e})]}):e.label},n))}),F?.children?.length&&f?/* @__PURE__ */o("div",{ref:g,"data-es-menu":"",role:"menu","aria-label":F.label,className:C.menuSub??C.menu,style:H({left:f.x,top:f.y}),children:F.children.map((e,n)=>/* @__PURE__ */i("button",{type:"button",role:"menuitemradio","aria-checked":Boolean(e.checked),onClick:()=>{e.onClick(),m()},className:E(e),style:C.itemStyle,children:[
|
|
12
|
-
/* @__PURE__ */o(S,{on:Boolean(e.checked)}),
|
|
13
|
-
/* @__PURE__ */o(L,{of:e}),
|
|
14
|
-
/* @__PURE__ */o("span",{className:C.labelSub??C.label,children:e.label}),
|
|
15
|
-
/* @__PURE__ */o(T,{of:e})]},n))}):null]}),y??document.body)}export{c as ES_MENU_SKIN,u as EaselContextMenu};
|
package/dist/chunk-N7VRF7PR.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{blockTypesIn as e}from"./chunk-5ZBY24K7.js";import{buildPaletteSections as t,pinnedSection as n,paletteWithoutPinned as o,categoryLabel as i}from"./chunk-PA3PNTVV.js";import{sectionTemplatesOf as s}from"./chunk-BVN33R76.js";import{SidePanelHead as r,PanelModeExit as c}from"./chunk-5ZBBXZPV.js";import{useEaselSession as l}from"./chunk-O7Q4DDJT.js";import{blockRuns as a}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as p,useScreenBlockRules as m}from"./chunk-VSHV6KJQ.js";import{DEFAULT_SCREEN_WORDS as d}from"./chunk-PQXIFBDY.js";import{useEasel as u}from"./chunk-P67FP7PG.js";import{useWords as f}from"./chunk-MFIRYGHW.js";import{AddPanel as h}from"./chunk-TTJ54QGG.js";import{AddIcon as k}from"./chunk-L5KW4HG5.js";import{useState as y,useEffect as b,useMemo as j}from"react";import{jsx as g,jsxs as B,Fragment as V}from"react/jsx-runtime";var $=e=>`section:${e}`,v=e=>`block:${e}`,O=e=>`template:${e}`;function P({blocks:P,blocksOnly:x,at:H,onAdd:I,itemFor:F,session:G,siteWide:L,onClose:Q,onHide:T,readOnly:A}){const D=u(e=>e.config),N=p(),{labelAtLevel:C,categoryLabel:J,firstSection:K,Icon:R,Thumbnail:S}=N,{blockIsOffered:W}=m(),Y=f("screen",d).add,Z=l(),[w,z]=y([]);b(()=>{let t=!1;const n=e=>W(e,Z);return s(Z).list().then(o=>{if(t)return;const i=D.components;z(o.filter(t=>t.node?.type&&i[t.node.type]&&e(t.node).every(n)))}).catch(()=>{}),()=>{t=!0}},[D,Z]);const X=j(()=>t(D,N),[D]),E=e=>({type:$(e.type),label:e.name,cover:/* @__PURE__ */g(S,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:Y.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),M=j(()=>{const e=[];if(P&&P.choices.length>0&&a(P.choices).forEach((t,n)=>{e.push({title:0===n?`${Y.inside({name:P.parentName})}${t.group?` · ${t.group}`:""}`:t.group??"",tiles:t.items.map(e=>({type:v(e.type),label:e.label,icon:/* @__PURE__ */g(R,{type:e.type,size:18}),title:Y.tile({name:e.label})}))})}),x)return e;const t=n(X,K);t&&e.push({title:Y.startBlank,tiles:[E(t)]}),w.length>0&&e.push({title:Y.templates,tiles:w.map(e=>{return{type:O(e.id),label:e.name,cover:/* @__PURE__ */g(S,{type:e.node.type}),keywords:[(t=e.node.type,C(t,"section",D.components[t]?.label??t)),e.node.type]};var t})});const s=o(X,K);for(const t of Object.keys(D.categories??{})){const n=s.filter(e=>e.cat===t);0!==n.length&&e.push({title:i(D,t,J),tiles:n.map(E)})}return e},[P,x,w,X,D,Y]),q=e=>{const t=e.indexOf(":"),n=e.slice(0,t),o=e.slice(t+1);if("section"===n)return{kind:"section",type:o};if("block"===n)return{kind:"block",type:o};if("template"===n){const e=w.find(e=>e.id===o);return e?{kind:"template",template:e}:null}return null};/* @__PURE__ */
|
|
2
|
-
return B(V,{children:[
|
|
3
|
-
/* @__PURE__ */g(r,{icon:/* @__PURE__ */g(k,{size:15}),title:Y.title,context:x?Y.contextBlocks:Y.contextAll,actions:/* @__PURE__ */g(c,{label:Y.done,description:Y.doneDescription,onClick:Q}),onHide:T}),
|
|
4
|
-
/* @__PURE__ */B("div",{className:"sf-addside sf-scroll",children:[
|
|
5
|
-
/* @__PURE__ */g(h,{groups:M,session:G,itemFor:e=>F(q(e)??{kind:"section",type:e}),onInsert:e=>{const t=q(e);t&&I(t)},at:H,hint:x?Y.hintBlocks:Y.hint,searchLabel:x?Y.searchBlocks:Y.searchSections,readOnly:A}),L&&!x?L:null]})]})}export{P as AddSidePanel,v as blockKey,$ as sectionKey,O as templateKey};
|
package/dist/chunk-OWBO4WKA.js
DELETED
|
File without changes
|
package/dist/chunk-P67FP7PG.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{DEFAULT_CANVAS_WORDS as e}from"./chunk-AELNNAFM.js";import{useResolvedFields as t}from"./chunk-YRLPFZW3.js";import{toItemSelector as n,fromItemSelector as o,useNodeOps as r}from"./chunk-D2BCHTQR.js";import{useWords as a}from"./chunk-MFIRYGHW.js";import{setCanvasNonce as i}from"./chunk-ZNCEOSXO.js";import{find as s,ROOT_ID as d,getList as l,remove as c,parseZoneKey as u,move as p,duplicate as f,replaceNode as h,createNode as m,insert as v,normalizeData as y,createResolveCache as g,resolveNodeData as k,ROOT_SLOT as b}from"./chunk-KRXQM65X.js";import{topLevelSlotKeys as w,fieldsFrom as S,defaultsFrom as I}from"./chunk-NKB3KVAB.js";import{createContext as C,useEffect as O,useContext as x,useRef as E,useSyncExternalStore as A,useState as D,useMemo as z,useCallback as M,useLayoutEffect as Z}from"react";import{jsx as N,jsxs as $}from"react/jsx-runtime";import{createPortal as j}from"react-dom";function R(e){return!["setData","setUi","set"].includes(e.type)}var B=(e,t,n,o)=>{const r=l(e,t,u(n));return r?.[o]??null},P=(e,t,n,o,r)=>{const a=B(e,t,n,o);if(!a)throw new Error(`${r}: nothing at ${n}[${o}]`);return a};function L(e,t){const{selection:o}=e;return{...e.ui,itemSelector:n(e.data,t,o),selectedSlot:o&&"slot"===o.kind?{parentId:o.parentId,slot:o.slot}:null}}function K(e,t,n){return n?"node"===n.kind?s(e,t,n.id)?n:null:n.parentId===d?l(e,t,n)?n:null:s(e,t,n.parentId)&&l(e,t,n)?n:null:null}function F(e,t,n,r=!1){const{itemSelector:a,selectedSlot:i,...s}=n;let d=e.selection;var l;return"itemSelector"in n&&(d=o(e.data,t,a??null)),"selectedSlot"in n&&(i?d=(l=i)?{kind:"slot",parentId:l.parentId,slot:l.slot}:null:"slot"===d?.kind&&(d=null)),{...e,selection:d,ui:r?s:{...e.ui,...s}}}function H(e,t,n){const o=V(e,t,n);if(o===e)return e;const r=K(o.data,n,o.selection);return r===o.selection?o:{...o,selection:r}}function V(e,t,n){const{data:o}=e;switch(t.type){case"setData":{const n="function"==typeof t.data?t.data(o):t.data;return{...e,data:{...o,...n}}}case"setUi":return F(e,n,"function"==typeof t.ui?t.ui(L(e,n)):t.ui);case"set":{const r={data:o,ui:L(e,n)},a="function"==typeof t.state?t.state(r):t.state;let i=a.data?{...e,data:a.data}:e;return a.ui&&(i=F(i,n,a.ui,!0)),i}case"insert":{const r={...u(t.destinationZone),index:t.destinationIndex},a=m(n,t.componentType,{},t.id?{id:t.id}:{});return{...e,data:v(o,n,r,a)}}case"replace":{const r=P(o,n,t.destinationZone,t.destinationIndex,"replace");if(r.props.id!==t.data.props.id)throw new Error("Can't change the id during a replace action. Use remove and insert for a new node.");return{...e,data:h(o,n,r.props.id,t.data)}}case"replaceRoot":{const n={...o.root,props:{...o.root.props,...t.root.props},readOnly:t.root.readOnly};return{...e,data:{...o,root:n}}}case"duplicate":{const r=P(o,n,t.sourceZone,t.sourceIndex,"duplicate"),a=f(o,n,r.props.id),i=B(a,n,t.sourceZone,t.sourceIndex+1);return{...e,data:a,selection:i?{kind:"node",id:i.props.id}:e.selection}}case"reorder":return V(e,{...t,type:"move",sourceZone:t.destinationZone},n);case"move":{if(t.sourceZone===t.destinationZone&&t.sourceIndex===t.destinationIndex)return e;const r=B(o,n,t.sourceZone,t.sourceIndex);if(!r)return e;const a={...u(t.destinationZone),index:t.destinationIndex};return{...e,data:p(o,n,r.props.id,a)}}case"remove":{const r=P(o,n,t.zone,t.index,"remove");return{...e,data:c(o,n,r.props.id)}}default:return e}}var T={drag:!0,duplicate:!0,delete:!0,edit:!0,insert:!0},q={leftSideBarVisible:!0,rightSideBarVisible:!0,arrayState:{},componentList:{},isDragging:!1,previewMode:"edit",viewports:{current:{width:360,height:"auto"},options:[],controlsVisible:!0},field:{focus:null}},Y=0,U=()=>`history-${Y+=1}`;function W(e){let t=e.config;const r=e.now??(()=>Date.now()),a=e.historyCoalesceMs??250;let i=e.permissions??{};const d=y(e.data,t);let c={data:d,selection:null,ui:{...q}};if(e.ui){const{itemSelector:n,selectedSlot:r,...a}=e.ui;c={data:d,selection:r?{kind:"slot",...r}:o(d,t,n??null),ui:{...q,...a}}}let u=[{core:c,at:-1/0,sealed:!0,id:U()}],p=0;const f=e=>{const t=u[p],n=r();!e&&p===u.length-1&&p>0&&!t.sealed&&n-t.at<a?u=[...u.slice(0,p),{...t,core:c,at:n}]:(u=[...u.slice(0,p+1),{core:c,at:n,sealed:e,id:U()}],p=u.length-1)},m=/* @__PURE__ */new Set;let v=null,b=null,w=0,S=null,I=!1;const C=()=>{for(const e of[...m])e()},O=()=>{u=[...u.slice(0,p),{...u[p],core:c},...u.slice(p+1)]},x=(t,n)=>{w>0?I=I||n:(n?f(!1):c!==t&&O(),c.data!==t.data&&e.onChange?.(c.data),c!==t&&C())},E=e=>{const n=c;if(c=H(c,e,t),c===n)return;const o=e.recordHistory??R(e);x(n,o&&c.data!==n.data)},A=t=>{0===w&&(S=c,I=!1),w+=1;try{t()}catch(e){throw w-=1,0===w&&S&&(c=S,S=null),e}if(w-=1,w>0||!S)return;const n=S;S=null,I&&c.data!==n.data?f(!0):c!==n&&O(),c.data!==n.data&&e.onChange?.(c.data),c!==n&&C()},D=e=>{const n=c,o=K(c.data,t,e);var r,a;(r=o,a=c.selection,r===a||r&&a&&r.kind===a.kind&&("node"===r.kind&&"node"===a.kind?r.id===a.id:"slot"===r.kind&&"slot"===a.kind&&r.parentId===a.parentId&&r.slot===a.slot))||(c={...c,selection:o},x(n,!1))},z=t=>{const n=c;p=t,c=u[p].core,c.data!==n.data&&e.onChange?.(c.data),c!==n&&C()},M=()=>(e={})=>{const n=e.root?t.root?.permissions:t.components[e.item?.type??e.type??""]?.permissions;return{...T,...i,...n}};let Z=M();const N=g(),$={resolveCache:N,async resolveAll({trigger:e="load",metadata:n}={}){const o=c.data,r={type:"root",props:{...o.root.props??{}}},a=[...o.content,...Object.values(o.zones??{}).flat()],[i,...d]=await Promise.all([k(r,t,{cache:N,trigger:e,metadata:n}),...a.map(o=>k(o,t,{cache:N,trigger:e,metadata:n}))]);A(()=>{const e=c;let n=c.data;d.forEach((e,r)=>{if(!e.didChange)return;const i=a[r].props.id,d=s(n,t,i)?.node;d&&d===s(o,t,i)?.node&&(n=h(n,t,i,e.node))}),i.didChange&&n.root===o.root&&(n={...n,root:{...n.root,props:i.node.props,readOnly:i.node.readOnly??n.root.readOnly}}),n!==c.data&&(c={...c,data:n,selection:K(n,t,c.selection)},x(e,!1))})},async resolveNode(e,{trigger:n="replace",metadata:o}={}){const r=s(c.data,t,e)?.node;if(!r)return!1;const a=await k(r,t,{cache:N,trigger:n,metadata:o});if(!a.didChange)return!1;let i=!1;return A(()=>{const n=c;if(s(c.data,t,e)?.node!==r)return;const o=h(c.data,t,e,a.node);o!==c.data&&(c={...c,data:o,selection:K(o,t,c.selection)},x(n,!1),i=!0)}),i},get config(){return t},getState(){if(v&&b===c)return v;const e=c,o={data:e.data,ui:L(e,t)},r="node"===e.selection?.kind?s(e.data,t,e.selection.id)?.node??null:null;return v={appState:o,selection:e.selection,selectedItem:r,config:t,dispatch:E,history:{back:()=>$.undo(),forward:()=>$.redo(),hasPast:p>0,hasFuture:p<u.length-1,histories:u.map(e=>({id:e.id,state:{data:e.core.data,ui:L(e.core,t)}})),index:p,setHistoryIndex:e=>{e>=0&&e<u.length&&e!==p&&z(e)}},getPermissions:Z,getItemById:n=>s(e.data,t,n)?.node,getItemBySelector:n=>function(e,t,n){const[o,r]=(n.zone??"root:default-zone").split(/:(.*)/s);return l(e,t,{parentId:o,slot:r})?.[n.index]}(e.data,t,n),getSelectorForId:o=>{const r=n(e.data,t,{kind:"node",id:o});return r?{index:r.index,zone:r.zone??"root:default-zone"}:void 0}},b=e,v},subscribe:e=>(m.add(e),()=>{m.delete(e)}),dispatch:E,batch:A,select:e=>D(e?{kind:"node",id:e}:null),selectSlot:e=>D(e?{kind:"slot",parentId:e.parentId,slot:e.slot}:null),run(e){A(()=>{const n=c,o=void 0===e.select?c.selection:e.select;c={...c,data:e.data,selection:K(e.data,t,o)},x(n,e.data!==n.data)})},load(e,n={}){const o=c,r=y(e,t);c={...c,data:r,selection:K(r,t,n.selection??c.selection)},n.keepHistory||(u=[{core:c,at:-1/0,sealed:!0,id:U()}],p=0),c!==o&&C()},undo(){p>0&&z(p-1)},redo(){p<u.length-1&&z(p+1)},setPermissions(e){(function(e,t){if(e===t)return!0;const n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>e[n]===t[n])})(e,i)||(i=e,Z=M(),v=null,C())},setConfig(e){e!==t&&(t=e,Z=M(),v=null,C())}};return $}function X(e,t){const n=e=>{if(e.altKey)return;if(!(e.metaKey!==e.ctrlKey))return;const n="KeyZ"===e.code,o="KeyY"===e.code&&!e.shiftKey;(n||o)&&!1!==t.getState?.().getPermissions().edit&&(e.preventDefault(),o||e.shiftKey?t.redo():t.undo())};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)}var Q=C(null),G=C(!0);function J({easel:e,hotkeys:t=!0,resolveOnMount:n=!0,children:o}){return O(()=>{n&&e.resolveAll()},[e,n]),O(()=>{if(t&&"undefined"!=typeof document)return X(document,e)},[e,t]),/* @__PURE__ */N(Q.Provider,{value:e,children:/* @__PURE__ */N(G.Provider,{value:t,children:o})})}function _(){const e=x(Q);if(!e)throw new Error("useEasel: no <EaselProvider> above this component");return e}function ee(e){const t=_(),n=E({view:null,selector:null,value:void 0,has:!1}),o=()=>{const o=t.getState(),r=n.current;if(r.has&&r.view===o&&r.selector===e)return r.value;const a=e(o);return r.has&&Object.is(r.value,a)?(n.current={view:o,selector:e,value:r.value,has:!0},r.value):(n.current={view:o,selector:e,value:a,has:!0},a)};return A(t.subscribe,o,o)}function te(){return function(e){return ee(e)}}var ne="data-puck-component",oe="data-puck-dropzone",re={},ae="data-es-mirror",ie="undefined"==typeof window?O:Z;function se(e,t,n){for(const e of Array.from(t.head.querySelectorAll(`[${ae}]`)))e.remove();for(const o of Array.from(e.head.querySelectorAll('style, link[rel="stylesheet"]'))){const e=o.cloneNode(!0);e.setAttribute(ae,""),n&&e.setAttribute("nonce",n),t.head.appendChild(e)}}function de({children:t,id:n="preview-frame",title:o,className:r,style:s,mirrorStyles:d=!0,onDocument:l,height:c="auto",nonce:u}){const p=a("canvas",e),f=E(null),[h,m]=D(null);return ie(()=>{const e=f.current,t=h?.ownerDocument.defaultView;if("auto"!==c||!e||!h||!t)return;const n=()=>{e.style.height=`${Math.ceil(h.getBoundingClientRect().height)}px`};n();const o=t.ResizeObserver,r=o?new o(n):null;return r?.observe(h),()=>r?.disconnect()},[h,c]),ie(()=>{let e=f.current?.contentDocument;if(!e)return;"CSS1Compat"!==e.compatMode&&(e.open(),e.write("<!DOCTYPE html><html><head></head><body></body></html>"),e.close(),e=f.current?.contentDocument??e),e.body||e.documentElement.appendChild(e.createElement("body")),e.body.style.margin="0";const t=e.createElement("div");t.setAttribute("data-puck-entry",""),t.id="frame-root","fill"===c&&t.classList.add("es-frame-fill"),e.body.appendChild(t),i(e,u),m(t),l?.(e);let n=null;const o=f.current?.ownerDocument;if(d&&o){se(o,e,u);const t=o.defaultView;t&&"MutationObserver"in t&&(n=new t.MutationObserver(()=>se(o,e,u)),n.observe(o.head,{childList:!0,subtree:!0,characterData:!0}))}return()=>{n?.disconnect(),t.remove(),m(null),l?.(null)}},[]),/* @__PURE__ */N("iframe",{ref:f,id:n,title:o??p.frame,className:["es-canvas-frame","fill"===c?"is-fill":"",r??""].filter(Boolean).join(" "),style:s,children:h?j(t,h):null})}var le=C(null),ce=C(re),ue=[];function pe({parentId:e,slot:t,className:n,style:o,minEmptyHeight:r=128}){const a=_(),i=ee(n=>l(n.appState.data,a.config,{parentId:e,slot:t})??ue),s=ee(t=>"node"===t.selection?.kind&&t.selection.id===e&&e!==d),c=ee(n=>"slot"===n.selection?.kind&&n.selection.parentId===e&&n.selection.slot===t),u=x(le),p=["es-zone"];return i.length&&p.push("has-children"),e===d&&p.push("is-root"),(s||c)&&p.push("is-area-selected"),null!==u&&u===e&&e!==d&&p.push("is-hovering-area"),n&&p.push(n),/* @__PURE__ */N("div",{className:p.join(" "),[oe]:`${e}:${t}`,style:{...o,"--min-empty-height":`${r}px`},children:i.map(e=>/* @__PURE__ */N(me,{node:e},e.props.id))})}function fe(e,t,n,o){const r="root"===t?e.root:e.components[t],a={...o};for(const e of w(S(r)))a[e]=function(t={}){/* @__PURE__ */
|
|
2
|
-
return N(pe,{parentId:n,slot:e,...t})};return a}function he(e){return function({zone:t,...n}){/* @__PURE__ */
|
|
3
|
-
return N(pe,{parentId:e,slot:t,...n})}}function me({node:e}){const t=_().config,n=t.components[e.type],o=e.props.id,r=function(e){const t=E(null);return z(()=>n=>{const o=t.current;o&&o!==n&&(o.removeAttribute(ne),o.removeAttribute("data-puck-dnd")),t.current=n,n&&(n.setAttribute(ne,e),n.setAttribute("data-puck-dnd",e),n.style.position="relative")},[e])}(o),a=x(ce);if(!n?.render)return null;const i=n.render,s=fe(t,e.type,o,{...I(n),...e.props}),d={renderDropZone:he(o),isEditing:!0,dragRef:n.inline?r:null,metadata:{...a,...n.metadata}};return n.inline?/* @__PURE__ */N(i,{...s,puck:d,editMode:!0}):/* @__PURE__ */N("div",{[ne]:o,"data-puck-dnd":o,style:{position:"relative"},children:/* @__PURE__ */N(i,{...s,puck:d,editMode:!0})})}function ve({metadata:e}){const t=ee(e=>e.config),n=ee(e=>e.appState.data.root).props??{},o=t.root?.render,r=/* @__PURE__ */N(pe,{parentId:d,slot:b}),a=o?/* @__PURE__ */N(o,{id:"puck-root",...fe(t,"root",d,n),puck:{renderDropZone:he(d),isEditing:!0,dragRef:null,metadata:e??{}},editMode:!0,children:r}):r;/* @__PURE__ */
|
|
4
|
-
return N(ce.Provider,{value:e??re,children:a})}function ye({id:e,kind:t,overlay:n}){const o=E(null),[r,a]=D(null);ie(()=>{const t=o.current?.ownerDocument,n=t?.defaultView;if(!t||!n||!e)return void a(null);let r=0;const i=()=>{r=0;const i=function(e,t){if(!e||!t)return null;const n=e.getBoundingClientRect(),o=t.getBoundingClientRect();return{top:n.top-o.top,left:n.left-o.left,width:n.width,height:n.height}}(t.querySelector(`[${ne}="${n.CSS?.escape?n.CSS.escape(e):e}"]`),o.current?.parentElement??null);a(e=>{return(t=e)===(n=i)||t&&n&&t.top===n.top&&t.left===n.left&&t.width===n.width&&t.height===n.height?e:i;var t,n})},s=()=>{r||(r=(n.requestAnimationFrame??(e=>n.setTimeout(e,16)))(i))};i();const d="MutationObserver"in n?new n.MutationObserver(s):null;d?.observe(t.body,{childList:!0,subtree:!0,attributes:!0,characterData:!0});const l="ResizeObserver"in n?new n.ResizeObserver(s):null;return l?.observe(t.documentElement),n.addEventListener("resize",s),()=>{d?.disconnect(),l?.disconnect(),n.removeEventListener("resize",s),r&&(n.cancelAnimationFrame??n.clearTimeout)(r)}},[e]);const i=/* @__PURE__ */N("div",{ref:o,"aria-hidden":"true",className:`es-canvas-outline is-${t}`,style:r?{position:"absolute",top:r.top,left:r.left,width:r.width,height:r.height}:{display:"none"}});return n&&e?/* @__PURE__ */N(n,{componentId:e,kind:t,children:i}):i}function ge({frame:e=!0,className:t,style:n,metadata:o,mirrorStyles:r,onDocument:a,height:i,title:s,nonce:d,hotkeys:l,frameWrapper:c,overlay:u,children:p}){const f=_(),h=x(G),m=l??h,[v,y]=D(void 0),g=ee(e=>"node"===e.selection?.kind?e.selection.id:null),[k,b]=D(null),w=/* @__PURE__ */$("div",{className:"es-canvas-content",style:{position:"relative"},onClick:e=>{const t=e.target;t.closest?.("a[href]")&&e.preventDefault();const n=t.closest?.(`[${ne}]`);n?f.select(n.getAttribute(ne)):t.hasAttribute?.(oe)||f.select(null)},onMouseOver:e=>{const t=e.target.closest?.(`[${ne}]`),n=t?.getAttribute(ne)??null;n!==k&&b(n)},onMouseLeave:()=>b(null),children:[
|
|
5
|
-
/* @__PURE__ */N(le.Provider,{value:k,children:/* @__PURE__ */N(ve,{metadata:o})}),
|
|
6
|
-
/* @__PURE__ */$("div",{className:"es-canvas-outlines",style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:[
|
|
7
|
-
/* @__PURE__ */N(ye,{id:k&&k!==g?k:null,kind:"hover",overlay:u}),
|
|
8
|
-
/* @__PURE__ */N(ye,{id:g,kind:"selected",overlay:u})]}),p]}),S=c?/* @__PURE__ */N(c,{document:v,children:w}):w;O(()=>{if(v&&m)return X(v,f)},[v,m,f]);/* @__PURE__ */
|
|
9
|
-
return N("div",{className:"es-canvas"+(t?` ${t}`:""),style:n,"data-puck-preview":"",children:e?/* @__PURE__ */N(de,{mirrorStyles:r,onDocument:e=>{y(e??void 0),a?.(e)},height:i,title:s,nonce:d,children:S}):/* @__PURE__ */N("div",{id:"preview-frame","data-puck-entry":"",children:S})})}function ke(e={}){const t=_(),n=ee(e=>e.appState.data);return r({...e,data:n,config:t.config,commit:(e,{select:n})=>t.run({data:e,select:n})})}function be(){const e=_(),n=ee(e=>e.config),o=e.resolveCache,r=ee(e=>e.selectedItem),a=ee(e=>e.appState.data.root),i=r?r.props.id:"root",d=a.props??{},l=z(()=>r||{type:"root",props:d},[r,d]),c=r?n.components[r.type]:n.root,u=e.getState(),p=r?s(u.appState.data,n,i):null,f=p&&"root"!==p.place.parentId?p.place.parentId:null,h=f?u.getItemById(f)??null:null,{fields:m}=t({id:i,node:l,block:c,parent:h,appState:u.appState}),v=ee(e=>!1===e.getPermissions(r?{item:r}:{root:!0}).edit),y=M((t,r)=>{(async()=>{const a=e.getState();if("root"!==i){const s=a.getItemById(i),d=a.getSelectorForId(i);if(!s||!d)return;const l={...s,props:{...s.props,[t]:r}},{node:c}=await k(l,n,{cache:o,trigger:"replace"}),u=e.getState().getSelectorForId(i);if(!u)return;return void e.dispatch({type:"replace",destinationZone:u.zone??"root:default-zone",destinationIndex:u.index,data:c})}const s=a.appState.data.root.props??{},{node:d}=await k({type:"root",props:{...s,[t]:r}},n,{cache:o,trigger:"replace"});e.dispatch({type:"replaceRoot",root:{props:d.props,readOnly:d.readOnly},recordHistory:!0})})()},[e,n,o,i]);return{id:i,node:l,fields:m,values:l.props,readOnly:v,onChange:y}}export{de as CanvasFrame,q as DEFAULT_UI,ge as EaselCanvas,J as EaselProvider,ve as EditDocument,X as bindUndoKeys,W as createEasel,te as createUseEasel,R as recordsByDefault,H as reduce,L as uiView,ee as useEasel,_ as useEaselApi,ke as useEaselNodeOps,be as useSelectedFields,K as validSelection};
|
package/dist/chunk-P6O363EE.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{wordFitVars as e}from"./chunk-BZ5ASXOL.js";import{jsx as a,jsxs as i}from"react/jsx-runtime";function s({options:s,value:l,onChange:t,ariaLabel:n,fit:r,disabled:d=!1,className:c}){const o=r&&e(s.length,r);
|
|
2
|
-
/* @__PURE__ */
|
|
3
|
-
return a("div",{className:"es-segs-fit",children:/* @__PURE__ */a("div",{role:"group","aria-label":n,"data-disabled":d||void 0,className:`es-segs${o?" is-measured":""}${c?` ${c}`:""}`,style:o,children:s.map(e=>{const s=e.id===l,n=e.title??("string"==typeof e.label?e.label:void 0),r=d||!0===e.disabled,c=`es-seg${e.icon?" has-icon":""}${s?" is-active":""}`;/* @__PURE__ */
|
|
4
|
-
return i("button",{type:"button",title:n,"aria-label":n,"aria-pressed":s,disabled:r,className:c,onClick:()=>t(e.id),children:[e.icon?/* @__PURE__ */a("span",{className:"es-seg-icon","aria-hidden":"true",children:e.icon}):null,
|
|
5
|
-
/* @__PURE__ */a("span",{className:"es-seg-word",children:e.label})]},String(e.id))})})})}function l({checked:e,onChange:i,disabled:s,id:l,ariaLabel:t,ariaLabelledBy:n,className:r}){/* @__PURE__ */
|
|
6
|
-
return a("button",{type:"button",role:"switch",id:l,"aria-checked":e,"aria-label":t,"aria-labelledby":n,disabled:s,className:r?`es-switch ${r}`:"es-switch",onClick:()=>i(!e)})}export{s as SettingsSegmented,l as SettingsSwitch};
|
package/dist/chunk-Q4N7C6CT.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{clientOnly as e}from"./chunk-GXQCZJOP.js";import{ScreenStoreProvider as n}from"./chunk-SARZN4M7.js";import{ScreenChrome as r}from"./chunk-HLEET6NV.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
|
-
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
|
-
/* @__PURE__ */c("h2",{id:"sf-leave-title",className:"text-[15px] font-semibold text-zinc-900",children:"Unsaved changes"}),
|
|
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."}),
|
|
5
|
-
/* @__PURE__ */l("div",{className:"mt-4 flex justify-end gap-2",children:[
|
|
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
|
-
/* @__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
|
-
/* @__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: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};
|
package/dist/chunk-QH6LCNOX.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
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
|
-
return r(c,{children:[
|
|
3
|
-
/* @__PURE__ */r("button",{type:"button",className:"sf-add-card","aria-expanded":h,onClick:i??(()=>u(e=>!e)),children:[
|
|
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:[
|
|
5
|
-
/* @__PURE__ */o("span",{className:"sf-menugroup-title",children:e.group}),
|
|
6
|
-
/* @__PURE__ */o("span",{className:"sf-menugroup-count",children:e.items.length})]}),e.items.map(e=>/* @__PURE__ */r("button",{type:"button",className:"sf-blockmenu-item",role:"menuitem",onClick:()=>{u(!1),t(e.type)},children:[
|
|
7
|
-
/* @__PURE__ */o("span",{className:"sf-chip",children:/* @__PURE__ */o(d,{type:e.type,size:13})}),
|
|
8
|
-
/* @__PURE__ */o("span",{className:"sf-row-name",children:e.label})]},e.type))]},e.group??"all"))})]})}export{l as AddBlockRow};
|
package/dist/chunk-RW4XBUUW.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=/\b(transform|translate|rotate|scale|perspective|filter|backdrop-filter|contain)\b/;function t(t){const n=e=>t.getPropertyValue(e).trim(),r=(e,t)=>{const r=n(e);return""!==r&&!t.includes(r)};return!!r("transform",["none"])||(!!(r("translate",["none"])||r("rotate",["none"])||r("scale",["none"]))||(!!r("perspective",["none"])||(!!r("filter",["none"])||(!(!r("backdrop-filter",["none"])&&!r("-webkit-backdrop-filter",["none"]))||(!!/\b(layout|paint|strict|content)\b/.test(n("contain"))||(!!r("container-type",["normal"])||(!!r("content-visibility",["visible"])||e.test(n("will-change")))))))))}function n(e){const n=e?.ownerDocument,r=n?.defaultView;if(!(e&&n&&r&&e.isConnected))return null;for(let o=e;o&&o!==n.body&&o!==n.documentElement;o=o.parentElement)if(t(r.getComputedStyle(o)))return null;return e}export{n as menuPortalTarget};
|
package/dist/chunk-TTJ54QGG.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import{DEFAULT_DRAG_WORDS as e}from"./chunk-O2NLQBFX.js";import{dropEffectFor as t,scrollBoxOf as n,frameScrollBox as l,startAutoScroll as r,isNoOpDrop as a}from"./chunk-67GNT6PF.js";import{useCanvasLayout as o,useCanvasEvent as s}from"./chunk-PAELDYYS.js";import{framePointToHost as i,elementScale as c,frameRectToLayer as d,clientPointToLayer as u}from"./chunk-ZNCEOSXO.js";import{CloseIcon as h,SearchIcon as f}from"./chunk-L5KW4HG5.js";import{parseZoneKey as p}from"./chunk-KRXQM65X.js";import{useRef as m,useEffect as b,useState as g,useCallback as y,useMemo as v,useSyncExternalStore as x,useId as k,useLayoutEffect as w}from"react";import{jsxs as N,jsx as A}from"react/jsx-runtime";var D=(e,t,n)=>t>=e.left&&t<=e.left+e.width&&n>=e.top&&n<=e.top+e.height,z=e=>e.width*e.height;function T(e,t,n){let l=null;for(const r of e)D(r.box,t,n)&&(!l||z(r.box)<=z(l.box))&&(l=r);return l}function C(e,t,n){const l="x"===e.axis?t:n;let r=0;for(const t of e.children){l>("x"===e.axis?t.left+t.width/2:t.top+t.height/2)&&(r+=1)}return r}function S(e,t){const n=e.children;if("x"===e.axis){const l=n[t-1],r=n[t],a=l&&r?(l.left+l.width+r.left)/2:l?l.left+l.width:r?r.left:e.box.left,o=r??l??e.box;return{left:a-1,top:o.top,width:2,height:o.height}}const l=n[t-1],r=n[t],a=l&&r?(l.top+l.height+r.top)/2:l?l.top+l.height:r?r.top:e.box.top;return{left:e.box.left,top:a-1,width:e.box.width,height:2}}function E(e,t,n,l,r=()=>!1,a=()=>!0){const o=e.filter(e=>D(e.box,t,n)).sort((e,t)=>z(e.box)-z(t.box));for(const e of o){const o=C(e,t,n),s={...e.list,index:o};if(r(s))return null;if(l(s))return{zone:e,to:s,line:S(e,o)};if(!a(s))return null}return null}function L(e,t=e.key){const n=[];for(let l=1;l<e.children.length;l++){const r=e.children[l-1],a=e.children[l],o=r.top+r.height;n.push({key:`${t}:${l}`,place:{...e.list,index:l},box:{left:e.box.left,top:o,width:e.box.width,height:Math.max(a.top-o,0)}})}return n}var j={nodes:[],zones:[]},$="data-puck-dropzone",B="data-puck-component";function K(e,t){if(e.length>=2){const[t,n]=e;return Math.abs(n.top-t.top)<Math.min(t.height,n.height)/2&&n.left>t.left?"x":"y"}const n=t.ownerDocument.defaultView?.getComputedStyle(t);return n&&n.display.includes("flex")&&n.flexDirection.startsWith("row")?"x":"y"}function M(e,t){const{frame:n,document:l}=e,r=e=>d(n,function(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top,width:t.width,height:t.height}}(e),t),a=[],o=[];for(const e of l.querySelectorAll(`[${$}]`)){const t=e.getAttribute($)??"";let n;try{n=p(t)}catch{continue}const l=[...e.querySelectorAll(`[${B}]`)].filter(t=>t.parentElement?.closest(`[${$}]`)===e),s=l.map(r);o.push({key:t,list:n,box:r(e),axis:K(s,e),children:s}),l.forEach((e,t)=>{const l=e.getAttribute(B);l&&a.push({id:l,place:{...n,index:t},box:s[t]})})}return{nodes:a,zones:o}}var O="data-es-empty-cell",X="data-puck-dropzone",q=140;var P=e=>({left:e.left,top:e.top,width:e.width,height:e.height});function Y(d){const{canvas:h,session:f,readOnly:p,words:k=e.canvas}=d,D=m(d);b(()=>{D.current=d});const z=m(null),C=o(h),[S,L]=g(0),$=y(()=>L(e=>e+1),[]),[B,K]=g(j);b(()=>{const e=z.current;h&&e&&K((D.current.measure??M)(h,e))},[h,C,d.revision,S]);const q=d.model,Y=v(()=>q(B),[q,B]),F=x(f.subscribe,f.shown,f.shown),[R,Z]=g(null),[G,Q]=g(null),W=m(null),H=()=>{W.current&&clearTimeout(W.current),W.current=null},I=()=>{H(),W.current=setTimeout(()=>{f.get()||Z(null)},140)};b(()=>H,[]);const V=m(null);s(h,"mousemove",e=>{const t=z.current;if(!h||!t)return;const n=i(h.frame,e.clientX,e.clientY,t),l=c(t),r={x:n.x/l,y:n.y/l};if(V.current=r,D.current.readOnly||f.get())return;H();const a=T(Y.sources,r.x,r.y);Z(e=>e?.key===a?.key&&e?.box===a?.box?e:a)}),s(h,"mouseout",e=>{e.relatedTarget||(V.current=null,I())}),s(h,"mouseover",e=>{e.relatedTarget||$()});const J=m(null),U=y(()=>{J.current?.(),J.current=null,Q(null)},[]);b(()=>f.subscribe(()=>{f.get()?$():U()}),[f,U,$]),b(()=>U,[U]),("undefined"==typeof document?b:w)(()=>{if(f.get())return;const e=V.current;Z(t=>p?null:e?T(Y.sources,e.x,e.y):t?Y.sources.find(e=>e.key===t.key)??null:null)},[Y,F,f,p]);const _=e=>{const t=f.get(),n=z.current;if(!t||!n)return null;const l=u(n,e.clientX,e.clientY);V.current=l;const r=E(Y.zones,l.x,l.y,e=>D.current.canDrop(t.item,e),e=>!!t.from&&a(t.from,e),e=>D.current.fallThrough?.(t.item,e,t.from)??!0);return r?{h:t,t:r}:null},ee={onDragEnter:e=>{if(J.current)return;const t=n(e.currentTarget.parentElement?.parentElement??null),a=h?l(h.document):null,o=[];t&&o.push(r(t)),a&&h&&o.push(r(a,h.frame)),J.current=o.length?()=>o.forEach(e=>e()):null},onDragOver:e=>{const n=_(e);if(!n)return void Q(null);e.preventDefault(),e.dataTransfer.dropEffect=t(e.dataTransfer.effectAllowed);const l={zoneKey:n.t.zone.key,line:n.t.line,axis:n.t.zone.axis};Q(e=>e&&e.zoneKey===l.zoneKey&&e.line.left===l.line.left&&e.line.top===l.line.top?e:l)},onDragLeave:e=>{const t=e.relatedTarget;t&&e.currentTarget.contains(t)||(V.current=null,Q(null))},onDrop:e=>{const t=_(e);t&&(e.preventDefault(),f.end(),U(),D.current.onDrop(t.h.item,t.t.to))}},te={draggable:!p&&!!R,onMouseEnter:H,onMouseLeave:()=>!f.get()&&I(),onDragStart:e=>{if(R&&!p){f.start({key:R.key,item:R.item,from:R.from}),e.dataTransfer.effectAllowed="move";try{e.dataTransfer.setData("text/plain",R.key)}catch{}}else e.preventDefault()},onDragEnd:()=>{f.end(),U()},onClick:()=>{R&&!p&&D.current.onPick?.(R.item)}},{seams:ne=[]}=Y,le=Y.zones.filter(e=>0===e.children.length),re=d.onZoneAdd&&!p?le:[],ae=re.map(e=>e.key).join("\n");return b(()=>{const e=h?.document;if(!e)return;const t=new Set(ae?ae.split("\n"):[]);for(const n of e.querySelectorAll(`[${X}]`))n.toggleAttribute(O,t.has(n.getAttribute(X)??""));return()=>{for(const t of e.querySelectorAll(`[${O}]`))t.removeAttribute(O)}},[h,ae,B,C,S]),/* @__PURE__ */N("div",{ref:z,className:"es-canvas-layer",children:[F||!d.onSeamAdd||p?null:ne.map(e=>/* @__PURE__ */A("div",{className:"es-canvas-seam",style:{left:e.box.left,top:e.box.top+e.box.height/2-8,width:e.box.width,height:16},children:/* @__PURE__ */A("button",{type:"button",className:"es-canvas-seam-add",onClick:()=>d.onSeamAdd?.(e.place),children:k.addButton({label:d.seamLabel??k.addSection})})},e.key)),re.length?re.map(e=>/* @__PURE__ */A("button",{type:"button",className:G?.zoneKey===e.key?"es-canvas-empty is-over":"es-canvas-empty",style:P(e.box),onClick:()=>d.onZoneAdd?.({...e.list,index:0}),children:/* @__PURE__ */A("span",{className:"es-canvas-empty-add",children:k.addButton({label:d.zoneAddLabel??k.addBlock})})},e.key)):null,F?/* @__PURE__ */A("div",{className:"es-canvas-catch",...ee}):null,G&&!le.some(e=>e.key===G.zoneKey)?/* @__PURE__ */A("div",{className:`es-canvas-line is-${G.axis}`,style:P(G.line)}):null,
|
|
2
|
-
/* @__PURE__ */N("div",{className:["es-canvas-handle",R&&!p?"is-shown":"",F?"is-dragging":""].filter(Boolean).join(" "),style:R?{left:R.box.left+2,top:Math.max(R.box.top-11,0)}:void 0,title:R?R.title??k.handle({label:R.label}):void 0,...te,children:[
|
|
3
|
-
/* @__PURE__ */A("span",{className:"es-canvas-grip","aria-hidden":"true",children:"⋮⋮"}),R?.label]})]})}var F=e=>e.tiles.length>0&&e.tiles.every(e=>null!=e.cover);function R({groups:t,session:n,itemFor:l,onInsert:r,at:a,hint:o,searchLabel:s,readOnly:i,words:c=e.add}){const d=o??c.hint,u=s??c.search,[p,m]=g(""),b=k(),y=p.trim().toLowerCase(),v=t.map(e=>({...e,tiles:y?e.tiles.filter(e=>((e,t)=>e.label.toLowerCase().includes(t)||(e.keywords??[]).some(e=>e.toLowerCase().includes(t)))(e,y)):e.tiles})).filter(e=>e.tiles.length>0),x=(e,t)=>r=>{if(t)r.preventDefault();else{n.start({key:`new:${e}`,item:l(e)}),r.dataTransfer.effectAllowed="copy";try{r.dataTransfer.setData("text/plain",e)}catch{}}};/* @__PURE__ */
|
|
4
|
-
return N("div",{className:"es-add",children:[a?/* @__PURE__ */N("div",{className:"es-add-at",role:"status",children:[
|
|
5
|
-
/* @__PURE__ */A("span",{children:a.label}),
|
|
6
|
-
/* @__PURE__ */A("button",{type:"button",className:"es-add-at-clear","aria-label":c.stop,title:c.stop,onClick:a.onClear,children:/* @__PURE__ */A(h,{size:12,"aria-hidden":"true"})})]}):null,
|
|
7
|
-
/* @__PURE__ */A("p",{className:"es-add-hint",children:d}),
|
|
8
|
-
/* @__PURE__ */N("div",{className:"es-add-search",children:[
|
|
9
|
-
/* @__PURE__ */A(f,{size:16,"aria-hidden":"true"}),
|
|
10
|
-
/* @__PURE__ */A("input",{id:b,type:"search","aria-label":u,placeholder:c.searchPlaceholder({label:u}),value:p,onChange:e=>m(e.target.value)}),p?/* @__PURE__ */A("button",{type:"button",className:"es-add-search-clear","aria-label":c.clearSearch,onClick:()=>m(""),children:/* @__PURE__ */A(h,{size:12,"aria-hidden":"true"})}):null]}),0===v.length?/* @__PURE__ */N("div",{className:"es-add-empty",role:"status",children:[
|
|
11
|
-
/* @__PURE__ */A("div",{className:"es-add-empty-title",children:c.nothing({query:p.trim()})}),
|
|
12
|
-
/* @__PURE__ */A("div",{className:"es-add-empty-sub",children:c.tryAnother})]}):v.map(e=>/* @__PURE__ */N("section",{className:"es-add-group","aria-label":e.title,children:[
|
|
13
|
-
/* @__PURE__ */N("div",{className:"es-add-group-head",children:[
|
|
14
|
-
/* @__PURE__ */A("span",{className:"es-add-group-title",children:e.title}),
|
|
15
|
-
/* @__PURE__ */A("span",{className:"es-add-group-count",children:e.tiles.length})]}),
|
|
16
|
-
/* @__PURE__ */A("div",{className:F(e)?"es-add-grid is-cards":"es-add-grid",children:e.tiles.map(e=>{const t=Boolean(i||e.disabled),l=i?void 0:e.disabled?e.disabledReason:e.title??c.tile({label:e.label});/* @__PURE__ */
|
|
17
|
-
return N("button",{type:"button",className:null!=e.cover?"es-add-tile has-cover":"es-add-tile",draggable:!t,"aria-disabled":t||void 0,"aria-label":c.tile({label:e.label}),title:l,onDragStart:x(e.type,t),onDragEnd:()=>n.end(),onClick:()=>!t&&r(e.type),children:[null!=e.cover?/* @__PURE__ */A("span",{className:"es-add-tile-cover","aria-hidden":"true",children:e.cover}):e.icon?/* @__PURE__ */A("span",{className:"es-add-tile-glyph","aria-hidden":"true",children:e.icon}):null,
|
|
18
|
-
/* @__PURE__ */A("span",{className:"es-add-tile-label",children:e.label})]},e.type)})})]},e.title))]})}export{R as AddPanel,Y as CanvasDragLayer,j as EMPTY_MEASURE,q as HANDLE_GRACE_MS,E as canvasTarget,D as contains,C as gapInZone,S as gapLine,M as measureCanvas,T as pickSource,L as seamsBetween};
|
package/dist/chunk-VSHV6KJQ.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
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};
|
package/dist/chunk-VSOP4GUM.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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};
|
package/dist/chunk-WZ7TGAAT.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{DEFAULT_RAIL_WORDS as a}from"./chunk-2OAZYSWJ.js";import{wordFitVars as i}from"./chunk-BZ5ASXOL.js";import{jsxs as e,jsx as r}from"react/jsx-runtime";function o({label:a,worded:i,icon:o,active:l,disabled:t,onSelect:n,className:d}){const s=["es-rail-btn",l?"is-active":"",d??""].filter(Boolean).join(" ");/* @__PURE__ */
|
|
2
|
-
return e("button",{type:"button",className:s,title:a,"aria-label":a,"aria-pressed":"boolean"==typeof l?l:void 0,disabled:t,onClick:t?void 0:n,children:[o,i?/* @__PURE__ */r("span",{className:"es-rail-word","aria-hidden":"true",children:a}):null]})}function l({items:e,ariaLabel:l=a.label,className:t,orientation:n="column",wordFit:d}){const s="row"===n,c=s&&d?d:void 0;/* @__PURE__ */
|
|
3
|
-
return r("div",{className:["es-rail",s?"es-rail-row":"",c?"is-measured":"",t??""].filter(Boolean).join(" "),role:"toolbar","aria-orientation":s?"horizontal":"vertical","aria-label":l,style:c&&i(e.length,c),children:e.map(a=>/* @__PURE__ */r(o,{label:a.label,worded:Boolean(c),icon:a.icon,active:a.active,disabled:a.disabled,onSelect:a.onSelect},a.id))})}var t={railWidth:46,railPaddingY:8,railGap:4,railRadius:12,buttonSize:34,buttonRadius:9,iconSize:18,wordPaddingX:8,wordGap:8,wordFontSize:12,wordFontWeight:500,transition:"background 0.12s, color 0.12s",disabledOpacity:.35,color:{background:"#ffffff",shadow:"0 1px 2px rgba(0, 0, 0, 0.05), 0 10px 30px rgba(0, 0, 0, 0.06)",idle:"#6b7280",hoverBg:"#f3f4f6",hoverFg:"#111827",accent:"#2563eb",accentTint:"#eff6ff"}},n={railWidth:"--es-rail-w",railPaddingY:"--es-rail-pad-y",railGap:"--es-rail-gap",railRadius:"--es-rail-radius",buttonSize:"--es-rail-btn-size",buttonRadius:"--es-rail-btn-radius",iconSize:"--es-rail-icon-size",wordPaddingX:"--es-rail-word-pad-x",wordGap:"--es-rail-word-gap",wordFontSize:"--es-rail-word-size",wordFontWeight:"--es-rail-word-weight",background:"--es-rail-bg",shadow:"--es-rail-shadow",idle:"--es-rail-fg",hoverBg:"--es-rail-hover-bg",hoverFg:"--es-rail-hover-fg",accent:"--es-rail-accent",accentTint:"--es-rail-accent-tint"};export{l as EaselRail,o as EaselRailButton,n as railCssVars,t as railTokens};
|
package/dist/chunk-YC4TB3CJ.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
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
|
-
return p("div",{className:"es-topbar",children:e})}function C({kind:e,style:n,children:t}){/* @__PURE__ */
|
|
3
|
-
return p("div",{className:e?`es-cluster es-cluster--${e}`:"es-cluster",style:n,children:t})}function x(){/* @__PURE__ */
|
|
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__ */
|
|
5
|
-
return p("button",{ref:r,type:"button",className:i?`es-iconbtn es-iconbtn--${i}`:"es-iconbtn",title:e,"aria-label":e,disabled:t,onClick:n,children:a})}function S({devices:e,value:t,onChange:i,ariaLabel:r}){const a=c("chrome",n);/* @__PURE__ */
|
|
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
|
-
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
|
-
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 T({icon:e,name:n,kind:t,actions:i}){/* @__PURE__ */
|
|
10
|
-
return v("div",{className:"es-insp-head",children:[
|
|
11
|
-
/* @__PURE__ */p("span",{className:"es-insp-chip","aria-hidden":"true",children:e}),
|
|
12
|
-
/* @__PURE__ */v("div",{className:"es-insp-titles",children:[
|
|
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 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
|
-
/* @__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 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
|
-
/* @__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 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
|
-
return v("div",{className:`es-notice is-${l.tone}`,role:l.urgent?"alert":"status",children:[
|
|
23
|
-
/* @__PURE__ */v("span",{className:"es-notice-text",children:[
|
|
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},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};
|
package/dist/chunk-ZFDCDJNZ.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{DEFAULT_TREE_WORDS as e}from"./chunk-3EDSDPIP.js";import{ChevronIcon as a,AddIcon as r}from"./chunk-L5KW4HG5.js";import{jsx as l,jsxs as n,Fragment as s}from"react/jsx-runtime";function t({className:e,children:a,rootProps:r}){/* @__PURE__ */
|
|
2
|
-
return l("div",{...r,className:e?`es-tree ${e}`:"es-tree",children:a})}function i({children:e}){/* @__PURE__ */
|
|
3
|
-
return l("div",{className:"es-tree-group",children:e})}function d({children:e}){/* @__PURE__ */
|
|
4
|
-
return l("div",{className:"es-subtree",children:e})}var o=e.dragHint;function c({icon:r,name:t,preview:i,selected:d,hidden:o,draggable:c,dragHint:p,dragging:m,drop:h,fold:u,handle:b,actions:N,nameSlot:g,onSelect:k,marks:y,badge:f,trailing:v,children:w,rowProps:P,words:j=e}){const x=["es-tree-row",d?"is-selected":"",o?"is-hidden":"",c?"is-draggable":"",m?"is-dragging":"",h?`is-drop-${h}`:""].filter(Boolean).join(" "),A=/* @__PURE__ */n(s,{children:[
|
|
5
|
-
/* @__PURE__ */n("span",{className:"es-tree-name",children:[t,i?/* @__PURE__ */l("span",{className:"es-tree-preview",children:i}):null]}),y?.map(e=>/* @__PURE__ */l("span",{className:"es-tree-mark",title:e.label,"aria-label":e.label,role:"img",children:e.icon},e.key)),null!=f&&!1!==f?/* @__PURE__ */l("span",{className:"es-tree-badge",children:f}):null]});/* @__PURE__ */
|
|
6
|
-
return n("div",{...P,className:x,children:[c?
|
|
7
|
-
/* @__PURE__ */n(s,{children:[
|
|
8
|
-
/* @__PURE__ */l("span",{className:"es-tree-grip","aria-hidden":"true",children:"⋮"}),
|
|
9
|
-
/* @__PURE__ */l("span",{className:"es-tree-hint","aria-hidden":"true",children:p??j.dragHint})]}):b?/* @__PURE__ */l("button",{type:"button",className:"es-tree-handle",...b,children:"⋮⋮"}):null,u?/* @__PURE__ */l("button",{type:"button",className:"es-tree-caret","aria-label":u.open?j.collapseNamed({label:u.label}):j.expandNamed({label:u.label}),"aria-expanded":u.open,title:u.open?j.collapse:j.expand,onClick:e=>{e.stopPropagation(),u.onToggle()},children:/* @__PURE__ */l(a,{size:11,strokeWidth:2.6,className:u.open?"es-tree-chev is-open":"es-tree-chev"})}):/* @__PURE__ */l("span",{className:"es-tree-caret-spacer","aria-hidden":"true"}),
|
|
10
|
-
/* @__PURE__ */l("span",{className:"es-tree-chip","aria-hidden":"true",children:r}),
|
|
11
|
-
/* @__PURE__ */n("span",{className:"es-tree-name-box",children:[g??(k?
|
|
12
|
-
/* @__PURE__ */l("button",{type:"button",className:"es-tree-select","aria-current":d?"true":void 0,"aria-keyshortcuts":c?"Alt+ArrowUp Alt+ArrowDown":void 0,onClick:k,children:A}):A),N?/* @__PURE__ */l("span",{className:"es-tree-actions",children:N}):null]}),v?/* @__PURE__ */l("span",{className:"es-tree-trailing",title:v.label,"aria-label":v.label,role:"img",children:v.icon}):null,w]})}function p({kind:e,label:a,onClick:r,pressed:n,disabled:s,children:t}){/* @__PURE__ */
|
|
13
|
-
return l("button",{type:"button",className:"delete"===e?"es-tree-del":"eye"===e?"es-tree-eye":"es-tree-act",title:a,"aria-label":a,"aria-pressed":n,disabled:s,onClick:e=>{e.stopPropagation(),r()},children:t})}function m({drop:e,onAdd:a,label:r,seamProps:n}){const s=["es-tree-seam",e?"is-drop":"",a?"has-add":""].filter(Boolean).join(" ");/* @__PURE__ */
|
|
14
|
-
return l("div",{...n,className:s,children:a?/* @__PURE__ */l("button",{type:"button",className:"es-tree-seam-add","aria-label":r,title:r,onClick:a,children:"+"}):null})}function h({drop:a,onAdd:s,label:t,seamProps:i,words:d=e}){const o=["es-tree-empty",a?"is-drop":"",s?"has-add":""].filter(Boolean).join(" "),c=d.dropHere??e.dropHere;/* @__PURE__ */
|
|
15
|
-
return l("div",{...i,className:o,children:s?/* @__PURE__ */n("button",{type:"button",className:"es-tree-empty-add",onClick:s,children:[
|
|
16
|
-
/* @__PURE__ */l(r,{size:12,"aria-hidden":"true"}),a?c:t??d.addBlock??e.addBlock]}):/* @__PURE__ */l("span",{className:"es-tree-empty-note",children:a?c:t??d.emptySlot??e.emptySlot})})}export{t as LayersTree,d as Subtree,o as TREE_DRAG_HINT,h as TreeEmptySlot,i as TreeGroupLabel,c as TreeRow,p as TreeRowAction,m as TreeSeam};
|
package/dist/chunk-ZNS7727Y.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{DEFAULT_PANEL_WORDS as e}from"./chunk-QTLAVDJE.js";import{SettingsSwitch as a}from"./chunk-P6O363EE.js";import{jsx as l,jsxs as n,Fragment as i}from"react/jsx-runtime";import{isValidElement as s,cloneElement as r}from"react";function t({items:a,activeId:i,onSelect:s,ariaLabel:r=e.settings,className:t}){
|
|
2
|
-
/* @__PURE__ */
|
|
3
|
-
return l("div",{className:"es-tabs-fit",children:/* @__PURE__ */l("div",{role:"tablist","aria-label":r,"aria-orientation":"horizontal",className:t?`es-tabs ${t}`:"es-tabs",children:a.map(e=>{const a=e.id===i,r=`es-tab${e.icon?" has-icon":""}${a?" is-active":""}`;/* @__PURE__ */
|
|
4
|
-
return n("button",{type:"button",role:"tab",id:e.htmlId,title:e.label,"aria-label":e.label,"aria-selected":a,"aria-controls":e.panelId,className:r,onClick:()=>s(e.id),children:[e.icon?/* @__PURE__ */l("span",{className:"es-tab-icon","aria-hidden":"true",children:e.icon}):null,
|
|
5
|
-
/* @__PURE__ */l("span",{className:"es-tab-word",children:e.label}),"number"==typeof e.badge&&e.badge>0?/* @__PURE__ */l("span",{className:"es-tab-badge",children:e.badge}):null]},e.id)})})})}function c(e){return Array.isArray(e)?e.some(c):s(e)}function d(e,l,n){if(!s(e)||e.type!==a)return e;const i=e.props;return i.ariaLabel||i.ariaLabelledBy?e:r(e,n?{ariaLabelledBy:n}:{ariaLabel:l})}function o({label:e,labelId:a,icon:s,value:r,hint:t,changed:o,htmlFor:u,action:m,children:h,className:b}){const p=c(h),f=c(m);if(!p&&!f)return null;const N=["es-field"];p||N.push("is-inline"),o&&N.push("is-changed"),b&&N.push(b);const g=/* @__PURE__ */n(i,{children:[s?/* @__PURE__ */l("span",{className:"es-field-icon","aria-hidden":"true",children:s}):null,
|
|
6
|
-
/* @__PURE__ */l("span",{className:"es-field-label",id:a,children:e})]});/* @__PURE__ */
|
|
7
|
-
return n("div",{className:N.join(" "),children:[
|
|
8
|
-
/* @__PURE__ */n("div",{className:"es-field-head",children:[u?/* @__PURE__ */l("label",{className:"es-field-name",htmlFor:u,children:g}):/* @__PURE__ */l("span",{className:"es-field-name",children:g}),null!=r?/* @__PURE__ */l("span",{className:"es-field-value",children:r}):null,f?d(m,e,a):null]}),p?/* @__PURE__ */l("div",{className:"es-field-ctl",children:h}):null,t?/* @__PURE__ */l("p",{className:"es-field-hint",children:t}):null]})}function u({title:e,open:a,onToggle:i,count:s,id:r,children:t,className:c}){const d=r?`${r}-body`:void 0;/* @__PURE__ */
|
|
9
|
-
return n("div",{className:c?`es-group ${c}`:"es-group",children:[
|
|
10
|
-
/* @__PURE__ */n("button",{type:"button",id:r,"aria-expanded":a,"aria-controls":d,className:"es-group-head",onClick:()=>i(!a),children:[e,"number"==typeof s&&s>0?/* @__PURE__ */l("span",{className:"es-group-count",children:s}):null,
|
|
11
|
-
/* @__PURE__ */l("span",{className:"es-group-sign","aria-hidden":"true"})]}),
|
|
12
|
-
/* @__PURE__ */l("div",{id:d,className:"es-group-body",hidden:!a,children:t})]})}var m=Object.freeze(["Content","Style","Layout","Animation"]);export{m as SETTINGS_BUCKETS,o as SettingsField,u as SettingsGroup,t as SettingsTabs};
|
package/dist/chunk-ZTTWFAAC.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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};
|