efficient-easel 25.0.0 → 25.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.
Files changed (35) hide show
  1. package/dist/{chunk-ZYOQXBJF.js → chunk-6WTWYHC2.js} +3 -3
  2. package/dist/{chunk-53ME3GAI.js → chunk-BBD3FLU3.js} +14 -14
  3. package/dist/{chunk-GEPSJJWW.js → chunk-FEP6XMNX.js} +1 -1
  4. package/dist/{chunk-4Y3TK65H.js → chunk-ITIVCER6.js} +1 -1
  5. package/dist/{chunk-KTV7ORWF.js → chunk-IW5QXREH.js} +38 -38
  6. package/dist/chunk-JQQFB7EZ.js +1 -0
  7. package/dist/{chunk-YFHKE54W.js → chunk-KF3LT7J2.js} +1 -1
  8. package/dist/chunk-KVIEUWTX.js +11 -0
  9. package/dist/{chunk-4OMAA45Q.js → chunk-LUHGBFOD.js} +5 -5
  10. package/dist/{chunk-MBEUSPIN.js → chunk-SQTVXE5D.js} +4 -4
  11. package/dist/{chunk-FYV6GZXP.js → chunk-UCZQWQNS.js} +1 -1
  12. package/dist/chunk-UDWXBS46.js +1 -0
  13. package/dist/{chunk-M4THI4OO.js → chunk-XLC7HWW3.js} +1 -1
  14. package/dist/{chunk-VIUES5R6.js → chunk-XTDOSL2M.js} +8 -8
  15. package/dist/drag/index.js +1 -1
  16. package/dist/easel/index.js +1 -1
  17. package/dist/screen/components/AddBlockRow.js +1 -1
  18. package/dist/screen/components/AddSidePanel.js +1 -1
  19. package/dist/screen/components/NodeContextMenu.js +1 -1
  20. package/dist/screen/components/ScreenChrome.js +1 -1
  21. package/dist/screen/components/ScreenMount.js +1 -1
  22. package/dist/screen/components/ScreenStoreProvider.js +1 -1
  23. package/dist/screen/components/SectionScreenShell.js +17 -17
  24. package/dist/screen/components/usePartBridge.js +1 -1
  25. package/dist/screen/index.js +1 -1
  26. package/dist/screen/lib/document/block-set-host.js +1 -1
  27. package/dist/screen/lib/document/box-fields.d.ts +91 -3
  28. package/dist/screen/lib/document/box-fields.js +1 -1
  29. package/dist/screen/lib/document/use-section-ops.js +1 -1
  30. package/dist/screen/lib/key-scope.js +1 -1
  31. package/dist/screen/lib/screen-parts.js +1 -1
  32. package/package.json +1 -1
  33. package/dist/chunk-LUG22U5L.js +0 -1
  34. package/dist/chunk-SSDKT4AY.js +0 -9
  35. package/dist/chunk-ZLOMH2PD.js +0 -1
@@ -1,9 +0,0 @@
1
- import{SettingsDefaultReset as e,sidesStartEach as n,SidesInput as t,SidesEachToggle as l}from"./chunk-SC6E3UUS.js";import{deviceField as a}from"./chunk-OXOUGEAT.js";import{noControlField as o,NoControlMark as i}from"./chunk-22I55W37.js";import{describedAs as r}from"./chunk-LX23TCTP.js";import{withStyleKind as u}from"./chunk-CWELHADJ.js";import{phoneKey as s}from"./chunk-E52W3M5I.js";import{foldMetaOf as c,FOLD_FIELD_MARKER as d}from"./chunk-ANPOR6EY.js";import{useEasel as p,useSelectedHost as m}from"./chunk-53ME3GAI.js";import{DEFAULT_PANEL_WORDS as b}from"./chunk-KFV7N2DJ.js";import{SettingsSwitch as f}from"./chunk-OECWLNKJ.js";import{FieldSelect as h}from"./chunk-KFWNGPW3.js";import{SettingsField as g}from"./chunk-MIX7EGRG.js";import{SettingsSegmented as v}from"./chunk-DX3VILZ3.js";import{useWords as y}from"./chunk-MFIRYGHW.js";import{useState as k}from"react";import{AlignmentIcon as C,BoxJustifyIcon as x,WrapIcon as w,GapIcon as F,WidthIcon as j,PlacementIcon as S,NudgeIcon as L,DesktopIcon as P,BoxXEndIcon as E,BoxXCenterIcon as O,BoxXStartIcon as A,PaddingAllIcon as I,BoxYBetweenIcon as W,BoxYStretchIcon as B,BoxYEndIcon as G,BoxYCenterIcon as N,BoxYStartIcon as T,BoxXBetweenIcon as R,BoxXStretchIcon as K,BoxItemAlignmentIcon as M}from"efficient-shell/icons/efficient";import{Slider as V,textAlignOptions as D,AlignmentGrid as J,PositionInput as X}from"efficient-shell/ui";import{jsx as U,Fragment as z,jsxs as Y}from"react/jsx-runtime";var _=e=>e;function H(){return null}function $(e){if(!e.trim())throw new Error("noGlyph() needs a reason naming the ruling that decided it.");/* @__PURE__ */
2
- return U(H,{},e)}function Z(e){return e.type===H}function q(e){return Z(e)?void 0:e}function Q(e){for(const[n,t]of Object.entries(e))t&&"object"==typeof t&&!c(t)&&u(t,`section:${n}`);return e}function ee(e,n){return{type:"custom",[d]:{label:e,level:n},marker:!0,fold:e,render:()=>/* @__PURE__ */U(z,{})}}function ne(e){return ee(e,2)}function te(e){return ee(e,1)}var le=[{label:"Start",value:"start"},{label:"Center",value:"center"},{label:"Space between",value:"between"},{label:"End",value:"end"}],ae=[{label:"Start",value:"start"},{label:"Center",value:"center"},{label:"End",value:"end"},{label:"Stretch",value:"stretch"}],oe="Wrap",ie=[{label:"Wrap",value:"wrap"},{label:"No wrap",value:"nowrap"}],re="Direction",ue=[{label:"Stacked",value:"column"},{label:"One row",value:"row"}],se={min:-32,max:64,step:2,builtIn:0},ce={min:30,max:100,step:5,fallback:60},de=["top-left","top-center","top-right","left","center","right","bottom-left","bottom-center","bottom-right"],pe="bottom-left",me={"top-left":"Top left","top-center":"Top center","top-right":"Top right",left:"Left",center:"Center",right:"Right","bottom-left":"Bottom left","bottom-center":"Bottom center","bottom-right":"Bottom right"},be=de.map(e=>({value:e,label:me[e]}));function fe(e,n=pe){return de.includes(e)?e:n}var he=40,ge=e=>"number"==typeof e?e:null;function ve(e,n,t){const l={};for(const a of["x","y"])t[a]!==n[a]&&(l[e[a]]=t[a]??void 0);return l}var ye=["top","right","bottom","left"],ke={top:"sectionPaddingTop",right:"sectionPaddingRight",bottom:"sectionPaddingBottom",left:"sectionPaddingLeft"},Ce=e=>"number"==typeof e?e:null;function xe(e,n,t){const l={};for(const a of ye)t[a]!==n[a]&&(l[e[a]]=t[a]??void 0);return l}var we=["left","center","right"];function Fe(e,{options:n,value:t,onChange:l,ariaLabel:a,disabled:o=!1}){/* @__PURE__ */
3
- return U(v,{options:n.map(n=>n.picture?{id:n.value,label:n.picture,title:e(n.title??n.label)}:{id:n.value,label:e(n.label),title:void 0===n.title?void 0:e(n.title)}),value:t,onChange:l,ariaLabel:e(a),disabled:o})}function je(e,{label:n,value:t,onChange:l,points:a}){const o=a.find(e=>e.disabled),i=a.map(n=>({...n,label:e(n.label),...n.title?{title:e(n.title)}:null}));/* @__PURE__ */
4
- return U(g,{label:e(n),icon:/* @__PURE__ */U(S,{}),hint:o?.title?e(o.title):void 0,children:/* @__PURE__ */U(J,{label:e(n),value:t,points:i,onChange:l})})}function Se({say:e,label:n,value:t,onChange:l,pointsFor:a}){const{appState:o,selectedItem:i}=p(e=>e),r=i?.props?.id?String(i.props.id):void 0;return je(e,{label:n,value:t,onChange:l,points:a(o?.data,r)})}function Le({say:n,o:t}){const l=m(),a=y("panel",b),o=l?.values??{},i={x:ge(o[t.keys.x]),y:ge(o[t.keys.y])},r=n(t.label??"Position"),u=Boolean(i.x||i.y),s=e=>{const n=ve(t.keys,i,e);Object.keys(n).length&&l?.onChangeMany(n)},c=/* @__PURE__ */U(X,{label:r,value:i,onChange:s,words:{x:n("Left and right"),y:n("Up and down"),unit:"px"},placeholder:{x:"0",y:"0"},min:t.min,max:t.max,step:t.step??1}),d=/* @__PURE__ */U(e,{words:a,label:r,changed:u,detail:"0 px, 0 px",onReset:()=>s({x:null,y:null})});return null===t.label?/* @__PURE__ */Y("div",{className:"sf-position-line",children:[c,d]}):/* @__PURE__ */U(g,{label:r,icon:/* @__PURE__ */U(L,{}),changed:u,action:d,children:c})}var Pe={x:{start:/* @__PURE__ */U(A,{}),center:/* @__PURE__ */U(O,{}),end:/* @__PURE__ */U(E,{}),stretch:/* @__PURE__ */U(K,{}),between:/* @__PURE__ */U(R,{})},y:{start:/* @__PURE__ */U(T,{}),center:/* @__PURE__ */U(N,{}),end:/* @__PURE__ */U(G,{}),stretch:/* @__PURE__ */U(B,{}),between:/* @__PURE__ */U(W,{})}},Ee=e=>"row"===e?"row":"column";function Oe({say:e,kind:n,label:t,options:l,value:a,onChange:o,o:i}){const r=m(),u="justify"===n==("row"===(i.runs??Ee)(r?.values?.[i.directionKey??"direction"]))?"x":"y";return Fe(e,{options:l.map(e=>({label:e.label,value:e.value,picture:Pe[u][e.value]})),value:a,onChange:o,ariaLabel:t})}function Ae({say:e,tier:a,o:o}){const i=m(),r=i?.values??{},u="mobile"===a?o.phoneKeys:o.keys,s=Object.fromEntries(ye.map(e=>[e,Ce(r[u[e]])])),c=Object.fromEntries(ye.map(e=>[e,String("mobile"===a?Ce(r[o.keys[e]])??o.fallback[e]:o.fallback[e])])),[d,p]=k(()=>n(s,c));/* @__PURE__ */
5
- return U(g,{label:e("Padding"),icon:/* @__PURE__ */U(I,{}),action:/* @__PURE__ */U(l,{each:d,label:e("Each side"),onChange:p}),children:/* @__PURE__ */U(t,{label:e("Padding"),each:d,value:s,placeholder:c,min:o.min,max:o.max,step:o.step,onChange:e=>{const n=xe(u,s,e);Object.keys(n).length&&i?.onChangeMany(n)},words:{sides:{top:e("Padding top"),right:e("Padding right"),bottom:e("Padding bottom"),left:e("Padding left")},vertical:e("Top and bottom"),horizontal:e("Left and right"),unit:"px"}})})}function Ie(e=_){function n(n,t,l,a,o,i,u="",s){return{type:"custom",...r({},{type:"number",label:n}),render:r=>{const c="number"==typeof r.value?r.value:i;/* @__PURE__ */
6
- return U(g,{label:e(n),icon:q(t),action:s?s("storedValue"in r?r.storedValue:r.value,r.onChange):void 0,children:/* @__PURE__ */U("div",{className:"sf-slider",children:/* @__PURE__ */U(V,{min:l,max:a,step:o,value:c,suffix:u||void 0,showInput:!0,label:e(n),disabled:!1,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:e=>{null!==e&&e!==c&&r.onChange(e)}})})})}}}function t(n){return Fe(e,n)}function l(n,l,a,o){const i=a.map(e=>"string"==typeof e?{label:e,value:e}:e);return{type:"custom",...r({},{type:"radio",label:n,options:i.map(e=>({value:e.value,label:e.label}))}),render:({value:a,onChange:r,field:u})=>/* @__PURE__ */U(g,{label:e(n),icon:q(l),children:t({options:i,value:i.some(e=>e.value===a)?a:a||u?.currentValue||o,onChange:r,ariaLabel:n})})}}function u(e,n){return n.phone?e.unshift({label:"Match desktop",value:"",picture:/* @__PURE__ */U(P,{})}):n.inherit&&e.unshift({label:n.inherit,value:""}),e}function c(e,n){return n.inherit||n.phone?{...e,render:n=>e.render({...n,onChange:e=>n.onChange(""===e?void 0:e)})}:e}function d(e,n,t){return{[e]:a("desktop",n(t)),[s(e)]:a("mobile",n({...t,phone:!0},""))}}function p(e){return u(D(e.allow??we).map(e=>({label:e.label,value:e.value,picture:e.icon})),e)}function m(e={},n=e.fallback??"left"){return c(l(e.label??"Text alignment",/* @__PURE__ */U(C,{}),p(e),n),e)}function b(e){const n={left:Pe.x.start,center:Pe.x.center,right:Pe.x.end};return u(D((e.allow??we).filter(e=>e in n)).map(e=>({label:e.label,value:e.value,picture:n[e.value]})),e)}function v(e={},n=e.fallback??"left"){return c(l(e.label??"Block alignment",/* @__PURE__ */U(x,{}),b(e),n),e)}function y(n,t,l,a,o,i){return{type:"custom",options:a,fallback:o,...r({},{type:"radio",label:t,options:a.map(e=>({value:e.value,label:e.label}))}),render:({value:r,onChange:u,field:s})=>{const c=s.options??a,d=s.fallback??o,p=c.some(e=>e.value===r)?r:d;/* @__PURE__ */
7
- return U(g,{label:e(t),icon:q(l),children:/* @__PURE__ */U(Oe,{say:e,kind:n,label:t,options:c,value:p,onChange:u,o:i})})}}}function k(e={}){return y("justify","Justify",/* @__PURE__ */U(x,{}),le,le[0].value,e)}function S(e={}){return y("align","Item alignment",/* @__PURE__ */U(M,{}),ae,"stretch",e)}function L(){const n=oe;return{type:"custom",options:ie,fallback:ie[1].value,...r({},{type:"radio",label:n,options:ie.map(e=>({value:e.value,label:e.label}))}),render:({value:t,onChange:l,id:a,name:o})=>{const i=`${a??o??n}-label`;/* @__PURE__ */
8
- return U(g,{label:e(n),labelId:i,icon:/* @__PURE__ */U(w,{}),action:/* @__PURE__ */U(f,{checked:(r=t,!0===r||"wrap"===r),onChange:e=>l(e?ie[0].value:ie[1].value),ariaLabelledBy:i})});var r}}}function E({offered:e,fallback:n,resolve:t}){const a=t??(t=>e.some(e=>e.value===t)?t:n),o=l(re,$("`Direction` names how a container’s children run — a MODIFIER, not a thing. doc/naming.md N10.1 gives the idea a dash in its Glyph column; the shell’s own `direction` meaning says the bare row is CORRECT and not an omission (SS seat, 2026-09-11)."),e.map(e=>({label:e.label,value:e.value})),a(void 0));return{type:"custom",render:e=>o.render({...e,value:a(e.value),onChange:n=>e.onChange(n)})}}function O({min:e,max:t,step:l,builtIn:a,resolve:o,action:i,mark:r}){const u=n("Gap",/* @__PURE__ */U(F,{}),e,t,l,a,"px",i),s=o??(e=>"number"==typeof e?e:a);return{...r,type:"custom",render:e=>u.render({...e,value:s(e.value,e.field),storedValue:e.value,onChange:n=>e.onChange(n)})}}function A(n,{fallback:t=pe,pointsFor:l}={}){return{type:"custom",render:({value:a,onChange:o})=>{const i=fe(a,t);return l?/* @__PURE__ */U(Se,{say:e,label:n,value:i,onChange:o,pointsFor:l}):je(e,{label:n,value:i,onChange:o,points:be})}}}function I(n){return{[n.keys.x]:{type:"custom",render:()=>/* @__PURE__ */U(Le,{say:e,o:n})},[n.keys.y]:{...o({type:"custom",render:()=>/* @__PURE__ */U(i,{})},"always"),reachedBy:n.keys.x}}}function W(n={}){const t={...ke,...n.keys},l={keys:t,phoneKeys:Object.fromEntries(ye.map(e=>[e,s(t[e])])),fallback:{top:0,right:0,bottom:0,left:0,...n.fallback},min:n.min??0,max:n.max??200,step:n.step??4},r=!1!==n.phone,u=n=>{const t={type:"custom",render:()=>/* @__PURE__ */U(Ae,{say:e,tier:n,o:l})};return r?a(n,t):t},c=()=>o({type:"custom",render:()=>/* @__PURE__ */U(i,{})},"always"),d=ye.filter(e=>"top"!==e);return Q({...!1===n.group?{}:{_gSpacing:ne("Padding")},[l.keys.top]:u("desktop"),...r?{[l.phoneKeys.top]:u("mobile")}:{},...Object.fromEntries(d.map(e=>[l.keys[e],{...c(),reachedBy:l.keys.top}])),...r?Object.fromEntries(d.map(e=>[l.phoneKeys[e],a("mobile",c())])):{}})}return{slider:n,select:function(n,t,l,a,o){return{type:"custom",options:l,fallback:a,...o?{note:o}:{},...r({},{type:"select",label:n}),render:({value:i,onChange:r,field:u})=>{const s=u.options??l,c=u.fallback??a,d=s.some(e=>e.value===i)?i:c;/* @__PURE__ */
9
- return U(g,{label:e(n),icon:q(t),children:/* @__PURE__ */U(h,{value:d,ariaLabel:e(n),onChange:r,options:[...o?[{label:e(o),value:"\0note",disabled:!0}]:[],...s.map(n=>({label:e(n.label),value:n.value}))]})})}}},Segmented:t,segmented:l,boxJustifyField:k,boxAlignField:S,boxWrapField:L,directionField:E,gapField:O,placementField:A,PlacementGridView:function(n){return je(e,n)},positionFields:I,sidesPaddingFields:W,alignmentField:m,alignmentFields:function(e="align",n={}){return d(e,m,n)},AlignmentStrip:function({opts:e={},value:n,onChange:l,ariaLabel:a,disabled:o=!1}){return t({options:p(e),value:n,onChange:l,ariaLabel:a,disabled:o})},blockAlignmentField:v,blockAlignmentFields:function(e="align",n={}){return d(e,v,n)},BlockAlignmentStrip:function({opts:e={},value:n,onChange:l,ariaLabel:a,disabled:o=!1}){return t({options:b(e),value:n,onChange:l,ariaLabel:a,disabled:o})},boxFieldSet:function(e={}){const t=e.width??ce,l=e.nudge?.limit??40,a=e.direction??{offered:ue,fallback:"column"},o=a.resolve??(e=>a.offered.some(n=>n.value===e)?e:a.fallback),i={runs:e=>"row"===o(e)?"row":"column"};return{_gLayout:ne("Layout"),placement:A("Placement",e.placement),width:n("Width",/* @__PURE__ */U(j,{}),t.min,t.max,t.step,t.fallback,"%"),direction:E(a),gap:O(e.gap??se),justify:k(i),align:S(i),wrap:L(),_gNudge:ne("Nudge"),...I({keys:e.nudge?.keys??{x:"nudgeX",y:"nudgeY"},min:-l,max:l,label:null}),...W(e.padding)}}}}var{slider:We,select:Be,Segmented:Ge,segmented:Ne,boxJustifyField:Te,boxAlignField:Re,boxWrapField:Ke,directionField:Me,gapField:Ve,placementField:De,PlacementGridView:Je,positionFields:Xe,sidesPaddingFields:Ue,alignmentField:ze,alignmentFields:Ye,AlignmentStrip:_e,blockAlignmentField:He,blockAlignmentFields:$e,BlockAlignmentStrip:Ze,boxFieldSet:qe}=Ie();export{me as ANCHOR_LABELS,_e as AlignmentStrip,ae as BOX_ALIGN_POINTS,ue as BOX_DIRECTIONS,re as BOX_DIRECTION_LABEL,se as BOX_GAP,le as BOX_JUSTIFY_POINTS,he as BOX_NUDGE_LIMIT,de as BOX_PLACEMENTS,pe as BOX_PLACEMENT_DEFAULT,ce as BOX_WIDTH,oe as BOX_WRAP_LABEL,ie as BOX_WRAP_POINTS,Ze as BlockAlignmentStrip,be as OPEN_PLACEMENT_POINTS,Je as PlacementGridView,ke as SIDE_PAD_KEYS,Ge as Segmented,ze as alignmentField,Ye as alignmentFields,He as blockAlignmentField,$e as blockAlignmentFields,Re as boxAlignField,Ie as boxFieldBuilders,qe as boxFieldSet,Te as boxJustifyField,Ke as boxWrapField,Me as directionField,Ve as gapField,ne as group,q as iconOf,Z as isNoGlyph,$ as noGlyph,fe as normaliseBoxPlacement,De as placementField,Xe as positionFields,ve as positionPatch,te as section,Ne as segmented,Be as select,Q as sharedStyleKinds,Ue as sidesPaddingFields,xe as sidesPaddingPatch,We as slider};
@@ -1 +0,0 @@
1
- import{useSectionOps as o}from"./chunk-M4THI4OO.js";import{SELECTION_MODE as e}from"./chunk-4OMAA45Q.js";import{decodePartId as r,encodePartId as t}from"./chunk-R4AUZVA3.js";import{useEasel as n}from"./chunk-53ME3GAI.js";import{usePreviewParts as p}from"./chunk-467WWV4I.js";import{useCallback as d,useEffect as c}from"react";var s=o=>"part"===o.kind;function m({mode:m,setMode:i,onOpenPart:I}){const{getSelectorForId:a}=n(o=>o),u=o(),{setSelectedPartId:f,setSelectHandler:k}=p(),l=d(o=>{const t=r(o);if(!t)return;const{nodeId:n,propKey:p}=t;p?(i(o=>s(o)&&o.nodeId===n&&o.propKey===p?o:{kind:"part",nodeId:n,propKey:p}),I?.(n)):i(o=>"part"===o.kind?e:o)},[i,I]);c(()=>{k(l)},[k,l]);const h=s(m)?t(m.nodeId,m.propKey):null;c(()=>{f(h)},[h,f]);return{selectNode:d(o=>{i(()=>e);const r=a(o);r&&u.select(r)},[i,a,u]),openPartId:h}}export{m as usePartBridge};