@taprootio/site-authoring 0.41.1 → 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 +50 -0
- 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 +170 -11
- package/src/appearance-contract.js +278 -8
- package/src/authored-tag-names.js +88 -0
- package/src/block-flow.js +103 -1
- package/src/brand-color.js +39 -4
- package/src/breadcrumb-artwork.js +234 -0
- package/src/breadcrumb-separators.js +11 -0
- package/src/changelog.json +154 -0
- package/src/chrome-features.js +152 -0
- package/src/chrome-input.js +147 -0
- package/src/chrome-output.js +92 -0
- package/src/chrome-paint-catalog-taproot.json +52 -0
- package/src/chrome-report.js +173 -0
- package/src/cli.js +48 -17
- 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 +25 -2
- package/src/footer-content.js +38 -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 +60 -16
- package/src/header-presentation.js +16 -0
- 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 +312 -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 +25 -5
- package/src/site-check-rules.json +3 -1
- package/src/site-health-findings.js +13 -13
- package/src/site-navigation-groups.js +70 -0
- 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 +305 -51
- package/src/theme-validation.js +126 -6
- 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 +249 -120
- package/src/verbs/theme-resolve.js +310 -47
- package/src/verbs/validate.js +71 -17
- package/src/workspace-check.js +37 -4
- package/src/workspace.js +37 -1
- package/test/fixtures/default-site-theme.json +516 -0
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
// Generated from shared/breadcrumb-artwork.ts by scripts/sync-field-validation.mjs. Do not edit.
|
|
2
|
+
export const BREADCRUMB_ARTWORK_FIELDS = ["breadcrumbSeparatorArtwork", "breadcrumbTrailEndArtwork"];
|
|
3
|
+
export const BREADCRUMB_ARTWORK_MAX_BYTES = 8192;
|
|
4
|
+
const MAX_PATHS = 16;
|
|
5
|
+
const MAX_PATH_LENGTH = 1024;
|
|
6
|
+
const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
|
|
7
|
+
const PAINT = /^(?:none|currentColor|#[0-9a-fA-F]{3}|#[0-9a-fA-F]{6})$/u;
|
|
8
|
+
const PATH_DATA = /^[Mm][MmLlHhVvCcSsQqTtAaZz0-9eE.,+\- ]*$/u;
|
|
9
|
+
const NUMBER = "[+-]?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)";
|
|
10
|
+
const VIEW_BOX = new RegExp("^" + Array(4).fill(NUMBER).join(" ") + "$", "u");
|
|
11
|
+
const STROKE_WIDTH = /^(?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+)$/u;
|
|
12
|
+
const XML_SPACE = /[ \t\r\n]+/gu;
|
|
13
|
+
const PATH_SEGMENT = /([MmLlHhVvCcSsQqTtAaZz])([^MmLlHhVvCcSsQqTtAaZz]*)/gu;
|
|
14
|
+
const PATH_NUMBER = new RegExp(NUMBER + "(?:[eE][+-]?[0-9]+)?", "gu");
|
|
15
|
+
const COMMAND_ARGUMENTS = {
|
|
16
|
+
m: 2, l: 2, h: 1, v: 1, c: 6, s: 4, q: 4, t: 2, a: 7, z: 0,
|
|
17
|
+
};
|
|
18
|
+
function object(value) {
|
|
19
|
+
return value !== null && typeof value === "object" && !Array.isArray(value)
|
|
20
|
+
? value
|
|
21
|
+
: undefined;
|
|
22
|
+
}
|
|
23
|
+
function parseViewBox(value) {
|
|
24
|
+
if (typeof value !== "string" || !VIEW_BOX.test(value))
|
|
25
|
+
return undefined;
|
|
26
|
+
const coordinates = value.split(" ").map(Number);
|
|
27
|
+
return coordinates.every(coordinate => Math.abs(coordinate) <= 32768) &&
|
|
28
|
+
coordinates[2] > 0 && coordinates[3] > 0 ? value : undefined;
|
|
29
|
+
}
|
|
30
|
+
function isPathData(value) {
|
|
31
|
+
if (!PATH_DATA.test(value))
|
|
32
|
+
return false;
|
|
33
|
+
for (const [, rawCommand, rawArguments] of value.matchAll(PATH_SEGMENT)) {
|
|
34
|
+
const command = rawCommand.toLowerCase();
|
|
35
|
+
const parameters = rawArguments;
|
|
36
|
+
const required = COMMAND_ARGUMENTS[command];
|
|
37
|
+
let count = 0;
|
|
38
|
+
let end = 0;
|
|
39
|
+
for (const argument of parameters.matchAll(PATH_NUMBER)) {
|
|
40
|
+
const gap = parameters.slice(end, argument.index).trim();
|
|
41
|
+
if (gap !== "" && (count === 0 || gap !== ","))
|
|
42
|
+
return false;
|
|
43
|
+
const number = Number(argument[0]);
|
|
44
|
+
if (Math.abs(number) > 32768 || !Number.isFinite(number))
|
|
45
|
+
return false;
|
|
46
|
+
if (command === "a") {
|
|
47
|
+
const position = count % required;
|
|
48
|
+
if (position < 2 && number < 0)
|
|
49
|
+
return false;
|
|
50
|
+
if ((position === 3 || position === 4) && argument[0] !== "0" && argument[0] !== "1")
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
count += 1;
|
|
54
|
+
end = argument.index + argument[0].length;
|
|
55
|
+
}
|
|
56
|
+
if (parameters.slice(end).trim() !== "" ||
|
|
57
|
+
(required === 0 ? count !== 0 : count < required || count % required !== 0))
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
function pathProblem(path) {
|
|
63
|
+
if (path.d.length > MAX_PATH_LENGTH)
|
|
64
|
+
return "has path data longer than " + MAX_PATH_LENGTH + " characters";
|
|
65
|
+
if (!isPathData(path.d))
|
|
66
|
+
return "has invalid d path data";
|
|
67
|
+
for (const attribute of ["fill", "stroke"]) {
|
|
68
|
+
const paint = path[attribute];
|
|
69
|
+
if (!PAINT.test(paint)) {
|
|
70
|
+
const expectation = "Use none, currentColor, #RGB or #RRGGBB";
|
|
71
|
+
return /^[A-Za-z]{1,30}$/u.test(paint)
|
|
72
|
+
? "uses the unsupported named color '" + paint + "' in " + attribute + ". " + expectation
|
|
73
|
+
: "has an invalid " + attribute + " paint. " + expectation;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (!STROKE_WIDTH.test(path.strokeWidth) || Number(path.strokeWidth) > 64) {
|
|
77
|
+
return "needs a numeric stroke-width from 0 through 64";
|
|
78
|
+
}
|
|
79
|
+
if (!["butt", "round", "square"].includes(path.strokeLinecap))
|
|
80
|
+
return "has an invalid stroke-linecap";
|
|
81
|
+
if (!["miter", "round", "bevel"].includes(path.strokeLinejoin))
|
|
82
|
+
return "has an invalid stroke-linejoin";
|
|
83
|
+
if (!["nonzero", "evenodd"].includes(path.fillRule))
|
|
84
|
+
return "has an invalid fill-rule";
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
function parsePath(value) {
|
|
88
|
+
const path = object(value);
|
|
89
|
+
if (path === undefined || Object.keys(path).length !== 7)
|
|
90
|
+
return undefined;
|
|
91
|
+
const { d, fill, stroke, strokeWidth, strokeLinecap, strokeLinejoin, fillRule } = path;
|
|
92
|
+
if (typeof d !== "string" || typeof fill !== "string" || typeof stroke !== "string" ||
|
|
93
|
+
typeof strokeWidth !== "string" || typeof strokeLinecap !== "string" ||
|
|
94
|
+
typeof strokeLinejoin !== "string" || typeof fillRule !== "string")
|
|
95
|
+
return undefined;
|
|
96
|
+
const artworkPath = { d, fill, stroke, strokeWidth, strokeLinecap, strokeLinejoin, fillRule };
|
|
97
|
+
return pathProblem(artworkPath) === undefined ? artworkPath : undefined;
|
|
98
|
+
}
|
|
99
|
+
function fitsArtworkLimit(artwork) {
|
|
100
|
+
return JSON.stringify(artwork).length <= BREADCRUMB_ARTWORK_MAX_BYTES;
|
|
101
|
+
}
|
|
102
|
+
/** Revalidate the stored geometry independently of the write path before rendering it. */
|
|
103
|
+
export function parseBreadcrumbArtwork(value) {
|
|
104
|
+
const artwork = object(value);
|
|
105
|
+
if (artwork === undefined || Object.keys(artwork).length !== 2)
|
|
106
|
+
return undefined;
|
|
107
|
+
const { paths } = artwork;
|
|
108
|
+
const viewBox = parseViewBox(artwork.viewBox);
|
|
109
|
+
if (viewBox === undefined || !Array.isArray(paths) || paths.length < 1 || paths.length > MAX_PATHS)
|
|
110
|
+
return undefined;
|
|
111
|
+
const parsed = paths.map(parsePath);
|
|
112
|
+
if (parsed.some(path => path === undefined))
|
|
113
|
+
return undefined;
|
|
114
|
+
const result = { viewBox, paths: parsed };
|
|
115
|
+
return fitsArtworkLimit(result) ? result : undefined;
|
|
116
|
+
}
|
|
117
|
+
export function decodeBreadcrumbArtwork(value) {
|
|
118
|
+
if (typeof value !== "string" || value.length > BREADCRUMB_ARTWORK_MAX_BYTES || value === "")
|
|
119
|
+
return undefined;
|
|
120
|
+
try {
|
|
121
|
+
return parseBreadcrumbArtwork(JSON.parse(value));
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
return undefined;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
const PAINT_ATTRIBUTES = new Set(["fill", "stroke", "stroke-width", "stroke-linecap", "stroke-linejoin", "fill-rule"]);
|
|
128
|
+
const ROOT_ATTRIBUTES = new Set([...PAINT_ATTRIBUTES, "viewBox", "xmlns", "width", "height"]);
|
|
129
|
+
const PATH_ATTRIBUTES = new Set([...PAINT_ATTRIBUTES, "d"]);
|
|
130
|
+
function parseAttributes(input, allowed) {
|
|
131
|
+
const attributes = Object.create(null);
|
|
132
|
+
const attribute = /[ \t\r\n]+([A-Za-z][A-Za-z0-9-]*)[ \t\r\n]*=[ \t\r\n]*(?:"([^"]*)"|'([^']*)')/uy;
|
|
133
|
+
while (input.slice(attribute.lastIndex).trim() !== "") {
|
|
134
|
+
const match = attribute.exec(input);
|
|
135
|
+
if (match === null)
|
|
136
|
+
return "has a malformed attribute";
|
|
137
|
+
const key = match[1];
|
|
138
|
+
if (!allowed.has(key))
|
|
139
|
+
return "has an unsupported '" + key + "' attribute";
|
|
140
|
+
if (Object.hasOwn(attributes, key))
|
|
141
|
+
return "repeats the '" + key + "' attribute";
|
|
142
|
+
attributes[key] = match[2] ?? match[3];
|
|
143
|
+
}
|
|
144
|
+
return attributes;
|
|
145
|
+
}
|
|
146
|
+
function modePaint(paint, themed) {
|
|
147
|
+
return themed && PAINT.test(paint) && paint !== "none" ? "currentColor" : paint;
|
|
148
|
+
}
|
|
149
|
+
/** Accept only SVG geometry and paint. No original markup reaches the site. */
|
|
150
|
+
export function importBreadcrumbSvg(source, themed) {
|
|
151
|
+
if (source.length > BREADCRUMB_ARTWORK_MAX_BYTES) {
|
|
152
|
+
return { reason: "exceeds " + BREADCRUMB_ARTWORK_MAX_BYTES + " bytes" };
|
|
153
|
+
}
|
|
154
|
+
if (/[^\u0009\u000a\u000d\u0020-\u007e]/u.test(source)) {
|
|
155
|
+
return { reason: "contains non-ASCII or unsupported control characters" };
|
|
156
|
+
}
|
|
157
|
+
const trimmed = source.trim();
|
|
158
|
+
if (trimmed.startsWith("<?xml"))
|
|
159
|
+
return { reason: "contains an XML declaration" };
|
|
160
|
+
if (trimmed.startsWith("<!DOCTYPE"))
|
|
161
|
+
return { reason: "contains a DOCTYPE declaration" };
|
|
162
|
+
const root = /^<svg([ \t\r\n][^<>]*)?>([\s\S]*)<\/svg>$/u.exec(trimmed);
|
|
163
|
+
if (root === null)
|
|
164
|
+
return { reason: "needs a single <svg> root with a closing tag" };
|
|
165
|
+
const attributes = parseAttributes(root[1] ?? "", ROOT_ATTRIBUTES);
|
|
166
|
+
if (typeof attributes === "string")
|
|
167
|
+
return { reason: "'<svg>' " + attributes };
|
|
168
|
+
if (attributes.xmlns !== undefined && attributes.xmlns !== SVG_NAMESPACE) {
|
|
169
|
+
return { reason: "uses an invalid SVG namespace" };
|
|
170
|
+
}
|
|
171
|
+
for (const dimension of ["width", "height"]) {
|
|
172
|
+
const value = attributes[dimension];
|
|
173
|
+
if (value !== undefined && (!STROKE_WIDTH.test(value) || Number(value) <= 0 || Number(value) > 32768)) {
|
|
174
|
+
return { reason: "needs a positive numeric " + dimension + " up to 32768" };
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
const viewBox = attributes.viewBox?.trim().replaceAll(XML_SPACE, " ");
|
|
178
|
+
if (viewBox === undefined)
|
|
179
|
+
return { reason: "is missing its viewBox" };
|
|
180
|
+
if (parseViewBox(viewBox) === undefined) {
|
|
181
|
+
return { reason: "needs a viewBox with four numbers within ±32768 and positive dimensions" };
|
|
182
|
+
}
|
|
183
|
+
const paths = [];
|
|
184
|
+
let remaining = root[2].trim();
|
|
185
|
+
while (remaining !== "") {
|
|
186
|
+
const element = /^<path([ \t\r\n][^<>]*?)(?:\/>|>[ \t\r\n]*<\/path>)/u.exec(remaining);
|
|
187
|
+
if (element === null) {
|
|
188
|
+
const name = /^<([A-Za-z][A-Za-z0-9-]*)/u.exec(remaining)?.[1];
|
|
189
|
+
if (name !== undefined && name !== "path") {
|
|
190
|
+
return { reason: "contains a <" + name + "> element. Use direct <path> elements" };
|
|
191
|
+
}
|
|
192
|
+
return { reason: "needs well-formed, empty <path> elements directly inside <svg>" };
|
|
193
|
+
}
|
|
194
|
+
if (paths.length === MAX_PATHS) {
|
|
195
|
+
return { reason: "contains at least " + (MAX_PATHS + 1) + " paths, limit " + MAX_PATHS };
|
|
196
|
+
}
|
|
197
|
+
const path = parseAttributes(element[1], PATH_ATTRIBUTES);
|
|
198
|
+
const label = "path " + (paths.length + 1) + " ";
|
|
199
|
+
if (typeof path === "string")
|
|
200
|
+
return { reason: label + path };
|
|
201
|
+
if (path.d === undefined)
|
|
202
|
+
return { reason: label + "is missing its d attribute" };
|
|
203
|
+
const parsed = {
|
|
204
|
+
d: path.d.trim().replaceAll(XML_SPACE, " "),
|
|
205
|
+
fill: modePaint(path.fill ?? attributes.fill ?? "#000", themed),
|
|
206
|
+
stroke: modePaint(path.stroke ?? attributes.stroke ?? "none", themed),
|
|
207
|
+
strokeWidth: path["stroke-width"] ?? attributes["stroke-width"] ?? "1",
|
|
208
|
+
strokeLinecap: path["stroke-linecap"] ?? attributes["stroke-linecap"] ?? "butt",
|
|
209
|
+
strokeLinejoin: path["stroke-linejoin"] ?? attributes["stroke-linejoin"] ?? "miter",
|
|
210
|
+
fillRule: path["fill-rule"] ?? attributes["fill-rule"] ?? "nonzero",
|
|
211
|
+
};
|
|
212
|
+
const problem = pathProblem(parsed);
|
|
213
|
+
if (problem !== undefined)
|
|
214
|
+
return { reason: label + problem };
|
|
215
|
+
paths.push(parsed);
|
|
216
|
+
remaining = remaining.slice(element[0].length).trimStart();
|
|
217
|
+
}
|
|
218
|
+
if (paths.length === 0)
|
|
219
|
+
return { reason: "requires at least one <path>" };
|
|
220
|
+
const artwork = { viewBox, paths };
|
|
221
|
+
return fitsArtworkLimit(artwork)
|
|
222
|
+
? { artwork }
|
|
223
|
+
: { reason: "exceeds " + BREADCRUMB_ARTWORK_MAX_BYTES + " bytes after normalization" };
|
|
224
|
+
}
|
|
225
|
+
export function renderBreadcrumbArtwork(value, mirrorRtl) {
|
|
226
|
+
const artwork = decodeBreadcrumbArtwork(value);
|
|
227
|
+
if (artwork === undefined)
|
|
228
|
+
return undefined;
|
|
229
|
+
const paths = artwork.paths.map(path => '<path d="' + path.d + '" fill="' + path.fill + '" stroke="' + path.stroke +
|
|
230
|
+
'" stroke-width="' + path.strokeWidth + '" stroke-linecap="' + path.strokeLinecap +
|
|
231
|
+
'" stroke-linejoin="' + path.strokeLinejoin + '" fill-rule="' + path.fillRule + '"/>').join("");
|
|
232
|
+
return '<svg xmlns="' + SVG_NAMESPACE + '" viewBox="' + artwork.viewBox +
|
|
233
|
+
'" aria-hidden="true" focusable="false"' + (mirrorRtl ? " data-mirror-rtl" : "") + ">" + paths + "</svg>";
|
|
234
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Generated from shared/breadcrumb-separators.ts by scripts/sync-field-validation.mjs. Do not edit.
|
|
2
|
+
export const BREADCRUMB_SEPARATOR_STYLES = ["arrow-filled", "chevron", "line-arrow", "slash", "none"];
|
|
3
|
+
export const BREADCRUMB_SEPARATOR_DEFAULT = BREADCRUMB_SEPARATOR_STYLES[0];
|
|
4
|
+
export const BREADCRUMB_TRAIL_ENDS = ["arrow-down-filled", "same", "none"];
|
|
5
|
+
export const BREADCRUMB_TRAIL_END_DEFAULT = BREADCRUMB_TRAIL_ENDS[0];
|
|
6
|
+
export function normalizeBreadcrumbSeparator(value) {
|
|
7
|
+
return BREADCRUMB_SEPARATOR_STYLES.find(option => option === value) ?? BREADCRUMB_SEPARATOR_DEFAULT;
|
|
8
|
+
}
|
|
9
|
+
export function normalizeBreadcrumbTrailEnd(value) {
|
|
10
|
+
return BREADCRUMB_TRAIL_ENDS.find(option => option === value) ?? BREADCRUMB_TRAIL_END_DEFAULT;
|
|
11
|
+
}
|
package/src/changelog.json
CHANGED
|
@@ -1,5 +1,159 @@
|
|
|
1
1
|
{
|
|
2
2
|
"entries": [
|
|
3
|
+
{
|
|
4
|
+
"version": "0.55.0",
|
|
5
|
+
"note": "Style linked tag badges by state and choose what the recipe card tag bar displays.",
|
|
6
|
+
"behavior": [
|
|
7
|
+
"The recipe bar defaults to authored badges. Help appearance documents recipeTagsContent, recipeMetadataDestinations, and the bar colors.",
|
|
8
|
+
"Validation and theme dry runs refuse unknown style and publishing settings. Breadcrumb refusals name the invalid SVG feature.",
|
|
9
|
+
"Listing tags are checked before push when pull has the site catalog. Destination warnings appear in delete and theme dry runs and deploy.",
|
|
10
|
+
"Linked badges have a separate focus ring color. Theme resolve and validate check ring contrast and warn about low-contrast recipe tag icons.",
|
|
11
|
+
"Public recipes publish recipe markup without an author. Validate and staging deploy advise when a public place review has no credited reviewer.",
|
|
12
|
+
"The published title and its metadata use the site's spacing scale. headingH1SpaceAfter can set the gap from a title to its byline or tags.",
|
|
13
|
+
"Theme push --dry-run checks the proposed recipe tag bar icon and badge focus ring contrast.",
|
|
14
|
+
"Recipe jump and place review Save buttons use compact byline sizing with a larger touch target.",
|
|
15
|
+
"Validate, health and staging deploy print publishing warnings ahead of title and description advice.",
|
|
16
|
+
"The help reference version is 79."
|
|
17
|
+
],
|
|
18
|
+
"help": ["appearance", "theme", "settings", "page", "component"]
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"version": "0.54.0",
|
|
22
|
+
"note": "Author breadcrumb artwork and tag landing pages, and preview footer edits before saving.",
|
|
23
|
+
"behavior": [
|
|
24
|
+
"Help appearance describes breadcrumb SVG files, tag destinations and the combined footer and theme preview.",
|
|
25
|
+
"Help component latest-posts supports tag matching and an all-results count. Help appearance walks through a tag landing page.",
|
|
26
|
+
"Staging review requires an acknowledged staging release. Status shows staging host setup separately from candidate readiness.",
|
|
27
|
+
"The help reference version is 75."
|
|
28
|
+
],
|
|
29
|
+
"help": ["appearance", "footer", "preview", "page", "component"]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"version": "0.53.0",
|
|
33
|
+
"note": "Choose one content inset for the published page and its chrome.",
|
|
34
|
+
"behavior": [
|
|
35
|
+
"Run taproot-site pull before theme push to add contentInset to settings/taproot-styles.json. Small to normal is the default.",
|
|
36
|
+
"Help appearance lists the five choices and their sizes. Both color schemes use the light theme's spacing scale.",
|
|
37
|
+
"The help reference version is 74."
|
|
38
|
+
],
|
|
39
|
+
"help": ["appearance", "page", "settings"]
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"version": "0.52.0",
|
|
43
|
+
"note": "Set exact gaps above and below individual heading levels.",
|
|
44
|
+
"behavior": [
|
|
45
|
+
"Run taproot-site pull before theme push to add the eight heading spacing fields.",
|
|
46
|
+
"Use canonical strings from 0 to 6 rem in quarter-rem steps. Empty follows Block spacing. The string \"0\" sets an exact zero gap.",
|
|
47
|
+
"Help appearance describes when custom gaps apply and which gaps keep the preset. The help reference version is 73."
|
|
48
|
+
],
|
|
49
|
+
"help": ["appearance", "settings"]
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"version": "0.51.0",
|
|
53
|
+
"note": "Publish explicitly authored page tags as neutral badges.",
|
|
54
|
+
"behavior": [
|
|
55
|
+
"Run taproot-site pull before theme push to add pageTagBadges. Off is the default. Enable it for typed page headers or for those headers plus folder and Latest Posts cards.",
|
|
56
|
+
"Set the neutral badge background, text and border in theme component properties. Recipe category, cuisine and method use the same badges.",
|
|
57
|
+
"The help reference version is 72."
|
|
58
|
+
],
|
|
59
|
+
"help": ["appearance", "page", "theme"]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"version": "0.50.0",
|
|
63
|
+
"note": "Style footer links, headings and the aside call to action.",
|
|
64
|
+
"behavior": [
|
|
65
|
+
"Set asideCtaStyle to link, bold-link or button. Footer validation calls out button label overflow at narrow widths.",
|
|
66
|
+
"The footer draft hash is now footer-draft-v9. Run taproot-site pull before saving a footer from an existing workspace.",
|
|
67
|
+
"Help footer lists the new link and heading properties. The help reference version is 71."
|
|
68
|
+
],
|
|
69
|
+
"help": ["footer", "theme"]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"version": "0.49.0",
|
|
73
|
+
"note": "Choose which marks appear between published breadcrumb links and after the last crumb.",
|
|
74
|
+
"behavior": [
|
|
75
|
+
"Run taproot-site pull before theme push to add breadcrumbSeparator and breadcrumbTrailEnd to settings/taproot-styles.json.",
|
|
76
|
+
"Choose the separator color and size in each theme scheme. Published trails show folder ancestors and use the same marks in both schemes.",
|
|
77
|
+
"The help reference version is 70."
|
|
78
|
+
],
|
|
79
|
+
"help": ["appearance", "theme"]
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"version": "0.48.0",
|
|
83
|
+
"note": "Choose separate colors for quote marks and each of the first four heading levels.",
|
|
84
|
+
"behavior": [
|
|
85
|
+
"The published page title and recipe card title follow the per-level theme colors. Body headings use the normalized heading level on published pages.",
|
|
86
|
+
"Help theme explains the quote fill and recipe card contrast surface. Help tokens names the local overrides beside their semantic fallback paints.",
|
|
87
|
+
"The help reference version is 69."
|
|
88
|
+
],
|
|
89
|
+
"help": ["theme", "tokens"]
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"version": "0.47.0",
|
|
93
|
+
"note": "Find what each theme token paints and how contrast changes its color.",
|
|
94
|
+
"behavior": [
|
|
95
|
+
"Help tokens lists each token's role and paints. Help page adds the theme colors and intents used by each page type.",
|
|
96
|
+
"Theme resolve shows selected paints, explains contrast adjustments, and suggests the nearest named lightness stop that reaches the target when one exists.",
|
|
97
|
+
"Validate and theme push name the published header and footer paints behind their contrast warnings.",
|
|
98
|
+
"The help reference version is 68."
|
|
99
|
+
],
|
|
100
|
+
"help": ["page", "theme", "tokens"]
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"version": "0.46.0",
|
|
104
|
+
"note": "Set supported component properties in a theme or named context with Espalier 7.3.0.",
|
|
105
|
+
"behavior": [
|
|
106
|
+
"Footer link-group and aside headings share the normal size. Unclassed footer links keep their underline on hover.",
|
|
107
|
+
"The default breadcrumb separator uses a 70% mix of the crumb color with transparency.",
|
|
108
|
+
"Theme push warns when a length or keyword property resolves to different values in light and dark.",
|
|
109
|
+
"Help theme lists settable properties. Theme resolve reports authored values, context overrides and paired contrast.",
|
|
110
|
+
"Theme push accepts supported component properties per scheme and context. Invalid component properties and unknown theme fields are refused at their field paths, with a suggested name when available.",
|
|
111
|
+
"The help reference version is 67."
|
|
112
|
+
],
|
|
113
|
+
"help": ["appearance", "footer", "theme"]
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"version": "0.45.0",
|
|
117
|
+
"note": "Set and round-trip topic tags on typed pages from the CLI.",
|
|
118
|
+
"behavior": [
|
|
119
|
+
"Article, recipe, album and place review accept a tags array in typed JSON or a one-line JSON array in Markdown front matter.",
|
|
120
|
+
"Pull establishes the tag revision. Omit tags or leave a pulled list unchanged to preserve the site's assignment. Use [] to clear topic tags while keeping the page's system type.",
|
|
121
|
+
"Tagged writes require site.tags.manage and an enabled rollout. Replacements also check the page body and tag revisions before saving.",
|
|
122
|
+
"The help reference version is 66."
|
|
123
|
+
],
|
|
124
|
+
"help": ["page"]
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"version": "0.44.0",
|
|
128
|
+
"note": "Link directly to a recipe card and set the jump control and tag icon for your site.",
|
|
129
|
+
"behavior": [
|
|
130
|
+
"Run taproot-site pull before your next theme push to get the new recipeJumpControl and recipeTagsIcon settings.",
|
|
131
|
+
"Recipe cards have a #recipe anchor. A public recipe can show a link or button below its byline, and the recipe card can show an info, tags or category icon beside its tags or display the tags on their own.",
|
|
132
|
+
"The help reference version is 65."
|
|
133
|
+
],
|
|
134
|
+
"help": ["settings", "appearance", "page"]
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"version": "0.43.0",
|
|
138
|
+
"note": "Find styling defaults, render locations, and fixed values in CLI help.",
|
|
139
|
+
"behavior": [
|
|
140
|
+
"Settings, appearance, and footer help state the defaults for a new Standard site and where fields render. Read-only projections carry an explicit no-default marker.",
|
|
141
|
+
"Appearance, footer, page, and font help report fixed styling facts in text and JSON. Theme help identifies the token that paints header and footer hairlines.",
|
|
142
|
+
"The help reference version is 64."
|
|
143
|
+
],
|
|
144
|
+
"help": ["settings", "appearance", "footer", "fonts", "page", "theme"]
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"version": "0.42.0",
|
|
148
|
+
"note": "Check published header and footer contrast while authoring a theme.",
|
|
149
|
+
"behavior": [
|
|
150
|
+
"Theme resolve builds a contrast report for the selected schemes and contexts. JSON chrome rows use response-local indexes in chromeCatalog. The 64 KiB output retains every selected chrome measurement and at least 24 KiB for legacy surfaces.",
|
|
151
|
+
"Validate and theme push report below-AA header and footer paint in the warning list. Validate lists theme.chrome_report_name in siteChecks.skipped while display eligibility is unknown.",
|
|
152
|
+
"Espalier 7.2.0 provides the audited paint catalog and shared WCAG calculation. Contrast measurement runs in the authoring tools.",
|
|
153
|
+
"The help reference version is 63."
|
|
154
|
+
],
|
|
155
|
+
"help": ["theme", "appearance"]
|
|
156
|
+
},
|
|
3
157
|
{
|
|
4
158
|
"version": "0.41.1",
|
|
5
159
|
"note": "Share renderer URL, social platform and brand-color rules with the authoring CLI while preserving published output.",
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
// Generated from shared/chrome-features.ts by scripts/sync-field-validation.mjs. Do not edit.
|
|
2
|
+
import { isTallHeaderPaint } from "@taprootio/espalier/shared/theme";
|
|
3
|
+
import { resolveFooterTarget } from "./footer-content.js";
|
|
4
|
+
import { resolveFooterCtaStyle } from "./footer-cta-styles.js";
|
|
5
|
+
import { resolveHeaderChromePresentation } from "./header-presentation.js";
|
|
6
|
+
import { describeHeaderNavigationItem, MAX_NAVIGATION_DEPTH, prepareHeaderNavigation, SITE_NAVIGATION_KINDS, } from "./site-navigation-groups.js";
|
|
7
|
+
import { isRenderableSocialLink } from "./social-link-url.js";
|
|
8
|
+
/** Flags describe reachable paint across pages, viewport sizes and header scroll positions. */
|
|
9
|
+
export function chromeFeatures({ headerSettings, footerSettings, navItems, footerPagePaths, logoPairs, searchEnabled, hasIconSprite, nameReportEnabled, }) {
|
|
10
|
+
const features = {};
|
|
11
|
+
if (headerSettings) {
|
|
12
|
+
const header = resolveHeaderChromePresentation(headerSettings);
|
|
13
|
+
const navigation = navigationFacts(navItems ?? []);
|
|
14
|
+
const flags = [];
|
|
15
|
+
if (navigation.length) {
|
|
16
|
+
flags.push("burger", `drawer:${header.navDrawerStyle}`);
|
|
17
|
+
if (header.menuDisplay === "auto" && header.layout !== "minimal")
|
|
18
|
+
flags.push("inlineNav");
|
|
19
|
+
}
|
|
20
|
+
if (searchEnabled)
|
|
21
|
+
flags.push("searchButton");
|
|
22
|
+
if (header.showThemeToggle)
|
|
23
|
+
flags.push("themeToggle");
|
|
24
|
+
const modes = [false, ...(header.compactOnScroll ? [true] : [])].map(complete => isTallHeaderPaint({
|
|
25
|
+
heightMultiplier: header.heightMultiplier,
|
|
26
|
+
minHeightMultiplier: header.minHeightMultiplier,
|
|
27
|
+
compactSize: header.compactSizeStandard ? "standard" : "compact",
|
|
28
|
+
complete,
|
|
29
|
+
}) ? "headerPaint:tall" : "headerPaint:standard");
|
|
30
|
+
flags.push(...new Set(modes));
|
|
31
|
+
// Compact artwork only replaces a configured regular logo. The regular
|
|
32
|
+
// logo's generic fallback can supply either scheme.
|
|
33
|
+
const hasLogo = Boolean(logoPairs?.header?.light.url || logoPairs?.header?.dark.url);
|
|
34
|
+
features.header = schemeFeatures(flags, navigation, header.showBrandText ? header.brandText : undefined, {
|
|
35
|
+
light: hasLogo,
|
|
36
|
+
dark: hasLogo,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
if (footerSettings?.enabled === true) {
|
|
40
|
+
const flags = footerContentFlags(footerSettings, footerPagePaths);
|
|
41
|
+
if (hasIconSprite && footerSettings.socialLinks?.some(isRenderableSocialLink))
|
|
42
|
+
flags.push("socialLinks");
|
|
43
|
+
if (nameReportEnabled === true && !flags.includes("footerActionButton"))
|
|
44
|
+
flags.push("footerActionButton");
|
|
45
|
+
const showBrand = footerSettings.showBrand !== false;
|
|
46
|
+
features.footer = schemeFeatures(flags, [], showBrand && footerSettings.showBrandText !== false ? headerSettings?.brandText : undefined, {
|
|
47
|
+
// A one-scheme footer override must not become the opposite scheme's logo.
|
|
48
|
+
light: showBrand && Boolean(logoPairs?.footer?.light.url),
|
|
49
|
+
dark: showBrand && Boolean(logoPairs?.footer?.dark.url),
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
else if (nameReportEnabled === true) {
|
|
53
|
+
features.footer = schemeFeatures(["footerActionButton:standalone"], [], undefined, { light: false, dark: false });
|
|
54
|
+
}
|
|
55
|
+
return features;
|
|
56
|
+
}
|
|
57
|
+
/** Use the released button paint, with the page's footer wrapper as the ring backdrop. */
|
|
58
|
+
export function standaloneFooterActionEntries(entries) {
|
|
59
|
+
return entries.filter(entry => entry.flags.includes("footerActionButton")).map(entry => ({
|
|
60
|
+
...entry,
|
|
61
|
+
flags: entry.flags.map(flag => flag === "footerActionButton" ? "footerActionButton:standalone" : flag),
|
|
62
|
+
background: entry.kind === "ring" ? "background" : entry.background,
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
function schemeFeatures(flags, navigation, brandText, logos) {
|
|
66
|
+
const paintedText = hasText(brandText) ? ["brandText"] : [];
|
|
67
|
+
// Nonbreaking whitespace has no ink but still gives the brand link a focusable box.
|
|
68
|
+
const forScheme = (hasLogo) => ({
|
|
69
|
+
flags: [...flags, ...paintedText, ...(brandText || hasLogo ? ["brandLink"] : [])],
|
|
70
|
+
navigation,
|
|
71
|
+
});
|
|
72
|
+
return { light: forScheme(logos.light), dark: forScheme(logos.dark) };
|
|
73
|
+
}
|
|
74
|
+
// The slots match NavItemKind in Sites.proto.
|
|
75
|
+
const NAVIGATION_KIND_NAMES = ["", SITE_NAVIGATION_KINDS.page, SITE_NAVIGATION_KINDS.externalUrl, SITE_NAVIGATION_KINDS.groupHeader];
|
|
76
|
+
const BUTTON_APPEARANCE = "NAV_ITEM_APPEARANCE_BUTTON";
|
|
77
|
+
function normalizeNavigationItem(item) {
|
|
78
|
+
return {
|
|
79
|
+
...item,
|
|
80
|
+
kind: typeof item.kind === "number" ? NAVIGATION_KIND_NAMES[item.kind] : item.kind,
|
|
81
|
+
appearance: item.appearance === 2 ? BUTTON_APPEARANCE : item.appearance,
|
|
82
|
+
children: item.children?.map(normalizeNavigationItem),
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function navigationFacts(items) {
|
|
86
|
+
const facts = [];
|
|
87
|
+
const visit = (nodes, depth) => {
|
|
88
|
+
// Linked-group normalization can add a child just past the published cap.
|
|
89
|
+
if (depth > MAX_NAVIGATION_DEPTH)
|
|
90
|
+
return;
|
|
91
|
+
for (const node of nodes) {
|
|
92
|
+
const { group, url, button } = describeHeaderNavigationItem(node, SITE_NAVIGATION_KINDS, BUTTON_APPEARANCE);
|
|
93
|
+
facts.push({
|
|
94
|
+
depth: depth === 1 ? "top-level" : "nested",
|
|
95
|
+
kind: group ? "group" : button ? "button" : "plain",
|
|
96
|
+
anchor: Boolean(url),
|
|
97
|
+
// Espalier compares the raw URL (apart from a trailing slash) to location.pathname.
|
|
98
|
+
canBeCurrent: url.startsWith("/") && new URL(url, "https://taproot.invalid").pathname === url,
|
|
99
|
+
});
|
|
100
|
+
if (node.children?.length)
|
|
101
|
+
visit(node.children, depth + 1);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
visit(prepareHeaderNavigation(items.map(normalizeNavigationItem), SITE_NAVIGATION_KINDS), 1);
|
|
105
|
+
return facts;
|
|
106
|
+
}
|
|
107
|
+
function hasText(text) {
|
|
108
|
+
return Boolean(text?.trim());
|
|
109
|
+
}
|
|
110
|
+
function footerContentFlags(settings, paths) {
|
|
111
|
+
const resolves = (target) => Boolean(resolveFooterTarget(target, paths));
|
|
112
|
+
const hasLinkText = (link) => hasText(link.label) && resolves(link);
|
|
113
|
+
let headings = false;
|
|
114
|
+
let body = false;
|
|
115
|
+
let links = false;
|
|
116
|
+
for (const { groups = [] } of settings.linkColumns ?? []) {
|
|
117
|
+
for (const group of groups) {
|
|
118
|
+
for (const link of group.links ?? []) {
|
|
119
|
+
if (!resolves(link))
|
|
120
|
+
continue;
|
|
121
|
+
headings ||= hasText(group.heading);
|
|
122
|
+
links ||= hasText(link.label);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
const recordParagraph = (paragraph, heading) => {
|
|
127
|
+
for (const run of paragraph?.runs ?? []) {
|
|
128
|
+
if (!hasText(run.text))
|
|
129
|
+
continue;
|
|
130
|
+
if (run.link && resolves(run.link))
|
|
131
|
+
links = true;
|
|
132
|
+
else if (heading)
|
|
133
|
+
headings = true;
|
|
134
|
+
else
|
|
135
|
+
body = true;
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
recordParagraph(settings.asideHeadingContent?.paragraphs?.[0], true);
|
|
139
|
+
for (const content of [settings.asideBodyContent, settings.bottomContent]) {
|
|
140
|
+
for (const paragraph of content?.paragraphs ?? [])
|
|
141
|
+
recordParagraph(paragraph, false);
|
|
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));
|
|
146
|
+
return [
|
|
147
|
+
...(headings ? ["footerHeadings"] : []),
|
|
148
|
+
...(body ? ["footerBody"] : []),
|
|
149
|
+
...(links ? ["footerLinks"] : []),
|
|
150
|
+
...(hasCtaButton ? ["footerActionButton"] : []),
|
|
151
|
+
];
|
|
152
|
+
}
|