@taprootio/site-authoring 0.60.0 → 0.61.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/package.json +2 -2
- package/src/appearance-contract.js +36 -1
- package/src/changelog.json +21 -0
- package/src/chrome-additions.js +25 -7
- package/src/chrome-input.js +47 -0
- package/src/cli.js +1 -1
- package/src/content/components.js +21 -6
- package/src/content/media-presentation.js +13 -2
- package/src/content/validate-document.js +2 -0
- package/src/latest-posts-settings.js +78 -0
- package/src/legal-roles.js +121 -0
- package/src/output.js +2 -0
- package/src/page-metadata.js +3 -0
- package/src/presentation-reference.js +11 -4
- package/src/reference-help.js +16 -3
- package/src/session.js +19 -1
- package/src/setting-reference.js +21 -2
- package/src/settings-catalog.js +5 -0
- package/src/site-check-findings.js +8 -3
- package/src/status-warning-paints.js +2 -2
- package/src/template-token-reach.json +10 -8
- package/src/theme-resolve.js +10 -0
- package/src/theme-validation.js +11 -1
- package/src/token-reach.js +2 -1
- package/src/transport.js +15 -2
- package/src/typed-page-reference.js +11 -2
- package/src/typed-pages.js +3 -1
- package/src/verbs/delivery-check.js +31 -10
- package/src/verbs/footer-push.js +33 -7
- package/src/verbs/pages-meta-set.js +10 -1
- package/src/verbs/pages-push.js +12 -4
- package/src/verbs/plan.js +1 -0
- package/src/verbs/pull.js +26 -4
- package/src/verbs/status.js +23 -0
- package/src/verbs/theme-push.js +9 -0
- package/src/verbs/theme-resolve.js +1 -0
- package/src/verbs/validate.js +14 -5
- package/src/workspace-check.js +20 -8
- package/src/workspace-context-usage.js +12 -5
- package/test/fixtures/default-site-theme.json +1 -1
package/src/reference-help.js
CHANGED
|
@@ -99,7 +99,7 @@ import {
|
|
|
99
99
|
|
|
100
100
|
export { getAppearanceReference, getFooterReference, getSettingsReference, getThemeReference };
|
|
101
101
|
|
|
102
|
-
export const REFERENCE_VERSION =
|
|
102
|
+
export const REFERENCE_VERSION = 85;
|
|
103
103
|
|
|
104
104
|
// The date-limit examples `help forms` prints; tests run them through the form validator.
|
|
105
105
|
export const FORM_DATE_WINDOW_FIELD = Object.freeze({
|
|
@@ -562,7 +562,7 @@ const WORKFLOW_REFERENCES = Object.freeze({
|
|
|
562
562
|
+ "and every section decoration, background and section-owned image problem in a free-form Markdown page. Any other "
|
|
563
563
|
+ "Markdown problem, or a decoration or background problem in a typed page such as an article, stops that file at "
|
|
564
564
|
+ "its first; recipe steps report all of theirs. The JSON keeps the problems that fit its size budget (problemCount "
|
|
565
|
-
+ "and problemsTruncated
|
|
565
|
+
+ "always, and problemsTruncated: true only when some were cut; at most 5,000 are kept), and stderr lists the kept ones. "
|
|
566
566
|
+ "'validate --site' also reads the site's image records and reports each placed image with no default description "
|
|
567
567
|
+ "in imageFindings, with the 'media images describe' command to fix it. "
|
|
568
568
|
+ "'pages push --dry-run' then checks the pages against the live site — paths taken, templates, revisions, "
|
|
@@ -842,7 +842,20 @@ const WORKFLOW_REFERENCES = Object.freeze({
|
|
|
842
842
|
+ "'/b?x=1' and '/b' are the same destination to it.",
|
|
843
843
|
"Refused by the site, which alone knows what it serves: a path a live page, Docs resource, or generated "
|
|
844
844
|
+ "resource already occupies. '/' is such a path while the site's home page is served there — and a "
|
|
845
|
-
+ "usable source once the home page has moved, which is the entry a home-page rename records."
|
|
845
|
+
+ "usable source once the home page has moved, which is the entry a home-page rename records. A page you "
|
|
846
|
+
+ "deleted ('pages delete', which stages a live page's removal) no longer occupies its path, and neither "
|
|
847
|
+
+ "does a folder index once every page under it is deleted, so the redirect goes live in the release that "
|
|
848
|
+
+ "removes the page. If the page is kept or restored, it takes its path back and the redirect is dropped.",
|
|
849
|
+
"Moving pages to another site: on the old site, point navigation items at the new site's URLs (kind "
|
|
850
|
+
+ "NAV_ITEM_KIND_EXTERNAL_URL with externalUrl, and no resourceId) and 'nav push', which the next staging deploy "
|
|
851
|
+
+ "carries; change links in pages that stay, 'pages push' and 'approve' them; 'pages "
|
|
852
|
+
+ "delete' each moved page; add one entry per old path with the absolute target ('https://new.example/path', in the "
|
|
853
|
+
+ "spelling the new site serves) and repoint every entry whose target was a moved page, path_history "
|
|
854
|
+
+ "entries included (a changed entry becomes authored; an unchanged one would now be a chain); "
|
|
855
|
+
+ "'validate', 'redirects push', 'deploy --staging', then 'redirects check' (delivery check may report a "
|
|
856
|
+
+ "removed folder index as degraded, since its path now answers 301). Promoting that release removes "
|
|
857
|
+
+ "the pages and starts the redirects at once. Generated lists, the archive and sitemap.xml drop the pages "
|
|
858
|
+
+ "with that release.",
|
|
846
859
|
`Bounded: at most ${REDIRECT_LIMITS.entries} entries, ${REDIRECT_LIMITS.pathBytes} bytes of path, and `
|
|
847
860
|
+ `${REDIRECT_LIMITS.targetBytes} bytes of target, matching the edge's own key and value limits.`,
|
|
848
861
|
`The ${REDIRECT_LIMITS.pathBytes}-byte path bound governs what you declare, not what the site already `
|
package/src/session.js
CHANGED
|
@@ -210,6 +210,22 @@ export async function openAccountSession(invocation = {}) {
|
|
|
210
210
|
* There is deliberately no second environment variable for the sign-in
|
|
211
211
|
* credential. One override, one precedence rule.
|
|
212
212
|
*/
|
|
213
|
+
/**
|
|
214
|
+
* Whether this machine's legal-drafts sign-in for the site says it is Taproot's platform legal site, read from the
|
|
215
|
+
* local store without a request so offline validate can apply the same legal-role rule a push does (TR01433).
|
|
216
|
+
* Anything unreadable answers false: a creator site is the common case and the site refuses again regardless.
|
|
217
|
+
*/
|
|
218
|
+
export async function storedPlatformLegalSite(invocation, siteId) {
|
|
219
|
+
try {
|
|
220
|
+
const environment = invocation.environment ?? process.env;
|
|
221
|
+
const store = await readCredentialStore(environment);
|
|
222
|
+
const credential = selectCredential(store.credentials, credentialApiOrigin(await resolveApiBaseUrl(environment)), { siteId });
|
|
223
|
+
return credential?.legalDraftPlatformSite === true;
|
|
224
|
+
} catch {
|
|
225
|
+
return false;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
213
229
|
/**
|
|
214
230
|
* Which Taproot to talk to. Machine state, then the production default — the
|
|
215
231
|
* project has no say since TR00645, so every session path resolves it here
|
|
@@ -271,7 +287,9 @@ export async function resolveSiteSession(invocation = {}) {
|
|
|
271
287
|
+ `If Taproot refuses it, run '${CLI_BINARY_NAME} ${VERB_LOGIN} --legal-drafts' again.`,
|
|
272
288
|
);
|
|
273
289
|
}
|
|
274
|
-
|
|
290
|
+
const session = resolveDirectSiteSession(invocation, { config, apiBaseUrl, now, onProgress }, credential.key);
|
|
291
|
+
// Only Taproot's platform legal site may use Taproot-owned legal roles (TR01433).
|
|
292
|
+
return { ...session, open: () => ({ ...session.open(), legalDraftPlatformSite: credential.legalDraftPlatformSite === true }) };
|
|
275
293
|
}
|
|
276
294
|
|
|
277
295
|
let config;
|
package/src/setting-reference.js
CHANGED
|
@@ -439,7 +439,9 @@ const PREFERENCES_ENTRIES = {
|
|
|
439
439
|
),
|
|
440
440
|
tiptapImageMaxHeightVh: entry(
|
|
441
441
|
`${FEATURES} > Image height`,
|
|
442
|
-
"The tallest an image in a page body may be,
|
|
442
|
+
"The tallest an image in a page body may be, in screen-height units (vh: 45, 60, 75 or 90). An image's own "
|
|
443
|
+
+ "maxHeight overrides it; a bare percentage there (\"50%\") also means that share of the screen height, "
|
|
444
|
+
+ "and a percentage inside calc() is ignored.",
|
|
443
445
|
"Images in page bodies.",
|
|
444
446
|
60,
|
|
445
447
|
),
|
|
@@ -469,7 +471,7 @@ const PREFERENCES_ENTRIES = {
|
|
|
469
471
|
),
|
|
470
472
|
albumMaxRowHeightVh: entry(
|
|
471
473
|
`${FEATURES} > Album maximum row height`,
|
|
472
|
-
"The tallest an album row may be,
|
|
474
|
+
"The tallest an album row may be, in screen-height units (vh, 1 to 100). A partial last row stays no "
|
|
473
475
|
+ "taller than the rows before it.",
|
|
474
476
|
"Album pages.",
|
|
475
477
|
90,
|
|
@@ -513,6 +515,23 @@ const PREFERENCES_ENTRIES = {
|
|
|
513
515
|
RECIPE_TAG_BAR_COLOR_USAGE + " Empty uses --esp-color-text. Validation warns below 3:1 against the bar fill in either color scheme. Set badge ink in help theme.",
|
|
514
516
|
"The recipe tag bar's decorative icon.",
|
|
515
517
|
),
|
|
518
|
+
listingCardInteraction: entry(
|
|
519
|
+
`${FEATURES} > Listing cards > Card interaction`,
|
|
520
|
+
"Choose grow, lift, press or none. An empty value resets this setting to grow.",
|
|
521
|
+
"How a card answers a pointer in folder indexes and the archive, and in any Latest Posts list that leaves its own interaction out. Applies after deployment.",
|
|
522
|
+
),
|
|
523
|
+
listingCardBorderWidth: entry(
|
|
524
|
+
`${FEATURES} > Listing cards > Card border width`,
|
|
525
|
+
"A whole number of pixels from 0 through 20; 0 draws no border. An empty string resets it to 1. Leave the field out to keep the site's value.",
|
|
526
|
+
"The line around each card in folder indexes and the archive, and in any Latest Posts list that leaves its own borderWidth out. Applies after deployment.",
|
|
527
|
+
),
|
|
528
|
+
listingCardContext: entry(
|
|
529
|
+
`${FEATURES} > Listing cards > Card colors`,
|
|
530
|
+
"Name a context declared by both lightTheme and darkTheme, or leave it empty to follow the page. Leave the field out to keep the site's value. "
|
|
531
|
+
+ "A context that no longer exists in both themes fails settings.context_unknown, and dropping one the listing cards still use fails theme.context_in_use. "
|
|
532
|
+
+ "A profile site renders in its owner's own theme, so it accepts only an empty value.",
|
|
533
|
+
"The card fill, border and shadow colors of every generated listing and every Latest Posts list. Define a context whose border and shadow roles differ from the page to give cards their own. Applies after deployment.",
|
|
534
|
+
),
|
|
516
535
|
tagDestinations: entry(
|
|
517
536
|
"Tag destinations",
|
|
518
537
|
"Map authored tag names to page resource IDs from pull. Names are case-insensitive and pull writes canonical slugs. "
|
package/src/settings-catalog.js
CHANGED
|
@@ -8,6 +8,7 @@ import { SiteAuthoringError } from "./errors.js";
|
|
|
8
8
|
import { closeFieldMatch, unknownFieldHint } from "./field-suggestions.js";
|
|
9
9
|
import { projectFooterSettingsForWorkspace } from "./footer-contract.js";
|
|
10
10
|
import { parseHeaderHeightMultiplier, resolveLogoVariant } from "./header-presentation.js";
|
|
11
|
+
import { latestPostsInteraction } from "./latest-posts-settings.js";
|
|
11
12
|
import { normalizePageTagBadges } from "./page-tag-badge-modes.js";
|
|
12
13
|
import { normalizeRecipeJumpControl, normalizeRecipeTagsContent, normalizeRecipeTagsIcon } from "./recipe-page-options.js";
|
|
13
14
|
import { projectPulledTheme } from "./theme-projection.js";
|
|
@@ -181,6 +182,10 @@ export const SETTINGS_GROUPS = Object.freeze([
|
|
|
181
182
|
{ name: "recipeTagsBarBackground", wireType: "string", optional: true },
|
|
182
183
|
{ name: "recipeTagsBarBorderColor", wireType: "string", optional: true },
|
|
183
184
|
{ name: "recipeTagsBarColor", wireType: "string", optional: true },
|
|
185
|
+
// The site's listing card default (TR01438). An unset width stays absent so it reads as "1".
|
|
186
|
+
{ name: "listingCardInteraction", wireType: "string", normalize: latestPostsInteraction, optional: true },
|
|
187
|
+
{ name: "listingCardBorderWidth", wireType: "int", optional: true },
|
|
188
|
+
{ name: "listingCardContext", wireType: "string", optional: true },
|
|
184
189
|
{ name: "footerSettings", wireType: "document", zero: {} },
|
|
185
190
|
]),
|
|
186
191
|
}),
|
|
@@ -6,7 +6,7 @@ import rules from "./site-check-rules.json" with { type: "json" };
|
|
|
6
6
|
import { isFormKey } from "./forms-contract.js";
|
|
7
7
|
import { DESCRIPTION_MINIMUM_LENGTH, DESCRIPTION_WARN_LENGTH, localAuthoringMetadata, METADATA_RULE_IDS, pageStructureFindings, RULE_IMAGE_DEFAULT_MISSING, TITLE_MINIMUM_LENGTH, TITLE_WARN_LENGTH } from "./page-structure-checks.js";
|
|
8
8
|
import { missingPageLinkFindings, normalizedPathSet } from "./site-checks.js";
|
|
9
|
-
import { documentTemplate, TEMPLATE_FREE_FORM, TEMPLATE_GENERATED } from "./typed-pages.js";
|
|
9
|
+
import { documentTemplate, TEMPLATE_FREE_FORM, TEMPLATE_GENERATED, TEMPLATE_LEGAL } from "./typed-pages.js";
|
|
10
10
|
import { displayPagePath } from "./workspace.js";
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -75,7 +75,9 @@ export const SITE_CHECK_WORDING = Object.freeze({
|
|
|
75
75
|
"a11y.link_text_empty": (finding) => `has a link to ${finding.subject} with no text`,
|
|
76
76
|
"seo.title_missing": () => "has no title; add one that identifies the page",
|
|
77
77
|
"seo.title_short": (finding) => `has a title of ${finding.detail} characters; consider a more specific title (guidance: ${TITLE_MINIMUM_LENGTH}–${TITLE_WARN_LENGTH})`,
|
|
78
|
-
|
|
78
|
+
// A post card takes five lines, which holds a title within the guidance on the usual card widths (TR01437).
|
|
79
|
+
"seo.title_long": (finding) => `has a title of ${finding.detail} characters; consider shortening it (guidance: ${TITLE_MINIMUM_LENGTH}–${TITLE_WARN_LENGTH}). `
|
|
80
|
+
+ "Search results and post cards may cut a longer title; a card ends it in an ellipsis",
|
|
79
81
|
"seo.description_missing": () => "has no description; add a short account of what the page offers",
|
|
80
82
|
"seo.description_short": (finding) => `has a description of ${finding.detail} characters; consider adding useful detail (guidance: ${DESCRIPTION_MINIMUM_LENGTH}–${DESCRIPTION_WARN_LENGTH})`,
|
|
81
83
|
"seo.description_long": (finding) => `has a description of ${finding.detail} characters; consider shortening it (guidance: ${DESCRIPTION_MINIMUM_LENGTH}–${DESCRIPTION_WARN_LENGTH})`,
|
|
@@ -199,7 +201,10 @@ function structureFindingsFor(page) {
|
|
|
199
201
|
body: freeForm ? page.document : undefined,
|
|
200
202
|
...localAuthoringMetadata({
|
|
201
203
|
title: page.title,
|
|
202
|
-
|
|
204
|
+
// A legal page carries no description: Taproot stores and renders none (TR01433).
|
|
205
|
+
description: template === TEMPLATE_LEGAL || page.metadataDescriptionKnown === false
|
|
206
|
+
? undefined
|
|
207
|
+
: page.declaredDescription ?? page.description,
|
|
203
208
|
homePage: page.pagePath === "" || page.pagePath === "/",
|
|
204
209
|
generated: template === TEMPLATE_GENERATED ? page.document.data ?? {} : undefined,
|
|
205
210
|
}),
|
|
@@ -83,8 +83,8 @@ const USE_KIND_LABEL = Object.freeze({ section: "section", cta: "call to action"
|
|
|
83
83
|
function usageLine(record) {
|
|
84
84
|
if (record.usedBy === undefined) return [];
|
|
85
85
|
if (record.usedBy === null) return [` Used by: ${record.usedByNote}`];
|
|
86
|
-
const { header, footer, sections, ctas } = record.usedBy;
|
|
87
|
-
const parts = [header ? "header" : "", footer ? "footer" : "", sections > 0 ? `${sections} section(s)` : "", ctas > 0 ? `${ctas} call(s) to action` : ""];
|
|
86
|
+
const { header, footer, listingCards, sections, ctas } = record.usedBy;
|
|
87
|
+
const parts = [header ? "header" : "", footer ? "footer" : "", listingCards ? "listing cards" : "", sections > 0 ? `${sections} section(s)` : "", ctas > 0 ? `${ctas} call(s) to action` : ""];
|
|
88
88
|
const { items = [], total = 0 } = record.usedIn ?? {};
|
|
89
89
|
const where = items.map(({ file, kind, position }) => `${file} ${USE_KIND_LABEL[kind] ?? kind} ${position}`);
|
|
90
90
|
if (total > items.length) where.push(`and ${total - items.length} more`);
|
|
@@ -17,12 +17,6 @@
|
|
|
17
17
|
{"token": "--esp-color-shadow", "file": "generator/client/pages/card-grid/taproot-card-grid.ts", "markup": ":host", "part": "--taproot-cg-card-shadow", "label": "card grid shadow fallback", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
18
18
|
{"token": "--esp-color-layer-1", "file": "generator/client/pages/card-grid/taproot-card-grid.ts", "markup": "::slotted(.card-item)", "part": "background", "label": "card item fill", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
19
19
|
{"token": "--esp-color-border", "file": "generator/client/pages/card-grid/taproot-card-grid.ts", "markup": "::slotted(.card-item)", "part": "border", "label": "card item border", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
20
|
-
{"token": "--esp-color-layer-2", "file": "generator/client/pages/card-grid/taproot-card-grid.ts", "markup": ":host(:is(:not([interaction]), [interaction=\"lift\"])) ::slotted(a.card-item:is(:hover, :focus-visible))", "part": "background", "label": "card item hover fill", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
21
|
-
{"token": "--esp-color-shadow", "file": "generator/client/pages/card-grid/taproot-card-grid.ts", "markup": ":host([interaction=\"press\"]) ::slotted(.card-item)", "part": "box-shadow via --esp-shadow-2", "label": "pressable card resting shadow", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
22
|
-
{"token": "--esp-color-shadow", "file": "generator/client/pages/card-grid/taproot-card-grid.ts", "markup": ":host([interaction=\"press\"]) ::slotted(.card-item)", "part": "box-shadow", "label": "pressable card resting shadow fallback", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
23
|
-
{"token": "--esp-color-layer-2", "file": "generator/client/pages/card-grid/taproot-card-grid.ts", "markup": ":host([interaction=\"press\"]) ::slotted(a.card-item:is(:hover, :focus-visible))", "part": "background", "label": "pressable card hover fill", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
24
|
-
{"token": "--esp-color-shadow", "file": "generator/client/pages/card-grid/taproot-card-grid.ts", "markup": ":host([interaction=\"press\"]) ::slotted(a.card-item:is(:hover, :focus-visible))", "part": "box-shadow via --esp-shadow-1", "label": "pressable card hover shadow", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
25
|
-
{"token": "--esp-color-shadow", "file": "generator/client/pages/card-grid/taproot-card-grid.ts", "markup": ":host([interaction=\"press\"]) ::slotted(a.card-item:is(:hover, :focus-visible))", "part": "box-shadow", "label": "pressable card hover shadow fallback", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
26
20
|
{"token": "--esp-color-link", "file": "generator/client/pages/card-grid/taproot-card-grid.ts", "markup": "::slotted(a.card-item:focus-visible)", "part": "outline", "label": "card item focus ring", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
27
21
|
{"token": "--esp-color-layer-2", "file": "generator/client/pages/card-grid/taproot-card-grid.ts", "markup": ":host(:not([interaction=\"none\"])) ::slotted(a.card-item:focus-visible)", "part": "background", "label": "card item fill", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
28
22
|
{"token": "intent:danger", "file": "generator/client/pages/cta/taproot-cta.ts", "markup": "esp-button[class=\"cta__button\"]", "part": "intent", "label": "destructive call-to-action button", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
@@ -41,8 +35,9 @@
|
|
|
41
35
|
{"token": "--esp-color-type-lead", "file": "generator/src/hero-cta-markup.ts", "markup": "taproot-hero > [slot=\"lead\"]", "part": "color via --esp-type-lead-color", "label": "hero lead ink", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
42
36
|
{"token": "--esp-color-link", "file": "generator/client/pages/image-row/taproot-image-row.ts", "markup": "taproot-image-row > a.image-row__item:focus-visible", "part": "outline", "label": "image row item focus ring", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
43
37
|
{"token": "--esp-color-text", "file": "generator/client/pages/latest-posts/taproot-latest-posts.ts", "markup": "taproot-latest-posts :is(a.post-card.post-card, a.post-card__link)", "part": "color", "label": "latest posts card link ink", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
44
|
-
{"token": "--esp-color-layer-2", "file": "generator/client/pages/latest-posts/taproot-latest-posts.ts", "markup": "taproot-latest-posts :is(a.post-card.post-card:hover, article.post-card:has(> a.post-card__link:hover))", "part": "background", "label": "latest posts hover fill", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
45
|
-
{"token": "--esp-color-layer-1", "file": "generator/client/pages/latest-posts/taproot-latest-posts.ts", "markup": "taproot-latest-posts :is(a.post-card.post-card:hover, article.post-card:has(> a.post-card__link:hover))", "part": "background", "label": "latest posts hover fill fallback", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
38
|
+
{"token": "--esp-color-layer-2", "file": "generator/client/pages/latest-posts/taproot-latest-posts.ts", "markup": "taproot-latest-posts:not([interaction=\"none\"]) :is(a.post-card.post-card:hover, article.post-card:has(> a.post-card__link:hover))", "part": "background", "label": "latest posts hover fill", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
39
|
+
{"token": "--esp-color-layer-1", "file": "generator/client/pages/latest-posts/taproot-latest-posts.ts", "markup": "taproot-latest-posts:not([interaction=\"none\"]) :is(a.post-card.post-card:hover, article.post-card:has(> a.post-card__link:hover))", "part": "background", "label": "latest posts hover fill fallback", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
40
|
+
{"token": "--esp-color-layer-1", "file": "generator/client/pages/latest-posts/taproot-latest-posts.ts", "markup": "taproot-latest-posts[interaction=\"none\"] :is(a.post-card.post-card:hover, article.post-card:has(> a.post-card__link:hover))", "part": "background", "label": "latest posts still card fill", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
46
41
|
{"token": "--esp-color-link", "file": "generator/client/pages/latest-posts/taproot-latest-posts.ts", "markup": "taproot-latest-posts .post-card__link:focus-visible", "part": "outline", "label": "linked-tag card focus ring", "topics": ["article", "recipe", "generated"]},
|
|
47
42
|
{"token": "--esp-color-headings", "file": "generator/client/pages/latest-posts/taproot-latest-posts.ts", "markup": "taproot-latest-posts .post-card__title", "part": "color", "label": "post card title ink", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
48
43
|
{"token": "--esp-color-type-caption", "file": "generator/client/pages/latest-posts/taproot-latest-posts.ts", "markup": "taproot-latest-posts .post-card__meta", "part": "color", "label": "post card meta ink", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
@@ -60,7 +55,14 @@
|
|
|
60
55
|
{"token": "--esp-color-type-caption", "file": "generator/client/pages/product-grid/taproot-product-grid.ts", "markup": "taproot-product-grid .product-item > .product-item__price > .product-item__note", "part": "color", "label": "product item note ink", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
61
56
|
{"token": "--esp-color-layer-2", "file": "generator/client/pages/recipe/taproot-recipe.ts", "markup": ".recipe-meta ::slotted(*)", "part": "background", "label": "recipe meta fill", "topics": ["recipe"]},
|
|
62
57
|
{"token": "--esp-color-headings", "file": "generator/client/pages/recipe/taproot-recipe.ts", "markup": ".recipe-instructions h2", "part": "color", "label": "recipe instructions ink", "topics": ["recipe"]},
|
|
58
|
+
{"token": "--esp-color-layer-2", "file": "generator/client/pages/shared/card-motion.ts", "markup": "LIFT", "part": "background", "label": "lifted card fill", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
59
|
+
{"token": "--esp-color-shadow", "file": "generator/client/pages/shared/card-motion.ts", "markup": "PRESS_REST", "part": "box-shadow via --esp-shadow-2", "label": "pressable card resting shadow", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
60
|
+
{"token": "--esp-color-shadow", "file": "generator/client/pages/shared/card-motion.ts", "markup": "PRESS_REST", "part": "box-shadow", "label": "pressable card resting shadow fallback", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
61
|
+
{"token": "--esp-color-layer-2", "file": "generator/client/pages/shared/card-motion.ts", "markup": "PRESS_ENGAGED", "part": "background", "label": "pressable card hover fill", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
62
|
+
{"token": "--esp-color-shadow", "file": "generator/client/pages/shared/card-motion.ts", "markup": "PRESS_ENGAGED", "part": "box-shadow via --esp-shadow-1", "label": "pressable card hover shadow", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
63
|
+
{"token": "--esp-color-shadow", "file": "generator/client/pages/shared/card-motion.ts", "markup": "PRESS_ENGAGED", "part": "box-shadow", "label": "pressable card hover shadow fallback", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
63
64
|
{"token": "--esp-color-headings", "file": "generator/client/pages/shared/taproot-page-base.ts", "markup": ":host", "part": "--taproot-title-color", "label": "published page title ink with --esp-heading-1-color unset", "topics": ["article", "album", "recipe", "place-review"]},
|
|
65
|
+
{"token": "--esp-color-link", "file": "generator/client/pages/shared/taproot-page-base.ts", "markup": ":host", "part": "--taproot-byline-color", "label": "published author and byline link ink with --esp-byline-color unset", "topics": ["article", "album", "recipe", "place-review"]},
|
|
64
66
|
{"token": "--esp-color-border", "file": "generator/client/pages/spacer/taproot-spacer.ts", "markup": ".spacer__divider", "part": "border-top", "label": "spacer divider top border", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
65
67
|
{"token": "--esp-color-text", "file": "generator/client/pages/testimonial/taproot-testimonial.ts", "markup": ":host", "part": "color", "label": "testimonial text", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
66
68
|
{"token": "--esp-color-border", "file": "generator/client/pages/testimonial/taproot-testimonial.ts", "markup": "::slotted(.testimonial-item)", "part": "border", "label": "testimonial item border", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
package/src/theme-resolve.js
CHANGED
|
@@ -351,6 +351,14 @@ function formatComponentContrast({ apca, adjusted, targetLc }) {
|
|
|
351
351
|
+ `(${apca.againstColor}), ${adjusted ? "adjusted" : "unchanged"}`;
|
|
352
352
|
}
|
|
353
353
|
|
|
354
|
+
/** The label ink Espalier fits to a fill property, as the fit report traces it (TR01437). */
|
|
355
|
+
function formatComponentInk({ ink }) {
|
|
356
|
+
if (ink === undefined || ink === null) return "";
|
|
357
|
+
return `Label ink Lc ${floorTo(ink.fromLc, 1)} → ${floorTo(ink.toLc, 1)} (target ${ink.targetLc}) on this fill `
|
|
358
|
+
+ `(${ink.againstColor}), WCAG ${floorTo(ink.wcagRatio, 2)}:1, ${ink.requested === ink.resolved ? "unchanged" : "fitted"} `
|
|
359
|
+
+ `to ${ink.resolved}`;
|
|
360
|
+
}
|
|
361
|
+
|
|
354
362
|
function displayLc(value, target) {
|
|
355
363
|
const shown = floorTo(value, 1);
|
|
356
364
|
return value < target && shown >= target ? target - 0.1 : shown;
|
|
@@ -444,6 +452,8 @@ export function formatThemeResolve(result) {
|
|
|
444
452
|
` Authored ${JSON.stringify(property.authored)} → resolved ${property.resolved}. Root override ${override}.`,
|
|
445
453
|
);
|
|
446
454
|
if (contrast !== "") lines.push(` ${contrast}`);
|
|
455
|
+
const ink = formatComponentInk(property);
|
|
456
|
+
if (ink !== "") lines.push(` ${ink}`);
|
|
447
457
|
}
|
|
448
458
|
}
|
|
449
459
|
}
|
package/src/theme-validation.js
CHANGED
|
@@ -75,6 +75,7 @@ export const OPTIONAL_THEME_FIELDS = Object.freeze([
|
|
|
75
75
|
"vellumOpacity",
|
|
76
76
|
"vellumBackgroundImage",
|
|
77
77
|
"vellumBackgroundImageOpacity",
|
|
78
|
+
"typeRatioMin",
|
|
78
79
|
"componentProperties",
|
|
79
80
|
]);
|
|
80
81
|
|
|
@@ -122,7 +123,10 @@ export const HEADER_BRAND_COLOR_TOKENS = Object.freeze(
|
|
|
122
123
|
);
|
|
123
124
|
|
|
124
125
|
/** Validate the complete post-save state, including an atomic repoint and context removal. */
|
|
125
|
-
export function requireSurfaceContexts(
|
|
126
|
+
export function requireSurfaceContexts(
|
|
127
|
+
{ lightTheme, darkTheme, headerContext = "", footerContext = "", listingCardContext = "" },
|
|
128
|
+
current,
|
|
129
|
+
) {
|
|
126
130
|
const declared = new Set(sharedDeclaredThemeContextNames(lightTheme, darkTheme));
|
|
127
131
|
const previous = current === undefined ? new Set() : new Set(sharedEncodedThemeContextNames(
|
|
128
132
|
current.styleSettings?.lightTheme,
|
|
@@ -137,6 +141,12 @@ export function requireSurfaceContexts({ lightTheme, darkTheme, headerContext =
|
|
|
137
141
|
footerContext,
|
|
138
142
|
current?.sitePublishingPreferences?.footerSettings?.context ?? "",
|
|
139
143
|
],
|
|
144
|
+
[
|
|
145
|
+
"listing card",
|
|
146
|
+
"site-publishing-preferences.listingCardContext",
|
|
147
|
+
listingCardContext,
|
|
148
|
+
current?.sitePublishingPreferences?.listingCardContext ?? "",
|
|
149
|
+
],
|
|
140
150
|
]
|
|
141
151
|
) {
|
|
142
152
|
if (context === "" || declared.has(context)) continue;
|
package/src/token-reach.js
CHANGED
|
@@ -29,7 +29,8 @@ const BORDER_PAINT_NOTES = [
|
|
|
29
29
|
state: "default",
|
|
30
30
|
label: "header border value",
|
|
31
31
|
folder: "header",
|
|
32
|
-
text: "The header bottom hairline uses 1px of the context's border token
|
|
32
|
+
text: "The header bottom hairline uses 1px of the context's border token, or the theme's "
|
|
33
|
+
+ "--esp-header-border-bottom-width.",
|
|
33
34
|
},
|
|
34
35
|
{
|
|
35
36
|
token: "--esp-color-border",
|
package/src/transport.js
CHANGED
|
@@ -512,6 +512,9 @@ function parseRetryAfterHeader(headers) {
|
|
|
512
512
|
return Number.isFinite(seconds) && seconds >= 0 ? seconds : undefined;
|
|
513
513
|
}
|
|
514
514
|
|
|
515
|
+
// A site authoring key, or a URL with a query string (which is how a presigned URL carries its signature).
|
|
516
|
+
const CREDENTIAL_SHAPED = /\btr_[a-z]+_|[a-z][a-z0-9+.-]*:\/\/[^\s]*\?/iu;
|
|
517
|
+
|
|
515
518
|
export class ApiError extends SiteAuthoringError {
|
|
516
519
|
constructor(httpStatus, body, headers) {
|
|
517
520
|
const grpcCode = Number.isSafeInteger(body?.code) ? body.code : undefined;
|
|
@@ -527,10 +530,19 @@ export class ApiError extends SiteAuthoringError {
|
|
|
527
530
|
&& !hasControlCharacter(body.message)
|
|
528
531
|
? sanitizeDiagnostic(body.message, "")
|
|
529
532
|
: undefined;
|
|
533
|
+
const descriptions = fieldDescriptions(body);
|
|
534
|
+
// The site's own reason for the first refused field, already length-capped and control-free (TR01433). A reason
|
|
535
|
+
// that looks like it carries a key or a signed URL is withheld, since results reach logs and Actions output.
|
|
536
|
+
const described = fields.length > 0 ? descriptions.get(fields[0]) : undefined;
|
|
537
|
+
const reason = typeof described === "string" && !CREDENTIAL_SHAPED.test(described)
|
|
538
|
+
? sanitizeDiagnostic(described, "")
|
|
539
|
+
: "";
|
|
530
540
|
super(
|
|
531
541
|
"api.request_rejected",
|
|
532
542
|
upgradeMessage || (fields.length > 0
|
|
533
|
-
?
|
|
543
|
+
? reason === ""
|
|
544
|
+
? `Taproot rejected the request field '${fields[0]}'.`
|
|
545
|
+
: `Taproot rejected the request field '${fields[0]}': ${reason}`
|
|
534
546
|
: planLimit !== undefined
|
|
535
547
|
? planLimit.reason === BANDWIDTH_ALLOWANCE_REFUSAL_REASON
|
|
536
548
|
? "Taproot paused deployments: the site used more than its monthly bandwidth for two months in a row."
|
|
@@ -552,7 +564,8 @@ export class ApiError extends SiteAuthoringError {
|
|
|
552
564
|
this.httpStatus = httpStatus;
|
|
553
565
|
this.grpcCode = grpcCode;
|
|
554
566
|
this.fields = fields;
|
|
555
|
-
this.violationDescriptions =
|
|
567
|
+
this.violationDescriptions = descriptions;
|
|
568
|
+
if (reason !== "") this.reason = reason;
|
|
556
569
|
this.capability = capability;
|
|
557
570
|
this.planLimit = planLimit;
|
|
558
571
|
// The `retry-after` trailer (TR00839's deployment throttle, or any other
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LEGAL_ROLE_MEMBERSHIP_TERMS, LEGAL_ROLE_OTHER_NOTICE, TAPROOT_OWNED_LEGAL_ROLES } from "./legal-roles.js";
|
|
1
2
|
import { CLI_BINARY_NAME } from "./constants.js";
|
|
2
3
|
import { RECIPE_STEP_CONTRACT } from "./recipe-step-contract.js";
|
|
3
4
|
import {
|
|
@@ -442,7 +443,13 @@ function legalReference() {
|
|
|
442
443
|
Object.freeze({
|
|
443
444
|
name: "documentRole",
|
|
444
445
|
description:
|
|
445
|
-
|
|
446
|
+
`The typed purpose of the document, fixed after creation. A creator site uses '${LEGAL_ROLE_OTHER_NOTICE}' for `
|
|
447
|
+
+ "its own policies, its privacy policy included, with documentKey equal to the last segment of the path "
|
|
448
|
+
+ `(documentKey 'privacy' at /privacy), or '${LEGAL_ROLE_MEMBERSHIP_TERMS}' for a membership product's terms `
|
|
449
|
+
+ "(documentKey '<product-slug>-membership-terms' at /<product-slug>/membership-terms; validate checks that "
|
|
450
|
+
+ "shape, and the site checks the product exists). Every other role "
|
|
451
|
+
+ `(${TAPROOT_OWNED_LEGAL_ROLES.join(", ")}) is Taproot's own and is refused on a creator site; validate and `
|
|
452
|
+
+ "pages push say so before anything is sent.",
|
|
446
453
|
}),
|
|
447
454
|
Object.freeze({ name: "summaryOfChanges", description: "A short note on what this version changed, written by the owner." }),
|
|
448
455
|
Object.freeze({
|
|
@@ -535,7 +542,9 @@ function typedReference(type) {
|
|
|
535
542
|
purpose: generated
|
|
536
543
|
? "The pulled form, and the only one: { template, data }. Path comes from the manifest; title and description "
|
|
537
544
|
+ "are the custom ones in data."
|
|
538
|
-
: "The pulled form: { template, displayDate?, displayAuthor?, showOnProfile?, coverImageId?, data }.
|
|
545
|
+
: "The pulled form: { template, displayDate?, displayAuthor?, showOnProfile?, coverImageId?, tags?, data }. tags is "
|
|
546
|
+
+ "the page's authored tag names, where the template takes them; 'status' reports whether Taproot accepts tag "
|
|
547
|
+
+ "writes now. Title, path and description come from the manifest.",
|
|
539
548
|
dataFields: Object.freeze(details.dataFields),
|
|
540
549
|
}),
|
|
541
550
|
]),
|
package/src/typed-pages.js
CHANGED
|
@@ -114,10 +114,12 @@ const DISPLAY_DATE = /^\d{4}-\d{2}-\d{2}$/u;
|
|
|
114
114
|
const ALBUM_IMAGES_HEADING = "images";
|
|
115
115
|
const RECIPE_HEADINGS = Object.freeze(["ingredients", "instructions"]);
|
|
116
116
|
|
|
117
|
+
export const GENERATED_PAGE_KIND_FOLDER_INDEX = "GENERATED_PAGE_KIND_FOLDER_INDEX";
|
|
118
|
+
|
|
117
119
|
/** The generated page kinds the site reports, as the API names them (never the unknown kind). */
|
|
118
120
|
export const GENERATED_PAGE_KINDS = Object.freeze([
|
|
119
121
|
"GENERATED_PAGE_KIND_PUBLISHED_INDEX",
|
|
120
|
-
|
|
122
|
+
GENERATED_PAGE_KIND_FOLDER_INDEX,
|
|
121
123
|
"GENERATED_PAGE_KIND_MAP_INDEX",
|
|
122
124
|
]);
|
|
123
125
|
/**
|
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
withRefusalGuidance,
|
|
9
9
|
} from "../api.js";
|
|
10
10
|
import { boundSkippedLinks } from "../chrome-additions.js";
|
|
11
|
-
import { linkedPageEntries, unlinkedSavedPageEntries } from "../chrome-input.js";
|
|
11
|
+
import { isUnpublishedApprovedLegalPage, linkedPageEntries, unlinkedSavedPageEntries } from "../chrome-input.js";
|
|
12
12
|
import { DEPLOY_TARGET_PRODUCTION, DEPLOY_TARGET_STAGING, LIMITS, VERB_DELIVERY_CHECK } from "../constants.js";
|
|
13
13
|
import { probeDeliveryWithBrowser } from "../delivery-browser.js";
|
|
14
14
|
import { checkDelivery, selectDeliveryRoutes } from "../delivery-check.js";
|
|
15
|
-
import { SiteAuthoringError } from "../errors.js";
|
|
15
|
+
import { sanitizeDiagnostic, SiteAuthoringError } from "../errors.js";
|
|
16
16
|
import { openSession, successResult } from "../session.js";
|
|
17
17
|
import { authorizeStagingHandoff } from "../staging-check.js";
|
|
18
18
|
import { readManifest } from "../workspace.js";
|
|
@@ -45,11 +45,12 @@ function environmentFor(target) {
|
|
|
45
45
|
* the recipe, album or review that renders through a different template, which
|
|
46
46
|
* is exactly what a delivery check on a typed-content site has to prove (TR00893).
|
|
47
47
|
*/
|
|
48
|
-
function routesToCheck(pages) {
|
|
48
|
+
function routesToCheck(pages, target) {
|
|
49
49
|
const seenTemplates = new Set();
|
|
50
50
|
const firstOfTemplate = [];
|
|
51
51
|
const rest = [];
|
|
52
|
-
|
|
52
|
+
const unstaged = unstagedLegalResourceIds(pages, target);
|
|
53
|
+
for (const page of linkedPageEntries(pages).filter((entry) => !unstaged.has(entry.resourceId))) {
|
|
53
54
|
(seenTemplates.has(page.templateType) ? rest : firstOfTemplate).push(page);
|
|
54
55
|
seenTemplates.add(page.templateType);
|
|
55
56
|
}
|
|
@@ -61,15 +62,35 @@ const UNCHECKED_ROUTE_REASON = "omitted from the authored-route sample: the work
|
|
|
61
62
|
// Room kept for the envelope a verb wraps around its fields.
|
|
62
63
|
const RESULT_ENVELOPE_RESERVE_BYTES = 2048;
|
|
63
64
|
|
|
65
|
+
const UNSTAGED_LEGAL_ROUTE_REASON = "omitted from the authored-route sample: an approved legal page that has never been published, which deploy --staging leaves out; staging serves it only if it was staged from the app, so check it there by hand";
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* An approved, never-published legal page on a staging check: the CLI's deploy leaves legal pages out, so staging
|
|
69
|
+
* serves no copy of it and sampling it could only fail (TR01433).
|
|
70
|
+
*/
|
|
71
|
+
function unstagedLegalResourceIds(pages, target) {
|
|
72
|
+
return new Set(target !== DEPLOY_TARGET_STAGING ? [] : (pages ?? [])
|
|
73
|
+
.filter(isUnpublishedApprovedLegalPage)
|
|
74
|
+
.map((page) => page.resourceId));
|
|
75
|
+
}
|
|
76
|
+
|
|
64
77
|
/** Saved manifest pages the check skips, bounded like the other report lists. */
|
|
65
|
-
function uncheckedRoutes(pages) {
|
|
78
|
+
function uncheckedRoutes(pages, target) {
|
|
66
79
|
// The home page is always probed, so it is never listed as unchecked.
|
|
67
|
-
const
|
|
80
|
+
const unstaged = unstagedLegalResourceIds(pages, target);
|
|
81
|
+
const entries = [
|
|
82
|
+
...unlinkedSavedPageEntries(pages).map(({ path }) => ({ path, reason: UNCHECKED_ROUTE_REASON })),
|
|
83
|
+
...linkedPageEntries(pages).filter((page) => unstaged.has(page.resourceId))
|
|
84
|
+
.map((page) => ({
|
|
85
|
+
path: sanitizeDiagnostic(page.path === "" ? "/" : `/${page.path}/`, "(unprintable path)"),
|
|
86
|
+
reason: UNSTAGED_LEGAL_ROUTE_REASON,
|
|
87
|
+
})),
|
|
88
|
+
].filter(({ path }) => path !== "/");
|
|
68
89
|
return {
|
|
69
|
-
items: entries.slice(0, UNCHECKED_ROUTE_LIMIT)
|
|
90
|
+
items: entries.slice(0, UNCHECKED_ROUTE_LIMIT),
|
|
70
91
|
total: entries.length,
|
|
71
92
|
truncated: entries.length > UNCHECKED_ROUTE_LIMIT,
|
|
72
|
-
basis: "workspace manifest status",
|
|
93
|
+
basis: "workspace manifest status and template",
|
|
73
94
|
};
|
|
74
95
|
}
|
|
75
96
|
|
|
@@ -156,8 +177,8 @@ export async function deliveryCheck(invocation) {
|
|
|
156
177
|
}
|
|
157
178
|
|
|
158
179
|
const resolved = await resolveTarget(client, siteId, target, invocation, onProgress, now);
|
|
159
|
-
const routes = routesToCheck(manifest?.pages ?? []);
|
|
160
|
-
const unchecked = uncheckedRoutes(manifest?.pages ?? []);
|
|
180
|
+
const routes = routesToCheck(manifest?.pages ?? [], target);
|
|
181
|
+
const unchecked = uncheckedRoutes(manifest?.pages ?? [], target);
|
|
161
182
|
if (unchecked.total > 0) {
|
|
162
183
|
onProgress(
|
|
163
184
|
`${unchecked.total} saved page(s) the workspace manifest records as not published or approved were left out of the authored-route sample because of their manifest status (a stale status may not match the deployed site; the check may still fetch one as a link from another page), so the verdict covers the sampled routes and the checks made from them; run pull after approving pages in the app, then check again.`,
|
package/src/verbs/footer-push.js
CHANGED
|
@@ -14,7 +14,8 @@ import {
|
|
|
14
14
|
readPresentationBaseline,
|
|
15
15
|
reportFooterPreview,
|
|
16
16
|
} from "../footer-workspace.js";
|
|
17
|
-
import { openSession, successResult, warnIfExternalWritesPaused } from "../session.js";
|
|
17
|
+
import { boundedByBytes, openSession, successResult, warnIfExternalWritesPaused } from "../session.js";
|
|
18
|
+
import { unservedFooterLinks } from "../chrome-input.js";
|
|
18
19
|
import { SETTINGS_TYPE_SITE_PUBLISHING_PREFERENCES } from "../settings-catalog.js";
|
|
19
20
|
import { ApiError } from "../transport.js";
|
|
20
21
|
import { readWorkspaceJson, WORKSPACE_LIMITS, writeWorkspaceJson } from "../workspace.js";
|
|
@@ -65,6 +66,28 @@ function translateConcurrency(error) {
|
|
|
65
66
|
return error;
|
|
66
67
|
}
|
|
67
68
|
|
|
69
|
+
const FOOTER_LINK_REASONS = Object.freeze({
|
|
70
|
+
page_not_approved: "the page is not approved, so no release carries it",
|
|
71
|
+
legal_page_not_published: "it is an approved legal page that was never published; deploy leaves legal pages out, so "
|
|
72
|
+
+ "stage and publish it from the app",
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
/** Footer page links the next release cannot render as links, reported rather than refused (TR01433). */
|
|
76
|
+
const FOOTER_LINK_WARNING_BYTES = 4 * 1024;
|
|
77
|
+
|
|
78
|
+
export function footerLinkWarnings(pages, footerSettings, onProgress, budget = FOOTER_LINK_WARNING_BYTES) {
|
|
79
|
+
const links = unservedFooterLinks(pages, footerSettings);
|
|
80
|
+
for (const link of links) {
|
|
81
|
+
onProgress(`Warning: the footer link '${link.label}'${link.path === null ? "" : ` to ${link.path}`} is unavailable `
|
|
82
|
+
+ "until its page is in the release (a column, utility or aside link is left out; an inline link keeps only its "
|
|
83
|
+
+ `words): ${FOOTER_LINK_REASONS[link.reason]}.`);
|
|
84
|
+
}
|
|
85
|
+
// Left out, as the progress text still names the links, when not even its summary fits.
|
|
86
|
+
if (links.length === 0 || budget < 512) return {};
|
|
87
|
+
const reported = boundedByBytes(links, Math.min(budget - 256, FOOTER_LINK_WARNING_BYTES));
|
|
88
|
+
return { footerLinkWarnings: { count: links.length, ...reported } };
|
|
89
|
+
}
|
|
90
|
+
|
|
68
91
|
export async function footerPush(invocation) {
|
|
69
92
|
const session = await openSession(invocation);
|
|
70
93
|
const { client, config, siteId, onProgress } = session;
|
|
@@ -84,12 +107,15 @@ export async function footerPush(invocation) {
|
|
|
84
107
|
);
|
|
85
108
|
onProgress("Validated the complete footer document, stable page targets, and site-owned image references locally.");
|
|
86
109
|
|
|
87
|
-
const footerChecks =
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
110
|
+
const footerChecks = {
|
|
111
|
+
...evaluateOfflineSiteChecks({
|
|
112
|
+
pagePaths: [],
|
|
113
|
+
footerOnly: true,
|
|
114
|
+
footerInput: await readFooterFitInput(config.workspaceDir, footerSettings),
|
|
115
|
+
onProgress,
|
|
116
|
+
}),
|
|
117
|
+
...footerLinkWarnings(context.manifest.pages, footerSettings, onProgress),
|
|
118
|
+
};
|
|
93
119
|
|
|
94
120
|
if (dryRun) {
|
|
95
121
|
const response = await withRefusalGuidance(onProgress, VERB_FOOTER_PUSH, () =>
|
|
@@ -10,7 +10,7 @@ import { VERB_PAGES_META_SET } from "../constants.js";
|
|
|
10
10
|
import { SiteAuthoringError } from "../errors.js";
|
|
11
11
|
import { descriptionWarnings, PAGE_AUTHOR_UNVERIFIED, requireDescriptionLength } from "../page-metadata.js";
|
|
12
12
|
import { openAnonymousSession, successResult } from "../session.js";
|
|
13
|
-
import { isGeneratedTemplateType, TEMPLATE_GENERATED, typedDocumentFromJson } from "../typed-pages.js";
|
|
13
|
+
import { isGeneratedTemplateType, isLegalTemplateType, TEMPLATE_GENERATED, typedDocumentFromJson } from "../typed-pages.js";
|
|
14
14
|
import {
|
|
15
15
|
displayPagePath,
|
|
16
16
|
normalizePagePath,
|
|
@@ -107,6 +107,15 @@ export async function pagesMetaSet(invocation) {
|
|
|
107
107
|
{ field: shown },
|
|
108
108
|
);
|
|
109
109
|
}
|
|
110
|
+
// Taproot stores and renders no description for a legal page, so one would be dropped without a word (TR01433).
|
|
111
|
+
if (description !== undefined && description !== "" && isLegalTemplateType(entry.templateType)) {
|
|
112
|
+
throw new SiteAuthoringError(
|
|
113
|
+
"pages.legal_description_unsupported",
|
|
114
|
+
`'${shown}' is a legal page, which carries no description: Taproot drops it on save and renders none, and `
|
|
115
|
+
+ "the description checks skip legal pages.",
|
|
116
|
+
{ field: "description", exitCode: 2 },
|
|
117
|
+
);
|
|
118
|
+
}
|
|
110
119
|
if (description !== undefined) requireDescriptionLength(description);
|
|
111
120
|
// A generated page's custom title and description are in its source, where
|
|
112
121
|
// pull already protects an edit like any other.
|