@cntrl-site/sdk 1.12.4-alpha.2 → 1.12.4-alpha.4

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.
@@ -48,9 +48,7 @@ const ImageItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
48
48
  strokeColor: zod_1.z.string(),
49
49
  blur: zod_1.z.number()
50
50
  })),
51
- state: zod_1.z.object({
52
- hover: zod_1.z.record(ItemState_schema_1.MediaStateParamsSchema)
53
- })
51
+ state: zod_1.z.record(zod_1.z.record(ItemState_schema_1.MediaStateParamsSchema))
54
52
  });
55
53
  const VideoItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
56
54
  type: zod_1.z.literal(ArticleItemType_1.ArticleItemType.Video),
@@ -74,9 +72,7 @@ const VideoItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
74
72
  strokeColor: zod_1.z.string(),
75
73
  blur: zod_1.z.number()
76
74
  })),
77
- state: zod_1.z.object({
78
- hover: zod_1.z.record(ItemState_schema_1.MediaStateParamsSchema)
79
- })
75
+ state: zod_1.z.record(zod_1.z.record(ItemState_schema_1.MediaStateParamsSchema))
80
76
  });
81
77
  const RectangleItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
82
78
  type: zod_1.z.literal(ArticleItemType_1.ArticleItemType.Rectangle),
@@ -96,9 +92,7 @@ const RectangleItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
96
92
  backdropBlur: zod_1.z.number(),
97
93
  blurMode: zod_1.z.enum(['default', 'backdrop'])
98
94
  })),
99
- state: zod_1.z.object({
100
- hover: zod_1.z.record(ItemState_schema_1.RectangleStateParamsSchema)
101
- })
95
+ state: zod_1.z.record(zod_1.z.record(ItemState_schema_1.RectangleStateParamsSchema))
102
96
  });
103
97
  const CustomItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
104
98
  type: zod_1.z.literal(ArticleItemType_1.ArticleItemType.Custom),
@@ -110,9 +104,7 @@ const CustomItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
110
104
  to: zod_1.z.number().optional()
111
105
  }).nullable()),
112
106
  layoutParams: zod_1.z.record(zod_1.z.object({})),
113
- state: zod_1.z.object({
114
- hover: zod_1.z.record(ItemState_schema_1.CustomItemStateParamsSchema)
115
- })
107
+ state: zod_1.z.record(zod_1.z.record(ItemState_schema_1.CustomItemStateParamsSchema))
116
108
  });
117
109
  const VimeoEmbedItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
118
110
  type: zod_1.z.literal(ArticleItemType_1.ArticleItemType.VimeoEmbed),
@@ -135,9 +127,7 @@ const VimeoEmbedItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
135
127
  blur: zod_1.z.number(),
136
128
  opacity: zod_1.z.number().nonnegative()
137
129
  })),
138
- state: zod_1.z.object({
139
- hover: zod_1.z.record(ItemState_schema_1.EmbedStateParamsSchema)
140
- })
130
+ state: zod_1.z.record(zod_1.z.record(ItemState_schema_1.EmbedStateParamsSchema))
141
131
  });
142
132
  const YoutubeEmbedItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
143
133
  type: zod_1.z.literal(ArticleItemType_1.ArticleItemType.YoutubeEmbed),
@@ -157,9 +147,7 @@ const YoutubeEmbedItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
157
147
  blur: zod_1.z.number(),
158
148
  opacity: zod_1.z.number().nonnegative()
159
149
  })),
160
- state: zod_1.z.object({
161
- hover: zod_1.z.record(ItemState_schema_1.EmbedStateParamsSchema)
162
- })
150
+ state: zod_1.z.record(zod_1.z.record(ItemState_schema_1.EmbedStateParamsSchema))
163
151
  });
164
152
  const CodeEmbedItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
165
153
  type: zod_1.z.literal(ArticleItemType_1.ArticleItemType.CodeEmbed),
@@ -177,9 +165,7 @@ const CodeEmbedItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
177
165
  opacity: zod_1.z.number().nonnegative(),
178
166
  blur: zod_1.z.number()
179
167
  })),
180
- state: zod_1.z.object({
181
- hover: zod_1.z.record(ItemState_schema_1.CodeEmbedStateParamsSchema)
182
- })
168
+ state: zod_1.z.record(zod_1.z.record(ItemState_schema_1.CodeEmbedStateParamsSchema))
183
169
  });
184
170
  exports.ItemSchema = zod_1.z.lazy(() => zod_1.z.discriminatedUnion('type', [
185
171
  ImageItemSchema,
@@ -201,8 +187,6 @@ exports.ItemSchema = zod_1.z.lazy(() => zod_1.z.discriminatedUnion('type', [
201
187
  layoutParams: zod_1.z.record(zod_1.z.object({
202
188
  opacity: zod_1.z.number().nonnegative()
203
189
  })),
204
- state: zod_1.z.object({
205
- hover: zod_1.z.record(ItemState_schema_1.GroupStateParamsSchema)
206
- })
190
+ state: zod_1.z.record(zod_1.z.record(ItemState_schema_1.GroupStateParamsSchema))
207
191
  })
208
192
  ]));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cntrl-site/sdk",
3
- "version": "1.12.4-alpha.2",
3
+ "version": "1.12.4-alpha.4",
4
4
  "description": "Generic SDK for use in public websites.",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/index.ts",
@@ -68,9 +68,7 @@ const ImageItemSchema = ItemBaseSchema.extend({
68
68
  blur: z.number()
69
69
  })
70
70
  ),
71
- state: z.object({
72
- hover: z.record(MediaStateParamsSchema)
73
- })
71
+ state: z.record(z.record(MediaStateParamsSchema))
74
72
  }) satisfies ZodType<ImageItem>;
75
73
 
76
74
  const VideoItemSchema = ItemBaseSchema.extend({
@@ -99,9 +97,7 @@ const VideoItemSchema = ItemBaseSchema.extend({
99
97
  blur: z.number()
100
98
  })
101
99
  ),
102
- state: z.object({
103
- hover: z.record(MediaStateParamsSchema)
104
- })
100
+ state: z.record(z.record(MediaStateParamsSchema))
105
101
  }) satisfies ZodType<VideoItem>;
106
102
 
107
103
  const RectangleItemSchema = ItemBaseSchema.extend({
@@ -126,9 +122,7 @@ const RectangleItemSchema = ItemBaseSchema.extend({
126
122
  blurMode: z.enum(['default', 'backdrop'])
127
123
  })
128
124
  ),
129
- state: z.object({
130
- hover: z.record(RectangleStateParamsSchema)
131
- })
125
+ state: z.record(z.record(RectangleStateParamsSchema))
132
126
  }) satisfies ZodType<RectangleItem>;
133
127
 
134
128
  const CustomItemSchema = ItemBaseSchema.extend({
@@ -143,9 +137,7 @@ const CustomItemSchema = ItemBaseSchema.extend({
143
137
  }).nullable(),
144
138
  ),
145
139
  layoutParams: z.record(z.object({})),
146
- state: z.object({
147
- hover: z.record(CustomItemStateParamsSchema)
148
- })
140
+ state: z.record(z.record(CustomItemStateParamsSchema))
149
141
  }) satisfies ZodType<CustomItem>;
150
142
 
151
143
  const VimeoEmbedItemSchema = ItemBaseSchema.extend({
@@ -173,9 +165,7 @@ const VimeoEmbedItemSchema = ItemBaseSchema.extend({
173
165
  opacity: z.number().nonnegative()
174
166
  })
175
167
  ),
176
- state: z.object({
177
- hover: z.record(EmbedStateParamsSchema)
178
- })
168
+ state: z.record(z.record(EmbedStateParamsSchema))
179
169
  }) satisfies ZodType<VimeoEmbedItem>;
180
170
 
181
171
  const YoutubeEmbedItemSchema = ItemBaseSchema.extend({
@@ -200,9 +190,7 @@ const YoutubeEmbedItemSchema = ItemBaseSchema.extend({
200
190
  opacity: z.number().nonnegative()
201
191
  })
202
192
  ),
203
- state: z.object({
204
- hover: z.record(EmbedStateParamsSchema)
205
- })
193
+ state: z.record(z.record(EmbedStateParamsSchema))
206
194
  }) satisfies ZodType<YoutubeEmbedItem>;
207
195
 
208
196
  const CodeEmbedItemSchema = ItemBaseSchema.extend({
@@ -225,9 +213,7 @@ const CodeEmbedItemSchema = ItemBaseSchema.extend({
225
213
  blur: z.number()
226
214
  })
227
215
  ),
228
- state: z.object({
229
- hover: z.record(CodeEmbedStateParamsSchema)
230
- })
216
+ state: z.record(z.record(CodeEmbedStateParamsSchema))
231
217
  }) satisfies ZodType<CodeEmbedItem>;
232
218
 
233
219
  export const ItemSchema: ZodType<ItemAny> = z.lazy(() => z.discriminatedUnion('type', [
@@ -254,8 +240,6 @@ export const ItemSchema: ZodType<ItemAny> = z.lazy(() => z.discriminatedUnion('t
254
240
  opacity: z.number().nonnegative()
255
241
  })
256
242
  ),
257
- state: z.object({
258
- hover: z.record(GroupStateParamsSchema)
259
- })
243
+ state: z.record(z.record(GroupStateParamsSchema))
260
244
  })
261
245
  ]));
@@ -1,6 +1,8 @@
1
1
  import { Section } from './Section';
2
+ import { Interaction } from './Interaction';
2
3
 
3
4
  export interface Article {
4
5
  id: string;
5
6
  sections: Section[];
7
+ interactions: Interaction[];
6
8
  }