@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.
Files changed (78) hide show
  1. package/README.md +50 -0
  2. package/examples/riverbend-wellness/settings/site-publishing-preferences.json +3 -0
  3. package/examples/riverbend-wellness/settings/taproot-styles.json +11 -0
  4. package/package.json +4 -3
  5. package/src/api.js +170 -11
  6. package/src/appearance-contract.js +278 -8
  7. package/src/authored-tag-names.js +88 -0
  8. package/src/block-flow.js +103 -1
  9. package/src/brand-color.js +39 -4
  10. package/src/breadcrumb-artwork.js +234 -0
  11. package/src/breadcrumb-separators.js +11 -0
  12. package/src/changelog.json +154 -0
  13. package/src/chrome-features.js +152 -0
  14. package/src/chrome-input.js +147 -0
  15. package/src/chrome-output.js +92 -0
  16. package/src/chrome-paint-catalog-taproot.json +52 -0
  17. package/src/chrome-report.js +173 -0
  18. package/src/cli.js +48 -17
  19. package/src/content/components.js +27 -4
  20. package/src/content/external-link.js +2 -1
  21. package/src/content/markdown.js +271 -101
  22. package/src/content/tiptap-prosemirror.ts +125 -43
  23. package/src/content/validate-document.js +4 -1
  24. package/src/content-inset.js +48 -0
  25. package/src/errors.js +1 -0
  26. package/src/espalier-shared.js +26 -0
  27. package/src/field-suggestions.js +40 -0
  28. package/src/fixture-init.js +22 -5
  29. package/src/font-catalog.js +11 -1
  30. package/src/footer-brand-inputs.js +25 -2
  31. package/src/footer-content.js +38 -0
  32. package/src/footer-contract.js +11 -0
  33. package/src/footer-cta-styles.js +6 -0
  34. package/src/footer-draft-hash.js +4 -2
  35. package/src/footer-fit.js +62 -15
  36. package/src/footer-workspace.js +60 -16
  37. package/src/header-presentation.js +16 -0
  38. package/src/latest-posts-tags.js +57 -0
  39. package/src/page-structure-checks.js +5 -0
  40. package/src/page-tag-badge-modes.js +6 -0
  41. package/src/page-tag-writes.js +158 -0
  42. package/src/page-type-tags.js +16 -0
  43. package/src/presentation-reference.js +312 -86
  44. package/src/recipe-page-options.js +22 -0
  45. package/src/recipe-step-contract.js +164 -0
  46. package/src/recipe-step-contract.json +65 -0
  47. package/src/reference-help.js +164 -78
  48. package/src/session.js +39 -24
  49. package/src/setting-reference.js +239 -48
  50. package/src/settings-catalog.js +63 -0
  51. package/src/site-check-findings.js +25 -5
  52. package/src/site-check-rules.json +3 -1
  53. package/src/site-health-findings.js +13 -13
  54. package/src/site-navigation-groups.js +70 -0
  55. package/src/styling-fixed-values.js +71 -0
  56. package/src/tag-destination-warnings.js +35 -0
  57. package/src/template-token-reach.json +242 -0
  58. package/src/theme-proposals.js +18 -27
  59. package/src/theme-resolve.js +305 -51
  60. package/src/theme-validation.js +126 -6
  61. package/src/token-reach.js +222 -0
  62. package/src/typed-page-reference.js +72 -15
  63. package/src/typed-pages.js +171 -71
  64. package/src/verbs/deploy.js +6 -0
  65. package/src/verbs/footer-push.js +30 -5
  66. package/src/verbs/forms-push.js +11 -3
  67. package/src/verbs/pages-delete.js +19 -10
  68. package/src/verbs/pages-push.js +125 -36
  69. package/src/verbs/plan.js +10 -4
  70. package/src/verbs/pull.js +277 -67
  71. package/src/verbs/staging-review.js +27 -1
  72. package/src/verbs/status.js +22 -0
  73. package/src/verbs/theme-push.js +249 -120
  74. package/src/verbs/theme-resolve.js +310 -47
  75. package/src/verbs/validate.js +71 -17
  76. package/src/workspace-check.js +37 -4
  77. package/src/workspace.js +37 -1
  78. 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
- description: "How many posts to show, 1 to 12; a single post spans the full width.",
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 recent published pages, optionally filtered by page type.",
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
- ["Keep descriptions enabled when titles alone do not make each destination clear."],
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 NEW_TAB_CUE_TEXT = " (opens in a new tab)";
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.