bsmnt 0.12.0 → 0.13.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 +23 -0
- package/dist/application/add-integration/index.js.map +1 -1
- package/dist/domain/consent.d.ts +17 -0
- package/dist/domain/consent.d.ts.map +1 -0
- package/dist/domain/consent.js +13 -0
- package/dist/domain/consent.js.map +1 -0
- package/dist/domain/integration.d.ts +19 -2
- package/dist/domain/integration.d.ts.map +1 -1
- package/dist/domain/integration.js +10 -1
- package/dist/domain/integration.js.map +1 -1
- package/dist/domain/jobs.d.ts +17 -0
- package/dist/domain/jobs.d.ts.map +1 -0
- package/dist/domain/jobs.js +13 -0
- package/dist/domain/jobs.js.map +1 -0
- package/dist/domain/skills.d.ts +23 -2
- package/dist/domain/skills.d.ts.map +1 -1
- package/dist/domain/skills.js +23 -2
- package/dist/domain/skills.js.map +1 -1
- package/dist/domain/templates.d.ts +7 -1
- package/dist/domain/templates.d.ts.map +1 -1
- package/dist/domain/templates.js +2 -0
- package/dist/domain/templates.js.map +1 -1
- package/dist/index.js +34 -9
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/create/setup-agent.d.ts.map +1 -1
- package/dist/infrastructure/create/setup-agent.js +11 -4
- package/dist/infrastructure/create/setup-agent.js.map +1 -1
- package/dist/infrastructure/integrations/inject-integration.d.ts.map +1 -1
- package/dist/infrastructure/integrations/inject-integration.js +36 -2
- package/dist/infrastructure/integrations/inject-integration.js.map +1 -1
- package/dist/modules/features/consent/ketch/config.d.ts +18 -0
- package/dist/modules/features/consent/ketch/config.d.ts.map +1 -0
- package/dist/modules/features/consent/ketch/config.js +24 -0
- package/dist/modules/features/consent/ketch/config.js.map +1 -0
- package/dist/modules/features/consent/ketch/mergers/biome.d.ts +16 -0
- package/dist/modules/features/consent/ketch/mergers/biome.d.ts.map +1 -0
- package/dist/modules/features/consent/ketch/mergers/biome.js +31 -0
- package/dist/modules/features/consent/ketch/mergers/biome.js.map +1 -0
- package/dist/modules/features/consent/ketch/mergers/check-integration.d.ts +13 -0
- package/dist/modules/features/consent/ketch/mergers/check-integration.d.ts.map +1 -0
- package/dist/modules/features/consent/ketch/mergers/check-integration.js +64 -0
- package/dist/modules/features/consent/ketch/mergers/check-integration.js.map +1 -0
- package/dist/modules/features/consent/ketch/mergers/env-example.d.ts +12 -0
- package/dist/modules/features/consent/ketch/mergers/env-example.d.ts.map +1 -0
- package/dist/modules/features/consent/ketch/mergers/env-example.js +28 -0
- package/dist/modules/features/consent/ketch/mergers/env-example.js.map +1 -0
- package/dist/modules/features/consent/ketch/mergers/footer.d.ts +17 -0
- package/dist/modules/features/consent/ketch/mergers/footer.d.ts.map +1 -0
- package/dist/modules/features/consent/ketch/mergers/footer.js +40 -0
- package/dist/modules/features/consent/ketch/mergers/footer.js.map +1 -0
- package/dist/modules/features/consent/ketch/mergers/knip.d.ts +18 -0
- package/dist/modules/features/consent/ketch/mergers/knip.d.ts.map +1 -0
- package/dist/modules/features/consent/ketch/mergers/knip.js +37 -0
- package/dist/modules/features/consent/ketch/mergers/knip.js.map +1 -0
- package/dist/modules/features/consent/ketch/mergers/layout.d.ts +25 -0
- package/dist/modules/features/consent/ketch/mergers/layout.d.ts.map +1 -0
- package/dist/modules/features/consent/ketch/mergers/layout.js +55 -0
- package/dist/modules/features/consent/ketch/mergers/layout.js.map +1 -0
- package/dist/modules/features/jobs/ashby/config.d.ts +19 -0
- package/dist/modules/features/jobs/ashby/config.d.ts.map +1 -0
- package/dist/modules/features/jobs/ashby/config.js +29 -0
- package/dist/modules/features/jobs/ashby/config.js.map +1 -0
- package/dist/modules/features/jobs/ashby/mergers/check-integration.d.ts +14 -0
- package/dist/modules/features/jobs/ashby/mergers/check-integration.d.ts.map +1 -0
- package/dist/modules/features/jobs/ashby/mergers/check-integration.js +78 -0
- package/dist/modules/features/jobs/ashby/mergers/check-integration.js.map +1 -0
- package/dist/modules/features/jobs/ashby/mergers/env-example.d.ts +12 -0
- package/dist/modules/features/jobs/ashby/mergers/env-example.d.ts.map +1 -0
- package/dist/modules/features/jobs/ashby/mergers/env-example.js +27 -0
- package/dist/modules/features/jobs/ashby/mergers/env-example.js.map +1 -0
- package/dist/modules/features/jobs/ashby/mergers/knip.d.ts +18 -0
- package/dist/modules/features/jobs/ashby/mergers/knip.d.ts.map +1 -0
- package/dist/modules/features/jobs/ashby/mergers/knip.js +41 -0
- package/dist/modules/features/jobs/ashby/mergers/knip.js.map +1 -0
- package/dist/paths.d.ts +12 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +12 -0
- package/dist/paths.js.map +1 -1
- package/package.json +3 -1
- package/src/agent-skills/ashby-pagebuilder-block/SKILL.md +277 -0
- package/src/agent-skills/hubspot-pagebuilder-block/SKILL.md +58 -25
- package/src/agent-skills/ketch-consent-check/SKILL.md +197 -0
- package/src/agent-skills/ketch-consent-setup/SKILL.md +326 -0
- package/src/agent-skills/ketch-consent-setup/references/ui-customization.md +329 -0
- package/src/agent-skills/page-builder-block/SKILL.md +150 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/anchor-id-input.tsx +17 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/presentation-input.tsx +146 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/spacing-steps-input.tsx +84 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/fetchers/layout.ts +6 -3
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/icons.ts +8 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/queries.ts +12 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/reusable/blog-content.ts +3 -3
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/reusable/description.ts +3 -3
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/reusable/gated-content.ts +3 -3
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/reusable/hero.ts +3 -3
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/reusable/rich-text-block.ts +3 -3
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/singleton/content-collection.ts +3 -3
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/index.ts +8 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/layout/spacing-settings.ts +120 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/anchor.ts +75 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/block.ts +46 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/presentation.ts +44 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/spacing.ts +164 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/singletons.ts +7 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/anchor-id-input.tsx +17 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/presentation-input.tsx +146 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/spacing-steps-input.tsx +84 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/fetchers/layout.ts +4 -2
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/icons.ts +8 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/queries.ts +12 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/reusable/blog-content.ts +3 -3
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/reusable/description.ts +3 -3
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/reusable/gated-content.ts +3 -3
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/reusable/hero.ts +3 -3
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/reusable/rich-text-block.ts +3 -3
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/singleton/content-collection.ts +3 -3
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/index.ts +8 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/layout/spacing-settings.ts +120 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/anchor.ts +75 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/block.ts +46 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/presentation.ts +44 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/spacing.ts +164 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/singletons.ts +7 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/tags.ts +2 -0
- package/src/modules/features/consent/ketch/files/lib/integrations/check-integration.ts +25 -0
- package/src/modules/features/consent/ketch/files/lib/integrations/ketch/README.md +70 -0
- package/src/modules/features/consent/ketch/files/lib/integrations/ketch/categories.ts +20 -0
- package/src/modules/features/consent/ketch/files/lib/integrations/ketch/consent-store.ts +107 -0
- package/src/modules/features/consent/ketch/files/lib/integrations/ketch/env.ts +20 -0
- package/src/modules/features/consent/ketch/files/lib/integrations/ketch/ketch-experience.css +136 -0
- package/src/modules/features/consent/ketch/files/lib/integrations/ketch/preferences-button.tsx +51 -0
- package/src/modules/features/consent/ketch/files/lib/integrations/ketch/script.tsx +8 -0
- package/src/modules/features/consent/ketch/files/lib/integrations/ketch/types.ts +15 -0
- package/src/modules/features/consent/ketch/files/lib/integrations/ketch/use-consent.ts +26 -0
- package/src/modules/features/jobs/ashby/files/_sanity-adapter/job-board-block.ts +53 -0
- package/src/modules/features/jobs/ashby/files/lib/integrations/ashby/README.md +134 -0
- package/src/modules/features/jobs/ashby/files/lib/integrations/ashby/env.ts +3 -0
- package/src/modules/features/jobs/ashby/files/lib/integrations/ashby/index.ts +40 -0
- package/src/modules/features/jobs/ashby/files/lib/integrations/ashby/normalize.ts +124 -0
- package/src/modules/features/jobs/ashby/files/lib/integrations/ashby/types.ts +20 -0
- package/src/modules/features/jobs/ashby/files/lib/integrations/check-integration.ts +25 -0
- package/src/templates/next-pagebuilder/AGENTS.md +129 -0
- package/src/templates/next-pagebuilder/CLAUDE.md +3 -0
- package/src/templates/next-pagebuilder/README.md +70 -0
- package/src/templates/next-pagebuilder/app/(content)/layout.tsx +2 -0
- package/src/templates/next-pagebuilder/components/layout/spacing-scale/index.tsx +18 -0
- package/src/templates/next-pagebuilder/components/page-builder/components/article-content/index.tsx +1 -1
- package/src/templates/next-pagebuilder/components/page-builder/components/content-collection/index.tsx +2 -2
- package/src/templates/next-pagebuilder/components/page-builder/components/description.tsx +3 -7
- package/src/templates/next-pagebuilder/components/page-builder/components/gated-content/index.tsx +2 -2
- package/src/templates/next-pagebuilder/components/page-builder/components/hero.tsx +3 -7
- package/src/templates/next-pagebuilder/components/page-builder/components/rich-text-block.tsx +3 -5
- package/src/templates/next-pagebuilder/components/page-builder/registry.tsx +70 -0
- package/src/templates/next-pagebuilder/components/page-builder/renderer.tsx +33 -49
- package/src/templates/next-pagebuilder/components/page-builder/section.tsx +35 -0
- package/src/templates/next-pagebuilder/components/page-document/index.tsx +1 -1
- package/src/templates/next-pagebuilder/lib/integrations/sanity/sanity.types.ts +92 -4
- package/src/templates/next-pagebuilder-cache/AGENTS.md +136 -0
- package/src/templates/next-pagebuilder-cache/CLAUDE.md +3 -0
- package/src/templates/next-pagebuilder-cache/README.md +75 -0
- package/src/templates/next-pagebuilder-cache/app/(content)/layout.tsx +2 -0
- package/src/templates/next-pagebuilder-cache/components/layout/spacing-scale/index.tsx +46 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/article-content/index.tsx +1 -1
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/content-collection/index.tsx +2 -2
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/description.tsx +3 -7
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/gated-content/index.tsx +2 -2
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/hero.tsx +3 -7
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/rich-text-block.tsx +3 -5
- package/src/templates/next-pagebuilder-cache/components/page-builder/registry.tsx +70 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/renderer.tsx +33 -49
- package/src/templates/next-pagebuilder-cache/components/page-builder/section.tsx +35 -0
- package/src/templates/next-pagebuilder-cache/components/page-document/index.tsx +1 -1
- package/src/templates/next-pagebuilder-cache/lib/integrations/sanity/sanity.types.ts +92 -4
|
@@ -5,13 +5,9 @@ type DescriptionProps = {
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
export function Description({ block }: DescriptionProps) {
|
|
8
|
-
if (!block.description) return null
|
|
9
|
-
|
|
10
8
|
return (
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
</p>
|
|
15
|
-
</section>
|
|
9
|
+
<p className="max-w-[62ch] text-base/7 text-current/72 md:text-lg/8">
|
|
10
|
+
{block.description}
|
|
11
|
+
</p>
|
|
16
12
|
)
|
|
17
13
|
}
|
package/src/templates/next-pagebuilder/components/page-builder/components/gated-content/index.tsx
CHANGED
|
@@ -64,7 +64,7 @@ export function GatedContent({ block }: GatedContentProps) {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
return (
|
|
67
|
-
<
|
|
67
|
+
<div>
|
|
68
68
|
{block.teaserHeading ? (
|
|
69
69
|
<h2 className="mb-4 font-semibold text-2xl tracking-tight md:text-4xl">
|
|
70
70
|
{block.teaserHeading}
|
|
@@ -114,7 +114,7 @@ export function GatedContent({ block }: GatedContentProps) {
|
|
|
114
114
|
</button>
|
|
115
115
|
</form>
|
|
116
116
|
)}
|
|
117
|
-
</
|
|
117
|
+
</div>
|
|
118
118
|
)
|
|
119
119
|
}
|
|
120
120
|
|
|
@@ -5,13 +5,9 @@ type HeroProps = {
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
export function Hero({ block }: HeroProps) {
|
|
8
|
-
if (!block.headline) return null
|
|
9
|
-
|
|
10
8
|
return (
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
</h1>
|
|
15
|
-
</section>
|
|
9
|
+
<h1 className="max-w-4xl font-semibold text-4xl tracking-tight md:text-6xl">
|
|
10
|
+
{block.headline}
|
|
11
|
+
</h1>
|
|
16
12
|
)
|
|
17
13
|
}
|
package/src/templates/next-pagebuilder/components/page-builder/components/rich-text-block.tsx
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import { RichText } from "@/components/sanity/rich-text"
|
|
2
1
|
import type { PageBuilderBlock } from "@/components/page-builder/types"
|
|
2
|
+
import { RichText } from "@/components/sanity/rich-text"
|
|
3
3
|
|
|
4
4
|
type RichTextBlockProps = {
|
|
5
5
|
block: Extract<PageBuilderBlock, { _type: "richTextBlock" }>
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
export function RichTextBlock({ block }: RichTextBlockProps) {
|
|
9
|
-
if (!block.content) return null
|
|
10
|
-
|
|
11
9
|
return (
|
|
12
|
-
<
|
|
10
|
+
<div className="prose max-w-none">
|
|
13
11
|
<RichText content={block.content} />
|
|
14
|
-
</
|
|
12
|
+
</div>
|
|
15
13
|
)
|
|
16
14
|
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { ReactNode } from "react"
|
|
2
|
+
import type { PageBuilderDocumentType } from "@/lib/integrations/sanity/page-builder-config"
|
|
3
|
+
import { ArticleContent } from "./components/article-content"
|
|
4
|
+
import { ContentCollection } from "./components/content-collection"
|
|
5
|
+
import type {
|
|
6
|
+
ContentCollectionSearchParams,
|
|
7
|
+
PinnedCollectionCategory,
|
|
8
|
+
} from "./components/content-collection/types"
|
|
9
|
+
import { Description } from "./components/description"
|
|
10
|
+
import { GatedContent } from "./components/gated-content"
|
|
11
|
+
import { Hero } from "./components/hero"
|
|
12
|
+
import { RichTextBlock } from "./components/rich-text-block"
|
|
13
|
+
import type { PageBuilderBlock } from "./types"
|
|
14
|
+
|
|
15
|
+
export type BlockContext = {
|
|
16
|
+
searchParams: ContentCollectionSearchParams
|
|
17
|
+
pinnedCategory: PinnedCollectionCategory
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
type BlockOf<T extends PageBuilderDocumentType> = Extract<
|
|
21
|
+
PageBuilderBlock,
|
|
22
|
+
{ _type: T }
|
|
23
|
+
>
|
|
24
|
+
|
|
25
|
+
type BlockEntry<T extends PageBuilderDocumentType> = {
|
|
26
|
+
render: (block: BlockOf<T>, context: BlockContext) => ReactNode
|
|
27
|
+
/** Skips the block *and* its `<Section>`, so no padded gap is left behind. */
|
|
28
|
+
isEmpty?: (block: BlockOf<T>) => boolean
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const blockRegistry: {
|
|
32
|
+
[T in PageBuilderDocumentType]: BlockEntry<T>
|
|
33
|
+
} = {
|
|
34
|
+
blogCollection: {
|
|
35
|
+
render: (block, { searchParams, pinnedCategory }) => (
|
|
36
|
+
<ContentCollection
|
|
37
|
+
block={block}
|
|
38
|
+
pinnedCategory={pinnedCategory}
|
|
39
|
+
searchParams={searchParams}
|
|
40
|
+
/>
|
|
41
|
+
),
|
|
42
|
+
},
|
|
43
|
+
blogContent: {
|
|
44
|
+
render: (block) => <ArticleContent block={block} />,
|
|
45
|
+
},
|
|
46
|
+
description: {
|
|
47
|
+
render: (block) => <Description block={block} />,
|
|
48
|
+
isEmpty: (block) => !block.description,
|
|
49
|
+
},
|
|
50
|
+
gatedContent: {
|
|
51
|
+
render: (block) => <GatedContent block={block} />,
|
|
52
|
+
},
|
|
53
|
+
hero: {
|
|
54
|
+
render: (block) => <Hero block={block} />,
|
|
55
|
+
isEmpty: (block) => !block.headline,
|
|
56
|
+
},
|
|
57
|
+
richTextBlock: {
|
|
58
|
+
render: (block) => <RichTextBlock block={block} />,
|
|
59
|
+
isEmpty: (block) => !block.content?.length,
|
|
60
|
+
},
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Indexing the registry with the union collapses its per-key signatures into an
|
|
65
|
+
* intersection nothing satisfies, so the widening happens once, here.
|
|
66
|
+
*/
|
|
67
|
+
export const getBlockEntry = (
|
|
68
|
+
type: PageBuilderDocumentType
|
|
69
|
+
): BlockEntry<PageBuilderDocumentType> | undefined =>
|
|
70
|
+
blockRegistry[type] as BlockEntry<PageBuilderDocumentType> | undefined
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
reserveAnchorIds,
|
|
3
|
+
resolveAnchorId,
|
|
4
|
+
} from "@/lib/integrations/sanity/schemas/shared/anchor"
|
|
3
5
|
import type {
|
|
4
6
|
ContentCollectionSearchParams,
|
|
5
7
|
PinnedCollectionCategory,
|
|
6
8
|
} from "./components/content-collection/types"
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { Hero } from "./components/hero"
|
|
10
|
-
import { RichTextBlock } from "./components/rich-text-block"
|
|
9
|
+
import { type BlockContext, getBlockEntry } from "./registry"
|
|
10
|
+
import { Section } from "./section"
|
|
11
11
|
import type { PageBuilderBlock, PageBuilderBlocks } from "./types"
|
|
12
12
|
|
|
13
13
|
type RendererProps = {
|
|
@@ -23,49 +23,33 @@ export function Renderer({
|
|
|
23
23
|
}: RendererProps) {
|
|
24
24
|
if (!blocks?.length) return null
|
|
25
25
|
|
|
26
|
+
const context: BlockContext = { searchParams, pinnedCategory }
|
|
27
|
+
|
|
28
|
+
const reservedAnchorIds = reserveAnchorIds(blocks)
|
|
29
|
+
const takenAnchorIds = new Set<string>()
|
|
30
|
+
|
|
26
31
|
return (
|
|
27
|
-
|
|
28
|
-
{blocks.map((block: PageBuilderBlock) =>
|
|
29
|
-
|
|
30
|
-
key={block._key}
|
|
31
|
-
block={block}
|
|
32
|
-
searchParams={searchParams}
|
|
33
|
-
pinnedCategory={pinnedCategory}
|
|
34
|
-
/>
|
|
35
|
-
))}
|
|
36
|
-
</div>
|
|
37
|
-
)
|
|
38
|
-
}
|
|
32
|
+
<>
|
|
33
|
+
{blocks.map((block: PageBuilderBlock) => {
|
|
34
|
+
const entry = getBlockEntry(block._type)
|
|
39
35
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return <ArticleContent block={block} />
|
|
60
|
-
case "hero":
|
|
61
|
-
return <Hero block={block} />
|
|
62
|
-
case "description":
|
|
63
|
-
return <Description block={block} />
|
|
64
|
-
case "richTextBlock":
|
|
65
|
-
return <RichTextBlock block={block} />
|
|
66
|
-
case "gatedContent":
|
|
67
|
-
return <GatedContent block={block} />
|
|
68
|
-
default:
|
|
69
|
-
return null
|
|
70
|
-
}
|
|
36
|
+
// No entry means the content is ahead of the generated types.
|
|
37
|
+
if (!entry || entry.isEmpty?.(block)) return null
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<Section
|
|
41
|
+
anchorId={resolveAnchorId(
|
|
42
|
+
block,
|
|
43
|
+
takenAnchorIds,
|
|
44
|
+
reservedAnchorIds
|
|
45
|
+
)}
|
|
46
|
+
key={block._key}
|
|
47
|
+
presentation={block.presentation}
|
|
48
|
+
>
|
|
49
|
+
{entry.render(block, context)}
|
|
50
|
+
</Section>
|
|
51
|
+
)
|
|
52
|
+
})}
|
|
53
|
+
</>
|
|
54
|
+
)
|
|
71
55
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ReactNode } from "react"
|
|
2
|
+
import { spacingPaddingValue } from "@/lib/integrations/sanity/schemas/shared/spacing"
|
|
3
|
+
import { cn } from "@/lib/styles/cn"
|
|
4
|
+
|
|
5
|
+
export type SectionPresentation = {
|
|
6
|
+
paddingTop?: string | null
|
|
7
|
+
paddingBottom?: string | null
|
|
8
|
+
} | null
|
|
9
|
+
|
|
10
|
+
type SectionProps = {
|
|
11
|
+
anchorId?: string | null | undefined
|
|
12
|
+
presentation?: SectionPresentation | undefined
|
|
13
|
+
className?: string | undefined
|
|
14
|
+
children: ReactNode
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function Section({
|
|
18
|
+
anchorId,
|
|
19
|
+
presentation,
|
|
20
|
+
className,
|
|
21
|
+
children,
|
|
22
|
+
}: SectionProps) {
|
|
23
|
+
return (
|
|
24
|
+
<section
|
|
25
|
+
id={anchorId || undefined}
|
|
26
|
+
style={{
|
|
27
|
+
paddingTop: spacingPaddingValue(presentation?.paddingTop),
|
|
28
|
+
paddingBottom: spacingPaddingValue(presentation?.paddingBottom),
|
|
29
|
+
}}
|
|
30
|
+
className={cn(anchorId && "scroll-mt-24", className)}
|
|
31
|
+
>
|
|
32
|
+
{children}
|
|
33
|
+
</section>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
@@ -132,7 +132,7 @@ export const PageDocument = ({
|
|
|
132
132
|
{pageJsonLd.map(({ key, data }) => (
|
|
133
133
|
<JsonLd key={key} data={data} />
|
|
134
134
|
))}
|
|
135
|
-
<article className="mx-auto flex w-full max-w-6xl flex-1 flex-col
|
|
135
|
+
<article className="mx-auto flex w-full max-w-6xl flex-1 flex-col px-4 py-14 md:px-6 md:py-20">
|
|
136
136
|
<h1>{title}</h1>
|
|
137
137
|
{sections.length ? (
|
|
138
138
|
sections
|