efficient-web-builder 67.0.0 → 67.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/dist/editor/components/StorefrontEditor.js +1 -1
- package/dist/editor/components/storefront-editor.css +178 -0
- package/dist/editor/lib/animation/fields.js +1 -1
- package/dist/editor/lib/animation/hover-fields.d.ts +8 -0
- package/dist/editor/lib/animation/hover-fields.js +1 -1
- package/dist/editor/lib/document/block-offer.d.ts +2 -0
- package/dist/editor/lib/document/block-offer.js +1 -1
- package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Split/fields.js +1 -1
- package/dist/editor/lib/document/box-fields.d.ts +1 -1
- package/dist/editor/lib/document/card-display-chips.d.ts +1 -0
- package/dist/editor/lib/document/card-display-chips.js +1 -1
- package/dist/editor/lib/document/controls.d.ts +4 -12
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/document/page-root.js +2 -2
- package/dist/editor/lib/document/passes/inspector.js +1 -1
- package/dist/editor/lib/sections/section-dry-run.js +2 -2
- package/dist/format/lib/animation/hover.d.ts +3 -0
- package/dist/format/lib/animation/hover.js +1 -1
- package/dist/format/lib/content/box-shape.d.ts +1 -1
- package/dist/format/lib/content/container-gap.d.ts +2 -2
- package/dist/format/lib/content/container-gap.js +1 -1
- package/dist/format/lib/content/css-length.d.ts +17 -1
- package/dist/format/lib/content/css-length.js +1 -1
- package/dist/format/lib/content/hover-media.d.ts +6 -1
- package/dist/format/lib/content/hover-media.js +1 -1
- package/dist/format/lib/content/image-treatment.d.ts +3 -0
- package/dist/format/lib/content/image-treatment.js +1 -1
- package/dist/format/lib/content/page-width.d.ts +3 -3
- package/dist/format/lib/content/page-width.js +1 -1
- package/dist/format/lib/content/section-min-height.d.ts +11 -1
- package/dist/format/lib/content/section-min-height.js +1 -1
- package/dist/format/lib/document/blocks/general/Split/meta.d.ts +1 -0
- package/dist/format/lib/document/blocks/general/Split/meta.js +2 -2
- package/dist/format/lib/document/easel-row-words.d.ts +2 -0
- package/dist/format/lib/document/easel-row-words.js +1 -1
- package/dist/format/lib/document/passes/types.d.ts +3 -1
- package/dist/format/lib/document/section-catalog.d.ts +5 -0
- package/dist/format/lib/document/section-catalog.js +10 -2
- package/dist/format/lib/editor-words-catalogue.d.ts +7 -0
- package/dist/format/lib/editor-words-catalogue.js +3 -3
- package/dist/format/lib/fit-words.js +4 -2
- package/dist/format/lib/sections/section-presets.js +1 -1
- package/dist/format/lib/site-theme-row.d.ts +6 -0
- package/dist/format/lib/source-rules/no-hard-coded-option-rows.d.ts +1 -1
- package/dist/format/lib/source-rules/no-hard-coded-option-rows.js +1 -1
- package/dist/format/lib/source-rules/site-square-by-default.js +1 -1
- package/dist/format/lib/theme.d.ts +1 -1
- package/dist/format/lib/theme.js +4 -4
- package/dist/render/components/CardRowContext.d.ts +3 -1
- package/dist/render/components/CardRowContext.js +1 -1
- package/dist/render/components/Flex.d.ts +2 -1
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/HoverMediaLayer.d.ts +16 -1
- package/dist/render/components/HoverMediaLayer.js +1 -1
- package/dist/render/components/ImageBlock.d.ts +1 -1
- package/dist/render/components/ImageBlock.js +1 -1
- package/dist/render/components/PictureHoverMove.d.ts +1 -0
- package/dist/render/components/PictureHoverMove.js +1 -1
- package/dist/render/components/PreviewHeaderContext.d.ts +4 -1
- package/dist/render/components/PreviewHeaderContext.js +1 -1
- package/dist/render/components/ViewHideRoot.d.ts +6 -0
- package/dist/render/components/ViewHideRoot.js +1 -1
- package/dist/render/lib/content/block-size.d.ts +7 -1
- package/dist/render/lib/content/block-size.js +1 -1
- package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
- package/dist/render/lib/document/blocks/general/ImageBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Split/render.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +6 -1
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-editorial.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
- package/dist/render/lib/document/passes/block-size.js +1 -1
- package/dist/render/lib/document/passes/index.js +1 -1
- package/dist/render/lib/document/passes/section-height.d.ts +5 -1
- package/dist/render/lib/document/passes/section-height.js +1 -1
- package/dist/render/lib/sections/section-to-box.d.ts +2 -0
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 67.2.0 - 2026-11-11
|
|
4
|
+
|
|
5
|
+
From main at `7d5e50df`: #701, #702, #705, #706, #707, #704. A minor: no `!`, no export is removed, the peers stay `efficient-easel` `^34.1.0` and `efficient-shell` `^12.33.0`. Exported functions gain optional arguments and components gain optional props; one exported type widens (`OptionRowShape` adds `"d"` and `"e"`). One stored key is added (`hoverShow` on a Box, and the value `hover: "nextImage"` on a card Box); no stored key or value moves (read-only count 2026-11-11: 0 such nodes on the US and AU sites).
|
|
6
|
+
|
|
7
|
+
**For hosts:**
|
|
8
|
+
- Nothing to change. A theme row with no unit columns, or a px unit, draws the bytes it drew (#702, #707). A Box with no `hoverShow` draws the bytes it drew (#704). The canvas width attributes are written in the editor only; the published page does not change (#706).
|
|
9
|
+
- To draw a site length stored in vw or %, pass the row's units: `siteLengthUnitsOfRow(row)` into the new `siteLengthUnits` prop of `PreviewHeaderProvider`, or each unit as the new second argument of the site emitters (#702).
|
|
10
|
+
- A host that runs the option-row source rule may see new findings (a pressed element of any tag, a native tick box holding the pick); a host that switches on `OptionRowShape` gets two new values (0 such hosts today). storefront-blocks can now import this rule and delete its own copy (#701).
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **Site lengths draw in their stored unit** (#702): `siteWidthTokens`, `siteGutterTokens`, `siteGutterPhoneTokens`, `siteBlockGapTokens`, `siteBlockGapPhoneTokens` and `siteCornerRadiusTokens` take the stored unit as a new optional second argument; % and vw publish the number in that unit, held in easel's grid for the length's kind. New exports `siteLengthHeld`, `siteLengthCss`, `SiteLengthUnits`, `siteLengthUnitsOfRow`, `siteLengthNumber`. The editor canvas reads the six unit columns from the theme row.
|
|
15
|
+
- **A Box shows the next image and shows on card hover** (#704): a card Box on its row's picture takes Show next image; a Box inside a card copy takes Show: Always / On card hover (stored `hoverShow`); a Box with no picture inside a copy takes its own Darken wash. New exports in `lib/animation/hover` (`BOX_SHOW_KEY`, `BOX_SHOW_ON_CARD_HOVER`, `BOX_SHOW_ALWAYS`, `BOX_REVEAL_*`, `BOX_NEXT_PICTURE_ROW`) and `components/HoverMediaLayer` (`HoverArrowsSlot`, `HoverMediaArrows`, opt-in `arrowsAbove`). New optional props: `Flex` `hoverShow`, `CardTemplateRows` `previewHover`.
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- **Option-row source rule: a pressed element of any tag is a row** (#701): `lib/source-rules/no-hard-coded-option-rows` now also reads an element a shopper presses (`onClick`, `onMouseDown`, `onPointerDown`), an element carrying `aria-pressed` or `aria-checked`, and a native checkbox or radio holding the pick. New shapes (d) and (e); `OptionRowShape` is `"a" | "b" | "c" | "d" | "e"`. `aria-expanded` still lets a control pass.
|
|
20
|
+
- **Converted Boxes read the site gutter in its unit** (#707): `siteFactsFromRead` reads `site_gutter_unit` and `site_gutter_phone_unit` (new optional `SiteFacts` fields); `siteGutterOf(ctx, { view?, to?, maxPx? })` takes a new optional options argument. Section Header writes its sides in the Box's own padding unit, so a section with vw or % padding converts its 40px gutter correctly (40 -> 3vw, 2.78%) where before it got 40vw or 40%.
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- **A Box's block on the canvas takes the page's width** (#706): new exports `BLOCK_WIDTH_MODE_ATTR`, `BLOCK_MIN_WIDTH_ATTR`, `blockCanvasWidthAttrs` (`lib/content/block-size`). On the editor canvas a Fill or Fixed block takes the page's width, a block with a Min width can shrink, and a hidden part's empty item takes no gap. Editor canvas only.
|
|
25
|
+
- **Option-row rule reads each part's root once per set of kinds** (#705): a tree 20 parts deep took about 9 s. No export changes.
|
|
26
|
+
|
|
27
|
+
## 67.1.0 - 2026-11-11
|
|
28
|
+
|
|
29
|
+
From main at `df10d50a`: #697, #700. A minor: no `!`, no export is removed, the peers stay `efficient-easel` `^34.1.0` and `efficient-shell` `^12.33.0` (#697 raises only the easel devDependency, to `^34.2.0`). One stored key is added (`imageOverlay` on Split) and one stored value (`textFit: "ellipsis"`); no stored key or value moves.
|
|
30
|
+
|
|
31
|
+
**For hosts:**
|
|
32
|
+
- Nothing to change. A Split saved before this release has no `imageOverlay` and draws the 40% wash it always drew. With easel 34.1.0 the text fit row shows three answers and a stored "ellipsis" draws as nothing stored; with 34.2.0 it shows Shorten (#697).
|
|
33
|
+
|
|
34
|
+
### Added
|
|
35
|
+
|
|
36
|
+
- **Text fit: Shorten** (#697): the text fit row (`When the text does not fit`) offers its fourth answer, Shorten (stored `ellipsis`): the words stay on one line and the cut words end with "...", each view capped by its own Content width. A Shorten heading is never shrunk.
|
|
37
|
+
- **Image & Text Split: an Image overlay row** (#700): the black wash over the image column's picture was a fixed 40% with no row to change it, so an illustration or a screenshot read as greyed out (coloquo.com). The row sits in the Image column's Style group beside Black and white (a Design group, so Copy style copies it), 0 to 100%, 40 unless changed; 0 draws no wash. New export `splitImageOverlay` (`lib/document/blocks/general/Split/meta`). The Box conversion carries it as the Picture Box's Darken (none at 0).
|
|
38
|
+
|
|
3
39
|
## 67.0.0 - 2026-11-10
|
|
4
40
|
|
|
5
41
|
From main at `25036624`: #689, #691, #675, #692, #690. A MAJOR: #690 has `!` (narrowed peers). Peers move: `efficient-easel` `^33.0.0` -> `^34.1.0`, `efficient-shell` `^12.30.0` -> `^12.33.0` (#690). No export is removed. No stored key changes; no stored page needs a data move.
|
|
@@ -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 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
|
+
"use client";import{jsx as c,jsxs as wt}from"react/jsx-runtime";import{useCallback as n,useEffect as f,useMemo as de,useRef as g,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 Ct}from"../lib/document/build-config.js";import{ChromeWrap as _t}from"efficient-easel/screen/lib/host-chrome";import{sessionRegistry as Pt}from"efficient-easel/screen/lib/session";import{refreshSiteLiveState as Tt}from"../lib/site-live-state.js";import{holdSiteWrites as Et}from"../../format/lib/site-writes.js";import{backendOf as H,blocksOf as yt}from"../lib/website-session.js";import{useEaselSession as Gt}from"efficient-easel/screen/lib/session-context";import{withSiteBlockGapFields as vt}from"../../format/lib/document/site-gap-fields.js";import{withTemplateMediaPlaceholders as kt}from"../../format/lib/document/templateFields.js";import{setEditorPage as ue}from"../../format/lib/document/editor-page-context.js";import{EditorPagePathProvider as Wt}from"./EditorPagePathProvider.js";import{resolveSiteName as Ht}from"../../format/lib/content/site-name.js";import{normalizeSiteGutter as Rt,normalizeSiteGutterPhone as Bt,normalizeSiteWidth as Ft}from"../../format/lib/content/page-width.js";import{siteLengthNumber as w,siteLengthUnitsOfRow as It}from"../../format/lib/content/css-length.js";import{normalizeSiteBackground as he}from"../../format/lib/content/section-width.js";import{normalizeSiteBlockGap as le}from"../../format/lib/content/container-gap.js";import bt,{DocumentScreen as Dt}from"efficient-easel/screen/components/ScreenMount";import Mt from"./WebsiteHintsProvider.js";import{useScreenDocument as Nt}from"efficient-easel/screen/components/ScreenDocumentContext";import{PreviewHeaderProvider as Ot,siteThemeRow as xt,themeEdited as At,themeSeeded as Ut}from"../../render/components/PreviewHeaderContext.js";import{PreviewFooterProvider as zt}from"./PreviewFooterContext.js";import{PreviewChatProvider as Lt,DEFAULT_CHAT_PREVIEW as Yt}from"./PreviewChatContext.js";import{PreviewSocialProvider as jt}from"../../render/components/PreviewSocialContext.js";import{useSocialSettings as Kt}from"./useSocialSettings.js";import{PreviewSurfaceProvider as Vt}from"./PreviewSurfaceContext.js";import{WEBSITE_ADDRESSING as Xt}from"../lib/website-document-addressing.js";import{PreviewTickerProvider as Zt}from"../../render/components/PreviewTickerContext.js";import{PreviewHeroPartProvider as qt}from"../../render/components/PreviewHeroPartContext.js";import{PreviewPartsProvider as Jt}from"efficient-easel/draw/client";import{CanvasPartsBridge as Qt}from"./CanvasPartsBridge.js";import{PreviewLocationPartProvider as $t}from"../../render/components/PreviewLocationPartContext.js";import{PreviewPartStyleProvider as er}from"./PreviewPartStyleContext.js";import{CORNER_STYLE_TO_PX as tr,DEFAULT_HEADING_COMPRESSION as rr,DEFAULT_HEADING_TYPOGRAPHY as or,DEFAULT_SWITCH_SHOWN as R,DEFAULT_SIZES as nr,DEFAULT_THEME_MODE as T,normalizeCornerRadius as ir,normalizeCornerStyle as ar,normalizeCardShadow as cr,normalizeCardGap as sr,normalizeHoverEffect as dr,IDENTITY_CARD_GAP as me,IDENTITY_CARD_SHADOW as ur,IDENTITY_HOVER_EFFECT as hr,THEME_MODE_KEY as pe,THEME_STORAGE_KEY as lr,THEME_SWITCH_HIDE as Se,THEME_SWITCH_KEY as B}from"../../format/lib/theme.js";import{pictureShadowColor as mr}from"efficient-easel/screen/lib/document/shadow-values";import{DEFAULT_FONTS as pr}from"../../format/lib/fonts.js";import{WEBSITE_SCREEN as Sr}from"./WebsiteScreenParts.js";import{routeWebsiteHostMessage as fr}from"../../format/lib/website-host-inbound.js";import{siteTextFromRow as gr}from"../../render/lib/text-styles/site-text-styles.js";import{wordStylesFromRow as wr}from"../../format/lib/word-styles.js";import{chatPreviewFrom as Cr}from"./PreviewChatContext.js";const _r=()=>{if(typeof window>"u")return T;try{const s=window.localStorage.getItem(pe);return s==="light"||s==="dark"||s==="auto"?s:T}catch{return T}},fe=s=>{if(!(typeof window>"u"))try{window.localStorage.setItem(pe,s)}catch{}},Pr=()=>{if(typeof window>"u")return R;try{return window.localStorage.getItem(B)!==Se}catch{return R}},Tr=()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem(lr)}catch{}},ge=s=>{if(!(typeof window>"u"))try{s?window.localStorage.removeItem(B):window.localStorage.setItem(B,Se)}catch{}};function Er(){const{adapter:s,capabilities:d,templateId:F,ready:_,token:h,siteId:a,currentSlug:I,currentKind:b}=Nt();f(()=>(ue(I,b),()=>ue(null,null)),[I,b]);const E=d.placeholderFrames,[we,D]=r(null),[Ce,M]=r("");f(()=>{const e=s.templateName;if(!_||!F||!e){M("");return}let i=!1;return e().then(l=>!i&&M(l??"")).catch(()=>{}),()=>{i=!0}},[_,h,F,s]);const[_e,y]=r(T),[Pe,G]=r(R),[N,O]=r({value:{selected:0,themes:[]},readFor:null}),Te=N.value,[Ee,x]=r(pr),[ye,A]=r(nr),[Ge,U]=r(null),[ve,z]=r(rr),[ke,L]=r(null),[We,Y]=r(null),[He,j]=r(me),[Re,K]=r(null),[Be,V]=r(null),[Fe,X]=r(null),[Ie,Z]=r(null),[v,q]=r(null),[k,J]=r(null),[be,De]=r({}),u=Gt(),Q=de(()=>Ct(Pt(u),yt(u)),[u]),Me=de(()=>vt(kt(Q,E),v,k),[Q,E,v,k]),[Ne,$]=r(or),[Oe,ee]=r(null),[xe,te]=r(null),[Ae,re]=r(null),[Ue,oe]=r(null),[ze,ne]=r(null),ie=g(null),o=g(!1);f(()=>{y(_r()),G(Pr())},[]);const Le=n(e=>{o.current=!0,Tr(),fe(e),y(e)},[]),Ye=n(e=>{o.current=!0,ge(e),G(e)},[]),je=n(e=>{o.current=!0,O(i=>At(i,e,a??""))},[a]),Ke=n(e=>{o.current=!0,x(e)},[]),Ve=n(e=>{o.current=!0,A(e)},[]),Xe=n(e=>{o.current=!0,U(e)},[]),Ze=n(e=>{o.current=!0,z(e)},[]),qe=n(e=>{o.current=!0,L(e)},[]),Je=n(e=>{o.current=!0,Y(e)},[]),Qe=n(e=>{o.current=!0,j(e)},[]),$e=n(e=>{o.current=!0,K(e)},[]),et=n(e=>{o.current=!0,$(e)},[]),[tt,ae]=r(null),[rt,ot]=r(null),nt=n(e=>{o.current=!0,ae(e)},[]),it=n(e=>{o.current=!0,V(e)},[]),at=n(e=>{o.current=!0,X(e)},[]),ct=n(e=>{o.current=!0,Z(e)},[]),st=n(e=>{o.current=!0,q(e)},[]),dt=n(e=>{o.current=!0,J(e)},[]),ut=n(e=>{o.current=!0,ee(e)},[]),ht=n(e=>{o.current=!0,te(e)},[]),lt=n(e=>{o.current=!0,re(e)},[]),mt=n(e=>{o.current=!0,oe(e)},[]),pt=n(e=>{o.current=!0,ne(e)},[]);f(()=>{const e=H(u).theme;if(!h||!d.hasSiteTheme||!e)return;const i=a??"";ie.current!==i&&(ie.current=i,o.current=!1);let l=!1;return e.get(a?{siteId:a}:void 0).then(t=>{if(l||o.current)return;fe(t.default_mode),ge(t.show_theme_switch),y(t.default_mode),G(t.show_theme_switch),O(Ut({selected:t.selected_preset,themes:t.theme_presets},i));const C=gr(t);x(C.fonts),A(C.sizes);const S=It(t);De(S),U(t.corner_radius_px===void 0?tr[ar(t.corner_style)]:w(t.corner_radius_px,S.cornerRadiusUnit,ir)),z(C.compression),L(t.card_shadow==null?ur:cr(t.card_shadow)),j(t.card_gap==null?me:sr(t.card_gap)),K(t.hover_effect==null?hr:dr(t.hover_effect)),Y(mr(t.shadow_color)),V(w(t.site_width,S.siteWidthUnit,Ft)),X(w(t.site_gutter,S.siteGutterUnit,Rt)),Z(w(t.site_gutter_phone,S.siteGutterPhoneUnit,Bt)),q(w(t.block_gap,S.blockGapUnit,le)),J(w(t.block_gap_phone,S.blockGapPhoneUnit,le)),$(C.typography),ae(C.textStyles),ot(wr(t)),ee(t.hero_background_follows_width===!0),te(he(t.section_background_width)),re(he(t.section_content_width)),oe(t.photography_grayscale===!0),ne(t.share_button_on_posts===!0)}).catch(()=>{}),()=>{l=!0}},[h,a,d.hasSiteTheme,u]);const St=Kt({token:h,siteId:a,enabled:d.hasSiteSettings}),[ft,ce]=r(Yt),se=g(null),W=g(!1),m=g(null),p=g({}),P=n(async()=>{m.current&&clearTimeout(m.current),m.current=null;const e=p.current;p.current={};try{await H(u).chat?.update(e,a?{siteId:a}:void 0),Tt()}catch(i){throw p.current={...e,...p.current},i}},[u,a]);f(()=>Et(()=>m.current||Object.keys(p.current).length>0?P():void 0),[P]);const gt=n(e=>{W.current=!0,ce(i=>({...i,...e})),!(!d.hasSiteSettings||!h)&&(p.current={...p.current,...e},m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{P().catch(()=>{})},500))},[d.hasSiteSettings,h,P]);return f(()=>{if(!h||!d.hasSiteSettings)return;const e=a??"";se.current!==e&&(se.current=e,W.current=!1);let i=!1;const l=H(u).chat;if(l)return l.get(a?{siteId:a}:void 0).then(t=>{i||W.current||ce(Cr(t))}).catch(()=>{}),()=>{i=!0}},[h,a,d.hasSiteSettings,u]),f(()=>{const e=s.site;if(!_||!d.hasSiteRecord||!e){D(null);return}let i=!1;return e().then(l=>{i||D(Ht(l.name))}).catch(()=>{}),()=>{i=!0}},[_,h,d.hasSiteRecord,a,s]),c(Dt,{config:Me,parts:Sr,wrap:(e,i)=>c(Ot,{websiteName:we,templateChrome:E,templateName:Ce||null,themeMode:_e,onThemeModeChange:Le,themeSwitchShown:Pe,onThemeSwitchShownChange:Ye,theme:Te,themeRow:xt(d.hasSiteTheme,N.readFor,a??""),onThemeChange:je,fonts:Ee,onFontsChange:Ke,cornerRadiusPx:Ge,onCornerRadiusPxChange:Xe,cardShadow:ke,onCardShadowChange:qe,shadowColor:We,onShadowColorChange:Je,cardGap:He,onCardGapChange:Qe,hoverEffect:Re,onHoverEffectChange:$e,headingCompression:ve,onHeadingCompressionChange:Ze,headingTypography:Ne,onHeadingTypographyChange:et,textStyles:tt,onTextStylesChange:nt,wordStyles:rt,sizes:ye,onSizesChange:Ve,siteWidth:Be,onSiteWidthChange:it,siteGutter:Fe,onSiteGutterChange:at,siteGutterPhone:Ie,onSiteGutterPhoneChange:ct,blockGap:v,onBlockGapChange:st,blockGapPhone:k,onBlockGapPhoneChange:dt,siteLengthUnits:be,heroBackgroundFollowsWidth:Oe,onHeroBackgroundFollowsWidthChange:ut,sectionBackgroundWidth:xe,onSectionBackgroundWidthChange:ht,sectionContentWidth:Ae,onSectionContentWidthChange:lt,photographyGrayscale:Ue,onPhotographyGrayscaleChange:mt,shareButtonOnPosts:ze,onShareButtonOnPostsChange:pt,themeFromDocument:!d.hasSiteTheme,children:c(zt,{children:c(_t,{wrap:u.chrome?.wrap,surface:"page",children:c(Zt,{children:c(qt,{children:c(Jt,{children:c($t,{children:c(Qt,{children:wt(er,{children:[c(Lt,{chat:ft,onChatChange:gt,children:c(jt,{value:St,children:c(Vt,{children:c(Wt,{children:c(Mt,{children:e})})})})}),i]})})})})})})})})})})}function yr({target:s}){return c(bt,{target:s,addressing:Xt,onHostMessage:fr,children:c(Er,{})})}export{yr as default};
|
|
@@ -766,6 +766,25 @@
|
|
|
766
766
|
word `edge`), a stored section's own line (720 and 1100) for a section
|
|
767
767
|
that is neither (lib/content/view-hide-class, components/ViewHideRoot).
|
|
768
768
|
The block stays in Layers, where the eye shows it again. */
|
|
769
|
+
/* A block hidden in every view draws nothing (passes/hidden-nodes), on the
|
|
770
|
+
page and on the canvas, so on the page the Box keeps no cell and no gap for
|
|
771
|
+
it. On the canvas the engine's item stays, empty: efficient-easel's item
|
|
772
|
+
holds the block's render and nothing else (its outlines and handles are
|
|
773
|
+
drawn over the canvas, outside the item), so an empty item is a block that
|
|
774
|
+
draws nothing, and it takes no gap either. The block stays in Layers.
|
|
775
|
+
Only the engine's bare item (`:not([class])`): an `inline` block carries the
|
|
776
|
+
attribute on its own root, which the page draws too. `!important` because
|
|
777
|
+
storefront-blocks' sheet gives this same item `display: grid` in a stretch
|
|
778
|
+
row and a Grid zone (`.flex-row:not(.items-start)...> [data-easel-block]
|
|
779
|
+
:not([class])`, `.sf-grid-zone > [data-easel-block]`), unlayered and of a
|
|
780
|
+
higher specificity, and a hidden block must win there too.
|
|
781
|
+
A block with parts draws inside its part host (`data-sf-part-host`,
|
|
782
|
+
display: contents), so when it draws nothing the item holds only that
|
|
783
|
+
empty host and is not `:empty`: the second selector hides it too. */
|
|
784
|
+
[data-easel-block]:not([class]):empty,
|
|
785
|
+
[data-easel-block]:not([class]):has(> [data-sf-part-host]:only-child:empty) {
|
|
786
|
+
display: none !important;
|
|
787
|
+
}
|
|
769
788
|
@media (width < 720px) {
|
|
770
789
|
[data-easel-block]:has(> [data-sf-view-hide~="mobile"]:not([data-sf-view-hide~="edge"])),
|
|
771
790
|
[data-easel-block]:has(> [data-sf-part-host] > [data-sf-view-hide~="mobile"]:not([data-sf-view-hide~="edge"])) {
|
|
@@ -797,6 +816,165 @@
|
|
|
797
816
|
}
|
|
798
817
|
}
|
|
799
818
|
|
|
819
|
+
/* ── A block on Height Fill ───────────────────────────────────────────────
|
|
820
|
+
On the page, the block's outermost element is its Box's flex item and grows
|
|
821
|
+
(lib/content/section-min-height `sectionHeightFillClass`: the grow in a
|
|
822
|
+
column, the stretch in a row). On the canvas the engine's own item
|
|
823
|
+
(`[data-easel-block]`, with the part host between them, display: contents)
|
|
824
|
+
is the flex item, so it grows instead, in the views the root names
|
|
825
|
+
(`data-sf-height-fill="desktop tablet mobile"`, at the one edge, 800, and
|
|
826
|
+
1100, as a Box's other views), and it is a one-column grid so the block in
|
|
827
|
+
it stretches to that height. A block with no Fill wears no attribute and
|
|
828
|
+
matches nothing. */
|
|
829
|
+
@media (width >= 1100px) { /* height fill */
|
|
830
|
+
[data-easel-block]:is(.flex-col > *):has(> [data-sf-height-fill~="desktop"]),
|
|
831
|
+
[data-easel-block]:is(.flex-col > *):has(> [data-sf-part-host] > [data-sf-height-fill~="desktop"]) {
|
|
832
|
+
flex-grow: 1;
|
|
833
|
+
display: grid;
|
|
834
|
+
grid-template-columns: 100%;
|
|
835
|
+
}
|
|
836
|
+
[data-easel-block]:is(.flex-row > *):has(> [data-sf-height-fill~="desktop"]),
|
|
837
|
+
[data-easel-block]:is(.flex-row > *):has(> [data-sf-part-host] > [data-sf-height-fill~="desktop"]) {
|
|
838
|
+
align-self: stretch;
|
|
839
|
+
display: grid;
|
|
840
|
+
grid-template-columns: 100%;
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
@media (800px <= width < 1100px) { /* height fill */
|
|
844
|
+
[data-easel-block]:is(.flex-col > *):has(> [data-sf-height-fill~="tablet"]),
|
|
845
|
+
[data-easel-block]:is(.flex-col > *):has(> [data-sf-part-host] > [data-sf-height-fill~="tablet"]) {
|
|
846
|
+
flex-grow: 1;
|
|
847
|
+
display: grid;
|
|
848
|
+
grid-template-columns: 100%;
|
|
849
|
+
}
|
|
850
|
+
[data-easel-block]:is(.flex-row > *):has(> [data-sf-height-fill~="tablet"]),
|
|
851
|
+
[data-easel-block]:is(.flex-row > *):has(> [data-sf-part-host] > [data-sf-height-fill~="tablet"]) {
|
|
852
|
+
align-self: stretch;
|
|
853
|
+
display: grid;
|
|
854
|
+
grid-template-columns: 100%;
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
@media (width < 800px) { /* height fill */
|
|
858
|
+
[data-easel-block]:is(.flex-col > *):has(> [data-sf-height-fill~="mobile"]),
|
|
859
|
+
[data-easel-block]:is(.flex-col > *):has(> [data-sf-part-host] > [data-sf-height-fill~="mobile"]) {
|
|
860
|
+
flex-grow: 1;
|
|
861
|
+
display: grid;
|
|
862
|
+
grid-template-columns: 100%;
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
/* ── A block's Width (Fill, Fixed) ────────────────────────────────────────
|
|
867
|
+
On the page, a block's Width sits on its Size wrapper (lib/content/
|
|
868
|
+
block-size), the Box's flex item: Fill is `w-full` and grows in a row Box,
|
|
869
|
+
Fixed is `w-[min(var(--sf-bw),100%)]` and neither grows nor shrinks. On the
|
|
870
|
+
canvas the engine's own item (`[data-easel-block]`, with the part host
|
|
871
|
+
between them, display: contents) is the flex item, so it takes the same:
|
|
872
|
+
Fill makes it full width (the wrapper's `w-full` then fills it) and grows
|
|
873
|
+
it in a row Box; Fixed stops it growing and shrinking, and its wrapper takes
|
|
874
|
+
the plain width, so the item's content size is that width (a `min(…, 100%)`
|
|
875
|
+
has nothing to resolve against while the item measures its content, and
|
|
876
|
+
counts as auto). The item stays within the Box (`max-width: 100%`), as the
|
|
877
|
+
page's `min(…, 100%)` does.
|
|
878
|
+
The wrapper names the views each mode acts in (`data-sf-width-fill`,
|
|
879
|
+
`data-sf-width-fixed`, `BLOCK_WIDTH_MODE_ATTR`): `wide` for a block that
|
|
880
|
+
splits at 800 (800 up), `desktop` and `tablet` for one split in three (1100
|
|
881
|
+
up, 800 up to 1100), `mobile` under 800, each reading its own width
|
|
882
|
+
property. No display here: the hidden-in-a-view rules above set the item's
|
|
883
|
+
display, and these must not undo them. A block with no Fill and no Fixed
|
|
884
|
+
wears no attribute and matches nothing.
|
|
885
|
+
A Min width (`data-sf-min-width`, the same words) is the page's flex
|
|
886
|
+
item's own minimum (`min-w-[var(--sf-bmin)]!`), so there the block shrinks
|
|
887
|
+
to it in a full row. The canvas item would keep its automatic minimum (its
|
|
888
|
+
content's narrowest) and push the row past the Box: it takes
|
|
889
|
+
`min-width: 0`, and the wrapper's Min width decides. */
|
|
890
|
+
@media (width >= 1100px) { /* block width */
|
|
891
|
+
[data-easel-block]:has(> [data-sf-width-fill~="wide"]),
|
|
892
|
+
[data-easel-block]:has(> [data-sf-part-host] > [data-sf-width-fill~="wide"]),
|
|
893
|
+
[data-easel-block]:has(> [data-sf-width-fill~="desktop"]),
|
|
894
|
+
[data-easel-block]:has(> [data-sf-part-host] > [data-sf-width-fill~="desktop"]) {
|
|
895
|
+
width: 100%;
|
|
896
|
+
}
|
|
897
|
+
[data-easel-block]:is(.flex-row > *):has(> [data-sf-width-fill~="wide"]),
|
|
898
|
+
[data-easel-block]:is(.flex-row > *):has(> [data-sf-part-host] > [data-sf-width-fill~="wide"]),
|
|
899
|
+
[data-easel-block]:is(.flex-row > *):has(> [data-sf-width-fill~="desktop"]),
|
|
900
|
+
[data-easel-block]:is(.flex-row > *):has(> [data-sf-part-host] > [data-sf-width-fill~="desktop"]) {
|
|
901
|
+
flex-grow: 1;
|
|
902
|
+
}
|
|
903
|
+
[data-easel-block]:has(> [data-sf-width-fixed~="wide"]),
|
|
904
|
+
[data-easel-block]:has(> [data-sf-part-host] > [data-sf-width-fixed~="wide"]),
|
|
905
|
+
[data-easel-block]:has(> [data-sf-width-fixed~="desktop"]),
|
|
906
|
+
[data-easel-block]:has(> [data-sf-part-host] > [data-sf-width-fixed~="desktop"]) {
|
|
907
|
+
flex: 0 0 auto;
|
|
908
|
+
max-width: 100%;
|
|
909
|
+
}
|
|
910
|
+
[data-easel-block] > [data-sf-width-fixed~="wide"],
|
|
911
|
+
[data-easel-block] > [data-sf-part-host] > [data-sf-width-fixed~="wide"],
|
|
912
|
+
[data-easel-block] > [data-sf-width-fixed~="desktop"],
|
|
913
|
+
[data-easel-block] > [data-sf-part-host] > [data-sf-width-fixed~="desktop"] {
|
|
914
|
+
width: var(--sf-bw);
|
|
915
|
+
}
|
|
916
|
+
[data-easel-block]:has(> [data-sf-min-width~="wide"]),
|
|
917
|
+
[data-easel-block]:has(> [data-sf-part-host] > [data-sf-min-width~="wide"]),
|
|
918
|
+
[data-easel-block]:has(> [data-sf-min-width~="desktop"]),
|
|
919
|
+
[data-easel-block]:has(> [data-sf-part-host] > [data-sf-min-width~="desktop"]) {
|
|
920
|
+
min-width: 0;
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
@media (800px <= width < 1100px) { /* block width */
|
|
924
|
+
[data-easel-block]:has(> [data-sf-width-fill~="wide"]),
|
|
925
|
+
[data-easel-block]:has(> [data-sf-part-host] > [data-sf-width-fill~="wide"]),
|
|
926
|
+
[data-easel-block]:has(> [data-sf-width-fill~="tablet"]),
|
|
927
|
+
[data-easel-block]:has(> [data-sf-part-host] > [data-sf-width-fill~="tablet"]) {
|
|
928
|
+
width: 100%;
|
|
929
|
+
}
|
|
930
|
+
[data-easel-block]:is(.flex-row > *):has(> [data-sf-width-fill~="wide"]),
|
|
931
|
+
[data-easel-block]:is(.flex-row > *):has(> [data-sf-part-host] > [data-sf-width-fill~="wide"]),
|
|
932
|
+
[data-easel-block]:is(.flex-row > *):has(> [data-sf-width-fill~="tablet"]),
|
|
933
|
+
[data-easel-block]:is(.flex-row > *):has(> [data-sf-part-host] > [data-sf-width-fill~="tablet"]) {
|
|
934
|
+
flex-grow: 1;
|
|
935
|
+
}
|
|
936
|
+
[data-easel-block]:has(> [data-sf-width-fixed~="wide"]),
|
|
937
|
+
[data-easel-block]:has(> [data-sf-part-host] > [data-sf-width-fixed~="wide"]),
|
|
938
|
+
[data-easel-block]:has(> [data-sf-width-fixed~="tablet"]),
|
|
939
|
+
[data-easel-block]:has(> [data-sf-part-host] > [data-sf-width-fixed~="tablet"]) {
|
|
940
|
+
flex: 0 0 auto;
|
|
941
|
+
max-width: 100%;
|
|
942
|
+
}
|
|
943
|
+
[data-easel-block] > [data-sf-width-fixed~="wide"],
|
|
944
|
+
[data-easel-block] > [data-sf-part-host] > [data-sf-width-fixed~="wide"] {
|
|
945
|
+
width: var(--sf-bw);
|
|
946
|
+
}
|
|
947
|
+
[data-easel-block] > [data-sf-width-fixed~="tablet"],
|
|
948
|
+
[data-easel-block] > [data-sf-part-host] > [data-sf-width-fixed~="tablet"] {
|
|
949
|
+
width: var(--sf-bw-t);
|
|
950
|
+
}
|
|
951
|
+
[data-easel-block]:has(> [data-sf-min-width~="wide"]),
|
|
952
|
+
[data-easel-block]:has(> [data-sf-part-host] > [data-sf-min-width~="wide"]),
|
|
953
|
+
[data-easel-block]:has(> [data-sf-min-width~="tablet"]),
|
|
954
|
+
[data-easel-block]:has(> [data-sf-part-host] > [data-sf-min-width~="tablet"]) {
|
|
955
|
+
min-width: 0;
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
@media (width < 800px) { /* block width */
|
|
959
|
+
[data-easel-block]:has(> [data-sf-width-fill~="mobile"]),
|
|
960
|
+
[data-easel-block]:has(> [data-sf-part-host] > [data-sf-width-fill~="mobile"]) {
|
|
961
|
+
width: 100%;
|
|
962
|
+
}
|
|
963
|
+
[data-easel-block]:has(> [data-sf-width-fixed~="mobile"]),
|
|
964
|
+
[data-easel-block]:has(> [data-sf-part-host] > [data-sf-width-fixed~="mobile"]) {
|
|
965
|
+
flex: 0 0 auto;
|
|
966
|
+
max-width: 100%;
|
|
967
|
+
}
|
|
968
|
+
[data-easel-block] > [data-sf-width-fixed~="mobile"],
|
|
969
|
+
[data-easel-block] > [data-sf-part-host] > [data-sf-width-fixed~="mobile"] {
|
|
970
|
+
width: var(--sf-bw-p);
|
|
971
|
+
}
|
|
972
|
+
[data-easel-block]:has(> [data-sf-min-width~="mobile"]),
|
|
973
|
+
[data-easel-block]:has(> [data-sf-part-host] > [data-sf-min-width~="mobile"]) {
|
|
974
|
+
min-width: 0;
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
|
|
800
978
|
/* @tokens canvas-end */
|
|
801
979
|
|
|
802
980
|
/* ── Canvas "Add section" seams (overlay between preview sections) ──────────
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{loopDelayField as
|
|
1
|
+
import{loopDelayField as _,loopDurationField as O}from"./AnimationDurationRow.js";import{entranceFields as o}from"./entrance-fields.js";import{scrollFields as r}from"./scroll-fields.js";import{BOX_SHOW_KEY as s,HOVER_GROUP_KEY as c,HOVER_KEY as l,cardHoverResting as f,pictureHoverResting as R}from"../../../format/lib/animation/hover.js";import{boxHoverFields as F,cardHoverFields as H,hoverFields as h,pictureHoverFields as D}from"./hover-fields.js";import{ON_A_PICTURE_OR_CARD as m}from"../document/card-display-chips.js";import{customize as E}from"efficient-easel/screen/lib/document/box-fields";import{loopDirectionField as v,loopFields as w,loopHeading as S}from"./loop-fields.js";import{LOOP_GROUP_KEY as P}from"../../../format/lib/animation/loop.js";import{withRowsShownWhen as i}from"../../../format/lib/document/show-when-attach.js";import{BOX_IS_CARD_RULE as b}from"../../../format/lib/content/box-card-rule.js";const p={field:s,set:!0};function x(){const t=F(),e=[c,l],a=i(t,Object.keys(t).filter(n=>!e.includes(n)&&n!==s),b),u=i(a,[s],p),d=i(u,[l],m);return i(d,[c],{any:[m,p]})}function G(t,e=""){switch(t){case"section":case"block":return{...o(),...r()};case"box":return{...o(),...r(),...w(),...x()};case"picture":return{...o(),...r(),...D(R(e),e)};case"textPart":return{...o(),...r(),...h()};case"cards":return{...o(),...r(),...H(f(e))};case"marquee":return{...o(),...r(),[P]:S(),_cLoop:E(),scrollDirection:v(),loopDuration:O({readsSpeed:!0}),loopDelay:_()}}}export{G as animationTabFields};
|
|
@@ -16,3 +16,11 @@ export declare const BOX_HIGHLIGHT_ROW: {
|
|
|
16
16
|
showWhen?: ShowWhenRule;
|
|
17
17
|
};
|
|
18
18
|
export declare function boxHoverFields(): Record<string, unknown>;
|
|
19
|
+
export declare const BOX_NEXT_PICTURE_ROW: {
|
|
20
|
+
description: string;
|
|
21
|
+
type: "custom";
|
|
22
|
+
render: (props: import("efficient-easel/screen/lib/document/box-fields").BoxFieldRenderProps<PictureHover | undefined>) => ReactElement;
|
|
23
|
+
showWhen?: ShowWhenRule;
|
|
24
|
+
} & {
|
|
25
|
+
sfPictureResting: PictureHover;
|
|
26
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as i}from"react/jsx-runtime";import{AccentIcon as
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{AccentIcon as j,ContrastIcon as Z,EyeIcon as q,ExpandIcon as J,FinishIcon as Q,ImagesIcon as $,NoSymbolIcon as S,HoverLiftIcon as ee,HoverNextImageIcon as oe,HoverRotateIcon as te,HoverZoomIcon as T,OpacityIcon as ne}from"efficient-easel/icons";import{customize as re,describedAs as N,group as se}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 ie,noControlField as ce}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 ae}from"../../../format/lib/content/card-template.js";import{angleRow as pe,segmented as H,select as he,slider as A}from"../document/box-fields.js";import{say as E}from"../../../format/lib/editor-words.js";import{withShowWhen as a}from"../../../format/lib/document/show-when-attach.js";import{animationDelayField as D,animationDurationField as k,showsWhatRuns as O}from"./AnimationDurationRow.js";import{BOX_HIGHLIGHT as C,BOX_HOVER_KINDS as g,BOX_HOVER_LABELS as x,CARD_HOVER_KEYS as c,CARD_HOVER_KINDS as de,CARD_HOVER_SECTIONS as _e,CARD_HOVER_TURN as le,HOVER_KEY as h,HOVER_MEDIA_COVERS as ue,HOVER_MEDIA_COVER_LABELS as Ee,HOVER_MEDIA_DEFAULTS as m,HOVER_MEDIA_GROUPS as Re,HOVER_MEDIA_GROUP_LABELS as He,HOVER_MEDIA_KINDS as Oe,HOVER_MEDIA_KIND_LABELS as me,HOVER_KIND_LABELS as B,BOX_SHOW_KEY as P,BOX_SHOW_ALWAYS as W,BOX_SHOW_ON_CARD_HOVER as K,NEXT_PICTURE_BLOCKS as b,NEXT_PICTURE_HOVER_KINDS as y,OLD_SPIN_KEY as Ie,PART_HOVER_KINDS as X,PICTURE_HOVER_KEYS as U,PICTURE_HOVER_KINDS as fe,PICTURE_HOVER_ZOOM as d,cardHoverAngleOf as we,cardHoverKindOf as ve,cardRotatesRule as Se,cardShowsNextRule as I,HOVER_GROUP_KEY as _,pictureHoverKindOf as Te,pictureHoverMoveRule as Ne,pictureHoverRunsRule as L,pictureHoverTimedRule as Ve}from"../../../format/lib/animation/hover.js";const R=e=>r("desktop",se("Hover",{dot:e})),M=()=>r("desktop",re()),Ae="What this does when a shopper points at it, or taps it on a phone.",De="What this picture does when a shopper points at it. Black and white shows it in grey until then. A phone shows its colour.",ke="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.",Ce="What this picture does when a shopper points at the card. Show next image covers the picture with the card's photos, with arrows; a phone shows the picture as it is. Black and white shows it in grey until then.",ge="When this shows. On card hover shows it while a shopper points at the card. A phone always shows it.",xe="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.",Be="Which of the product's pictures the card shows.",Pe="Same finish shows the photos of the finish the card shows, else the first group.",We="Whole card hides the words under the photo. Picture keeps the words and swatches in view.",Ke={none:()=>i(S,{}),nextImage:()=>i(oe,{}),rotate:()=>i(te,{}),zoom:()=>i(T,{}),lift:()=>i(ee,{}),mono:()=>i(Z,{})};function f(e,o){const s=V({label:E("Hover effect"),options:e.map(n=>({value:n,label:E(B[n]),picture:Ke[n]()})),fallback:o});return N(s,{type:"select",label:"Hover effect",options:e.map(n=>({value:n,label:B[n]}))})}function oo(){return{[_]:R({field:h,in:X.filter(e=>e!=="none")}),[h]:r("desktop",{...f(X,"none"),description:Ae})}}function to(e){const o=Se(e),s=I(),n=pe(le);return{[_]:R({any:[o,s]}),[c.kind]:r("desktop",{...O(f(de,e),(t,l)=>ve(l??{},e)),description:xe}),...w(s),[Ie]:ce({type:"custom",render:()=>i(ie,{})},"always"),_cHover:M(),[c.angle]:r("desktop",a(O(n,t=>we(t)),o)),[c.duration]:r("desktop",a(k("hover"),o)),[c.delay]:r("desktop",a(D("hover"),o))}}function w(e){const o=he("Type",i($,{}),Oe.map(t=>({value:t,label:me[t]})),m.kind),s=H("Group",i(Q,{}),Re.map(t=>({value:t,label:He[t]})),m.group),n=H("Covers",i(J,{}),ue.map(t=>({value:t,label:Ee[t]})),m.cover);return{[c.mediaKind]:r("desktop",a({...o,description:Be},e)),[c.mediaGroup]:r("desktop",a({...s,description:Pe},e)),[c.cover]:r("desktop",a({...n,description:We},e))}}function be(e,o="",s=b.includes(o)){const n=L(e),t=Ve(e);return{[_]:R(n),[c.kind]:v(fe,e,De),...b.includes(o)?w(I()):{},_cHover:M(),...s?F():{},[c.duration]:r("desktop",a(k("hover"),t)),[c.delay]:r("desktop",a(D("hover"),t))}}function F(e=!1){const o=t=>e?t:a(t,Ne()),s=A("Zoom",i(T,{}),d.min,d.max,d.step,d.min,d.unit),n=A("Darken on hover",i(ne,{}),p.min,p.max,p.step,p.fallback,p.unit);return{[U.zoom]:r("desktop",o(s)),[U.darken]:r("desktop",o(n))}}function v(e,o,s){const n=r("desktop",{...O(f(e,o),t=>Te({[h]:t},o,e)),description:s});return Object.assign(n,{[G]:o})}const G="sfPictureResting",Y=new WeakMap;function no(e,o,s){const n=e[c.kind],t=n?.[G];if(!n||!t)return e;const l=o.props?.[h]==="nextImage",z=l?null:ae(s.appState,o.props?.id);if(!l&&!_e.includes(String(z?.type??"")))return e;let u=Y.get(e);return u||(u={...e,[c.kind]:v(y,t,ke)},Y.set(e,u)),u}const ye="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.",Xe={none:()=>i(S,{}),[C]:()=>i(j,{})},ro=r("desktop",{...N(V({label:E("Hover effect"),options:g.map(e=>({value:e,label:E(x[e]),picture:Xe[e]()})),fallback:"none"}),{type:"select",label:"Hover effect",options:g.map(e=>({value:e,label:x[e]}))}),description:ye}),Ue=r("desktop",{...H("Show",i(q,{}),[{value:W,label:"Always"},{value:K,label:"On card hover"}],W),description:ge});function so(){const e={any:[L("none"),{field:h,is:C},{field:P,is:K}]},{[_]:o,[c.kind]:s,...n}=be("none","",!0);return{[_]:R(e),[c.kind]:s,[P]:Ue,...w(I()),...n,...F(!0)}}const io=v(y,"none",Ce);export{ro as BOX_HIGHLIGHT_ROW,io as BOX_NEXT_PICTURE_ROW,so as boxHoverFields,to as cardHoverFields,oo as hoverFields,no as offerNextPicture,be as pictureHoverFields};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { type EditorBlocks, type OfferedSets } from "../editor-blocks.js";
|
|
2
2
|
import { type EaselSession as EditorSession } from "efficient-easel/screen/lib/session";
|
|
3
|
+
import { type BlockSet, type PressNeedsSet } from "../../../format/lib/document/section-catalog.js";
|
|
3
4
|
export interface BlockOffer {
|
|
4
5
|
readonly sets: OfferedSets;
|
|
5
6
|
offers(type: string): boolean;
|
|
6
7
|
}
|
|
7
8
|
export declare function blocksLaidDownBy(type: string): readonly string[];
|
|
9
|
+
export declare function blocksOutsideItsSet(type: string, laid?: readonly string[], setOf?: (type: string) => BlockSet | undefined, needs?: Readonly<Record<string, PressNeedsSet>>): readonly string[];
|
|
8
10
|
export declare function resolveBlockOffer(blocks: EditorBlocks | null | undefined): BlockOffer | null;
|
|
9
11
|
export declare function blockOfferOf(session?: EditorSession): BlockOffer | null;
|
|
10
12
|
export declare function blockIsOffered(type: string, session?: EditorSession): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{offeredSets as
|
|
1
|
+
import{offeredSets as h}from"../editor-blocks.js";import{currentEaselSession as u}from"efficient-easel/screen/lib/session";import{blocksOf as E}from"../website-session.js";import{layoutPresetFor as T}from"../sections/text-layouts.js";import{blockTypesIn as d}from"efficient-easel/screen/lib/document/block-types-in";import{blockSetOf as w,PRESS_NEEDS_SET as _}from"../../../format/lib/document/section-catalog.js";import{SLOT_SECTION_SPECS as S}from"../../../render/lib/document/slot-specs.js";const m=()=>({}),O=new Map;function p(e){const n=O.get(e);if(n)return n;const t=new Set,f=Object.prototype.hasOwnProperty.call(S,e)?S[e]:void 0;if(f)for(const r of f.seeds(m))for(const s of d({type:f.childType,props:r}))t.add(s);const c=T(e);if(c){let r=0;for(const s of d(c(m,o=>`${o}-${r+=1}`)))t.add(s)}t.delete(e);const i=[...t].sort();return O.set(e,i),i}function N(e,n=p(e),t=w,f=_){const c=new Set(["general"]),i=t(e);return i&&c.add(i),Object.prototype.hasOwnProperty.call(f,e)&&c.add(f[e].set),n.filter(r=>{const s=t(r);return!s||!c.has(s)})}function x(e){if(!e||!e.sets&&!e.allow&&!e.deny?.length)return null;const n=h(e),t=e.allow?new Set(e.allow):null,f=new Set(e.deny??[]),c=new Set(Object.keys(e.host??{})),i=o=>{if(f.has(o))return!1;if(c.has(o))return!0;const l=w(o);return!l||!n[l]?!1:t?t.has(o):!0},r=new Map,s=o=>{const l=r.get(o);if(l!==void 0)return l;r.set(o,!1);const a=i(o)&&p(o).every(s);return r.set(o,a),a};return{sets:n,offers:s}}const P="block-offer";function b(e=u()){return e.cache(P,()=>x(E(e)))}function v(e,n=u()){const t=b(n);return t?t.offers(e):!0}export{v as blockIsOffered,b as blockOfferOf,p as blocksLaidDownBy,N as blocksOutsideItsSet,x as resolveBlockOffer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{phoneKey as r,tabletKey as i}from"efficient-easel/draw";import{BOX_CARD_PAD as E,BOX_SWATCH_PROP as bo,boxCardProps as Po,boxIsCard as x}from"../../../../../../format/lib/content/box-background.js";import{BOX_IS_CARD_RULE as ko,BOX_IS_NOT_CARD_RULE as Fo,BOX_ROW_IMAGE_PROP as Ho}from"../../../../../../format/lib/content/box-card-rule.js";import{CARD_ROW_FACTS as Wo,cardRowField as y,cardRowFields as Bo,cardRowLinkField as xo,typedLinkField as yo}from"../../../card-row-fields.js";import{CARD_ROW_LINK_PROP as Mo,cardCopyPlace as Uo}from"../../../../../../format/lib/content/card-template.js";import{HOVER_KEY as M}from"../../../../../../format/lib/animation/hover.js";import{BOX_HIGHLIGHT_ROW as Ko}from"../../../../animation/hover-fields.js";import{darkenFields as Xo}from"../../../darken-fields.js";import{BOX_TAB_SHAPES as Go,REEL_SHAPE_LABELS as Yo}from"../../../../../../format/lib/reel.js";import{LAYOUT_CELL as U,CARD_LIST_STYLE_PICTURES as vo,TAB_SHAPE_PICTURES as jo}from"../../../choice-pictures.js";import{CARD_STYLE_KEY as C,CARD_STYLE_POINTS as Vo,applyCardStyle as Jo,isCardStyle as zo}from"../../../../../../render/lib/sections/card-list-style.js";import{deviceField as a}from"efficient-easel/screen/lib/document/device-fields";import{ChevronDownIcon as qo,ClockIcon as Qo,CropIcon as K,GapIcon as Zo,MediaLayoutStackedIcon as X,LineBetweenIcon as $o,LineSolidIcon as oe,ListIcon as ee,NumberedListIcon as G,ShadowIcon as ne,StylesIcon as Y,TableIcon as v,TargetIcon as te,WrapIcon as j}from"efficient-easel/icons";import{boxBlockSpacingField as re,boxFillField as ie,boxColumnsFields as le,boxShareField as ae,boxSharePhoneField as se,boxShareTabletField as de,containerDirectionField as ce,containerGapRows as _e,linkField as pe,plainText as Se,swapPadding as V,toggle as c,upload as J,withPanelOnly as Oe}from"../../../controls.js";import{BOX_STACK_LINE as L,BOX_STACK_RANGE as f,STACK_BELOW_PROP as T}from"../../../../../../render/lib/content/box-stack-line.js";import{BOX_SHAPES as z,boxShapeOf as me}from"../../../../../../format/lib/content/box-shape.js";import{BOX_ANGLE_PROP as fe}from"../../../../../../format/lib/content/box-angle.js";import{shapeLines as q}from"../../../../../../format/lib/content/gallery-card-layout.js";import{shapePickerRow as Q}from"../../../shape-picker.js";import{ACCORDION_COLUMN_COUNTS as Re,ACCORDION_PHONE_COLUMN_COUNTS as he,BOX_COLUMNS_MAX as D,BOX_COLUMNS_MIN as I,boxPhoneRowOneLine as ue,boxWrapWordOf as Z}from"../../../../../../format/lib/content/box-layout.js";import{BOX_SEPARATOR_POINTS as $}from"../../../../../../format/lib/content/box-separator.js";import{BOX_WRAP_LABEL as oo,VIEW_KEY_ACCESS as s,group as R,phoneTwinFields as d}from"efficient-easel/screen/lib/document/box-fields";import{angleRow as Ae,boxAlignField as Ce,boxJustifyField as we,boxWrapField as N,iconPickerRow as g,placementField as Ee,select as b,sidesPaddingFields as eo,slider as no}from"../../../box-fields.js";import{withRowRules as Te,withShowWhen as to}from"../../../../../../render/lib/document/show-when.js";import{separatorField as Ne}from"../../../separator-field.js";import{LOOP_SCROLLS as Le}from"../../../../../../format/lib/animation/index.js";import{DEFAULT_TICKER_JOIN as De,TICKER_JOIN_OPTIONS as Ie}from"../../../../../../format/lib/sections/ticker-join.js";import{NOT_HELD_BY_A_NODE as ro}from"../../../../../../format/lib/document/passes/document-position.js";import{BOX_SIDE_SPACE_PROP as io}from"../../../../../../format/lib/content/box-side-space.js";import{boxSideSpaceField as ge}from"../../../box-side-space-field.js";import{accordionOnSet as be}from"../../../box-accordion-seed.js";import{ACCORDION_ROW_STYLE_POINTS as Pe,ACCORDION_ROW_STYLE_PROP as P}from"../../../../../../format/lib/content/accordion-row-style.js";import{FlexSlots as lo}from"../../../../../../format/lib/document/blocks/general/Flex/meta.js";import{BOX_TYPE as ke,CONTAINER_BLOCKS_SLOT as Fe}from"../../../../../../format/lib/document/container-blocks.js";import{boxPhoneOrderField as He}from"../../../box-phone-order-field.js";import{CARD_BOX_FACTS as We,ON_A_CARD as ao,cardDisplayField as k}from"../../../card-display-chips.js";import{MIRROR_CARDS_FACTS as Be,MIRROR_CARDS_MIRRORS as xe,mirrorCardsField as ye}from"../../../mirror-cards-field.js";import{handedRowOf as so}from"../../../../../../format/lib/document/row-hand.js";import{SHOW_FOR_FACTS as Me,showForField as Ue,showForFields as Ke}from"../../../show-for-field.js";import{SHARED_COLUMNS_KEY as h,SHARED_COLUMNS_LABEL as co,SHARED_COLUMNS_OFF as _o,sharedColumnsDrawn as po,sharedColumnsFits as So,SHARED_COLUMNS_PHONE_POINTS as Xe,SHARED_COLUMNS_POINTS as Ge,sharedRowsDrawn as Ye}from"../../../../../../render/lib/content/box-shared-columns.js";const Oo=ko,mo={all:[{field:"phoneRow",in:[2,3]},{not:{field:"direction",is:"accordion"}}]},ve={field:"direction",is:"tabs"},je={field:"line",in:[!0,!1]},Ve={field:"anchor",set:!0},F=["fixed","screen"],Je={not:{any:[{field:"sectionHeightMode",in:F},{field:"sectionHeightModeTablet",in:F},{field:"sectionHeightModePhone",in:F}]}},ze={context:"parent.line",is:!0},_={not:{field:"direction",is:"accordion"}},fo={field:"direction",is:"accordion"},Ro={any:[_,{not:{field:P,is:"numbered"}},{field:"columns",in:[...Re]},{field:"phoneRow",in:[...he]}]},ho="notAccordionRow",qe={not:{context:ho,is:!0}},Qe={[ho]:(o,e)=>e.parent?.props?.direction!=="accordion"},H={field:"direction",is:"row",default:"row"},p={not:Le},S={all:[H,p,{not:{field:"separator",in:$.map(o=>o.value)}},{not:{field:"line",is:!0}}]},Ze={field:"direction",is:"column"},uo={all:[S,...["columns",i("columns")].map(o=>({not:{field:o,in:Array.from({length:D},(e,n)=>n+I)}}))]},$e={all:[p,{not:{all:[H,{field:"separator",in:$.map(o=>o.value)}]}}]},W={not:{all:[S,{field:"columns",in:Array.from({length:D},(o,e)=>e+I)}]}},on="sharedColumnsFits",Ao="sharedColumnsMisfit",Co="sharedColumnsDraws",wo="sharedColumnsPhoneDraws";function O(o,e){return Po(o.props??{},Uo(e.appState,o.props?.id)?.inCopy!==!1)}const en={[on]:(o,e)=>So(O(o,e)),[Ao]:(o,e)=>!So(O(o,e)),[Co]:(o,e)=>po(O(o,e)).desktop,[wo]:(o,e)=>po(O(o,e)).phone};function Eo(o){return{all:[{not:{context:Ao,is:!0}},{any:[ao,{field:o,set:!0}]}]}}const m={not:{context:Co,is:!0}},u={not:{context:wo,is:!0}},To="sharedRowsDraws",nn={[To]:(o,e)=>Ye(O(o,e))&&so(e.appState,o.props?.id)?.row===void 0},w={not:{context:To,is:!0}},tn={any:[m,u]},B=Fo,rn={not:{context:xe,is:!0}},No="rowHanded",ln={not:{context:No,is:!0}},an={[No]:(o,e)=>{const n=so(e.appState,o.props?.id);return n===void 0?void 0:n?.row!==void 0}},Lo={all:[_,B,m,u,rn]},sn={field:"direction",is:"row"},dn={field:"align",in:["start","center","end"]},cn={all:[{field:"darken",set:!0},{not:{field:"darken",in:[0,"0"]}}]};function _n(){const{darken:o,darkenStyle:e}=Xo();return{...d("darken",o,s),...d("darkenStyle",e,s)}}const Do={not:{all:[S,{field:i("columns"),in:Array.from({length:D},(o,e)=>e+I)}]}};function pn(){const o=c(oo,!1,t(j,{})),e=n=>{const l=Z(n);return l===void 0?void 0:l==="wrap"};return{...N(),render:n=>o.render({...n,value:e(n.value),follows:e(n.follows)??!1,onChange:l=>n.onChange(l===void 0?void 0:l?"wrap":"nowrap")})}}function Sn(){const o=c(oo,!0,t(j,{})),e=n=>{const l=Z(n);return l===void 0?void 0:l==="wrap"};return{...N(),render:n=>{const l=n.followsView==="tablet";return o.render({...n,value:e(n.value),follows:!ue(void 0,l?n.follows:void 0),followsNoView:!l,onChange:A=>n.onChange(A===void 0?void 0:A?"wrap":"nowrap")})}}}const Io={hint:L},go={all:[B,{any:[Ze,{all:[S,Do,{not:{all:[uo,{field:i("share"),set:!0}]}}]}]}]},On=to(a("desktop",no("Narrows below",t(X,{}),f.min,f.max,f.step,L,{kind:"breakpoint"},{clear:Io,hint:"Under this screen width the side space narrows and the Phone Padding is used."})),go);function mn(o,e){const n=o;return!(T in n)||e.direction!=="column"?o:{...n,[T]:On}}const lt={fields:Te({_gContent:R("Content"),rowTitle:lo.rowTitle,content:lo.content,_gCardDisplay:R("Display"),cardDisplay:k("desktop"),cardDisplayTablet:k("tablet"),cardDisplayPhone:k("mobile"),showFor:Ue(),_gLayout:R("Layout"),direction:ce("Flex"),tabShape:g("Tab shape",t(Y,{}),Go.map(o=>({label:Yo[o],value:o,picture:jo[o]})),"tabs",{columns:2,cell:U}),mirrorCards:ye(),[T]:a("desktop",no("Stacks below",t(X,{}),f.min,f.max,f.step,L,{kind:"breakpoint"},{clear:Io,hint:"Under this screen width the blocks stand one under another, with the Phone Gap and Padding."})),[io]:ge(),startsOpen:a("desktop",c("Starts open",!1,t(qo,{}))),[P]:a("desktop",g("Row style",t(G,{}),Pe.map(o=>({...o,picture:o.value==="numbered"?t(G,{}):t(ee,{})})),"plain",{columns:2})),label:Oe(Se("Tab name")),..._e("Flex"),...d("justify",we(),s),...d("align",Ce(),s),...(()=>{const o=d("wrap",N(),s,{phoneRow:Sn()}),e=d("wrap",N(),s,{phoneRow:pn()});return{wrap:e.wrap,[i("wrap")]:e[i("wrap")],[r("wrap")]:o[r("wrap")]}})(),[r("order")]:He(),...d("boxShape",Q("Box shape",t(K,{}),q(z),"shape","auto"),s,{phoneRow:Q("Box shape",t(K,{}),q(z),"shape","auto",{phoneRest:o=>me(o)})}),[fe]:a("desktop",Ae(0,{clear:{hint:0},hint:"Turns the box. 0° is straight."})),separator:Ne(t($o,{size:18}),"none"),[C]:a("desktop",g("Card style",t(Y,{}),Vo.map(o=>({...o,picture:vo[o.value]})),"table",{columns:2,cell:U})),share:a("desktop",ae()),[i("share")]:de(),[r("share")]:se(),[h]:a("desktop",b(co,t(v,{}),[...Ge],_o)),[r(h)]:a("mobile",b(co,t(v,{}),[...Xe],_o)),...le(),...d("blockSpacing",re(),s),line:c("Line",!1,t(oe,{}),"A line across the blocks, with a dot on each."),upcoming:c("Upcoming",!1,t(Qo,{}),"Still to come: a hollow dot, and the gold line stops before it."),join:b("Join",t(Zo,{}),Ie,De),_gShadow:R("Shadow"),...d("shadow",c("Shadow",!1,t(ne,{})),s),...d("fillColor",ie(),s),[bo]:y("Fill content","colour"),_gBackground:R("Background image"),bgImage:a("desktop",J("Image","image/*")),bgImagePhone:a("mobile",J("Image","image/*")),[Ho]:y("Image content","image",{content:!0}),..._n(),placement:Ee("Content position"),_gLink:R("Link"),link:yo(pe("Link to")),[Mo]:xo(),jumpHighlight:c("Highlight when a link jumps here",!1,t(te,{}),"When a link lands on this Box's anchor, the Box gets a main color outline and its first block turns the main color.")},[[["darken","darkenStyle","placement"],Oo],[[r("share")],{all:[mo,u]}],[[h],Eo(h)],[[r(h)],Eo(r(h))],[[r("wrap")],{all:[mo,p,u,w]}],[[r("order")],{all:[S,u,m]}],[["phoneRow"],u],[[P],fo],[["tabShape"],ve],[["rowTitle","startsOpen"],qe],[["align","blockSpacing",i("blockSpacing"),r("blockSpacing")],_],[[i("justify"),r("justify")],{all:[p,Lo,w]}],[[i("align"),r("align")],{all:[sn,dn,Lo]}],[[i("wrap")],{all:[p,W,Do,m,_,w]}],[[i("shadow"),r("shadow")],B],[[i("darken"),r("darken"),i("darkenStyle"),r("darkenStyle")],{all:[Oo,cn]}],[["separator"],H],[[C],{field:C,set:!0}],[["columns"],{any:[S,fo]}],[[i("columns")],S],[[T],go],[[i("gap")],{all:[$e,Ro]}],[["gap",r("gap")],Ro],[["justify"],{all:[p,tn,_,w]}],[["wrap"],{all:[p,W,m,_,w]}],[["share"],{all:[W,m,_]}],[[i("share")],{all:[uo,m]}],[["line"],je],[["upcoming"],ze],[["jumpHighlight"],Ve],[["boxShape",i("boxShape"),r("boxShape")],Je],[["direction","share",r("order")],ln],[["join"],ro],[[io],ro]]),resolveData:(o,e)=>{const n=o.props,l=n[C];return e.changed?.[C]===!0&&zo(l)?{...o,props:Jo(n,l,ke,Fe)}:n.direction==="accordion"&&(e.trigger==="insert"||e.changed?.direction===!0)?{...o,props:be(n)}:o},resolveFields:(o,e)=>mn(Rn(Ke(hn(o,{...e,fields:Bo(e.fields,o,e)}),o.props),O(o,e)),o.props),showWhenFacts:{...Wo,...We,...Be,...an,...en,...nn,...Me,...Qe}},fn=to(Ko,ao);function Rn(o,e){const n=o;return!(M in n)||x(e)?o:{...n,[M]:fn}}function hn(...[o,e]){const{fields:n}=e;{if(x(O(o,e))){const A=eo({fallback:{top:E.desktop,bottom:E.desktop,left:E.side,right:E.side},tablet:!0,siteSide:!0});return V(n,A)}return o.props.padV2!==!0?V(n,eo({fallback:{top:24,bottom:24},tablet:!0,siteSide:!0})):n}}export{lt as FlexFields};
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{phoneKey as i,tabletKey as l}from"efficient-easel/draw";import{BOX_CARD_PAD as E,BOX_SWATCH_PROP as ko,boxCardProps as Ho,boxIsCard as I}from"../../../../../../format/lib/content/box-background.js";import{BOX_IS_CARD_RULE as Fo,BOX_IS_NOT_CARD_RULE as Wo,BOX_ROW_IMAGE_PROP as yo}from"../../../../../../format/lib/content/box-card-rule.js";import{CARD_ROW_FACTS as Bo,cardRowField as M,cardRowFields as xo,cardRowLinkField as Uo,typedLinkField as Mo}from"../../../card-row-fields.js";import{CARD_ROW_LINK_PROP as Ko,cardCopyPlace as K,cardTemplateCardOwner as Xo}from"../../../../../../format/lib/content/card-template.js";import{BOX_SHOW_KEY as Go,HOVER_GROUP_KEY as Yo,HOVER_KEY as T}from"../../../../../../format/lib/animation/hover.js";import{BOX_HIGHLIGHT_ROW as vo,BOX_NEXT_PICTURE_ROW as jo}from"../../../../animation/hover-fields.js";import{darkenFields as Vo}from"../../../darken-fields.js";import{BOX_TAB_SHAPES as Jo,REEL_SHAPE_LABELS as zo}from"../../../../../../format/lib/reel.js";import{LAYOUT_CELL as X,CARD_LIST_STYLE_PICTURES as qo,TAB_SHAPE_PICTURES as Qo}from"../../../choice-pictures.js";import{CARD_STYLE_KEY as A,CARD_STYLE_POINTS as Zo,applyCardStyle as $o,isCardStyle as oe}from"../../../../../../render/lib/sections/card-list-style.js";import{deviceField as a}from"efficient-easel/screen/lib/document/device-fields";import{ChevronDownIcon as ee,ClockIcon as ne,CropIcon as G,GapIcon as te,MediaLayoutStackedIcon as Y,LineBetweenIcon as re,LineSolidIcon as ie,ListIcon as le,NumberedListIcon as v,ShadowIcon as ae,StylesIcon as j,TableIcon as V,TargetIcon as se,WrapIcon as J}from"efficient-easel/icons";import{boxBlockSpacingField as de,boxFillField as ce,boxColumnsFields as _e,boxShareField as pe,boxSharePhoneField as Oe,boxShareTabletField as Se,containerDirectionField as me,containerGapRows as fe,linkField as Re,plainText as ue,swapPadding as z,toggle as c,upload as q,withPanelOnly as he}from"../../../controls.js";import{BOX_STACK_LINE as L,BOX_STACK_RANGE as R,STACK_BELOW_PROP as N}from"../../../../../../render/lib/content/box-stack-line.js";import{BOX_SHAPES as Q,boxShapeOf as Ce}from"../../../../../../format/lib/content/box-shape.js";import{BOX_ANGLE_PROP as Ae}from"../../../../../../format/lib/content/box-angle.js";import{shapeLines as Z}from"../../../../../../format/lib/content/gallery-card-layout.js";import{shapePickerRow as $}from"../../../shape-picker.js";import{ACCORDION_COLUMN_COUNTS as we,ACCORDION_PHONE_COLUMN_COUNTS as Ee,BOX_COLUMNS_MAX as g,BOX_COLUMNS_MIN as b,boxPhoneRowOneLine as Te,boxWrapWordOf as oo}from"../../../../../../format/lib/content/box-layout.js";import{BOX_SEPARATOR_POINTS as eo}from"../../../../../../format/lib/content/box-separator.js";import{BOX_WRAP_LABEL as no,VIEW_KEY_ACCESS as s,group as u,phoneTwinFields as d}from"efficient-easel/screen/lib/document/box-fields";import{angleRow as Ne,boxAlignField as De,boxJustifyField as Ie,boxWrapField as D,iconPickerRow as P,placementField as Le,select as k,sidesPaddingFields as to,slider as ro}from"../../../box-fields.js";import{withRowRules as ge,withShowWhen as H}from"../../../../../../render/lib/document/show-when.js";import{separatorField as be}from"../../../separator-field.js";import{LOOP_SCROLLS as Pe}from"../../../../../../format/lib/animation/index.js";import{DEFAULT_TICKER_JOIN as ke,TICKER_JOIN_OPTIONS as He}from"../../../../../../format/lib/sections/ticker-join.js";import{NOT_HELD_BY_A_NODE as io}from"../../../../../../format/lib/document/passes/document-position.js";import{BOX_SIDE_SPACE_PROP as lo}from"../../../../../../format/lib/content/box-side-space.js";import{boxSideSpaceField as Fe}from"../../../box-side-space-field.js";import{accordionOnSet as We}from"../../../box-accordion-seed.js";import{ACCORDION_ROW_STYLE_POINTS as ye,ACCORDION_ROW_STYLE_PROP as F}from"../../../../../../format/lib/content/accordion-row-style.js";import{FlexSlots as ao}from"../../../../../../format/lib/document/blocks/general/Flex/meta.js";import{BOX_TYPE as Be,CONTAINER_BLOCKS_SLOT as xe}from"../../../../../../format/lib/document/container-blocks.js";import{boxPhoneOrderField as Ue}from"../../../box-phone-order-field.js";import{CARD_BOX_FACTS as Me,ON_A_CARD as so,ON_A_PICTURE_OR_CARD as Ke,cardDisplayField as W}from"../../../card-display-chips.js";import{MIRROR_CARDS_FACTS as Xe,MIRROR_CARDS_MIRRORS as Ge,mirrorCardsField as Ye}from"../../../mirror-cards-field.js";import{handedRowOf as co}from"../../../../../../format/lib/document/row-hand.js";import{SHOW_FOR_FACTS as ve,showForField as je,showForFields as Ve}from"../../../show-for-field.js";import{SHARED_COLUMNS_KEY as h,SHARED_COLUMNS_LABEL as _o,SHARED_COLUMNS_OFF as po,sharedColumnsDrawn as Oo,sharedColumnsFits as So,SHARED_COLUMNS_PHONE_POINTS as Je,SHARED_COLUMNS_POINTS as ze,sharedRowsDrawn as qe}from"../../../../../../render/lib/content/box-shared-columns.js";const mo=Fo,fo={all:[{field:"phoneRow",in:[2,3]},{not:{field:"direction",is:"accordion"}}]},Qe={field:"direction",is:"tabs"},Ze={field:"line",in:[!0,!1]},$e={field:"anchor",set:!0},y=["fixed","screen","fill"],on={not:{any:[{field:"sectionHeightMode",in:y},{field:"sectionHeightModeTablet",in:y},{field:"sectionHeightModePhone",in:y}]}},en={context:"parent.line",is:!0},_={not:{field:"direction",is:"accordion"}},Ro={field:"direction",is:"accordion"},uo={any:[_,{not:{field:F,is:"numbered"}},{field:"columns",in:[...we]},{field:"phoneRow",in:[...Ee]}]},ho="notAccordionRow",nn={not:{context:ho,is:!0}},tn={[ho]:(o,e)=>e.parent?.props?.direction!=="accordion"},B={field:"direction",is:"row",default:"row"},p={not:Pe},O={all:[B,p,{not:{field:"separator",in:eo.map(o=>o.value)}},{not:{field:"line",is:!0}}]},rn={field:"direction",is:"column"},Co={all:[O,...["columns",l("columns")].map(o=>({not:{field:o,in:Array.from({length:g},(e,n)=>n+b)}}))]},ln={all:[p,{not:{all:[B,{field:"separator",in:eo.map(o=>o.value)}]}}]},x={not:{all:[O,{field:"columns",in:Array.from({length:g},(o,e)=>e+b)}]}},an="sharedColumnsFits",Ao="sharedColumnsMisfit",wo="sharedColumnsDraws",Eo="sharedColumnsPhoneDraws";function S(o,e){return Ho(o.props??{},K(e.appState,o.props?.id)?.inCopy!==!1)}const sn={[an]:(o,e)=>So(S(o,e)),[Ao]:(o,e)=>!So(S(o,e)),[wo]:(o,e)=>Oo(S(o,e)).desktop,[Eo]:(o,e)=>Oo(S(o,e)).phone};function To(o){return{all:[{not:{context:Ao,is:!0}},{any:[so,{field:o,set:!0}]}]}}const m={not:{context:wo,is:!0}},C={not:{context:Eo,is:!0}},No="sharedRowsDraws",dn={[No]:(o,e)=>qe(S(o,e))&&co(e.appState,o.props?.id)?.row===void 0},w={not:{context:No,is:!0}},cn={any:[m,C]},U=Wo,_n={not:{context:Ge,is:!0}},Do="rowHanded",pn={not:{context:Do,is:!0}},On={[Do]:(o,e)=>{const n=co(e.appState,o.props?.id);return n===void 0?void 0:n?.row!==void 0}},Io={all:[_,U,m,C,_n]},Sn={field:"direction",is:"row"},mn={field:"align",in:["start","center","end"]},fn={all:[{field:"darken",set:!0},{not:{field:"darken",in:[0,"0"]}}]};function Rn(){const{darken:o,darkenStyle:e}=Vo();return{...d("darken",o,s),...d("darkenStyle",e,s)}}const Lo={not:{all:[O,{field:l("columns"),in:Array.from({length:g},(o,e)=>e+b)}]}};function un(){const o=c(no,!1,r(J,{})),e=n=>{const t=oo(n);return t===void 0?void 0:t==="wrap"};return{...D(),render:n=>o.render({...n,value:e(n.value),follows:e(n.follows)??!1,onChange:t=>n.onChange(t===void 0?void 0:t?"wrap":"nowrap")})}}function hn(){const o=c(no,!0,r(J,{})),e=n=>{const t=oo(n);return t===void 0?void 0:t==="wrap"};return{...D(),render:n=>{const t=n.followsView==="tablet";return o.render({...n,value:e(n.value),follows:!Te(void 0,t?n.follows:void 0),followsNoView:!t,onChange:f=>n.onChange(f===void 0?void 0:f?"wrap":"nowrap")})}}}const go={hint:L},bo={all:[U,{any:[rn,{all:[O,Lo,{not:{all:[Co,{field:l("share"),set:!0}]}}]}]}]},Cn=H(a("desktop",ro("Narrows below",r(Y,{}),R.min,R.max,R.step,L,{kind:"breakpoint"},{clear:go,hint:"Under this screen width the side space narrows and the Phone Padding is used."})),bo);function An(o,e){const n=o;return!(N in n)||e.direction!=="column"?o:{...n,[N]:Cn}}const St={fields:ge({_gContent:u("Content"),rowTitle:ao.rowTitle,content:ao.content,_gCardDisplay:u("Display"),cardDisplay:W("desktop"),cardDisplayTablet:W("tablet"),cardDisplayPhone:W("mobile"),showFor:je(),_gLayout:u("Layout"),direction:me("Flex"),tabShape:P("Tab shape",r(j,{}),Jo.map(o=>({label:zo[o],value:o,picture:Qo[o]})),"tabs",{columns:2,cell:X}),mirrorCards:Ye(),[N]:a("desktop",ro("Stacks below",r(Y,{}),R.min,R.max,R.step,L,{kind:"breakpoint"},{clear:go,hint:"Under this screen width the blocks stand one under another, with the Phone Gap and Padding."})),[lo]:Fe(),startsOpen:a("desktop",c("Starts open",!1,r(ee,{}))),[F]:a("desktop",P("Row style",r(v,{}),ye.map(o=>({...o,picture:o.value==="numbered"?r(v,{}):r(le,{})})),"plain",{columns:2})),label:he(ue("Tab name")),...fe("Flex"),...d("justify",Ie(),s),...d("align",De(),s),...(()=>{const o=d("wrap",D(),s,{phoneRow:hn()}),e=d("wrap",D(),s,{phoneRow:un()});return{wrap:e.wrap,[l("wrap")]:e[l("wrap")],[i("wrap")]:o[i("wrap")]}})(),[i("order")]:Ue(),...d("boxShape",$("Box shape",r(G,{}),Z(Q),"shape","auto"),s,{phoneRow:$("Box shape",r(G,{}),Z(Q),"shape","auto",{phoneRest:o=>Ce(o)})}),[Ae]:a("desktop",Ne(0,{clear:{hint:0},hint:"Turns the box. 0° is straight."})),separator:be(r(re,{size:18}),"none"),[A]:a("desktop",P("Card style",r(j,{}),Zo.map(o=>({...o,picture:qo[o.value]})),"table",{columns:2,cell:X})),share:a("desktop",pe()),[l("share")]:Se(),[i("share")]:Oe(),[h]:a("desktop",k(_o,r(V,{}),[...ze],po)),[i(h)]:a("mobile",k(_o,r(V,{}),[...Je],po)),..._e(),...d("blockSpacing",de(),s),line:c("Line",!1,r(ie,{}),"A line across the blocks, with a dot on each."),upcoming:c("Upcoming",!1,r(ne,{}),"Still to come: a hollow dot, and the gold line stops before it."),join:k("Join",r(te,{}),He,ke),_gShadow:u("Shadow"),...d("shadow",c("Shadow",!1,r(ae,{})),s),...d("fillColor",ce(),s),[ko]:M("Fill content","colour"),_gBackground:u("Background image"),bgImage:a("desktop",q("Image","image/*")),bgImagePhone:a("mobile",q("Image","image/*")),[yo]:M("Image content","image",{content:!0}),...Rn(),placement:Le("Content position"),_gLink:u("Link"),link:Mo(Re("Link to")),[Ko]:Uo(),jumpHighlight:c("Highlight when a link jumps here",!1,r(se,{}),"When a link lands on this Box's anchor, the Box gets a main color outline and its first block turns the main color.")},[[["darken","darkenStyle","placement"],mo],[[i("share")],{all:[fo,C]}],[[h],To(h)],[[i(h)],To(i(h))],[[i("wrap")],{all:[fo,p,C,w]}],[[i("order")],{all:[O,C,m]}],[["phoneRow"],C],[[F],Ro],[["tabShape"],Qe],[["rowTitle","startsOpen"],nn],[["align","blockSpacing",l("blockSpacing"),i("blockSpacing")],_],[[l("justify"),i("justify")],{all:[p,Io,w]}],[[l("align"),i("align")],{all:[Sn,mn,Io]}],[[l("wrap")],{all:[p,x,Lo,m,_,w]}],[[l("shadow"),i("shadow")],U],[[l("darken"),i("darken"),l("darkenStyle"),i("darkenStyle")],{all:[mo,fn]}],[["separator"],B],[[A],{field:A,set:!0}],[["columns"],{any:[O,Ro]}],[[l("columns")],O],[[N],bo],[[l("gap")],{all:[ln,uo]}],[["gap",i("gap")],uo],[["justify"],{all:[p,cn,_,w]}],[["wrap"],{all:[p,x,m,_,w]}],[["share"],{all:[x,m,_]}],[[l("share")],{all:[Co,m]}],[["line"],Ze],[["upcoming"],en],[["jumpHighlight"],$e],[["boxShape",l("boxShape"),i("boxShape")],on],[["direction","share",i("order")],pn],[["join"],io],[[lo],io]]),resolveData:(o,e)=>{const n=o.props,t=n[A];return e.changed?.[A]===!0&&oe(t)?{...o,props:$o(n,t,Be,xe)}:n.direction==="accordion"&&(e.trigger==="insert"||e.changed?.direction===!0)?{...o,props:We(n)}:o},resolveFields:(o,e)=>{const n=K(e.appState,o.props?.id)?.inCopy===!0,t=n&&Xo(e.appState,o.props?.id)===null;return An(Tn(Nn(Ve(Dn(o,{...e,fields:xo(e.fields,o,e)}),o.props),S(o,e),n),t),o.props)},showWhenFacts:{...Bo,...Me,...Xe,...On,...sn,...dn,...ve,...tn}},wn=H(vo,so),En=["darken","darkenStyle",Yo,Go];function Tn(o,e){if(!e)return o;const n={...o};for(const t of En){if(!(t in n))continue;const{showWhen:f,...Po}=n[t];n[t]=Po}return n}function Nn(o,e,n=!1){const t=o;return T in t&&I(e)&&n?{...t,[T]:H(jo,Ke)}:!(T in t)||I(e)?o:{...t,[T]:wn}}function Dn(...[o,e]){const{fields:n}=e;{if(I(S(o,e))){const f=to({fallback:{top:E.desktop,bottom:E.desktop,left:E.side,right:E.side},tablet:!0,siteSide:!0});return z(n,f)}return o.props.padV2!==!0?z(n,to({fallback:{top:24,bottom:24},tablet:!0,siteSide:!0})):n}}export{St as FlexFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{CaseIcon as
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{CaseIcon as n,OpacityIcon as o,PlacementIcon as s}from"efficient-easel/icons";import{linkField as c,text as r,textarea as g,toggle as p,upload as l}from"../../../controls.js";import{group as e,section as m}from"efficient-easel/screen/lib/document/box-fields";import{alignmentFields as y,segmented as d,slider as i}from"../../../box-fields.js";import{VIEW_KEY_ACCESS as I}from"efficient-easel/screen/lib/document/box-fields";import{ctaField as u,photographyToggle as f}from"../../shared-fields.js";import{SPLIT_PH as a,IMGBTN_PH as _}from"../../../../../../format/lib/document/blocks/general/Split/meta.js";const h={fields:{_sText:m("Text column"),_gContent:e("Content"),eyebrow:r("Eyebrow",a.eyebrow),title:g("Heading",a.title),body:g("Body",a.body),uppercase:p("Uppercase heading",!1,t(n,{})),...y("textAlign",{access:I}),_gButton:e("Button"),...u,_gTextBg:e("Background image"),textBgSrc:l("Background image","image/*"),overlay:i("Overlay",t(o,{}),0,100,5,60,"%"),_sImage:m("Image column"),_gImage:e("Image"),imageSrc:l("Image","image/*"),reverse:d("Image side",t(s,{}),[{label:"Image left",value:!1},{label:"Image right",value:!0}],!1),_gImageBtn:e("Overlay button"),imageBtnText:r("Overlay button",_.text),imageBtnHref:c("Overlay button link"),_gStyle:e("Style"),grayscale:f(),imageOverlay:i("Image overlay",t(o,{}),0,100,5,40,"%")}};export{h as SplitFields};
|
|
@@ -3,7 +3,7 @@ import { boxFieldBuilders, type BoxFieldSay } from "efficient-easel/screen/lib/d
|
|
|
3
3
|
import type { ShowWhenRule } from "efficient-shell/format";
|
|
4
4
|
type Rows = ReturnType<typeof boxFieldBuilders>;
|
|
5
5
|
export declare const rowSay: BoxFieldSay;
|
|
6
|
-
export declare const LENGTH_UNITS_TABLE: Readonly<Record<"size" | "spacing" | "gap" | "
|
|
6
|
+
export declare const LENGTH_UNITS_TABLE: Readonly<Record<"size" | "spacing" | "gap" | "radius" | "fontSize" | "letterSpacing" | "position" | "border" | "height" | "breakpoint", readonly ("px" | "%" | "vw")[]>>;
|
|
7
7
|
export declare const slider: Rows["slider"];
|
|
8
8
|
export declare const select: Rows["select"];
|
|
9
9
|
export declare const Segmented: Rows["Segmented"];
|
|
@@ -3,6 +3,7 @@ import { type CardRowFieldSpec } from "../../../format/lib/content/card-template
|
|
|
3
3
|
import { type BlockShowWhenFacts, type ShowWhenRule } from "../../../format/lib/document/show-when-attach.js";
|
|
4
4
|
export declare const NOT_CARD_OF_TEMPLATE = "notCardOfTemplate";
|
|
5
5
|
export declare const ON_A_CARD: ShowWhenRule;
|
|
6
|
+
export declare const ON_A_PICTURE_OR_CARD: ShowWhenRule;
|
|
6
7
|
export declare const CARD_BOX_FACTS: BlockShowWhenFacts;
|
|
7
8
|
type Child = {
|
|
8
9
|
type: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as m}from"react/jsx-runtime";import{isNodeList as A}from"efficient-easel/data";import{useEasel as D}from"efficient-easel/easel";import{hiddenInView as N,hiddenKeyOf as _,hidePatch as T,slotChildName as E,slotChildRowName as P}from"efficient-easel/draw";import{cardListFieldsOf as F,cardTemplateCardOwner as k,cardTemplateSlotOf as L,namedRowField as j,rowFieldSpec as I}from"../../../format/lib/content/card-template.js";import{DisplayRow as w,useSelectedPatch as M}from"./controls.js";import{websiteNodeIsLocked as $}from"./locked-blocks.js";import{stripMarkup as B}from"../../../format/lib/markup.js";import{sourceRowName as U}from"../../../format/lib/document/source-row-name.js";import{withShowWhen as X}from"../../../format/lib/document/show-when-attach.js";import{deviceField as H}from"efficient-easel/screen/lib/document/device-fields";import{NoControlMark as K}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{BOX_IS_CARD_RULE as V}from"../../../format/lib/content/box-card-rule.js";const x="notCardOfTemplate",S={not:{context:x,is:!0}},me={any:[V,S]},le={[x]:(e,n)=>{const t=k(n.appState,e.props?.id);return t===void 0?void 0:t===null}};function l(e){const n=e.props?.content;return A(n)?n:[]}const y=(e,n)=>N(e.props??{},n),W=(e,n)=>e.props?.[_(n)]!==void 0;function g(e,n=()=>!1,t="desktop"){return l(e).flatMap(o=>typeof o?.props?.id!="string"?[]:l(o).length&&!y(o,t)?g(o,n,t):n(o)?[]:[o])}function Y(e,n,t,o="desktop"){const r=g(e,t,o).map(p=>({child:p,name:n(p)})),a=new Set(r.map(p=>p.name)),s=new Set;return r.map(({child:p,name:i})=>{let d=i;if(s.has(i)){let u=2;for(;a.has(`${i} ${u}`);)u+=1;d=`${i} ${u}`,a.add(d)}return s.add(i),{id:p.props.id,label:d,shown:!y(p,o)}})}function O(e,n,t){const o=r=>t==="desktop"?y(r,t):W(r,t);return l(e).flatMap(r=>o(r)?n(r)?[]:[r,...O(r,n,t)]:O(r,n,t))}function q(e,n){const t={...e};for(const[r,a]of Object.entries(n))a===void 0||r===_("desktop")&&a===!1?delete t[r]:t[r]=a;return Object.keys(t).length===Object.keys(e).length&&Object.keys(t).every(r=>t[r]===e[r])?e:t}function h(e,n,t){const o=l(e);let r=!1;const a=o.map(s=>{if(r)return s;let p=s;if(s?.props?.id===n){const i=q(s.props,t(s.props));i!==s.props&&(p={...s,props:i})}else p=h(s,n,t);return r=p!==s,p});return r?{...e,props:{...e.props,content:a}}:e}function b(e,n,t,o="desktop"){return h(e,n,r=>o==="desktop"&&y({props:r},o)===!t?{}:T(r,o,!t))}function z(e,n,t){return t==="desktop"?b(e,n,!0,t):h(e,n,()=>({[_(t)]:void 0}))}function G(e,n,t,o,r,a){return E(e).trim()?t(e):I({ownerType:n,owner:o,fields:r,slot:a},j(e.props))?.label??t(e)}const J="This page is read-only.";function Q({card:e,ownerType:n,owner:t,fields:o,slot:r,labelOf:a,write:s,readOnly:p,view:i="desktop"}){const d=f=>P(f,a,B,void 0,U),u=f=>$(f.type,f),C=Y(e,f=>G(f,n,d,t,o,r),u,i);return C.length?m(w,{parts:C,changed:O(e,u,i).length>0,shown:f=>C.find(c=>c.id===f)?.shown??!0,disabledReason:p?J:void 0,onPress:(f,c)=>s(R=>b(R,f,c,i)),onReset:()=>s(f=>O(f,u,i).reduce((c,R)=>z(c,String(R.props.id),i),f))}):m(K,{})}function Z(){try{const e=D(r=>r),n=e.config.components??{},t=e.selectedItem;if(!t)return null;const o=k(e.appState,t.props?.id);return{labelOf:r=>n[r]?.label??r,card:t,ownerType:typeof o?.type=="string"?o.type:void 0,owner:o,fields:F(e.appState,o),slot:L(e.appState,t.props?.id)??void 0}}catch{return null}}function v({readOnly:e,view:n}){const t=Z(),o=M();return t?m(Q,{...t,view:n,readOnly:e,write:r=>{e||o(a=>{const s={...t.card,props:a},p=r(s);return p===s?null:{content:p.props.content}})}}):m(w,{parts:[],changed:!1,shown:()=>!0,onPress:()=>{},onReset:()=>{}})}function ye(e){return X(H(e,{type:"custom",render:({readOnly:n})=>m(v,{readOnly:n,view:e})}),S)}export{le as CARD_BOX_FACTS,Q as CardDisplayChips,x as NOT_CARD_OF_TEMPLATE,S as ON_A_CARD,me as ON_A_PICTURE_OR_CARD,G as cardChipLabel,ye as cardDisplayField,Y as cardDisplayItems,g as cardDisplayParts,b as withChildShown};
|
|
@@ -6,7 +6,7 @@ import { readHidable, hidableText, type HidableValue } from "efficient-easel/dra
|
|
|
6
6
|
import { FOLD_FIELD_MARKER, LINK_FIELD_MARKER, MEDIA_FIELD_MARKER, SCAFFOLD_FIELD_MARKER, TEXT_FIELD_MARKER, foldMetaOf, textFieldIdentifier, type EdgeCell, type FoldFieldMeta, type TextFieldMeta, type TextListRendering } from "efficient-easel/draw";
|
|
7
7
|
import { type ShowWhenRule } from "../../../render/lib/document/show-when.js";
|
|
8
8
|
import { CARD_IMAGE_RADIUS_ROW } from "../../../format/lib/content/card-image-shape.js";
|
|
9
|
-
import {
|
|
9
|
+
import { FOCAL_DEFAULT, type UnitChoice as ShellUnitChoice } from "efficient-shell/ui";
|
|
10
10
|
import { type ColourChoice } from "./ColourControl.js";
|
|
11
11
|
import { type DeviceTier } from "efficient-easel/screen/lib/document/device-fields";
|
|
12
12
|
import type { GeocodeState } from "../../../format/lib/content/contact.js";
|
|
@@ -271,7 +271,9 @@ export declare function spacingFields(opts?: {
|
|
|
271
271
|
export declare function swapPadding(fields: Record<string, unknown>, padding: Record<string, unknown>): Record<string, unknown>;
|
|
272
272
|
export declare const WIDTH_LABEL = "Width";
|
|
273
273
|
export declare function widthField(defaultMode: WidthMode, modes?: readonly WidthMode[], inheritable?: boolean): Record<string, CustomField<undefined> | CustomField<string> | CustomField<number>>;
|
|
274
|
-
export declare function heightFields(
|
|
274
|
+
export declare function heightFields({ fill }?: {
|
|
275
|
+
fill?: boolean;
|
|
276
|
+
}): Record<string, CustomField<undefined> | CustomField<string> | CustomField<number>>;
|
|
275
277
|
export declare function heightFollowedBy(view: PanelView, props: Record<string, unknown>): {
|
|
276
278
|
mode: SectionHeightMode;
|
|
277
279
|
value: number;
|
|
@@ -307,17 +309,7 @@ export declare function ThemeFillRow({ label, icon, id, value, shown, onChange,
|
|
|
307
309
|
export declare function boxFillField(): CustomField<string>;
|
|
308
310
|
export declare function fillSlotChoices(value: string, colors: ReturnType<typeof normalizeThemeColors>, n: number, onChange: (next: string) => void): ColourChoice[];
|
|
309
311
|
export declare function boxThemeIndexOf(data: unknown, id: string, own: unknown): number | null;
|
|
310
|
-
export declare const FOCAL_POINTS: {
|
|
311
|
-
value: string;
|
|
312
|
-
label: string;
|
|
313
|
-
}[];
|
|
314
312
|
export { FOCAL_DEFAULT };
|
|
315
|
-
export declare function FocalPicker({ label, value, onChange, points, }: {
|
|
316
|
-
label: string;
|
|
317
|
-
value: string;
|
|
318
|
-
onChange: (next: string) => void;
|
|
319
|
-
points?: readonly AlignmentPoint[];
|
|
320
|
-
}): import("react").JSX.Element;
|
|
321
313
|
export declare function focusKeptField(): CustomField<string>;
|
|
322
314
|
export type { EdgeCell };
|
|
323
315
|
export declare const EDGE_ARROWS: Record<EdgeCell, ReactNode>;
|