@drawnagency/primitives 0.1.56 → 0.1.58

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 (165) hide show
  1. package/dist/adapter-HH47ZPGM.js +1779 -0
  2. package/dist/auth/index.js +1 -0
  3. package/dist/{chunk-EU6NZ4GS.js → chunk-AN62WPW7.js} +22 -163
  4. package/dist/chunk-ESE5UBQI.js +73 -0
  5. package/dist/{chunk-KGYWQDBB.js → chunk-ICLXLWQ5.js} +9 -72
  6. package/dist/chunk-JSBRDJBE.js +30 -0
  7. package/dist/chunk-NSCT3AMV.js +32 -0
  8. package/dist/chunk-RFZNNCAS.js +160 -0
  9. package/dist/chunk-TG43X7JO.js +123 -0
  10. package/dist/{chunk-7IAWF7LE.js → chunk-V7JN2DDU.js} +2 -19
  11. package/dist/chunk-VKAGMEKE.js +90 -0
  12. package/dist/chunk-ZU2MKPTG.js +29 -0
  13. package/dist/closest-edge-EBOXL3YW.js +72 -0
  14. package/dist/components/editor/ChildBlockWrapper.d.ts +19 -0
  15. package/dist/components/editor/ChildBlockWrapper.d.ts.map +1 -0
  16. package/dist/components/editor/ColSpanControl.d.ts +9 -0
  17. package/dist/components/editor/ColSpanControl.d.ts.map +1 -0
  18. package/dist/components/editor/SectionWrapper.d.ts +1 -1
  19. package/dist/components/editor/SectionWrapper.d.ts.map +1 -1
  20. package/dist/components/editor/SettingsForm.d.ts +5 -1
  21. package/dist/components/editor/SettingsForm.d.ts.map +1 -1
  22. package/dist/components/primitives/EditableGrid.d.ts.map +1 -1
  23. package/dist/components/primitives/IconPicker.d.ts +7 -1
  24. package/dist/components/primitives/IconPicker.d.ts.map +1 -1
  25. package/dist/components/sections/Container/Container.d.ts +20 -0
  26. package/dist/components/sections/Container/Container.d.ts.map +1 -0
  27. package/dist/components/sections/Container/ContainerSettingsForm.d.ts +17 -0
  28. package/dist/components/sections/Container/ContainerSettingsForm.d.ts.map +1 -0
  29. package/dist/components/sections/Container/index.d.ts +11 -0
  30. package/dist/components/sections/Container/index.d.ts.map +1 -0
  31. package/dist/components/sections/IconList/IconList.d.ts +1 -0
  32. package/dist/components/sections/IconList/IconList.d.ts.map +1 -1
  33. package/dist/components/sections/IconList/IconListSettings.d.ts +3 -4
  34. package/dist/components/sections/IconList/IconListSettings.d.ts.map +1 -1
  35. package/dist/components/sections/IconList/index.d.ts +1 -0
  36. package/dist/components/sections/IconList/index.d.ts.map +1 -1
  37. package/dist/components/sections/Media/MediaBlock.d.ts +19 -0
  38. package/dist/components/sections/Media/MediaBlock.d.ts.map +1 -0
  39. package/dist/components/sections/{MediaGrid → Media}/index.d.ts +15 -25
  40. package/dist/components/sections/Media/index.d.ts.map +1 -0
  41. package/dist/components/sections/Prose/index.d.ts.map +1 -1
  42. package/dist/components/sections/Spacer/Spacer.d.ts +2 -0
  43. package/dist/components/sections/Spacer/Spacer.d.ts.map +1 -0
  44. package/dist/components/sections/Spacer/index.d.ts +6 -0
  45. package/dist/components/sections/Spacer/index.d.ts.map +1 -0
  46. package/dist/components/sections/all-sections.d.ts +29 -103
  47. package/dist/components/sections/all-sections.d.ts.map +1 -1
  48. package/dist/components/sections/register-schemas.d.ts.map +1 -1
  49. package/dist/components/sections/register-schemas.js +4094 -0
  50. package/dist/components/shared/Tabs.d.ts +24 -0
  51. package/dist/components/shared/Tabs.d.ts.map +1 -0
  52. package/dist/components/shell/EditorShell.d.ts.map +1 -1
  53. package/dist/components/shell/SiteSettingsModal.d.ts.map +1 -1
  54. package/dist/components/shell/blockMoveDispatch.d.ts +21 -0
  55. package/dist/components/shell/blockMoveDispatch.d.ts.map +1 -0
  56. package/dist/hooks/useBlockDnd.d.ts +48 -0
  57. package/dist/hooks/useBlockDnd.d.ts.map +1 -0
  58. package/dist/index.js +69 -56
  59. package/dist/lib/block-dnd.d.ts +42 -0
  60. package/dist/lib/block-dnd.d.ts.map +1 -0
  61. package/dist/lib/block-move.d.ts +31 -0
  62. package/dist/lib/block-move.d.ts.map +1 -0
  63. package/dist/lib/container-grid.d.ts +29 -0
  64. package/dist/lib/container-grid.d.ts.map +1 -0
  65. package/dist/lib/container-ops.d.ts +44 -0
  66. package/dist/lib/container-ops.d.ts.map +1 -0
  67. package/dist/lib/dexie.d.ts.map +1 -1
  68. package/dist/lib/dexie.js +15 -0
  69. package/dist/lib/env.js +1 -0
  70. package/dist/lib/index.js +19 -13
  71. package/dist/lib/loader.d.ts.map +1 -1
  72. package/dist/lib/migrate-sections-transform.d.ts +12 -0
  73. package/dist/lib/migrate-sections-transform.d.ts.map +1 -0
  74. package/dist/lib/migrate-sections-transform.js +7 -0
  75. package/dist/lib/registry.d.ts +39 -0
  76. package/dist/lib/registry.d.ts.map +1 -1
  77. package/dist/lib/registry.js +27 -0
  78. package/dist/media/index.js +1 -0
  79. package/dist/schemas/auth.js +1 -0
  80. package/dist/schemas/block.d.ts +20 -0
  81. package/dist/schemas/block.d.ts.map +1 -0
  82. package/dist/schemas/block.js +15 -0
  83. package/dist/schemas/index.js +13 -4
  84. package/dist/schemas/link.d.ts +7 -0
  85. package/dist/schemas/link.d.ts.map +1 -1
  86. package/dist/schemas/rich-text.d.ts +9 -0
  87. package/dist/schemas/rich-text.d.ts.map +1 -0
  88. package/dist/schemas/sections.d.ts +2 -0
  89. package/dist/schemas/sections.d.ts.map +1 -1
  90. package/dist/schemas/shared.d.ts +30 -0
  91. package/dist/schemas/shared.d.ts.map +1 -1
  92. package/dist/types/database.js +2 -0
  93. package/package.json +17 -1
  94. package/src/components/brandguide/Colors.tsx +35 -33
  95. package/src/components/editor/ChildBlockWrapper.tsx +108 -0
  96. package/src/components/editor/ColSpanControl.tsx +56 -0
  97. package/src/components/editor/SectionWrapper.tsx +44 -20
  98. package/src/components/editor/SettingsForm.tsx +100 -73
  99. package/src/components/primitives/EditableGrid.tsx +40 -36
  100. package/src/components/primitives/IconPicker.tsx +116 -26
  101. package/src/components/sections/Container/Container.tsx +354 -0
  102. package/src/components/sections/Container/ContainerSettingsForm.tsx +113 -0
  103. package/src/components/sections/Container/index.tsx +51 -0
  104. package/src/components/sections/IconList/IconList.tsx +113 -43
  105. package/src/components/sections/IconList/IconListSettings.tsx +2 -2
  106. package/src/components/sections/IconList/index.tsx +1 -1
  107. package/src/components/sections/Media/MediaBlock.tsx +103 -0
  108. package/src/components/sections/Media/index.tsx +85 -0
  109. package/src/components/sections/Prose/index.tsx +1 -0
  110. package/src/components/sections/Spacer/Spacer.tsx +6 -0
  111. package/src/components/sections/Spacer/index.tsx +18 -0
  112. package/src/components/sections/all-sections.ts +10 -8
  113. package/src/components/sections/register-schemas.ts +5 -2
  114. package/src/components/shared/Tabs.tsx +63 -0
  115. package/src/components/shell/EditorShell.tsx +105 -13
  116. package/src/components/shell/SiteSettingsModal.tsx +41 -51
  117. package/src/components/shell/blockMoveDispatch.ts +40 -0
  118. package/src/hooks/useBlockDnd.ts +144 -0
  119. package/src/lib/block-dnd.ts +58 -0
  120. package/src/lib/block-move.ts +236 -0
  121. package/src/lib/container-grid.ts +58 -0
  122. package/src/lib/container-ops.ts +159 -0
  123. package/src/lib/dexie.ts +22 -0
  124. package/src/lib/loader.ts +16 -4
  125. package/src/lib/migrate-sections-transform.ts +147 -0
  126. package/src/lib/registry.ts +48 -0
  127. package/src/schemas/block.ts +40 -0
  128. package/src/schemas/link.ts +19 -1
  129. package/src/schemas/rich-text.ts +11 -0
  130. package/src/schemas/sections.ts +5 -1
  131. package/src/schemas/shared.ts +6 -0
  132. package/dist/components/brandguide/DoDontList.d.ts +0 -16
  133. package/dist/components/brandguide/DoDontList.d.ts.map +0 -1
  134. package/dist/components/brandguide/DoDontMediaGrid.d.ts +0 -16
  135. package/dist/components/brandguide/DoDontMediaGrid.d.ts.map +0 -1
  136. package/dist/components/primitives/MediaSettingsForms.d.ts +0 -23
  137. package/dist/components/primitives/MediaSettingsForms.d.ts.map +0 -1
  138. package/dist/components/sections/DoDontList/index.d.ts +0 -21
  139. package/dist/components/sections/DoDontList/index.d.ts.map +0 -1
  140. package/dist/components/sections/DoDontMediaGrid/index.d.ts +0 -55
  141. package/dist/components/sections/DoDontMediaGrid/index.d.ts.map +0 -1
  142. package/dist/components/sections/MediaGrid/MediaGrid.d.ts +0 -17
  143. package/dist/components/sections/MediaGrid/MediaGrid.d.ts.map +0 -1
  144. package/dist/components/sections/MediaGrid/index.d.ts.map +0 -1
  145. package/dist/components/sections/SplitContent/SplitContent.d.ts +0 -14
  146. package/dist/components/sections/SplitContent/SplitContent.d.ts.map +0 -1
  147. package/dist/components/sections/SplitContent/index.d.ts +0 -13
  148. package/dist/components/sections/SplitContent/index.d.ts.map +0 -1
  149. package/src/components/brandguide/DoDontList.d.ts.map +0 -1
  150. package/src/components/brandguide/DoDontList.tsx +0 -67
  151. package/src/components/brandguide/DoDontMediaGrid.d.ts.map +0 -1
  152. package/src/components/brandguide/DoDontMediaGrid.tsx +0 -19
  153. package/src/components/primitives/MediaSettingsForms.tsx +0 -128
  154. package/src/components/sections/DoDontList/index.d.ts.map +0 -1
  155. package/src/components/sections/DoDontList/index.tsx +0 -45
  156. package/src/components/sections/DoDontMediaGrid/index.d.ts.map +0 -1
  157. package/src/components/sections/DoDontMediaGrid/index.tsx +0 -63
  158. package/src/components/sections/MediaGrid/MediaGrid.d.ts.map +0 -1
  159. package/src/components/sections/MediaGrid/MediaGrid.tsx +0 -239
  160. package/src/components/sections/MediaGrid/index.d.ts.map +0 -1
  161. package/src/components/sections/MediaGrid/index.tsx +0 -57
  162. package/src/components/sections/SplitContent/SplitContent.d.ts.map +0 -1
  163. package/src/components/sections/SplitContent/SplitContent.tsx +0 -84
  164. package/src/components/sections/SplitContent/index.d.ts.map +0 -1
  165. package/src/components/sections/SplitContent/index.tsx +0 -55
@@ -1,8 +1,7 @@
1
1
  declare const _default: import("../../..").SectionDefinition<{
2
- type: "media_grid";
2
+ type: "media";
3
3
  content: {
4
- columns: number;
5
- media: ({
4
+ ref: {
6
5
  imageId: string;
7
6
  type: "image";
8
7
  caption?: string | string[] | undefined;
@@ -22,33 +21,24 @@ declare const _default: import("../../..").SectionDefinition<{
22
21
  autoplay?: boolean | undefined;
23
22
  loop?: boolean | undefined;
24
23
  muted?: boolean | undefined;
25
- } | {
26
- imageId: string;
27
- type: "doDontImage";
28
- doDont: "do" | "dont";
29
- caption?: string | string[] | undefined;
30
- background?: string | undefined;
31
- invertFrom?: string | undefined;
32
- border?: boolean | undefined;
33
- objectFit?: "cover" | "contain" | undefined;
34
- } | {
35
- imageId: string;
36
- type: "linkedImage";
24
+ };
25
+ link?: {
26
+ kind: "external";
37
27
  href: string;
38
- caption?: string | string[] | undefined;
39
- background?: string | undefined;
40
- invertFrom?: string | undefined;
41
- border?: boolean | undefined;
42
- objectFit?: "cover" | "contain" | undefined;
43
- target?: string | undefined;
44
- linkText?: string | undefined;
45
- })[];
28
+ target: "_self" | "_blank";
29
+ } | {
30
+ kind: "internal";
31
+ pageId: string;
32
+ target: "_self" | "_blank";
33
+ anchorSectionId?: string | null | undefined;
34
+ } | undefined;
35
+ dodont?: "do" | "dont" | undefined;
46
36
  };
47
37
  options: {
48
38
  square?: boolean | undefined;
39
+ showCaption?: boolean | undefined;
49
40
  border?: boolean | undefined;
50
- crop?: boolean | undefined;
51
- showCaptions?: boolean | undefined;
41
+ objectFit?: "cover" | "contain" | undefined;
52
42
  };
53
43
  }>;
54
44
  export default _default;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/Media/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,wBA4DG"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/Prose/index.tsx"],"names":[],"mappings":";;;;;;AAWA,wBAUG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/Prose/index.tsx"],"names":[],"mappings":";;;;;;AAWA,wBAWG"}
@@ -0,0 +1,2 @@
1
+ export default function Spacer(): import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=Spacer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Spacer.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/Spacer/Spacer.tsx"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,UAAU,MAAM,4CAE7B"}
@@ -0,0 +1,6 @@
1
+ declare const _default: import("../../..").SectionDefinition<{
2
+ type: "spacer";
3
+ content: Record<string, never>;
4
+ }>;
5
+ export default _default;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/Spacer/index.tsx"],"names":[],"mappings":";;;;AAUA,wBAOG"}
@@ -6,6 +6,10 @@
6
6
  * array, so the two can no longer drift — previously they hand-maintained
7
7
  * parallel 11-entry lists, and a section added to one but not the other would
8
8
  * make the editor render a type that save rejects with a 400 (or vice versa).
9
+ *
10
+ * Retired: split_content, media_grid, do_dont_grid, do_dont — fully decomposable
11
+ * into container sections. The loader fallback in mergeSiteContent transforms any
12
+ * legacy-typed JSON to container before validation.
9
13
  */
10
14
  export declare const allSectionDefs: (import("../..").SectionDefinition<{
11
15
  type: "link_heading";
@@ -30,10 +34,9 @@ export declare const allSectionDefs: (import("../..").SectionDefinition<{
30
34
  body: string;
31
35
  };
32
36
  }> | import("../..").SectionDefinition<{
33
- type: "media_grid";
37
+ type: "media";
34
38
  content: {
35
- columns: number;
36
- media: ({
39
+ ref: {
37
40
  imageId: string;
38
41
  type: "image";
39
42
  caption?: string | string[] | undefined;
@@ -53,44 +56,25 @@ export declare const allSectionDefs: (import("../..").SectionDefinition<{
53
56
  autoplay?: boolean | undefined;
54
57
  loop?: boolean | undefined;
55
58
  muted?: boolean | undefined;
56
- } | {
57
- imageId: string;
58
- type: "doDontImage";
59
- doDont: "do" | "dont";
60
- caption?: string | string[] | undefined;
61
- background?: string | undefined;
62
- invertFrom?: string | undefined;
63
- border?: boolean | undefined;
64
- objectFit?: "cover" | "contain" | undefined;
65
- } | {
66
- imageId: string;
67
- type: "linkedImage";
59
+ };
60
+ link?: {
61
+ kind: "external";
68
62
  href: string;
69
- caption?: string | string[] | undefined;
70
- background?: string | undefined;
71
- invertFrom?: string | undefined;
72
- border?: boolean | undefined;
73
- objectFit?: "cover" | "contain" | undefined;
74
- target?: string | undefined;
75
- linkText?: string | undefined;
76
- })[];
63
+ target: "_self" | "_blank";
64
+ } | {
65
+ kind: "internal";
66
+ pageId: string;
67
+ target: "_self" | "_blank";
68
+ anchorSectionId?: string | null | undefined;
69
+ } | undefined;
70
+ dodont?: "do" | "dont" | undefined;
77
71
  };
78
72
  options: {
79
73
  square?: boolean | undefined;
74
+ showCaption?: boolean | undefined;
80
75
  border?: boolean | undefined;
81
- crop?: boolean | undefined;
82
- showCaptions?: boolean | undefined;
76
+ objectFit?: "cover" | "contain" | undefined;
83
77
  };
84
- }> | import("../..").SectionDefinition<{
85
- type: "split_content";
86
- content: {
87
- body: string;
88
- imageId?: string | undefined;
89
- };
90
- options?: {
91
- border?: boolean | undefined;
92
- imagePosition?: "left" | "right" | undefined;
93
- } | undefined;
94
78
  }> | import("../..").SectionDefinition<{
95
79
  type: "button";
96
80
  content: {
@@ -127,88 +111,30 @@ export declare const allSectionDefs: (import("../..").SectionDefinition<{
127
111
  showLabel?: boolean | undefined;
128
112
  } | undefined;
129
113
  }> | import("../..").SectionDefinition<{
130
- type: "do_dont";
114
+ type: "icon_list";
131
115
  content: {
132
- doItems: {
133
- label: string;
134
- text: string;
135
- icon?: string | undefined;
136
- }[];
137
- dontItems: {
116
+ items: {
138
117
  label: string;
139
118
  text: string;
140
119
  icon?: string | undefined;
120
+ dodont?: "do" | "dont" | undefined;
141
121
  }[];
142
122
  };
143
123
  options?: {
124
+ icon?: string | null | undefined;
144
125
  showLabel?: boolean | undefined;
145
126
  stackText?: boolean | undefined;
146
127
  } | undefined;
147
128
  }> | import("../..").SectionDefinition<{
148
- type: "do_dont_grid";
129
+ type: "container";
149
130
  content: {
131
+ children: import("../..").Section<Record<string, unknown>>[];
150
132
  columns: number;
151
- media: ({
152
- imageId: string;
153
- type: "image";
154
- caption?: string | string[] | undefined;
155
- background?: string | undefined;
156
- invertFrom?: string | undefined;
157
- border?: boolean | undefined;
158
- objectFit?: "cover" | "contain" | undefined;
159
- } | {
160
- imageId: string;
161
- type: "video";
162
- caption?: string | string[] | undefined;
163
- background?: string | undefined;
164
- invertFrom?: string | undefined;
165
- border?: boolean | undefined;
166
- objectFit?: "cover" | "contain" | undefined;
167
- poster?: string | undefined;
168
- autoplay?: boolean | undefined;
169
- loop?: boolean | undefined;
170
- muted?: boolean | undefined;
171
- } | {
172
- imageId: string;
173
- type: "doDontImage";
174
- doDont: "do" | "dont";
175
- caption?: string | string[] | undefined;
176
- background?: string | undefined;
177
- invertFrom?: string | undefined;
178
- border?: boolean | undefined;
179
- objectFit?: "cover" | "contain" | undefined;
180
- } | {
181
- imageId: string;
182
- type: "linkedImage";
183
- href: string;
184
- caption?: string | string[] | undefined;
185
- background?: string | undefined;
186
- invertFrom?: string | undefined;
187
- border?: boolean | undefined;
188
- objectFit?: "cover" | "contain" | undefined;
189
- target?: string | undefined;
190
- linkText?: string | undefined;
191
- })[];
192
- };
193
- options: {
194
- square?: boolean | undefined;
195
- border?: boolean | undefined;
196
- crop?: boolean | undefined;
197
- showCaptions?: boolean | undefined;
133
+ flow: "row" | "column";
134
+ childDefaults?: Record<string, unknown> | undefined;
198
135
  };
199
136
  }> | import("../..").SectionDefinition<{
200
- type: "icon_list";
201
- content: {
202
- items: {
203
- label: string;
204
- text: string;
205
- icon?: string | undefined;
206
- }[];
207
- };
208
- options?: {
209
- icon?: string | null | undefined;
210
- showLabel?: boolean | undefined;
211
- stackText?: boolean | undefined;
212
- } | undefined;
137
+ type: "spacer";
138
+ content: Record<string, never>;
213
139
  }>)[];
214
140
  //# sourceMappingURL=all-sections.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"all-sections.d.ts","sourceRoot":"","sources":["../../../src/components/sections/all-sections.ts"],"names":[],"mappings":"AAYA;;;;;;;;GAQG;AAKH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAY1B,CAAC"}
1
+ {"version":3,"file":"all-sections.d.ts","sourceRoot":"","sources":["../../../src/components/sections/all-sections.ts"],"names":[],"mappings":"AAWA;;;;;;;;;;;;GAYG;AAKH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAW1B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"register-schemas.d.ts","sourceRoot":"","sources":["../../../src/components/sections/register-schemas.ts"],"names":[],"mappings":"AAUA,wBAAgB,uBAAuB,IAAI,MAAM,CAMhD"}
1
+ {"version":3,"file":"register-schemas.d.ts","sourceRoot":"","sources":["../../../src/components/sections/register-schemas.ts"],"names":[],"mappings":"AAUA,wBAAgB,uBAAuB,IAAI,MAAM,CAShD"}