bsmnt 0.11.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 (217) 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/files/components/ui/sanity-image/index.tsx +36 -4
  88. package/src/modules/features/cms/sanity/files/lib/integrations/sanity/components/rich-text.tsx +7 -1
  89. package/src/modules/features/cms/sanity-pagebuilder/files/components/sanity/rich-text.tsx +7 -1
  90. package/src/modules/features/cms/sanity-pagebuilder/files/components/ui/sanity-image/index.tsx +36 -4
  91. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/anchor-id-input.tsx +17 -0
  92. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/page-builder-input.tsx +26 -7
  93. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/page-builder-insert-menu.tsx +242 -0
  94. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/presentation-input.tsx +146 -0
  95. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/spacing-steps-input.tsx +84 -0
  96. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/use-studio-preview-urls.ts +62 -0
  97. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/fetchers/layout.ts +6 -3
  98. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/icons.ts +8 -0
  99. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/page-builder-config.ts +72 -34
  100. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/queries.ts +12 -0
  101. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/index.ts +1 -0
  102. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/reusable/blog-content.ts +3 -3
  103. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/reusable/description.ts +3 -3
  104. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/reusable/gated-content.ts +3 -3
  105. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/reusable/hero.ts +3 -3
  106. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/reusable/rich-text-block.ts +3 -3
  107. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/singleton/content-collection.ts +3 -3
  108. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/studio-preview.ts +37 -0
  109. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/index.ts +11 -0
  110. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/layout/spacing-settings.ts +120 -0
  111. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/anchor.ts +75 -0
  112. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/block.ts +46 -0
  113. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/presentation.ts +44 -0
  114. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/spacing.ts +164 -0
  115. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/singletons.ts +9 -0
  116. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/structure.ts +5 -0
  117. package/src/modules/features/cms/sanity-pagebuilder-cache/files/components/sanity/rich-text.tsx +7 -1
  118. package/src/modules/features/cms/sanity-pagebuilder-cache/files/components/ui/sanity-image/index.tsx +36 -4
  119. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/anchor-id-input.tsx +17 -0
  120. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/page-builder-input.tsx +26 -7
  121. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/page-builder-insert-menu.tsx +242 -0
  122. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/presentation-input.tsx +146 -0
  123. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/spacing-steps-input.tsx +84 -0
  124. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/use-studio-preview-urls.ts +62 -0
  125. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/fetchers/layout.ts +4 -2
  126. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/icons.ts +8 -0
  127. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/page-builder-config.ts +72 -34
  128. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/queries.ts +12 -0
  129. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/index.ts +1 -0
  130. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/reusable/blog-content.ts +3 -3
  131. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/reusable/description.ts +3 -3
  132. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/reusable/gated-content.ts +3 -3
  133. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/reusable/hero.ts +3 -3
  134. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/reusable/rich-text-block.ts +3 -3
  135. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/singleton/content-collection.ts +3 -3
  136. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/studio-preview.ts +37 -0
  137. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/index.ts +11 -0
  138. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/layout/spacing-settings.ts +120 -0
  139. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/anchor.ts +75 -0
  140. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/block.ts +46 -0
  141. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/presentation.ts +44 -0
  142. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/spacing.ts +164 -0
  143. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/singletons.ts +9 -0
  144. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/structure.ts +5 -0
  145. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/tags.ts +2 -0
  146. package/src/modules/features/consent/ketch/files/lib/integrations/check-integration.ts +25 -0
  147. package/src/modules/features/consent/ketch/files/lib/integrations/ketch/README.md +70 -0
  148. package/src/modules/features/consent/ketch/files/lib/integrations/ketch/categories.ts +20 -0
  149. package/src/modules/features/consent/ketch/files/lib/integrations/ketch/consent-store.ts +107 -0
  150. package/src/modules/features/consent/ketch/files/lib/integrations/ketch/env.ts +20 -0
  151. package/src/modules/features/consent/ketch/files/lib/integrations/ketch/ketch-experience.css +136 -0
  152. package/src/modules/features/consent/ketch/files/lib/integrations/ketch/preferences-button.tsx +51 -0
  153. package/src/modules/features/consent/ketch/files/lib/integrations/ketch/script.tsx +8 -0
  154. package/src/modules/features/consent/ketch/files/lib/integrations/ketch/types.ts +15 -0
  155. package/src/modules/features/consent/ketch/files/lib/integrations/ketch/use-consent.ts +26 -0
  156. package/src/modules/features/jobs/ashby/files/_sanity-adapter/job-board-block.ts +53 -0
  157. package/src/modules/features/jobs/ashby/files/lib/integrations/ashby/README.md +134 -0
  158. package/src/modules/features/jobs/ashby/files/lib/integrations/ashby/env.ts +3 -0
  159. package/src/modules/features/jobs/ashby/files/lib/integrations/ashby/index.ts +40 -0
  160. package/src/modules/features/jobs/ashby/files/lib/integrations/ashby/normalize.ts +124 -0
  161. package/src/modules/features/jobs/ashby/files/lib/integrations/ashby/types.ts +20 -0
  162. package/src/modules/features/jobs/ashby/files/lib/integrations/check-integration.ts +25 -0
  163. package/src/templates/next-default/.biome/plugins/no-fill-without-sizes.grit +11 -0
  164. package/src/templates/next-default/biome.json +2 -1
  165. package/src/templates/next-default/components/ui/image/index.tsx +20 -12
  166. package/src/templates/next-default/next.config.ts +10 -4
  167. package/src/templates/next-experiments/.biome/plugins/no-fill-without-sizes.grit +11 -0
  168. package/src/templates/next-experiments/biome.json +2 -1
  169. package/src/templates/next-experiments/components/ui/image/index.tsx +20 -12
  170. package/src/templates/next-experiments/next.config.ts +10 -4
  171. package/src/templates/next-pagebuilder/.biome/plugins/no-fill-without-sizes.grit +11 -0
  172. package/src/templates/next-pagebuilder/AGENTS.md +129 -0
  173. package/src/templates/next-pagebuilder/CLAUDE.md +3 -0
  174. package/src/templates/next-pagebuilder/README.md +70 -0
  175. package/src/templates/next-pagebuilder/app/(content)/layout.tsx +2 -0
  176. package/src/templates/next-pagebuilder/biome.json +2 -1
  177. package/src/templates/next-pagebuilder/components/layout/spacing-scale/index.tsx +18 -0
  178. package/src/templates/next-pagebuilder/components/page-builder/components/article-content/index.tsx +6 -1
  179. package/src/templates/next-pagebuilder/components/page-builder/components/article-content/related-post-item.tsx +1 -0
  180. package/src/templates/next-pagebuilder/components/page-builder/components/content-collection/index.tsx +2 -2
  181. package/src/templates/next-pagebuilder/components/page-builder/components/description.tsx +3 -7
  182. package/src/templates/next-pagebuilder/components/page-builder/components/gated-content/index.tsx +2 -2
  183. package/src/templates/next-pagebuilder/components/page-builder/components/hero.tsx +3 -7
  184. package/src/templates/next-pagebuilder/components/page-builder/components/rich-text-block.tsx +3 -5
  185. package/src/templates/next-pagebuilder/components/page-builder/registry.tsx +70 -0
  186. package/src/templates/next-pagebuilder/components/page-builder/renderer.tsx +33 -49
  187. package/src/templates/next-pagebuilder/components/page-builder/section.tsx +35 -0
  188. package/src/templates/next-pagebuilder/components/page-document/index.tsx +1 -1
  189. package/src/templates/next-pagebuilder/components/ui/image/index.tsx +20 -12
  190. package/src/templates/next-pagebuilder/lib/integrations/sanity/sanity.types.ts +92 -4
  191. package/src/templates/next-pagebuilder/next.config.ts +4 -3
  192. package/src/templates/next-pagebuilder-cache/.biome/plugins/no-fill-without-sizes.grit +11 -0
  193. package/src/templates/next-pagebuilder-cache/AGENTS.md +136 -0
  194. package/src/templates/next-pagebuilder-cache/CLAUDE.md +3 -0
  195. package/src/templates/next-pagebuilder-cache/README.md +75 -0
  196. package/src/templates/next-pagebuilder-cache/app/(content)/layout.tsx +2 -0
  197. package/src/templates/next-pagebuilder-cache/biome.json +2 -1
  198. package/src/templates/next-pagebuilder-cache/components/layout/spacing-scale/index.tsx +46 -0
  199. package/src/templates/next-pagebuilder-cache/components/page-builder/components/article-content/index.tsx +6 -1
  200. package/src/templates/next-pagebuilder-cache/components/page-builder/components/article-content/related-post-item.tsx +1 -0
  201. package/src/templates/next-pagebuilder-cache/components/page-builder/components/content-collection/index.tsx +2 -2
  202. package/src/templates/next-pagebuilder-cache/components/page-builder/components/description.tsx +3 -7
  203. package/src/templates/next-pagebuilder-cache/components/page-builder/components/gated-content/index.tsx +2 -2
  204. package/src/templates/next-pagebuilder-cache/components/page-builder/components/hero.tsx +3 -7
  205. package/src/templates/next-pagebuilder-cache/components/page-builder/components/rich-text-block.tsx +3 -5
  206. package/src/templates/next-pagebuilder-cache/components/page-builder/registry.tsx +70 -0
  207. package/src/templates/next-pagebuilder-cache/components/page-builder/renderer.tsx +33 -49
  208. package/src/templates/next-pagebuilder-cache/components/page-builder/section.tsx +35 -0
  209. package/src/templates/next-pagebuilder-cache/components/page-document/index.tsx +1 -1
  210. package/src/templates/next-pagebuilder-cache/components/ui/image/index.tsx +21 -12
  211. package/src/templates/next-pagebuilder-cache/lib/integrations/sanity/sanity.types.ts +92 -4
  212. package/src/templates/next-pagebuilder-cache/lib/utils/image-sizes.ts +72 -0
  213. package/src/templates/next-pagebuilder-cache/next.config.ts +4 -3
  214. package/src/templates/next-webgl/.biome/plugins/no-fill-without-sizes.grit +11 -0
  215. package/src/templates/next-webgl/biome.json +2 -1
  216. package/src/templates/next-webgl/components/ui/image/index.tsx +20 -12
  217. package/src/templates/next-webgl/next.config.ts +10 -4
@@ -98,7 +98,6 @@ const getFinalPlaceholder = (
98
98
  * Enhanced Image component with responsive sizing and automatic optimizations.
99
99
  *
100
100
  * Always use this component instead of next/image directly. Provides:
101
- * - Automatic responsive sizes generation
102
101
  * - Smart blur placeholders with aspect ratio support
103
102
  * - Performance optimizations (lazy loading by default)
104
103
  * - Priority flag for LCP images
@@ -147,14 +146,14 @@ export function Image({
147
146
  style,
148
147
  className,
149
148
  objectFit = "cover",
150
- quality = 90,
149
+ quality = 75,
151
150
  alt = "",
152
151
  fill,
153
152
  block = !fill,
154
- width = block ? 1 : undefined,
155
- height = block ? 1 : undefined,
156
- mobileSize = "100vw",
157
- desktopSize = "100vw",
153
+ width,
154
+ height,
155
+ mobileSize,
156
+ desktopSize,
158
157
  sizes,
159
158
  src,
160
159
  unoptimized,
@@ -164,9 +163,18 @@ export function Image({
164
163
  priority = false,
165
164
  ...props
166
165
  }: ImageProps) {
167
- // Generate responsive sizes if not provided
168
- const finalSizes =
169
- sizes || buildImageSizes({ base: mobileSize, desktop: desktopSize })
166
+ const responsiveSizes =
167
+ mobileSize || desktopSize
168
+ ? buildImageSizes({
169
+ base: mobileSize ?? "100vw",
170
+ desktop: desktopSize ?? mobileSize ?? "100vw",
171
+ })
172
+ : undefined
173
+
174
+ const hasIntrinsicSize = width !== undefined && height !== undefined
175
+ const finalSizes = sizes ?? responsiveSizes ?? (hasIntrinsicSize ? undefined : "100vw")
176
+ const finalWidth = width ?? (block ? 1 : undefined)
177
+ const finalHeight = height ?? (block ? 1 : undefined)
170
178
 
171
179
  // Early return after hooks
172
180
  if (!src) return null
@@ -194,8 +202,8 @@ export function Image({
194
202
  <NextImage
195
203
  ref={ref}
196
204
  fill={!block}
197
- {...(width !== undefined && { width })}
198
- {...(height !== undefined && { height })}
205
+ {...(finalWidth !== undefined && { width: finalWidth })}
206
+ {...(finalHeight !== undefined && { height: finalHeight })}
199
207
  priority={priority}
200
208
  quality={quality}
201
209
  alt={alt}
@@ -204,7 +212,7 @@ export function Image({
204
212
  ...style,
205
213
  }}
206
214
  className={cn(className, block && "block w-full")}
207
- sizes={finalSizes}
215
+ {...(finalSizes && { sizes: finalSizes })}
208
216
  src={src}
209
217
  unoptimized={unoptimized || isSvg}
210
218
  draggable={false}
@@ -77,12 +77,18 @@ const nextConfig: NextConfig = {
77
77
  ],
78
78
  },
79
79
  images: {
80
- dangerouslyAllowSVG: true,
81
- remotePatterns: [],
80
+ remotePatterns: [
81
+ {
82
+ protocol: "https",
83
+ hostname: "cdn.sanity.io",
84
+ },
85
+ ],
82
86
  minimumCacheTTL: 60 * 60 * 24 * 30, // 30 days
83
- qualities: [90],
87
+ qualities: [75, 90, 100],
84
88
  formats: ["image/avif", "image/webp"],
85
- deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
89
+ deviceSizes: [
90
+ 640, 750, 828, 1080, 1200, 1320, 1620, 1920, 2048, 2560, 3024, 3456, 3840,
91
+ ],
86
92
  imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
87
93
  },
88
94
  headers: async () => [
@@ -0,0 +1,11 @@
1
+ language js
2
+
3
+ or {
4
+ `<Image $attrs />`,
5
+ `<SanityImage $attrs />`
6
+ } as $image where {
7
+ $attrs <: contains `fill`,
8
+ ! $attrs <: contains `fill={false}`,
9
+ ! $attrs <: contains or { `sizes`, `mobileSize`, `desktopSize` },
10
+ register_diagnostic(span=$image, message="A `fill` image has no intrinsic width, so without `sizes` the browser assumes 100vw and requests the largest candidate. Pass `sizes`, or `mobileSize`/`desktopSize`.", severity="error")
11
+ }
@@ -0,0 +1,129 @@
1
+ # AGENTS.md
2
+
3
+ Instructions for AI agents working in this repository. Human-facing setup,
4
+ environment variables and the publish webhook live in the README — read it too.
5
+
6
+ This is a **Next.js + Sanity page builder**: all URL structure is managed in
7
+ Sanity, not in code, and a single catch-all route `[[...slug]]` renders every
8
+ page.
9
+
10
+ **Never add a page route under `app/`.** A new page is a `page` document in the
11
+ Studio with a slug, not a directory. `app/(content)/[[...slug]]/page.tsx`
12
+ resolves every one of them; a hand-written route shadows that resolver and
13
+ becomes a URL no editor can see, move or delete. The only things that belong in
14
+ `app/` are non-page endpoints — the Studio, API handlers, sitemap, feed.
15
+
16
+ ## Page-builder blocks
17
+
18
+ **A block is `defineBlock` + a registry entry.** Define the schema with
19
+ `defineBlock` (`lib/integrations/sanity/schemas/shared/block.ts`), never
20
+ `defineType` — it implies `type: "document"` and appends **Anchor ID** and
21
+ **Presentation Mode** for you. Register the component in
22
+ `components/page-builder/registry.tsx`; the renderer is driven by that map, so
23
+ there is no switch to extend.
24
+
25
+ Both halves are enforced, not documented: the registry's key set is typed as
26
+ exactly `PageBuilderDocumentType`, so a block registered in
27
+ `page-builder-config.ts` without an entry there — or an entry there for a block
28
+ that was never registered — is a typecheck error.
29
+
30
+ **Every block declares two orthogonal axes** in `page-builder-config.ts`:
31
+ `pageTypes` (which page documents may host it — drives validation) and
32
+ `category` (what the block structurally is, one of `componentCategories` —
33
+ drives the insert menu; `misc` only when nothing else fits). Never collapse them
34
+ into one field: that is what made the menu a single flat list.
35
+
36
+ **And a preview image.** The insert menu renders one tile per block from a
37
+ `studioPreview` document (Components → Component Previews) keyed
38
+ `block.<memberName>`. A block without one falls back to its schema icon, which
39
+ is what made the old menu unreadable.
40
+
41
+ **Never hardcode vertical padding in a block component.** The renderer wraps
42
+ each block in `<Section>` (`components/page-builder/section.tsx`), which owns
43
+ the `<section>` element, the anchor `id`, `scroll-mt` and the responsive padding
44
+ top/bottom. A block component returns its content only — no outer `<section>`,
45
+ no `py-*` / `pt-*` / `pb-*` on its root. Internal gaps between a block's own
46
+ parts are fine.
47
+
48
+ **Never hardcode px for section spacing either.** The scale lives in the Studio
49
+ at **Layout → Spacing Scale**, where editors add or rename steps and mark one as
50
+ the default, and it reaches the page as CSS custom properties. `Section` only
51
+ references `var(--section-space-<key>, var(--section-space-default, 2.5rem))`.
52
+
53
+ **An empty Anchor ID is generated from the block's title** (`headline` /
54
+ `heading` / `teaserHeading` / `title` / `label` — never `internalTitle`, which is
55
+ Studio-only) and de-duplicated per page. Name your block's headline field one of
56
+ those and anchor links work for free.
57
+
58
+ Declare `isEmpty` in the registry when a block can be left unfilled — the
59
+ renderer then skips the block *and* its `<Section>`, so it leaves no padded gap
60
+ and claims no anchor id. Don't early-return `null` from the component instead;
61
+ the renderer has to know before it wraps anything.
62
+
63
+ Full recipe and a checklist for a new block: the `page-builder-block` skill, or
64
+ the "Page-builder blocks" section of the README.
65
+
66
+ ## Sanity
67
+
68
+ - Everything Sanity lives in `lib/integrations/sanity/`.
69
+ - Schemas use `defineType` / `defineField` / `defineArrayMember` (blocks use
70
+ `defineBlock`). GROQ queries are `SCREAMING_SNAKE_CASE` and wrapped in
71
+ `defineQuery`.
72
+ - **Regenerate types after any schema or query change:** `bun sanity:typegen`,
73
+ and commit the result in the same PR. Never hand-edit `sanity.types.ts`.
74
+ - The page query spreads `...` for non-gated blocks, so new block fields flow
75
+ through on their own — except `gatedContent`, whose GROQ branch lists fields
76
+ explicitly in `lib/integrations/sanity/queries.ts`. Add fields there by hand.
77
+ - Read through `sanityFetch` / `fetchSanity`, not a bare client, so the
78
+ draft-mode perspective and cache tags are applied.
79
+ - Publishing a document must invalidate what renders it. Layout singletons are
80
+ listed in `SANITY_LAYOUT_TAGS`; a new one that isn't there serves stale.
81
+ - Add `data-sanity` attributes where visual editing should reach.
82
+ - Nested layouts (e.g. `app/studio/layout.tsx`) must NOT render `<html>` or
83
+ `<body>` — the root layout already provides them.
84
+
85
+ ## React and Next.js
86
+
87
+ - **React Compiler is on.** Do not write `useMemo`, `useCallback` or
88
+ `React.memo`. The one exception is `useRef` to instantiate an object once:
89
+
90
+ ```tsx
91
+ const instanceRef = useRef<SomeClass | null>(null)
92
+ if (!instanceRef.current) instanceRef.current = new SomeClass()
93
+ ```
94
+
95
+ - React 19: refs are regular props, so no `forwardRef` (a lint rule enforces it).
96
+ - **Never call `headers()`, `cookies()`, `draftMode()` or read `searchParams` in
97
+ a root layout** — it takes the whole page out of the prerender. Detect the
98
+ route with `useSelectedLayoutSegment()` in a `"use client"` wrapper, and put
99
+ draft-mode / visual-editing behaviour in a child component with its own
100
+ `<Suspense>` boundary.
101
+ - Use `@/components/ui/image` rather than `next/image` directly, and
102
+ `@/components/ui/sanity-image` for Sanity assets.
103
+ - Compose classNames with `cn` from `@/lib/styles/cn`.
104
+ - Import with the `@/` alias; relative parent imports are a lint error.
105
+ - Gate debug UI behind `process.env.NODE_ENV === "development"` — it is not
106
+ stripped in production otherwise.
107
+
108
+ ## House rules
109
+
110
+ - **Bun only.** `bun install`, `bun run <script>`, `bunx`. Never npm, pnpm or
111
+ yarn — a second lockfile next to `bun.lock` is how the versions drift.
112
+ - **Don't add a dependency without asking.** Check `bun info <package>` and the
113
+ current docs first.
114
+ <!-- bsmnt:if dotenvx -->
115
+ - **Secrets are encrypted at rest with dotenvx.** Never put a real secret in
116
+ plaintext in a committed env file — gitleaks blocks the commit. Use
117
+ `bun env:set KEY value` (`--plain` for trivial config and `NEXT_PUBLIC_*`).
118
+ The `manage-env` skill has the full procedure.
119
+ <!-- bsmnt:endif -->
120
+ - Don't leave commented-out code or `TODO`s behind; write the code so it reads
121
+ without them.
122
+ - **Verify before claiming done:**
123
+
124
+ ```bash
125
+ bun sanity:typegen && bun typecheck && bun lint && bun run build && bun knip
126
+ ```
127
+
128
+ (`bun run build`, not `bun build` — the bare form is Bun's bundler.) Say what
129
+ you ran and what it printed; don't report success you haven't seen.
@@ -0,0 +1,3 @@
1
+ # CLAUDE.md
2
+
3
+ @AGENTS.md
@@ -12,9 +12,79 @@ bun dev
12
12
 
13
13
  - Single catch-all route `[[...slug]]` handles all pages
14
14
  - Sanity page builder with composable content blocks
15
+ - Editor-owned vertical spacing scale and per-block anchor links
15
16
  - Blog with categories, filtering, and pagination
16
17
  - Visual editing and live preview support
17
18
 
19
+ ## Page-builder blocks
20
+
21
+ A block is two halves — a schema document and a React component — and each half
22
+ has one place that makes it a block rather than an ordinary document or a loose
23
+ component. Use them and Anchor ID, Presentation Mode and the spacing scale come
24
+ for free.
25
+
26
+ **Define the schema with `defineBlock`, never `defineType`**
27
+ (`lib/integrations/sanity/schemas/shared/block.ts`). It implies
28
+ `type: "document"` and appends two fields to every block:
29
+
30
+ - **Anchor ID** — optional. Left empty, the anchor is generated from the block's
31
+ own title at render time (`headline` / `heading` / `teaserHeading` / `title` /
32
+ `label` — never `internalTitle`, which is Studio-only) and de-duplicated per
33
+ page, so two blocks with the same heading get `-2`. A value typed by hand
34
+ always wins, and the Studio shows the generated one as the placeholder. Link
35
+ to it as `/<page>#<anchor>`.
36
+ - **Presentation Mode** — padding top and bottom, each picked from the shared
37
+ spacing scale. No free-form px. A block that never touches it follows whichever
38
+ step is marked as the default.
39
+
40
+ Blocks that declare `groups` get a **Presentation** tab for both fields
41
+ automatically — don't list it in `groups` yourself.
42
+
43
+ **Register the component in `components/page-builder/registry.tsx`.** One entry
44
+ per block, keyed by schema type; the renderer is driven by that map, so there is
45
+ no switch to extend. `isEmpty` declares when a block has nothing to show — the
46
+ renderer then skips the block *and* its `<Section>`, so an unfilled block leaves
47
+ no padded gap behind and claims no anchor id. The registry's key set is typed as
48
+ exactly `PageBuilderDocumentType`, so a block registered in one place and not the
49
+ other is a typecheck error.
50
+
51
+ **Never hardcode vertical padding in a block component.** The renderer wraps each
52
+ block in `<Section>` (`components/page-builder/section.tsx`), which owns the
53
+ `<section>` element, the anchor `id`, `scroll-mt` and the padding. A block
54
+ component returns its content only — no outer `<section>`, no `py-*` / `pt-*` /
55
+ `pb-*` on its root. Internal gaps between a block's own parts are fine.
56
+
57
+ ### The spacing scale is content, not code
58
+
59
+ Editors own it at **Layout → Spacing Scale**: a list of steps, each with a name
60
+ and px per breakpoint (mobile / tablet / desktop, empty reuses Desktop), one
61
+ marked as the default. Ticking a second step as default unticks the previous, so
62
+ there is always exactly one. Add a "Hero 120px" step and it shows up in every
63
+ block's dropdown, no deploy.
64
+
65
+ - Blocks store the step's `_key`, so renaming a step breaks nothing and a deleted
66
+ step degrades to the default instead of breaking the page.
67
+ - The list arrives seeded with the built-in five (XS 16 · SM 24 · **MD 32,
68
+ default** · LG 48 · XL 80, from `schemas/shared/spacing.ts`), which also apply
69
+ as the fallback if you empty it. Hit **"Add the built-in steps"** in the field
70
+ to get them back as editable rows.
71
+ - Values reach the page as CSS custom properties injected server-side by
72
+ `components/layout/spacing-scale/`, one `--section-space-<key>` per step plus
73
+ `--section-space-default`, re-declared inside the `768px` and `1440px` media
74
+ queries. `Section` only ever references
75
+ `var(--section-space-<key>, var(--section-space-default, 2.5rem))`, so an
76
+ unknown key degrades instead of breaking.
77
+ - `spacingSettings` is a layout singleton, so publishing it busts the layout
78
+ cache the same way navbar and footer do.
79
+
80
+ After a schema change run `bun sanity:typegen`. The page query spreads `...` for
81
+ non-gated blocks, so new fields flow through on their own — except
82
+ `gatedContent`, whose GROQ branch lists fields explicitly in
83
+ `lib/integrations/sanity/queries.ts`.
84
+
85
+ The bundled `page-builder-block` agent skill has the full recipe and a checklist
86
+ for adding a new block.
87
+
18
88
  ## Commands
19
89
 
20
90
  - `bun dev` - Start dev server
@@ -1,10 +1,12 @@
1
1
  import { JsonLd } from "@/components/layout/json-ld"
2
+ import { SpacingScale } from "@/components/layout/spacing-scale"
2
3
  import { Wrapper } from "@/components/layout/wrapper"
3
4
  import { SanityVisualEditing } from "@/components/sanity/visual-editing"
4
5
 
5
6
  const Layout = ({ children }: { children: React.ReactNode }) => {
6
7
  return (
7
8
  <>
9
+ <SpacingScale />
8
10
  <JsonLd />
9
11
  <Wrapper>{children}</Wrapper>
10
12
  <SanityVisualEditing />
@@ -247,7 +247,8 @@
247
247
  "plugins": [
248
248
  "./.biome/plugins/no-anchor-element.grit",
249
249
  "./.biome/plugins/no-unnecessary-forwardref.grit",
250
- "./.biome/plugins/no-relative-parent-imports.grit"
250
+ "./.biome/plugins/no-relative-parent-imports.grit",
251
+ "./.biome/plugins/no-fill-without-sizes.grit"
251
252
  ],
252
253
  "vcs": {
253
254
  "clientKind": "git",
@@ -0,0 +1,18 @@
1
+ import { getLayoutData } from "@/lib/integrations/sanity/fetchers/layout"
2
+ import {
3
+ resolveSpacingSteps,
4
+ spacingScaleCss,
5
+ } from "@/lib/integrations/sanity/schemas/shared/spacing"
6
+
7
+ export const SpacingScale = async () => {
8
+ const { spacingSettings } = await getLayoutData()
9
+
10
+ return (
11
+ <style
12
+ // biome-ignore lint/security/noDangerouslySetInnerHtml: css custom properties from the spacing singleton
13
+ dangerouslySetInnerHTML={{
14
+ __html: spacingScaleCss(resolveSpacingSteps(spacingSettings?.steps)),
15
+ }}
16
+ />
17
+ )
18
+ }
@@ -7,7 +7,7 @@ import { RelatedPostItem } from "./related-post-item"
7
7
  export function ArticleContent({ block }: ArticleContentProps) {
8
8
  const { author, body, categories, date, relatedPosts, thumbnail } = block
9
9
  return (
10
- <div className="py-8 md:py-12">
10
+ <div>
11
11
  <header className="mx-auto max-w-3xl space-y-6">
12
12
  {categories && categories.length > 0 ? (
13
13
  <div className="flex flex-wrap gap-2">
@@ -28,6 +28,9 @@ export function ArticleContent({ block }: ArticleContentProps) {
28
28
  <SanityImage
29
29
  image={author.avatar}
30
30
  alt={author.name || ""}
31
+ width={40}
32
+ height={40}
33
+ maxWidth={80}
31
34
  className="size-10 rounded-full object-cover"
32
35
  />
33
36
  ) : null}
@@ -50,6 +53,8 @@ export function ArticleContent({ block }: ArticleContentProps) {
50
53
  image={thumbnail}
51
54
  alt={thumbnail.alt || ""}
52
55
  priority
56
+ quality={90}
57
+ sizes="(min-width: 896px) 896px, 100vw"
53
58
  className="aspect-video w-full object-cover"
54
59
  />
55
60
  </div>
@@ -14,6 +14,7 @@ export const RelatedPostItem = ({ post }: { post: ArticleRelatedPost }) => {
14
14
  <SanityImage
15
15
  image={post.metadata.image}
16
16
  alt={post.title || ""}
17
+ sizes="(min-width: 768px) 768px, 100vw"
17
18
  className="aspect-[16/9] w-full object-cover transition-transform duration-300 group-hover:scale-105"
18
19
  />
19
20
  </div>
@@ -239,11 +239,11 @@ async function CollectionResults({
239
239
  // clickable before the grid resolves.
240
240
  export function ContentCollection(props: ContentCollectionProps) {
241
241
  return (
242
- <section className="flex flex-col gap-8 py-8">
242
+ <div className="flex flex-col gap-8">
243
243
  <CollectionToolbar pinnedCategory={props.pinnedCategory} />
244
244
  <Suspense fallback={<CollectionResultsSkeleton />}>
245
245
  <CollectionResults {...props} />
246
246
  </Suspense>
247
- </section>
247
+ </div>
248
248
  )
249
249
  }
@@ -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
  }