efficient-web-builder 61.0.0 → 63.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/dist/editor/components/ShadowColourField.js +1 -1
  3. package/dist/editor/components/StorefrontEditor.js +1 -1
  4. package/dist/editor/components/WebsiteSettingsPanel.js +1 -1
  5. package/dist/editor/lib/animation/hover-fields.js +1 -1
  6. package/dist/editor/lib/document/page-root.js +2 -2
  7. package/dist/format/lib/animation/hover.d.ts +11 -6
  8. package/dist/format/lib/animation/hover.js +1 -1
  9. package/dist/format/lib/content/card-state.d.ts +16 -1
  10. package/dist/format/lib/content/card-state.js +1 -1
  11. package/dist/format/lib/content/card-template.d.ts +10 -2
  12. package/dist/format/lib/content/card-template.js +1 -1
  13. package/dist/format/lib/content/hover-media.d.ts +7 -0
  14. package/dist/format/lib/content/hover-media.js +1 -1
  15. package/dist/format/lib/content/image-treatment.d.ts +6 -3
  16. package/dist/format/lib/content/image-treatment.js +1 -1
  17. package/dist/format/lib/content/ink.d.ts +1 -1
  18. package/dist/format/lib/content/ink.js +1 -1
  19. package/dist/format/lib/content/site-gutter.d.ts +2 -1
  20. package/dist/format/lib/content/site-gutter.js +1 -1
  21. package/dist/format/lib/document/card-template-layers.js +1 -1
  22. package/dist/format/lib/document/easel-row-words.d.ts +7 -0
  23. package/dist/format/lib/document/easel-row-words.js +1 -1
  24. package/dist/format/lib/document/passes/card-template-on-insert.js +1 -1
  25. package/dist/format/lib/editor-words-catalogue.d.ts +2 -0
  26. package/dist/format/lib/editor-words-catalogue.js +2 -2
  27. package/dist/format/lib/editor-words-kept.js +1 -1
  28. package/dist/format/lib/source-rules/no-hard-coded-option-rows.d.ts +30 -0
  29. package/dist/format/lib/source-rules/no-hard-coded-option-rows.js +1 -0
  30. package/dist/format/lib/source-rules/one-next-image-path.d.ts +6 -0
  31. package/dist/format/lib/source-rules/one-next-image-path.js +1 -0
  32. package/dist/format/lib/theme.d.ts +6 -3
  33. package/dist/format/lib/theme.js +4 -4
  34. package/dist/render/components/CardRowContext.d.ts +3 -1
  35. package/dist/render/components/CardRowContext.js +1 -1
  36. package/dist/render/components/Flex.js +1 -1
  37. package/dist/render/components/HeroSection.js +1 -1
  38. package/dist/render/components/ImageBlock.d.ts +9 -3
  39. package/dist/render/components/ImageBlock.js +1 -1
  40. package/dist/render/components/Text.d.ts +2 -1
  41. package/dist/render/components/Text.js +1 -1
  42. package/dist/render/components/ThemeLightInkContext.d.ts +6 -0
  43. package/dist/render/components/ThemeLightInkContext.js +1 -0
  44. package/dist/render/components/goldPhrases.d.ts +2 -1
  45. package/dist/render/components/goldPhrases.js +3 -2
  46. package/dist/render/lib/document/blocks/general/ImageBlock/render.js +1 -1
  47. package/dist/render/lib/document/blocks/general/Text/render.js +1 -1
  48. package/dist/render/lib/document/passes/section-theme.js +1 -1
  49. package/dist/render/lib/document/passes/section-width.js +1 -1
  50. package/dist/render/lib/document/slot-counts.js +1 -1
  51. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,60 @@
1
1
  # Changelog
2
2
 
3
+ ## 63.0.0 - 2026-11-09
4
+
5
+ From main at `beb99f54`: #656, #658, #659, #660. A MAJOR: #656 and #659 have `!`. No export is removed. No stored key or value moves.
6
+
7
+ **BREAKING (#656):** the peer `efficient-easel` moves to `^30.1.0` (was `^30.0.0`): easel 30.0.0 has no media-zones module. `efficient-shell` stays `^12.18.0`. `HOVER_MEDIA_KINDS` now follows easel's zone table: its type widens and its order changes. `HoverMediaKind` and every stored `hoverKind` value stay the same.
8
+
9
+ **BREAKING (#659):** `cardStateAttrs` (`format/lib/content/card-state`) now returns `CardStateAttrs` (the state attribute, a `className`, and on a picked copy a `style` with the picked ink); in 62.0.0 it returned `Record<string, string>`. A host that typed the result as `Record<string, string>` must type it as `CardStateAttrs`, or spread it onto the element. `renderChrome` now draws through `renderPlain`: a chrome value with a newline breaks onto lines (0 live US values have one).
10
+
11
+ **For hosts:**
12
+ - Install efficient-easel 30.1.0 or later with this release.
13
+ - **HOLD (#651, from 62.0.0) stays: the storefront takes this version ONLY in the PR that mounts `ThemeLightInkProvider` in efficient-storefront `app/layout.tsx`.**
14
+ - storefront-blocks: the Contact section can move its reason chips and topic cards onto the card template (`plain: true` fields, #659); the wheels filter rail can use `CardItemAction` `label` and `disabled` (#660) in place of its own aria code.
15
+
16
+ ### Added
17
+
18
+ - **A guard against hard-coded shopper option rows** (#658): the rule `format/lib/source-rules/no-hard-coded-option-rows` and its guard. A list of buttons or choice roles drawn in code fails unless it is in the one exemption list.
19
+ - **`CardItemAction` `label` and `disabled`** (#660), and `CARD_ACTION_OFF_CLASS`. A disabled row is skipped by the keyboard, does nothing on press, and draws no hover frame.
20
+
21
+ ### Changed
22
+
23
+ - **Picked rows show their words at full ink** (#659): a `selected` card-template copy swaps the theme's muted ink for the full text ink (`CARD_STATE_PICKED_INK`). A row field can be `plain` (its words print as typed). One home for plain words: `renderChrome` is `renderPlain`.
24
+ - **Card media kinds read easel's media zone table** (#656): `HOVER_MEDIA_KINDS` and `HOVER_MEDIA_KIND_LABELS` come from `efficient-easel/screen/lib/content/media-zones`.
25
+
26
+ ## 62.0.0 - 2026-11-09
27
+
28
+ From main at `4ce0e69f`: #650, #651, #652, #653, #654, #655. A MAJOR: #653 has `!` (public names and a prop are removed). The peers stay `efficient-easel` `^30.0.0` and `efficient-shell` `^12.18.0`. No stored key or value moves.
29
+
30
+ **BREAKING (#653):** "Show next image" has one draw path, `render/components/HoverMediaLayer`.
31
+ - Removed from `format/lib/content/image-treatment`: `NEXT_PICTURE_CLASS`, `NEXT_PICTURE_CSS`, `resolveNextPicture`.
32
+ - Removed from `format/lib/animation/hover`: `pictureHoverMovesRule` (use `pictureHoverMoveRule`). Changed: `pictureHoverZoomOf` takes `(record)` with no kind argument; `PictureHoverDrawn` has `zoom` / `darken` only when stored (and `media` for Show next image).
33
+ - Removed from `format/lib/content/card-template`: `rowNextPicture` and `CardRowFieldSpec.next`.
34
+ - Removed prop: `render/components/ImageBlock` `nextSrc` (use `hoverLayer`).
35
+
36
+ **For hosts:**
37
+ - Draw Show next image only through `HoverMediaLayer`; stop declaring `next` on card row fields; for "Same finish" on an Image part, set `finish` on the `CardRow` it provides. storefront-blocks and the storefront import none of the removed names.
38
+ - **HOLD (#651): the storefront takes this version ONLY in the same PR that mounts `ThemeLightInkProvider` in efficient-storefront `app/layout.tsx`.** Without that mount the editor canvas and the live site draw different text inks on a row-filled Box.
39
+ - storefront-blocks: ProductHero can name its second card template (`optionTemplate`) with #652, and picked rows take the site-wide picked look with #655.
40
+
41
+ ### Added
42
+
43
+ - **A block can name more than one card-template slot** (#652): `CardTemplateSpec.slots`, `CardTemplateSlotSpec`, `cardTemplateSlotNames`, `isCardTemplateSlot`, `cardTemplateSlotLabel`, and an optional `slot` prop on `CardTemplateRows`. 9 readers now use the one rule.
44
+ - **A picked row draws the site-wide picked look** (#655): `CARD_STATE_PICKED_CLASS`, `CARD_STATE_PICKED_BAR_CLASS`, `CARD_STATE_PICKED_WASH_CLASS`, `CARD_ACTION_HOVER_CLASS`, `cardStatePicked`, and an optional second argument on `cardStateAttrs`. A highlighted card keeps its 1px line; the tab line is unchanged.
45
+ - **`sectionGroundAnswer`** (#654): the one rule for the width of a section's ground.
46
+ - **`ThemeLightInkProvider`** (#651) in `render/components/ThemeLightInkContext`.
47
+
48
+ ### Changed
49
+
50
+ - **Show next image draws the card hover layer** (#653). Zoom and Darken on hover work without Show next image. 0 of 34 inovit_us pages store a value that changes.
51
+ - **Row-fill words pick the theme ink with more contrast** (#651): `fillIsDark` measures against the theme's own inks, not pure black and white.
52
+ - **The shadow colour rule comes from easel** (#650): `DEFAULT_SHADOW_COLOR` and the `#rrggbb` check have one home, `efficient-easel/screen/lib/document/shadow-values`.
53
+
54
+ ### Fixed
55
+
56
+ - **A Box preset paints the content ground only** (#654) on a site whose Background is Content width. Both US sites draw Full and do not change.
57
+
3
58
  ## 61.0.0 - 2026-11-09
4
59
 
5
60
  From main at `aba028f3`: #647, #648. A MAJOR: #648 has `!` (the peers narrow). No export, stored key or value moves.
@@ -1 +1 @@
1
- "use client";import{jsx as t}from"react/jsx-runtime";import{ShadowIcon as s}from"efficient-easel/icons";import{say as r}from"../../format/lib/editor-words.js";import{InheritedColourRow as a}from"../lib/document/ColourControl.js";import{DEFAULT_SHADOW_COLOR as n}from"../../format/lib/theme.js";const i="Most useful on a dark theme, where a black shadow cannot be seen. Also used by the Lift hover, even with the card shadow off.";function l({value:o,onChange:e}){const h=o===null;return t(a,{label:r("Shadow color"),icon:t(s,{}),value:o??"",inherited:n,resetTo:n,onChange:e,onReset:()=>e(null),hint:r(i)})}export{l as default};
1
+ "use client";import{jsx as t}from"react/jsx-runtime";import{ShadowIcon as s}from"efficient-easel/icons";import{say as r}from"../../format/lib/editor-words.js";import{InheritedColourRow as a}from"../lib/document/ColourControl.js";import{DEFAULT_SHADOW_COLOR as n}from"efficient-easel/screen/lib/document/shadow-values";const i="Most useful on a dark theme, where a black shadow cannot be seen. Also used by the Lift hover, even with the card shadow off.";function l({value:o,onChange:e}){const h=o===null;return t(a,{label:r("Shadow color"),icon:t(s,{}),value:o??"",inherited:n,resetTo:n,onChange:e,onReset:()=>e(null),hint:r(i)})}export{l as default};
@@ -1 +1 @@
1
- "use client";import{jsx as c,jsxs as pt}from"react/jsx-runtime";import{useCallback as n,useEffect as S,useMemo as ce,useRef as f,useState as r}from"react";import"efficient-easel/easel.css";import"efficient-easel/shell.css";import"efficient-easel/rail.css";import"efficient-easel/panel.css";import"efficient-easel/fields.css";import"efficient-easel/pick.css";import"efficient-easel/copy.css";import"efficient-easel/gold.css";import"efficient-easel/text-styles.css";import"efficient-easel/menu.css";import"efficient-easel/chrome.css";import"efficient-easel/tree.css";import"efficient-easel/drag.css";import"efficient-easel/screen.css";import"./storefront-editor.css";import{buildConfig as St}from"../lib/document/build-config.js";import{ChromeWrap as ft}from"efficient-easel/screen/lib/host-chrome";import{sessionRegistry as gt}from"efficient-easel/screen/lib/session";import{refreshSiteLiveState as wt}from"../lib/site-live-state.js";import{holdSiteWrites as Ct}from"../../format/lib/site-writes.js";import{backendOf as k,blocksOf as _t}from"../lib/website-session.js";import{useEaselSession as Tt}from"efficient-easel/screen/lib/session-context";import{withSiteBlockGapFields as Pt}from"../../format/lib/document/site-gap-fields.js";import{withTemplateMediaPlaceholders as Et}from"../../format/lib/document/templateFields.js";import{setEditorPage as se}from"../../format/lib/document/editor-page-context.js";import{EditorPagePathProvider as yt}from"./EditorPagePathProvider.js";import{resolveSiteName as vt}from"../../format/lib/content/site-name.js";import{normalizeSiteGutter as Gt,normalizeSiteGutterPhone as kt,normalizeSiteWidth as Ht}from"../../format/lib/content/page-width.js";import{normalizeSiteBackground as de}from"../../format/lib/content/section-width.js";import{normalizeSiteBlockGap as ue}from"../../format/lib/content/container-gap.js";import Wt,{DocumentScreen as Bt}from"efficient-easel/screen/components/ScreenMount";import Rt from"./WebsiteHintsProvider.js";import{useScreenDocument as Ft}from"efficient-easel/screen/components/ScreenDocumentContext";import{PreviewHeaderProvider as It,siteThemeRow as Dt,themeEdited as bt,themeSeeded as Mt}from"../../render/components/PreviewHeaderContext.js";import{PreviewFooterProvider as xt}from"./PreviewFooterContext.js";import{PreviewChatProvider as Nt,DEFAULT_CHAT_PREVIEW as Ot}from"./PreviewChatContext.js";import{PreviewSocialProvider as zt}from"../../render/components/PreviewSocialContext.js";import{useSocialSettings as At}from"./useSocialSettings.js";import{PreviewSurfaceProvider as Lt}from"./PreviewSurfaceContext.js";import{WEBSITE_ADDRESSING as Yt}from"../lib/website-document-addressing.js";import{PreviewTickerProvider as Ut}from"../../render/components/PreviewTickerContext.js";import{PreviewHeroPartProvider as jt}from"../../render/components/PreviewHeroPartContext.js";import{PreviewPartsProvider as Kt}from"efficient-easel/draw/client";import{CanvasPartsBridge as Vt}from"./CanvasPartsBridge.js";import{PreviewLocationPartProvider as Xt}from"../../render/components/PreviewLocationPartContext.js";import{PreviewPartStyleProvider as Zt}from"./PreviewPartStyleContext.js";import{CORNER_STYLE_TO_PX as qt,DEFAULT_HEADING_COMPRESSION as Jt,DEFAULT_HEADING_TYPOGRAPHY as Qt,DEFAULT_SWITCH_SHOWN as H,DEFAULT_SIZES as $t,DEFAULT_THEME_MODE as _,normalizeCornerRadius as er,normalizeCornerStyle as tr,normalizeCardShadow as rr,normalizeCardGap as or,normalizeHoverEffect as nr,normalizeShadowColor as ar,IDENTITY_CARD_GAP as he,IDENTITY_CARD_SHADOW as ir,IDENTITY_HOVER_EFFECT as cr,THEME_MODE_KEY as le,THEME_STORAGE_KEY as sr,THEME_SWITCH_HIDE as me,THEME_SWITCH_KEY as W}from"../../format/lib/theme.js";import{DEFAULT_FONTS as dr}from"../../format/lib/fonts.js";import{WEBSITE_SCREEN as ur}from"./WebsiteScreenParts.js";import{routeWebsiteHostMessage as hr}from"../../format/lib/website-host-inbound.js";import{siteTextFromRow as lr}from"../../render/lib/text-styles/site-text-styles.js";import{wordStylesFromRow as mr}from"../../format/lib/word-styles.js";import{chatPreviewFrom as pr}from"./PreviewChatContext.js";const Sr=()=>{if(typeof window>"u")return _;try{const s=window.localStorage.getItem(le);return s==="light"||s==="dark"||s==="auto"?s:_}catch{return _}},pe=s=>{if(!(typeof window>"u"))try{window.localStorage.setItem(le,s)}catch{}},fr=()=>{if(typeof window>"u")return H;try{return window.localStorage.getItem(W)!==me}catch{return H}},gr=()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem(sr)}catch{}},Se=s=>{if(!(typeof window>"u"))try{s?window.localStorage.removeItem(W):window.localStorage.setItem(W,me)}catch{}};function wr(){const{adapter:s,capabilities:d,templateId:B,ready:w,token:h,siteId:i,currentSlug:R,currentKind:F}=Ft();S(()=>(se(R,F),()=>se(null,null)),[R,F]);const T=d.placeholderFrames,[fe,I]=r(null),[ge,D]=r("");S(()=>{const e=s.templateName;if(!w||!B||!e){D("");return}let a=!1;return e().then(l=>!a&&D(l??"")).catch(()=>{}),()=>{a=!0}},[w,h,B,s]);const[we,P]=r(_),[Ce,E]=r(H),[b,M]=r({value:{selected:0,themes:[]},readFor:null}),_e=b.value,[Te,x]=r(dr),[Pe,N]=r($t),[Ee,O]=r(null),[ye,z]=r(Jt),[ve,A]=r(null),[Ge,L]=r(null),[ke,Y]=r(he),[He,U]=r(null),[We,j]=r(null),[Be,K]=r(null),[Re,V]=r(null),[y,X]=r(null),[v,Z]=r(null),u=Tt(),q=ce(()=>St(gt(u),_t(u)),[u]),Fe=ce(()=>Pt(Et(q,T),y,v),[q,T,y,v]),[Ie,J]=r(Qt),[De,Q]=r(null),[be,$]=r(null),[Me,ee]=r(null),[xe,te]=r(null),[Ne,re]=r(null),oe=f(null),o=f(!1);S(()=>{P(Sr()),E(fr())},[]);const Oe=n(e=>{o.current=!0,gr(),pe(e),P(e)},[]),ze=n(e=>{o.current=!0,Se(e),E(e)},[]),Ae=n(e=>{o.current=!0,M(a=>bt(a,e,i??""))},[i]),Le=n(e=>{o.current=!0,x(e)},[]),Ye=n(e=>{o.current=!0,N(e)},[]),Ue=n(e=>{o.current=!0,O(e)},[]),je=n(e=>{o.current=!0,z(e)},[]),Ke=n(e=>{o.current=!0,A(e)},[]),Ve=n(e=>{o.current=!0,L(e)},[]),Xe=n(e=>{o.current=!0,Y(e)},[]),Ze=n(e=>{o.current=!0,U(e)},[]),qe=n(e=>{o.current=!0,J(e)},[]),[Je,ne]=r(null),[Qe,$e]=r(null),et=n(e=>{o.current=!0,ne(e)},[]),tt=n(e=>{o.current=!0,j(e)},[]),rt=n(e=>{o.current=!0,K(e)},[]),ot=n(e=>{o.current=!0,V(e)},[]),nt=n(e=>{o.current=!0,X(e)},[]),at=n(e=>{o.current=!0,Z(e)},[]),it=n(e=>{o.current=!0,Q(e)},[]),ct=n(e=>{o.current=!0,$(e)},[]),st=n(e=>{o.current=!0,ee(e)},[]),dt=n(e=>{o.current=!0,te(e)},[]),ut=n(e=>{o.current=!0,re(e)},[]);S(()=>{const e=k(u).theme;if(!h||!d.hasSiteTheme||!e)return;const a=i??"";oe.current!==a&&(oe.current=a,o.current=!1);let l=!1;return e.get(i?{siteId:i}:void 0).then(t=>{if(l||o.current)return;pe(t.default_mode),Se(t.show_theme_switch),P(t.default_mode),E(t.show_theme_switch),M(Mt({selected:t.selected_preset,themes:t.theme_presets},a));const g=lr(t);x(g.fonts),N(g.sizes),O(t.corner_radius_px===void 0?qt[tr(t.corner_style)]:er(t.corner_radius_px)),z(g.compression),A(t.card_shadow==null?ir:rr(t.card_shadow)),Y(t.card_gap==null?he:or(t.card_gap)),U(t.hover_effect==null?cr:nr(t.hover_effect)),L(ar(t.shadow_color)),j(Ht(t.site_width)),K(Gt(t.site_gutter)),V(kt(t.site_gutter_phone)),X(ue(t.block_gap)),Z(ue(t.block_gap_phone)),J(g.typography),ne(g.textStyles),$e(mr(t)),Q(t.hero_background_follows_width===!0),$(de(t.section_background_width)),ee(de(t.section_content_width)),te(t.photography_grayscale===!0),re(t.share_button_on_posts===!0)}).catch(()=>{}),()=>{l=!0}},[h,i,d.hasSiteTheme,u]);const ht=At({token:h,siteId:i,enabled:d.hasSiteSettings}),[lt,ae]=r(Ot),ie=f(null),G=f(!1),m=f(null),p=f({}),C=n(async()=>{m.current&&clearTimeout(m.current),m.current=null;const e=p.current;p.current={};try{await k(u).chat?.update(e,i?{siteId:i}:void 0),wt()}catch(a){throw p.current={...e,...p.current},a}},[u,i]);S(()=>Ct(()=>m.current||Object.keys(p.current).length>0?C():void 0),[C]);const mt=n(e=>{G.current=!0,ae(a=>({...a,...e})),!(!d.hasSiteSettings||!h)&&(p.current={...p.current,...e},m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{C().catch(()=>{})},500))},[d.hasSiteSettings,h,C]);return S(()=>{if(!h||!d.hasSiteSettings)return;const e=i??"";ie.current!==e&&(ie.current=e,G.current=!1);let a=!1;const l=k(u).chat;if(l)return l.get(i?{siteId:i}:void 0).then(t=>{a||G.current||ae(pr(t))}).catch(()=>{}),()=>{a=!0}},[h,i,d.hasSiteSettings,u]),S(()=>{const e=s.site;if(!w||!d.hasSiteRecord||!e){I(null);return}let a=!1;return e().then(l=>{a||I(vt(l.name))}).catch(()=>{}),()=>{a=!0}},[w,h,d.hasSiteRecord,i,s]),c(Bt,{config:Fe,parts:ur,wrap:(e,a)=>c(It,{websiteName:fe,templateChrome:T,templateName:ge||null,themeMode:we,onThemeModeChange:Oe,themeSwitchShown:Ce,onThemeSwitchShownChange:ze,theme:_e,themeRow:Dt(d.hasSiteTheme,b.readFor,i??""),onThemeChange:Ae,fonts:Te,onFontsChange:Le,cornerRadiusPx:Ee,onCornerRadiusPxChange:Ue,cardShadow:ve,onCardShadowChange:Ke,shadowColor:Ge,onShadowColorChange:Ve,cardGap:ke,onCardGapChange:Xe,hoverEffect:He,onHoverEffectChange:Ze,headingCompression:ye,onHeadingCompressionChange:je,headingTypography:Ie,onHeadingTypographyChange:qe,textStyles:Je,onTextStylesChange:et,wordStyles:Qe,sizes:Pe,onSizesChange:Ye,siteWidth:We,onSiteWidthChange:tt,siteGutter:Be,onSiteGutterChange:rt,siteGutterPhone:Re,onSiteGutterPhoneChange:ot,blockGap:y,onBlockGapChange:nt,blockGapPhone:v,onBlockGapPhoneChange:at,heroBackgroundFollowsWidth:De,onHeroBackgroundFollowsWidthChange:it,sectionBackgroundWidth:be,onSectionBackgroundWidthChange:ct,sectionContentWidth:Me,onSectionContentWidthChange:st,photographyGrayscale:xe,onPhotographyGrayscaleChange:dt,shareButtonOnPosts:Ne,onShareButtonOnPostsChange:ut,themeFromDocument:!d.hasSiteTheme,children:c(xt,{children:c(ft,{wrap:u.chrome?.wrap,surface:"page",children:c(Ut,{children:c(jt,{children:c(Kt,{children:c(Xt,{children:c(Vt,{children:pt(Zt,{children:[c(Nt,{chat:lt,onChatChange:mt,children:c(zt,{value:ht,children:c(Lt,{children:c(yt,{children:c(Rt,{children:e})})})})}),a]})})})})})})})})})})}function Cr({target:s}){return c(Wt,{target:s,addressing:Yt,onHostMessage:hr,children:c(wr,{})})}export{Cr as default};
1
+ "use client";import{jsx as c,jsxs as pt}from"react/jsx-runtime";import{useCallback as n,useEffect as S,useMemo as ce,useRef as f,useState as r}from"react";import"efficient-easel/easel.css";import"efficient-easel/shell.css";import"efficient-easel/rail.css";import"efficient-easel/panel.css";import"efficient-easel/fields.css";import"efficient-easel/pick.css";import"efficient-easel/copy.css";import"efficient-easel/gold.css";import"efficient-easel/text-styles.css";import"efficient-easel/menu.css";import"efficient-easel/chrome.css";import"efficient-easel/tree.css";import"efficient-easel/drag.css";import"efficient-easel/screen.css";import"./storefront-editor.css";import{buildConfig as St}from"../lib/document/build-config.js";import{ChromeWrap as ft}from"efficient-easel/screen/lib/host-chrome";import{sessionRegistry as gt}from"efficient-easel/screen/lib/session";import{refreshSiteLiveState as wt}from"../lib/site-live-state.js";import{holdSiteWrites as Ct}from"../../format/lib/site-writes.js";import{backendOf as k,blocksOf as _t}from"../lib/website-session.js";import{useEaselSession as Tt}from"efficient-easel/screen/lib/session-context";import{withSiteBlockGapFields as Pt}from"../../format/lib/document/site-gap-fields.js";import{withTemplateMediaPlaceholders as Et}from"../../format/lib/document/templateFields.js";import{setEditorPage as se}from"../../format/lib/document/editor-page-context.js";import{EditorPagePathProvider as yt}from"./EditorPagePathProvider.js";import{resolveSiteName as vt}from"../../format/lib/content/site-name.js";import{normalizeSiteGutter as Gt,normalizeSiteGutterPhone as kt,normalizeSiteWidth as Ht}from"../../format/lib/content/page-width.js";import{normalizeSiteBackground as de}from"../../format/lib/content/section-width.js";import{normalizeSiteBlockGap as ue}from"../../format/lib/content/container-gap.js";import Wt,{DocumentScreen as Bt}from"efficient-easel/screen/components/ScreenMount";import Rt from"./WebsiteHintsProvider.js";import{useScreenDocument as Ft}from"efficient-easel/screen/components/ScreenDocumentContext";import{PreviewHeaderProvider as It,siteThemeRow as Dt,themeEdited as bt,themeSeeded as Mt}from"../../render/components/PreviewHeaderContext.js";import{PreviewFooterProvider as xt}from"./PreviewFooterContext.js";import{PreviewChatProvider as Nt,DEFAULT_CHAT_PREVIEW as Ot}from"./PreviewChatContext.js";import{PreviewSocialProvider as At}from"../../render/components/PreviewSocialContext.js";import{useSocialSettings as zt}from"./useSocialSettings.js";import{PreviewSurfaceProvider as Lt}from"./PreviewSurfaceContext.js";import{WEBSITE_ADDRESSING as Yt}from"../lib/website-document-addressing.js";import{PreviewTickerProvider as Ut}from"../../render/components/PreviewTickerContext.js";import{PreviewHeroPartProvider as jt}from"../../render/components/PreviewHeroPartContext.js";import{PreviewPartsProvider as Kt}from"efficient-easel/draw/client";import{CanvasPartsBridge as Vt}from"./CanvasPartsBridge.js";import{PreviewLocationPartProvider as Xt}from"../../render/components/PreviewLocationPartContext.js";import{PreviewPartStyleProvider as Zt}from"./PreviewPartStyleContext.js";import{CORNER_STYLE_TO_PX as qt,DEFAULT_HEADING_COMPRESSION as Jt,DEFAULT_HEADING_TYPOGRAPHY as Qt,DEFAULT_SWITCH_SHOWN as H,DEFAULT_SIZES as $t,DEFAULT_THEME_MODE as _,normalizeCornerRadius as er,normalizeCornerStyle as tr,normalizeCardShadow as rr,normalizeCardGap as or,normalizeHoverEffect as nr,IDENTITY_CARD_GAP as he,IDENTITY_CARD_SHADOW as ar,IDENTITY_HOVER_EFFECT as ir,THEME_MODE_KEY as le,THEME_STORAGE_KEY as cr,THEME_SWITCH_HIDE as me,THEME_SWITCH_KEY as W}from"../../format/lib/theme.js";import{pictureShadowColor as sr}from"efficient-easel/screen/lib/document/shadow-values";import{DEFAULT_FONTS as dr}from"../../format/lib/fonts.js";import{WEBSITE_SCREEN as ur}from"./WebsiteScreenParts.js";import{routeWebsiteHostMessage as hr}from"../../format/lib/website-host-inbound.js";import{siteTextFromRow as lr}from"../../render/lib/text-styles/site-text-styles.js";import{wordStylesFromRow as mr}from"../../format/lib/word-styles.js";import{chatPreviewFrom as pr}from"./PreviewChatContext.js";const Sr=()=>{if(typeof window>"u")return _;try{const s=window.localStorage.getItem(le);return s==="light"||s==="dark"||s==="auto"?s:_}catch{return _}},pe=s=>{if(!(typeof window>"u"))try{window.localStorage.setItem(le,s)}catch{}},fr=()=>{if(typeof window>"u")return H;try{return window.localStorage.getItem(W)!==me}catch{return H}},gr=()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem(cr)}catch{}},Se=s=>{if(!(typeof window>"u"))try{s?window.localStorage.removeItem(W):window.localStorage.setItem(W,me)}catch{}};function wr(){const{adapter:s,capabilities:d,templateId:B,ready:w,token:h,siteId:i,currentSlug:R,currentKind:F}=Ft();S(()=>(se(R,F),()=>se(null,null)),[R,F]);const T=d.placeholderFrames,[fe,I]=r(null),[ge,D]=r("");S(()=>{const e=s.templateName;if(!w||!B||!e){D("");return}let a=!1;return e().then(l=>!a&&D(l??"")).catch(()=>{}),()=>{a=!0}},[w,h,B,s]);const[we,P]=r(_),[Ce,E]=r(H),[b,M]=r({value:{selected:0,themes:[]},readFor:null}),_e=b.value,[Te,x]=r(dr),[Pe,N]=r($t),[Ee,O]=r(null),[ye,A]=r(Jt),[ve,z]=r(null),[Ge,L]=r(null),[ke,Y]=r(he),[He,U]=r(null),[We,j]=r(null),[Be,K]=r(null),[Re,V]=r(null),[y,X]=r(null),[v,Z]=r(null),u=Tt(),q=ce(()=>St(gt(u),_t(u)),[u]),Fe=ce(()=>Pt(Et(q,T),y,v),[q,T,y,v]),[Ie,J]=r(Qt),[De,Q]=r(null),[be,$]=r(null),[Me,ee]=r(null),[xe,te]=r(null),[Ne,re]=r(null),oe=f(null),o=f(!1);S(()=>{P(Sr()),E(fr())},[]);const Oe=n(e=>{o.current=!0,gr(),pe(e),P(e)},[]),Ae=n(e=>{o.current=!0,Se(e),E(e)},[]),ze=n(e=>{o.current=!0,M(a=>bt(a,e,i??""))},[i]),Le=n(e=>{o.current=!0,x(e)},[]),Ye=n(e=>{o.current=!0,N(e)},[]),Ue=n(e=>{o.current=!0,O(e)},[]),je=n(e=>{o.current=!0,A(e)},[]),Ke=n(e=>{o.current=!0,z(e)},[]),Ve=n(e=>{o.current=!0,L(e)},[]),Xe=n(e=>{o.current=!0,Y(e)},[]),Ze=n(e=>{o.current=!0,U(e)},[]),qe=n(e=>{o.current=!0,J(e)},[]),[Je,ne]=r(null),[Qe,$e]=r(null),et=n(e=>{o.current=!0,ne(e)},[]),tt=n(e=>{o.current=!0,j(e)},[]),rt=n(e=>{o.current=!0,K(e)},[]),ot=n(e=>{o.current=!0,V(e)},[]),nt=n(e=>{o.current=!0,X(e)},[]),at=n(e=>{o.current=!0,Z(e)},[]),it=n(e=>{o.current=!0,Q(e)},[]),ct=n(e=>{o.current=!0,$(e)},[]),st=n(e=>{o.current=!0,ee(e)},[]),dt=n(e=>{o.current=!0,te(e)},[]),ut=n(e=>{o.current=!0,re(e)},[]);S(()=>{const e=k(u).theme;if(!h||!d.hasSiteTheme||!e)return;const a=i??"";oe.current!==a&&(oe.current=a,o.current=!1);let l=!1;return e.get(i?{siteId:i}:void 0).then(t=>{if(l||o.current)return;pe(t.default_mode),Se(t.show_theme_switch),P(t.default_mode),E(t.show_theme_switch),M(Mt({selected:t.selected_preset,themes:t.theme_presets},a));const g=lr(t);x(g.fonts),N(g.sizes),O(t.corner_radius_px===void 0?qt[tr(t.corner_style)]:er(t.corner_radius_px)),A(g.compression),z(t.card_shadow==null?ar:rr(t.card_shadow)),Y(t.card_gap==null?he:or(t.card_gap)),U(t.hover_effect==null?ir:nr(t.hover_effect)),L(sr(t.shadow_color)),j(Ht(t.site_width)),K(Gt(t.site_gutter)),V(kt(t.site_gutter_phone)),X(ue(t.block_gap)),Z(ue(t.block_gap_phone)),J(g.typography),ne(g.textStyles),$e(mr(t)),Q(t.hero_background_follows_width===!0),$(de(t.section_background_width)),ee(de(t.section_content_width)),te(t.photography_grayscale===!0),re(t.share_button_on_posts===!0)}).catch(()=>{}),()=>{l=!0}},[h,i,d.hasSiteTheme,u]);const ht=zt({token:h,siteId:i,enabled:d.hasSiteSettings}),[lt,ae]=r(Ot),ie=f(null),G=f(!1),m=f(null),p=f({}),C=n(async()=>{m.current&&clearTimeout(m.current),m.current=null;const e=p.current;p.current={};try{await k(u).chat?.update(e,i?{siteId:i}:void 0),wt()}catch(a){throw p.current={...e,...p.current},a}},[u,i]);S(()=>Ct(()=>m.current||Object.keys(p.current).length>0?C():void 0),[C]);const mt=n(e=>{G.current=!0,ae(a=>({...a,...e})),!(!d.hasSiteSettings||!h)&&(p.current={...p.current,...e},m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{C().catch(()=>{})},500))},[d.hasSiteSettings,h,C]);return S(()=>{if(!h||!d.hasSiteSettings)return;const e=i??"";ie.current!==e&&(ie.current=e,G.current=!1);let a=!1;const l=k(u).chat;if(l)return l.get(i?{siteId:i}:void 0).then(t=>{a||G.current||ae(pr(t))}).catch(()=>{}),()=>{a=!0}},[h,i,d.hasSiteSettings,u]),S(()=>{const e=s.site;if(!w||!d.hasSiteRecord||!e){I(null);return}let a=!1;return e().then(l=>{a||I(vt(l.name))}).catch(()=>{}),()=>{a=!0}},[w,h,d.hasSiteRecord,i,s]),c(Bt,{config:Fe,parts:ur,wrap:(e,a)=>c(It,{websiteName:fe,templateChrome:T,templateName:ge||null,themeMode:we,onThemeModeChange:Oe,themeSwitchShown:Ce,onThemeSwitchShownChange:Ae,theme:_e,themeRow:Dt(d.hasSiteTheme,b.readFor,i??""),onThemeChange:ze,fonts:Te,onFontsChange:Le,cornerRadiusPx:Ee,onCornerRadiusPxChange:Ue,cardShadow:ve,onCardShadowChange:Ke,shadowColor:Ge,onShadowColorChange:Ve,cardGap:ke,onCardGapChange:Xe,hoverEffect:He,onHoverEffectChange:Ze,headingCompression:ye,onHeadingCompressionChange:je,headingTypography:Ie,onHeadingTypographyChange:qe,textStyles:Je,onTextStylesChange:et,wordStyles:Qe,sizes:Pe,onSizesChange:Ye,siteWidth:We,onSiteWidthChange:tt,siteGutter:Be,onSiteGutterChange:rt,siteGutterPhone:Re,onSiteGutterPhoneChange:ot,blockGap:y,onBlockGapChange:nt,blockGapPhone:v,onBlockGapPhoneChange:at,heroBackgroundFollowsWidth:De,onHeroBackgroundFollowsWidthChange:it,sectionBackgroundWidth:be,onSectionBackgroundWidthChange:ct,sectionContentWidth:Me,onSectionContentWidthChange:st,photographyGrayscale:xe,onPhotographyGrayscaleChange:dt,shareButtonOnPosts:Ne,onShareButtonOnPostsChange:ut,themeFromDocument:!d.hasSiteTheme,children:c(xt,{children:c(ft,{wrap:u.chrome?.wrap,surface:"page",children:c(Ut,{children:c(jt,{children:c(Kt,{children:c(Xt,{children:c(Vt,{children:pt(Zt,{children:[c(Nt,{chat:lt,onChatChange:mt,children:c(At,{value:ht,children:c(Lt,{children:c(yt,{children:c(Rt,{children:e})})})})}),a]})})})})})})})})})})}function Cr({target:s}){return c(Wt,{target:s,addressing:Yt,onHostMessage:hr,children:c(wr,{})})}export{Cr as default};
@@ -1 +1 @@
1
- "use client";import{jsx as t,Fragment as T,jsxs as C}from"react/jsx-runtime";import{useEasel as I,useRootFields as H}from"efficient-easel/easel";import{Inspector as Y}from"efficient-easel/fields";import{SettingsGroup as j}from"efficient-easel/panel";import{useEffect as X,useRef as U,useState as E}from"react";import q from"./ThemeField.js";import K from"./CornersField.js";import M from"./CardShadowField.js";import $ from"./ShadowColourField.js";import V,{blockGapRow as J}from"./BlockGapField.js";import Q from"./HoverEffectField.js";import Z from"./PhotographyField.js";import D from"./ShareButtonField.js";import{usePreviewDevice as G}from"efficient-easel/draw/client";import ee,{sideSpaceRow as te}from"./SideSpaceField.js";import{BackgroundWidthRow as oe,ContentWidthRow as ne,SITE_BACKGROUND_HINT as re,SITE_CONTENT_HINT as ie}from"./SectionWidthRows.js";import se from"./SiteAccentField.js";import ae from"./SiteTextStylesField.js";import{usePreviewHeader as f}from"../../render/components/PreviewHeaderContext.js";import{EmptyState as ce,SliderGroup as le,Tabs as ue,Tooltip as de,tabButtonId as pe,tabPanelId as he}from"efficient-shell/ui";import{ContrastIcon as fe,SettingsIcon as ge,TypeIcon as me}from"efficient-easel/icons";import{useThemeRowPersist as Se}from"../lib/theme-row-persist.js";import{themeSaveNotice as _e}from"../../format/lib/theme-save-message.js";import{say as m}from"../../format/lib/editor-words.js";import{NEUTRAL_SITE_NAME as xe}from"../../format/lib/content/site-name.js";import{PAGE_WIDTH as w}from"../../format/lib/content/page-width.js";import{PAGE_STYLE_FIELDS as Ce}from"../lib/document/page-root-fields.js";import{previewFrame as Te}from"efficient-easel/screen/lib/document/preview-dom";import{siteTextColourNameOf as be,siteTextColours as Pe}from"../../format/lib/text-styles/site-text-colours.js";import{useSiteTextStylesWriter as ye}from"../lib/site-text-styles-writer.js";import{CORNER_STYLE_TO_PX as we,normalizeCornerRadius as Re,normalizeCornerStyle as Ee,normalizeShadowColor as Ge}from"../../format/lib/theme.js";const k="sf-site-styles",ke="sf-site-styles-tabpanel",Lt="text",O="basics",B="this-page-group",R=[{id:O,label:"Basics",icon:t(ge,{})},{id:"theme",label:"Theme",icon:t(fe,{})},{id:"text",label:"Text",icon:t(me,{})}];function Fe({themeFromDocument:e,persist:o}){const{appState:n,dispatch:r}=I(u=>u),{theme:s,setTheme:i}=f(),d=n.data,a=d.root?.props??{},p=u=>{if(e){const h={...a,theme:u};r({type:"replaceRoot",root:{...d.root,props:h},recordHistory:!0})}else i(u);o({selected_preset:u.selected,theme_presets:u.themes})};return t(q,{value:e?a.theme:s,onChange:p})}function Ie({themeFromDocument:e,persist:o}){const[n,r]=E(null),{theme:s,setFonts:i,setSizes:d,setHeadingTypography:a}=f(),p=ye({themeFromDocument:e,persist:o}),{old:u,saved:h,writeRoot:g}=p,l=p.fonts,_=p.sizes,x=p.typography,b=c=>c.values.size??Ae(Oe[c.id]??"body")??Be[c.kind],P=c=>p.write(c),y=Pe(s),A=be(s),N=c=>{const S={...l,accent:c};e?g({fonts:S}):i(S),o({accent_font:c})},L=c=>{d({..._,accent:c}),o({accent_size_px:c})},W=c=>{const S={...x,weightStrong:c};e?g({headingTypography:S}):a(S),o({heading_weight_strong:c})},z=c=>{const S={...x,italicStrong:c};e?g({headingTypography:S}):a(S),o({accent_italic:c})};return C(T,{children:[t(ae,{saved:h,old:u,colours:y,colourNameOf:A,sizeOf:b,onChange:P,openId:n===F?null:n,onOpenChange:r,withoutSize:e}),t(se,{font:l.accent,size:_.accent,weight:x.weightStrong,italic:x.italicStrong,headingWeight:x.weight,open:n===F,onOpenChange:c=>r(c?F:null),onChange:c=>{c.key==="font"?N(c.value):c.key==="size"?L(c.value):c.key==="weight"?W(c.value):z(c.value)},withoutSize:e})]})}const F="accent",Oe={"heading-1":"heading","heading-2":"heading2","heading-3":"heading3","body-1":"body","body-5":"label"},Be={heading:32,body:14},ve={heading:"main h1, main h2",heading2:"main h1, main h2",heading3:"main h1, main h2",accent:"main h1 em, main h2 em",body:"main p",label:"main .mono-eyebrow"};function Ae(e){if(typeof document>"u")return null;const n=(Te()?.contentDocument??document).querySelector(ve[e]);if(!n)return null;const r=parseFloat(getComputedStyle(n).fontSize);return Number.isFinite(r)?r:null}function Ne({themeFromDocument:e,persist:o}){const{appState:n,dispatch:r}=I(l=>l),{cornerRadiusPx:s,setCornerRadiusPx:i}=f(),d=n.data,a=d.root?.props??{},p=a.cornerRadiusPx===void 0?we[Ee(a.cornerStyle)]:Re(a.cornerRadiusPx),u=e?p:s,h=l=>r({type:"replaceRoot",root:{...d.root,props:{...a,...l}},recordHistory:!0});return t(K,{value:u,onChange:l=>{e?h({cornerRadiusPx:l}):i(l),o({corner_radius_px:l})}})}function Le(e){return{site_width:e}}function We({persist:e}){const{siteWidth:o,setSiteWidth:n,sectionBackgroundWidth:r,setSectionBackgroundWidth:s,sectionContentWidth:i,setSectionContentWidth:d}=f();if(G()!=="desktop")return null;const p=typeof o=="number"?o:w.default,u=l=>{n(l),e(Le(l),l===null)},h=l=>{s(l),e({section_background_width:l},!0)},g=l=>{d(l),e({section_content_width:l},!0)};return C(T,{children:[t(oe,{value:r??"full",changed:r!==null,detail:m("Full width"),onChange:h,onReset:()=>h(null),hint:re}),t(ne,{mode:i??"content",px:p,min:w.min,max:w.max,changed:typeof o=="number"||i!==null,detail:`${m("Content width")} ${w.default}px`,onMode:g,onPx:l=>u(l),onReset:()=>{g(null),u(null)},hint:ie})]})}function ze(e){return{block_gap:e}}function He(e){return{block_gap_phone:e}}function Ye(e){return{site_gutter:e}}function je(e){return{site_gutter_phone:e}}function v(e,[o,n],r){o(e),r(n(e),e===null)}function Xe({persist:e}){const{siteGutter:o,siteGutterPhone:n,setSiteGutter:r,setSiteGutterPhone:s}=f(),i=te(G(),{gutter:o,phone:n});if(!i)return null;const d=i.key==="site_gutter_phone"?[s,je]:[r,Ye];return t(ee,{value:i.value,onChange:a=>v(a,d,e),unsetPx:i.unsetPx,bounds:i.bounds})}function Ue({persist:e}){const{blockGap:o,blockGapPhone:n,setBlockGap:r,setBlockGapPhone:s}=f(),i=J(G(),{gap:o,phone:n});if(!i)return null;const d=i.key==="block_gap_phone"?[s,He]:[r,ze];return t(V,{value:i.value,onChange:a=>v(a,d,e),followsPx:i.followsPx})}function qe({persist:e}){return C(T,{children:[t(We,{persist:e}),t(Xe,{persist:e}),t(Ue,{persist:e})]})}function Ke(e){return{card_shadow:e}}function Me(e){return e===null?{shadow_color:null}:{shadow_color:Ge(e)}}function $e(e){return{hover_effect:e}}function Ve({persist:e}){const{cardShadow:o,setCardShadow:n,shadowColor:r,setShadowColor:s,hoverEffect:i,setHoverEffect:d}=f();return C(T,{children:[t(M,{value:o,onChange:a=>{n(a),e(Ke(a),!0)}}),t($,{value:r,onChange:a=>{s(a),e(Me(a),a===null)}}),t(Q,{value:i,onChange:a=>{d(a),e($e(a),!0)}})]})}function Je(e){return{photography_grayscale:e}}function Qe({persist:e}){const{photographyGrayscale:o,setPhotographyGrayscale:n}=f();return t(Z,{value:o,onChange:s=>{n(s),e(Je(s),!0)}})}function Ze({persist:e}){return t(T,{children:t(Qe,{persist:e})})}function De(e){return{share_button_on_posts:e}}function et({persist:e}){const{shareButtonOnPosts:o,setShareButtonOnPosts:n}=f();return t(D,{value:o,onChange:s=>{n(s),e(De(s),!0)}})}function tt(){const{websiteName:e}=f();return e?.trim()||xe}function Wt(){const e=tt();return t(de,{content:m("{name} — renamed in the Console: {place}.",{name:e,place:m("Storefront ▸ Sites ▸ Settings")}),className:"sf-name-tip",children:t("span",{className:"sf-panel-site",children:e})})}function ot({themeFromDocument:e=!1,tokenRef:o,siteId:n,onNotify:r,tab:s,onTabChange:i,initialTab:d,revealPageGroup:a=!1,onPageGroupRevealed:p}){const{persist:u}=Se({themeFromDocument:e,tokenRef:o,siteId:n,onResult:P=>{const y=_e(P);y&&r?.(y.msg,y.tone)}}),[h,g]=E(d??R[0].id),l=s!==void 0,_=l?s:h,x=l?i??(()=>{}):g,b=R.find(P=>P.id===_)??R[0];return C(le,{children:[t(it,{activeId:b.id,onSelect:x}),C("div",{id:he(k,b.id),className:ke,role:"tabpanel","aria-labelledby":pe(k,b.id),children:[_===O&&C(T,{children:[t(Ne,{themeFromDocument:e,persist:u}),!e&&t(Ve,{persist:u}),!e&&t(qe,{persist:u}),!e&&t(Ze,{persist:u}),!e&&t(et,{persist:u}),t(nt,{reveal:a,onRevealed:p})]}),_==="theme"&&t(Fe,{themeFromDocument:e,persist:u}),_==="text"&&t(Ie,{themeFromDocument:e,persist:u})]})]})}function nt({reveal:e,onRevealed:o}){const[n,r]=E(!0),s=U(o);return s.current=o,X(()=>{if(!e)return;r(!0);const i=requestAnimationFrame(()=>{document.getElementById(B)?.scrollIntoView({block:"start"}),s.current?.()});return()=>cancelAnimationFrame(i)},[e]),t(j,{title:m("This page"),open:n,onToggle:r,id:B,children:t(rt,{})})}function rt(){const{fields:e,values:o,readOnly:n,onChange:r}=H(),s=Object.fromEntries(Ce.filter(i=>i in e).map(i=>[i,e[i]]));return Object.keys(s).length===0?t(ce,{variant:"none",icon:!1,message:m("This page has no look of its own to set.")}):t(Y,{fields:s,values:o,onChange:r,readOnly:n,tabs:!1,idPrefix:"this-page",ariaLabel:m("This page")})}function it({activeId:e,onSelect:o}){return t("div",{className:"es-insp-tabs",children:t(ue,{variant:"underline",block:!0,labelsFit:!0,"aria-label":m("Styles"),idPrefix:k,value:e,onChange:o,items:R.map(n=>{const r=m(n.label);return{id:n.id,icon:n.icon,label:r}})})})}export{Ue as BlockGapRootField,Ve as CardLookFields,qe as PageGroupFields,Ze as PhotographyGroupFields,O as SITE_STYLES_BASICS_TAB,k as SITE_STYLES_ID_PREFIX,R as SITE_STYLES_TABS,Lt as SITE_STYLES_TEXT_TAB,et as ShareButtonRootField,Xe as SideSpaceRootField,it as SiteStylesTabStrip,ke as TABPANEL_CLASS,B as THIS_PAGE_GROUP_ID,Wt as WebsiteNameReadonly,ze as blockGapPatch,He as blockGapPhonePatch,Ke as cardShadowPatch,ot as default,$e as hoverEffectPatch,Je as photographyPatch,Me as shadowColourPatch,De as shareButtonPatch,Ye as siteGutterPatch,je as siteGutterPhonePatch,Le as siteWidthPatch,tt as useWebsiteName};
1
+ "use client";import{jsx as t,Fragment as T,jsxs as C}from"react/jsx-runtime";import{useEasel as I,useRootFields as H}from"efficient-easel/easel";import{Inspector as Y}from"efficient-easel/fields";import{SettingsGroup as j}from"efficient-easel/panel";import{useEffect as X,useRef as U,useState as E}from"react";import q from"./ThemeField.js";import K from"./CornersField.js";import M from"./CardShadowField.js";import $ from"./ShadowColourField.js";import V,{blockGapRow as J}from"./BlockGapField.js";import Q from"./HoverEffectField.js";import Z from"./PhotographyField.js";import D from"./ShareButtonField.js";import{usePreviewDevice as G}from"efficient-easel/draw/client";import ee,{sideSpaceRow as te}from"./SideSpaceField.js";import{BackgroundWidthRow as oe,ContentWidthRow as ne,SITE_BACKGROUND_HINT as re,SITE_CONTENT_HINT as ie}from"./SectionWidthRows.js";import se from"./SiteAccentField.js";import ae from"./SiteTextStylesField.js";import{usePreviewHeader as f}from"../../render/components/PreviewHeaderContext.js";import{EmptyState as ce,SliderGroup as le,Tabs as ue,Tooltip as de,tabButtonId as pe,tabPanelId as he}from"efficient-shell/ui";import{ContrastIcon as fe,SettingsIcon as ge,TypeIcon as me}from"efficient-easel/icons";import{useThemeRowPersist as Se}from"../lib/theme-row-persist.js";import{themeSaveNotice as _e}from"../../format/lib/theme-save-message.js";import{say as m}from"../../format/lib/editor-words.js";import{NEUTRAL_SITE_NAME as xe}from"../../format/lib/content/site-name.js";import{PAGE_WIDTH as w}from"../../format/lib/content/page-width.js";import{PAGE_STYLE_FIELDS as Ce}from"../lib/document/page-root-fields.js";import{previewFrame as Te}from"efficient-easel/screen/lib/document/preview-dom";import{siteTextColourNameOf as be,siteTextColours as Pe}from"../../format/lib/text-styles/site-text-colours.js";import{useSiteTextStylesWriter as ye}from"../lib/site-text-styles-writer.js";import{CORNER_STYLE_TO_PX as we,normalizeCornerRadius as Re,normalizeCornerStyle as Ee}from"../../format/lib/theme.js";import{pictureShadowColor as Ge}from"efficient-easel/screen/lib/document/shadow-values";const k="sf-site-styles",ke="sf-site-styles-tabpanel",Wt="text",O="basics",B="this-page-group",R=[{id:O,label:"Basics",icon:t(ge,{})},{id:"theme",label:"Theme",icon:t(fe,{})},{id:"text",label:"Text",icon:t(me,{})}];function Fe({themeFromDocument:e,persist:o}){const{appState:n,dispatch:r}=I(u=>u),{theme:s,setTheme:i}=f(),d=n.data,a=d.root?.props??{},p=u=>{if(e){const h={...a,theme:u};r({type:"replaceRoot",root:{...d.root,props:h},recordHistory:!0})}else i(u);o({selected_preset:u.selected,theme_presets:u.themes})};return t(q,{value:e?a.theme:s,onChange:p})}function Ie({themeFromDocument:e,persist:o}){const[n,r]=E(null),{theme:s,setFonts:i,setSizes:d,setHeadingTypography:a}=f(),p=ye({themeFromDocument:e,persist:o}),{old:u,saved:h,writeRoot:g}=p,l=p.fonts,_=p.sizes,x=p.typography,b=c=>c.values.size??Ae(Oe[c.id]??"body")??Be[c.kind],P=c=>p.write(c),y=Pe(s),A=be(s),N=c=>{const S={...l,accent:c};e?g({fonts:S}):i(S),o({accent_font:c})},L=c=>{d({..._,accent:c}),o({accent_size_px:c})},W=c=>{const S={...x,weightStrong:c};e?g({headingTypography:S}):a(S),o({heading_weight_strong:c})},z=c=>{const S={...x,italicStrong:c};e?g({headingTypography:S}):a(S),o({accent_italic:c})};return C(T,{children:[t(ae,{saved:h,old:u,colours:y,colourNameOf:A,sizeOf:b,onChange:P,openId:n===F?null:n,onOpenChange:r,withoutSize:e}),t(se,{font:l.accent,size:_.accent,weight:x.weightStrong,italic:x.italicStrong,headingWeight:x.weight,open:n===F,onOpenChange:c=>r(c?F:null),onChange:c=>{c.key==="font"?N(c.value):c.key==="size"?L(c.value):c.key==="weight"?W(c.value):z(c.value)},withoutSize:e})]})}const F="accent",Oe={"heading-1":"heading","heading-2":"heading2","heading-3":"heading3","body-1":"body","body-5":"label"},Be={heading:32,body:14},ve={heading:"main h1, main h2",heading2:"main h1, main h2",heading3:"main h1, main h2",accent:"main h1 em, main h2 em",body:"main p",label:"main .mono-eyebrow"};function Ae(e){if(typeof document>"u")return null;const n=(Te()?.contentDocument??document).querySelector(ve[e]);if(!n)return null;const r=parseFloat(getComputedStyle(n).fontSize);return Number.isFinite(r)?r:null}function Ne({themeFromDocument:e,persist:o}){const{appState:n,dispatch:r}=I(l=>l),{cornerRadiusPx:s,setCornerRadiusPx:i}=f(),d=n.data,a=d.root?.props??{},p=a.cornerRadiusPx===void 0?we[Ee(a.cornerStyle)]:Re(a.cornerRadiusPx),u=e?p:s,h=l=>r({type:"replaceRoot",root:{...d.root,props:{...a,...l}},recordHistory:!0});return t(K,{value:u,onChange:l=>{e?h({cornerRadiusPx:l}):i(l),o({corner_radius_px:l})}})}function Le(e){return{site_width:e}}function We({persist:e}){const{siteWidth:o,setSiteWidth:n,sectionBackgroundWidth:r,setSectionBackgroundWidth:s,sectionContentWidth:i,setSectionContentWidth:d}=f();if(G()!=="desktop")return null;const p=typeof o=="number"?o:w.default,u=l=>{n(l),e(Le(l),l===null)},h=l=>{s(l),e({section_background_width:l},!0)},g=l=>{d(l),e({section_content_width:l},!0)};return C(T,{children:[t(oe,{value:r??"full",changed:r!==null,detail:m("Full width"),onChange:h,onReset:()=>h(null),hint:re}),t(ne,{mode:i??"content",px:p,min:w.min,max:w.max,changed:typeof o=="number"||i!==null,detail:`${m("Content width")} ${w.default}px`,onMode:g,onPx:l=>u(l),onReset:()=>{g(null),u(null)},hint:ie})]})}function ze(e){return{block_gap:e}}function He(e){return{block_gap_phone:e}}function Ye(e){return{site_gutter:e}}function je(e){return{site_gutter_phone:e}}function v(e,[o,n],r){o(e),r(n(e),e===null)}function Xe({persist:e}){const{siteGutter:o,siteGutterPhone:n,setSiteGutter:r,setSiteGutterPhone:s}=f(),i=te(G(),{gutter:o,phone:n});if(!i)return null;const d=i.key==="site_gutter_phone"?[s,je]:[r,Ye];return t(ee,{value:i.value,onChange:a=>v(a,d,e),unsetPx:i.unsetPx,bounds:i.bounds})}function Ue({persist:e}){const{blockGap:o,blockGapPhone:n,setBlockGap:r,setBlockGapPhone:s}=f(),i=J(G(),{gap:o,phone:n});if(!i)return null;const d=i.key==="block_gap_phone"?[s,He]:[r,ze];return t(V,{value:i.value,onChange:a=>v(a,d,e),followsPx:i.followsPx})}function qe({persist:e}){return C(T,{children:[t(We,{persist:e}),t(Xe,{persist:e}),t(Ue,{persist:e})]})}function Ke(e){return{card_shadow:e}}function Me(e){return e===null?{shadow_color:null}:{shadow_color:Ge(e)}}function $e(e){return{hover_effect:e}}function Ve({persist:e}){const{cardShadow:o,setCardShadow:n,shadowColor:r,setShadowColor:s,hoverEffect:i,setHoverEffect:d}=f();return C(T,{children:[t(M,{value:o,onChange:a=>{n(a),e(Ke(a),!0)}}),t($,{value:r,onChange:a=>{s(a),e(Me(a),a===null)}}),t(Q,{value:i,onChange:a=>{d(a),e($e(a),!0)}})]})}function Je(e){return{photography_grayscale:e}}function Qe({persist:e}){const{photographyGrayscale:o,setPhotographyGrayscale:n}=f();return t(Z,{value:o,onChange:s=>{n(s),e(Je(s),!0)}})}function Ze({persist:e}){return t(T,{children:t(Qe,{persist:e})})}function De(e){return{share_button_on_posts:e}}function et({persist:e}){const{shareButtonOnPosts:o,setShareButtonOnPosts:n}=f();return t(D,{value:o,onChange:s=>{n(s),e(De(s),!0)}})}function tt(){const{websiteName:e}=f();return e?.trim()||xe}function zt(){const e=tt();return t(de,{content:m("{name} — renamed in the Console: {place}.",{name:e,place:m("Storefront ▸ Sites ▸ Settings")}),className:"sf-name-tip",children:t("span",{className:"sf-panel-site",children:e})})}function ot({themeFromDocument:e=!1,tokenRef:o,siteId:n,onNotify:r,tab:s,onTabChange:i,initialTab:d,revealPageGroup:a=!1,onPageGroupRevealed:p}){const{persist:u}=Se({themeFromDocument:e,tokenRef:o,siteId:n,onResult:P=>{const y=_e(P);y&&r?.(y.msg,y.tone)}}),[h,g]=E(d??R[0].id),l=s!==void 0,_=l?s:h,x=l?i??(()=>{}):g,b=R.find(P=>P.id===_)??R[0];return C(le,{children:[t(it,{activeId:b.id,onSelect:x}),C("div",{id:he(k,b.id),className:ke,role:"tabpanel","aria-labelledby":pe(k,b.id),children:[_===O&&C(T,{children:[t(Ne,{themeFromDocument:e,persist:u}),!e&&t(Ve,{persist:u}),!e&&t(qe,{persist:u}),!e&&t(Ze,{persist:u}),!e&&t(et,{persist:u}),t(nt,{reveal:a,onRevealed:p})]}),_==="theme"&&t(Fe,{themeFromDocument:e,persist:u}),_==="text"&&t(Ie,{themeFromDocument:e,persist:u})]})]})}function nt({reveal:e,onRevealed:o}){const[n,r]=E(!0),s=U(o);return s.current=o,X(()=>{if(!e)return;r(!0);const i=requestAnimationFrame(()=>{document.getElementById(B)?.scrollIntoView({block:"start"}),s.current?.()});return()=>cancelAnimationFrame(i)},[e]),t(j,{title:m("This page"),open:n,onToggle:r,id:B,children:t(rt,{})})}function rt(){const{fields:e,values:o,readOnly:n,onChange:r}=H(),s=Object.fromEntries(Ce.filter(i=>i in e).map(i=>[i,e[i]]));return Object.keys(s).length===0?t(ce,{variant:"none",icon:!1,message:m("This page has no look of its own to set.")}):t(Y,{fields:s,values:o,onChange:r,readOnly:n,tabs:!1,idPrefix:"this-page",ariaLabel:m("This page")})}function it({activeId:e,onSelect:o}){return t("div",{className:"es-insp-tabs",children:t(ue,{variant:"underline",block:!0,labelsFit:!0,"aria-label":m("Styles"),idPrefix:k,value:e,onChange:o,items:R.map(n=>{const r=m(n.label);return{id:n.id,icon:n.icon,label:r}})})})}export{Ue as BlockGapRootField,Ve as CardLookFields,qe as PageGroupFields,Ze as PhotographyGroupFields,O as SITE_STYLES_BASICS_TAB,k as SITE_STYLES_ID_PREFIX,R as SITE_STYLES_TABS,Wt as SITE_STYLES_TEXT_TAB,et as ShareButtonRootField,Xe as SideSpaceRootField,it as SiteStylesTabStrip,ke as TABPANEL_CLASS,B as THIS_PAGE_GROUP_ID,zt as WebsiteNameReadonly,ze as blockGapPatch,He as blockGapPhonePatch,Ke as cardShadowPatch,ot as default,$e as hoverEffectPatch,Je as photographyPatch,Me as shadowColourPatch,De as shareButtonPatch,Ye as siteGutterPatch,je as siteGutterPhonePatch,Le as siteWidthPatch,tt as useWebsiteName};
@@ -1 +1 @@
1
- import{jsx as i}from"react/jsx-runtime";import{AccentIcon as F,ContrastIcon as M,ExpandIcon as G,FinishIcon as W,ImagesIcon as X,NoSymbolIcon as O,HoverLiftIcon as z,HoverNextImageIcon as Y,HoverRotateIcon as j,HoverZoomIcon as w,OpacityIcon as Z}from"efficient-easel/icons";import{customize as q,describedAs as v,group as J}from"efficient-easel/screen/lib/document/box-fields";import{effectTiles as V}from"efficient-easel/screen/lib/document/effect-tiles";import{deviceField as r}from"efficient-easel/screen/lib/document/device-fields";import{NoControlMark as Q,noControlField as $}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{BOX_DARKEN as p}from"../../../format/lib/content/box-background.js";import{cardListFieldsOf as oo,cardTemplateOwner as eo,namedRowField as to,rowFieldSpec as no}from"../../../format/lib/content/card-template.js";import{angleRow as ro,segmented as N,select as so,slider as S}from"../document/box-fields.js";import{say as u}from"../../../format/lib/editor-words.js";import{withShowWhen as a}from"../../../format/lib/document/show-when-attach.js";import{animationDelayField as T,animationDurationField as D,showsWhatRuns as m}from"./AnimationDurationRow.js";import{BOX_HIGHLIGHT as A,BOX_HOVER_KINDS as k,BOX_HOVER_LABELS as x,CARD_HOVER_KEYS as c,CARD_HOVER_KINDS as io,CARD_HOVER_TURN as co,HOVER_KEY as h,HOVER_MEDIA_COVERS as ao,HOVER_MEDIA_COVER_LABELS as po,HOVER_MEDIA_DEFAULTS as f,HOVER_MEDIA_GROUPS as ho,HOVER_MEDIA_GROUP_LABELS as lo,HOVER_MEDIA_KINDS as _o,HOVER_MEDIA_KIND_LABELS as Eo,HOVER_KIND_LABELS as C,NEXT_PICTURE_BLOCKS as uo,NEXT_PICTURE_HOVER_KINDS as Ro,OLD_SPIN_KEY as Ho,PART_HOVER_KINDS as g,PICTURE_HOVER_KEYS as K,PICTURE_HOVER_KINDS as mo,PICTURE_HOVER_ZOOM as d,cardHoverAngleOf as fo,cardHoverKindOf as Io,cardRotatesRule as Oo,cardShowsNextRule as wo,HOVER_GROUP_KEY as R,pictureHoverKindOf as vo,pictureHoverMovesRule as Vo,pictureHoverRunsRule as P}from"../../../format/lib/animation/hover.js";const H=o=>r("desktop",J("Hover",{dot:o})),b=()=>r("desktop",q()),No="What this does when a shopper points at it, or taps it on a phone.",So="What this picture does when a shopper points at it. Black and white shows it in grey until then. A phone shows its colour.",To="What this picture does when a shopper points at the card. Show next image fades to the card's next photo. Black and white shows it in grey until then. A phone shows the first photo in colour.",Do="What each card does when a shopper points at it. Show next image covers the card with this product's photos, with arrows; a phone shows the card as it is. Rotate turns the wheel picture.",Ao="Which of the product's pictures the card shows.",ko="Same finish shows the photos of the finish the card shows, else the first group.",xo="Whole card hides the words under the photo. Picture keeps the words and swatches in view.",Co={none:()=>i(O,{}),nextImage:()=>i(Y,{}),rotate:()=>i(j,{}),zoom:()=>i(w,{}),lift:()=>i(z,{}),mono:()=>i(M,{})};function I(o,e){const t=V({label:u("Hover effect"),options:o.map(s=>({value:s,label:u(C[s]),picture:Co[s]()})),fallback:e});return v(t,{type:"select",label:"Hover effect",options:o.map(s=>({value:s,label:C[s]}))})}function Jo(){return{[R]:H({field:h,in:g.filter(o=>o!=="none")}),[h]:r("desktop",{...I(g,"none"),description:No})}}function Qo(o){const e=Oo(o),t=wo(),s=ro(co);return{[R]:H({any:[e,t]}),[c.kind]:r("desktop",{...m(I(io,o),(n,l)=>Io(l??{},o)),description:Do}),...go(t),[Ho]:$({type:"custom",render:()=>i(Q,{})},"always"),_cHover:b(),[c.angle]:r("desktop",a(m(s,n=>fo(n)),e)),[c.duration]:r("desktop",a(D("hover"),e)),[c.delay]:r("desktop",a(T("hover"),e))}}function go(o){const e=so("Type",i(X,{}),_o.map(n=>({value:n,label:Eo[n]})),f.kind),t=N("Group",i(W,{}),ho.map(n=>({value:n,label:lo[n]})),f.group),s=N("Covers",i(G,{}),ao.map(n=>({value:n,label:po[n]})),f.cover);return{[c.mediaKind]:r("desktop",a({...e,description:Ao},o)),[c.mediaGroup]:r("desktop",a({...t,description:ko},o)),[c.cover]:r("desktop",a({...s,description:xo},o))}}function Ko(o,e=""){const t=P(o);return{[R]:H(t),[c.kind]:y(mo,o,So),_cHover:b(),...uo.includes(e)?Po():{},[c.duration]:r("desktop",a(D("hover"),t)),[c.delay]:r("desktop",a(T("hover"),t))}}function Po(){const o=Vo(),e=S("Zoom",i(w,{}),d.min,d.max,d.step,d.min,d.unit),t=S("Darken on hover",i(Z,{}),p.min,p.max,p.step,p.fallback,p.unit);return{[K.zoom]:r("desktop",a(e,o)),[K.darken]:r("desktop",a(t,o))}}function y(o,e,t){const s=r("desktop",{...m(I(o,e),n=>vo({[h]:n},e,o)),description:t});return Object.assign(s,{[L]:e})}const L="sfPictureResting",U=new WeakMap;function $o(o,e,t){const s=o[c.kind],n=s?.[L];if(!s||!n)return o;const l=e.props?.[h]==="nextImage",_=l?null:eo(t.appState,e.props?.id),B=_?no({ownerType:String(_.type),owner:_,fields:oo(t.appState,_)},to(e.props)):null;if(!l&&!B?.next)return o;let E=U.get(o);return E||(E={...o,[c.kind]:y(Ro,n,To)},U.set(o,E)),E}const bo="What this card does when a shopper points at it, or taps it on a phone. Highlight fills it with the surface color and turns its text the main color.",yo={none:()=>i(O,{}),[A]:()=>i(F,{})},oe=r("desktop",{...v(V({label:u("Hover effect"),options:k.map(o=>({value:o,label:u(x[o]),picture:yo[o]()})),fallback:"none"}),{type:"select",label:"Hover effect",options:k.map(o=>({value:o,label:x[o]}))}),description:bo});function ee(){const o={any:[P("none"),{field:h,is:A}]};return{...Ko("none"),[R]:H(o)}}export{oe as BOX_HIGHLIGHT_ROW,ee as boxHoverFields,Qo as cardHoverFields,Jo as hoverFields,$o as offerNextPicture,Ko as pictureHoverFields};
1
+ import{jsx as i}from"react/jsx-runtime";import{AccentIcon as G,ContrastIcon as W,ExpandIcon as X,FinishIcon as z,ImagesIcon as Y,NoSymbolIcon as f,HoverLiftIcon as j,HoverNextImageIcon as Z,HoverRotateIcon as q,HoverZoomIcon as O,OpacityIcon as J}from"efficient-easel/icons";import{customize as Q,describedAs as w,group as $}from"efficient-easel/screen/lib/document/box-fields";import{effectTiles as v}from"efficient-easel/screen/lib/document/effect-tiles";import{deviceField as n}from"efficient-easel/screen/lib/document/device-fields";import{NoControlMark as ee,noControlField as oe}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{BOX_DARKEN as p}from"../../../format/lib/content/box-background.js";import{cardTemplateOwner as te}from"../../../format/lib/content/card-template.js";import{angleRow as re,segmented as V,select as ne,slider as N}from"../document/box-fields.js";import{say as u}from"../../../format/lib/editor-words.js";import{withShowWhen as a}from"../../../format/lib/document/show-when-attach.js";import{animationDelayField as T,animationDurationField as D,showsWhatRuns as H}from"./AnimationDurationRow.js";import{BOX_HIGHLIGHT as S,BOX_HOVER_KINDS as A,BOX_HOVER_LABELS as C,CARD_HOVER_KEYS as c,CARD_HOVER_KINDS as se,CARD_HOVER_SECTIONS as ie,CARD_HOVER_TURN as ce,HOVER_KEY as h,HOVER_MEDIA_COVERS as ae,HOVER_MEDIA_COVER_LABELS as pe,HOVER_MEDIA_DEFAULTS as m,HOVER_MEDIA_GROUPS as he,HOVER_MEDIA_GROUP_LABELS as de,HOVER_MEDIA_KINDS as _e,HOVER_MEDIA_KIND_LABELS as le,HOVER_KIND_LABELS as k,NEXT_PICTURE_BLOCKS as x,NEXT_PICTURE_HOVER_KINDS as ue,OLD_SPIN_KEY as Ee,PART_HOVER_KINDS as g,PICTURE_HOVER_KEYS as K,PICTURE_HOVER_KINDS as Re,PICTURE_HOVER_ZOOM as d,cardHoverAngleOf as He,cardHoverKindOf as me,cardRotatesRule as Ie,cardShowsNextRule as P,HOVER_GROUP_KEY as E,pictureHoverKindOf as fe,pictureHoverMoveRule as Oe,pictureHoverRunsRule as b,pictureHoverTimedRule as we}from"../../../format/lib/animation/hover.js";const R=e=>n("desktop",$("Hover",{dot:e})),L=()=>n("desktop",Q()),ve="What this does when a shopper points at it, or taps it on a phone.",Ve="What this picture does when a shopper points at it. Black and white shows it in grey until then. A phone shows its colour.",Ne="What this picture does when a shopper points at the card. Show next image covers the card or the picture with this product's photos, with arrows; a phone shows the picture as it is. Black and white shows it in grey until then.",Te="What each card does when a shopper points at it. Show next image covers the card with this product's photos, with arrows; a phone shows the card as it is. Rotate turns the wheel picture.",De="Which of the product's pictures the card shows.",Se="Same finish shows the photos of the finish the card shows, else the first group.",Ae="Whole card hides the words under the photo. Picture keeps the words and swatches in view.",Ce={none:()=>i(f,{}),nextImage:()=>i(Z,{}),rotate:()=>i(q,{}),zoom:()=>i(O,{}),lift:()=>i(j,{}),mono:()=>i(W,{})};function I(e,o){const s=v({label:u("Hover effect"),options:e.map(t=>({value:t,label:u(k[t]),picture:Ce[t]()})),fallback:o});return w(s,{type:"select",label:"Hover effect",options:e.map(t=>({value:t,label:k[t]}))})}function je(){return{[E]:R({field:h,in:g.filter(e=>e!=="none")}),[h]:n("desktop",{...I(g,"none"),description:ve})}}function Ze(e){const o=Ie(e),s=P(),t=re(ce);return{[E]:R({any:[o,s]}),[c.kind]:n("desktop",{...H(I(se,e),(r,_)=>me(_??{},e)),description:Te}),...U(s),[Ee]:oe({type:"custom",render:()=>i(ee,{})},"always"),_cHover:L(),[c.angle]:n("desktop",a(H(t,r=>He(r)),o)),[c.duration]:n("desktop",a(D("hover"),o)),[c.delay]:n("desktop",a(T("hover"),o))}}function U(e){const o=ne("Type",i(Y,{}),_e.map(r=>({value:r,label:le[r]})),m.kind),s=V("Group",i(z,{}),he.map(r=>({value:r,label:de[r]})),m.group),t=V("Covers",i(X,{}),ae.map(r=>({value:r,label:pe[r]})),m.cover);return{[c.mediaKind]:n("desktop",a({...o,description:De},e)),[c.mediaGroup]:n("desktop",a({...s,description:Se},e)),[c.cover]:n("desktop",a({...t,description:Ae},e))}}function ke(e,o=""){const s=b(e),t=we(e);return{[E]:R(s),[c.kind]:y(Re,e,Ve),...x.includes(o)?U(P()):{},_cHover:L(),...x.includes(o)?xe():{},[c.duration]:n("desktop",a(D("hover"),t)),[c.delay]:n("desktop",a(T("hover"),t))}}function xe(){const e=Oe(),o=N("Zoom",i(O,{}),d.min,d.max,d.step,d.min,d.unit),s=N("Darken on hover",i(J,{}),p.min,p.max,p.step,p.fallback,p.unit);return{[K.zoom]:n("desktop",a(o,e)),[K.darken]:n("desktop",a(s,e))}}function y(e,o,s){const t=n("desktop",{...H(I(e,o),r=>fe({[h]:r},o,e)),description:s});return Object.assign(t,{[B]:o})}const B="sfPictureResting",M=new WeakMap;function qe(e,o,s){const t=e[c.kind],r=t?.[B];if(!t||!r)return e;const _=o.props?.[h]==="nextImage",F=_?null:te(s.appState,o.props?.id);if(!_&&!ie.includes(String(F?.type??"")))return e;let l=M.get(e);return l||(l={...e,[c.kind]:y(ue,r,Ne)},M.set(e,l)),l}const ge="What this card does when a shopper points at it, or taps it on a phone. Highlight fills it with the surface color and turns its text the main color.",Ke={none:()=>i(f,{}),[S]:()=>i(G,{})},Je=n("desktop",{...w(v({label:u("Hover effect"),options:A.map(e=>({value:e,label:u(C[e]),picture:Ke[e]()})),fallback:"none"}),{type:"select",label:"Hover effect",options:A.map(e=>({value:e,label:C[e]}))}),description:ge});function Qe(){const e={any:[b("none"),{field:h,is:S}]};return{...ke("none"),[E]:R(e)}}export{Je as BOX_HIGHLIGHT_ROW,Qe as boxHoverFields,Ze as cardHoverFields,je as hoverFields,qe as offerNextPicture,ke as pictureHoverFields};
@@ -1,2 +1,2 @@
1
- import{jsx as o,jsxs as C}from"react/jsx-runtime";import{accentItalicCss as $,storedTextStyles as K,textStylesCss as X}from"../../../render/lib/text-styles/site-text-styles.js";import{pageWidthMarker as Y,PAGE_WIDTH_ATTR as q,siteWidthTokens as J,siteGutterTokens as Q,siteGutterPhoneClass as U,siteGutterPhoneTokens as Z,heroBackgroundTokens as ee}from"../../../format/lib/content/page-width.js";import{siteBlockGapPhoneClass as te,siteBlockGapPhoneTokens as oe,siteBlockGapTokens as ne}from"../../../format/lib/content/container-gap.js";import{usePreviewHeader as re}from"../../../render/components/PreviewHeaderContext.js";import{SitePhotographyProvider as se}from"../../../render/components/SitePhotographyContext.js";import{CORNER_STYLE_TO_PX as ae,normalizeCornerStyle as ie,normalizeCornerRadius as de,themeColorStyle as ce,typeSizesStyle as le,headingTypographyStyle as he,normalizeHeadingTypography as pe,themeAccentStyle as me,themeButtonStyle as fe,themePresetAccentVars as ue,themeSurfaceStyle as Se,siteCornerRadiusTokens as ge,shadowColorTokens as ye,headingCompressionAttr as xe,cardShadowAttr as Te,cardGapAttr as ke,hoverEffectAttr as Ce}from"../../../format/lib/theme.js";import{fontRoleStyle as Pe}from"../../../format/lib/fonts.js";import{wordStyleTokens as Ee}from"../../../format/lib/word-styles.js";import{isStandaloneSectionDocument as Ae,pageHasHeaderSection as P,pageTakesTopSpace as Ge,topSpaceMarker as ve,TOP_SPACE_ATTR as _e,HEADER_CLEARANCE_CLASS as Be}from"../../../render/lib/document/header-clearance.js";import{leadSectionInk as we,HEADER_INK_ATTR as Re}from"../../../render/lib/document/header-ink.js";import{useEasel as Ie}from"efficient-easel/easel";import{useCardContentSwitchPass as We}from"../../components/useCardContentSwitchPass.js";import{pageBackgroundVars as He}from"../../../format/lib/content/page-background.js";import{pageWidthTokens as Ne}from"../../../render/lib/document/page-frame.js";import{EditingBridgesProvider as be}from"../../../render/lib/document/editing-bridges.js";import De from"../../components/SectionTextPartBridge.js";import{PageContentsFromDocument as E}from"../../../render/components/PageContentsContext.js";const ze={SectionTextParts:De};import{PageWidthWrapper as lt,PublishedPageFrame as ht,pageWidthTokens as pt}from"../../../render/lib/document/page-frame.js";const je="color-mix(in oklab, var(--bg) 40%, #ffffff)",Fe="12vh";function Ve({style:n,children:a}){const{appState:i}=Ie(u=>u),t=i.data.content,r=i.data.root;if(Ae(t))return o("div",{className:"sf-themed-content",style:{...n,background:je,minHeight:"100vh",paddingBottom:Fe},children:o("div",{style:{background:"var(--bg)"},children:o(E,{content:t,children:a})})});const d=P(t)&&Ge(r,t),c=P(t)?ve(r,t):null,p=c?{[_e]:c}:null,l=Y(r?.widthChoice),m=l?{[q]:l}:null,h=d?null:we(t),f=h?{[Re]:h}:null;return o("div",{className:`sf-themed-content${d?` ${Be}`:""}`,style:n,...f,...p,...m,children:o("div",{style:{background:"var(--bg)",minHeight:"100%"},children:o(E,{content:t,children:a})})})}function at({propsTheme:n,propsFonts:a,propsCornerStyle:i,propsCornerRadiusPx:t,propsHeadingCompression:r,propsHeadingTypography:d,pageBackground:c,chromeInheritsSiteBackground:p,suppressPreviewNav:l,footer:m,overlay:h,children:f}){const{theme:u,fonts:A,sizes:G,cornerRadiusPx:v,cardShadow:S,shadowColor:_,cardGap:B,hoverEffect:g,headingCompression:w,siteWidth:R,siteGutter:I,siteGutterPhone:y,blockGap:W,blockGapPhone:x,headingTypography:H,heroBackgroundFollowsWidth:N,photographyGrayscale:b,textStyles:D,wordStyles:z,themeFromDocument:e}=re();We();const s=e?n:u,j=e?a:A,F=e?void 0:G,V=e?t===void 0?ae[ie(i)]:de(t):v,L=e?r:w,T=e?d:H,k=[X(K(e?void 0:D)),$(pe(T).italicStrong)].filter(Boolean).join(`
2
- `),O=Ne(),M={...ce(s),...le(F),...he(T),...O.style,...p?{}:He(c)};return C("div",{className:`sf-theme-surfaces sf-theme-accent ${[U(e?void 0:y),te(e?void 0:x)].filter(Boolean).join(" ")}`.trim(),style:{...Pe(j),...Ee(e?null:z),...me(s),...fe(s),...ue(s),...Se(s),...ge(V),...ye(e?void 0:S,e?void 0:_,e?void 0:g),...J(e?void 0:R),...Q(e?void 0:I),...Z(e?void 0:y),...ne(e?void 0:W),...oe(e?void 0:x),...ee(e?void 0:N)},"data-sf-headings":xe(L),"data-sf-card-shadow":e?void 0:Te(S),"data-sf-card-gap":e?void 0:ke(B),"data-sf-card-hover":e?void 0:Ce(g),onClickCapture:l,children:[k?o("style",{"data-sf-text-styles":"",dangerouslySetInnerHTML:{__html:k}}):null,o(se,{grayscale:e?void 0:b,children:C(be,{value:ze,children:[o(Ve,{style:M,children:f}),m,h]})})]})}const it=n=>{n.target?.closest?.("a")&&n.preventDefault()};export{ze as EDITING_BRIDGES,Ve as EditorPageBody,at as EditorThemedBody,lt as PageWidthWrapper,ht as PublishedPageFrame,je as SECTION_PREVIEW_CANVAS,Fe as SECTION_PREVIEW_CANVAS_TAIL,pt as pageWidthTokens,it as suppressPreviewNav};
1
+ import{jsx as o,jsxs as P}from"react/jsx-runtime";import{accentItalicCss as $,storedTextStyles as K,textStylesCss as X}from"../../../render/lib/text-styles/site-text-styles.js";import{pageWidthMarker as Y,PAGE_WIDTH_ATTR as q,siteWidthTokens as J,siteGutterTokens as Q,siteGutterPhoneClass as U,siteGutterPhoneTokens as Z,heroBackgroundTokens as ee}from"../../../format/lib/content/page-width.js";import{siteBlockGapPhoneClass as te,siteBlockGapPhoneTokens as oe,siteBlockGapTokens as ne}from"../../../format/lib/content/container-gap.js";import{usePreviewHeader as re}from"../../../render/components/PreviewHeaderContext.js";import{SitePhotographyProvider as se}from"../../../render/components/SitePhotographyContext.js";import{ThemeLightInkProvider as ae}from"../../../render/components/ThemeLightInkContext.js";import{CORNER_STYLE_TO_PX as ie,normalizeCornerStyle as de,normalizeCornerRadius as ce,themeColorStyle as le,themeLightInk as he,typeSizesStyle as pe,headingTypographyStyle as me,normalizeHeadingTypography as fe,themeAccentStyle as ue,themeButtonStyle as ge,themePresetAccentVars as Se,themeSurfaceStyle as ye,siteCornerRadiusTokens as xe,shadowColorTokens as Te,headingCompressionAttr as ke,cardShadowAttr as Pe,cardGapAttr as Ce,hoverEffectAttr as Ee}from"../../../format/lib/theme.js";import{fontRoleStyle as Ae}from"../../../format/lib/fonts.js";import{wordStyleTokens as ve}from"../../../format/lib/word-styles.js";import{isStandaloneSectionDocument as Ge,pageHasHeaderSection as C,pageTakesTopSpace as _e,topSpaceMarker as Be,TOP_SPACE_ATTR as we,HEADER_CLEARANCE_CLASS as Ie}from"../../../render/lib/document/header-clearance.js";import{leadSectionInk as Re,HEADER_INK_ATTR as We}from"../../../render/lib/document/header-ink.js";import{useEasel as He}from"efficient-easel/easel";import{useCardContentSwitchPass as Ne}from"../../components/useCardContentSwitchPass.js";import{pageBackgroundVars as be}from"../../../format/lib/content/page-background.js";import{pageWidthTokens as De}from"../../../render/lib/document/page-frame.js";import{EditingBridgesProvider as ze}from"../../../render/lib/document/editing-bridges.js";import Le from"../../components/SectionTextPartBridge.js";import{PageContentsFromDocument as E}from"../../../render/components/PageContentsContext.js";const je={SectionTextParts:Le};import{PageWidthWrapper as mt,PublishedPageFrame as ft,pageWidthTokens as ut}from"../../../render/lib/document/page-frame.js";const Fe="color-mix(in oklab, var(--bg) 40%, #ffffff)",Ve="12vh";function Oe({style:n,children:a}){const{appState:i}=He(u=>u),t=i.data.content,s=i.data.root;if(Ge(t))return o("div",{className:"sf-themed-content",style:{...n,background:Fe,minHeight:"100vh",paddingBottom:Ve},children:o("div",{style:{background:"var(--bg)"},children:o(E,{content:t,children:a})})});const d=C(t)&&_e(s,t),c=C(t)?Be(s,t):null,p=c?{[we]:c}:null,l=Y(s?.widthChoice),m=l?{[q]:l}:null,h=d?null:Re(t),f=h?{[We]:h}:null;return o("div",{className:`sf-themed-content${d?` ${Ie}`:""}`,style:n,...f,...p,...m,children:o("div",{style:{background:"var(--bg)",minHeight:"100%"},children:o(E,{content:t,children:a})})})}function ct({propsTheme:n,propsFonts:a,propsCornerStyle:i,propsCornerRadiusPx:t,propsHeadingCompression:s,propsHeadingTypography:d,pageBackground:c,chromeInheritsSiteBackground:p,suppressPreviewNav:l,footer:m,overlay:h,children:f}){const{theme:u,fonts:A,sizes:v,cornerRadiusPx:G,cardShadow:g,shadowColor:_,cardGap:B,hoverEffect:S,headingCompression:w,siteWidth:I,siteGutter:R,siteGutterPhone:y,blockGap:W,blockGapPhone:x,headingTypography:H,heroBackgroundFollowsWidth:N,photographyGrayscale:b,textStyles:D,wordStyles:z,themeFromDocument:e}=re();Ne();const r=e?n:u,L=e?a:A,j=e?void 0:v,F=e?t===void 0?ie[de(i)]:ce(t):G,V=e?s:w,T=e?d:H,k=[X(K(e?void 0:D)),$(fe(T).italicStrong)].filter(Boolean).join(`
2
+ `),O=De(),M={...le(r),...pe(j),...me(T),...O.style,...p?{}:be(c)};return P("div",{className:`sf-theme-surfaces sf-theme-accent ${[U(e?void 0:y),te(e?void 0:x)].filter(Boolean).join(" ")}`.trim(),style:{...Ae(L),...ve(e?null:z),...ue(r),...ge(r),...Se(r),...ye(r),...xe(F),...Te(e?void 0:g,e?void 0:_,e?void 0:S),...J(e?void 0:I),...Q(e?void 0:R),...Z(e?void 0:y),...ne(e?void 0:W),...oe(e?void 0:x),...ee(e?void 0:N)},"data-sf-headings":ke(V),"data-sf-card-shadow":e?void 0:Pe(g),"data-sf-card-gap":e?void 0:Ce(B),"data-sf-card-hover":e?void 0:Ee(S),onClickCapture:l,children:[k?o("style",{"data-sf-text-styles":"",dangerouslySetInnerHTML:{__html:k}}):null,o(se,{grayscale:e?void 0:b,children:o(ze,{value:je,children:P(ae,{ink:he(r),children:[o(Oe,{style:M,children:f}),m,h]})})})]})}const lt=n=>{n.target?.closest?.("a")&&n.preventDefault()};export{je as EDITING_BRIDGES,Oe as EditorPageBody,ct as EditorThemedBody,mt as PageWidthWrapper,ft as PublishedPageFrame,Fe as SECTION_PREVIEW_CANVAS,Ve as SECTION_PREVIEW_CANVAS_TAIL,ut as pageWidthTokens,lt as suppressPreviewNav};
@@ -1,3 +1,4 @@
1
+ import { type MediaZone } from "efficient-easel/screen/lib/content/media-zones";
1
2
  import { type HoverKind, type ShowWhenRule } from "efficient-shell/format";
2
3
  export declare const HOVER_KEY = "hover";
3
4
  export declare const HOVER_GROUP_KEY = "_gHover";
@@ -42,8 +43,9 @@ export type CardHoverDrawn = {
42
43
  delay: number;
43
44
  media?: CardHoverMedia;
44
45
  };
45
- export declare const HOVER_MEDIA_KINDS: readonly ["photos", "lifestyle", "renderings", "accessories", "others"];
46
- export type HoverMediaKind = (typeof HOVER_MEDIA_KINDS)[number];
46
+ type ImageMediaZone = Exclude<MediaZone, "videos">;
47
+ export type HoverMediaKind = Exclude<ImageMediaZone, "rendering"> | "renderings";
48
+ export declare const HOVER_MEDIA_KINDS: readonly HoverMediaKind[];
47
49
  export declare const HOVER_MEDIA_KIND_LABELS: Readonly<Record<HoverMediaKind, string>>;
48
50
  export declare const HOVER_MEDIA_GROUPS: readonly ["finish", "first"];
49
51
  export type HoverMediaGroup = (typeof HOVER_MEDIA_GROUPS)[number];
@@ -72,8 +74,9 @@ export type PictureHoverDrawn = {
72
74
  kind: PictureHover;
73
75
  duration: number;
74
76
  delay: number;
75
- zoom?: string | null;
76
- darken?: number | null;
77
+ media?: CardHoverMedia;
78
+ zoom?: string;
79
+ darken?: number;
77
80
  };
78
81
  export declare const PICTURE_HOVER_KEYS: {
79
82
  readonly zoom: "hoverZoom";
@@ -85,9 +88,11 @@ export declare const PICTURE_HOVER_ZOOM: {
85
88
  readonly step: 1;
86
89
  readonly unit: "%";
87
90
  };
88
- export declare function pictureHoverZoomOf(record: Readonly<Record<string, unknown>>, kind: string): string | null;
91
+ export declare function pictureHoverZoomOf(record: Readonly<Record<string, unknown>>): string | null;
92
+ export declare function pictureHoverDarkenOf(record: Readonly<Record<string, unknown>>): number | null;
89
93
  export declare const NEXT_PICTURE_BLOCKS: readonly string[];
90
94
  export declare function pictureHoverKindOf(record: Readonly<Record<string, unknown>>, resting: PictureHover, kinds?: readonly PictureHover[]): PictureHover;
91
95
  export declare function pictureHoverOf(record: Readonly<Record<string, unknown>>, blockKey?: string): PictureHoverDrawn;
92
- export declare function pictureHoverMovesRule(): ShowWhenRule;
96
+ export declare function pictureHoverMoveRule(): ShowWhenRule;
93
97
  export declare function pictureHoverRunsRule(resting: PictureHover): ShowWhenRule;
98
+ export declare function pictureHoverTimedRule(resting: PictureHover): ShowWhenRule;
@@ -1 +1 @@
1
- import{HOVER_MOTION as m,hoverKindsOf as c,motionSeconds as a}from"efficient-shell/format";import{ANGLE_RANGE as I}from"../content/box-angle.js";import{finiteNumber as l}from"../finite-number.js";const i="hover",z="_gHover",g={none:"None",nextImage:"Show next image",rotate:"Rotate",zoom:"Zoom",lift:"Lift",mono:"Black and white"},s="highlight",S="Highlight",Z=["none",s],F={none:g.none,[s]:S};function A(e){return e[i]===s?s:"none"}const W="transition-colors hover:bg-[var(--sf-hl-bg)]! hover:[--fg:var(--sf-hl-ink)] active:bg-[var(--sf-hl-bg)]! active:[--fg:var(--sf-hl-ink)]",j="hover:[--fg:var(--sf-hl-ink)]! hover:[--fg-dim:inherit]! hover:[--site-line:inherit]! hover:[color:inherit]! active:[--fg:var(--sf-hl-ink)]! active:[--fg-dim:inherit]! active:[--site-line:inherit]! active:[color:inherit]!";function q(e,n){return A(e)!==s?null:{"--sf-hl-bg":n("surface"),"--sf-hl-ink":n("main")}}const V=c(["none","lift"]);function J(e){const n=e[i];return V.includes(n)?n:"none"}const E=c(["none","nextImage","rotate"]),r={kind:i,angle:"hoverAngle",duration:"hoverDuration",delay:"hoverDelay",mediaKind:"hoverKind",mediaGroup:"hoverGroup",cover:"hoverCover"},f="spinOnHover",O=I,R={ProductGrid:"rotate",RelatedProducts:"rotate",AlloyWheelsListing:"none"},Q=Object.keys(R);function D(e){return R[e]??"none"}const L=m.rotateFallbackDeg,k=["photos","lifestyle","renderings","accessories","others"],$={photos:"Product photos",lifestyle:"Lifestyle photos",renderings:"Renderings",accessories:"Accessories",others:"Others"},N=["finish","first"],ee={finish:"Same finish",first:"First group"},C=["card","picture"],ne={card:"Whole card",picture:"Picture"},d={kind:"photos",group:"finish",cover:"card"},p=(e,n,t)=>e.includes(n)?n:t;function K(e){return{kind:p(k,e[r.mediaKind],d.kind),group:p(N,e[r.mediaGroup],d.group),cover:p(C,e[r.cover],d.cover)}}function oe(){return{field:r.kind,is:"nextImage"}}function G(e,n){const t=e[r.kind];if(E.includes(t))return t;const o=e[f];return typeof o=="boolean"?o?"rotate":"none":n}function T(e){const n=l(e);return n===void 0?L:Math.min(O.max,Math.max(O.min,n))}function te(e,n){const t=D(n),o=G(e,t);return{kind:o,angle:o==="rotate"?T(e[r.angle]):null,duration:a("hover","duration",o==="rotate"?e[r.duration]:void 0),delay:a("hover","delay",o==="rotate"?e[r.delay]:void 0),...o==="nextImage"?{media:K(e)}:{}}}function re(e){const n={field:r.kind,in:[...E]};return{any:[{field:r.kind,is:"rotate"},{all:[{not:n},e==="rotate"?{not:{field:f,is:!1}}:{field:f,is:!0}]}]}}const x=c(["none","mono"]),M=c(["none","nextImage","mono"]),v={ImageBlock:"none",Manifesto:"none",Split:"none",ContactLocations:"mono"},ie=Object.keys(v);function y(e){return v[e]??"none"}const H={zoom:"hoverZoom",darken:"hoverDarken"},_={min:100,max:150,step:1,unit:"%"},u=["nextImage"];function B(e,n){if(!u.includes(n))return null;const t=l(e[H.zoom]);if(t===void 0)return null;const o=Math.min(_.max,Math.max(_.min,t));return o===_.min?null:String(o/100)}function P(e,n){if(!u.includes(n))return null;const t=l(e[H.darken]);return t!==void 0&&t>0?t:null}const U=["ImageBlock"];function b(e,n,t=x){const o=e[i];return t.includes(o)?o:n}function se(e,n=""){const t=U.includes(n)?M:x,o=b(e,y(n),t),h=o!=="none";return{kind:o,duration:a("hover","duration",h?e[r.duration]:void 0),delay:a("hover","delay",h?e[r.delay]:void 0),...u.includes(o)?{zoom:B(e,o),darken:P(e,o)}:{}}}function ce(){return{field:i,in:[...u]}}function ae(e){return e==="none"?{field:i,in:["mono","nextImage"]}:{not:{field:i,is:"none"}}}export{s as BOX_HIGHLIGHT,W as BOX_HIGHLIGHT_CLASS,j as BOX_HIGHLIGHT_OVER_ROW_INK_CLASS,Z as BOX_HOVER_KINDS,F as BOX_HOVER_LABELS,O as CARD_HOVER_ANGLE,r as CARD_HOVER_KEYS,E as CARD_HOVER_KINDS,Q as CARD_HOVER_SECTIONS,L as CARD_HOVER_TURN,S as HIGHLIGHT_LABEL,z as HOVER_GROUP_KEY,i as HOVER_KEY,g as HOVER_KIND_LABELS,C as HOVER_MEDIA_COVERS,ne as HOVER_MEDIA_COVER_LABELS,d as HOVER_MEDIA_DEFAULTS,N as HOVER_MEDIA_GROUPS,ee as HOVER_MEDIA_GROUP_LABELS,k as HOVER_MEDIA_KINDS,$ as HOVER_MEDIA_KIND_LABELS,U as NEXT_PICTURE_BLOCKS,M as NEXT_PICTURE_HOVER_KINDS,f as OLD_SPIN_KEY,V as PART_HOVER_KINDS,ie as PICTURE_HOVER_BLOCKS,H as PICTURE_HOVER_KEYS,x as PICTURE_HOVER_KINDS,_ as PICTURE_HOVER_ZOOM,q as boxHighlightStyle,A as boxHoverOf,T as cardHoverAngleOf,G as cardHoverKindOf,K as cardHoverMediaOf,te as cardHoverOf,D as cardHoverResting,re as cardRotatesRule,oe as cardShowsNextRule,J as hoverOf,b as pictureHoverKindOf,ce as pictureHoverMovesRule,se as pictureHoverOf,y as pictureHoverResting,ae as pictureHoverRunsRule,B as pictureHoverZoomOf};
1
+ import{MEDIA_ZONES as g,MEDIA_ZONE_LABELS as I}from"efficient-easel/screen/lib/content/media-zones";import{HOVER_MOTION as S,hoverKindsOf as a,motionSeconds as s}from"efficient-shell/format";import{ANGLE_RANGE as A}from"../content/box-angle.js";import{finiteNumber as u}from"../finite-number.js";const i="hover",q="_gHover",D={none:"None",nextImage:"Show next image",rotate:"Rotate",zoom:"Zoom",lift:"Lift",mono:"Black and white"},c="highlight",L="Highlight",J=["none",c],Q={none:D.none,[c]:L};function V(e){return e[i]===c?c:"none"}const $="transition-colors hover:bg-[var(--sf-hl-bg)]! hover:[--fg:var(--sf-hl-ink)] active:bg-[var(--sf-hl-bg)]! active:[--fg:var(--sf-hl-ink)]",ee="hover:[--fg:var(--sf-hl-ink)]! hover:[--fg-dim:inherit]! hover:[--site-line:inherit]! hover:[color:inherit]! active:[--fg:var(--sf-hl-ink)]! active:[--fg-dim:inherit]! active:[--site-line:inherit]! active:[color:inherit]!";function ne(e,n){return V(e)!==c?null:{"--sf-hl-bg":n("surface"),"--sf-hl-ink":n("main")}}const k=a(["none","lift"]);function oe(e){const n=e[i];return k.includes(n)?n:"none"}const E=a(["none","nextImage","rotate"]),r={kind:i,angle:"hoverAngle",duration:"hoverDuration",delay:"hoverDelay",mediaKind:"hoverKind",mediaGroup:"hoverGroup",cover:"hoverCover"},f="spinOnHover",O=A,x={ProductGrid:"rotate",RelatedProducts:"rotate",AlloyWheelsListing:"none"},te=Object.keys(x);function N(e){return x[e]??"none"}const C=S.rotateFallbackDeg,K=e=>e==="rendering"?"renderings":e,T=e=>e==="renderings"?"rendering":e,m=Object.freeze(g.filter(e=>e!=="videos").map(K)),re=Object.freeze(Object.fromEntries(m.map(e=>[e,I[T(e)]]))),G=["finish","first"],ie={finish:"Same finish",first:"First group"},M=["card","picture"],ce={card:"Whole card",picture:"Picture"},d={kind:"photos",group:"finish",cover:"card"},l=(e,n,o)=>e.includes(n)?n:o;function R(e){return{kind:l(m,e[r.mediaKind],d.kind),group:l(G,e[r.mediaGroup],d.group),cover:l(M,e[r.cover],d.cover)}}function ae(){return{field:r.kind,is:"nextImage"}}function B(e,n){const o=e[r.kind];if(E.includes(o))return o;const t=e[f];return typeof t=="boolean"?t?"rotate":"none":n}function P(e){const n=u(e);return n===void 0?C:Math.min(O.max,Math.max(O.min,n))}function se(e,n){const o=N(n),t=B(e,o);return{kind:t,angle:t==="rotate"?P(e[r.angle]):null,duration:s("hover","duration",t==="rotate"?e[r.duration]:void 0),delay:s("hover","delay",t==="rotate"?e[r.delay]:void 0),...t==="nextImage"?{media:R(e)}:{}}}function ue(e){const n={field:r.kind,in:[...E]};return{any:[{field:r.kind,is:"rotate"},{all:[{not:n},e==="rotate"?{not:{field:f,is:!1}}:{field:f,is:!0}]}]}}const v=a(["none","mono"]),b=a(["none","nextImage","mono"]),h={ImageBlock:"none",Manifesto:"none",Split:"none",ContactLocations:"mono"},fe=Object.keys(h);function y(e){return h[e]??"none"}const H={zoom:"hoverZoom",darken:"hoverDarken"},p={min:100,max:150,step:1,unit:"%"};function U(e){const n=u(e[H.zoom]);if(n===void 0)return null;const o=Math.min(p.max,Math.max(p.min,n));return o===p.min?null:String(o/100)}function X(e){const n=u(e[H.darken]);return n!==void 0&&n>0?n:null}const Z=["ImageBlock"];function z(e,n,o=v){const t=e[i];return o.includes(t)?t:n}function de(e,n=""){const o=Z.includes(n)?b:v,t=z(e,y(n),o),_=t==="mono";return{kind:t,duration:s("hover","duration",_?e[r.duration]:void 0),delay:s("hover","delay",_?e[r.delay]:void 0),...t==="nextImage"?{media:R(e)}:j(e)}}function j(e){const n=U(e),o=X(e);return{...n?{zoom:n}:{},...o?{darken:o}:{}}}function le(){return{not:{field:i,is:"nextImage"}}}function pe(e){return e==="none"?{field:i,in:["mono","nextImage"]}:{not:{field:i,is:"none"}}}function _e(e){return e==="none"?{field:i,is:"mono"}:{not:{field:i,in:["none","nextImage"]}}}export{c as BOX_HIGHLIGHT,$ as BOX_HIGHLIGHT_CLASS,ee as BOX_HIGHLIGHT_OVER_ROW_INK_CLASS,J as BOX_HOVER_KINDS,Q as BOX_HOVER_LABELS,O as CARD_HOVER_ANGLE,r as CARD_HOVER_KEYS,E as CARD_HOVER_KINDS,te as CARD_HOVER_SECTIONS,C as CARD_HOVER_TURN,L as HIGHLIGHT_LABEL,q as HOVER_GROUP_KEY,i as HOVER_KEY,D as HOVER_KIND_LABELS,M as HOVER_MEDIA_COVERS,ce as HOVER_MEDIA_COVER_LABELS,d as HOVER_MEDIA_DEFAULTS,G as HOVER_MEDIA_GROUPS,ie as HOVER_MEDIA_GROUP_LABELS,m as HOVER_MEDIA_KINDS,re as HOVER_MEDIA_KIND_LABELS,Z as NEXT_PICTURE_BLOCKS,b as NEXT_PICTURE_HOVER_KINDS,f as OLD_SPIN_KEY,k as PART_HOVER_KINDS,fe as PICTURE_HOVER_BLOCKS,H as PICTURE_HOVER_KEYS,v as PICTURE_HOVER_KINDS,p as PICTURE_HOVER_ZOOM,ne as boxHighlightStyle,V as boxHoverOf,P as cardHoverAngleOf,B as cardHoverKindOf,R as cardHoverMediaOf,se as cardHoverOf,N as cardHoverResting,ue as cardRotatesRule,ae as cardShowsNextRule,oe as hoverOf,X as pictureHoverDarkenOf,z as pictureHoverKindOf,le as pictureHoverMoveRule,de as pictureHoverOf,y as pictureHoverResting,pe as pictureHoverRunsRule,_e as pictureHoverTimedRule,U as pictureHoverZoomOf};
@@ -1,3 +1,4 @@
1
+ import type { CSSProperties } from "react";
1
2
  import type { SourceRow } from "./block-sources.js";
2
3
  declare const CARD_ROW_STATES: readonly ["selected", "highlighted"];
3
4
  type CardRowStateName = (typeof CARD_ROW_STATES)[number];
@@ -6,8 +7,19 @@ export declare const CARD_STATE_ATTR = "data-sf-card-state";
6
7
  export declare const CARD_STATE_LINE_CLASS = "pointer-events-none absolute inset-0 border border-accent";
7
8
  export type CardStateLine = "frame" | "under";
8
9
  export declare const CARD_STATE_UNDER_LINE_CLASS = "pointer-events-none absolute inset-x-0 bottom-0 border-b-2 border-accent";
10
+ export declare const CARD_STATE_PICKED_CLASS = "pointer-events-none absolute inset-0 border-2 border-accent outline outline-1 -outline-offset-1 outline-accent";
11
+ export declare const CARD_STATE_PICKED_BAR_CLASS = "absolute inset-y-0 left-0 w-[3px] bg-accent";
12
+ export declare const CARD_STATE_PICKED_WASH_CLASS = "absolute -inset-[2px] -z-[1] bg-[color-mix(in_oklab,var(--accent)_14%,transparent)]";
13
+ export declare const CARD_ACTION_HOVER_CLASS = "after:pointer-events-none after:absolute after:inset-0 hover:after:border-2 hover:after:border-accent";
14
+ export declare const CARD_STATE_PICKED_INK: Readonly<Record<string, string>>;
15
+ export declare function cardStatePicked(state: CardRowState | undefined | null): boolean;
9
16
  export declare function cardStateValue(state: CardRowState | undefined | null): string;
10
- export declare function cardStateAttrs(state: CardRowState | undefined | null): Record<string, string>;
17
+ export type CardStateAttrs = {
18
+ [attribute: string]: string | CSSProperties | undefined;
19
+ className?: string;
20
+ style?: CSSProperties;
21
+ };
22
+ export declare function cardStateAttrs(state: CardRowState | undefined | null, line?: CardStateLine): CardStateAttrs;
11
23
  export declare const CARD_BADGE_FIELD = "badge";
12
24
  export declare function keyedRows(rows: readonly SourceRow[], keys?: readonly {
13
25
  key: string;
@@ -26,8 +38,11 @@ export declare function highlightOf(props: Record<string, unknown>): {
26
38
  };
27
39
  export type CardItemAction = {
28
40
  readonly press: () => void;
41
+ readonly label?: string;
42
+ readonly disabled?: boolean;
29
43
  };
30
44
  export declare function cardItemAction(item: unknown): CardItemAction | undefined;
31
45
  export declare const CARD_ACTION_ATTR = "data-sf-card-press";
32
46
  export declare const CARD_ACTION_CLASS = "absolute inset-0 -z-[1] outline-none focus-visible:z-[2] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent appearance-none bg-transparent border-0 p-0 m-0 cursor-pointer";
47
+ export declare const CARD_ACTION_OFF_CLASS = "absolute inset-0 -z-[1] outline-none focus-visible:z-[2] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent appearance-none bg-transparent border-0 p-0 m-0";
33
48
  export {};
@@ -1 +1 @@
1
- import{BOX_LINK_CLASS as a}from"./box-link.js";import{cardKeyOf as d}from"./card-template.js";const f=["selected","highlighted"],p="data-sf-card-state",T="pointer-events-none absolute inset-0 border border-accent",C="pointer-events-none absolute inset-x-0 bottom-0 border-b-2 border-accent";function u(t){return t?f.filter(e=>t[e]===!0).join(" "):""}function S(t){const e=u(t);return e?{[p]:e,className:"relative"}:{}}const A={highlighted:!0},g={},c="badge";function b(t,e=[]){return t.map((r,n)=>({...r,key:r.key||e[n]?.key||d(r,n)}))}function l(t){return!t||typeof t!="object"?!1:Object.entries(t).some(([e,r])=>e==="key"||e===c||e==="state"?!1:typeof r=="string"?r.trim()!=="":Array.isArray(r)?r.length>0:r!=null&&typeof r!="function")}function x(t,{chosen:e,badge:r}){const n=e.trim(),s=n?t.findIndex(o=>o.key===n):-1;return{rows:t.map((o,i)=>({...o,[c]:i===s?r:""})),states:t.map((o,i)=>i===s?A:g)}}function y(t){return{chosen:typeof t.highlightedCard=="string"?t.highlightedCard.trim():"",badge:typeof t.highlightBadge=="string"?t.highlightBadge:""}}function m(t){if(!t||typeof t!="object")return;const e=t.press;return typeof e=="function"?{press:e}:void 0}const R="data-sf-card-press",D=`${a} appearance-none bg-transparent border-0 p-0 m-0 cursor-pointer`;export{R as CARD_ACTION_ATTR,D as CARD_ACTION_CLASS,c as CARD_BADGE_FIELD,p as CARD_STATE_ATTR,T as CARD_STATE_LINE_CLASS,C as CARD_STATE_UNDER_LINE_CLASS,m as cardItemAction,S as cardStateAttrs,u as cardStateValue,y as highlightOf,b as keyedRows,x as markedRows,l as rowHoldsContent};
1
+ import{BOX_LINK_CLASS as u}from"./box-link.js";import{cardKeyOf as A}from"./card-template.js";import{INK as p}from"./ink.js";const _=["selected","highlighted"],a="data-sf-card-state",m="pointer-events-none absolute inset-0 border border-accent",D="pointer-events-none absolute inset-x-0 bottom-0 border-b-2 border-accent",E="pointer-events-none absolute inset-0 border-2 border-accent outline outline-1 -outline-offset-1 outline-accent",R="absolute inset-y-0 left-0 w-[3px] bg-accent",I="absolute -inset-[2px] -z-[1] bg-[color-mix(in_oklab,var(--accent)_14%,transparent)]",y="after:pointer-events-none after:absolute after:inset-0 hover:after:border-2 hover:after:border-accent",c=e=>{const r=p.find(t=>t.role===e)?.token;if(!r)throw new Error(`card-state: the palette has no ink token for "${e}"`);return r},l={[c("muted")]:`var(${c("fg")})`};function C(e){return e?.selected===!0}function S(e){return e?_.filter(r=>e[r]===!0).join(" "):""}function L(e,r="frame"){const t=S(e);return t?r==="frame"&&C(e)?{[a]:t,className:"relative isolate",style:{...l}}:{[a]:t,className:"relative"}:{}}const b={highlighted:!0},T={},f="badge";function N(e,r=[]){return e.map((t,n)=>({...t,key:t.key||r[n]?.key||A(t,n)}))}function k(e){return!e||typeof e!="object"?!1:Object.entries(e).some(([r,t])=>r==="key"||r===f||r==="state"?!1:typeof t=="string"?t.trim()!=="":Array.isArray(t)?t.length>0:t!=null&&typeof t!="function")}function O(e,{chosen:r,badge:t}){const n=r.trim(),i=n?e.findIndex(o=>o.key===n):-1;return{rows:e.map((o,s)=>({...o,[f]:s===i?t:""})),states:e.map((o,s)=>s===i?b:T)}}function K(e){return{chosen:typeof e.highlightedCard=="string"?e.highlightedCard.trim():"",badge:typeof e.highlightBadge=="string"?e.highlightBadge:""}}function B(e){if(!e||typeof e!="object")return;const{press:r,pressLabel:t,pressDisabled:n}=e;if(typeof r=="function")return{press:r,...typeof t=="string"&&t.trim()!==""?{label:t}:null,...n===!0?{disabled:!0}:null}}const H="data-sf-card-press",d=`${u} appearance-none bg-transparent border-0 p-0 m-0`,v=`${d} cursor-pointer`,P=d;export{H as CARD_ACTION_ATTR,v as CARD_ACTION_CLASS,y as CARD_ACTION_HOVER_CLASS,P as CARD_ACTION_OFF_CLASS,f as CARD_BADGE_FIELD,a as CARD_STATE_ATTR,m as CARD_STATE_LINE_CLASS,R as CARD_STATE_PICKED_BAR_CLASS,E as CARD_STATE_PICKED_CLASS,l as CARD_STATE_PICKED_INK,I as CARD_STATE_PICKED_WASH_CLASS,D as CARD_STATE_UNDER_LINE_CLASS,B as cardItemAction,L as cardStateAttrs,C as cardStatePicked,S as cardStateValue,K as highlightOf,N as keyedRows,O as markedRows,k as rowHoldsContent};
@@ -24,13 +24,18 @@ export interface CardRowFieldSpec {
24
24
  kind?: CardRowFieldKind;
25
25
  multiline?: boolean;
26
26
  alt?: string;
27
- next?: string;
28
27
  everySource?: boolean;
29
28
  fields?: readonly CardRowFieldSpec[];
30
29
  mark?: "accentItalic";
30
+ plain?: true;
31
+ }
32
+ export interface CardTemplateSlotSpec {
33
+ slot: string;
34
+ label?: string;
31
35
  }
32
36
  export interface CardTemplateSpec {
33
37
  block: string;
38
+ slots?: readonly CardTemplateSlotSpec[];
34
39
  fields: readonly CardRowFieldSpec[];
35
40
  blocks?: readonly CardTemplateBlock[];
36
41
  typedRows?: string;
@@ -51,6 +56,9 @@ export declare function isCardTemplateBlock(type: string): boolean;
51
56
  export declare function cardTemplateTypedRows(type: unknown): string;
52
57
  export declare function cardTemplateLinesBetween(type: unknown): boolean;
53
58
  export declare function hasCardTemplate(type: unknown): boolean;
59
+ export declare function cardTemplateSlotNames(type: unknown): readonly string[];
60
+ export declare function isCardTemplateSlot(type: unknown, slot: string): boolean;
61
+ export declare function cardTemplateSlotLabel(type: unknown, slot: string): string | null;
54
62
  export declare function cardTemplateFields(type: string, kind?: CardRowFieldKind): readonly CardRowFieldSpec[];
55
63
  export declare function defaultListField(type: unknown): string;
56
64
  export declare function cardListShows(props: Record<string, unknown> | null | undefined, ownerType: unknown): string;
@@ -70,12 +78,12 @@ export declare function rowFieldSpec(copy: {
70
78
  props?: Record<string, unknown>;
71
79
  } | null;
72
80
  } | null | undefined, key: string): CardRowFieldSpec | null;
81
+ export declare function rowFieldWordsArePlain(copy: Parameters<typeof rowFieldSpec>[0], key: string): boolean;
73
82
  export declare function namedRowField(props: Record<string, unknown> | null | undefined, prop?: string): string;
74
83
  export declare function cardKeyOf(row: SourceRow, index: number): string;
75
84
  export declare function cardRow(value: unknown): SourceRow;
76
85
  export declare const BOX_HIDE_WHEN_ROW_EMPTY = "hideWhenRowEmpty";
77
86
  export declare function templateBoxIsEmpty(props: Record<string, unknown>, row: SourceRow | null | undefined): boolean;
78
- export declare function rowNextPicture(item: unknown, next: string | undefined, cover?: string): string;
79
87
  export declare const ROW_BOUND_PROPS: Readonly<Record<string, Readonly<Record<string, string>>>>;
80
88
  export declare const ROW_PART_BY_WORDS: ReadonlySet<string>;
81
89
  export declare function rowPartByKey(type: string, props: Record<string, unknown> | null | undefined, key: string): boolean;
@@ -1 +1 @@
1
- import{blockSourceSpec as x,declaredBlockSource as g}from"./block-sources.js";import{isNodeList as h}from"efficient-easel/data";import{BOX_TYPE as O}from"../document/container-blocks.js";import{globalRegistry as _}from"../global-registry.js";import{nonEmptyString as w}from"../non-empty-string.js";import{accentItalicRuns as C}from"../markup.js";import{withCardsTemplate as A}from"../document/cards-template-on-read.js";import{withCardListTemplate as S}from"../document/blocks/general/CardList/item-seed.js";import{ARTICLE_BODY_BLOCK as I,withArticleBodyTemplate as E}from"../document/article-body-seed.js";import{withLogosTemplate as P}from"../document/blocks/general/Logos/card-seed.js";import{withFaqTemplate as F}from"../document/blocks/general/FAQ/card-seed.js";import{withFootprintSideTemplate as D}from"../document/blocks/general/Footprint/card-seed.js";const v="template",fe="Card template",y="CardList",B=["Text","ImageBlock","ButtonBlock","Flex"],p="rowField",W="rowLinkField";function pe(){return{type:"slot",allow:[...B]}}const M=B.filter(e=>e!=="ButtonBlock"),T="items",R="itemFields";function ye(){return{type:"slot",allow:[...M]}}const N=[{block:"OrderSummary",typedRows:"rows",linesBetween:!0,fields:[{key:"label",label:"Item"},{key:"meta",label:"Meta line"},{key:"amount",label:"Amount"}]},{block:"FAQ",typedRows:"items",fields:[{key:"question",label:"Question"},{key:"answer",label:"Answer",multiline:!0}],seedOnInsert:e=>F(e)},{block:"Footprint",typedRows:"offices",fields:[{key:"badge",label:"HQ"},{key:"role",label:"Role"},{key:"city",label:"City"},{key:"country",label:"Region · country"},{key:"address",label:"Address"},{key:"phone",label:"Phone"},{key:"linkLabel",label:"Button"},{key:"href",label:"Link",kind:"link"}],seed:e=>D(e)},{block:"Cards",typedRows:"items",fields:[{key:"num",label:"Number"},{key:"since",label:"Corner note"},{key:"label",label:"Label"},{key:"title",label:"Card title"},{key:"value",label:"Value"},{key:"body",label:"Card body",multiline:!0},{key:"href",label:"Link",kind:"link"},{key:"count",label:"Count"},{key:"badge",label:"Highlight badge",everySource:!0}],seed:e=>A("Cards",e)},{block:"ProcessSteps",fields:[{key:"eyebrow",label:"Eyebrow"},{key:"title",label:"Title",mark:"accentItalic"},{key:"copy",label:"Body",multiline:!0},{key:"image",label:"Image",kind:"image",alt:"title"},{key:"tag",label:"Image tag"},{key:"specs",label:"Specs",kind:"list",fields:[{key:"label",label:"Label"},{key:"value",label:"Value"}]}],blocks:[{type:y,label:"Card list"}]},{block:"Logos",fields:[{key:"label",label:"Name"},{key:"kind",label:"Kind"}],seed:e=>P(e)},{block:y,fields:[{key:"badge",label:"Highlight badge",everySource:!0}],typedRows:T,seed:e=>S(e)},{block:I,fields:[{key:"heading",label:"Subhead"},{key:"paragraph",label:"Paragraph",multiline:!0}],seed:e=>E(e)}];function c(){return _("efficient.card-templates",()=>new Map(N.map(e=>[e.block,e])))}function me(e){for(const t of e){if(typeof t.block!="string"||!t.block)throw new Error("A card template names no block.");const r=[];for(const o of t.blocks??[]){if(typeof o?.type!="string"||!o.type)throw new Error(`The card template of ${t.block} names an empty block.`);r.some(i=>i.type===o.type)||r.push({type:o.type,label:o.label||o.type})}const n=w(t.typedRows);c().set(t.block,{block:t.block,fields:t.fields.map(o=>({...o})),blocks:r,typedRows:n,...t.seed?{seed:t.seed}:{},...t.seedOnInsert?{seedOnInsert:t.seedOnInsert}:{},...t.linesBetween===!0?{linesBetween:!0}:{}})}}function K(e,t){const r=e?c().get(e)?.seed:void 0;return r?r(t):t}function ke(e,t){if(!(t.template===void 0||Array.isArray(t.template)&&t.template.length===0))return t;const{template:n,...o}=t,i=e?c().get(e)?.seedOnInsert:void 0,l=i?i(o):K(e,o);return l===o?t:l}function be(){for(const e of c().values())if(e.blocks?.length)return!0;return!1}function xe(e){return c().get(e)?.blocks??[]}function ge(e){for(const t of c().values())if(t.blocks?.some(r=>r.type===e))return!0;return!1}function we(e){return typeof e=="string"&&c().get(e)?.typedRows||""}function Be(e){return typeof e=="string"&&c().get(e)?.linesBetween===!0}function j(e){return typeof e=="string"&&c().has(e)}function H(e,t){const r=c().get(e)?.fields??[];return t?r.filter(n=>(n.kind??"text")===t):r}function Y(e){return typeof e=="string"?H(e,"list")[0]?.key??"":""}function Q(e,t){return m(e)||Y(t)}function L(e,t){const r=typeof e?.type=="string"?e.type:"";if(!r)return[];const n=c().get(r)?.fields??[],o=x(g(e?.props))?.fields,i=o?.length?[...o.map(l=>({...l})),...n.filter(l=>l.everySource&&!o.some(s=>s.key===l.key))]:n;return t?i.filter(l=>(l.kind??"text")===t):i}function U(e,t,r){return e?r?L(r).find(n=>n.key===t)??null:c().get(e)?.fields.find(n=>n.key===t)??null:null}function $(e,t){return!e||!t?null:e.fields?.find(r=>r.key===t)??U(e.ownerType,t,e.owner)}function m(e,t=p){const r=e?.[t];return typeof r=="string"?r.trim():""}function Te(e,t){return e.key||String(t+1)}function Re(e){const t={};if(e&&typeof e=="object"&&!Array.isArray(e))for(const[r,n]of Object.entries(e))typeof n=="string"&&(t[r]=n);return t}const q="hideWhenRowEmpty";function Le(e,t){const r=e[q];return!t||!Array.isArray(r)||!r.length?!1:r.every(n=>typeof n!="string"||!t[n]?.trim())}function he(e,t,r=""){const n=t&&e&&typeof e=="object"?e[t]:void 0;if(!Array.isArray(n))return"";for(const o of n){const i=typeof o=="string"?o:o?.src,l=w(typeof i=="string"?i.trim():void 0);if(l&&l!==r.trim())return l}return""}const k={Text:{text:p},ImageBlock:{src:p},ButtonBlock:{label:p,href:W},LogoBlock:{alt:p},Breadcrumb:{currentCrumb:p}},Oe=k,V=new Set(["ButtonBlock.label","LogoBlock.alt"]);function _e(e,t,r){return X(e,t,r)&&!V.has(`${e}.${r}`)}function X(e,t,r){return z(e,t,r)!==""}function z(e,t,r){const n=k[e]?.[r];return n?m(t,n):""}function G(e,t){return!t||!e?null:e[t]??""}function Ce(e,t,r,n,o){if(!r)return t;let i=null;for(const[l,s]of Object.entries(k[e]??{})){const d=m(t,s),a=G(r,d);a!==null&&(i??={...t},i[l]=$({ownerType:n,fields:o},d)?.mark==="accentItalic"?C(a):a)}return i??t}function b(e,t){const r=e?.data?.content;if(!Array.isArray(r)||typeof t!="string")return;const n=(i,l)=>{for(const s of i){if(s?.props?.id===t)return l;for(const[d,a]of Object.entries(s?.props??{})){if(!h(a))continue;const u=d===v&&j(s.type)?{owner:s,direct:!0,nested:l!==null,underBox:!1}:l&&{owner:l.owner,direct:!1,nested:l.nested,underBox:l.underBox||s.type===O},f=n(a,u);if(f!==void 0)return f}}},o=n(r,null);return o===void 0?null:o}function J(e,t){const r=b(e,t);return r&&r.owner}function Ae(e,t){const r=b(e,t);return r&&(r.direct?r.owner:null)}function Se(e,t){const r=b(e,t);if(r!==void 0)return r===null?{inCopy:!1,nestedCopy:!1,underBox:!1}:{inCopy:!0,nestedCopy:r.nested,underBox:r.underBox}}function Ie(e,t,r){if(t?.type!==y)return[];const n=J(e,t.props?.id);if(!n){const l=x(g(t.props))?.fields,s=l?.length?l.map(u=>({...u})):Z(t.props),d=(c().get(y)?.fields??[]).filter(u=>u.everySource&&!s.some(f=>f.key===u.key)),a=[...s,...d];return r?a.filter(u=>(u.kind??"text")===r):a}const o=Q(t.props,n.type),i=o&&L(n,"list").find(l=>l.key===o)?.fields||[];return r?i.filter(l=>(l.kind??"text")===r):i}function Ee(e,t){return{[p]:"",[T]:e.map(r=>({...r})),[R]:t.map(r=>({...r}))}}function Z(e,t){const r=e?.[R];if(!Array.isArray(r))return[];const n=r.flatMap(o=>{if(!o||typeof o!="object")return[];const{key:i,label:l,kind:s,multiline:d,alt:a,next:u}=o;if(typeof i!="string"||!i||typeof l!="string")return[];const f=s==="image"||s==="link"||s==="colour"?s:void 0;return[{key:i,label:l,...f?{kind:f}:{},...d===!0?{multiline:!0}:{},...typeof a=="string"&&a?{alt:a}:{},...typeof u=="string"&&u?{next:u}:{}}]});return t?n.filter(o=>(o.kind??"text")===t):n}export{q as BOX_HIDE_WHEN_ROW_EMPTY,R as CARD_LIST_FIELDS,M as CARD_LIST_ITEM_BLOCKS,T as CARD_LIST_ROWS,y as CARD_LIST_TYPE,p as CARD_ROW_FIELD_PROP,W as CARD_ROW_LINK_PROP,B as CARD_TEMPLATE_BLOCKS,fe as CARD_TEMPLATE_LABEL,v as CARD_TEMPLATE_SLOT,Oe as ROW_BOUND_PROPS,V as ROW_PART_BY_WORDS,Se as cardCopyPlace,Te as cardKeyOf,Ie as cardListFieldsOf,ye as cardListItemSlot,Ee as cardListProps,Q as cardListShows,Re as cardRow,xe as cardTemplateBlocks,Ae as cardTemplateCardOwner,U as cardTemplateField,H as cardTemplateFields,L as cardTemplateFieldsOf,Be as cardTemplateLinesBetween,J as cardTemplateOwner,pe as cardTemplateSlot,we as cardTemplateTypedRows,be as cardTemplatesNameBlocks,Y as defaultListField,j as hasCardTemplate,ge as isCardTemplateBlock,m as namedRowField,me as registerCardTemplates,X as rowBound,z as rowFieldOf,$ as rowFieldSpec,G as rowFieldText,Ce as rowFilledProps,he as rowNextPicture,_e as rowPartByKey,Le as templateBoxIsEmpty,ke as templateOnInsert,K as templateOnRead};
1
+ import{blockSourceSpec as x,declaredBlockSource as w}from"./block-sources.js";import{isNodeList as C}from"efficient-easel/data";import{BOX_TYPE as _}from"../document/container-blocks.js";import{globalRegistry as A}from"../global-registry.js";import{nonEmptyString as T}from"../non-empty-string.js";import{accentItalicRuns as I}from"../markup.js";import{withCardsTemplate as E}from"../document/cards-template-on-read.js";import{withCardListTemplate as F}from"../document/blocks/general/CardList/item-seed.js";import{ARTICLE_BODY_BLOCK as P,withArticleBodyTemplate as D}from"../document/article-body-seed.js";import{withLogosTemplate as v}from"../document/blocks/general/Logos/card-seed.js";import{withFaqTemplate as W}from"../document/blocks/general/FAQ/card-seed.js";import{withFootprintSideTemplate as M}from"../document/blocks/general/Footprint/card-seed.js";const B="template",N="Card template",y="CardList",h=["Text","ImageBlock","ButtonBlock","Flex"],p="rowField",K="rowLinkField";function be(){return{type:"slot",allow:[...h]}}const j=h.filter(e=>e!=="ButtonBlock"),L="items",R="itemFields";function ke(){return{type:"slot",allow:[...j]}}const H=[{block:"OrderSummary",typedRows:"rows",linesBetween:!0,fields:[{key:"label",label:"Item"},{key:"meta",label:"Meta line"},{key:"amount",label:"Amount"}]},{block:"FAQ",typedRows:"items",fields:[{key:"question",label:"Question"},{key:"answer",label:"Answer",multiline:!0}],seedOnInsert:e=>W(e)},{block:"Footprint",typedRows:"offices",fields:[{key:"badge",label:"HQ",plain:!0},{key:"role",label:"Role"},{key:"city",label:"City"},{key:"country",label:"Region · country"},{key:"address",label:"Address"},{key:"phone",label:"Phone"},{key:"linkLabel",label:"Button"},{key:"href",label:"Link",kind:"link"}],seed:e=>M(e)},{block:"Cards",typedRows:"items",fields:[{key:"num",label:"Number"},{key:"since",label:"Corner note"},{key:"label",label:"Label"},{key:"title",label:"Card title"},{key:"value",label:"Value"},{key:"body",label:"Card body",multiline:!0},{key:"href",label:"Link",kind:"link"},{key:"count",label:"Count"},{key:"badge",label:"Highlight badge",everySource:!0,plain:!0}],seed:e=>E("Cards",e)},{block:"ProcessSteps",fields:[{key:"eyebrow",label:"Eyebrow"},{key:"title",label:"Title",mark:"accentItalic"},{key:"copy",label:"Body",multiline:!0},{key:"image",label:"Image",kind:"image",alt:"title"},{key:"tag",label:"Image tag"},{key:"specs",label:"Specs",kind:"list",fields:[{key:"label",label:"Label"},{key:"value",label:"Value"}]}],blocks:[{type:y,label:"Card list"}]},{block:"Logos",fields:[{key:"label",label:"Name"},{key:"kind",label:"Kind"}],seed:e=>v(e)},{block:y,fields:[{key:"badge",label:"Highlight badge",everySource:!0,plain:!0}],typedRows:L,seed:e=>F(e)},{block:P,fields:[{key:"heading",label:"Subhead"},{key:"paragraph",label:"Paragraph",multiline:!0}],seed:e=>D(e)}];function a(){return A("efficient.card-templates",()=>new Map(H.map(e=>[e.block,e])))}function ge(e){for(const t of e){if(typeof t.block!="string"||!t.block)throw new Error("A card template names no block.");const r=[];for(const o of t.blocks??[]){if(typeof o?.type!="string"||!o.type)throw new Error(`The card template of ${t.block} names an empty block.`);r.some(l=>l.type===o.type)||r.push({type:o.type,label:o.label||o.type})}const n=[];for(const o of t.slots??[]){if(typeof o?.slot!="string"||!o.slot)throw new Error(`The card template of ${t.block} names an empty slot.`);const l=T(o.label);n.some(s=>s.slot===o.slot)||n.push(l?{slot:o.slot,label:l}:{slot:o.slot})}const i=T(t.typedRows);a().set(t.block,{block:t.block,...n.length?{slots:n}:{},fields:t.fields.map(o=>({...o})),blocks:r,typedRows:i,...t.seed?{seed:t.seed}:{},...t.seedOnInsert?{seedOnInsert:t.seedOnInsert}:{},...t.linesBetween===!0?{linesBetween:!0}:{}})}}function Y(e,t){const r=e?a().get(e)?.seed:void 0;return r?r(t):t}function xe(e,t){const r=$(e),n=(r.length?r:[B]).filter(s=>t[s]===void 0||Array.isArray(t[s])&&t[s].length===0);if(!n.length)return t;const i={...t};for(const s of n)delete i[s];const o=e?a().get(e)?.seedOnInsert:void 0,l=o?o(i):Y(e,i);return l===i?t:l}function we(){for(const e of a().values())if(e.blocks?.length)return!0;return!1}function Te(e){return a().get(e)?.blocks??[]}function Be(e){for(const t of a().values())if(t.blocks?.some(r=>r.type===e))return!0;return!1}function he(e){return typeof e=="string"&&a().get(e)?.typedRows||""}function Le(e){return typeof e=="string"&&a().get(e)?.linesBetween===!0}function Re(e){return typeof e=="string"&&a().has(e)}const U=[{slot:B}];function m(e){if(typeof e!="string")return[];const t=a().get(e);return t?t.slots??U:[]}function $(e){return m(e).map(t=>t.slot)}function Q(e,t){return m(e).some(r=>r.slot===t)}function Oe(e,t){const r=m(e).find(n=>n.slot===t);return r?r.label??N:null}function q(e,t){const r=a().get(e)?.fields??[];return t?r.filter(n=>(n.kind??"text")===t):r}function V(e){return typeof e=="string"?q(e,"list")[0]?.key??"":""}function X(e,t){return b(e)||V(t)}function O(e,t){const r=typeof e?.type=="string"?e.type:"";if(!r)return[];const n=a().get(r)?.fields??[],i=x(w(e?.props))?.fields,o=i?.length?[...i.map(l=>({...l})),...n.filter(l=>l.everySource&&!i.some(s=>s.key===l.key))]:n;return t?o.filter(l=>(l.kind??"text")===t):o}function z(e,t,r){return e?r?O(r).find(n=>n.key===t)??null:a().get(e)?.fields.find(n=>n.key===t)??null:null}function S(e,t){return!e||!t?null:e.fields?.find(r=>r.key===t)??z(e.ownerType,t,e.owner)}function Se(e,t){return S(e,t)?.plain===!0}function b(e,t=p){const r=e?.[t];return typeof r=="string"?r.trim():""}function Ce(e,t){return e.key||String(t+1)}function _e(e){const t={};if(e&&typeof e=="object"&&!Array.isArray(e))for(const[r,n]of Object.entries(e))typeof n=="string"&&(t[r]=n);return t}const G="hideWhenRowEmpty";function Ae(e,t){const r=e[G];return!t||!Array.isArray(r)||!r.length?!1:r.every(n=>typeof n!="string"||!t[n]?.trim())}const k={Text:{text:p},ImageBlock:{src:p},ButtonBlock:{label:p,href:K},LogoBlock:{alt:p},Breadcrumb:{currentCrumb:p}},Ie=k,J=new Set(["ButtonBlock.label","LogoBlock.alt"]);function Ee(e,t,r){return Z(e,t,r)&&!J.has(`${e}.${r}`)}function Z(e,t,r){return ee(e,t,r)!==""}function ee(e,t,r){const n=k[e]?.[r];return n?b(t,n):""}function te(e,t){return!t||!e?null:e[t]??""}function Fe(e,t,r,n,i){if(!r)return t;let o=null;for(const[l,s]of Object.entries(k[e]??{})){const f=b(t,s),c=te(r,f);c!==null&&(o??={...t},o[l]=S({ownerType:n,fields:i},f)?.mark==="accentItalic"?I(c):c)}return o??t}function g(e,t){const r=e?.data?.content;if(!Array.isArray(r)||typeof t!="string")return;const n=(o,l)=>{for(const s of o){if(s?.props?.id===t)return l;for(const[f,c]of Object.entries(s?.props??{})){if(!C(c))continue;const u=Q(s.type,f)?{owner:s,direct:!0,nested:l!==null,underBox:!1}:l&&{owner:l.owner,direct:!1,nested:l.nested,underBox:l.underBox||s.type===_},d=n(c,u);if(d!==void 0)return d}}},i=n(r,null);return i===void 0?null:i}function re(e,t){const r=g(e,t);return r&&r.owner}function Pe(e,t){const r=g(e,t);return r&&(r.direct?r.owner:null)}function De(e,t){const r=g(e,t);if(r!==void 0)return r===null?{inCopy:!1,nestedCopy:!1,underBox:!1}:{inCopy:!0,nestedCopy:r.nested,underBox:r.underBox}}function ve(e,t,r){if(t?.type!==y)return[];const n=re(e,t.props?.id);if(!n){const l=x(w(t.props))?.fields,s=l?.length?l.map(u=>({...u})):ne(t.props),f=(a().get(y)?.fields??[]).filter(u=>u.everySource&&!s.some(d=>d.key===u.key)),c=[...s,...f];return r?c.filter(u=>(u.kind??"text")===r):c}const i=X(t.props,n.type),o=i&&O(n,"list").find(l=>l.key===i)?.fields||[];return r?o.filter(l=>(l.kind??"text")===r):o}function We(e,t){return{[p]:"",[L]:e.map(r=>({...r})),[R]:t.map(r=>({...r}))}}function ne(e,t){const r=e?.[R];if(!Array.isArray(r))return[];const n=r.flatMap(i=>{if(!i||typeof i!="object")return[];const{key:o,label:l,kind:s,multiline:f,alt:c,next:u}=i;if(typeof o!="string"||!o||typeof l!="string")return[];const d=s==="image"||s==="link"||s==="colour"?s:void 0;return[{key:o,label:l,...d?{kind:d}:{},...f===!0?{multiline:!0}:{},...typeof c=="string"&&c?{alt:c}:{},...typeof u=="string"&&u?{next:u}:{}}]});return t?n.filter(i=>(i.kind??"text")===t):n}export{G as BOX_HIDE_WHEN_ROW_EMPTY,R as CARD_LIST_FIELDS,j as CARD_LIST_ITEM_BLOCKS,L as CARD_LIST_ROWS,y as CARD_LIST_TYPE,p as CARD_ROW_FIELD_PROP,K as CARD_ROW_LINK_PROP,h as CARD_TEMPLATE_BLOCKS,N as CARD_TEMPLATE_LABEL,B as CARD_TEMPLATE_SLOT,Ie as ROW_BOUND_PROPS,J as ROW_PART_BY_WORDS,De as cardCopyPlace,Ce as cardKeyOf,ve as cardListFieldsOf,ke as cardListItemSlot,We as cardListProps,X as cardListShows,_e as cardRow,Te as cardTemplateBlocks,Pe as cardTemplateCardOwner,z as cardTemplateField,q as cardTemplateFields,O as cardTemplateFieldsOf,Le as cardTemplateLinesBetween,re as cardTemplateOwner,be as cardTemplateSlot,Oe as cardTemplateSlotLabel,$ as cardTemplateSlotNames,he as cardTemplateTypedRows,we as cardTemplatesNameBlocks,V as defaultListField,Re as hasCardTemplate,Be as isCardTemplateBlock,Q as isCardTemplateSlot,b as namedRowField,ge as registerCardTemplates,Z as rowBound,ee as rowFieldOf,S as rowFieldSpec,te as rowFieldText,Se as rowFieldWordsArePlain,Fe as rowFilledProps,Ee as rowPartByKey,Ae as templateBoxIsEmpty,xe as templateOnInsert,Y as templateOnRead};
@@ -25,6 +25,13 @@ export declare function pickHoverMedia(row: HoverMediaRow | null | undefined, me
25
25
  kind: HoverMediaKind;
26
26
  group: HoverMediaGroup;
27
27
  }, finish?: string): HoverMediaPick | null;
28
+ export declare function cardRowHoverMedia(at: {
29
+ item?: unknown;
30
+ finish?: string;
31
+ } | null | undefined, media: {
32
+ kind: HoverMediaKind;
33
+ group: HoverMediaGroup;
34
+ } | null | undefined): HoverMediaPick | null;
28
35
  export declare function hoverArrowLabel(direction: "prev" | "next", name: string): string;
29
36
  export declare function hoverMediaCount(index: number, count: number): string;
30
37
  export {};
@@ -1 +1 @@
1
- import{nonEmptyString as f}from"../non-empty-string.js";const a=8,c=(t,n)=>!!t&&!!n&&t.trim().toLowerCase()===n.trim().toLowerCase(),l=(t,n,e)=>{if(e){const o=n(e);if(o.length>0)return o}for(const o of t){const r=n(o);if(r.length>0)return r}return[]},d=t=>(t.items??[]).flatMap(n=>{const e=n.kind==="image"?f(n.url):void 0;return e?[e]:[]}),g=t=>(t.angles??[]).flatMap(n=>{const e=f(n);return e?[e]:[]});function h(t,n,e){if(!t)return null;const o=n.group==="finish";let r;if(n.kind==="renderings"){const i=t.finishes??[],s=o?i.find(u=>c(u.name,e)):void 0;r=l(i,g,s)}else{const i=t.hoverMedia?.[n.kind]??[],s=o?i.find(u=>c(u.finish,e)):void 0;r=l(i,d,s)}return r.length===0?null:{kind:n.kind,fit:n.kind==="renderings"?"contain":"cover",urls:r.slice(0,a)}}function m(t,n){return`${t==="prev"?"Previous":"Next"} photo of ${n}`}function k(t,n){return`Photo ${t+1} of ${n}`}export{a as HOVER_MEDIA_LIMIT,m as hoverArrowLabel,k as hoverMediaCount,h as pickHoverMedia};
1
+ import{nonEmptyString as f}from"../non-empty-string.js";const d=8,c=(e,n)=>!!e&&!!n&&e.trim().toLowerCase()===n.trim().toLowerCase(),l=(e,n,t)=>{if(t){const o=n(t);if(o.length>0)return o}for(const o of e){const r=n(o);if(r.length>0)return r}return[]},p=e=>(e.items??[]).flatMap(n=>{const t=n.kind==="image"?f(n.url):void 0;return t?[t]:[]}),g=e=>(e.angles??[]).flatMap(n=>{const t=f(n);return t?[t]:[]});function h(e,n,t){if(!e)return null;const o=n.group==="finish";let r;if(n.kind==="renderings"){const i=e.finishes??[],s=o?i.find(u=>c(u.name,t)):void 0;r=l(i,g,s)}else{const i=e.hoverMedia?.[n.kind]??[],s=o?i.find(u=>c(u.finish,t)):void 0;r=l(i,p,s)}return r.length===0?null:{kind:n.kind,fit:n.kind==="renderings"?"contain":"cover",urls:r.slice(0,d)}}function m(e,n){return!e||!n||!e.item||typeof e.item!="object"?null:h(e.item,n,e.finish)}function v(e,n){return`${e==="prev"?"Previous":"Next"} photo of ${n}`}function M(e,n){return`Photo ${e+1} of ${n}`}export{d as HOVER_MEDIA_LIMIT,m as cardRowHoverMedia,v as hoverArrowLabel,M as hoverMediaCount,h as pickHoverMedia};
@@ -26,7 +26,6 @@ export type PictureHoverTreatment = {
26
26
  delay: number;
27
27
  };
28
28
  export declare function resolveImageTreatment(block?: boolean | null, site?: boolean | null, hover?: PictureHoverTreatment | null): ImageTreatment;
29
- export declare const NEXT_PICTURE_CLASS = "sf-photo-next";
30
29
  export declare const CARD_COPY_ATTR = "data-sf-repeat";
31
30
  export declare const PICTURE_ZOOM_CLASS = "sf-photo-zoom";
32
31
  export declare const PICTURE_ZOOM_VAR = "--sf-photo-zoom";
@@ -34,6 +33,10 @@ export declare const PICTURE_WASH_CLASS = "sf-photo-wash";
34
33
  export declare const PICTURE_WASH_REST_CLASS = "sf-photo-wash-rest";
35
34
  export declare const PICTURE_WASH_HOVER_CLASS = "sf-photo-wash-hover";
36
35
  export declare const PICTURE_FRAME_CLASS = "sf-photo-frame";
37
- export declare const NEXT_PICTURE_CSS: string;
38
- export declare function resolveNextPicture(hover?: PictureHoverTreatment | null): ImageTreatment | null;
36
+ export declare const PICTURE_MOVE_CSS: string;
37
+ export declare const PICTURE_MOVE_SHEET = "sf-photo-move";
38
+ export declare function resolvePictureMove(hover?: (PictureHoverTreatment & {
39
+ zoom?: string | null;
40
+ darken?: number | null;
41
+ }) | null): ImageTreatment | null;
39
42
  export declare function sitePhotographyTokens(grayscale?: boolean | null): Record<string, string>;
@@ -1 +1 @@
1
- import{MOTION_TIMING as _}from"efficient-shell/format";const c="grayscale(1) contrast(1.03)",E="Black and white";function l(o){return o===!0?{filter:c}:{}}function S(o){const{filter:e}=l(o);return e?{style:{filter:e}}:{}}const r="sf-photo-grayscale",T="data-sf-photo-host",f={duration:"--sf-photo-hover-duration",delay:"--sf-photo-hover-delay"},v=`@media (hover:hover){.${r}{filter:${c};transition:filter var(--sf-photo-hover-duration,var(--page-motion-hover-duration)) var(--page-ease-media) var(--sf-photo-hover-delay,var(--page-motion-hover-delay))}.${r}:hover,[data-sf-photo-host]:hover .${r}{filter:none}}@media (hover:hover) and (prefers-reduced-motion:reduce){.${r}{transition:none}}`;function u(o){const e=_.hover,t={...o.duration!==e.duration.default?{[f.duration]:`${o.duration}s`}:{},...o.delay!==e.delay.default?{[f.delay]:`${o.delay}s`}:{}};return Object.keys(t).length?t:void 0}function C(o,e,t){if(o===!0)return S(!0);if(t?.kind==="mono"){const d=u(t);return{className:r,sheet:v,...d?{style:d}:{}}}return o===!1?{}:e===!0?{className:r}:{}}const n="sf-photo-next",$="data-sf-repeat",p="sf-photo-zoom",A="--sf-photo-zoom",R="sf-photo-wash",s="sf-photo-wash-rest",a="sf-photo-wash-hover",i="sf-photo-frame",h=(o,e)=>{const t=`:not([${$}]:not(:hover) .${o})`;return`${e},[${$}]:hover .${o}${t},[${T}]:hover .${o}${t}`},m=o=>`${o} var(--sf-photo-hover-duration,var(--page-motion-hover-duration)) var(--page-ease-media) var(--sf-photo-hover-delay,var(--page-motion-hover-delay))`,x=`.${n}{opacity:0}.${a}{opacity:0}@media (hover:hover){.${n},.${s},.${a}{transition:${m("opacity")}}${h(n,`.${n}:hover,.${i}:hover .${n}`)},${h(a,`.${i}:hover .${a}`)}{opacity:1}${h(s,`.${i}:hover .${s}`)}{opacity:0}}@media (hover:hover) and (prefers-reduced-motion:no-preference){.${p}{transition:${m("transform")}}${h(p,`.${i}:hover .${p}`)}{transform:scale(var(${A}))}}@media (hover:hover) and (prefers-reduced-motion:reduce){.${n},.${s},.${a}{transition:none}}`;function O(o){if(o?.kind!=="nextImage")return null;const e=u(o);return{className:n,sheet:x,...e?{style:e}:{}}}function I(o){return o===!0?{[r]:v}:{}}export{$ as CARD_COPY_ATTR,c as IMAGE_GRAYSCALE_FILTER,E as IMAGE_GRAYSCALE_LABEL,n as NEXT_PICTURE_CLASS,x as NEXT_PICTURE_CSS,T as PHOTO_HOST_ATTR,f as PHOTO_HOVER_VARS,i as PICTURE_FRAME_CLASS,R as PICTURE_WASH_CLASS,a as PICTURE_WASH_HOVER_CLASS,s as PICTURE_WASH_REST_CLASS,p as PICTURE_ZOOM_CLASS,A as PICTURE_ZOOM_VAR,r as SITE_PHOTO_CLASS,v as SITE_PHOTO_CSS,S as imageTreatmentProps,l as imageTreatmentStyle,C as resolveImageTreatment,O as resolveNextPicture,I as sitePhotographyTokens};
1
+ import{MOTION_TIMING as m}from"efficient-shell/format";const d="grayscale(1) contrast(1.03)",y="Black and white";function _(o){return o===!0?{filter:d}:{}}function l(o){const{filter:e}=_(o);return e?{style:{filter:e}}:{}}const r="sf-photo-grayscale",S="data-sf-photo-host",c={duration:"--sf-photo-hover-duration",delay:"--sf-photo-hover-delay"},f=`@media (hover:hover){.${r}{filter:${d};transition:filter var(--sf-photo-hover-duration,var(--page-motion-hover-duration)) var(--page-ease-media) var(--sf-photo-hover-delay,var(--page-motion-hover-delay))}.${r}:hover,[data-sf-photo-host]:hover .${r}{filter:none}}@media (hover:hover) and (prefers-reduced-motion:reduce){.${r}{transition:none}}`;function u(o){const e=m.hover,t={...o.duration!==e.duration.default?{[c.duration]:`${o.duration}s`}:{},...o.delay!==e.delay.default?{[c.delay]:`${o.delay}s`}:{}};return Object.keys(t).length?t:void 0}function O(o,e,t){if(o===!0)return l(!0);if(t?.kind==="mono"){const h=u(t);return{className:r,sheet:f,...h?{style:h}:{}}}return o===!1?{}:e===!0?{className:r}:{}}const v="data-sf-repeat",i="sf-photo-zoom",T="--sf-photo-zoom",x="sf-photo-wash",a="sf-photo-wash-rest",n="sf-photo-wash-hover",s="sf-photo-frame",p=(o,e)=>{const t=`:not([${v}]:not(:hover) .${o})`;return`${e},[${v}]:hover .${o}${t},[${S}]:hover .${o}${t}`},$=o=>`${o} var(--sf-photo-hover-duration,var(--page-motion-hover-duration)) var(--page-ease-media) var(--sf-photo-hover-delay,var(--page-motion-hover-delay))`,E=`.${n}{opacity:0}@media (hover:hover){.${a},.${n}{transition:${$("opacity")}}${p(n,`.${s}:hover .${n}`)}{opacity:1}${p(a,`.${s}:hover .${a}`)}{opacity:0}}@media (hover:hover) and (prefers-reduced-motion:no-preference){.${i}{transition:${$("transform")}}${p(i,`.${s}:hover .${i}`)}{transform:scale(var(${T}))}}@media (hover:hover) and (prefers-reduced-motion:reduce){.${a},.${n}{transition:none}}`,C="sf-photo-move";function R(o){if(!o||!o.zoom&&!o.darken)return null;const e=u(o);return{className:s,sheet:E,...e?{style:e}:{}}}function I(o){return o===!0?{[r]:f}:{}}export{v as CARD_COPY_ATTR,d as IMAGE_GRAYSCALE_FILTER,y as IMAGE_GRAYSCALE_LABEL,S as PHOTO_HOST_ATTR,c as PHOTO_HOVER_VARS,s as PICTURE_FRAME_CLASS,E as PICTURE_MOVE_CSS,C as PICTURE_MOVE_SHEET,x as PICTURE_WASH_CLASS,n as PICTURE_WASH_HOVER_CLASS,a as PICTURE_WASH_REST_CLASS,i as PICTURE_ZOOM_CLASS,T as PICTURE_ZOOM_VAR,r as SITE_PHOTO_CLASS,f as SITE_PHOTO_CSS,l as imageTreatmentProps,_ as imageTreatmentStyle,O as resolveImageTreatment,R as resolvePictureMove,I as sitePhotographyTokens};
@@ -35,5 +35,5 @@ export declare const ON_MEDIA_INK: InkSource;
35
35
  export declare const ON_MEDIA_INK_STYLE: Readonly<Record<string, string>>;
36
36
  export declare const ON_LIGHT_INK: InkSource;
37
37
  export declare const ON_LIGHT_INK_STYLE: Readonly<Record<string, string>>;
38
- export declare function rowFillInkStyle(fill: string | null | undefined): Readonly<Record<string, string>> | null;
38
+ export declare function rowFillInkStyle(fill: string | null | undefined, lightInk?: string): Readonly<Record<string, string>> | null;
39
39
  export {};