@replohq/canopy-sdk 0.1.1 → 0.1.3
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/_vendor/replo-utils/lib/json.mjs +2 -0
- package/_vendor/replo-utils/lib/misc.d.ts +2 -0
- package/_vendor/replo-utils/lib/misc.mjs +2 -1
- package/_vendor/schemas/designLibrary.d.ts +333 -0
- package/_vendor/schemas/designLibrary.mjs +108 -0
- package/_vendor/schemas/errors.mjs +2 -1
- package/_vendor/schemas/generated/consent.d.ts +24 -0
- package/_vendor/schemas/savedStyles.d.ts +140 -0
- package/_vendor/schemas/selectMode.mjs +3 -10
- package/analytics/analytics-provider.js +28 -29
- package/analytics/analytics-provider.js.map +2 -2
- package/analytics/get-analytics-sinks.d.ts +25 -0
- package/analytics/get-analytics-sinks.js +46 -0
- package/analytics/get-analytics-sinks.js.map +7 -0
- package/chunk-GV5FY7ZZ.mjs +89 -0
- package/chunk-VKO7P3ED.mjs +41 -0
- package/{chunk-INHK6MYI.mjs → chunk-XK2K3263.mjs} +48 -128
- package/consent/consent-store.d.ts +52 -0
- package/consent/consent-store.js +160 -0
- package/consent/consent-store.js.map +7 -0
- package/consent/cookie.d.ts +38 -0
- package/consent/cookie.js +83 -0
- package/consent/cookie.js.map +7 -0
- package/consent/replo-scripts.d.ts +9 -0
- package/consent/replo-scripts.js +91 -0
- package/consent/replo-scripts.js.map +7 -0
- package/consent/script-registration-store.d.ts +25 -0
- package/consent/script-registration-store.js +61 -0
- package/consent/script-registration-store.js.map +7 -0
- package/consent/script-snippets.d.ts +19 -0
- package/consent/script-snippets.js +125 -0
- package/consent/script-snippets.js.map +7 -0
- package/consent/server.d.ts +12 -0
- package/consent/server.js +29 -0
- package/consent/server.js.map +7 -0
- package/consent/window-api.d.ts +41 -0
- package/consent/window-api.js +73 -0
- package/consent/window-api.js.map +7 -0
- package/editor/design-library-preview/DesignLibraryPreview.d.ts +1 -0
- package/editor/design-library-preview/DesignLibraryPreview.js +31 -0
- package/editor/design-library-preview/DesignLibraryPreview.js.map +7 -0
- package/loaders/prefetch-loaders.d.ts +1 -1
- package/loaders/prefetch-loaders.js.map +1 -1
- package/package.json +1 -1
- package/providers/replo-provider.js +2 -0
- package/providers/replo-provider.js.map +2 -2
|
@@ -10,6 +10,8 @@ export declare function isNotNullish<T>(value: T): value is Exclude<T, null | un
|
|
|
10
10
|
* Checks if a value is either `null` or `undefined`.
|
|
11
11
|
*/
|
|
12
12
|
export declare function isNullish(value: unknown): value is null | undefined;
|
|
13
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
14
|
+
export declare function stringValue(value: unknown): string | null;
|
|
13
15
|
export declare function getFromRecordOrNull<RecordKey extends PropertyKey, RecordValue>(record: Record<RecordKey, RecordValue> | null | undefined, key: RecordKey | undefined | null): NonNullable<Record<RecordKey, RecordValue>[RecordKey]> | null;
|
|
14
16
|
export declare function isPrimitive(value: unknown): value is string | number | boolean;
|
|
15
17
|
type StructureRecord<A extends {
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { coerceNumberToString, deepCloneAndMergeReplacingArrays, errorMessage, exhaustiveSwitch, formatFileSize, getFromRecordOrNull, hasOwnProperty, invariant, isEmpty, isFunction_default as isFunction, isNotNullish, isNullish,
|
|
1
|
+
export { coerceNumberToString, deepCloneAndMergeReplacingArrays, errorMessage, exhaustiveSwitch, formatFileSize, getFromRecordOrNull, hasOwnProperty, invariant, isEmpty, isFunction_default as isFunction, isNotNullish, isNullish, isPrimitive, isRecord, mergeReplacingArrays, mergeReplacingObjects, noop, preventDefault, sleep, stringValue, warning } from '../../../chunk-XK2K3263.mjs';
|
|
2
|
+
export { isNumber_default as isNumber, isString_default as isString } from '../../../chunk-GV5FY7ZZ.mjs';
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const savedColorStyleSchema: z.ZodObject<{
|
|
3
|
+
type: z.ZodLiteral<"color">;
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
attributes: z.ZodObject<{
|
|
6
|
+
type: z.ZodLiteral<"color">;
|
|
7
|
+
color: z.ZodString;
|
|
8
|
+
colorType: z.ZodEnum<{
|
|
9
|
+
basic: "basic";
|
|
10
|
+
foregroundPrimary: "foregroundPrimary";
|
|
11
|
+
foregroundSecondary: "foregroundSecondary";
|
|
12
|
+
foregroundTertiary: "foregroundTertiary";
|
|
13
|
+
backgroundPrimary: "backgroundPrimary";
|
|
14
|
+
backgroundSecondary: "backgroundSecondary";
|
|
15
|
+
backgroundTertiary: "backgroundTertiary";
|
|
16
|
+
}>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
optionalUsageGuidelines: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
19
|
+
deletedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
20
|
+
isPrimary: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export declare const savedTextStyleSchema: z.ZodObject<{
|
|
23
|
+
type: z.ZodLiteral<"text">;
|
|
24
|
+
name: z.ZodString;
|
|
25
|
+
attributes: z.ZodObject<{
|
|
26
|
+
type: z.ZodLiteral<"text">;
|
|
27
|
+
htmlTag: z.ZodEnum<{
|
|
28
|
+
h1: "h1";
|
|
29
|
+
h2: "h2";
|
|
30
|
+
h3: "h3";
|
|
31
|
+
h4: "h4";
|
|
32
|
+
h5: "h5";
|
|
33
|
+
h6: "h6";
|
|
34
|
+
p: "p";
|
|
35
|
+
}>;
|
|
36
|
+
color: z.ZodOptional<z.ZodString>;
|
|
37
|
+
fontFamily: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
38
|
+
fontSize: z.ZodOptional<z.ZodString>;
|
|
39
|
+
fontWeight: z.ZodOptional<z.ZodEnum<{
|
|
40
|
+
100: "100";
|
|
41
|
+
200: "200";
|
|
42
|
+
300: "300";
|
|
43
|
+
400: "400";
|
|
44
|
+
500: "500";
|
|
45
|
+
600: "600";
|
|
46
|
+
700: "700";
|
|
47
|
+
800: "800";
|
|
48
|
+
900: "900";
|
|
49
|
+
950: "950";
|
|
50
|
+
}>>;
|
|
51
|
+
letterSpacing: z.ZodOptional<z.ZodString>;
|
|
52
|
+
lineHeight: z.ZodOptional<z.ZodString>;
|
|
53
|
+
textAlign: z.ZodOptional<z.ZodEnum<{
|
|
54
|
+
left: "left";
|
|
55
|
+
right: "right";
|
|
56
|
+
center: "center";
|
|
57
|
+
}>>;
|
|
58
|
+
textDecoration: z.ZodOptional<z.ZodEnum<{
|
|
59
|
+
none: "none";
|
|
60
|
+
underline: "underline";
|
|
61
|
+
"line-through": "line-through";
|
|
62
|
+
italic: "italic";
|
|
63
|
+
}>>;
|
|
64
|
+
textShadow: z.ZodOptional<z.ZodString>;
|
|
65
|
+
textStroke: z.ZodOptional<z.ZodString>;
|
|
66
|
+
textTransform: z.ZodOptional<z.ZodEnum<{
|
|
67
|
+
none: "none";
|
|
68
|
+
lowercase: "lowercase";
|
|
69
|
+
uppercase: "uppercase";
|
|
70
|
+
capitalize: "capitalize";
|
|
71
|
+
}>>;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
optionalUsageGuidelines: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
74
|
+
deletedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
75
|
+
isPrimary: z.ZodOptional<z.ZodBoolean>;
|
|
76
|
+
}, z.core.$strip>;
|
|
77
|
+
export declare const designLibrarySavedStylesSchema: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
78
|
+
type: z.ZodLiteral<"color">;
|
|
79
|
+
name: z.ZodString;
|
|
80
|
+
attributes: z.ZodObject<{
|
|
81
|
+
type: z.ZodLiteral<"color">;
|
|
82
|
+
color: z.ZodString;
|
|
83
|
+
colorType: z.ZodEnum<{
|
|
84
|
+
basic: "basic";
|
|
85
|
+
foregroundPrimary: "foregroundPrimary";
|
|
86
|
+
foregroundSecondary: "foregroundSecondary";
|
|
87
|
+
foregroundTertiary: "foregroundTertiary";
|
|
88
|
+
backgroundPrimary: "backgroundPrimary";
|
|
89
|
+
backgroundSecondary: "backgroundSecondary";
|
|
90
|
+
backgroundTertiary: "backgroundTertiary";
|
|
91
|
+
}>;
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
optionalUsageGuidelines: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
94
|
+
deletedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
95
|
+
isPrimary: z.ZodOptional<z.ZodBoolean>;
|
|
96
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
97
|
+
type: z.ZodLiteral<"text">;
|
|
98
|
+
name: z.ZodString;
|
|
99
|
+
attributes: z.ZodObject<{
|
|
100
|
+
type: z.ZodLiteral<"text">;
|
|
101
|
+
htmlTag: z.ZodEnum<{
|
|
102
|
+
h1: "h1";
|
|
103
|
+
h2: "h2";
|
|
104
|
+
h3: "h3";
|
|
105
|
+
h4: "h4";
|
|
106
|
+
h5: "h5";
|
|
107
|
+
h6: "h6";
|
|
108
|
+
p: "p";
|
|
109
|
+
}>;
|
|
110
|
+
color: z.ZodOptional<z.ZodString>;
|
|
111
|
+
fontFamily: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
112
|
+
fontSize: z.ZodOptional<z.ZodString>;
|
|
113
|
+
fontWeight: z.ZodOptional<z.ZodEnum<{
|
|
114
|
+
100: "100";
|
|
115
|
+
200: "200";
|
|
116
|
+
300: "300";
|
|
117
|
+
400: "400";
|
|
118
|
+
500: "500";
|
|
119
|
+
600: "600";
|
|
120
|
+
700: "700";
|
|
121
|
+
800: "800";
|
|
122
|
+
900: "900";
|
|
123
|
+
950: "950";
|
|
124
|
+
}>>;
|
|
125
|
+
letterSpacing: z.ZodOptional<z.ZodString>;
|
|
126
|
+
lineHeight: z.ZodOptional<z.ZodString>;
|
|
127
|
+
textAlign: z.ZodOptional<z.ZodEnum<{
|
|
128
|
+
left: "left";
|
|
129
|
+
right: "right";
|
|
130
|
+
center: "center";
|
|
131
|
+
}>>;
|
|
132
|
+
textDecoration: z.ZodOptional<z.ZodEnum<{
|
|
133
|
+
none: "none";
|
|
134
|
+
underline: "underline";
|
|
135
|
+
"line-through": "line-through";
|
|
136
|
+
italic: "italic";
|
|
137
|
+
}>>;
|
|
138
|
+
textShadow: z.ZodOptional<z.ZodString>;
|
|
139
|
+
textStroke: z.ZodOptional<z.ZodString>;
|
|
140
|
+
textTransform: z.ZodOptional<z.ZodEnum<{
|
|
141
|
+
none: "none";
|
|
142
|
+
lowercase: "lowercase";
|
|
143
|
+
uppercase: "uppercase";
|
|
144
|
+
capitalize: "capitalize";
|
|
145
|
+
}>>;
|
|
146
|
+
}, z.core.$strip>;
|
|
147
|
+
optionalUsageGuidelines: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
148
|
+
deletedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
149
|
+
isPrimary: z.ZodOptional<z.ZodBoolean>;
|
|
150
|
+
}, z.core.$strip>]>>;
|
|
151
|
+
export declare const designLibrarySchema: z.ZodObject<{
|
|
152
|
+
id: z.ZodUUID;
|
|
153
|
+
createdAt: z.ZodDate;
|
|
154
|
+
updatedAt: z.ZodDate;
|
|
155
|
+
deletedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
156
|
+
savedStyles: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
157
|
+
type: z.ZodLiteral<"color">;
|
|
158
|
+
name: z.ZodString;
|
|
159
|
+
attributes: z.ZodObject<{
|
|
160
|
+
type: z.ZodLiteral<"color">;
|
|
161
|
+
color: z.ZodString;
|
|
162
|
+
colorType: z.ZodEnum<{
|
|
163
|
+
basic: "basic";
|
|
164
|
+
foregroundPrimary: "foregroundPrimary";
|
|
165
|
+
foregroundSecondary: "foregroundSecondary";
|
|
166
|
+
foregroundTertiary: "foregroundTertiary";
|
|
167
|
+
backgroundPrimary: "backgroundPrimary";
|
|
168
|
+
backgroundSecondary: "backgroundSecondary";
|
|
169
|
+
backgroundTertiary: "backgroundTertiary";
|
|
170
|
+
}>;
|
|
171
|
+
}, z.core.$strip>;
|
|
172
|
+
optionalUsageGuidelines: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
173
|
+
deletedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
174
|
+
isPrimary: z.ZodOptional<z.ZodBoolean>;
|
|
175
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
176
|
+
type: z.ZodLiteral<"text">;
|
|
177
|
+
name: z.ZodString;
|
|
178
|
+
attributes: z.ZodObject<{
|
|
179
|
+
type: z.ZodLiteral<"text">;
|
|
180
|
+
htmlTag: z.ZodEnum<{
|
|
181
|
+
h1: "h1";
|
|
182
|
+
h2: "h2";
|
|
183
|
+
h3: "h3";
|
|
184
|
+
h4: "h4";
|
|
185
|
+
h5: "h5";
|
|
186
|
+
h6: "h6";
|
|
187
|
+
p: "p";
|
|
188
|
+
}>;
|
|
189
|
+
color: z.ZodOptional<z.ZodString>;
|
|
190
|
+
fontFamily: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
191
|
+
fontSize: z.ZodOptional<z.ZodString>;
|
|
192
|
+
fontWeight: z.ZodOptional<z.ZodEnum<{
|
|
193
|
+
100: "100";
|
|
194
|
+
200: "200";
|
|
195
|
+
300: "300";
|
|
196
|
+
400: "400";
|
|
197
|
+
500: "500";
|
|
198
|
+
600: "600";
|
|
199
|
+
700: "700";
|
|
200
|
+
800: "800";
|
|
201
|
+
900: "900";
|
|
202
|
+
950: "950";
|
|
203
|
+
}>>;
|
|
204
|
+
letterSpacing: z.ZodOptional<z.ZodString>;
|
|
205
|
+
lineHeight: z.ZodOptional<z.ZodString>;
|
|
206
|
+
textAlign: z.ZodOptional<z.ZodEnum<{
|
|
207
|
+
left: "left";
|
|
208
|
+
right: "right";
|
|
209
|
+
center: "center";
|
|
210
|
+
}>>;
|
|
211
|
+
textDecoration: z.ZodOptional<z.ZodEnum<{
|
|
212
|
+
none: "none";
|
|
213
|
+
underline: "underline";
|
|
214
|
+
"line-through": "line-through";
|
|
215
|
+
italic: "italic";
|
|
216
|
+
}>>;
|
|
217
|
+
textShadow: z.ZodOptional<z.ZodString>;
|
|
218
|
+
textStroke: z.ZodOptional<z.ZodString>;
|
|
219
|
+
textTransform: z.ZodOptional<z.ZodEnum<{
|
|
220
|
+
none: "none";
|
|
221
|
+
lowercase: "lowercase";
|
|
222
|
+
uppercase: "uppercase";
|
|
223
|
+
capitalize: "capitalize";
|
|
224
|
+
}>>;
|
|
225
|
+
}, z.core.$strip>;
|
|
226
|
+
optionalUsageGuidelines: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
227
|
+
deletedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
228
|
+
isPrimary: z.ZodOptional<z.ZodBoolean>;
|
|
229
|
+
}, z.core.$strip>]>>;
|
|
230
|
+
}, z.core.$strip>;
|
|
231
|
+
export declare const designLibrarySavedStyleMetadataSchema: z.ZodObject<{
|
|
232
|
+
library: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
233
|
+
styles: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
234
|
+
type: z.ZodLiteral<"color">;
|
|
235
|
+
name: z.ZodString;
|
|
236
|
+
attributes: z.ZodObject<{
|
|
237
|
+
type: z.ZodLiteral<"color">;
|
|
238
|
+
color: z.ZodString;
|
|
239
|
+
colorType: z.ZodEnum<{
|
|
240
|
+
basic: "basic";
|
|
241
|
+
foregroundPrimary: "foregroundPrimary";
|
|
242
|
+
foregroundSecondary: "foregroundSecondary";
|
|
243
|
+
foregroundTertiary: "foregroundTertiary";
|
|
244
|
+
backgroundPrimary: "backgroundPrimary";
|
|
245
|
+
backgroundSecondary: "backgroundSecondary";
|
|
246
|
+
backgroundTertiary: "backgroundTertiary";
|
|
247
|
+
}>;
|
|
248
|
+
}, z.core.$strip>;
|
|
249
|
+
optionalUsageGuidelines: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
250
|
+
deletedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
251
|
+
isPrimary: z.ZodOptional<z.ZodBoolean>;
|
|
252
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
253
|
+
type: z.ZodLiteral<"text">;
|
|
254
|
+
name: z.ZodString;
|
|
255
|
+
attributes: z.ZodObject<{
|
|
256
|
+
type: z.ZodLiteral<"text">;
|
|
257
|
+
htmlTag: z.ZodEnum<{
|
|
258
|
+
h1: "h1";
|
|
259
|
+
h2: "h2";
|
|
260
|
+
h3: "h3";
|
|
261
|
+
h4: "h4";
|
|
262
|
+
h5: "h5";
|
|
263
|
+
h6: "h6";
|
|
264
|
+
p: "p";
|
|
265
|
+
}>;
|
|
266
|
+
color: z.ZodOptional<z.ZodString>;
|
|
267
|
+
fontFamily: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
268
|
+
fontSize: z.ZodOptional<z.ZodString>;
|
|
269
|
+
fontWeight: z.ZodOptional<z.ZodEnum<{
|
|
270
|
+
100: "100";
|
|
271
|
+
200: "200";
|
|
272
|
+
300: "300";
|
|
273
|
+
400: "400";
|
|
274
|
+
500: "500";
|
|
275
|
+
600: "600";
|
|
276
|
+
700: "700";
|
|
277
|
+
800: "800";
|
|
278
|
+
900: "900";
|
|
279
|
+
950: "950";
|
|
280
|
+
}>>;
|
|
281
|
+
letterSpacing: z.ZodOptional<z.ZodString>;
|
|
282
|
+
lineHeight: z.ZodOptional<z.ZodString>;
|
|
283
|
+
textAlign: z.ZodOptional<z.ZodEnum<{
|
|
284
|
+
left: "left";
|
|
285
|
+
right: "right";
|
|
286
|
+
center: "center";
|
|
287
|
+
}>>;
|
|
288
|
+
textDecoration: z.ZodOptional<z.ZodEnum<{
|
|
289
|
+
none: "none";
|
|
290
|
+
underline: "underline";
|
|
291
|
+
"line-through": "line-through";
|
|
292
|
+
italic: "italic";
|
|
293
|
+
}>>;
|
|
294
|
+
textShadow: z.ZodOptional<z.ZodString>;
|
|
295
|
+
textStroke: z.ZodOptional<z.ZodString>;
|
|
296
|
+
textTransform: z.ZodOptional<z.ZodEnum<{
|
|
297
|
+
none: "none";
|
|
298
|
+
lowercase: "lowercase";
|
|
299
|
+
uppercase: "uppercase";
|
|
300
|
+
capitalize: "capitalize";
|
|
301
|
+
}>>;
|
|
302
|
+
}, z.core.$strip>;
|
|
303
|
+
optionalUsageGuidelines: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
304
|
+
deletedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
305
|
+
isPrimary: z.ZodOptional<z.ZodBoolean>;
|
|
306
|
+
}, z.core.$strip>]>>;
|
|
307
|
+
}, z.core.$strip>>;
|
|
308
|
+
}, z.core.$strip>;
|
|
309
|
+
export declare const globalsCssTokenSchema: z.ZodObject<{
|
|
310
|
+
name: z.ZodString;
|
|
311
|
+
value: z.ZodString;
|
|
312
|
+
}, z.core.$strip>;
|
|
313
|
+
export declare const globalsCssScopeSchema: z.ZodObject<{
|
|
314
|
+
selector: z.ZodString;
|
|
315
|
+
tokens: z.ZodArray<z.ZodObject<{
|
|
316
|
+
name: z.ZodString;
|
|
317
|
+
value: z.ZodString;
|
|
318
|
+
}, z.core.$strip>>;
|
|
319
|
+
}, z.core.$strip>;
|
|
320
|
+
export declare const globalsCssSnapshotSchema: z.ZodObject<{
|
|
321
|
+
scopes: z.ZodArray<z.ZodObject<{
|
|
322
|
+
selector: z.ZodString;
|
|
323
|
+
tokens: z.ZodArray<z.ZodObject<{
|
|
324
|
+
name: z.ZodString;
|
|
325
|
+
value: z.ZodString;
|
|
326
|
+
}, z.core.$strip>>;
|
|
327
|
+
}, z.core.$strip>>;
|
|
328
|
+
}, z.core.$strip>;
|
|
329
|
+
export declare const DESIGN_LIBRARY_PREVIEW_MESSAGE_TYPE = "replo:design-library:applyOverrides";
|
|
330
|
+
export declare const designLibraryPreviewMessageSchema: z.ZodObject<{
|
|
331
|
+
type: z.ZodLiteral<"replo:design-library:applyOverrides">;
|
|
332
|
+
cssVars: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
333
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// ../schemas/designLibrary.ts
|
|
4
|
+
var colorTypeSchema = z.enum([
|
|
5
|
+
"basic",
|
|
6
|
+
"foregroundPrimary",
|
|
7
|
+
"foregroundSecondary",
|
|
8
|
+
"foregroundTertiary",
|
|
9
|
+
"backgroundPrimary",
|
|
10
|
+
"backgroundSecondary",
|
|
11
|
+
"backgroundTertiary"
|
|
12
|
+
]).describe("SavedStyleColorType");
|
|
13
|
+
var savedStyleColorAttributesSchema = z.object({
|
|
14
|
+
type: z.literal("color"),
|
|
15
|
+
color: z.string(),
|
|
16
|
+
colorType: colorTypeSchema
|
|
17
|
+
}).describe("SavedStyleColorAttributes");
|
|
18
|
+
var savedStyleTextHtmlTagSchema = z.enum([
|
|
19
|
+
"h1",
|
|
20
|
+
"h2",
|
|
21
|
+
"h3",
|
|
22
|
+
"h4",
|
|
23
|
+
"h5",
|
|
24
|
+
"h6",
|
|
25
|
+
"p"
|
|
26
|
+
]);
|
|
27
|
+
var savedStyleTextAttributesSchema = z.object({
|
|
28
|
+
type: z.literal("text"),
|
|
29
|
+
htmlTag: savedStyleTextHtmlTagSchema,
|
|
30
|
+
color: z.string().optional(),
|
|
31
|
+
fontFamily: z.string().nullish(),
|
|
32
|
+
fontSize: z.string().optional(),
|
|
33
|
+
fontWeight: z.enum([
|
|
34
|
+
"100",
|
|
35
|
+
"200",
|
|
36
|
+
"300",
|
|
37
|
+
"400",
|
|
38
|
+
"500",
|
|
39
|
+
"600",
|
|
40
|
+
"700",
|
|
41
|
+
"800",
|
|
42
|
+
"900",
|
|
43
|
+
"950"
|
|
44
|
+
]).optional(),
|
|
45
|
+
letterSpacing: z.string().optional(),
|
|
46
|
+
lineHeight: z.string().optional(),
|
|
47
|
+
textAlign: z.enum(["left", "center", "right"]).optional(),
|
|
48
|
+
textDecoration: z.enum(["underline", "line-through", "italic", "none"]).optional(),
|
|
49
|
+
textShadow: z.string().optional(),
|
|
50
|
+
textStroke: z.string().optional(),
|
|
51
|
+
textTransform: z.enum(["lowercase", "uppercase", "capitalize", "none"]).optional()
|
|
52
|
+
}).describe("SavedStyleTextAttributes");
|
|
53
|
+
z.discriminatedUnion("type", [
|
|
54
|
+
savedStyleColorAttributesSchema,
|
|
55
|
+
savedStyleTextAttributesSchema
|
|
56
|
+
]).describe("SavedStyleAttributes");
|
|
57
|
+
|
|
58
|
+
// ../schemas/designLibrary.ts
|
|
59
|
+
var savedColorStyleSchema = z.object({
|
|
60
|
+
type: z.literal("color"),
|
|
61
|
+
name: z.string(),
|
|
62
|
+
attributes: savedStyleColorAttributesSchema,
|
|
63
|
+
optionalUsageGuidelines: z.string().nullish(),
|
|
64
|
+
deletedAt: z.coerce.date().nullish(),
|
|
65
|
+
isPrimary: z.boolean().optional()
|
|
66
|
+
}).describe("SavedColorStyle");
|
|
67
|
+
var savedTextStyleSchema = z.object({
|
|
68
|
+
type: z.literal("text"),
|
|
69
|
+
name: z.string(),
|
|
70
|
+
attributes: savedStyleTextAttributesSchema,
|
|
71
|
+
optionalUsageGuidelines: z.string().nullish(),
|
|
72
|
+
deletedAt: z.coerce.date().nullish(),
|
|
73
|
+
isPrimary: z.boolean().optional()
|
|
74
|
+
}).describe("SavedTextStyle");
|
|
75
|
+
var designLibrarySavedStylesSchema = z.record(z.string(), z.union([savedColorStyleSchema, savedTextStyleSchema])).describe("DesignLibrarySavedStylesMapping");
|
|
76
|
+
var designLibrarySchema = z.object({
|
|
77
|
+
id: z.uuid(),
|
|
78
|
+
createdAt: z.date(),
|
|
79
|
+
updatedAt: z.date(),
|
|
80
|
+
deletedAt: z.coerce.date().nullish(),
|
|
81
|
+
savedStyles: designLibrarySavedStylesSchema
|
|
82
|
+
}).describe("DesignLibrary");
|
|
83
|
+
var designLibrarySavedStyleMetadataSchema = z.object({
|
|
84
|
+
library: z.record(
|
|
85
|
+
z.string(),
|
|
86
|
+
z.object({
|
|
87
|
+
styles: designLibrarySavedStylesSchema
|
|
88
|
+
})
|
|
89
|
+
)
|
|
90
|
+
}).describe("DesignLibrarySavedStyleMetadata");
|
|
91
|
+
var globalsCssTokenSchema = z.object({
|
|
92
|
+
name: z.string(),
|
|
93
|
+
value: z.string()
|
|
94
|
+
}).describe("GlobalsCssToken");
|
|
95
|
+
var globalsCssScopeSchema = z.object({
|
|
96
|
+
selector: z.string(),
|
|
97
|
+
tokens: z.array(globalsCssTokenSchema)
|
|
98
|
+
}).describe("GlobalsCssScope");
|
|
99
|
+
var globalsCssSnapshotSchema = z.object({
|
|
100
|
+
scopes: z.array(globalsCssScopeSchema)
|
|
101
|
+
}).describe("GlobalsCssSnapshot");
|
|
102
|
+
var DESIGN_LIBRARY_PREVIEW_MESSAGE_TYPE = "replo:design-library:applyOverrides";
|
|
103
|
+
var designLibraryPreviewMessageSchema = z.object({
|
|
104
|
+
type: z.literal(DESIGN_LIBRARY_PREVIEW_MESSAGE_TYPE),
|
|
105
|
+
cssVars: z.record(z.string(), z.string())
|
|
106
|
+
}).describe("DesignLibraryPreviewMessage");
|
|
107
|
+
|
|
108
|
+
export { DESIGN_LIBRARY_PREVIEW_MESSAGE_TYPE, designLibraryPreviewMessageSchema, designLibrarySavedStyleMetadataSchema, designLibrarySavedStylesSchema, designLibrarySchema, globalsCssScopeSchema, globalsCssSnapshotSchema, globalsCssTokenSchema, savedColorStyleSchema, savedTextStyleSchema };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MapCache_default, exhaustiveSwitch, hasOwnProperty, identity_default, baseFor_default, keys_default, Stack_default, isLength_default, isIndex_default, isArguments_default, getTag_default, isBuffer_default, isTypedArray_default, eq_default, Uint8Array_default, getAllKeys_default, baseAssignValue_default } from '../../chunk-XK2K3263.mjs';
|
|
2
|
+
import { Symbol_default, isArray_default, isObject_default, isObjectLike_default, baseGetTag_default } from '../../chunk-GV5FY7ZZ.mjs';
|
|
2
3
|
import { z, ZodError } from 'zod';
|
|
3
4
|
|
|
4
5
|
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseForOwn.js
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type ReploScriptType = "GA4" | "GoogleTagManager" | "Meta" | "TikTok" | "Pinterest" | "Reddit" | "Snapchat" | "Hotjar" | "MicrosoftClarity" | "Triplewhale" | "Segment" | "custom";
|
|
2
|
+
export type ConsentCategory = "necessary" | "analytics" | "marketing" | "preferences" | "sale_of_data";
|
|
3
|
+
export type ConsentMode = "off" | "simple" | "per-category";
|
|
4
|
+
export type ScriptTagDescriptor = {
|
|
5
|
+
kind: "external";
|
|
6
|
+
src: string;
|
|
7
|
+
attributes?: {
|
|
8
|
+
[x: string]: string;
|
|
9
|
+
};
|
|
10
|
+
} | {
|
|
11
|
+
kind: "inline";
|
|
12
|
+
body: string;
|
|
13
|
+
};
|
|
14
|
+
export type ReploScriptEntry = {
|
|
15
|
+
type: "GA4" | "GoogleTagManager" | "Meta" | "TikTok" | "Pinterest" | "Reddit" | "Snapchat" | "Hotjar" | "MicrosoftClarity" | "Triplewhale" | "Segment";
|
|
16
|
+
identifier: string;
|
|
17
|
+
requiredConsent?: ConsentCategory[];
|
|
18
|
+
} | {
|
|
19
|
+
type: "custom";
|
|
20
|
+
id: string;
|
|
21
|
+
requiredConsent: ConsentCategory[];
|
|
22
|
+
src?: string;
|
|
23
|
+
body?: string;
|
|
24
|
+
};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const colorTypeSchema: z.ZodEnum<{
|
|
3
|
+
basic: "basic";
|
|
4
|
+
foregroundPrimary: "foregroundPrimary";
|
|
5
|
+
foregroundSecondary: "foregroundSecondary";
|
|
6
|
+
foregroundTertiary: "foregroundTertiary";
|
|
7
|
+
backgroundPrimary: "backgroundPrimary";
|
|
8
|
+
backgroundSecondary: "backgroundSecondary";
|
|
9
|
+
backgroundTertiary: "backgroundTertiary";
|
|
10
|
+
}>;
|
|
11
|
+
export declare const savedStyleColorAttributesSchema: z.ZodObject<{
|
|
12
|
+
type: z.ZodLiteral<"color">;
|
|
13
|
+
color: z.ZodString;
|
|
14
|
+
colorType: z.ZodEnum<{
|
|
15
|
+
basic: "basic";
|
|
16
|
+
foregroundPrimary: "foregroundPrimary";
|
|
17
|
+
foregroundSecondary: "foregroundSecondary";
|
|
18
|
+
foregroundTertiary: "foregroundTertiary";
|
|
19
|
+
backgroundPrimary: "backgroundPrimary";
|
|
20
|
+
backgroundSecondary: "backgroundSecondary";
|
|
21
|
+
backgroundTertiary: "backgroundTertiary";
|
|
22
|
+
}>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
export declare const savedStyleTextHtmlTagSchema: z.ZodEnum<{
|
|
25
|
+
h1: "h1";
|
|
26
|
+
h2: "h2";
|
|
27
|
+
h3: "h3";
|
|
28
|
+
h4: "h4";
|
|
29
|
+
h5: "h5";
|
|
30
|
+
h6: "h6";
|
|
31
|
+
p: "p";
|
|
32
|
+
}>;
|
|
33
|
+
export declare const savedStyleTextAttributesSchema: z.ZodObject<{
|
|
34
|
+
type: z.ZodLiteral<"text">;
|
|
35
|
+
htmlTag: z.ZodEnum<{
|
|
36
|
+
h1: "h1";
|
|
37
|
+
h2: "h2";
|
|
38
|
+
h3: "h3";
|
|
39
|
+
h4: "h4";
|
|
40
|
+
h5: "h5";
|
|
41
|
+
h6: "h6";
|
|
42
|
+
p: "p";
|
|
43
|
+
}>;
|
|
44
|
+
color: z.ZodOptional<z.ZodString>;
|
|
45
|
+
fontFamily: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
46
|
+
fontSize: z.ZodOptional<z.ZodString>;
|
|
47
|
+
fontWeight: z.ZodOptional<z.ZodEnum<{
|
|
48
|
+
100: "100";
|
|
49
|
+
200: "200";
|
|
50
|
+
300: "300";
|
|
51
|
+
400: "400";
|
|
52
|
+
500: "500";
|
|
53
|
+
600: "600";
|
|
54
|
+
700: "700";
|
|
55
|
+
800: "800";
|
|
56
|
+
900: "900";
|
|
57
|
+
950: "950";
|
|
58
|
+
}>>;
|
|
59
|
+
letterSpacing: z.ZodOptional<z.ZodString>;
|
|
60
|
+
lineHeight: z.ZodOptional<z.ZodString>;
|
|
61
|
+
textAlign: z.ZodOptional<z.ZodEnum<{
|
|
62
|
+
left: "left";
|
|
63
|
+
right: "right";
|
|
64
|
+
center: "center";
|
|
65
|
+
}>>;
|
|
66
|
+
textDecoration: z.ZodOptional<z.ZodEnum<{
|
|
67
|
+
none: "none";
|
|
68
|
+
underline: "underline";
|
|
69
|
+
"line-through": "line-through";
|
|
70
|
+
italic: "italic";
|
|
71
|
+
}>>;
|
|
72
|
+
textShadow: z.ZodOptional<z.ZodString>;
|
|
73
|
+
textStroke: z.ZodOptional<z.ZodString>;
|
|
74
|
+
textTransform: z.ZodOptional<z.ZodEnum<{
|
|
75
|
+
none: "none";
|
|
76
|
+
lowercase: "lowercase";
|
|
77
|
+
uppercase: "uppercase";
|
|
78
|
+
capitalize: "capitalize";
|
|
79
|
+
}>>;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
export declare const savedStyleAttributesSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
82
|
+
type: z.ZodLiteral<"color">;
|
|
83
|
+
color: z.ZodString;
|
|
84
|
+
colorType: z.ZodEnum<{
|
|
85
|
+
basic: "basic";
|
|
86
|
+
foregroundPrimary: "foregroundPrimary";
|
|
87
|
+
foregroundSecondary: "foregroundSecondary";
|
|
88
|
+
foregroundTertiary: "foregroundTertiary";
|
|
89
|
+
backgroundPrimary: "backgroundPrimary";
|
|
90
|
+
backgroundSecondary: "backgroundSecondary";
|
|
91
|
+
backgroundTertiary: "backgroundTertiary";
|
|
92
|
+
}>;
|
|
93
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
94
|
+
type: z.ZodLiteral<"text">;
|
|
95
|
+
htmlTag: z.ZodEnum<{
|
|
96
|
+
h1: "h1";
|
|
97
|
+
h2: "h2";
|
|
98
|
+
h3: "h3";
|
|
99
|
+
h4: "h4";
|
|
100
|
+
h5: "h5";
|
|
101
|
+
h6: "h6";
|
|
102
|
+
p: "p";
|
|
103
|
+
}>;
|
|
104
|
+
color: z.ZodOptional<z.ZodString>;
|
|
105
|
+
fontFamily: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
106
|
+
fontSize: z.ZodOptional<z.ZodString>;
|
|
107
|
+
fontWeight: z.ZodOptional<z.ZodEnum<{
|
|
108
|
+
100: "100";
|
|
109
|
+
200: "200";
|
|
110
|
+
300: "300";
|
|
111
|
+
400: "400";
|
|
112
|
+
500: "500";
|
|
113
|
+
600: "600";
|
|
114
|
+
700: "700";
|
|
115
|
+
800: "800";
|
|
116
|
+
900: "900";
|
|
117
|
+
950: "950";
|
|
118
|
+
}>>;
|
|
119
|
+
letterSpacing: z.ZodOptional<z.ZodString>;
|
|
120
|
+
lineHeight: z.ZodOptional<z.ZodString>;
|
|
121
|
+
textAlign: z.ZodOptional<z.ZodEnum<{
|
|
122
|
+
left: "left";
|
|
123
|
+
right: "right";
|
|
124
|
+
center: "center";
|
|
125
|
+
}>>;
|
|
126
|
+
textDecoration: z.ZodOptional<z.ZodEnum<{
|
|
127
|
+
none: "none";
|
|
128
|
+
underline: "underline";
|
|
129
|
+
"line-through": "line-through";
|
|
130
|
+
italic: "italic";
|
|
131
|
+
}>>;
|
|
132
|
+
textShadow: z.ZodOptional<z.ZodString>;
|
|
133
|
+
textStroke: z.ZodOptional<z.ZodString>;
|
|
134
|
+
textTransform: z.ZodOptional<z.ZodEnum<{
|
|
135
|
+
none: "none";
|
|
136
|
+
lowercase: "lowercase";
|
|
137
|
+
uppercase: "uppercase";
|
|
138
|
+
capitalize: "capitalize";
|
|
139
|
+
}>>;
|
|
140
|
+
}, z.core.$strip>], "type">;
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { parseJsonOrNull } from '../../chunk-VKO7P3ED.mjs';
|
|
2
|
+
import { exhaustiveSwitch } from '../../chunk-XK2K3263.mjs';
|
|
3
|
+
import '../../chunk-GV5FY7ZZ.mjs';
|
|
2
4
|
import { z } from 'zod';
|
|
3
5
|
|
|
4
|
-
// ../replo-utils/lib/json.ts
|
|
5
|
-
function parseJsonOrNull(json) {
|
|
6
|
-
try {
|
|
7
|
-
return JSON.parse(json);
|
|
8
|
-
} catch {
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
6
|
// ../replo-utils/lib/parse.ts
|
|
14
7
|
function parseSchemaOrNull(value, schema) {
|
|
15
8
|
const parseResult = schema.safeParse(value);
|