@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.
- package/dist/{chunk-KGYWQDBB.js → chunk-ICLXLWQ5.js} +9 -72
- package/dist/chunk-NSCT3AMV.js +32 -0
- package/dist/{chunk-EU6NZ4GS.js → chunk-PRKUXM7E.js} +23 -9
- package/dist/{chunk-7IAWF7LE.js → chunk-PYWS3MOJ.js} +12 -2
- package/dist/chunk-TG43X7JO.js +123 -0
- package/dist/chunk-VKAGMEKE.js +90 -0
- package/dist/components/editor/ChildBlockWrapper.d.ts +19 -0
- package/dist/components/editor/ChildBlockWrapper.d.ts.map +1 -0
- package/dist/components/editor/ColSpanControl.d.ts +9 -0
- package/dist/components/editor/ColSpanControl.d.ts.map +1 -0
- package/dist/components/editor/SectionWrapper.d.ts +1 -1
- package/dist/components/editor/SectionWrapper.d.ts.map +1 -1
- package/dist/components/editor/SettingsForm.d.ts +5 -1
- package/dist/components/editor/SettingsForm.d.ts.map +1 -1
- package/dist/components/primitives/EditableGrid.d.ts.map +1 -1
- package/dist/components/primitives/IconPicker.d.ts +7 -1
- package/dist/components/primitives/IconPicker.d.ts.map +1 -1
- package/dist/components/sections/Container/Container.d.ts +20 -0
- package/dist/components/sections/Container/Container.d.ts.map +1 -0
- package/dist/components/sections/Container/ContainerSettingsForm.d.ts +17 -0
- package/dist/components/sections/Container/ContainerSettingsForm.d.ts.map +1 -0
- package/dist/components/sections/Container/index.d.ts +11 -0
- package/dist/components/sections/Container/index.d.ts.map +1 -0
- package/dist/components/sections/IconList/IconList.d.ts +1 -0
- package/dist/components/sections/IconList/IconList.d.ts.map +1 -1
- package/dist/components/sections/IconList/IconListSettings.d.ts +3 -4
- package/dist/components/sections/IconList/IconListSettings.d.ts.map +1 -1
- package/dist/components/sections/IconList/index.d.ts +1 -0
- package/dist/components/sections/IconList/index.d.ts.map +1 -1
- package/dist/components/sections/Media/MediaBlock.d.ts +19 -0
- package/dist/components/sections/Media/MediaBlock.d.ts.map +1 -0
- package/dist/components/sections/{MediaGrid → Media}/index.d.ts +15 -25
- package/dist/components/sections/Media/index.d.ts.map +1 -0
- package/dist/components/sections/Prose/index.d.ts.map +1 -1
- package/dist/components/sections/Spacer/Spacer.d.ts +2 -0
- package/dist/components/sections/Spacer/Spacer.d.ts.map +1 -0
- package/dist/components/sections/Spacer/index.d.ts +6 -0
- package/dist/components/sections/Spacer/index.d.ts.map +1 -0
- package/dist/components/sections/all-sections.d.ts +29 -103
- package/dist/components/sections/all-sections.d.ts.map +1 -1
- package/dist/components/sections/register-schemas.d.ts.map +1 -1
- package/dist/components/shared/Tabs.d.ts +24 -0
- package/dist/components/shared/Tabs.d.ts.map +1 -0
- package/dist/components/shell/EditorShell.d.ts.map +1 -1
- package/dist/components/shell/SiteSettingsModal.d.ts.map +1 -1
- package/dist/components/shell/blockMoveDispatch.d.ts +21 -0
- package/dist/components/shell/blockMoveDispatch.d.ts.map +1 -0
- package/dist/hooks/useBlockDnd.d.ts +48 -0
- package/dist/hooks/useBlockDnd.d.ts.map +1 -0
- package/dist/index.js +56 -48
- package/dist/lib/block-dnd.d.ts +42 -0
- package/dist/lib/block-dnd.d.ts.map +1 -0
- package/dist/lib/block-move.d.ts +31 -0
- package/dist/lib/block-move.d.ts.map +1 -0
- package/dist/lib/container-grid.d.ts +29 -0
- package/dist/lib/container-grid.d.ts.map +1 -0
- package/dist/lib/container-ops.d.ts +44 -0
- package/dist/lib/container-ops.d.ts.map +1 -0
- package/dist/lib/dexie.d.ts.map +1 -1
- package/dist/lib/dexie.js +13 -0
- package/dist/lib/index.js +10 -7
- package/dist/lib/loader.d.ts.map +1 -1
- package/dist/lib/migrate-sections-transform.d.ts +12 -0
- package/dist/lib/migrate-sections-transform.d.ts.map +1 -0
- package/dist/lib/migrate-sections-transform.js +6 -0
- package/dist/lib/registry.d.ts +39 -0
- package/dist/lib/registry.d.ts.map +1 -1
- package/dist/lib/registry.js +26 -0
- package/dist/schemas/block.d.ts +20 -0
- package/dist/schemas/block.d.ts.map +1 -0
- package/dist/schemas/block.js +14 -0
- package/dist/schemas/index.js +8 -2
- package/dist/schemas/link.d.ts +7 -0
- package/dist/schemas/link.d.ts.map +1 -1
- package/dist/schemas/rich-text.d.ts +9 -0
- package/dist/schemas/rich-text.d.ts.map +1 -0
- package/dist/schemas/sections.d.ts +2 -0
- package/dist/schemas/sections.d.ts.map +1 -1
- package/dist/schemas/shared.d.ts +30 -0
- package/dist/schemas/shared.d.ts.map +1 -1
- package/package.json +13 -1
- package/src/components/brandguide/Colors.tsx +35 -33
- package/src/components/editor/ChildBlockWrapper.tsx +108 -0
- package/src/components/editor/ColSpanControl.tsx +56 -0
- package/src/components/editor/SectionWrapper.tsx +44 -20
- package/src/components/editor/SettingsForm.tsx +100 -73
- package/src/components/primitives/EditableGrid.tsx +40 -36
- package/src/components/primitives/IconPicker.tsx +116 -26
- package/src/components/sections/Container/Container.tsx +354 -0
- package/src/components/sections/Container/ContainerSettingsForm.tsx +113 -0
- package/src/components/sections/Container/index.tsx +51 -0
- package/src/components/sections/IconList/IconList.tsx +113 -43
- package/src/components/sections/IconList/IconListSettings.tsx +2 -2
- package/src/components/sections/IconList/index.tsx +1 -1
- package/src/components/sections/Media/MediaBlock.tsx +103 -0
- package/src/components/sections/Media/index.tsx +85 -0
- package/src/components/sections/Prose/index.tsx +1 -0
- package/src/components/sections/Spacer/Spacer.tsx +6 -0
- package/src/components/sections/Spacer/index.tsx +18 -0
- package/src/components/sections/all-sections.ts +10 -8
- package/src/components/sections/register-schemas.ts +5 -2
- package/src/components/shared/Tabs.tsx +63 -0
- package/src/components/shell/EditorShell.tsx +105 -13
- package/src/components/shell/SiteSettingsModal.tsx +41 -51
- package/src/components/shell/blockMoveDispatch.ts +40 -0
- package/src/hooks/useBlockDnd.ts +144 -0
- package/src/lib/block-dnd.ts +58 -0
- package/src/lib/block-move.ts +236 -0
- package/src/lib/container-grid.ts +58 -0
- package/src/lib/container-ops.ts +159 -0
- package/src/lib/dexie.ts +22 -0
- package/src/lib/loader.ts +16 -4
- package/src/lib/migrate-sections-transform.ts +147 -0
- package/src/lib/registry.ts +48 -0
- package/src/schemas/block.ts +40 -0
- package/src/schemas/link.ts +19 -1
- package/src/schemas/rich-text.ts +11 -0
- package/src/schemas/sections.ts +5 -1
- package/src/schemas/shared.ts +6 -0
- package/dist/components/brandguide/DoDontList.d.ts +0 -16
- package/dist/components/brandguide/DoDontList.d.ts.map +0 -1
- package/dist/components/brandguide/DoDontMediaGrid.d.ts +0 -16
- package/dist/components/brandguide/DoDontMediaGrid.d.ts.map +0 -1
- package/dist/components/primitives/MediaSettingsForms.d.ts +0 -23
- package/dist/components/primitives/MediaSettingsForms.d.ts.map +0 -1
- package/dist/components/sections/DoDontList/index.d.ts +0 -21
- package/dist/components/sections/DoDontList/index.d.ts.map +0 -1
- package/dist/components/sections/DoDontMediaGrid/index.d.ts +0 -55
- package/dist/components/sections/DoDontMediaGrid/index.d.ts.map +0 -1
- package/dist/components/sections/MediaGrid/MediaGrid.d.ts +0 -17
- package/dist/components/sections/MediaGrid/MediaGrid.d.ts.map +0 -1
- package/dist/components/sections/MediaGrid/index.d.ts.map +0 -1
- package/dist/components/sections/SplitContent/SplitContent.d.ts +0 -14
- package/dist/components/sections/SplitContent/SplitContent.d.ts.map +0 -1
- package/dist/components/sections/SplitContent/index.d.ts +0 -13
- package/dist/components/sections/SplitContent/index.d.ts.map +0 -1
- package/src/components/brandguide/DoDontList.d.ts.map +0 -1
- package/src/components/brandguide/DoDontList.tsx +0 -67
- package/src/components/brandguide/DoDontMediaGrid.d.ts.map +0 -1
- package/src/components/brandguide/DoDontMediaGrid.tsx +0 -19
- package/src/components/primitives/MediaSettingsForms.tsx +0 -128
- package/src/components/sections/DoDontList/index.d.ts.map +0 -1
- package/src/components/sections/DoDontList/index.tsx +0 -45
- package/src/components/sections/DoDontMediaGrid/index.d.ts.map +0 -1
- package/src/components/sections/DoDontMediaGrid/index.tsx +0 -63
- package/src/components/sections/MediaGrid/MediaGrid.d.ts.map +0 -1
- package/src/components/sections/MediaGrid/MediaGrid.tsx +0 -239
- package/src/components/sections/MediaGrid/index.d.ts.map +0 -1
- package/src/components/sections/MediaGrid/index.tsx +0 -57
- package/src/components/sections/SplitContent/SplitContent.d.ts.map +0 -1
- package/src/components/sections/SplitContent/SplitContent.tsx +0 -84
- package/src/components/sections/SplitContent/index.d.ts.map +0 -1
- package/src/components/sections/SplitContent/index.tsx +0 -55
|
@@ -0,0 +1,147 @@
|
|
|
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
|
+
|
|
12
|
+
type Obj = Record<string, unknown>;
|
|
13
|
+
|
|
14
|
+
const RETIRED = new Set(["split_content", "media_grid", "do_dont_grid", "do_dont"]);
|
|
15
|
+
|
|
16
|
+
export function upgradeLegacySection(raw: unknown): unknown {
|
|
17
|
+
if (!raw || typeof raw !== "object") return raw;
|
|
18
|
+
const section = raw as Obj;
|
|
19
|
+
if (!RETIRED.has(section.type as string)) return raw; // same reference → idempotent
|
|
20
|
+
if (section.type === "split_content") return upgradeSplitContent(section);
|
|
21
|
+
if (section.type === "do_dont") return upgradeDoDont(section);
|
|
22
|
+
return upgradeGrid(section); // media_grid | do_dont_grid (per-item type drives the mapping)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Carry only known BaseMediaRef (+ video) fields; drops render artifacts (src/srcset/alt) and any stray keys. */
|
|
26
|
+
function buildRef(item: Obj, forceImage: boolean): Obj {
|
|
27
|
+
const type = forceImage ? "image" : (item.type as string);
|
|
28
|
+
const ref: Obj = { type, imageId: item.imageId ?? "" };
|
|
29
|
+
if (item.caption !== undefined) ref.caption = item.caption;
|
|
30
|
+
if (item.background !== undefined) ref.background = item.background;
|
|
31
|
+
if (item.invertFrom !== undefined) ref.invertFrom = item.invertFrom;
|
|
32
|
+
if (item.border !== undefined) ref.border = item.border;
|
|
33
|
+
if (item.objectFit !== undefined) ref.objectFit = item.objectFit;
|
|
34
|
+
if (type === "video") {
|
|
35
|
+
if (item.poster !== undefined) ref.poster = item.poster;
|
|
36
|
+
if (item.autoplay !== undefined) ref.autoplay = item.autoplay;
|
|
37
|
+
if (item.loop !== undefined) ref.loop = item.loop;
|
|
38
|
+
if (item.muted !== undefined) ref.muted = item.muted;
|
|
39
|
+
}
|
|
40
|
+
return ref;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function mapRefItem(item: Obj, parentId: string, index: number): Obj {
|
|
44
|
+
const content: Obj = {};
|
|
45
|
+
if (item.type === "linkedImage") {
|
|
46
|
+
content.ref = buildRef(item, true);
|
|
47
|
+
content.link = { kind: "external", href: item.href ?? "", target: item.target === "_blank" ? "_blank" : "_self" };
|
|
48
|
+
} else if (item.type === "doDontImage") {
|
|
49
|
+
content.ref = buildRef(item, true);
|
|
50
|
+
if (item.doDont !== undefined) content.dodont = item.doDont;
|
|
51
|
+
} else {
|
|
52
|
+
content.ref = buildRef(item, false); // image | video
|
|
53
|
+
}
|
|
54
|
+
return { id: `${parentId}__media_${index}`, type: "media", content, options: {} };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function upgradeGrid(section: Obj): Obj {
|
|
58
|
+
const id = section.id as string;
|
|
59
|
+
const content = (section.content ?? {}) as Obj;
|
|
60
|
+
const options = (section.options ?? {}) as Obj;
|
|
61
|
+
const media = Array.isArray(content.media) ? (content.media as Obj[]) : [];
|
|
62
|
+
|
|
63
|
+
const childDefaults: Obj = {};
|
|
64
|
+
if (options.square !== undefined) childDefaults.square = options.square;
|
|
65
|
+
if (options.showCaptions !== undefined) childDefaults.showCaption = options.showCaptions; // RENAME plural→singular
|
|
66
|
+
if (options.border !== undefined) childDefaults.border = options.border;
|
|
67
|
+
if (options.crop) childDefaults.objectFit = "cover"; // crop:true → 'cover'; else omit (→ contain)
|
|
68
|
+
|
|
69
|
+
const out: Obj = {
|
|
70
|
+
id,
|
|
71
|
+
type: "container",
|
|
72
|
+
content: {
|
|
73
|
+
columns: content.columns,
|
|
74
|
+
flow: "row",
|
|
75
|
+
children: media.map((item, i) => mapRefItem(item, id, i)),
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
if (Object.keys(childDefaults).length > 0) (out.content as Obj).childDefaults = childDefaults;
|
|
79
|
+
if (section.layout !== undefined) out.layout = section.layout;
|
|
80
|
+
return out;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function upgradeSplitContent(section: Obj): Obj {
|
|
84
|
+
const id = section.id as string;
|
|
85
|
+
const content = (section.content ?? {}) as Obj;
|
|
86
|
+
const options = (section.options ?? {}) as Obj;
|
|
87
|
+
|
|
88
|
+
const mediaChild: Obj = {
|
|
89
|
+
id: `${id}__media_0`,
|
|
90
|
+
type: "media",
|
|
91
|
+
content: { ref: { type: "image", imageId: content.imageId ?? "" } },
|
|
92
|
+
options: options.border !== undefined ? { border: options.border } : {},
|
|
93
|
+
};
|
|
94
|
+
const proseChild: Obj = {
|
|
95
|
+
id: `${id}__prose_1`,
|
|
96
|
+
type: "prose",
|
|
97
|
+
content: { body: content.body ?? "" },
|
|
98
|
+
};
|
|
99
|
+
const children = options.imagePosition === "right" ? [proseChild, mediaChild] : [mediaChild, proseChild];
|
|
100
|
+
|
|
101
|
+
const out: Obj = { id, type: "container", content: { columns: 2, flow: "row", children } };
|
|
102
|
+
if (section.layout !== undefined) out.layout = section.layout;
|
|
103
|
+
return out;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** Carry showLabel/stackText onto each icon_list child; omit the options key entirely when neither is set. */
|
|
107
|
+
function dodontChildOptions(options: Obj): Obj | undefined {
|
|
108
|
+
const out: Obj = {};
|
|
109
|
+
if (options.showLabel !== undefined) out.showLabel = options.showLabel;
|
|
110
|
+
if (options.stackText !== undefined) out.stackText = options.stackText;
|
|
111
|
+
return Object.keys(out).length > 0 ? out : undefined;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** doItems/dontItems → two tagged icon_list children. dodont forces the glyph, so per-item icon is dropped. */
|
|
115
|
+
function dodontChild(items: Obj[], parentId: string, index: number, tag: "do" | "dont", options: Obj | undefined): Obj {
|
|
116
|
+
const child: Obj = {
|
|
117
|
+
id: `${parentId}__icon_list_${index}`,
|
|
118
|
+
type: "icon_list",
|
|
119
|
+
content: { items: items.map((it) => ({ label: it.label ?? "", text: it.text ?? "", dodont: tag })) },
|
|
120
|
+
};
|
|
121
|
+
if (options !== undefined) child.options = options;
|
|
122
|
+
return child;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function upgradeDoDont(section: Obj): Obj {
|
|
126
|
+
const id = section.id as string;
|
|
127
|
+
const content = (section.content ?? {}) as Obj;
|
|
128
|
+
const options = (section.options ?? {}) as Obj;
|
|
129
|
+
const doItems = Array.isArray(content.doItems) ? (content.doItems as Obj[]) : [];
|
|
130
|
+
const dontItems = Array.isArray(content.dontItems) ? (content.dontItems as Obj[]) : [];
|
|
131
|
+
|
|
132
|
+
const childOptions = dodontChildOptions(options);
|
|
133
|
+
const out: Obj = {
|
|
134
|
+
id,
|
|
135
|
+
type: "container",
|
|
136
|
+
content: {
|
|
137
|
+
columns: 2,
|
|
138
|
+
flow: "row",
|
|
139
|
+
children: [
|
|
140
|
+
dodontChild(doItems, id, 0, "do", childOptions),
|
|
141
|
+
dodontChild(dontItems, id, 1, "dont", childOptions),
|
|
142
|
+
],
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
if (section.layout !== undefined) out.layout = section.layout;
|
|
146
|
+
return out;
|
|
147
|
+
}
|
package/src/lib/registry.ts
CHANGED
|
@@ -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
|
+
}
|
package/src/schemas/link.ts
CHANGED
|
@@ -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
|
+
}
|
package/src/schemas/sections.ts
CHANGED
|
@@ -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
|
|
25
|
+
return z
|
|
26
|
+
.object({ id: z.string(), layout: LayoutEnvelopeSchema.optional() })
|
|
27
|
+
.and(getSectionContentSchema()) as z.ZodType<Section>;
|
|
24
28
|
}
|
package/src/schemas/shared.ts
CHANGED
|
@@ -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"}
|