@taprootio/site-authoring 0.42.0 → 0.56.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 (80) hide show
  1. package/README.md +110 -12
  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 +242 -23
  6. package/src/appearance-contract.js +264 -3
  7. package/src/authored-tag-names.js +88 -0
  8. package/src/authors-contract.js +71 -3
  9. package/src/block-flow.js +103 -1
  10. package/src/brand-color.js +22 -0
  11. package/src/breadcrumb-artwork.js +234 -0
  12. package/src/breadcrumb-separators.js +11 -0
  13. package/src/changelog.json +160 -0
  14. package/src/chrome-features.js +6 -2
  15. package/src/chrome-input.js +1 -0
  16. package/src/chrome-paint-catalog-taproot.json +3 -3
  17. package/src/chrome-report.js +91 -12
  18. package/src/cli.js +136 -38
  19. package/src/constants.js +1 -0
  20. package/src/content/components.js +27 -4
  21. package/src/content/external-link.js +2 -1
  22. package/src/content/markdown.js +271 -101
  23. package/src/content/tiptap-prosemirror.ts +125 -43
  24. package/src/content/validate-document.js +4 -1
  25. package/src/content-inset.js +48 -0
  26. package/src/errors.js +1 -0
  27. package/src/espalier-shared.js +26 -0
  28. package/src/field-suggestions.js +40 -0
  29. package/src/fixture-init.js +22 -5
  30. package/src/font-catalog.js +11 -1
  31. package/src/footer-brand-inputs.js +22 -3
  32. package/src/footer-content.js +1 -0
  33. package/src/footer-contract.js +11 -0
  34. package/src/footer-cta-styles.js +6 -0
  35. package/src/footer-draft-hash.js +4 -2
  36. package/src/footer-fit.js +62 -15
  37. package/src/footer-workspace.js +44 -7
  38. package/src/latest-posts-tags.js +57 -0
  39. package/src/page-metadata.js +15 -13
  40. package/src/page-structure-checks.js +5 -0
  41. package/src/page-tag-badge-modes.js +6 -0
  42. package/src/page-tag-writes.js +158 -0
  43. package/src/page-type-tags.js +16 -0
  44. package/src/presentation-reference.js +297 -86
  45. package/src/recipe-page-options.js +22 -0
  46. package/src/recipe-step-contract.js +164 -0
  47. package/src/recipe-step-contract.json +65 -0
  48. package/src/reference-help.js +182 -79
  49. package/src/session.js +39 -24
  50. package/src/setting-reference.js +239 -48
  51. package/src/settings-catalog.js +63 -0
  52. package/src/site-check-findings.js +23 -5
  53. package/src/site-check-rules.json +1 -0
  54. package/src/site-health-findings.js +13 -13
  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 +265 -23
  60. package/src/theme-validation.js +118 -7
  61. package/src/token-reach.js +222 -0
  62. package/src/typed-page-reference.js +94 -16
  63. package/src/typed-pages.js +233 -74
  64. package/src/verbs/authors.js +198 -33
  65. package/src/verbs/deploy.js +6 -0
  66. package/src/verbs/footer-push.js +30 -5
  67. package/src/verbs/forms-push.js +11 -3
  68. package/src/verbs/index.js +4 -2
  69. package/src/verbs/pages-delete.js +19 -10
  70. package/src/verbs/pages-push.js +225 -71
  71. package/src/verbs/plan.js +10 -4
  72. package/src/verbs/pull.js +324 -69
  73. package/src/verbs/staging-review.js +27 -1
  74. package/src/verbs/status.js +22 -0
  75. package/src/verbs/theme-push.js +93 -25
  76. package/src/verbs/theme-resolve.js +189 -55
  77. package/src/verbs/validate.js +6 -5
  78. package/src/workspace-check.js +35 -3
  79. package/src/workspace.js +73 -2
  80. package/test/fixtures/default-site-theme.json +516 -0
package/src/verbs/plan.js CHANGED
@@ -30,6 +30,8 @@ import { SiteAuthoringError } from "../errors.js";
30
30
  import { computeFooterContentHash, computeFooterDraftHash, stableJson } from "../footer-draft-hash.js";
31
31
  import { FOOTER_SETTINGS_FILE } from "../footer-workspace.js";
32
32
  import { workspaceFormKeys } from "../forms-workspace.js";
33
+ import { preflightPageTagWrites } from "../page-tag-writes.js";
34
+ import { latestPostsTagProblems } from "../latest-posts-tags.js";
33
35
  import { CHECK_AREA, collectProblems, problemsError, problemsOf, problemsWithinBudget, withinByteBudget } from "../problems.js";
34
36
  import { openSession, successResult, warnIfExternalWritesPaused } from "../session.js";
35
37
  import { IMAGE_IDENTIFIER, usedImageIds } from "../typed-pages.js";
@@ -54,6 +56,7 @@ import {
54
56
  placedVideoProblems,
55
57
  planPages,
56
58
  plannedPageItem,
59
+ plannedPageWriteIdentity,
57
60
  staleGeneratedSourcesField,
58
61
  } from "./pages-push.js";
59
62
  import { comparePresentation, presentationMovedRefusal, presentationPullRequired, themePush } from "./theme-push.js";
@@ -289,7 +292,8 @@ async function preflight(session, invocation) {
289
292
  : sharedThemeContextNames(offline.presentation.style.lightTheme, offline.presentation.style.darkTheme),
290
293
  onProgress,
291
294
  });
292
- problems.push(...pages.problems);
295
+ const pageTagCapabilities = await preflightPageTagWrites(client, siteId, pages);
296
+ problems.push(...pages.problems, ...latestPostsTagProblems(pages.planned, manifest, { sendingOnly: true }));
293
297
  problems.push(...await placedVideoProblems(client, siteId, pages.planned));
294
298
  problems.push(...(await placedFormProblems(client, siteId, pages.planned, () => workspaceFormKeys(workspaceDir))).problems);
295
299
  const sending = pages.planned.filter((page) => !page.unchanged);
@@ -430,7 +434,7 @@ async function preflight(session, invocation) {
430
434
  version: 1,
431
435
  siteId,
432
436
  media: pendingMedia.map((entry) => [entry.file, entry.identity]),
433
- pages: pages.planned.map((page) => [page.file, page.action, page.unchanged, page.contentKey, page.pageId ?? "", page.revision ?? ""]),
437
+ pages: pages.planned.map((page) => [page.file, page.unchanged, page.contentKey, plannedPageWriteIdentity(page)]),
434
438
  footer: [footerChanged, workspaceFooter === undefined ? "" : computeFooterContentHash(workspaceFooter), liveFooterDraftHash ?? ""],
435
439
  theme: theme === undefined ? [] : [theme.changeSetHash, theme.current.revision],
436
440
  navigation: [stableJson(offline.navigation?.navItems ?? null), stableJson(liveNavigation ?? null)],
@@ -443,7 +447,8 @@ async function preflight(session, invocation) {
443
447
  planHash,
444
448
  // The live state each step must still find: page revisions and the navigation tree, which the steps check
445
449
  // themselves (the theme and footer saves are fenced by the server, and the navigation save is as well).
446
- plannedPages: new Map(sending.map((page) => [page.file, stableJson([page.pageId ?? "", page.revision ?? "", page.action])])),
450
+ plannedPages: new Map(sending.map((page) => [page.file, stableJson(plannedPageWriteIdentity(page))])),
451
+ pageTagCapabilities,
447
452
  plannedLiveNavigation: stableJson(liveNavigation ?? null),
448
453
  };
449
454
  });
@@ -522,6 +527,7 @@ const STEP_RUNNERS = Object.freeze({
522
527
  pagePaths: undefined,
523
528
  dryRun: false,
524
529
  plannedPages: planned.plannedPages,
530
+ pageTagCapabilities: planned.pageTagCapabilities,
525
531
  }),
526
532
  [PLAN_STEP.footer]: (invocation) => footerPush({ ...invocation, verb: PLAN_STEP.footer }),
527
533
  [PLAN_STEP.theme]: (invocation) => themePush({ ...invocation, verb: PLAN_STEP.theme, dryRun: false }),
@@ -548,7 +554,7 @@ export async function apply(invocation) {
548
554
  "The workspace or the site changed since that plan was made, so nothing was applied. Run 'taproot-site plan' "
549
555
  + "again, read it, and apply the new planHash.",
550
556
  { field: "planHash", alternatives: [planned.planHash] },
551
- );
557
+ ).withProblems(planned.problems);
552
558
  }
553
559
  if (planned.problems.length > 0) throw problemsError(planned.problems, "apply sent nothing; the plan has problems");
554
560