@cntrl-site/sdk 1.22.9-alpha.0 → 1.22.9

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.d.ts CHANGED
@@ -13,7 +13,7 @@ export type { Item, ImageItem, ItemAny, CustomItem, ItemCommonParamsMap, ItemLay
13
13
  export type { RichTextBlock, RichTextEntity, RichTextStyle } from './types/article/RichText';
14
14
  export type { ItemArea } from './types/article/ItemArea';
15
15
  export type { ItemState, ItemStateParams, StateParams, ItemStatesMap } from './types/article/ItemState';
16
- export type { Interaction, InteractionItemTrigger, InteractionScrollTrigger, InteractionState } from './types/article/Interaction';
16
+ export type { Interaction, InteractionTrigger, InteractionState } from './types/article/Interaction';
17
17
  export type { Layout } from './types/project/Layout';
18
18
  export type { Project } from './types/project/Project';
19
19
  export type { Meta } from './types/project/Meta';
package/dist/index.js CHANGED
@@ -542,12 +542,6 @@ const TriggerSchema = zod.z.object({
542
542
  from: zod.z.string(),
543
543
  to: zod.z.string()
544
544
  });
545
- const ScrollTriggerSchema = zod.z.object({
546
- position: zod.z.number(),
547
- from: zod.z.string(),
548
- to: zod.z.string(),
549
- isReverse: zod.z.boolean()
550
- });
551
545
  const VideoInteractionActionSchema = zod.z.object({
552
546
  type: zod.z.enum(["play", "pause"]),
553
547
  itemId: zod.z.string()
@@ -558,7 +552,7 @@ const StateSchema = zod.z.object({
558
552
  });
559
553
  const InteractionSchema = zod.z.object({
560
554
  id: zod.z.string(),
561
- triggers: zod.z.array(zod.z.union([TriggerSchema, ScrollTriggerSchema])),
555
+ triggers: zod.z.array(TriggerSchema),
562
556
  states: zod.z.array(StateSchema),
563
557
  startStateId: zod.z.string()
564
558
  });
@@ -1642,7 +1636,7 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
1642
1636
  ] });
1643
1637
  }
1644
1638
  function ArrowIcon({ color, className }) {
1645
- return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 10 18", className, children: /* @__PURE__ */ jsxRuntime.jsx("g", { id: "Symbols", stroke: "none", strokeWidth: "1", fill: color, fillRule: "evenodd", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z", id: "Shape-Copy", fill: "#000000", transform: "translate(5, 9) rotate(-90) translate(-5, -9)" }) }) });
1639
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 10 18", className, children: /* @__PURE__ */ jsxRuntime.jsx("g", { id: "Symbols", stroke: "none", strokeWidth: "1", fillRule: "evenodd", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z", id: "Shape-Copy", fill: color, transform: "translate(5, 9) rotate(-90) translate(-5, -9)" }) }) });
1646
1640
  }
1647
1641
  const ControlSliderComponent = {
1648
1642
  element: ControlSlider,
package/dist/index.mjs CHANGED
@@ -523,12 +523,6 @@ const TriggerSchema = z.object({
523
523
  from: z.string(),
524
524
  to: z.string()
525
525
  });
526
- const ScrollTriggerSchema = z.object({
527
- position: z.number(),
528
- from: z.string(),
529
- to: z.string(),
530
- isReverse: z.boolean()
531
- });
532
526
  const VideoInteractionActionSchema = z.object({
533
527
  type: z.enum(["play", "pause"]),
534
528
  itemId: z.string()
@@ -539,7 +533,7 @@ const StateSchema = z.object({
539
533
  });
540
534
  const InteractionSchema = z.object({
541
535
  id: z.string(),
542
- triggers: z.array(z.union([TriggerSchema, ScrollTriggerSchema])),
536
+ triggers: z.array(TriggerSchema),
543
537
  states: z.array(StateSchema),
544
538
  startStateId: z.string()
545
539
  });
@@ -1623,7 +1617,7 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
1623
1617
  ] });
1624
1618
  }
1625
1619
  function ArrowIcon({ color, className }) {
1626
- return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 10 18", className, children: /* @__PURE__ */ jsx("g", { id: "Symbols", stroke: "none", strokeWidth: "1", fill: color, fillRule: "evenodd", children: /* @__PURE__ */ jsx("path", { d: "M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z", id: "Shape-Copy", fill: "#000000", transform: "translate(5, 9) rotate(-90) translate(-5, -9)" }) }) });
1620
+ return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 10 18", className, children: /* @__PURE__ */ jsx("g", { id: "Symbols", stroke: "none", strokeWidth: "1", fillRule: "evenodd", children: /* @__PURE__ */ jsx("path", { d: "M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z", id: "Shape-Copy", fill: color, transform: "translate(5, 9) rotate(-90) translate(-5, -9)" }) }) });
1627
1621
  }
1628
1622
  const ControlSliderComponent = {
1629
1623
  element: ControlSlider,
@@ -76,7 +76,7 @@ export declare const ArticleSchema: z.ZodObject<{
76
76
  }>, "many">;
77
77
  interactions: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
78
78
  id: z.ZodString;
79
- triggers: z.ZodArray<z.ZodUnion<[z.ZodObject<{
79
+ triggers: z.ZodArray<z.ZodObject<{
80
80
  itemId: z.ZodString;
81
81
  type: z.ZodEnum<["hover-in", "hover-out", "click"]>;
82
82
  from: z.ZodString;
@@ -91,22 +91,7 @@ export declare const ArticleSchema: z.ZodObject<{
91
91
  from: string;
92
92
  to: string;
93
93
  itemId: string;
94
- }>, z.ZodObject<{
95
- position: z.ZodNumber;
96
- from: z.ZodString;
97
- to: z.ZodString;
98
- isReverse: z.ZodBoolean;
99
- }, "strip", z.ZodTypeAny, {
100
- position: number;
101
- from: string;
102
- to: string;
103
- isReverse: boolean;
104
- }, {
105
- position: number;
106
- from: string;
107
- to: string;
108
- isReverse: boolean;
109
- }>]>, "many">;
94
+ }>, "many">;
110
95
  states: z.ZodArray<z.ZodObject<{
111
96
  id: z.ZodString;
112
97
  actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -135,17 +120,12 @@ export declare const ArticleSchema: z.ZodObject<{
135
120
  startStateId: z.ZodString;
136
121
  }, "strip", z.ZodTypeAny, {
137
122
  id: string;
138
- triggers: ({
123
+ triggers: {
139
124
  type: "hover-in" | "hover-out" | "click";
140
125
  from: string;
141
126
  to: string;
142
127
  itemId: string;
143
- } | {
144
- position: number;
145
- from: string;
146
- to: string;
147
- isReverse: boolean;
148
- })[];
128
+ }[];
149
129
  states: {
150
130
  id: string;
151
131
  actions?: {
@@ -156,17 +136,12 @@ export declare const ArticleSchema: z.ZodObject<{
156
136
  startStateId: string;
157
137
  }, {
158
138
  id: string;
159
- triggers: ({
139
+ triggers: {
160
140
  type: "hover-in" | "hover-out" | "click";
161
141
  from: string;
162
142
  to: string;
163
143
  itemId: string;
164
- } | {
165
- position: number;
166
- from: string;
167
- to: string;
168
- isReverse: boolean;
169
- })[];
144
+ }[];
170
145
  states: {
171
146
  id: string;
172
147
  actions?: {
@@ -199,17 +174,12 @@ export declare const ArticleSchema: z.ZodObject<{
199
174
  }[];
200
175
  interactions: Record<string, {
201
176
  id: string;
202
- triggers: ({
177
+ triggers: {
203
178
  type: "hover-in" | "hover-out" | "click";
204
179
  from: string;
205
180
  to: string;
206
181
  itemId: string;
207
- } | {
208
- position: number;
209
- from: string;
210
- to: string;
211
- isReverse: boolean;
212
- })[];
182
+ }[];
213
183
  states: {
214
184
  id: string;
215
185
  actions?: {
@@ -242,17 +212,12 @@ export declare const ArticleSchema: z.ZodObject<{
242
212
  }[];
243
213
  interactions: Record<string, {
244
214
  id: string;
245
- triggers: ({
215
+ triggers: {
246
216
  type: "hover-in" | "hover-out" | "click";
247
217
  from: string;
248
218
  to: string;
249
219
  itemId: string;
250
- } | {
251
- position: number;
252
- from: string;
253
- to: string;
254
- isReverse: boolean;
255
- })[];
220
+ }[];
256
221
  states: {
257
222
  id: string;
258
223
  actions?: {
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  export declare const InteractionSchema: z.ZodObject<{
3
3
  id: z.ZodString;
4
- triggers: z.ZodArray<z.ZodUnion<[z.ZodObject<{
4
+ triggers: z.ZodArray<z.ZodObject<{
5
5
  itemId: z.ZodString;
6
6
  type: z.ZodEnum<["hover-in", "hover-out", "click"]>;
7
7
  from: z.ZodString;
@@ -16,22 +16,7 @@ export declare const InteractionSchema: z.ZodObject<{
16
16
  from: string;
17
17
  to: string;
18
18
  itemId: string;
19
- }>, z.ZodObject<{
20
- position: z.ZodNumber;
21
- from: z.ZodString;
22
- to: z.ZodString;
23
- isReverse: z.ZodBoolean;
24
- }, "strip", z.ZodTypeAny, {
25
- position: number;
26
- from: string;
27
- to: string;
28
- isReverse: boolean;
29
- }, {
30
- position: number;
31
- from: string;
32
- to: string;
33
- isReverse: boolean;
34
- }>]>, "many">;
19
+ }>, "many">;
35
20
  states: z.ZodArray<z.ZodObject<{
36
21
  id: z.ZodString;
37
22
  actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -60,17 +45,12 @@ export declare const InteractionSchema: z.ZodObject<{
60
45
  startStateId: z.ZodString;
61
46
  }, "strip", z.ZodTypeAny, {
62
47
  id: string;
63
- triggers: ({
48
+ triggers: {
64
49
  type: "hover-in" | "hover-out" | "click";
65
50
  from: string;
66
51
  to: string;
67
52
  itemId: string;
68
- } | {
69
- position: number;
70
- from: string;
71
- to: string;
72
- isReverse: boolean;
73
- })[];
53
+ }[];
74
54
  states: {
75
55
  id: string;
76
56
  actions?: {
@@ -81,17 +61,12 @@ export declare const InteractionSchema: z.ZodObject<{
81
61
  startStateId: string;
82
62
  }, {
83
63
  id: string;
84
- triggers: ({
64
+ triggers: {
85
65
  type: "hover-in" | "hover-out" | "click";
86
66
  from: string;
87
67
  to: string;
88
68
  itemId: string;
89
- } | {
90
- position: number;
91
- from: string;
92
- to: string;
93
- isReverse: boolean;
94
- })[];
69
+ }[];
95
70
  states: {
96
71
  id: string;
97
72
  actions?: {
@@ -8,12 +8,6 @@ const TriggerSchema = zod_1.z.object({
8
8
  from: zod_1.z.string(),
9
9
  to: zod_1.z.string()
10
10
  });
11
- const ScrollTriggerSchema = zod_1.z.object({
12
- position: zod_1.z.number(),
13
- from: zod_1.z.string(),
14
- to: zod_1.z.string(),
15
- isReverse: zod_1.z.boolean()
16
- });
17
11
  const VideoInteractionActionSchema = zod_1.z.object({
18
12
  type: zod_1.z.enum(['play', 'pause']),
19
13
  itemId: zod_1.z.string()
@@ -24,7 +18,7 @@ const StateSchema = zod_1.z.object({
24
18
  });
25
19
  exports.InteractionSchema = zod_1.z.object({
26
20
  id: zod_1.z.string(),
27
- triggers: zod_1.z.array(zod_1.z.union([TriggerSchema, ScrollTriggerSchema])),
21
+ triggers: zod_1.z.array(TriggerSchema),
28
22
  states: zod_1.z.array(StateSchema),
29
23
  startStateId: zod_1.z.string(),
30
24
  });
@@ -1,21 +1,15 @@
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
- export interface InteractionItemTrigger {
7
+ export interface InteractionTrigger {
8
8
  itemId: string;
9
9
  type: 'hover-in' | 'hover-out' | 'click';
10
10
  from: StateId;
11
11
  to: StateId;
12
12
  }
13
- export interface InteractionScrollTrigger {
14
- position: number;
15
- from: StateId;
16
- to: StateId;
17
- isReverse: boolean;
18
- }
19
13
  export type VideoInteractionAction = {
20
14
  type: 'play' | 'pause';
21
15
  itemId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cntrl-site/sdk",
3
- "version": "1.22.9-alpha.0",
3
+ "version": "1.22.9",
4
4
  "description": "Generic SDK for use in public websites.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",