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.
- 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/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 +1 -0
- 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 +1 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/components/sanity/visual-editing.tsx +2 -2
- 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/slug-notices.tsx +6 -16
- 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 +7 -0
- 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 +1 -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/index.ts +2 -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/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 +88 -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 +51 -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 +39 -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/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 +144 -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 +6 -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/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 +134 -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 +51 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/structure.ts +334 -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/.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/components/ui/image/index.tsx +2 -4
- 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 +2 -3
- package/src/templates/next-default/package.json +2 -5
- 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/components/ui/image/index.tsx +2 -4
- 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 +2 -3
- package/src/templates/next-experiments/package.json +2 -5
- 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 +2 -1
- 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/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 +2 -1
- 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 +2 -3
- 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-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 +257 -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 +78 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/article-content/related-post-item.tsx +27 -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 +216 -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/slug-tag.ts +6 -0
- package/src/templates/next-pagebuilder-cache/next.config.ts +176 -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/.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/components/ui/image/index.tsx +2 -4
- 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 +2 -3
- 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,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
|
+
});
|