@cntrl-site/sdk 1.17.0 → 1.19.1

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.
@@ -50,7 +50,8 @@ const ImageItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
50
50
  radius: zod_1.z.number(),
51
51
  strokeWidth: zod_1.z.number(),
52
52
  strokeColor: zod_1.z.string(),
53
- blur: zod_1.z.number()
53
+ blur: zod_1.z.number(),
54
+ isDraggable: zod_1.z.boolean().optional()
54
55
  })),
55
56
  state: zod_1.z.record(zod_1.z.record(ItemState_schema_1.MediaStateParamsSchema))
56
57
  });
@@ -74,7 +75,8 @@ const VideoItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
74
75
  radius: zod_1.z.number(),
75
76
  strokeWidth: zod_1.z.number(),
76
77
  strokeColor: zod_1.z.string(),
77
- blur: zod_1.z.number()
78
+ blur: zod_1.z.number(),
79
+ isDraggable: zod_1.z.boolean().optional()
78
80
  })),
79
81
  state: zod_1.z.record(zod_1.z.record(ItemState_schema_1.MediaStateParamsSchema))
80
82
  });
@@ -95,7 +97,8 @@ const RectangleItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
95
97
  strokeColor: zod_1.z.string().min(1),
96
98
  blur: zod_1.z.number(),
97
99
  backdropBlur: zod_1.z.number(),
98
- blurMode: zod_1.z.enum(['default', 'backdrop'])
100
+ blurMode: zod_1.z.enum(['default', 'backdrop']),
101
+ isDraggable: zod_1.z.boolean().optional()
99
102
  })),
100
103
  state: zod_1.z.record(zod_1.z.record(ItemState_schema_1.RectangleStateParamsSchema))
101
104
  });
@@ -109,7 +112,9 @@ const CustomItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
109
112
  from: zod_1.z.number(),
110
113
  to: zod_1.z.number().optional()
111
114
  }).nullable()),
112
- layoutParams: zod_1.z.record(zod_1.z.object({})),
115
+ layoutParams: zod_1.z.record(zod_1.z.object({
116
+ isDraggable: zod_1.z.boolean().optional()
117
+ })),
113
118
  state: zod_1.z.record(zod_1.z.record(ItemState_schema_1.CustomItemStateParamsSchema))
114
119
  });
115
120
  const VimeoEmbedItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
@@ -172,7 +177,8 @@ const CodeEmbedItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
172
177
  layoutParams: zod_1.z.record(zod_1.z.object({
173
178
  areaAnchor: zod_1.z.nativeEnum(ItemArea_1.AreaAnchor),
174
179
  opacity: zod_1.z.number().nonnegative(),
175
- blur: zod_1.z.number()
180
+ blur: zod_1.z.number(),
181
+ isDraggable: zod_1.z.boolean().optional()
176
182
  })),
177
183
  state: zod_1.z.record(zod_1.z.record(ItemState_schema_1.CodeEmbedStateParamsSchema))
178
184
  });
@@ -196,7 +202,8 @@ exports.ItemSchema = zod_1.z.lazy(() => zod_1.z.discriminatedUnion('type', [
196
202
  to: zod_1.z.number().optional()
197
203
  }).nullable()),
198
204
  layoutParams: zod_1.z.record(zod_1.z.object({
199
- opacity: zod_1.z.number().nonnegative()
205
+ opacity: zod_1.z.number().nonnegative(),
206
+ blur: zod_1.z.number()
200
207
  })),
201
208
  state: zod_1.z.record(zod_1.z.record(ItemState_schema_1.GroupStateParamsSchema))
202
209
  }),
@@ -49,7 +49,8 @@ exports.RichTextStateParamsSchema = zod_1.z.object({
49
49
  wordSpacing: (0, exports.getStateParamsSchema)(zod_1.z.number())
50
50
  }).merge(exports.ItemStateBaseSchema);
51
51
  exports.GroupStateParamsSchema = zod_1.z.object({
52
- opacity: (0, exports.getStateParamsSchema)(zod_1.z.number().nonnegative())
52
+ opacity: (0, exports.getStateParamsSchema)(zod_1.z.number().nonnegative()),
53
+ blur: (0, exports.getStateParamsSchema)(zod_1.z.number().nonnegative())
53
54
  }).merge(exports.ItemStateBaseSchema);
54
55
  exports.CompoundStateParamsSchema = zod_1.z.object({
55
56
  opacity: (0, exports.getStateParamsSchema)(zod_1.z.number().nonnegative())
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cntrl-site/sdk",
3
- "version": "1.17.0",
3
+ "version": "1.19.1",
4
4
  "description": "Generic SDK for use in public websites.",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/index.ts",
@@ -71,7 +71,8 @@ const ImageItemSchema = ItemBaseSchema.extend({
71
71
  radius: z.number(),
72
72
  strokeWidth: z.number(),
73
73
  strokeColor: z.string(),
74
- blur: z.number()
74
+ blur: z.number(),
75
+ isDraggable: z.boolean().optional()
75
76
  })
76
77
  ),
77
78
  state: z.record(z.record(MediaStateParamsSchema))
@@ -100,7 +101,8 @@ const VideoItemSchema = ItemBaseSchema.extend({
100
101
  radius: z.number(),
101
102
  strokeWidth: z.number(),
102
103
  strokeColor: z.string(),
103
- blur: z.number()
104
+ blur: z.number(),
105
+ isDraggable: z.boolean().optional()
104
106
  })
105
107
  ),
106
108
  state: z.record(z.record(MediaStateParamsSchema))
@@ -126,7 +128,8 @@ const RectangleItemSchema = ItemBaseSchema.extend({
126
128
  strokeColor: z.string().min(1),
127
129
  blur: z.number(),
128
130
  backdropBlur: z.number(),
129
- blurMode: z.enum(['default', 'backdrop'])
131
+ blurMode: z.enum(['default', 'backdrop']),
132
+ isDraggable: z.boolean().optional()
130
133
  })
131
134
  ),
132
135
  state: z.record(z.record(RectangleStateParamsSchema))
@@ -144,7 +147,9 @@ const CustomItemSchema = ItemBaseSchema.extend({
144
147
  to: z.number().optional()
145
148
  }).nullable(),
146
149
  ),
147
- layoutParams: z.record(z.object({})),
150
+ layoutParams: z.record(z.object({
151
+ isDraggable: z.boolean().optional()
152
+ })),
148
153
  state: z.record(z.record(CustomItemStateParamsSchema))
149
154
  }) satisfies ZodType<CustomItem>;
150
155
 
@@ -221,7 +226,8 @@ const CodeEmbedItemSchema = ItemBaseSchema.extend({
221
226
  z.object({
222
227
  areaAnchor: z.nativeEnum(AreaAnchor),
223
228
  opacity: z.number().nonnegative(),
224
- blur: z.number()
229
+ blur: z.number(),
230
+ isDraggable: z.boolean().optional()
225
231
  })
226
232
  ),
227
233
  state: z.record(z.record(CodeEmbedStateParamsSchema))
@@ -250,7 +256,8 @@ export const ItemSchema: ZodType<ItemAny> = z.lazy(() => z.discriminatedUnion('t
250
256
  ),
251
257
  layoutParams: z.record(
252
258
  z.object({
253
- opacity: z.number().nonnegative()
259
+ opacity: z.number().nonnegative(),
260
+ blur: z.number()
254
261
  })
255
262
  ),
256
263
  state: z.record(z.record(GroupStateParamsSchema))
@@ -64,7 +64,8 @@ export const RichTextStateParamsSchema = z.object({
64
64
  }).merge(ItemStateBaseSchema) satisfies ZodType<RichTextStateParams>;
65
65
 
66
66
  export const GroupStateParamsSchema = z.object({
67
- opacity: getStateParamsSchema(z.number().nonnegative())
67
+ opacity: getStateParamsSchema(z.number().nonnegative()),
68
+ blur: getStateParamsSchema(z.number().nonnegative())
68
69
  }).merge(ItemStateBaseSchema) satisfies ZodType<GroupStateParams>;
69
70
 
70
71
  export const CompoundStateParamsSchema = z.object({
@@ -114,22 +114,29 @@ interface MediaLayoutParams {
114
114
  strokeWidth: number;
115
115
  strokeColor: string;
116
116
  blur: number;
117
+ isDraggable?: boolean;
117
118
  }
118
119
 
119
- interface CustomLayoutParams {}
120
+ interface CustomLayoutParams {
121
+ isDraggable?: boolean;
122
+ }
120
123
 
121
124
  interface GroupLayoutParams {
122
125
  opacity: number;
126
+ blur: number;
127
+ isDraggable?: boolean;
123
128
  }
124
129
 
125
130
  interface CompoundLayoutParams {
126
131
  opacity: number;
132
+ isDraggable?: boolean;
127
133
  }
128
134
 
129
135
  interface CodeEmbedLayoutParams {
130
136
  areaAnchor: AreaAnchor;
131
137
  opacity: number;
132
138
  blur: number;
139
+ isDraggable?: boolean;
133
140
  }
134
141
 
135
142
  interface VimeoEmbedLayoutParams {
@@ -167,6 +174,7 @@ interface RichTextLayoutParams {
167
174
  fontStyle: string;
168
175
  fontWeight: number;
169
176
  fontVariant: string;
177
+ isDraggable?: boolean;
170
178
  }
171
179
 
172
180
  interface RectangleLayoutParams {
@@ -177,6 +185,7 @@ interface RectangleLayoutParams {
177
185
  blur: number;
178
186
  backdropBlur: number;
179
187
  blurMode: 'default' | 'backdrop';
188
+ isDraggable?: boolean;
180
189
  }
181
190
 
182
191
  export interface ScrollPlaybackParams {
@@ -74,6 +74,7 @@ export interface CustomItemStateParams extends ItemStatesBaseMap {}
74
74
 
75
75
  export interface GroupStateParams extends ItemStatesBaseMap {
76
76
  opacity?: StateParams<number>;
77
+ blur?: StateParams<number>;
77
78
  }
78
79
 
79
80
  export interface CompoundStateParams extends ItemStatesBaseMap {