efficient-easel 12.0.0 → 13.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 +24 -0
- package/dist/{canvas-typing-CZ11Y5tb.d.ts → canvas-typing-CC0wA-ys.d.ts} +1 -1
- package/dist/{chunk-4ES5JGGX.js → chunk-3Z2MVLCD.js} +1 -1
- package/dist/{chunk-5NM5TPAX.js → chunk-4EI6UGGH.js} +1 -1
- package/dist/{chunk-WY5U4XFO.js → chunk-52LIZZG4.js} +4 -4
- package/dist/chunk-6RLEHTMK.js +1 -0
- package/dist/{chunk-2SOOKBHH.js → chunk-BPZQ7S2Z.js} +16 -16
- package/dist/chunk-DWIOHQG7.js +1 -0
- package/dist/{chunk-47JTYRQC.js → chunk-FBS75I6E.js} +2 -2
- package/dist/chunk-FUMIBYUU.js +57 -0
- package/dist/chunk-FZ3Y3QTQ.js +5 -0
- package/dist/chunk-H5QI34FV.js +1 -0
- package/dist/{chunk-WUO2GBPO.js → chunk-IWFVVCRN.js} +1 -1
- package/dist/{chunk-5QP7ZE35.js → chunk-J2JDC3EZ.js} +1 -1
- package/dist/{chunk-CZYR5V77.js → chunk-J54OXLQF.js} +1 -1
- package/dist/chunk-M4CNCPHA.js +1 -0
- package/dist/{chunk-FHLYUIJJ.js → chunk-NBDMTIU2.js} +2 -2
- package/dist/{chunk-EC2I7SIY.js → chunk-NW4LJ4G4.js} +1 -1
- package/dist/chunk-NY7HHUGB.js +7 -0
- package/dist/chunk-OG2SKSSK.js +2 -0
- package/dist/chunk-PIND6KE7.js +1 -0
- package/dist/chunk-PVAIOBBE.js +13 -0
- package/dist/{chunk-X4VIDPKV.js → chunk-S2MMPHKD.js} +1 -1
- package/dist/{chunk-XY5ZHRMR.js → chunk-TLDRFVD2.js} +1 -1
- package/dist/chunk-YWUHPY5W.js +5 -0
- package/dist/copy/index.d.ts +4 -4
- package/dist/copy/index.js +18 -18
- package/dist/draw/client.d.ts +6 -0
- package/dist/draw/client.js +1 -0
- package/dist/draw/index.d.ts +8 -0
- package/dist/draw/index.js +1 -0
- package/dist/easel/index.d.ts +2 -2
- package/dist/easel/index.js +1 -1
- package/dist/fields/index.js +1 -1
- package/dist/icons/index.d.ts +3 -2
- package/dist/icons/index.js +1 -1
- package/dist/icons/meanings.d.ts +1 -0
- package/dist/icons/meanings.js +1 -0
- package/dist/index.js +1 -1
- package/dist/panel/index.js +1 -1
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/MediaSidePanel.js +1 -1
- package/dist/screen/components/NodeContextMenu.d.ts +2 -2
- package/dist/screen/components/NodeContextMenu.js +1 -1
- package/dist/screen/components/PageEditGuardNotices.js +1 -1
- package/dist/screen/components/SaveControls.d.ts +2 -2
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenDocumentContext.js +1 -1
- package/dist/screen/components/ScreenMount.d.ts +1 -1
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.d.ts +2 -2
- package/dist/screen/components/ScreenStoreProvider.js +1 -1
- package/dist/screen/components/SectionScreenShell.js +15 -15
- package/dist/screen/components/UiIcon.d.ts +3 -1
- package/dist/screen/components/UiIcon.js +1 -2
- package/dist/screen/components/usePartBridge.d.ts +2 -2
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.d.ts +2 -2
- package/dist/screen/index.js +1 -1
- 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 +2 -2
- package/dist/screen/lib/puck/style-clipboard.js +1 -1
- package/dist/screen/lib/puck/text-control-kinds.js +1 -1
- package/dist/screen/lib/puck/use-section-ops.js +1 -1
- package/dist/screen/lib/screen-parts.d.ts +2 -2
- package/dist/screen/lib/screen-parts.js +1 -1
- package/dist/strings/catalogue.d.ts +1 -1
- package/dist/strings/catalogue.js +1 -1
- package/dist/strings/index.d.ts +1 -1
- package/dist/strings/index.js +1 -1
- package/dist/text-styles/index.js +26 -26
- package/dist/tree/index.d.ts +3 -2
- package/dist/{types-BLRK6_JO.d.ts → types-D8P9q-BG.d.ts} +7 -2
- package/dist/{words-notpwHR2.d.ts → words-CiuKuiy0.d.ts} +1 -1
- package/package.json +18 -3
- package/dist/chunk-5R7FE4VT.js +0 -57
- package/dist/chunk-KE2CXEIK.js +0 -13
- package/dist/chunk-KR4OCYRP.js +0 -1
- package/dist/chunk-LZS7JZK5.js +0 -1
- package/dist/chunk-O3RLI7XE.js +0 -1
- package/dist/chunk-UX7UJPC5.js +0 -5
- package/dist/chunk-WDQY6JMM.js +0 -7
- package/dist/chunk-WP7AZDCV.js +0 -5
|
@@ -0,0 +1,7 @@
|
|
|
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 E(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 S(t,e){const[n,l]=E(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 A(t,e){const[n,l]=E(t,e);let r=0;for(const t of n.chars){if(l===r)return t.at;r+=t.ch.length}return S(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?[S(t,e),S(t,e)]:[A(t,e),S(t,n)]}function W(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 j(t,o,i,a,s){const c=C(t,o),[u,d,h]=E(c,Math.min(i,a)),[f,p,m]=E(c,Math.max(i,a)),g=W(u,d),b=W(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]=E(r,n);return n!==l||!o.bullet&&null==o.number||""!==o.text?j(t,e,n,l,{text:"\n"}):K(t,e,i,!1,n)}function K(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]=E(o,Math.min(l,r)),[c,u,d]=E(o,Math.max(l,r)),h=o.lines.slice(s,d+1).map(({bullet:t,number:e,chars:n},l)=>{const r=0===l?W(i,a):0,o=l===d-s?W(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:j(e,n,i,a,{markup:r}),range:s}}return l||(c=c.replace(/\s*\r?\n\s*/g," ")),{kind:"type",edit:j(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:K(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:j(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,E=()=>N().defaultView?.getSelection()??null,S=()=>{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}),E()?.setBaseAndExtent(i,a,s,c),k=b,A=b,b=null,w(),!0};let A=null;const B=()=>{if(!A)return!1;const t=E(),e=t?.anchorNode??null;return!(e&&e.isConnected&&p.contains(e))||e===p&&0===t.anchorOffset&&(0!==A[0]||0!==A[1])},W=()=>{b=A,S()},P=()=>{S(),N().activeElement===p&&B()&&W();const e=E();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},K=t=>{const e=N().defaultView;t<=0||!e?A=null:e.requestAnimationFrame(()=>{m||b||(nt(),N().activeElement===p?(B()&&(W(),w()),K(t-1)):A=null)})},q=(t,e)=>{b=[t,e];const n=t=>{if(m)return;if(S())return void K(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(j(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("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=j(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(j(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,j 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,K as setBullet,J as startCanvasTyping,G as textMap,rt as textRange,S as toSource,A as toSourceStart,B as toVisible,nt as visibleArea};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ChevronRightIcon as e,TrashIcon as r,RenameIcon as i,ExternalIcon as t,SearchIcon as o,EyeOffIcon as n,EyeIcon as s}from"efficient-shell/icons/efficient-glyphs";import{jsx as a}from"react/jsx-runtime";var c={eye:s,"eye-off":n,search:o,"external-link":t,pencil:i,trash:r,"chevron-right":e};function l({name:e,size:r,strokeWidth:i=1.8,rounded:t=!1,className:o,style:n}){/* @__PURE__ */
|
|
2
|
+
return a(c[e],{size:r,strokeWidth:i,strokeLinecap:t?"round":void 0,strokeLinejoin:t?"round":void 0,className:o,style:n})}export{l as UiIcon};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a={text:"scalar",textarea:"scalar",plainText:"scalar",copyText:"scalar",plainTextarea:"scalar",textList:"list"},t=Object.entries(a).filter(([,a])=>"scalar"===a).map(([a])=>a);export{t as SCALAR_TEXT_CONTROLS,a as TEXT_CONTROL_KINDS};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{DEFAULT_CANVAS_WORDS as e}from"./chunk-TBY3DFKS.js";import{toItemSelector as t,fromItemSelector as n,useNodeOps as o,parentStep as r,clickPick as i}from"./chunk-ECM5F6JJ.js";import{useResolvedFields as l}from"./chunk-YRLPFZW3.js";import{selectionBox as s,placeWindow as a,offsetOrigin as c,colorRunOf as d,ColorWindow as u,startCanvasTyping as p,textMap as f}from"./chunk-NY7HHUGB.js";import{DEFAULT_COPY_WORDS as h}from"./chunk-33C6ALT5.js";import{useWords as m}from"./chunk-MFIRYGHW.js";import{setCanvasNonce as g,isTypingTarget as v,frameRectToHost as y,CANVAS_TYPING_EVENT as w,drawnBox as b}from"./chunk-ILXP5VX5.js";import{find as k,ROOT_ID as S,getList as C,remove as I,parseZoneKey as E,move as x,duplicate as D,replaceNode as A,createNode as M,insert as O,normalizeData as z,createResolveCache as R,resolveNodeData as P,ROOT_SLOT as B}from"./chunk-KRXQM65X.js";import{topLevelSlotKeys as L,fieldsFrom as N,defaultsFrom as V}from"./chunk-NKB3KVAB.js";import{createContext as $,useEffect as K,useContext as j,useRef as Z,useSyncExternalStore as F,useState as H,useMemo as T,useCallback as W,useLayoutEffect as Y}from"react";import{jsx as q,jsxs as X,Fragment as U}from"react/jsx-runtime";import{createPortal as G}from"react-dom";import{registerModalEscapeInterceptor as J,FloatingBar as Q,TextToolbar as _,LinkPicker as ee}from"efficient-shell/ui";function te(e){return!["setData","setUi","set"].includes(e.type)}var ne=(e,t,n,o)=>{const r=C(e,t,E(n));return r?.[o]??null},oe=(e,t,n,o,r)=>{const i=ne(e,t,n,o);if(!i)throw new Error(`${r}: nothing at ${n}[${o}]`);return i};function re(e,n){const{selection:o}=e;return{...e.ui,itemSelector:t(e.data,n,o),selectedSlot:o&&"slot"===o.kind?{parentId:o.parentId,slot:o.slot}:null}}function ie(e,t,n){return n?"node"===n.kind?k(e,t,n.id)?n:null:n.parentId===S?C(e,t,n)?n:null:k(e,t,n.parentId)&&C(e,t,n)?n:null:null}function le(e,t,o,r=!1){const{itemSelector:i,selectedSlot:l,...s}=o;let a=e.selection;var c;return"itemSelector"in o&&(a=n(e.data,t,i??null)),"selectedSlot"in o&&(l?a=(c=l)?{kind:"slot",parentId:c.parentId,slot:c.slot}:null:"slot"===a?.kind&&(a=null)),{...e,selection:a,ui:r?s:{...e.ui,...s}}}function se(e,t,n){const o=ae(e,t,n);if(o===e)return e;const r=ie(o.data,n,o.selection);return r===o.selection?o:{...o,selection:r}}function ae(e,t,n){const{data:o}=e;switch(t.type){case"setData":{const n="function"==typeof t.data?t.data(o):t.data;return{...e,data:{...o,...n}}}case"setUi":return le(e,n,"function"==typeof t.ui?t.ui(re(e,n)):t.ui);case"set":{const r={data:o,ui:re(e,n)},i="function"==typeof t.state?t.state(r):t.state;let l=i.data?{...e,data:i.data}:e;return i.ui&&(l=le(l,n,i.ui,!0)),l}case"insert":{const r={...E(t.destinationZone),index:t.destinationIndex},i=M(n,t.componentType,{},t.id?{id:t.id}:{});return{...e,data:O(o,n,r,i)}}case"replace":{const r=oe(o,n,t.destinationZone,t.destinationIndex,"replace");if(r.props.id!==t.data.props.id)throw new Error("Can't change the id during a replace action. Use remove and insert for a new node.");return{...e,data:A(o,n,r.props.id,t.data)}}case"replaceRoot":{const n={...o.root,props:{...o.root.props,...t.root.props},readOnly:t.root.readOnly};return{...e,data:{...o,root:n}}}case"duplicate":{const r=oe(o,n,t.sourceZone,t.sourceIndex,"duplicate"),i=D(o,n,r.props.id),l=ne(i,n,t.sourceZone,t.sourceIndex+1);return{...e,data:i,selection:l?{kind:"node",id:l.props.id}:e.selection}}case"reorder":return ae(e,{...t,type:"move",sourceZone:t.destinationZone},n);case"move":{if(t.sourceZone===t.destinationZone&&t.sourceIndex===t.destinationIndex)return e;const r=ne(o,n,t.sourceZone,t.sourceIndex);if(!r)return e;const i={...E(t.destinationZone),index:t.destinationIndex};return{...e,data:x(o,n,r.props.id,i)}}case"remove":{const r=oe(o,n,t.zone,t.index,"remove");return{...e,data:I(o,n,r.props.id)}}default:return e}}var ce={drag:!0,duplicate:!0,delete:!0,edit:!0,insert:!0},de={leftSideBarVisible:!0,rightSideBarVisible:!0,arrayState:{},componentList:{},isDragging:!1,previewMode:"edit",viewports:{current:{width:360,height:"auto"},options:[],controlsVisible:!0},field:{focus:null}},ue=0,pe=()=>`history-${ue+=1}`;function fe(e){let o=e.config;const r=e.now??(()=>Date.now()),i=e.historyCoalesceMs??250;let l=e.permissions??{};const s=z(e.data,o);let a={data:s,selection:null,ui:{...de}};if(e.ui){const{itemSelector:t,selectedSlot:r,...i}=e.ui;a={data:s,selection:r?{kind:"slot",...r}:n(s,o,t??null),ui:{...de,...i}}}let c=[{core:a,at:-1/0,sealed:!0,id:pe()}],d=0;const u=e=>{const t=c[d],n=r();!e&&d===c.length-1&&d>0&&!t.sealed&&n-t.at<i?c=[...c.slice(0,d),{...t,core:a,at:n}]:(c=[...c.slice(0,d+1),{core:a,at:n,sealed:e,id:pe()}],d=c.length-1)},p=/* @__PURE__ */new Set;let f=null,h=null,m=0,g=null,v=!1;const y=()=>{for(const e of[...p])e()},w=()=>{c=[...c.slice(0,d),{...c[d],core:a},...c.slice(d+1)]},b=(t,n)=>{m>0?v=v||n:(n?u(!1):a!==t&&w(),a.data!==t.data&&e.onChange?.(a.data),a!==t&&y())},S=e=>{const t=a;if(a=se(a,e,o),a===t)return;const n=e.recordHistory??te(e);b(t,n&&a.data!==t.data)},I=t=>{0===m&&(g=a,v=!1),m+=1;try{t()}catch(e){throw m-=1,0===m&&g&&(a=g,g=null),e}if(m-=1,m>0||!g)return;const n=g;g=null,v&&a.data!==n.data?u(!0):a!==n&&w(),a.data!==n.data&&e.onChange?.(a.data),a!==n&&y()},E=e=>{const t=a,n=ie(a.data,o,e);var r,i;(r=n,i=a.selection,r===i||r&&i&&r.kind===i.kind&&("node"===r.kind&&"node"===i.kind?r.id===i.id:"slot"===r.kind&&"slot"===i.kind&&r.parentId===i.parentId&&r.slot===i.slot))||(a={...a,selection:n},b(t,!1))},x=t=>{const n=a;d=t,a=c[d].core,a.data!==n.data&&e.onChange?.(a.data),a!==n&&y()},D=()=>(e={})=>{const t=e.root?o.root?.permissions:o.components[e.item?.type??e.type??""]?.permissions;return{...ce,...l,...t}};let M=D();const O=R(),B={resolveCache:O,async resolveAll({trigger:e="load",metadata:t}={}){const n=a.data,r={type:"root",props:{...n.root.props??{}}},i=[...n.content,...Object.values(n.zones??{}).flat()],[l,...s]=await Promise.all([P(r,o,{cache:O,trigger:e,metadata:t}),...i.map(n=>P(n,o,{cache:O,trigger:e,metadata:t}))]);I(()=>{const e=a;let t=a.data;s.forEach((e,r)=>{if(!e.didChange)return;const l=i[r].props.id,s=k(t,o,l)?.node;s&&s===k(n,o,l)?.node&&(t=A(t,o,l,e.node))}),l.didChange&&t.root===n.root&&(t={...t,root:{...t.root,props:l.node.props,readOnly:l.node.readOnly??t.root.readOnly}}),t!==a.data&&(a={...a,data:t,selection:ie(t,o,a.selection)},b(e,!1))})},async resolveNode(e,{trigger:t="replace",metadata:n}={}){const r=k(a.data,o,e)?.node;if(!r)return!1;const i=await P(r,o,{cache:O,trigger:t,metadata:n});if(!i.didChange)return!1;let l=!1;return I(()=>{const t=a;if(k(a.data,o,e)?.node!==r)return;const n=A(a.data,o,e,i.node);n!==a.data&&(a={...a,data:n,selection:ie(n,o,a.selection)},b(t,!1),l=!0)}),l},get config(){return o},getState(){if(f&&h===a)return f;const e=a,n={data:e.data,ui:re(e,o)},r="node"===e.selection?.kind?k(e.data,o,e.selection.id)?.node??null:null;return f={appState:n,selection:e.selection,selectedItem:r,config:o,dispatch:S,history:{back:()=>B.undo(),forward:()=>B.redo(),hasPast:d>0,hasFuture:d<c.length-1,histories:c.map(e=>({id:e.id,state:{data:e.core.data,ui:re(e.core,o)}})),index:d,setHistoryIndex:e=>{e>=0&&e<c.length&&e!==d&&x(e)}},getPermissions:M,getItemById:t=>k(e.data,o,t)?.node,getItemBySelector:t=>function(e,t,n){const[o,r]=(n.zone??"root:default-zone").split(/:(.*)/s);return C(e,t,{parentId:o,slot:r})?.[n.index]}(e.data,o,t),getSelectorForId:n=>{const r=t(e.data,o,{kind:"node",id:n});return r?{index:r.index,zone:r.zone??"root:default-zone"}:void 0}},h=e,f},subscribe:e=>(p.add(e),()=>{p.delete(e)}),dispatch:S,batch:I,group:()=>{const e=d,t=c[e].id;let n=!0;return{close:()=>{if(!n)return;if(n=!1,c[e]?.id!==t)return;if(d<=e+1)return void(d===e+1&&(c=[...c.slice(0,d),{...c[d],sealed:!0},...c.slice(d+1)]));const o=c[d];c=[...c.slice(0,e+1),{...o,sealed:!0},...c.slice(d+1)],d=e+1}}},select:e=>E(e?{kind:"node",id:e}:null),selectSlot:e=>E(e?{kind:"slot",parentId:e.parentId,slot:e.slot}:null),run(e){I(()=>{const t=a,n=void 0===e.select?a.selection:e.select;a={...a,data:e.data,selection:ie(e.data,o,n)},b(t,e.data!==t.data)})},load(e,t={}){const n=a,r=z(e,o);a={...a,data:r,selection:ie(r,o,t.selection??a.selection)},t.keepHistory||(c=[{core:a,at:-1/0,sealed:!0,id:pe()}],d=0),a!==n&&y()},undo(){d>0&&x(d-1)},redo(){d<c.length-1&&x(d+1)},setPermissions(e){(function(e,t){if(e===t)return!0;const n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>e[n]===t[n])})(e,l)||(l=e,M=D(),f=null,y())},setConfig(e){e!==o&&(o=e,M=D(),f=null,y())}};return B}function he(e,t,n={}){const o=e=>{if(e.altKey)return;if(!(e.metaKey!==e.ctrlKey))return;const o="KeyZ"===e.code,r="KeyY"===e.code&&!e.shiftKey;(o||r)&&(n.leaveTyping&&v(e.target)||!1!==t.getState?.().getPermissions().edit&&(e.preventDefault(),r||e.shiftKey?t.redo():t.undo()))};return e.addEventListener("keydown",o),()=>e.removeEventListener("keydown",o)}var me=$(null),ge=$(!0);function ve({easel:e,hotkeys:t=!0,resolveOnMount:n=!0,children:o}){return K(()=>{n&&e.resolveAll()},[e,n]),K(()=>{if(t&&"undefined"!=typeof document)return he(document,e)},[e,t]),/* @__PURE__ */q(me.Provider,{value:e,children:/* @__PURE__ */q(ge.Provider,{value:t,children:o})})}function ye(){const e=j(me);if(!e)throw new Error("useEasel: no <EaselProvider> above this component");return e}function we(e){const t=ye(),n=Z({view:null,selector:null,value:void 0,has:!1}),o=()=>{const o=t.getState(),r=n.current;if(r.has&&r.view===o&&r.selector===e)return r.value;const i=e(o);return r.has&&Object.is(r.value,i)?(n.current={view:o,selector:e,value:r.value,has:!0},r.value):(n.current={view:o,selector:e,value:i,has:!0},i)};return F(t.subscribe,o,o)}function be(){return function(e){return we(e)}}var ke="data-puck-component",Se="data-puck-dropzone",Ce={},Ie="data-es-mirror",Ee="undefined"==typeof window?K:Y;function xe(e,t,n){for(const e of Array.from(t.head.querySelectorAll(`[${Ie}]`)))e.remove();for(const o of Array.from(e.head.querySelectorAll('style, link[rel="stylesheet"]'))){const e=o.cloneNode(!0);e.setAttribute(Ie,""),n&&e.setAttribute("nonce",n),t.head.appendChild(e)}}function De({children:t,id:n="preview-frame",title:o,className:r,style:i,mirrorStyles:l=!0,onDocument:s,height:a="auto",nonce:c}){const d=m("canvas",e),u=Z(null),[p,f]=H(null);return Ee(()=>{const e=u.current,t=p?.ownerDocument.defaultView;if("auto"!==a||!e||!p||!t)return;const n=()=>{e.style.height=`${Math.ceil(p.getBoundingClientRect().height)}px`};n();const o=t.ResizeObserver,r=o?new o(n):null;return r?.observe(p),()=>r?.disconnect()},[p,a]),Ee(()=>{let e=u.current?.contentDocument;if(!e)return;"CSS1Compat"!==e.compatMode&&(e.open(),e.write("<!DOCTYPE html><html><head></head><body></body></html>"),e.close(),e=u.current?.contentDocument??e),e.body||e.documentElement.appendChild(e.createElement("body")),e.body.style.margin="0";const t=e.createElement("div");t.setAttribute("data-puck-entry",""),t.id="frame-root","fill"===a&&t.classList.add("es-frame-fill"),e.body.appendChild(t),g(e,c),f(t),s?.(e);let n=null;const o=u.current?.ownerDocument;if(l&&o){xe(o,e,c);const t=o.defaultView;t&&"MutationObserver"in t&&(n=new t.MutationObserver(()=>xe(o,e,c)),n.observe(o.head,{childList:!0,subtree:!0,characterData:!0}))}return()=>{n?.disconnect(),t.remove(),f(null),s?.(null)}},[]),/* @__PURE__ */q("iframe",{ref:u,id:n,title:o??d.frame,className:["es-canvas-frame","fill"===a?"is-fill":"",r??""].filter(Boolean).join(" "),style:i,children:p?G(t,p):null})}var Ae=$(null),Me=$(Ce),Oe=[];function ze({parentId:e,slot:t,className:n,style:o,minEmptyHeight:r=128,minEmptyWidth:i=120}){const l=ye(),s=we(n=>C(n.appState.data,l.config,{parentId:e,slot:t})??Oe),a=we(t=>"node"===t.selection?.kind&&t.selection.id===e&&e!==S),c=we(n=>"slot"===n.selection?.kind&&n.selection.parentId===e&&n.selection.slot===t),d=j(Ae),u=["es-zone"];return s.length&&u.push("has-children"),e===S&&u.push("is-root"),(a||c)&&u.push("is-area-selected"),null!==d&&d===e&&e!==S&&u.push("is-hovering-area"),n&&u.push(n),/* @__PURE__ */q("div",{className:u.join(" "),[Se]:`${e}:${t}`,style:{...o,"--min-empty-height":`${r}px`,"--min-empty-width":`${i}px`},children:s.map(e=>/* @__PURE__ */q(Ke,{node:e},e.props.id))})}function Re(e,t){return T(()=>{const n={};for(const o of L(N(e)))n[o]=function(e={}){/* @__PURE__ */
|
|
2
|
+
return q(ze,{parentId:t,slot:o,...e})};return n},[e,t])}function Pe(e){return T(()=>function({zone:t,...n}){/* @__PURE__ */
|
|
3
|
+
return q(ze,{parentId:e,slot:t,...n})},[e])}var Be=["top","bottom","zIndex"];function Le(e,t,n){e.style[t]!==n&&(e.style[t]=n)}function Ne(e){const t=function(e){const t=e?.ownerDocument.defaultView?.getComputedStyle(e);if(!t||"sticky"!==t.position)return null;const n=e=>"auto"===e?"":e;return{top:n(t.top),bottom:n(t.bottom),zIndex:n(t.zIndex)}}(function(e){const t=e.ownerDocument.defaultView;let n=null;for(const o of Array.from(e.children))if("none"!==t?.getComputedStyle(o).display){if(n)return null;n=o}return n}(e));Le(e,"position",t?"sticky":"relative");for(const n of Be)Le(e,n,t?.[n]??"");return!!t}var Ve="data-es-canvas-relative";function $e(e){e.hasAttribute(Ve)&&("relative"===e.style.position&&(e.style.position=""),e.removeAttribute(Ve));const t=e.ownerDocument.defaultView?.getComputedStyle(e).position;return t&&"static"!==t?"sticky"===t:(e.style.position||(e.style.position="relative",e.setAttribute(Ve,"")),!1)}function Ke({node:e}){const t=ye().config.components[e.type],n=e.props.id,o=Z(null),r=function(e,t){return T(()=>n=>{const o=t.current;o&&o!==n&&(o.removeAttribute(ke),o.removeAttribute("data-puck-dnd")),t.current=n,n&&(n.setAttribute(ke,e),n.setAttribute("data-puck-dnd",e),$e(n))},[e,t])}(n,o),i=Z(null),l=!!t?.inline;!function(e,t){const n=Z(!1),o=Z(()=>{});o.current=()=>{const o=e(),i=n.current;n.current=!!o&&t(o),i!==n.current&&r.current()};const r=Z(()=>{});Ee(()=>o.current()),Ee(()=>{const t=e(),i=t?.ownerDocument.defaultView;if(!t||!i)return;const l=()=>o.current();i.addEventListener("resize",l);const s=i.ResizeObserver,a=s?new s(l):null;a?.observe(t);let c=null;return r.current=()=>{c?.disconnect(),c=null;const e=t.ownerDocument.documentElement;n.current&&e&&i.MutationObserver&&(c=new i.MutationObserver(l),c.observe(e,{attributes:!0}))},r.current(),()=>{i.removeEventListener("resize",l),a?.disconnect(),c?.disconnect(),r.current=()=>{}}},[])}(()=>l?o.current:i.current,e=>l?$e(e):Ne(e));const s=j(Me),a=Re(t,n),c=Pe(n);if(!t?.render)return null;const d=t.render,u={...V(t),...e.props,...a},p={renderDropZone:c,isEditing:!0,dragRef:t.inline?r:null,metadata:{...s,...t.metadata}};return t.inline?/* @__PURE__ */q(d,{...u,puck:p,editMode:!0}):
|
|
4
|
+
/* @__PURE__ */q("div",{ref:i,[ke]:n,"data-puck-dnd":n,style:{position:"relative"},children:/* @__PURE__ */q(d,{...u,puck:p,editMode:!0})})}function je({metadata:e}){const t=we(e=>e.config),n=we(e=>e.appState.data.root).props??{},o=t.root?.render,r=Re(t.root,S),i=Pe(S),l=/* @__PURE__ */q(ze,{parentId:S,slot:B}),s=o?/* @__PURE__ */q(o,{id:"puck-root",...n,...r,puck:{renderDropZone:i,isEditing:!0,dragRef:null,metadata:e??{}},editMode:!0,children:l}):l;/* @__PURE__ */
|
|
5
|
+
return q(Me.Provider,{value:e??Ce,children:s})}var Ze=$(void 0);function Fe(e,t,n){const[o,r]=H(null),i=Z(t);return i.current=t,Ee(()=>{const t=e.current?.ownerDocument,n=t?.defaultView;if(!t||!n||!i.current)return void r(null);let o=0;const l=()=>{o=0;const n=function(e,t){if(!e||!t)return null;const n=b(e),o=t.getBoundingClientRect();return{top:n.top-o.top,left:n.left-o.left,width:n.width,height:n.height}}(i.current?i.current(t):null,e.current?.parentElement??null);r(e=>{return(t=e)===(o=n)||t&&o&&t.top===o.top&&t.left===o.left&&t.width===o.width&&t.height===o.height?e:n;var t,o})},s=()=>{o||(o=(n.requestAnimationFrame??(e=>n.setTimeout(e,16)))(l))};l();const a="MutationObserver"in n?new n.MutationObserver(s):null;a?.observe(t.body,{childList:!0,subtree:!0,attributes:!0,characterData:!0});const c="ResizeObserver"in n?new n.ResizeObserver(s):null;return c?.observe(t.documentElement),n.addEventListener("resize",s),()=>{a?.disconnect(),c?.disconnect(),n.removeEventListener("resize",s),o&&(n.cancelAnimationFrame??n.clearTimeout)(o)}},[n]),o}function He({id:e,kind:t,overlay:n}){const o=Z(null),r=Fe(o,e?t=>t.querySelector(`[${ke}="${t.defaultView?.CSS?.escape?t.defaultView.CSS.escape(e):e}"]`):null,e),i=/* @__PURE__ */q("div",{ref:o,"aria-hidden":"true",className:`es-canvas-outline is-${t}`,style:r?{position:"absolute",top:r.top,left:r.left,width:r.width,height:r.height}:{display:"none"}});return n&&e?/* @__PURE__ */q(n,{componentId:e,kind:t,children:i}):i}function Te(e,t,n){const o=f(e,n),r=o.text.length,i=e.ownerDocument;if(!t)return[r,r];let l=null;const s=i.caretPositionFromPoint?.(t.x,t.y);if(s&&e.contains(s.offsetNode))l=o.at(s.offsetNode,s.offset);else{const n=i.caretRangeFromPoint?.(t.x,t.y);n&&e.contains(n.startContainer)&&(l=o.at(n.startContainer,n.startOffset))}if(null===l)return[r,r];const a=o.text;let c=l,d=l;for(;c>0&&!/\s/.test(a[c-1]);)c-=1;for(;d<a.length&&!/\s/.test(a[d]);)d+=1;return[c,d]}function We({s:e,element:t,toolbar:n,label:o,keys:r}){const i=m("copy",h),l=e.pressed(),p=new Set(n.offered),f=n.colors&&n.colors.length>0?n.colors:null,g=Z(null),[v,w]=H(!1),[b,k]=H(null),S=v||null!==b,C=()=>{e.hold(),w(!1),k({href:e.pressed().href})},I=()=>{w(!1),k(null),e.resume()};Y(()=>{r.current={escape:()=>!!S&&(I(),!0),link:()=>!!p.has("link")&&(C(),!0)}}),Y(()=>()=>{r.current=null},[r]);const E=Z(I);E.current=I,K(()=>{if(v)return J(e=>{const t=g.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&(E.current(),!0)},()=>g.current?.querySelector(".es-copy-colors"))},[v]),K(()=>{const n=g.current;if(!S||!n)return;const o=/* @__PURE__ */new Set([n.ownerDocument]),r=t();r&&o.add(r.ownerDocument);const i=o=>{const r=o.target;if(r&&n.contains(r))return;w(!1),k(null);const i=t();r&&i&&i.contains(r)?e.release():e.stop("outside")};for(const e of o)e.addEventListener("pointerdown",i,!0);return()=>{for(const e of o)e.removeEventListener("pointerdown",i,!0)}},[S,e,t]),Y(()=>{const e=g.current,n=e?.querySelector(".rosh-tb-wrap > .es-copy-pop"),o=t();if(!(S&&e&&n&&o))return;const r=o.ownerDocument.defaultView?.getSelection()??null,i=r&&r.rangeCount>0&&o.contains(r.getRangeAt(0).startContainer)?r.getRangeAt(0):null,l=(i?s(i,o):null)??(()=>{const e=o.getBoundingClientRect();return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}})(),d=o.ownerDocument.defaultView?.frameElement,u=d?y(d,{left:l.left,top:l.top,width:l.right-l.left,height:l.bottom-l.top}):{left:l.left,top:l.top,width:l.right-l.left,height:l.bottom-l.top},p=o.getBoundingClientRect(),f=d?y(d,{left:p.left,top:p.top,width:p.width,height:p.height}):{left:p.left,top:p.top,width:p.width,height:p.height},h=(e.closest("[data-floating-bar]")??e).getBoundingClientRect(),m={left:u.left,right:u.left+u.width,top:Math.min(u.top,f.top-6,h.top),bottom:Math.max(u.top+u.height,f.top+f.height+6,h.bottom)},v=e.ownerDocument.documentElement,w=(d??o.closest(".es-canvas")??o).getBoundingClientRect(),b={left:Math.max(0,w.left),top:Math.max(0,w.top),right:Math.min(v.clientWidth||w.right,w.right),bottom:Math.min(v.clientHeight||w.bottom,w.bottom)};if(b.right<=b.left||b.bottom<=b.top||0===n.offsetWidth)return;const k=a({anchor:m,size:{width:n.offsetWidth,height:n.offsetHeight},within:{left:w.left,top:w.top,right:w.right,bottom:w.bottom},clip:b,parent:c(n)});n.style.top=`${k.top}px`,n.style.left=`${k.left}px`,n.style.setProperty("--es-pop-point",`${k.point}px`),n.dataset.side=k.above?"above":"below"});const x=f?{run:d(l.color,f),open:v,onToggle:()=>{k(null),v?I():(e.hold(),w(!0))}}:void 0;/* @__PURE__ */
|
|
6
|
+
return q(Q,{anchor:()=>{const e=t();if(!e)return null;const n=e.getBoundingClientRect(),o=e.ownerDocument.defaultView?.frameElement,r=o?y(o,{left:n.left,top:n.top,width:n.width,height:n.height}):{left:n.left,top:n.top,width:n.width,height:n.height};return{left:r.left-6,top:r.top-6,right:r.left+r.width+6,bottom:r.top+r.height+6}},bounds:()=>{const e=t(),n=e?.ownerDocument.defaultView?.frameElement,o=(n??e?.closest(".es-canvas")??e)?.getBoundingClientRect();return o?{left:o.left,top:o.top,right:o.right,bottom:o.bottom}:{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}},"aria-label":o,children:/* @__PURE__ */q("div",{ref:g,style:{width:"18rem"},children:/* @__PURE__ */q(_,{offered:p,pressed:l.marks,onMark:t=>{"link"===t?C():e.press(t)},color:x,linkOpen:null!==b,list:{pressed:l.list,onList:t=>e.list(t)},alignment:n.alignment,letterCase:n.letterCase,last:n.lastTool?.({className:"rosh-tb-btn",disabled:!1,selected:l.selected,keepCaret:t=>{t.preventDefault(),e.hold()},insert:t=>e.insert(t)}),windows:/* @__PURE__ */X(U,{children:[v&&f?/* @__PURE__ */q(u,{colors:f,current:l.color,words:i.colors??h.colors,onPick:t=>e.color(t)}):null,b?
|
|
7
|
+
/* @__PURE__ */q(ee,{className:"es-copy-link es-copy-pop",value:b.href??"",onApply:t=>{k(null),e.link(t)},onRemove:null!==b.href?()=>{k(null),e.link(null)}:void 0,onCancel:I}):null]})})})})}function Ye({element:e}){const t=Z(null),n=Fe(t,()=>e(),e);/* @__PURE__ */
|
|
8
|
+
return q("div",{ref:t,"aria-hidden":"true",className:"es-canvas-outline is-typing",style:n?{position:"absolute",top:n.top,left:n.left,width:n.width,height:n.height}:{display:"none"}})}function qe({frame:t=!0,className:n,style:o,metadata:l,mirrorStyles:s,onDocument:a,height:c,title:d,nonce:u,hotkeys:f,frameWrapper:h,overlay:g,children:v,typing:y,passThrough:b}){const k=ye(),S=j(Ze),C=b??S,I=j(ge),E=m("canvas",e),x=f??I,[D,A]=H(void 0),M=we(e=>"node"===e.selection?.kind?e.selection.id:null),[O,z]=H(null),[R,P]=H(null),B=Z(null),[,L]=H(0),N=Z(y);N.current=y;const V=Z(null),$=Z(null),F=e=>{const t=$.current?.ownerDocument,n=t?.defaultView?.CustomEvent;t&&n&&t.dispatchEvent(new n(w,{detail:{typing:e}}))},T=(e,t)=>{B.current?.s.stop("stop");const n=e.element();if(!n)return!1;const o=k.group(),r=e.element,i=p({element:r,value:e.value,rules:e.rules,multiline:e.multiline,skip:e.skip,caret:Te(n,t,e.skip),write:e.write,remount:e.remount,onSelect:()=>L(e=>e+1),onEscape:()=>V.current?.escape()??!1,onLinkKey:()=>V.current?.link()??!1,end:e=>{o.close(),B.current?.element===r&&(B.current=null),P(null),F(!1),N.current?.onChange?.({typing:!1,why:e})}});if(!i)return o.close(),!1;const l=n.closest?.(`[${ke}]`)?.getAttribute(ke);return l&&k.select(l),B.current={s:i,element:r,target:e},P(()=>r),z(null),F(!0),N.current?.onChange?.({typing:!0,element:n}),!0};K(()=>()=>B.current?.s.stop("stop"),[]);const W=e=>{const t=B.current?.element();return Boolean(t&&t.contains(e))},Y=e=>{const t=e.closest?.(`[${ke}]`)?.getAttribute(ke);if(!t)return;const n=k.getState(),o="node"===n.selection?.kind?n.selection.id:null;return i(n.appState.data,k.config,t,o,C)??t},U=e=>{if("Enter"!==e.key||e.defaultPrevented||e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return;if(B.current)return;const t=e.target;if(t?.isContentEditable||t?.closest?.("input, textarea, select, button"))return;const n=N.current?.atSelection?.();n&&T(n,null)&&e.preventDefault()},G=/* @__PURE__ */X("div",{ref:$,className:"es-canvas-content",style:{position:"relative"},onClick:e=>{const t=e.target;if(t.closest?.("a[href]")&&e.preventDefault(),B.current){if(W(t))return;B.current.s.stop("outside")}const n=Y(t);void 0===n?t.hasAttribute?.(Se)||k.select(null):k.select(n)},onDoubleClick:e=>{const t=N.current;if(!t||W(e.target))return;const n=t.at(e.target);n&&T(n,{x:e.clientX,y:e.clientY})&&e.preventDefault()},onKeyDown:e=>U(e),onMouseOver:e=>{if(B.current)return;const t=Y(e.target)??null;t!==O&&z(t)},onMouseLeave:()=>z(null),children:[
|
|
9
|
+
/* @__PURE__ */q(Ae.Provider,{value:O,children:/* @__PURE__ */q(je,{metadata:l})}),
|
|
10
|
+
/* @__PURE__ */X("div",{className:"es-canvas-outlines",style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:[
|
|
11
|
+
/* @__PURE__ */q(He,{id:!R&&O&&O!==M?O:null,kind:"hover",overlay:g}),
|
|
12
|
+
/* @__PURE__ */q(He,{id:R?null:M,kind:"selected",overlay:g}),R?/* @__PURE__ */q(Ye,{element:R}):null]}),v]}),J=h?/* @__PURE__ */q(h,{document:D,children:G}):G;K(()=>{if(D&&x)return he(D,k)},[D,x,k]),K(()=>{if(!D)return;const e=e=>{if("Enter"===e.key)return void U(e);if("Escape"!==e.key||e.defaultPrevented)return;const t=e.target;if(t?.isContentEditable||t?.closest?.("input, textarea, select"))return;const n=k.getState();if("node"!==n.selection?.kind)return;const o=r(n.appState.data,k.config,n.selection);"node"===o?.kind&&k.select(o.id)};return D.addEventListener("keydown",e),()=>D.removeEventListener("keydown",e)},[D,k]);/* @__PURE__ */
|
|
13
|
+
return X("div",{className:"es-canvas"+(n?` ${n}`:""),style:o,"data-puck-preview":"","data-es-typing":R?"":void 0,children:[R&&B.current?.target.toolbar?/* @__PURE__ */q(We,{s:B.current.s,element:B.current.element,toolbar:B.current.target.toolbar,label:E.textTools,keys:V}):null,t?/* @__PURE__ */q(De,{mirrorStyles:s,onDocument:e=>{A(e??void 0),a?.(e)},height:c,title:d,nonce:u,children:J}):/* @__PURE__ */q("div",{id:"preview-frame","data-puck-entry":"",children:J})]})}function Xe(e={}){const t=ye(),n=we(e=>e.appState.data);return o({...e,data:n,config:t.config,commit:(e,{select:n})=>t.run({data:e,select:n})})}function Ue(){const e=ye(),t=we(e=>e.config),n=e.resolveCache,o=we(e=>e.selectedItem),r=we(e=>e.appState.data.root),i=o?o.props.id:"root",s=r.props??{},a=T(()=>o||{type:"root",props:s},[o,s]),c=o?t.components[o.type]:t.root,d=e.getState(),u=o?k(d.appState.data,t,i):null,p=u&&"root"!==u.place.parentId?u.place.parentId:null,f=p?d.getItemById(p)??null:null,{fields:h}=l({id:i,node:a,block:c,parent:f,appState:d.appState}),m=we(e=>!1===e.getPermissions(o?{item:o}:{root:!0}).edit),g=W(o=>{(async()=>{const r=e.getState();if("root"!==i){const l=r.getItemById(i),s=r.getSelectorForId(i);if(!l||!s)return;const a={...l,props:{...l.props,...o}},{node:c}=await P(a,t,{cache:n,trigger:"replace"}),d=e.getState().getSelectorForId(i);if(!d)return;return void e.dispatch({type:"replace",destinationZone:d.zone??"root:default-zone",destinationIndex:d.index,data:c})}const l=r.appState.data.root.props??{},{node:s}=await P({type:"root",props:{...l,...o}},t,{cache:n,trigger:"replace"});e.dispatch({type:"replaceRoot",root:{props:s.props,readOnly:s.readOnly},recordHistory:!0})})()},[e,t,n,i]),v=W((e,t)=>g({[e]:t}),[g]);return{id:i,node:a,fields:h,values:a.props,readOnly:m,onChange:v,onChangeMany:g}}export{De as CanvasFrame,Ze as CanvasPassThroughContext,de as DEFAULT_UI,qe as EaselCanvas,ve as EaselProvider,je as EditDocument,he as bindUndoKeys,fe as createEasel,be as createUseEasel,te as recordsByDefault,se as reduce,re as uiView,we as useEasel,ye as useEaselApi,Xe as useEaselNodeOps,Ue as useSelectedFields,ie as validSelection};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useScreenBlockRules as e}from"./chunk-
|
|
1
|
+
import{useScreenBlockRules as e}from"./chunk-FZ3Y3QTQ.js";import{newNodeId as t,ROOT_ZONE as n}from"./chunk-PLVEGYK6.js";import{useEasel as o,useEaselApi as r}from"./chunk-PVAIOBBE.js";import{useMemo as s}from"react";function i(i={}){const{dispatch:p}=o(e=>e),d=r(),c=!0===i.readOnly,a=e().resolveOnInsert,l=!0===(i.resolveOnInsert??a),m=!0===i.foldIntoHistory;return s(()=>{const e=m?e=>p({...e,recordHistory:!1}):p,o=(n,o,r)=>{const s=t(o);return c||e({type:"insert",componentType:o,destinationZone:n,destinationIndex:r,id:s}),s},r=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,t,n)=>r(o(e,t,n));return{insertComponent:i,insertSection:(e,t)=>i(n,e,t),replaceComponent:s,seedChild:(e,t,n,i)=>{const p=o(e,n,t);s(e,t,{type:n,props:{id:p,...i}}),r(p)},insertNode:(e,t,n)=>{const i=o(e,n.type,t);return s(e,t,{type:n.type,props:{...n.props,id:i}}),r(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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{blockRuns as e}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as r}from"./chunk-
|
|
1
|
+
import{blockRuns as e}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as r}from"./chunk-FZ3Y3QTQ.js";import{DEFAULT_SCREEN_WORDS as s}from"./chunk-VVPZMWJE.js";import{useWords as t}from"./chunk-MFIRYGHW.js";import{DropdownMenu as n}from"efficient-shell/ui";import{jsxs as c,Fragment as i,jsx as o}from"react/jsx-runtime";function l({choices:l,onPick:p}){const{Icon:a}=r(),m=t("screen",s),u=e(l).flatMap(e=>[...e.group?[{type:"label",key:`group:${e.group}`,label:/* @__PURE__ */c(i,{children:[e.group," ",
|
|
2
2
|
/* @__PURE__ */o("span",{className:"sf-menugroup-count",children:e.items.length})]})}]:[],...e.items.map(e=>({key:e.type,label:e.label,icon:/* @__PURE__ */o("span",{className:"sf-chip",children:/* @__PURE__ */o(a,{type:e.type,size:13})}),onSelect:()=>p(e.type)}))]);/* @__PURE__ */
|
|
3
3
|
return o(n,{align:"start",triggerClassName:"sf-add-card",items:u,trigger:/* @__PURE__ */c(i,{children:[
|
|
4
4
|
/* @__PURE__ */o("span",{className:"sf-plus sf-plus--sm",children:"+"}),m.addBlockMenu]})})}export{l as AddBlockRow};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{buildPaletteSections as e,pinnedSection as t,categoryLabel as o}from"./chunk-PA3PNTVV.js";import{sectionTemplatesOf as n}from"./chunk-BVN33R76.js";import{blockTypesIn as s}from"./chunk-5ZBY24K7.js";import{SidePanelHead as i,PanelModeExit as r}from"./chunk-62VPYC7F.js";import{blockRuns as l}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as c,useScreenBlockRules as a}from"./chunk-FZ3Y3QTQ.js";import{useEaselSession as p}from"./chunk-O7Q4DDJT.js";import{DEFAULT_SCREEN_WORDS as m}from"./chunk-VVPZMWJE.js";import{useEasel as d}from"./chunk-PVAIOBBE.js";import{useWords as f}from"./chunk-MFIRYGHW.js";import{AddPanel as y}from"./chunk-QFVRMARS.js";import{DEFAULT_DRAG_WORDS as h}from"./chunk-AYWN5NRH.js";import{useState as u,useEffect as k,useMemo as b}from"react";import{AddIcon as g}from"efficient-shell/icons/efficient";import{jsx as j,jsxs as v,Fragment as V}from"react/jsx-runtime";var A=e=>`section:${e}`,B=e=>`block:${e}`,E=e=>`template:${e}`;function O({at:O,placeBlocks:R,canTake:$,onPick:w,itemFor:F,session:I,siteWide:N,onClose:P,onHide:T,readOnly:x}){const H=d(e=>e.config),Q=c(),{labelAtLevel:W,categoryLabel:Y,firstSection:C,Icon:L,Thumbnail:M}=Q,{blockIsOffered:D,canAddTo:S}=a(),Z=f("screen",m).add,z=f("drag",h).add,J=p(),[G,K]=u([]);k(()=>{let e=!1;const t=e=>D(e,J);return n(J).list().then(o=>{if(e)return;const n=H.components;K(o.filter(e=>e.node?.type&&n[e.node.type]&&s(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[H,J]);const q=b(()=>e(H,Q),[H]),U=e=>({type:A(e.type),label:e.name,cover:/* @__PURE__ */j(M,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:Z.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),X=e=>{const t=e.indexOf(":"),o=e.slice(0,t),n=e.slice(t+1);if("section"===o)return{kind:"section",type:n};if("block"===o)return{kind:"block",type:n};if("template"===o){const e=G.find(e=>e.id===n);return e?{kind:"template",template:e}:null}return null},_=e=>/* @__PURE__ */j("span",{className:"es-add-glyph-cover",children:/* @__PURE__ */j(L,{type:e,size:26})}),ee=b(()=>{const e=t(q,C),n=/* @__PURE__ */new Map,s=e=>{!n.has(e.type)&&D(e.type,J)&&n.set(e.type,e)};for(const t of e?[e]:q){const e=S(t.type)?.choices??[];e.forEach(s),e.forEach(e=>S(e.type,1)?.choices?.forEach(s))}R?.forEach(s);const i=new Set(q.map(e=>e.type)),r=[...n.values()].filter(e=>!i.has(e.type)),c=e=>({type:B(e.type),label:e.label,cover:_(e.type),title:Z.tile({name:e.label}),keywords:[e.group??"",e.type].filter(Boolean)}),a=e=>n.has(e.type)?{...U(e),cover:_(e.type)}:U(e),p=[];G.length>0&&p.push({key:"templates",title:Z.templates,tiles:G.map(e=>{return{type:E(e.id),label:e.name,cover:/* @__PURE__ */j(M,{type:e.node.type}),keywords:[(t=e.node.type,W(t,"section",H.components[t]?.label??t)),e.node.type]};var t})});const m=r.filter(e=>!e.group);let d=!1;for(const t of Object.keys(H.categories??{})){const n=q.filter(e=>e.cat===t);if(0===n.length)continue;const s=e&&n.some(t=>t.type===e.type)?e:null,i=(s?[s,...n.filter(e=>e.type!==s.type)]:n).map(a);s&&!d&&(i.splice(1,0,...m.map(c)),d=!0),p.push({key:`category:${t}`,title:o(H,t,Y),tiles:i})}const f=p.find(e=>e.key?.startsWith("category:"));if(!d&&f&&m.length>0&&(f.tiles=[...f.tiles,...m.map(c)],d=!0),l(r.filter(e=>e.group||!d)).forEach((e,t)=>{p.push({key:`blocks:${t}`,title:e.group??"",tiles:e.items.map(c)})}),!$)return p;const y=p.map(e=>({...e,tiles:e.tiles.map(e=>{const t=X(e.type),o=t?$(t):null;return o?{...e,disabled:!0,disabledReason:o}:e})})),h=e=>e.tiles.some(e=>!e.disabled);return[...y.filter(h),...y.filter(e=>!h(e))]},[G,q,H,Z,$,R,J]);/* @__PURE__ */
|
|
2
|
+
return v(V,{children:[
|
|
3
|
+
/* @__PURE__ */j(i,{icon:/* @__PURE__ */j(g,{size:15}),title:Z.title,context:Z.contextAll,actions:/* @__PURE__ */j(r,{label:Z.done,description:Z.doneDescription,onClick:P}),onHide:T}),
|
|
4
|
+
/* @__PURE__ */v("div",{className:"sf-addside sf-scroll",children:[
|
|
5
|
+
/* @__PURE__ */j(y,{groups:ee,session:I,itemFor:e=>F(X(e)??{kind:"section",type:e}),onInsert:w?e=>{const t=X(e);t&&w(t)}:void 0,at:O,hint:Z.hint,searchLabel:Z.search,readOnly:x,words:z}),N??null]})]})}export{O as AddSidePanel,B as blockKey,A as sectionKey,E as templateKey};
|
package/dist/copy/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { c as CopyBoxProps, d as CopyCell, T as TextBoxHandle } from '../canvas-typing-
|
|
4
|
-
export { e as COPY_CELLS, b as CanvasTypingEnd, f as CanvasTypingOptions, g as CanvasTypingSession, h as ColorWindow, i as CopyBoxAlign, j as CopyBoxFooter, C as CopyBoxLastTool, k as CopyCase, l as CopyCellPreset, m as CopyCells, a as CopyThemeColor, M as MarkWriter, S as SelectionSource, n as TextAreaHandle, o as TextMap, p as ToolbarMark, q as colorRunOf, r as insertSelection, s as markSelection, t as startCanvasTyping, u as textMap } from '../canvas-typing-
|
|
3
|
+
import { c as CopyBoxProps, d as CopyCell, T as TextBoxHandle } from '../canvas-typing-CC0wA-ys.js';
|
|
4
|
+
export { e as COPY_CELLS, b as CanvasTypingEnd, f as CanvasTypingOptions, g as CanvasTypingSession, h as ColorWindow, i as CopyBoxAlign, j as CopyBoxFooter, C as CopyBoxLastTool, k as CopyCase, l as CopyCellPreset, m as CopyCells, a as CopyThemeColor, M as MarkWriter, S as SelectionSource, n as TextAreaHandle, o as TextMap, p as ToolbarMark, q as colorRunOf, r as insertSelection, s as markSelection, t as startCanvasTyping, u as textMap } from '../canvas-typing-CC0wA-ys.js';
|
|
5
5
|
import { MarkStyle, MarkupTool, InlineRule, MarkedLine, WrapResult } from 'efficient-shell/markup';
|
|
6
6
|
export { TextToolbar, TextToolbarProps } from 'efficient-shell/ui';
|
|
7
7
|
import { F as FieldOption } from '../types-Dkx1VAIQ.js';
|
|
8
|
-
import { a as CopyAlign } from '../words-
|
|
9
|
-
export { b as COPY_ALIGNS, c as COPY_ALIGN_FIT, d as COPY_ALIGN_GLYPHS, e as COPY_ALIGN_LABELS, C as CopyWords, f as copyAlignOptions } from '../words-
|
|
8
|
+
import { a as CopyAlign } from '../words-CiuKuiy0.js';
|
|
9
|
+
export { b as COPY_ALIGNS, c as COPY_ALIGN_FIT, d as COPY_ALIGN_GLYPHS, e as COPY_ALIGN_LABELS, C as CopyWords, f as copyAlignOptions } from '../words-CiuKuiy0.js';
|
|
10
10
|
import { TextStyleCase } from '../text-styles/model.js';
|
|
11
11
|
import '../buckets-Tj-nkBpg.js';
|
|
12
12
|
import '../words-gIDCeRv3.js';
|
package/dist/copy/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import{TEXT_STYLE_CASES as e}from"../chunk-YHZSBL2N.js";import{
|
|
2
|
-
return
|
|
3
|
-
/* @__PURE__ */
|
|
4
|
-
return
|
|
5
|
-
return
|
|
6
|
-
/* @__PURE__ */
|
|
7
|
-
/* @__PURE__ */
|
|
8
|
-
return
|
|
9
|
-
return
|
|
10
|
-
/* @__PURE__ */
|
|
11
|
-
/* @__PURE__ */
|
|
12
|
-
/* @__PURE__ */
|
|
13
|
-
/* @__PURE__ */
|
|
14
|
-
return
|
|
15
|
-
return
|
|
16
|
-
/* @__PURE__ */
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
-
/* @__PURE__ */
|
|
1
|
+
import{TEXT_STYLE_CASES as e}from"../chunk-YHZSBL2N.js";import{selectionToVisible as t,selectionToSource as n,richLayout as r,createHistory as l,colorRunOf as o,textRange as a,selectionBox as s,placeWindow as c,offsetOrigin as i,visibleArea as u,ColorWindow as d,markPress as p,pasteToMarkup as m,richInput as h,editVisible as f,MARKUP_CLIPBOARD_TYPE as g,markupOfRange as y}from"../chunk-NY7HHUGB.js";export{ColorWindow,MARKUP_CLIPBOARD_TYPE,TYPING_BURST_MS,colorRunOf,createHistory,editVisible,markupOfRange,newLine,pasteToMarkup,richInput,richLayout,selectionToSource,selectionToVisible,setBullet,startCanvasTyping,textMap,toSource,toSourceStart,toVisible}from"../chunk-NY7HHUGB.js";import{DEFAULT_COPY_WORDS as v}from"../chunk-33C6ALT5.js";import{FieldNumber as b}from"../chunk-2XMHLXMA.js";import{FieldSelect as S}from"../chunk-G3GWAP5R.js";import"../chunk-WRFD4EXD.js";import{SettingsSwitch as k,SettingsField as x,SettingsSegmented as w}from"../chunk-36LVP5WD.js";import{GoldTextInput as E}from"../chunk-H4UMY7QF.js";import{useWords as C}from"../chunk-MFIRYGHW.js";import{TextToolbar as D,registerModalEscapeInterceptor as N,textToolbarRows as L,LinkPicker as O,Tooltip as T,IconButton as R}from"efficient-shell/ui";export{TextToolbar}from"efficient-shell/ui";import{useRef as H,useState as K,useLayoutEffect as M,useEffect as P,useId as j}from"react";import{RETIRED_MARKS as F,applyMark as B,marksIn as $,STANDARD_MARKUP as V,listIn as z,colorIn as U,spanFor as W,findLink as A,colorOver as Y,setList as I,unlinkAt as G,removeLink as q,linkOver as _,writeLink as X}from"efficient-shell/markup";import{jsxs as Z,jsx as Q,Fragment as J}from"react/jsx-runtime";import{ParagraphSpacingIcon as ee,LetterSpacingIcon as te,LineSpacingIcon as ne,TextSizeIcon as re,AlignJustifyIcon as le,AlignRightIcon as oe,AlignCenterIcon as ae,AlignLeftIcon as se,StylesIcon as ce,TypeIcon as ie,AlignmentIcon as ue,ListFormatIcon as de,CaseIcon as pe,ItalicIcon as me,NumberedListIcon as he,ListIcon as fe,ListNoneIcon as ge,CaseLowerIcon as ye,CaseCapitalizedIcon as ve,CaseUpperIcon as be,CaseNormalIcon as Se}from"efficient-shell/icons/efficient";function ke(e,t){const n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}}function xe(e,t,n,r=B){const{start:l,end:o}=ke(e,n);return r(e,l,o,t)}function we(e,t,n){const{start:r,end:l}=ke(e,n),o=r+t.length;return{text:e.slice(0,r)+t+e.slice(l),selectionStart:o,selectionEnd:o}}function Ee(e,t,n,r){switch(t){case"bold":return e.createElement("strong");case"italic":return e.createElement("em");case"strike":return e.createElement("s");case"underline":return e.createElement("u");case"sup":return e.createElement("sup");case"sub":return e.createElement("sub");case"color":{const t=e.createElement("span");return t.className="es-rich-color",r&&(t.dataset.color=r,t.title=r.startsWith("#")?r.toUpperCase():r,t.style.color=r.startsWith("#")?r:`var(--es-color-${r}, inherit)`),t}case"link":{const t=e.createElement("a");return t.className="es-rich-link",n&&(t.title=n),t}default:{const n=e.createElement("span");return n.className="highlight"===t||"accent"===t?"es-rich-emphasis":`es-rich-${t}`,n}}}function Ce(e,t,n,r){const l=e.layout.lines;if(n===t)return r>=e.lines.length?e.layout.text.length:l[r].vis;const o=e.lines.findIndex(e=>e===n||e.contains(n));if(-1===o)return 0;const a=t.ownerDocument.createRange();a.setStart(e.lines[o],0);try{a.setEnd(n,r)}catch{return l[o].vis}return l[o].vis+Math.min(a.toString().length,l[o].text.length)}function De(e,t){const n=e.layout.lines;let r=n.length-1;for(let e=0;e<n.length;e+=1)if(t<=n[e].vis+n[e].text.length){r=e;break}let l=Math.max(0,t-n[r].vis);const o=e.lines[r].ownerDocument.createTreeWalker(e.lines[r],4);let a=o.nextNode(),s=null;for(;a;){if(l<=a.data.length)return[a,l];l-=a.data.length,s=a,a=o.nextNode()}return s?[s,s.data.length]:[e.lines[r],0]}function Ne({value:e,rules:l,multiline:o,readOnly:a=!1,placeholder:s,ariaLabel:c,handle:i,onEdit:u,onSelect:d,onHistory:p,onFormat:v,pending:b,onCommit:S,onCancel:k}){const x=H(null),w=H(null),E=H(null),C=H(null),D=H(null),N=H(e),[L,O]=K(0),T=H({value:e,rules:l,multiline:o,readOnly:a,pending:b,onEdit:u,onHistory:p,onFormat:v});T.current={value:e,rules:l,multiline:o,readOnly:a,pending:b,onEdit:u,onHistory:p,onFormat:v};const R=()=>{const e=x.current,t=w.current,n=e?.ownerDocument.getSelection();if(!(e&&t&&n&&0!==n.rangeCount&&n.anchorNode&&e.contains(n.anchorNode)))return null;const r=Ce(t,e,n.anchorNode,n.anchorOffset),l=n.focusNode&&e.contains(n.focusNode)?Ce(t,e,n.focusNode,n.focusOffset):r;return r<=l?[r,l]:[l,r]},j=(e,t)=>{const n=x.current,r=w.current;if(!n||!r)return;const[l,o]=De(r,e),[a,s]=De(r,t);n.ownerDocument.getSelection()?.setBaseAndExtent(l,o,a,s)};i.current={getSource(){const e=R(),t=w.current;if(!e||!t)return null;const[r,l]=n(t.layout,e[0],e[1]);return{start:r,end:l}},setSource(e,t,n){C.current={text:n,src:[e,t]},O(e=>e+1)},focus(){x.current?.focus()},rangeOf(e,n){const r=x.current,l=w.current;if(!r||!l)return null;const[o,a]=t(l.layout,e,n),[s,c]=De(l,o),[i,u]=De(l,a),d=r.ownerDocument.createRange();return d.setStart(s,c),d.setEnd(i,u),d}},M(()=>{const n=x.current;if(!n||D.current)return;const o=C.current?null:R();w.current=function(e,t){const n=e.ownerDocument;e.replaceChildren();const r=t.lines.map(t=>{const r=n.createElement("div");r.className=null!=t.number?"es-rich-line is-numbered":t.bullet?"es-rich-line is-bullet":"es-rich-line",null!=t.number&&(r.dataset.number=t.number);const l=[],o=()=>l.length?l[l.length-1].el:r;let a=null;for(const e of t.chars){let t=0;for(;t<l.length&&t<e.marks.length&&l[t].id===e.marks[t].id;)t+=1;(l.length>t||e.marks.length>t)&&(a=null),l.length=t;for(let r=t;r<e.marks.length;r+=1){const t=Ee(n,e.marks[r].kind,e.marks[r].href,e.marks[r].color);o().appendChild(t),l.push({id:e.marks[r].id,el:t})}a||(a=n.createTextNode(""),o().appendChild(a)),a.data+=e.ch}return 0===t.chars.length&&r.appendChild(n.createElement("br")),e.appendChild(r),r});return{layout:t,lines:r}}(n,r(e,l)),E.current=e;const a=C.current;if(!a||a.text!==e)return void(o&&n.ownerDocument.activeElement===n&&j(o[0],Math.min(o[1],w.current.layout.text.length)));C.current=null;const s=w.current.layout,[c,i]=a.vis??t(s,a.src[0],a.src[1]);n.ownerDocument.activeElement!==n&&n.focus(),j(c,i)},[e,l,L]);const F=(e,t,r)=>{const l=w.current,[o,a]=n(l.layout,t[0],t[1]);C.current={text:e.text,vis:[e.caret,e.caret]},e.text!==T.current.value?T.current.onEdit(e.text,{start:o,end:a},r):O(e=>e+1)};P(()=>{const e=x.current;if(!e)return;const t=t=>{const{value:n,rules:r,multiline:l,readOnly:o,pending:a}=T.current;if("insertCompositionText"===t.inputType)return;if(t.preventDefault(),o)return;const s=w.current,c=R();if(!s||!c)return;const i="function"==typeof t.getTargetRanges?t.getTargetRanges()[0]:void 0,u=i&&!i.collapsed?[Ce(s,e,i.startContainer,i.startOffset),Ce(s,e,i.endContainer,i.endOffset)]:null,d=h({value:n,rules:r,multiline:l,inputType:t.inputType,data:t.data??t.dataTransfer?.getData("text/plain")??"",html:t.dataTransfer?.getData("text/html"),doc:e.ownerDocument,sel:c,target:u,pending:a});d&&("history"!==d.kind?"format"!==d.kind?F(d.edit,d.range,d.kind):T.current.onFormat(d.style):T.current.onHistory(d.dir))},n=()=>{D.current||O(e=>e+1)};return e.addEventListener("beforeinput",t),e.addEventListener("input",n),()=>{e.removeEventListener("beforeinput",t),e.removeEventListener("input",n)}},[]),P(()=>{const e=x.current;if(!e)return;const t=e.ownerDocument,n=()=>{const e=i.current?.getSource();e&&d(e)};return t.addEventListener("selectionchange",n),()=>t.removeEventListener("selectionchange",n)});const B=(t,n=!1)=>{const r=R();if(!r||r[0]===r[1])return;t.preventDefault();const o=w.current;t.clipboardData.setData("text/plain",o.layout.text.slice(r[0],r[1])),t.clipboardData.setData(g,y(e,l,r[0],r[1])),n&&!a&&F(f(e,l,r[0],r[1],{text:""}),r,"edit")};/* @__PURE__ */
|
|
2
|
+
return Z("div",{className:"es-rich-wrap",children:[s&&""===e?/* @__PURE__ */Q("div",{className:"es-rich-placeholder","aria-hidden":"true",children:s}):null,
|
|
3
|
+
/* @__PURE__ */Q("div",{ref:x,className:`es-rich${o?" is-multiline":" is-single"}${a?" is-off":""}`,contentEditable:!a,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":o,"aria-label":c,"aria-readonly":a||void 0,"aria-placeholder":s,tabIndex:a?-1:0,spellCheck:!0,onFocus:()=>{N.current=e},onBlur:()=>{e!==N.current&&S?.(e),N.current=e},onKeyDown:t=>{if("Escape"===t.key)return t.preventDefault(),k?.(N.current),void(N.current=e);"Enter"!==t.key||o||(t.preventDefault(),e!==N.current&&S?.(e),N.current=e)},onCompositionStart:()=>{const e=R()??[0,0];D.current={from:e[0],to:e[1]}},onCompositionEnd:e=>{const t=D.current;if(D.current=null,!t)return;const{value:n,rules:r,pending:l}=T.current;e.data?F(f(n,r,t.from,t.to,{text:e.data,add:l?.add,drop:l?.drop,color:l?.color}),[t.from,t.to],"type"):O(e=>e+1)},onCopy:e=>B(e),onCut:e=>B(e,!0),onPaste:t=>{if(t.preventDefault(),a)return;const n=R();if(!n)return;const r=t.clipboardData.getData(g),s=r?o?r:r.replace(/\s*\r?\n\s*/g," "):m({html:t.clipboardData.getData("text/html"),text:t.clipboardData.getData("text/plain")},{doc:t.currentTarget.ownerDocument,multiline:o,rules:l});F(f(e,l,n[0],n[1],{markup:s}),n,"edit")}})]})}var Le={fontSize:{key:"fontSize",nameKey:"fontSize",icon:/* @__PURE__ */Q(re,{}),unit:"px",step:1,shiftStep:10,min:5},lineHeight:{key:"lineHeight",nameKey:"lineHeight",icon:/* @__PURE__ */Q(ne,{}),unit:"%",step:1,shiftStep:10,min:50,max:250,scale:100},letterSpacing:{key:"letterSpacing",nameKey:"letterSpacing",icon:/* @__PURE__ */Q(te,{}),unit:"px",step:.1,shiftStep:1,min:-10},paragraphSpacing:{key:"paragraphSpacing",nameKey:"paragraphSpacing",icon:/* @__PURE__ */Q(ee,{}),unit:"px",step:1,shiftStep:10,min:0}};function Oe(e,t){return void 0===e?void 0:Number((e*t).toFixed(6))}function Te({cells:e,words:t,readOnly:n=!1}){const r=t??v.cells,l=j();/* @__PURE__ */
|
|
4
|
+
return Q("div",{className:"es-copy-cells-fit",children:/* @__PURE__ */Q("div",{className:"es-copy-cells",children:e.map(e=>{const t=e.scale??1,o=e.name??(e.nameKey?r[e.nameKey]:e.key),a=e.unit??"",s=e.step??1,c=`${l}-${e.key}`;/* @__PURE__ */
|
|
5
|
+
return Z("div",{className:"es-copy-cell",children:[
|
|
6
|
+
/* @__PURE__ */Q("label",{className:"es-field-label es-copy-cell-name",htmlFor:c,children:o}),
|
|
7
|
+
/* @__PURE__ */Q(b,{id:c,value:Oe(e.value,t),styleValue:Oe(e.styleValue,t),onChange:n=>e.onChange(void 0===n?void 0:Number((n/t).toFixed(6))),min:e.min,max:e.max,step:s,shiftStep:e.shiftStep,icon:e.icon,unit:a||void 0,steppers:"compact",readOnly:n,ariaLabel:o,title:r.tip({name:o,step:s,unit:a})})]},e.key)})})})}function Re({target:e,onChange:t}){const n=H(null);return M(()=>{const t=n.current,r=e.current;t&&r&&r.value===t.text&&(n.current=null,r.focus(),r.setSelectionRange(t.start,t.end))}),r=>{const l=r(e.current);t(l.text),n.current={start:l.selectionStart,end:l.selectionEnd,text:l.text}}}var He=/* @__PURE__ */new Set([...F,"clear"]);function Ke(e){if(!e)return;const t=e.split("+"),n=t.pop().toUpperCase();return["Meta",...t.map(e=>e[0].toUpperCase()+e.slice(1)),n].join("+")}function Me({tools:e,onApply:t,disabled:n=!1,actions:r,ariaLabel:l,pressed:o,open:a=null}){const s=C("copy",v),c=("string"==typeof e[0]?e:e.map(e=>e.style)).filter(e=>!He.has(e));/* @__PURE__ */
|
|
8
|
+
return Q(D,{"aria-label":l??s.formatting,offered:new Set(c),pressed:o??{},onMark:e=>t(e),linkOpen:"link"===a,list:c.includes("bullet")||c.includes("number")?{pressed:null,onList:e=>t(e)}:void 0,last:r,disabled:n})}function Pe({value:e,onChange:t,onCommit:n,onCancel:r,multiline:h=!1,placeholder:f,ariaLabel:g,className:y,readOnly:b=!1,rules:S,tools:x=[],writeMark:w,align:T,actions:R,toolbar:F,barLabel:ee,renderFooter:te,inputRef:ne,barShows:re="always",richText:le=!0,defaultShowMarks:oe=!1,colors:ae,cells:se,letterCase:ce,lastTool:ie}){const ue=C("copy",v),de=H(null),pe=ne??de,[me,he]=K(!1),[fe,ge]=K(null),ye=H(l()).current,ve=H(null);P(()=>{const t=ve.current;t&&e===t.to?ve.current=null:t&&e===t.from||(ve.current=null,ye.reset())},[e,ye]);const be=n=>{ve.current={from:ve.current?.from??e,to:n},t(n)},Se=t=>({text:e,start:t?.selectionStart??fe?.start??e.length,end:t?.selectionEnd??fe?.end??e.length}),[ke,Ee]=K(oe),Ce=le&&!(h&&ke),De=H(null),Le=j(),[Oe,Ke]=K(null),[Me,Pe]=K(!1),je=()=>{if(!Ce)return pe.current;const e=De.current?.getSource()??fe;return e?{selectionStart:e.start,selectionEnd:e.end}:null},Fe=Re({target:pe,onChange:be}),Be=e=>(ge({start:e.selectionStart,end:e.selectionEnd}),e),$e=(t,n)=>{if(!Ce)return void Fe(e=>(n&&ye.record(Se(e),"edit",Date.now()),Be(t(e))));const r=je(),l=Be(t(r));n&&ye.record(Se(r),"edit",Date.now()),Ke(null),l.text!==e&&be(l.text),De.current?.setSource(l.selectionStart,l.selectionEnd,l.text)},Ve=e=>$e(e,!0),ze=e=>$e(t=>{const n=Se(t),r=ye[e](n);return r?{text:r.text,selectionStart:r.start,selectionEnd:r.end}:{text:n.text,selectionStart:n.start,selectionEnd:n.end}},!1),Ue=H(null);M(()=>{const t=Ue.current;t&&(Ue.current=null,Ce?De.current?.setSource(t.start,t.end,e):(pe.current?.focus(),pe.current?.setSelectionRange(t.start,t.end),ge(t)))},[Ce]);const[We,Ae]=K(null),Ye=S??V,Ie=("string"==typeof x[0]?x:x.map(e=>e.style)).filter(e=>!He.has(e)),Ge={};if(fe){const t=$(e,fe.start,fe.end,Ye);for(const e of Ie){const n=t.has(e)||"highlight"===e&&t.has("accent");Ge[e]=!!Oe?.add.includes(e)||!Oe?.drop.includes(e)&&n}Ge.link=t.has("link")}const qe=()=>{const t=je(),n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}},_e=t=>{if("link"!==t&&W(0,t)){const{start:n,end:r}=qe();if(n===r&&!Ce)return void Ve(n=>xe(e,t,n,(e,t,n,r)=>B(e,t,n,r,Ye,ue.placeholders)));const l=p({value:e,rules:Ye,start:n,end:r,style:t,pending:Oe});return void("pending"===l.kind?Ke(l.pending):Ve(()=>l.result))}if("link"!==t){const n=w??((e,t,n,r)=>B(e,t,n,r,V,ue.placeholders));return void Ve(r=>xe(e,t,r,n))}const n=je(),r=n?.selectionStart??e.length,l=n?.selectionEnd??r;Pe(!1),Ae({start:r,end:l,link:A(e,r,l)})},Xe=Boolean(fe&&fe.start!==fe.end),Ze=fe?z(e,fe.start,fe.end,Ye):null,Qe=fe?Oe&&void 0!==Oe.color&&Oe.at===fe.start?Oe.color:U(e,fe.start,fe.end,Ye):null,Je=o(Qe,ae),et=t=>{Ce?t?De.current?.setSource(t.start,t.end,e):De.current?.focus():(pe.current?.focus(),t&&pe.current?.setSelectionRange(t.start,t.end))},tt=()=>{const e=We;Ae(null),et(e?{start:e.start,end:e.end}:fe)},nt=()=>{const e=lt.current,t=Boolean(e&&e.querySelector(".es-copy-colors")?.contains(e.ownerDocument.activeElement));Pe(!1),t&&et(fe)},rt=H(nt);rt.current=nt,P(()=>{if(Me)return N(e=>{const t=lt.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&(rt.current(),!0)},()=>lt.current?.querySelector(".es-copy-colors"))},[Me]);const lt=H(null),ot=Me||null!==We;P(()=>{const e=lt.current;if(!ot||!e)return;const t=e.ownerDocument,n=()=>{Pe(!1),Ae(null)},r=t=>{e.contains(t.target)||n()};let l;const o=r=>{const o=r.relatedTarget;o?e.contains(o)||n():(clearTimeout(l),l=setTimeout(()=>{const r=t.activeElement;t.hasFocus()&&r&&r!==t.body&&!e.contains(r)&&n()},0))};return t.addEventListener("pointerdown",r,!0),e.addEventListener("focusout",o),()=>{clearTimeout(l),t.removeEventListener("pointerdown",r,!0),e.removeEventListener("focusout",o)}},[ot]);const at=We??(Me?fe??{start:e.length,end:e.length}:null),st=H(()=>{});st.current=()=>{const e=lt.current,t=e?.querySelector(".rosh-tb-wrap > .es-copy-pop");if(!e||!t||!at)return;const n=Ce?null:e.querySelector(".es-gold-layer"),r=Ce?De.current?.rangeOf(at.start,at.end)??null:n?a(n,at.start,at.end):null,l=r?.endContainer,o=l?1===l.nodeType?l:l.parentElement:null,d=r?s(r,o?.closest(".es-rich-line, .es-gold-layer")??null):null;if(!d)return;const p=c({anchor:d,size:{width:t.offsetWidth,height:t.offsetHeight},within:e.getBoundingClientRect(),clip:u(e),parent:i(t)});t.style.top=`${p.top}px`,t.style.left=`${p.left}px`,t.style.setProperty("--es-pop-point",`${p.point}px`),t.dataset.side=p.above?"above":"below"},M(()=>{const e=lt.current;if(!ot||!e)return;const t=()=>st.current();t();const n=e.ownerDocument.defaultView;n?.addEventListener("resize",t);const r=e.querySelector(".rosh-tb-wrap > .es-copy-pop"),l=n?.ResizeObserver,o=l&&r?new l(t):null;return o&&r&&o.observe(r),()=>{n?.removeEventListener("resize",t),o?.disconnect()}},[ot,Me,We,at?.start,at?.end,Ce]);const ct="always"===re||me||null!==We||Me,it=ae&&ae.length>0?{run:Je,open:Me,onToggle:()=>{Ae(null),Me?nt():Pe(!0)}}:void 0,ut=ct?ie?ie({className:"rosh-tb-btn",disabled:b,selected:Xe,keepCaret:e=>e.preventDefault(),insert:t=>Ve(n=>we(e,t,n))}):"classic"===F?R:void 0:void 0,dt=new Set(Ie),pt=T?{value:T.value,allow:T.allow,onChange:T.onChange,disabled:T.disabled}:void 0,mt={pressed:Ze,onList:t=>{const{start:n,end:r}=qe(),l=z(e,n,r,Ye);Ve(()=>I(e,n,r,l===t?null:t,Ye))}},ht=L({offered:dt,color:it,last:ut,alignment:pt,list:mt,letterCase:ce});/* @__PURE__ */
|
|
9
|
+
return Z("div",{ref:lt,className:"es-copy"+(y?` ${y}`:""),onFocus:()=>he(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||he(!1)},onKeyDown:e=>{const t=e.target===pe.current||Boolean(e.target.closest?.(".es-rich"));if(b||!t)return;if(e.altKey||e.metaKey===e.ctrlKey)return;const n=e.key.toLowerCase(),r="KeyZ"===e.code||"z"===n,l=("KeyY"===e.code||"y"===n)&&!e.shiftKey;if(r||l)return e.preventDefault(),e.stopPropagation(),void ze(l||e.shiftKey?"redo":"undo");const o={b:"bold",i:"italic",u:"underline",k:"link"}[`${e.shiftKey?"shift+":""}${n}`];o&&Ie.includes(o)&&(e.preventDefault(),e.stopPropagation(),_e(o))},onPaste:t=>{const n=pe.current;if(b||!n||t.target!==n)return;t.preventDefault();const r=m({html:t.clipboardData.getData("text/html"),text:t.clipboardData.getData("text/plain")},{doc:n.ownerDocument,multiline:h,rules:Ye});Ve(t=>we(e,r,t))},style:ae&&ae.length>0?Object.fromEntries(ae.map(e=>[`--es-color-${e.name}`,e.value])):void 0,onSelect:()=>{const t=pe.current;t&&t.ownerDocument.activeElement===t&&ge({start:t.selectionStart??e.length,end:t.selectionEnd??e.length})},children:[ct&&(ht.words||ht.paragraph)?
|
|
10
|
+
/* @__PURE__ */Q(D,{className:"es-copy-toolbar","aria-label":ee??ue.formatting,offered:dt,pressed:Ge,onMark:e=>_e(e),color:it,linkOpen:null!==We,last:ut,alignment:pt,list:mt,letterCase:ce,disabled:b,windows:/* @__PURE__ */Z(J,{children:[Me&&ae&&ae.length>0?/* @__PURE__ */Q(d,{colors:ae,current:Qe,words:ue.colors??v.colors,onPick:t=>{const{start:n,end:r}=qe();if(n!==r)Ve(()=>Y(e,n,r,t,Ye));else{if(!Ce)return;Ke({add:Oe?.add??[],drop:Oe?.drop??[],color:t,at:n})}}}):null,We?We&&/* @__PURE__ */Q(O,{className:"es-copy-link es-copy-pop",value:We.link?.href??"",onApply:t=>{const n=We;Ae(null),Ve(()=>Ce?_(e,n.start,n.end,t,Ye):X(e,n.start,n.end,t))},onRemove:We.link?()=>{const t=We.link,n=We;Ae(null),t&&Ve(()=>Ce?G(e,n.start,n.end,Ye):q(e,t))}:void 0,onCancel:tt}):null]})}):null,se&&se.length>0?/* @__PURE__ */Q(Te,{cells:se,words:ue.cells??v.cells,readOnly:b}):null,Ce?/* @__PURE__ */Q(Ne,{value:e,rules:Ye,multiline:h,readOnly:b,placeholder:f,ariaLabel:g,handle:De,pending:Oe??void 0,onEdit:(t,n,r)=>{ye.record({text:e,start:n.start,end:n.end},r,Date.now()),Ke(null),be(t)},onSelect:e=>{ge(t=>t&&t.start===e.start&&t.end===e.end?t:e),!Oe||e.start===Oe.at&&e.end===Oe.at||Ke(null)},onHistory:ze,onFormat:e=>{Ie.includes(e)&&_e(e)},onCommit:n,onCancel:r}):/* @__PURE__ */Q(E,{value:e,onInput:e=>{ye.record(Se(null),"type",Date.now()),be(e)},onCommit:n,onCancel:r,multiline:h,placeholder:f,ariaLabel:g,rules:S,disabled:b,inputRef:pe,className:"es-copy-box"}),te?te({focused:me,insert:t=>Ve(n=>we(e,t,n))}):null,le&&h?
|
|
11
|
+
/* @__PURE__ */Z("div",{className:"es-copy-marks",children:[
|
|
12
|
+
/* @__PURE__ */Q(k,{checked:ke,onChange:()=>{const e=je();Ue.current=e&&null!==e.selectionStart&&null!==e.selectionEnd?{start:e.selectionStart,end:e.selectionEnd}:fe,Ke(null),Ee(e=>!e)},ariaLabelledBy:Le,disabled:b}),
|
|
13
|
+
/* @__PURE__ */Q("span",{id:Le,className:"es-copy-marks-label",children:ue.showMarks??"Show marks"})]}):null]})}var je=["left","center","right","justify"],Fe=v.align,Be={left:/* @__PURE__ */Q(se,{}),center:/* @__PURE__ */Q(ae,{}),right:/* @__PURE__ */Q(oe,{}),justify:/* @__PURE__ */Q(le,{})},$e={three:{labelsPx:94.5,widestLabelPx:39.94},four:{labelsPx:140,widestLabelPx:44}};function Ve(e,t=Fe){return je.filter(t=>e.includes(t)).map(e=>({id:e,label:t[e],icon:Be[e],title:t[e]}))}var ze=["none","bullet","number"],Ue=e,We={none:/* @__PURE__ */Q(ge,{}),bullet:/* @__PURE__ */Q(fe,{}),number:/* @__PURE__ */Q(he,{})},Ae={none:/* @__PURE__ */Q(Se,{}),upper:/* @__PURE__ */Q(be,{}),capitalize:/* @__PURE__ */Q(ve,{}),lower:/* @__PURE__ */Q(ye,{})};function Ye({label:e,icon:t,answers:n,names:r,glyphs:l,row:o,readOnly:a}){const s=o.value||o.styleValue||"";/* @__PURE__ */
|
|
14
|
+
return Q(x,{label:e,icon:t,children:/* @__PURE__ */Q(w,{ariaLabel:e,value:s,disabled:a,onChange:e=>{a||o.onChange(function(e,t){return t===e.value||""===e.value&&t===e.styleValue?"":t}(o,e))},options:n.map(e=>({id:e,label:l[e],title:r[e]}))})})}function Ie({kept:e,keptHint:t,readOnly:n=!1,style:r,font:l,italic:o,cells:a,align:s,list:c,letterCase:i}){const u=C("copy",v),d={...v.panel,...u.panel},p=u.clearStyle??v.clearStyle,m=r&&!n?[r.onClearChanges&&{label:p,onSelect:r.onClearChanges},r.onEditStyles&&{label:d.editStyles,onSelect:r.onEditStyles},r.onUpdateStyle&&{label:d.updateStyle,onSelect:r.onUpdateStyle}].filter(e=>!!e):[],h=!!o&&(o.value??o.styleValue??!1),f=o?/* @__PURE__ */Q(T,{content:d.italic,children:/* @__PURE__ */Q(R,{size:"sm",variant:"ghost","aria-label":d.italic,"aria-pressed":h,disabled:n,onClick:()=>{if(n)return;const e=!h;o.onChange(e===(o.styleValue??!1)?void 0:e)},children:/* @__PURE__ */Q(me,{})})}):null;/* @__PURE__ */
|
|
15
|
+
return Z("div",{className:"es-tpp",children:[e?/* @__PURE__ */Z("div",{className:"es-tpp-kept",children:[
|
|
16
|
+
/* @__PURE__ */Q(Pe,{...e,readOnly:n||e.readOnly}),t?/* @__PURE__ */Q("p",{className:"es-field-hint",children:t}):null]}):null,r?/* @__PURE__ */Q(x,{label:d.style,icon:/* @__PURE__ */Q(ce,{}),children:/* @__PURE__ */Q(S,{ariaLabel:d.style,value:r.value,options:r.options,onChange:r.onChange,changed:r.changed,footer:m,readOnly:n})}):null,l?/* @__PURE__ */Q(x,{label:d.font,icon:/* @__PURE__ */Q(ie,{}),children:/* @__PURE__ */Z("div",{className:"es-tpp-font",children:[
|
|
17
|
+
/* @__PURE__ */Q("div",{className:"es-tpp-font-select",children:/* @__PURE__ */Q(S,{ariaLabel:d.font,value:l.value||void 0,placeholder:l.styleValue,options:l.options,onChange:l.onChange,searchable:l.searchable,readOnly:n})}),f]})}):f?
|
|
18
|
+
/* @__PURE__ */Q(x,{label:d.italic,icon:/* @__PURE__ */Q(ie,{}),children:/* @__PURE__ */Q("div",{className:"es-tpp-font",children:f})}):null,a?.length?/* @__PURE__ */Q(Te,{cells:a,words:u.cells,readOnly:n}):null,s?/* @__PURE__ */Q(Ye,{label:u.alignment,icon:/* @__PURE__ */Q(ue,{}),answers:je.filter(e=>!s.allow||s.allow.includes(e)),names:u.align,glyphs:Be,row:s,readOnly:n}):null,c?/* @__PURE__ */Q(Ye,{label:d.list,icon:/* @__PURE__ */Q(de,{}),answers:ze,names:d.lists,glyphs:We,row:c,readOnly:n}):null,i?/* @__PURE__ */Q(Ye,{label:d.capitalization,icon:/* @__PURE__ */Q(pe,{}),answers:Ue,names:d.cases,glyphs:Ae,row:i,readOnly:n}):null]})}export{je as COPY_ALIGNS,$e as COPY_ALIGN_FIT,Be as COPY_ALIGN_GLYPHS,Fe as COPY_ALIGN_LABELS,Le as COPY_CELLS,Pe as CopyBox,Te as CopyCells,Me as MarkBar,Ne as RichBox,Ie as TextPartPanel,Ke as ariaShortcut,Ve as copyAlignOptions,we as insertSelection,xe as markSelection,Re as useCaretEdit};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { PreviewDevice, PreviewDeviceContext, usePreviewDevice } from '../screen/components/PreviewDeviceContext.js';
|
|
2
|
+
export { PreviewPartsProvider, usePreviewParts } from '../screen/components/PreviewPartsContext.js';
|
|
3
|
+
export { PreviewIdSelection, createPreviewSelectionContext, useSelectHandler } from '../screen/lib/puck/preview-selection-context.js';
|
|
4
|
+
export { default as UiIcon, UiIconName } from '../screen/components/UiIcon.js';
|
|
5
|
+
import 'react';
|
|
6
|
+
import '../screen/lib/content/view-tiers.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{UiIcon}from"../chunk-OG2SKSSK.js";export{PreviewPartsProvider,usePreviewParts}from"../chunk-I54UCYOU.js";export{createPreviewSelectionContext,useSelectHandler}from"../chunk-GOTN2KY4.js";import"../chunk-R5L2E7JX.js";export{PreviewDeviceContext,usePreviewDevice}from"../chunk-BSPCSC45.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { HidableValue, hidableText, readHidable } from '../screen/lib/puck/hidable.js';
|
|
2
|
+
export { PART_SEP, decodePartId, encodePartId } from '../screen/lib/puck/part-id.js';
|
|
3
|
+
export { ANCHOR_FIELD_KEYS, EdgeCell, FOLD_FIELD_MARKER, FoldFieldMeta, LINK_FIELD_MARKER, MEDIA_FIELD_MARKER, SCAFFOLD_FIELD_MARKER, TEXT_FIELD_MARKER, TextFieldMeta, TextListRendering, foldMetaOf, textFieldIdentifier } from '../screen/lib/puck/field-markers.js';
|
|
4
|
+
export { SCALAR_TEXT_CONTROLS, ScalarTextControlKind, TEXT_CONTROL_KINDS, TextControlKind } from '../screen/lib/puck/text-control-kinds.js';
|
|
5
|
+
export { RowNameRule, rootRowName, sectionRenameProp, slotChildName, slotChildRenameProp, slotChildRowName } from '../screen/lib/puck/slot-child-name.js';
|
|
6
|
+
export { FOOTER_TYPE, HEADER_TYPE, NodeLocation, ROOT_ZONE, SlotConfigView, TREE_MAX_DEPTH, TreeItem, blockNodeActions, childSlotsOf, locateNode, missingPinnedTypes, nestsInTree, newNodeId, pinnedDuplicateIds, pinnedDuplicateIndices, slotChildrenIn, slotFieldsOf } from '../screen/lib/puck/content-tree.js';
|
|
7
|
+
export { VIEW_DESKTOP_MIN, VIEW_TABLET_MIN, VIEW_TIERS, VIEW_TIER_LABEL, ViewTier, viewTierForWidth } from '../screen/lib/content/view-tiers.js';
|
|
8
|
+
export { HERO_SLIDER_GOTO_EVENT, HeroSliderGotoDetail } from '../screen/lib/puck/preview-events.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{SCALAR_TEXT_CONTROLS,TEXT_CONTROL_KINDS}from"../chunk-PIND6KE7.js";export{VIEW_DESKTOP_MIN,VIEW_TABLET_MIN,VIEW_TIERS,VIEW_TIER_LABEL,viewTierForWidth}from"../chunk-DWIOHQG7.js";export{HERO_SLIDER_GOTO_EVENT}from"../chunk-IQ5TA7AM.js";export{rootRowName,sectionRenameProp,slotChildName,slotChildRenameProp,slotChildRowName}from"../chunk-TBF5CVPA.js";export{ANCHOR_FIELD_KEYS,FOLD_FIELD_MARKER,LINK_FIELD_MARKER,MEDIA_FIELD_MARKER,SCAFFOLD_FIELD_MARKER,TEXT_FIELD_MARKER,foldMetaOf,textFieldIdentifier}from"../chunk-DUVRZ456.js";export{hidableText,readHidable}from"../chunk-6W7WLPZH.js";export{PART_SEP,decodePartId,encodePartId}from"../chunk-IYT6NN2J.js";export{FOOTER_TYPE,HEADER_TYPE,ROOT_ZONE,TREE_MAX_DEPTH,blockNodeActions,childSlotsOf,locateNode,missingPinnedTypes,nestsInTree,newNodeId,pinnedDuplicateIds,pinnedDuplicateIndices,slotChildrenIn,slotFieldsOf}from"../chunk-PLVEGYK6.js";
|
package/dist/easel/index.d.ts
CHANGED
|
@@ -8,11 +8,11 @@ import { c as ResolveTrigger, a as ResolveCache, R as ResolvableItem } from '../
|
|
|
8
8
|
import * as react from 'react';
|
|
9
9
|
import { ReactNode, CSSProperties, ComponentType, ReactElement } from 'react';
|
|
10
10
|
import { TextToolbarProps } from 'efficient-shell/ui';
|
|
11
|
-
import { C as CopyBoxLastTool, a as CopyThemeColor, b as CanvasTypingEnd } from '../canvas-typing-
|
|
11
|
+
import { C as CopyBoxLastTool, a as CopyThemeColor, b as CanvasTypingEnd } from '../canvas-typing-CC0wA-ys.js';
|
|
12
12
|
import { InlineRule } from 'efficient-shell/markup';
|
|
13
13
|
import { b as NodeOpsHost, C as ClipboardEntry } from '../useNodeOps-BHRkUFfG.js';
|
|
14
14
|
import { I as InspectorFields } from '../types-Dkx1VAIQ.js';
|
|
15
|
-
import '../words-
|
|
15
|
+
import '../words-CiuKuiy0.js';
|
|
16
16
|
import '../buckets-Tj-nkBpg.js';
|
|
17
17
|
|
|
18
18
|
interface EaselOptions<C extends EaselConfig = EaselConfig> {
|
package/dist/easel/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{CanvasFrame,CanvasPassThroughContext,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useSelectedFields,validSelection}from"../chunk-
|
|
1
|
+
export{CanvasFrame,CanvasPassThroughContext,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useSelectedFields,validSelection}from"../chunk-PVAIOBBE.js";import"../chunk-TBY3DFKS.js";import"../chunk-ECM5F6JJ.js";import"../chunk-YRLPFZW3.js";import"../chunk-NY7HHUGB.js";import"../chunk-33C6ALT5.js";import"../chunk-MFIRYGHW.js";import"../chunk-ILXP5VX5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
|
package/dist/fields/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-
|
|
1
|
+
export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-BPZQ7S2Z.js";export{FieldSlider}from"../chunk-XWFH2NHZ.js";import"../chunk-4JSBIW5H.js";import"../chunk-K56YDHYQ.js";import"../chunk-EA2HTX37.js";import"../chunk-RC25EGHD.js";import"../chunk-KFV7N2DJ.js";export{useResolvedFields}from"../chunk-YRLPFZW3.js";export{FieldNumber}from"../chunk-2XMHLXMA.js";export{FieldSelect,optionFor}from"../chunk-G3GWAP5R.js";import"../chunk-WRFD4EXD.js";import"../chunk-36LVP5WD.js";import"../chunk-MFIRYGHW.js";import"../chunk-67GNT6PF.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
|
package/dist/icons/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export * from 'efficient-shell/icons/efficient';
|
|
2
|
-
export { EfficientIconName as IconName, EfficientIconProps as IconProps
|
|
1
|
+
export * from 'efficient-shell/icons/efficient-glyphs';
|
|
2
|
+
export { EfficientIconName as IconName, EfficientIconProps as IconProps } from 'efficient-shell/icons/efficient-glyphs';
|
|
3
|
+
import 'efficient-shell/icons/efficient-meanings';
|
|
3
4
|
import 'efficient-shell/markup';
|
package/dist/icons/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"efficient-shell/icons/efficient
|
|
1
|
+
export*from"efficient-shell/icons/efficient-glyphs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { efficientIconMeanings as iconMeanings } from 'efficient-shell/icons/efficient-meanings';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{efficientIconMeanings as iconMeanings}from"efficient-shell/icons/efficient-meanings";
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{AddIcon,LayersIcon,MediaIcon,PageIcon as PagesIcon,SitemapIcon,StylesIcon,railCssVars,railTokens}from"./chunk-4VJATVVR.js";export{
|
|
1
|
+
export{SPACING_SCALE,shellCssVars,shellDarkTokens,shellTokens}from"./chunk-HMXIAMCU.js";export{AddIcon,LayersIcon,MediaIcon,PageIcon as PagesIcon,SitemapIcon,StylesIcon,railCssVars,railTokens}from"./chunk-4VJATVVR.js";export{EaselRail,EaselRailButton}from"./chunk-MJM6SFD3.js";import"./chunk-2OAZYSWJ.js";
|
package/dist/panel/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export{DESIGN_GROUPS,SETTINGS_BUCKETS,SettingsGroup}from"../chunk-RC25EGHD.js";import{DEFAULT_PANEL_WORDS as e}from"../chunk-KFV7N2DJ.js";
|
|
1
|
+
export{DESIGN_GROUPS,SETTINGS_BUCKETS,SettingsGroup}from"../chunk-RC25EGHD.js";import{DEFAULT_PANEL_WORDS as e}from"../chunk-KFV7N2DJ.js";export{SettingsField,SettingsSegmented,SettingsSwitch}from"../chunk-36LVP5WD.js";import{withTip as t}from"../chunk-P2VEMZH5.js";import{Tabs as s,CountBadge as i,Tooltip as n}from"efficient-shell/ui";export{BorderInput as SettingsBorder,CornersInput as SettingsCorners,AlignmentGrid as SettingsPlacement,SidesInput as SettingsSides,SidesEachToggle as SettingsSidesEach,borderSides,borderStartEach,sidesStartEach}from"efficient-shell/ui";import{jsx as a,jsxs as l,Fragment as r}from"react/jsx-runtime";import{RevertIcon as d}from"efficient-shell/icons/efficient";function c(e){const t=e[0];if(!t?.htmlId||!t.htmlId.endsWith(`-tab-${t.id}`))return;const s=t.htmlId.slice(0,-`-tab-${t.id}`.length);return e.every(e=>e.htmlId===`${s}-tab-${e.id}`)?s:void 0}function o({items:t,activeId:n,onSelect:d,ariaLabel:o=e.settings,idPrefix:u,className:m}){
|
|
2
2
|
/* @__PURE__ */
|
|
3
3
|
return a("div",{className:"es-tabs-fit",children:/* @__PURE__ */a(s,{variant:"pill","aria-label":o,idPrefix:u??c(t),className:m?`es-tabs ${m}`:"es-tabs",value:n,onChange:d,items:t.map(e=>{const t="number"==typeof e.badge&&e.badge>0?/* @__PURE__ */a(i,{count:e.badge,tone:"accent"}):null;return e.icon?{id:e.id,tooltip:e.label,label:/* @__PURE__ */l(r,{children:[
|
|
4
4
|
/* @__PURE__ */l("span",{className:"es-tab-tip",children:[
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{AddBlockRow as default}from"../../chunk-
|
|
1
|
+
export{AddBlockRow as default}from"../../chunk-TLDRFVD2.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-FZ3Y3QTQ.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-VVPZMWJE.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-PVAIOBBE.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-BPZQ7S2Z.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-EA2HTX37.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-NY7HHUGB.js";import"../../chunk-33C6ALT5.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{blockKey,AddSidePanel as default,sectionKey,templateKey}from"../../chunk-
|
|
1
|
+
export{blockKey,AddSidePanel as default,sectionKey,templateKey}from"../../chunk-YWUHPY5W.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-62VPYC7F.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-FZ3Y3QTQ.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-VVPZMWJE.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-PVAIOBBE.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-BPZQ7S2Z.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-EA2HTX37.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-NY7HHUGB.js";import"../../chunk-33C6ALT5.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-QFVRMARS.js";import"../../chunk-AYWN5NRH.js";import"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{MediaSidePanel as default}from"../../chunk-
|
|
1
|
+
export{MediaSidePanel as default}from"../../chunk-J2JDC3EZ.js";import"../../chunk-FZ3Y3QTQ.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-PVAIOBBE.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-BPZQ7S2Z.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-EA2HTX37.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-NY7HHUGB.js";import"../../chunk-33C6ALT5.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -22,7 +22,8 @@ import '../../panelWidths-D9hTLR25.js';
|
|
|
22
22
|
import '../../CanvasDragLayer-CLb7j-CZ.js';
|
|
23
23
|
import '../../session-DSQFmIvx.js';
|
|
24
24
|
import '../../words-BDignMl_.js';
|
|
25
|
-
import '../../types-
|
|
25
|
+
import '../../types-D8P9q-BG.js';
|
|
26
|
+
import 'efficient-shell/ui';
|
|
26
27
|
import '../../words-Cl9xMUYY.js';
|
|
27
28
|
import './AddSidePanel.js';
|
|
28
29
|
import '../lib/section-template-types.js';
|
|
@@ -35,7 +36,6 @@ import '../../engine-CvXpFE86.js';
|
|
|
35
36
|
import '../lib/admin-bridge.js';
|
|
36
37
|
import '../lib/host-chrome.js';
|
|
37
38
|
import '../lib/links/link-filters.js';
|
|
38
|
-
import 'efficient-shell/ui';
|
|
39
39
|
import '../lib/puck/add-target-types.js';
|
|
40
40
|
import '../lib/puck/slot-section-spec.js';
|
|
41
41
|
import '../lib/backend-error.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{EASEL_NODE_CLIPBOARD,ancestorChain,nodeClipboardOf,nodeClipboardRules,nodeMenuItems,nodeShortcut,pageMenuItems,pastePlace,runNodeShortcut,textMenuItems,useNodeClipboard,useNodeContextMenu}from"../../chunk-
|
|
1
|
+
export{EASEL_NODE_CLIPBOARD,ancestorChain,nodeClipboardOf,nodeClipboardRules,nodeMenuItems,nodeShortcut,pageMenuItems,pastePlace,runNodeShortcut,textMenuItems,useNodeClipboard,useNodeContextMenu}from"../../chunk-NW4LJ4G4.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-VVPZMWJE.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-BXMXTO36.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{PageEditGuardNotices as default}from"../../chunk-
|
|
1
|
+
export{PageEditGuardNotices as default}from"../../chunk-IWFVVCRN.js";import"../../chunk-FBS75I6E.js";import"../../chunk-ERR437B5.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-VVPZMWJE.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-MFIRYGHW.js";
|