efficient-web-builder 67.0.0 → 67.2.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 (79) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/editor/components/StorefrontEditor.js +1 -1
  3. package/dist/editor/components/storefront-editor.css +178 -0
  4. package/dist/editor/lib/animation/fields.js +1 -1
  5. package/dist/editor/lib/animation/hover-fields.d.ts +8 -0
  6. package/dist/editor/lib/animation/hover-fields.js +1 -1
  7. package/dist/editor/lib/document/block-offer.d.ts +2 -0
  8. package/dist/editor/lib/document/block-offer.js +1 -1
  9. package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
  10. package/dist/editor/lib/document/blocks/general/Split/fields.js +1 -1
  11. package/dist/editor/lib/document/box-fields.d.ts +1 -1
  12. package/dist/editor/lib/document/card-display-chips.d.ts +1 -0
  13. package/dist/editor/lib/document/card-display-chips.js +1 -1
  14. package/dist/editor/lib/document/controls.d.ts +4 -12
  15. package/dist/editor/lib/document/controls.js +1 -1
  16. package/dist/editor/lib/document/page-root.js +2 -2
  17. package/dist/editor/lib/document/passes/inspector.js +1 -1
  18. package/dist/editor/lib/sections/section-dry-run.js +2 -2
  19. package/dist/format/lib/animation/hover.d.ts +3 -0
  20. package/dist/format/lib/animation/hover.js +1 -1
  21. package/dist/format/lib/content/box-shape.d.ts +1 -1
  22. package/dist/format/lib/content/container-gap.d.ts +2 -2
  23. package/dist/format/lib/content/container-gap.js +1 -1
  24. package/dist/format/lib/content/css-length.d.ts +17 -1
  25. package/dist/format/lib/content/css-length.js +1 -1
  26. package/dist/format/lib/content/hover-media.d.ts +6 -1
  27. package/dist/format/lib/content/hover-media.js +1 -1
  28. package/dist/format/lib/content/image-treatment.d.ts +3 -0
  29. package/dist/format/lib/content/image-treatment.js +1 -1
  30. package/dist/format/lib/content/page-width.d.ts +3 -3
  31. package/dist/format/lib/content/page-width.js +1 -1
  32. package/dist/format/lib/content/section-min-height.d.ts +11 -1
  33. package/dist/format/lib/content/section-min-height.js +1 -1
  34. package/dist/format/lib/document/blocks/general/Split/meta.d.ts +1 -0
  35. package/dist/format/lib/document/blocks/general/Split/meta.js +2 -2
  36. package/dist/format/lib/document/easel-row-words.d.ts +2 -0
  37. package/dist/format/lib/document/easel-row-words.js +1 -1
  38. package/dist/format/lib/document/passes/types.d.ts +3 -1
  39. package/dist/format/lib/document/section-catalog.d.ts +5 -0
  40. package/dist/format/lib/document/section-catalog.js +10 -2
  41. package/dist/format/lib/editor-words-catalogue.d.ts +7 -0
  42. package/dist/format/lib/editor-words-catalogue.js +3 -3
  43. package/dist/format/lib/fit-words.js +4 -2
  44. package/dist/format/lib/sections/section-presets.js +1 -1
  45. package/dist/format/lib/site-theme-row.d.ts +6 -0
  46. package/dist/format/lib/source-rules/no-hard-coded-option-rows.d.ts +1 -1
  47. package/dist/format/lib/source-rules/no-hard-coded-option-rows.js +1 -1
  48. package/dist/format/lib/source-rules/site-square-by-default.js +1 -1
  49. package/dist/format/lib/theme.d.ts +1 -1
  50. package/dist/format/lib/theme.js +4 -4
  51. package/dist/render/components/CardRowContext.d.ts +3 -1
  52. package/dist/render/components/CardRowContext.js +1 -1
  53. package/dist/render/components/Flex.d.ts +2 -1
  54. package/dist/render/components/Flex.js +1 -1
  55. package/dist/render/components/HoverMediaLayer.d.ts +16 -1
  56. package/dist/render/components/HoverMediaLayer.js +1 -1
  57. package/dist/render/components/ImageBlock.d.ts +1 -1
  58. package/dist/render/components/ImageBlock.js +1 -1
  59. package/dist/render/components/PictureHoverMove.d.ts +1 -0
  60. package/dist/render/components/PictureHoverMove.js +1 -1
  61. package/dist/render/components/PreviewHeaderContext.d.ts +4 -1
  62. package/dist/render/components/PreviewHeaderContext.js +1 -1
  63. package/dist/render/components/ViewHideRoot.d.ts +6 -0
  64. package/dist/render/components/ViewHideRoot.js +1 -1
  65. package/dist/render/lib/content/block-size.d.ts +7 -1
  66. package/dist/render/lib/content/block-size.js +1 -1
  67. package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
  68. package/dist/render/lib/document/blocks/general/ImageBlock/render.js +1 -1
  69. package/dist/render/lib/document/blocks/general/Split/render.js +1 -1
  70. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +6 -1
  71. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
  72. package/dist/render/lib/document/blocks/general/section-to-box-rows-editorial.js +1 -1
  73. package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
  74. package/dist/render/lib/document/passes/block-size.js +1 -1
  75. package/dist/render/lib/document/passes/index.js +1 -1
  76. package/dist/render/lib/document/passes/section-height.d.ts +5 -1
  77. package/dist/render/lib/document/passes/section-height.js +1 -1
  78. package/dist/render/lib/sections/section-to-box.d.ts +2 -0
  79. package/package.json +4 -3
@@ -1,18 +1,18 @@
1
- import{contrastRatio as q,hexToRgb as d,parseHexColor as s,readableInk as O,relativeLuminance as g}from"efficient-shell/format";import{DEFAULT_SHADOW_COLOR as J,pictureShadowColor as Q}from"efficient-easel/screen/lib/document/shadow-values";import{isLengthUnit as v}from"efficient-easel/screen/lib/content/length-units";import{cssLengthOf as ee}from"./content/css-length.js";const te="storefront-theme",Ke="sf:theme-mode",We="sf:theme-switch",je="hide",Ve="light",Ze=!1,H=7,L=18;function ne(e){return e>=H&&e<L}function qe(e){const{mode:t,override:n,switchShown:r,hour:o}=e;return r&&(n==="light"||n==="dark")?n:t==="auto"?ne(o)?"light":"dark":t==="light"?"light":"dark"}function Je(e){const{mode:t,switchShown:n}=e;return`
1
+ import{contrastRatio as J,hexToRgb as d,parseHexColor as s,readableInk as H,relativeLuminance as g}from"efficient-shell/format";import{DEFAULT_SHADOW_COLOR as Q,pictureShadowColor as v}from"efficient-easel/screen/lib/document/shadow-values";import{isLengthUnit as ee}from"efficient-easel/screen/lib/content/length-units";import{cssLengthOf as te,siteLengthHeld as ne}from"./content/css-length.js";const re="storefront-theme",je="sf:theme-mode",Ve="sf:theme-switch",Ze="hide",qe="light",Je=!1,L=7,N=18;function oe(e){return e>=L&&e<N}function Qe(e){const{mode:t,override:n,switchShown:r,hour:o}=e;return r&&(n==="light"||n==="dark")?n:t==="auto"?oe(o)?"light":"dark":t==="light"?"light":"dark"}function ve(e){const{mode:t,switchShown:n}=e;return`
2
2
  try {
3
3
  var mode = ${JSON.stringify(t)};
4
4
  var shown = ${n?"true":"false"};
5
- var override = localStorage.getItem(${JSON.stringify(te)});
5
+ var override = localStorage.getItem(${JSON.stringify(re)});
6
6
  var theme;
7
7
  if (shown && (override === 'light' || override === 'dark')) {
8
8
  theme = override;
9
9
  } else if (mode === 'auto') {
10
10
  var h = new Date().getHours();
11
- theme = (h >= ${H} && h < ${L}) ? 'light' : 'dark';
11
+ theme = (h >= ${L} && h < ${N}) ? 'light' : 'dark';
12
12
  } else {
13
13
  theme = mode === 'light' ? 'light' : 'dark';
14
14
  }
15
15
  if (theme === 'light') document.documentElement.setAttribute('data-theme', 'light');
16
16
  else document.documentElement.removeAttribute('data-theme');
17
17
  } catch (e) {}
18
- `}const l={background:"#0a0a0a",surface:"#131313",line:"#2a2a2a",muted:"#9a9388"},re=[{text:"#2e2e2e",accent:"#2e2e2e",background:"#ffffff",surface:"#f7f7f7",line:"#e0e0e0",muted:"#5c5c5c"},{text:"#f7f7f7",accent:"#f7f7f7",background:"#0a0a0a",surface:"#1b1b1b",line:"#363636",muted:"#a3a3a3"},{text:"#ffffff",accent:"#ffffff",background:"#2e2e2e",surface:"#3d3d3d",line:"#545454",muted:"#b0b0b0"},{text:"#0a0a0a",accent:"#0a0a0a",background:"#f7f7f7",surface:"#ffffff",line:"#d9d9d9",muted:"#5c5c5c"}],oe={selected:0,themes:re};function N(e){return!e||!Array.isArray(e.themes)||e.themes.length===0?{...oe}:{selected:Math.min(Math.max(0,e.selected??0),e.themes.length-1),themes:e.themes}}function _(e,t,n){const r=d(e),o=d(t);if(r===null||o===null)return e;const c=(i,a)=>Math.max(0,Math.min(255,Math.round(i+(a-i)*n))).toString(16).padStart(2,"0");return`#${c(r.r,o.r)}${c(r.g,o.g)}${c(r.b,o.b)}`}const ce={light:"#ffffff",dark:"#0a0a0a"},Qe=["light","dark"];function ve(e,t){const n=ce[t],r=t==="light"?"#ffffff":"#000000";return{text:n,accent:n,background:e,surface:_(e,r,.1),line:_(e,r,.22),muted:_(n,e,.35),brandInk:t}}function f(e){const t=N(e);return t.themes[t.selected]}function u(e){return{text:e.text,accent:e.accent,background:e.background||l.background,surface:e.surface||l.surface,line:e.line||l.line,muted:e.muted||l.muted}}function et(e){return{fill:u(e).background,accent:e.accent}}const ie=.4,se="#f5f1e8",k="#0a0a0a";function ae(e){const t=f(e).text,n=g(t);return n===null||n>=ie?t:null}const ue=4.5,le=3,tt={good:"Good","large-only":"Large text only",hard:"Hard to read"};function nt(e){return e>=ue?"good":e>=le?"large-only":"hard"}const fe=["#000000","#ffffff"];function m(e){return O(e,fe)}function rt(e,t){const n=t!==void 0&&g(t)!==null?t:se;return O(e,[k,n])===n&&n!==k}const he=[.25,.4,.55];function ot(e){const t=d(e);return t===null?[]:he.map(n=>"#"+[t.r,t.g,t.b].map(r=>Math.round(r*(1-n)).toString(16).padStart(2,"0")).join(""))}function ct(e){const n={"--theme-fg":f(e).text},r=ae(e);return r!==null&&(n["--overlay-fg"]=r),n}const de=82;function E(e){return`color-mix(in srgb, ${e} ${de}%, #000)`}function it(e){const t=f(e);return{"--theme-accent":t.accent,"--theme-accent-2":E(t.accent),"--theme-accent-ink":m(t.accent)}}function S(e){const t=e?.button;return t&&s(t)===t.toLowerCase()?t.toLowerCase():null}function st(e){const t=f(e),n=S(t),r=P(t);if(n===null&&r===null)return{};const o={};return n!==null&&(o["--theme-btn"]=n,o["--theme-btn-2"]=E(n)),o["--theme-btn-ink"]=r??m(n),o}function P(e){const t=e?.buttonInk;return t&&s(t)===t.toLowerCase()?t.toLowerCase():null}function ge(e,t){return P(e)??m(S(e)??t)}function at(e){const t=f(e);return{fill:S(t)??t.accent.toLowerCase(),ink:ge(t,t.accent)}}function ut(e){const t={};return N(e).themes.forEach((n,r)=>{const o=u(n);t[`--theme-preset-${r}-accent`]=o.accent,t[`--theme-preset-${r}-accent-2`]=E(o.accent),t[`--theme-preset-${r}-accent-ink`]=m(o.accent),t[`--theme-preset-${r}-bg`]=o.background,t[`--theme-preset-${r}-fg`]=o.text,t[`--theme-preset-${r}-surface`]=o.surface,t[`--theme-preset-${r}-surface-2`]=`color-mix(in srgb, ${o.surface} 60%, ${o.line})`,t[`--theme-preset-${r}-line`]=o.line,t[`--theme-preset-${r}-muted`]=o.muted}),t}const A=e=>{const t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4},T=e=>255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055);function F([e,t,n]){const[r,o,c]=[A(e),A(t),A(n)],i=Math.cbrt(.4122214708*r+.5363325363*o+.0514459929*c),a=Math.cbrt(.2119034982*r+.6806995451*o+.1073969566*c),h=Math.cbrt(.0883024619*r+.2817188376*o+.6299787005*c);return[.2104542553*i+.793617785*a-.0040720468*h,1.9779984951*i-2.428592205*a+.4505937099*h,.0259040371*i+.7827717662*a-.808675766*h]}function me([e,t,n]){const r=(e+.3963377774*t+.2158037573*n)**3,o=(e-.1055613458*t-.0638541728*n)**3,c=(e-.0894841775*t-1.291485548*n)**3;return[T(4.0767416621*r-3.3077115913*o+.2309699292*c),T(-1.2684380046*r+2.6097574011*o-.3413193965*c),T(-.0041960863*r-.7034186147*o+1.707614701*c)]}const b=e=>{const t=d(e);return t===null?[0,0,0]:[t.r,t.g,t.b]},$=(e,t,n)=>[e[0]*n+t[0]*(1-n),e[1]*n+t[1]*(1-n),e[2]*n+t[2]*(1-n)],U=e=>`#${e.map(t=>Math.max(0,Math.min(255,Math.round(t))).toString(16).padStart(2,"0")).join("")}`,G=e=>$(b(e.surface),b(e.line),.6);function lt(e){return U(G(u(e)))}function Y(e){const t=u(e);return U(me($(F(G(t)),F(b(t.text)),.92)))}function ft(e){return{...e,background:Y(e)}}function z(e,t,n,r){const o=e[t];if(!o)return-1;const c=n(o);if(!c)return-1;const i=u(o);return e.findIndex((a,h)=>{if(h===t)return!1;const p=u(a);return s(p.background)!==c?!1:!r||s(p.text??"")===s(i.text??"")&&s(p.accent??"")===s(i.accent??"")})}function ht(e,t){return z(e,t,Y,!1)}function dt(e,t){return z(e,t,n=>s(n.surface??""),!0)}const xe=1;function pe(e,t){const n=(e??[]).flatMap((r,o)=>{const c=g(r.background??""),i=g(r.text??"");return c!==null&&i!==null&&c<i?[o]:[]});return n.find(r=>r!==t)??n[0]??xe}function gt(e){return pe(e?.themes,e?.selected)}const mt=["--theme-bg","--theme-surface","--theme-surface-2","--theme-line","--theme-muted"];function xt(e){const t=u(f(e)),n=`color-mix(in srgb, ${t.surface} 60%, ${t.line})`,r={"--theme-bg":t.background,"--theme-surface":t.surface,"--theme-line":t.line,"--theme-muted":t.muted};return(t.surface!==l.surface||t.line!==l.line)&&(r["--theme-surface-2"]=n),r}const _e=["heading","body","label"],pt={heading:"Headings",body:"Body",label:"Labels"};function _t(e){if(!e)return null;for(const t of _e)if(e.includes(`--size-${t}`))return t;return/--size-heading(Large|Medium|Small)/.test(e)?"heading":null}const B=["headingLarge","headingMedium","headingSmall","accent","body","label"],Et={headingLarge:"heading",headingMedium:"heading",headingSmall:"heading",accent:"heading",body:"body",label:"label"},St={headingLarge:null,headingMedium:null,headingSmall:null,accent:null,body:null,label:null},Ee=8,Se=200;function Ae(e){if(typeof e!="number"||!Number.isFinite(e))return null;const t=Math.round(e);return t>=Ee&&t<=Se?t:null}function Te(e){const t={};for(const n of B)t[n]=Ae(e?.[n]);return t}function At(e){const t=Te(e),n={};for(const r of B){const o=t[r];o!==null&&(n[`--size-${r}`]=`${o}px`)}return n}const be=["square","small","large"],Ie="small";function Ce(e){return be.includes(e??"")?e:Ie}function Tt(e){return X(Me[Ce(e)])}const I=0,Re=40,Me={square:0,small:null,large:16},C={"--sf-card-radius":1,"--sf-button-radius":.5,"--site-radius":.5,"--site-radius-xs":.25,"--site-radius-sm":.5,"--site-radius-md":.75,"--site-radius-lg":1,"--site-radius-xl":1.25,"--site-radius-2xl":1.5,"--site-radius-3xl":2,"--site-radius-4xl":2.5};function R(e){if(e==null||typeof e=="string"&&e.trim()==="")return null;const t=typeof e=="string"?Number(e):e;return Number.isFinite(t)?Math.min(Re,Math.max(I,Math.round(t))):null}function X(e,t){if(v(t)&&t!=="px"){if(typeof e!="number"||!Number.isFinite(e))return{};const r=Math.max(0,e);return Object.fromEntries(Object.entries(C).map(([o,c])=>{const i=Math.round(r*c*1e4)/1e4;return[o,i===0?"0":ee(i,t)]}))}const n=R(e);return n===null?{}:Object.fromEntries(Object.entries(C).map(([r,o])=>{const c=n*o/16;return[r,c===0?"0":`${c}rem`]}))}function bt(e){return(R(e)??I)*C["--sf-button-radius"]}function It(e){return X(R(e)??I)}const De=["none","soft","lifted"],ye="soft",K="none",we=["tight","normal","roomy"],Oe="normal",He="normal",Le=["none","lift","highlight"],Ne="lift",ke="highlight";import{DEFAULT_SHADOW_COLOR as Ut}from"efficient-easel/screen/lib/document/shadow-values";function W(e){return De.includes(e??"")?e:ye}function Pe(e){return we.includes(e??"")?e:Oe}function j(e){return Le.includes(e??"")?e:Ne}function Ct(e){const t=W(e);return t===K?void 0:t}function Rt(e){const t=Pe(e);return t===He?void 0:t}function Mt(e){const t=j(e);return t===ke?void 0:t}function Dt(e,t,n){const r=Q(t);return r===J?{}:W(e)!==K||j(n)==="lift"?{"--sf-shadow-color":r}:{}}const Fe=["normal","tight","compressed"],V="normal";function Z(e){return Fe.includes(e??"")?e:V}function yt(e){const t=Z(e);return t===V?void 0:t}function wt(e){switch(Z(e)){case"tight":return{lineHeight:.95,letterSpacing:-.01};case"compressed":return{lineHeight:.86,letterSpacing:-.01};default:return{}}}const Ot=["authored","sentence"],Ht={case:"authored",weight:null,weightStrong:null,italicStrong:null,maxPx:null,weight2:null,weight3:null,case2:"authored",case3:"authored"},M=100,D=900,$e=24,Ue=200;function x(e,t,n){return typeof e!="number"||!Number.isFinite(e)?null:Math.round(Math.min(Math.max(e,t),n))}function y(e){const t=x(e?.weight,M,D),n=e?.case==="sentence"?"sentence":"authored",r=c=>c==null?t:x(c,M,D),o=c=>c==="sentence"?"sentence":c==="authored"?"authored":n;return{case:n,weight:t,weightStrong:x(e?.weightStrong,M,D),italicStrong:typeof e?.italicStrong=="boolean"?e.italicStrong:null,maxPx:x(e?.maxPx,$e,Ue),weight2:r(e?.weight2),weight3:r(e?.weight3),case2:o(e?.case2),case3:o(e?.case3)}}function Lt(e){const t=y(e),n={};return t.case==="sentence"&&(n["--sf-heading-case"]="none"),t.weight!==null&&(n["--sf-heading-weight"]=String(t.weight)),t.weightStrong!==null&&(n["--sf-heading-weight-strong"]=String(t.weightStrong)),t.maxPx!==null&&(n["--sf-heading-max"]=`${t.maxPx}px`),t.weight2!==null&&t.weight2!==t.weight&&(n["--sf-heading-2-weight"]=String(t.weight2)),t.weight3!==null&&t.weight3!==t.weight&&(n["--sf-heading-3-weight"]=String(t.weight3)),t.case2!==t.case&&(n["--sf-heading-2-case"]=t.case2==="sentence"?"none":"uppercase"),t.case3!==t.case&&(n["--sf-heading-3-case"]=t.case3==="sentence"?"none":"uppercase"),n}function Nt(e){return y({case:e?.heading_case??void 0,weight:e?.heading_weight,weightStrong:e?.heading_weight_strong,italicStrong:e?.accent_italic,maxPx:e?.heading_max_px,weight2:e?.heading_2_weight??void 0,weight3:e?.heading_3_weight??void 0,case2:e?.heading_2_case??void 0,case3:e?.heading_3_case??void 0})}function kt(e){const t=y(e);return{heading_case:t.case,heading_weight:t.weight,heading_weight_strong:t.weightStrong,heading_max_px:t.maxPx,heading_2_weight:t.weight2,heading_3_weight:t.weight3,heading_2_case:t.case2,heading_3_case:t.case3}}const w="siteTheme";function Ge(e){const t=e;if(!t||typeof t!="object"||!Array.isArray(t.themes)||!t.themes.every(r=>!!r&&typeof r=="object"))return{};const n=typeof t.selected=="number"&&Number.isInteger(t.selected)&&t.selected>=0?t.selected:0;return{[w]:{selected:n,themes:t.themes}}}function Pt(e){return Ge(e?.[w])[w]}export{he as ACCENT_DARKEN_STEPS,Qe as BRAND_INKS,we as CARD_GAPS,De as CARD_SHADOWS,Re as CORNER_RADIUS_MAX,I as CORNER_RADIUS_MIN,be as CORNER_STYLES,Me as CORNER_STYLE_TO_PX,Oe as DEFAULT_CARD_GAP,ye as DEFAULT_CARD_SHADOW,Ie as DEFAULT_CORNER_STYLE,V as DEFAULT_HEADING_COMPRESSION,Ht as DEFAULT_HEADING_TYPOGRAPHY,Ne as DEFAULT_HOVER_EFFECT,Ut as DEFAULT_SHADOW_COLOR,St as DEFAULT_SIZES,l as DEFAULT_SURFACES,Ze as DEFAULT_SWITCH_SHOWN,re as DEFAULT_THEMES,Ve as DEFAULT_THEME_MODE,oe as DEFAULT_THEME_VALUE,tt as GRADE_LABEL,Ot as HEADING_CASES,Fe as HEADING_COMPRESSIONS,Ue as HEADING_MAX_PX_MAX,$e as HEADING_MAX_PX_MIN,D as HEADING_WEIGHT_MAX,M as HEADING_WEIGHT_MIN,Le as HOVER_EFFECTS,He as IDENTITY_CARD_GAP,K as IDENTITY_CARD_SHADOW,ke as IDENTITY_HOVER_EFFECT,k as OVERLAY_INK_DARK,se as OVERLAY_INK_LIGHT,ue as READABILITY_AA,le as READABILITY_AA_LARGE,Et as SCALE_OF_STEP,w as SITE_THEME_KEY,B as SIZE_STEPS,Se as TEXT_SIZE_MAX,Ee as TEXT_SIZE_MIN,L as THEME_DAY_END_HOUR,H as THEME_DAY_START_HOUR,Ke as THEME_MODE_KEY,te as THEME_STORAGE_KEY,mt as THEME_SURFACE_KEYS,je as THEME_SWITCH_HIDE,We as THEME_SWITCH_KEY,_e as TYPE_GROUPS,pt as TYPE_GROUP_LABELS,m as accentInk,ft as bandPresetFor,ht as bandPresetIndex,ve as brandTheme,Je as buildThemeBootScript,Rt as cardGapAttr,Ct as cardShadowAttr,wt as compressionMetrics,q as contrastRatio,X as cornerRadiusTokens,Tt as cornerStyleTokens,gt as darkBandIndex,pe as darkPresetIndex,ot as darkerAccents,rt as fillIsDark,nt as gradeContrast,yt as headingCompressionAttr,Nt as headingTypographyFromRow,Lt as headingTypographyStyle,kt as headingTypographyToRow,Mt as hoverEffectAttr,ne as isDayHour,Pe as normalizeCardGap,W as normalizeCardShadow,R as normalizeCornerRadius,Ce as normalizeCornerStyle,Z as normalizeHeadingCompression,y as normalizeHeadingTypography,j as normalizeHoverEffect,Ae as normalizeSize,Te as normalizeSizes,N as normalizeTheme,u as normalizeThemeColors,qe as resolveTheme,ge as resolvedButtonInk,Y as sectionBandTone,f as selectedThemeColors,Dt as shadowColorTokens,at as siteButtonPaint,bt as siteButtonRadiusPx,It as siteCornerRadiusTokens,Ge as siteThemeMetadata,Pt as siteThemeOf,dt as surfacePresetIndex,lt as surfaceTwoTone,it as themeAccentStyle,S as themeButtonColour,P as themeButtonInk,st as themeButtonStyle,ct as themeColorStyle,ae as themeLightInk,ut as themePresetAccentVars,xt as themeSurfaceStyle,et as themeSwatchColors,_t as typeScaleGroupOfClassName,At as typeSizesStyle};
18
+ `}const l={background:"#0a0a0a",surface:"#131313",line:"#2a2a2a",muted:"#9a9388"},ce=[{text:"#2e2e2e",accent:"#2e2e2e",background:"#ffffff",surface:"#f7f7f7",line:"#e0e0e0",muted:"#5c5c5c"},{text:"#f7f7f7",accent:"#f7f7f7",background:"#0a0a0a",surface:"#1b1b1b",line:"#363636",muted:"#a3a3a3"},{text:"#ffffff",accent:"#ffffff",background:"#2e2e2e",surface:"#3d3d3d",line:"#545454",muted:"#b0b0b0"},{text:"#0a0a0a",accent:"#0a0a0a",background:"#f7f7f7",surface:"#ffffff",line:"#d9d9d9",muted:"#5c5c5c"}],ie={selected:0,themes:ce};function k(e){return!e||!Array.isArray(e.themes)||e.themes.length===0?{...ie}:{selected:Math.min(Math.max(0,e.selected??0),e.themes.length-1),themes:e.themes}}function E(e,t,n){const r=d(e),o=d(t);if(r===null||o===null)return e;const c=(i,a)=>Math.max(0,Math.min(255,Math.round(i+(a-i)*n))).toString(16).padStart(2,"0");return`#${c(r.r,o.r)}${c(r.g,o.g)}${c(r.b,o.b)}`}const se={light:"#ffffff",dark:"#0a0a0a"},et=["light","dark"];function tt(e,t){const n=se[t],r=t==="light"?"#ffffff":"#000000";return{text:n,accent:n,background:e,surface:E(e,r,.1),line:E(e,r,.22),muted:E(n,e,.35),brandInk:t}}function f(e){const t=k(e);return t.themes[t.selected]}function u(e){return{text:e.text,accent:e.accent,background:e.background||l.background,surface:e.surface||l.surface,line:e.line||l.line,muted:e.muted||l.muted}}function nt(e){return{fill:u(e).background,accent:e.accent}}const ae=.4,ue="#f5f1e8",P="#0a0a0a";function le(e){const t=f(e).text,n=g(t);return n===null||n>=ae?t:null}const fe=4.5,he=3,rt={good:"Good","large-only":"Large text only",hard:"Hard to read"};function ot(e){return e>=fe?"good":e>=he?"large-only":"hard"}const de=["#000000","#ffffff"];function m(e){return H(e,de)}function ct(e,t){const n=t!==void 0&&g(t)!==null?t:ue;return H(e,[P,n])===n&&n!==P}const ge=[.25,.4,.55];function it(e){const t=d(e);return t===null?[]:ge.map(n=>"#"+[t.r,t.g,t.b].map(r=>Math.round(r*(1-n)).toString(16).padStart(2,"0")).join(""))}function st(e){const n={"--theme-fg":f(e).text},r=le(e);return r!==null&&(n["--overlay-fg"]=r),n}const me=82;function S(e){return`color-mix(in srgb, ${e} ${me}%, #000)`}function at(e){const t=f(e);return{"--theme-accent":t.accent,"--theme-accent-2":S(t.accent),"--theme-accent-ink":m(t.accent)}}function A(e){const t=e?.button;return t&&s(t)===t.toLowerCase()?t.toLowerCase():null}function ut(e){const t=f(e),n=A(t),r=F(t);if(n===null&&r===null)return{};const o={};return n!==null&&(o["--theme-btn"]=n,o["--theme-btn-2"]=S(n)),o["--theme-btn-ink"]=r??m(n),o}function F(e){const t=e?.buttonInk;return t&&s(t)===t.toLowerCase()?t.toLowerCase():null}function xe(e,t){return F(e)??m(A(e)??t)}function lt(e){const t=f(e);return{fill:A(t)??t.accent.toLowerCase(),ink:xe(t,t.accent)}}function ft(e){const t={};return k(e).themes.forEach((n,r)=>{const o=u(n);t[`--theme-preset-${r}-accent`]=o.accent,t[`--theme-preset-${r}-accent-2`]=S(o.accent),t[`--theme-preset-${r}-accent-ink`]=m(o.accent),t[`--theme-preset-${r}-bg`]=o.background,t[`--theme-preset-${r}-fg`]=o.text,t[`--theme-preset-${r}-surface`]=o.surface,t[`--theme-preset-${r}-surface-2`]=`color-mix(in srgb, ${o.surface} 60%, ${o.line})`,t[`--theme-preset-${r}-line`]=o.line,t[`--theme-preset-${r}-muted`]=o.muted}),t}const T=e=>{const t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4},b=e=>255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055);function $([e,t,n]){const[r,o,c]=[T(e),T(t),T(n)],i=Math.cbrt(.4122214708*r+.5363325363*o+.0514459929*c),a=Math.cbrt(.2119034982*r+.6806995451*o+.1073969566*c),h=Math.cbrt(.0883024619*r+.2817188376*o+.6299787005*c);return[.2104542553*i+.793617785*a-.0040720468*h,1.9779984951*i-2.428592205*a+.4505937099*h,.0259040371*i+.7827717662*a-.808675766*h]}function pe([e,t,n]){const r=(e+.3963377774*t+.2158037573*n)**3,o=(e-.1055613458*t-.0638541728*n)**3,c=(e-.0894841775*t-1.291485548*n)**3;return[b(4.0767416621*r-3.3077115913*o+.2309699292*c),b(-1.2684380046*r+2.6097574011*o-.3413193965*c),b(-.0041960863*r-.7034186147*o+1.707614701*c)]}const I=e=>{const t=d(e);return t===null?[0,0,0]:[t.r,t.g,t.b]},U=(e,t,n)=>[e[0]*n+t[0]*(1-n),e[1]*n+t[1]*(1-n),e[2]*n+t[2]*(1-n)],G=e=>`#${e.map(t=>Math.max(0,Math.min(255,Math.round(t))).toString(16).padStart(2,"0")).join("")}`,Y=e=>U(I(e.surface),I(e.line),.6);function ht(e){return G(Y(u(e)))}function z(e){const t=u(e);return G(pe(U($(Y(t)),$(I(t.text)),.92)))}function dt(e){return{...e,background:z(e)}}function B(e,t,n,r){const o=e[t];if(!o)return-1;const c=n(o);if(!c)return-1;const i=u(o);return e.findIndex((a,h)=>{if(h===t)return!1;const _=u(a);return s(_.background)!==c?!1:!r||s(_.text??"")===s(i.text??"")&&s(_.accent??"")===s(i.accent??"")})}function gt(e,t){return B(e,t,z,!1)}function mt(e,t){return B(e,t,n=>s(n.surface??""),!0)}const _e=1;function Ee(e,t){const n=(e??[]).flatMap((r,o)=>{const c=g(r.background??""),i=g(r.text??"");return c!==null&&i!==null&&c<i?[o]:[]});return n.find(r=>r!==t)??n[0]??_e}function xt(e){return Ee(e?.themes,e?.selected)}const pt=["--theme-bg","--theme-surface","--theme-surface-2","--theme-line","--theme-muted"];function _t(e){const t=u(f(e)),n=`color-mix(in srgb, ${t.surface} 60%, ${t.line})`,r={"--theme-bg":t.background,"--theme-surface":t.surface,"--theme-line":t.line,"--theme-muted":t.muted};return(t.surface!==l.surface||t.line!==l.line)&&(r["--theme-surface-2"]=n),r}const Se=["heading","body","label"],Et={heading:"Headings",body:"Body",label:"Labels"};function St(e){if(!e)return null;for(const t of Se)if(e.includes(`--size-${t}`))return t;return/--size-heading(Large|Medium|Small)/.test(e)?"heading":null}const X=["headingLarge","headingMedium","headingSmall","accent","body","label"],At={headingLarge:"heading",headingMedium:"heading",headingSmall:"heading",accent:"heading",body:"body",label:"label"},Tt={headingLarge:null,headingMedium:null,headingSmall:null,accent:null,body:null,label:null},Ae=8,Te=200;function be(e){if(typeof e!="number"||!Number.isFinite(e))return null;const t=Math.round(e);return t>=Ae&&t<=Te?t:null}function Ie(e){const t={};for(const n of X)t[n]=be(e?.[n]);return t}function bt(e){const t=Ie(e),n={};for(const r of X){const o=t[r];o!==null&&(n[`--size-${r}`]=`${o}px`)}return n}const Re=["square","small","large"],Ce="small";function De(e){return Re.includes(e??"")?e:Ce}function It(e){return D(ye[De(e)])}const x=0,K=40,Me={min:x,max:K,step:1},ye={square:0,small:null,large:16},R={"--sf-card-radius":1,"--sf-button-radius":.5,"--site-radius":.5,"--site-radius-xs":.25,"--site-radius-sm":.5,"--site-radius-md":.75,"--site-radius-lg":1,"--site-radius-xl":1.25,"--site-radius-2xl":1.5,"--site-radius-3xl":2,"--site-radius-4xl":2.5};function C(e){if(e==null||typeof e=="string"&&e.trim()==="")return null;const t=typeof e=="string"?Number(e):e;return Number.isFinite(t)?Math.min(K,Math.max(x,Math.round(t))):null}function D(e,t){if(ee(t)&&t!=="px"){if(typeof e!="number"||!Number.isFinite(e))return{};const r=Math.max(0,e);return Object.fromEntries(Object.entries(R).map(([o,c])=>{const i=Math.round(r*c*1e4)/1e4;return[o,i===0?"0":te(i,t)]}))}const n=C(e);return n===null?{}:Object.fromEntries(Object.entries(R).map(([r,o])=>{const c=n*o/16;return[r,c===0?"0":`${c}rem`]}))}function Rt(e){return(C(e)??x)*R["--sf-button-radius"]}function Ct(e,t){const n=ne(e,t,"radius",Me);return n!==null?D(n,t):D(C(e)??x)}const Oe=["none","soft","lifted"],we="soft",W="none",He=["tight","normal","roomy"],Le="normal",Ne="normal",ke=["none","lift","highlight"],Pe="lift",Fe="highlight";import{DEFAULT_SHADOW_COLOR as Yt}from"efficient-easel/screen/lib/document/shadow-values";function j(e){return Oe.includes(e??"")?e:we}function $e(e){return He.includes(e??"")?e:Le}function V(e){return ke.includes(e??"")?e:Pe}function Dt(e){const t=j(e);return t===W?void 0:t}function Mt(e){const t=$e(e);return t===Ne?void 0:t}function yt(e){const t=V(e);return t===Fe?void 0:t}function Ot(e,t,n){const r=v(t);return r===Q?{}:j(e)!==W||V(n)==="lift"?{"--sf-shadow-color":r}:{}}const Ue=["normal","tight","compressed"],Z="normal";function q(e){return Ue.includes(e??"")?e:Z}function wt(e){const t=q(e);return t===Z?void 0:t}function Ht(e){switch(q(e)){case"tight":return{lineHeight:.95,letterSpacing:-.01};case"compressed":return{lineHeight:.86,letterSpacing:-.01};default:return{}}}const Lt=["authored","sentence"],Nt={case:"authored",weight:null,weightStrong:null,italicStrong:null,maxPx:null,weight2:null,weight3:null,case2:"authored",case3:"authored"},M=100,y=900,Ge=24,Ye=200;function p(e,t,n){return typeof e!="number"||!Number.isFinite(e)?null:Math.round(Math.min(Math.max(e,t),n))}function O(e){const t=p(e?.weight,M,y),n=e?.case==="sentence"?"sentence":"authored",r=c=>c==null?t:p(c,M,y),o=c=>c==="sentence"?"sentence":c==="authored"?"authored":n;return{case:n,weight:t,weightStrong:p(e?.weightStrong,M,y),italicStrong:typeof e?.italicStrong=="boolean"?e.italicStrong:null,maxPx:p(e?.maxPx,Ge,Ye),weight2:r(e?.weight2),weight3:r(e?.weight3),case2:o(e?.case2),case3:o(e?.case3)}}function kt(e){const t=O(e),n={};return t.case==="sentence"&&(n["--sf-heading-case"]="none"),t.weight!==null&&(n["--sf-heading-weight"]=String(t.weight)),t.weightStrong!==null&&(n["--sf-heading-weight-strong"]=String(t.weightStrong)),t.maxPx!==null&&(n["--sf-heading-max"]=`${t.maxPx}px`),t.weight2!==null&&t.weight2!==t.weight&&(n["--sf-heading-2-weight"]=String(t.weight2)),t.weight3!==null&&t.weight3!==t.weight&&(n["--sf-heading-3-weight"]=String(t.weight3)),t.case2!==t.case&&(n["--sf-heading-2-case"]=t.case2==="sentence"?"none":"uppercase"),t.case3!==t.case&&(n["--sf-heading-3-case"]=t.case3==="sentence"?"none":"uppercase"),n}function Pt(e){return O({case:e?.heading_case??void 0,weight:e?.heading_weight,weightStrong:e?.heading_weight_strong,italicStrong:e?.accent_italic,maxPx:e?.heading_max_px,weight2:e?.heading_2_weight??void 0,weight3:e?.heading_3_weight??void 0,case2:e?.heading_2_case??void 0,case3:e?.heading_3_case??void 0})}function Ft(e){const t=O(e);return{heading_case:t.case,heading_weight:t.weight,heading_weight_strong:t.weightStrong,heading_max_px:t.maxPx,heading_2_weight:t.weight2,heading_3_weight:t.weight3,heading_2_case:t.case2,heading_3_case:t.case3}}const w="siteTheme";function ze(e){const t=e;if(!t||typeof t!="object"||!Array.isArray(t.themes)||!t.themes.every(r=>!!r&&typeof r=="object"))return{};const n=typeof t.selected=="number"&&Number.isInteger(t.selected)&&t.selected>=0?t.selected:0;return{[w]:{selected:n,themes:t.themes}}}function $t(e){return ze(e?.[w])[w]}export{ge as ACCENT_DARKEN_STEPS,et as BRAND_INKS,He as CARD_GAPS,Oe as CARD_SHADOWS,K as CORNER_RADIUS_MAX,x as CORNER_RADIUS_MIN,Re as CORNER_STYLES,ye as CORNER_STYLE_TO_PX,Le as DEFAULT_CARD_GAP,we as DEFAULT_CARD_SHADOW,Ce as DEFAULT_CORNER_STYLE,Z as DEFAULT_HEADING_COMPRESSION,Nt as DEFAULT_HEADING_TYPOGRAPHY,Pe as DEFAULT_HOVER_EFFECT,Yt as DEFAULT_SHADOW_COLOR,Tt as DEFAULT_SIZES,l as DEFAULT_SURFACES,Je as DEFAULT_SWITCH_SHOWN,ce as DEFAULT_THEMES,qe as DEFAULT_THEME_MODE,ie as DEFAULT_THEME_VALUE,rt as GRADE_LABEL,Lt as HEADING_CASES,Ue as HEADING_COMPRESSIONS,Ye as HEADING_MAX_PX_MAX,Ge as HEADING_MAX_PX_MIN,y as HEADING_WEIGHT_MAX,M as HEADING_WEIGHT_MIN,ke as HOVER_EFFECTS,Ne as IDENTITY_CARD_GAP,W as IDENTITY_CARD_SHADOW,Fe as IDENTITY_HOVER_EFFECT,P as OVERLAY_INK_DARK,ue as OVERLAY_INK_LIGHT,fe as READABILITY_AA,he as READABILITY_AA_LARGE,At as SCALE_OF_STEP,w as SITE_THEME_KEY,X as SIZE_STEPS,Te as TEXT_SIZE_MAX,Ae as TEXT_SIZE_MIN,N as THEME_DAY_END_HOUR,L as THEME_DAY_START_HOUR,je as THEME_MODE_KEY,re as THEME_STORAGE_KEY,pt as THEME_SURFACE_KEYS,Ze as THEME_SWITCH_HIDE,Ve as THEME_SWITCH_KEY,Se as TYPE_GROUPS,Et as TYPE_GROUP_LABELS,m as accentInk,dt as bandPresetFor,gt as bandPresetIndex,tt as brandTheme,ve as buildThemeBootScript,Mt as cardGapAttr,Dt as cardShadowAttr,Ht as compressionMetrics,J as contrastRatio,D as cornerRadiusTokens,It as cornerStyleTokens,xt as darkBandIndex,Ee as darkPresetIndex,it as darkerAccents,ct as fillIsDark,ot as gradeContrast,wt as headingCompressionAttr,Pt as headingTypographyFromRow,kt as headingTypographyStyle,Ft as headingTypographyToRow,yt as hoverEffectAttr,oe as isDayHour,$e as normalizeCardGap,j as normalizeCardShadow,C as normalizeCornerRadius,De as normalizeCornerStyle,q as normalizeHeadingCompression,O as normalizeHeadingTypography,V as normalizeHoverEffect,be as normalizeSize,Ie as normalizeSizes,k as normalizeTheme,u as normalizeThemeColors,Qe as resolveTheme,xe as resolvedButtonInk,z as sectionBandTone,f as selectedThemeColors,Ot as shadowColorTokens,lt as siteButtonPaint,Rt as siteButtonRadiusPx,Ct as siteCornerRadiusTokens,ze as siteThemeMetadata,$t as siteThemeOf,mt as surfacePresetIndex,ht as surfaceTwoTone,at as themeAccentStyle,A as themeButtonColour,F as themeButtonInk,ut as themeButtonStyle,st as themeColorStyle,le as themeLightInk,ft as themePresetAccentVars,_t as themeSurfaceStyle,nt as themeSwatchColors,St as typeScaleGroupOfClassName,bt as typeSizesStyle};
@@ -14,6 +14,7 @@ export type CardRow = {
14
14
  item?: unknown;
15
15
  finish?: string;
16
16
  nested?: boolean;
17
+ previewHover?: boolean;
17
18
  state?: CardRowState;
18
19
  linesBetween?: boolean;
19
20
  };
@@ -45,9 +46,10 @@ type CardTemplateRowsProps = {
45
46
  stateLine?: CardStateLine;
46
47
  actions?: readonly (CardItemAction | undefined)[];
47
48
  pressTitles?: readonly CardPressTitle[];
49
+ previewHover?: boolean;
48
50
  fallback: ReactNode;
49
51
  copyAttrs?: Readonly<Record<string, string>> | ((row: CardRow) => Readonly<Record<string, string>>);
50
52
  wrapCopy?: (copy: ReactNode, row: CardRow) => ReactNode;
51
53
  children: (cards: ReactNode) => ReactNode;
52
54
  };
53
- export declare function CardTemplateRows({ ownerId, ownerType, slot, Template, rows, items, fields, states, stateLine, actions, pressTitles, fallback, copyAttrs, wrapCopy, children }: CardTemplateRowsProps): import("react").JSX.Element;
55
+ export declare function CardTemplateRows({ ownerId, ownerType, slot, Template, rows, items, fields, states, stateLine, actions, pressTitles, previewHover, fallback, copyAttrs, wrapCopy, children }: CardTemplateRowsProps): import("react").JSX.Element;
@@ -1 +1 @@
1
- "use client";import{Fragment as u,jsx as t,jsxs as I}from"react/jsx-runtime";import{createContext as x,useContext as C,useId as j}from"react";import{REPEAT_ATTRIBUTE as H,REPEAT_INDEX_ATTRIBUTE as K}from"efficient-easel/draw";import{BOX_LINKED_CLASS as O}from"../../format/lib/content/box-link.js";import{BOX_HIDE_WHEN_ROW_EMPTY as U,CARD_TEMPLATE_SLOT as W,cardTemplateLinesBetween as X,rowFilledProps as M,templateBoxIsEmpty as v}from"../../format/lib/content/card-template.js";import{CARD_ACTION_ATTR as V,CARD_ACTION_CLASS as G,CARD_ACTION_HOVER_CLASS as Y,CARD_ACTION_OFF_CLASS as q,CARD_STATE_LINE_CLASS as z,CARD_STATE_PICKED_BAR_CLASS as J,CARD_STATE_PICKED_CLASS as Q,CARD_STATE_PICKED_WASH_CLASS as Z,CARD_STATE_UNDER_LINE_CLASS as ee,cardStateAttrs as te,cardStatePicked as re,cardStateValue as ne}from"../../format/lib/content/card-state.js";import{usePageRecordRow as oe}from"./CurrentRecord.js";import{CardCopyCell as se}from"./InBoxContext.js";import{SECTION_FILL_CLASS as ae}from"../../format/lib/content/section-min-height.js";function pe({props:o,editing:r,children:n}){const e=C(A);return!r&&v(o,e?.row)?null:t(u,{children:n})}const S=x(null);function Ee({field:o,children:r}){const n=C(S);return t(u,{children:r(n&&n.field===o?n.id:void 0)})}function le(o,r){return o?.find(e=>!!r[e.field]?.trim()&&!e.gates.some(s=>v({[U]:s},r)))?.field??""}const A=x(null);function Re(){return C(A)}function fe({type:o,props:r,children:n}){const e=C(A),s=oe(),l=e?.row??s;return t(u,{children:n(M(o,r,l,e?.ownerType,e?.fields,e?.slot),e,l)})}function ie({attrs:o,selected:r,hover:n,action:e,titleField:s,children:l}){const i=j(),{press:T,disabled:a}=e,_=e.label?.trim(),m=!_&&s?{id:`${i}-title`,field:s}:null;return I("div",{...o,id:i,className:n&&!a?`${O} ${Y}`:O,children:[t("button",{type:"button",[V]:"",className:a?q:G,"aria-pressed":r,..._?{"aria-label":_}:{"aria-labelledby":m?.id??i},...a?{"aria-disabled":!0,tabIndex:-1}:null,onClick:a?void 0:T}),t(S.Provider,{value:m,children:l})]})}function he({ownerId:o,ownerType:r,slot:n=W,Template:e,rows:s,items:l,fields:i,states:T,stateLine:a,actions:_,pressTitles:m,fallback:B,copyAttrs:p,wrapCopy:N,children:F}){const g=C(A),k=C(S);if(!e||(e.blockCount??0)<=0)return t(u,{children:B});const y=g!==null,D=X(r),L=e.blockCount===1?t(se,{children:t(e,{className:ae})}):t(e,{}),$=s.map((P,c)=>{const d=T?.[c],E={row:P,index:c,ownerType:r,slot:n,item:l?.[c],nested:y,...i?{fields:i}:null,...d?{state:d}:null,...D?{linesBetween:D}:null},R=ne(d)?I(u,{children:[L,a==="under"?t("span",{"aria-hidden":"true",className:ee}):re(d)?I("span",{"aria-hidden":"true",className:Q,children:[t("span",{className:J}),t("span",{className:Z})]}):t("span",{"aria-hidden":"true",className:z})]}):L,f={[H]:`${o}:${n}`,[K]:c,...typeof p=="function"?p(E):p},b=_?.[c],h=te(d,a),w=b?t(ie,{attrs:{...f,...h},selected:d?.selected===!0,hover:a!=="under",action:b,titleField:le(m,P),children:R}):k?t("div",{...f,...h,children:t(S.Provider,{value:null,children:R})}):t("div",{...f,...h,children:R});return t(A.Provider,{value:E,children:N?N(w,E):w},c)});return t(u,{children:F($)})}export{Ee as CardPressTitled,A as CardRowContext,fe as CardRowDrawn,he as CardTemplateRows,pe as RowEmptyGate,Re as useCardRow};
1
+ "use client";import{Fragment as u,jsx as t,jsxs as I}from"react/jsx-runtime";import{createContext as O,useContext as C,useId as K}from"react";import{REPEAT_ATTRIBUTE as U,REPEAT_INDEX_ATTRIBUTE as W}from"efficient-easel/draw";import{BOX_LINKED_CLASS as B}from"../../format/lib/content/box-link.js";import{BOX_HIDE_WHEN_ROW_EMPTY as X,CARD_TEMPLATE_SLOT as M,cardTemplateLinesBetween as V,rowFilledProps as G,templateBoxIsEmpty as F}from"../../format/lib/content/card-template.js";import{CARD_ACTION_ATTR as Y,CARD_ACTION_CLASS as q,CARD_ACTION_HOVER_CLASS as z,CARD_ACTION_OFF_CLASS as J,CARD_STATE_LINE_CLASS as Q,CARD_STATE_PICKED_BAR_CLASS as Z,CARD_STATE_PICKED_CLASS as ee,CARD_STATE_PICKED_WASH_CLASS as te,CARD_STATE_UNDER_LINE_CLASS as re,cardStateAttrs as ne,cardStatePicked as oe,cardStateValue as se}from"../../format/lib/content/card-state.js";import{usePageRecordRow as le}from"./CurrentRecord.js";import{CardCopyCell as ae}from"./InBoxContext.js";import{SECTION_FILL_CLASS as ie}from"../../format/lib/content/section-min-height.js";function Re({props:o,editing:r,children:n}){const e=C(A);return!r&&F(o,e?.row)?null:t(u,{children:n})}const S=O(null);function fe({field:o,children:r}){const n=C(S);return t(u,{children:r(n&&n.field===o?n.id:void 0)})}function ce(o,r){return o?.find(e=>!!r[e.field]?.trim()&&!e.gates.some(s=>F({[X]:s},r)))?.field??""}const A=O(null);function he(){return C(A)}function Ie({type:o,props:r,children:n}){const e=C(A),s=le(),a=e?.row??s;return t(u,{children:n(G(o,r,a,e?.ownerType,e?.fields,e?.slot),e,a)})}function de({attrs:o,selected:r,hover:n,action:e,titleField:s,children:a}){const i=K(),{press:T,disabled:l}=e,_=e.label?.trim(),m=!_&&s?{id:`${i}-title`,field:s}:null;return I("div",{...o,id:i,className:n&&!l?`${B} ${z}`:B,children:[t("button",{type:"button",[Y]:"",className:l?J:q,"aria-pressed":r,..._?{"aria-label":_}:{"aria-labelledby":m?.id??i},...l?{"aria-disabled":!0,tabIndex:-1}:null,onClick:l?void 0:T}),t(S.Provider,{value:m,children:a})]})}function Ne({ownerId:o,ownerType:r,slot:n=M,Template:e,rows:s,items:a,fields:i,states:T,stateLine:l,actions:_,pressTitles:m,previewHover:g,fallback:H,copyAttrs:p,wrapCopy:N,children:k}){const D=C(A),y=C(S);if(!e||(e.blockCount??0)<=0)return t(u,{children:H});const $=D!==null,L=V(r),P=g??D?.previewHover,v=e.blockCount===1?t(ae,{children:t(e,{className:ie})}):t(e,{}),j=s.map((w,c)=>{const d=T?.[c],E={row:w,index:c,ownerType:r,slot:n,item:a?.[c],nested:$,...i?{fields:i}:null,...d?{state:d}:null,...L?{linesBetween:L}:null,...P?{previewHover:P}:null},R=se(d)?I(u,{children:[v,l==="under"?t("span",{"aria-hidden":"true",className:re}):oe(d)?I("span",{"aria-hidden":"true",className:ee,children:[t("span",{className:Z}),t("span",{className:te})]}):t("span",{"aria-hidden":"true",className:Q})]}):v,f={[U]:`${o}:${n}`,[W]:c,...typeof p=="function"?p(E):p},b=_?.[c],h=ne(d,l),x=b?t(de,{attrs:{...f,...h},selected:d?.selected===!0,hover:l!=="under",action:b,titleField:ce(m,w),children:R}):y?t("div",{...f,...h,children:t(S.Provider,{value:null,children:R})}):t("div",{...f,...h,children:R});return t(A.Provider,{value:E,children:N?N(x,E):x},c)});return t(u,{children:k(j)})}export{fe as CardPressTitled,A as CardRowContext,Ie as CardRowDrawn,Ne as CardTemplateRows,Re as RowEmptyGate,he as useCardRow};
@@ -70,6 +70,7 @@ interface FlexProps {
70
70
  link?: unknown;
71
71
  rowLink?: string;
72
72
  rowImage?: string;
73
+ hoverShow?: unknown;
73
74
  highlight?: Record<string, string> | null;
74
75
  boxShape?: unknown;
75
76
  boxShapePhone?: unknown;
@@ -91,5 +92,5 @@ interface FlexProps {
91
92
  rowStyle?: unknown;
92
93
  sideSpace?: unknown;
93
94
  }
94
- export default function Flex({ direction: storedDirection, label, tabShape, gap, gapPhone, gapTablet, justify, align, wrap, share: storedShare, sharePhone, shareTablet, wrapPhone, orderPhone: storedOrderPhone, phoneRow, columns, columnsTablet, separator, stackBelow, blockSpacing, bgImage: storedBgImage, bgImagePhone: storedBgImagePhone, rowImage: storedRowImage, pictureHover, darken, darkenStyle, darkenTablet, darkenPhone, darkenStyleTablet, darkenStylePhone, placement, padV2, border: storedBorder, borderTablet: storedBorderTablet, borderPhone: storedBorderPhone, borderUnits, pad, contained, fillHeight, shadow, shadowTablet, shadowPhone, justifyTablet, justifyPhone, alignTablet, alignPhone, wrapTablet, blockSpacingTablet, blockSpacingPhone, loop, scrollDirection, loopSeconds, loopDelay, editing, fillColor, fillColorTablet, fillColorPhone, swatch, line, upcoming, link, rowLink, highlight, boxShape, boxShapePhone, boxShapeTablet, angle, jumpHighlight, anchor, sharedSides: storedSharedSides, sharedRows: storedSharedRows, boxId, slotCount, mirrorCards, content: Content, rowTitle: RowTitle, startsOpen, rowStyle, sideSpace, }: FlexProps): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
95
+ export default function Flex({ direction: storedDirection, label, tabShape, gap, gapPhone, gapTablet, justify, align, wrap, share: storedShare, sharePhone, shareTablet, wrapPhone, orderPhone: storedOrderPhone, phoneRow, columns, columnsTablet, separator, stackBelow, blockSpacing, bgImage: storedBgImage, bgImagePhone: storedBgImagePhone, rowImage: storedRowImage, hoverShow, pictureHover, darken, darkenStyle, darkenTablet, darkenPhone, darkenStyleTablet, darkenStylePhone, placement, padV2, border: storedBorder, borderTablet: storedBorderTablet, borderPhone: storedBorderPhone, borderUnits, pad, contained, fillHeight, shadow, shadowTablet, shadowPhone, justifyTablet, justifyPhone, alignTablet, alignPhone, wrapTablet, blockSpacingTablet, blockSpacingPhone, loop, scrollDirection, loopSeconds, loopDelay, editing, fillColor, fillColorTablet, fillColorPhone, swatch, line, upcoming, link, rowLink, highlight, boxShape, boxShapePhone, boxShapeTablet, angle, jumpHighlight, anchor, sharedSides: storedSharedSides, sharedRows: storedSharedRows, boxId, slotCount, mirrorCards, content: Content, rowTitle: RowTitle, startsOpen, rowStyle, sideSpace, }: FlexProps): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
95
96
  export {};
@@ -1 +1 @@
1
- import{Fragment as ee,jsx as e,jsxs as be}from"react/jsx-runtime";import{useContext as zn,useId as Jn}from"react";import Yn from"./BoxTabs.js";import{AccordionRowStyleContext as Ge,BoxTabPaneContext as We,useAccordionRowStyle as Zn,useBoxPaneKind as qn,useFirstCopyOpens as Qn,useIsTabPane as et}from"./BoxTabPaneContext.js";import ot,{ACCORDION_COUNTER_RESET as st}from"./BoxAccordionRow.js";import{ACCORDION_MARK_SHEET as nt}from"./AccordionMark.js";import{accordionRowStyleOf as tt}from"../../format/lib/content/accordion-row-style.js";import{boxPhoneCell as rt,boxPhoneOrder as lt}from"../../format/lib/content/box-phone-place.js";import{CellFillContext as as,InBoxContext as ds,useCellOfStretchedRow as it,useFillsCell as ct}from"./InBoxContext.js";import at,{InsideSiteColumn as us,useInsideSiteGutter as dt,useSectionRoot as ut}from"./SiteGutterFrame.js";import{BoxSurfaceProvider as mt}from"./BoxSurfaceContext.js";import ft from"./PictureWash.js";import{BoxCellContext as ms,NoCellBound as ht}from"./BoxCellContext.js";import{boxCellFractions as Ct}from"../lib/content/box-cell-bound.js";import{boundOf as bt}from"../../format/lib/content/cell-picture-sizes.js";import{useInSiteHeader as St}from"./PhoneMenuTools.js";import{useCardRow as wt}from"./CardRowContext.js";import{cardLineBetween as Xe,framesItsCards as pt}from"../../format/lib/content/card-place.js";import{rowLinkText as xt}from"../../format/lib/content/card-template.js";import{HandedMirrorContext as Pt,MirrorContext as _t,RowHandContext as fs,boxPlace as $t,useHandedMirrorAbove as vt,useHandedRows as Rt,useMirroredCopy as Ot,useUnderCardBox as yt}from"./MirrorContext.js";import{boxChildrenHand as Lt,isMirroredCopy as At,mirrorCardsActs as hs,mirrorCardsOf as Nt,mirroredBoxClass as kt,MIRROR_ROW_CLASS as It,ownsCard as gt}from"../../format/lib/content/mirror-cards.js";import{FRAME_BASE as je,frameGutterOf as Bt}from"./BlockFrame.js";import{BOX_SIDE_SPACE_SITE as Et,boxSideSpaceOf as Tt}from"../../format/lib/content/box-side-space.js";import{containerGapProps as Cs}from"../../format/lib/content/container-gap.js";import{boxLayoutClasses as Ft,boxAlignViewClasses as Dt,boxBlockSpacingClass as Ht,boxBlockSpacingViewClasses as Mt,boxJustifyViewClasses as Vt,boxWrapTabletClass as Gt,boxFitContentClass as Wt,boxAccordionColumnsClass as bs,boxRowColumnsClass as Xt,boxRowTabletColumnsClass as jt,boxRowTabletShareClass as Kt,boxPhoneCellsShareLine as Ut,boxPhoneRowClasses as oe,boxPhoneRowFits as zt,boxShareClasses as W,boxShareVars as Jt,boxWrapClass as Yt,BOX_GAP_ONLY_CLASS as Zt}from"../../format/lib/content/box-layout.js";import{boxSeparatorClasses as qt,boxSeparatorSeamClass as Qt,boxSeparatorStyle as er,isStripBox as or}from"../../format/lib/content/box-separator.js";import{DEFAULT_LOOP_DELAY as sr,DEFAULT_LOOP_DIRECTION as nr,DEFAULT_LOOP_SECONDS as tr,isVerticalLoop as rr}from"../../format/lib/animation/index.js";import{LoopTrack as lr}from"../lib/animation/LoopTrack.js";import{BOX_CARD_PAD as R,BOX_OWNS_SIDES_CLASS as ir,boxDarkenStyle as cr,boxPaintOf as ar,boxFillViews as dr,boxPlacementClasses as ur,boxCardProps as mr,boxIsCard as Ss,boxRowPicture as fr,boxSwatchFill as hr,boxWashViews as Cr,CARD_SHADOW_CLASS as br,isBackgroundBox as ws}from"../../format/lib/content/box-background.js";import{BOX_ROW_IMAGE_PROP as S}from"../../format/lib/content/box-card-rule.js";import{boxShadowAttrs as Sr,boxShadowOnAnyView as wr,boxShadowViewAttrs as pr}from"../../format/lib/content/box-shadow.js";import{boxRunsEdgeToEdge as xr,drawsSiteGutter as Pr}from"../../format/lib/content/site-gutter.js";import{boxShapeClass as _r,boxShapeClasses as $r}from"../../format/lib/content/box-shape.js";import{boxAngleStyle as vr}from"../../format/lib/content/box-angle.js";import{BOX_JUMP_ATTR as Rr,BOX_LINK_ATTR as ps,BOX_LINK_CLASS as xs,BOX_LINKED_CLASS as Or,boxJumpBlocksClass as yr,boxJumpCss as Lr,boxJumpSlug as Ar,boxLinkOf as Nr,siteLinkDraws as kr}from"../../format/lib/content/box-link.js";import{SiteLink as Ir}from"../lib/site-runtime.js";import{sectionBorderStyle as Ps}from"../../format/lib/content/borders.js";import{finiteNumber as Se}from"../../format/lib/finite-number.js";import{padDefaultIn as O,padSideValue as we,sectionPadAttrs as gr}from"../lib/content/section-padding.js";import{SECTION_FILL_CLASS as pe}from"../../format/lib/content/section-min-height.js";import{ON_MEDIA_INK_STYLE as Br,rowFillInkStyle as Er}from"../../format/lib/content/ink.js";import{useThemeLightInk as Tr}from"./ThemeLightInkContext.js";import{sizedBackground as Ke}from"../../format/lib/sized-image.js";import{PHOTO_HOST_ATTR as Fr,resolveImageTreatment as Dr}from"../../format/lib/content/image-treatment.js";import{BOX_HIGHLIGHT_CLASS as Hr,BOX_HIGHLIGHT_OVER_ROW_INK_CLASS as Mr}from"../../format/lib/animation/hover.js";import{BoxRail as Vr,BoxRailStop as Gr,RAIL_STOPS_CLASS as Wr,useTimelineRail as Xr}from"./TimelineRail.js";import{SHARED_PLAIN_ATTR as jr,sharedColumnsClasses as Kr,sharedColumnsCss as Ur,sharedRowsClasses as zr,sharedRowsCss as Jr}from"../lib/content/box-shared-columns.js";import Yr from"./PhotoHoverSheet.js";import{PictureHoverMoveSheet as Zr,PictureHoverZoom as qr,pictureHoverMoveOf as Qr}from"./PictureHoverMove.js";import{BOX_DESKTOP_LINE as el,stackGutterClass as ol,stackLineCss as sl,stackOuterClass as nl,stackRowClass as tl,storedStackLine as Ue}from"../lib/content/box-stack-line.js";const ze={"--sf-site-gutter":"0px"},rl={overflowX:"clip",overflowY:"visible"},ll={stretchedRow:!1,fillingColumn:!1,columnsRow:!1},_s={desktop:!1,phone:!1},$s="bg-cover bg-center bg-[image:var(--sf-box-bg)] max-view-wide:bg-[image:var(--sf-box-bg-p)]",Je=u=>u==null||u==="",Ye=u=>!Je(u)&&Number(u)===0;function il({children:u}){return e(ee,{children:u(Jn())})}function cl({direction:u,label:vs,tabShape:Rs,gap:Ze,gapPhone:Os,gapTablet:xe,justify:X,align:y,wrap:se,share:ys,sharePhone:j,shareTablet:I,wrapPhone:Ls,orderPhone:As,phoneRow:w,columns:m,columnsTablet:g,separator:f,stackBelow:ne,blockSpacing:qe,bgImage:Ns,bgImagePhone:ks,rowImage:Is,pictureHover:Qe,darken:eo,darkenStyle:Pe,darkenTablet:gs,darkenPhone:Bs,darkenStyleTablet:Es,darkenStylePhone:Ts,placement:Fs,padV2:oo=!1,border:Ds,borderTablet:Hs,borderPhone:Ms,borderUnits:so,pad:t={},contained:_e=!0,fillHeight:L=!1,shadow:$e,shadowTablet:no,shadowPhone:to,justifyTablet:ro,justifyPhone:Vs,alignTablet:Gs,alignPhone:Ws,wrapTablet:lo,blockSpacingTablet:Xs,blockSpacingPhone:js,loop:h,scrollDirection:ve=nr,loopSeconds:Ks=tr,loopDelay:Us=sr,editing:B=!1,fillColor:io,fillColorTablet:zs,fillColorPhone:Js,swatch:Ys,line:p,upcoming:Zs,link:qs,rowLink:co,highlight:Qs,boxShape:ao,boxShapePhone:en,boxShapeTablet:on,angle:sn,jumpHighlight:nn,anchor:tn,sharedSides:rn=_s,sharedRows:ln=!1,boxId:E,slotCount:cn,mirrorCards:uo,content:i,rowTitle:Re,startsOpen:an,rowStyle:dn,sideSpace:un}){const n=wt(),A=mr({[S]:Is},n!==null)[S],mo=Ss({[S]:A}),c=mo?_s:rn,mn=mo?!1:ln,fo=fr({[S]:A},n?.row),x=fo??Ns,ho=fo===null?ks:void 0,Co=zn(ms),fn=vt(),bo=yt()&&!(fn&&n!==null),P=Rt(),_=gt({inCopy:n!==null,nestedCopy:n?.nested===!0,underBox:bo}),So=Xe(Ds,n,_),wo=Xe(Hs,n,_),po=Xe(Ms,n,_),xo=n===null&&!bo&&P?.ids&&E?P.ids.indexOf(E):-1,te=xo>=0&&P&&E?$t(P,E,xo):-1,C=te>=0?P?.hand??null:_&&P?.copies===!0?P.hand:null,o=C?.row?"row":u,d=C?.row?C.row.share:ys,hn=C?.row?C.row.phoneReverse?[...i.blockIds??[]].reverse():void 0:As,re=mn&&!C?.row,T=B?"":co&&n?xt(n.row,co)??"":Nr(qs),$=L?"":$r(ao,en,on),Cn=!L&&_r(ao)!=="",N=Ar(nn,tn),Oe=hr({swatch:Ys},n?.row),le=Oe??ar(io),F=Oe?{className:"",style:{}}:dr(io,zs,Js),bn=Tr(),Po=Er(Oe,bn??void 0),_o=le||F.className?{...le?{backgroundColor:le}:{},...F.style,...Po}:void 0,$o=Xr(),K=p===!0&&o!=="tabs"&&o!=="accordion",r=Ss({bgImage:x,[S]:A}),vo=vr(sn),Ro=r?void 0:_o,ie=r?null:Qs??null,Sn=vo||ie?{...Ro,...vo,...ie}:Ro,ce=St(),wn=ut(),pn=et(),Oo=qn(),xn=Zn(),Pn=Qn(),l=o==="accordion",yo=tt(dn),U=l&&yo==="numbered",ye=ct(),_n=it(),D=or(o,f),a=h==="scroll"&&o!=="tabs"&&!l,$n=Ot(),ae=_||te>=0&&C!==null,Lo=C?C.mirror:uo,vn=te>=0?te:n?.index,de=_&&pt(n?.ownerType),Ao=hs({direction:o,separator:f,loop:h,line:p,bgImage:x,[S]:A,columns:m,columnsTablet:g,share:d,wrap:se},ae,c.desktop)&&At(Lo,vn),Rn=hs({direction:o,separator:f,loop:h,line:p,bgImage:x,[S]:A,columns:m,columnsTablet:g,share:d,wrap:se},ae,c.desktop)&&Nt(Lo)!==null,H=Xt({direction:o,separator:f,loop:h,line:p,columns:m}),k=jt({direction:o,separator:f,loop:h,line:p,columnsTablet:g}),z=Kt({direction:o,separator:f,loop:h,line:p,columns:m,columnsTablet:g,share:d,shareTablet:I}),J=Tt(un)===Et,Le=Bt(J),No=K&&Ue(ne)===el,M=o==="row"&&!r&&!D&&!a&&(!K||No)&&k===""&&z===""?Ue(ne):void 0,V=M??(o==="column"&&!r?Ue(ne):void 0),On=dt(),ue=Kr(c,i.blockCount??0,M),yn=(ue&&(!n||n.index===0)?Ur(c,i.blockCount??0,M):"")+(re&&(!n||n.index===0)?Jr(re,i.blockCount??0):""),ko=zr(re,i.blockCount??0),Io=k!==""?Number(g)>=2:z===""||W(I)!=="",go=k!==""||z!=="",Bo=o==="row"&&!D&&!a&&p!==!0,Ae=Bo&&!c.phone&&!c.desktop?rt(lt(hn,i.blockIds??[]),{editing:B}):void 0,Eo=Ae!==void 0&&!B,Ln=H!==""?Number(m)>=2:W(d)!=="",To=!r&&!l&&!Rn&&!c.desktop&&!c.phone,me=To&&!a?Vt(X,ro,Vs):"",Ne=r||ae?"":kt($n,o,a?void 0:X,y,me?ro:void 0),An=/view-wide:max-view-desktop:justify-/.test(Ne)?me.split(" ").filter(s=>!s.startsWith("view-wide:max-view-desktop:justify-")).join(" "):me,Nn=To&&o==="row"?Dt(y,Gs,Ws):"",kn=!a&&!l&&H===""&&k===""&&!c.desktop?Gt(se,lo):"",Fo=[l?"":W(d),o==="row"?Wt(d):"",H,k,z,Ht(l?"gap":qe),qt(o,f),l&&!U?"border-t border-line":"",An,Nn,kn,l?"":Mt(qe,Xs,js),l?bs(m,w,U):"",U?st:""].filter(Boolean).join(" "),In=Fo?` ${Fo}`:"",Do=["flex",o==="row"?D||a?"flex-row":`flex-row ${oe(w,j,Ls,lo)}`:"flex-col",Yt(a||l?!1:se),r?ur(Fs??"center",o):Ft(a||l?void 0:X,l?void 0:y)+(Ne?` ${Ne}`:"")].join(" ")+In,Y=L||r||$||ye?` ${pe}`:"",ke=Cn?` ${$}`:$?`${Y} ${$}`:Y,Ho=_n&&o==="column"&&!r&&!a&&W(d)===""&&(typeof X=="string"&&X!=="start"||me!==""),Mo=Y||(Ho?` ${pe}`:""),Ie=T?` ${Or}`:"",ge=r||ce||oo?"":" py-6",gn=M===void 0?"":` ${tl(M)}`,Vo=V===void 0||J?"":` ${ol(V)}`,Be=V===void 0?"":` ${nl(V)}`,Bn=`${je}${ge} ${Le}${ke}${Ie}${Vo}${Be}`,En=ce?`${ke}${Ie}${Be}`.trim():`w-full${ge}${ke}${Ie}${Be}`,Z=U&&bs(m,w)===""?Cs("Flex",0,"block"):Cs("Flex",Ze,o==="row"?"inline":"block",Os,D||a?void 0:xe),Go=Jt(d,I,o==="row"?i.blockCount??0:0),Wo=D?{...Z.style,...er(o,f)}:Z.style,Tn=Go?{...Wo,...Go}:Wo,Ee=(s="")=>e(i,{className:`${Do}${Ao?` ${It}`:""}${Z.className}${Mo}${gn}${s?` ${s}`:""}${K?` ${Wr}`:""}${N?` ${yr(N)}`:""}${ue}${ko}`,style:Tn,minEmptyHeight:120,...Ae?{cell:Ae}:null}),Xo=rr(ve)?"":Qt(o,f),jo=a?e(lr,{direction:ve,seconds:Ks,delay:Us,editing:B,copy:s=>Ee(s&&Xo?`${s} ${Xo}`:s)}):U?be(ee,{children:[e("style",{children:nt}),Ee()]}):Ee(),Te=o==="tabs"?e(Yn,{className:`${Do}${Z.className}${ye&&!L&&!r&&!$?"":Y}`,style:Z.style,shape:Rs,children:jo}):jo,Fe=l?e(We.Provider,{value:"accordion",children:e(Ge.Provider,{value:yo,children:Te})}):Oo?e(We.Provider,{value:!1,children:e(Ge.Provider,{value:"plain",children:Te})}):Te,Ko=o==="row"&&!r&&(y===void 0||y==="stretch"),Fn={stretchedRow:Ko,fillingColumn:o==="column"&&(ye||Ho),columnsRow:H!==""||k!==""||ue!==""||ko!==""||o==="row"&&(Array.isArray(d)||Array.isArray(I))||Eo,...Eo?{phoneCells:!0}:null,...Ko&&Bo&&(i.blockCount??0)>=2&&Ln?{picturesFillRow:!0}:null,...go&&!Io?{fillFrom:"desktop"}:null,...Ut(w,j)&&(!go||Io)?{phoneRowFills:!0}:null,...E?{id:E}:null},Uo=n===null?Lt({direction:o,loop:h,bgImage:x,[S]:A,columns:m,mirrorCards:uo},!1):null,zo=Uo?e(fs.Provider,{value:{hand:Uo,ids:i.blockIds??[],boxes:[]},children:Fe}):P?e(fs.Provider,{value:null,children:Fe}):Fe,Jo=e(ds.Provider,{value:Fn,children:e(as.Provider,{value:!1,children:ae?e(_t.Provider,{value:Ao,children:e(Pt.Provider,{value:!_,children:zo})}):zo})}),Dn=Re?.blockCount??0,Yo=Oo==="accordion"&&!!Re&&(B||Dn>0)?e(ot,{startsOpen:an===!0||Pn&&_&&n?.index===0,editing:B,numbered:xn==="numbered",title:e(ds.Provider,{value:ll,children:e(as.Provider,{value:!1,children:e(We.Provider,{value:!1,children:e(Ge.Provider,{value:"plain",children:e(Re,{className:`min-w-0 flex-1 ${Zt}`,minEmptyHeight:24})})})})}),children:Jo}):Jo,De=K?e(Vr,{row:o==="row",stops:i.blockCount??0,desktopLine:M!==void 0&&No,children:Yo}):Yo,Hn=vs?.trim()||(pn?"":void 0),Mn={values:t,frame:ge?24:0},Vn=s=>$o?e(Gr,{on:$o,future:Zs===!0,children:s}):s,Gn=s=>kr(T)?e(Ir,{href:T,newTab:"auto",className:xs,"aria-labelledby":s,[ps]:""}):e("a",{href:T,className:xs,"aria-labelledby":s,[ps]:""}),Zo=(N?Lr(N):"")+yn+(V===void 0||n&&n.index!==0?"":sl(V,{gutter:!J})),qo=Zo?e("style",{dangerouslySetInnerHTML:{__html:Zo}}):null,q=xr({loop:h,direction:o,scrollDirection:ve,bgImage:x,[S]:A}),Wn=c.desktop&&ue!==""&&!le&&!F.className&&!Ps(So,po,wo,so)&&!wr($e,no,to)&&!T&&!$&&!L&&!N&&!Pr(_e&&!q,On)&&Ye(Ze)&&(Je(xe)||Ye(xe))&&oo&&Object.values(t).every(s=>Je(s)||Ye(s)),Xn=s=>({...Wn?{[jr]:""}:null,...r?null:{...Sr($e),...pr($e,no,to)},...N?{[Rr]:N}:null,...s?{id:s}:null}),Qo=H!==""?Number(m):0,jn=oe(w,j)===oe(void 0),Kn=(o==="column"||o==="row"&&!D&&!a&&(Qo===1&&jn||Qo===0&&i.blockCount===1))&&!r&&!K&&!ce,es=r&&wn&&!ce,os=(s,v)=>Vn(e(at,{contained:_e&&!q,style:q?ze:void 0,framedClass:Bn,fillClass:En,columnClass:`${je} ${Le}${Mo}${Vo}`,tabLabel:Hn,pad:r?void 0:Mn,border:Ps(So,po,wo,so),outerAttrs:Xn(v),box:!0,edge:Kn,outerStyle:Sn,outerClass:r?void 0:[F.className,ie?Hr:"",ie&&Po?Mr:""].filter(Boolean).join(" ")||void 0,bleed:es,siteSide:J,children:qo||v?be(ee,{children:[qo,v?Gn(v):null,q?e(us,{children:s}):s]}):q?e(us,{children:s}):s})),He=s=>T?e(il,{children:v=>os(s,v)}):os(s),ss=s=>Co.bound?e(ht,{children:s}):s;if(!r){const s=y===void 0||y==="stretch",v=(W(d)!==""||H!==""||k!=="")&&!zt(w,j)&&!(z!==""&&W(I)==="")&&(s||oe(w)!==oe(void 0));if(!(o==="row"?v:o==="column"&&s))return He(ss(De));const cs=Ct({direction:o,separator:f,loop:h,line:p,share:d,shareTablet:I,sharePhone:j,phoneRow:w,columns:m,columnsTablet:g,stackBelow:ne,shared:c.desktop||c.phone||re,count:cn}),Un={hasWidth:!0,...cs?{bound:bt(cs,Co.bound)}:null};return He(e(ms.Provider,{value:Un,children:De}))}const fe=ws(x),Q=fe?cr(eo,Pe):null,he=fe?Cr({darken:eo,darkenStyle:Pe,darkenTablet:gs,darkenStyleTablet:Es,darkenPhone:Bs,darkenStylePhone:Ts}):{className:"",style:{}},Me=ws(ho),ns=fe?Me?{"--sf-box-bg":Ke(x??""),"--sf-box-bg-p":Ke(ho??"")}:{backgroundImage:Ke(x??""),backgroundSize:"cover",backgroundPosition:"center"}:{},ts=Dr(void 0,void 0,Qe),G=ts.className?ts:null,b=fe?Qr(Qe,Pe):null,Ce=G!==null||!!b?.zoom,rs=Ce?e("div",{"aria-hidden":!0,className:`absolute inset-0${de?" rounded-[inherit]":""}${Me?` ${$s}`:""}${G?` ${G.className}`:""}`,style:{...ns,...G?.style??{}}}):null,Ve=gr({...t,top:Se(t.top)??O(R.desktop,t.unit,"desktop"),bottom:Se(t.bottom)??O(R.desktop,t.unit,"desktop"),topPhone:Se(t.topPhone)??O(R.phone,t.unitPhone,"mobile"),bottomPhone:Se(t.bottomPhone)??O(R.phone,t.unitPhone,"mobile"),left:we(t.left)??O(R.side,t.unit,"desktop"),right:we(t.right)??O(R.side,t.unit,"desktop"),leftPhone:we(t.leftPhone)??O(R.sidePhone,t.unitPhone,"mobile"),rightPhone:we(t.rightPhone)??O(R.sidePhone,t.unitPhone,"mobile"),sideSpace:J?"site":"box"}),ls=e("div",{className:`relative z-[1] ${ir} ${Ve?.className??""}${L||$?` ${pe}`:""}`.trimEnd(),style:Q?{...Ve?.style,...ze,...Br}:{...Ve?.style,...ze},children:ss(De)}),is=es&&_e?e("div",{className:`${je} ${Le}${L||$?` ${pe}`:""}`,children:ls}):ls;return He(e(ee,{children:be("div",{className:`relative isolate overflow-hidden ${br}${Y}${Me&&!Ce?` ${$s}`:""}${F.className?` ${F.className}`:""}${b?` ${b.className}`:""}`,style:{...de?rl:{},..._o,...Ce?{}:ns,...b?b.style:{}},...G?{[Fr]:""}:{},children:[e(Zr,{move:b}),Ce&&be(ee,{children:[e(Yr,{sheet:G?.sheet}),b?.zoom?e("div",{className:`absolute inset-0 overflow-hidden${de?" rounded-[inherit]":""}`,children:e(qr,{move:b,className:"absolute inset-0",children:rs})}):rs]}),e(ft,{wash:Q&&he.className?{...Q,...he.style}:Q,hover:b?.washHover,...de?{className:"rounded-[inherit]"}:{},...he.className?{restClassName:he.className}:{}}),Q?e(mt,{children:is}):is]})}))}export{cl as default};
1
+ import{Fragment as O,jsx as e,jsxs as A}from"react/jsx-runtime";import{useContext as ir,useId as ar,useState as cr}from"react";import dr from"./BoxTabs.js";import{AccordionRowStyleContext as ze,BoxTabPaneContext as Ye,useAccordionRowStyle as ur,useBoxPaneKind as mr,useFirstCopyOpens as fr,useIsTabPane as hr}from"./BoxTabPaneContext.js";import Cr,{ACCORDION_COUNTER_RESET as br}from"./BoxAccordionRow.js";import{ACCORDION_MARK_SHEET as Sr}from"./AccordionMark.js";import{accordionRowStyleOf as wr}from"../../format/lib/content/accordion-row-style.js";import{boxPhoneCell as xr,boxPhoneOrder as pr}from"../../format/lib/content/box-phone-place.js";import{CellFillContext as ws,InBoxContext as xs,useCellOfStretchedRow as _r,useFillsCell as vr}from"./InBoxContext.js";import Rr,{InsideSiteColumn as ps,useInsideSiteGutter as Pr,useSectionRoot as Or}from"./SiteGutterFrame.js";import{BoxSurfaceProvider as Ar}from"./BoxSurfaceContext.js";import $r from"./PictureWash.js";import{BoxCellContext as _s,NoCellBound as Lr}from"./BoxCellContext.js";import{boxCellFractions as yr}from"../lib/content/box-cell-bound.js";import{boundOf as Nr}from"../../format/lib/content/cell-picture-sizes.js";import{useInSiteHeader as Er}from"./PhoneMenuTools.js";import{useCardRow as kr}from"./CardRowContext.js";import{cardLineBetween as Je,framesItsCards as Ir}from"../../format/lib/content/card-place.js";import{rowLinkText as Br}from"../../format/lib/content/card-template.js";import{HandedMirrorContext as gr,MirrorContext as Tr,RowHandContext as vs,boxPlace as Hr,useHandedMirrorAbove as Fr,useHandedRows as Dr,useMirroredCopy as Vr,useUnderCardBox as Mr}from"./MirrorContext.js";import{boxChildrenHand as Wr,isMirroredCopy as Xr,mirrorCardsActs as Rs,mirrorCardsOf as Gr,mirroredBoxClass as jr,MIRROR_ROW_CLASS as Kr,ownsCard as Ur}from"../../format/lib/content/mirror-cards.js";import{FRAME_BASE as Ze,frameGutterOf as zr}from"./BlockFrame.js";import{BOX_SIDE_SPACE_SITE as Yr,boxSideSpaceOf as Jr}from"../../format/lib/content/box-side-space.js";import{containerGapProps as Ps}from"../../format/lib/content/container-gap.js";import{boxLayoutClasses as Zr,boxAlignViewClasses as qr,boxBlockSpacingClass as Qr,boxBlockSpacingViewClasses as et,boxJustifyViewClasses as ot,boxWrapTabletClass as st,boxFitContentClass as nt,boxAccordionColumnsClass as Os,boxRowColumnsClass as rt,boxRowTabletColumnsClass as tt,boxRowTabletShareClass as lt,boxPhoneCellsShareLine as it,boxPhoneRowClasses as ie,boxPhoneRowFits as at,boxShareClasses as K,boxShareVars as ct,boxWrapClass as dt,BOX_GAP_ONLY_CLASS as ut}from"../../format/lib/content/box-layout.js";import{boxSeparatorClasses as mt,boxSeparatorSeamClass as ft,boxSeparatorStyle as ht,isStripBox as Ct}from"../../format/lib/content/box-separator.js";import{DEFAULT_LOOP_DELAY as bt,DEFAULT_LOOP_DIRECTION as St,DEFAULT_LOOP_SECONDS as wt,isVerticalLoop as xt}from"../../format/lib/animation/index.js";import{LoopTrack as pt}from"../lib/animation/LoopTrack.js";import{BOX_CARD_PAD as $,BOX_OWNS_SIDES_CLASS as _t,boxDarkenStyle as As,boxPaintOf as vt,boxFillViews as Rt,boxPlacementClasses as Pt,boxCardProps as Ot,boxIsCard as $s,boxRowPicture as At,boxSwatchFill as $t,boxWashViews as Lt,CARD_SHADOW_CLASS as yt,isBackgroundBox as Ls}from"../../format/lib/content/box-background.js";import{BOX_ROW_IMAGE_PROP as w}from"../../format/lib/content/box-card-rule.js";import{boxShadowAttrs as Nt,boxShadowOnAnyView as Et,boxShadowViewAttrs as kt}from"../../format/lib/content/box-shadow.js";import{boxRunsEdgeToEdge as It,drawsSiteGutter as Bt}from"../../format/lib/content/site-gutter.js";import{boxShapeClass as gt,boxShapeClasses as Tt}from"../../format/lib/content/box-shape.js";import{boxAngleStyle as Ht}from"../../format/lib/content/box-angle.js";import{BOX_JUMP_ATTR as Ft,BOX_LINK_ATTR as ys,BOX_LINK_CLASS as Ns,BOX_LINKED_CLASS as Dt,boxJumpBlocksClass as Vt,boxJumpCss as Mt,boxJumpSlug as Wt,boxLinkOf as Xt,siteLinkDraws as Gt}from"../../format/lib/content/box-link.js";import{SiteLink as jt}from"../lib/site-runtime.js";import{sectionBorderStyle as Es}from"../../format/lib/content/borders.js";import{finiteNumber as _e}from"../../format/lib/finite-number.js";import{padDefaultIn as L,padSideValue as ve,sectionPadAttrs as Kt}from"../lib/content/section-padding.js";import{SECTION_FILL_CLASS as Re}from"../../format/lib/content/section-min-height.js";import{ON_MEDIA_INK_STYLE as Ut,rowFillInkStyle as zt}from"../../format/lib/content/ink.js";import{useThemeLightInk as Yt}from"./ThemeLightInkContext.js";import{sizedBackground as qe}from"../../format/lib/sized-image.js";import{BOX_REVEAL_CLASS as Jt,BOX_REVEAL_CSS as Zt,BOX_REVEAL_SHEET as qt,PHOTO_HOST_ATTR as Qt,resolveImageTreatment as el}from"../../format/lib/content/image-treatment.js";import ol,{HoverArrowsSlot as sl,HoverMediaArrows as nl}from"./HoverMediaLayer.js";import{HOVER_ARROWS_HOST_ATTR as rl,HOVER_ARROWS_HOST_CLASS as tl,HOVER_LAYER_GROUND as ll,cardRowHoverMedia as il,hoverLayerName as al}from"../../format/lib/content/hover-media.js";import{BOX_HIGHLIGHT_CLASS as cl,BOX_HIGHLIGHT_OVER_ROW_INK_CLASS as dl,BOX_SHOW_ON_CARD_HOVER as ul}from"../../format/lib/animation/hover.js";import{BoxRail as ml,BoxRailStop as fl,RAIL_STOPS_CLASS as hl,useTimelineRail as Cl}from"./TimelineRail.js";import{SHARED_PLAIN_ATTR as bl,sharedColumnsClasses as Sl,sharedColumnsCss as wl,sharedRowsClasses as xl,sharedRowsCss as pl}from"../lib/content/box-shared-columns.js";import ks from"./PhotoHoverSheet.js";import{PICTURE_FRAME_ONLY as _l,PictureHoverMoveSheet as vl,PictureHoverZoom as Rl,pictureHoverMoveOf as Pl}from"./PictureHoverMove.js";import{BOX_DESKTOP_LINE as Ol,stackGutterClass as Al,stackLineCss as $l,stackOuterClass as Ll,stackRowClass as yl,storedStackLine as Qe}from"../lib/content/box-stack-line.js";const eo={"--sf-site-gutter":"0px"},Nl={overflowX:"clip",overflowY:"visible"},El={stretchedRow:!1,fillingColumn:!1,columnsRow:!1},Is={desktop:!1,phone:!1},Bs="bg-cover bg-center bg-[image:var(--sf-box-bg)] max-view-wide:bg-[image:var(--sf-box-bg-p)]",oo=u=>u==null||u==="",so=u=>!oo(u)&&Number(u)===0;function kl({children:u}){return e(O,{children:u(ar())})}function Il({direction:u,label:gs,tabShape:Ts,gap:no,gapPhone:Hs,gapTablet:Pe,justify:U,align:y,wrap:ae,share:Fs,sharePhone:z,shareTablet:g,wrapPhone:Ds,orderPhone:Vs,phoneRow:x,columns:m,columnsTablet:T,separator:f,stackBelow:ce,blockSpacing:ro,bgImage:Ms,bgImagePhone:Ws,rowImage:Xs,hoverShow:Gs,pictureHover:H,darken:Oe,darkenStyle:de,darkenTablet:js,darkenPhone:Ks,darkenStyleTablet:Us,darkenStylePhone:zs,placement:Ys,padV2:to=!1,border:Js,borderTablet:Zs,borderPhone:qs,borderUnits:lo,pad:r={},contained:Ae=!0,fillHeight:N=!1,shadow:$e,shadowTablet:io,shadowPhone:ao,justifyTablet:co,justifyPhone:Qs,alignTablet:en,alignPhone:on,wrapTablet:uo,blockSpacingTablet:sn,blockSpacingPhone:nn,loop:h,scrollDirection:Le=St,loopSeconds:rn=wt,loopDelay:tn=bt,editing:E=!1,fillColor:mo,fillColorTablet:ln,fillColorPhone:an,swatch:cn,line:p,upcoming:dn,link:un,rowLink:fo,highlight:mn,boxShape:ho,boxShapePhone:fn,boxShapeTablet:hn,angle:Cn,jumpHighlight:bn,anchor:Sn,sharedSides:wn=Is,sharedRows:xn=!1,boxId:F,slotCount:pn,mirrorCards:Co,content:i,rowTitle:ye,startsOpen:_n,rowStyle:vn,sideSpace:Rn}){const n=kr(),k=Ot({[w]:Xs},n!==null)[w],bo=$s({[w]:k}),a=bo?Is:wn,Pn=bo?!1:xn,So=At({[w]:k},n?.row),_=So??Ms,wo=So===null?Ws:void 0,xo=ir(_s),[po,On]=cr(null),An=Fr(),_o=Mr()&&!(An&&n!==null),v=Dr(),C=Ur({inCopy:n!==null,nestedCopy:n?.nested===!0,underBox:_o}),Ne=Gs===ul&&n!==null&&!C&&!(E&&n.previewHover===!0),vo=Je(Js,n,C),Ro=Je(Zs,n,C),Po=Je(qs,n,C),Oo=n===null&&!_o&&v?.ids&&F?v.ids.indexOf(F):-1,ue=Oo>=0&&v&&F?Hr(v,F,Oo):-1,b=ue>=0?v?.hand??null:C&&v?.copies===!0?v.hand:null,s=b?.row?"row":u,d=b?.row?b.row.share:Fs,$n=b?.row?b.row.phoneReverse?[...i.blockIds??[]].reverse():void 0:Vs,me=Pn&&!b?.row,D=E?"":fo&&n?Br(n.row,fo)??"":Xt(un),R=N?"":Tt(ho,fn,hn),Ln=!N&&gt(ho)!=="",I=Wt(bn,Sn),Ee=$t({swatch:cn},n?.row),fe=Ee??vt(mo),V=Ee?{className:"",style:{}}:Rt(mo,ln,an),yn=Yt(),Ao=zt(Ee,yn??void 0),$o=fe||V.className?{...fe?{backgroundColor:fe}:{},...V.style,...Ao}:void 0,Lo=Cl(),Y=p===!0&&s!=="tabs"&&s!=="accordion",t=$s({bgImage:_,[w]:k}),yo=Ht(Cn),No=t?void 0:$o,he=t?null:mn??null,Nn=yo||he?{...No,...yo,...he}:No,Ce=Er(),En=Or(),kn=hr(),Eo=mr(),In=ur(),Bn=fr(),l=s==="accordion",ko=wr(vn),J=l&&ko==="numbered",ke=vr(),gn=_r(),M=Ct(s,f),c=h==="scroll"&&s!=="tabs"&&!l,Tn=Vr(),be=C||ue>=0&&b!==null,Io=b?b.mirror:Co,Hn=ue>=0?ue:n?.index,Z=C&&Ir(n?.ownerType),Bo=Rs({direction:s,separator:f,loop:h,line:p,bgImage:_,[w]:k,columns:m,columnsTablet:T,share:d,wrap:ae},be,a.desktop)&&Xr(Io,Hn),Fn=Rs({direction:s,separator:f,loop:h,line:p,bgImage:_,[w]:k,columns:m,columnsTablet:T,share:d,wrap:ae},be,a.desktop)&&Gr(Io)!==null,W=rt({direction:s,separator:f,loop:h,line:p,columns:m}),B=tt({direction:s,separator:f,loop:h,line:p,columnsTablet:T}),q=lt({direction:s,separator:f,loop:h,line:p,columns:m,columnsTablet:T,share:d,shareTablet:g}),Q=Jr(Rn)===Yr,Ie=zr(Q),go=Y&&Qe(ce)===Ol,X=s==="row"&&!t&&!M&&!c&&(!Y||go)&&B===""&&q===""?Qe(ce):void 0,G=X??(s==="column"&&!t?Qe(ce):void 0),Dn=Pr(),Se=Sl(a,i.blockCount??0,X),Vn=(Se&&(!n||n.index===0)?wl(a,i.blockCount??0,X):"")+(me&&(!n||n.index===0)?pl(me,i.blockCount??0):""),To=xl(me,i.blockCount??0),Ho=B!==""?Number(T)>=2:q===""||K(g)!=="",Fo=B!==""||q!=="",Do=s==="row"&&!M&&!c&&p!==!0,Be=Do&&!a.phone&&!a.desktop?xr(pr($n,i.blockIds??[]),{editing:E}):void 0,Vo=Be!==void 0&&!E,Mn=W!==""?Number(m)>=2:K(d)!=="",Mo=!t&&!l&&!Fn&&!a.desktop&&!a.phone,we=Mo&&!c?ot(U,co,Qs):"",ge=t||be?"":jr(Tn,s,c?void 0:U,y,we?co:void 0),Wn=/view-wide:max-view-desktop:justify-/.test(ge)?we.split(" ").filter(o=>!o.startsWith("view-wide:max-view-desktop:justify-")).join(" "):we,Xn=Mo&&s==="row"?qr(y,en,on):"",Gn=!c&&!l&&W===""&&B===""&&!a.desktop?st(ae,uo):"",Wo=[l?"":K(d),s==="row"?nt(d):"",W,B,q,Qr(l?"gap":ro),mt(s,f),l&&!J?"border-t border-line":"",Wn,Xn,Gn,l?"":et(ro,sn,nn),l?Os(m,x,J):"",J?br:""].filter(Boolean).join(" "),jn=Wo?` ${Wo}`:"",Xo=["flex",s==="row"?M||c?"flex-row":`flex-row ${ie(x,z,Ds,uo)}`:"flex-col",dt(c||l?!1:ae),t?Pt(Ys??"center",s):Zr(c||l?void 0:U,l?void 0:y)+(ge?` ${ge}`:"")].join(" ")+jn,ee=N||t||R||ke?` ${Re}`:"",Te=Ln?` ${R}`:R?`${ee} ${R}`:ee,Go=gn&&s==="column"&&!t&&!c&&K(d)===""&&(typeof U=="string"&&U!=="start"||we!==""),jo=ee||(Go?` ${Re}`:""),He=D?` ${Dt}`:"",Fe=t||Ce||to?"":" py-6",Kn=X===void 0?"":` ${yl(X)}`,Ko=G===void 0||Q?"":` ${Al(G)}`,De=G===void 0?"":` ${Ll(G)}`,Un=`${Ze}${Fe} ${Ie}${Te}${He}${Ko}${De}`,zn=Ce?`${Te}${He}${De}`.trim():`w-full${Fe}${Te}${He}${De}`,oe=J&&Os(m,x)===""?Ps("Flex",0,"block"):Ps("Flex",no,s==="row"?"inline":"block",Hs,M||c?void 0:Pe),Uo=ct(d,g,s==="row"?i.blockCount??0:0),zo=M?{...oe.style,...ht(s,f)}:oe.style,Yn=Uo?{...zo,...Uo}:zo,Ve=(o="")=>e(i,{className:`${Xo}${Bo?` ${Kr}`:""}${oe.className}${jo}${Kn}${o?` ${o}`:""}${Y?` ${hl}`:""}${I?` ${Vt(I)}`:""}${Se}${To}`,style:Yn,minEmptyHeight:120,...Be?{cell:Be}:null}),Yo=xt(Le)?"":ft(s,f),Jo=c?e(pt,{direction:Le,seconds:rn,delay:tn,editing:E,copy:o=>Ve(o&&Yo?`${o} ${Yo}`:o)}):J?A(O,{children:[e("style",{children:Sr}),Ve()]}):Ve(),Me=s==="tabs"?e(dr,{className:`${Xo}${oe.className}${ke&&!N&&!t&&!R?"":ee}`,style:oe.style,shape:Ts,children:Jo}):Jo,We=l?e(Ye.Provider,{value:"accordion",children:e(ze.Provider,{value:ko,children:Me})}):Eo?e(Ye.Provider,{value:!1,children:e(ze.Provider,{value:"plain",children:Me})}):Me,Zo=s==="row"&&!t&&(y===void 0||y==="stretch"),Jn={stretchedRow:Zo,fillingColumn:s==="column"&&(ke||Go),columnsRow:W!==""||B!==""||Se!==""||To!==""||s==="row"&&(Array.isArray(d)||Array.isArray(g))||Vo,...Vo?{phoneCells:!0}:null,...Zo&&Do&&(i.blockCount??0)>=2&&Mn?{picturesFillRow:!0}:null,...Fo&&!Ho?{fillFrom:"desktop"}:null,...it(x,z)&&(!Fo||Ho)?{phoneRowFills:!0}:null,...F?{id:F}:null},qo=n===null?Wr({direction:s,loop:h,bgImage:_,[w]:k,columns:m,mirrorCards:Co},!1):null,Qo=qo?e(vs.Provider,{value:{hand:qo,ids:i.blockIds??[],boxes:[]},children:We}):v?e(vs.Provider,{value:null,children:We}):We,es=e(xs.Provider,{value:Jn,children:e(ws.Provider,{value:!1,children:be?e(Tr.Provider,{value:Bo,children:e(gr.Provider,{value:!C,children:Qo})}):Qo})}),Zn=ye?.blockCount??0,os=Eo==="accordion"&&!!ye&&(E||Zn>0)?e(Cr,{startsOpen:_n===!0||Bn&&C&&n?.index===0,editing:E,numbered:In==="numbered",title:e(xs.Provider,{value:El,children:e(ws.Provider,{value:!1,children:e(Ye.Provider,{value:!1,children:e(ze.Provider,{value:"plain",children:e(ye,{className:`min-w-0 flex-1 ${ut}`,minEmptyHeight:24})})})})}),children:es}):es,Xe=Y?e(ml,{row:s==="row",stops:i.blockCount??0,desktopLine:X!==void 0&&go,children:os}):os,qn=gs?.trim()||(kn?"":void 0),Qn={values:r,frame:Fe?24:0},er=o=>Lo?e(fl,{on:Lo,future:dn===!0,children:o}):o,or=o=>Gt(D)?e(jt,{href:D,newTab:"auto",className:Ns,"aria-labelledby":o,[ys]:""}):e("a",{href:D,className:Ns,"aria-labelledby":o,[ys]:""}),ss=(I?Mt(I):"")+Vn+(G===void 0||n&&n.index!==0?"":$l(G,{gutter:!Q})),ns=ss?e("style",{dangerouslySetInnerHTML:{__html:ss}}):null,se=It({loop:h,direction:s,scrollDirection:Le,bgImage:_,[w]:k}),sr=a.desktop&&Se!==""&&!fe&&!V.className&&!Es(vo,Po,Ro,lo)&&!Et($e,io,ao)&&!D&&!R&&!N&&!I&&!Bt(Ae&&!se,Dn)&&so(no)&&(oo(Pe)||so(Pe))&&to&&Object.values(r).every(o=>oo(o)||so(o)),nr=o=>({...sr?{[bl]:""}:null,...t?null:{...Nt($e),...kt($e,io,ao)},...I?{[Ft]:I}:null,...o?{id:o}:null}),rs=W!==""?Number(m):0,rr=ie(x,z)===ie(void 0),tr=(s==="column"||s==="row"&&!M&&!c&&(rs===1&&rr||rs===0&&i.blockCount===1))&&!t&&!Y&&!Ce,ts=t&&En&&!Ce,xe=!t&&n!==null?As(Oe,de):null,ls=Ne||xe?A(O,{children:[Ne?e(ks,{sheet:Zt,name:qt}):null,xe?e("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 -z-10 rounded-[inherit]",style:xe}):null]}):null,is=[Ne?Jt:"",xe?"relative isolate":""].filter(Boolean).join(" "),as=o=>ls?A(O,{children:[ls,o]}):o,cs=(o,P)=>er(e(Rr,{contained:Ae&&!se,style:se?eo:void 0,framedClass:Un,fillClass:zn,columnClass:`${Ze} ${Ie}${jo}${Ko}`,tabLabel:qn,pad:t?void 0:Qn,border:Es(vo,Po,Ro,lo),outerAttrs:nr(P),box:!0,edge:tr,outerStyle:Nn,outerClass:t?is||void 0:[V.className,he?cl:"",he&&Ao?dl:"",is].filter(Boolean).join(" ")||void 0,bleed:ts,siteSide:Q,children:ns||P?A(O,{children:[ns,P?or(P):null,se?e(ps,{children:o}):o]}):se?e(ps,{children:o}):o})),Ge=o=>D?e(kl,{children:P=>cs(as(o),P)}):cs(as(o)),ds=o=>xo.bound?e(Lr,{children:o}):o;if(!t){const o=y===void 0||y==="stretch",P=(K(d)!==""||W!==""||B!=="")&&!at(x,z)&&!(q!==""&&K(g)==="")&&(o||ie(x)!==ie(void 0));if(!(s==="row"?P:s==="column"&&o))return Ge(ds(Xe));const Ss=yr({direction:s,separator:f,loop:h,line:p,share:d,shareTablet:g,sharePhone:z,phoneRow:x,columns:m,columnsTablet:T,stackBelow:ce,shared:a.desktop||a.phone||me,count:pn}),lr={hasWidth:!0,...Ss?{bound:Nr(Ss,xo.bound)}:null};return Ge(e(_s.Provider,{value:lr,children:Xe}))}const ne=Ls(_),re=ne?As(Oe,de):null,pe=ne?Lt({darken:Oe,darkenStyle:de,darkenTablet:js,darkenStyleTablet:Us,darkenPhone:Ks,darkenStylePhone:zs}):{className:"",style:{}},je=Ls(wo),us=ne?je?{"--sf-box-bg":qe(_??""),"--sf-box-bg-p":qe(wo??"")}:{backgroundImage:qe(_??""),backgroundSize:"cover",backgroundPosition:"center"}:{},ms=el(void 0,void 0,H),j=ms.className?ms:null,te=ne&&n&&H?.kind==="nextImage"&&H.media?il(n,H.media):null,S=ne?Pl(H,de)??(te?_l:null):null,fs=H?.media?.cover??"picture",Ke=te?e("div",{className:`absolute inset-0 isolate${Z?" rounded-[inherit]":""}`,children:e(sl.Provider,{value:On,children:e(ol,{media:te,name:al(n?.row),cover:fs,ground:ll[fs],arrowsAbove:!0})})}):null,le=j!==null||!!S?.zoom,hs=le?e("div",{"aria-hidden":!0,className:`absolute inset-0${Z?" rounded-[inherit]":""}${je?` ${Bs}`:""}${j?` ${j.className}`:""}`,style:{...us,...j?.style??{}}}):null,Ue=Kt({...r,top:_e(r.top)??L($.desktop,r.unit,"desktop"),bottom:_e(r.bottom)??L($.desktop,r.unit,"desktop"),topPhone:_e(r.topPhone)??L($.phone,r.unitPhone,"mobile"),bottomPhone:_e(r.bottomPhone)??L($.phone,r.unitPhone,"mobile"),left:ve(r.left)??L($.side,r.unit,"desktop"),right:ve(r.right)??L($.side,r.unit,"desktop"),leftPhone:ve(r.leftPhone)??L($.sidePhone,r.unitPhone,"mobile"),rightPhone:ve(r.rightPhone)??L($.sidePhone,r.unitPhone,"mobile"),sideSpace:Q?"site":"box"}),Cs=e("div",{className:`relative z-[1] ${_t} ${Ue?.className??""}${N||R?` ${Re}`:""}`.trimEnd(),style:re?{...Ue?.style,...eo,...Ut}:{...Ue?.style,...eo},children:ds(Xe)}),bs=ts&&Ae?e("div",{className:`${Ze} ${Ie}${N||R?` ${Re}`:""}`,children:Cs}):Cs;return Ge(e(O,{children:A("div",{className:`relative isolate overflow-hidden ${yt}${ee}${je&&!le?` ${Bs}`:""}${V.className?` ${V.className}`:""}${S?` ${S.className}`:""}`,style:{...Z?Nl:{},...$o,...le?{}:us,...S?S.style:{}},...j||te?{[Qt]:""}:{},children:[e(vl,{move:S}),le&&A(O,{children:[e(ks,{sheet:j?.sheet}),S?.zoom?e("div",{className:`absolute inset-0 overflow-hidden${Z?" rounded-[inherit]":""}`,children:A(Rl,{move:S,className:"absolute inset-0",children:[hs,Ke]})}):A(O,{children:[hs,Ke]})]}),!le&&Ke,e($r,{wash:re&&pe.className?{...re,...pe.style}:re,hover:S?.washHover,...Z?{className:"rounded-[inherit]"}:{},...pe.className?{restClassName:pe.className}:{}}),re?e(Ar,{children:bs}):bs,te?e("div",{[rl]:"",className:tl,children:po?e(nl,{state:po}):null}):null]})}))}export{Il as default};
@@ -1,9 +1,24 @@
1
1
  import type { HoverMediaCover } from "../../format/lib/animation/hover.js";
2
+ import { type HeroArrowDirection } from "../../format/lib/hero-arrows.js";
2
3
  import { type HoverMediaPick } from "../../format/lib/content/hover-media.js";
3
4
  export interface HoverMediaLayerProps {
4
5
  media: HoverMediaPick | null;
5
6
  name: string;
6
7
  cover?: HoverMediaCover;
7
8
  ground?: string;
9
+ arrowsAbove?: boolean;
8
10
  }
9
- export default function HoverMediaLayer({ media, name, cover, ground }: HoverMediaLayerProps): import("react").JSX.Element | null;
11
+ export interface HoverArrowsState {
12
+ name: string;
13
+ count: number;
14
+ shown: boolean;
15
+ press: (direction: HeroArrowDirection, e: {
16
+ preventDefault(): void;
17
+ stopPropagation(): void;
18
+ }) => void;
19
+ }
20
+ export declare const HoverArrowsSlot: import("react").Context<((state: HoverArrowsState | null) => void) | null>;
21
+ export declare function HoverMediaArrows({ state }: {
22
+ state: HoverArrowsState;
23
+ }): import("react").JSX.Element;
24
+ export default function HoverMediaLayer({ media, name, cover, ground, arrowsAbove }: HoverMediaLayerProps): import("react").JSX.Element | null;
@@ -1 +1 @@
1
- "use client";import{jsx as A,jsxs as I,Fragment as k}from"react/jsx-runtime";import{useEffect as T,useRef as W,useState as p}from"react";import $ from"./HeroArrows.js";import{arrowStep as z,HERO_ARROW_DIRECTIONS as Y}from"../../format/lib/hero-arrows.js";import{hoverArrowLabel as q,hoverMediaCount as V}from"../../format/lib/content/hover-media.js";import{CARD_COPY_ATTR as B,PHOTO_HOST_ATTR as G}from"../../format/lib/content/image-treatment.js";import{useDeferredPicture as J}from"../lib/first-screen.js";import{sizedImage as j}from"../../format/lib/sized-image.js";const K=200,H="data-hover-media-anchor";function Q(r){const i=r.closest(`[${B}]`);for(let o=r.parentElement;o;o=o.parentElement){const u=!i?.contains(o)&&[...o.children].some(h=>h.matches("a[href]"));if(o.hasAttribute(G)||u)return o.querySelectorAll(`[${H}]`).length===1?o:null}return null}const U={card:"pointer-events-none absolute inset-0 z-20 overflow-hidden rounded-[inherit] transition-opacity duration-200 motion-reduce:transition-none",picture:"pointer-events-none absolute inset-0 z-20 overflow-hidden transition-opacity duration-200 motion-reduce:transition-none"},X={cover:"h-full w-full object-cover",contain:"h-full w-full object-contain"};function M(r){const i=j(r,{fallbackWidth:960});return i.src===r?{src:r}:{src:i.src,srcSet:`${i.src} 1x, ${j(r,{fallbackWidth:1280}).src} 2x`}}const P=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(hover: hover) and (pointer: fine)").matches;function Z({media:r,name:i,cover:o="card",ground:u}){const v=W(null),h=J(),[c,w]=p(!1),[D,S]=p(!1),[l,L]=p(0),[E,_]=p(!1),f=r?.urls??[],s=f.length;if(T(()=>{const n=v.current;if(!n||s===0)return;const e=Q(n)??n.parentElement;if(!e)return;let t,m=!1;const y=()=>{t!==void 0&&clearTimeout(t),t=void 0,w(!1),S(!1),L(0),_(!1),m=!1},O=a=>{a.pointerType!=="mouse"||!P()||(t!==void 0&&clearTimeout(t),t=setTimeout(()=>{t=void 0,w(!0)},K))},R=a=>{if(a.pointerType==="mouse"){if(!m&&e.contains(document.activeElement)){t!==void 0&&clearTimeout(t),t=void 0;return}y()}},b=()=>{m=!0},x=()=>{!m&&P()&&w(!0)},g=a=>{const C=a.relatedTarget;(!C||!e.contains(C))&&y()};return e.addEventListener("pointerenter",O),e.addEventListener("pointerleave",R),e.addEventListener("pointerdown",b),e.addEventListener("focusin",x),e.addEventListener("focusout",g),()=>{t!==void 0&&clearTimeout(t),e.removeEventListener("pointerenter",O),e.removeEventListener("pointerleave",R),e.removeEventListener("pointerdown",b),e.removeEventListener("focusin",x),e.removeEventListener("focusout",g)}},[s]),T(()=>{if(!c)return;const n=requestAnimationFrame(()=>S(!0));return()=>cancelAnimationFrame(n)},[c]),T(()=>{if(!c||!E||s<2)return;const n=new Image,e=M(f[(l+1)%s]);e.srcSet&&(n.srcset=e.srcSet),n.src=e.src},[c,E,l,s,f]),!r||s===0)return null;const d=c?M(f[Math.min(l,s-1)]):null,F=(n,e)=>{e.preventDefault(),e.stopPropagation(),_(!0),L(t=>z(n,t,s))},N=Object.fromEntries(Y.map(n=>[n,q(n,i)]));return I(k,{children:[A("span",{ref:v,className:"sr-only","aria-live":"polite",[H]:"",children:c&&E?V(l,s):""}),d?I("div",{"data-hover-media":"","data-hover-cover":o,className:U[o],style:{opacity:D?1:0,...u?{backgroundColor:u}:{}},children:[A("img",{src:d.src,...d.srcSet?{srcSet:d.srcSet}:{},alt:"",decoding:"async",...h,className:X[r.fit]}),s>1?A($,{shape:"solid",sides:!0,labels:N,onPress:F}):null]}):null]})}export{Z as default};
1
+ "use client";import{jsx as w,jsxs as P,Fragment as q}from"react/jsx-runtime";import{createContext as B,useCallback as V,useContext as G,useEffect as A,useRef as J,useState as E}from"react";import K from"./HeroArrows.js";import{arrowStep as Q,HERO_ARROW_DIRECTIONS as U}from"../../format/lib/hero-arrows.js";import{hoverArrowLabel as X,hoverMediaCount as Z}from"../../format/lib/content/hover-media.js";import{CARD_COPY_ATTR as ee,PHOTO_HOST_ATTR as te}from"../../format/lib/content/image-treatment.js";import{useDeferredPicture as ne}from"../lib/first-screen.js";import{sizedImage as $}from"../../format/lib/sized-image.js";const re=B(null);function N({name:t,count:s,press:o}){if(s<2)return null;const a=Object.fromEntries(U.map(l=>[l,X(l,t)]));return w(K,{shape:"solid",sides:!0,labels:a,onPress:o})}function Ae({state:t}){return w("div",{className:ce,style:{opacity:t.shown?1:0},children:N(t)})}const oe=200,k="data-hover-media-anchor";function se(t){const s=t.closest(`[${ee}]`);for(let o=t.parentElement;o;o=o.parentElement){const a=!s?.contains(o)&&[...o.children].some(d=>d.matches("a[href]"));if(o.hasAttribute(te)||a)return o.querySelectorAll(`[${k}]`).length===1?o:null}return null}const b="transition-opacity duration-200 motion-reduce:transition-none",ie={card:`pointer-events-none absolute inset-0 z-20 overflow-hidden rounded-[inherit] ${b}`,picture:`pointer-events-none absolute inset-0 z-20 overflow-hidden ${b}`},ce=`pointer-events-none absolute inset-0 ${b}`,ae={cover:"h-full w-full object-cover",contain:"h-full w-full object-contain"};function W(t){const s=$(t,{fallbackWidth:960});return s.src===t?{src:t}:{src:s.src,srcSet:`${s.src} 1x, ${$(t,{fallbackWidth:1280}).src} 2x`}}const Y=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(hover: hover) and (pointer: fine)").matches;function le({media:t,name:s,cover:o="card",ground:a,arrowsAbove:l=!1}){const d=J(null),z=ne(),[c,S]=E(!1),[L,x]=E(!1),[m,O]=E(0),[T,y]=E(!1),u=G(re),_=l&&u!==null,p=t?.urls??[],n=p.length;A(()=>{const i=d.current;if(!i||n===0)return;const e=se(i)??i.parentElement;if(!e)return;let r,h=!1;const g=()=>{r!==void 0&&clearTimeout(r),r=void 0,S(!1),x(!1),O(0),y(!1),h=!1},H=f=>{f.pointerType!=="mouse"||!Y()||(r!==void 0&&clearTimeout(r),r=setTimeout(()=>{r=void 0,S(!0)},oe))},I=f=>{if(f.pointerType==="mouse"){if(!h&&e.contains(document.activeElement)){r!==void 0&&clearTimeout(r),r=void 0;return}g()}},M=()=>{h=!0},j=()=>{!h&&Y()&&S(!0)},D=f=>{const F=f.relatedTarget;(!F||!e.contains(F))&&g()};return e.addEventListener("pointerenter",H),e.addEventListener("pointerleave",I),e.addEventListener("pointerdown",M),e.addEventListener("focusin",j),e.addEventListener("focusout",D),()=>{r!==void 0&&clearTimeout(r),e.removeEventListener("pointerenter",H),e.removeEventListener("pointerleave",I),e.removeEventListener("pointerdown",M),e.removeEventListener("focusin",j),e.removeEventListener("focusout",D)}},[n]),A(()=>{if(!c)return;const i=requestAnimationFrame(()=>x(!0));return()=>cancelAnimationFrame(i)},[c]),A(()=>{if(!c||!T||n<2)return;const i=new Image,e=W(p[(m+1)%n]);e.srcSet&&(i.srcset=e.srcSet),i.src=e.src},[c,T,m,n,p]);const R=V((i,e)=>{e.preventDefault(),e.stopPropagation(),y(!0),O(r=>Q(i,r,n))},[n]),C=!!t&&c&&n>1;if(A(()=>{if(!(!_||!u))return u(C?{name:s,count:n,shown:L,press:R}:null),()=>u(null)},[_,u,C,s,n,L,R]),!t||n===0)return null;const v=c?W(p[Math.min(m,n-1)]):null;return P(q,{children:[w("span",{ref:d,className:"sr-only","aria-live":"polite",[k]:"",children:c&&T?Z(m,n):""}),v?P("div",{"data-hover-media":"","data-hover-cover":o,className:ie[o],style:{opacity:L?1:0,...a?{backgroundColor:a}:{}},children:[w("img",{src:v.src,...v.srcSet?{srcSet:v.srcSet}:{},alt:"",decoding:"async",...z,className:ae[t.fit]}),_?null:N({name:s,count:n,press:R})]}):null]})}export{re as HoverArrowsSlot,Ae as HoverMediaArrows,le as default};
@@ -1,7 +1,7 @@
1
1
  import { type ImageAspect } from "../../format/lib/content/image-aspect.js";
2
2
  import { type ImageFit } from "../../format/lib/content/image-fit.js";
3
3
  import type { HoverMediaCover, PictureHoverDrawn } from "../../format/lib/animation/hover.js";
4
- import type { HoverMediaPick } from "../../format/lib/content/hover-media.js";
4
+ import { type HoverMediaPick } from "../../format/lib/content/hover-media.js";
5
5
  import type { PadValues } from "../lib/content/section-padding.js";
6
6
  export type ImageHoverLayer = {
7
7
  media: HoverMediaPick;
@@ -1 +1 @@
1
- import{jsx as e,Fragment as se,jsxs as v}from"react/jsx-runtime";import{PagePicture as re}from"../lib/first-screen.js";import{SiteLink as le}from"../lib/site-runtime.js";import{siteLinkDraws as ie}from"../../format/lib/content/box-link.js";import me from"./BlockFrame.js";import{useCellPictureSizes as ae}from"./BoxCellContext.js";import{useBoxCell as ce,useFillsCell as ne}from"./InBoxContext.js";import{useInsideSiteGutter as fe,useSectionEdge as ue}from"./SiteGutterFrame.js";import{useSitePhotography as pe}from"./SitePhotographyContext.js";import{media as de}from"../lib/media.js";import{CONTENT_SIZES as R,sizedImage as ge}from"../../format/lib/sized-image.js";import{imageCornerStyle as he}from"../../format/lib/content/image-corners.js";import{FILL_ROW as Se,imageAspectClasses as ve,pictureLayerClass as we,imageFillFrom as Fe,imageAspectDrawn as Ne,imageAspectDrawsARatio as Ce,imageFocalPointActs as be,imageFocalPointActsIn as j,imageAspectPhoneOf as ye,imageFillRowClasses as xe,imageWidthFollowsBox as Ae}from"../../format/lib/content/image-aspect.js";import{drawsSiteGutter as Ie}from"../../format/lib/content/site-gutter.js";import{imageFitClass as $e,parseImageFit as ke}from"../../format/lib/content/image-fit.js";import{SECTION_FILL_CLASS as Pe}from"../../format/lib/content/section-min-height.js";import{PICTURE_WASH_CLASS as _e,resolveImageTreatment as Re}from"../../format/lib/content/image-treatment.js";import{boxDarkenStyle as je}from"../../format/lib/content/box-background.js";import{phoneFocus as Oe}from"../../format/lib/content/phone-focus.js";import{say as ze}from"../../format/lib/editor-words.js";import{sectionEdgeAttrs as Ee}from"../lib/content/section-edge.js";import He from"./PhotoHoverSheet.js";import Le from"./PictureWash.js";import Te from"./HoverMediaLayer.js";import{PictureHoverMoveSheet as De,PictureHoverZoom as Ge,pictureHoverMoveOf as We}from"./PictureHoverMove.js";import{PictureZoom as Be}from"./PictureZoom.js";const Me={picture:"var(--surface)",card:"var(--card-bg)"};function Ze({src:o,alt:O,aspect:z,aspectPhone:r,contained:w,grayscale:E,pictureHover:F,hoverLayer:s,darken:H,darkenStyle:N,href:L,fit:T,focal:C,focalPhone:D,focalTablet:G,corners:W,cornerSides:B,cornersUnit:M,pad:b,ownSize:Z=!1,editing:y=!1}){const c=Re(E,pe(),F),p=ce(),U=ne(),d=ue(),Y=ae(R),t=Ne(z,p?.picturesFillRow===!0),g=t===Se,x=Fe(p?.fillFrom,p?.phoneRowFills===!0,r),l=g?xe(x):null,A=ye(t,r),i=ke(T,"cover"),q=d||!Ae(t,A,i)?R:Y,I=he(W,B,M),J=be(i,t,r),h=Oe(j("mobile",i,t,r)?D:void 0,j("tablet",i,t,r)?G:void 0),$={...c.style??{},...C&&J?{objectPosition:C}:{},...h.style},n=o?ge(de(o)):null,m=We(F,N),K=je(H,N),Q=m?.washHover??null,k=m?.style??{},f=s&&o?e(Te,{media:s.media,name:s.name,cover:s.cover,ground:Me[s.cover]}):null,P=o&&n?e(re,{src:n.src,...n.srcSet?{srcSet:n.srcSet,sizes:q}:{},alt:O,className:`${l?`${l.img} `:""}h-full w-full ${Ce(t,r)?$e(i):""}${c.className?` ${c.className}`:""}${h.className?` ${h.className}`:""}`,...Object.keys($).length?{style:$}:{}}):null,S=P?v(se,{children:[e(He,{sheet:c.sheet}),e(De,{move:m}),e(Ge,{move:m,className:we(l),children:P}),e(Le,{wash:K,hover:Q,className:`pointer-events-none ${_e}`})]}):e("div",{className:"flex aspect-[16/9] items-center justify-center border border-dashed border-line font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg-dim",children:ze("Image — set a path")}),u=(L??"").trim(),V=u&&o?ie(u)?e(le,{href:u,className:"block h-full w-full",newTab:"auto",children:S}):e("a",{href:u,className:"block h-full w-full",children:S}):S,X=fe(),a=d&&!Z?Ee(d):null,_=b?{values:b,frame:g?0:24}:void 0,ee=_!==void 0&&Ie(a?!1:w,X),te=g?U||y||ee?Pe:"":"py-6",oe=o&&i==="contain"?"":"bg-surface ";return!o&&!y?null:v(me,{contained:a?!1:w,className:te,pad:_,...a?{fillWidth:a.className,style:a.style}:{},children:[e("figure",{...l?{className:l.figure}:{},children:v("div",{className:`relative w-full overflow-hidden ${oe}${ve(t,A,x)}${m?` ${m.className}`:""}`,...I||Object.keys(k).length?{style:{...I,...k}}:{},children:[e(Be,{fill:l,children:V}),f&&s?.cover==="picture"?f:null]})}),f&&s?.cover==="card"?f:null]})}export{Ze as default};
1
+ import{jsx as e,Fragment as se,jsxs as v}from"react/jsx-runtime";import{PagePicture as le}from"../lib/first-screen.js";import{SiteLink as re}from"../lib/site-runtime.js";import{siteLinkDraws as ie}from"../../format/lib/content/box-link.js";import me from"./BlockFrame.js";import{useCellPictureSizes as ae}from"./BoxCellContext.js";import{useBoxCell as ne,useFillsCell as ce}from"./InBoxContext.js";import{useInsideSiteGutter as fe,useSectionEdge as ue}from"./SiteGutterFrame.js";import{useSitePhotography as pe}from"./SitePhotographyContext.js";import{media as de}from"../lib/media.js";import{CONTENT_SIZES as R,sizedImage as ge}from"../../format/lib/sized-image.js";import{imageCornerStyle as he}from"../../format/lib/content/image-corners.js";import{FILL_ROW as Se,imageAspectClasses as ve,pictureLayerClass as we,imageFillFrom as Fe,imageAspectDrawn as Ne,imageAspectDrawsARatio as Ce,imageFocalPointActs as be,imageFocalPointActsIn as O,imageAspectPhoneOf as ye,imageFillRowClasses as xe,imageWidthFollowsBox as Ae}from"../../format/lib/content/image-aspect.js";import{drawsSiteGutter as Ie}from"../../format/lib/content/site-gutter.js";import{imageFitClass as $e,parseImageFit as ke}from"../../format/lib/content/image-fit.js";import{SECTION_FILL_CLASS as _e}from"../../format/lib/content/section-min-height.js";import{PICTURE_WASH_CLASS as Pe,resolveImageTreatment as Re}from"../../format/lib/content/image-treatment.js";import{boxDarkenStyle as Oe}from"../../format/lib/content/box-background.js";import{HOVER_LAYER_GROUND as je}from"../../format/lib/content/hover-media.js";import{phoneFocus as Ee}from"../../format/lib/content/phone-focus.js";import{say as He}from"../../format/lib/editor-words.js";import{sectionEdgeAttrs as ze}from"../lib/content/section-edge.js";import Le from"./PhotoHoverSheet.js";import Te from"./PictureWash.js";import De from"./HoverMediaLayer.js";import{PictureHoverMoveSheet as Ge,PictureHoverZoom as We,pictureHoverMoveOf as Be}from"./PictureHoverMove.js";import{PictureZoom as Me}from"./PictureZoom.js";function Ze({src:o,alt:j,aspect:E,aspectPhone:l,contained:w,grayscale:H,pictureHover:F,hoverLayer:s,darken:z,darkenStyle:N,href:L,fit:T,focal:C,focalPhone:D,focalTablet:G,corners:W,cornerSides:B,cornersUnit:M,pad:b,ownSize:Z=!1,editing:y=!1}){const n=Re(H,pe(),F),p=ne(),U=ce(),d=ue(),V=ae(R),t=Ne(E,p?.picturesFillRow===!0),g=t===Se,x=Fe(p?.fillFrom,p?.phoneRowFills===!0,l),r=g?xe(x):null,A=ye(t,l),i=ke(T,"cover"),Y=d||!Ae(t,A,i)?R:V,I=he(W,B,M),q=be(i,t,l),h=Ee(O("mobile",i,t,l)?D:void 0,O("tablet",i,t,l)?G:void 0),$={...n.style??{},...C&&q?{objectPosition:C}:{},...h.style},c=o?ge(de(o)):null,m=Be(F,N),J=Oe(z,N),K=m?.washHover??null,k=m?.style??{},f=s&&o?e(De,{media:s.media,name:s.name,cover:s.cover,ground:je[s.cover]}):null,_=o&&c?e(le,{src:c.src,...c.srcSet?{srcSet:c.srcSet,sizes:Y}:{},alt:j,className:`${r?`${r.img} `:""}h-full w-full ${Ce(t,l)?$e(i):""}${n.className?` ${n.className}`:""}${h.className?` ${h.className}`:""}`,...Object.keys($).length?{style:$}:{}}):null,S=_?v(se,{children:[e(Le,{sheet:n.sheet}),e(Ge,{move:m}),e(We,{move:m,className:we(r),children:_}),e(Te,{wash:J,hover:K,className:`pointer-events-none ${Pe}`})]}):e("div",{className:"flex aspect-[16/9] items-center justify-center border border-dashed border-line font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg-dim",children:He("Image — set a path")}),u=(L??"").trim(),Q=u&&o?ie(u)?e(re,{href:u,className:"block h-full w-full",newTab:"auto",children:S}):e("a",{href:u,className:"block h-full w-full",children:S}):S,X=fe(),a=d&&!Z?ze(d):null,P=b?{values:b,frame:g?0:24}:void 0,ee=P!==void 0&&Ie(a?!1:w,X),te=g?U||y||ee?_e:"":"py-6",oe=o&&i==="contain"?"":"bg-surface ";return!o&&!y?null:v(me,{contained:a?!1:w,className:te,pad:P,...a?{fillWidth:a.className,style:a.style}:{},children:[e("figure",{...r?{className:r.figure}:{},children:v("div",{className:`relative w-full overflow-hidden ${oe}${ve(t,A,x)}${m?` ${m.className}`:""}`,...I||Object.keys(k).length?{style:{...I,...k}}:{},children:[e(Me,{fill:r,children:Q}),f&&s?.cover==="picture"?f:null]})}),f&&s?.cover==="card"?f:null]})}export{Ze as default};
@@ -8,6 +8,7 @@ export interface PictureHoverMoveDrawn {
8
8
  washHover: CSSProperties | null;
9
9
  }
10
10
  export declare function pictureHoverMoveOf(pictureHover: PictureHoverDrawn | null | undefined, darkenStyle: unknown): PictureHoverMoveDrawn | null;
11
+ export declare const PICTURE_FRAME_ONLY: PictureHoverMoveDrawn;
11
12
  export declare function PictureHoverMoveSheet({ move }: {
12
13
  move: PictureHoverMoveDrawn | null;
13
14
  }): import("react").JSX.Element | null;
@@ -1 +1 @@
1
- import{jsx as n,Fragment as s}from"react/jsx-runtime";import{boxDarkenStyle as m}from"../../format/lib/content/box-background.js";import{PICTURE_MOVE_SHEET as l,PICTURE_ZOOM_CLASS as a,PICTURE_ZOOM_VAR as u,resolvePictureMove as i}from"../../format/lib/content/image-treatment.js";import c from"./PhotoHoverSheet.js";function P(e,t){const o=i(e);if(!o)return null;const r=e?.zoom??null;return{className:o.className??"",style:{...o.style??{},...r?{[u]:r}:{}},...o.sheet?{sheet:o.sheet}:{},zoom:r,washHover:e?.darken?m(e.darken,t):null}}function x({move:e}){return e?n(c,{sheet:e.sheet,name:l}):null}function E({move:e,className:t,children:o}){return e?.zoom?n("div",{className:`${t} ${a}`,children:o}):n(s,{children:o})}export{x as PictureHoverMoveSheet,E as PictureHoverZoom,P as pictureHoverMoveOf};
1
+ import{jsx as n,Fragment as s}from"react/jsx-runtime";import{boxDarkenStyle as l}from"../../format/lib/content/box-background.js";import{PICTURE_FRAME_CLASS as m,PICTURE_MOVE_SHEET as a,PICTURE_ZOOM_CLASS as u,PICTURE_ZOOM_VAR as c,resolvePictureMove as _}from"../../format/lib/content/image-treatment.js";import h from"./PhotoHoverSheet.js";function v(e,t){const o=_(e);if(!o)return null;const r=e?.zoom??null;return{className:o.className??"",style:{...o.style??{},...r?{[c]:r}:{}},...o.sheet?{sheet:o.sheet}:{},zoom:r,washHover:e?.darken?l(e.darken,t):null}}const M={className:m,style:{},zoom:null,washHover:null};function R({move:e}){return e?n(h,{sheet:e.sheet,name:a}):null}function S({move:e,className:t,children:o}){return e?.zoom?n("div",{className:`${t} ${u}`,children:o}):n(s,{children:o})}export{M as PICTURE_FRAME_ONLY,R as PictureHoverMoveSheet,S as PictureHoverZoom,v as pictureHoverMoveOf};
@@ -2,6 +2,7 @@ import { type ReactNode } from "react";
2
2
  import { type CardGap, type CardShadow, type HoverEffect, type HeadingCompression, type ResolvedHeadingTypography, type SizesValue, type ThemeMode, type ThemeValue } from "../../format/lib/theme.js";
3
3
  import { type FontsValue } from "../../format/lib/fonts.js";
4
4
  import type { PreviewHeaderSettings } from "../../format/lib/preview-header-settings.js";
5
+ import type { SiteLengthUnits } from "../../format/lib/content/css-length.js";
5
6
  import type { ResolvedWordStyle, WordStyleName } from "../../format/lib/word-styles.js";
6
7
  export type { PreviewHeaderSettings };
7
8
  type Ctx = {
@@ -46,6 +47,7 @@ type Ctx = {
46
47
  siteGutterPhone: number | null;
47
48
  blockGap: number | null;
48
49
  blockGapPhone: number | null;
50
+ siteLengthUnits: SiteLengthUnits;
49
51
  setSiteGutter: (v: number | null) => void;
50
52
  setSiteGutterPhone: (v: number | null) => void;
51
53
  setBlockGap: (v: number | null) => void;
@@ -63,7 +65,7 @@ type Ctx = {
63
65
  themeFromDocument: boolean;
64
66
  };
65
67
  export declare const PreviewHeaderContext: import("react").Context<Ctx>;
66
- export declare function PreviewHeaderProvider({ children, websiteName, templateChrome, templateName, chromePlaceholder, themeMode, onThemeModeChange, themeSwitchShown, onThemeSwitchShownChange, theme, themeRow, onThemeChange, fonts, onFontsChange, sizes, onSizesChange, cornerRadiusPx, onCornerRadiusPxChange, cardShadow, onCardShadowChange, shadowColor, onShadowColorChange, cardGap, onCardGapChange, hoverEffect, onHoverEffectChange, headingCompression, onHeadingCompressionChange, siteWidth, onSiteWidthChange, siteGutter, siteGutterPhone, blockGap, blockGapPhone, onSiteGutterChange, onSiteGutterPhoneChange, onBlockGapChange, onBlockGapPhoneChange, headingTypography, onHeadingTypographyChange, textStyles, onTextStylesChange, wordStyles, heroBackgroundFollowsWidth, onHeroBackgroundFollowsWidthChange, sectionBackgroundWidth, onSectionBackgroundWidthChange, sectionContentWidth, onSectionContentWidthChange, photographyGrayscale, onPhotographyGrayscaleChange, shareButtonOnPosts, onShareButtonOnPostsChange, themeFromDocument, }: {
68
+ export declare function PreviewHeaderProvider({ children, websiteName, templateChrome, templateName, chromePlaceholder, themeMode, onThemeModeChange, themeSwitchShown, onThemeSwitchShownChange, theme, themeRow, onThemeChange, fonts, onFontsChange, sizes, onSizesChange, cornerRadiusPx, onCornerRadiusPxChange, cardShadow, onCardShadowChange, shadowColor, onShadowColorChange, cardGap, onCardGapChange, hoverEffect, onHoverEffectChange, headingCompression, onHeadingCompressionChange, siteWidth, onSiteWidthChange, siteGutter, siteGutterPhone, blockGap, blockGapPhone, siteLengthUnits, onSiteGutterChange, onSiteGutterPhoneChange, onBlockGapChange, onBlockGapPhoneChange, headingTypography, onHeadingTypographyChange, textStyles, onTextStylesChange, wordStyles, heroBackgroundFollowsWidth, onHeroBackgroundFollowsWidthChange, sectionBackgroundWidth, onSectionBackgroundWidthChange, sectionContentWidth, onSectionContentWidthChange, photographyGrayscale, onPhotographyGrayscaleChange, shareButtonOnPosts, onShareButtonOnPostsChange, themeFromDocument, }: {
67
69
  children: ReactNode;
68
70
  websiteName?: string | null;
69
71
  templateChrome?: boolean;
@@ -96,6 +98,7 @@ export declare function PreviewHeaderProvider({ children, websiteName, templateC
96
98
  siteGutter?: number | null;
97
99
  blockGap?: number | null;
98
100
  blockGapPhone?: number | null;
101
+ siteLengthUnits?: SiteLengthUnits;
99
102
  onSiteGutterChange?: (v: number | null) => void;
100
103
  siteGutterPhone?: number | null;
101
104
  onSiteGutterPhoneChange?: (v: number | null) => void;
@@ -1 +1 @@
1
- "use client";import{jsx as B}from"react/jsx-runtime";import{createContext as zt,useCallback as e,useContext as Vt,useMemo as Zt,useState as qt}from"react";import{EditorSiteLogoContext as Jt}from"./SiteLogoContext.js";import{IDENTITY_CARD_GAP as O,DEFAULT_HEADING_COMPRESSION as M,DEFAULT_HEADING_TYPOGRAPHY as g,DEFAULT_SIZES as N,DEFAULT_SWITCH_SHOWN as Y,DEFAULT_THEME_MODE as b,DEFAULT_THEME_VALUE as j}from"../../format/lib/theme.js";import{DEFAULT_FONTS as z}from"../../format/lib/fonts.js";const V=zt({settings:null,setSettings:()=>{},primeSettings:()=>{},websiteName:null,templateChrome:!1,templateName:null,chromePlaceholder:!1,themeMode:b,setThemeMode:()=>{},themeSwitchShown:Y,setThemeSwitchShown:()=>{},theme:j,themeRow:"none",setTheme:()=>{},fonts:z,setFonts:()=>{},sizes:N,setSizes:()=>{},cornerRadiusPx:null,setCornerRadiusPx:()=>{},cardShadow:null,setCardShadow:()=>{},shadowColor:null,setShadowColor:()=>{},cardGap:O,setCardGap:()=>{},hoverEffect:null,setHoverEffect:()=>{},headingCompression:M,setHeadingCompression:()=>{},siteWidth:null,setSiteWidth:()=>{},siteGutter:null,siteGutterPhone:null,blockGap:null,blockGapPhone:null,setSiteGutter:()=>{},setSiteGutterPhone:()=>{},setBlockGap:()=>{},setBlockGapPhone:()=>{},headingTypography:g,setHeadingTypography:()=>{},textStyles:null,setTextStyles:()=>{},wordStyles:null,heroBackgroundFollowsWidth:null,setHeroBackgroundFollowsWidth:()=>{},sectionBackgroundWidth:null,setSectionBackgroundWidth:()=>{},sectionContentWidth:null,setSectionContentWidth:()=>{},photographyGrayscale:null,setPhotographyGrayscale:()=>{},shareButtonOnPosts:null,setShareButtonOnPosts:()=>{},themeFromDocument:!1});function ee({children:o,websiteName:s=null,templateChrome:l=!1,templateName:r=null,chromePlaceholder:u=!1,themeMode:Z=b,onThemeModeChange:i,themeSwitchShown:q=Y,onThemeSwitchShownChange:c,theme:J=j,themeRow:K="none",onThemeChange:d,fonts:Q=z,onFontsChange:S,sizes:X=N,onSizesChange:a,cornerRadiusPx:$=null,onCornerRadiusPxChange:p,cardShadow:C=null,onCardShadowChange:m,shadowColor:tt=null,onShadowColorChange:h,cardGap:et=O,onCardGapChange:f,hoverEffect:st=null,onHoverEffectChange:E,headingCompression:ot=M,onHeadingCompressionChange:T,siteWidth:lt=null,onSiteWidthChange:P,siteGutter:nt=null,siteGutterPhone:rt=null,blockGap:ut=null,blockGapPhone:it=null,onSiteGutterChange:x,onSiteGutterPhoneChange:w,onBlockGapChange:D,onBlockGapPhoneChange:F,headingTypography:ct=g,onHeadingTypographyChange:G,textStyles:dt=null,onTextStylesChange:_,wordStyles:St=null,heroBackgroundFollowsWidth:at=null,onHeroBackgroundFollowsWidthChange:k,sectionBackgroundWidth:pt=null,onSectionBackgroundWidthChange:H,sectionContentWidth:mt=null,onSectionContentWidthChange:A,photographyGrayscale:ht=null,onPhotographyGrayscaleChange:v,shareButtonOnPosts:ft=null,onShareButtonOnPostsChange:W,themeFromDocument:Et=!1}){const[n,y]=qt(null),Tt=e(t=>y(jt=>jt??t),[]),Pt=e(t=>i?.(t),[i]),xt=e(t=>c?.(t),[c]),wt=e(t=>d?.(t),[d]),Dt=e(t=>S?.(t),[S]),Ft=e(t=>a?.(t),[a]),Gt=e(t=>P?.(t),[P]),_t=e(t=>x?.(t),[x]),kt=e(t=>w?.(t),[w]),Ht=e(t=>D?.(t),[D]),At=e(t=>F?.(t),[F]),vt=e(t=>k?.(t),[k]),Wt=e(t=>H?.(t),[H]),yt=e(t=>A?.(t),[A]),It=e(t=>v?.(t),[v]),Lt=e(t=>W?.(t),[W]),Ut=e(t=>p?.(t),[p]),Rt=e(t=>m?.(t),[m]),Bt=e(t=>h?.(t),[h]),Ot=e(t=>f?.(t),[f]),Mt=e(t=>E?.(t),[E]),gt=e(t=>T?.(t),[T]),Nt=e(t=>G?.(t),[G]),Yt=e(t=>_?.(t),[_]),I=n?.logoUrl,L=n?.logoReversed,U=n?.logoInkIsDark,R=n!==null,bt=Zt(()=>({logo:R?{logoUrl:I,logoReversed:L,logoInkIsDark:U}:null,placeholder:l||u,wordmark:l?r:s}),[R,I,L,U,l,u,r,s]);return B(Jt.Provider,{value:bt,children:B(V.Provider,{value:{settings:n,setSettings:y,primeSettings:Tt,websiteName:s,templateChrome:l,templateName:r,chromePlaceholder:u,themeMode:Z,setThemeMode:Pt,themeSwitchShown:q,setThemeSwitchShown:xt,theme:J,themeRow:K,setTheme:wt,fonts:Q,setFonts:Dt,sizes:X,setSizes:Ft,cornerRadiusPx:$,setCornerRadiusPx:Ut,cardShadow:C,setCardShadow:Rt,shadowColor:tt,setShadowColor:Bt,cardGap:et,setCardGap:Ot,hoverEffect:st,setHoverEffect:Mt,headingCompression:ot,setHeadingCompression:gt,siteWidth:lt,setSiteWidth:Gt,siteGutter:nt,siteGutterPhone:rt,blockGap:ut,blockGapPhone:it,setSiteGutter:_t,setSiteGutterPhone:kt,setBlockGap:Ht,setBlockGapPhone:At,headingTypography:ct,setHeadingTypography:Nt,textStyles:dt,setTextStyles:Yt,wordStyles:St,heroBackgroundFollowsWidth:at,setHeroBackgroundFollowsWidth:vt,sectionBackgroundWidth:pt,setSectionBackgroundWidth:Wt,sectionContentWidth:mt,setSectionContentWidth:yt,photographyGrayscale:ht,setPhotographyGrayscale:It,shareButtonOnPosts:ft,setShareButtonOnPosts:Lt,themeFromDocument:Et},children:o})})}const Kt=()=>Vt(V);function se(o,s,l){return o?s===l?"read":"loading":"none"}function oe(o,s){return{value:o,readFor:s}}function le(o,s,l){return{value:s,readFor:o.readFor===l?l:null}}function ne(){const{sectionContentWidth:o,themeFromDocument:s}=Kt();return s?null:o}export{V as PreviewHeaderContext,ee as PreviewHeaderProvider,se as siteThemeRow,le as themeEdited,oe as themeSeeded,Kt as usePreviewHeader,ne as useSiteContentWidth};
1
+ "use client";import{jsx as R}from"react/jsx-runtime";import{createContext as Zt,useCallback as e,useContext as qt,useMemo as Jt,useState as Kt}from"react";import{EditorSiteLogoContext as Qt}from"./SiteLogoContext.js";import{IDENTITY_CARD_GAP as B,DEFAULT_HEADING_COMPRESSION as M,DEFAULT_HEADING_TYPOGRAPHY as N,DEFAULT_SIZES as g,DEFAULT_SWITCH_SHOWN as Y,DEFAULT_THEME_MODE as b,DEFAULT_THEME_VALUE as j}from"../../format/lib/theme.js";import{DEFAULT_FONTS as z}from"../../format/lib/fonts.js";const V={},Z=Zt({settings:null,setSettings:()=>{},primeSettings:()=>{},websiteName:null,templateChrome:!1,templateName:null,chromePlaceholder:!1,themeMode:b,setThemeMode:()=>{},themeSwitchShown:Y,setThemeSwitchShown:()=>{},theme:j,themeRow:"none",setTheme:()=>{},fonts:z,setFonts:()=>{},sizes:g,setSizes:()=>{},cornerRadiusPx:null,setCornerRadiusPx:()=>{},cardShadow:null,setCardShadow:()=>{},shadowColor:null,setShadowColor:()=>{},cardGap:B,setCardGap:()=>{},hoverEffect:null,setHoverEffect:()=>{},headingCompression:M,setHeadingCompression:()=>{},siteWidth:null,setSiteWidth:()=>{},siteGutter:null,siteGutterPhone:null,blockGap:null,blockGapPhone:null,siteLengthUnits:V,setSiteGutter:()=>{},setSiteGutterPhone:()=>{},setBlockGap:()=>{},setBlockGapPhone:()=>{},headingTypography:N,setHeadingTypography:()=>{},textStyles:null,setTextStyles:()=>{},wordStyles:null,heroBackgroundFollowsWidth:null,setHeroBackgroundFollowsWidth:()=>{},sectionBackgroundWidth:null,setSectionBackgroundWidth:()=>{},sectionContentWidth:null,setSectionContentWidth:()=>{},photographyGrayscale:null,setPhotographyGrayscale:()=>{},shareButtonOnPosts:null,setShareButtonOnPosts:()=>{},themeFromDocument:!1});function oe({children:o,websiteName:s=null,templateChrome:l=!1,templateName:r=null,chromePlaceholder:u=!1,themeMode:q=b,onThemeModeChange:i,themeSwitchShown:J=Y,onThemeSwitchShownChange:c,theme:K=j,themeRow:Q="none",onThemeChange:d,fonts:X=z,onFontsChange:S,sizes:$=g,onSizesChange:a,cornerRadiusPx:C=null,onCornerRadiusPxChange:p,cardShadow:tt=null,onCardShadowChange:h,shadowColor:et=null,onShadowColorChange:m,cardGap:st=B,onCardGapChange:E,hoverEffect:ot=null,onHoverEffectChange:T,headingCompression:lt=M,onHeadingCompressionChange:f,siteWidth:nt=null,onSiteWidthChange:P,siteGutter:rt=null,siteGutterPhone:ut=null,blockGap:it=null,blockGapPhone:ct=null,siteLengthUnits:dt=V,onSiteGutterChange:_,onSiteGutterPhoneChange:x,onBlockGapChange:G,onBlockGapPhoneChange:w,headingTypography:St=N,onHeadingTypographyChange:D,textStyles:at=null,onTextStylesChange:F,wordStyles:pt=null,heroBackgroundFollowsWidth:ht=null,onHeroBackgroundFollowsWidthChange:H,sectionBackgroundWidth:mt=null,onSectionBackgroundWidthChange:k,sectionContentWidth:Et=null,onSectionContentWidthChange:A,photographyGrayscale:Tt=null,onPhotographyGrayscaleChange:I,shareButtonOnPosts:ft=null,onShareButtonOnPostsChange:v,themeFromDocument:Pt=!1}){const[n,L]=Kt(null),_t=e(t=>L(Vt=>Vt??t),[]),xt=e(t=>i?.(t),[i]),Gt=e(t=>c?.(t),[c]),wt=e(t=>d?.(t),[d]),Dt=e(t=>S?.(t),[S]),Ft=e(t=>a?.(t),[a]),Ht=e(t=>P?.(t),[P]),kt=e(t=>_?.(t),[_]),At=e(t=>x?.(t),[x]),It=e(t=>G?.(t),[G]),vt=e(t=>w?.(t),[w]),Lt=e(t=>H?.(t),[H]),Ut=e(t=>k?.(t),[k]),Wt=e(t=>A?.(t),[A]),yt=e(t=>I?.(t),[I]),Ot=e(t=>v?.(t),[v]),Rt=e(t=>p?.(t),[p]),Bt=e(t=>h?.(t),[h]),Mt=e(t=>m?.(t),[m]),Nt=e(t=>E?.(t),[E]),gt=e(t=>T?.(t),[T]),Yt=e(t=>f?.(t),[f]),bt=e(t=>D?.(t),[D]),jt=e(t=>F?.(t),[F]),U=n?.logoUrl,W=n?.logoReversed,y=n?.logoInkIsDark,O=n!==null,zt=Jt(()=>({logo:O?{logoUrl:U,logoReversed:W,logoInkIsDark:y}:null,placeholder:l||u,wordmark:l?r:s}),[O,U,W,y,l,u,r,s]);return R(Qt.Provider,{value:zt,children:R(Z.Provider,{value:{settings:n,setSettings:L,primeSettings:_t,websiteName:s,templateChrome:l,templateName:r,chromePlaceholder:u,themeMode:q,setThemeMode:xt,themeSwitchShown:J,setThemeSwitchShown:Gt,theme:K,themeRow:Q,setTheme:wt,fonts:X,setFonts:Dt,sizes:$,setSizes:Ft,cornerRadiusPx:C,setCornerRadiusPx:Rt,cardShadow:tt,setCardShadow:Bt,shadowColor:et,setShadowColor:Mt,cardGap:st,setCardGap:Nt,hoverEffect:ot,setHoverEffect:gt,headingCompression:lt,setHeadingCompression:Yt,siteWidth:nt,setSiteWidth:Ht,siteGutter:rt,siteGutterPhone:ut,blockGap:it,blockGapPhone:ct,siteLengthUnits:dt,setSiteGutter:kt,setSiteGutterPhone:At,setBlockGap:It,setBlockGapPhone:vt,headingTypography:St,setHeadingTypography:bt,textStyles:at,setTextStyles:jt,wordStyles:pt,heroBackgroundFollowsWidth:ht,setHeroBackgroundFollowsWidth:Lt,sectionBackgroundWidth:mt,setSectionBackgroundWidth:Ut,sectionContentWidth:Et,setSectionContentWidth:Wt,photographyGrayscale:Tt,setPhotographyGrayscale:yt,shareButtonOnPosts:ft,setShareButtonOnPosts:Ot,themeFromDocument:Pt},children:o})})}const Xt=()=>qt(Z);function le(o,s,l){return o?s===l?"read":"loading":"none"}function ne(o,s){return{value:o,readFor:s}}function re(o,s,l){return{value:s,readFor:o.readFor===l?l:null}}function ue(){const{sectionContentWidth:o,themeFromDocument:s}=Xt();return s?null:o}export{Z as PreviewHeaderContext,oe as PreviewHeaderProvider,le as siteThemeRow,re as themeEdited,ne as themeSeeded,Xt as usePreviewHeader,ue as useSiteContentWidth};
@@ -14,6 +14,12 @@ export type ViewHideTake = {
14
14
  readonly scope: (element: ReactNode) => ReactNode;
15
15
  };
16
16
  export declare const NO_HIDE: ViewHideTake;
17
+ type HeightFillClaim = {
18
+ readonly className: string;
19
+ readonly views: string;
20
+ };
21
+ export declare const HeightFillContext: import("react").Context<HeightFillClaim | null>;
22
+ export declare const heightFillClaim: (className: string, views: string) => HeightFillClaim | null;
17
23
  export declare const viewHideClaim: (className: string, words: string, line?: {
18
24
  readonly sectionClassName?: string;
19
25
  readonly line?: ViewHideLineOf;
@@ -1 +1 @@
1
- "use client";import{createContext as m,createElement as l,useContext as r}from"react";import{InBoxContext as d}from"./InBoxContext.js";const a=m(null),w="data-sf-view-hide",u=e=>l(a.Provider,{value:null},e),N={className:"",attrs:{},scope:u},p=N,E=(e,s,t={})=>e?{className:e,words:s,...t}:null,f=(e,s)=>e.sectionClassName===void 0?{className:e.className,words:e.words}:e.line==="edge"||e.line!=="section"&&s?{className:e.className,words:`${e.words} edge`}:{className:e.sectionClassName,words:e.words};function x(){const e=r(a),s=r(d)!==null;if(e===null)return p;const t=f(e,s);return{className:t.className,attrs:{[w]:t.words},scope:u}}function v(){const e=r(a),s=r(d)!==null;return e===null?"":f(e,s).className}const C=(e,s)=>s?e?`${e} ${s}`:s:e;function V(e){const s=x(),t=e.takes===!1?N:s,o={};let c=!1;for(const[n,i]of Object.entries(e))n==="as"||n==="takes"||n==="children"||(n==="className"?(o.className=C(i,t.className),c=!0):o[n]=i);return!c&&t.className&&(o.className=t.className),t.scope(l(e.as??"div",{...o,...t.attrs},e.children))}export{V as HideTaker,N as NO_HIDE,w as VIEW_HIDE_ATTR,a as ViewHideContext,v as usePeekViewHide,x as useTakeViewHide,E as viewHideClaim,C as withViewHide};
1
+ "use client";import{createContext as u,createElement as l,useContext as r}from"react";import{CellFillContext as w,InBoxContext as d}from"./InBoxContext.js";import{SECTION_HEIGHT_FILL_ATTR as C}from"../../format/lib/content/section-min-height.js";const a=u(null),m="data-sf-view-hide",N=e=>l(a.Provider,{value:null},e),f={className:"",attrs:{},scope:N},v=f,p=u(null),h=(e,s)=>e?{className:e,views:s}:null,H=e=>l(a.Provider,{value:null},l(p.Provider,{value:null},l(w.Provider,{value:!0},e))),_=(e,s,n={})=>e?{className:e,words:s,...n}:null,x=(e,s)=>e.sectionClassName===void 0?{className:e.className,words:e.words}:e.line==="edge"||e.line!=="section"&&s?{className:e.className,words:`${e.words} edge`}:{className:e.sectionClassName,words:e.words};function E(){const e=r(a),s=r(p),n=r(d)!==null;if(e===null&&s===null)return v;const t=e===null?null:x(e,n);return s===null?{className:t.className,attrs:{[m]:t.words},scope:N}:{className:t?`${t.className} ${s.className}`:s.className,attrs:{...t?{[m]:t.words}:{},[C]:s.views},scope:H}}function F(){const e=r(a),s=r(d)!==null;return e===null?"":x(e,s).className}const T=(e,s)=>s?e?`${e} ${s}`:s:e;function P(e){const s=E(),n=e.takes===!1?f:s,t={};let c=!1;for(const[o,i]of Object.entries(e))o==="as"||o==="takes"||o==="children"||(o==="className"?(t.className=T(i,n.className),c=!0):t[o]=i);return!c&&n.className&&(t.className=n.className),n.scope(l(e.as??"div",{...t,...n.attrs},e.children))}export{p as HeightFillContext,P as HideTaker,f as NO_HIDE,m as VIEW_HIDE_ATTR,a as ViewHideContext,h as heightFillClaim,F as usePeekViewHide,E as useTakeViewHide,_ as viewHideClaim,T as withViewHide};
@@ -17,11 +17,17 @@ export type BlockSize = {
17
17
  style: Record<string, string>;
18
18
  attrs: Record<string, string>;
19
19
  };
20
+ export declare const BLOCK_WIDTH_MODE_ATTR: {
21
+ readonly fill: "data-sf-width-fill";
22
+ readonly fixed: "data-sf-width-fixed";
23
+ };
24
+ export declare const BLOCK_MIN_WIDTH_ATTR = "data-sf-min-width";
20
25
  export type BlockSizeLine = {
21
26
  readonly atSectionLine?: boolean;
22
27
  };
23
28
  export declare function blockFillInCellClass(values: BlockSizeValues): string;
24
- export declare function blockSizeOf(values: BlockSizeValues, { atSectionLine }?: BlockSizeLine): BlockSize | null;
29
+ export declare function blockCanvasWidthAttrs(values: BlockSizeValues): Record<string, string>;
30
+ export declare function blockSizeOf(values: BlockSizeValues, { atSectionLine: storedLine }?: BlockSizeLine): BlockSize | null;
25
31
  export declare function blockSetsItsWidth(values: BlockSizeValues): boolean;
26
32
  export declare function blockCanWidenPastCell(values: BlockSizeValues): boolean;
27
33
  export declare function blockSizeValuesOf(props: Readonly<Record<string, unknown>>): BlockSizeValues;
@@ -1 +1 @@
1
- import{BLOCK_FIXED_WIDTH as Y,BLOCK_SIZE_KEYS as R,parseBlockWidthFit as c,phoneKey as A,parseTextFit as g,tabletKey as N,viewKeyAt as O}from"efficient-easel/draw";import{sideLengthAt as U}from"efficient-easel/screen/lib/content/length-units";import{TEXT_FIT_ATTR as m}from"../../../format/lib/fit-words.js";import{cssLengthOf as K}from"../../../format/lib/content/css-length.js";import{tierOfView as I}from"../../../format/lib/content/view-tier.js";const X="sf-block-size",B=["width","minWidth","maxWidth"],D=e=>`${e}Unit`,x=e=>typeof e=="number"&&Number.isFinite(e)&&e>=0?e:void 0,Z={desktop:{fill:"view-wide:w-full view-wide:[.flex-row>&]:grow",fixed:"view-wide:w-[min(var(--sf-bw),100%)] view-wide:basis-auto! view-wide:grow-0! view-wide:shrink-0"},phone:{fill:"max-view-wide:w-full",fixed:"max-view-wide:w-[min(var(--sf-bw-p),100%)] max-view-wide:basis-auto! max-view-wide:grow-0! max-view-wide:shrink-0"}},P={desktop:{fill:"view-desktop:w-full view-desktop:[.flex-row>&]:grow",fixed:"view-desktop:w-[min(var(--sf-bw),100%)] view-desktop:basis-auto! view-desktop:grow-0! view-desktop:shrink-0"},tablet:{fill:"view-wide:max-view-desktop:w-full view-wide:max-view-desktop:[.flex-row>&]:grow",fixed:"view-wide:max-view-desktop:w-[min(var(--sf-bw-t),100%)] view-wide:max-view-desktop:basis-auto! view-wide:max-view-desktop:grow-0! view-wide:max-view-desktop:shrink-0"},phone:{fill:"max-view-wide:w-full",fixed:"max-view-wide:w-[min(var(--sf-bw-p),100%)] max-view-wide:basis-auto! max-view-wide:grow-0! max-view-wide:shrink-0"}},$={desktop:P.desktop,tablet:{fill:"view-tablet:max-view-desktop:w-full view-wide:max-view-desktop:[.flex-row>&]:grow",fixed:"view-tablet:max-view-desktop:w-[min(var(--sf-bw-t),100%)] view-tablet:max-view-desktop:basis-auto! view-tablet:max-view-desktop:grow-0! view-tablet:max-view-desktop:shrink-0"},phone:{fill:"max-view-tablet:w-full",fixed:"max-view-tablet:w-[min(var(--sf-bw-p),100%)] max-view-tablet:basis-auto! max-view-tablet:grow-0! max-view-tablet:shrink-0"}},G={two:{desktop:"view-wide:[.flex-row>*>&]:grow"},three:{desktop:"view-desktop:[.flex-row>*>&]:grow",tablet:"view-wide:max-view-desktop:[.flex-row>*>&]:grow"}},q={desktop:"--sf-bw",tablet:"--sf-bw-t",phone:"--sf-bw-p"},J={minWidth:{desktop:["--sf-bmin","view-wide:min-w-[var(--sf-bmin)]!"],phone:["--sf-bmin-p","max-view-wide:min-w-[var(--sf-bmin-p)]!"]},maxWidth:{desktop:["--sf-bmax","view-wide:max-w-[var(--sf-bmax)]"],phone:["--sf-bmax-p","max-view-wide:max-w-[var(--sf-bmax-p)]"]}},L={minWidth:{desktop:["--sf-bmin","view-desktop:min-w-[var(--sf-bmin)]!"],tablet:["--sf-bmin-t","view-wide:max-view-desktop:min-w-[var(--sf-bmin-t)]!"],phone:["--sf-bmin-p","max-view-wide:min-w-[var(--sf-bmin-p)]!"]},maxWidth:{desktop:["--sf-bmax","view-desktop:max-w-[var(--sf-bmax)]"],tablet:["--sf-bmax-t","view-wide:max-view-desktop:max-w-[var(--sf-bmax-t)]"],phone:["--sf-bmax-p","max-view-wide:max-w-[var(--sf-bmax-p)]"]}},Q={minWidth:{desktop:L.minWidth.desktop,tablet:["--sf-bmin-t","view-tablet:max-view-desktop:min-w-[var(--sf-bmin-t)]!"],phone:["--sf-bmin-p","max-view-tablet:min-w-[var(--sf-bmin-p)]!"]},maxWidth:{desktop:L.maxWidth.desktop,tablet:["--sf-bmax-t","view-tablet:max-view-desktop:max-w-[var(--sf-bmax-t)]"],phone:["--sf-bmax-p","max-view-tablet:max-w-[var(--sf-bmax-p)]"]}},ee=["widthFit",...B],H={desktop:"view-wide:whitespace-nowrap view-wide:[&_*]:whitespace-nowrap!",phone:"max-view-wide:whitespace-nowrap max-view-wide:[&_*]:whitespace-nowrap!"},y={desktop:"view-desktop:whitespace-nowrap view-desktop:[&_*]:whitespace-nowrap!",tablet:"view-wide:max-view-desktop:whitespace-nowrap view-wide:max-view-desktop:[&_*]:whitespace-nowrap!",phone:"max-view-wide:whitespace-nowrap max-view-wide:[&_*]:whitespace-nowrap!"},te={desktop:y.desktop,tablet:"view-tablet:max-view-desktop:whitespace-nowrap view-tablet:max-view-desktop:[&_*]:whitespace-nowrap!",phone:"max-view-tablet:whitespace-nowrap max-view-tablet:[&_*]:whitespace-nowrap!"};function de(e){const n=z(e);return n.sides.filter(o=>n.mode[o]==="fill").map(o=>G[n.three?"three":"two"][o]).filter(Boolean).join(" ")}function z(e){const n=ee.some(t=>{const s=e[t]?.tablet;return t==="widthFit"?c(s)!==void 0:x(s)!==void 0}),o=n?["desktop","tablet","phone"]:["desktop","phone"],a=(t,s)=>{const i=t(s?.desktop),p=n?t(s?.tablet)??i:i;return{desktop:i,tablet:p,phone:t(s?.phone)??p}};return{three:n,sides:o,perSide:a,lengthPerSide:t=>{const s=D(t),i={};for(const f of o)i[O(t,I(f))]=x(e[t]?.[f]),i[O(s,I(f))]=e.units?.[t]?.[f];const p=f=>U(i,{length:t},s,I(f),"length")??void 0;return{desktop:p("desktop"),tablet:p("tablet"),phone:p("phone")}},mode:a(c,e.widthFit)}}function ae(e,{atSectionLine:n=!1}={}){const o=n?$:P,a=n?Q:L,r=n?te:y,t=[],s={},i={},{three:p,sides:f,lengthPerSide:C,mode:M}=z(e),W=C("width");for(const w of f){const d=M[w];!d||d==="fit"||(t.push(p?o[w][d]:Z[w][d]),d==="fixed"&&(s[q[w]]=K(W[w]?.value??Y.fallback,W[w]?.unit)))}for(const w of B.filter(d=>d!=="width")){const d=C(w);for(const h of f){const T=d[h];if(T===void 0)continue;const[j,V]=p?a[w][h]:J[w][h];s[j]=K(T.value,T.unit),t.push(V)}}const l=g(e.textFit?.desktop),b=g(e.textFit?.phone),k=w=>{const d=x(e.minFont?.[w]);return d===void 0?void 0:e.units?.minFont?.[w]==="vw"?`${d}vw`:String(d)},u=k("desktop"),_=k("phone"),E=g(e.textFit?.tablet),v=E!==l||b!==void 0?E:void 0,F=k("tablet"),S=F!==u||_!==void 0?F:void 0;return v?(l==="line"&&t.push(r.desktop),v==="line"&&t.push(r.tablet),(b??v)==="line"&&t.push(r.phone)):(l==="line"&&t.push(H.desktop),(b??l)==="line"&&t.push(H.phone)),l&&(i[m.fit]=l),v&&(i[m.fitTablet]=v),b&&(i[m.fitPhone]=b),u!==void 0&&(i[m.min]=u),S!==void 0&&(i[m.minTablet]=S),_!==void 0&&(i[m.minPhone]=_),!n&&(v||S!==void 0)&&(i[m.edge]=""),t.length===0&&Object.keys(i).length===0?null:{className:[X,...t].join(" "),style:s,attrs:i}}function pe(e){if(x(e.maxWidth?.desktop)!==void 0)return!0;const n=c(e.widthFit?.desktop);return n==="fill"||n==="fixed"}function fe(e){return["desktop","tablet","phone"].some(o=>{const a=c(e.widthFit?.[o]);return a==="fixed"||a==="fill"||x(e.minWidth?.[o])!==void 0})}function me(e){const n={};for(const o of R){const a=e[o],r=e[N(o)],t=e[A(o)];(a!==void 0||r!==void 0||t!==void 0)&&(n[o]={desktop:a,tablet:r,phone:t});const s=D(o),i={desktop:e[s],tablet:e[N(s)],phone:e[A(s)]};(i.desktop!==void 0||i.tablet!==void 0||i.phone!==void 0)&&((n.units??={})[o]=i)}return n}export{B as BLOCK_LENGTH_KEYS,X as BLOCK_SIZE_CLASS,m as TEXT_FIT_ATTR,fe as blockCanWidenPastCell,de as blockFillInCellClass,D as blockLengthUnitKey,pe as blockSetsItsWidth,ae as blockSizeOf,me as blockSizeValuesOf};
1
+ import{BLOCK_FIXED_WIDTH as ie,BLOCK_SIZE_KEYS as oe,parseBlockWidthFit as T,phoneKey as y,parseTextFit as L,tabletKey as j,viewKeyAt as z}from"efficient-easel/draw";import{sideLengthAt as ne}from"efficient-easel/screen/lib/content/length-units";import{TEXT_FIT_ATTR as m}from"../../../format/lib/fit-words.js";import{cssLengthOf as V}from"../../../format/lib/content/css-length.js";import{TIER_OF_VIEW as Y,tierOfView as A}from"../../../format/lib/content/view-tier.js";const se="sf-block-size",U=["width","minWidth","maxWidth"],X=e=>`${e}Unit`,l=e=>typeof e=="number"&&Number.isFinite(e)&&e>=0?e:void 0,we={desktop:{fill:"view-wide:w-full view-wide:[.flex-row>&]:grow",fixed:"view-wide:w-[min(var(--sf-bw),100%)] view-wide:basis-auto! view-wide:grow-0! view-wide:shrink-0"},phone:{fill:"max-view-wide:w-full",fixed:"max-view-wide:w-[min(var(--sf-bw-p),100%)] max-view-wide:basis-auto! max-view-wide:grow-0! max-view-wide:shrink-0"}},Z={desktop:{fill:"view-desktop:w-full view-desktop:[.flex-row>&]:grow",fixed:"view-desktop:w-[min(var(--sf-bw),100%)] view-desktop:basis-auto! view-desktop:grow-0! view-desktop:shrink-0"},tablet:{fill:"view-wide:max-view-desktop:w-full view-wide:max-view-desktop:[.flex-row>&]:grow",fixed:"view-wide:max-view-desktop:w-[min(var(--sf-bw-t),100%)] view-wide:max-view-desktop:basis-auto! view-wide:max-view-desktop:grow-0! view-wide:max-view-desktop:shrink-0"},phone:{fill:"max-view-wide:w-full",fixed:"max-view-wide:w-[min(var(--sf-bw-p),100%)] max-view-wide:basis-auto! max-view-wide:grow-0! max-view-wide:shrink-0"}},de={desktop:Z.desktop,tablet:{fill:"view-tablet:max-view-desktop:w-full view-wide:max-view-desktop:[.flex-row>&]:grow",fixed:"view-tablet:max-view-desktop:w-[min(var(--sf-bw-t),100%)] view-tablet:max-view-desktop:basis-auto! view-tablet:max-view-desktop:grow-0! view-tablet:max-view-desktop:shrink-0"},phone:{fill:"max-view-tablet:w-full",fixed:"max-view-tablet:w-[min(var(--sf-bw-p),100%)] max-view-tablet:basis-auto! max-view-tablet:grow-0! max-view-tablet:shrink-0"}},ae={two:{desktop:"view-wide:[.flex-row>*>&]:grow"},three:{desktop:"view-desktop:[.flex-row>*>&]:grow",tablet:"view-wide:max-view-desktop:[.flex-row>*>&]:grow"}},pe={desktop:"--sf-bw",tablet:"--sf-bw-t",phone:"--sf-bw-p"},fe={fill:"data-sf-width-fill",fixed:"data-sf-width-fixed"},me="data-sf-min-width",$={two:{desktop:"wide",phone:Y.phone},three:Y},le={minWidth:{desktop:["--sf-bmin","view-wide:min-w-[var(--sf-bmin)]!"],phone:["--sf-bmin-p","max-view-wide:min-w-[var(--sf-bmin-p)]!"]},maxWidth:{desktop:["--sf-bmax","view-wide:max-w-[var(--sf-bmax)]"],phone:["--sf-bmax-p","max-view-wide:max-w-[var(--sf-bmax-p)]"]}},E={minWidth:{desktop:["--sf-bmin","view-desktop:min-w-[var(--sf-bmin)]!"],tablet:["--sf-bmin-t","view-wide:max-view-desktop:min-w-[var(--sf-bmin-t)]!"],phone:["--sf-bmin-p","max-view-wide:min-w-[var(--sf-bmin-p)]!"]},maxWidth:{desktop:["--sf-bmax","view-desktop:max-w-[var(--sf-bmax)]"],tablet:["--sf-bmax-t","view-wide:max-view-desktop:max-w-[var(--sf-bmax-t)]"],phone:["--sf-bmax-p","max-view-wide:max-w-[var(--sf-bmax-p)]"]}},re={minWidth:{desktop:E.minWidth.desktop,tablet:["--sf-bmin-t","view-tablet:max-view-desktop:min-w-[var(--sf-bmin-t)]!"],phone:["--sf-bmin-p","max-view-tablet:min-w-[var(--sf-bmin-p)]!"]},maxWidth:{desktop:E.maxWidth.desktop,tablet:["--sf-bmax-t","view-tablet:max-view-desktop:max-w-[var(--sf-bmax-t)]"],phone:["--sf-bmax-p","max-view-tablet:max-w-[var(--sf-bmax-p)]"]}},xe=["widthFit",...U],G={desktop:"view-wide:whitespace-nowrap view-wide:[&_*]:whitespace-nowrap!",phone:"max-view-wide:whitespace-nowrap max-view-wide:[&_*]:whitespace-nowrap!"},O={desktop:"view-desktop:whitespace-nowrap view-desktop:[&_*]:whitespace-nowrap!",tablet:"view-wide:max-view-desktop:whitespace-nowrap view-wide:max-view-desktop:[&_*]:whitespace-nowrap!",phone:"max-view-wide:whitespace-nowrap max-view-wide:[&_*]:whitespace-nowrap!"},he={desktop:O.desktop,tablet:"view-tablet:max-view-desktop:whitespace-nowrap view-tablet:max-view-desktop:[&_*]:whitespace-nowrap!",phone:"max-view-tablet:whitespace-nowrap max-view-tablet:[&_*]:whitespace-nowrap!"},q={desktop:"view-wide:min-w-0 view-wide:[&_*]:overflow-hidden view-wide:[&_*]:text-ellipsis",phone:"max-view-wide:min-w-0 max-view-wide:[&_*]:overflow-hidden max-view-wide:[&_*]:text-ellipsis"},ce={desktop:"view-desktop:min-w-0 view-desktop:[&_*]:overflow-hidden view-desktop:[&_*]:text-ellipsis",tablet:"view-wide:max-view-desktop:min-w-0 view-wide:max-view-desktop:[&_*]:overflow-hidden view-wide:max-view-desktop:[&_*]:text-ellipsis",phone:q.phone},J={desktop:"view-wide:max-w-full",phone:"max-view-wide:max-w-full"},Q={desktop:"view-desktop:max-w-full",tablet:"view-wide:max-view-desktop:max-w-full",phone:J.phone};function Se(e){const d=N(e);return d.sides.filter(s=>d.mode[s]==="fill").map(s=>ae[d.three?"three":"two"][s]).filter(Boolean).join(" ")}function Te(e){const{three:d,sides:s,mode:p,lengthPerSide:r}=N(e),w=t=>d?$.three[t]:$.two[t],o={fill:[],fixed:[],min:[]},i=r("minWidth");for(const t of s){const x=p[t];(x==="fill"||x==="fixed")&&o[x].push(w(t)),i[t]!==void 0&&o.min.push(w(t))}const f={};for(const t of["fill","fixed"])o[t].length&&(f[fe[t]]=o[t].join(" "));return o.min.length&&(f[me]=o.min.join(" ")),f}function N(e){const d=xe.some(w=>{const o=e[w]?.tablet;return w==="widthFit"?T(o)!==void 0:l(o)!==void 0}),s=d?["desktop","tablet","phone"]:["desktop","phone"],p=(w,o)=>{const i=w(o?.desktop),f=d?w(o?.tablet)??i:i;return{desktop:i,tablet:f,phone:w(o?.phone)??f}};return{three:d,sides:s,perSide:p,lengthPerSide:w=>{const o=X(w),i={};for(const t of s)i[z(w,A(t))]=l(e[w]?.[t]),i[z(o,A(t))]=e.units?.[w]?.[t];const f=t=>ne(i,{length:w},o,A(t),"length")??void 0;return{desktop:f("desktop"),tablet:f("tablet"),phone:f("phone")}},mode:p(T,e.widthFit)}}function Le(e,{atSectionLine:d=!1}={}){const s=["desktop","tablet","phone"].some(n=>L(e.textFit?.[n])==="ellipsis"),p=d&&!s,r=p?de:Z,w=p?re:E,o=p?he:O,i=[],f={},t={},{three:x,sides:F,lengthPerSide:D,mode:ee}=N(e),K=D("width");for(const n of F){const a=ee[n];!a||a==="fit"||(i.push(x?r[n][a]:we[n][a]),a==="fixed"&&(f[pe[n]]=V(K[n]?.value??ie.fallback,K[n]?.unit)))}for(const n of U.filter(a=>a!=="width")){const a=D(n);for(const h of F){const b=a[h];if(b===void 0)continue;const[k,u]=x?w[n][h]:le[n][h];f[k]=V(b.value,b.unit),i.push(u)}}const c=L(e.textFit?.desktop),_=L(e.textFit?.phone),I=n=>{const a=l(e.minFont?.[n]);return a===void 0?void 0:e.units?.minFont?.[n]==="vw"?`${a}vw`:String(a)},W=I("desktop"),C=I("phone"),B=L(e.textFit?.tablet),v=B!==c||_!==void 0?B:void 0,H=I("tablet"),g=H!==W||C!==void 0?H:void 0,P=l(e.maxWidth?.desktop),R=l(e.maxWidth?.tablet)??P,M={desktop:P!==void 0,tablet:R!==void 0,phone:(l(e.maxWidth?.phone)??R)!==void 0},S=(n,a,h)=>{if(a!=="line"&&a!=="ellipsis")return;const b=n==="tablet"?void 0:n,k=(u,te)=>h||!b?u[n]:te[b];if(a==="line"){i.push(k(o,G));return}if(i.push(k(O,G)),i.push(k(ce,q)),x&&!h&&n==="desktop")for(const u of["desktop","tablet"])M[u]||i.push(Q[u]);else M[n]||i.push(k(Q,J))};return v?(S("desktop",c,!0),S("tablet",v,!0),S("phone",_??v,!0)):(S("desktop",c,!1),S("phone",_??c,!1)),c&&(t[m.fit]=c),v&&(t[m.fitTablet]=v),_&&(t[m.fitPhone]=_),W!==void 0&&(t[m.min]=W),g!==void 0&&(t[m.minTablet]=g),C!==void 0&&(t[m.minPhone]=C),!p&&(v||g!==void 0)&&(t[m.edge]=""),i.length===0&&Object.keys(t).length===0?null:{className:[se,...i].join(" "),style:f,attrs:t}}function Ie(e){if(l(e.maxWidth?.desktop)!==void 0)return!0;const d=T(e.widthFit?.desktop);return d==="fill"||d==="fixed"}function We(e){return["desktop","tablet","phone"].some(s=>{const p=T(e.widthFit?.[s]);return p==="fixed"||p==="fill"||l(e.minWidth?.[s])!==void 0})}function Ce(e){const d={};for(const s of oe){const p=e[s],r=e[j(s)],w=e[y(s)];(p!==void 0||r!==void 0||w!==void 0)&&(d[s]={desktop:p,tablet:r,phone:w});const o=X(s),i={desktop:e[o],tablet:e[j(o)],phone:e[y(o)]};(i.desktop!==void 0||i.tablet!==void 0||i.phone!==void 0)&&((d.units??={})[s]=i)}return d}export{U as BLOCK_LENGTH_KEYS,me as BLOCK_MIN_WIDTH_ATTR,se as BLOCK_SIZE_CLASS,fe as BLOCK_WIDTH_MODE_ATTR,m as TEXT_FIT_ATTR,We as blockCanWidenPastCell,Te as blockCanvasWidthAttrs,Se as blockFillInCellClass,X as blockLengthUnitKey,Ie as blockSetsItsWidth,Le as blockSizeOf,Ce as blockSizeValuesOf};
@@ -1 +1 @@
1
- import{jsx as n}from"react/jsx-runtime";import{sectionBorderUnitsOf as f}from"../../../../../../format/lib/content/borders.js";import{BOX_ANGLE_PROP as g}from"../../../../../../format/lib/content/box-angle.js";import{BOX_SIDE_SPACE_PROP as b}from"../../../../../../format/lib/content/box-side-space.js";import{phoneKey as a,tabletKey as t}from"efficient-easel/draw";import{BOX_SWATCH_PROP as S,boxCardProps as r,boxPaintOf as u}from"../../../../../../format/lib/content/box-background.js";import{BOX_ROW_IMAGE_PROP as w}from"../../../../../../format/lib/content/box-card-rule.js";import{sharedColumnsDrawn as P,sharedRowsDrawn as O}from"../../../../content/box-shared-columns.js";import{CountRowsContext as k,NO_COUNTS as y}from"../../../../../components/CountRowsContext.js";import{RowEmptyGate as C}from"../../../../../components/CardRowContext.js";import{BOX_HIDE_WHEN_ROW_EMPTY as T,CARD_ROW_LINK_PROP as _,namedRowField as d}from"../../../../../../format/lib/content/card-template.js";import R from"../../../../../components/Flex.js";import{loopDelayOf as x,loopSecondsOf as D,parseLoop as B,parseLoopDirection as j}from"../../../../../../format/lib/animation/index.js";import{COUNTS_SOURCE as E,declaredBlockSource as H,servedRows as I}from"../../../../../../format/lib/content/block-sources.js";import{padValuesOf as N}from"../../../../content/section-padding.js";import{sectionFillsHeight as v}from"../../../../../../format/lib/content/section-min-height.js";import{boxHighlightStyle as A,pictureHoverOf as F}from"../../../../../../format/lib/animation/hover.js";import{slotCountOf as L}from"../../../slot-counts.js";import{FlexMeta as U}from"../../../../../../format/lib/document/blocks/general/Flex/meta.js";const oe={...U,render:e=>{const o=!!e.editor?.isEditing,c=n(R,{direction:e.direction,label:e.label,tabShape:e.tabShape,gap:e.gap,gapPhone:e[a("gap")],gapTablet:e[t("gap")],justify:e.justify,justifyTablet:e[t("justify")],justifyPhone:e[a("justify")],align:e.align,alignTablet:e[t("align")],alignPhone:e[a("align")],wrap:e.wrap,wrapTablet:e[t("wrap")],share:e.share,sharePhone:e[a("share")],shareTablet:e[t("share")],wrapPhone:e[a("wrap")],orderPhone:e[a("order")],phoneRow:e.phoneRow,columns:e.columns,columnsTablet:e[t("columns")],separator:e.separator,stackBelow:e.stackBelow,blockSpacing:e.blockSpacing,blockSpacingTablet:e[t("blockSpacing")],blockSpacingPhone:e[a("blockSpacing")],bgImage:e.bgImage,bgImagePhone:e.bgImagePhone,rowImage:d(e,w),pictureHover:F(e),darken:e.darken,darkenStyle:e.darkenStyle,darkenTablet:e[t("darken")],darkenPhone:e[a("darken")],darkenStyleTablet:e[t("darkenStyle")],darkenStylePhone:e[a("darkenStyle")],placement:e.placement,padV2:e.padV2===!0,border:e.sectionBorder,borderTablet:e.sectionBorderTablet,borderPhone:e.sectionBorderPhone,borderUnits:f(e),pad:N(e),contained:e.contained,fillHeight:v(e),shadow:e.shadow,shadowTablet:e[t("shadow")],shadowPhone:e[a("shadow")],loop:B(e.loop),scrollDirection:j(e.scrollDirection),loopSeconds:D({loopDuration:e.loopDuration}),loopDelay:x({loopDelay:e.loopDelay}),editing:o,fillColor:e.fillColor,fillColorTablet:e[t("fillColor")],fillColorPhone:e[a("fillColor")],swatch:e[S],line:e.line,upcoming:e.upcoming,link:e.link,rowLink:d(e,_),highlight:A(e,m=>u(m)??""),boxShape:e.boxShape,boxShapePhone:e[a("boxShape")],boxShapeTablet:e[t("boxShape")],angle:e[g],jumpHighlight:e.jumpHighlight,anchor:e.anchor,sharedSides:P(r(e,!1)),sharedRows:O(r(e,!1)),boxId:typeof e.id=="string"?e.id:void 0,slotCount:L(e),mirrorCards:e.mirrorCards,content:e.content,rowTitle:e.rowTitle,startsOpen:e.startsOpen,rowStyle:e.rowStyle,sideSpace:e[b]}),l=H(e),h=l?l===E?I(e):y:null,i=n(k.Provider,{value:h,children:c});return e[T]===void 0?i:n(C,{props:e,editing:o,children:i})}};export{oe as FlexRender};
1
+ import{jsx as n}from"react/jsx-runtime";import{sectionBorderUnitsOf as f}from"../../../../../../format/lib/content/borders.js";import{BOX_ANGLE_PROP as g}from"../../../../../../format/lib/content/box-angle.js";import{BOX_SIDE_SPACE_PROP as b}from"../../../../../../format/lib/content/box-side-space.js";import{phoneKey as a,tabletKey as t}from"efficient-easel/draw";import{BOX_SWATCH_PROP as S,boxCardProps as r,boxPaintOf as u}from"../../../../../../format/lib/content/box-background.js";import{BOX_ROW_IMAGE_PROP as w}from"../../../../../../format/lib/content/box-card-rule.js";import{sharedColumnsDrawn as P,sharedRowsDrawn as O}from"../../../../content/box-shared-columns.js";import{CountRowsContext as k,NO_COUNTS as y}from"../../../../../components/CountRowsContext.js";import{RowEmptyGate as _}from"../../../../../components/CardRowContext.js";import{BOX_HIDE_WHEN_ROW_EMPTY as C,CARD_ROW_LINK_PROP as T,namedRowField as d}from"../../../../../../format/lib/content/card-template.js";import x from"../../../../../components/Flex.js";import{loopDelayOf as R,loopSecondsOf as B,parseLoop as D,parseLoopDirection as E}from"../../../../../../format/lib/animation/index.js";import{COUNTS_SOURCE as H,declaredBlockSource as j,servedRows as I}from"../../../../../../format/lib/content/block-sources.js";import{padValuesOf as v}from"../../../../content/section-padding.js";import{sectionFillsHeight as F}from"../../../../../../format/lib/content/section-min-height.js";import{BOX_SHOW_KEY as N,boxHighlightStyle as W,pictureHoverOf as X}from"../../../../../../format/lib/animation/hover.js";import{slotCountOf as A}from"../../../slot-counts.js";import{FlexMeta as L}from"../../../../../../format/lib/document/blocks/general/Flex/meta.js";const le={...L,render:e=>{const o=!!e.editor?.isEditing,h=n(x,{direction:e.direction,label:e.label,tabShape:e.tabShape,gap:e.gap,gapPhone:e[a("gap")],gapTablet:e[t("gap")],justify:e.justify,justifyTablet:e[t("justify")],justifyPhone:e[a("justify")],align:e.align,alignTablet:e[t("align")],alignPhone:e[a("align")],wrap:e.wrap,wrapTablet:e[t("wrap")],share:e.share,sharePhone:e[a("share")],shareTablet:e[t("share")],wrapPhone:e[a("wrap")],orderPhone:e[a("order")],phoneRow:e.phoneRow,columns:e.columns,columnsTablet:e[t("columns")],separator:e.separator,stackBelow:e.stackBelow,blockSpacing:e.blockSpacing,blockSpacingTablet:e[t("blockSpacing")],blockSpacingPhone:e[a("blockSpacing")],bgImage:e.bgImage,bgImagePhone:e.bgImagePhone,rowImage:d(e,w),pictureHover:X(e,"Flex"),hoverShow:e[N],darken:e.darken,darkenStyle:e.darkenStyle,darkenTablet:e[t("darken")],darkenPhone:e[a("darken")],darkenStyleTablet:e[t("darkenStyle")],darkenStylePhone:e[a("darkenStyle")],placement:e.placement,padV2:e.padV2===!0,border:e.sectionBorder,borderTablet:e.sectionBorderTablet,borderPhone:e.sectionBorderPhone,borderUnits:f(e),pad:v(e),contained:e.contained,fillHeight:F(e),shadow:e.shadow,shadowTablet:e[t("shadow")],shadowPhone:e[a("shadow")],loop:D(e.loop),scrollDirection:E(e.scrollDirection),loopSeconds:B({loopDuration:e.loopDuration}),loopDelay:R({loopDelay:e.loopDelay}),editing:o,fillColor:e.fillColor,fillColorTablet:e[t("fillColor")],fillColorPhone:e[a("fillColor")],swatch:e[S],line:e.line,upcoming:e.upcoming,link:e.link,rowLink:d(e,T),highlight:W(e,m=>u(m)??""),boxShape:e.boxShape,boxShapePhone:e[a("boxShape")],boxShapeTablet:e[t("boxShape")],angle:e[g],jumpHighlight:e.jumpHighlight,anchor:e.anchor,sharedSides:P(r(e,!1)),sharedRows:O(r(e,!1)),boxId:typeof e.id=="string"?e.id:void 0,slotCount:A(e),mirrorCards:e.mirrorCards,content:e.content,rowTitle:e.rowTitle,startsOpen:e.startsOpen,rowStyle:e.rowStyle,sideSpace:e[b]}),l=j(e),c=l?l===H?I(e):y:null,i=n(k.Provider,{value:c,children:h});return e[C]===void 0?i:n(_,{props:e,editing:o,children:i})}};export{le as FlexRender};