bsmnt 0.4.0 → 0.4.2
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/{helpers/add → application/add-hooks}/index.d.ts +4 -4
- package/dist/application/add-hooks/index.d.ts.map +1 -0
- package/dist/{helpers/add → application/add-hooks}/index.js +22 -35
- package/dist/application/add-hooks/index.js.map +1 -0
- package/dist/{utils → application/add-integration}/format-results.d.ts +1 -6
- package/dist/application/add-integration/format-results.d.ts.map +1 -0
- package/dist/{utils → application/add-integration}/format-results.js +1 -6
- package/dist/application/add-integration/format-results.js.map +1 -0
- package/dist/{helpers/integrate → application/add-integration}/index.d.ts +2 -1
- package/dist/application/add-integration/index.d.ts.map +1 -0
- package/dist/{helpers/integrate → application/add-integration}/index.js +46 -41
- package/dist/application/add-integration/index.js.map +1 -0
- package/dist/application/create-project/build-context.d.ts +9 -0
- package/dist/application/create-project/build-context.d.ts.map +1 -0
- package/dist/application/create-project/build-context.js +13 -0
- package/dist/application/create-project/build-context.js.map +1 -0
- package/dist/application/create-project/index.d.ts +44 -0
- package/dist/application/create-project/index.d.ts.map +1 -0
- package/dist/application/create-project/index.js +70 -0
- package/dist/application/create-project/index.js.map +1 -0
- package/dist/application/create-project/map-selection-to-registry.d.ts +3 -0
- package/dist/application/create-project/map-selection-to-registry.d.ts.map +1 -0
- package/dist/application/create-project/map-selection-to-registry.js +30 -0
- package/dist/application/create-project/map-selection-to-registry.js.map +1 -0
- package/dist/application/create-project/resolve-selection.d.ts +15 -0
- package/dist/application/create-project/resolve-selection.d.ts.map +1 -0
- package/dist/application/create-project/resolve-selection.js +11 -0
- package/dist/application/create-project/resolve-selection.js.map +1 -0
- package/dist/{helpers/skills → application/install-skills}/index.d.ts +1 -1
- package/dist/application/install-skills/index.d.ts.map +1 -0
- package/dist/{helpers/skills → application/install-skills}/index.js +31 -44
- package/dist/application/install-skills/index.js.map +1 -0
- package/dist/{utils/detect-project.d.ts → application/shared/project-detection.d.ts} +8 -15
- package/dist/application/shared/project-detection.d.ts.map +1 -0
- package/dist/{utils/detect-project.js → application/shared/project-detection.js} +8 -24
- package/dist/application/shared/project-detection.js.map +1 -0
- package/dist/core/create/build-plan.d.ts +8 -0
- package/dist/core/create/build-plan.d.ts.map +1 -0
- package/dist/core/create/build-plan.js +89 -0
- package/dist/core/create/build-plan.js.map +1 -0
- package/dist/core/create/execute-plan.d.ts +23 -0
- package/dist/core/create/execute-plan.d.ts.map +1 -0
- package/dist/core/create/execute-plan.js +23 -0
- package/dist/core/create/execute-plan.js.map +1 -0
- package/dist/core/create/internal-ids.d.ts +23 -0
- package/dist/core/create/internal-ids.d.ts.map +1 -0
- package/dist/core/create/internal-ids.js +36 -0
- package/dist/core/create/internal-ids.js.map +1 -0
- package/dist/core/create/registry.d.ts +12 -0
- package/dist/core/create/registry.d.ts.map +1 -0
- package/dist/core/create/registry.js +33 -0
- package/dist/core/create/registry.js.map +1 -0
- package/dist/core/create/types.d.ts +96 -0
- package/dist/core/create/types.d.ts.map +1 -0
- package/dist/core/create/types.js +2 -0
- package/dist/core/create/types.js.map +1 -0
- package/dist/domain/agents.d.ts +61 -0
- package/dist/domain/agents.d.ts.map +1 -0
- package/dist/domain/agents.js +35 -0
- package/dist/domain/agents.js.map +1 -0
- package/dist/domain/animations.d.ts +20 -0
- package/dist/domain/animations.d.ts.map +1 -0
- package/dist/domain/animations.js +13 -0
- package/dist/domain/animations.js.map +1 -0
- package/dist/domain/cms.d.ts +24 -0
- package/dist/domain/cms.d.ts.map +1 -0
- package/dist/domain/cms.js +13 -0
- package/dist/domain/cms.js.map +1 -0
- package/dist/domain/hooks.d.ts +67 -0
- package/dist/domain/hooks.d.ts.map +1 -0
- package/dist/domain/hooks.js +52 -0
- package/dist/domain/hooks.js.map +1 -0
- package/dist/domain/skills.d.ts +70 -0
- package/dist/domain/skills.d.ts.map +1 -0
- package/dist/domain/skills.js +84 -0
- package/dist/domain/skills.js.map +1 -0
- package/dist/domain/templates.d.ts +51 -0
- package/dist/domain/templates.d.ts.map +1 -0
- package/dist/domain/templates.js +27 -0
- package/dist/domain/templates.js.map +1 -0
- package/dist/index.js +124 -115
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/agents/register-sanity-mcp.d.ts +12 -0
- package/dist/infrastructure/agents/register-sanity-mcp.d.ts.map +1 -0
- package/dist/infrastructure/agents/register-sanity-mcp.js +153 -0
- package/dist/infrastructure/agents/register-sanity-mcp.js.map +1 -0
- package/dist/infrastructure/create/apply-copy-paths.d.ts +3 -0
- package/dist/infrastructure/create/apply-copy-paths.d.ts.map +1 -0
- package/dist/infrastructure/create/apply-copy-paths.js +12 -0
- package/dist/infrastructure/create/apply-copy-paths.js.map +1 -0
- package/dist/infrastructure/create/apply-merge-paths.d.ts +3 -0
- package/dist/infrastructure/create/apply-merge-paths.d.ts.map +1 -0
- package/dist/infrastructure/create/apply-merge-paths.js +17 -0
- package/dist/infrastructure/create/apply-merge-paths.js.map +1 -0
- package/dist/infrastructure/create/apply-package-json.d.ts +8 -0
- package/dist/infrastructure/create/apply-package-json.d.ts.map +1 -0
- package/dist/infrastructure/create/apply-package-json.js +46 -0
- package/dist/infrastructure/create/apply-package-json.js.map +1 -0
- package/dist/infrastructure/create/copy-template.d.ts +10 -0
- package/dist/infrastructure/create/copy-template.d.ts.map +1 -0
- package/dist/infrastructure/create/copy-template.js.map +1 -0
- package/dist/infrastructure/create/executor.d.ts +3 -0
- package/dist/infrastructure/create/executor.d.ts.map +1 -0
- package/dist/infrastructure/create/executor.js +21 -0
- package/dist/infrastructure/create/executor.js.map +1 -0
- package/dist/{helpers/create/init-git.d.ts → infrastructure/create/init-git-repo.d.ts} +2 -3
- package/dist/infrastructure/create/init-git-repo.d.ts.map +1 -0
- package/dist/{helpers/create/init-git.js → infrastructure/create/init-git-repo.js} +1 -4
- package/dist/infrastructure/create/init-git-repo.js.map +1 -0
- package/dist/{helpers/create/install.d.ts → infrastructure/create/install-dependencies.d.ts} +1 -1
- package/dist/infrastructure/create/install-dependencies.d.ts.map +1 -0
- package/dist/{helpers/create/install.js → infrastructure/create/install-dependencies.js} +1 -1
- package/dist/infrastructure/create/install-dependencies.js.map +1 -0
- package/dist/infrastructure/create/lifecycle-registry.d.ts +3 -0
- package/dist/infrastructure/create/lifecycle-registry.d.ts.map +1 -0
- package/dist/infrastructure/create/lifecycle-registry.js +38 -0
- package/dist/infrastructure/create/lifecycle-registry.js.map +1 -0
- package/dist/infrastructure/create/merge-registry.d.ts +3 -0
- package/dist/infrastructure/create/merge-registry.d.ts.map +1 -0
- package/dist/infrastructure/create/merge-registry.js +27 -0
- package/dist/infrastructure/create/merge-registry.js.map +1 -0
- package/dist/infrastructure/create/rename-files.d.ts.map +1 -0
- package/dist/infrastructure/create/rename-files.js.map +1 -0
- package/dist/{helpers → infrastructure}/create/setup-agent.d.ts +9 -7
- package/dist/infrastructure/create/setup-agent.d.ts.map +1 -0
- package/dist/infrastructure/create/setup-agent.js +77 -0
- package/dist/infrastructure/create/setup-agent.js.map +1 -0
- package/dist/infrastructure/create/setup-sanity.d.ts.map +1 -0
- package/dist/{helpers → infrastructure}/create/setup-sanity.js +1 -19
- package/dist/infrastructure/create/setup-sanity.js.map +1 -0
- package/dist/infrastructure/integrations/inject-integration.d.ts +9 -0
- package/dist/infrastructure/integrations/inject-integration.d.ts.map +1 -0
- package/dist/{helpers/integrate/merge-orchestrator.js → infrastructure/integrations/inject-integration.js} +26 -38
- package/dist/infrastructure/integrations/inject-integration.js.map +1 -0
- package/dist/modules/features/agents/index.d.ts +3 -0
- package/dist/modules/features/agents/index.d.ts.map +1 -0
- package/dist/modules/features/agents/index.js +4 -0
- package/dist/modules/features/agents/index.js.map +1 -0
- package/dist/modules/features/agents/shared.d.ts +4 -0
- package/dist/modules/features/agents/shared.d.ts.map +1 -0
- package/dist/modules/features/agents/shared.js +21 -0
- package/dist/modules/features/agents/shared.js.map +1 -0
- package/dist/{configs/animations.d.ts → modules/features/animation/config.d.ts} +1 -1
- package/dist/modules/features/animation/config.d.ts.map +1 -0
- package/dist/{configs/animations.js → modules/features/animation/config.js} +1 -1
- package/dist/modules/features/animation/config.js.map +1 -0
- package/dist/modules/features/animation/gsap.d.ts +3 -0
- package/dist/modules/features/animation/gsap.d.ts.map +1 -0
- package/dist/modules/features/animation/gsap.js +16 -0
- package/dist/modules/features/animation/gsap.js.map +1 -0
- package/dist/modules/features/animation/index.d.ts +3 -0
- package/dist/modules/features/animation/index.d.ts.map +1 -0
- package/dist/modules/features/animation/index.js +4 -0
- package/dist/modules/features/animation/index.js.map +1 -0
- package/dist/modules/features/animation/motion.d.ts +3 -0
- package/dist/modules/features/animation/motion.d.ts.map +1 -0
- package/dist/modules/features/animation/motion.js +16 -0
- package/dist/modules/features/animation/motion.js.map +1 -0
- package/dist/modules/features/cms/index.d.ts +3 -0
- package/dist/modules/features/cms/index.d.ts.map +1 -0
- package/dist/modules/features/cms/index.js +7 -0
- package/dist/modules/features/cms/index.js.map +1 -0
- package/dist/modules/features/cms/sanity/config.d.ts.map +1 -0
- package/dist/{helpers/integrate → modules/features/cms}/sanity/config.js +3 -2
- package/dist/modules/features/cms/sanity/config.js.map +1 -0
- package/dist/modules/features/cms/sanity/index.d.ts +3 -0
- package/dist/modules/features/cms/sanity/index.d.ts.map +1 -0
- package/dist/modules/features/cms/sanity/index.js +61 -0
- package/dist/modules/features/cms/sanity/index.js.map +1 -0
- package/dist/{helpers/integrate/sanity/mergers/check-integration-merger.d.ts → modules/features/cms/sanity/mergers/check-integration.d.ts} +1 -1
- package/dist/modules/features/cms/sanity/mergers/check-integration.d.ts.map +1 -0
- package/dist/{helpers/integrate/sanity/mergers/check-integration-merger.js → modules/features/cms/sanity/mergers/check-integration.js} +1 -1
- package/dist/modules/features/cms/sanity/mergers/check-integration.js.map +1 -0
- package/dist/{helpers/integrate/sanity/mergers/layout-merger.d.ts → modules/features/cms/sanity/mergers/layout.d.ts} +1 -1
- package/dist/modules/features/cms/sanity/mergers/layout.d.ts.map +1 -0
- package/dist/{helpers/integrate/sanity/mergers/layout-merger.js → modules/features/cms/sanity/mergers/layout.js} +1 -1
- package/dist/modules/features/cms/sanity/mergers/layout.js.map +1 -0
- package/dist/modules/features/cms/sanity/mergers/sitemap.d.ts +13 -0
- package/dist/modules/features/cms/sanity/mergers/sitemap.d.ts.map +1 -0
- package/dist/modules/features/cms/sanity/mergers/sitemap.js +92 -0
- package/dist/modules/features/cms/sanity/mergers/sitemap.js.map +1 -0
- package/dist/modules/features/cms/sanity-pagebuilder/config.d.ts +14 -0
- package/dist/modules/features/cms/sanity-pagebuilder/config.d.ts.map +1 -0
- package/dist/modules/features/cms/sanity-pagebuilder/config.js +44 -0
- package/dist/modules/features/cms/sanity-pagebuilder/config.js.map +1 -0
- package/dist/modules/features/cms/sanity-pagebuilder/index.d.ts +3 -0
- package/dist/modules/features/cms/sanity-pagebuilder/index.d.ts.map +1 -0
- package/dist/modules/features/cms/sanity-pagebuilder/index.js +46 -0
- package/dist/modules/features/cms/sanity-pagebuilder/index.js.map +1 -0
- package/dist/modules/features/hooks/factory.d.ts +4 -0
- package/dist/modules/features/hooks/factory.d.ts.map +1 -0
- package/dist/modules/features/hooks/factory.js +26 -0
- package/dist/modules/features/hooks/factory.js.map +1 -0
- package/dist/modules/features/hooks/index.d.ts +3 -0
- package/dist/modules/features/hooks/index.d.ts.map +1 -0
- package/dist/modules/features/hooks/index.js +4 -0
- package/dist/modules/features/hooks/index.js.map +1 -0
- package/dist/modules/presets/index.d.ts +3 -0
- package/dist/modules/presets/index.d.ts.map +1 -0
- package/dist/modules/presets/index.js +11 -0
- package/dist/modules/presets/index.js.map +1 -0
- package/dist/modules/presets/next-default.d.ts +3 -0
- package/dist/modules/presets/next-default.d.ts.map +1 -0
- package/dist/modules/presets/next-default.js +9 -0
- package/dist/modules/presets/next-default.js.map +1 -0
- package/dist/modules/presets/next-experiments.d.ts +3 -0
- package/dist/modules/presets/next-experiments.d.ts.map +1 -0
- package/dist/modules/presets/next-experiments.js +9 -0
- package/dist/modules/presets/next-experiments.js.map +1 -0
- package/dist/modules/presets/next-pagebuilder.d.ts +3 -0
- package/dist/modules/presets/next-pagebuilder.d.ts.map +1 -0
- package/dist/modules/presets/next-pagebuilder.js +10 -0
- package/dist/modules/presets/next-pagebuilder.js.map +1 -0
- package/dist/modules/presets/next-webgl.d.ts +3 -0
- package/dist/modules/presets/next-webgl.d.ts.map +1 -0
- package/dist/modules/presets/next-webgl.js +9 -0
- package/dist/modules/presets/next-webgl.js.map +1 -0
- package/dist/paths.d.ts +7 -1
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +8 -2
- package/dist/paths.js.map +1 -1
- package/index.js +2 -2
- package/package.json +11 -4
- package/src/modules/features/cms/sanity/files/.knip.json +8 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/app/api/blog/[slug]/route.ts +3 -4
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/app/api/revalidate/route.ts +1 -4
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/app/blog/[slug]/page.tsx +8 -9
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/app/layout.tsx +2 -2
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/app/sitemap.md/route.ts +18 -29
- package/src/modules/features/cms/sanity/files/app/sitemap.xml/route.ts +51 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/env.ts +2 -4
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/queries.ts +0 -42
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/schemas/index.ts +1 -1
- package/src/modules/features/cms/sanity/files/lib/scripts/copy-sanity-mcp.ts +23 -0
- package/src/modules/features/cms/sanity/files/lib/scripts/generate-page.ts +297 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/utils/json-ld.tsx +1 -6
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/utils/metadata.ts +2 -2
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/utils/url.ts +4 -2
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/proxy.ts +11 -11
- package/src/template-hooks/use-device-perf.ts +27 -17
- package/src/templates/next-default/.env.example +3 -3
- package/src/templates/next-default/.vscode/extensions.json +1 -5
- package/src/templates/next-default/.vscode/settings.json +1 -1
- package/src/templates/next-default/.zed/settings.json +47 -0
- package/src/templates/next-default/README.md +7 -6
- package/src/templates/next-default/_gitignore +1 -3
- package/src/templates/next-default/app/layout.tsx +21 -35
- package/src/templates/next-default/app/robots.ts +3 -4
- package/src/templates/next-default/app/sitemap.xml/route.ts +29 -29
- package/src/templates/next-default/biome.json +9 -2
- package/src/templates/next-default/components/ui/image/index.tsx +2 -1
- package/src/templates/next-default/components/ui/link/index.tsx +35 -35
- package/src/templates/next-default/lefthook.yml +25 -0
- package/src/templates/next-default/lib/README.md +8 -4
- package/src/templates/next-default/lib/hooks/use-media.ts +6 -3
- package/src/templates/next-default/lib/scripts/dev.ts +32 -0
- package/src/templates/next-default/lib/styles/README.md +13 -0
- package/src/templates/next-default/lib/styles/fonts.ts +20 -0
- package/src/templates/next-default/lib/styles/global.css +15 -196
- package/src/templates/next-default/lib/styles/index.css +3 -0
- package/src/templates/next-default/lib/styles/tokens.css +182 -0
- package/src/templates/next-default/lib/utils/README.md +40 -0
- package/src/templates/next-default/lib/utils/easings.ts +240 -0
- package/src/templates/next-default/lib/utils/fetch.ts +84 -0
- package/src/templates/next-default/lib/utils/global-css.d.ts +1 -0
- package/src/templates/next-default/lib/utils/json-ld.tsx +70 -68
- package/src/templates/next-default/lib/utils/math.ts +236 -0
- package/src/templates/next-default/lib/utils/metadata.ts +26 -27
- package/src/templates/next-default/lib/utils/strings.ts +246 -0
- package/src/templates/next-default/lib/utils/types.d.ts +15 -0
- package/src/templates/next-default/lib/utils/url.ts +8 -5
- package/src/templates/next-default/lib/utils/viewport.ts +199 -0
- package/src/templates/next-default/package.json +12 -7
- package/src/templates/next-default/svg.d.ts +1 -0
- package/src/templates/next-experiments/.env.example +3 -3
- package/src/templates/next-experiments/.knip.json +3 -0
- package/src/templates/next-experiments/.vscode/extensions.json +1 -5
- package/src/templates/next-experiments/.vscode/settings.json +1 -1
- package/src/templates/next-experiments/.zed/settings.json +47 -0
- package/src/templates/next-experiments/README.md +7 -6
- package/src/templates/next-experiments/_gitignore +1 -3
- package/src/templates/next-experiments/app/layout.tsx +21 -35
- package/src/templates/next-experiments/app/robots.ts +5 -2
- package/src/templates/next-experiments/app/sitemap.xml/route.ts +51 -0
- package/src/templates/next-experiments/biome.json +4 -2
- package/src/templates/next-experiments/components/layout/navigation-menu.tsx +1 -1
- package/src/templates/next-experiments/components/layout/wrapper/index.tsx +6 -6
- package/src/templates/next-experiments/components/ui/image/index.tsx +33 -33
- package/src/templates/next-experiments/lib/README.md +8 -4
- package/src/templates/next-experiments/lib/hooks/use-media.ts +6 -3
- package/src/templates/next-experiments/lib/scripts/dev.ts +32 -0
- package/src/templates/next-experiments/lib/styles/README.md +13 -0
- package/src/templates/next-experiments/lib/styles/fonts.ts +20 -0
- package/src/templates/next-experiments/lib/styles/global.css +16 -196
- package/src/templates/next-experiments/lib/styles/index.css +3 -0
- package/src/templates/next-experiments/lib/styles/tokens.css +182 -0
- package/src/templates/next-experiments/lib/utils/README.md +40 -0
- package/src/templates/next-experiments/lib/utils/easings.ts +240 -0
- package/src/templates/next-experiments/lib/utils/fetch.ts +84 -0
- package/src/templates/next-experiments/lib/utils/global-css.d.ts +1 -0
- package/src/templates/next-experiments/lib/utils/json-ld.tsx +70 -68
- package/src/templates/next-experiments/lib/utils/math.ts +236 -0
- package/src/templates/next-experiments/lib/utils/metadata.ts +26 -27
- package/src/templates/next-experiments/lib/utils/strings.ts +246 -0
- package/src/templates/next-experiments/lib/utils/types.d.ts +15 -0
- package/src/templates/next-experiments/lib/utils/url.ts +8 -5
- package/src/templates/next-experiments/lib/utils/viewport.ts +199 -0
- package/src/templates/next-experiments/package.json +6 -6
- package/src/templates/next-experiments/svg.d.ts +1 -0
- package/src/templates/next-pagebuilder/.vscode/extensions.json +16 -0
- package/src/templates/next-pagebuilder/.vscode/settings.json +105 -0
- package/src/templates/next-pagebuilder/.zed/settings.json +47 -0
- package/src/templates/next-pagebuilder/_gitignore +1 -3
- package/src/templates/next-pagebuilder/app/(content)/[[...slug]]/page.tsx +17 -8
- package/src/templates/next-pagebuilder/app/(content)/layout.tsx +18 -7
- package/src/templates/next-pagebuilder/app/actions/refresh.ts +5 -0
- package/src/templates/next-pagebuilder/app/robots.ts +3 -4
- package/src/templates/next-pagebuilder/biome.json +17 -0
- package/src/templates/next-pagebuilder/components/layout/footer/index.tsx +17 -22
- package/src/templates/next-pagebuilder/components/layout/header/index.tsx +3 -5
- package/src/templates/next-pagebuilder/components/layout/json-ld/index.tsx +11 -10
- package/src/templates/next-pagebuilder/components/layout/wrapper/index.tsx +14 -4
- package/src/templates/next-pagebuilder/components/page-builder/components/article-content/index.tsx +4 -9
- package/src/templates/next-pagebuilder/components/page-builder/components/article-content/related-post-item.tsx +4 -4
- package/src/templates/next-pagebuilder/components/page-builder/components/{post-collection → content-collection}/content-card.tsx +2 -2
- package/src/templates/next-pagebuilder/components/page-builder/components/content-collection/content-filters.tsx +93 -0
- package/src/templates/next-pagebuilder/components/page-builder/components/{post-collection → content-collection}/content-grid.tsx +7 -9
- package/src/templates/next-pagebuilder/components/page-builder/components/content-collection/content-pagination-nav.tsx +71 -0
- package/src/templates/next-pagebuilder/components/page-builder/components/content-collection/index.tsx +219 -0
- package/src/templates/next-pagebuilder/components/page-builder/components/{post-collection → content-collection}/types.ts +7 -4
- package/src/templates/next-pagebuilder/components/page-builder/renderer.tsx +17 -5
- package/src/templates/next-pagebuilder/components/page-builder/types.ts +9 -7
- package/src/templates/next-pagebuilder/components/page-document/index.tsx +19 -4
- package/src/templates/next-pagebuilder/lefthook.yml +25 -0
- package/src/templates/next-pagebuilder/lib/integrations/sanity/sanity.types.ts +208 -0
- package/src/templates/next-pagebuilder/lib/styles/global.css +0 -1
- package/src/templates/next-pagebuilder/next.config.ts +1 -0
- package/src/templates/next-pagebuilder/package.json +13 -26
- package/src/templates/next-pagebuilder/postcss.config.mjs +27 -1
- package/src/templates/next-pagebuilder/svg.d.ts +1 -0
- package/src/templates/next-webgl/.env.example +3 -3
- package/src/templates/next-webgl/.vscode/extensions.json +1 -5
- package/src/templates/next-webgl/.vscode/settings.json +1 -1
- package/src/templates/next-webgl/.zed/settings.json +47 -0
- package/src/templates/next-webgl/README.md +7 -6
- package/src/templates/next-webgl/_gitignore +1 -3
- package/src/templates/next-webgl/app/layout.tsx +21 -35
- package/src/templates/next-webgl/app/robots.ts +3 -4
- package/src/templates/next-webgl/app/sitemap.xml/route.ts +29 -29
- package/src/templates/next-webgl/biome.json +9 -2
- package/src/templates/next-webgl/components/ui/image/index.tsx +2 -1
- package/src/templates/next-webgl/components/webgl/components/scene/index.tsx +0 -2
- package/src/templates/next-webgl/lefthook.yml +25 -0
- package/src/templates/next-webgl/lib/README.md +8 -4
- package/src/templates/next-webgl/lib/hooks/use-media.ts +6 -3
- package/src/templates/next-webgl/lib/scripts/dev.ts +32 -0
- package/src/templates/next-webgl/lib/styles/README.md +13 -0
- package/src/templates/next-webgl/lib/styles/fonts.ts +20 -0
- package/src/templates/next-webgl/lib/styles/global.css +16 -196
- package/src/templates/next-webgl/lib/styles/index.css +3 -0
- package/src/templates/next-webgl/lib/styles/tokens.css +182 -0
- package/src/templates/next-webgl/lib/utils/README.md +40 -0
- package/src/templates/next-webgl/lib/utils/easings.ts +240 -0
- package/src/templates/next-webgl/lib/utils/fetch.ts +84 -0
- package/src/templates/next-webgl/lib/utils/global-css.d.ts +1 -0
- package/src/templates/next-webgl/lib/utils/json-ld.tsx +70 -68
- package/src/templates/next-webgl/lib/utils/math.ts +236 -0
- package/src/templates/next-webgl/lib/utils/metadata.ts +26 -27
- package/src/templates/next-webgl/lib/utils/strings.ts +246 -0
- package/src/templates/next-webgl/lib/utils/types.d.ts +15 -0
- package/src/templates/next-webgl/lib/utils/url.ts +8 -5
- package/src/templates/next-webgl/lib/utils/viewport.ts +199 -0
- package/src/templates/next-webgl/package.json +13 -8
- package/src/templates/next-webgl/svg.d.ts +1 -0
- package/src/templates/next-webgl/tsconfig.tsbuildinfo +1 -1
- package/dist/configs/animations.d.ts.map +0 -1
- package/dist/configs/animations.js.map +0 -1
- package/dist/configs/skills.d.ts +0 -27
- package/dist/configs/skills.d.ts.map +0 -1
- package/dist/configs/skills.js +0 -18
- package/dist/configs/skills.js.map +0 -1
- package/dist/configs/skills.json +0 -26
- package/dist/helpers/add/hooks-config.d.ts +0 -22
- package/dist/helpers/add/hooks-config.d.ts.map +0 -1
- package/dist/helpers/add/hooks-config.js +0 -31
- package/dist/helpers/add/hooks-config.js.map +0 -1
- package/dist/helpers/add/index.d.ts.map +0 -1
- package/dist/helpers/add/index.js.map +0 -1
- package/dist/helpers/create/copy-template.d.ts +0 -11
- package/dist/helpers/create/copy-template.d.ts.map +0 -1
- package/dist/helpers/create/copy-template.js.map +0 -1
- package/dist/helpers/create/index.d.ts +0 -24
- package/dist/helpers/create/index.d.ts.map +0 -1
- package/dist/helpers/create/index.js +0 -99
- package/dist/helpers/create/index.js.map +0 -1
- package/dist/helpers/create/init-git.d.ts.map +0 -1
- package/dist/helpers/create/init-git.js.map +0 -1
- package/dist/helpers/create/install.d.ts.map +0 -1
- package/dist/helpers/create/install.js.map +0 -1
- package/dist/helpers/create/rename-files.d.ts.map +0 -1
- package/dist/helpers/create/rename-files.js.map +0 -1
- package/dist/helpers/create/setup-agent.d.ts.map +0 -1
- package/dist/helpers/create/setup-agent.js +0 -91
- package/dist/helpers/create/setup-agent.js.map +0 -1
- package/dist/helpers/create/setup-sanity.d.ts.map +0 -1
- package/dist/helpers/create/setup-sanity.js.map +0 -1
- package/dist/helpers/create/update-package.d.ts +0 -20
- package/dist/helpers/create/update-package.d.ts.map +0 -1
- package/dist/helpers/create/update-package.js +0 -97
- package/dist/helpers/create/update-package.js.map +0 -1
- package/dist/helpers/integrate/index.d.ts.map +0 -1
- package/dist/helpers/integrate/index.js.map +0 -1
- package/dist/helpers/integrate/merge-config.d.ts +0 -21
- package/dist/helpers/integrate/merge-config.d.ts.map +0 -1
- package/dist/helpers/integrate/merge-config.js +0 -42
- package/dist/helpers/integrate/merge-config.js.map +0 -1
- package/dist/helpers/integrate/merge-orchestrator.d.ts +0 -10
- package/dist/helpers/integrate/merge-orchestrator.d.ts.map +0 -1
- package/dist/helpers/integrate/merge-orchestrator.js.map +0 -1
- package/dist/helpers/integrate/sanity/config.d.ts.map +0 -1
- package/dist/helpers/integrate/sanity/config.js.map +0 -1
- package/dist/helpers/integrate/sanity/mergers/check-integration-merger.d.ts.map +0 -1
- package/dist/helpers/integrate/sanity/mergers/check-integration-merger.js.map +0 -1
- package/dist/helpers/integrate/sanity/mergers/layout-merger.d.ts.map +0 -1
- package/dist/helpers/integrate/sanity/mergers/layout-merger.js.map +0 -1
- package/dist/helpers/integrate/sanity/mergers/sitemap-merger.d.ts +0 -11
- package/dist/helpers/integrate/sanity/mergers/sitemap-merger.d.ts.map +0 -1
- package/dist/helpers/integrate/sanity/mergers/sitemap-merger.js +0 -133
- package/dist/helpers/integrate/sanity/mergers/sitemap-merger.js.map +0 -1
- package/dist/helpers/skills/index.d.ts.map +0 -1
- package/dist/helpers/skills/index.js.map +0 -1
- package/dist/utils/detect-project.d.ts.map +0 -1
- package/dist/utils/detect-project.js.map +0 -1
- package/dist/utils/format-results.d.ts.map +0 -1
- package/dist/utils/format-results.js.map +0 -1
- package/src/helpers/integrate/sanity/files/lib/integrations/sanity/WEBHOOK-SETUP.md +0 -74
- package/src/helpers/integrate/sanity/files/lib/integrations/sanity/sitemap.ts +0 -90
- package/src/template-hooks/config.js +0 -32
- package/src/templates/next-default/css.d.ts +0 -1
- package/src/templates/next-default/lib/utils/portable-text-to-markdown.ts +0 -83
- package/src/templates/next-default/tsconfig.tsbuildinfo +0 -1
- package/src/templates/next-experiments/css.d.ts +0 -1
- package/src/templates/next-experiments/lib/utils/portable-text-to-markdown.ts +0 -83
- package/src/templates/next-pagebuilder/app/api/[[...slug]]/route.ts +0 -100
- package/src/templates/next-pagebuilder/app/api/draft-mode/disable/route.ts +0 -7
- package/src/templates/next-pagebuilder/app/api/draft-mode/enable/route.ts +0 -20
- package/src/templates/next-pagebuilder/app/api/revalidate/route.ts +0 -121
- package/src/templates/next-pagebuilder/app/sitemap.md/route.ts +0 -124
- package/src/templates/next-pagebuilder/app/studio/[[...tool]]/page.tsx +0 -8
- package/src/templates/next-pagebuilder/components/page-builder/components/post-collection/index.tsx +0 -28
- package/src/templates/next-pagebuilder/components/sanity/draft-mode-toggle.tsx +0 -27
- package/src/templates/next-pagebuilder/components/sanity/rich-text.tsx +0 -87
- package/src/templates/next-pagebuilder/components/sanity/visual-editing.tsx +0 -27
- package/src/templates/next-pagebuilder/components/ui/sanity-image/index.tsx +0 -41
- package/src/templates/next-pagebuilder/lib/integrations/check-integration.ts +0 -5
- package/src/templates/next-pagebuilder/lib/integrations/sanity/client.ts +0 -27
- package/src/templates/next-pagebuilder/lib/integrations/sanity/components/disable-draft-mode.tsx +0 -23
- package/src/templates/next-pagebuilder/lib/integrations/sanity/components/page-builder-input.tsx +0 -36
- package/src/templates/next-pagebuilder/lib/integrations/sanity/components/page-category-input.tsx +0 -50
- package/src/templates/next-pagebuilder/lib/integrations/sanity/components/rich-text.tsx +0 -84
- package/src/templates/next-pagebuilder/lib/integrations/sanity/confirm-publish-action.ts +0 -40
- package/src/templates/next-pagebuilder/lib/integrations/sanity/env.ts +0 -34
- package/src/templates/next-pagebuilder/lib/integrations/sanity/fetchers/layout.ts +0 -35
- package/src/templates/next-pagebuilder/lib/integrations/sanity/icons.ts +0 -58
- package/src/templates/next-pagebuilder/lib/integrations/sanity/live/index.tsx +0 -61
- package/src/templates/next-pagebuilder/lib/integrations/sanity/markdown-proxy.config.ts +0 -50
- package/src/templates/next-pagebuilder/lib/integrations/sanity/page-builder-config.ts +0 -132
- package/src/templates/next-pagebuilder/lib/integrations/sanity/page-category.ts +0 -28
- package/src/templates/next-pagebuilder/lib/integrations/sanity/queries.ts +0 -281
- package/src/templates/next-pagebuilder/lib/integrations/sanity/sanity.cli.ts +0 -29
- package/src/templates/next-pagebuilder/lib/integrations/sanity/sanity.config.ts +0 -211
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/components/index.ts +0 -4
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/components/reusable/blog-content.ts +0 -89
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/components/reusable/description.ts +0 -29
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/components/reusable/hero.ts +0 -28
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/components/singleton/content-collection.ts +0 -45
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/content/author.ts +0 -70
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/content/blog-category.ts +0 -55
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/index.ts +0 -96
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/layout/company-data.ts +0 -62
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/layout/footer.ts +0 -79
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/layout/navbar.ts +0 -74
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/shared/link.ts +0 -125
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/shared/logo-field.ts +0 -9
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/shared/metadata.ts +0 -68
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/shared/nav-objects.ts +0 -192
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/shared/page-builder.ts +0 -39
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/shared/page-folder.ts +0 -124
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/shared/page.ts +0 -232
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/shared/richText.ts +0 -63
- package/src/templates/next-pagebuilder/lib/integrations/sanity/singletons.ts +0 -44
- package/src/templates/next-pagebuilder/lib/integrations/sanity/structure.ts +0 -453
- package/src/templates/next-pagebuilder/lib/integrations/sanity/utils/image.ts +0 -8
- package/src/templates/next-pagebuilder/lib/integrations/sanity/utils/link.ts +0 -137
- package/src/templates/next-pagebuilder/lib/integrations/sanity/utils/page-builder-markdown.ts +0 -81
- package/src/templates/next-pagebuilder/lib/scripts/sanity-typegen.ts +0 -45
- package/src/templates/next-pagebuilder/lib/utils/json-ld.tsx +0 -213
- package/src/templates/next-pagebuilder/lib/utils/metadata.ts +0 -167
- package/src/templates/next-pagebuilder/lib/utils/sitemap.ts +0 -37
- package/src/templates/next-pagebuilder/proxy.ts +0 -81
- package/src/templates/next-webgl/css.d.ts +0 -1
- package/src/templates/next-webgl/lib/utils/portable-text-to-markdown.ts +0 -83
- package/dist/{helpers → infrastructure}/create/copy-template.js +0 -0
- package/dist/{helpers → infrastructure}/create/rename-files.d.ts +0 -0
- package/dist/{helpers → infrastructure}/create/rename-files.js +0 -0
- package/dist/{helpers → infrastructure}/create/setup-sanity.d.ts +0 -0
- package/dist/{helpers/integrate → modules/features/cms}/sanity/config.d.ts +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/app/api/draft-mode/disable/route.ts +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/app/api/draft-mode/enable/route.ts +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/app/studio/[[...tool]]/page.tsx +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/app/studio/layout.tsx +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/components/ui/sanity-image/index.tsx +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/README.md +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/check-integration.ts +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/MARKDOWN-PROXY.md +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/README.md +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/client.ts +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/components/disable-draft-mode.tsx +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/components/rich-text.tsx +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/confirm-publish-action.ts +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/live/index.tsx +1 -1
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/markdown-proxy.config.ts +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/sanity.cli.ts +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/sanity.config.ts +1 -1
- /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/sanity.types.ts +0 -0
- /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/schema.json +0 -0
- /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/schemas/article.ts +0 -0
- /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/schemas/example.ts +0 -0
- /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/schemas/link.ts +0 -0
- /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/schemas/metadata.ts +0 -0
- /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/schemas/navigation.ts +0 -0
- /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/schemas/richText.ts +0 -0
- /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/structure.ts +0 -0
- /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/utils/image.ts +0 -0
- /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/utils/link.ts +0 -0
- /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/utils/portable-text-to-markdown.ts +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
declare module "*.css"
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
export interface PortableTextMarkDefinition {
|
|
2
|
-
_key?: string;
|
|
3
|
-
_type?: string;
|
|
4
|
-
href?: string;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export interface PortableTextSpan {
|
|
8
|
-
_type?: string;
|
|
9
|
-
text?: string;
|
|
10
|
-
marks?: string[];
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface PortableTextBlock {
|
|
14
|
-
_type?: string;
|
|
15
|
-
style?: string;
|
|
16
|
-
listItem?: "bullet" | "number";
|
|
17
|
-
level?: number;
|
|
18
|
-
children?: PortableTextSpan[];
|
|
19
|
-
markDefs?: PortableTextMarkDefinition[];
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const headingStyles: Record<string, string> = {
|
|
23
|
-
h1: "#",
|
|
24
|
-
h2: "##",
|
|
25
|
-
h3: "###",
|
|
26
|
-
h4: "####",
|
|
27
|
-
h5: "#####",
|
|
28
|
-
h6: "######",
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function applyMarks(
|
|
32
|
-
text: string,
|
|
33
|
-
marks: string[] | undefined,
|
|
34
|
-
markDefs: PortableTextMarkDefinition[]
|
|
35
|
-
) {
|
|
36
|
-
return (marks ?? []).reduce((result, mark) => {
|
|
37
|
-
if (mark === "strong") return `**${result}**`
|
|
38
|
-
if (mark === "em") return `*${result}*`
|
|
39
|
-
if (mark === "code") return `\`${result}\``
|
|
40
|
-
|
|
41
|
-
const link = markDefs.find((definition) => definition._key === mark)
|
|
42
|
-
if (link?._type === "link" && link.href) {
|
|
43
|
-
return `[${result}](${link.href})`
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return result
|
|
47
|
-
}, text)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function serializeBlock(block: PortableTextBlock) {
|
|
51
|
-
const text = (block.children ?? [])
|
|
52
|
-
.map((child) =>
|
|
53
|
-
applyMarks(child.text ?? "", child.marks, block.markDefs ?? [])
|
|
54
|
-
)
|
|
55
|
-
.join("")
|
|
56
|
-
.trim()
|
|
57
|
-
|
|
58
|
-
if (!text) return ""
|
|
59
|
-
|
|
60
|
-
if (block.listItem) {
|
|
61
|
-
const level = Math.max((block.level ?? 1) - 1, 0)
|
|
62
|
-
const indent = " ".repeat(level)
|
|
63
|
-
const marker = block.listItem === "number" ? "1." : "-"
|
|
64
|
-
return `${indent}${marker} ${text}`
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (block.style === "blockquote") {
|
|
68
|
-
return `> ${text}`
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const headingPrefix = headingStyles[block.style ?? ""]
|
|
72
|
-
if (headingPrefix) {
|
|
73
|
-
return `${headingPrefix} ${text}`
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return text
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export function portableTextToMarkdown(
|
|
80
|
-
value: PortableTextBlock[] | null | undefined
|
|
81
|
-
) {
|
|
82
|
-
return (value ?? []).map(serializeBlock).filter(Boolean).join("\n\n")
|
|
83
|
-
}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { NextResponse } from "next/server"
|
|
2
|
-
import { isSanityConfigured } from "@/lib/integrations/check-integration"
|
|
3
|
-
import { sanityFetch } from "@/lib/integrations/sanity/live"
|
|
4
|
-
import { PAGE_QUERY } from "@/lib/integrations/sanity/queries"
|
|
5
|
-
import type { PAGE_QUERY_RESULT } from "@/lib/integrations/sanity/sanity.types"
|
|
6
|
-
import { renderPageBuilderMarkdown } from "@/lib/integrations/sanity/utils/page-builder-markdown"
|
|
7
|
-
import { getBaseUrl } from "@/lib/utils/base-url"
|
|
8
|
-
|
|
9
|
-
type PageResult = NonNullable<PAGE_QUERY_RESULT>
|
|
10
|
-
|
|
11
|
-
const getSlugPath = (slugParts?: string[]) => {
|
|
12
|
-
if (!slugParts?.length) return null
|
|
13
|
-
|
|
14
|
-
const lastSegment = slugParts.at(-1)
|
|
15
|
-
|
|
16
|
-
if (!lastSegment?.endsWith(".md")) return null
|
|
17
|
-
|
|
18
|
-
const pathSegments = [...slugParts]
|
|
19
|
-
pathSegments[pathSegments.length - 1] = lastSegment.slice(0, -3)
|
|
20
|
-
|
|
21
|
-
const slug = pathSegments.filter(Boolean).join("/")
|
|
22
|
-
if (!slug) return null
|
|
23
|
-
|
|
24
|
-
return slug === "index" ? null : slug
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export async function GET(
|
|
28
|
-
_request: Request,
|
|
29
|
-
props: { params: Promise<{ slug?: string[] }> }
|
|
30
|
-
) {
|
|
31
|
-
const { slug: rawSlugParts } = await props.params
|
|
32
|
-
const slug = getSlugPath(rawSlugParts)
|
|
33
|
-
|
|
34
|
-
if (
|
|
35
|
-
rawSlugParts?.length &&
|
|
36
|
-
slug === null &&
|
|
37
|
-
rawSlugParts.join("/") !== "index.md"
|
|
38
|
-
) {
|
|
39
|
-
return new NextResponse(null, { status: 404 })
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (!rawSlugParts?.length) {
|
|
43
|
-
return new NextResponse(null, { status: 404 })
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (!isSanityConfigured()) {
|
|
47
|
-
return new NextResponse("# 404 Not Found\n\nCMS not configured.", {
|
|
48
|
-
status: 404,
|
|
49
|
-
headers: { "Content-Type": "text/markdown; charset=utf-8" },
|
|
50
|
-
})
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const { data } = await sanityFetch({
|
|
54
|
-
query: PAGE_QUERY,
|
|
55
|
-
params: { slug },
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
const page = data as PageResult | null
|
|
59
|
-
|
|
60
|
-
const baseUrl = getBaseUrl()
|
|
61
|
-
|
|
62
|
-
if (!page) {
|
|
63
|
-
return new NextResponse("# 404 Not Found\n\nPage not found.", {
|
|
64
|
-
status: 404,
|
|
65
|
-
headers: { "Content-Type": "text/markdown; charset=utf-8" },
|
|
66
|
-
})
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const body = renderPageBuilderMarkdown(page.pageBuilder)
|
|
70
|
-
const canonicalPath = slug ? `/${slug}` : "/"
|
|
71
|
-
|
|
72
|
-
return new NextResponse(
|
|
73
|
-
[
|
|
74
|
-
`# ${page.title}`,
|
|
75
|
-
"",
|
|
76
|
-
page._updatedAt
|
|
77
|
-
? `**Updated:** ${new Date(page._updatedAt).toLocaleDateString()}`
|
|
78
|
-
: null,
|
|
79
|
-
"",
|
|
80
|
-
`Canonical URL: ${baseUrl}${canonicalPath}`,
|
|
81
|
-
"",
|
|
82
|
-
"---",
|
|
83
|
-
"",
|
|
84
|
-
body || "No page builder content yet.",
|
|
85
|
-
"",
|
|
86
|
-
"---",
|
|
87
|
-
"",
|
|
88
|
-
`[View all content](${baseUrl}/sitemap.md)`,
|
|
89
|
-
]
|
|
90
|
-
.filter((part): part is string => part !== null)
|
|
91
|
-
.join("\n"),
|
|
92
|
-
{
|
|
93
|
-
headers: {
|
|
94
|
-
"Content-Type": "text/markdown; charset=utf-8",
|
|
95
|
-
Vary: "Accept",
|
|
96
|
-
"X-Content-Type-Options": "nosniff",
|
|
97
|
-
},
|
|
98
|
-
}
|
|
99
|
-
)
|
|
100
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { NextResponse } from "next/server"
|
|
2
|
-
import { defineEnableDraftMode } from "next-sanity/draft-mode"
|
|
3
|
-
import { isSanityConfigured } from "@/lib/integrations/check-integration"
|
|
4
|
-
import { client } from "@/lib/integrations/sanity/client"
|
|
5
|
-
import { sanityToken } from "@/lib/integrations/sanity/env"
|
|
6
|
-
|
|
7
|
-
const draftModeHandler =
|
|
8
|
-
isSanityConfigured() && client
|
|
9
|
-
? defineEnableDraftMode({
|
|
10
|
-
client: client.withConfig({ token: sanityToken }),
|
|
11
|
-
})
|
|
12
|
-
: {
|
|
13
|
-
GET: () =>
|
|
14
|
-
NextResponse.json(
|
|
15
|
-
{ error: "Sanity is not configured" },
|
|
16
|
-
{ status: 503 }
|
|
17
|
-
),
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export const { GET } = draftModeHandler
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { revalidatePath, revalidateTag } from "next/cache"
|
|
2
|
-
import { type NextRequest, NextResponse } from "next/server"
|
|
3
|
-
import { parseBody } from "next-sanity/webhook"
|
|
4
|
-
import { client } from "@/lib/integrations/sanity/client"
|
|
5
|
-
import { SANITY_LAYOUT_TAGS } from "@/lib/integrations/sanity/fetchers/layout"
|
|
6
|
-
import { pageBuilderReferenceMembers as pbrm } from "@/lib/integrations/sanity/page-builder-config"
|
|
7
|
-
import {
|
|
8
|
-
P_REF_PB_COMP_QUERY,
|
|
9
|
-
P_REV_SLUGS_QUERY,
|
|
10
|
-
} from "@/lib/integrations/sanity/queries"
|
|
11
|
-
import type { P_REF_PB_COMP_QUERY_RESULT } from "@/lib/integrations/sanity/sanity.types"
|
|
12
|
-
import { getPagePath } from "@/lib/utils/sitemap"
|
|
13
|
-
|
|
14
|
-
const ERRORS = {
|
|
15
|
-
BAD_REQ: ["Bad Request", { status: 400 }],
|
|
16
|
-
INVALID_SIG: ["Invalid signature", { status: 401 }],
|
|
17
|
-
} as const
|
|
18
|
-
|
|
19
|
-
type WebhookSlug = {
|
|
20
|
-
current?: string | null
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
type WebhookDocument = {
|
|
24
|
-
_id: string
|
|
25
|
-
_type: string
|
|
26
|
-
resolvedSlug?: string | null
|
|
27
|
-
slug?: WebhookSlug | null
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
type MutationOperation = "create" | "update" | "delete"
|
|
31
|
-
|
|
32
|
-
type RevalidateWebhookBody = WebhookDocument & {
|
|
33
|
-
operation?: MutationOperation
|
|
34
|
-
before?: Partial<WebhookDocument> | null
|
|
35
|
-
after?: Partial<WebhookDocument> | null
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const pageBuilderComponent = new Set<string>(pbrm.map((m) => m.documentType))
|
|
39
|
-
|
|
40
|
-
const normalizeRevalidationSlug = (slug: string | null | undefined) => {
|
|
41
|
-
if (slug === undefined) return null
|
|
42
|
-
if (slug === null) return "/"
|
|
43
|
-
return `/${slug}`
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const getCanonicalPageSlug = async (documentId: string) => {
|
|
47
|
-
if (!client) return null
|
|
48
|
-
|
|
49
|
-
const pageSlugs = await client.fetch<Array<{ slug: string | null }>>(
|
|
50
|
-
P_REV_SLUGS_QUERY,
|
|
51
|
-
{ documentIds: [documentId] }
|
|
52
|
-
)
|
|
53
|
-
|
|
54
|
-
return normalizeRevalidationSlug(
|
|
55
|
-
pageSlugs.find((page) => page.slug !== undefined)?.slug
|
|
56
|
-
)
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const getPagesThatReferenceComp = async (documentId: string) => {
|
|
60
|
-
if (!client) return []
|
|
61
|
-
|
|
62
|
-
const pages = await client.fetch<P_REF_PB_COMP_QUERY_RESULT>(
|
|
63
|
-
P_REF_PB_COMP_QUERY,
|
|
64
|
-
{
|
|
65
|
-
documentId,
|
|
66
|
-
}
|
|
67
|
-
)
|
|
68
|
-
|
|
69
|
-
return (pages ?? []).map((page) => normalizeRevalidationSlug(page.slug))
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const getAffectedPageSlugsForWebhook = async (body: RevalidateWebhookBody) => {
|
|
73
|
-
const pages: Array<string | null> = []
|
|
74
|
-
|
|
75
|
-
if (body.operation === "delete" && body?.before?.slug?.current) {
|
|
76
|
-
revalidateTag(body.before.slug.current, "max")
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// If the document is a page, get its slug
|
|
80
|
-
if (body._type === "page") {
|
|
81
|
-
const data = await getCanonicalPageSlug(body._id)
|
|
82
|
-
if (data !== null) pages.push(data)
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// If the document is a page builder component, get the page slugs that reference it
|
|
86
|
-
if (pageBuilderComponent.has(body._type)) {
|
|
87
|
-
const data = await getPagesThatReferenceComp(body._id)
|
|
88
|
-
pages.push(...data)
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return pages.filter((page): page is string => page !== null)
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export async function POST(request: NextRequest) {
|
|
95
|
-
try {
|
|
96
|
-
const { body, isValidSignature } = await parseBody<RevalidateWebhookBody>(
|
|
97
|
-
request,
|
|
98
|
-
process.env.SANITY_REVALIDATE_SECRET
|
|
99
|
-
)
|
|
100
|
-
|
|
101
|
-
if (!isValidSignature) return new Response(...ERRORS.INVALID_SIG)
|
|
102
|
-
if (!(body?._type && body._id)) return new Response(...ERRORS.BAD_REQ)
|
|
103
|
-
if (body._id.startsWith("drafts."))
|
|
104
|
-
return NextResponse.json({ status: 200, now: Date.now(), skipped: true })
|
|
105
|
-
|
|
106
|
-
const affectedPageSlugs = await getAffectedPageSlugsForWebhook(body)
|
|
107
|
-
|
|
108
|
-
for (const slug of affectedPageSlugs) {
|
|
109
|
-
revalidatePath(getPagePath(slug))
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
if (SANITY_LAYOUT_TAGS.includes(body?._type)) {
|
|
113
|
-
revalidateTag(body._type, "max")
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return NextResponse.json({ status: 200, now: Date.now() })
|
|
117
|
-
} catch (error) {
|
|
118
|
-
console.error("Revalidation error:", error)
|
|
119
|
-
return new Response("Internal Server Error", { status: 500 })
|
|
120
|
-
}
|
|
121
|
-
}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { NextResponse } from "next/server"
|
|
2
|
-
import { isSanityConfigured } from "@/lib/integrations/check-integration"
|
|
3
|
-
import type { PAGE_SITEMAP_QUERY_RESULT } from "@/lib/integrations/sanity/sanity.types"
|
|
4
|
-
import {
|
|
5
|
-
getMarkdownPath,
|
|
6
|
-
getSitemap,
|
|
7
|
-
getSitemapBaseUrl,
|
|
8
|
-
} from "@/lib/utils/sitemap"
|
|
9
|
-
|
|
10
|
-
export const dynamic = "force-dynamic"
|
|
11
|
-
|
|
12
|
-
type PageDoc = PAGE_SITEMAP_QUERY_RESULT[number]
|
|
13
|
-
|
|
14
|
-
const ROOT_GROUP = "__root__"
|
|
15
|
-
|
|
16
|
-
const getFolderGroup = (slug: string | null) => {
|
|
17
|
-
if (!slug) return ROOT_GROUP
|
|
18
|
-
|
|
19
|
-
const segments = slug.split("/").filter(Boolean)
|
|
20
|
-
|
|
21
|
-
if (segments.length <= 1) return ROOT_GROUP
|
|
22
|
-
|
|
23
|
-
return segments.slice(0, -1).join("/")
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const getGroupHeading = (group: string) => {
|
|
27
|
-
if (group === ROOT_GROUP) return "### Root Pages"
|
|
28
|
-
|
|
29
|
-
return `### /${group}`
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const sortPages = (left: PageDoc, right: PageDoc) => {
|
|
33
|
-
const leftLabel = left.title || left.slug || "Homepage"
|
|
34
|
-
const rightLabel = right.title || right.slug || "Homepage"
|
|
35
|
-
|
|
36
|
-
return leftLabel.localeCompare(rightLabel)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export const GET = async () => {
|
|
40
|
-
const baseUrl = getSitemapBaseUrl()
|
|
41
|
-
|
|
42
|
-
if (!isSanityConfigured()) {
|
|
43
|
-
return new NextResponse(
|
|
44
|
-
[
|
|
45
|
-
"# Sitemap",
|
|
46
|
-
"",
|
|
47
|
-
"## Pages",
|
|
48
|
-
"",
|
|
49
|
-
`- [Homepage](${baseUrl}/index.md)`,
|
|
50
|
-
"",
|
|
51
|
-
"CMS not configured. No additional content available.",
|
|
52
|
-
].join("\n"),
|
|
53
|
-
{
|
|
54
|
-
headers: { "Content-Type": "text/markdown; charset=utf-8" },
|
|
55
|
-
}
|
|
56
|
-
)
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
try {
|
|
60
|
-
const allPages = await getSitemap()
|
|
61
|
-
|
|
62
|
-
if (!allPages) {
|
|
63
|
-
return new NextResponse("# Sitemap\n\nUnable to connect to CMS.", {
|
|
64
|
-
status: 503,
|
|
65
|
-
headers: { "Content-Type": "text/markdown; charset=utf-8" },
|
|
66
|
-
})
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const pages = (allPages ?? []).filter((page) => !page.noIndex)
|
|
70
|
-
const pageGroups = new Map<string, PageDoc[]>()
|
|
71
|
-
|
|
72
|
-
for (const page of pages) {
|
|
73
|
-
const group = getFolderGroup(page.slug ?? null)
|
|
74
|
-
const groupedPages = pageGroups.get(group) ?? []
|
|
75
|
-
|
|
76
|
-
groupedPages.push(page)
|
|
77
|
-
pageGroups.set(group, groupedPages)
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const sortedGroupNames = [...pageGroups.keys()].sort((left, right) => {
|
|
81
|
-
if (left === ROOT_GROUP) return -1
|
|
82
|
-
if (right === ROOT_GROUP) return 1
|
|
83
|
-
|
|
84
|
-
return left.localeCompare(right)
|
|
85
|
-
})
|
|
86
|
-
|
|
87
|
-
const parts = [
|
|
88
|
-
`# ${new URL(baseUrl).hostname} - Content Sitemap`,
|
|
89
|
-
"",
|
|
90
|
-
"> This sitemap lists all available markdown content for AI agents.",
|
|
91
|
-
"",
|
|
92
|
-
"## Pages",
|
|
93
|
-
"",
|
|
94
|
-
]
|
|
95
|
-
|
|
96
|
-
if (pages.length > 0) {
|
|
97
|
-
for (const groupName of sortedGroupNames) {
|
|
98
|
-
const groupedPages = (pageGroups.get(groupName) ?? []).sort(sortPages)
|
|
99
|
-
|
|
100
|
-
if (groupedPages.length === 0) continue
|
|
101
|
-
|
|
102
|
-
parts.push(getGroupHeading(groupName), "")
|
|
103
|
-
|
|
104
|
-
for (const page of groupedPages) {
|
|
105
|
-
parts.push(
|
|
106
|
-
`- [${page.title || page.slug || "Homepage"}](${getMarkdownPath(baseUrl, page.slug ?? null)})`
|
|
107
|
-
)
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
parts.push("")
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
if (pages.length === 0) parts.push("No content published yet.", "")
|
|
115
|
-
|
|
116
|
-
return new NextResponse(parts.join("\n"))
|
|
117
|
-
} catch (error) {
|
|
118
|
-
console.error("Error generating sitemap.md:", error)
|
|
119
|
-
return new NextResponse("# Sitemap\n\nError fetching content.", {
|
|
120
|
-
status: 500,
|
|
121
|
-
headers: { "Content-Type": "text/markdown; charset=utf-8" },
|
|
122
|
-
})
|
|
123
|
-
}
|
|
124
|
-
}
|
package/src/templates/next-pagebuilder/components/page-builder/components/post-collection/index.tsx
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { sanityFetch } from "@/lib/integrations/sanity/live"
|
|
2
|
-
import { ALL_BLOG_ARTICLES_QUERY } from "@/lib/integrations/sanity/queries"
|
|
3
|
-
import { ContentGrid } from "./content-grid"
|
|
4
|
-
import type { ContentCollectionBlock } from "./types"
|
|
5
|
-
|
|
6
|
-
type ContentCollectionProps = {
|
|
7
|
-
block: ContentCollectionBlock
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export async function ContentCollection({ block }: ContentCollectionProps) {
|
|
11
|
-
const { data: articles } = await sanityFetch({
|
|
12
|
-
query: ALL_BLOG_ARTICLES_QUERY,
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
// @ts-ignore
|
|
16
|
-
if (!articles?.length) return null
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<section className="flex flex-col gap-8 py-8">
|
|
20
|
-
{block.subtitle ? (
|
|
21
|
-
<h2 className="font-medium text-2xl leading-tight">
|
|
22
|
-
{block.subtitle}
|
|
23
|
-
</h2>
|
|
24
|
-
) : null}
|
|
25
|
-
<ContentGrid articles={articles} />
|
|
26
|
-
</section>
|
|
27
|
-
)
|
|
28
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import { useRouter } from "next/navigation"
|
|
4
|
-
import { useTransition } from "react"
|
|
5
|
-
|
|
6
|
-
export function DraftModeToggle() {
|
|
7
|
-
const router = useRouter()
|
|
8
|
-
const [isPending, startTransition] = useTransition()
|
|
9
|
-
|
|
10
|
-
const handleDisable = () => {
|
|
11
|
-
startTransition(async () => {
|
|
12
|
-
await fetch("/api/draft-mode/disable")
|
|
13
|
-
router.refresh()
|
|
14
|
-
})
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<button
|
|
19
|
-
type="button"
|
|
20
|
-
onClick={handleDisable}
|
|
21
|
-
disabled={isPending}
|
|
22
|
-
className="fixed bottom-4 left-1/2 z-50 -translate-x-1/2 rounded-full border border-white/10 bg-black/80 px-2 py-1 font-medium text-sm text-white shadow-lg backdrop-blur-sm transition-colors hover:bg-black/90 disabled:opacity-50"
|
|
23
|
-
>
|
|
24
|
-
{isPending ? "Disabling..." : "Disable Draft Mode"}
|
|
25
|
-
</button>
|
|
26
|
-
)
|
|
27
|
-
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { PortableText, type PortableTextProps } from "@portabletext/react"
|
|
2
|
-
import { Link } from "@/components/ui/link"
|
|
3
|
-
import { SanityImage } from "@/components/ui/sanity-image"
|
|
4
|
-
import {
|
|
5
|
-
getLinkAttributes,
|
|
6
|
-
urlForReference,
|
|
7
|
-
} from "../../lib/integrations/sanity/utils/link"
|
|
8
|
-
|
|
9
|
-
interface RichTextProps {
|
|
10
|
-
content: PortableTextProps["value"]
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
type LinkMarkProps = {
|
|
14
|
-
children: React.ReactNode
|
|
15
|
-
value?: unknown
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const LinkMark = ({ children, value }: LinkMarkProps) => {
|
|
19
|
-
const href = urlForReference(value as Parameters<typeof urlForReference>[0])
|
|
20
|
-
const attrs = getLinkAttributes(
|
|
21
|
-
value as Parameters<typeof getLinkAttributes>[0]
|
|
22
|
-
)
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<Link
|
|
26
|
-
href={href}
|
|
27
|
-
target={attrs.target}
|
|
28
|
-
rel={attrs.rel}
|
|
29
|
-
data-sanity-edit-target
|
|
30
|
-
>
|
|
31
|
-
{children}
|
|
32
|
-
</Link>
|
|
33
|
-
)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export const RichText = ({ content }: RichTextProps) => {
|
|
37
|
-
if (!content) return null
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<PortableText
|
|
41
|
-
value={content}
|
|
42
|
-
components={{
|
|
43
|
-
types: {
|
|
44
|
-
image: ({ value }) => <SanityImage image={value} maxWidth={1920} />,
|
|
45
|
-
table: ({ value }) => {
|
|
46
|
-
const rows = value?.rows as
|
|
47
|
-
| Array<{ _key?: string; cells?: string[] }>
|
|
48
|
-
| undefined
|
|
49
|
-
if (!rows?.length) return null
|
|
50
|
-
return (
|
|
51
|
-
<table>
|
|
52
|
-
<tbody>
|
|
53
|
-
{rows.map((row, i) => (
|
|
54
|
-
<tr key={row._key ?? `row-${i}`}>
|
|
55
|
-
{row.cells?.map((cell) => {
|
|
56
|
-
const cellKey = `${row._key}-${cell}`
|
|
57
|
-
return i === 0 ? (
|
|
58
|
-
<th key={cellKey}>{cell}</th>
|
|
59
|
-
) : (
|
|
60
|
-
<td key={cellKey}>{cell}</td>
|
|
61
|
-
)
|
|
62
|
-
})}
|
|
63
|
-
</tr>
|
|
64
|
-
))}
|
|
65
|
-
</tbody>
|
|
66
|
-
</table>
|
|
67
|
-
)
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
marks: {
|
|
71
|
-
link: LinkMark,
|
|
72
|
-
pageReference: LinkMark,
|
|
73
|
-
externalLink: LinkMark,
|
|
74
|
-
},
|
|
75
|
-
block: {
|
|
76
|
-
h1: ({ children }) => <h1 className="h1">{children}</h1>,
|
|
77
|
-
h2: ({ children }) => <h2 className="h2">{children}</h2>,
|
|
78
|
-
h3: ({ children }) => <h3 className="h3">{children}</h3>,
|
|
79
|
-
h4: ({ children }) => <h4 className="h4">{children}</h4>,
|
|
80
|
-
h5: ({ children }) => <h5 className="h5">{children}</h5>,
|
|
81
|
-
h6: ({ children }) => <h6 className="h6">{children}</h6>,
|
|
82
|
-
normal: ({ children }) => <p className="p">{children}</p>,
|
|
83
|
-
},
|
|
84
|
-
}}
|
|
85
|
-
/>
|
|
86
|
-
)
|
|
87
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { draftMode } from "next/headers"
|
|
2
|
-
import { VisualEditing } from "next-sanity/visual-editing"
|
|
3
|
-
import { Suspense } from "react"
|
|
4
|
-
import { DraftModeToggle } from "@/components/sanity/draft-mode-toggle"
|
|
5
|
-
import { isSanityConfigured } from "@/lib/integrations/check-integration"
|
|
6
|
-
import { SanityLive } from "@/lib/integrations/sanity/live"
|
|
7
|
-
|
|
8
|
-
async function VisualEditingInner() {
|
|
9
|
-
const { isEnabled: isDraftMode } = await draftMode()
|
|
10
|
-
const sanityConfigured = isSanityConfigured()
|
|
11
|
-
|
|
12
|
-
if (!(sanityConfigured && isDraftMode)) return null
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<>
|
|
16
|
-
<DraftModeToggle />
|
|
17
|
-
<VisualEditing />
|
|
18
|
-
<SanityLive />
|
|
19
|
-
</>
|
|
20
|
-
)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export const SanityVisualEditing = () => (
|
|
24
|
-
<Suspense fallback={null}>
|
|
25
|
-
<VisualEditingInner />
|
|
26
|
-
</Suspense>
|
|
27
|
-
)
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { getImageDimensions } from "@sanity/asset-utils"
|
|
2
|
-
import { Image, type ImageProps } from "@/components/ui/image"
|
|
3
|
-
import { urlForImage } from "@/lib/integrations/sanity/utils/image"
|
|
4
|
-
|
|
5
|
-
interface SanityImageProps extends Omit<ImageProps, "src" | "aspectRatio"> {
|
|
6
|
-
image: {
|
|
7
|
-
asset?: {
|
|
8
|
-
_ref: string
|
|
9
|
-
_type: "reference"
|
|
10
|
-
}
|
|
11
|
-
alt?: string
|
|
12
|
-
hotspot?: object
|
|
13
|
-
crop?: object
|
|
14
|
-
}
|
|
15
|
-
maxWidth?: number
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function SanityImage({
|
|
19
|
-
image,
|
|
20
|
-
maxWidth = 1920,
|
|
21
|
-
alt,
|
|
22
|
-
fill,
|
|
23
|
-
...props
|
|
24
|
-
}: SanityImageProps) {
|
|
25
|
-
if (!image?.asset) return null
|
|
26
|
-
|
|
27
|
-
const { width, height } = getImageDimensions(image.asset)
|
|
28
|
-
const aspectRatio = width / height
|
|
29
|
-
|
|
30
|
-
const imageProps = fill ? { fill: true } : { width, height }
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<Image
|
|
34
|
-
src={urlForImage(image).width(maxWidth).url()}
|
|
35
|
-
alt={alt || image.alt || ""}
|
|
36
|
-
aspectRatio={aspectRatio}
|
|
37
|
-
{...imageProps}
|
|
38
|
-
{...props}
|
|
39
|
-
/>
|
|
40
|
-
)
|
|
41
|
-
}
|