efficient-easel 26.16.0 → 27.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.
Files changed (78) hide show
  1. package/README.md +9 -8
  2. package/dist/{chunk-YTF65TZA.js → chunk-2262JGFV.js} +5 -5
  3. package/dist/chunk-53QUHEHK.js +1 -0
  4. package/dist/{chunk-W2S2VJOQ.js → chunk-5JNVMCCB.js} +1 -1
  5. package/dist/{chunk-XFI3UPB2.js → chunk-5OWAV3MH.js} +1 -1
  6. package/dist/chunk-76MUJIZE.js +17 -0
  7. package/dist/{chunk-JDQSRKJG.js → chunk-AAZIMKLQ.js} +1 -1
  8. package/dist/{chunk-RN5AYO53.js → chunk-DAKKPW2Z.js} +1 -1
  9. package/dist/chunk-DIOTWSCO.js +1 -0
  10. package/dist/chunk-FW35PCK7.js +1 -0
  11. package/dist/{chunk-C4TJN6GR.js → chunk-G2VZ4DET.js} +1 -1
  12. package/dist/{chunk-LWFE6QDN.js → chunk-HG65R6IN.js} +12 -12
  13. package/dist/chunk-L2WK5JYB.js +2 -0
  14. package/dist/{chunk-RQO3UDKP.js → chunk-L7PSERQH.js} +8 -8
  15. package/dist/{chunk-H4TUOPI7.js → chunk-NTG5ODKZ.js} +1 -1
  16. package/dist/{chunk-T5U2UZO6.js → chunk-O4OWODU2.js} +31 -31
  17. package/dist/chunk-TDEBPOWV.js +3 -0
  18. package/dist/{chunk-6DUCOSHW.js → chunk-TYTMUHUK.js} +1 -1
  19. package/dist/chunk-W3UZNKGS.js +7 -0
  20. package/dist/{chunk-CLAADE4J.js → chunk-XWTQTANN.js} +5 -5
  21. package/dist/{chunk-MGEXTIZH.js → chunk-YES5F7OS.js} +1 -1
  22. package/dist/chunk-ZFEAWEFS.js +4 -0
  23. package/dist/chunk-ZNLODQD4.js +3 -0
  24. package/dist/copy/index.d.ts +1 -1
  25. package/dist/copy/index.js +13 -13
  26. package/dist/draw/index.js +1 -1
  27. package/dist/easel/index.d.ts +1 -1
  28. package/dist/fields/index.d.ts +43 -16
  29. package/dist/fields/index.js +1 -1
  30. package/dist/panel/index.js +1 -1
  31. package/dist/{rowMarks-CO5TpfLY.d.ts → rowMarks-D2cO7UTi.d.ts} +5 -5
  32. package/dist/screen/components/AddBlockRow.js +1 -1
  33. package/dist/screen/components/AddSidePanel.js +1 -1
  34. package/dist/screen/components/NodeContextMenu.js +1 -1
  35. package/dist/screen/components/PageEditGuardNotices.js +1 -1
  36. package/dist/screen/components/ScreenChrome.js +1 -1
  37. package/dist/screen/components/ScreenDocumentContext.js +1 -1
  38. package/dist/screen/components/ScreenMount.js +1 -1
  39. package/dist/screen/components/ScreenStoreProvider.js +1 -1
  40. package/dist/screen/components/SectionScreenShell.js +17 -17
  41. package/dist/screen/components/usePartBridge.js +1 -1
  42. package/dist/screen/index.js +1 -1
  43. package/dist/screen/lib/content/view-tiers.d.ts +11 -1
  44. package/dist/screen/lib/content/view-tiers.js +1 -1
  45. package/dist/screen/lib/document/block-set-host.js +1 -1
  46. package/dist/screen/lib/document/block-size-fields.js +1 -1
  47. package/dist/screen/lib/document/box-fields.d.ts +41 -13
  48. package/dist/screen/lib/document/box-fields.js +1 -1
  49. package/dist/screen/lib/document/button-fields.js +1 -1
  50. package/dist/screen/lib/document/device-fields.d.ts +10 -17
  51. package/dist/screen/lib/document/device-fields.js +1 -1
  52. package/dist/screen/lib/document/image-fields.js +4 -4
  53. package/dist/screen/lib/document/panel-no-control-mark.d.ts +2 -2
  54. package/dist/screen/lib/document/shadow-fields.js +1 -1
  55. package/dist/screen/lib/document/style-clipboard.js +1 -1
  56. package/dist/screen/lib/document/style-fields.js +1 -1
  57. package/dist/screen/lib/document/use-section-ops.js +1 -1
  58. package/dist/screen/lib/screen-parts.d.ts +0 -10
  59. package/dist/screen/lib/screen-parts.js +1 -1
  60. package/dist/screen/screen.css +0 -6
  61. package/dist/screen/words.d.ts +1 -3
  62. package/dist/screen/words.js +1 -1
  63. package/dist/strings/index.js +2 -2
  64. package/dist/text-styles/index.d.ts +6 -5
  65. package/dist/text-styles/index.js +37 -37
  66. package/dist/text-styles/model.d.ts +24 -14
  67. package/dist/text-styles/model.js +1 -1
  68. package/dist/{types-CVHwspYM.d.ts → types-DcyH17ij.d.ts} +2 -0
  69. package/package.json +1 -1
  70. package/dist/chunk-5U6DUZE2.js +0 -7
  71. package/dist/chunk-BLE3U2GS.js +0 -2
  72. package/dist/chunk-CPIWSFGR.js +0 -2
  73. package/dist/chunk-E52W3M5I.js +0 -1
  74. package/dist/chunk-OGG6FMBA.js +0 -17
  75. package/dist/chunk-TXNCWF67.js +0 -4
  76. package/dist/chunk-U4TG43PD.js +0 -1
  77. package/dist/chunk-YHZSBL2N.js +0 -1
  78. package/dist/chunk-ZEH6QLBH.js +0 -4
@@ -1,37 +1,37 @@
1
- import{hexReadout as e,typedHex as s}from"../chunk-4FFDGEWA.js";import{DEFAULT_TEXT_STYLES_WORDS as t}from"../chunk-OGH6CC3E.js";export{DEFAULT_TEXT_STYLES_WORDS}from"../chunk-OGH6CC3E.js";import{FieldSlider as a}from"../chunk-ZEH6QLBH.js";import{TEXT_STYLE_KINDS as l,canAddTextStyle as i,TEXT_STYLE_MAX as n,isDefaultTextStyle as r,CAMPAIGN_TEXT_STYLE_SETTINGS as o,TEXT_STYLE_SETTINGS as d,textStyleRowSize as c,describeTextStyle as u,updateTextStyle as m,textStyleCaseCss as h,TEXT_STYLE_CASES as p,addTextStyle as v,removeTextStyle as f,TEXT_STYLE_RANGES as y}from"../chunk-YHZSBL2N.js";export{CAMPAIGN_TEXT_STYLE_SETTINGS,TEXT_STYLE_CASES,TEXT_STYLE_CASE_CSS,TEXT_STYLE_DEFAULT_COUNT,TEXT_STYLE_KINDS,TEXT_STYLE_MAX,TEXT_STYLE_RANGES,TEXT_STYLE_SETTINGS,addTextStyle,canAddTextStyle,defaultTextStyles,describeTextStyle,isDefaultTextStyle,isTextStyleCase,removeTextStyle,resolveTextStyle,textStyleCaseCss,textStyleCaseOfCss,textStyleRowSize,updateTextStyle,weightWord}from"../chunk-YHZSBL2N.js";import{FieldSelect as g}from"../chunk-KFWNGPW3.js";import"../chunk-JACEEVVF.js";import{SettingsSegmented as S}from"../chunk-DX3VILZ3.js";import{useWords as b}from"../chunk-MFIRYGHW.js";import{withTip as N}from"../chunk-P2VEMZH5.js";import{hsvToHex as C,Tooltip as T,ColorSwatch as k,Popover as x,ColorPickerPanel as w,colorSwatchClasses as z,IconButton as E,Button as O}from"efficient-shell/ui";import{useId as _,useState as L,useRef as A,useEffect as j,Fragment as M}from"react";import{TrashIcon as $,ChevronIcon as W,BoldIcon as Y,ItalicIcon as X,CaseLowerIcon as F,CaseCapitalizedIcon as G,CaseUpperIcon as H,CaseNormalIcon as I}from"efficient-shell/icons/efficient";import{jsxs as P,jsx as B,Fragment as D}from"react/jsx-runtime";var R=`conic-gradient(${[0,60,120,180,240,300,0].map(e=>C({h:e,s:1,v:1})).join(", ")})`;function V({value:s,hex:t,colours:a,label:l,followsWord:i,anyWord:n,onChange:r,readOnly:o=!1}){const d=void 0!==s&&a.some(e=>e.key===s),c=void 0!==s&&!d;/* @__PURE__ */
2
- return P("div",{className:"es-ts-set","data-ts-setting":"color",children:[
3
- /* @__PURE__ */P("div",{className:"es-ts-top",children:[
4
- /* @__PURE__ */B("span",{className:"es-ts-sub",children:l}),
5
- /* @__PURE__ */B("span",{className:"es-ts-colour-read",children:t?e(t):i})]}),
6
- /* @__PURE__ */P("div",{className:"es-ts-swatches",role:"group","aria-label":l,children:[a.map(t=>/* @__PURE__ */B(T,{content:`${t.name} · ${e(t.value)}`,children:/* @__PURE__ */B(k,{color:t.value,size:"sm",className:"es-ts-swatch","aria-label":t.name,selected:s===t.key,disabled:o,onClick:()=>r(t.key)})},t.key)),
7
- /* @__PURE__ */B(T,{content:n,children:/* @__PURE__ */B(x,{trigger:/* @__PURE__ */B("span",{"aria-hidden":"true",className:"absolute inset-0",style:{background:R}}),triggerLabel:n,triggerClassName:z({size:"sm",selected:c,className:"es-ts-swatch es-ts-swatch--any"}),"aria-label":l,disabled:o,children:/* @__PURE__ */B(w,{className:"es-pick-window",value:t??"",onChange:e=>r(e),label:l,disabled:o})})})]})]})}function Z({styles:e,onChange:s,fonts:a,colours:d=[],settings:c=o,auto:u=[],fallback:m,sample:h,openId:p,defaultOpenId:y=null,onOpenChange:g,onAdd:S,rowActions:C,onRemove:T,max:k=n,device:x="desktop",readOnly:w=!1}){const z=b("textStyles",t),M=_(),[W,Y]=L(y),X=void 0!==p?p:W,F=e=>{void 0===p&&Y(e),g?.(e)},G=A(null),[H,I]=L(null);j(()=>{if(!H||!G.current)return;const e=[...G.current.querySelectorAll(".es-ts-item")].find(e=>e.dataset.tsId===H.id),s=e?e.querySelector(".es-ts-row"):G.current.querySelector(`.es-ts-add[data-ts-kind="${H.kind}"]`);s?.focus(),I(null)},[H]);/* @__PURE__ */
8
- return B("div",{className:"es-ts",ref:G,children:l.map(t=>{const l=e.filter(e=>e.kind===t),n=!i(e,t,k),o=!w&&!n;/* @__PURE__ */
9
- return P(q,{label:z.groups[t],children:[l.map(t=>{const l=C?.(t),i=null!=l&&!1!==l,n=Boolean(T)&&!w&&!r(t);/* @__PURE__ */
10
- return B(U,{style:t,fonts:a,colours:d,settings:c,auto:u,fallback:m,sample:h,device:x,readOnly:w,open:X===t.id,onOpenChange:e=>F(e?t.id:null),onChange:t=>s(e.map(e=>e.id===t.id?t:e)),actions:n||i?/* @__PURE__ */P(D,{children:[n?N(z.remove,/* @__PURE__ */B(E,{variant:"ghost-danger",size:"sm",className:"es-ts-del","aria-label":z.removeNamed({name:t.name}),onClick:()=>(t=>{if(w||!T)return;const a=f(e,t.id,{name:z.styleName});if(!a)return;const l=e.filter(e=>e.kind===t.kind),i=l[l.indexOf(t)+1];X===t.id&&F(null),s(a.styles),T(a.removed),I({id:i?.id??null,kind:t.kind})})(t),children:/* @__PURE__ */B($,{size:14,"aria-hidden":"true"})})):null,i?l:null]}):null},t.id)}),N(!w&&n?z.full({kind:t,max:k}):void 0,/* @__PURE__ */P(O,{variant:"link",className:"es-ts-add","data-ts-kind":t,disabled:w,"aria-disabled":!(w||!n)||void 0,"aria-describedby":!w&&n?`${M}-full-${t}`:void 0,onClick:()=>{o&&(t=>{if(w)return;const a=v(e,t,{max:k,name:z.styleName,make:S});a&&s(a.styles)})(t)},children:[
11
- /* @__PURE__ */B("span",{className:"es-ts-add-word",children:z.add[t]}),
12
- /* @__PURE__ */B("span",{className:"es-ts-count",children:z.count({n:l.length,max:k})})]})),w||!n?null:/* @__PURE__ */B("span",{id:`${M}-full-${t}`,className:"es-vh",children:z.full({kind:t,max:k})})]},t)})})}function q({label:e,children:s}){const t=_();/* @__PURE__ */
13
- return P("section",{className:"es-ts-section","aria-labelledby":t,children:[
14
- /* @__PURE__ */B("div",{className:"es-ts-group",id:t,children:e}),s]})}function U({style:e,fonts:s,colours:a=[],settings:l=o,auto:i=[],fallback:n,sample:r,open:h,onOpenChange:p,onChange:v,actions:f,device:y="desktop",readOnly:g=!1}){const S=b("textStyles",t),N=`${_()}-open-${e.id}`,C=new Set(i),T=d.filter(e=>l.includes(e)),k={...n?.(e)??{},...e.values},x="phone"===y,w=x&&void 0!==e.values.sizePhone?{...k,size:e.values.sizePhone}:k,z=s.find(e=>e.value===k.font),E={fontFamily:z?.family,fontSize:`${c(w.size??16)}px`,fontWeight:k.weight,fontStyle:k.italic?"italic":void 0};/* @__PURE__ */
15
- return P(M,{children:[
16
- /* @__PURE__ */P("div",{className:"es-ts-item","data-ts-id":e.id,children:[
17
- /* @__PURE__ */P("button",{type:"button",className:"es-ts-row","aria-expanded":h,"aria-controls":h?N:void 0,onClick:()=>p(!h),children:[
18
- /* @__PURE__ */B("span",{className:"es-ts-chev","aria-hidden":"true",children:/* @__PURE__ */B(W,{size:12})}),
19
- /* @__PURE__ */B("span",{className:"es-ts-name",style:E,children:e.name}),
20
- /* @__PURE__ */B("span",{className:"es-ts-meta",children:u(w,s,S,{autoSize:C.has("size")&&w===k&&void 0===e.values.size})})]}),f?/* @__PURE__ */B("div",{className:"es-ts-actions",children:f}):null]}),h?/* @__PURE__ */B("div",{className:"es-ts-open",id:N,children:/* @__PURE__ */B(J,{style:e,values:k,fonts:s,colours:a,settings:T,autoSet:C,sample:r??S.sample,words:S,phone:x,readOnly:g,set:s=>v(m([e],e.id,s)[0])})}):null]})}var K={none:I,upper:H,capitalize:G,lower:F};function J({style:e,values:t,fonts:l,colours:i,settings:n,autoSet:r,sample:o,words:d,phone:c,readOnly:u,set:m}){const p=e.values,v=l.find(e=>e.value===t.font),f=function(e,t){return e?t.find(s=>s.key===e)?.value??s(e)??void 0:void 0}(t.color,i),g=e=>"largestSize"===e||r.has(e),S=e=>g(e)?p[e]:t[e],b=S("size"),C=c&&void 0!==p.sizePhone?p.sizePhone:b,T=S("lineSpacing"),k=S("letterSpacing"),x=g("letterCase")?p.letterCase:t.letterCase,w={fontFamily:v?.family,fontSize:void 0===C?void 0:`${C}px`,fontWeight:t.weight,fontStyle:t.italic?"italic":void 0,lineHeight:void 0===T?void 0:String(T/100),letterSpacing:void 0===k?void 0:`${k}px`,color:f,textTransform:h(x)},z=e=>{const s=y[e],l=g(e);/* @__PURE__ */
21
- return B("div",{className:"es-ts-slider","data-ts-setting":e,children:/* @__PURE__ */B(a,{label:d.settings[e],value:p[e],onChange:s=>m({[e]:s}),min:s.min,max:s.max,step:s.step,shiftStep:s.shiftStep,sliderMin:s.sliderMin,sliderMax:s.sliderMax,unit:s.unit||void 0,styleValue:l?void 0:t[e],auto:l?d.auto:void 0,readOnly:u})},e)};/* @__PURE__ */
22
- return P(D,{children:[
23
- /* @__PURE__ */B("div",{className:"es-ts-preview",style:w,"aria-label":d.preview,children:o}),n.map(s=>{switch(s){case"font":/* @__PURE__ */
24
- return B(Q,{value:p.font,fonts:l,words:d,readOnly:u,set:m},s);case"color":/* @__PURE__ */
25
- return B(ee,{value:p.color,hex:f,colours:i,words:d,readOnly:u,set:m},s);case"emphasis":{const e=(t.weight??400)>=600,a=!1!==v?.italic;/* @__PURE__ */
26
- return P("div",{className:"es-ts-set","data-ts-setting":s,children:[
27
- /* @__PURE__ */B("span",{className:"es-ts-sub",children:d.settings.emphasis}),
28
- /* @__PURE__ */P("div",{className:"es-ts-icons",children:[N(d.bold,/* @__PURE__ */B(E,{className:"es-ts-icon","aria-label":d.bold,"aria-pressed":e,disabled:u,onClick:()=>m({weight:e?400:700}),children:/* @__PURE__ */B(Y,{size:16})})),u||a?N(d.italic,/* @__PURE__ */B(E,{className:"es-ts-icon","aria-label":d.italic,"aria-pressed":Boolean(t.italic),disabled:u,onClick:()=>m({italic:!t.italic||void 0}),children:/* @__PURE__ */B(X,{size:16})})):/* @__PURE__ */B(E,{className:"es-ts-icon","aria-label":d.italic,"aria-pressed":Boolean(t.italic),"aria-disabled":!0,disabledReason:d.italicMissing,children:/* @__PURE__ */B(X,{size:16})})]})]},s)}case"letterCase":/* @__PURE__ */
29
- return B(se,{value:p.letterCase??t.letterCase,auto:g("letterCase"),words:d,readOnly:u,set:m},s);case"largestSize":return"heading"===e.kind?z(s):null;case"size":return c?(()=>{const e=y.size;/* @__PURE__ */
30
- return B("div",{className:"es-ts-slider","data-ts-setting":"size","data-ts-device":"phone",children:/* @__PURE__ */B(a,{label:d.settings.size,value:p.sizePhone,onChange:e=>m({sizePhone:e}),min:e.min,max:e.max,step:e.step,shiftStep:e.shiftStep,sliderMin:e.sliderMin,sliderMax:e.sliderMax,unit:e.unit||void 0,styleValue:b,readOnly:u})},"size")})():z(s);default:return z(s)}})]})}function Q({value:e,fonts:s,words:t,readOnly:a,set:l}){const i=_();/* @__PURE__ */
31
- return P("div",{className:"es-ts-set","data-ts-setting":"font",children:[
32
- /* @__PURE__ */B("span",{className:"es-ts-sub",id:i,children:t.settings.font}),
33
- /* @__PURE__ */B(g,{value:e,options:s.map(e=>({label:e.label,value:e.value})),onChange:e=>l({font:e}),ariaLabelledBy:i,readOnly:a})]})}function ee({value:e,hex:s,colours:t,words:a,readOnly:l,set:i}){/* @__PURE__ */
34
- return B(V,{value:e,hex:s,colours:t,label:a.settings.color,followsWord:a.colour.follows,anyWord:a.colour.any,readOnly:l,onChange:e=>i({color:e})})}function se({value:e,auto:s,words:t,readOnly:a,set:l}){const i=p.map(e=>{const s=K[e];return{id:e,label:/* @__PURE__ */B(s,{size:16}),title:t.case[e]}}),n=s?[{id:"auto",label:/* @__PURE__ */B("span",{children:t.case.auto}),title:t.case.autoTitle},...i]:i;/* @__PURE__ */
35
- return P("div",{className:"es-ts-set","data-ts-setting":"letterCase",children:[
36
- /* @__PURE__ */B("span",{className:"es-ts-sub",children:t.settings.letterCase}),
37
- /* @__PURE__ */B(S,{options:n,value:e??(s?"auto":"none"),ariaLabel:t.settings.letterCase,disabled:a,onChange:e=>l({letterCase:"auto"===e?void 0:e})})]})}export{V as ColourSwatchRow,U as TextStyleItem,q as TextStylesGroup,Z as TextStylesList};
1
+ import{SettingsDefaultReset as e}from"../chunk-2T22IY3J.js";import{hexReadout as s,typedHex as t}from"../chunk-4FFDGEWA.js";import{DEFAULT_TEXT_STYLES_WORDS as a}from"../chunk-OGH6CC3E.js";export{DEFAULT_TEXT_STYLES_WORDS}from"../chunk-OGH6CC3E.js";import{FieldSlider as l}from"../chunk-TDEBPOWV.js";import{DEFAULT_PANEL_WORDS as i}from"../chunk-56ID6FKZ.js";import{TEXT_STYLE_KINDS as n,canAddTextStyle as r,TEXT_STYLE_MAX as o,isDefaultTextStyle as d,CAMPAIGN_TEXT_STYLE_SETTINGS as c,TEXT_STYLE_SETTINGS as u,textStyleViewValues as m,textStyleRowSize as h,describeTextStyle as p,updateTextStyle as f,textStyleCaseCss as v,TEXT_STYLE_VIEW_NUMBERS as g,TEXT_STYLE_CASES as y,addTextStyle as S,removeTextStyle as b,TEXT_STYLE_RANGES as T,textStyleViewKey as N}from"../chunk-53QUHEHK.js";export{CAMPAIGN_TEXT_STYLE_SETTINGS,TEXT_STYLE_CASES,TEXT_STYLE_CASE_CSS,TEXT_STYLE_DEFAULT_COUNT,TEXT_STYLE_KINDS,TEXT_STYLE_MAX,TEXT_STYLE_RANGES,TEXT_STYLE_SETTINGS,TEXT_STYLE_VIEW_NUMBERS,addTextStyle,canAddTextStyle,defaultTextStyles,describeTextStyle,isDefaultTextStyle,isTextStyleCase,removeTextStyle,resolveTextStyle,textStyleCaseCss,textStyleCaseOfCss,textStyleRowSize,textStyleViewKey,textStyleViewValues,updateTextStyle,weightWord}from"../chunk-53QUHEHK.js";import{viewFollows as k,isAuto as C}from"../chunk-DIOTWSCO.js";import{FieldSelect as x}from"../chunk-KFWNGPW3.js";import{SettingsSegmented as E}from"../chunk-DX3VILZ3.js";import{SettingsField as w}from"../chunk-MIX7EGRG.js";import"../chunk-JACEEVVF.js";import{useWords as O}from"../chunk-MFIRYGHW.js";import{withTip as _}from"../chunk-P2VEMZH5.js";import{hsvToHex as z,Tooltip as j,ColorSwatch as L,Popover as M,ColorPickerPanel as W,colorSwatchClasses as $,IconButton as A,Button as I}from"efficient-shell/ui";import{useId as X,useState as Y,useRef as F,useEffect as G,Fragment as V}from"react";import{TrashIcon as D,ChevronIcon as H,BoldIcon as R,ItalicIcon as B,CaseLowerIcon as K,CaseCapitalizedIcon as U,CaseUpperIcon as P,CaseNormalIcon as q}from"efficient-shell/icons/efficient";import{jsxs as Z,jsx as J,Fragment as Q}from"react/jsx-runtime";var ee=`conic-gradient(${[0,60,120,180,240,300,0].map(e=>z({h:e,s:1,v:1})).join(", ")})`;function se({value:e,hex:t,colours:a,label:l,followsWord:i,anyWord:n,onChange:r,readOnly:o=!1}){const d=void 0!==e&&a.some(s=>s.key===e),c=void 0!==e&&!d;/* @__PURE__ */
2
+ return Z("div",{className:"es-ts-set","data-ts-setting":"color",children:[
3
+ /* @__PURE__ */Z("div",{className:"es-ts-top",children:[
4
+ /* @__PURE__ */J("span",{className:"es-ts-sub",children:l}),
5
+ /* @__PURE__ */J("span",{className:"es-ts-colour-read",children:t?s(t):i})]}),
6
+ /* @__PURE__ */Z("div",{className:"es-ts-swatches",role:"group","aria-label":l,children:[a.map(t=>/* @__PURE__ */J(j,{content:`${t.name} · ${s(t.value)}`,children:/* @__PURE__ */J(L,{color:t.value,size:"sm",className:"es-ts-swatch","aria-label":t.name,selected:e===t.key,disabled:o,onClick:()=>r(t.key)})},t.key)),
7
+ /* @__PURE__ */J(j,{content:n,children:/* @__PURE__ */J(M,{trigger:/* @__PURE__ */J("span",{"aria-hidden":"true",className:"absolute inset-0",style:{background:ee}}),triggerLabel:n,triggerClassName:$({size:"sm",selected:c,className:"es-ts-swatch es-ts-swatch--any"}),"aria-label":l,disabled:o,children:/* @__PURE__ */J(W,{className:"es-pick-window",value:t??"",onChange:e=>r(e),label:l,disabled:o})})})]})]})}function te({styles:e,onChange:s,fonts:t,colours:l=[],settings:i=c,auto:u=[],fallback:m,sample:h,openId:p,defaultOpenId:f=null,onOpenChange:v,onAdd:g,rowActions:y,onRemove:T,max:N=o,device:k="desktop",readOnly:C=!1}){const x=O("textStyles",a),E=X(),[w,z]=Y(f),j=void 0!==p?p:w,L=e=>{void 0===p&&z(e),v?.(e)},M=F(null),[W,$]=Y(null);G(()=>{if(!W||!M.current)return;const e=[...M.current.querySelectorAll(".es-ts-item")].find(e=>e.dataset.tsId===W.id),s=e?e.querySelector(".es-ts-row"):M.current.querySelector(`.es-ts-add[data-ts-kind="${W.kind}"]`);s?.focus(),$(null)},[W]);/* @__PURE__ */
8
+ return J("div",{className:"es-ts",ref:M,children:n.map(a=>{const n=e.filter(e=>e.kind===a),o=!r(e,a,N),c=!C&&!o;/* @__PURE__ */
9
+ return Z(ae,{label:x.groups[a],children:[n.map(a=>{const n=y?.(a),r=null!=n&&!1!==n,o=Boolean(T)&&!C&&!d(a);/* @__PURE__ */
10
+ return J(le,{style:a,fonts:t,colours:l,settings:i,auto:u,fallback:m,sample:h,device:k,readOnly:C,open:j===a.id,onOpenChange:e=>L(e?a.id:null),onChange:t=>s(e.map(e=>e.id===t.id?t:e)),actions:o||r?/* @__PURE__ */Z(Q,{children:[o?_(x.remove,/* @__PURE__ */J(A,{variant:"ghost-danger",size:"sm",className:"es-ts-del","aria-label":x.removeNamed({name:a.name}),onClick:()=>(t=>{if(C||!T)return;const a=b(e,t.id,{name:x.styleName});if(!a)return;const l=e.filter(e=>e.kind===t.kind),i=l[l.indexOf(t)+1];j===t.id&&L(null),s(a.styles),T(a.removed),$({id:i?.id??null,kind:t.kind})})(a),children:/* @__PURE__ */J(D,{size:14,"aria-hidden":"true"})})):null,r?n:null]}):null},a.id)}),_(!C&&o?x.full({kind:a,max:N}):void 0,/* @__PURE__ */Z(I,{variant:"link",className:"es-ts-add","data-ts-kind":a,disabled:C,"aria-disabled":!(C||!o)||void 0,"aria-describedby":!C&&o?`${E}-full-${a}`:void 0,onClick:()=>{c&&(t=>{if(C)return;const a=S(e,t,{max:N,name:x.styleName,make:g});a&&s(a.styles)})(a)},children:[
11
+ /* @__PURE__ */J("span",{className:"es-ts-add-word",children:x.add[a]}),
12
+ /* @__PURE__ */J("span",{className:"es-ts-count",children:x.count({n:n.length,max:N})})]})),C||!o?null:/* @__PURE__ */J("span",{id:`${E}-full-${a}`,className:"es-vh",children:x.full({kind:a,max:N})})]},a)})})}function ae({label:e,children:s}){const t=X();/* @__PURE__ */
13
+ return Z("section",{className:"es-ts-section","aria-labelledby":t,children:[
14
+ /* @__PURE__ */J("div",{className:"es-ts-group",id:t,children:e}),s]})}function le({style:e,fonts:s,colours:t=[],settings:l=c,auto:i=[],fallback:n,sample:r,open:o,onOpenChange:d,onChange:v,actions:g,device:y="desktop",readOnly:S=!1}){const b=O("textStyles",a),T=`${X()}-open-${e.id}`,N=new Set(i),k=u.filter(e=>l.includes(e)),C={...n?.(e)??{},...e.values},x=m(C,y),E=s.find(e=>e.value===C.font),w={fontFamily:E?.family,fontSize:`${h(x.size??16)}px`,fontWeight:C.weight,fontStyle:C.italic?"italic":void 0};/* @__PURE__ */
15
+ return Z(V,{children:[
16
+ /* @__PURE__ */Z("div",{className:"es-ts-item","data-ts-id":e.id,children:[
17
+ /* @__PURE__ */Z("button",{type:"button",className:"es-ts-row","aria-expanded":o,"aria-controls":o?T:void 0,onClick:()=>d(!o),children:[
18
+ /* @__PURE__ */J("span",{className:"es-ts-chev","aria-hidden":"true",children:/* @__PURE__ */J(H,{size:12})}),
19
+ /* @__PURE__ */J("span",{className:"es-ts-name",style:w,children:e.name}),
20
+ /* @__PURE__ */J("span",{className:"es-ts-meta",children:p(x,s,b,{autoSize:N.has("size")&&void 0===x.size})})]}),g?/* @__PURE__ */J("div",{className:"es-ts-actions",children:g}):null]}),o?/* @__PURE__ */J("div",{className:"es-ts-open",id:T,children:/* @__PURE__ */J(ne,{style:e,values:C,fonts:s,colours:t,settings:k,autoSet:N,sample:r??b.sample,words:b,device:y,readOnly:S,set:s=>v(f([e],e.id,s)[0])})}):null]})}var ie={none:q,upper:P,capitalize:U,lower:K};function ne({style:s,values:a,fonts:n,colours:r,settings:o,autoSet:d,sample:c,words:u,device:h,readOnly:p,set:f}){const y=s.values,S=O("panel",i),b=n.find(e=>e.value===a.font),x=function(e,s){return e?s.find(s=>s.key===e)?.value??t(e)??void 0:void 0}(a.color,r),E=e=>"largestSize"===e||d.has(e),z=e=>E(e)?y[e]:a[e],j=m(y,h),L=j.size??z("size"),M=j.lineSpacing??z("lineSpacing"),W=j.letterSpacing??z("letterSpacing"),$=E("letterCase")?y.letterCase:a.letterCase,I={fontFamily:b?.family,fontSize:void 0===L?void 0:`${L}px`,fontWeight:a.weight,fontStyle:a.italic?"italic":void 0,lineHeight:void 0===M?void 0:String(M/100),letterSpacing:void 0===W?void 0:`${W}px`,color:x,textTransform:v($)},X=e=>{const s=T[e],t=E(e);/* @__PURE__ */
21
+ return J("div",{className:"es-ts-slider","data-ts-setting":e,children:/* @__PURE__ */J(l,{label:u.settings[e],value:y[e],onChange:s=>f({[e]:s}),min:s.min,max:s.max,step:s.step,shiftStep:s.shiftStep,sliderMin:s.sliderMin,sliderMax:s.sliderMax,unit:s.unit||void 0,styleValue:t?void 0:a[e],auto:t?u.auto:void 0,readOnly:p})},e)};/* @__PURE__ */
22
+ return Z(Q,{children:[
23
+ /* @__PURE__ */J("div",{className:"es-ts-preview",style:I,"aria-label":u.preview,children:c}),o.map(t=>{if("desktop"!==h)return g.includes(t)?"largestSize"===t&&"heading"!==s.kind?null:((s,t)=>{const a=T[s],i=N(s,t),n=k(z(s),"phone"===t?y[N(s,"tablet")]:void 0),r=!C(y[i]);/* @__PURE__ */
24
+ return J("div",{className:"es-ts-slider","data-ts-setting":s,"data-ts-device":t,children:/* @__PURE__ */J(w,{label:u.settings[s],changed:r,action:/* @__PURE__ */J(e,{label:u.settings[s],changed:r,disabled:p,onReset:()=>f({[i]:void 0}),detail:void 0===n?u.auto:`${n}${a.unit}`,words:S}),children:/* @__PURE__ */J(l,{bare:!0,label:u.settings[s],value:y[i],onChange:e=>f({[i]:e}),min:a.min,max:a.max,step:a.step,shiftStep:a.shiftStep,sliderMin:a.sliderMin,sliderMax:a.sliderMax,unit:a.unit||void 0,styleValue:n,auto:void 0===n?u.auto:void 0,readOnly:p})})},s)})(t,h):null;switch(t){case"font":/* @__PURE__ */
25
+ return J(re,{value:y.font,fonts:n,words:u,readOnly:p,set:f},t);case"color":/* @__PURE__ */
26
+ return J(oe,{value:y.color,hex:x,colours:r,words:u,readOnly:p,set:f},t);case"emphasis":{const e=(a.weight??400)>=600,s=!1!==b?.italic;/* @__PURE__ */
27
+ return Z("div",{className:"es-ts-set","data-ts-setting":t,children:[
28
+ /* @__PURE__ */J("span",{className:"es-ts-sub",children:u.settings.emphasis}),
29
+ /* @__PURE__ */Z("div",{className:"es-ts-icons",children:[_(u.bold,/* @__PURE__ */J(A,{className:"es-ts-icon","aria-label":u.bold,"aria-pressed":e,disabled:p,onClick:()=>f({weight:e?400:700}),children:/* @__PURE__ */J(R,{size:16})})),p||s?_(u.italic,/* @__PURE__ */J(A,{className:"es-ts-icon","aria-label":u.italic,"aria-pressed":Boolean(a.italic),disabled:p,onClick:()=>f({italic:!a.italic||void 0}),children:/* @__PURE__ */J(B,{size:16})})):/* @__PURE__ */J(A,{className:"es-ts-icon","aria-label":u.italic,"aria-pressed":Boolean(a.italic),"aria-disabled":!0,disabledReason:u.italicMissing,children:/* @__PURE__ */J(B,{size:16})})]})]},t)}case"letterCase":/* @__PURE__ */
30
+ return J(de,{value:y.letterCase??a.letterCase,auto:E("letterCase"),words:u,readOnly:p,set:f},t);case"largestSize":return"heading"===s.kind?X(t):null;default:return X(t)}})]})}function re({value:e,fonts:s,words:t,readOnly:a,set:l}){const i=X();/* @__PURE__ */
31
+ return Z("div",{className:"es-ts-set","data-ts-setting":"font",children:[
32
+ /* @__PURE__ */J("span",{className:"es-ts-sub",id:i,children:t.settings.font}),
33
+ /* @__PURE__ */J(x,{value:e,options:s.map(e=>({label:e.label,value:e.value})),onChange:e=>l({font:e}),ariaLabelledBy:i,readOnly:a})]})}function oe({value:e,hex:s,colours:t,words:a,readOnly:l,set:i}){/* @__PURE__ */
34
+ return J(se,{value:e,hex:s,colours:t,label:a.settings.color,followsWord:a.colour.follows,anyWord:a.colour.any,readOnly:l,onChange:e=>i({color:e})})}function de({value:e,auto:s,words:t,readOnly:a,set:l}){const i=y.map(e=>{const s=ie[e];return{id:e,label:/* @__PURE__ */J(s,{size:16}),title:t.case[e]}}),n=s?[{id:"auto",label:/* @__PURE__ */J("span",{children:t.case.auto}),title:t.case.autoTitle},...i]:i;/* @__PURE__ */
35
+ return Z("div",{className:"es-ts-set","data-ts-setting":"letterCase",children:[
36
+ /* @__PURE__ */J("span",{className:"es-ts-sub",children:t.settings.letterCase}),
37
+ /* @__PURE__ */J(E,{options:n,value:e??(s?"auto":"none"),ariaLabel:t.settings.letterCase,disabled:a,onChange:e=>l({letterCase:"auto"===e?void 0:e})})]})}export{se as ColourSwatchRow,le as TextStyleItem,ae as TextStylesGroup,te as TextStylesList};
@@ -68,22 +68,32 @@ interface TextStyleValues {
68
68
  /** px; headings only — the largest a heading is drawn anywhere on the site. */
69
69
  largestSize?: number;
70
70
  /**
71
- * px; the size on a PHONE (Lewis 2026-10-19: Heading 1 at 106 px on a 390 px
72
- * screen). Absent = the phone draws `size`. Edited on the Size row itself,
73
- * in the phone view (`TextStylesList`'s `device`), never as a row of its own.
74
- */
75
- sizePhone?: number;
76
- /**
77
- * px; the size on a TABLET (three views, Lewis 2026-10-09 / 10-23). Absent =
78
- * AUTO: the tablet works its size out from `size` by the text-size rule
79
- * (`AUTO_RULES.textSize` in `screen/lib/content/view-tiers`, x0.85 to 1px),
80
- * and a `sizePhone` left absent follows it (x0.7 of `size`). Nothing reads it
81
- * yet: the panel and the rendering come in later PRs of the plan.
71
+ * The same five numbers per view (Lewis 2026-10-19: Heading 1 at 106 px on a
72
+ * 390 px screen; 2026-11-02: the 5 rows). Absent = the view draws the next
73
+ * wider view. Edited on the setting's own row in that view
74
+ * (`TextStylesList`'s `device`), never as a row of its own.
82
75
  */
83
76
  sizeTablet?: number;
77
+ sizePhone?: number;
78
+ lineSpacingTablet?: number;
79
+ lineSpacingPhone?: number;
80
+ letterSpacingTablet?: number;
81
+ letterSpacingPhone?: number;
82
+ paragraphSpacingTablet?: number;
83
+ paragraphSpacingPhone?: number;
84
+ largestSizeTablet?: number;
85
+ largestSizePhone?: number;
84
86
  }
85
- /** Which view the list edits: the phone view's Size row writes `sizePhone`. */
86
- type TextStyleDevice = 'desktop' | 'phone';
87
+ /** Which view the list edits: the tablet and phone views' rows write that view's value. */
88
+ type TextStyleDevice = 'desktop' | 'tablet' | 'phone';
89
+ /** The settings a style keeps per view. Every other setting is the desktop's. */
90
+ declare const TEXT_STYLE_VIEW_NUMBERS: readonly ["size", "lineSpacing", "letterSpacing", "paragraphSpacing", "largestSize"];
91
+ type TextStyleViewNumber = (typeof TEXT_STYLE_VIEW_NUMBERS)[number];
92
+ /** The key a view's value of `key` is stored under. */
93
+ declare function textStyleViewKey(key: TextStyleViewNumber, device: 'tablet' | 'phone'): `${TextStyleViewNumber}${'Tablet' | 'Phone'}`;
94
+ /** What a view draws: its own value, else the next wider view's. The same
95
+ * object when no view value moves anything. */
96
+ declare function textStyleViewValues(values: TextStyleValues, device: TextStyleDevice): TextStyleValues;
87
97
  interface TextStyle {
88
98
  /** The host's, stable: the list never renames an id. */
89
99
  id: string;
@@ -272,4 +282,4 @@ declare function describeTextStyle(values: TextStyleValues, fonts: readonly Text
272
282
  autoSize?: boolean;
273
283
  }): string;
274
284
 
275
- export { CAMPAIGN_TEXT_STYLE_SETTINGS, TEXT_STYLE_CASES, TEXT_STYLE_CASE_CSS, TEXT_STYLE_DEFAULT_COUNT, TEXT_STYLE_KINDS, TEXT_STYLE_MAX, TEXT_STYLE_RANGES, TEXT_STYLE_SETTINGS, type TextStyle, type TextStyleAuto, type TextStyleCase, type TextStyleCaseCss, type TextStyleColour, type TextStyleDevice, type TextStyleFont, type TextStyleKind, type TextStyleNumber, type TextStyleRange, type TextStyleSetting, type TextStyleValues, addTextStyle, canAddTextStyle, defaultTextStyles, describeTextStyle, isDefaultTextStyle, isTextStyleCase, removeTextStyle, resolveTextStyle, textStyleCaseCss, textStyleCaseOfCss, textStyleRowSize, updateTextStyle, weightWord };
285
+ export { CAMPAIGN_TEXT_STYLE_SETTINGS, TEXT_STYLE_CASES, TEXT_STYLE_CASE_CSS, TEXT_STYLE_DEFAULT_COUNT, TEXT_STYLE_KINDS, TEXT_STYLE_MAX, TEXT_STYLE_RANGES, TEXT_STYLE_SETTINGS, TEXT_STYLE_VIEW_NUMBERS, type TextStyle, type TextStyleAuto, type TextStyleCase, type TextStyleCaseCss, type TextStyleColour, type TextStyleDevice, type TextStyleFont, type TextStyleKind, type TextStyleNumber, type TextStyleRange, type TextStyleSetting, type TextStyleValues, type TextStyleViewNumber, addTextStyle, canAddTextStyle, defaultTextStyles, describeTextStyle, isDefaultTextStyle, isTextStyleCase, removeTextStyle, resolveTextStyle, textStyleCaseCss, textStyleCaseOfCss, textStyleRowSize, textStyleViewKey, textStyleViewValues, updateTextStyle, weightWord };
@@ -1 +1 @@
1
- export{CAMPAIGN_TEXT_STYLE_SETTINGS,TEXT_STYLE_CASES,TEXT_STYLE_CASE_CSS,TEXT_STYLE_DEFAULT_COUNT,TEXT_STYLE_KINDS,TEXT_STYLE_MAX,TEXT_STYLE_RANGES,TEXT_STYLE_SETTINGS,addTextStyle,canAddTextStyle,defaultTextStyles,describeTextStyle,isDefaultTextStyle,isTextStyleCase,removeTextStyle,resolveTextStyle,textStyleCaseCss,textStyleCaseOfCss,textStyleRowSize,updateTextStyle,weightWord}from"../chunk-YHZSBL2N.js";
1
+ export{CAMPAIGN_TEXT_STYLE_SETTINGS,TEXT_STYLE_CASES,TEXT_STYLE_CASE_CSS,TEXT_STYLE_DEFAULT_COUNT,TEXT_STYLE_KINDS,TEXT_STYLE_MAX,TEXT_STYLE_RANGES,TEXT_STYLE_SETTINGS,TEXT_STYLE_VIEW_NUMBERS,addTextStyle,canAddTextStyle,defaultTextStyles,describeTextStyle,isDefaultTextStyle,isTextStyleCase,removeTextStyle,resolveTextStyle,textStyleCaseCss,textStyleCaseOfCss,textStyleRowSize,textStyleViewKey,textStyleViewValues,updateTextStyle,weightWord}from"../chunk-53QUHEHK.js";import"../chunk-DIOTWSCO.js";
@@ -56,6 +56,8 @@ interface FieldNumberProps extends ControlBase {
56
56
  interface FieldSliderProps extends Omit<FieldNumberProps, 'icon' | 'steppers' | 'placeholder' | 'ariaLabel' | 'ariaLabelledBy'> {
57
57
  /** The row's name; it labels both the value and the slider. */
58
58
  label: string;
59
+ /** The host draws the name line: the name is the control's accessible name only. */
60
+ bare?: boolean;
59
61
  sliderMin: number;
60
62
  sliderMax: number;
61
63
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efficient-easel",
3
- "version": "26.16.0",
3
+ "version": "27.0.0",
4
4
  "description": "Efficient Easel: the EFFICIENT editors' shared engine and chrome: the saved document as pure functions, the published renderer, and the editor frame, panels, Layers tree, text grammar and type-in-place box. Published as editor-shell up to 0.66.0 and as efficient-editor up to 0.95.0.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Efficient Pty Ltd",
@@ -1,7 +0,0 @@
1
- import{clientOnly as r}from"./chunk-GXQCZJOP.js";import{ScreenStoreProvider as n}from"./chunk-JDQSRKJG.js";import{ScreenChrome as e}from"./chunk-T5U2UZO6.js";import{ScreenDocumentProvider as i,useScreenDocument as a}from"./chunk-CPIWSFGR.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-C4TJN6GR.js";import{documentPermissions as s}from"./chunk-YYD257TD.js";import{useWords as c}from"./chunk-MFIRYGHW.js";import{useMemo as t,useState as d,useRef as l,useEffect as m,useCallback as g}from"react";import{Dialog as h,Button as f}from"efficient-shell/ui";import{jsx as u,jsxs as p,Fragment as v}from"react/jsx-runtime";var C=r(n),k=r(e);function N({onCancel:r,onDiscard:n,onSave:e}){const i=c("screen",o).leave,[a,s]=d(!1),t=l(!0);m(()=>(t.current=!0,()=>{t.current=!1}),[]);const C=g(async()=>{s(!0);try{await e()}finally{t.current&&s(!1)}},[e]);/* @__PURE__ */
2
- return u(h,{open:!0,role:"alertdialog",size:"sm",title:i.title,onClose:r,footer:/* @__PURE__ */p(v,{children:[
3
- /* @__PURE__ */u(f,{variant:"secondary",onClick:r,children:i.cancel}),
4
- /* @__PURE__ */u(f,{variant:"ghost-danger",onClick:n,children:i.discard}),
5
- /* @__PURE__ */u(f,{variant:"primary",loading:a,onClick:()=>{C()},children:i.save})]}),children:i.body})}function j({target:r,addressing:n,onHostMessage:e,children:a}){/* @__PURE__ */
6
- return u(i,{target:r,addressing:n,onHostMessage:e,children:a})}var y=(r,n)=>/* @__PURE__ */p(v,{children:[r,n]});function D({config:r,parts:n,wrap:e=y}){const{data:i,error:d,redirecting:l,ready:m,readOnly:g,onChange:h,pendingNav:f,cancelPendingNav:p,discardAndNavigate:v,saveAndNavigate:j}=a(),D=t(()=>s(!g),[g]),G=c("screen",o);return l?/* @__PURE__ */u("div",{className:"sf-msg",children:G.loading}):d?/* @__PURE__ */u("div",{className:"sf-msg sf-msg--error",children:d}):m?i?e(
7
- /* @__PURE__ */u(C,{config:r,data:i,onChange:h,permissions:D,parts:n,children:/* @__PURE__ */u(k,{})}),f&&/* @__PURE__ */u(N,{onCancel:p,onDiscard:v,onSave:j})):/* @__PURE__ */u("div",{className:"sf-msg",children:G.loading}):/* @__PURE__ */u("div",{className:"sf-msg",children:G.waitingForAuthorization})}export{D as DocumentScreen,j as ScreenMount};
@@ -1,2 +0,0 @@
1
- import{noControlField as e}from"./chunk-22I55W37.js";import{DEFAULT_SCREEN_WORDS as r}from"./chunk-C4TJN6GR.js";import{deviceMetaOf as n,DEVICE_FIELD_MARKER as t}from"./chunk-YCSZAP7T.js";import{useWords as o}from"./chunk-MFIRYGHW.js";import{usePreviewDevice as i}from"./chunk-BSPCSC45.js";import{jsx as c}from"react/jsx-runtime";function u(e){return"mobile"===e?"mobile":"desktop"}var s={desktop:null,tablet:r.deviceNote.tablet,mobile:r.deviceNote.mobile},d="data-sf-device-hidden";function m(){/* @__PURE__ */
2
- return c("span",{hidden:!0,[d]:""})}function f({tier:e,render:r,...n}){const t=i();return"each"===e?/* @__PURE__ */c(r,{...n,tier:u(t)}):u(t)===e?/* @__PURE__ */c(r,{...n}):/* @__PURE__ */c(m,{})}function l(e){return n(e)?.inner??e}function p(e,r){const n=r.render;return{...r,[t]:{tier:e,inner:r},render:r=>/* @__PURE__ */c(f,{tier:e,render:n,...r})}}function a(){const e=o("screen",r).deviceNote,n=i(),t="desktop"===n?null:e[n];return t?/* @__PURE__ */c("div",{className:"sf-device-scope",children:t}):/* @__PURE__ */c(m,{})}function h(){return e({type:"custom",render:()=>/* @__PURE__ */c(a,{})},"always")}export{d as DEVICE_HIDDEN_ATTR,s as DEVICE_NOTE,p as deviceField,h as deviceNote,u as shownTier,l as withoutDeviceGate};
@@ -1,2 +0,0 @@
1
- import{routeSharedHostMessage as e}from"./chunk-QZJKWKGH.js";import{describeLoadFailure as r,hostLoadRefusal as n}from"./chunk-ERR437B5.js";import{editLockOf as t}from"./chunk-GR3XRILS.js";import{NO_DOCUMENT_ADDRESSING as o}from"./chunk-RLBXE4EU.js";import{saveStatusOf as u,resetForDocumentSwitch as a}from"./chunk-6ATIYLUL.js";import{isExpiredSession as s,readEaselFailure as i}from"./chunk-KO47WAWR.js";import{useAdminBridge as l}from"./chunk-NQW6XCAY.js";import{STATUS_UNREACHABLE as c}from"./chunk-KCOBHPN6.js";import{useEaselSession as d}from"./chunk-YM4UEGBV.js";import{backendOf as f,setSessionDocumentSite as m}from"./chunk-SNF5764Q.js";import{useEaselHost as k}from"./chunk-LX23TCTP.js";import{DEFAULT_SCREEN_WORDS as v}from"./chunk-C4TJN6GR.js";import{useAutosave as g}from"./chunk-NDRZP6YR.js";import{canWriteDocument as p,newEaselClientId as h,reloadIfVersionMoved as y,openUnansweredClaim as w,FAIL_OPEN_RETRY_MS as b,CLAIM_FAIL_OPEN_MS as S,holderOf as I}from"./chunk-YYD257TD.js";import{useWords as P}from"./chunk-MFIRYGHW.js";import{createContext as j,useContext as R,useState as E,useMemo as T,useCallback as B,useEffect as C,useRef as A}from"react";import{jsx as H}from"react/jsx-runtime";var L={content:[],root:{},zones:{}};var N=j(null);function D(){const e=R(N);if(!e)throw new Error("useStorefrontDocument must be used within StorefrontDocumentProvider");return e}function O({target:j,addressing:R=o,onHostMessage:D,children:O}){const Y=R,{homeSlug:F,entryMayBounce:M,entryBounce:W,onSwitch:G,tellsHost:K,adapterFor:U,migrateRenamedProps:V,describeMissing:X,onLoadFailed:x}=Y,[Q,J]=E(j),Z=k(),z=d(),_=T(()=>f(z),[z]),q=T(()=>t(z),[z]),$="template"===Q.kind,ee="template"===Q.kind?Q.id:null,re="template"===Q.kind?Q.pageSlug??F??"":"document"===Q.kind?Q.slug??"":Q.slug,ne="page"===Q.kind?Q.siteId??null:null,te=z.blocks,oe=T(()=>U(Q,_,te),[U,_,te,Q.kind,"template"===Q.kind?Q.id:"document"===Q.kind?Q.record:Q.siteId]),ue=oe.capabilities,ae=B(e=>z.documentHooks?.stored?.(e)??e,[z]);C(()=>{m(z,ne)},[z,ne]);const se=A(Q);C(()=>{se.current=Q},[Q]);const{token:ie,tokenRef:le,capabilities:ce}=l({onMessage:r=>{if(D?.(r)||e(r))return;const n=r;if("storefront-editor:navigate"===n?.type){const e=r;e?.target&&Er(e.target)}}}),de=!z.usesBridgedToken||null!==ie,fe=oe.lock,me=Boolean(_.lock),[ke,ve]=E(null),[ge,pe]=E(null),[he,ye]=E(null),[we,be]=E(null),Se=P("screen",v),Ie=we?function(e,r){if(null!==e.sentence)return e.sentence;if(!e.missing)return r.loadFailed({cause:e.cause});switch(e.target.kind){case"template":return r.missingTemplatePage;case"document":return r.missingDocument;default:return r.missingPage({slug:e.slug})}}(we,Se):null,[Pe,je]=E(null),Re=A(null),Ee=A(null),[Te,Be]=E(!1),Ce=A(null),[Ae,He]=E(null),Le=A(null),[Ne,De]=E(null),[Oe,Ye]=E(!1),Fe=A(null);C(()=>{Fe.current=Ne},[Ne]);const[Me,We]=E(ue.hasEditLock?{kind:"checking"}:{kind:"editing"}),Ge=A(Me);C(()=>{Ge.current=Me},[Me]);const Ke=A(()=>Promise.resolve(!1)),Ue=B(e=>{Ee.current=e,Be(!0)},[]),Ve=g({save:async({id:e,data:r})=>{if(p(Ge.current)){if(!await Ke.current(e,r)){if(!p(Ge.current))return void Ue({id:e,data:r});throw new Error("page save did not land")}}else Ue({id:e,data:r})},onFailure:(e,r)=>{0===r&&Z.send("storefront-editor:save-failed")}}),{state:Xe,push:xe,flush:Qe,pause:Je,resume:Ze,stop:ze,reset:_e,retryNow:qe,hasPending:$e}=Ve,er=A(Xe);C(()=>{er.current=Xe},[Xe]);const rr=u(Xe),nr=B(()=>{const e=Ee.current;e&&(Ee.current=null,Be(!1),xe(e))},[xe]),tr=A("");tr.current||(tr.current=h());const[or,ur]=E(0),ar=A(!1),[sr,ir]=E(M(j)),lr=A(!1);C(()=>{if(lr.current)return;lr.current=!0;const e=Z.address.search(),r=W(j,e);r?Z.address.load(r):M(j)&&ir(!1)},[j,Z]);const cr=Z.send;C(()=>{if(!de)return;let e=!1;const t=se.current,o=oe.resolve(re),u=z.documentHooks?.opening?.({slug:re,isTemplate:$,capabilities:ue});return o.then(async r=>{if(e)return;if(!r)return"page"===t.kind&&null!==F&&re!==F?void Z.address.load({kind:"page",slug:F,siteId:ne??void 0}):(be({target:t,slug:re,missing:!0,sentence:X?.(t)??null}),void x?.(t,null));const n=r.readOnlyReason?r.readOnlyReason:null;Re.current=n,je(n),ve(r.id),pe(r.kind??null),Le.current=r.version??null;const o=r.layout,a=o&&Object.keys(o).length?o:L,s=V(a),i=u?await u(s):s;e||ye(i)}).catch(o=>{e||(console.error("[storefront-editor] document load failed",o),be({target:t,slug:re,missing:!1,sentence:n(o,{slug:re},z),cause:r(o,z)}),x?.(t,o))}),()=>{e=!0}},[de,ie,$,oe,re]);const dr=B(e=>new Promise(r=>{const n=Date.now(),t=setInterval(()=>{const o=le.current;o&&o!==e?(clearInterval(t),r(o)):Date.now()-n>6e3&&(clearInterval(t),r(null))},200)}),[]),fr=B(async e=>{const r=le.current;if(!r&&z.usesBridgedToken)return{ok:!1,error:new Error("no editor token")};try{return{ok:!0,value:await e(r??"")}}catch(n){if(s(n,z)){cr("storefront-editor:auth-expired");const n=r?await dr(r):null;if(n)try{return{ok:!0,value:await e(n)}}catch(e){return{ok:!1,error:e}}}return{ok:!1,error:n}}},[cr,dr,z]),mr=B(async e=>{const r=le.current?await fr(e):{ok:!1};return r.ok||cr("storefront-editor:save-failed"),r.ok},[cr,fr]),kr=B(async(e,r,n=!1)=>{if(null!==Re.current)return!1;if(!p(Ge.current))return!1;if(Fe.current)return!1;const t=await fr(()=>oe.saveLayout(e,r,Le.current,tr.current));if(t.ok)return Le.current=t.value.version??Le.current,Ye(!1),!0;const o=q.readLockTaken(t.error);if(o){const e={kind:"takenover",holder:o};return Ge.current=e,We(e),!1}const u=q.readSaveConflict(t.error);if(u){if(u.savedByYou&&!n&&oe.rereadVersion){const n=await fr(()=>oe.rereadVersion(e));if(n.ok&&n.value)return Le.current=n.value,Ke.current(e,r,!0)}ze(),Fe.current=u,De(u)}return Ye(i(t.error,z)?.status===c),!1},[oe,fr,ze,z]);C(()=>{Ke.current=kr},[kr]);const vr=B(e=>{if(null!==Re.current)return;if(cr("storefront-editor:dirty"),!ke)return;const r=ae(e);Ce.current=r,p(Ge.current)?xe({id:ke,data:r}):Ue({id:ke,data:r})},[ke,cr,Ue,xe,ae]),gr=B(async()=>{p(Ge.current)&&nr();return await Qe()&&null==Ee.current},[nr,Qe]),pr=A(gr);C(()=>{pr.current=gr},[gr]);const hr=A(fr);C(()=>{hr.current=fr},[fr]);const yr=B(()=>{Z.address.reload()},[Z]),wr=A(()=>Promise.resolve(!1));C(()=>{wr.current=()=>{const e=oe.rereadVersion;return ke&&e?y({ours:Le.current,stored:async()=>{const r=await hr.current(()=>e(ke));return r.ok?r.value:null},hasPending:()=>null!=Ee.current||$e(),reload:yr}):Promise.resolve(!1)}},[oe,ke,$e,yr]);const br=null!==Pe;C(()=>{if(!fe||!ke||!de||br)return;let e=!1,r=null,n=null;const t=tr.current,o={claim:async e=>{const r=await hr.current(()=>fe.claim(ke,t,e));if(r.ok)return{heartbeat_seconds:r.value.heartbeatSeconds};throw r.error},cancelled:()=>e,currentAccess:()=>Ge.current,heldWrite:()=>({pending:null!=Ee.current||$e(),autoSaveEnabled:!er.current.paused,saveConflict:null!=Fe.current}),setAccess:e=>{Ge.current=e,We(e)},releaseHeldWrite:()=>{pr.current()},startHeartbeat:e=>{r&&clearInterval(r),r=setInterval(()=>{u(!1)},e)},stopHeartbeat:()=>{r&&(clearInterval(r),r=null)},reloadIfMoved:()=>{wr.current()}},u=q.makeClaimBeat(o),a=ar.current;return ar.current=!1,a||(We({kind:"checking"}),n=setTimeout(()=>{n=null,w(o)&&o.startHeartbeat(b)},S)),u(a).finally(()=>{n&&clearTimeout(n),n=null}),()=>{e=!0,n&&clearTimeout(n),r&&clearInterval(r),fe.release(ke,t).catch(()=>{})}},[ke,fe,de,ie,or,br]);const Sr=B(()=>{fe&&ke&&(ar.current=!0,ur(e=>e+1))},[ke,fe]),Ir=B(()=>{We(e=>{const r="blocked"===e.kind||"takenover"===e.kind?e.holder:null;return r?{kind:"readonly",holder:r}:e})},[]),Pr=B(()=>{er.current.paused?(p(Ge.current)&&nr(),Ze()):Je()},[nr,Je,Ze]),jr=B(()=>{qe()},[qe]),Rr=B(e=>{Ce.current=null,a("template"!==e.kind&&me,{resetAutosave:()=>{_e(),Ee.current=null,Be(!1)},setVersion:e=>{Le.current=e},setSaveConflict:De,setAccess:We}),G(e),J(e),Re.current=null,je(null),ve(null),pe(null),ye(null),be(null),Z.address.show(e),"document"!==e.kind&&K(e)&&Z.send("storefront-editor:navigated",{target:e})},[_e,Z,me,G,K]),Er=B(e=>{if(function(e,r,n){if(e.kind!==r.kind)return!1;if("template"===e.kind){const t=r;return e.id===t.id&&(e.pageSlug??n)===(t.pageSlug??n)}if("document"===e.kind){const n=r;return e.record===n.record&&(e.slug??"")===(n.slug??"")}const t=r;return e.slug===t.slug&&e.siteId===t.siteId}(e,se.current,F))return;const r=null!=Ee.current;if(!r&&!$e())return void Rr(e);const n=er.current;r||n.paused||n.failed||n.stopped?He(e):Qe().then(r=>{r?Rr(e):He(e)})},[Rr,$e,Qe,F]),Tr=B(()=>He(null),[]),Br=B(()=>{He(e=>(e&&Rr(e),null))},[Rr]),Cr=B(async()=>{const e=Ae;if(!e)return;await gr()&&(He(null),Rr(e))},[Ae,gr,Rr]),Ar=B(async e=>{if(null!==Re.current)return;if(!ke)return;if(!p(Ge.current)||Fe.current)return;const r=ae(e);if(!await kr(ke,r))return void(Fe.current||cr("storefront-editor:save-failed"));const n=oe.publish;if(!ue.canPublish||!n)return void cr("storefront-editor:saved");const t=await fr(()=>n(ke,Le.current??void 0));if(!t.ok){const{error:e}=t;return void cr("storefront-editor:publish-failed",{reason:e instanceof Error&&e.message?e.message:null})}Le.current=t.value.version??Le.current,cr("storefront-editor:published")},[ke,oe,ue.canPublish,cr,kr,fr,ae]);/* @__PURE__ */
2
- return H(N.Provider,{value:{target:Q,adapter:oe,capabilities:ue,templateId:ee,currentSlug:re,currentKind:ge,siteId:ne,ready:de,token:ie,tokenRef:le,notifyParent:cr,bridgeCapabilities:ce,runAuthed:mr,docId:ke,data:he,getLiveData:()=>Ce.current??he,error:Ie,redirecting:sr,saveStatus:rr,saveState:Xe,autoSaveEnabled:!Xe.paused,autoSaveStoppedByConflict:Xe.stopped,hasUnsavedEdits:Xe.pending||Te,toggleAutoSave:Pr,retrySave:jr,onChange:vr,flushSave:gr,onPublish:Ar,access:Me,readOnly:null!==I(Me)||null!==Pe||null!==Ne,readOnlyReason:Pe,takeOverEditing:Sr,viewReadOnly:Ir,saveConflict:Ne,saveUnreachable:Oe,reloadFromServer:yr,navigate:Er,pendingNav:Ae,cancelPendingNav:Tr,discardAndNavigate:Br,saveAndNavigate:Cr},children:O})}export{N as ScreenDocumentContext,O as ScreenDocumentProvider,D as useScreenDocument};
@@ -1 +0,0 @@
1
- var t=["desktop","tablet","mobile"],e={desktop:"Desktop",tablet:"Tablet",mobile:"Mobile"},n=720,o=1100;function a(t){return t>=1100?"desktop":t>=720?"tablet":"mobile"}function r(t){return`${t}Tablet`}function b(t){return`${t}Phone`}function u(t){return null==t}var l=t=>e=>"number"==typeof e?e*t:e,p=t=>t;var h={spacing:{tablet:l(.75),phone:l(2/3),round:function(t){const e=Math.ceil(Math.abs(t)/4-.5);return 4*(t<0?-e:e)+0}},columns:{tablet:t=>"number"==typeof t?Math.min(t,2):t,phone:t=>"number"==typeof t?1:t},stack:{tablet:p,phone:t=>void 0===t?t:"stacked"},textSize:{tablet:l(.85),phone:l(.7/.85),round:Math.round},heightMode:{tablet:p,phone:t=>"px"===t?"fit":t},heightPx:{tablet:l(.75),phone:p,round:Math.round},same:{tablet:p,phone:p}},i=Object.fromEntries(Object.keys(h).map(t=>[t,{tablet:p,phone:p}]));function c(t,e,n,o,a=h){const r=a[t],b=t=>r.round&&"number"==typeof t?r.round(t):t,l=u(n)?r.tablet(e):n,p=u(o)?r.phone(l):o;return{desktop:e,tablet:u(n)?b(l):n,phone:u(o)?b(p):o}}export{h as AUTO_RULES,i as FOLLOW_RULES,o as VIEW_DESKTOP_MIN,n as VIEW_TABLET_MIN,t as VIEW_TIERS,e as VIEW_TIER_LABEL,u as isAuto,b as phoneKey,c as resolveViewValue,r as tabletKey,a as viewTierForWidth};
@@ -1,17 +0,0 @@
1
- import{deviceField as e}from"./chunk-BLE3U2GS.js";import{noControlField as n,NoControlMark as t}from"./chunk-22I55W37.js";import{describedAs as l}from"./chunk-LX23TCTP.js";import{withStyleKind as o}from"./chunk-CWELHADJ.js";import{phoneKey as a}from"./chunk-E52W3M5I.js";import{foldMetaOf as i,FOLD_FIELD_MARKER as r}from"./chunk-ANPOR6EY.js";import{useSelectedHost as s,useEasel as u}from"./chunk-3W2O22DZ.js";import{sidesStartEach as c,SidesInput as d,SidesEachToggle as p}from"./chunk-CLAADE4J.js";import{SettingsDefaultReset as f}from"./chunk-2T22IY3J.js";import{DEFAULT_PANEL_WORDS as b}from"./chunk-56ID6FKZ.js";import{FieldSelect as m}from"./chunk-KFWNGPW3.js";import{SettingsSwitch as h}from"./chunk-OECWLNKJ.js";import{SettingsField as v}from"./chunk-MIX7EGRG.js";import{SettingsSegmented as g}from"./chunk-DX3VILZ3.js";import{useWords as y}from"./chunk-MFIRYGHW.js";import{useState as k}from"react";import{AlignmentIcon as w,BoxJustifyIcon as x,WrapIcon as C,ArrowRightIcon as j,GapIcon as F,WidthIcon as L,PlacementIcon as O,NudgeIcon as S,DesktopIcon as E,BoxXEndIcon as P,BoxXCenterIcon as R,BoxXStartIcon as A,PaddingAllIcon as M,BoxYBetweenIcon as W,BoxYStretchIcon as I,BoxYEndIcon as K,BoxYCenterIcon as B,BoxYStartIcon as $,BoxXBetweenIcon as G,BoxXStretchIcon as N,BoxItemAlignmentIcon as T}from"efficient-shell/icons/efficient";import{textAlignOptions as V,AlignmentGrid as J,PositionInput as D,Slider as H}from"efficient-shell/ui";import{jsx as _,Fragment as z,jsxs as X}from"react/jsx-runtime";var Y=e=>e;function Z(e,n){return e("{value} on desktop").replace("{value}",n)}var U=()=>{};function q(){return null}function Q(e){if(!e.trim())throw new Error("noGlyph() needs a reason naming the ruling that decided it.");/* @__PURE__ */
2
- return _(q,{},e)}function ee(e){return e.type===q}function ne(e){return ee(e)?void 0:e}function te(e){for(const[n,t]of Object.entries(e))t&&"object"==typeof t&&!i(t)&&o(t,`section:${n}`);return e}function le(e,n){return{type:"custom",[r]:{label:e,level:n},marker:!0,fold:e,render:()=>/* @__PURE__ */_(z,{})}}function oe(e){return le(e,2)}function ae(e){return le(e,1)}var ie=[{label:"Start",value:"start"},{label:"Center",value:"center"},{label:"Space between",value:"between"},{label:"End",value:"end"}],re=[{label:"Start",value:"start"},{label:"Center",value:"center"},{label:"End",value:"end"},{label:"Stretch",value:"stretch"}],se="Wrap",ue=[{label:"Wrap",value:"wrap"},{label:"No wrap",value:"nowrap"}],ce="Direction",de=[{label:"Stacked",value:"column"},{label:"One row",value:"row"}],pe={min:-32,max:64,step:2,builtIn:0},fe={min:30,max:100,step:5,fallback:60},be=["top-left","top-center","top-right","left","center","right","bottom-left","bottom-center","bottom-right"],me="bottom-left",he={"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"},ve=be.map(e=>({value:e,label:he[e]}));function ge(e,n=me){return be.includes(e)?e:n}var ye=40,ke=e=>"number"==typeof e?e:null;function we(e,n,t){const l={};for(const o of["x","y"])t[o]!==n[o]&&(l[e[o]]=t[o]??void 0);return l}var xe=["top","right","bottom","left"],Ce={top:"sectionPaddingTop",right:"sectionPaddingRight",bottom:"sectionPaddingBottom",left:"sectionPaddingLeft"},je=e=>"number"==typeof e?e:null;function Fe(e,n,t){const l={};for(const o of xe)t[o]!==n[o]&&(l[e[o]]=t[o]??void 0);return l}function Le(e){if("number"==typeof e)return{top:e,right:e,bottom:e,left:e};const n=e&&"object"==typeof e?e:{};return Object.fromEntries(xe.map(e=>[e,je(n[e])]))}function Oe(e){const n={};for(const t of xe)"number"==typeof e[t]&&(n[t]=e[t]);return Object.keys(n).length?n:void 0}function Se(e,n={}){const t=n=>{const t=n[e];return t&&"object"==typeof t?t:{}},l=e=>Object.hasOwn(n,e)?n[e]:e;return{read:(e,n)=>t(e)[l(n)],write:(n,o,a)=>{const i={...t(n)};return void 0===a?delete i[l(o)]:i[l(o)]=a,{[e]:Object.keys(i).length?i:void 0}}}}function Ee(e,n,t){const l=Pe(e),o=s();if(t)return[t.value,t.onChange];const a=o?.values??{};return[e.read(a,n),e=>l([[n,e]])]}function Pe(e){const n=s();return t=>{n&&n.onChangeMany(n=>{let l={};for(const[o,a]of t)l={...l,...e.write({...n,...l},o,a)};return l})}}var Re={read:(e,n)=>e[n],write:(e,n,t)=>({[n]:t})},Ae={fieldKey:a,ownField:!0,read:(e,n)=>e[a(n)],write:(e,n,t)=>({[a(n)]:t})};function Me(e){return{...Se(e),fieldKey:n=>`_${e}_${n}`}}function We({row:e,desktopKey:n,access:t,props:l}){const o=s(),a=o?.values?.[n],[i,r]=Ee(t,n);return t.ownField?e.render({...l,follows:a,twinAccess:t}):e.render({...l,value:i,storedValue:i,follows:a,twinAccess:t,onChange:r})}function Ie(n,t,l=Ae,o={}){const a=o.phoneRow??t,i={...a,render:e=>/* @__PURE__ */_(We,{row:a,desktopKey:n,access:l,props:e})};return{[n]:e("desktop",t),[l.fieldKey(n)]:e("mobile",i)}}var Ke=["left","center","right"];function Be(e,{options:n,value:t,onChange:l,ariaLabel:o,disabled:a=!1}){/* @__PURE__ */
3
- return _(g,{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(o),disabled:a})}function $e(e,{label:n,value:t,onChange:l,points:o}){const a=o.find(e=>e.disabled),i=o.map(n=>({...n,label:e(n.label),...n.title?{title:e(n.title)}:null}));/* @__PURE__ */
4
- return _(v,{label:e(n),icon:/* @__PURE__ */_(O,{}),hint:a?.title?e(a.title):void 0,children:/* @__PURE__ */_(J,{label:e(n),value:t,points:i,onChange:l})})}function Ge({say:e,label:n,value:t,onChange:l,pointsFor:o}){const{appState:a,selectedItem:i}=u(e=>e),r=i?.props?.id?String(i.props.id):void 0;return $e(e,{label:n,value:t,onChange:l,points:o(a?.data,r)})}function Ne({say:e,o:n}){const t=s(),l=y("panel",b),o=t?.values??{},a={x:ke(o[n.keys.x]),y:ke(o[n.keys.y])},i=e(n.label??"Position"),r=Boolean(a.x||a.y),u=e=>{const l=we(n.keys,a,e);Object.keys(l).length&&t?.onChangeMany(l)},c=/* @__PURE__ */_(D,{label:i,value:a,onChange:u,words:{x:e("Left and right"),y:e("Up and down"),unit:"px"},placeholder:{x:"0",y:"0"},min:n.min,max:n.max,step:n.step??1}),d=/* @__PURE__ */_(f,{words:l,label:i,changed:r,detail:"0 px, 0 px",onReset:()=>u({x:null,y:null})});return null===n.label?/* @__PURE__ */X("div",{className:"sf-position-line",children:[c,d]}):/* @__PURE__ */_(v,{label:i,icon:/* @__PURE__ */_(S,{}),changed:r,action:d,children:c})}var Te={x:{start:/* @__PURE__ */_(A,{}),center:/* @__PURE__ */_(R,{}),end:/* @__PURE__ */_(P,{}),stretch:/* @__PURE__ */_(N,{}),between:/* @__PURE__ */_(G,{})},y:{start:/* @__PURE__ */_($,{}),center:/* @__PURE__ */_(B,{}),end:/* @__PURE__ */_(K,{}),stretch:/* @__PURE__ */_(I,{}),between:/* @__PURE__ */_(W,{})}},Ve=e=>"row"===e?"row":"column";function Je({say:e,kind:n,label:t,options:l,value:o,onChange:a,o:i}){const r=s(),u="justify"===n==("row"===(i.runs??Ve)(r?.values?.[i.directionKey??"direction"]))?"x":"y";return Be(e,{options:l.map(e=>({label:e.label,value:e.value,picture:Te[u][e.value]})),value:o,onChange:a,ariaLabel:t})}function De(e,n){const t=(e.useFallback??U)(n);return Object.fromEntries(xe.map(n=>[n,t?.[n]??e.fallback[n]]))}function He({say:e,tier:n,o:t,props:l}){const o=De(t,l),a=s(),i=a?.values??{},r="mobile"===n?t.phoneKeys:t.keys,u=Object.fromEntries(xe.map(e=>[e,je(i[r[e]])])),c="mobile"===n?Object.fromEntries(xe.map(e=>[e,je(i[t.keys[e]])])):null;/* @__PURE__ */
5
- return _(ze,{say:e,o:t,fallback:o,value:u,follows:c,readOnly:l.readOnly,onChange:e=>{const n=Fe(r,u,e);Object.keys(n).length&&a?.onChangeMany(n)}})}function _e({say:e,o:n,props:t}){const l=De(n,t);/* @__PURE__ */
6
- return _(ze,{say:e,o:n,fallback:l,value:Le(t.value),follows:"follows"in t?Le(t.follows):null,readOnly:t.readOnly,onChange:e=>t.onChange(Oe(e))})}function ze({say:e,o:n,fallback:t,value:l,follows:o,readOnly:a,onChange:i}){const r=Object.fromEntries(xe.map(e=>[e,String(o?.[e]??t[e])])),[s,u]=k(()=>c(l,r)),m=y("panel",b),h=xe.map(e=>r[e]),g=`${1===new Set(h).size?h[0]:h.join(" / ")}px`;/* @__PURE__ */
7
- return _(v,{label:e(n.label),icon:n.icon??/* @__PURE__ */_(M,{}),action:/* @__PURE__ */X(z,{children:[
8
- /* @__PURE__ */_(p,{each:s,label:e("Each side"),onChange:u,disabled:a}),
9
- /* @__PURE__ */_(f,{words:m,label:e(n.label),changed:xe.some(e=>"number"==typeof l[e]),detail:o?Z(e,g):g,disabled:a,onReset:()=>i({top:null,right:null,bottom:null,left:null})})]}),children:/* @__PURE__ */_(d,{label:e(n.label),each:s,value:l,placeholder:r,min:n.min,max:n.max,step:n.step,readOnly:a,onChange:i,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"}})})}var Xe=e=>""===e||"px"===e?e:` ${e}`;function Ye({label:e,value:n,onChange:t,min:l,max:o,step:a=1,unit:i="",hint:r,emptyLabel:s,inputMax:u,readOnly:c=!1,clears:d,detail:p,resetWords:b}){const m="number"==typeof n,h=d?/* @__PURE__ */_(f,{label:e,changed:m,detail:p??s??(void 0===r?void 0:`${r}${Xe(i)}`),disabled:c,onReset:()=>t(void 0),...b?{words:b}:{}}):void 0;return{track:/* @__PURE__ */_("div",{className:"sf-slider",children:/* @__PURE__ */_(H,{min:l,max:o,step:a,value:n,suffix:i||void 0,showInput:!0,label:e,disabled:c,...d&&void 0!==r?{placeholderValue:r}:{},...s?{emptyLabel:s}:{},...void 0!==u?{inputMax:u}:{},size:"sm",boxSize:"md",className:"sf-slider-track",onChange:e=>{null===e?d&&m&&t(void 0):e!==n&&t(e)}})}),reset:h}}function Ze({caption:e,label:n,value:t,hint:l,emptyLabel:o,...a}){const i=void 0!==l||void 0!==o,r="number"==typeof t,{track:s,reset:u}=Ye({...a,label:n,value:r?t:i?null:a.min,hint:l,emptyLabel:o,clears:i});/* @__PURE__ */
10
- return _(v,{label:e??n,action:u,children:s})}function Ue({draw:e,props:n,useMax:t,useHint:l}){return e(n,{max:(t??U)(n),hint:(l??U)(n)})}function qe(o=Y){function i(e,n,t,a,i,r,s="",u){const c="function"==typeof u?{action:u}:u??{},{action:d,clear:p}=c,f=(l,u)=>{const f="storedValue"in l?l.storedValue:l.value,b="follows"in l,m=b&&!1!==p?.phoneFollows,h=b||void 0!==p,g="number"==typeof l.value,y=void 0===p?r:u.hint??("function"==typeof p.hint?p.hint(l):p.hint)??r,k=m&&"number"==typeof l.follows?l.follows:y,w=Xe(s),x=!p?.emptyLabel||m&&"number"==typeof l.follows?void 0:p.emptyLabel,C=x??`${k}${w}`,j="function"==typeof c.hint?c.hint(l):c.hint,{track:F,reset:L}=Ye({label:o(e),value:g?l.value:h?null:r,onChange:e=>l.onChange(e),min:t,max:u.max??a,step:i,unit:s,hint:h?k:void 0,emptyLabel:x,inputMax:c.inputMax,readOnly:!0===l.readOnly,clears:h,detail:m?Z(o,C):C});/* @__PURE__ */
11
- return _(v,{label:o(e),icon:ne(n),hint:void 0===j?void 0:o(j),action:h?L:d?d(f,l.onChange):void 0,children:F})},b=c.useMax,m=p?.useHint;return{type:"custom",...l({},{type:"number",label:e}),render:b||m?e=>/* @__PURE__ */_(Ue,{draw:f,props:e,useMax:b,useHint:m}):e=>f(e,{})}}function r(e){return Be(o,e)}function s(e,n,t,a,i={}){const s=t.map(e=>"string"==typeof e?{label:e,value:e}:e);return{type:"custom",...l({},{type:"radio",label:e,options:s.map(e=>({value:e.value,label:e.label}))}),render:t=>{const{value:l,onChange:u,field:c}=t,d=s.some(e=>e.value===l),p=!0===t.readOnly;if("follows"in t&&!s.some(e=>""===e.value)){const c=i.phoneRest?i.phoneRest(t.follows):t.follows,b=s.find(e=>e.value===c)??s.find(e=>e.value===a);/* @__PURE__ */
12
- return _(v,{label:o(e),icon:ne(n),action:/* @__PURE__ */_(f,{label:o(e),changed:d,detail:Z(o,o(b?.label??"")),disabled:p,onReset:()=>u(void 0)}),children:r({options:s,value:d?l:b?.value??a,onChange:u,ariaLabel:e,disabled:p})})}const b="follows"in t&&i.followsLabel?i.followsLabel(t.follows):void 0;/* @__PURE__ */
13
- return _(v,{label:o(e),icon:ne(n),action:"follows"in t&&i.followsLabel?/* @__PURE__ */_(f,{label:o(e),changed:null!=l&&""!==l,detail:void 0===b?void 0:Z(o,o(b)),disabled:p,onReset:()=>u(void 0)}):void 0,children:r({options:s,value:d?l:l||c?.currentValue||a,onChange:u,ariaLabel:e,disabled:p})})}}}function u(e,n){return n.phone?e.unshift({label:"Match desktop",value:"",picture:/* @__PURE__ */_(E,{})}):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(n,t,l,o){if(o.access){const e=o.inherit?"":o.fallback??"left",a=l({...o,phone:!1}),i=n=>{const t="string"==typeof n&&""!==n&&a.some(e=>e.value===n)?n:e;return a.find(e=>e.value===t)?.label};return Ie(n,t(o,e),o.access,{phoneRow:t({...o,phone:!0},"",i)})}return{[n]:e("desktop",t(o)),[a(n)]:e("mobile",t({...o,phone:!0},""))}}function p(e){return u(V(e.allow??Ke).map(e=>({label:e.label,value:e.value,picture:e.icon})),e)}function b(e,n=e.fallback??"left",t){return c(s(e.label??"Text alignment",/* @__PURE__ */_(w,{}),p(e),n,t?{followsLabel:t}:{}),e)}function g(e){const n={left:Te.x.start,center:Te.x.center,right:Te.x.end};return u(V((e.allow??Ke).filter(e=>e in n)).map(e=>({label:e.label,value:e.value,picture:n[e.value]})),e)}function y(e,n=e.fallback??"left",t){return c(s(e.label??"Block alignment",/* @__PURE__ */_(x,{}),g(e),n,t?{followsLabel:t}:{}),e)}function k(e,n,t,a,i,r){return{type:"custom",options:a,fallback:i,...l({},{type:"radio",label:n,options:a.map(e=>({value:e.value,label:e.label}))}),render:({value:l,onChange:s,field:u})=>{const c=u.options??a,d=u.fallback??i,p=c.some(e=>e.value===l)?l:d;/* @__PURE__ */
14
- return _(v,{label:o(n),icon:ne(t),children:/* @__PURE__ */_(Je,{say:o,kind:e,label:n,options:c,value:p,onChange:s,o:r})})}}}function O(e={}){return k("justify","Justify",/* @__PURE__ */_(x,{}),ie,ie[0].value,e)}function S(e={}){return k("align","Item alignment",/* @__PURE__ */_(T,{}),re,"stretch",e)}function P(){const e=se;return{type:"custom",options:ue,fallback:ue[1].value,...l({},{type:"radio",label:e,options:ue.map(e=>({value:e.value,label:e.label}))}),render:({value:n,onChange:t,id:l,name:a})=>{const i=`${l??a??e}-label`;/* @__PURE__ */
15
- return _(v,{label:o(e),labelId:i,icon:/* @__PURE__ */_(C,{}),action:/* @__PURE__ */_(h,{checked:(r=n,!0===r||"wrap"===r),onChange:e=>t(e?ue[0].value:ue[1].value),ariaLabelledBy:i})});var r}}}function R({offered:e,fallback:n,resolve:t}){const l=t??(t=>e.some(e=>e.value===t)?t:n),o=s(ce,
16
- /* @__PURE__ */_(j,{}),e.map(e=>({label:e.label,value:e.value})),l(void 0));return{type:"custom",render:e=>o.render({...e,value:l(e.value),onChange:n=>e.onChange(n)})}}function A({min:e,max:n,step:t,builtIn:l,resolve:o,action:a,mark:r}){const s=i("Gap",/* @__PURE__ */_(F,{}),e,n,t,l,"px",a),u=o??(e=>"number"==typeof e?e:l);return{...r,type:"custom",render:e=>s.render({...e,value:u(e.value,e.field),storedValue:e.value,onChange:n=>e.onChange(n)})}}function M(e,{fallback:n=me,pointsFor:t}={}){return{type:"custom",render:({value:l,onChange:a})=>{const i=ge(l,n);return t?/* @__PURE__ */_(Ge,{say:o,label:e,value:i,onChange:a,pointsFor:t}):$e(o,{label:e,value:i,onChange:a,points:ve})}}}function W(e){return{[e.keys.x]:{type:"custom",render:()=>/* @__PURE__ */_(Ne,{say:o,o:e})},[e.keys.y]:{...n({type:"custom",render:()=>/* @__PURE__ */_(t,{})},"always"),reachedBy:e.keys.x}}}function I(l={}){const i={...Ce,...l.keys},r={keys:i,phoneKeys:Object.fromEntries(xe.map(e=>[e,a(i[e])])),fallback:{top:0,right:0,bottom:0,left:0,...l.fallback},useFallback:l.useFallback,label:l.label??"Padding",icon:l.icon,min:l.min??0,max:l.max??200,step:l.step??4},s=!1!==l.phone,u=!1===l.group?{}:{_gSpacing:oe("Padding")};if(l.object){const e={type:"custom",render:e=>/* @__PURE__ */_(_e,{say:o,o:r,props:e})};return te({...u,...s?Ie(l.object.key,e,l.object.phone):{[l.object.key]:e}})}const c=n=>{const t={type:"custom",render:e=>/* @__PURE__ */_(He,{say:o,tier:n,o:r,props:e})};return s?e(n,t):t},d=()=>n({type:"custom",render:()=>/* @__PURE__ */_(t,{})},"always"),p=xe.filter(e=>"top"!==e);return te({...u,[r.keys.top]:c("desktop"),...s?{[r.phoneKeys.top]:c("mobile")}:{},...Object.fromEntries(p.map(e=>[r.keys[e],{...d(),reachedBy:r.keys.top}])),...s?Object.fromEntries(p.map(n=>[r.phoneKeys[n],e("mobile",d())])):{}})}return{slider:i,select:function(e,n,t,a,i){const{note:r,phoneRest:s}="string"==typeof i?{note:i,phoneRest:void 0}:i??{};return{type:"custom",options:t,fallback:a,...r?{note:r}:{},...l({},{type:"select",label:e}),render:l=>{const{value:i,onChange:u,field:c}=l,d=c.options??t,p=c.fallback??a,b=d.some(e=>e.value===i),h="follows"in l,g=h?s?s(l.follows):l.follows:void 0,y=h?d.find(e=>e.value===g)??d.find(e=>e.value===p):void 0,k=b?i:y?.value??p,w=!0===l.readOnly;/* @__PURE__ */
17
- return _(v,{label:o(e),icon:ne(n),action:h?/* @__PURE__ */_(f,{label:o(e),changed:null!=i&&""!==i,detail:y?Z(o,o(y.label)):void 0,disabled:w,onReset:()=>u(void 0)}):void 0,children:/* @__PURE__ */_(m,{value:k,ariaLabel:o(e),readOnly:w,onChange:u,options:[...r?[{label:o(r),value:"\0note",disabled:!0}]:[],...d.map(e=>({label:o(e.label),value:e.value}))]})})}}},Segmented:r,segmented:s,boxJustifyField:O,boxAlignField:S,boxWrapField:P,directionField:R,gapField:A,placementField:M,PlacementGridView:function(e){return $e(o,e)},positionFields:W,sidesPaddingFields:I,alignmentField:function(e={},n=e.fallback??"left"){return b(e,n)},alignmentFields:function(e="align",n={}){return d(e,b,p,n)},AlignmentStrip:function({opts:e={},value:n,onChange:t,ariaLabel:l,disabled:o=!1}){return r({options:p(e),value:n,onChange:t,ariaLabel:l,disabled:o})},blockAlignmentField:function(e={},n=e.fallback??"left"){return y(e,n)},blockAlignmentFields:function(e="align",n={}){return d(e,y,g,n)},BlockAlignmentStrip:function({opts:e={},value:n,onChange:t,ariaLabel:l,disabled:o=!1}){return r({options:g(e),value:n,onChange:t,ariaLabel:l,disabled:o})},boxFieldSet:function(e={}){const n=e.width??fe,t=e.nudge?.limit??40,l=e.direction??{offered:de,fallback:"column"},o=l.resolve??(e=>l.offered.some(n=>n.value===e)?e:l.fallback),a={runs:e=>"row"===o(e)?"row":"column"};return{_gLayout:oe("Layout"),placement:M("Placement",e.placement),width:i("Width",/* @__PURE__ */_(L,{}),n.min,n.max,n.step,n.fallback,"%"),direction:R(l),gap:A(e.gap??pe),justify:O(a),align:S(a),wrap:P(),_gNudge:oe("Nudge"),...W({keys:e.nudge?.keys??{x:"nudgeX",y:"nudgeY"},min:-t,max:t,label:null}),...I(e.padding)}}}}var{slider:Qe,select:en,Segmented:nn,segmented:tn,boxJustifyField:ln,boxAlignField:on,boxWrapField:an,directionField:rn,gapField:sn,placementField:un,PlacementGridView:cn,positionFields:dn,sidesPaddingFields:pn,alignmentField:fn,alignmentFields:bn,AlignmentStrip:mn,blockAlignmentField:hn,blockAlignmentFields:vn,BlockAlignmentStrip:gn,boxFieldSet:yn}=qe();export{he as ANCHOR_LABELS,mn as AlignmentStrip,re as BOX_ALIGN_POINTS,de as BOX_DIRECTIONS,ce as BOX_DIRECTION_LABEL,pe as BOX_GAP,ie as BOX_JUSTIFY_POINTS,ye as BOX_NUDGE_LIMIT,be as BOX_PLACEMENTS,me as BOX_PLACEMENT_DEFAULT,fe as BOX_WIDTH,se as BOX_WRAP_LABEL,ue as BOX_WRAP_POINTS,gn as BlockAlignmentStrip,Re as FLAT_ACCESS,ve as OPEN_PLACEMENT_POINTS,Ae as PHONE_KEY_ACCESS,cn as PlacementGridView,Ce as SIDE_PAD_KEYS,nn as Segmented,Ze as SliderControl,fn as alignmentField,bn as alignmentFields,hn as blockAlignmentField,vn as blockAlignmentFields,on as boxAlignField,qe as boxFieldBuilders,yn as boxFieldSet,ln as boxJustifyField,an as boxWrapField,rn as directionField,sn as gapField,oe as group,ne as iconOf,ee as isNoGlyph,Q as noGlyph,ge as normaliseBoxPlacement,Se as objectAccess,Z as onDesktopWords,Me as phoneObjectAccess,Ie as phoneTwinFields,un as placementField,dn as positionFields,we as positionPatch,ae as section,tn as segmented,en as select,te as sharedStyleKinds,Le as sidesFromObject,pn as sidesPaddingFields,Fe as sidesPaddingPatch,Oe as sidesToObject,Qe as slider,Pe as useAccessPatch,Ee as useAccessValue};
@@ -1,4 +0,0 @@
1
- import{useAccessPatch as e,FLAT_ACCESS as o,onDesktopWords as r,useAccessValue as t}from"./chunk-OGG6FMBA.js";import{noControlField as s,NoControlMark as l}from"./chunk-22I55W37.js";import{normalizeCornerSides as n,CORNER_SIDES as i}from"./chunk-PLTTPHK5.js";import{CornersInput as c,BorderInput as a,SettingsColour as d}from"./chunk-CLAADE4J.js";import{SettingsDefaultReset as u}from"./chunk-2T22IY3J.js";import{DEFAULT_PANEL_WORDS as p,DEFAULT_COLOUR_ROW_WORDS as y}from"./chunk-56ID6FKZ.js";import{SettingsField as h}from"./chunk-MIX7EGRG.js";import{useWords as f}from"./chunk-MFIRYGHW.js";import{CornerIcon as m,BorderAllIcon as b}from"efficient-shell/icons/efficient";import{jsx as w}from"react/jsx-runtime";var g=e=>e;function v(e,o){const r=o.twinAccess;return r?{key:e.key,access:r,ownField:r.ownField}:e}function k(e,r){const s=!e.access||e.ownField?{value:r.value,onChange:r.onChange}:void 0;return t(e.access??o,e.key,s)}function F(e,r){return t(e.access??o,r??"")}function j(e){return{...s({type:"custom",render:()=>/* @__PURE__ */w(l,{})},"always"),reachedBy:e}}function B({o:t,say:s,props:l}){const n=f("colourRow",y),i=f("panel",p),c=t.useFollows(),a=t.usePresets?.(),u=t.opacity?.useUnset?.()??100,h=v(t,l),[m,b]=k(h,l),[g,j]=F(h,t.opacity?.key),B=e(h.access??o),C="string"==typeof m?m:"",O="number"==typeof g,A="follows"in l,T=(A&&"string"==typeof l.follows&&""!==l.follows?l.follows:void 0)??c,x=t.access||A?void 0:"";/* @__PURE__ */
2
- return w(d,{label:s(t.label),icon:t.icon,hint:t.hint,value:C,onChange:e=>b(""===e?x:e),inherited:T,presets:a,changed:""!==C||O,onReset:()=>{O&&t.opacity?B([[t.key,x],[t.opacity.key,void 0]]):b(x)},resetTo:A?r(s,T.toUpperCase()):t.resetTo?t.resetTo(c.toUpperCase()):c.toUpperCase(),...t.opacity?{opacity:O?g:u,onOpacityChange:e=>j(e)}:{},readOnly:l.readOnly,words:n,resetWords:i})}var C=20;function O({o:e,say:o,props:t}){const s=e.useFollows(),[l,n]=k(v(e,t),t),i=l&&"object"==typeof l?l:{},c="follows"in t,d=c&&t.follows&&"object"==typeof t.follows?t.follows:{},p="number"==typeof d.width?d.width:s.width,y="string"==typeof d.color&&""!==d.color?d.color:s.color,f=Object.keys(i).length>0,m={width:o("Border width"),sides:{top:o("Border top"),right:o("Border right"),bottom:o("Border bottom"),left:o("Border left")},style:o("Border style"),styles:{solid:o("Solid"),dashed:o("Dashed"),dotted:o("Dotted")},color:o("Border color"),unit:"px"};/* @__PURE__ */
3
- return w(h,{label:o("Border"),icon:/* @__PURE__ */w(b,{}),action:c?/* @__PURE__ */w(u,{label:o("Border"),changed:f,detail:r(o,`${p}px`),disabled:t.readOnly,onReset:()=>n(void 0)}):void 0,children:/* @__PURE__ */w(a,{label:o("Border"),value:i,each:!1,onChange:o=>n(function(e){const o=Object.fromEntries(Object.entries(e).filter(([,e])=>null!=e&&""!==e));return Object.keys(o).length?o:void 0}(e.styles?{width:o.width,color:o.color,style:o.style}:{width:o.width,color:o.color})),placeholder:{sides:{top:p,right:p,bottom:p,left:p},style:d.style??"solid",color:y},presets:[y],words:m,styles:e.styles??!1,max:20,readOnly:t.readOnly})})}var A=40,T=()=>null;function x({o:r,say:t,props:s}){const l=f("panel",p),a=r.useFollows(),[d,y]=k(r,s),[b,g]=F(r,r.sidesKey),v=e(r.access??o),j=r.access?void 0:null,B="number"==typeof d&&Number.isFinite(d)?d:null,C=n((r.useFollowsSides??T)())??[...i],O=n(b)??C,A=[{value:"tl",label:t("Top left")},{value:"tr",label:t("Top right")},{value:"bl",label:t("Bottom left")},{value:"br",label:t("Bottom right")}];/* @__PURE__ */
4
- return w(h,{label:t("Corners"),icon:/* @__PURE__ */w(m,{}),changed:null!==B||Array.isArray(b),action:/* @__PURE__ */w(u,{label:t("Corners"),changed:null!==B||Array.isArray(b),detail:`${a}px`,onReset:()=>Array.isArray(b)?v([[r.key,j],[r.sidesKey,j]]):y(j),words:l}),children:/* @__PURE__ */w(c,{label:t("Corners"),value:O,corners:A,onChange:e=>{const o=i.filter(o=>e.includes(o)),r=o.length===C.length&&o.every(e=>C.includes(e));g(r?j:o)},radius:B,onRadiusChange:e=>y(e??j),radiusMin:0,radiusMax:40,radiusStep:r.step??1,radiusPlaceholder:String(a),disabled:s.readOnly})})}function R(e=g){return{colourField:o=>({type:"custom",render:r=>/* @__PURE__ */w(B,{o:o,say:e,props:r})}),borderField:o=>({type:"custom",render:r=>/* @__PURE__ */w(O,{o:o,say:e,props:r})}),cornersField:o=>({type:"custom",render:r=>/* @__PURE__ */w(x,{o:o,say:e,props:r})})}}var{colourField:G,borderField:I,cornersField:M}=R();export{C as BORDER_WIDTH_MAX,A as CORNER_RADIUS_MAX,I as borderField,G as colourField,M as cornersField,j as keptByRow,R as styleFieldBuilders};
@@ -1 +0,0 @@
1
- import{panelFieldsOf as t}from"./chunk-5XL2RXFU.js";import{DESIGN_GROUP_KEY as o,BUCKET_KEY as n}from"./chunk-3QB2ZQXK.js";import{withoutDeviceGate as e}from"./chunk-BLE3U2GS.js";import{STYLE_KIND as r,fieldKind as s,copyStyle as c,heldStyle as i,planPaste as p,pasteMessage as u}from"./chunk-CWELHADJ.js";import{ANCHOR_FIELD_KEYS as f,foldMetaOf as a,MEDIA_FIELD_MARKER as l,TEXT_FIELD_MARKER as m,LINK_FIELD_MARKER as h}from"./chunk-ANPOR6EY.js";import{deviceMetaOf as y}from"./chunk-YCSZAP7T.js";var j=/* @__PURE__ */new Set([o.Size,o.Design,o.Layout,o.Position]),w=new Set(Object.values(o)),S=new Set(Object.values(n)),b=new Set(f),k=/* @__PURE__ */new Set(["focal","imageFocal"]),g=[l,m,h];function v(t){return`site:${t??""}`}function A(t){if(!t||"object"!=typeof t)return null;const o=t,n=e(t)??t,c=o[r]??n[r];if("string"==typeof c)return c;const i=o.options??n.options;if(Array.isArray(i)){return`choice:${i.map(t=>String(t?.value)).sort().join("|")}`}return s(n)}function L(t){const o=t,n=e(t);return g.some(t=>t in o||n&&t in n)}function O(o,e){const r=t(o,e)??{},s=[];let c=!0,i=!1;for(const[t,o]of Object.entries(r))S.has(t)?(c=t===n.Design,i=!1):w.has(t)?c&&(i=j.has(t)):i&&o&&"object"==typeof o&&!t.startsWith("_")&&(a(o)||b.has(t)||k.has(t)||L(o)||"slot"!==o.type&&s.push({path:[t],kind:A(o),counted:"mobile"!==y(o)?.tier}));return s}function d(t,o,n,e,r){c({scope:n,type:e.type,label:r,rows:t(o,e),props:e.props})}function D(t,o,n,e,r,s){const c=i(n);if(!c)return null;const f=p(c,{type:e.type,rows:t(o,e),props:e.props});return{...f,message:u(f,c.sourceLabel,r,s)}}function E(t,o,n,e){d(O,t,o,n,e)}function P(t,o,n,e,r){return D(O,t,o,n,e,r)}var X={scope:t=>v(t.siteId),rows:(t,o)=>O(t,o),copy:(t,o,n,e)=>E(e,t,o,n),plan:(t,o,n,e)=>P(e,t,o,n)};function B(t,o){if(!t&&!o)return X;const n=t?.rows,e=n?(t,o)=>n(t,o):O;return{scope:t?.scope??X.scope,rows:(t,o)=>e(t,o),copy:t?.copy??((t,o,n,r)=>d(e,r,t,o,n)),plan:t?.plan??((t,n,r,s)=>D(e,s,t,n,r,o))}}export{E as copyNodeStyle,O as nodeStyleRows,P as planNodePaste,A as shopFieldKind,v as siteStyleScope,B as styleClipboardOf};
@@ -1 +0,0 @@
1
- var n=["none","upper","capitalize","lower"],e={none:"none",upper:"uppercase",capitalize:"capitalize",lower:"lowercase"};function i(e){return n.includes(e)}function t(n){return i(n)?e[n]:void 0}function a(i){return n.find(n=>e[n]===i)}var r=["font","color","size","weight","emphasis","lineSpacing","letterSpacing","paragraphSpacing","letterCase","largestSize"],o=["font","color","size","weight","lineSpacing","letterSpacing","paragraphSpacing","letterCase"],d=["heading","body"],s=7,l={heading:3,body:5},u={min:5,max:void 0,sliderMin:12,sliderMax:72,step:1,shiftStep:10,unit:"px"},c={size:u,weight:{min:100,max:900,sliderMin:300,sliderMax:900,step:100,shiftStep:100,unit:""},lineSpacing:{min:50,max:250,sliderMin:50,sliderMax:250,step:1,shiftStep:10,unit:"%"},letterSpacing:{min:-10,max:void 0,sliderMin:-5,sliderMax:10,step:.1,shiftStep:1,unit:"px"},paragraphSpacing:{min:0,max:void 0,sliderMin:0,sliderMax:48,step:1,shiftStep:10,unit:"px"},largestSize:u},f=(n,e)=>`${"heading"===n?"Heading":"Body"} ${e}`;function p(n=({kind:n,n:e})=>f(n,e)){return d.flatMap(e=>Array.from({length:l[e]},(i,t)=>({id:`${e}-${t+1}`,kind:e,name:n({kind:e,n:t+1}),values:{}})))}function m(n,e,i=s){return n.filter(n=>n.kind===e).length<i}function h(n,e){const i=new RegExp(`^${e}-([1-9]\\d*)$`).exec(n);return i?Number(i[1]):void 0}function g(n){const e=h(n.id,n.kind);return void 0!==e&&e<=l[n.kind]}function x(n,e,i={}){const{max:t=s,name:a=({kind:n,n:e})=>f(n,e),make:r}=i;if(!m(n,e,t))return null;const o=n.filter(n=>n.kind===e);let d=o.length+1;const l=new Set(n.map(n=>n.name));for(;l.has(a({kind:e,n:d}));)d+=1;const u=new Set(n.map(n=>n.id));let c=Math.max(d,...o.map(n=>(h(n.id,e)??0)+1));for(;u.has(`${e}-${c}`);)c+=1;const p=o.at(-1),g=r?r(e,d):{id:`${e}-${c}`,kind:e,name:a({kind:e,n:d}),values:{...p?.values??{}}},x=p?n.indexOf(p)+1:"heading"===e?0:n.length;return{styles:[...n.slice(0,x),g,...n.slice(x)],added:g}}function k(n,e,i={}){const{name:t=({kind:n,n:e})=>f(n,e)}=i,a=n.find(n=>n.id===e);if(!a||g(a))return null;const r=n.filter(n=>n.kind===a.kind),o=r.indexOf(a),d=/* @__PURE__ */new Map;return r.forEach((n,e)=>{e>o&&n.name===t({kind:n.kind,n:e+1})&&d.set(n,t({kind:n.kind,n:e}))}),{styles:n.filter(n=>n!==a).map(n=>d.has(n)?{...n,name:d.get(n)}:n),removed:a}}function v(n,e){const i=n.find(n=>n.id===e);if(i)return i;for(const i of d){const t=h(e,i);if(void 0===t)continue;let a;for(const e of n){const n=e.kind===i?h(e.id,i):void 0;void 0!==n&&n<t&&(!a||n>a.n)&&(a={n:n,style:e})}return a?.style}}function M(n,e,i){return n.map(n=>{if(n.id!==e)return n;const t={...n.values};for(const[n,e]of Object.entries(i))void 0===e?delete t[n]:t[n]=e;return{...n,values:t}})}function S(n){return Math.min(20,Math.max(12,Math.round(.5*n+6)))}function w(n,e){const i=e.weights;return[i.thin,i.extraLight,i.light,i.regular,i.medium,i.semibold,i.bold,i.extraBold,i.black][Math.min(8,Math.max(0,Math.round(n/100)-1))]}function z(n,e,i,t={}){const a=e.find(e=>e.value===n.font)?.label??n.font??"",r=void 0===n.size?t.autoSize?i.auto:"":i.px({n:n.size});return i.summary({font:a,size:r,weight:w(n.weight??400,i)})}export{o as CAMPAIGN_TEXT_STYLE_SETTINGS,n as TEXT_STYLE_CASES,e as TEXT_STYLE_CASE_CSS,l as TEXT_STYLE_DEFAULT_COUNT,d as TEXT_STYLE_KINDS,s as TEXT_STYLE_MAX,c as TEXT_STYLE_RANGES,r as TEXT_STYLE_SETTINGS,x as addTextStyle,m as canAddTextStyle,p as defaultTextStyles,z as describeTextStyle,g as isDefaultTextStyle,i as isTextStyleCase,k as removeTextStyle,v as resolveTextStyle,t as textStyleCaseCss,a as textStyleCaseOfCss,S as textStyleRowSize,M as updateTextStyle,w as weightWord};
@@ -1,4 +0,0 @@
1
- import{Slider as e}from"efficient-shell/ui";import{useId as i,useRef as o}from"react";import{jsxs as t,jsx as r}from"react/jsx-runtime";function n({id:n,label:l,value:a,onChange:d,min:s,max:u,step:m=1,shiftStep:v,styleValue:p,unit:f,sliderMin:c,sliderMax:b,auto:h,readOnly:x=!1}){const y=i(),N=n??y,C="number"==typeof a&&Number.isFinite(a)?a:void 0,g=void 0!==h&&void 0===C,F=!g&&void 0===C&&void 0!==p,I=Number((c-m).toFixed(6)),M=o(!1),S=e=>{M.current="range"===e.target.type},V=e=>{x||e===C||d(e)};/* @__PURE__ */
2
- return t("div",{className:"es-fslider"+(F||g?" is-style":""),onChangeCapture:S,onKeyDownCapture:S,onPointerDownCapture:S,children:[
3
- /* @__PURE__ */r("label",{className:"es-fslider-name",htmlFor:N,children:l}),
4
- /* @__PURE__ */r(e,{id:N,label:l,value:C??null,onChange:e=>{if(null===e)return V(void 0);V(void 0!==h&&M.current&&e<c?void 0:e)},min:void 0!==h?I:c,max:b,inputMin:s??-1e9,inputMax:u??Number.POSITIVE_INFINITY,step:m,shiftStep:v,suffix:f&&!g?f:void 0,emptyLabel:h??(void 0===p?"":void 0),placeholderValue:void 0===h?p:void 0,stepFrom:void 0!==h?I:void 0,disabled:x,size:"sm",boxSize:"md"})]})}export{n as FieldSlider};