@taprootio/site-authoring 0.42.0 → 0.56.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 +110 -12
- 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 +242 -23
- package/src/appearance-contract.js +264 -3
- package/src/authored-tag-names.js +88 -0
- package/src/authors-contract.js +71 -3
- 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 +160 -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 +136 -38
- package/src/constants.js +1 -0
- 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-metadata.js +15 -13
- 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 +182 -79
- 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 +94 -16
- package/src/typed-pages.js +233 -74
- package/src/verbs/authors.js +198 -33
- 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/index.js +4 -2
- package/src/verbs/pages-delete.js +19 -10
- package/src/verbs/pages-push.js +225 -71
- package/src/verbs/plan.js +10 -4
- package/src/verbs/pull.js +324 -69
- 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 +73 -2
- 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,165 @@
|
|
|
1
1
|
{
|
|
2
2
|
"entries": [
|
|
3
|
+
{
|
|
4
|
+
"version": "0.56.0",
|
|
5
|
+
"note": "Give a site author a byline link and an image, and change an author with authors set.",
|
|
6
|
+
"behavior": [
|
|
7
|
+
"authors add takes --link-page (a page path from the manifest, or a resourceId), --link-url and --image (a media path or an image id). A byline links to one place, so --link-page and --link-url together are refused (authors.link_conflict).",
|
|
8
|
+
"authors set <handle> changes the name, email, link or image and sends only what was passed. --no-link, --no-image and --no-email clear. It needs the deployments capability too, because changing the byline of an author on published pages queues a deployment.",
|
|
9
|
+
"Repeating authors add for an existing handle succeeds when the name matches and any link or image option passed matches; options not passed are not compared. A difference is authors.handle_taken and points at authors set.",
|
|
10
|
+
"New refusal codes: authors.link_url_invalid, authors.link_page_unknown, authors.image_unknown, authors.deployment_refused, authors.handle_unknown, authors.image_conflict, authors.email_conflict and authors.set_empty.",
|
|
11
|
+
"authors.json records linkPageResourceId, linkUrl and imageId for each author that has one.",
|
|
12
|
+
"Typed pages (article, album, recipe, place review) take displayAuthor, a site author's handle that replaces the member on the byline and keeps the page off the member's profile. A quoted empty value (displayAuthor: \"\") clears it, a bare displayAuthor: line is refused (pages.display_author_invalid), and an absent key leaves the site's alone.",
|
|
13
|
+
"Pull refreshes an unedited .pm.json document with the site's display author, and a push that would overwrite one that changed on the site is refused with pages.push_conflict until a pull has shown it.",
|
|
14
|
+
"New codes: pages.display_author_invalid, pages.display_author_unknown and the warning pages.display_author_unverified. A place review with a display author raises no missing-reviewer warning, and a page credited only through displayAuthor is not in pages.authorless.",
|
|
15
|
+
"Typed pages take showOnProfile: false to keep a page off its author's Taproot profile (it keeps its byline and profile link), and true to put it back. Only the words true and false are accepted in front matter and a JSON boolean in .pm.json; anything else is pages.show_on_profile_invalid. The profile changes after the page is published and its release goes live. An absent key leaves the site's setting alone, and pull and push treat it like displayDate.",
|
|
16
|
+
"The help reference version is 80."
|
|
17
|
+
],
|
|
18
|
+
"help": ["page"]
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"version": "0.55.0",
|
|
22
|
+
"note": "Style linked tag badges by state and choose what the recipe card tag bar displays.",
|
|
23
|
+
"behavior": [
|
|
24
|
+
"The recipe bar defaults to authored badges. Help appearance documents recipeTagsContent, recipeMetadataDestinations, and the bar colors.",
|
|
25
|
+
"Validation and theme dry runs refuse unknown style and publishing settings. Breadcrumb refusals name the invalid SVG feature.",
|
|
26
|
+
"Listing tags are checked before push when pull has the site catalog. Destination warnings appear in delete and theme dry runs and deploy.",
|
|
27
|
+
"Linked badges have a separate focus ring color. Theme resolve and validate check ring contrast and warn about low-contrast recipe tag icons.",
|
|
28
|
+
"Public recipes publish recipe markup without an author. Validate and staging deploy advise when a public place review has no credited reviewer.",
|
|
29
|
+
"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.",
|
|
30
|
+
"Theme push --dry-run checks the proposed recipe tag bar icon and badge focus ring contrast.",
|
|
31
|
+
"Recipe jump and place review Save buttons use compact byline sizing with a larger touch target.",
|
|
32
|
+
"Validate, health and staging deploy print publishing warnings ahead of title and description advice.",
|
|
33
|
+
"The help reference version is 79."
|
|
34
|
+
],
|
|
35
|
+
"help": ["appearance", "theme", "settings", "page", "component"]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"version": "0.54.0",
|
|
39
|
+
"note": "Author breadcrumb artwork and tag landing pages, and preview footer edits before saving.",
|
|
40
|
+
"behavior": [
|
|
41
|
+
"Help appearance describes breadcrumb SVG files, tag destinations and the combined footer and theme preview.",
|
|
42
|
+
"Help component latest-posts supports tag matching and an all-results count. Help appearance walks through a tag landing page.",
|
|
43
|
+
"Staging review requires an acknowledged staging release. Status shows staging host setup separately from candidate readiness.",
|
|
44
|
+
"The help reference version is 75."
|
|
45
|
+
],
|
|
46
|
+
"help": ["appearance", "footer", "preview", "page", "component"]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"version": "0.53.0",
|
|
50
|
+
"note": "Choose one content inset for the published page and its chrome.",
|
|
51
|
+
"behavior": [
|
|
52
|
+
"Run taproot-site pull before theme push to add contentInset to settings/taproot-styles.json. Small to normal is the default.",
|
|
53
|
+
"Help appearance lists the five choices and their sizes. Both color schemes use the light theme's spacing scale.",
|
|
54
|
+
"The help reference version is 74."
|
|
55
|
+
],
|
|
56
|
+
"help": ["appearance", "page", "settings"]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"version": "0.52.0",
|
|
60
|
+
"note": "Set exact gaps above and below individual heading levels.",
|
|
61
|
+
"behavior": [
|
|
62
|
+
"Run taproot-site pull before theme push to add the eight heading spacing fields.",
|
|
63
|
+
"Use canonical strings from 0 to 6 rem in quarter-rem steps. Empty follows Block spacing. The string \"0\" sets an exact zero gap.",
|
|
64
|
+
"Help appearance describes when custom gaps apply and which gaps keep the preset. The help reference version is 73."
|
|
65
|
+
],
|
|
66
|
+
"help": ["appearance", "settings"]
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"version": "0.51.0",
|
|
70
|
+
"note": "Publish explicitly authored page tags as neutral badges.",
|
|
71
|
+
"behavior": [
|
|
72
|
+
"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.",
|
|
73
|
+
"Set the neutral badge background, text and border in theme component properties. Recipe category, cuisine and method use the same badges.",
|
|
74
|
+
"The help reference version is 72."
|
|
75
|
+
],
|
|
76
|
+
"help": ["appearance", "page", "theme"]
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"version": "0.50.0",
|
|
80
|
+
"note": "Style footer links, headings and the aside call to action.",
|
|
81
|
+
"behavior": [
|
|
82
|
+
"Set asideCtaStyle to link, bold-link or button. Footer validation calls out button label overflow at narrow widths.",
|
|
83
|
+
"The footer draft hash is now footer-draft-v9. Run taproot-site pull before saving a footer from an existing workspace.",
|
|
84
|
+
"Help footer lists the new link and heading properties. The help reference version is 71."
|
|
85
|
+
],
|
|
86
|
+
"help": ["footer", "theme"]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"version": "0.49.0",
|
|
90
|
+
"note": "Choose which marks appear between published breadcrumb links and after the last crumb.",
|
|
91
|
+
"behavior": [
|
|
92
|
+
"Run taproot-site pull before theme push to add breadcrumbSeparator and breadcrumbTrailEnd to settings/taproot-styles.json.",
|
|
93
|
+
"Choose the separator color and size in each theme scheme. Published trails show folder ancestors and use the same marks in both schemes.",
|
|
94
|
+
"The help reference version is 70."
|
|
95
|
+
],
|
|
96
|
+
"help": ["appearance", "theme"]
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"version": "0.48.0",
|
|
100
|
+
"note": "Choose separate colors for quote marks and each of the first four heading levels.",
|
|
101
|
+
"behavior": [
|
|
102
|
+
"The published page title and recipe card title follow the per-level theme colors. Body headings use the normalized heading level on published pages.",
|
|
103
|
+
"Help theme explains the quote fill and recipe card contrast surface. Help tokens names the local overrides beside their semantic fallback paints.",
|
|
104
|
+
"The help reference version is 69."
|
|
105
|
+
],
|
|
106
|
+
"help": ["theme", "tokens"]
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"version": "0.47.0",
|
|
110
|
+
"note": "Find what each theme token paints and how contrast changes its color.",
|
|
111
|
+
"behavior": [
|
|
112
|
+
"Help tokens lists each token's role and paints. Help page adds the theme colors and intents used by each page type.",
|
|
113
|
+
"Theme resolve shows selected paints, explains contrast adjustments, and suggests the nearest named lightness stop that reaches the target when one exists.",
|
|
114
|
+
"Validate and theme push name the published header and footer paints behind their contrast warnings.",
|
|
115
|
+
"The help reference version is 68."
|
|
116
|
+
],
|
|
117
|
+
"help": ["page", "theme", "tokens"]
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"version": "0.46.0",
|
|
121
|
+
"note": "Set supported component properties in a theme or named context with Espalier 7.3.0.",
|
|
122
|
+
"behavior": [
|
|
123
|
+
"Footer link-group and aside headings share the normal size. Unclassed footer links keep their underline on hover.",
|
|
124
|
+
"The default breadcrumb separator uses a 70% mix of the crumb color with transparency.",
|
|
125
|
+
"Theme push warns when a length or keyword property resolves to different values in light and dark.",
|
|
126
|
+
"Help theme lists settable properties. Theme resolve reports authored values, context overrides and paired contrast.",
|
|
127
|
+
"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.",
|
|
128
|
+
"The help reference version is 67."
|
|
129
|
+
],
|
|
130
|
+
"help": ["appearance", "footer", "theme"]
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"version": "0.45.0",
|
|
134
|
+
"note": "Set and round-trip topic tags on typed pages from the CLI.",
|
|
135
|
+
"behavior": [
|
|
136
|
+
"Article, recipe, album and place review accept a tags array in typed JSON or a one-line JSON array in Markdown front matter.",
|
|
137
|
+
"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.",
|
|
138
|
+
"Tagged writes require site.tags.manage and an enabled rollout. Replacements also check the page body and tag revisions before saving.",
|
|
139
|
+
"The help reference version is 66."
|
|
140
|
+
],
|
|
141
|
+
"help": ["page"]
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"version": "0.44.0",
|
|
145
|
+
"note": "Link directly to a recipe card and set the jump control and tag icon for your site.",
|
|
146
|
+
"behavior": [
|
|
147
|
+
"Run taproot-site pull before your next theme push to get the new recipeJumpControl and recipeTagsIcon settings.",
|
|
148
|
+
"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.",
|
|
149
|
+
"The help reference version is 65."
|
|
150
|
+
],
|
|
151
|
+
"help": ["settings", "appearance", "page"]
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"version": "0.43.0",
|
|
155
|
+
"note": "Find styling defaults, render locations, and fixed values in CLI help.",
|
|
156
|
+
"behavior": [
|
|
157
|
+
"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.",
|
|
158
|
+
"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.",
|
|
159
|
+
"The help reference version is 64."
|
|
160
|
+
],
|
|
161
|
+
"help": ["settings", "appearance", "footer", "fonts", "page", "theme"]
|
|
162
|
+
},
|
|
3
163
|
{
|
|
4
164
|
"version": "0.42.0",
|
|
5
165
|
"note": "Check published header and footer contrast while authoring a theme.",
|
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",
|