@cntrl-site/sdk 1.24.6 → 1.24.7-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.
package/dist/index.js CHANGED
@@ -613,6 +613,16 @@ const ScrollTriggerSchema = zod.z.object({
613
613
  to: zod.z.string(),
614
614
  isReverse: zod.z.boolean()
615
615
  });
616
+ const ItemScrollTriggerSchema = zod.z.object({
617
+ itemId: zod.z.string(),
618
+ type: zod.z.literal("item-scroll-position"),
619
+ itemPosition: zod.z.enum(["bottom", "center", "top"]),
620
+ screenPosition: zod.z.enum(["bottom", "center", "top"]),
621
+ offset: zod.z.number(),
622
+ from: zod.z.string(),
623
+ to: zod.z.string(),
624
+ isReverse: zod.z.boolean()
625
+ });
616
626
  const VideoInteractionActionSchema = zod.z.object({
617
627
  type: zod.z.enum(["play", "pause"]),
618
628
  itemId: zod.z.string()
@@ -623,7 +633,7 @@ const StateSchema = zod.z.object({
623
633
  });
624
634
  const InteractionSchema = zod.z.object({
625
635
  id: zod.z.string(),
626
- triggers: zod.z.array(zod.z.union([ItemTriggerSchema, ScrollTriggerSchema])),
636
+ triggers: zod.z.array(zod.z.union([ItemTriggerSchema, ScrollTriggerSchema, ItemScrollTriggerSchema])),
627
637
  states: zod.z.array(StateSchema),
628
638
  startStateId: zod.z.string()
629
639
  });
package/dist/index.mjs CHANGED
@@ -594,6 +594,16 @@ const ScrollTriggerSchema = z.object({
594
594
  to: z.string(),
595
595
  isReverse: z.boolean()
596
596
  });
597
+ const ItemScrollTriggerSchema = z.object({
598
+ itemId: z.string(),
599
+ type: z.literal("item-scroll-position"),
600
+ itemPosition: z.enum(["bottom", "center", "top"]),
601
+ screenPosition: z.enum(["bottom", "center", "top"]),
602
+ offset: z.number(),
603
+ from: z.string(),
604
+ to: z.string(),
605
+ isReverse: z.boolean()
606
+ });
597
607
  const VideoInteractionActionSchema = z.object({
598
608
  type: z.enum(["play", "pause"]),
599
609
  itemId: z.string()
@@ -604,7 +614,7 @@ const StateSchema = z.object({
604
614
  });
605
615
  const InteractionSchema = z.object({
606
616
  id: z.string(),
607
- triggers: z.array(z.union([ItemTriggerSchema, ScrollTriggerSchema])),
617
+ triggers: z.array(z.union([ItemTriggerSchema, ScrollTriggerSchema, ItemScrollTriggerSchema])),
608
618
  states: z.array(StateSchema),
609
619
  startStateId: z.string()
610
620
  });
@@ -157,6 +157,33 @@ export declare const ArticleSchema: z.ZodObject<{
157
157
  from: string;
158
158
  to: string;
159
159
  isReverse: boolean;
160
+ }>, z.ZodObject<{
161
+ itemId: z.ZodString;
162
+ type: z.ZodLiteral<"item-scroll-position">;
163
+ itemPosition: z.ZodEnum<["bottom", "center", "top"]>;
164
+ screenPosition: z.ZodEnum<["bottom", "center", "top"]>;
165
+ offset: z.ZodNumber;
166
+ from: z.ZodString;
167
+ to: z.ZodString;
168
+ isReverse: z.ZodBoolean;
169
+ }, "strip", z.ZodTypeAny, {
170
+ type: "item-scroll-position";
171
+ from: string;
172
+ to: string;
173
+ itemId: string;
174
+ isReverse: boolean;
175
+ itemPosition: "center" | "top" | "bottom";
176
+ screenPosition: "center" | "top" | "bottom";
177
+ offset: number;
178
+ }, {
179
+ type: "item-scroll-position";
180
+ from: string;
181
+ to: string;
182
+ itemId: string;
183
+ isReverse: boolean;
184
+ itemPosition: "center" | "top" | "bottom";
185
+ screenPosition: "center" | "top" | "bottom";
186
+ offset: number;
160
187
  }>]>, "many">;
161
188
  states: z.ZodArray<z.ZodObject<{
162
189
  id: z.ZodString;
@@ -198,6 +225,15 @@ export declare const ArticleSchema: z.ZodObject<{
198
225
  from: string;
199
226
  to: string;
200
227
  isReverse: boolean;
228
+ } | {
229
+ type: "item-scroll-position";
230
+ from: string;
231
+ to: string;
232
+ itemId: string;
233
+ isReverse: boolean;
234
+ itemPosition: "center" | "top" | "bottom";
235
+ screenPosition: "center" | "top" | "bottom";
236
+ offset: number;
201
237
  })[];
202
238
  states: {
203
239
  id: string;
@@ -221,6 +257,15 @@ export declare const ArticleSchema: z.ZodObject<{
221
257
  from: string;
222
258
  to: string;
223
259
  isReverse: boolean;
260
+ } | {
261
+ type: "item-scroll-position";
262
+ from: string;
263
+ to: string;
264
+ itemId: string;
265
+ isReverse: boolean;
266
+ itemPosition: "center" | "top" | "bottom";
267
+ screenPosition: "center" | "top" | "bottom";
268
+ offset: number;
224
269
  })[];
225
270
  states: {
226
271
  id: string;
@@ -275,6 +320,15 @@ export declare const ArticleSchema: z.ZodObject<{
275
320
  from: string;
276
321
  to: string;
277
322
  isReverse: boolean;
323
+ } | {
324
+ type: "item-scroll-position";
325
+ from: string;
326
+ to: string;
327
+ itemId: string;
328
+ isReverse: boolean;
329
+ itemPosition: "center" | "top" | "bottom";
330
+ screenPosition: "center" | "top" | "bottom";
331
+ offset: number;
278
332
  })[];
279
333
  states: {
280
334
  id: string;
@@ -329,6 +383,15 @@ export declare const ArticleSchema: z.ZodObject<{
329
383
  from: string;
330
384
  to: string;
331
385
  isReverse: boolean;
386
+ } | {
387
+ type: "item-scroll-position";
388
+ from: string;
389
+ to: string;
390
+ itemId: string;
391
+ isReverse: boolean;
392
+ itemPosition: "center" | "top" | "bottom";
393
+ screenPosition: "center" | "top" | "bottom";
394
+ offset: number;
332
395
  })[];
333
396
  states: {
334
397
  id: string;
@@ -37,6 +37,33 @@ export declare const InteractionSchema: z.ZodObject<{
37
37
  from: string;
38
38
  to: string;
39
39
  isReverse: boolean;
40
+ }>, z.ZodObject<{
41
+ itemId: z.ZodString;
42
+ type: z.ZodLiteral<"item-scroll-position">;
43
+ itemPosition: z.ZodEnum<["bottom", "center", "top"]>;
44
+ screenPosition: z.ZodEnum<["bottom", "center", "top"]>;
45
+ offset: z.ZodNumber;
46
+ from: z.ZodString;
47
+ to: z.ZodString;
48
+ isReverse: z.ZodBoolean;
49
+ }, "strip", z.ZodTypeAny, {
50
+ type: "item-scroll-position";
51
+ from: string;
52
+ to: string;
53
+ itemId: string;
54
+ isReverse: boolean;
55
+ itemPosition: "center" | "top" | "bottom";
56
+ screenPosition: "center" | "top" | "bottom";
57
+ offset: number;
58
+ }, {
59
+ type: "item-scroll-position";
60
+ from: string;
61
+ to: string;
62
+ itemId: string;
63
+ isReverse: boolean;
64
+ itemPosition: "center" | "top" | "bottom";
65
+ screenPosition: "center" | "top" | "bottom";
66
+ offset: number;
40
67
  }>]>, "many">;
41
68
  states: z.ZodArray<z.ZodObject<{
42
69
  id: z.ZodString;
@@ -78,6 +105,15 @@ export declare const InteractionSchema: z.ZodObject<{
78
105
  from: string;
79
106
  to: string;
80
107
  isReverse: boolean;
108
+ } | {
109
+ type: "item-scroll-position";
110
+ from: string;
111
+ to: string;
112
+ itemId: string;
113
+ isReverse: boolean;
114
+ itemPosition: "center" | "top" | "bottom";
115
+ screenPosition: "center" | "top" | "bottom";
116
+ offset: number;
81
117
  })[];
82
118
  states: {
83
119
  id: string;
@@ -101,6 +137,15 @@ export declare const InteractionSchema: z.ZodObject<{
101
137
  from: string;
102
138
  to: string;
103
139
  isReverse: boolean;
140
+ } | {
141
+ type: "item-scroll-position";
142
+ from: string;
143
+ to: string;
144
+ itemId: string;
145
+ isReverse: boolean;
146
+ itemPosition: "center" | "top" | "bottom";
147
+ screenPosition: "center" | "top" | "bottom";
148
+ offset: number;
104
149
  })[];
105
150
  states: {
106
151
  id: string;
@@ -16,6 +16,16 @@ const ScrollTriggerSchema = zod_1.z.object({
16
16
  to: zod_1.z.string(),
17
17
  isReverse: zod_1.z.boolean()
18
18
  });
19
+ const ItemScrollTriggerSchema = zod_1.z.object({
20
+ itemId: zod_1.z.string(),
21
+ type: zod_1.z.literal('item-scroll-position'),
22
+ itemPosition: zod_1.z.enum(['bottom', 'center', 'top']),
23
+ screenPosition: zod_1.z.enum(['bottom', 'center', 'top']),
24
+ offset: zod_1.z.number(),
25
+ from: zod_1.z.string(),
26
+ to: zod_1.z.string(),
27
+ isReverse: zod_1.z.boolean()
28
+ });
19
29
  const VideoInteractionActionSchema = zod_1.z.object({
20
30
  type: zod_1.z.enum(['play', 'pause']),
21
31
  itemId: zod_1.z.string()
@@ -26,7 +36,7 @@ const StateSchema = zod_1.z.object({
26
36
  });
27
37
  exports.InteractionSchema = zod_1.z.object({
28
38
  id: zod_1.z.string(),
29
- triggers: zod_1.z.array(zod_1.z.union([ItemTriggerSchema, ScrollTriggerSchema])),
39
+ triggers: zod_1.z.array(zod_1.z.union([ItemTriggerSchema, ScrollTriggerSchema, ItemScrollTriggerSchema])),
30
40
  states: zod_1.z.array(StateSchema),
31
41
  startStateId: zod_1.z.string(),
32
42
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cntrl-site/sdk",
3
- "version": "1.24.6",
3
+ "version": "1.24.7-0",
4
4
  "description": "Generic SDK for use in public websites.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",