bsmnt 0.12.0 → 0.13.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 (174) hide show
  1. package/dist/application/add-integration/index.d.ts.map +1 -1
  2. package/dist/application/add-integration/index.js +23 -0
  3. package/dist/application/add-integration/index.js.map +1 -1
  4. package/dist/domain/consent.d.ts +17 -0
  5. package/dist/domain/consent.d.ts.map +1 -0
  6. package/dist/domain/consent.js +13 -0
  7. package/dist/domain/consent.js.map +1 -0
  8. package/dist/domain/integration.d.ts +19 -2
  9. package/dist/domain/integration.d.ts.map +1 -1
  10. package/dist/domain/integration.js +10 -1
  11. package/dist/domain/integration.js.map +1 -1
  12. package/dist/domain/jobs.d.ts +17 -0
  13. package/dist/domain/jobs.d.ts.map +1 -0
  14. package/dist/domain/jobs.js +13 -0
  15. package/dist/domain/jobs.js.map +1 -0
  16. package/dist/domain/skills.d.ts +23 -2
  17. package/dist/domain/skills.d.ts.map +1 -1
  18. package/dist/domain/skills.js +23 -2
  19. package/dist/domain/skills.js.map +1 -1
  20. package/dist/domain/templates.d.ts +7 -1
  21. package/dist/domain/templates.d.ts.map +1 -1
  22. package/dist/domain/templates.js +2 -0
  23. package/dist/domain/templates.js.map +1 -1
  24. package/dist/index.js +34 -9
  25. package/dist/index.js.map +1 -1
  26. package/dist/infrastructure/create/setup-agent.d.ts.map +1 -1
  27. package/dist/infrastructure/create/setup-agent.js +11 -4
  28. package/dist/infrastructure/create/setup-agent.js.map +1 -1
  29. package/dist/infrastructure/integrations/inject-integration.d.ts.map +1 -1
  30. package/dist/infrastructure/integrations/inject-integration.js +36 -2
  31. package/dist/infrastructure/integrations/inject-integration.js.map +1 -1
  32. package/dist/modules/features/consent/ketch/config.d.ts +18 -0
  33. package/dist/modules/features/consent/ketch/config.d.ts.map +1 -0
  34. package/dist/modules/features/consent/ketch/config.js +24 -0
  35. package/dist/modules/features/consent/ketch/config.js.map +1 -0
  36. package/dist/modules/features/consent/ketch/mergers/biome.d.ts +16 -0
  37. package/dist/modules/features/consent/ketch/mergers/biome.d.ts.map +1 -0
  38. package/dist/modules/features/consent/ketch/mergers/biome.js +31 -0
  39. package/dist/modules/features/consent/ketch/mergers/biome.js.map +1 -0
  40. package/dist/modules/features/consent/ketch/mergers/check-integration.d.ts +13 -0
  41. package/dist/modules/features/consent/ketch/mergers/check-integration.d.ts.map +1 -0
  42. package/dist/modules/features/consent/ketch/mergers/check-integration.js +64 -0
  43. package/dist/modules/features/consent/ketch/mergers/check-integration.js.map +1 -0
  44. package/dist/modules/features/consent/ketch/mergers/env-example.d.ts +12 -0
  45. package/dist/modules/features/consent/ketch/mergers/env-example.d.ts.map +1 -0
  46. package/dist/modules/features/consent/ketch/mergers/env-example.js +28 -0
  47. package/dist/modules/features/consent/ketch/mergers/env-example.js.map +1 -0
  48. package/dist/modules/features/consent/ketch/mergers/footer.d.ts +17 -0
  49. package/dist/modules/features/consent/ketch/mergers/footer.d.ts.map +1 -0
  50. package/dist/modules/features/consent/ketch/mergers/footer.js +40 -0
  51. package/dist/modules/features/consent/ketch/mergers/footer.js.map +1 -0
  52. package/dist/modules/features/consent/ketch/mergers/knip.d.ts +18 -0
  53. package/dist/modules/features/consent/ketch/mergers/knip.d.ts.map +1 -0
  54. package/dist/modules/features/consent/ketch/mergers/knip.js +37 -0
  55. package/dist/modules/features/consent/ketch/mergers/knip.js.map +1 -0
  56. package/dist/modules/features/consent/ketch/mergers/layout.d.ts +25 -0
  57. package/dist/modules/features/consent/ketch/mergers/layout.d.ts.map +1 -0
  58. package/dist/modules/features/consent/ketch/mergers/layout.js +55 -0
  59. package/dist/modules/features/consent/ketch/mergers/layout.js.map +1 -0
  60. package/dist/modules/features/jobs/ashby/config.d.ts +19 -0
  61. package/dist/modules/features/jobs/ashby/config.d.ts.map +1 -0
  62. package/dist/modules/features/jobs/ashby/config.js +29 -0
  63. package/dist/modules/features/jobs/ashby/config.js.map +1 -0
  64. package/dist/modules/features/jobs/ashby/mergers/check-integration.d.ts +14 -0
  65. package/dist/modules/features/jobs/ashby/mergers/check-integration.d.ts.map +1 -0
  66. package/dist/modules/features/jobs/ashby/mergers/check-integration.js +78 -0
  67. package/dist/modules/features/jobs/ashby/mergers/check-integration.js.map +1 -0
  68. package/dist/modules/features/jobs/ashby/mergers/env-example.d.ts +12 -0
  69. package/dist/modules/features/jobs/ashby/mergers/env-example.d.ts.map +1 -0
  70. package/dist/modules/features/jobs/ashby/mergers/env-example.js +27 -0
  71. package/dist/modules/features/jobs/ashby/mergers/env-example.js.map +1 -0
  72. package/dist/modules/features/jobs/ashby/mergers/knip.d.ts +18 -0
  73. package/dist/modules/features/jobs/ashby/mergers/knip.d.ts.map +1 -0
  74. package/dist/modules/features/jobs/ashby/mergers/knip.js +41 -0
  75. package/dist/modules/features/jobs/ashby/mergers/knip.js.map +1 -0
  76. package/dist/paths.d.ts +12 -0
  77. package/dist/paths.d.ts.map +1 -1
  78. package/dist/paths.js +12 -0
  79. package/dist/paths.js.map +1 -1
  80. package/package.json +3 -1
  81. package/src/agent-skills/ashby-pagebuilder-block/SKILL.md +277 -0
  82. package/src/agent-skills/hubspot-pagebuilder-block/SKILL.md +58 -25
  83. package/src/agent-skills/ketch-consent-check/SKILL.md +197 -0
  84. package/src/agent-skills/ketch-consent-setup/SKILL.md +326 -0
  85. package/src/agent-skills/ketch-consent-setup/references/ui-customization.md +329 -0
  86. package/src/agent-skills/page-builder-block/SKILL.md +150 -0
  87. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/anchor-id-input.tsx +17 -0
  88. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/presentation-input.tsx +146 -0
  89. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/spacing-steps-input.tsx +84 -0
  90. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/fetchers/layout.ts +6 -3
  91. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/icons.ts +8 -0
  92. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/queries.ts +12 -0
  93. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/reusable/blog-content.ts +3 -3
  94. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/reusable/description.ts +3 -3
  95. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/reusable/gated-content.ts +3 -3
  96. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/reusable/hero.ts +3 -3
  97. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/reusable/rich-text-block.ts +3 -3
  98. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/singleton/content-collection.ts +3 -3
  99. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/index.ts +8 -0
  100. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/layout/spacing-settings.ts +120 -0
  101. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/anchor.ts +75 -0
  102. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/block.ts +46 -0
  103. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/presentation.ts +44 -0
  104. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/spacing.ts +164 -0
  105. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/singletons.ts +7 -0
  106. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/anchor-id-input.tsx +17 -0
  107. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/presentation-input.tsx +146 -0
  108. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/spacing-steps-input.tsx +84 -0
  109. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/fetchers/layout.ts +4 -2
  110. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/icons.ts +8 -0
  111. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/queries.ts +12 -0
  112. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/reusable/blog-content.ts +3 -3
  113. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/reusable/description.ts +3 -3
  114. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/reusable/gated-content.ts +3 -3
  115. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/reusable/hero.ts +3 -3
  116. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/reusable/rich-text-block.ts +3 -3
  117. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/singleton/content-collection.ts +3 -3
  118. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/index.ts +8 -0
  119. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/layout/spacing-settings.ts +120 -0
  120. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/anchor.ts +75 -0
  121. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/block.ts +46 -0
  122. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/presentation.ts +44 -0
  123. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/spacing.ts +164 -0
  124. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/singletons.ts +7 -0
  125. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/tags.ts +2 -0
  126. package/src/modules/features/consent/ketch/files/lib/integrations/check-integration.ts +25 -0
  127. package/src/modules/features/consent/ketch/files/lib/integrations/ketch/README.md +70 -0
  128. package/src/modules/features/consent/ketch/files/lib/integrations/ketch/categories.ts +20 -0
  129. package/src/modules/features/consent/ketch/files/lib/integrations/ketch/consent-store.ts +107 -0
  130. package/src/modules/features/consent/ketch/files/lib/integrations/ketch/env.ts +20 -0
  131. package/src/modules/features/consent/ketch/files/lib/integrations/ketch/ketch-experience.css +136 -0
  132. package/src/modules/features/consent/ketch/files/lib/integrations/ketch/preferences-button.tsx +51 -0
  133. package/src/modules/features/consent/ketch/files/lib/integrations/ketch/script.tsx +8 -0
  134. package/src/modules/features/consent/ketch/files/lib/integrations/ketch/types.ts +15 -0
  135. package/src/modules/features/consent/ketch/files/lib/integrations/ketch/use-consent.ts +26 -0
  136. package/src/modules/features/jobs/ashby/files/_sanity-adapter/job-board-block.ts +53 -0
  137. package/src/modules/features/jobs/ashby/files/lib/integrations/ashby/README.md +134 -0
  138. package/src/modules/features/jobs/ashby/files/lib/integrations/ashby/env.ts +3 -0
  139. package/src/modules/features/jobs/ashby/files/lib/integrations/ashby/index.ts +40 -0
  140. package/src/modules/features/jobs/ashby/files/lib/integrations/ashby/normalize.ts +124 -0
  141. package/src/modules/features/jobs/ashby/files/lib/integrations/ashby/types.ts +20 -0
  142. package/src/modules/features/jobs/ashby/files/lib/integrations/check-integration.ts +25 -0
  143. package/src/templates/next-pagebuilder/AGENTS.md +129 -0
  144. package/src/templates/next-pagebuilder/CLAUDE.md +3 -0
  145. package/src/templates/next-pagebuilder/README.md +70 -0
  146. package/src/templates/next-pagebuilder/app/(content)/layout.tsx +2 -0
  147. package/src/templates/next-pagebuilder/components/layout/spacing-scale/index.tsx +18 -0
  148. package/src/templates/next-pagebuilder/components/page-builder/components/article-content/index.tsx +1 -1
  149. package/src/templates/next-pagebuilder/components/page-builder/components/content-collection/index.tsx +2 -2
  150. package/src/templates/next-pagebuilder/components/page-builder/components/description.tsx +3 -7
  151. package/src/templates/next-pagebuilder/components/page-builder/components/gated-content/index.tsx +2 -2
  152. package/src/templates/next-pagebuilder/components/page-builder/components/hero.tsx +3 -7
  153. package/src/templates/next-pagebuilder/components/page-builder/components/rich-text-block.tsx +3 -5
  154. package/src/templates/next-pagebuilder/components/page-builder/registry.tsx +70 -0
  155. package/src/templates/next-pagebuilder/components/page-builder/renderer.tsx +33 -49
  156. package/src/templates/next-pagebuilder/components/page-builder/section.tsx +35 -0
  157. package/src/templates/next-pagebuilder/components/page-document/index.tsx +1 -1
  158. package/src/templates/next-pagebuilder/lib/integrations/sanity/sanity.types.ts +92 -4
  159. package/src/templates/next-pagebuilder-cache/AGENTS.md +136 -0
  160. package/src/templates/next-pagebuilder-cache/CLAUDE.md +3 -0
  161. package/src/templates/next-pagebuilder-cache/README.md +75 -0
  162. package/src/templates/next-pagebuilder-cache/app/(content)/layout.tsx +2 -0
  163. package/src/templates/next-pagebuilder-cache/components/layout/spacing-scale/index.tsx +46 -0
  164. package/src/templates/next-pagebuilder-cache/components/page-builder/components/article-content/index.tsx +1 -1
  165. package/src/templates/next-pagebuilder-cache/components/page-builder/components/content-collection/index.tsx +2 -2
  166. package/src/templates/next-pagebuilder-cache/components/page-builder/components/description.tsx +3 -7
  167. package/src/templates/next-pagebuilder-cache/components/page-builder/components/gated-content/index.tsx +2 -2
  168. package/src/templates/next-pagebuilder-cache/components/page-builder/components/hero.tsx +3 -7
  169. package/src/templates/next-pagebuilder-cache/components/page-builder/components/rich-text-block.tsx +3 -5
  170. package/src/templates/next-pagebuilder-cache/components/page-builder/registry.tsx +70 -0
  171. package/src/templates/next-pagebuilder-cache/components/page-builder/renderer.tsx +33 -49
  172. package/src/templates/next-pagebuilder-cache/components/page-builder/section.tsx +35 -0
  173. package/src/templates/next-pagebuilder-cache/components/page-document/index.tsx +1 -1
  174. package/src/templates/next-pagebuilder-cache/lib/integrations/sanity/sanity.types.ts +92 -4
@@ -5,13 +5,9 @@ type DescriptionProps = {
5
5
  }
6
6
 
7
7
  export function Description({ block }: DescriptionProps) {
8
- if (!block.description) return null
9
-
10
8
  return (
11
- <section className="py-4">
12
- <p className="max-w-[62ch] text-base/7 text-current/72 md:text-lg/8">
13
- {block.description}
14
- </p>
15
- </section>
9
+ <p className="max-w-[62ch] text-base/7 text-current/72 md:text-lg/8">
10
+ {block.description}
11
+ </p>
16
12
  )
17
13
  }
@@ -64,7 +64,7 @@ export function GatedContent({ block }: GatedContentProps) {
64
64
  }
65
65
 
66
66
  return (
67
- <section className="py-8 md:py-12">
67
+ <div>
68
68
  {block.teaserHeading ? (
69
69
  <h2 className="mb-4 font-semibold text-2xl tracking-tight md:text-4xl">
70
70
  {block.teaserHeading}
@@ -114,7 +114,7 @@ export function GatedContent({ block }: GatedContentProps) {
114
114
  </button>
115
115
  </form>
116
116
  )}
117
- </section>
117
+ </div>
118
118
  )
119
119
  }
120
120
 
@@ -5,13 +5,9 @@ type HeroProps = {
5
5
  }
6
6
 
7
7
  export function Hero({ block }: HeroProps) {
8
- if (!block.headline) return null
9
-
10
8
  return (
11
- <section className="py-8 md:py-12">
12
- <h1 className="max-w-4xl font-semibold text-4xl tracking-tight md:text-6xl">
13
- {block.headline}
14
- </h1>
15
- </section>
9
+ <h1 className="max-w-4xl font-semibold text-4xl tracking-tight md:text-6xl">
10
+ {block.headline}
11
+ </h1>
16
12
  )
17
13
  }
@@ -1,16 +1,14 @@
1
- import { RichText } from "@/components/sanity/rich-text"
2
1
  import type { PageBuilderBlock } from "@/components/page-builder/types"
2
+ import { RichText } from "@/components/sanity/rich-text"
3
3
 
4
4
  type RichTextBlockProps = {
5
5
  block: Extract<PageBuilderBlock, { _type: "richTextBlock" }>
6
6
  }
7
7
 
8
8
  export function RichTextBlock({ block }: RichTextBlockProps) {
9
- if (!block.content) return null
10
-
11
9
  return (
12
- <section className="prose max-w-none">
10
+ <div className="prose max-w-none">
13
11
  <RichText content={block.content} />
14
- </section>
12
+ </div>
15
13
  )
16
14
  }
@@ -0,0 +1,70 @@
1
+ import type { ReactNode } from "react"
2
+ import type { PageBuilderDocumentType } from "@/lib/integrations/sanity/page-builder-config"
3
+ import { ArticleContent } from "./components/article-content"
4
+ import { ContentCollection } from "./components/content-collection"
5
+ import type {
6
+ ContentCollectionSearchParams,
7
+ PinnedCollectionCategory,
8
+ } from "./components/content-collection/types"
9
+ import { Description } from "./components/description"
10
+ import { GatedContent } from "./components/gated-content"
11
+ import { Hero } from "./components/hero"
12
+ import { RichTextBlock } from "./components/rich-text-block"
13
+ import type { PageBuilderBlock } from "./types"
14
+
15
+ export type BlockContext = {
16
+ searchParams: ContentCollectionSearchParams
17
+ pinnedCategory: PinnedCollectionCategory
18
+ }
19
+
20
+ type BlockOf<T extends PageBuilderDocumentType> = Extract<
21
+ PageBuilderBlock,
22
+ { _type: T }
23
+ >
24
+
25
+ type BlockEntry<T extends PageBuilderDocumentType> = {
26
+ render: (block: BlockOf<T>, context: BlockContext) => ReactNode
27
+ /** Skips the block *and* its `<Section>`, so no padded gap is left behind. */
28
+ isEmpty?: (block: BlockOf<T>) => boolean
29
+ }
30
+
31
+ const blockRegistry: {
32
+ [T in PageBuilderDocumentType]: BlockEntry<T>
33
+ } = {
34
+ blogCollection: {
35
+ render: (block, { searchParams, pinnedCategory }) => (
36
+ <ContentCollection
37
+ block={block}
38
+ pinnedCategory={pinnedCategory}
39
+ searchParams={searchParams}
40
+ />
41
+ ),
42
+ },
43
+ blogContent: {
44
+ render: (block) => <ArticleContent block={block} />,
45
+ },
46
+ description: {
47
+ render: (block) => <Description block={block} />,
48
+ isEmpty: (block) => !block.description,
49
+ },
50
+ gatedContent: {
51
+ render: (block) => <GatedContent block={block} />,
52
+ },
53
+ hero: {
54
+ render: (block) => <Hero block={block} />,
55
+ isEmpty: (block) => !block.headline,
56
+ },
57
+ richTextBlock: {
58
+ render: (block) => <RichTextBlock block={block} />,
59
+ isEmpty: (block) => !block.content?.length,
60
+ },
61
+ }
62
+
63
+ /**
64
+ * Indexing the registry with the union collapses its per-key signatures into an
65
+ * intersection nothing satisfies, so the widening happens once, here.
66
+ */
67
+ export const getBlockEntry = (
68
+ type: PageBuilderDocumentType
69
+ ): BlockEntry<PageBuilderDocumentType> | undefined =>
70
+ blockRegistry[type] as BlockEntry<PageBuilderDocumentType> | undefined
@@ -1,13 +1,13 @@
1
- import { ArticleContent } from "./components/article-content"
2
- import { ContentCollection } from "./components/content-collection"
1
+ import {
2
+ reserveAnchorIds,
3
+ resolveAnchorId,
4
+ } from "@/lib/integrations/sanity/schemas/shared/anchor"
3
5
  import type {
4
6
  ContentCollectionSearchParams,
5
7
  PinnedCollectionCategory,
6
8
  } from "./components/content-collection/types"
7
- import { Description } from "./components/description"
8
- import { GatedContent } from "./components/gated-content"
9
- import { Hero } from "./components/hero"
10
- import { RichTextBlock } from "./components/rich-text-block"
9
+ import { type BlockContext, getBlockEntry } from "./registry"
10
+ import { Section } from "./section"
11
11
  import type { PageBuilderBlock, PageBuilderBlocks } from "./types"
12
12
 
13
13
  type RendererProps = {
@@ -23,49 +23,33 @@ export function Renderer({
23
23
  }: RendererProps) {
24
24
  if (!blocks?.length) return null
25
25
 
26
+ const context: BlockContext = { searchParams, pinnedCategory }
27
+
28
+ const reservedAnchorIds = reserveAnchorIds(blocks)
29
+ const takenAnchorIds = new Set<string>()
30
+
26
31
  return (
27
- <div className="space-y-16">
28
- {blocks.map((block: PageBuilderBlock) => (
29
- <PageBuilderNode
30
- key={block._key}
31
- block={block}
32
- searchParams={searchParams}
33
- pinnedCategory={pinnedCategory}
34
- />
35
- ))}
36
- </div>
37
- )
38
- }
32
+ <>
33
+ {blocks.map((block: PageBuilderBlock) => {
34
+ const entry = getBlockEntry(block._type)
39
35
 
40
- function PageBuilderNode({
41
- block,
42
- searchParams,
43
- pinnedCategory,
44
- }: {
45
- block: PageBuilderBlock
46
- searchParams: ContentCollectionSearchParams
47
- pinnedCategory: PinnedCollectionCategory
48
- }) {
49
- switch (block._type) {
50
- case "blogCollection":
51
- return (
52
- <ContentCollection
53
- block={block}
54
- searchParams={searchParams}
55
- pinnedCategory={pinnedCategory}
56
- />
57
- )
58
- case "blogContent":
59
- return <ArticleContent block={block} />
60
- case "hero":
61
- return <Hero block={block} />
62
- case "description":
63
- return <Description block={block} />
64
- case "richTextBlock":
65
- return <RichTextBlock block={block} />
66
- case "gatedContent":
67
- return <GatedContent block={block} />
68
- default:
69
- return null
70
- }
36
+ // No entry means the content is ahead of the generated types.
37
+ if (!entry || entry.isEmpty?.(block)) return null
38
+
39
+ return (
40
+ <Section
41
+ anchorId={resolveAnchorId(
42
+ block,
43
+ takenAnchorIds,
44
+ reservedAnchorIds
45
+ )}
46
+ key={block._key}
47
+ presentation={block.presentation}
48
+ >
49
+ {entry.render(block, context)}
50
+ </Section>
51
+ )
52
+ })}
53
+ </>
54
+ )
71
55
  }
@@ -0,0 +1,35 @@
1
+ import type { ReactNode } from "react"
2
+ import { spacingPaddingValue } from "@/lib/integrations/sanity/schemas/shared/spacing"
3
+ import { cn } from "@/lib/styles/cn"
4
+
5
+ export type SectionPresentation = {
6
+ paddingTop?: string | null
7
+ paddingBottom?: string | null
8
+ } | null
9
+
10
+ type SectionProps = {
11
+ anchorId?: string | null | undefined
12
+ presentation?: SectionPresentation | undefined
13
+ className?: string | undefined
14
+ children: ReactNode
15
+ }
16
+
17
+ export function Section({
18
+ anchorId,
19
+ presentation,
20
+ className,
21
+ children,
22
+ }: SectionProps) {
23
+ return (
24
+ <section
25
+ id={anchorId || undefined}
26
+ style={{
27
+ paddingTop: spacingPaddingValue(presentation?.paddingTop),
28
+ paddingBottom: spacingPaddingValue(presentation?.paddingBottom),
29
+ }}
30
+ className={cn(anchorId && "scroll-mt-24", className)}
31
+ >
32
+ {children}
33
+ </section>
34
+ )
35
+ }
@@ -132,7 +132,7 @@ export const PageDocument = ({
132
132
  {pageJsonLd.map(({ key, data }) => (
133
133
  <JsonLd key={key} data={data} />
134
134
  ))}
135
- <article className="mx-auto flex w-full max-w-6xl flex-1 flex-col gap-14 px-4 py-14 md:px-6 md:py-20">
135
+ <article className="mx-auto flex w-full max-w-6xl flex-1 flex-col px-4 py-14 md:px-6 md:py-20">
136
136
  <h1>{title}</h1>
137
137
  {sections.length ? (
138
138
  sections