bsmnt 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/application/add-integration/index.d.ts.map +1 -1
- package/dist/application/add-integration/index.js +19 -2
- package/dist/application/add-integration/index.js.map +1 -1
- package/dist/application/shared/node-version.js.map +1 -1
- package/dist/core/create/internal-ids.d.ts +3 -0
- package/dist/core/create/internal-ids.d.ts.map +1 -1
- package/dist/core/create/internal-ids.js +4 -0
- package/dist/core/create/internal-ids.js.map +1 -1
- package/dist/domain/agents.d.ts.map +1 -1
- package/dist/domain/animations.d.ts.map +1 -1
- package/dist/domain/cms.d.ts.map +1 -1
- package/dist/domain/forms.d.ts.map +1 -1
- package/dist/domain/hooks.d.ts.map +1 -1
- package/dist/domain/skills.d.ts.map +1 -1
- package/dist/domain/templates.d.ts +10 -0
- package/dist/domain/templates.d.ts.map +1 -1
- package/dist/domain/templates.js +5 -0
- package/dist/domain/templates.js.map +1 -1
- package/dist/index.js +18 -5
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/agents/register-sanity-mcp.js +3 -8
- package/dist/infrastructure/agents/register-sanity-mcp.js.map +1 -1
- package/dist/infrastructure/agents/register-storybook-mcp.d.ts +18 -0
- package/dist/infrastructure/agents/register-storybook-mcp.d.ts.map +1 -0
- package/dist/infrastructure/agents/register-storybook-mcp.js +157 -0
- package/dist/infrastructure/agents/register-storybook-mcp.js.map +1 -0
- package/dist/infrastructure/create/lifecycle-registry.d.ts.map +1 -1
- package/dist/infrastructure/create/lifecycle-registry.js +39 -1
- package/dist/infrastructure/create/lifecycle-registry.js.map +1 -1
- package/dist/infrastructure/create/merge-registry.d.ts.map +1 -1
- package/dist/infrastructure/create/merge-registry.js +4 -0
- package/dist/infrastructure/create/merge-registry.js.map +1 -1
- package/dist/infrastructure/create/sanity-auth.js.map +1 -1
- package/dist/infrastructure/create/setup-agent.d.ts +6 -1
- package/dist/infrastructure/create/setup-agent.d.ts.map +1 -1
- package/dist/infrastructure/create/setup-agent.js +23 -21
- package/dist/infrastructure/create/setup-agent.js.map +1 -1
- package/dist/infrastructure/create/setup-dotenvx.js.map +1 -1
- package/dist/infrastructure/create/setup-remote.js.map +1 -1
- package/dist/infrastructure/create/setup-sanity.d.ts.map +1 -1
- package/dist/infrastructure/create/setup-sanity.js +12 -1
- package/dist/infrastructure/create/setup-sanity.js.map +1 -1
- package/dist/infrastructure/integrations/ensure-studio-headers.d.ts +6 -0
- package/dist/infrastructure/integrations/ensure-studio-headers.d.ts.map +1 -0
- package/dist/infrastructure/integrations/ensure-studio-headers.js +153 -0
- package/dist/infrastructure/integrations/ensure-studio-headers.js.map +1 -0
- package/dist/infrastructure/integrations/inject-integration.d.ts.map +1 -1
- package/dist/infrastructure/integrations/inject-integration.js +2 -0
- package/dist/infrastructure/integrations/inject-integration.js.map +1 -1
- package/dist/infrastructure/update/notifier.js.map +1 -1
- package/dist/modules/features/cms/index.d.ts.map +1 -1
- package/dist/modules/features/cms/index.js +2 -0
- package/dist/modules/features/cms/index.js.map +1 -1
- package/dist/modules/features/cms/sanity/config.d.ts.map +1 -1
- package/dist/modules/features/cms/sanity/config.js +3 -1
- package/dist/modules/features/cms/sanity/config.js.map +1 -1
- package/dist/modules/features/cms/sanity/index.d.ts.map +1 -1
- package/dist/modules/features/cms/sanity/index.js +10 -1
- package/dist/modules/features/cms/sanity/index.js.map +1 -1
- package/dist/modules/features/cms/sanity/mergers/check-integration.d.ts.map +1 -1
- package/dist/modules/features/cms/sanity/mergers/check-integration.js +15 -6
- package/dist/modules/features/cms/sanity/mergers/check-integration.js.map +1 -1
- package/dist/modules/features/cms/sanity/mergers/knip.d.ts.map +1 -1
- package/dist/modules/features/cms/sanity/mergers/knip.js +1 -0
- package/dist/modules/features/cms/sanity/mergers/knip.js.map +1 -1
- package/dist/modules/features/cms/sanity/mergers/layout.js.map +1 -1
- package/dist/modules/features/cms/sanity/mergers/package-json.d.ts +12 -0
- package/dist/modules/features/cms/sanity/mergers/package-json.d.ts.map +1 -0
- package/dist/modules/features/cms/sanity/mergers/package-json.js +19 -0
- package/dist/modules/features/cms/sanity/mergers/package-json.js.map +1 -0
- package/dist/modules/features/cms/sanity-pagebuilder/config.d.ts.map +1 -1
- package/dist/modules/features/cms/sanity-pagebuilder/config.js +2 -1
- package/dist/modules/features/cms/sanity-pagebuilder/config.js.map +1 -1
- package/dist/modules/features/cms/sanity-pagebuilder/index.d.ts.map +1 -1
- package/dist/modules/features/cms/sanity-pagebuilder/index.js +7 -1
- package/dist/modules/features/cms/sanity-pagebuilder/index.js.map +1 -1
- package/dist/modules/features/cms/sanity-pagebuilder-cache/config.d.ts +14 -0
- package/dist/modules/features/cms/sanity-pagebuilder-cache/config.d.ts.map +1 -0
- package/dist/modules/features/cms/sanity-pagebuilder-cache/config.js +50 -0
- package/dist/modules/features/cms/sanity-pagebuilder-cache/config.js.map +1 -0
- package/dist/modules/features/cms/sanity-pagebuilder-cache/index.d.ts +3 -0
- package/dist/modules/features/cms/sanity-pagebuilder-cache/index.d.ts.map +1 -0
- package/dist/modules/features/cms/sanity-pagebuilder-cache/index.js +55 -0
- package/dist/modules/features/cms/sanity-pagebuilder-cache/index.js.map +1 -0
- package/dist/modules/presets/index.d.ts.map +1 -1
- package/dist/modules/presets/index.js +2 -0
- package/dist/modules/presets/index.js.map +1 -1
- package/dist/modules/presets/next-pagebuilder-cache.d.ts +3 -0
- package/dist/modules/presets/next-pagebuilder-cache.d.ts.map +1 -0
- package/dist/modules/presets/next-pagebuilder-cache.js +10 -0
- package/dist/modules/presets/next-pagebuilder-cache.js.map +1 -0
- package/dist/paths.d.ts +6 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +6 -0
- package/dist/paths.js.map +1 -1
- package/package.json +6 -3
- package/src/modules/features/cms/sanity/files/app/api/blog/[slug]/route.ts +4 -1
- package/src/modules/features/cms/sanity/files/app/sitemap.md/route.ts +2 -1
- package/src/modules/features/cms/sanity/files/components/ui/sanity-image/index.tsx +19 -5
- package/src/modules/features/cms/sanity/files/lib/integrations/check-integration.ts +7 -6
- package/src/modules/features/cms/sanity/files/lib/integrations/sanity/README.md +32 -1
- package/src/modules/features/cms/sanity/files/lib/integrations/sanity/components/rich-text.tsx +1 -0
- package/src/modules/features/cms/sanity/files/lib/integrations/sanity/env.ts +2 -2
- package/src/modules/features/cms/sanity/files/proxy.ts +9 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/app/api/[[...slug]]/route.ts +12 -3
- package/src/modules/features/cms/sanity-pagebuilder/files/app/api/revalidate/route.ts +172 -24
- package/src/modules/features/cms/sanity-pagebuilder/files/app/feed.xml/route.ts +14 -7
- package/src/modules/features/cms/sanity-pagebuilder/files/app/sitemap.md/route.ts +8 -2
- package/src/modules/features/cms/sanity-pagebuilder/files/app/studio/[[...tool]]/page.tsx +16 -1
- package/src/modules/features/cms/sanity-pagebuilder/files/components/sanity/rich-text.tsx +1 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/components/sanity/visual-editing.tsx +2 -2
- package/src/modules/features/cms/sanity-pagebuilder/files/components/ui/sanity-image/index.tsx +15 -5
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/check-integration.ts +6 -5
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/client.ts +8 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/slug-field.tsx +13 -7
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/slug-notices.tsx +125 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/env.ts +2 -2
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/fetchers/layout.ts +22 -52
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/icons.ts +2 -2
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/live/index.tsx +4 -2
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/markdown-proxy.config.ts +1 -1
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/page-builder-config.ts +7 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/page-tree-pane.tsx +70 -57
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/queries.ts +119 -29
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/revalidate-paths.ts +70 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/index.ts +1 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/reusable/rich-text-block.ts +39 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/index.ts +2 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/layout/redirect.ts +35 -4
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/page.ts +12 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/tags.ts +56 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/utils/page-builder-markdown.ts +12 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/utils/sitemap.ts +11 -8
- package/src/modules/features/cms/sanity-pagebuilder/files/proxy.ts +9 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/.knip.json +8 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/app/api/[[...slug]]/route.ts +112 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/app/api/draft-mode/disable/route.ts +7 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/app/api/draft-mode/enable/route.ts +20 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/app/api/revalidate/route.ts +292 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/app/feed.xml/route.ts +66 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/app/sitemap.md/route.ts +132 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/app/studio/[[...tool]]/layout.tsx +26 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/app/studio/[[...tool]]/page.tsx +23 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/components/sanity/draft-mode-toggle.tsx +27 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/components/sanity/rich-text.tsx +88 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/components/sanity/visual-editing.tsx +11 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/components/ui/sanity-image/index.tsx +51 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/check-integration.ts +6 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/client.ts +37 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/block-actions-item.tsx +81 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/disable-draft-mode.tsx +23 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/page-builder-input.tsx +39 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/page-category-input.tsx +50 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/same-as-input.tsx +66 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/slug-field.tsx +24 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/slug-input.tsx +14 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/slug-notices.tsx +125 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/confirm-publish-action.ts +40 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/env.ts +34 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/fetchers/layout.ts +39 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/fetchers/redirects.ts +22 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/icons.ts +81 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/live/index.tsx +140 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/markdown-proxy.config.ts +50 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/page-builder-config.ts +144 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/page-category.ts +28 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/page-tree-pane.tsx +431 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/pinned-pages.ts +54 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/presentation.ts +119 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/queries.ts +548 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/revalidate-paths.ts +70 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/sanity.cli.ts +29 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/sanity.config.ts +116 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/index.ts +6 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/reusable/blog-content.ts +89 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/reusable/description.ts +29 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/reusable/gated-content.ts +178 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/reusable/hero.ts +28 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/reusable/rich-text-block.ts +39 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/singleton/content-collection.ts +45 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/content/author.ts +70 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/content/blog-category.ts +55 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/index.ts +134 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/layout/company-data.ts +70 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/layout/footer.ts +79 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/layout/navbar.ts +75 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/layout/redirect.ts +152 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/layout/structured-data.ts +124 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/link.ts +125 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/logo-field.ts +9 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/metadata.ts +132 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/nav-objects.ts +192 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/page-builder.ts +43 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/page-folder.ts +124 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/page.ts +265 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/richText.ts +63 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/structured-data-blocks.ts +436 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/singletons.ts +51 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/structure.ts +334 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/tags.ts +89 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/utils/image.ts +8 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/utils/link.ts +140 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/utils/page-builder-markdown.ts +113 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/utils/page-json-ld.ts +208 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/scripts/sanity-typegen.ts +36 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/utils/check-redirect.ts +30 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/utils/json-ld.tsx +522 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/utils/metadata.ts +189 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/utils/rss.ts +96 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/utils/sitemap.ts +58 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/proxy.ts +90 -0
- package/src/modules/features/env/dotenvx/files/vercelignore +5 -0
- package/src/templates/next-default/.env.example +4 -2
- package/src/templates/next-default/.github/workflows/ci.yml +1 -1
- package/src/templates/next-default/.vscode/settings.json +0 -2
- package/src/templates/next-default/app/robots.ts +2 -3
- package/src/templates/next-default/components/ui/image/index.tsx +2 -4
- package/src/templates/next-default/knip.json +1 -1
- package/src/templates/next-default/lefthook.yml +1 -1
- package/src/templates/next-default/lib/utils/README.md +18 -5
- package/src/templates/next-default/lib/utils/image-sizes.ts +72 -0
- package/src/templates/next-default/lib/utils/merge-refs.ts +56 -0
- package/src/templates/next-default/lib/utils/strings.ts +1 -51
- package/src/templates/next-default/next.config.ts +38 -5
- package/src/templates/next-default/package.json +9 -12
- package/src/templates/next-experiments/.env.example +4 -2
- package/src/templates/next-experiments/.github/workflows/ci.yml +1 -1
- package/src/templates/next-experiments/.vscode/settings.json +0 -2
- package/src/templates/next-experiments/app/page.tsx +1 -1
- package/src/templates/next-experiments/app/robots.ts +2 -3
- package/src/templates/next-experiments/components/ui/image/index.tsx +2 -4
- package/src/templates/next-experiments/knip.json +1 -1
- package/src/templates/next-experiments/lefthook.yml +1 -1
- package/src/templates/next-experiments/lib/utils/README.md +18 -5
- package/src/templates/next-experiments/lib/utils/image-sizes.ts +72 -0
- package/src/templates/next-experiments/lib/utils/merge-refs.ts +56 -0
- package/src/templates/next-experiments/lib/utils/strings.ts +1 -51
- package/src/templates/next-experiments/next.config.ts +38 -5
- package/src/templates/next-experiments/package.json +9 -12
- package/src/templates/next-pagebuilder/.env.example +3 -0
- package/src/templates/next-pagebuilder/.github/workflows/ci.yml +1 -1
- package/src/templates/next-pagebuilder/.vscode/settings.json +0 -2
- package/src/templates/next-pagebuilder/README.md +95 -0
- package/src/templates/next-pagebuilder/app/(content)/[[...slug]]/page.tsx +24 -9
- package/src/templates/next-pagebuilder/app/robots.ts +2 -3
- package/src/templates/next-pagebuilder/app/sitemap.xml/route.ts +9 -4
- package/src/templates/next-pagebuilder/biome.json +2 -1
- package/src/templates/next-pagebuilder/components/layout/footer/index.tsx +3 -6
- package/src/templates/next-pagebuilder/components/layout/header/index.tsx +3 -2
- package/src/templates/next-pagebuilder/components/layout/json-ld/index.tsx +3 -8
- package/src/templates/next-pagebuilder/components/page-builder/components/content-collection/content-filters.tsx +23 -40
- package/src/templates/next-pagebuilder/components/page-builder/components/content-collection/index.tsx +88 -58
- package/src/templates/next-pagebuilder/components/page-builder/components/content-collection/skeleton.tsx +41 -0
- package/src/templates/next-pagebuilder/components/page-builder/components/content-collection/types.ts +14 -1
- package/src/templates/next-pagebuilder/components/page-builder/components/rich-text-block.tsx +16 -0
- package/src/templates/next-pagebuilder/components/page-builder/renderer.tsx +23 -3
- package/src/templates/next-pagebuilder/components/page-document/index.tsx +1 -0
- package/src/templates/next-pagebuilder/components/ui/image/index.tsx +2 -1
- package/src/templates/next-pagebuilder/knip.json +3 -2
- package/src/templates/next-pagebuilder/lefthook.yml +1 -1
- package/src/templates/next-pagebuilder/lib/integrations/sanity/sanity.types.ts +1221 -977
- package/src/templates/next-pagebuilder/lib/utils/image-sizes.ts +72 -0
- package/src/templates/next-pagebuilder/lib/utils/merge-refs.ts +56 -0
- package/src/templates/next-pagebuilder/next.config.ts +35 -5
- package/src/templates/next-pagebuilder/package.json +8 -10
- package/src/templates/next-pagebuilder-cache/.biome/plugins/README.md +21 -0
- package/src/templates/next-pagebuilder-cache/.biome/plugins/no-anchor-element.grit +12 -0
- package/src/templates/next-pagebuilder-cache/.biome/plugins/no-relative-parent-imports.grit +10 -0
- package/src/templates/next-pagebuilder-cache/.biome/plugins/no-unnecessary-forwardref.grit +9 -0
- package/src/templates/next-pagebuilder-cache/.env.example +40 -0
- package/src/templates/next-pagebuilder-cache/.github/PULL_REQUEST_TEMPLATE.md +13 -0
- package/src/templates/next-pagebuilder-cache/.github/workflows/ci.yml +105 -0
- package/src/templates/next-pagebuilder-cache/.vscode/extensions.json +19 -0
- package/src/templates/next-pagebuilder-cache/.vscode/settings.json +103 -0
- package/src/templates/next-pagebuilder-cache/.zed/settings.json +47 -0
- package/src/templates/next-pagebuilder-cache/README.md +212 -0
- package/src/templates/next-pagebuilder-cache/_gitignore +65 -0
- package/src/templates/next-pagebuilder-cache/app/(content)/[[...slug]]/page.tsx +124 -0
- package/src/templates/next-pagebuilder-cache/app/(content)/layout.tsx +28 -0
- package/src/templates/next-pagebuilder-cache/app/actions/unlock-gated-content.ts +53 -0
- package/src/templates/next-pagebuilder-cache/app/favicon.ico +0 -0
- package/src/templates/next-pagebuilder-cache/app/layout.tsx +83 -0
- package/src/templates/next-pagebuilder-cache/app/robots.ts +13 -0
- package/src/templates/next-pagebuilder-cache/app/sitemap.xml/route.ts +84 -0
- package/src/templates/next-pagebuilder-cache/biome.json +257 -0
- package/src/templates/next-pagebuilder-cache/components/layout/footer/index.tsx +127 -0
- package/src/templates/next-pagebuilder-cache/components/layout/header/components/cta-button.tsx +28 -0
- package/src/templates/next-pagebuilder-cache/components/layout/header/components/mega-menu-panel.tsx +90 -0
- package/src/templates/next-pagebuilder-cache/components/layout/header/components/nav-item-renderer.tsx +98 -0
- package/src/templates/next-pagebuilder-cache/components/layout/header/components/nav-leaf-item.tsx +33 -0
- package/src/templates/next-pagebuilder-cache/components/layout/header/components/types.ts +7 -0
- package/src/templates/next-pagebuilder-cache/components/layout/header/header-client.tsx +110 -0
- package/src/templates/next-pagebuilder-cache/components/layout/header/index.tsx +32 -0
- package/src/templates/next-pagebuilder-cache/components/layout/json-ld/index.tsx +79 -0
- package/src/templates/next-pagebuilder-cache/components/layout/wrapper/index.tsx +33 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/article-content/index.tsx +78 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/article-content/related-post-item.tsx +27 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/content-collection/content-card.tsx +66 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/content-collection/content-filters.tsx +76 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/content-collection/content-grid.tsx +40 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/content-collection/content-pagination-nav.tsx +71 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/content-collection/index.tsx +306 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/content-collection/skeleton.tsx +41 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/content-collection/types.ts +32 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/description.tsx +17 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/gated-content/index.tsx +169 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/hero.tsx +17 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/rich-text-block.tsx +16 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/renderer.tsx +71 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/types.ts +25 -0
- package/src/templates/next-pagebuilder-cache/components/page-document/index.tsx +147 -0
- package/src/templates/next-pagebuilder-cache/components/ui/image/index.tsx +216 -0
- package/src/templates/next-pagebuilder-cache/components/ui/link/index.tsx +152 -0
- package/src/templates/next-pagebuilder-cache/components.json +24 -0
- package/src/templates/next-pagebuilder-cache/knip.json +35 -0
- package/src/templates/next-pagebuilder-cache/lefthook.yml +25 -0
- package/src/templates/next-pagebuilder-cache/lib/integrations/sanity/sanity.types.ts +1588 -0
- package/src/templates/next-pagebuilder-cache/lib/scripts/setup-ci-secrets.ts +117 -0
- package/src/templates/next-pagebuilder-cache/lib/styles/cn.ts +5 -0
- package/src/templates/next-pagebuilder-cache/lib/styles/global.css +69 -0
- package/src/templates/next-pagebuilder-cache/lib/utils/base-url.ts +17 -0
- package/src/templates/next-pagebuilder-cache/lib/utils/format-date.ts +8 -0
- package/src/templates/next-pagebuilder-cache/lib/utils/slug-tag.ts +6 -0
- package/src/templates/next-pagebuilder-cache/next.config.ts +176 -0
- package/src/templates/next-pagebuilder-cache/package.json +62 -0
- package/src/templates/next-pagebuilder-cache/postcss.config.mjs +65 -0
- package/src/templates/next-pagebuilder-cache/svg.d.ts +6 -0
- package/src/templates/next-pagebuilder-cache/tsconfig.json +38 -0
- package/src/templates/next-webgl/.env.example +4 -2
- package/src/templates/next-webgl/.github/workflows/ci.yml +1 -1
- package/src/templates/next-webgl/.vscode/settings.json +0 -2
- package/src/templates/next-webgl/app/robots.ts +2 -3
- package/src/templates/next-webgl/components/ui/image/index.tsx +2 -4
- package/src/templates/next-webgl/knip.json +1 -1
- package/src/templates/next-webgl/lefthook.yml +1 -1
- package/src/templates/next-webgl/lib/utils/README.md +18 -5
- package/src/templates/next-webgl/lib/utils/image-sizes.ts +72 -0
- package/src/templates/next-webgl/lib/utils/merge-refs.ts +56 -0
- package/src/templates/next-webgl/lib/utils/strings.ts +1 -51
- package/src/templates/next-webgl/next.config.ts +38 -5
- package/src/templates/next-webgl/package.json +11 -14
- package/src/templates/next-experiments/tsconfig.tsbuildinfo +0 -1
- package/src/templates/next-pagebuilder/app/actions/refresh.ts +0 -5
- package/src/templates/next-webgl/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { stegaClean } from "@sanity/client/stega"
|
|
2
|
+
import type { ContentCollectionSearchParams } from "@/components/page-builder/components/content-collection/types"
|
|
3
|
+
import { Renderer } from "@/components/page-builder/renderer"
|
|
4
|
+
import type { PAGE_QUERY_RESULT } from "@/lib/integrations/sanity/sanity.types"
|
|
5
|
+
import { urlForImage } from "@/lib/integrations/sanity/utils/image"
|
|
6
|
+
import { buildPageJsonLd } from "@/lib/integrations/sanity/utils/page-json-ld"
|
|
7
|
+
import {
|
|
8
|
+
generateBreadcrumbJsonLd,
|
|
9
|
+
generateSanityArticleJsonLd,
|
|
10
|
+
generateSanityWebPageJsonLd,
|
|
11
|
+
JsonLd,
|
|
12
|
+
} from "@/lib/utils/json-ld"
|
|
13
|
+
|
|
14
|
+
type PageDocumentProps = {
|
|
15
|
+
page: NonNullable<PAGE_QUERY_RESULT>
|
|
16
|
+
path: string | null
|
|
17
|
+
searchParams: ContentCollectionSearchParams
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
type PageBuilderBlock = NonNullable<
|
|
21
|
+
NonNullable<PAGE_QUERY_RESULT>["pageBuilder"]
|
|
22
|
+
>[number]
|
|
23
|
+
type BlogContentBlock = Extract<PageBuilderBlock, { _type: "blogContent" }>
|
|
24
|
+
|
|
25
|
+
export const getPageSections = (
|
|
26
|
+
page: NonNullable<PAGE_QUERY_RESULT>,
|
|
27
|
+
searchParams: ContentCollectionSearchParams
|
|
28
|
+
) =>
|
|
29
|
+
page.pageBuilder?.length
|
|
30
|
+
? [
|
|
31
|
+
<Renderer
|
|
32
|
+
key="page-builder"
|
|
33
|
+
blocks={page.pageBuilder}
|
|
34
|
+
searchParams={searchParams}
|
|
35
|
+
// Cleaned because the slug becomes a GROQ parameter: in draft mode the
|
|
36
|
+
// projection carries stega characters that would break the match.
|
|
37
|
+
pinnedCategory={stegaClean(page.collectionCategory)}
|
|
38
|
+
/>,
|
|
39
|
+
]
|
|
40
|
+
: []
|
|
41
|
+
|
|
42
|
+
const buildBreadcrumbs = (
|
|
43
|
+
slugPath: string | null,
|
|
44
|
+
pageTitle: string | null
|
|
45
|
+
): Array<{ name: string; url: string }> => {
|
|
46
|
+
const items: Array<{ name: string; url: string }> = [
|
|
47
|
+
{ name: "Home", url: "/" },
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
if (!slugPath) return items
|
|
51
|
+
|
|
52
|
+
const segments = slugPath.split("/").filter(Boolean)
|
|
53
|
+
for (let i = 0; i < segments.length; i++) {
|
|
54
|
+
const isLast = i === segments.length - 1
|
|
55
|
+
const url = `/${segments.slice(0, i + 1).join("/")}`
|
|
56
|
+
|
|
57
|
+
//TODO: we might change this in the future if slug title and folder diverge too much :)
|
|
58
|
+
|
|
59
|
+
const name =
|
|
60
|
+
isLast && pageTitle
|
|
61
|
+
? pageTitle
|
|
62
|
+
: (segments[i]
|
|
63
|
+
?.replace(/-/g, " ")
|
|
64
|
+
.replace(/\b\w/g, (c) => c.toUpperCase()) ?? "")
|
|
65
|
+
items.push({ name, url })
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return items
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export const PageDocument = ({
|
|
72
|
+
page,
|
|
73
|
+
path,
|
|
74
|
+
searchParams,
|
|
75
|
+
}: PageDocumentProps) => {
|
|
76
|
+
const title = stegaClean(page.title) || page.title
|
|
77
|
+
const sections = getPageSections(page, searchParams)
|
|
78
|
+
|
|
79
|
+
const cleanTitle = stegaClean(page.title) || "Basement"
|
|
80
|
+
const cleanDescription = stegaClean(
|
|
81
|
+
page.metadata?.metaDescription || page.metadata?.description
|
|
82
|
+
)
|
|
83
|
+
const pageUrl = path ? `/${path}` : "/"
|
|
84
|
+
|
|
85
|
+
const ogImage = page.metadata?.image
|
|
86
|
+
? urlForImage(page.metadata.image).width(1200).height(630).url()
|
|
87
|
+
: undefined
|
|
88
|
+
|
|
89
|
+
const breadcrumbs = buildBreadcrumbs(path, cleanTitle)
|
|
90
|
+
const hasBreadcrumbs = breadcrumbs.length > 1
|
|
91
|
+
|
|
92
|
+
// Editor-selected page-level structured data (FAQ, Event, custom, etc.).
|
|
93
|
+
const pageJsonLd = buildPageJsonLd(page.metadata?.jsonLd)
|
|
94
|
+
|
|
95
|
+
// Blog posts (pages with a Blog Content block) emit Article JSON-LD with
|
|
96
|
+
// fields derived from the post — no Custom block needed. Skipped when the
|
|
97
|
+
// editor already supplied an Article (via a Custom block) to avoid duplicates.
|
|
98
|
+
const blogBlock = page.pageBuilder?.find(
|
|
99
|
+
(block): block is BlogContentBlock => block?._type === "blogContent"
|
|
100
|
+
)
|
|
101
|
+
const hasManualArticle = pageJsonLd.some(
|
|
102
|
+
({ data }) => (data as { "@type"?: unknown })["@type"] === "Article"
|
|
103
|
+
)
|
|
104
|
+
const articleJsonLd =
|
|
105
|
+
blogBlock && !hasManualArticle
|
|
106
|
+
? generateSanityArticleJsonLd({
|
|
107
|
+
title: cleanTitle,
|
|
108
|
+
url: pageUrl,
|
|
109
|
+
description: cleanDescription || undefined,
|
|
110
|
+
image: blogBlock.thumbnail
|
|
111
|
+
? urlForImage(blogBlock.thumbnail).width(1200).height(630).url()
|
|
112
|
+
: undefined,
|
|
113
|
+
datePublished: stegaClean(blogBlock.date) || undefined,
|
|
114
|
+
dateModified: page._updatedAt,
|
|
115
|
+
authorName: stegaClean(blogBlock.author?.name) || undefined,
|
|
116
|
+
})
|
|
117
|
+
: null
|
|
118
|
+
|
|
119
|
+
return (
|
|
120
|
+
<>
|
|
121
|
+
<JsonLd
|
|
122
|
+
data={generateSanityWebPageJsonLd({
|
|
123
|
+
title: cleanTitle,
|
|
124
|
+
url: pageUrl,
|
|
125
|
+
description: cleanDescription || undefined,
|
|
126
|
+
image: ogImage,
|
|
127
|
+
dateModified: page._updatedAt,
|
|
128
|
+
})}
|
|
129
|
+
/>
|
|
130
|
+
{articleJsonLd ? <JsonLd data={articleJsonLd} /> : null}
|
|
131
|
+
{hasBreadcrumbs ? (
|
|
132
|
+
<JsonLd data={generateBreadcrumbJsonLd(breadcrumbs)} />
|
|
133
|
+
) : null}
|
|
134
|
+
{pageJsonLd.map(({ key, data }) => (
|
|
135
|
+
<JsonLd key={key} data={data} />
|
|
136
|
+
))}
|
|
137
|
+
<article className="mx-auto flex w-full max-w-6xl flex-1 flex-col gap-14 px-4 py-14 md:px-6 md:py-20">
|
|
138
|
+
<h1>{title}</h1>
|
|
139
|
+
{sections.length ? (
|
|
140
|
+
sections
|
|
141
|
+
) : (
|
|
142
|
+
<section>No page content has been added yet.</section>
|
|
143
|
+
)}
|
|
144
|
+
</article>
|
|
145
|
+
</>
|
|
146
|
+
)
|
|
147
|
+
}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enhanced Image Component
|
|
3
|
+
*
|
|
4
|
+
* Next.js Image wrapper with optimized defaults and error handling.
|
|
5
|
+
* Always use this component instead of next/image directly.
|
|
6
|
+
*/
|
|
7
|
+
"use client"
|
|
8
|
+
|
|
9
|
+
import cn from "clsx"
|
|
10
|
+
import NextImage, { type ImageProps as NextImageProps } from "next/image"
|
|
11
|
+
import type { CSSProperties, Ref } from "react"
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Enhanced Image component props extending Next.js Image.
|
|
15
|
+
*
|
|
16
|
+
* Adds responsive sizing, aspect ratio support, and automatic blur placeholders.
|
|
17
|
+
* Always use this component instead of next/image directly.
|
|
18
|
+
*/
|
|
19
|
+
export type ImageProps = Omit<NextImageProps, "objectFit" | "alt"> & {
|
|
20
|
+
/** CSS object-fit property for image positioning */
|
|
21
|
+
objectFit?: CSSProperties["objectFit"]
|
|
22
|
+
/** Display as block element (adds display: block) */
|
|
23
|
+
block?: boolean
|
|
24
|
+
/** Size on mobile devices (e.g., "100vw", "50vw") */
|
|
25
|
+
mobileSize?: `${number}vw`
|
|
26
|
+
/** Size on desktop devices (e.g., "33vw", "25vw") */
|
|
27
|
+
desktopSize?: `${number}vw`
|
|
28
|
+
/** Ref for accessing the underlying img element */
|
|
29
|
+
ref?: Ref<HTMLImageElement>
|
|
30
|
+
/** Alt text for accessibility (required for meaningful images) */
|
|
31
|
+
alt?: string
|
|
32
|
+
/** Aspect ratio for automatic placeholder and layout stability */
|
|
33
|
+
aspectRatio?: number
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Memoize helper functions to avoid recreation
|
|
37
|
+
const toBase64 = (str: string) =>
|
|
38
|
+
typeof window === "undefined"
|
|
39
|
+
? Buffer.from(str).toString("base64")
|
|
40
|
+
: window.btoa(str)
|
|
41
|
+
|
|
42
|
+
// Helper to generate blur placeholder with transparent background by default
|
|
43
|
+
const generateShimmer = (w: number, h: number) => `
|
|
44
|
+
<svg width="${w}" height="${h}" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
45
|
+
<defs>
|
|
46
|
+
<linearGradient id="g">
|
|
47
|
+
<stop stop-color="rgba(255,255,255,0.1)" offset="20%" />
|
|
48
|
+
<stop stop-color="rgba(255,255,255,0.2)" offset="50%" />
|
|
49
|
+
<stop stop-color="rgba(255,255,255,0.1)" offset="70%" />
|
|
50
|
+
</linearGradient>
|
|
51
|
+
</defs>
|
|
52
|
+
<rect width="${w}" height="${h}" fill="rgba(0,0,0,0)" />
|
|
53
|
+
<rect id="r" width="${w}" height="${h}" fill="url(#g)" />
|
|
54
|
+
<animate xlink:href="#r" attributeName="x" from="-${w}" to="${w}" dur="1s" repeatCount="indefinite" />
|
|
55
|
+
</svg>`
|
|
56
|
+
|
|
57
|
+
// Helper to determine if blur placeholder should be used
|
|
58
|
+
const shouldUseBlurPlaceholder = (
|
|
59
|
+
src: NextImageProps["src"],
|
|
60
|
+
placeholder: string,
|
|
61
|
+
blurDataURL: string | undefined
|
|
62
|
+
): boolean => {
|
|
63
|
+
if (!src) return false
|
|
64
|
+
const isSvg = typeof src === "string" && src.includes(".svg")
|
|
65
|
+
return !isSvg && placeholder === "blur" && !blurDataURL
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Helper to generate blur data URL
|
|
69
|
+
const generateBlurDataURL = (
|
|
70
|
+
shouldUse: boolean,
|
|
71
|
+
aspectRatio: number | undefined,
|
|
72
|
+
existingBlurDataURL: string | undefined
|
|
73
|
+
): string | undefined => {
|
|
74
|
+
if (!(shouldUse && aspectRatio)) return existingBlurDataURL
|
|
75
|
+
|
|
76
|
+
const shimmerSvg = generateShimmer(700, Math.round(700 / aspectRatio))
|
|
77
|
+
return `data:image/svg+xml;base64,${toBase64(shimmerSvg)}`
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Helper to determine final placeholder value
|
|
81
|
+
const getFinalPlaceholder = (
|
|
82
|
+
shouldUse: boolean,
|
|
83
|
+
aspectRatio: number | undefined,
|
|
84
|
+
blurDataURL: string | undefined,
|
|
85
|
+
originalPlaceholder: NextImageProps["placeholder"]
|
|
86
|
+
): NextImageProps["placeholder"] => {
|
|
87
|
+
if (!shouldUse) {
|
|
88
|
+
return originalPlaceholder === "blur" && !blurDataURL
|
|
89
|
+
? "empty"
|
|
90
|
+
: originalPlaceholder
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return aspectRatio || blurDataURL ? "blur" : "empty"
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Enhanced Image component with responsive sizing and automatic optimizations.
|
|
98
|
+
*
|
|
99
|
+
* Always use this component instead of next/image directly. Provides:
|
|
100
|
+
* - Automatic responsive sizes generation
|
|
101
|
+
* - Smart blur placeholders with aspect ratio support
|
|
102
|
+
* - Performance optimizations (lazy loading by default)
|
|
103
|
+
* - Priority flag for LCP images
|
|
104
|
+
*
|
|
105
|
+
* @param props - Image props extending Next.js Image
|
|
106
|
+
* @param props.aspectRatio - Aspect ratio for layout stability and blur placeholder
|
|
107
|
+
* @param props.mobileSize - Size on mobile (e.g., "100vw")
|
|
108
|
+
* @param props.desktopSize - Size on desktop (e.g., "50vw")
|
|
109
|
+
* @param props.block - Display as block element
|
|
110
|
+
* @param props.priority - Prioritize loading for LCP images
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```tsx
|
|
114
|
+
* // Basic usage with aspect ratio
|
|
115
|
+
* <Image
|
|
116
|
+
* src="/hero.jpg"
|
|
117
|
+
* alt="Hero image"
|
|
118
|
+
* aspectRatio={16/9}
|
|
119
|
+
* />
|
|
120
|
+
* ```
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```tsx
|
|
124
|
+
* // LCP image with priority
|
|
125
|
+
* <Image
|
|
126
|
+
* src="/hero.jpg"
|
|
127
|
+
* alt="Hero image"
|
|
128
|
+
* aspectRatio={16/9}
|
|
129
|
+
* priority // Preloads image for LCP
|
|
130
|
+
* />
|
|
131
|
+
* ```
|
|
132
|
+
*
|
|
133
|
+
* @example
|
|
134
|
+
* ```tsx
|
|
135
|
+
* // Responsive grid image
|
|
136
|
+
* <Image
|
|
137
|
+
* src="/product.jpg"
|
|
138
|
+
* alt="Product"
|
|
139
|
+
* aspectRatio={1}
|
|
140
|
+
* mobileSize="100vw"
|
|
141
|
+
* desktopSize="33vw"
|
|
142
|
+
* />
|
|
143
|
+
* ```
|
|
144
|
+
*/
|
|
145
|
+
export function Image({
|
|
146
|
+
style,
|
|
147
|
+
className,
|
|
148
|
+
objectFit = "cover",
|
|
149
|
+
quality = 90,
|
|
150
|
+
alt = "",
|
|
151
|
+
fill,
|
|
152
|
+
block = !fill,
|
|
153
|
+
width = block ? 1 : undefined,
|
|
154
|
+
height = block ? 1 : undefined,
|
|
155
|
+
mobileSize = "100vw",
|
|
156
|
+
desktopSize = "100vw",
|
|
157
|
+
sizes,
|
|
158
|
+
src,
|
|
159
|
+
unoptimized,
|
|
160
|
+
ref,
|
|
161
|
+
aspectRatio,
|
|
162
|
+
placeholder = "blur",
|
|
163
|
+
priority = false,
|
|
164
|
+
...props
|
|
165
|
+
}: ImageProps) {
|
|
166
|
+
// Generate responsive sizes if not provided
|
|
167
|
+
const finalSizes =
|
|
168
|
+
sizes || `(max-width: 1440px) ${mobileSize}, ${desktopSize}`
|
|
169
|
+
|
|
170
|
+
// Early return after hooks
|
|
171
|
+
if (!src) return null
|
|
172
|
+
|
|
173
|
+
// Determine SVG status and placeholder logic
|
|
174
|
+
const isSvg = typeof src === "string" && src.includes(".svg")
|
|
175
|
+
const shouldUsePlaceholder = shouldUseBlurPlaceholder(
|
|
176
|
+
src,
|
|
177
|
+
placeholder,
|
|
178
|
+
props.blurDataURL
|
|
179
|
+
)
|
|
180
|
+
const blurDataURL = generateBlurDataURL(
|
|
181
|
+
shouldUsePlaceholder,
|
|
182
|
+
aspectRatio,
|
|
183
|
+
props.blurDataURL
|
|
184
|
+
)
|
|
185
|
+
const finalPlaceholder = getFinalPlaceholder(
|
|
186
|
+
shouldUsePlaceholder,
|
|
187
|
+
aspectRatio,
|
|
188
|
+
props.blurDataURL,
|
|
189
|
+
placeholder
|
|
190
|
+
)
|
|
191
|
+
|
|
192
|
+
return (
|
|
193
|
+
<NextImage
|
|
194
|
+
ref={ref}
|
|
195
|
+
fill={!block}
|
|
196
|
+
{...(width !== undefined && { width })}
|
|
197
|
+
{...(height !== undefined && { height })}
|
|
198
|
+
priority={priority}
|
|
199
|
+
quality={quality}
|
|
200
|
+
alt={alt}
|
|
201
|
+
style={{
|
|
202
|
+
objectFit,
|
|
203
|
+
...style,
|
|
204
|
+
}}
|
|
205
|
+
className={cn(className, block && "block w-full")}
|
|
206
|
+
sizes={finalSizes}
|
|
207
|
+
src={src}
|
|
208
|
+
unoptimized={unoptimized || isSvg}
|
|
209
|
+
draggable={false}
|
|
210
|
+
onDragStart={(e) => e.preventDefault()}
|
|
211
|
+
{...(finalPlaceholder && { placeholder: finalPlaceholder })}
|
|
212
|
+
{...(blurDataURL && { blurDataURL })}
|
|
213
|
+
{...props}
|
|
214
|
+
/>
|
|
215
|
+
)
|
|
216
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import NextLink from "next/link"
|
|
4
|
+
import { usePathname } from "next/navigation"
|
|
5
|
+
import {
|
|
6
|
+
type AnchorHTMLAttributes,
|
|
7
|
+
type ComponentProps,
|
|
8
|
+
type MouseEvent,
|
|
9
|
+
useEffect,
|
|
10
|
+
useState,
|
|
11
|
+
} from "react"
|
|
12
|
+
|
|
13
|
+
// Helper to extract props safe for button elements
|
|
14
|
+
function getButtonProps(props: Record<string, unknown>) {
|
|
15
|
+
const {
|
|
16
|
+
href,
|
|
17
|
+
target,
|
|
18
|
+
rel,
|
|
19
|
+
"data-external": _dataExternal,
|
|
20
|
+
...buttonProps
|
|
21
|
+
} = props
|
|
22
|
+
return buttonProps
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Helper to extract props safe for div elements
|
|
26
|
+
function getDivProps(props: Record<string, unknown>) {
|
|
27
|
+
const {
|
|
28
|
+
href,
|
|
29
|
+
target,
|
|
30
|
+
rel,
|
|
31
|
+
onClick,
|
|
32
|
+
"data-external": _dataExternal,
|
|
33
|
+
...divProps
|
|
34
|
+
} = props
|
|
35
|
+
return divProps
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
type CustomLinkProps = Omit<
|
|
39
|
+
AnchorHTMLAttributes<HTMLAnchorElement>,
|
|
40
|
+
keyof ComponentProps<typeof NextLink> | "href"
|
|
41
|
+
> &
|
|
42
|
+
Omit<ComponentProps<typeof NextLink>, "href"> & {
|
|
43
|
+
href?: string
|
|
44
|
+
onClick?: (e: MouseEvent<HTMLElement>) => void
|
|
45
|
+
scroll?: boolean
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function Link({
|
|
49
|
+
href,
|
|
50
|
+
children,
|
|
51
|
+
onClick,
|
|
52
|
+
scroll = false, // Default to false to prevent scroll restoration warnings with fixed/sticky elements
|
|
53
|
+
...props
|
|
54
|
+
}: CustomLinkProps) {
|
|
55
|
+
const [shouldPrefetch, setShouldPrefetch] = useState(false)
|
|
56
|
+
const [isExternal, setIsExternal] = useState(false)
|
|
57
|
+
const [isActive, setIsActive] = useState(false)
|
|
58
|
+
|
|
59
|
+
// Get pathname - deferred to avoid blocking static generation
|
|
60
|
+
// usePathname is safe to call but we defer the active check to useEffect
|
|
61
|
+
const pathname = usePathname()
|
|
62
|
+
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
// Check if this link is active (current page)
|
|
65
|
+
if (href && pathname) {
|
|
66
|
+
setIsActive(pathname === href)
|
|
67
|
+
}
|
|
68
|
+
}, [href, pathname])
|
|
69
|
+
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
// Skip if no href
|
|
72
|
+
if (!href) return
|
|
73
|
+
|
|
74
|
+
// Check if external link
|
|
75
|
+
try {
|
|
76
|
+
const url = new URL(href, window.location.href)
|
|
77
|
+
setIsExternal(url.host !== window.location.host)
|
|
78
|
+
} catch {
|
|
79
|
+
setIsExternal(false)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Only prefetch on good connections
|
|
83
|
+
const connection = (
|
|
84
|
+
navigator as Navigator & {
|
|
85
|
+
connection?: { effectiveType: string; saveData: boolean }
|
|
86
|
+
}
|
|
87
|
+
).connection
|
|
88
|
+
if (connection) {
|
|
89
|
+
const { effectiveType, saveData } = connection
|
|
90
|
+
setShouldPrefetch(effectiveType === "4g" && !saveData)
|
|
91
|
+
} else {
|
|
92
|
+
// Default to prefetching if API not available
|
|
93
|
+
setShouldPrefetch(true)
|
|
94
|
+
}
|
|
95
|
+
}, [href])
|
|
96
|
+
|
|
97
|
+
// If no href is provided but there's an onClick, render a button
|
|
98
|
+
if (!href && onClick) {
|
|
99
|
+
return (
|
|
100
|
+
<button
|
|
101
|
+
onClick={(e: MouseEvent<HTMLButtonElement>) => onClick(e)}
|
|
102
|
+
type="button"
|
|
103
|
+
{...getButtonProps(props)}
|
|
104
|
+
>
|
|
105
|
+
{children}
|
|
106
|
+
</button>
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// If no href and no onClick, render a div
|
|
111
|
+
if (!href) {
|
|
112
|
+
return <div {...getDivProps(props)}>{children}</div>
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Block dangerous URIs (javascript:, data:, vbscript:)
|
|
116
|
+
const isDangerousHref = /^(javascript|data|vbscript):/i.test(href)
|
|
117
|
+
if (isDangerousHref) {
|
|
118
|
+
return <span {...getDivProps(props)}>{children}</span>
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// For SSR, check if it's external based on the href pattern
|
|
122
|
+
const isExternalSSR =
|
|
123
|
+
href.startsWith("http://") || href.startsWith("https://")
|
|
124
|
+
|
|
125
|
+
if (isExternalSSR || isExternal) {
|
|
126
|
+
return (
|
|
127
|
+
<a
|
|
128
|
+
href={href}
|
|
129
|
+
target="_blank"
|
|
130
|
+
rel="noopener noreferrer"
|
|
131
|
+
data-external
|
|
132
|
+
onClick={onClick}
|
|
133
|
+
{...props}
|
|
134
|
+
>
|
|
135
|
+
{children}
|
|
136
|
+
</a>
|
|
137
|
+
)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
<NextLink
|
|
142
|
+
href={href as ComponentProps<typeof NextLink>["href"]}
|
|
143
|
+
prefetch={shouldPrefetch}
|
|
144
|
+
scroll={scroll}
|
|
145
|
+
data-active={isActive || undefined}
|
|
146
|
+
{...(onClick && { onClick })}
|
|
147
|
+
{...props}
|
|
148
|
+
>
|
|
149
|
+
{children}
|
|
150
|
+
</NextLink>
|
|
151
|
+
)
|
|
152
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
+
"style": "new-york",
|
|
4
|
+
"rsc": true,
|
|
5
|
+
"tsx": true,
|
|
6
|
+
"tailwind": {
|
|
7
|
+
"config": "",
|
|
8
|
+
"css": "lib/styles/global.css",
|
|
9
|
+
"baseColor": "neutral",
|
|
10
|
+
"cssVariables": true,
|
|
11
|
+
"prefix": ""
|
|
12
|
+
},
|
|
13
|
+
"aliases": {
|
|
14
|
+
"components": "@/components",
|
|
15
|
+
"utils": "@/lib/styles/cn",
|
|
16
|
+
"ui": "@/components/ui",
|
|
17
|
+
"lib": "@/lib",
|
|
18
|
+
"hooks": "@/lib/hooks"
|
|
19
|
+
},
|
|
20
|
+
"iconLibrary": "phosphor",
|
|
21
|
+
"registries": {
|
|
22
|
+
"@basement": "https://basement-registry.vercel.app/r/{name}.json"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://unpkg.com/knip@6/schema.json",
|
|
3
|
+
"entry": [
|
|
4
|
+
"lib/integrations/sanity/**/*.{ts,tsx}",
|
|
5
|
+
"lib/scripts/**/*.{ts,tsx}",
|
|
6
|
+
"lib/utils/**/*.{ts,tsx}",
|
|
7
|
+
"components/**/*.{ts,tsx}",
|
|
8
|
+
"app/actions/**/*.{ts,tsx}"
|
|
9
|
+
],
|
|
10
|
+
"ignoreDependencies": [
|
|
11
|
+
"zod",
|
|
12
|
+
"react-use",
|
|
13
|
+
"@portabletext/types",
|
|
14
|
+
"@portabletext/react",
|
|
15
|
+
"@portabletext/markdown",
|
|
16
|
+
"@sanity/vision",
|
|
17
|
+
"@sanity/visual-editing",
|
|
18
|
+
"@sanity/ui",
|
|
19
|
+
"@svgr/webpack",
|
|
20
|
+
"postcss-functions",
|
|
21
|
+
"clsx",
|
|
22
|
+
"rxjs",
|
|
23
|
+
"gsap",
|
|
24
|
+
"@gsap/react",
|
|
25
|
+
"motion",
|
|
26
|
+
"detect-gpu",
|
|
27
|
+
"lodash-es",
|
|
28
|
+
"@types/lodash-es",
|
|
29
|
+
"react-device-detect",
|
|
30
|
+
"zustand",
|
|
31
|
+
"@sanity/browserslist-config"
|
|
32
|
+
],
|
|
33
|
+
"ignoreBinaries": ["gh", "op", "vercel"],
|
|
34
|
+
"ignoreFiles": [".agents/**", ".claude/**", "hooks/**", "lib/integrations/hubspot/**"]
|
|
35
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Lefthook configuration for git hooks
|
|
2
|
+
# Cross-platform compatible (Windows, macOS, Linux)
|
|
3
|
+
# https://github.com/evilmartians/lefthook
|
|
4
|
+
|
|
5
|
+
pre-commit:
|
|
6
|
+
parallel: true
|
|
7
|
+
commands:
|
|
8
|
+
biome:
|
|
9
|
+
glob: '*.{js,mjs,ts,jsx,tsx,css,scss}'
|
|
10
|
+
run: bun biome check --max-diagnostics=200 --write --unsafe {staged_files}
|
|
11
|
+
stage_fixed: true
|
|
12
|
+
typecheck:
|
|
13
|
+
glob: '*.{ts,tsx}'
|
|
14
|
+
run: bunx tsc --noEmit --incremental false
|
|
15
|
+
stage_fixed: false
|
|
16
|
+
|
|
17
|
+
post-merge:
|
|
18
|
+
commands:
|
|
19
|
+
install-deps:
|
|
20
|
+
run: bun i
|
|
21
|
+
|
|
22
|
+
post-checkout:
|
|
23
|
+
commands:
|
|
24
|
+
install-deps:
|
|
25
|
+
run: '[ "{3}" = "1" ] && bun i || true'
|