@drawnagency/primitives 0.1.55 → 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/auth/cookies.d.ts.map +1 -1
- package/dist/auth/index.js +1 -1
- package/dist/{chunk-24SUF2BC.js → chunk-ICLXLWQ5.js} +13 -74
- package/dist/chunk-NSCT3AMV.js +32 -0
- package/dist/{chunk-KDGYHU36.js → chunk-PRKUXM7E.js} +35 -10
- package/dist/{chunk-PUNXQK4M.js → chunk-PYWS3MOJ.js} +12 -2
- package/dist/chunk-TG43X7JO.js +123 -0
- package/dist/chunk-VKAGMEKE.js +90 -0
- package/dist/{chunk-B5VYSTPB.js → chunk-XTK4BR27.js} +1 -1
- 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 +140 -0
- package/dist/components/sections/all-sections.d.ts.map +1 -0
- package/dist/components/sections/register-schemas.d.ts.map +1 -1
- package/dist/components/sections/register.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 +2 -1
- 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/hooks/useEditorPublish.d.ts +2 -1
- package/dist/hooks/useEditorPublish.d.ts.map +1 -1
- package/dist/index.js +69 -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 +12 -1
- package/dist/lib/dexie.d.ts.map +1 -1
- package/dist/lib/dexie.js +28 -3
- 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 -2
- package/dist/lib/registry.d.ts.map +1 -1
- package/dist/lib/registry.js +26 -0
- package/dist/lib/sanitize.d.ts.map +1 -1
- 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 +10 -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 +31 -0
- package/dist/schemas/shared.d.ts.map +1 -1
- package/dist/storage/index.d.ts +1 -0
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/types.d.ts +13 -1
- package/dist/storage/types.d.ts.map +1 -1
- package/package.json +13 -1
- package/src/auth/cookies.ts +6 -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 +40 -0
- package/src/components/sections/register-schemas.ts +13 -18
- package/src/components/sections/register.ts +3 -17
- package/src/components/shared/Tabs.tsx +63 -0
- package/src/components/shell/EditorShell.tsx +147 -18
- 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/hooks/useEditorPublish.ts +17 -4
- 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 +47 -0
- package/src/lib/loader.ts +16 -4
- package/src/lib/migrate-sections-transform.ts +147 -0
- package/src/lib/registry.ts +48 -2
- package/src/lib/sanitize.ts +22 -1
- 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 +16 -0
- package/src/schemas/site-config.ts +3 -3
- package/src/storage/index.ts +1 -0
- package/src/storage/types.ts +17 -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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cookies.d.ts","sourceRoot":"","sources":["../../src/auth/cookies.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGnD,eAAO,MAAM,cAAc,eAAe,CAAC;AAC3C,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAC7C,eAAO,MAAM,uBAAuB,QAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"cookies.d.ts","sourceRoot":"","sources":["../../src/auth/cookies.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGnD,eAAO,MAAM,cAAc,eAAe,CAAC;AAC3C,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAC7C,eAAO,MAAM,uBAAuB,QAAe,CAAC;AAMpD,eAAO,MAAM,wBAAwB,QAAe,CAAC;AAErD,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAWxE;AAED,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAe/E;AAMD,wBAAsB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAMzE;AAED,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAS/E;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,UAAU,EACnB,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,OAAO,GACpB,IAAI,CAQN"}
|
package/dist/auth/index.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MediaConfigSchema
|
|
3
3
|
} from "./chunk-DKOUFIP6.js";
|
|
4
|
+
import {
|
|
5
|
+
LayoutEnvelopeSchema
|
|
6
|
+
} from "./chunk-NSCT3AMV.js";
|
|
7
|
+
import {
|
|
8
|
+
getAllSchemas
|
|
9
|
+
} from "./chunk-VKAGMEKE.js";
|
|
4
10
|
|
|
5
11
|
// src/schemas/shared.ts
|
|
6
12
|
import { z } from "zod";
|
|
@@ -61,7 +67,9 @@ var MediaReferenceSchema = z.discriminatedUnion("type", [
|
|
|
61
67
|
DoDontImageRef,
|
|
62
68
|
LinkedImageRef
|
|
63
69
|
]);
|
|
70
|
+
var SingleMediaReferenceSchema = z.discriminatedUnion("type", [ImageRef, VideoRef]);
|
|
64
71
|
var HexColorSchema = z.string().regex(/^#[0-9a-fA-F]{6}$/, "must be a 6-digit hex color");
|
|
72
|
+
var FontNameSchema = z.string().max(120).regex(/^[a-zA-Z0-9 ,'"-]+$/, "contains invalid font-name characters");
|
|
65
73
|
var ColorSpaceSchema = z.object({
|
|
66
74
|
hex: HexColorSchema.optional(),
|
|
67
75
|
rgb: z.string().optional(),
|
|
@@ -76,68 +84,6 @@ var ColorItemSchema = z.object({
|
|
|
76
84
|
spaces: z.array(ColorSpaceSchema).min(1)
|
|
77
85
|
});
|
|
78
86
|
|
|
79
|
-
// src/lib/registry.ts
|
|
80
|
-
function defineSection(def) {
|
|
81
|
-
return def;
|
|
82
|
-
}
|
|
83
|
-
function createRegistry() {
|
|
84
|
-
const sections = /* @__PURE__ */ new Map();
|
|
85
|
-
const schemas = /* @__PURE__ */ new Map();
|
|
86
|
-
return {
|
|
87
|
-
registerSection(def) {
|
|
88
|
-
sections.set(def.type, def);
|
|
89
|
-
},
|
|
90
|
-
registerSchema(type, schema) {
|
|
91
|
-
schemas.set(type, schema);
|
|
92
|
-
},
|
|
93
|
-
getSection(type) {
|
|
94
|
-
return sections.get(type);
|
|
95
|
-
},
|
|
96
|
-
getSchema(type) {
|
|
97
|
-
return schemas.get(type) ?? sections.get(type)?.schema;
|
|
98
|
-
},
|
|
99
|
-
getAllSections() {
|
|
100
|
-
return Array.from(sections.values());
|
|
101
|
-
},
|
|
102
|
-
getAllSchemas() {
|
|
103
|
-
const merged = new Map(schemas);
|
|
104
|
-
for (const [type, def] of sections) {
|
|
105
|
-
if (!merged.has(type)) merged.set(type, def.schema);
|
|
106
|
-
}
|
|
107
|
-
return Array.from(merged.values());
|
|
108
|
-
},
|
|
109
|
-
clearRegistry() {
|
|
110
|
-
sections.clear();
|
|
111
|
-
schemas.clear();
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("@drawnagency/primitives/registry");
|
|
116
|
-
var g = globalThis;
|
|
117
|
-
if (!g[REGISTRY_KEY]) g[REGISTRY_KEY] = createRegistry();
|
|
118
|
-
var defaultRegistry = g[REGISTRY_KEY];
|
|
119
|
-
function registerSection(def) {
|
|
120
|
-
defaultRegistry.registerSection(def);
|
|
121
|
-
}
|
|
122
|
-
function registerSchema(type, schema) {
|
|
123
|
-
defaultRegistry.registerSchema(type, schema);
|
|
124
|
-
}
|
|
125
|
-
function getSection(type) {
|
|
126
|
-
return defaultRegistry.getSection(type);
|
|
127
|
-
}
|
|
128
|
-
function getSchema(type) {
|
|
129
|
-
return defaultRegistry.getSchema(type);
|
|
130
|
-
}
|
|
131
|
-
function getAllSections() {
|
|
132
|
-
return defaultRegistry.getAllSections();
|
|
133
|
-
}
|
|
134
|
-
function getAllSchemas() {
|
|
135
|
-
return defaultRegistry.getAllSchemas();
|
|
136
|
-
}
|
|
137
|
-
function clearRegistry() {
|
|
138
|
-
defaultRegistry.clearRegistry();
|
|
139
|
-
}
|
|
140
|
-
|
|
141
87
|
// src/schemas/sections.ts
|
|
142
88
|
import { z as z2 } from "zod";
|
|
143
89
|
function getSectionContentSchema() {
|
|
@@ -148,7 +94,7 @@ function getSectionContentSchema() {
|
|
|
148
94
|
return z2.union(schemas);
|
|
149
95
|
}
|
|
150
96
|
function getSectionSchema() {
|
|
151
|
-
return z2.object({ id: z2.string() }).and(getSectionContentSchema());
|
|
97
|
+
return z2.object({ id: z2.string(), layout: LayoutEnvelopeSchema.optional() }).and(getSectionContentSchema());
|
|
152
98
|
}
|
|
153
99
|
|
|
154
100
|
// src/schemas/site-config.ts
|
|
@@ -260,8 +206,8 @@ var SiteConfigSchema = z3.object({
|
|
|
260
206
|
primaryColor: HexColorSchema.default("#009ca6"),
|
|
261
207
|
primaryContrast: HexColorSchema.default("#f0f0f0"),
|
|
262
208
|
darkMode: z3.enum(["light", "dark", "optional"]).default("light"),
|
|
263
|
-
headingFont:
|
|
264
|
-
bodyFont:
|
|
209
|
+
headingFont: FontNameSchema.default("system-ui"),
|
|
210
|
+
bodyFont: FontNameSchema.default("system-ui"),
|
|
265
211
|
uppercaseHeadings: z3.boolean().default(true),
|
|
266
212
|
uppercaseSubheadings: z3.boolean().default(true),
|
|
267
213
|
uppercaseNavHeadings: z3.boolean().default(true),
|
|
@@ -275,18 +221,11 @@ var SiteConfigSchema = z3.object({
|
|
|
275
221
|
export {
|
|
276
222
|
TextLineSchema,
|
|
277
223
|
MediaReferenceSchema,
|
|
224
|
+
SingleMediaReferenceSchema,
|
|
278
225
|
HexColorSchema,
|
|
226
|
+
FontNameSchema,
|
|
279
227
|
ColorSpaceSchema,
|
|
280
228
|
ColorItemSchema,
|
|
281
|
-
defineSection,
|
|
282
|
-
createRegistry,
|
|
283
|
-
registerSection,
|
|
284
|
-
registerSchema,
|
|
285
|
-
getSection,
|
|
286
|
-
getSchema,
|
|
287
|
-
getAllSections,
|
|
288
|
-
getAllSchemas,
|
|
289
|
-
clearRegistry,
|
|
290
229
|
getSectionContentSchema,
|
|
291
230
|
getSectionSchema,
|
|
292
231
|
SectionMetaSchema,
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// src/schemas/block.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var LayoutEnvelopeSchema = z.object({
|
|
4
|
+
colSpan: z.number().int().min(1).optional()
|
|
5
|
+
});
|
|
6
|
+
var MAX_BLOCK_DEPTH = 2;
|
|
7
|
+
function getBlockChildren(block) {
|
|
8
|
+
if (typeof block !== "object" || block === null) return [];
|
|
9
|
+
const content = block.content;
|
|
10
|
+
if (typeof content !== "object" || content === null) return [];
|
|
11
|
+
const children = content.children;
|
|
12
|
+
return Array.isArray(children) ? children : [];
|
|
13
|
+
}
|
|
14
|
+
function blockDepth(block) {
|
|
15
|
+
const children = getBlockChildren(block);
|
|
16
|
+
if (children.length === 0) return 1;
|
|
17
|
+
return 1 + Math.max(...children.map(blockDepth));
|
|
18
|
+
}
|
|
19
|
+
function assertMaxDepth(block, max = MAX_BLOCK_DEPTH) {
|
|
20
|
+
const depth = blockDepth(block);
|
|
21
|
+
if (depth > max) {
|
|
22
|
+
throw new Error(`Block tree depth ${depth} exceeds MAX_BLOCK_DEPTH (${max})`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
LayoutEnvelopeSchema,
|
|
28
|
+
MAX_BLOCK_DEPTH,
|
|
29
|
+
getBlockChildren,
|
|
30
|
+
blockDepth,
|
|
31
|
+
assertMaxDepth
|
|
32
|
+
};
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
getSection,
|
|
5
|
-
getSectionSchema
|
|
6
|
-
} from "./chunk-24SUF2BC.js";
|
|
2
|
+
upgradeLegacySection
|
|
3
|
+
} from "./chunk-TG43X7JO.js";
|
|
7
4
|
import {
|
|
8
5
|
safeNextPath
|
|
9
6
|
} from "./chunk-S2L3BPLS.js";
|
|
7
|
+
import {
|
|
8
|
+
IndexSchema,
|
|
9
|
+
getSectionSchema
|
|
10
|
+
} from "./chunk-ICLXLWQ5.js";
|
|
11
|
+
import {
|
|
12
|
+
MAX_BLOCK_DEPTH,
|
|
13
|
+
blockDepth
|
|
14
|
+
} from "./chunk-NSCT3AMV.js";
|
|
15
|
+
import {
|
|
16
|
+
getAllSchemas,
|
|
17
|
+
getSection
|
|
18
|
+
} from "./chunk-VKAGMEKE.js";
|
|
10
19
|
|
|
11
20
|
// src/lib/cn.ts
|
|
12
21
|
import { clsx } from "clsx";
|
|
@@ -96,9 +105,20 @@ if (typeof window !== "undefined") {
|
|
|
96
105
|
return mod;
|
|
97
106
|
});
|
|
98
107
|
}
|
|
108
|
+
var sanitizeCache = /* @__PURE__ */ new Map();
|
|
109
|
+
var SANITIZE_CACHE_LIMIT = 500;
|
|
99
110
|
function sanitizeHtml(html) {
|
|
100
111
|
if (!html) return "";
|
|
101
|
-
|
|
112
|
+
if (!purifier) return html;
|
|
113
|
+
const cached = sanitizeCache.get(html);
|
|
114
|
+
if (cached !== void 0) return cached;
|
|
115
|
+
const clean = purifier(html);
|
|
116
|
+
if (sanitizeCache.size >= SANITIZE_CACHE_LIMIT) {
|
|
117
|
+
const oldest = sanitizeCache.keys().next().value;
|
|
118
|
+
if (oldest !== void 0) sanitizeCache.delete(oldest);
|
|
119
|
+
}
|
|
120
|
+
sanitizeCache.set(html, clean);
|
|
121
|
+
return clean;
|
|
102
122
|
}
|
|
103
123
|
async function ensureSanitizer() {
|
|
104
124
|
if (typeof window === "undefined") return;
|
|
@@ -234,11 +254,14 @@ function mergeSiteContent(index, sectionFiles) {
|
|
|
234
254
|
const schema = canValidate ? getSectionSchema() : null;
|
|
235
255
|
const orderedIds = index.pages.flatMap((p) => p.order);
|
|
236
256
|
for (const id of orderedIds) {
|
|
237
|
-
const
|
|
238
|
-
if (!
|
|
257
|
+
const rawFile = sectionFiles[id];
|
|
258
|
+
if (!rawFile) {
|
|
239
259
|
console.warn(`Section file missing for id: ${id}, skipping`);
|
|
240
260
|
continue;
|
|
241
261
|
}
|
|
262
|
+
const raw = upgradeLegacySection(rawFile);
|
|
263
|
+
const baseMeta = index.sections[id];
|
|
264
|
+
const meta = raw !== rawFile ? { ...baseMeta, type: "container" } : baseMeta;
|
|
242
265
|
if (canValidate && schema) {
|
|
243
266
|
const result = schema.safeParse(raw);
|
|
244
267
|
if (!result.success) {
|
|
@@ -246,10 +269,12 @@ function mergeSiteContent(index, sectionFiles) {
|
|
|
246
269
|
console.warn(`Skipping section "${id}" (type: ${type}): invalid schema`);
|
|
247
270
|
continue;
|
|
248
271
|
}
|
|
249
|
-
|
|
272
|
+
if (blockDepth(result.data) > MAX_BLOCK_DEPTH) {
|
|
273
|
+
console.warn(`Skipping section "${id}": block tree depth exceeds ${MAX_BLOCK_DEPTH}`);
|
|
274
|
+
continue;
|
|
275
|
+
}
|
|
250
276
|
sections.push({ section: result.data, meta });
|
|
251
277
|
} else {
|
|
252
|
-
const meta = index.sections[id];
|
|
253
278
|
sections.push({ section: raw, meta });
|
|
254
279
|
}
|
|
255
280
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
HexColorSchema
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ICLXLWQ5.js";
|
|
4
4
|
|
|
5
5
|
// src/schemas/audience.ts
|
|
6
6
|
import { z } from "zod";
|
|
@@ -25,8 +25,17 @@ var MediaGridOptionsSchema = z2.object({
|
|
|
25
25
|
// src/schemas/link.ts
|
|
26
26
|
import { z as z3 } from "zod";
|
|
27
27
|
var LinkTargetSchema = z3.enum(["_self", "_blank"]);
|
|
28
|
+
function isSafeHref(href) {
|
|
29
|
+
const normalized = href.replace(/[\t\r\n]/g, "").trimStart();
|
|
30
|
+
if (normalized === "") return true;
|
|
31
|
+
if (normalized.startsWith("//")) return false;
|
|
32
|
+
const scheme = /^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(normalized);
|
|
33
|
+
if (!scheme) return true;
|
|
34
|
+
const s = scheme[1].toLowerCase();
|
|
35
|
+
return s === "http" || s === "https" || s === "mailto";
|
|
36
|
+
}
|
|
28
37
|
var LinkValueSchema = z3.discriminatedUnion("kind", [
|
|
29
|
-
z3.object({ kind: z3.literal("external"), href: z3.string(), target: LinkTargetSchema }),
|
|
38
|
+
z3.object({ kind: z3.literal("external"), href: z3.string().refine(isSafeHref, "Unsafe href scheme"), target: LinkTargetSchema }),
|
|
30
39
|
z3.object({
|
|
31
40
|
kind: z3.literal("internal"),
|
|
32
41
|
pageId: z3.string(),
|
|
@@ -42,6 +51,7 @@ export {
|
|
|
42
51
|
slugifyAudienceName,
|
|
43
52
|
MediaGridOptionsSchema,
|
|
44
53
|
LinkTargetSchema,
|
|
54
|
+
isSafeHref,
|
|
45
55
|
LinkValueSchema,
|
|
46
56
|
DEFAULT_LINK
|
|
47
57
|
};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// src/lib/migrate-sections-transform.ts
|
|
2
|
+
var RETIRED = /* @__PURE__ */ new Set(["split_content", "media_grid", "do_dont_grid", "do_dont"]);
|
|
3
|
+
function upgradeLegacySection(raw) {
|
|
4
|
+
if (!raw || typeof raw !== "object") return raw;
|
|
5
|
+
const section = raw;
|
|
6
|
+
if (!RETIRED.has(section.type)) return raw;
|
|
7
|
+
if (section.type === "split_content") return upgradeSplitContent(section);
|
|
8
|
+
if (section.type === "do_dont") return upgradeDoDont(section);
|
|
9
|
+
return upgradeGrid(section);
|
|
10
|
+
}
|
|
11
|
+
function buildRef(item, forceImage) {
|
|
12
|
+
const type = forceImage ? "image" : item.type;
|
|
13
|
+
const ref = { type, imageId: item.imageId ?? "" };
|
|
14
|
+
if (item.caption !== void 0) ref.caption = item.caption;
|
|
15
|
+
if (item.background !== void 0) ref.background = item.background;
|
|
16
|
+
if (item.invertFrom !== void 0) ref.invertFrom = item.invertFrom;
|
|
17
|
+
if (item.border !== void 0) ref.border = item.border;
|
|
18
|
+
if (item.objectFit !== void 0) ref.objectFit = item.objectFit;
|
|
19
|
+
if (type === "video") {
|
|
20
|
+
if (item.poster !== void 0) ref.poster = item.poster;
|
|
21
|
+
if (item.autoplay !== void 0) ref.autoplay = item.autoplay;
|
|
22
|
+
if (item.loop !== void 0) ref.loop = item.loop;
|
|
23
|
+
if (item.muted !== void 0) ref.muted = item.muted;
|
|
24
|
+
}
|
|
25
|
+
return ref;
|
|
26
|
+
}
|
|
27
|
+
function mapRefItem(item, parentId, index) {
|
|
28
|
+
const content = {};
|
|
29
|
+
if (item.type === "linkedImage") {
|
|
30
|
+
content.ref = buildRef(item, true);
|
|
31
|
+
content.link = { kind: "external", href: item.href ?? "", target: item.target === "_blank" ? "_blank" : "_self" };
|
|
32
|
+
} else if (item.type === "doDontImage") {
|
|
33
|
+
content.ref = buildRef(item, true);
|
|
34
|
+
if (item.doDont !== void 0) content.dodont = item.doDont;
|
|
35
|
+
} else {
|
|
36
|
+
content.ref = buildRef(item, false);
|
|
37
|
+
}
|
|
38
|
+
return { id: `${parentId}__media_${index}`, type: "media", content, options: {} };
|
|
39
|
+
}
|
|
40
|
+
function upgradeGrid(section) {
|
|
41
|
+
const id = section.id;
|
|
42
|
+
const content = section.content ?? {};
|
|
43
|
+
const options = section.options ?? {};
|
|
44
|
+
const media = Array.isArray(content.media) ? content.media : [];
|
|
45
|
+
const childDefaults = {};
|
|
46
|
+
if (options.square !== void 0) childDefaults.square = options.square;
|
|
47
|
+
if (options.showCaptions !== void 0) childDefaults.showCaption = options.showCaptions;
|
|
48
|
+
if (options.border !== void 0) childDefaults.border = options.border;
|
|
49
|
+
if (options.crop) childDefaults.objectFit = "cover";
|
|
50
|
+
const out = {
|
|
51
|
+
id,
|
|
52
|
+
type: "container",
|
|
53
|
+
content: {
|
|
54
|
+
columns: content.columns,
|
|
55
|
+
flow: "row",
|
|
56
|
+
children: media.map((item, i) => mapRefItem(item, id, i))
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
if (Object.keys(childDefaults).length > 0) out.content.childDefaults = childDefaults;
|
|
60
|
+
if (section.layout !== void 0) out.layout = section.layout;
|
|
61
|
+
return out;
|
|
62
|
+
}
|
|
63
|
+
function upgradeSplitContent(section) {
|
|
64
|
+
const id = section.id;
|
|
65
|
+
const content = section.content ?? {};
|
|
66
|
+
const options = section.options ?? {};
|
|
67
|
+
const mediaChild = {
|
|
68
|
+
id: `${id}__media_0`,
|
|
69
|
+
type: "media",
|
|
70
|
+
content: { ref: { type: "image", imageId: content.imageId ?? "" } },
|
|
71
|
+
options: options.border !== void 0 ? { border: options.border } : {}
|
|
72
|
+
};
|
|
73
|
+
const proseChild = {
|
|
74
|
+
id: `${id}__prose_1`,
|
|
75
|
+
type: "prose",
|
|
76
|
+
content: { body: content.body ?? "" }
|
|
77
|
+
};
|
|
78
|
+
const children = options.imagePosition === "right" ? [proseChild, mediaChild] : [mediaChild, proseChild];
|
|
79
|
+
const out = { id, type: "container", content: { columns: 2, flow: "row", children } };
|
|
80
|
+
if (section.layout !== void 0) out.layout = section.layout;
|
|
81
|
+
return out;
|
|
82
|
+
}
|
|
83
|
+
function dodontChildOptions(options) {
|
|
84
|
+
const out = {};
|
|
85
|
+
if (options.showLabel !== void 0) out.showLabel = options.showLabel;
|
|
86
|
+
if (options.stackText !== void 0) out.stackText = options.stackText;
|
|
87
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
88
|
+
}
|
|
89
|
+
function dodontChild(items, parentId, index, tag, options) {
|
|
90
|
+
const child = {
|
|
91
|
+
id: `${parentId}__icon_list_${index}`,
|
|
92
|
+
type: "icon_list",
|
|
93
|
+
content: { items: items.map((it) => ({ label: it.label ?? "", text: it.text ?? "", dodont: tag })) }
|
|
94
|
+
};
|
|
95
|
+
if (options !== void 0) child.options = options;
|
|
96
|
+
return child;
|
|
97
|
+
}
|
|
98
|
+
function upgradeDoDont(section) {
|
|
99
|
+
const id = section.id;
|
|
100
|
+
const content = section.content ?? {};
|
|
101
|
+
const options = section.options ?? {};
|
|
102
|
+
const doItems = Array.isArray(content.doItems) ? content.doItems : [];
|
|
103
|
+
const dontItems = Array.isArray(content.dontItems) ? content.dontItems : [];
|
|
104
|
+
const childOptions = dodontChildOptions(options);
|
|
105
|
+
const out = {
|
|
106
|
+
id,
|
|
107
|
+
type: "container",
|
|
108
|
+
content: {
|
|
109
|
+
columns: 2,
|
|
110
|
+
flow: "row",
|
|
111
|
+
children: [
|
|
112
|
+
dodontChild(doItems, id, 0, "do", childOptions),
|
|
113
|
+
dodontChild(dontItems, id, 1, "dont", childOptions)
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
if (section.layout !== void 0) out.layout = section.layout;
|
|
118
|
+
return out;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export {
|
|
122
|
+
upgradeLegacySection
|
|
123
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// src/lib/registry.ts
|
|
2
|
+
function defineSection(def) {
|
|
3
|
+
return def;
|
|
4
|
+
}
|
|
5
|
+
function createRegistry() {
|
|
6
|
+
const sections = /* @__PURE__ */ new Map();
|
|
7
|
+
const schemas = /* @__PURE__ */ new Map();
|
|
8
|
+
const richText = /* @__PURE__ */ new Map();
|
|
9
|
+
return {
|
|
10
|
+
registerSection(def) {
|
|
11
|
+
sections.set(def.type, def);
|
|
12
|
+
if (def.richTextFields) richText.set(def.type, def.richTextFields);
|
|
13
|
+
},
|
|
14
|
+
registerSchema(type, schema) {
|
|
15
|
+
schemas.set(type, schema);
|
|
16
|
+
},
|
|
17
|
+
registerRichText(type, fields) {
|
|
18
|
+
richText.set(type, fields);
|
|
19
|
+
},
|
|
20
|
+
getRichTextFields(type) {
|
|
21
|
+
return richText.get(type) ?? [];
|
|
22
|
+
},
|
|
23
|
+
getSection(type) {
|
|
24
|
+
return sections.get(type);
|
|
25
|
+
},
|
|
26
|
+
getSchema(type) {
|
|
27
|
+
return schemas.get(type) ?? sections.get(type)?.schema;
|
|
28
|
+
},
|
|
29
|
+
getAllSections() {
|
|
30
|
+
return Array.from(sections.values());
|
|
31
|
+
},
|
|
32
|
+
getAllSchemas() {
|
|
33
|
+
const merged = new Map(schemas);
|
|
34
|
+
for (const [type, def] of sections) {
|
|
35
|
+
if (!merged.has(type)) merged.set(type, def.schema);
|
|
36
|
+
}
|
|
37
|
+
return Array.from(merged.values());
|
|
38
|
+
},
|
|
39
|
+
clearRegistry() {
|
|
40
|
+
sections.clear();
|
|
41
|
+
schemas.clear();
|
|
42
|
+
richText.clear();
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("@drawnagency/primitives/registry");
|
|
47
|
+
var g = globalThis;
|
|
48
|
+
if (!g[REGISTRY_KEY]) g[REGISTRY_KEY] = createRegistry();
|
|
49
|
+
var defaultRegistry = g[REGISTRY_KEY];
|
|
50
|
+
function registerSection(def) {
|
|
51
|
+
defaultRegistry.registerSection(def);
|
|
52
|
+
}
|
|
53
|
+
function registerSchema(type, schema) {
|
|
54
|
+
defaultRegistry.registerSchema(type, schema);
|
|
55
|
+
}
|
|
56
|
+
function registerRichText(type, fields) {
|
|
57
|
+
defaultRegistry.registerRichText(type, fields);
|
|
58
|
+
}
|
|
59
|
+
function getRichTextFields(type) {
|
|
60
|
+
return defaultRegistry.getRichTextFields(type);
|
|
61
|
+
}
|
|
62
|
+
function getSection(type) {
|
|
63
|
+
return defaultRegistry.getSection(type);
|
|
64
|
+
}
|
|
65
|
+
function getSchema(type) {
|
|
66
|
+
return defaultRegistry.getSchema(type);
|
|
67
|
+
}
|
|
68
|
+
function getAllSections() {
|
|
69
|
+
return defaultRegistry.getAllSections();
|
|
70
|
+
}
|
|
71
|
+
function getAllSchemas() {
|
|
72
|
+
return defaultRegistry.getAllSchemas();
|
|
73
|
+
}
|
|
74
|
+
function clearRegistry() {
|
|
75
|
+
defaultRegistry.clearRegistry();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export {
|
|
79
|
+
defineSection,
|
|
80
|
+
createRegistry,
|
|
81
|
+
registerSection,
|
|
82
|
+
registerSchema,
|
|
83
|
+
registerRichText,
|
|
84
|
+
getRichTextFields,
|
|
85
|
+
getSection,
|
|
86
|
+
getSchema,
|
|
87
|
+
getAllSections,
|
|
88
|
+
getAllSchemas,
|
|
89
|
+
clearRegistry
|
|
90
|
+
};
|
|
@@ -7,7 +7,7 @@ import * as jose from "jose";
|
|
|
7
7
|
var SESSION_COOKIE = "bp-session";
|
|
8
8
|
var AUDIENCE_COOKIE = "bp-audience";
|
|
9
9
|
var SESSION_MAX_AGE_SECONDS = 60 * 60 * 24;
|
|
10
|
-
var AUDIENCE_MAX_AGE_SECONDS = 60 * 60 * 24
|
|
10
|
+
var AUDIENCE_MAX_AGE_SECONDS = 60 * 60 * 24;
|
|
11
11
|
async function signSessionToken(session) {
|
|
12
12
|
return new jose.SignJWT({
|
|
13
13
|
userId: session.userId,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ReactNode, type Ref } from "react";
|
|
2
|
+
import type { Edge } from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge";
|
|
3
|
+
export interface ChildBlockWrapperProps {
|
|
4
|
+
label: string;
|
|
5
|
+
columns: number;
|
|
6
|
+
colSpan: number;
|
|
7
|
+
closestEdge: Edge | null;
|
|
8
|
+
isDragging: boolean;
|
|
9
|
+
hasSettings: boolean;
|
|
10
|
+
/** Forwarded to the drag handle button (pragmatic-dnd dragHandle target). */
|
|
11
|
+
dragHandleRef?: Ref<HTMLButtonElement>;
|
|
12
|
+
onDelete: () => void;
|
|
13
|
+
onDuplicate: () => void;
|
|
14
|
+
onColSpanChange: (span: number) => void;
|
|
15
|
+
onOpenSettings?: () => void;
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export declare const ChildBlockWrapper: import("react").ForwardRefExoticComponent<ChildBlockWrapperProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
19
|
+
//# sourceMappingURL=ChildBlockWrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChildBlockWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/editor/ChildBlockWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uDAAuD,CAAC;AAQlF,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,6EAA6E;IAC7E,aAAa,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACvC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,iBAAiB,mHAkF7B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface ColSpanControlProps {
|
|
2
|
+
colSpan: number;
|
|
3
|
+
columns: number;
|
|
4
|
+
onChange: (span: number) => void;
|
|
5
|
+
}
|
|
6
|
+
/** Contextual col-span picker — only meaningful inside a multi-column container. */
|
|
7
|
+
export declare function ColSpanControl({ colSpan, columns, onChange }: ColSpanControlProps): import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=ColSpanControl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColSpanControl.d.ts","sourceRoot":"","sources":["../../../src/components/editor/ColSpanControl.tsx"],"names":[],"mappings":"AAMA,UAAU,mBAAmB;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC;AAED,oFAAoF;AACpF,wBAAgB,cAAc,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,mBAAmB,kDA0CjF"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { WrapperProps } from "../../lib/registry";
|
|
2
|
-
export declare function SectionWrapper({ sectionId, sectionType, status, dirty, index, isLast, definition, options, audiences, access, onAccessChange, onStatusChange, onSectionChange, onReorder, onRequestInsert, onDelete, onMoveSection, mainStatus, contentDiffersFromMain, isLocalOnly, children, }: WrapperProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function SectionWrapper({ sectionId, sectionType, status, dirty, index, isLast, containerId, isContainerBlock, definition, options, audiences, access, onAccessChange, onStatusChange, onSectionChange, onReorder, onRequestInsert, onDelete, onMoveSection, onAddChild, mainStatus, contentDiffersFromMain, isLocalOnly, children, }: WrapperProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=SectionWrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/editor/SectionWrapper.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"SectionWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/editor/SectionWrapper.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIvD,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,WAAW,EACX,MAAM,EACN,KAAK,EACL,KAAK,EACL,MAAM,EACN,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,OAAO,EACP,SAAS,EACT,MAAM,EACN,cAAc,EACd,cAAc,EACd,eAAe,EACf,SAAS,EACT,eAAe,EACf,QAAQ,EACR,aAAa,EACb,UAAU,EACV,UAAU,EACV,sBAAsB,EACtB,WAAW,EACX,QAAQ,GACT,EAAE,YAAY,2CAgTd"}
|
|
@@ -7,7 +7,11 @@ interface SettingsFormProps {
|
|
|
7
7
|
schema: SettingsSchema;
|
|
8
8
|
values: Record<string, unknown>;
|
|
9
9
|
onChange: (result: SettingsFormResult) => void;
|
|
10
|
+
tabs?: {
|
|
11
|
+
label: string;
|
|
12
|
+
fields: string[];
|
|
13
|
+
}[];
|
|
10
14
|
}
|
|
11
|
-
export declare function SettingsForm({ schema, values, onChange }: SettingsFormProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function SettingsForm({ schema, values, onChange, tabs }: SettingsFormProps): import("react/jsx-runtime").JSX.Element;
|
|
12
16
|
export {};
|
|
13
17
|
//# sourceMappingURL=SettingsForm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsForm.d.ts","sourceRoot":"","sources":["../../../src/components/editor/SettingsForm.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAoB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"SettingsForm.d.ts","sourceRoot":"","sources":["../../../src/components/editor/SettingsForm.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAoB,MAAM,oBAAoB,CAAC;AAU3E,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,UAAU,iBAAiB;IACzB,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,QAAQ,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC/C,IAAI,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE,EAAE,CAAC;CAC9C;AAqJD,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,iBAAiB,2CA2BjF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditableGrid.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/EditableGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAQpE,UAAU,iBAAiB,CAAC,CAAC;IAC3B,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE;QAAE,UAAU,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,SAAS,CAAC;IAClF,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,EAC9B,KAAK,EACL,OAAO,EACP,QAAQ,EACR,UAAU,EACV,UAAU,EACV,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,SAAS,GACV,EAAE,iBAAiB,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"EditableGrid.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/EditableGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAQpE,UAAU,iBAAiB,CAAC,CAAC;IAC3B,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE;QAAE,UAAU,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,SAAS,CAAC;IAClF,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,EAC9B,KAAK,EACL,OAAO,EACP,QAAQ,EACR,UAAU,EACV,UAAU,EACV,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,SAAS,GACV,EAAE,iBAAiB,CAAC,CAAC,CAAC,2CAqFtB"}
|
|
@@ -3,7 +3,13 @@ interface IconPickerProps {
|
|
|
3
3
|
onSelect: (iconId: string | null) => void;
|
|
4
4
|
onClose: () => void;
|
|
5
5
|
showRemove?: boolean;
|
|
6
|
+
/** Opt-in: render the None / Do-Don't mode toggle. Default false → grid-only. */
|
|
7
|
+
allowDoDont?: boolean;
|
|
8
|
+
/** Current per-item Do/Don't tag (only meaningful when allowDoDont). */
|
|
9
|
+
dodont?: "do" | "dont";
|
|
10
|
+
/** Commit a Do/Don't choice; pass undefined to clear the tag (None). */
|
|
11
|
+
onSelectDoDont?: (v: "do" | "dont" | undefined) => void;
|
|
6
12
|
}
|
|
7
|
-
export declare function IconPicker({ selected, onSelect, onClose, showRemove }: IconPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function IconPicker({ selected, onSelect, onClose, showRemove, allowDoDont, dodont, onSelectDoDont, }: IconPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
8
14
|
export {};
|
|
9
15
|
//# sourceMappingURL=IconPicker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconPicker.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/IconPicker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IconPicker.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/IconPicker.tsx"],"names":[],"mappings":"AAKA,UAAU,eAAe;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iFAAiF;IACjF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,wEAAwE;IACxE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IACvB,wEAAwE;IACxE,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;CACzD;AAED,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,UAAiB,EACjB,WAAmB,EACnB,MAAM,EACN,cAAc,GACf,EAAE,eAAe,2CA2HjB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { Section } from "../../../schemas/sections";
|
|
3
|
+
interface ContainerContent {
|
|
4
|
+
columns: number;
|
|
5
|
+
flow: string;
|
|
6
|
+
childDefaults?: Record<string, unknown>;
|
|
7
|
+
children: Section[];
|
|
8
|
+
}
|
|
9
|
+
export interface ContainerProps {
|
|
10
|
+
content: {
|
|
11
|
+
id?: string;
|
|
12
|
+
content: ContainerContent;
|
|
13
|
+
};
|
|
14
|
+
isEditMode: boolean;
|
|
15
|
+
onChange?: (content: unknown) => void;
|
|
16
|
+
openModal?: (title: string, content: ReactNode) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare function Container({ content, isEditMode, onChange, openModal }: ContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=Container.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/Container/Container.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAgB3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAqGzD,UAAU,gBAAgB;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,gBAAgB,CAAA;KAAE,CAAC;IACpD,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,KAAK,IAAI,CAAC;CACzD;AAkDD,wBAAgB,SAAS,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,cAAc,2CA8KrF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface ChildLike {
|
|
2
|
+
type: string;
|
|
3
|
+
options?: Record<string, unknown>;
|
|
4
|
+
}
|
|
5
|
+
interface ContainerSettingsFormProps {
|
|
6
|
+
columns?: number;
|
|
7
|
+
flow?: string;
|
|
8
|
+
childDefaults?: Record<string, unknown>;
|
|
9
|
+
children?: ChildLike[];
|
|
10
|
+
onChange: (result: {
|
|
11
|
+
content: Record<string, unknown>;
|
|
12
|
+
options: Record<string, unknown>;
|
|
13
|
+
}) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function ContainerSettingsForm({ columns, flow, childDefaults, children, onChange, }: ContainerSettingsFormProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=ContainerSettingsForm.d.ts.map
|