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.
Files changed (80) hide show
  1. package/dist/modules/features/cms/sanity-pagebuilder/config.d.ts.map +1 -1
  2. package/dist/modules/features/cms/sanity-pagebuilder/config.js +1 -0
  3. package/dist/modules/features/cms/sanity-pagebuilder/config.js.map +1 -1
  4. package/dist/modules/features/cms/sanity-pagebuilder-cache/config.d.ts.map +1 -1
  5. package/dist/modules/features/cms/sanity-pagebuilder-cache/config.js +1 -0
  6. package/dist/modules/features/cms/sanity-pagebuilder-cache/config.js.map +1 -1
  7. package/package.json +1 -1
  8. package/src/agent-skills/ashby-pagebuilder-block/SKILL.md +29 -11
  9. package/src/agent-skills/hubspot-pagebuilder-block/SKILL.md +31 -12
  10. package/src/agent-skills/page-builder-block/SKILL.md +26 -13
  11. package/src/modules/features/cms/sanity-pagebuilder/files/app/api/revalidate/route.ts +2 -2
  12. package/src/modules/features/cms/sanity-pagebuilder/files/components/sanity/rich-text.tsx +1 -1
  13. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/block-actions-item.tsx +2 -2
  14. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/component-preview-frame.tsx +124 -0
  15. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/component-preview-pane.tsx +25 -0
  16. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/page-builder-input.tsx +3 -26
  17. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/page-builder-insert-menu.tsx +121 -93
  18. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/icons.ts +2 -2
  19. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/page-builder-config.ts +21 -49
  20. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/presentation.ts +1 -50
  21. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/queries.ts +56 -64
  22. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/sanity.config.ts +4 -8
  23. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/index.ts +0 -1
  24. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/index.ts +1 -4
  25. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/block.ts +4 -4
  26. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/page-builder.ts +4 -18
  27. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/page.ts +11 -37
  28. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/singletons.ts +0 -16
  29. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/structure.ts +36 -34
  30. package/src/modules/features/cms/sanity-pagebuilder/files/lib/utils/studio-embed.ts +22 -0
  31. package/src/modules/features/cms/sanity-pagebuilder-cache/files/app/api/revalidate/route.ts +2 -2
  32. package/src/modules/features/cms/sanity-pagebuilder-cache/files/components/sanity/rich-text.tsx +1 -1
  33. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/block-actions-item.tsx +2 -2
  34. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/component-preview-frame.tsx +124 -0
  35. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/component-preview-pane.tsx +25 -0
  36. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/page-builder-input.tsx +3 -26
  37. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/page-builder-insert-menu.tsx +121 -93
  38. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/icons.ts +2 -2
  39. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/page-builder-config.ts +21 -49
  40. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/presentation.ts +1 -50
  41. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/queries.ts +56 -64
  42. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/sanity.config.ts +4 -8
  43. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/components/index.ts +0 -1
  44. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/index.ts +1 -4
  45. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/block.ts +4 -4
  46. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/page-builder.ts +4 -18
  47. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/schemas/shared/page.ts +11 -37
  48. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/singletons.ts +0 -16
  49. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/structure.ts +36 -34
  50. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/utils/studio-embed.ts +22 -0
  51. package/src/modules/features/forms/hubspot/files/_sanity-adapter/form-block.ts +4 -10
  52. package/src/modules/features/forms/hubspot/files/lib/integrations/hubspot/README.md +10 -5
  53. package/src/modules/features/jobs/ashby/files/_sanity-adapter/job-board-block.ts +0 -7
  54. package/src/modules/features/jobs/ashby/files/lib/integrations/ashby/README.md +11 -5
  55. package/src/templates/next-pagebuilder/AGENTS.md +19 -7
  56. package/src/templates/next-pagebuilder/README.md +15 -3
  57. package/src/templates/next-pagebuilder/app/actions/unlock-gated-content.ts +5 -4
  58. package/src/templates/next-pagebuilder/app/components/page.tsx +81 -0
  59. package/src/templates/next-pagebuilder/components/page-builder/components/gated-content/index.tsx +8 -3
  60. package/src/templates/next-pagebuilder/components/page-builder/library.ts +183 -0
  61. package/src/templates/next-pagebuilder/components/page-builder/registry.tsx +4 -1
  62. package/src/templates/next-pagebuilder/components/page-builder/renderer.tsx +3 -1
  63. package/src/templates/next-pagebuilder/components/page-builder/stage.tsx +10 -0
  64. package/src/templates/next-pagebuilder/components/page-document/index.tsx +1 -0
  65. package/src/templates/next-pagebuilder/lib/integrations/sanity/sanity.types.ts +139 -271
  66. package/src/templates/next-pagebuilder-cache/AGENTS.md +19 -7
  67. package/src/templates/next-pagebuilder-cache/README.md +15 -3
  68. package/src/templates/next-pagebuilder-cache/app/actions/unlock-gated-content.ts +5 -4
  69. package/src/templates/next-pagebuilder-cache/app/components/page.tsx +91 -0
  70. package/src/templates/next-pagebuilder-cache/components/page-builder/components/gated-content/index.tsx +8 -3
  71. package/src/templates/next-pagebuilder-cache/components/page-builder/library.ts +183 -0
  72. package/src/templates/next-pagebuilder-cache/components/page-builder/registry.tsx +4 -1
  73. package/src/templates/next-pagebuilder-cache/components/page-builder/renderer.tsx +3 -1
  74. package/src/templates/next-pagebuilder-cache/components/page-builder/stage.tsx +10 -0
  75. package/src/templates/next-pagebuilder-cache/components/page-document/index.tsx +1 -0
  76. package/src/templates/next-pagebuilder-cache/lib/integrations/sanity/sanity.types.ts +139 -271
  77. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/use-studio-preview-urls.ts +0 -62
  78. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/studio-preview.ts +0 -37
  79. package/src/modules/features/cms/sanity-pagebuilder-cache/files/lib/integrations/sanity/components/use-studio-preview-urls.ts +0 -62
  80. 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
- });