@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 +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"}
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;AAGnF;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CA6B9E"}
@@ -1,22 +1,18 @@
1
1
  import { h, image } from '@cogenta/theme-kit';
2
+ import { optionalText, section } from '../layout.js';
2
3
  /**
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.
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.
6
9
  */
7
10
  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
+ const hasAttribution = block.author !== undefined || block.role !== undefined;
12
+ return section('div', 'quote', 'cd-quote', {}, 'figure', h('blockquote', { class: 'cd-quote__body' }, h('p', { class: 'cd-quote__text', 'data-field': 'text' }, block.text)), hasAttribution
13
+ ? h('figcaption', { class: 'cd-person' }, block.avatar === undefined
11
14
  ? 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))
15
+ : image(ctx, block.avatar, { className: 'cd-person__avatar', sizes: '2.5rem' }), h('span', { class: 'cd-person__words' }, optionalText('span', 'cd-person__name', block.author, { 'data-field': 'author' }), optionalText('span', 'cd-person__role', block.role, { 'data-field': 'role' })))
20
16
  : null);
21
17
  }
22
18
  //# sourceMappingURL=quote.js.map
@@ -1 +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,S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EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,CACtE,EACD,cAAc;QACZ,CAAC,CAAC,CAAC,CACC,YAAY,EACZ,EAAE,KAAK,EAAE,WAAW,EAAE,EACtB,KAAK,CAAC,MAAM,KAAK,SAAS;YACxB,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,mBAAmB,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,EACjF,CAAC,CACC,MAAM,EACN,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAC7B,YAAY,CAAC,MAAM,EAAE,iBAAiB,EAAE,KAAK,CAAC,MAAM,EAAE,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,EACjF,YAAY,CAAC,MAAM,EAAE,iBAAiB,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,CAC9E,CACF;QACH,CAAC,CAAC,IAAI,CACT,CAAA;AACH,CAAC"}
@@ -1,4 +1,9 @@
1
1
  import type { StatCounterBlock } from '@cogenta/blocks';
2
2
  import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
3
+ /**
4
+ * A row of counts ("Releases this year", "Supported runtimes"): the same
5
+ * ruled, tabular register as `stats`, without units. Nothing counts up on
6
+ * scroll; the figure is simply printed.
7
+ */
3
8
  export declare function renderStatCounter(block: StatCounterBlock, _ctx: RenderContext): HtmlElement;
4
9
  //# sourceMappingURL=stat-counter.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"stat-counter.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/stat-counter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,KAAK,WAAW,EAAK,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAG5E;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,aAAa,GAAG,WAAW,CAyB3F"}
@@ -1,15 +1,11 @@
1
- import { blockHeadingTag, h, heading, } from '@cogenta/theme-kit';
1
+ import { h } from '@cogenta/theme-kit';
2
+ import { section, sectionHead } from '../layout.js';
2
3
  /**
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.
4
+ * A row of counts ("Releases this year", "Supported runtimes"): the same
5
+ * ruled, tabular register as `stats`, without units. Nothing counts up on
6
+ * scroll; the figure is simply printed.
6
7
  */
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
8
  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)));
9
+ return section('section', 'statCounter', 'cd-figures', { 'data-count': String(Math.min(block.stats.length, 4)) }, 'div', sectionHead('statCounter', block.title), h('dl', { class: 'cd-figures__items' }, block.stats.map((stat) => h('div', { class: 'cd-figures__item' }, h('dt', { class: 'cd-figures__label' }, stat.label), h('dd', { class: 'cd-figures__value' }, h('span', { class: 'cd-figures__number' }, stat.value))))));
14
10
  }
15
11
  //# sourceMappingURL=stat-counter.js.map
@@ -1 +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"}
1
+ {"version":3,"file":"stat-counter.js","sourceRoot":"","sources":["../../../../src/render/blocks/stat-counter.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAsB,MAAM,oBAAoB,CAAA;AAC5E,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAEnD;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAuB,EAAE,IAAmB;IAC5E,OAAO,OAAO,CACZ,SAAS,EACT,aAAa,EACb,YAAY,EACZ,EAAE,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EACzD,KAAK,EACL,WAAW,CAAC,aAAa,EAAE,KAAK,CAAC,KAAK,CAAC,EACvC,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAC9B,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACvB,CAAC,CACC,KAAK,EACL,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAC7B,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EACnD,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAC9B,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CACvD,CACF,CACF,CACF,CACF,CAAA;AACH,CAAC"}
@@ -1,4 +1,14 @@
1
1
  import type { StatsBlock } from '@cogenta/blocks';
2
2
  import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
3
+ /**
4
+ * Figures the way a benchmark or a limits page prints them: a ruled row of
5
+ * up to four columns, each value in tabular numerals with its unit smaller on
6
+ * the same baseline, and a one-line label under it. The rule above each
7
+ * figure is the only structure; there is no box behind the row.
8
+ *
9
+ * A `<dl>`, since each figure is the value of its label; the label comes
10
+ * first in the markup (so it is announced first) and is drawn under the
11
+ * figure.
12
+ */
3
13
  export declare function renderStats(block: StatsBlock, _ctx: RenderContext): HtmlElement;
4
14
  //# sourceMappingURL=stats.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/stats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,KAAK,WAAW,EAAK,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAG5E;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,GAAG,WAAW,CA0B/E"}
@@ -1,11 +1,16 @@
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
- }
1
+ import { h } from '@cogenta/theme-kit';
2
+ import { optionalText, section, sectionHead } from '../layout.js';
3
+ /**
4
+ * Figures the way a benchmark or a limits page prints them: a ruled row of
5
+ * up to four columns, each value in tabular numerals with its unit smaller on
6
+ * the same baseline, and a one-line label under it. The rule above each
7
+ * figure is the only structure; there is no box behind the row.
8
+ *
9
+ * A `<dl>`, since each figure is the value of its label; the label comes
10
+ * first in the markup (so it is announced first) and is drawn under the
11
+ * figure.
12
+ */
6
13
  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)));
14
+ return section('section', 'stats', 'cd-figures', { 'data-count': String(Math.min(block.items.length, 4)) }, 'div', sectionHead('stats', block.title), h('dl', { class: 'cd-figures__items' }, block.items.map((item) => h('div', { class: 'cd-figures__item' }, h('dt', { class: 'cd-figures__label' }, item.label), h('dd', { class: 'cd-figures__value' }, h('span', { class: 'cd-figures__number' }, item.value), optionalText('span', 'cd-figures__unit', item.unit))))));
10
15
  }
11
16
  //# sourceMappingURL=stats.js.map
@@ -1 +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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EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EACtD,YAAY,CAAC,MAAM,EAAE,kBAAkB,EAAE,IAAI,CAAC,IAAI,CAAC,CACpD,CACF,CACF,CACF,CACF,CAAA;AACH,CAAC"}
@@ -1,11 +1,10 @@
1
1
  import type { TestimonialBlock } from '@cogenta/blocks';
2
2
  import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
3
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.
4
+ * One person's account of using the product: the same register as `quote`
5
+ * (a rule in ink on the left, real quotation marks), with rich text, so a
6
+ * testimonial can hold a second paragraph or a command in `code`. The first
7
+ * paragraph is set at the quote size, the rest at the reading size.
9
8
  */
10
9
  export declare function renderTestimonial(block: TestimonialBlock, ctx: RenderContext): HtmlElement;
11
10
  //# sourceMappingURL=testimonial.d.ts.map
@@ -1 +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"}
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,EAAE,MAAM,oBAAoB,CAAA;AAInF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAuB1F"}
@@ -1,20 +1,16 @@
1
- import { h, image, renderRichText } from '@cogenta/theme-kit';
1
+ import { h, image } from '@cogenta/theme-kit';
2
+ import { optionalText, section } from '../layout.js';
3
+ import { renderDocsRichText } from '../rich-text.js';
2
4
  /**
3
- * `blocks@2.0` (RFC 0001). The same `<figure><blockquote>…</blockquote>
4
- * <figcaption>` pattern `quote` uses, kept consistent so the two read as
5
- * siblings — the quote itself is rich text here, and the attribution is
6
- * the block's single grouped `attribution` field rather than three loose
7
- * ones.
5
+ * One person's account of using the product: the same register as `quote`
6
+ * (a rule in ink on the left, real quotation marks), with rich text, so a
7
+ * testimonial can hold a second paragraph or a command in `code`. The first
8
+ * paragraph is set at the quote size, the rest at the reading size.
8
9
  */
9
10
  export function renderTestimonial(block, ctx) {
10
11
  const { attribution } = block;
11
- return h('figure', { class: 'cg-block cg-testimonial', 'data-block': 'testimonial' }, h('blockquote', { class: 'cg-testimonial__quote' }, renderRichText(ctx, block.quote)), h('figcaption', { class: 'cg-testimonial__attribution' }, attribution.avatar === undefined
12
+ return section('div', 'testimonial', 'cd-testimonial', {}, 'figure', h('blockquote', { class: 'cd-testimonial__quote' }, renderDocsRichText(ctx, block.quote)), h('figcaption', { class: 'cd-person' }, attribution.avatar === undefined
12
13
  ? null
13
- : image(ctx, attribution.avatar, {
14
- className: 'cg-testimonial__avatar',
15
- variant: { width: 96, height: 96, fit: 'cover' },
16
- }), h('span', { class: 'cg-testimonial__who' }, h('span', { class: 'cg-testimonial__name' }, attribution.name), attribution.role === undefined
17
- ? null
18
- : h('span', { class: 'cg-testimonial__role' }, attribution.role))));
14
+ : image(ctx, attribution.avatar, { className: 'cd-person__avatar', sizes: '2.5rem' }), h('span', { class: 'cd-person__words' }, h('span', { class: 'cd-person__name' }, attribution.name), optionalText('span', 'cd-person__role', attribution.role))));
19
15
  }
20
16
  //# sourceMappingURL=testimonial.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"testimonial.js","sourceRoot":"","sources":["../../../../src/render/blocks/testimonial.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAE,KAAK,EAAsB,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAEnG;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAuB,EAAE,GAAkB;IAC3E,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,CAAA;IAC7B,OAAO,CAAC,CACN,QAAQ,EACR,EAAE,KAAK,EAAE,yBAAyB,EAAE,YAAY,EAAE,aAAa,EAAE,EACjE,CAAC,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,uBAAuB,EAAE,EAAE,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EACrF,CAAC,CACC,YAAY,EACZ,EAAE,KAAK,EAAE,6BAA6B,EAAE,EACxC,WAAW,CAAC,MAAM,KAAK,SAAS;QAC9B,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,WAAW,CAAC,MAAM,EAAE;YAC7B,SAAS,EAAE,wBAAwB;YACnC,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE;SACjD,CAAC,EACN,CAAC,CACC,MAAM,EACN,EAAE,KAAK,EAAE,qBAAqB,EAAE,EAChC,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,sBAAsB,EAAE,EAAE,WAAW,CAAC,IAAI,CAAC,EAC9D,WAAW,CAAC,IAAI,KAAK,SAAS;QAC5B,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,sBAAsB,EAAE,EAAE,WAAW,CAAC,IAAI,CAAC,CACnE,CACF,CACF,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"testimonial.js","sourceRoot":"","sources":["../../../../src/render/blocks/testimonial.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAE,KAAK,EAAsB,MAAM,oBAAoB,CAAA;AACnF,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEpD;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAuB,EAAE,GAAkB;IAC3E,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,CAAA;IAC7B,OAAO,OAAO,CACZ,KAAK,EACL,aAAa,EACb,gBAAgB,EAChB,EAAE,EACF,QAAQ,EACR,CAAC,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,uBAAuB,EAAE,EAAE,kBAAkB,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EACzF,CAAC,CACC,YAAY,EACZ,EAAE,KAAK,EAAE,WAAW,EAAE,EACtB,WAAW,CAAC,MAAM,KAAK,SAAS;QAC9B,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,WAAW,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,mBAAmB,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,EACvF,CAAC,CACC,MAAM,EACN,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAC7B,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAAE,WAAW,CAAC,IAAI,CAAC,EACzD,YAAY,CAAC,MAAM,EAAE,iBAAiB,EAAE,WAAW,CAAC,IAAI,CAAC,CAC1D,CACF,CACF,CAAA;AACH,CAAC"}
@@ -1,3 +1,38 @@
1
- import { type ChromeInput, type ChromeResult } from '@cogenta/theme-kit';
1
+ import { type ChromeInput, type ChromeNavLink, type ChromeResult } from '@cogenta/theme-kit';
2
+ /**
3
+ * The header and footer of a documentation site (`theme@1.4`).
4
+ *
5
+ * Header: one bar held at the top of the window on the page's own ground,
6
+ * under a hairline (no blur, no translucency). The product's name as a text
7
+ * wordmark (or the uploaded logo), a real search field, the top sections of
8
+ * the site, the light/dark control, and the `headerAction` as a quiet
9
+ * outlined control when a site sets one.
10
+ *
11
+ * Below the wide breakpoint the sections and the search field move into a
12
+ * panel opened by a `<details>` disclosure: no script. The panel is a second,
13
+ * hidden-by-default copy of the same links: at any width exactly one copy is
14
+ * displayed, so a screen reader is never offered two primary navigations. A
15
+ * magnifier link to the search page stays in the bar, so a reader on a phone
16
+ * can search without opening the menu.
17
+ *
18
+ * Footer: columns, the way a developer tool's site is organised. The name,
19
+ * the `tagline`, the `footerNote` (a licence line, a support address) and the
20
+ * social profiles; then the footer navigation, split into columns at each
21
+ * unlinked heading (`submenu-placeholder`) an editor adds in the menu screen.
22
+ * Under a hairline, the copyright year and the product's name, beside the
23
+ * host's `brandingHtml`, placed once, as received.
24
+ *
25
+ * Footer widget columns (`theme@1.6`), when the site placed any, sit between
26
+ * the two, under their own hairline: a row of columns set like the footer
27
+ * navigation's, so a support address or a status link reads as part of the
28
+ * same footer rather than a band added above it.
29
+ */
30
+ interface FooterGroup {
31
+ readonly heading: string | null;
32
+ readonly links: readonly ChromeNavLink[];
33
+ }
34
+ /** The footer menu, split into columns at each unlinked heading. */
35
+ export declare function footerGroups(links: readonly ChromeNavLink[]): readonly FooterGroup[];
2
36
  export declare function renderChrome(input: ChromeInput): ChromeResult;
37
+ export {};
3
38
  //# sourceMappingURL=chrome.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chrome.d.ts","sourceRoot":"","sources":["../../../src/render/chrome.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,YAAY,EAOlB,MAAM,oBAAoB,CAAA;AA0D3B,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,YAAY,CAuD7D"}
1
+ {"version":3,"file":"chrome.d.ts","sourceRoot":"","sources":["../../../src/render/chrome.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,YAAY,EASlB,MAAM,oBAAoB,CAAA;AAI3B;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,UAAU,WAAW;IACnB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,QAAQ,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,CAAA;CACzC;AAcD,oEAAoE;AACpE,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,GAAG,SAAS,WAAW,EAAE,CAYpF;AA4BD,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,YAAY,CA2G7D"}
@@ -1,94 +1,136 @@
1
- import { escapeAttribute, escapeText, renderBrandMark, renderSocialLinks, renderThemeToggle, serialize, } from '@cogenta/theme-kit';
2
- /**
3
- * This theme's own header and footer — structurally distinct from the
4
- * canonical theme's, not a recolour of it: a docs site's header carries a
5
- * genuine CSS-only mobile menu (a `<details>` disclosure, never a script),
6
- * because "Docs / Guides / Reference / Blog" plus a header action does not
7
- * fit a narrow viewport the way three links do.
8
- *
9
- * The mobile panel is a **second, hidden-by-default copy** of the same nav
10
- * markup, not a repositioned single copy: two static layouts (`display:none`
11
- * either way at a given viewport width) is the only zero-JS way to put the
12
- * links inline on a wide screen and inside a disclosure on a narrow one.
13
- * `display:none` removes the inactive copy from the accessibility tree, so a
14
- * screen reader is never offered two "Primary" navigations at once — only
15
- * the sighted, CSS-driven layout differs.
16
- *
17
- * Footer: brand column (name + tagline), a footer nav column, social links,
18
- * a short "about" note, and Cogenta's own credit (or its white-label
19
- * replacement) — `brandingHtml` placed exactly once, unaltered.
20
- */
21
- function navItems(links) {
22
- return links
23
- .filter((link) => link.href !== null || link.kind === 'submenu-placeholder')
24
- .map((link) => {
25
- const label = escapeText(link.label);
26
- const titleAttr = link.title === null ? '' : ` title="${escapeAttribute(link.title)}"`;
27
- if (link.href === null)
28
- return `<li><span${titleAttr}>${label}</span></li>`;
29
- const href = escapeAttribute(link.href);
30
- const target = link.openInNewTab ? ' target="_blank" rel="noopener"' : '';
31
- return `<li><a href="${href}"${target}${titleAttr}>${label}</a></li>`;
32
- })
33
- .join('');
1
+ import { escapeAttribute, escapeText, renderBrandMark, renderFooterWidgets, renderIcon, renderSocialLinks, renderThemeToggle, serialize, } from '@cogenta/theme-kit';
2
+ import { renderSearchForm, SEARCH_PATH } from './search.js';
3
+ import { splitSiteName, word } from './strings.js';
4
+ function usable(links) {
5
+ return links.filter((link) => link.href !== null || link.kind === 'submenu-placeholder');
34
6
  }
35
- function renderNav(links, className, label) {
36
- const items = navItems(links);
37
- return items === ''
38
- ? ''
39
- : `<nav class="${className}" aria-label="${label}"><ul class="cg-menu">${items}</ul></nav>`;
7
+ function linkItem(link, className) {
8
+ const label = escapeText(link.label);
9
+ const titleAttr = link.title === null ? '' : ` title="${escapeAttribute(link.title)}"`;
10
+ if (link.href === null)
11
+ return `<li class="${className}"><span${titleAttr}>${label}</span></li>`;
12
+ const target = link.openInNewTab ? ' target="_blank" rel="noopener"' : '';
13
+ return `<li class="${className}"><a href="${escapeAttribute(link.href)}"${target}${titleAttr}>${label}</a></li>`;
40
14
  }
41
- /** The header's own call-to-action link (`theme@1.4`), reusing `.cg-action`'s own look. */
42
- function renderHeaderAction(action, className) {
43
- if (action === undefined)
15
+ /** The footer menu, split into columns at each unlinked heading. */
16
+ export function footerGroups(links) {
17
+ const groups = [];
18
+ for (const link of usable(links)) {
19
+ if (link.kind === 'submenu-placeholder' && link.href === null) {
20
+ groups.push({ heading: link.label, links: [] });
21
+ continue;
22
+ }
23
+ const current = groups[groups.length - 1];
24
+ if (current === undefined)
25
+ groups.push({ heading: null, links: [link] });
26
+ else
27
+ current.links.push(link);
28
+ }
29
+ return groups.filter((group) => group.links.length > 0);
30
+ }
31
+ /** `footerNote` as paragraphs at blank lines, each keeping its own line breaks. */
32
+ function renderFooterNote(note) {
33
+ const paragraphs = note
34
+ .replace(/\r\n?/g, '\n')
35
+ .split(/\n\s*\n/)
36
+ .map((paragraph) => paragraph
37
+ .split('\n')
38
+ .map((line) => line.trim())
39
+ .filter((line) => line !== ''))
40
+ .filter((lines) => lines.length > 0);
41
+ if (paragraphs.length === 0)
44
42
  return '';
45
- return (`<a class="cg-action ${className}" data-emphasis="primary" ` +
46
- `href="${escapeAttribute(action.href)}">${escapeText(action.label)}</a>`);
43
+ return `<div class="cd-footer__note">${paragraphs
44
+ .map((lines) => `<p>${lines.map((line) => escapeText(line)).join('<br>')}</p>`)
45
+ .join('')}</div>`;
46
+ }
47
+ /** "Relay Docs" as the product in ink and the kind of site in grey; any other name as it is. */
48
+ function wordmark(name) {
49
+ const { product, suffix } = splitSiteName(name);
50
+ const productHtml = `<span class="cd-wordmark__product">${escapeText(product)}</span>`;
51
+ if (suffix === null)
52
+ return `<span class="cd-wordmark">${productHtml}</span>`;
53
+ return `<span class="cd-wordmark">${productHtml} <span class="cd-wordmark__kind">${escapeText(suffix)}</span></span>`;
47
54
  }
48
- /** Three bars, drawn once for this file — not part of `renderIcon`'s closed vocabulary, since a "menu" glyph names no contract B field. */
49
- const HAMBURGER_SVG = '<svg class="cg-nav-toggle__icon" viewBox="0 0 24 24" width="22" height="22" fill="none" ' +
50
- 'stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true" focusable="false">' +
51
- '<path d="M4 6h16M4 12h16M4 18h16"/></svg>';
52
55
  export function renderChrome(input) {
53
- const siteName = escapeAttribute(input.site.name);
54
- const siteNameText = escapeText(input.site.name);
55
- const mark = renderBrandMark(input.brand, { className: 'cg-site-header__logo' }) ?? siteNameText;
56
- const desktopNav = renderNav(input.headerNav, 'cg-site-header__nav', 'Primary');
57
- const themeToggle = serialize(renderThemeToggle(input.locale, { className: 'cg-theme-toggle' }));
58
- const desktopAction = renderHeaderAction(input.headerAction, 'cg-site-header__action');
59
- const mobileNavItems = navItems(input.headerNav);
60
- const mobileAction = renderHeaderAction(input.headerAction, 'cg-nav-toggle__action');
61
- const mobilePanel = mobileNavItems === '' && mobileAction === ''
56
+ const locale = input.locale;
57
+ const siteName = escapeText(input.site.name);
58
+ const home = escapeAttribute(input.homeHref);
59
+ const headerLinks = usable(input.headerNav)
60
+ .map((link) => linkItem(link, 'cd-header__item'))
61
+ .join('');
62
+ const logo = renderBrandMark(input.brand, { className: 'cd-header__logo' });
63
+ const mark = logo ?? wordmark(input.site.name);
64
+ const toggle = serialize(renderThemeToggle(locale, { className: 'cg-theme-toggle' }));
65
+ const action = input.headerAction === undefined
66
+ ? ''
67
+ : `<a class="cg-action cd-header__action" data-emphasis="outline" href="${escapeAttribute(input.headerAction.href)}">${escapeText(input.headerAction.label)}</a>`;
68
+ const nav = headerLinks === ''
69
+ ? ''
70
+ : `<nav class="cd-header__nav" aria-label="${escapeAttribute(word(locale, 'primary'))}">` +
71
+ `<ul class="cd-header__links">${headerLinks}</ul></nav>`;
72
+ const searchIcon = renderIcon('search', { className: 'cd-header__search-icon', size: 20 });
73
+ const searchLink = `<a class="cd-header__search-link" href="${SEARCH_PATH}" ` +
74
+ `aria-label="${escapeAttribute(word(locale, 'search'))}">` +
75
+ `${searchIcon === null ? '' : serialize(searchIcon)}</a>`;
76
+ const panelLinks = headerLinks === ''
62
77
  ? ''
63
- : `<nav class="cg-nav-toggle__panel" aria-label="Primary">` +
64
- `${mobileNavItems === '' ? '' : `<ul class="cg-menu">${mobileNavItems}</ul>`}` +
65
- `${mobileAction}</nav>`;
66
- const toggle = mobilePanel === ''
78
+ : `<nav class="cd-menu__nav" aria-label="${escapeAttribute(word(locale, 'primary'))}">` +
79
+ `<ul class="cd-menu__links">${usable(input.headerNav)
80
+ .map((link) => linkItem(link, 'cd-menu__item'))
81
+ .join('')}</ul></nav>`;
82
+ const panelAction = input.headerAction === undefined
67
83
  ? ''
68
- : `<details class="cg-nav-toggle"><summary class="cg-nav-toggle__button" aria-label="Menu">${HAMBURGER_SVG}</summary>${mobilePanel}</details>`;
69
- const header = `<header class="cg-site-header"><div class="cg-site-header__inner">` +
70
- `<a class="cg-site-header__home" href="${escapeAttribute(input.homeHref)}">${mark}</a>` +
71
- `${desktopNav}${themeToggle}${desktopAction}${toggle}` +
84
+ : `<a class="cg-action cd-menu__action" data-emphasis="outline" href="${escapeAttribute(input.headerAction.href)}">${escapeText(input.headerAction.label)}</a>`;
85
+ const menu = `<details class="cd-menu">` +
86
+ `<summary class="cd-menu__button" aria-label="${escapeAttribute(word(locale, 'menu'))}">` +
87
+ `<span class="cd-menu__bar"></span><span class="cd-menu__bar"></span></summary>` +
88
+ `<div class="cd-menu__panel">` +
89
+ `${serialize(renderSearchForm(locale, 'cd-search-menu', 'compact'))}${panelLinks}${panelAction}` +
90
+ `</div></details>`;
91
+ const header = `<header class="cd-header"><div class="cd-header__inner">` +
92
+ `<a class="cd-header__brand" href="${home}">${mark}</a>` +
93
+ `<div class="cd-header__search">${serialize(renderSearchForm(locale, 'cd-search-header', 'compact'))}</div>` +
94
+ `${nav}` +
95
+ `<div class="cd-header__end">${searchLink}${action}${toggle}${menu}</div>` +
72
96
  `</div></header>`;
73
- const footerNav = renderNav(input.footerNav, 'cg-site-footer__nav', 'Footer');
74
97
  const tagline = input.tagline === undefined
75
98
  ? ''
76
- : `<p class="cg-site-footer__tagline">${escapeText(input.tagline)}</p>`;
77
- const socialElement = input.social === undefined
78
- ? null
79
- : renderSocialLinks(input.social, {
80
- className: 'cg-site-footer__social',
81
- itemClassName: 'cg-site-footer__social-item',
82
- });
83
- const social = socialElement === null ? '' : serialize(socialElement);
84
- const footerNote = input.footerNote === undefined
99
+ : `<p class="cd-footer__tagline" data-field="tagline">${escapeText(input.tagline)}</p>`;
100
+ const note = input.footerNote === undefined ? '' : renderFooterNote(input.footerNote);
101
+ const social = renderSocialLinks(input.social, {
102
+ className: 'cd-footer__social',
103
+ itemClassName: 'cd-footer__social-item',
104
+ });
105
+ const groups = footerGroups(input.footerNav);
106
+ const footerNav = groups.length === 0
85
107
  ? ''
86
- : `<p class="cg-site-footer__note">${escapeText(input.footerNote)}</p>`;
87
- const footer = `<footer class="cg-site-footer"><div class="cg-site-footer__grid">` +
88
- `<div class="cg-site-footer__brand"><a href="${escapeAttribute(input.homeHref)}">${siteName}</a>${tagline}${social}</div>` +
89
- `<div class="cg-site-footer__nav-col">${footerNav}</div>` +
90
- `<div class="cg-site-footer__about-col">${footerNote}<div class="cg-site-footer__branding">${input.brandingHtml}</div></div>` +
91
- `</div><div class="cg-site-footer__bottom"><span>${siteName}</span></div></footer>`;
108
+ : `<nav class="cd-footer__nav" aria-label="${escapeAttribute(word(locale, 'footer'))}" data-columns="${Math.min(groups.length, 4)}">${groups
109
+ .map((group) => `<div class="cd-footer__group">${group.heading === null
110
+ ? ''
111
+ : `<p class="cd-footer__heading">${escapeText(group.heading)}</p>`}<ul class="cd-footer__links">${group.links
112
+ .map((link) => linkItem(link, 'cd-footer__item'))
113
+ .join('')}</ul></div>`)
114
+ .join('')}</nav>`;
115
+ const year = new Date().getFullYear();
116
+ const owner = escapeText(splitSiteName(input.site.name).product);
117
+ const footerWidgets = renderFooterWidgets(input.widgets, {
118
+ className: 'cd-footer__widgets',
119
+ headingLevel: 'h2',
120
+ });
121
+ const footer = `<footer class="cd-footer"><div class="cd-footer__inner">` +
122
+ `<div class="cd-footer__about">` +
123
+ `<a class="cd-footer__name" href="${home}">${siteName}</a>` +
124
+ `${tagline}${note}` +
125
+ `${social === null ? '' : serialize(social)}` +
126
+ `</div>` +
127
+ `${footerNav}` +
128
+ `${footerWidgets === null ? '' : serialize(footerWidgets)}` +
129
+ `<div class="cd-footer__legal">` +
130
+ `<p class="cd-footer__copyright">© ${year} ${owner}</p>` +
131
+ `${input.brandingHtml === '' ? '' : `<div class="cd-footer__branding">${input.brandingHtml}</div>`}` +
132
+ `</div>` +
133
+ `</div></footer>`;
92
134
  return { header, footer };
93
135
  }
94
136
  //# sourceMappingURL=chrome.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chrome.js","sour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MAAM,GACV,0DAA0D;QAC1D,gCAAgC;QAChC,oCAAoC,IAAI,KAAK,QAAQ,MAAM;QAC3D,GAAG,OAAO,GAAG,IAAI,EAAE;QACnB,GAAG,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE;QAC7C,QAAQ;QACR,GAAG,SAAS,EAAE;QACd,GAAG,aAAa,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE;QAC3D,gCAAgC;QAChC,qCAAqC,IAAI,IAAI,KAAK,MAAM;QACxD,GAAG,KAAK,CAAC,YAAY,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,oCAAoC,KAAK,CAAC,YAAY,QAAQ,EAAE;QACpG,QAAQ;QACR,iBAAiB,CAAA;IAEnB,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;AAC3B,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { CollectionListBlock, VocabularyBlock } from '@cogenta/blocks';
2
+ import type { ContentEntry, RenderContext } from '@cogenta/theme-kit';
3
+ /**
4
+ * The documentation's own order, shared by the sidebar, the home page index
5
+ * and previous/next.
6
+ *
7
+ * A doc page carries two plain fields: `section` (the group it belongs to)
8
+ * and `order` (its place in that group). Neither is a sort field contract B
9
+ * allows a `collectionList` to ask for (`id`/`createdAt`/`updatedAt` only),
10
+ * so the list is fetched by creation date and ordered here: pages within a
11
+ * section by `order`, then by the order they were fetched in; sections by the
12
+ * smallest `order` they hold, then by the order they first appear. Two pages
13
+ * created in the same millisecond can come back in either order, so the
14
+ * documentation never depends on creation time alone.
15
+ */
16
+ export declare const DOC_PAGE_COLLECTION = "doc_page";
17
+ export interface DocGroup {
18
+ readonly section: string;
19
+ readonly entries: readonly ContentEntry[];
20
+ }
21
+ export declare function isDocIndexBlock(block: VocabularyBlock): block is CollectionListBlock;
22
+ export declare function groupDocPages(entries: readonly ContentEntry[], ctx: RenderContext): readonly DocGroup[];
23
+ /** The reading order of the whole documentation: every group, in turn. */
24
+ export declare function readingOrder(groups: readonly DocGroup[]): readonly ContentEntry[];
25
+ //# sourceMappingURL=doc-index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doc-index.d.ts","sourceRoot":"","sources":["../../../src/render/doc-index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAC3E,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAErE;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,mBAAmB,aAAa,CAAA;AAE7C,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAA;CAC1C;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,eAAe,GAAG,KAAK,IAAI,mBAAmB,CAEpF;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,SAAS,YAAY,EAAE,EAChC,GAAG,EAAE,aAAa,GACjB,SAAS,QAAQ,EAAE,CA4BrB;AAED,0EAA0E;AAC1E,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,QAAQ,EAAE,GAAG,SAAS,YAAY,EAAE,CAEjF"}