@perkyzz/emvb-mcp 1.2.0 → 1.3.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/dist/cli.mjs +2051 -310
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -6498,7 +6498,7 @@ function duration2(params) {
|
|
|
6498
6498
|
return _isoDuration(ZodISODuration, params);
|
|
6499
6499
|
}
|
|
6500
6500
|
// ../../docs/system/layout-format.md
|
|
6501
|
-
var layout_format_default = "# Layout format (schema 18)\n\nHow EmVB stores a page and its site-wide design, at layout schema 18 and design schema 17, schema contract 1.0 (W-925, D-065: renames, motion under `motion`, unknown keys kept; see [docs/SCHEMA.md](../SCHEMA.md)); Loop forever on an icon animation in W-853, D-059; the image editor's `edit` record on images in W-481; per-element direction, image link and caption, button icons, table of contents, container queries, and focal points in W-341 onward; visitor segments in W-329; Loop fields in W-330; `ch` lengths and negative margins in W-331). The source of truth is the code: `packages/emvb/src/core/schema/` (Zod schemas), `core/limits.ts`, `core/validate.ts` and `core/migrate/`. Update this file in the same change as any of them (ARCHITECTURE.md § Documentation).\n\n## Where it lives\n\n- **Pages** are entries in the hidden `emvb_pages` collection (D-012, D-019). The layout is the `layout` field (EmDash type `json`, shown with the read-only `emvb:layout` widget). The other fields are `title`, `canvas_mode` (`site-layout` or `blank`) and EmDash's own slug, status, revision and SEO fields. EmDash may hand a `json` field back as a string, so readers accept both (`renderStored` in `src/astro/render.ts`).\n- **The design system** (colours, fonts, font sizes, spacings; classes in W-030) is one document in plugin storage, collection `design`, key `system` (D-013). Editors save a draft at key `draft` through `POST /_emdash/api/plugins/emvb/design/save` (W-100, D-040 proposed). `POST .../design/publish` copies that draft onto `system`. The public `GET /_emdash/api/plugins/emvb/design` returns `system` only.\n\n## Page layout\n\n```json\n{\n \"schemaVersion\": 18,\n \"root\": {\n \"id\": \"root0001\",\n \"type\": \"container\",\n \"props\": {},\n \"style\": { \"flexDirection\": \"column\", \"gap\": { \"value\": 16, \"unit\": \"px\" } },\n \"children\": [\n {\n \"id\": \"head0001\",\n \"type\": \"heading\",\n \"props\": { \"text\": \"Welcome\", \"level\": 1 },\n \"style\": { \"color\": { \"var\": \"brand\" } }\n }\n ]\n }\n}\n```\n\n- `schemaVersion` is the literal `18` (D-031, D-032, D-034, D-036, D-038, D-039, D-041, D-042, D-044, W-141, D-045, W-160, W-307, W-329, W-341, W-481, W-885, W-925; older documents are upgraded on read by steps that change nothing, except v11 → v12, which rewrites a gradient's `from` and `to` into `stops`, and v17 → v18 (W-925), which renames `section` to `part-ref`, a node's `label` to `editorLabel` and a Loop's `itemPartId` to `partId`, and moves `transition`, `entrance`, `scrollMotion` and `iconAnimation` under `style.motion`). `root` is always a container.\n- Every node has `id` (4–24 of `A-Z a-z 0-9 _ -`, unique within the page), `type`, `props`, and optional `style`, `states` (W-089, see [State styles](#state-styles-w-089)), `classes` (up to 20 ids of 1–40 of `a-z 0-9 -`, rendered as `emvb-k-<id>`), `bind` (W-307), `variant` (an A/B arm, W-312) and `audience` (who sees it, W-313, W-329).\n- Objects are strict: unknown keys are rejected, not ignored.\n- **Unknown element types** (W-022 / R-033): a node whose `type` is not in the known set is kept on save (`id` rules still apply; `props` is an open record; every shared node field, including `devices` and `hiddenOn`, is allowed and checked as on known nodes; optional `children` are validated recursively). Public pages omit it; the editor shows a selectable placeholder. Damaged known nodes (wrong props) still fail validation with path-specific issues.\n\n\n| Type | `props` | Children | Renders as |\n| --- | --- | --- | --- |\n| `container` | optional `tag` (`div`, `section`, `header`, `footer`, `main`, `article`, `aside`, `nav`), optional `href` and `newTab` (the box is the link; a link inside a link is dropped) | `children: Node[]` (required, may be empty) | that tag (default `div`) with `class=\"emvb-container …\"` |\n| `layout-section` (shown as \"Section\", W-156) | optional `tag` (as `container`, default `section`), `contentWidth` length, `fullWidth` boolean | `children: Node[]` | that tag with `class=\"emvb-layout-section …\"`, wrapping `<div class=\"emvb-layout-section-inner\">` around the children; the inner box is at most `contentWidth` (default 1140 px, none with `fullWidth`) wide and centred |\n| `heading` | `text` (≤ 2000), `level` (1–6), optional `href` (≤ 2000) and `newTab` (W-141), optional `marks` (W-950, see below) | none | `<h1>`–`<h6>`; with a safe `href`, the text is wrapped in `<a class=\"emvb-heading-link\">` (colour and decoration inherited) |\n| `spacer` | `height` length | none | `<div aria-hidden=\"true\">` with height in CSS |\n| `divider` | `{}` | none | `<hr>` |\n| `text` | `text`, optional `tag` (`p` \\| `div`), optional `marks` (W-950) | none | `<p>` or `<div>`; formatted words as below |\n| `label` | `text` | none | `<span>` |\n| `link` | `text`, `href`, optional `newTab` | none | `<a href>` (+ `target`/`rel` when `newTab`) |\n| `button` | `text`, optional `href` and `newTab` | none | `<a href>` when `href` is safe, else `<button type=\"button\">` |\n| `list` | `items` (string[], ≤ 200), optional `ordered`; W-952: optional `marker` (`disc`, `circle`, `square`, `decimal`, `decimal-leading-zero`, `lower-alpha`, `upper-alpha`, `lower-roman`, `upper-roman`, `steps`, `none`; a number style or `steps` makes it numbered) and `start` (1–9999, numbered only) | none | `<ul>` or `<ol>` (with `start`) with `<li>`; the marker is `list-style-type`, `steps` adds `emvb-list--steps` (numbers in circles, CSS sent only when used) |\n| `image` | `src`, `alt`, optional `decorative`, `width`, `height`, `mediaId`, `edit` (editor-only image-editor record, never rendered; see below) | none | `<img loading=\"lazy\">` (decorative → empty `alt` + `role=\"presentation\"`) |\n| `icon` | `iconId` (a bundled Lucide id, or `<set prefix>:<name>` from the icon library, W-236), optional `iconSvg` (the picked icon's SVG, ≤ 32768 chars, W-234 / W-239; `iconId` `upload:<id>` for an uploaded SVG), optional `singleColor` (W-238: `true` paints a picked SVG's own fills, strokes and stops in `currentColor`), `size`, `decorative`, `title`, `href` (≤ 2000) and `newTab` (W-141); a non-empty `href` needs a `title` | none | Inline `<svg>`: `iconSvg` sanitized again at render (allowlist; size, id, role and aria attributes replaced), else the bundled Lucide icon (unknown id and no `iconSvg` → placeholder; never a remote URL); with a safe `href`, the svg is hidden inside `<a class=\"emvb-icon-link\" aria-label=\"title\">` |\n| `video` | `url`, `title`, optional `mediaId` | none | YouTube/Vimeo privacy `<iframe loading=\"lazy\">` or media `<video controls>` (no autoplay) |\n| `form` | `formId` (forms-plugin id; may be empty until bound) | `children: Node[]` (form fields + submit; no nested forms) | Bound: `<form class=\"emvb-form ec-form\" …>`. Unbound: editor placeholder `data-emvb-form-unbound`; omitted on public (no forms runtime). |\n| `text-input` | `field`, optional `label`, `placeholder` | none | labelled `<input class=\"ec-form-input\">` + `data-error-for` |\n| `textarea` | `field`, optional `label`, `placeholder` | none | labelled `<textarea class=\"ec-form-input\">` + `data-error-for` |\n| `select` | `field`, optional `label`, `placeholder` (words the empty first choice; unset is \"Choose…\", W-686) | none | labelled `<select>` (options from the public form definition when available) |\n| `checkbox` | `field`, optional `label` | none | labelled `<input type=\"checkbox\" value=\"true\">` |\n| `radio` | `field`, optional `label`, `placeholder` | none | `<fieldset>` of radios (options from definition when available) |\n| `submit` | optional `label` | none | `<button type=\"submit\" class=\"ec-form-submit\">` |\n| `post-title` | optional `level` (1–6) | none | Dynamic heading from `ThemeDynamicData.post` |\n| `post-excerpt` | optional `maxWords` (whole number, 1–10000, W-177) | none | Dynamic excerpt paragraph; with `maxWords`, cut to that many words with \"…\" |\n| `post-content` | (none) | none | Dynamic body (Portable Text → safe blocks) |\n| `post-image` | optional `decorative` | none | Dynamic featured image when URL present |\n| `post-link` | optional `text`, `newTab` | none | Dynamic permalink; blank text → title |\n| `post-date` | optional `format`: `medium` (default), `short`, `long`, `full` or `numeric` (W-177) | none | `<time datetime>` with the published date in UTC; `numeric` is YYYY-MM-DD |\n| `post-author` | (none) | none | The author's name |\n| `pagination` | optional `prevText`, `nextText`, `showCount` and `countText` (`{page}` and `{total}`; unset text is \"Page {page} of {total}\"), `titleText` (the paged archive title, `{title}` and `{page}`, W-529), `archiveTitle` (replaces \"Posts\" as the posts archive title, ≤ 60, W-532), and screen reader names `navLabel` (\"Pagination\"), `pageLabel` (\"Page {page}\"), `prevLabel` and `nextLabel` (\"Previous page\" / \"Next page\", used when the text is only an arrow), each ≤ 60 (W-689) | none | `nav` of Previous, page numbers and Next. Nothing on a single page, with no archive data, or inside a Loop item |\n| `loop` | optional `partId` (the item part; `itemPartId` before schema 18); `perPage` (1–50, unset = 20) on an archive; a collection Loop also takes `collection`, `limit`, `order`, `display`, `columns`, `permalink`, `imageField`, `excerptField` and `filter` (see [Schema 13](#schema-13-the-w-307-feature-batch) and [Schema 14](#schema-14)) | `children: Node[]` (inline item template when no part id) | Repeats the item template for each post or collection entry |\n| `grid` | `columns` (1–12); optional `columnsTablet` and `columnsMobile` (1–12, W-139); optional `columnTracks`, `columnTracksTablet`, `columnTracksMobile` (1–12 tracks: `1fr`, `2fr`, `3fr`, `auto`, `min-content`, `max-content`, or a length) | `children: Node[]` | `display: grid` with that many equal columns, or the custom tracks when that device sets them; the device values go in the tablet and mobile media queries, and an unset one follows the next wider device |\n| `part-ref` (shown as \"Theme section\"; `section` before schema 18) | optional `partId` | `children: Node[]` (inline contents when no part id) | When `partId` is set, the published Section theme part's children replace the local ones |\n\nAn image's optional `edit` (W-481, D-061) is written by the image editor and never rendered. `src`, `mediaId`, `width` and `height` point at the edited file; `edit` points back at the original: `v` (`1`), `engine` (`\"photocn\"`), `engineVersion` (such as `\"0.1.2\"`), `recipe` (photocn's `RecipeV1`, strict: sliders −1 to 1, blur and curve points 0 to 1, at most 32 points per curve channel, straighten ±45°, a filter name of up to 32 letters, digits, spaces, `_` or `-`, a blend image only as a site path or `https:` URL, at most 16 KB as JSON), optional `originalMediaId`, `originalSrc` (up to 2000 characters), `output` (`format` `webp`, `jpeg` or `png`, optional `quality` 0.1 to 1, optional `maxSide` 16 to 10000 px, `stripGps` boolean) and `editedAt` (an ISO 8601 timestamp).\n\nEvery node may also carry an optional `editorLabel` (`label` before schema 18; 1–80 characters, trimmed; an editor-only name shown in Layers and on the canvas, never rendered, W-157), optional `htmlId` (CSS `id`, unique on the page; since 1.1.2 an id that names a browser global such as `location` or `document` is kept in the layout but not rendered, S-12), `classes` (style-class ids from the design system, S4), `devices` and `hiddenOn` (W-096, below).\n\n**Forms (S5):** form fields are only valid inside a `form` (or under one). Pages with a form set `needsFormsRuntime`; the host route loads `EmVBFormsRuntime` so `initForms` handles AJAX submit. Pages without a form stay zero EmVB JS (R-031).\n\n### Style properties (W-017, extended in W-088)\n\n**Text marks (W-950).** `marks` on a Heading or Text is up to 100 ranges `{ \"start\", \"end\", \"bold\"?: true, \"italic\"?: true, \"color\"?: colour, \"href\"?, \"newTab\"?: true }` over its `text` (characters `start` to `end`, end not included, 0–2000). They render as `<strong>`, `<em>`, `<span class=\"emvb-mark-c<n>\">` (the colour as `--emvb-mark-<n>` on the element, up to 8 per element; `.emvb-mark-c<n>{color:var(--emvb-mark-<n>)}` is sent only when a page uses one) and `<a class=\"emvb-mark-link\">` (checked like any link; left out inside a linked heading). Ranges past the text are clipped when drawn, so editing the text never invalidates a page; the editor moves them with the words.\n\nLengths are `{ \"value\": 0–10000, \"unit\": \"px\" | \"rem\" | \"em\" | \"%\" | \"vw\" | \"vh\" | \"ch\" }` (`vw` and `vh` since W-088, `ch` since W-331). Colours are hex or `{ \"var\": \"<id>\" }`. A **size** is a length, a variable reference or `\"auto\"`. An **offset** is a size whose value may also be negative (−10000 to 10000). A **fluid size** (W-955) is `{ \"fluid\": { \"min\": 0–10000, \"max\": 0–10000 } }` in px: written as `clamp()` growing from `min` on 360 px wide screens to `max` on 1280 px ones (the formula the design's fluid sizes use); `fontSize`, `gap`, the width and height keys, padding and margins (and the offsets) take one.\n\n| Key | Value | CSS |\n| --- | --- | --- |\n| `flexDirection` | `row`, `column`, `row-reverse`, `column-reverse` | `flex-direction` |\n| `flexWrap` | `nowrap`, `wrap`, `wrap-reverse` | `flex-wrap` |\n| `justifyContent` | `flex-start`, `flex-end`, `center`, `space-between`, `space-around`, `space-evenly` | `justify-content` |\n| `alignItems` | `stretch`, `flex-start`, `flex-end`, `center`, `baseline` | `align-items` |\n| `gap` | length | `gap` |\n| `gridColumnSpan` / `gridRowSpan` (W-099) | whole number 1–12 | `grid-column` / `grid-row` as `span N` |\n| `gridColumnStart` / `gridRowStart` | whole number 1–13 | `grid-column` / `grid-row` as the line number, or `start / span N` when a span is set too |\n| `width` / `height` | size | `width` / `height` |\n| `minWidth` / `maxWidth` / `minHeight` / `maxHeight` | length | matching size properties (`maxHeight` since W-088) |\n| `flexGrow`, `flexShrink` (W-954) | number 0–100 | `flex-grow`, `flex-shrink`: a Flexbox or Container child's share of free space, and of the shortfall |\n| `flexBasis` (W-954) | length or `auto` | `flex-basis`: the child's starting size along the row or column |\n| `alignSelf` (W-954) | `auto`, `stretch`, `flex-start`, `flex-end`, `center`, `baseline` | `align-self`: the child's own cross-axis alignment (`auto` follows the parent's Align) |\n| `order` (W-954) | whole number −99 to 99 | `order`: the child's place among its siblings (lower first) |\n| `overflow` | `visible`, `hidden`, `clip`, `scroll`, `auto` | `overflow` |\n| `overflowX`, `overflowY` (W-957) | same as `overflow` | `overflow-x`, `overflow-y`, after `overflow` so one axis wins |\n| `aspectRatio` | `\"auto\"` or `\"w/h\"` with whole numbers 1–9999, such as `\"16/9\"` | `aspect-ratio` (`16 / 9`) |\n| `objectFit` | `fill`, `contain`, `cover`, `none`, `scale-down` | `object-fit` (the editor offers it on Image and Video) |\n| `objectPosition` (W-957) | `center`, `top`, `bottom`, `left`, `right`, `top left`, `top right`, `bottom left`, `bottom right` | `object-position` (Image and Video) |\n| `paddingTop` / `Right` / `Bottom` / `Left` | length | `padding-*` |\n| `marginTop` / `Right` / `Bottom` / `Left` | offset (negative since W-331) | `margin-*` |\n| `position` | `static`, `relative`, `absolute`, `fixed`, `sticky` | `position` |\n| `top` / `right` / `bottom` / `left` | offset | matching inset properties |\n| `zIndex` | whole number −9999 to 9999 | `z-index` |\n| `fontFamily` | a font stack (1–200, checked as safe) or a font variable | `font-family` |\n| `fontSize` | length | `font-size` |\n| `lineHeight` | length, or a unitless number 0–100 | `line-height` |\n| `letterSpacing` | length whose value may be negative (−10000 to 10000) | `letter-spacing` |\n| `fontWeight` | `100`–`900` in steps of 100, `normal`, `bold` | `font-weight` |\n| `textAlign` | `left`, `center`, `right`, `justify` | `text-align` |\n| `textTransform` | `none`, `uppercase`, `lowercase`, `capitalize` | `text-transform` |\n| `textDecoration` | `none`, `underline`, `overline`, `line-through` | `text-decoration` (W-113; a button sets `none` in its base CSS) |\n| `markerColor`, `markerSize` (W-952, Lists) | colour; length | `--emvb-marker-color`, `--emvb-marker-size`, read by the marker and step rules (sent only when a page sets them) |\n| `fontStyle` (W-957) | `normal`, `italic` | `font-style` |\n| `whiteSpace` (W-957) | `normal`, `nowrap`, `pre-line`, `pre-wrap` | `white-space` (a Text element defaults to `pre-line`) |\n| `overflowWrap` (W-957) | `normal`, `break-word`, `anywhere` | `overflow-wrap` |\n| `color` / `backgroundColor` / `borderColor` | colour | matching colour properties |\n| `backgroundImage` (W-094) | http(s) URL or a site path, no spaces, quotes or parentheses | `background-image` as `url(\"…\")`. With no size, position or repeat: `cover`, `center`, `no-repeat` |\n| `backgroundVideo` | the same URL rule as `backgroundImage` | a muted, looping `<video>` behind the content |\n| `backgroundSize` | `auto`, `cover`, `contain` | `background-size` (the image layer) |\n| `backgroundPosition` | `center`, an edge (`top`, `bottom`, `left`, `right`) or a corner (`top left` and the other three) | `background-position` |\n| `backgroundRepeat` | `no-repeat`, `repeat`, `repeat-x`, `repeat-y` | `background-repeat` |\n| `gradient` | `{ type, angle?, position?, stops }`: `type` `linear`, `radial` or `conic`; `angle` whole degrees 0–360 (the linear direction, default 180, or the conic start, default 0); `position` (the radial centre, default `center`) takes the `backgroundPosition` values; `stops` are 2–10 `{ color, at }`, `color` a colour and `at` a whole % 0–100 | `linear-gradient`, `radial-gradient` (a circle) or `conic-gradient`, stops in `at` order, behind the image |\n| `overlay` | `{ color, opacity: 0–1 }`, or since W-949 `{ gradient, opacity?: 0–1 }` with the same `gradient` shape | a colour or gradient layer above the image (a scrim). Hex becomes 8-digit hex; a colour variable becomes `color-mix`; a gradient overlay's `opacity` (unset = 1) fades every stop |\n| `borderWidth` / `borderRadius` | length | matching border properties: every side or corner |\n| `borderTopWidth`, `borderRightWidth`, `borderBottomWidth`, `borderLeftWidth` (W-138) | length | `border-top-width`, `border-inline-end-width`, `border-bottom-width`, `border-inline-start-width`, after `border-width`, so a side beats it |\n| `borderTopLeftRadius`, `borderTopRightRadius`, `borderBottomRightRadius`, `borderBottomLeftRadius` (W-138) | length or a spacing variable | `border-start-start-radius`, `border-start-end-radius`, `border-end-end-radius`, `border-end-start-radius`, after `border-radius` |\n| `borderStyle` | `none`, `solid`, `dashed`, `dotted` | `border-style` |\n| `opacity` | number 0–1 (the editor shows 0–100 %) | `opacity` |\n| `boxShadow` | `{ x, y, blur, spread, color?, inset? }`: px numbers, `x`, `y` and `spread` −1000 to 1000, `blur` 0 to 1000; `color` is a colour; `inset` is a boolean | `box-shadow` as `[inset] Xpx Ypx Bpx Spx [colour]`; no colour means the text colour |\n| `filter` | `{ blur?, brightness?, contrast?, saturate?, grayscale?, hueRotate? }`, at least one set: `blur` 0–100 px, `brightness` / `contrast` / `saturate` 0–300 %, `grayscale` 0–100 %, `hueRotate` 0–360° | `filter`, functions always in that order, such as `blur(2px) grayscale(100%)` |\n| `backdropFilter` (W-957) | the same object as `filter` | `backdrop-filter`, applied to what is behind the element (frosted glass) |\n| `transform` (W-953) | `{ x?, y?, scale?, rotate? }`, at least one: `x` and `y` whole px −2000 to 2000, `scale` whole % 10–400, `rotate` whole degrees −360 to 360 | `translate`, `scale` and `rotate` (CSS's own properties, so an entrance never cancels it; a scroll motion or loop on the same property wins while it runs). In a hover state it is a lift; animate it with a `transform` transition |\n| `cursor` | `default`, `pointer`, `text`, `move`, `grab`, `not-allowed`, `help`, `crosshair`, `zoom-in` | `cursor` |\n| `motion.transition` (W-089, Normal only) | `{ duration, delay?, easing, property }`: `duration` and `delay` whole ms 0–2000; `easing` `ease`, `ease-in`, `ease-out`, `ease-in-out`, `linear`; `property` `all`, `colors`, `opacity`, `shadow`, `filter`, `transform` (W-953). No other keys | `transition`, one entry per CSS property: `colors` is `color`, `background-color` and `border-color`; `shadow` is `box-shadow`; `transform` is `translate`, `scale` and `rotate`. For example `opacity 200ms ease-out 50ms` |\n| `motion.entrance` (W-101, Normal only) | `{ type, duration, delay?, trigger? }`: `type` is `fade`, `fade-up`, `fade-down`, `slide-up`, `slide-down` or `scale`; `duration` and `delay` whole ms 0–2000; `trigger` is `load` (default) or `view` (as it scrolls in; browsers without scroll-driven animations play it on load) | `animation` named `emvb-<type>`, once, `ease-out`, `both`. Reduced motion sets `animation: none` |\n| `motion.loop` (W-938, Normal only; 1.0) | `{ effects, duration, easing?, alternate?, loop? }` or `{ type: \"none\" }`. `effects` as `motion.scroll`; `duration` 200–20000 ms; `easing` a transition easing (default `ease-in-out`); `alternate` false plays one way; `loop: true` never stops | A time-based CSS animation; stops after about 5 s unless `loop`; off for reduced motion. The accessibility check flags Loop forever and runs over 5 s |\n| `motion.scroll` (W-319, Normal only; `scrollMotion` before schema 18) | `{ effects, range }` or `{ type: \"none\" }`. Each effect is `{ type, from, to }`: `type` is `fade`, `move-x`, `move-y`, `scale`, `rotate` or `blur` (one of each). `range` is `enter`, `cross`, `exit` or `page`. `none` stops motion a wider device set | CSS scroll-driven animations. Reduced motion, and browsers without them, show the element still |\n| `iconRotate` (W-237, icons) | whole degrees −360 to 360 | `--emvb-icon-rotate`, read by the icon's `svg` as `rotate` |\n| `iconFlip` (W-237, icons) | `none`, `horizontal`, `vertical`, `both` | `--emvb-icon-flip` (`1 1`, `-1 1`, `1 -1`, `-1 -1`), read by the `svg` as `scale` |\n| `iconScale` (W-237) | number 0.1–4 | `scale` on the element (the icon and its background shape) |\n| `iconStrokeWidth` (W-237, outline icons) | number 0.25–6 | `--emvb-icon-stroke`; applies when the stored SVG's root has a stroke width of 1, 1.5, 2, 2.5 or 3 (render moves it into an `emvb-icon-sw<w>` class) |\n| `iconShadow` (W-237, icons) | `{ x, y, blur, color? }`: px, `x` and `y` −100 to 100, `blur` 0–100 | `--emvb-icon-shadow` as `drop-shadow(Xpx Ypx Bpx [colour])`, read by the `svg` as `filter` (follows the outline) |\n| `motion.icon` (W-237, Normal only; `iconAnimation` before schema 18) | `{ type, duration }`: `type` `spin` or `pulse`; `duration` whole ms 200–10000; optional `loop: true` (W-853, D-059) keeps it running forever. Or `{ type: \"none\" }` (W-248), which stops an animation a device inherits from a wider one | `--emvb-icon-animation` (`emvb-icon-spin <ms> linear <runs>`, `emvb-icon-pulse <ms> ease-in-out <runs> alternate` or `none`; W-848: `<runs>` is as many whole runs as fit in 5 s, at least one, even for a pulse; with `loop: true` it is `infinite`); the icon base CSS turns it off under `prefers-reduced-motion: reduce` |\n\n**W-088 additions are additive.** Every new key and unit is optional and every earlier value keeps its meaning, so stored pages and classes are valid unchanged. The version moved to 2 (D-031) with a v1 → v2 step that changes nothing, so an older EmVB shows \"saved by a newer EmVB\" rather than an invalid-layout error. The keys are the same on `node.style` and on `design.classes[].style`. The generator builds each value from typed numbers and keywords only and runs the same `isSafeCssValue` gate as every other property; anything else is dropped with a `rejected-style` warning. A shadow colour bound to a colour variable counts as a use of that variable, and deleting the variable clears it from the page layout and from class styles.\n\n### State styles (W-089)\n\n`node.states` and `design.classes[].states` are `{ \"hover\"?, \"focus\"?, \"active\"? }`. Each state is a style object with the same keys, limits and variable references as `style`, except `motion` (transition, entrance, scroll and icon motion), which belongs to Normal only. Any other state name is refused. Adding `states` moved the version to 3 (D-032) with a v2 → v3 step that changes nothing.\n\n```json\n{\n \"id\": \"btn00001\",\n \"type\": \"button\",\n \"props\": { \"text\": \"Go\" },\n \"style\": { \"backgroundColor\": \"#1d4ed8\", \"motion\": { \"transition\": { \"duration\": 200, \"easing\": \"ease-out\", \"property\": \"colors\" } } },\n \"states\": { \"hover\": { \"backgroundColor\": \"#1e3a8a\" }, \"focus\": { \"borderColor\": \"#f59e0b\" } }\n}\n```\n\n- **Selectors.** `hover` is `:hover`, `focus` is `:focus-visible` (keyboard focus, so a mouse click leaves no focus style); a linked Heading or Icon also matches when its inner link has keyboard focus (`:has(> :is(.emvb-heading-link,.emvb-icon-link):focus-visible)`, W-242) and `active` is `:active`.\n- **Cascade.** Each selector's base rule is followed by its `:hover`, `:focus-visible` and `:active` rules, classes first and then the local rule. So a state rule beats every Normal rule (a class's Hover colour shows over a local Normal colour), within one state the local rule beats the class, and Active beats Focus, which beats Hover.\n- **Safety.** State values go through the same mappers and `isSafeCssValue` gate as `style`. A rejected value is dropped with a `rejected-style` warning naming `<state>.<key>` (such as `hover.color`); a `motion` inside a state is refused by validation and dropped by the renderer and reported the same way, and so is an unknown state name. An unknown variable in a state is reported like one in `style`. An element whose only styles are states still gets `emvb-e-<id>`.\n- **Reduced motion.** When any rule has a `transition`, the CSS ends with one `@media (prefers-reduced-motion: reduce){…{transition:none}}` block that lists exactly those selectors. Nothing else changes under reduced motion.\n- **Editor preview.** The canvas CSS repeats every state rule for `[data-emvb-state=\"hover\"|\"focus\"|\"active\"]`, and the editor sets that attribute on the selected element while a state is chosen in the Style tab. Public CSS has neither the attribute nor those selectors.\n\n### Per-device styles (W-096)\n\n`node.devices` and `design.classes[].devices` are `{ \"laptop\"?, \"tablet\"?, \"mobile\"? }` (`laptop` since W-956). Each is a style object with the same keys as `style`. Only keys that differ from the wider devices are stored. `node.hiddenOn` and `design.classes[].hiddenOn` are arrays of `\"desktop\"`, `\"laptop\"`, `\"tablet\"` and `\"mobile\"` (at most one of each). Desktop itself stays in `style`.\n\n- **Queries.** Laptop is `@media (max-width: 1366.98px)`, then tablet `@media (max-width: 1024.98px)`, then mobile `@media (max-width: 767.98px)`. A narrower screen matches every wider query, so the narrowest device wins on a shared key, and a laptop-only key still applies on tablets and phones. The tablet and mobile bounds match `deviceForWidth` (under 768 mobile, under 1025 tablet), which popup targeting and visitor rules use (a laptop is desktop there).\n- **Hide.** Each device has its own query, so `display: none` does not leak: desktop `(min-width: 1367px)`, laptop `(min-width: 1025px) and (max-width: 1366.98px)`, tablet `(min-width: 768px) and (max-width: 1024.98px)`, mobile `(max-width: 767.98px)`. An element hidden on both Desktop and Laptop gets the one rule `(min-width: 1025px)`. Before W-956, `\"desktop\"` meant every screen from 1025 px; schema 17 pages are upgraded to `[\"desktop\", \"laptop\", …]` on read, so they render byte for byte as before.\n- **Grids.** Column counts have no laptop value: laptops use the desktop columns. The `.98` keeps fractional widths from zoom or display scaling (1024.5, say) inside one device, so nothing slips between two hide queries (W-506).\n- **Wide screen (W-959, 1.1).** An own `style.wide` record holds the values for 2400 px and up, in `@media (min-width: 2400px)`, built on Desktop's (the narrower devices never overlap it). `style.wide.hidden` overrides the Desktop hide there: `true` adds `(min-width: 2400px)` for an element not hidden on Desktop; `false` on an element hidden on Desktop stops its Desktop rule at `2399.98px`. Without `hidden`, Wide screen follows Desktop and the CSS is what it was. The renderer reads it as one more device (`renderableNode` moves it to `devices.wide` and `wideHidden`). Grid column counts have no Wide screen value.\n- **States.** Hover, focus and active stay all-viewport. Device overrides edit Normal only.\n- **Version.** Adding these fields moved the version to 5 (D-036) with a v4 → v5 step that changes nothing.\n\n## Design system document\n\n```json\n{\n \"schemaVersion\": 17,\n \"variables\": {\n \"colors\": [{ \"id\": \"brand\", \"name\": \"Brand\", \"value\": \"#0055ff\" }],\n \"fonts\": [{ \"id\": \"body\", \"name\": \"Body\", \"value\": \"Noto Sans, sans-serif\" }],\n \"fontSizes\": [{ \"id\": \"lg\", \"name\": \"Large\", \"value\": { \"value\": 24, \"unit\": \"px\" } }],\n \"spacings\": [{ \"id\": \"md\", \"name\": \"Medium\", \"value\": { \"value\": 16, \"unit\": \"px\" } }]\n },\n \"classes\": [{ \"id\": \"card\", \"name\": \"Card\", \"style\": { \"paddingTop\": { \"value\": 16, \"unit\": \"px\" } } }]\n}\n```\n\n- Colour ids are 1–40 of `a-z 0-9 -`, names 1–60 characters, values hex as above. At most 200 colours.\n- The document is at most 256 KiB (`MAX_DESIGN_BYTES`).\n- A font size or spacing variable may set `fluid: { min, max }` (px, 0–1000). It is emitted as `clamp()` between `fluidRange` (unset is 360 to 1280 px; `minWidth` must be less than `maxWidth`). `value` stays the fixed fallback (W-316).\n- `direction` is `ltr`, `rtl` or `auto` (unset is left to right). It is `dir` on every EmVB root, and hosts get it back for `<html dir>` (W-230).\n- `defaults` is a starting style per tag (`h1`–`h6`, `p`, `a`, `button`), emitted under `:where(.emvb-root)` so a class still wins.\n\n## Limits and validation\n\n`validateLayout()` runs on every save (the plugin's `beforeSave` hook) and on every read (editor and public render), in this order:\n\n1. **Size:** the JSON is at most 512 KiB (`MAX_LAYOUT_BYTES`) in UTF-8 bytes.\n2. **Version:** `upgradeLayout()` runs the migration chain up to the current version. A document from a newer EmVB is refused with \"Update EmVB to edit it\", never downgraded.\n3. **Structure:** at most 2000 nodes (`MAX_NODES`) and 24 levels (`MAX_DEPTH`), checked iteratively before parsing.\n4. **Schema:** the Zod schema above.\n5. **Ids:** every node id is unique.\n\nIssues carry a path such as `root.children[0].props.level`, which the editor uses to select the element at fault. A layout that fails on read renders nothing on the public page and logs only the page id (R-033).\n\n## Rendered output\n\n- The root gets `emvb-root`, each node `emvb-<type>` and, when its style, a state, a device override or a hide flag yields a rule, `emvb-e-<id>`. Invalid style values are dropped with a render warning. A reference to an unknown variable is kept and also reported as a warning. Unknown element types render nothing publicly and a placeholder with `data-emvb-id` in the editor (warning `unknown-type`). An unknown node still keeps `dir`, `container` and `query` (W-352), so a later version that understands the type still has them.\n- The CSS is, in order: variables on `.emvb-root` (`--emvb-c-*` colours, `--emvb-f-*` fonts, `--emvb-fs-*` font sizes, `--emvb-s-*` spacings), base CSS for the element types in use, then class rules (W-030), then one `.emvb-e-<id>{…}` rule per styled node (R-021). Each class and local rule is followed by its state rules, then the tablet media query, the mobile media query and the hide queries (see [Per-device styles](#per-device-styles-w-096)). A reduced-motion block closes the CSS when a transition is set (see [State styles](#state-styles-w-089)).\n- **Style classes** (`design.classes[]`): `{ id, name, style, states?, devices?, hiddenOn? }`. Elements list ids in `node.classes`; HTML gets `emvb-k-<id>` in that order. When two classes set the same property, the one later in `design.classes` wins, because its rule comes later in the stylesheet. Local `.emvb-e-<id>` rules come after every class, so local styles win. `classStylesInListOrder` feeds `resolveCascade` in that list order.\n- Length/font style props may use `{ \"var\": \"<id>\", \"from\": \"spacing\"|\"fontSize\"|\"font\" }` (colours keep `{ \"var\": \"<id>\" }`). Offsets (`top`, `right`, `bottom`, `left`) take spacing variables; the shadow colour takes a colour variable.\n- Text and attributes are escaped by the serializer. Public output has no scripts and no editor `data-emvb-*` attributes (such as `data-emvb-id`). The only `data-emvb-*` attributes it carries are these public hooks (`PUBLIC_DATA_ATTRIBUTES` in `core/public-attributes.ts`, kept in step with this list by a test): `data-emvb-theme-part` on a theme part's wrapper ([theme-parts.md](theme-parts.md#public-render)); `data-emvb-loop-item` (the post id) on each Loop item; `data-emvb-popup`, `data-emvb-popup-config` and `data-emvb-popup-dismiss` on popup chrome; `data-emvb-float`, `data-emvb-float-dismiss` and `data-emvb-float-edge` on float chrome. The popup, float and menu runtimes may add their own state attributes after load (`data-emvb-menu-dismissed`).\n\n## Changing the format\n\n- Add a migration `LAYOUT_MIGRATIONS[n]` (pure, version n to n + 1) and bump `LAYOUT_SCHEMA_VERSION` in the same change.\n- Add fixtures and tests for the old and new shapes, and update this file.\n- `test/docs/layout-format.test.ts` checks this file's title, the \"literal `N`\" sentence and the JSON examples against the code, so a schema bump must update them.\n\n## S8 additive elements (W-072–W-074)\n\n- **`div-block`**: block container (`display:block`); children like Container. Optional `href` and `newTab`, like Container.\n- **`flexbox`**: flex container defaulting to row + wrap + gap (Container stays column). Optional `href` and `newTab`.\n- **`svg`**: `props.markup` (sanitized allowlist; no scripts/handlers/`use`/`foreignObject`); optional `title`, `decorative`, `size`. A valid non-square `viewBox` keeps its ratio: the longer side is `size` (48 when unset) and the other side scales. A square, missing, or unreadable `viewBox` stays a square of `size`.\n- **`tabs` / `tab-panel`**: Tabs hold only tab-panels. Public markup is CSS-only (radio + `:has()`); the optional tabs script only takes the hidden radios out of the tab order.\n- **`accordion` / `accordion-item`**: items are `<details>`. An item needs `summary` (1–200) and may start `open`. No script.\n- **`menu` / `menu-item`**: a `nav` (named by `label`, default \"Menu\") of links. `direction` is `row` or `column`. An item with children is a dropdown; `wide` stretches that panel across the menu. A menu with a dropdown can load the optional menu script so Escape closes it. An empty menu is a plain box, not a `nav`.\n- **`grid`** also takes optional `href` and `newTab`.\n\n\n## Schema 13: the W-307 feature batch\n\nSchema 13 only adds optional fields, so a v12 document upgrades unchanged.\n\n### Collection Loops (W-308)\n\nA `loop` with `props.collection` (a collection slug) lists that collection's published entries\ninstead of the archive's posts. `limit` (1–50, default 6), `order` (`newest`, `oldest`, `title`),\n`display` (`list`, `grid`, `cards`) and `columns` (1–6) are optional. Hosts fill\n`dynamic.collections[loopId]` (see `collectCollectionLoops`). A `loop-empty` child is left out of\nthe item design and rendered when there are no entries; it is only valid inside a `loop`.\n\n### Data bindings (W-307)\n\nAny node may carry `bind`: prop name → `{ source, key }`. `source` is `post` (a post field such as\n`title`, or any plain field of the entry by name, for example `role`), `site` (a site setting:\n`title`, `tagline`, `url`, `social.github`…) or `param` (a URL parameter). Which props can be bound\nis fixed per element (`BINDABLE_FIELDS`: text, links, image source and alt). The typed prop stays as\nthe fallback when the source has no value. Bound values are plain text, capped at 500 characters,\nand go through the element's own escaping and link and image URL checks.\n\nA link or image bound to `param` only takes same-site URLs: relative ones, or absolute ones on the\npage's origin (hosts pass it as `dynamic.origin`). Anything else shows the typed value, unless the\nbinding sets `outside: true` (\"Allow outside sites\" in the editor). Anyone can craft a URL\nparameter, so that option lets them point the page's links and images at any site.\n\n### A/B tests and visitors (W-312, W-313, W-329)\n\nAny node may set `variant`: `{ test, arm, split? }`. `test` is a name of lowercase letters, digits and `-` (up to 32). `arm` is `a` or `b`. `split` (on the B element, 1–99, unset = 50) is the share of visitors who see B. The host picks one arm per visitor and keeps it in a cookie.\n\n`audience` shows or hides the element. Every field that is set must match, and `hide: true` flips that to \"everyone except\":\n\n- `countries`: two-letter codes, 1–50\n- `devices`: `mobile`, `tablet`, `desktop`\n- `visitor`: `new` or `returning`\n- `hours`: `{ from, to }` (0–23 and 0–24; wraps past midnight when `to` < `from`) and `days` (0 = Sunday), in `timeZone` (an IANA name; unset = UTC)\n- `segments` (W-329): 1–20 names the host passes (`member`, `pro`), lowercase letters, digits, `-` and `_`\n\nA rule the host cannot check does not match. Pages with a variant or an audience are sent `Cache-Control: private, no-store`.\n\n## Schema 14\n\nSchema 14 only adds optional fields, so a v13 document upgrades unchanged.\n\n- **Visitor segments (W-329).** `audience.segments`, above. Hosts pass them as `resolveEmVBPage(Astro, { visitor: { segments } })` and the same option on `resolveThemeParts`. `country`, `device` and `returning` on that object replace what EmVB detects.\n- **Loop fields (W-330).** On a collection Loop, `permalink` is a site path containing `{slug}` or `{id}` (unset is `/<collection>/{slug}`). `imageField` and `excerptField` name the entry fields Post Image and Post Excerpt read (unset is `featured_image` and `excerpt`). `filter` is up to five `field=value` pairs separated by `;`. A taxonomy name filters by term, and the same field twice matches either value.\n- **`ch` and negative margins (W-331).** Lengths may use `ch`. Margins may be negative (−10000 to 10000). Padding stays 0 or more.\n\n## Internal proposal records (W-928)\n\nProposals are review data in the plugin-storage collection `emvb_proposals`, not page\nrevisions. A row holds `{ proposal, createdAt }`, keyed by a server-generated 16-hex id.\nThe version-1 proposal is `{ version: 1, target: { collection, id }, baseRevision,\nbaseDesignRevision, ops }`. The plugin adapter currently reads the target entry's\n`layout` field (native visual pages and theme parts); arbitrary host canvas-field\nselection is not part of this transport. `baseRevision` is EmDash's current `_rev`.\n`baseDesignRevision` is the effective draft style revision, or the published style\nrevision when no draft exists, or null on an empty site. It is checked only when\nclass/variable ops are present, so page-only proposals survive unrelated style edits.\n\nOperations run in list order against frozen schema 18 ids and names:\n\n- `insert`: `{ kind, parentId, index, node }` — a complete stored node/subtree.\n- `move`: `{ kind, id, parentId, index }` — uses editor drop rules; index addresses\n the destination children **before** removal, as in `moveNode`.\n- `update`: `{ kind, id, set }` — editable node fields only. `props` shallow-merges;\n other fields replace their whole value, and null clears an optional node field.\n `id`, `type` and `children` cannot be patched. Use `editorLabel`, `props.partId`\n and `style.motion`, not their old aliases.\n- `delete`: `{ kind, id }` — never the root.\n- `class`: `{ kind, id, value }` — full class upsert, or null to remove an existing id.\n- `variable`: `{ kind, group, id, value }` — full variable upsert/removal;\n group is `colors`, `fonts`, `fontSizes` or `spacings`. Payload ids must match the\n operation id. Names must already be clean and unique in their list; no truncation.\n\n`applyProposal(base, proposal, selectedIndexes?)` returns a new `{ layout, design }`\nonly: it cannot save, publish, acquire an edit lock, or change review/undo state.\nSelected indexes refer to the original list; selection order cannot reorder ops.\nEach selected intermediate result passes stored-layout/design validation, nesting\nrules and the existing URL/SVG/CSS/font allowlists. Unknown layout keys still use\nthe frozen contract's keep-and-ignore rules. A dependency on an omitted operation,\na missing id, a bad node, a duplicate id, an invalid index or any other refusal\naborts the entire preview. Nothing is partially returned or persisted. W-930 must\nfeed accepted results through normal undo and draft saves, including the existing\nsite-wide guards for shared-style deletion; this store never writes site styles.\n\nCreation checks **all** ops and re-reads the base before storage. `STALE_BASE` reports\nexpected/current revisions and asks the caller to read the current document and\nsubmit a rebased proposal; there is no merge/retry/override. Preparation rechecks the\nlive revisions, so keeping or reading an old proposal does not make it applicable.\nGet/list are review reads, not an applicability guarantee; malformed rows are refused\nby get and omitted by list. Per-isolate serialization matches saved sections; there\nis no distributed content transaction (the final draft save still needs its own CAS).\n\nBudgets: 100 ops, 512 KiB JSON, 64 JSON nesting levels, and 100 stored proposals per\nsite; resulting layouts/designs retain all existing byte/node/depth limits. Cycles,\nnon-JSON values and prototype-manipulation keys are refused before parsing.\n\nPlugin-local editor transport mirrors saved sections: `proposals` (target-filtered\nlist), `proposals/get`, `proposals/create`, `proposals/withdraw`. Every route requires\n`content:edit_any` and EmDash's private-request/CSRF guard. These are not public/MCP\nAPIs; W-929 adds MCP tools and W-930 adds review UI later. Withdrawal only removes\nreview data; it cannot affect a page. No per-op review states or agent publish path\nare implemented here.\n\n## 1.2 widgets (W-1018–W-1025)\n\nAdded in 1.2, additive: new element types only, so an older 1.x keeps them on save and leaves them out of\nthe page (see Unknown element types above). Each renders without script.\n\n| Type | `props` | Children | Renders as |\n| --- | --- | --- | --- |\n| `rating` (shown as \"Star rating\", W-1023) | `value` (0–10, any decimal; shown to one decimal), optional `max` (whole number 1–10, unset 5; a `value` above it shows as `max`, so lowering it never makes a page invalid), `label` (≤ 120; `{value}` and `{max}` are filled in; unset \"Rated {value} out of {max}\"), `size` (8–128 px per star, unset 20) | none | `<div role=\"img\" aria-label=\"Rated 4.5 out of 5\">` with one `aria-hidden` star SVG per point, filled in the element's text colour; a part-filled star is the filled star cut by its `viewBox` over a 25 % star. Right to left, stars fill from the right |\n| `alert` (W-1025) | `variant` (`info`, `success`, `warning`, `danger`), optional `title` (≤ 200), `text` (≤ 2000; line breaks kept), optional `hideIcon`, `dismissible`, `dismissLabel` (≤ 80, unset \"Dismiss\") | none | `<div role=\"note\" class=\"emvb-alert emvb-alert-<variant>\">` in the variant's colours (text on background at least 7:1, overridable by the element's styles), its `aria-hidden` icon unless `hideIcon`, then the title and text paragraphs. `dismissible` adds `<button type=\"button\" data-emvb-alert-dismiss aria-label=\"Dismiss\">`, hidden by CSS until the opt-in alerts runtime marks it ready; that script hides the Alert on press and moves focus to the next focusable element. The page then lists `\"alerts\"` in `runtimes` |\n| `icon-box` (W-1020) | `iconId` and optional `iconSvg` (as on `icon`), `iconSize` (8–512 px, unset 48), `title` (≤ 200), optional `titleLevel` (2–6, unset 3), `text` (≤ 2000, line breaks kept), optional `position` (`top`, `left`, `right`; unset `top`), `href`, `newTab` | none | `<div class=\"emvb-icon-box emvb-media-box emvb-media-box-<position>\">` with the icon `aria-hidden` in `.emvb-media-box-media`, then `<hN class=\"emvb-media-box-title\">` and `<p class=\"emvb-media-box-text\">`. With a safe `href` the title is wrapped in `<a class=\"emvb-media-box-link\">`, whose `::after` covers the box, so the whole box is clickable through one named link. An empty title or text is left out |\n| `image-box` (W-1021) | the picture keys of `image`: `src`, `alt` (required unless `decorative`), optional `mediaId`, `width`, `height`, `focalX`, `focalY` (kept for the media library; a box doesn't crop); optional `imageSize` (`small` 25 %, `medium` 40 %, `large` 60 %, `full`; the picture's share of the width when beside the words, unset `medium`); and the title, text, position and link keys of `icon-box` | none | as `icon-box`, class `emvb-image-box` (plus `emvb-image-box-<size>` unless medium), with `<img loading=\"lazy\" decoding=\"async\">` and its `width`/`height` in `.emvb-media-box-media`; no media part without a safe `src` |\n| `testimonial` (W-1022) | `quote` (≤ 2000, line breaks kept), `name` (≤ 200), optional `role` (≤ 200), optional photo keys `src`, `alt` (written by the media library, not rendered), `mediaId`, `width`, `height`, `focalX`, `focalY`; optional `rating` (0–10) and `ratingMax` (1–10, unset 5) | none | `<figure class=\"emvb-testimonial\">`: the rating as in `rating` (`role=\"img\"`, \"Rated 5 out of 5\") when `rating` is set, `<blockquote class=\"emvb-testimonial-quote\"><p>`, then `<figcaption>` with the photo (48 px, round, `alt=\"\"`: the name is beside it) and the name and role |\n| `social-icons` (W-1024) | optional `label` (≤ 80, unset \"Social media\"), `shape` (`plain`, `circle`, `rounded`, `square`; unset `plain`), `brandColors` | `children`: Social links only, at most 20 | `<ul class=\"emvb-social-icons emvb-social-<shape>\" aria-label=\"Social media\">`; icons are one em, so the element's font size sizes them (1.5em by default). Badges draw the icon in white on the text colour, or on each network's colour with `brandColors` |\n| `social-link` (W-1024) | `network` (one of `facebook`, `instagram`, `x`, `linkedin`, `youtube`, `tiktok`, `bluesky`, `mastodon`, `threads`, `github`, `pinterest`, `whatsapp`, `discord`, `twitch`, `reddit`, `dribbble`, `behance`, `telegram`, `spotify`, `email`, `rss`, `website`), `href` (≤ 2000), optional `label` (≤ 80, the link's name; unset the network's name), `newTab` | none; only inside `social-icons` | `<li class=\"emvb-social-link emvb-social-<network>\"><a href aria-label=\"Instagram\">` around the preset's `aria-hidden` SVG (Font Awesome Free, CC BY 4.0, generated into `core/icons/social.generated.ts`). Without a safe `href` the icon shows dimmed in a `<span aria-hidden>` with no link |\n| `gallery` (W-1019) | optional `layout` (`grid` squares or `masonry`; unset `grid`), `columns` (1–6, unset 3; at most 2 up to 1024 px wide and 1 up to 767 px), `lightbox`, `label` (≤ 80) | `children`: Gallery images only, at most 60 | `<ul class=\"emvb-gallery emvb-gallery-<layout> emvb-gallery-cols-<n>\">`, named by `label`. `lightbox` adds `data-emvb-lightbox` and lists `\"lightbox\"` in `runtimes`: that script turns each picture into a \"View larger: <alt>\" button opening one native modal `<dialog>` with Previous/Next (and arrow keys), a spoken \"2 of 5\", Close and Escape; focus returns to the picture |\n| `gallery-image` (W-1019) | the picture keys of `image` (`src`, `alt` required unless `decorative`, `mediaId`, `width`, `height`, `focalX`, `focalY`) and optional `caption` (≤ 500) | none; only inside `gallery` | `<li class=\"emvb-gallery-image\"><figure>` with a lazy `<img>` and its `<figcaption>`; no picture without a safe `src` |\n| `carousel` (W-1018) | optional `label` (≤ 80, unset \"Carousel\"), `perView` (1–4, unset 1; at most 2 up to 1024 px, 1 up to 767 px), `arrows`, `dots`, `autoplay`, `interval` (3–30 seconds, unset 6), `loop` | `children`: Slides only, at most 20 | `<section aria-roledescription=\"carousel\" aria-label=\"Carousel\">` with a focusable `<div class=\"emvb-carousel-track\" tabindex=\"0\">` that scrolls and snaps to each slide with no script (`aria-live` polite, off while autoplaying). `arrows`, `dots` or `autoplay` add `data-emvb-*` options and list `\"carousel\"` in `runtimes`: that script adds Previous/Next (disabled at the ends unless `loop`), one \"Go to slide n\" button per view position (`aria-current`), and for autoplay a Pause/Play button before the slides; autoplay pauses while hovered or focused and starts paused under `prefers-reduced-motion` |\n| `carousel-slide` (W-1018) | optional `label` (≤ 80) | `children: Node[]`; only inside `carousel` | `<div role=\"group\" aria-roledescription=\"slide\" aria-label=\"2 of 5\">` (or its `label`) |\n\n**Widget runtimes (W-1025).** `renderPage` returns `runtimes`, the opt-in widget scripts the rendered\nelements asked for (sorted; empty for most pages). `renderStored` and `resolveThemeParts` set it only\nwhen it is not empty. `EmVBPage` mounts them itself; a site layout mounts its theme parts' with\n`<EmVBWidgetRuntimes names={theme.runtimes} />` from `@perkyzz/emvb/astro/widgets`. The HTML/CSS\nexport writes each one next to the pages that use it (`assets/emvb-alerts.js`, `assets/emvb-lightbox.js`, `assets/emvb-carousel.js`).\n";
|
|
6501
|
+
var layout_format_default = "# Layout format (schema 18)\n\nHow EmVB stores a page and its site-wide design, at layout schema 18 and design schema 17, schema contract 1.0 (W-925, D-065: renames, motion under `motion`, unknown keys kept; see [docs/SCHEMA.md](../SCHEMA.md)); Loop forever on an icon animation in W-853, D-059; the image editor's `edit` record on images in W-481; per-element direction, image link and caption, button icons, table of contents, container queries, and focal points in W-341 onward; visitor segments in W-329; Loop fields in W-330; `ch` lengths and negative margins in W-331). The source of truth is the code: `packages/emvb/src/core/schema/` (Zod schemas), `core/limits.ts`, `core/validate.ts` and `core/migrate/`. Update this file in the same change as any of them (ARCHITECTURE.md § Documentation).\n\n## Where it lives\n\n- **Pages** are entries in the hidden `emvb_pages` collection (D-012, D-019). The layout is the `layout` field (EmDash type `json`, shown with the read-only `emvb:layout` widget). The other fields are `title`, `canvas_mode` (`site-layout` or `blank`) and EmDash's own slug, status, revision and SEO fields. EmDash may hand a `json` field back as a string, so readers accept both (`renderStored` in `src/astro/render.ts`).\n- **The design system** (colours, fonts, font sizes, spacings; classes in W-030) is one document in plugin storage, collection `design`, key `system` (D-013). Editors save a draft at key `draft` through `POST /_emdash/api/plugins/emvb/design/save` (W-100, D-040 proposed). `POST .../design/publish` copies that draft onto `system`. The public `GET /_emdash/api/plugins/emvb/design` returns `system` only.\n\n## Page layout\n\n```json\n{\n \"schemaVersion\": 18,\n \"root\": {\n \"id\": \"root0001\",\n \"type\": \"container\",\n \"props\": {},\n \"style\": { \"flexDirection\": \"column\", \"gap\": { \"value\": 16, \"unit\": \"px\" } },\n \"children\": [\n {\n \"id\": \"head0001\",\n \"type\": \"heading\",\n \"props\": { \"text\": \"Welcome\", \"level\": 1 },\n \"style\": { \"color\": { \"var\": \"brand\" } }\n }\n ]\n }\n}\n```\n\n- `schemaVersion` is the literal `18` (D-031, D-032, D-034, D-036, D-038, D-039, D-041, D-042, D-044, W-141, D-045, W-160, W-307, W-329, W-341, W-481, W-885, W-925; older documents are upgraded on read by steps that change nothing, except v11 → v12, which rewrites a gradient's `from` and `to` into `stops`, and v17 → v18 (W-925), which renames `section` to `part-ref`, a node's `label` to `editorLabel` and a Loop's `itemPartId` to `partId`, and moves `transition`, `entrance`, `scrollMotion` and `iconAnimation` under `style.motion`). `root` is always a container.\n- Every node has `id` (4–24 of `A-Z a-z 0-9 _ -`, unique within the page), `type`, `props`, and optional `style`, `states` (W-089, see [State styles](#state-styles-w-089)), `classes` (up to 20 ids of 1–40 of `a-z 0-9 -`, rendered as `emvb-k-<id>`), `bind` (W-307), `variant` (an A/B arm, W-312) and `audience` (who sees it, W-313, W-329).\n- Objects are strict: unknown keys are rejected, not ignored.\n- **Unknown element types** (W-022 / R-033): a node whose `type` is not in the known set is kept on save (`id` rules still apply; `props` is an open record; every shared node field, including `devices` and `hiddenOn`, is allowed and checked as on known nodes; optional `children` are validated recursively). Public pages omit it; the editor shows a selectable placeholder. Damaged known nodes (wrong props) still fail validation with path-specific issues.\n\n\n| Type | `props` | Children | Renders as |\n| --- | --- | --- | --- |\n| `container` | optional `tag` (`div`, `section`, `header`, `footer`, `main`, `article`, `aside`, `nav`), optional `href` and `newTab` (the box is the link; a link inside a link is dropped) | `children: Node[]` (required, may be empty) | that tag (default `div`) with `class=\"emvb-container …\"` |\n| `layout-section` (shown as \"Section\", W-156) | optional `tag` (as `container`, default `section`), `contentWidth` length, `fullWidth` boolean | `children: Node[]` | that tag with `class=\"emvb-layout-section …\"`, wrapping `<div class=\"emvb-layout-section-inner\">` around the children; the inner box is at most `contentWidth` (default 1140 px, none with `fullWidth`) wide and centred |\n| `heading` | `text` (≤ 2000), `level` (1–6), optional `href` (≤ 2000) and `newTab` (W-141), optional `marks` (W-950, see below) | none | `<h1>`–`<h6>`; with a safe `href`, the text is wrapped in `<a class=\"emvb-heading-link\">` (colour and decoration inherited) |\n| `spacer` | `height` length | none | `<div aria-hidden=\"true\">` with height in CSS |\n| `divider` | `{}` | none | `<hr>` |\n| `text` | `text`, optional `tag` (`p` \\| `div`), optional `marks` (W-950) | none | `<p>` or `<div>`; formatted words as below |\n| `label` | `text` | none | `<span>` |\n| `link` | `text`, `href`, optional `newTab` | none | `<a href>` (+ `target`/`rel` when `newTab`) |\n| `button` | `text`, optional `href` and `newTab` | none | `<a href>` when `href` is safe, else `<button type=\"button\">` |\n| `list` | `items` (string[], ≤ 200), optional `ordered`; W-952: optional `marker` (`disc`, `circle`, `square`, `decimal`, `decimal-leading-zero`, `lower-alpha`, `upper-alpha`, `lower-roman`, `upper-roman`, `steps`, `none`; a number style or `steps` makes it numbered) and `start` (1–9999, numbered only) | none | `<ul>` or `<ol>` (with `start`) with `<li>`; the marker is `list-style-type`, `steps` adds `emvb-list--steps` (numbers in circles, CSS sent only when used) |\n| `image` | `src`, `alt`, optional `decorative`, `width`, `height`, `mediaId`, `edit` (editor-only image-editor record, never rendered; see below) | none | `<img loading=\"lazy\">` (decorative → empty `alt` + `role=\"presentation\"`) |\n| `icon` | `iconId` (a bundled Lucide id, or `<set prefix>:<name>` from the icon library, W-236), optional `iconSvg` (the picked icon's SVG, ≤ 32768 chars, W-234 / W-239; `iconId` `upload:<id>` for an uploaded SVG), optional `singleColor` (W-238: `true` paints a picked SVG's own fills, strokes and stops in `currentColor`), `size`, `decorative`, `title`, `href` (≤ 2000) and `newTab` (W-141); a non-empty `href` needs a `title` | none | Inline `<svg>`: `iconSvg` sanitized again at render (allowlist; size, id, role and aria attributes replaced), else the bundled Lucide icon (unknown id and no `iconSvg` → placeholder; never a remote URL); with a safe `href`, the svg is hidden inside `<a class=\"emvb-icon-link\" aria-label=\"title\">` |\n| `video` | `url`, `title`, optional `mediaId` | none | YouTube/Vimeo privacy `<iframe loading=\"lazy\">` or media `<video controls>` (no autoplay) |\n| `form` | `formId` (forms-plugin id; may be empty until bound) | `children: Node[]` (form fields + submit; no nested forms) | Bound: `<form class=\"emvb-form ec-form\" …>`. Unbound: editor placeholder `data-emvb-form-unbound`; omitted on public (no forms runtime). |\n| `text-input` | `field`, optional `label`, `placeholder` | none | labelled `<input class=\"ec-form-input\">` + `data-error-for` |\n| `textarea` | `field`, optional `label`, `placeholder` | none | labelled `<textarea class=\"ec-form-input\">` + `data-error-for` |\n| `select` | `field`, optional `label`, `placeholder` (words the empty first choice; unset is \"Choose…\", W-686) | none | labelled `<select>` (options from the public form definition when available) |\n| `checkbox` | `field`, optional `label` | none | labelled `<input type=\"checkbox\" value=\"true\">` |\n| `radio` | `field`, optional `label`, `placeholder` | none | `<fieldset>` of radios (options from definition when available) |\n| `submit` | optional `label` | none | `<button type=\"submit\" class=\"ec-form-submit\">` |\n| `post-title` | optional `level` (1–6) | none | Dynamic heading from `ThemeDynamicData.post` |\n| `post-excerpt` | optional `maxWords` (whole number, 1–10000, W-177) | none | Dynamic excerpt paragraph; with `maxWords`, cut to that many words with \"…\" |\n| `post-content` | (none) | none | Dynamic body (Portable Text → safe blocks) |\n| `post-image` | optional `decorative` | none | Dynamic featured image when URL present |\n| `post-link` | optional `text`, `newTab` | none | Dynamic permalink; blank text → title |\n| `post-date` | optional `format`: `medium` (default), `short`, `long`, `full` or `numeric` (W-177) | none | `<time datetime>` with the published date in UTC; `numeric` is YYYY-MM-DD |\n| `post-author` | (none) | none | The author's name |\n| `pagination` | optional `prevText`, `nextText`, `showCount` and `countText` (`{page}` and `{total}`; unset text is \"Page {page} of {total}\"), `titleText` (the paged archive title, `{title}` and `{page}`, W-529), `archiveTitle` (replaces \"Posts\" as the posts archive title, ≤ 60, W-532), and screen reader names `navLabel` (\"Pagination\"), `pageLabel` (\"Page {page}\"), `prevLabel` and `nextLabel` (\"Previous page\" / \"Next page\", used when the text is only an arrow), each ≤ 60 (W-689) | none | `nav` of Previous, page numbers and Next. Nothing on a single page, with no archive data, or inside a Loop item |\n| `loop` | optional `partId` (the item part; `itemPartId` before schema 18); `perPage` (1–50, unset = 20) on an archive; a collection Loop also takes `collection`, `limit`, `order`, `display`, `columns`, `permalink`, `imageField`, `excerptField` and `filter` (see [Schema 13](#schema-13-the-w-307-feature-batch) and [Schema 14](#schema-14)) | `children: Node[]` (inline item template when no part id) | Repeats the item template for each post or collection entry |\n| `grid` | `columns` (1–12); optional `columnsTablet` and `columnsMobile` (1–12, W-139); optional `columnTracks`, `columnTracksTablet`, `columnTracksMobile` (1–12 tracks: `1fr`, `2fr`, `3fr`, `auto`, `min-content`, `max-content`, or a length) | `children: Node[]` | `display: grid` with that many equal columns, or the custom tracks when that device sets them; the device values go in the tablet and mobile media queries, and an unset one follows the next wider device |\n| `part-ref` (shown as \"Theme section\"; `section` before schema 18) | optional `partId` | `children: Node[]` (inline contents when no part id) | When `partId` is set, the published Section theme part's children replace the local ones |\n\nAn image's optional `edit` (W-481, D-061) is written by the image editor and never rendered. `src`, `mediaId`, `width` and `height` point at the edited file; `edit` points back at the original: `v` (`1`), `engine` (`\"photocn\"`), `engineVersion` (such as `\"0.1.2\"`), `recipe` (photocn's `RecipeV1`, strict: sliders −1 to 1, blur and curve points 0 to 1, at most 32 points per curve channel, straighten ±45°, a filter name of up to 32 letters, digits, spaces, `_` or `-`, a blend image only as a site path or `https:` URL, at most 16 KB as JSON), optional `originalMediaId`, `originalSrc` (up to 2000 characters), `output` (`format` `webp`, `jpeg` or `png`, optional `quality` 0.1 to 1, optional `maxSide` 16 to 10000 px, `stripGps` boolean) and `editedAt` (an ISO 8601 timestamp).\n\nEvery node may also carry an optional `editorLabel` (`label` before schema 18; 1–80 characters, trimmed; an editor-only name shown in Layers and on the canvas, never rendered, W-157), optional `htmlId` (CSS `id`, unique on the page; since 1.1.2 an id that names a browser global such as `location` or `document` is kept in the layout but not rendered, S-12), `classes` (style-class ids from the design system, S4), `devices` and `hiddenOn` (W-096, below).\n\n**Forms (S5):** form fields are only valid inside a `form` (or under one). Pages with a form set `needsFormsRuntime`; the host route loads `EmVBFormsRuntime` so `initForms` handles AJAX submit. Pages without a form stay zero EmVB JS (R-031).\n\n### Style properties (W-017, extended in W-088)\n\n**Text marks (W-950).** `marks` on a Heading or Text is up to 100 ranges `{ \"start\", \"end\", \"bold\"?: true, \"italic\"?: true, \"color\"?: colour, \"href\"?, \"newTab\"?: true }` over its `text` (characters `start` to `end`, end not included, 0–2000). They render as `<strong>`, `<em>`, `<span class=\"emvb-mark-c<n>\">` (the colour as `--emvb-mark-<n>` on the element, up to 8 per element; `.emvb-mark-c<n>{color:var(--emvb-mark-<n>)}` is sent only when a page uses one) and `<a class=\"emvb-mark-link\">` (checked like any link; left out inside a linked heading). Ranges past the text are clipped when drawn, so editing the text never invalidates a page; the editor moves them with the words.\n\nLengths are `{ \"value\": 0–10000, \"unit\": \"px\" | \"rem\" | \"em\" | \"%\" | \"vw\" | \"vh\" | \"ch\" }` (`vw` and `vh` since W-088, `ch` since W-331). Colours are hex or `{ \"var\": \"<id>\" }`. A **size** is a length, a variable reference or `\"auto\"`. An **offset** is a size whose value may also be negative (−10000 to 10000). A **fluid size** (W-955) is `{ \"fluid\": { \"min\": 0–10000, \"max\": 0–10000 } }` in px: written as `clamp()` growing from `min` on 360 px wide screens to `max` on 1280 px ones (the formula the design's fluid sizes use); `fontSize`, `gap`, the width and height keys, padding and margins (and the offsets) take one.\n\n| Key | Value | CSS |\n| --- | --- | --- |\n| `flexDirection` | `row`, `column`, `row-reverse`, `column-reverse` | `flex-direction` |\n| `flexWrap` | `nowrap`, `wrap`, `wrap-reverse` | `flex-wrap` |\n| `justifyContent` | `flex-start`, `flex-end`, `center`, `space-between`, `space-around`, `space-evenly` | `justify-content` |\n| `alignItems` | `stretch`, `flex-start`, `flex-end`, `center`, `baseline` | `align-items` |\n| `gap` | length | `gap` |\n| `gridColumnSpan` / `gridRowSpan` (W-099) | whole number 1–12 | `grid-column` / `grid-row` as `span N` |\n| `gridColumnStart` / `gridRowStart` | whole number 1–13 | `grid-column` / `grid-row` as the line number, or `start / span N` when a span is set too |\n| `width` / `height` | size | `width` / `height` |\n| `minWidth` / `maxWidth` / `minHeight` / `maxHeight` | length | matching size properties (`maxHeight` since W-088) |\n| `flexGrow`, `flexShrink` (W-954) | number 0–100 | `flex-grow`, `flex-shrink`: a Flexbox or Container child's share of free space, and of the shortfall |\n| `flexBasis` (W-954) | length or `auto` | `flex-basis`: the child's starting size along the row or column |\n| `alignSelf` (W-954) | `auto`, `stretch`, `flex-start`, `flex-end`, `center`, `baseline` | `align-self`: the child's own cross-axis alignment (`auto` follows the parent's Align) |\n| `order` (W-954) | whole number −99 to 99 | `order`: the child's place among its siblings (lower first) |\n| `overflow` | `visible`, `hidden`, `clip`, `scroll`, `auto` | `overflow` |\n| `overflowX`, `overflowY` (W-957) | same as `overflow` | `overflow-x`, `overflow-y`, after `overflow` so one axis wins |\n| `aspectRatio` | `\"auto\"` or `\"w/h\"` with whole numbers 1–9999, such as `\"16/9\"` | `aspect-ratio` (`16 / 9`) |\n| `objectFit` | `fill`, `contain`, `cover`, `none`, `scale-down` | `object-fit` (the editor offers it on Image and Video) |\n| `objectPosition` (W-957) | `center`, `top`, `bottom`, `left`, `right`, `top left`, `top right`, `bottom left`, `bottom right` | `object-position` (Image and Video) |\n| `paddingTop` / `Right` / `Bottom` / `Left` | length | `padding-*` |\n| `marginTop` / `Right` / `Bottom` / `Left` | offset (negative since W-331) | `margin-*` |\n| `position` | `static`, `relative`, `absolute`, `fixed`, `sticky` | `position` |\n| `top` / `right` / `bottom` / `left` | offset | matching inset properties |\n| `zIndex` | whole number −9999 to 9999 | `z-index` |\n| `fontFamily` | a font stack (1–200, checked as safe) or a font variable | `font-family` |\n| `fontSize` | length | `font-size` |\n| `lineHeight` | length, or a unitless number 0–100 | `line-height` |\n| `letterSpacing` | length whose value may be negative (−10000 to 10000) | `letter-spacing` |\n| `fontWeight` | `100`–`900` in steps of 100, `normal`, `bold` | `font-weight` |\n| `textAlign` | `left`, `center`, `right`, `justify` | `text-align` |\n| `textTransform` | `none`, `uppercase`, `lowercase`, `capitalize` | `text-transform` |\n| `textDecoration` | `none`, `underline`, `overline`, `line-through` | `text-decoration` (W-113; a button sets `none` in its base CSS) |\n| `markerColor`, `markerSize` (W-952, Lists) | colour; length | `--emvb-marker-color`, `--emvb-marker-size`, read by the marker and step rules (sent only when a page sets them) |\n| `fontStyle` (W-957) | `normal`, `italic` | `font-style` |\n| `whiteSpace` (W-957) | `normal`, `nowrap`, `pre-line`, `pre-wrap` | `white-space` (a Text element defaults to `pre-line`) |\n| `overflowWrap` (W-957) | `normal`, `break-word`, `anywhere` | `overflow-wrap` |\n| `color` / `backgroundColor` / `borderColor` | colour | matching colour properties |\n| `backgroundImage` (W-094) | http(s) URL or a site path, no spaces, quotes or parentheses | `background-image` as `url(\"…\")`. With no size, position or repeat: `cover`, `center`, `no-repeat` |\n| `backgroundVideo` | the same URL rule as `backgroundImage` | a muted, looping `<video>` behind the content |\n| `backgroundSize` | `auto`, `cover`, `contain` | `background-size` (the image layer) |\n| `backgroundPosition` | `center`, an edge (`top`, `bottom`, `left`, `right`) or a corner (`top left` and the other three) | `background-position` |\n| `backgroundRepeat` | `no-repeat`, `repeat`, `repeat-x`, `repeat-y` | `background-repeat` |\n| `gradient` | `{ type, angle?, position?, stops }`: `type` `linear`, `radial` or `conic`; `angle` whole degrees 0–360 (the linear direction, default 180, or the conic start, default 0); `position` (the radial centre, default `center`) takes the `backgroundPosition` values; `stops` are 2–10 `{ color, at }`, `color` a colour and `at` a whole % 0–100 | `linear-gradient`, `radial-gradient` (a circle) or `conic-gradient`, stops in `at` order, behind the image |\n| `overlay` | `{ color, opacity: 0–1 }`, or since W-949 `{ gradient, opacity?: 0–1 }` with the same `gradient` shape | a colour or gradient layer above the image (a scrim). Hex becomes 8-digit hex; a colour variable becomes `color-mix`; a gradient overlay's `opacity` (unset = 1) fades every stop |\n| `borderWidth` / `borderRadius` | length | matching border properties: every side or corner |\n| `borderTopWidth`, `borderRightWidth`, `borderBottomWidth`, `borderLeftWidth` (W-138) | length | `border-top-width`, `border-inline-end-width`, `border-bottom-width`, `border-inline-start-width`, after `border-width`, so a side beats it |\n| `borderTopLeftRadius`, `borderTopRightRadius`, `borderBottomRightRadius`, `borderBottomLeftRadius` (W-138) | length or a spacing variable | `border-start-start-radius`, `border-start-end-radius`, `border-end-end-radius`, `border-end-start-radius`, after `border-radius` |\n| `borderStyle` | `none`, `solid`, `dashed`, `dotted` | `border-style` |\n| `opacity` | number 0–1 (the editor shows 0–100 %) | `opacity` |\n| `boxShadow` | `{ x, y, blur, spread, color?, inset? }`: px numbers, `x`, `y` and `spread` −1000 to 1000, `blur` 0 to 1000; `color` is a colour; `inset` is a boolean | `box-shadow` as `[inset] Xpx Ypx Bpx Spx [colour]`; no colour means the text colour |\n| `filter` | `{ blur?, brightness?, contrast?, saturate?, grayscale?, hueRotate? }`, at least one set: `blur` 0–100 px, `brightness` / `contrast` / `saturate` 0–300 %, `grayscale` 0–100 %, `hueRotate` 0–360° | `filter`, functions always in that order, such as `blur(2px) grayscale(100%)` |\n| `backdropFilter` (W-957) | the same object as `filter` | `backdrop-filter`, applied to what is behind the element (frosted glass) |\n| `transform` (W-953) | `{ x?, y?, scale?, rotate? }`, at least one: `x` and `y` whole px −2000 to 2000, `scale` whole % 10–400, `rotate` whole degrees −360 to 360 | `translate`, `scale` and `rotate` (CSS's own properties, so an entrance never cancels it; a scroll motion or loop on the same property wins while it runs). In a hover state it is a lift; animate it with a `transform` transition |\n| `cursor` | `default`, `pointer`, `text`, `move`, `grab`, `not-allowed`, `help`, `crosshair`, `zoom-in` | `cursor` |\n| `motion.transition` (W-089, Normal only) | `{ duration, delay?, easing, property }`: `duration` and `delay` whole ms 0–2000; `easing` `ease`, `ease-in`, `ease-out`, `ease-in-out`, `linear`; `property` `all`, `colors`, `opacity`, `shadow`, `filter`, `transform` (W-953). No other keys | `transition`, one entry per CSS property: `colors` is `color`, `background-color` and `border-color`; `shadow` is `box-shadow`; `transform` is `translate`, `scale` and `rotate`. For example `opacity 200ms ease-out 50ms` |\n| `motion.entrance` (W-101, Normal only) | `{ type, duration, delay?, trigger? }`: `type` is `fade`, `fade-up`, `fade-down`, `slide-up`, `slide-down` or `scale`; `duration` and `delay` whole ms 0–2000; `trigger` is `load` (default) or `view` (as it scrolls in; browsers without scroll-driven animations play it on load) | `animation` named `emvb-<type>`, once, `ease-out`, `both`. Reduced motion sets `animation: none` |\n| `motion.loop` (W-938, Normal only; 1.0) | `{ effects, duration, easing?, alternate?, loop? }` or `{ type: \"none\" }`. `effects` as `motion.scroll`; `duration` 200–20000 ms; `easing` a transition easing (default `ease-in-out`); `alternate` false plays one way; `loop: true` never stops | A time-based CSS animation; stops after about 5 s unless `loop`; off for reduced motion. The accessibility check flags Loop forever and runs over 5 s |\n| `motion.scroll` (W-319, Normal only; `scrollMotion` before schema 18) | `{ effects, range }` or `{ type: \"none\" }`. Each effect is `{ type, from, to }`: `type` is `fade`, `move-x`, `move-y`, `scale`, `rotate` or `blur` (one of each). `range` is `enter`, `cross`, `exit` or `page`. `none` stops motion a wider device set | CSS scroll-driven animations. Reduced motion, and browsers without them, show the element still |\n| `iconRotate` (W-237, icons) | whole degrees −360 to 360 | `--emvb-icon-rotate`, read by the icon's `svg` as `rotate` |\n| `iconFlip` (W-237, icons) | `none`, `horizontal`, `vertical`, `both` | `--emvb-icon-flip` (`1 1`, `-1 1`, `1 -1`, `-1 -1`), read by the `svg` as `scale` |\n| `iconScale` (W-237) | number 0.1–4 | `scale` on the element (the icon and its background shape) |\n| `iconStrokeWidth` (W-237, outline icons) | number 0.25–6 | `--emvb-icon-stroke`; applies when the stored SVG's root has a stroke width of 1, 1.5, 2, 2.5 or 3 (render moves it into an `emvb-icon-sw<w>` class) |\n| `iconShadow` (W-237, icons) | `{ x, y, blur, color? }`: px, `x` and `y` −100 to 100, `blur` 0–100 | `--emvb-icon-shadow` as `drop-shadow(Xpx Ypx Bpx [colour])`, read by the `svg` as `filter` (follows the outline) |\n| `motion.icon` (W-237, Normal only; `iconAnimation` before schema 18) | `{ type, duration }`: `type` `spin` or `pulse`; `duration` whole ms 200–10000; optional `loop: true` (W-853, D-059) keeps it running forever. Or `{ type: \"none\" }` (W-248), which stops an animation a device inherits from a wider one | `--emvb-icon-animation` (`emvb-icon-spin <ms> linear <runs>`, `emvb-icon-pulse <ms> ease-in-out <runs> alternate` or `none`; W-848: `<runs>` is as many whole runs as fit in 5 s, at least one, even for a pulse; with `loop: true` it is `infinite`); the icon base CSS turns it off under `prefers-reduced-motion: reduce` |\n\n**W-088 additions are additive.** Every new key and unit is optional and every earlier value keeps its meaning, so stored pages and classes are valid unchanged. The version moved to 2 (D-031) with a v1 → v2 step that changes nothing, so an older EmVB shows \"saved by a newer EmVB\" rather than an invalid-layout error. The keys are the same on `node.style` and on `design.classes[].style`. The generator builds each value from typed numbers and keywords only and runs the same `isSafeCssValue` gate as every other property; anything else is dropped with a `rejected-style` warning. A shadow colour bound to a colour variable counts as a use of that variable, and deleting the variable clears it from the page layout and from class styles.\n\n### State styles (W-089)\n\n`node.states` and `design.classes[].states` are `{ \"hover\"?, \"focus\"?, \"active\"? }`. Each state is a style object with the same keys, limits and variable references as `style`, except `motion` (transition, entrance, scroll and icon motion), which belongs to Normal only. Any other state name is refused. Adding `states` moved the version to 3 (D-032) with a v2 → v3 step that changes nothing.\n\n```json\n{\n \"id\": \"btn00001\",\n \"type\": \"button\",\n \"props\": { \"text\": \"Go\" },\n \"style\": { \"backgroundColor\": \"#1d4ed8\", \"motion\": { \"transition\": { \"duration\": 200, \"easing\": \"ease-out\", \"property\": \"colors\" } } },\n \"states\": { \"hover\": { \"backgroundColor\": \"#1e3a8a\" }, \"focus\": { \"borderColor\": \"#f59e0b\" } }\n}\n```\n\n- **Selectors.** `hover` is `:hover`, `focus` is `:focus-visible` (keyboard focus, so a mouse click leaves no focus style); a linked Heading or Icon also matches when its inner link has keyboard focus (`:has(> :is(.emvb-heading-link,.emvb-icon-link):focus-visible)`, W-242) and `active` is `:active`.\n- **Cascade.** Each selector's base rule is followed by its `:hover`, `:focus-visible` and `:active` rules, classes first and then the local rule. So a state rule beats every Normal rule (a class's Hover colour shows over a local Normal colour), within one state the local rule beats the class, and Active beats Focus, which beats Hover.\n- **Safety.** State values go through the same mappers and `isSafeCssValue` gate as `style`. A rejected value is dropped with a `rejected-style` warning naming `<state>.<key>` (such as `hover.color`); a `motion` inside a state is refused by validation and dropped by the renderer and reported the same way, and so is an unknown state name. An unknown variable in a state is reported like one in `style`. An element whose only styles are states still gets `emvb-e-<id>`.\n- **Reduced motion.** When any rule has a `transition`, the CSS ends with one `@media (prefers-reduced-motion: reduce){…{transition:none}}` block that lists exactly those selectors. Nothing else changes under reduced motion.\n- **Editor preview.** The canvas CSS repeats every state rule for `[data-emvb-state=\"hover\"|\"focus\"|\"active\"]`, and the editor sets that attribute on the selected element while a state is chosen in the Style tab. Public CSS has neither the attribute nor those selectors.\n\n### Per-device styles (W-096)\n\n`node.devices` and `design.classes[].devices` are `{ \"laptop\"?, \"tablet\"?, \"mobile\"? }` (`laptop` since W-956). Each is a style object with the same keys as `style`. Only keys that differ from the wider devices are stored. `node.hiddenOn` and `design.classes[].hiddenOn` are arrays of `\"desktop\"`, `\"laptop\"`, `\"tablet\"` and `\"mobile\"` (at most one of each). Desktop itself stays in `style`.\n\n- **Queries.** Laptop is `@media (max-width: 1366.98px)`, then tablet `@media (max-width: 1024.98px)`, then mobile `@media (max-width: 767.98px)`. A narrower screen matches every wider query, so the narrowest device wins on a shared key, and a laptop-only key still applies on tablets and phones. The tablet and mobile bounds match `deviceForWidth` (under 768 mobile, under 1025 tablet), which popup targeting and visitor rules use (a laptop is desktop there).\n- **Hide.** Each device has its own query, so `display: none` does not leak: desktop `(min-width: 1367px)`, laptop `(min-width: 1025px) and (max-width: 1366.98px)`, tablet `(min-width: 768px) and (max-width: 1024.98px)`, mobile `(max-width: 767.98px)`. An element hidden on both Desktop and Laptop gets the one rule `(min-width: 1025px)`. Before W-956, `\"desktop\"` meant every screen from 1025 px; schema 17 pages are upgraded to `[\"desktop\", \"laptop\", …]` on read, so they render byte for byte as before.\n- **Grids.** Column counts have no laptop value: laptops use the desktop columns. The `.98` keeps fractional widths from zoom or display scaling (1024.5, say) inside one device, so nothing slips between two hide queries (W-506).\n- **Wide screen (W-959, 1.1).** An own `style.wide` record holds the values for 2400 px and up, in `@media (min-width: 2400px)`, built on Desktop's (the narrower devices never overlap it). `style.wide.hidden` overrides the Desktop hide there: `true` adds `(min-width: 2400px)` for an element not hidden on Desktop; `false` on an element hidden on Desktop stops its Desktop rule at `2399.98px`. Without `hidden`, Wide screen follows Desktop and the CSS is what it was. The renderer reads it as one more device (`renderableNode` moves it to `devices.wide` and `wideHidden`). Grid column counts have no Wide screen value.\n- **States.** Hover, focus and active stay all-viewport. Device overrides edit Normal only.\n- **Version.** Adding these fields moved the version to 5 (D-036) with a v4 → v5 step that changes nothing.\n\n## Design system document\n\n```json\n{\n \"schemaVersion\": 17,\n \"variables\": {\n \"colors\": [{ \"id\": \"brand\", \"name\": \"Brand\", \"value\": \"#0055ff\" }],\n \"fonts\": [{ \"id\": \"body\", \"name\": \"Body\", \"value\": \"Noto Sans, sans-serif\" }],\n \"fontSizes\": [{ \"id\": \"lg\", \"name\": \"Large\", \"value\": { \"value\": 24, \"unit\": \"px\" } }],\n \"spacings\": [{ \"id\": \"md\", \"name\": \"Medium\", \"value\": { \"value\": 16, \"unit\": \"px\" } }]\n },\n \"classes\": [{ \"id\": \"card\", \"name\": \"Card\", \"style\": { \"paddingTop\": { \"value\": 16, \"unit\": \"px\" } } }]\n}\n```\n\n- Colour ids are 1–40 of `a-z 0-9 -`, names 1–60 characters, values hex as above. At most 200 colours.\n- The document is at most 256 KiB (`MAX_DESIGN_BYTES`).\n- A font size or spacing variable may set `fluid: { min, max }` (px, 0–1000). It is emitted as `clamp()` between `fluidRange` (unset is 360 to 1280 px; `minWidth` must be less than `maxWidth`). `value` stays the fixed fallback (W-316).\n- `direction` is `ltr`, `rtl` or `auto` (unset is left to right). It is `dir` on every EmVB root, and hosts get it back for `<html dir>` (W-230).\n- `defaults` is a starting style per tag (`h1`–`h6`, `p`, `a`, `button`), emitted under `:where(.emvb-root)` so a class still wins.\n\n## Limits and validation\n\n`validateLayout()` runs on every save (the plugin's `beforeSave` hook) and on every read (editor and public render), in this order:\n\n1. **Size:** the JSON is at most 512 KiB (`MAX_LAYOUT_BYTES`) in UTF-8 bytes.\n2. **Version:** `upgradeLayout()` runs the migration chain up to the current version. A document from a newer EmVB is refused with \"Update EmVB to edit it\", never downgraded.\n3. **Structure:** at most 2000 nodes (`MAX_NODES`) and 24 levels (`MAX_DEPTH`), checked iteratively before parsing.\n4. **Schema:** the Zod schema above.\n5. **Ids:** every node id is unique.\n\nIssues carry a path such as `root.children[0].props.level`, which the editor uses to select the element at fault. A layout that fails on read renders nothing on the public page and logs only the page id (R-033).\n\n## Rendered output\n\n- The root gets `emvb-root`, each node `emvb-<type>` and, when its style, a state, a device override or a hide flag yields a rule, `emvb-e-<id>`. Invalid style values are dropped with a render warning. A reference to an unknown variable is kept and also reported as a warning. Unknown element types render nothing publicly and a placeholder with `data-emvb-id` in the editor (warning `unknown-type`). An unknown node still keeps `dir`, `container` and `query` (W-352), so a later version that understands the type still has them.\n- The CSS is, in order: variables on `.emvb-root` (`--emvb-c-*` colours, `--emvb-f-*` fonts, `--emvb-fs-*` font sizes, `--emvb-s-*` spacings), base CSS for the element types in use, then class rules (W-030), then one `.emvb-e-<id>{…}` rule per styled node (R-021). Each class and local rule is followed by its state rules, then the tablet media query, the mobile media query and the hide queries (see [Per-device styles](#per-device-styles-w-096)). A reduced-motion block closes the CSS when a transition is set (see [State styles](#state-styles-w-089)).\n- **Style classes** (`design.classes[]`): `{ id, name, style, states?, devices?, hiddenOn? }`. Elements list ids in `node.classes`; HTML gets `emvb-k-<id>` in that order. When two classes set the same property, the one later in `design.classes` wins, because its rule comes later in the stylesheet. Local `.emvb-e-<id>` rules come after every class, so local styles win. `classStylesInListOrder` feeds `resolveCascade` in that list order.\n- Length/font style props may use `{ \"var\": \"<id>\", \"from\": \"spacing\"|\"fontSize\"|\"font\" }` (colours keep `{ \"var\": \"<id>\" }`). Offsets (`top`, `right`, `bottom`, `left`) take spacing variables; the shadow colour takes a colour variable.\n- Text and attributes are escaped by the serializer. Public output has no scripts and no editor `data-emvb-*` attributes (such as `data-emvb-id`). The only `data-emvb-*` attributes it carries are these public hooks (`PUBLIC_DATA_ATTRIBUTES` in `core/public-attributes.ts`, kept in step with this list by a test): `data-emvb-theme-part` on a theme part's wrapper ([theme-parts.md](theme-parts.md#public-render)); `data-emvb-loop-item` (the post id) on each Loop item; `data-emvb-popup`, `data-emvb-popup-config` and `data-emvb-popup-dismiss` on popup chrome; `data-emvb-float`, `data-emvb-float-dismiss` and `data-emvb-float-edge` on float chrome. The popup, float and menu runtimes may add their own state attributes after load (`data-emvb-menu-dismissed`).\n\n## Changing the format\n\n- Add a migration `LAYOUT_MIGRATIONS[n]` (pure, version n to n + 1) and bump `LAYOUT_SCHEMA_VERSION` in the same change.\n- Add fixtures and tests for the old and new shapes, and update this file.\n- `test/docs/layout-format.test.ts` checks this file's title, the \"literal `N`\" sentence and the JSON examples against the code, so a schema bump must update them.\n\n## S8 additive elements (W-072–W-074)\n\n- **`div-block`**: block container (`display:block`); children like Container. Optional `href` and `newTab`, like Container.\n- **`flexbox`**: flex container defaulting to row + wrap + gap (Container stays column). Optional `href` and `newTab`.\n- **`svg`**: `props.markup` (sanitized allowlist; no scripts/handlers/`use`/`foreignObject`); optional `title`, `decorative`, `size`. A valid non-square `viewBox` keeps its ratio: the longer side is `size` (48 when unset) and the other side scales. A square, missing, or unreadable `viewBox` stays a square of `size`.\n- **`tabs` / `tab-panel`**: Tabs hold only tab-panels. Public markup is CSS-only (radio + `:has()`); the optional tabs script only takes the hidden radios out of the tab order.\n- **`accordion` / `accordion-item`**: items are `<details>`. An item needs `summary` (1–200) and may start `open`. No script.\n- **`menu` / `menu-item`**: a `nav` (named by `label`, default \"Menu\") of links. `direction` is `row` or `column`. An item with children is a dropdown; `wide` stretches that panel across the menu. A menu with a dropdown can load the optional menu script so Escape closes it. An empty menu is a plain box, not a `nav`.\n- **`grid`** also takes optional `href` and `newTab`.\n\n\n## Schema 13: the W-307 feature batch\n\nSchema 13 only adds optional fields, so a v12 document upgrades unchanged.\n\n### Collection Loops (W-308)\n\nA `loop` with `props.collection` (a collection slug) lists that collection's published entries\ninstead of the archive's posts. `limit` (1–50, default 6), `order` (`newest`, `oldest`, `title`),\n`display` (`list`, `grid`, `cards`) and `columns` (1–6) are optional. Hosts fill\n`dynamic.collections[loopId]` (see `collectCollectionLoops`). A `loop-empty` child is left out of\nthe item design and rendered when there are no entries; it is only valid inside a `loop`.\n\n### Data bindings (W-307)\n\nAny node may carry `bind`: prop name → `{ source, key }`. `source` is `post` (a post field such as\n`title`, or any plain field of the entry by name, for example `role`), `site` (a site setting:\n`title`, `tagline`, `url`, `social.github`…) or `param` (a URL parameter). Which props can be bound\nis fixed per element (`BINDABLE_FIELDS`: text, links, image source and alt). The typed prop stays as\nthe fallback when the source has no value. Bound values are plain text, capped at 500 characters,\nand go through the element's own escaping and link and image URL checks.\n\nA link or image bound to `param` only takes same-site URLs: relative ones, or absolute ones on the\npage's origin (hosts pass it as `dynamic.origin`). Anything else shows the typed value, unless the\nbinding sets `outside: true` (\"Allow outside sites\" in the editor). Anyone can craft a URL\nparameter, so that option lets them point the page's links and images at any site.\n\n### A/B tests and visitors (W-312, W-313, W-329)\n\nAny node may set `variant`: `{ test, arm, split? }`. `test` is a name of lowercase letters, digits and `-` (up to 32). `arm` is `a` or `b`. `split` (on the B element, 1–99, unset = 50) is the share of visitors who see B. The host picks one arm per visitor and keeps it in a cookie.\n\n`audience` shows or hides the element. Every field that is set must match, and `hide: true` flips that to \"everyone except\":\n\n- `countries`: two-letter codes, 1–50\n- `devices`: `mobile`, `tablet`, `desktop`\n- `visitor`: `new` or `returning`\n- `hours`: `{ from, to }` (0–23 and 0–24; wraps past midnight when `to` < `from`) and `days` (0 = Sunday), in `timeZone` (an IANA name; unset = UTC)\n- `segments` (W-329): 1–20 names the host passes (`member`, `pro`), lowercase letters, digits, `-` and `_`\n\nA rule the host cannot check does not match. Pages with a variant or an audience are sent `Cache-Control: private, no-store`.\n\n## Schema 14\n\nSchema 14 only adds optional fields, so a v13 document upgrades unchanged.\n\n- **Visitor segments (W-329).** `audience.segments`, above. Hosts pass them as `resolveEmVBPage(Astro, { visitor: { segments } })` and the same option on `resolveThemeParts`. `country`, `device` and `returning` on that object replace what EmVB detects.\n- **Loop fields (W-330).** On a collection Loop, `permalink` is a site path containing `{slug}` or `{id}` (unset is `/<collection>/{slug}`). `imageField` and `excerptField` name the entry fields Post Image and Post Excerpt read (unset is `featured_image` and `excerpt`). `filter` is up to five `field=value` pairs separated by `;`. A taxonomy name filters by term, and the same field twice matches either value.\n- **`ch` and negative margins (W-331).** Lengths may use `ch`. Margins may be negative (−10000 to 10000). Padding stays 0 or more.\n\n## Internal proposal records (W-928)\n\nProposals are review data in the plugin-storage collection `emvb_proposals`, not page\nrevisions. A row holds `{ proposal, createdAt }`, keyed by a server-generated 16-hex id.\nThe version-1 proposal is `{ version: 1, target: { collection, id }, baseRevision,\nbaseDesignRevision, ops }`. The plugin adapter currently reads the target entry's\n`layout` field (native visual pages and theme parts); arbitrary host canvas-field\nselection is not part of this transport. `baseRevision` is EmDash's current `_rev`.\n`baseDesignRevision` is the effective draft style revision, or the published style\nrevision when no draft exists, or null on an empty site. It is checked only when\nclass/variable ops are present, so page-only proposals survive unrelated style edits.\n\nOperations run in list order against frozen schema 18 ids and names:\n\n- `insert`: `{ kind, parentId, index, node }` — a complete stored node/subtree.\n- `move`: `{ kind, id, parentId, index }` — uses editor drop rules; index addresses\n the destination children **before** removal, as in `moveNode`.\n- `update`: `{ kind, id, set }` — editable node fields only. `props` shallow-merges;\n other fields replace their whole value, and null clears an optional node field.\n `id`, `type` and `children` cannot be patched. Use `editorLabel`, `props.partId`\n and `style.motion`, not their old aliases.\n- `delete`: `{ kind, id }` — never the root.\n- `class`: `{ kind, id, value }` — full class upsert, or null to remove an existing id.\n- `variable`: `{ kind, group, id, value }` — full variable upsert/removal;\n group is `colors`, `fonts`, `fontSizes` or `spacings`. Payload ids must match the\n operation id. Names must already be clean and unique in their list; no truncation.\n\n`applyProposal(base, proposal, selectedIndexes?)` returns a new `{ layout, design }`\nonly: it cannot save, publish, acquire an edit lock, or change review/undo state.\nSelected indexes refer to the original list; selection order cannot reorder ops.\nEach selected intermediate result passes stored-layout/design validation, nesting\nrules and the existing URL/SVG/CSS/font allowlists. Unknown layout keys still use\nthe frozen contract's keep-and-ignore rules. A dependency on an omitted operation,\na missing id, a bad node, a duplicate id, an invalid index or any other refusal\naborts the entire preview. Nothing is partially returned or persisted. W-930 must\nfeed accepted results through normal undo and draft saves, including the existing\nsite-wide guards for shared-style deletion; this store never writes site styles.\n\nCreation checks **all** ops and re-reads the base before storage. `STALE_BASE` reports\nexpected/current revisions and asks the caller to read the current document and\nsubmit a rebased proposal; there is no merge/retry/override. Preparation rechecks the\nlive revisions, so keeping or reading an old proposal does not make it applicable.\nGet/list are review reads, not an applicability guarantee; malformed rows are refused\nby get and omitted by list. Per-isolate serialization matches saved sections; there\nis no distributed content transaction (the final draft save still needs its own CAS).\n\nBudgets: 100 ops, 512 KiB JSON, 64 JSON nesting levels, and 100 stored proposals per\nsite; resulting layouts/designs retain all existing byte/node/depth limits. Cycles,\nnon-JSON values and prototype-manipulation keys are refused before parsing.\n\nPlugin-local editor transport mirrors saved sections: `proposals` (target-filtered\nlist), `proposals/get`, `proposals/create`, `proposals/withdraw`. Every route requires\n`content:edit_any` and EmDash's private-request/CSRF guard. These are not public/MCP\nAPIs; W-929 adds MCP tools and W-930 adds review UI later. Withdrawal only removes\nreview data; it cannot affect a page. No per-op review states or agent publish path\nare implemented here.\n\n## 1.2 widgets (W-1018–W-1025)\n\nAdded in 1.2, additive: new element types only, so an older 1.x keeps them on save and leaves them out of\nthe page (see Unknown element types above). Each renders without script.\n\n| Type | `props` | Children | Renders as |\n| --- | --- | --- | --- |\n| `rating` (shown as \"Star rating\", W-1023) | `value` (0–10, any decimal; shown to one decimal), optional `max` (whole number 1–10, unset 5; a `value` above it shows as `max`, so lowering it never makes a page invalid), `label` (≤ 120; `{value}` and `{max}` are filled in; unset \"Rated {value} out of {max}\"), `size` (8–128 px per star, unset 20) | none | `<div role=\"img\" aria-label=\"Rated 4.5 out of 5\">` with one `aria-hidden` star SVG per point, filled in the element's text colour; a part-filled star is the filled star cut by its `viewBox` over a 25 % star. Right to left, stars fill from the right |\n| `alert` (W-1025) | `variant` (`info`, `success`, `warning`, `danger`), optional `title` (≤ 200), `text` (≤ 2000; line breaks kept), optional `hideIcon`, `dismissible`, `dismissLabel` (≤ 80, unset \"Dismiss\") | none | `<div role=\"note\" class=\"emvb-alert emvb-alert-<variant>\">` in the variant's colours (text on background at least 7:1, overridable by the element's styles), its `aria-hidden` icon unless `hideIcon`, then the title and text paragraphs. `dismissible` adds `<button type=\"button\" data-emvb-alert-dismiss aria-label=\"Dismiss\">`, hidden by CSS until the opt-in alerts runtime marks it ready; that script hides the Alert on press and moves focus to the next focusable element. The page then lists `\"alerts\"` in `runtimes` |\n| `icon-box` (W-1020) | `iconId` and optional `iconSvg` (as on `icon`), `iconSize` (8–512 px, unset 48), `title` (≤ 200), optional `titleLevel` (2–6, unset 3), `text` (≤ 2000, line breaks kept), optional `position` (`top`, `left`, `right`; unset `top`), `href`, `newTab` | none | `<div class=\"emvb-icon-box emvb-media-box emvb-media-box-<position>\">` with the icon `aria-hidden` in `.emvb-media-box-media`, then `<hN class=\"emvb-media-box-title\">` and `<p class=\"emvb-media-box-text\">`. With a safe `href` the title is wrapped in `<a class=\"emvb-media-box-link\">`, whose `::after` covers the box, so the whole box is clickable through one named link. An empty title or text is left out |\n| `image-box` (W-1021) | the picture keys of `image`: `src`, `alt` (required unless `decorative`), optional `mediaId`, `width`, `height`, `focalX`, `focalY` (kept for the media library; a box doesn't crop); optional `imageSize` (`small` 25 %, `medium` 40 %, `large` 60 %, `full`; the picture's share of the width when beside the words, unset `medium`); and the title, text, position and link keys of `icon-box` | none | as `icon-box`, class `emvb-image-box` (plus `emvb-image-box-<size>` unless medium), with `<img loading=\"lazy\" decoding=\"async\">` and its `width`/`height` in `.emvb-media-box-media`; no media part without a safe `src` |\n| `testimonial` (W-1022) | `quote` (≤ 2000, line breaks kept), `name` (≤ 200), optional `role` (≤ 200), optional photo keys `src`, `alt` (written by the media library, not rendered), `mediaId`, `width`, `height`, `focalX`, `focalY`; optional `rating` (0–10) and `ratingMax` (1–10, unset 5) | none | `<figure class=\"emvb-testimonial\">`: the rating as in `rating` (`role=\"img\"`, \"Rated 5 out of 5\") when `rating` is set, `<blockquote class=\"emvb-testimonial-quote\"><p>`, then `<figcaption>` with the photo (48 px, round, `alt=\"\"`: the name is beside it) and the name and role |\n| `social-icons` (W-1024) | optional `label` (≤ 80, unset \"Social media\"), `shape` (`plain`, `circle`, `rounded`, `square`; unset `plain`), `brandColors` | `children`: Social links only, at most 20 | `<ul class=\"emvb-social-icons emvb-social-<shape>\" aria-label=\"Social media\">`; icons are one em, so the element's font size sizes them (1.5em by default). Badges draw the icon in white on the text colour, or on each network's colour with `brandColors` |\n| `social-link` (W-1024) | `network` (one of `facebook`, `instagram`, `x`, `linkedin`, `youtube`, `tiktok`, `bluesky`, `mastodon`, `threads`, `github`, `pinterest`, `whatsapp`, `discord`, `twitch`, `reddit`, `dribbble`, `behance`, `telegram`, `spotify`, `email`, `rss`, `website`), `href` (≤ 2000), optional `label` (≤ 80, the link's name; unset the network's name), `newTab` | none; only inside `social-icons` | `<li class=\"emvb-social-link emvb-social-<network>\"><a href aria-label=\"Instagram\">` around the preset's `aria-hidden` SVG (Font Awesome Free, CC BY 4.0, generated into `core/icons/social.generated.ts`). Without a safe `href` the icon shows dimmed in a `<span aria-hidden>` with no link |\n| `gallery` (W-1019) | optional `layout` (`grid` squares or `masonry`; unset `grid`), `columns` (1–6, unset 3; at most 2 up to 1024 px wide and 1 up to 767 px), `lightbox`, `label` (≤ 80) | `children`: Gallery images only, at most 60 | `<ul class=\"emvb-gallery emvb-gallery-<layout> emvb-gallery-cols-<n>\">`, named by `label`. `lightbox` adds `data-emvb-lightbox` and lists `\"lightbox\"` in `runtimes`: that script turns each picture into a \"View larger: <alt>\" button opening one native modal `<dialog>` with Previous/Next (and arrow keys), a spoken \"2 of 5\", Close and Escape; focus returns to the picture |\n| `gallery-image` (W-1019) | the picture keys of `image` (`src`, `alt` required unless `decorative`, `mediaId`, `width`, `height`, `focalX`, `focalY`) and optional `caption` (≤ 500) | none; only inside `gallery` | `<li class=\"emvb-gallery-image\"><figure>` with a lazy `<img>` and its `<figcaption>`; no picture without a safe `src` |\n| `carousel` (W-1018) | optional `label` (≤ 80, unset \"Carousel\"), `perView` (1–4, unset 1; at most 2 up to 1024 px, 1 up to 767 px), `arrows`, `dots`, `autoplay`, `interval` (3–30 seconds, unset 6), `loop` | `children`: Slides only, at most 20 | `<section aria-roledescription=\"carousel\" aria-label=\"Carousel\">` with a focusable `<div class=\"emvb-carousel-track\" tabindex=\"0\">` that scrolls and snaps to each slide with no script (`aria-live` polite, off while autoplaying). `arrows`, `dots` or `autoplay` add `data-emvb-*` options and list `\"carousel\"` in `runtimes`: that script adds Previous/Next (disabled at the ends unless `loop`), one \"Go to slide n\" button per view position (`aria-current`), and for autoplay a Pause/Play button before the slides; autoplay pauses while hovered or focused and starts paused under `prefers-reduced-motion` |\n| `carousel-slide` (W-1018) | optional `label` (≤ 80) | `children: Node[]`; only inside `carousel` | `<div role=\"group\" aria-roledescription=\"slide\" aria-label=\"2 of 5\">` (or its `label`) |\n\n**Widget runtimes (W-1025).** `renderPage` returns `runtimes`, the opt-in widget scripts the rendered\nelements asked for (sorted; empty for most pages). `renderStored` and `resolveThemeParts` set it only\nwhen it is not empty. `EmVBPage` mounts them itself; a site layout mounts its theme parts' with\n`<EmVBWidgetRuntimes names={theme.runtimes} />` from `@perkyzz/emvb/astro/widgets`. The HTML/CSS\nexport writes each one next to the pages that use it (`assets/emvb-alerts.js`, `assets/emvb-lightbox.js`, `assets/emvb-carousel.js`).\n\n## 1.3 marketing widgets (W-1038–W-1048)\n\nNew element types only (layout schema stays 18): a page that uses them can't be opened by EmVB\n1.2, which keeps them on save without showing them. Each renders without script; the opt-in\nscripts are listed in `runtimes`.\n\n| Type | `props` | Children | Renders as |\n| --- | --- | --- | --- |\n| `counter` (W-1038) | `value` (−10¹² to 10¹²), optional `start` (same range, unset 0), `decimals` (0–3, unset 0), `separator` (`,` `.` space or `'`; unset none; with `.` the decimal mark is `,`), `prefix` and `suffix` (≤ 20), `title` (≤ 200), `countUp`, `duration` (300–5000 ms, unset 2000) | none | `<div class=\"emvb-counter\">` with `<p class=\"emvb-counter-number\">` (prefix, `<span class=\"emvb-counter-value\">` holding the final number, suffix) and the title paragraph. `countUp` adds `data-emvb-counter`, `data-from`, `data-to`, `data-decimals`, `data-separator` and `data-duration` to the value and lists `\"counter\"` in `runtimes`; that script counts from `start` when the number scrolls into view, with a hidden copy of the final number for screen readers while it counts, and does nothing under reduced motion |\n| `progress` (shown as \"Progress bar\", W-1039) | `value` (0–10⁶), optional `max` (above 0, ≤ 10⁶, unset 100; a `value` above it shows as full), `label` (≤ 120), `showValue`, `kind` (`meter` or `progressbar`, unset `meter`), `thickness` (2–48 px, unset 8), `grow` | none | `<div class=\"emvb-progress\">` with an optional head (the label and, with `showValue`, an `aria-hidden` percentage), then `<div role=\"meter\" aria-label=\"…\" aria-valuemin=\"0\" aria-valuemax aria-valuenow aria-valuetext=\"75%\">` holding an `aria-hidden` SVG: a 20 % track and a fill `rect` as wide as the share, in the element's text colour, no inline styles. `grow` adds the `emvb-progress-grow` class, whose fill grows in with a CSS scroll-driven animation, only where supported and not under reduced motion. Right to left, it fills from the right |\n| `countdown` (W-1040) | `target` (`YYYY-MM-DDTHH:MM[:SS]` with `Z` or a `±HH:MM` offset, a real date), optional `title` (≤ 200), `label` (≤ 40, unset \"Ends\"), `ticking`, `hideSeconds`, `expired` (`text`, `hide` or `link`, unset `text`), `expiredText` (≤ 200, unset \"This offer has ended.\"), `expiredHref` (a link, sanitised like any) | none | `<div class=\"emvb-countdown\">` with the title and `<p>Ends <time datetime=\"…\">1 Dec 2026, 09:00 UTC−5</time></p>`, the date written in the target's own offset. `ticking` adds `data-emvb-countdown`, `data-target` and `data-expired`, a clock (`aria-hidden` days, hours, minutes and seconds, without seconds under `hideSeconds`) with a `Pause` button (`aria-pressed`), and the ended paragraph (a link with `link`, none with `hide`); CSS hides the clock until the opt-in countdown runtime marks it ready and the ended text until it is shown. The runtime ticks every second (no live region), stops on Pause, and at the target shows the ended text and hides the clock, or hides the Countdown. The page then lists `\"countdown\"` in `runtimes` |\n| `map` (W-1041) | `address` (1–300, line breaks kept), optional `provider` (`osm` or `google`, unset `osm`), `lat` (−90 to 90) and `lng` (−180 to 180), `zoom` (1–19, unset 15), `linkText` (≤ 80, unset \"Open in OpenStreetMap\" or \"Open in Google Maps\"), `embed`, `height` (150–800 px, unset 360) | none | `<div class=\"emvb-map\">` with the address paragraph and `<a class=\"emvb-map-link\" rel=\"noopener\">` to the place (a search for the address, or a marker at `lat`/`lng`). `embed` (with `lat`/`lng` for OpenStreetMap) adds `data-emvb-map` and a `.emvb-map-frame` holding `data-src`, `data-title` (\"Map of\" the address's first line) and `data-height`, a \"Show the map\" button and a note naming the service; CSS hides it until the opt-in map runtime marks the Map ready. Pressed, the runtime replaces it with a titled, lazy `<iframe>` (only `https://www.openstreetmap.org/export/embed.html?…` or `https://www.google.com/maps?…`) and moves focus to it, so the page requests nothing from the map service before that. Hosts with a Content Security Policy add `frame-src https://www.openstreetmap.org https://www.google.com`. The page then lists `\"map\"` in `runtimes` |\n| `price-table` (shown as \"Price table\", W-1042) | `title` (≤ 120), optional `titleLevel` (2–6, unset 3), `description` (≤ 500), `price` (≤ 20, text such as `29.99` or `Free`), optional `currency` (≤ 5), `period` (≤ 40), `regularPrice` (≤ 20), `features` and `excluded` (≤ 30 lines of ≤ 200 each), `buttonText` (≤ 80), `buttonHref` (a link, sanitised), `newTab`, `featured`, `ribbon` (≤ 30, unset \"Featured\") | none | `<div class=\"emvb-price-table\">` (plus `emvb-price-table-featured` and a ribbon paragraph when `featured`), the title heading, the description, `<p class=\"emvb-price-table-price\">` with the regular price in `<s>` when on sale (with \"Regular price:\" and \"Sale price:\" for screen readers only), the amount with its currency and the period; a list of included features with a check mark and excluded ones with a cross, struck through and introduced as \"Not included:\" for screen readers; then the button link (left out without text or a safe link; `newTab` adds `target=\"_blank\" rel=\"noopener noreferrer\"`). No script |\n| `price-list` (shown as \"Price list\", W-1043) | optional `label` (≤ 80) | `children: Node[]`, Price list items only, at most 50 | `<ul class=\"emvb-price-list\" aria-label=\"…\">` (no name without `label`) |\n| `price-list-item` (W-1043) | `title` (≤ 120), `price` (≤ 20, text), optional `description` (≤ 500), `src` with an Image's picture keys and `alt` (≤ 500; unset or empty: decorative), `href` (a link, sanitised), `newTab` | none; only inside `price-list` | `<li class=\"emvb-price-list-item\">` with the picture first (`loading=\"lazy\"`), then `<p class=\"emvb-price-list-head\">` holding the title (a link with `href`), an `aria-hidden` dotted leader and the price, and the description paragraph. No script |\n| `cta` (shown as \"Call to action\", W-1044) | `title` (≤ 200), optional `titleLevel` (2–6, unset 3), `text`, `src` with an Image's picture keys and `alt` (unset or empty: decorative), `layout` (`behind`, `top`, `left`, `right`; unset `behind`), `buttonText` (≤ 80), `href` (a link, sanitised), `newTab`, `ribbon` (≤ 30) | none | `<div class=\"emvb-cta emvb-cta-<layout>\">` (`top` without a picture) with the ribbon, the picture in `.emvb-cta-media` (behind: covering the box under a 55 % black overlay, the words in white), then the title heading, text and button. With a safe `href` the title holds the one link, `emvb-cta-linked` stretches it over the whole box, and the button is an `aria-hidden` span; without one there is no link or button. No script |\n| `flip-box` (shown as \"Flip box\", W-1045) | `frontTitle` (≤ 200), optional `frontText`, `backTitle` (≤ 200), `backText`, `titleLevel` (2–6, unset 3), `buttonText` (≤ 80), `href` (a link, sanitised), `newTab`, `direction` (`right`, `left`, `up`, `down`; unset `right`), `toggleLabel` (≤ 40, unset \"Turn over\") | none | `<div class=\"emvb-flip-box emvb-flip-<direction>\">` holding `.emvb-flip-inner` with two faces stacked in one grid cell (the box is as tall as the taller face), each with its title and text, the back with the button link; then `<label class=\"emvb-flip-toggle\"><input type=\"checkbox\" class=\"emvb-flip-check\">Turn over</label>`. CSS turns the inner on hover (only under `(hover:hover)`), when the checkbox is ticked, and when keyboard focus is inside the back face; both faces stay in the accessibility tree. Reduced motion drops the transition. No script |\n| `headline` (shown as \"Animated headline\", W-1046) | optional `level` (1–6, unset 2), `before` and `after` (≤ 200), `highlight` (1–120), `mark` (`underline`, `circle`, `strike`, `none`; unset `underline`), `rotate` (≤ 10 words of ≤ 120), `rotating`, `interval` (1.5–10 s, unset 2.5), `turns` (1–5, unset 2) | none | `<hN class=\"emvb-headline emvb-headline-<mark>\">before <span class=\"emvb-headline-mark\">highlight</span> after</hN>`, counted as a heading by the accessibility check. The mark is drawn once by CSS (a growing gradient, or an `aria-hidden` SVG circle), already drawn under reduced motion. `rotating` with other words adds `data-emvb-rotate` (the words as JSON), `data-interval` and `data-turns` and lists `\"headline\"` in `runtimes`; the runtime hides the changing word from screen readers (they read the sentence with the first word), adds a Pause button after the heading, and stops on the first word after its rounds or on Pause; nothing rotates under reduced motion |\n| `share-buttons` (shown as \"Share buttons\", W-1047) | optional `label` (≤ 80, unset \"Share this page\"), `shape` (as Social icons), `brandColors`, `nativeShare` | `children: Node[]`, Share links only, at most 12 | `<ul class=\"emvb-share-buttons emvb-share-<shape>\" aria-label=\"Share this page\">`. `nativeShare` adds a last item with `<button type=\"button\" class=\"emvb-share-native\" data-emvb-share>Share…</button>`, hidden by CSS until the opt-in share runtime finds the browser's `navigator.share` and marks the list ready; pressed, it opens the share sheet for the page. The page then lists `\"share\"` in `runtimes` |\n| `share-link` (W-1047) | `network` (`facebook`, `x`, `linkedin`, `whatsapp`, `telegram`, `reddit`, `bluesky`, `threads`, `email`), optional `label` (≤ 80) | none; only inside `share-buttons` | `<li class=\"emvb-share-<network>\"><a href=\"…\" aria-label=\"Share on Facebook\" target=\"_blank\" rel=\"noopener noreferrer\">` with the network's `aria-hidden` icon; the address is the service's own share link with the page URL encoded in it (email: `mailto:?body=…`, same tab). The page URL comes from the host as `dynamic.pageUrl` (`resolveEmVBPage` and `resolveThemeParts` fill it with the request's origin and path when a layout has Share buttons); without it a public page renders no share links, and the editor uses `https://example.com/`. No tracking script |\n| `hotspots` (W-1048) | `src` and `alt` with an Image's picture keys and `decorative`, optional `label` (≤ 80, unset \"Points on the picture\") | `children: Node[]`, Hotspots only, at most 20 | `<div class=\"emvb-hotspots\">` with the picture (`loading=\"lazy\"`; the accessibility check wants its alt text as for an Image) and `<ol class=\"emvb-hotspots-list\" aria-label=\"…\">` of markers numbered by a CSS counter |\n| `hotspot` (W-1048) | `title` (1–120), optional `text` (≤ 1000), `x` and `y` (0–100 %), optional `xTablet`, `yTablet`, `xMobile`, `yMobile` (unset: the wider device's) | none; only inside `hotspots` | `<li>` placed by its own CSS rule (`left`/`top` in percent, tablet and phone values in their media queries), holding `<button type=\"button\" popovertarget=\"emvb-hotspot-<id>\" aria-label=\"title\">` and `<div id=\"emvb-hotspot-<id>\" popover=\"auto\">` with the title and note. The native Popover API opens and closes it (Escape, click outside) with no script; where `position-area` is supported the note sits by its marker, elsewhere in the middle of the screen. `popover`, `popovertarget` and `popovertargetaction` joined the markup attribute allowlist |\n";
|
|
6502
6502
|
|
|
6503
6503
|
// skill/emvb-page-builder/SKILL.md
|
|
6504
6504
|
var SKILL_default = `---
|
|
@@ -6675,6 +6675,9 @@ var MAX_TABS = 12;
|
|
|
6675
6675
|
var MAX_SOCIAL_LINKS = 20;
|
|
6676
6676
|
var MAX_GALLERY_IMAGES = 60;
|
|
6677
6677
|
var MAX_CAROUSEL_SLIDES = 20;
|
|
6678
|
+
var MAX_PRICE_ITEMS = 50;
|
|
6679
|
+
var MAX_SHARE_LINKS = 12;
|
|
6680
|
+
var MAX_HOTSPOTS = 20;
|
|
6678
6681
|
function clipText(text, max) {
|
|
6679
6682
|
if (text.length <= max)
|
|
6680
6683
|
return text;
|
|
@@ -8198,7 +8201,21 @@ var KNOWN_ELEMENT_TYPES = [
|
|
|
8198
8201
|
"gallery",
|
|
8199
8202
|
"gallery-image",
|
|
8200
8203
|
"carousel",
|
|
8201
|
-
"carousel-slide"
|
|
8204
|
+
"carousel-slide",
|
|
8205
|
+
"counter",
|
|
8206
|
+
"progress",
|
|
8207
|
+
"countdown",
|
|
8208
|
+
"map",
|
|
8209
|
+
"price-table",
|
|
8210
|
+
"price-list",
|
|
8211
|
+
"price-list-item",
|
|
8212
|
+
"cta",
|
|
8213
|
+
"flip-box",
|
|
8214
|
+
"headline",
|
|
8215
|
+
"share-buttons",
|
|
8216
|
+
"share-link",
|
|
8217
|
+
"hotspots",
|
|
8218
|
+
"hotspot"
|
|
8202
8219
|
];
|
|
8203
8220
|
var TocNode = leafNode("toc", strictObject({
|
|
8204
8221
|
title: string2().max(80).optional()
|
|
@@ -8222,6 +8239,69 @@ var AlertNode = leafNode("alert", strictObject({
|
|
|
8222
8239
|
dismissible: boolean2().optional(),
|
|
8223
8240
|
dismissLabel: string2().max(80).optional()
|
|
8224
8241
|
}));
|
|
8242
|
+
var COUNTER_SEPARATORS = [",", ".", " ", "'"];
|
|
8243
|
+
var MAX_COUNTER = 1000000000000;
|
|
8244
|
+
var CounterNode = leafNode("counter", strictObject({
|
|
8245
|
+
value: number2().min(-MAX_COUNTER).max(MAX_COUNTER),
|
|
8246
|
+
start: number2().min(-MAX_COUNTER).max(MAX_COUNTER).optional(),
|
|
8247
|
+
decimals: number2().int().min(0).max(3).optional(),
|
|
8248
|
+
separator: _enum(COUNTER_SEPARATORS).optional(),
|
|
8249
|
+
prefix: string2().max(20).optional(),
|
|
8250
|
+
suffix: string2().max(20).optional(),
|
|
8251
|
+
title: string2().max(200).optional(),
|
|
8252
|
+
countUp: boolean2().optional(),
|
|
8253
|
+
duration: number2().int().min(300).max(5000).optional()
|
|
8254
|
+
}));
|
|
8255
|
+
var PROGRESS_KINDS = ["meter", "progressbar"];
|
|
8256
|
+
var MAX_PROGRESS = 1e6;
|
|
8257
|
+
var ProgressNode = leafNode("progress", strictObject({
|
|
8258
|
+
value: number2().min(0).max(MAX_PROGRESS),
|
|
8259
|
+
max: number2().positive().max(MAX_PROGRESS).optional(),
|
|
8260
|
+
label: string2().max(120).optional(),
|
|
8261
|
+
showValue: boolean2().optional(),
|
|
8262
|
+
kind: _enum(PROGRESS_KINDS).optional(),
|
|
8263
|
+
thickness: number2().int().min(2).max(48).optional(),
|
|
8264
|
+
grow: boolean2().optional()
|
|
8265
|
+
}));
|
|
8266
|
+
var COUNTDOWN_TARGET = /^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])T([01]\d|2[0-3]):([0-5]\d)(?::([0-5]\d))?(Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;
|
|
8267
|
+
var COUNTDOWN_EXPIRED = ["text", "hide", "link"];
|
|
8268
|
+
var CountdownNode = leafNode("countdown", strictObject({
|
|
8269
|
+
target: string2().regex(COUNTDOWN_TARGET, "Use a date, time and UTC offset such as 2026-12-01T09:00-05:00").refine((value) => !Number.isNaN(Date.parse(value)), "This date doesn't exist"),
|
|
8270
|
+
title: string2().max(200).optional(),
|
|
8271
|
+
label: string2().max(40).optional(),
|
|
8272
|
+
ticking: boolean2().optional(),
|
|
8273
|
+
hideSeconds: boolean2().optional(),
|
|
8274
|
+
expired: _enum(COUNTDOWN_EXPIRED).optional(),
|
|
8275
|
+
expiredText: string2().max(200).optional(),
|
|
8276
|
+
expiredHref: string2().max(2000).optional()
|
|
8277
|
+
}));
|
|
8278
|
+
var MAP_PROVIDERS = ["osm", "google"];
|
|
8279
|
+
var MapNode = leafNode("map", strictObject({
|
|
8280
|
+
address: string2().min(1).max(300),
|
|
8281
|
+
provider: _enum(MAP_PROVIDERS).optional(),
|
|
8282
|
+
lat: number2().min(-90).max(90).optional(),
|
|
8283
|
+
lng: number2().min(-180).max(180).optional(),
|
|
8284
|
+
zoom: number2().int().min(1).max(19).optional(),
|
|
8285
|
+
linkText: string2().max(80).optional(),
|
|
8286
|
+
embed: boolean2().optional(),
|
|
8287
|
+
height: number2().int().min(150).max(800).optional()
|
|
8288
|
+
}));
|
|
8289
|
+
var PriceTableNode = leafNode("price-table", strictObject({
|
|
8290
|
+
title: string2().max(120),
|
|
8291
|
+
titleLevel: number2().int().min(2).max(6).optional(),
|
|
8292
|
+
description: string2().max(500).optional(),
|
|
8293
|
+
price: string2().max(20),
|
|
8294
|
+
currency: string2().max(5).optional(),
|
|
8295
|
+
period: string2().max(40).optional(),
|
|
8296
|
+
regularPrice: string2().max(20).optional(),
|
|
8297
|
+
features: boundedArray(string2().max(200), 30).optional(),
|
|
8298
|
+
excluded: boundedArray(string2().max(200), 30).optional(),
|
|
8299
|
+
buttonText: string2().max(80).optional(),
|
|
8300
|
+
buttonHref: string2().max(2000).optional(),
|
|
8301
|
+
newTab: boolean2().optional(),
|
|
8302
|
+
featured: boolean2().optional(),
|
|
8303
|
+
ribbon: string2().max(30).optional()
|
|
8304
|
+
}));
|
|
8225
8305
|
var MEDIA_BOX_POSITIONS = ["top", "left", "right"];
|
|
8226
8306
|
var MediaBoxText = {
|
|
8227
8307
|
title: string2().max(200),
|
|
@@ -8238,15 +8318,18 @@ var IconBoxNode = leafNode("icon-box", strictObject({
|
|
|
8238
8318
|
...MediaBoxText
|
|
8239
8319
|
}));
|
|
8240
8320
|
var IMAGE_BOX_SIZES = ["small", "medium", "large", "full"];
|
|
8241
|
-
var
|
|
8242
|
-
src: string2().max(2000),
|
|
8243
|
-
alt: string2().max(500),
|
|
8244
|
-
decorative: boolean2().optional(),
|
|
8321
|
+
var PICKED_MEDIA = {
|
|
8245
8322
|
mediaId: string2().min(1).max(128).optional(),
|
|
8246
8323
|
width: number2().int().positive().max(1e4).optional(),
|
|
8247
8324
|
height: number2().int().positive().max(1e4).optional(),
|
|
8248
8325
|
focalX: number2().int().min(0).max(100).optional(),
|
|
8249
|
-
focalY: number2().int().min(0).max(100).optional()
|
|
8326
|
+
focalY: number2().int().min(0).max(100).optional()
|
|
8327
|
+
};
|
|
8328
|
+
var ImageBoxNode = leafNode("image-box", strictObject({
|
|
8329
|
+
src: string2().max(2000),
|
|
8330
|
+
alt: string2().max(500),
|
|
8331
|
+
decorative: boolean2().optional(),
|
|
8332
|
+
...PICKED_MEDIA,
|
|
8250
8333
|
imageSize: _enum(IMAGE_BOX_SIZES).optional(),
|
|
8251
8334
|
...MediaBoxText
|
|
8252
8335
|
})).refine((node) => node.props.decorative === true || node.props.alt.length > 0, {
|
|
@@ -8259,11 +8342,7 @@ var TestimonialNode = leafNode("testimonial", strictObject({
|
|
|
8259
8342
|
role: string2().max(200).optional(),
|
|
8260
8343
|
src: string2().max(2000).optional(),
|
|
8261
8344
|
alt: string2().max(500).optional(),
|
|
8262
|
-
|
|
8263
|
-
width: number2().int().positive().max(1e4).optional(),
|
|
8264
|
-
height: number2().int().positive().max(1e4).optional(),
|
|
8265
|
-
focalX: number2().int().min(0).max(100).optional(),
|
|
8266
|
-
focalY: number2().int().min(0).max(100).optional(),
|
|
8345
|
+
...PICKED_MEDIA,
|
|
8267
8346
|
rating: number2().min(0).max(MAX_RATING).optional(),
|
|
8268
8347
|
ratingMax: number2().int().min(1).max(MAX_RATING).optional()
|
|
8269
8348
|
}));
|
|
@@ -8314,11 +8393,7 @@ var GalleryImageNode = leafNode("gallery-image", strictObject({
|
|
|
8314
8393
|
src: string2().max(2000),
|
|
8315
8394
|
alt: string2().max(500),
|
|
8316
8395
|
decorative: boolean2().optional(),
|
|
8317
|
-
|
|
8318
|
-
width: number2().int().positive().max(1e4).optional(),
|
|
8319
|
-
height: number2().int().positive().max(1e4).optional(),
|
|
8320
|
-
focalX: number2().int().min(0).max(100).optional(),
|
|
8321
|
-
focalY: number2().int().min(0).max(100).optional(),
|
|
8396
|
+
...PICKED_MEDIA,
|
|
8322
8397
|
caption: string2().max(500).optional()
|
|
8323
8398
|
})).refine((node) => node.props.decorative === true || node.props.alt.length > 0, {
|
|
8324
8399
|
message: "Alt text is required unless the picture is marked decorative.",
|
|
@@ -8336,6 +8411,97 @@ var CarouselNodeSchema = parentNode("carousel", strictObject({
|
|
|
8336
8411
|
var CarouselSlideNode = parentNode("carousel-slide", strictObject({
|
|
8337
8412
|
label: string2().max(80).optional()
|
|
8338
8413
|
}));
|
|
8414
|
+
var PriceListNodeSchema = parentNode("price-list", strictObject({
|
|
8415
|
+
label: string2().max(80).optional()
|
|
8416
|
+
}));
|
|
8417
|
+
var PriceListItemNode = leafNode("price-list-item", strictObject({
|
|
8418
|
+
title: string2().max(120),
|
|
8419
|
+
price: string2().max(20),
|
|
8420
|
+
description: string2().max(500).optional(),
|
|
8421
|
+
src: string2().max(2000).optional(),
|
|
8422
|
+
alt: string2().max(500).optional(),
|
|
8423
|
+
...PICKED_MEDIA,
|
|
8424
|
+
href: string2().max(2000).optional(),
|
|
8425
|
+
newTab: boolean2().optional()
|
|
8426
|
+
}));
|
|
8427
|
+
var CTA_LAYOUTS = ["behind", "top", "left", "right"];
|
|
8428
|
+
var CtaNode = leafNode("cta", strictObject({
|
|
8429
|
+
title: string2().max(200),
|
|
8430
|
+
titleLevel: number2().int().min(2).max(6).optional(),
|
|
8431
|
+
text: string2().max(MAX_TEXT_LENGTH).optional(),
|
|
8432
|
+
src: string2().max(2000).optional(),
|
|
8433
|
+
alt: string2().max(500).optional(),
|
|
8434
|
+
...PICKED_MEDIA,
|
|
8435
|
+
layout: _enum(CTA_LAYOUTS).optional(),
|
|
8436
|
+
buttonText: string2().max(80).optional(),
|
|
8437
|
+
href: string2().max(2000).optional(),
|
|
8438
|
+
newTab: boolean2().optional(),
|
|
8439
|
+
ribbon: string2().max(30).optional()
|
|
8440
|
+
}));
|
|
8441
|
+
var FLIP_DIRECTIONS = ["left", "right", "up", "down"];
|
|
8442
|
+
var FlipBoxNode = leafNode("flip-box", strictObject({
|
|
8443
|
+
frontTitle: string2().max(200),
|
|
8444
|
+
frontText: string2().max(MAX_TEXT_LENGTH).optional(),
|
|
8445
|
+
backTitle: string2().max(200).optional(),
|
|
8446
|
+
backText: string2().max(MAX_TEXT_LENGTH).optional(),
|
|
8447
|
+
titleLevel: number2().int().min(2).max(6).optional(),
|
|
8448
|
+
buttonText: string2().max(80).optional(),
|
|
8449
|
+
href: string2().max(2000).optional(),
|
|
8450
|
+
newTab: boolean2().optional(),
|
|
8451
|
+
direction: _enum(FLIP_DIRECTIONS).optional(),
|
|
8452
|
+
toggleLabel: string2().max(40).optional()
|
|
8453
|
+
}));
|
|
8454
|
+
var HEADLINE_MARKS = ["underline", "circle", "strike", "none"];
|
|
8455
|
+
var HeadlineNode = leafNode("headline", strictObject({
|
|
8456
|
+
level: number2().int().min(1).max(6).optional(),
|
|
8457
|
+
before: string2().max(200).optional(),
|
|
8458
|
+
highlight: string2().min(1).max(120),
|
|
8459
|
+
after: string2().max(200).optional(),
|
|
8460
|
+
mark: _enum(HEADLINE_MARKS).optional(),
|
|
8461
|
+
rotate: boundedArray(string2().max(120), 10).optional(),
|
|
8462
|
+
rotating: boolean2().optional(),
|
|
8463
|
+
interval: number2().min(1.5).max(10).optional(),
|
|
8464
|
+
turns: number2().int().min(1).max(5).optional()
|
|
8465
|
+
}));
|
|
8466
|
+
var SHARE_NETWORKS = [
|
|
8467
|
+
"facebook",
|
|
8468
|
+
"x",
|
|
8469
|
+
"linkedin",
|
|
8470
|
+
"whatsapp",
|
|
8471
|
+
"telegram",
|
|
8472
|
+
"reddit",
|
|
8473
|
+
"bluesky",
|
|
8474
|
+
"threads",
|
|
8475
|
+
"email"
|
|
8476
|
+
];
|
|
8477
|
+
var ShareButtonsNodeSchema = parentNode("share-buttons", strictObject({
|
|
8478
|
+
label: string2().max(80).optional(),
|
|
8479
|
+
shape: _enum(SOCIAL_SHAPES).optional(),
|
|
8480
|
+
brandColors: boolean2().optional(),
|
|
8481
|
+
nativeShare: boolean2().optional()
|
|
8482
|
+
}));
|
|
8483
|
+
var ShareLinkNode = leafNode("share-link", strictObject({
|
|
8484
|
+
network: _enum(SHARE_NETWORKS),
|
|
8485
|
+
label: string2().max(80).optional()
|
|
8486
|
+
}));
|
|
8487
|
+
var HotspotsNodeSchema = parentNode("hotspots", strictObject({
|
|
8488
|
+
src: string2().max(2000),
|
|
8489
|
+
alt: string2().max(500),
|
|
8490
|
+
decorative: boolean2().optional(),
|
|
8491
|
+
...PICKED_MEDIA,
|
|
8492
|
+
label: string2().max(80).optional()
|
|
8493
|
+
}));
|
|
8494
|
+
var HotspotPlace = number2().min(0).max(100);
|
|
8495
|
+
var HotspotNode = leafNode("hotspot", strictObject({
|
|
8496
|
+
title: string2().min(1).max(120),
|
|
8497
|
+
text: string2().max(1000).optional(),
|
|
8498
|
+
x: HotspotPlace,
|
|
8499
|
+
y: HotspotPlace,
|
|
8500
|
+
xTablet: HotspotPlace.optional(),
|
|
8501
|
+
yTablet: HotspotPlace.optional(),
|
|
8502
|
+
xMobile: HotspotPlace.optional(),
|
|
8503
|
+
yMobile: HotspotPlace.optional()
|
|
8504
|
+
}));
|
|
8339
8505
|
var knownTypeSet = new Set(KNOWN_ELEMENT_TYPES);
|
|
8340
8506
|
var UnknownNodeSchema = strictObject({
|
|
8341
8507
|
id: NodeId,
|
|
@@ -8369,6 +8535,20 @@ var KnownLayoutNode = discriminatedUnion("type", [
|
|
|
8369
8535
|
GalleryImageNode,
|
|
8370
8536
|
CarouselNodeSchema,
|
|
8371
8537
|
CarouselSlideNode,
|
|
8538
|
+
PriceListNodeSchema,
|
|
8539
|
+
PriceListItemNode,
|
|
8540
|
+
CtaNode,
|
|
8541
|
+
FlipBoxNode,
|
|
8542
|
+
HeadlineNode,
|
|
8543
|
+
ShareButtonsNodeSchema,
|
|
8544
|
+
ShareLinkNode,
|
|
8545
|
+
HotspotsNodeSchema,
|
|
8546
|
+
HotspotNode,
|
|
8547
|
+
CounterNode,
|
|
8548
|
+
ProgressNode,
|
|
8549
|
+
CountdownNode,
|
|
8550
|
+
MapNode,
|
|
8551
|
+
PriceTableNode,
|
|
8372
8552
|
SpacerNode,
|
|
8373
8553
|
DividerNode,
|
|
8374
8554
|
TextNode,
|
|
@@ -8477,7 +8657,7 @@ var Layout = strictObject({
|
|
|
8477
8657
|
});
|
|
8478
8658
|
var isFormNode = (node) => node.type === "form";
|
|
8479
8659
|
var isLayoutParentNode = (node) => node.type === "container" || node.type === "div-block" || node.type === "layout-section" || node.type === "flexbox" || node.type === "grid" || node.type === "tab-panel" || node.type === "part-ref" || node.type === "loop-empty" || node.type === "accordion-item" || node.type === "menu-item" || node.type === "carousel-slide";
|
|
8480
|
-
var isParentNode = (node) => node.type === "container" || node.type === "div-block" || node.type === "layout-section" || node.type === "flexbox" || node.type === "grid" || node.type === "form" || node.type === "loop" || node.type === "loop-empty" || node.type === "part-ref" || node.type === "tabs" || node.type === "tab-panel" || node.type === "accordion" || node.type === "accordion-item" || node.type === "menu" || node.type === "menu-item" || node.type === "social-icons" || node.type === "gallery" || node.type === "carousel" || node.type === "carousel-slide";
|
|
8660
|
+
var isParentNode = (node) => node.type === "container" || node.type === "div-block" || node.type === "layout-section" || node.type === "flexbox" || node.type === "grid" || node.type === "form" || node.type === "loop" || node.type === "loop-empty" || node.type === "part-ref" || node.type === "tabs" || node.type === "tab-panel" || node.type === "accordion" || node.type === "accordion-item" || node.type === "menu" || node.type === "menu-item" || node.type === "social-icons" || node.type === "gallery" || node.type === "carousel" || node.type === "carousel-slide" || node.type === "price-list" || node.type === "share-buttons" || node.type === "hotspots";
|
|
8481
8661
|
var isFormFieldType = (type) => FORM_FIELD_TYPES.includes(type);
|
|
8482
8662
|
// ../emvb/src/core/sanitize/href.ts
|
|
8483
8663
|
var HREF_SCHEMES = new Set(["http:", "https:", "mailto:", "tel:"]);
|
|
@@ -10286,80 +10466,1445 @@ var carousel = {
|
|
|
10286
10466
|
{ key: "loop", kind: "boolean", label: "Go round from the last slide", optional: true },
|
|
10287
10467
|
{ key: "autoplay", kind: "boolean", label: "Play automatically", optional: true },
|
|
10288
10468
|
{
|
|
10289
|
-
key: "interval",
|
|
10290
|
-
kind: "int",
|
|
10291
|
-
label: "Seconds per slide",
|
|
10469
|
+
key: "interval",
|
|
10470
|
+
kind: "int",
|
|
10471
|
+
label: "Seconds per slide",
|
|
10472
|
+
optional: true,
|
|
10473
|
+
min: 3,
|
|
10474
|
+
max: 30,
|
|
10475
|
+
message: "From 3 to 30 seconds. Leave it empty for 6."
|
|
10476
|
+
}
|
|
10477
|
+
]
|
|
10478
|
+
},
|
|
10479
|
+
build: (node, attrs, children) => {
|
|
10480
|
+
const { label, perView, arrows, dots, autoplay, interval, loop } = node.props;
|
|
10481
|
+
const total = children.length;
|
|
10482
|
+
const slides = children.map((slide, i) => slide.attrs["aria-label"] ? slide : { ...slide, attrs: { ...slide.attrs, "aria-label": `${i + 1} of ${total}` } });
|
|
10483
|
+
const options = {};
|
|
10484
|
+
if (arrows)
|
|
10485
|
+
options["data-emvb-arrows"] = "";
|
|
10486
|
+
if (dots)
|
|
10487
|
+
options["data-emvb-dots"] = "";
|
|
10488
|
+
if (autoplay)
|
|
10489
|
+
options["data-emvb-autoplay"] = String(interval ?? 6);
|
|
10490
|
+
if (loop)
|
|
10491
|
+
options["data-emvb-loop"] = "";
|
|
10492
|
+
return {
|
|
10493
|
+
tag: "section",
|
|
10494
|
+
attrs: {
|
|
10495
|
+
...attrs,
|
|
10496
|
+
class: `${attrs["class"] ?? ""} emvb-carousel-per-${perView ?? 1}`.trim(),
|
|
10497
|
+
"aria-roledescription": "carousel",
|
|
10498
|
+
"aria-label": label?.trim() || "Carousel",
|
|
10499
|
+
...options
|
|
10500
|
+
},
|
|
10501
|
+
children: [
|
|
10502
|
+
{
|
|
10503
|
+
tag: "div",
|
|
10504
|
+
attrs: {
|
|
10505
|
+
class: "emvb-carousel-track",
|
|
10506
|
+
tabindex: "0",
|
|
10507
|
+
"aria-live": autoplay ? "off" : "polite"
|
|
10508
|
+
},
|
|
10509
|
+
children: slides
|
|
10510
|
+
}
|
|
10511
|
+
]
|
|
10512
|
+
};
|
|
10513
|
+
}
|
|
10514
|
+
};
|
|
10515
|
+
var carouselSlide = {
|
|
10516
|
+
baseCss: "",
|
|
10517
|
+
defaults: () => ({ type: "carousel-slide", props: {}, children: [] }),
|
|
10518
|
+
descriptor: {
|
|
10519
|
+
type: "carousel-slide",
|
|
10520
|
+
name: "Slide",
|
|
10521
|
+
group: "layout",
|
|
10522
|
+
defaultTab: "content",
|
|
10523
|
+
fields: [
|
|
10524
|
+
{
|
|
10525
|
+
key: "label",
|
|
10526
|
+
kind: "text",
|
|
10527
|
+
label: "Slide name",
|
|
10528
|
+
optional: true,
|
|
10529
|
+
message: "What screen readers call this slide. Leave it empty for its place, such as 2 of 5."
|
|
10530
|
+
}
|
|
10531
|
+
]
|
|
10532
|
+
},
|
|
10533
|
+
build: (node, attrs, children) => ({
|
|
10534
|
+
tag: "div",
|
|
10535
|
+
attrs: {
|
|
10536
|
+
...attrs,
|
|
10537
|
+
role: "group",
|
|
10538
|
+
"aria-roledescription": "slide",
|
|
10539
|
+
...node.props.label?.trim() ? { "aria-label": node.props.label.trim() } : {}
|
|
10540
|
+
},
|
|
10541
|
+
children
|
|
10542
|
+
})
|
|
10543
|
+
};
|
|
10544
|
+
|
|
10545
|
+
// ../emvb/src/core/elements/counter-format.ts
|
|
10546
|
+
function formatCounter(value, decimals = 0, separator = "") {
|
|
10547
|
+
const fixed = Math.abs(value).toFixed(decimals);
|
|
10548
|
+
const [whole = "0", fraction] = fixed.split(".");
|
|
10549
|
+
const grouped = separator ? whole.replace(/\B(?=(\d{3})+(?!\d))/g, separator) : whole;
|
|
10550
|
+
const mark = separator === "." ? "," : ".";
|
|
10551
|
+
const sign = value < 0 && Number(fixed) !== 0 ? "-" : "";
|
|
10552
|
+
return `${sign}${grouped}${fraction === undefined ? "" : `${mark}${fraction}`}`;
|
|
10553
|
+
}
|
|
10554
|
+
|
|
10555
|
+
// ../emvb/src/core/elements/marketing.ts
|
|
10556
|
+
var SR_ONLY = "position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0";
|
|
10557
|
+
var SEPARATOR_LABELS = {
|
|
10558
|
+
",": "1,000",
|
|
10559
|
+
".": "1.000",
|
|
10560
|
+
" ": "1 000",
|
|
10561
|
+
"'": "1'000"
|
|
10562
|
+
};
|
|
10563
|
+
var counter = {
|
|
10564
|
+
baseCss: `.emvb-counter-number{margin:0;font-size:2.5em;font-weight:700;line-height:1.1;font-variant-numeric:tabular-nums}.emvb-counter-title{margin:0.25em 0 0}.emvb-counter-sr{${SR_ONLY}}`,
|
|
10565
|
+
defaults: () => ({
|
|
10566
|
+
type: "counter",
|
|
10567
|
+
props: { value: 1200, separator: ",", suffix: "+", title: "Happy clients" }
|
|
10568
|
+
}),
|
|
10569
|
+
descriptor: {
|
|
10570
|
+
type: "counter",
|
|
10571
|
+
name: "Counter",
|
|
10572
|
+
group: "content",
|
|
10573
|
+
defaultTab: "content",
|
|
10574
|
+
fields: [
|
|
10575
|
+
{
|
|
10576
|
+
key: "value",
|
|
10577
|
+
kind: "decimal",
|
|
10578
|
+
label: "Number",
|
|
10579
|
+
min: -MAX_COUNTER,
|
|
10580
|
+
max: MAX_COUNTER,
|
|
10581
|
+
message: "Enter a number, such as 1200 or 98.5."
|
|
10582
|
+
},
|
|
10583
|
+
{ key: "prefix", kind: "text", label: "Before the number", optional: true },
|
|
10584
|
+
{ key: "suffix", kind: "text", label: "After the number", optional: true },
|
|
10585
|
+
{ key: "title", kind: "text", label: "Title", optional: true },
|
|
10586
|
+
{
|
|
10587
|
+
key: "decimals",
|
|
10588
|
+
kind: "select",
|
|
10589
|
+
label: "Decimals",
|
|
10590
|
+
optional: true,
|
|
10591
|
+
options: [0, 1, 2, 3].map((value) => ({ value, label: String(value) }))
|
|
10592
|
+
},
|
|
10593
|
+
{
|
|
10594
|
+
key: "separator",
|
|
10595
|
+
kind: "select",
|
|
10596
|
+
label: "Thousands separator",
|
|
10597
|
+
optional: true,
|
|
10598
|
+
options: COUNTER_SEPARATORS.map((value) => ({ value, label: SEPARATOR_LABELS[value] }))
|
|
10599
|
+
},
|
|
10600
|
+
{
|
|
10601
|
+
key: "countUp",
|
|
10602
|
+
kind: "boolean",
|
|
10603
|
+
label: "Count up when scrolled into view",
|
|
10604
|
+
optional: true
|
|
10605
|
+
},
|
|
10606
|
+
{
|
|
10607
|
+
key: "start",
|
|
10608
|
+
kind: "decimal",
|
|
10609
|
+
label: "Count from",
|
|
10610
|
+
optional: true,
|
|
10611
|
+
min: -MAX_COUNTER,
|
|
10612
|
+
max: MAX_COUNTER,
|
|
10613
|
+
message: "Enter the number the count-up starts at, such as 0."
|
|
10614
|
+
},
|
|
10615
|
+
{
|
|
10616
|
+
key: "duration",
|
|
10617
|
+
kind: "int",
|
|
10618
|
+
label: "Count-up time (ms)",
|
|
10619
|
+
optional: true,
|
|
10620
|
+
min: 300,
|
|
10621
|
+
max: 5000,
|
|
10622
|
+
message: "From 300 to 5000 ms (5 seconds at most)."
|
|
10623
|
+
}
|
|
10624
|
+
]
|
|
10625
|
+
},
|
|
10626
|
+
build: (node, attrs) => {
|
|
10627
|
+
const { value, start, decimals, separator, prefix, suffix, title, countUp, duration } = node.props;
|
|
10628
|
+
const valueAttrs = { class: "emvb-counter-value" };
|
|
10629
|
+
if (countUp) {
|
|
10630
|
+
valueAttrs["data-emvb-counter"] = "";
|
|
10631
|
+
valueAttrs["data-from"] = String(start ?? 0);
|
|
10632
|
+
valueAttrs["data-to"] = String(value);
|
|
10633
|
+
if (decimals)
|
|
10634
|
+
valueAttrs["data-decimals"] = String(decimals);
|
|
10635
|
+
if (separator)
|
|
10636
|
+
valueAttrs["data-separator"] = separator;
|
|
10637
|
+
valueAttrs["data-duration"] = String(duration ?? 2000);
|
|
10638
|
+
}
|
|
10639
|
+
const number = [];
|
|
10640
|
+
if (prefix)
|
|
10641
|
+
number.push({ tag: "span", attrs: { class: "emvb-counter-prefix" }, children: [prefix] });
|
|
10642
|
+
number.push({
|
|
10643
|
+
tag: "span",
|
|
10644
|
+
attrs: valueAttrs,
|
|
10645
|
+
children: [formatCounter(value, decimals, separator)]
|
|
10646
|
+
});
|
|
10647
|
+
if (suffix)
|
|
10648
|
+
number.push({ tag: "span", attrs: { class: "emvb-counter-suffix" }, children: [suffix] });
|
|
10649
|
+
const children = [
|
|
10650
|
+
{ tag: "p", attrs: { class: "emvb-counter-number" }, children: number }
|
|
10651
|
+
];
|
|
10652
|
+
if (title?.trim())
|
|
10653
|
+
children.push({ tag: "p", attrs: { class: "emvb-counter-title" }, children: [title] });
|
|
10654
|
+
return { tag: "div", attrs, children };
|
|
10655
|
+
}
|
|
10656
|
+
};
|
|
10657
|
+
var short = (value) => String(Math.round(value * 100) / 100);
|
|
10658
|
+
function progressPercent(props) {
|
|
10659
|
+
const max = props.max ?? 100;
|
|
10660
|
+
return Math.min(100, Math.max(0, props.value / max * 100));
|
|
10661
|
+
}
|
|
10662
|
+
var progress = {
|
|
10663
|
+
baseCss: ".emvb-progress-head{display:flex;justify-content:space-between;gap:1em;margin:0 0 0.375em}.emvb-progress-svg{display:block;width:100%;overflow:visible}[dir=rtl] .emvb-progress-svg,.emvb-progress[dir=rtl] .emvb-progress-svg{transform:scaleX(-1)}@keyframes emvb-progress-grow{from{transform:scaleX(0)}to{transform:scaleX(1)}}@media (prefers-reduced-motion:no-preference){@supports (animation-timeline:view()){.emvb-progress-grow .emvb-progress-fill{transform-box:fill-box;transform-origin:left center;animation:emvb-progress-grow linear both;animation-timeline:view();animation-range:entry 10% cover 40%}}}",
|
|
10664
|
+
defaults: () => ({
|
|
10665
|
+
type: "progress",
|
|
10666
|
+
props: { value: 75, label: "Design", showValue: true }
|
|
10667
|
+
}),
|
|
10668
|
+
descriptor: {
|
|
10669
|
+
type: "progress",
|
|
10670
|
+
name: "Progress bar",
|
|
10671
|
+
group: "content",
|
|
10672
|
+
defaultTab: "content",
|
|
10673
|
+
fields: [
|
|
10674
|
+
{ key: "label", kind: "text", label: "Title", optional: true },
|
|
10675
|
+
{
|
|
10676
|
+
key: "value",
|
|
10677
|
+
kind: "decimal",
|
|
10678
|
+
label: "Value",
|
|
10679
|
+
max: MAX_PROGRESS,
|
|
10680
|
+
maxProp: "max",
|
|
10681
|
+
message: "Enter a number from 0 up to the maximum, such as 75."
|
|
10682
|
+
},
|
|
10683
|
+
{
|
|
10684
|
+
key: "max",
|
|
10685
|
+
kind: "decimal",
|
|
10686
|
+
label: "Maximum",
|
|
10687
|
+
optional: true,
|
|
10688
|
+
min: 0.01,
|
|
10689
|
+
max: MAX_PROGRESS,
|
|
10690
|
+
message: "Enter a number above 0, such as 100."
|
|
10691
|
+
},
|
|
10692
|
+
{ key: "showValue", kind: "boolean", label: "Show the percentage", optional: true },
|
|
10693
|
+
{
|
|
10694
|
+
key: "kind",
|
|
10695
|
+
kind: "select",
|
|
10696
|
+
label: "Meaning",
|
|
10697
|
+
optional: true,
|
|
10698
|
+
options: [
|
|
10699
|
+
{ value: "meter", label: "A measurement, such as a skill" },
|
|
10700
|
+
{ value: "progressbar", label: "How far a task has got" }
|
|
10701
|
+
]
|
|
10702
|
+
},
|
|
10703
|
+
{ key: "thickness", kind: "int", label: "Bar height (px)", optional: true, min: 2, max: 48 },
|
|
10704
|
+
{ key: "grow", kind: "boolean", label: "Grow in when scrolled into view", optional: true }
|
|
10705
|
+
]
|
|
10706
|
+
},
|
|
10707
|
+
build: (node, attrs) => {
|
|
10708
|
+
const { value, label, showValue, kind, thickness, grow } = node.props;
|
|
10709
|
+
const max = node.props.max ?? 100;
|
|
10710
|
+
const percent = progressPercent(node.props);
|
|
10711
|
+
const shown = `${Math.round(percent)}%`;
|
|
10712
|
+
const height = thickness ?? 8;
|
|
10713
|
+
const radius = String(height / 2);
|
|
10714
|
+
const children = [];
|
|
10715
|
+
const title = label?.trim();
|
|
10716
|
+
if (title || showValue) {
|
|
10717
|
+
const head = [];
|
|
10718
|
+
head.push({
|
|
10719
|
+
tag: "span",
|
|
10720
|
+
attrs: { class: "emvb-progress-label" },
|
|
10721
|
+
children: title ? [title] : []
|
|
10722
|
+
});
|
|
10723
|
+
if (showValue)
|
|
10724
|
+
head.push({
|
|
10725
|
+
tag: "span",
|
|
10726
|
+
attrs: { class: "emvb-progress-value", "aria-hidden": "true" },
|
|
10727
|
+
children: [shown]
|
|
10728
|
+
});
|
|
10729
|
+
children.push({ tag: "div", attrs: { class: "emvb-progress-head" }, children: head });
|
|
10730
|
+
}
|
|
10731
|
+
const rect = (className, width, extra) => ({
|
|
10732
|
+
tag: "rect",
|
|
10733
|
+
attrs: {
|
|
10734
|
+
class: className,
|
|
10735
|
+
width,
|
|
10736
|
+
height: "100%",
|
|
10737
|
+
rx: radius,
|
|
10738
|
+
fill: "currentColor",
|
|
10739
|
+
...extra
|
|
10740
|
+
},
|
|
10741
|
+
children: []
|
|
10742
|
+
});
|
|
10743
|
+
children.push({
|
|
10744
|
+
tag: "div",
|
|
10745
|
+
attrs: {
|
|
10746
|
+
class: "emvb-progress-bar",
|
|
10747
|
+
role: kind ?? "meter",
|
|
10748
|
+
...title ? { "aria-label": title } : {},
|
|
10749
|
+
"aria-valuemin": "0",
|
|
10750
|
+
"aria-valuemax": short(max),
|
|
10751
|
+
"aria-valuenow": short(Math.min(value, max)),
|
|
10752
|
+
"aria-valuetext": shown
|
|
10753
|
+
},
|
|
10754
|
+
children: [
|
|
10755
|
+
{
|
|
10756
|
+
tag: "svg",
|
|
10757
|
+
attrs: {
|
|
10758
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
10759
|
+
class: "emvb-progress-svg",
|
|
10760
|
+
width: "100%",
|
|
10761
|
+
height: String(height),
|
|
10762
|
+
"aria-hidden": "true",
|
|
10763
|
+
focusable: "false"
|
|
10764
|
+
},
|
|
10765
|
+
children: [
|
|
10766
|
+
rect("emvb-progress-track", "100%", { "fill-opacity": "0.2" }),
|
|
10767
|
+
...percent > 0 ? [rect("emvb-progress-fill", `${short(percent)}%`, {})] : []
|
|
10768
|
+
]
|
|
10769
|
+
}
|
|
10770
|
+
]
|
|
10771
|
+
});
|
|
10772
|
+
return {
|
|
10773
|
+
tag: "div",
|
|
10774
|
+
attrs: grow ? { ...attrs, class: `${attrs["class"] ?? ""} emvb-progress-grow`.trim() } : attrs,
|
|
10775
|
+
children
|
|
10776
|
+
};
|
|
10777
|
+
}
|
|
10778
|
+
};
|
|
10779
|
+
var MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
10780
|
+
function countdownDate(target) {
|
|
10781
|
+
const m = COUNTDOWN_TARGET.exec(target);
|
|
10782
|
+
if (!m)
|
|
10783
|
+
return target;
|
|
10784
|
+
const [, year, month, day, hour, minute, , zone = "Z"] = m;
|
|
10785
|
+
let offset = "";
|
|
10786
|
+
if (zone !== "Z") {
|
|
10787
|
+
const [h = "00", min = "00"] = zone.slice(1).split(":");
|
|
10788
|
+
const hours = String(Number(h));
|
|
10789
|
+
offset = `${zone[0] === "-" ? "−" : "+"}${hours}${min === "00" ? "" : `:${min}`}`;
|
|
10790
|
+
if (h === "00" && min === "00")
|
|
10791
|
+
offset = "";
|
|
10792
|
+
}
|
|
10793
|
+
return `${Number(day)} ${MONTHS[Number(month) - 1]} ${year}, ${hour}:${minute} UTC${offset}`;
|
|
10794
|
+
}
|
|
10795
|
+
var COUNTDOWN_UNITS = [
|
|
10796
|
+
["days", "Days"],
|
|
10797
|
+
["hours", "Hours"],
|
|
10798
|
+
["minutes", "Minutes"],
|
|
10799
|
+
["seconds", "Seconds"]
|
|
10800
|
+
];
|
|
10801
|
+
var countdown = {
|
|
10802
|
+
baseCss: ".emvb-countdown-title{margin:0 0 0.25em;font-weight:600}.emvb-countdown-target{margin:0}.emvb-countdown-clock{display:flex;flex-wrap:wrap;align-items:center;gap:0.75em;margin:0.5em 0 0}.emvb-countdown:not([data-emvb-ready]) .emvb-countdown-clock,.emvb-countdown-expired:not([data-emvb-shown]),.emvb-countdown[hidden],.emvb-countdown-clock[hidden]{display:none}.emvb-countdown-units{display:flex;gap:0.75em}.emvb-countdown-unit{display:flex;flex-direction:column;align-items:center;min-width:3.5em}.emvb-countdown-num{font-size:2em;font-weight:700;line-height:1.1;font-variant-numeric:tabular-nums}.emvb-countdown-name{font-size:0.75em;text-transform:uppercase;letter-spacing:0.05em}.emvb-countdown-pause{padding:0.25em 0.75em;border:1px solid currentColor;border-radius:4px;background:none;color:inherit;font:inherit;cursor:pointer}.emvb-countdown-pause:focus-visible{outline:2px solid currentColor;outline-offset:2px}.emvb-countdown-expired{margin:0.5em 0 0}",
|
|
10803
|
+
defaults: () => ({
|
|
10804
|
+
type: "countdown",
|
|
10805
|
+
props: { target: "2027-01-01T00:00Z", title: "Offer ends soon", ticking: true }
|
|
10806
|
+
}),
|
|
10807
|
+
descriptor: {
|
|
10808
|
+
type: "countdown",
|
|
10809
|
+
name: "Countdown",
|
|
10810
|
+
group: "content",
|
|
10811
|
+
defaultTab: "content",
|
|
10812
|
+
fields: [
|
|
10813
|
+
{
|
|
10814
|
+
key: "target",
|
|
10815
|
+
kind: "text",
|
|
10816
|
+
label: "Ends at",
|
|
10817
|
+
message: "Date, time and UTC offset, such as 2026-12-01T09:00-05:00 (or Z for UTC)."
|
|
10818
|
+
},
|
|
10819
|
+
{ key: "title", kind: "text", label: "Title", optional: true },
|
|
10820
|
+
{
|
|
10821
|
+
key: "label",
|
|
10822
|
+
kind: "text",
|
|
10823
|
+
label: "Words before the date",
|
|
10824
|
+
optional: true,
|
|
10825
|
+
message: "Leave it empty for Ends."
|
|
10826
|
+
},
|
|
10827
|
+
{ key: "ticking", kind: "boolean", label: "Show a live countdown", optional: true },
|
|
10828
|
+
{ key: "hideSeconds", kind: "boolean", label: "Hide seconds", optional: true },
|
|
10829
|
+
{
|
|
10830
|
+
key: "expired",
|
|
10831
|
+
kind: "select",
|
|
10832
|
+
label: "When time is up",
|
|
10833
|
+
optional: true,
|
|
10834
|
+
options: [
|
|
10835
|
+
{ value: "text", label: "Show the ended text" },
|
|
10836
|
+
{ value: "hide", label: "Hide the countdown" },
|
|
10837
|
+
{ value: "link", label: "Show the ended text as a link" }
|
|
10838
|
+
]
|
|
10839
|
+
},
|
|
10840
|
+
{
|
|
10841
|
+
key: "expiredText",
|
|
10842
|
+
kind: "text",
|
|
10843
|
+
label: "Ended text",
|
|
10844
|
+
optional: true,
|
|
10845
|
+
message: "Shown by the live countdown once time is up. Leave it empty for This offer has ended."
|
|
10846
|
+
},
|
|
10847
|
+
{
|
|
10848
|
+
key: "expiredHref",
|
|
10849
|
+
kind: "href",
|
|
10850
|
+
label: "Ended link",
|
|
10851
|
+
optional: true,
|
|
10852
|
+
message: "Use a full URL such as https://example.com or a path such as /offers."
|
|
10853
|
+
}
|
|
10854
|
+
]
|
|
10855
|
+
},
|
|
10856
|
+
build: (node, attrs) => {
|
|
10857
|
+
const { target, title, label, ticking, hideSeconds, expired, expiredText, expiredHref } = node.props;
|
|
10858
|
+
const children = [];
|
|
10859
|
+
if (title?.trim())
|
|
10860
|
+
children.push({ tag: "p", attrs: { class: "emvb-countdown-title" }, children: [title] });
|
|
10861
|
+
children.push({
|
|
10862
|
+
tag: "p",
|
|
10863
|
+
attrs: { class: "emvb-countdown-target" },
|
|
10864
|
+
children: [
|
|
10865
|
+
`${label?.trim() || "Ends"} `,
|
|
10866
|
+
{ tag: "time", attrs: { datetime: target }, children: [countdownDate(target)] }
|
|
10867
|
+
]
|
|
10868
|
+
});
|
|
10869
|
+
if (!ticking)
|
|
10870
|
+
return { tag: "div", attrs, children };
|
|
10871
|
+
const units = COUNTDOWN_UNITS.filter(([unit]) => !(hideSeconds && unit === "seconds"));
|
|
10872
|
+
children.push({
|
|
10873
|
+
tag: "div",
|
|
10874
|
+
attrs: { class: "emvb-countdown-clock" },
|
|
10875
|
+
children: [
|
|
10876
|
+
{
|
|
10877
|
+
tag: "div",
|
|
10878
|
+
attrs: { class: "emvb-countdown-units", "aria-hidden": "true" },
|
|
10879
|
+
children: units.map(([unit, name]) => ({
|
|
10880
|
+
tag: "span",
|
|
10881
|
+
attrs: { class: "emvb-countdown-unit" },
|
|
10882
|
+
children: [
|
|
10883
|
+
{
|
|
10884
|
+
tag: "span",
|
|
10885
|
+
attrs: { class: "emvb-countdown-num", "data-unit": unit },
|
|
10886
|
+
children: ["00"]
|
|
10887
|
+
},
|
|
10888
|
+
{ tag: "span", attrs: { class: "emvb-countdown-name" }, children: [name] }
|
|
10889
|
+
]
|
|
10890
|
+
}))
|
|
10891
|
+
},
|
|
10892
|
+
{
|
|
10893
|
+
tag: "button",
|
|
10894
|
+
attrs: { type: "button", class: "emvb-countdown-pause", "aria-pressed": "false" },
|
|
10895
|
+
children: ["Pause"]
|
|
10896
|
+
}
|
|
10897
|
+
]
|
|
10898
|
+
});
|
|
10899
|
+
const action = expired ?? "text";
|
|
10900
|
+
if (action !== "hide") {
|
|
10901
|
+
const words = expiredText?.trim() || "This offer has ended.";
|
|
10902
|
+
const href = action === "link" && expiredHref ? sanitizeHref(expiredHref) : undefined;
|
|
10903
|
+
children.push({
|
|
10904
|
+
tag: "p",
|
|
10905
|
+
attrs: { class: "emvb-countdown-expired" },
|
|
10906
|
+
children: [href ? { tag: "a", attrs: { href }, children: [words] } : words]
|
|
10907
|
+
});
|
|
10908
|
+
}
|
|
10909
|
+
return {
|
|
10910
|
+
tag: "div",
|
|
10911
|
+
attrs: {
|
|
10912
|
+
...attrs,
|
|
10913
|
+
"data-emvb-countdown": "",
|
|
10914
|
+
"data-target": target,
|
|
10915
|
+
"data-expired": action
|
|
10916
|
+
},
|
|
10917
|
+
children
|
|
10918
|
+
};
|
|
10919
|
+
}
|
|
10920
|
+
};
|
|
10921
|
+
var MAP_NAMES = { osm: "OpenStreetMap", google: "Google Maps" };
|
|
10922
|
+
var coord = (value) => String(Math.round(value * 1e6) / 1e6);
|
|
10923
|
+
function mapUrls(props) {
|
|
10924
|
+
const { address, lat, lng } = props;
|
|
10925
|
+
const zoom = props.zoom ?? 15;
|
|
10926
|
+
const at = lat !== undefined && lng !== undefined ? [coord(lat), coord(lng)] : undefined;
|
|
10927
|
+
const query = encodeURIComponent(address.trim());
|
|
10928
|
+
if ((props.provider ?? "osm") === "google") {
|
|
10929
|
+
const q = at ? `${at[0]},${at[1]}` : query;
|
|
10930
|
+
return {
|
|
10931
|
+
link: `https://www.google.com/maps/search/?api=1&query=${q}`,
|
|
10932
|
+
embed: `https://www.google.com/maps?q=${q}&z=${zoom}&output=embed`
|
|
10933
|
+
};
|
|
10934
|
+
}
|
|
10935
|
+
if (!at)
|
|
10936
|
+
return { link: `https://www.openstreetmap.org/search?query=${query}` };
|
|
10937
|
+
const [la, lo] = at;
|
|
10938
|
+
const span = 360 / 2 ** zoom;
|
|
10939
|
+
const box = [
|
|
10940
|
+
Number(lo) - span,
|
|
10941
|
+
Number(la) - span / 2,
|
|
10942
|
+
Number(lo) + span,
|
|
10943
|
+
Number(la) + span / 2
|
|
10944
|
+
].map(coord);
|
|
10945
|
+
return {
|
|
10946
|
+
link: `https://www.openstreetmap.org/?mlat=${la}&mlon=${lo}#map=${zoom}/${la}/${lo}`,
|
|
10947
|
+
embed: `https://www.openstreetmap.org/export/embed.html?bbox=${box.join("%2C")}&layer=mapnik&marker=${la}%2C${lo}`
|
|
10948
|
+
};
|
|
10949
|
+
}
|
|
10950
|
+
var map = {
|
|
10951
|
+
baseCss: ".emvb-map-address{margin:0 0 0.25em;white-space:pre-line}.emvb-map-frame{margin:0.75em 0 0}.emvb-map:not([data-emvb-ready]) .emvb-map-frame{display:none}.emvb-map-load{padding:0.5em 1em;border:1px solid currentColor;border-radius:4px;background:none;color:inherit;font:inherit;cursor:pointer}.emvb-map-load:focus-visible{outline:2px solid currentColor;outline-offset:2px}.emvb-map-note{margin:0.25em 0 0;font-size:0.875em}.emvb-map iframe{display:block;width:100%;border:0}",
|
|
10952
|
+
defaults: () => ({
|
|
10953
|
+
type: "map",
|
|
10954
|
+
props: { address: "Tour Eiffel, Paris", lat: 48.8584, lng: 2.2945 }
|
|
10955
|
+
}),
|
|
10956
|
+
descriptor: {
|
|
10957
|
+
type: "map",
|
|
10958
|
+
name: "Map",
|
|
10959
|
+
group: "content",
|
|
10960
|
+
defaultTab: "content",
|
|
10961
|
+
fields: [
|
|
10962
|
+
{ key: "address", kind: "textarea", label: "Address" },
|
|
10963
|
+
{
|
|
10964
|
+
key: "provider",
|
|
10965
|
+
kind: "select",
|
|
10966
|
+
label: "Map service",
|
|
10967
|
+
optional: true,
|
|
10968
|
+
options: [
|
|
10969
|
+
{ value: "osm", label: "OpenStreetMap" },
|
|
10970
|
+
{ value: "google", label: "Google Maps" }
|
|
10971
|
+
]
|
|
10972
|
+
},
|
|
10973
|
+
{
|
|
10974
|
+
key: "lat",
|
|
10975
|
+
kind: "decimal",
|
|
10976
|
+
label: "Latitude",
|
|
10977
|
+
optional: true,
|
|
10978
|
+
min: -90,
|
|
10979
|
+
max: 90,
|
|
10980
|
+
message: "From -90 to 90, such as 48.8584."
|
|
10981
|
+
},
|
|
10982
|
+
{
|
|
10983
|
+
key: "lng",
|
|
10984
|
+
kind: "decimal",
|
|
10985
|
+
label: "Longitude",
|
|
10986
|
+
optional: true,
|
|
10987
|
+
min: -180,
|
|
10988
|
+
max: 180,
|
|
10989
|
+
message: "From -180 to 180, such as 2.2945."
|
|
10990
|
+
},
|
|
10991
|
+
{ key: "zoom", kind: "int", label: "Zoom", optional: true, min: 1, max: 19 },
|
|
10992
|
+
{ key: "linkText", kind: "text", label: "Link text", optional: true },
|
|
10993
|
+
{
|
|
10994
|
+
key: "embed",
|
|
10995
|
+
kind: "boolean",
|
|
10996
|
+
label: "Visitors can load the map on the page",
|
|
10997
|
+
optional: true
|
|
10998
|
+
},
|
|
10999
|
+
{ key: "height", kind: "int", label: "Map height (px)", optional: true, min: 150, max: 800 }
|
|
11000
|
+
]
|
|
11001
|
+
},
|
|
11002
|
+
build: (node, attrs) => {
|
|
11003
|
+
const { address, provider, linkText, embed, height } = node.props;
|
|
11004
|
+
const service = MAP_NAMES[provider ?? "osm"];
|
|
11005
|
+
const urls = mapUrls(node.props);
|
|
11006
|
+
const children = [
|
|
11007
|
+
{ tag: "p", attrs: { class: "emvb-map-address" }, children: [address] },
|
|
11008
|
+
{
|
|
11009
|
+
tag: "a",
|
|
11010
|
+
attrs: { class: "emvb-map-link", href: urls.link, rel: "noopener" },
|
|
11011
|
+
children: [linkText?.trim() || `Open in ${service}`]
|
|
11012
|
+
}
|
|
11013
|
+
];
|
|
11014
|
+
if (!embed || !urls.embed)
|
|
11015
|
+
return { tag: "div", attrs, children };
|
|
11016
|
+
children.push({
|
|
11017
|
+
tag: "div",
|
|
11018
|
+
attrs: {
|
|
11019
|
+
class: "emvb-map-frame",
|
|
11020
|
+
"data-src": urls.embed,
|
|
11021
|
+
"data-title": `Map of ${address.split(`
|
|
11022
|
+
`)[0]?.trim() ?? address}`,
|
|
11023
|
+
"data-height": String(height ?? 360)
|
|
11024
|
+
},
|
|
11025
|
+
children: [
|
|
11026
|
+
{
|
|
11027
|
+
tag: "button",
|
|
11028
|
+
attrs: { type: "button", class: "emvb-map-load" },
|
|
11029
|
+
children: ["Show the map"]
|
|
11030
|
+
},
|
|
11031
|
+
{
|
|
11032
|
+
tag: "p",
|
|
11033
|
+
attrs: { class: "emvb-map-note" },
|
|
11034
|
+
children: [`Loads a map from ${service}.`]
|
|
11035
|
+
}
|
|
11036
|
+
]
|
|
11037
|
+
});
|
|
11038
|
+
return { tag: "div", attrs: { ...attrs, "data-emvb-map": "" }, children };
|
|
11039
|
+
}
|
|
11040
|
+
};
|
|
11041
|
+
var mark = (className, d) => ({
|
|
11042
|
+
tag: "svg",
|
|
11043
|
+
attrs: {
|
|
11044
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
11045
|
+
class: className,
|
|
11046
|
+
width: "16",
|
|
11047
|
+
height: "16",
|
|
11048
|
+
viewBox: "0 0 24 24",
|
|
11049
|
+
fill: "none",
|
|
11050
|
+
stroke: "currentColor",
|
|
11051
|
+
"stroke-width": "2.5",
|
|
11052
|
+
"stroke-linecap": "round",
|
|
11053
|
+
"stroke-linejoin": "round",
|
|
11054
|
+
"aria-hidden": "true",
|
|
11055
|
+
focusable: "false"
|
|
11056
|
+
},
|
|
11057
|
+
children: [{ tag: "path", attrs: { d }, children: [] }]
|
|
11058
|
+
});
|
|
11059
|
+
var srText = (className, text) => ({
|
|
11060
|
+
tag: "span",
|
|
11061
|
+
attrs: { class: className },
|
|
11062
|
+
children: [text]
|
|
11063
|
+
});
|
|
11064
|
+
function linkAttrs(href, newTab) {
|
|
11065
|
+
const safe = href ? sanitizeHref(href) : undefined;
|
|
11066
|
+
if (!safe)
|
|
11067
|
+
return;
|
|
11068
|
+
return newTab ? { href: safe, target: "_blank", rel: "noopener noreferrer" } : { href: safe };
|
|
11069
|
+
}
|
|
11070
|
+
var priceTable = {
|
|
11071
|
+
baseCss: `.emvb-price-table{position:relative;display:flex;flex-direction:column;gap:0.75em;padding:1.5em;border:1px solid rgb(0 0 0 / 0.15);border-radius:8px}.emvb-price-table-featured{border-width:2px;border-color:currentColor}.emvb-price-table-ribbon{position:absolute;top:0;right:1.5em;transform:translateY(-50%);margin:0;padding:0.125em 0.75em;border-radius:999px;background:#1f2937;color:#fff;font-size:0.75em;font-weight:600;text-transform:uppercase;letter-spacing:0.05em}.emvb-price-table-title{margin:0}.emvb-price-table-desc{margin:0}.emvb-price-table-price{display:flex;flex-wrap:wrap;align-items:baseline;gap:0.25em 0.5em;margin:0}.emvb-price-table-amount{font-size:2.5em;font-weight:700;line-height:1}.emvb-price-table-currency{font-size:0.5em;vertical-align:super}.emvb-price-table-regular{opacity:0.7}.emvb-price-table-features{display:flex;flex-direction:column;gap:0.5em;margin:0;padding:0;list-style:none}.emvb-price-table-features li{display:flex;gap:0.5em;align-items:baseline}.emvb-price-table-features svg{flex:none;align-self:center}.emvb-price-table-no{opacity:0.6}.emvb-price-table-no .emvb-price-table-text{text-decoration:line-through}.emvb-price-table-button{display:inline-flex;align-items:center;justify-content:center;margin-top:auto;padding:0.625em 1.25em;border:1px solid currentColor;border-radius:6px;color:inherit;font:inherit;text-decoration:none;text-align:center}.emvb-price-table-button:focus-visible{outline:2px solid currentColor;outline-offset:2px}.emvb-price-table-sr{${SR_ONLY}}`,
|
|
11072
|
+
defaults: () => ({
|
|
11073
|
+
type: "price-table",
|
|
11074
|
+
props: {
|
|
11075
|
+
title: "Pro",
|
|
11076
|
+
description: "For growing teams.",
|
|
11077
|
+
price: "29",
|
|
11078
|
+
currency: "$",
|
|
11079
|
+
period: "per month",
|
|
11080
|
+
features: ["Unlimited pages", "Priority support"],
|
|
11081
|
+
excluded: ["Custom domain"],
|
|
11082
|
+
buttonText: "Choose Pro",
|
|
11083
|
+
buttonHref: "/signup",
|
|
11084
|
+
featured: true
|
|
11085
|
+
}
|
|
11086
|
+
}),
|
|
11087
|
+
descriptor: {
|
|
11088
|
+
type: "price-table",
|
|
11089
|
+
name: "Price table",
|
|
11090
|
+
group: "content",
|
|
11091
|
+
defaultTab: "content",
|
|
11092
|
+
fields: [
|
|
11093
|
+
{ key: "title", kind: "text", label: "Title" },
|
|
11094
|
+
{
|
|
11095
|
+
key: "titleLevel",
|
|
11096
|
+
kind: "select",
|
|
11097
|
+
label: "Title level",
|
|
11098
|
+
optional: true,
|
|
11099
|
+
options: [2, 3, 4, 5, 6].map((level) => ({ value: level, label: `H${level}` }))
|
|
11100
|
+
},
|
|
11101
|
+
{ key: "description", kind: "textarea", label: "Description", optional: true },
|
|
11102
|
+
{ key: "currency", kind: "text", label: "Currency", optional: true },
|
|
11103
|
+
{ key: "price", kind: "text", label: "Price", message: "Such as 29, 29.99 or Free." },
|
|
11104
|
+
{
|
|
11105
|
+
key: "period",
|
|
11106
|
+
kind: "text",
|
|
11107
|
+
label: "Period",
|
|
11108
|
+
optional: true,
|
|
11109
|
+
message: "Such as per month."
|
|
11110
|
+
},
|
|
11111
|
+
{
|
|
11112
|
+
key: "regularPrice",
|
|
11113
|
+
kind: "text",
|
|
11114
|
+
label: "Regular price (on sale)",
|
|
11115
|
+
optional: true,
|
|
11116
|
+
message: "Shown struck through before the price."
|
|
11117
|
+
},
|
|
11118
|
+
{ key: "features", kind: "list-items", label: "Included", optional: true },
|
|
11119
|
+
{ key: "excluded", kind: "list-items", label: "Not included", optional: true },
|
|
11120
|
+
{ key: "buttonText", kind: "text", label: "Button text", optional: true },
|
|
11121
|
+
{
|
|
11122
|
+
key: "buttonHref",
|
|
11123
|
+
kind: "href",
|
|
11124
|
+
label: "Button link",
|
|
11125
|
+
optional: true,
|
|
11126
|
+
message: "Use a full URL such as https://example.com or a path such as /signup."
|
|
11127
|
+
},
|
|
11128
|
+
{ key: "newTab", kind: "boolean", label: "Open in a new tab", optional: true },
|
|
11129
|
+
{ key: "featured", kind: "boolean", label: "Featured", optional: true },
|
|
11130
|
+
{ key: "ribbon", kind: "text", label: "Ribbon text", optional: true }
|
|
11131
|
+
]
|
|
11132
|
+
},
|
|
11133
|
+
build: (node, attrs) => {
|
|
11134
|
+
const p = node.props;
|
|
11135
|
+
const children = [];
|
|
11136
|
+
if (p.featured)
|
|
11137
|
+
children.push({
|
|
11138
|
+
tag: "p",
|
|
11139
|
+
attrs: { class: "emvb-price-table-ribbon" },
|
|
11140
|
+
children: [p.ribbon?.trim() || "Featured"]
|
|
11141
|
+
});
|
|
11142
|
+
children.push({
|
|
11143
|
+
tag: `h${p.titleLevel ?? 3}`,
|
|
11144
|
+
attrs: { class: "emvb-price-table-title" },
|
|
11145
|
+
children: [p.title]
|
|
11146
|
+
});
|
|
11147
|
+
if (p.description?.trim())
|
|
11148
|
+
children.push({
|
|
11149
|
+
tag: "p",
|
|
11150
|
+
attrs: { class: "emvb-price-table-desc" },
|
|
11151
|
+
children: [p.description]
|
|
11152
|
+
});
|
|
11153
|
+
const currency = p.currency?.trim();
|
|
11154
|
+
const regular = p.regularPrice?.trim();
|
|
11155
|
+
const price = [];
|
|
11156
|
+
if (regular)
|
|
11157
|
+
price.push({
|
|
11158
|
+
tag: "s",
|
|
11159
|
+
attrs: { class: "emvb-price-table-regular" },
|
|
11160
|
+
children: [srText("emvb-price-table-sr", "Regular price: "), `${currency ?? ""}${regular}`]
|
|
11161
|
+
});
|
|
11162
|
+
price.push({
|
|
11163
|
+
tag: "span",
|
|
11164
|
+
attrs: { class: "emvb-price-table-amount" },
|
|
11165
|
+
children: [
|
|
11166
|
+
...regular ? [srText("emvb-price-table-sr", "Sale price: ")] : [],
|
|
11167
|
+
...currency ? [{ tag: "span", attrs: { class: "emvb-price-table-currency" }, children: [currency] }] : [],
|
|
11168
|
+
p.price
|
|
11169
|
+
]
|
|
11170
|
+
});
|
|
11171
|
+
if (p.period?.trim())
|
|
11172
|
+
price.push({
|
|
11173
|
+
tag: "span",
|
|
11174
|
+
attrs: { class: "emvb-price-table-period" },
|
|
11175
|
+
children: [p.period]
|
|
11176
|
+
});
|
|
11177
|
+
children.push({ tag: "p", attrs: { class: "emvb-price-table-price" }, children: price });
|
|
11178
|
+
const items = [];
|
|
11179
|
+
for (const feature of p.features ?? []) {
|
|
11180
|
+
if (!feature.trim())
|
|
11181
|
+
continue;
|
|
11182
|
+
items.push({
|
|
11183
|
+
tag: "li",
|
|
11184
|
+
attrs: { class: "emvb-price-table-yes" },
|
|
11185
|
+
children: [
|
|
11186
|
+
mark("emvb-price-table-check", "M20 6 9 17l-5-5"),
|
|
11187
|
+
{ tag: "span", attrs: { class: "emvb-price-table-text" }, children: [feature] }
|
|
11188
|
+
]
|
|
11189
|
+
});
|
|
11190
|
+
}
|
|
11191
|
+
for (const feature of p.excluded ?? []) {
|
|
11192
|
+
if (!feature.trim())
|
|
11193
|
+
continue;
|
|
11194
|
+
items.push({
|
|
11195
|
+
tag: "li",
|
|
11196
|
+
attrs: { class: "emvb-price-table-no" },
|
|
11197
|
+
children: [
|
|
11198
|
+
mark("emvb-price-table-cross", "M18 6 6 18M6 6l12 12"),
|
|
11199
|
+
srText("emvb-price-table-sr", "Not included: "),
|
|
11200
|
+
{ tag: "span", attrs: { class: "emvb-price-table-text" }, children: [feature] }
|
|
11201
|
+
]
|
|
11202
|
+
});
|
|
11203
|
+
}
|
|
11204
|
+
if (items.length > 0)
|
|
11205
|
+
children.push({ tag: "ul", attrs: { class: "emvb-price-table-features" }, children: items });
|
|
11206
|
+
const link = linkAttrs(p.buttonHref, p.newTab);
|
|
11207
|
+
if (p.buttonText?.trim() && link)
|
|
11208
|
+
children.push({
|
|
11209
|
+
tag: "a",
|
|
11210
|
+
attrs: { class: "emvb-price-table-button", ...link },
|
|
11211
|
+
children: [p.buttonText]
|
|
11212
|
+
});
|
|
11213
|
+
return {
|
|
11214
|
+
tag: "div",
|
|
11215
|
+
attrs: p.featured ? { ...attrs, class: `${attrs["class"] ?? ""} emvb-price-table-featured`.trim() } : attrs,
|
|
11216
|
+
children
|
|
11217
|
+
};
|
|
11218
|
+
}
|
|
11219
|
+
};
|
|
11220
|
+
var priceList = {
|
|
11221
|
+
baseCss: ".emvb-price-list{display:flex;flex-direction:column;gap:1em;margin:0;padding:0;list-style:none}.emvb-price-list-item{display:flex;gap:1em;align-items:flex-start}.emvb-price-list-image{flex:none;width:4em;height:4em;object-fit:cover;border-radius:6px}.emvb-price-list-body{flex:1;min-width:0}.emvb-price-list-head{display:flex;align-items:baseline;gap:0.5em;margin:0;font-weight:600}.emvb-price-list-title a{color:inherit}.emvb-price-list-leader{flex:1;min-width:1em;border-bottom:2px dotted currentColor;opacity:0.5}.emvb-price-list-price{flex:none}.emvb-price-list-desc{margin:0.25em 0 0;opacity:0.8}",
|
|
11222
|
+
defaults: () => ({ type: "price-list", props: {}, children: [] }),
|
|
11223
|
+
descriptor: {
|
|
11224
|
+
type: "price-list",
|
|
11225
|
+
name: "Price list",
|
|
11226
|
+
group: "content",
|
|
11227
|
+
defaultTab: "content",
|
|
11228
|
+
fields: [
|
|
11229
|
+
{
|
|
11230
|
+
key: "label",
|
|
11231
|
+
kind: "text",
|
|
11232
|
+
label: "List name",
|
|
11233
|
+
optional: true,
|
|
11234
|
+
message: "What screen readers call the list, such as Drinks. Leave it empty for none."
|
|
11235
|
+
}
|
|
11236
|
+
]
|
|
11237
|
+
},
|
|
11238
|
+
build: (node, attrs, children) => ({
|
|
11239
|
+
tag: "ul",
|
|
11240
|
+
attrs: node.props.label?.trim() ? { ...attrs, "aria-label": node.props.label } : attrs,
|
|
11241
|
+
children
|
|
11242
|
+
})
|
|
11243
|
+
};
|
|
11244
|
+
var priceListItem = {
|
|
11245
|
+
baseCss: "",
|
|
11246
|
+
defaults: () => ({
|
|
11247
|
+
type: "price-list-item",
|
|
11248
|
+
props: { title: "Item", price: "$10" }
|
|
11249
|
+
}),
|
|
11250
|
+
descriptor: {
|
|
11251
|
+
type: "price-list-item",
|
|
11252
|
+
name: "Price list item",
|
|
11253
|
+
group: "content",
|
|
11254
|
+
defaultTab: "content",
|
|
11255
|
+
fields: [
|
|
11256
|
+
{ key: "title", kind: "text", label: "Title" },
|
|
11257
|
+
{ key: "price", kind: "text", label: "Price", message: "Such as $12 or 12 €." },
|
|
11258
|
+
{ key: "description", kind: "textarea", label: "Description", optional: true },
|
|
11259
|
+
{ key: "src", kind: "media", label: "Picture", optional: true },
|
|
11260
|
+
{
|
|
11261
|
+
key: "alt",
|
|
11262
|
+
kind: "text",
|
|
11263
|
+
label: "Alt text",
|
|
11264
|
+
optional: true,
|
|
11265
|
+
message: "Leave it empty when the picture only decorates the row."
|
|
11266
|
+
},
|
|
11267
|
+
{
|
|
11268
|
+
key: "href",
|
|
11269
|
+
kind: "href",
|
|
11270
|
+
label: "Link",
|
|
11271
|
+
optional: true,
|
|
11272
|
+
message: "Use a full URL such as https://example.com or a path such as /menu."
|
|
11273
|
+
},
|
|
11274
|
+
{ key: "newTab", kind: "boolean", label: "Open in a new tab", optional: true }
|
|
11275
|
+
]
|
|
11276
|
+
},
|
|
11277
|
+
build: (node, attrs) => {
|
|
11278
|
+
const p = node.props;
|
|
11279
|
+
const src = p.src?.trim() ? sanitizeMediaUrl(p.src.trim()) : undefined;
|
|
11280
|
+
const link = linkAttrs(p.href, p.newTab);
|
|
11281
|
+
const children = [];
|
|
11282
|
+
if (src)
|
|
11283
|
+
children.push({
|
|
11284
|
+
tag: "img",
|
|
11285
|
+
attrs: {
|
|
11286
|
+
class: "emvb-price-list-image",
|
|
11287
|
+
src,
|
|
11288
|
+
alt: p.alt?.trim() ?? "",
|
|
11289
|
+
...p.width ? { width: String(p.width) } : {},
|
|
11290
|
+
...p.height ? { height: String(p.height) } : {},
|
|
11291
|
+
loading: "lazy",
|
|
11292
|
+
decoding: "async"
|
|
11293
|
+
},
|
|
11294
|
+
children: []
|
|
11295
|
+
});
|
|
11296
|
+
const body = [
|
|
11297
|
+
{
|
|
11298
|
+
tag: "p",
|
|
11299
|
+
attrs: { class: "emvb-price-list-head" },
|
|
11300
|
+
children: [
|
|
11301
|
+
{
|
|
11302
|
+
tag: "span",
|
|
11303
|
+
attrs: { class: "emvb-price-list-title" },
|
|
11304
|
+
children: [link ? { tag: "a", attrs: link, children: [p.title] } : p.title]
|
|
11305
|
+
},
|
|
11306
|
+
{
|
|
11307
|
+
tag: "span",
|
|
11308
|
+
attrs: { class: "emvb-price-list-leader", "aria-hidden": "true" },
|
|
11309
|
+
children: []
|
|
11310
|
+
},
|
|
11311
|
+
{ tag: "span", attrs: { class: "emvb-price-list-price" }, children: [p.price] }
|
|
11312
|
+
]
|
|
11313
|
+
}
|
|
11314
|
+
];
|
|
11315
|
+
if (p.description?.trim())
|
|
11316
|
+
body.push({ tag: "p", attrs: { class: "emvb-price-list-desc" }, children: [p.description] });
|
|
11317
|
+
children.push({ tag: "div", attrs: { class: "emvb-price-list-body" }, children: body });
|
|
11318
|
+
return { tag: "li", attrs, children };
|
|
11319
|
+
}
|
|
11320
|
+
};
|
|
11321
|
+
var cta = {
|
|
11322
|
+
baseCss: '.emvb-cta{position:relative;display:flex;flex-direction:column;gap:1em;overflow:hidden;border-radius:8px;min-width:0}.emvb-cta-left{flex-direction:row;align-items:center}.emvb-cta-right{flex-direction:row-reverse;align-items:center}.emvb-cta-media{flex:none;line-height:0}.emvb-cta-media img{display:block;width:100%;height:100%;object-fit:cover}.emvb-cta:is(.emvb-cta-left,.emvb-cta-right) .emvb-cta-media{flex-basis:40%;max-width:40%;align-self:stretch}.emvb-cta-body{position:relative;flex:1;min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:0.75em;padding:1.5em}.emvb-cta-behind{justify-content:center;min-height:16em;color:#fff}.emvb-cta-behind .emvb-cta-media{position:absolute;inset:0}.emvb-cta-behind .emvb-cta-media::after{content:"";position:absolute;inset:0;background:rgb(0 0 0 / 0.55)}.emvb-cta-title{margin:0;font-size:1.5em}.emvb-cta-text{margin:0;white-space:pre-line}.emvb-cta-link{color:inherit;text-decoration:none}.emvb-cta-link::after{content:"";position:absolute;inset:0;z-index:1}.emvb-cta-linked .emvb-cta-body{position:static}.emvb-cta-linked:has(.emvb-cta-link:focus-visible){outline:2px solid currentColor;outline-offset:4px}.emvb-cta-link:focus-visible{outline:none}.emvb-cta-button{display:inline-flex;padding:0.625em 1.25em;border:1px solid currentColor;border-radius:6px}.emvb-cta-ribbon{position:absolute;top:0.75em;right:0.75em;z-index:2;margin:0;padding:0.125em 0.75em;border-radius:999px;background:#1f2937;color:#fff;font-size:0.75em;font-weight:600;text-transform:uppercase;letter-spacing:0.05em}',
|
|
11323
|
+
defaults: () => ({
|
|
11324
|
+
type: "cta",
|
|
11325
|
+
props: {
|
|
11326
|
+
title: "Ready to start?",
|
|
11327
|
+
text: "Create your first page in minutes.",
|
|
11328
|
+
buttonText: "Get started",
|
|
11329
|
+
href: "/signup",
|
|
11330
|
+
layout: "top"
|
|
11331
|
+
}
|
|
11332
|
+
}),
|
|
11333
|
+
descriptor: {
|
|
11334
|
+
type: "cta",
|
|
11335
|
+
name: "Call to action",
|
|
11336
|
+
group: "content",
|
|
11337
|
+
defaultTab: "content",
|
|
11338
|
+
fields: [
|
|
11339
|
+
{ key: "title", kind: "text", label: "Title" },
|
|
11340
|
+
{
|
|
11341
|
+
key: "titleLevel",
|
|
11342
|
+
kind: "select",
|
|
11343
|
+
label: "Title level",
|
|
11344
|
+
optional: true,
|
|
11345
|
+
options: [2, 3, 4, 5, 6].map((level) => ({ value: level, label: `H${level}` }))
|
|
11346
|
+
},
|
|
11347
|
+
{ key: "text", kind: "textarea", label: "Text", optional: true },
|
|
11348
|
+
{ key: "src", kind: "media", label: "Picture", optional: true },
|
|
11349
|
+
{
|
|
11350
|
+
key: "alt",
|
|
11351
|
+
kind: "text",
|
|
11352
|
+
label: "Alt text",
|
|
11353
|
+
optional: true,
|
|
11354
|
+
message: "Leave it empty when the picture only sets the mood."
|
|
11355
|
+
},
|
|
11356
|
+
{
|
|
11357
|
+
key: "layout",
|
|
11358
|
+
kind: "select",
|
|
11359
|
+
label: "Picture",
|
|
11360
|
+
optional: true,
|
|
11361
|
+
options: [
|
|
11362
|
+
{ value: "behind", label: "Behind the text" },
|
|
11363
|
+
{ value: "top", label: "Above" },
|
|
11364
|
+
{ value: "left", label: "Before" },
|
|
11365
|
+
{ value: "right", label: "After" }
|
|
11366
|
+
]
|
|
11367
|
+
},
|
|
11368
|
+
{ key: "buttonText", kind: "text", label: "Button text", optional: true },
|
|
11369
|
+
{
|
|
11370
|
+
key: "href",
|
|
11371
|
+
kind: "href",
|
|
11372
|
+
label: "Link",
|
|
11373
|
+
optional: true,
|
|
11374
|
+
message: "The whole box opens it. Use a full URL or a path such as /signup."
|
|
11375
|
+
},
|
|
11376
|
+
{ key: "newTab", kind: "boolean", label: "Open in a new tab", optional: true },
|
|
11377
|
+
{ key: "ribbon", kind: "text", label: "Ribbon text", optional: true }
|
|
11378
|
+
]
|
|
11379
|
+
},
|
|
11380
|
+
build: (node, attrs) => {
|
|
11381
|
+
const p = node.props;
|
|
11382
|
+
const layout = p.layout ?? "behind";
|
|
11383
|
+
const src = p.src?.trim() ? sanitizeMediaUrl(p.src.trim()) : undefined;
|
|
11384
|
+
const link = linkAttrs(p.href, p.newTab);
|
|
11385
|
+
const children = [];
|
|
11386
|
+
if (p.ribbon?.trim())
|
|
11387
|
+
children.push({ tag: "p", attrs: { class: "emvb-cta-ribbon" }, children: [p.ribbon] });
|
|
11388
|
+
if (src)
|
|
11389
|
+
children.push({
|
|
11390
|
+
tag: "div",
|
|
11391
|
+
attrs: { class: "emvb-cta-media" },
|
|
11392
|
+
children: [
|
|
11393
|
+
{
|
|
11394
|
+
tag: "img",
|
|
11395
|
+
attrs: {
|
|
11396
|
+
src,
|
|
11397
|
+
alt: p.alt?.trim() ?? "",
|
|
11398
|
+
...p.width ? { width: String(p.width) } : {},
|
|
11399
|
+
...p.height ? { height: String(p.height) } : {},
|
|
11400
|
+
loading: "lazy",
|
|
11401
|
+
decoding: "async"
|
|
11402
|
+
},
|
|
11403
|
+
children: []
|
|
11404
|
+
}
|
|
11405
|
+
]
|
|
11406
|
+
});
|
|
11407
|
+
const body = [
|
|
11408
|
+
{
|
|
11409
|
+
tag: `h${p.titleLevel ?? 3}`,
|
|
11410
|
+
attrs: { class: "emvb-cta-title" },
|
|
11411
|
+
children: [
|
|
11412
|
+
link ? { tag: "a", attrs: { class: "emvb-cta-link", ...link }, children: [p.title] } : p.title
|
|
11413
|
+
]
|
|
11414
|
+
}
|
|
11415
|
+
];
|
|
11416
|
+
if (p.text?.trim())
|
|
11417
|
+
body.push({ tag: "p", attrs: { class: "emvb-cta-text" }, children: [p.text] });
|
|
11418
|
+
if (link && p.buttonText?.trim())
|
|
11419
|
+
body.push({
|
|
11420
|
+
tag: "span",
|
|
11421
|
+
attrs: { class: "emvb-cta-button", "aria-hidden": "true" },
|
|
11422
|
+
children: [p.buttonText]
|
|
11423
|
+
});
|
|
11424
|
+
children.push({ tag: "div", attrs: { class: "emvb-cta-body" }, children: body });
|
|
11425
|
+
const classes = [attrs["class"] ?? "", `emvb-cta-${src ? layout : "top"}`];
|
|
11426
|
+
if (link)
|
|
11427
|
+
classes.push("emvb-cta-linked");
|
|
11428
|
+
return { tag: "div", attrs: { ...attrs, class: classes.join(" ").trim() }, children };
|
|
11429
|
+
}
|
|
11430
|
+
};
|
|
11431
|
+
var FLIP_TURNS = {
|
|
11432
|
+
left: "rotateY(-180deg)",
|
|
11433
|
+
right: "rotateY(180deg)",
|
|
11434
|
+
up: "rotateX(180deg)",
|
|
11435
|
+
down: "rotateX(-180deg)"
|
|
11436
|
+
};
|
|
11437
|
+
var flipBox = {
|
|
11438
|
+
baseCss: ":where(.emvb-flip-box){color:#fff;border-radius:8px}.emvb-flip-box{position:relative;perspective:1200px}.emvb-flip-inner{display:grid;transition:transform 0.6s ease;transform-style:preserve-3d}.emvb-flip-face{grid-area:1/1;display:flex;flex-direction:column;justify-content:center;gap:0.75em;min-height:16em;padding:1.5em 1.5em 3em;border-radius:inherit;background:#1f2937;color:inherit;backface-visibility:hidden;-webkit-backface-visibility:hidden}.emvb-flip-back{background:#374151}.emvb-flip-title{margin:0;font-size:1.25em}.emvb-flip-text{margin:0;white-space:pre-line}.emvb-flip-button{align-self:flex-start;padding:0.625em 1.25em;border:1px solid currentColor;border-radius:6px;color:inherit;text-decoration:none}.emvb-flip-button:focus-visible{outline:2px solid currentColor;outline-offset:2px}.emvb-flip-toggle{position:absolute;right:0.75em;bottom:0.75em;z-index:1;display:inline-flex;gap:0.375em;align-items:center;font-size:0.875em;cursor:pointer}.emvb-flip-check{margin:0;accent-color:currentColor}.emvb-flip-check:focus-visible{outline:2px solid currentColor;outline-offset:2px}" + Object.keys(FLIP_TURNS).map((dir) => {
|
|
11439
|
+
const turn = FLIP_TURNS[dir];
|
|
11440
|
+
const on = `.emvb-flip-${dir}:has(.emvb-flip-check:checked) .emvb-flip-inner,.emvb-flip-${dir}:has(.emvb-flip-back :focus-visible) .emvb-flip-inner`;
|
|
11441
|
+
return `.emvb-flip-${dir} .emvb-flip-back{transform:${turn}}${on}{transform:${turn}}@media (hover:hover){.emvb-flip-${dir}:hover .emvb-flip-inner{transform:${turn}}}`;
|
|
11442
|
+
}).join("") + "@media (prefers-reduced-motion:reduce){.emvb-flip-inner{transition:none}}",
|
|
11443
|
+
defaults: () => ({
|
|
11444
|
+
type: "flip-box",
|
|
11445
|
+
props: {
|
|
11446
|
+
frontTitle: "Hover or tap to learn more",
|
|
11447
|
+
frontText: "A short teaser on the front.",
|
|
11448
|
+
backTitle: "Here is the detail",
|
|
11449
|
+
backText: "The back says more and can link somewhere.",
|
|
11450
|
+
buttonText: "Read more",
|
|
11451
|
+
href: "/about"
|
|
11452
|
+
}
|
|
11453
|
+
}),
|
|
11454
|
+
descriptor: {
|
|
11455
|
+
type: "flip-box",
|
|
11456
|
+
name: "Flip box",
|
|
11457
|
+
group: "content",
|
|
11458
|
+
defaultTab: "content",
|
|
11459
|
+
fields: [
|
|
11460
|
+
{ key: "frontTitle", kind: "text", label: "Front title" },
|
|
11461
|
+
{ key: "frontText", kind: "textarea", label: "Front text", optional: true },
|
|
11462
|
+
{ key: "backTitle", kind: "text", label: "Back title", optional: true },
|
|
11463
|
+
{ key: "backText", kind: "textarea", label: "Back text", optional: true },
|
|
11464
|
+
{
|
|
11465
|
+
key: "titleLevel",
|
|
11466
|
+
kind: "select",
|
|
11467
|
+
label: "Title level",
|
|
11468
|
+
optional: true,
|
|
11469
|
+
options: [2, 3, 4, 5, 6].map((level) => ({ value: level, label: `H${level}` }))
|
|
11470
|
+
},
|
|
11471
|
+
{ key: "buttonText", kind: "text", label: "Button text", optional: true },
|
|
11472
|
+
{
|
|
11473
|
+
key: "href",
|
|
11474
|
+
kind: "href",
|
|
11475
|
+
label: "Button link",
|
|
11476
|
+
optional: true,
|
|
11477
|
+
message: "Use a full URL such as https://example.com or a path such as /about."
|
|
11478
|
+
},
|
|
11479
|
+
{ key: "newTab", kind: "boolean", label: "Open in a new tab", optional: true },
|
|
11480
|
+
{
|
|
11481
|
+
key: "direction",
|
|
11482
|
+
kind: "select",
|
|
11483
|
+
label: "Turns",
|
|
11484
|
+
optional: true,
|
|
11485
|
+
options: [
|
|
11486
|
+
{ value: "right", label: "Right" },
|
|
11487
|
+
{ value: "left", label: "Left" },
|
|
11488
|
+
{ value: "up", label: "Up" },
|
|
11489
|
+
{ value: "down", label: "Down" }
|
|
11490
|
+
]
|
|
11491
|
+
},
|
|
11492
|
+
{
|
|
11493
|
+
key: "toggleLabel",
|
|
11494
|
+
kind: "text",
|
|
11495
|
+
label: "Turn-over control text",
|
|
11496
|
+
optional: true,
|
|
11497
|
+
message: "The tick box that turns the card on touch screens. Leave it empty for Turn over."
|
|
11498
|
+
}
|
|
11499
|
+
]
|
|
11500
|
+
},
|
|
11501
|
+
build: (node, attrs) => {
|
|
11502
|
+
const p = node.props;
|
|
11503
|
+
const heading = `h${p.titleLevel ?? 3}`;
|
|
11504
|
+
const face = (side, title, text, extra = []) => {
|
|
11505
|
+
const children = [];
|
|
11506
|
+
if (title?.trim())
|
|
11507
|
+
children.push({ tag: heading, attrs: { class: "emvb-flip-title" }, children: [title] });
|
|
11508
|
+
if (text?.trim())
|
|
11509
|
+
children.push({ tag: "p", attrs: { class: "emvb-flip-text" }, children: [text] });
|
|
11510
|
+
return {
|
|
11511
|
+
tag: "div",
|
|
11512
|
+
attrs: { class: `emvb-flip-face emvb-flip-${side}` },
|
|
11513
|
+
children: [...children, ...extra]
|
|
11514
|
+
};
|
|
11515
|
+
};
|
|
11516
|
+
const link = linkAttrs(p.href, p.newTab);
|
|
11517
|
+
const button = link && p.buttonText?.trim() ? [{ tag: "a", attrs: { class: "emvb-flip-button", ...link }, children: [p.buttonText] }] : [];
|
|
11518
|
+
return {
|
|
11519
|
+
tag: "div",
|
|
11520
|
+
attrs: {
|
|
11521
|
+
...attrs,
|
|
11522
|
+
class: `${attrs["class"] ?? ""} emvb-flip-${p.direction ?? "right"}`.trim()
|
|
11523
|
+
},
|
|
11524
|
+
children: [
|
|
11525
|
+
{
|
|
11526
|
+
tag: "div",
|
|
11527
|
+
attrs: { class: "emvb-flip-inner" },
|
|
11528
|
+
children: [
|
|
11529
|
+
face("front", p.frontTitle, p.frontText),
|
|
11530
|
+
face("back", p.backTitle, p.backText, button)
|
|
11531
|
+
]
|
|
11532
|
+
},
|
|
11533
|
+
{
|
|
11534
|
+
tag: "label",
|
|
11535
|
+
attrs: { class: "emvb-flip-toggle" },
|
|
11536
|
+
children: [
|
|
11537
|
+
{ tag: "input", attrs: { type: "checkbox", class: "emvb-flip-check" }, children: [] },
|
|
11538
|
+
{ tag: "span", attrs: {}, children: [p.toggleLabel?.trim() || "Turn over"] }
|
|
11539
|
+
]
|
|
11540
|
+
}
|
|
11541
|
+
]
|
|
11542
|
+
};
|
|
11543
|
+
}
|
|
11544
|
+
};
|
|
11545
|
+
var HEADLINE_CIRCLE = "M50 3C20 2 3 10 3 20s20 18 48 17 47-8 46-17S78 3 46 4";
|
|
11546
|
+
var headline = {
|
|
11547
|
+
baseCss: `.emvb-headline{margin:0}.emvb-headline-mark{position:relative;display:inline-block;white-space:nowrap}.emvb-headline-underline .emvb-headline-mark{background:linear-gradient(var(--emvb-headline-mark,#f59e0b),var(--emvb-headline-mark,#f59e0b)) no-repeat 0 92%/100% 0.12em}.emvb-headline-strike .emvb-headline-mark{background:linear-gradient(var(--emvb-headline-mark,#f59e0b),var(--emvb-headline-mark,#f59e0b)) no-repeat 0 55%/100% 0.1em}.emvb-headline-shape{position:absolute;left:-0.25em;top:-0.15em;width:calc(100% + 0.5em);height:calc(100% + 0.3em);overflow:visible;pointer-events:none;color:var(--emvb-headline-mark,#f59e0b)}.emvb-headline-shape path{stroke-dasharray:300;stroke-dashoffset:0}.emvb-headline-pause{margin:0.5em 0 0;padding:0.25em 0.75em;border:1px solid currentColor;border-radius:4px;background:none;color:inherit;font:inherit;font-size:0.875em;cursor:pointer}.emvb-headline-pause:focus-visible{outline:2px solid currentColor;outline-offset:2px}.emvb-headline-sr{${SR_ONLY}}@keyframes emvb-headline-line{from{background-size:0 0.12em}}@keyframes emvb-headline-strike{from{background-size:0 0.1em}}@keyframes emvb-headline-circle{from{stroke-dashoffset:300}}@media (prefers-reduced-motion:no-preference){.emvb-headline-underline .emvb-headline-mark{animation:emvb-headline-line 0.8s ease-out 0.3s both}.emvb-headline-strike .emvb-headline-mark{animation:emvb-headline-strike 0.8s ease-out 0.3s both}.emvb-headline-shape path{animation:emvb-headline-circle 1s ease-out 0.3s both}}`,
|
|
11548
|
+
defaults: () => ({
|
|
11549
|
+
type: "headline",
|
|
11550
|
+
props: {
|
|
11551
|
+
level: 2,
|
|
11552
|
+
before: "We build",
|
|
11553
|
+
highlight: "fast",
|
|
11554
|
+
after: "websites",
|
|
11555
|
+
rotate: ["accessible", "beautiful"]
|
|
11556
|
+
}
|
|
11557
|
+
}),
|
|
11558
|
+
descriptor: {
|
|
11559
|
+
type: "headline",
|
|
11560
|
+
name: "Animated headline",
|
|
11561
|
+
group: "content",
|
|
11562
|
+
defaultTab: "content",
|
|
11563
|
+
fields: [
|
|
11564
|
+
{ key: "before", kind: "text", label: "Before", optional: true },
|
|
11565
|
+
{ key: "highlight", kind: "text", label: "Highlighted words" },
|
|
11566
|
+
{ key: "after", kind: "text", label: "After", optional: true },
|
|
11567
|
+
{
|
|
11568
|
+
key: "level",
|
|
11569
|
+
kind: "select",
|
|
11570
|
+
label: "Level",
|
|
11571
|
+
optional: true,
|
|
11572
|
+
options: [1, 2, 3, 4, 5, 6].map((level) => ({ value: level, label: `H${level}` }))
|
|
11573
|
+
},
|
|
11574
|
+
{
|
|
11575
|
+
key: "mark",
|
|
11576
|
+
kind: "select",
|
|
11577
|
+
label: "Mark",
|
|
11578
|
+
optional: true,
|
|
11579
|
+
options: [
|
|
11580
|
+
{ value: "underline", label: "Underline" },
|
|
11581
|
+
{ value: "circle", label: "Circle" },
|
|
11582
|
+
{ value: "strike", label: "Strike through" },
|
|
11583
|
+
{ value: "none", label: "None" }
|
|
11584
|
+
]
|
|
11585
|
+
},
|
|
11586
|
+
{
|
|
11587
|
+
key: "rotate",
|
|
11588
|
+
kind: "list-items",
|
|
11589
|
+
label: "Other words",
|
|
11590
|
+
optional: true,
|
|
11591
|
+
message: "One per line. They take turns with the highlighted words."
|
|
11592
|
+
},
|
|
11593
|
+
{ key: "rotating", kind: "boolean", label: "Rotate the words", optional: true },
|
|
11594
|
+
{
|
|
11595
|
+
key: "interval",
|
|
11596
|
+
kind: "decimal",
|
|
11597
|
+
label: "Seconds per word",
|
|
11598
|
+
optional: true,
|
|
11599
|
+
min: 1.5,
|
|
11600
|
+
max: 10,
|
|
11601
|
+
message: "From 1.5 to 10 seconds."
|
|
11602
|
+
},
|
|
11603
|
+
{
|
|
11604
|
+
key: "turns",
|
|
11605
|
+
kind: "int",
|
|
11606
|
+
label: "Rounds before it stops",
|
|
11607
|
+
optional: true,
|
|
11608
|
+
min: 1,
|
|
11609
|
+
max: 5
|
|
11610
|
+
}
|
|
11611
|
+
]
|
|
11612
|
+
},
|
|
11613
|
+
build: (node, attrs) => {
|
|
11614
|
+
const p = node.props;
|
|
11615
|
+
const style = p.mark ?? "underline";
|
|
11616
|
+
const words = (p.rotate ?? []).map((w) => w.trim()).filter(Boolean);
|
|
11617
|
+
const rotating = Boolean(p.rotating) && words.length > 0;
|
|
11618
|
+
const markChildren = [p.highlight];
|
|
11619
|
+
if (style === "circle")
|
|
11620
|
+
markChildren.push({
|
|
11621
|
+
tag: "svg",
|
|
11622
|
+
attrs: {
|
|
11623
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
11624
|
+
class: "emvb-headline-shape",
|
|
11625
|
+
viewBox: "0 0 100 40",
|
|
11626
|
+
preserveAspectRatio: "none",
|
|
11627
|
+
fill: "none",
|
|
11628
|
+
stroke: "currentColor",
|
|
11629
|
+
"stroke-width": "2.5",
|
|
11630
|
+
"stroke-linecap": "round",
|
|
11631
|
+
"aria-hidden": "true",
|
|
11632
|
+
focusable: "false"
|
|
11633
|
+
},
|
|
11634
|
+
children: [{ tag: "path", attrs: { d: HEADLINE_CIRCLE }, children: [] }]
|
|
11635
|
+
});
|
|
11636
|
+
const markAttrs = { class: "emvb-headline-mark" };
|
|
11637
|
+
if (rotating) {
|
|
11638
|
+
markAttrs["data-emvb-rotate"] = JSON.stringify([p.highlight, ...words]);
|
|
11639
|
+
markAttrs["data-interval"] = String(p.interval ?? 2.5);
|
|
11640
|
+
markAttrs["data-turns"] = String(p.turns ?? 2);
|
|
11641
|
+
}
|
|
11642
|
+
const children = [];
|
|
11643
|
+
if (p.before?.trim())
|
|
11644
|
+
children.push(`${p.before.trim()} `);
|
|
11645
|
+
children.push({ tag: "span", attrs: markAttrs, children: markChildren });
|
|
11646
|
+
if (p.after?.trim())
|
|
11647
|
+
children.push(` ${p.after.trim()}`);
|
|
11648
|
+
return {
|
|
11649
|
+
tag: `h${p.level ?? 2}`,
|
|
11650
|
+
attrs: { ...attrs, class: `${attrs["class"] ?? ""} emvb-headline-${style}`.trim() },
|
|
11651
|
+
children
|
|
11652
|
+
};
|
|
11653
|
+
}
|
|
11654
|
+
};
|
|
11655
|
+
function shareHref(network, url) {
|
|
11656
|
+
const u = encodeURIComponent(url);
|
|
11657
|
+
switch (network) {
|
|
11658
|
+
case "facebook":
|
|
11659
|
+
return `https://www.facebook.com/sharer/sharer.php?u=${u}`;
|
|
11660
|
+
case "x":
|
|
11661
|
+
return `https://x.com/intent/post?url=${u}`;
|
|
11662
|
+
case "linkedin":
|
|
11663
|
+
return `https://www.linkedin.com/sharing/share-offsite/?url=${u}`;
|
|
11664
|
+
case "whatsapp":
|
|
11665
|
+
return `https://wa.me/?text=${u}`;
|
|
11666
|
+
case "telegram":
|
|
11667
|
+
return `https://t.me/share/url?url=${u}`;
|
|
11668
|
+
case "reddit":
|
|
11669
|
+
return `https://www.reddit.com/submit?url=${u}`;
|
|
11670
|
+
case "bluesky":
|
|
11671
|
+
return `https://bsky.app/intent/compose?text=${u}`;
|
|
11672
|
+
case "threads":
|
|
11673
|
+
return `https://www.threads.net/intent/post?text=${u}`;
|
|
11674
|
+
case "email":
|
|
11675
|
+
return `mailto:?body=${u}`;
|
|
11676
|
+
}
|
|
11677
|
+
}
|
|
11678
|
+
var shareName = (network) => network === "email" ? "Share by email" : `Share on ${SOCIAL_NAMES[network]}`;
|
|
11679
|
+
var shareButtons = {
|
|
11680
|
+
baseCss: ".emvb-share-buttons{display:flex;flex-wrap:wrap;align-items:center;gap:0.5em;margin:0;padding:0;list-style:none;font-size:1.5em}.emvb-share-link{display:flex}.emvb-share-link>a,.emvb-share-native{display:inline-flex;align-items:center;justify-content:center;color:inherit;text-decoration:none}.emvb-share-buttons .emvb-social-svg{display:block;width:1em;height:1em}.emvb-share-brand.emvb-share-plain .emvb-share-link>a{color:var(--emvb-social,currentColor)}.emvb-share-buttons:not(.emvb-share-plain) .emvb-share-link>a{width:2em;height:2em;background:var(--emvb-social,currentColor)}.emvb-share-buttons:not(.emvb-share-plain) .emvb-social-svg{width:1.1em;height:1.1em;color:#fff}.emvb-share-circle .emvb-share-link>a{border-radius:50%}.emvb-share-rounded .emvb-share-link>a{border-radius:0.4em}.emvb-share-link>a:focus-visible,.emvb-share-native:focus-visible{outline:2px solid currentColor;outline-offset:2px}.emvb-share-native{gap:0.375em;padding:0.25em 0.75em;border:1px solid currentColor;border-radius:999px;background:none;font:inherit;font-size:0.6em;cursor:pointer}.emvb-share-buttons:not([data-emvb-ready]) .emvb-share-native-item{display:none}" + SHARE_NETWORKS.map((network) => `.emvb-share-brand .emvb-share-${network}{--emvb-social:${SOCIAL_COLORS[network]}}`).join(""),
|
|
11681
|
+
defaults: () => ({ type: "share-buttons", props: { shape: "circle" }, children: [] }),
|
|
11682
|
+
descriptor: {
|
|
11683
|
+
type: "share-buttons",
|
|
11684
|
+
name: "Share buttons",
|
|
11685
|
+
group: "content",
|
|
11686
|
+
defaultTab: "content",
|
|
11687
|
+
fields: [
|
|
11688
|
+
{
|
|
11689
|
+
key: "label",
|
|
11690
|
+
kind: "text",
|
|
11691
|
+
label: "List name",
|
|
11692
|
+
optional: true,
|
|
11693
|
+
message: "What screen readers call the list. Leave it empty for Share this page."
|
|
11694
|
+
},
|
|
11695
|
+
{
|
|
11696
|
+
key: "shape",
|
|
11697
|
+
kind: "select",
|
|
11698
|
+
label: "Shape",
|
|
11699
|
+
optional: true,
|
|
11700
|
+
options: [
|
|
11701
|
+
{ value: "plain", label: "Icon only" },
|
|
11702
|
+
{ value: "circle", label: "Circle" },
|
|
11703
|
+
{ value: "rounded", label: "Rounded square" },
|
|
11704
|
+
{ value: "square", label: "Square" }
|
|
11705
|
+
]
|
|
11706
|
+
},
|
|
11707
|
+
{ key: "brandColors", kind: "boolean", label: "Brand colours", optional: true },
|
|
11708
|
+
{
|
|
11709
|
+
key: "nativeShare",
|
|
11710
|
+
kind: "boolean",
|
|
11711
|
+
label: "Add the device's Share button where it has one",
|
|
11712
|
+
optional: true
|
|
11713
|
+
}
|
|
11714
|
+
]
|
|
11715
|
+
},
|
|
11716
|
+
build: (node, attrs, children) => {
|
|
11717
|
+
const items = [...children];
|
|
11718
|
+
if (node.props.nativeShare)
|
|
11719
|
+
items.push({
|
|
11720
|
+
tag: "li",
|
|
11721
|
+
attrs: { class: "emvb-share-native-item" },
|
|
11722
|
+
children: [
|
|
11723
|
+
{
|
|
11724
|
+
tag: "button",
|
|
11725
|
+
attrs: { type: "button", class: "emvb-share-native", "data-emvb-share": "" },
|
|
11726
|
+
children: ["Share…"]
|
|
11727
|
+
}
|
|
11728
|
+
]
|
|
11729
|
+
});
|
|
11730
|
+
const classes = [
|
|
11731
|
+
attrs["class"] ?? "",
|
|
11732
|
+
`emvb-share-${node.props.shape ?? "plain"}`,
|
|
11733
|
+
...node.props.brandColors ? ["emvb-share-brand"] : []
|
|
11734
|
+
];
|
|
11735
|
+
return {
|
|
11736
|
+
tag: "ul",
|
|
11737
|
+
attrs: {
|
|
11738
|
+
...attrs,
|
|
11739
|
+
class: classes.join(" ").trim(),
|
|
11740
|
+
"aria-label": node.props.label?.trim() || "Share this page",
|
|
11741
|
+
...node.props.nativeShare ? { "data-emvb-share-list": "" } : {}
|
|
11742
|
+
},
|
|
11743
|
+
children: items
|
|
11744
|
+
};
|
|
11745
|
+
}
|
|
11746
|
+
};
|
|
11747
|
+
function shareLinkVNode(node, attrs, url) {
|
|
11748
|
+
const { network, label } = node.props;
|
|
11749
|
+
const icon = socialSvg(network);
|
|
11750
|
+
const href = sanitizeHref(shareHref(network, url)) ?? "#";
|
|
11751
|
+
return {
|
|
11752
|
+
tag: "li",
|
|
11753
|
+
attrs: { ...attrs, class: `${attrs["class"] ?? ""} emvb-share-${network}`.trim() },
|
|
11754
|
+
children: [
|
|
11755
|
+
{
|
|
11756
|
+
tag: "a",
|
|
11757
|
+
attrs: {
|
|
11758
|
+
href,
|
|
11759
|
+
"aria-label": label?.trim() || shareName(network),
|
|
11760
|
+
...network === "email" ? {} : { target: "_blank", rel: "noopener noreferrer" }
|
|
11761
|
+
},
|
|
11762
|
+
children: icon ? [icon] : []
|
|
11763
|
+
}
|
|
11764
|
+
]
|
|
11765
|
+
};
|
|
11766
|
+
}
|
|
11767
|
+
var shareLink = {
|
|
11768
|
+
baseCss: "",
|
|
11769
|
+
defaults: () => ({ type: "share-link", props: { network: "facebook" } }),
|
|
11770
|
+
descriptor: {
|
|
11771
|
+
type: "share-link",
|
|
11772
|
+
name: "Share link",
|
|
11773
|
+
group: "content",
|
|
11774
|
+
defaultTab: "content",
|
|
11775
|
+
fields: [
|
|
11776
|
+
{
|
|
11777
|
+
key: "network",
|
|
11778
|
+
kind: "select",
|
|
11779
|
+
label: "Share to",
|
|
11780
|
+
options: SHARE_NETWORKS.map((value) => ({
|
|
11781
|
+
value,
|
|
11782
|
+
label: value === "email" ? "Email" : SOCIAL_NAMES[value]
|
|
11783
|
+
}))
|
|
11784
|
+
},
|
|
11785
|
+
{
|
|
11786
|
+
key: "label",
|
|
11787
|
+
kind: "text",
|
|
11788
|
+
label: "Name for screen readers",
|
|
11789
|
+
optional: true,
|
|
11790
|
+
message: "Leave it empty for Share on and the service's name."
|
|
11791
|
+
}
|
|
11792
|
+
]
|
|
11793
|
+
},
|
|
11794
|
+
build: (node, attrs) => shareLinkVNode(node, attrs, "https://example.com/")
|
|
11795
|
+
};
|
|
11796
|
+
var hotspots = {
|
|
11797
|
+
baseCss: ".emvb-hotspots{position:relative;margin:0;line-height:0}.emvb-hotspots-image{display:block;width:100%;height:auto}.emvb-hotspots-list{margin:0;padding:0;list-style:none;counter-reset:emvb-hotspot}.emvb-hotspot{position:absolute;line-height:1.4;counter-increment:emvb-hotspot;transform:translate(-50%,-50%)}.emvb-hotspot-button{display:flex;align-items:center;justify-content:center;width:2em;height:2em;padding:0;border:2px solid #fff;border-radius:50%;background:#1f2937;color:#fff;font:inherit;font-weight:700;box-shadow:0 1px 4px rgb(0 0 0 / 0.4);cursor:pointer}.emvb-hotspot-button::before{content:counter(emvb-hotspot)}.emvb-hotspot-button:focus-visible{outline:3px solid #fff;outline-offset:2px}.emvb-hotspot-note{max-width:min(20em,90vw);margin:auto;padding:0.75em 1em;border:1px solid rgb(0 0 0 / 0.2);border-radius:8px;background:#fff;color:#1f2937;line-height:1.4;box-shadow:0 4px 16px rgb(0 0 0 / 0.2)}.emvb-hotspot-title{margin:0;font-weight:600}.emvb-hotspot-text{margin:0.25em 0 0;white-space:pre-line}@supports (position-area:bottom){.emvb-hotspot-note{margin:0.5em;position-area:bottom;position-try-fallbacks:flip-block,flip-inline}}",
|
|
11798
|
+
defaults: () => ({ type: "hotspots", props: { src: "", alt: "Image" }, children: [] }),
|
|
11799
|
+
descriptor: {
|
|
11800
|
+
type: "hotspots",
|
|
11801
|
+
name: "Hotspots",
|
|
11802
|
+
group: "content",
|
|
11803
|
+
defaultTab: "content",
|
|
11804
|
+
fields: [
|
|
11805
|
+
{ key: "src", kind: "media", label: "Picture" },
|
|
11806
|
+
{ key: "alt", kind: "text", label: "Alt text" },
|
|
11807
|
+
{ key: "decorative", kind: "boolean", label: "Decorative", optional: true },
|
|
11808
|
+
{
|
|
11809
|
+
key: "label",
|
|
11810
|
+
kind: "text",
|
|
11811
|
+
label: "Markers list name",
|
|
10292
11812
|
optional: true,
|
|
10293
|
-
|
|
10294
|
-
max: 30,
|
|
10295
|
-
message: "From 3 to 30 seconds. Leave it empty for 6."
|
|
11813
|
+
message: "What screen readers call the markers. Leave it empty for Points on the picture."
|
|
10296
11814
|
}
|
|
10297
11815
|
]
|
|
10298
11816
|
},
|
|
10299
11817
|
build: (node, attrs, children) => {
|
|
10300
|
-
const
|
|
10301
|
-
const
|
|
10302
|
-
const
|
|
10303
|
-
|
|
10304
|
-
|
|
10305
|
-
|
|
10306
|
-
|
|
10307
|
-
|
|
10308
|
-
|
|
10309
|
-
|
|
10310
|
-
|
|
10311
|
-
|
|
11818
|
+
const p = node.props;
|
|
11819
|
+
const src = p.src.trim() ? sanitizeMediaUrl(p.src.trim()) : undefined;
|
|
11820
|
+
const image = src ? [
|
|
11821
|
+
{
|
|
11822
|
+
tag: "img",
|
|
11823
|
+
attrs: {
|
|
11824
|
+
class: "emvb-hotspots-image",
|
|
11825
|
+
src,
|
|
11826
|
+
alt: p.decorative ? "" : p.alt,
|
|
11827
|
+
...p.width ? { width: String(p.width) } : {},
|
|
11828
|
+
...p.height ? { height: String(p.height) } : {},
|
|
11829
|
+
loading: "lazy",
|
|
11830
|
+
decoding: "async"
|
|
11831
|
+
},
|
|
11832
|
+
children: []
|
|
11833
|
+
}
|
|
11834
|
+
] : [];
|
|
10312
11835
|
return {
|
|
10313
|
-
tag: "
|
|
10314
|
-
attrs
|
|
10315
|
-
...attrs,
|
|
10316
|
-
class: `${attrs["class"] ?? ""} emvb-carousel-per-${perView ?? 1}`.trim(),
|
|
10317
|
-
"aria-roledescription": "carousel",
|
|
10318
|
-
"aria-label": label?.trim() || "Carousel",
|
|
10319
|
-
...options
|
|
10320
|
-
},
|
|
11836
|
+
tag: "div",
|
|
11837
|
+
attrs,
|
|
10321
11838
|
children: [
|
|
11839
|
+
...image,
|
|
10322
11840
|
{
|
|
10323
|
-
tag: "
|
|
11841
|
+
tag: "ol",
|
|
10324
11842
|
attrs: {
|
|
10325
|
-
class: "emvb-
|
|
10326
|
-
|
|
10327
|
-
"aria-live": autoplay ? "off" : "polite"
|
|
11843
|
+
class: "emvb-hotspots-list",
|
|
11844
|
+
"aria-label": p.label?.trim() || "Points on the picture"
|
|
10328
11845
|
},
|
|
10329
|
-
children
|
|
11846
|
+
children
|
|
10330
11847
|
}
|
|
10331
11848
|
]
|
|
10332
11849
|
};
|
|
10333
11850
|
}
|
|
10334
11851
|
};
|
|
10335
|
-
var
|
|
11852
|
+
var hotspot = {
|
|
10336
11853
|
baseCss: "",
|
|
10337
|
-
defaults: () => ({ type: "
|
|
11854
|
+
defaults: () => ({ type: "hotspot", props: { title: "Point", x: 50, y: 50 } }),
|
|
10338
11855
|
descriptor: {
|
|
10339
|
-
type: "
|
|
10340
|
-
name: "
|
|
10341
|
-
group: "
|
|
11856
|
+
type: "hotspot",
|
|
11857
|
+
name: "Hotspot",
|
|
11858
|
+
group: "content",
|
|
10342
11859
|
defaultTab: "content",
|
|
10343
11860
|
fields: [
|
|
11861
|
+
{ key: "title", kind: "text", label: "Title" },
|
|
11862
|
+
{ key: "text", kind: "textarea", label: "Note", optional: true },
|
|
10344
11863
|
{
|
|
10345
|
-
key: "
|
|
10346
|
-
kind: "
|
|
10347
|
-
label: "
|
|
10348
|
-
|
|
10349
|
-
message: "
|
|
10350
|
-
}
|
|
11864
|
+
key: "x",
|
|
11865
|
+
kind: "decimal",
|
|
11866
|
+
label: "Across (%)",
|
|
11867
|
+
max: 100,
|
|
11868
|
+
message: "From 0 (left edge) to 100 (right edge)."
|
|
11869
|
+
},
|
|
11870
|
+
{
|
|
11871
|
+
key: "y",
|
|
11872
|
+
kind: "decimal",
|
|
11873
|
+
label: "Down (%)",
|
|
11874
|
+
max: 100,
|
|
11875
|
+
message: "From 0 (top) to 100 (bottom)."
|
|
11876
|
+
},
|
|
11877
|
+
{ key: "xTablet", kind: "decimal", label: "Across on tablets (%)", optional: true, max: 100 },
|
|
11878
|
+
{ key: "yTablet", kind: "decimal", label: "Down on tablets (%)", optional: true, max: 100 },
|
|
11879
|
+
{ key: "xMobile", kind: "decimal", label: "Across on phones (%)", optional: true, max: 100 },
|
|
11880
|
+
{ key: "yMobile", kind: "decimal", label: "Down on phones (%)", optional: true, max: 100 }
|
|
10351
11881
|
]
|
|
10352
11882
|
},
|
|
10353
|
-
build: (node, attrs
|
|
10354
|
-
|
|
10355
|
-
|
|
10356
|
-
|
|
10357
|
-
|
|
10358
|
-
"
|
|
10359
|
-
|
|
10360
|
-
|
|
10361
|
-
|
|
10362
|
-
|
|
11883
|
+
build: (node, attrs) => {
|
|
11884
|
+
const { title, text } = node.props;
|
|
11885
|
+
const noteId = `emvb-hotspot-${node.id}`;
|
|
11886
|
+
const note = [{ tag: "p", attrs: { class: "emvb-hotspot-title" }, children: [title] }];
|
|
11887
|
+
if (text?.trim())
|
|
11888
|
+
note.push({ tag: "p", attrs: { class: "emvb-hotspot-text" }, children: [text] });
|
|
11889
|
+
const marker = [
|
|
11890
|
+
{
|
|
11891
|
+
tag: "button",
|
|
11892
|
+
attrs: {
|
|
11893
|
+
type: "button",
|
|
11894
|
+
class: "emvb-hotspot-button",
|
|
11895
|
+
popovertarget: noteId,
|
|
11896
|
+
"aria-label": title
|
|
11897
|
+
},
|
|
11898
|
+
children: []
|
|
11899
|
+
},
|
|
11900
|
+
{
|
|
11901
|
+
tag: "div",
|
|
11902
|
+
attrs: { id: noteId, class: "emvb-hotspot-note", popover: "auto" },
|
|
11903
|
+
children: note
|
|
11904
|
+
}
|
|
11905
|
+
];
|
|
11906
|
+
return { tag: "li", attrs, children: marker };
|
|
11907
|
+
}
|
|
10363
11908
|
};
|
|
10364
11909
|
|
|
10365
11910
|
// ../emvb/src/core/elements/select-prompt.ts
|
|
@@ -11812,6 +13357,20 @@ var ELEMENTS = {
|
|
|
11812
13357
|
"gallery-image": galleryImage,
|
|
11813
13358
|
carousel,
|
|
11814
13359
|
"carousel-slide": carouselSlide,
|
|
13360
|
+
counter,
|
|
13361
|
+
progress,
|
|
13362
|
+
countdown,
|
|
13363
|
+
map,
|
|
13364
|
+
"price-table": priceTable,
|
|
13365
|
+
"price-list": priceList,
|
|
13366
|
+
"price-list-item": priceListItem,
|
|
13367
|
+
cta,
|
|
13368
|
+
"flip-box": flipBox,
|
|
13369
|
+
headline,
|
|
13370
|
+
"share-buttons": shareButtons,
|
|
13371
|
+
"share-link": shareLink,
|
|
13372
|
+
hotspots,
|
|
13373
|
+
hotspot,
|
|
11815
13374
|
container,
|
|
11816
13375
|
"layout-section": layoutSection,
|
|
11817
13376
|
spacer,
|
|
@@ -12679,6 +14238,15 @@ var REASONS = {
|
|
|
12679
14238
|
slideOutsideCarousel: "Slides can only go inside a Carousel.",
|
|
12680
14239
|
onlySlides: "A carousel can only hold slides.",
|
|
12681
14240
|
tooManySlides: `A carousel can hold up to ${MAX_CAROUSEL_SLIDES} slides.`,
|
|
14241
|
+
itemOutsidePriceList: "Price list items can only go inside a Price list.",
|
|
14242
|
+
onlyPriceItems: "A price list can only hold price list items.",
|
|
14243
|
+
tooManyPriceItems: `A price list can hold up to ${MAX_PRICE_ITEMS} items.`,
|
|
14244
|
+
shareOutsideButtons: "Share links can only go inside Share buttons.",
|
|
14245
|
+
onlyShareLinks: "Share buttons can only hold share links.",
|
|
14246
|
+
tooManyShareLinks: `Share buttons can hold up to ${MAX_SHARE_LINKS} links.`,
|
|
14247
|
+
hotspotOutsidePicture: "Hotspots can only go inside a Hotspots picture.",
|
|
14248
|
+
onlyHotspots: "A Hotspots picture can only hold hotspots.",
|
|
14249
|
+
tooManyHotspots: `A Hotspots picture can hold up to ${MAX_HOTSPOTS} markers.`,
|
|
12682
14250
|
emptyOutsideLoop: "An Empty state can only go inside a Loop."
|
|
12683
14251
|
};
|
|
12684
14252
|
var refuse = (reason) => ({ ok: false, reason });
|
|
@@ -12756,6 +14324,23 @@ function parentChildRefusal(parent, child, inForm) {
|
|
|
12756
14324
|
}
|
|
12757
14325
|
if (parent.type === "carousel" && child.type !== "carousel-slide")
|
|
12758
14326
|
return REASONS.onlySlides;
|
|
14327
|
+
if (child.type === "price-list-item" && parent.type !== "price-list") {
|
|
14328
|
+
return REASONS.itemOutsidePriceList;
|
|
14329
|
+
}
|
|
14330
|
+
if (parent.type === "price-list" && child.type !== "price-list-item") {
|
|
14331
|
+
return REASONS.onlyPriceItems;
|
|
14332
|
+
}
|
|
14333
|
+
if (child.type === "share-link" && parent.type !== "share-buttons") {
|
|
14334
|
+
return REASONS.shareOutsideButtons;
|
|
14335
|
+
}
|
|
14336
|
+
if (parent.type === "share-buttons" && child.type !== "share-link") {
|
|
14337
|
+
return REASONS.onlyShareLinks;
|
|
14338
|
+
}
|
|
14339
|
+
if (child.type === "hotspot" && parent.type !== "hotspots") {
|
|
14340
|
+
return REASONS.hotspotOutsidePicture;
|
|
14341
|
+
}
|
|
14342
|
+
if (parent.type === "hotspots" && child.type !== "hotspot")
|
|
14343
|
+
return REASONS.onlyHotspots;
|
|
12759
14344
|
if (isFormNode(child) && inForm)
|
|
12760
14345
|
return REASONS.nestedForm;
|
|
12761
14346
|
if (isFormFieldType(child.type) && !inForm)
|
|
@@ -12780,6 +14365,18 @@ var DROP_RULES = [
|
|
|
12780
14365
|
({ node, into }) => into.node.type === "carousel" && !nodeChildren(into.node).some((child) => child.id === node.id) && nodeChildren(into.node).length >= MAX_CAROUSEL_SLIDES,
|
|
12781
14366
|
REASONS.tooManySlides
|
|
12782
14367
|
],
|
|
14368
|
+
[
|
|
14369
|
+
({ node, into }) => into.node.type === "price-list" && !nodeChildren(into.node).some((child) => child.id === node.id) && nodeChildren(into.node).length >= MAX_PRICE_ITEMS,
|
|
14370
|
+
REASONS.tooManyPriceItems
|
|
14371
|
+
],
|
|
14372
|
+
[
|
|
14373
|
+
({ node, into }) => into.node.type === "share-buttons" && !nodeChildren(into.node).some((child) => child.id === node.id) && nodeChildren(into.node).length >= MAX_SHARE_LINKS,
|
|
14374
|
+
REASONS.tooManyShareLinks
|
|
14375
|
+
],
|
|
14376
|
+
[
|
|
14377
|
+
({ node, into }) => into.node.type === "hotspots" && !nodeChildren(into.node).some((child) => child.id === node.id) && nodeChildren(into.node).length >= MAX_HOTSPOTS,
|
|
14378
|
+
REASONS.tooManyHotspots
|
|
14379
|
+
],
|
|
12783
14380
|
[({ node, into }) => into.depth + height(node) > MAX_DEPTH, REASONS.tooDeep],
|
|
12784
14381
|
[
|
|
12785
14382
|
({ node, layout, isNew }) => isNew && size(layout.root) + size(node) > MAX_NODES,
|
|
@@ -13718,7 +15315,7 @@ var TAGS = new Set([
|
|
|
13718
15315
|
"tspan"
|
|
13719
15316
|
]);
|
|
13720
15317
|
var VOID = new Set(["hr", "img", "input", "br"]);
|
|
13721
|
-
var ATTR_NAME = /^(?:class|id|href|src|srcset|sizes|alt|width|height|loading|decoding|fetchpriority|dir|lang|hreflang|role|type|checked|target|rel|aria-[a-z][a-z0-9-]*|title|allow|referrerpolicy|preload|controls|allowfullscreen|sandbox|xmlns|viewBox|fill|stroke|stroke-width|stroke-linecap|stroke-linejoin|stroke-dasharray|stroke-opacity|fill-opacity|opacity|transform|focusable|d|cx|cy|r|x|y|x1|y1|x2|y2|points|rx|ry|xlink:href|preserveAspectRatio|gradientUnits|gradientTransform|offset|stop-color|stop-opacity|clipPathUnits|maskUnits|maskContentUnits|patternUnits|patternContentUnits|patternTransform|markerUnits|markerWidth|markerHeight|refX|refY|orient|font-size|font-family|font-weight|text-anchor|dominant-baseline|dx|dy|clip-path|mask|method|action|name|value|placeholder|for|tabindex|autocomplete|open|datetime|muted|loop|playsinline|autoplay|required|novalidate|minlength|maxlength|min|max|pattern|step|start|data-[a-z][a-z0-9-]*)$/;
|
|
15318
|
+
var ATTR_NAME = /^(?:class|id|href|src|srcset|sizes|alt|width|height|loading|decoding|fetchpriority|dir|lang|hreflang|role|type|checked|target|rel|aria-[a-z][a-z0-9-]*|title|allow|referrerpolicy|preload|controls|allowfullscreen|sandbox|xmlns|viewBox|fill|stroke|stroke-width|stroke-linecap|stroke-linejoin|stroke-dasharray|stroke-opacity|fill-opacity|opacity|transform|focusable|d|cx|cy|r|x|y|x1|y1|x2|y2|points|rx|ry|xlink:href|preserveAspectRatio|gradientUnits|gradientTransform|offset|stop-color|stop-opacity|clipPathUnits|maskUnits|maskContentUnits|patternUnits|patternContentUnits|patternTransform|markerUnits|markerWidth|markerHeight|refX|refY|orient|font-size|font-family|font-weight|text-anchor|dominant-baseline|dx|dy|clip-path|mask|method|action|name|value|placeholder|for|tabindex|autocomplete|open|popover|popovertarget|popovertargetaction|datetime|muted|loop|playsinline|autoplay|required|novalidate|minlength|maxlength|min|max|pattern|step|start|data-[a-z][a-z0-9-]*)$/;
|
|
13722
15319
|
class RefusedMarkup extends Error {
|
|
13723
15320
|
}
|
|
13724
15321
|
function write(node, inner) {
|
|
@@ -14230,7 +15827,7 @@ function px(value, design) {
|
|
|
14230
15827
|
}
|
|
14231
15828
|
var HEADING_PX = [32, 24, 18.72, 16, 13.28, 10.72];
|
|
14232
15829
|
var headingLevel = (node) => {
|
|
14233
|
-
if (node.type !== "heading")
|
|
15830
|
+
if (node.type !== "heading" && node.type !== "headline")
|
|
14234
15831
|
return;
|
|
14235
15832
|
const level = node.props.level;
|
|
14236
15833
|
return typeof level === "number" && level >= 1 && level <= 6 ? level : 2;
|
|
@@ -14329,7 +15926,7 @@ function auditPage(layout, design) {
|
|
|
14329
15926
|
severity: "error",
|
|
14330
15927
|
message: "This image is a link but is marked decorative, so the link has no name."
|
|
14331
15928
|
});
|
|
14332
|
-
} else if ((node.type === "image" || (node.type === "image-box" || node.type === "gallery-image") && spoken(props["src"])) && props["decorative"] !== true) {
|
|
15929
|
+
} else if ((node.type === "image" || (node.type === "image-box" || node.type === "gallery-image" || node.type === "hotspots") && spoken(props["src"])) && props["decorative"] !== true) {
|
|
14333
15930
|
const alt = typeof props["alt"] === "string" ? spoken(props["alt"]) : "";
|
|
14334
15931
|
if (USELESS_ALT.test(alt)) {
|
|
14335
15932
|
add({
|
|
@@ -14513,6 +16110,22 @@ function auditPage(layout, design) {
|
|
|
14513
16110
|
message: "This alert has no title or text, so it shows an empty box and says nothing."
|
|
14514
16111
|
});
|
|
14515
16112
|
}
|
|
16113
|
+
if (node.type === "progress" && !spoken(props["label"]) && !node.bind) {
|
|
16114
|
+
add({
|
|
16115
|
+
nodeId: node.id,
|
|
16116
|
+
rule: "control-name",
|
|
16117
|
+
severity: "warning",
|
|
16118
|
+
message: `This progress bar has no title, so screen readers can't say what it measures. Add a title such as "Design".`
|
|
16119
|
+
});
|
|
16120
|
+
}
|
|
16121
|
+
if (node.type === "counter" && !spoken(props["title"]) && !node.bind) {
|
|
16122
|
+
add({
|
|
16123
|
+
nodeId: node.id,
|
|
16124
|
+
rule: "counter-title",
|
|
16125
|
+
severity: "warning",
|
|
16126
|
+
message: `This counter has no title, so its number doesn't say what it counts. Add a title such as "Happy clients".`
|
|
16127
|
+
});
|
|
16128
|
+
}
|
|
14516
16129
|
if (node.type === "heading" && !spoken(props["text"]) && !node.bind) {
|
|
14517
16130
|
add({
|
|
14518
16131
|
nodeId: node.id,
|
|
@@ -14521,7 +16134,7 @@ function auditPage(layout, design) {
|
|
|
14521
16134
|
message: "This heading is empty; screen readers list it as a heading with no words."
|
|
14522
16135
|
});
|
|
14523
16136
|
}
|
|
14524
|
-
if (node.type === "heading") {
|
|
16137
|
+
if (node.type === "heading" || node.type === "headline") {
|
|
14525
16138
|
const level = typeof props["level"] === "number" ? props["level"] : 2;
|
|
14526
16139
|
if (level === 1) {
|
|
14527
16140
|
h1s = h1s.map((count, i) => count + (shownOn[i] ? 1 : 0));
|
|
@@ -14955,6 +16568,8 @@ function recipeNode(id, design, layout, random = Math.random) {
|
|
|
14955
16568
|
var MAX_UNPACKED_BYTES = MAX_LAYOUT_BYTES + MAX_DESIGN_BYTES + 4096;
|
|
14956
16569
|
// ../emvb/src/core/canvas-collections.ts
|
|
14957
16570
|
var OWN = new Set(["emvb_pages", "emvb_theme_parts"]);
|
|
16571
|
+
var KEY2 = Symbol.for("emvb.canvasCollections");
|
|
16572
|
+
var WARNED = Symbol.for("emvb.canvasCollectionsWarned");
|
|
14958
16573
|
// ../emvb/src/core/saved-sections.ts
|
|
14959
16574
|
var SAVED_SECTION_VERSION = 1;
|
|
14960
16575
|
var SAVED_SECTION_NAME_MAX = 60;
|
|
@@ -16059,7 +17674,7 @@ function plain(value) {
|
|
|
16059
17674
|
const text = cleanText(decodeEntities2(raw.replace(/<br\s*\/?>/gi, " ").replace(/<[^>]*>/g, "")));
|
|
16060
17675
|
return { text, hadMarkup };
|
|
16061
17676
|
}
|
|
16062
|
-
var
|
|
17677
|
+
var short2 = (text, max = MAX_TEXT_LENGTH) => text.slice(0, max);
|
|
16063
17678
|
function href(value, ctx) {
|
|
16064
17679
|
const l = link2(value);
|
|
16065
17680
|
if (!l)
|
|
@@ -16302,7 +17917,7 @@ var heading3 = (s, ctx, el) => {
|
|
|
16302
17917
|
...marks.length > 0 ? { marks } : {}
|
|
16303
17918
|
}), ds));
|
|
16304
17919
|
if (linkProps.href)
|
|
16305
|
-
return [styled(node2(ctx, "link", { text:
|
|
17920
|
+
return [styled(node2(ctx, "link", { text: short2(text), ...linkProps }), ds)];
|
|
16306
17921
|
return splitLong(text).map((part) => styled(node2(ctx, "text", { text: part, tag: tag === "div" ? "div" : "p" }), ds));
|
|
16307
17922
|
};
|
|
16308
17923
|
var textEditor = (s, ctx, el) => {
|
|
@@ -16383,7 +17998,7 @@ function buttonNode(s, ctx, el, keys = {
|
|
|
16383
17998
|
link: "link",
|
|
16384
17999
|
icon: "selected_icon"
|
|
16385
18000
|
}) {
|
|
16386
|
-
const text =
|
|
18001
|
+
const text = short2(plain(s[keys.text]).text);
|
|
16387
18002
|
if (!text)
|
|
16388
18003
|
return;
|
|
16389
18004
|
const size = BUTTON_SIZES[str(s["size"]) ?? "sm"] ?? SMALL_BUTTON;
|
|
@@ -16540,13 +18155,13 @@ function mediaBox2(media, s, ctx, el) {
|
|
|
16540
18155
|
const linkProps = href(s["link"], ctx);
|
|
16541
18156
|
const children = [];
|
|
16542
18157
|
if (title) {
|
|
16543
|
-
children.push(styled(node2(ctx, "heading", { text:
|
|
18158
|
+
children.push(styled(node2(ctx, "heading", { text: short2(title), level, ...linkProps }), deviceStyles2(s, ctx, el, [
|
|
16544
18159
|
typographyReader("title_typography", "primary"),
|
|
16545
18160
|
textReader("title_color", "primary", "text_align")
|
|
16546
18161
|
])));
|
|
16547
18162
|
}
|
|
16548
18163
|
if (description) {
|
|
16549
|
-
children.push(styled(node2(ctx, "text", { text:
|
|
18164
|
+
children.push(styled(node2(ctx, "text", { text: short2(description) }), deviceStyles2(s, ctx, el, [
|
|
16550
18165
|
typographyReader("description_typography", "text"),
|
|
16551
18166
|
textReader("description_color", "text", "text_align")
|
|
16552
18167
|
])));
|
|
@@ -16570,9 +18185,9 @@ function mediaBoxProps(s, ctx) {
|
|
|
16570
18185
|
const position = str(s["position"]);
|
|
16571
18186
|
const linkProps = href(s["link"], ctx);
|
|
16572
18187
|
return {
|
|
16573
|
-
title:
|
|
18188
|
+
title: short2(plain(s["title_text"]).text, 200),
|
|
16574
18189
|
...level === 3 ? {} : { titleLevel: Math.max(2, level) },
|
|
16575
|
-
text:
|
|
18190
|
+
text: short2(plain(s["description_text"]).text),
|
|
16576
18191
|
...position === "left" || position === "right" ? { position } : {},
|
|
16577
18192
|
...linkProps
|
|
16578
18193
|
};
|
|
@@ -16644,7 +18259,7 @@ var iconList = (s, ctx, el) => {
|
|
|
16644
18259
|
for (const raw of items) {
|
|
16645
18260
|
if (!isRecord2(raw) || ctx.overBudget)
|
|
16646
18261
|
continue;
|
|
16647
|
-
const text =
|
|
18262
|
+
const text = short2(plain(raw["text"]).text);
|
|
16648
18263
|
if (!text)
|
|
16649
18264
|
continue;
|
|
16650
18265
|
const linkProps = href(raw["link"], ctx);
|
|
@@ -16697,61 +18312,46 @@ var video2 = (s, ctx, el) => {
|
|
|
16697
18312
|
return [];
|
|
16698
18313
|
return [node2(ctx, "video", { url: safe, title: "Video" })];
|
|
16699
18314
|
};
|
|
16700
|
-
var
|
|
16701
|
-
|
|
16702
|
-
const
|
|
16703
|
-
const
|
|
16704
|
-
const
|
|
16705
|
-
|
|
16706
|
-
const
|
|
16707
|
-
|
|
16708
|
-
|
|
16709
|
-
|
|
16710
|
-
]))
|
|
16711
|
-
];
|
|
18315
|
+
var clamp2 = (n) => Math.min(1000000000000, Math.max(-1000000000000, n));
|
|
18316
|
+
var counter2 = (s, ctx, el) => {
|
|
18317
|
+
const end = clamp2(num2(s["ending_number"]) ?? 100);
|
|
18318
|
+
const start = clamp2(num2(s["starting_number"]) ?? 0);
|
|
18319
|
+
const sep = str(s["thousand_separator_char"]);
|
|
18320
|
+
const separator = s["thousand_separator"] === "yes" || s["thousand_separator"] === undefined && sep ? sep === "." || sep === "'" ? sep : sep === " " || sep === "space" ? " " : "," : undefined;
|
|
18321
|
+
const decimals = (String(end).split(".")[1] ?? "").length;
|
|
18322
|
+
const duration = num2(s["duration"]) ?? 2000;
|
|
18323
|
+
if (duration > 5000)
|
|
18324
|
+
ctx.note("approximated", el, "Counters count up in 5 seconds at most.");
|
|
16712
18325
|
const title = plain(s["title"]).text;
|
|
16713
|
-
if (title) {
|
|
16714
|
-
children.push(styled(node2(ctx, "text", { text: short(title), tag: "div" }, { style: { fontSize: { value: 19, unit: "px" } } }), deviceStyles2(s, ctx, el, [
|
|
16715
|
-
typographyReader("typography_title", "secondary"),
|
|
16716
|
-
textReader("title_color", "secondary")
|
|
16717
|
-
])));
|
|
16718
|
-
}
|
|
16719
18326
|
return [
|
|
16720
|
-
|
|
16721
|
-
|
|
16722
|
-
|
|
16723
|
-
|
|
16724
|
-
|
|
18327
|
+
styled(node2(ctx, "counter", {
|
|
18328
|
+
value: end,
|
|
18329
|
+
...start !== 0 ? { start } : {},
|
|
18330
|
+
...decimals ? { decimals: Math.min(3, decimals) } : {},
|
|
18331
|
+
...separator ? { separator } : {},
|
|
18332
|
+
...plain(s["prefix"]).text ? { prefix: plain(s["prefix"]).text.slice(0, 20) } : {},
|
|
18333
|
+
...plain(s["suffix"]).text ? { suffix: plain(s["suffix"]).text.slice(0, 20) } : {},
|
|
18334
|
+
...title ? { title: title.slice(0, 200) } : {},
|
|
18335
|
+
countUp: true,
|
|
18336
|
+
duration: Math.min(5000, Math.max(300, Math.round(duration)))
|
|
18337
|
+
}), deviceStyles2(s, ctx, el, [textReader("number_color", "primary")]))
|
|
16725
18338
|
];
|
|
16726
18339
|
};
|
|
16727
|
-
var
|
|
16728
|
-
const percent = Math.min(100, Math.max(0,
|
|
16729
|
-
const bar = colorAt(s, "bar_color", ctx) ?? (ctx.useDefaults ? ctx.globalColor("primary") : undefined) ?? "#6ec1e4";
|
|
16730
|
-
const children = [];
|
|
18340
|
+
var progress2 = (s, ctx, el) => {
|
|
18341
|
+
const percent = Math.min(100, Math.max(0, num2(isRecord2(s["percent"]) ? s["percent"]["size"] : s["percent"]) ?? 50));
|
|
16731
18342
|
const title = plain(s["title"]).text;
|
|
16732
|
-
if (
|
|
16733
|
-
|
|
16734
|
-
const
|
|
16735
|
-
|
|
16736
|
-
node2(ctx, "
|
|
16737
|
-
|
|
16738
|
-
|
|
16739
|
-
|
|
16740
|
-
|
|
16741
|
-
|
|
16742
|
-
})
|
|
16743
|
-
]
|
|
16744
|
-
width: { value: percent, unit: "%" },
|
|
16745
|
-
minHeight: { value: 30, unit: "px" },
|
|
16746
|
-
backgroundColor: bar,
|
|
16747
|
-
justifyContent: "center"
|
|
16748
|
-
});
|
|
16749
|
-
children.push(box(ctx, [fill], {
|
|
16750
|
-
backgroundColor: colorAt(s, "bar_bg_color", ctx) ?? "#eeeeee",
|
|
16751
|
-
minHeight: { value: 30, unit: "px" }
|
|
16752
|
-
}));
|
|
16753
|
-
ctx.note("approximated", el, "Progress bars are shown filled, without their animation.");
|
|
16754
|
-
return [box(ctx, children, { gap: { value: 8, unit: "px" } })];
|
|
18343
|
+
if (plain(s["inner_text"]).text)
|
|
18344
|
+
ctx.note("approximated", el, "Text inside progress bars was left out; the title stays.");
|
|
18345
|
+
const bar = colorAt(s, "bar_color", ctx) ?? (ctx.useDefaults ? ctx.globalColor("primary") : undefined) ?? "#6ec1e4";
|
|
18346
|
+
return [
|
|
18347
|
+
node2(ctx, "progress", {
|
|
18348
|
+
value: Math.round(percent * 100) / 100,
|
|
18349
|
+
...title ? { label: title.slice(0, 120) } : {},
|
|
18350
|
+
...str(s["display_percentage"]) === "hide" ? {} : { showValue: true },
|
|
18351
|
+
thickness: 30,
|
|
18352
|
+
grow: true
|
|
18353
|
+
}, { style: { color: bar } })
|
|
18354
|
+
];
|
|
16755
18355
|
};
|
|
16756
18356
|
var testimonial2 = (s, ctx, el) => {
|
|
16757
18357
|
const quote = plain(s["testimonial_content"]).text;
|
|
@@ -16772,9 +18372,9 @@ var testimonial2 = (s, ctx, el) => {
|
|
|
16772
18372
|
ctx.note("approximated", el, "Testimonials keep one text style; name and job colours and fonts were simplified.");
|
|
16773
18373
|
return [
|
|
16774
18374
|
node2(ctx, "testimonial", {
|
|
16775
|
-
quote:
|
|
16776
|
-
name:
|
|
16777
|
-
...job ? { role:
|
|
18375
|
+
quote: short2(quote),
|
|
18376
|
+
name: short2(name, 200),
|
|
18377
|
+
...job ? { role: short2(job, 200) } : {},
|
|
16778
18378
|
...Object.fromEntries(["src", "alt", "mediaId", "width", "height"].filter((key) => photo[key] !== undefined).map((key) => [key, photo[key]]))
|
|
16779
18379
|
}, { style })
|
|
16780
18380
|
];
|
|
@@ -16794,7 +18394,7 @@ var starRating = (s, ctx, el) => {
|
|
|
16794
18394
|
if (!title)
|
|
16795
18395
|
return [rating];
|
|
16796
18396
|
return [
|
|
16797
|
-
box(ctx, [node2(ctx, "text", { text:
|
|
18397
|
+
box(ctx, [node2(ctx, "text", { text: short2(title) }), rating], {
|
|
16798
18398
|
flexDirection: "row",
|
|
16799
18399
|
alignItems: "center",
|
|
16800
18400
|
gap: { value: 8, unit: "px" }
|
|
@@ -16821,8 +18421,8 @@ var alert2 = (s, ctx) => {
|
|
|
16821
18421
|
return [
|
|
16822
18422
|
node2(ctx, "alert", {
|
|
16823
18423
|
variant: ALERT_KINDS.has(kind) ? kind : "info",
|
|
16824
|
-
...title ? { title:
|
|
16825
|
-
text:
|
|
18424
|
+
...title ? { title: short2(title, 200) } : {},
|
|
18425
|
+
text: short2(description),
|
|
16826
18426
|
hideIcon: true,
|
|
16827
18427
|
...str(s["show_dismiss"]) === "show" ? { dismissible: true } : {}
|
|
16828
18428
|
}, Object.keys(style).length > 0 ? { style } : {})
|
|
@@ -16846,15 +18446,19 @@ var menuAnchor = (s, ctx, el) => {
|
|
|
16846
18446
|
return [box(ctx, [], {}, { htmlId: anchor, editorLabel: `Anchor ${anchor}`.slice(0, 80) })];
|
|
16847
18447
|
};
|
|
16848
18448
|
var googleMaps = (s, ctx, el) => {
|
|
16849
|
-
const address = plain(s["address"]).text;
|
|
16850
|
-
ctx.note("approximated", el, "Google Maps embeds became a link to the map.");
|
|
18449
|
+
const address = plain(s["address"]).text.slice(0, 300);
|
|
16851
18450
|
if (!address)
|
|
16852
18451
|
return [];
|
|
18452
|
+
const zoom = num2(isRecord2(s["zoom"]) ? s["zoom"]["size"] : s["zoom"]);
|
|
18453
|
+
const height = num2(isRecord2(s["height"]) ? s["height"]["size"] : s["height"]);
|
|
18454
|
+
ctx.note("approximated", el, "Google Maps load when a visitor presses Show the map, so Google isn't contacted before.");
|
|
16853
18455
|
return [
|
|
16854
|
-
node2(ctx, "
|
|
16855
|
-
|
|
16856
|
-
|
|
16857
|
-
|
|
18456
|
+
node2(ctx, "map", {
|
|
18457
|
+
address,
|
|
18458
|
+
provider: "google",
|
|
18459
|
+
embed: true,
|
|
18460
|
+
...zoom ? { zoom: Math.min(19, Math.max(1, Math.round(zoom))) } : {},
|
|
18461
|
+
...height ? { height: Math.min(800, Math.max(150, Math.round(height))) } : {}
|
|
16858
18462
|
})
|
|
16859
18463
|
];
|
|
16860
18464
|
};
|
|
@@ -16900,25 +18504,7 @@ function carouselWidget(list, perView, s, ctx, el, imageKey) {
|
|
|
16900
18504
|
img["style"] = { width: { value: 100, unit: "%" }, height: "auto" };
|
|
16901
18505
|
slides.push(node2(ctx, "carousel-slide", {}, { children: [img] }));
|
|
16902
18506
|
}
|
|
16903
|
-
|
|
16904
|
-
return [];
|
|
16905
|
-
const navigation = str(s["navigation"]) ?? "both";
|
|
16906
|
-
const autoplay = str(s["autoplay"]);
|
|
16907
|
-
if (autoplay !== "yes" && autoplay !== "no")
|
|
16908
|
-
ctx.note("approximated", el, "Carousels don't play by themselves unless you turn on Play automatically.");
|
|
16909
|
-
const speed = num2(s["autoplay_speed"]);
|
|
16910
|
-
return [
|
|
16911
|
-
node2(ctx, "carousel", {
|
|
16912
|
-
perView: Math.min(4, Math.max(1, Math.round(perView))),
|
|
16913
|
-
...navigation === "both" || navigation === "arrows" ? { arrows: true } : {},
|
|
16914
|
-
...navigation === "both" || navigation === "dots" ? { dots: true } : {},
|
|
16915
|
-
...autoplay === "yes" ? {
|
|
16916
|
-
autoplay: true,
|
|
16917
|
-
...speed ? { interval: Math.min(30, Math.max(3, Math.round(speed / 1000))) } : {}
|
|
16918
|
-
} : {},
|
|
16919
|
-
...str(s["infinite"]) === "no" ? {} : { loop: true }
|
|
16920
|
-
}, { children: slides })
|
|
16921
|
-
];
|
|
18507
|
+
return carouselFrom(slides, perView, s, ctx, el);
|
|
16922
18508
|
}
|
|
16923
18509
|
var imageCarousel = (s, ctx, el) => carouselWidget(s["carousel"], num2(s["slides_to_show"]) ?? 3, s, ctx, el);
|
|
16924
18510
|
var mediaCarousel = (s, ctx, el) => carouselWidget(s["slides"], num2(s["slides_per_view"]) ?? 3, s, ctx, el, "image");
|
|
@@ -17087,7 +18673,7 @@ var tabs2 = (s, ctx, el) => {
|
|
|
17087
18673
|
return [];
|
|
17088
18674
|
if (items.length > MAX_TABS)
|
|
17089
18675
|
ctx.note("skipped", el, `Only the first ${MAX_TABS} tabs are kept.`);
|
|
17090
|
-
const panels = items.slice(0, MAX_TABS).map((t) => node2(ctx, "tab-panel", { label:
|
|
18676
|
+
const panels = items.slice(0, MAX_TABS).map((t) => node2(ctx, "tab-panel", { label: short2(t.title) }, { children: htmlNodes(t.content, ctx, el) }));
|
|
17091
18677
|
return [node2(ctx, "tabs", {}, { children: panels })];
|
|
17092
18678
|
};
|
|
17093
18679
|
var accordion2 = (firstOpen) => (s, ctx, el) => {
|
|
@@ -17102,7 +18688,7 @@ var nestedTabs = (s, ctx, el, env, raw) => {
|
|
|
17102
18688
|
const kids = Array.isArray(raw["elements"]) ? raw["elements"] : [];
|
|
17103
18689
|
if (titles.length > MAX_TABS)
|
|
17104
18690
|
ctx.note("skipped", el, `Only the first ${MAX_TABS} tabs are kept.`);
|
|
17105
|
-
const panels = titles.slice(0, MAX_TABS).map((title, i) => node2(ctx, "tab-panel", { label:
|
|
18691
|
+
const panels = titles.slice(0, MAX_TABS).map((title, i) => node2(ctx, "tab-panel", { label: short2(title) }, { children: env.walk([kids[i]], { ...env, parentRow: false, depth: env.depth + 2 }) }));
|
|
17106
18692
|
return panels.length > 0 ? [node2(ctx, "tabs", {}, { children: panels })] : [];
|
|
17107
18693
|
};
|
|
17108
18694
|
var nestedAccordion = (s, ctx, _el, env, raw) => {
|
|
@@ -17160,7 +18746,7 @@ var form2 = (s, ctx, el) => {
|
|
|
17160
18746
|
};
|
|
17161
18747
|
function menuItems(ctx, links, depth = 0) {
|
|
17162
18748
|
return links.slice(0, 50).map((entry) => node2(ctx, "menu-item", {
|
|
17163
|
-
text:
|
|
18749
|
+
text: short2(entry.text || "Link", 200),
|
|
17164
18750
|
...entry.href ? { href: entry.href.slice(0, 2000) } : {},
|
|
17165
18751
|
...entry.newTab ? { newTab: true } : {}
|
|
17166
18752
|
}, { children: depth < 2 && entry.children ? menuItems(ctx, entry.children, depth + 1) : [] }));
|
|
@@ -17184,123 +18770,136 @@ var megaMenu = (s, ctx, _el, env, raw) => {
|
|
|
17184
18770
|
const children = items.map((item, i) => {
|
|
17185
18771
|
const text = plain(item["item_title"]).text || "Item";
|
|
17186
18772
|
const panel = str(item["item_dropdown_content"]) === "yes" ? env.walk([kids[i]], { ...env, parentRow: false, depth: env.depth + 2 }) : [];
|
|
17187
|
-
return node2(ctx, "menu-item", { text:
|
|
18773
|
+
return node2(ctx, "menu-item", { text: short2(text), ...href(item["item_link"], ctx) }, { children: panel });
|
|
17188
18774
|
});
|
|
17189
18775
|
return [node2(ctx, "menu", { direction: "row" }, { children })];
|
|
17190
18776
|
};
|
|
17191
18777
|
var callToAction = (s, ctx, el) => {
|
|
17192
|
-
const
|
|
17193
|
-
|
|
17194
|
-
|
|
17195
|
-
|
|
17196
|
-
paddingBottom: { value: 35, unit: "px" },
|
|
17197
|
-
paddingLeft: { value: 35, unit: "px" },
|
|
17198
|
-
paddingRight: { value: 35, unit: "px" },
|
|
17199
|
-
alignItems: "center",
|
|
17200
|
-
textAlign: "center"
|
|
17201
|
-
};
|
|
18778
|
+
const title = plain(s["title"]).text.slice(0, 200);
|
|
18779
|
+
if (!title)
|
|
18780
|
+
return [];
|
|
18781
|
+
const level = Number(/^h([2-6])$/.exec(str(s["title_tag"]) ?? "h2")?.[1] ?? 2);
|
|
17202
18782
|
const bg = image2(s["bg_image"]);
|
|
17203
|
-
if (bg
|
|
17204
|
-
|
|
17205
|
-
|
|
17206
|
-
|
|
17207
|
-
|
|
17208
|
-
const
|
|
17209
|
-
if (fill)
|
|
17210
|
-
style["backgroundColor"] = fill;
|
|
17211
|
-
const title = plain(s["title"]).text;
|
|
17212
|
-
const level = Number(/^h([1-6])$/.exec(str(s["title_tag"]) ?? "h2")?.[1] ?? 2);
|
|
17213
|
-
if (title)
|
|
17214
|
-
children.push(node2(ctx, "heading", { text: short(title), level }));
|
|
18783
|
+
if (bg)
|
|
18784
|
+
ctx.externalImage(bg.url);
|
|
18785
|
+
const layout = str(s["layout"]);
|
|
18786
|
+
const where = str(s["skin"]) === "cover" ? "behind" : layout === "left" ? "left" : layout === "right" ? "right" : "top";
|
|
18787
|
+
const target = href(s["link"], ctx);
|
|
18788
|
+
const btn = plain(s["button"]).text.slice(0, 80);
|
|
17215
18789
|
const description = plain(s["description"]).text;
|
|
17216
|
-
|
|
17217
|
-
|
|
17218
|
-
const
|
|
17219
|
-
|
|
17220
|
-
|
|
17221
|
-
|
|
17222
|
-
|
|
17223
|
-
}
|
|
17224
|
-
|
|
17225
|
-
|
|
17226
|
-
|
|
17227
|
-
|
|
17228
|
-
|
|
17229
|
-
|
|
17230
|
-
|
|
17231
|
-
|
|
18790
|
+
const ribbon = plain(s["ribbon_title"]).text.slice(0, 30);
|
|
18791
|
+
ctx.note("approximated", el, "Call to Action boxes keep their content, not their hover effects.");
|
|
18792
|
+
const fill = colorAt(s, "background_color", ctx);
|
|
18793
|
+
return [
|
|
18794
|
+
node2(ctx, "cta", {
|
|
18795
|
+
title,
|
|
18796
|
+
...level !== 3 ? { titleLevel: level } : {},
|
|
18797
|
+
...description ? { text: short2(description) } : {},
|
|
18798
|
+
...bg ? { src: bg.url, alt: bg.alt ?? "" } : {},
|
|
18799
|
+
layout: where,
|
|
18800
|
+
...btn && target.href ? { buttonText: btn } : {},
|
|
18801
|
+
...target,
|
|
18802
|
+
...ribbon ? { ribbon } : {}
|
|
18803
|
+
}, fill ? { style: { backgroundColor: fill } } : {})
|
|
18804
|
+
];
|
|
18805
|
+
};
|
|
18806
|
+
var CURRENCY_SYMBOLS = {
|
|
18807
|
+
dollar: "$",
|
|
18808
|
+
euro: "€",
|
|
18809
|
+
pound: "£",
|
|
18810
|
+
yen: "¥",
|
|
18811
|
+
rupee: "₹",
|
|
18812
|
+
franc: "₣",
|
|
18813
|
+
real: "R$",
|
|
18814
|
+
baht: "฿",
|
|
18815
|
+
krona: "kr",
|
|
18816
|
+
lira: "₺",
|
|
18817
|
+
peseta: "₧",
|
|
18818
|
+
peso: "₱",
|
|
18819
|
+
shekel: "₪",
|
|
18820
|
+
won: "₩",
|
|
18821
|
+
guilder: "ƒ"
|
|
18822
|
+
};
|
|
18823
|
+
var priceTable2 = (s, ctx, el) => {
|
|
18824
|
+
const title = plain(s["heading"]).text.slice(0, 120);
|
|
18825
|
+
const price = plain(s["price"]).text.slice(0, 20);
|
|
18826
|
+
if (!title && !price)
|
|
18827
|
+
return [];
|
|
18828
|
+
const currency = (str(s["currency_symbol"]) === "custom" ? plain(s["currency_symbol_custom"]).text : CURRENCY_SYMBOLS[str(s["currency_symbol"]) ?? "dollar"] ?? "").slice(0, 5);
|
|
18829
|
+
const regular = s["sale"] === "yes" ? plain(s["original_price"]).text.slice(0, 20) : "";
|
|
18830
|
+
const features = (Array.isArray(s["features_list"]) ? s["features_list"] : []).filter(isRecord2).map((f) => plain(f["item_text"]).text.slice(0, 200)).filter(Boolean).slice(0, 30);
|
|
17232
18831
|
const sub = plain(s["sub_heading"]).text;
|
|
17233
|
-
if (sub)
|
|
17234
|
-
children.push(node2(ctx, "text", { text: short(sub) }));
|
|
17235
|
-
const symbols = {
|
|
17236
|
-
dollar: "$",
|
|
17237
|
-
euro: "€",
|
|
17238
|
-
pound: "£",
|
|
17239
|
-
yen: "¥",
|
|
17240
|
-
rupee: "₹",
|
|
17241
|
-
franc: "₣",
|
|
17242
|
-
real: "R$",
|
|
17243
|
-
baht: "฿",
|
|
17244
|
-
krona: "kr",
|
|
17245
|
-
lira: "₺",
|
|
17246
|
-
peseta: "₧",
|
|
17247
|
-
peso: "₱",
|
|
17248
|
-
shekel: "₪",
|
|
17249
|
-
won: "₩",
|
|
17250
|
-
guilder: "ƒ"
|
|
17251
|
-
};
|
|
17252
|
-
const currency = str(s["currency_symbol"]) === "custom" ? plain(s["currency_symbol_custom"]).text : symbols[str(s["currency_symbol"]) ?? "dollar"] ?? "";
|
|
17253
|
-
const price = plain(s["price"]).text;
|
|
17254
|
-
if (price) {
|
|
17255
|
-
const period = plain(s["period"]).text;
|
|
17256
|
-
children.push(node2(ctx, "text", { text: short(`${currency}${price}${period ? ` / ${period}` : ""}`), tag: "div" }, { style: { fontSize: { value: 2.5, unit: "em" }, fontWeight: 600 } }));
|
|
17257
|
-
}
|
|
17258
|
-
const features = (Array.isArray(s["features_list"]) ? s["features_list"] : []).filter(isRecord2).map((f) => short(plain(f["item_text"]).text)).filter(Boolean).slice(0, 200);
|
|
17259
|
-
if (features.length > 0)
|
|
17260
|
-
children.push(node2(ctx, "list", { items: features }));
|
|
17261
|
-
const btn = buttonNode(s, ctx, el, { text: "button_text", link: "link" });
|
|
17262
|
-
if (btn)
|
|
17263
|
-
children.push(btn);
|
|
17264
18832
|
const footer = plain(s["footer_additional_info"]).text;
|
|
18833
|
+
const description = [sub, footer].filter(Boolean).join(`
|
|
18834
|
+
`).slice(0, 500);
|
|
18835
|
+
const target = href(s["link"], ctx);
|
|
18836
|
+
const btn = plain(s["button_text"]).text.slice(0, 80);
|
|
18837
|
+
const ribbon = s["show_ribbon"] === "yes" ? plain(s["ribbon_title"]).text.slice(0, 30) : "";
|
|
17265
18838
|
if (footer)
|
|
17266
|
-
|
|
17267
|
-
|
|
17268
|
-
return
|
|
17269
|
-
|
|
17270
|
-
|
|
17271
|
-
|
|
17272
|
-
|
|
18839
|
+
ctx.note("approximated", el, "A price table's footer text joined its description.");
|
|
18840
|
+
const level = Number(/^h([2-6])$/.exec(str(s["heading_tag"]) ?? "h3")?.[1] ?? 3);
|
|
18841
|
+
return [
|
|
18842
|
+
node2(ctx, "price-table", {
|
|
18843
|
+
title: title || price,
|
|
18844
|
+
...level !== 3 ? { titleLevel: level } : {},
|
|
18845
|
+
...description ? { description } : {},
|
|
18846
|
+
price: price || "0",
|
|
18847
|
+
...currency ? { currency } : {},
|
|
18848
|
+
...plain(s["period"]).text ? { period: plain(s["period"]).text.slice(0, 40) } : {},
|
|
18849
|
+
...regular ? { regularPrice: regular } : {},
|
|
18850
|
+
...features.length > 0 ? { features } : {},
|
|
18851
|
+
...btn && target.href ? { buttonText: btn, buttonHref: target.href } : {},
|
|
18852
|
+
...target.newTab && btn ? { newTab: true } : {},
|
|
18853
|
+
...s["show_ribbon"] === "yes" ? { featured: true, ...ribbon ? { ribbon } : {} } : {}
|
|
17273
18854
|
})
|
|
17274
|
-
]
|
|
18855
|
+
];
|
|
17275
18856
|
};
|
|
17276
|
-
var
|
|
17277
|
-
const
|
|
17278
|
-
|
|
17279
|
-
|
|
17280
|
-
|
|
17281
|
-
|
|
17282
|
-
const
|
|
17283
|
-
if (
|
|
17284
|
-
|
|
17285
|
-
const
|
|
17286
|
-
|
|
17287
|
-
|
|
17288
|
-
|
|
17289
|
-
|
|
17290
|
-
|
|
17291
|
-
|
|
17292
|
-
|
|
17293
|
-
|
|
17294
|
-
|
|
17295
|
-
|
|
17296
|
-
|
|
17297
|
-
|
|
17298
|
-
|
|
17299
|
-
|
|
17300
|
-
|
|
17301
|
-
|
|
17302
|
-
|
|
17303
|
-
|
|
18857
|
+
var priceList2 = (s, ctx, el) => {
|
|
18858
|
+
const rows = (Array.isArray(s["price_list"]) ? s["price_list"] : []).filter(isRecord2);
|
|
18859
|
+
if (rows.length > 50)
|
|
18860
|
+
ctx.note("skipped", el, "Price lists keep their first 50 items.");
|
|
18861
|
+
const items = [];
|
|
18862
|
+
for (const row of rows.slice(0, 50)) {
|
|
18863
|
+
const title = plain(row["title"]).text.slice(0, 120);
|
|
18864
|
+
if (!title)
|
|
18865
|
+
continue;
|
|
18866
|
+
const img = image2(row["image"]);
|
|
18867
|
+
if (img)
|
|
18868
|
+
ctx.externalImage(img.url);
|
|
18869
|
+
const target = href(row["link"], ctx);
|
|
18870
|
+
const description = plain(row["item_description"]).text.slice(0, 500);
|
|
18871
|
+
items.push(node2(ctx, "price-list-item", {
|
|
18872
|
+
title,
|
|
18873
|
+
price: plain(row["price"]).text.slice(0, 20),
|
|
18874
|
+
...description ? { description } : {},
|
|
18875
|
+
...img ? { src: img.url, ...img.alt ? { alt: img.alt } : {} } : {},
|
|
18876
|
+
...target
|
|
18877
|
+
}));
|
|
18878
|
+
}
|
|
18879
|
+
return items.length > 0 ? [node2(ctx, "price-list", {}, { children: items })] : [];
|
|
18880
|
+
};
|
|
18881
|
+
var flipBox2 = (s, ctx, el) => {
|
|
18882
|
+
const frontTitle = plain(s["title_text_a"]).text.slice(0, 200);
|
|
18883
|
+
const backTitle = plain(s["title_text_b"]).text.slice(0, 200);
|
|
18884
|
+
if (!frontTitle && !backTitle)
|
|
18885
|
+
return [];
|
|
18886
|
+
const frontText = plain(s["description_text_a"]).text;
|
|
18887
|
+
const backText = plain(s["description_text_b"]).text;
|
|
18888
|
+
const target = href(s["link"], ctx);
|
|
18889
|
+
const btn = plain(s["button_text"]).text.slice(0, 80);
|
|
18890
|
+
const direction = str(s["flip_direction"]);
|
|
18891
|
+
if (image2(s["image"]) || isRecord2(s["selected_icon"]))
|
|
18892
|
+
ctx.note("approximated", el, "A flip box's front image or icon was left out.");
|
|
18893
|
+
return [
|
|
18894
|
+
node2(ctx, "flip-box", {
|
|
18895
|
+
frontTitle: frontTitle || backTitle,
|
|
18896
|
+
...frontText ? { frontText: short2(frontText) } : {},
|
|
18897
|
+
...backTitle ? { backTitle } : {},
|
|
18898
|
+
...backText ? { backText: short2(backText) } : {},
|
|
18899
|
+
...btn && target.href ? { buttonText: btn, ...target } : {},
|
|
18900
|
+
...direction === "left" || direction === "up" || direction === "down" ? { direction } : {}
|
|
18901
|
+
})
|
|
18902
|
+
];
|
|
17304
18903
|
};
|
|
17305
18904
|
var blockquote = (s, ctx) => {
|
|
17306
18905
|
const content = plain(s["blockquote_content"]).text;
|
|
@@ -17309,8 +18908,8 @@ var blockquote = (s, ctx) => {
|
|
|
17309
18908
|
const author = plain(s["author_name"]).text;
|
|
17310
18909
|
return [
|
|
17311
18910
|
box(ctx, [
|
|
17312
|
-
node2(ctx, "text", { text:
|
|
17313
|
-
...author ? [node2(ctx, "text", { text:
|
|
18911
|
+
node2(ctx, "text", { text: short2(content) }, { style: { fontSize: { value: 1.2, unit: "em" } } }),
|
|
18912
|
+
...author ? [node2(ctx, "text", { text: short2(`— ${author}`) })] : []
|
|
17314
18913
|
], {
|
|
17315
18914
|
gap: { value: 8, unit: "px" },
|
|
17316
18915
|
borderStyle: "solid",
|
|
@@ -17319,17 +18918,39 @@ var blockquote = (s, ctx) => {
|
|
|
17319
18918
|
})
|
|
17320
18919
|
];
|
|
17321
18920
|
};
|
|
18921
|
+
var HEADLINE_MARKERS = {
|
|
18922
|
+
circle: "circle",
|
|
18923
|
+
curly: "underline",
|
|
18924
|
+
underline: "underline",
|
|
18925
|
+
double: "underline",
|
|
18926
|
+
double_underline: "underline",
|
|
18927
|
+
underline_zigzag: "underline",
|
|
18928
|
+
diagonal: "strike",
|
|
18929
|
+
strikethrough: "strike",
|
|
18930
|
+
x: "strike"
|
|
18931
|
+
};
|
|
17322
18932
|
var animatedHeadline = (s, ctx, el) => {
|
|
17323
|
-
const
|
|
17324
|
-
|
|
17325
|
-
|
|
17326
|
-
const
|
|
17327
|
-
|
|
18933
|
+
const rotate = str(s["headline_style"]) === "rotate";
|
|
18934
|
+
const words = (str(s["rotating_text"]) ?? "").split(`
|
|
18935
|
+
`).map((w) => plain(w).text.slice(0, 120)).filter(Boolean);
|
|
18936
|
+
const highlight = (rotate ? words[0] : plain(s["highlighted_text"]).text)?.slice(0, 120) ?? "";
|
|
18937
|
+
const before = plain(s["before_text"]).text.slice(0, 200);
|
|
18938
|
+
const after = plain(s["after_text"]).text.slice(0, 200);
|
|
18939
|
+
if (!highlight && !before && !after)
|
|
17328
18940
|
return [];
|
|
17329
|
-
ctx.note("approximated", el, "Animated headlines are shown without their animation (rotating headlines show their first word).");
|
|
17330
18941
|
const level = Number(/^h([1-6])$/.exec(str(s["tag"]) ?? "h3")?.[1] ?? 3);
|
|
18942
|
+
if (link2(s["link"]))
|
|
18943
|
+
ctx.note("approximated", el, "An animated headline's link was left out.");
|
|
18944
|
+
const marker = HEADLINE_MARKERS[str(s["marker"]) ?? "circle"] ?? "underline";
|
|
17331
18945
|
return [
|
|
17332
|
-
styled(node2(ctx, "
|
|
18946
|
+
styled(node2(ctx, "headline", {
|
|
18947
|
+
level,
|
|
18948
|
+
...before ? { before } : {},
|
|
18949
|
+
highlight: highlight || before || after,
|
|
18950
|
+
...after && highlight ? { after } : {},
|
|
18951
|
+
mark: rotate ? "none" : marker,
|
|
18952
|
+
...rotate && words.length > 1 ? { rotate: words.slice(1, 11), rotating: true, turns: s["loop"] === "yes" ? 5 : 1 } : {}
|
|
18953
|
+
}), deviceStyles2(s, ctx, el, [
|
|
17333
18954
|
typographyReader("title_typography", "primary"),
|
|
17334
18955
|
textReader("title_color", "secondary", "alignment")
|
|
17335
18956
|
]))
|
|
@@ -17378,18 +18999,41 @@ var siteLogo = (s, ctx, el, env) => {
|
|
|
17378
18999
|
n["style"] = { maxWidth: { value: 100, unit: "%" } };
|
|
17379
19000
|
return [align(n, s["align"], env, "center")];
|
|
17380
19001
|
};
|
|
19002
|
+
function carouselFrom(slides, perView, s, ctx, el) {
|
|
19003
|
+
if (slides.length === 0)
|
|
19004
|
+
return [];
|
|
19005
|
+
const navigation = str(s["navigation"]) ?? "both";
|
|
19006
|
+
const autoplay = str(s["autoplay"]);
|
|
19007
|
+
if (autoplay !== "yes" && autoplay !== "no")
|
|
19008
|
+
ctx.note("approximated", el, "Carousels don't play by themselves unless you turn on Play automatically.");
|
|
19009
|
+
const speed = num2(s["autoplay_speed"]);
|
|
19010
|
+
return [
|
|
19011
|
+
node2(ctx, "carousel", {
|
|
19012
|
+
perView: Math.min(4, Math.max(1, Math.round(perView))),
|
|
19013
|
+
...navigation === "both" || navigation === "arrows" ? { arrows: true } : {},
|
|
19014
|
+
...navigation === "both" || navigation === "dots" ? { dots: true } : {},
|
|
19015
|
+
...autoplay === "yes" ? {
|
|
19016
|
+
autoplay: true,
|
|
19017
|
+
...speed ? { interval: Math.min(30, Math.max(3, Math.round(speed / 1000))) } : {}
|
|
19018
|
+
} : {},
|
|
19019
|
+
...str(s["infinite"]) === "no" ? {} : { loop: true }
|
|
19020
|
+
}, { children: slides })
|
|
19021
|
+
];
|
|
19022
|
+
}
|
|
17381
19023
|
var slides = (s, ctx, el) => {
|
|
17382
|
-
const list = (Array.isArray(s["slides"]) ? s["slides"] : []).filter(isRecord2)
|
|
19024
|
+
const list = (Array.isArray(s["slides"]) ? s["slides"] : []).filter(isRecord2);
|
|
19025
|
+
if (list.length > 20)
|
|
19026
|
+
ctx.note("skipped", el, "Carousels keep their first 20 slides.");
|
|
17383
19027
|
const height = slider(s["slides_height"]) ?? { value: 400, unit: "px" };
|
|
17384
19028
|
const out = [];
|
|
17385
|
-
for (const slide of list) {
|
|
19029
|
+
for (const slide of list.slice(0, 20)) {
|
|
17386
19030
|
const parts = [];
|
|
17387
19031
|
const title = plain(slide["heading"]).text;
|
|
17388
19032
|
if (title)
|
|
17389
|
-
parts.push(node2(ctx, "heading", { text:
|
|
19033
|
+
parts.push(node2(ctx, "heading", { text: short2(title), level: 2 }));
|
|
17390
19034
|
const text = plain(slide["description"]).text;
|
|
17391
19035
|
if (text)
|
|
17392
|
-
parts.push(node2(ctx, "text", { text:
|
|
19036
|
+
parts.push(node2(ctx, "text", { text: short2(text) }));
|
|
17393
19037
|
const btn = buttonNode(slide, ctx, el, { text: "button_text", link: "link" });
|
|
17394
19038
|
if (btn)
|
|
17395
19039
|
parts.push(btn);
|
|
@@ -17409,25 +19053,121 @@ var slides = (s, ctx, el) => {
|
|
|
17409
19053
|
style["backgroundImage"] = bg.url;
|
|
17410
19054
|
style["backgroundSize"] = "cover";
|
|
17411
19055
|
}
|
|
17412
|
-
out.push(box(ctx, parts, style));
|
|
19056
|
+
out.push(node2(ctx, "carousel-slide", {}, { children: [box(ctx, parts, style)] }));
|
|
17413
19057
|
}
|
|
17414
|
-
|
|
17415
|
-
ctx.note("approximated", el, "Slides are shown stacked, one after another.");
|
|
17416
|
-
return out;
|
|
19058
|
+
return carouselFrom(out, 1, s, ctx, el);
|
|
17417
19059
|
};
|
|
17418
19060
|
var testimonialCarousel = (s, ctx, el, env, raw) => {
|
|
17419
|
-
const list = (Array.isArray(s["slides"]) ? s["slides"] : []).filter(isRecord2)
|
|
17420
|
-
|
|
17421
|
-
|
|
17422
|
-
|
|
17423
|
-
|
|
17424
|
-
|
|
17425
|
-
|
|
17426
|
-
|
|
17427
|
-
|
|
17428
|
-
|
|
17429
|
-
|
|
17430
|
-
|
|
19061
|
+
const list = (Array.isArray(s["slides"]) ? s["slides"] : []).filter(isRecord2);
|
|
19062
|
+
if (list.length > 20)
|
|
19063
|
+
ctx.note("skipped", el, "Carousels keep their first 20 slides.");
|
|
19064
|
+
const out = [];
|
|
19065
|
+
for (const slide of list.slice(0, 20)) {
|
|
19066
|
+
const quote = testimonial2({
|
|
19067
|
+
testimonial_content: slide["content"],
|
|
19068
|
+
testimonial_name: slide["name"],
|
|
19069
|
+
testimonial_job: slide["title"],
|
|
19070
|
+
testimonial_image: slide["image"]
|
|
19071
|
+
}, ctx, el, env, raw);
|
|
19072
|
+
if (quote.length > 0)
|
|
19073
|
+
out.push(node2(ctx, "carousel-slide", {}, { children: quote }));
|
|
19074
|
+
}
|
|
19075
|
+
return carouselFrom(out, num2(s["slides_per_view"]) ?? 1, s, ctx, el);
|
|
19076
|
+
};
|
|
19077
|
+
function countdownTarget(value) {
|
|
19078
|
+
const m = /^(\d{4}-\d{2}-\d{2})[ T](\d{2}):(\d{2})/.exec(str(value) ?? "");
|
|
19079
|
+
return m ? `${m[1]}T${m[2]}:${m[3]}Z` : undefined;
|
|
19080
|
+
}
|
|
19081
|
+
var countdown2 = (s, ctx, el) => {
|
|
19082
|
+
if (str(s["countdown_type"]) === "evergreen") {
|
|
19083
|
+
ctx.note("skipped", el, "Evergreen countdowns (a timer per visitor) weren't imported.");
|
|
19084
|
+
return [];
|
|
19085
|
+
}
|
|
19086
|
+
const target = countdownTarget(s["due_date"]);
|
|
19087
|
+
if (!target)
|
|
19088
|
+
return [];
|
|
19089
|
+
ctx.note("approximated", el, "Countdown dates have no time zone in Elementor; they were read as UTC. Check the time.");
|
|
19090
|
+
const actions = Array.isArray(s["expire_actions"]) ? s["expire_actions"].map(String) : [];
|
|
19091
|
+
const message = plain(s["message_after_expire"]).text.slice(0, 200);
|
|
19092
|
+
const redirect = href(s["expire_redirect_url"], ctx).href;
|
|
19093
|
+
const expired = actions.includes("hide") ? { expired: "hide" } : redirect ? { expired: "link", expiredHref: redirect, ...message ? { expiredText: message } : {} } : message ? { expiredText: message } : {};
|
|
19094
|
+
if (actions.includes("redirect"))
|
|
19095
|
+
ctx.note("approximated", el, "A countdown that redirected now shows a link instead.");
|
|
19096
|
+
return [
|
|
19097
|
+
node2(ctx, "countdown", {
|
|
19098
|
+
target,
|
|
19099
|
+
ticking: true,
|
|
19100
|
+
...s["show_seconds"] === "" || s["show_seconds"] === "no" ? { hideSeconds: true } : {},
|
|
19101
|
+
...expired
|
|
19102
|
+
})
|
|
19103
|
+
];
|
|
19104
|
+
};
|
|
19105
|
+
var SHARE_FROM_ELEMENTOR = {
|
|
19106
|
+
facebook: "facebook",
|
|
19107
|
+
twitter: "x",
|
|
19108
|
+
"x-twitter": "x",
|
|
19109
|
+
linkedin: "linkedin",
|
|
19110
|
+
whatsapp: "whatsapp",
|
|
19111
|
+
telegram: "telegram",
|
|
19112
|
+
reddit: "reddit",
|
|
19113
|
+
threads: "threads",
|
|
19114
|
+
bluesky: "bluesky",
|
|
19115
|
+
email: "email"
|
|
19116
|
+
};
|
|
19117
|
+
var shareButtons2 = (s, ctx, el) => {
|
|
19118
|
+
const list = (Array.isArray(s["share_buttons"]) ? s["share_buttons"] : []).filter(isRecord2);
|
|
19119
|
+
const networks = list.map((b) => SHARE_FROM_ELEMENTOR[str(b["button"]) ?? ""]);
|
|
19120
|
+
if (networks.some((n) => !n))
|
|
19121
|
+
ctx.note("skipped", el, "Share buttons for services EmVB has no link for were left out.");
|
|
19122
|
+
const links = [...new Set(networks.filter((n) => Boolean(n)))].slice(0, 12).map((network) => node2(ctx, "share-link", { network }));
|
|
19123
|
+
if (links.length === 0)
|
|
19124
|
+
return [];
|
|
19125
|
+
const shape = str(s["shape"]);
|
|
19126
|
+
return [
|
|
19127
|
+
node2(ctx, "share-buttons", {
|
|
19128
|
+
shape: shape === "circle" || shape === "rounded" ? shape : "square",
|
|
19129
|
+
...str(s["color_source"]) === "custom" ? {} : { brandColors: true }
|
|
19130
|
+
}, { children: links })
|
|
19131
|
+
];
|
|
19132
|
+
};
|
|
19133
|
+
var offset = (value) => {
|
|
19134
|
+
const n = num2(isRecord2(value) ? value["size"] : value);
|
|
19135
|
+
return n === undefined ? undefined : Math.min(100, Math.max(0, Math.round(n * 100) / 100));
|
|
19136
|
+
};
|
|
19137
|
+
var hotspotWidget = (s, ctx, el) => {
|
|
19138
|
+
const img = image2(s["image"]);
|
|
19139
|
+
if (!img)
|
|
19140
|
+
return [];
|
|
19141
|
+
ctx.externalImage(img.url);
|
|
19142
|
+
const list = (Array.isArray(s["hotspot"]) ? s["hotspot"] : []).filter(isRecord2);
|
|
19143
|
+
if (list.length > 20)
|
|
19144
|
+
ctx.note("skipped", el, "Hotspots keep their first 20 markers.");
|
|
19145
|
+
const markers = list.slice(0, 20).map((spot, i) => {
|
|
19146
|
+
const title = plain(spot["hotspot_label"]).text.slice(0, 120) || `Point ${i + 1}`;
|
|
19147
|
+
const text = plain(spot["hotspot_tooltip_content"]).text.slice(0, 1000);
|
|
19148
|
+
const at = (key) => offset(spot[key]);
|
|
19149
|
+
const place = {};
|
|
19150
|
+
for (const [prop, key] of [
|
|
19151
|
+
["xTablet", "hotspot_offset_x_tablet"],
|
|
19152
|
+
["yTablet", "hotspot_offset_y_tablet"],
|
|
19153
|
+
["xMobile", "hotspot_offset_x_mobile"],
|
|
19154
|
+
["yMobile", "hotspot_offset_y_mobile"]
|
|
19155
|
+
]) {
|
|
19156
|
+
const v = at(key);
|
|
19157
|
+
if (v !== undefined)
|
|
19158
|
+
place[prop] = v;
|
|
19159
|
+
}
|
|
19160
|
+
return node2(ctx, "hotspot", {
|
|
19161
|
+
title,
|
|
19162
|
+
...text ? { text } : {},
|
|
19163
|
+
x: at("hotspot_offset_x") ?? 50,
|
|
19164
|
+
y: at("hotspot_offset_y") ?? 50,
|
|
19165
|
+
...place
|
|
19166
|
+
});
|
|
19167
|
+
});
|
|
19168
|
+
return [
|
|
19169
|
+
node2(ctx, "hotspots", { src: img.url, alt: img.alt ?? altFromUrl(img.url) }, { children: markers })
|
|
19170
|
+
];
|
|
17431
19171
|
};
|
|
17432
19172
|
var codeHighlight = (s, ctx, el) => {
|
|
17433
19173
|
const code = str(s["code"]) ?? "";
|
|
@@ -17445,7 +19185,7 @@ var audio = (s, ctx, el) => {
|
|
|
17445
19185
|
var textPath = (s, ctx, el) => {
|
|
17446
19186
|
const text = plain(s["text"]).text;
|
|
17447
19187
|
ctx.note("approximated", el, "Text on a path is shown as straight text.");
|
|
17448
|
-
return text ? [node2(ctx, "text", { text:
|
|
19188
|
+
return text ? [node2(ctx, "text", { text: short2(text) })] : [];
|
|
17449
19189
|
};
|
|
17450
19190
|
var skip = (message, kind = "skipped") => (_s, ctx, el) => {
|
|
17451
19191
|
ctx.note(kind, el, message);
|
|
@@ -17464,8 +19204,8 @@ var WIDGETS = {
|
|
|
17464
19204
|
"image-box": imageBox2,
|
|
17465
19205
|
"icon-list": iconList,
|
|
17466
19206
|
video: video2,
|
|
17467
|
-
counter,
|
|
17468
|
-
progress,
|
|
19207
|
+
counter: counter2,
|
|
19208
|
+
progress: progress2,
|
|
17469
19209
|
testimonial: testimonial2,
|
|
17470
19210
|
"star-rating": starRating,
|
|
17471
19211
|
alert: alert2,
|
|
@@ -17486,8 +19226,9 @@ var WIDGETS = {
|
|
|
17486
19226
|
"nav-menu": navMenu,
|
|
17487
19227
|
"mega-menu": megaMenu,
|
|
17488
19228
|
"call-to-action": callToAction,
|
|
17489
|
-
"price-table":
|
|
17490
|
-
"
|
|
19229
|
+
"price-table": priceTable2,
|
|
19230
|
+
"price-list": priceList2,
|
|
19231
|
+
"flip-box": flipBox2,
|
|
17491
19232
|
blockquote,
|
|
17492
19233
|
"animated-headline": animatedHeadline,
|
|
17493
19234
|
"table-of-contents": toc2,
|
|
@@ -17514,12 +19255,12 @@ var WIDGETS = {
|
|
|
17514
19255
|
"theme-site-title": skip("The site title comes from WordPress settings; add it as a Heading."),
|
|
17515
19256
|
"read-more": skip("WordPress's Read More tag has no EmVB equivalent."),
|
|
17516
19257
|
sidebar: skip("WordPress sidebars weren't imported."),
|
|
17517
|
-
countdown:
|
|
17518
|
-
"share-buttons":
|
|
19258
|
+
countdown: countdown2,
|
|
19259
|
+
"share-buttons": shareButtons2,
|
|
17519
19260
|
"search-form": skip("Search forms weren't imported."),
|
|
17520
19261
|
login: skip("Login forms weren't imported."),
|
|
17521
19262
|
lottie: skip("Lottie animations weren't imported."),
|
|
17522
|
-
hotspot:
|
|
19263
|
+
hotspot: hotspotWidget,
|
|
17523
19264
|
"paypal-button": skip("PayPal buttons weren't imported."),
|
|
17524
19265
|
"progress-tracker": skip("Reading progress bars weren't imported."),
|
|
17525
19266
|
posts: skip(LOOPS),
|
|
@@ -19632,7 +21373,7 @@ function httpRemote(endpoint, token, version) {
|
|
|
19632
21373
|
}
|
|
19633
21374
|
|
|
19634
21375
|
// src/bridge.ts
|
|
19635
|
-
var BRIDGE_VERSION = "1.
|
|
21376
|
+
var BRIDGE_VERSION = "1.3.0";
|
|
19636
21377
|
var failure2 = (message) => ({
|
|
19637
21378
|
content: [{ type: "text", text: message }],
|
|
19638
21379
|
isError: true
|