@taprootio/site-authoring 0.42.0 → 0.55.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 +32 -1
- package/examples/riverbend-wellness/settings/site-publishing-preferences.json +3 -0
- package/examples/riverbend-wellness/settings/taproot-styles.json +11 -0
- package/package.json +4 -3
- package/src/api.js +161 -8
- package/src/appearance-contract.js +264 -3
- package/src/authored-tag-names.js +88 -0
- package/src/block-flow.js +103 -1
- package/src/brand-color.js +22 -0
- package/src/breadcrumb-artwork.js +234 -0
- package/src/breadcrumb-separators.js +11 -0
- package/src/changelog.json +143 -0
- package/src/chrome-features.js +6 -2
- package/src/chrome-input.js +1 -0
- package/src/chrome-paint-catalog-taproot.json +3 -3
- package/src/chrome-report.js +91 -12
- package/src/cli.js +45 -16
- package/src/content/components.js +27 -4
- package/src/content/external-link.js +2 -1
- package/src/content/markdown.js +271 -101
- package/src/content/tiptap-prosemirror.ts +125 -43
- package/src/content/validate-document.js +4 -1
- package/src/content-inset.js +48 -0
- package/src/errors.js +1 -0
- package/src/espalier-shared.js +26 -0
- package/src/field-suggestions.js +40 -0
- package/src/fixture-init.js +22 -5
- package/src/font-catalog.js +11 -1
- package/src/footer-brand-inputs.js +22 -3
- package/src/footer-content.js +1 -0
- package/src/footer-contract.js +11 -0
- package/src/footer-cta-styles.js +6 -0
- package/src/footer-draft-hash.js +4 -2
- package/src/footer-fit.js +62 -15
- package/src/footer-workspace.js +44 -7
- package/src/latest-posts-tags.js +57 -0
- package/src/page-structure-checks.js +5 -0
- package/src/page-tag-badge-modes.js +6 -0
- package/src/page-tag-writes.js +158 -0
- package/src/page-type-tags.js +16 -0
- package/src/presentation-reference.js +297 -86
- package/src/recipe-page-options.js +22 -0
- package/src/recipe-step-contract.js +164 -0
- package/src/recipe-step-contract.json +65 -0
- package/src/reference-help.js +164 -78
- package/src/session.js +39 -24
- package/src/setting-reference.js +239 -48
- package/src/settings-catalog.js +63 -0
- package/src/site-check-findings.js +23 -5
- package/src/site-check-rules.json +1 -0
- package/src/site-health-findings.js +13 -13
- package/src/styling-fixed-values.js +71 -0
- package/src/tag-destination-warnings.js +35 -0
- package/src/template-token-reach.json +242 -0
- package/src/theme-proposals.js +18 -27
- package/src/theme-resolve.js +265 -23
- package/src/theme-validation.js +118 -7
- package/src/token-reach.js +222 -0
- package/src/typed-page-reference.js +72 -15
- package/src/typed-pages.js +171 -71
- package/src/verbs/deploy.js +6 -0
- package/src/verbs/footer-push.js +30 -5
- package/src/verbs/forms-push.js +11 -3
- package/src/verbs/pages-delete.js +19 -10
- package/src/verbs/pages-push.js +125 -36
- package/src/verbs/plan.js +10 -4
- package/src/verbs/pull.js +277 -67
- package/src/verbs/staging-review.js +27 -1
- package/src/verbs/status.js +22 -0
- package/src/verbs/theme-push.js +93 -25
- package/src/verbs/theme-resolve.js +189 -55
- package/src/verbs/validate.js +6 -5
- package/src/workspace-check.js +35 -3
- package/src/workspace.js +37 -1
- package/test/fixtures/default-site-theme.json +516 -0
package/src/chrome-features.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Generated from shared/chrome-features.ts by scripts/sync-field-validation.mjs. Do not edit.
|
|
2
2
|
import { isTallHeaderPaint } from "@taprootio/espalier/shared/theme";
|
|
3
3
|
import { resolveFooterTarget } from "./footer-content.js";
|
|
4
|
+
import { resolveFooterCtaStyle } from "./footer-cta-styles.js";
|
|
4
5
|
import { resolveHeaderChromePresentation } from "./header-presentation.js";
|
|
5
6
|
import { describeHeaderNavigationItem, MAX_NAVIGATION_DEPTH, prepareHeaderNavigation, SITE_NAVIGATION_KINDS, } from "./site-navigation-groups.js";
|
|
6
7
|
import { isRenderableSocialLink } from "./social-link-url.js";
|
|
@@ -39,7 +40,7 @@ export function chromeFeatures({ headerSettings, footerSettings, navItems, foote
|
|
|
39
40
|
const flags = footerContentFlags(footerSettings, footerPagePaths);
|
|
40
41
|
if (hasIconSprite && footerSettings.socialLinks?.some(isRenderableSocialLink))
|
|
41
42
|
flags.push("socialLinks");
|
|
42
|
-
if (nameReportEnabled === true)
|
|
43
|
+
if (nameReportEnabled === true && !flags.includes("footerActionButton"))
|
|
43
44
|
flags.push("footerActionButton");
|
|
44
45
|
const showBrand = footerSettings.showBrand !== false;
|
|
45
46
|
features.footer = schemeFeatures(flags, [], showBrand && footerSettings.showBrandText !== false ? headerSettings?.brandText : undefined, {
|
|
@@ -139,10 +140,13 @@ function footerContentFlags(settings, paths) {
|
|
|
139
140
|
for (const paragraph of content?.paragraphs ?? [])
|
|
140
141
|
recordParagraph(paragraph, false);
|
|
141
142
|
}
|
|
142
|
-
|
|
143
|
+
const hasCta = Boolean(settings.asideCta && hasLinkText(settings.asideCta));
|
|
144
|
+
const hasCtaButton = hasCta && resolveFooterCtaStyle(settings.asideCtaStyle) === "button";
|
|
145
|
+
links ||= (hasCta && !hasCtaButton) || Boolean(settings.bottomLinks?.some(hasLinkText));
|
|
143
146
|
return [
|
|
144
147
|
...(headings ? ["footerHeadings"] : []),
|
|
145
148
|
...(body ? ["footerBody"] : []),
|
|
146
149
|
...(links ? ["footerLinks"] : []),
|
|
150
|
+
...(hasCtaButton ? ["footerActionButton"] : []),
|
|
147
151
|
];
|
|
148
152
|
}
|
package/src/chrome-input.js
CHANGED
|
@@ -141,6 +141,7 @@ export function buildChromeInput({ appearance, resources, nameReportEnabled }) {
|
|
|
141
141
|
return {
|
|
142
142
|
paintSurfaces: surfaces.filter(({ context, features }) => features !== undefined && (context === null || contexts.has(context))),
|
|
143
143
|
brandColorSourceFields: resolveBrandColorSourceFields(header),
|
|
144
|
+
badgeSettings: settingsOnly ? undefined : resources.badgeSettings ?? publishing,
|
|
144
145
|
navigationUnavailable: navItems === undefined,
|
|
145
146
|
};
|
|
146
147
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"footer": [
|
|
3
3
|
{
|
|
4
4
|
"element": "social-link",
|
|
5
|
-
"foreground": "link",
|
|
5
|
+
"foreground": "footer-link-ink",
|
|
6
6
|
"background": "layer2",
|
|
7
7
|
"state": "rest",
|
|
8
8
|
"kind": "graphic",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
20
|
"element": "social-link",
|
|
21
|
-
"foreground": "link",
|
|
21
|
+
"foreground": "footer-link-ink",
|
|
22
22
|
"background": "layer2",
|
|
23
23
|
"state": "focus",
|
|
24
24
|
"kind": "graphic",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
"element": "social-link",
|
|
29
|
-
"foreground": "link",
|
|
29
|
+
"foreground": "footer-link-ink",
|
|
30
30
|
"background": "layer2",
|
|
31
31
|
"state": "focus",
|
|
32
32
|
"kind": "ring",
|
package/src/chrome-report.js
CHANGED
|
@@ -1,24 +1,91 @@
|
|
|
1
|
-
import { parseTheme } from "@taprootio/espalier/shared/theme";
|
|
1
|
+
import { parseTheme, semanticToCSS, wcagRatio } from "@taprootio/espalier/shared/theme";
|
|
2
2
|
|
|
3
3
|
import { APPEARANCE_FILES } from "./appearance-contract.js";
|
|
4
|
+
import { RECIPE_TAGS_BAR_PAINT_DEFAULTS, resolveRecipeTagsBarColor } from "./brand-color.js";
|
|
4
5
|
import { standaloneFooterActionEntries } from "./chrome-features.js";
|
|
5
6
|
import { buildChromeInput } from "./chrome-input.js";
|
|
6
|
-
import { CHROME_UNAVAILABLE_MESSAGE, displayChromeRatio } from "./chrome-output.js";
|
|
7
|
+
import { CHROME_UNAVAILABLE_MESSAGE, displayChromeContext, displayChromeRatio } from "./chrome-output.js";
|
|
7
8
|
import taprootCatalog from "./chrome-paint-catalog-taproot.json" with { type: "json" };
|
|
8
|
-
import {
|
|
9
|
+
import { CLI_BINARY_NAME } from "./constants.js";
|
|
10
|
+
import { BADGE_FOCUS_RING, loadEspalierShared, supportsBadgeFocusRing } from "./espalier-shared.js";
|
|
11
|
+
import { normalizePageTagBadges } from "./page-tag-badge-modes.js";
|
|
12
|
+
import { normalizeRecipeTagsContent, normalizeRecipeTagsIcon } from "./recipe-page-options.js";
|
|
9
13
|
import { SETTINGS_TYPE_SITE_HEADER, SETTINGS_TYPE_SITE_PUBLISHING_PREFERENCES } from "./settings-catalog.js";
|
|
10
14
|
import { CONTRAST_TEXT_BELOW_AA, THEME_STYLES_FILE } from "./theme-resolve.js";
|
|
11
15
|
import { loadFitReport } from "./theme-validation.js";
|
|
16
|
+
import { describeChromeToken } from "./token-reach.js";
|
|
12
17
|
|
|
13
18
|
export { CHROME_UNAVAILABLE_MESSAGE } from "./chrome-output.js";
|
|
14
19
|
|
|
15
20
|
const SCHEMES = ["light", "dark"];
|
|
21
|
+
const THEME_RESOLVE_GUIDANCE = `See ${CLI_BINARY_NAME} theme resolve.`;
|
|
22
|
+
|
|
23
|
+
const RECIPE_BAR_ICON = "recipe-tag-icon";
|
|
24
|
+
export const RECIPE_TAG_ICON_CONTRAST = "theme.recipe_tag_icon_contrast";
|
|
25
|
+
|
|
26
|
+
async function measureBadgePaint(suite, settings, rootSurface) {
|
|
27
|
+
if (settings === undefined) return { light: [], dark: [] };
|
|
28
|
+
const { parsePaintColor, compositePaint, paintRequiredRatio } = await loadEspalierShared("paint-color.js");
|
|
29
|
+
const hasFocusRing = supportsBadgeFocusRing();
|
|
30
|
+
const mode = normalizePageTagBadges(settings.pageTagBadges);
|
|
31
|
+
const barContents = normalizeRecipeTagsContent(settings.recipeTagsContent);
|
|
32
|
+
const hasTagLinks = Object.keys(settings.tagDestinations ?? {}).length > 0;
|
|
33
|
+
const hasMetadataLinks = Object.keys(settings.recipeMetadataDestinations ?? {}).length > 0;
|
|
34
|
+
const barLinks = hasTagLinks || (barContents !== "tags" && hasMetadataLinks);
|
|
35
|
+
const barIcon = normalizeRecipeTagsIcon(settings.recipeTagsIcon) !== "none";
|
|
36
|
+
const resolveBarColor = (value, fallback, colors) => {
|
|
37
|
+
// Theme resolve accepts partially edited preferences as optional evidence.
|
|
38
|
+
if (value != null && typeof value !== "string") return null;
|
|
39
|
+
const paint = resolveRecipeTagsBarColor(value, fallback);
|
|
40
|
+
const absolute = paint.startsWith("var(") ? colors.get(paint.slice(4, -1)) : paint;
|
|
41
|
+
return absolute === undefined ? null : parsePaintColor(absolute);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
return Object.fromEntries(SCHEMES.map(scheme => [scheme, (suite[scheme] ?? []).flatMap(surface => {
|
|
45
|
+
const context = surface.surface === rootSurface ? null : surface.surface;
|
|
46
|
+
const colors = new Map(surface.tokens.map(({ token, resolved }) => [semanticToCSS(token), resolved]));
|
|
47
|
+
const parsed = (token) => {
|
|
48
|
+
const color = colors.get(token);
|
|
49
|
+
return color === undefined ? null : parsePaintColor(color);
|
|
50
|
+
};
|
|
51
|
+
const page = parsed("--esp-color-background");
|
|
52
|
+
const card = parsed("--esp-color-layer-1");
|
|
53
|
+
const barPaint = resolveBarColor(settings.recipeTagsBarBackground, RECIPE_TAGS_BAR_PAINT_DEFAULTS.background, colors);
|
|
54
|
+
// The tag bar paints over the recipe card's layer 1, including when its authored fill is translucent.
|
|
55
|
+
const bar = barPaint && card ? compositePaint(barPaint, card) : null;
|
|
56
|
+
const authoredRing = surface.componentProperties.find(({ name }) => name === BADGE_FOCUS_RING);
|
|
57
|
+
const ring = !hasFocusRing ? null
|
|
58
|
+
: authoredRing === undefined ? parsed("--esp-color-link") : parsePaintColor(authoredRing.resolved);
|
|
59
|
+
const icon = resolveBarColor(settings.recipeTagsBarColor, RECIPE_TAGS_BAR_PAINT_DEFAULTS.ink, colors);
|
|
60
|
+
const pairs = [];
|
|
61
|
+
const add = (element, foreground, ink, background, ground, state, kind) => {
|
|
62
|
+
if (!ink || !ground) return;
|
|
63
|
+
pairs.push({ element, foreground, background, state, kind,
|
|
64
|
+
required: paintRequiredRatio(kind), ratio: wcagRatio(compositePaint(ink, ground), ground) });
|
|
65
|
+
};
|
|
66
|
+
if (hasTagLinks && mode !== "none") add("linked-badge", BADGE_FOCUS_RING, ring, "page", page, "focus", "ring");
|
|
67
|
+
if (hasTagLinks && mode === "page-and-cards") {
|
|
68
|
+
add("linked-badge", BADGE_FOCUS_RING, ring, "card", card, "focus", "ring");
|
|
69
|
+
add("linked-badge", BADGE_FOCUS_RING, ring, "card-hover", parsed("--esp-color-layer-2"), "hover-focus", "ring");
|
|
70
|
+
}
|
|
71
|
+
if (barLinks) add("linked-badge", BADGE_FOCUS_RING, ring, "recipe-tag-bar", bar, "focus", "ring");
|
|
72
|
+
if (barIcon) add(RECIPE_BAR_ICON, "recipeTagsBarColor", icon, "recipe-tag-bar", bar, "rest", "graphic");
|
|
73
|
+
return pairs.length ? [{ role: "tag-badges", context, pairs }] : [];
|
|
74
|
+
})]));
|
|
75
|
+
}
|
|
16
76
|
|
|
17
77
|
function fieldFor(role, context, scheme, pair, brandColorSourceFields) {
|
|
18
78
|
const brandColorField = pair.foreground === "brand-color" ? brandColorSourceFields[scheme] : undefined;
|
|
19
79
|
if (brandColorField !== undefined) {
|
|
20
80
|
return { field: `site-header.${brandColorField}`, file: APPEARANCE_FILES[SETTINGS_TYPE_SITE_HEADER] };
|
|
21
81
|
}
|
|
82
|
+
if (pair.element === RECIPE_BAR_ICON) {
|
|
83
|
+
return { field: "site-publishing-preferences.recipeTagsBarColor", file: APPEARANCE_FILES[SETTINGS_TYPE_SITE_PUBLISHING_PREFERENCES] };
|
|
84
|
+
}
|
|
85
|
+
if (role === "tag-badges") {
|
|
86
|
+
const theme = context === null ? `${scheme}Theme` : `${scheme}Theme.contexts.${context}`;
|
|
87
|
+
return { field: `${theme}.componentProperties.${BADGE_FOCUS_RING}`, file: THEME_STYLES_FILE };
|
|
88
|
+
}
|
|
22
89
|
if (context === null) return { field: `${scheme}Theme`, file: THEME_STYLES_FILE };
|
|
23
90
|
return role === "header"
|
|
24
91
|
? { field: "site-header.context", file: APPEARANCE_FILES[SETTINGS_TYPE_SITE_HEADER] }
|
|
@@ -26,9 +93,14 @@ function fieldFor(role, context, scheme, pair, brandColorSourceFields) {
|
|
|
26
93
|
}
|
|
27
94
|
|
|
28
95
|
async function extraPaintEntries(nameReportEnabled) {
|
|
29
|
-
if (nameReportEnabled !== true) return taprootCatalog;
|
|
30
96
|
const { PAINT_CATALOG } = await loadEspalierShared("paint-catalog.js");
|
|
31
|
-
|
|
97
|
+
const hasFittedFooter = PAINT_CATALOG.footer.some(entry => entry.foreground === "footer-link-ink");
|
|
98
|
+
const footer = hasFittedFooter ? taprootCatalog.footer : taprootCatalog.footer.map(entry =>
|
|
99
|
+
entry.foreground === "footer-link-ink" ? { ...entry, foreground: "link" } : entry);
|
|
100
|
+
return {
|
|
101
|
+
...taprootCatalog,
|
|
102
|
+
footer: nameReportEnabled === true ? [...footer, ...standaloneFooterActionEntries(PAINT_CATALOG.footer)] : footer,
|
|
103
|
+
};
|
|
32
104
|
}
|
|
33
105
|
|
|
34
106
|
/** Measure optional chrome without changing the command that accepted the appearance. */
|
|
@@ -43,13 +115,15 @@ export async function completeChromeReport(inputs, { loadFit = loadFitReport } =
|
|
|
43
115
|
if (!light || !dark) throw new Error("Missing accepted theme pair.");
|
|
44
116
|
const fit = await loadFit();
|
|
45
117
|
const extraEntries = await extraPaintEntries(nameReportEnabled);
|
|
46
|
-
const
|
|
118
|
+
const suite = fit.themeFitReportSuite(light, dark, { paintSurfaces: input.paintSurfaces, extraEntries });
|
|
119
|
+
const { paint: entries } = suite;
|
|
120
|
+
const badges = await measureBadgePaint(suite, input.badgeSettings, fit.ROOT_SURFACE);
|
|
47
121
|
const flags = [];
|
|
48
122
|
const warnings = [];
|
|
49
123
|
let pairs = 0;
|
|
50
124
|
for (const scheme of SCHEMES) {
|
|
51
|
-
for (const { role, context, pairs: measured } of entries[scheme]) {
|
|
52
|
-
pairs += measured.length;
|
|
125
|
+
for (const { role, context, pairs: measured } of [...entries[scheme], ...badges[scheme]]) {
|
|
126
|
+
pairs += measured.filter(({ element }) => element !== RECIPE_BAR_ICON).length;
|
|
53
127
|
for (const pair of measured) {
|
|
54
128
|
if (pair.ratio >= pair.required) continue;
|
|
55
129
|
const { element, foreground, background, state, kind, required } = pair;
|
|
@@ -57,8 +131,12 @@ export async function completeChromeReport(inputs, { loadFit = loadFitReport } =
|
|
|
57
131
|
const ratio = displayChromeRatio(pair.ratio, required);
|
|
58
132
|
const shownRatio = ratio.toFixed(2);
|
|
59
133
|
const shownRequirement = required.toFixed(2);
|
|
134
|
+
const location = role === "tag-badges" && context !== null ? ` in context '${displayChromeContext(context).context}'` : "";
|
|
135
|
+
const decorative = element === RECIPE_BAR_ICON;
|
|
136
|
+
const code = decorative ? RECIPE_TAG_ICON_CONTRAST : CONTRAST_TEXT_BELOW_AA;
|
|
137
|
+
const paint = `${describeChromeToken(foreground, role)} over ${describeChromeToken(background, role)}`;
|
|
60
138
|
flags.push({
|
|
61
|
-
code
|
|
139
|
+
code,
|
|
62
140
|
area: "presentation",
|
|
63
141
|
file,
|
|
64
142
|
field,
|
|
@@ -68,22 +146,23 @@ export async function completeChromeReport(inputs, { loadFit = loadFitReport } =
|
|
|
68
146
|
context,
|
|
69
147
|
ratio,
|
|
70
148
|
required,
|
|
71
|
-
message: `${role} ${element}/${state}
|
|
149
|
+
message: `${role} ${element}/${state}${location} paints ${paint} at ${shownRatio}:1. ${decorative ? "Aim for" : "It needs"} ${shownRequirement}:1. ${THEME_RESOLVE_GUIDANCE}`,
|
|
72
150
|
role,
|
|
73
151
|
element,
|
|
74
152
|
state,
|
|
75
153
|
kind,
|
|
76
154
|
});
|
|
77
155
|
warnings.push(
|
|
78
|
-
`chrome: ${
|
|
156
|
+
`chrome: ${code}; ${field}; ${scheme} ${role} ${element}/${state}${location}; ${shownRatio}:1 < ${shownRequirement}:1. ${paint}. ${THEME_RESOLVE_GUIDANCE}`,
|
|
79
157
|
);
|
|
80
158
|
}
|
|
81
159
|
}
|
|
82
160
|
}
|
|
83
|
-
return { entries, flags, warnings, contrast: { pairs, belowAa: flags.length }, navigationUnavailable, unavailable: false };
|
|
161
|
+
return { entries, badges, flags, warnings, contrast: { pairs, belowAa: flags.filter(({ code }) => code === CONTRAST_TEXT_BELOW_AA).length }, navigationUnavailable, unavailable: false };
|
|
84
162
|
} catch {
|
|
85
163
|
return {
|
|
86
164
|
entries: { light: [], dark: [] },
|
|
165
|
+
badges: { light: [], dark: [] },
|
|
87
166
|
flags: [],
|
|
88
167
|
warnings: [CHROME_UNAVAILABLE_MESSAGE],
|
|
89
168
|
contrast: { pairs: 0, belowAa: 0 },
|
package/src/cli.js
CHANGED
|
@@ -85,6 +85,7 @@ import {
|
|
|
85
85
|
getPageTypeReference,
|
|
86
86
|
getSettingsReference,
|
|
87
87
|
getThemeReference,
|
|
88
|
+
getTokenReference,
|
|
88
89
|
getWorkflowReference,
|
|
89
90
|
listComponentTypeReferences,
|
|
90
91
|
listDesignBlueprints,
|
|
@@ -100,7 +101,7 @@ import { assertCliCurrent } from "./session.js";
|
|
|
100
101
|
import { ApiError } from "./transport.js";
|
|
101
102
|
import { imageDescriptionOptions, imageListOptions, requireImageId } from "./image-description-contract.js";
|
|
102
103
|
import { formatThemeResolve } from "./theme-resolve.js";
|
|
103
|
-
import {
|
|
104
|
+
import { encodePageTokenReach } from "./token-reach.js";
|
|
104
105
|
import { VERB_HANDLERS } from "./verbs/index.js";
|
|
105
106
|
import { siteNeedsWorkspaceError } from "./verbs/validate.js";
|
|
106
107
|
|
|
@@ -166,7 +167,8 @@ const VERBS = Object.freeze([
|
|
|
166
167
|
+ "sign-in, so it is refused with a directory argument or --init (validate.site_needs_workspace), and a managed "
|
|
167
168
|
+ "Docs site is not read. Known author-entered metadata also receives missing, "
|
|
168
169
|
+ "short, long and repeated-title description advice (title guidance 15–70 characters; description 50–160). "
|
|
169
|
-
+ "These are writing suggestions, never requirements.
|
|
170
|
+
+ "These are writing suggestions, never requirements. The terminal lists errors and publishing warnings "
|
|
171
|
+
+ "ahead of title and description advice. Generated custom values are checked; generated "
|
|
170
172
|
+ "defaults, home-page settings and unknown fields are listed in siteChecks.deferredToDeployment. "
|
|
171
173
|
+ "siteChecks.checkedInEditor names rules only the page editor evaluates, such as a selected cover; "
|
|
172
174
|
+ "siteChecks.checkedBySite names rules whose evidence comes from site records; 'status' reads their "
|
|
@@ -711,22 +713,36 @@ const VERBS = Object.freeze([
|
|
|
711
713
|
tokens: ["theme", "resolve"],
|
|
712
714
|
json: true,
|
|
713
715
|
resolveOptions: true,
|
|
714
|
-
summary: "
|
|
716
|
+
summary: "Show resolved theme colors and component properties by scheme and context.",
|
|
715
717
|
note: "Reads the pulled workspace's settings/taproot-styles.json offline (run pull first; no credential, no network) "
|
|
716
718
|
+ "and compiles it through Espalier's own pipeline, the one theme push lints and the published page renders "
|
|
717
|
-
+ "through, so a value here cannot differ from the render. For
|
|
719
|
+
+ "through, so a value here cannot differ from the render. For an enabled footer, the report includes its "
|
|
720
|
+
+ "resting link and heading inks against the painted layer2 surface. For the root page and every declared context in "
|
|
718
721
|
+ "each scheme it lists every semantic color token as oklch and hex (hex is the sRGB the engine gamut-maps the "
|
|
719
722
|
+ "color to), whether it is compiled from the roles or pinned in semanticMappings (origin compiled, pinned, "
|
|
720
|
-
+ "or inherited_pin for a root pin a context carries), and the ramp stop or anchor it came from.
|
|
721
|
-
+ "
|
|
723
|
+
+ "or inherited_pin for a root pin a context carries), and the ramp stop or anchor it came from. Each token "
|
|
724
|
+
+ "names its static role plan and explains any contrast adjustment, including a passing lightness stop when "
|
|
725
|
+
+ "one exists. The paint catalog shows where pinned and adjusted colors are used. It also "
|
|
726
|
+
+ "measures the semantic ink-on-surface pairings (text on background, links, headings, the action "
|
|
722
727
|
+ "label, and so on): the WCAG ratio against the AA minimum (4.5:1 for text, 3:1 for large text and UI) and "
|
|
723
728
|
+ "the APCA Lc against Espalier's target. A pair under AA is listed in flags with the stable code "
|
|
724
729
|
+ "theme.contrast_text_below_aa and the field to edit (for example "
|
|
725
730
|
+ "darkTheme.contexts.inverted); flags never refuse, so the exit code stays 0. An invalid or incomplete theme "
|
|
726
731
|
+ "is refused with the code theme push and validate use, the first fault in error.code and error.field. Without --json the output "
|
|
727
|
-
+ "is a readable table
|
|
732
|
+
+ "is a readable table. JSON lists tokens, pairs and componentProperties in schemes[].surfaces[], plus contrast "
|
|
733
|
+
+ "and flags. Each component row records its authored and resolved values, whether a context overrides the "
|
|
734
|
+
+ "root, and the APCA measurements and adjustment for a paired color. WCAG ratios cover the semantic and site-chrome pairs. "
|
|
728
735
|
+ "--scheme and --context narrow the output only; the whole pair is always validated. A result too large for "
|
|
729
|
-
+ "the output bound
|
|
736
|
+
+ "the output bound lists omittedSurfaces. Retry an omitted named context with --scheme and --context, "
|
|
737
|
+
+ "or an omitted root with --scheme. The root retry keeps its scheme's named contexts and chrome. "
|
|
738
|
+
+ "omittedSurfaces.retryRootSchemes names roots that fit on retry, even if the omission list is truncated. "
|
|
739
|
+
+ "Full context names are under lightTheme.contexts and darkTheme.contexts in settings/taproot-styles.json. "
|
|
740
|
+
+ "When using --site, run taproot-site pull in a separate workspace for the same site to preserve local edits. "
|
|
741
|
+
+ "The reason surface_too_large means the surface exceeds the output bound under its narrowest selection. "
|
|
742
|
+
+ "The command reports theme.resolve_surface_too_large when a single selected surface cannot fit "
|
|
743
|
+
+ "or every selected surface is individually oversized. "
|
|
744
|
+
+ "If the paint catalog does not fit, omittedTokens lists the missing paint entries. See taproot-site help tokens for the full catalog. "
|
|
745
|
+
+ "--site reads the site's stored theme "
|
|
730
746
|
+ "instead of the workspace (the effective theme pull would write), which compares a workspace edit with what is "
|
|
731
747
|
+ "live: run it with and without --site. A pair under AA is a finding to read, not a failure: a brand color "
|
|
732
748
|
+ "may be a deliberate choice. See 'taproot-site help theme'.",
|
|
@@ -736,9 +752,11 @@ const VERBS = Object.freeze([
|
|
|
736
752
|
surface: SURFACE_DOCS_PRESENTATION,
|
|
737
753
|
capabilities: [CAPABILITY_DESIGN],
|
|
738
754
|
tokens: ["footer", "push"],
|
|
755
|
+
dryRun: true,
|
|
739
756
|
summary: "Validate and replace the workspace's complete footer document.",
|
|
740
757
|
note: "Run pull first. The command validates the whole closed footer locally, uses the pulled draft hash,"
|
|
741
|
-
+ " and refuses a concurrent remote edit with re-pull guidance."
|
|
758
|
+
+ " and refuses a concurrent remote edit with re-pull guidance. --dry-run reads the current draft and reports"
|
|
759
|
+
+ " changed JSON paths, staleness and fit findings without writing to the site or workspace.",
|
|
742
760
|
},
|
|
743
761
|
{
|
|
744
762
|
name: VERB_MEDIA_UPLOAD,
|
|
@@ -828,7 +846,9 @@ const VERBS = Object.freeze([
|
|
|
828
846
|
summary: "Deploy to staging, or promote staging to production.",
|
|
829
847
|
target: true,
|
|
830
848
|
handoffOptions: true,
|
|
831
|
-
note: "deploy
|
|
849
|
+
note: "If deploy.hosting_unavailable names Hosting, check stagingHosting in status. Activate the staging "
|
|
850
|
+
+ "hostname in Settings > Licence & domain. For a missing Taproot-provided address on a local stack, "
|
|
851
|
+
+ "check its user-content domain configuration. deploy --staging does not report a review URL, because the URL is a live single-use credential and this "
|
|
832
852
|
+ "JSON is often saved to logs. Run 'staging review' to mint one, or pass --handoff to get a fresh "
|
|
833
853
|
+ "single-use one in stagingPreview.url (on a managed Docs site too, where it stages settings only): open it "
|
|
834
854
|
+ "once, then switch the site's theme toggle to review both schemes before deploy --production. Without "
|
|
@@ -902,9 +922,10 @@ const VERBS = Object.freeze([
|
|
|
902
922
|
surface: SURFACE_DOCS_PRESENTATION,
|
|
903
923
|
capabilities: [CAPABILITY_DEPLOYMENTS],
|
|
904
924
|
tokens: ["staging", "review"],
|
|
905
|
-
summary: "Mint a fresh single-use review handoff for the site's staging
|
|
925
|
+
summary: "Mint a fresh single-use review handoff for the site's first or later acknowledged staging release.",
|
|
906
926
|
reviewPath: true,
|
|
907
|
-
note: "
|
|
927
|
+
note: "Run deploy --staging first. staging.deployment_required means no staging release has been acknowledged yet. "
|
|
928
|
+
+ "The handoff URL is reported only in the final JSON as stagingPreview.url; keep it private. --path <page> opens the review on that page instead of the "
|
|
908
929
|
+ "home page: a page path as 'pull' records it ('about', '/posts/one'), optionally with a query. Open it once, then use the site's theme toggle to review both "
|
|
909
930
|
+ "schemes. deploy --staging and redirects check report no review URL unless you pass --handoff, so this is "
|
|
910
931
|
+ "the usual way to get one, on a managed Docs site too. "
|
|
@@ -919,7 +940,8 @@ const VERBS = Object.freeze([
|
|
|
919
940
|
tokens: ["status"],
|
|
920
941
|
summary:
|
|
921
942
|
"Report the platform authoring switch, CLI release, deployments, readiness, image processing, and site health.",
|
|
922
|
-
note: "
|
|
943
|
+
note: "stagingHosting reports staging host setup separately from candidate readiness. If the host is missing, "
|
|
944
|
+
+ "check the site's Licence & domain settings and local staging host configuration. siteHealth summarizes the stored Site Health report of the last production release, with its findings (a rule id, severity, page, and the value found); stagedSiteHealth summarizes the staged release's report."
|
|
923
945
|
+ " Both read what a release stored when it was generated, so edits made since are outside them; run 'health --staging' or 'health --production' for each finding's file and fix."
|
|
924
946
|
+ " Content permission is required; a refused or failed production read fails status rather than reporting a clean site, and a failed staged read is reported as unavailable.",
|
|
925
947
|
},
|
|
@@ -946,7 +968,8 @@ const VERBS = Object.freeze([
|
|
|
946
968
|
+ "supplies a safe description, and otherwise needsDescription. With --staging each finding says "
|
|
947
969
|
+ "newSinceProduction, and comparison says whether production had a report to compare with; without one "
|
|
948
970
|
+ "every finding is listed as not compared. Both lists are bounded by size, with findingsTotal, "
|
|
949
|
-
+ "imageFindingsTotal and the truncation flags.
|
|
971
|
+
+ "imageFindingsTotal and the truncation flags. The terminal output for health and deploy --staging lists errors "
|
|
972
|
+
+ "and publishing warnings ahead of title and description advice. A site with no stored report says available false and why. "
|
|
950
973
|
+ "A managed Docs site returns covered false. Content permission is required.",
|
|
951
974
|
},
|
|
952
975
|
]);
|
|
@@ -1358,6 +1381,7 @@ function parseReferenceArguments(arguments_) {
|
|
|
1358
1381
|
|| topic === "media"
|
|
1359
1382
|
|| topic === "preview"
|
|
1360
1383
|
|| topic === "theme"
|
|
1384
|
+
|| topic === "tokens"
|
|
1361
1385
|
|| topic === "appearance"
|
|
1362
1386
|
|| topic === "settings"
|
|
1363
1387
|
|| topic === "footer"
|
|
@@ -1409,7 +1433,11 @@ function referenceResult(parsed) {
|
|
|
1409
1433
|
{ alternatives: PAGE_TYPES },
|
|
1410
1434
|
);
|
|
1411
1435
|
}
|
|
1412
|
-
return {
|
|
1436
|
+
return {
|
|
1437
|
+
...result,
|
|
1438
|
+
topic: "page",
|
|
1439
|
+
page: parsed.json ? { ...page, tokenReach: encodePageTokenReach(page.tokenReach) } : page,
|
|
1440
|
+
};
|
|
1413
1441
|
}
|
|
1414
1442
|
case "component": {
|
|
1415
1443
|
const component = getComponentReference(parsed.subject);
|
|
@@ -1464,6 +1492,8 @@ function referenceResult(parsed) {
|
|
|
1464
1492
|
}
|
|
1465
1493
|
case "theme":
|
|
1466
1494
|
return { ...result, topic: "presentation", referenceKind: "theme", reference: getThemeReference() };
|
|
1495
|
+
case "tokens":
|
|
1496
|
+
return { ...result, topic: "tokens", ...getTokenReference() };
|
|
1467
1497
|
case "appearance":
|
|
1468
1498
|
return { ...result, topic: "presentation", referenceKind: "appearance", reference: getAppearanceReference() };
|
|
1469
1499
|
case "settings":
|
|
@@ -1607,7 +1637,6 @@ function parseThemeContext(arguments_, index) {
|
|
|
1607
1637
|
if (
|
|
1608
1638
|
typeof candidate !== "string"
|
|
1609
1639
|
|| candidate.length === 0
|
|
1610
|
-
|| [...candidate].length > MAXIMUM_THEME_OPEN_MAP_KEY_SCALARS
|
|
1611
1640
|
|| hasAsciiControl(candidate)
|
|
1612
1641
|
|| candidate.startsWith("--")
|
|
1613
1642
|
) {
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { BUILT_IN_IMAGE_TEXTURES } from "@taprootio/espalier/shared/image-texture-registry";
|
|
7
7
|
import registry from "./free-form-section-registry.json" with { type: "json" };
|
|
8
8
|
import { hasAsciiControl } from "../errors.js";
|
|
9
|
+
import { validateAuthoredTagNames } from "../authored-tag-names.js";
|
|
9
10
|
import { isSocialLinkUrl, SOCIAL_LINK_URL_MAX_LENGTH, trimSocialLinkInput } from "../social-link-url.js";
|
|
10
11
|
import socialPlatforms from "../social-platforms.json" with { type: "json" };
|
|
11
12
|
import { IMAGE_DESCRIPTION_MODES } from "./image-description-validation.js";
|
|
@@ -271,10 +272,13 @@ const LATEST_POSTS = Object.freeze({
|
|
|
271
272
|
integer: true,
|
|
272
273
|
minimum: 1,
|
|
273
274
|
maximum: 12,
|
|
274
|
-
|
|
275
|
+
alternate: "all",
|
|
276
|
+
description: 'Show 1 to 12 posts, or "all" for every match. A count of 1 spans the full width.',
|
|
275
277
|
}),
|
|
276
278
|
columns: num({ values: Object.freeze([1, 2, 3, 4]) }),
|
|
277
279
|
pageTypes: list(enumOf(...LATEST_POST_PAGE_TYPES)),
|
|
280
|
+
tags: list(str({ nonWhitespace: true }), { tagNames: true }),
|
|
281
|
+
tagMatch: enumOf("any", "all"),
|
|
278
282
|
showPinned: bool(),
|
|
279
283
|
highlightFirst: bool(),
|
|
280
284
|
showDescription: bool(),
|
|
@@ -768,7 +772,7 @@ const COMPONENT_DEFINITIONS = Object.freeze({
|
|
|
768
772
|
"latest-posts": component(
|
|
769
773
|
LATEST_POSTS,
|
|
770
774
|
"Latest Posts",
|
|
771
|
-
"Generation-time list of
|
|
775
|
+
"Generation-time list of published pages, optionally filtered by page type and authored tags.",
|
|
772
776
|
{
|
|
773
777
|
count: 6,
|
|
774
778
|
columns: 3,
|
|
@@ -781,7 +785,13 @@ const COMPONENT_DEFINITIONS = Object.freeze({
|
|
|
781
785
|
borderWidth: 1,
|
|
782
786
|
bannerScheme: "auto",
|
|
783
787
|
},
|
|
784
|
-
[
|
|
788
|
+
[
|
|
789
|
+
"Use tags with tagMatch any (the default) or all. Names are case-insensitive. Omit tags or pass [] for no tag filter.",
|
|
790
|
+
"Assign the tags to pages first or in the same pages push. Validate warns about names absent from the pulled catalog. Pages push refuses them before sending pages, and deploy checks against the current site catalog.",
|
|
791
|
+
"The listing skips its own page. Tagged lists exclude member-only pages. Pinned matches come first by default, then newest by displayed date.",
|
|
792
|
+
"The count defaults to 6. Set count to the string all for every match, with no listing cap or pagination. Thumbnails load lazily.",
|
|
793
|
+
"No matches render no grid. Taproot does not generate tag pages. Create a free-form page and place the listing in its body.",
|
|
794
|
+
],
|
|
785
795
|
{
|
|
786
796
|
count: 6,
|
|
787
797
|
columns: 3,
|
|
@@ -1162,6 +1172,10 @@ function referenceSchema(spec) {
|
|
|
1162
1172
|
};
|
|
1163
1173
|
case "number": {
|
|
1164
1174
|
const schema = { type: spec.integer ? "integer" : "number" };
|
|
1175
|
+
if (spec.alternate !== undefined) {
|
|
1176
|
+
const { alternate, description, ...numeric } = spec;
|
|
1177
|
+
return { anyOf: [referenceSchema(numeric), { type: "string", enum: [alternate] }], description };
|
|
1178
|
+
}
|
|
1165
1179
|
if (spec.values) schema.enum = [...spec.values];
|
|
1166
1180
|
if (spec.minimum !== undefined) schema.minimum = spec.minimum;
|
|
1167
1181
|
if (spec.maximum !== undefined) schema.maximum = spec.maximum;
|
|
@@ -1330,8 +1344,9 @@ function validateValue(spec, value, path, errors) {
|
|
|
1330
1344
|
if (typeof value !== "string" || !spec.values.includes(value)) fail(describe(spec));
|
|
1331
1345
|
return;
|
|
1332
1346
|
case "number": {
|
|
1347
|
+
if (spec.alternate !== undefined && value === spec.alternate) return;
|
|
1333
1348
|
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
1334
|
-
fail(describe(spec));
|
|
1349
|
+
fail(spec.alternate === undefined ? describe(spec) : `${describe(spec)} or "${spec.alternate}"`);
|
|
1335
1350
|
return;
|
|
1336
1351
|
}
|
|
1337
1352
|
if (spec.values && !spec.values.includes(value)) {
|
|
@@ -1350,6 +1365,14 @@ function validateValue(spec, value, path, errors) {
|
|
|
1350
1365
|
return;
|
|
1351
1366
|
}
|
|
1352
1367
|
case "array": {
|
|
1368
|
+
if (spec.tagNames) {
|
|
1369
|
+
const result = validateAuthoredTagNames(value);
|
|
1370
|
+
if ("field" in result) {
|
|
1371
|
+
const match = /^tags\[(\d+)\]$/u.exec(result.field);
|
|
1372
|
+
errors.push(contentError(match ? `${path}/${match[1]}` : path, CODES.componentData, result.reason));
|
|
1373
|
+
}
|
|
1374
|
+
return;
|
|
1375
|
+
}
|
|
1353
1376
|
if (!Array.isArray(value)) {
|
|
1354
1377
|
fail("an array");
|
|
1355
1378
|
return;
|
|
@@ -61,7 +61,8 @@ export function newTabAttributeMarkup(rel) {
|
|
|
61
61
|
* `esp-button` read alike. `generator/browser-tests/new-tab-cue.spec.ts` holds
|
|
62
62
|
* the two together.
|
|
63
63
|
*/
|
|
64
|
-
export const
|
|
64
|
+
export const NEW_TAB_LABEL = "opens in a new tab";
|
|
65
|
+
export const NEW_TAB_CUE_TEXT = ` (${NEW_TAB_LABEL})`;
|
|
65
66
|
/**
|
|
66
67
|
* The cue for a native anchor, as its last child. Pagefind indexes raw HTML, so
|
|
67
68
|
* `data-pagefind-ignore` keeps the words out of search content and excerpts.
|