bsmnt 0.10.0 → 0.11.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 (321) hide show
  1. package/dist/application/add-integration/index.js.map +1 -1
  2. package/dist/application/shared/node-version.js.map +1 -1
  3. package/dist/core/create/internal-ids.d.ts +3 -0
  4. package/dist/core/create/internal-ids.d.ts.map +1 -1
  5. package/dist/core/create/internal-ids.js +4 -0
  6. package/dist/core/create/internal-ids.js.map +1 -1
  7. package/dist/domain/agents.d.ts.map +1 -1
  8. package/dist/domain/animations.d.ts.map +1 -1
  9. package/dist/domain/cms.d.ts.map +1 -1
  10. package/dist/domain/forms.d.ts.map +1 -1
  11. package/dist/domain/hooks.d.ts.map +1 -1
  12. package/dist/domain/skills.d.ts.map +1 -1
  13. package/dist/domain/templates.d.ts +10 -0
  14. package/dist/domain/templates.d.ts.map +1 -1
  15. package/dist/domain/templates.js +5 -0
  16. package/dist/domain/templates.js.map +1 -1
  17. package/dist/index.js +18 -5
  18. package/dist/index.js.map +1 -1
  19. package/dist/infrastructure/agents/register-sanity-mcp.js +3 -8
  20. package/dist/infrastructure/agents/register-sanity-mcp.js.map +1 -1
  21. package/dist/infrastructure/agents/register-storybook-mcp.d.ts +18 -0
  22. package/dist/infrastructure/agents/register-storybook-mcp.d.ts.map +1 -0
  23. package/dist/infrastructure/agents/register-storybook-mcp.js +157 -0
  24. package/dist/infrastructure/agents/register-storybook-mcp.js.map +1 -0
  25. package/dist/infrastructure/create/lifecycle-registry.d.ts.map +1 -1
  26. package/dist/infrastructure/create/lifecycle-registry.js +39 -1
  27. package/dist/infrastructure/create/lifecycle-registry.js.map +1 -1
  28. package/dist/infrastructure/create/merge-registry.d.ts.map +1 -1
  29. package/dist/infrastructure/create/merge-registry.js +4 -0
  30. package/dist/infrastructure/create/merge-registry.js.map +1 -1
  31. package/dist/infrastructure/create/sanity-auth.js.map +1 -1
  32. package/dist/infrastructure/create/setup-agent.d.ts +6 -1
  33. package/dist/infrastructure/create/setup-agent.d.ts.map +1 -1
  34. package/dist/infrastructure/create/setup-agent.js +23 -21
  35. package/dist/infrastructure/create/setup-agent.js.map +1 -1
  36. package/dist/infrastructure/create/setup-dotenvx.js.map +1 -1
  37. package/dist/infrastructure/create/setup-remote.js.map +1 -1
  38. package/dist/infrastructure/create/setup-sanity.d.ts.map +1 -1
  39. package/dist/infrastructure/create/setup-sanity.js +12 -1
  40. package/dist/infrastructure/create/setup-sanity.js.map +1 -1
  41. package/dist/infrastructure/integrations/inject-integration.d.ts.map +1 -1
  42. package/dist/infrastructure/integrations/inject-integration.js +2 -0
  43. package/dist/infrastructure/integrations/inject-integration.js.map +1 -1
  44. package/dist/infrastructure/update/notifier.js.map +1 -1
  45. package/dist/modules/features/cms/index.d.ts.map +1 -1
  46. package/dist/modules/features/cms/index.js +2 -0
  47. package/dist/modules/features/cms/index.js.map +1 -1
  48. package/dist/modules/features/cms/sanity/config.d.ts.map +1 -1
  49. package/dist/modules/features/cms/sanity/config.js +1 -0
  50. package/dist/modules/features/cms/sanity/config.js.map +1 -1
  51. package/dist/modules/features/cms/sanity/index.d.ts.map +1 -1
  52. package/dist/modules/features/cms/sanity/index.js +10 -1
  53. package/dist/modules/features/cms/sanity/index.js.map +1 -1
  54. package/dist/modules/features/cms/sanity/mergers/check-integration.d.ts.map +1 -1
  55. package/dist/modules/features/cms/sanity/mergers/check-integration.js +15 -6
  56. package/dist/modules/features/cms/sanity/mergers/check-integration.js.map +1 -1
  57. package/dist/modules/features/cms/sanity/mergers/knip.d.ts.map +1 -1
  58. package/dist/modules/features/cms/sanity/mergers/knip.js +1 -0
  59. package/dist/modules/features/cms/sanity/mergers/knip.js.map +1 -1
  60. package/dist/modules/features/cms/sanity/mergers/layout.js.map +1 -1
  61. package/dist/modules/features/cms/sanity/mergers/package-json.d.ts +12 -0
  62. package/dist/modules/features/cms/sanity/mergers/package-json.d.ts.map +1 -0
  63. package/dist/modules/features/cms/sanity/mergers/package-json.js +19 -0
  64. package/dist/modules/features/cms/sanity/mergers/package-json.js.map +1 -0
  65. package/dist/modules/features/cms/sanity-pagebuilder/index.d.ts.map +1 -1
  66. package/dist/modules/features/cms/sanity-pagebuilder/index.js +7 -1
  67. package/dist/modules/features/cms/sanity-pagebuilder/index.js.map +1 -1
  68. package/dist/modules/features/cms/sanity-pagebuilder-cache/config.d.ts +14 -0
  69. package/dist/modules/features/cms/sanity-pagebuilder-cache/config.d.ts.map +1 -0
  70. package/dist/modules/features/cms/sanity-pagebuilder-cache/config.js +50 -0
  71. package/dist/modules/features/cms/sanity-pagebuilder-cache/config.js.map +1 -0
  72. package/dist/modules/features/cms/sanity-pagebuilder-cache/index.d.ts +3 -0
  73. package/dist/modules/features/cms/sanity-pagebuilder-cache/index.d.ts.map +1 -0
  74. package/dist/modules/features/cms/sanity-pagebuilder-cache/index.js +55 -0
  75. package/dist/modules/features/cms/sanity-pagebuilder-cache/index.js.map +1 -0
  76. package/dist/modules/presets/index.d.ts.map +1 -1
  77. package/dist/modules/presets/index.js +2 -0
  78. package/dist/modules/presets/index.js.map +1 -1
  79. package/dist/modules/presets/next-pagebuilder-cache.d.ts +3 -0
  80. package/dist/modules/presets/next-pagebuilder-cache.d.ts.map +1 -0
  81. package/dist/modules/presets/next-pagebuilder-cache.js +10 -0
  82. package/dist/modules/presets/next-pagebuilder-cache.js.map +1 -0
  83. package/dist/paths.d.ts +6 -0
  84. package/dist/paths.d.ts.map +1 -1
  85. package/dist/paths.js +6 -0
  86. package/dist/paths.js.map +1 -1
  87. package/package.json +5 -2
  88. package/src/modules/features/cms/sanity/files/lib/integrations/check-integration.ts +7 -6
  89. package/src/modules/features/cms/sanity/files/lib/integrations/sanity/README.md +1 -1
  90. package/src/modules/features/cms/sanity/files/lib/integrations/sanity/components/rich-text.tsx +1 -0
  91. package/src/modules/features/cms/sanity/files/lib/integrations/sanity/env.ts +2 -2
  92. package/src/modules/features/cms/sanity-pagebuilder/files/app/api/[[...slug]]/route.ts +4 -0
  93. package/src/modules/features/cms/sanity-pagebuilder/files/app/api/revalidate/route.ts +172 -24
  94. package/src/modules/features/cms/sanity-pagebuilder/files/app/feed.xml/route.ts +14 -7
  95. package/src/modules/features/cms/sanity-pagebuilder/files/app/sitemap.md/route.ts +2 -2
  96. package/src/modules/features/cms/sanity-pagebuilder/files/app/studio/[[...tool]]/page.tsx +16 -1
  97. package/src/modules/features/cms/sanity-pagebuilder/files/components/sanity/rich-text.tsx +1 -0
  98. package/src/modules/features/cms/sanity-pagebuilder/files/components/sanity/visual-editing.tsx +2 -2
  99. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/check-integration.ts +6 -5
  100. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/client.ts +8 -0
  101. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/slug-notices.tsx +6 -16
  102. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/env.ts +2 -2
  103. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/fetchers/layout.ts +22 -52
  104. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/icons.ts +2 -2
  105. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/live/index.tsx +3 -1
  106. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/page-builder-config.ts +7 -0
  107. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/page-tree-pane.tsx +70 -57
  108. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/queries.ts +119 -29
  109. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/revalidate-paths.ts +70 -0
  110. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/index.ts +1 -0
  111. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/reusable/rich-text-block.ts +39 -0
  112. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/index.ts +2 -0
  113. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/page.ts +12 -0
  114. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/tags.ts +56 -0
  115. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/utils/page-builder-markdown.ts +12 -0
  116. package/src/modules/features/cms/sanity-pagebuilder/files/lib/utils/sitemap.ts +11 -8
  117. package/src/modules/features/cms/sanity-pagebuilder-cache/files/.knip.json +8 -0
  118. package/src/modules/features/cms/sanity-pagebuilder-cache/files/app/api/[[...slug]]/route.ts +112 -0
  119. package/src/modules/features/cms/sanity-pagebuilder-cache/files/app/api/draft-mode/disable/route.ts +7 -0
  120. package/src/modules/features/cms/sanity-pagebuilder-cache/files/app/api/draft-mode/enable/route.ts +20 -0
  121. package/src/modules/features/cms/sanity-pagebuilder-cache/files/app/api/revalidate/route.ts +292 -0
  122. package/src/modules/features/cms/sanity-pagebuilder-cache/files/app/feed.xml/route.ts +66 -0
  123. package/src/modules/features/cms/sanity-pagebuilder-cache/files/app/sitemap.md/route.ts +132 -0
  124. package/src/modules/features/cms/sanity-pagebuilder-cache/files/app/studio/[[...tool]]/layout.tsx +26 -0
  125. package/src/modules/features/cms/sanity-pagebuilder-cache/files/app/studio/[[...tool]]/page.tsx +23 -0
  126. package/src/modules/features/cms/sanity-pagebuilder-cache/files/components/sanity/draft-mode-toggle.tsx +27 -0
  127. package/src/modules/features/cms/sanity-pagebuilder-cache/files/components/sanity/rich-text.tsx +88 -0
  128. package/src/modules/features/cms/sanity-pagebuilder-cache/files/components/sanity/visual-editing.tsx +11 -0
  129. package/src/modules/features/cms/sanity-pagebuilder-cache/files/components/ui/sanity-image/index.tsx +51 -0
  130. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/check-integration.ts +6 -0
  131. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/client.ts +37 -0
  132. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/block-actions-item.tsx +81 -0
  133. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/disable-draft-mode.tsx +23 -0
  134. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/page-builder-input.tsx +39 -0
  135. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/page-category-input.tsx +50 -0
  136. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/same-as-input.tsx +66 -0
  137. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/slug-field.tsx +24 -0
  138. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/slug-input.tsx +14 -0
  139. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/slug-notices.tsx +125 -0
  140. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/confirm-publish-action.ts +40 -0
  141. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/env.ts +34 -0
  142. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/fetchers/layout.ts +39 -0
  143. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/fetchers/redirects.ts +22 -0
  144. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/icons.ts +81 -0
  145. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/live/index.tsx +140 -0
  146. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/markdown-proxy.config.ts +50 -0
  147. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/page-builder-config.ts +144 -0
  148. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/page-category.ts +28 -0
  149. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/page-tree-pane.tsx +431 -0
  150. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/pinned-pages.ts +54 -0
  151. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/presentation.ts +119 -0
  152. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/queries.ts +548 -0
  153. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/revalidate-paths.ts +70 -0
  154. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/sanity.cli.ts +29 -0
  155. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/sanity.config.ts +116 -0
  156. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/index.ts +6 -0
  157. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/reusable/blog-content.ts +89 -0
  158. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/reusable/description.ts +29 -0
  159. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/reusable/gated-content.ts +178 -0
  160. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/reusable/hero.ts +28 -0
  161. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/reusable/rich-text-block.ts +39 -0
  162. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/singleton/content-collection.ts +45 -0
  163. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/content/author.ts +70 -0
  164. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/content/blog-category.ts +55 -0
  165. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/index.ts +134 -0
  166. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/layout/company-data.ts +70 -0
  167. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/layout/footer.ts +79 -0
  168. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/layout/navbar.ts +75 -0
  169. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/layout/redirect.ts +152 -0
  170. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/layout/structured-data.ts +124 -0
  171. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/link.ts +125 -0
  172. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/logo-field.ts +9 -0
  173. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/metadata.ts +132 -0
  174. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/nav-objects.ts +192 -0
  175. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/page-builder.ts +43 -0
  176. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/page-folder.ts +124 -0
  177. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/page.ts +265 -0
  178. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/richText.ts +63 -0
  179. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/structured-data-blocks.ts +436 -0
  180. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/singletons.ts +51 -0
  181. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/structure.ts +334 -0
  182. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/tags.ts +89 -0
  183. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/utils/image.ts +8 -0
  184. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/utils/link.ts +140 -0
  185. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/utils/page-builder-markdown.ts +113 -0
  186. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/utils/page-json-ld.ts +208 -0
  187. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/scripts/sanity-typegen.ts +36 -0
  188. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/utils/check-redirect.ts +30 -0
  189. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/utils/json-ld.tsx +522 -0
  190. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/utils/metadata.ts +189 -0
  191. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/utils/rss.ts +96 -0
  192. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/utils/sitemap.ts +58 -0
  193. package/src/modules/features/cms/sanity-pagebuilder-cache/files/proxy.ts +90 -0
  194. package/src/modules/features/env/dotenvx/files/vercelignore +5 -0
  195. package/src/templates/next-default/.env.example +2 -2
  196. package/src/templates/next-default/.github/workflows/ci.yml +1 -1
  197. package/src/templates/next-default/.vscode/settings.json +0 -2
  198. package/src/templates/next-default/components/ui/image/index.tsx +2 -4
  199. package/src/templates/next-default/knip.json +1 -1
  200. package/src/templates/next-default/lefthook.yml +1 -1
  201. package/src/templates/next-default/lib/utils/README.md +18 -5
  202. package/src/templates/next-default/lib/utils/image-sizes.ts +72 -0
  203. package/src/templates/next-default/lib/utils/merge-refs.ts +56 -0
  204. package/src/templates/next-default/lib/utils/strings.ts +1 -51
  205. package/src/templates/next-default/next.config.ts +2 -3
  206. package/src/templates/next-default/package.json +2 -5
  207. package/src/templates/next-experiments/.env.example +2 -2
  208. package/src/templates/next-experiments/.github/workflows/ci.yml +1 -1
  209. package/src/templates/next-experiments/.vscode/settings.json +0 -2
  210. package/src/templates/next-experiments/app/page.tsx +1 -1
  211. package/src/templates/next-experiments/components/ui/image/index.tsx +2 -4
  212. package/src/templates/next-experiments/knip.json +1 -1
  213. package/src/templates/next-experiments/lefthook.yml +1 -1
  214. package/src/templates/next-experiments/lib/utils/README.md +18 -5
  215. package/src/templates/next-experiments/lib/utils/image-sizes.ts +72 -0
  216. package/src/templates/next-experiments/lib/utils/merge-refs.ts +56 -0
  217. package/src/templates/next-experiments/lib/utils/strings.ts +1 -51
  218. package/src/templates/next-experiments/next.config.ts +2 -3
  219. package/src/templates/next-experiments/package.json +2 -5
  220. package/src/templates/next-pagebuilder/.env.example +1 -0
  221. package/src/templates/next-pagebuilder/.github/workflows/ci.yml +1 -1
  222. package/src/templates/next-pagebuilder/.vscode/settings.json +0 -2
  223. package/src/templates/next-pagebuilder/README.md +64 -0
  224. package/src/templates/next-pagebuilder/app/sitemap.xml/route.ts +3 -1
  225. package/src/templates/next-pagebuilder/biome.json +2 -1
  226. package/src/templates/next-pagebuilder/components/layout/footer/index.tsx +3 -6
  227. package/src/templates/next-pagebuilder/components/layout/header/index.tsx +3 -2
  228. package/src/templates/next-pagebuilder/components/layout/json-ld/index.tsx +3 -8
  229. package/src/templates/next-pagebuilder/components/page-builder/components/content-collection/content-filters.tsx +23 -40
  230. package/src/templates/next-pagebuilder/components/page-builder/components/content-collection/index.tsx +88 -58
  231. package/src/templates/next-pagebuilder/components/page-builder/components/content-collection/skeleton.tsx +4 -16
  232. package/src/templates/next-pagebuilder/components/page-builder/components/content-collection/types.ts +14 -1
  233. package/src/templates/next-pagebuilder/components/page-builder/components/rich-text-block.tsx +16 -0
  234. package/src/templates/next-pagebuilder/components/page-builder/renderer.tsx +21 -7
  235. package/src/templates/next-pagebuilder/components/page-document/index.tsx +1 -0
  236. package/src/templates/next-pagebuilder/components/ui/image/index.tsx +2 -1
  237. package/src/templates/next-pagebuilder/knip.json +3 -2
  238. package/src/templates/next-pagebuilder/lefthook.yml +1 -1
  239. package/src/templates/next-pagebuilder/lib/integrations/sanity/sanity.types.ts +1221 -977
  240. package/src/templates/next-pagebuilder/lib/utils/image-sizes.ts +72 -0
  241. package/src/templates/next-pagebuilder/lib/utils/merge-refs.ts +56 -0
  242. package/src/templates/next-pagebuilder/next.config.ts +2 -3
  243. package/src/templates/next-pagebuilder/package.json +4 -6
  244. package/src/templates/next-pagebuilder-cache/.biome/plugins/README.md +21 -0
  245. package/src/templates/next-pagebuilder-cache/.biome/plugins/no-anchor-element.grit +12 -0
  246. package/src/templates/next-pagebuilder-cache/.biome/plugins/no-relative-parent-imports.grit +10 -0
  247. package/src/templates/next-pagebuilder-cache/.biome/plugins/no-unnecessary-forwardref.grit +9 -0
  248. package/src/templates/next-pagebuilder-cache/.env.example +40 -0
  249. package/src/templates/next-pagebuilder-cache/.github/PULL_REQUEST_TEMPLATE.md +13 -0
  250. package/src/templates/next-pagebuilder-cache/.github/workflows/ci.yml +105 -0
  251. package/src/templates/next-pagebuilder-cache/.vscode/extensions.json +19 -0
  252. package/src/templates/next-pagebuilder-cache/.vscode/settings.json +103 -0
  253. package/src/templates/next-pagebuilder-cache/.zed/settings.json +47 -0
  254. package/src/templates/next-pagebuilder-cache/README.md +212 -0
  255. package/src/templates/next-pagebuilder-cache/_gitignore +65 -0
  256. package/src/templates/next-pagebuilder-cache/app/(content)/[[...slug]]/page.tsx +124 -0
  257. package/src/templates/next-pagebuilder-cache/app/(content)/layout.tsx +28 -0
  258. package/src/templates/next-pagebuilder-cache/app/actions/unlock-gated-content.ts +53 -0
  259. package/src/templates/next-pagebuilder-cache/app/favicon.ico +0 -0
  260. package/src/templates/next-pagebuilder-cache/app/layout.tsx +83 -0
  261. package/src/templates/next-pagebuilder-cache/app/robots.ts +13 -0
  262. package/src/templates/next-pagebuilder-cache/app/sitemap.xml/route.ts +84 -0
  263. package/src/templates/next-pagebuilder-cache/biome.json +257 -0
  264. package/src/templates/next-pagebuilder-cache/components/layout/footer/index.tsx +127 -0
  265. package/src/templates/next-pagebuilder-cache/components/layout/header/components/cta-button.tsx +28 -0
  266. package/src/templates/next-pagebuilder-cache/components/layout/header/components/mega-menu-panel.tsx +90 -0
  267. package/src/templates/next-pagebuilder-cache/components/layout/header/components/nav-item-renderer.tsx +98 -0
  268. package/src/templates/next-pagebuilder-cache/components/layout/header/components/nav-leaf-item.tsx +33 -0
  269. package/src/templates/next-pagebuilder-cache/components/layout/header/components/types.ts +7 -0
  270. package/src/templates/next-pagebuilder-cache/components/layout/header/header-client.tsx +110 -0
  271. package/src/templates/next-pagebuilder-cache/components/layout/header/index.tsx +32 -0
  272. package/src/templates/next-pagebuilder-cache/components/layout/json-ld/index.tsx +79 -0
  273. package/src/templates/next-pagebuilder-cache/components/layout/wrapper/index.tsx +33 -0
  274. package/src/templates/next-pagebuilder-cache/components/page-builder/components/article-content/index.tsx +78 -0
  275. package/src/templates/next-pagebuilder-cache/components/page-builder/components/article-content/related-post-item.tsx +27 -0
  276. package/src/templates/next-pagebuilder-cache/components/page-builder/components/content-collection/content-card.tsx +66 -0
  277. package/src/templates/next-pagebuilder-cache/components/page-builder/components/content-collection/content-filters.tsx +76 -0
  278. package/src/templates/next-pagebuilder-cache/components/page-builder/components/content-collection/content-grid.tsx +40 -0
  279. package/src/templates/next-pagebuilder-cache/components/page-builder/components/content-collection/content-pagination-nav.tsx +71 -0
  280. package/src/templates/next-pagebuilder-cache/components/page-builder/components/content-collection/index.tsx +306 -0
  281. package/src/templates/next-pagebuilder-cache/components/page-builder/components/content-collection/skeleton.tsx +41 -0
  282. package/src/templates/next-pagebuilder-cache/components/page-builder/components/content-collection/types.ts +32 -0
  283. package/src/templates/next-pagebuilder-cache/components/page-builder/components/description.tsx +17 -0
  284. package/src/templates/next-pagebuilder-cache/components/page-builder/components/gated-content/index.tsx +169 -0
  285. package/src/templates/next-pagebuilder-cache/components/page-builder/components/hero.tsx +17 -0
  286. package/src/templates/next-pagebuilder-cache/components/page-builder/components/rich-text-block.tsx +16 -0
  287. package/src/templates/next-pagebuilder-cache/components/page-builder/renderer.tsx +71 -0
  288. package/src/templates/next-pagebuilder-cache/components/page-builder/types.ts +25 -0
  289. package/src/templates/next-pagebuilder-cache/components/page-document/index.tsx +147 -0
  290. package/src/templates/next-pagebuilder-cache/components/ui/image/index.tsx +216 -0
  291. package/src/templates/next-pagebuilder-cache/components/ui/link/index.tsx +152 -0
  292. package/src/templates/next-pagebuilder-cache/components.json +24 -0
  293. package/src/templates/next-pagebuilder-cache/knip.json +35 -0
  294. package/src/templates/next-pagebuilder-cache/lefthook.yml +25 -0
  295. package/src/templates/next-pagebuilder-cache/lib/integrations/sanity/sanity.types.ts +1588 -0
  296. package/src/templates/next-pagebuilder-cache/lib/scripts/setup-ci-secrets.ts +117 -0
  297. package/src/templates/next-pagebuilder-cache/lib/styles/cn.ts +5 -0
  298. package/src/templates/next-pagebuilder-cache/lib/styles/global.css +69 -0
  299. package/src/templates/next-pagebuilder-cache/lib/utils/base-url.ts +17 -0
  300. package/src/templates/next-pagebuilder-cache/lib/utils/format-date.ts +8 -0
  301. package/src/templates/next-pagebuilder-cache/lib/utils/slug-tag.ts +6 -0
  302. package/src/templates/next-pagebuilder-cache/next.config.ts +176 -0
  303. package/src/templates/next-pagebuilder-cache/package.json +62 -0
  304. package/src/templates/next-pagebuilder-cache/postcss.config.mjs +65 -0
  305. package/src/templates/next-pagebuilder-cache/svg.d.ts +6 -0
  306. package/src/templates/next-pagebuilder-cache/tsconfig.json +38 -0
  307. package/src/templates/next-webgl/.env.example +2 -2
  308. package/src/templates/next-webgl/.github/workflows/ci.yml +1 -1
  309. package/src/templates/next-webgl/.vscode/settings.json +0 -2
  310. package/src/templates/next-webgl/components/ui/image/index.tsx +2 -4
  311. package/src/templates/next-webgl/knip.json +1 -1
  312. package/src/templates/next-webgl/lefthook.yml +1 -1
  313. package/src/templates/next-webgl/lib/utils/README.md +18 -5
  314. package/src/templates/next-webgl/lib/utils/image-sizes.ts +72 -0
  315. package/src/templates/next-webgl/lib/utils/merge-refs.ts +56 -0
  316. package/src/templates/next-webgl/lib/utils/strings.ts +1 -51
  317. package/src/templates/next-webgl/next.config.ts +2 -3
  318. package/src/templates/next-webgl/package.json +4 -7
  319. package/src/templates/next-experiments/tsconfig.tsbuildinfo +0 -1
  320. package/src/templates/next-pagebuilder/app/actions/refresh.ts +0 -5
  321. package/src/templates/next-webgl/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1,124 @@
1
+ import { defineField, defineType } from "sanity";
2
+ import { apiVersion } from "@/lib/integrations/sanity/env";
3
+ import { pageFolderIcon } from "@/lib/integrations/sanity/icons";
4
+
5
+ type FolderValidationDocument = {
6
+ _id?: string;
7
+ };
8
+
9
+ export const pageFolder = defineType({
10
+ name: "pageFolder",
11
+ title: "Page Folder",
12
+ type: "document",
13
+ icon: pageFolderIcon,
14
+ fields: [
15
+ defineField({
16
+ name: "title",
17
+ title: "Title",
18
+ type: "string",
19
+ validation: (Rule) => Rule.required(),
20
+ }),
21
+ defineField({
22
+ name: "parentFolder",
23
+ title: "Parent Folder",
24
+ type: "reference",
25
+ to: [{ type: "pageFolder" }],
26
+ description: "Optional parent folder for nesting inside the Pages tree.",
27
+ hidden: true,
28
+ options: {
29
+ disableNew: true,
30
+ filter: ({ document }) => {
31
+ const currentId = (document as FolderValidationDocument | undefined)
32
+ ?._id;
33
+ const normalizedId = currentId?.replace(/^drafts\./, "");
34
+
35
+ return normalizedId
36
+ ? {
37
+ filter: `_type == "pageFolder" && !(_id in [$id, "drafts." + $id])`,
38
+ params: { id: normalizedId },
39
+ }
40
+ : { filter: `_type == "pageFolder"` };
41
+ },
42
+ },
43
+ validation: (Rule) =>
44
+ Rule.custom((value, context) => {
45
+ const document = context.document as
46
+ | FolderValidationDocument
47
+ | undefined;
48
+ const currentId = document?._id?.replace(/^drafts\./, "");
49
+
50
+ if (value?._ref && currentId && value._ref === currentId) {
51
+ return "A folder cannot be its own parent";
52
+ }
53
+
54
+ return true;
55
+ }),
56
+ }),
57
+ defineField({
58
+ name: "slug",
59
+ title: "Slug",
60
+ type: "slug",
61
+ description:
62
+ "Required full folder path for organization, for example blog or blog/guides.",
63
+ options: {
64
+ source: "title",
65
+ maxLength: 200,
66
+ },
67
+ validation: (Rule) =>
68
+ Rule.required().custom(async (slug, context) => {
69
+ if (!slug?.current) {
70
+ return "Slug is required";
71
+ }
72
+
73
+ if (!/^[a-z0-9-/]+$/.test(slug.current)) {
74
+ return "Slug must be lowercase with hyphens, letters, numbers, and forward slashes only";
75
+ }
76
+
77
+ if (slug.current.startsWith("/") || slug.current.endsWith("/")) {
78
+ return "Slug must not start or end with a forward slash";
79
+ }
80
+
81
+ const document = context.document as
82
+ | FolderValidationDocument
83
+ | undefined;
84
+ const id = document?._id?.replace(/^drafts\./, "");
85
+
86
+ if (!id) return true;
87
+
88
+ const client = context.getClient({ apiVersion });
89
+ const existing = await client.fetch<number>(
90
+ `count(*[
91
+ _type == "pageFolder" &&
92
+ slug.current == $slug &&
93
+ !(_id in [$id, "drafts." + $id])
94
+ ])`,
95
+ {
96
+ slug: slug.current,
97
+ id,
98
+ },
99
+ );
100
+
101
+ return existing === 0 || "Another page folder already uses this slug";
102
+ }),
103
+ }),
104
+ ],
105
+ preview: {
106
+ select: {
107
+ title: "title",
108
+ slug: "slug.current",
109
+ },
110
+ prepare({ title, slug }) {
111
+ return {
112
+ title: title || "Untitled Folder",
113
+ subtitle: slug ? `/${slug}` : "Folder",
114
+ };
115
+ },
116
+ },
117
+ orderings: [
118
+ {
119
+ title: "Title A-Z",
120
+ name: "titleAsc",
121
+ by: [{ field: "title", direction: "asc" }],
122
+ },
123
+ ],
124
+ });
@@ -0,0 +1,265 @@
1
+ import { defineField, defineType } from "sanity";
2
+ import { SlugField } from "@/lib/integrations/sanity/components/slug-field";
3
+ import { SlugInput } from "@/lib/integrations/sanity/components/slug-input";
4
+ import { apiVersion } from "@/lib/integrations/sanity/env";
5
+ import { pageIcon } from "@/lib/integrations/sanity/icons";
6
+ import {
7
+ getInvalidPageBuilderDocumentTypes,
8
+ getPageBuilderReferenceMemberByDocumentType,
9
+ getPageCategoryIcon,
10
+ type PageBuilderDocumentType,
11
+ type PageBuilderGroupName,
12
+ pageBuilderPageTypes,
13
+ } from "@/lib/integrations/sanity/page-builder-config";
14
+ import { getGeneratedPageCategory } from "@/lib/integrations/sanity/page-category";
15
+ import { getPinnedPageById } from "@/lib/integrations/sanity/pinned-pages";
16
+
17
+ type PageValidationDocument = {
18
+ _id?: string;
19
+ type?: PageBuilderGroupName;
20
+ pageFolder?: {
21
+ _ref?: string;
22
+ };
23
+ slug?: { current?: string | null };
24
+ pageBuilder?: Array<{
25
+ _key?: string;
26
+ _type?: string;
27
+ _ref?: string;
28
+ }>;
29
+ };
30
+
31
+ type PageSlugValidationContext = {
32
+ document?: PageValidationDocument | undefined;
33
+ getClient: (options: { apiVersion: string }) => {
34
+ fetch: <T>(query: string, params?: Record<string, unknown>) => Promise<T>;
35
+ };
36
+ };
37
+
38
+ type ReferencedPageBuilderDocument = {
39
+ _id: string;
40
+ _type: PageBuilderDocumentType;
41
+ };
42
+
43
+ const PAGE_FOLDER_QUERY = `*[_type == "pageFolder" && _id in [$publishedId, $draftId]][0].slug.current`;
44
+
45
+ async function getGeneratedPageCategoryForDocument(
46
+ document: PageValidationDocument | undefined,
47
+ getClient: PageSlugValidationContext["getClient"],
48
+ ) {
49
+ const pageFolderId = document?.pageFolder?._ref?.replace(/^drafts\./, "");
50
+ let folder: string | null = null;
51
+
52
+ if (pageFolderId) {
53
+ folder = await getClient({ apiVersion }).fetch<string | null>(
54
+ PAGE_FOLDER_QUERY,
55
+ { draftId: `drafts.${pageFolderId}`, publishedId: pageFolderId },
56
+ );
57
+ }
58
+
59
+ return getGeneratedPageCategory({
60
+ folder,
61
+ slug: document?.slug?.current ?? null,
62
+ });
63
+ }
64
+
65
+ async function isPageSlugUniqueInFolder(
66
+ slug: string | null,
67
+ context: PageSlugValidationContext,
68
+ ) {
69
+ const id = context.document?._id?.replace(/^drafts\./, "");
70
+
71
+ if (!id) return true;
72
+
73
+ const pageFolderId = context.document?.pageFolder?._ref ?? null;
74
+ const client = context.getClient({ apiVersion });
75
+ const existing = await client.fetch<number>(
76
+ `count(*[
77
+ _type == "page" &&
78
+ !(_id in [$id, "drafts." + $id]) &&
79
+ (
80
+ ($pageFolderId == null && !defined(pageFolder._ref)) ||
81
+ pageFolder._ref == $pageFolderId
82
+ ) &&
83
+ (
84
+ ($slug == null && !defined(slug.current)) ||
85
+ slug.current == $slug
86
+ )
87
+ ])`,
88
+ {
89
+ id,
90
+ pageFolderId,
91
+ slug,
92
+ },
93
+ );
94
+
95
+ return existing === 0;
96
+ }
97
+
98
+ export const page = defineType({
99
+ name: "page",
100
+ title: "Page",
101
+ type: "document",
102
+ icon: pageIcon,
103
+ fields: [
104
+ defineField({
105
+ name: "title",
106
+ title: "Title",
107
+ type: "string",
108
+ validation: (Rule) => Rule.required(),
109
+ }),
110
+ defineField({
111
+ name: "type",
112
+ title: "Page Category",
113
+ type: "string",
114
+ options: { list: pageBuilderPageTypes },
115
+ initialValue: "generic",
116
+ hidden: true,
117
+ readOnly: true,
118
+ }),
119
+ defineField({
120
+ name: "pageFolder",
121
+ title: "Folder",
122
+ type: "reference",
123
+ to: [{ type: "pageFolder" }],
124
+ description: "Optional Studio folder for organizing this page.",
125
+ hidden: true,
126
+ }),
127
+ defineField({
128
+ name: "slug",
129
+ title: "Slug",
130
+ type: "slug",
131
+ description: "URL path without leading slash.",
132
+ readOnly: ({ document }) =>
133
+ getPinnedPageById(document?._id as string | undefined) !== null,
134
+ components: {
135
+ field: SlugField,
136
+ input: SlugInput,
137
+ },
138
+ options: {
139
+ source: "title",
140
+ maxLength: 200,
141
+ isUnique: (slug, context) => isPageSlugUniqueInFolder(slug, context),
142
+ },
143
+ validation: (Rule) =>
144
+ Rule.custom(async (slug, context) => {
145
+ return (
146
+ (await isPageSlugUniqueInFolder(slug?.current ?? null, {
147
+ document: context.document as PageValidationDocument | undefined,
148
+ getClient: context.getClient,
149
+ })) || "Another page in this folder already uses this slug"
150
+ );
151
+ }),
152
+ }),
153
+ defineField({
154
+ name: "pageBuilder",
155
+ title: "Page Builder",
156
+ type: "pageBuilder",
157
+ description: "Composable content blocks for this page",
158
+ validation: (Rule) =>
159
+ Rule.custom(async (value, context) => {
160
+ const document = context.document as
161
+ | PageValidationDocument
162
+ | undefined;
163
+ const pageType = await getGeneratedPageCategoryForDocument(
164
+ document,
165
+ context.getClient,
166
+ );
167
+ const pageBuilderItems = Array.isArray(value)
168
+ ? (value as Array<{ _ref?: string }>)
169
+ : [];
170
+ const referenceIds = pageBuilderItems
171
+ .map((item) => item?._ref?.replace(/^drafts\./, ""))
172
+ .filter((item): item is string => typeof item === "string");
173
+
174
+ if (referenceIds.length === 0) return true;
175
+
176
+ const referencedDocuments = await context
177
+ .getClient({ apiVersion })
178
+ .fetch<ReferencedPageBuilderDocument[]>(
179
+ `*[
180
+ _id in $publishedIds || _id in $draftIds
181
+ ]{
182
+ _id,
183
+ _type
184
+ }`,
185
+ {
186
+ publishedIds: referenceIds,
187
+ draftIds: referenceIds.map((id) => `drafts.${id}`),
188
+ },
189
+ );
190
+
191
+ const invalidDocumentTypes = getInvalidPageBuilderDocumentTypes(
192
+ pageType,
193
+ referencedDocuments.map((entry) => entry._type),
194
+ );
195
+
196
+ if (invalidDocumentTypes.length === 0) return true;
197
+
198
+ const invalidMemberTitles = invalidDocumentTypes.map(
199
+ (documentType) =>
200
+ getPageBuilderReferenceMemberByDocumentType(documentType)
201
+ ?.title ?? documentType,
202
+ );
203
+
204
+ return `These page builder components do not belong to the "${pageType ?? "generic"}" category: ${invalidMemberTitles.join(", ")}`;
205
+ }),
206
+ }),
207
+ defineField({
208
+ name: "collectionCategory",
209
+ title: "Pinned Collection Category",
210
+ type: "reference",
211
+ to: [{ type: "blogCategory" }],
212
+ // Lives on the page because the collection block is deliberately a
213
+ // singleton (see `singletonComponents`) — editors reuse one block rather
214
+ // than creating them, so a category set there would apply site-wide. Move
215
+ // the block to the reusable list if you'd rather scope it per instance.
216
+ description:
217
+ "Turns this page into a category page: the content collection shows only this category. Leave empty to show everything.",
218
+ }),
219
+ defineField({
220
+ name: "hiddenPageBuilderKeys",
221
+ title: "Hidden Blocks",
222
+ type: "array",
223
+ of: [{ type: "string" }],
224
+ // The `_key`s of page builder placements hidden on this page. Managed
225
+ // via each block's Hide/Show action (see BlockActionsItem); never edited
226
+ // directly. Declaring it keeps the Studio from warning about an unknown
227
+ // field. Filtered out at query time in `pageBuilderProjection`.
228
+ hidden: true,
229
+ }),
230
+ defineField({
231
+ name: "metadata",
232
+ title: "SEO & Metadata",
233
+ type: "metadata",
234
+ }),
235
+ ],
236
+ preview: {
237
+ select: {
238
+ id: "_id",
239
+ title: "title",
240
+ folder: "pageFolder->slug.current",
241
+ slug: "slug.current",
242
+ },
243
+ prepare({ folder, id, title, slug }) {
244
+ let path = "No slug";
245
+ const pinned = getPinnedPageById(id as string | undefined);
246
+ if (pinned) {
247
+ path = pinned.path;
248
+ } else if (slug) {
249
+ path = `/${slug}`;
250
+ }
251
+ return {
252
+ title: title || "Untitled",
253
+ subtitle: path,
254
+ media: getPageCategoryIcon(getGeneratedPageCategory({ folder, slug })),
255
+ };
256
+ },
257
+ },
258
+ orderings: [
259
+ {
260
+ title: "Title A-Z",
261
+ name: "titleAsc",
262
+ by: [{ field: "title", direction: "asc" }],
263
+ },
264
+ ],
265
+ });
@@ -0,0 +1,63 @@
1
+ import { defineType } from "sanity";
2
+ import { linkAnnotations } from "./link";
3
+
4
+ export const richText = defineType({
5
+ name: "richText",
6
+ title: "Rich Text",
7
+ type: "array",
8
+ of: [
9
+ {
10
+ type: "block",
11
+ styles: [
12
+ { title: "Normal", value: "normal" },
13
+ { title: "H1", value: "h1" },
14
+ { title: "H2", value: "h2" },
15
+ { title: "H3", value: "h3" },
16
+ { title: "H4", value: "h4" },
17
+ { title: "H5", value: "h5" },
18
+ { title: "H6", value: "h6" },
19
+ { title: "Quote", value: "blockquote" },
20
+ ],
21
+ lists: [
22
+ { title: "Bullet", value: "bullet" },
23
+ { title: "Number", value: "number" },
24
+ ],
25
+ marks: {
26
+ decorators: [
27
+ { title: "Strong", value: "strong" },
28
+ { title: "Emphasis", value: "em" },
29
+ { title: "Code", value: "code" },
30
+ { title: "Underline", value: "underline" },
31
+ { title: "Strike", value: "strike-through" },
32
+ ],
33
+ annotations: linkAnnotations,
34
+ },
35
+ },
36
+ {
37
+ type: "table",
38
+ title: "Table",
39
+ },
40
+ {
41
+ type: "image",
42
+ title: "Image",
43
+ options: {
44
+ hotspot: true,
45
+ },
46
+ fields: [
47
+ {
48
+ name: "alt",
49
+ title: "Alt Text",
50
+ type: "string",
51
+ description: "Alternative text for screen readers",
52
+ validation: (Rule) => Rule.required(),
53
+ },
54
+ {
55
+ name: "caption",
56
+ title: "Caption",
57
+ type: "string",
58
+ description: "Optional caption displayed below the image",
59
+ },
60
+ ],
61
+ },
62
+ ],
63
+ });