@cogenta/theme-magazine 1.1.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/render/article.d.ts +32 -0
- package/dist/src/render/article.d.ts.map +1 -0
- package/dist/src/render/article.js +137 -0
- package/dist/src/render/article.js.map +1 -0
- package/dist/src/render/blocks/accordion.d.ts.map +1 -1
- package/dist/src/render/blocks/accordion.js +9 -13
- package/dist/src/render/blocks/accordion.js.map +1 -1
- package/dist/src/render/blocks/collection-list.d.ts.map +1 -1
- package/dist/src/render/blocks/collection-list.js +91 -118
- package/dist/src/render/blocks/collection-list.js.map +1 -1
- package/dist/src/render/blocks/cta.d.ts +4 -4
- package/dist/src/render/blocks/cta.d.ts.map +1 -1
- package/dist/src/render/blocks/cta.js +7 -9
- package/dist/src/render/blocks/cta.js.map +1 -1
- package/dist/src/render/blocks/embed.d.ts.map +1 -1
- package/dist/src/render/blocks/embed.js +17 -20
- package/dist/src/render/blocks/embed.js.map +1 -1
- package/dist/src/render/blocks/faq.d.ts.map +1 -1
- package/dist/src/render/blocks/faq.js +12 -11
- package/dist/src/render/blocks/faq.js.map +1 -1
- package/dist/src/render/blocks/feature-grid.d.ts.map +1 -1
- package/dist/src/render/blocks/feature-grid.js +13 -20
- package/dist/src/render/blocks/feature-grid.js.map +1 -1
- package/dist/src/render/blocks/gallery.d.ts +6 -6
- package/dist/src/render/blocks/gallery.d.ts.map +1 -1
- package/dist/src/render/blocks/gallery.js +15 -13
- package/dist/src/render/blocks/gallery.js.map +1 -1
- package/dist/src/render/blocks/hero.d.ts +6 -5
- package/dist/src/render/blocks/hero.d.ts.map +1 -1
- package/dist/src/render/blocks/hero.js +15 -14
- package/dist/src/render/blocks/hero.js.map +1 -1
- package/dist/src/render/blocks/logo-strip.d.ts.map +1 -1
- package/dist/src/render/blocks/logo-strip.js +8 -11
- package/dist/src/render/blocks/logo-strip.js.map +1 -1
- package/dist/src/render/blocks/logos.d.ts.map +1 -1
- package/dist/src/render/blocks/logos.js +16 -16
- package/dist/src/render/blocks/logos.js.map +1 -1
- package/dist/src/render/blocks/media-figure.d.ts +8 -8
- package/dist/src/render/blocks/media-figure.d.ts.map +1 -1
- package/dist/src/render/blocks/media-figure.js +23 -19
- package/dist/src/render/blocks/media-figure.js.map +1 -1
- package/dist/src/render/blocks/pricing-table.d.ts.map +1 -1
- package/dist/src/render/blocks/pricing-table.js +19 -22
- package/dist/src/render/blocks/pricing-table.js.map +1 -1
- package/dist/src/render/blocks/prose.d.ts +6 -10
- package/dist/src/render/blocks/prose.d.ts.map +1 -1
- package/dist/src/render/blocks/prose.js +8 -11
- package/dist/src/render/blocks/prose.js.map +1 -1
- package/dist/src/render/blocks/quote.d.ts +6 -9
- package/dist/src/render/blocks/quote.d.ts.map +1 -1
- package/dist/src/render/blocks/quote.js +11 -13
- package/dist/src/render/blocks/quote.js.map +1 -1
- package/dist/src/render/blocks/stat-counter.d.ts.map +1 -1
- package/dist/src/render/blocks/stat-counter.js +9 -10
- package/dist/src/render/blocks/stat-counter.js.map +1 -1
- package/dist/src/render/blocks/stats.d.ts.map +1 -1
- package/dist/src/render/blocks/stats.js +9 -12
- package/dist/src/render/blocks/stats.js.map +1 -1
- package/dist/src/render/blocks/testimonial.d.ts +4 -13
- package/dist/src/render/blocks/testimonial.d.ts.map +1 -1
- package/dist/src/render/blocks/testimonial.js +7 -15
- package/dist/src/render/blocks/testimonial.js.map +1 -1
- package/dist/src/render/chrome.d.ts.map +1 -1
- package/dist/src/render/chrome.js +109 -97
- package/dist/src/render/chrome.js.map +1 -1
- package/dist/src/render/layout.d.ts +28 -0
- package/dist/src/render/layout.d.ts.map +1 -0
- package/dist/src/render/layout.js +72 -0
- package/dist/src/render/layout.js.map +1 -0
- package/dist/src/render/render-block.d.ts +15 -13
- package/dist/src/render/render-block.d.ts.map +1 -1
- package/dist/src/render/render-block.js +53 -29
- package/dist/src/render/render-block.js.map +1 -1
- package/dist/src/render/story.d.ts +41 -0
- package/dist/src/render/story.d.ts.map +1 -0
- package/dist/src/render/story.js +65 -0
- package/dist/src/render/story.js.map +1 -0
- package/dist/src/render/term-archive.d.ts +0 -10
- package/dist/src/render/term-archive.d.ts.map +1 -1
- package/dist/src/render/term-archive.js +42 -19
- package/dist/src/render/term-archive.js.map +1 -1
- package/dist/src/render/widget-areas.d.ts +12 -0
- package/dist/src/render/widget-areas.d.ts.map +1 -0
- package/dist/src/render/widget-areas.js +19 -0
- package/dist/src/render/widget-areas.js.map +1 -0
- package/dist/theme.config.js +2 -2
- package/dist/theme.config.js.map +1 -1
- package/package.json +5 -5
- package/src/index.ts +3 -0
- package/src/render/article.ts +239 -0
- package/src/render/blocks/accordion.ts +23 -30
- package/src/render/blocks/collection-list.ts +161 -225
- package/src/render/blocks/cta.ts +19 -13
- package/src/render/blocks/embed.ts +40 -36
- package/src/render/blocks/faq.ts +31 -36
- package/src/render/blocks/feature-grid.ts +26 -36
- package/src/render/blocks/gallery.ts +24 -18
- package/src/render/blocks/hero.ts +32 -32
- package/src/render/blocks/logo-strip.ts +17 -17
- package/src/render/blocks/logos.ts +23 -31
- package/src/render/blocks/media-figure.ts +36 -20
- package/src/render/blocks/pricing-table.ts +29 -34
- package/src/render/blocks/prose.ts +13 -13
- package/src/render/blocks/quote.ts +24 -24
- package/src/render/blocks/stat-counter.ts +16 -24
- package/src/render/blocks/stats.ts +14 -24
- package/src/render/blocks/testimonial.ts +12 -17
- package/src/render/chrome.ts +123 -104
- package/src/render/layout.ts +105 -0
- package/src/render/render-block.ts +61 -33
- package/src/render/story.ts +139 -0
- package/src/render/term-archive.ts +111 -58
- package/src/render/widget-areas.ts +22 -0
- package/src/styles/archive.css +114 -17
- package/src/styles/article.css +237 -0
- package/src/styles/base.css +848 -591
- package/src/styles/blocks.css +903 -921
- package/src/styles/stories.css +593 -0
- package/src/styles/theme.css +28 -9
- package/src/styles/tokens.css +200 -185
- package/src/styles/widgets.css +614 -0
- package/tokens.json +18 -18
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { actionList, blockHeadingTag, h, heading, } from '@cogenta/theme-kit';
|
|
2
|
+
import { section } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
* a
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* An appeal, set like the subscription panel a newspaper runs between two
|
|
5
|
+
* sections: a double rule above, the title large in the display face across
|
|
6
|
+
* the left seven columns, the text and the actions in the right five. No
|
|
7
|
+
* coloured box: the rules and the type carry it.
|
|
7
8
|
*/
|
|
8
9
|
export function renderCta(block, ctx) {
|
|
9
|
-
return
|
|
10
|
+
return section('section', 'cta', 'cg-appeal', {}, 'div', heading(blockHeadingTag('cta') ?? 'h2', { class: 'cg-appeal__title', 'data-field': 'title' }, block.title), h('div', { class: 'cg-appeal__body' }, block.text === undefined
|
|
10
11
|
? null
|
|
11
|
-
: h('p', { class: 'cg-
|
|
12
|
-
// `actions` is required and non-empty for a `cta`, so this always renders;
|
|
13
|
-
// the null branch stays reachable only through invalid stored data.
|
|
14
|
-
actionList(ctx, block.actions, block.title));
|
|
12
|
+
: h('p', { class: 'cg-appeal__text', 'data-field': 'text' }, block.text), actionList(ctx, block.actions, block.title)));
|
|
15
13
|
}
|
|
16
14
|
//# sourceMappingURL=cta.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cta.js","sourceRoot":"","sources":["../../../../src/render/blocks/cta.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,eAAe,EAEf,CAAC,EACD,OAAO,GAER,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"cta.js","sourceRoot":"","sources":["../../../../src/render/blocks/cta.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,eAAe,EAEf,CAAC,EACD,OAAO,GAER,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,KAAe,EAAE,GAAkB;IAC3D,OAAO,OAAO,CACZ,SAAS,EACT,KAAK,EACL,WAAW,EACX,EAAE,EACF,KAAK,EACL,OAAO,CACL,eAAe,CAAC,KAAK,CAAC,IAAI,IAAI,EAC9B,EAAE,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,OAAO,EAAE,EACpD,KAAK,CAAC,KAAK,CACZ,EACD,CAAC,CACC,KAAK,EACL,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAC5B,KAAK,CAAC,IAAI,KAAK,SAAS;QACtB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,EAC1E,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAC5C,CACF,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embed.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/embed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAe,KAAK,WAAW,EAAK,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"embed.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/embed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAe,KAAK,WAAW,EAAK,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAgEzF,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAqC9E"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { aspectRatio, h } from '@cogenta/theme-kit';
|
|
2
|
+
import { section } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
* Nothing here contacts a third party before the visitor
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
4
|
+
* Nothing here contacts a third party before the visitor consents: when
|
|
5
|
+
* `consentRequired` is set, or the provider has no cookie-free frame source,
|
|
6
|
+
* a notice and an outbound link render instead of an `<iframe>`. No
|
|
7
|
+
* preconnect, no thumbnail fetched from the provider.
|
|
8
|
+
*
|
|
9
|
+
* The frame and the notice both take the reading column at the block's
|
|
10
|
+
* ratio. The notice holds the place the player will take: a hairline frame,
|
|
11
|
+
* the provider named in small capitals, one sentence, one arrow link.
|
|
10
12
|
*/
|
|
11
13
|
function frameSource(provider, rawUrl) {
|
|
12
14
|
const url = URL.parse(rawUrl);
|
|
@@ -37,15 +39,12 @@ function frameSource(provider, rawUrl) {
|
|
|
37
39
|
case 'soundcloud':
|
|
38
40
|
return `https://w.soundcloud.com/player/?url=${encodeURIComponent(rawUrl)}`;
|
|
39
41
|
default:
|
|
40
|
-
// bluesky, mastodon, other: a post embed is a script tag this theme
|
|
41
|
-
// does not load. The sidebar note card is the rendering.
|
|
42
42
|
return null;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
class: 'cg-sidenote__link',
|
|
45
|
+
function notice(block, ctx, reason) {
|
|
46
|
+
return h('div', { class: 'cg-embed__notice' }, h('p', { class: 'cg-embed__label' }, ctx.t('embed.label')), h('p', { class: 'cg-embed__reason' }, reason), h('a', {
|
|
47
|
+
class: 'cg-arrow-link cg-embed__link',
|
|
49
48
|
href: ctx.link(block.url),
|
|
50
49
|
rel: 'noopener noreferrer nofollow',
|
|
51
50
|
}, ctx.t('embed.open', { provider: block.provider })));
|
|
@@ -53,24 +52,22 @@ function noteCard(block, ctx, reason) {
|
|
|
53
52
|
export function renderEmbed(block, ctx) {
|
|
54
53
|
const source = block.consentRequired ? null : frameSource(block.provider, block.url);
|
|
55
54
|
const ratio = aspectRatio(block.ratio) ?? '16 / 9';
|
|
56
|
-
return
|
|
57
|
-
class: 'cg-block cg-sidenote',
|
|
58
|
-
'data-block': 'embed',
|
|
55
|
+
return section('div', 'embed', 'cg-embed', {
|
|
59
56
|
'data-provider': block.provider,
|
|
60
57
|
'data-consent': block.consentRequired ? 'required' : 'not-required',
|
|
61
58
|
style: `--cg-ratio:${ratio}`,
|
|
62
|
-
}, source === null
|
|
63
|
-
?
|
|
59
|
+
}, 'div', h('div', { class: 'cg-embed__frame' }, source === null
|
|
60
|
+
? notice(block, ctx, block.consentRequired
|
|
64
61
|
? ctx.t('embed.consentRequired', { provider: block.provider })
|
|
65
62
|
: ctx.t('embed.unsupported', { provider: block.provider }))
|
|
66
63
|
: h('iframe', {
|
|
67
|
-
class: 'cg-
|
|
64
|
+
class: 'cg-embed__player',
|
|
68
65
|
src: source,
|
|
69
66
|
title: ctx.t('embed.title', { provider: block.provider }),
|
|
70
67
|
loading: 'lazy',
|
|
71
68
|
referrerpolicy: 'strict-origin-when-cross-origin',
|
|
72
69
|
allow: 'accelerometer; clipboard-write; encrypted-media; picture-in-picture; fullscreen',
|
|
73
70
|
allowfullscreen: true,
|
|
74
|
-
}));
|
|
71
|
+
})));
|
|
75
72
|
}
|
|
76
73
|
//# sourceMappingURL=embed.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embed.js","sourceRoot":"","sources":["../../../../src/render/blocks/embed.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAoB,CAAC,EAAsB,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"embed.js","sourceRoot":"","sources":["../../../../src/render/blocks/embed.ts"],"names":[],"mappings":"AACA,OAAO,E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faq.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/faq.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAW,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAEL,KAAK,WAAW,EAGhB,KAAK,aAAa,EAEnB,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"faq.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/faq.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAW,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAEL,KAAK,WAAW,EAGhB,KAAK,aAAa,EAEnB,MAAM,oBAAoB,CAAA;AAmB3B,wBAAgB,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAyB1E"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { blockHeadingTag, h, heading, renderRichText, } from '@cogenta/theme-kit';
|
|
2
|
+
import { section } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* are this theme's own.
|
|
4
|
+
* Questions and their answers, set open, the way a newspaper prints a
|
|
5
|
+
* reader's guide: the title in the left three columns, and down the right
|
|
6
|
+
* the questions in the display face with each answer under it, divided by
|
|
7
|
+
* hairlines. Nothing is hidden behind a disclosure: a short guide is read
|
|
8
|
+
* whole. (`accordion` is the collapsible form of the same content.)
|
|
9
9
|
*/
|
|
10
|
-
function renderItem(item, ctx,
|
|
11
|
-
return h('
|
|
10
|
+
function renderItem(item, ctx, tag) {
|
|
11
|
+
return h('div', { class: 'cg-guide__item' }, heading(tag, { class: 'cg-guide__question' }, item.question), h('div', { class: 'cg-guide__answer' }, renderRichText(ctx, item.answer)));
|
|
12
12
|
}
|
|
13
13
|
export function renderFaq(block, ctx) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
: heading(blockHeadingTag('faq') ?? 'h2', { class: 'cg-
|
|
14
|
+
const titled = block.title !== undefined;
|
|
15
|
+
return section('section', 'faq', 'cg-guide', { 'data-titled': titled ? 'true' : 'false' }, 'div', titled
|
|
16
|
+
? h('div', { class: 'cg-guide__head' }, heading(blockHeadingTag('faq') ?? 'h2', { class: 'cg-guide__title', 'data-field': 'title' }, block.title ?? ''))
|
|
17
|
+
: null, h('div', { class: 'cg-guide__items' }, block.items.map((item) => renderItem(item, ctx, titled ? 'h3' : 'h2'))));
|
|
17
18
|
}
|
|
18
19
|
//# sourceMappingURL=faq.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"faq.js","sourceRoot":"","sources":["../../../../src/render/blocks/faq.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EAEf,CAAC,EACD,OAAO,EAEP,cAAc,GACf,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"faq.js","sourceRoot":"","sources":["../../../../src/render/blocks/faq.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EAEf,CAAC,EACD,OAAO,EAEP,cAAc,GACf,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC;;;;;;GAMG;AACH,SAAS,UAAU,CAAC,IAAa,EAAE,GAAkB,EAAE,GAAgB;IACrE,OAAO,CAAC,CACN,KAAK,EACL,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAC3B,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,EAC5D,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAAE,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAC1E,CAAA;AACH,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,KAAe,EAAE,GAAkB;IAC3D,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,KAAK,SAAS,CAAA;IACxC,OAAO,OAAO,CACZ,SAAS,EACT,KAAK,EACL,UAAU,EACV,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,EAC5C,KAAK,EACL,MAAM;QACJ,CAAC,CAAC,CAAC,CACC,KAAK,EACL,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAC3B,OAAO,CACL,eAAe,CAAC,KAAK,CAAC,IAAI,IAAI,EAC9B,EAAE,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,OAAO,EAAE,EACnD,KAAK,CAAC,KAAK,IAAI,EAAE,CAClB,CACF;QACH,CAAC,CAAC,IAAI,EACR,CAAC,CACC,KAAK,EACL,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAC5B,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CACvE,CACF,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,EAEL,KAAK,WAAW,EAKhB,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAA;AA0B3B,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAe1F"}
|
|
@@ -1,27 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h, heading, href, nestedHeadingTag, } from '@cogenta/theme-kit';
|
|
2
|
+
import { section, sectionHead } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
* A
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* The item's own title carries the link, exactly as in the reference theme:
|
|
11
|
-
* a bare "read more" repeated across a grid fails WCAG 2.4.4, and the block
|
|
12
|
-
* has no separate label field to fix that with.
|
|
4
|
+
* A set of short items, set as a contents panel: up to four columns divided
|
|
5
|
+
* by vertical hairlines, each item a title in the display face and a line of
|
|
6
|
+
* text. An item with a link makes its title the link, with an arrow set
|
|
7
|
+
* inline after the last word so the underline runs under the words and never
|
|
8
|
+
* under a lone arrow. No icon tiles: `icon` names are ignored on purpose, a
|
|
9
|
+
* newspaper sets a contents panel in type.
|
|
13
10
|
*/
|
|
14
11
|
function renderItem(item, ctx, tag) {
|
|
15
|
-
|
|
16
|
-
?
|
|
17
|
-
:
|
|
18
|
-
return h('li', { class: 'cg-index__item', 'data-icon': item.icon }, title, item.text === undefined ? null : h('p', { class: 'cg-index__text' }, item.text));
|
|
12
|
+
return h('li', { class: 'cg-contents__item' }, heading(tag, { class: 'cg-contents__title' }, item.link === undefined
|
|
13
|
+
? item.title
|
|
14
|
+
: h('a', { class: 'cg-arrow-link', href: href(ctx, item.link) }, item.title)), item.text === undefined ? null : h('p', { class: 'cg-contents__text' }, item.text));
|
|
19
15
|
}
|
|
20
16
|
export function renderFeatureGrid(block, ctx) {
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
return h('section', { class: 'cg-block cg-index', 'data-block': 'featureGrid' }, hasTitle
|
|
24
|
-
? heading(blockHeadingTag('featureGrid') ?? 'h2', { class: 'cg-index__heading', 'data-field': 'title' }, block.title ?? '')
|
|
25
|
-
: null, h('ol', { class: 'cg-index__items' }, block.items.map((item) => renderItem(item, ctx, itemTag))));
|
|
17
|
+
const tag = nestedHeadingTag('featureGrid', block.title !== undefined);
|
|
18
|
+
return section('section', 'featureGrid', 'cg-contents', { 'data-count': String(Math.min(block.items.length, 4)) }, 'div', sectionHead('featureGrid', block.title), h('ul', { class: 'cg-contents__items' }, block.items.map((item) => renderItem(item, ctx, tag))));
|
|
26
19
|
}
|
|
27
20
|
//# sourceMappingURL=feature-grid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-grid.js","sourceRoot":"","sources":["../../../../src/render/blocks/feature-grid.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"feature-grid.js","sourceRoot":"","sources":["../../../../src/render/blocks/feature-grid.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,CAAC,EACD,OAAO,EACP,IAAI,EACJ,gBAAgB,GAEjB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAEnD;;;;;;;GAOG;AACH,SAAS,UAAU,CAAC,IAAiB,EAAE,GAAkB,EAAE,GAAe;IACxE,OAAO,CAAC,CACN,IAAI,EACJ,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAC9B,OAAO,CACL,GAAG,EACH,EAAE,KAAK,EAAE,oBAAoB,EAAE,EAC/B,IAAI,CAAC,IAAI,KAAK,SAAS;QACrB,CAAC,CAAC,IAAI,CAAC,KAAK;QACZ,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAC/E,EACD,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CACnF,CAAA;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAuB,EAAE,GAAkB;IAC3E,MAAM,GAAG,GAAG,gBAAgB,CAAC,aAAa,EAAE,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAA;IACtE,OAAO,OAAO,CACZ,SAAS,EACT,aAAa,EACb,aAAa,EACb,EAAE,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EACzD,KAAK,EACL,WAAW,CAAC,aAAa,EAAE,KAAK,CAAC,KAAK,CAAC,EACvC,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,oBAAoB,EAAE,EAC/B,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CACtD,CACF,CAAA;AACH,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { GalleryBlock } from '@cogenta/blocks';
|
|
2
2
|
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
3
|
/**
|
|
4
|
-
* A
|
|
5
|
-
* space of the print corner) in a tight grid with hairline gutters, rather
|
|
6
|
-
* than the reference theme's rounded, shadowed tiles.
|
|
4
|
+
* A picture page, square-cornered, with a constant gutter:
|
|
7
5
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
6
|
+
* - `grid`: the first photograph across eight columns, the next two stacked
|
|
7
|
+
* beside it, then rows of three at 3:2, the rhythm of a picture spread.
|
|
8
|
+
* - `masonry`: three columns at each picture's own ratio.
|
|
9
|
+
* - `carousel`: one row that scrolls and snaps, focusable and labelled; touch,
|
|
10
|
+
* trackpad and arrow keys are all native. No script.
|
|
11
11
|
*/
|
|
12
12
|
export declare function renderGallery(block: GalleryBlock, ctx: RenderContext): HtmlElement;
|
|
13
13
|
//# sourceMappingURL=gallery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gallery.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/gallery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"gallery.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/gallery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAGnF;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAsClF"}
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import { h, image } from '@cogenta/theme-kit';
|
|
2
|
+
import { section } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
* A
|
|
4
|
-
* space of the print corner) in a tight grid with hairline gutters, rather
|
|
5
|
-
* than the reference theme's rounded, shadowed tiles.
|
|
4
|
+
* A picture page, square-cornered, with a constant gutter:
|
|
6
5
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* - `grid`: the first photograph across eight columns, the next two stacked
|
|
7
|
+
* beside it, then rows of three at 3:2, the rhythm of a picture spread.
|
|
8
|
+
* - `masonry`: three columns at each picture's own ratio.
|
|
9
|
+
* - `carousel`: one row that scrolls and snaps, focusable and labelled; touch,
|
|
10
|
+
* trackpad and arrow keys are all native. No script.
|
|
10
11
|
*/
|
|
11
12
|
export function renderGallery(block, ctx) {
|
|
12
|
-
const items = h('ul', { class: 'cg-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
13
|
+
const items = h('ul', { class: 'cg-pictures__items', 'data-count': String(block.items.length) }, block.items.map((item, index) => h('li', { class: 'cg-pictures__item' }, image(ctx, item.media, {
|
|
14
|
+
className: 'cg-pictures__image',
|
|
15
|
+
sizes: block.layout === 'grid' && index === 0
|
|
16
|
+
? '(min-width: 64rem) 52rem, 100vw'
|
|
17
|
+
: '(min-width: 64rem) 26rem, (min-width: 40rem) 45vw, 90vw',
|
|
18
|
+
}))));
|
|
19
|
+
return section('div', 'gallery', 'cg-pictures', { 'data-layout': block.layout }, 'div', block.layout === 'carousel'
|
|
18
20
|
? h('div', {
|
|
19
|
-
class: 'cg-
|
|
21
|
+
class: 'cg-pictures__viewport',
|
|
20
22
|
role: 'region',
|
|
21
23
|
'aria-label': ctx.t('gallery.carousel'),
|
|
22
24
|
tabindex: '0',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gallery.js","sourceRoot":"","sources":["../../../../src/render/blocks/gallery.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAE,KAAK,EAAsB,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"gallery.js","sourceRoot":"","sources":["../../../../src/render/blocks/gallery.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAE,KAAK,EAAsB,MAAM,oBAAoB,CAAA;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAAC,KAAmB,EAAE,GAAkB;IACnE,MAAM,KAAK,GAAG,CAAC,CACb,IAAI,EACJ,EAAE,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EACzE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAC9B,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAC9B,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE;QACrB,SAAS,EAAE,oBAAoB;QAC/B,KAAK,EACH,KAAK,CAAC,MAAM,KAAK,MAAM,IAAI,KAAK,KAAK,CAAC;YACpC,CAAC,CAAC,iCAAiC;YACnC,CAAC,CAAC,yDAAyD;KAChE,CAAC,CACH,CACF,CACF,CAAA;IAED,OAAO,OAAO,CACZ,KAAK,EACL,SAAS,EACT,aAAa,EACb,EAAE,aAAa,EAAE,KAAK,CAAC,MAAM,EAAE,EAC/B,KAAK,EACL,KAAK,CAAC,MAAM,KAAK,UAAU;QACzB,CAAC,CAAC,CAAC,CACC,KAAK,EACL;YACE,KAAK,EAAE,uBAAuB;YAC9B,IAAI,EAAE,QAAQ;YACd,YAAY,EAAE,GAAG,CAAC,CAAC,CAAC,kBAAkB,CAAC;YACvC,QAAQ,EAAE,GAAG;SACd,EACD,KAAK,CACN;QACH,CAAC,CAAC,KAAK,CACV,CAAA;AACH,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { HeroBlock } from '@cogenta/blocks';
|
|
2
2
|
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* A cover story. `hero` carries the page's own `h1` (contract B), so it is
|
|
5
|
+
* set as the opening of a special issue: the eyebrow as a red kicker, the
|
|
6
|
+
* headline in the display face at its largest, the subtitle as an italic
|
|
7
|
+
* standfirst, and the photograph beside the words across seven columns,
|
|
8
|
+
* its bottom edge on the same line as the last action. Without a photograph
|
|
9
|
+
* the headline takes ten columns over a double rule.
|
|
9
10
|
*/
|
|
10
11
|
export declare function renderHero(block: HeroBlock, ctx: RenderContext): HtmlElement;
|
|
11
12
|
//# sourceMappingURL=hero.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hero.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/hero.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAGL,KAAK,WAAW,EAIhB,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"hero.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/hero.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAGL,KAAK,WAAW,EAIhB,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAA;AAG3B;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAiC5E"}
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import { actionList, blockHeadingTag, h, heading, image, } from '@cogenta/theme-kit';
|
|
2
|
+
import { section } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* A cover story. `hero` carries the page's own `h1` (contract B), so it is
|
|
5
|
+
* set as the opening of a special issue: the eyebrow as a red kicker, the
|
|
6
|
+
* headline in the display face at its largest, the subtitle as an italic
|
|
7
|
+
* standfirst, and the photograph beside the words across seven columns,
|
|
8
|
+
* its bottom edge on the same line as the last action. Without a photograph
|
|
9
|
+
* the headline takes ten columns over a double rule.
|
|
8
10
|
*/
|
|
9
11
|
export function renderHero(block, ctx) {
|
|
10
12
|
const tag = blockHeadingTag('hero') ?? 'h1';
|
|
11
|
-
return
|
|
13
|
+
return section('section', 'hero', 'cg-cover', { 'data-media': block.media === undefined ? 'none' : 'image' }, 'div', h('div', { class: 'cg-cover__copy' }, block.eyebrow === undefined
|
|
12
14
|
? null
|
|
13
|
-
: h('p', { class: 'cg-
|
|
15
|
+
: h('p', { class: 'cg-cover__kicker', 'data-field': 'eyebrow' }, block.eyebrow), heading(tag, { class: 'cg-cover__title', 'data-field': 'title' }, block.title), block.subtitle === undefined
|
|
14
16
|
? null
|
|
15
|
-
: h('p', { class: 'cg-
|
|
17
|
+
: h('p', { class: 'cg-cover__standfirst', 'data-field': 'subtitle' }, block.subtitle), actionList(ctx, block.actions, ctx.t('hero.actions'))), block.media === undefined
|
|
16
18
|
? null
|
|
17
|
-
: h('div', { class: 'cg-
|
|
18
|
-
// The
|
|
19
|
-
// lazy-loading it is a measured LCP regression, not a theory.
|
|
19
|
+
: h('div', { class: 'cg-cover__media' },
|
|
20
|
+
// The one image above the fold, so the one loaded eagerly.
|
|
20
21
|
image(ctx, block.media, {
|
|
21
|
-
className: 'cg-
|
|
22
|
+
className: 'cg-cover__image',
|
|
22
23
|
loading: 'eager',
|
|
23
|
-
sizes: '(min-width: 64rem)
|
|
24
|
-
})))
|
|
24
|
+
sizes: '(min-width: 64rem) 46rem, 100vw',
|
|
25
|
+
})));
|
|
25
26
|
}
|
|
26
27
|
//# sourceMappingURL=hero.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hero.js","sourceRoot":"","sources":["../../../../src/render/blocks/hero.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,eAAe,EAEf,CAAC,EACD,OAAO,EACP,KAAK,GAEN,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"hero.js","sourceRoot":"","sources":["../../../../src/render/blocks/hero.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,eAAe,EAEf,CAAC,EACD,OAAO,EACP,KAAK,GAEN,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,KAAgB,EAAE,GAAkB;IAC7D,MA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|
|
1
|
-
{"version":3,"file":"logo-strip.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/logo-strip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,iBAAiB,CAAA;AACpE,OAAO,EAAE,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"logo-strip.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/logo-strip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,iBAAiB,CAAA;AACpE,OAAO,EAAE,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAiBnF,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAgBtF"}
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
import { h, image } from '@cogenta/theme-kit';
|
|
2
|
+
import { section } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* caption set underneath, the way a colophon credits its supporters along
|
|
8
|
-
* the bottom of a masthead page. Each image's own alt text (set once, in
|
|
9
|
-
* the media library) is what names it, exactly as `logos` already falls
|
|
10
|
-
* back to when a link is absent.
|
|
4
|
+
* A line of credits: the caption in small capitals on the left three
|
|
5
|
+
* columns, the marks in one tone along the rest of the row, between two
|
|
6
|
+
* hairlines. `logoStrip` has no per-mark name or link, so each image's own
|
|
7
|
+
* alt text (set once, in the media library) is what names it.
|
|
11
8
|
*/
|
|
12
9
|
function renderItem(item, ctx) {
|
|
13
|
-
return h('li', { class: 'cg-
|
|
10
|
+
return h('li', { class: 'cg-credits__item' }, image(ctx, item.media, { className: 'cg-credits__image', variant: { fit: 'contain' } }));
|
|
14
11
|
}
|
|
15
12
|
export function renderLogoStrip(block, ctx) {
|
|
16
|
-
return
|
|
13
|
+
return section('div', 'logoStrip', 'cg-credits', {}, 'div', block.caption === undefined
|
|
17
14
|
? null
|
|
18
|
-
: h('
|
|
15
|
+
: h('p', { class: 'cg-credits__caption', 'data-field': 'caption' }, block.caption), h('ul', { class: 'cg-credits__items' }, block.logos.map((item) => renderItem(item, ctx))));
|
|
19
16
|
}
|
|
20
17
|
//# sourceMappingURL=logo-strip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logo-strip.js","sourceRoot":"","sources":["../../../../src/render/blocks/logo-strip.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAE,KAAK,EAAsB,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"logo-strip.js","sourceRoot":"","sources":["../../../../src/render/blocks/logo-strip.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAE,KAAK,EAAsB,MAAM,oBAAoB,CAAA;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC;;;;;GAKG;AACH,SAAS,UAAU,CAAC,IAAmB,EAAE,GAAkB;IACzD,OAAO,CAAC,CACN,IAAI,EACJ,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAC7B,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,mBAAmB,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,CACxF,CAAA;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAqB,EAAE,GAAkB;IACvE,OAAO,OAAO,CACZ,KAAK,EACL,WAAW,EACX,YAAY,EACZ,EAAE,EACF,KAAK,EACL,KAAK,CAAC,OAAO,KAAK,SAAS;QACzB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,EACpF,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,CAAC,CAAC,CACjD,CACF,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logos.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/logos.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,
|
|
1
|
+
{"version":3,"file":"logos.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/logos.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,EAAE,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAiCnF,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAc9E"}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h, image } from '@cogenta/theme-kit';
|
|
2
|
+
import { section, sectionHead } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Organisations credited by name, set as a ruled grid of marks in ink: up to
|
|
5
|
+
* six to a row on a wide screen (`data-count`, never fewer than three columns,
|
|
6
|
+
* so two marks do not stretch across the page), a hairline between each, the
|
|
7
|
+
* marks reduced to
|
|
8
|
+
* one tone so no brand colour competes with the page's single red.
|
|
6
9
|
*
|
|
7
|
-
* The organisation's name is contract B's own accessible name
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* image with `alt` text is already named.
|
|
10
|
+
* The organisation's name is contract B's own accessible name: the image
|
|
11
|
+
* carries it as `alt` when the media entity has none, so a linked mark is
|
|
12
|
+
* named without a hidden duplicate.
|
|
11
13
|
*/
|
|
12
14
|
function renderItem(item, ctx) {
|
|
13
|
-
const
|
|
14
|
-
className: 'cg-
|
|
15
|
+
const mark = image(ctx, item.media, {
|
|
16
|
+
className: 'cg-marks__image',
|
|
15
17
|
altFrom: item.name,
|
|
16
18
|
variant: { fit: 'contain' },
|
|
17
19
|
});
|
|
18
|
-
return h('li', { class: 'cg-
|
|
19
|
-
?
|
|
20
|
-
: h('a', { class: 'cg-
|
|
20
|
+
return h('li', { class: 'cg-marks__item' }, item.url === undefined
|
|
21
|
+
? mark
|
|
22
|
+
: h('a', { class: 'cg-marks__link', href: ctx.link(item.url), rel: 'noopener noreferrer' }, mark));
|
|
21
23
|
}
|
|
22
24
|
export function renderLogos(block, ctx) {
|
|
23
|
-
return
|
|
24
|
-
? null
|
|
25
|
-
: heading(blockHeadingTag('logos') ?? 'h2', { class: 'cg-press__title', 'data-field': 'title' }, block.title), h('ul', { class: 'cg-press__items' }, block.items.map((item) => renderItem(item, ctx))));
|
|
25
|
+
return section('section', 'logos', 'cg-marks', { 'data-count': String(Math.min(Math.max(block.items.length, 3), 6)) }, 'div', sectionHead('logos', block.title), h('ul', { class: 'cg-marks__items' }, block.items.map((item) => renderItem(item, ctx))));
|
|
26
26
|
}
|
|
27
27
|
//# sourceMappingURL=logos.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logos.js","sourceRoot":"","sources":["../../../../src/render/blocks/logos.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"logos.js","sourceRoot":"","sources":["../../../../src/render/blocks/logos.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAE,KAAK,EAAsB,MAAM,oBAAoB,CAAA;AACnF,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAEnD;;;;;;;;;;GAUG;AACH,SAAS,UAAU,CAAC,IAAc,EAAE,GAAkB;IAC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|
|
6
|
-
* the
|
|
7
|
-
*
|
|
4
|
+
* A photograph placed on the grid by its alignment, captioned the way a
|
|
5
|
+
* newspaper captions one: the caption in the interface face under the
|
|
6
|
+
* picture and the credit after it in small capitals, both starting on the
|
|
7
|
+
* picture's own left edge.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
9
|
+
* - `center` (the default): the reading column.
|
|
10
|
+
* - `start` / `end`: half the page, from the left or to the right.
|
|
11
|
+
* - `wide`: ten columns, the width an article's lead photograph takes.
|
|
12
|
+
* - `full`: edge to edge, the caption returning to the grid.
|
|
13
13
|
*/
|
|
14
14
|
export declare function renderMediaFigure(block: MediaFigureBlock, ctx: RenderContext): HtmlElement;
|
|
15
15
|
//# sourceMappingURL=media-figure.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-figure.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/media-figure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAe,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"media-figure.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/media-figure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAe,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAGhG;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CA2C1F"}
|