bsmnt 0.13.1 → 0.14.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/modules/features/cms/sanity-pagebuilder/config.d.ts.map +1 -1
- package/dist/modules/features/cms/sanity-pagebuilder/config.js +1 -0
- package/dist/modules/features/cms/sanity-pagebuilder/config.js.map +1 -1
- package/dist/modules/features/cms/sanity-pagebuilder-cache/config.d.ts.map +1 -1
- package/dist/modules/features/cms/sanity-pagebuilder-cache/config.js +1 -0
- package/dist/modules/features/cms/sanity-pagebuilder-cache/config.js.map +1 -1
- package/package.json +1 -1
- package/src/agent-skills/ashby-pagebuilder-block/SKILL.md +29 -11
- package/src/agent-skills/hubspot-pagebuilder-block/SKILL.md +31 -12
- package/src/agent-skills/page-builder-block/SKILL.md +26 -13
- package/src/modules/features/cms/sanity-pagebuilder/files/app/api/revalidate/route.ts +2 -2
- package/src/modules/features/cms/sanity-pagebuilder/files/components/sanity/rich-text.tsx +1 -1
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/block-actions-item.tsx +2 -2
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/component-preview-frame.tsx +124 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/component-preview-pane.tsx +25 -0
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/page-builder-input.tsx +3 -26
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/page-builder-insert-menu.tsx +121 -93
- 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/page-builder-config.ts +21 -49
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/presentation.ts +1 -50
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/queries.ts +56 -64
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/sanity.config.ts +4 -8
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/index.ts +0 -1
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/index.ts +1 -4
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/block.ts +4 -4
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/page-builder.ts +4 -18
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/page.ts +11 -37
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/singletons.ts +0 -16
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/structure.ts +36 -34
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/utils/studio-embed.ts +22 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/app/api/revalidate/route.ts +2 -2
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/components/sanity/rich-text.tsx +1 -1
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/block-actions-item.tsx +2 -2
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/component-preview-frame.tsx +124 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/component-preview-pane.tsx +25 -0
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/page-builder-input.tsx +3 -26
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/page-builder-insert-menu.tsx +121 -93
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/icons.ts +2 -2
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/page-builder-config.ts +21 -49
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/presentation.ts +1 -50
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/queries.ts +56 -64
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/sanity.config.ts +4 -8
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/index.ts +0 -1
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/index.ts +1 -4
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/block.ts +4 -4
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/page-builder.ts +4 -18
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/page.ts +11 -37
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/singletons.ts +0 -16
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/structure.ts +36 -34
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/utils/studio-embed.ts +22 -0
- package/src/modules/features/forms/hubspot/files/_sanity-adapter/form-block.ts +4 -10
- package/src/modules/features/forms/hubspot/files/lib/integrations/hubspot/README.md +10 -5
- package/src/modules/features/jobs/ashby/files/_sanity-adapter/job-board-block.ts +0 -7
- package/src/modules/features/jobs/ashby/files/lib/integrations/ashby/README.md +11 -5
- package/src/templates/next-pagebuilder/AGENTS.md +19 -7
- package/src/templates/next-pagebuilder/README.md +15 -3
- package/src/templates/next-pagebuilder/app/actions/unlock-gated-content.ts +5 -4
- package/src/templates/next-pagebuilder/app/components/page.tsx +81 -0
- package/src/templates/next-pagebuilder/components/page-builder/components/gated-content/index.tsx +8 -3
- package/src/templates/next-pagebuilder/components/page-builder/library.ts +183 -0
- package/src/templates/next-pagebuilder/components/page-builder/registry.tsx +4 -1
- package/src/templates/next-pagebuilder/components/page-builder/renderer.tsx +3 -1
- package/src/templates/next-pagebuilder/components/page-builder/stage.tsx +10 -0
- package/src/templates/next-pagebuilder/components/page-document/index.tsx +1 -0
- package/src/templates/next-pagebuilder/lib/integrations/sanity/sanity.types.ts +139 -271
- package/src/templates/next-pagebuilder-cache/AGENTS.md +19 -7
- package/src/templates/next-pagebuilder-cache/README.md +15 -3
- package/src/templates/next-pagebuilder-cache/app/actions/unlock-gated-content.ts +5 -4
- package/src/templates/next-pagebuilder-cache/app/components/page.tsx +91 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/components/gated-content/index.tsx +8 -3
- package/src/templates/next-pagebuilder-cache/components/page-builder/library.ts +183 -0
- package/src/templates/next-pagebuilder-cache/components/page-builder/registry.tsx +4 -1
- package/src/templates/next-pagebuilder-cache/components/page-builder/renderer.tsx +3 -1
- package/src/templates/next-pagebuilder-cache/components/page-builder/stage.tsx +10 -0
- package/src/templates/next-pagebuilder-cache/components/page-document/index.tsx +1 -0
- package/src/templates/next-pagebuilder-cache/lib/integrations/sanity/sanity.types.ts +139 -271
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/use-studio-preview-urls.ts +0 -62
- package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/studio-preview.ts +0 -37
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/use-studio-preview-urls.ts +0 -62
- package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/studio-preview.ts +0 -37
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from "react";
|
|
2
|
-
import { useClient } from "sanity";
|
|
3
|
-
import { apiVersion } from "@/lib/integrations/sanity/env";
|
|
4
|
-
|
|
5
|
-
const PREVIEW_ASSETS_QUERY = `*[
|
|
6
|
-
_type == "studioPreview" &&
|
|
7
|
-
key in $keys &&
|
|
8
|
-
defined(preview.asset._ref)
|
|
9
|
-
] | order(_updatedAt desc) {
|
|
10
|
-
key,
|
|
11
|
-
"url": preview.asset->url
|
|
12
|
-
}`;
|
|
13
|
-
|
|
14
|
-
type PreviewDocument = {
|
|
15
|
-
key: string | null;
|
|
16
|
-
url: string | null;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export type StudioPreviewUrls = Record<string, string>;
|
|
20
|
-
|
|
21
|
-
const SEPARATOR = " ";
|
|
22
|
-
|
|
23
|
-
/** `undefined` while in flight, so callers can tell loading from "no preview". */
|
|
24
|
-
export function useStudioPreviewUrls(keys: readonly string[]) {
|
|
25
|
-
const client = useClient({ apiVersion });
|
|
26
|
-
const [urls, setUrls] = useState<StudioPreviewUrls>();
|
|
27
|
-
// Keys off contents, not array identity — callers pass a freshly mapped array.
|
|
28
|
-
const keyList = keys.join(SEPARATOR);
|
|
29
|
-
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
if (!keyList) {
|
|
32
|
-
setUrls({});
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
let cancelled = false;
|
|
37
|
-
|
|
38
|
-
client
|
|
39
|
-
.fetch<PreviewDocument[]>(PREVIEW_ASSETS_QUERY, {
|
|
40
|
-
keys: keyList.split(SEPARATOR),
|
|
41
|
-
})
|
|
42
|
-
.then((documents) => {
|
|
43
|
-
if (cancelled) return;
|
|
44
|
-
const next: StudioPreviewUrls = {};
|
|
45
|
-
for (const document of documents) {
|
|
46
|
-
if (document.key && document.url && !next[document.key]) {
|
|
47
|
-
next[document.key] = document.url;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
setUrls(next);
|
|
51
|
-
})
|
|
52
|
-
.catch(() => {
|
|
53
|
-
if (!cancelled) setUrls({});
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
return () => {
|
|
57
|
-
cancelled = true;
|
|
58
|
-
};
|
|
59
|
-
}, [client, keyList]);
|
|
60
|
-
|
|
61
|
-
return urls;
|
|
62
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { defineField, defineType } from "sanity";
|
|
2
|
-
import { pageBuilderCardIcon } from "@/lib/integrations/sanity/icons";
|
|
3
|
-
import { pageBuilderBlockPreviewOptions } from "@/lib/integrations/sanity/page-builder-config";
|
|
4
|
-
|
|
5
|
-
export const studioPreview = defineType({
|
|
6
|
-
name: "studioPreview",
|
|
7
|
-
title: "Component Preview",
|
|
8
|
-
type: "document",
|
|
9
|
-
icon: pageBuilderCardIcon,
|
|
10
|
-
fields: [
|
|
11
|
-
defineField({
|
|
12
|
-
name: "key",
|
|
13
|
-
title: "Component",
|
|
14
|
-
type: "string",
|
|
15
|
-
options: { list: pageBuilderBlockPreviewOptions },
|
|
16
|
-
validation: (Rule) => Rule.required(),
|
|
17
|
-
}),
|
|
18
|
-
defineField({
|
|
19
|
-
name: "preview",
|
|
20
|
-
title: "Preview image",
|
|
21
|
-
type: "image",
|
|
22
|
-
options: { hotspot: true },
|
|
23
|
-
validation: (Rule) => Rule.required(),
|
|
24
|
-
}),
|
|
25
|
-
],
|
|
26
|
-
preview: {
|
|
27
|
-
select: { key: "key", media: "preview" },
|
|
28
|
-
prepare({ key, media }) {
|
|
29
|
-
return {
|
|
30
|
-
title:
|
|
31
|
-
pageBuilderBlockPreviewOptions.find((option) => option.value === key)
|
|
32
|
-
?.title ?? "Component Preview",
|
|
33
|
-
media,
|
|
34
|
-
};
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
});
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from "react";
|
|
2
|
-
import { useClient } from "sanity";
|
|
3
|
-
import { apiVersion } from "@/lib/integrations/sanity/env";
|
|
4
|
-
|
|
5
|
-
const PREVIEW_ASSETS_QUERY = `*[
|
|
6
|
-
_type == "studioPreview" &&
|
|
7
|
-
key in $keys &&
|
|
8
|
-
defined(preview.asset._ref)
|
|
9
|
-
] | order(_updatedAt desc) {
|
|
10
|
-
key,
|
|
11
|
-
"url": preview.asset->url
|
|
12
|
-
}`;
|
|
13
|
-
|
|
14
|
-
type PreviewDocument = {
|
|
15
|
-
key: string | null;
|
|
16
|
-
url: string | null;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export type StudioPreviewUrls = Record<string, string>;
|
|
20
|
-
|
|
21
|
-
const SEPARATOR = " ";
|
|
22
|
-
|
|
23
|
-
/** `undefined` while in flight, so callers can tell loading from "no preview". */
|
|
24
|
-
export function useStudioPreviewUrls(keys: readonly string[]) {
|
|
25
|
-
const client = useClient({ apiVersion });
|
|
26
|
-
const [urls, setUrls] = useState<StudioPreviewUrls>();
|
|
27
|
-
// Keys off contents, not array identity — callers pass a freshly mapped array.
|
|
28
|
-
const keyList = keys.join(SEPARATOR);
|
|
29
|
-
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
if (!keyList) {
|
|
32
|
-
setUrls({});
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
let cancelled = false;
|
|
37
|
-
|
|
38
|
-
client
|
|
39
|
-
.fetch<PreviewDocument[]>(PREVIEW_ASSETS_QUERY, {
|
|
40
|
-
keys: keyList.split(SEPARATOR),
|
|
41
|
-
})
|
|
42
|
-
.then((documents) => {
|
|
43
|
-
if (cancelled) return;
|
|
44
|
-
const next: StudioPreviewUrls = {};
|
|
45
|
-
for (const document of documents) {
|
|
46
|
-
if (document.key && document.url && !next[document.key]) {
|
|
47
|
-
next[document.key] = document.url;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
setUrls(next);
|
|
51
|
-
})
|
|
52
|
-
.catch(() => {
|
|
53
|
-
if (!cancelled) setUrls({});
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
return () => {
|
|
57
|
-
cancelled = true;
|
|
58
|
-
};
|
|
59
|
-
}, [client, keyList]);
|
|
60
|
-
|
|
61
|
-
return urls;
|
|
62
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { defineField, defineType } from "sanity";
|
|
2
|
-
import { pageBuilderCardIcon } from "@/lib/integrations/sanity/icons";
|
|
3
|
-
import { pageBuilderBlockPreviewOptions } from "@/lib/integrations/sanity/page-builder-config";
|
|
4
|
-
|
|
5
|
-
export const studioPreview = defineType({
|
|
6
|
-
name: "studioPreview",
|
|
7
|
-
title: "Component Preview",
|
|
8
|
-
type: "document",
|
|
9
|
-
icon: pageBuilderCardIcon,
|
|
10
|
-
fields: [
|
|
11
|
-
defineField({
|
|
12
|
-
name: "key",
|
|
13
|
-
title: "Component",
|
|
14
|
-
type: "string",
|
|
15
|
-
options: { list: pageBuilderBlockPreviewOptions },
|
|
16
|
-
validation: (Rule) => Rule.required(),
|
|
17
|
-
}),
|
|
18
|
-
defineField({
|
|
19
|
-
name: "preview",
|
|
20
|
-
title: "Preview image",
|
|
21
|
-
type: "image",
|
|
22
|
-
options: { hotspot: true },
|
|
23
|
-
validation: (Rule) => Rule.required(),
|
|
24
|
-
}),
|
|
25
|
-
],
|
|
26
|
-
preview: {
|
|
27
|
-
select: { key: "key", media: "preview" },
|
|
28
|
-
prepare({ key, media }) {
|
|
29
|
-
return {
|
|
30
|
-
title:
|
|
31
|
-
pageBuilderBlockPreviewOptions.find((option) => option.value === key)
|
|
32
|
-
?.title ?? "Component Preview",
|
|
33
|
-
media,
|
|
34
|
-
};
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
});
|