@cogenta/theme-canonical 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 +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/render/arrow-link.d.ts +11 -0
- package/dist/src/render/arrow-link.d.ts.map +1 -0
- package/dist/src/render/arrow-link.js +29 -0
- package/dist/src/render/arrow-link.js.map +1 -0
- package/dist/src/render/blocks/collection-list.d.ts +15 -5
- package/dist/src/render/blocks/collection-list.d.ts.map +1 -1
- package/dist/src/render/blocks/collection-list.js +36 -13
- package/dist/src/render/blocks/collection-list.js.map +1 -1
- package/dist/src/render/blocks/embed.d.ts.map +1 -1
- package/dist/src/render/blocks/embed.js +3 -2
- package/dist/src/render/blocks/embed.js.map +1 -1
- package/dist/src/render/blocks/gallery.d.ts.map +1 -1
- package/dist/src/render/blocks/gallery.js +4 -1
- package/dist/src/render/blocks/gallery.js.map +1 -1
- package/dist/src/render/blocks/hero.d.ts.map +1 -1
- package/dist/src/render/blocks/hero.js +9 -2
- package/dist/src/render/blocks/hero.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 -4
- package/dist/src/render/blocks/pricing-table.js.map +1 -1
- package/dist/src/render/chrome.d.ts +40 -1
- package/dist/src/render/chrome.d.ts.map +1 -1
- package/dist/src/render/chrome.js +103 -71
- package/dist/src/render/chrome.js.map +1 -1
- package/dist/src/render/dates.d.ts +9 -0
- package/dist/src/render/dates.d.ts.map +1 -0
- package/dist/src/render/dates.js +16 -0
- package/dist/src/render/dates.js.map +1 -0
- package/dist/src/render/render-block.d.ts.map +1 -1
- package/dist/src/render/render-block.js +7 -1
- package/dist/src/render/render-block.js.map +1 -1
- package/dist/src/render/strings.d.ts +25 -0
- package/dist/src/render/strings.d.ts.map +1 -0
- package/dist/src/render/strings.js +26 -0
- package/dist/src/render/strings.js.map +1 -0
- package/dist/src/render/term-archive.d.ts +5 -5
- package/dist/src/render/term-archive.d.ts.map +1 -1
- package/dist/src/render/term-archive.js +14 -12
- package/dist/src/render/term-archive.js.map +1 -1
- package/dist/src/render/widget-areas.d.ts +20 -0
- package/dist/src/render/widget-areas.d.ts.map +1 -0
- package/dist/src/render/widget-areas.js +40 -0
- package/dist/src/render/widget-areas.js.map +1 -0
- package/package.json +5 -5
- package/src/index.ts +1 -0
- package/src/render/arrow-link.ts +27 -0
- package/src/render/blocks/collection-list.ts +53 -15
- package/src/render/blocks/embed.ts +3 -2
- package/src/render/blocks/gallery.ts +4 -1
- package/src/render/blocks/hero.ts +9 -2
- package/src/render/blocks/pricing-table.ts +22 -4
- package/src/render/chrome.ts +156 -70
- package/src/render/dates.ts +14 -0
- package/src/render/render-block.ts +6 -0
- package/src/render/strings.ts +30 -0
- package/src/render/term-archive.ts +54 -32
- package/src/render/widget-areas.ts +44 -0
- package/src/styles/archive.css +66 -20
- package/src/styles/base.css +266 -680
- package/src/styles/blocks.css +678 -811
- package/src/styles/chrome.css +469 -0
- package/src/styles/listings.css +183 -0
- package/src/styles/theme.css +28 -14
- package/src/styles/tokens.css +192 -205
- package/src/styles/utility.css +295 -0
- package/src/styles/widgets.css +1064 -0
- package/tokens.json +15 -15
|
@@ -1,82 +1,114 @@
|
|
|
1
|
-
import { escapeAttribute, escapeText, renderBrandMark, renderSocialLinks, renderThemeToggle, serialize, } from '@cogenta/theme-kit';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (link.href === null)
|
|
31
|
-
return `<li><span${titleAttr}>${label}</span></li>`;
|
|
32
|
-
const href = escapeAttribute(link.href);
|
|
33
|
-
const target = link.openInNewTab ? ' target="_blank" rel="noopener"' : '';
|
|
34
|
-
return `<li><a href="${href}"${target}${titleAttr}>${label}</a></li>`;
|
|
35
|
-
})
|
|
36
|
-
.join('');
|
|
37
|
-
return items === '' ? '' : `<ul class="cg-menu">${items}</ul>`;
|
|
1
|
+
import { escapeAttribute, escapeText, renderBrandMark, renderFooterWidgets, renderSocialLinks, renderThemeToggle, serialize, } from '@cogenta/theme-kit';
|
|
2
|
+
import { word } from './strings.js';
|
|
3
|
+
/** Links a visitor can follow, plus the unlinked headings that name a column. */
|
|
4
|
+
function usable(links) {
|
|
5
|
+
return links.filter((link) => link.href !== null || link.kind === 'submenu-placeholder');
|
|
6
|
+
}
|
|
7
|
+
function linkItem(link) {
|
|
8
|
+
const label = escapeText(link.label);
|
|
9
|
+
const titleAttr = link.title === null ? '' : ` title="${escapeAttribute(link.title)}"`;
|
|
10
|
+
if (link.href === null)
|
|
11
|
+
return `<li><span${titleAttr}>${label}</span></li>`;
|
|
12
|
+
const target = link.openInNewTab ? ' target="_blank" rel="noopener"' : '';
|
|
13
|
+
return `<li><a href="${escapeAttribute(link.href)}"${target}${titleAttr}>${label}</a></li>`;
|
|
14
|
+
}
|
|
15
|
+
/** The footer menu, split into columns at each unlinked heading. */
|
|
16
|
+
export function footerGroups(links) {
|
|
17
|
+
const groups = [];
|
|
18
|
+
for (const link of usable(links)) {
|
|
19
|
+
if (link.kind === 'submenu-placeholder' && link.href === null) {
|
|
20
|
+
groups.push({ heading: link.label, links: [] });
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
const current = groups[groups.length - 1];
|
|
24
|
+
if (current === undefined)
|
|
25
|
+
groups.push({ heading: null, links: [link] });
|
|
26
|
+
else
|
|
27
|
+
current.links.push(link);
|
|
28
|
+
}
|
|
29
|
+
return groups.filter((group) => group.links.length > 0);
|
|
38
30
|
}
|
|
39
|
-
/**
|
|
40
|
-
function
|
|
41
|
-
|
|
31
|
+
/** `footerNote` as paragraphs at blank lines, each keeping its own line breaks. */
|
|
32
|
+
function renderFooterNote(note) {
|
|
33
|
+
const paragraphs = note
|
|
34
|
+
.replace(/\r\n?/g, '\n')
|
|
35
|
+
.split(/\n\s*\n/)
|
|
36
|
+
.map((paragraph) => paragraph
|
|
37
|
+
.split('\n')
|
|
38
|
+
.map((line) => line.trim())
|
|
39
|
+
.filter((line) => line !== ''))
|
|
40
|
+
.filter((lines) => lines.length > 0);
|
|
41
|
+
if (paragraphs.length === 0)
|
|
42
42
|
return '';
|
|
43
|
-
return
|
|
44
|
-
|
|
43
|
+
return `<div class="cg-site-footer__about">${paragraphs
|
|
44
|
+
.map((lines) => `<p class="cg-site-footer__note">${lines.map((line) => escapeText(line)).join('<br>')}</p>`)
|
|
45
|
+
.join('')}</div>`;
|
|
45
46
|
}
|
|
46
|
-
|
|
47
|
-
const siteName =
|
|
48
|
-
const
|
|
49
|
-
const footerNav = renderNavLinks(input.footerNav);
|
|
47
|
+
function renderHeader(input) {
|
|
48
|
+
const siteName = escapeText(input.site.name);
|
|
49
|
+
const home = escapeAttribute(input.homeHref);
|
|
50
50
|
// The uploaded logo replaces the wordmark, and only the wordmark: the
|
|
51
|
-
// footer keeps the site's name in text, so a
|
|
52
|
-
//
|
|
51
|
+
// footer keeps the site's name in text, so a page whose logo fails to load
|
|
52
|
+
// still names the site.
|
|
53
53
|
const mark = renderBrandMark(input.brand, { className: 'cg-site-header__logo' }) ?? siteName;
|
|
54
|
-
const
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
54
|
+
const links = usable(input.headerNav).map(linkItem).join('');
|
|
55
|
+
const actionHref = input.headerAction === undefined ? '' : escapeAttribute(input.headerAction.href);
|
|
56
|
+
const actionLabel = input.headerAction === undefined ? '' : escapeText(input.headerAction.label);
|
|
57
|
+
// On a phone the bar holds the name, the menu control and the light/dark
|
|
58
|
+
// control; the action moves to the foot of the menu panel. It is the same
|
|
59
|
+
// link twice in the source, and the stylesheet shows exactly one of them at
|
|
60
|
+
// any width (`display: none` hides the other from assistive technology
|
|
61
|
+
// too), so it is never announced twice.
|
|
62
|
+
const menuAction = input.headerAction === undefined
|
|
63
|
+
? ''
|
|
64
|
+
: `<p class="cg-site-header__menu-action"><a class="cg-action" data-emphasis="primary" href="${actionHref}">${actionLabel}</a></p>`;
|
|
65
|
+
const menu = links === ''
|
|
66
|
+
? ''
|
|
67
|
+
: `<input type="checkbox" id="cg-nav-toggle" class="cg-nav-toggle" aria-controls="cg-site-nav">` +
|
|
68
|
+
`<label for="cg-nav-toggle" class="cg-nav-toggle__label">${escapeText(word(input.locale, 'menu'))}</label>` +
|
|
69
|
+
`<nav class="cg-site-header__nav" id="cg-site-nav" aria-label="${escapeAttribute(word(input.locale, 'primaryNavigation'))}"><ul class="cg-menu">${links}</ul>${menuAction}</nav>`;
|
|
70
|
+
const action = input.headerAction === undefined
|
|
71
|
+
? ''
|
|
72
|
+
: `<a class="cg-action cg-site-header__action" data-emphasis="primary" href="${actionHref}">${actionLabel}</a>`;
|
|
73
|
+
const toggle = serialize(renderThemeToggle(input.locale, { className: 'cg-theme-toggle' }));
|
|
74
|
+
return (`<header class="cg-site-header" data-nav="${links === '' ? 'none' : 'links'}"><div class="cg-site-header__inner">` +
|
|
75
|
+
`<a class="cg-site-header__home" href="${home}">${mark}</a>` +
|
|
76
|
+
menu +
|
|
77
|
+
`<div class="cg-site-header__end">${action}${toggle}</div>` +
|
|
78
|
+
`</div></header>`);
|
|
79
|
+
}
|
|
80
|
+
function renderFooter(input) {
|
|
81
|
+
const siteName = escapeText(input.site.name);
|
|
62
82
|
const tagline = input.tagline === undefined
|
|
63
83
|
? ''
|
|
64
84
|
: `<p class="cg-site-footer__tagline">${escapeText(input.tagline)}</p>`;
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const
|
|
85
|
+
const note = input.footerNote === undefined ? '' : renderFooterNote(input.footerNote);
|
|
86
|
+
const socialLinks = renderSocialLinks(input.social, {
|
|
87
|
+
className: 'cg-site-footer__social',
|
|
88
|
+
itemClassName: 'cg-site-footer__social-item',
|
|
89
|
+
});
|
|
90
|
+
const social = socialLinks === null ? '' : serialize(socialLinks);
|
|
91
|
+
const groups = footerGroups(input.footerNav);
|
|
92
|
+
const nav = groups.length === 0
|
|
72
93
|
? ''
|
|
73
|
-
: `<
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
94
|
+
: `<nav class="cg-site-footer__nav" aria-label="${escapeAttribute(word(input.locale, 'footerNavigation'))}" data-columns="${Math.min(groups.length, 3)}">${groups
|
|
95
|
+
.map((group) => `<div class="cg-site-footer__group">${group.heading === null
|
|
96
|
+
? ''
|
|
97
|
+
: `<p class="cg-site-footer__heading">${escapeText(group.heading)}</p>`}<ul class="cg-menu">${group.links.map(linkItem).join('')}</ul></div>`)
|
|
98
|
+
.join('')}</nav>`;
|
|
99
|
+
const widgets = renderFooterWidgets(input.widgets, {
|
|
100
|
+
className: 'cg-site-footer__widgets',
|
|
101
|
+
headingLevel: 'h2',
|
|
102
|
+
});
|
|
103
|
+
const year = new Date().getFullYear();
|
|
104
|
+
return (`<footer class="cg-site-footer"><div class="cg-site-footer__inner">` +
|
|
105
|
+
`<div class="cg-site-footer__identity"><p class="cg-site-footer__name">${siteName}</p>${tagline}${note}${social}</div>` +
|
|
106
|
+
nav +
|
|
107
|
+
(widgets === null ? '' : serialize(widgets)) +
|
|
108
|
+
`<div class="cg-site-footer__legal"><p class="cg-site-footer__copyright">© ${year} ${siteName}</p>${input.brandingHtml}</div>` +
|
|
109
|
+
`</div></footer>`);
|
|
110
|
+
}
|
|
111
|
+
export function renderChrome(input) {
|
|
112
|
+
return { header: renderHeader(input), footer: renderFooter(input) };
|
|
81
113
|
}
|
|
82
114
|
//# sourceMappingURL=chrome.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chrome.js","sourceRoot":"","sources":["../../../src/render/chrome.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,eAAe,EACf,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,SAAS,GACV,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"chrome.js","sourceRoot":"","sources":["../../../src/render/chrome.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,eAAe,EACf,UAAU,EACV,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,SAAS,GACV,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAwCnC,iFAAiF;AACjF,SAAS,MAAM,CAAC,KAA+B;IAC7C,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,qBAAqB,CAAC,CAAA;AAC1F,CAAC;AAED,SAAS,QAAQ,CAAC,IAAmB;IACnC,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACpC,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAA;IACtF,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI;QAAE,OAAO,YAAY,SAAS,IAAI,KAAK,cAAc,CAAA;IAC3E,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC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,YAAY,EAAE,IAAI;KACnB,CAAC,CAAA;IACF,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAA;IAErC,OAAO,CACL,oEAAoE;QACpE,yEAAyE,QAAQ,OAAO,OAAO,GAAG,IAAI,GAAG,MAAM,QAAQ;QACvH,GAAG;QACH,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAC5C,6EAA6E,IAAI,IAAI,QAAQ,OAAO,KAAK,CAAC,YAAY,QAAQ;QAC9H,iBAAiB,CAClB,CAAA;AACH,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAkB;IAC7C,OAAO,EAAE,MAAM,EAAE,YAAY,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,KAAK,CAAC,EAAE,CAAA;AACrE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one date format of this theme — `Intl`'s long date, in the page's own
|
|
3
|
+
* language — shared by the collection list, the term archive and the entry
|
|
4
|
+
* header (`renderEntryHeader` formats the same way), so a date reads alike on
|
|
5
|
+
* every page. An invalid locale or date falls back to the ISO day, a true
|
|
6
|
+
* answer rather than a thrown error.
|
|
7
|
+
*/
|
|
8
|
+
export declare function formatEntryDate(iso: string, locale: string): string;
|
|
9
|
+
//# sourceMappingURL=dates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dates.d.ts","sourceRoot":"","sources":["../../../src/render/dates.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAMnE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one date format of this theme — `Intl`'s long date, in the page's own
|
|
3
|
+
* language — shared by the collection list, the term archive and the entry
|
|
4
|
+
* header (`renderEntryHeader` formats the same way), so a date reads alike on
|
|
5
|
+
* every page. An invalid locale or date falls back to the ISO day, a true
|
|
6
|
+
* answer rather than a thrown error.
|
|
7
|
+
*/
|
|
8
|
+
export function formatEntryDate(iso, locale) {
|
|
9
|
+
try {
|
|
10
|
+
return new Intl.DateTimeFormat(locale, { dateStyle: 'long' }).format(new Date(iso));
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return iso.slice(0, 10);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=dates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dates.js","sourceRoot":"","sources":["../../../src/render/dates.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW,EAAE,MAAc;IACzD,IAAI,CAAC;QACH,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;IACrF,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IACzB,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-block.d.ts","sourceRoot":"","sources":["../../../src/render/render-block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAoB,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAC5F,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"render-block.d.ts","sourceRoot":"","sources":["../../../src/render/render-block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAoB,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAC5F,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,iBAAiB,EAEjB,iBAAiB,EAEjB,YAAY,EAEb,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAkBzD,OAAO,EAAE,KAAK,WAAW,EAAK,MAAM,WAAW,CAAA;AAE/C;;;;;GAKG;AACH,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAA;AAE7D,wBAAgB,WAAW,CACzB,KAAK,EAAE,eAAe,EACtB,GAAG,EAAE,aAAa,EAClB,OAAO,GAAE,cAAmB,EAC5B,QAAQ,CAAC,EAAE,aAAa,GACvB,WAAW,GAAG,IAAI,CAmBpB;AA0DD,wBAAgB,UAAU,CACxB,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,aAAa,EAClB,OAAO,GAAE,cAAmB,EAC5B,QAAQ,CAAC,EAAE,aAAa,GACvB,WAAW,CAkBb"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VOCABULARY_NAMES } from '@cogenta/blocks';
|
|
2
|
-
import { pageHasOwnHeading, renderEntryHeader, resolveBlockForRender, withBlockKey, withBlockVariant, } from '@cogenta/theme-kit';
|
|
2
|
+
import { pageHasOwnHeading, providedBlockNode, renderEntryHeader, resolveBlockForRender, withBlockKey, withBlockVariant, } from '@cogenta/theme-kit';
|
|
3
3
|
import { renderAccordion } from './blocks/accordion.js';
|
|
4
4
|
import { renderCollectionList } from './blocks/collection-list.js';
|
|
5
5
|
import { renderCta } from './blocks/cta.js';
|
|
@@ -20,6 +20,12 @@ import { renderTestimonial } from './blocks/testimonial.js';
|
|
|
20
20
|
import { h } from './html.js';
|
|
21
21
|
export { pageHasOwnHeading, renderEntryHeader, withBlockKey };
|
|
22
22
|
export function renderBlock(block, ctx, entries = {}, registry) {
|
|
23
|
+
// A block a plugin provides arrives already rendered by the host, in a
|
|
24
|
+
// process of its own (contract D theme@1.7). Nothing else in this theme
|
|
25
|
+
// needs to know such blocks exist.
|
|
26
|
+
const provided = providedBlockNode(block, ctx);
|
|
27
|
+
if (provided !== null)
|
|
28
|
+
return withBlockVariant(provided, block.variant);
|
|
23
29
|
// `block`'s type says `VocabularyBlock`, but the value crossing this
|
|
24
30
|
// boundary from stored content is not always literally one of the twelve —
|
|
25
31
|
// `theme-render.ts` cannot know at compile time what a block zone holds.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-block.js","sourceRoot":"","sources":["../../../src/render/render-block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,gBAAgB,EAAwB,MAAM,iBAAiB,CAAA;AAC5F,OAAO,EAGL,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,GACjB,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAm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,KAAK,CAAC;QAClD,CAAC,CAAC,IAAI,EACR,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACxB,YAAY,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,CACrE,CACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The few words this theme prints on its own, beyond `THEME_STRINGS`
|
|
3
|
+
* (`@cogenta/theme-kit`): the name of the menu control and of the two
|
|
4
|
+
* navigation landmarks, and the label over a recommended plan. The same two
|
|
5
|
+
* languages as the shared table, resolved the same way (`fr-CA` is French,
|
|
6
|
+
* anything unknown is English).
|
|
7
|
+
*/
|
|
8
|
+
declare const WORDS: {
|
|
9
|
+
readonly en: {
|
|
10
|
+
readonly menu: 'Menu';
|
|
11
|
+
readonly primaryNavigation: 'Primary';
|
|
12
|
+
readonly footerNavigation: 'Footer';
|
|
13
|
+
readonly recommended: 'Recommended';
|
|
14
|
+
};
|
|
15
|
+
readonly fr: {
|
|
16
|
+
readonly menu: 'Menu';
|
|
17
|
+
readonly primaryNavigation: 'Principale';
|
|
18
|
+
readonly footerNavigation: 'Pied de page';
|
|
19
|
+
readonly recommended: 'Recommandé';
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export type ThemeWord = keyof (typeof WORDS)['en'];
|
|
23
|
+
export declare function word(locale: string, key: ThemeWord): string;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=strings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../../src/render/strings.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,QAAA,MAAM,KAAK;aACT,EAAE;iBACA,IAAI,EAAE,MAAM;iBACZ,iBAAiB,EAAE,SAAS;iBAC5B,gBAAgB,EAAE,QAAQ;iBAC1B,WAAW,EAAE,aAAa;;aAE5B,EAAE;iBACA,IAAI,EAAE,MAAM;iBACZ,iBAAiB,EAAE,YAAY;iBAC/B,gBAAgB,EAAE,cAAc;iBAChC,WAAW,EAAE,YAAY;;CAEnB,CAAA;AAEV,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,KAAK,CAAC,CAAC,IAAI,CAAC,CAAA;AAElD,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,GAAG,MAAM,CAE3D"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { themeLocaleFor } from '@cogenta/theme-kit';
|
|
2
|
+
/**
|
|
3
|
+
* The few words this theme prints on its own, beyond `THEME_STRINGS`
|
|
4
|
+
* (`@cogenta/theme-kit`): the name of the menu control and of the two
|
|
5
|
+
* navigation landmarks, and the label over a recommended plan. The same two
|
|
6
|
+
* languages as the shared table, resolved the same way (`fr-CA` is French,
|
|
7
|
+
* anything unknown is English).
|
|
8
|
+
*/
|
|
9
|
+
const WORDS = {
|
|
10
|
+
en: {
|
|
11
|
+
menu: 'Menu',
|
|
12
|
+
primaryNavigation: 'Primary',
|
|
13
|
+
footerNavigation: 'Footer',
|
|
14
|
+
recommended: 'Recommended',
|
|
15
|
+
},
|
|
16
|
+
fr: {
|
|
17
|
+
menu: 'Menu',
|
|
18
|
+
primaryNavigation: 'Principale',
|
|
19
|
+
footerNavigation: 'Pied de page',
|
|
20
|
+
recommended: 'Recommandé',
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
export function word(locale, key) {
|
|
24
|
+
return WORDS[themeLocaleFor(locale)][key];
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=strings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strings.js","sourceRoot":"","sources":["../../../src/render/strings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAEnD;;;;;;GAMG;AAEH,MAAM,KAAK,GAAG;IACZ,EAAE,EAAE;QACF,IAAI,EAAE,MAAM;QACZ,iBAAiB,EAAE,SAAS;QAC5B,gBAAgB,EAAE,QAAQ;QAC1B,WAAW,EAAE,aAAa;KAC3B;IACD,EAAE,EAAE;QACF,IAAI,EAAE,MAAM;QACZ,iBAAiB,EAAE,YAAY;QAC/B,gBAAgB,EAAE,cAAc;QAChC,WAAW,EAAE,YAAY;KAC1B;CACO,CAAA;AAIV,MAAM,UAAU,IAAI,CAAC,MAAc,EAAE,GAAc;IACjD,OAAO,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAC3C,CAAC"}
|
|
@@ -2,11 +2,11 @@ import { type HtmlElement, type TermArchiveInput } from '@cogenta/theme-kit';
|
|
|
2
2
|
/**
|
|
3
3
|
* The taxonomy-term archive (contract D `theme@1.3`).
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
5
|
+
* A header in the page frame (the breadcrumb, the term as the page's title,
|
|
6
|
+
* the sub-terms), then the classified entries as this theme's index: the
|
|
7
|
+
* same `cg-collection`/`cg-entry` markup a `collectionList` block renders in
|
|
8
|
+
* its `list` layout, so an archive of articles reads exactly like a list of
|
|
9
|
+
* articles anywhere else on the site, from one set of rules.
|
|
10
10
|
*/
|
|
11
11
|
export declare function renderTermArchive(input: TermArchiveInput): HtmlElement;
|
|
12
12
|
//# sourceMappingURL=term-archive.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"term-archive.d.ts","sourceRoot":"","sources":["../../../src/render/term-archive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAK,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"term-archive.d.ts","sourceRoot":"","sources":["../../../src/render/term-archive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAK,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAI/E;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,WAAW,CAkEtE"}
|
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
import { h } from '@cogenta/theme-kit';
|
|
2
|
+
import { arrowWords } from './arrow-link.js';
|
|
3
|
+
import { formatEntryDate } from './dates.js';
|
|
2
4
|
/**
|
|
3
5
|
* The taxonomy-term archive (contract D `theme@1.3`).
|
|
4
6
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* A header in the page frame (the breadcrumb, the term as the page's title,
|
|
8
|
+
* the sub-terms), then the classified entries as this theme's index: the
|
|
9
|
+
* same `cg-collection`/`cg-entry` markup a `collectionList` block renders in
|
|
10
|
+
* its `list` layout, so an archive of articles reads exactly like a list of
|
|
11
|
+
* articles anywhere else on the site, from one set of rules.
|
|
10
12
|
*/
|
|
11
13
|
export function renderTermArchive(input) {
|
|
12
|
-
const items = input.entries.map((entry) => h('li', { class: 'cg-entry' }, h('
|
|
14
|
+
const items = input.entries.map((entry) => h('li', { class: 'cg-entry', 'data-picture': 'false' }, h('article', { class: 'cg-entry__body' }, h('h2', { class: 'cg-entry__title' }, entry.href === null
|
|
13
15
|
? entry.title
|
|
14
16
|
: h('a', { class: 'cg-entry__link', href: entry.href }, entry.title)), entry.publishedAt === null
|
|
15
17
|
? null
|
|
16
|
-
: h('time', { class: 'cg-entry__date', datetime: entry.publishedAt }, entry.publishedAt
|
|
17
|
-
return h('main', { class: 'cg-main cg-archive', id: 'cg-main' }, input.ancestors.length === 0
|
|
18
|
+
: h('time', { class: 'cg-entry__date', datetime: entry.publishedAt }, formatEntryDate(entry.publishedAt, input.locale)), entry.summary === null ? null : h('p', { class: 'cg-entry__excerpt' }, entry.summary))));
|
|
19
|
+
return h('main', { class: 'cg-main cg-archive', id: 'cg-main' }, h('div', { class: 'cg-archive__head' }, input.ancestors.length === 0
|
|
18
20
|
? null
|
|
19
21
|
: h('nav', { class: 'cg-archive__breadcrumb', 'aria-label': input.labels.breadcrumb }, h('ol', {}, ...input.ancestors.map((link) => h('li', {}, h('a', { href: link.href }, link.label))))), h('h1', { class: 'cg-page__title' }, input.term.label), input.children.length === 0
|
|
20
22
|
? null
|
|
21
|
-
: h('ul', { class: 'cg-archive__children', 'aria-label': input.labels.subterms }, ...input.children.map((child) => h('li', {}, h('a', { href: child.href }, child.label)))), items.length === 0
|
|
23
|
+
: h('ul', { class: 'cg-archive__children', 'aria-label': input.labels.subterms }, ...input.children.map((child) => h('li', {}, h('a', { href: child.href }, child.label))))), h('section', { class: 'cg-collection cg-archive__list', 'data-layout': 'list' }, items.length === 0
|
|
22
24
|
? h('p', { class: 'cg-collection__empty' }, input.labels.empty)
|
|
23
|
-
: h('ul', { class: 'cg-collection__items' }, ...items), renderPager(input));
|
|
25
|
+
: h('ul', { class: 'cg-collection__items' }, ...items), renderPager(input)));
|
|
24
26
|
}
|
|
25
27
|
/**
|
|
26
28
|
* Previous/next only — never a numbered pager. This renderer is handed the
|
|
@@ -32,8 +34,8 @@ function renderPager(input) {
|
|
|
32
34
|
return null;
|
|
33
35
|
return h('nav', { class: 'cg-archive__pager', 'aria-label': input.labels.pagination }, input.page.previousHref === null
|
|
34
36
|
? null
|
|
35
|
-
: h('a', { rel: 'prev', href: input.page.previousHref }, input.labels.previous), input.page.nextHref === null
|
|
37
|
+
: h('a', { class: 'cg-arrow-link', rel: 'prev', href: input.page.previousHref }, arrowWords(input.labels.previous, 'back')), input.page.nextHref === null
|
|
36
38
|
? null
|
|
37
|
-
: h('a', { rel: 'next', href: input.page.nextHref }, input.labels.next));
|
|
39
|
+
: h('a', { class: 'cg-arrow-link', rel: 'next', href: input.page.nextHref }, arrowWords(input.labels.next)));
|
|
38
40
|
}
|
|
39
41
|
//# sourceMappingURL=term-archive.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"term-archive.js","sourceRoot":"","sources":["../../../src/render/term-archive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,CAAC,EAAyB,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"term-archive.js","sourceRoot":"","sources":["../../../src/render/term-archive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,CAAC,EAAyB,MAAM,oBAAoB,CAAA;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE5C;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAuB;IACvD,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACxC,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,OAAO,EAAE,EAC9C,CAAC,CACC,SAAS,EACT,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAC3B,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAC5B,KAAK,CAAC,IAAI,KAAK,IAAI;QACjB,CAAC,CAAC,KAAK,CAAC,KAAK;QACb,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,CACvE,EACD,KAAK,CAAC,WAAW,KAAK,IAAI;QACxB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,CACC,MAAM,EACN,EAAE,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,KAAK,CAAC,WAAW,EAAE,EACxD,eAAe,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CACjD,EACL,KA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,EAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,EAClE,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAC9B,CACN,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The widget areas this theme names (contract D `theme@1.6`).
|
|
3
|
+
*
|
|
4
|
+
* Exporting `widgetAreas` is what tells the host that this theme draws the
|
|
5
|
+
* footer columns (`footer-1`..`footer-4`) inside its own footer, where
|
|
6
|
+
* `renderChrome` places them between the footer menu and the legal line. The
|
|
7
|
+
* page areas (`content-before`, `content-after`, `sidebar`) are placed by the
|
|
8
|
+
* host in the one `cg-sidebar-layout` markup every theme styles; this theme
|
|
9
|
+
* sets it on its twelve-column grid in `styles/widgets.css`.
|
|
10
|
+
*
|
|
11
|
+
* A third-party theme can copy this file as it is: a theme that adds an area
|
|
12
|
+
* of its own lists it here too, and renders it itself with
|
|
13
|
+
* `renderWidgetArea` from `@cogenta/theme-kit`.
|
|
14
|
+
*/
|
|
15
|
+
export declare const widgetAreas: readonly {
|
|
16
|
+
readonly id: string;
|
|
17
|
+
readonly label: string;
|
|
18
|
+
readonly description?: string;
|
|
19
|
+
}[];
|
|
20
|
+
//# sourceMappingURL=widget-areas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-areas.d.ts","sourceRoot":"","sources":["../../../src/render/widget-areas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,WAAW,EAAE,SAAS;IACjC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAC9B,EAyBA,CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The widget areas this theme names (contract D `theme@1.6`).
|
|
3
|
+
*
|
|
4
|
+
* Exporting `widgetAreas` is what tells the host that this theme draws the
|
|
5
|
+
* footer columns (`footer-1`..`footer-4`) inside its own footer, where
|
|
6
|
+
* `renderChrome` places them between the footer menu and the legal line. The
|
|
7
|
+
* page areas (`content-before`, `content-after`, `sidebar`) are placed by the
|
|
8
|
+
* host in the one `cg-sidebar-layout` markup every theme styles; this theme
|
|
9
|
+
* sets it on its twelve-column grid in `styles/widgets.css`.
|
|
10
|
+
*
|
|
11
|
+
* A third-party theme can copy this file as it is: a theme that adds an area
|
|
12
|
+
* of its own lists it here too, and renders it itself with
|
|
13
|
+
* `renderWidgetArea` from `@cogenta/theme-kit`.
|
|
14
|
+
*/
|
|
15
|
+
export const widgetAreas = [
|
|
16
|
+
{
|
|
17
|
+
id: 'sidebar',
|
|
18
|
+
label: 'Sidebar',
|
|
19
|
+
description: 'Beside an entry, an archive or search results on a wide screen; under the content on a phone and on the home page.',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: 'content-before',
|
|
23
|
+
label: 'Before the content',
|
|
24
|
+
description: 'At the top of the page, under the header.',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: 'content-after',
|
|
28
|
+
label: 'After the content',
|
|
29
|
+
description: 'Under the page’s own content, before the comments.',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: 'footer-1',
|
|
33
|
+
label: 'Footer, column 1',
|
|
34
|
+
description: 'In the footer, between the footer menu and the legal line.',
|
|
35
|
+
},
|
|
36
|
+
{ id: 'footer-2', label: 'Footer, column 2' },
|
|
37
|
+
{ id: 'footer-3', label: 'Footer, column 3' },
|
|
38
|
+
{ id: 'footer-4', label: 'Footer, column 4' },
|
|
39
|
+
];
|
|
40
|
+
//# sourceMappingURL=widget-areas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-areas.js","sourceRoot":"","sources":["../../../src/render/widget-areas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,WAAW,GAIlB;IACJ;QACE,EAAE,EAAE,SAAS;QACb,KAAK,EAAE,SAAS;QAChB,WAAW,EACT,oHAAoH;KACvH;IACD;QACE,EAAE,EAAE,gBAAgB;QACpB,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EAAE,2CAA2C;KACzD;IACD;QACE,EAAE,EAAE,eAAe;QACnB,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EAAE,oDAAoD;KAClE;IACD;QACE,EAAE,EAAE,UAAU;QACd,KAAK,EAAE,kBAAkB;QACzB,WAAW,EAAE,4DAA4D;KAC1E;IACD,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,kBAAkB,EAAE;IAC7C,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,kBAAkB,EAAE;IAC7C,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,kBAAkB,EAAE;CAC9C,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cogenta/theme-canonical",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "The reference Cogenta theme:
|
|
3
|
+
"version": "1.3.3",
|
|
4
|
+
"description": "The reference Cogenta theme: all seventeen vocabulary blocks on a twelve-column grid, set in Instrument Sans and Instrument Serif, accessible, with zero client JavaScript.",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": false,
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"directory": "packages/theme-canonical"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@cogenta/
|
|
43
|
-
"@cogenta/
|
|
44
|
-
"@cogenta/
|
|
42
|
+
"@cogenta/render": "0.3.5",
|
|
43
|
+
"@cogenta/blocks": "1.1.3",
|
|
44
|
+
"@cogenta/theme-kit": "0.5.3"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"astro": "^7.2.1"
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type Child, h, text } from '@cogenta/theme-kit'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The words of a link that ends (or starts) with an arrow.
|
|
5
|
+
*
|
|
6
|
+
* The arrow itself is drawn by the stylesheet, after the last word (or before
|
|
7
|
+
* the first), on a `<span>` that also refuses to break: a long label wraps
|
|
8
|
+
* between its earlier words, and the arrow always travels with a word. A
|
|
9
|
+
* label of one word is that span alone.
|
|
10
|
+
*/
|
|
11
|
+
export function arrowWords(label: string, direction: 'forward' | 'back' = 'forward'): Child[] {
|
|
12
|
+
const trimmed = label.trim()
|
|
13
|
+
if (direction === 'back') {
|
|
14
|
+
const at = trimmed.indexOf(' ')
|
|
15
|
+
if (at === -1) return [h('span', { class: 'cg-arrow-link__start' }, trimmed)]
|
|
16
|
+
return [
|
|
17
|
+
h('span', { class: 'cg-arrow-link__start' }, trimmed.slice(0, at)),
|
|
18
|
+
text(trimmed.slice(at)),
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
const at = trimmed.lastIndexOf(' ')
|
|
22
|
+
if (at === -1) return [h('span', { class: 'cg-arrow-link__end' }, trimmed)]
|
|
23
|
+
return [
|
|
24
|
+
text(trimmed.slice(0, at + 1)),
|
|
25
|
+
h('span', { class: 'cg-arrow-link__end' }, trimmed.slice(at + 1)),
|
|
26
|
+
]
|
|
27
|
+
}
|