@cogenta/theme-docs 0.3.2
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/LICENSE +373 -0
- package/dist/src/index.d.ts +21 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +21 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/render/blocks/accordion.d.ts +4 -0
- package/dist/src/render/blocks/accordion.d.ts.map +1 -0
- package/dist/src/render/blocks/accordion.js +15 -0
- package/dist/src/render/blocks/accordion.js.map +1 -0
- package/dist/src/render/blocks/collection-list.d.ts +14 -0
- package/dist/src/render/blocks/collection-list.d.ts.map +1 -0
- package/dist/src/render/blocks/collection-list.js +77 -0
- package/dist/src/render/blocks/collection-list.js.map +1 -0
- package/dist/src/render/blocks/cta.d.ts +4 -0
- package/dist/src/render/blocks/cta.d.ts.map +1 -0
- package/dist/src/render/blocks/cta.js +7 -0
- package/dist/src/render/blocks/cta.js.map +1 -0
- package/dist/src/render/blocks/embed.d.ts +4 -0
- package/dist/src/render/blocks/embed.d.ts.map +1 -0
- package/dist/src/render/blocks/embed.js +71 -0
- package/dist/src/render/blocks/embed.js.map +1 -0
- package/dist/src/render/blocks/faq.d.ts +4 -0
- package/dist/src/render/blocks/faq.d.ts.map +1 -0
- package/dist/src/render/blocks/faq.js +15 -0
- package/dist/src/render/blocks/faq.js.map +1 -0
- package/dist/src/render/blocks/feature-grid.d.ts +4 -0
- package/dist/src/render/blocks/feature-grid.d.ts.map +1 -0
- package/dist/src/render/blocks/feature-grid.js +27 -0
- package/dist/src/render/blocks/feature-grid.js.map +1 -0
- package/dist/src/render/blocks/gallery.d.ts +10 -0
- package/dist/src/render/blocks/gallery.d.ts.map +1 -0
- package/dist/src/render/blocks/gallery.js +19 -0
- package/dist/src/render/blocks/gallery.js.map +1 -0
- package/dist/src/render/blocks/hero.d.ts +16 -0
- package/dist/src/render/blocks/hero.d.ts.map +1 -0
- package/dist/src/render/blocks/hero.js +28 -0
- package/dist/src/render/blocks/hero.js.map +1 -0
- package/dist/src/render/blocks/logo-strip.d.ts +4 -0
- package/dist/src/render/blocks/logo-strip.d.ts.map +1 -0
- package/dist/src/render/blocks/logo-strip.js +16 -0
- package/dist/src/render/blocks/logo-strip.js.map +1 -0
- package/dist/src/render/blocks/logos.d.ts +4 -0
- package/dist/src/render/blocks/logos.d.ts.map +1 -0
- package/dist/src/render/blocks/logos.js +22 -0
- package/dist/src/render/blocks/logos.js.map +1 -0
- package/dist/src/render/blocks/media-figure.d.ts +10 -0
- package/dist/src/render/blocks/media-figure.d.ts.map +1 -0
- package/dist/src/render/blocks/media-figure.js +25 -0
- package/dist/src/render/blocks/media-figure.js.map +1 -0
- package/dist/src/render/blocks/pricing-table.d.ts +4 -0
- package/dist/src/render/blocks/pricing-table.d.ts.map +1 -0
- package/dist/src/render/blocks/pricing-table.js +28 -0
- package/dist/src/render/blocks/pricing-table.js.map +1 -0
- package/dist/src/render/blocks/prose.d.ts +4 -0
- package/dist/src/render/blocks/prose.d.ts.map +1 -0
- package/dist/src/render/blocks/prose.js +36 -0
- package/dist/src/render/blocks/prose.js.map +1 -0
- package/dist/src/render/blocks/quote.d.ts +9 -0
- package/dist/src/render/blocks/quote.d.ts.map +1 -0
- package/dist/src/render/blocks/quote.js +22 -0
- package/dist/src/render/blocks/quote.js.map +1 -0
- package/dist/src/render/blocks/stat-counter.d.ts +4 -0
- package/dist/src/render/blocks/stat-counter.d.ts.map +1 -0
- package/dist/src/render/blocks/stat-counter.js +15 -0
- package/dist/src/render/blocks/stat-counter.js.map +1 -0
- package/dist/src/render/blocks/stats.d.ts +4 -0
- package/dist/src/render/blocks/stats.d.ts.map +1 -0
- package/dist/src/render/blocks/stats.js +11 -0
- package/dist/src/render/blocks/stats.js.map +1 -0
- package/dist/src/render/blocks/testimonial.d.ts +11 -0
- package/dist/src/render/blocks/testimonial.d.ts.map +1 -0
- package/dist/src/render/blocks/testimonial.js +20 -0
- package/dist/src/render/blocks/testimonial.js.map +1 -0
- package/dist/src/render/chrome.d.ts +3 -0
- package/dist/src/render/chrome.d.ts.map +1 -0
- package/dist/src/render/chrome.js +94 -0
- package/dist/src/render/chrome.js.map +1 -0
- package/dist/src/render/render-block.d.ts +15 -0
- package/dist/src/render/render-block.d.ts.map +1 -0
- package/dist/src/render/render-block.js +176 -0
- package/dist/src/render/render-block.js.map +1 -0
- package/dist/src/render/term-archive.d.ts +10 -0
- package/dist/src/render/term-archive.d.ts.map +1 -0
- package/dist/src/render/term-archive.js +32 -0
- package/dist/src/render/term-archive.js.map +1 -0
- package/dist/theme.config.d.ts +16 -0
- package/dist/theme.config.d.ts.map +1 -0
- package/dist/theme.config.js +46 -0
- package/dist/theme.config.js.map +1 -0
- package/package.json +57 -0
- package/src/index.ts +20 -0
- package/src/render/blocks/accordion.ts +51 -0
- package/src/render/blocks/collection-list.ts +170 -0
- package/src/render/blocks/cta.ts +25 -0
- package/src/render/blocks/embed.ts +94 -0
- package/src/render/blocks/faq.ts +46 -0
- package/src/render/blocks/feature-grid.ts +67 -0
- package/src/render/blocks/gallery.ts +39 -0
- package/src/render/blocks/hero.ts +61 -0
- package/src/render/blocks/logo-strip.ts +31 -0
- package/src/render/blocks/logos.ts +52 -0
- package/src/render/blocks/media-figure.ts +36 -0
- package/src/render/blocks/pricing-table.ts +72 -0
- package/src/render/blocks/prose.ts +49 -0
- package/src/render/blocks/quote.ts +35 -0
- package/src/render/blocks/stat-counter.ts +37 -0
- package/src/render/blocks/stats.ts +38 -0
- package/src/render/blocks/testimonial.ts +36 -0
- package/src/render/chrome.ts +124 -0
- package/src/render/render-block.ts +305 -0
- package/src/render/term-archive.ts +78 -0
- package/src/styles/archive.css +39 -0
- package/src/styles/base.css +1106 -0
- package/src/styles/blocks.css +1238 -0
- package/src/styles/theme.css +34 -0
- package/src/styles/tokens.css +307 -0
- package/tokens.json +36 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { aspectRatio, h } from '@cogenta/theme-kit';
|
|
2
|
+
/**
|
|
3
|
+
* Nothing here contacts a third party before the visitor has consented.
|
|
4
|
+
*
|
|
5
|
+
* When `consentRequired` is true the block renders a self-contained card and
|
|
6
|
+
* an outbound link — no `<iframe>`, no `<script>`, no preconnect, no poster
|
|
7
|
+
* image fetched from the provider.
|
|
8
|
+
*/
|
|
9
|
+
function frameSource(provider, rawUrl) {
|
|
10
|
+
const url = URL.parse(rawUrl);
|
|
11
|
+
if (url === null)
|
|
12
|
+
return null;
|
|
13
|
+
const segments = url.pathname.split('/').filter((segment) => segment !== '');
|
|
14
|
+
switch (provider) {
|
|
15
|
+
case 'youtube': {
|
|
16
|
+
const id = url.hostname.endsWith('youtu.be')
|
|
17
|
+
? segments[0]
|
|
18
|
+
: (url.searchParams.get('v') ?? segments[1]);
|
|
19
|
+
return id === undefined || id === null ? null : `https://www.youtube-nocookie.com/embed/${id}`;
|
|
20
|
+
}
|
|
21
|
+
case 'vimeo': {
|
|
22
|
+
const id = segments.find((segment) => /^\d+$/.test(segment));
|
|
23
|
+
return id === undefined ? null : `https://player.vimeo.com/video/${id}`;
|
|
24
|
+
}
|
|
25
|
+
case 'dailymotion': {
|
|
26
|
+
const id = url.hostname.endsWith('dai.ly') ? segments[0] : segments[segments.length - 1];
|
|
27
|
+
return id === undefined ? null : `https://geo.dailymotion.com/player.html?video=${id}`;
|
|
28
|
+
}
|
|
29
|
+
case 'spotify': {
|
|
30
|
+
const [kind, id] = segments;
|
|
31
|
+
return kind === undefined || id === undefined
|
|
32
|
+
? null
|
|
33
|
+
: `https://open.spotify.com/embed/${kind}/${id}`;
|
|
34
|
+
}
|
|
35
|
+
case 'soundcloud':
|
|
36
|
+
return `https://w.soundcloud.com/player/?url=${encodeURIComponent(rawUrl)}`;
|
|
37
|
+
default:
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function consentCard(block, ctx, reason) {
|
|
42
|
+
return h('div', { class: 'cg-embed__placeholder' }, h('p', { class: 'cg-embed__provider', 'aria-hidden': 'true' }, block.provider), h('p', { class: 'cg-embed__notice' }, reason), h('a', {
|
|
43
|
+
class: 'cg-embed__link',
|
|
44
|
+
href: ctx.link(block.url),
|
|
45
|
+
rel: 'noopener noreferrer nofollow',
|
|
46
|
+
}, ctx.t('embed.open', { provider: block.provider })));
|
|
47
|
+
}
|
|
48
|
+
export function renderEmbed(block, ctx) {
|
|
49
|
+
const source = block.consentRequired ? null : frameSource(block.provider, block.url);
|
|
50
|
+
const ratio = aspectRatio(block.ratio) ?? '16 / 9';
|
|
51
|
+
return h('div', {
|
|
52
|
+
class: 'cg-block cg-embed',
|
|
53
|
+
'data-block': 'embed',
|
|
54
|
+
'data-provider': block.provider,
|
|
55
|
+
'data-consent': block.consentRequired ? 'required' : 'not-required',
|
|
56
|
+
style: `--cg-ratio:${ratio}`,
|
|
57
|
+
}, source === null
|
|
58
|
+
? consentCard(block, ctx, block.consentRequired
|
|
59
|
+
? ctx.t('embed.consentRequired', { provider: block.provider })
|
|
60
|
+
: ctx.t('embed.unsupported', { provider: block.provider }))
|
|
61
|
+
: h('iframe', {
|
|
62
|
+
class: 'cg-embed__frame',
|
|
63
|
+
src: source,
|
|
64
|
+
title: ctx.t('embed.title', { provider: block.provider }),
|
|
65
|
+
loading: 'lazy',
|
|
66
|
+
referrerpolicy: 'strict-origin-when-cross-origin',
|
|
67
|
+
allow: 'accelerometer; clipboard-write; encrypted-media; picture-in-picture; fullscreen',
|
|
68
|
+
allowfullscreen: true,
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=embed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embed.js","sourceRoot":"","sources":["../../../../src/render/blocks/embed.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAoB,CAAC,EAAsB,MAAM,oBAAoB,CAAA;AAEzF;;;;;;GAMG;AAEH,SAAS,WAAW,CAAC,QAAgC,EAAE,MAAc;IACnE,MAAM,GA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,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAiB1E"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { blockHeadingTag, h, heading, renderRichText, } from '@cogenta/theme-kit';
|
|
2
|
+
/**
|
|
3
|
+
* `<details>`/`<summary>` rather than a scripted accordion: expanding,
|
|
4
|
+
* keyboard operation, and the expanded state announced to assistive
|
|
5
|
+
* technology all come from the browser, at zero bytes of JavaScript.
|
|
6
|
+
*/
|
|
7
|
+
function renderItem(item, ctx) {
|
|
8
|
+
return h('li', { class: 'cg-faq__item' }, h('details', { class: 'cg-faq__details' }, h('summary', { class: 'cg-faq__question' }, item.question), h('div', { class: 'cg-faq__answer' }, renderRichText(ctx, item.answer))));
|
|
9
|
+
}
|
|
10
|
+
export function renderFaq(block, ctx) {
|
|
11
|
+
return h('section', { class: 'cg-block cg-faq', 'data-block': 'faq' }, block.title === undefined
|
|
12
|
+
? null
|
|
13
|
+
: heading(blockHeadingTag('faq') ?? 'h2', { class: 'cg-faq__title', 'data-field': 'title' }, block.title), h('ul', { class: 'cg-faq__items' }, block.items.map((item) => renderItem(item, ctx))));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=faq.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"faq.js","sourceRoot":"","sources":["../../../../src/render/blocks/faq.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EAEf,CAAC,EACD,OAAO,EAEP,cAAc,GACf,MAAM,oBAAoB,CAAA;AAE3B;;;;GAIG;AACH,SAAS,UAAU,CAAC,IAAa,EAAE,GAAkB;IACnD,OAAO,CAAC,CACN,IAAI,EACJ,EAAE,KAAK,EAAE,cAAc,EAAE,EACzB,CAAC,CACC,SAAS,EACT,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAC5B,CAAC,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,EAC1D,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CACxE,CACF,CAAA;AACH,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,KAAe,EAAE,GAAkB;IAC3D,OAAO,CAAC,CACN,SAAS,EACT,EAAE,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,KAAK,EAAE,EACjD,KAAK,CAAC,KAAK,KAAK,SAAS;QACvB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,OAAO,CACL,eAAe,CAAC,KAAK,CAAC,IAAI,IAAI,EAC9B,EAAE,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,OAAO,EAAE,EACjD,KAAK,CAAC,KAAK,CACZ,EACL,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,eAAe,EAAE,EAC1B,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CACjD,CACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { FeatureGridBlock } from '@cogenta/blocks';
|
|
2
|
+
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
|
+
export declare function renderFeatureGrid(block: FeatureGridBlock, ctx: RenderContext): HtmlElement;
|
|
4
|
+
//# sourceMappingURL=feature-grid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature-grid.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/feature-grid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAe,MAAM,iBAAiB,CAAA;AACpE,OAAO,EAGL,KAAK,WAAW,EAKhB,KAAK,aAAa,EAEnB,MAAM,oBAAoB,CAAA;AAoC3B,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAmB1F"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { blockHeadingTag, h, heading, href, nestedHeadingTag, renderIcon, } from '@cogenta/theme-kit';
|
|
2
|
+
/**
|
|
3
|
+
* The item's title is the link, so the link's accessible name is the
|
|
4
|
+
* feature's own name (WCAG 2.4.4) — the block carries no separate label
|
|
5
|
+
* field to write a "learn more" with anyway.
|
|
6
|
+
*
|
|
7
|
+
* `icon` names a symbol, never markup: when the name is one `renderIcon`
|
|
8
|
+
* recognises it becomes a real inline glyph, `aria-hidden` since the title
|
|
9
|
+
* already names the card. An unrecognised name keeps the bare, empty
|
|
10
|
+
* `data-icon` span for a skin/plugin to key off.
|
|
11
|
+
*/
|
|
12
|
+
function renderItem(item, ctx, tag) {
|
|
13
|
+
const title = item.link === undefined
|
|
14
|
+
? heading(tag, { class: 'cg-feature__title' }, item.title)
|
|
15
|
+
: heading(tag, { class: 'cg-feature__title' }, h('a', { class: 'cg-feature__link', href: href(ctx, item.link) }, item.title));
|
|
16
|
+
return h('li', { class: 'cg-feature' }, item.icon === undefined
|
|
17
|
+
? null
|
|
18
|
+
: h('span', { class: 'cg-feature__icon', 'data-icon': item.icon, 'aria-hidden': 'true' }, renderIcon(item.icon)), title, item.text === undefined ? null : h('p', { class: 'cg-feature__text' }, item.text));
|
|
19
|
+
}
|
|
20
|
+
export function renderFeatureGrid(block, ctx) {
|
|
21
|
+
const hasTitle = block.title !== undefined;
|
|
22
|
+
const itemTag = nestedHeadingTag('featureGrid', hasTitle);
|
|
23
|
+
return h('section', { class: 'cg-block cg-features', 'data-block': 'featureGrid' }, hasTitle
|
|
24
|
+
? heading(blockHeadingTag('featureGrid') ?? 'h2', { class: 'cg-features__title', 'data-field': 'title' }, block.title ?? '')
|
|
25
|
+
: null, h('ul', { class: 'cg-features__items' }, block.items.map((item) => renderItem(item, ctx, itemTag))));
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=feature-grid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature-grid.js","sourceRoot":"","sources":["../../../../src/render/blocks/feature-grid.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EAGf,CAAC,EACD,OAAO,EACP,IAAI,EACJ,gBAAgB,EAEhB,UAAU,GACX,MAAM,oBAAoB,CAAA;AAE3B;;;;;;;;;GASG;AACH,SAAS,UAAU,CAAC,IAAiB,EAAE,GAAkB,EAAE,GAAe;IACxE,MAAM,KAAK,GACT,IAAI,CAAC,IAAI,KAAK,SAAS;QACrB,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC;QAC1D,CAAC,CAAC,OAAO,CACL,GAAG,EACH,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAC9B,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAC9E,CAAA;IACP,OAAO,CAAC,CACN,IAAI,EACJ,EAAE,KAAK,EAAE,YAAY,EAAE,EACvB,IAAI,CAAC,IAAI,KAAK,SAAS;QACrB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,CACC,MAAM,EACN,EAAE,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,IAAI,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,EAC5E,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CACtB,EACL,KAAK,EACL,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAClF,CAAA;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAuB,EAAE,GAAkB;IAC3E,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,KAAK,SAAS,CAAA;IAC1C,MAAM,OAAO,GAAG,gBAAgB,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAA;IACzD,OAAO,CAAC,CACN,SAAS,EACT,EAAE,KAAK,EAAE,sBAAsB,EAAE,YAAY,EAAE,aAAa,EAAE,EAC9D,QAAQ;QACN,CAAC,CAAC,OAAO,CACL,eAAe,CAAC,aAAa,CAAC,IAAI,IAAI,EACtC,EAAE,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,OAAO,EAAE,EACtD,KAAK,CAAC,KAAK,IAAI,EAAE,CAClB;QACH,CAAC,CAAC,IAAI,EACR,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,oBAAoB,EAAE,EAC/B,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,CAC1D,CACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { GalleryBlock } from '@cogenta/blocks';
|
|
2
|
+
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
|
+
/**
|
|
4
|
+
* The carousel ships **no JavaScript**. It is a scroll-snapping list, which
|
|
5
|
+
* gives touch swiping, trackpad scrolling and — because the list is
|
|
6
|
+
* focusable and labelled — arrow-key scrolling, with none of the failure
|
|
7
|
+
* modes of a scripted carousel.
|
|
8
|
+
*/
|
|
9
|
+
export declare function renderGallery(block: GalleryBlock, ctx: RenderContext): HtmlElement;
|
|
10
|
+
//# sourceMappingURL=gallery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gallery.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/gallery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEnF;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CA6BlF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { h, image } from '@cogenta/theme-kit';
|
|
2
|
+
/**
|
|
3
|
+
* The carousel ships **no JavaScript**. It is a scroll-snapping list, which
|
|
4
|
+
* gives touch swiping, trackpad scrolling and — because the list is
|
|
5
|
+
* focusable and labelled — arrow-key scrolling, with none of the failure
|
|
6
|
+
* modes of a scripted carousel.
|
|
7
|
+
*/
|
|
8
|
+
export function renderGallery(block, ctx) {
|
|
9
|
+
const items = h('ul', { class: 'cg-gallery__items' }, block.items.map((item) => h('li', { class: 'cg-gallery__item' }, image(ctx, item.media, { sizes: '(min-width: 45rem) 20rem, 60vw' }))));
|
|
10
|
+
return h('section', { class: 'cg-block cg-gallery', 'data-block': 'gallery', 'data-layout': block.layout }, block.layout === 'carousel'
|
|
11
|
+
? h('div', {
|
|
12
|
+
class: 'cg-gallery__viewport',
|
|
13
|
+
role: 'region',
|
|
14
|
+
'aria-label': ctx.t('gallery.carousel'),
|
|
15
|
+
tabindex: '0',
|
|
16
|
+
}, items)
|
|
17
|
+
: items);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=gallery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gallery.js","sourceRoot":"","sources":["../../../../src/render/blocks/gallery.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAE,KAAK,EAAsB,MAAM,oBAAoB,CAAA;AAEnF;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,KAAmB,EAAE,GAAkB;IACnE,MAAM,KAAK,GAAG,CAAC,CACb,IAAI,EACJ,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAC9B,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACvB,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAC7B,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,gCAAgC,EAAE,CAAC,CACpE,CACF,CACF,CAAA;IAED,OAAO,CAAC,CACN,SAAS,EACT,EAAE,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,KAAK,CAAC,MAAM,EAAE,EACtF,KAAK,CAAC,MAAM,KAAK,UAAU;QACzB,CAAC,CAAC,CAAC,CACC,KAAK,EACL;YACE,KAAK,EAAE,sBAAsB;YAC7B,IAAI,EAAE,QAAQ;YACd,YAAY,EAAE,GAAG,CAAC,CAAC,CAAC,kBAAkB,CAAC;YACvC,QAAQ,EAAE,GAAG;SACd,EACD,KAAK,CACN;QACH,CAAC,CAAC,KAAK,CACV,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { HeroBlock } from '@cogenta/blocks';
|
|
2
|
+
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
|
+
/**
|
|
4
|
+
* The hero carries the page's `h1` (contract B: `headingLevel: 'h1'`), so
|
|
5
|
+
* `renderPage` relies on it to avoid emitting a second one.
|
|
6
|
+
*
|
|
7
|
+
* A reference-docs hero: copy on the left, a decorative search-looking
|
|
8
|
+
* prompt right under the actions (purely presentational — `aria-hidden`,
|
|
9
|
+
* no `<input>`, no `<form>` — this theme ships zero client JavaScript and a
|
|
10
|
+
* fake control that looked operable would be a worse failure than no
|
|
11
|
+
* control at all), and an optional small illustration on the right rather
|
|
12
|
+
* than a full-bleed image wash, matching the information-dense register the
|
|
13
|
+
* aesthetic direction asks for.
|
|
14
|
+
*/
|
|
15
|
+
export declare function renderHero(block: HeroBlock, ctx: RenderContext): HtmlElement;
|
|
16
|
+
//# sourceMappingURL=hero.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hero.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/hero.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAGL,KAAK,WAAW,EAIhB,KAAK,aAAa,EAEnB,MAAM,oBAAoB,CAAA;AAE3B;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAoC5E"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { actionList, blockHeadingTag, h, heading, image, renderIcon, } from '@cogenta/theme-kit';
|
|
2
|
+
/**
|
|
3
|
+
* The hero carries the page's `h1` (contract B: `headingLevel: 'h1'`), so
|
|
4
|
+
* `renderPage` relies on it to avoid emitting a second one.
|
|
5
|
+
*
|
|
6
|
+
* A reference-docs hero: copy on the left, a decorative search-looking
|
|
7
|
+
* prompt right under the actions (purely presentational — `aria-hidden`,
|
|
8
|
+
* no `<input>`, no `<form>` — this theme ships zero client JavaScript and a
|
|
9
|
+
* fake control that looked operable would be a worse failure than no
|
|
10
|
+
* control at all), and an optional small illustration on the right rather
|
|
11
|
+
* than a full-bleed image wash, matching the information-dense register the
|
|
12
|
+
* aesthetic direction asks for.
|
|
13
|
+
*/
|
|
14
|
+
export function renderHero(block, ctx) {
|
|
15
|
+
const tag = blockHeadingTag('hero') ?? 'h1';
|
|
16
|
+
return h('section', { class: 'cg-block cg-hero', 'data-block': 'hero' }, h('div', { class: 'cg-hero__copy' }, block.eyebrow === undefined
|
|
17
|
+
? null
|
|
18
|
+
: h('p', { class: 'cg-hero__eyebrow', 'data-field': 'eyebrow' }, block.eyebrow), heading(tag, { class: 'cg-hero__title', 'data-field': 'title' }, block.title), block.subtitle === undefined
|
|
19
|
+
? null
|
|
20
|
+
: h('p', { class: 'cg-hero__subtitle', 'data-field': 'subtitle' }, block.subtitle), actionList(ctx, block.actions, ctx.t('hero.actions')), h('div', { class: 'cg-hero__search', 'aria-hidden': 'true' }, renderIcon('search', { className: 'cg-hero__search-icon' }), h('span', { class: 'cg-hero__search-text' }, 'Search the docs…'), h('kbd', { class: 'cg-hero__search-key' }, '/'))), block.media === undefined
|
|
21
|
+
? null
|
|
22
|
+
: h('div', { class: 'cg-hero__panel' }, image(ctx, block.media, {
|
|
23
|
+
className: 'cg-hero__media',
|
|
24
|
+
loading: 'eager',
|
|
25
|
+
sizes: '(min-width: 64rem) 32vw, 100vw',
|
|
26
|
+
})));
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=hero.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hero.js","sourceRoot":"","sources":["../../../../src/render/blocks/hero.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,eAAe,EAEf,CAAC,EACD,OAAO,EACP,KAAK,EAEL,UAAU,GACX,MAAM,oBAAoB,CAAA;AAE3B;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,UAAU,CAAC,KAAgB,EAAE,GAAkB;IAC7D,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,IAAI,IAAI,CAAA;IAC3C,OAAO,CAAC,CACN,SAAS,EACT,EAAE,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,EAAE,EACnD,CAAC,CACC,KAAK,EACL,EAAE,KAAK,EAAE,eAAe,EAAE,EAC1B,KAAK,CAAC,OAAO,KAAK,SAAS;QACzB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,EACjF,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,OAA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,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAatF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { h, image } from '@cogenta/theme-kit';
|
|
2
|
+
/**
|
|
3
|
+
* `blocks@2.0` (RFC 0001). The lighter-weight "as seen in" row next to
|
|
4
|
+
* `logos`: no per-logo name or link, so no accessible-name field to
|
|
5
|
+
* require — each image's own alt text (set once, in the media library)
|
|
6
|
+
* names it.
|
|
7
|
+
*/
|
|
8
|
+
function renderItem(item, _ctx) {
|
|
9
|
+
return h('li', { class: 'cg-logo-band__item' }, image(_ctx, item.media, { className: 'cg-logo-band__image', variant: { fit: 'contain' } }));
|
|
10
|
+
}
|
|
11
|
+
export function renderLogoStrip(block, ctx) {
|
|
12
|
+
return h('figure', { class: 'cg-block cg-logo-band', 'data-block': 'logoStrip' }, h('ul', { class: 'cg-logo-band__items' }, block.logos.map((item) => renderItem(item, ctx))), block.caption === undefined
|
|
13
|
+
? null
|
|
14
|
+
: h('figcaption', { class: 'cg-logo-band__caption', 'data-field': 'caption' }, block.caption));
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=logo-strip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logo-strip.js","sourceRoot":"","sources":["../../../../src/render/blocks/logo-strip.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAE,KAAK,EAAsB,MAAM,oBAAoB,CAAA;AAEnF;;;;;GAKG;AACH,SAAS,UAAU,CAAC,IAAmB,EAAE,IAAmB;IAC1D,OAAO,CAAC,CACN,IAAI,EACJ,EAAE,KAAK,EAAE,oBAAoB,EAAE,EAC/B,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,qBAAqB,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,CAC3F,CAAA;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAqB,EAAE,GAAkB;IACvE,OAAO,CAAC,CACN,QAAQ,EACR,EAAE,KAAK,EAAE,uBAAuB,EAAE,YAAY,EAAE,WAAW,EAAE,EAC7D,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,qBAAqB,EAAE,EAChC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CACjD,EACD,KAAK,CAAC,OAAO,KAAK,SAAS;QACzB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,uBAAuB,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,CAChG,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logos.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/logos.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,EAEL,KAAK,WAAW,EAIhB,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAA;AA0B3B,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAiB9E"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { blockHeadingTag, h, heading, image, } from '@cogenta/theme-kit';
|
|
2
|
+
/**
|
|
3
|
+
* Contract B says the organisation's name **is** the accessible name of the
|
|
4
|
+
* link. So the logo image carries it as alt text when the media entity has
|
|
5
|
+
* none, and no visually hidden duplicate is added.
|
|
6
|
+
*/
|
|
7
|
+
function renderItem(item, ctx) {
|
|
8
|
+
const logo = image(ctx, item.media, {
|
|
9
|
+
className: 'cg-logo__image',
|
|
10
|
+
altFrom: item.name,
|
|
11
|
+
variant: { fit: 'contain' },
|
|
12
|
+
});
|
|
13
|
+
return h('li', { class: 'cg-logo' }, item.url === undefined
|
|
14
|
+
? logo
|
|
15
|
+
: h('a', { class: 'cg-logo__link', href: ctx.link(item.url), rel: 'noopener noreferrer' }, logo));
|
|
16
|
+
}
|
|
17
|
+
export function renderLogos(block, ctx) {
|
|
18
|
+
return h('section', { class: 'cg-block cg-logos', 'data-block': 'logos' }, block.title === undefined
|
|
19
|
+
? null
|
|
20
|
+
: heading(blockHeadingTag('logos') ?? 'h2', { class: 'cg-logos__title', 'data-field': 'title' }, block.title), h('ul', { class: 'cg-logos__items' }, block.items.map((item) => renderItem(item, ctx))));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=logos.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logos.js","sourceRoot":"","sources":["../../../../src/render/blocks/logos.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EAEf,CAAC,EACD,OAAO,EACP,KAAK,GAEN,MAAM,oBAAoB,CAAA;AAE3B;;;;GAIG;AACH,SAAS,UAAU,CAAC,IAAc,EAAE,GAAkB;IACpD,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE;QAClC,SAAS,EAAE,gBAAgB;QAC3B,OAAO,EAAE,IAAI,CAAC,IAAI;QAClB,OAAO,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE;KAC5B,CAAC,CAAA;IACF,OAAO,CAAC,CACN,IAAI,EACJ,EAAE,KAAK,EAAE,SAAS,EAAE,EACpB,IAAI,CAAC,GAAG,KAAK,SAAS;QACpB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,CACC,GAAG,EACH,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,qBAAqB,EAAE,EAChF,IAAI,CACL,CACN,CAAA;AACH,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAiB,EAAE,GAAkB;IAC/D,OAAO,CAAC,CACN,SAAS,EACT,EAAE,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,OAAO,EAAE,EACrD,KAAK,CAAC,KAAK,KAAK,SAAS;QACvB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,OAAO,CACL,eAAe,CAAC,OAAO,CAAC,IAAI,IAAI,EAChC,EAAE,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,OAAO,EAAE,EACnD,KAAK,CAAC,KAAK,CACZ,EACL,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAC5B,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CACjD,CACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MediaFigureBlock } from '@cogenta/blocks';
|
|
2
|
+
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
|
+
/**
|
|
4
|
+
* `<figure>`/`<figcaption>` rather than a div and a paragraph: the
|
|
5
|
+
* association between the picture and its caption is then in the markup,
|
|
6
|
+
* and a screen reader announces the caption as belonging to the image
|
|
7
|
+
* instead of as loose text after it.
|
|
8
|
+
*/
|
|
9
|
+
export declare function renderMediaFigure(block: MediaFigureBlock, ctx: RenderContext): HtmlElement;
|
|
10
|
+
//# sourceMappingURL=media-figure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-figure.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/media-figure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAe,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEhG;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CA0B1F"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { aspectRatio, h, image } from '@cogenta/theme-kit';
|
|
2
|
+
/**
|
|
3
|
+
* `<figure>`/`<figcaption>` rather than a div and a paragraph: the
|
|
4
|
+
* association between the picture and its caption is then in the markup,
|
|
5
|
+
* and a screen reader announces the caption as belonging to the image
|
|
6
|
+
* instead of as loose text after it.
|
|
7
|
+
*/
|
|
8
|
+
export function renderMediaFigure(block, ctx) {
|
|
9
|
+
const ratio = aspectRatio(block.ratio);
|
|
10
|
+
const hasCaption = block.caption !== undefined || block.credit !== undefined;
|
|
11
|
+
return h('figure', {
|
|
12
|
+
class: 'cg-block cg-figure',
|
|
13
|
+
'data-block': 'mediaFigure',
|
|
14
|
+
'data-align': block.align ?? 'center',
|
|
15
|
+
style: ratio === undefined ? undefined : `--cg-ratio:${ratio}`,
|
|
16
|
+
}, image(ctx, block.media, {
|
|
17
|
+
className: 'cg-figure__media',
|
|
18
|
+
sizes: '(min-width: 45rem) 40rem, 100vw',
|
|
19
|
+
}), hasCaption
|
|
20
|
+
? h('figcaption', { class: 'cg-figure__caption' }, block.caption, block.credit === undefined
|
|
21
|
+
? null
|
|
22
|
+
: h('span', { class: 'cg-figure__credit', 'data-field': 'credit' }, block.credit))
|
|
23
|
+
: null);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=media-figure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-figure.js","sourceRoot":"","sources":["../../../../src/render/blocks/media-figure.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAoB,CAAC,EAAE,KAAK,EAAsB,MAAM,oBAAoB,CAAA;AAEhG;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAuB,EAAE,GAAkB;IAC3E,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IACtC,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS,CAAA;IAC5E,OAAO,CAAC,CACN,QAAQ,EACR;QACE,KAAK,EAAE,oBAAoB;QAC3B,YAAY,EAAE,aAAa;QAC3B,YAAY,EAAE,KAAK,CAAC,KAAK,IAAI,QAAQ;QACrC,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,KAAK,EAAE;KAC/D,EACD,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,EAAE;QACtB,SAAS,EAAE,kBAAkB;QAC7B,KAAK,EAAE,iCAAiC;KACzC,CAAC,EACF,UAAU;QACR,CAAC,CAAC,CAAC,CACC,YAAY,EACZ,EAAE,KAAK,EAAE,oBAAoB,EAAE,EAC/B,KAAK,CAAC,OAAO,EACb,KAAK,CAAC,MAAM,KAAK,SAAS;YACxB,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC,CACpF;QACH,CAAC,CAAC,IAAI,CACT,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PricingTableBlock } from '@cogenta/blocks';
|
|
2
|
+
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
|
+
export declare function renderPricingTable(block: PricingTableBlock, ctx: RenderContext): HtmlElement;
|
|
4
|
+
//# sourceMappingURL=pricing-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pricing-table.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/pricing-table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAe,MAAM,iBAAiB,CAAA;AACrE,OAAO,EAIL,KAAK,WAAW,EAIhB,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAA;AA0C3B,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAmB5F"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { actionLink, blockHeadingTag, h, heading, nestedHeadingTag, } from '@cogenta/theme-kit';
|
|
2
|
+
/**
|
|
3
|
+
* `blocks@2.0` (RFC 0001). Bordered plates, one lifted (border + a small
|
|
4
|
+
* "recommended" rule) when `highlighted` is set — an editorial signal,
|
|
5
|
+
* never a colour: it becomes `data-highlighted` for the stylesheet, and
|
|
6
|
+
* `aria-current` so the emphasis is announced, not only shown.
|
|
7
|
+
*/
|
|
8
|
+
function renderTier(tier, ctx, tag) {
|
|
9
|
+
return h('li', {
|
|
10
|
+
class: 'cg-pricing__tier',
|
|
11
|
+
'data-highlighted': tier.highlighted === true ? 'true' : undefined,
|
|
12
|
+
'aria-current': tier.highlighted === true ? 'true' : undefined,
|
|
13
|
+
}, heading(tag, { class: 'cg-pricing__name' }, tier.name), h('p', { class: 'cg-pricing__price' }, h('span', { class: 'cg-pricing__amount' }, tier.price), tier.interval === undefined
|
|
14
|
+
? null
|
|
15
|
+
: h('span', { class: 'cg-pricing__interval' }, tier.interval)), tier.features.length === 0
|
|
16
|
+
? null
|
|
17
|
+
: h('ul', { class: 'cg-pricing__features' }, tier.features.map((feature) => h('li', { class: 'cg-pricing__feature' }, feature))), tier.action === undefined
|
|
18
|
+
? null
|
|
19
|
+
: h('div', { class: 'cg-pricing__action' }, actionLink(ctx, { ...tier.action, emphasis: tier.action.emphasis ?? 'primary' })));
|
|
20
|
+
}
|
|
21
|
+
export function renderPricingTable(block, ctx) {
|
|
22
|
+
const hasTitle = block.title !== undefined;
|
|
23
|
+
const tierTag = nestedHeadingTag('pricingTable', hasTitle);
|
|
24
|
+
return h('section', { class: 'cg-block cg-pricing', 'data-block': 'pricingTable' }, hasTitle
|
|
25
|
+
? heading(blockHeadingTag('pricingTable') ?? 'h2', { class: 'cg-pricing__title', 'data-field': 'title' }, block.title ?? '')
|
|
26
|
+
: null, h('ul', { class: 'cg-pricing__tiers' }, block.tiers.map((tier) => renderTier(tier, ctx, tierTag))));
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=pricing-table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pricing-table.js","sourceRoot":"","sources":["../../../../src/render/blocks/pricing-table.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,eAAe,EAGf,CAAC,EACD,OAAO,EACP,gBAAgB,GAEjB,MAAM,oBAAoB,CAAA;AAE3B;;;;;GAKG;AACH,SAAS,UAAU,CAAC,IAAiB,EAAE,GAAkB,EAAE,GAAe;IACxE,OAAO,CAAC,CACN,IAAI,EACJ;QACE,KAAK,EAAE,kBAAkB;QACzB,kBAAkB,EAAE,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;QAClE,cAAc,EAAE,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;KAC/D,EACD,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,EACtD,CAAC,CACC,GAAG,EACH,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAC9B,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EACtD,IAAI,CAAC,QAAQ,KAAK,SAAS;QACzB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,sBAAsB,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,CAChE,EACD,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC;QACxB,CAAC,CA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C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prose.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/prose.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EACL,KAAK,WAAW,EAGhB,KAAK,aAAa,EAEnB,MAAM,oBAAoB,CAAA;AAmC3B,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAM9E"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { h, renderRichText, } from '@cogenta/theme-kit';
|
|
2
|
+
/**
|
|
3
|
+
* `prose` declares `headingLevel: 'none'`: it contributes no heading of its
|
|
4
|
+
* own. Whatever headings appear come from the rich text document, whose
|
|
5
|
+
* vocabulary starts at `h2`.
|
|
6
|
+
*
|
|
7
|
+
* Contract A's rich text schema (`@cogenta/schema`, frozen) has no fenced
|
|
8
|
+
* "code block" node — the only code-shaped thing it can carry is a
|
|
9
|
+
* paragraph whose sole span carries the `code` mark, which
|
|
10
|
+
* `renderRichText` (`@cogenta/theme-kit`) already turns into
|
|
11
|
+
* `<p><code>…</code></p>`. A documentation theme without a real, multi-line
|
|
12
|
+
* code block would be dishonest about what it is for, so this is the one
|
|
13
|
+
* place in the theme that post-processes theme-kit's own output rather than
|
|
14
|
+
* writing a second rich-text renderer: a `<p>` whose only child is a bare
|
|
15
|
+
* `<code>` is promoted to `<pre><code>`, everything else is untouched. The
|
|
16
|
+
* transform only ever changes two tag names on an already-escaped tree — no
|
|
17
|
+
* new content is invented, and R3 (a block never stores HTML) still holds,
|
|
18
|
+
* since the source is still the same structured span the editor wrote.
|
|
19
|
+
*/
|
|
20
|
+
function promoteCodeBlocks(nodes) {
|
|
21
|
+
return nodes.map((node) => {
|
|
22
|
+
if (node.kind !== 'element')
|
|
23
|
+
return node;
|
|
24
|
+
if (node.tag === 'p' &&
|
|
25
|
+
node.children.length === 1 &&
|
|
26
|
+
node.children[0]?.kind === 'element' &&
|
|
27
|
+
node.children[0].tag === 'code') {
|
|
28
|
+
return h('pre', { class: 'cg-prose__code' }, node.children[0]);
|
|
29
|
+
}
|
|
30
|
+
return node;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
export function renderProse(block, ctx) {
|
|
34
|
+
return h('div', { class: 'cg-block cg-prose', 'data-block': 'prose' }, promoteCodeBlocks(renderRichText(ctx, block.body)));
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=prose.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prose.js","sourceRoot":"","sources":["../../../../src/render/blocks/prose.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,CAAC,EAED,cAAc,GACf,MAAM,oBAAoB,CAAA;AAE3B;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAS,iBAAiB,CAAC,KAA0B;IACnD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACxB,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS;YAAE,OAAO,IAAI,CAAA;QACxC,IACE,IAAI,CAAC,GAAG,KAAK,GAAG;YAChB,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC;YAC1B,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,KAAK,SAAS;YACpC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,MAAM,EAC/B,CAAC;YACD,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;QAChE,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAiB,EAAE,GAAkB;IAC/D,OAAO,CAAC,CACN,KAAK,EACL,EAAE,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,OAAO,EAAE,EACrD,iBAAiB,CAAC,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CACnD,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { QuoteBlock } from '@cogenta/blocks';
|
|
2
|
+
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
|
+
/**
|
|
4
|
+
* `<figure><blockquote>…</blockquote><figcaption>` is the attribution
|
|
5
|
+
* pattern the HTML spec prescribes: putting the author inside the
|
|
6
|
+
* `<blockquote>` would claim the author's name is part of what was said.
|
|
7
|
+
*/
|
|
8
|
+
export declare function renderQuote(block: QuoteBlock, ctx: RenderContext): HtmlElement;
|
|
9
|
+
//# sourceMappingURL=quote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quote.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/quote.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEnF;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CA0B9E"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { h, image } from '@cogenta/theme-kit';
|
|
2
|
+
/**
|
|
3
|
+
* `<figure><blockquote>…</blockquote><figcaption>` is the attribution
|
|
4
|
+
* pattern the HTML spec prescribes: putting the author inside the
|
|
5
|
+
* `<blockquote>` would claim the author's name is part of what was said.
|
|
6
|
+
*/
|
|
7
|
+
export function renderQuote(block, ctx) {
|
|
8
|
+
const hasAttribution = block.author !== undefined || block.role !== undefined || block.avatar !== undefined;
|
|
9
|
+
return h('figure', { class: 'cg-block cg-quote', 'data-block': 'quote' }, h('blockquote', { class: 'cg-quote__text' }, h('p', { 'data-field': 'text' }, block.text)), hasAttribution
|
|
10
|
+
? h('figcaption', { class: 'cg-quote__attribution' }, block.avatar === undefined
|
|
11
|
+
? null
|
|
12
|
+
: image(ctx, block.avatar, {
|
|
13
|
+
className: 'cg-quote__avatar',
|
|
14
|
+
variant: { width: 96, height: 96, fit: 'cover' },
|
|
15
|
+
}), block.author === undefined
|
|
16
|
+
? null
|
|
17
|
+
: h('span', { class: 'cg-quote__author', 'data-field': 'author' }, block.author), block.role === undefined
|
|
18
|
+
? null
|
|
19
|
+
: h('span', { class: 'cg-quote__role', 'data-field': 'role' }, block.role))
|
|
20
|
+
: null);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=quote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quote.js","sourceRoot":"","sources":["../../../../src/render/blocks/quote.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAE,KAAK,EAAsB,MAAM,oBAAoB,CAAA;AAEnF;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,KAAiB,EAAE,GAAkB;IAC/D,MAAM,cAAc,GAClB,KAAK,CAAC,MAAM,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS,CAAA;IACtF,OAAO,CAAC,CACN,QAAQ,EACR,EAAE,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,OAAO,EAAE,EACrD,CAAC,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,EAC1F,cAAc;QACZ,CAAC,CAAC,CAAC,CACC,YAAY,EACZ,EAAE,KAAK,EAAE,uBAAuB,EAAE,EAClC,KAAK,CAAC,MAAM,KAAK,SAAS;YACxB,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,EAAE;gBACvB,SAAS,EAAE,kBAAkB;gBAC7B,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE;aACjD,CAAC,EACN,KAAK,CAAC,MAAM,KAAK,SAAS;YACxB,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC,EAClF,KAAK,CAAC,IAAI,KAAK,SAAS;YACtB,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,CAC7E;QACH,CAAC,CAAC,IAAI,CACT,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { StatCounterBlock } from '@cogenta/blocks';
|
|
2
|
+
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
|
+
export declare function renderStatCounter(block: StatCounterBlock, _ctx: RenderContext): HtmlElement;
|
|
4
|
+
//# sourceMappingURL=stat-counter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stat-counter.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/stat-counter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAmB,MAAM,iBAAiB,CAAA;AACxE,OAAO,EAEL,KAAK,WAAW,EAGhB,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAA;AAgB3B,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,aAAa,GAAG,WAAW,CAa3F"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { blockHeadingTag, h, heading, } from '@cogenta/theme-kit';
|
|
2
|
+
/**
|
|
3
|
+
* `blocks@2.0` (RFC 0001). A `<dl>`, exactly like `stats`: the label sits
|
|
4
|
+
* before the figure in markup (WCAG 1.3.2); the stylesheet paints the big
|
|
5
|
+
* figure first.
|
|
6
|
+
*/
|
|
7
|
+
function renderItem(item) {
|
|
8
|
+
return h('div', { class: 'cg-kpi' }, h('dt', { class: 'cg-kpi__label' }, item.label), h('dd', { class: 'cg-kpi__value' }, item.value));
|
|
9
|
+
}
|
|
10
|
+
export function renderStatCounter(block, _ctx) {
|
|
11
|
+
return h('section', { class: 'cg-block cg-kpis', 'data-block': 'statCounter' }, block.title === undefined
|
|
12
|
+
? null
|
|
13
|
+
: heading(blockHeadingTag('statCounter') ?? 'h2', { class: 'cg-kpis__title', 'data-field': 'title' }, block.title), h('dl', { class: 'cg-kpis__items' }, block.stats.map(renderItem)));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=stat-counter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stat-counter.js","sourceRoot":"","sources":["../../../../src/render/blocks/stat-counter.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EAEf,CAAC,EACD,OAAO,GAER,MAAM,oBAAoB,CAAA;AAE3B;;;;GAIG;AACH,SAAS,UAAU,CAAC,IAAqB;IACvC,OAAO,CAAC,CACN,KAAK,EACL,EAAE,KAAK,EAAE,QAAQ,EAAE,EACnB,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EAC/C,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAChD,CAAA;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAuB,EAAE,IAAmB;IAC5E,OAAO,CAAC,CACN,SAAS,EACT,EAAE,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,aAAa,EAAE,EAC1D,KAAK,CAAC,KAAK,KAAK,SAAS;QACvB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,OAAO,CACL,eAAe,CAAC,aAAa,CAAC,IAAI,IAAI,EACtC,EAAE,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,OAAO,EAAE,EAClD,KAAK,CAAC,KAAK,CACZ,EACL,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAClE,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/stats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,EAEL,KAAK,WAAW,EAGhB,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAA;AAiB3B,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,GAAG,WAAW,CAa/E"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { blockHeadingTag, h, heading, } from '@cogenta/theme-kit';
|
|
2
|
+
/** A description list: each figure is the description of its label. */
|
|
3
|
+
function renderItem(item) {
|
|
4
|
+
return h('div', { class: 'cg-stat' }, h('dt', { class: 'cg-stat__label' }, item.label), h('dd', { class: 'cg-stat__value' }, item.value, item.unit === undefined ? null : h('span', { class: 'cg-stat__unit' }, item.unit)));
|
|
5
|
+
}
|
|
6
|
+
export function renderStats(block, _ctx) {
|
|
7
|
+
return h('section', { class: 'cg-block cg-stats', 'data-block': 'stats' }, block.title === undefined
|
|
8
|
+
? null
|
|
9
|
+
: heading(blockHeadingTag('stats') ?? 'h2', { class: 'cg-stats__title', 'data-field': 'title' }, block.title), h('dl', { class: 'cg-stats__items' }, block.items.map(renderItem)));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=stats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats.js","sourceRoot":"","sources":["../../../../src/render/blocks/stats.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EAEf,CAAC,EACD,OAAO,GAER,MAAM,oBAAoB,CAAA;AAE3B,uEAAuE;AACvE,SAAS,UAAU,CAAC,IAAc;IAChC,OAAO,CAAC,CACN,KAAK,EACL,EAAE,KAAK,EAAE,SAAS,EAAE,EACpB,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EAChD,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAC3B,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAClF,CACF,CAAA;AACH,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAiB,EAAE,IAAmB;IAChE,OAAO,CAAC,CACN,SAAS,EACT,EAAE,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,OAAO,EAAE,EACrD,KAAK,CAAC,KAAK,KAAK,SAAS;QACvB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,OAAO,CACL,eAAe,CAAC,OAAO,CAAC,IAAI,IAAI,EAChC,EAAE,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,OAAO,EAAE,EACnD,KAAK,CAAC,KAAK,CACZ,EACL,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CACnE,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TestimonialBlock } from '@cogenta/blocks';
|
|
2
|
+
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
|
+
/**
|
|
4
|
+
* `blocks@2.0` (RFC 0001). The same `<figure><blockquote>…</blockquote>
|
|
5
|
+
* <figcaption>` pattern `quote` uses, kept consistent so the two read as
|
|
6
|
+
* siblings — the quote itself is rich text here, and the attribution is
|
|
7
|
+
* the block's single grouped `attribution` field rather than three loose
|
|
8
|
+
* ones.
|
|
9
|
+
*/
|
|
10
|
+
export declare function renderTestimonial(block: TestimonialBlock, ctx: RenderContext): HtmlElement;
|
|
11
|
+
//# sourceMappingURL=testimonial.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testimonial.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/testimonial.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,KAAK,WAAW,EAAY,KAAK,aAAa,EAAkB,MAAM,oBAAoB,CAAA;AAEnG;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAyB1F"}
|