@taprootio/site-authoring 0.41.1 → 0.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -0
- package/examples/riverbend-wellness/settings/site-publishing-preferences.json +3 -0
- package/examples/riverbend-wellness/settings/taproot-styles.json +11 -0
- package/package.json +4 -3
- package/src/api.js +170 -11
- package/src/appearance-contract.js +278 -8
- package/src/authored-tag-names.js +88 -0
- package/src/block-flow.js +103 -1
- package/src/brand-color.js +39 -4
- package/src/breadcrumb-artwork.js +234 -0
- package/src/breadcrumb-separators.js +11 -0
- package/src/changelog.json +154 -0
- package/src/chrome-features.js +152 -0
- package/src/chrome-input.js +147 -0
- package/src/chrome-output.js +92 -0
- package/src/chrome-paint-catalog-taproot.json +52 -0
- package/src/chrome-report.js +173 -0
- package/src/cli.js +48 -17
- package/src/content/components.js +27 -4
- package/src/content/external-link.js +2 -1
- package/src/content/markdown.js +271 -101
- package/src/content/tiptap-prosemirror.ts +125 -43
- package/src/content/validate-document.js +4 -1
- package/src/content-inset.js +48 -0
- package/src/errors.js +1 -0
- package/src/espalier-shared.js +26 -0
- package/src/field-suggestions.js +40 -0
- package/src/fixture-init.js +22 -5
- package/src/font-catalog.js +11 -1
- package/src/footer-brand-inputs.js +25 -2
- package/src/footer-content.js +38 -0
- package/src/footer-contract.js +11 -0
- package/src/footer-cta-styles.js +6 -0
- package/src/footer-draft-hash.js +4 -2
- package/src/footer-fit.js +62 -15
- package/src/footer-workspace.js +60 -16
- package/src/header-presentation.js +16 -0
- package/src/latest-posts-tags.js +57 -0
- package/src/page-structure-checks.js +5 -0
- package/src/page-tag-badge-modes.js +6 -0
- package/src/page-tag-writes.js +158 -0
- package/src/page-type-tags.js +16 -0
- package/src/presentation-reference.js +312 -86
- package/src/recipe-page-options.js +22 -0
- package/src/recipe-step-contract.js +164 -0
- package/src/recipe-step-contract.json +65 -0
- package/src/reference-help.js +164 -78
- package/src/session.js +39 -24
- package/src/setting-reference.js +239 -48
- package/src/settings-catalog.js +63 -0
- package/src/site-check-findings.js +25 -5
- package/src/site-check-rules.json +3 -1
- package/src/site-health-findings.js +13 -13
- package/src/site-navigation-groups.js +70 -0
- package/src/styling-fixed-values.js +71 -0
- package/src/tag-destination-warnings.js +35 -0
- package/src/template-token-reach.json +242 -0
- package/src/theme-proposals.js +18 -27
- package/src/theme-resolve.js +305 -51
- package/src/theme-validation.js +126 -6
- package/src/token-reach.js +222 -0
- package/src/typed-page-reference.js +72 -15
- package/src/typed-pages.js +171 -71
- package/src/verbs/deploy.js +6 -0
- package/src/verbs/footer-push.js +30 -5
- package/src/verbs/forms-push.js +11 -3
- package/src/verbs/pages-delete.js +19 -10
- package/src/verbs/pages-push.js +125 -36
- package/src/verbs/plan.js +10 -4
- package/src/verbs/pull.js +277 -67
- package/src/verbs/staging-review.js +27 -1
- package/src/verbs/status.js +22 -0
- package/src/verbs/theme-push.js +249 -120
- package/src/verbs/theme-resolve.js +310 -47
- package/src/verbs/validate.js +71 -17
- package/src/workspace-check.js +37 -4
- package/src/workspace.js +37 -1
- package/test/fixtures/default-site-theme.json +516 -0
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { BUILT_IN_IMAGE_TEXTURES } from "@taprootio/espalier/shared/image-texture-registry";
|
|
7
7
|
import registry from "./free-form-section-registry.json" with { type: "json" };
|
|
8
8
|
import { hasAsciiControl } from "../errors.js";
|
|
9
|
+
import { validateAuthoredTagNames } from "../authored-tag-names.js";
|
|
9
10
|
import { isSocialLinkUrl, SOCIAL_LINK_URL_MAX_LENGTH, trimSocialLinkInput } from "../social-link-url.js";
|
|
10
11
|
import socialPlatforms from "../social-platforms.json" with { type: "json" };
|
|
11
12
|
import { IMAGE_DESCRIPTION_MODES } from "./image-description-validation.js";
|
|
@@ -271,10 +272,13 @@ const LATEST_POSTS = Object.freeze({
|
|
|
271
272
|
integer: true,
|
|
272
273
|
minimum: 1,
|
|
273
274
|
maximum: 12,
|
|
274
|
-
|
|
275
|
+
alternate: "all",
|
|
276
|
+
description: 'Show 1 to 12 posts, or "all" for every match. A count of 1 spans the full width.',
|
|
275
277
|
}),
|
|
276
278
|
columns: num({ values: Object.freeze([1, 2, 3, 4]) }),
|
|
277
279
|
pageTypes: list(enumOf(...LATEST_POST_PAGE_TYPES)),
|
|
280
|
+
tags: list(str({ nonWhitespace: true }), { tagNames: true }),
|
|
281
|
+
tagMatch: enumOf("any", "all"),
|
|
278
282
|
showPinned: bool(),
|
|
279
283
|
highlightFirst: bool(),
|
|
280
284
|
showDescription: bool(),
|
|
@@ -768,7 +772,7 @@ const COMPONENT_DEFINITIONS = Object.freeze({
|
|
|
768
772
|
"latest-posts": component(
|
|
769
773
|
LATEST_POSTS,
|
|
770
774
|
"Latest Posts",
|
|
771
|
-
"Generation-time list of
|
|
775
|
+
"Generation-time list of published pages, optionally filtered by page type and authored tags.",
|
|
772
776
|
{
|
|
773
777
|
count: 6,
|
|
774
778
|
columns: 3,
|
|
@@ -781,7 +785,13 @@ const COMPONENT_DEFINITIONS = Object.freeze({
|
|
|
781
785
|
borderWidth: 1,
|
|
782
786
|
bannerScheme: "auto",
|
|
783
787
|
},
|
|
784
|
-
[
|
|
788
|
+
[
|
|
789
|
+
"Use tags with tagMatch any (the default) or all. Names are case-insensitive. Omit tags or pass [] for no tag filter.",
|
|
790
|
+
"Assign the tags to pages first or in the same pages push. Validate warns about names absent from the pulled catalog. Pages push refuses them before sending pages, and deploy checks against the current site catalog.",
|
|
791
|
+
"The listing skips its own page. Tagged lists exclude member-only pages. Pinned matches come first by default, then newest by displayed date.",
|
|
792
|
+
"The count defaults to 6. Set count to the string all for every match, with no listing cap or pagination. Thumbnails load lazily.",
|
|
793
|
+
"No matches render no grid. Taproot does not generate tag pages. Create a free-form page and place the listing in its body.",
|
|
794
|
+
],
|
|
785
795
|
{
|
|
786
796
|
count: 6,
|
|
787
797
|
columns: 3,
|
|
@@ -1162,6 +1172,10 @@ function referenceSchema(spec) {
|
|
|
1162
1172
|
};
|
|
1163
1173
|
case "number": {
|
|
1164
1174
|
const schema = { type: spec.integer ? "integer" : "number" };
|
|
1175
|
+
if (spec.alternate !== undefined) {
|
|
1176
|
+
const { alternate, description, ...numeric } = spec;
|
|
1177
|
+
return { anyOf: [referenceSchema(numeric), { type: "string", enum: [alternate] }], description };
|
|
1178
|
+
}
|
|
1165
1179
|
if (spec.values) schema.enum = [...spec.values];
|
|
1166
1180
|
if (spec.minimum !== undefined) schema.minimum = spec.minimum;
|
|
1167
1181
|
if (spec.maximum !== undefined) schema.maximum = spec.maximum;
|
|
@@ -1330,8 +1344,9 @@ function validateValue(spec, value, path, errors) {
|
|
|
1330
1344
|
if (typeof value !== "string" || !spec.values.includes(value)) fail(describe(spec));
|
|
1331
1345
|
return;
|
|
1332
1346
|
case "number": {
|
|
1347
|
+
if (spec.alternate !== undefined && value === spec.alternate) return;
|
|
1333
1348
|
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
1334
|
-
fail(describe(spec));
|
|
1349
|
+
fail(spec.alternate === undefined ? describe(spec) : `${describe(spec)} or "${spec.alternate}"`);
|
|
1335
1350
|
return;
|
|
1336
1351
|
}
|
|
1337
1352
|
if (spec.values && !spec.values.includes(value)) {
|
|
@@ -1350,6 +1365,14 @@ function validateValue(spec, value, path, errors) {
|
|
|
1350
1365
|
return;
|
|
1351
1366
|
}
|
|
1352
1367
|
case "array": {
|
|
1368
|
+
if (spec.tagNames) {
|
|
1369
|
+
const result = validateAuthoredTagNames(value);
|
|
1370
|
+
if ("field" in result) {
|
|
1371
|
+
const match = /^tags\[(\d+)\]$/u.exec(result.field);
|
|
1372
|
+
errors.push(contentError(match ? `${path}/${match[1]}` : path, CODES.componentData, result.reason));
|
|
1373
|
+
}
|
|
1374
|
+
return;
|
|
1375
|
+
}
|
|
1353
1376
|
if (!Array.isArray(value)) {
|
|
1354
1377
|
fail("an array");
|
|
1355
1378
|
return;
|
|
@@ -61,7 +61,8 @@ export function newTabAttributeMarkup(rel) {
|
|
|
61
61
|
* `esp-button` read alike. `generator/browser-tests/new-tab-cue.spec.ts` holds
|
|
62
62
|
* the two together.
|
|
63
63
|
*/
|
|
64
|
-
export const
|
|
64
|
+
export const NEW_TAB_LABEL = "opens in a new tab";
|
|
65
|
+
export const NEW_TAB_CUE_TEXT = ` (${NEW_TAB_LABEL})`;
|
|
65
66
|
/**
|
|
66
67
|
* The cue for a native anchor, as its last child. Pagefind indexes raw HTML, so
|
|
67
68
|
* `data-pagefind-ignore` keeps the words out of search content and excerpts.
|