@cogenta/theme-portfolio 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 +9 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +10 -1
- 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 +10 -18
- package/dist/src/render/blocks/accordion.js.map +1 -1
- package/dist/src/render/blocks/collection-list.d.ts +0 -20
- package/dist/src/render/blocks/collection-list.d.ts.map +1 -1
- package/dist/src/render/blocks/collection-list.js +59 -66
- 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 +15 -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 +16 -31
- 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 -17
- 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 +26 -23
- package/dist/src/render/blocks/feature-grid.js.map +1 -1
- package/dist/src/render/blocks/gallery.d.ts +0 -14
- package/dist/src/render/blocks/gallery.d.ts.map +1 -1
- package/dist/src/render/blocks/gallery.js +29 -21
- package/dist/src/render/blocks/gallery.js.map +1 -1
- package/dist/src/render/blocks/hero.d.ts +8 -8
- package/dist/src/render/blocks/hero.d.ts.map +1 -1
- package/dist/src/render/blocks/hero.js +17 -18
- 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 +9 -14
- 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 +14 -19
- package/dist/src/render/blocks/logos.js.map +1 -1
- package/dist/src/render/blocks/media-figure.d.ts +8 -12
- package/dist/src/render/blocks/media-figure.d.ts.map +1 -1
- package/dist/src/render/blocks/media-figure.js +20 -20
- 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 +17 -20
- package/dist/src/render/blocks/pricing-table.js.map +1 -1
- package/dist/src/render/blocks/prose.d.ts +10 -9
- package/dist/src/render/blocks/prose.d.ts.map +1 -1
- package/dist/src/render/blocks/prose.js +29 -10
- package/dist/src/render/blocks/prose.js.map +1 -1
- package/dist/src/render/blocks/quote.d.ts +5 -12
- package/dist/src/render/blocks/quote.d.ts.map +1 -1
- package/dist/src/render/blocks/quote.js +9 -15
- 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 +10 -12
- 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 +7 -15
- package/dist/src/render/blocks/stats.js.map +1 -1
- package/dist/src/render/blocks/testimonial.d.ts +4 -14
- package/dist/src/render/blocks/testimonial.d.ts.map +1 -1
- package/dist/src/render/blocks/testimonial.js +9 -18
- 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 +93 -90
- package/dist/src/render/chrome.js.map +1 -1
- package/dist/src/render/layout.d.ts +61 -0
- package/dist/src/render/layout.d.ts.map +1 -0
- package/dist/src/render/layout.js +134 -0
- package/dist/src/render/layout.js.map +1 -0
- package/dist/src/render/project.d.ts +27 -0
- package/dist/src/render/project.d.ts.map +1 -0
- package/dist/src/render/project.js +82 -0
- package/dist/src/render/project.js.map +1 -0
- package/dist/src/render/render-block.d.ts +17 -7
- package/dist/src/render/render-block.d.ts.map +1 -1
- package/dist/src/render/render-block.js +47 -34
- package/dist/src/render/render-block.js.map +1 -1
- package/dist/src/render/term-archive.d.ts +0 -11
- package/dist/src/render/term-archive.d.ts.map +1 -1
- package/dist/src/render/term-archive.js +36 -24
- 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/src/render/work.d.ts +37 -0
- package/dist/src/render/work.d.ts.map +1 -0
- package/dist/src/render/work.js +49 -0
- package/dist/src/render/work.js.map +1 -0
- package/dist/theme.config.d.ts +4 -7
- package/dist/theme.config.d.ts.map +1 -1
- package/dist/theme.config.js +6 -9
- package/dist/theme.config.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +10 -1
- package/src/render/blocks/accordion.ts +22 -42
- package/src/render/blocks/collection-list.ts +83 -137
- package/src/render/blocks/cta.ts +24 -12
- package/src/render/blocks/embed.ts +39 -47
- package/src/render/blocks/faq.ts +24 -33
- package/src/render/blocks/feature-grid.ts +38 -41
- package/src/render/blocks/gallery.ts +34 -28
- package/src/render/blocks/hero.ts +31 -28
- package/src/render/blocks/logo-strip.ts +18 -20
- package/src/render/blocks/logos.ts +22 -43
- package/src/render/blocks/media-figure.ts +28 -20
- package/src/render/blocks/pricing-table.ts +31 -32
- package/src/render/blocks/prose.ts +38 -13
- package/src/render/blocks/quote.ts +18 -18
- package/src/render/blocks/stat-counter.ts +19 -37
- package/src/render/blocks/stats.ts +18 -33
- package/src/render/blocks/testimonial.ts +16 -22
- package/src/render/chrome.ts +99 -97
- package/src/render/layout.ts +177 -0
- package/src/render/project.ts +140 -0
- package/src/render/render-block.ts +49 -45
- package/src/render/term-archive.ts +92 -70
- package/src/render/widget-areas.ts +25 -0
- package/src/render/work.ts +124 -0
- package/src/styles/archive.css +61 -21
- package/src/styles/base.css +763 -648
- package/src/styles/blocks.css +697 -1093
- package/src/styles/theme.css +22 -10
- package/src/styles/tokens.css +174 -252
- package/src/styles/widgets.css +948 -0
- package/src/styles/work.css +405 -0
- package/tokens.json +19 -19
package/dist/src/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from '@cogenta/theme-kit';
|
|
2
|
+
export * from './render/blocks/accordion.js';
|
|
2
3
|
export * from './render/blocks/collection-list.js';
|
|
3
4
|
export * from './render/blocks/cta.js';
|
|
4
5
|
export * from './render/blocks/embed.js';
|
|
@@ -6,12 +7,20 @@ export * from './render/blocks/faq.js';
|
|
|
6
7
|
export * from './render/blocks/feature-grid.js';
|
|
7
8
|
export * from './render/blocks/gallery.js';
|
|
8
9
|
export * from './render/blocks/hero.js';
|
|
10
|
+
export * from './render/blocks/logo-strip.js';
|
|
9
11
|
export * from './render/blocks/logos.js';
|
|
10
12
|
export * from './render/blocks/media-figure.js';
|
|
13
|
+
export * from './render/blocks/pricing-table.js';
|
|
11
14
|
export * from './render/blocks/prose.js';
|
|
12
15
|
export * from './render/blocks/quote.js';
|
|
16
|
+
export * from './render/blocks/stat-counter.js';
|
|
13
17
|
export * from './render/blocks/stats.js';
|
|
18
|
+
export * from './render/blocks/testimonial.js';
|
|
14
19
|
export * from './render/chrome.js';
|
|
20
|
+
export * from './render/layout.js';
|
|
21
|
+
export * from './render/project.js';
|
|
15
22
|
export * from './render/render-block.js';
|
|
16
23
|
export * from './render/term-archive.js';
|
|
24
|
+
export * from './render/widget-areas.js';
|
|
25
|
+
export * from './render/work.js';
|
|
17
26
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,oBAAoB,CAAA;AAClC,cAAc,oCAAoC,CAAA;AAClD,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,oBAAoB,CAAA;AAClC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,oBAAoB,CAAA;AAClC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oCAAoC,CAAA;AAClD,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,0BAA0B,CAAA;AACxC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,kCAAkC,CAAA;AAChD,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,0BAA0B,CAAA;AACxC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,kBAAkB,CAAA"}
|
package/dist/src/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
// The shared contract D primitives every theme package implements against
|
|
1
|
+
// The shared contract D primitives every theme package implements against,
|
|
2
2
|
// re-exported so a consumer of this package never has to know they live in
|
|
3
3
|
// `@cogenta/theme-kit` to use them alongside this theme's own blocks.
|
|
4
4
|
export * from '@cogenta/theme-kit';
|
|
5
|
+
export * from './render/blocks/accordion.js';
|
|
5
6
|
export * from './render/blocks/collection-list.js';
|
|
6
7
|
export * from './render/blocks/cta.js';
|
|
7
8
|
export * from './render/blocks/embed.js';
|
|
@@ -9,12 +10,20 @@ export * from './render/blocks/faq.js';
|
|
|
9
10
|
export * from './render/blocks/feature-grid.js';
|
|
10
11
|
export * from './render/blocks/gallery.js';
|
|
11
12
|
export * from './render/blocks/hero.js';
|
|
13
|
+
export * from './render/blocks/logo-strip.js';
|
|
12
14
|
export * from './render/blocks/logos.js';
|
|
13
15
|
export * from './render/blocks/media-figure.js';
|
|
16
|
+
export * from './render/blocks/pricing-table.js';
|
|
14
17
|
export * from './render/blocks/prose.js';
|
|
15
18
|
export * from './render/blocks/quote.js';
|
|
19
|
+
export * from './render/blocks/stat-counter.js';
|
|
16
20
|
export * from './render/blocks/stats.js';
|
|
21
|
+
export * from './render/blocks/testimonial.js';
|
|
17
22
|
export * from './render/chrome.js';
|
|
23
|
+
export * from './render/layout.js';
|
|
24
|
+
export * from './render/project.js';
|
|
18
25
|
export * from './render/render-block.js';
|
|
19
26
|
export * from './render/term-archive.js';
|
|
27
|
+
export * from './render/widget-areas.js';
|
|
28
|
+
export * from './render/work.js';
|
|
20
29
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,2EAA2E;AAC3E,sEAAsE;AACtE,cAAc,oBAAoB,CAAA;AAClC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oCAAoC,CAAA;AAClD,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,0BAA0B,CAAA;AACxC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,kCAAkC,CAAA;AAChD,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,0BAA0B,CAAA;AACxC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,kBAAkB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/accordion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,iBAAiB,CAAA;AACpE,OAAO,
|
|
1
|
+
{"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/accordion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,iBAAiB,CAAA;AACpE,OAAO,EAAE,KAAK,WAAW,EAAK,KAAK,aAAa,EAAkB,MAAM,oBAAoB,CAAA;AA4B5F,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CActF"}
|
|
@@ -1,24 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h, renderRichText } from '@cogenta/theme-kit';
|
|
2
|
+
import { section, sectionHead } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* treats them as two distinct editorial intents sharing one data shape; this
|
|
9
|
-
* package keeps that distinction in its markup too.
|
|
10
|
-
*
|
|
11
|
-
* The marker here is a plain rotating caret rather than `faq.ts`'s plus/
|
|
12
|
-
* cross, and questions sit in a numbered ledger the same way `logos.ts`'s
|
|
13
|
-
* items do — an accordion reads as an indexed list of topics, not a wall of
|
|
14
|
-
* frequently-asked questions.
|
|
4
|
+
* Collapsible notes on a ruled list, from the fourth column: each question on
|
|
5
|
+
* its own row in the display width, a plus drawn from two bars that loses its
|
|
6
|
+
* upright when the row is open, and the answer at the reading measure.
|
|
7
|
+
* Opening, keyboard behaviour and the announced state are all native
|
|
8
|
+
* `<details>`. No script.
|
|
15
9
|
*/
|
|
16
|
-
function renderItem(item, ctx
|
|
17
|
-
return h('li', { class: 'cg-
|
|
10
|
+
function renderItem(item, ctx) {
|
|
11
|
+
return h('li', { class: 'cg-notes__item' }, h('details', { class: 'cg-notes__details' }, h('summary', { class: 'cg-notes__question' }, h('span', { class: 'cg-notes__question-text' }, item.question), h('span', { class: 'cg-notes__mark', 'aria-hidden': 'true' })), h('div', { class: 'cg-notes__answer' }, renderRichText(ctx, item.answer))));
|
|
18
12
|
}
|
|
19
13
|
export function renderAccordion(block, ctx) {
|
|
20
|
-
return
|
|
21
|
-
? null
|
|
22
|
-
: heading(blockHeadingTag('accordion') ?? 'h2', { class: 'cg-accordion__title', 'data-field': 'title' }, block.title), h('ul', { class: 'cg-accordion__items' }, block.items.map((item, index) => renderItem(item, ctx, index))));
|
|
14
|
+
return section('section', 'accordion', 'cg-notes cg-split', { 'data-titled': block.title === undefined ? 'false' : 'true' }, 'div', sectionHead('accordion', block.title), h('ul', { class: 'cg-notes__items' }, block.items.map((item) => renderItem(item, ctx))));
|
|
23
15
|
}
|
|
24
16
|
//# sourceMappingURL=accordion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.js","sourceRoot":"","sources":["../../../../src/render/blocks/accordion.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"accordion.js","sourceRoot":"","sources":["../../../../src/render/blocks/accordion.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAsB,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAC5F,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAEnD;;;;;;GAMG;AACH,SAAS,UAAU,CAAC,IAAmB,EAAE,GAAkB;IACzD,OAAO,CAAC,CACN,IAAI,EACJ,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAC3B,CAAC,CACC,SAAS,EACT,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAC9B,CAAC,CACC,SAAS,EACT,EAAE,KAAK,EAAE,oBAAoB,EAAE,EAC/B,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,yBAAyB,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,EAC9D,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC,CAC9D,EACD,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAAE,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAC1E,CACF,CAAA;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAqB,EAAE,GAAkB;IACvE,OAAO,OAAO,CACZ,SAAS,EACT,WAAW,EACX,mBAAmB,EACnB,EAAE,aAAa,EAAE,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,EAC/D,KAAK,EACL,WAAW,CAAC,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,EACrC,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,CAAC,CAAC,CACjD,CACF,CAAA;AACH,CAAC"}
|
|
@@ -1,25 +1,5 @@
|
|
|
1
1
|
import type { CollectionListBlock } from '@cogenta/blocks';
|
|
2
2
|
import { buildCollectionListQuery, type ContentEntry, type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
|
-
/**
|
|
4
|
-
* The only block of the seventeen that reads data at render time — contract
|
|
5
|
-
* B marks it `runtime: 'server'` for that reason.
|
|
6
|
-
*
|
|
7
|
-
* The read is *not* done here. `query` builds the request
|
|
8
|
-
* (`@cogenta/theme-kit`'s `buildCollectionListQuery`, shared across every
|
|
9
|
-
* theme since it derives purely from the block's own fields), the caller
|
|
10
|
-
* awaits `ctx.content.list(...)` before rendering starts, and this function
|
|
11
|
-
* stays a pure function of the entries it is handed.
|
|
12
|
-
*
|
|
13
|
-
* `list` keeps this theme's original register — a numbered mono index, the
|
|
14
|
-
* title set at feature-headline scale, the date pushed to the far edge —
|
|
15
|
-
* unchanged since L23. `grid`/`carousel` (`theme@1.4`) retile the same
|
|
16
|
-
* entries into full-bleed project cards instead: a cover (`entryImage`,
|
|
17
|
-
* 4:3), the title in display type, and — read straight off the raw
|
|
18
|
-
* `ContentEntry` this block's entries already are, never invented — the
|
|
19
|
-
* entry's own `role`/`year` fields as a meta line when a collection happens
|
|
20
|
-
* to declare them (the `portfolio` blueprint's `project` does; any other
|
|
21
|
-
* collection simply shows no meta line).
|
|
22
|
-
*/
|
|
23
3
|
export { buildCollectionListQuery as query };
|
|
24
4
|
export declare function renderCollectionList(block: CollectionListBlock, ctx: RenderContext, entries: readonly ContentEntry[]): HtmlElement;
|
|
25
5
|
//# sourceMappingURL=collection-list.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-list.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/collection-list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,
|
|
1
|
+
{"version":3,"file":"collection-list.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/collection-list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EACL,wBAAwB,EACxB,KAAK,YAAY,EACjB,KAAK,WAAW,EAGhB,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAA;AAI3B,OAAO,EAAE,wBAAwB,IAAI,KAAK,EAAE,CAAA;AAyF5C,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,mBAAmB,EAC1B,GAAG,EAAE,aAAa,EAClB,OAAO,EAAE,SAAS,YAAY,EAAE,GAC/B,WAAW,CAqBb"}
|
|
@@ -1,77 +1,70 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { buildCollectionListQuery, h, nestedHeadingTag, } from '@cogenta/theme-kit';
|
|
2
|
+
import { section, sectionHead } from '../layout.js';
|
|
3
|
+
import { renderIndexRow, renderWorkCard, workFromEntry } from '../work.js';
|
|
4
|
+
export { buildCollectionListQuery as query };
|
|
2
5
|
/**
|
|
3
|
-
*
|
|
4
|
-
* B
|
|
6
|
+
* A listing of work, in one of three forms taken from the layout the editor
|
|
7
|
+
* chose in contract B, never from a setting this theme invents:
|
|
5
8
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* - `grid` is **the work grid**: an asymmetric sequence on twelve columns,
|
|
10
|
+
* six places long. A large image across seven columns with a smaller one
|
|
11
|
+
* across four, dropped lower, beside it; a full-width image; the pair again
|
|
12
|
+
* mirrored; a full-width image. Every cover keeps the same 3:2 shape, so
|
|
13
|
+
* the asymmetry comes from the columns and the drop, never from cropping
|
|
14
|
+
* one project differently from the next. The pattern lives in `work.css`,
|
|
15
|
+
* keyed on each item's `data-place`.
|
|
16
|
+
* - `list` is **the index**: one ruled row per project, title, client,
|
|
17
|
+
* discipline and year in columns.
|
|
18
|
+
* - `carousel` is **a strip**: cards side by side at one width, scrolling on
|
|
19
|
+
* any screen, a focusable and labelled region. No script.
|
|
11
20
|
*
|
|
12
|
-
*
|
|
13
|
-
* title set at feature-headline scale, the date pushed to the far edge —
|
|
14
|
-
* unchanged since L23. `grid`/`carousel` (`theme@1.4`) retile the same
|
|
15
|
-
* entries into full-bleed project cards instead: a cover (`entryImage`,
|
|
16
|
-
* 4:3), the title in display type, and — read straight off the raw
|
|
17
|
-
* `ContentEntry` this block's entries already are, never invented — the
|
|
18
|
-
* entry's own `role`/`year` fields as a meta line when a collection happens
|
|
19
|
-
* to declare them (the `portfolio` blueprint's `project` does; any other
|
|
20
|
-
* collection simply shows no meta line).
|
|
21
|
+
* An empty list keeps its label and says so in one line.
|
|
21
22
|
*/
|
|
22
|
-
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
const PLACES = 6;
|
|
24
|
+
function sizesFor(place) {
|
|
25
|
+
if (place === 3 || place === 0)
|
|
26
|
+
return '(min-width: 64rem) 92rem, 100vw';
|
|
27
|
+
if (place === 1 || place === 5)
|
|
28
|
+
return '(min-width: 64rem) 54rem, 100vw';
|
|
29
|
+
return '(min-width: 64rem) 30rem, 100vw';
|
|
26
30
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
function grid(entries, ctx, titled) {
|
|
32
|
+
const tag = nestedHeadingTag('collectionList', titled);
|
|
33
|
+
return h('ul', { class: 'cg-grid', 'data-count': String(entries.length) }, entries.map((entry, index) => {
|
|
34
|
+
const place = (index + 1) % PLACES;
|
|
35
|
+
return h('li', { class: 'cg-grid__item', 'data-place': String(place === 0 ? PLACES : place) }, renderWorkCard(workFromEntry(entry, ctx), {
|
|
36
|
+
tag,
|
|
37
|
+
sizes: sizesFor(place),
|
|
38
|
+
loading: index < 2 ? 'eager' : 'lazy',
|
|
39
|
+
}));
|
|
40
|
+
}));
|
|
34
41
|
}
|
|
35
|
-
function
|
|
36
|
-
const
|
|
37
|
-
return h('
|
|
38
|
-
? h('span', { class: 'cg-entry__cover-empty', 'aria-hidden': 'true' })
|
|
39
|
-
: renderImageSource(cover, {
|
|
40
|
-
className: 'cg-entry__cover',
|
|
41
|
-
sizes: '(min-width: 80rem) 50vw, 100vw',
|
|
42
|
-
})), h('span', { class: 'cg-entry__index', 'aria-hidden': 'true' }, String(index + 1).padStart(2, '0')), heading(tag, { class: 'cg-entry__title' }, h('a', { class: 'cg-entry__link', href: entryHref(entry, ctx) }, entryTitle(entry, ctx))), renderCardMeta(entry)));
|
|
42
|
+
function index(entries, ctx, titled) {
|
|
43
|
+
const tag = nestedHeadingTag('collectionList', titled);
|
|
44
|
+
return h('ol', { class: 'cg-index', 'data-count': String(entries.length) }, entries.map((entry) => renderIndexRow(workFromEntry(entry, ctx), tag)));
|
|
43
45
|
}
|
|
44
|
-
function
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
function strip(entries, ctx, block) {
|
|
47
|
+
const tag = nestedHeadingTag('collectionList', block.title !== undefined);
|
|
48
|
+
return h('div', {
|
|
49
|
+
class: 'cg-strip',
|
|
50
|
+
role: 'region',
|
|
51
|
+
'aria-label': block.title ?? ctx.t('collection.carousel'),
|
|
52
|
+
tabindex: '0',
|
|
53
|
+
}, h('ul', { class: 'cg-strip__items', 'data-count': String(entries.length) }, entries.map((entry) => h('li', { class: 'cg-strip__item' }, renderWorkCard(workFromEntry(entry, ctx), {
|
|
54
|
+
tag,
|
|
55
|
+
sizes: '(min-width: 64rem) 34rem, 80vw',
|
|
56
|
+
})))));
|
|
53
57
|
}
|
|
54
58
|
export function renderCollectionList(block, ctx, entries) {
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
'data-layout': block.layout,
|
|
66
|
-
}, hasTitle
|
|
67
|
-
? heading(blockHeadingTag('collectionList') ?? 'h2', { class: 'cg-collection__title', 'data-field': 'title' }, block.title ?? '')
|
|
68
|
-
: null, block.layout === 'carousel'
|
|
69
|
-
? h('div', {
|
|
70
|
-
class: 'cg-collection__viewport',
|
|
71
|
-
role: 'region',
|
|
72
|
-
'aria-label': block.title ?? ctx.t('collection.carousel'),
|
|
73
|
-
tabindex: '0',
|
|
74
|
-
}, items)
|
|
75
|
-
: items);
|
|
59
|
+
const titled = block.title !== undefined;
|
|
60
|
+
const form = block.layout === 'list' ? 'index' : block.layout === 'carousel' ? 'strip' : 'grid';
|
|
61
|
+
const body = entries.length === 0
|
|
62
|
+
? h('p', { class: 'cg-empty' }, ctx.t('collection.empty'))
|
|
63
|
+
: form === 'index'
|
|
64
|
+
? index(entries, ctx, titled)
|
|
65
|
+
: form === 'strip'
|
|
66
|
+
? strip(entries, ctx, block)
|
|
67
|
+
: grid(entries, ctx, titled);
|
|
68
|
+
return section('section', 'collectionList', 'cg-collection', { 'data-form': form, 'data-collection': block.collection }, 'div', sectionHead('collectionList', block.title), body);
|
|
76
69
|
}
|
|
77
70
|
//# sourceMappingURL=collection-list.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-list.js","sourceRoot":"","sources":["../../../../src/render/blocks/collection-list.ts"],"names":[],"mappings":"AACA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"collection-list.js","sourceRoot":"","sources":["../../../../src/render/blocks/collection-list.ts"],"names":[],"mappings":"AACA,OAAO,EACL,wBAAwB,EAGxB,CAAC,EACD,gBAAgB,GAEjB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAA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,GAAG,KAAK,CAAC,KAAK,KAAK,SAAS,CAAA;IACxC,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAA;IAC/F,MAAM,IAAI,GACR,OAAO,CAAC,MAAM,KAAK,CAAC;QAClB,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC;QAC1D,CAAC,CAAC,IAAI,KAAK,OAAO;YAChB,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,MAAM,CAAC;YAC7B,CAAC,CAAC,IAAI,KAAK,OAAO;gBAChB,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,KAAK,CAAC;gBAC5B,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,MAAM,CAAC,CAAA;IAEpC,OAAO,OAAO,CACZ,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,EAAE,WAAW,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,CAAC,UAAU,EAAE,EAC1D,KAAK,EACL,WAAW,CAAC,gBAAgB,EAAE,KAAK,CAAC,KAAK,CAAC,EAC1C,IAAI,CACL,CAAA;AACH,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { CtaBlock } from '@cogenta/blocks';
|
|
2
2
|
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
3
|
/**
|
|
4
|
-
* The
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* The invitation to get in touch, set the way a studio sets its contact
|
|
5
|
+
* line: a short title and a sentence, then the first action as a very large
|
|
6
|
+
* link in the display width, underlined in the one signal colour. Any further
|
|
7
|
+
* action follows as ordinary underlined words. No box, no band, no button.
|
|
8
8
|
*/
|
|
9
9
|
export declare function renderCta(block: CtaBlock, ctx: RenderContext): HtmlElement;
|
|
10
10
|
//# sourceMappingURL=cta.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cta.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/cta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,
|
|
1
|
+
{"version":3,"file":"cta.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/cta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAIL,KAAK,WAAW,EAGhB,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAA;AAG3B;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CA8B1E"}
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
import { actionList, blockHeadingTag, h, heading, } from '@cogenta/theme-kit';
|
|
1
|
+
import { actionLink, actionList, blockHeadingTag, h, heading, } from '@cogenta/theme-kit';
|
|
2
|
+
import { section } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
* The
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* The invitation to get in touch, set the way a studio sets its contact
|
|
5
|
+
* line: a short title and a sentence, then the first action as a very large
|
|
6
|
+
* link in the display width, underlined in the one signal colour. Any further
|
|
7
|
+
* action follows as ordinary underlined words. No box, no band, no button.
|
|
7
8
|
*/
|
|
8
9
|
export function renderCta(block, ctx) {
|
|
9
|
-
|
|
10
|
+
const [first, ...rest] = block.actions;
|
|
11
|
+
const lead = first === undefined
|
|
10
12
|
? null
|
|
11
|
-
:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
: (() => {
|
|
14
|
+
const link = actionLink(ctx, first);
|
|
15
|
+
return { ...link, attrs: { ...link.attrs, class: 'cg-action cg-contact__link' } };
|
|
16
|
+
})();
|
|
17
|
+
return section('section', 'cta', 'cg-contact', {}, 'div', h('div', { class: 'cg-contact__copy' }, heading(blockHeadingTag('cta') ?? 'h2', { class: 'cg-contact__title', 'data-field': 'title' }, block.title), block.text === undefined
|
|
18
|
+
? null
|
|
19
|
+
: h('p', { class: 'cg-contact__text', 'data-field': 'text' }, block.text)), lead === null ? null : h('p', { class: 'cg-contact__lead' }, lead), actionList(ctx, rest, block.title));
|
|
15
20
|
}
|
|
16
21
|
//# 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,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,MAAM,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,OAAO,CAAA;IACtC,MAAM,IAAI,GACR,KAAK,KAAK,SAAS;QACjB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,GAAG,EAAE;YACJ,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;YACnC,OAAO,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,4BAA4B,EAAE,EAAE,CAAA;QACnF,CAAC,CAAC,EAAE,CAAA;IACV,OAAO,OAAO,CACZ,SAAS,EACT,KAAK,EACL,YAAY,EACZ,EAAE,EACF,KAAK,EACL,CAAC,CACC,KAAK,EACL,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAC7B,OAAO,CACL,eAAe,CAAC,KAAK,CAAC,IAAI,IAAI,EAC9B,EAAE,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,OAAO,EAAE,EACrD,KAAK,CAAC,KAAK,CACZ,EACD,KAAK,CAAC,IAAI,KAAK,SAAS;QACtB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,CAC5E,EACD,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAAE,IAAI,CAAC,EAClE,UAAU,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,CACnC,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,20 +1,15 @@
|
|
|
1
1
|
import { aspectRatio, h } from '@cogenta/theme-kit';
|
|
2
|
+
import { section } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
+
* A film or a recording from a third party, the size a project image would
|
|
5
|
+
* be: columns 3 to 10 at the block's ratio.
|
|
4
6
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* The theme ships no consent *button*, because it ships no JavaScript:
|
|
12
|
-
* granting consent is a site-wide decision that belongs to the consent
|
|
13
|
-
* layer, not to a block. The card carries a bracketed provider tag in the
|
|
14
|
-
* mono register — `[ youtube ]` — the theme's own visual shorthand for
|
|
15
|
-
* "something external belongs here".
|
|
7
|
+
* Nothing here contacts a third party before the visitor consents: when
|
|
8
|
+
* `consentRequired` is set, or the provider has no cookie-free frame source,
|
|
9
|
+
* a notice renders in the frame's place instead of an `<iframe>`, holding the
|
|
10
|
+
* same shape: a hairline frame, a small label, one sentence and one arrow
|
|
11
|
+
* link. No preconnect, no thumbnail fetched from the provider.
|
|
16
12
|
*/
|
|
17
|
-
/** `null` means "this provider has no embeddable frame we trust". */
|
|
18
13
|
function frameSource(provider, rawUrl) {
|
|
19
14
|
const url = URL.parse(rawUrl);
|
|
20
15
|
if (url === null)
|
|
@@ -22,8 +17,6 @@ function frameSource(provider, rawUrl) {
|
|
|
22
17
|
const segments = url.pathname.split('/').filter((segment) => segment !== '');
|
|
23
18
|
switch (provider) {
|
|
24
19
|
case 'youtube': {
|
|
25
|
-
// `youtube-nocookie.com` is the privacy-preserving host, and the only one
|
|
26
|
-
// this theme will point an iframe at.
|
|
27
20
|
const id = url.hostname.endsWith('youtu.be')
|
|
28
21
|
? segments[0]
|
|
29
22
|
: (url.searchParams.get('v') ?? segments[1]);
|
|
@@ -46,43 +39,35 @@ function frameSource(provider, rawUrl) {
|
|
|
46
39
|
case 'soundcloud':
|
|
47
40
|
return `https://w.soundcloud.com/player/?url=${encodeURIComponent(rawUrl)}`;
|
|
48
41
|
default:
|
|
49
|
-
// bluesky, mastodon, other: a post embed is a script tag, which this
|
|
50
|
-
// theme does not load. The link card is the rendering.
|
|
51
42
|
return null;
|
|
52
43
|
}
|
|
53
44
|
}
|
|
54
|
-
function
|
|
55
|
-
return h('div', { class: 'cg-
|
|
56
|
-
class: 'cg-embed__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',
|
|
57
48
|
href: ctx.link(block.url),
|
|
58
49
|
rel: 'noopener noreferrer nofollow',
|
|
59
50
|
}, ctx.t('embed.open', { provider: block.provider })));
|
|
60
51
|
}
|
|
61
52
|
export function renderEmbed(block, ctx) {
|
|
62
53
|
const source = block.consentRequired ? null : frameSource(block.provider, block.url);
|
|
63
|
-
// Video providers are 16:9 unless the editor framed them otherwise; without a
|
|
64
|
-
// ratio the frame would collapse and shift the layout as it loads.
|
|
65
54
|
const ratio = aspectRatio(block.ratio) ?? '16 / 9';
|
|
66
|
-
return
|
|
67
|
-
class: 'cg-block cg-embed',
|
|
68
|
-
'data-block': 'embed',
|
|
55
|
+
return section('div', 'embed', 'cg-embed', {
|
|
69
56
|
'data-provider': block.provider,
|
|
70
57
|
'data-consent': block.consentRequired ? 'required' : 'not-required',
|
|
71
58
|
style: `--cg-ratio:${ratio}`,
|
|
72
|
-
}, source === null
|
|
73
|
-
?
|
|
59
|
+
}, 'div', h('div', { class: 'cg-embed__frame' }, source === null
|
|
60
|
+
? notice(block, ctx, block.consentRequired
|
|
74
61
|
? ctx.t('embed.consentRequired', { provider: block.provider })
|
|
75
62
|
: ctx.t('embed.unsupported', { provider: block.provider }))
|
|
76
63
|
: h('iframe', {
|
|
77
|
-
class: 'cg-
|
|
64
|
+
class: 'cg-embed__player',
|
|
78
65
|
src: source,
|
|
79
|
-
// An iframe with no accessible name is announced as "frame" and
|
|
80
|
-
// nothing else. WCAG 4.1.2, and the single most common embed defect.
|
|
81
66
|
title: ctx.t('embed.title', { provider: block.provider }),
|
|
82
67
|
loading: 'lazy',
|
|
83
68
|
referrerpolicy: 'strict-origin-when-cross-origin',
|
|
84
69
|
allow: 'accelerometer; clipboard-write; encrypted-media; picture-in-picture; fullscreen',
|
|
85
70
|
allowfullscreen: true,
|
|
86
|
-
}));
|
|
71
|
+
})));
|
|
87
72
|
}
|
|
88
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,EAAE,WAAW,EAAoB,CAAC,EAAsB,MAAM,oBAAoB,CAAA;AACzF,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC;;;;;;;;;GASG;AACH,SAAS,WAAW,CAAC,QAAgC,EAAE,MAAc;IACnE,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IAC7B,IAAI,GAAG,KAAK,IAAI;QAAE,OAAO,IAAI,CAAA;IAC7B,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,KAAK,EAAE,CAAC,CAAA;IAE5E,QAAQ,QAAQ,EAAE,CAAC;QAC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,EACL,CAAC,CACC,KAAK,EACL,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAC5B,MAAM,KAAK,IAAI;QACb,CAAC,CAAC,MAAM,CACJ,KAAK,EACL,GAAG,EACH,KAAK,CAAC,eAAe;YACnB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,uBAAuB,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;YAC9D,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,mBAAmB,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAC7D;QACH,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;YACV,KAAK,EAAE,kBAAkB;YACzB,GAAG,EAAE,MAAM;YACX,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,aAAa,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;YACzD,OAAO,EAAE,MAAM;YACf,cAAc,EAAE,iCAAiC;YACjD,KAAK,EACH,iFAAiF;YACnF,eAAe,EAAE,IAAI;SACtB,CAAC,CACP,CACF,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,EAIhB,KAAK,aAAa,EAEnB,MAAM,oBAAoB,CAAA;AAmB3B,wBAAgB,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAgB1E"}
|
|
@@ -1,23 +1,18 @@
|
|
|
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. A CSS-drawn plus mark (rotated to a cross on `[open]`) replaces
|
|
12
|
-
* the native marker rather than a chevron — the theme's own vocabulary of
|
|
13
|
-
* shapes, kept purely visual.
|
|
4
|
+
* Questions a client asks before a project starts, set open: the label in
|
|
5
|
+
* the first three columns, and from the fourth each question in the display
|
|
6
|
+
* width with its answer beside it on a wide screen, divided by hairlines.
|
|
7
|
+
* Nothing is hidden behind a disclosure: a short set of answers is read
|
|
8
|
+
* whole. (`accordion` is the collapsible form of the same content.)
|
|
14
9
|
*/
|
|
15
|
-
function renderItem(item, ctx) {
|
|
16
|
-
return h('
|
|
10
|
+
function renderItem(item, ctx, tag) {
|
|
11
|
+
return h('div', { class: 'cg-answers__item' }, heading(tag, { class: 'cg-answers__question' }, item.question), h('div', { class: 'cg-answers__answer' }, renderRichText(ctx, item.answer)));
|
|
17
12
|
}
|
|
18
13
|
export function renderFaq(block, ctx) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
const titled = block.title !== undefined;
|
|
15
|
+
const tag = nestedHeadingTag('faq', titled);
|
|
16
|
+
return section('section', 'faq', 'cg-answers cg-split', { 'data-titled': titled ? 'true' : 'false' }, 'div', sectionHead('faq', block.title), h('div', { class: 'cg-answers__items' }, block.items.map((item) => renderItem(item, ctx, tag))));
|
|
22
17
|
}
|
|
23
18
|
//# 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,EAGL,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,UAAU,CAAC,IAAa,EAAE,GAAkB,EAAE,GAAe;IACpE,OAAO,CAAC,CACN,KAAK,EACL,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAC7B,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,sBAAsB,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,EAC9D,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE,EAAE,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAC5E,CAAA;AACH,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,KAAe,EAAE,GAAkB;IAC3D,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,KAAK,SAAS,CAAA;IACxC,MAAM,GAAG,GAAG,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;IAC3C,OAAO,OAAO,CACZ,SAAS,EACT,KAAK,EACL,qBAAqB,EACrB,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,EAC5C,KAAK,EACL,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,EAC/B,CAAC,CACC,KAAK,EACL,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAC9B,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 +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;AAsC3B,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAiB1F"}
|