@cogenta/theme-canonical 0.2.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/dist/src/index.d.ts +4 -0
  2. package/dist/src/index.d.ts.map +1 -1
  3. package/dist/src/index.js +4 -0
  4. package/dist/src/index.js.map +1 -1
  5. package/dist/src/render/actions.d.ts +2 -16
  6. package/dist/src/render/actions.d.ts.map +1 -1
  7. package/dist/src/render/actions.js +2 -42
  8. package/dist/src/render/actions.js.map +1 -1
  9. package/dist/src/render/blocks/accordion.d.ts +5 -0
  10. package/dist/src/render/blocks/accordion.d.ts.map +1 -0
  11. package/dist/src/render/blocks/accordion.js +19 -0
  12. package/dist/src/render/blocks/accordion.js.map +1 -0
  13. package/dist/src/render/blocks/collection-list.d.ts +9 -7
  14. package/dist/src/render/blocks/collection-list.d.ts.map +1 -1
  15. package/dist/src/render/blocks/collection-list.js +8 -14
  16. package/dist/src/render/blocks/collection-list.js.map +1 -1
  17. package/dist/src/render/blocks/feature-grid.d.ts.map +1 -1
  18. package/dist/src/render/blocks/feature-grid.js +7 -2
  19. package/dist/src/render/blocks/feature-grid.js.map +1 -1
  20. package/dist/src/render/blocks/logo-strip.d.ts +5 -0
  21. package/dist/src/render/blocks/logo-strip.d.ts.map +1 -0
  22. package/dist/src/render/blocks/logo-strip.js +18 -0
  23. package/dist/src/render/blocks/logo-strip.js.map +1 -0
  24. package/dist/src/render/blocks/pricing-table.d.ts +5 -0
  25. package/dist/src/render/blocks/pricing-table.d.ts.map +1 -0
  26. package/dist/src/render/blocks/pricing-table.js +29 -0
  27. package/dist/src/render/blocks/pricing-table.js.map +1 -0
  28. package/dist/src/render/blocks/stat-counter.d.ts +5 -0
  29. package/dist/src/render/blocks/stat-counter.d.ts.map +1 -0
  30. package/dist/src/render/blocks/stat-counter.js +17 -0
  31. package/dist/src/render/blocks/stat-counter.js.map +1 -0
  32. package/dist/src/render/blocks/testimonial.d.ts +14 -0
  33. package/dist/src/render/blocks/testimonial.d.ts.map +1 -0
  34. package/dist/src/render/blocks/testimonial.js +24 -0
  35. package/dist/src/render/blocks/testimonial.js.map +1 -0
  36. package/dist/src/render/chrome.d.ts +3 -0
  37. package/dist/src/render/chrome.d.ts.map +1 -0
  38. package/dist/src/render/chrome.js +82 -0
  39. package/dist/src/render/chrome.js.map +1 -0
  40. package/dist/src/render/comments.d.ts +3 -0
  41. package/dist/src/render/comments.d.ts.map +1 -0
  42. package/dist/src/render/comments.js +3 -0
  43. package/dist/src/render/comments.js.map +1 -0
  44. package/dist/src/render/entry.d.ts +2 -6
  45. package/dist/src/render/entry.d.ts.map +1 -1
  46. package/dist/src/render/entry.js +2 -34
  47. package/dist/src/render/entry.js.map +1 -1
  48. package/dist/src/render/heading.d.ts +2 -13
  49. package/dist/src/render/heading.d.ts.map +1 -1
  50. package/dist/src/render/heading.js +2 -33
  51. package/dist/src/render/heading.js.map +1 -1
  52. package/dist/src/render/html.d.ts +2 -43
  53. package/dist/src/render/html.d.ts.map +1 -1
  54. package/dist/src/render/html.js +2 -95
  55. package/dist/src/render/html.js.map +1 -1
  56. package/dist/src/render/icons.d.ts +3 -0
  57. package/dist/src/render/icons.d.ts.map +1 -0
  58. package/dist/src/render/icons.js +3 -0
  59. package/dist/src/render/icons.js.map +1 -0
  60. package/dist/src/render/media.d.ts +2 -31
  61. package/dist/src/render/media.d.ts.map +1 -1
  62. package/dist/src/render/media.js +2 -41
  63. package/dist/src/render/media.js.map +1 -1
  64. package/dist/src/render/render-block.d.ts +11 -22
  65. package/dist/src/render/render-block.d.ts.map +1 -1
  66. package/dist/src/render/render-block.js +63 -62
  67. package/dist/src/render/render-block.js.map +1 -1
  68. package/dist/src/render/rich-text.d.ts +2 -4
  69. package/dist/src/render/rich-text.d.ts.map +1 -1
  70. package/dist/src/render/rich-text.js +2 -104
  71. package/dist/src/render/rich-text.js.map +1 -1
  72. package/dist/src/render/term-archive.d.ts +12 -0
  73. package/dist/src/render/term-archive.d.ts.map +1 -0
  74. package/dist/src/render/term-archive.js +39 -0
  75. package/dist/src/render/term-archive.js.map +1 -0
  76. package/dist/src/theme-contract.d.ts +10 -162
  77. package/dist/src/theme-contract.d.ts.map +1 -1
  78. package/dist/src/theme-contract.js +9 -17
  79. package/dist/src/theme-contract.js.map +1 -1
  80. package/dist/theme.config.d.ts +5 -16
  81. package/dist/theme.config.d.ts.map +1 -1
  82. package/dist/theme.config.js +16 -5
  83. package/dist/theme.config.js.map +1 -1
  84. package/package.json +4 -2
  85. package/src/index.ts +4 -0
  86. package/src/render/actions.ts +2 -57
  87. package/src/render/blocks/accordion.ts +44 -0
  88. package/src/render/blocks/collection-list.ts +9 -15
  89. package/src/render/blocks/feature-grid.ts +11 -2
  90. package/src/render/blocks/logo-strip.ts +38 -0
  91. package/src/render/blocks/pricing-table.ts +65 -0
  92. package/src/render/blocks/stat-counter.ts +34 -0
  93. package/src/render/blocks/testimonial.ts +41 -0
  94. package/src/render/chrome.ts +105 -0
  95. package/src/render/comments.ts +6 -0
  96. package/src/render/entry.ts +2 -40
  97. package/src/render/heading.ts +7 -44
  98. package/src/render/html.ts +15 -122
  99. package/src/render/icons.ts +2 -0
  100. package/src/render/media.ts +2 -62
  101. package/src/render/render-block.ts +85 -75
  102. package/src/render/rich-text.ts +2 -150
  103. package/src/render/term-archive.ts +85 -0
  104. package/src/styles/archive.css +40 -0
  105. package/src/styles/base.css +525 -3
  106. package/src/styles/blocks.css +344 -14
  107. package/src/styles/theme.css +1 -0
  108. package/src/theme-contract.ts +23 -155
@@ -11,11 +11,15 @@ export * from './render/blocks/media-figure.js';
11
11
  export * from './render/blocks/prose.js';
12
12
  export * from './render/blocks/quote.js';
13
13
  export * from './render/blocks/stats.js';
14
+ export * from './render/chrome.js';
15
+ export * from './render/comments.js';
14
16
  export * from './render/entry.js';
15
17
  export * from './render/heading.js';
16
18
  export * from './render/html.js';
19
+ export * from './render/icons.js';
17
20
  export * from './render/media.js';
18
21
  export * from './render/render-block.js';
19
22
  export * from './render/rich-text.js';
23
+ export * from './render/term-archive.js';
20
24
  export * from './theme-contract.js';
21
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,oCAAoC,CAAA;AAClD,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AACrC,cAAc,qBAAqB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,oCAAoC,CAAA;AAClD,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AACxC,cAAc,qBAAqB,CAAA"}
package/dist/src/index.js CHANGED
@@ -11,11 +11,15 @@ export * from './render/blocks/media-figure.js';
11
11
  export * from './render/blocks/prose.js';
12
12
  export * from './render/blocks/quote.js';
13
13
  export * from './render/blocks/stats.js';
14
+ export * from './render/chrome.js';
15
+ export * from './render/comments.js';
14
16
  export * from './render/entry.js';
15
17
  export * from './render/heading.js';
16
18
  export * from './render/html.js';
19
+ export * from './render/icons.js';
17
20
  export * from './render/media.js';
18
21
  export * from './render/render-block.js';
19
22
  export * from './render/rich-text.js';
23
+ export * from './render/term-archive.js';
20
24
  export * from './theme-contract.js';
21
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,oCAAoC,CAAA;AAClD,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AACrC,cAAc,qBAAqB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,oCAAoC,CAAA;AAClD,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AACxC,cAAc,qBAAqB,CAAA"}
@@ -1,17 +1,3 @@
1
- import type { Action, LinkTarget } from '@cogenta/blocks';
2
- import type { RenderContext } from '../theme-contract.js';
3
- import { type HtmlElement } from './html.js';
4
- /**
5
- * A target is resolved through `ctx.link` in every case, including an external
6
- * `href`: the context is the only thing that knows the locale prefix and the
7
- * site's base URL, and duplicating that reasoning here is how a theme starts
8
- * emitting broken links in a sub-path deployment.
9
- */
10
- export declare function href(ctx: RenderContext, target: LinkTarget): string;
11
- export declare function actionLink(ctx: RenderContext, action: Action): HtmlElement;
12
- /**
13
- * A list, not a row of loose anchors: a screen reader then announces "list, 2
14
- * items" and the actions are navigable as a group.
15
- */
16
- export declare function actionList(ctx: RenderContext, actions: readonly Action[] | undefined, label: string): HtmlElement | null;
1
+ /** Re-exported from `@cogenta/theme-kit` see that package's `actions.ts`. */
2
+ export { actionLink, actionList, href } from '@cogenta/theme-kit';
17
3
  //# sourceMappingURL=actions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../src/render/actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,KAAK,WAAW,EAAK,MAAM,WAAW,CAAA;AAE/C;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,GAAG,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,GAAG,MAAM,CAEnE;AAWD,wBAAgB,UAAU,CAAC,GAAG,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,CAgB1E;AAED;;;GAGG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,aAAa,EAClB,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EACtC,KAAK,EAAE,MAAM,GACZ,WAAW,GAAG,IAAI,CAOpB"}
1
+ {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../src/render/actions.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA"}
@@ -1,43 +1,3 @@
1
- import { h } from './html.js';
2
- /**
3
- * A target is resolved through `ctx.link` in every case, including an external
4
- * `href`: the context is the only thing that knows the locale prefix and the
5
- * site's base URL, and duplicating that reasoning here is how a theme starts
6
- * emitting broken links in a sub-path deployment.
7
- */
8
- export function href(ctx, target) {
9
- return 'href' in target ? ctx.link(target.href) : ctx.link(target);
10
- }
11
- /** A link that leaves the site gets the protection; a same-site one must not. */
12
- function isExternal(ctx, url) {
13
- if (!/^[a-z][a-z0-9+.-]*:/i.test(url))
14
- return false;
15
- const site = URL.parse(ctx.site.url);
16
- const target = URL.parse(url);
17
- if (site === null || target === null)
18
- return false;
19
- return site.host !== target.host;
20
- }
21
- export function actionLink(ctx, action) {
22
- const url = href(ctx, action.target);
23
- const external = isExternal(ctx, url);
24
- return h('a', {
25
- class: 'cg-action',
26
- // `emphasis` is a semantic intent, so it stays an attribute the skin reads
27
- // rather than a class the block dictated. Default `secondary`: promoting
28
- // an unstated action to primary is a decision the editor did not make.
29
- 'data-emphasis': action.emphasis ?? 'secondary',
30
- href: url,
31
- rel: external ? 'noopener noreferrer' : undefined,
32
- }, action.label);
33
- }
34
- /**
35
- * A list, not a row of loose anchors: a screen reader then announces "list, 2
36
- * items" and the actions are navigable as a group.
37
- */
38
- export function actionList(ctx, actions, label) {
39
- if (actions === undefined || actions.length === 0)
40
- return null;
41
- return h('ul', { class: 'cg-actions', 'aria-label': label }, actions.map((action) => h('li', {}, actionLink(ctx, action))));
42
- }
1
+ /** Re-exported from `@cogenta/theme-kit` see that package's `actions.ts`. */
2
+ export { actionLink, actionList, href } from '@cogenta/theme-kit';
43
3
  //# sourceMappingURL=actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../src/render/actions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,CAAC,EAAE,MAAM,WAAW,CAAA;AAE/C;;;;;GAKG;AACH,MAAM,UAAU,IAAI,CAAC,GAAkB,EAAE,MAAkB;IACzD,OAAO,MAAM,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AACpE,CAAC;AAED,iFAAiF;AACjF,SAAS,UAAU,CAAC,GAAkB,EAAE,GAAW;IACjD,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAA;IACnD,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACpC,MAAM,MAAM,GAAG,GAAG,CAAC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IAAI,EAAE,MAAM,oBAAoB,CAAA"}
@@ -0,0 +1,5 @@
1
+ import type { AccordionBlock } from '@cogenta/blocks';
2
+ import type { RenderContext } from '../../theme-contract.js';
3
+ import { type HtmlElement } from '../html.js';
4
+ export declare function renderAccordion(block: AccordionBlock, ctx: RenderContext): HtmlElement;
5
+ //# sourceMappingURL=accordion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/accordion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,iBAAiB,CAAA;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAE5D,OAAO,EAAE,KAAK,WAAW,EAAK,MAAM,YAAY,CAAA;AAuBhD,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAiBtF"}
@@ -0,0 +1,19 @@
1
+ import { blockHeadingTag, heading } from '../heading.js';
2
+ import { h } from '../html.js';
3
+ import { renderRichText } from '../rich-text.js';
4
+ /**
5
+ * `blocks@2.0` (RFC 0001). Shares `faq`'s `<details>`/`<summary>` mechanics —
6
+ * expanding, keyboard operation and the expanded state all come from the
7
+ * browser, at zero bytes of JavaScript — but is its own block, since
8
+ * "accordion" and "frequently asked question" are different editorial
9
+ * intents even when the underlying question/answer shape coincides.
10
+ */
11
+ function renderItem(item, ctx) {
12
+ return h('li', { class: 'cg-accordion__item' }, h('details', { class: 'cg-accordion__details' }, h('summary', { class: 'cg-accordion__question' }, item.question), h('div', { class: 'cg-accordion__answer' }, renderRichText(ctx, item.answer))));
13
+ }
14
+ export function renderAccordion(block, ctx) {
15
+ return h('section', { class: 'cg-block cg-accordion', 'data-block': 'accordion' }, block.title === undefined
16
+ ? null
17
+ : heading(blockHeadingTag('accordion') ?? 'h2', { class: 'cg-accordion__title', 'data-field': 'title' }, block.title), h('ul', { class: 'cg-accordion__items' }, block.items.map((item) => renderItem(item, ctx))));
18
+ }
19
+ //# sourceMappingURL=accordion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accordion.js","sourceRoot":"","sources":["../../../../src/render/blocks/accordion.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACxD,OAAO,EAAoB,CAAC,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD;;;;;;GAMG;AACH,SAAS,UAAU,CAAC,IAAmB,EAAE,GAAkB;IACzD,OAAO,CAAC,CACN,IAAI,EACJ,EAAE,KAAK,EAAE,oBAAoB,EAAE,EAC/B,CAAC,CACC,SAAS,EACT,EAAE,KAAK,EAAE,uBAAuB,EAAE,EAClC,CAAC,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,wBAAwB,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,EAChE,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,sBAAsB,EAAE,EAAE,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAC9E,CACF,CAAA;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAqB,EAAE,GAAkB;IACvE,OAAO,CAAC,CACN,SAAS,EACT,EAAE,KAAK,EAAE,uBAAuB,EAAE,YAAY,EAAE,WAAW,EAAE,EAC7D,KAAK,CAAC,KAAK,KAAK,SAAS;QACvB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,OAAO,CACL,eAAe,CAAC,WAAW,CAAC,IAAI,IAAI,EACpC,EAAE,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,OAAO,EAAE,EACvD,KAAK,CAAC,KAAK,CACZ,EACL,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,qBAAqB,EAAE,EAChC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CACjD,CACF,CAAA;AACH,CAAC"}
@@ -1,16 +1,18 @@
1
1
  import type { CollectionListBlock } from '@cogenta/blocks';
2
- import type { ContentEntry, QueryRequest, RenderContext } from '../../theme-contract.js';
2
+ import type { ContentEntry, RenderContext } from '../../theme-contract.js';
3
3
  import { type HtmlElement } from '../html.js';
4
4
  /**
5
5
  * The only block of the twelve that reads data at render time — contract B
6
6
  * marks it `runtime: 'server'` for that reason.
7
7
  *
8
- * The read is *not* done here. `query` builds the request, the `.astro`
9
- * component awaits `ctx.content.list(...)` in its frontmatter, and this
10
- * function stays a pure function of the entries it is handed. That keeps the
11
- * markup snapshot-testable and keeps the theme's single door to data the
12
- * read-only content client in one visible place.
8
+ * The read is *not* done here. `query` builds the request (`@cogenta/theme-kit`'s
9
+ * `buildCollectionListQuery`, shared across every theme since it derives
10
+ * purely from the block's own fields), the caller awaits `ctx.content.list(...)`
11
+ * before rendering starts, and this function stays a pure function of the
12
+ * entries it is handed. That keeps the markup snapshot-testable and keeps a
13
+ * theme's single door to data — the read-only content client — in one visible
14
+ * place.
13
15
  */
14
- export declare function query(block: CollectionListBlock): QueryRequest;
16
+ export { buildCollectionListQuery as query } from '@cogenta/theme-kit';
15
17
  export declare function renderCollectionList(block: CollectionListBlock, ctx: RenderContext, entries: readonly ContentEntry[]): HtmlElement;
16
18
  //# sourceMappingURL=collection-list.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"collection-list.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/collection-list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAGxF,OAAO,EAAE,KAAK,WAAW,EAAK,MAAM,YAAY,CAAA;AAEhD;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,mBAAmB,GAAG,YAAY,CAQ9D;AA8BD,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,mBAAmB,EAC1B,GAAG,EAAE,aAAa,EAClB,OAAO,EAAE,SAAS,YAAY,EAAE,GAC/B,WAAW,CAuCb"}
1
+ {"version":3,"file":"collection-list.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/collection-list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAG1E,OAAO,EAAE,KAAK,WAAW,EAAK,MAAM,YAAY,CAAA;AAEhD;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,wBAAwB,IAAI,KAAK,EAAE,MAAM,oBAAoB,CAAA;AA8BtE,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,mBAAmB,EAC1B,GAAG,EAAE,aAAa,EAClB,OAAO,EAAE,SAAS,YAAY,EAAE,GAC/B,WAAW,CAuCb"}
@@ -5,21 +5,15 @@ import { h } from '../html.js';
5
5
  * The only block of the twelve that reads data at render time — contract B
6
6
  * marks it `runtime: 'server'` for that reason.
7
7
  *
8
- * The read is *not* done here. `query` builds the request, the `.astro`
9
- * component awaits `ctx.content.list(...)` in its frontmatter, and this
10
- * function stays a pure function of the entries it is handed. That keeps the
11
- * markup snapshot-testable and keeps the theme's single door to data the
12
- * read-only content client in one visible place.
8
+ * The read is *not* done here. `query` builds the request (`@cogenta/theme-kit`'s
9
+ * `buildCollectionListQuery`, shared across every theme since it derives
10
+ * purely from the block's own fields), the caller awaits `ctx.content.list(...)`
11
+ * before rendering starts, and this function stays a pure function of the
12
+ * entries it is handed. That keeps the markup snapshot-testable and keeps a
13
+ * theme's single door to data — the read-only content client — in one visible
14
+ * place.
13
15
  */
14
- export function query(block) {
15
- return {
16
- collection: block.collection,
17
- ...(block.filter === undefined ? {} : { filter: block.filter }),
18
- ...(block.sort === undefined ? {} : { sort: block.sort }),
19
- // Capped by contract B at 100; an absent limit still must not mean "all".
20
- limit: block.limit ?? 10,
21
- };
22
- }
16
+ export { buildCollectionListQuery as query } from '@cogenta/theme-kit';
23
17
  function renderEntry(entry, ctx, tag) {
24
18
  const date = entryDate(entry);
25
19
  const excerpt = entryExcerpt(entry);
@@ -1 +1 @@
1
- {"version":3,"file":"collection-list.js","sourceRoot":"","sources":["../../../../src/render/blocks/collection-list.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC5E,OAAO,EAAE,eAAe,EAAmB,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAC3F,OAAO,EAAoB,CAAC,EAAE,MAAM,YAAY,CAAA;AAEhD;;;;;;;;;GASG;AACH,MAAM,UAAU,KAAK,CAAC,KAA0B;IAC9C,OAAO;QACL,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,GAAG,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;QAC/D,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;QACzD,0EAA0E;QAC1E,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,EAAE;KACzB,CAAA;AACH,CAAC;AAED,SAAS,WAAW,CAAC,KAAmB,EAAE,GAAkB,EAAE,GAAe;IAC3E,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,CAAA;IAC7B,MAAM,OAAO,GAAG,YAAY,CAAC,KAAK,CAAC,CAAA;IACnC,OAAO,CAAC,CACN,IAAI,EACJ,EAAE,KAAK,EAAE,U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E,KAAK,EAAE,sBAAsB,EAAE,EACjC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC,CAC1D,CAAA;IAEP,OAAO,CAAC,CACN,SAAS,EACT;QACE,KAAK,EAAE,wBAAwB;QAC/B,YAAY,EAAE,gBAAgB;QAC9B,aAAa,EAAE,KAAK,CAAC,MAAM;KAC5B,EACD,QAAQ;QACN,CAAC,CAAC,OAAO,CACL,eAAe,CAAC,gBAAgB,CAAC,IAAI,IAAI,EACzC,EAAE,KAAK,EAAE,sBAAsB,EAAE,YAAY,EAAE,OAAO,EAAE,EACxD,KAAK,CAAC,KAAK,IAAI,EAAE,CAClB;QACH,CAAC,CAAC,IAAI,EACR,KAAK,CAAC,MAAM,KAAK,UAAU;QACzB,CAAC,CAAC,CAAC,CACC,KAAK,EACL;YACE,KAAK,EAAE,yBAAyB;YAChC,IAAI,EAAE,QAAQ;YACd,YAAY,EAAE,KAAK,CAAC,KAAK,IAAI,GAAG,CAAC,CAAC,CAAC,qBAAqB,CAAC;YACzD,QAAQ,EAAE,GAAG;SACd,EACD,KAAK,CACN;QACH,CAAC,CAAC,KAAK,CACV,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"collection-list.js","sourceRoot":"","sources":["../../../../src/render/blocks/collection-list.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC5E,OAAO,EAAE,eAAe,EAAmB,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAC3F,OAAO,EAAoB,CAAC,EAAE,MAAM,YAAY,CAAA;AAEhD;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,wBAAwB,IAAI,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAEtE,SAAS,WAAW,CAAC,KAAmB,EAAE,GAAkB,EAAE,GAAe;IA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wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAmB1F"}
1
+ {"version":3,"file":"feature-grid.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/feature-grid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAe,MAAM,iBAAiB,CAAA;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAG5D,OAAO,EAAE,KAAK,WAAW,EAAK,MAAM,YAAY,CAAA;AAuChD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAmB1F"}
@@ -1,13 +1,18 @@
1
1
  import { href } from '../actions.js';
2
2
  import { blockHeadingTag, heading, nestedHeadingTag } from '../heading.js';
3
3
  import { h } from '../html.js';
4
+ import { renderIcon } from '../icons.js';
4
5
  /**
5
6
  * The item's title is the link, so the link's accessible name is the feature's
6
7
  * name. A bare "learn more" repeated six times is the classic failure of
7
8
  * WCAG 2.4.4, and the block carries no label field to write one anyway.
8
9
  *
9
10
  * `icon` names a symbol, never markup: it is exposed as a data attribute for
10
- * the skin and marked `aria-hidden`, since the title already names the feature.
11
+ * the skin (and, since L25, the page builder see `data-icon` below) and,
12
+ * when the name is one `renderIcon` (`@cogenta/theme-kit`) recognises, a real
13
+ * inline glyph — `aria-hidden`, since the title already names the feature.
14
+ * An unrecognised name keeps the pre-L25 behaviour: the bare, empty
15
+ * `data-icon` span, styled by `.cg-feature__icon` alone.
11
16
  */
12
17
  function renderItem(item, ctx, tag) {
13
18
  const title = item.link === undefined
@@ -15,7 +20,7 @@ function renderItem(item, ctx, tag) {
15
20
  : heading(tag, { class: 'cg-feature__title' }, h('a', { class: 'cg-feature__link', href: href(ctx, item.link) }, item.title));
16
21
  return h('li', { class: 'cg-feature' }, item.icon === undefined
17
22
  ? null
18
- : h('span', { class: 'cg-feature__icon', 'data-icon': item.icon, 'aria-hidden': 'true' }), title, item.text === undefined ? null : h('p', { class: 'cg-feature__text' }, item.text));
23
+ : h('span', { class: 'cg-feature__icon', 'data-icon': item.icon, 'aria-hidden': 'true' }, renderIcon(item.icon)), title, item.text === undefined ? null : h('p', { class: 'cg-feature__text' }, item.text));
19
24
  }
20
25
  export function renderFeatureGrid(block, ctx) {
21
26
  const hasTitle = block.title !== undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"feature-grid.js","sourceRoot":"","sources":["../../../../src/render/blocks/feature-grid.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,eAAe,EAAmB,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAC3F,OAAO,EAAoB,CAAC,EAAE,MAAM,YAAY,CAAA;AAEhD;;;;;;;GAOG;AACH,SAAS,UAAU,CAAC,IAAiB,EAAE,GAAkB,EAAE,GAAe;IACxE,MAAM,KAAK,GACT,IAAI,CAAC,IAAI,KAAK,SAAS;QACrB,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC;QAC1D,CAAC,CAAC,OAAO,CACL,GAAG,EACH,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAC9B,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAC9E,CAAA;IACP,OAAO,CAAC,CACN,IAAI,EACJ,EAAE,KAAK,EAAE,YAAY,EAAE,EACvB,IAAI,CAAC,IAAI,KAAK,SAAS;QACrB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,IAAI,CAAC,IAAI,EAAE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B,EAAE,YAAY,EAAE,aAAa,EAAE,EAC9D,QAAQ;QACN,CAAC,CAAC,OAAO,CACL,eAAe,CAAC,aAAa,CAAC,IAAI,IAAI,EACtC,EAAE,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,OAAO,EAAE,EACtD,KAAK,CAAC,KAAK,IAAI,EAAE,CAClB;QACH,CAAC,CAAC,IAAI,EACR,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,oBAAoB,EAAE,EAC/B,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,CAC1D,CACF,CAAA;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { LogoStripBlock } from '@cogenta/blocks';
2
+ import type { RenderContext } from '../../theme-contract.js';
3
+ import { type HtmlElement } from '../html.js';
4
+ export declare function renderLogoStrip(block: LogoStripBlock, ctx: RenderContext): HtmlElement;
5
+ //# sourceMappingURL=logo-strip.d.ts.map
@@ -0,0 +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,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,KAAK,WAAW,EAAK,MAAM,YAAY,CAAA;AAkBhD,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAiBtF"}
@@ -0,0 +1,18 @@
1
+ import { h } from '../html.js';
2
+ import { image } from '../media.js';
3
+ /**
4
+ * `blocks@2.0` (RFC 0001). The lighter-weight "as seen in" / social-proof
5
+ * row next to `logos`: no per-logo name or link, so no accessible-name field
6
+ * to require — each image's own alt text (set once, in the media library)
7
+ * is what names it, exactly as `logos` already falls back to when a link is
8
+ * absent.
9
+ */
10
+ function renderItem(item, ctx) {
11
+ return h('li', { class: 'cg-logo-strip__item' }, image(ctx, item.media, { className: 'cg-logo-strip__image', variant: { fit: 'contain' } }));
12
+ }
13
+ export function renderLogoStrip(block, ctx) {
14
+ return h('figure', { class: 'cg-block cg-logo-strip', 'data-block': 'logoStrip' }, h('ul', { class: 'cg-logo-strip__items' }, block.logos.map((item) => renderItem(item, ctx))), block.caption === undefined
15
+ ? null
16
+ : h('figcaption', { class: 'cg-logo-strip__caption', 'data-field': 'caption' }, block.caption));
17
+ }
18
+ //# sourceMappingURL=logo-strip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logo-strip.js","sourceRoot":"","sources":["../../../../src/render/blocks/logo-strip.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,CAAC,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAEnC;;;;;;GAMG;AACH,SAAS,UAAU,CAAC,IAAmB,EAAE,GAAkB;IACzD,OAAO,CAAC,CACN,IAAI,EACJ,EAAE,KAAK,EAAE,qBAAqB,EAAE,EAChC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,sBAAsB,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,CAC3F,CAAA;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAqB,EAAE,GAAkB;IACvE,OAAO,CAAC,CACN,QAAQ,EACR,EAAE,KAAK,EAAE,wBAAwB,EAAE,YAAY,EAAE,WAAW,EAAE,EAC9D,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,sBAAsB,EAAE,EACjC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CACjD,EACD,KAAK,CAAC,OAAO,KAAK,SAAS;QACzB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,CACC,YAAY,EACZ,EAAE,KAAK,EAAE,wBAAwB,EAAE,YAAY,EAAE,SAAS,EAAE,EAC5D,KAAK,CAAC,OAAO,CACd,CACN,CAAA;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { PricingTableBlock } from '@cogenta/blocks';
2
+ import type { RenderContext } from '../../theme-contract.js';
3
+ import { type HtmlElement } from '../html.js';
4
+ export declare function renderPricingTable(block: PricingTableBlock, ctx: RenderContext): HtmlElement;
5
+ //# sourceMappingURL=pricing-table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pricing-table.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/pricing-table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAe,MAAM,iBAAiB,CAAA;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAG5D,OAAO,EAAE,KAAK,WAAW,EAAK,MAAM,YAAY,CAAA;AAyChD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAmB5F"}
@@ -0,0 +1,29 @@
1
+ import { actionLink } from '../actions.js';
2
+ import { blockHeadingTag, heading, nestedHeadingTag } from '../heading.js';
3
+ import { h } from '../html.js';
4
+ /**
5
+ * `blocks@2.0` (RFC 0001). `highlighted` is editorial emphasis, not a colour:
6
+ * it becomes `data-highlighted` for the skin to style, and `aria-current`
7
+ * (loosely "the one on offer") so it is announced, not only shown.
8
+ */
9
+ function renderTier(tier, ctx, tag) {
10
+ return h('li', {
11
+ class: 'cg-pricing__tier',
12
+ 'data-highlighted': tier.highlighted === true ? 'true' : undefined,
13
+ 'aria-current': tier.highlighted === true ? 'true' : undefined,
14
+ }, 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
15
+ ? null
16
+ : h('span', { class: 'cg-pricing__interval' }, tier.interval)), tier.features.length === 0
17
+ ? null
18
+ : h('ul', { class: 'cg-pricing__features' }, tier.features.map((feature) => h('li', {}, feature))), tier.action === undefined
19
+ ? null
20
+ : h('div', { class: 'cg-pricing__action' }, actionLink(ctx, { ...tier.action, emphasis: tier.action.emphasis ?? 'primary' })));
21
+ }
22
+ export function renderPricingTable(block, ctx) {
23
+ const hasTitle = block.title !== undefined;
24
+ const tierTag = nestedHeadingTag('pricingTable', hasTitle);
25
+ return h('section', { class: 'cg-block cg-pricing', 'data-block': 'pricingTable' }, hasTitle
26
+ ? heading(blockHeadingTag('pricingTable') ?? 'h2', { class: 'cg-pricing__title', 'data-field': 'title' }, block.title ?? '')
27
+ : null, h('ul', { class: 'cg-pricing__tiers' }, block.tiers.map((tier) => renderTier(tier, ctx, tierTag))));
28
+ }
29
+ //# sourceMappingURL=pricing-table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pricing-table.js","sourceRoot":"","sources":["../../../../src/render/blocks/pricing-table.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAmB,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAC3F,OAAO,EAAoB,CAAC,EAAE,MAAM,YAAY,CAAA;AAEhD;;;;GAIG;AACH,SAAS,UAAU,CAAC,IAAiB,EAAE,GAAkB,EAAE,GAAe;IACxE,OAAO,CAAC,CACN,IAAI,EACJ;QACE,KAAK,EAAE,kBAAkB;QACzB,kBAAkB,EAAE,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;QAClE,cAAc,EAAE,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;KAC/D,EACD,OAAO,CAAC,GAAG,EAAE,EAA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,EAC9D,QAAQ;QACN,CAAC,CAAC,OAAO,CACL,eAAe,CAAC,cAAc,CAAC,IAAI,IAAI,EACvC,EAAE,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,OAAO,EAAE,EACrD,KAAK,CAAC,KAAK,IAAI,EAAE,CAClB;QACH,CAAC,CAAC,IAAI,EACR,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAC9B,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,CAC1D,CACF,CAAA;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { StatCounterBlock } from '@cogenta/blocks';
2
+ import type { RenderContext } from '../../theme-contract.js';
3
+ import { type HtmlElement } from '../html.js';
4
+ export declare function renderStatCounter(block: StatCounterBlock, _ctx: RenderContext): HtmlElement;
5
+ //# sourceMappingURL=stat-counter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stat-counter.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/stat-counter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAmB,MAAM,iBAAiB,CAAA;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAE5D,OAAO,EAAE,KAAK,WAAW,EAAK,MAAM,YAAY,CAAA;AAiBhD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,aAAa,GAAG,WAAW,CAa3F"}
@@ -0,0 +1,17 @@
1
+ import { blockHeadingTag, heading } from '../heading.js';
2
+ import { h } from '../html.js';
3
+ /**
4
+ * `blocks@2.0` (RFC 0001). A `<dl>`, exactly like `stats` — each figure is
5
+ * the description of its label — but narrower on purpose: no `unit`, since a
6
+ * counter row is meant for one big figure and its label, not the fuller
7
+ * statistic `stats` already covers.
8
+ */
9
+ function renderItem(item) {
10
+ return h('div', { class: 'cg-stat-counter' }, h('dt', { class: 'cg-stat-counter__label' }, item.label), h('dd', { class: 'cg-stat-counter__value' }, item.value));
11
+ }
12
+ export function renderStatCounter(block, _ctx) {
13
+ return h('section', { class: 'cg-block cg-stat-counters', 'data-block': 'statCounter' }, block.title === undefined
14
+ ? null
15
+ : heading(blockHeadingTag('statCounter') ?? 'h2', { class: 'cg-stat-counters__title', 'data-field': 'title' }, block.title), h('dl', { class: 'cg-stat-counters__items' }, block.stats.map(renderItem)));
16
+ }
17
+ //# sourceMappingURL=stat-counter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stat-counter.js","sourceRoot":"","sources":["../../../../src/render/blocks/stat-counter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACxD,OAAO,EAAoB,CAAC,EAAE,MAAM,YAAY,CAAA;AAEhD;;;;;GAKG;AACH,SAAS,UAAU,CAAC,IAAqB;IACvC,OAAO,CAAC,CACN,KAAK,EACL,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAC5B,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,wBAAwB,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EACxD,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,wBAAwB,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CACzD,CAAA;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAuB,EAAE,IAAmB;IAC5E,OAAO,CAAC,CACN,SAAS,EACT,EAAE,KAAK,EAAE,2BAA2B,EAAE,YAAY,EAAE,aAAa,EAAE,EACnE,KAAK,CAAC,KAAK,KAAK,SAAS;QACvB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,OAAO,CACL,eAAe,CAAC,aAAa,CAAC,IAAI,IAAI,EACtC,EAAE,KAAK,EAAE,yBAAyB,EAAE,YAAY,EAAE,OAAO,EAAE,EAC3D,KAAK,CAAC,KAAK,CACZ,EACL,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,yBAAyB,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAC3E,CAAA;AACH,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { TestimonialBlock } from '@cogenta/blocks';
2
+ import type { RenderContext } from '../../theme-contract.js';
3
+ import { type HtmlElement } from '../html.js';
4
+ /**
5
+ * `blocks@2.0` (RFC 0001). Same `<figure><blockquote>…<figcaption>` pattern
6
+ * as `quote`, but the quote itself is rich text (a testimonial can carry a
7
+ * link or emphasis the shorter, plain-text `quote` block cannot) and the
8
+ * attribution is one grouped field rather than three loose ones.
9
+ *
10
+ * The avatar is decorative, exactly like `quote`'s own: the name is right
11
+ * beside it in text, so its media entity's alt text is expected to be empty.
12
+ */
13
+ export declare function renderTestimonial(block: TestimonialBlock, ctx: RenderContext): HtmlElement;
14
+ //# sourceMappingURL=testimonial.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testimonial.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/testimonial.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,KAAK,WAAW,EAAK,MAAM,YAAY,CAAA;AAIhD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAyB1F"}
@@ -0,0 +1,24 @@
1
+ import { h } from '../html.js';
2
+ import { image } from '../media.js';
3
+ import { renderRichText } from '../rich-text.js';
4
+ /**
5
+ * `blocks@2.0` (RFC 0001). Same `<figure><blockquote>…<figcaption>` pattern
6
+ * as `quote`, but the quote itself is rich text (a testimonial can carry a
7
+ * link or emphasis the shorter, plain-text `quote` block cannot) and the
8
+ * attribution is one grouped field rather than three loose ones.
9
+ *
10
+ * The avatar is decorative, exactly like `quote`'s own: the name is right
11
+ * beside it in text, so its media entity's alt text is expected to be empty.
12
+ */
13
+ export function renderTestimonial(block, ctx) {
14
+ const { attribution } = block;
15
+ 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
16
+ ? null
17
+ : image(ctx, attribution.avatar, {
18
+ className: 'cg-testimonial__avatar',
19
+ variant: { width: 96, height: 96, fit: 'cover' },
20
+ }), h('span', { class: 'cg-testimonial__names' }, h('span', { class: 'cg-testimonial__name' }, attribution.name), attribution.role === undefined
21
+ ? null
22
+ : h('span', { class: 'cg-testimonial__role' }, attribution.role))));
23
+ }
24
+ //# sourceMappingURL=testimonial.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testimonial.js","sourceRoot":"","sources":["../../../../src/render/blocks/testimonial.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,CAAC,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD;;;;;;;;GAQG;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,uBAAuB,EAAE,EAClC,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"}
@@ -0,0 +1,3 @@
1
+ import { type ChromeInput, type ChromeResult } from '@cogenta/theme-kit';
2
+ export declare function renderChrome(input: ChromeInput): ChromeResult;
3
+ //# sourceMappingURL=chrome.d.ts.map
@@ -0,0 +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;AAgD3B,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,YAAY,CA8C7D"}
@@ -0,0 +1,82 @@
1
+ import { escapeAttribute, escapeText, renderBrandMark, renderSocialLinks, renderThemeToggle, serialize, } from '@cogenta/theme-kit';
2
+ /**
3
+ * The site header and footer — moved here, verbatim, from what used to be
4
+ * `@cogenta/cli`'s own hardcoded `<header class="cg-site-header">`/`<footer
5
+ * class="cg-site-footer">` template (`packages/cli/src/commands/theme-render.ts`,
6
+ * before the chrome extension point existed). Byte-identical output to that
7
+ * template: this is the reference theme, and every site that installed it
8
+ * before a second theme existed must render exactly as it always has.
9
+ *
10
+ * A future theme with a structurally different header (a mega-menu, a cart
11
+ * icon, no header at all) implements its own `renderChrome` instead — this is
12
+ * simply the one this package ships.
13
+ *
14
+ * `theme@1.4` (L25 D2) adds four optional fields, each rendered only when
15
+ * present: `headerAction` as a button-styled link at the end of the header
16
+ * nav, `tagline` under the site name in the footer, `social` as an icon-link
17
+ * row (`renderSocialLinks`), `footerNote` as a short "about" paragraph. A
18
+ * site that sets none of them, and a `1.3` render that never reaches this
19
+ * file at all, both keep the pre-1.4 header/footer byte for byte — see
20
+ * `test/chrome.test.ts`'s own "without the new fields" case.
21
+ */
22
+ function renderNavLinks(links) {
23
+ if (links.length === 0)
24
+ return '';
25
+ const items = links
26
+ .filter((link) => link.href !== null || link.kind === 'submenu-placeholder')
27
+ .map((link) => {
28
+ const label = escapeText(link.label);
29
+ const titleAttr = link.title === null ? '' : ` title="${escapeAttribute(link.title)}"`;
30
+ if (link.href === null)
31
+ return `<li><span${titleAttr}>${label}</span></li>`;
32
+ const href = escapeAttribute(link.href);
33
+ const target = link.openInNewTab ? ' target="_blank" rel="noopener"' : '';
34
+ return `<li><a href="${href}"${target}${titleAttr}>${label}</a></li>`;
35
+ })
36
+ .join('');
37
+ return items === '' ? '' : `<ul class="cg-menu">${items}</ul>`;
38
+ }
39
+ /** The header's own call-to-action link (`theme@1.4`), styled like the block vocabulary's own primary action. */
40
+ function renderHeaderAction(action) {
41
+ if (action === undefined)
42
+ return '';
43
+ return (`<a class="cg-action cg-site-header__action" data-emphasis="primary" ` +
44
+ `href="${escapeAttribute(action.href)}">${escapeText(action.label)}</a>`);
45
+ }
46
+ export function renderChrome(input) {
47
+ const siteName = escapeAttribute(input.site.name);
48
+ const headerNav = renderNavLinks(input.headerNav);
49
+ const footerNav = renderNavLinks(input.footerNav);
50
+ // The uploaded logo replaces the wordmark, and only the wordmark: the
51
+ // footer keeps the site's name in text, so a site whose logo fails to load
52
+ // is still named somewhere on every page.
53
+ const mark = renderBrandMark(input.brand, { className: 'cg-site-header__logo' }) ?? siteName;
54
+ const headerAction = renderHeaderAction(input.headerAction);
55
+ const themeToggle = serialize(renderThemeToggle(input.locale, { className: 'cg-theme-toggle' }));
56
+ const header = `<header class="cg-site-header"><div class="cg-site-header__inner">` +
57
+ `<a class="cg-site-header__home" href="${escapeAttribute(input.homeHref)}">${mark}</a>` +
58
+ `${headerNav === '' ? '' : `<nav class="cg-site-header__nav" aria-label="Primary">${headerNav}</nav>`}` +
59
+ `${themeToggle}` +
60
+ `${headerAction}` +
61
+ `</div></header>`;
62
+ const tagline = input.tagline === undefined
63
+ ? ''
64
+ : `<p class="cg-site-footer__tagline">${escapeText(input.tagline)}</p>`;
65
+ const social = input.social === undefined
66
+ ? ''
67
+ : serialize(renderSocialLinks(input.social, {
68
+ className: 'cg-site-footer__social',
69
+ itemClassName: 'cg-site-footer__social-item',
70
+ }) ?? { kind: 'text', value: '' });
71
+ const footerNote = input.footerNote === undefined
72
+ ? ''
73
+ : `<p class="cg-site-footer__note">${escapeText(input.footerNote)}</p>`;
74
+ const footer = `<footer class="cg-site-footer"><div class="cg-site-footer__inner">` +
75
+ `<span>${siteName}</span>${tagline}` +
76
+ `${footerNav === '' ? '' : `<nav class="cg-site-footer__nav" aria-label="Footer">${footerNav}</nav>`}` +
77
+ `${social}` +
78
+ `${footerNote === '' ? '' : `<div class="cg-site-footer__about">${footerNote}</div>`}` +
79
+ `${input.brandingHtml}</div></footer>`;
80
+ return { header, footer };
81
+ }
82
+ //# sourceMappingURL=chrome.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chrome.js","sourceRoot":"","sources":["../../../src/render/chrome.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,eAAe,EACf,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,SAAS,GACV,MAAM,oBAAoB,CAAA;AAE3B;;;;;;;;;;;;;;;;;;;GAmBG;AA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,EAAE,6BAA6B;SAC7C,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,CAClC,CAAA;IACP,MAAM,UAAU,GACd,KAAK,CAAC,UAAU,KAAK,SAAS;QAC5B,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,mCAAmC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAA;IAE3E,MAAM,MAAM,GACV,oEAAoE;QACpE,SAAS,QAAQ,UAAU,OAAO,EAAE;QACpC,GAAG,SAAS,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,wDAAwD,SAAS,QAAQ,EAAE;QACtG,GAAG,MAAM,EAAE;QACX,GAAG,UAAU,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,sCAAsC,UAAU,QAAQ,EAAE;QACtF,GAAG,KAAK,CAAC,YAAY,iBAAiB,CAAA;IAExC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;AAC3B,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** Re-exported from `@cogenta/theme-kit` — see that package's `comments.ts`. */
2
+ export { type CommentsSectionOptions, type PublicComment, renderCommentsSection, } from '@cogenta/theme-kit';
3
+ //# sourceMappingURL=comments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comments.d.ts","sourceRoot":"","sources":["../../../src/render/comments.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAClB,qBAAqB,GACtB,MAAM,oBAAoB,CAAA"}
@@ -0,0 +1,3 @@
1
+ /** Re-exported from `@cogenta/theme-kit` — see that package's `comments.ts`. */
2
+ export { renderCommentsSection, } from '@cogenta/theme-kit';
3
+ //# sourceMappingURL=comments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comments.js","sourceRoot":"","sources":["../../../src/render/comments.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,OAAO,EAGL,qBAAqB,GACtB,MAAM,oBAAoB,CAAA"}
@@ -1,7 +1,3 @@
1
- import type { ContentEntry, RenderContext } from '../theme-contract.js';
2
- export declare function entryTitle(entry: ContentEntry, ctx: RenderContext): string;
3
- export declare function entryExcerpt(entry: ContentEntry): string | undefined;
4
- /** ISO 8601, for `<time datetime>`. Anything else is not a date this can use. */
5
- export declare function entryDate(entry: ContentEntry): string | undefined;
6
- export declare function entryHref(entry: ContentEntry, ctx: RenderContext): string;
1
+ /** Re-exported from `@cogenta/theme-kit` see that package's `entry.ts`. */
2
+ export { entryDate, entryExcerpt, entryHref, entryImage, entryTitle } from '@cogenta/theme-kit';
7
3
  //# sourceMappingURL=entry.d.ts.map