@taprootio/site-authoring 0.61.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.
Files changed (71) hide show
  1. package/README.md +97 -23
  2. package/package.json +2 -2
  3. package/src/api.js +149 -21
  4. package/src/appearance-contract.js +27 -0
  5. package/src/article-appearance.js +19 -0
  6. package/src/article-appearance.json +9 -0
  7. package/src/article-end-settings.js +295 -0
  8. package/src/changelog.json +49 -0
  9. package/src/chrome-input.js +1 -1
  10. package/src/cli.js +110 -26
  11. package/src/constants.js +7 -0
  12. package/src/content/components.js +130 -14
  13. package/src/content/cta-decoration-paint.js +321 -0
  14. package/src/content/form-placement-presentation.js +91 -0
  15. package/src/content/form-placement-presentation.json +6 -0
  16. package/src/content/free-form-section-registry.json +19 -1
  17. package/src/content/free-form-sections.js +64 -55
  18. package/src/content/markdown.js +13 -0
  19. package/src/content/tiptap-prosemirror.ts +72 -59
  20. package/src/content/validate-document.js +2 -0
  21. package/src/cta-artwork-warnings.js +164 -0
  22. package/src/errors.js +6 -0
  23. package/src/field-schema.json +6 -2
  24. package/src/field-validation.js +14 -5
  25. package/src/footer-workspace.js +7 -3
  26. package/src/form-references.js +71 -9
  27. package/src/forms-contract.js +3 -5
  28. package/src/heading-outline.js +7 -0
  29. package/src/output.js +2 -0
  30. package/src/page-article-end.js +66 -0
  31. package/src/page-block-catalog.js +54 -0
  32. package/src/page-form-presentation.js +104 -0
  33. package/src/page-structure-checks.js +7 -1
  34. package/src/placed-image-ids.js +15 -18
  35. package/src/presentation-reference.js +31 -53
  36. package/src/reference-help.js +97 -27
  37. package/src/reusable-blocks.js +429 -0
  38. package/src/reusable-placements.js +271 -0
  39. package/src/setting-reference.js +57 -1
  40. package/src/settings-catalog.js +3 -0
  41. package/src/site-check-findings.js +30 -2
  42. package/src/site-check-rules.json +1 -0
  43. package/src/site-checks.js +26 -2
  44. package/src/site-health-findings.js +25 -3
  45. package/src/site-health-image-checks.js +1 -1
  46. package/src/staging-check.js +108 -21
  47. package/src/staging-served.js +5 -49
  48. package/src/status-warning-paints.js +17 -0
  49. package/src/template-token-reach.json +20 -2
  50. package/src/theme-resolve.js +27 -0
  51. package/src/transport.js +41 -5
  52. package/src/typed-page-reference.js +55 -5
  53. package/src/typed-pages.js +27 -4
  54. package/src/verbs/approve.js +2 -1
  55. package/src/verbs/deploy.js +93 -15
  56. package/src/verbs/footer-push.js +4 -2
  57. package/src/verbs/forms-push.js +9 -0
  58. package/src/verbs/health.js +11 -6
  59. package/src/verbs/index.js +3 -0
  60. package/src/verbs/pages-blocks-pull.js +22 -0
  61. package/src/verbs/pages-push.js +89 -34
  62. package/src/verbs/plan.js +34 -5
  63. package/src/verbs/pull.js +213 -124
  64. package/src/verbs/status.js +20 -2
  65. package/src/verbs/theme-push.js +170 -20
  66. package/src/verbs/theme-resolve.js +114 -40
  67. package/src/verbs/validate.js +49 -18
  68. package/src/workspace-check.js +42 -5
  69. package/src/workspace-context-usage.js +54 -1
  70. package/src/workspace.js +37 -7
  71. 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
  }
@@ -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.Extract` in the API decides which images a page places, over its stored
6
- * `templateData`. The CLI holds the wire form (the proto-JSON data member of a page read or of
7
- * `wireTemplate(document)`), so this mirrors `Extract` over that shape, and C# is authoritative.
8
- * `shared/image-reference-corpus.json` holds the two together: the API test maps each case's wire twin to its stored
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 === "imageId" && typeof child === "string")
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
- addGenericImageIds(ids, parsed);
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 places only as a section decoration. An id also placed as content
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 the complete light/dark pair it writes; never build a sparse theme from memory. pull resolves the stored theme over the same defaults every consumer renders, so a fresh workspace validates and every group carries its effective value.",
473
- "Define brand anchors first, then assign canvas, ink, accent, action, and structure roles in both schemes. Give the canvas anchor as much chroma as the design's saturation calls for: it sets the chroma of the background, every layer and every border, so a near-white paper anchor produces a grey page that no other setting can rescue.",
474
- "Check the filled action before anything else looks finished. Its ramp stop is chosen by the engine near a mid-band target rather than named by the theme, so seating the ramp — the remedy for every other anchored token — cannot move it, and declaring an action role does not either. The only lever is pinning semanticMappings.actionBackground.",
475
- "A brand colour between roughly L 0.55 and L 0.83 cannot be a button surface at its own lightness: across that band no ink, not even pure black, reaches the Lc 75 APCA asks of a button label. Espalier then walks the label to the far end of the ramp and the button renders inverted — a dark surface carrying a pale label where the swatch wanted the opposite. Pin the stop just past the band instead. A gold at L 0.81 pinned to a tone at L 0.85 carries a dark label at Lc 76; the same gold left to the engine compiles to a brown one.",
476
- "Name a tone as a lowercase slug — gold-band, not goldBand. theme push refuses any other name, and refuses a mapping that names a tone its theme or context never declares.",
477
- "Run taproot-site theme resolve (offline; add --scheme, --context, or --json) after every edit to see what the theme compiles to: for the root page and each context in both schemes, every semantic color as oklch and hex, whether it is compiled from the roles or pinned (origin compiled, pinned, inherited_pin), and the WCAG ratios for semantic and site-chrome pairs against AA (4.5:1 text, 3:1 large text and UI). Paired component properties show Espalier's APCA measurements and adjustment. A pair under AA is listed in flags as theme.contrast_text_below_aa with the field to edit; it never fails the run, so decide whether it is a deliberate choice. theme resolve --site shows the site's stored theme for comparison.",
478
- "theme push runs Espalier's fit report over the root and every context in both schemes and lists each finding as a warning reading 'fit lint <id>'; theme push --dry-run does the same and writes nothing, and validate does it for an offline fixture. Read the lints before calling a theme done: action-anchor-inversion names a filled action that rendered the opposite way round from the swatches it declares, apca-target-unmet names a pair enforcement could not rescue, and action-canvas-separation and link-hover-ordering cover an action lost in its canvas and a hover weaker than its link. A lint is a warning, not a refusal, so a push still goes through with one — the lints are what tell an agent the design did not survive the compile. Contrast and status-color warnings end with 'Nearest passing value: …' when the CLI finds one: it applied that value to a copy of the theme and checked that the warning clears without raising another, so start there and check again. validate and theme push refuse a font weight a catalog family has no face for (theme.font_weight_unavailable), because the publish would fail, and name the nearest weight it has.",
479
- "Add named contexts for whole zones, including inverted zones, and rebind lightness when the zone changes brightness. A context that declares its own action needs its own actionBackground pin: without one it compiles at the engine's mid-band stop, and where the root is pinned it carries the root's pin instead, whatever action colour the context declares.",
480
- "Tune typography, type/space ratios, radii, and viewport interpolation as one layout system.",
481
- "Typography is per scheme on purpose: light and dark set their own moods, so a heading, body, or brand face that differs between them is a design choice, and theme push never warns about it.",
482
- "Retune danger/success/warning/info through intents without changing their meanings; design data palettes separately. "
483
- + "Espalier compares the four statuses and the action color as action fills: each is re-rendered at the action color's lightness stop and "
484
- + "the actionBackground chroma band, and two that land closer than 0.045 apart in OKLab (ΔE-OK) raise a 'Status colors' warning. "
485
- + "Intents are set once per scheme and every context inherits them; a context cannot set its own, so a warning that starts with "
486
- + "'contexts.<name>:' and involves action is fixed by that context's action color (the advice names the field), or left alone; one "
487
- + "between two statuses is retuned through root intents and applies to every zone. A context that "
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 scheme logos; optional lightCompactLogoId and darkCompactLogoId "
582
- + "supply compact logos for Fixed headers above 1.0 when a regular logo resolves. A ready compact logo appears when shrinking starts; pending or failed artwork keeps the regular logo. Inactive choices are retained. "
583
- + "Each takes one image id: upload the highest-resolution file you have and assign it. An @2x or @3x suffix is only "
584
- + "part of a filename, nothing pairs it with another file, and the platform generates the sizes. "
585
- + "Prefer transparent PNG or WebP artwork with genuine alpha so the header background shows through, including "
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
- "Include a favicon when designing a site: upload a square, simplified brand mark and set brand.faviconId "
592
- + "in settings/brand.json, then run theme push; faviconUrl is a read-only projection. Do not shrink a full wordmark into a favicon. "
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 "
@@ -660,22 +642,18 @@ export function getAppearanceReference() {
660
642
  + "fontMenu falls back to the body font, never to headings.",
661
643
  changeSet: [
662
644
  "the footer context and logo variant, saved alongside the theme and header presentation",
663
- "default scheme, assets, favicon, breadcrumb marks, heading spacing and header scalars",
645
+ "default scheme, assets, favicon, breadcrumbs, heading spacing, article and header settings. Omit article fields to preserve them. Use an empty string to reset.",
664
646
  "recipeJumpControl, recipeTagsIcon, recipeTagsContent, tag bar colors, pageTagBadges, the listing card default and optional destination maps in settings/site-publishing-preferences.json",
665
647
  "the complete light theme and the complete dark theme",
666
648
  ],
667
649
  atomic: true,
668
650
  revision:
669
- "pull reads the four settings documents and the site's presentation revision — a server hash over exactly "
670
- + "the fields theme push writes — from one snapshot, so the recorded baseline is the revision of the "
671
- + "documents the workspace holds; theme push sends it back as the baseline. The whole change set commits in "
672
- + "one transaction or none of it does; a change to any of those fields since the pull refuses the push "
673
- + "(theme.concurrent_modification) and nothing is written. The revision includes recipeJumpControl, recipeTagsIcon and pageTagBadges "
674
- + "when they differ from their defaults, and so do the listing card interaction, border width and context. The same holds for breadcrumbSeparator and breadcrumbTrailEnd. "
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.",