@cogenta/theme-docs 0.3.3 → 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.
Files changed (148) hide show
  1. package/dist/src/index.d.ts +2 -0
  2. package/dist/src/index.d.ts.map +1 -1
  3. package/dist/src/index.js +2 -0
  4. package/dist/src/index.js.map +1 -1
  5. package/dist/src/render/blocks/accordion.d.ts +8 -0
  6. package/dist/src/render/blocks/accordion.d.ts.map +1 -1
  7. package/dist/src/render/blocks/accordion.js +10 -10
  8. package/dist/src/render/blocks/accordion.js.map +1 -1
  9. package/dist/src/render/blocks/collection-list.d.ts +3 -11
  10. package/dist/src/render/blocks/collection-list.d.ts.map +1 -1
  11. package/dist/src/render/blocks/collection-list.js +69 -68
  12. package/dist/src/render/blocks/collection-list.js.map +1 -1
  13. package/dist/src/render/blocks/cta.d.ts +6 -0
  14. package/dist/src/render/blocks/cta.d.ts.map +1 -1
  15. package/dist/src/render/blocks/cta.js +9 -4
  16. package/dist/src/render/blocks/cta.js.map +1 -1
  17. package/dist/src/render/blocks/embed.d.ts.map +1 -1
  18. package/dist/src/render/blocks/embed.js +14 -13
  19. package/dist/src/render/blocks/embed.js.map +1 -1
  20. package/dist/src/render/blocks/faq.d.ts +7 -0
  21. package/dist/src/render/blocks/faq.d.ts.map +1 -1
  22. package/dist/src/render/blocks/faq.js +10 -10
  23. package/dist/src/render/blocks/faq.js.map +1 -1
  24. package/dist/src/render/blocks/feature-grid.d.ts.map +1 -1
  25. package/dist/src/render/blocks/feature-grid.js +19 -19
  26. package/dist/src/render/blocks/feature-grid.js.map +1 -1
  27. package/dist/src/render/blocks/gallery.d.ts +8 -4
  28. package/dist/src/render/blocks/gallery.d.ts.map +1 -1
  29. package/dist/src/render/blocks/gallery.js +19 -13
  30. package/dist/src/render/blocks/gallery.js.map +1 -1
  31. package/dist/src/render/blocks/hero.d.ts +12 -9
  32. package/dist/src/render/blocks/hero.d.ts.map +1 -1
  33. package/dist/src/render/blocks/hero.js +22 -20
  34. package/dist/src/render/blocks/hero.js.map +1 -1
  35. package/dist/src/render/blocks/logo-strip.d.ts +6 -0
  36. package/dist/src/render/blocks/logo-strip.d.ts.map +1 -1
  37. package/dist/src/render/blocks/logo-strip.js +6 -10
  38. package/dist/src/render/blocks/logo-strip.js.map +1 -1
  39. package/dist/src/render/blocks/logos.d.ts +10 -0
  40. package/dist/src/render/blocks/logos.d.ts.map +1 -1
  41. package/dist/src/render/blocks/logos.js +20 -17
  42. package/dist/src/render/blocks/logos.js.map +1 -1
  43. package/dist/src/render/blocks/media-figure.d.ts +0 -6
  44. package/dist/src/render/blocks/media-figure.d.ts.map +1 -1
  45. package/dist/src/render/blocks/media-figure.js +28 -16
  46. package/dist/src/render/blocks/media-figure.js.map +1 -1
  47. package/dist/src/render/blocks/pricing-table.d.ts.map +1 -1
  48. package/dist/src/render/blocks/pricing-table.js +16 -20
  49. package/dist/src/render/blocks/pricing-table.js.map +1 -1
  50. package/dist/src/render/blocks/prose.d.ts +13 -1
  51. package/dist/src/render/blocks/prose.d.ts.map +1 -1
  52. package/dist/src/render/blocks/prose.js +12 -31
  53. package/dist/src/render/blocks/prose.js.map +1 -1
  54. package/dist/src/render/blocks/quote.d.ts +5 -3
  55. package/dist/src/render/blocks/quote.d.ts.map +1 -1
  56. package/dist/src/render/blocks/quote.js +10 -14
  57. package/dist/src/render/blocks/quote.js.map +1 -1
  58. package/dist/src/render/blocks/stat-counter.d.ts +5 -0
  59. package/dist/src/render/blocks/stat-counter.d.ts.map +1 -1
  60. package/dist/src/render/blocks/stat-counter.js +6 -10
  61. package/dist/src/render/blocks/stat-counter.js.map +1 -1
  62. package/dist/src/render/blocks/stats.d.ts +10 -0
  63. package/dist/src/render/blocks/stats.d.ts.map +1 -1
  64. package/dist/src/render/blocks/stats.js +13 -8
  65. package/dist/src/render/blocks/stats.js.map +1 -1
  66. package/dist/src/render/blocks/testimonial.d.ts +4 -5
  67. package/dist/src/render/blocks/testimonial.d.ts.map +1 -1
  68. package/dist/src/render/blocks/testimonial.js +9 -13
  69. package/dist/src/render/blocks/testimonial.js.map +1 -1
  70. package/dist/src/render/chrome.d.ts +36 -1
  71. package/dist/src/render/chrome.d.ts.map +1 -1
  72. package/dist/src/render/chrome.js +122 -80
  73. package/dist/src/render/chrome.js.map +1 -1
  74. package/dist/src/render/doc-index.d.ts +25 -0
  75. package/dist/src/render/doc-index.d.ts.map +1 -0
  76. package/dist/src/render/doc-index.js +49 -0
  77. package/dist/src/render/doc-index.js.map +1 -0
  78. package/dist/src/render/doc-page.d.ts +6 -0
  79. package/dist/src/render/doc-page.d.ts.map +1 -0
  80. package/dist/src/render/doc-page.js +127 -0
  81. package/dist/src/render/doc-page.js.map +1 -0
  82. package/dist/src/render/layout.d.ts +23 -0
  83. package/dist/src/render/layout.d.ts.map +1 -0
  84. package/dist/src/render/layout.js +40 -0
  85. package/dist/src/render/layout.js.map +1 -0
  86. package/dist/src/render/render-block.d.ts +9 -6
  87. package/dist/src/render/render-block.d.ts.map +1 -1
  88. package/dist/src/render/render-block.js +47 -100
  89. package/dist/src/render/render-block.js.map +1 -1
  90. package/dist/src/render/rich-text.d.ts +26 -0
  91. package/dist/src/render/rich-text.d.ts.map +1 -0
  92. package/dist/src/render/rich-text.js +325 -0
  93. package/dist/src/render/rich-text.js.map +1 -0
  94. package/dist/src/render/search.d.ts +15 -0
  95. package/dist/src/render/search.d.ts.map +1 -0
  96. package/dist/src/render/search.js +31 -0
  97. package/dist/src/render/search.js.map +1 -0
  98. package/dist/src/render/strings.d.ts +51 -0
  99. package/dist/src/render/strings.d.ts.map +1 -0
  100. package/dist/src/render/strings.js +60 -0
  101. package/dist/src/render/strings.js.map +1 -0
  102. package/dist/src/render/term-archive.d.ts +5 -5
  103. package/dist/src/render/term-archive.d.ts.map +1 -1
  104. package/dist/src/render/term-archive.js +27 -16
  105. package/dist/src/render/term-archive.js.map +1 -1
  106. package/dist/src/render/widget-areas.d.ts +22 -0
  107. package/dist/src/render/widget-areas.d.ts.map +1 -0
  108. package/dist/src/render/widget-areas.js +29 -0
  109. package/dist/src/render/widget-areas.js.map +1 -0
  110. package/package.json +4 -4
  111. package/src/index.ts +2 -0
  112. package/src/render/blocks/accordion.ts +31 -42
  113. package/src/render/blocks/collection-list.ts +132 -123
  114. package/src/render/blocks/cta.ts +23 -18
  115. package/src/render/blocks/embed.ts +37 -28
  116. package/src/render/blocks/faq.ts +26 -37
  117. package/src/render/blocks/feature-grid.ts +34 -42
  118. package/src/render/blocks/gallery.ts +33 -29
  119. package/src/render/blocks/hero.ts +41 -45
  120. package/src/render/blocks/logo-strip.ts +21 -21
  121. package/src/render/blocks/logos.ts +32 -42
  122. package/src/render/blocks/media-figure.ts +47 -25
  123. package/src/render/blocks/pricing-table.ts +34 -41
  124. package/src/render/blocks/prose.ts +25 -40
  125. package/src/render/blocks/quote.ts +25 -19
  126. package/src/render/blocks/stat-counter.ts +27 -29
  127. package/src/render/blocks/stats.ts +35 -32
  128. package/src/render/blocks/testimonial.ts +18 -19
  129. package/src/render/chrome.ts +170 -83
  130. package/src/render/doc-index.ts +65 -0
  131. package/src/render/doc-page.ts +303 -0
  132. package/src/render/layout.ts +73 -0
  133. package/src/render/render-block.ts +67 -191
  134. package/src/render/rich-text.ts +446 -0
  135. package/src/render/search.ts +41 -0
  136. package/src/render/strings.ts +67 -0
  137. package/src/render/term-archive.ts +62 -38
  138. package/src/render/widget-areas.ts +33 -0
  139. package/src/styles/archive.css +21 -27
  140. package/src/styles/base.css +438 -838
  141. package/src/styles/blocks.css +658 -916
  142. package/src/styles/chrome.css +439 -0
  143. package/src/styles/docs.css +404 -0
  144. package/src/styles/rich.css +337 -0
  145. package/src/styles/theme.css +28 -23
  146. package/src/styles/tokens.css +209 -215
  147. package/src/styles/widgets.css +890 -0
  148. 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
- * 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.
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;AAEnF;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CA6BlF"}
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
- * 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.
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 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);
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;AAEnF;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,KA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AAC,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 hero carries the page's `h1` (contract B: `headingLevel: 'h1'`), so
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
- * 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.
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,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"}
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, blockHeadingTag, h, heading, image, renderIcon, } from '@cogenta/theme-kit';
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 hero carries the page's `h1` (contract B: `headingLevel: 'h1'`), so
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
- * 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.
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 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
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('div', { class: 'cg-hero__panel' }, image(ctx, block.media, {
23
- className: 'cg-hero__media',
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) 32vw, 100vw',
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,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,gBAA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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,EAAiB,MAAM,iBAAiB,CAAA;AACpE,OAAO,EAAE,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAgBnF,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAatF"}
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
- * `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.
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 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));
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;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,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I,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,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"}
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 { blockHeadingTag, h, heading, image, } from '@cogenta/theme-kit';
1
+ import { h, image } from '@cogenta/theme-kit';
2
+ import { section, sectionHead } from '../layout.js';
2
3
  /**
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.
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 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))));
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,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,C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E,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;AAEhG;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CA0B1F"}
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
- * `<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.
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: 'cg-block cg-figure',
13
- 'data-block': 'mediaFigure',
14
- 'data-align': block.align ?? 'center',
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: '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);
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;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,KAA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AAC,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,EAIL,KAAK,WAAW,EAIhB,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAA;AA0C3B,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAmB5F"}
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, blockHeadingTag, h, heading, nestedHeadingTag, } from '@cogenta/theme-kit';
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
- * `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.
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 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
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('span', { class: 'cg-pricing__interval' }, tier.interval)), tier.features.length === 0
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('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' })));
18
+ : h('div', { class: 'cd-plans__action' }, actionLink(ctx, item.action)));
20
19
  }
21
20
  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))));
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,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,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,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
- export declare function renderProse(block: ProseBlock, ctx: RenderContext): HtmlElement;
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,EACL,KAAK,WAAW,EAGhB,KAAK,aAAa,EAEnB,MAAM,oBAAoB,CAAA;AAmC3B,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAM9E"}
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, renderRichText, } from '@cogenta/theme-kit';
1
+ import { h } from '@cogenta/theme-kit';
2
+ import { headingAnchors, renderDocsRichText } from '../rich-text.js';
2
3
  /**
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`.
4
+ * Running text. `prose` declares `headingLevel: 'none'`: its headings come
5
+ * from the rich text document, whose vocabulary starts at `h2`.
6
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.
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 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)));
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,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"}
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
- * `<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.
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