efficient-easel 1.1.1 → 2.1.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 +7 -3
- package/dist/chrome/index.js +1 -1
- package/dist/{chunk-ORR3Q4WV.js → chunk-2JIWFFXA.js} +1 -1
- package/dist/{chunk-MAEXP3KE.js → chunk-35Q5HMJZ.js} +1 -1
- package/dist/{chunk-P3GORPR4.js → chunk-4TMMEBAG.js} +1 -1
- package/dist/chunk-4VJATVVR.js +1 -0
- package/dist/chunk-5TRBCPRB.js +5 -0
- package/dist/chunk-6HHHBBSY.js +16 -0
- package/dist/{chunk-EOUMA3QT.js → chunk-6OY2THZH.js} +1 -1
- package/dist/{chunk-THQB37AA.js → chunk-AAT3O7PK.js} +1 -1
- package/dist/{chunk-QR4DLZ3P.js → chunk-BSSKAEFF.js} +1 -1
- package/dist/{chunk-PJP46U5L.js → chunk-FOBGSFFS.js} +8 -8
- package/dist/chunk-HGTPLCTQ.js +1 -0
- package/dist/chunk-HMXIAMCU.js +1 -0
- package/dist/chunk-OSPUG6S6.js +1 -0
- package/dist/chunk-OXYGFK2B.js +21 -0
- package/dist/{chunk-5LGAIELC.js → chunk-RC6DD4XP.js} +3 -3
- package/dist/chunk-TSQUEJZB.js +5 -0
- package/dist/{chunk-DCPFE4IO.js → chunk-UAVNI3BU.js} +1 -1
- package/dist/chunk-UEM66O42.js +64 -0
- package/dist/chunk-V7U33NF2.js +1 -0
- package/dist/{chunk-U4MJQAVH.js → chunk-VB5LRSGJ.js} +1 -1
- package/dist/chunk-VETFIYQR.js +23 -0
- package/dist/{chunk-SQTY6CJD.js → chunk-ZV6OYSZ7.js} +1 -1
- package/dist/copy/index.js +21 -21
- package/dist/drag/index.js +1 -1
- package/dist/easel/index.d.ts +1 -1
- package/dist/fields/index.d.ts +5 -2
- package/dist/fields/index.js +1 -1
- package/dist/icons/index.d.ts +2 -507
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/node-ops/index.js +1 -1
- package/dist/panel/index.js +15 -15
- package/dist/rail/index.d.ts +1 -1
- package/dist/rail/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.js +1 -1
- package/dist/screen/components/PageEditGuardNotices.js +1 -1
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.js +1 -1
- package/dist/screen/components/SectionScreenShell.js +16 -16
- package/dist/screen/components/SidePanelHead.js +1 -1
- package/dist/screen/components/UiIcon.js +2 -2
- package/dist/screen/components/panel-widths.js +1 -1
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/puck/style-clipboard.js +1 -1
- package/dist/screen/lib/puck/use-section-ops.js +1 -1
- package/dist/screen/lib/screen-parts.js +1 -1
- package/dist/shell/index.d.ts +4 -4
- package/dist/shell/index.js +1 -1
- package/dist/shell/shell.css +11 -3
- package/dist/style-clipboard/index.js +1 -1
- package/dist/text-styles/index.js +23 -23
- package/dist/{types-DQp_i3dE.d.ts → types-CWxUxPGO.d.ts} +9 -0
- package/package.json +5 -4
- package/dist/chunk-2LK54I4E.js +0 -1
- package/dist/chunk-57DJOKXT.js +0 -1
- package/dist/chunk-63GQKLJI.js +0 -5
- package/dist/chunk-CG4OPQQX.js +0 -64
- package/dist/chunk-FODNRCCO.js +0 -5
- package/dist/chunk-HMJS344F.js +0 -1
- package/dist/chunk-JLTZQ4US.js +0 -1
- package/dist/chunk-K6ELD7N5.js +0 -23
- package/dist/chunk-L5KW4HG5.js +0 -470
- package/dist/chunk-TJ7YIRWQ.js +0 -21
- package/dist/chunk-W3XX2CNW.js +0 -16
- package/dist/chunk-X6DQWK2C.js +0 -1
package/dist/chunk-TJ7YIRWQ.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import{DEFAULT_NOTICE_WORDS as e,DEFAULT_CHROME_WORDS as n}from"./chunk-ZJEBF4NB.js";import{holderOf as i,describeAge as a,nameOrSomeone as s}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as t}from"./chunk-RE4LP46F.js";import{EaselRail as l}from"./chunk-MJM6SFD3.js";import{DEFAULT_RAIL_WORDS as r}from"./chunk-2OAZYSWJ.js";import{useWords as o}from"./chunk-MFIRYGHW.js";import{PanelLeftIcon as c,PanelRightIcon as d,MediaIcon as u,ImageIcon as h}from"./chunk-L5KW4HG5.js";import{jsx as m,jsxs as v,Fragment as f}from"react/jsx-runtime";import{Tooltip as k,IconButton as p,Segmented as b,Switch as g,ResizeHandle as y,Button as N,Banner as w}from"efficient-shell/ui";function C({children:e}){/* @__PURE__ */
|
|
2
|
-
return m("div",{className:"es-topbar",children:e})}function O({kind:e,style:n,children:i}){/* @__PURE__ */
|
|
3
|
-
return m("div",{className:e?`es-cluster es-cluster--${e}`:"es-cluster",style:n,children:i})}function x(){/* @__PURE__ */
|
|
4
|
-
return m("div",{className:"es-divider-v","aria-hidden":"true"})}function z({items:e,ariaLabel:n,onWords:i}){const a=o("rail",r);/* @__PURE__ */
|
|
5
|
-
return m("div",{className:"es-cluster es-cluster--rail es-rail-fit",children:/* @__PURE__ */m(l,{items:e,ariaLabel:n??a.label,orientation:"row",onLabelsShown:i})})}function B({label:e,onClick:n,disabled:i,state:a,buttonRef:s,children:t}){/* @__PURE__ */
|
|
6
|
-
return m(k,{content:e,side:"bottom",children:/* @__PURE__ */m(p,{ref:s,"aria-label":e,"aria-pressed":a?"active"===a:void 0,className:"es-iconbtn",disabled:i,onClick:n,children:t})})}function L({devices:e,value:i,onChange:a,ariaLabel:s}){const t=o("chrome",n);/* @__PURE__ */
|
|
7
|
-
return m(b,{className:"es-devseg",size:"sm",label:s??t.device,value:i,onChange:e=>{e!==i&&a(e)},options:e.map(e=>({value:e.id,icon:/* @__PURE__ */m(k,{content:e.label,side:"bottom",children:/* @__PURE__ */m("span",{className:"es-devseg-glyph","aria-hidden":"true",children:e.icon})}),label:/* @__PURE__ */m("span",{className:"es-vh",children:e.label})}))})}var R={idle:"is-quiet",saved:"is-quiet is-saved",saving:"is-saving",error:"is-error",off:"is-off","off-unsaved":"is-off is-unsaved"};function W({tone:e,label:n,counting:i,waitMs:a,ringRef:s,role:t}){/* @__PURE__ */
|
|
8
|
-
return v("span",{className:`es-savestate ${R[e]}`,role:t,"aria-live":"polite",children:[/* @__PURE__ */m("span",i?{ref:s,className:"es-savestate-ring is-counting",style:void 0!==a?{"--es-savewait":`${a}ms`}:void 0,"aria-hidden":"true"}:{className:"es-savestate-dot","aria-hidden":"true"}),n]})}function $({pressed:e,title:n,onToggle:i,children:a}){/* @__PURE__ */
|
|
9
|
-
return m("span",{className:"es-savestate-toggle",children:/* @__PURE__ */m(k,{content:n,side:"bottom",children:/* @__PURE__ */m(g,{size:"sm",checked:!e,"aria-label":n,label:a,onChange:()=>i()})})})}function j({side:e,width:i,min:a,max:s,defaultWidth:t,label:l,onResize:r}){const c=o("chrome",n);/* @__PURE__ */
|
|
10
|
-
return m(y,{side:e,width:i,min:a,max:s,defaultWidth:t,label:l,hint:c.resize,onResize:e=>r(e),className:`es-resizer es-resizer--${e}`})}function M({icon:e,name:n,kind:i,actions:a}){/* @__PURE__ */
|
|
11
|
-
return v("div",{className:"es-insp-head",children:[
|
|
12
|
-
/* @__PURE__ */m("span",{className:"es-insp-chip","aria-hidden":"true",children:e}),
|
|
13
|
-
/* @__PURE__ */v("div",{className:"es-insp-titles",children:[
|
|
14
|
-
/* @__PURE__ */m("h2",{className:"es-insp-name",children:n}),
|
|
15
|
-
/* @__PURE__ */m("div",{className:"es-insp-kind",children:i})]}),a?/* @__PURE__ */m("div",{className:"es-insp-actions",children:a}):null]})}function S({label:e,title:n,hasPopup:i,onClick:a,disabled:s,danger:t,expanded:l,buttonRef:r,children:o}){/* @__PURE__ */
|
|
16
|
-
return m(k,{content:n??e,side:"bottom",children:/* @__PURE__ */m(p,{ref:r,variant:t?"ghost-danger":"ghost",className:"es-insp-iconbtn","aria-label":e,"aria-haspopup":i,"aria-expanded":l,disabled:s,onClick:a,children:o})})}function P({name:e,onSelect:i,label:a,inline:s}){const t=o("chrome",n),l=a??t.upLevel,r=/* @__PURE__ */m(k,{content:l,side:"bottom",children:/* @__PURE__ */m(N,{variant:"link",size:"sm",className:"es-insp-up-btn","aria-label":t.upLevelTo({label:l,name:e}),leftIcon:/* @__PURE__ */m("span",{className:"es-insp-up-arrow","aria-hidden":"true",children:"←"}),onClick:i,children:/* @__PURE__ */m("span",{className:"es-insp-up-name",children:e})})});return s?r:/* @__PURE__ */m("div",{className:"es-insp-up",children:r})}function F({context:e,pick:i,onCancel:a,onHide:s,side:t="left"}){const l=o("chrome",n),r=s?/* @__PURE__ */m(S,{label:l.hidePanelLabel({side:t}),title:l.hidePanel,onClick:s,children:/* @__PURE__ */m("left"===t?c:d,{size:16})}):null;if(!i)/* @__PURE__ */
|
|
17
|
-
return m(M,{icon:/* @__PURE__ */m(u,{}),name:l.mediaLibrary,kind:e,actions:r??void 0});const p=l.mediaKinds[i.kind];/* @__PURE__ */
|
|
18
|
-
return m(M,{icon:/* @__PURE__ */m(h,{size:15}),name:l.mediaChoose({kind:p}),kind:i.field?l.mediaFor({field:i.field}):e,actions:/* @__PURE__ */v(f,{children:[
|
|
19
|
-
/* @__PURE__ */m(k,{content:l.mediaKeep({kind:p}),side:"bottom",children:/* @__PURE__ */m(N,{variant:"secondary",size:"sm",className:"es-insp-textbtn",onClick:a,children:l.mediaCancel})}),r?/* @__PURE__ */v(f,{children:[
|
|
20
|
-
/* @__PURE__ */m("span",{className:"es-insp-divider","aria-hidden":"true"}),r]}):null]})})}function H(e){return/svg/i.test(e)?"svg":e.startsWith("video")?"video":"image"}var T={notice:e,lock:t};function Y(e,n,t,l=T){const r=l.notice,o=i(e),c={kind:"reload",label:r.reload};if(n){const e=a(n.secondsAgo,l.lock);return{tone:"warning",urgent:!0,lead:n.savedByYou?r.savedByYou({noun:t,when:e}):r.savedByOther({name:s(n.savedBy,l.lock),noun:t,when:e}),body:r.conflictBody,actions:o?[c,{kind:"take-over",label:r.takeOver,title:r.takeOverWhileDeciding}]:[c]}}if(!o)return null;const d=s(o.name,l.lock),u=a(o.secondsSinceSeen,l.lock);switch(e.kind){case"takenover":return{tone:"warning",urgent:!0,lead:r.tookOver({name:d,noun:t,when:a(o.secondsSinceHeld,l.lock)}),body:r.tookOverBody,actions:[{kind:"take-back",label:r.takeBack},c]};case"readonly":return{tone:"neutral",urgent:!1,lead:r.viewingOnly,body:r.viewingOnlyBody({name:d,noun:t,seen:u}),actions:[{kind:"take-over",label:r.takeOver}]};default:return{tone:"warning",urgent:!1,lead:r.editing({name:d,noun:t}),body:r.editingBody({seen:u}),actions:[{kind:"view-read-only",label:r.viewReadOnly},{kind:"take-over",label:r.takeOver,title:r.takeOverTold}]}}}function J({access:n,conflict:i,noun:a,onTakeOver:s,onViewReadOnly:l,onReload:r}){const c=Y(n,i,a,{notice:o("notice",e),lock:o("lock",t)});if(!c)return null;const d={reload:r,"take-over":s,"take-back":s,"view-read-only":l},u=c.actions.map(e=>e.title?/* @__PURE__ */m(k,{content:e.title,side:"bottom",children:/* @__PURE__ */m(N,{variant:"secondary",size:"sm",onClick:d[e.kind],children:e.label})},e.kind):/* @__PURE__ */m(N,{variant:"secondary",size:"sm",onClick:d[e.kind],children:e.label},e.kind));/* @__PURE__ */
|
|
21
|
-
return m("div",{className:`es-notice is-${c.tone}`,role:c.urgent?"alert":"status",children:/* @__PURE__ */m(w,{tone:"warning"===c.tone?"warning":"info",title:c.lead,action:/* @__PURE__ */m("span",{className:"es-notice-actions",children:u}),children:c.body})})}var K={left:288,right:320},Z=220,q=560;function A(e){return Math.min(560,Math.max(220,Math.round(e)))}function D(e){return{"--es-left-w":`${e.left}px`,"--es-right-w":`${e.right}px`}}function E(e,n){e.style.setProperty("--es-left-w",`${n.left}px`),e.style.setProperty("--es-right-w",`${n.right}px`)}export{K as DEFAULT_PANEL_W,L as DeviceSwitch,B as EaselIconButton,C as EaselTopBar,J as EditNotice,M as InspectorHead,S as InspectorIconButton,P as InspectorUpLevel,q as MAX_PANEL_W,Z as MIN_PANEL_W,F as MediaPanelHead,j as PanelResizeHandle,W as SaveState,$ as SaveStateToggle,O as TopBarCluster,x as TopBarDivider,z as TopBarRail,A as clampPanelWidth,Y as editNotice,H as mediaPickKind,D as panelWidthVars,E as setPanelWidthVars};
|
package/dist/chunk-W3XX2CNW.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{DEFAULT_DRAG_WORDS as e}from"./chunk-O2NLQBFX.js";import{dropEffectFor as t,scrollBoxOf as n,frameScrollBox as l,startAutoScroll as r,isNoOpDrop as a}from"./chunk-67GNT6PF.js";import{useCanvasLayout as o,useCanvasEvent as s}from"./chunk-PAELDYYS.js";import{framePointToHost as i,elementScale as c,frameRectToLayer as d,clientPointToLayer as u}from"./chunk-ZNCEOSXO.js";import{withTip as h}from"./chunk-P2VEMZH5.js";import{CloseIcon as p,SearchIcon as f}from"./chunk-L5KW4HG5.js";import{parseZoneKey as m}from"./chunk-KRXQM65X.js";import{useRef as b,useEffect as g,useState as y,useCallback as v,useMemo as x,useSyncExternalStore as k,useId as w,useLayoutEffect as N}from"react";import{Tooltip as A}from"efficient-shell/ui";import{jsxs as D,jsx as z}from"react/jsx-runtime";var T=(e,t,n)=>t>=e.left&&t<=e.left+e.width&&n>=e.top&&n<=e.top+e.height,C=e=>e.width*e.height;function S(e,t,n){let l=null;for(const r of e)T(r.box,t,n)&&(!l||C(r.box)<=C(l.box))&&(l=r);return l}function E(e,t,n){const l="x"===e.axis?t:n;let r=0;for(const t of e.children){l>("x"===e.axis?t.left+t.width/2:t.top+t.height/2)&&(r+=1)}return r}function $(e,t){const n=e.children;if("x"===e.axis){const l=n[t-1],r=n[t],a=l&&r?(l.left+l.width+r.left)/2:l?l.left+l.width:r?r.left:e.box.left,o=r??l??e.box;return{left:a-1,top:o.top,width:2,height:o.height}}const l=n[t-1],r=n[t],a=l&&r?(l.top+l.height+r.top)/2:l?l.top+l.height:r?r.top:e.box.top;return{left:e.box.left,top:a-1,width:e.box.width,height:2}}function L(e,t,n,l,r=()=>!1,a=()=>!0){const o=e.filter(e=>T(e.box,t,n)).sort((e,t)=>C(e.box)-C(t.box));for(const e of o){const o=E(e,t,n),s={...e.list,index:o};if(r(s))return null;if(l(s))return{zone:e,to:s,line:$(e,o)};if(!a(s))return null}return null}function j(e,t=e.key){const n=[];for(let l=1;l<e.children.length;l++){const r=e.children[l-1],a=e.children[l],o=r.top+r.height;n.push({key:`${t}:${l}`,place:{...e.list,index:l},box:{left:e.box.left,top:o,width:e.box.width,height:Math.max(a.top-o,0)}})}return n}var M={nodes:[],zones:[]},B="data-puck-dropzone",K="data-puck-component";function O(e,t){if(e.length>=2){const[t,n]=e;return Math.abs(n.top-t.top)<Math.min(t.height,n.height)/2&&n.left>t.left?"x":"y"}const n=t.ownerDocument.defaultView?.getComputedStyle(t);return n&&n.display.includes("flex")&&n.flexDirection.startsWith("row")?"x":"y"}function X(e,t){const{frame:n,document:l}=e,r=e=>d(n,function(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top,width:t.width,height:t.height}}(e),t),a=[],o=[];for(const e of l.querySelectorAll(`[${B}]`)){const t=e.getAttribute(B)??"";let n;try{n=m(t)}catch{continue}const l=[...e.querySelectorAll(`[${K}]`)].filter(t=>t.parentElement?.closest(`[${B}]`)===e),s=l.map(r);o.push({key:t,list:n,box:r(e),axis:O(s,e),children:s}),l.forEach((e,t)=>{const l=e.getAttribute(K);l&&a.push({id:l,place:{...n,index:t},box:s[t]})})}return{nodes:a,zones:o}}var q="data-es-empty-cell",P="data-puck-dropzone",Y=140;var Z=e=>({left:e.left,top:e.top,width:e.width,height:e.height});function F(d){const{canvas:h,session:p,readOnly:f,words:m=e.canvas}=d,w=b(d);g(()=>{w.current=d});const T=b(null),C=o(h),[E,$]=y(0),j=v(()=>$(e=>e+1),[]),[B,K]=y(M);g(()=>{const e=T.current;h&&e&&K((w.current.measure??X)(h,e))},[h,C,d.revision,E]);const O=d.model,Y=x(()=>O(B),[O,B]),F=k(p.subscribe,p.shown,p.shown),[R,G]=y(null),[H,Q]=y(null),V=b(null),W=()=>{V.current&&clearTimeout(V.current),V.current=null},I=()=>{W(),V.current=setTimeout(()=>{p.get()||G(null)},140)};g(()=>W,[]);const J=b(null);s(h,"mousemove",e=>{const t=T.current;if(!h||!t)return;const n=i(h.frame,e.clientX,e.clientY,t),l=c(t),r={x:n.x/l,y:n.y/l};if(J.current=r,w.current.readOnly||p.get())return;W();const a=S(Y.sources,r.x,r.y);G(e=>e?.key===a?.key&&e?.box===a?.box?e:a)}),s(h,"mouseout",e=>{e.relatedTarget||(J.current=null,I())}),s(h,"mouseover",e=>{e.relatedTarget||j()});const U=b(null),_=v(()=>{U.current?.(),U.current=null,Q(null)},[]);g(()=>p.subscribe(()=>{p.get()?j():_()}),[p,_,j]),g(()=>_,[_]),("undefined"==typeof document?g:N)(()=>{if(p.get())return;const e=J.current;G(t=>f?null:e?S(Y.sources,e.x,e.y):t?Y.sources.find(e=>e.key===t.key)??null:null)},[Y,F,p,f]);const ee=e=>{const t=p.get(),n=T.current;if(!t||!n)return null;const l=u(n,e.clientX,e.clientY);J.current=l;const r=L(Y.zones,l.x,l.y,e=>w.current.canDrop(t.item,e),e=>!!t.from&&a(t.from,e),e=>w.current.fallThrough?.(t.item,e,t.from)??!0);return r?{h:t,t:r}:null},te={onDragEnter:e=>{if(U.current)return;const t=n(e.currentTarget.parentElement?.parentElement??null),a=h?l(h.document):null,o=[];t&&o.push(r(t)),a&&h&&o.push(r(a,h.frame)),U.current=o.length?()=>o.forEach(e=>e()):null},onDragOver:e=>{const n=ee(e);if(!n)return void Q(null);e.preventDefault(),e.dataTransfer.dropEffect=t(e.dataTransfer.effectAllowed);const l={zoneKey:n.t.zone.key,line:n.t.line,axis:n.t.zone.axis};Q(e=>e&&e.zoneKey===l.zoneKey&&e.line.left===l.line.left&&e.line.top===l.line.top?e:l)},onDragLeave:e=>{const t=e.relatedTarget;t&&e.currentTarget.contains(t)||(J.current=null,Q(null))},onDrop:e=>{const t=ee(e);t&&(e.preventDefault(),p.end(),_(),w.current.onDrop(t.h.item,t.t.to))}},ne={draggable:!f&&!!R,onMouseEnter:W,onMouseLeave:()=>!p.get()&&I(),onDragStart:e=>{if(R&&!f){p.start({key:R.key,item:R.item,from:R.from}),e.dataTransfer.effectAllowed="move";try{e.dataTransfer.setData("text/plain",R.key)}catch{}}else e.preventDefault()},onDragEnd:()=>{p.end(),_()},onClick:()=>{R&&!f&&w.current.onPick?.(R.item)}},{seams:le=[]}=Y,re=Y.zones.filter(e=>0===e.children.length),ae=d.onZoneAdd&&!f?re:[],oe=ae.map(e=>e.key).join("\n");return g(()=>{const e=h?.document;if(!e)return;const t=new Set(oe?oe.split("\n"):[]);for(const n of e.querySelectorAll(`[${P}]`))n.toggleAttribute(q,t.has(n.getAttribute(P)??""));return()=>{for(const t of e.querySelectorAll(`[${q}]`))t.removeAttribute(q)}},[h,oe,B,C,E]),/* @__PURE__ */D("div",{ref:T,className:"es-canvas-layer",children:[F||!d.onSeamAdd||f?null:le.map(e=>/* @__PURE__ */z("div",{className:"es-canvas-seam",style:{left:e.box.left,top:e.box.top+e.box.height/2-8,width:e.box.width,height:16},children:/* @__PURE__ */z("button",{type:"button",className:"es-canvas-seam-add",onClick:()=>d.onSeamAdd?.(e.place),children:m.addButton({label:d.seamLabel??m.addSection})})},e.key)),ae.length?ae.map(e=>/* @__PURE__ */z("button",{type:"button",className:H?.zoneKey===e.key?"es-canvas-empty is-over":"es-canvas-empty",style:Z(e.box),onClick:()=>d.onZoneAdd?.({...e.list,index:0}),children:/* @__PURE__ */z("span",{className:"es-canvas-empty-add",children:m.addButton({label:d.zoneAddLabel??m.addBlock})})},e.key)):null,F?/* @__PURE__ */z("div",{className:"es-canvas-catch",...te}):null,H&&!re.some(e=>e.key===H.zoneKey)?/* @__PURE__ */z("div",{className:`es-canvas-line is-${H.axis}`,style:Z(H.line)}):null,
|
|
2
|
-
/* @__PURE__ */z("div",{className:"es-canvas-handle-spot",style:R?{"--es-handle-x":`${R.box.left+2}px`,"--es-handle-y":`${Math.max(R.box.top-11,0)}px`}:void 0,children:/* @__PURE__ */z(A,{className:"es-canvas-handle-tip",side:"top",content:!R||f||F?null:R.title??m.handle({label:R.label}),children:/* @__PURE__ */D("div",{className:["es-canvas-handle",R&&!f?"is-shown":"",F?"is-dragging":""].filter(Boolean).join(" "),...ne,children:[
|
|
3
|
-
/* @__PURE__ */z("span",{className:"es-canvas-grip","aria-hidden":"true",children:"⋮⋮"}),R?.label]})})})]})}var R=e=>e.tiles.length>0&&e.tiles.every(e=>null!=e.cover);function G({groups:t,session:n,itemFor:l,onInsert:r,at:a,hint:o,searchLabel:s,readOnly:i,words:c=e.add}){const d=o??c.hint,u=s??c.search,[m,b]=y(""),g=w(),v=m.trim().toLowerCase(),x=function(e){const t=/* @__PURE__ */new Map;return e.map(e=>{const n=e.key??e.title,l=t.get(n)??0;return t.set(n,l+1),0===l?n:`${n}\0${l}`})}(t),k=t.map((e,t)=>({...e,key:x[t],tiles:v?e.tiles.filter(e=>((e,t)=>e.label.toLowerCase().includes(t)||(e.keywords??[]).some(e=>e.toLowerCase().includes(t)))(e,v)):e.tiles})).filter(e=>e.tiles.length>0),N=(e,t)=>r=>{if(t)r.preventDefault();else{n.start({key:`new:${e}`,item:l(e)}),r.dataTransfer.effectAllowed="copy";try{r.dataTransfer.setData("text/plain",e)}catch{}}};/* @__PURE__ */
|
|
4
|
-
return D("div",{className:"es-add",children:[a?/* @__PURE__ */D("div",{className:"es-add-at",role:"status",children:[
|
|
5
|
-
/* @__PURE__ */z("span",{children:a.label}),h(c.stop,/* @__PURE__ */z("button",{type:"button",className:"es-add-at-clear","aria-label":c.stop,onClick:a.onClear,children:/* @__PURE__ */z(p,{size:12,"aria-hidden":"true"})}))]}):null,
|
|
6
|
-
/* @__PURE__ */z("p",{className:"es-add-hint",children:d}),
|
|
7
|
-
/* @__PURE__ */D("div",{className:"es-add-search",children:[
|
|
8
|
-
/* @__PURE__ */z(f,{size:16,"aria-hidden":"true"}),
|
|
9
|
-
/* @__PURE__ */z("input",{id:g,type:"search","aria-label":u,placeholder:c.searchPlaceholder({label:u}),value:m,onChange:e=>b(e.target.value)}),m?/* @__PURE__ */z("button",{type:"button",className:"es-add-search-clear","aria-label":c.clearSearch,onClick:()=>b(""),children:/* @__PURE__ */z(p,{size:12,"aria-hidden":"true"})}):null]}),0===k.length?/* @__PURE__ */D("div",{className:"es-add-empty",role:"status",children:[
|
|
10
|
-
/* @__PURE__ */z("div",{className:"es-add-empty-title",children:c.nothing({query:m.trim()})}),
|
|
11
|
-
/* @__PURE__ */z("div",{className:"es-add-empty-sub",children:c.tryAnother})]}):k.map(e=>/* @__PURE__ */D("section",{className:"es-add-group","aria-label":e.title,children:[
|
|
12
|
-
/* @__PURE__ */D("div",{className:"es-add-group-head",children:[
|
|
13
|
-
/* @__PURE__ */z("span",{className:"es-add-group-title",children:e.title}),
|
|
14
|
-
/* @__PURE__ */z("span",{className:"es-add-group-count",children:e.tiles.length})]}),
|
|
15
|
-
/* @__PURE__ */z("div",{className:R(e)?"es-add-grid is-cards":"es-add-grid",children:e.tiles.map(e=>{const t=Boolean(i||e.disabled),l=i?void 0:e.disabled?e.disabledReason:e.title??c.tile({label:e.label});return h(l,/* @__PURE__ */D("button",{type:"button",className:null!=e.cover?"es-add-tile has-cover":"es-add-tile",draggable:!t,"aria-disabled":t||void 0,"aria-label":c.tile({label:e.label}),onDragStart:N(e.type,t),onDragEnd:()=>n.end(),onClick:()=>!t&&r(e.type),children:[null!=e.cover?/* @__PURE__ */z("span",{className:"es-add-tile-cover","aria-hidden":"true",children:e.cover}):e.icon?/* @__PURE__ */z("span",{className:"es-add-tile-glyph","aria-hidden":"true",children:e.icon}):null,
|
|
16
|
-
/* @__PURE__ */z("span",{className:"es-add-tile-label",children:e.label})]},e.type))})})]},e.key))]})}export{G as AddPanel,F as CanvasDragLayer,M as EMPTY_MEASURE,Y as HANDLE_GRACE_MS,L as canvasTarget,T as contains,E as gapInZone,$ as gapLine,X as measureCanvas,S as pickSource,j as seamsBetween};
|
package/dist/chunk-X6DQWK2C.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var a={railWidth:46,railPaddingY:8,railGap:4,railRadius:"var(--radius-xl)",buttonSize:36,iconSize:18,color:{background:"var(--surface)",shadow:"0 1px 2px rgba(0, 0, 0, 0.05), 0 10px 30px rgba(0, 0, 0, 0.06)"}},i={railWidth:"--es-rail-w",railPaddingY:"--es-rail-pad-y",railGap:"--es-rail-gap",railRadius:"--es-rail-radius",buttonSize:"--es-rail-btn-size",iconSize:"--es-rail-icon-size",background:"--es-rail-bg",shadow:"--es-rail-shadow"};export{i as railCssVars,a as railTokens};
|