efficient-web-builder 51.0.0 → 53.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.
- package/CHANGELOG.md +66 -0
- package/dist/editor/components/ChatSettingsPanel.js +1 -1
- package/dist/editor/components/MediaUploadField.d.ts +7 -7
- package/dist/editor/components/MediaUploadField.js +1 -1
- package/dist/editor/components/PartSettingsPanel.js +1 -1
- package/dist/editor/components/PartTextBox.js +1 -1
- package/dist/editor/components/PreviewPartAnchors.js +1 -1
- package/dist/editor/components/PreviewPartStyleContext.d.ts +2 -2
- package/dist/editor/components/SectionTextPartBridge.js +1 -1
- package/dist/editor/components/SiteAccentField.js +1 -1
- package/dist/editor/components/SiteTextStylesField.d.ts +3 -2
- package/dist/editor/components/SiteTextStylesField.js +1 -1
- package/dist/editor/components/WebsiteSettingsPanel.js +1 -1
- package/dist/editor/components/storefront-editor.css +82 -64
- package/dist/editor/lib/animation/entrance-fields.js +1 -1
- package/dist/editor/lib/animation/hover-fields.js +1 -1
- package/dist/editor/lib/document/ColourControl.d.ts +11 -8
- package/dist/editor/lib/document/ColourControl.js +1 -1
- package/dist/editor/lib/document/blocks/general/Breadcrumb/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/ButtonBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Cards/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Chart/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Contents/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Divider/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Hero/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/HeroSingle/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/HeroSlide/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/ImageBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/IntroBleed/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Logos/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Mockup/fields.js +2 -2
- package/dist/editor/lib/document/blocks/general/PostCard/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/SectionHeader/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Series/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/StatsParagraph/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Timeline/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/index.d.ts +2 -2
- package/dist/editor/lib/document/blocks/shared-fields.d.ts +5 -0
- package/dist/editor/lib/document/blocks/shared-fields.js +1 -1
- package/dist/editor/lib/document/box-fields.d.ts +23 -2
- package/dist/editor/lib/document/box-fields.js +1 -1
- package/dist/editor/lib/document/card-row-fields.js +1 -1
- package/dist/editor/lib/document/choice-pictures.d.ts +21 -0
- package/dist/editor/lib/document/choice-pictures.js +1 -0
- package/dist/editor/lib/document/controls.d.ts +33 -9
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/document/hidable-rows-drawn.d.ts +1 -0
- package/dist/editor/lib/document/hidable-rows-drawn.js +1 -1
- package/dist/editor/lib/document/overrides.js +1 -1
- package/dist/editor/lib/document/part-panel-rows.d.ts +1 -0
- package/dist/editor/lib/document/part-panel-rows.js +1 -1
- package/dist/editor/lib/document/passes/inspector.js +1 -1
- package/dist/editor/lib/document/separator-field.d.ts +9 -1
- package/dist/editor/lib/document/separator-field.js +1 -1
- package/dist/editor/lib/document/shape-picker.d.ts +37 -0
- package/dist/editor/lib/document/shape-picker.js +1 -0
- package/dist/editor/lib/document/show-for-field.d.ts +6 -0
- package/dist/editor/lib/document/show-for-field.js +1 -0
- package/dist/format/lib/animation/hover.d.ts +0 -2
- package/dist/format/lib/animation/hover.js +1 -1
- package/dist/format/lib/content/borders.d.ts +4 -2
- package/dist/format/lib/content/borders.js +1 -1
- package/dist/format/lib/content/box-layout.d.ts +21 -6
- package/dist/format/lib/content/box-layout.js +1 -1
- package/dist/format/lib/content/box-shape.d.ts +1 -5
- package/dist/format/lib/content/box-shape.js +1 -1
- package/dist/format/lib/content/box-show-for-choices.d.ts +9 -0
- package/dist/format/lib/content/box-show-for-choices.js +1 -0
- package/dist/format/lib/content/button-icon.d.ts +1 -1
- package/dist/format/lib/content/button-icon.js +1 -1
- package/dist/format/lib/content/card-state.d.ts +8 -0
- package/dist/format/lib/content/card-state.js +1 -0
- package/dist/format/lib/content/card-template.js +1 -1
- package/dist/format/lib/content/gallery-card-layout.d.ts +45 -1
- package/dist/format/lib/content/gallery-card-layout.js +1 -1
- package/dist/format/lib/content/image-aspect.d.ts +47 -0
- package/dist/format/lib/content/image-aspect.js +1 -0
- package/dist/format/lib/content/list-number.d.ts +11 -0
- package/dist/format/lib/content/list-number.js +1 -1
- package/dist/format/lib/content/phone-focus.d.ts +4 -1
- package/dist/format/lib/content/phone-focus.js +1 -1
- package/dist/format/lib/content/record-row.d.ts +14 -0
- package/dist/format/lib/content/record-row.js +1 -0
- package/dist/format/lib/content/record-types.d.ts +1 -1
- package/dist/format/lib/content/record-types.js +1 -1
- package/dist/format/lib/content/section-background.d.ts +10 -3
- package/dist/format/lib/content/section-background.js +1 -1
- package/dist/format/lib/content/section-height.d.ts +8 -0
- package/dist/format/lib/content/section-height.js +1 -1
- package/dist/format/lib/content/section-min-height.d.ts +17 -1
- package/dist/format/lib/content/section-min-height.js +1 -1
- package/dist/format/lib/content/section-sticky.d.ts +9 -0
- package/dist/format/lib/content/section-sticky.js +1 -1
- package/dist/format/lib/document/blocks/general/text-part-shapes.json +2 -2
- package/dist/format/lib/document/card-template-layers.d.ts +1 -1
- package/dist/format/lib/document/card-template-layers.js +1 -1
- package/dist/format/lib/document/media-manifest.json +5 -2
- package/dist/format/lib/document/mockup-variant-fields.d.ts +1 -0
- package/dist/format/lib/document/mockup-variant-fields.js +1 -1
- package/dist/format/lib/document/part-inks.d.ts +5 -10
- package/dist/format/lib/document/part-inks.js +1 -1
- package/dist/format/lib/document/passes/types.d.ts +1 -0
- package/dist/format/lib/document/section-catalog.js +2 -2
- package/dist/format/lib/document/section-descriptions.js +1 -1
- package/dist/format/lib/document/show-when-attach.d.ts +2 -1
- package/dist/format/lib/document/show-when-attach.js +1 -1
- package/dist/format/lib/editor-words-catalogue.d.ts +25 -14
- package/dist/format/lib/editor-words-catalogue.js +4 -4
- package/dist/format/lib/fonts.js +1 -1
- package/dist/format/lib/sections/divider-style.d.ts +4 -0
- package/dist/format/lib/sections/divider-style.js +1 -1
- package/dist/format/lib/sections/hero-single-to-hero.js +1 -1
- package/dist/format/lib/sections/section-presets.js +1 -1
- package/dist/format/lib/source-rules/editor-words.js +2 -2
- package/dist/format/lib/source-rules/mirrored-rows-agree.js +4 -4
- package/dist/format/lib/source-rules/panel-rows-use-the-shared-row.d.ts +4 -0
- package/dist/format/lib/source-rules/panel-rows-use-the-shared-row.js +37 -20
- package/dist/format/lib/source-rules/shape-rows-use-the-picker.d.ts +7 -0
- package/dist/format/lib/source-rules/shape-rows-use-the-picker.js +2 -0
- package/dist/format/lib/source-rules/support/part-slider-call-sites.d.ts +0 -1
- package/dist/format/lib/source-rules/support/part-slider-call-sites.js +6 -6
- package/dist/format/lib/text-styles/site-text-colours.d.ts +4 -0
- package/dist/format/lib/text-styles/site-text-colours.js +1 -0
- package/dist/format/lib/theme.d.ts +1 -0
- package/dist/format/lib/theme.js +3 -3
- package/dist/format/lib/word-styles.d.ts +0 -1
- package/dist/format/lib/word-styles.js +1 -1
- package/dist/render/components/Breadcrumb.d.ts +2 -1
- package/dist/render/components/Breadcrumb.js +1 -1
- package/dist/render/components/ButtonBlock.d.ts +1 -0
- package/dist/render/components/ButtonBlock.js +1 -1
- package/dist/render/components/CardRowContext.d.ts +6 -3
- package/dist/render/components/CardRowContext.js +1 -1
- package/dist/render/components/ContentsList.d.ts +4 -1
- package/dist/render/components/ContentsList.js +1 -1
- package/dist/render/components/CurrentRecord.d.ts +23 -0
- package/dist/render/components/CurrentRecord.js +1 -0
- package/dist/render/components/Flex.d.ts +3 -2
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/HeroPictures.d.ts +2 -0
- package/dist/render/components/HeroPictures.js +1 -1
- package/dist/render/components/HeroPoster.d.ts +2 -1
- package/dist/render/components/HeroPoster.js +1 -1
- package/dist/render/components/HeroSection.d.ts +2 -1
- package/dist/render/components/HeroSection.js +1 -1
- package/dist/render/components/HeroSingle.d.ts +3 -1
- package/dist/render/components/HeroSingle.js +1 -1
- package/dist/render/components/HeroSlide.d.ts +3 -1
- package/dist/render/components/HeroSlide.js +1 -1
- package/dist/render/components/ImageBlock.d.ts +5 -3
- package/dist/render/components/ImageBlock.js +1 -1
- package/dist/render/components/InBoxContext.d.ts +3 -0
- package/dist/render/components/SiteGutterFrame.d.ts +1 -0
- package/dist/render/components/SiteGutterFrame.js +1 -1
- package/dist/render/components/goldPhrases.js +2 -2
- package/dist/render/lib/content/block-size.d.ts +3 -0
- package/dist/render/lib/content/block-size.js +1 -1
- package/dist/render/lib/content/box-shared-columns.js +1 -1
- package/dist/render/lib/content/box-show-for.d.ts +14 -0
- package/dist/render/lib/content/box-show-for.js +1 -0
- package/dist/render/lib/content/page-contents.d.ts +1 -0
- package/dist/render/lib/content/page-contents.js +1 -1
- package/dist/render/lib/content/picture-focus-rows.d.ts +13 -0
- package/dist/render/lib/content/picture-focus-rows.js +1 -0
- package/dist/render/lib/document/blocks/general/Breadcrumb/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Cards/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Contents/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Hero/render.js +1 -1
- package/dist/render/lib/document/blocks/general/HeroSingle/render.js +1 -1
- package/dist/render/lib/document/blocks/general/HeroSlide/render.js +1 -1
- package/dist/render/lib/document/blocks/general/ImageBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +2 -0
- 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-cards.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-stats.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-timeline.js +2 -2
- package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
- package/dist/render/lib/document/part-styles.d.ts +21 -7
- package/dist/render/lib/document/part-styles.js +2 -2
- package/dist/render/lib/document/passes/block-size.js +1 -1
- package/dist/render/lib/document/passes/borders.js +1 -1
- package/dist/render/lib/document/passes/index.js +1 -1
- package/dist/render/lib/document/passes/section-height.js +1 -1
- package/dist/render/lib/document/passes/section-sticky.js +1 -1
- package/dist/render/lib/document/passes/show-for.d.ts +2 -0
- package/dist/render/lib/document/passes/show-for.js +1 -0
- package/dist/render/lib/document/show-when.d.ts +1 -1
- package/dist/render/lib/document/show-when.js +1 -1
- package/dist/render/lib/text-styles/site-text-styles.js +2 -2
- package/package.json +3 -3
- package/dist/editor/components/PartInkControl.d.ts +0 -7
- package/dist/editor/components/PartInkControl.js +0 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from "react";
|
|
2
|
+
import type { ShowWhenRule } from "efficient-shell/format";
|
|
3
|
+
import type { ShapeLine } from "../../../format/lib/content/gallery-card-layout.js";
|
|
4
|
+
export declare function fillRowCell<V extends string>(option: {
|
|
5
|
+
label: string;
|
|
6
|
+
value: V;
|
|
7
|
+
showWhen: ShowWhenRule;
|
|
8
|
+
}): {
|
|
9
|
+
picture: import("react").JSX.Element;
|
|
10
|
+
label: string;
|
|
11
|
+
value: V;
|
|
12
|
+
showWhen: ShowWhenRule;
|
|
13
|
+
};
|
|
14
|
+
export declare function shapePickerRow<V extends string>(label: string, icon: ReactElement, lines: readonly ShapeLine[], column: "shape" | "image", fallback: V, extra?: {
|
|
15
|
+
phoneRest?: (follows: unknown) => V | undefined;
|
|
16
|
+
more?: readonly {
|
|
17
|
+
label: string;
|
|
18
|
+
value: V;
|
|
19
|
+
picture: ReactNode;
|
|
20
|
+
showWhen: ShowWhenRule;
|
|
21
|
+
}[];
|
|
22
|
+
}): {
|
|
23
|
+
options: {
|
|
24
|
+
showWhen?: ShowWhenRule | undefined;
|
|
25
|
+
label?: string | undefined;
|
|
26
|
+
value: V;
|
|
27
|
+
}[];
|
|
28
|
+
render: (props: {
|
|
29
|
+
value?: unknown;
|
|
30
|
+
onChange: (v: V) => void;
|
|
31
|
+
field?: object;
|
|
32
|
+
readOnly?: boolean;
|
|
33
|
+
follows?: unknown;
|
|
34
|
+
followsView?: "desktop" | "tablet";
|
|
35
|
+
}) => import("react").FunctionComponentElement<import("efficient-easel/panel").SettingsFieldProps>;
|
|
36
|
+
type: "custom";
|
|
37
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as o,jsxs as a}from"react/jsx-runtime";import{iconPickerRow as d}from"./box-fields.js";const e=28,t=1.5;function x({ratio:r}){const[n,s]=r??[1,1],c=(e-t*2)/Math.max(n,s),h=n*c,i=s*c;return o("svg",{width:e,height:e,viewBox:`0 0 ${e} ${e}`,"aria-hidden":"true",children:o("rect",{x:(e-h)/2,y:(e-i)/2,width:h,height:i,rx:2,fill:"none",stroke:"currentColor",strokeWidth:t,strokeDasharray:r?void 0:"3 2"})})}function w(){const r=t*2;return a("svg",{width:e,height:e,viewBox:`0 0 ${e} ${e}`,"aria-hidden":"true",children:[o("line",{x1:t,y1:t/2,x2:e-t,y2:t/2,stroke:"currentColor",strokeWidth:t}),o("line",{x1:t,y1:e-t/2,x2:e-t,y2:e-t/2,stroke:"currentColor",strokeWidth:t}),o("rect",{x:e/4,y:r,width:e/2,height:e-r*2,rx:2,fill:"none",stroke:"currentColor",strokeWidth:t})]})}function m(r){return{...r,picture:o(w,{})}}const p={width:"5.25rem",height:"3.5rem"};function g(r,n,s,c,h,i={}){const u=[...s.map(l=>({value:l[c],label:l.label,picture:o(x,{ratio:l.ratio})})),...i.more??[]];return d(r,n,u,h,{columns:3,cell:p,phoneRest:i.phoneRest})}export{m as fillRowCell,g as shapePickerRow};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SelectField } from "efficient-easel/screen/lib/document/box-fields";
|
|
2
|
+
import { type BlockShowWhenFacts } from "../../../format/lib/document/show-when-attach.js";
|
|
3
|
+
export declare const SHOW_FOR_UNOFFERED = "showForUnoffered";
|
|
4
|
+
export declare const SHOW_FOR_FACTS: BlockShowWhenFacts;
|
|
5
|
+
export declare function showForField(): SelectField;
|
|
6
|
+
export declare function showForFields<Fields extends Record<string, unknown>>(fields: Fields, props: Record<string, unknown> | null | undefined): Fields;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as p}from"react/jsx-runtime";import{FilterIcon as v}from"efficient-easel/icons";import{deviceField as O}from"efficient-easel/screen/lib/document/device-fields";import{SHOW_FOR_PROP as f,showForChoices as w,showForChoicesRevision as x,showForOf as m}from"../../../format/lib/content/box-show-for-choices.js";import{select as _}from"./box-fields.js";import{withShowWhen as k}from"../../../format/lib/document/show-when-attach.js";const h="showForUnoffered",y={[h]:e=>w().length===0&&m(e.props?.[f])===void 0},R="Show for",S="All";function W(e,n){if(!e)return;const o=w().find(s=>s.slug===e);if(o)return{slug:o.slug,name:o.name};const r=m(n);return r?.slug===e?r:void 0}function E(){const e=_(R,p(v,{}),[{label:S,value:""}],"");return k(O("desktop",{...e,render:n=>e.render({...n,value:m(n.value)?.slug??"",onChange:o=>n.onChange(W(o,n.value))})}),{not:{context:h,is:!0}})}const F=new WeakMap;function H(e,n){const o=e[f];if(!o)return e;const r=w(),s=m(n?.[f]),t=s&&!r.some(c=>c.slug===s.slug)?s:void 0;let i=F.get(o);i||F.set(o,i=new Map);const u=`${x()}\0${t?`${t.slug}\0${t.name}`:""}`;let l=i.get(u);l||(l={...o,options:[...o.options,...r.map(c=>({label:c.name,value:c.slug})),...t?[{label:t.name,value:t.slug}]:[]]},i.set(u,l));let a=g.get(e);a||g.set(e,a=new Map);let d=a.get(u);return d||a.set(u,d={...e,[f]:l}),d}const g=new WeakMap;export{y as SHOW_FOR_FACTS,h as SHOW_FOR_UNOFFERED,E as showForField,H as showForFields};
|
|
@@ -27,14 +27,12 @@ export declare const CARD_HOVER_TURN: number;
|
|
|
27
27
|
export type CardHoverDrawn = {
|
|
28
28
|
kind: CardHover;
|
|
29
29
|
angle: number | null;
|
|
30
|
-
angleSet?: boolean;
|
|
31
30
|
duration: number;
|
|
32
31
|
delay: number;
|
|
33
32
|
};
|
|
34
33
|
export declare function cardHoverKindOf(record: Readonly<Record<string, unknown>>, resting: CardHover): CardHover;
|
|
35
34
|
export declare function cardHoverAngleOf(stored: unknown): number;
|
|
36
35
|
export declare function cardHoverOf(record: Readonly<Record<string, unknown>>, blockKey: string): CardHoverDrawn;
|
|
37
|
-
export declare function cardTurnFor(hover: CardHoverDrawn, spokes: unknown): CardHoverDrawn;
|
|
38
36
|
export declare function cardRotatesRule(resting: CardHover): ShowWhenRule;
|
|
39
37
|
export type PictureHover = Extract<HoverKind, "none" | "nextImage" | "mono">;
|
|
40
38
|
export declare const PICTURE_HOVER_KINDS: readonly PictureHover[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{HOVER_MOTION as E,motionSeconds as
|
|
1
|
+
import{HOVER_MOTION as E,motionSeconds as u}from"efficient-shell/format";import{finiteNumber as s}from"../finite-number.js";const i="hover",A="_gHover",H=["none","nextImage","rotate","zoom","lift","mono"],P={none:"None",nextImage:"Show next image",rotate:"Rotate",zoom:"Zoom",lift:"Lift",mono:"Black and white"};function a(n){return H.filter(e=>n.includes(e))}const v=a(["none","lift"]);function L(n){const e=n[i];return v.includes(e)?e:"none"}const R=a(["none","rotate"]),r={kind:i,angle:"hoverAngle",duration:"hoverDuration",delay:"hoverDelay"},l="spinOnHover",p={min:0,max:360,step:1},m={ProductGrid:"rotate",RelatedProducts:"rotate",AlloyWheelsListing:"none"},M=Object.keys(m);function I(n){return m[n]??"none"}const g=E.rotateFallbackDeg;function S(n,e){const t=n[r.kind];if(R.includes(t))return t;const o=n[l];return typeof o=="boolean"?o?"rotate":"none":e}function k(n){const e=s(n);return e===void 0?g:Math.min(p.max,Math.max(p.min,e))}function U(n,e){const t=I(e),o=S(n,t);return{kind:o,angle:o==="rotate"?k(n[r.angle]):null,duration:u("hover","duration",o==="rotate"?n[r.duration]:void 0),delay:u("hover","delay",o==="rotate"?n[r.delay]:void 0)}}function B(n){const e={field:r.kind,in:[...R]};return{any:[{field:r.kind,is:"rotate"},{all:[{not:e},n==="rotate"?{not:{field:l,is:!1}}:{field:l,is:!0}]}]}}const x=a(["none","mono"]),D=a(["none","nextImage","mono"]),O={ImageBlock:"none",Manifesto:"none",Split:"none",ContactLocations:"mono"},G=Object.keys(O);function N(n){return O[n]??"none"}const _={zoom:"hoverZoom",darken:"hoverDarken"},d={min:100,max:150,step:1,unit:"%"},c=["nextImage"];function V(n,e){if(!c.includes(e))return null;const t=s(n[_.zoom]);if(t===void 0)return null;const o=Math.min(d.max,Math.max(d.min,t));return o===d.min?null:String(o/100)}function h(n,e){if(!c.includes(e))return null;const t=s(n[_.darken]);return t!==void 0&&t>0?t:null}const C=["ImageBlock"];function K(n,e,t=x){const o=n[i];return t.includes(o)?o:e}function z(n,e=""){const t=C.includes(e)?D:x,o=K(n,N(e),t),f=o!=="none";return{kind:o,duration:u("hover","duration",f?n[r.duration]:void 0),delay:u("hover","delay",f?n[r.delay]:void 0),...c.includes(o)?{zoom:V(n,o),darken:h(n,o)}:{}}}function Y(){return{field:i,in:[...c]}}function b(n){return n==="none"?{field:i,in:["mono","nextImage"]}:{not:{field:i,is:"none"}}}export{p as CARD_HOVER_ANGLE,r as CARD_HOVER_KEYS,R as CARD_HOVER_KINDS,M as CARD_HOVER_SECTIONS,g as CARD_HOVER_TURN,A as HOVER_GROUP_KEY,i as HOVER_KEY,H as HOVER_KINDS,P as HOVER_KIND_LABELS,C as NEXT_PICTURE_BLOCKS,D as NEXT_PICTURE_HOVER_KINDS,l as OLD_SPIN_KEY,v as PART_HOVER_KINDS,G as PICTURE_HOVER_BLOCKS,_ as PICTURE_HOVER_KEYS,x as PICTURE_HOVER_KINDS,d as PICTURE_HOVER_ZOOM,k as cardHoverAngleOf,S as cardHoverKindOf,U as cardHoverOf,I as cardHoverResting,B as cardRotatesRule,L as hoverOf,K as pictureHoverKindOf,Y as pictureHoverMovesRule,z as pictureHoverOf,N as pictureHoverResting,b as pictureHoverRunsRule,V as pictureHoverZoomOf};
|
|
@@ -15,7 +15,9 @@ export type BorderValue = {
|
|
|
15
15
|
};
|
|
16
16
|
export declare const SECTION_BORDER_CLASS = "sf-section-border";
|
|
17
17
|
export declare const SECTION_BORDER_SELF_CLASS = "sf-section-border-self";
|
|
18
|
-
export declare function borderVars(value: BorderValue | null | undefined, { phone }?: {
|
|
18
|
+
export declare function borderVars(value: BorderValue | null | undefined, { phone, tablet }?: {
|
|
19
19
|
phone?: boolean;
|
|
20
|
+
tablet?: boolean;
|
|
20
21
|
}): Record<string, string> | undefined;
|
|
21
|
-
export declare function
|
|
22
|
+
export declare function borderBySide(value: BorderValue): BorderValue;
|
|
23
|
+
export declare function sectionBorderStyle(desktop: BorderValue | null | undefined, phone: BorderValue | null | undefined, tablet?: BorderValue | null): CSSProperties | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const b=20,p=["solid","dashed","dotted"],i=["top","right","bottom","left"],h="sf-section-border",E="sf-section-border-self",u=/^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,c=t=>typeof t=="number"&&Number.isFinite(t)?`${Math.min(20,Math.max(0,Math.round(t)))}px`:void 0;function s(t,{phone:n=!1,tablet:o=!1}={}){if(!t||typeof t!="object")return;const e=n?"-phone":o?"-tablet":"",r={};for(const f of i){const d=c(t[f])??c(t.width);d!==void 0&&(r[`--sf-border-${f}-width${e}`]=d)}return typeof t.style=="string"&&p.includes(t.style)&&(r[`--sf-border-style${e}`]=t.style),typeof t.color=="string"&&u.test(t.color)&&(r[`--sf-border-color${e}`]=t.color.toLowerCase()),Object.keys(r).length?r:void 0}function S(t){const{width:n,...o}=t;return typeof n!="number"?t:{...o,...Object.fromEntries(i.map(e=>[e,o[e]??n]))}}function y(t,n,o){const e=s(t),r=s(o,{tablet:!0}),f=s(o,{phone:!0})||s(n,{phone:!0})?{...s(o,{phone:!0}),...s(n,{phone:!0})}:void 0;return e||r||f?{...e,...r,...f}:void 0}export{b as BORDER_MAX,i as BORDER_SIDES,p as BORDER_STYLES,h as SECTION_BORDER_CLASS,E as SECTION_BORDER_SELF_CLASS,S as borderBySide,s as borderVars,y as sectionBorderStyle};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BoxAlign } from "efficient-easel/screen/lib/document/box-fields";
|
|
2
|
+
import type { ShowWhenRule } from "efficient-shell/format";
|
|
2
3
|
export declare const NESTED_BOX_PADDING: {
|
|
3
4
|
readonly sectionPaddingTop: 0;
|
|
4
5
|
readonly sectionPaddingBottom: 0;
|
|
@@ -16,29 +17,42 @@ export declare const BOX_SHARE_POINTS: readonly [{
|
|
|
16
17
|
readonly value: "equal";
|
|
17
18
|
readonly weights: readonly [1, 1];
|
|
18
19
|
}, {
|
|
19
|
-
readonly label: "Big left";
|
|
20
20
|
readonly value: "bigLeft";
|
|
21
21
|
readonly weights: readonly [2, 1];
|
|
22
22
|
}, {
|
|
23
|
-
readonly label: "Big right";
|
|
24
23
|
readonly value: "bigRight";
|
|
25
24
|
readonly weights: readonly [1, 2];
|
|
26
25
|
}, {
|
|
27
|
-
readonly label: "Bigger left";
|
|
28
26
|
readonly value: "biggerLeft";
|
|
29
27
|
readonly weights: readonly [3, 1];
|
|
30
28
|
}, {
|
|
31
|
-
readonly label: "Bigger right";
|
|
32
29
|
readonly value: "biggerRight";
|
|
33
30
|
readonly weights: readonly [1, 3];
|
|
34
31
|
}, {
|
|
35
|
-
readonly label: "2 : 3";
|
|
36
32
|
readonly value: "twoThree";
|
|
37
33
|
readonly weights: readonly [2, 3];
|
|
38
34
|
}];
|
|
39
35
|
export type BoxShare = (typeof BOX_SHARE_POINTS)[number]["value"];
|
|
36
|
+
export declare const BOX_SHARE_CHOICES: readonly [{
|
|
37
|
+
readonly label: "Fit content";
|
|
38
|
+
readonly value: "content";
|
|
39
|
+
readonly weights: null;
|
|
40
|
+
}, {
|
|
41
|
+
readonly label: "Equal";
|
|
42
|
+
readonly value: "equal";
|
|
43
|
+
readonly weights: readonly [1, 1];
|
|
44
|
+
}, {
|
|
45
|
+
readonly label: "Custom";
|
|
46
|
+
readonly value: "custom";
|
|
47
|
+
readonly weights: readonly [2, 1];
|
|
48
|
+
}];
|
|
49
|
+
export type BoxShareChoice = (typeof BOX_SHARE_CHOICES)[number]["value"];
|
|
50
|
+
export declare function boxShareChoiceOf(share: unknown): BoxShareChoice;
|
|
51
|
+
export declare function boxShareVars(share: unknown, shareTablet: unknown, count: number): Record<string, number> | undefined;
|
|
52
|
+
export declare function boxShareWidthsOf(share: unknown, count: number): unknown;
|
|
40
53
|
export declare function boxShareClasses(share: unknown): string;
|
|
41
|
-
export declare
|
|
54
|
+
export declare const BOX_GIVES_PICTURES_A_HEIGHT: ShowWhenRule;
|
|
55
|
+
export declare function boxShareTabletOf(shareTablet: unknown): string | readonly unknown[] | null;
|
|
42
56
|
export declare function boxRowTabletShareClass(box: {
|
|
43
57
|
direction?: unknown;
|
|
44
58
|
separator?: unknown;
|
|
@@ -83,6 +97,7 @@ export declare function boxRowColumnsClass(box: {
|
|
|
83
97
|
}): string;
|
|
84
98
|
export declare function boxPhoneRowOneLine(wrapPhone: unknown): boolean;
|
|
85
99
|
export declare function boxPhoneRowClasses(perRow: unknown, sharePhone?: unknown, wrapPhone?: unknown): string;
|
|
100
|
+
export declare function boxPhoneCellsShareLine(perRow: unknown, sharePhone: unknown): boolean;
|
|
86
101
|
export declare function boxPhoneRowFits(perRow: unknown, sharePhone: unknown): boolean;
|
|
87
102
|
export declare const BOX_BLOCK_SPACING_LABEL = "Block spacing";
|
|
88
103
|
export declare const BOX_BLOCK_SPACING_POINTS: readonly [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isStripBox as
|
|
1
|
+
import{isStripBox as p}from"./box-separator.js";const W={sectionPaddingTop:0,sectionPaddingBottom:0},x={start:"justify-start",center:"justify-center",between:"justify-between",end:"justify-end"},h={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"};function U(e,t){const i=typeof e=="string"&&e in x?x[e]:"",n=typeof t=="string"&&t in h?h[t]:"";return[i,n].filter(Boolean).join(" ")}function q(e){return e===!0||e==="wrap"?"flex-wrap":""}const F="Block widths",f=[{label:"Fit content",value:"content",weights:null},{label:"Equal",value:"equal",weights:[1,1]},{value:"bigLeft",weights:[2,1]},{value:"bigRight",weights:[1,2]},{value:"biggerLeft",weights:[3,1]},{value:"biggerRight",weights:[1,3]},{value:"twoThree",weights:[2,3]}],G=[{label:"Fit content",value:"content",weights:null},{label:"Equal",value:"equal",weights:[1,1]},{label:"Custom",value:"custom",weights:[2,1]}];function j(e){return Array.isArray(e)?"custom":e==="equal"?"equal":typeof e=="string"&&e in v?"custom":"content"}const u=4,_=10;function k(e,t){if(!Number.isInteger(t)||t<2||t>u||e.length!==t-1||!e.every(a=>typeof a=="number"&&Number.isFinite(a)))return;const i=[];let n=0;return e.forEach((a,o)=>{const r=100-n-_*(t-1-o),c=Math.min(r,Math.max(_,Math.round(a)));i.push(c),n+=c}),i}function m(e,t,i){if(!Array.isArray(t))return;const n=k(t,i),a=n?[...n,100-n.reduce((r,c)=>r+c,0)]:[],o={};for(let r=0;r<u;r+=1)o[`--${e}-${r+1}`]=a[r]??1;return o}function D(e,t,i){const n=m("sf-share",e,i),a=m("sf-share-tablet",t,i);return n||a?{...n,...a}:void 0}function C(e,t){const i=Array.from({length:t},()=>1),n=f.find(r=>r.value===e);if(!n?.weights||t<1)return i;const[a,o]=n.weights;return a>1&&(i[0]=a),o>1&&(i[t-1]=o),i}function K(e,t){if(typeof e!="string"||!(e in v)||e==="equal")return e;const i=C(e,t),n=i.reduce((a,o)=>a+o,0);return i.slice(0,-1).map(a=>Math.round(a/n*100))}const s="[&>*]:min-w-0 [&>*]:flex-1 [&>*]:basis-0",v={equal:s,bigLeft:`${s} [&>*:first-child]:view-wide:grow-[2]`,bigRight:`${s} [&>*:last-child]:view-wide:grow-[2]`,biggerLeft:`${s} [&>*:first-child]:view-wide:grow-[3]`,biggerRight:`${s} [&>*:last-child]:view-wide:grow-[3]`,twoThree:`${s} [&>*:first-child]:view-wide:grow-[2] [&>*:last-child]:view-wide:grow-[3]`},L=`${s} [&>*:nth-child(1)]:view-wide:grow-[var(--sf-share-1,1)] [&>*:nth-child(2)]:view-wide:grow-[var(--sf-share-2,1)] [&>*:nth-child(3)]:view-wide:grow-[var(--sf-share-3,1)] [&>*:nth-child(4)]:view-wide:grow-[var(--sf-share-4,1)]`;function E(e){return Array.isArray(e)?L:typeof e=="string"?v[e]??"":""}const V={all:[{context:"parentType",is:"Flex"},{context:"parent.direction",is:"row"},{any:[{not:{context:"parent.align",set:!0}},{context:"parent.align",is:"stretch"}]},{not:{context:"parent.separator",set:!0}},{not:{context:"parent.loop",is:"scroll"}},{not:{context:"parent.line",is:!0}},{not:{context:"parent.bgImage",set:!0}},{any:[{context:"parent.columns",in:[2,3,4,5,6]},{all:[{not:{context:"parent.columns",is:1}},{context:"parent.share",in:Object.keys(v)}]}]}]},b="view-tablet:max-view-desktop:flex-row!",l=`${b} [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-0!`,g={content:`${b} [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[content]!`,equal:l,bigLeft:`${l} [&>*:first-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[2]!`,bigRight:`${l} [&>*:last-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[2]!`,biggerLeft:`${l} [&>*:first-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[3]!`,biggerRight:`${l} [&>*:last-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[3]!`,twoThree:`${l} [&>*:first-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[2]! [&>*:last-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[3]!`},B=`${l} [&>*:nth-child(1):nth-child(n)]:view-tablet:max-view-desktop:grow-[var(--sf-share-tablet-1,1)]! [&>*:nth-child(2):nth-child(n)]:view-tablet:max-view-desktop:grow-[var(--sf-share-tablet-2,1)]! [&>*:nth-child(3):nth-child(n)]:view-tablet:max-view-desktop:grow-[var(--sf-share-tablet-3,1)]! [&>*:nth-child(4):nth-child(n)]:view-tablet:max-view-desktop:grow-[var(--sf-share-tablet-4,1)]!`;function N(e){return Array.isArray(e)||typeof e=="string"&&e in g?e:null}function Q(e){if(e.direction!=="row"||p(e.direction,e.separator)||e.loop==="scroll"||e.line===!0||S(e.columns)!==""||O(e.columnsTablet)!=="")return"";const t=N(e.shareTablet);return t===null?"":typeof t=="string"?g[t]:B}const T="[&>*]:view-wide:basis-[content]";function Y(e){return E(e)===""?T:""}const J="Columns",z=1,Z=3,d={2:"max-view-wide:flex-wrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px)))/2)]",3:"max-view-wide:flex-wrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px))_*_2)/3)]"},ee=f.filter(e=>e.value==="content"||e.value==="equal"),te="equal",ie=1,ne=6,w="view-wide:flex-wrap [&>*]:view-wide:min-w-0 [&>*]:view-wide:grow-0!",y={1:`${w} [&>*]:view-wide:basis-[calc(100%/1)]!`,2:`${w} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px))/2)]!`,3:`${w} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_2)/3)]!`,4:`${w} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_3)/4)]!`,5:`${w} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_4)/5)]!`,6:`${w} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_5)/6)]!`};function S(e){return typeof e=="number"?y[e]??"":""}const R={1:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc(100%/1)]!",2:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px)))/2)]!",3:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_2)/3)]!",4:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_3)/4)]!",5:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_4)/5)]!",6:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_5)/6)]!"};function O(e){return typeof e=="number"?R[e]??"":""}function ae(e){return e.direction!=="row"||p(e.direction,e.separator)||e.loop==="scroll"||e.line===!0?"":O(e.columnsTablet)}function re(e){return e.direction!=="row"||p(e.direction,e.separator)||e.loop==="scroll"||e.line===!0?"":S(e.columns)}const P="max-view-wide:flex-wrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:grow-0 [&>*]:max-view-wide:basis-[content]",$={2:"max-view-wide:flex-nowrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px)))/2)]",3:"max-view-wide:flex-nowrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px))_*_2)/3)]"},H="max-view-wide:flex-nowrap [&>*]:max-view-wide:grow-0 [&>*]:max-view-wide:basis-[content]";function X(e){return e===!1||e==="nowrap"}function oe(e,t,i){const n=d[Number(e)];if(!n)return"max-view-wide:flex-col";const a=X(i);return A(e,t)?a?H:P:a?$[Number(e)]:n}function se(e,t){return Number(e)in d&&!A(e,t)}function A(e,t){return Number(e)in d&&t==="content"}const le="Block spacing",we=[{label:"Each block",value:"each"},{label:"Gap only",value:"gap"}],I="sf-box-gap-only";function ce(e){return e==="gap"?I:""}export{h as BOX_ALIGN_CLASS,le as BOX_BLOCK_SPACING_LABEL,we as BOX_BLOCK_SPACING_POINTS,ne as BOX_COLUMNS_MAX,ie as BOX_COLUMNS_MIN,I as BOX_GAP_ONLY_CLASS,V as BOX_GIVES_PICTURES_A_HEIGHT,J as BOX_PHONE_ROW_LABEL,Z as BOX_PHONE_ROW_MAX,z as BOX_PHONE_ROW_MIN,G as BOX_SHARE_CHOICES,F as BOX_SHARE_LABEL,te as BOX_SHARE_PHONE_DEFAULT,ee as BOX_SHARE_PHONE_POINTS,f as BOX_SHARE_POINTS,W as NESTED_BOX_PADDING,ce as boxBlockSpacingClass,S as boxColumnsClass,Y as boxFitContentClass,U as boxLayoutClasses,se as boxPhoneCellsShareLine,oe as boxPhoneRowClasses,A as boxPhoneRowFits,X as boxPhoneRowOneLine,re as boxRowColumnsClass,ae as boxRowTabletColumnsClass,Q as boxRowTabletShareClass,j as boxShareChoiceOf,E as boxShareClasses,N as boxShareTabletOf,D as boxShareVars,K as boxShareWidthsOf,O as boxTabletColumnsClass,q as boxWrapClass};
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
export declare const BOX_SHAPES: readonly ["auto", "tall", "square", "landscape", "wide"];
|
|
1
|
+
export declare const BOX_SHAPES: readonly ["auto", "tall", "square", "landscape", "video", "wide", "panorama"];
|
|
2
2
|
export type BoxShape = (typeof BOX_SHAPES)[number];
|
|
3
|
-
export declare const BOX_SHAPE_OPTIONS: readonly {
|
|
4
|
-
label: string;
|
|
5
|
-
value: BoxShape;
|
|
6
|
-
}[];
|
|
7
3
|
export declare function boxShapeOf(value: unknown): BoxShape;
|
|
8
4
|
export declare function boxShapeClass(value: unknown): string;
|
|
9
5
|
export declare function boxShapePhoneOf(desktop: unknown, phone: unknown): BoxShape | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{galleryCardRatioClass as
|
|
1
|
+
import{galleryCardRatioClass as u}from"./gallery-card-layout.js";const w=["auto","tall","square","landscape","video","wide","panorama"];function o(e){return w.includes(String(e??""))?e:"auto"}function l(e){const a=o(e);return a==="auto"?"":u(a)}const p={tall:"view-wide:aspect-[3/4]",square:"view-wide:aspect-square",landscape:"view-wide:aspect-[4/3]",video:"view-wide:aspect-[16/9]",wide:"view-wide:aspect-[2/1]",panorama:"view-wide:aspect-[21/9]"},v={auto:"max-view-wide:aspect-auto",tall:"max-view-wide:h-auto max-view-wide:aspect-[3/4]",square:"max-view-wide:h-auto max-view-wide:aspect-square",landscape:"max-view-wide:h-auto max-view-wide:aspect-[4/3]",video:"max-view-wide:h-auto max-view-wide:aspect-[16/9]",wide:"max-view-wide:h-auto max-view-wide:aspect-[2/1]",panorama:"max-view-wide:h-auto max-view-wide:aspect-[21/9]"};function d(e,a){return w.includes(String(a??""))?a===o(e)?null:a:null}const c={auto:"view-tablet:max-view-desktop:aspect-auto!",tall:"view-tablet:max-view-desktop:h-auto! view-tablet:max-view-desktop:aspect-[3/4]!",square:"view-tablet:max-view-desktop:h-auto! view-tablet:max-view-desktop:aspect-square!",landscape:"view-tablet:max-view-desktop:h-auto! view-tablet:max-view-desktop:aspect-[4/3]!",video:"view-tablet:max-view-desktop:h-auto! view-tablet:max-view-desktop:aspect-[16/9]!",wide:"view-tablet:max-view-desktop:h-auto! view-tablet:max-view-desktop:aspect-[2/1]!",panorama:"view-tablet:max-view-desktop:h-auto! view-tablet:max-view-desktop:aspect-[21/9]!"};function r(e){return w.includes(String(e??""))?e:null}function m(e,a,n){const t=r(n),i=d(e,w.includes(String(a??""))?a:t);if(i===null&&t===null)return l(e);const s=o(e);return[i===null?l(e):s==="auto"?"":p[s],i===null?"":v[i],t===null?"":c[t]].filter(Boolean).join(" ")}export{w as BOX_SHAPES,l as boxShapeClass,m as boxShapeClasses,o as boxShapeOf,d as boxShapePhoneOf,r as boxShapeTabletOf};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const SHOW_FOR_PROP = "showFor";
|
|
2
|
+
export interface ShowForChoice {
|
|
3
|
+
slug: string;
|
|
4
|
+
name: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function registerShowForChoices(choices: readonly ShowForChoice[] | null): void;
|
|
7
|
+
export declare function showForChoices(): readonly ShowForChoice[];
|
|
8
|
+
export declare function showForChoicesRevision(): number;
|
|
9
|
+
export declare function showForOf(value: unknown): ShowForChoice | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{globalRegistry as s}from"../global-registry.js";const c="showFor";function e(){return s("efficient.box-show-for-choices",()=>({choices:[],revision:0}))}const i=o=>!!o&&typeof o=="object"&&typeof o.slug=="string"&&o.slug.trim()!==""&&typeof o.name=="string"&&o.name.trim()!=="";function f(o){const r=e();r.choices=(o??[]).filter(i).map(t=>({slug:t.slug,name:t.name})),r.revision+=1}function u(){return e().choices}function h(){return e().revision}function g(o){return i(o)?{slug:o.slug,name:o.name}:void 0}export{c as SHOW_FOR_PROP,f as registerShowForChoices,u as showForChoices,h as showForChoicesRevision,g as showForOf};
|
|
@@ -8,4 +8,4 @@ export declare function buttonIconChoice(icon: unknown, arrow: unknown): ButtonI
|
|
|
8
8
|
export declare function buttonIconSide(value: unknown): ButtonIconSide;
|
|
9
9
|
export declare function buttonIconAtEnd(side: unknown, width: unknown): boolean;
|
|
10
10
|
export declare function buttonWidth(value: unknown): ButtonWidth;
|
|
11
|
-
export declare function buttonWidthClass(desktop: unknown, phone: unknown): string;
|
|
11
|
+
export declare function buttonWidthClass(desktop: unknown, phone: unknown, tablet?: unknown): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{buttonArrowShown as
|
|
1
|
+
import{buttonArrowShown as w}from"./button-arrow.js";import{nonEmptyString as i}from"../non-empty-string.js";const a=["none","arrow-right","arrow-long-right","arrow-up-right","chevron-right","external","cart","bag","tag","email","location","play","download","search","car"];function c(t){return typeof t=="string"&&a.includes(t)?t:void 0}function x(t,o){return c(t)??(w(o)?"arrow-right":"none")}function d(t){return t==="before"?"before":t==="end"?"end":"after"}function b(t,o){return d(t)==="end"&&e(o)==="fill"}function e(t){return t==="fill"||t==="fixed"?"fill":"fit"}function m(t,o,l){const r=e(t);if(i(l)){const n=e(l),u=i(o)?e(o):n;return[r==="fill"?"view-desktop:w-full":"view-desktop:w-auto",n==="fill"?"view-tablet:max-view-desktop:w-full":"view-tablet:max-view-desktop:w-auto",u==="fill"?"max-view-tablet:w-full":"max-view-tablet:w-auto"].join(" ")}const f=r==="fill"?["w-full"]:[];if(i(o)){const n=e(o);n!==r&&f.push(n==="fill"?"max-view-wide:w-full":"max-view-wide:w-auto")}return f.join(" ")}export{a as BUTTON_ICONS,b as buttonIconAtEnd,x as buttonIconChoice,d as buttonIconSide,e as buttonWidth,m as buttonWidthClass,c as storedButtonIcon};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const CARD_ROW_STATES: readonly ["selected", "highlighted"];
|
|
2
|
+
type CardRowStateName = (typeof CARD_ROW_STATES)[number];
|
|
3
|
+
export type CardRowState = Readonly<Partial<Record<CardRowStateName, boolean>>>;
|
|
4
|
+
export declare const CARD_STATE_ATTR = "data-sf-card-state";
|
|
5
|
+
export declare const CARD_STATE_LINE_CLASS = "pointer-events-none absolute inset-0 border border-accent";
|
|
6
|
+
export declare function cardStateValue(state: CardRowState | undefined | null): string;
|
|
7
|
+
export declare function cardStateAttrs(state: CardRowState | undefined | null): Record<string, string>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const r=["selected","highlighted"],n="data-sf-card-state",a="pointer-events-none absolute inset-0 border border-accent";function o(t){return t?r.filter(e=>t[e]===!0).join(" "):""}function c(t){const e=o(t);return e?{[n]:e,className:"relative"}:{}}export{n as CARD_STATE_ATTR,a as CARD_STATE_LINE_CLASS,c as cardStateAttrs,o as cardStateValue};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{blockSourceSpec as x,declaredBlockSource as g}from"./block-sources.js";import{isNodeList as T}from"efficient-easel/data";import{BOX_TYPE as w}from"../document/container-blocks.js";import{globalRegistry as C}from"../global-registry.js";import{nonEmptyString as p}from"../non-empty-string.js";import{withCardsTemplate as B}from"../document/cards-template-on-read.js";const R="template",j="Card template",A=["Text","ImageBlock","ButtonBlock","Flex"],u="rowField",O="rowLinkField";function K(){return{type:"slot",allow:[...A]}}const h=[{block:"OrderSummary",typedRows:"rows",fields:[{key:"label",label:"Item"},{key:"meta",label:"Meta line"},{key:"amount",label:"Amount"}]},{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=>B("Cards",e)}];function
|
|
1
|
+
import{blockSourceSpec as x,declaredBlockSource as g}from"./block-sources.js";import{isNodeList as T}from"efficient-easel/data";import{BOX_TYPE as w}from"../document/container-blocks.js";import{globalRegistry as C}from"../global-registry.js";import{nonEmptyString as p}from"../non-empty-string.js";import{withCardsTemplate as B}from"../document/cards-template-on-read.js";const R="template",j="Card template",A=["Text","ImageBlock","ButtonBlock","Flex"],u="rowField",O="rowLinkField";function K(){return{type:"slot",allow:[...A]}}const h=[{block:"OrderSummary",typedRows:"rows",fields:[{key:"label",label:"Item"},{key:"meta",label:"Meta line"},{key:"amount",label:"Amount"}]},{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=>B("Cards",e)}];function i(){return C("efficient.card-templates",()=>new Map(h.map(e=>[e.block,e])))}function W(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(c=>c.type===o.type)||r.push({type:o.type,label:o.label||o.type})}const n=p(t.typedRows);i().set(t.block,{block:t.block,fields:t.fields.map(o=>({...o})),blocks:r,typedRows:n,...t.seed?{seed:t.seed}:{}})}}function _(e,t){const r=e?i().get(e)?.seed:void 0;return r?r(t):t}function U(e,t){if(!(t.template===void 0||Array.isArray(t.template)&&t.template.length===0))return t;const{template:n,...o}=t,c=_(e,o);return c===o?t:c}function H(){for(const e of i().values())if(e.blocks?.length)return!0;return!1}function V(e){return i().get(e)?.blocks??[]}function X(e){for(const t of i().values())if(t.blocks?.some(r=>r.type===e))return!0;return!1}function Y(e){return typeof e=="string"&&i().get(e)?.typedRows||""}function E(e){return typeof e=="string"&&i().has(e)}function $(e,t){const r=i().get(e)?.fields??[];return t?r.filter(n=>(n.kind??"text")===t):r}function L(e,t){const r=typeof e?.type=="string"?e.type:"";if(!r)return[];const n=i().get(r)?.fields??[],o=x(g(e?.props))?.fields,c=o?.length?[...o.map(l=>({...l})),...n.filter(l=>l.everySource&&!o.some(s=>s.key===l.key))]:n;return t?c.filter(l=>(l.kind??"text")===t):c}function q(e,t,r){return e?r?L(r).find(n=>n.key===t)??null:i().get(e)?.fields.find(n=>n.key===t)??null:null}function y(e,t=u){const r=e?.[t];return typeof r=="string"?r.trim():""}function z(e,t){return e.key||String(t+1)}function G(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}function J(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 c=typeof o=="string"?o:o?.src,l=p(typeof c=="string"?c.trim():void 0);if(l&&l!==r.trim())return l}return""}const m={Text:{text:u},ImageBlock:{src:u},ButtonBlock:{label:u,href:O},Breadcrumb:{currentCrumb:u}};function Q(e,t,r){return P(e,t,r)!==""}function P(e,t,r){const n=m[e]?.[r];return n?y(t,n):""}function S(e,t){return!t||!e?null:e[t]??""}function Z(e,t,r){if(!r)return t;let n=null;for(const[o,c]of Object.entries(m[e]??{})){const l=S(r,y(t,c));l!==null&&(n??={...t},n[o]=l)}return n??t}function f(e,t){const r=e?.data?.content;if(!Array.isArray(r)||typeof t!="string")return;const n=(c,l)=>{for(const s of c){if(s?.props?.id===t)return l;for(const[b,d]of Object.entries(s?.props??{})){if(!T(d))continue;const k=b===R&&E(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===w},a=n(d,k);if(a!==void 0)return a}}},o=n(r,null);return o===void 0?null:o}function ee(e,t){const r=f(e,t);return r&&r.owner}function te(e,t){const r=f(e,t);return r&&(r.direct?r.owner:null)}function re(e,t){const r=f(e,t);if(r!==void 0)return r===null?{inCopy:!1,nestedCopy:!1,underBox:!1}:{inCopy:!0,nestedCopy:r.nested,underBox:r.underBox}}export{u as CARD_ROW_FIELD_PROP,O as CARD_ROW_LINK_PROP,A as CARD_TEMPLATE_BLOCKS,j as CARD_TEMPLATE_LABEL,R as CARD_TEMPLATE_SLOT,re as cardCopyPlace,z as cardKeyOf,G as cardRow,V as cardTemplateBlocks,te as cardTemplateCardOwner,q as cardTemplateField,$ as cardTemplateFields,L as cardTemplateFieldsOf,ee as cardTemplateOwner,K as cardTemplateSlot,Y as cardTemplateTypedRows,H as cardTemplatesNameBlocks,E as hasCardTemplate,X as isCardTemplateBlock,y as namedRowField,W as registerCardTemplates,Q as rowBound,P as rowFieldOf,S as rowFieldText,Z as rowFilledProps,J as rowNextPicture,U as templateOnInsert,_ as templateOnRead};
|
|
@@ -1,8 +1,52 @@
|
|
|
1
1
|
import { type HeroGroupPlacement } from "../hero-group-placement.js";
|
|
2
|
-
export declare const GALLERY_CARD_RATIOS: readonly ["square", "tall", "wide", "landscape", "portrait", "auto"];
|
|
2
|
+
export declare const GALLERY_CARD_RATIOS: readonly ["square", "tall", "wide", "landscape", "portrait", "video", "panorama", "auto"];
|
|
3
3
|
export type GalleryCardRatio = (typeof GALLERY_CARD_RATIOS)[number];
|
|
4
4
|
export declare const GALLERY_CARD_RATIO_DEFAULT: GalleryCardRatio;
|
|
5
5
|
export declare function galleryCardRatioClass(ratio?: string): string;
|
|
6
|
+
export interface ShapeLine {
|
|
7
|
+
shape: GalleryCardRatio;
|
|
8
|
+
image: string;
|
|
9
|
+
ratio: readonly [number, number] | null;
|
|
10
|
+
label: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const SHAPE_TABLE: readonly [{
|
|
13
|
+
readonly shape: "auto";
|
|
14
|
+
readonly image: "auto";
|
|
15
|
+
readonly ratio: null;
|
|
16
|
+
readonly label: "Auto";
|
|
17
|
+
}, {
|
|
18
|
+
readonly shape: "tall";
|
|
19
|
+
readonly image: "3/4";
|
|
20
|
+
readonly ratio: readonly [3, 4];
|
|
21
|
+
readonly label: "Tall 3:4";
|
|
22
|
+
}, {
|
|
23
|
+
readonly shape: "square";
|
|
24
|
+
readonly image: "1/1";
|
|
25
|
+
readonly ratio: readonly [1, 1];
|
|
26
|
+
readonly label: "Square 1:1";
|
|
27
|
+
}, {
|
|
28
|
+
readonly shape: "landscape";
|
|
29
|
+
readonly image: "4/3";
|
|
30
|
+
readonly ratio: readonly [4, 3];
|
|
31
|
+
readonly label: "Landscape 4:3";
|
|
32
|
+
}, {
|
|
33
|
+
readonly shape: "video";
|
|
34
|
+
readonly image: "16/9";
|
|
35
|
+
readonly ratio: readonly [16, 9];
|
|
36
|
+
readonly label: "Video 16:9";
|
|
37
|
+
}, {
|
|
38
|
+
readonly shape: "wide";
|
|
39
|
+
readonly image: "2/1";
|
|
40
|
+
readonly ratio: readonly [2, 1];
|
|
41
|
+
readonly label: "Wide 2:1";
|
|
42
|
+
}, {
|
|
43
|
+
readonly shape: "panorama";
|
|
44
|
+
readonly image: "21/9";
|
|
45
|
+
readonly ratio: readonly [21, 9];
|
|
46
|
+
readonly label: "Panorama 21:9";
|
|
47
|
+
}];
|
|
48
|
+
export type ImageShapeValue = (typeof SHAPE_TABLE)[number]["image"];
|
|
49
|
+
export declare function shapeLines(shapes: readonly GalleryCardRatio[]): readonly ShapeLine[];
|
|
6
50
|
export declare const GALLERY_CAPTION_PLACES: readonly ["overlay", "below"];
|
|
7
51
|
export type GalleryCaptionPlace = (typeof GALLERY_CAPTION_PLACES)[number];
|
|
8
52
|
export declare function galleryCaptionIsBelow(place?: string): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{normalisePlacement as
|
|
1
|
+
import{normalisePlacement as n,placementParts as o}from"../hero-group-placement.js";import{scrim as t}from"./scrim.js";const A=["square","tall","wide","landscape","portrait","video","panorama","auto"],g="square";function f(e){switch(e){case"tall":return"aspect-[3/4]";case"wide":return"aspect-[2/1]";case"landscape":return"aspect-[4/3]";case"portrait":return"aspect-[4/5]";case"video":return"aspect-[16/9]";case"panorama":return"aspect-[21/9]";case"auto":return"";default:return"aspect-square"}}const s=[{shape:"auto",image:"auto",ratio:null,label:"Auto"},{shape:"tall",image:"3/4",ratio:[3,4],label:"Tall 3:4"},{shape:"square",image:"1/1",ratio:[1,1],label:"Square 1:1"},{shape:"landscape",image:"4/3",ratio:[4,3],label:"Landscape 4:3"},{shape:"video",image:"16/9",ratio:[16,9],label:"Video 16:9"},{shape:"wide",image:"2/1",ratio:[2,1],label:"Wide 2:1"},{shape:"panorama",image:"21/9",ratio:[21,9],label:"Panorama 21:9"}];function L(e){return s.filter(a=>e.includes(a.shape))}const _=["overlay","below"];function h(e){return e==="below"}const b="bottom-left";function x(e){const{band:a,column:r}=o(n(e));return["justify-start","justify-center","justify-end"][a]+(r==="center"?" text-center":r==="end"?" text-right":"")}const i=`linear-gradient(180deg, transparent 40%, ${t(.85)} 100%)`,l=`linear-gradient(0deg, transparent 40%, ${t(.85)} 100%)`,c=t(.45);function C(e){return[l,c,i][o(n(e)).band]}export{b as GALLERY_CAPTION_ANCHOR_DEFAULT,_ as GALLERY_CAPTION_PLACES,A as GALLERY_CARD_RATIOS,g as GALLERY_CARD_RATIO_DEFAULT,s as SHAPE_TABLE,x as galleryCaptionAnchorClass,h as galleryCaptionIsBelow,C as galleryCaptionWash,f as galleryCardRatioClass,L as shapeLines};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ShowWhenRule } from "efficient-shell/format";
|
|
2
|
+
import { type ImageShapeValue } from "./gallery-card-layout.js";
|
|
3
|
+
type ImageRatio = ImageShapeValue;
|
|
4
|
+
export declare const FILL_ROW = "fill";
|
|
5
|
+
export type ImageAspect = ImageRatio | typeof FILL_ROW;
|
|
6
|
+
export declare const FILL_ROW_OPTION: {
|
|
7
|
+
label: string;
|
|
8
|
+
value: typeof FILL_ROW;
|
|
9
|
+
showWhen: ShowWhenRule;
|
|
10
|
+
};
|
|
11
|
+
declare const FILL_ROW_CLASSES: {
|
|
12
|
+
readonly all: {
|
|
13
|
+
readonly frame: "h-full min-h-[240px]";
|
|
14
|
+
readonly img: "absolute inset-0";
|
|
15
|
+
readonly figure: "h-full";
|
|
16
|
+
};
|
|
17
|
+
readonly wide: {
|
|
18
|
+
readonly frame: "view-wide:h-full view-wide:min-h-[240px]";
|
|
19
|
+
readonly img: "view-wide:absolute view-wide:inset-0";
|
|
20
|
+
readonly figure: "view-wide:h-full";
|
|
21
|
+
};
|
|
22
|
+
readonly tablet: {
|
|
23
|
+
readonly frame: "view-tablet:h-full view-tablet:min-h-[240px] view-tablet:aspect-auto!";
|
|
24
|
+
readonly img: "view-tablet:absolute view-tablet:inset-0";
|
|
25
|
+
readonly figure: "view-tablet:h-full";
|
|
26
|
+
};
|
|
27
|
+
readonly desktop: {
|
|
28
|
+
readonly frame: "view-desktop:h-full view-desktop:min-h-[240px] max-view-desktop:aspect-[4/3]";
|
|
29
|
+
readonly img: "view-desktop:absolute view-desktop:inset-0";
|
|
30
|
+
readonly figure: "view-desktop:h-full";
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
type ImageFillFrom = keyof typeof FILL_ROW_CLASSES;
|
|
34
|
+
export declare function imageFillFrom(rowFrom: "tablet" | "desktop" | undefined, phoneRowFills: boolean, phone: unknown): ImageFillFrom;
|
|
35
|
+
export declare function imageFillRowClasses(from: ImageFillFrom): {
|
|
36
|
+
frame: string;
|
|
37
|
+
img: string;
|
|
38
|
+
figure: string;
|
|
39
|
+
};
|
|
40
|
+
export declare function imageAspectDrawn(aspect: unknown, rowGivesHeight: boolean): unknown;
|
|
41
|
+
export declare function imageAspectPhoneRest(desktop: unknown): ImageRatio | undefined;
|
|
42
|
+
export declare function imageAspectPhoneOf(drawn: unknown, phone: unknown): ImageRatio | null;
|
|
43
|
+
export declare function imageAspectDrawsARatio(aspect: unknown, phone: unknown): boolean;
|
|
44
|
+
export declare function imageFocalPointActs(fit: unknown, aspect: unknown, phone: unknown): boolean;
|
|
45
|
+
export declare function imageFocalPointActsIn(view: "desktop" | "tablet" | "mobile", fit: unknown, aspect: unknown, phone: unknown): boolean;
|
|
46
|
+
export declare function imageAspectClasses(drawn: unknown, phone: ImageRatio | null, fillFrom?: ImageFillFrom): string;
|
|
47
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{BOX_GIVES_PICTURES_A_HEIGHT as p}from"./box-layout.js";import{imageIsCropped as n,parseImageFit as w}from"./image-fit.js";import{SHAPE_TABLE as m}from"./gallery-card-layout.js";const f=m.map(e=>e.image),a="fill",E={label:"Fill row",value:a,showWhen:p},r="4/3",v={all:{frame:"h-full min-h-[240px]",img:"absolute inset-0",figure:"h-full"},wide:{frame:"view-wide:h-full view-wide:min-h-[240px]",img:"view-wide:absolute view-wide:inset-0",figure:"view-wide:h-full"},tablet:{frame:"view-tablet:h-full view-tablet:min-h-[240px] view-tablet:aspect-auto!",img:"view-tablet:absolute view-tablet:inset-0",figure:"view-tablet:h-full"},desktop:{frame:"view-desktop:h-full view-desktop:min-h-[240px] max-view-desktop:aspect-[4/3]",img:"view-desktop:absolute view-desktop:inset-0",figure:"view-desktop:h-full"}};function R(e,t,i){return t&&!s(i)?"all":e??"wide"}function c(e){return v[e]}const d={auto:"","3/4":"aspect-[3/4]","2/1":"aspect-[2/1]","21/9":"aspect-[21/9]","16/9":"aspect-[16/9]","4/3":"aspect-[4/3]","1/1":"aspect-square"},x={auto:"","3/4":"view-wide:aspect-[3/4]","2/1":"view-wide:aspect-[2/1]","21/9":"view-wide:aspect-[21/9]","16/9":"view-wide:aspect-[16/9]","4/3":"view-wide:aspect-[4/3]","1/1":"view-wide:aspect-square"},_={auto:"","3/4":"max-view-wide:aspect-[3/4]","2/1":"max-view-wide:aspect-[2/1]","21/9":"max-view-wide:aspect-[21/9]","16/9":"max-view-wide:aspect-[16/9]","4/3":"max-view-wide:aspect-[4/3]","1/1":"max-view-wide:aspect-square"},A={auto:"max-view-wide:aspect-auto!","3/4":"max-view-wide:aspect-[3/4]!","2/1":"max-view-wide:aspect-[2/1]!","21/9":"max-view-wide:aspect-[21/9]!","16/9":"max-view-wide:aspect-[16/9]!","4/3":"","1/1":"max-view-wide:aspect-square!"},s=e=>f.includes(e);function F(e,t){return e===a&&!t?r:e}function h(e){return e===a?r:s(e)?e:void 0}function u(e,t){return s(t)?t===e?null:t:e===a?r:null}function g(e,t){const i=u(e,t);return n(e,"cover")||i!==null&&n(i,"cover")}function L(e,t,i){return w(e,"cover")==="cover"&&g(t,i)}function P(e,t,i,o){return e==="desktop"?L(t,i,o):w(t,"cover")!=="cover"?!1:l(e==="tablet"?i:u(i,o)??i)}const l=e=>e===a||s(e)&&e!=="auto";function S(e,t,i="wide"){return e===a&&i==="all"?c("all").frame:t===null?s(e)?d[e]:"":[e===a?c(i).frame:s(e)?x[e]:"",e===a&&i==="desktop"?A[t]:_[t]].filter(Boolean).join(" ")}export{a as FILL_ROW,E as FILL_ROW_OPTION,S as imageAspectClasses,F as imageAspectDrawn,g as imageAspectDrawsARatio,u as imageAspectPhoneOf,h as imageAspectPhoneRest,R as imageFillFrom,c as imageFillRowClasses,L as imageFocalPointActs,P as imageFocalPointActsIn};
|
|
@@ -1 +1,12 @@
|
|
|
1
1
|
export declare const listNumber: (index: number) => string;
|
|
2
|
+
export declare const LIST_NUMBER_FORMS: readonly [{
|
|
3
|
+
readonly label: "01 ·";
|
|
4
|
+
readonly value: "two-digit";
|
|
5
|
+
}, {
|
|
6
|
+
readonly label: "1.";
|
|
7
|
+
readonly value: "plain";
|
|
8
|
+
}];
|
|
9
|
+
export type ListNumberForm = (typeof LIST_NUMBER_FORMS)[number]["value"];
|
|
10
|
+
export declare const LIST_NUMBER_FORM_DEFAULT: ListNumberForm;
|
|
11
|
+
export declare const readListNumberForm: (value: unknown) => ListNumberForm;
|
|
12
|
+
export declare const listNumberIn: (form: ListNumberForm, index: number) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const e=t=>String(t+1).padStart(2,"0"),r=[{label:"01 ·",value:"two-digit"},{label:"1.",value:"plain"}],l="two-digit",a=t=>t==="plain"?"plain":l,i=(t,o)=>t==="plain"?`${o+1}.`:e(o);export{r as LIST_NUMBER_FORMS,l as LIST_NUMBER_FORM_DEFAULT,e as listNumber,i as listNumberIn,a as readListNumberForm};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { CSSProperties } from "react";
|
|
2
2
|
export declare const PHONE_FOCUS_CLASS = "sf-focus-phone";
|
|
3
3
|
export declare const PHONE_FOCUS_VAR = "--sf-focus-phone";
|
|
4
|
-
export declare
|
|
4
|
+
export declare const TABLET_FOCUS_CLASS = "sf-focus-tablet";
|
|
5
|
+
export declare const TABLET_FOCUS_VAR = "--sf-focus-tablet";
|
|
6
|
+
export declare const focusPoint: (value: unknown) => string | null;
|
|
7
|
+
export declare function phoneFocus(phone: unknown, tablet?: unknown): {
|
|
5
8
|
className: string;
|
|
6
9
|
style: CSSProperties;
|
|
7
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{formatFocal as
|
|
1
|
+
import{formatFocal as c,parseFocal as r}from"efficient-shell/format";const f="sf-focus-phone",p="--sf-focus-phone",i="sf-focus-tablet",l="--sf-focus-tablet",e=t=>{if(typeof t!="string"||!/^\s*-?\d+(\.\d+)?%\s+-?\d+(\.\d+)?%\s*$/.test(t))return null;const{x:s,y:o}=r(t);return c(s,o)};function a(t,s){const o=e(s),n=e(t)??o;return{className:[o?i:"",n?f:""].filter(Boolean).join(" "),style:{...o?{[l]:o}:{},...n?{[p]:n}:{}}}}export{f as PHONE_FOCUS_CLASS,p as PHONE_FOCUS_VAR,i as TABLET_FOCUS_CLASS,l as TABLET_FOCUS_VAR,e as focusPoint,a as phoneFocus};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SourceRow } from "./block-sources.js";
|
|
2
|
+
import type { CardRowFieldKind, CardRowFieldSpec } from "./card-template.js";
|
|
3
|
+
export declare const RECORD_TITLE_FIELD = "title";
|
|
4
|
+
export declare function recordPictureAlt(key: string): string;
|
|
5
|
+
export interface RecordForRow {
|
|
6
|
+
title?: unknown;
|
|
7
|
+
fields?: Readonly<Record<string, unknown>> | null;
|
|
8
|
+
schema?: readonly {
|
|
9
|
+
key: string;
|
|
10
|
+
kind: string;
|
|
11
|
+
}[] | null;
|
|
12
|
+
}
|
|
13
|
+
export declare function recordRow(record: RecordForRow, dateWords?: (iso: string) => string): SourceRow;
|
|
14
|
+
export declare function recordRowFields(key: string, kind: CardRowFieldKind): readonly CardRowFieldSpec[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{PRODUCT_RECORD_TYPE as c,recordFields as n,recordTypeSpec as p}from"./record-types.js";import{say as y}from"../editor-words.js";const a="title";function s(e){return`${e}Alt`}function m(e){const r=e.find(t=>typeof t?.url=="string");return{url:r?.url??"",alt:typeof r?.alt=="string"?r.alt:""}}function R(e,r){const t={[a]:typeof e.title=="string"?e.title:""};for(const{key:o,kind:l}of e.schema??[]){const i=e.fields?.[o];if(l==="text"&&typeof i=="string")t[o]=i;else if(l==="date"&&typeof i=="string")t[o]=i&&r?r(i):i;else if(l==="images"&&Array.isArray(i)){const{url:f,alt:u}=m(i);t[o]=f,t[s(o)]=u}}return t}function T(e,r){return e===c||!p(e)?[]:r==="image"?n(e,["images"]).map(t=>({key:t.key,label:t.label,kind:"image",alt:s(t.key)})):r!=="text"?[]:[{key:a,label:y("Title")},...n(e,["text","date"]).map(t=>({key:t.key,label:t.label}))]}export{a as RECORD_TITLE_FIELD,s as recordPictureAlt,R as recordRow,T as recordRowFields};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const PRODUCT_RECORD_TYPE = "product";
|
|
2
2
|
export declare const TEMPLATE_RECORD_TYPE_PROP = "recordType";
|
|
3
|
-
export type RecordFieldKind = "text" | "date";
|
|
3
|
+
export type RecordFieldKind = "text" | "date" | "images";
|
|
4
4
|
export interface RecordFieldSpec {
|
|
5
5
|
key: string;
|
|
6
6
|
label: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t="product",f="recordType",i={key:t,label:"Product",fields:[]},l=/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/,a=/^[a-z][A-Za-z0-9]*$/,u=["text","date"],n=new Map;let s=0;function y(e){if(typeof e.key!="string"||!l.test(e.key))throw new Error(`A record type key is lower-case words joined by hyphens, not ${JSON.stringify(e.key)}.`);if(e.key===t)throw new Error("The product record type is the builder's own and is not declared by a host.");if(typeof e.label!="string"||!e.label.trim())throw new Error(`The record type ${e.key} has no label.`);const o=new Set;for(const r of e.fields){if(typeof r.key!="string"||!a.test(r.key)||o.has(r.key))throw new Error(`The record type ${e.key} has a field key it cannot use: ${JSON.stringify(r.key)}.`);if(!u.includes(r.kind))throw new Error(`The field ${r.key} of ${e.key} has no kind ${JSON.stringify(r.kind)}.`);o.add(r.key)}return{key:e.key,label:e.label.trim(),fields:e.fields.map(r=>({...r}))}}function k(e){const o=e.map(y);for(const r of o)n.set(r.key,r);o.length&&(s+=1)}function h(){return[i,...n.values()]}function p(e){return e===t?i:n.get(e)??null}function T(){return s}function c(e){const o=e?.[f];return typeof o!="string"?t:o.trim()||t}function w(e){const o=e?.root;return c(o&&typeof o=="object"?o.props:null)}function E(e){return c(e)===t}function x(e,o){const r=p(e)?.fields??[];return o?r.filter(d=>o.includes(d.kind)):r}export{t as PRODUCT_RECORD_TYPE,f as TEMPLATE_RECORD_TYPE_PROP,c as declaredRecordType,E as drawsProduct,w as layoutRecordType,x as recordFields,p as recordTypeSpec,h as recordTypes,T as recordTypesRevision,k as registerRecordTypes};
|
|
1
|
+
const t="product",f="recordType",i={key:t,label:"Product",fields:[]},l=/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/,a=/^[a-z][A-Za-z0-9]*$/,u=["text","date","images"],n=new Map;let s=0;function y(e){if(typeof e.key!="string"||!l.test(e.key))throw new Error(`A record type key is lower-case words joined by hyphens, not ${JSON.stringify(e.key)}.`);if(e.key===t)throw new Error("The product record type is the builder's own and is not declared by a host.");if(typeof e.label!="string"||!e.label.trim())throw new Error(`The record type ${e.key} has no label.`);const o=new Set;for(const r of e.fields){if(typeof r.key!="string"||!a.test(r.key)||o.has(r.key))throw new Error(`The record type ${e.key} has a field key it cannot use: ${JSON.stringify(r.key)}.`);if(!u.includes(r.kind))throw new Error(`The field ${r.key} of ${e.key} has no kind ${JSON.stringify(r.kind)}.`);o.add(r.key)}return{key:e.key,label:e.label.trim(),fields:e.fields.map(r=>({...r}))}}function k(e){const o=e.map(y);for(const r of o)n.set(r.key,r);o.length&&(s+=1)}function h(){return[i,...n.values()]}function p(e){return e===t?i:n.get(e)??null}function T(){return s}function c(e){const o=e?.[f];return typeof o!="string"?t:o.trim()||t}function w(e){const o=e?.root;return c(o&&typeof o=="object"?o.props:null)}function E(e){return c(e)===t}function x(e,o){const r=p(e)?.fields??[];return o?r.filter(d=>o.includes(d.kind)):r}export{t as PRODUCT_RECORD_TYPE,f as TEMPLATE_RECORD_TYPE_PROP,c as declaredRecordType,E as drawsProduct,w as layoutRecordType,x as recordFields,p as recordTypeSpec,h as recordTypes,T as recordTypesRevision,k as registerRecordTypes};
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
export declare const SECTION_BG_SWATCHES: readonly ["transparent", "var(--section-bg)", "var(--surface)", "var(--surface-2)"];
|
|
2
|
-
export declare const SECTION_BG_SWATCH_NAMES: Readonly<Record<string, string>>;
|
|
3
1
|
export declare const THEME_SECTION_BG = "var(--section-bg)";
|
|
4
2
|
export declare const SECTION_BG_INHERIT: "inherit";
|
|
5
3
|
export type SectionBackground = string | undefined;
|
|
6
4
|
export declare function resolveSectionBackground(stored: SectionBackground, builtIn: SectionBackground): SectionBackground;
|
|
7
5
|
export declare function paintedFill(stored: string): string;
|
|
8
|
-
export
|
|
6
|
+
export interface SectionBandColours {
|
|
7
|
+
background: string;
|
|
8
|
+
surface: string;
|
|
9
|
+
surface2: string;
|
|
10
|
+
band: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function sectionBackgroundHex(stored: SectionBackground, builtIn: SectionBackground, colours: SectionBandColours): string;
|
|
13
|
+
export declare const SECTION_BG_NO_FILL: "transparent";
|
|
14
|
+
export declare function sectionBackgroundChoice(stored: SectionBackground, builtIn: SectionBackground): "none" | "band" | null;
|
|
15
|
+
export declare function isSectionBackgroundEmpty(stored: SectionBackground, builtIn: SectionBackground, follows?: SectionBackground): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const i=
|
|
1
|
+
import{parseHexColor as u}from"efficient-shell/format";const i="var(--section-bg)",f="inherit";function c(n,t){return n===f?i:n===void 0?t:E(n)}const p=/var\(\s*--(surface-2|surface|line)\s*(?=[,)])/g;function E(n){return n.replace(p,"var(--site-$1")}const d={"var(--section-bg)":"band","var(--site-surface)":"surface","var(--site-surface-2)":"surface2"};function _(n,t,r){const e=c(n,t);if(!e||e==="transparent")return r.background.toLowerCase();const o=e.trim(),a=o.startsWith("#")?u(o):null;if(a)return a.toLowerCase();const s=d[o.replace(/\s+/g,"")];return(s?r[s]:r.background).toLowerCase()}const x="transparent";function l(n,t){const r=c(n,t);return!r||r===x?"none":r===i?"band":null}function C(n,t,r=t){const e=a=>!a||a==="transparent",o=c(n,t);return o===r||e(o)&&e(r)}export{f as SECTION_BG_INHERIT,x as SECTION_BG_NO_FILL,i as THEME_SECTION_BG,C as isSectionBackgroundEmpty,E as paintedFill,c as resolveSectionBackground,l as sectionBackgroundChoice,_ as sectionBackgroundHex};
|
|
@@ -7,3 +7,11 @@ export declare const SECTION_HEIGHT: {
|
|
|
7
7
|
};
|
|
8
8
|
export declare function resolveSectionHeight(value: number | undefined): string;
|
|
9
9
|
export declare function hasSectionHeight(...values: (number | undefined)[]): boolean;
|
|
10
|
+
export declare function heroHeightBox({ heightDesktop, heightTablet, heightMobile }: {
|
|
11
|
+
heightDesktop?: number;
|
|
12
|
+
heightTablet?: number;
|
|
13
|
+
heightMobile?: number;
|
|
14
|
+
}): {
|
|
15
|
+
className: string;
|
|
16
|
+
style: Record<string, string> | undefined;
|
|
17
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a={min:40,max:100,step:5,fallback:100,unit:"vh"};function o(e){return`${typeof e=="number"?e:a.fallback}${a.unit}`}function f(...e){return e.some(t=>typeof t=="number")}function c({heightDesktop:e,heightTablet:t,heightMobile:h}){const r=f(e,h),n=typeof t=="number",s="view-tablet:max-view-desktop:h-[var(--sf-hero-h-t)]",i=r?n?`h-[var(--sf-hero-h-m)] ${s} view-desktop:h-[var(--sf-hero-h-d)]`:"h-[var(--sf-hero-h-m)] view-tablet:h-[var(--sf-hero-h-d)]":n?`h-screen min-h-[680px] ${s} view-tablet:max-view-desktop:min-h-0`:"h-screen min-h-[680px]";return!r&&!n?{className:i,style:void 0}:{className:i,style:{...r?{"--sf-hero-h-d":o(e)}:{},...n?{"--sf-hero-h-t":o(t)}:{},...r?{"--sf-hero-h-m":o(h)}:{}}}}export{a as SECTION_HEIGHT,f as hasSectionHeight,c as heroHeightBox,o as resolveSectionHeight};
|