@cogenta/theme-magazine 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +373 -0
- package/dist/src/index.d.ts +21 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +21 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/render/blocks/accordion.d.ts +4 -0
- package/dist/src/render/blocks/accordion.d.ts.map +1 -0
- package/dist/src/render/blocks/accordion.js +20 -0
- package/dist/src/render/blocks/accordion.js.map +1 -0
- package/dist/src/render/blocks/collection-list.d.ts +5 -0
- package/dist/src/render/blocks/collection-list.d.ts.map +1 -0
- package/dist/src/render/blocks/collection-list.js +134 -0
- package/dist/src/render/blocks/collection-list.js.map +1 -0
- package/dist/src/render/blocks/cta.d.ts +10 -0
- package/dist/src/render/blocks/cta.d.ts.map +1 -0
- package/dist/src/render/blocks/cta.js +16 -0
- package/dist/src/render/blocks/cta.js.map +1 -0
- package/dist/src/render/blocks/embed.d.ts +4 -0
- package/dist/src/render/blocks/embed.d.ts.map +1 -0
- package/dist/src/render/blocks/embed.js +76 -0
- package/dist/src/render/blocks/embed.js.map +1 -0
- package/dist/src/render/blocks/faq.d.ts +4 -0
- package/dist/src/render/blocks/faq.d.ts.map +1 -0
- package/dist/src/render/blocks/faq.js +18 -0
- package/dist/src/render/blocks/faq.js.map +1 -0
- package/dist/src/render/blocks/feature-grid.d.ts +4 -0
- package/dist/src/render/blocks/feature-grid.d.ts.map +1 -0
- package/dist/src/render/blocks/feature-grid.js +27 -0
- package/dist/src/render/blocks/feature-grid.js.map +1 -0
- package/dist/src/render/blocks/gallery.d.ts +13 -0
- package/dist/src/render/blocks/gallery.d.ts.map +1 -0
- package/dist/src/render/blocks/gallery.js +26 -0
- package/dist/src/render/blocks/gallery.js.map +1 -0
- package/dist/src/render/blocks/hero.d.ts +11 -0
- package/dist/src/render/blocks/hero.d.ts.map +1 -0
- package/dist/src/render/blocks/hero.js +26 -0
- package/dist/src/render/blocks/hero.js.map +1 -0
- package/dist/src/render/blocks/logo-strip.d.ts +4 -0
- package/dist/src/render/blocks/logo-strip.d.ts.map +1 -0
- package/dist/src/render/blocks/logo-strip.js +20 -0
- package/dist/src/render/blocks/logo-strip.js.map +1 -0
- package/dist/src/render/blocks/logos.d.ts +4 -0
- package/dist/src/render/blocks/logos.d.ts.map +1 -0
- package/dist/src/render/blocks/logos.js +27 -0
- package/dist/src/render/blocks/logos.js.map +1 -0
- package/dist/src/render/blocks/media-figure.d.ts +15 -0
- package/dist/src/render/blocks/media-figure.d.ts.map +1 -0
- package/dist/src/render/blocks/media-figure.js +32 -0
- package/dist/src/render/blocks/media-figure.js.map +1 -0
- package/dist/src/render/blocks/pricing-table.d.ts +4 -0
- package/dist/src/render/blocks/pricing-table.d.ts.map +1 -0
- package/dist/src/render/blocks/pricing-table.js +32 -0
- package/dist/src/render/blocks/pricing-table.js.map +1 -0
- package/dist/src/render/blocks/prose.d.ts +16 -0
- package/dist/src/render/blocks/prose.d.ts.map +1 -0
- package/dist/src/render/blocks/prose.js +17 -0
- package/dist/src/render/blocks/prose.js.map +1 -0
- package/dist/src/render/blocks/quote.d.ts +16 -0
- package/dist/src/render/blocks/quote.d.ts.map +1 -0
- package/dist/src/render/blocks/quote.js +29 -0
- package/dist/src/render/blocks/quote.js.map +1 -0
- package/dist/src/render/blocks/stat-counter.d.ts +4 -0
- package/dist/src/render/blocks/stat-counter.d.ts.map +1 -0
- package/dist/src/render/blocks/stat-counter.js +17 -0
- package/dist/src/render/blocks/stat-counter.js.map +1 -0
- package/dist/src/render/blocks/stats.d.ts +4 -0
- package/dist/src/render/blocks/stats.d.ts.map +1 -0
- package/dist/src/render/blocks/stats.js +19 -0
- package/dist/src/render/blocks/stats.js.map +1 -0
- package/dist/src/render/blocks/testimonial.d.ts +19 -0
- package/dist/src/render/blocks/testimonial.d.ts.map +1 -0
- package/dist/src/render/blocks/testimonial.js +28 -0
- package/dist/src/render/blocks/testimonial.js.map +1 -0
- package/dist/src/render/chrome.d.ts +3 -0
- package/dist/src/render/chrome.d.ts.map +1 -0
- package/dist/src/render/chrome.js +136 -0
- package/dist/src/render/chrome.js.map +1 -0
- package/dist/src/render/render-block.d.ts +21 -0
- package/dist/src/render/render-block.d.ts.map +1 -0
- package/dist/src/render/render-block.js +104 -0
- package/dist/src/render/render-block.js.map +1 -0
- package/dist/src/render/term-archive.d.ts +13 -0
- package/dist/src/render/term-archive.d.ts.map +1 -0
- package/dist/src/render/term-archive.js +35 -0
- package/dist/src/render/term-archive.js.map +1 -0
- package/dist/theme.config.d.ts +12 -0
- package/dist/theme.config.d.ts.map +1 -0
- package/dist/theme.config.js +42 -0
- package/dist/theme.config.js.map +1 -0
- package/package.json +57 -0
- package/src/index.ts +20 -0
- package/src/render/blocks/accordion.ts +51 -0
- package/src/render/blocks/collection-list.ts +286 -0
- package/src/render/blocks/cta.ts +33 -0
- package/src/render/blocks/embed.ts +99 -0
- package/src/render/blocks/faq.ts +58 -0
- package/src/render/blocks/feature-grid.ts +61 -0
- package/src/render/blocks/gallery.ts +46 -0
- package/src/render/blocks/hero.ts +54 -0
- package/src/render/blocks/logo-strip.ts +35 -0
- package/src/render/blocks/logos.ts +57 -0
- package/src/render/blocks/media-figure.ts +43 -0
- package/src/render/blocks/pricing-table.ts +76 -0
- package/src/render/blocks/prose.ts +22 -0
- package/src/render/blocks/quote.ts +46 -0
- package/src/render/blocks/stat-counter.ts +39 -0
- package/src/render/blocks/stats.ts +46 -0
- package/src/render/blocks/testimonial.ts +44 -0
- package/src/render/chrome.ts +162 -0
- package/src/render/render-block.ts +137 -0
- package/src/render/term-archive.ts +87 -0
- package/src/styles/archive.css +40 -0
- package/src/styles/base.css +1037 -0
- package/src/styles/blocks.css +1335 -0
- package/src/styles/theme.css +18 -0
- package/src/styles/tokens.css +308 -0
- package/tokens.json +36 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { blockHeadingTag, h, heading, } from '@cogenta/theme-kit';
|
|
2
|
+
/**
|
|
3
|
+
* `blocks@2.0` (RFC 0001). A circulation tally, set apart from `stats`'s own
|
|
4
|
+
* `cg-figures` (which carries vertical column rules and an optional `unit`):
|
|
5
|
+
* `statCounter` has no `unit`, so it is laid out as a single running line —
|
|
6
|
+
* each figure and its label separated only by a shared baseline rule, the
|
|
7
|
+
* way a masthead prints its circulation and edition counts along one strip.
|
|
8
|
+
*/
|
|
9
|
+
function renderItem(item) {
|
|
10
|
+
return h('div', { class: 'cg-tally__item' }, h('dd', { class: 'cg-tally__value' }, item.value), h('dt', { class: 'cg-tally__label' }, item.label));
|
|
11
|
+
}
|
|
12
|
+
export function renderStatCounter(block, _ctx) {
|
|
13
|
+
return h('section', { class: 'cg-block cg-tally', 'data-block': 'statCounter' }, block.title === undefined
|
|
14
|
+
? null
|
|
15
|
+
: heading(blockHeadingTag('statCounter') ?? 'h2', { class: 'cg-tally__title', 'data-field': 'title' }, block.title), h('dl', { class: 'cg-tally__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":"AACA,OAAO,EACL,eAAe,EAEf,CAAC,EACD,OAAO,GAER,MAAM,oBAAoB,CAAA;AAE3B;;;;;;GAMG;AACH,SAAS,UAAU,CAAC,IAAqB;IACvC,OAAO,CAAC,CACN,KAAK,EACL,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAC3B,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EACjD,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAClD,CAAA;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAuB,EAAE,IAAmB;IAC5E,OAAO,CAAC,CACN,SAAS,EACT,EAAE,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,aAAa,EAAE,EAC3D,KAAK,CAAC,KAAK,KAAK,SAAS;QACvB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,OAAO,CACL,eAAe,CAAC,aAAa,CAAC,IAAI,IAAI,EACtC,EAAE,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,OAAO,EAAE,EACnD,KAAK,CAAC,KAAK,CACZ,EACL,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CACnE,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
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;AAyB3B,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,GAAG,WAAW,CAa/E"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { blockHeadingTag, h, heading, } from '@cogenta/theme-kit';
|
|
2
|
+
/**
|
|
3
|
+
* "By the numbers" — an infographic sidebar with a real newspaper
|
|
4
|
+
* `column-rule` between figures, each set in the display serif with tabular
|
|
5
|
+
* numerals so a column of changing digits never shifts width.
|
|
6
|
+
*
|
|
7
|
+
* A description list, as in the reference theme: each figure *describes* its
|
|
8
|
+
* label, which is exactly what `<dt>`/`<dd>` mean, and it survives being read
|
|
9
|
+
* linearly by anything that ignores the stylesheet.
|
|
10
|
+
*/
|
|
11
|
+
function renderItem(item) {
|
|
12
|
+
return h('div', { class: 'cg-figures__item' }, h('dt', { class: 'cg-figures__label' }, item.label), h('dd', { class: 'cg-figures__value' }, item.value, item.unit === undefined ? null : h('span', { class: 'cg-figures__unit' }, item.unit)));
|
|
13
|
+
}
|
|
14
|
+
export function renderStats(block, _ctx) {
|
|
15
|
+
return h('section', { class: 'cg-block cg-figures', 'data-block': 'stats' }, block.title === undefined
|
|
16
|
+
? null
|
|
17
|
+
: heading(blockHeadingTag('stats') ?? 'h2', { class: 'cg-figures__title', 'data-field': 'title' }, block.title), h('dl', { class: 'cg-figures__items' }, block.items.map(renderItem)));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=stats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats.js","sourceRoot":"","sources":["../../../../src/render/blocks/stats.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EAEf,CAAC,EACD,OAAO,GAER,MAAM,oBAAoB,CAAA;AAE3B;;;;;;;;GAQG;AACH,SAAS,UAAU,CAAC,IAAc;IAChC,OAAO,CAAC,CACN,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,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CACrF,CACF,CAAA;AACH,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAiB,EAAE,IAAmB;IAChE,OAAO,CAAC,CACN,SAAS,EACT,EAAE,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,OAAO,EAAE,EACvD,KAAK,CAAC,KAAK,KAAK,SAAS;QACvB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,OAAO,CACL,eAAe,CAAC,OAAO,CAAC,IAAI,IAAI,EAChC,EAAE,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,OAAO,EAAE,EACrD,KAAK,CAAC,KAAK,CACZ,EACL,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CACrE,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { TestimonialBlock } from '@cogenta/blocks';
|
|
2
|
+
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
|
+
/**
|
|
4
|
+
* `blocks@2.0` (RFC 0001). A reader's letter, not a pull quote: `quote`
|
|
5
|
+
* already owns the theme's one "loud" typographic gesture (the giant quote
|
|
6
|
+
* mark and heavy rule in `cg-pullquote`), so a testimonial reads instead as
|
|
7
|
+
* a boxed letter-to-the-editor — a framed panel, the quote set in italic
|
|
8
|
+
* serif at body size rather than blown up, and a byline row underneath a
|
|
9
|
+
* hairline rule, the way a magazine runs its reader mail column.
|
|
10
|
+
*
|
|
11
|
+
* The quote is rich text (unlike `quote`'s plain-text `text`), so a
|
|
12
|
+
* testimonial can carry a link or emphasis; `renderRichText` handles it the
|
|
13
|
+
* same way `accordion`'s answers and `prose`'s body do.
|
|
14
|
+
*
|
|
15
|
+
* The avatar is decorative, exactly like `quote`'s own: the name sits right
|
|
16
|
+
* beside it in text, so its media entity's alt text is expected to be empty.
|
|
17
|
+
*/
|
|
18
|
+
export declare function renderTestimonial(block: TestimonialBlock, ctx: RenderContext): HtmlElement;
|
|
19
|
+
//# sourceMappingURL=testimonial.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testimonial.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/testimonial.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,KAAK,WAAW,EAAY,KAAK,aAAa,EAAkB,MAAM,oBAAoB,CAAA;AAEnG;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAyB1F"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { h, image, renderRichText } from '@cogenta/theme-kit';
|
|
2
|
+
/**
|
|
3
|
+
* `blocks@2.0` (RFC 0001). A reader's letter, not a pull quote: `quote`
|
|
4
|
+
* already owns the theme's one "loud" typographic gesture (the giant quote
|
|
5
|
+
* mark and heavy rule in `cg-pullquote`), so a testimonial reads instead as
|
|
6
|
+
* a boxed letter-to-the-editor — a framed panel, the quote set in italic
|
|
7
|
+
* serif at body size rather than blown up, and a byline row underneath a
|
|
8
|
+
* hairline rule, the way a magazine runs its reader mail column.
|
|
9
|
+
*
|
|
10
|
+
* The quote is rich text (unlike `quote`'s plain-text `text`), so a
|
|
11
|
+
* testimonial can carry a link or emphasis; `renderRichText` handles it the
|
|
12
|
+
* same way `accordion`'s answers and `prose`'s body do.
|
|
13
|
+
*
|
|
14
|
+
* The avatar is decorative, exactly like `quote`'s own: the name sits right
|
|
15
|
+
* beside it in text, so its media entity's alt text is expected to be empty.
|
|
16
|
+
*/
|
|
17
|
+
export function renderTestimonial(block, ctx) {
|
|
18
|
+
const { attribution } = block;
|
|
19
|
+
return h('figure', { class: 'cg-block cg-letter', 'data-block': 'testimonial' }, h('blockquote', { class: 'cg-letter__quote' }, renderRichText(ctx, block.quote)), h('figcaption', { class: 'cg-letter__byline' }, attribution.avatar === undefined
|
|
20
|
+
? null
|
|
21
|
+
: image(ctx, attribution.avatar, {
|
|
22
|
+
className: 'cg-letter__avatar',
|
|
23
|
+
variant: { width: 96, height: 96, fit: 'cover' },
|
|
24
|
+
}), h('span', { class: 'cg-letter__names' }, h('span', { class: 'cg-letter__name' }, attribution.name), attribution.role === undefined
|
|
25
|
+
? null
|
|
26
|
+
: h('span', { class: 'cg-letter__role' }, attribution.role))));
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=testimonial.js.map
|
|
@@ -0,0 +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;;;;;;;;;;;;;;GAcG;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,oBAAoB,EAAE,YAAY,EAAE,aAAa,EAAE,EAC5D,CAAC,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAAE,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAChF,CAAC,CACC,YAAY,EACZ,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAC9B,WAAW,CAAC,MAAM,KAAK,SAAS;QAC9B,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,WAAW,CAAC,MAAM,EAAE;YAC7B,SAAS,EAAE,mBAAmB;YAC9B,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,kBAAkB,EAAE,EAC7B,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAAE,WAAW,CAAC,IAAI,CAAC,EACzD,WAAW,CAAC,IAAI,KAAK,SAAS;QAC5B,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAAE,WAAW,CAAC,IAAI,CAAC,CAC9D,CACF,CACF,CAAA;AACH,CAAC"}
|
|
@@ -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;AA0E3B,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,YAAY,CA6E7D"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { escapeAttribute, escapeText, renderBrandMark, renderSocialLinks, renderThemeToggle, serialize, } from '@cogenta/theme-kit';
|
|
2
|
+
/**
|
|
3
|
+
* The masthead. A magazine's front matter is a nameplate — the title set in
|
|
4
|
+
* the display serif, centred, with a hairline rule above and below — and a
|
|
5
|
+
* quiet rubric bar underneath it, the way a print contents strip reads. That
|
|
6
|
+
* is a structurally different header from a left-aligned wordmark plus a
|
|
7
|
+
* right-aligned menu (`theme-canonical`'s own layout): the nameplate gets
|
|
8
|
+
* its own row so it can be set large without competing with the nav for
|
|
9
|
+
* width, and the nav becomes a second, quieter row.
|
|
10
|
+
*
|
|
11
|
+
* L25 pro pass (`theme@1.4`): the top strip now names today's date rather
|
|
12
|
+
* than a static tagline (`Intl.DateTimeFormat(ctx.locale, { dateStyle:
|
|
13
|
+
* 'full' })` on `new Date()` — legitimate here because every page renders
|
|
14
|
+
* per request, `cogenta serve` never caches a rendered page across a day
|
|
15
|
+
* boundary for an anonymous visitor beyond `security.pageMaxAge`, and this
|
|
16
|
+
* theme's own masthead has never claimed to be static-generated — `theme.
|
|
17
|
+
* config.ts` still declares `runtime: 'static'`, which describes what this
|
|
18
|
+
* theme *needs* to render a page, not a promise that today's date is frozen
|
|
19
|
+
* at build time); the rubric row now also carries `headerAction` as a filled
|
|
20
|
+
* "Subscribe"-style button; and a CSS-only `<details>` disclosure collapses
|
|
21
|
+
* the whole rubric row into a hamburger below the nameplate's own
|
|
22
|
+
* breakpoint, exactly the technique `theme-blog`'s masthead already proved
|
|
23
|
+
* against a real browser (a closed `<details>`'s non-summary content cannot
|
|
24
|
+
* be forced open by CSS alone, so the collapsed and expanded nav are two
|
|
25
|
+
* separate `<nav>`s, never one pushed into a state it was never opened
|
|
26
|
+
* into — see that theme's own `chrome.ts` for the verified detail).
|
|
27
|
+
*
|
|
28
|
+
* L26 D4 — the manual light/dark/system toggle (`renderThemeToggle`,
|
|
29
|
+
* `@cogenta/theme-kit`) sits in the top strip, next to today's date, not in
|
|
30
|
+
* the rubric row below: the top strip renders unconditionally on every
|
|
31
|
+
* page, while the rubric (`hasRubric`) only renders when there is a nav or
|
|
32
|
+
* a header action — a toggle placed there would vanish on a site with
|
|
33
|
+
* neither, which is exactly the "dark mode looks unsupported" bug this
|
|
34
|
+
* feature exists to fix.
|
|
35
|
+
*/
|
|
36
|
+
function renderNavItems(links, className) {
|
|
37
|
+
const items = links
|
|
38
|
+
.filter((link) => link.href !== null || link.kind === 'submenu-placeholder')
|
|
39
|
+
.map((link) => {
|
|
40
|
+
const label = escapeText(link.label);
|
|
41
|
+
const titleAttr = link.title === null ? '' : ` title="${escapeAttribute(link.title)}"`;
|
|
42
|
+
if (link.href === null)
|
|
43
|
+
return `<li><span${titleAttr}>${label}</span></li>`;
|
|
44
|
+
const href = escapeAttribute(link.href);
|
|
45
|
+
const target = link.openInNewTab ? ' target="_blank" rel="noopener"' : '';
|
|
46
|
+
return `<li><a href="${href}"${target}${titleAttr}>${label}</a></li>`;
|
|
47
|
+
})
|
|
48
|
+
.join('');
|
|
49
|
+
return items === '' ? '' : `<ul class="${className}">${items}</ul>`;
|
|
50
|
+
}
|
|
51
|
+
/** The rubric row's own call-to-action link (`theme@1.4`) — a filled button, the masthead's one place of solid colour. */
|
|
52
|
+
function renderHeaderAction(action) {
|
|
53
|
+
if (action === undefined)
|
|
54
|
+
return '';
|
|
55
|
+
return (`<a class="cg-action cg-masthead__action" data-emphasis="primary" ` +
|
|
56
|
+
`href="${escapeAttribute(action.href)}">${escapeText(action.label)}</a>`);
|
|
57
|
+
}
|
|
58
|
+
/** A hamburger mark drawn from three stacked bars — no icon font, no glyph a font might not ship. */
|
|
59
|
+
function menuGlyph() {
|
|
60
|
+
return '<span class="cg-masthead__bars" aria-hidden="true"></span>';
|
|
61
|
+
}
|
|
62
|
+
function todaysDate(locale) {
|
|
63
|
+
try {
|
|
64
|
+
return new Intl.DateTimeFormat(locale, { dateStyle: 'full' }).format(new Date());
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
return new Date().toISOString().slice(0, 10);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
export function renderChrome(input) {
|
|
71
|
+
const siteNameText = escapeText(input.site.name);
|
|
72
|
+
const navItems = renderNavItems(input.headerNav, 'cg-masthead__menu');
|
|
73
|
+
const headerAction = renderHeaderAction(input.headerAction);
|
|
74
|
+
const footerNav = renderNavItems(input.footerNav, 'cg-colophon__menu');
|
|
75
|
+
const homeHref = escapeAttribute(input.homeHref);
|
|
76
|
+
// A nameplate is the one place a masthead earns a logo: it replaces the
|
|
77
|
+
// wordmark on its own row. The colophon keeps the name in text, so the
|
|
78
|
+
// site is still named in a page whose images never load.
|
|
79
|
+
const nameplate = renderBrandMark(input.brand, { className: 'cg-masthead__logo' }) ?? siteNameText;
|
|
80
|
+
const themeToggle = serialize(renderThemeToggle(input.locale, { className: 'cg-theme-toggle' }));
|
|
81
|
+
const hasRubric = navItems !== '' || headerAction !== '';
|
|
82
|
+
// Two renderings of the same rubric row, never both visible at once (CSS,
|
|
83
|
+
// `min-width: 56rem`) — see the file-level comment for why this cannot be
|
|
84
|
+
// a single `<details open>` forced open at width.
|
|
85
|
+
const mobileRubric = !hasRubric
|
|
86
|
+
? ''
|
|
87
|
+
: `<details class="cg-masthead__disclosure">` +
|
|
88
|
+
`<summary class="cg-masthead__toggle" aria-label="Menu">${menuGlyph()}</summary>` +
|
|
89
|
+
`<nav class="cg-masthead__panel" aria-label="Primary">${navItems}${headerAction}</nav>` +
|
|
90
|
+
`</details>`;
|
|
91
|
+
const desktopRubric = !hasRubric
|
|
92
|
+
? ''
|
|
93
|
+
: `<nav class="cg-masthead__nav" aria-label="Primary"><div class="cg-masthead__nav-inner">${navItems}${headerAction}</div></nav>`;
|
|
94
|
+
const header = `<header class="cg-masthead">` +
|
|
95
|
+
`<div class="cg-masthead__top">` +
|
|
96
|
+
`<span class="cg-masthead__date">${escapeText(todaysDate(input.locale))}</span>` +
|
|
97
|
+
`${themeToggle}` +
|
|
98
|
+
`</div>` +
|
|
99
|
+
`<div class="cg-masthead__nameplate">` +
|
|
100
|
+
`<a class="cg-masthead__wordmark" href="${homeHref}">${nameplate}</a>` +
|
|
101
|
+
`${mobileRubric}` +
|
|
102
|
+
`</div>` +
|
|
103
|
+
`${desktopRubric}` +
|
|
104
|
+
`</header>`;
|
|
105
|
+
const tagline = input.tagline === undefined
|
|
106
|
+
? ''
|
|
107
|
+
: `<p class="cg-colophon__tagline" data-field="tagline">${escapeText(input.tagline)}</p>`;
|
|
108
|
+
const social = input.social === undefined
|
|
109
|
+
? ''
|
|
110
|
+
: serialize(renderSocialLinks(input.social, {
|
|
111
|
+
className: 'cg-colophon__social',
|
|
112
|
+
itemClassName: 'cg-colophon__social-item',
|
|
113
|
+
}) ?? { kind: 'text', value: '' });
|
|
114
|
+
const footerNote = input.footerNote === undefined
|
|
115
|
+
? ''
|
|
116
|
+
: `<p class="cg-colophon__note">${escapeText(input.footerNote)}</p>`;
|
|
117
|
+
const footer = `<footer class="cg-colophon"><div class="cg-colophon__grid">` +
|
|
118
|
+
`<div class="cg-colophon__about">` +
|
|
119
|
+
`<a class="cg-colophon__wordmark" href="${homeHref}">${siteNameText}</a>` +
|
|
120
|
+
`${tagline}</div>` +
|
|
121
|
+
`<div class="cg-colophon__sections">` +
|
|
122
|
+
`<p class="cg-colophon__heading">Sections</p>` +
|
|
123
|
+
`${footerNav === '' ? '' : `<nav aria-label="Footer">${footerNav}</nav>`}` +
|
|
124
|
+
`</div>` +
|
|
125
|
+
`<div class="cg-colophon__follow">` +
|
|
126
|
+
`<p class="cg-colophon__heading">Follow</p>` +
|
|
127
|
+
`${social}` +
|
|
128
|
+
`</div>` +
|
|
129
|
+
`<div class="cg-colophon__meta">` +
|
|
130
|
+
`${footerNote}` +
|
|
131
|
+
`<div class="cg-colophon__branding">${input.brandingHtml}</div>` +
|
|
132
|
+
`</div>` +
|
|
133
|
+
`</div></footer>`;
|
|
134
|
+
return { header, footer };
|
|
135
|
+
}
|
|
136
|
+
//# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,SAAS,cAAc,CAAC,KAA+B,EAAE,SAAiB;IACxE,MAAM,KAAK,GAAG,KAAK;SAChB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,qBAAqB,CAAC;SAC3E,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACZ,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACpC,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAA;QACtF,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI;YAAE,OAAO,YAAY,SA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lElement, type PageContent, type RenderContext } from '@cogenta/theme-kit';
|
|
3
|
+
export declare function renderBlock(block: VocabularyBlock, ctx: RenderContext, entries?: FetchedEntries, registry?: BlockRegistry): HtmlElement | null;
|
|
4
|
+
/**
|
|
5
|
+
* Wraps every block in `<main id="cg-main">` — the skip link's anchor — and
|
|
6
|
+
* marks each rendered block with its own `_key` (`withBlockKey`, mandatory:
|
|
7
|
+
* it is what lets the L16 page builder map a clicked element on the real
|
|
8
|
+
* rendered page back to the block that produced it). A page whose blocks
|
|
9
|
+
* already carry a heading (a `hero`) gets no second `<h1>`.
|
|
10
|
+
*
|
|
11
|
+
* A page carrying `entry` (contract D `theme@1.4`) gets `renderEntryHeader`'s
|
|
12
|
+
* furniture — classification eyebrow (styled in this masthead's own
|
|
13
|
+
* journal-red accent, see `styles/base.css`'s `.cg-entry-header__terms`),
|
|
14
|
+
* title, excerpt, date/author/reading-time meta and cover — instead of the
|
|
15
|
+
* bare `<h1>` every other page falls back to; `renderEntryHeader` itself
|
|
16
|
+
* returns `null` for a `blocks`-only page (e.g. `about`, which carries no
|
|
17
|
+
* `entry`) or one that already draws its own heading, so the bare-title
|
|
18
|
+
* fallback still applies there, exactly as before.
|
|
19
|
+
*/
|
|
20
|
+
export declare function renderPage(page: PageContent, ctx: RenderContext, entries?: FetchedEntries, registry?: BlockRegistry): HtmlElement;
|
|
21
|
+
//# sourceMappingURL=render-block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-block.d.ts","sourceRoot":"","sources":["../../../src/render/render-block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAoB,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAC5F,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,WAAW,EAEhB,KAAK,WAAW,EAEhB,KAAK,aAAa,EAKnB,MAAM,oBAAoB,CAAA;AAmB3B,wBAAgB,WAAW,CACzB,KAAK,EAAE,eAAe,EACtB,GAAG,EAAE,aAAa,EAClB,OAAO,GAAE,cAAmB,EAC5B,QAAQ,CAAC,EAAE,aAAa,GACvB,WAAW,GAAG,IAAI,CAapB;AAuDD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,aAAa,EAClB,OAAO,GAAE,cAAmB,EAC5B,QAAQ,CAAC,EAAE,aAAa,GACvB,WAAW,CAWb"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { VOCABULARY_NAMES } from '@cogenta/blocks';
|
|
2
|
+
import { h, pageHasOwnHeading, renderEntryHeader, resolveBlockForRender, withBlockKey, withBlockVariant, } from '@cogenta/theme-kit';
|
|
3
|
+
import { renderAccordion } from './blocks/accordion.js';
|
|
4
|
+
import { renderCollectionList } from './blocks/collection-list.js';
|
|
5
|
+
import { renderCta } from './blocks/cta.js';
|
|
6
|
+
import { renderEmbed } from './blocks/embed.js';
|
|
7
|
+
import { renderFaq } from './blocks/faq.js';
|
|
8
|
+
import { renderFeatureGrid } from './blocks/feature-grid.js';
|
|
9
|
+
import { renderGallery } from './blocks/gallery.js';
|
|
10
|
+
import { renderHero } from './blocks/hero.js';
|
|
11
|
+
import { renderLogoStrip } from './blocks/logo-strip.js';
|
|
12
|
+
import { renderLogos } from './blocks/logos.js';
|
|
13
|
+
import { renderMediaFigure } from './blocks/media-figure.js';
|
|
14
|
+
import { renderPricingTable } from './blocks/pricing-table.js';
|
|
15
|
+
import { renderProse } from './blocks/prose.js';
|
|
16
|
+
import { renderQuote } from './blocks/quote.js';
|
|
17
|
+
import { renderStatCounter } from './blocks/stat-counter.js';
|
|
18
|
+
import { renderStats } from './blocks/stats.js';
|
|
19
|
+
import { renderTestimonial } from './blocks/testimonial.js';
|
|
20
|
+
export function renderBlock(block, ctx, entries = {}, registry) {
|
|
21
|
+
// `block`'s type says `VocabularyBlock`, but the value crossing this
|
|
22
|
+
// boundary from stored content is not always literally one of the shared
|
|
23
|
+
// vocabulary — resolving here is what turns an unimplemented theme-private
|
|
24
|
+
// block into its declared fallback instead of a silently blank slot.
|
|
25
|
+
const resolved = resolveBlockForRender(block, VOCABULARY_NAMES, registry);
|
|
26
|
+
if (resolved === null)
|
|
27
|
+
return null;
|
|
28
|
+
const known = resolved;
|
|
29
|
+
// `withBlockVariant` (blocks@2.0, RFC 0002) is applied once here, after
|
|
30
|
+
// dispatch, rather than inside each of the seventeen block renderers —
|
|
31
|
+
// `variant` is envelope data every block carries identically, exactly the
|
|
32
|
+
// same reasoning `withBlockKey` in `renderPage` already follows for `_key`.
|
|
33
|
+
return withBlockVariant(renderKnownBlock(known, ctx, entries), known.variant);
|
|
34
|
+
}
|
|
35
|
+
function renderKnownBlock(known, ctx, entries) {
|
|
36
|
+
switch (known._type) {
|
|
37
|
+
case 'hero':
|
|
38
|
+
return renderHero(known, ctx);
|
|
39
|
+
case 'prose':
|
|
40
|
+
return renderProse(known, ctx);
|
|
41
|
+
case 'mediaFigure':
|
|
42
|
+
return renderMediaFigure(known, ctx);
|
|
43
|
+
case 'featureGrid':
|
|
44
|
+
return renderFeatureGrid(known, ctx);
|
|
45
|
+
case 'cta':
|
|
46
|
+
return renderCta(known, ctx);
|
|
47
|
+
case 'gallery':
|
|
48
|
+
return renderGallery(known, ctx);
|
|
49
|
+
case 'quote':
|
|
50
|
+
return renderQuote(known, ctx);
|
|
51
|
+
case 'faq':
|
|
52
|
+
return renderFaq(known, ctx);
|
|
53
|
+
case 'stats':
|
|
54
|
+
return renderStats(known, ctx);
|
|
55
|
+
case 'logos':
|
|
56
|
+
return renderLogos(known, ctx);
|
|
57
|
+
case 'collectionList':
|
|
58
|
+
return renderCollectionList(known, ctx, entries[known._key] ?? []);
|
|
59
|
+
case 'embed':
|
|
60
|
+
return renderEmbed(known, ctx);
|
|
61
|
+
case 'testimonial':
|
|
62
|
+
return renderTestimonial(known, ctx);
|
|
63
|
+
case 'pricingTable':
|
|
64
|
+
return renderPricingTable(known, ctx);
|
|
65
|
+
case 'accordion':
|
|
66
|
+
return renderAccordion(known, ctx);
|
|
67
|
+
case 'statCounter':
|
|
68
|
+
return renderStatCounter(known, ctx);
|
|
69
|
+
case 'logoStrip':
|
|
70
|
+
return renderLogoStrip(known, ctx);
|
|
71
|
+
default: {
|
|
72
|
+
// Exhaustive over contract B's vocabulary: `known` is `never` here, so
|
|
73
|
+
// a block this package does not implement stops it compiling until it
|
|
74
|
+
// is. `null`, not a throw — a theme has no `@cogenta/core` error types
|
|
75
|
+
// to reach for (contract D refuses that import), and a fallback block
|
|
76
|
+
// is the render layer's decision, not the theme's.
|
|
77
|
+
const unreachable = known;
|
|
78
|
+
void unreachable;
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Wraps every block in `<main id="cg-main">` — the skip link's anchor — and
|
|
85
|
+
* marks each rendered block with its own `_key` (`withBlockKey`, mandatory:
|
|
86
|
+
* it is what lets the L16 page builder map a clicked element on the real
|
|
87
|
+
* rendered page back to the block that produced it). A page whose blocks
|
|
88
|
+
* already carry a heading (a `hero`) gets no second `<h1>`.
|
|
89
|
+
*
|
|
90
|
+
* A page carrying `entry` (contract D `theme@1.4`) gets `renderEntryHeader`'s
|
|
91
|
+
* furniture — classification eyebrow (styled in this masthead's own
|
|
92
|
+
* journal-red accent, see `styles/base.css`'s `.cg-entry-header__terms`),
|
|
93
|
+
* title, excerpt, date/author/reading-time meta and cover — instead of the
|
|
94
|
+
* bare `<h1>` every other page falls back to; `renderEntryHeader` itself
|
|
95
|
+
* returns `null` for a `blocks`-only page (e.g. `about`, which carries no
|
|
96
|
+
* `entry`) or one that already draws its own heading, so the bare-title
|
|
97
|
+
* fallback still applies there, exactly as before.
|
|
98
|
+
*/
|
|
99
|
+
export function renderPage(page, ctx, entries = {}, registry) {
|
|
100
|
+
const ownHeading = pageHasOwnHeading(page.blocks);
|
|
101
|
+
const entryHeader = ownHeading ? null : renderEntryHeader(page, ctx);
|
|
102
|
+
return h('main', { class: 'cg-main', id: 'cg-main' }, ownHeading ? null : (entryHeader ?? h('h1', { class: 'cg-page__title' }, page.title)), page.blocks.map((block) => withBlockKey(renderBlock(block, ctx, entries, registry), block._key)));
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=render-block.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-block.js","sourceRoot":"","sources":["../../../src/render/render-block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,gBAAgB,EAAwB,MAAM,iBAAiB,CAAA;AAC5F,OAAO,EAGL,CAAC,EAED,iBAAiB,EAEjB,iBAAiB,EACjB,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,GACjB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,iBAAiB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AAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IACpE,OAAO,CAAC,CACN,MAAM,EACN,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,EACnC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EACrF,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACxB,YAAY,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,CACrE,CACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type HtmlElement, type TermArchiveInput } from '@cogenta/theme-kit';
|
|
2
|
+
/**
|
|
3
|
+
* The taxonomy-term archive (contract D `theme@1.3`), as a section front.
|
|
4
|
+
*
|
|
5
|
+
* A magazine's archive is a section page, so it is built from the same
|
|
6
|
+
* `cg-issue__row` rows `collectionList` already sets here — a contents strip,
|
|
7
|
+
* not a card grid — under a section head that names the taxonomy as a kicker
|
|
8
|
+
* and the term as the section title. Reusing the block's classes is what
|
|
9
|
+
* keeps the two looking like the same publication without a second
|
|
10
|
+
* stylesheet.
|
|
11
|
+
*/
|
|
12
|
+
export declare function renderTermArchive(input: TermArchiveInput): HtmlElement;
|
|
13
|
+
//# sourceMappingURL=term-archive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"term-archive.d.ts","sourceRoot":"","sources":["../../../src/render/term-archive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAK,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAE/E;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,WAAW,CA4DtE"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { h } from '@cogenta/theme-kit';
|
|
2
|
+
/**
|
|
3
|
+
* The taxonomy-term archive (contract D `theme@1.3`), as a section front.
|
|
4
|
+
*
|
|
5
|
+
* A magazine's archive is a section page, so it is built from the same
|
|
6
|
+
* `cg-issue__row` rows `collectionList` already sets here — a contents strip,
|
|
7
|
+
* not a card grid — under a section head that names the taxonomy as a kicker
|
|
8
|
+
* and the term as the section title. Reusing the block's classes is what
|
|
9
|
+
* keeps the two looking like the same publication without a second
|
|
10
|
+
* stylesheet.
|
|
11
|
+
*/
|
|
12
|
+
export function renderTermArchive(input) {
|
|
13
|
+
const rows = input.entries.map((entry, index) => h('li', { class: 'cg-issue__row' }, h('span', { class: 'cg-issue__row-number', 'aria-hidden': 'true' }, String(index + 1).padStart(2, '0')), h('div', { class: 'cg-issue__row-body' }, h('h2', { class: 'cg-issue__row-title' }, entry.href === null
|
|
14
|
+
? entry.title
|
|
15
|
+
: h('a', { class: 'cg-issue__link', href: entry.href }, entry.title)), entry.publishedAt === null
|
|
16
|
+
? null
|
|
17
|
+
: h('time', { class: 'cg-issue__row-date', datetime: entry.publishedAt }, entry.publishedAt.slice(0, 10)), entry.summary === null ? null : h('p', { class: 'cg-issue__lead-excerpt' }, entry.summary))));
|
|
18
|
+
return h('main', { class: 'cg-main cg-archive', id: 'cg-main' }, input.ancestors.length === 0
|
|
19
|
+
? null
|
|
20
|
+
: h('nav', { class: 'cg-archive__breadcrumb', 'aria-label': input.labels.breadcrumb }, h('ol', {}, ...input.ancestors.map((l) => h('li', {}, h('a', { href: l.href }, l.label))))), h('p', { class: 'cg-issue__kicker' }, input.taxonomyName), h('h1', { class: 'cg-page__title' }, input.term.label), input.children.length === 0
|
|
21
|
+
? null
|
|
22
|
+
: h('ul', { class: 'cg-archive__children', 'aria-label': input.labels.subterms }, ...input.children.map((c) => h('li', {}, h('a', { href: c.href }, c.label)))), rows.length === 0
|
|
23
|
+
? h('p', { class: 'cg-issue__empty' }, input.labels.empty)
|
|
24
|
+
: h('ul', { class: 'cg-issue__rest' }, ...rows), pager(input));
|
|
25
|
+
}
|
|
26
|
+
function pager(input) {
|
|
27
|
+
if (input.page.previousHref === null && input.page.nextHref === null)
|
|
28
|
+
return null;
|
|
29
|
+
return h('nav', { class: 'cg-archive__pager', 'aria-label': input.labels.pagination }, input.page.previousHref === null
|
|
30
|
+
? null
|
|
31
|
+
: h('a', { rel: 'prev', href: input.page.previousHref }, input.labels.previous), input.page.nextHref === null
|
|
32
|
+
? null
|
|
33
|
+
: h('a', { rel: 'next', href: input.page.nextHref }, input.labels.next));
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=term-archive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"term-archive.js","sourceRoot":"","sources":["../../../src/render/term-archive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,CAAC,EAAyB,MAAM,oBAAoB,CAAA;AAE/E;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAuB;IACvD,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAC9C,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,eAAe,EAAE,EAC1B,CAAC,CACC,MAAM,EACN,EAAE,KAAK,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,EAAE,EACxD,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CACnC,EACD,CAAC,CACC,KAAK,EACL,EAAE,KAAK,EAAE,oBAAoB,EAAE,EAC/B,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,qBAAqB,EAAE,EAChC,KAAK,CAAC,IAAI,KAAK,IAAI;QACjB,CAAC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AE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,EACjF,KAAK,CAAC,IAAI,CAAC,QAAQ,KAAK,IAAI;QAC1B,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAC1E,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contract D — Thème, `theme@1.0`/`1.1`.
|
|
3
|
+
*
|
|
4
|
+
* `implements` lists the seventeen blocks of contract B (`blocks@2.0`, RFC
|
|
5
|
+
* 0001) in the order the contract lists them. `runtime: 'static'` describes
|
|
6
|
+
* what this theme itself needs to render a page — `collectionList` stays
|
|
7
|
+
* `runtime: 'server'` in the vocabulary regardless, and it is that block, not
|
|
8
|
+
* this manifest, that forces a server for the pages that use it.
|
|
9
|
+
*/
|
|
10
|
+
declare const _default: import("@cogenta/theme-kit").ThemeManifest;
|
|
11
|
+
export default _default;
|
|
12
|
+
//# sourceMappingURL=theme.config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.config.d.ts","sourceRoot":"","sources":["../theme.config.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { defineTheme } from '@cogenta/theme-kit';
|
|
2
|
+
/**
|
|
3
|
+
* Contract D — Thème, `theme@1.0`/`1.1`.
|
|
4
|
+
*
|
|
5
|
+
* `implements` lists the seventeen blocks of contract B (`blocks@2.0`, RFC
|
|
6
|
+
* 0001) in the order the contract lists them. `runtime: 'static'` describes
|
|
7
|
+
* what this theme itself needs to render a page — `collectionList` stays
|
|
8
|
+
* `runtime: 'server'` in the vocabulary regardless, and it is that block, not
|
|
9
|
+
* this manifest, that forces a server for the pages that use it.
|
|
10
|
+
*/
|
|
11
|
+
export default defineTheme({
|
|
12
|
+
name: 'magazine',
|
|
13
|
+
version: '1.2.0',
|
|
14
|
+
description: 'An editorial magazine theme: print-inspired typography, a front-page "Top stories" grid with rubric rails, a masthead-styled article header, and zero client JavaScript.',
|
|
15
|
+
author: 'Cogenta',
|
|
16
|
+
engine: '^1.0.0',
|
|
17
|
+
blocks: '^2.0.0',
|
|
18
|
+
implements: [
|
|
19
|
+
'hero',
|
|
20
|
+
'prose',
|
|
21
|
+
'mediaFigure',
|
|
22
|
+
'featureGrid',
|
|
23
|
+
'cta',
|
|
24
|
+
'gallery',
|
|
25
|
+
'quote',
|
|
26
|
+
'faq',
|
|
27
|
+
'stats',
|
|
28
|
+
'logos',
|
|
29
|
+
'collectionList',
|
|
30
|
+
'embed',
|
|
31
|
+
'testimonial',
|
|
32
|
+
'pricingTable',
|
|
33
|
+
'accordion',
|
|
34
|
+
'statCounter',
|
|
35
|
+
'logoStrip',
|
|
36
|
+
],
|
|
37
|
+
collections: ['article', 'page'],
|
|
38
|
+
runtime: 'static',
|
|
39
|
+
tokens: './tokens.json',
|
|
40
|
+
a11y: { verified: 'WCAG-2.2-AA' },
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=theme.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.config.js","sourceRoot":"","sources":["../theme.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEhD;;;;;;;;GAQG;AACH,eAAe,WAAW,CAAC;IACzB,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,OAAO;IAChB,WAAW,EACT,0KAA0K;IAC5K,MAAM,EAAE,SAAS;IACjB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE;QACV,MAAM;QACN,OAAO;QACP,aAAa;QACb,aAAa;QACb,KAAK;QACL,SAAS;QACT,OAAO;QACP,KAAK;QACL,OAAO;QACP,OAAO;QACP,gBAAgB;QAChB,OAAO;QACP,aAAa;QACb,cAAc;QACd,WAAW;QACX,aAAa;QACb,WAAW;KACZ;IACD,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC;IAChC,OAAO,EAAE,QAAQ;IACjB,MAAM,EAAE,eAAe;IACvB,IAAI,EAAE,EAAE,QAAQ,EAAE,aAAa,EAAE;CAClC,CAAC,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cogenta/theme-magazine",
|
|
3
|
+
"version": "1.1.2",
|
|
4
|
+
"description": "An editorial magazine theme for Cogenta: print-inspired typography, a lead-story listing grid, zero client JavaScript.",
|
|
5
|
+
"license": "MPL-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/src/index.d.ts",
|
|
11
|
+
"default": "./dist/src/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./theme.config": {
|
|
14
|
+
"types": "./dist/theme.config.d.ts",
|
|
15
|
+
"default": "./dist/theme.config.js"
|
|
16
|
+
},
|
|
17
|
+
"./tokens.json": "./tokens.json",
|
|
18
|
+
"./styles/theme.css": "./src/styles/theme.css",
|
|
19
|
+
"./styles/*.css": "./src/styles/*.css"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"src",
|
|
24
|
+
"tokens.json"
|
|
25
|
+
],
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=22.11.0"
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public",
|
|
31
|
+
"provenance": true
|
|
32
|
+
},
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/cogenta-cms/cogenta.git",
|
|
36
|
+
"directory": "packages/theme-magazine"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@cogenta/blocks": "1.0.3",
|
|
40
|
+
"@cogenta/render": "0.2.3",
|
|
41
|
+
"@cogenta/theme-kit": "0.3.2"
|
|
42
|
+
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"astro": "^7.2.1"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"astro": "^7.2.1",
|
|
48
|
+
"typescript": "^7.0.2",
|
|
49
|
+
"vitest": "^4.1.10"
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"build": "tsc -p tsconfig.json",
|
|
53
|
+
"typecheck": "tsc -p tsconfig.typecheck.json",
|
|
54
|
+
"test": "vitest run --passWithNoTests",
|
|
55
|
+
"test:integration": "vitest run --config vitest.integration.config.ts --passWithNoTests"
|
|
56
|
+
}
|
|
57
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from './render/blocks/accordion.js'
|
|
2
|
+
export * from './render/blocks/collection-list.js'
|
|
3
|
+
export * from './render/blocks/cta.js'
|
|
4
|
+
export * from './render/blocks/embed.js'
|
|
5
|
+
export * from './render/blocks/faq.js'
|
|
6
|
+
export * from './render/blocks/feature-grid.js'
|
|
7
|
+
export * from './render/blocks/gallery.js'
|
|
8
|
+
export * from './render/blocks/hero.js'
|
|
9
|
+
export * from './render/blocks/logo-strip.js'
|
|
10
|
+
export * from './render/blocks/logos.js'
|
|
11
|
+
export * from './render/blocks/media-figure.js'
|
|
12
|
+
export * from './render/blocks/pricing-table.js'
|
|
13
|
+
export * from './render/blocks/prose.js'
|
|
14
|
+
export * from './render/blocks/quote.js'
|
|
15
|
+
export * from './render/blocks/stat-counter.js'
|
|
16
|
+
export * from './render/blocks/stats.js'
|
|
17
|
+
export * from './render/blocks/testimonial.js'
|
|
18
|
+
export * from './render/chrome.js'
|
|
19
|
+
export * from './render/render-block.js'
|
|
20
|
+
export * from './render/term-archive.js'
|