bsmnt 0.10.0 → 0.12.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.
- package/dist/application/add-integration/index.js.map +1 -1
- package/dist/application/shared/node-version.js.map +1 -1
- package/dist/core/create/internal-ids.d.ts +3 -0
- package/dist/core/create/internal-ids.d.ts.map +1 -1
- package/dist/core/create/internal-ids.js +4 -0
- package/dist/core/create/internal-ids.js.map +1 -1
- package/dist/domain/agents.d.ts.map +1 -1
- package/dist/domain/animations.d.ts.map +1 -1
- package/dist/domain/cms.d.ts.map +1 -1
- package/dist/domain/forms.d.ts.map +1 -1
- package/dist/domain/hooks.d.ts.map +1 -1
- package/dist/domain/skills.d.ts.map +1 -1
- package/dist/domain/templates.d.ts +10 -0
- package/dist/domain/templates.d.ts.map +1 -1
- package/dist/domain/templates.js +5 -0
- package/dist/domain/templates.js.map +1 -1
- package/dist/index.js +18 -5
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/agents/register-sanity-mcp.js +3 -8
- package/dist/infrastructure/agents/register-sanity-mcp.js.map +1 -1
- package/dist/infrastructure/agents/register-storybook-mcp.d.ts +18 -0
- package/dist/infrastructure/agents/register-storybook-mcp.d.ts.map +1 -0
- package/dist/infrastructure/agents/register-storybook-mcp.js +157 -0
- package/dist/infrastructure/agents/register-storybook-mcp.js.map +1 -0
- package/dist/infrastructure/create/lifecycle-registry.d.ts.map +1 -1
- package/dist/infrastructure/create/lifecycle-registry.js +39 -1
- package/dist/infrastructure/create/lifecycle-registry.js.map +1 -1
- package/dist/infrastructure/create/merge-registry.d.ts.map +1 -1
- package/dist/infrastructure/create/merge-registry.js +4 -0
- package/dist/infrastructure/create/merge-registry.js.map +1 -1
- package/dist/infrastructure/create/sanity-auth.js.map +1 -1
- package/dist/infrastructure/create/setup-agent.d.ts +6 -1
- package/dist/infrastructure/create/setup-agent.d.ts.map +1 -1
- package/dist/infrastructure/create/setup-agent.js +23 -21
- package/dist/infrastructure/create/setup-agent.js.map +1 -1
- package/dist/infrastructure/create/setup-dotenvx.js.map +1 -1
- package/dist/infrastructure/create/setup-remote.js.map +1 -1
- package/dist/infrastructure/create/setup-sanity.d.ts.map +1 -1
- package/dist/infrastructure/create/setup-sanity.js +12 -1
- package/dist/infrastructure/create/setup-sanity.js.map +1 -1
- package/dist/infrastructure/integrations/inject-integration.d.ts.map +1 -1
- package/dist/infrastructure/integrations/inject-integration.js +2 -0
- package/dist/infrastructure/integrations/inject-integration.js.map +1 -1
- package/dist/infrastructure/update/notifier.js.map +1 -1
- package/dist/modules/features/cms/index.d.ts.map +1 -1
- package/dist/modules/features/cms/index.js +2 -0
- package/dist/modules/features/cms/index.js.map +1 -1
- package/dist/modules/features/cms/sanity/config.d.ts.map +1 -1
- package/dist/modules/features/cms/sanity/config.js +1 -0
- package/dist/modules/features/cms/sanity/config.js.map +1 -1
- package/dist/modules/features/cms/sanity/index.d.ts.map +1 -1
- package/dist/modules/features/cms/sanity/index.js +10 -1
- package/dist/modules/features/cms/sanity/index.js.map +1 -1
- package/dist/modules/features/cms/sanity/mergers/check-integration.d.ts.map +1 -1
- package/dist/modules/features/cms/sanity/mergers/check-integration.js +15 -6
- package/dist/modules/features/cms/sanity/mergers/check-integration.js.map +1 -1
- package/dist/modules/features/cms/sanity/mergers/knip.d.ts.map +1 -1
- package/dist/modules/features/cms/sanity/mergers/knip.js +1 -0
- package/dist/modules/features/cms/sanity/mergers/knip.js.map +1 -1
- package/dist/modules/features/cms/sanity/mergers/layout.js.map +1 -1
- package/dist/modules/features/cms/sanity/mergers/package-json.d.ts +12 -0
- package/dist/modules/features/cms/sanity/mergers/package-json.d.ts.map +1 -0
- package/dist/modules/features/cms/sanity/mergers/package-json.js +19 -0
- package/dist/modules/features/cms/sanity/mergers/package-json.js.map +1 -0
- package/dist/modules/features/cms/sanity-pagebuilder/index.d.ts.map +1 -1
- package/dist/modules/features/cms/sanity-pagebuilder/index.js +7 -1
- package/dist/modules/features/cms/sanity-pagebuilder/index.js.map +1 -1
- package/dist/modules/features/cms/sanity-pagebuilder-cache/config.d.ts +14 -0
- package/dist/modules/features/cms/sanity-pagebuilder-cache/config.d.ts.map +1 -0
- package/dist/modules/features/cms/sanity-pagebuilder-cache/config.js +50 -0
- package/dist/modules/features/cms/sanity-pagebuilder-cache/config.js.map +1 -0
- package/dist/modules/features/cms/sanity-pagebuilder-cache/index.d.ts +3 -0
- package/dist/modules/features/cms/sanity-pagebuilder-cache/index.d.ts.map +1 -0
- package/dist/modules/features/cms/sanity-pagebuilder-cache/index.js +55 -0
- package/dist/modules/features/cms/sanity-pagebuilder-cache/index.js.map +1 -0
- package/dist/modules/presets/index.d.ts.map +1 -1
- package/dist/modules/presets/index.js +2 -0
- package/dist/modules/presets/index.js.map +1 -1
- package/dist/modules/presets/next-pagebuilder-cache.d.ts +3 -0
- package/dist/modules/presets/next-pagebuilder-cache.d.ts.map +1 -0
- package/dist/modules/presets/next-pagebuilder-cache.js +10 -0
- package/dist/modules/presets/next-pagebuilder-cache.js.map +1 -0
- package/dist/paths.d.ts +6 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +6 -0
- package/dist/paths.js.map +1 -1
- package/package.json +5 -2
- package/src/modules/features/cms/sanity/files/components/ui/sanity-image/index.tsx +36 -4
- package/src/modules/features/cms/sanity/files/lib/integrations/check-integration.ts +7 -6
- package/src/modules/features/cms/sanity/files/lib/integrations/sanity/README.md +1 -1
- package/src/modules/features/cms/sanity/files/lib/integrations/sanity/components/rich-text.tsx +8 -1
- package/src/modules/features/cms/sanity/files/lib/integrations/sanity/env.ts +2 -2
- package/src/modules/features/cms/sanity-pagebuilder/files/app/api/[[...slug]]/route.ts +4 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/app/api/revalidate/route.ts +172 -24
- package/src/modules/features/cms/sanity-pagebuilder/files/app/feed.xml/route.ts +14 -7
- package/src/modules/features/cms/sanity-pagebuilder/files/app/sitemap.md/route.ts +2 -2
- package/src/modules/features/cms/sanity-pagebuilder/files/app/studio/[[...tool]]/page.tsx +16 -1
- package/src/modules/features/cms/sanity-pagebuilder/files/components/sanity/rich-text.tsx +8 -1
- package/src/modules/features/cms/sanity-pagebuilder/files/components/sanity/visual-editing.tsx +2 -2
- package/src/modules/features/cms/sanity-pagebuilder/files/components/ui/sanity-image/index.tsx +36 -4
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/check-integration.ts +6 -5
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/client.ts +8 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/page-builder-input.tsx +26 -7
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/page-builder-insert-menu.tsx +242 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/slug-notices.tsx +6 -16
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/use-studio-preview-urls.ts +62 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/env.ts +2 -2
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/fetchers/layout.ts +22 -52
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/icons.ts +2 -2
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/live/index.tsx +3 -1
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/page-builder-config.ts +78 -33
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/page-tree-pane.tsx +70 -57
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/queries.ts +119 -29
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/revalidate-paths.ts +70 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/index.ts +2 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/reusable/rich-text-block.ts +39 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/studio-preview.ts +37 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/index.ts +5 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/page.ts +12 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/singletons.ts +2 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/structure.ts +5 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/tags.ts +56 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/utils/page-builder-markdown.ts +12 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/utils/sitemap.ts +11 -8
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/.knip.json +8 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/app/api/[[...slug]]/route.ts +112 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/app/api/draft-mode/disable/route.ts +7 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/app/api/draft-mode/enable/route.ts +20 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/app/api/revalidate/route.ts +292 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/app/feed.xml/route.ts +66 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/app/sitemap.md/route.ts +132 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/app/studio/[[...tool]]/layout.tsx +26 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/app/studio/[[...tool]]/page.tsx +23 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/components/sanity/draft-mode-toggle.tsx +27 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/components/sanity/rich-text.tsx +94 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/components/sanity/visual-editing.tsx +11 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/components/ui/sanity-image/index.tsx +83 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/check-integration.ts +6 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/client.ts +37 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/block-actions-item.tsx +81 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/disable-draft-mode.tsx +23 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/page-builder-input.tsx +58 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/page-builder-insert-menu.tsx +242 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/page-category-input.tsx +50 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/same-as-input.tsx +66 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/slug-field.tsx +24 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/slug-input.tsx +14 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/slug-notices.tsx +125 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/use-studio-preview-urls.ts +62 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/confirm-publish-action.ts +40 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/env.ts +34 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/fetchers/layout.ts +39 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/fetchers/redirects.ts +22 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/icons.ts +81 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/live/index.tsx +140 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/markdown-proxy.config.ts +50 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/page-builder-config.ts +182 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/page-category.ts +28 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/page-tree-pane.tsx +431 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/pinned-pages.ts +54 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/presentation.ts +119 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/queries.ts +548 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/revalidate-paths.ts +70 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/sanity.cli.ts +29 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/sanity.config.ts +116 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/index.ts +7 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/reusable/blog-content.ts +89 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/reusable/description.ts +29 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/reusable/gated-content.ts +178 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/reusable/hero.ts +28 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/reusable/rich-text-block.ts +39 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/singleton/content-collection.ts +45 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/studio-preview.ts +37 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/content/author.ts +70 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/content/blog-category.ts +55 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/index.ts +137 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/layout/company-data.ts +70 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/layout/footer.ts +79 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/layout/navbar.ts +75 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/layout/redirect.ts +152 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/layout/structured-data.ts +124 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/link.ts +125 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/logo-field.ts +9 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/metadata.ts +132 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/nav-objects.ts +192 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/page-builder.ts +43 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/page-folder.ts +124 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/page.ts +265 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/richText.ts +63 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/structured-data-blocks.ts +436 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/singletons.ts +53 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/structure.ts +339 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/tags.ts +89 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/utils/image.ts +8 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/utils/link.ts +140 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/utils/page-builder-markdown.ts +113 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/utils/page-json-ld.ts +208 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/scripts/sanity-typegen.ts +36 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/utils/check-redirect.ts +30 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/utils/json-ld.tsx +522 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/utils/metadata.ts +189 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/utils/rss.ts +96 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/utils/sitemap.ts +58 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/proxy.ts +90 -0
- package/src/modules/features/env/dotenvx/files/vercelignore +5 -0
- package/src/templates/next-default/.biome/plugins/no-fill-without-sizes.grit +11 -0
- package/src/templates/next-default/.env.example +2 -2
- package/src/templates/next-default/.github/workflows/ci.yml +1 -1
- package/src/templates/next-default/.vscode/settings.json +0 -2
- package/src/templates/next-default/biome.json +2 -1
- package/src/templates/next-default/components/ui/image/index.tsx +21 -15
- package/src/templates/next-default/knip.json +1 -1
- package/src/templates/next-default/lefthook.yml +1 -1
- package/src/templates/next-default/lib/utils/README.md +18 -5
- package/src/templates/next-default/lib/utils/image-sizes.ts +72 -0
- package/src/templates/next-default/lib/utils/merge-refs.ts +56 -0
- package/src/templates/next-default/lib/utils/strings.ts +1 -51
- package/src/templates/next-default/next.config.ts +12 -7
- package/src/templates/next-default/package.json +2 -5
- package/src/templates/next-experiments/.biome/plugins/no-fill-without-sizes.grit +11 -0
- package/src/templates/next-experiments/.env.example +2 -2
- package/src/templates/next-experiments/.github/workflows/ci.yml +1 -1
- package/src/templates/next-experiments/.vscode/settings.json +0 -2
- package/src/templates/next-experiments/app/page.tsx +1 -1
- package/src/templates/next-experiments/biome.json +2 -1
- package/src/templates/next-experiments/components/ui/image/index.tsx +21 -15
- package/src/templates/next-experiments/knip.json +1 -1
- package/src/templates/next-experiments/lefthook.yml +1 -1
- package/src/templates/next-experiments/lib/utils/README.md +18 -5
- package/src/templates/next-experiments/lib/utils/image-sizes.ts +72 -0
- package/src/templates/next-experiments/lib/utils/merge-refs.ts +56 -0
- package/src/templates/next-experiments/lib/utils/strings.ts +1 -51
- package/src/templates/next-experiments/next.config.ts +12 -7
- package/src/templates/next-experiments/package.json +2 -5
- package/src/templates/next-pagebuilder/.biome/plugins/no-fill-without-sizes.grit +11 -0
- package/src/templates/next-pagebuilder/.env.example +1 -0
- package/src/templates/next-pagebuilder/.github/workflows/ci.yml +1 -1
- package/src/templates/next-pagebuilder/.vscode/settings.json +0 -2
- package/src/templates/next-pagebuilder/README.md +64 -0
- package/src/templates/next-pagebuilder/app/sitemap.xml/route.ts +3 -1
- package/src/templates/next-pagebuilder/biome.json +4 -2
- package/src/templates/next-pagebuilder/components/layout/footer/index.tsx +3 -6
- package/src/templates/next-pagebuilder/components/layout/header/index.tsx +3 -2
- package/src/templates/next-pagebuilder/components/layout/json-ld/index.tsx +3 -8
- package/src/templates/next-pagebuilder/components/page-builder/components/article-content/index.tsx +5 -0
- package/src/templates/next-pagebuilder/components/page-builder/components/article-content/related-post-item.tsx +1 -0
- package/src/templates/next-pagebuilder/components/page-builder/components/content-collection/content-filters.tsx +23 -40
- package/src/templates/next-pagebuilder/components/page-builder/components/content-collection/index.tsx +88 -58
- package/src/templates/next-pagebuilder/components/page-builder/components/content-collection/skeleton.tsx +4 -16
- package/src/templates/next-pagebuilder/components/page-builder/components/content-collection/types.ts +14 -1
- package/src/templates/next-pagebuilder/components/page-builder/components/rich-text-block.tsx +16 -0
- package/src/templates/next-pagebuilder/components/page-builder/renderer.tsx +21 -7
- package/src/templates/next-pagebuilder/components/page-document/index.tsx +1 -0
- package/src/templates/next-pagebuilder/components/ui/image/index.tsx +21 -12
- package/src/templates/next-pagebuilder/knip.json +3 -2
- package/src/templates/next-pagebuilder/lefthook.yml +1 -1
- package/src/templates/next-pagebuilder/lib/integrations/sanity/sanity.types.ts +1221 -977
- package/src/templates/next-pagebuilder/lib/utils/image-sizes.ts +72 -0
- package/src/templates/next-pagebuilder/lib/utils/merge-refs.ts +56 -0
- package/src/templates/next-pagebuilder/next.config.ts +6 -6
- package/src/templates/next-pagebuilder/package.json +4 -6
- package/src/templates/next-pagebuilder-cache/.biome/plugins/README.md +21 -0
- package/src/templates/next-pagebuilder-cache/.biome/plugins/no-anchor-element.grit +12 -0
- package/src/templates/next-pagebuilder-cache/.biome/plugins/no-fill-without-sizes.grit +11 -0
- package/src/templates/next-pagebuilder-cache/.biome/plugins/no-relative-parent-imports.grit +10 -0
- package/src/templates/next-pagebuilder-cache/.biome/plugins/no-unnecessary-forwardref.grit +9 -0
- package/src/templates/next-pagebuilder-cache/.env.example +40 -0
- package/src/templates/next-pagebuilder-cache/.github/PULL_REQUEST_TEMPLATE.md +13 -0
- package/src/templates/next-pagebuilder-cache/.github/workflows/ci.yml +105 -0
- package/src/templates/next-pagebuilder-cache/.vscode/extensions.json +19 -0
- package/src/templates/next-pagebuilder-cache/.vscode/settings.json +103 -0
- package/src/templates/next-pagebuilder-cache/.zed/settings.json +47 -0
- package/src/templates/next-pagebuilder-cache/README.md +212 -0
- package/src/templates/next-pagebuilder-cache/_gitignore +65 -0
- package/src/templates/next-pagebuilder-cache/app/(content)/[[...slug]]/page.tsx +124 -0
- package/src/templates/next-pagebuilder-cache/app/(content)/layout.tsx +28 -0
- package/src/templates/next-pagebuilder-cache/app/actions/unlock-gated-content.ts +53 -0
- package/src/templates/next-pagebuilder-cache/app/favicon.ico +0 -0
- package/src/templates/next-pagebuilder-cache/app/layout.tsx +83 -0
- package/src/templates/next-pagebuilder-cache/app/robots.ts +13 -0
- package/src/templates/next-pagebuilder-cache/app/sitemap.xml/route.ts +84 -0
- package/src/templates/next-pagebuilder-cache/biome.json +258 -0
- package/src/templates/next-pagebuilder-cache/components/layout/footer/index.tsx +127 -0
- package/src/templates/next-pagebuilder-cache/components/layout/header/components/cta-button.tsx +28 -0
- package/src/templates/next-pagebuilder-cache/components/layout/header/components/mega-menu-panel.tsx +90 -0
- package/src/templates/next-pagebuilder-cache/components/layout/header/components/nav-item-renderer.tsx +98 -0
- package/src/templates/next-pagebuilder-cache/components/layout/header/components/nav-leaf-item.tsx +33 -0
- package/src/templates/next-pagebuilder-cache/components/layout/header/components/types.ts +7 -0
- package/src/templates/next-pagebuilder-cache/components/layout/header/header-client.tsx +110 -0
- package/src/templates/next-pagebuilder-cache/components/layout/header/index.tsx +32 -0
- package/src/templates/next-pagebuilder-cache/components/layout/json-ld/index.tsx +79 -0
- package/src/templates/next-pagebuilder-cache/components/layout/wrapper/index.tsx +33 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/article-content/index.tsx +83 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/article-content/related-post-item.tsx +28 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/content-collection/content-card.tsx +66 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/content-collection/content-filters.tsx +76 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/content-collection/content-grid.tsx +40 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/content-collection/content-pagination-nav.tsx +71 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/content-collection/index.tsx +306 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/content-collection/skeleton.tsx +41 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/content-collection/types.ts +32 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/description.tsx +17 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/gated-content/index.tsx +169 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/hero.tsx +17 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/rich-text-block.tsx +16 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/renderer.tsx +71 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/types.ts +25 -0
- package/src/templates/next-pagebuilder-cache/components/page-document/index.tsx +147 -0
- package/src/templates/next-pagebuilder-cache/components/ui/image/index.tsx +225 -0
- package/src/templates/next-pagebuilder-cache/components/ui/link/index.tsx +152 -0
- package/src/templates/next-pagebuilder-cache/components.json +24 -0
- package/src/templates/next-pagebuilder-cache/knip.json +35 -0
- package/src/templates/next-pagebuilder-cache/lefthook.yml +25 -0
- package/src/templates/next-pagebuilder-cache/lib/integrations/sanity/sanity.types.ts +1588 -0
- package/src/templates/next-pagebuilder-cache/lib/scripts/setup-ci-secrets.ts +117 -0
- package/src/templates/next-pagebuilder-cache/lib/styles/cn.ts +5 -0
- package/src/templates/next-pagebuilder-cache/lib/styles/global.css +69 -0
- package/src/templates/next-pagebuilder-cache/lib/utils/base-url.ts +17 -0
- package/src/templates/next-pagebuilder-cache/lib/utils/format-date.ts +8 -0
- package/src/templates/next-pagebuilder-cache/lib/utils/image-sizes.ts +72 -0
- package/src/templates/next-pagebuilder-cache/lib/utils/slug-tag.ts +6 -0
- package/src/templates/next-pagebuilder-cache/next.config.ts +177 -0
- package/src/templates/next-pagebuilder-cache/package.json +62 -0
- package/src/templates/next-pagebuilder-cache/postcss.config.mjs +65 -0
- package/src/templates/next-pagebuilder-cache/svg.d.ts +6 -0
- package/src/templates/next-pagebuilder-cache/tsconfig.json +38 -0
- package/src/templates/next-webgl/.biome/plugins/no-fill-without-sizes.grit +11 -0
- package/src/templates/next-webgl/.env.example +2 -2
- package/src/templates/next-webgl/.github/workflows/ci.yml +1 -1
- package/src/templates/next-webgl/.vscode/settings.json +0 -2
- package/src/templates/next-webgl/biome.json +2 -1
- package/src/templates/next-webgl/components/ui/image/index.tsx +21 -15
- package/src/templates/next-webgl/knip.json +1 -1
- package/src/templates/next-webgl/lefthook.yml +1 -1
- package/src/templates/next-webgl/lib/utils/README.md +18 -5
- package/src/templates/next-webgl/lib/utils/image-sizes.ts +72 -0
- package/src/templates/next-webgl/lib/utils/merge-refs.ts +56 -0
- package/src/templates/next-webgl/lib/utils/strings.ts +1 -51
- package/src/templates/next-webgl/next.config.ts +12 -7
- package/src/templates/next-webgl/package.json +4 -7
- package/src/templates/next-experiments/tsconfig.tsbuildinfo +0 -1
- package/src/templates/next-pagebuilder/app/actions/refresh.ts +0 -5
- package/src/templates/next-webgl/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { table } from "@sanity/table";
|
|
2
|
+
import { defineConfig } from "sanity";
|
|
3
|
+
import { structureTool } from "sanity/structure";
|
|
4
|
+
import { media } from "sanity-plugin-media";
|
|
5
|
+
import { createConfirmPublishAction } from "./confirm-publish-action";
|
|
6
|
+
import { dataset, projectId } from "./env";
|
|
7
|
+
import { PINNED_PAGE_ENTRIES, PINNED_PAGE_IDS } from "./pinned-pages";
|
|
8
|
+
import { presentation } from "./presentation";
|
|
9
|
+
import { schema } from "./schemas";
|
|
10
|
+
import { singletonComponentTypes } from "./singletons";
|
|
11
|
+
import { structure } from "./structure";
|
|
12
|
+
|
|
13
|
+
const isProd = process.env.NODE_ENV === "production";
|
|
14
|
+
|
|
15
|
+
const singletonDocumentActions = new Set([
|
|
16
|
+
"publish",
|
|
17
|
+
"discardChanges",
|
|
18
|
+
"restore",
|
|
19
|
+
]);
|
|
20
|
+
|
|
21
|
+
const isSingletonDocument = (schemaType: string, documentId?: string) =>
|
|
22
|
+
singletonComponentTypes.has(schemaType) ||
|
|
23
|
+
(schemaType === "page" &&
|
|
24
|
+
documentId !== undefined &&
|
|
25
|
+
PINNED_PAGE_IDS.has(documentId));
|
|
26
|
+
|
|
27
|
+
export default defineConfig({
|
|
28
|
+
basePath: "/studio",
|
|
29
|
+
projectId,
|
|
30
|
+
dataset,
|
|
31
|
+
// Content Releases is an Enterprise-only feature; hide it from the Studio.
|
|
32
|
+
releases: { enabled: false },
|
|
33
|
+
scheduledDrafts: { enabled: false },
|
|
34
|
+
schema: {
|
|
35
|
+
...schema,
|
|
36
|
+
templates: (previousTemplates) => [
|
|
37
|
+
...previousTemplates.filter(
|
|
38
|
+
(template) =>
|
|
39
|
+
!PINNED_PAGE_IDS.has(template.id) &&
|
|
40
|
+
!["page-with-folder", "page-folder-with-parent"].includes(
|
|
41
|
+
template.id,
|
|
42
|
+
),
|
|
43
|
+
),
|
|
44
|
+
...PINNED_PAGE_ENTRIES.map((entry) => ({
|
|
45
|
+
id: entry.id,
|
|
46
|
+
title: entry.title,
|
|
47
|
+
schemaType: "page",
|
|
48
|
+
value: {
|
|
49
|
+
title: entry.title,
|
|
50
|
+
...(entry.slug ? { slug: { current: entry.slug } } : {}),
|
|
51
|
+
},
|
|
52
|
+
})),
|
|
53
|
+
{
|
|
54
|
+
id: "page-with-folder",
|
|
55
|
+
title: "Page in Folder",
|
|
56
|
+
schemaType: "page",
|
|
57
|
+
parameters: [
|
|
58
|
+
{ name: "pageFolderId", title: "Page Folder ID", type: "string" },
|
|
59
|
+
],
|
|
60
|
+
value: ({ pageFolderId }: { pageFolderId?: string }) => ({
|
|
61
|
+
pageFolder: pageFolderId
|
|
62
|
+
? {
|
|
63
|
+
_type: "reference",
|
|
64
|
+
_ref: pageFolderId,
|
|
65
|
+
}
|
|
66
|
+
: undefined,
|
|
67
|
+
}),
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
id: "page-folder-with-parent",
|
|
71
|
+
title: "Page Folder in Folder",
|
|
72
|
+
schemaType: "pageFolder",
|
|
73
|
+
parameters: [
|
|
74
|
+
{ name: "parentFolderId", title: "Parent Folder ID", type: "string" },
|
|
75
|
+
],
|
|
76
|
+
value: ({ parentFolderId }: { parentFolderId?: string }) => ({
|
|
77
|
+
parentFolder: parentFolderId
|
|
78
|
+
? {
|
|
79
|
+
_type: "reference",
|
|
80
|
+
_ref: parentFolderId,
|
|
81
|
+
}
|
|
82
|
+
: undefined,
|
|
83
|
+
}),
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
document: {
|
|
88
|
+
actions: (previousActions, context) => {
|
|
89
|
+
const filtered = isSingletonDocument(
|
|
90
|
+
context.schemaType,
|
|
91
|
+
context.documentId,
|
|
92
|
+
)
|
|
93
|
+
? previousActions.filter(
|
|
94
|
+
(action) =>
|
|
95
|
+
action.action !== undefined &&
|
|
96
|
+
singletonDocumentActions.has(action.action),
|
|
97
|
+
)
|
|
98
|
+
: previousActions;
|
|
99
|
+
|
|
100
|
+
if (!isProd) return filtered;
|
|
101
|
+
|
|
102
|
+
return filtered.map((action) =>
|
|
103
|
+
action.action === "publish"
|
|
104
|
+
? createConfirmPublishAction(action)
|
|
105
|
+
: action,
|
|
106
|
+
);
|
|
107
|
+
},
|
|
108
|
+
newDocumentOptions: (previousOptions) =>
|
|
109
|
+
previousOptions.filter(
|
|
110
|
+
(option) =>
|
|
111
|
+
!singletonComponentTypes.has(option.templateId) &&
|
|
112
|
+
!PINNED_PAGE_IDS.has(option.templateId),
|
|
113
|
+
),
|
|
114
|
+
},
|
|
115
|
+
plugins: [structureTool({ structure }), presentation, media(), table()],
|
|
116
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { blogContent } from "./reusable/blog-content";
|
|
2
|
+
export { description } from "./reusable/description";
|
|
3
|
+
export { gatedContent } from "./reusable/gated-content";
|
|
4
|
+
export { hero } from "./reusable/hero";
|
|
5
|
+
export { richTextBlock } from "./reusable/rich-text-block";
|
|
6
|
+
export { blogCollection } from "./singleton/content-collection";
|
|
7
|
+
export { studioPreview } from "./studio-preview";
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { defineField, defineType } from "sanity";
|
|
2
|
+
import { contentIcon } from "@/lib/integrations/sanity/icons";
|
|
3
|
+
|
|
4
|
+
export const blogContent = defineType({
|
|
5
|
+
name: "blogContent",
|
|
6
|
+
title: "Blog Content",
|
|
7
|
+
type: "document",
|
|
8
|
+
icon: contentIcon,
|
|
9
|
+
fields: [
|
|
10
|
+
defineField({
|
|
11
|
+
name: "title",
|
|
12
|
+
title: "Title",
|
|
13
|
+
type: "string",
|
|
14
|
+
validation: (Rule) => Rule.required(),
|
|
15
|
+
}),
|
|
16
|
+
defineField({
|
|
17
|
+
name: "thumbnail",
|
|
18
|
+
title: "Thumbnail",
|
|
19
|
+
type: "image",
|
|
20
|
+
description: "Featured image for the article",
|
|
21
|
+
options: { hotspot: true },
|
|
22
|
+
fields: [
|
|
23
|
+
{
|
|
24
|
+
name: "alt",
|
|
25
|
+
title: "Alt Text",
|
|
26
|
+
type: "string",
|
|
27
|
+
description: "Alternative text for screen readers",
|
|
28
|
+
validation: (Rule) => Rule.required(),
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
}),
|
|
32
|
+
defineField({
|
|
33
|
+
name: "categories",
|
|
34
|
+
title: "Categories",
|
|
35
|
+
type: "array",
|
|
36
|
+
of: [{ type: "reference", to: [{ type: "blogCategory" }] }],
|
|
37
|
+
description: "Category tags for filtering",
|
|
38
|
+
}),
|
|
39
|
+
defineField({
|
|
40
|
+
name: "date",
|
|
41
|
+
title: "Publication Date",
|
|
42
|
+
type: "date",
|
|
43
|
+
options: { dateFormat: "YYYY-MM-DD" },
|
|
44
|
+
}),
|
|
45
|
+
defineField({
|
|
46
|
+
name: "author",
|
|
47
|
+
title: "Author",
|
|
48
|
+
type: "reference",
|
|
49
|
+
to: [{ type: "author" }],
|
|
50
|
+
}),
|
|
51
|
+
defineField({
|
|
52
|
+
name: "body",
|
|
53
|
+
title: "Body",
|
|
54
|
+
type: "richText",
|
|
55
|
+
description: "Article content",
|
|
56
|
+
}),
|
|
57
|
+
defineField({
|
|
58
|
+
name: "relatedPosts",
|
|
59
|
+
title: "Related Posts",
|
|
60
|
+
type: "array",
|
|
61
|
+
of: [
|
|
62
|
+
{
|
|
63
|
+
type: "reference",
|
|
64
|
+
to: [{ type: "page" }],
|
|
65
|
+
options: {
|
|
66
|
+
filter:
|
|
67
|
+
'pageFolder->slug.current == "blog" && defined(slug.current) && slug.current != ""',
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
description: "Manually curated related blog pages",
|
|
72
|
+
validation: (Rule) => Rule.max(3),
|
|
73
|
+
}),
|
|
74
|
+
],
|
|
75
|
+
preview: {
|
|
76
|
+
select: {
|
|
77
|
+
title: "title",
|
|
78
|
+
date: "date",
|
|
79
|
+
media: "thumbnail",
|
|
80
|
+
},
|
|
81
|
+
prepare({ title, date, media }) {
|
|
82
|
+
return {
|
|
83
|
+
title: title || "Blog Content",
|
|
84
|
+
subtitle: date || "No date set",
|
|
85
|
+
media,
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { defineField, defineType } from "sanity";
|
|
2
|
+
import { descriptionIcon } from "@/lib/integrations/sanity/icons";
|
|
3
|
+
|
|
4
|
+
export const description = defineType({
|
|
5
|
+
name: "description",
|
|
6
|
+
title: "Description",
|
|
7
|
+
type: "document",
|
|
8
|
+
icon: descriptionIcon,
|
|
9
|
+
fields: [
|
|
10
|
+
defineField({
|
|
11
|
+
name: "description",
|
|
12
|
+
title: "Description",
|
|
13
|
+
type: "text",
|
|
14
|
+
rows: 4,
|
|
15
|
+
validation: (Rule) => Rule.required(),
|
|
16
|
+
}),
|
|
17
|
+
],
|
|
18
|
+
preview: {
|
|
19
|
+
select: {
|
|
20
|
+
description: "description",
|
|
21
|
+
},
|
|
22
|
+
prepare({ description }) {
|
|
23
|
+
return {
|
|
24
|
+
title: "Description",
|
|
25
|
+
subtitle: description || "Untitled",
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
});
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { defineField, defineType } from "sanity";
|
|
2
|
+
import { gatedContentIcon } from "@/lib/integrations/sanity/icons";
|
|
3
|
+
|
|
4
|
+
type GatedContentParent = { kind?: string };
|
|
5
|
+
|
|
6
|
+
const getKindLabel = (kind: unknown) => {
|
|
7
|
+
if (kind === "file") return "File";
|
|
8
|
+
if (kind === "video") return "Video";
|
|
9
|
+
return "Rich Text";
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const requiredForKind =
|
|
13
|
+
(kind: string, message: string) =>
|
|
14
|
+
(value: unknown, context: { parent?: unknown }) => {
|
|
15
|
+
const parent = context.parent as GatedContentParent | undefined;
|
|
16
|
+
if (parent?.kind !== kind) return true;
|
|
17
|
+
const isEmpty =
|
|
18
|
+
value == null || (Array.isArray(value) && value.length === 0);
|
|
19
|
+
return isEmpty ? message : true;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const gatedContent = defineType({
|
|
23
|
+
name: "gatedContent",
|
|
24
|
+
title: "Gated Content",
|
|
25
|
+
type: "document",
|
|
26
|
+
icon: gatedContentIcon,
|
|
27
|
+
description:
|
|
28
|
+
"Content hidden behind a lead-capture gate. Everyone sees the teaser; the payload is withheld from the page until the visitor submits the form.",
|
|
29
|
+
groups: [
|
|
30
|
+
{ name: "teaser", title: "Teaser", default: true },
|
|
31
|
+
{ name: "gate", title: "Gate" },
|
|
32
|
+
{ name: "content", title: "Gated Content" },
|
|
33
|
+
],
|
|
34
|
+
fields: [
|
|
35
|
+
defineField({
|
|
36
|
+
name: "internalTitle",
|
|
37
|
+
title: "Internal Title",
|
|
38
|
+
type: "string",
|
|
39
|
+
description: "Only used to identify this block in the Studio.",
|
|
40
|
+
validation: (Rule) => Rule.required(),
|
|
41
|
+
}),
|
|
42
|
+
defineField({
|
|
43
|
+
name: "teaserHeading",
|
|
44
|
+
title: "Teaser Heading",
|
|
45
|
+
type: "string",
|
|
46
|
+
group: "teaser",
|
|
47
|
+
}),
|
|
48
|
+
defineField({
|
|
49
|
+
name: "teaserBody",
|
|
50
|
+
title: "Teaser Body",
|
|
51
|
+
type: "richText",
|
|
52
|
+
group: "teaser",
|
|
53
|
+
description: "Shown to everyone, above the gate.",
|
|
54
|
+
}),
|
|
55
|
+
defineField({
|
|
56
|
+
name: "gateType",
|
|
57
|
+
title: "Unlock With",
|
|
58
|
+
type: "string",
|
|
59
|
+
group: "gate",
|
|
60
|
+
initialValue: "form",
|
|
61
|
+
options: {
|
|
62
|
+
list: [{ title: "Form submission", value: "form" }],
|
|
63
|
+
layout: "radio",
|
|
64
|
+
},
|
|
65
|
+
validation: (Rule) => Rule.required(),
|
|
66
|
+
}),
|
|
67
|
+
defineField({
|
|
68
|
+
name: "gateHeadline",
|
|
69
|
+
title: "Gate Headline",
|
|
70
|
+
type: "string",
|
|
71
|
+
group: "gate",
|
|
72
|
+
initialValue: "Unlock the full content",
|
|
73
|
+
}),
|
|
74
|
+
defineField({
|
|
75
|
+
name: "gateDescription",
|
|
76
|
+
title: "Gate Description",
|
|
77
|
+
type: "text",
|
|
78
|
+
rows: 3,
|
|
79
|
+
group: "gate",
|
|
80
|
+
}),
|
|
81
|
+
defineField({
|
|
82
|
+
name: "submitLabel",
|
|
83
|
+
title: "Submit Button Label",
|
|
84
|
+
type: "string",
|
|
85
|
+
group: "gate",
|
|
86
|
+
initialValue: "Unlock",
|
|
87
|
+
}),
|
|
88
|
+
defineField({
|
|
89
|
+
name: "successMessage",
|
|
90
|
+
title: "Success Message",
|
|
91
|
+
type: "string",
|
|
92
|
+
group: "gate",
|
|
93
|
+
description: "Shown briefly after the gate is unlocked.",
|
|
94
|
+
}),
|
|
95
|
+
defineField({
|
|
96
|
+
name: "kind",
|
|
97
|
+
title: "Content Type",
|
|
98
|
+
type: "string",
|
|
99
|
+
group: "content",
|
|
100
|
+
initialValue: "richText",
|
|
101
|
+
options: {
|
|
102
|
+
list: [
|
|
103
|
+
{ title: "Rich Text", value: "richText" },
|
|
104
|
+
{ title: "File (PDF, etc.)", value: "file" },
|
|
105
|
+
{ title: "Video", value: "video" },
|
|
106
|
+
],
|
|
107
|
+
layout: "radio",
|
|
108
|
+
},
|
|
109
|
+
validation: (Rule) => Rule.required(),
|
|
110
|
+
}),
|
|
111
|
+
defineField({
|
|
112
|
+
name: "content",
|
|
113
|
+
title: "Rich Text",
|
|
114
|
+
type: "richText",
|
|
115
|
+
group: "content",
|
|
116
|
+
description: "Revealed once the visitor completes the unlock action.",
|
|
117
|
+
hidden: ({ parent }) => (parent as GatedContentParent)?.kind !== "richText",
|
|
118
|
+
validation: (Rule) =>
|
|
119
|
+
Rule.custom(requiredForKind("richText", "Rich text is required.")),
|
|
120
|
+
}),
|
|
121
|
+
defineField({
|
|
122
|
+
name: "file",
|
|
123
|
+
title: "File",
|
|
124
|
+
type: "file",
|
|
125
|
+
group: "content",
|
|
126
|
+
description: "PDF or other downloadable asset, revealed on unlock.",
|
|
127
|
+
options: { accept: ".pdf,.doc,.docx,.zip,.epub,.csv,.xlsx" },
|
|
128
|
+
hidden: ({ parent }) => (parent as GatedContentParent)?.kind !== "file",
|
|
129
|
+
validation: (Rule) =>
|
|
130
|
+
Rule.custom((value: unknown, context) => {
|
|
131
|
+
const parent = context.parent as GatedContentParent | undefined;
|
|
132
|
+
if (parent?.kind !== "file") return true;
|
|
133
|
+
const asset = (value as { asset?: unknown } | undefined)?.asset;
|
|
134
|
+
return asset ? true : "A file is required.";
|
|
135
|
+
}),
|
|
136
|
+
}),
|
|
137
|
+
defineField({
|
|
138
|
+
name: "videoUrl",
|
|
139
|
+
title: "Video URL",
|
|
140
|
+
type: "url",
|
|
141
|
+
group: "content",
|
|
142
|
+
description: "External embed URL (YouTube, Vimeo, Mux…).",
|
|
143
|
+
hidden: ({ parent }) => (parent as GatedContentParent)?.kind !== "video",
|
|
144
|
+
}),
|
|
145
|
+
defineField({
|
|
146
|
+
name: "videoFile",
|
|
147
|
+
title: "Video File",
|
|
148
|
+
type: "file",
|
|
149
|
+
group: "content",
|
|
150
|
+
description: "Uploaded video, used when no Video URL is set.",
|
|
151
|
+
options: { accept: "video/*" },
|
|
152
|
+
hidden: ({ parent }) => (parent as GatedContentParent)?.kind !== "video",
|
|
153
|
+
validation: (Rule) =>
|
|
154
|
+
Rule.custom((value: unknown, context) => {
|
|
155
|
+
const parent = context.parent as
|
|
156
|
+
| (GatedContentParent & { videoUrl?: string })
|
|
157
|
+
| undefined;
|
|
158
|
+
if (parent?.kind !== "video") return true;
|
|
159
|
+
const asset = (value as { asset?: unknown } | undefined)?.asset;
|
|
160
|
+
if (parent?.videoUrl || asset) return true;
|
|
161
|
+
return "Add a Video URL or upload a video file.";
|
|
162
|
+
}),
|
|
163
|
+
}),
|
|
164
|
+
],
|
|
165
|
+
preview: {
|
|
166
|
+
select: {
|
|
167
|
+
title: "internalTitle",
|
|
168
|
+
heading: "teaserHeading",
|
|
169
|
+
kind: "kind",
|
|
170
|
+
},
|
|
171
|
+
prepare({ title, heading, kind }) {
|
|
172
|
+
return {
|
|
173
|
+
title: title || heading || "Gated Content",
|
|
174
|
+
subtitle: `Gated Content · ${getKindLabel(kind)}`,
|
|
175
|
+
};
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { defineField, defineType } from "sanity";
|
|
2
|
+
import { heroIcon } from "@/lib/integrations/sanity/icons";
|
|
3
|
+
|
|
4
|
+
export const hero = defineType({
|
|
5
|
+
name: "hero",
|
|
6
|
+
title: "Heading",
|
|
7
|
+
type: "document",
|
|
8
|
+
icon: heroIcon,
|
|
9
|
+
fields: [
|
|
10
|
+
defineField({
|
|
11
|
+
name: "headline",
|
|
12
|
+
title: "Heading",
|
|
13
|
+
type: "string",
|
|
14
|
+
validation: (Rule) => Rule.required(),
|
|
15
|
+
}),
|
|
16
|
+
],
|
|
17
|
+
preview: {
|
|
18
|
+
select: {
|
|
19
|
+
title: "headline",
|
|
20
|
+
},
|
|
21
|
+
prepare({ title }) {
|
|
22
|
+
return {
|
|
23
|
+
title: title || "Untitled",
|
|
24
|
+
subtitle: "Heading",
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { defineField, defineType } from "sanity";
|
|
2
|
+
import { richTextIcon } from "@/lib/integrations/sanity/icons";
|
|
3
|
+
|
|
4
|
+
export const richTextBlock = defineType({
|
|
5
|
+
name: "richTextBlock",
|
|
6
|
+
title: "Rich Text",
|
|
7
|
+
type: "document",
|
|
8
|
+
icon: richTextIcon,
|
|
9
|
+
fields: [
|
|
10
|
+
defineField({
|
|
11
|
+
name: "content",
|
|
12
|
+
title: "Content",
|
|
13
|
+
type: "richText",
|
|
14
|
+
validation: (Rule) => Rule.required(),
|
|
15
|
+
}),
|
|
16
|
+
],
|
|
17
|
+
preview: {
|
|
18
|
+
select: {
|
|
19
|
+
content: "content",
|
|
20
|
+
},
|
|
21
|
+
prepare({ content }) {
|
|
22
|
+
// Portable Text has no plain-text field, so derive a subtitle from the
|
|
23
|
+
// first block's spans.
|
|
24
|
+
const firstBlock = Array.isArray(content) ? content[0] : null;
|
|
25
|
+
const spans = Array.isArray(firstBlock?.children)
|
|
26
|
+
? firstBlock.children
|
|
27
|
+
: [];
|
|
28
|
+
const text = spans
|
|
29
|
+
.map((span: { text?: string }) => span?.text ?? "")
|
|
30
|
+
.join("")
|
|
31
|
+
.trim();
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
title: "Rich Text",
|
|
35
|
+
subtitle: text || "Empty",
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { defineField, defineType } from "sanity";
|
|
2
|
+
import type { SanityStudioIcon } from "@/lib/integrations/sanity/icons";
|
|
3
|
+
import { pageListIcon } from "@/lib/integrations/sanity/icons";
|
|
4
|
+
|
|
5
|
+
function createContentCollection(config: {
|
|
6
|
+
name: string;
|
|
7
|
+
title: string;
|
|
8
|
+
icon: SanityStudioIcon;
|
|
9
|
+
label: string;
|
|
10
|
+
}) {
|
|
11
|
+
return defineType({
|
|
12
|
+
name: config.name,
|
|
13
|
+
title: config.title,
|
|
14
|
+
type: "document",
|
|
15
|
+
icon: config.icon,
|
|
16
|
+
description: `This component contains all the ${config.label}`,
|
|
17
|
+
fields: [
|
|
18
|
+
defineField({
|
|
19
|
+
name: "subtitle",
|
|
20
|
+
title: "Subtitle",
|
|
21
|
+
type: "string",
|
|
22
|
+
description:
|
|
23
|
+
"Text displayed between the featured articles and the rest of the collection",
|
|
24
|
+
}),
|
|
25
|
+
],
|
|
26
|
+
preview: {
|
|
27
|
+
select: {
|
|
28
|
+
title: "title",
|
|
29
|
+
},
|
|
30
|
+
prepare({ title }) {
|
|
31
|
+
return {
|
|
32
|
+
title: title || config.title,
|
|
33
|
+
subtitle: `${config.title} with search and category filters`,
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const blogCollection = createContentCollection({
|
|
41
|
+
name: "blogCollection",
|
|
42
|
+
title: "Blog Collection",
|
|
43
|
+
icon: pageListIcon,
|
|
44
|
+
label: "blog articles",
|
|
45
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineField, defineType } from "sanity";
|
|
2
|
+
import { pageBuilderCardIcon } from "@/lib/integrations/sanity/icons";
|
|
3
|
+
import { pageBuilderBlockPreviewOptions } from "@/lib/integrations/sanity/page-builder-config";
|
|
4
|
+
|
|
5
|
+
export const studioPreview = defineType({
|
|
6
|
+
name: "studioPreview",
|
|
7
|
+
title: "Component Preview",
|
|
8
|
+
type: "document",
|
|
9
|
+
icon: pageBuilderCardIcon,
|
|
10
|
+
fields: [
|
|
11
|
+
defineField({
|
|
12
|
+
name: "key",
|
|
13
|
+
title: "Component",
|
|
14
|
+
type: "string",
|
|
15
|
+
options: { list: pageBuilderBlockPreviewOptions },
|
|
16
|
+
validation: (Rule) => Rule.required(),
|
|
17
|
+
}),
|
|
18
|
+
defineField({
|
|
19
|
+
name: "preview",
|
|
20
|
+
title: "Preview image",
|
|
21
|
+
type: "image",
|
|
22
|
+
options: { hotspot: true },
|
|
23
|
+
validation: (Rule) => Rule.required(),
|
|
24
|
+
}),
|
|
25
|
+
],
|
|
26
|
+
preview: {
|
|
27
|
+
select: { key: "key", media: "preview" },
|
|
28
|
+
prepare({ key, media }) {
|
|
29
|
+
return {
|
|
30
|
+
title:
|
|
31
|
+
pageBuilderBlockPreviewOptions.find((option) => option.value === key)
|
|
32
|
+
?.title ?? "Component Preview",
|
|
33
|
+
media,
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { defineField, defineType } from "sanity";
|
|
2
|
+
import { authorIcon } from "@/lib/integrations/sanity/icons";
|
|
3
|
+
|
|
4
|
+
export const author = defineType({
|
|
5
|
+
name: "author",
|
|
6
|
+
title: "Author",
|
|
7
|
+
type: "document",
|
|
8
|
+
icon: authorIcon,
|
|
9
|
+
fields: [
|
|
10
|
+
defineField({
|
|
11
|
+
name: "name",
|
|
12
|
+
title: "Name",
|
|
13
|
+
type: "string",
|
|
14
|
+
validation: (Rule) => Rule.required(),
|
|
15
|
+
}),
|
|
16
|
+
defineField({
|
|
17
|
+
name: "avatar",
|
|
18
|
+
title: "Avatar",
|
|
19
|
+
type: "image",
|
|
20
|
+
options: {
|
|
21
|
+
hotspot: true,
|
|
22
|
+
},
|
|
23
|
+
fields: [
|
|
24
|
+
{
|
|
25
|
+
name: "alt",
|
|
26
|
+
title: "Alt Text",
|
|
27
|
+
type: "string",
|
|
28
|
+
description: "Alternative text for screen readers",
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
validation: (Rule) => Rule.required(),
|
|
32
|
+
}),
|
|
33
|
+
defineField({
|
|
34
|
+
name: "role",
|
|
35
|
+
title: "Role",
|
|
36
|
+
type: "string",
|
|
37
|
+
description: "Job title or role (e.g. CEO, Engineering Lead)",
|
|
38
|
+
}),
|
|
39
|
+
defineField({
|
|
40
|
+
name: "description",
|
|
41
|
+
title: "Description",
|
|
42
|
+
type: "text",
|
|
43
|
+
rows: 3,
|
|
44
|
+
description: "Short bio displayed on blog articles",
|
|
45
|
+
}),
|
|
46
|
+
defineField({
|
|
47
|
+
name: "linkedInUrl",
|
|
48
|
+
title: "LinkedIn URL",
|
|
49
|
+
type: "url",
|
|
50
|
+
validation: (Rule) =>
|
|
51
|
+
Rule.uri({
|
|
52
|
+
scheme: ["https"],
|
|
53
|
+
}),
|
|
54
|
+
}),
|
|
55
|
+
],
|
|
56
|
+
preview: {
|
|
57
|
+
select: {
|
|
58
|
+
title: "name",
|
|
59
|
+
subtitle: "role",
|
|
60
|
+
media: "avatar",
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
orderings: [
|
|
64
|
+
{
|
|
65
|
+
title: "Name A-Z",
|
|
66
|
+
name: "nameAsc",
|
|
67
|
+
by: [{ field: "name", direction: "asc" }],
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { defineField, defineType } from "sanity";
|
|
2
|
+
import { blogCategoryIcon } from "@/lib/integrations/sanity/icons";
|
|
3
|
+
|
|
4
|
+
export const blogCategory = defineType({
|
|
5
|
+
name: "blogCategory",
|
|
6
|
+
title: "Blog Category",
|
|
7
|
+
type: "document",
|
|
8
|
+
icon: blogCategoryIcon,
|
|
9
|
+
fields: [
|
|
10
|
+
defineField({
|
|
11
|
+
name: "title",
|
|
12
|
+
title: "Title",
|
|
13
|
+
type: "string",
|
|
14
|
+
description: "Category name (e.g. AI, Product Updates, Engineering)",
|
|
15
|
+
validation: (Rule) => Rule.required(),
|
|
16
|
+
}),
|
|
17
|
+
defineField({
|
|
18
|
+
name: "slug",
|
|
19
|
+
title: "Slug",
|
|
20
|
+
type: "slug",
|
|
21
|
+
description: "URL-friendly identifier used for filtering",
|
|
22
|
+
options: {
|
|
23
|
+
source: "title",
|
|
24
|
+
maxLength: 96,
|
|
25
|
+
},
|
|
26
|
+
validation: (Rule) =>
|
|
27
|
+
Rule.required().custom((slug) => {
|
|
28
|
+
if (!slug?.current) return "Required";
|
|
29
|
+
if (!/^[a-z0-9-]+$/.test(slug.current)) {
|
|
30
|
+
return "Slug must be lowercase with hyphens only";
|
|
31
|
+
}
|
|
32
|
+
return true;
|
|
33
|
+
}),
|
|
34
|
+
}),
|
|
35
|
+
defineField({
|
|
36
|
+
name: "description",
|
|
37
|
+
title: "Description",
|
|
38
|
+
type: "text",
|
|
39
|
+
rows: 2,
|
|
40
|
+
description: "Brief description of this category",
|
|
41
|
+
}),
|
|
42
|
+
],
|
|
43
|
+
preview: {
|
|
44
|
+
select: {
|
|
45
|
+
title: "title",
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
orderings: [
|
|
49
|
+
{
|
|
50
|
+
title: "Title A-Z",
|
|
51
|
+
name: "titleAsc",
|
|
52
|
+
by: [{ field: "title", direction: "asc" }],
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
});
|