@cogenta/theme-magazine 1.1.3 → 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,32 +1,36 @@
|
|
|
1
1
|
import { aspectRatio, h, image } from '@cogenta/theme-kit';
|
|
2
|
+
import { section } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
* A
|
|
4
|
-
*
|
|
5
|
-
* the
|
|
6
|
-
*
|
|
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.
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
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.
|
|
12
13
|
*/
|
|
13
14
|
export function renderMediaFigure(block, ctx) {
|
|
14
15
|
const ratio = aspectRatio(block.ratio);
|
|
16
|
+
const align = block.align ?? 'center';
|
|
15
17
|
const hasCaption = block.caption !== undefined || block.credit !== undefined;
|
|
16
|
-
return
|
|
17
|
-
|
|
18
|
-
'data-block': 'mediaFigure',
|
|
19
|
-
'data-align': block.align ?? 'center',
|
|
18
|
+
return section('div', 'mediaFigure', 'cg-figure', {
|
|
19
|
+
'data-align': align,
|
|
20
20
|
style: ratio === undefined ? undefined : `--cg-ratio:${ratio}`,
|
|
21
|
-
}, image(ctx, block.media, {
|
|
22
|
-
className: 'cg-
|
|
23
|
-
sizes:
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
}, 'figure', h('div', { class: 'cg-figure__frame' }, image(ctx, block.media, {
|
|
22
|
+
className: 'cg-figure__image',
|
|
23
|
+
sizes: align === 'full'
|
|
24
|
+
? '100vw'
|
|
25
|
+
: align === 'wide'
|
|
26
|
+
? '(min-width: 64rem) 66rem, 100vw'
|
|
27
|
+
: '(min-width: 64rem) 40rem, 100vw',
|
|
28
|
+
})), hasCaption
|
|
29
|
+
? h('figcaption', { class: 'cg-figure__caption' }, block.caption === undefined
|
|
26
30
|
? null
|
|
27
|
-
: h('span', { class: 'cg-
|
|
31
|
+
: h('span', { class: 'cg-figure__caption-text', 'data-field': 'caption' }, block.caption), block.credit === undefined
|
|
28
32
|
? null
|
|
29
|
-
: h('span', { class: 'cg-
|
|
33
|
+
: h('span', { class: 'cg-figure__credit', 'data-field': 'credit' }, block.credit))
|
|
30
34
|
: null);
|
|
31
35
|
}
|
|
32
36
|
//# sourceMappingURL=media-figure.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-figure.js","sourceRoot":"","sources":["../../../../src/render/blocks/media-figure.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAoB,CAAC,EAAE,KAAK,EAAsB,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"media-figure.js","sourceRoot":"","sources":["../../../../src/render/blocks/media-figure.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAoB,CAAC,EAAE,KAAK,EAAsB,MAAM,oBAAoB,CAAA;AAChG,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAuB,EAAE,GAAkB;IAC3E,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IACtC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,QAAQ,CAAA;IACrC,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS,CAAA;IAC5E,OAAO,OAAO,CACZ,KAAK,EACL,aAAa,EACb,WAAW,EACX;QACE,YAAY,EAAE,KAAK;QACnB,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,KAAK,EAAE;KAC/D,EACD,QAAQ,EACR,CAAC,CACC,KAAK,EACL,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAC7B,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,EAAE;QACtB,SAAS,EAAE,kBAAkB;QAC7B,KAAK,EACH,KAAK,KAAK,MAAM;YACd,CAAC,CAAC,OAAO;YACT,CAAC,CAAC,KAAK,KAAK,MAAM;gBAChB,CAAC,CAAC,iCAAiC;gBACnC,CAAC,CAAC,iCAAiC;KAC1C,CAAC,CACH,EACD,UAAU;QACR,CAAC,CAAC,CAAC,CACC,YAAY,EACZ,EAAE,KAAK,EAAE,oBAAoB,EAAE,EAC/B,KAAK,CAAC,OAAO,KAAK,SAAS;YACzB,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,CAAC,CACC,MAAM,EACN,EAAE,KAAK,EAAE,yBAAyB,EAAE,YAAY,EAAE,SAAS,EAAE,EAC7D,KAAK,CAAC,OAAO,CACd,EACL,KAAK,CAAC,MAAM,KAAK,SAAS;YACxB,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC,CACpF;QACH,CAAC,CAAC,IAAI,CACT,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pricing-table.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/pricing-table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAe,MAAM,iBAAiB,CAAA;AACrE,OAAO,
|
|
1
|
+
{"version":3,"file":"pricing-table.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/pricing-table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAe,MAAM,iBAAiB,CAAA;AACrE,OAAO,EAGL,KAAK,WAAW,EAIhB,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAA;AA8C3B,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAe5F"}
|
|
@@ -1,32 +1,29 @@
|
|
|
1
|
-
import { actionLink,
|
|
1
|
+
import { actionLink, h, heading, nestedHeadingTag, } from '@cogenta/theme-kit';
|
|
2
|
+
import { section, sectionHead } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* `
|
|
10
|
-
* here) and `aria-current` so it is announced, not only shown.
|
|
4
|
+
* Subscription rates, set as the columns of a ruled table rather than as
|
|
5
|
+
* cards: each tier opens on a hairline, its name in small capitals, the price
|
|
6
|
+
* in the display face with tabular numerals and the interval after it, what
|
|
7
|
+
* it includes as a list divided by hairlines, and its action at the foot. The
|
|
8
|
+
* tier the editor highlighted opens on a heavy red rule instead, and its
|
|
9
|
+
* action is the filled one; every other tier's action is drawn as an outlined
|
|
10
|
+
* control in `blocks.css`, so the four actions line up as one row.
|
|
11
11
|
*/
|
|
12
12
|
function renderTier(tier, ctx, tag) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
'data-highlighted': tier.highlighted === true ? 'true' : undefined,
|
|
16
|
-
'aria-current': tier.highlighted === true ? 'true' : undefined,
|
|
17
|
-
}, heading(tag, { class: 'cg-ratecard__name' }, tier.name), h('p', { class: 'cg-ratecard__price' }, h('span', { class: 'cg-ratecard__amount' }, tier.price), tier.interval === undefined
|
|
13
|
+
const highlighted = tier.highlighted === true;
|
|
14
|
+
return h('li', { class: 'cg-rates__tier', 'data-highlighted': highlighted ? 'true' : undefined }, heading(tag, { class: 'cg-rates__name' }, tier.name), h('p', { class: 'cg-rates__price' }, h('span', { class: 'cg-rates__amount' }, tier.price), tier.interval === undefined
|
|
18
15
|
? null
|
|
19
|
-
: h('span', { class: 'cg-
|
|
16
|
+
: h('span', { class: 'cg-rates__interval' }, tier.interval)), tier.features.length === 0
|
|
20
17
|
? null
|
|
21
|
-
: h('ul', { class: 'cg-
|
|
18
|
+
: h('ul', { class: 'cg-rates__features' }, tier.features.map((feature) => h('li', { class: 'cg-rates__feature' }, feature))), tier.action === undefined
|
|
22
19
|
? null
|
|
23
|
-
: h('div', { class: 'cg-
|
|
20
|
+
: h('div', { class: 'cg-rates__action' }, actionLink(ctx, {
|
|
21
|
+
...tier.action,
|
|
22
|
+
emphasis: tier.action.emphasis ?? (highlighted ? 'primary' : 'secondary'),
|
|
23
|
+
})));
|
|
24
24
|
}
|
|
25
25
|
export function renderPricingTable(block, ctx) {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
return h('section', { class: 'cg-block cg-ratecard', 'data-block': 'pricingTable' }, hasTitle
|
|
29
|
-
? heading(blockHeadingTag('pricingTable') ?? 'h2', { class: 'cg-ratecard__title', 'data-field': 'title' }, block.title ?? '')
|
|
30
|
-
: null, h('ul', { class: 'cg-ratecard__tiers' }, block.tiers.map((tier) => renderTier(tier, ctx, tierTag))));
|
|
26
|
+
const tierTag = nestedHeadingTag('pricingTable', block.title !== undefined);
|
|
27
|
+
return section('section', 'pricingTable', 'cg-rates', { 'data-count': String(Math.min(block.tiers.length, 4)) }, 'div', sectionHead('pricingTable', block.title), h('ul', { class: 'cg-rates__tiers' }, block.tiers.map((tier) => renderTier(tier, ctx, tierTag))));
|
|
31
28
|
}
|
|
32
29
|
//# sourceMappingURL=pricing-table.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pricing-table.js","sourceRoot":"","sources":["../../../../src/render/blocks/pricing-table.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,
|
|
1
|
+
{"version":3,"file":"pricing-table.js","sourceRoot":"","sources":["../../../../src/render/blocks/pricing-table.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EAGV,CAAC,EACD,OAAO,EACP,gBAAgB,GAEjB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAEnD;;;;;;;;GAQG;AACH,SAAS,UAAU,CAAC,IAAiB,EAAE,GAAkB,EAAE,GAAe;IACxE,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,KAAK,IAAI,CAAA;IAC7C,OAAO,CAAC,CACN,IAAI,EACJ,EAAE,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAAE,EACjF,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,EACpD,CAAC,CACC,GAAG,EACH,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAC5B,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EACpD,IAAI,CAAC,QAAQ,KAAK,SAAS;QACzB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,CAC9D,EACD,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC;QACxB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,oBAAoB,EAAE,EAC/B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAAE,OAAO,CAAC,CAAC,CACjF,EACL,IAAI,CAAC,MAAM,KAAK,SAAS;QACvB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,CACC,KAAK,EACL,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAC7B,UAAU,CAAC,GAAG,EAAE;YACd,GAAG,IAAI,CAAC,MAAM;YACd,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC;SAC1E,CAAC,CACH,CACN,CAAA;AACH,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,KAAwB,EAAE,GAAkB;IAC7E,MAAM,OAAO,GAAG,gBAAgB,CAAC,cAAc,EAAE,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAA;IAC3E,OAAO,OAAO,CACZ,SAAS,EACT,cAAc,EACd,UAAU,EACV,EAAE,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EACzD,KAAK,EACL,WAAW,CAAC,cAAc,EAAE,KAAK,CAAC,KAAK,CAAC,EACxC,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAC5B,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,CAC1D,CACF,CAAA;AACH,CAAC"}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import type { ProseBlock } from '@cogenta/blocks';
|
|
2
2
|
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* The drop cap and the pull-quote treatment on a nested `<blockquote>` are
|
|
11
|
-
* both pure CSS, keyed off `.cg-prose > :first-child` and `.cg-prose
|
|
12
|
-
* blockquote` in `blocks.css` — nothing here has to know which paragraph
|
|
13
|
-
* came first.
|
|
4
|
+
* Running text, in the reading column: Source Serif at the reading size and
|
|
5
|
+
* a measure of about 66 characters, subheads in the display face, a
|
|
6
|
+
* blockquote set as a pull quote, figures captioned. On an article the first
|
|
7
|
+
* paragraph of the first `prose` block may open on a drop cap (`article.css`,
|
|
8
|
+
* keyed on `data-opening`), and only where the browser can set a real
|
|
9
|
+
* initial letter.
|
|
14
10
|
*/
|
|
15
11
|
export declare function renderProse(block: ProseBlock, ctx: RenderContext): HtmlElement;
|
|
16
12
|
//# sourceMappingURL=prose.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prose.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/prose.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,KAAK,WAAW,EAAK,KAAK,aAAa,EAAkB,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"prose.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/prose.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,KAAK,WAAW,EAAK,KAAK,aAAa,EAAkB,MAAM,oBAAoB,CAAA;AAG5F;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAS9E"}
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import { h, renderRichText } from '@cogenta/theme-kit';
|
|
2
|
+
import { section } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* The drop cap and the pull-quote treatment on a nested `<blockquote>` are
|
|
10
|
-
* both pure CSS, keyed off `.cg-prose > :first-child` and `.cg-prose
|
|
11
|
-
* blockquote` in `blocks.css` — nothing here has to know which paragraph
|
|
12
|
-
* came first.
|
|
4
|
+
* Running text, in the reading column: Source Serif at the reading size and
|
|
5
|
+
* a measure of about 66 characters, subheads in the display face, a
|
|
6
|
+
* blockquote set as a pull quote, figures captioned. On an article the first
|
|
7
|
+
* paragraph of the first `prose` block may open on a drop cap (`article.css`,
|
|
8
|
+
* keyed on `data-opening`), and only where the browser can set a real
|
|
9
|
+
* initial letter.
|
|
13
10
|
*/
|
|
14
11
|
export function renderProse(block, ctx) {
|
|
15
|
-
return
|
|
12
|
+
return section('div', 'prose', 'cg-prose', {}, 'div', h('div', { class: 'cg-prose__body' }, renderRichText(ctx, block.body)));
|
|
16
13
|
}
|
|
17
14
|
//# sourceMappingURL=prose.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prose.js","sourceRoot":"","sources":["../../../../src/render/blocks/prose.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAsB,cAAc,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"prose.js","sourceRoot":"","sources":["../../../../src/render/blocks/prose.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAsB,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAC5F,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,KAAiB,EAAE,GAAkB;IAC/D,OAAO,OAAO,CACZ,KAAK,EACL,OAAO,EACP,UAAU,EACV,EAAE,EACF,KAAK,EACL,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CACvE,CAAA;AACH,CAAC"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import type { QuoteBlock } from '@cogenta/blocks';
|
|
2
2
|
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* markup does not carry.
|
|
4
|
+
* A pull quote: a short red rule, the words in the display face at a large
|
|
5
|
+
* italic size, and the speaker in small capitals with their role after them.
|
|
6
|
+
* In an article it hangs to the left of the reading column; on any other page
|
|
7
|
+
* it takes the same columns as the text around it.
|
|
9
8
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* outside the `<blockquote>` is what stops it from being claimed as part of
|
|
13
|
-
* what was said.
|
|
9
|
+
* The avatar is decorative (the name is beside it in text), so it keeps the
|
|
10
|
+
* media library's own empty `alt`.
|
|
14
11
|
*/
|
|
15
12
|
export declare function renderQuote(block: QuoteBlock, ctx: RenderContext): HtmlElement;
|
|
16
13
|
//# sourceMappingURL=quote.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quote.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/quote.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"quote.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/quote.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAGnF;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAgC9E"}
|
|
@@ -1,29 +1,27 @@
|
|
|
1
1
|
import { h, image } from '@cogenta/theme-kit';
|
|
2
|
+
import { section } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* markup does not carry.
|
|
4
|
+
* A pull quote: a short red rule, the words in the display face at a large
|
|
5
|
+
* italic size, and the speaker in small capitals with their role after them.
|
|
6
|
+
* In an article it hangs to the left of the reading column; on any other page
|
|
7
|
+
* it takes the same columns as the text around it.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* outside the `<blockquote>` is what stops it from being claimed as part of
|
|
12
|
-
* what was said.
|
|
9
|
+
* The avatar is decorative (the name is beside it in text), so it keeps the
|
|
10
|
+
* media library's own empty `alt`.
|
|
13
11
|
*/
|
|
14
12
|
export function renderQuote(block, ctx) {
|
|
15
|
-
const hasAttribution = block.author !== undefined || block.role !== undefined
|
|
16
|
-
return
|
|
13
|
+
const hasAttribution = block.author !== undefined || block.role !== undefined;
|
|
14
|
+
return section('div', 'quote', 'cg-pullquote', {}, 'figure', h('blockquote', { class: 'cg-pullquote__quote' }, h('p', { class: 'cg-pullquote__text', 'data-field': 'text' }, block.text)), hasAttribution
|
|
17
15
|
? h('figcaption', { class: 'cg-pullquote__attribution' }, block.avatar === undefined
|
|
18
16
|
? null
|
|
19
17
|
: image(ctx, block.avatar, {
|
|
20
18
|
className: 'cg-pullquote__avatar',
|
|
21
19
|
variant: { width: 96, height: 96, fit: 'cover' },
|
|
22
|
-
}),
|
|
20
|
+
}), block.author === undefined
|
|
23
21
|
? null
|
|
24
22
|
: h('span', { class: 'cg-pullquote__author', 'data-field': 'author' }, block.author), block.role === undefined
|
|
25
23
|
? null
|
|
26
|
-
: h('span', { class: 'cg-pullquote__role', 'data-field': 'role' }, block.role))
|
|
24
|
+
: h('span', { class: 'cg-pullquote__role', 'data-field': 'role' }, block.role))
|
|
27
25
|
: null);
|
|
28
26
|
}
|
|
29
27
|
//# sourceMappingURL=quote.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quote.js","sourceRoot":"","sources":["../../../../src/render/blocks/quote.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAE,KAAK,EAAsB,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"quote.js","sourceRoot":"","sources":["../../../../src/render/blocks/quote.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAE,KAAK,EAAsB,MAAM,oBAAoB,CAAA;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAC,KAAiB,EAAE,GAAkB;IAC/D,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,CAAA;IAC7E,OAAO,OAAO,CACZ,KAAK,EACL,OAAO,EACP,cAAc,EACd,EAAE,EACF,QAAQ,EACR,CAAC,CACC,YAAY,EACZ,EAAE,KAAK,EAAE,qBAAqB,EAAE,EAChC,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,CAC1E,EACD,cAAc;QACZ,CAAC,CAAC,CAAC,CACC,YAAY,EACZ,EAAE,KAAK,EAAE,2BAA2B,EAAE,EACtC,KAAK,CAAC,MAAM,KAAK,SAAS;YACxB,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,EAAE;gBACvB,SAAS,EAAE,sBAAsB;gBACjC,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE;aACjD,CAAC,EACN,KAAK,CAAC,MAAM,KAAK,SAAS;YACxB,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,sBAAsB,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC,EACtF,KAAK,CAAC,IAAI,KAAK,SAAS;YACtB,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,CACjF;QACH,CAAC,CAAC,IAAI,CACT,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stat-counter.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/stat-counter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAmB,MAAM,iBAAiB,CAAA;AACxE,OAAO,
|
|
1
|
+
{"version":3,"file":"stat-counter.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/stat-counter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAmB,MAAM,iBAAiB,CAAA;AACxE,OAAO,EAAE,KAAK,WAAW,EAAK,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAmB5E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,aAAa,GAAG,WAAW,CAU3F"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h } from '@cogenta/theme-kit';
|
|
2
|
+
import { section, sectionHead } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* `
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* "By the numbers": a ruled table of figures down the page, each row a value
|
|
5
|
+
* in the display face on the left and what it counts on the right. Where
|
|
6
|
+
* `stats` sets figures side by side, this sets them as a list a reader runs
|
|
7
|
+
* down, which suits a longer set. It carries no unit, the narrower shape
|
|
8
|
+
* contract B gives it.
|
|
8
9
|
*/
|
|
9
10
|
function renderItem(item) {
|
|
10
|
-
return h('div', { class: 'cg-
|
|
11
|
+
return h('div', { class: 'cg-tally__row' }, h('dt', { class: 'cg-tally__label' }, item.label), h('dd', { class: 'cg-tally__value' }, item.value));
|
|
11
12
|
}
|
|
12
13
|
export function renderStatCounter(block, _ctx) {
|
|
13
|
-
return
|
|
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)));
|
|
14
|
+
return section('section', 'statCounter', 'cg-tally', {}, 'div', sectionHead('statCounter', block.title), h('dl', { class: 'cg-tally__rows' }, block.stats.map(renderItem)));
|
|
16
15
|
}
|
|
17
16
|
//# sourceMappingURL=stat-counter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stat-counter.js","sourceRoot":"","sources":["../../../../src/render/blocks/stat-counter.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"stat-counter.js","sourceRoot":"","sources":["../../../../src/render/blocks/stat-counter.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAsB,MAAM,oBAAoB,CAAA;AAC5E,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAEnD;;;;;;GAMG;AACH,SAAS,UAAU,CAAC,IAAqB;IACvC,OAAO,CAAC,CACN,KAAK,EACL,EAAE,KAAK,EAAE,eAAe,EAAE,EAC1B,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,OAAO,CACZ,SAAS,EACT,aAAa,EACb,UAAU,EACV,EAAE,EACF,KAAK,EACL,WAAW,CAAC,aAAa,EAAE,KAAK,CAAC,KAAK,CAAC,EACvC,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAClE,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/stats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,
|
|
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,EAAE,KAAK,WAAW,EAAK,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAwB5E,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,GAAG,WAAW,CAU/E"}
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h } from '@cogenta/theme-kit';
|
|
2
|
+
import { section, sectionHead } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* numerals
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* label, which is exactly what `<dt>`/`<dd>` mean, and it survives being read
|
|
9
|
-
* linearly by anything that ignores the stylesheet.
|
|
4
|
+
* Figures in a row between two rules, the way a newspaper sets a fact box
|
|
5
|
+
* without the box: each value in the display face with lining tabular
|
|
6
|
+
* numerals, its unit smaller beside it, the label under it in the interface
|
|
7
|
+
* face, and a vertical hairline between figures. A description list, so
|
|
8
|
+
* each value is announced with its label.
|
|
10
9
|
*/
|
|
11
10
|
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)));
|
|
11
|
+
return h('div', { class: 'cg-figures__item' }, h('dt', { class: 'cg-figures__label' }, item.label), h('dd', { class: 'cg-figures__value' }, h('span', { class: 'cg-figures__number' }, item.value), item.unit === undefined ? null : h('span', { class: 'cg-figures__unit' }, item.unit)));
|
|
13
12
|
}
|
|
14
13
|
export function renderStats(block, _ctx) {
|
|
15
|
-
return
|
|
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)));
|
|
14
|
+
return section('section', 'stats', 'cg-figures', { 'data-count': String(Math.min(block.items.length, 4)) }, 'div', sectionHead('stats', block.title), h('dl', { class: 'cg-figures__items' }, block.items.map(renderItem)));
|
|
18
15
|
}
|
|
19
16
|
//# sourceMappingURL=stats.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats.js","sourceRoot":"","sources":["../../../../src/render/blocks/stats.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"stats.js","sourceRoot":"","sources":["../../../../src/render/blocks/stats.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAsB,MAAM,oBAAoB,CAAA;AAC5E,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAEnD;;;;;;GAMG;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,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EACtD,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,OAAO,CACZ,SAAS,EACT,OAAO,EACP,YAAY,EACZ,EAAE,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EACzD,KAAK,EACL,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,EACjC,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CACrE,CAAA;AACH,CAAC"}
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
import type { TestimonialBlock } from '@cogenta/blocks';
|
|
2
2
|
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* a
|
|
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.
|
|
4
|
+
* A letter from a reader, set as the letters page sets one: the words in the
|
|
5
|
+
* reading face one step above the text size, a hairline, and the writer's
|
|
6
|
+
* name in small capitals with where they write from. Quieter than `quote` on
|
|
7
|
+
* purpose: a pull quote is display, a letter is correspondence.
|
|
17
8
|
*/
|
|
18
9
|
export declare function renderTestimonial(block: TestimonialBlock, ctx: RenderContext): HtmlElement;
|
|
19
10
|
//# sourceMappingURL=testimonial.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testimonial.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/testimonial.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,KAAK,WAAW,EAAY,KAAK,aAAa,EAAkB,MAAM,oBAAoB,CAAA;
|
|
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;AAGnG;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CA4B1F"}
|
|
@@ -1,27 +1,19 @@
|
|
|
1
1
|
import { h, image, renderRichText } from '@cogenta/theme-kit';
|
|
2
|
+
import { section } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* a
|
|
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.
|
|
4
|
+
* A letter from a reader, set as the letters page sets one: the words in the
|
|
5
|
+
* reading face one step above the text size, a hairline, and the writer's
|
|
6
|
+
* name in small capitals with where they write from. Quieter than `quote` on
|
|
7
|
+
* purpose: a pull quote is display, a letter is correspondence.
|
|
16
8
|
*/
|
|
17
9
|
export function renderTestimonial(block, ctx) {
|
|
18
10
|
const { attribution } = block;
|
|
19
|
-
return
|
|
11
|
+
return section('div', 'testimonial', 'cg-letter', {}, 'figure', h('blockquote', { class: 'cg-letter__quote' }, renderRichText(ctx, block.quote)), h('figcaption', { class: 'cg-letter__attribution' }, attribution.avatar === undefined
|
|
20
12
|
? null
|
|
21
13
|
: image(ctx, attribution.avatar, {
|
|
22
14
|
className: 'cg-letter__avatar',
|
|
23
15
|
variant: { width: 96, height: 96, fit: 'cover' },
|
|
24
|
-
}), h('span', { class: 'cg-
|
|
16
|
+
}), h('span', { class: 'cg-letter__who' }, h('span', { class: 'cg-letter__name' }, attribution.name), attribution.role === undefined
|
|
25
17
|
? null
|
|
26
18
|
: h('span', { class: 'cg-letter__role' }, attribution.role))));
|
|
27
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testimonial.js","sourceRoot":"","sources":["../../../../src/render/blocks/testimonial.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAE,KAAK,EAAsB,cAAc,EAAE,MAAM,oBAAoB,CAAA;
|
|
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;AACnG,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAuB,EAAE,GAAkB;IAC3E,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,CAAA;IAC7B,OAAO,OAAO,CACZ,KAAK,EACL,aAAa,EACb,WAAW,EACX,EAAE,EACF,QAAQ,EACR,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,wBAAwB,EAAE,EACnC,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,gBAAgB,EAAE,EAC3B,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chrome.d.ts","sourceRoot":"","sources":["../../../src/render/chrome.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,YAAY,
|
|
1
|
+
{"version":3,"file":"chrome.d.ts","sourceRoot":"","sources":["../../../src/render/chrome.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,YAAY,EAQlB,MAAM,oBAAoB,CAAA;AAuE3B,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,YAAY,CAkG7D"}
|