@cntrl-site/sdk 1.27.1 → 1.28.0-0

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.
@@ -1,124 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  export declare const ArticleSchema: z.ZodObject<{
3
3
  id: z.ZodString;
4
- sections: z.ZodArray<z.ZodObject<{
5
- id: z.ZodString;
6
- items: z.ZodArray<z.ZodType<import("../..").ItemAny, z.ZodTypeDef, import("../..").ItemAny>, "many">;
7
- name: z.ZodOptional<z.ZodString>;
8
- height: z.ZodRecord<z.ZodString, z.ZodObject<{
9
- mode: z.ZodNativeEnum<typeof import("../..").SectionHeightMode>;
10
- units: z.ZodNumber;
11
- vhUnits: z.ZodOptional<z.ZodNumber>;
12
- }, "strip", z.ZodTypeAny, {
13
- mode: import("../..").SectionHeightMode;
14
- units: number;
15
- vhUnits?: number | undefined;
16
- }, {
17
- mode: import("../..").SectionHeightMode;
18
- units: number;
19
- vhUnits?: number | undefined;
20
- }>>;
21
- position: z.ZodRecord<z.ZodString, z.ZodNumber>;
22
- hidden: z.ZodRecord<z.ZodString, z.ZodBoolean>;
23
- color: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
24
- media: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
25
- url: z.ZodString;
26
- size: z.ZodString;
27
- type: z.ZodLiteral<"video">;
28
- play: z.ZodEnum<["on-click", "auto"]>;
29
- coverUrl: z.ZodNullable<z.ZodString>;
30
- position: z.ZodString;
31
- offsetX: z.ZodNullable<z.ZodNumber>;
32
- }, "strip", z.ZodTypeAny, {
33
- url: string;
34
- coverUrl: string | null;
35
- play: "on-click" | "auto";
36
- position: string;
37
- type: "video";
38
- size: string;
39
- offsetX: number | null;
40
- }, {
41
- url: string;
42
- coverUrl: string | null;
43
- play: "on-click" | "auto";
44
- position: string;
45
- type: "video";
46
- size: string;
47
- offsetX: number | null;
48
- }>, z.ZodObject<{
49
- url: z.ZodString;
50
- type: z.ZodLiteral<"image">;
51
- size: z.ZodString;
52
- position: z.ZodString;
53
- offsetX: z.ZodNullable<z.ZodNumber>;
54
- }, "strip", z.ZodTypeAny, {
55
- url: string;
56
- position: string;
57
- type: "image";
58
- size: string;
59
- offsetX: number | null;
60
- }, {
61
- url: string;
62
- position: string;
63
- type: "image";
64
- size: string;
65
- offsetX: number | null;
66
- }>]>>>;
67
- }, "strip", z.ZodTypeAny, {
68
- color: Record<string, string | null>;
69
- hidden: Record<string, boolean>;
70
- position: Record<string, number>;
71
- id: string;
72
- height: Record<string, {
73
- mode: import("../..").SectionHeightMode;
74
- units: number;
75
- vhUnits?: number | undefined;
76
- }>;
77
- items: import("../..").ItemAny[];
78
- name?: string | undefined;
79
- media?: Record<string, {
80
- url: string;
81
- coverUrl: string | null;
82
- play: "on-click" | "auto";
83
- position: string;
84
- type: "video";
85
- size: string;
86
- offsetX: number | null;
87
- } | {
88
- url: string;
89
- position: string;
90
- type: "image";
91
- size: string;
92
- offsetX: number | null;
93
- }> | undefined;
94
- }, {
95
- color: Record<string, string | null>;
96
- hidden: Record<string, boolean>;
97
- position: Record<string, number>;
98
- id: string;
99
- height: Record<string, {
100
- mode: import("../..").SectionHeightMode;
101
- units: number;
102
- vhUnits?: number | undefined;
103
- }>;
104
- items: import("../..").ItemAny[];
105
- name?: string | undefined;
106
- media?: Record<string, {
107
- url: string;
108
- coverUrl: string | null;
109
- play: "on-click" | "auto";
110
- position: string;
111
- type: "video";
112
- size: string;
113
- offsetX: number | null;
114
- } | {
115
- url: string;
116
- position: string;
117
- type: "image";
118
- size: string;
119
- offsetX: number | null;
120
- }> | undefined;
121
- }>, "many">;
4
+ sections: z.ZodArray<z.ZodType<import("../..").Section, z.ZodTypeDef, import("../..").Section>, "many">;
122
5
  interactions: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
123
6
  id: z.ZodString;
124
7
  triggers: z.ZodArray<z.ZodUnion<[z.ZodObject<{
@@ -278,34 +161,7 @@ export declare const ArticleSchema: z.ZodObject<{
278
161
  }>, "many">>;
279
162
  }, "strip", z.ZodTypeAny, {
280
163
  id: string;
281
- sections: {
282
- color: Record<string, string | null>;
283
- hidden: Record<string, boolean>;
284
- position: Record<string, number>;
285
- id: string;
286
- height: Record<string, {
287
- mode: import("../..").SectionHeightMode;
288
- units: number;
289
- vhUnits?: number | undefined;
290
- }>;
291
- items: import("../..").ItemAny[];
292
- name?: string | undefined;
293
- media?: Record<string, {
294
- url: string;
295
- coverUrl: string | null;
296
- play: "on-click" | "auto";
297
- position: string;
298
- type: "video";
299
- size: string;
300
- offsetX: number | null;
301
- } | {
302
- url: string;
303
- position: string;
304
- type: "image";
305
- size: string;
306
- offsetX: number | null;
307
- }> | undefined;
308
- }[];
164
+ sections: import("../..").Section[];
309
165
  interactions: Record<string, {
310
166
  id: string;
311
167
  triggers: ({
@@ -341,34 +197,7 @@ export declare const ArticleSchema: z.ZodObject<{
341
197
  }[]>;
342
198
  }, {
343
199
  id: string;
344
- sections: {
345
- color: Record<string, string | null>;
346
- hidden: Record<string, boolean>;
347
- position: Record<string, number>;
348
- id: string;
349
- height: Record<string, {
350
- mode: import("../..").SectionHeightMode;
351
- units: number;
352
- vhUnits?: number | undefined;
353
- }>;
354
- items: import("../..").ItemAny[];
355
- name?: string | undefined;
356
- media?: Record<string, {
357
- url: string;
358
- coverUrl: string | null;
359
- play: "on-click" | "auto";
360
- position: string;
361
- type: "video";
362
- size: string;
363
- offsetX: number | null;
364
- } | {
365
- url: string;
366
- position: string;
367
- type: "image";
368
- size: string;
369
- offsetX: number | null;
370
- }> | undefined;
371
- }[];
200
+ sections: import("../..").Section[];
372
201
  interactions: Record<string, {
373
202
  id: string;
374
203
  triggers: ({
@@ -37,4 +37,76 @@ export declare const FXControlSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
37
37
  type: "vec2";
38
38
  shaderParam: string;
39
39
  }>]>;
40
+ export declare const VimeoEmbedLayoutParamsSchema: z.ZodObject<{
41
+ radius: z.ZodNumber;
42
+ blur: z.ZodNumber;
43
+ opacity: z.ZodNumber;
44
+ play: z.ZodUnion<[z.ZodLiteral<"on-hover">, z.ZodLiteral<"on-click">, z.ZodLiteral<"auto">]>;
45
+ controls: z.ZodBoolean;
46
+ loop: z.ZodBoolean;
47
+ muted: z.ZodBoolean;
48
+ pictureInPicture: z.ZodBoolean;
49
+ blendMode: z.ZodOptional<z.ZodString>;
50
+ }, "strip", z.ZodTypeAny, {
51
+ opacity: number;
52
+ radius: number;
53
+ play: "on-hover" | "on-click" | "auto";
54
+ blur: number;
55
+ muted: boolean;
56
+ controls: boolean;
57
+ loop: boolean;
58
+ pictureInPicture: boolean;
59
+ blendMode?: string | undefined;
60
+ }, {
61
+ opacity: number;
62
+ radius: number;
63
+ play: "on-hover" | "on-click" | "auto";
64
+ blur: number;
65
+ muted: boolean;
66
+ controls: boolean;
67
+ loop: boolean;
68
+ pictureInPicture: boolean;
69
+ blendMode?: string | undefined;
70
+ }>;
71
+ export declare const YoutubeEmbedLayoutParamsSchema: z.ZodObject<{
72
+ radius: z.ZodNumber;
73
+ blur: z.ZodNumber;
74
+ opacity: z.ZodNumber;
75
+ play: z.ZodEnum<["on-hover", "on-click", "auto"]>;
76
+ controls: z.ZodBoolean;
77
+ loop: z.ZodBoolean;
78
+ blendMode: z.ZodOptional<z.ZodString>;
79
+ }, "strip", z.ZodTypeAny, {
80
+ opacity: number;
81
+ radius: number;
82
+ play: "on-hover" | "on-click" | "auto";
83
+ blur: number;
84
+ controls: boolean;
85
+ loop: boolean;
86
+ blendMode?: string | undefined;
87
+ }, {
88
+ opacity: number;
89
+ radius: number;
90
+ play: "on-hover" | "on-click" | "auto";
91
+ blur: number;
92
+ controls: boolean;
93
+ loop: boolean;
94
+ blendMode?: string | undefined;
95
+ }>;
96
+ export declare const ComponentItemLayoutParamsSchema: z.ZodObject<{
97
+ opacity: z.ZodNumber;
98
+ blur: z.ZodNumber;
99
+ parameters: z.ZodOptional<z.ZodAny>;
100
+ blendMode: z.ZodOptional<z.ZodString>;
101
+ }, "strip", z.ZodTypeAny, {
102
+ opacity: number;
103
+ blur: number;
104
+ parameters?: any;
105
+ blendMode?: string | undefined;
106
+ }, {
107
+ opacity: number;
108
+ blur: number;
109
+ parameters?: any;
110
+ blendMode?: string | undefined;
111
+ }>;
40
112
  export declare const ItemSchema: ZodType<ItemAny>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ItemSchema = exports.FXControlSchema = void 0;
3
+ exports.ItemSchema = exports.ComponentItemLayoutParamsSchema = exports.YoutubeEmbedLayoutParamsSchema = exports.VimeoEmbedLayoutParamsSchema = exports.FXControlSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const ItemState_schema_1 = require("./ItemState.schema");
6
6
  const RichTextItem_schema_1 = require("./RichTextItem.schema");
@@ -129,6 +129,17 @@ const CustomItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
129
129
  })),
130
130
  state: zod_1.z.record(ItemState_schema_1.CustomItemStateParamsSchema)
131
131
  });
132
+ exports.VimeoEmbedLayoutParamsSchema = zod_1.z.object({
133
+ radius: zod_1.z.number(),
134
+ blur: zod_1.z.number(),
135
+ opacity: zod_1.z.number().nonnegative(),
136
+ play: zod_1.z.union([zod_1.z.literal('on-hover'), zod_1.z.literal('on-click'), zod_1.z.literal('auto')]),
137
+ controls: zod_1.z.boolean(),
138
+ loop: zod_1.z.boolean(),
139
+ muted: zod_1.z.boolean(),
140
+ pictureInPicture: zod_1.z.boolean(),
141
+ blendMode: zod_1.z.string().optional()
142
+ });
132
143
  const VimeoEmbedItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
133
144
  type: zod_1.z.literal(ArticleItemType_1.ArticleItemType.VimeoEmbed),
134
145
  commonParams: zod_1.z.object({
@@ -141,19 +152,18 @@ const VimeoEmbedItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
141
152
  from: zod_1.z.number(),
142
153
  to: zod_1.z.number().optional()
143
154
  }).nullable()),
144
- layoutParams: zod_1.z.record(zod_1.z.object({
145
- radius: zod_1.z.number(),
146
- blur: zod_1.z.number(),
147
- opacity: zod_1.z.number().nonnegative(),
148
- play: zod_1.z.union([zod_1.z.literal('on-hover'), zod_1.z.literal('on-click'), zod_1.z.literal('auto')]),
149
- controls: zod_1.z.boolean(),
150
- loop: zod_1.z.boolean(),
151
- muted: zod_1.z.boolean(),
152
- pictureInPicture: zod_1.z.boolean(),
153
- blendMode: zod_1.z.string().optional()
154
- })),
155
+ layoutParams: zod_1.z.record(exports.VimeoEmbedLayoutParamsSchema),
155
156
  state: zod_1.z.record(ItemState_schema_1.EmbedStateParamsSchema)
156
157
  });
158
+ exports.YoutubeEmbedLayoutParamsSchema = zod_1.z.object({
159
+ radius: zod_1.z.number(),
160
+ blur: zod_1.z.number(),
161
+ opacity: zod_1.z.number().nonnegative(),
162
+ play: zod_1.z.enum(['on-hover', 'on-click', 'auto']),
163
+ controls: zod_1.z.boolean(),
164
+ loop: zod_1.z.boolean(),
165
+ blendMode: zod_1.z.string().optional()
166
+ });
157
167
  const YoutubeEmbedItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
158
168
  type: zod_1.z.literal(ArticleItemType_1.ArticleItemType.YoutubeEmbed),
159
169
  commonParams: zod_1.z.object({
@@ -165,15 +175,7 @@ const YoutubeEmbedItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
165
175
  from: zod_1.z.number(),
166
176
  to: zod_1.z.number().optional()
167
177
  }).nullable()),
168
- layoutParams: zod_1.z.record(zod_1.z.object({
169
- radius: zod_1.z.number(),
170
- blur: zod_1.z.number(),
171
- opacity: zod_1.z.number().nonnegative(),
172
- play: zod_1.z.enum(['on-hover', 'on-click', 'auto']),
173
- controls: zod_1.z.boolean(),
174
- loop: zod_1.z.boolean(),
175
- blendMode: zod_1.z.string().optional()
176
- })),
178
+ layoutParams: zod_1.z.record(exports.YoutubeEmbedLayoutParamsSchema),
177
179
  state: zod_1.z.record(ItemState_schema_1.EmbedStateParamsSchema)
178
180
  });
179
181
  const CodeEmbedItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
@@ -197,6 +199,12 @@ const CodeEmbedItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
197
199
  })),
198
200
  state: zod_1.z.record(ItemState_schema_1.CodeEmbedStateParamsSchema)
199
201
  });
202
+ exports.ComponentItemLayoutParamsSchema = zod_1.z.object({
203
+ opacity: zod_1.z.number().nonnegative(),
204
+ blur: zod_1.z.number(),
205
+ parameters: zod_1.z.any().optional(),
206
+ blendMode: zod_1.z.string().optional(),
207
+ });
200
208
  const ComponentItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
201
209
  type: zod_1.z.literal(ArticleItemType_1.ArticleItemType.Component),
202
210
  commonParams: zod_1.z.object({
@@ -208,12 +216,7 @@ const ComponentItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
208
216
  from: zod_1.z.number(),
209
217
  to: zod_1.z.number().optional()
210
218
  }).nullable()),
211
- layoutParams: zod_1.z.record(zod_1.z.object({
212
- parameters: zod_1.z.any().optional(),
213
- opacity: zod_1.z.number().nonnegative(),
214
- blur: zod_1.z.number(),
215
- blendMode: zod_1.z.string().optional()
216
- })),
219
+ layoutParams: zod_1.z.record(exports.ComponentItemLayoutParamsSchema),
217
220
  state: zod_1.z.record(ItemState_schema_1.ComponentStateParamsSchema)
218
221
  });
219
222
  exports.ItemSchema = zod_1.z.lazy(() => zod_1.z.discriminatedUnion('type', [