bsmnt 0.4.3 → 0.6.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 (266) hide show
  1. package/README.md +1 -0
  2. package/dist/application/add-hooks/index.d.ts.map +1 -1
  3. package/dist/application/add-hooks/index.js +1 -0
  4. package/dist/application/add-hooks/index.js.map +1 -1
  5. package/dist/application/add-integration/index.d.ts +33 -8
  6. package/dist/application/add-integration/index.d.ts.map +1 -1
  7. package/dist/application/add-integration/index.js +221 -90
  8. package/dist/application/add-integration/index.js.map +1 -1
  9. package/dist/application/create-project/build-context.d.ts +3 -1
  10. package/dist/application/create-project/build-context.d.ts.map +1 -1
  11. package/dist/application/create-project/build-context.js +2 -1
  12. package/dist/application/create-project/build-context.js.map +1 -1
  13. package/dist/application/create-project/index.d.ts +3 -1
  14. package/dist/application/create-project/index.d.ts.map +1 -1
  15. package/dist/application/create-project/index.js +4 -2
  16. package/dist/application/create-project/index.js.map +1 -1
  17. package/dist/application/create-project/map-selection-to-registry.js +1 -1
  18. package/dist/application/create-project/map-selection-to-registry.js.map +1 -1
  19. package/dist/application/install-skills/index.js +1 -1
  20. package/dist/application/install-skills/index.js.map +1 -1
  21. package/dist/application/shared/project-detection.d.ts +2 -2
  22. package/dist/application/shared/project-detection.d.ts.map +1 -1
  23. package/dist/application/shared/project-detection.js +2 -2
  24. package/dist/application/shared/project-detection.js.map +1 -1
  25. package/dist/core/create/execute-plan.d.ts +4 -0
  26. package/dist/core/create/execute-plan.d.ts.map +1 -1
  27. package/dist/core/create/execute-plan.js +8 -0
  28. package/dist/core/create/execute-plan.js.map +1 -1
  29. package/dist/core/create/internal-ids.d.ts +4 -1
  30. package/dist/core/create/internal-ids.d.ts.map +1 -1
  31. package/dist/core/create/internal-ids.js +6 -1
  32. package/dist/core/create/internal-ids.js.map +1 -1
  33. package/dist/core/create/types.d.ts +2 -0
  34. package/dist/core/create/types.d.ts.map +1 -1
  35. package/dist/domain/cms.d.ts +0 -7
  36. package/dist/domain/cms.d.ts.map +1 -1
  37. package/dist/domain/cms.js.map +1 -1
  38. package/dist/domain/forms.d.ts +17 -0
  39. package/dist/domain/forms.d.ts.map +1 -0
  40. package/dist/domain/forms.js +13 -0
  41. package/dist/domain/forms.js.map +1 -0
  42. package/dist/domain/integration.d.ts +30 -0
  43. package/dist/domain/integration.d.ts.map +1 -0
  44. package/dist/domain/integration.js +12 -0
  45. package/dist/domain/integration.js.map +1 -0
  46. package/dist/domain/skills.d.ts +58 -0
  47. package/dist/domain/skills.d.ts.map +1 -1
  48. package/dist/domain/skills.js +52 -0
  49. package/dist/domain/skills.js.map +1 -1
  50. package/dist/index.js +114 -38
  51. package/dist/index.js.map +1 -1
  52. package/dist/infrastructure/agents/register-sanity-mcp.js +9 -6
  53. package/dist/infrastructure/agents/register-sanity-mcp.js.map +1 -1
  54. package/dist/infrastructure/create/apply-package-json.d.ts.map +1 -1
  55. package/dist/infrastructure/create/apply-package-json.js +19 -0
  56. package/dist/infrastructure/create/apply-package-json.js.map +1 -1
  57. package/dist/infrastructure/create/executor.d.ts.map +1 -1
  58. package/dist/infrastructure/create/executor.js +5 -0
  59. package/dist/infrastructure/create/executor.js.map +1 -1
  60. package/dist/infrastructure/create/install-dependencies.d.ts.map +1 -1
  61. package/dist/infrastructure/create/install-dependencies.js +4 -0
  62. package/dist/infrastructure/create/install-dependencies.js.map +1 -1
  63. package/dist/infrastructure/create/lifecycle-registry.d.ts.map +1 -1
  64. package/dist/infrastructure/create/lifecycle-registry.js +2 -0
  65. package/dist/infrastructure/create/lifecycle-registry.js.map +1 -1
  66. package/dist/infrastructure/create/merge-registry.d.ts.map +1 -1
  67. package/dist/infrastructure/create/merge-registry.js +8 -0
  68. package/dist/infrastructure/create/merge-registry.js.map +1 -1
  69. package/dist/infrastructure/create/setup-agent.d.ts +2 -0
  70. package/dist/infrastructure/create/setup-agent.d.ts.map +1 -1
  71. package/dist/infrastructure/create/setup-agent.js +32 -8
  72. package/dist/infrastructure/create/setup-agent.js.map +1 -1
  73. package/dist/infrastructure/create/setup-dotenvx.d.ts +41 -0
  74. package/dist/infrastructure/create/setup-dotenvx.d.ts.map +1 -0
  75. package/dist/infrastructure/create/setup-dotenvx.js +502 -0
  76. package/dist/infrastructure/create/setup-dotenvx.js.map +1 -0
  77. package/dist/infrastructure/create/setup-sanity.d.ts +13 -1
  78. package/dist/infrastructure/create/setup-sanity.d.ts.map +1 -1
  79. package/dist/infrastructure/create/setup-sanity.js +74 -31
  80. package/dist/infrastructure/create/setup-sanity.js.map +1 -1
  81. package/dist/infrastructure/integrations/inject-integration.d.ts +3 -3
  82. package/dist/infrastructure/integrations/inject-integration.d.ts.map +1 -1
  83. package/dist/infrastructure/integrations/inject-integration.js +81 -37
  84. package/dist/infrastructure/integrations/inject-integration.js.map +1 -1
  85. package/dist/modules/features/cms/sanity/config.d.ts.map +1 -1
  86. package/dist/modules/features/cms/sanity/config.js +13 -6
  87. package/dist/modules/features/cms/sanity/config.js.map +1 -1
  88. package/dist/modules/features/cms/sanity/index.js +8 -2
  89. package/dist/modules/features/cms/sanity/index.js.map +1 -1
  90. package/dist/modules/features/cms/sanity/mergers/ci-workflow.d.ts +13 -0
  91. package/dist/modules/features/cms/sanity/mergers/ci-workflow.d.ts.map +1 -0
  92. package/dist/modules/features/cms/sanity/mergers/ci-workflow.js +38 -0
  93. package/dist/modules/features/cms/sanity/mergers/ci-workflow.js.map +1 -0
  94. package/dist/modules/features/cms/sanity/mergers/knip.d.ts +12 -0
  95. package/dist/modules/features/cms/sanity/mergers/knip.d.ts.map +1 -0
  96. package/dist/modules/features/cms/sanity/mergers/knip.js +38 -0
  97. package/dist/modules/features/cms/sanity/mergers/knip.js.map +1 -0
  98. package/dist/modules/features/cms/sanity/mergers/layout.d.ts.map +1 -1
  99. package/dist/modules/features/cms/sanity/mergers/layout.js +17 -3
  100. package/dist/modules/features/cms/sanity/mergers/layout.js.map +1 -1
  101. package/dist/modules/features/cms/sanity/mergers/sitemap.d.ts +3 -3
  102. package/dist/modules/features/cms/sanity/mergers/sitemap.d.ts.map +1 -1
  103. package/dist/modules/features/cms/sanity/mergers/sitemap.js +48 -62
  104. package/dist/modules/features/cms/sanity/mergers/sitemap.js.map +1 -1
  105. package/dist/modules/features/cms/sanity-pagebuilder/config.d.ts.map +1 -1
  106. package/dist/modules/features/cms/sanity-pagebuilder/config.js +8 -5
  107. package/dist/modules/features/cms/sanity-pagebuilder/config.js.map +1 -1
  108. package/dist/modules/features/cms/sanity-pagebuilder/index.js +2 -2
  109. package/dist/modules/features/cms/sanity-pagebuilder/index.js.map +1 -1
  110. package/dist/modules/features/env/dotenvx/config.d.ts +13 -0
  111. package/dist/modules/features/env/dotenvx/config.d.ts.map +1 -0
  112. package/dist/modules/features/env/dotenvx/config.js +47 -0
  113. package/dist/modules/features/env/dotenvx/config.js.map +1 -0
  114. package/dist/modules/features/forms/hubspot/config.d.ts +31 -0
  115. package/dist/modules/features/forms/hubspot/config.d.ts.map +1 -0
  116. package/dist/modules/features/forms/hubspot/config.js +25 -0
  117. package/dist/modules/features/forms/hubspot/config.js.map +1 -0
  118. package/dist/paths.d.ts +16 -0
  119. package/dist/paths.d.ts.map +1 -1
  120. package/dist/paths.js +16 -0
  121. package/dist/paths.js.map +1 -1
  122. package/package.json +21 -9
  123. package/src/agent-skills/json-ld/SKILL.md +85 -0
  124. package/src/agent-skills/manage-env/SKILL.md +67 -0
  125. package/src/assets/check-node-version.mjs +22 -0
  126. package/src/modules/features/cms/sanity/files/app/blog/[slug]/page.tsx +48 -21
  127. package/src/modules/features/cms/sanity/files/app/blog/page.tsx +54 -0
  128. package/src/modules/features/cms/sanity/files/app/feed.xml/route.ts +36 -0
  129. package/src/modules/features/cms/sanity/files/components/sanity/structured-data.tsx +83 -0
  130. package/src/modules/features/cms/sanity/files/lib/integrations/sanity/components/disable-draft-mode.tsx +3 -3
  131. package/src/modules/features/cms/sanity/files/lib/integrations/sanity/queries.ts +14 -0
  132. package/src/modules/features/cms/sanity/files/lib/integrations/sanity/sanity.config.ts +19 -3
  133. package/src/modules/features/cms/sanity/files/lib/integrations/sanity/sanity.types.ts +1 -0
  134. package/src/modules/features/cms/sanity/files/lib/integrations/sanity/schemas/article.ts +7 -7
  135. package/src/modules/features/cms/sanity/files/lib/integrations/sanity/schemas/index.ts +36 -1
  136. package/src/modules/features/cms/sanity/files/lib/integrations/sanity/schemas/metadata.ts +12 -1
  137. package/src/modules/features/cms/sanity/files/lib/integrations/sanity/schemas/structured-data-blocks.ts +416 -0
  138. package/src/modules/features/cms/sanity/files/lib/integrations/sanity/schemas/structured-data.ts +100 -0
  139. package/src/modules/features/cms/sanity/files/lib/integrations/sanity/structure.ts +37 -2
  140. package/src/modules/features/cms/sanity/files/lib/integrations/sanity/utils/page-json-ld.ts +208 -0
  141. package/src/modules/features/cms/sanity/files/lib/scripts/setup-ci-secrets.ts +117 -0
  142. package/src/modules/features/cms/sanity/files/lib/utils/rss.ts +96 -0
  143. package/src/modules/features/cms/sanity-pagebuilder/files/.knip.json +8 -0
  144. package/src/modules/features/cms/sanity-pagebuilder/files/app/api/[[...slug]]/route.ts +100 -0
  145. package/src/modules/features/cms/sanity-pagebuilder/files/app/api/draft-mode/disable/route.ts +7 -0
  146. package/src/modules/features/cms/sanity-pagebuilder/files/app/api/draft-mode/enable/route.ts +20 -0
  147. package/src/modules/features/cms/sanity-pagebuilder/files/app/api/revalidate/route.ts +126 -0
  148. package/src/modules/features/cms/sanity-pagebuilder/files/app/feed.xml/route.ts +40 -0
  149. package/src/modules/features/cms/sanity-pagebuilder/files/app/sitemap.md/route.ts +124 -0
  150. package/src/modules/features/cms/sanity-pagebuilder/files/app/studio/[[...tool]]/page.tsx +8 -0
  151. package/src/modules/features/cms/sanity-pagebuilder/files/components/sanity/draft-mode-toggle.tsx +27 -0
  152. package/src/modules/features/cms/sanity-pagebuilder/files/components/sanity/rich-text.tsx +87 -0
  153. package/src/modules/features/cms/sanity-pagebuilder/files/components/sanity/visual-editing.tsx +28 -0
  154. package/src/modules/features/cms/sanity-pagebuilder/files/components/ui/sanity-image/index.tsx +41 -0
  155. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/check-integration.ts +5 -0
  156. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/client.ts +27 -0
  157. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/disable-draft-mode.tsx +23 -0
  158. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/page-builder-input.tsx +39 -0
  159. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/page-category-input.tsx +50 -0
  160. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/same-as-input.tsx +66 -0
  161. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/slug-field.tsx +18 -0
  162. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/slug-input.tsx +14 -0
  163. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/confirm-publish-action.ts +40 -0
  164. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/env.ts +34 -0
  165. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/fetchers/layout.ts +67 -0
  166. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/fetchers/redirects.ts +17 -0
  167. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/icons.ts +79 -0
  168. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/live/index.tsx +88 -0
  169. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/markdown-proxy.config.ts +50 -0
  170. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/page-builder-config.ts +130 -0
  171. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/page-category.ts +28 -0
  172. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/page-tree-pane.tsx +420 -0
  173. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/pinned-pages.ts +54 -0
  174. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/presentation.ts +119 -0
  175. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/queries.ts +407 -0
  176. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/sanity.cli.ts +29 -0
  177. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/sanity.config.ts +113 -0
  178. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/index.ts +4 -0
  179. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/reusable/blog-content.ts +89 -0
  180. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/reusable/description.ts +29 -0
  181. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/reusable/hero.ts +28 -0
  182. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/singleton/content-collection.ts +45 -0
  183. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/content/author.ts +70 -0
  184. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/content/blog-category.ts +55 -0
  185. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/index.ts +124 -0
  186. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/layout/company-data.ts +70 -0
  187. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/layout/footer.ts +79 -0
  188. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/layout/navbar.ts +75 -0
  189. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/layout/redirect.ts +120 -0
  190. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/layout/structured-data.ts +124 -0
  191. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/link.ts +125 -0
  192. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/logo-field.ts +9 -0
  193. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/metadata.ts +79 -0
  194. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/nav-objects.ts +192 -0
  195. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/page-builder.ts +39 -0
  196. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/page-folder.ts +124 -0
  197. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/page.ts +242 -0
  198. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/richText.ts +63 -0
  199. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/structured-data-blocks.ts +436 -0
  200. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/singletons.ts +51 -0
  201. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/structure.ts +330 -0
  202. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/utils/image.ts +8 -0
  203. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/utils/link.ts +140 -0
  204. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/utils/page-builder-markdown.ts +81 -0
  205. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/utils/page-json-ld.ts +208 -0
  206. package/src/modules/features/cms/sanity-pagebuilder/files/lib/scripts/sanity-typegen.ts +45 -0
  207. package/src/modules/features/cms/sanity-pagebuilder/files/lib/utils/check-redirect.ts +30 -0
  208. package/src/modules/features/cms/sanity-pagebuilder/files/lib/utils/json-ld.tsx +521 -0
  209. package/src/modules/features/cms/sanity-pagebuilder/files/lib/utils/metadata.ts +167 -0
  210. package/src/modules/features/cms/sanity-pagebuilder/files/lib/utils/rss.ts +96 -0
  211. package/src/modules/features/cms/sanity-pagebuilder/files/lib/utils/sitemap.ts +40 -0
  212. package/src/modules/features/cms/sanity-pagebuilder/files/proxy.ts +81 -0
  213. package/src/modules/features/env/dotenvx/files/decrypt-env.mjs +45 -0
  214. package/src/modules/features/env/dotenvx/files/gitleaks.yml +25 -0
  215. package/src/modules/features/env/dotenvx/files/instrumentation.ts +14 -0
  216. package/src/modules/features/env/dotenvx/files/push-keys.mjs +129 -0
  217. package/src/modules/features/env/dotenvx/files/save-key.mjs +108 -0
  218. package/src/modules/features/env/dotenvx/files/setup-env.mjs +67 -0
  219. package/src/modules/features/env/dotenvx/files/vercelignore +4 -0
  220. package/src/modules/features/env/dotenvx/files/write-env.mjs +47 -0
  221. package/src/templates/next-default/.env.example +14 -6
  222. package/src/templates/next-default/.github/workflows/ci.yml +83 -0
  223. package/src/templates/next-default/.vscode/extensions.json +3 -0
  224. package/src/templates/next-default/README.md +53 -0
  225. package/src/templates/next-default/knip.json +14 -0
  226. package/src/templates/next-default/lefthook.yml +5 -0
  227. package/src/templates/next-default/lib/utils/json-ld.tsx +327 -21
  228. package/src/templates/next-default/next.config.ts +6 -0
  229. package/src/templates/next-default/package.json +8 -4
  230. package/src/templates/next-experiments/.env.example +14 -6
  231. package/src/templates/next-experiments/.github/workflows/ci.yml +83 -0
  232. package/src/templates/next-experiments/.vscode/extensions.json +3 -0
  233. package/src/templates/next-experiments/README.md +53 -0
  234. package/src/templates/next-experiments/knip.json +14 -0
  235. package/src/templates/next-experiments/lefthook.yml +30 -0
  236. package/src/templates/next-experiments/lib/utils/json-ld.tsx +327 -21
  237. package/src/templates/next-experiments/next.config.ts +6 -0
  238. package/src/templates/next-experiments/package.json +10 -2
  239. package/src/templates/next-pagebuilder/.env.example +19 -1
  240. package/src/templates/next-pagebuilder/.github/workflows/ci.yml +90 -0
  241. package/src/templates/next-pagebuilder/.vscode/extensions.json +3 -0
  242. package/src/templates/next-pagebuilder/README.md +65 -0
  243. package/src/templates/next-pagebuilder/app/(content)/[[...slug]]/page.tsx +6 -1
  244. package/src/templates/next-pagebuilder/app/(content)/layout.tsx +3 -12
  245. package/src/templates/next-pagebuilder/components/layout/footer/index.tsx +11 -10
  246. package/src/templates/next-pagebuilder/components/layout/header/index.tsx +5 -3
  247. package/src/templates/next-pagebuilder/components/layout/json-ld/index.tsx +38 -26
  248. package/src/templates/next-pagebuilder/components/layout/wrapper/index.tsx +3 -11
  249. package/src/templates/next-pagebuilder/components/page-builder/components/content-collection/index.tsx +1 -1
  250. package/src/templates/next-pagebuilder/components/page-document/index.tsx +38 -0
  251. package/src/templates/next-pagebuilder/knip.json +27 -0
  252. package/src/templates/next-pagebuilder/lefthook.yml +5 -0
  253. package/src/templates/next-pagebuilder/lib/integrations/sanity/sanity.types.ts +36 -2
  254. package/src/templates/next-pagebuilder/lib/scripts/setup-ci-secrets.ts +117 -0
  255. package/src/templates/next-pagebuilder/next.config.ts +6 -0
  256. package/src/templates/next-pagebuilder/package.json +9 -3
  257. package/src/templates/next-webgl/.env.example +14 -6
  258. package/src/templates/next-webgl/.github/workflows/ci.yml +83 -0
  259. package/src/templates/next-webgl/.vscode/extensions.json +3 -0
  260. package/src/templates/next-webgl/README.md +53 -0
  261. package/src/templates/next-webgl/knip.json +13 -0
  262. package/src/templates/next-webgl/lefthook.yml +5 -0
  263. package/src/templates/next-webgl/lib/utils/json-ld.tsx +327 -21
  264. package/src/templates/next-webgl/next.config.ts +6 -0
  265. package/src/templates/next-webgl/package.json +8 -4
  266. package/src/modules/features/cms/sanity/files/lib/utils/json-ld.tsx +0 -244
@@ -0,0 +1,436 @@
1
+ import { defineArrayMember, defineField, defineType } from "sanity";
2
+ import {
3
+ customJsonLdIcon,
4
+ eventJsonLdIcon,
5
+ faqJsonLdIcon,
6
+ itemListJsonLdIcon,
7
+ jobPostingJsonLdIcon,
8
+ softwareApplicationJsonLdIcon,
9
+ videoJsonLdIcon,
10
+ } from "@/lib/integrations/sanity/icons";
11
+
12
+ /**
13
+ * Editor-selectable JSON-LD blocks (predefined schema.org types + a raw
14
+ * `customJsonLd` escape hatch), each emitted as its own script tag.
15
+ */
16
+
17
+ export const faqJsonLd = defineType({
18
+ name: "faqJsonLd",
19
+ title: "FAQ",
20
+ type: "object",
21
+ icon: faqJsonLdIcon,
22
+ fields: [
23
+ defineField({
24
+ name: "questions",
25
+ title: "Questions",
26
+ type: "array",
27
+ validation: (Rule) => Rule.min(1),
28
+ of: [
29
+ defineArrayMember({
30
+ type: "object",
31
+ fields: [
32
+ defineField({
33
+ name: "question",
34
+ title: "Question",
35
+ type: "string",
36
+ validation: (Rule) => Rule.required(),
37
+ }),
38
+ defineField({
39
+ name: "answer",
40
+ title: "Answer",
41
+ type: "text",
42
+ rows: 3,
43
+ validation: (Rule) => Rule.required(),
44
+ }),
45
+ ],
46
+ preview: {
47
+ select: { title: "question", subtitle: "answer" },
48
+ },
49
+ }),
50
+ ],
51
+ }),
52
+ ],
53
+ preview: {
54
+ select: { questions: "questions" },
55
+ prepare: ({ questions }) => ({
56
+ title: "FAQ",
57
+ subtitle: `${Array.isArray(questions) ? questions.length : 0} question(s)`,
58
+ }),
59
+ },
60
+ });
61
+
62
+ export const jobPostingJsonLd = defineType({
63
+ name: "jobPostingJsonLd",
64
+ title: "Job Posting",
65
+ type: "object",
66
+ icon: jobPostingJsonLdIcon,
67
+ fields: [
68
+ defineField({
69
+ name: "title",
70
+ title: "Job Title",
71
+ type: "string",
72
+ validation: (Rule) => Rule.required(),
73
+ }),
74
+ defineField({
75
+ name: "description",
76
+ title: "Description",
77
+ type: "text",
78
+ rows: 4,
79
+ validation: (Rule) => Rule.required(),
80
+ }),
81
+ defineField({
82
+ name: "datePosted",
83
+ title: "Date Posted",
84
+ type: "datetime",
85
+ validation: (Rule) => Rule.required(),
86
+ }),
87
+ defineField({
88
+ name: "validThrough",
89
+ title: "Valid Through",
90
+ type: "datetime",
91
+ description: "When the posting expires.",
92
+ }),
93
+ defineField({
94
+ name: "employmentType",
95
+ title: "Employment Type",
96
+ type: "string",
97
+ options: {
98
+ list: [
99
+ { title: "Full-time", value: "FULL_TIME" },
100
+ { title: "Part-time", value: "PART_TIME" },
101
+ { title: "Contractor", value: "CONTRACTOR" },
102
+ { title: "Temporary", value: "TEMPORARY" },
103
+ { title: "Intern", value: "INTERN" },
104
+ { title: "Volunteer", value: "VOLUNTEER" },
105
+ { title: "Per diem", value: "PER_DIEM" },
106
+ { title: "Other", value: "OTHER" },
107
+ ],
108
+ },
109
+ }),
110
+ defineField({
111
+ name: "organizationName",
112
+ title: "Hiring Organization",
113
+ type: "string",
114
+ }),
115
+ defineField({
116
+ name: "organizationUrl",
117
+ title: "Organization URL",
118
+ type: "url",
119
+ }),
120
+ defineField({
121
+ name: "remote",
122
+ title: "Remote / Telecommute",
123
+ type: "boolean",
124
+ initialValue: false,
125
+ }),
126
+ defineField({ name: "locality", title: "City", type: "string" }),
127
+ defineField({ name: "region", title: "Region / State", type: "string" }),
128
+ defineField({ name: "country", title: "Country", type: "string" }),
129
+ ],
130
+ preview: {
131
+ select: { title: "title", subtitle: "organizationName" },
132
+ prepare: ({ title, subtitle }) => ({
133
+ title: title || "Job Posting",
134
+ subtitle: subtitle ? `Job · ${subtitle}` : "Job Posting",
135
+ }),
136
+ },
137
+ });
138
+
139
+ export const softwareApplicationJsonLd = defineType({
140
+ name: "softwareApplicationJsonLd",
141
+ title: "Software Application",
142
+ type: "object",
143
+ icon: softwareApplicationJsonLdIcon,
144
+ fields: [
145
+ defineField({
146
+ name: "name",
147
+ title: "Name",
148
+ type: "string",
149
+ validation: (Rule) => Rule.required(),
150
+ }),
151
+ defineField({
152
+ name: "description",
153
+ title: "Description",
154
+ type: "text",
155
+ rows: 2,
156
+ }),
157
+ defineField({
158
+ name: "applicationCategory",
159
+ title: "Application Category",
160
+ type: "string",
161
+ options: {
162
+ list: [
163
+ { title: "Web application", value: "WebApplication" },
164
+ { title: "Mobile application", value: "MobileApplication" },
165
+ { title: "Developer tool", value: "DeveloperApplication" },
166
+ { title: "Business application", value: "BusinessApplication" },
167
+ { title: "Design application", value: "DesignApplication" },
168
+ { title: "Game", value: "GameApplication" },
169
+ ],
170
+ },
171
+ }),
172
+ defineField({
173
+ name: "operatingSystem",
174
+ title: "Operating System",
175
+ type: "string",
176
+ description: "e.g. 'Web', 'macOS, Windows', 'iOS, Android'.",
177
+ }),
178
+ defineField({
179
+ name: "price",
180
+ title: "Price",
181
+ type: "number",
182
+ description: "Use 0 for free apps. Enables the rich result.",
183
+ }),
184
+ defineField({
185
+ name: "currency",
186
+ title: "Currency",
187
+ type: "string",
188
+ description: "ISO 4217 code, e.g. USD, EUR.",
189
+ initialValue: "USD",
190
+ }),
191
+ defineField({ name: "url", title: "URL", type: "url" }),
192
+ defineField({ name: "image", title: "Screenshot / Icon", type: "image" }),
193
+ ],
194
+ preview: {
195
+ select: { title: "name", subtitle: "applicationCategory" },
196
+ prepare: ({ title, subtitle }) => ({
197
+ title: title || "Software Application",
198
+ subtitle: subtitle ? `App · ${subtitle}` : "Software Application",
199
+ }),
200
+ },
201
+ });
202
+
203
+ export const itemListJsonLd = defineType({
204
+ name: "itemListJsonLd",
205
+ title: "Item List / Carousel",
206
+ type: "object",
207
+ icon: itemListJsonLdIcon,
208
+ description:
209
+ "An ordered list of links (e.g. a carousel of articles or products). Each item points to a page on your site.",
210
+ fields: [
211
+ defineField({
212
+ name: "name",
213
+ title: "List Name",
214
+ type: "string",
215
+ description: "Optional title for the list.",
216
+ }),
217
+ defineField({
218
+ name: "items",
219
+ title: "Items",
220
+ type: "array",
221
+ validation: (Rule) => Rule.min(1),
222
+ of: [
223
+ defineArrayMember({
224
+ type: "object",
225
+ fields: [
226
+ defineField({
227
+ name: "name",
228
+ title: "Name",
229
+ type: "string",
230
+ validation: (Rule) => Rule.required(),
231
+ }),
232
+ defineField({
233
+ name: "url",
234
+ title: "URL",
235
+ type: "url",
236
+ validation: (Rule) => Rule.required(),
237
+ }),
238
+ ],
239
+ preview: {
240
+ select: { title: "name", subtitle: "url" },
241
+ },
242
+ }),
243
+ ],
244
+ }),
245
+ ],
246
+ preview: {
247
+ select: { title: "name", items: "items" },
248
+ prepare: ({ title, items }) => ({
249
+ title: title || "Item List / Carousel",
250
+ subtitle: `${Array.isArray(items) ? items.length : 0} item(s)`,
251
+ }),
252
+ },
253
+ });
254
+
255
+ export const eventJsonLd = defineType({
256
+ name: "eventJsonLd",
257
+ title: "Event",
258
+ type: "object",
259
+ icon: eventJsonLdIcon,
260
+ fields: [
261
+ defineField({
262
+ name: "name",
263
+ title: "Name",
264
+ type: "string",
265
+ validation: (Rule) => Rule.required(),
266
+ }),
267
+ defineField({
268
+ name: "description",
269
+ title: "Description",
270
+ type: "text",
271
+ rows: 2,
272
+ }),
273
+ defineField({
274
+ name: "startDate",
275
+ title: "Start Date",
276
+ type: "datetime",
277
+ validation: (Rule) => Rule.required(),
278
+ }),
279
+ defineField({ name: "endDate", title: "End Date", type: "datetime" }),
280
+ defineField({
281
+ name: "locationName",
282
+ title: "Location Name",
283
+ type: "string",
284
+ description: "Venue name, or leave blank for online events.",
285
+ }),
286
+ defineField({
287
+ name: "locationAddress",
288
+ title: "Location Address",
289
+ type: "string",
290
+ }),
291
+ defineField({
292
+ name: "url",
293
+ title: "Event URL",
294
+ type: "url",
295
+ }),
296
+ defineField({ name: "image", title: "Image", type: "image" }),
297
+ ],
298
+ preview: {
299
+ select: { title: "name", subtitle: "startDate" },
300
+ prepare: ({ title, subtitle }) => ({
301
+ title: title || "Event",
302
+ subtitle: subtitle ? `Event · ${subtitle}` : "Event",
303
+ }),
304
+ },
305
+ });
306
+
307
+ export const videoJsonLd = defineType({
308
+ name: "videoJsonLd",
309
+ title: "Video",
310
+ type: "object",
311
+ icon: videoJsonLdIcon,
312
+ fields: [
313
+ defineField({
314
+ name: "name",
315
+ title: "Name",
316
+ type: "string",
317
+ validation: (Rule) => Rule.required(),
318
+ }),
319
+ defineField({
320
+ name: "description",
321
+ title: "Description",
322
+ type: "text",
323
+ rows: 2,
324
+ validation: (Rule) => Rule.required(),
325
+ }),
326
+ defineField({
327
+ name: "thumbnail",
328
+ title: "Thumbnail",
329
+ type: "image",
330
+ validation: (Rule) => Rule.required(),
331
+ }),
332
+ defineField({
333
+ name: "uploadDate",
334
+ title: "Upload Date",
335
+ type: "datetime",
336
+ validation: (Rule) => Rule.required(),
337
+ }),
338
+ defineField({
339
+ name: "contentUrl",
340
+ title: "Content URL",
341
+ type: "url",
342
+ description: "Direct link to the video file (.mp4, etc.).",
343
+ }),
344
+ defineField({
345
+ name: "embedUrl",
346
+ title: "Embed URL",
347
+ type: "url",
348
+ description: "Player embed URL (YouTube, Vimeo, etc.).",
349
+ }),
350
+ ],
351
+ preview: {
352
+ select: { title: "name" },
353
+ prepare: ({ title }) => ({
354
+ title: title || "Video",
355
+ subtitle: "Video",
356
+ }),
357
+ },
358
+ });
359
+
360
+ export const customJsonLd = defineType({
361
+ name: "customJsonLd",
362
+ title: "Custom JSON-LD",
363
+ type: "object",
364
+ icon: customJsonLdIcon,
365
+ description:
366
+ "Optional JSON-LD block for advanced rich results (FAQ, Product, HowTo, etc.). Emits its own <script> tag. Validate snippets with https://search.google.com/test/rich-results — invalid blocks are skipped at render time.",
367
+ fields: [
368
+ defineField({
369
+ name: "label",
370
+ title: "Internal Label",
371
+ type: "string",
372
+ description:
373
+ "For your reference only (e.g. 'FAQ – pricing tiers'). Not emitted.",
374
+ validation: (Rule) => Rule.required(),
375
+ }),
376
+ defineField({
377
+ name: "json",
378
+ title: "JSON-LD",
379
+ type: "text",
380
+ rows: 10,
381
+ description:
382
+ "Paste a single schema.org JSON-LD object. Omit the <script> wrapper. Must include an @type (@context is added automatically if omitted).",
383
+ validation: (Rule) =>
384
+ Rule.required().custom((value) => {
385
+ if (typeof value !== "string" || value.trim() === "") {
386
+ return "JSON-LD is required";
387
+ }
388
+ try {
389
+ const parsed = JSON.parse(value);
390
+ if (Array.isArray(parsed)) {
391
+ return "Use one block per entry (split arrays into multiple blocks).";
392
+ }
393
+ if (typeof parsed !== "object" || parsed === null) {
394
+ return "Must be a JSON object.";
395
+ }
396
+ if (!("@type" in parsed)) {
397
+ return 'Must include an @type (e.g. "@type": "FAQPage").';
398
+ }
399
+ return true;
400
+ } catch {
401
+ return "Invalid JSON. Use https://jsonlint.com to debug.";
402
+ }
403
+ }),
404
+ }),
405
+ ],
406
+ preview: {
407
+ select: { title: "label", subtitle: "json" },
408
+ prepare: ({ title, subtitle }) => {
409
+ let type: string | undefined;
410
+ if (typeof subtitle === "string") {
411
+ try {
412
+ const parsed = JSON.parse(subtitle);
413
+ if (parsed && typeof parsed === "object" && "@type" in parsed) {
414
+ type = String(parsed["@type"]);
415
+ }
416
+ } catch {
417
+ // ignore — render-time skips invalid blocks
418
+ }
419
+ }
420
+ return {
421
+ title: title || "Custom JSON-LD",
422
+ subtitle: type ? `@type: ${type}` : "JSON-LD",
423
+ };
424
+ },
425
+ },
426
+ });
427
+
428
+ export const pageJsonLdMembers = [
429
+ faqJsonLd,
430
+ eventJsonLd,
431
+ videoJsonLd,
432
+ jobPostingJsonLd,
433
+ softwareApplicationJsonLd,
434
+ itemListJsonLd,
435
+ customJsonLd,
436
+ ] as const;
@@ -0,0 +1,51 @@
1
+ import {
2
+ companyDataIcon,
3
+ footerIcon,
4
+ navbarIcon,
5
+ pageListIcon,
6
+ structuredDataIcon,
7
+ } from "./icons";
8
+
9
+ export const singletonComponents = [
10
+ {
11
+ schemaType: "blogCollection",
12
+ documentId: "blogCollection",
13
+ title: "Blog Collection",
14
+ icon: pageListIcon,
15
+ },
16
+ ] as const;
17
+
18
+ export const singletonLayout = [
19
+ {
20
+ schemaType: "companyData",
21
+ documentId: "companyData",
22
+ title: "Company Data",
23
+ icon: companyDataIcon,
24
+ },
25
+ {
26
+ schemaType: "navbar",
27
+ documentId: "navbar",
28
+ title: "Navbar",
29
+ icon: navbarIcon,
30
+ },
31
+ {
32
+ schemaType: "footer",
33
+ documentId: "footer",
34
+ title: "Footer",
35
+ icon: footerIcon,
36
+ },
37
+ {
38
+ schemaType: "structuredData",
39
+ documentId: "structuredData",
40
+ title: "Structured Data",
41
+ icon: structuredDataIcon,
42
+ },
43
+ ] as const;
44
+
45
+ export const singletonComponentTypes: Set<string> = new Set(
46
+ singletonComponents.map((item) => item.schemaType),
47
+ );
48
+
49
+ export const singletonLayoutTypes: Set<string> = new Set(
50
+ singletonLayout.map((item) => item.schemaType),
51
+ );