@taprootio/site-authoring 0.60.0 → 0.62.0
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/README.md +34 -0
- package/package.json +2 -2
- package/src/appearance-contract.js +54 -1
- package/src/article-appearance.js +19 -0
- package/src/article-appearance.json +9 -0
- package/src/changelog.json +31 -0
- package/src/chrome-additions.js +25 -7
- package/src/chrome-input.js +47 -0
- package/src/cli.js +1 -1
- package/src/content/components.js +21 -6
- package/src/content/media-presentation.js +13 -2
- package/src/content/validate-document.js +2 -0
- package/src/latest-posts-settings.js +78 -0
- package/src/legal-roles.js +121 -0
- package/src/output.js +2 -0
- package/src/page-metadata.js +3 -0
- package/src/presentation-reference.js +12 -5
- package/src/reference-help.js +16 -3
- package/src/session.js +19 -1
- package/src/setting-reference.js +53 -2
- package/src/settings-catalog.js +7 -0
- package/src/site-check-findings.js +8 -3
- package/src/status-warning-paints.js +2 -2
- package/src/template-token-reach.json +16 -8
- package/src/theme-resolve.js +10 -0
- package/src/theme-validation.js +11 -1
- package/src/token-reach.js +2 -1
- package/src/transport.js +15 -2
- package/src/typed-page-reference.js +11 -2
- package/src/typed-pages.js +3 -1
- package/src/verbs/delivery-check.js +31 -10
- package/src/verbs/footer-push.js +33 -7
- package/src/verbs/pages-meta-set.js +10 -1
- package/src/verbs/pages-push.js +12 -4
- package/src/verbs/plan.js +1 -0
- package/src/verbs/pull.js +26 -4
- package/src/verbs/status.js +23 -0
- package/src/verbs/theme-push.js +15 -6
- package/src/verbs/theme-resolve.js +1 -0
- package/src/verbs/validate.js +14 -5
- package/src/workspace-check.js +20 -8
- package/src/workspace-context-usage.js +12 -5
- package/test/fixtures/default-site-theme.json +1 -1
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { SiteAuthoringError } from "./errors.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Legal document roles as the site checks them (`LegalDocumentRoles` and
|
|
5
|
+
* `LegalDocumentPageValidation` in the API), so a creator site learns before a
|
|
6
|
+
* push which role it may use (TR01433).
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export const LEGAL_ROLE_OTHER_NOTICE = "other_notice";
|
|
10
|
+
export const LEGAL_ROLE_MEMBERSHIP_TERMS = "membership_terms";
|
|
11
|
+
|
|
12
|
+
/** The roles a creator site may use. Every other role is Taproot's own. */
|
|
13
|
+
export const CREATOR_LEGAL_ROLES = Object.freeze([LEGAL_ROLE_OTHER_NOTICE, LEGAL_ROLE_MEMBERSHIP_TERMS]);
|
|
14
|
+
|
|
15
|
+
/** Roles only Taproot's platform legal site may use (`LegalDocumentRoles.IsTaprootOwned`). */
|
|
16
|
+
export const TAPROOT_OWNED_LEGAL_ROLES = Object.freeze([
|
|
17
|
+
"platform_terms",
|
|
18
|
+
"privacy_notice",
|
|
19
|
+
"cookie_notice",
|
|
20
|
+
"affiliate_agreement",
|
|
21
|
+
"creator_commerce_terms",
|
|
22
|
+
"creator_merchant_commerce_terms",
|
|
23
|
+
"member_purchase_terms",
|
|
24
|
+
"creator_merchant_member_purchase_terms",
|
|
25
|
+
"free_membership_program_terms",
|
|
26
|
+
"free_membership_join_terms",
|
|
27
|
+
]);
|
|
28
|
+
|
|
29
|
+
/** A membership-terms key is its product slug and this suffix, at `/<product-slug>/membership-terms` (`LegalDocumentRoles`). */
|
|
30
|
+
const MEMBERSHIP_TERMS_KEY_SUFFIX = "-membership-terms";
|
|
31
|
+
const MEMBERSHIP_TERMS_PATH_SEGMENT = "membership-terms";
|
|
32
|
+
|
|
33
|
+
/** The site's document key rule (`LegalDocumentPageValidation.DocumentKeyPattern`). */
|
|
34
|
+
const DOCUMENT_KEY_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/u;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Document keys Taproot reserves for its own roles: the site resolves an other_notice with one of these keys to the
|
|
38
|
+
* Taproot-owned role (`LegalDocumentRoles.Resolve`).
|
|
39
|
+
*/
|
|
40
|
+
export const TAPROOT_RESERVED_LEGAL_KEYS = Object.freeze([
|
|
41
|
+
"terms-of-service",
|
|
42
|
+
"privacy-notice",
|
|
43
|
+
"cookie-notice",
|
|
44
|
+
"affiliate-agreement",
|
|
45
|
+
"creator-commerce-terms",
|
|
46
|
+
"member-purchase-terms",
|
|
47
|
+
"creator-merchant-commerce-terms",
|
|
48
|
+
"creator-merchant-member-purchase-terms",
|
|
49
|
+
"free-membership-program-terms",
|
|
50
|
+
"free-membership-join-terms",
|
|
51
|
+
]);
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* The refusal for a legal source's role and key at its path, or undefined. `platformLegalSite` is true only when
|
|
55
|
+
* the stored legal-drafts sign-in says this is Taproot's platform legal site. Whether a membership-terms key names
|
|
56
|
+
* one of the site's products only the site can check; its key and path shape are checked here (TR01437).
|
|
57
|
+
*/
|
|
58
|
+
export function legalRoleRefusal({ documentRole, documentKey }, pagePath, file, { platformLegalSite = false } = {}) {
|
|
59
|
+
const role = (documentRole ?? "").trim().toLowerCase();
|
|
60
|
+
if (TAPROOT_OWNED_LEGAL_ROLES.includes(role)) {
|
|
61
|
+
if (platformLegalSite) return undefined;
|
|
62
|
+
return new SiteAuthoringError(
|
|
63
|
+
"pages.legal_role_taproot_owned",
|
|
64
|
+
`'${file}' uses the documentRole '${role}', which only Taproot's platform legal site may use. A site's own `
|
|
65
|
+
+ `policy, its privacy policy included, uses '${LEGAL_ROLE_OTHER_NOTICE}' with the documentKey equal to the `
|
|
66
|
+
+ "last segment of its path (documentKey 'privacy' at /privacy).",
|
|
67
|
+
{ field: `${file}:data.documentRole` },
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
if (!CREATOR_LEGAL_ROLES.includes(role)) {
|
|
71
|
+
return new SiteAuthoringError(
|
|
72
|
+
"pages.legal_role_unknown",
|
|
73
|
+
`'${file}' ${role === "" ? "has no documentRole" : `has the documentRole '${role}', which Taproot does not know`}. Use one of: `
|
|
74
|
+
+ `${CREATOR_LEGAL_ROLES.join(", ")}.`,
|
|
75
|
+
{ field: `${file}:data.documentRole` },
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
// As the site compares them: the key trimmed of spaces and slashes and lower-cased, the last path segment as written.
|
|
79
|
+
const lastSegment = (pagePath ?? "").split("/").filter(Boolean).at(-1) ?? "";
|
|
80
|
+
const key = (documentKey ?? "").trim().replace(/^\/+|\/+$/gu, "").toLowerCase();
|
|
81
|
+
if (role === LEGAL_ROLE_OTHER_NOTICE && !platformLegalSite
|
|
82
|
+
&& TAPROOT_RESERVED_LEGAL_KEYS.includes(key)) {
|
|
83
|
+
return new SiteAuthoringError(
|
|
84
|
+
"pages.legal_key_reserved",
|
|
85
|
+
`'${file}' uses the documentKey '${key}', which Taproot reserves for its own documents. Use another key and `
|
|
86
|
+
+ "a path ending in it (documentKey 'privacy' at /privacy).",
|
|
87
|
+
{ field: `${file}:data.documentKey` },
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
if (!DOCUMENT_KEY_PATTERN.test(key)) {
|
|
91
|
+
return new SiteAuthoringError(
|
|
92
|
+
"pages.legal_key_invalid",
|
|
93
|
+
`'${file}' has the documentKey '${key}'; a document key uses lowercase letters, numbers and hyphens.`,
|
|
94
|
+
{ field: `${file}:data.documentKey` },
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
if (role === LEGAL_ROLE_OTHER_NOTICE && key !== lastSegment) {
|
|
98
|
+
return new SiteAuthoringError(
|
|
99
|
+
"pages.legal_key_path_mismatch",
|
|
100
|
+
`'${file}' is an ${LEGAL_ROLE_OTHER_NOTICE} with the documentKey '${documentKey ?? ""}', but its path ends in `
|
|
101
|
+
+ `'${lastSegment}'. An ${LEGAL_ROLE_OTHER_NOTICE}'s documentKey is the last segment of its path.`,
|
|
102
|
+
{ field: `${file}:data.documentKey` },
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
if (role === LEGAL_ROLE_MEMBERSHIP_TERMS) {
|
|
106
|
+
const productSlug = key.endsWith(MEMBERSHIP_TERMS_KEY_SUFFIX) ? key.slice(0, -MEMBERSHIP_TERMS_KEY_SUFFIX.length) : "";
|
|
107
|
+
// The site trims the path of slashes and compares it as written.
|
|
108
|
+
const path = (pagePath ?? "").replace(/^\/+|\/+$/gu, "");
|
|
109
|
+
if (productSlug === "" || path !== `${productSlug}/${MEMBERSHIP_TERMS_PATH_SEGMENT}`) {
|
|
110
|
+
return new SiteAuthoringError(
|
|
111
|
+
"pages.legal_membership_terms_mismatch",
|
|
112
|
+
`'${file}' is ${LEGAL_ROLE_MEMBERSHIP_TERMS} with the documentKey '${documentKey ?? ""}' at /${path}. Membership `
|
|
113
|
+
+ `terms use the documentKey '<product-slug>${MEMBERSHIP_TERMS_KEY_SUFFIX}' at `
|
|
114
|
+
+ `/<product-slug>/${MEMBERSHIP_TERMS_PATH_SEGMENT}, where <product-slug> is one of the site's membership `
|
|
115
|
+
+ "products; the site checks that the product exists.",
|
|
116
|
+
{ field: `${file}:data.documentKey` },
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return undefined;
|
|
121
|
+
}
|
package/src/output.js
CHANGED
|
@@ -39,6 +39,8 @@ export function failureResult(error) {
|
|
|
39
39
|
error: { code: error.code },
|
|
40
40
|
};
|
|
41
41
|
if (error.field) result.error.field = error.field;
|
|
42
|
+
// The site's reason for a refused field, so an agent reading only JSON learns what to change (TR01433).
|
|
43
|
+
if (typeof error.reason === "string" && error.reason !== "") result.error.reason = error.reason;
|
|
42
44
|
if (error.rule) result.error.rule = error.rule;
|
|
43
45
|
if (error.details?.length) result.error.details = error.details;
|
|
44
46
|
if (error.status) result.error.status = error.status;
|
package/src/page-metadata.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { documentTemplate, TEMPLATE_LEGAL } from "./typed-pages.js";
|
|
1
2
|
import { SiteAuthoringError } from "./errors.js";
|
|
2
3
|
import { DESCRIPTION_WARN_LENGTH } from "./page-structure-checks.js";
|
|
3
4
|
import { boundedByBytes } from "./session.js";
|
|
@@ -30,6 +31,8 @@ export function requireDescriptionLength(description, field = "description") {
|
|
|
30
31
|
export function descriptionWarnings(pages, onProgress) {
|
|
31
32
|
const items = [];
|
|
32
33
|
for (const page of pages ?? []) {
|
|
34
|
+
// A legal page carries no description: Taproot drops it (TR01433).
|
|
35
|
+
if (page.document !== null && typeof page.document === "object" && documentTemplate(page.document) === TEMPLATE_LEGAL) continue;
|
|
33
36
|
const description = page.metadataDescriptionKnown === false ? undefined : page.declaredDescription ?? page.description;
|
|
34
37
|
if (typeof description !== "string" || length(description.trim()) <= DESCRIPTION_WARN_LENGTH) continue;
|
|
35
38
|
const item = {
|
|
@@ -91,6 +91,7 @@ const THEME_FIELD_TYPES = Object.freeze({
|
|
|
91
91
|
vellumOpacity: "number",
|
|
92
92
|
vellumBackgroundImage: "string",
|
|
93
93
|
vellumBackgroundImageOpacity: "number",
|
|
94
|
+
typeRatioMin: "number",
|
|
94
95
|
});
|
|
95
96
|
|
|
96
97
|
function exampleTheme(defaults, scheme) {
|
|
@@ -259,6 +260,12 @@ const THEME_GROUPS = Object.freeze([
|
|
|
259
260
|
),
|
|
260
261
|
themeField("rootFontSize", "Root font size in px.", { minimum: 1, warningMaximum: 100 }),
|
|
261
262
|
themeField("typeRatio", "Modular type-scale ratio.", { exclusiveMinimum: 1, warningMaximum: 1.3 }),
|
|
263
|
+
themeField(
|
|
264
|
+
"typeRatioMin",
|
|
265
|
+
"Optional type-scale ratio at viewportMin, so headings step down on phones; typeRatio applies at viewportMax. "
|
|
266
|
+
+ "Above 1 and at most typeRatio. Unset, every viewport uses typeRatio.",
|
|
267
|
+
{ exclusiveMinimum: 1 },
|
|
268
|
+
),
|
|
262
269
|
themeField("spaceRatio", "Modular spacing-scale ratio.", { exclusiveMinimum: 1, warningMaximum: 2 }),
|
|
263
270
|
themeField("borderRadius", "Global border radius in rem.", { minimum: 0, warningMaximum: 10 }),
|
|
264
271
|
themeField("viewportMin", "Minimum fluid-interpolation viewport in px.", { minimum: 100 }),
|
|
@@ -482,7 +489,7 @@ export function getThemeReference() {
|
|
|
482
489
|
+ "components that paint that color in statusWarningPaints (statusWarningPaintsOmitted counts warnings left out). A proposal keeps a status within 16 degrees of its hue; when none "
|
|
483
490
|
+ "clears the warning it says so and names the action lightness stop, the chroma band and the other family as the levers.",
|
|
484
491
|
"A status warning for a named context also says what in the workspace uses that context. usedBy counts the header, "
|
|
485
|
-
+ "the footer, and the sections and calls to action that name it (usedBy: null means nothing was found). The first record of "
|
|
492
|
+
+ "the footer, the listing cards (the boolean listingCards, set when the site's listingCardContext names it), and the sections and calls to action that name it (usedBy: null means nothing was found). The first record of "
|
|
486
493
|
+ "each warning adds usedIn: { items: [{ file, kind, position }], total, truncated }, where kind is section or cta and position is "
|
|
487
494
|
+ "the 1-based ordinal among all of the page's sections (or calls to action), with or without a context, in document order. "
|
|
488
495
|
+ "items holds at most 20 rows, in page-walk order, and total is the full count. A page counts only when it reads, converts and passes "
|
|
@@ -653,8 +660,8 @@ export function getAppearanceReference() {
|
|
|
653
660
|
+ "fontMenu falls back to the body font, never to headings.",
|
|
654
661
|
changeSet: [
|
|
655
662
|
"the footer context and logo variant, saved alongside the theme and header presentation",
|
|
656
|
-
"default scheme, assets, favicon,
|
|
657
|
-
"recipeJumpControl, recipeTagsIcon, recipeTagsContent, tag bar colors, pageTagBadges and optional destination maps in settings/site-publishing-preferences.json",
|
|
663
|
+
"default scheme, assets, favicon, breadcrumbs, heading spacing, article and header settings. Omit article fields to preserve them. Use an empty string to reset.",
|
|
664
|
+
"recipeJumpControl, recipeTagsIcon, recipeTagsContent, tag bar colors, pageTagBadges, the listing card default and optional destination maps in settings/site-publishing-preferences.json",
|
|
658
665
|
"the complete light theme and the complete dark theme",
|
|
659
666
|
],
|
|
660
667
|
atomic: true,
|
|
@@ -664,7 +671,7 @@ export function getAppearanceReference() {
|
|
|
664
671
|
+ "documents the workspace holds; theme push sends it back as the baseline. The whole change set commits in "
|
|
665
672
|
+ "one transaction or none of it does; a change to any of those fields since the pull refuses the push "
|
|
666
673
|
+ "(theme.concurrent_modification) and nothing is written. The revision includes recipeJumpControl, recipeTagsIcon and pageTagBadges "
|
|
667
|
-
+ "when they differ from their defaults. The same holds for breadcrumbSeparator and breadcrumbTrailEnd. "
|
|
674
|
+
+ "when they differ from their defaults, and so do the listing card interaction, border width and context. The same holds for breadcrumbSeparator and breadcrumbTrailEnd. "
|
|
668
675
|
+ "The revision includes each nonempty heading spacing override, including zero, the tag bar overrides and both destination maps. "
|
|
669
676
|
+ "Footer prose, links and imagery and the other publishing scalars are "
|
|
670
677
|
+ "outside the revision, so concurrent edits to those values are preserved. Footer content saves retain the "
|
|
@@ -683,7 +690,7 @@ export function getAppearanceReference() {
|
|
|
683
690
|
footerBoundary:
|
|
684
691
|
"theme push owns header and footer contexts and logo variants. Use footer push for prose, links, layout, logos, images, fade and padding.",
|
|
685
692
|
surfaceContexts:
|
|
686
|
-
"Set site-header.context
|
|
693
|
+
"Set site-header.context, footerSettings.context and site-publishing-preferences.listingCardContext to a name declared by both themes, or empty to follow the page. Deleting the header or footer key clears it on theme push; omitting listingCardContext keeps the current choice. Invalid names fail settings.context_unknown; dropping a context a surface still uses fails theme.context_in_use. Repoint the surface and drop the old context in one atomic push.",
|
|
687
694
|
footerColorMigration:
|
|
688
695
|
"Before upgrading a site with custom footer colors, pull and record its five values per scheme. In each theme declare a context: the background is layer2, text is ink.color, headings are ink.heading, links are accent.text and hover is accent.hover. Add named color anchors for literal values and bind those roles to the anchors. For a semantic background such as --esp-color-layer-1, copy that token's source/lightness mapping into the context's semanticMappings.layer2. Set footerSettings.context to the shared name, remove backgroundColor/textColor/headingColor/linkColor/linkHoverColor from both footer schemes, then theme push. Retired keys fail appearance.retired_footer_color; images, fade and padding remain footer content.",
|
|
689
696
|
footerContentGuard: "theme push --dry-run includes unpushed local footer content in its checks and reports the "
|
package/src/reference-help.js
CHANGED
|
@@ -99,7 +99,7 @@ import {
|
|
|
99
99
|
|
|
100
100
|
export { getAppearanceReference, getFooterReference, getSettingsReference, getThemeReference };
|
|
101
101
|
|
|
102
|
-
export const REFERENCE_VERSION =
|
|
102
|
+
export const REFERENCE_VERSION = 86;
|
|
103
103
|
|
|
104
104
|
// The date-limit examples `help forms` prints; tests run them through the form validator.
|
|
105
105
|
export const FORM_DATE_WINDOW_FIELD = Object.freeze({
|
|
@@ -562,7 +562,7 @@ const WORKFLOW_REFERENCES = Object.freeze({
|
|
|
562
562
|
+ "and every section decoration, background and section-owned image problem in a free-form Markdown page. Any other "
|
|
563
563
|
+ "Markdown problem, or a decoration or background problem in a typed page such as an article, stops that file at "
|
|
564
564
|
+ "its first; recipe steps report all of theirs. The JSON keeps the problems that fit its size budget (problemCount "
|
|
565
|
-
+ "and problemsTruncated
|
|
565
|
+
+ "always, and problemsTruncated: true only when some were cut; at most 5,000 are kept), and stderr lists the kept ones. "
|
|
566
566
|
+ "'validate --site' also reads the site's image records and reports each placed image with no default description "
|
|
567
567
|
+ "in imageFindings, with the 'media images describe' command to fix it. "
|
|
568
568
|
+ "'pages push --dry-run' then checks the pages against the live site — paths taken, templates, revisions, "
|
|
@@ -842,7 +842,20 @@ const WORKFLOW_REFERENCES = Object.freeze({
|
|
|
842
842
|
+ "'/b?x=1' and '/b' are the same destination to it.",
|
|
843
843
|
"Refused by the site, which alone knows what it serves: a path a live page, Docs resource, or generated "
|
|
844
844
|
+ "resource already occupies. '/' is such a path while the site's home page is served there — and a "
|
|
845
|
-
+ "usable source once the home page has moved, which is the entry a home-page rename records."
|
|
845
|
+
+ "usable source once the home page has moved, which is the entry a home-page rename records. A page you "
|
|
846
|
+
+ "deleted ('pages delete', which stages a live page's removal) no longer occupies its path, and neither "
|
|
847
|
+
+ "does a folder index once every page under it is deleted, so the redirect goes live in the release that "
|
|
848
|
+
+ "removes the page. If the page is kept or restored, it takes its path back and the redirect is dropped.",
|
|
849
|
+
"Moving pages to another site: on the old site, point navigation items at the new site's URLs (kind "
|
|
850
|
+
+ "NAV_ITEM_KIND_EXTERNAL_URL with externalUrl, and no resourceId) and 'nav push', which the next staging deploy "
|
|
851
|
+
+ "carries; change links in pages that stay, 'pages push' and 'approve' them; 'pages "
|
|
852
|
+
+ "delete' each moved page; add one entry per old path with the absolute target ('https://new.example/path', in the "
|
|
853
|
+
+ "spelling the new site serves) and repoint every entry whose target was a moved page, path_history "
|
|
854
|
+
+ "entries included (a changed entry becomes authored; an unchanged one would now be a chain); "
|
|
855
|
+
+ "'validate', 'redirects push', 'deploy --staging', then 'redirects check' (delivery check may report a "
|
|
856
|
+
+ "removed folder index as degraded, since its path now answers 301). Promoting that release removes "
|
|
857
|
+
+ "the pages and starts the redirects at once. Generated lists, the archive and sitemap.xml drop the pages "
|
|
858
|
+
+ "with that release.",
|
|
846
859
|
`Bounded: at most ${REDIRECT_LIMITS.entries} entries, ${REDIRECT_LIMITS.pathBytes} bytes of path, and `
|
|
847
860
|
+ `${REDIRECT_LIMITS.targetBytes} bytes of target, matching the edge's own key and value limits.`,
|
|
848
861
|
`The ${REDIRECT_LIMITS.pathBytes}-byte path bound governs what you declare, not what the site already `
|
package/src/session.js
CHANGED
|
@@ -210,6 +210,22 @@ export async function openAccountSession(invocation = {}) {
|
|
|
210
210
|
* There is deliberately no second environment variable for the sign-in
|
|
211
211
|
* credential. One override, one precedence rule.
|
|
212
212
|
*/
|
|
213
|
+
/**
|
|
214
|
+
* Whether this machine's legal-drafts sign-in for the site says it is Taproot's platform legal site, read from the
|
|
215
|
+
* local store without a request so offline validate can apply the same legal-role rule a push does (TR01433).
|
|
216
|
+
* Anything unreadable answers false: a creator site is the common case and the site refuses again regardless.
|
|
217
|
+
*/
|
|
218
|
+
export async function storedPlatformLegalSite(invocation, siteId) {
|
|
219
|
+
try {
|
|
220
|
+
const environment = invocation.environment ?? process.env;
|
|
221
|
+
const store = await readCredentialStore(environment);
|
|
222
|
+
const credential = selectCredential(store.credentials, credentialApiOrigin(await resolveApiBaseUrl(environment)), { siteId });
|
|
223
|
+
return credential?.legalDraftPlatformSite === true;
|
|
224
|
+
} catch {
|
|
225
|
+
return false;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
213
229
|
/**
|
|
214
230
|
* Which Taproot to talk to. Machine state, then the production default — the
|
|
215
231
|
* project has no say since TR00645, so every session path resolves it here
|
|
@@ -271,7 +287,9 @@ export async function resolveSiteSession(invocation = {}) {
|
|
|
271
287
|
+ `If Taproot refuses it, run '${CLI_BINARY_NAME} ${VERB_LOGIN} --legal-drafts' again.`,
|
|
272
288
|
);
|
|
273
289
|
}
|
|
274
|
-
|
|
290
|
+
const session = resolveDirectSiteSession(invocation, { config, apiBaseUrl, now, onProgress }, credential.key);
|
|
291
|
+
// Only Taproot's platform legal site may use Taproot-owned legal roles (TR01433).
|
|
292
|
+
return { ...session, open: () => ({ ...session.open(), legalDraftPlatformSite: credential.legalDraftPlatformSite === true }) };
|
|
275
293
|
}
|
|
276
294
|
|
|
277
295
|
let config;
|
package/src/setting-reference.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { readFileSync } from "node:fs";
|
|
2
2
|
|
|
3
|
+
import { ARTICLE_APPEARANCE_CONTRACT } from "./article-appearance.js";
|
|
3
4
|
import { APPEARANCE_SCALAR_FIELDS } from "./appearance-contract.js";
|
|
4
5
|
import { BLOCK_SPACINGS, HEADING_SPACING_FIELDS } from "./block-flow.js";
|
|
5
6
|
import { RECIPE_TAGS_BAR_COLOR_TOKENS } from "./brand-color.js";
|
|
@@ -141,7 +142,38 @@ export const PAGE_BACKGROUND_VERSUS_CANVAS = Object.freeze({
|
|
|
141
142
|
+ "published site copies the file the URL names into its own assets; it does not resize it.",
|
|
142
143
|
});
|
|
143
144
|
|
|
145
|
+
const ARTICLE_CODE_RENDERS = "Inline code in published article prose in both color schemes.";
|
|
146
|
+
const ARTICLE_TITLE_RENDERS = "The published article title in both color schemes.";
|
|
147
|
+
const ARTICLE_STYLE_LABEL = "Article appearance (CLI)";
|
|
148
|
+
|
|
149
|
+
function articleTitleSize(name, description, unit) {
|
|
150
|
+
const { min, max, fallback, decimalPlaces } = ARTICLE_APPEARANCE_CONTRACT[name];
|
|
151
|
+
return entry(ARTICLE_STYLE_LABEL,
|
|
152
|
+
description + ` ${decimalPlaces ? "Decimal" : "Whole-number"} string, ${min}–${max} ${unit}.`
|
|
153
|
+
+ (fallback === undefined ? "" : ` Default ${fallback}.`),
|
|
154
|
+
ARTICLE_TITLE_RENDERS);
|
|
155
|
+
}
|
|
156
|
+
|
|
144
157
|
const TAPROOT_STYLES_ENTRIES = {
|
|
158
|
+
articleInlineCodeBackground: entry(ARTICLE_STYLE_LABEL,
|
|
159
|
+
"Choose subtle (a tint from the current scheme's link color), transparent, layer1 or layer2. Empty uses the theme's regular inline code fill.",
|
|
160
|
+
ARTICLE_CODE_RENDERS),
|
|
161
|
+
articleInlineCodePadding: entry(ARTICLE_STYLE_LABEL,
|
|
162
|
+
"Choose none, light (0.05em block and 0.2em inline) or regular (0 block and 0.35em inline). Empty uses regular padding.",
|
|
163
|
+
ARTICLE_CODE_RENDERS),
|
|
164
|
+
articleInlineCodeBorder: entry(ARTICLE_STYLE_LABEL,
|
|
165
|
+
"Choose none, dotted, dashed or solid. Uses the theme border color. Empty follows the shared code border.",
|
|
166
|
+
ARTICLE_CODE_RENDERS),
|
|
167
|
+
articleInlineCodeShadow: entry(ARTICLE_STYLE_LABEL,
|
|
168
|
+
"Choose none or an elevation of 1, 2 or 3. Empty uses the theme's regular inline code shadow.",
|
|
169
|
+
ARTICLE_CODE_RENDERS),
|
|
170
|
+
articleTitleMobileSize: articleTitleSize("articleTitleMobileSize",
|
|
171
|
+
"Title size at 390 CSS pixels and below, capped at the desktop size.", "rem"),
|
|
172
|
+
articleTitleDesktopSize: articleTitleSize("articleTitleDesktopSize",
|
|
173
|
+
"Maximum size. Empty follows the theme’s large type.", "rem"),
|
|
174
|
+
articleTitleDesktopAt: articleTitleSize("articleTitleDesktopAt",
|
|
175
|
+
"Viewport width at which the title reaches its desktop size with a 16px root font. Between 390px and this width the title grows linearly.", "CSS pixels"),
|
|
176
|
+
|
|
145
177
|
lightTheme: entry(
|
|
146
178
|
"Brand & style (light scheme)",
|
|
147
179
|
"The complete Espalier theme for the light scheme: colors, fonts, scales and the page background image.",
|
|
@@ -439,7 +471,9 @@ const PREFERENCES_ENTRIES = {
|
|
|
439
471
|
),
|
|
440
472
|
tiptapImageMaxHeightVh: entry(
|
|
441
473
|
`${FEATURES} > Image height`,
|
|
442
|
-
"The tallest an image in a page body may be,
|
|
474
|
+
"The tallest an image in a page body may be, in screen-height units (vh: 45, 60, 75 or 90). An image's own "
|
|
475
|
+
+ "maxHeight overrides it; a bare percentage there (\"50%\") also means that share of the screen height, "
|
|
476
|
+
+ "and a percentage inside calc() is ignored.",
|
|
443
477
|
"Images in page bodies.",
|
|
444
478
|
60,
|
|
445
479
|
),
|
|
@@ -469,7 +503,7 @@ const PREFERENCES_ENTRIES = {
|
|
|
469
503
|
),
|
|
470
504
|
albumMaxRowHeightVh: entry(
|
|
471
505
|
`${FEATURES} > Album maximum row height`,
|
|
472
|
-
"The tallest an album row may be,
|
|
506
|
+
"The tallest an album row may be, in screen-height units (vh, 1 to 100). A partial last row stays no "
|
|
473
507
|
+ "taller than the rows before it.",
|
|
474
508
|
"Album pages.",
|
|
475
509
|
90,
|
|
@@ -513,6 +547,23 @@ const PREFERENCES_ENTRIES = {
|
|
|
513
547
|
RECIPE_TAG_BAR_COLOR_USAGE + " Empty uses --esp-color-text. Validation warns below 3:1 against the bar fill in either color scheme. Set badge ink in help theme.",
|
|
514
548
|
"The recipe tag bar's decorative icon.",
|
|
515
549
|
),
|
|
550
|
+
listingCardInteraction: entry(
|
|
551
|
+
`${FEATURES} > Listing cards > Card interaction`,
|
|
552
|
+
"Choose grow, lift, press or none. An empty value resets this setting to grow.",
|
|
553
|
+
"How a card answers a pointer in folder indexes and the archive, and in any Latest Posts list that leaves its own interaction out. Applies after deployment.",
|
|
554
|
+
),
|
|
555
|
+
listingCardBorderWidth: entry(
|
|
556
|
+
`${FEATURES} > Listing cards > Card border width`,
|
|
557
|
+
"A whole number of pixels from 0 through 20; 0 draws no border. An empty string resets it to 1. Leave the field out to keep the site's value.",
|
|
558
|
+
"The line around each card in folder indexes and the archive, and in any Latest Posts list that leaves its own borderWidth out. Applies after deployment.",
|
|
559
|
+
),
|
|
560
|
+
listingCardContext: entry(
|
|
561
|
+
`${FEATURES} > Listing cards > Card colors`,
|
|
562
|
+
"Name a context declared by both lightTheme and darkTheme, or leave it empty to follow the page. Leave the field out to keep the site's value. "
|
|
563
|
+
+ "A context that no longer exists in both themes fails settings.context_unknown, and dropping one the listing cards still use fails theme.context_in_use. "
|
|
564
|
+
+ "A profile site renders in its owner's own theme, so it accepts only an empty value.",
|
|
565
|
+
"The card fill, border and shadow colors of every generated listing and every Latest Posts list. Define a context whose border and shadow roles differ from the page to give cards their own. Applies after deployment.",
|
|
566
|
+
),
|
|
516
567
|
tagDestinations: entry(
|
|
517
568
|
"Tag destinations",
|
|
518
569
|
"Map authored tag names to page resource IDs from pull. Names are case-insensitive and pull writes canonical slugs. "
|
package/src/settings-catalog.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { parseTheme } from "@taprootio/espalier/shared/theme";
|
|
2
2
|
|
|
3
|
+
import { ARTICLE_APPEARANCE_FIELDS } from "./article-appearance.js";
|
|
3
4
|
import { HEADING_SPACING_FIELDS, normalizeHeadingSpacing } from "./block-flow.js";
|
|
4
5
|
import { BREADCRUMB_ARTWORK_FIELDS, decodeBreadcrumbArtwork } from "./breadcrumb-artwork.js";
|
|
5
6
|
import { normalizeBreadcrumbSeparator, normalizeBreadcrumbTrailEnd } from "./breadcrumb-separators.js";
|
|
@@ -8,6 +9,7 @@ import { SiteAuthoringError } from "./errors.js";
|
|
|
8
9
|
import { closeFieldMatch, unknownFieldHint } from "./field-suggestions.js";
|
|
9
10
|
import { projectFooterSettingsForWorkspace } from "./footer-contract.js";
|
|
10
11
|
import { parseHeaderHeightMultiplier, resolveLogoVariant } from "./header-presentation.js";
|
|
12
|
+
import { latestPostsInteraction } from "./latest-posts-settings.js";
|
|
11
13
|
import { normalizePageTagBadges } from "./page-tag-badge-modes.js";
|
|
12
14
|
import { normalizeRecipeJumpControl, normalizeRecipeTagsContent, normalizeRecipeTagsIcon } from "./recipe-page-options.js";
|
|
13
15
|
import { projectPulledTheme } from "./theme-projection.js";
|
|
@@ -80,6 +82,7 @@ export const SETTINGS_GROUPS = Object.freeze([
|
|
|
80
82
|
"darkCanvasImageId",
|
|
81
83
|
"darkCanvasImageUrl",
|
|
82
84
|
),
|
|
85
|
+
...ARTICLE_APPEARANCE_FIELDS.map(name => ({ name, wireType: "string", optional: true })),
|
|
83
86
|
...HEADING_SPACING_FIELDS.map(name => ({ name, wireType: "string", normalize: normalizeHeadingSpacing })),
|
|
84
87
|
{ name: "contentInset", wireType: "string", normalize: normalizeContentInset },
|
|
85
88
|
{ name: "breadcrumbSeparator", wireType: "string", normalize: normalizeBreadcrumbSeparator },
|
|
@@ -181,6 +184,10 @@ export const SETTINGS_GROUPS = Object.freeze([
|
|
|
181
184
|
{ name: "recipeTagsBarBackground", wireType: "string", optional: true },
|
|
182
185
|
{ name: "recipeTagsBarBorderColor", wireType: "string", optional: true },
|
|
183
186
|
{ name: "recipeTagsBarColor", wireType: "string", optional: true },
|
|
187
|
+
// The site's listing card default (TR01438). An unset width stays absent so it reads as "1".
|
|
188
|
+
{ name: "listingCardInteraction", wireType: "string", normalize: latestPostsInteraction, optional: true },
|
|
189
|
+
{ name: "listingCardBorderWidth", wireType: "int", optional: true },
|
|
190
|
+
{ name: "listingCardContext", wireType: "string", optional: true },
|
|
184
191
|
{ name: "footerSettings", wireType: "document", zero: {} },
|
|
185
192
|
]),
|
|
186
193
|
}),
|
|
@@ -6,7 +6,7 @@ import rules from "./site-check-rules.json" with { type: "json" };
|
|
|
6
6
|
import { isFormKey } from "./forms-contract.js";
|
|
7
7
|
import { DESCRIPTION_MINIMUM_LENGTH, DESCRIPTION_WARN_LENGTH, localAuthoringMetadata, METADATA_RULE_IDS, pageStructureFindings, RULE_IMAGE_DEFAULT_MISSING, TITLE_MINIMUM_LENGTH, TITLE_WARN_LENGTH } from "./page-structure-checks.js";
|
|
8
8
|
import { missingPageLinkFindings, normalizedPathSet } from "./site-checks.js";
|
|
9
|
-
import { documentTemplate, TEMPLATE_FREE_FORM, TEMPLATE_GENERATED } from "./typed-pages.js";
|
|
9
|
+
import { documentTemplate, TEMPLATE_FREE_FORM, TEMPLATE_GENERATED, TEMPLATE_LEGAL } from "./typed-pages.js";
|
|
10
10
|
import { displayPagePath } from "./workspace.js";
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -75,7 +75,9 @@ export const SITE_CHECK_WORDING = Object.freeze({
|
|
|
75
75
|
"a11y.link_text_empty": (finding) => `has a link to ${finding.subject} with no text`,
|
|
76
76
|
"seo.title_missing": () => "has no title; add one that identifies the page",
|
|
77
77
|
"seo.title_short": (finding) => `has a title of ${finding.detail} characters; consider a more specific title (guidance: ${TITLE_MINIMUM_LENGTH}–${TITLE_WARN_LENGTH})`,
|
|
78
|
-
|
|
78
|
+
// A post card takes five lines, which holds a title within the guidance on the usual card widths (TR01437).
|
|
79
|
+
"seo.title_long": (finding) => `has a title of ${finding.detail} characters; consider shortening it (guidance: ${TITLE_MINIMUM_LENGTH}–${TITLE_WARN_LENGTH}). `
|
|
80
|
+
+ "Search results and post cards may cut a longer title; a card ends it in an ellipsis",
|
|
79
81
|
"seo.description_missing": () => "has no description; add a short account of what the page offers",
|
|
80
82
|
"seo.description_short": (finding) => `has a description of ${finding.detail} characters; consider adding useful detail (guidance: ${DESCRIPTION_MINIMUM_LENGTH}–${DESCRIPTION_WARN_LENGTH})`,
|
|
81
83
|
"seo.description_long": (finding) => `has a description of ${finding.detail} characters; consider shortening it (guidance: ${DESCRIPTION_MINIMUM_LENGTH}–${DESCRIPTION_WARN_LENGTH})`,
|
|
@@ -199,7 +201,10 @@ function structureFindingsFor(page) {
|
|
|
199
201
|
body: freeForm ? page.document : undefined,
|
|
200
202
|
...localAuthoringMetadata({
|
|
201
203
|
title: page.title,
|
|
202
|
-
|
|
204
|
+
// A legal page carries no description: Taproot stores and renders none (TR01433).
|
|
205
|
+
description: template === TEMPLATE_LEGAL || page.metadataDescriptionKnown === false
|
|
206
|
+
? undefined
|
|
207
|
+
: page.declaredDescription ?? page.description,
|
|
203
208
|
homePage: page.pagePath === "" || page.pagePath === "/",
|
|
204
209
|
generated: template === TEMPLATE_GENERATED ? page.document.data ?? {} : undefined,
|
|
205
210
|
}),
|
|
@@ -83,8 +83,8 @@ const USE_KIND_LABEL = Object.freeze({ section: "section", cta: "call to action"
|
|
|
83
83
|
function usageLine(record) {
|
|
84
84
|
if (record.usedBy === undefined) return [];
|
|
85
85
|
if (record.usedBy === null) return [` Used by: ${record.usedByNote}`];
|
|
86
|
-
const { header, footer, sections, ctas } = record.usedBy;
|
|
87
|
-
const parts = [header ? "header" : "", footer ? "footer" : "", sections > 0 ? `${sections} section(s)` : "", ctas > 0 ? `${ctas} call(s) to action` : ""];
|
|
86
|
+
const { header, footer, listingCards, sections, ctas } = record.usedBy;
|
|
87
|
+
const parts = [header ? "header" : "", footer ? "footer" : "", listingCards ? "listing cards" : "", sections > 0 ? `${sections} section(s)` : "", ctas > 0 ? `${ctas} call(s) to action` : ""];
|
|
88
88
|
const { items = [], total = 0 } = record.usedIn ?? {};
|
|
89
89
|
const where = items.map(({ file, kind, position }) => `${file} ${USE_KIND_LABEL[kind] ?? kind} ${position}`);
|
|
90
90
|
if (total > items.length) where.push(`and ${total - items.length} more`);
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
{"token": "--esp-color-shadow", "file": "generator/client/pages/card-grid/taproot-card-grid.ts", "markup": ":host", "part": "--taproot-cg-card-shadow", "label": "card grid shadow fallback", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
18
18
|
{"token": "--esp-color-layer-1", "file": "generator/client/pages/card-grid/taproot-card-grid.ts", "markup": "::slotted(.card-item)", "part": "background", "label": "card item fill", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
19
19
|
{"token": "--esp-color-border", "file": "generator/client/pages/card-grid/taproot-card-grid.ts", "markup": "::slotted(.card-item)", "part": "border", "label": "card item border", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
20
|
-
{"token": "--esp-color-layer-2", "file": "generator/client/pages/card-grid/taproot-card-grid.ts", "markup": ":host(:is(:not([interaction]), [interaction=\"lift\"])) ::slotted(a.card-item:is(:hover, :focus-visible))", "part": "background", "label": "card item hover fill", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
21
|
-
{"token": "--esp-color-shadow", "file": "generator/client/pages/card-grid/taproot-card-grid.ts", "markup": ":host([interaction=\"press\"]) ::slotted(.card-item)", "part": "box-shadow via --esp-shadow-2", "label": "pressable card resting shadow", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
22
|
-
{"token": "--esp-color-shadow", "file": "generator/client/pages/card-grid/taproot-card-grid.ts", "markup": ":host([interaction=\"press\"]) ::slotted(.card-item)", "part": "box-shadow", "label": "pressable card resting shadow fallback", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
23
|
-
{"token": "--esp-color-layer-2", "file": "generator/client/pages/card-grid/taproot-card-grid.ts", "markup": ":host([interaction=\"press\"]) ::slotted(a.card-item:is(:hover, :focus-visible))", "part": "background", "label": "pressable card hover fill", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
24
|
-
{"token": "--esp-color-shadow", "file": "generator/client/pages/card-grid/taproot-card-grid.ts", "markup": ":host([interaction=\"press\"]) ::slotted(a.card-item:is(:hover, :focus-visible))", "part": "box-shadow via --esp-shadow-1", "label": "pressable card hover shadow", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
25
|
-
{"token": "--esp-color-shadow", "file": "generator/client/pages/card-grid/taproot-card-grid.ts", "markup": ":host([interaction=\"press\"]) ::slotted(a.card-item:is(:hover, :focus-visible))", "part": "box-shadow", "label": "pressable card hover shadow fallback", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
26
20
|
{"token": "--esp-color-link", "file": "generator/client/pages/card-grid/taproot-card-grid.ts", "markup": "::slotted(a.card-item:focus-visible)", "part": "outline", "label": "card item focus ring", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
27
21
|
{"token": "--esp-color-layer-2", "file": "generator/client/pages/card-grid/taproot-card-grid.ts", "markup": ":host(:not([interaction=\"none\"])) ::slotted(a.card-item:focus-visible)", "part": "background", "label": "card item fill", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
28
22
|
{"token": "intent:danger", "file": "generator/client/pages/cta/taproot-cta.ts", "markup": "esp-button[class=\"cta__button\"]", "part": "intent", "label": "destructive call-to-action button", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
29
23
|
{"token": "--esp-color-background", "file": "generator/client/pages/cta/taproot-cta.ts", "markup": ":host([context]:not([context=\"\"])) .cta", "part": "background", "label": "cta panel fill from its context", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
30
24
|
{"token": "--esp-color-border", "file": "generator/client/pages/cta/taproot-cta.ts", "markup": ".cta--bordered", "part": "border", "label": "cta bordered border", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
25
|
+
{"token": "--esp-color-link","file": "generator/src/article-appearance-css.ts","markup": "subtle","part": "CSS value","label": "article inline code tint","topics": ["article"]},
|
|
26
|
+
{"token": "--esp-color-layer-1","file": "generator/src/article-appearance-css.ts","markup": "layer1","part": "CSS value","label": "article inline code layer 1 background","topics": ["article"]},
|
|
27
|
+
{"token": "--esp-color-layer-2","file": "generator/src/article-appearance-css.ts","markup": "layer2","part": "CSS value","label": "article inline code layer 2 background","topics": ["article"]},
|
|
28
|
+
{"token": "--esp-color-shadow","file": "generator/src/article-appearance-css.ts","markup": "1","part": "CSS value via --esp-shadow-1","label": "article inline code elevation 1","topics": ["article"]},
|
|
29
|
+
{"token": "--esp-color-shadow","file": "generator/src/article-appearance-css.ts","markup": "2","part": "CSS value via --esp-shadow-2","label": "article inline code elevation 2","topics": ["article"]},
|
|
30
|
+
{"token": "--esp-color-shadow","file": "generator/src/article-appearance-css.ts","markup": "3","part": "CSS value via --esp-shadow-3","label": "article inline code elevation 3","topics": ["article"]},
|
|
31
31
|
{"token": "--esp-color-headings", "file": "generator/src/hero-cta-markup.ts", "markup": "taproot-cta > [slot=\"heading\"]", "part": "color", "label": "cta heading ink", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
32
32
|
{"token": "--esp-color-text", "file": "generator/src/hero-cta-markup.ts", "markup": "taproot-cta > [slot=\"description\"]", "part": "color", "label": "cta description ink", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
33
33
|
{"token": "--esp-color-headings", "file": "generator/client/pages/feature-grid/taproot-feature-grid.ts", "markup": ":host", "part": "--taproot-fg-icon-color", "label": "feature icon ink", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
@@ -41,8 +41,9 @@
|
|
|
41
41
|
{"token": "--esp-color-type-lead", "file": "generator/src/hero-cta-markup.ts", "markup": "taproot-hero > [slot=\"lead\"]", "part": "color via --esp-type-lead-color", "label": "hero lead ink", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
42
42
|
{"token": "--esp-color-link", "file": "generator/client/pages/image-row/taproot-image-row.ts", "markup": "taproot-image-row > a.image-row__item:focus-visible", "part": "outline", "label": "image row item focus ring", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
43
43
|
{"token": "--esp-color-text", "file": "generator/client/pages/latest-posts/taproot-latest-posts.ts", "markup": "taproot-latest-posts :is(a.post-card.post-card, a.post-card__link)", "part": "color", "label": "latest posts card link ink", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
44
|
-
{"token": "--esp-color-layer-2", "file": "generator/client/pages/latest-posts/taproot-latest-posts.ts", "markup": "taproot-latest-posts :is(a.post-card.post-card:hover, article.post-card:has(> a.post-card__link:hover))", "part": "background", "label": "latest posts hover fill", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
45
|
-
{"token": "--esp-color-layer-1", "file": "generator/client/pages/latest-posts/taproot-latest-posts.ts", "markup": "taproot-latest-posts :is(a.post-card.post-card:hover, article.post-card:has(> a.post-card__link:hover))", "part": "background", "label": "latest posts hover fill fallback", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
44
|
+
{"token": "--esp-color-layer-2", "file": "generator/client/pages/latest-posts/taproot-latest-posts.ts", "markup": "taproot-latest-posts:not([interaction=\"none\"]) :is(a.post-card.post-card:hover, article.post-card:has(> a.post-card__link:hover))", "part": "background", "label": "latest posts hover fill", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
45
|
+
{"token": "--esp-color-layer-1", "file": "generator/client/pages/latest-posts/taproot-latest-posts.ts", "markup": "taproot-latest-posts:not([interaction=\"none\"]) :is(a.post-card.post-card:hover, article.post-card:has(> a.post-card__link:hover))", "part": "background", "label": "latest posts hover fill fallback", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
46
|
+
{"token": "--esp-color-layer-1", "file": "generator/client/pages/latest-posts/taproot-latest-posts.ts", "markup": "taproot-latest-posts[interaction=\"none\"] :is(a.post-card.post-card:hover, article.post-card:has(> a.post-card__link:hover))", "part": "background", "label": "latest posts still card fill", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
46
47
|
{"token": "--esp-color-link", "file": "generator/client/pages/latest-posts/taproot-latest-posts.ts", "markup": "taproot-latest-posts .post-card__link:focus-visible", "part": "outline", "label": "linked-tag card focus ring", "topics": ["article", "recipe", "generated"]},
|
|
47
48
|
{"token": "--esp-color-headings", "file": "generator/client/pages/latest-posts/taproot-latest-posts.ts", "markup": "taproot-latest-posts .post-card__title", "part": "color", "label": "post card title ink", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
48
49
|
{"token": "--esp-color-type-caption", "file": "generator/client/pages/latest-posts/taproot-latest-posts.ts", "markup": "taproot-latest-posts .post-card__meta", "part": "color", "label": "post card meta ink", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
@@ -60,7 +61,14 @@
|
|
|
60
61
|
{"token": "--esp-color-type-caption", "file": "generator/client/pages/product-grid/taproot-product-grid.ts", "markup": "taproot-product-grid .product-item > .product-item__price > .product-item__note", "part": "color", "label": "product item note ink", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
61
62
|
{"token": "--esp-color-layer-2", "file": "generator/client/pages/recipe/taproot-recipe.ts", "markup": ".recipe-meta ::slotted(*)", "part": "background", "label": "recipe meta fill", "topics": ["recipe"]},
|
|
62
63
|
{"token": "--esp-color-headings", "file": "generator/client/pages/recipe/taproot-recipe.ts", "markup": ".recipe-instructions h2", "part": "color", "label": "recipe instructions ink", "topics": ["recipe"]},
|
|
64
|
+
{"token": "--esp-color-layer-2", "file": "generator/client/pages/shared/card-motion.ts", "markup": "LIFT", "part": "background", "label": "lifted card fill", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
65
|
+
{"token": "--esp-color-shadow", "file": "generator/client/pages/shared/card-motion.ts", "markup": "PRESS_REST", "part": "box-shadow via --esp-shadow-2", "label": "pressable card resting shadow", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
66
|
+
{"token": "--esp-color-shadow", "file": "generator/client/pages/shared/card-motion.ts", "markup": "PRESS_REST", "part": "box-shadow", "label": "pressable card resting shadow fallback", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
67
|
+
{"token": "--esp-color-layer-2", "file": "generator/client/pages/shared/card-motion.ts", "markup": "PRESS_ENGAGED", "part": "background", "label": "pressable card hover fill", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
68
|
+
{"token": "--esp-color-shadow", "file": "generator/client/pages/shared/card-motion.ts", "markup": "PRESS_ENGAGED", "part": "box-shadow via --esp-shadow-1", "label": "pressable card hover shadow", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
69
|
+
{"token": "--esp-color-shadow", "file": "generator/client/pages/shared/card-motion.ts", "markup": "PRESS_ENGAGED", "part": "box-shadow", "label": "pressable card hover shadow fallback", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
63
70
|
{"token": "--esp-color-headings", "file": "generator/client/pages/shared/taproot-page-base.ts", "markup": ":host", "part": "--taproot-title-color", "label": "published page title ink with --esp-heading-1-color unset", "topics": ["article", "album", "recipe", "place-review"]},
|
|
71
|
+
{"token": "--esp-color-link", "file": "generator/client/pages/shared/taproot-page-base.ts", "markup": ":host", "part": "--taproot-byline-color", "label": "published author and byline link ink with --esp-byline-color unset", "topics": ["article", "album", "recipe", "place-review"]},
|
|
64
72
|
{"token": "--esp-color-border", "file": "generator/client/pages/spacer/taproot-spacer.ts", "markup": ".spacer__divider", "part": "border-top", "label": "spacer divider top border", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
65
73
|
{"token": "--esp-color-text", "file": "generator/client/pages/testimonial/taproot-testimonial.ts", "markup": ":host", "part": "color", "label": "testimonial text", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
66
74
|
{"token": "--esp-color-border", "file": "generator/client/pages/testimonial/taproot-testimonial.ts", "markup": "::slotted(.testimonial-item)", "part": "border", "label": "testimonial item border", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
package/src/theme-resolve.js
CHANGED
|
@@ -351,6 +351,14 @@ function formatComponentContrast({ apca, adjusted, targetLc }) {
|
|
|
351
351
|
+ `(${apca.againstColor}), ${adjusted ? "adjusted" : "unchanged"}`;
|
|
352
352
|
}
|
|
353
353
|
|
|
354
|
+
/** The label ink Espalier fits to a fill property, as the fit report traces it (TR01437). */
|
|
355
|
+
function formatComponentInk({ ink }) {
|
|
356
|
+
if (ink === undefined || ink === null) return "";
|
|
357
|
+
return `Label ink Lc ${floorTo(ink.fromLc, 1)} → ${floorTo(ink.toLc, 1)} (target ${ink.targetLc}) on this fill `
|
|
358
|
+
+ `(${ink.againstColor}), WCAG ${floorTo(ink.wcagRatio, 2)}:1, ${ink.requested === ink.resolved ? "unchanged" : "fitted"} `
|
|
359
|
+
+ `to ${ink.resolved}`;
|
|
360
|
+
}
|
|
361
|
+
|
|
354
362
|
function displayLc(value, target) {
|
|
355
363
|
const shown = floorTo(value, 1);
|
|
356
364
|
return value < target && shown >= target ? target - 0.1 : shown;
|
|
@@ -444,6 +452,8 @@ export function formatThemeResolve(result) {
|
|
|
444
452
|
` Authored ${JSON.stringify(property.authored)} → resolved ${property.resolved}. Root override ${override}.`,
|
|
445
453
|
);
|
|
446
454
|
if (contrast !== "") lines.push(` ${contrast}`);
|
|
455
|
+
const ink = formatComponentInk(property);
|
|
456
|
+
if (ink !== "") lines.push(` ${ink}`);
|
|
447
457
|
}
|
|
448
458
|
}
|
|
449
459
|
}
|
package/src/theme-validation.js
CHANGED
|
@@ -75,6 +75,7 @@ export const OPTIONAL_THEME_FIELDS = Object.freeze([
|
|
|
75
75
|
"vellumOpacity",
|
|
76
76
|
"vellumBackgroundImage",
|
|
77
77
|
"vellumBackgroundImageOpacity",
|
|
78
|
+
"typeRatioMin",
|
|
78
79
|
"componentProperties",
|
|
79
80
|
]);
|
|
80
81
|
|
|
@@ -122,7 +123,10 @@ export const HEADER_BRAND_COLOR_TOKENS = Object.freeze(
|
|
|
122
123
|
);
|
|
123
124
|
|
|
124
125
|
/** Validate the complete post-save state, including an atomic repoint and context removal. */
|
|
125
|
-
export function requireSurfaceContexts(
|
|
126
|
+
export function requireSurfaceContexts(
|
|
127
|
+
{ lightTheme, darkTheme, headerContext = "", footerContext = "", listingCardContext = "" },
|
|
128
|
+
current,
|
|
129
|
+
) {
|
|
126
130
|
const declared = new Set(sharedDeclaredThemeContextNames(lightTheme, darkTheme));
|
|
127
131
|
const previous = current === undefined ? new Set() : new Set(sharedEncodedThemeContextNames(
|
|
128
132
|
current.styleSettings?.lightTheme,
|
|
@@ -137,6 +141,12 @@ export function requireSurfaceContexts({ lightTheme, darkTheme, headerContext =
|
|
|
137
141
|
footerContext,
|
|
138
142
|
current?.sitePublishingPreferences?.footerSettings?.context ?? "",
|
|
139
143
|
],
|
|
144
|
+
[
|
|
145
|
+
"listing card",
|
|
146
|
+
"site-publishing-preferences.listingCardContext",
|
|
147
|
+
listingCardContext,
|
|
148
|
+
current?.sitePublishingPreferences?.listingCardContext ?? "",
|
|
149
|
+
],
|
|
140
150
|
]
|
|
141
151
|
) {
|
|
142
152
|
if (context === "" || declared.has(context)) continue;
|
package/src/token-reach.js
CHANGED
|
@@ -29,7 +29,8 @@ const BORDER_PAINT_NOTES = [
|
|
|
29
29
|
state: "default",
|
|
30
30
|
label: "header border value",
|
|
31
31
|
folder: "header",
|
|
32
|
-
text: "The header bottom hairline uses 1px of the context's border token
|
|
32
|
+
text: "The header bottom hairline uses 1px of the context's border token, or the theme's "
|
|
33
|
+
+ "--esp-header-border-bottom-width.",
|
|
33
34
|
},
|
|
34
35
|
{
|
|
35
36
|
token: "--esp-color-border",
|