@cogenta/theme-association 0.3.3 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/index.d.ts +6 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +9 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/render/blocks/accordion.d.ts.map +1 -1
- package/dist/src/render/blocks/accordion.js +13 -10
- package/dist/src/render/blocks/accordion.js.map +1 -1
- package/dist/src/render/blocks/breakdown.d.ts +14 -0
- package/dist/src/render/blocks/breakdown.d.ts.map +1 -0
- package/dist/src/render/blocks/breakdown.js +17 -0
- package/dist/src/render/blocks/breakdown.js.map +1 -0
- package/dist/src/render/blocks/collection-list.d.ts +4 -10
- package/dist/src/render/blocks/collection-list.d.ts.map +1 -1
- package/dist/src/render/blocks/collection-list.js +89 -58
- package/dist/src/render/blocks/collection-list.js.map +1 -1
- package/dist/src/render/blocks/cta.d.ts +0 -5
- package/dist/src/render/blocks/cta.d.ts.map +1 -1
- package/dist/src/render/blocks/cta.js +22 -10
- 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 +30 -22
- 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 +11 -15
- package/dist/src/render/blocks/faq.js.map +1 -1
- package/dist/src/render/blocks/feature-grid.d.ts +6 -0
- package/dist/src/render/blocks/feature-grid.d.ts.map +1 -1
- package/dist/src/render/blocks/feature-grid.js +42 -20
- package/dist/src/render/blocks/feature-grid.js.map +1 -1
- package/dist/src/render/blocks/gallery.d.ts +9 -7
- package/dist/src/render/blocks/gallery.d.ts.map +1 -1
- package/dist/src/render/blocks/gallery.js +22 -16
- package/dist/src/render/blocks/gallery.js.map +1 -1
- package/dist/src/render/blocks/hero.d.ts +23 -9
- package/dist/src/render/blocks/hero.d.ts.map +1 -1
- package/dist/src/render/blocks/hero.js +40 -23
- package/dist/src/render/blocks/hero.js.map +1 -1
- package/dist/src/render/blocks/logo-strip.d.ts +6 -0
- package/dist/src/render/blocks/logo-strip.d.ts.map +1 -1
- package/dist/src/render/blocks/logo-strip.js +7 -9
- package/dist/src/render/blocks/logo-strip.js.map +1 -1
- package/dist/src/render/blocks/logos.d.ts +14 -0
- package/dist/src/render/blocks/logos.d.ts.map +1 -1
- package/dist/src/render/blocks/logos.js +30 -16
- package/dist/src/render/blocks/logos.js.map +1 -1
- package/dist/src/render/blocks/media-figure.d.ts +12 -5
- package/dist/src/render/blocks/media-figure.d.ts.map +1 -1
- package/dist/src/render/blocks/media-figure.js +32 -18
- 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 +18 -20
- package/dist/src/render/blocks/pricing-table.js.map +1 -1
- package/dist/src/render/blocks/prose.d.ts +9 -3
- package/dist/src/render/blocks/prose.d.ts.map +1 -1
- package/dist/src/render/blocks/prose.js +11 -4
- package/dist/src/render/blocks/prose.js.map +1 -1
- package/dist/src/render/blocks/quote.d.ts +4 -7
- package/dist/src/render/blocks/quote.d.ts.map +1 -1
- package/dist/src/render/blocks/quote.js +12 -17
- package/dist/src/render/blocks/quote.js.map +1 -1
- package/dist/src/render/blocks/stat-counter.d.ts +8 -1
- package/dist/src/render/blocks/stat-counter.d.ts.map +1 -1
- package/dist/src/render/blocks/stat-counter.js +18 -10
- package/dist/src/render/blocks/stat-counter.js.map +1 -1
- package/dist/src/render/blocks/stats.d.ts +12 -1
- package/dist/src/render/blocks/stats.d.ts.map +1 -1
- package/dist/src/render/blocks/stats.js +24 -14
- package/dist/src/render/blocks/stats.js.map +1 -1
- package/dist/src/render/blocks/testimonial.d.ts +6 -5
- package/dist/src/render/blocks/testimonial.d.ts.map +1 -1
- package/dist/src/render/blocks/testimonial.js +13 -11
- package/dist/src/render/blocks/testimonial.js.map +1 -1
- package/dist/src/render/chrome.d.ts +38 -1
- package/dist/src/render/chrome.d.ts.map +1 -1
- package/dist/src/render/chrome.js +117 -91
- package/dist/src/render/chrome.js.map +1 -1
- package/dist/src/render/details.d.ts +79 -0
- package/dist/src/render/details.d.ts.map +1 -0
- package/dist/src/render/details.js +221 -0
- package/dist/src/render/details.js.map +1 -0
- package/dist/src/render/figures.d.ts +29 -0
- package/dist/src/render/figures.d.ts.map +1 -0
- package/dist/src/render/figures.js +59 -0
- package/dist/src/render/figures.js.map +1 -0
- package/dist/src/render/layout.d.ts +31 -0
- package/dist/src/render/layout.d.ts.map +1 -0
- package/dist/src/render/layout.js +46 -0
- package/dist/src/render/layout.js.map +1 -0
- package/dist/src/render/page-head.d.ts +7 -0
- package/dist/src/render/page-head.d.ts.map +1 -0
- package/dist/src/render/page-head.js +95 -0
- package/dist/src/render/page-head.js.map +1 -0
- package/dist/src/render/render-block.d.ts +8 -12
- package/dist/src/render/render-block.d.ts.map +1 -1
- package/dist/src/render/render-block.js +40 -29
- package/dist/src/render/render-block.js.map +1 -1
- package/dist/src/render/strings.d.ts +15 -0
- package/dist/src/render/strings.d.ts.map +1 -0
- package/dist/src/render/strings.js +39 -0
- package/dist/src/render/strings.js.map +1 -0
- package/dist/src/render/term-archive.d.ts.map +1 -1
- package/dist/src/render/term-archive.js +33 -25
- package/dist/src/render/term-archive.js.map +1 -1
- package/dist/src/render/widget-areas.d.ts +14 -0
- package/dist/src/render/widget-areas.d.ts.map +1 -0
- package/dist/src/render/widget-areas.js +21 -0
- package/dist/src/render/widget-areas.js.map +1 -0
- package/dist/theme.config.d.ts +1 -1
- package/dist/theme.config.js +3 -3
- package/dist/theme.config.js.map +1 -1
- package/package.json +5 -5
- package/src/index.ts +9 -0
- package/src/render/blocks/accordion.ts +28 -22
- package/src/render/blocks/breakdown.ts +42 -0
- package/src/render/blocks/collection-list.ts +234 -103
- package/src/render/blocks/cta.ts +48 -19
- package/src/render/blocks/embed.ts +47 -29
- package/src/render/blocks/faq.ts +22 -31
- package/src/render/blocks/feature-grid.ts +73 -41
- package/src/render/blocks/gallery.ts +32 -26
- package/src/render/blocks/hero.ts +56 -43
- package/src/render/blocks/logo-strip.ts +23 -21
- package/src/render/blocks/logos.ts +45 -40
- package/src/render/blocks/media-figure.ts +49 -24
- package/src/render/blocks/pricing-table.ts +31 -40
- package/src/render/blocks/prose.ts +16 -6
- package/src/render/blocks/quote.ts +34 -27
- package/src/render/blocks/stat-counter.ts +35 -29
- package/src/render/blocks/stats.ts +46 -38
- package/src/render/blocks/testimonial.ts +29 -20
- package/src/render/chrome.ts +165 -91
- package/src/render/details.ts +276 -0
- package/src/render/figures.ts +68 -0
- package/src/render/layout.ts +78 -0
- package/src/render/page-head.ts +193 -0
- package/src/render/render-block.ts +45 -32
- package/src/render/strings.ts +74 -0
- package/src/render/term-archive.ts +94 -58
- package/src/render/widget-areas.ts +24 -0
- package/src/styles/archive.css +38 -102
- package/src/styles/base.css +503 -554
- package/src/styles/blocks.css +913 -666
- package/src/styles/chrome.css +506 -0
- package/src/styles/listings.css +591 -0
- package/src/styles/theme.css +25 -19
- package/src/styles/tokens.css +284 -234
- package/src/styles/widgets.css +1059 -0
- package/tokens.json +18 -18
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h, heading, nestedHeadingTag, renderRichText, } from '@cogenta/theme-kit';
|
|
2
|
+
import { section, sectionHead } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* The question is plain text inside `<summary>`, not a heading: a heading
|
|
9
|
-
* nested in a summary is rendered inconsistently across screen readers, and
|
|
10
|
-
* the questions are already reachable as a list under the block's own
|
|
11
|
-
* heading.
|
|
4
|
+
* The questions people ask before they give an hour or a pound, answered in
|
|
5
|
+
* the open: every answer is printed under its question, two columns of them
|
|
6
|
+
* on a wide screen, each pair under a hairline. A charity's answers are short
|
|
7
|
+
* and they are the point; hiding them behind a click makes a visitor work for
|
|
8
|
+
* reassurance. (The `accordion` block is the collapsible one.)
|
|
12
9
|
*/
|
|
13
|
-
function
|
|
14
|
-
return h('
|
|
10
|
+
function pair(item, ctx, titled) {
|
|
11
|
+
return h('div', { class: 'ca-faq__item' }, heading(nestedHeadingTag('faq', titled), { class: 'ca-faq__question' }, item.question), h('div', { class: 'ca-faq__answer' }, renderRichText(ctx, item.answer)));
|
|
15
12
|
}
|
|
16
13
|
export function renderFaq(block, ctx) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
: heading(blockHeadingTag('faq') ?? 'h2', { class: 'cg-faq__title', 'data-field': 'title' }, block.title), h('ul', { class: 'cg-faq__items' }, block.items.map((item) => renderItem(item, ctx))));
|
|
14
|
+
const titled = block.title !== undefined;
|
|
15
|
+
return section('section', 'faq', 'ca-faq', { 'data-titled': String(titled) }, 'div', sectionHead('faq', block.title), h('div', { class: 'ca-faq__items' }, block.items.map((item) => pair(item, ctx, titled))));
|
|
20
16
|
}
|
|
21
17
|
//# sourceMappingURL=faq.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"faq.js","sourceRoot":"","sources":["../../../../src/render/blocks/faq.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"faq.js","sourceRoot":"","sources":["../../../../src/render/blocks/faq.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,CAAC,EACD,OAAO,EACP,gBAAgB,EAEhB,cAAc,GACf,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAEnD;;;;;;GAMG;AACH,SAAS,IAAI,CAAC,IAAa,EAAE,GAAkB,EAAE,MAAe;IAC9D,OAAO,CAAC,CACN,KAAK,EACL,EAAE,KAAK,EAAE,cAAc,EAAE,EACzB,OAAO,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,EACtF,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CACxE,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,QAAQ,EACR,EAAE,aAAa,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EACjC,KAAK,EACL,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,EAC/B,CAAC,CACC,KAAK,EACL,EAAE,KAAK,EAAE,eAAe,EAAE,EAC1B,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC,CACnD,CACF,CAAA;AACH,CAAC"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { FeatureGridBlock } from '@cogenta/blocks';
|
|
2
2
|
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
|
+
/**
|
|
4
|
+
* How many columns a wide screen gets: as many as there are items up to
|
|
5
|
+
* four, then three when the count divides by three, so six items make two
|
|
6
|
+
* full rows of three rather than a row of four and a row of two.
|
|
7
|
+
*/
|
|
8
|
+
export declare function columnsFor(count: number): number;
|
|
3
9
|
export declare function renderFeatureGrid(block: FeatureGridBlock, ctx: RenderContext): HtmlElement;
|
|
4
10
|
//# sourceMappingURL=feature-grid.d.ts.map
|
|
@@ -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,EACL,KAAK,WAAW,EAKhB,KAAK,aAAa,EAEnB,MAAM,oBAAoB,CAAA;AAoB3B;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGhD;AA8BD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CA+B1F"}
|
|
@@ -1,27 +1,49 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h, heading, href, nestedHeadingTag, renderIcon, } from '@cogenta/theme-kit';
|
|
2
|
+
import { arrowWords, section, sectionHead } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* link, so the link's accessible name is the programme's own name (WCAG
|
|
6
|
-
* 2.4.4) — the block has no separate "learn more" field to write.
|
|
4
|
+
* Two readings of the same block, chosen by its content rather than by a
|
|
5
|
+
* setting:
|
|
7
6
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* - **Ways in**, when an item names an icon this theme can draw: ruled
|
|
8
|
+
* columns, each with a small line icon in the organisation's green, the
|
|
9
|
+
* name, its sentence, and the name as an arrow link when it leads somewhere.
|
|
10
|
+
* Never a tinted tile behind an icon, never a card.
|
|
11
|
+
* - **Steps**, when no item names an icon: an ordered list, each step under a
|
|
12
|
+
* rule with its number set large in the display face, because a list of
|
|
13
|
+
* things without pictures on a charity's site is almost always "how it
|
|
14
|
+
* works": how to sign up, what happens after you give, the first evening.
|
|
11
15
|
*/
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
function hasIcons(block) {
|
|
17
|
+
return block.items.some((item) => item.icon !== undefined);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* How many columns a wide screen gets: as many as there are items up to
|
|
21
|
+
* four, then three when the count divides by three, so six items make two
|
|
22
|
+
* full rows of three rather than a row of four and a row of two.
|
|
23
|
+
*/
|
|
24
|
+
export function columnsFor(count) {
|
|
25
|
+
if (count <= 4)
|
|
26
|
+
return count;
|
|
27
|
+
return count % 3 === 0 ? 3 : 4;
|
|
28
|
+
}
|
|
29
|
+
function name(item, ctx) {
|
|
30
|
+
return item.link === undefined
|
|
31
|
+
? item.title
|
|
32
|
+
: h('a', { class: 'ca-arrow-link', href: href(ctx, item.link) }, arrowWords(item.title));
|
|
33
|
+
}
|
|
34
|
+
function column(item, ctx, titled) {
|
|
35
|
+
const icon = item.icon === undefined ? null : renderIcon(item.icon, { className: 'ca-ways__icon', size: 28 });
|
|
36
|
+
return h('li', { class: 'ca-ways__item' }, icon, heading(nestedHeadingTag('featureGrid', titled), { class: 'ca-ways__name' }, name(item, ctx)), item.text === undefined ? null : h('p', { class: 'ca-ways__text' }, item.text));
|
|
37
|
+
}
|
|
38
|
+
function step(item, ctx, titled, index) {
|
|
39
|
+
return h('li', { class: 'ca-steps__item' }, h('span', { class: 'ca-steps__number', 'aria-hidden': 'true' }, String(index + 1)), heading(nestedHeadingTag('featureGrid', titled), { class: 'ca-steps__name' }, name(item, ctx)), item.text === undefined ? null : h('p', { class: 'ca-steps__text' }, item.text));
|
|
19
40
|
}
|
|
20
41
|
export function renderFeatureGrid(block, ctx) {
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
42
|
+
const titled = block.title !== undefined;
|
|
43
|
+
const count = String(columnsFor(block.items.length));
|
|
44
|
+
if (!hasIcons(block)) {
|
|
45
|
+
return section('section', 'featureGrid', 'ca-steps', { 'data-titled': String(titled), 'data-count': count }, 'div', sectionHead('featureGrid', block.title), h('ol', { class: 'ca-steps__items' }, block.items.map((item, index) => step(item, ctx, titled, index))));
|
|
46
|
+
}
|
|
47
|
+
return section('section', 'featureGrid', 'ca-ways', { 'data-titled': String(titled), 'data-count': count }, 'div', sectionHead('featureGrid', block.title), h('ul', { class: 'ca-ways__items' }, block.items.map((item) => column(item, ctx, titled))));
|
|
26
48
|
}
|
|
27
49
|
//# 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,EAEL,CAAC,EACD,OAAO,EACP,IAAI,EACJ,gBAAgB,EAEhB,UAAU,GACX,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE/D;;;;;;;;;;;;GAYG;AACH,SAAS,QAAQ,CAAC,KAAuB;IACvC,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAA;AAC5D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,KAAK,CAAA;IAC5B,OAAO,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAChC,CAAC;AAED,SAAS,IAAI,CAAC,IAAiB,EAAE,GAAkB;IACjD,OAAO,IAAI,CAAC,IAAI,KAAK,SAAS;QAC5B,CAAC,CAAC,IAAI,CAAC,KAAK;QACZ,CAAC,CAAC,CAA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E,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC,CACrD,CACF,CAAA;AACH,CAAC"}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import type { GalleryBlock } from '@cogenta/blocks';
|
|
2
2
|
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* gives touch swiping, trackpad scrolling and — because the list is focusable
|
|
6
|
-
* and labelled — arrow-key scrolling, with none of the failure modes of a
|
|
7
|
-
* scripted carousel (WCAG 2.2.2).
|
|
4
|
+
* Photographs of a year at the hall, in the three layouts contract B names:
|
|
8
5
|
*
|
|
9
|
-
* `grid
|
|
10
|
-
*
|
|
11
|
-
*
|
|
6
|
+
* - `grid`: one picture takes the row at 16:9; two share it at 3:2; three
|
|
7
|
+
* make one large picture on the first eight columns with the other two
|
|
8
|
+
* stacked beside it; four make two rows of two at 3:2; five and more make
|
|
9
|
+
* rows of three at 4:3. No row is ever left with a gap in it.
|
|
10
|
+
* - `masonry`: three columns of pictures at their own proportions.
|
|
11
|
+
* - `carousel`: a row of 4:3 crops that scrolls sideways, with native scroll
|
|
12
|
+
* snapping. It is a focusable, labelled region so the row can be scrolled
|
|
13
|
+
* from the keyboard; no script drives it.
|
|
12
14
|
*/
|
|
13
15
|
export declare function renderGallery(block: GalleryBlock, ctx: RenderContext): HtmlElement;
|
|
14
16
|
//# 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;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAoClF"}
|
|
@@ -1,27 +1,33 @@
|
|
|
1
1
|
import { h, image } from '@cogenta/theme-kit';
|
|
2
|
+
import { section } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
* gives touch swiping, trackpad scrolling and — because the list is focusable
|
|
5
|
-
* and labelled — arrow-key scrolling, with none of the failure modes of a
|
|
6
|
-
* scripted carousel (WCAG 2.2.2).
|
|
4
|
+
* Photographs of a year at the hall, in the three layouts contract B names:
|
|
7
5
|
*
|
|
8
|
-
* `grid
|
|
9
|
-
*
|
|
10
|
-
*
|
|
6
|
+
* - `grid`: one picture takes the row at 16:9; two share it at 3:2; three
|
|
7
|
+
* make one large picture on the first eight columns with the other two
|
|
8
|
+
* stacked beside it; four make two rows of two at 3:2; five and more make
|
|
9
|
+
* rows of three at 4:3. No row is ever left with a gap in it.
|
|
10
|
+
* - `masonry`: three columns of pictures at their own proportions.
|
|
11
|
+
* - `carousel`: a row of 4:3 crops that scrolls sideways, with native scroll
|
|
12
|
+
* snapping. It is a focusable, labelled region so the row can be scrolled
|
|
13
|
+
* from the keyboard; no script drives it.
|
|
11
14
|
*/
|
|
12
15
|
export function renderGallery(block, ctx) {
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
const count = block.items.length;
|
|
17
|
+
const items = block.items.map((item, index) => h('li', { class: 'ca-gallery__item' }, image(ctx, item.media, {
|
|
18
|
+
className: 'ca-gallery__image',
|
|
19
|
+
sizes: block.layout === 'grid' && index === 0
|
|
20
|
+
? '(min-width: 64rem) 52vw, 100vw'
|
|
21
|
+
: '(min-width: 64rem) 30vw, 80vw',
|
|
22
|
+
})));
|
|
23
|
+
const list = h('ul', { class: 'ca-gallery__items' }, items);
|
|
24
|
+
return section('div', 'gallery', 'ca-gallery', { 'data-layout': block.layout, 'data-count': count >= 5 ? 'many' : String(count) }, 'div', block.layout === 'carousel'
|
|
19
25
|
? h('div', {
|
|
20
|
-
class: '
|
|
26
|
+
class: 'ca-gallery__viewport',
|
|
21
27
|
role: 'region',
|
|
22
28
|
'aria-label': ctx.t('gallery.carousel'),
|
|
23
29
|
tabindex: '0',
|
|
24
|
-
},
|
|
25
|
-
:
|
|
30
|
+
}, list)
|
|
31
|
+
: list);
|
|
26
32
|
}
|
|
27
33
|
//# sourceMappingURL=gallery.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gallery.js","sourceRoot":"","sources":["../../../../src/render/blocks/gallery.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAE,KAAK,EAAsB,MAAM,oBAAoB,CAAA;
|
|
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;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,aAAa,CAAC,KAAmB,EAAE,GAAkB;IACnE,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAA;IAChC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAC5C,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAC7B,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE;QACrB,SAAS,EAAE,mBAAmB;QAC9B,KAAK,EACH,KAAK,CAAC,MAAM,KAAK,MAAM,IAAI,KAAK,KAAK,CAAC;YACpC,CAAC,CAAC,gCAAgC;YAClC,CAAC,CAAC,+BAA+B;KACtC,CAAC,CACH,CACF,CAAA;IACD,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAAE,KAAK,CAAC,CAAA;IAE3D,OAAO,OAAO,CACZ,KAAK,EACL,SAAS,EACT,YAAY,EACZ,EAAE,aAAa,EAAE,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAClF,KAAK,EACL,KAAK,CAAC,MAAM,KAAK,UAAU;QACzB,CAAC,CAAC,CAAC,CACC,KAAK,EACL;YACE,KAAK,EAAE,sBAAsB;YAC7B,IAAI,EAAE,QAAQ;YACd,YAAY,EAAE,GAAG,CAAC,CAAC,CAAC,kBAAkB,CAAC;YACvC,QAAQ,EAAE,GAAG;SACd,EACD,IAAI,CACL;QACH,CAAC,CAAC,IAAI,CACT,CAAA;AACH,CAAC"}
|
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
import type { HeroBlock } from '@cogenta/blocks';
|
|
2
2
|
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
3
|
/**
|
|
4
|
-
* The
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
4
|
+
* The opening of a page: a photograph of the people the organisation works
|
|
5
|
+
* with, across the whole width of the window, and the statement of the cause
|
|
6
|
+
* set large on a sheet of the page's own paper that starts at the window's
|
|
7
|
+
* left edge and rises into the bottom of the photograph.
|
|
8
|
+
*
|
|
9
|
+
* On a wide screen the sheet holds the eyebrow and the statement on the first
|
|
10
|
+
* seven columns; the subtitle and the actions sit under the photograph on
|
|
11
|
+
* the last four, starting where the photograph ends, so the two halves of the
|
|
12
|
+
* opening read as one composition rather than a box with a hole beside it.
|
|
13
|
+
*
|
|
14
|
+
* The words are never laid over the picture. A headline floated in the middle
|
|
15
|
+
* of a dimmed photograph needs a veil to stay legible on every picture an
|
|
16
|
+
* editor may choose, and that veil is the look of every generated charity
|
|
17
|
+
* template; on the paper the statement is legible in both schemes whatever
|
|
18
|
+
* the photograph, and the faces keep their own light.
|
|
19
|
+
*
|
|
20
|
+
* The first action is the donation ask, drawn in the signal yellow; the
|
|
21
|
+
* others are underlined words. An eyebrow, when there is one, is a short line
|
|
22
|
+
* in the organisation's green, never a badge. Without media the block is the
|
|
23
|
+
* sheet alone.
|
|
24
|
+
*
|
|
25
|
+
* The image is the only one on a page loaded eagerly: it is above the fold
|
|
26
|
+
* by construction.
|
|
13
27
|
*/
|
|
14
28
|
export declare function renderHero(block: HeroBlock, ctx: RenderContext): HtmlElement;
|
|
15
29
|
//# 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,
|
|
1
|
+
{"version":3,"file":"hero.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/hero.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAc,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAG/F;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CA2C5E"}
|
|
@@ -1,31 +1,48 @@
|
|
|
1
|
-
import { actionList,
|
|
1
|
+
import { actionList, h, image } from '@cogenta/theme-kit';
|
|
2
|
+
import { optionalText } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
* The
|
|
4
|
-
*
|
|
4
|
+
* The opening of a page: a photograph of the people the organisation works
|
|
5
|
+
* with, across the whole width of the window, and the statement of the cause
|
|
6
|
+
* set large on a sheet of the page's own paper that starts at the window's
|
|
7
|
+
* left edge and rises into the bottom of the photograph.
|
|
5
8
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* On a wide screen the sheet holds the eyebrow and the statement on the first
|
|
10
|
+
* seven columns; the subtitle and the actions sit under the photograph on
|
|
11
|
+
* the last four, starting where the photograph ends, so the two halves of the
|
|
12
|
+
* opening read as one composition rather than a box with a hole beside it.
|
|
13
|
+
*
|
|
14
|
+
* The words are never laid over the picture. A headline floated in the middle
|
|
15
|
+
* of a dimmed photograph needs a veil to stay legible on every picture an
|
|
16
|
+
* editor may choose, and that veil is the look of every generated charity
|
|
17
|
+
* template; on the paper the statement is legible in both schemes whatever
|
|
18
|
+
* the photograph, and the faces keep their own light.
|
|
19
|
+
*
|
|
20
|
+
* The first action is the donation ask, drawn in the signal yellow; the
|
|
21
|
+
* others are underlined words. An eyebrow, when there is one, is a short line
|
|
22
|
+
* in the organisation's green, never a badge. Without media the block is the
|
|
23
|
+
* sheet alone.
|
|
24
|
+
*
|
|
25
|
+
* The image is the only one on a page loaded eagerly: it is above the fold
|
|
26
|
+
* by construction.
|
|
12
27
|
*/
|
|
13
28
|
export function renderHero(block, ctx) {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
29
|
+
const hasMedia = block.media !== undefined;
|
|
30
|
+
const actions = actionList(ctx, block.actions, ctx.t('hero.actions'));
|
|
31
|
+
const hasAside = block.subtitle !== undefined || actions !== null;
|
|
32
|
+
return h('section', {
|
|
33
|
+
class: 'ca-section ca-hero ca-ask',
|
|
34
|
+
'data-block': 'hero',
|
|
35
|
+
'data-media': String(hasMedia),
|
|
36
|
+
}, block.media === undefined
|
|
20
37
|
? null
|
|
21
|
-
: h('
|
|
22
|
-
|
|
23
|
-
// that must not be lazy — a lazy-loaded LCP element is a measured
|
|
24
|
-
// Lighthouse regression, not a theoretical one.
|
|
25
|
-
image(ctx, block.media, {
|
|
26
|
-
className: 'cg-hero__media',
|
|
38
|
+
: h('figure', { class: 'ca-hero__media' }, image(ctx, block.media, {
|
|
39
|
+
className: 'ca-hero__image',
|
|
27
40
|
loading: 'eager',
|
|
28
|
-
sizes: '
|
|
29
|
-
}))
|
|
41
|
+
sizes: '100vw',
|
|
42
|
+
})), h('div', { class: 'ca-container ca-hero__inner' }, h('div', { class: 'ca-hero__panel' }, optionalText('p', 'ca-kicker ca-hero__eyebrow', block.eyebrow, {
|
|
43
|
+
'data-field': 'eyebrow',
|
|
44
|
+
}), h('h1', { class: 'ca-hero__title', 'data-field': 'title' }, block.title)), hasAside
|
|
45
|
+
? h('div', { class: 'ca-hero__aside' }, optionalText('p', 'ca-hero__subtitle', block.subtitle, { 'data-field': 'subtitle' }), actions)
|
|
46
|
+
: null));
|
|
30
47
|
}
|
|
31
48
|
//# sourceMappingURL=hero.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hero.js","sourceRoot":"","sources":["../../../../src/render/blocks/hero.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"hero.js","sourceRoot":"","sources":["../../../../src/render/blocks/hero.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAoB,CAAC,EAAE,KAAK,EAAsB,MAAM,oBAAoB,CAAA;AAC/F,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,UAAU,CAAC,KAAgB,EAAE,GAAkB;IAC7D,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H,CAAC,CAAC,IAAI,CACT,CACF,CAAA;AACH,CAAC"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { LogoStripBlock } from '@cogenta/blocks';
|
|
2
2
|
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
|
+
/**
|
|
4
|
+
* The lighter row of marks: the caption at the caption size above a rule,
|
|
5
|
+
* and the marks spread along one line under it, small and evenly spaced, in
|
|
6
|
+
* one ink. No links, by contract B; each mark is named by its own alt text
|
|
7
|
+
* from the media library.
|
|
8
|
+
*/
|
|
3
9
|
export declare function renderLogoStrip(block: LogoStripBlock, ctx: RenderContext): HtmlElement;
|
|
4
10
|
//# sourceMappingURL=logo-strip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logo-strip.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/logo-strip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"logo-strip.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/logo-strip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAGnF;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAsBtF"}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { h, image } from '@cogenta/theme-kit';
|
|
2
|
+
import { section } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* The lighter row of marks: the caption at the caption size above a rule,
|
|
5
|
+
* and the marks spread along one line under it, small and evenly spaced, in
|
|
6
|
+
* one ink. No links, by contract B; each mark is named by its own alt text
|
|
7
|
+
* from the media library.
|
|
7
8
|
*/
|
|
8
|
-
function renderItem(item, ctx) {
|
|
9
|
-
return h('li', { class: 'cg-logo-band__item' }, image(ctx, item.media, { className: 'cg-logo-band__image', variant: { fit: 'contain' } }));
|
|
10
|
-
}
|
|
11
9
|
export function renderLogoStrip(block, ctx) {
|
|
12
|
-
return
|
|
10
|
+
return section('div', 'logoStrip', 'ca-strip', { 'data-captioned': String(block.caption !== undefined) }, 'div', block.caption === undefined
|
|
13
11
|
? null
|
|
14
|
-
: h('
|
|
12
|
+
: h('p', { class: 'ca-strip__caption', 'data-field': 'caption' }, block.caption), h('ul', { class: 'ca-strip__items' }, block.logos.map((logo) => h('li', { class: 'ca-strip__item' }, image(ctx, logo.media, { className: 'ca-mark', sizes: '12rem' })))));
|
|
15
13
|
}
|
|
16
14
|
//# 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,MAAM,UAAU,eAAe,CAAC,KAAqB,EAAE,GAAkB;IACvE,OAAO,OAAO,CACZ,KAAK,EACL,WAAW,EACX,UAAU,EACV,EAAE,gBAAgB,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC,EAAE,EACzD,KAAK,EACL,KAAK,CAAC,OAAO,KAAK,SAAS;QACzB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,EAClF,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAC5B,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACvB,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAC3B,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CACjE,CACF,CACF,CACF,CAAA;AACH,CAAC"}
|
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
import type { LogosBlock } from '@cogenta/blocks';
|
|
2
2
|
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
|
+
/**
|
|
4
|
+
* The organisations that work alongside this one: the title on the first
|
|
5
|
+
* four columns, and their marks on the last eight in a grid of cells divided
|
|
6
|
+
* by hairlines, each mark set small and in one ink so no partner shouts
|
|
7
|
+
* louder than another. A mark drawn in ink is inverted in the dark scheme.
|
|
8
|
+
*
|
|
9
|
+
* The organisation's name is the mark's accessible name when the media
|
|
10
|
+
* library has no alt text for it, and the link's own name when it links out.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Columns on a wide screen that leave no empty cell in the grid: three when
|
|
14
|
+
* the count divides by three, two when it divides by two, otherwise three.
|
|
15
|
+
*/
|
|
16
|
+
export declare function logoColumnsFor(count: number): number;
|
|
3
17
|
export declare function renderLogos(block: LogosBlock, ctx: RenderContext): HtmlElement;
|
|
4
18
|
//# sourceMappingURL=logos.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logos.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/logos.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"logos.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/logos.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAGnF;;;;;;;;GAQG;AACH;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGpD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAkC9E"}
|
|
@@ -1,22 +1,36 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h, image } from '@cogenta/theme-kit';
|
|
2
|
+
import { section, sectionHead } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* The organisations that work alongside this one: the title on the first
|
|
5
|
+
* four columns, and their marks on the last eight in a grid of cells divided
|
|
6
|
+
* by hairlines, each mark set small and in one ink so no partner shouts
|
|
7
|
+
* louder than another. A mark drawn in ink is inverted in the dark scheme.
|
|
8
|
+
*
|
|
9
|
+
* The organisation's name is the mark's accessible name when the media
|
|
10
|
+
* library has no alt text for it, and the link's own name when it links out.
|
|
6
11
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
: h('a', { class: 'cg-logo__link', href: ctx.link(item.url), rel: 'noopener noreferrer' }, logo));
|
|
12
|
+
/**
|
|
13
|
+
* Columns on a wide screen that leave no empty cell in the grid: three when
|
|
14
|
+
* the count divides by three, two when it divides by two, otherwise three.
|
|
15
|
+
*/
|
|
16
|
+
export function logoColumnsFor(count) {
|
|
17
|
+
if (count % 3 === 0)
|
|
18
|
+
return 3;
|
|
19
|
+
return count % 2 === 0 ? 2 : 3;
|
|
16
20
|
}
|
|
17
21
|
export function renderLogos(block, ctx) {
|
|
18
|
-
return
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
return section('section', 'logos', 'ca-partners', {
|
|
23
|
+
'data-titled': String(block.title !== undefined),
|
|
24
|
+
'data-columns': String(logoColumnsFor(block.items.length)),
|
|
25
|
+
}, 'div', sectionHead('logos', block.title), h('ul', { class: 'ca-partners__items' }, block.items.map((item) => {
|
|
26
|
+
const mark = image(ctx, item.media, {
|
|
27
|
+
className: 'ca-mark',
|
|
28
|
+
altFrom: item.name,
|
|
29
|
+
sizes: '12rem',
|
|
30
|
+
});
|
|
31
|
+
return h('li', { class: 'ca-partners__item' }, item.url === undefined
|
|
32
|
+
? h('span', { class: 'ca-partners__cell' }, mark)
|
|
33
|
+
: h('a', { class: 'ca-partners__cell', href: item.url, rel: 'noopener noreferrer' }, mark));
|
|
34
|
+
})));
|
|
21
35
|
}
|
|
22
36
|
//# 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;;;;;;;;GAQG;AACH;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,KAAa;IAC1C,IAAI,KAAK,GAAG,CAAC,KAAK,CAAC;QAAE,OAAO,CAAC,CAAA;IAC7B,OAAO,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAChC,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAiB,EAAE,GAAkB;IAC/D,OAAO,OAAO,CACZ,SAAS,EACT,OAAO,EACP,aAAa,EACb;QACE,aAAa,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC;QAChD,cAAc,EAAE,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;KAC3D,EACD,KAAK,EACL,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,EACjC,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,oBAAoB,EAAE,EAC/B,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACvB,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE;YAClC,SAAS,EAAE,SAAS;YACpB,OAAO,EAAE,IAAI,CAAC,IAAI;YAClB,KAAK,EAAE,OAAO;SACf,CAAC,CAAA;QACF,OAAO,CAAC,CACN,IAAI,EACJ,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAC9B,IAAI,CAAC,GAAG,KAAK,SAAS;YACpB,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAAE,IAAI,CAAC;YACjD,CAAC,CAAC,CAAC,CACC,GAAG,EACH,EAAE,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,qBAAqB,EAAE,EAC1E,IAAI,CACL,CACN,CAAA;IACH,CAAC,CAAC,CACH,CACF,CAAA;AACH,CAAC"}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import type { MediaFigureBlock } from '@cogenta/blocks';
|
|
2
2
|
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* A photograph and its caption, the caption always under the picture's own
|
|
5
|
+
* left edge, in the text face, with the credit after it.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* `align` is an editorial intent, read as a layout:
|
|
8
|
+
*
|
|
9
|
+
* - `start` / `end`: seven columns on that side, the caption beside it on the
|
|
10
|
+
* other four, set against the bottom of the picture.
|
|
11
|
+
* - `center`: eight columns, set in from the second.
|
|
12
|
+
* - `wide` (and no value): the whole container.
|
|
13
|
+
* - `full`: the whole window, edge to edge.
|
|
14
|
+
*
|
|
15
|
+
* The ratio crops from the middle, or from the media's own focal point; the
|
|
16
|
+
* corners stay square and the picture casts no shadow.
|
|
10
17
|
*/
|
|
11
18
|
export declare function renderMediaFigure(block: MediaFigureBlock, ctx: RenderContext): HtmlElement;
|
|
12
19
|
//# 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;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CA2C1F"}
|