efficient-easel 20.2.0 → 21.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 +15 -6
- package/dist/{CanvasDragLayer-ARfaivCu.d.ts → CanvasDragLayer-Cd1o0HQf.d.ts} +1 -1
- package/dist/{chunk-TNGOL65V.js → chunk-2E2SXDYQ.js} +1 -1
- package/dist/chunk-2M4T27BI.js +18 -0
- package/dist/chunk-4IJVV7DA.js +1 -0
- package/dist/{chunk-JQXD3TDE.js → chunk-66JNVRQM.js} +1 -1
- package/dist/{chunk-EFHV56BO.js → chunk-7L3NKHEC.js} +14 -14
- package/dist/chunk-APVUYICP.js +65 -0
- package/dist/{chunk-HK6I3NVO.js → chunk-E52W3M5I.js} +1 -1
- package/dist/chunk-EB6NI2VK.js +1 -0
- package/dist/chunk-EZTP6E2M.js +5 -0
- package/dist/chunk-FM6JO4WF.js +2 -0
- package/dist/chunk-FOHHXSOL.js +1 -0
- package/dist/{chunk-I7BROL77.js → chunk-HGCGIRVA.js} +1 -1
- package/dist/chunk-JACEEVVF.js +1 -0
- package/dist/{chunk-QAJAEWCZ.js → chunk-KFWNGPW3.js} +5 -5
- package/dist/{chunk-276MBG5P.js → chunk-LXTM2OLQ.js} +2 -2
- package/dist/{chunk-FGYJ5DJY.js → chunk-MSGZ56QL.js} +1 -1
- package/dist/chunk-MZ5GSSZ3.js +7 -0
- package/dist/{chunk-UJ46J7QW.js → chunk-N2RISV46.js} +1 -1
- package/dist/chunk-NA3GMA43.js +5 -0
- package/dist/{chunk-FGJTX2DL.js → chunk-OBWDHKLI.js} +6 -6
- package/dist/chunk-Q2A7RHG2.js +1 -0
- package/dist/{chunk-JBOSEHIX.js → chunk-R4QJ6DC5.js} +1 -1
- package/dist/chunk-S3DUFDQ6.js +6 -0
- package/dist/chunk-TQ5Y6S2X.js +1 -0
- package/dist/{chunk-OTONLZR4.js → chunk-V2ULLALL.js} +3 -3
- package/dist/chunk-WHS6Y55E.js +10 -0
- package/dist/{chunk-ZOBSIXRD.js → chunk-Y2T3JX7K.js} +1 -1
- package/dist/chunk-YHFKWV7H.js +21 -0
- package/dist/copy/index.js +13 -13
- package/dist/drag/drag.css +3 -9
- package/dist/drag/index.d.ts +2 -2
- package/dist/drag/index.js +1 -1
- package/dist/draw/index.d.ts +1 -1
- package/dist/draw/index.js +1 -1
- package/dist/easel/index.js +1 -1
- package/dist/fields/fields.css +2 -2
- package/dist/fields/index.d.ts +1 -1
- package/dist/fields/index.js +1 -1
- package/dist/panel/index.d.ts +37 -138
- package/dist/panel/index.js +15 -15
- package/dist/panel/panel.css +53 -347
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/MediaPopup.d.ts +5 -6
- package/dist/screen/components/NodeContextMenu.d.ts +3 -3
- package/dist/screen/components/NodeContextMenu.js +1 -1
- package/dist/screen/components/PageEditGuardNotices.js +1 -1
- package/dist/screen/components/SaveControls.d.ts +3 -3
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenDocumentContext.js +1 -1
- package/dist/screen/components/ScreenMount.d.ts +3 -3
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.d.ts +3 -3
- package/dist/screen/components/ScreenStoreProvider.js +1 -1
- package/dist/screen/components/SectionScreenShell.js +16 -16
- package/dist/screen/components/usePartBridge.d.ts +3 -3
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.d.ts +3 -3
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/content/view-tiers.d.ts +14 -2
- package/dist/screen/lib/content/view-tiers.js +1 -1
- package/dist/screen/lib/key-scope.js +1 -1
- package/dist/screen/lib/puck/device-fields.js +1 -1
- package/dist/screen/lib/puck/preview-dom.js +1 -1
- package/dist/screen/lib/puck/style-clipboard.d.ts +3 -3
- package/dist/screen/lib/puck/style-clipboard.js +1 -1
- package/dist/screen/lib/puck/use-section-ops.js +1 -1
- package/dist/screen/lib/screen-parts.d.ts +3 -3
- package/dist/screen/lib/screen-parts.js +1 -1
- package/dist/screen/screen.css +3 -7
- package/dist/screen/words.d.ts +4 -0
- package/dist/screen/words.js +1 -1
- package/dist/strings/index.d.ts +2 -2
- package/dist/strings/index.js +2 -2
- package/dist/text-styles/index.js +30 -30
- package/dist/tree/index.d.ts +4 -4
- package/dist/tree/index.js +1 -1
- package/dist/{types-Bqq6ya0y.d.ts → types-DBy3L69b.d.ts} +11 -4
- package/dist/{words-vhnV8sM7.d.ts → words-CFkb8XtN.d.ts} +5 -0
- package/dist/{words-CvwYvkJm.d.ts → words-SD4neL0n.d.ts} +6 -0
- package/package.json +3 -3
- package/dist/chunk-23DYNW6S.js +0 -1
- package/dist/chunk-23VM4PMV.js +0 -7
- package/dist/chunk-2BOXPUGF.js +0 -1
- package/dist/chunk-3R3PEVU7.js +0 -65
- package/dist/chunk-7LYKFL3Q.js +0 -21
- package/dist/chunk-A6Z4SD3I.js +0 -10
- package/dist/chunk-H2PRGXCW.js +0 -18
- package/dist/chunk-KAML3KQH.js +0 -1
- package/dist/chunk-L2Y3PF2R.js +0 -4
- package/dist/chunk-MEHLY5Q4.js +0 -1
- package/dist/chunk-PAOZMXEI.js +0 -5
- package/dist/chunk-RC25EGHD.js +0 -5
- package/dist/chunk-VANKQVOW.js +0 -8
- package/dist/chunk-WEIE2FBC.js +0 -1
- package/dist/chunk-WRFD4EXD.js +0 -1
|
@@ -29,6 +29,11 @@ type FieldsWords = {
|
|
|
29
29
|
noun: string;
|
|
30
30
|
n: number;
|
|
31
31
|
}) => string;
|
|
32
|
+
/** How many items, in words: the head's count Tooltip and screen-reader text. */
|
|
33
|
+
count: (v: {
|
|
34
|
+
noun: string;
|
|
35
|
+
n: number;
|
|
36
|
+
}) => string;
|
|
32
37
|
/** Where the open item sits: "2 of 5". */
|
|
33
38
|
position: (v: {
|
|
34
39
|
n: number;
|
|
@@ -32,6 +32,12 @@ type DragWords = {
|
|
|
32
32
|
tile: (v: {
|
|
33
33
|
label: string;
|
|
34
34
|
}) => string;
|
|
35
|
+
/** A group's count, in words: its Tooltip and its screen-reader text.
|
|
36
|
+
* `sections` is true for a group of cards (sections with covers). */
|
|
37
|
+
count: (v: {
|
|
38
|
+
count: number;
|
|
39
|
+
sections: boolean;
|
|
40
|
+
}) => string;
|
|
35
41
|
};
|
|
36
42
|
canvas: {
|
|
37
43
|
/** The button in a gap between two sections. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-easel",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "21.0.0",
|
|
4
4
|
"description": "Efficient Easel: the EFFICIENT editors' shared engine and chrome: the saved document as pure functions, the published renderer, and the editor frame, panels, Layers tree, text grammar and type-in-place box. Published as editor-shell up to 0.66.0 and as efficient-editor up to 0.95.0.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Efficient Pty Ltd",
|
|
@@ -627,7 +627,7 @@
|
|
|
627
627
|
"dist"
|
|
628
628
|
],
|
|
629
629
|
"peerDependencies": {
|
|
630
|
-
"efficient-shell": "^
|
|
630
|
+
"efficient-shell": "^10.0.0",
|
|
631
631
|
"react": ">=18",
|
|
632
632
|
"react-dom": ">=18"
|
|
633
633
|
},
|
|
@@ -637,7 +637,7 @@
|
|
|
637
637
|
"@types/node": "^22.0.0",
|
|
638
638
|
"@types/react": "^18.2.0",
|
|
639
639
|
"@types/react-dom": "^18.2.0",
|
|
640
|
-
"efficient-shell": "^
|
|
640
|
+
"efficient-shell": "^10.0.0",
|
|
641
641
|
"esbuild": "^0.27.0",
|
|
642
642
|
"jsdom": "^26.1.0",
|
|
643
643
|
"react": "^18.2.0",
|
package/dist/chunk-23DYNW6S.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={title:"Add",contextAll:"Sections and blocks",done:"Done",doneDescription:"Close Add and go back",templates:"Your templates",tile:({name:e})=>`Add ${e}`,hint:"Drag onto the page.",search:"Search",onlySections:"Only sections go here",notInside:({name:e})=>`Cannot go inside ${e}`,addingTo:({name:e})=>`Adding to ${e}`,addingBefore:({name:e})=>`Adding before ${e}`,addingAtEnd:"Adding at the end of the page",addingHere:"Adding here"},a=e=>1===e?"1 page":`${e} pages`,t={group:"Shared sections",onPages:({count:e})=>`On ${a(e)}`,makeShared:"Make shared",makeSharedHint:"Use this section on other pages from Add. Change it once, and every page changes.",name:"Name",cancel:"Cancel",makeFailed:"Could not make it shared. Try again.",detach:"Detach from shared",removeFromPage:"Remove from this page",removed:({count:e})=>e>0?`Removed from this page · still on ${a(e)}`:"Removed from this page",deleteShared:"Delete shared section",deleteTitle:({name:e})=>`Delete “${e}”?`,deleteMessage:({count:e})=>0===e?"No page uses it. Nothing on the website changes.":1===e?"The page that uses it keeps its own copy. Nothing disappears from the website.":`The ${e} pages that use it each keep their own copy. Nothing disappears from the website.`,deleteFailed:"Could not delete it. Try again.",alreadyHere:"Already on this page"};var o={savedAgo:function({seconds:e}){const a=Math.max(0,Math.floor(e));if(a<1)return"Saved just now";if(a<60)return`Saved ${a} second${1===a?"":"s"} ago`;const t=Math.floor(a/60);if(t<60)return`Saved ${t} minute${1===t?"":"s"} ago`;const o=Math.floor(t/60);return`Saved ${o} hour${1===o?"":"s"} ago`},saved:"All changes saved",saving:"Saving",pending:"Changes not saved yet — saving in a moment",failedIn:({seconds:e})=>`Not saved — trying again in ${e} s`,failedSoon:"Not saved — trying again soon",offline:"You’re offline — we’ll save when you’re back",pausedHeld:"Auto-save is off — changes not saved",paused:"Auto-save is off",locked:({editing:e})=>`Not saving — ${e}`,blockedOffline:"You’re offline. Try again when you’re back online.",blockedFailed:"Your last changes are not saved yet. Try again when they are.",blockedConflict:"Your last save was refused. See the notice below."},n={loading:"Loading",waitingForAuthorization:"Waiting for editor authorization",missingTemplatePage:"Couldn’t open a page in this template.",missingPage:({slug:e})=>`No page with slug "${e}".`,missingDocument:"Couldn’t open this document.",loadFailed:({cause:e})=>`Could not load the document — ${e}`,noun:"page",pageSettings:"Page settings",header:"Header",footer:"Footer",pageSections:"Page",templateSections:"Template",addSection:"Add section",addSectionHere:"Add section here",done:"Done",copied:({name:e})=>`Copied ${e}`,pasteRefused:({name:e})=>`${e} can’t be pasted here.`,add:e,shared:t,canvasAddBlock:"Add block",canvasReplaceImage:"Replace image",railMedia:"Media library",leftPanel:"Left panel",resizeLeftPanel:"Resize left panel",leave:{title:"Unsaved changes",body:"Your most recent edits haven’t finished saving yet. Save them before switching, or leave and discard them.",cancel:"Cancel",discard:"Discard & leave",save:"Save & leave",saving:"Saving"},bar:{undo:"Undo",redo:"Redo",refresh:"Reload the preview",refreshTip:"Reload the preview (keeps your place)",notSaving:"Not saving — see the notice below",retry:"Retry now",autoSaveOff:"Auto-save is off — click to turn it back on (saves your held edits)",autoSaveOn:"Auto-save is on — click to pause it",views:"Left panel views",saveOptions:"Save options",autoSave:"Auto-save",saveNow:"Save now"},saveStatus:o,menu:{undo:"Undo",redo:"Redo",collapseAll:"Collapse all layers",selectAll:"Select all",pinned:"Pinned — can’t be moved or deleted",clipboardRefused:"Your browser won’t let us read the clipboard — press ⌘V"},layers:"Layers",expandAll:"Expand all sections",collapseAll:"Collapse all sections",nothingToFold:"Nothing to fold on this page",rename:"Rename",deleteNamed:({name:e})=>`Delete ${e}`,hideNamed:({name:e})=>`Hide ${e}`,showNamed:({name:e})=>`Show ${e}`,addBlockHere:"Add block here",sectionFirst:({name:e})=>`“${e}” is already first`,sectionLast:({name:e})=>`“${e}” is already last`,sectionMoved:({name:e,n:a,total:t})=>`Moved “${e}” to position ${a} of ${t}`,sectionAdded:({name:e})=>`Added “${e}” section`,deleted:({name:e})=>`Deleted “${e}”`,resizeSettingsPanel:"Resize settings panel",sectionSettings:({name:e})=>`${e} settings`,headerSettings:"Header settings",addBlockMenu:"Add block",deviceNote:{tablet:"Tablet uses the desktop settings.",mobile:"Showing the phone settings for this section."}};export{e as DEFAULT_SCREEN_ADD_WORDS,o as DEFAULT_SCREEN_SAVE_STATUS_WORDS,t as DEFAULT_SCREEN_SHARED_WORDS,n as DEFAULT_SCREEN_WORDS};
|
package/dist/chunk-23VM4PMV.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{STANDARD_MARKUP as t,writeMarkedLines as e,sameMarks as n,markedLines as l,spanFor as r,marksIn as o,toggleMark as i,listIn as a,setList as s,colorOver as c,unlinkAt as u,linkOver as d,colorIn as h,findLink as f,isSafeLinkHref as p}from"efficient-shell/markup";import{Tooltip as m,ColorSwatch as g,ColorPickerPanel as b,Button as k}from"efficient-shell/ui";import{jsxs as v,jsx as y}from"react/jsx-runtime";var x=/* @__PURE__ */new Set(["script","style","head","title","meta","link","template","noscript","svg","math","object","iframe"]),w=/* @__PURE__ */new Set(["p","div","li","ul","ol","dl","dt","dd","h1","h2","h3","h4","h5","h6","blockquote","pre","table","thead","tbody","tfoot","tr","section","article","header","footer","aside","nav","figure","figcaption","address","hr"]);function D(r,o){const i=o.rules??t,a=r.html&&""!==r.html.trim()?function(t,r,o){const i=r.createElement("template");i.innerHTML=t;const a=[[]],s=()=>a[a.length-1],c=()=>{const t=s();for(;t.length>0&&" "===t[t.length-1].ch;)t.pop();t.length>0&&a.push([])},u=(t,e,n,l)=>{if(3===t.nodeType){for(const r of t.textContent??""){const t=/\s/.test(r)?" ":r,o=s();" "===t&&(0===o.length&&a.length>1||" "===o[o.length-1]?.ch)||o.push({ch:t,bold:e,italic:n,href:l})}return}if(1!==t.nodeType&&11!==t.nodeType)return;const r=t,o=1===t.nodeType?r.localName:"";if(x.has(o))return;if("br"===o)return void a.push([]);let i=e,d=n,h=l;if("b"!==o&&"strong"!==o||(i=!0),"i"!==o&&"em"!==o||(d=!0),"a"===o){const t=(r.getAttribute("href")??"").trim();h=p(t)?t:null}const f=1===t.nodeType?r.style:null;if(f){const t=f.fontWeight;"bold"===t||"bolder"===t||Number(t)>=600?i=!0:("normal"===t||"lighter"===t||""!==t&&Number(t)<600)&&(i=!1),"italic"===f.fontStyle||"oblique"===f.fontStyle?d=!0:"normal"===f.fontStyle&&(d=!1)}const m=w.has(o);m&&c();for(const e of[...t.childNodes])u(e,i,d,h);m&&c()};u(i.content,!1,!1,null);for(;a.length>1&&0===a[a.length-1].length;)a.pop();return a.map(t=>function(t,r){const o=e=>t.map((n,l)=>n[e]&&(" "!==n.ch||Boolean(t[l-1]?.[e])&&Boolean(t[l+1]?.[e]))),i=[{bold:!0,italic:!0,links:!0},{bold:!0,italic:!1,links:!0},{bold:!1,italic:!1,links:!0},{bold:!1,italic:!1,links:!1}];for(const a of i){const i=M(t,a.bold?o("bold"):null,a.italic?o("italic"):null,a.links),s=e([i]).text;if(n([i],l(s,r)))return s}return t.map(t=>t.ch).join("")}(t,o))}(r.html,o.doc,i):(r.text??"").replace(/\r\n?/g,"\n").split("\n");return o.multiline?a.join("\n"):1===a.length?a[0]:a.map(t=>t.trim()).filter(t=>""!==t).join(" ")}function M(t,e,n,l){let o=0,i=null,a=null,s=null;return{bullet:!1,chars:t.map((t,c)=>{const u=l?t.href:null;return i=null===u?null:i&&i.href===u?i:r(++o,"link",u),a=e?.[c]?a??r(++o,"bold"):null,s=n?.[c]?s??r(++o,"italic"):null,{ch:t.ch,at:-1,marks:[i,a,s].filter(t=>null!==t)}})}}var T="application/x-efficient-markup",N=/^([0-9]{1,3})\. $/;function C(t,e){const n=t.split("\n"),r=l(t,e);let o=0,i=0;const a=r.map((t,e)=>{const l=!t.bullet&&null==t.number&&"- "===n[e],r=null!=t.number||t.bullet?null:N.exec(n[e]),a=t.bullet||l,s=r?r[1]:t.number??null,c=l||r?[]:t.chars,u=c.map(t=>t.ch).join(""),d=null!=s?s.length+2:a?2:0,h={bullet:a,number:s,chars:c,start:o,src:o+d,vis:i,text:u};return o+=n[e].length+1,i+=u.length+1,h});return{lines:a,text:a.map(t=>t.text).join("\n")}}function A(t,e){const{lines:n}=t;for(let t=0;t<n.length;t+=1){const l=n[t];if(e<=l.vis+l.text.length||t===n.length-1)return[l,Math.max(0,Math.min(e-l.vis,l.text.length)),t]}return[n[0],0,0]}function E(t,e){const[n,l]=A(t,e);if(0===l)return n.src;let r=0;for(const t of n.chars){if(l<=r+t.ch.length)return t.at+(l-r);r+=t.ch.length}return n.src}function S(t,e){const[n,l]=A(t,e);let r=0;for(const t of n.chars){if(l===r)return t.at;r+=t.ch.length}return E(t,e)}function B(t,e){const{lines:n}=t;let l=n[0];for(const t of n)e>=t.start&&(l=t);let r=0;for(const t of l.chars){if(!(e>=t.at+t.ch.length)){e>t.at&&(r+=e-t.at);break}r+=t.ch.length}return l.vis+r}function L(t,e,n){return[B(t,e),B(t,n)]}function R(t,e,n){return e===n?[E(t,e),E(t,e)]:[S(t,e),E(t,n)]}function K(t,e){let n=0;for(let l=0;l<t.chars.length;l+=1){if(n>=e)return l;n+=t.chars[l].ch.length}return t.chars.length}function W(t,o,i,a,s){const c=C(t,o),[u,d,h]=A(c,Math.min(i,a)),[f,p,m]=A(c,Math.max(i,a)),g=K(u,d),b=K(f,p),k=u.chars.slice(0,g),v=f.chars.slice(b),y=i!==a&&u.chars[g]&&(h!==m||g<b)?u.chars[g].marks:function(t,e){const n=t.chars[e-1],l=t.chars[e],r=(t,e)=>{const n=t.findIndex(t=>"link"===t.kind);return-1===n||e?t:t.slice(0,n)};if(n){const t=n.marks.find(t=>"link"===t.kind),e=Boolean(t&&l?.marks.some(e=>e.id===t.id));return r(n.marks,e)}return l?r(l.marks,!1):[]}(u,g);let x=(w=c.lines,Math.max(0,...w.flatMap(t=>t.chars.flatMap(t=>t.marks.map(t=>t.id))))+1);var w;const D=t=>{let e;if(void 0!==s.markup){const t=x;e=l(s.markup,o).map(e=>({bullet:e.bullet,number:e.number??null,chars:e.chars.map(e=>({...e,at:-1,marks:e.marks.map(e=>({...e,id:e.id+t}))}))}))}else{let n=u.number??null;e=(s.text??"").split("\n").map((e,l)=>(l>0&&null!=n&&(n=function(t){return String(Number(t)+1).padStart(t.length,"0")}(n)),{bullet:u.bullet,number:n,chars:[...e].map(e=>({ch:e,at:-1,marks:t??[]}))}))}const n=e.map(t=>t.chars.map(t=>t.ch).join("")).join("\n"),r={bullet:u.bullet,number:u.number??null,chars:[...k,...e[0].chars]},i=e.slice(1);if(i.length>0){const t=i[i.length-1];i[i.length-1]={...t,chars:[...t.chars,...v]}}else r.chars.push(...v);return{lines:[...c.lines.slice(0,h).map(({bullet:t,number:e,chars:n})=>({bullet:t,number:e,chars:n})),r,...i,...c.lines.slice(m+1).map(({bullet:t,number:e,chars:n})=>({bullet:t,number:e,chars:n}))],shown:n}},M=void 0!==s.markup?[null]:[(t=>{let e=t.filter(t=>!s.drop?.some(e=>t.kind===e||"highlight"===e&&"accent"===t.kind));for(const t of s.add??[]){if(e.some(e=>e.kind===t))continue;const n=r(x++,t);n&&(e=[...e,n])}if(void 0!==s.color){e=e.filter(t=>"color"!==t.kind);const t=null===s.color?null:r(x++,"color",s.color);t&&(e=[...e,t])}return e})(y),y,[]];let T="",N="";for(const t of M){const l=D(t),r=e(l.lines).text;if(T=r,N=l.shown,n(l.lines,C(r,o).lines))break}return{text:T,caret:Math.min(i,a)+N.length}}function P(t,e,n,l){const r=C(t,e),[o,,i]=A(r,n);return n!==l||!o.bullet&&null==o.number||""!==o.text?W(t,e,n,l,{text:"\n"}):j(t,e,i,!1,n)}function j(t,n,l,r,o){const i=C(t,n).lines.map(({bullet:t,number:e,chars:n},o)=>o===l?{bullet:r,number:null,chars:n}:{bullet:t,number:e,chars:n});return{text:e(i).text,caret:o}}function V(t,n,l,r){const o=C(t,n),[i,a,s]=A(o,Math.min(l,r)),[c,u,d]=A(o,Math.max(l,r)),h=o.lines.slice(s,d+1).map(({bullet:t,number:e,chars:n},l)=>{const r=0===l?K(i,a):0,o=l===d-s?K(c,u):n.length;return{bullet:t,number:e,chars:n.slice(r,o)}});return e(h).text}function q(t,e,n){if(n<0){const n=t.charCodeAt(e-1);return e-(n>=56320&&n<=57343&&e>=2?2:1)}const l=t.charCodeAt(e);return e+(l>=55296&&l<=56319?2:1)}function F(t){const{value:e,rules:n,multiline:l,inputType:r,pending:o}=t;let[i,a]=t.sel;t.target&&t.target[0]!==t.target[1]&&r.startsWith("delete")&&([i,a]=t.target);const s=[i,a];if("historyUndo"===r||"historyRedo"===r)return{kind:"history",dir:"historyUndo"===r?"undo":"redo"};if("formatBold"===r||"formatItalic"===r||"formatStrikeThrough"===r)return{kind:"format",style:"formatBold"===r?"bold":"formatItalic"===r?"italic":"strike"};if("insertParagraph"===r||"insertLineBreak"===r)return l?{kind:"edit",edit:P(e,n,i,a),range:s}:null;if(r.startsWith("insert")){if("insertTranspose"===r)return null;let c=t.data??"";if("insertFromDrop"===r||"insertFromPaste"===r){const r=D({html:t.html??void 0,text:c},{doc:t.doc,multiline:l,rules:n});return{kind:"edit",edit:W(e,n,i,a,{markup:r}),range:s}}return l||(c=c.replace(/\s*\r?\n\s*/g," ")),{kind:"type",edit:W(e,n,i,a,{text:c,add:o?.add,drop:o?.drop,color:o?.color}),range:s}}if(r.startsWith("delete")){const t=C(e,n),l=t.text;if(i===a){const o=r.includes("Backward"),c=t.lines.findIndex(t=>i>=t.vis&&i<=t.vis+t.text.length),u=t.lines[c];if(o&&u&&i===u.vis&&(u.bullet||null!=u.number))return{kind:"edit",edit:j(e,n,c,!1,i),range:s};if(o?0===i:i===l.length)return null;o?i=q(l,i,-1):a=q(l,a,1)}return{kind:"type",edit:W(e,n,i,a,{text:""}),range:[i,a]}}return null}var I=1e3;function O(t=200){let e=[],n=[],l=null,r=0;return{record(o,i,a){const s="type"===i&&"type"===l&&a-r<1e3;l=i,r=a,n=[],s||(e.push(o),e.length>t&&e.shift())},undo(t){const r=e.pop();return r?(n.push(t),l=null,r):null},redo(t){const r=n.pop();return r?(e.push(t),l=null,r):null},reset(){e=[],n=[],l=null}}}var z=t=>t.preventDefault();function U(t,e){if(t)return t.startsWith("#")?t:e?.find(e=>e.name===t)?.value}function $({colors:t,current:e,words:n,onPick:l}){const r=null===e?null:e.startsWith("#")?e.toLowerCase():t.find(t=>t.name===e)?.value.toLowerCase()??null;/* @__PURE__ */
|
|
2
|
-
return v("div",{className:"es-copy-pop es-copy-colors",role:"dialog","aria-label":n.title,onMouseDown:t=>{"INPUT"!==t.target.tagName&&t.preventDefault()},children:[
|
|
3
|
-
/* @__PURE__ */y("span",{className:"es-copy-pop-label",children:n.theme}),
|
|
4
|
-
/* @__PURE__ */y("div",{className:"es-copy-theme",role:"group","aria-label":n.theme,children:t.map(t=>/* @__PURE__ */y(m,{content:`${t.label} · ${t.value.toUpperCase()}`,children:/* @__PURE__ */y(g,{color:t.value,size:"sm",className:"es-copy-theme-swatch","data-color":t.name,"aria-label":t.label,selected:e===t.name,onMouseDown:z,onClick:()=>l(t.name)})},t.name))}),
|
|
5
|
-
/* @__PURE__ */y("span",{className:"es-copy-pop-label",children:n.any}),
|
|
6
|
-
/* @__PURE__ */y(b,{className:"es-copy-any",value:r??"",onChange:t=>{t!==e&&l(t)},label:n.title,dragWrites:"end"}),
|
|
7
|
-
/* @__PURE__ */y("div",{className:"es-copy-pop-foot",children:/* @__PURE__ */y(k,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onMouseDown:z,onClick:()=>l(null),children:n.remove})})]})}var H={sup:"sub",sub:"sup"};function X(t){const{value:e,rules:n,start:l,end:r,style:a,pending:s}=t,c=H[a];if(l===r){const t=o(e,l,r,n),i=s&&s.at===l?s:null,u=t.has(a),d=!!i?.add.includes(a)||!i?.drop.includes(a)&&u;let h=(i?.add??[]).filter(t=>t!==a),f=(i?.drop??[]).filter(t=>t!==a);return d&&u?f.push(a):d||u||h.push(a),!d&&c&&(h=h.filter(t=>t!==c),t.has(c)&&(f=[...f.filter(t=>t!==c),c])),{kind:"pending",pending:h.length||f.length||void 0!==i?.color?{add:h,drop:f,color:i?.color,at:l}:null}}let u=e,d=l,h=r;if(c&&!o(u,d,h,n).has(a)&&o(u,d,h,n).has(c)){const t=i(u,d,h,c,n);({text:u,selectionStart:d,selectionEnd:h}=t)}return{kind:"edit",result:i(u,d,h,a,n)}}var Y=/^(block|list-item|flex|grid|table|flow-root)$/;function Z(t){const e=t.ownerDocument.defaultView;return!!e&&Y.test(e.getComputedStyle(t).display)}function G(t,e){const n=[],l=/* @__PURE__ */new Map,r=/* @__PURE__ */new Map;let o="",i=!1;const a=()=>{i&&(o+="\n",i=!1)},s=t=>{for(const c of Array.from(t.childNodes)){if(3===c.nodeType){c.data.length>0&&a(),l.set(c,o.length),n.push({node:c,start:o.length,length:c.data.length}),o+=c.data,r.set(c,o.length);continue}if(1!==c.nodeType)continue;const t=c;if(e&&t.matches(e)){l.set(t,o.length),r.set(t,o.length);continue}if("BR"===t.tagName){a(),l.set(t,o.length),o+="\n",r.set(t,o.length);continue}const u=Z(t);u&&((i||o.length>0&&!o.endsWith("\n"))&&(o+="\n"),i=!1),l.set(t,o.length);const d=o.length;s(t),u&&o.length===d&&!i&&n.push({node:t,start:d,length:0}),r.set(t,o.length),u&&(i=!0)}};l.set(t,0),s(t),r.set(t,o.length);return{text:o,at:(t,e)=>{if(3===t.nodeType)return(l.get(t)??0)+Math.min(e,t.data.length);const n=t.childNodes;return e<n.length?l.get(n[e])??r.get(t)??0:r.get(t)??o.length},dom:e=>{for(let t=0;t<n.length;t+=1){const l=n[t],r=l.start+l.length;if(e<l.start)return[l.node,0];if(e<r||e===r&&(t===n.length-1||n[t+1].start>e))return 3===l.node.nodeType?[l.node,e-l.start]:[l.node,0]}const l=n[n.length-1];return l?3===l.node.nodeType?[l.node,l.length]:[l.node,0]:[t,0]}}}function J(t){const e=t.element();if(!e)return null;let n=t.value;const l=t.rules;if(G(e,t.skip).text!==C(n,l).text)return null;const r=t.now??(()=>Date.now()),i=O();let p=e,m=!1,g=null,b=null,k=[t.caret[0],t.caret[1]],v=null,y=!1,x=!1;const w=()=>{x||t.onSelect?.()},M={contenteditable:e.getAttribute("contenteditable"),spellcheck:e.getAttribute("spellcheck")},N=()=>p.ownerDocument,A=()=>N().defaultView?.getSelection()??null,E=()=>{if(!b)return!0;nt();const e=G(p,t.skip);if(e.text!==C(n,l).text)return!1;const[r,o]=b,[i,a]=e.dom(r),[s,c]=e.dom(o);return y||N().activeElement===p||p.focus({preventScroll:!0}),A()?.setBaseAndExtent(i,a,s,c),k=b,S=b,b=null,w(),!0};let S=null;const B=()=>{if(!S)return!1;const t=A(),e=t?.anchorNode??null;return!(e&&e.isConnected&&p.contains(e))||e===p&&0===t.anchorOffset&&(0!==S[0]||0!==S[1])},K=()=>{b=S,E()},P=()=>{E(),N().activeElement===p&&B()&&K();const e=A();if(!(e&&e.anchorNode&&e.focusNode&&p.contains(e.anchorNode)&&p.contains(e.focusNode)))return k;const n=G(p,t.skip),l=n.at(e.anchorNode,e.anchorOffset),r=n.at(e.focusNode,e.focusOffset);return k=l<=r?[l,r]:[r,l],k},j=t=>{const e=N().defaultView;t<=0||!e?S=null:e.requestAnimationFrame(()=>{m||b||(nt(),N().activeElement===p?(B()&&(K(),w()),j(t-1)):S=null)})},q=(t,e)=>{b=[t,e];const n=t=>{if(m)return;if(E())return void j(3);const e=N().defaultView;t>0&&e&&e.requestAnimationFrame(()=>n(t-1))};n(30)},I=(e,l,o)=>{e.text!==n?(i.record({text:n,start:l[0],end:l[1]},o,r()),n=e.text,t.write(n),q(e.caret,e.caret),w()):q(e.caret,e.caret)},z=t=>R(C(n,l),t[0],t[1]),U=(e,o)=>{if(e.text===n)return;i.record({text:n,start:o[0],end:o[1]},"edit",r()),n=e.text,t.write(n);const[a,s]=L(C(n,l),e.selectionStart,e.selectionEnd);q(a,s),w()},$=t=>{if(m)return;const e=P(),[r,o]=z(e),i=X({value:n,rules:l,start:r,end:o,style:t,pending:v});if("pending"===i.kind)return v=i.pending,void w();U(i.result,e)},H=e=>{n=e.text,t.write(n),q(e.start,e.end)},Y=e=>{m||(m=!0,lt.removeEventListener("selectionchange",rt),et(p),t.end(e))},Z=(t,e)=>{const r=P();!m&&r[0]!==r[1]&&t.clipboardData&&(t.preventDefault(),t.clipboardData.setData("text/plain",C(n,l).text.slice(r[0],r[1])),t.clipboardData.setData(T,V(n,l,r[0],r[1])),e&&I(W(n,l,r[0],r[1],{text:""}),r,"edit"))},J=t=>t.preventDefault(),Q=()=>{t.remount?.()},_=[["keydown",e=>{if(m||e.isComposing)return;const l=e.metaKey||e.ctrlKey;if("Escape"!==e.key){if(l&&!e.altKey&&!e.shiftKey&&("k"===e.key||"K"===e.key)&&t.onLinkKey?.())return e.preventDefault(),void e.stopPropagation();if(l&&!e.altKey&&!e.shiftKey&&("KeyA"===e.code||"a"===e.key||"A"===e.key))return e.preventDefault(),e.stopPropagation(),q(0,G(p,t.skip).text.length),void w();if("Enter"===e.key&&(!e.shiftKey||l))return e.preventDefault(),e.stopPropagation(),void Y("enter");if(l&&("z"===e.key||"Z"===e.key||"y"===e.key)){e.preventDefault(),e.stopPropagation();const t=P(),l={text:n,start:t[0],end:t[1]},r="y"===e.key||e.shiftKey?i.redo(l):i.undo(l);r&&H(r)}}else{if(e.preventDefault(),e.stopPropagation(),t.onEscape?.())return;Y("escape")}}],["beforeinput",e=>{if(m)return;if("insertCompositionText"===e.inputType)return;e.preventDefault();const r=P(),o=G(p,t.skip),a="function"==typeof e.getTargetRanges?e.getTargetRanges()[0]:void 0,s=a&&!a.collapsed?[o.at(a.startContainer,a.startOffset),o.at(a.endContainer,a.endOffset)]:null,c=F({value:n,rules:l,multiline:t.multiline,inputType:e.inputType,data:e.data??e.dataTransfer?.getData("text/plain")??"",html:e.dataTransfer?.getData("text/html"),doc:N(),sel:r,target:s,pending:v&&v.at===z(r)[0]?v:null});if(c){if("type"!==c.kind&&"edit"!==c.kind||(v=null),"history"===c.kind){const t={text:n,start:r[0],end:r[1]},e="undo"===c.dir?i.undo(t):i.redo(t);return void(e&&H(e))}"format"!==c.kind?I(c.edit,c.range,c.kind):$(c.style)}}],["compositionstart",()=>{g=P()}],["compositionend",e=>{const o=g;if(g=null,!m&&o)if(e.data){const a=W(n,l,o[0],o[1],{text:e.data});i.record({text:n,start:o[0],end:o[1]},"type",r()),n=a.text,t.write(n),Q(),q(a.caret,a.caret)}else Q(),q(o[0],o[0])}],["paste",e=>{if(m)return;e.preventDefault();const r=P(),o=e.clipboardData,i=o?.getData(T)??"",a=i?t.multiline?i:i.replace(/\s*\r?\n\s*/g," "):D({html:o?.getData("text/html")??"",text:o?.getData("text/plain")??""},{doc:N(),multiline:t.multiline,rules:l});I(W(n,l,r[0],r[1],{markup:a}),r,"edit")}],["copy",t=>Z(t,!1)],["cut",t=>Z(t,!0)],["drop",J],["dragstart",J],["blur",e=>{if(m||null!==g||y)return;const n=e.target,l=n.ownerDocument.defaultView,r=()=>{m||(n.isConnected&&n===t.element()?y||n.ownerDocument.activeElement===n||Y("blur"):q(k[0],k[1]))};l?.requestAnimationFrame?l.requestAnimationFrame(r):setTimeout(r,0)}],["focus",()=>{y=!1}]];function tt(t){t.setAttribute("contenteditable","true"),t.setAttribute("spellcheck","false"),t.setAttribute("data-es-typing","");for(const[e,n]of _)t.addEventListener(e,n)}function et(t){for(const[e,n]of _)t.removeEventListener(e,n);null===M.contenteditable?t.removeAttribute("contenteditable"):t.setAttribute("contenteditable",M.contenteditable),null===M.spellcheck?t.removeAttribute("spellcheck"):t.setAttribute("spellcheck",M.spellcheck),t.removeAttribute("data-es-typing")}function nt(){const e=t.element();e&&e!==p&&(et(p),p=e,tt(p))}const lt=p.ownerDocument;function rt(){m||w()}return lt.addEventListener("selectionchange",rt),tt(p),p.focus({preventScroll:!0}),q(t.caret[0],t.caret[1]),{get value(){return n},update(t){if(t===n)return;const e=C(t,l).text.length,[r,o]=P();n=t,i.reset(),q(Math.min(r,e),Math.min(o,e))},stop(t="stop"){Y(t)},pressed(){let t;x=!0;try{t=P()}finally{x=!1}const[e,r]=z(t),i=o(n,e,r,l),s={};for(const t of["bold","italic","underline","strike","sup","sub","link"]){const n=i.has(t),l=v&&v.at===e?v:null;s[t]=!!l?.add.includes(t)||!l?.drop.includes(t)&&n}const c=v&&v.at===e&&void 0!==v.color?v:null;return{marks:s,list:a(n,e,r,l),selected:r>e,href:f(n,e,r)?.href??null,color:c?c.color??null:h(n,e,r,l)}},press:$,insert(t){if(m)return;y=!1;const e=P(),[l,r]=z(e),o=l+t.length;U({text:n.slice(0,l)+t+n.slice(r),selectionStart:o,selectionEnd:o},e),nt(),p.focus({preventScroll:!0})},hold(){m||(P(),y=!0)},release(){y=!1},resume(){m||(y=!1,nt(),p.focus({preventScroll:!0}),q(k[0],k[1]))},link(t){if(m)return;y=!1;const e=P(),[r,o]=z(e),i=null===t?u(n,r,o,l):d(n,r,o,t,l),a=i.text===n;U(i,e),nt(),p.focus({preventScroll:!0}),a&&q(e[0],e[1])},color(t){if(m)return;const e=P(),[r,o]=z(e);if(r===o){const e=v&&v.at===r?v:null;return v={add:e?.add??[],drop:e?.drop??[],color:t,at:r},void w()}U(c(n,r,o,t,l),e)},list(e){if(m||!t.multiline)return;const r=P(),[o,i]=z(r),c=a(n,o,i,l);U(s(n,o,i,c===e?null:e,l),r)}}}var Q=(t,e,n)=>Math.min(Math.max(t,e),Math.max(e,n));function _({anchor:t,size:e,within:n,clip:l,parent:r,gap:o=8}){const i=Math.max(n.left,l.left),a=Math.min(n.right,l.right)-e.width,s=Q(t.left,i,a),c=l.bottom-(t.bottom+o),u=t.top-o-l.top,d=e.height>c&&(e.height<=u||u>c),h=d?t.top-o-e.height:t.bottom+o,f=t.left+Math.min((t.right-t.left)/2,10),p=Q(f-5-s,10,e.width-10-10);return{top:h-r.top,left:s-r.left,above:d,point:p}}var tt=t=>({left:t.left,top:t.top,right:t.right,bottom:t.bottom});function et(t,e){const n=("function"==typeof t.getClientRects?[...t.getClientRects()]:[]).filter(t=>t.height>0);if(n.length>0){const e="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():n[0];return e.height>0?tt(e):tt(n[0])}if(!e)return null;const l=e.getBoundingClientRect();return{left:l.left,top:l.top,right:l.left,bottom:l.bottom}}function nt(t){const e=t.ownerDocument,n=e.documentElement,l={left:0,top:0,right:n.clientWidth,bottom:n.clientHeight},r=e.defaultView?.getComputedStyle.bind(e.defaultView);for(let o=t.parentElement;o&&o!==n&&o!==e.body;o=o.parentElement){const t=r?.(o);if(!t||"visible"===t.overflowX&&"visible"===t.overflowY)continue;const e=o.getBoundingClientRect();if(0===e.width&&0===e.height)continue;const n=e.left+o.clientLeft,i=e.top+o.clientTop;l.left=Math.max(l.left,n),l.top=Math.max(l.top,i),l.right=Math.min(l.right,n+(o.clientWidth||e.width)),l.bottom=Math.min(l.bottom,i+(o.clientHeight||e.height))}return l}function lt(t){const e=t.offsetParent??t.parentElement;if(!e)return{left:0,top:0};const n=e.getBoundingClientRect();return{left:n.left+e.clientLeft-e.scrollLeft,top:n.top+e.clientTop-e.scrollTop}}function rt(t,e,n){const l=t.ownerDocument,r=l.createTreeWalker(t,4),o=t=>{let e=t,n=null;for(let t=r.nextNode();t;t=r.nextNode()){if(e<=t.data.length)return[t,e];e-=t.data.length,n=t}return n?[n,n.data.length]:null},i=o(e);r.currentNode=t;const a=o(n);if(!i||!a)return null;const s=l.createRange();return s.setStart(i[0],i[1]),s.setEnd(a[0],a[1]),s}export{$ as ColorWindow,T as MARKUP_CLIPBOARD_TYPE,I as TYPING_BURST_MS,U as colorRunOf,O as createHistory,W as editVisible,X as markPress,V as markupOfRange,P as newLine,lt as offsetOrigin,D as pasteToMarkup,_ as placeWindow,F as richInput,C as richLayout,et as selectionBox,R as selectionToSource,L as selectionToVisible,j as setBullet,J as startCanvasTyping,G as textMap,rt as textRange,E as toSource,S as toSourceStart,B as toVisible,nt as visibleArea};
|
package/dist/chunk-2BOXPUGF.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useEaselSession as e}from"./chunk-O7Q4DDJT.js";import{useHostEscape as n}from"./chunk-MQA7OFRA.js";import{DEFAULT_SCREEN_WORDS as t}from"./chunk-23DYNW6S.js";import{styleMenuItems as o}from"./chunk-V7U33NF2.js";import{createNodeClipboard as l,nodeMenuItems as r}from"./chunk-P5VYGWYO.js";import{DEFAULT_NODE_MENU_WORDS as i}from"./chunk-WK3AFPXY.js";import{easelMenuEntries as c,menuLabel as s}from"./chunk-FIVU2COQ.js";import{zoneKey as u,ROOT_SLOT as a,ROOT_ID as d}from"./chunk-K7BTCBWD.js";import{isTypingTarget as p,useCanvasEvent as f,framePointToHost as m}from"./chunk-QIDRJH3S.js";import{ROOT_ZONE as h}from"./chunk-PLVEGYK6.js";import{useState as y,useCallback as k,useRef as b,useEffect as g}from"react";import{ContextMenu as v}from"efficient-shell/ui";import{UndoIcon as w,RedoIcon as x,PasteIcon as C,SettingsIcon as O,LayersIcon as z,CopyIcon as P}from"efficient-shell/icons/efficient";import{jsx as A}from"react/jsx-runtime";function D(e,n){const t=[],o=/* @__PURE__ */new Set;let l={zone:n.zone,index:n.index};for(;l;){const n=e.nodeAt(l.zone,l.index);if(!n||o.has(n.props.id))break;if(o.add(n.props.id),t.push({zone:l.zone,index:l.index,node:n,parentType:null}),l.zone===h)break;const r=l.zone.lastIndexOf(":");if(r<=0)break;l=e.locate(l.zone.slice(0,r))}for(let e=0;e<t.length-1;e+=1)t[e].parentType=t[e+1].node.type;return t}var K=l(),j=/* @__PURE__ */new WeakMap;function M(e){if(e.claimsPage)return K;const n=e.registry;if(!n)return e.cache("easel:node-clipboard",l);let t=j.get(n);return t||(t=l(),j.set(n,t)),t}function S(){return M(e())}function T(e,n,t){if(n===h){const{floor:n,cap:o}=e.sectionBand();return{parentId:d,slot:a,index:Math.min(Math.max(t,n),o)}}const o=n.lastIndexOf(":");return{parentId:n.slice(0,o),slot:n.slice(o+1),index:t}}function Y(e,n,t){const o=e.isPinned(n,t),l=!o&&!e.isLocked(n)&&!e.duplicateBlocked(n),r=e.permits?.(n)??{duplicate:!0,delete:!0};return{copy:!o&&r.duplicate,cut:l&&r.duplicate&&r.delete,delete:l&&r.delete}}function I(e,n,t){const o=e.canPasteAt;if(!o)return u(n.from)===t.zone?T(e,t.zone,t.index+1):null;for(const l of D(e,t)){const t=T(e,l.zone,l.index+1);if(o(n,t))return t}return null}function R(e){if(e.defaultPrevented||e.altKey||e.shiftKey)return null;if(p(e.target))return null;const n=e.target,t=n&&"ownerDocument"in n?n.ownerDocument??n:null,o=t?.getSelection?.();if(o&&!o.isCollapsed&&o.toString().trim())return null;if(!e.metaKey&&!e.ctrlKey)return"Delete"===e.key?"delete":null;const l=e.code||(1===e.key.length?`Key${e.key.toUpperCase()}`:"");return"KeyC"===l?"copy":"KeyX"===l?"cut":"KeyV"===l?"paste":null}function B(e,n,t,o){const l=e.nodeAt(t.zone,t.index);if(!l)return null;const r=l.props.id,i=e.labelOf(l.type,t.zone),c=Y(e,l,t.zone);if("copy"===n)return c.copy?(e.nodeOps.copy(r,i),{done:"copied",name:i}):null;if(o.readOnly)return null;if("cut"===n)return c.cut?(e.nodeOps.cut(r,i),{done:"cut",name:i}):null;if("delete"===n)return c.delete?(e.nodeOps.remove(r),{done:"deleted",name:i}):null;const s=o.held;if(!s)return null;const u=e.isPinned(l,t.zone)?null:I(e,s,t);return u?(e.nodeOps.paste(u),{done:"pasted",name:s.label}):(e.onPasteRefused(s),{done:"refused",name:s.label})}function E(e,n){const{zone:t,index:l}=n,i=e.nodeAt(t,l);if(!i)return[];const c=i.props.id,s=e.labelOf(i.type,t),u=Boolean(i.props._hidden),a=e.nodeOps,d=e.isPinned(i,t),p=e.isLocked(i),f=!d&&!p&&!e.duplicateBlocked(i),m=e.permits?.(i)??{duplicate:!0,delete:!0},y=Y(e,i,t),k=D(e,n),b=a.held,g=b&&!d?I(e,b,n):null,v=!e.readOnly,w=e.style?o({held:v?e.style.held():null,canCopy:e.style.canCopy(i,t),onCopy:()=>e.style?.copy(i,t),onPaste:()=>e.style?.paste(t,l,i),words:e.words?.styleClipboard}):[];return r({title:s,words:e.words?.menu,layer:{group:"pick",items:k.flatMap((n,t)=>{const o={label:e.rowNameOf(n.node,n.zone),checked:0===t,onClick:()=>e.selectAt(n.zone,n.index,n.node.props.id,n.parentType)},l=n.zone===h?null:e.slotRung?.(n.zone)??null;return l?[o,{label:l.label,checked:!1,onClick:l.select}]:[o]})},actions:{duplicate:v&&f&&m.duplicate?()=>a.duplicate(c):void 0,...L(v&&!d,e=>a.canStep(c,e),e=>a.step(c,e)),copy:y.copy?()=>a.copy(c,s):void 0,cut:v&&y.cut?()=>a.cut(c,s):void 0,paste:v&&b&&g?{label:b.label,run:()=>a.paste(g)}:void 0,rename:v&&e.renamePropOf(i,t)?()=>e.beginRename(t,l):void 0,hide:!v||p||d?void 0:{hidden:u,run:()=>a.setProps(c,{_hidden:!u})},delete:v&&f&&m.delete?()=>a.remove(c):void 0},style:w,extras:e.menuRows?.(i,t,l)??void 0,pinnedLine:d?V(e).pinned:void 0})}function L(e,n,t){return e?{moveUp:n(-1)?()=>t(-1):null,moveDown:n(1)?()=>t(1):null}:{}}var V=e=>e.words?.screen??t.menu;function X(e){const n=V(e),o=!e.readOnly,l=[];o&&e.history.hasPast&&l.push({label:n.undo,icon:/* @__PURE__ */A(w,{}),shortcut:"⌘Z",onClick:e.history.back}),o&&e.history.hasFuture&&l.push({label:n.redo,icon:/* @__PURE__ */A(x,{}),shortcut:"⇧⌘Z",onClick:e.history.forward});const r=[],c=e.nodeOps.held,s=T(e,h,e.sectionBand().cap);if(o&&c&&(e.canPasteAt?e.canPasteAt(c,s):u(c.from)===h)){const n=s,t=e.words?.menu??i;r.push({label:t.pasteNamed({paste:t.paste,label:c.label}),icon:/* @__PURE__ */A(C,{}),shortcut:"⌘V",onClick:()=>e.nodeOps.paste(n)})}const a=[l,r,[{label:e.pageSettingsLabel??t.pageSettings,icon:/* @__PURE__ */A(O,{}),onClick:e.openPageSettings},{label:n.collapseAll,icon:/* @__PURE__ */A(z,{}),onClick:e.collapseAll}]].filter(e=>e.length>0),d={label:"—",onClick:()=>{}};return a.flatMap((e,n)=>n?[d,...e]:e)}function N(e,n){const t=n.selectionStart??0,o=n.selectionEnd??0,l=n.value.slice(t,o),r=e=>{n.focus(),n.setRangeText(e,t,o,"end"),n.dispatchEvent(new Event("input",{bubbles:!0}))},c=e.words?.menu??i,s=V(e),u=[];l&&(u.push({label:c.copy,icon:/* @__PURE__ */A(P,{}),shortcut:"⌘C",onClick:()=>navigator.clipboard?.writeText(l)}),u.push({label:c.cut,icon:/* @__PURE__ */A(P,{}),shortcut:"⌘X",onClick:()=>{navigator.clipboard?.writeText(l),r("")}})),u.push({label:c.paste,icon:/* @__PURE__ */A(C,{}),shortcut:"⌘V",onClick:()=>{navigator.clipboard?.readText().then(e=>{e&&r(e)}).catch(()=>e.onPasteRefused())}});const a=[u,n.value?[{label:s.selectAll,shortcut:"⌘A",onClick:()=>{n.focus(),n.select()}}]:[]].filter(e=>e.length>0),d={label:"—",onClick:()=>{}};return a.flatMap((e,n)=>n?[d,...e]:e)}function F(e){return e.shiftKey}function U(e,t){const[o,l]=y(null),r=k(()=>l(null),[]);n(null!==o,r);const i=b(e);i.current=e;const c=k(e=>{const n=i.current,t=n.keys;if(!t)return;const o=R(e);if(!o)return;const l=t.selected();if(!l)return;const r=B(n,o,l,{readOnly:t.readOnly,held:t.held()});r&&(e.preventDefault(),t.onDone?.(r))},[]),s=e.keys?.target??null;g(()=>{if(!s)return;const e=e=>c(e);return s.addEventListener("keydown",e),()=>s.removeEventListener("keydown",e)},[s,c]),f(t,"keydown",c);const u=k(n=>{if(F(n))return;const t=n.target;if(t?.closest?.("[data-slot-zone]"))return n.preventDefault(),void l(null);const o=function(e){const n=e?.closest?.("input, textarea");return n&&("INPUT"!==n.tagName||["text","search","url","email","tel","number",""].includes(n.type))?n:null}(t);if(o)return n.preventDefault(),void l({kind:"input",x:n.clientX,y:n.clientY,el:o,owner:t});const r=t?.closest?.("[data-node-id]")?.getAttribute("data-node-id"),i=r?e.locate(r):null;n.preventDefault(),l(i?{kind:"node",x:n.clientX,y:n.clientY,...i,owner:t}:{kind:"empty",x:n.clientX,y:n.clientY,owner:t})},[e]);f(t,"contextmenu",n=>{if(F(n)||!t)return;const o=n.target?.closest?.("[data-puck-component]")??null,r=o?.getAttribute("data-puck-component"),i=r?e.locate(r):null;n.preventDefault();const c=m(t.frame,n.clientX,n.clientY),s=t.frame;l(i?{kind:"node",...c,...i,owner:s}:{kind:"empty",...c,owner:s})}),f(t,"mousedown",r),f(t,"scroll",r,{on:"window"});return{onEditorContextMenu:u,menu:o?/* @__PURE__ */A(W,{host:e,target:o,onClose:r}):null,closeMenu:r}}function W({host:e,target:n,onClose:t}){const o="node"===n.kind?E(e,n):"input"===n.kind?N(e,n.el):X(e);return 0===o.length?null:/* @__PURE__ */A(v,{at:{x:n.x,y:n.y},owner:n.owner??null,onClose:t,"aria-label":s(o),items:c(o)})}export{K as EASEL_NODE_CLIPBOARD,D as ancestorChain,M as nodeClipboardOf,Y as nodeClipboardRules,E as nodeMenuItems,R as nodeShortcut,X as pageMenuItems,I as pastePlace,B as runNodeShortcut,N as textMenuItems,S as useNodeClipboard,U as useNodeContextMenu};
|
package/dist/chunk-3R3PEVU7.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import{cloneNodeWithFreshIds as e}from"./chunk-2GVCAIPX.js";import{dedupeSlotChildren as n}from"./chunk-26OOWIJJ.js";import{styleClipboardOf as t}from"./chunk-JBOSEHIX.js";import{markedTreeNodeId as o,revealSelectedTreeRow as r,sameSelector as i}from"./chunk-FGNR22NY.js";import{scrollPreviewToSection as l,gotoPreviewSlide as s,scrollPreviewToTop as d}from"./chunk-TNGOL65V.js";import{useEaselKeyTarget as a,useEaselUndoKeys as c,useEaselSaveKey as p,editorRootFocus as u}from"./chunk-I7BROL77.js";import{SlotChildActionsProvider as h}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as f,DEFAULT_PANEL_W as m,clampPanelWidth as g}from"./chunk-C56MPJBH.js";import{usePartBridge as y}from"./chunk-MEHLY5Q4.js";import{useSectionOps as v}from"./chunk-WEIE2FBC.js";import{ScreenSaveIcon as k,ScreenMainButton as b}from"./chunk-PY7OOQEZ.js";import{useBrowserOffline as S}from"./chunk-RKTF5XLP.js";import{AddChildRow as w}from"./chunk-5545A3PC.js";import{AddSidePanel as x}from"./chunk-FGJTX2DL.js";import{keepsSharedSections as z,sharedSectionsOf as C}from"./chunk-43AEUUNQ.js";import{PanelHideButton as O,SidePanelHead as I,PanelShowStrip as N}from"./chunk-SINAM2IT.js";import{offeredChoices as B}from"./chunk-M2Z775ZC.js";import{useScreenSaveSwitch as P,useScreenNodeKeys as $,useScreenPinned as M,useScreenDocumentLabel as j,useScreenCanvasFrame as A,useScreenInspectorPanel as L,useScreenDevices as T,useScreenPickFollowsSelection as E,useScreenLeftView as R,SELECTION_MODE as F,sameInspectorMode as D,useScreenBridges as H,useScreenBlockRules as V,useScreenBlockLook as W,useScreenStorageNamespace as U,useScreenNotify as J,useScreenCanvasHead as G,isSlotMode as Y,useScreenStyleClipboard as X,useScreenDocumentPass as K,useScreenCanvasDrag as Z,ScreenCanvasTargetProvider as Q,isPinnedFirst as _,isPinnedLast as q,screenSlotsOf as ee}from"./chunk-PAOZMXEI.js";import{MediaPopup as ne}from"./chunk-2G6MAXPY.js";import{useNodeClipboard as te,useNodeContextMenu as oe}from"./chunk-2BOXPUGF.js";import{PageEditGuardNotices as re}from"./chunk-UJ46J7QW.js";import{useScreenDocument as ie}from"./chunk-276MBG5P.js";import{requestMediaPick as le}from"./chunk-UNVKPVZW.js";import{useMediaPanel as se,usePanelPick as de,useMediaBrowsing as ae,useOpenMediaBrowse as ce,useMediaPlace as pe}from"./chunk-FHCKFOCD.js";import{useEaselSession as ue}from"./chunk-O7Q4DDJT.js";import{useEaselHost as he,useHostEscape as fe}from"./chunk-MQA7OFRA.js";import{LayersIcon as me,MediaIcon as ge}from"./chunk-XFYFKITX.js";import{DEFAULT_SCREEN_WORDS as ye}from"./chunk-23DYNW6S.js";import{heldStyle as ve,styleShortcut as ke}from"./chunk-V7U33NF2.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as be}from"./chunk-6WY6ZXJG.js";import{useEasel as Se,useEaselApi as we,CanvasPassThroughContext as xe,CanvasSharedContext as ze}from"./chunk-EFHV56BO.js";import{TreeRow as Ce,Subtree as Oe,LayersTree as Ie,TreeGroupLabel as Ne,TreeRowAction as Be,TreeSeam as Pe}from"./chunk-A6Z4SD3I.js";import{DEFAULT_TREE_WORDS as $e}from"./chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as Me}from"./chunk-WK3AFPXY.js";import{toItemSelector as je,useNodeOps as Ae,clickPick as Le}from"./chunk-BSHIQIZC.js";import{EaselTopBar as Te,EaselIconButton as Ee,TopBarCluster as Re,DeviceSwitch as Fe,InspectorIconButton as De,PanelResizeHandle as He,MAX_PANEL_W as Ve,MIN_PANEL_W_BY_SIDE as We,panelWidthVars as Ue}from"./chunk-ZG6PVMC3.js";import{DEFAULT_NOTICE_WORDS as Je,DEFAULT_CHROME_WORDS as Ge}from"./chunk-AJSDWWJW.js";import{holderOf as Ye,nameOrSomeone as Xe}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as Ke}from"./chunk-RE4LP46F.js";import{useWords as Ze}from"./chunk-MFIRYGHW.js";import{insertSeams as Qe,CanvasDragLayer as _e,CanvasInsert as qe}from"./chunk-H2PRGXCW.js";import{DEFAULT_DRAG_WORDS as en}from"./chunk-KAML3KQH.js";import{createDragSession as nn,useTreeDrag as tn,gapToMoveIndex as on}from"./chunk-3S5N4HLJ.js";import{ROOT_ID as rn,ROOT_SLOT as ln,zoneKey as sn,parseZoneKey as dn,find as an,DataError as cn}from"./chunk-K7BTCBWD.js";import{useCanvasFrame as pn,LIST_SELECTOR as un,BLOCK_SELECTOR as hn,useCanvasTyping as fn,useCanvasEvent as mn,nodeIdAt as gn,frameRectToHost as yn,BLOCK_ATTRIBUTE as vn,drawnBox as kn}from"./chunk-QIDRJH3S.js";import{rootRowName as bn,slotChildRowName as Sn,slotChildRenameProp as wn,sectionRenameProp as xn}from"./chunk-BHRC3ASL.js";import{ROOT_ZONE as zn,blockNodeActions as Cn,TREE_MAX_DEPTH as On,childSlotsOf as In,slotFieldsOf as Nn,newNodeId as Bn,slotChildrenIn as Pn,nestsInTree as $n}from"./chunk-PLVEGYK6.js";import{queryMainCopy as Mn}from"./chunk-LF3FUSCQ.js";import{useRef as jn,useMemo as An,useState as Ln,useEffect as Tn,useCallback as En,useLayoutEffect as Rn,Fragment as Fn,useId as Dn}from"react";import{ColoredBadge as Hn,Button as Vn,Tabs as Wn,toast as Un,readMediaFileDrag as Jn,Tooltip as Gn,groupColors as Yn,Dialog as Xn,FormField as Kn,Input as Zn,MEDIA_FILE_DRAG_TYPE as Qn}from"efficient-shell/ui";import{UndoIcon as _n,RedoIcon as qn,RefreshIcon as et,AddIcon as nt,TrashIcon as tt,EyeOffIcon as ot,EyeIcon as rt,SharedIcon as it,DuplicateIcon as lt}from"efficient-shell/icons/efficient";import{jsx as st,jsxs as dt,Fragment as at}from"react/jsx-runtime";var ct="media-file";function pt({name:e,onMake:n,onCancel:t}){const o=Ze("screen",ye).shared,[r,i]=Ln(e),[l,s]=Ln(!1),d=Dn(),a=jn(null),c=async()=>{const e=r.trim();if(e&&!l){s(!0);try{await n(e)}finally{s(!1)}}};/* @__PURE__ */
|
|
2
|
-
return st(Xn,{open:!0,size:"sm",title:o.makeShared,description:o.makeSharedHint,onClose:t,initialFocus:a,footer:/* @__PURE__ */dt(at,{children:[
|
|
3
|
-
/* @__PURE__ */st(Vn,{variant:"secondary",onClick:t,children:o.cancel}),
|
|
4
|
-
/* @__PURE__ */st(Vn,{variant:"primary",loading:l,disabled:!r.trim(),onClick:()=>{c()},children:o.makeShared})]}),children:/* @__PURE__ */st("form",{onSubmit:e=>{e.preventDefault(),c()},children:/* @__PURE__ */st(Kn,{label:o.name,htmlFor:d,children:/* @__PURE__ */st(Zn,{id:d,ref:a,value:r,onChange:e=>i(e.target.value)})})})})}var ut=/* @__PURE__ */new WeakSet;function ht(e,n,t){const o=an(e,n,t);if(!o)return null;const r=o.path.find(e=>"root"!==e.parentId);return r?r.parentId:t}function ft({canvas:e,tabs:n,onSelect:t}){const o=jn(null),[r,i]=Ln({}),l=n.map(e=>`${e.id}:${e.below?1:0}`).join("|");return Rn(()=>{const t=e?.document,r=e?.window,l=e?.frame;if(!t||!r||!l||0===n.length)return void i({});let s=0;const d=()=>{s=0;const e=o.current;if(!e)return;const d=yn(l,{left:0,top:0,width:r.innerWidth,height:r.innerHeight},e),a={};for(const o of n){const n=Mn(t,`[${vn}="${r.CSS?.escape?r.CSS.escape(o.id):o.id}"]`),i=n?kn(n):null;if(!i||0===i.height){a[o.id]=null;continue}const s=yn(l,{left:i.left,top:i.top,width:i.width,height:i.height},e),c=s.top+s.height;if(c<d.top||s.top>d.top+d.height){a[o.id]=null;continue}const p=o.below?c+4:Math.max(s.top,d.top)+6;a[o.id]={left:Math.max(s.left,d.left)+6,top:p}}i(a)},a=()=>{s||(s=r.requestAnimationFrame(d))};d(),r.addEventListener("scroll",a,!0),r.addEventListener("resize",a);const c=new r.MutationObserver(a);return c.observe(t.body,{childList:!0,subtree:!0,attributes:!0}),()=>{s&&r.cancelAnimationFrame(s),r.removeEventListener("scroll",a,!0),r.removeEventListener("resize",a),c.disconnect()}},[e,l]),/* @__PURE__ */st("div",{ref:o,className:"es-band-tabs","aria-hidden":"true",children:n.map(e=>{const n=r[e.id];return n?/* @__PURE__ */st("span",{className:"es-band-tab","data-band-tab":e.id,style:{left:n.left,top:n.top},onClick:n=>{n.stopPropagation(),t(e.id)},children:e.reach?
|
|
5
|
-
/* @__PURE__ */st(Gn,{content:e.reach,children:/* @__PURE__ */dt(Hn,{colorClass:Yn("success","solid"),size:"sm",children:[
|
|
6
|
-
/* @__PURE__ */st("span",{className:"es-band-tab-mark",children:/* @__PURE__ */st(it,{size:12})}),e.label]})}):/* @__PURE__ */st(Hn,{colorClass:Yn("info","solid"),size:"sm",children:e.label})},e.id):null})})}function mt({expand:e}){/* @__PURE__ */
|
|
7
|
-
return st("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */dt(at,e?{children:[
|
|
8
|
-
/* @__PURE__ */st("path",{d:"M8 9l4-4 4 4"}),
|
|
9
|
-
/* @__PURE__ */st("path",{d:"M8 15l4 4 4-4"})]}:{children:[
|
|
10
|
-
/* @__PURE__ */st("path",{d:"M8 4l4 4 4-4"}),
|
|
11
|
-
/* @__PURE__ */st("path",{d:"M8 20l4-4 4 4"}),
|
|
12
|
-
/* @__PURE__ */st("path",{d:"M5 12h14"})]})})}var gt=`${un}, ${hn}`;function yt(e,n,t){const o=t-n;if(o<6)return null;if(o<24)return{top:Math.round((n+t)/2),height:Math.round(o)};return{top:Math.round(Math.min(Math.max(e,n+12),t-12))}}var vt="__rungs";var kt="screen:band",bt={duplicate:!0,delete:!0},St=()=>null;function wt(){const un=he(),yn=un.panels?.Toolbar,vn=(un.panels?.useRight??St)(),{target:kn,docId:Dn,capabilities:Gn,currentSlug:Yn,siteId:Xn,onPublish:Kn,saveState:Zn,saveConflict:it,retrySave:wt,toggleAutoSave:xt,flushSave:zt,access:Ct,saveUnreachable:Ot=!1,readOnly:It,readOnlyReason:Nt=null}=ie(),Bt=P(),Pt=$(),{mediaEditing:$t,hasEditGuard:Mt,hasPinnedChrome:jt}=Gn,{appState:At,dispatch:Lt,history:Tt,selectedItem:Et,getSelectorForId:Rt,config:Ft}=Se(e=>e),Dt=M(),{first:Ht,firstGroup:Vt,lastGroup:Wt,isSectionGroup:Ut,sectionGroupZone:Jt,panelOf:Gt}=Dt,Yt=Gt(Ht),Xt=e=>_(Dt,e),Kt=e=>q(Dt,e),Zt="node"===Dt.firstRow,Qt=Dt.band??null,_t=Ze("screen",ye),qt=Ze("tree",$e),eo=Ze("drag",en),no=Ze("notice",Je),to=Ze("lock",Ke),oo=Ze("menu",Me),ro=Ze("styleClipboard",be),io=Ze("chrome",Ge),lo=j()??`/${Yn}`,so=A(),ao=L(),co=v({readOnly:It}),po=v({readOnly:It,foldIntoHistory:!0}),uo=jn(null),ho=we(),fo=An(()=>({...co,select:e=>{uo.current=e,co.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=ho.config;uo.current=je(e,t,n)}co.commitDocument(e,n)}}),[co,ho]),mo=At.ui,go=mo.leftSideBarVisible,yo=mo.rightSideBarVisible,{options:vo,widths:ko,initial:bo,fluid:So,fit:wo}=T(),[xo,zo]=Ln(bo),Co=se(),Oo=$t&&null!==Co,Io=de(),No=ae(),Bo=null!==Io||No,Po=ce();E(Et?.props.id);const{read:$o,write:Mo,forSelection:jo}=R(),[Ao,Lo]=Ln($o);Tn(()=>{Mo(Ao)},[Ao]);const[To,Eo]=Ln(0),Ro=jn(null),Fo=jn(null),Do=pn(Fo,{readySelector:gt}),Ho=fn(Do),Vo=a(Fo);c(Fo,Do);const Wo=S(),Uo=Ye(Ct),Jo={state:Zn,offline:Wo||Zn.failed&&Ot,readOnlyReason:Nt,editing:Uo?no.editing({name:Xe(Uo.name,to),noun:_t.noun}):null,conflict:null!=it,notSaving:_t.bar.notSaving},Go=()=>{It||(Zn.failed?wt():zt())};p(Fo,Do,Go);const[Yo,Xo]=Ln(!1),Ko=jn(!1),[Zo,Qo]=Ln(null),[_o,qo]=Ln([]),[er,nr]=Ln(F),tr="puck"===er.kind,or=o(er,Et?.props.id),[rr,ir]=Ln(null);Tn(()=>{rr&&(r(),ir(null))},[rr]);const lr=jn(Rt);lr.current=Rt;const sr=En((e,{scroll:n})=>{Lo(n=>jo(e,n)),n&&ir(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=lr.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&Tr(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),dr=jn(null);Tn(()=>{const e=dr.current;dr.current=null;const n=null==Et?.props.id?null:String(Et.props.id);nr(t=>e&&e.id===n?e.mode:"part"===t.kind&&"nodeId"in t&&t.nodeId===n?t:Gt(Et?.type)??F);const t=Et?.props.id,o=uo.current;if(uo.current=null,!t)return;const r=Rt(t);sr(String(t),{scroll:!i(o,r??null,zn)})},[Et?.props.id,sr]);const ar=En(e=>{nr(n=>D(n,e)?n:e),Lt({type:"setUi",ui:{rightSideBarVisible:!0}})},[Lt]),cr=jn(()=>{});cr.current=(e,n)=>{const t=e?Mi(e.zone??zn)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==Et?.props.id?null:String(Et.props.id);nr(e=>D(e,n)?e:n),o!==r&&(dr.current={id:o,mode:n},fo.select(e))};const pr=En((e,n)=>cr.current(e,n),[]),ur={kind:er.kind,mode:er,open:ar,show:e=>nr(e),reveal:()=>{yo||Lt({type:"setUi",ui:{rightSideBarVisible:!0}})},select:pr},hr=H(ur,{data:At.data,selected:Et??null,zoneOf:e=>Rt(e)?.zone,readOnly:Boolean(It),select:e=>{nr(F),fo.select({index:e})},replace:(e,n)=>fo.replaceComponent(zn,e,n),scrollTo:e=>l(e)},{device:xo,refreshes:To},{setView:Lo,reveal:()=>{go||Lt({type:"setUi",ui:{leftSideBarVisible:!0}})}}),fr=hr.resolveLeftView?hr.resolveLeftView(Ao):"sections",mr=V(),{isLockedBlock:gr,duplicateBlocked:yr,nestDepth:vr,newSectionNode:kr,canAddTo:br,blockIsOffered:Sr}=mr,wr=W(),{labelAtLevel:xr,Icon:zr,useProducts:Cr}=wr,Or=wr.rowName?(e,n,t)=>wr.rowName(e,n,t):void 0,Ir=En(e=>{Lt({type:"setUi",ui:{rightSideBarVisible:!0}}),l(e),sr(e,{scroll:!0})},[Lt,sr]),{selectNode:Nr,openPartId:Br}=y({mode:er,setMode:nr,onOpenPart:Ir}),[Pr,$r]=Ln(null);fe(null!==Pr,()=>$r(null));const Mr=f(U()),jr=Mr.collapsed,Ar=Mr.panelWidths,[Lr,Tr]=Ln(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(jr);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
|
|
13
|
-
return new Set}});Tn(()=>{try{window.localStorage.setItem(jr,JSON.stringify([...Lr]))}catch{}},[Lr]);const[Er,Rr]=Ln(()=>{if("undefined"==typeof window)return{...m};try{const e=window.localStorage.getItem(Ar);if(!e)return{...m};const n=JSON.parse(e);return{left:g(Number(n.left)||m.left,"left"),right:g(Number(n.right)||m.right,"right")}}catch{return{...m}}});Tn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(Ar,JSON.stringify(Er))}catch{}},300);return()=>clearTimeout(e)},[Er]);const Fr=En((e,n)=>Rr(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),Dr=En(e=>Fr("left",e),[Fr]),Hr=En(e=>Fr("right",e),[Fr]),Vr=e=>Lr.has(e),Wr=e=>Tr(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Ur=jn(!1),Jr=jn(null);Tn(()=>{if(Ur.current&&!Yo){const e=Jr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??Fo.current?.querySelector(`button[aria-label="${CSS.escape(_t.add.title)}"]`))?.focus(),Jr.current=null}Ur.current=Yo},[Yo]),Tn(()=>{if(!Yo||!Vo)return;const e=e=>{"Escape"===e.key&&cl()};return Vo.addEventListener("keydown",e),()=>Vo.removeEventListener("keydown",e)},[Yo,Vo]),fe(Yo,()=>cl()),Tn(()=>{!go&&Yo&&(Xo(!1),Qo(null),Ko.current=!1)},[go]);const Gr=J(),Yr=(e,n="success",t)=>{if(Gr)return void(t?Gr(e,"error"===n?"error":"info",t):Gr(e,"error"===n?"error":"info"));const o={sound:!1,action:t?.action,onClose:t?.onClose};"error"===n?Un.error(e,{...o,duration:t?.duration??3200}):Un.success(e,{...o,duration:t?.duration??1900})},Xr=jn(null),[Kr,Zr]=Ln(0),[Qr,_r]=Ln(0),qr=G(),ei=jn(null),ni=e=>Math.max(0,e.clientHeight-(ei.current?.offsetHeight??0));Tn(()=>{const e=Xr.current;if(!e)return;const n=()=>{Zr(e.clientWidth),_r(ni(e))};n();const t=new ResizeObserver(n);return t.observe(e),ei.current&&t.observe(ei.current),()=>t.disconnect()},[]),Rn(()=>{Xr.current&&(Zr(Xr.current.clientWidth),_r(ni(Xr.current)))},[Er,go,yo]);const ti=xo===So?Kr>0?Kr:ko[So]:ko[xo],oi=Kr>0?Math.min(Kr/ti,"shrink"===wo?1:2):1,ri=ti*oi,ii=Kr>0&&ri>Kr+1,li={width:ri,height:Qr||"100%",flex:"none",position:"relative"},si={width:ti,height:Qr?Qr/oi:"100%",maxHeight:"none",transform:1!==oi?`scale(${oi})`:void 0,transformOrigin:"top left"},di=()=>Lt({type:"setUi",ui:{leftSideBarVisible:!go}}),ai=()=>Lt({type:"setUi",ui:{rightSideBarVisible:!yo}}),ci=e=>{Yo&&(Xo(!1),Qo(null),Ko.current=!1,go&&Ao===e)||(Lo(e),go||Lt({type:"setUi",ui:{leftSideBarVisible:!0}}))},pi=()=>{nr(F),fo.select(null),d()},ui=()=>{nr(Yt??F),yo||Lt({type:"setUi",ui:{rightSideBarVisible:!0}})},hi=At.data.content??[],fi=()=>{const e=hi.findIndex(Xt),n=hi.findIndex(Kt);return{floor:e>=0?e+1:0,cap:n>=0?n:hi.length}},mi=Ft,gi=mr.stripCopy,yi=n=>e(n,gi),vi=te(),ki=Ae({data:At.data,config:mi,readOnly:Boolean(It),clipboard:vi,strip:gi?e=>gi(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==rn||e.slot!==ln)return{min:0,max:n-1};const{floor:t,cap:o}=fi();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&nr(F);const t=void 0===n||"node"===n?.kind?n:null;fo.commitDocument(e,t)}}),bi=ue(),[Si,wi]=Ln(null),xi=e=>{const n=hi.find(n=>String(n.props.id)===e),t=Dt.shared;n&&t&&ki.swap(e,t.detach(n))},zi=e=>{const n=an(At.data,Ft,e);if(!n)return!1;const t=sn(n.place),o=n.node,r=t===zn?Bi(o):Wi(o),i=t===zn?Dt.shared?.usedOn(o):null;return!!ki.remove(e)&&(Yr(i?_t.shared.removed({count:Math.max(0,i.length-1)}):_t.deleted({name:r}),"success",{duration:8e3,action:{label:_t.bar.undo,onClick:()=>{ki.restore(n.node,n.place)}}}),!0)},Ci={...ki,remove:zi},Oi=e=>xr(e,"block",Ft.components[e]?.label??e),Ii=En(e=>Ft.components[e]?.defaultProps??{},[Ft]),Ni=e=>xr(e,"section",Oi(e)),Bi=e=>bn({type:e.type,props:e.props??{}},Ni(e.type),Or),{nodeAddresses:Pi,zoneItems:$i}=An(()=>{const e=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map,t=(o,r,i)=>{n.set(r,o),o.forEach((n,o)=>{const l=String(n.props?.id??"");if(l&&e.set(l,{zone:r,index:o}),i>=On)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of In(Ft,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(hi,zn,0),{nodeAddresses:e,zoneItems:n}},[hi,Ft]),Mi=En(e=>$i.get(e)??[],[$i]),ji=e=>{const n=Pi.get(e);return n?Mi(n.zone)[n.index]:void 0},Ai=e=>ee(mr,Ft,e),Li=e=>{if(!mr.slotsOf||e===zn)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=ji(e.slice(0,n));if(!t)return null;const o=Ai(t).filter(e=>e.rung),r=o.findIndex(t=>t.slot===e.slice(n+1));return r<0?null:{node:t,slot:o[r],position:r}},Ti=(()=>{if(!Y(er))return null;const e=`${er.nodeId}:${er.slot}`;return Li(e)?.slot.panel===er.kind?e:null})(),Ei=jn(null);Tn(()=>{const e=Ei.current;if(Ei.current=null,!Ti||!Y(er))return;const n=er.nodeId;sr(n,{scroll:e!==Ti}),Tr(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[er]);const Ri=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=Pi.get(e);n&&(n.zone===zn?ol(n.index):Pl(n.zone,n.index,e,ji(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&Ti!==i&&(Ei.current=i),pr(null,r),yo||Lt({type:"setUi",ui:{rightSideBarVisible:!0}}),l(o)},Fi=(e,n,t)=>{const o=`${e}:${n}`;if(Tr(n=>{if(!n.has(o)&&!n.has(e))return n;const t=new Set(n);return t.delete(o),t.delete(e),t}),!t)return;Ti!==o&&(Ei.current=o);pr(null,{kind:t,nodeId:e,slot:n})},Di=(e,n,t)=>{if(It||!mr.moveSlot)return;const o=ji(e),r=o?Ai(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:vt,index:n},s=on(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=mr.moveSlot(e,n,s);"string"==typeof d&&Fi(e,d,i.panel)},Hi=Cr(),Vi=An(()=>{const e=/* @__PURE__ */new Map;for(const n of Hi??[])e.set(n.slug,n.name);return e},[Hi]),Wi=e=>Sn(e,Oi,wr.plainText,e=>Vi.get(e),wr.rowName),Ui=(e,n)=>{const t=Ft.components[e.type]?.fields,o=n===zn||ts(n)?"section":"block",r=n===zn&&(Xt(e)||Kt(e)||Ut(e.type)),i="block"===o?wn(t):r?null:xn(t);return wr.renamePropOf?wr.renamePropOf(e,o,i):i},Ji=(e,n,t,o)=>{if(!(!It&&Pr?.zone===e&&Pr.index===n))return;const r=(t,o)=>{$r(null),o&&((e,n,t)=>{const o=Mi(e)[n];if(!o)return;const r=Ui(o,e);r&&fo.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
|
|
14
|
-
return st("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":_t.rename,onClick:e=>e.stopPropagation(),onBlur:e=>r(e.currentTarget.value,!0),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),r(e.currentTarget.value,!0)):"Escape"===e.key&&(e.preventDefault(),r("",!1))}},t)},Gi=t(X(),ro),Yi=Gi.scope({target:kn,siteId:Xn,docId:Dn}),Xi=Ft,Ki=(e,n)=>n===zn?Ni(e):Oi(e),Zi=(e,n,t)=>{const o=Gi.plan(Yi,t,Ki(t.type,e),Xi);o&&(o.changed&&fo.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),Yr(o.message))},Qi=oe({nodesIn:Mi,nodeAt:(e,n)=>Mi(e)[n]??null,labelOf:(e,n)=>n===zn?Ni(e):Oi(e),renamePropOf:Ui,beginRename:(e,n)=>$r({zone:e,index:n}),history:{hasPast:Tt.hasPast,hasFuture:Tt.hasFuture,back:()=>Tt.back(),forward:()=>Tt.forward()},openPageSettings:()=>{fo.select(null),nr(F)},pageSettingsLabel:_t.pageSettings,words:{menu:oo,styleClipboard:ro,screen:_t.menu},readOnly:Boolean(It),collapseAll:()=>Tr(new Set(Mi(zn).map(e=>String(e.props.id)))),onPasteRefused:e=>Yr(e?_t.pasteRefused({name:e.label}):_t.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>is(e,n),menuRows:(e,n,t)=>{const o=hr.menuRows?.(e,n,t)??null,r=((e,n)=>{const t=Dt.shared;if(!t||n!==zn)return null;const o=t.usedOn(e);if(o){const n={pick:[{label:_t.shared.onPages({count:o.length}),onClick:()=>{},children:o.map(e=>({label:e.title,onClick:()=>t.openPage(e)}))}]};return It||gr(e.type,e)?n:{...n,change:[{label:_t.shared.detach,onClick:()=>xi(e.props.id)}],remove:[{label:_t.shared.removeFromPage,danger:!0,onClick:()=>{zi(e.props.id)}}]}}return It||Xt(e)||Kt(e)||Ut(e.type)?null:z(bi)?{change:[{label:_t.shared.makeShared,onClick:()=>wi({id:e.props.id,name:Bi(e)})}]}:null})(e,n);if(!r)return o;return Object.fromEntries(["pick","make","change","remove"].map(e=>[e,[...o?.[e]??[],...r[e]??[]]]).filter(([,e])=>e.length>0))},isLocked:e=>gr(e.type,e),duplicateBlocked:e=>yr(At.data,e),permits:e=>{const n=Cn(Ft,e.type);return Dt.shared?.usedOn(e)?{...n,delete:!1}:n},nodeOps:Ci,isPinned:(e,n)=>n===zn&&(Xt(e)||Kt(e)),sectionBand:fi,locate:e=>Pi.get(e)??null,rowNameOf:(e,n)=>n===zn?Bi(e):Wi(e),selectAt:(e,n,t,o)=>{e===zn?ol(n):Pl(e,n,t,o??"")},slotRung:e=>{const n=Li(e);return n?.slot.panel?{label:n.slot.label,select:()=>Ri(n.node,n.slot,!1)}:null},style:{held:()=>ve(Yi),canCopy:e=>Gi.rows(Xi,e).some(e=>!1!==e.counted),copy:(e,n)=>Gi.copy(Yi,e,Ki(e.type,n),Xi),paste:(e,n,t)=>Zi(e,n,t)},keys:Pt?{target:Vo,selected:()=>{const e=At.ui.itemSelector;return e?{zone:e.zone??zn,index:e.index}:null},held:()=>vi.get(),readOnly:Boolean(It),onDone:({done:e,name:n})=>{"copied"===e&&Yr(_t.copied({name:n}))}}:void 0},Do),_i=jn({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});Tn(()=>{_i.current={copy:(e,n)=>Gi.copy(Yi,e,Ki(e.type,n),Xi),paste:Zi,at:()=>{const e=At.ui.itemSelector;if(!e)return null;const n=e.zone??zn,t=Mi(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(It)}});const qi=En(e=>{const n=ke(e);if(!n)return;const t=_i.current,o=t.at();o&&(e.preventDefault(),"copy"===n?t.copy(o.node,o.zone):t.readOnly||t.paste(o.zone,o.index,o.node))},[]);Tn(()=>{if(!Vo)return;const e=e=>qi(e);return Vo.addEventListener("keydown",e),()=>Vo.removeEventListener("keydown",e)},[qi,Vo]),mn(Do,"keydown",qi);const el=hi.map(e=>e.props.id).join("|");Tn(()=>{const e=Do?.document??null,n=Do?.window??null;let t=0;const o=[],r=()=>{if(!e)return void qo(e=>e.length?[]:e);const n=hi.findIndex(Kt),t=n>=0?n:hi.length,o=n=>{const t=hi[n]?.props?.id;return null==t?null:Mn(e,`[data-puck-component="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(hn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=hi.length>0&&!Xt(hi[0])?0:1;e<=t;e++){const n=o(e),t=o(e-1),l=n?.getBoundingClientRect()??null,s=t?.getBoundingClientRect()??null;if(!l&&!s)continue;const d=yt(l&&s?(s.bottom+l.top)/2:l?0===e?l.top+12:l.top:s.bottom,Math.max(0===e?0:-1/0,...r(t).map(e=>e.bottom)),Math.min(1/0,...r(n).map(e=>e.top)));d&&i.push({...d,index:e})}qo(e=>function(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t].top!==n[t].top||e[t].index!==n[t].index||e[t].height!==n[t].height)return!1;return!0}(e,i)?e:i)},i=()=>{cancelAnimationFrame(t),t=requestAnimationFrame(r)};if(!e||!n)return void r();n.addEventListener("scroll",i,{passive:!0});const l=new ResizeObserver(i);return l.observe(e.documentElement),r(),o.push(setTimeout(r,150),setTimeout(r,450)),()=>{cancelAnimationFrame(t),o.forEach(clearTimeout),n.removeEventListener("scroll",i),l.disconnect()}},[Do,el,xo,oi,go,yo,Et?.props.id]);const nl=Do?.document??null,tl=Do?.window??null;Tn(()=>{const e=Ro.current;if(!e||!nl||!tl)return;const n=[],t=()=>{const n=Mn(nl,`[data-puck-component="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&tl.scrollTo({left:tl.scrollX,top:tl.scrollY+t,behavior:"instant"}),!0};return Ro.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[nl,tl]);const ol=e=>{nr(F),fo.select({index:e}),hr.sectionPressed?.(hi[e]);const n=hi[e]?.props?.id;n&&l(n)},rl=e=>{const{floor:n,cap:t}=fi(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=Et&&er.kind!==Yt?.kind?hi.findIndex(e=>e.props.id===Et.props.id):-1;return o(r>=0?r+1:t)},il=(e,n)=>{const{floor:t,cap:o}=fi(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(fo.reorderComponent(zn,e,i),fo.select({index:i}),{moved:!0,dest:i})},ll=(e,n,t,o)=>{nr(F),fo.select(o?{index:o.index,zone:o.zone}:{index:e}),l(n),Yr(_t.sectionAdded({name:t}))},sl=(e,n)=>{const t=rl(n),o=kr(e,{nodeDefaults:Ii,newNodeId:Bn,sectionLabel:Ni,blockIsOffered:Sr}),r=o?fo.insertNode(zn,t,o):fo.insertSection(e,t);return ll(t,r,Ni(e),o?((e,n,t)=>{if(e.type===t)return null;const o={at:null},r=(e,n,i)=>{const l=i.filter(n=>n===e.type).length;for(const{child:s,zone:d,index:a}of In(Ft,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=br(e.type,l,d.slice(d.lastIndexOf(":")+1)),i=r?.choices??(r?.spec?[{type:r.spec.childType,label:r.spec.childType}]:[]);null!==r&&"footer"!==r.source&&`${e.props.id}:${r.slot}`===d&&i.some(e=>e.type===t)&&(o.at={zone:d,index:a,depth:n})}r(s,n+1,[...i,e.type])}};return r({type:e.type,props:{...e.props,id:n}},1,[]),o.at?{zone:o.at.zone,index:o.at.index}:null})(o,r,e):null),t},dl=e=>al(zn,e),al=(e,n)=>{Jr.current=document.activeElement??null,Qo(null===n?null:{zone:e,index:n}),Xo(!0),go||(Ko.current=!0,Lt({type:"setUi",ui:{leftSideBarVisible:!0}}))},cl=()=>{Xo(!1),Qo(null),Ko.current&&Lt({type:"setUi",ui:{leftSideBarVisible:!1}}),Ko.current=!1},pl=(e,n)=>wr.rowName?n?Xt(e)?wr.rowName(e,"section",_t.header):Kt(e)?wr.rowName(e,"section",_t.footer):Ut(e.type)?wr.rowName(e,"section",Oi(e.type)):Bi(e):Wi(e):n?Ni(e.type):Oi(e.type),ul=e=>n=>{e()},hl=(e,n,t)=>{if(It)return null;const o=Mi(e)[n];return o&&!Cn(Ft,o.type).delete||o&&gr(o.type,o)?null:/* @__PURE__ */st(Be,{kind:"delete",label:e===zn&&o&&Dt.shared?.usedOn(o)?_t.shared.removeFromPage:_t.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=Mi(e)[n]?.props?.id;null!=t&&zi(String(t))})(e,n),children:/* @__PURE__ */st(tt,{size:15})})},fl=e=>wr.rowPreview?.(e)||void 0,ml=e=>wr.rowMarks?.(e)??void 0,gl=(e,n,t)=>wr.rowActions?.(e,n,t)??null,yl=(e,n,t,o)=>{if(It)return null;if(gr(t.type,t))return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
|
|
15
|
-
return st(Be,{kind:"eye",label:r?_t.showNamed({name:o}):_t.hideNamed({name:o}),onClick:()=>kl(e,n,t),children:/* @__PURE__ */st(r?ot:rt,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},vl=e=>Js(zn,e),kl=(e,n,t)=>{fo.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},bl=e=>Nn(Ft,e),Sl=e=>In(Ft,e),wl=e=>mr.slotsOf?Ai(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:Pn(e,n.slot)})):[{slot:null,rung:null,kids:Sl(e)}],xl=e=>mr.slotsOf?wl(e).flatMap(e=>e.kids):Sl(e),zl=e=>Boolean(mr.slotsOf)&&Ai(e).some(e=>e.rung),Cl=(e,n,t)=>null===t?void 0===n?br(e):br(e,n):br(e,n,t),Ol=(e,n,t)=>{const o=$n(Ft,e.type,n)&&(t||xl(e).length>0||zl(e));return{collapsible:o,folded:o&&Vr(String(e.props.id))}},Il=(e,n,t)=>wl(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>Ol(e,r,t(e.type)).collapsible?[String(e.props.id),...Il(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),Nl=e=>xl(e).length>0||zl(e)||Boolean(br(e.type)),Bl=e=>Boolean(br(e)),Pl=(e,n,t,o)=>{if(nr(F),br(o)?.spec?.slider){const t=e.split(":")[0];s(t,n),fo.select({index:n,zone:e}),l(t)}else fo.select({index:n,zone:e}),l(t)},$l=(e,n,t,o,r)=>{const i=`${e}:${n}`;fo.insertComponent(i,t,o),br(r)?.spec?.slider?requestAnimationFrame(()=>{s(e,o),fo.select({index:o,zone:i})}):fo.select({index:o,zone:i})},Ml=jn(/* @__PURE__ */new Set);Tn(()=>{hi.forEach(e=>{const n=br(e.type)?.spec;if(!n)return;const t=e.props.id;if(Ml.current.has(t))return;Ml.current.add(t);if((Array.isArray(e.props[n.slot])?e.props[n.slot]:[]).length>0)return;if(n.skipSeed?.(e.props))return;const o=`${t}:${n.slot}`,r=n.legacy?.(e.props)??[];(r.length?r:n.seeds(Ii)).forEach((e,t)=>po.seedChild(o,t,n.childType,e))})},[hi,po,Ii]);const jl=jn(/* @__PURE__ */new Set);Tn(()=>{hi.forEach((e,t)=>{const o=e.props.id;if(jl.current.has(o))return;const r=n(e,bl(e.type));jl.current.add(o),r&&po.replaceComponent(zn,t,{...e,props:r})})},[hi,po]),K(po,Ft);const Al=hi.findIndex(Kt),Ll=Al>=0?hi[Al]:null,Tl=Zt?hi.findIndex(Xt):-1,El=Tl>=0?hi[Tl]:null,Rl=Dt.groupTab,Fl=An(()=>Rl?e=>Ut(e.type):void 0,[Rl]),Dl=Boolean(Dt.groupBadge),Hl=Dt.sharedReach,Vl=e=>Hl?.(e)??void 0,Wl=An(()=>Hl?new Set(hi.filter(e=>Vl(e)).map(e=>String(e.props.id))):null,[hi,Hl]),Ul=An(()=>Wl?e=>Wl.has(e):void 0,[Wl]),Jl=Dt.first?Hl?.({type:Dt.first,props:{id:""}})??void 0:void 0,Gl=Dt.groupBadge?/* @__PURE__ */st("span",{className:"es-tree-group-badge",children:/* @__PURE__ */st(Hn,{tone:"info",size:"xs",children:Dt.groupBadge})}):void 0,Yl=hi.find(e=>e.type===Vt)??null,Xl=hi.find(e=>e.type===Wt)??null,Kl=Al>=0?Al:hi.length,Zl=[];hi.forEach(e=>{Kt(e)||(Nl(e)&&Zl.push(String(e.props.id)),Zl.push(...Il(e,1,Bl)))}),Ll&&(Zl.push(String(Ll.props.id)),Zl.push(...Il(Ll,1,Bl)));const Ql=Zl.length>0&&Zl.every(e=>Lr.has(e)),_l=e=>{const n=wr.blockRowName(e,Oi);return wr.rowName?wr.rowName(e,"block",n):n},ql=(e,n,t,o)=>{const r=Mi(e)[t];if(!r)return;const i={...dn(e),index:t},l={...dn(n),index:Math.min(Math.max(o,0),Mi(n).length)},s=on(i,l);if(e!==n||s!==t)try{ki.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof cn))throw e}},es=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of Sl(e))n.add(r),t(o)};for(const t of bl(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},ns=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Pi.get(n);if(!e)return null;if(e.zone===zn)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},ts=e=>{const n=e.slice(0,e.indexOf(":")),t=hi.find(e=>Ut(e.type)&&String(e.props.id)===n);return t&&Jt(n)===e?t:null},os=(e,n)=>{const t=ts(e);return!t||(!Dt.groupAccepts||Dt.groupAccepts(t.type,n,Mi(e).length))},rs=(e,n,t)=>{if(e.rung){const t=ji(e.rung.nodeId),o=t?Ai(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===vt&&n.index>=0&&n.index<=o}if(n.slot===vt)return!1;if(e.add)return ds(e.add,n);const o=sn(n);if(Ut(e.type))return!1;const r=ts(o),i=ts(e.zone);if(r||i)return!(!r||!i)&&(!(r!==i&&!os(o,e.type))&&(n.index>=0&&n.index<=Mi(o).length));if(e.zone===zn||o===zn){if(e.zone!==o)return!1;const{floor:t,cap:r}=fi();return n.index>=t&&n.index<=r}if(n.index<0||n.index>Mi(o).length)return!1;if(e.zone===o)return!0;const l=Ll&&!Dt.lastIsOpen?String(Ll.props.id):null;return(!l||ns(e.zone)!==l&&ns(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??Mi(e)[t];if(!r)return!1;const i=n.split(":")[0],l=Pi.get(i),s=l?Mi(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&es(r).has(n))return!1;const d=br(s.type,vr(At?.data,s.type,i),n.slice(n.lastIndexOf(":")+1));return!!d&&(!!(d.choices?d.choices.some(e=>e.type===r.type):d.spec?.childType===r.type)&&!d.spec?.addBlocked?.(Mi(n),r))})(e.zone,o,e.index,t)},is=(e,n)=>{const t=sn(e.from),o=e.node;return t===sn(n)?os(t,o.type):rs({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},ls=e=>{const n=e.slice(0,e.indexOf(":")),t=Pi.get(n),o=t?Mi(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=br(o.type,vr(At?.data,o.type,n),e.slice(e.lastIndexOf(":")+1));if(!r||`${n}:${r.slot}`!==e)return null;if("footer"===r.source)return null;const i=B(r.choices??(r.spec?[{type:r.spec.childType,label:Oi(r.spec.childType)}]:[])),l=Li(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:pl(o,t.zone===zn)}},ss=(e,n)=>{if("section"!==e.kind)return e;const t=sn(n);return t===zn||ts(t)?e:ls(t)?.choices.some(n=>n.type===e.type)?{kind:"block",type:e.type}:e},ds=(e,n)=>{const t=ss(e,n),o=sn(n);if("shared"===t.kind){if(o!==zn||!Dt.shared?.nodeOf(t.section))return!1;const{floor:e,cap:r}=fi();return n.index>=e&&n.index<=r}if("block"!==t.kind){if(ts(o)){const e="section"===t.kind?t.type:t.template.node.type;return os(o,e)&&n.index>=0&&n.index<=Mi(o).length}if(o!==zn)return!1;const{floor:e,cap:r}=fi();return n.index>=e&&n.index<=r}if(o===zn)return!1;const r=ls(o);return!(!r||!r.choices.some(e=>e.type===t.type))&&!r.target.spec?.addBlocked?.(Mi(o))},as=(e,n)=>{const t=ss(e,n);if("block"!==t.kind&&ts(sn(n)))return void((e,n,t)=>{const o="section"===e.kind?e.type:"template"===e.kind?e.template.node.type:null;if(o&&os(n,o)){if("section"===e.kind)fo.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;fo.insertNode(n,t,yi(e.template.node))}nr(F),fo.select({index:t,zone:n})}})(t,sn(n),n.index);if("section"===t.kind)return void sl(t.type,n.index);if("template"===t.kind)return void((e,n,t)=>{const o=rl(t),r=fo.insertNode(zn,o,n);ll(o,r,e)})(t.template.name,yi(t.template.node),n.index);if("shared"===t.kind){const e=Dt.shared?.nodeOf(t.section);if(!e)return;const o=rl(n.index);return void(ki.restore(e,{parentId:rn,slot:ln,index:o})&&ll(o,e.props.id,t.section.title))}const o=sn(n),r=ls(o);r&&(r.target.spec?$l(r.parentId,r.target.slot,t.type,n.index,r.parent.type):((e,n,t)=>{fo.insertComponent(e,n,t),nr(F),fo.select({index:t,zone:e})})(o,t.type,n.index))},cs=(e,n)=>{e.media?function(e){const n=Ds();if(!n||!Es)return;Vs(n).then(n=>{n&&function(e,n){if(!Es)return;const t=Es.create(e,{nodeDefaults:Ii,newNodeId:Bn,sectionLabel:Ni,blockIsOffered:Sr}),o=sn(n);if(o===zn){const e=rl(n.index),o=fo.insertNode(zn,e,t);return void ll(e,o,Ni(t.type))}fo.insertNode(o,n.index,t),nr(F),fo.select({index:n.index,zone:o})}(n,e)})}(n):e.rung?Di(e.rung.nodeId,e.index,n.index):e.add?as(e.add,n):e.zone===zn?il(e.index,n.index):ql(e.zone,sn(n),e.index,n.index)},[ps]=Ln(()=>nn()),us=tn({keyOf:e=>e.id,readOnly:Boolean(It),session:ps,canDrop:rs,onDrop:cs,onStep:(e,n)=>{e.rung?Di(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===zn?((e,n)=>{const t=Ni(hi[e]?.type??""),o=il(e,n<0?e-1:e+2);if(!o.moved)return void Yr(n<0?_t.sectionFirst({name:t}):_t.sectionLast({name:t}));const{floor:r,cap:i}=fi();Yr(_t.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):ql(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),hs=En(e=>{const{floor:n,cap:t}=fi(),o=[];for(const r of e.nodes){const e=sn(r.place),i=Mi(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(Xt(i)||Kt(i)||gr(i.type,i))continue;if(Ut(i.type))continue;const l=Boolean(ts(e)),s=e===zn||l;e===zn&&t-n<2||o.push({key:r.id,item:{id:r.id,zone:e,index:r.place.index,type:i.type},box:r.box,label:s?Ni(i.type):Wi(i),from:r.place})}const r=e.zones.flatMap(e=>{const n=sn(e.list);if(n===zn&&0===e.children.length)return[{...e,addLabel:_t.addSection,addAlways:!0}];const t=ls(n),o=t?.target.spec?.addLabel;return e.children.length>0||Boolean(t?.choices.length)||Boolean(ts(n))?[o?{...e,addLabel:o}:e]:[]}),i=r.flatMap(e=>{const n=sn(e.list),t=n===zn||ts(n)?null:ls(n);return t?.choices.length?Qe(e,t.target.spec?.addLabel??_t.addBlockHere):[]});return{sources:o,zones:r,seams:i}},[At.data]),fs=null==Et?.props.id?null:String(Et.props.id),ms=En(e=>{const n=Ft,t=e=>!e.item.rung&&null!==an(At.data,n,e.item.id),o=e[e.length-1];if(!t(o))return o;const r=n=>e.find(e=>t(e)&&e.item.id===n),i=r(fs);return i||(r(Le(At.data,n,o.item.id,fs,Fl))??o)},[At.data,Ft,fs,Fl]),[gs,ys]=Ln(null),vs=Boolean(Rl||Hl);mn(Do,"mouseover",e=>{if(!vs)return;const n=gn(e.target),t=n?ht(At.data,Ft,n):null;t!==gs&&ys(t)}),mn(Do,"mouseout",e=>{vs&&!e.relatedTarget&&ys(null)});const ks=e=>Xt(e)||Kt(e)||Ut(e.type),bs=e=>{const n=Ut(e.type)?Oi(e.type):Xt(e)?_t.header:Kt(e)?_t.footer:null;return null===n?Bi(e):wr.rowName?wr.rowName(e,"section",n):n},Ss=[];if(vs){const e=fs?ht(At.data,Ft,fs):null;for(const n of/* @__PURE__ */new Set([e,gs])){const e=n?hi.find(e=>String(e.props.id)===n):void 0;if(!e)continue;const t=Xt(e)||e.type===Vt,o=Vl(e);if(o){Ss.push({id:String(e.props.id),label:bs(e),below:t,reach:o});continue}if(!Rl||!ks(e))continue;const r=Rl(e);r&&Ss.push({id:String(e.props.id),label:r,below:t})}}const ws=ue(),xs=jn(null);Tn(()=>{const e=Dt.changeNotice;if(!e)return;const n=JSON.stringify(hi.filter(ks)),t=xs.current;if(xs.current={doc:Dn,bands:n,index:Tt.index},!t||t.doc!==Dn||t.bands===n)return;Tt.hasPast&&Tt.index>=t.index&&!ut.has(ws)&&(ut.add(ws),Yr(e,"success",{action:{label:_t.bar.undo,onClick:()=>Tt.back()},duration:8e3}))},[hi]);const zs=e=>{nr(F),fo.select(e.zone===zn?{index:e.index}:{index:e.index,zone:e.zone})},Cs=Z(),Os=()=>({data:At.data,device:xo,ops:fo,inspector:ur}),Is=Cs?.model,Ns=An(()=>Is?e=>Is(e,hs(e),Os()):hs,[Is,hs,xo]),Bs=Cs?.measure,Ps=Bs?(e,n)=>Bs(e,n,Os()):void 0,$s=Cs?.canDrop,Ms=$s?(e,n)=>$s(e,n,rs,Os()):rs,js=Cs?.drop,As=js?(e,n)=>js(e,n,cs,Os()):cs,Ls=Cs?.pick,Ts=Ls?e=>Ls(e,zs,Os()):zs,Es=Cs?.media??null,Rs=jn(null),Fs=An(()=>Es?{id:ct,zone:"",index:-1,type:Es.adds.type,add:{kind:Es.adds.kind,type:Es.adds.type},media:!0}:null,[Es]);Tn(()=>{if(!Fs||It||"undefined"==typeof document)return;const e=e=>{(e=>Array.from(e.dataTransfer?.types??[]).includes(Qn))(e)&&(Rs.current=null,ps.start({key:ct,item:Fs}))},n=e=>{ps.get()?.item.media&&(Rs.current=Jn(e.dataTransfer))},t=()=>{ps.get()?.item.media&&ps.end()};return document.addEventListener("dragstart",e),document.addEventListener("drop",n,!0),document.addEventListener("dragend",t,!0),()=>{document.removeEventListener("dragstart",e),document.removeEventListener("drop",n,!0),document.removeEventListener("dragend",t,!0)}},[Fs,It,ps]);const Ds=()=>{const e=Rs.current;return Rs.current=null,e},Hs=pe(),Vs=async e=>{if(!Hs)return e;const n=await Hs(e);return n?{...e,id:n.id,url:n.url}:null};const Ws=(e,n)=>{if(!Es)return;const t=an(ho.getState().appState.data,mi,n);if(!t)return;const o=t.node;fo.replaceComponent(sn(t.place),t.place.index,{...o,props:{...Es.replace(o,e),id:o.props.id}})},Us=e=>{const n=sn(e),t=Li(n);t&&Ri(t.node,t.slot,!1),al(n,e.index)},Js=(e,n)=>/* @__PURE__ */st(Pe,{...It?{}:us.seam({place:{...dn(e),index:n}})},`seam:${e}:${n}`),Gs={rowClick:ul,isCollapsed:Vr,toggleCollapse:Wr},Ys=e=>{const n=String(e.props.id),t=hi.findIndex(e=>String(e.props.id)===n),o=Jt(n),r=Mi(o),i=Vr(n),l=Oi(e.type),s=wr.rowName?wr.rowName(e,"section",l):l,d=e=>Js(o,e);/* @__PURE__ */
|
|
16
|
-
return dt(at,{children:[
|
|
17
|
-
/* @__PURE__ */st(Ce,{words:qt,icon:/* @__PURE__ */st(zr,{type:e.type,size:13}),name:s,preview:fl(e),marks:ml(e),onSelect:()=>ol(t),nameSlot:Ji(zn,t,n,s),selected:or===n,badge:Vl(e)?void 0:Gl,shared:Vl(e),actions:gl(e,zn,t)??void 0,rowProps:{"data-node-id":n,onClick:ul(()=>ol(t))},fold:{open:!i,label:"section",onToggle:()=>Wr(n)}}),!i&&/* @__PURE__ */dt(Oe,{children:[r.map((n,t)=>{const r=String(n.props.id),i=Bi(n),l=Nl(n),s=l&&Vr(r),a=()=>Pl(o,t,r,e.type),{rowProps:c,...p}=us.row({item:{id:r,zone:o,index:t,type:n.type},place:{...dn(o),index:t}},{"data-node-id":r,onClick:ul(a)});/* @__PURE__ */
|
|
18
|
-
return dt(Fn,{children:[d(t),
|
|
19
|
-
/* @__PURE__ */st(Ce,{words:qt,icon:/* @__PURE__ */st(zr,{type:n.type,size:13}),name:i,preview:fl(n),marks:ml(n),onSelect:a,nameSlot:Ji(o,t,r,i),selected:or===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Wr(r)}:void 0,actions:/* @__PURE__ */dt(at,{children:[hl(o,t,i),gl(n,o,t),yl(o,t,n,i)]}),rowProps:c}),l&&!s&&/* @__PURE__ */st(Oe,{children:Zs(n,2)})]},r)}),d(r.length)]})]})},Xs=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=us.dragging,d=!Vr(l)&&s?.rung?.nodeId!==i,a={...dn(l),index:0},c=s&&!s.rung&&rs(s,a)?a:void 0,p=()=>Ri(e,n,!0),{rowProps:u,...h}=us.row({item:{id:`rung:${l}`,zone:`${i}:${vt}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:vt,index:t},into:c,canDrag:Boolean(mr.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:ul(p)}),f=It?null:mr.slotActions?.(e,n.slot);/* @__PURE__ */
|
|
20
|
-
return dt(Fn,{children:[n.heading,
|
|
21
|
-
/* @__PURE__ */st(Ce,{words:qt,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:Ti===l,...h,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>Wr(l)},actions:f&&f.length>0?/* @__PURE__ */st(at,{children:f.map((t,o)=>/* @__PURE__ */st(Be,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(It||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&Fi(o,e,n.panel)},i=t.run();i&&"function"==typeof i.then?i.then(r):r(i)})(e,n,t),children:"delete"===t.kind?/* @__PURE__ */st(tt,{size:15}):/* @__PURE__ */st(lt,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */st(Oe,{children:r})]},l)},Ks=(e,n)=>{const t=wl(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
|
|
22
|
-
return st(at,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=Cl(e.type,void 0,t.slot),d=s?`${e.props.id}:${s.slot}`:null,a=null===t.slot?null:`${e.props.id}:${t.slot}`,c=(e,n)=>Js(e,n),p=/* @__PURE__ */dt(at,{children:[i.map(({child:n,zone:t,index:o})=>{const r=or===String(n.props.id),{collapsible:i,folded:s}=Ol(n,l,Bl(n.type)),d=String(n.props.id),a=_l(n),p=()=>Pl(t,o,d,e.type),{rowProps:u,...h}=us.row({item:{id:d,zone:t,index:o,type:n.type},place:{...dn(t),index:o}},{"data-node-id":d,onClick:ul(p)});/* @__PURE__ */
|
|
23
|
-
return dt(Fn,{children:[0===o&&c(t,0),
|
|
24
|
-
/* @__PURE__ */st(Ce,{words:qt,icon:/* @__PURE__ */st(zr,{type:n.type,size:13}),name:a,preview:fl(n),marks:ml(n),onSelect:p,nameSlot:Ji(t,o,d,a),selected:r,hidden:Boolean(n.props._hidden),...h,fold:i?{open:!s,label:"group",onToggle:()=>Wr(d)}:void 0,actions:/* @__PURE__ */dt(at,{children:[hl(t,o,a),gl(n,t,o),yl(t,o,n,a)]}),rowProps:u}),i&&!s&&/* @__PURE__ */st(Oe,{children:Ks(n,l+1)}),c(t,o+1)]},String(n.props.id??`${t}-${o}`))}),null===a?d&&!i.some(e=>e.zone===d)?c(d,0):null:0!==i.length||!t.rung&&d!==a?null:c(a,0)]});return t.rung?Xs(e,t.rung,r++,o,p):/* @__PURE__ */st(Fn,{children:p},t.slot??"")})})},Zs=(e,n)=>{const t=vr(At?.data,e.type,String(e.props.id)),o=wl(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
|
|
25
|
-
return st(at,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=Cl(e.type,t,o.slot),a=d?.spec??null,c=a&&Array.isArray(e.props[a.slot])?e.props[a.slot]:[],p=d&&d.choices?{slot:d.slot,choices:d.choices}:null,u=String(e.props.id),h=a&&!a.fixed?`${u}:${a.slot}`:null,f=p?`${u}:${p.slot}`:null,m=(e,n)=>Js(e,n),g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(a&&!a.fixed&&(null===g||g===h)),v=/* @__PURE__ */dt(at,{children:[l.map(({child:n,zone:t,index:o})=>{const r=or===String(n.props.id),i=Wi(n),l=String(n.props.id),{collapsible:d,folded:a}=Ol(n,s,Bl(n.type)),c=bl(n.type),p=1===c.length?`${l}:${c[0]}`:null,u=p?{...dn(p),index:Mi(p).length}:void 0,h=us.dragging,f=u&&h&&rs(h,u)?u:void 0,g=()=>Pl(t,o,l,e.type),{rowProps:y,...v}=us.row({item:{id:l,zone:t,index:o,type:n.type},place:{...dn(t),index:o},into:f,canDrag:!gr(n.type,n)},{"data-node-id":l,onClick:ul(g)});/* @__PURE__ */
|
|
26
|
-
return dt(Fn,{children:[0===o&&m(t,0),
|
|
27
|
-
/* @__PURE__ */st(Ce,{words:qt,icon:/* @__PURE__ */st(zr,{type:n.type,size:13}),name:i,preview:fl(n),marks:ml(n),onSelect:g,nameSlot:Ji(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...v,fold:d?{open:!a,label:"group",onToggle:()=>Wr(l)}:void 0,actions:gr(n.type,n)?gl(n,t,o)??void 0:/* @__PURE__ */dt(at,{children:[hl(t,o,i),gl(n,t,o),yl(t,o,n,i)]}),rowProps:y}),d&&!a&&/* @__PURE__ */st(Oe,{children:Zs(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&a&&
|
|
28
|
-
/* @__PURE__ */st(w,{small:!0,label:a.addLabel,blocked:a.addBlocked?.(c)??null,onAdd:()=>$l(e.props.id,a.slot,a.childType,c.length,e.type)}),null===g?f&&!l.some(e=>e.zone===f)?m(f,0):null:0!==l.length||(o.rung?y:g!==f)?null:m(g,0)]});return o.rung?Xs(e,o.rung,i++,r,v):/* @__PURE__ */st(Fn,{children:v},o.slot??"")})})},Qs=Yo,_s=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:go&&!Qs&&fr===e.id,onSelect:()=>ci(e.id)}:e,qs=[...(hr.railLead??[]).map(_s),{id:"sections",label:_t.layers,icon:/* @__PURE__ */st(me,{}),active:go&&!Qs&&"sections"===fr,onSelect:()=>ci("sections")},...(hr.railTrail??[]).map(_s)],ed=Oo?{pressed:Bo,onPress:Po}:$t?{pressed:!1,onPress:()=>{le(un,{accept:"image/*",title:io.mediaLibrary})}}:null,nd={value:qs.find(e=>!0===e.active)?.id??"",press:e=>{const n=qs.find(n=>n.id===e);n&&!n.disabled&&!0!==n.active&&n.onSelect?.()},items:qs.map(e=>({id:e.id,icon:e.icon,label:/* @__PURE__ */st("span",{className:"sr-only",children:e.label}),tooltip:e.label,disabled:e.disabled}))},td=[...hr.railLead??[],...hr.railTrail??[]].find(e=>"panel"in e&&e.id===fr),od=Boolean(Qt?.foldable),rd=Qt?.label??(Mt?_t.pageSections:_t.templateSections),id=od&&Vr(kt),ld=/* @__PURE__ */dt(at,{children:[hi.map((e,n)=>{if(Xt(e)||Kt(e)||Ut(e.type))return null;const t=or===String(e.props.id),o=Boolean(e.props._hidden);Sl(e);const r=String(e.props.id),i=hr.hasOwnRows?.(e)??!1,l=Nl(e)||i,s=l&&Vr(r),d=bl(e.type),a=1===d.length?`${r}:${d[0]}`:null,c=a?{...dn(a),index:Mi(a).length}:void 0,p=us.dragging,u=c&&p&&rs(p,c)?c:void 0,{rowProps:h,...f}=us.row({item:{id:r,zone:zn,index:n,type:e.type},place:{...dn(zn),index:n},into:u,canDrag:!gr(e.type,e)},{"data-node-id":r,onClick:ul(()=>ol(n))});/* @__PURE__ */
|
|
29
|
-
return dt(Fn,{children:[n>0&&vl(n),
|
|
30
|
-
/* @__PURE__ */st(Ce,{words:qt,icon:/* @__PURE__ */st(zr,{type:e.type,size:13}),name:Bi(e),preview:fl(e),marks:ml(e),shared:Vl(e),onSelect:()=>ol(n),nameSlot:Ji(zn,n,r,Bi(e)),selected:t,hidden:o,...f,fold:l?{open:!s,label:"section",onToggle:()=>Wr(r)}:void 0,actions:/* @__PURE__ */dt(at,{children:[hl(zn,n,Bi(e)),gl(e,zn,n),yl(zn,n,e,Bi(e))]}),rowProps:h}),Nl(e)&&!s&&/* @__PURE__ */dt(Oe,{children:[Zs(e,1),hr.partRows?.(e,Gs)]}),i&&!s&&/* @__PURE__ */st(Oe,{children:hr.ownRows?.(e,n,Gs)})]},String(e.props.id??n))}),Kl>0&&vl(Kl)]}),sd=(e,n,t)=>{const o=String(e.props.id),r=xl(e).length>0||zl(e)||Boolean(br(e.type)),i=r&&Vr(o),l="header"===t?_t.header:_t.footer,s=wr.rowName?wr.rowName(e,"section",l):l;/* @__PURE__ */
|
|
31
|
-
return dt(at,{children:[
|
|
32
|
-
/* @__PURE__ */st(Ce,{words:qt,icon:/* @__PURE__ */st(zr,{type:t,size:13}),name:s,preview:fl(e),marks:ml(e),badge:Vl(e)?void 0:Gl,shared:Vl(e),onSelect:()=>ol(n),nameSlot:Ji(zn,n,o,s),selected:or===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Wr(o)}:void 0,actions:gl(e,zn,n)??void 0,rowProps:{"data-node-id":o,onClick:ul(()=>ol(n))}}),r&&!i&&/* @__PURE__ */st(Oe,{children:Ks(e,1)})]})};return(hr.wrap??(e=>e))(
|
|
33
|
-
/* @__PURE__ */st(Q,{target:Do,children:/* @__PURE__ */dt("div",{ref:Fo,className:"sf-editor es-editor",style:Ue(Er),onContextMenu:Qi.onEditorContextMenu,...u(un),children:[
|
|
34
|
-
/* @__PURE__ */dt(Te,{children:[
|
|
35
|
-
/* @__PURE__ */dt("div",{className:"es-cluster es-cluster--left",children:[ed?/* @__PURE__ */st(Vn,{variant:ed.pressed?"primary":"secondary",className:"es-barbtn","aria-pressed":ed.pressed,leftIcon:/* @__PURE__ */st(ge,{}),onClick:ed.onPress,children:_t.railMedia}):null,
|
|
36
|
-
/* @__PURE__ */st(Ee,{label:_t.bar.undo,disabled:Boolean(It)||!Tt.hasPast,onClick:()=>Tt.back(),children:/* @__PURE__ */st(_n,{})}),
|
|
37
|
-
/* @__PURE__ */st(Ee,{label:_t.bar.redo,disabled:Boolean(It)||!Tt.hasFuture,onClick:()=>Tt.forward(),children:/* @__PURE__ */st(qn,{})})]}),
|
|
38
|
-
/* @__PURE__ */dt(Re,{children:[
|
|
39
|
-
/* @__PURE__ */st(Fe,{devices:vo,value:xo,onChange:zo}),
|
|
40
|
-
/* @__PURE__ */st(Ee,{label:_t.bar.refresh,tip:_t.bar.refreshTip,onClick:()=>{Ro.current=(()=>{const e=Do?.document;if(!e)return null;const n=hi.findIndex(Kt),t=n>=0?n:hi.length;let o=null;for(let n=0;n<t;n++){const t=hi[n]?.props?.id;if(null==t)continue;const r=Mn(e,`[data-puck-component="${CSS.escape(String(t))}"]`);if(!r)continue;const i=r.getBoundingClientRect().top;i<=4&&(null===o||i>o.offset)&&(o={id:String(t),offset:i})}if(!o){const e=Et?.props?.id??hi[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),Eo(e=>e+1)},children:/* @__PURE__ */st(et,{})}),hr.barView?.()]}),
|
|
41
|
-
/* @__PURE__ */dt(Re,{kind:"right",style:{minWidth:300},children:[
|
|
42
|
-
/* @__PURE__ */st(k,{input:Jo,words:_t.saveStatus}),yn?/* @__PURE__ */st(yn,{}):null,hr.barLead?.(),hr.barTrail?.(),hr.mainAction||!hr.barMain?/* @__PURE__ */st(b,{input:Jo,action:hr.mainAction??{label:_t.done,onPress:()=>{Kn(At.data)}},readOnly:Boolean(It),saveSwitch:Bt,onToggleAutoSave:xt,onSaveNow:Go,bar:_t.bar,words:_t.saveStatus}):hr.barMain()]})]}),
|
|
43
|
-
/* @__PURE__ */st(re,{}),
|
|
44
|
-
/* @__PURE__ */dt("div",{className:"sf-body",children:[go?/* @__PURE__ */dt(at,{children:[
|
|
45
|
-
/* @__PURE__ */dt("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":_t.leftPanel,children:[
|
|
46
|
-
/* @__PURE__ */dt("div",{className:"es-paneltabs es-paneltabs--with-hide",children:[
|
|
47
|
-
/* @__PURE__ */st(O,{side:"left",onHide:di}),
|
|
48
|
-
/* @__PURE__ */st("span",{className:"es-paneltabs-divider","aria-hidden":"true"}),
|
|
49
|
-
/* @__PURE__ */st(Wn,{variant:"underline",block:!0,"aria-label":_t.bar.views,value:nd.value,onChange:nd.press,items:nd.items})]}),Yo?/* @__PURE__ */st(x,{at:Zo?{label:(e=>{const n=ts(e.zone);if(n)return _t.add.addingTo({name:wr.rowName?pl(n,!0):Oi(n.type)});if(e.zone===zn){const n=hi[e.index];return n&&!Kt(n)?_t.add.addingBefore({name:pl(n,!0)}):_t.add.addingAtEnd}const t=ls(e.zone);return t?_t.add.addingTo({name:t.parentName}):_t.add.addingHere})(Zo),onClear:()=>Qo(null)}:void 0,placeBlocks:Zo&&Zo.zone!==zn?ls(Zo.zone)?.choices:void 0,canTake:Zo?e=>{if(!Zo)return null;const n={...dn(Zo.zone),index:Zo.index};if(ds(e,n))return null;if("shared"===e.kind&&Zo.zone===zn&&!Dt.shared?.nodeOf(e.section))return _t.shared.alreadyHere;const t=ts(Zo.zone);if(t)return _t.add.notInside({name:pl(t,!0)});if(Zo.zone===zn)return _t.add.onlySections;const o=ls(Zo.zone);return o?_t.add.notInside({name:o.parentName}):_t.add.onlySections}:void 0,onPick:Zo?e=>{if(!Zo)return;const n={...dn(Zo.zone),index:Zo.index};ds(e,n)&&(as(e,n),cl())}:void 0,itemFor:e=>({id:`new:${e.kind}:${"template"===e.kind?e.template.id:"shared"===e.kind?e.section.id:e.type}`,zone:"",index:-1,type:"template"===e.kind?e.template.node.type:"shared"===e.kind?e.section.node.type:e.type,add:e}),session:ps,siteWide:hr.addPanelRow?.(cl),onClose:cl,readOnly:Boolean(It)}):td?td.panel({onHide:di,notify:Yr}):/* @__PURE__ */dt(at,{children:[
|
|
50
|
-
/* @__PURE__ */st(I,{icon:/* @__PURE__ */st(me,{}),title:_t.layers,context:lo,actions:/* @__PURE__ */dt(at,{children:[!It&&/* @__PURE__ */st(De,{label:_t.add.title,onClick:()=>dl(null),children:/* @__PURE__ */st(nt,{size:15})}),
|
|
51
|
-
/* @__PURE__ */st(De,{label:Ql?_t.expandAll:_t.collapseAll,title:0===Zl.length?_t.nothingToFold:void 0,disabled:0===Zl.length,onClick:()=>Tr(e=>{const n=new Set(Zl);return Ql?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...Zl])}),children:/* @__PURE__ */st(mt,{expand:Ql})})]})}),
|
|
52
|
-
/* @__PURE__ */dt(Ie,{className:"sf-tree sf-scroll",words:qt,children:[
|
|
53
|
-
/* @__PURE__ */st(Ce,{words:qt,icon:/* @__PURE__ */st(zr,{type:"page",size:13}),name:_t.pageSettings,onSelect:pi,selected:!Et&&tr,rowProps:{onClick:ul(pi)}}),Yl&&/* @__PURE__ */dt(at,{children:[!Dl&&/* @__PURE__ */st(Ne,{children:_t.header}),Ys(Yl)]}),jt&&!(Dl&&Yl)&&/* @__PURE__ */dt(at,{children:[!Dl&&/* @__PURE__ */st(Ne,{children:_t.header}),!Zt&&/* @__PURE__ */st(Ce,{words:qt,icon:/* @__PURE__ */st(zr,{type:"header",size:13}),name:_t.header,badge:Jl?void 0:Gl,shared:Jl,onSelect:ui,selected:er.kind===Yt?.kind,rowProps:{onClick:ul(ui)}})]}),El&&!(Dl&&Yl)&&sd(El,Tl,"header"),!od&&/* @__PURE__ */st(Ne,{children:rd}),od?/* @__PURE__ */dt(at,{children:[
|
|
54
|
-
/* @__PURE__ */st(Ce,{words:qt,icon:null,name:rd,fold:{open:!id,label:rd,onToggle:()=>Wr(kt)}}),!id&&/* @__PURE__ */st(Oe,{children:ld})]}):ld,jt&&!Dl&&/* @__PURE__ */st(Ne,{children:_t.footer}),Ll&&!(Dl&&Xl)&&sd(Ll,Al,"footer"),Xl&&Ys(Xl),hr.treeFoot?.()]})]})]}),
|
|
55
|
-
/* @__PURE__ */st(He,{side:"left",width:Er.left,min:We.left,max:Ve,defaultWidth:m.left,label:_t.resizeLeftPanel,onResize:Dr})]}):/* @__PURE__ */st(N,{side:"left",onShow:di}),
|
|
56
|
-
/* @__PURE__ */dt("div",{ref:Xr,className:"sf-center sf-scroll","data-sf-canvas-head":qr?"":void 0,style:{overflowX:ii?"auto":"hidden",overflowY:"hidden"},children:[qr&&/* @__PURE__ */st("div",{ref:ei,className:"sf-canvas-head",children:/* @__PURE__ */st(qr,{device:xo})}),
|
|
57
|
-
/* @__PURE__ */dt("div",{className:"sf-frame-scaler",style:li,children:[
|
|
58
|
-
/* @__PURE__ */st("div",{className:"sf-frame "+(xo===So?"":`sf-frame--${xo}`),style:si,children:/* @__PURE__ */dt("div",{className:"sf-preview-host",children:[
|
|
59
|
-
/* @__PURE__ */st(xe.Provider,{value:Fl,children:/* @__PURE__ */st(ze.Provider,{value:Ul,children:/* @__PURE__ */st(so,{},To)})}),
|
|
60
|
-
/* @__PURE__ */st(_e,{canvas:Do,session:ps,model:Ns,measure:Ps,canDrop:Ms,onDrop:As,choose:ms,onPick:Ts,dropOn:Es?{accepts:(e,n)=>{if(!e.media||!Es||n.item.rung)return!1;const t=an(At.data,mi,n.item.id);return null!==t&&Es.takes(t.node)},onDrop:(e,n)=>(e=>{const n=Ds();n&&Es&&Vs(n).then(n=>{n&&Ws(n,e.item.id)})})(n),label:()=>_t.canvasReplaceImage}:void 0,onZoneAdd:Us,onSeamAdd:Us,zoneAddLabel:_t.canvasAddBlock,words:eo.canvas,readOnly:Boolean(It),revision:At.data}),_o.length>0&&!Ho&&/* @__PURE__ */st("div",{className:"sf-preview-gaps",children:_o.map(e=>
|
|
61
|
-
/* @__PURE__ */st(qe,{index:e.index,label:_t.addSectionHere,onInsert:()=>dl(e.index),className:void 0===e.height?"sf-preview-gap":"sf-preview-gap sf-preview-gap--tight",style:void 0===e.height?{top:e.top}:{top:e.top,height:e.height}},e.index))})]})}),vs?/* @__PURE__ */st(ft,{canvas:Do,tabs:Ss,onSelect:e=>{const n=hi.findIndex(n=>String(n.props.id)===e);n>=0&&ol(n)}}):null]})]}),yo?/* @__PURE__ */dt(at,{children:[vn?
|
|
62
|
-
/* @__PURE__ */st("div",{className:"es-sidepanel es-sidepanel--right","data-es-host-panel":"",children:vn}):/* @__PURE__ */st(at,{children:/* @__PURE__ */st(h,{value:{selectChild:Pl,addChild:$l,childRowName:Wi,blockRowName:_l},children:/* @__PURE__ */st(ao,{mode:er,onOpenWebsiteSettings:hr.openSettings??(()=>{}),onOpenSiteStyles:hr.openStyles,onSelectNode:Nr,onNotify:Yr,onHidePanel:ai,nodeActions:Et?Cn(Ft,Et.type):bt})})}),
|
|
63
|
-
/* @__PURE__ */st(He,{side:"right",width:Er.right,min:We.right,max:Ve,defaultWidth:m.right,label:_t.resizeSettingsPanel,onResize:Hr})]}):
|
|
64
|
-
/* @__PURE__ */st(N,{side:"right",onShow:ai})]}),Qi.menu,
|
|
65
|
-
/* @__PURE__ */st(ne,{}),Si?/* @__PURE__ */st(pt,{name:Si.name,onMake:e=>(async(e,n)=>{const t=hi.find(n=>String(n.props.id)===e),o=Dt.shared;if(!t||!o)return;let r;try{r=await C(bi).create(n,t)}catch{return void Yr(_t.shared.makeFailed,"error")}o.adopt(t,r),wi(null)})(Si.id,e),onCancel:()=>wi(null)}):null]})}))}export{wt as ScreenChrome};
|
package/dist/chunk-7LYKFL3Q.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import{fieldIsShown as e,shownFields as n}from"./chunk-BPXEFVSQ.js";import{TreeSeam as t}from"./chunk-A6Z4SD3I.js";import{DEFAULT_TREE_WORDS as l}from"./chunk-K56YDHYQ.js";import{easelMenuEntries as a}from"./chunk-FIVU2COQ.js";import{SETTINGS_BUCKETS as r,SettingsGroup as o}from"./chunk-RC25EGHD.js";import{DEFAULT_PANEL_WORDS as i}from"./chunk-KFV7N2DJ.js";import{FieldNumber as s}from"./chunk-ZOBSIXRD.js";import{FieldSelect as c}from"./chunk-QAJAEWCZ.js";import{DEFAULT_FIELDS_WORDS as d}from"./chunk-WRFD4EXD.js";import{SettingsField as u,SettingsSegmented as m}from"./chunk-VANKQVOW.js";import{useWords as h}from"./chunk-MFIRYGHW.js";import{useTreeDrag as p,gapToMoveIndex as f}from"./chunk-3S5N4HLJ.js";import{withTip as b}from"./chunk-P2VEMZH5.js";import{Textarea as g,Input as v,SortableList as y,ListRow as k,ContextMenu as x,tabPanelId as w,Tabs as C,tabButtonId as N}from"efficient-shell/ui";export{LinkPicker}from"efficient-shell/ui";import{useRef as O,useState as j,useLayoutEffect as D,useId as S}from"react";import{jsx as $,jsxs as I}from"react/jsx-runtime";import{ChevronIcon as L,LockIcon as P,MoveUpIcon as F,MoveDownIcon as E,DuplicateIcon as R,TrashIcon as A}from"efficient-shell/icons/efficient";function M({id:e,value:n,onChange:t,placeholder:l,multiline:a=!1,rows:r=3,readOnly:o=!1,ariaLabel:i,ariaLabelledBy:s}){const c=n??"";return a?/* @__PURE__ */$(g,{id:e,size:"sm",className:"es-fin",value:c,rows:r,placeholder:l,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>t(e.target.value)}):/* @__PURE__ */$(v,{id:e,size:"md",className:"es-fin",type:"text",value:c,placeholder:l,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>t(e.target.value)})}function W(e,n,t){const l=e.slice();return l.splice(Math.max(0,Math.min(n,l.length)),0,t),l}function z(e,n,t){const l=e.slice(),[a]=l.splice(n,1);return l.splice(Math.max(0,Math.min(t,l.length)),0,a),l}function T(e,n){return e.filter((e,t)=>t!==n)}function H(e){return null===e||"object"!=typeof e?e:JSON.parse(JSON.stringify(e))}var V='input, textarea, select, button, [contenteditable]:not([contenteditable="false"]), [tabindex]',B={parentId:"list",slot:"items"};function K({label:e,icon:n,noun:r,items:o,onChange:i,newItem:s,summary:c,itemName:u,thumb:m,min:g=0,max:v,readOnly:w=!1,open:C,onOpen:N,renderItem:S,renderRow:M,canRemove:K,lockedReason:J,fixed:Q=!1,removeOnRow:Z=!0,canDuplicate:X,above:Y,head:q=!0}){const G=h("fields",d).list,U=h("tree",l),_=r??G.item,ee=!w&&!Q&&("number"!=typeof v||o.length<v),ne=o.length<=g,te=e=>!!K&&!K(o[e],e),le=e=>!w&&!Q&&Z&&!ne&&!te(e),ae=e=>ee&&(!X||X(o[e],e)),re=(e,n)=>u?u(e,n):G.itemName({noun:_,n:n+1}),oe=O([]),ie=O(null),[se,ce]=j(null),de=O(null),[ue,me]=j(null),[he,pe]=j("");D(()=>{const e=ie.current;if(!e)return;ie.current=null;const n=oe.current[e.index]?.querySelectorAll(V)[e.nth]??oe.current[e.index];if(n?.focus(),n&&null!==e.start&&"setSelectionRange"in n)try{n.setSelectionRange(e.start,e.end)}catch{}});const fe=(e,n)=>{if(n<0||n>=o.length||n===e)return;const t=oe.current[e],l=t?.ownerDocument.activeElement;if(t&&l&&t.contains(l)){const e=[...t.querySelectorAll(V)].indexOf(l),a=l;ie.current={index:n,nth:e,start:"number"==typeof a.selectionStart?a.selectionStart:null,end:"number"==typeof a.selectionEnd?a.selectionEnd:null}}i(z(o,e,n));const a=function(e,n,t){return null===e?null:e===n?t:n<e&&t>=e?e-1:n>e&&t<=e?e+1:e}(C,e,n);a!==C&&N(a),pe(G.moved({n:n+1,total:o.length}))},be=e=>{ee&&(i(W(o,e,s())),M?(ie.current={index:e,nth:0,start:null,end:null},null!==C&&C>=e&&N(C+1)):N(e))},ge=e=>{le(e)&&(i(T(o,e)),C===e?N(null):null!==C&&C>e&&N(C-1))},ve=p({keyOf:e=>String(e),canDrop:(e,n)=>n.parentId===B.parentId&&n.slot===B.slot,onDrop:(e,n)=>{const t=f({...B,index:e},n);t!==e&&fe(e,t)},onStep:(e,n)=>fe(e,e+n),canStep:(e,n)=>e+n>=0&&e+n<o.length,readOnly:w}),ye=e=>{const n=[];return e>0&&n.push({label:G.moveUp,icon:/* @__PURE__ */$(F,{size:14}),shortcut:"⌥↑",onClick:()=>fe(e,e-1)}),e<o.length-1&&n.push({label:G.moveDown,icon:/* @__PURE__ */$(E,{size:14}),shortcut:"⌥↓",onClick:()=>fe(e,e+1)}),ae(e)&&n.push({label:G.duplicate,icon:/* @__PURE__ */$(R,{size:14}),onClick:()=>(e=>{ae(e)&&(i(W(o,e+1,H(o[e]))),null!==C&&C>e&&N(C+1))})(e)}),le(e)&&n.push({label:G.delete,icon:/* @__PURE__ */$(A,{size:14}),danger:!0,onClick:()=>ge(e)}),n},ke=(e,n,t,l)=>{w||0===ye(e).length||me({index:e,x:n,y:t,owner:l})},xe=e=>n=>{const t=o.slice();t[e]=n,i(t)};/* @__PURE__ */
|
|
2
|
-
return I("div",{className:"es-list",children:[q?/* @__PURE__ */I("div",{className:"es-list-head",children:[
|
|
3
|
-
/* @__PURE__ */I("span",{className:"es-list-label",children:[n?/* @__PURE__ */$("span",{className:"es-field-icon","aria-hidden":"true",children:n}):null,e]}),
|
|
4
|
-
/* @__PURE__ */$("span",{className:"es-list-count",children:o.length})]}):null,Y?/* @__PURE__ */$("div",{className:"es-list-above",children:Y}):null,o.length?/* @__PURE__ */I(y,{"aria-label":e,spacing:"comfortable",className:"es-list-rows",rootProps:ve.rootProps(),children:[o.map((e,n)=>{const l=ve.row({item:n,place:{...B,index:n}}),a=l.draggable&&se!==n,r=!M&&C===n,o=!w&&!Q&&Z&&te(n),i=["es-list-row",M?"is-inline":"is-item",r?"is-open":"",a?"is-draggable":"",l.dragging?"is-dragging":"",l.drop?`is-drop-${l.drop}`:""].filter(Boolean).join(" ");return[n>0?/* @__PURE__ */$(t,{...ve.seam({place:{...B,index:n}}),onAdd:ee?()=>be(n):void 0,label:G.addHere({noun:_})},`seam-${n}`):null,
|
|
5
|
-
/* @__PURE__ */$(k,{className:i,flat:!!M,active:r,draggable:l.draggable,dragHint:U.dragHint,dragging:l.dragging,drop:"before"===l.drop||"after"===l.drop?l.drop:void 0,onMove:l.draggable?e=>fe(n,"up"===e?n-1:n+1):void 0,rowRef:e=>{oe.current[n]=e},rowProps:{...l.rowProps,draggable:a||void 0,onPointerDown:e=>{const t=e.target.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])'),a=!!t&&t===t.ownerDocument.activeElement;e.currentTarget.draggable=l.draggable&&!a,de.current=t&&!a?t:null,ce(a?n:null)},onDragStart:e=>{const n=de.current;de.current=null,n&&n.ownerDocument.activeElement===n&&n.blur(),l.rowProps.onDragStart?.(e)},onContextMenu:e=>{w||(e.preventDefault(),e.stopPropagation(),ke(n,e.clientX,e.clientY,e.currentTarget))},onKeyDown:e=>{if("ContextMenu"===e.key||e.shiftKey&&"F10"===e.key){e.preventDefault();const t=e.currentTarget.ownerDocument,l=e=>e.preventDefault();t.addEventListener("contextmenu",l,{capture:!0,once:!0}),t.defaultView?.setTimeout(()=>t.removeEventListener("contextmenu",l,{capture:!0}),500);const a=e.currentTarget.getBoundingClientRect();return void ke(n,a.left+24,a.bottom,e.currentTarget)}l.rowProps.onKeyDown?.(e)}},actions:w||Q||!Z?void 0:o?b(J?J(e,n):G.locked,/* @__PURE__ */$("span",{className:"es-list-lock",role:"img","aria-label":J?J(e,n):G.locked,children:/* @__PURE__ */$(P,{size:13})})):b(G.deleteItem({noun:_}),/* @__PURE__ */$("button",{type:"button",className:"es-list-x","aria-label":G.deleteItem({noun:_}),disabled:!le(n),onClick:()=>ge(n),children:"×"})),below:r?/* @__PURE__ */$("div",{className:"es-list-item",children:S(e,n,xe(n))}):void 0,children:M?/* @__PURE__ */$("div",{className:"es-list-row-main",children:M(e,n,xe(n))}):/* @__PURE__ */I("button",{type:"button",className:"es-list-open","aria-expanded":r,onClick:()=>N(r?null:n),children:[m?/* @__PURE__ */$("span",{className:"es-list-thumb","aria-hidden":"true",children:m(e,n)}):null,
|
|
6
|
-
/* @__PURE__ */$("span",{className:"es-list-row-name",children:re(e,n)}),/* @__PURE__ */$("span",c?{className:"es-list-row-summary",children:c(e,n)}:{className:"es-list-row-summary"}),
|
|
7
|
-
/* @__PURE__ */$(L,{size:14,className:"es-list-chev","aria-hidden":"true"})]})},n)]}),
|
|
8
|
-
/* @__PURE__ */$(t,{...ve.seam({place:{...B,index:o.length}})})]}):null,w||Q?null:/* @__PURE__ */$("button",{type:"button",className:"es-list-add",disabled:!ee,onClick:()=>be(o.length),children:G.add({noun:_})}),
|
|
9
|
-
/* @__PURE__ */$("span",{className:"es-list-said","aria-live":"polite",children:he}),ue&&ue.index<o.length?
|
|
10
|
-
/* @__PURE__ */$(x,{at:{x:ue.x,y:ue.y},owner:ue.owner,onClose:()=>me(null),items:a(ye(ue.index))}):null]})}var J=e=>e<6?e+1:6,Q=(e,n)=>"string"==typeof e.label&&e.label?e.label:n;function Z({field:e,name:t,id:l,value:a,onChange:r,readOnly:i,context:s,showWhenContext:c,renderers:d,headingLevel:u=3}){const[m,h]=j(!0),p=a&&"object"==typeof a?a:{};/* @__PURE__ */
|
|
11
|
-
return $(o,{id:`${l}-group`,title:Q(e,t),open:m,onToggle:h,level:u,children:Object.entries(n(e.objectFields,{values:p,context:c})).map(([e,n])=>/* @__PURE__ */$(Y,{field:n,name:`${t}.${e}`,id:`${l}-${e}`,value:p[e],onChange:n=>r({...p,[e]:n}),readOnly:i,context:s,showWhenContext:c,renderers:d,headingLevel:J(u)},e))})}function X({field:e,name:t,id:l,value:a,onChange:r,readOnly:o,context:i,showWhenContext:s,renderers:c,openItem:d,onOpenItem:u,headingLevel:m}){const[h,p]=j(null),f=u?d??null:h,b=u??p,g=Array.isArray(a)?a:[],v=e.getItemSummary;/* @__PURE__ */
|
|
12
|
-
return $(K,{label:Q(e,t),icon:e.icon,noun:"string"==typeof e.noun?e.noun:void 0,items:g,onChange:r,newItem:()=>H({...e.defaultItemProps??{}}),summary:v?(e,n)=>v(e,n):void 0,min:e.min,max:e.max,readOnly:o,open:f,onOpen:b,renderItem:(a,r,d)=>Object.entries(n(e.arrayFields,{values:a,context:s})).map(([e,n])=>/* @__PURE__ */$(Y,{field:n,name:`${t}[${r}].${e}`,id:`${l}-${r}-${e}`,value:a?.[e],onChange:n=>d({...a,[e]:n}),readOnly:o,context:i,showWhenContext:s,renderers:c,headingLevel:m},e))})}function Y(e){const{field:n,name:t,id:l,value:a,onChange:r,readOnly:o,context:i,renderers:d}=e;if(!n||n.marker||!1===n.visible)return null;const h=d?.[n.type];if(h)return h({field:n,name:t,id:l,value:a,onChange:r,readOnly:o});switch(n.type){case"custom":{const e={...i,field:n,name:t,id:l,value:a,onChange:r,readOnly:o};return n.render(e)}case"text":case"textarea":/* @__PURE__ */
|
|
13
|
-
return $(u,{label:Q(n,t),htmlFor:l,icon:n.icon,hint:n.hint,children:/* @__PURE__ */$(M,{id:l,value:"string"==typeof a?a:null==a?"":String(a),onChange:r,placeholder:n.placeholder,multiline:"textarea"===n.type,readOnly:o})});case"number":/* @__PURE__ */
|
|
14
|
-
return $(u,{label:Q(n,t),htmlFor:l,icon:n.icon,hint:n.hint,children:/* @__PURE__ */$(s,{id:l,value:"number"==typeof a?a:void 0,onChange:r,min:n.min,max:n.max,step:n.step,placeholder:n.placeholder,readOnly:o})});case"select":{const e=`${l}-label`;/* @__PURE__ */
|
|
15
|
-
return $(u,{label:Q(n,t),labelId:e,htmlFor:l,icon:n.icon,hint:n.hint,children:/* @__PURE__ */$(c,{id:l,value:a,options:n.options,onChange:r,readOnly:o,ariaLabelledBy:e})})}case"radio":/* @__PURE__ */
|
|
16
|
-
return $(u,{label:Q(n,t),icon:n.icon,hint:n.hint,children:/* @__PURE__ */$(m,{ariaLabel:Q(n,t),value:a,options:n.options.map(e=>({id:e.value,label:e.label,icon:e.icon,disabled:e.disabled||o})),onChange:e=>{o||r(e)}})});case"object":/* @__PURE__ */
|
|
17
|
-
return $(Z,{...e,field:n});case"array":/* @__PURE__ */
|
|
18
|
-
return $(X,{...e,field:n});case"slot":return null}}var q=e=>r.includes(e);function G(n,t){let l,a=r[0];const o=[],i=/* @__PURE__ */new Set;for(const[r,s]of Object.entries(n))s&&(q(s.bucket)&&((s.marker||s.bucket!==a)&&(l=void 0),a=s.bucket),s.marker&&"string"==typeof s.fold?l={key:r,title:s.fold}:s.marker&&!1===s.fold&&(l=void 0),s.marker||!1===s.visible||t&&!e(s,t)||(o.push(l?{name:r,field:s,bucket:a,fold:l}:{name:r,field:s,bucket:a}),"slot"!==s.type&&i.add(a)));return{rows:o,buckets:r.filter(e=>i.has(e))}}function U(e){return new Map(G(e).rows.map(e=>[e.name,e.bucket]))}function _(e){const n=[];for(const t of e){const e=n[n.length-1];e&&e.fold?.key===t.fold?.key?e.rows.push(t):n.push({fold:t.fold,rows:[t]})}return n}function ee({fields:e,values:n,onChange:t,readOnly:l=!1,context:a,showWhenContext:r,tab:s,onTab:c,tabs:d=!0,tabIcons:u,renderers:m,idPrefix:p,ariaLabel:f,lead:b,children:g,leadFold:v,closedFolds:y,onFold:k,headingLevel:x=3}){const O=h("panel",i),D=S(),L=p??`es-insp${D.replace(/:/g,"")}`,P=G(e,{values:n,context:r}),[F,E]=j(void 0),R=s??F,A=R&&P.buckets.includes(R)?R:P.buckets[0],[M,W]=j(null),z=M&&M.panel===L&&P.rows.some(e=>e.name===M.name)?M:null,T=d&&P.buckets.length>1,H=T&&A?w(L,A):`${L}-rows`,[V,B]=j(()=>/* @__PURE__ */new Set),K=y??V,Q=(e,n)=>{/* @__PURE__ */return $(o,{title:e.title,open:!K.has(e.key),onToggle:n=>((e,n)=>{void 0===y&&B(t=>{const l=new Set(t);return n?l.delete(e):l.add(e),l}),k?.(e,n)})(e.key,n),id:`${L}-fold-${t=e.key,[...t].map(e=>/[A-Za-z0-9_-]/.test(e)?e:`-u${e.codePointAt(0).toString(16)}-`).join("")}`,level:x,children:n});var t},Z=e=>T&&e!==A,X=({name:e,field:o,bucket:i,fold:s})=>/* @__PURE__ */$("div",{className:"es-insp-row","data-field":e,"data-bucket":i,hidden:!!Z(i)||void 0,children:/* @__PURE__ */$(Y,{field:o,name:e,id:`${L}-${e}`,value:n[e],onChange:n=>t(e,n),readOnly:l,context:a,showWhenContext:r,renderers:m,openItem:z&&z.name===e?z.index:null,onOpenItem:n=>W(null===n?null:{panel:L,name:e,index:n}),headingLevel:s?J(x):x})},e);/* @__PURE__ */
|
|
19
|
-
return I("div",{className:"es-insp",children:[T?/* @__PURE__ */$("div",{className:"es-insp-tabs",children:/* @__PURE__ */$(C,{variant:"underline",block:!0,"aria-label":f??O.settings,idPrefix:L,value:A,onChange:e=>{const n=e;void 0===s&&E(n),c?.(n)},items:P.buckets.map(e=>{const n=O.buckets[e],t=u?.[e];return t?{id:e,icon:t,label:/* @__PURE__ */$("span",{className:"sr-only",children:n}),tooltip:n}:{id:e,label:n}})})}):null,
|
|
20
|
-
/* @__PURE__ */I("div",{className:"es-insp-rows",id:H,role:T?"tabpanel":void 0,"aria-labelledby":T&&A?N(L,A):void 0,children:[b?v?/* @__PURE__ */$("div",{className:"es-insp-band","data-fold":v.key,children:Q(v,b)}):b:null,_(P.rows).map((e,n)=>{if(!e.fold)return e.rows.map(X);const t=e.rows[0].bucket,l=e.rows.every(e=>"slot"===e.field.type);/* @__PURE__ */
|
|
21
|
-
return $("div",{className:"es-insp-band","data-fold":e.fold.key,"data-bucket":t,hidden:!(!Z(t)&&!l)||void 0,children:Q(e.fold,e.rows.map(X))},`fold-${e.fold.key}-${n}`)}),g]})]})}export{M as FieldText,ee as Inspector,Y as InspectorField,K as ListField,U as bucketsOf,H as copyItem,W as insertAt,Q as labelOf,z as moveTo,G as planFields,T as removeAt};
|
package/dist/chunk-A6Z4SD3I.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{DEFAULT_TREE_WORDS as e}from"./chunk-K56YDHYQ.js";import{useContext as r,createContext as a,isValidElement as l}from"react";import{Tree as n,TreeGroupLabel as o,TreeGroup as s,Tooltip as i,TreeRow as t,IconButton as d,TreeSeam as c,TreeEmptySlot as m}from"efficient-shell/ui";import{jsx as p,jsxs as g,Fragment as h}from"react/jsx-runtime";import{SharedIcon as u}from"efficient-shell/icons/efficient";var b,f=()=>b??=a(1),k=()=>r(f());function v({className:r,children:a,rootProps:l,ariaLabel:o,words:s=e}){/* @__PURE__ */
|
|
2
|
-
return p(n,{"aria-label":o??s.name??e.name,className:r?`es-tree ${r}`:"es-tree",rootProps:l,children:a})}function N({children:e,count:r,expanded:a,onToggle:l}){/* @__PURE__ */
|
|
3
|
-
return p(o,{count:r,expanded:a,onToggle:l,children:e})}function w({children:e}){const r=k(),a=f();/* @__PURE__ */
|
|
4
|
-
return p(a.Provider,{value:r+1,children:/* @__PURE__ */p(s,{children:e})})}var P=e.dragHint,y=e=>[e].flat(1/0).some(e=>l(e)&&!0===e.props.pressed);function T({icon:r,name:a,preview:l,selected:n,hidden:o,draggable:s,dragHint:d,dragging:c,drop:m,fold:b,actions:f,nameSlot:v,onSelect:N,marks:w,badge:P,trailing:T,shared:A,children:S,rowProps:x,level:H,words:j=e}){const B=k(),C=["es-tree-row",n?"is-selected":"",o?"is-hidden":"",s?"is-draggable":"",c?"is-dragging":"",m?`is-drop-${m}`:""].filter(Boolean).join(" "),$=/* @__PURE__ */g(h,{children:[
|
|
5
|
-
/* @__PURE__ */p("span",{className:"es-tree-name",children:a}),w?.map(e=>/* @__PURE__ */p(i,{content:e.label,children:/* @__PURE__ */p("span",{className:"es-tree-mark","aria-label":e.label,role:"img",children:e.icon})},e.key)),T?/* @__PURE__ */p(i,{content:T.label,children:/* @__PURE__ */p("span",{className:"es-tree-trailing","aria-label":T.label,role:"img",children:T.icon})}):null,S]}),z=A?/* @__PURE__ */g(h,{children:[null!=f?/* @__PURE__ */p("span",{className:"es-tree-shared-acts",children:f}):null,
|
|
6
|
-
/* @__PURE__ */p(i,{content:A,children:/* @__PURE__ */p("span",{className:"es-tree-shared-mark","aria-label":A,role:"img",children:/* @__PURE__ */p(u,{size:14})})})]}):null,D=x?.onClick,L={click:!1},Y=D?e=>{D(e),L.click=!0,queueMicrotask(()=>{L.click=!1})}:void 0,q=N?()=>{L.click||N()}:void 0;/* @__PURE__ */
|
|
7
|
-
return p(t,{label:$,level:H??B,icon:r,tone:A?"shared":void 0,preview:l,selected:!!n,expanded:b?b.open:void 0,onToggle:b?.onToggle,onSelect:q,muted:!!o,badge:P,actions:z??f,actionsPinned:!!A||y(f),actionsOverlay:!A,rename:v,drop:m,dragging:!!c,draggable:!!s,dragHint:d??j.dragHint,className:C,rowProps:{...x,onClick:Y,...s?{"aria-keyshortcuts":"Alt+ArrowUp Alt+ArrowDown"}:{}}})}function A({kind:e,label:r,onClick:a,pressed:l,disabled:n,children:o}){/* @__PURE__ */
|
|
8
|
-
return p(i,{content:r,children:/* @__PURE__ */p(d,{"aria-label":r,"aria-pressed":l,"aria-disabled":n||void 0,variant:"delete"===e?"ghost-danger":"ghost",size:"sm","data-kind":e,className:n?"es-tree-act-off":void 0,onClick:e=>{e.stopPropagation(),a()},children:o})})}function S({drop:e,onAdd:r,label:a,seamProps:l}){const n=["es-tree-seam",e?"is-drop":"",r?"has-add":"",l?.className??""].filter(Boolean).join(" "),o={...l,className:n};/* @__PURE__ */
|
|
9
|
-
return p(c,{drop:!!e,onInsert:r,label:a,seamProps:o})}function x({drop:r,onAdd:a,label:l,seamProps:n,words:o=e}){const s=l??(a?o.addBlock??e.addBlock:o.emptySlot??e.emptySlot),i={...n,className:n?.className?`es-tree-empty ${n.className}`:"es-tree-empty"};/* @__PURE__ */
|
|
10
|
-
return p(m,{drop:!!r,onAdd:a,label:s,slotProps:i})}export{v as LayersTree,w as Subtree,P as TREE_DRAG_HINT,x as TreeEmptySlot,N as TreeGroupLabel,T as TreeRow,A as TreeRowAction,S as TreeSeam};
|
package/dist/chunk-H2PRGXCW.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import{DEFAULT_DRAG_WORDS as e}from"./chunk-KAML3KQH.js";import{dropEffectFor as t,scrollBoxOf as n,frameScrollBox as l,startAutoScroll as a,isNoOpDrop as r}from"./chunk-3S5N4HLJ.js";import{parseZoneKey as o,ROOT_ID as s}from"./chunk-K7BTCBWD.js";import{withTip as i}from"./chunk-P2VEMZH5.js";import{useCanvasLayout as c,useCanvasTyping as d,useCanvasEvent as u,CANVAS_TYPABLE_EVENT as h,framePointToHost as f,elementScale as p,frameRectToLayer as m,clientPointToLayer as g}from"./chunk-QIDRJH3S.js";import{isRepeatCopy as x}from"./chunk-LF3FUSCQ.js";import{useRef as b,useEffect as y,useState as v,useCallback as w,useMemo as k,useSyncExternalStore as N,useId as D,useLayoutEffect as A}from"react";import{Tooltip as z,IconButton as T,solidSurfaceStyle as M,Input as C}from"efficient-shell/ui";import{AddIcon as S,CloseIcon as $,SearchIcon as E}from"efficient-shell/icons/efficient";import{jsxs as L,jsx as j}from"react/jsx-runtime";function B({label:e,onInsert:t,style:n,axis:l="y",className:a,index:r}){const o=["es-canvas-insert","x"===l?"is-x":"",a??""].filter(Boolean).join(" ");/* @__PURE__ */
|
|
2
|
-
return L("div",{className:o,style:n,"data-index":r,children:[
|
|
3
|
-
/* @__PURE__ */j("span",{className:"es-canvas-insert-line","aria-hidden":"true"}),
|
|
4
|
-
/* @__PURE__ */j("span",{className:"es-canvas-insert-chip",children:/* @__PURE__ */j(z,{content:e,children:/* @__PURE__ */j(T,{variant:"ghost",size:"sm","aria-label":e,onClick:t,children:/* @__PURE__ */j(S,{})})})})]})}var K=(e,t,n)=>t>=e.left&&t<=e.left+e.width&&n>=e.top&&n<=e.top+e.height,O=e=>e.width*e.height;function I(e,t,n){return e.map((e,t)=>({s:e,at:t})).filter(({s:e})=>K(e.box,t,n)).sort((e,t)=>O(t.s.box)-O(e.s.box)||e.at-t.at).map(({s:e})=>e)}function q(e,t,n){return I(e,t,n).at(-1)??null}function H(e,t,n){const l="x"===e.axis?t:n;let a=0;for(const t of e.children){l>("x"===e.axis?t.left+t.width/2:t.top+t.height/2)&&(a+=1)}return a}function X(e,t){const n=e.children;if("x"===e.axis){const l=n[t-1],a=n[t],r=l&&a?(l.left+l.width+a.left)/2:l?l.left+l.width:a?a.left:e.box.left,o=a??l??e.box;return{left:r-1,top:o.top,width:2,height:o.height}}const l=n[t-1],a=n[t],r=l&&a?(l.top+l.height+a.top)/2:l?l.top+l.height:a?a.top:e.box.top;return{left:e.box.left,top:r-1,width:e.box.width,height:2}}function Y(e,t,n,l,a=()=>!1,r=()=>!0){const o=e.filter(e=>K(e.box,t,n)).sort((e,t)=>O(e.box)-O(t.box));for(const e of o){const o=H(e,t,n),s={...e.list,index:o};if(a(s))return null;if(l(s))return{zone:e,to:s,line:X(e,o)};if(!r(s))return null}return null}function F(e,t,n=12){const l=e.children;if(0===l.length)return[];const a=e.box,r="x"===e.axis,o=r?a.left:a.top,s=o+(r?a.width:a.height),i=e=>r?e.left:e.top,c=e=>r?e.left+e.width:e.top+e.height,d=[];for(let a=0;a<=l.length;a++){const u=l[a-1],h=l[a];let f,p;if(u&&h)f=c(u),p=Math.max(i(h)-f,0);else{const e=u?(c(u)+s)/2:(o+i(h))/2,t=Math.min(Math.max(e,o+n),s-n);f=u?Math.max(t,c(u)):Math.min(t,i(h)),p=0}const m=[u,h].filter(e=>Boolean(e)),g=Math.min(...m.map(e=>r?e.top:e.left)),x=Math.max(...m.map(e=>r?e.top+e.height:e.left+e.width)),b=r?{left:f,top:g,width:p,height:x-g}:{left:g,top:f,width:x-g,height:p};d.push({key:`${e.key}:+${a}`,place:{...e.list,index:a},box:b,axis:e.axis,label:t})}return d}function P(e,t=e.key){const n=[];for(let l=1;l<e.children.length;l++){const a=e.children[l-1],r=e.children[l],o=a.top+a.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(r.top-o,0)}})}return n}var Q={nodes:[],zones:[]},R="data-puck-dropzone",Z="data-puck-component";function J(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 V(e,t){const{frame:n,document:l}=e,a=e=>m(n,function(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top,width:t.width,height:t.height}}(e),t),r=[],s=[];for(const e of l.querySelectorAll(`[${R}]`)){if(x(e))continue;const t=e.getAttribute(R)??"";let n;try{n=o(t)}catch{continue}const l=[...e.querySelectorAll(`[${Z}]`)].filter(t=>t.parentElement?.closest(`[${R}]`)===e&&!x(t)),i=l.map(a);s.push({key:t,list:n,box:a(e),axis:J(i,e),children:i}),l.forEach((e,t)=>{const l=e.getAttribute(Z);l&&r.push({id:l,place:{...n,index:t},box:i[t]})})}return{nodes:r,zones:s}}var W="data-es-empty-cell",U="data-puck-dropzone",G=140;var _=e=>({left:e.left,top:e.top,width:e.width,height:e.height});function ee(o){const{canvas:i,session:m,readOnly:x,words:D=e.canvas}=o,T=b(o);y(()=>{T.current=o});const C=b(null),S=c(i),[$,E]=v(0),K=w(()=>E(e=>e+1),[]),[O,q]=v(Q);y(()=>{const e=C.current;i&&e&&q((T.current.measure??V)(i,e))},[i,S,o.revision,$]);const H=o.model,X=k(()=>H(O),[H,O]),F=N(m.subscribe,m.shown,m.shown),P=o.choose,R=(e,t)=>{const n=I(X.sources,e,t);return 0===n.length?null:P?P(n):n[n.length-1]},[Z,J]=v(null),[G,ee]=v(null),[te,ne]=v(null),le=b(null),ae=()=>{le.current&&clearTimeout(le.current),le.current=null},re=()=>{ae(),le.current=setTimeout(()=>{m.get()||J(null)},140)};y(()=>ae,[]);const oe=b(null),se=d(i),ie=b(!1);ie.current=se,y(()=>{se&&(ae(),J(null))},[se]);const[ce,de]=v(null);u(i,h,e=>de(e.detail?.id??null));const ue=!ce||se||x||F?null:O.nodes.find(e=>e.id===ce)?.box??null;u(i,"mousemove",e=>{const t=C.current;if(!i||!t)return;const n=f(i.frame,e.clientX,e.clientY,t),l=p(t),a={x:n.x/l,y:n.y/l};if(oe.current=a,T.current.readOnly||m.get()||ie.current)return;ae();const r=R(a.x,a.y);J(e=>e?.key===r?.key&&e?.box===r?.box?e:r)}),u(i,"mouseout",e=>{e.relatedTarget||(oe.current=null,re())}),u(i,"mouseover",e=>{e.relatedTarget||K()});const he=b(null),fe=w(()=>{he.current?.(),he.current=null,ee(null),ne(null)},[]);y(()=>m.subscribe(()=>{m.get()?K():fe()}),[m,fe,K]),y(()=>fe,[fe]),("undefined"==typeof document?y:A)(()=>{if(m.get())return;const e=oe.current;J(t=>x||ie.current?null:e?R(e.x,e.y):t?X.sources.find(e=>e.key===t.key)??null:null)},[X,F,m,x,P]);const pe=e=>{const t=m.get(),n=C.current,l=T.current.dropOn;if(!t||!n||!l)return null;const a=g(n,e.clientX,e.clientY);oe.current=a;const r=I(X.sources,a.x,a.y);for(let e=r.length-1;e>=0;e-=1)if(l.accepts(t.item,r[e]))return{h:t,source:r[e]};return null},me=e=>{const t=m.get(),n=C.current;if(!t||!n)return null;const l=g(n,e.clientX,e.clientY);oe.current=l;const a=Y(X.zones,l.x,l.y,e=>T.current.canDrop(t.item,e),e=>!!t.from&&r(t.from,e),e=>T.current.fallThrough?.(t.item,e,t.from)??!0);return a?{h:t,t:a}:null},ge={onDragEnter:e=>{if(he.current)return;const t=n(e.currentTarget.parentElement?.parentElement??null),r=i?l(i.document):null,o=[];t&&o.push(a(t)),r&&i&&o.push(a(r,i.frame)),he.current=o.length?()=>o.forEach(e=>e()):null},onDragOver:e=>{const n=pe(e);if(n)return e.preventDefault(),e.dataTransfer.dropEffect=t(e.dataTransfer.effectAllowed),ee(null),void ne(e=>e&&e.key===n.source.key&&e.box===n.source.box?e:n.source);ne(null);const l=me(e);if(!l)return void ee(null);e.preventDefault(),e.dataTransfer.dropEffect=t(e.dataTransfer.effectAllowed);const a={zoneKey:l.t.zone.key,line:l.t.line,axis:l.t.zone.axis};ee(e=>e&&e.zoneKey===a.zoneKey&&e.line.left===a.line.left&&e.line.top===a.line.top?e:a)},onDragLeave:e=>{const t=e.relatedTarget;t&&e.currentTarget.contains(t)||(oe.current=null,ee(null),ne(null))},onDrop:e=>{const t=pe(e);if(t)return e.preventDefault(),m.end(),fe(),void T.current.dropOn.onDrop(t.h.item,t.source);const n=me(e);n&&(e.preventDefault(),m.end(),fe(),T.current.onDrop(n.h.item,n.t.to))}},xe={draggable:!x&&!!Z,onMouseEnter:ae,onMouseLeave:()=>!m.get()&&re(),onDragStart:e=>{if(Z&&!x){m.start({key:Z.key,item:Z.item,from:Z.from}),e.dataTransfer.effectAllowed="move";try{e.dataTransfer.setData("text/plain",Z.key)}catch{}}else e.preventDefault()},onDragEnd:()=>{m.end(),fe()},onClick:()=>{Z&&!x&&T.current.onPick?.(Z.item)}},{seams:be=[]}=X,ye=X.zones.filter(e=>0===e.children.length),ve=!o.onZoneAdd||x||se?[]:ye,we=ve.map(e=>e.key).join("\n");return y(()=>{const e=i?.document;if(!e)return;const t=new Set(we?we.split("\n"):[]);for(const n of e.querySelectorAll(`[${U}]`))n.toggleAttribute(W,t.has(n.getAttribute(U)??""));return()=>{for(const t of e.querySelectorAll(`[${W}]`))t.removeAttribute(W)}},[i,we,O,S,$]),/* @__PURE__ */L("div",{ref:C,className:"es-canvas-layer",children:[F||!o.onSeamAdd||x||se?null:be.map(e=>
|
|
5
|
-
/* @__PURE__ */j(B,{className:"es-canvas-seam",axis:e.axis,index:e.place.index,label:e.label??o.seamLabel??D.addSection,onInsert:()=>o.onSeamAdd?.(e.place),style:"x"===e.axis?{left:e.box.left+e.box.width/2-12,top:e.box.top,width:24,height:e.box.height}:{left:e.box.left,top:e.box.top+e.box.height/2-12,width:e.box.width,height:24}},e.key)),ve.length?ve.map(e=>/* @__PURE__ */j("button",{type:"button",className:["es-canvas-empty",e.addAlways?"is-always":"",G?.zoneKey===e.key?"is-over":""].filter(Boolean).join(" "),style:_(e.box),"data-node-id":e.list.parentId===s?void 0:e.list.parentId,onClick:()=>o.onZoneAdd?.({...e.list,index:0}),children:/* @__PURE__ */j("span",{className:"es-canvas-empty-add",children:D.addButton({label:e.addLabel??o.zoneAddLabel??D.addBlock})})},e.key)):null,F?/* @__PURE__ */j("div",{className:"es-canvas-catch",...ge}):null,te&&F?/* @__PURE__ */j("div",{className:"es-canvas-target",style:_(te.box),children:o.dropOn?.label?/* @__PURE__ */j("span",{className:"es-canvas-target-label",style:M(),children:o.dropOn.label(F.item,te)}):null}):null,G&&!ye.some(e=>e.key===G.zoneKey)?/* @__PURE__ */j("div",{className:`es-canvas-line is-${G.axis}`,style:_(G.line)}):null,ue?/* @__PURE__ */j("span",{className:"es-canvas-hint"+(ue.width<200?" is-below":""),style:{...M(),left:ue.left+ue.width,top:ue.width<200?ue.top+ue.height:ue.top},children:D.typeHint}):null,
|
|
6
|
-
/* @__PURE__ */j("div",{className:"es-canvas-handle-spot",style:Z?{"--es-handle-x":`${Z.box.left+2}px`,"--es-handle-y":`${Math.max(Z.box.top-11,0)}px`}:void 0,children:/* @__PURE__ */j(z,{className:"es-canvas-handle-tip",side:"top",content:!Z||x||F?null:Z.title??D.handle({label:Z.label}),children:/* @__PURE__ */L("div",{className:["es-canvas-handle",Z&&!x?"is-shown":"",F?"is-dragging":""].filter(Boolean).join(" "),...xe,children:[
|
|
7
|
-
/* @__PURE__ */j("span",{className:"es-canvas-grip","aria-hidden":"true",children:"⋮⋮"}),Z?.label]})})})]})}var te=e=>e.tiles.length>0&&e.tiles.every(e=>null!=e.cover);function ne({groups:t,session:n,itemFor:l,onInsert:a,onTileMenu:r,at:o,hint:s,searchLabel:c,readOnly:d,words:u=e.add}){const h=s??u.hint,f=c??u.search,[p,m]=v(""),g=D(),x=p.trim().toLowerCase(),b=function(e){const t=/* @__PURE__ */new Map;return e.map(e=>{const n=e.key??e.title,l=t.get(n)??0;return t.set(n,l+1),0===l?n:`${n}\0${l}`})}(t),y=t.map((e,t)=>({...e,key:b[t],tiles:x?e.tiles.filter(e=>((e,t)=>e.label.toLowerCase().includes(t)||(e.keywords??[]).some(e=>e.toLowerCase().includes(t)))(e,x)):e.tiles})).filter(e=>e.tiles.length>0),w=(e,t)=>a=>{if(t)a.preventDefault();else{n.start({key:`new:${e}`,item:l(e)}),a.dataTransfer.effectAllowed="copy";try{a.dataTransfer.setData("text/plain",e)}catch{}}};/* @__PURE__ */
|
|
8
|
-
return L("div",{className:"es-add",children:[o?/* @__PURE__ */L("div",{className:"es-add-at",role:"status",children:[
|
|
9
|
-
/* @__PURE__ */j("span",{children:o.label}),i(u.stop,/* @__PURE__ */j("button",{type:"button",className:"es-add-at-clear","aria-label":u.stop,onClick:o.onClear,children:/* @__PURE__ */j($,{size:12,"aria-hidden":"true"})}))]}):null,
|
|
10
|
-
/* @__PURE__ */j("p",{className:"es-add-hint",children:h}),
|
|
11
|
-
/* @__PURE__ */j("div",{className:"es-add-find",children:/* @__PURE__ */j(C,{id:g,type:"search","aria-label":f,placeholder:u.searchPlaceholder({label:f}),value:p,onChange:e=>m(e.target.value),leftIcon:/* @__PURE__ */j(E,{size:16,"aria-hidden":"true"}),rightAdornment:p?/* @__PURE__ */j(T,{size:"sm","aria-label":u.clearSearch,onClick:()=>m(""),children:/* @__PURE__ */j($,{size:12,"aria-hidden":"true"})}):void 0})}),0===y.length?/* @__PURE__ */L("div",{className:"es-add-empty",role:"status",children:[
|
|
12
|
-
/* @__PURE__ */j("div",{className:"es-add-empty-title",children:u.nothing({query:p.trim()})}),
|
|
13
|
-
/* @__PURE__ */j("div",{className:"es-add-empty-sub",children:u.tryAnother})]}):y.map(e=>/* @__PURE__ */L("section",{className:"es-add-group","aria-label":e.title,children:[
|
|
14
|
-
/* @__PURE__ */L("div",{className:"es-add-group-head",children:[
|
|
15
|
-
/* @__PURE__ */j("span",{className:"es-add-group-title",children:e.title}),
|
|
16
|
-
/* @__PURE__ */j("span",{className:"es-add-group-count",children:e.tiles.length})]}),
|
|
17
|
-
/* @__PURE__ */j("div",{className:te(e)?"es-add-grid is-cards":"es-add-grid",children:e.tiles.map(e=>{const t=Boolean(d||e.disabled),l=d?void 0:e.disabled?e.disabledReason:e.title??u.tile({label:e.label});return i(l,/* @__PURE__ */L("button",{type:"button",className:null!=e.cover?"es-add-tile has-cover":"es-add-tile",draggable:!t,"aria-disabled":t||void 0,"aria-label":u.tile({label:e.label}),onDragStart:w(e.type,t),onDragEnd:()=>n.end(),onClick:()=>!t&&a?.(e.type),onContextMenu:r?t=>{r(e.type,{x:t.clientX,y:t.clientY,owner:t.currentTarget})&&t.preventDefault()}:void 0,children:[null!=e.cover?/* @__PURE__ */j("span",{className:"es-add-tile-cover","aria-hidden":"true",children:e.cover}):e.icon?/* @__PURE__ */j("span",{className:"es-add-tile-glyph","aria-hidden":"true",children:e.icon}):null,
|
|
18
|
-
/* @__PURE__ */L("span",{className:"es-add-tile-label",children:[e.label,null!=e.mark?/* @__PURE__ */j("span",{className:"es-add-tile-mark","aria-hidden":"true",children:e.mark}):null]})]},e.type))})})]},e.key))]})}export{ne as AddPanel,ee as CanvasDragLayer,B as CanvasInsert,Q as EMPTY_MEASURE,G as HANDLE_GRACE_MS,Y as canvasTarget,K as contains,H as gapInZone,X as gapLine,F as insertSeams,V as measureCanvas,q as pickSource,P as seamsBetween,I as sourcesAt};
|
package/dist/chunk-KAML3KQH.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={add:{stop:"Stop adding here",hint:"Drag onto the page.",search:"Search blocks",searchPlaceholder:({label:e})=>e,clearSearch:"Clear search",nothing:({query:e})=>`Nothing matches “${e}”`,tryAnother:"Try another word.",tile:({label:e})=>`Add ${e}`},canvas:{addSection:"Add section",addBlock:"Add block",addButton:({label:e})=>`+ ${e}`,handle:({label:e})=>`Drag to move this ${e.toLowerCase()}`,typeHint:"Double-click to edit"}};export{e as DEFAULT_DRAG_WORDS};
|
package/dist/chunk-L2Y3PF2R.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{blockRuns as e,offeredChoices as r}from"./chunk-M2Z775ZC.js";import{useScreenBlockLook as s}from"./chunk-PAOZMXEI.js";import{DEFAULT_SCREEN_WORDS as t}from"./chunk-23DYNW6S.js";import{useWords as n}from"./chunk-MFIRYGHW.js";import{DropdownMenu as c}from"efficient-shell/ui";import{jsxs as i,Fragment as o,jsx as l}from"react/jsx-runtime";function p({choices:p,onPick:a}){const{Icon:m}=s(),u=n("screen",t),f=e(r(p)).flatMap(e=>[...e.group?[{type:"label",key:`group:${e.group}`,label:/* @__PURE__ */i(o,{children:[e.group," ",
|
|
2
|
-
/* @__PURE__ */l("span",{className:"sf-menugroup-count",children:e.items.length})]})}]:[],...e.items.map(e=>({key:e.type,label:e.label,icon:/* @__PURE__ */l("span",{className:"sf-chip",children:/* @__PURE__ */l(m,{type:e.type,size:13})}),onSelect:()=>a(e.type)}))]);/* @__PURE__ */
|
|
3
|
-
return l(c,{align:"start",triggerClassName:"sf-add-card",items:f,trigger:/* @__PURE__ */i(o,{children:[
|
|
4
|
-
/* @__PURE__ */l("span",{className:"sf-plus sf-plus--sm",children:"+"}),u.addBlockMenu]})})}export{p as AddBlockRow};
|
package/dist/chunk-MEHLY5Q4.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useSectionOps as o}from"./chunk-WEIE2FBC.js";import{SELECTION_MODE as e}from"./chunk-PAOZMXEI.js";import{useEasel as r}from"./chunk-EFHV56BO.js";import{usePreviewParts as t}from"./chunk-I54UCYOU.js";import{decodePartId as n,encodePartId as p}from"./chunk-IYT6NN2J.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}=r(o=>o),u=o(),{setSelectedPartId:f,setSelectHandler:k}=t(),l=d(o=>{const r=n(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?e:o)},[i,I]);c(()=>{k(l)},[k,l]);const h=s(m)?p(m.nodeId,m.propKey):null;c(()=>{f(h)},[h,f]);return{selectNode:d(o=>{i(()=>e);const r=a(o);r&&u.select(r)},[i,a,u]),openPartId:h}}export{m as usePartBridge};
|
package/dist/chunk-PAOZMXEI.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{usePickFollowsSelection as n}from"./chunk-FHCKFOCD.js";import{EaselCanvas as e,useSelectedFields as t}from"./chunk-EFHV56BO.js";import{Inspector as r}from"./chunk-7LYKFL3Q.js";import{slotFieldsOf as i}from"./chunk-PLVEGYK6.js";import{createContext as o,useContext as u}from"react";import{DesktopIcon as l}from"efficient-shell/icons/efficient";import{jsx as s}from"react/jsx-runtime";var c={kind:"puck"};function f(n,e){const t=n,r=e,i=Object.keys(t);return i.length===Object.keys(r).length&&i.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(n,e,t){const r=n.slotsOf?.(t);return r||i(e,t.type).map(n=>({slot:n,label:n,rung:!1}))}function p(n,e){return n.isFirst?n.isFirst(e):e.type===n.first}function m(n,e){return n.isLast?n.isLast(e):e.type===n.last}var k={},h=()=>k,v=()=>"",g=()=>null,y=()=>{},b={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},O={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},L={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */s(l,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},j={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(e,{height:"fill"})}function F(){const{id:n,fields:e,values:i,readOnly:o,onChange:u}=t();/* @__PURE__ */
|
|
3
|
-
return s("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */s(r,{fields:e,values:i,onChange:u,readOnly:o,idPrefix:n})})}var S=o({});function D({parts:n,children:e}){/* @__PURE__ */
|
|
4
|
-
return s(S.Provider,{value:n,children:e})}function P(){return u(S)}function B(){return(P().useOwnerName??v)()}function G(){return(P().useDocumentLabel??g)()}function N(n,e,t,r){return(P().useBridges??h)(n,e,t,r)}function x(n){return(P().useStandaloneBridges??h)(n)}function I(n,e){(P().useDocumentPass??y)(n,e)}function K(){return P().blockRules??b}function H(){return P().blockLook??O}function T(){return P().devices??L}function V(){return P().leftView??j}function A(){return P().pinned??w}function E(){return P().saveSwitch??!0}function R(e){n(!0===P().pickFollowsSelection,e)}function Y(){return P().storageNamespace||void 0}function Q(){return P().styleClipboard??null}function Z(){return P().nodeKeys??!0}function q(){return P().notify??null}function z(){return P().Canvas??C}function J(){return P().CanvasHead??null}function M(){return P().canvasDrag??null}var U=o(null);function W({target:n,children:e}){/* @__PURE__ */
|
|
5
|
-
return s(U.Provider,{value:n,children:e})}function X(){return u(U)}function $(){return P().Inspector??F}export{c as SELECTION_MODE,W as ScreenCanvasTargetProvider,D as ScreenPartsProvider,p as isPinnedFirst,m as isPinnedLast,a as isSlotMode,f as sameInspectorMode,d as screenSlotsOf,H as useScreenBlockLook,K as useScreenBlockRules,N as useScreenBridges,M as useScreenCanvasDrag,z as useScreenCanvasFrame,J as useScreenCanvasHead,X as useScreenCanvasTarget,T as useScreenDevices,G as useScreenDocumentLabel,I as useScreenDocumentPass,$ as useScreenInspectorPanel,V as useScreenLeftView,Z as useScreenNodeKeys,q as useScreenNotify,B as useScreenOwnerName,P as useScreenParts,R as useScreenPickFollowsSelection,A as useScreenPinned,E as useScreenSaveSwitch,Y as useScreenStorageNamespace,Q as useScreenStyleClipboard,x as useStandaloneScreenBridges};
|
package/dist/chunk-RC25EGHD.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,jsx as n}from"react/jsx-runtime";function o({title:o,open:i,onToggle:r,count:s,level:a=3,id:t,children:c,className:l}){const d=t?`${t}-body`:void 0;/* @__PURE__ */
|
|
2
|
-
return e("div",{className:l?`es-group ${l}`:"es-group",children:[
|
|
3
|
-
/* @__PURE__ */n(`h${a}`,{className:"es-group-title",children:/* @__PURE__ */e("button",{type:"button",id:t,"aria-expanded":i,"aria-controls":d,className:"es-group-head",onClick:()=>r(!i),children:[o,"number"==typeof s&&s>0?/* @__PURE__ */n("span",{className:"es-group-count",children:s}):null,
|
|
4
|
-
/* @__PURE__ */n("span",{className:"es-group-sign","aria-hidden":"true"})]})}),
|
|
5
|
-
/* @__PURE__ */n("div",{id:d,className:"es-group-body",hidden:!i,children:c})]})}var i=Object.freeze(["Design","Animation"]),r=Object.freeze(["Content","Size","Design","Layout","Position","Anchor"]);export{r as DESIGN_GROUPS,i as SETTINGS_BUCKETS,o as SettingsGroup};
|
package/dist/chunk-VANKQVOW.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{isValidElement as e}from"react";import{jsxs as l,jsx as s,Fragment as i}from"react/jsx-runtime";import{Segmented as a,Tooltip as n}from"efficient-shell/ui";function d(l){return Array.isArray(l)?l.some(d):e(l)}function r({label:e,labelId:a,icon:n,value:r,hint:c,changed:t,htmlFor:o,action:h,children:m,className:u}){const f=d(m),p=d(h);if(!f&&!p)return null;const b=["es-field"];f||b.push("is-inline"),t&&b.push("is-changed"),u&&b.push(u);const N=/* @__PURE__ */l(i,{children:[n?/* @__PURE__ */s("span",{className:"es-field-icon","aria-hidden":"true",children:n}):null,
|
|
2
|
-
/* @__PURE__ */s("span",{className:"es-field-label",id:a,children:e})]});/* @__PURE__ */
|
|
3
|
-
return l("div",{className:b.join(" "),children:[
|
|
4
|
-
/* @__PURE__ */l("div",{className:"es-field-head",children:[o?/* @__PURE__ */s("label",{className:"es-field-name",htmlFor:o,children:N}):/* @__PURE__ */s("span",{className:"es-field-name",children:N}),null!=r?/* @__PURE__ */s("span",{className:"es-field-value",children:r}):null,p?h:null]}),f?/* @__PURE__ */s("div",{className:"es-field-ctl",children:m}):null,c?/* @__PURE__ */s("p",{className:"es-field-hint",children:c}):null]})}function c({options:e,value:i,onChange:d,ariaLabel:r,fit:c,disabled:t=!1,className:o}){const h=c&&function(e,l){return{"--es-fit-count":e,"--es-fit-labels":`${l.labelsPx}px`,"--es-fit-widest":`${l.widestLabelPx}px`}}(e.length,c),m=e.findIndex(e=>e.id===i);
|
|
5
|
-
/* @__PURE__ */
|
|
6
|
-
return s("div",{className:"es-segs-fit","data-disabled":t||void 0,style:h,children:/* @__PURE__ */s(a,{size:"sm",label:r,className:`es-segs${h?" is-measured":""}${o?` ${o}`:""}`,value:m<0?"":String(m),onChange:l=>d(e[Number(l)].id),options:e.map((e,i)=>{const a=e.title??("string"==typeof e.label?e.label:void 0),d="string"!=typeof e.label,r=l=>a&&(e.icon||d)?/* @__PURE__ */s(n,{content:a,children:l}):l;return{value:String(i),disabled:t||!0===e.disabled,icon:e.icon?r(
|
|
7
|
-
/* @__PURE__ */s("span",{className:"es-seg-icon","aria-hidden":"true",children:e.icon})):void 0,label:d?/* @__PURE__ */l("span",{className:"es-seg-word",children:[r(/* @__PURE__ */s("span",{"aria-hidden":"true",children:e.label})),
|
|
8
|
-
/* @__PURE__ */s("span",{className:"es-vh",children:a})]}):/* @__PURE__ */s("span",{className:"es-seg-word",children:e.label})}})})})}export{r as SettingsField,c as SettingsSegmented};
|
package/dist/chunk-WEIE2FBC.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useScreenBlockRules as e}from"./chunk-PAOZMXEI.js";import{useEasel as t,useEaselApi as n}from"./chunk-EFHV56BO.js";import{newNodeId as o,ROOT_ZONE as r}from"./chunk-PLVEGYK6.js";import{useMemo as s}from"react";function i(i={}){const{dispatch:p}=t(e=>e),d=n(),c=!0===i.readOnly,a=e().resolveOnInsert,l=!0===(i.resolveOnInsert??a),m=!0===i.foldIntoHistory;return s(()=>{const e=m?e=>p({...e,recordHistory:!1}):p,t=(t,n,r)=>{const s=o(n);return c||e({type:"insert",componentType:n,destinationZone:t,destinationIndex:r,id:s}),s},n=e=>(l&&!c&&d.resolveNode(e,{trigger:"insert"}),e),s=(t,n,o)=>{c||e({type:"replace",destinationZone:t,destinationIndex:n,data:o})},i=(e,o,r)=>n(t(e,o,r));return{insertComponent:i,insertSection:(e,t)=>i(r,e,t),replaceComponent:s,seedChild:(e,o,r,i)=>{const p=t(e,r,o);s(e,o,{type:r,props:{id:p,...i}}),n(p)},insertNode:(e,o,r)=>{const i=t(e,r.type,o);return s(e,o,{type:r.type,props:{...r.props,id:i}}),n(i)},removeComponent:(t,n)=>{c||e({type:"remove",index:n,zone:t})},reorderComponent:(t,n,o)=>{c||e({type:"reorder",sourceIndex:n,destinationIndex:o,destinationZone:t})},duplicateComponent:(t,n)=>{c||e({type:"duplicate",sourceIndex:n,sourceZone:t})},select:e=>p({type:"setUi",ui:{itemSelector:e}}),setDocument:t=>{c||e({type:"setData",data:t})},commitDocument:(t,n)=>{c||(m?d.batch(()=>{e({type:"setData",data:t}),void 0!==n&&("slot"===n?.kind?d.selectSlot({parentId:n.parentId,slot:n.slot}):d.select(n?n.id:null))}):d.run({data:t,select:n}))}}},[p,c,l,d,m])}export{i as useSectionOps};
|
package/dist/chunk-WRFD4EXD.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={less:"Less",more:"More",choose:"Choose",search:"Search",noMatches:"No matches",list:{item:"item",itemName:({noun:e,n:o})=>{return`${t=e,t?t[0].toUpperCase()+t.slice(1):t} ${o}`;var t},position:({n:e,total:o})=>`${e} of ${o}`,duplicate:"Duplicate",duplicateItem:({noun:e})=>`Duplicate ${e}`,deleteItem:({noun:e})=>`Delete ${e}`,add:({noun:e})=>`+ Add ${e}`,addHere:({noun:e})=>`Add ${e} here`,moveUp:"Move up",moveDown:"Move down",delete:"Delete",locked:"This one cannot be removed",moved:({n:e,total:o})=>`Moved to ${e} of ${o}`}};export{e as DEFAULT_FIELDS_WORDS};
|