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,27 +0,0 @@
|
|
|
1
|
-
import { createClient, type SanityClient } from "next-sanity"
|
|
2
|
-
import { isSanityConfigured } from "@/lib/integrations/check-integration"
|
|
3
|
-
import { apiVersion, dataset, projectId, sanityToken, studioUrl } from "./env"
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Sanity client instance
|
|
7
|
-
*
|
|
8
|
-
* Returns null if Sanity is not configured (missing env vars).
|
|
9
|
-
* Always check with isSanityConfigured() before using.
|
|
10
|
-
*/
|
|
11
|
-
export const client: SanityClient | null = isSanityConfigured()
|
|
12
|
-
? createClient({
|
|
13
|
-
projectId,
|
|
14
|
-
dataset,
|
|
15
|
-
apiVersion,
|
|
16
|
-
useCdn: true,
|
|
17
|
-
perspective: "published",
|
|
18
|
-
token: sanityToken,
|
|
19
|
-
stega: {
|
|
20
|
-
studioUrl,
|
|
21
|
-
filter: (props) => {
|
|
22
|
-
if (props.sourcePath.at(-1) === "title") return true
|
|
23
|
-
return props.filterDefault(props)
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
})
|
|
27
|
-
: null
|
package/src/templates/next-pagebuilder/lib/integrations/sanity/components/disable-draft-mode.tsx
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import Link from "next/link"
|
|
4
|
-
import { usePathname } from "next/navigation"
|
|
5
|
-
import { useDraftModeEnvironment } from "next-sanity/hooks"
|
|
6
|
-
|
|
7
|
-
export function DisableDraftMode() {
|
|
8
|
-
const environment = useDraftModeEnvironment()
|
|
9
|
-
const pathname = usePathname()
|
|
10
|
-
|
|
11
|
-
if (environment !== "live" && environment !== "unknown") return null
|
|
12
|
-
if (pathname.startsWith("/studio")) return null
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<Link
|
|
16
|
-
href="/api/draft-mode/disable"
|
|
17
|
-
scroll={false}
|
|
18
|
-
className="dr-p-4 fixed top-safe right-safe z-50 bg-red font-mono text-primary text-sm uppercase"
|
|
19
|
-
>
|
|
20
|
-
Disable Draft Mode
|
|
21
|
-
</Link>
|
|
22
|
-
)
|
|
23
|
-
}
|
package/src/templates/next-pagebuilder/lib/integrations/sanity/components/page-builder-input.tsx
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { type ArrayOfObjectsInputProps, useFormValue } from "sanity"
|
|
2
|
-
import {
|
|
3
|
-
getVisiblePageBuilderInsertMenuGroups,
|
|
4
|
-
getVisiblePageBuilderReferenceMembers,
|
|
5
|
-
type PageBuilderGroupName,
|
|
6
|
-
} from "@/lib/integrations/sanity/page-builder-config"
|
|
7
|
-
|
|
8
|
-
export function PageBuilderInput(props: ArrayOfObjectsInputProps) {
|
|
9
|
-
const pageTypeValue = useFormValue(["type"])
|
|
10
|
-
const pageType =
|
|
11
|
-
typeof pageTypeValue === "string"
|
|
12
|
-
? (pageTypeValue as PageBuilderGroupName)
|
|
13
|
-
: undefined
|
|
14
|
-
|
|
15
|
-
const visibleMemberNames = new Set(
|
|
16
|
-
getVisiblePageBuilderReferenceMembers(pageType).map((member) => member.name)
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
return props.renderDefault({
|
|
20
|
-
...props,
|
|
21
|
-
schemaType: {
|
|
22
|
-
...props.schemaType,
|
|
23
|
-
of: props.schemaType.of.filter(
|
|
24
|
-
(member) =>
|
|
25
|
-
typeof member.name === "string" && visibleMemberNames.has(member.name)
|
|
26
|
-
),
|
|
27
|
-
options: {
|
|
28
|
-
...props.schemaType.options,
|
|
29
|
-
insertMenu: {
|
|
30
|
-
...props.schemaType.options?.insertMenu,
|
|
31
|
-
groups: getVisiblePageBuilderInsertMenuGroups(pageType),
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
})
|
|
36
|
-
}
|
package/src/templates/next-pagebuilder/lib/integrations/sanity/components/page-category-input.tsx
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Select } from "@sanity/ui"
|
|
2
|
-
import { useEffect } from "react"
|
|
3
|
-
import { type StringInputProps, set, setIfMissing } from "sanity"
|
|
4
|
-
|
|
5
|
-
type PageCategoryOption = {
|
|
6
|
-
title: string
|
|
7
|
-
value: string
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const isPageCategoryOption = (option: unknown): option is PageCategoryOption =>
|
|
11
|
-
typeof option === "object" &&
|
|
12
|
-
option !== null &&
|
|
13
|
-
"title" in option &&
|
|
14
|
-
"value" in option &&
|
|
15
|
-
typeof option.title === "string" &&
|
|
16
|
-
typeof option.value === "string"
|
|
17
|
-
|
|
18
|
-
export function PageCategoryInput(props: StringInputProps) {
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
if (props.value === undefined) {
|
|
21
|
-
props.onChange(setIfMissing("generic"))
|
|
22
|
-
}
|
|
23
|
-
}, [props.onChange, props.value])
|
|
24
|
-
|
|
25
|
-
const options = Array.isArray(props.schemaType.options?.list)
|
|
26
|
-
? props.schemaType.options.list.filter(isPageCategoryOption)
|
|
27
|
-
: []
|
|
28
|
-
|
|
29
|
-
if (options.length === 0) {
|
|
30
|
-
return props.renderDefault({ ...props, value: props.value ?? "generic" })
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<Select
|
|
35
|
-
{...props.elementProps}
|
|
36
|
-
disabled={props.readOnly}
|
|
37
|
-
onChange={(event) => props.onChange(set(event.currentTarget.value))}
|
|
38
|
-
value={props.value ?? "generic"}
|
|
39
|
-
{...(props.validationError
|
|
40
|
-
? { customValidity: props.validationError }
|
|
41
|
-
: {})}
|
|
42
|
-
>
|
|
43
|
-
{options.map((option) => (
|
|
44
|
-
<option key={option.value} value={option.value}>
|
|
45
|
-
{option.title}
|
|
46
|
-
</option>
|
|
47
|
-
))}
|
|
48
|
-
</Select>
|
|
49
|
-
)
|
|
50
|
-
}
|
|
@@ -1,84 +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 { getLinkAttributes, urlForReference } from "../utils/link"
|
|
5
|
-
|
|
6
|
-
interface RichTextProps {
|
|
7
|
-
content: PortableTextProps["value"]
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
type LinkMarkProps = {
|
|
11
|
-
children: React.ReactNode
|
|
12
|
-
value?: unknown
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const LinkMark = ({ children, value }: LinkMarkProps) => {
|
|
16
|
-
const href = urlForReference(value as Parameters<typeof urlForReference>[0])
|
|
17
|
-
const attrs = getLinkAttributes(
|
|
18
|
-
value as Parameters<typeof getLinkAttributes>[0]
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<Link
|
|
23
|
-
href={href}
|
|
24
|
-
target={attrs.target}
|
|
25
|
-
rel={attrs.rel}
|
|
26
|
-
data-sanity-edit-target
|
|
27
|
-
>
|
|
28
|
-
{children}
|
|
29
|
-
</Link>
|
|
30
|
-
)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export const RichText = ({ content }: RichTextProps) => {
|
|
34
|
-
if (!content) return null
|
|
35
|
-
|
|
36
|
-
return (
|
|
37
|
-
<PortableText
|
|
38
|
-
value={content}
|
|
39
|
-
components={{
|
|
40
|
-
types: {
|
|
41
|
-
image: ({ value }) => <SanityImage image={value} maxWidth={1920} />,
|
|
42
|
-
table: ({ value }) => {
|
|
43
|
-
const rows = value?.rows as
|
|
44
|
-
| Array<{ _key?: string; cells?: string[] }>
|
|
45
|
-
| undefined
|
|
46
|
-
if (!rows?.length) return null
|
|
47
|
-
return (
|
|
48
|
-
<table>
|
|
49
|
-
<tbody>
|
|
50
|
-
{rows.map((row, i) => (
|
|
51
|
-
<tr key={row._key ?? `row-${i}`}>
|
|
52
|
-
{row.cells?.map((cell) => {
|
|
53
|
-
const cellKey = `${row._key}-${cell}`
|
|
54
|
-
return i === 0 ? (
|
|
55
|
-
<th key={cellKey}>{cell}</th>
|
|
56
|
-
) : (
|
|
57
|
-
<td key={cellKey}>{cell}</td>
|
|
58
|
-
)
|
|
59
|
-
})}
|
|
60
|
-
</tr>
|
|
61
|
-
))}
|
|
62
|
-
</tbody>
|
|
63
|
-
</table>
|
|
64
|
-
)
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
marks: {
|
|
68
|
-
link: LinkMark,
|
|
69
|
-
pageReference: LinkMark,
|
|
70
|
-
externalLink: LinkMark,
|
|
71
|
-
},
|
|
72
|
-
block: {
|
|
73
|
-
h1: ({ children }) => <h1 className="h1">{children}</h1>,
|
|
74
|
-
h2: ({ children }) => <h2 className="h2">{children}</h2>,
|
|
75
|
-
h3: ({ children }) => <h3 className="h3">{children}</h3>,
|
|
76
|
-
h4: ({ children }) => <h4 className="h4">{children}</h4>,
|
|
77
|
-
h5: ({ children }) => <h5 className="h5">{children}</h5>,
|
|
78
|
-
h6: ({ children }) => <h6 className="h6">{children}</h6>,
|
|
79
|
-
normal: ({ children }) => <p className="p">{children}</p>,
|
|
80
|
-
},
|
|
81
|
-
}}
|
|
82
|
-
/>
|
|
83
|
-
)
|
|
84
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { useState } from "react";
|
|
2
|
-
import type {
|
|
3
|
-
DocumentActionComponent,
|
|
4
|
-
DocumentActionDialogProps,
|
|
5
|
-
DocumentActionProps,
|
|
6
|
-
} from "sanity";
|
|
7
|
-
|
|
8
|
-
export function createConfirmPublishAction(
|
|
9
|
-
originalPublishAction: DocumentActionComponent,
|
|
10
|
-
): DocumentActionComponent {
|
|
11
|
-
const ConfirmPublishAction = (props: DocumentActionProps) => {
|
|
12
|
-
const original = originalPublishAction(props);
|
|
13
|
-
const [dialogOpen, setDialogOpen] = useState(false);
|
|
14
|
-
|
|
15
|
-
if (!original) return null;
|
|
16
|
-
|
|
17
|
-
const { dialog: _originalDialog, ...originalWithoutDialog } = original;
|
|
18
|
-
const dialog: DocumentActionDialogProps | false = dialogOpen
|
|
19
|
-
? {
|
|
20
|
-
type: "confirm",
|
|
21
|
-
tone: "critical",
|
|
22
|
-
message:
|
|
23
|
-
"This will make these changes live on the production site immediately. Continue?",
|
|
24
|
-
onCancel: () => setDialogOpen(false),
|
|
25
|
-
onConfirm: () => {
|
|
26
|
-
setDialogOpen(false);
|
|
27
|
-
original.onHandle?.();
|
|
28
|
-
},
|
|
29
|
-
}
|
|
30
|
-
: false;
|
|
31
|
-
|
|
32
|
-
return {
|
|
33
|
-
...originalWithoutDialog,
|
|
34
|
-
onHandle: () => setDialogOpen(true),
|
|
35
|
-
dialog,
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
return ConfirmPublishAction;
|
|
40
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sanity Environment Configuration
|
|
3
|
-
*
|
|
4
|
-
* All values have safe defaults to allow the app to build and run
|
|
5
|
-
* without Sanity configured. Use isSanityConfigured() to check
|
|
6
|
-
* if Sanity is properly set up before making API calls.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/** Sanity API version - defaults to latest stable */
|
|
10
|
-
export const apiVersion =
|
|
11
|
-
process.env.NEXT_PUBLIC_SANITY_API_VERSION || "2024-03-15"
|
|
12
|
-
|
|
13
|
-
/** Sanity dataset name - defaults to 'production' */
|
|
14
|
-
export const dataset = process.env.NEXT_PUBLIC_SANITY_DATASET || "production"
|
|
15
|
-
|
|
16
|
-
/** Sanity project ID - empty string if not configured */
|
|
17
|
-
export const projectId =
|
|
18
|
-
process.env.NEXT_PUBLIC_SANITY_PROJECT_ID ||
|
|
19
|
-
process.env.SANITY_STUDIO_PROJECT_ID ||
|
|
20
|
-
""
|
|
21
|
-
|
|
22
|
-
/** Sanity Studio URL for visual editing */
|
|
23
|
-
export const studioUrl =
|
|
24
|
-
process.env.NODE_ENV === "development"
|
|
25
|
-
? "http://localhost:3000/studio"
|
|
26
|
-
: `${process.env.NEXT_PUBLIC_BASE_URL || ""}/studio`
|
|
27
|
-
|
|
28
|
-
export const sanityToken = process.env.SANITY_API_READ_TOKEN || ""
|
|
29
|
-
|
|
30
|
-
/** Preview URL for draft mode */
|
|
31
|
-
export const previewURL =
|
|
32
|
-
process.env.NODE_ENV === "development"
|
|
33
|
-
? "http://localhost:3000"
|
|
34
|
-
: process.env.NEXT_PUBLIC_BASE_URL || ""
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { sanityFetch } from "@/lib/integrations/sanity/live"
|
|
2
|
-
import {
|
|
3
|
-
COMPANY_DATA_QUERY,
|
|
4
|
-
FOOTER_QUERY,
|
|
5
|
-
NAVBAR_QUERY,
|
|
6
|
-
} from "@/lib/integrations/sanity/queries"
|
|
7
|
-
import type {
|
|
8
|
-
COMPANY_DATA_QUERY_RESULT,
|
|
9
|
-
FOOTER_QUERY_RESULT,
|
|
10
|
-
NAVBAR_QUERY_RESULT,
|
|
11
|
-
} from "@/lib/integrations/sanity/sanity.types"
|
|
12
|
-
|
|
13
|
-
export type NavbarData = NonNullable<NAVBAR_QUERY_RESULT>
|
|
14
|
-
export type FooterData = NonNullable<FOOTER_QUERY_RESULT>
|
|
15
|
-
export type CompanyData = NonNullable<COMPANY_DATA_QUERY_RESULT>
|
|
16
|
-
|
|
17
|
-
export const SANITY_LAYOUT_TAGS = ["navbar", "footer", "companyData"]
|
|
18
|
-
|
|
19
|
-
export const getNavbar = async (): Promise<NavbarData | null> => {
|
|
20
|
-
const { data } = await sanityFetch({ query: NAVBAR_QUERY, tags: ["navbar"] })
|
|
21
|
-
return data
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export const getFooter = async (): Promise<FooterData | null> => {
|
|
25
|
-
const { data } = await sanityFetch({ query: FOOTER_QUERY, tags: ["footer"] })
|
|
26
|
-
return data
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export const getCompanyData = async (): Promise<CompanyData | null> => {
|
|
30
|
-
const { data } = await sanityFetch({
|
|
31
|
-
query: COMPANY_DATA_QUERY,
|
|
32
|
-
tags: ["companyData"],
|
|
33
|
-
})
|
|
34
|
-
return data
|
|
35
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import type { Icon, IconProps } from "@phosphor-icons/react"
|
|
2
|
-
import {
|
|
3
|
-
ArticleNyTimesIcon,
|
|
4
|
-
BrowsersIcon,
|
|
5
|
-
BuildingsIcon,
|
|
6
|
-
FileTextIcon,
|
|
7
|
-
FolderOpenIcon,
|
|
8
|
-
FootprintsIcon,
|
|
9
|
-
LayoutIcon,
|
|
10
|
-
ListBulletsIcon,
|
|
11
|
-
ListIcon,
|
|
12
|
-
PackageIcon,
|
|
13
|
-
RocketIcon,
|
|
14
|
-
ShapesIcon,
|
|
15
|
-
ShareNetworkIcon,
|
|
16
|
-
TagIcon,
|
|
17
|
-
TextAlignLeftIcon,
|
|
18
|
-
UserCircleIcon,
|
|
19
|
-
} from "@phosphor-icons/react/dist/ssr"
|
|
20
|
-
import { createElement, forwardRef } from "react"
|
|
21
|
-
|
|
22
|
-
export type SanityStudioIcon = Icon
|
|
23
|
-
|
|
24
|
-
const asDuotoneIcon = (IconComponent: Icon): SanityStudioIcon => {
|
|
25
|
-
const DuotoneIcon = forwardRef<SVGSVGElement, IconProps>((props, ref) =>
|
|
26
|
-
createElement(IconComponent, { ...props, ref, weight: "duotone" })
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
DuotoneIcon.displayName = `${IconComponent.displayName ?? "Phosphor"}Duotone`
|
|
30
|
-
|
|
31
|
-
return DuotoneIcon
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export const pageBuilderCardIcon = asDuotoneIcon(PackageIcon)
|
|
35
|
-
export const pageBuilderCardListIcon = asDuotoneIcon(ListIcon)
|
|
36
|
-
|
|
37
|
-
export const authorIcon = asDuotoneIcon(UserCircleIcon)
|
|
38
|
-
|
|
39
|
-
export const pageListIcon = asDuotoneIcon(ListBulletsIcon)
|
|
40
|
-
|
|
41
|
-
export const blogCategoryIcon = asDuotoneIcon(TagIcon)
|
|
42
|
-
|
|
43
|
-
export const componentsFolderIcon = asDuotoneIcon(ShapesIcon)
|
|
44
|
-
|
|
45
|
-
export const companyDataIcon = asDuotoneIcon(BuildingsIcon)
|
|
46
|
-
export const socialLinksIcon = asDuotoneIcon(ShareNetworkIcon)
|
|
47
|
-
export const navbarIcon = asDuotoneIcon(ListIcon)
|
|
48
|
-
export const footerIcon = asDuotoneIcon(FootprintsIcon)
|
|
49
|
-
export const layoutFolderIcon = asDuotoneIcon(LayoutIcon)
|
|
50
|
-
|
|
51
|
-
export const heroIcon = asDuotoneIcon(RocketIcon)
|
|
52
|
-
export const descriptionIcon = asDuotoneIcon(TextAlignLeftIcon)
|
|
53
|
-
export const contentIcon = asDuotoneIcon(ArticleNyTimesIcon)
|
|
54
|
-
|
|
55
|
-
export const pageIcon = asDuotoneIcon(FileTextIcon)
|
|
56
|
-
export const pagesFolderIcon = asDuotoneIcon(BrowsersIcon)
|
|
57
|
-
export const pageFolderIcon = asDuotoneIcon(FolderOpenIcon)
|
|
58
|
-
export const contentFolderIcon = asDuotoneIcon(FolderOpenIcon)
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { NextResponse } from "next/server"
|
|
2
|
-
import { defineLive } from "next-sanity/live"
|
|
3
|
-
import { isSanityConfigured } from "@/lib/integrations/check-integration"
|
|
4
|
-
import { client } from "../client"
|
|
5
|
-
import { sanityToken } from "../env"
|
|
6
|
-
|
|
7
|
-
const isConfigured = isSanityConfigured() && client
|
|
8
|
-
|
|
9
|
-
const liveExports =
|
|
10
|
-
isConfigured && client
|
|
11
|
-
? defineLive({
|
|
12
|
-
client,
|
|
13
|
-
browserToken: sanityToken,
|
|
14
|
-
serverToken: sanityToken,
|
|
15
|
-
})
|
|
16
|
-
: null
|
|
17
|
-
|
|
18
|
-
export const sanityFetch =
|
|
19
|
-
liveExports?.sanityFetch ?? (async () => ({ data: null }))
|
|
20
|
-
|
|
21
|
-
export const SanityLive = liveExports?.SanityLive ?? (() => null)
|
|
22
|
-
|
|
23
|
-
export const SanityFetch = async <T,>(
|
|
24
|
-
slug: string,
|
|
25
|
-
query: string,
|
|
26
|
-
label = "Content"
|
|
27
|
-
): Promise<T | NextResponse> => {
|
|
28
|
-
if (!client) {
|
|
29
|
-
return new NextResponse(`# 503 Unavailable\n\nCMS client unavailable.`, {
|
|
30
|
-
status: 503,
|
|
31
|
-
headers: { "Content-Type": "text/markdown; charset=utf-8" },
|
|
32
|
-
})
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
try {
|
|
36
|
-
const { data } = await sanityFetch({
|
|
37
|
-
query,
|
|
38
|
-
params: { slug },
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
const result = data as T | null
|
|
42
|
-
|
|
43
|
-
if (!result) {
|
|
44
|
-
return new NextResponse(`# 404 Not Found\n\nPage not found.`, {
|
|
45
|
-
status: 404,
|
|
46
|
-
headers: { "Content-Type": "text/markdown; charset=utf-8" },
|
|
47
|
-
})
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return result
|
|
51
|
-
} catch (error) {
|
|
52
|
-
console.error(`Error fetching ${label.toLowerCase()}:`, error)
|
|
53
|
-
return new NextResponse(
|
|
54
|
-
`# 500 Error\n\nFailed to fetch ${label.toLowerCase()}.`,
|
|
55
|
-
{
|
|
56
|
-
status: 500,
|
|
57
|
-
headers: { "Content-Type": "text/markdown; charset=utf-8" },
|
|
58
|
-
}
|
|
59
|
-
)
|
|
60
|
-
}
|
|
61
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
export interface MarkdownRoute {
|
|
2
|
-
/** Regex to match the public-facing URL */
|
|
3
|
-
regex: RegExp
|
|
4
|
-
/** API route path template (under /api/) */
|
|
5
|
-
apiPath: string
|
|
6
|
-
/** Public markdown URL template (for Link headers) */
|
|
7
|
-
publicPath: string
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Routes that serve markdown versions for AI agents.
|
|
12
|
-
* All pages are backed by the shared `page` document type and resolved
|
|
13
|
-
* through the catch-all route handlers.
|
|
14
|
-
*
|
|
15
|
-
* How it works:
|
|
16
|
-
* - `regex`: match the public-facing URL (e.g. /about.md or /about)
|
|
17
|
-
* - `apiPath`: the internal API route that serves the markdown (e.g. /api/about.md)
|
|
18
|
-
* - Proxy rewrites .md URLs and Accept: text/markdown requests to the API route
|
|
19
|
-
* - Route handlers live under /api/ so page.tsx can coexist at the public path
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
/** .md extension routes -- rewrite to API endpoints */
|
|
23
|
-
export const mdExtensionRoutes: MarkdownRoute[] = [
|
|
24
|
-
{
|
|
25
|
-
regex: /^\/(.+)\.md$/,
|
|
26
|
-
apiPath: "/api/[slug].md",
|
|
27
|
-
publicPath: "/[slug].md",
|
|
28
|
-
},
|
|
29
|
-
]
|
|
30
|
-
|
|
31
|
-
/** Accept: text/markdown routes -- content negotiation for HTML pages */
|
|
32
|
-
export const acceptHeaderRoutes: MarkdownRoute[] = [
|
|
33
|
-
{
|
|
34
|
-
regex: /^\/(.+)$/,
|
|
35
|
-
apiPath: "/api/[slug].md",
|
|
36
|
-
publicPath: "/[slug].md",
|
|
37
|
-
},
|
|
38
|
-
]
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Paths the proxy should never process.
|
|
42
|
-
* Studio, static files, Next.js internals.
|
|
43
|
-
*/
|
|
44
|
-
export const ignoredPaths = [
|
|
45
|
-
"/studio",
|
|
46
|
-
"/api/",
|
|
47
|
-
"/_next/",
|
|
48
|
-
"/favicon.ico",
|
|
49
|
-
"/sitemap.md",
|
|
50
|
-
]
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import { contentIcon, pageIcon, type SanityStudioIcon } from "./icons"
|
|
2
|
-
import { singletonComponents } from "./singletons"
|
|
3
|
-
|
|
4
|
-
export type PageBuilderDocumentType =
|
|
5
|
-
| "hero"
|
|
6
|
-
| "description"
|
|
7
|
-
| "blogContent"
|
|
8
|
-
| (typeof singletonComponents)[number]["schemaType"]
|
|
9
|
-
|
|
10
|
-
type PageBuilderReferenceMember = {
|
|
11
|
-
documentType: PageBuilderDocumentType
|
|
12
|
-
name: string
|
|
13
|
-
title: string
|
|
14
|
-
documentId?: string
|
|
15
|
-
groups: PageBuilderGroupName[]
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export type PageBuilderGroupName =
|
|
19
|
-
| "generic"
|
|
20
|
-
| "blogEntry"
|
|
21
|
-
|
|
22
|
-
export const pageBuilderPageTypes: Array<{
|
|
23
|
-
title: string
|
|
24
|
-
value: PageBuilderGroupName
|
|
25
|
-
}> = [
|
|
26
|
-
{ title: "Generic", value: "generic" },
|
|
27
|
-
{ title: "Blog Entry", value: "blogEntry" },
|
|
28
|
-
]
|
|
29
|
-
|
|
30
|
-
const pageCategoryIcons: Record<PageBuilderGroupName, SanityStudioIcon> = {
|
|
31
|
-
generic: pageIcon,
|
|
32
|
-
blogEntry: contentIcon,
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export const getPageCategoryIcon = (
|
|
36
|
-
pageType: PageBuilderGroupName | undefined | null
|
|
37
|
-
) => pageCategoryIcons[pageType ?? "generic"]
|
|
38
|
-
|
|
39
|
-
const reusablePageBuilderReferenceMembers: PageBuilderReferenceMember[] = [
|
|
40
|
-
{
|
|
41
|
-
documentType: "hero",
|
|
42
|
-
name: "heroReference",
|
|
43
|
-
title: "Heading",
|
|
44
|
-
groups: ["generic"],
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
documentType: "description",
|
|
48
|
-
name: "descriptionReference",
|
|
49
|
-
title: "Description",
|
|
50
|
-
groups: ["generic"],
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
documentType: "blogContent",
|
|
54
|
-
name: "blogContentReference",
|
|
55
|
-
title: "Blog Content",
|
|
56
|
-
groups: ["blogEntry"],
|
|
57
|
-
},
|
|
58
|
-
]
|
|
59
|
-
|
|
60
|
-
const singletonPageBuilderReferenceMembers: PageBuilderReferenceMember[] =
|
|
61
|
-
singletonComponents.map((component) => ({
|
|
62
|
-
documentType: component.schemaType,
|
|
63
|
-
name: `${component.schemaType}Reference`,
|
|
64
|
-
title: component.title,
|
|
65
|
-
documentId: component.documentId,
|
|
66
|
-
groups: ["generic"],
|
|
67
|
-
}))
|
|
68
|
-
|
|
69
|
-
export const pageBuilderReferenceMembers: PageBuilderReferenceMember[] = [
|
|
70
|
-
...reusablePageBuilderReferenceMembers,
|
|
71
|
-
...singletonPageBuilderReferenceMembers,
|
|
72
|
-
]
|
|
73
|
-
|
|
74
|
-
export const getPageBuilderReferenceMember = (name: string) =>
|
|
75
|
-
pageBuilderReferenceMembers.find((member) => member.name === name)
|
|
76
|
-
|
|
77
|
-
export const getPageBuilderReferenceMemberByDocumentType = (
|
|
78
|
-
documentType: PageBuilderDocumentType
|
|
79
|
-
) =>
|
|
80
|
-
pageBuilderReferenceMembers.find(
|
|
81
|
-
(member) => member.documentType === documentType
|
|
82
|
-
)
|
|
83
|
-
|
|
84
|
-
const isPageBuilderGroupVisible = (
|
|
85
|
-
pageType: PageBuilderGroupName | undefined,
|
|
86
|
-
group: PageBuilderGroupName
|
|
87
|
-
) => (pageType ?? "generic") === group
|
|
88
|
-
|
|
89
|
-
export const getVisiblePageBuilderReferenceMembers = (
|
|
90
|
-
pageType: PageBuilderGroupName | undefined
|
|
91
|
-
) =>
|
|
92
|
-
pageBuilderReferenceMembers.filter((member) =>
|
|
93
|
-
member.groups.some((group) => isPageBuilderGroupVisible(pageType, group))
|
|
94
|
-
)
|
|
95
|
-
|
|
96
|
-
export const getVisiblePageBuilderInsertMenuGroups = (
|
|
97
|
-
pageType: PageBuilderGroupName | undefined
|
|
98
|
-
) =>
|
|
99
|
-
pageBuilderInsertMenuGroups.filter(
|
|
100
|
-
(group) => group.name === (pageType ?? "generic")
|
|
101
|
-
)
|
|
102
|
-
|
|
103
|
-
export const getInvalidPageBuilderDocumentTypes = (
|
|
104
|
-
pageType: PageBuilderGroupName | undefined,
|
|
105
|
-
documentTypes: PageBuilderDocumentType[]
|
|
106
|
-
) =>
|
|
107
|
-
documentTypes.filter((documentType) => {
|
|
108
|
-
const member = getPageBuilderReferenceMemberByDocumentType(documentType)
|
|
109
|
-
|
|
110
|
-
if (!member) return false
|
|
111
|
-
|
|
112
|
-
return !member.groups.some((group) =>
|
|
113
|
-
isPageBuilderGroupVisible(pageType, group)
|
|
114
|
-
)
|
|
115
|
-
})
|
|
116
|
-
|
|
117
|
-
export const pageBuilderInsertMenuGroups = [
|
|
118
|
-
{
|
|
119
|
-
name: "generic",
|
|
120
|
-
title: "Generic",
|
|
121
|
-
of: pageBuilderReferenceMembers
|
|
122
|
-
.filter((member) => member.groups.includes("generic"))
|
|
123
|
-
.map((member) => member.name),
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
name: "blogEntry",
|
|
127
|
-
title: "Blog Entry",
|
|
128
|
-
of: pageBuilderReferenceMembers
|
|
129
|
-
.filter((member) => member.groups.includes("blogEntry"))
|
|
130
|
-
.map((member) => member.name),
|
|
131
|
-
},
|
|
132
|
-
]
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { PageBuilderGroupName } from "@/lib/integrations/sanity/page-builder-config"
|
|
2
|
-
|
|
3
|
-
type PageCategoryParams = {
|
|
4
|
-
slug?: string | null
|
|
5
|
-
folder?: string | null
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export const isEmptyPageSlug = (slug?: string | null) =>
|
|
9
|
-
slug == null || slug === "" || slug === "/"
|
|
10
|
-
|
|
11
|
-
export const getGeneratedPageCategory = ({
|
|
12
|
-
slug,
|
|
13
|
-
folder,
|
|
14
|
-
}: PageCategoryParams): PageBuilderGroupName => {
|
|
15
|
-
if (!isEmptyPageSlug(slug) && folder === "blog") return "blogEntry"
|
|
16
|
-
|
|
17
|
-
return "generic"
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export const pageCategoryExpression = `
|
|
21
|
-
select(
|
|
22
|
-
defined(slug.current) &&
|
|
23
|
-
slug.current != "" &&
|
|
24
|
-
slug.current != "/" &&
|
|
25
|
-
pageFolder->slug.current == "blog" => "blogEntry",
|
|
26
|
-
"generic"
|
|
27
|
-
)
|
|
28
|
-
`
|