@taprootio/site-authoring 0.62.0 → 0.64.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 +63 -23
- package/package.json +2 -2
- package/src/api.js +149 -21
- package/src/appearance-contract.js +9 -0
- package/src/article-end-settings.js +295 -0
- package/src/changelog.json +39 -0
- package/src/chrome-input.js +1 -1
- package/src/cli.js +110 -26
- package/src/constants.js +7 -0
- package/src/content/components.js +130 -14
- package/src/content/cta-decoration-paint.js +321 -0
- package/src/content/form-placement-presentation.js +91 -0
- package/src/content/form-placement-presentation.json +6 -0
- package/src/content/free-form-section-registry.json +19 -1
- package/src/content/free-form-sections.js +64 -55
- package/src/content/markdown.js +13 -0
- package/src/content/tiptap-prosemirror.ts +72 -59
- package/src/content/validate-document.js +2 -0
- package/src/cta-artwork-warnings.js +164 -0
- package/src/errors.js +6 -0
- package/src/field-schema.json +6 -2
- package/src/field-validation.js +14 -5
- package/src/footer-workspace.js +7 -3
- package/src/form-references.js +71 -9
- package/src/forms-contract.js +3 -5
- package/src/heading-outline.js +7 -0
- package/src/output.js +2 -0
- package/src/page-article-end.js +66 -0
- package/src/page-block-catalog.js +54 -0
- package/src/page-form-presentation.js +104 -0
- package/src/page-structure-checks.js +7 -1
- package/src/placed-image-ids.js +15 -18
- package/src/presentation-reference.js +30 -52
- package/src/reference-help.js +97 -27
- package/src/reusable-blocks.js +429 -0
- package/src/reusable-placements.js +271 -0
- package/src/setting-reference.js +25 -1
- package/src/settings-catalog.js +1 -0
- package/src/site-check-findings.js +30 -2
- package/src/site-check-rules.json +1 -0
- package/src/site-checks.js +26 -2
- package/src/site-health-findings.js +25 -3
- package/src/site-health-image-checks.js +1 -1
- package/src/staging-check.js +108 -21
- package/src/staging-served.js +5 -49
- package/src/status-warning-paints.js +17 -0
- package/src/template-token-reach.json +14 -2
- package/src/theme-resolve.js +27 -0
- package/src/transport.js +41 -5
- package/src/typed-page-reference.js +55 -5
- package/src/typed-pages.js +27 -4
- package/src/verbs/approve.js +2 -1
- package/src/verbs/deploy.js +93 -15
- package/src/verbs/footer-push.js +4 -2
- package/src/verbs/forms-push.js +9 -0
- package/src/verbs/health.js +11 -6
- package/src/verbs/index.js +3 -0
- package/src/verbs/pages-blocks-pull.js +22 -0
- package/src/verbs/pages-push.js +89 -34
- package/src/verbs/plan.js +34 -5
- package/src/verbs/pull.js +213 -124
- package/src/verbs/status.js +20 -2
- package/src/verbs/theme-push.js +164 -14
- package/src/verbs/theme-resolve.js +114 -40
- package/src/verbs/validate.js +49 -18
- package/src/workspace-check.js +42 -5
- package/src/workspace-context-usage.js +54 -1
- package/src/workspace.js +37 -7
- package/test/fixtures/default-site-theme.json +1 -1
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { getSiteAuthoringCapabilities } from "./api.js";
|
|
2
|
+
import { SiteAuthoringError } from "./errors.js";
|
|
3
|
+
import { formPlacementContexts, formPresentationHash, withFormKeys } from "./form-references.js";
|
|
4
|
+
import { getSitePageBlockCatalog } from "./page-block-catalog.js";
|
|
5
|
+
import { CHECK_AREA, appendAll, collectProblems, problemsOf } from "./problems.js";
|
|
6
|
+
import { ApiError } from "./transport.js";
|
|
7
|
+
import { workspaceDocumentFromPage } from "./typed-pages.js";
|
|
8
|
+
import { normalizePageBodyRevision, WORKSPACE_CONTENT_HASH } from "./workspace.js";
|
|
9
|
+
|
|
10
|
+
function formPresentationPullRequired(file) {
|
|
11
|
+
return new SiteAuthoringError("pages.form_presentation_pull_required",
|
|
12
|
+
`Pull and reconcile '${file}' before changing its Form presentation. The edit must use the body revision you saw.`,
|
|
13
|
+
{ field: file });
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function formPresentationUnavailable(file) {
|
|
17
|
+
return new SiteAuthoringError("pages.form_presentation_writes_unavailable",
|
|
18
|
+
`This site is not ready to change Form presentation in '${file}'. Retry after its publishing update finishes.`,
|
|
19
|
+
{ field: file });
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export async function formPresentationWriteIntent({ file, hash, target, baseline, observed, readEditablePage, readFormIndex }) {
|
|
23
|
+
if (target === undefined) return hash === undefined ? undefined : { formPlacementPresentationEdit: true };
|
|
24
|
+
const saved = typeof baseline?.formPresentationHash === "string" && WORKSPACE_CONTENT_HASH.test(baseline.formPresentationHash)
|
|
25
|
+
? baseline.formPresentationHash : undefined;
|
|
26
|
+
const observedRevision = normalizePageBodyRevision(observed?.revision);
|
|
27
|
+
if (observedRevision !== undefined && observedRevision === target.bodyRevision &&
|
|
28
|
+
observed.formPresentationHash !== undefined) {
|
|
29
|
+
if (hash === (observed.formPresentationHash ?? undefined)) return undefined;
|
|
30
|
+
// When the workspace did not record the older copy, reconcile the exact
|
|
31
|
+
// remote copy first so that an unrelated source edit cannot replace it.
|
|
32
|
+
if (hash === saved || (saved === undefined && observed.formPresentationHash !== null)) {
|
|
33
|
+
throw formPresentationPullRequired(file);
|
|
34
|
+
}
|
|
35
|
+
return { formPlacementPresentationEdit: true, expectedBodyRevision: observedRevision };
|
|
36
|
+
}
|
|
37
|
+
if (hash === saved) return undefined;
|
|
38
|
+
const revision = normalizePageBodyRevision(baseline?.revision);
|
|
39
|
+
if (revision === undefined || revision !== target.bodyRevision) throw formPresentationPullRequired(file);
|
|
40
|
+
if (saved === undefined) {
|
|
41
|
+
// An older baseline may lack the Form hash. Compare the exact saved body
|
|
42
|
+
// so the author can keep a matching copy without marking an edit.
|
|
43
|
+
if (readEditablePage === undefined) throw formPresentationPullRequired(file);
|
|
44
|
+
const page = await readEditablePage(target);
|
|
45
|
+
const stored = workspaceDocumentFromPage(page, target.templateType);
|
|
46
|
+
if (normalizePageBodyRevision(page.bodyRevision) !== revision || stored === undefined) {
|
|
47
|
+
throw formPresentationPullRequired(file);
|
|
48
|
+
}
|
|
49
|
+
if (formPresentationHash(stored) !== undefined) {
|
|
50
|
+
if (readFormIndex !== undefined && formPresentationHash(withFormKeys(stored, (await readFormIndex()).keyById)) === hash) {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
throw formPresentationPullRequired(file);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return { formPlacementPresentationEdit: true, expectedBodyRevision: revision };
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export async function preflightFormPresentationWrites(client, siteId, plan, confirmedCapabilities) {
|
|
60
|
+
const sending = plan.planned.filter((page) => !page.unchanged);
|
|
61
|
+
const write = sending.find((page) => page.formPresentationWrite !== undefined);
|
|
62
|
+
let capabilities;
|
|
63
|
+
if (write !== undefined) {
|
|
64
|
+
capabilities = await collectProblems(plan.problems, { area: CHECK_AREA.pages, file: write.file }, async () => {
|
|
65
|
+
const current = confirmedCapabilities ?? await getSiteAuthoringCapabilities(client, siteId);
|
|
66
|
+
if (current?.formPlacementPresentationWritesEnabled !== true) throw formPresentationUnavailable(write.file);
|
|
67
|
+
return current;
|
|
68
|
+
});
|
|
69
|
+
if (capabilities === undefined) return undefined;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const named = sending.filter((page) => page.formPresentationHash !== undefined)
|
|
73
|
+
.map((page) => ({ file: page.file, contexts: formPlacementContexts(page.document) }))
|
|
74
|
+
.filter((page) => page.contexts.length > 0);
|
|
75
|
+
if (named.length === 0) return capabilities;
|
|
76
|
+
const catalog = await collectProblems(plan.problems, { area: CHECK_AREA.pages, file: named[0].file }, () =>
|
|
77
|
+
getSitePageBlockCatalog(client, siteId));
|
|
78
|
+
if (catalog?.formPlacementContextNames === undefined) return capabilities;
|
|
79
|
+
|
|
80
|
+
// A plan sends pages before its theme step. A valid workspace context must
|
|
81
|
+
// also be in both saved draft themes before the site will accept a page.
|
|
82
|
+
const saved = new Set(catalog.formPlacementContextNames);
|
|
83
|
+
for (const { file, contexts } of named) {
|
|
84
|
+
for (const context of contexts) {
|
|
85
|
+
if (saved.has(context)) continue;
|
|
86
|
+
const refusal = new SiteAuthoringError("pages.form_context_not_saved",
|
|
87
|
+
`Form theme context '${context}' in '${file}' is missing from one or both saved draft themes. `
|
|
88
|
+
+ "Run 'taproot-site theme push' to save the context before pushing pages, then plan or try the push again.",
|
|
89
|
+
{ field: "context" });
|
|
90
|
+
appendAll(plan.problems, problemsOf(refusal, { area: CHECK_AREA.pages, file }));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return capabilities;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function translateFormPresentationRefusal(error, page) {
|
|
97
|
+
if (!(error instanceof ApiError)) return error;
|
|
98
|
+
if (page.formPresentationWrite === undefined) {
|
|
99
|
+
return error.hasField("FormPlacement") ? formPresentationPullRequired(page.file) : error;
|
|
100
|
+
}
|
|
101
|
+
if (error.hasField("ExpectedBodyRevision")) return formPresentationPullRequired(page.file);
|
|
102
|
+
if (error.hasField("FormPlacement")) return formPresentationUnavailable(page.file);
|
|
103
|
+
return error;
|
|
104
|
+
}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* can carry copies. `node scripts/sync-field-validation.mjs` writes them; edit
|
|
21
21
|
* only this file and re-run it.
|
|
22
22
|
*/
|
|
23
|
-
import { bannerOpensPage, componentFixedHeadingLevel, createHeadingOutlineState, htmlOpensH1, nextHeadingLevel, recordFixedHeading, } from "./heading-outline.js";
|
|
23
|
+
import { bannerOpensPage, componentFixedHeadingLevel, createHeadingOutlineState, formPlacementHeadingLevel, htmlOpensH1, nextHeadingLevel, recordFixedHeading, } from "./heading-outline.js";
|
|
24
24
|
export const RULE_H1_MISSING = "seo.h1_missing";
|
|
25
25
|
export const RULE_H1_DEMOTED = "seo.h1_demoted";
|
|
26
26
|
export const RULE_HEADING_RENUMBERED = "seo.heading_renumbered";
|
|
@@ -220,6 +220,12 @@ function walkBody(body) {
|
|
|
220
220
|
else if (fixedLevel !== undefined) {
|
|
221
221
|
recordFixedHeading(outline, fixedLevel);
|
|
222
222
|
}
|
|
223
|
+
else if (type === "form") {
|
|
224
|
+
const level = formPlacementHeadingLevel(data.heading, outline);
|
|
225
|
+
if (level !== undefined) {
|
|
226
|
+
headings.push({ path, text: clip(String(data.heading)), authored: level, level, role: "component" });
|
|
227
|
+
}
|
|
228
|
+
}
|
|
223
229
|
seeContent();
|
|
224
230
|
return;
|
|
225
231
|
}
|
package/src/placed-image-ids.js
CHANGED
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* The images a page places (TR01364), read from the wire form the CLI holds.
|
|
4
4
|
*
|
|
5
|
-
* `PageImageReferenceExtractor.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* twin and runs `Extract` over it, and the CLI test runs this over the wire twin.
|
|
5
|
+
* `PageImageReferenceExtractor.ExtractWithRoles` in the API decides which images a page places and
|
|
6
|
+
* which uses are content. `placedImageIds` and `decorationOnlyImageIds` mirror it over the wire form
|
|
7
|
+
* (the proto-JSON data member of a page read or of `wireTemplate(document)`). The shared corpus tests
|
|
8
|
+
* the API on stored fixtures and the CLI on their wire equivalents.
|
|
10
9
|
*
|
|
11
10
|
* It does not validate, so it cannot reproduce `ColumnsBodyPolicy`: for a body `PageTemplateBodies.Read` would
|
|
12
11
|
* reject, it returns every id its walk reaches. It never throws. Known gaps, all outside this file's reach:
|
|
@@ -17,10 +16,6 @@
|
|
|
17
16
|
* - the `Guid.TryParse` X format (`{0x...}`), and the numeric entities .NET also decodes with a sign or
|
|
18
17
|
* whitespace (`&#+34;`, `&# 34;`).
|
|
19
18
|
*
|
|
20
|
-
* It also reports which ids are placed only as a section decoration (`decorationOnlyImageIds`): C#'s `Extract` returns ids only, so the roles are a
|
|
21
|
-
* TypeScript-only reading of the same walk, and an image placed only as a section decoration needs no description
|
|
22
|
-
* (TR01421).
|
|
23
|
-
*
|
|
24
19
|
* It is dependency-free so the published site-authoring package can carry a compiled copy. The generator's Site
|
|
25
20
|
* Health and the CLI use it, so `node scripts/sync-field-validation.mjs` writes both copies; edit only this file
|
|
26
21
|
* and re-run it.
|
|
@@ -132,14 +127,14 @@ function addNodeImages(ids, node) {
|
|
|
132
127
|
addGuid(ids, imageId);
|
|
133
128
|
}
|
|
134
129
|
else if (type === "componentBlock" && Object.hasOwn(attributes, "componentData")) {
|
|
135
|
-
addComponentImages(ids, own(attributes, "componentData"));
|
|
130
|
+
addComponentImages(ids, own(attributes, "componentData"), own(attributes, "componentType") === "cta");
|
|
136
131
|
}
|
|
137
132
|
}
|
|
138
133
|
/**
|
|
139
134
|
* `AddImageIdsFromJson`: every string-valued `imageId` property at any depth, and nothing else. It is iterative and
|
|
140
135
|
* bounded, like the body walk.
|
|
141
136
|
*/
|
|
142
|
-
function addGenericImageIds(ids, root) {
|
|
137
|
+
function addGenericImageIds(ids, root, ctaDecoration) {
|
|
143
138
|
const stack = [[root, 0]];
|
|
144
139
|
for (let next = stack.pop(); next !== undefined; next = stack.pop()) {
|
|
145
140
|
const [value, depth] = next;
|
|
@@ -151,7 +146,10 @@ function addGenericImageIds(ids, root) {
|
|
|
151
146
|
}
|
|
152
147
|
else if (isDictionary(value)) {
|
|
153
148
|
for (const [key, child] of Object.entries(value)) {
|
|
154
|
-
if (key === "
|
|
149
|
+
if (value === ctaDecoration && (key === "image" || key === "darkImage")) {
|
|
150
|
+
addProcessedImage(ids, value, key, "decoration");
|
|
151
|
+
}
|
|
152
|
+
else if (key === "imageId" && typeof child === "string")
|
|
155
153
|
addGuid(ids, child);
|
|
156
154
|
else
|
|
157
155
|
stack.push([child, depth + 1]);
|
|
@@ -164,7 +162,7 @@ function addGenericImageIds(ids, root) {
|
|
|
164
162
|
* generic rule here too, and the body walk then also recurses into it, so a nested `integrationFragment` counts
|
|
165
163
|
* inside an object but not inside a decoded string. Malformed component JSON reads as no ids, as in C#.
|
|
166
164
|
*/
|
|
167
|
-
function addComponentImages(ids, componentData) {
|
|
165
|
+
function addComponentImages(ids, componentData, isCta) {
|
|
168
166
|
if (typeof componentData === "string") {
|
|
169
167
|
let parsed;
|
|
170
168
|
try {
|
|
@@ -173,11 +171,10 @@ function addComponentImages(ids, componentData) {
|
|
|
173
171
|
catch {
|
|
174
172
|
return;
|
|
175
173
|
}
|
|
176
|
-
|
|
177
|
-
}
|
|
178
|
-
else if (Array.isArray(componentData) || isDictionary(componentData)) {
|
|
179
|
-
addGenericImageIds(ids, componentData);
|
|
174
|
+
componentData = parsed;
|
|
180
175
|
}
|
|
176
|
+
const decoration = isCta && isDictionary(componentData) ? own(componentData, "decoration") : undefined;
|
|
177
|
+
addGenericImageIds(ids, componentData, isDictionary(decoration) ? decoration : undefined);
|
|
181
178
|
}
|
|
182
179
|
/** Every node of a rich-text body, to the depth bound, so each one is read by `addNodeImages`. */
|
|
183
180
|
function addBodyImageIds(ids, body) {
|
|
@@ -256,7 +253,7 @@ export function placedImageIds(templateType, data) {
|
|
|
256
253
|
return [...readPlacements(templateType, data).keys()].sort();
|
|
257
254
|
}
|
|
258
255
|
/**
|
|
259
|
-
* The ids `placedImageIds` returns that a page
|
|
256
|
+
* The ids `placedImageIds` returns that a page uses only as decoration. An id also placed as content
|
|
260
257
|
* on the same page is not listed. The caller still has to remove an id the page also uses outside its body (the
|
|
261
258
|
* cover, an integration), which this walk cannot see.
|
|
262
259
|
*/
|
|
@@ -2,6 +2,7 @@ import { readFileSync } from "node:fs";
|
|
|
2
2
|
|
|
3
3
|
import { FOOTER_DRAFT_VERSION } from "./footer-content.js";
|
|
4
4
|
import { FOOTER_CTA_STYLES } from "./footer-cta-styles.js";
|
|
5
|
+
import { CTA_ART_GUIDANCE } from "./content/cta-decoration-paint.js";
|
|
5
6
|
|
|
6
7
|
import { computeThemeProperties } from "@taprootio/espalier/shared/theme-properties";
|
|
7
8
|
|
|
@@ -469,35 +470,22 @@ export function getThemeReference() {
|
|
|
469
470
|
},
|
|
470
471
|
roleResolution: ROLE_RESOLUTION,
|
|
471
472
|
workflow: [
|
|
472
|
-
"Run taproot-site pull and edit
|
|
473
|
-
"Define brand anchors
|
|
474
|
-
"Check
|
|
475
|
-
"
|
|
476
|
-
"
|
|
477
|
-
"
|
|
478
|
-
"
|
|
479
|
-
"
|
|
480
|
-
"
|
|
481
|
-
"
|
|
482
|
-
"
|
|
483
|
-
+ "
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
+ "
|
|
488
|
-
+ "renders no status UI, such as a decorative band, can keep its warning: it is advisory, and each status warning lists the "
|
|
489
|
-
+ "components that paint that color in statusWarningPaints (statusWarningPaintsOmitted counts warnings left out). A proposal keeps a status within 16 degrees of its hue; when none "
|
|
490
|
-
+ "clears the warning it says so and names the action lightness stop, the chroma band and the other family as the levers.",
|
|
491
|
-
"A status warning for a named context also says what in the workspace uses that context. usedBy counts the header, "
|
|
492
|
-
+ "the footer, the listing cards (the boolean listingCards, set when the site's listingCardContext names it), and the sections and calls to action that name it (usedBy: null means nothing was found). The first record of "
|
|
493
|
-
+ "each warning adds usedIn: { items: [{ file, kind, position }], total, truncated }, where kind is section or cta and position is "
|
|
494
|
-
+ "the 1-based ordinal among all of the page's sections (or calls to action), with or without a context, in document order. "
|
|
495
|
-
+ "items holds at most 20 rows, in page-walk order, and total is the full count. A page counts only when it reads, converts and passes "
|
|
496
|
-
+ "the same content checks validate runs, against the theme being evaluated; any other page is listed in contextUsageSkipped: "
|
|
497
|
-
+ "{ items: [{ file, code }], total, truncated }, also at most 20, and the text output adds a 'Not counted' line. When the pages "
|
|
498
|
-
+ "folder cannot be listed, no usage is claimed and the text says why. theme push and theme resolve add these fields last, "
|
|
499
|
-
+ "from the bytes the result has left, so a full result can omit usedIn or contextUsageSkipped (the text still reports the total). "
|
|
500
|
-
+ "validate prints the skipped sources in its progress text and returns its error envelope without contextUsageSkipped.",
|
|
473
|
+
"Run taproot-site pull and edit its complete light/dark pair. It resolves stored values over the same defaults used to render the site.",
|
|
474
|
+
"Define brand anchors, then canvas, ink, accent, action and structure roles in both schemes. Canvas chroma applies to the background, layers and borders, so use the saturation you want on those surfaces.",
|
|
475
|
+
"Check filled actions early. The engine picks a mid-band stop independently of ramp seating and the action role. Set semanticMappings.actionBackground to pin it. Around L 0.55–0.83 no ink reaches APCA Lc 75 for a button label. An L 0.81 gold may compile to a brown fill with a pale label. Pinning L 0.85 instead reached Lc 76 with a dark label.",
|
|
476
|
+
"Name custom tones with lowercase slugs such as gold-band. theme push refuses a mapping to an undeclared tone.",
|
|
477
|
+
"Run taproot-site theme resolve offline after editing. Use --scheme, --context, --json or --site for stored values. It reports oklch and hex, origin (compiled, pinned, inherited_pin), and WCAG AA ratios (4.5:1 text, 3:1 large text and UI) for semantic and site-chrome pairs. Paired component properties include APCA measurements and adjustment. theme.contrast_text_below_aa flags the field without failing the run.",
|
|
478
|
+
"theme push, its --dry-run, and offline validate report each Espalier fit lint <id> in both schemes and all contexts. Read action-anchor-inversion (a flipped fill), apca-target-unmet (an unresolved pair), action-canvas-separation and link-hover-ordering. Where available, 'Nearest passing value: …' was checked against the theme for new warnings. validate and theme push refuse missing font faces with theme.font_weight_unavailable and name the nearest weight.",
|
|
479
|
+
"Use contexts for whole zones. When brightness changes, rebind lightness. A context's own action needs its own actionBackground pin to avoid the compiled mid-band or inherited root pin.",
|
|
480
|
+
"Tune type, space ratios, radii and viewport interpolation together. Each scheme can use different heading, body and brand faces.",
|
|
481
|
+
"For published preformatted code, set --esp-pre-background and --esp-pre-color together. Espalier checks "
|
|
482
|
+
+ "the pair for contrast. --esp-pre-shadow chooses an elevation using the theme’s shadow geometry. Set these "
|
|
483
|
+
+ "properties per scheme or context. Long lines scroll inside the code block. Inline code keeps its existing styling. "
|
|
484
|
+
+ "On Standard sites, enable codeCopyEnabled in site publishing preferences to add a keyboard-accessible Copy button.",
|
|
485
|
+
`For call-to-action panels, the artwork's mask uses the tint token from the panel context. ${CTA_ART_GUIDANCE} Run validate for possible low contrast in each scheme, and see help component cta for the Markdown fields.`,
|
|
486
|
+
"Retune status intents at the root and data palettes separately. Statuses and action are re-rendered at the action color's lightness stop and chroma. Fills closer than 0.045 apart in OKLab raise an advisory warning. Intents are set per scheme at the root; a context cannot set its own. For a context warning involving action, adjust that context's action color. For a warning between two statuses, adjust the root intents. statusWarningPaints shows which components paint the color and statusWarningPaintsOmitted counts dropped warnings. A proposal stays within 16 degrees of its hue. When none passes, adjust the action stop, chroma or other hue family.",
|
|
487
|
+
"theme resolve reports contextUsage for every named context. scope is workspace or site, status is complete, partial or unavailable, and contexts holds { context, usedBy } rows. usedBy gives header, footer and listingCards booleans (null if unknown), plus sections and ctas counts (null without page evidence, including --site and settings-only Docs workspaces). Partial counts cover valid readable sources. Inventory errors supply reason. omitted counts rows left out of JSON. Use narrowWith or --context to narrow. An omitted report sets contextUsageOmitted if it fits, or prints progress. The text view prints usage rows. "
|
|
488
|
+
+ "Context warnings retain usedBy (null when no uses were found). The first paint record for each warning can include usedIn: { items: [{ file, kind, position }], total, truncated }, at most 20 in document order. position is the one-based ordinal among all sections or CTAs of that kind. contextUsageSkipped has the same limit and { file, code } rows for sources that fail the offline content checks. Text shows 'Not counted' and explains an unreadable inventory. JSON may omit these bounded details. validate reports skipped sources in progress.",
|
|
501
489
|
"Use semanticMappings only for meanings roles and contexts cannot express; scattered pins shadow the coherent model. pull keeps only authored pins there and lists them in explicitMappingTokens; a mapping the marker does not name is never applied, so a hand-added pin at the root needs its token added to the marker or theme push reports it as inert. A pin inside a context needs no marker.",
|
|
502
490
|
"Run theme push --dry-run and clear its warnings, fit lints included (a status-color warning in a context that renders no status UI may stay); then run theme push and verify text, actions, focus states, and both schemes in authoring previews.",
|
|
503
491
|
],
|
|
@@ -578,20 +566,14 @@ export function getAppearanceReference() {
|
|
|
578
566
|
imageReferences:
|
|
579
567
|
"Use site-owned image ids retained from pull or returned by media upload. URLs are server projections, never authored inputs.",
|
|
580
568
|
logoContract:
|
|
581
|
-
"lightLogoId and darkLogoId are the expanded
|
|
582
|
-
+ "
|
|
583
|
-
+ "
|
|
584
|
-
+ "
|
|
585
|
-
+ "
|
|
586
|
-
+ "inside letter counters. Avoid baked-in background rectangles unless the brand intentionally uses a badge. "
|
|
587
|
-
+ "Keep padding tight and verify the delivered image preserves transparency. Logo style and coloration are "
|
|
588
|
-
+ "project-specific: choose monochrome, an accent, or multiple colors to suit the brand, not a universal recipe. "
|
|
589
|
-
+ "Keep the lettering readable and test the visible artwork against each header scheme.",
|
|
569
|
+
"lightLogoId and darkLogoId are the expanded logos. lightCompactLogoId and darkCompactLogoId supply compact "
|
|
570
|
+
+ "art for Fixed headers above 1.0 when a regular logo resolves. Shrinking uses ready compact art or keeps "
|
|
571
|
+
+ "the regular logo while it is pending or failed. Inactive choices are retained. For each slot, upload the highest-resolution file you have and assign it. "
|
|
572
|
+
+ "Taproot generates sizes from one image id. An @2x or @3x suffix is just a filename, and nothing pairs it with another file. Prefer PNG or WebP with genuine alpha, "
|
|
573
|
+
+ "including inside letter counters. Trim padding and verify the delivered artwork and its contrast in both schemes.",
|
|
590
574
|
faviconContract:
|
|
591
|
-
"
|
|
592
|
-
+ "
|
|
593
|
-
+ "Inspect at 16 and 32 pixels in light and dark browser tabs; a deliberate contrasting badge can help a favicon "
|
|
594
|
-
+ "remain recognizable independently of the header theme. Verify the published icon loads, not just the setting.",
|
|
575
|
+
"Upload a square, simplified brand mark and set brand.faviconId in settings/brand.json, then run theme push. "
|
|
576
|
+
+ "faviconUrl is read-only. Check that the published icon loads and reads at 16 and 32 pixels in light and dark tabs.",
|
|
595
577
|
logoContrastContract:
|
|
596
578
|
"logoVariant is empty (Match the color scheme), light (Light-background logo), or dark (Dark-background logo); auto is refused. Header and footer choose independently. Deleting the key clears a forced choice on theme push. Footer artwork is chosen after its per-scheme overrides and keeps its own scale. validate reports brand.logo_on_surface when a changeable artwork slot appears on the opposite layer2 brightness; it is a heuristic, not a pixel test, and ignores footer background art. Offline workspaces do not know profile fallback metadata; unknown fallback slots are unchecked. "
|
|
597
579
|
+ "Evaluate lightLogoId against the rendered light-scheme header and darkLogoId against the rendered dark-scheme "
|
|
@@ -666,16 +648,12 @@ export function getAppearanceReference() {
|
|
|
666
648
|
],
|
|
667
649
|
atomic: true,
|
|
668
650
|
revision:
|
|
669
|
-
"pull reads the
|
|
670
|
-
+ "
|
|
671
|
-
+ "
|
|
672
|
-
+ "
|
|
673
|
-
+ "
|
|
674
|
-
+ "
|
|
675
|
-
+ "The revision includes each nonempty heading spacing override, including zero, the tag bar overrides and both destination maps. "
|
|
676
|
-
+ "Footer prose, links and imagery and the other publishing scalars are "
|
|
677
|
-
+ "outside the revision, so concurrent edits to those values are preserved. Footer content saves retain the "
|
|
678
|
-
+ "stored context and cannot adopt an unrelated newer presentation baseline.",
|
|
651
|
+
"pull reads the settings and revision together. theme push saves atomically against that baseline or refuses with "
|
|
652
|
+
+ "theme.concurrent_modification. The revision covers writable appearance and includes recipeJumpControl, recipeTagsIcon "
|
|
653
|
+
+ "and pageTagBadges when they differ from their defaults, as well as nondefault listing card and breadcrumb settings, "
|
|
654
|
+
+ "nonempty heading spacing overrides (including zero), tag bar overrides, destination maps, reusable blocks and article-end rules. "
|
|
655
|
+
+ "Nondefault recipeTagsContent and enabled codeCopyEnabled also affect the revision. "
|
|
656
|
+
+ "Footer prose, links, images and other publishing scalars are outside the revision. Footer saves retain the theme context and baseline.",
|
|
679
657
|
dryRun: CLI_BINARY_NAME + " theme push --dry-run reads the site, lists the JSON paths at which each settings file "
|
|
680
658
|
+ "differs from it, and says whether the recorded baseline is still current or a pending save of the same "
|
|
681
659
|
+ "change set would be replayed; it writes nothing.",
|