@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
@@ -33,6 +33,11 @@ export type SettingsFieldDef =
33
33
  default: string;
34
34
  target?: "content" | "options";
35
35
  coerce?: "number";
36
+ /** When set, an empty-string ("") selection is normalized to `undefined`
37
+ * before the content/options split, so an optional-enum field clears cleanly
38
+ * (e.g. Media `dodont`, whose enum is strictly ["do","dont"]). Opt-in so other
39
+ * selects keep their "" value. */
40
+ emptyIsUndefined?: boolean;
36
41
  options: { label: string; value: string }[];
37
42
  }
38
43
  | {
@@ -79,6 +84,8 @@ export interface WrapperProps {
79
84
  dirty?: boolean;
80
85
  index: number;
81
86
  isLast: boolean;
87
+ containerId: string;
88
+ isContainerBlock: boolean;
82
89
  definition: SectionDefinition;
83
90
  options?: Record<string, unknown>;
84
91
  audiences: Audience[];
@@ -90,6 +97,7 @@ export interface WrapperProps {
90
97
  onRequestInsert?: (index: number) => void;
91
98
  onDelete?: () => void;
92
99
  onMoveSection?: () => void;
100
+ onAddChild?: () => void;
93
101
  mainStatus?: string | null;
94
102
  contentDiffersFromMain?: boolean;
95
103
  isLocalOnly?: boolean;
@@ -111,6 +119,19 @@ export interface SectionDefinition<T = unknown> {
111
119
  getLabel?(content: T): string;
112
120
  getThumbnails?(content: T): Thumbnail[];
113
121
  navRole?: "h1" | "h2" | "h3";
122
+ /** content-relative field paths that hold HTML rich text (for the sanitizer). */
123
+ richTextFields?: readonly string[];
124
+ /**
125
+ * Option keys (under this type's `options`) that a parent container may set as a
126
+ * default for all children via `content.childDefaults`. v1: typed primitives only.
127
+ */
128
+ inheritableSettings?: readonly string[];
129
+ /**
130
+ * Optional grouping of `settings` fields into labeled tabs for the settings modal;
131
+ * presentation-only — does not change content/options routing; omitted fields fall
132
+ * into a trailing 'Other' tab.
133
+ */
134
+ settingsTabs?: { label: string; fields: string[] }[];
114
135
  }
115
136
 
116
137
  // --- defineSection ---
@@ -128,6 +149,14 @@ type DefineSectionInput<S extends ZodType> = {
128
149
  getLabel?(content: z.infer<S>): string;
129
150
  getThumbnails?(content: z.infer<S>): Thumbnail[];
130
151
  navRole?: "h1" | "h2" | "h3";
152
+ richTextFields?: readonly string[];
153
+ inheritableSettings?: readonly string[];
154
+ /**
155
+ * Optional grouping of `settings` fields into labeled tabs for the settings modal;
156
+ * presentation-only — does not change content/options routing; omitted fields fall
157
+ * into a trailing 'Other' tab.
158
+ */
159
+ settingsTabs?: { label: string; fields: string[] }[];
131
160
  };
132
161
 
133
162
  export function defineSection<S extends ZodType>(
@@ -146,6 +175,8 @@ export interface SectionRegistry {
146
175
  getSchema(type: string): ZodType | undefined;
147
176
  getAllSections(): SectionDefinition[];
148
177
  getAllSchemas(): ZodType[];
178
+ registerRichText(type: string, fields: readonly string[]): void;
179
+ getRichTextFields(type: string): readonly string[];
149
180
  clearRegistry(): void;
150
181
  }
151
182
 
@@ -153,14 +184,22 @@ export function createRegistry(): SectionRegistry {
153
184
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
154
185
  const sections = new Map<string, SectionDefinition<any>>();
155
186
  const schemas = new Map<string, ZodType>();
187
+ const richText = new Map<string, readonly string[]>();
156
188
 
157
189
  return {
158
190
  registerSection(def) {
159
191
  sections.set(def.type, def);
192
+ if (def.richTextFields) richText.set(def.type, def.richTextFields);
160
193
  },
161
194
  registerSchema(type, schema) {
162
195
  schemas.set(type, schema);
163
196
  },
197
+ registerRichText(type, fields) {
198
+ richText.set(type, fields);
199
+ },
200
+ getRichTextFields(type) {
201
+ return richText.get(type) ?? [];
202
+ },
164
203
  getSection(type) {
165
204
  return sections.get(type);
166
205
  },
@@ -180,6 +219,7 @@ export function createRegistry(): SectionRegistry {
180
219
  clearRegistry() {
181
220
  sections.clear();
182
221
  schemas.clear();
222
+ richText.clear();
183
223
  },
184
224
  };
185
225
  }
@@ -202,6 +242,14 @@ export function registerSchema(type: string, schema: ZodType): void {
202
242
  defaultRegistry.registerSchema(type, schema);
203
243
  }
204
244
 
245
+ export function registerRichText(type: string, fields: readonly string[]): void {
246
+ defaultRegistry.registerRichText(type, fields);
247
+ }
248
+
249
+ export function getRichTextFields(type: string): readonly string[] {
250
+ return defaultRegistry.getRichTextFields(type);
251
+ }
252
+
205
253
  export function getSection(type: string): SectionDefinition | undefined {
206
254
  return defaultRegistry.getSection(type);
207
255
  }
@@ -0,0 +1,40 @@
1
+ import { z } from "zod";
2
+
3
+ /**
4
+ * A block's participation in its parent container's layout — distinct from its
5
+ * content. Optional, and absent at the page root (the root is an implicit single
6
+ * column). Intentionally NOT strict so future keys (rowSpan, alignSelf) are
7
+ * forward-compatible.
8
+ */
9
+ export const LayoutEnvelopeSchema = z.object({
10
+ colSpan: z.number().int().min(1).optional(),
11
+ });
12
+
13
+ export type LayoutEnvelope = z.infer<typeof LayoutEnvelopeSchema>;
14
+
15
+ /** v1 nesting cap: a top-level container (depth 2) may hold leaves but not containers. */
16
+ export const MAX_BLOCK_DEPTH = 2;
17
+
18
+ /** Content-agnostic: any block whose `content.children` is an array is a container. */
19
+ export function getBlockChildren(block: unknown): unknown[] {
20
+ if (typeof block !== "object" || block === null) return [];
21
+ const content = (block as { content?: unknown }).content;
22
+ if (typeof content !== "object" || content === null) return [];
23
+ const children = (content as { children?: unknown }).children;
24
+ return Array.isArray(children) ? children : [];
25
+ }
26
+
27
+ /** Depth of a block tree: a leaf is 1; a container is 1 + max(child depths). */
28
+ export function blockDepth(block: unknown): number {
29
+ const children = getBlockChildren(block);
30
+ if (children.length === 0) return 1;
31
+ return 1 + Math.max(...children.map(blockDepth));
32
+ }
33
+
34
+ /** Throws if the block tree is deeper than `max`. */
35
+ export function assertMaxDepth(block: unknown, max: number = MAX_BLOCK_DEPTH): void {
36
+ const depth = blockDepth(block);
37
+ if (depth > max) {
38
+ throw new Error(`Block tree depth ${depth} exceeds MAX_BLOCK_DEPTH (${max})`);
39
+ }
40
+ }
@@ -2,8 +2,26 @@ import { z } from "zod";
2
2
 
3
3
  export const LinkTargetSchema = z.enum(["_self", "_blank"]);
4
4
 
5
+ /**
6
+ * Block dangerous href schemes (javascript:, data:, vbscript:) and protocol-
7
+ * relative URLs at the schema boundary. Allows empty (unset), relative paths /
8
+ * fragments / queries, and http(s)/mailto absolute URLs. Links are not walked by
9
+ * the recursive sanitizer, so this is the only XSS guard for stored link hrefs.
10
+ */
11
+ export function isSafeHref(href: string): boolean {
12
+ // Browsers strip leading ASCII whitespace and embedded \t \r \n before
13
+ // interpreting the scheme, so normalize the same way before checking.
14
+ const normalized = href.replace(/[\t\r\n]/g, "").trimStart();
15
+ if (normalized === "") return true;
16
+ if (normalized.startsWith("//")) return false; // protocol-relative
17
+ const scheme = /^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(normalized);
18
+ if (!scheme) return true; // no scheme → relative path / fragment / query
19
+ const s = scheme[1].toLowerCase();
20
+ return s === "http" || s === "https" || s === "mailto";
21
+ }
22
+
5
23
  export const LinkValueSchema = z.discriminatedUnion("kind", [
6
- z.object({ kind: z.literal("external"), href: z.string(), target: LinkTargetSchema }),
24
+ z.object({ kind: z.literal("external"), href: z.string().refine(isSafeHref, "Unsafe href scheme"), target: LinkTargetSchema }),
7
25
  z.object({
8
26
  kind: z.literal("internal"),
9
27
  pageId: z.string(),
@@ -0,0 +1,11 @@
1
+ import { z } from "zod";
2
+
3
+ /**
4
+ * Marks a schema field as HTML rich text. Readability marker only — the runtime
5
+ * source of truth for sanitization is each block definition's `richTextFields`
6
+ * list (see registry). Kept as a helper so schemas read self-documentingly
7
+ * (`body: richText()`) and a future Zod version could make it introspectable.
8
+ */
9
+ export function richText() {
10
+ return z.string();
11
+ }
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { getAllSchemas } from "../lib/registry";
3
+ import { LayoutEnvelopeSchema, type LayoutEnvelope } from "./block";
3
4
 
4
5
  export interface SectionContent<C = Record<string, unknown>> {
5
6
  type: string;
@@ -9,6 +10,7 @@ export interface SectionContent<C = Record<string, unknown>> {
9
10
 
10
11
  export interface Section<C = Record<string, unknown>> extends SectionContent<C> {
11
12
  id: string;
13
+ layout?: LayoutEnvelope;
12
14
  }
13
15
 
14
16
  export function getSectionContentSchema(): z.ZodType<SectionContent> {
@@ -20,5 +22,7 @@ export function getSectionContentSchema(): z.ZodType<SectionContent> {
20
22
  }
21
23
 
22
24
  export function getSectionSchema(): z.ZodType<Section> {
23
- return z.object({ id: z.string() }).and(getSectionContentSchema()) as z.ZodType<Section>;
25
+ return z
26
+ .object({ id: z.string(), layout: LayoutEnvelopeSchema.optional() })
27
+ .and(getSectionContentSchema()) as z.ZodType<Section>;
24
28
  }
@@ -71,6 +71,12 @@ export const MediaReferenceSchema = z.discriminatedUnion("type", [
71
71
 
72
72
  export type MediaReference = z.infer<typeof MediaReferenceSchema>;
73
73
 
74
+ /** A single image or video reference — for the standalone `media` block
75
+ * (excludes the grid-only doDontImage/linkedImage variants). */
76
+ export const SingleMediaReferenceSchema = z.discriminatedUnion("type", [ImageRef, VideoRef]);
77
+
78
+ export type SingleMediaReference = z.infer<typeof SingleMediaReferenceSchema>;
79
+
74
80
  // --- Colors ---
75
81
  export const HexColorSchema = z
76
82
  .string()
@@ -1,16 +0,0 @@
1
- import type { SectionContent } from "../../schemas/sections";
2
- interface DoDontItem {
3
- label: string;
4
- text: string;
5
- icon?: string;
6
- }
7
- interface Props {
8
- doItems: DoDontItem[];
9
- dontItems: DoDontItem[];
10
- showLabel?: boolean;
11
- stackText?: boolean;
12
- onChange?: (content: SectionContent) => void;
13
- }
14
- export default function DoDontList({ doItems, dontItems, showLabel, stackText, onChange, }: Props): import("react/jsx-runtime").JSX.Element;
15
- export {};
16
- //# sourceMappingURL=DoDontList.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DoDontList.d.ts","sourceRoot":"","sources":["../../../src/components/brandguide/DoDontList.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7D,UAAU,UAAU;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,UAAU,KAAK;IACb,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,SAAS,EAAE,UAAU,EAAE,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;CAC9C;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,OAAO,EACP,SAAS,EACT,SAAgB,EAChB,SAAiB,EACjB,QAAQ,GACT,EAAE,KAAK,2CA0CP"}
@@ -1,16 +0,0 @@
1
- import type { ReactNode } from "react";
2
- import type { MediaReference } from "../../schemas/shared";
3
- import type { SectionContent } from "../../schemas/sections";
4
- interface Props {
5
- media: MediaReference[];
6
- columns: number;
7
- square?: boolean;
8
- border?: boolean;
9
- crop?: boolean;
10
- showCaptions?: boolean;
11
- onChange?: (content: SectionContent) => void;
12
- openModal?: (title: string, content: ReactNode) => void;
13
- }
14
- export default function DoDontMediaGrid(props: Props): import("react/jsx-runtime").JSX.Element;
15
- export {};
16
- //# sourceMappingURL=DoDontMediaGrid.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DoDontMediaGrid.d.ts","sourceRoot":"","sources":["../../../src/components/brandguide/DoDontMediaGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7D,UAAU,KAAK;IACb,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IAC7C,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,KAAK,IAAI,CAAC;CACzD;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,KAAK,2CAEnD"}
@@ -1,23 +0,0 @@
1
- export declare function ImageSettingsForm({ border, objectFit, invertFrom: initialInvertFrom, onChange, }: {
2
- border?: boolean;
3
- objectFit?: "cover" | "contain";
4
- invertFrom?: string;
5
- onChange: (update: {
6
- border?: boolean;
7
- objectFit?: "cover" | "contain";
8
- invertFrom?: string;
9
- }) => void;
10
- }): import("react/jsx-runtime").JSX.Element;
11
- export declare function DoDontImageSettingsForm({ border, objectFit, invertFrom, doDont: initialDoDont, onChange, }: {
12
- border?: boolean;
13
- objectFit?: "cover" | "contain";
14
- invertFrom?: string;
15
- doDont: "do" | "dont";
16
- onChange: (update: {
17
- border?: boolean;
18
- objectFit?: "cover" | "contain";
19
- invertFrom?: string;
20
- doDont: "do" | "dont";
21
- }) => void;
22
- }): import("react/jsx-runtime").JSX.Element;
23
- //# sourceMappingURL=MediaSettingsForms.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MediaSettingsForms.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/MediaSettingsForms.tsx"],"names":[],"mappings":"AAMA,wBAAgB,iBAAiB,CAAC,EAChC,MAAM,EACN,SAAS,EACT,UAAU,EAAE,iBAAiB,EAC7B,QAAQ,GACT,EAAE;IACD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,CAAC,MAAM,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CACxG,2CA6CA;AAED,wBAAgB,uBAAuB,CAAC,EACtC,MAAM,EACN,SAAS,EACT,UAAU,EACV,MAAM,EAAE,aAAa,EACrB,QAAQ,GACT,EAAE;IACD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,IAAI,GAAG,MAAM,CAAC;IACtB,QAAQ,EAAE,CAAC,MAAM,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,IAAI,GAAG,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAC/H,2CAoDA"}
@@ -1,21 +0,0 @@
1
- declare const _default: import("../../..").SectionDefinition<{
2
- type: "do_dont";
3
- content: {
4
- doItems: {
5
- label: string;
6
- text: string;
7
- icon?: string | undefined;
8
- }[];
9
- dontItems: {
10
- label: string;
11
- text: string;
12
- icon?: string | undefined;
13
- }[];
14
- };
15
- options?: {
16
- showLabel?: boolean | undefined;
17
- stackText?: boolean | undefined;
18
- } | undefined;
19
- }>;
20
- export default _default;
21
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/DoDontList/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,wBAyBG"}
@@ -1,55 +0,0 @@
1
- declare const _default: import("../../..").SectionDefinition<{
2
- type: "do_dont_grid";
3
- content: {
4
- columns: number;
5
- media: ({
6
- imageId: string;
7
- type: "image";
8
- caption?: string | string[] | undefined;
9
- background?: string | undefined;
10
- invertFrom?: string | undefined;
11
- border?: boolean | undefined;
12
- objectFit?: "cover" | "contain" | undefined;
13
- } | {
14
- imageId: string;
15
- type: "video";
16
- caption?: string | string[] | undefined;
17
- background?: string | undefined;
18
- invertFrom?: string | undefined;
19
- border?: boolean | undefined;
20
- objectFit?: "cover" | "contain" | undefined;
21
- poster?: string | undefined;
22
- autoplay?: boolean | undefined;
23
- loop?: boolean | undefined;
24
- 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";
37
- 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
- })[];
46
- };
47
- options: {
48
- square?: boolean | undefined;
49
- border?: boolean | undefined;
50
- crop?: boolean | undefined;
51
- showCaptions?: boolean | undefined;
52
- };
53
- }>;
54
- export default _default;
55
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/DoDontMediaGrid/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,wBA8CG"}
@@ -1,17 +0,0 @@
1
- import type { MediaReference } from "../../../schemas/shared";
2
- import type { SectionContent } from "../../../schemas/sections";
3
- import type { ReactNode } from "react";
4
- interface Props {
5
- media: MediaReference[];
6
- columns: number;
7
- square?: boolean;
8
- border?: boolean;
9
- crop?: boolean;
10
- showCaptions?: boolean;
11
- sectionType?: string;
12
- onChange?: (content: SectionContent) => void;
13
- openModal?: (title: string, content: ReactNode) => void;
14
- }
15
- export default function MediaGrid({ media, columns, square, border, crop, showCaptions, sectionType, onChange, openModal }: Props): import("react/jsx-runtime").JSX.Element;
16
- export {};
17
- //# sourceMappingURL=MediaGrid.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MediaGrid.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/MediaGrid/MediaGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAOhE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,UAAU,KAAK;IACb,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IAC7C,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,KAAK,IAAI,CAAC;CACzD;AAED,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,KAAK,2CAgChI"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/MediaGrid/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,wBAwCG"}
@@ -1,14 +0,0 @@
1
- import type { SectionContent } from "../../../schemas/sections";
2
- interface Props {
3
- imageId: string | undefined;
4
- src?: string;
5
- srcset?: string;
6
- alt?: string;
7
- body: string;
8
- border?: boolean;
9
- imagePosition?: "left" | "right";
10
- onChange?: (content: SectionContent) => void;
11
- }
12
- export default function SplitContent({ imageId, src, srcset, alt, body, border, imagePosition, onChange }: Props): import("react/jsx-runtime").JSX.Element;
13
- export {};
14
- //# sourceMappingURL=SplitContent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SplitContent.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/SplitContent/SplitContent.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAIhE,UAAU,KAAK;IACb,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACjC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;CAC9C;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,aAAsB,EAAE,QAAQ,EAAE,EAAE,KAAK,2CA8DxH"}
@@ -1,13 +0,0 @@
1
- declare const _default: import("../../..").SectionDefinition<{
2
- type: "split_content";
3
- content: {
4
- body: string;
5
- imageId?: string | undefined;
6
- };
7
- options?: {
8
- border?: boolean | undefined;
9
- imagePosition?: "left" | "right" | undefined;
10
- } | undefined;
11
- }>;
12
- export default _default;
13
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/SplitContent/index.tsx"],"names":[],"mappings":";;;;;;;;;;;AAkBA,wBAoCG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"DoDontList.d.ts","sourceRoot":"","sources":["DoDontList.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7D,UAAU,UAAU;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,UAAU,KAAK;IACb,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,SAAS,EAAE,UAAU,EAAE,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;CAC9C;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,OAAO,EACP,SAAS,EACT,SAAgB,EAChB,SAAiB,EACjB,QAAQ,GACT,EAAE,KAAK,2CA0CP"}
@@ -1,67 +0,0 @@
1
- import { useRef, useEffect } from "react";
2
- import type { SectionContent } from "../../schemas/sections";
3
- import IconList from "../sections/IconList/IconList";
4
-
5
- interface DoDontItem {
6
- label: string;
7
- text: string;
8
- icon?: string;
9
- }
10
-
11
- interface Props {
12
- doItems: DoDontItem[];
13
- dontItems: DoDontItem[];
14
- showLabel?: boolean;
15
- stackText?: boolean;
16
- onChange?: (content: SectionContent) => void;
17
- }
18
-
19
- export default function DoDontList({
20
- doItems,
21
- dontItems,
22
- showLabel = true,
23
- stackText = false,
24
- onChange,
25
- }: Props) {
26
- const doRef = useRef(doItems);
27
- const dontRef = useRef(dontItems);
28
- useEffect(() => { doRef.current = doItems; }, [doItems]);
29
- useEffect(() => { dontRef.current = dontItems; }, [dontItems]);
30
-
31
- return (
32
- <div className="grid items-start gap-16 lg:grid-cols-2">
33
- <IconList
34
- items={doItems}
35
- icon="check"
36
- showLabel={showLabel}
37
- stackText={stackText}
38
- labelClassName="font-bold text-base-contrast"
39
- textClassName="text-base-contrast"
40
- iconClassName="text-green-600"
41
- onItemsChange={onChange ? (items) => {
42
- onChange({
43
- type: "do_dont",
44
- content: { doItems: items as DoDontItem[], dontItems: dontRef.current },
45
- options: { showLabel, stackText },
46
- });
47
- } : undefined}
48
- />
49
- <IconList
50
- items={dontItems}
51
- icon="x"
52
- showLabel={showLabel}
53
- stackText={stackText}
54
- labelClassName="font-bold text-base-contrast"
55
- textClassName="text-base-contrast"
56
- iconClassName="text-red-600"
57
- onItemsChange={onChange ? (items) => {
58
- onChange({
59
- type: "do_dont",
60
- content: { doItems: doRef.current, dontItems: items as DoDontItem[] },
61
- options: { showLabel, stackText },
62
- });
63
- } : undefined}
64
- />
65
- </div>
66
- );
67
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"DoDontMediaGrid.d.ts","sourceRoot":"","sources":["DoDontMediaGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7D,UAAU,KAAK;IACb,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IAC7C,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,KAAK,IAAI,CAAC;CACzD;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,KAAK,2CAEnD"}
@@ -1,19 +0,0 @@
1
- import type { ReactNode } from "react";
2
- import type { MediaReference } from "../../schemas/shared";
3
- import type { SectionContent } from "../../schemas/sections";
4
- import MediaGrid from "../sections/MediaGrid/MediaGrid";
5
-
6
- interface Props {
7
- media: MediaReference[];
8
- columns: number;
9
- square?: boolean;
10
- border?: boolean;
11
- crop?: boolean;
12
- showCaptions?: boolean;
13
- onChange?: (content: SectionContent) => void;
14
- openModal?: (title: string, content: ReactNode) => void;
15
- }
16
-
17
- export default function DoDontMediaGrid(props: Props) {
18
- return <MediaGrid {...props} sectionType="do_dont_grid" />;
19
- }