@cogenta/theme-docs 0.3.2 → 0.5.3
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/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/render/blocks/accordion.d.ts +8 -0
- package/dist/src/render/blocks/accordion.d.ts.map +1 -1
- package/dist/src/render/blocks/accordion.js +10 -10
- package/dist/src/render/blocks/accordion.js.map +1 -1
- package/dist/src/render/blocks/collection-list.d.ts +3 -11
- package/dist/src/render/blocks/collection-list.d.ts.map +1 -1
- package/dist/src/render/blocks/collection-list.js +69 -68
- package/dist/src/render/blocks/collection-list.js.map +1 -1
- package/dist/src/render/blocks/cta.d.ts +6 -0
- package/dist/src/render/blocks/cta.d.ts.map +1 -1
- package/dist/src/render/blocks/cta.js +9 -4
- package/dist/src/render/blocks/cta.js.map +1 -1
- package/dist/src/render/blocks/embed.d.ts.map +1 -1
- package/dist/src/render/blocks/embed.js +14 -13
- package/dist/src/render/blocks/embed.js.map +1 -1
- package/dist/src/render/blocks/faq.d.ts +7 -0
- package/dist/src/render/blocks/faq.d.ts.map +1 -1
- package/dist/src/render/blocks/faq.js +10 -10
- package/dist/src/render/blocks/faq.js.map +1 -1
- package/dist/src/render/blocks/feature-grid.d.ts.map +1 -1
- package/dist/src/render/blocks/feature-grid.js +19 -19
- package/dist/src/render/blocks/feature-grid.js.map +1 -1
- package/dist/src/render/blocks/gallery.d.ts +8 -4
- package/dist/src/render/blocks/gallery.d.ts.map +1 -1
- package/dist/src/render/blocks/gallery.js +19 -13
- package/dist/src/render/blocks/gallery.js.map +1 -1
- package/dist/src/render/blocks/hero.d.ts +12 -9
- package/dist/src/render/blocks/hero.d.ts.map +1 -1
- package/dist/src/render/blocks/hero.js +22 -20
- package/dist/src/render/blocks/hero.js.map +1 -1
- package/dist/src/render/blocks/logo-strip.d.ts +6 -0
- package/dist/src/render/blocks/logo-strip.d.ts.map +1 -1
- package/dist/src/render/blocks/logo-strip.js +6 -10
- package/dist/src/render/blocks/logo-strip.js.map +1 -1
- package/dist/src/render/blocks/logos.d.ts +10 -0
- package/dist/src/render/blocks/logos.d.ts.map +1 -1
- package/dist/src/render/blocks/logos.js +20 -17
- package/dist/src/render/blocks/logos.js.map +1 -1
- package/dist/src/render/blocks/media-figure.d.ts +0 -6
- package/dist/src/render/blocks/media-figure.d.ts.map +1 -1
- package/dist/src/render/blocks/media-figure.js +28 -16
- package/dist/src/render/blocks/media-figure.js.map +1 -1
- package/dist/src/render/blocks/pricing-table.d.ts.map +1 -1
- package/dist/src/render/blocks/pricing-table.js +16 -20
- package/dist/src/render/blocks/pricing-table.js.map +1 -1
- package/dist/src/render/blocks/prose.d.ts +13 -1
- package/dist/src/render/blocks/prose.d.ts.map +1 -1
- package/dist/src/render/blocks/prose.js +12 -31
- package/dist/src/render/blocks/prose.js.map +1 -1
- package/dist/src/render/blocks/quote.d.ts +5 -3
- package/dist/src/render/blocks/quote.d.ts.map +1 -1
- package/dist/src/render/blocks/quote.js +10 -14
- package/dist/src/render/blocks/quote.js.map +1 -1
- package/dist/src/render/blocks/stat-counter.d.ts +5 -0
- package/dist/src/render/blocks/stat-counter.d.ts.map +1 -1
- package/dist/src/render/blocks/stat-counter.js +6 -10
- package/dist/src/render/blocks/stat-counter.js.map +1 -1
- package/dist/src/render/blocks/stats.d.ts +10 -0
- package/dist/src/render/blocks/stats.d.ts.map +1 -1
- package/dist/src/render/blocks/stats.js +13 -8
- package/dist/src/render/blocks/stats.js.map +1 -1
- package/dist/src/render/blocks/testimonial.d.ts +4 -5
- package/dist/src/render/blocks/testimonial.d.ts.map +1 -1
- package/dist/src/render/blocks/testimonial.js +9 -13
- package/dist/src/render/blocks/testimonial.js.map +1 -1
- package/dist/src/render/chrome.d.ts +36 -1
- package/dist/src/render/chrome.d.ts.map +1 -1
- package/dist/src/render/chrome.js +122 -80
- package/dist/src/render/chrome.js.map +1 -1
- package/dist/src/render/doc-index.d.ts +25 -0
- package/dist/src/render/doc-index.d.ts.map +1 -0
- package/dist/src/render/doc-index.js +49 -0
- package/dist/src/render/doc-index.js.map +1 -0
- package/dist/src/render/doc-page.d.ts +6 -0
- package/dist/src/render/doc-page.d.ts.map +1 -0
- package/dist/src/render/doc-page.js +127 -0
- package/dist/src/render/doc-page.js.map +1 -0
- package/dist/src/render/layout.d.ts +23 -0
- package/dist/src/render/layout.d.ts.map +1 -0
- package/dist/src/render/layout.js +40 -0
- package/dist/src/render/layout.js.map +1 -0
- package/dist/src/render/render-block.d.ts +9 -6
- package/dist/src/render/render-block.d.ts.map +1 -1
- package/dist/src/render/render-block.js +47 -100
- package/dist/src/render/render-block.js.map +1 -1
- package/dist/src/render/rich-text.d.ts +26 -0
- package/dist/src/render/rich-text.d.ts.map +1 -0
- package/dist/src/render/rich-text.js +325 -0
- package/dist/src/render/rich-text.js.map +1 -0
- package/dist/src/render/search.d.ts +15 -0
- package/dist/src/render/search.d.ts.map +1 -0
- package/dist/src/render/search.js +31 -0
- package/dist/src/render/search.js.map +1 -0
- package/dist/src/render/strings.d.ts +51 -0
- package/dist/src/render/strings.d.ts.map +1 -0
- package/dist/src/render/strings.js +60 -0
- package/dist/src/render/strings.js.map +1 -0
- package/dist/src/render/term-archive.d.ts +5 -5
- package/dist/src/render/term-archive.d.ts.map +1 -1
- package/dist/src/render/term-archive.js +27 -16
- package/dist/src/render/term-archive.js.map +1 -1
- package/dist/src/render/widget-areas.d.ts +22 -0
- package/dist/src/render/widget-areas.d.ts.map +1 -0
- package/dist/src/render/widget-areas.js +29 -0
- package/dist/src/render/widget-areas.js.map +1 -0
- package/package.json +4 -4
- package/src/index.ts +2 -0
- package/src/render/blocks/accordion.ts +31 -42
- package/src/render/blocks/collection-list.ts +132 -123
- package/src/render/blocks/cta.ts +23 -18
- package/src/render/blocks/embed.ts +37 -28
- package/src/render/blocks/faq.ts +26 -37
- package/src/render/blocks/feature-grid.ts +34 -42
- package/src/render/blocks/gallery.ts +33 -29
- package/src/render/blocks/hero.ts +41 -45
- package/src/render/blocks/logo-strip.ts +21 -21
- package/src/render/blocks/logos.ts +32 -42
- package/src/render/blocks/media-figure.ts +47 -25
- package/src/render/blocks/pricing-table.ts +34 -41
- package/src/render/blocks/prose.ts +25 -40
- package/src/render/blocks/quote.ts +25 -19
- package/src/render/blocks/stat-counter.ts +27 -29
- package/src/render/blocks/stats.ts +35 -32
- package/src/render/blocks/testimonial.ts +18 -19
- package/src/render/chrome.ts +170 -83
- package/src/render/doc-index.ts +65 -0
- package/src/render/doc-page.ts +303 -0
- package/src/render/layout.ts +73 -0
- package/src/render/render-block.ts +67 -191
- package/src/render/rich-text.ts +446 -0
- package/src/render/search.ts +41 -0
- package/src/render/strings.ts +67 -0
- package/src/render/term-archive.ts +62 -38
- package/src/render/widget-areas.ts +33 -0
- package/src/styles/archive.css +21 -27
- package/src/styles/base.css +438 -838
- package/src/styles/blocks.css +658 -916
- package/src/styles/chrome.css +439 -0
- package/src/styles/docs.css +404 -0
- package/src/styles/rich.css +337 -0
- package/src/styles/theme.css +28 -23
- package/src/styles/tokens.css +209 -215
- package/src/styles/widgets.css +890 -0
- package/tokens.json +15 -15
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import type { GalleryBlock } from '@cogenta/blocks';
|
|
2
2
|
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* A set of screenshots or diagrams, each in the hairline frame.
|
|
5
|
+
*
|
|
6
|
+
* - `grid`: two or three columns, every frame cropped to the same 16:10 so
|
|
7
|
+
* the rows stay level.
|
|
8
|
+
* - `masonry`: three columns that keep each picture's own proportions.
|
|
9
|
+
* - `carousel`: one row that scrolls sideways inside the container, with
|
|
10
|
+
* scroll snapping and no script, named so a screen reader announces it as
|
|
11
|
+
* a scrollable group.
|
|
8
12
|
*/
|
|
9
13
|
export declare function renderGallery(block: GalleryBlock, ctx: RenderContext): HtmlElement;
|
|
10
14
|
//# sourceMappingURL=gallery.d.ts.map
|
|
@@ -1 +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;
|
|
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;AAGnF;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CA4BlF"}
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
import { h, image } from '@cogenta/theme-kit';
|
|
2
|
+
import { section } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* A set of screenshots or diagrams, each in the hairline frame.
|
|
5
|
+
*
|
|
6
|
+
* - `grid`: two or three columns, every frame cropped to the same 16:10 so
|
|
7
|
+
* the rows stay level.
|
|
8
|
+
* - `masonry`: three columns that keep each picture's own proportions.
|
|
9
|
+
* - `carousel`: one row that scrolls sideways inside the container, with
|
|
10
|
+
* scroll snapping and no script, named so a screen reader announces it as
|
|
11
|
+
* a scrollable group.
|
|
7
12
|
*/
|
|
8
13
|
export function renderGallery(block, ctx) {
|
|
9
|
-
const
|
|
10
|
-
return
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
role: 'region',
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
:
|
|
14
|
+
const carousel = block.layout === 'carousel';
|
|
15
|
+
return section('div', 'gallery', 'cd-gallery', { 'data-layout': block.layout, 'data-count': String(Math.min(block.items.length, 6)) }, 'div', h('ul', {
|
|
16
|
+
class: 'cd-gallery__items',
|
|
17
|
+
...(carousel
|
|
18
|
+
? { role: 'region', 'aria-label': ctx.t('gallery.carousel'), tabindex: 0 }
|
|
19
|
+
: {}),
|
|
20
|
+
}, block.items.map((item) => h('li', { class: 'cd-gallery__item cd-frame' }, image(ctx, item.media, {
|
|
21
|
+
className: 'cd-gallery__image cd-frame__image',
|
|
22
|
+
sizes: '(min-width: 64rem) 25rem, (min-width: 40rem) 50vw, 100vw',
|
|
23
|
+
})))));
|
|
18
24
|
}
|
|
19
25
|
//# sourceMappingURL=gallery.js.map
|
|
@@ -1 +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;
|
|
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;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAAC,KAAmB,EAAE,GAAkB;IACnE,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,KAAK,UAAU,CAAA;IAC5C,OAAO,OAAO,CACZ,KAAK,EACL,SAAS,EACT,YAAY,EACZ,EAAE,aAAa,EAAE,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EACtF,KAAK,EACL,CAAC,CACC,IAAI,EACJ;QACE,KAAK,EAAE,mBAAmB;QAC1B,GAAG,CAAC,QAAQ;YACV,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,CAAC,CAAC,CAAC,kBAAkB,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE;YAC1E,CAAC,CAAC,EAAE,CAAC;KACR,EACD,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACvB,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,2BAA2B,EAAE,EACtC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE;QACrB,SAAS,EAAE,mCAAmC;QAC9C,KAAK,EAAE,0DAA0D;KAClE,CAAC,CACH,CACF,CACF,CACF,CAAA;AACH,CAAC"}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import type { HeroBlock } from '@cogenta/blocks';
|
|
2
2
|
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
3
|
/**
|
|
4
|
-
* The
|
|
5
|
-
* `renderPage` relies on it to avoid emitting a second one.
|
|
4
|
+
* The opening of a documentation site: a clear statement and the search.
|
|
6
5
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
6
|
+
* Left-aligned on the grid, never centred. An eyebrow, when there is one, is
|
|
7
|
+
* a quiet line above the title (a product and its version), never a badge.
|
|
8
|
+
* The title is short and set large on the first eight columns, the subtitle
|
|
9
|
+
* says in two sentences what the documentation covers, and under it the
|
|
10
|
+
* search field at its large size: a real `GET /search` form, the first thing
|
|
11
|
+
* a reader of documentation reaches for. The actions follow, the primary one
|
|
12
|
+
* as the small teal control and the rest as underlined arrow links.
|
|
13
|
+
*
|
|
14
|
+
* Media, when an editor adds one, is a diagram or a screenshot on the last
|
|
15
|
+
* five columns in the hairline frame, loaded eagerly: it is above the fold by
|
|
16
|
+
* construction. Nothing decorative stands in for it when there is none.
|
|
14
17
|
*/
|
|
15
18
|
export declare function renderHero(block: HeroBlock, ctx: RenderContext): HtmlElement;
|
|
16
19
|
//# sourceMappingURL=hero.d.ts.map
|
|
@@ -1 +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,
|
|
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,EAAc,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAI/F;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAoC5E"}
|
|
@@ -1,28 +1,30 @@
|
|
|
1
|
-
import { actionList,
|
|
1
|
+
import { actionList, h, image } from '@cogenta/theme-kit';
|
|
2
|
+
import { optionalText } from '../layout.js';
|
|
3
|
+
import { renderSearchForm } from '../search.js';
|
|
2
4
|
/**
|
|
3
|
-
* The
|
|
4
|
-
* `renderPage` relies on it to avoid emitting a second one.
|
|
5
|
+
* The opening of a documentation site: a clear statement and the search.
|
|
5
6
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
7
|
+
* Left-aligned on the grid, never centred. An eyebrow, when there is one, is
|
|
8
|
+
* a quiet line above the title (a product and its version), never a badge.
|
|
9
|
+
* The title is short and set large on the first eight columns, the subtitle
|
|
10
|
+
* says in two sentences what the documentation covers, and under it the
|
|
11
|
+
* search field at its large size: a real `GET /search` form, the first thing
|
|
12
|
+
* a reader of documentation reaches for. The actions follow, the primary one
|
|
13
|
+
* as the small teal control and the rest as underlined arrow links.
|
|
14
|
+
*
|
|
15
|
+
* Media, when an editor adds one, is a diagram or a screenshot on the last
|
|
16
|
+
* five columns in the hairline frame, loaded eagerly: it is above the fold by
|
|
17
|
+
* construction. Nothing decorative stands in for it when there is none.
|
|
13
18
|
*/
|
|
14
19
|
export function renderHero(block, ctx) {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
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
|
|
20
|
+
const actions = actionList(ctx, block.actions, ctx.t('hero.actions'));
|
|
21
|
+
const media = block.media !== undefined;
|
|
22
|
+
return h('section', { class: 'cd-section cd-hero', 'data-block': 'hero', 'data-media': media ? 'true' : 'false' }, h('div', { class: 'cd-container cd-hero__inner' }, h('div', { class: 'cd-hero__copy' }, optionalText('p', 'cd-hero__eyebrow', block.eyebrow, { 'data-field': 'eyebrow' }), h('h1', { class: 'cd-hero__title', 'data-field': 'title' }, block.title), optionalText('p', 'cd-hero__subtitle', block.subtitle, { 'data-field': 'subtitle' }), h('div', { class: 'cd-hero__search' }, renderSearchForm(ctx.locale, 'cd-search-hero', 'large')), actions === null ? null : h('div', { class: 'cd-hero__actions' }, actions)), block.media === undefined
|
|
21
23
|
? null
|
|
22
|
-
: h('
|
|
23
|
-
className: '
|
|
24
|
+
: h('figure', { class: 'cd-hero__media cd-frame' }, image(ctx, block.media, {
|
|
25
|
+
className: 'cd-hero__image cd-frame__image',
|
|
24
26
|
loading: 'eager',
|
|
25
|
-
sizes: '(min-width: 64rem)
|
|
26
|
-
})));
|
|
27
|
+
sizes: '(min-width: 64rem) 30rem, 100vw',
|
|
28
|
+
}))));
|
|
27
29
|
}
|
|
28
30
|
//# sourceMappingURL=hero.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hero.js","sourceRoot":"","sources":["../../../../src/render/blocks/hero.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"hero.js","sourceRoot":"","sources":["../../../../src/render/blocks/hero.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAoB,CAAC,EAAE,KAAK,EAAsB,MAAM,oBAAoB,CAAA;AAC/F,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAE/C;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,UAAU,CAAC,KAAgB,EAAE,GAAkB;IAC7D,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAA;IACrE,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,KAAK,SAAS,CAAA;IAEvC,OAAO,CAAC,CACN,SAAS,EACT,EAAE,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,EAC7F,CAAC,CACC,KAAK,EACL,EAAE,KAAK,EAAE,6BAA6B,EAAE,EACxC,CAAC,CACC,KAAK,EACL,EAAE,KAAK,EAAE,eAAe,EAAE,EAC1B,YAAY,CAAC,GAAG,EAAE,kBAAkB,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,EACjF,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,EACxE,YAAY,CAAC,GAAG,EAAE,mBAAmB,EAAE,KAAK,CAAC,QAAQ,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC,EACpF,CAAC,CACC,KAAK,EACL,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAC5B,gBAAgB,CAAC,GAAG,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,CAAC,CACxD,EACD,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAAE,OAAO,CAAC,CAC3E,EACD,KAAK,CAAC,KAAK,KAAK,SAAS;QACvB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,CACC,QAAQ,EACR,EAAE,KAAK,EAAE,yBAAyB,EAAE,EACpC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,EAAE;YACtB,SAAS,EAAE,gCAAgC;YAC3C,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE,iCAAiC;SACzC,CAAC,CACH,CACN,CACF,CAAA;AACH,CAAC"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { LogoStripBlock } from '@cogenta/blocks';
|
|
2
2
|
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
|
+
/**
|
|
4
|
+
* A strip of wordmarks ("Runs in production at"): the caption on its own
|
|
5
|
+
* line above, then one row of marks at one height in grey, wrapping to three
|
|
6
|
+
* and then two to a row on smaller screens. A hairline above separates the
|
|
7
|
+
* strip from what precedes it.
|
|
8
|
+
*/
|
|
3
9
|
export declare function renderLogoStrip(block: LogoStripBlock, ctx: RenderContext): HtmlElement;
|
|
4
10
|
//# sourceMappingURL=logo-strip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logo-strip.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/logo-strip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"logo-strip.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/logo-strip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAGnF;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAoBtF"}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { h, image } from '@cogenta/theme-kit';
|
|
2
|
+
import { optionalText, section } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* A strip of wordmarks ("Runs in production at"): the caption on its own
|
|
5
|
+
* line above, then one row of marks at one height in grey, wrapping to three
|
|
6
|
+
* and then two to a row on smaller screens. A hairline above separates the
|
|
7
|
+
* strip from what precedes it.
|
|
7
8
|
*/
|
|
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
9
|
export function renderLogoStrip(block, ctx) {
|
|
12
|
-
return
|
|
13
|
-
? null
|
|
14
|
-
: h('figcaption', { class: 'cg-logo-band__caption', 'data-field': 'caption' }, block.caption));
|
|
10
|
+
return section('div', 'logoStrip', 'cd-strip', { 'data-count': String(Math.min(block.logos.length, 6)) }, 'div', optionalText('p', 'cd-strip__caption', block.caption, { 'data-field': 'caption' }), h('ul', { class: 'cd-strip__items' }, block.logos.map((logo) => h('li', { class: 'cd-strip__item' }, image(ctx, logo.media, { className: 'cd-strip__image cd-mark', sizes: '9rem' })))));
|
|
15
11
|
}
|
|
16
12
|
//# sourceMappingURL=logo-strip.js.map
|
|
@@ -1 +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;
|
|
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;AACnF,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEpD;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,KAAqB,EAAE,GAAkB;IACvE,OAAO,OAAO,CACZ,KAAK,EACL,WAAW,EACX,UAAU,EACV,EAAE,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EACzD,KAAK,EACL,YAAY,CAAC,GAAG,EAAE,mBAAmB,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,EAClF,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAC5B,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACvB,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAC3B,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,yBAAyB,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAChF,CACF,CACF,CACF,CAAA;AACH,CAAC"}
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import type { LogosBlock } from '@cogenta/blocks';
|
|
2
2
|
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
|
+
/**
|
|
4
|
+
* Named organisations (the companies running the product, the platforms it
|
|
5
|
+
* integrates with) as a ruled grid: hairlines between cells, each wordmark in
|
|
6
|
+
* grey at one height, linked when the block gives an address. The
|
|
7
|
+
* organisation's name is the image's accessible name when the media library
|
|
8
|
+
* has no alt text.
|
|
9
|
+
*
|
|
10
|
+
* Wordmarks are shown in grey in light and inverted in dark, so a logo drawn
|
|
11
|
+
* in dark ink stays legible on the dark ground.
|
|
12
|
+
*/
|
|
3
13
|
export declare function renderLogos(block: LogosBlock, ctx: RenderContext): HtmlElement;
|
|
4
14
|
//# sourceMappingURL=logos.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logos.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/logos.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"logos.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/logos.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAGnF;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CA2B9E"}
|
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h, image } from '@cogenta/theme-kit';
|
|
2
|
+
import { section, sectionHead } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Named organisations (the companies running the product, the platforms it
|
|
5
|
+
* integrates with) as a ruled grid: hairlines between cells, each wordmark in
|
|
6
|
+
* grey at one height, linked when the block gives an address. The
|
|
7
|
+
* organisation's name is the image's accessible name when the media library
|
|
8
|
+
* has no alt text.
|
|
9
|
+
*
|
|
10
|
+
* Wordmarks are shown in grey in light and inverted in dark, so a logo drawn
|
|
11
|
+
* in dark ink stays legible on the dark ground.
|
|
6
12
|
*/
|
|
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
13
|
export function renderLogos(block, ctx) {
|
|
18
|
-
return
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
return section('section', 'logos', 'cd-logos', { 'data-count': String(Math.min(block.items.length, 6)) }, 'div', sectionHead('logos', block.title), h('ul', { class: 'cd-logos__items' }, block.items.map((item) => {
|
|
15
|
+
const mark = image(ctx, item.media, {
|
|
16
|
+
className: 'cd-logos__image cd-mark',
|
|
17
|
+
altFrom: item.name,
|
|
18
|
+
sizes: '10rem',
|
|
19
|
+
});
|
|
20
|
+
return h('li', { class: 'cd-logos__item' }, item.url === undefined
|
|
21
|
+
? mark
|
|
22
|
+
: h('a', { class: 'cd-logos__link', href: ctx.link(item.url), rel: 'noopener' }, mark));
|
|
23
|
+
})));
|
|
21
24
|
}
|
|
22
25
|
//# sourceMappingURL=logos.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logos.js","sourceRoot":"","sources":["../../../../src/render/blocks/logos.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"logos.js","sourceRoot":"","sources":["../../../../src/render/blocks/logos.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAE,KAAK,EAAsB,MAAM,oBAAoB,CAAA;AACnF,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAEnD;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CAAC,KAAiB,EAAE,GAAkB;IAC/D,OAAO,OAAO,CACZ,SAAS,EACT,OAAO,EACP,UAAU,EACV,EAAE,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EACzD,KAAK,EACL,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,EACjC,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAC5B,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACvB,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE;YAClC,SAAS,EAAE,yBAAyB;YACpC,OAAO,EAAE,IAAI,CAAC,IAAI;YAClB,KAAK,EAAE,OAAO;SACf,CAAC,CAAA;QACF,OAAO,CAAC,CACN,IAAI,EACJ,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAC3B,IAAI,CAAC,GAAG,KAAK,SAAS;YACpB,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,EAAE,IAAI,CAAC,CACzF,CAAA;IACH,CAAC,CAAC,CACH,CACF,CAAA;AACH,CAAC"}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import type { MediaFigureBlock } from '@cogenta/blocks';
|
|
2
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
3
|
export declare function renderMediaFigure(block: MediaFigureBlock, ctx: RenderContext): HtmlElement;
|
|
10
4
|
//# sourceMappingURL=media-figure.d.ts.map
|
|
@@ -1 +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;
|
|
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;AAuBhG,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAiC1F"}
|
|
@@ -1,25 +1,37 @@
|
|
|
1
1
|
import { aspectRatio, h, image } from '@cogenta/theme-kit';
|
|
2
|
+
import { optionalText } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* A diagram, a screenshot or a photograph, in the hairline frame, with its
|
|
5
|
+
* caption and credit under it in the secondary ink.
|
|
6
|
+
*
|
|
7
|
+
* `align` (contract B) places the frame: `wide` takes the whole container
|
|
8
|
+
* (or the whole reading column on a documentation page), `center` the middle
|
|
9
|
+
* eight columns, `start` and `end` eight columns on either side, and `full`
|
|
10
|
+
* runs to the edges of the window, without a frame.
|
|
11
|
+
*
|
|
12
|
+
* `ratio` crops from the top edge, so an interface keeps its title bar; a
|
|
13
|
+
* focal point set in the media library still wins.
|
|
7
14
|
*/
|
|
15
|
+
const SIZES = {
|
|
16
|
+
full: '100vw',
|
|
17
|
+
wide: '(min-width: 80rem) 76rem, 100vw',
|
|
18
|
+
center: '(min-width: 64rem) 50rem, 100vw',
|
|
19
|
+
start: '(min-width: 64rem) 50rem, 100vw',
|
|
20
|
+
end: '(min-width: 64rem) 50rem, 100vw',
|
|
21
|
+
};
|
|
8
22
|
export function renderMediaFigure(block, ctx) {
|
|
23
|
+
const align = block.align ?? 'wide';
|
|
9
24
|
const ratio = aspectRatio(block.ratio);
|
|
10
25
|
const hasCaption = block.caption !== undefined || block.credit !== undefined;
|
|
11
|
-
return h('figure', {
|
|
12
|
-
class: '
|
|
13
|
-
|
|
14
|
-
'data-
|
|
15
|
-
style: ratio === undefined ? undefined : `--cg-ratio:${ratio}`,
|
|
26
|
+
return h('div', { class: 'cd-section cd-figure', 'data-block': 'mediaFigure', 'data-align': align }, h('figure', { class: 'cd-container cd-figure__inner' }, h('div', {
|
|
27
|
+
class: align === 'full' ? 'cd-figure__media' : 'cd-figure__media cd-frame',
|
|
28
|
+
style: ratio === undefined ? undefined : `aspect-ratio:${ratio}`,
|
|
29
|
+
'data-ratio': ratio === undefined ? 'original' : 'fixed',
|
|
16
30
|
}, image(ctx, block.media, {
|
|
17
|
-
className: '
|
|
18
|
-
sizes:
|
|
19
|
-
}), hasCaption
|
|
20
|
-
? h('figcaption', { class: '
|
|
21
|
-
|
|
22
|
-
: h('span', { class: 'cg-figure__credit', 'data-field': 'credit' }, block.credit))
|
|
23
|
-
: null);
|
|
31
|
+
className: 'cd-figure__image cd-frame__image',
|
|
32
|
+
sizes: SIZES[align] ?? '100vw',
|
|
33
|
+
})), hasCaption
|
|
34
|
+
? h('figcaption', { class: 'cd-figure__caption' }, optionalText('span', 'cd-figure__text', block.caption, { 'data-field': 'caption' }), optionalText('span', 'cd-figure__credit', block.credit, { 'data-field': 'credit' }))
|
|
35
|
+
: null));
|
|
24
36
|
}
|
|
25
37
|
//# sourceMappingURL=media-figure.js.map
|
|
@@ -1 +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;
|
|
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;AAChG,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAE3C;;;;;;;;;;;GAWG;AACH,MAAM,KAAK,GAAqC;IAC9C,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,iCAAiC;IACvC,MAAM,EAAE,iCAAiC;IACzC,KAAK,EAAE,iCAAiC;IACxC,GAAG,EAAE,iCAAiC;CACvC,CAAA;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAuB,EAAE,GAAkB;IAC3E,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,MAAM,CAAA;IACnC,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;IAE5E,OAAO,CAAC,CACN,KAAK,EACL,EAAE,KAAK,EAAE,sBAAsB,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,KAAK,EAAE,EACnF,CAAC,CACC,QAAQ,EACR,EAAE,KAAK,EAAE,+BAA+B,EAAE,EAC1C,CAAC,CACC,KAAK,EACL;QACE,KAAK,EAAE,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,2BAA2B;QAC1E,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAgB,KAAK,EAAE;QAChE,YAAY,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO;KACzD,EACD,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,EAAE;QACtB,SAAS,EAAE,kCAAkC;QAC7C,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,OAAO;KAC/B,CAAC,CACH,EACD,UAAU;QACR,CAAC,CAAC,CAAC,CACC,YAAY,EACZ,EAAE,KAAK,EAAE,oBAAoB,EAAE,EAC/B,YAAY,CAAC,MAAM,EAAE,iBAAiB,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,EACnF,YAAY,CAAC,MAAM,EAAE,mBAAmB,EAAE,KAAK,CAAC,MAAM,EAAE,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,CACpF;QACH,CAAC,CAAC,IAAI,CACT,CACF,CAAA;AACH,CAAC"}
|
|
@@ -1 +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,
|
|
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,EAEL,KAAK,WAAW,EAGhB,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAA;AA0C3B,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAe5F"}
|
|
@@ -1,28 +1,24 @@
|
|
|
1
|
-
import { actionLink,
|
|
1
|
+
import { actionLink, h, nestedHeadingTag, } from '@cogenta/theme-kit';
|
|
2
|
+
import { optionalText, section, sectionHead } from '../layout.js';
|
|
3
|
+
import { word } from '../strings.js';
|
|
2
4
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Plans, the way a documentation site shows them (support plans, usage
|
|
6
|
+
* limits): columns side by side between hairlines, never cards. Each plan
|
|
7
|
+
* names itself, prints its price in tabular numerals with the interval after
|
|
8
|
+
* it, lists what it includes as ruled lines, and ends on its action. The
|
|
9
|
+
* recommended plan is marked by a rule in ink above it and a word, never by a
|
|
10
|
+
* tinted background.
|
|
7
11
|
*/
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
|
|
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
|
|
12
|
+
function tier(item, ctx, tag) {
|
|
13
|
+
const highlighted = item.highlighted === true;
|
|
14
|
+
return h('li', { class: 'cd-plans__item', 'data-highlighted': highlighted ? 'true' : 'false' }, h('div', { class: 'cd-plans__head' }, h(tag, { class: 'cd-plans__name' }, item.name), highlighted ? h('p', { class: 'cd-plans__flag' }, word(ctx.locale, 'recommended')) : null), h('p', { class: 'cd-plans__price' }, h('span', { class: 'cd-plans__amount' }, item.price), optionalText('span', 'cd-plans__interval', item.interval)), item.features.length === 0
|
|
14
15
|
? null
|
|
15
|
-
: h('
|
|
16
|
+
: h('ul', { class: 'cd-plans__features' }, item.features.map((feature) => h('li', { class: 'cd-plans__feature' }, feature))), item.action === undefined
|
|
16
17
|
? null
|
|
17
|
-
: h('
|
|
18
|
-
? null
|
|
19
|
-
: h('div', { class: 'cg-pricing__action' }, actionLink(ctx, { ...tier.action, emphasis: tier.action.emphasis ?? 'primary' })));
|
|
18
|
+
: h('div', { class: 'cd-plans__action' }, actionLink(ctx, item.action)));
|
|
20
19
|
}
|
|
21
20
|
export function renderPricingTable(block, ctx) {
|
|
22
|
-
const
|
|
23
|
-
|
|
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))));
|
|
21
|
+
const tag = nestedHeadingTag('pricingTable', block.title !== undefined);
|
|
22
|
+
return section('section', 'pricingTable', 'cd-plans', { 'data-count': String(Math.min(block.tiers.length, 4)) }, 'div', sectionHead('pricingTable', block.title), h('ul', { class: 'cd-plans__items' }, block.tiers.map((item) => tier(item, ctx, tag))));
|
|
27
23
|
}
|
|
28
24
|
//# sourceMappingURL=pricing-table.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pricing-table.js","sourceRoot":"","sources":["../../../../src/render/blocks/pricing-table.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,
|
|
1
|
+
{"version":3,"file":"pricing-table.js","sourceRoot":"","sources":["../../../../src/render/blocks/pricing-table.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EAEV,CAAC,EACD,gBAAgB,GAEjB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAEpC;;;;;;;GAOG;AACH,SAAS,IAAI,CAAC,IAAiB,EAAE,GAAkB,EAAE,GAAW;IAC9D,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,KAAK,IAAI,CAAA;IAC7C,OAAO,CAAC,CACN,IAAI,EACJ,EAAE,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,EAC/E,CAAC,CACC,KAAK,EACL,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAC3B,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,EAC9C,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAC1F,EACD,CAAC,CACC,GAAG,EACH,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAC5B,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EACpD,YAAY,CAAC,MAAM,EAAE,oBAAoB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAC1D,EACD,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC;QACxB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,oBAAoB,EAAE,EAC/B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAAE,OAAO,CAAC,CAAC,CACjF,EACL,IAAI,CAAC,MAAM,KAAK,SAAS;QACvB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAAE,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAC1E,CAAA;AACH,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,KAAwB,EAAE,GAAkB;IAC7E,MAAM,GAAG,GAAG,gBAAgB,CAAC,cAAc,EAAE,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAA;IACvE,OAAO,OAAO,CACZ,SAAS,EACT,cAAc,EACd,UAAU,EACV,EAAE,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EACzD,KAAK,EACL,WAAW,CAAC,cAAc,EAAE,KAAK,CAAC,KAAK,CAAC,EACxC,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAC5B,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAChD,CACF,CAAA;AACH,CAAC"}
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import type { ProseBlock } from '@cogenta/blocks';
|
|
2
2
|
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
|
-
|
|
3
|
+
import { type HeadingAnchors } from '../rich-text.js';
|
|
4
|
+
/**
|
|
5
|
+
* Running text. `prose` declares `headingLevel: 'none'`: its headings come
|
|
6
|
+
* from the rich text document, whose vocabulary starts at `h2`.
|
|
7
|
+
*
|
|
8
|
+
* The body is set on the reading measure from the first column; code blocks,
|
|
9
|
+
* notes and reference tables are read out of the document by
|
|
10
|
+
* `renderDocsRichText` (see its own comment for the four shapes).
|
|
11
|
+
*
|
|
12
|
+
* `anchors` is the page's own set of heading ids, so the table of contents
|
|
13
|
+
* and the headings agree; a prose block rendered on its own computes its own.
|
|
14
|
+
*/
|
|
15
|
+
export declare function renderProse(block: ProseBlock, ctx: RenderContext, anchors?: HeadingAnchors): HtmlElement;
|
|
4
16
|
//# sourceMappingURL=prose.d.ts.map
|
|
@@ -1 +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,
|
|
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,EAAE,KAAK,WAAW,EAAK,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAC5E,OAAO,EAAE,KAAK,cAAc,EAAsC,MAAM,iBAAiB,CAAA;AAEzF;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,UAAU,EACjB,GAAG,EAAE,aAAa,EAClB,OAAO,GAAE,cAAwC,GAChD,WAAW,CAcb"}
|
|
@@ -1,36 +1,17 @@
|
|
|
1
|
-
import { h
|
|
1
|
+
import { h } from '@cogenta/theme-kit';
|
|
2
|
+
import { headingAnchors, renderDocsRichText } from '../rich-text.js';
|
|
2
3
|
/**
|
|
3
|
-
* `prose` declares `headingLevel: 'none'`:
|
|
4
|
-
*
|
|
5
|
-
* vocabulary starts at `h2`.
|
|
4
|
+
* Running text. `prose` declares `headingLevel: 'none'`: its headings come
|
|
5
|
+
* from the rich text document, whose vocabulary starts at `h2`.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
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.
|
|
7
|
+
* The body is set on the reading measure from the first column; code blocks,
|
|
8
|
+
* notes and reference tables are read out of the document by
|
|
9
|
+
* `renderDocsRichText` (see its own comment for the four shapes).
|
|
10
|
+
*
|
|
11
|
+
* `anchors` is the page's own set of heading ids, so the table of contents
|
|
12
|
+
* and the headings agree; a prose block rendered on its own computes its own.
|
|
19
13
|
*/
|
|
20
|
-
function
|
|
21
|
-
return
|
|
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)));
|
|
14
|
+
export function renderProse(block, ctx, anchors = headingAnchors([block])) {
|
|
15
|
+
return h('div', { class: 'cd-section cd-prose', 'data-block': 'prose' }, h('div', { class: 'cd-container cd-prose__inner' }, h('div', { class: 'cd-prose__body cd-rich' }, renderDocsRichText(ctx, block.body, { anchors: { blockKey: block._key, map: anchors } }))));
|
|
35
16
|
}
|
|
36
17
|
//# sourceMappingURL=prose.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prose.js","sourceRoot":"","sources":["../../../../src/render/blocks/prose.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"prose.js","sourceRoot":"","sources":["../../../../src/render/blocks/prose.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAsB,MAAM,oBAAoB,CAAA;AAC5E,OAAO,EAAuB,cAAc,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEzF;;;;;;;;;;GAUG;AACH,MAAM,UAAU,WAAW,CACzB,KAAiB,EACjB,GAAkB,EAClB,OAAO,GAAmB,cAAc,CAAC,CAAC,KAAK,CAAC,CAAC;IAEjD,OAAO,CAAC,CACN,KAAK,EACL,EAAE,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,OAAO,EAAE,EACvD,CAAC,CACC,KAAK,EACL,EAAE,KAAK,EAAE,8BAA8B,EAAE,EACzC,CAAC,CACC,KAAK,EACL,EAAE,KAAK,EAAE,wBAAwB,EAAE,EACnC,kBAAkB,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,CAAC,CACzF,CACF,CACF,CAAA;AACH,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { QuoteBlock } from '@cogenta/blocks';
|
|
2
2
|
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* A quotation: in documentation, a line from an RFC, a maintainer or a team
|
|
5
|
+
* that runs the product. Set at the quote size on the reading measure, in
|
|
6
|
+
* real curly quotation marks drawn by the stylesheet, hanging from a rule in
|
|
7
|
+
* ink on its left; the attribution under it, with a small round portrait when
|
|
8
|
+
* there is one.
|
|
7
9
|
*/
|
|
8
10
|
export declare function renderQuote(block: QuoteBlock, ctx: RenderContext): HtmlElement;
|
|
9
11
|
//# sourceMappingURL=quote.d.ts.map
|