@drawnagency/primitives 0.1.56 → 0.1.57

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 (153) hide show
  1. package/dist/{chunk-KGYWQDBB.js → chunk-ICLXLWQ5.js} +9 -72
  2. package/dist/chunk-NSCT3AMV.js +32 -0
  3. package/dist/{chunk-EU6NZ4GS.js → chunk-PRKUXM7E.js} +23 -9
  4. package/dist/{chunk-7IAWF7LE.js → chunk-PYWS3MOJ.js} +12 -2
  5. package/dist/chunk-TG43X7JO.js +123 -0
  6. package/dist/chunk-VKAGMEKE.js +90 -0
  7. package/dist/components/editor/ChildBlockWrapper.d.ts +19 -0
  8. package/dist/components/editor/ChildBlockWrapper.d.ts.map +1 -0
  9. package/dist/components/editor/ColSpanControl.d.ts +9 -0
  10. package/dist/components/editor/ColSpanControl.d.ts.map +1 -0
  11. package/dist/components/editor/SectionWrapper.d.ts +1 -1
  12. package/dist/components/editor/SectionWrapper.d.ts.map +1 -1
  13. package/dist/components/editor/SettingsForm.d.ts +5 -1
  14. package/dist/components/editor/SettingsForm.d.ts.map +1 -1
  15. package/dist/components/primitives/EditableGrid.d.ts.map +1 -1
  16. package/dist/components/primitives/IconPicker.d.ts +7 -1
  17. package/dist/components/primitives/IconPicker.d.ts.map +1 -1
  18. package/dist/components/sections/Container/Container.d.ts +20 -0
  19. package/dist/components/sections/Container/Container.d.ts.map +1 -0
  20. package/dist/components/sections/Container/ContainerSettingsForm.d.ts +17 -0
  21. package/dist/components/sections/Container/ContainerSettingsForm.d.ts.map +1 -0
  22. package/dist/components/sections/Container/index.d.ts +11 -0
  23. package/dist/components/sections/Container/index.d.ts.map +1 -0
  24. package/dist/components/sections/IconList/IconList.d.ts +1 -0
  25. package/dist/components/sections/IconList/IconList.d.ts.map +1 -1
  26. package/dist/components/sections/IconList/IconListSettings.d.ts +3 -4
  27. package/dist/components/sections/IconList/IconListSettings.d.ts.map +1 -1
  28. package/dist/components/sections/IconList/index.d.ts +1 -0
  29. package/dist/components/sections/IconList/index.d.ts.map +1 -1
  30. package/dist/components/sections/Media/MediaBlock.d.ts +19 -0
  31. package/dist/components/sections/Media/MediaBlock.d.ts.map +1 -0
  32. package/dist/components/sections/{MediaGrid → Media}/index.d.ts +15 -25
  33. package/dist/components/sections/Media/index.d.ts.map +1 -0
  34. package/dist/components/sections/Prose/index.d.ts.map +1 -1
  35. package/dist/components/sections/Spacer/Spacer.d.ts +2 -0
  36. package/dist/components/sections/Spacer/Spacer.d.ts.map +1 -0
  37. package/dist/components/sections/Spacer/index.d.ts +6 -0
  38. package/dist/components/sections/Spacer/index.d.ts.map +1 -0
  39. package/dist/components/sections/all-sections.d.ts +29 -103
  40. package/dist/components/sections/all-sections.d.ts.map +1 -1
  41. package/dist/components/sections/register-schemas.d.ts.map +1 -1
  42. package/dist/components/shared/Tabs.d.ts +24 -0
  43. package/dist/components/shared/Tabs.d.ts.map +1 -0
  44. package/dist/components/shell/EditorShell.d.ts.map +1 -1
  45. package/dist/components/shell/SiteSettingsModal.d.ts.map +1 -1
  46. package/dist/components/shell/blockMoveDispatch.d.ts +21 -0
  47. package/dist/components/shell/blockMoveDispatch.d.ts.map +1 -0
  48. package/dist/hooks/useBlockDnd.d.ts +48 -0
  49. package/dist/hooks/useBlockDnd.d.ts.map +1 -0
  50. package/dist/index.js +56 -48
  51. package/dist/lib/block-dnd.d.ts +42 -0
  52. package/dist/lib/block-dnd.d.ts.map +1 -0
  53. package/dist/lib/block-move.d.ts +31 -0
  54. package/dist/lib/block-move.d.ts.map +1 -0
  55. package/dist/lib/container-grid.d.ts +29 -0
  56. package/dist/lib/container-grid.d.ts.map +1 -0
  57. package/dist/lib/container-ops.d.ts +44 -0
  58. package/dist/lib/container-ops.d.ts.map +1 -0
  59. package/dist/lib/dexie.d.ts.map +1 -1
  60. package/dist/lib/dexie.js +13 -0
  61. package/dist/lib/index.js +10 -7
  62. package/dist/lib/loader.d.ts.map +1 -1
  63. package/dist/lib/migrate-sections-transform.d.ts +12 -0
  64. package/dist/lib/migrate-sections-transform.d.ts.map +1 -0
  65. package/dist/lib/migrate-sections-transform.js +6 -0
  66. package/dist/lib/registry.d.ts +39 -0
  67. package/dist/lib/registry.d.ts.map +1 -1
  68. package/dist/lib/registry.js +26 -0
  69. package/dist/schemas/block.d.ts +20 -0
  70. package/dist/schemas/block.d.ts.map +1 -0
  71. package/dist/schemas/block.js +14 -0
  72. package/dist/schemas/index.js +8 -2
  73. package/dist/schemas/link.d.ts +7 -0
  74. package/dist/schemas/link.d.ts.map +1 -1
  75. package/dist/schemas/rich-text.d.ts +9 -0
  76. package/dist/schemas/rich-text.d.ts.map +1 -0
  77. package/dist/schemas/sections.d.ts +2 -0
  78. package/dist/schemas/sections.d.ts.map +1 -1
  79. package/dist/schemas/shared.d.ts +30 -0
  80. package/dist/schemas/shared.d.ts.map +1 -1
  81. package/package.json +13 -1
  82. package/src/components/brandguide/Colors.tsx +35 -33
  83. package/src/components/editor/ChildBlockWrapper.tsx +108 -0
  84. package/src/components/editor/ColSpanControl.tsx +56 -0
  85. package/src/components/editor/SectionWrapper.tsx +44 -20
  86. package/src/components/editor/SettingsForm.tsx +100 -73
  87. package/src/components/primitives/EditableGrid.tsx +40 -36
  88. package/src/components/primitives/IconPicker.tsx +116 -26
  89. package/src/components/sections/Container/Container.tsx +354 -0
  90. package/src/components/sections/Container/ContainerSettingsForm.tsx +113 -0
  91. package/src/components/sections/Container/index.tsx +51 -0
  92. package/src/components/sections/IconList/IconList.tsx +113 -43
  93. package/src/components/sections/IconList/IconListSettings.tsx +2 -2
  94. package/src/components/sections/IconList/index.tsx +1 -1
  95. package/src/components/sections/Media/MediaBlock.tsx +103 -0
  96. package/src/components/sections/Media/index.tsx +85 -0
  97. package/src/components/sections/Prose/index.tsx +1 -0
  98. package/src/components/sections/Spacer/Spacer.tsx +6 -0
  99. package/src/components/sections/Spacer/index.tsx +18 -0
  100. package/src/components/sections/all-sections.ts +10 -8
  101. package/src/components/sections/register-schemas.ts +5 -2
  102. package/src/components/shared/Tabs.tsx +63 -0
  103. package/src/components/shell/EditorShell.tsx +105 -13
  104. package/src/components/shell/SiteSettingsModal.tsx +41 -51
  105. package/src/components/shell/blockMoveDispatch.ts +40 -0
  106. package/src/hooks/useBlockDnd.ts +144 -0
  107. package/src/lib/block-dnd.ts +58 -0
  108. package/src/lib/block-move.ts +236 -0
  109. package/src/lib/container-grid.ts +58 -0
  110. package/src/lib/container-ops.ts +159 -0
  111. package/src/lib/dexie.ts +22 -0
  112. package/src/lib/loader.ts +16 -4
  113. package/src/lib/migrate-sections-transform.ts +147 -0
  114. package/src/lib/registry.ts +48 -0
  115. package/src/schemas/block.ts +40 -0
  116. package/src/schemas/link.ts +19 -1
  117. package/src/schemas/rich-text.ts +11 -0
  118. package/src/schemas/sections.ts +5 -1
  119. package/src/schemas/shared.ts +6 -0
  120. package/dist/components/brandguide/DoDontList.d.ts +0 -16
  121. package/dist/components/brandguide/DoDontList.d.ts.map +0 -1
  122. package/dist/components/brandguide/DoDontMediaGrid.d.ts +0 -16
  123. package/dist/components/brandguide/DoDontMediaGrid.d.ts.map +0 -1
  124. package/dist/components/primitives/MediaSettingsForms.d.ts +0 -23
  125. package/dist/components/primitives/MediaSettingsForms.d.ts.map +0 -1
  126. package/dist/components/sections/DoDontList/index.d.ts +0 -21
  127. package/dist/components/sections/DoDontList/index.d.ts.map +0 -1
  128. package/dist/components/sections/DoDontMediaGrid/index.d.ts +0 -55
  129. package/dist/components/sections/DoDontMediaGrid/index.d.ts.map +0 -1
  130. package/dist/components/sections/MediaGrid/MediaGrid.d.ts +0 -17
  131. package/dist/components/sections/MediaGrid/MediaGrid.d.ts.map +0 -1
  132. package/dist/components/sections/MediaGrid/index.d.ts.map +0 -1
  133. package/dist/components/sections/SplitContent/SplitContent.d.ts +0 -14
  134. package/dist/components/sections/SplitContent/SplitContent.d.ts.map +0 -1
  135. package/dist/components/sections/SplitContent/index.d.ts +0 -13
  136. package/dist/components/sections/SplitContent/index.d.ts.map +0 -1
  137. package/src/components/brandguide/DoDontList.d.ts.map +0 -1
  138. package/src/components/brandguide/DoDontList.tsx +0 -67
  139. package/src/components/brandguide/DoDontMediaGrid.d.ts.map +0 -1
  140. package/src/components/brandguide/DoDontMediaGrid.tsx +0 -19
  141. package/src/components/primitives/MediaSettingsForms.tsx +0 -128
  142. package/src/components/sections/DoDontList/index.d.ts.map +0 -1
  143. package/src/components/sections/DoDontList/index.tsx +0 -45
  144. package/src/components/sections/DoDontMediaGrid/index.d.ts.map +0 -1
  145. package/src/components/sections/DoDontMediaGrid/index.tsx +0 -63
  146. package/src/components/sections/MediaGrid/MediaGrid.d.ts.map +0 -1
  147. package/src/components/sections/MediaGrid/MediaGrid.tsx +0 -239
  148. package/src/components/sections/MediaGrid/index.d.ts.map +0 -1
  149. package/src/components/sections/MediaGrid/index.tsx +0 -57
  150. package/src/components/sections/SplitContent/SplitContent.d.ts.map +0 -1
  151. package/src/components/sections/SplitContent/SplitContent.tsx +0 -84
  152. package/src/components/sections/SplitContent/index.d.ts.map +0 -1
  153. package/src/components/sections/SplitContent/index.tsx +0 -55
@@ -0,0 +1,31 @@
1
+ import type { LoadedSection } from "./loader";
2
+ import type { SiteIndex } from "../schemas/site-config";
3
+ export interface BlockMoveState {
4
+ sections: LoadedSection[];
5
+ index: SiteIndex;
6
+ rootPageId: string;
7
+ }
8
+ export interface BlockMove {
9
+ blockId: string;
10
+ fromContainerId: string;
11
+ fromIndex: number;
12
+ toContainerId: string;
13
+ /** Raw insertion index in the ORIGINAL (pre-removal) array, 0..len — as resolveDropIndex returns. applyBlockMove shifts it for same-container moves. */
14
+ toIndex: number;
15
+ /** When set, place at this 1-based grid column (ghost/spacer drop) instead of toIndex. */
16
+ toColumn?: number;
17
+ }
18
+ export interface BlockMoveEffects {
19
+ markDirtySectionIds: string[];
20
+ indexDirty: boolean;
21
+ deleteSectionIds: string[];
22
+ createSectionIds: string[];
23
+ }
24
+ export interface BlockMoveResult {
25
+ sections: LoadedSection[];
26
+ index: SiteIndex;
27
+ effects: BlockMoveEffects;
28
+ changed: boolean;
29
+ }
30
+ export declare function applyBlockMove(state: BlockMoveState, move: BlockMove, newId?: () => string): BlockMoveResult;
31
+ //# sourceMappingURL=block-move.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block-move.d.ts","sourceRoot":"","sources":["../../src/lib/block-move.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,wBAAwB,CAAC;AAKrE,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,KAAK,EAAE,SAAS,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,wJAAwJ;IACxJ,OAAO,EAAE,MAAM,CAAC;IAChB,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;CAClB;AA2BD,wBAAgB,cAAc,CAC5B,KAAK,EAAE,cAAc,EACrB,IAAI,EAAE,SAAS,EACf,KAAK,GAAE,MAAM,MAAqB,GACjC,eAAe,CAsFjB"}
@@ -0,0 +1,29 @@
1
+ /** Max columns a container exposes in v1 (covers halves/thirds/sixths via spans). */
2
+ export declare const MAX_CONTAINER_COLUMNS = 6;
3
+ /**
4
+ * Column count -> grid-cols classes that collapse by the CONTAINER's own width
5
+ * (Tailwind 4 container-query `@` variants), not the viewport. Full static
6
+ * strings so Tailwind's source scan generates them (no interpolation/purge gap).
7
+ */
8
+ export declare const containerGridClass: Record<number, string>;
9
+ /**
10
+ * Per-child colSpan -> col-span classes, keyed [columns][span]. A child's span
11
+ * must clamp to the columns AVAILABLE at each container-query breakpoint, and the
12
+ * collapse curve differs per column count — so the class depends on BOTH the
13
+ * parent's column count and the child's span, not span alone. At every breakpoint
14
+ * the emitted span = min(span, columns-at-that-breakpoint), guaranteeing a span
15
+ * never exceeds the tracks that exist (no phantom column). Span 1 needs no class.
16
+ * Full static strings so Tailwind's source scan generates them.
17
+ */
18
+ export declare const colSpanClass: Record<number, Record<number, string>>;
19
+ /** Gap token -> Tailwind gap class. Retained as a utility; the container now uses a
20
+ * fixed gap (the Gap setting was removed), but the map stays for general use. */
21
+ export declare const gapClass: Record<string, string>;
22
+ /**
23
+ * Per-column-count container-query classes that HIDE a spacer cell once the container
24
+ * collapses to a single column (mobile). Mirrors `containerGridClass`'s collapse curve:
25
+ * hidden at base width, shown at the first breakpoint where the grid has ≥2 columns.
26
+ * Static strings so Tailwind's source scan generates them.
27
+ */
28
+ export declare const spacerHiddenClass: Record<number, string>;
29
+ //# sourceMappingURL=container-grid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container-grid.d.ts","sourceRoot":"","sources":["../../src/lib/container-grid.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAOrD,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAO/D,CAAC;AAEF;kFACkF;AAClF,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAK3C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAOpD,CAAC"}
@@ -0,0 +1,44 @@
1
+ import type { ReactNode } from "react";
2
+ import type { Section } from "../schemas/sections";
3
+ /** A container is any block whose `content.children` is an array. */
4
+ export declare function getContainerChildren(block: Section): Section[];
5
+ export declare function reorderChild(container: Section, from: number, to: number): Section;
6
+ /**
7
+ * Block types insertable as a container CHILD — excludes `container` itself
8
+ * (v1 enforces one level of container nesting). Shared so the depth guard has a
9
+ * single, testable source of truth (the container toolbar's "+" picker uses it).
10
+ */
11
+ export declare function childInsertableTypes(): {
12
+ type: string;
13
+ label: string;
14
+ icon: ReactNode;
15
+ }[];
16
+ export declare function insertChildAt(container: Section, child: Section, index: number): Section;
17
+ export declare function removeChildAt(container: Section, index: number): {
18
+ container: Section;
19
+ removed: Section | null;
20
+ };
21
+ export declare function duplicateChildAt(container: Section, index: number, newId: () => string): Section;
22
+ /** Set a child's colSpan, clamped to the container's columns. Span 1 removes `layout`. */
23
+ export declare function setChildColSpan(container: Section, index: number, span: number): Section;
24
+ /** A spacer is the empty gap-filler block. */
25
+ export declare function isSpacer(child: Section): boolean;
26
+ /** Mint a fresh empty spacer block. */
27
+ export declare function makeSpacer(newId: () => string): Section;
28
+ /** Grid tracks occupied by a container's children (real child = clamped colSpan, spacer = 1). */
29
+ export declare function occupiedColumns(children: Section[], columns: number): number;
30
+ /** Remove spacer children after the last non-spacer child (a trailing gap is meaningless). */
31
+ export declare function trimTrailingSpacers(container: Section): Section;
32
+ /**
33
+ * Place `block` at 1-based grid column `K` of `container`. If a spacer already holds column
34
+ * `K`, replace it; otherwise pad intervening empty columns with spacers and append the block.
35
+ * Trailing spacers are trimmed. `columns` clamps colSpan accounting; `newId` mints spacer ids.
36
+ *
37
+ * Precondition: `K` addresses an EMPTY column — a trailing empty column or one held by a
38
+ * spacer. The editor's drop targets (ghost/spacer cells) only ever address empty columns, so
39
+ * callers never target a column consumed by a real block. Defensive: out-of-range `K`
40
+ * (`K < 1 || K > columns`) or a spacer `block` returns the container unchanged. A `block` with
41
+ * `colSpan > 1` dropped onto a single spacer keeps its span; CSS grid reflows it (v1).
42
+ */
43
+ export declare function placeBlockAtColumn(container: Section, block: Section, K: number, columns: number, newId: () => string): Section;
44
+ //# sourceMappingURL=container-ops.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container-ops.d.ts","sourceRoot":"","sources":["../../src/lib/container-ops.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAWnD,qEAAqE;AACrE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,EAAE,CAG9D;AAWD,wBAAgB,YAAY,CAAC,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAOlF;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,SAAS,CAAA;CAAE,EAAE,CAIzF;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAMxF;AAED,wBAAgB,aAAa,CAC3B,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,MAAM,GACZ;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAA;CAAE,CAMjD;AAED,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,O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,CAG3F;AAED,wBAAsB,sBAAsB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEtE;AAED,wBAAsB,uBAAuB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGvE;AAED,wBAAsB,0BAA0B,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE1E;AAED,wBAAsB,wBAAwB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAGlE;AAED,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAMvD;AAMD,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,MAAM,EAAE,EACjB,WAAW,EAAE,MAAM,EAAE,GACpB,OAAO,CAAC,IAAI,CAAC,CAOf"}
package/dist/lib/dexie.js CHANGED
@@ -74,6 +74,19 @@ var EditorDatabase = class extends Dexie {
74
74
  await tx.table("siteIndex").clear();
75
75
  await tx.table("contentCache").clear();
76
76
  });
77
+ this.version(8).stores({
78
+ sections: "sectionId",
79
+ siteIndex: "key",
80
+ meta: "key",
81
+ siteConfig: "key",
82
+ contentCache: "key",
83
+ mediaManifest: "key",
84
+ pendingMedia: "id",
85
+ pendingMediaDeletions: "id"
86
+ }).upgrade(async (tx) => {
87
+ await tx.table("siteIndex").clear();
88
+ await tx.table("contentCache").clear();
89
+ });
77
90
  }
78
91
  };
79
92
  var db = null;
package/dist/lib/index.js CHANGED
@@ -18,7 +18,15 @@ import {
18
18
  safeRedirect,
19
19
  sanitizeHtml,
20
20
  toSectionId
21
- } from "../chunk-EU6NZ4GS.js";
21
+ } from "../chunk-PRKUXM7E.js";
22
+ import "../chunk-TG43X7JO.js";
23
+ import "../chunk-S2L3BPLS.js";
24
+ import "../chunk-ICLXLWQ5.js";
25
+ import "../chunk-DKOUFIP6.js";
26
+ import "../chunk-NSCT3AMV.js";
27
+ import {
28
+ env
29
+ } from "../chunk-WKZ7OENC.js";
22
30
  import {
23
31
  clearRegistry,
24
32
  createRegistry,
@@ -29,12 +37,7 @@ import {
29
37
  getSection,
30
38
  registerSchema,
31
39
  registerSection
32
- } from "../chunk-KGYWQDBB.js";
33
- import "../chunk-S2L3BPLS.js";
34
- import {
35
- env
36
- } from "../chunk-WKZ7OENC.js";
37
- import "../chunk-DKOUFIP6.js";
40
+ } from "../chunk-VKAGMEKE.js";
38
41
  export {
39
42
  buildGoogleFontsUrl,
40
43
  clearRegistry,
@@ -1 +1 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/lib/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAe,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAGvF,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,KAAK,EAAE,SAAS,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,EAChB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACpC,WAAW,CA6Bb;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,SAAS,EAChB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACnC,WAAW,CAQb;AAED;;;GAGG;AACH,wBAAsB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAe9E"}
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/lib/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAe,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAKvF,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,KAAK,EAAE,SAAS,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,EAChB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACpC,WAAW,CAuCb;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,SAAS,EAChB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACnC,WAAW,CAQb;AAED;;;GAGG;AACH,wBAAsB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAe9E"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Pure, browser-safe transform that rewrites the three legacy "layout-as-content"
3
+ * section types into the recursive `container` block. Used by BOTH the loader
4
+ * fallback (mergeSiteContent) and the codemod (scripts/migrate-sections.ts), so
5
+ * it must stay free of Node APIs and registry/schema imports.
6
+ *
7
+ * Structural only — it never sanitizes. Output is emitted in schema-normal form
8
+ * (every defaulted key explicit, only known ref fields carried) so that
9
+ * `transform(raw)` deep-equals `safeParse(transform(raw))` (convergence).
10
+ */
11
+ export declare function upgradeLegacySection(raw: unknown): unknown;
12
+ //# sourceMappingURL=migrate-sections-transform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate-sections-transform.d.ts","sourceRoot":"","sources":["../../src/lib/migrate-sections-transform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAO1D"}
@@ -0,0 +1,6 @@
1
+ import {
2
+ upgradeLegacySection
3
+ } from "../chunk-TG43X7JO.js";
4
+ export {
5
+ upgradeLegacySection
6
+ };
@@ -26,6 +26,11 @@ export type SettingsFieldDef = {
26
26
  default: string;
27
27
  target?: "content" | "options";
28
28
  coerce?: "number";
29
+ /** When set, an empty-string ("") selection is normalized to `undefined`
30
+ * before the content/options split, so an optional-enum field clears cleanly
31
+ * (e.g. Media `dodont`, whose enum is strictly ["do","dont"]). Opt-in so other
32
+ * selects keep their "" value. */
33
+ emptyIsUndefined?: boolean;
29
34
  options: {
30
35
  label: string;
31
36
  value: string;
@@ -68,6 +73,8 @@ export interface WrapperProps {
68
73
  dirty?: boolean;
69
74
  index: number;
70
75
  isLast: boolean;
76
+ containerId: string;
77
+ isContainerBlock: boolean;
71
78
  definition: SectionDefinition;
72
79
  options?: Record<string, unknown>;
73
80
  audiences: Audience[];
@@ -79,6 +86,7 @@ export interface WrapperProps {
79
86
  onRequestInsert?: (index: number) => void;
80
87
  onDelete?: () => void;
81
88
  onMoveSection?: () => void;
89
+ onAddChild?: () => void;
82
90
  mainStatus?: string | null;
83
91
  contentDiffersFromMain?: boolean;
84
92
  isLocalOnly?: boolean;
@@ -96,6 +104,22 @@ export interface SectionDefinition<T = unknown> {
96
104
  getLabel?(content: T): string;
97
105
  getThumbnails?(content: T): Thumbnail[];
98
106
  navRole?: "h1" | "h2" | "h3";
107
+ /** content-relative field paths that hold HTML rich text (for the sanitizer). */
108
+ richTextFields?: readonly string[];
109
+ /**
110
+ * Option keys (under this type's `options`) that a parent container may set as a
111
+ * default for all children via `content.childDefaults`. v1: typed primitives only.
112
+ */
113
+ inheritableSettings?: readonly string[];
114
+ /**
115
+ * Optional grouping of `settings` fields into labeled tabs for the settings modal;
116
+ * presentation-only — does not change content/options routing; omitted fields fall
117
+ * into a trailing 'Other' tab.
118
+ */
119
+ settingsTabs?: {
120
+ label: string;
121
+ fields: string[];
122
+ }[];
99
123
  }
100
124
  type DefineSectionInput<S extends ZodType> = {
101
125
  type: string;
@@ -109,6 +133,17 @@ type DefineSectionInput<S extends ZodType> = {
109
133
  getLabel?(content: z.infer<S>): string;
110
134
  getThumbnails?(content: z.infer<S>): Thumbnail[];
111
135
  navRole?: "h1" | "h2" | "h3";
136
+ richTextFields?: readonly string[];
137
+ inheritableSettings?: readonly string[];
138
+ /**
139
+ * Optional grouping of `settings` fields into labeled tabs for the settings modal;
140
+ * presentation-only — does not change content/options routing; omitted fields fall
141
+ * into a trailing 'Other' tab.
142
+ */
143
+ settingsTabs?: {
144
+ label: string;
145
+ fields: string[];
146
+ }[];
112
147
  };
113
148
  export declare function defineSection<S extends ZodType>(def: DefineSectionInput<S>): SectionDefinition<z.infer<S>>;
114
149
  export interface SectionRegistry {
@@ -118,11 +153,15 @@ export interface SectionRegistry {
118
153
  getSchema(type: string): ZodType | undefined;
119
154
  getAllSections(): SectionDefinition[];
120
155
  getAllSchemas(): ZodType[];
156
+ registerRichText(type: string, fields: readonly string[]): void;
157
+ getRichTextFields(type: string): readonly string[];
121
158
  clearRegistry(): void;
122
159
  }
123
160
  export declare function createRegistry(): SectionRegistry;
124
161
  export declare function registerSection(def: SectionDefinition<any>): void;
125
162
  export declare function registerSchema(type: string, schema: ZodType): void;
163
+ export declare function registerRichText(type: string, fields: readonly string[]): void;
164
+ export declare function getRichTextFields(type: string): readonly string[];
126
165
  export declare function getSection(type: string): SectionDefinition | undefined;
127
166
  export declare function getSchema(type: string): ZodType | undefined;
128
167
  export declare function getAllSections(): SectionDefinition[];
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/lib/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACtC,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MA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,IAAI,iBAAiB,EAAE,CAAC;IACtC,aAAa,IAAI,OAAO,EAAE,CAAC;IAC3B,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;IAChE,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;IACnD,aAAa,IAAI,IAAI,CAAC;CACvB;AAED,wBAAgB,cAAc,IAAI,eAAe,CA0ChD;AAYD,wBAAgB,eAAe,CAAC,GAAG,EAAE,iBAAiB,CAAC,GAAG,CAAC,GAAG,IAAI,CAEjE;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CAElE;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAE9E;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAEjE;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAEtE;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAE3D;AAED,wBAAgB,cAAc,IAAI,iBAAiB,EAAE,CAEpD;AAED,wBAAgB,aAAa,IAAI,OAAO,EAAE,CAEzC;AAED,wBAAgB,aAAa,IAAI,IAAI,CAEpC"}
@@ -0,0 +1,26 @@
1
+ import {
2
+ clearRegistry,
3
+ createRegistry,
4
+ defineSection,
5
+ getAllSchemas,
6
+ getAllSections,
7
+ getRichTextFields,
8
+ getSchema,
9
+ getSection,
10
+ registerRichText,
11
+ registerSchema,
12
+ registerSection
13
+ } from "../chunk-VKAGMEKE.js";
14
+ export {
15
+ clearRegistry,
16
+ createRegistry,
17
+ defineSection,
18
+ getAllSchemas,
19
+ getAllSections,
20
+ getRichTextFields,
21
+ getSchema,
22
+ getSection,
23
+ registerRichText,
24
+ registerSchema,
25
+ registerSection
26
+ };
@@ -0,0 +1,20 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * A block's participation in its parent container's layout — distinct from its
4
+ * content. Optional, and absent at the page root (the root is an implicit single
5
+ * column). Intentionally NOT strict so future keys (rowSpan, alignSelf) are
6
+ * forward-compatible.
7
+ */
8
+ export declare const LayoutEnvelopeSchema: z.ZodObject<{
9
+ colSpan: z.ZodOptional<z.ZodNumber>;
10
+ }, z.core.$strip>;
11
+ export type LayoutEnvelope = z.infer<typeof LayoutEnvelopeSchema>;
12
+ /** v1 nesting cap: a top-level container (depth 2) may hold leaves but not containers. */
13
+ export declare const MAX_BLOCK_DEPTH = 2;
14
+ /** Content-agnostic: any block whose `content.children` is an array is a container. */
15
+ export declare function getBlockChildren(block: unknown): unknown[];
16
+ /** Depth of a block tree: a leaf is 1; a container is 1 + max(child depths). */
17
+ export declare function blockDepth(block: unknown): number;
18
+ /** Throws if the block tree is deeper than `max`. */
19
+ export declare function assertMaxDepth(block: unknown, max?: number): void;
20
+ //# sourceMappingURL=block.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../src/schemas/block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB;;iBAE/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,0FAA0F;AAC1F,eAAO,MAAM,eAAe,IAAI,CAAC;AAEjC,uFAAuF;AACvF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,EAAE,CAM1D;AAED,gFAAgF;AAChF,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAIjD;AAED,qDAAqD;AACrD,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,GAAE,MAAwB,GAAG,IAAI,CAKlF"}
@@ -0,0 +1,14 @@
1
+ import {
2
+ LayoutEnvelopeSchema,
3
+ MAX_BLOCK_DEPTH,
4
+ assertMaxDepth,
5
+ blockDepth,
6
+ getBlockChildren
7
+ } from "../chunk-NSCT3AMV.js";
8
+ export {
9
+ LayoutEnvelopeSchema,
10
+ MAX_BLOCK_DEPTH,
11
+ assertMaxDepth,
12
+ blockDepth,
13
+ getBlockChildren
14
+ };
@@ -5,8 +5,9 @@ import {
5
5
  LinkTargetSchema,
6
6
  LinkValueSchema,
7
7
  MediaGridOptionsSchema,
8
+ isSafeHref,
8
9
  slugifyAudienceName
9
- } from "../chunk-7IAWF7LE.js";
10
+ } from "../chunk-PYWS3MOJ.js";
10
11
  import {
11
12
  AudienceSchema,
12
13
  RoleSchema,
@@ -24,18 +25,21 @@ import {
24
25
  PageStatusSchema,
25
26
  RESERVED_SLUGS,
26
27
  SectionMetaSchema,
28
+ SingleMediaReferenceSchema,
27
29
  SiteConfigSchema,
28
30
  TextLineSchema,
29
31
  getSectionContentSchema,
30
32
  getSectionSchema,
31
33
  normalizeSiteIndex
32
- } from "../chunk-KGYWQDBB.js";
34
+ } from "../chunk-ICLXLWQ5.js";
33
35
  import {
34
36
  ImageManifestSchema,
35
37
  MediaConfigSchema,
36
38
  MediaItemSchema,
37
39
  VariantSchema
38
40
  } from "../chunk-DKOUFIP6.js";
41
+ import "../chunk-NSCT3AMV.js";
42
+ import "../chunk-VKAGMEKE.js";
39
43
  export {
40
44
  AudienceColorSchema,
41
45
  AudienceNameSchema,
@@ -59,12 +63,14 @@ export {
59
63
  RoleSchema,
60
64
  SectionMetaSchema,
61
65
  SessionSchema,
66
+ SingleMediaReferenceSchema,
62
67
  SiteConfigSchema,
63
68
  SiteUserSchema,
64
69
  TextLineSchema,
65
70
  VariantSchema,
66
71
  getSectionContentSchema,
67
72
  getSectionSchema,
73
+ isSafeHref,
68
74
  normalizeSiteIndex,
69
75
  slugifyAudienceName
70
76
  };
@@ -3,6 +3,13 @@ export declare const LinkTargetSchema: z.ZodEnum<{
3
3
  _self: "_self";
4
4
  _blank: "_blank";
5
5
  }>;
6
+ /**
7
+ * Block dangerous href schemes (javascript:, data:, vbscript:) and protocol-
8
+ * relative URLs at the schema boundary. Allows empty (unset), relative paths /
9
+ * fragments / queries, and http(s)/mailto absolute URLs. Links are not walked by
10
+ * the recursive sanitizer, so this is the only XSS guard for stored link hrefs.
11
+ */
12
+ export declare function isSafeHref(href: string): boolean;
6
13
  export declare const LinkValueSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7
14
  kind: z.ZodLiteral<"external">;
8
15
  href: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/schemas/link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,gBAAgB;;;EAA8B,CAAC;AAE5D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;2BAQ1B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,YAAY,EAAE,SAA2D,CAAC"}
1
+ {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/schemas/link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,gBAAgB;;;EAA8B,CAAC;AAE5D;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAUhD;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;2BAQ1B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,YAAY,EAAE,SAA2D,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Marks a schema field as HTML rich text. Readability marker only — the runtime
4
+ * source of truth for sanitization is each block definition's `richTextFields`
5
+ * list (see registry). Kept as a helper so schemas read self-documentingly
6
+ * (`body: richText()`) and a future Zod version could make it introspectable.
7
+ */
8
+ export declare function richText(): z.ZodString;
9
+ //# sourceMappingURL=rich-text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rich-text.d.ts","sourceRoot":"","sources":["../../src/schemas/rich-text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AACH,wBAAgB,QAAQ,gBAEvB"}
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import { type LayoutEnvelope } from "./block";
2
3
  export interface SectionContent<C = Record<string, unknown>> {
3
4
  type: string;
4
5
  content: C;
@@ -6,6 +7,7 @@ export interface SectionContent<C = Record<string, unknown>> {
6
7
  }
7
8
  export interface Section<C = Record<string, unknown>> extends SectionContent<C> {
8
9
  id: string;
10
+ layout?: LayoutEnvelope;
9
11
  }
10
12
  export declare function getSectionContentSchema(): z.ZodType<SectionContent>;
11
13
  export declare function getSectionSchema(): z.ZodType<Section>;
@@ -1 +1 @@
1
- {"version":3,"file":"sections.d.ts","sourceRoot":"","sources":["../../src/schemas/sections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,CAAC,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAE,SAAQ,cAAc,CAAC,CAAC,CAAC;IAC7E,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,wBAAgB,uBAAuB,IAAI,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAMnE;AAED,wBAAgB,gBAAgB,IAAI,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAErD"}
1
+ {"version":3,"file":"sections.d.ts","sourceRoot":"","sources":["../../src/schemas/sections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAEpE,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,CAAC,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAE,SAAQ,cAAc,CAAC,CAAC,CAAC;IAC7E,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB;AAED,wBAAgB,uBAAuB,IAAI,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAMnE;AAED,wBAAgB,gBAAgB,IAAI,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAIrD"}
@@ -77,6 +77,36 @@ export declare const MediaReferenceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
77
77
  linkText: z.ZodOptional<z.ZodString>;
78
78
  }, z.core.$strip>], "type">;
79
79
  export type MediaReference = z.infer<typeof MediaReferenceSchema>;
80
+ /** A single image or video reference — for the standalone `media` block
81
+ * (excludes the grid-only doDontImage/linkedImage variants). */
82
+ export declare const SingleMediaReferenceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
83
+ imageId: z.ZodDefault<z.ZodString>;
84
+ caption: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
85
+ background: z.ZodOptional<z.ZodString>;
86
+ invertFrom: z.ZodOptional<z.ZodString>;
87
+ border: z.ZodOptional<z.ZodBoolean>;
88
+ objectFit: z.ZodOptional<z.ZodEnum<{
89
+ cover: "cover";
90
+ contain: "contain";
91
+ }>>;
92
+ type: z.ZodLiteral<"image">;
93
+ }, z.core.$strip>, z.ZodObject<{
94
+ imageId: z.ZodDefault<z.ZodString>;
95
+ caption: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
96
+ background: z.ZodOptional<z.ZodString>;
97
+ invertFrom: z.ZodOptional<z.ZodString>;
98
+ border: z.ZodOptional<z.ZodBoolean>;
99
+ objectFit: z.ZodOptional<z.ZodEnum<{
100
+ cover: "cover";
101
+ contain: "contain";
102
+ }>>;
103
+ type: z.ZodLiteral<"video">;
104
+ poster: z.ZodOptional<z.ZodString>;
105
+ autoplay: z.ZodOptional<z.ZodBoolean>;
106
+ loop: z.ZodOptional<z.ZodBoolean>;
107
+ muted: z.ZodOptional<z.ZodBoolean>;
108
+ }, z.core.$strip>], "type">;
109
+ export type SingleMediaReference = z.infer<typeof SingleMediaReferenceSchema>;
80
110
  export declare const HexColorSchema: z.ZodString;
81
111
  export declare const FontNameSchema: z.ZodString;
82
112
  export declare const ColorSpaceSchema: z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/schemas/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwBxB,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;2BAKzB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAoCtD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,eAAO,MAAM,eAAe;;;;;;;;iBAG1B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drawnagency/primitives",
3
- "version": "0.1.56",
3
+ "version": "0.1.57",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./package.json": "./package.json",
@@ -16,6 +16,10 @@
16
16
  "types": "./dist/schemas/auth.d.ts",
17
17
  "default": "./dist/schemas/auth.js"
18
18
  },
19
+ "./schemas/block": {
20
+ "types": "./dist/schemas/block.d.ts",
21
+ "default": "./dist/schemas/block.js"
22
+ },
19
23
  "./schemas/link": {
20
24
  "types": "./dist/schemas/link.d.ts",
21
25
  "default": "./dist/schemas/link.js"
@@ -32,6 +36,14 @@
32
36
  "types": "./dist/lib/env.d.ts",
33
37
  "default": "./dist/lib/env.js"
34
38
  },
39
+ "./lib/registry": {
40
+ "types": "./dist/lib/registry.d.ts",
41
+ "default": "./dist/lib/registry.js"
42
+ },
43
+ "./lib/migrate-sections-transform": {
44
+ "types": "./dist/lib/migrate-sections-transform.d.ts",
45
+ "default": "./dist/lib/migrate-sections-transform.js"
46
+ },
35
47
  "./auth": {
36
48
  "types": "./dist/auth/index.d.ts",
37
49
  "default": "./dist/auth/index.js"