@cntrl-site/sdk 1.24.5 → 1.24.6

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.
@@ -328,9 +328,6 @@ export declare const ControlSliderComponent: {
328
328
  content: {
329
329
  layoutBased: boolean;
330
330
  type: string;
331
- settings: {
332
- addItemFromFileExplorer: boolean;
333
- };
334
331
  items: {
335
332
  type: string;
336
333
  properties: {
@@ -338,9 +335,6 @@ export declare const ControlSliderComponent: {
338
335
  type: string;
339
336
  display: {
340
337
  type: string;
341
- minWidth: number;
342
- defaultWidth: number;
343
- maxWidth: number;
344
338
  };
345
339
  properties: {
346
340
  url: {
@@ -360,9 +354,18 @@ export declare const ControlSliderComponent: {
360
354
  display: {
361
355
  type: string;
362
356
  placeholder: string;
363
- minWidth: number;
364
- defaultWidth: number;
365
- maxWidth: number;
357
+ };
358
+ };
359
+ link: {
360
+ type: string;
361
+ display: {
362
+ type: string;
363
+ placeholder: string;
364
+ };
365
+ properties: {
366
+ text: {
367
+ type: string;
368
+ };
366
369
  };
367
370
  };
368
371
  };
@@ -162,9 +162,6 @@ export declare const ControlImageRevealSliderComponent: {
162
162
  content: {
163
163
  layoutBased: boolean;
164
164
  type: string;
165
- settings: {
166
- addItemFromFileExplorer: boolean;
167
- };
168
165
  items: {
169
166
  type: string;
170
167
  properties: {
@@ -173,9 +170,6 @@ export declare const ControlImageRevealSliderComponent: {
173
170
  display: {
174
171
  type: string;
175
172
  isObjectFitEditable: boolean;
176
- minWidth: number;
177
- defaultWidth: number;
178
- maxWidth: number;
179
173
  };
180
174
  properties: {
181
175
  url: {
@@ -196,9 +190,6 @@ export declare const ControlImageRevealSliderComponent: {
196
190
  display: {
197
191
  type: string;
198
192
  placeholder: string;
199
- minWidth: number;
200
- defaultWidth: number;
201
- maxWidth: number;
202
193
  };
203
194
  };
204
195
  };
package/dist/index.js CHANGED
@@ -601,11 +601,13 @@ const SectionSchema = zod.z.object({
601
601
  });
602
602
  const ItemTriggerSchema = zod.z.object({
603
603
  itemId: zod.z.string(),
604
- type: zod.z.enum(["hover-in", "hover-out", "click"]),
604
+ type: zod.z.literal("item"),
605
+ triggerEvent: zod.z.enum(["hover-in", "hover-out", "click"]),
605
606
  from: zod.z.string(),
606
607
  to: zod.z.string()
607
608
  });
608
609
  const ScrollTriggerSchema = zod.z.object({
610
+ type: zod.z.literal("scroll-position"),
609
611
  position: zod.z.number(),
610
612
  from: zod.z.string(),
611
613
  to: zod.z.string(),
@@ -1386,7 +1388,6 @@ const RichTextRenderer = ({ content }) => {
1386
1388
  };
1387
1389
  function getLeafCss(leaf) {
1388
1390
  return {
1389
- ...leaf.fontFamily && { fontFamily: leaf.fontFamily },
1390
1391
  ...leaf.fontWeight && { fontWeight: leaf.fontWeight },
1391
1392
  ...leaf.fontStyle && { fontStyle: leaf.fontStyle },
1392
1393
  ...leaf.textDecoration && { textDecoration: leaf.textDecoration },
@@ -2058,19 +2059,13 @@ const ControlSliderComponent = {
2058
2059
  content: {
2059
2060
  layoutBased: false,
2060
2061
  type: "array",
2061
- settings: {
2062
- addItemFromFileExplorer: true
2063
- },
2064
2062
  items: {
2065
2063
  type: "object",
2066
2064
  properties: {
2067
2065
  image: {
2068
2066
  type: "object",
2069
2067
  display: {
2070
- type: "media-input",
2071
- minWidth: 48,
2072
- defaultWidth: 108,
2073
- maxWidth: 108
2068
+ type: "media-input"
2074
2069
  },
2075
2070
  properties: {
2076
2071
  url: {
@@ -2089,10 +2084,19 @@ const ControlSliderComponent = {
2089
2084
  imageCaption: {
2090
2085
  display: {
2091
2086
  type: "rich-text",
2092
- placeholder: "Add Caption...",
2093
- minWidth: 100,
2094
- defaultWidth: 300,
2095
- maxWidth: 500
2087
+ placeholder: "Add Caption..."
2088
+ }
2089
+ },
2090
+ link: {
2091
+ type: "object",
2092
+ display: {
2093
+ type: "text-input",
2094
+ placeholder: "Add Caption..."
2095
+ },
2096
+ properties: {
2097
+ text: {
2098
+ type: "string"
2099
+ }
2096
2100
  }
2097
2101
  }
2098
2102
  },
@@ -2634,9 +2638,6 @@ const ControlImageRevealSliderComponent = {
2634
2638
  content: {
2635
2639
  layoutBased: false,
2636
2640
  type: "array",
2637
- settings: {
2638
- addItemFromFileExplorer: true
2639
- },
2640
2641
  items: {
2641
2642
  type: "object",
2642
2643
  properties: {
@@ -2644,10 +2645,7 @@ const ControlImageRevealSliderComponent = {
2644
2645
  type: "object",
2645
2646
  display: {
2646
2647
  type: "media-input",
2647
- isObjectFitEditable: false,
2648
- minWidth: 48,
2649
- defaultWidth: 108,
2650
- maxWidth: 108
2648
+ isObjectFitEditable: false
2651
2649
  },
2652
2650
  properties: {
2653
2651
  url: {
@@ -2667,10 +2665,7 @@ const ControlImageRevealSliderComponent = {
2667
2665
  type: "string",
2668
2666
  display: {
2669
2667
  type: "text-input",
2670
- placeholder: "Enter link...",
2671
- minWidth: 100,
2672
- defaultWidth: 300,
2673
- maxWidth: 500
2668
+ placeholder: "Enter link..."
2674
2669
  }
2675
2670
  }
2676
2671
  },
package/dist/index.mjs CHANGED
@@ -582,11 +582,13 @@ const SectionSchema = z.object({
582
582
  });
583
583
  const ItemTriggerSchema = z.object({
584
584
  itemId: z.string(),
585
- type: z.enum(["hover-in", "hover-out", "click"]),
585
+ type: z.literal("item"),
586
+ triggerEvent: z.enum(["hover-in", "hover-out", "click"]),
586
587
  from: z.string(),
587
588
  to: z.string()
588
589
  });
589
590
  const ScrollTriggerSchema = z.object({
591
+ type: z.literal("scroll-position"),
590
592
  position: z.number(),
591
593
  from: z.string(),
592
594
  to: z.string(),
@@ -1367,7 +1369,6 @@ const RichTextRenderer = ({ content }) => {
1367
1369
  };
1368
1370
  function getLeafCss(leaf) {
1369
1371
  return {
1370
- ...leaf.fontFamily && { fontFamily: leaf.fontFamily },
1371
1372
  ...leaf.fontWeight && { fontWeight: leaf.fontWeight },
1372
1373
  ...leaf.fontStyle && { fontStyle: leaf.fontStyle },
1373
1374
  ...leaf.textDecoration && { textDecoration: leaf.textDecoration },
@@ -2039,19 +2040,13 @@ const ControlSliderComponent = {
2039
2040
  content: {
2040
2041
  layoutBased: false,
2041
2042
  type: "array",
2042
- settings: {
2043
- addItemFromFileExplorer: true
2044
- },
2045
2043
  items: {
2046
2044
  type: "object",
2047
2045
  properties: {
2048
2046
  image: {
2049
2047
  type: "object",
2050
2048
  display: {
2051
- type: "media-input",
2052
- minWidth: 48,
2053
- defaultWidth: 108,
2054
- maxWidth: 108
2049
+ type: "media-input"
2055
2050
  },
2056
2051
  properties: {
2057
2052
  url: {
@@ -2070,10 +2065,19 @@ const ControlSliderComponent = {
2070
2065
  imageCaption: {
2071
2066
  display: {
2072
2067
  type: "rich-text",
2073
- placeholder: "Add Caption...",
2074
- minWidth: 100,
2075
- defaultWidth: 300,
2076
- maxWidth: 500
2068
+ placeholder: "Add Caption..."
2069
+ }
2070
+ },
2071
+ link: {
2072
+ type: "object",
2073
+ display: {
2074
+ type: "text-input",
2075
+ placeholder: "Add Caption..."
2076
+ },
2077
+ properties: {
2078
+ text: {
2079
+ type: "string"
2080
+ }
2077
2081
  }
2078
2082
  }
2079
2083
  },
@@ -2615,9 +2619,6 @@ const ControlImageRevealSliderComponent = {
2615
2619
  content: {
2616
2620
  layoutBased: false,
2617
2621
  type: "array",
2618
- settings: {
2619
- addItemFromFileExplorer: true
2620
- },
2621
2622
  items: {
2622
2623
  type: "object",
2623
2624
  properties: {
@@ -2625,10 +2626,7 @@ const ControlImageRevealSliderComponent = {
2625
2626
  type: "object",
2626
2627
  display: {
2627
2628
  type: "media-input",
2628
- isObjectFitEditable: false,
2629
- minWidth: 48,
2630
- defaultWidth: 108,
2631
- maxWidth: 108
2629
+ isObjectFitEditable: false
2632
2630
  },
2633
2631
  properties: {
2634
2632
  url: {
@@ -2648,10 +2646,7 @@ const ControlImageRevealSliderComponent = {
2648
2646
  type: "string",
2649
2647
  display: {
2650
2648
  type: "text-input",
2651
- placeholder: "Enter link...",
2652
- minWidth: 100,
2653
- defaultWidth: 300,
2654
- maxWidth: 500
2649
+ placeholder: "Enter link..."
2655
2650
  }
2656
2651
  }
2657
2652
  },
@@ -123,31 +123,37 @@ export declare const ArticleSchema: z.ZodObject<{
123
123
  id: z.ZodString;
124
124
  triggers: z.ZodArray<z.ZodUnion<[z.ZodObject<{
125
125
  itemId: z.ZodString;
126
- type: z.ZodEnum<["hover-in", "hover-out", "click"]>;
126
+ type: z.ZodLiteral<"item">;
127
+ triggerEvent: z.ZodEnum<["hover-in", "hover-out", "click"]>;
127
128
  from: z.ZodString;
128
129
  to: z.ZodString;
129
130
  }, "strip", z.ZodTypeAny, {
130
- type: "hover-in" | "hover-out" | "click";
131
+ type: "item";
131
132
  from: string;
132
133
  to: string;
133
134
  itemId: string;
135
+ triggerEvent: "hover-in" | "hover-out" | "click";
134
136
  }, {
135
- type: "hover-in" | "hover-out" | "click";
137
+ type: "item";
136
138
  from: string;
137
139
  to: string;
138
140
  itemId: string;
141
+ triggerEvent: "hover-in" | "hover-out" | "click";
139
142
  }>, z.ZodObject<{
143
+ type: z.ZodLiteral<"scroll-position">;
140
144
  position: z.ZodNumber;
141
145
  from: z.ZodString;
142
146
  to: z.ZodString;
143
147
  isReverse: z.ZodBoolean;
144
148
  }, "strip", z.ZodTypeAny, {
145
149
  position: number;
150
+ type: "scroll-position";
146
151
  from: string;
147
152
  to: string;
148
153
  isReverse: boolean;
149
154
  }, {
150
155
  position: number;
156
+ type: "scroll-position";
151
157
  from: string;
152
158
  to: string;
153
159
  isReverse: boolean;
@@ -181,12 +187,14 @@ export declare const ArticleSchema: z.ZodObject<{
181
187
  }, "strip", z.ZodTypeAny, {
182
188
  id: string;
183
189
  triggers: ({
184
- type: "hover-in" | "hover-out" | "click";
190
+ type: "item";
185
191
  from: string;
186
192
  to: string;
187
193
  itemId: string;
194
+ triggerEvent: "hover-in" | "hover-out" | "click";
188
195
  } | {
189
196
  position: number;
197
+ type: "scroll-position";
190
198
  from: string;
191
199
  to: string;
192
200
  isReverse: boolean;
@@ -202,12 +210,14 @@ export declare const ArticleSchema: z.ZodObject<{
202
210
  }, {
203
211
  id: string;
204
212
  triggers: ({
205
- type: "hover-in" | "hover-out" | "click";
213
+ type: "item";
206
214
  from: string;
207
215
  to: string;
208
216
  itemId: string;
217
+ triggerEvent: "hover-in" | "hover-out" | "click";
209
218
  } | {
210
219
  position: number;
220
+ type: "scroll-position";
211
221
  from: string;
212
222
  to: string;
213
223
  isReverse: boolean;
@@ -254,12 +264,14 @@ export declare const ArticleSchema: z.ZodObject<{
254
264
  interactions: Record<string, {
255
265
  id: string;
256
266
  triggers: ({
257
- type: "hover-in" | "hover-out" | "click";
267
+ type: "item";
258
268
  from: string;
259
269
  to: string;
260
270
  itemId: string;
271
+ triggerEvent: "hover-in" | "hover-out" | "click";
261
272
  } | {
262
273
  position: number;
274
+ type: "scroll-position";
263
275
  from: string;
264
276
  to: string;
265
277
  isReverse: boolean;
@@ -306,12 +318,14 @@ export declare const ArticleSchema: z.ZodObject<{
306
318
  interactions: Record<string, {
307
319
  id: string;
308
320
  triggers: ({
309
- type: "hover-in" | "hover-out" | "click";
321
+ type: "item";
310
322
  from: string;
311
323
  to: string;
312
324
  itemId: string;
325
+ triggerEvent: "hover-in" | "hover-out" | "click";
313
326
  } | {
314
327
  position: number;
328
+ type: "scroll-position";
315
329
  from: string;
316
330
  to: string;
317
331
  isReverse: boolean;
@@ -3,31 +3,37 @@ export declare const InteractionSchema: z.ZodObject<{
3
3
  id: z.ZodString;
4
4
  triggers: z.ZodArray<z.ZodUnion<[z.ZodObject<{
5
5
  itemId: z.ZodString;
6
- type: z.ZodEnum<["hover-in", "hover-out", "click"]>;
6
+ type: z.ZodLiteral<"item">;
7
+ triggerEvent: z.ZodEnum<["hover-in", "hover-out", "click"]>;
7
8
  from: z.ZodString;
8
9
  to: z.ZodString;
9
10
  }, "strip", z.ZodTypeAny, {
10
- type: "hover-in" | "hover-out" | "click";
11
+ type: "item";
11
12
  from: string;
12
13
  to: string;
13
14
  itemId: string;
15
+ triggerEvent: "hover-in" | "hover-out" | "click";
14
16
  }, {
15
- type: "hover-in" | "hover-out" | "click";
17
+ type: "item";
16
18
  from: string;
17
19
  to: string;
18
20
  itemId: string;
21
+ triggerEvent: "hover-in" | "hover-out" | "click";
19
22
  }>, z.ZodObject<{
23
+ type: z.ZodLiteral<"scroll-position">;
20
24
  position: z.ZodNumber;
21
25
  from: z.ZodString;
22
26
  to: z.ZodString;
23
27
  isReverse: z.ZodBoolean;
24
28
  }, "strip", z.ZodTypeAny, {
25
29
  position: number;
30
+ type: "scroll-position";
26
31
  from: string;
27
32
  to: string;
28
33
  isReverse: boolean;
29
34
  }, {
30
35
  position: number;
36
+ type: "scroll-position";
31
37
  from: string;
32
38
  to: string;
33
39
  isReverse: boolean;
@@ -61,12 +67,14 @@ export declare const InteractionSchema: z.ZodObject<{
61
67
  }, "strip", z.ZodTypeAny, {
62
68
  id: string;
63
69
  triggers: ({
64
- type: "hover-in" | "hover-out" | "click";
70
+ type: "item";
65
71
  from: string;
66
72
  to: string;
67
73
  itemId: string;
74
+ triggerEvent: "hover-in" | "hover-out" | "click";
68
75
  } | {
69
76
  position: number;
77
+ type: "scroll-position";
70
78
  from: string;
71
79
  to: string;
72
80
  isReverse: boolean;
@@ -82,12 +90,14 @@ export declare const InteractionSchema: z.ZodObject<{
82
90
  }, {
83
91
  id: string;
84
92
  triggers: ({
85
- type: "hover-in" | "hover-out" | "click";
93
+ type: "item";
86
94
  from: string;
87
95
  to: string;
88
96
  itemId: string;
97
+ triggerEvent: "hover-in" | "hover-out" | "click";
89
98
  } | {
90
99
  position: number;
100
+ type: "scroll-position";
91
101
  from: string;
92
102
  to: string;
93
103
  isReverse: boolean;
@@ -4,11 +4,13 @@ exports.InteractionSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const ItemTriggerSchema = zod_1.z.object({
6
6
  itemId: zod_1.z.string(),
7
- type: zod_1.z.enum(['hover-in', 'hover-out', 'click']),
7
+ type: zod_1.z.literal('item'),
8
+ triggerEvent: zod_1.z.enum(['hover-in', 'hover-out', 'click']),
8
9
  from: zod_1.z.string(),
9
10
  to: zod_1.z.string()
10
11
  });
11
12
  const ScrollTriggerSchema = zod_1.z.object({
13
+ type: zod_1.z.literal('scroll-position'),
12
14
  position: zod_1.z.number(),
13
15
  from: zod_1.z.string(),
14
16
  to: zod_1.z.string(),
@@ -1,21 +1,33 @@
1
1
  export interface Interaction {
2
2
  id: string;
3
- triggers: (InteractionItemTrigger | InteractionScrollTrigger)[];
3
+ triggers: InteractionTrigger[];
4
4
  states: InteractionState[];
5
5
  startStateId: string;
6
6
  }
7
7
  export interface InteractionItemTrigger {
8
8
  itemId: string;
9
- type: 'hover-in' | 'hover-out' | 'click';
9
+ type: 'item';
10
+ triggerEvent: 'hover-in' | 'hover-out' | 'click';
10
11
  from: StateId;
11
12
  to: StateId;
12
13
  }
13
14
  export interface InteractionScrollTrigger {
15
+ type: 'scroll-position';
14
16
  position: number;
15
17
  from: StateId;
16
18
  to: StateId;
17
19
  isReverse: boolean;
18
20
  }
21
+ export interface InteractionItemScrollTrigger {
22
+ itemId: string;
23
+ type: 'item-scroll-position';
24
+ itemPosition: 'bottom' | 'center' | 'top';
25
+ screenPosition: 'bottom' | 'center' | 'top';
26
+ offset: number;
27
+ from: StateId;
28
+ to: StateId;
29
+ isReverse: boolean;
30
+ }
19
31
  export type VideoInteractionAction = {
20
32
  type: 'play' | 'pause';
21
33
  itemId: string;
@@ -25,4 +37,5 @@ export interface InteractionState {
25
37
  actions?: VideoInteractionAction[];
26
38
  }
27
39
  type StateId = string;
40
+ export type InteractionTrigger = InteractionItemTrigger | InteractionScrollTrigger | InteractionItemScrollTrigger;
28
41
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cntrl-site/sdk",
3
- "version": "1.24.5",
3
+ "version": "1.24.6",
4
4
  "description": "Generic SDK for use in public websites.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",