@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,22 @@
|
|
|
1
|
+
// Generated from shared/recipe-page-options.ts by scripts/sync-field-validation.mjs. Do not edit.
|
|
2
|
+
export const RECIPE_JUMP_CONTROLS = ["none", "link", "button"];
|
|
3
|
+
export const DEFAULT_RECIPE_JUMP_CONTROL = RECIPE_JUMP_CONTROLS[0];
|
|
4
|
+
export const RECIPE_TAGS_ICONS = ["info", "tags", "category", "none"];
|
|
5
|
+
export const DEFAULT_RECIPE_TAGS_ICON = RECIPE_TAGS_ICONS[0];
|
|
6
|
+
export const RECIPE_TAGS_CONTENT = ["tags", "metadata", "both"];
|
|
7
|
+
export const DEFAULT_RECIPE_TAGS_CONTENT = RECIPE_TAGS_CONTENT[0];
|
|
8
|
+
export function normalizeRecipeTagsContent(value) {
|
|
9
|
+
return RECIPE_TAGS_CONTENT.find(option => option === value) ?? DEFAULT_RECIPE_TAGS_CONTENT;
|
|
10
|
+
}
|
|
11
|
+
export function isRecipeJumpControl(value) {
|
|
12
|
+
return RECIPE_JUMP_CONTROLS.some(option => option === value);
|
|
13
|
+
}
|
|
14
|
+
export function isRecipeTagsIcon(value) {
|
|
15
|
+
return RECIPE_TAGS_ICONS.some(option => option === value);
|
|
16
|
+
}
|
|
17
|
+
export function normalizeRecipeJumpControl(value) {
|
|
18
|
+
return isRecipeJumpControl(value) ? value : DEFAULT_RECIPE_JUMP_CONTROL;
|
|
19
|
+
}
|
|
20
|
+
export function normalizeRecipeTagsIcon(value) {
|
|
21
|
+
return isRecipeTagsIcon(value) ? value : DEFAULT_RECIPE_TAGS_ICON;
|
|
22
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
// Generated from shared/recipe-step-contract.ts by scripts/sync-field-validation.mjs. Do not edit.
|
|
2
|
+
import contract from "./recipe-step-contract.json" with { type: "json" };
|
|
3
|
+
export const RECIPE_STEP_CONTRACT = contract;
|
|
4
|
+
function record(value) {
|
|
5
|
+
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : undefined;
|
|
6
|
+
}
|
|
7
|
+
export function isRecipeStepLinkHref(value) {
|
|
8
|
+
if (/[\x00-\x1f\x7f\\]/u.test(value))
|
|
9
|
+
return false;
|
|
10
|
+
const href = value.trim();
|
|
11
|
+
if (!href || href.startsWith("//"))
|
|
12
|
+
return false;
|
|
13
|
+
const scheme = /^([A-Za-z][A-Za-z0-9+.-]*):/u.exec(href)?.[1].toLowerCase();
|
|
14
|
+
if (!scheme)
|
|
15
|
+
return true;
|
|
16
|
+
if (!RECIPE_STEP_CONTRACT.linkSchemes.includes(scheme))
|
|
17
|
+
return false;
|
|
18
|
+
if (scheme !== "mailto" && scheme !== "tel")
|
|
19
|
+
return true;
|
|
20
|
+
const body = href.slice(scheme.length + 1);
|
|
21
|
+
return href.length <= 2048 && !/[\u0080-\u009f]/u.test(href)
|
|
22
|
+
&& !body.startsWith("//") && /^[^?#]/u.test(body);
|
|
23
|
+
}
|
|
24
|
+
export function isRecipeStepLinkTarget(value) {
|
|
25
|
+
const target = value.trim().toLowerCase();
|
|
26
|
+
return target === "" || RECIPE_STEP_CONTRACT.linkTargets.includes(target);
|
|
27
|
+
}
|
|
28
|
+
export function isRecipeStepLinkRel(value) {
|
|
29
|
+
return value.trim().toLowerCase().split(/\s+/u)
|
|
30
|
+
.every(token => token === "" || RECIPE_STEP_CONTRACT.linkRelTokens.includes(token));
|
|
31
|
+
}
|
|
32
|
+
export function recipeStepUnsupportedContentMessage(type) {
|
|
33
|
+
const { unsupportedContentLabels, unsupportedContentActions } = RECIPE_STEP_CONTRACT;
|
|
34
|
+
const label = Object.prototype.hasOwnProperty.call(unsupportedContentLabels, type)
|
|
35
|
+
? unsupportedContentLabels[type] : `a '${type}' node`;
|
|
36
|
+
const action = Object.prototype.hasOwnProperty.call(unsupportedContentActions, type)
|
|
37
|
+
? unsupportedContentActions[type] : unsupportedContentActions.default;
|
|
38
|
+
return `This step contains ${label}. ${action}`;
|
|
39
|
+
}
|
|
40
|
+
export function recipeStepProblems(value, { allowEmpty = false } = {}) {
|
|
41
|
+
const problems = [];
|
|
42
|
+
const { requiresText, nodes, marks } = RECIPE_STEP_CONTRACT;
|
|
43
|
+
const add = (path, message) => problems.push({ path, message });
|
|
44
|
+
function checkAttributes(entry, allowed, path, label) {
|
|
45
|
+
if (entry.attrs === undefined)
|
|
46
|
+
return;
|
|
47
|
+
const attrs = record(entry.attrs);
|
|
48
|
+
if (!attrs) {
|
|
49
|
+
add(path + ".attrs", `Use an attribute object for ${label}.`);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
for (const [key, attr] of Object.entries(attrs)) {
|
|
53
|
+
if (!allowed.includes(key))
|
|
54
|
+
add(path + ".attrs." + key, `${label} does not support the ${key} attribute.`);
|
|
55
|
+
else if (attr !== null && typeof attr !== "string")
|
|
56
|
+
add(path + ".attrs." + key, `Use text for the ${key} attribute.`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function checkMark(value, path, seen) {
|
|
60
|
+
const mark = record(value);
|
|
61
|
+
const type = mark?.type;
|
|
62
|
+
if (!mark || typeof type !== "string" || !Object.prototype.hasOwnProperty.call(marks, type)) {
|
|
63
|
+
add(path, typeof type === "string" ? `Formatting '${type}' is not supported in a recipe step.` : "Use a supported inline formatting mark.");
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (seen.has(type))
|
|
67
|
+
add(path, `Formatting '${type}' is listed more than once.`);
|
|
68
|
+
seen.add(type);
|
|
69
|
+
for (const key of Object.keys(mark)) {
|
|
70
|
+
if (key !== "type" && key !== "attrs")
|
|
71
|
+
add(path + "." + key, `Formatting '${type}' does not support the ${key} field.`);
|
|
72
|
+
}
|
|
73
|
+
checkAttributes(mark, marks[type], path, `Formatting '${type}'`);
|
|
74
|
+
if (type === "link") {
|
|
75
|
+
const attrs = record(mark.attrs);
|
|
76
|
+
if (mark.attrs !== undefined && !attrs)
|
|
77
|
+
return;
|
|
78
|
+
const { href, target, rel } = attrs ?? {};
|
|
79
|
+
if (href == null || (typeof href === "string" && !isRecipeStepLinkHref(href))) {
|
|
80
|
+
add(path + ".attrs.href", "Use a safe link address.");
|
|
81
|
+
}
|
|
82
|
+
if (typeof target === "string" && !isRecipeStepLinkTarget(target)) {
|
|
83
|
+
add(path + ".attrs.target", "Use _blank, _self, or leave the link target empty.");
|
|
84
|
+
}
|
|
85
|
+
if (typeof rel === "string" && !isRecipeStepLinkRel(rel)) {
|
|
86
|
+
add(path + ".attrs.rel", "Use supported space-separated link relations.");
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function checkNode(value, allowed, path) {
|
|
91
|
+
const node = record(value);
|
|
92
|
+
const type = node?.type;
|
|
93
|
+
if (!node || typeof type !== "string" || !allowed.includes(type)) {
|
|
94
|
+
if (typeof type === "string") {
|
|
95
|
+
add(path, recipeStepUnsupportedContentMessage(type));
|
|
96
|
+
}
|
|
97
|
+
else
|
|
98
|
+
add(path, "Use a ProseMirror document with plain paragraphs and inline formatting.");
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const rule = nodes[type];
|
|
102
|
+
const fields = ["type", "attrs"];
|
|
103
|
+
if (rule.children)
|
|
104
|
+
fields.push("content");
|
|
105
|
+
if (rule.text)
|
|
106
|
+
fields.push("text");
|
|
107
|
+
if (rule.marks)
|
|
108
|
+
fields.push("marks");
|
|
109
|
+
for (const key of Object.keys(node)) {
|
|
110
|
+
if (!fields.includes(key))
|
|
111
|
+
add(path + "." + key, `A ${type} node does not support the ${key} field.`);
|
|
112
|
+
}
|
|
113
|
+
checkAttributes(node, [], path, `A ${type} node`);
|
|
114
|
+
if (rule.text && (typeof node.text !== "string" || node.text.length === 0)) {
|
|
115
|
+
add(path + ".text", "A text node needs a nonempty string.");
|
|
116
|
+
}
|
|
117
|
+
if (rule.marks && node.marks !== undefined) {
|
|
118
|
+
if (Array.isArray(node.marks)) {
|
|
119
|
+
const seen = new Set();
|
|
120
|
+
node.marks.forEach((mark, index) => checkMark(mark, `${path}.marks[${index}]`, seen));
|
|
121
|
+
}
|
|
122
|
+
else
|
|
123
|
+
add(path + ".marks", "Use an array of inline formatting marks.");
|
|
124
|
+
}
|
|
125
|
+
if (rule.children && (type === "doc" || node.content !== undefined)) {
|
|
126
|
+
const children = rule.children;
|
|
127
|
+
if (Array.isArray(node.content) && (type !== "doc" || node.content.length > 0)) {
|
|
128
|
+
node.content.forEach((child, index) => checkNode(child, children, `${path}.content[${index}]`));
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
add(path + ".content", type === "doc" ? "A step needs at least one paragraph." : "Use an array of inline nodes.");
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
checkNode(value, ["doc"], "");
|
|
136
|
+
if (requiresText && !allowEmpty && problems.length === 0 && !hasVisibleStepText(value)) {
|
|
137
|
+
add("", "This step has no text. Add text or remove the step.");
|
|
138
|
+
}
|
|
139
|
+
return problems;
|
|
140
|
+
}
|
|
141
|
+
/** Plain text for JSON-LD, including soft line breaks and paragraph boundaries. */
|
|
142
|
+
export function recipeStepText(value) {
|
|
143
|
+
const paragraphs = record(value)?.content;
|
|
144
|
+
if (!Array.isArray(paragraphs))
|
|
145
|
+
return "";
|
|
146
|
+
return paragraphs.map(paragraph => {
|
|
147
|
+
const inline = record(paragraph)?.content;
|
|
148
|
+
if (!Array.isArray(inline))
|
|
149
|
+
return "";
|
|
150
|
+
return inline.map(value => {
|
|
151
|
+
const node = record(value);
|
|
152
|
+
return node?.type === "hardBreak" ? "\n" : typeof node?.text === "string" ? node.text : "";
|
|
153
|
+
}).join("");
|
|
154
|
+
}).join("\n\n").trim();
|
|
155
|
+
}
|
|
156
|
+
function hasVisibleStepText(value) {
|
|
157
|
+
const { visibleTextIgnoredRanges } = RECIPE_STEP_CONTRACT;
|
|
158
|
+
for (const character of recipeStepText(value)) {
|
|
159
|
+
const point = character.codePointAt(0);
|
|
160
|
+
if (!visibleTextIgnoredRanges.some(([first, last]) => point >= first && point <= last))
|
|
161
|
+
return true;
|
|
162
|
+
}
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"requiresText": true,
|
|
3
|
+
"visibleTextIgnoredRanges": [
|
|
4
|
+
[0,32], [127,160], [173,173], [847,847], [1536,1541], [1564,1564],
|
|
5
|
+
[1757,1757], [1807,1807], [2192,2193], [2274,2274], [4447,4448], [5760,5760],
|
|
6
|
+
[6068,6069], [6155,6159], [8192,8207], [8232,8239], [8287,8303], [12288,12288],
|
|
7
|
+
[12644,12644], [65024,65039], [65279,65279], [65440,65440], [65520,65531], [69821,69821],
|
|
8
|
+
[69837,69837], [78896,78911], [113824,113827], [119155,119162], [917504,921599]
|
|
9
|
+
],
|
|
10
|
+
"nodes": {
|
|
11
|
+
"doc": { "children": ["paragraph"] },
|
|
12
|
+
"paragraph": { "children": ["text", "hardBreak"] },
|
|
13
|
+
"text": { "text": true, "marks": true },
|
|
14
|
+
"hardBreak": { "marks": true }
|
|
15
|
+
},
|
|
16
|
+
"unsupportedContentLabels": {
|
|
17
|
+
"doc": "a document",
|
|
18
|
+
"paragraph": "a paragraph",
|
|
19
|
+
"text": "text outside a paragraph",
|
|
20
|
+
"hardBreak": "a line break outside a paragraph",
|
|
21
|
+
"heading": "a heading",
|
|
22
|
+
"bulletList": "a bulleted list",
|
|
23
|
+
"orderedList": "a numbered list",
|
|
24
|
+
"listItem": "a list item",
|
|
25
|
+
"blockquote": "a quote",
|
|
26
|
+
"codeBlock": "a code block",
|
|
27
|
+
"indentedCodeBlock": "an indented code block",
|
|
28
|
+
"horizontalRule": "a horizontal rule",
|
|
29
|
+
"taprootImage": "an image",
|
|
30
|
+
"inlineImage": "an inline image",
|
|
31
|
+
"componentBlock": "a component",
|
|
32
|
+
"integrationPlacement": "an integration placement",
|
|
33
|
+
"integrationFragment": "an integration fragment",
|
|
34
|
+
"section": "a section",
|
|
35
|
+
"columns": "a columns layout",
|
|
36
|
+
"column": "a column",
|
|
37
|
+
"inlineFacts": "inline facts",
|
|
38
|
+
"table": "a table",
|
|
39
|
+
"tableRow": "a table row",
|
|
40
|
+
"tableHeader": "a table header cell",
|
|
41
|
+
"tableCell": "a table cell"
|
|
42
|
+
},
|
|
43
|
+
"unsupportedContentActions": {
|
|
44
|
+
"default": "Move it to the introduction or make it a paragraph.",
|
|
45
|
+
"taprootImage": "Move it to the introduction.",
|
|
46
|
+
"inlineImage": "Move it to the introduction.",
|
|
47
|
+
"componentBlock": "Move it to the introduction.",
|
|
48
|
+
"horizontalRule": "Remove it from the step."
|
|
49
|
+
},
|
|
50
|
+
"marks": {
|
|
51
|
+
"bold": [],
|
|
52
|
+
"italic": [],
|
|
53
|
+
"underline": [],
|
|
54
|
+
"strike": [],
|
|
55
|
+
"code": [],
|
|
56
|
+
"link": ["href", "target", "rel", "title"]
|
|
57
|
+
},
|
|
58
|
+
"linkTargets": ["_blank", "_self"],
|
|
59
|
+
"linkRelTokens": [
|
|
60
|
+
"nofollow", "sponsored", "ugc", "me", "noopener", "noreferrer", "external",
|
|
61
|
+
"author", "license", "tag", "bookmark", "help", "prev", "next", "privacy-policy",
|
|
62
|
+
"terms-of-service"
|
|
63
|
+
],
|
|
64
|
+
"linkSchemes": ["http", "https", "mailto", "tel"]
|
|
65
|
+
}
|
package/src/reference-help.js
CHANGED
|
@@ -9,7 +9,9 @@ import {
|
|
|
9
9
|
mapComponentImages,
|
|
10
10
|
} from "./content/components.js";
|
|
11
11
|
import { FREE_FORM_SECTION_REGISTRY } from "./content/free-form-sections.js";
|
|
12
|
+
import { BADGE_FOCUS_RING, getSettableComponentProperties, supportsBadgeFocusRing } from "./espalier-shared.js";
|
|
12
13
|
import { formatFontCatalog } from "./font-catalog.js";
|
|
14
|
+
import { DEFAULT_PAGE_TAG_BADGES } from "./page-tag-badge-modes.js";
|
|
13
15
|
import {
|
|
14
16
|
CONTENT_ERROR_CODES,
|
|
15
17
|
CONTENT_LIMITS,
|
|
@@ -72,6 +74,8 @@ import {
|
|
|
72
74
|
} from "./redirects-contract.js";
|
|
73
75
|
import { SETTINGS_GROUPS } from "./settings-catalog.js";
|
|
74
76
|
import { getSettingsReference } from "./setting-reference.js";
|
|
77
|
+
import { formatFixedValues } from "./styling-fixed-values.js";
|
|
78
|
+
import { buildTokenPaintCatalog, formatTokenPaints, getPageTokenReach } from "./token-reach.js";
|
|
75
79
|
import {
|
|
76
80
|
formatTypedPageReference,
|
|
77
81
|
getTypedPageReference,
|
|
@@ -95,7 +99,7 @@ import {
|
|
|
95
99
|
|
|
96
100
|
export { getAppearanceReference, getFooterReference, getSettingsReference, getThemeReference };
|
|
97
101
|
|
|
98
|
-
export const REFERENCE_VERSION =
|
|
102
|
+
export const REFERENCE_VERSION = 79;
|
|
99
103
|
|
|
100
104
|
// The date-limit examples `help forms` prints; tests run them through the form validator.
|
|
101
105
|
export const FORM_DATE_WINDOW_FIELD = Object.freeze({
|
|
@@ -464,6 +468,11 @@ export const REFERENCE_TOPICS = Object.freeze([
|
|
|
464
468
|
usage: `${CLI_BINARY_NAME} help theme`,
|
|
465
469
|
summary: "Design and validate a complete Espalier light/dark theme pair.",
|
|
466
470
|
}),
|
|
471
|
+
Object.freeze({
|
|
472
|
+
name: "tokens",
|
|
473
|
+
usage: `${CLI_BINARY_NAME} help tokens`,
|
|
474
|
+
summary: "See what each semantic color paints and which theme role drives it.",
|
|
475
|
+
}),
|
|
467
476
|
Object.freeze({
|
|
468
477
|
name: "appearance",
|
|
469
478
|
usage: `${CLI_BINARY_NAME} help appearance`,
|
|
@@ -650,14 +659,17 @@ const WORKFLOW_REFERENCES = Object.freeze({
|
|
|
650
659
|
+ "appearance files, the footer, every page, navigation and redirects — against the contracts the site enforces, "
|
|
651
660
|
+ "lists every problem in error.problems, and warns when a semanticMappings pin repeats the default on a token "
|
|
652
661
|
+ "your roles would have moved (the pin would keep the role from rendering). validate stays offline unless you add "
|
|
653
|
-
+ "--site, which also reads the site's image records to report placed images that have no default description."
|
|
662
|
+
+ "--site, which also reads the site's image records to report placed images that have no default description. "
|
|
663
|
+
+ "Unknown settings in taproot-styles.json and site-publishing-preferences.json fail validation and theme push, including dry runs.",
|
|
654
664
|
`Plan a combined change: when pages, the footer, the theme and navigation all changed, ${CLI_BINARY_NAME} plan `
|
|
655
665
|
+ "checks them against the live site and lists the steps in the order they must run, each ready, blocked or "
|
|
656
666
|
+ `nothing to do; ${CLI_BINARY_NAME} apply --plan <planHash> runs them through the ordinary push verbs and refuses `
|
|
657
667
|
+ "a plan the workspace or the site has moved past. After a failed step, plan again: finished steps read as "
|
|
658
668
|
+ "nothing to do.",
|
|
659
669
|
`Push: ${CLI_BINARY_NAME} theme push --dry-run first: it reads the site and lists the JSON paths at which each `
|
|
660
|
-
+ "settings file differs from it, and says whether the baseline pull recorded is still current.
|
|
670
|
+
+ "settings file differs from it, and says whether the baseline pull recorded is still current. It previews "
|
|
671
|
+
+ "local footer content alongside theme changes. Run footer push --dry-run for the footer draft alone. To apply "
|
|
672
|
+
+ "both edits, run footer push first. Then "
|
|
661
673
|
+ `${CLI_BINARY_NAME} theme push saves both themes, the appearance scalars, header/footer contexts and logo variants in `
|
|
662
674
|
+ "one transaction fenced by that baseline: a concurrent change to any of those fields refuses the whole push "
|
|
663
675
|
+ "(theme.concurrent_modification) and nothing is written; keep copies of the edited files, pull, re-apply, "
|
|
@@ -774,7 +786,9 @@ const WORKFLOW_REFERENCES = Object.freeze({
|
|
|
774
786
|
+ "authenticates with its own handoff either way. With --handoff, stagingPreview.url is a fresh, single-use "
|
|
775
787
|
+ "two-minute handoff, minted after checks. It is emitted only in final JSON, excluded from progress and "
|
|
776
788
|
+ "GITHUB_OUTPUT; keep it private. Without it, stagingPreview.reason is staging.handoff_not_requested and "
|
|
777
|
-
+ "'staging review' mints one
|
|
789
|
+
+ "'staging review' mints one after the first successful staging deployment. Check stagingHosting in status "
|
|
790
|
+
+ "for staging host setup and acknowledged release separately from candidate readiness. The staging cookie lasts "
|
|
791
|
+
+ "five minutes and remains subject to current "
|
|
778
792
|
+ "site/host/credential permission. Each run mints its own handoff, which ends an earlier review link "
|
|
779
793
|
+ "minted with the same key (see 'help preview').",
|
|
780
794
|
`${REDIRECTS_FILE_NAME} is { siteId, revision, entries }, not a bare array. 'redirects pull' writes it and `
|
|
@@ -870,6 +884,8 @@ const WORKFLOW_REFERENCES = Object.freeze({
|
|
|
870
884
|
+ `sink is one of ${FORM_SINKS.join(", ")} and defaults to `
|
|
871
885
|
+ "'none' (store submissions only); 'newsletter' requests double-opt-in confirmation for the contact address. "
|
|
872
886
|
+ "A newsletter sink requires a required email contact field and at least one consent checkbox; every consent checkbox must be checked. "
|
|
887
|
+
+ "If forms push reports forms.newsletter_disabled, use sink: none or ask a Taproot platform administrator to enable "
|
|
888
|
+
+ "Newsletter sink enabled under Site Forms. "
|
|
873
889
|
+ `retention_days is ${FORM_RETENTION_DAYS.minimum} to ${FORM_RETENTION_DAYS.maximum} (a site's plan may cap it lower): `
|
|
874
890
|
+ "submissions are deleted that many days after they arrive. Leave it out and the site chooses on creation (its "
|
|
875
891
|
+ "plan's default, usually 365) and keeps the current value on an update. Shortening it deletes the submissions that fall outside it, "
|
|
@@ -1519,7 +1535,7 @@ function placementMatrix() {
|
|
|
1519
1535
|
label: definition.label,
|
|
1520
1536
|
rootPlacement: definition.placement,
|
|
1521
1537
|
fullBleed: explicit,
|
|
1522
|
-
contentPadding: explicit ? "standard by default; section may choose none" : "implicit
|
|
1538
|
+
contentPadding: explicit ? "standard by default; section may choose none" : "implicit: standard",
|
|
1523
1539
|
well: explicit ? "shared site well by default; none removes the cap" : "shared site well",
|
|
1524
1540
|
measure: type === FREE_FORM_SECTION_REGISTRY.section.nodeType ? "child-defined" : definition.measure,
|
|
1525
1541
|
});
|
|
@@ -1532,7 +1548,7 @@ function placementMatrix() {
|
|
|
1532
1548
|
label: definition.label,
|
|
1533
1549
|
rootPlacement: definition.rootPlacement,
|
|
1534
1550
|
fullBleed: rootBand,
|
|
1535
|
-
contentPadding: rootBand ? "component-owned" : "implicit
|
|
1551
|
+
contentPadding: rootBand ? "component-owned" : "implicit: standard",
|
|
1536
1552
|
well: rootBand ? "none at root" : "shared site well",
|
|
1537
1553
|
measure: definition.measure,
|
|
1538
1554
|
});
|
|
@@ -1716,89 +1732,62 @@ const FREE_FORM_REFERENCE = Object.freeze({
|
|
|
1716
1732
|
workspace: Object.freeze({
|
|
1717
1733
|
directory: "pages/",
|
|
1718
1734
|
sourceRule: Object.freeze({
|
|
1719
|
-
rule:
|
|
1720
|
-
"One page path has exactly one authoritative editable source. The manifest records its file and sourceFormat.",
|
|
1735
|
+
rule: "Each page path has exactly one authoritative editable source. The manifest records its file and sourceFormat.",
|
|
1721
1736
|
manifestFields: Object.freeze(["file", "sourceFormat", "baseline"]),
|
|
1722
|
-
pull:
|
|
1723
|
-
"pull keeps a tracked source that is still on disk and never writes a second editable file for the same page.",
|
|
1737
|
+
pull: "Pull preserves a tracked source still on disk and creates no second editable source.",
|
|
1724
1738
|
internalState:
|
|
1725
|
-
`${INTERNAL_PAGE_BASELINE_DIRECTORY}/<pageId>.pm.json holds the site's document for
|
|
1726
|
-
+ "
|
|
1727
|
-
+ "
|
|
1728
|
-
|
|
1729
|
-
+ "in version control.",
|
|
1730
|
-
formatChange:
|
|
1731
|
-
"Remove the tracked source, then author the other format beside it. Two editable sources for one path is a "
|
|
1732
|
-
+ "refusal, not a guess.",
|
|
1739
|
+
`${INTERNAL_PAGE_BASELINE_DIRECTORY}/<pageId>.pm.json holds the site's document for tracked Markdown. `
|
|
1740
|
+
+ "<pageId>.revision.json records the revision a refused pull showed for a recovery push. These files are "
|
|
1741
|
+
+ "never discovered as a page source or pushed. A reconciled pull rewrites or removes them. You can ignore them in version control.",
|
|
1742
|
+
formatChange: "Remove the tracked source before writing the other format. Two sources for one path are refused.",
|
|
1733
1743
|
formatChangeError: "pages.path_conflict",
|
|
1734
|
-
renamedSource:
|
|
1735
|
-
"A tracked source renamed onto the workspace file another page falls back to leaves that page nowhere to be "
|
|
1736
|
-
+ "written. Rename or remove it, then pull again.",
|
|
1744
|
+
renamedSource: "If a renamed source occupies another page's fallback file, rename or remove it and pull again.",
|
|
1737
1745
|
renamedSourceError: "pages.source_conflict",
|
|
1738
1746
|
conflict:
|
|
1739
|
-
"
|
|
1740
|
-
+ "
|
|
1741
|
-
+ "
|
|
1742
|
-
+ "
|
|
1743
|
-
+ "
|
|
1744
|
-
+ "
|
|
1745
|
-
+ "ProseMirror) approve, staging and production publication never move it; a legal page's version stamp is "
|
|
1746
|
-
+ "written at publication and does move it; a place review's effective category is applied only to the "
|
|
1747
|
-
+ "release, so a category override does not move it.",
|
|
1747
|
+
"A new stored-state revision or supported display date signals a site edit. For stale tracked Markdown, "
|
|
1748
|
+
+ "pull saves the site version internally and refuses before editing pages/. For .pm.json, pull refreshes the site "
|
|
1749
|
+
+ "version unless the body or manifest metadata (title, path, description or author) also has local edits. "
|
|
1750
|
+
+ "Revision covers the stored body, title, path, short description and cover image. Approval, staging and production "
|
|
1751
|
+
+ "leave authored revisions alone. Publishing a legal page stamps its version and changes its revision. "
|
|
1752
|
+
+ "Place review category overrides affect the release alone.",
|
|
1748
1753
|
conflictError: "pages.pull_conflict",
|
|
1749
1754
|
metadata:
|
|
1750
|
-
"A .pm.json page's title, path and description live in the manifest
|
|
1751
|
-
+ "
|
|
1752
|
-
+ "
|
|
1753
|
-
+ "
|
|
1754
|
-
+ "over 1000 is refused.",
|
|
1755
|
+
"A .pm.json page's title, path and description live in the manifest. Edit title or description with "
|
|
1756
|
+
+ "pages meta set <path> --title/--description. Edit Markdown metadata in front matter. Pull keeps local edits "
|
|
1757
|
+
+ "until push and refuses a concurrent site edit. Descriptions over 160 characters get a search cutoff warning. "
|
|
1758
|
+
+ "Over 1000 is refused.",
|
|
1755
1759
|
authorship:
|
|
1756
|
-
"Pages
|
|
1757
|
-
+ "
|
|
1758
|
-
+ "(
|
|
1759
|
-
+ "
|
|
1760
|
-
+ "
|
|
1761
|
-
+ "
|
|
1762
|
-
+ "
|
|
1763
|
-
+ "
|
|
1764
|
-
+ "
|
|
1765
|
-
+ "
|
|
1766
|
-
+ "
|
|
1767
|
-
+ "
|
|
1768
|
-
+ "already on the page is pages.author_conflict, which names the way out (pages meta set <path> --author "
|
|
1769
|
-
+ "<the site's author> for a .pm.json page, the author: line for Markdown, or pages meta set <path> --author "
|
|
1770
|
-
+ "\"\" to drop an author that was never sent), naming the author a page already has changes nothing, and a "
|
|
1771
|
-
+ "name that is unknown or belongs to a member who cannot create pages is pages.author_unknown either way. "
|
|
1772
|
-
+ "Text that is neither a handle nor an address is pages.author_invalid.",
|
|
1760
|
+
"Pages start authorless. pages push lists new pages without a byline in pages.authorless. Set author: in front "
|
|
1761
|
+
+ "matter for any template or use pages meta set <path> --author for .pm.json. Use a site author's handle "
|
|
1762
|
+
+ "(jane-doe) or the email of a member who can create pages. authors list refreshes authors.json. "
|
|
1763
|
+
+ "authors add <handle> --name <name> [--email <address>] creates a site author with a private email, "
|
|
1764
|
+
+ "a byline and structured data. Site authors have no Taproot account, profile link or follow button. "
|
|
1765
|
+
+ "Reusing a handle and name returns existing: true. A different name triggers authors.handle_taken. "
|
|
1766
|
+
+ "Only the CLI assigns authors, and only to authorless pages. Repeating the assigned author is a no-op. "
|
|
1767
|
+
+ "A different author triggers pages.author_conflict. Restore the site's author in front matter or with "
|
|
1768
|
+
+ "pages meta set <path> --author. Use --author \"\" to clear an unsent assignment. "
|
|
1769
|
+
+ "Offline validate and pages meta set warn pages.author_unverified on authors.json misses. pages push "
|
|
1770
|
+
+ "and plan check the live list once on a miss. Unknown or ineligible authors trigger pages.author_unknown. "
|
|
1771
|
+
+ "Text that is neither a handle nor an address triggers pages.author_invalid.",
|
|
1773
1772
|
authorshipErrors: Object.freeze(["pages.author_invalid", "pages.author_unknown", "pages.author_conflict"]),
|
|
1774
1773
|
conflictDetail:
|
|
1775
|
-
"
|
|
1776
|
-
+ "
|
|
1777
|
-
+ "
|
|
1778
|
-
+ "compared and the body is identical, so the change was to the page's title, path, description, cover image "
|
|
1779
|
-
+ "or display date, none of which is part of the body. Non-empty: the JSON paths at which the body differs. "
|
|
1780
|
-
+ "These paths explain a refusal; they never decide whether it happens.",
|
|
1774
|
+
"error.differences is absent when the workspace has no baseline document to compare. An empty list means "
|
|
1775
|
+
+ "only title, path, description, cover image or display date changed. Otherwise it lists changed JSON body paths. "
|
|
1776
|
+
+ "These paths explain the refusal.",
|
|
1781
1777
|
pushConflict:
|
|
1782
|
-
"pages push
|
|
1783
|
-
+ "
|
|
1784
|
-
+ "
|
|
1785
|
-
+ "error.alternatives, recorded first and live second. The guard is armed once both are known — a page this "
|
|
1786
|
-
+ "workspace has never reconciled with, or a Taproot that predates the revision contract, leaves it unarmed "
|
|
1787
|
-
+ "rather than refusing every push. A pull that refuses records the revision it showed you, so the pull "
|
|
1788
|
-
+ "conflict's own recovery push still goes through; a page that moved again since is refused again.",
|
|
1778
|
+
"pages push compares recorded and live revisions when both are known. A mismatch stops all writes and lists "
|
|
1779
|
+
+ "the recorded revision first in error.alternatives. A refused pull records the revision it showed for a recovery push. "
|
|
1780
|
+
+ "A later site edit invalidates that recovery. Workspaces without a reconciled revision and older servers leave the guard unarmed.",
|
|
1789
1781
|
pushConflictError: "pages.push_conflict",
|
|
1790
1782
|
revisionSource:
|
|
1791
|
-
"baseline.revision
|
|
1792
|
-
+ "
|
|
1783
|
+
"The manifest's baseline.revision comes from bodyRevision on page reads, listings, creates and updates. "
|
|
1784
|
+
+ "Compare the opaque value directly.",
|
|
1793
1785
|
conflictRecovery:
|
|
1794
|
-
"Either push the local source
|
|
1795
|
-
+ "the
|
|
1796
|
-
+ "differences list) changed only its title, path, description, cover image or display date, so the "
|
|
1797
|
-
+ "same two choices apply.",
|
|
1786
|
+
"Either push the local source or delete the local source and pull the site's document. "
|
|
1787
|
+
+ "Use the same choices when an empty differences list reports a metadata-only change.",
|
|
1798
1788
|
pushSelection:
|
|
1799
|
-
"pages push <path> validates the selected page
|
|
1800
|
-
+ "
|
|
1801
|
-
+ "path is the command that reports every authored page.",
|
|
1789
|
+
"pages push <path> converts and validates the selected page with every cross-page guard that applies. "
|
|
1790
|
+
+ "pages push with no path is the command that reports every authored page.",
|
|
1802
1791
|
}),
|
|
1803
1792
|
formats: Object.freeze([
|
|
1804
1793
|
Object.freeze({
|
|
@@ -2012,12 +2001,96 @@ export function listPageTypeReferences() {
|
|
|
2012
2001
|
});
|
|
2013
2002
|
}
|
|
2014
2003
|
|
|
2004
|
+
const PAGE_INSET = Object.freeze({
|
|
2005
|
+
file: "settings/taproot-styles.json",
|
|
2006
|
+
path: "settings.contentInset",
|
|
2007
|
+
helpCommand: `${CLI_BINARY_NAME} help appearance`,
|
|
2008
|
+
});
|
|
2009
|
+
|
|
2010
|
+
const RECIPE_ANCHOR = Object.freeze({
|
|
2011
|
+
name: "recipe.anchor",
|
|
2012
|
+
value: "#recipe",
|
|
2013
|
+
where: "the recipe card on every recipe page that renders it",
|
|
2014
|
+
source: "recipe card",
|
|
2015
|
+
});
|
|
2016
|
+
|
|
2017
|
+
const BADGE_PAGE_TYPES = new Set(["article", "album", "recipe", "place-review"]);
|
|
2018
|
+
function pageBadgeReference(type) {
|
|
2019
|
+
return {
|
|
2020
|
+
setting: "pageTagBadges",
|
|
2021
|
+
default: DEFAULT_PAGE_TAG_BADGES,
|
|
2022
|
+
renders: "On Standard sites, page displays authored tags in the page header. Page-and-cards also displays them in folder indexes and Latest Posts cards.",
|
|
2023
|
+
visibility: "Badges show explicitly assigned tags from the release’s selected page version, sorted alphabetically ignoring case. System tags and tags from member-only pages are omitted.",
|
|
2024
|
+
preview: "Generator-backed authoring preview shows the badges. The editor page preview and component previews keep their existing markup.",
|
|
2025
|
+
destinations: "Use settings.tagDestinations in settings/site-publishing-preferences.json to link a tag to a page resource ID. "
|
|
2026
|
+
+ "Tags without a current published destination appear as plain badges. See help appearance for the complete tag listing workflow.",
|
|
2027
|
+
componentProperties: getSettableComponentProperties()
|
|
2028
|
+
.filter(property => property.component === "esp-badge" && property.syntax === "color").map(({ name }) => name),
|
|
2029
|
+
...(supportsBadgeFocusRing() ? { focusRing: `Set the outside focus ring separately with ${BADGE_FOCUS_RING}. `
|
|
2030
|
+
+ "It defaults to --esp-color-link. Theme resolve checks 3:1 against surrounding surfaces." } : {}),
|
|
2031
|
+
...(type === "recipe" ? {
|
|
2032
|
+
recipeMetadata: "The bottom tag bar shows the same authored badges and links as the header, even when pageTagBadges is off. "
|
|
2033
|
+
+ "Set recipeTagsContent to metadata or both to include category, cuisine and method. Both keeps the authored badge and its link for a shared name, ignoring case. "
|
|
2034
|
+
+ "Metadata links can use a matching site tag's destination or an explicit recipeMetadataDestinations entry. See help settings.",
|
|
2035
|
+
} : {}),
|
|
2036
|
+
};
|
|
2037
|
+
}
|
|
2038
|
+
|
|
2015
2039
|
export function getPageTypeReference(type) {
|
|
2016
|
-
if (type === "free-form")
|
|
2017
|
-
|
|
2040
|
+
if (type === "free-form") {
|
|
2041
|
+
return {
|
|
2042
|
+
...FREE_FORM_REFERENCE,
|
|
2043
|
+
components: listComponentTypeReferences(),
|
|
2044
|
+
contentInset: PAGE_INSET,
|
|
2045
|
+
fixedValues: Object.freeze([]),
|
|
2046
|
+
tokenReach: getPageTokenReach(type),
|
|
2047
|
+
};
|
|
2048
|
+
}
|
|
2049
|
+
const page = getTypedPageReference(type);
|
|
2050
|
+
if (!page) return undefined;
|
|
2051
|
+
return Object.freeze({
|
|
2052
|
+
...page,
|
|
2053
|
+
...(BADGE_PAGE_TYPES.has(type) ? { tagBadges: pageBadgeReference(type) } : {}),
|
|
2054
|
+
contentInset: PAGE_INSET,
|
|
2055
|
+
fixedValues: Object.freeze(type === "recipe" ? [RECIPE_ANCHOR] : []),
|
|
2056
|
+
tokenReach: getPageTokenReach(type),
|
|
2057
|
+
});
|
|
2058
|
+
}
|
|
2059
|
+
|
|
2060
|
+
export function getTokenReference() {
|
|
2061
|
+
return {
|
|
2062
|
+
...buildTokenPaintCatalog(),
|
|
2063
|
+
pinning: "structure drives both border and shadow, and pinning either through semanticMappings "
|
|
2064
|
+
+ "(with its token in explicitMappingTokens at the root) colors it alone.",
|
|
2065
|
+
};
|
|
2066
|
+
}
|
|
2067
|
+
|
|
2068
|
+
function formatTokenReference({ tokens, paintCatalog, pinning }) {
|
|
2069
|
+
const derivations = Object.entries(tokens).map(([name, { derivation, note }]) => {
|
|
2070
|
+
const rolePlan = derivation === null ? note : `${derivation.role}.${derivation.slot} — ${derivation.defaultStop}`;
|
|
2071
|
+
return ` ${name.padEnd(18)} ${rolePlan}`;
|
|
2072
|
+
});
|
|
2073
|
+
return [
|
|
2074
|
+
"What each token paints",
|
|
2075
|
+
...formatTokenPaints(tokens, paintCatalog),
|
|
2076
|
+
"",
|
|
2077
|
+
"Static role plan and default lightness stops",
|
|
2078
|
+
...derivations,
|
|
2079
|
+
"",
|
|
2080
|
+
pinning,
|
|
2081
|
+
"",
|
|
2082
|
+
].join("\n");
|
|
2083
|
+
}
|
|
2084
|
+
|
|
2085
|
+
function formatPageTokenReach(rows = []) {
|
|
2086
|
+
if (!rows.length) return "";
|
|
2087
|
+
return "\n\nTemplate token reach\n" + rows.map(({ token, file, markup, part, label }) =>
|
|
2088
|
+
` ${label} — ${token} (${file}, ${markup}, ${part})`
|
|
2089
|
+
).join("\n") + "\n";
|
|
2018
2090
|
}
|
|
2019
2091
|
|
|
2020
2092
|
function schemaLabel(schema) {
|
|
2093
|
+
if (schema.anyOf) return schema.anyOf.map(schemaLabel).join(" | ");
|
|
2021
2094
|
if (schema.enum) return schema.enum.map((value) => JSON.stringify(value)).join(" | ");
|
|
2022
2095
|
if (schema.type === "array") return `array<${schemaLabel(schema.items)}>`;
|
|
2023
2096
|
if (Array.isArray(schema.type)) return schema.type.join(" | ");
|
|
@@ -2157,6 +2230,8 @@ export function formatReferenceResult(result) {
|
|
|
2157
2230
|
switch (result.topic) {
|
|
2158
2231
|
case "fonts":
|
|
2159
2232
|
return formatFontCatalog(result.fonts);
|
|
2233
|
+
case "tokens":
|
|
2234
|
+
return formatTokenReference(result);
|
|
2160
2235
|
case "topics":
|
|
2161
2236
|
return `Usage: ${CLI_BINARY_NAME} help <topic> [name] [--json]\n\nReference topics:\n${
|
|
2162
2237
|
result.topics.map((topic) => ` ${topic.usage.padEnd(48)} ${topic.summary}`).join("\n")
|
|
@@ -2191,7 +2266,18 @@ export function formatReferenceResult(result) {
|
|
|
2191
2266
|
}
|
|
2192
2267
|
case "page": {
|
|
2193
2268
|
const page = result.page;
|
|
2194
|
-
|
|
2269
|
+
const inset = page.contentInset;
|
|
2270
|
+
const styling = `\n\nContent inset uses ${inset.path} in ${inset.file}. See ${inset.helpCommand}.\n`
|
|
2271
|
+
+ formatFixedValues(page.fixedValues) + formatPageTokenReach(page.tokenReach);
|
|
2272
|
+
if (page.type !== "free-form") {
|
|
2273
|
+
const badges = page.tagBadges;
|
|
2274
|
+
const badgeText = badges
|
|
2275
|
+
? "\n\nTag badges (" + badges.setting + ", default " + badges.default + ")\n "
|
|
2276
|
+
+ [badges.renders, badges.visibility, badges.preview, badges.destinations, badges.recipeMetadata, badges.focusRing].filter(Boolean).join(" ")
|
|
2277
|
+
+ "\n Theme properties: " + badges.componentProperties.join(", ")
|
|
2278
|
+
: "";
|
|
2279
|
+
return `${formatTypedPageReference(page).trimEnd()}${badgeText}${styling}`;
|
|
2280
|
+
}
|
|
2195
2281
|
const markdownFormat = page.workspace.formats.find((format) => format.extension === ".md");
|
|
2196
2282
|
const sourceRule = page.workspace.sourceRule;
|
|
2197
2283
|
return `${page.displayName} (${page.type})\n${page.summary}\n\nWorkspace:\n${
|
|
@@ -2241,7 +2327,7 @@ export function formatReferenceResult(result) {
|
|
|
2241
2327
|
page.components.map((component) => ` ${component.type.padEnd(16)} ${component.summary}`).join("\n")
|
|
2242
2328
|
}\n\nWorkflow:\n${
|
|
2243
2329
|
page.workflow.map((step) => ` ${step.command}: ${step.result}`).join("\n")
|
|
2244
|
-
}\
|
|
2330
|
+
}${styling}\nUse --json for exact metadata and component-node shapes.\n`;
|
|
2245
2331
|
}
|
|
2246
2332
|
case "component": {
|
|
2247
2333
|
const component = result.component;
|