@cntrl-site/sdk 1.28.0-2 → 1.28.0-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.
- package/lib/index.d.ts +2 -1
- package/lib/schemas/article/Article.schema.d.ts +12 -12
- package/lib/schemas/article/ElementLayoutParams.schema.d.ts +1219 -0
- package/lib/schemas/article/ElementLayoutParams.schema.js +91 -0
- package/lib/schemas/article/Interaction.schema.d.ts +8 -8
- package/lib/schemas/article/Item.schema.d.ts +0 -72
- package/lib/schemas/article/Item.schema.js +12 -90
- package/lib/schemas/article/ItemArea.schema.d.ts +2 -2
- package/lib/schemas/article/ItemBase.schema.d.ts +4 -4
- package/lib/schemas/article/RichTextItem.schema.d.ts +4 -4
- package/lib/schemas/article/StructuredBlock.schema.js +5 -4
- package/lib/schemas/keyframe/Keyframes.schema.d.ts +8 -8
- package/lib/types/article/Item.d.ts +3 -210
- package/lib/types/article/ItemState.d.ts +1 -1
- package/lib/types/article/Params.type.d.ts +211 -0
- package/lib/types/article/Params.type.js +2 -0
- package/lib/types/article/StructuredBlock.d.ts +1 -1
- package/lib/types/keyframe/Keyframe.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CompoundLayoutParamsSchema = exports.GroupLayoutParamsSchema = exports.ComponentItemLayoutParamsSchema = exports.CodeEmbedLayoutParamsSchema = exports.YoutubeEmbedLayoutParamsSchema = exports.VimeoEmbedLayoutParamsSchema = exports.CustomLayoutParamsSchema = exports.RectangleLayoutParamsSchema = exports.VideoLayoutParamsSchema = exports.ImageLayoutParamsSchema = void 0;
|
|
4
|
+
const ItemArea_1 = require("../../types/article/ItemArea");
|
|
5
|
+
const FillLayer_schema_1 = require("./FillLayer.schema");
|
|
6
|
+
const zod_1 = require("zod");
|
|
7
|
+
exports.ImageLayoutParamsSchema = zod_1.z.object({
|
|
8
|
+
opacity: zod_1.z.number().nonnegative(),
|
|
9
|
+
radius: zod_1.z.number(),
|
|
10
|
+
strokeWidth: zod_1.z.number(),
|
|
11
|
+
strokeFill: zod_1.z.array(FillLayer_schema_1.FillLayerSchema),
|
|
12
|
+
blur: zod_1.z.number(),
|
|
13
|
+
isDraggable: zod_1.z.boolean().optional(),
|
|
14
|
+
blendMode: zod_1.z.string().optional()
|
|
15
|
+
});
|
|
16
|
+
exports.VideoLayoutParamsSchema = zod_1.z.object({
|
|
17
|
+
scrollPlayback: zod_1.z.object({
|
|
18
|
+
from: zod_1.z.number(),
|
|
19
|
+
to: zod_1.z.number()
|
|
20
|
+
}).nullable(),
|
|
21
|
+
opacity: zod_1.z.number().nonnegative(),
|
|
22
|
+
radius: zod_1.z.number(),
|
|
23
|
+
strokeWidth: zod_1.z.number(),
|
|
24
|
+
strokeFill: zod_1.z.array(FillLayer_schema_1.FillLayerSchema),
|
|
25
|
+
blur: zod_1.z.number(),
|
|
26
|
+
isDraggable: zod_1.z.boolean().optional(),
|
|
27
|
+
blendMode: zod_1.z.string().optional(),
|
|
28
|
+
play: zod_1.z.enum(['on-hover', 'on-click', 'auto']),
|
|
29
|
+
muted: zod_1.z.boolean(),
|
|
30
|
+
controls: zod_1.z.boolean(),
|
|
31
|
+
});
|
|
32
|
+
exports.RectangleLayoutParamsSchema = zod_1.z.object({
|
|
33
|
+
radius: zod_1.z.number(),
|
|
34
|
+
strokeWidth: zod_1.z.number(),
|
|
35
|
+
fill: zod_1.z.array(FillLayer_schema_1.FillLayerSchema),
|
|
36
|
+
strokeFill: zod_1.z.array(FillLayer_schema_1.FillLayerSchema),
|
|
37
|
+
blur: zod_1.z.number(),
|
|
38
|
+
backdropBlur: zod_1.z.number(),
|
|
39
|
+
blurMode: zod_1.z.enum(['default', 'backdrop']),
|
|
40
|
+
isDraggable: zod_1.z.boolean().optional(),
|
|
41
|
+
blendMode: zod_1.z.string().optional()
|
|
42
|
+
});
|
|
43
|
+
exports.CustomLayoutParamsSchema = zod_1.z.object({
|
|
44
|
+
isDraggable: zod_1.z.boolean().optional(),
|
|
45
|
+
blendMode: zod_1.z.string().optional()
|
|
46
|
+
});
|
|
47
|
+
exports.VimeoEmbedLayoutParamsSchema = zod_1.z.object({
|
|
48
|
+
radius: zod_1.z.number(),
|
|
49
|
+
blur: zod_1.z.number(),
|
|
50
|
+
opacity: zod_1.z.number().nonnegative(),
|
|
51
|
+
play: zod_1.z.union([zod_1.z.literal('on-hover'), zod_1.z.literal('on-click'), zod_1.z.literal('auto')]),
|
|
52
|
+
controls: zod_1.z.boolean(),
|
|
53
|
+
loop: zod_1.z.boolean(),
|
|
54
|
+
muted: zod_1.z.boolean(),
|
|
55
|
+
pictureInPicture: zod_1.z.boolean(),
|
|
56
|
+
blendMode: zod_1.z.string().optional()
|
|
57
|
+
});
|
|
58
|
+
exports.YoutubeEmbedLayoutParamsSchema = zod_1.z.object({
|
|
59
|
+
radius: zod_1.z.number(),
|
|
60
|
+
blur: zod_1.z.number(),
|
|
61
|
+
opacity: zod_1.z.number().nonnegative(),
|
|
62
|
+
play: zod_1.z.enum(['on-hover', 'on-click', 'auto']),
|
|
63
|
+
controls: zod_1.z.boolean(),
|
|
64
|
+
loop: zod_1.z.boolean(),
|
|
65
|
+
blendMode: zod_1.z.string().optional()
|
|
66
|
+
});
|
|
67
|
+
exports.CodeEmbedLayoutParamsSchema = zod_1.z.object({
|
|
68
|
+
areaAnchor: zod_1.z.nativeEnum(ItemArea_1.AreaAnchor),
|
|
69
|
+
opacity: zod_1.z.number().nonnegative(),
|
|
70
|
+
blur: zod_1.z.number(),
|
|
71
|
+
isDraggable: zod_1.z.boolean().optional(),
|
|
72
|
+
blendMode: zod_1.z.string().optional()
|
|
73
|
+
});
|
|
74
|
+
exports.ComponentItemLayoutParamsSchema = zod_1.z.object({
|
|
75
|
+
sizing: zod_1.z.string().optional(),
|
|
76
|
+
opacity: zod_1.z.number().nonnegative(),
|
|
77
|
+
blur: zod_1.z.number(),
|
|
78
|
+
parameters: zod_1.z.any().optional(),
|
|
79
|
+
blendMode: zod_1.z.string().optional(),
|
|
80
|
+
});
|
|
81
|
+
exports.GroupLayoutParamsSchema = zod_1.z.object({
|
|
82
|
+
opacity: zod_1.z.number().nonnegative(),
|
|
83
|
+
blur: zod_1.z.number(),
|
|
84
|
+
isDraggable: zod_1.z.boolean().optional(),
|
|
85
|
+
blendMode: zod_1.z.string().optional()
|
|
86
|
+
});
|
|
87
|
+
exports.CompoundLayoutParamsSchema = zod_1.z.object({
|
|
88
|
+
opacity: zod_1.z.number().nonnegative(),
|
|
89
|
+
isDraggable: zod_1.z.boolean().optional(),
|
|
90
|
+
blendMode: zod_1.z.string().optional()
|
|
91
|
+
});
|
|
@@ -52,8 +52,8 @@ export declare const InteractionSchema: z.ZodObject<{
|
|
|
52
52
|
to: string;
|
|
53
53
|
itemId: string;
|
|
54
54
|
isReverse: boolean;
|
|
55
|
-
itemPosition: "
|
|
56
|
-
screenPosition: "
|
|
55
|
+
itemPosition: "top" | "bottom" | "center";
|
|
56
|
+
screenPosition: "top" | "bottom" | "center";
|
|
57
57
|
offset: number;
|
|
58
58
|
}, {
|
|
59
59
|
type: "item-scroll-position";
|
|
@@ -61,8 +61,8 @@ export declare const InteractionSchema: z.ZodObject<{
|
|
|
61
61
|
to: string;
|
|
62
62
|
itemId: string;
|
|
63
63
|
isReverse: boolean;
|
|
64
|
-
itemPosition: "
|
|
65
|
-
screenPosition: "
|
|
64
|
+
itemPosition: "top" | "bottom" | "center";
|
|
65
|
+
screenPosition: "top" | "bottom" | "center";
|
|
66
66
|
offset: number;
|
|
67
67
|
}>]>, "many">;
|
|
68
68
|
states: z.ZodArray<z.ZodObject<{
|
|
@@ -111,8 +111,8 @@ export declare const InteractionSchema: z.ZodObject<{
|
|
|
111
111
|
to: string;
|
|
112
112
|
itemId: string;
|
|
113
113
|
isReverse: boolean;
|
|
114
|
-
itemPosition: "
|
|
115
|
-
screenPosition: "
|
|
114
|
+
itemPosition: "top" | "bottom" | "center";
|
|
115
|
+
screenPosition: "top" | "bottom" | "center";
|
|
116
116
|
offset: number;
|
|
117
117
|
})[];
|
|
118
118
|
states: {
|
|
@@ -143,8 +143,8 @@ export declare const InteractionSchema: z.ZodObject<{
|
|
|
143
143
|
to: string;
|
|
144
144
|
itemId: string;
|
|
145
145
|
isReverse: boolean;
|
|
146
|
-
itemPosition: "
|
|
147
|
-
screenPosition: "
|
|
146
|
+
itemPosition: "top" | "bottom" | "center";
|
|
147
|
+
screenPosition: "top" | "bottom" | "center";
|
|
148
148
|
offset: number;
|
|
149
149
|
})[];
|
|
150
150
|
states: {
|
|
@@ -37,76 +37,4 @@ export declare const FXControlSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
37
37
|
type: "vec2";
|
|
38
38
|
shaderParam: string;
|
|
39
39
|
}>]>;
|
|
40
|
-
export declare const VimeoEmbedLayoutParamsSchema: z.ZodObject<{
|
|
41
|
-
radius: z.ZodNumber;
|
|
42
|
-
blur: z.ZodNumber;
|
|
43
|
-
opacity: z.ZodNumber;
|
|
44
|
-
play: z.ZodUnion<[z.ZodLiteral<"on-hover">, z.ZodLiteral<"on-click">, z.ZodLiteral<"auto">]>;
|
|
45
|
-
controls: z.ZodBoolean;
|
|
46
|
-
loop: z.ZodBoolean;
|
|
47
|
-
muted: z.ZodBoolean;
|
|
48
|
-
pictureInPicture: z.ZodBoolean;
|
|
49
|
-
blendMode: z.ZodOptional<z.ZodString>;
|
|
50
|
-
}, "strip", z.ZodTypeAny, {
|
|
51
|
-
opacity: number;
|
|
52
|
-
radius: number;
|
|
53
|
-
play: "on-hover" | "on-click" | "auto";
|
|
54
|
-
blur: number;
|
|
55
|
-
muted: boolean;
|
|
56
|
-
controls: boolean;
|
|
57
|
-
loop: boolean;
|
|
58
|
-
pictureInPicture: boolean;
|
|
59
|
-
blendMode?: string | undefined;
|
|
60
|
-
}, {
|
|
61
|
-
opacity: number;
|
|
62
|
-
radius: number;
|
|
63
|
-
play: "on-hover" | "on-click" | "auto";
|
|
64
|
-
blur: number;
|
|
65
|
-
muted: boolean;
|
|
66
|
-
controls: boolean;
|
|
67
|
-
loop: boolean;
|
|
68
|
-
pictureInPicture: boolean;
|
|
69
|
-
blendMode?: string | undefined;
|
|
70
|
-
}>;
|
|
71
|
-
export declare const YoutubeEmbedLayoutParamsSchema: z.ZodObject<{
|
|
72
|
-
radius: z.ZodNumber;
|
|
73
|
-
blur: z.ZodNumber;
|
|
74
|
-
opacity: z.ZodNumber;
|
|
75
|
-
play: z.ZodEnum<["on-hover", "on-click", "auto"]>;
|
|
76
|
-
controls: z.ZodBoolean;
|
|
77
|
-
loop: z.ZodBoolean;
|
|
78
|
-
blendMode: z.ZodOptional<z.ZodString>;
|
|
79
|
-
}, "strip", z.ZodTypeAny, {
|
|
80
|
-
opacity: number;
|
|
81
|
-
radius: number;
|
|
82
|
-
play: "on-hover" | "on-click" | "auto";
|
|
83
|
-
blur: number;
|
|
84
|
-
controls: boolean;
|
|
85
|
-
loop: boolean;
|
|
86
|
-
blendMode?: string | undefined;
|
|
87
|
-
}, {
|
|
88
|
-
opacity: number;
|
|
89
|
-
radius: number;
|
|
90
|
-
play: "on-hover" | "on-click" | "auto";
|
|
91
|
-
blur: number;
|
|
92
|
-
controls: boolean;
|
|
93
|
-
loop: boolean;
|
|
94
|
-
blendMode?: string | undefined;
|
|
95
|
-
}>;
|
|
96
|
-
export declare const ComponentItemLayoutParamsSchema: z.ZodObject<{
|
|
97
|
-
opacity: z.ZodNumber;
|
|
98
|
-
blur: z.ZodNumber;
|
|
99
|
-
parameters: z.ZodOptional<z.ZodAny>;
|
|
100
|
-
blendMode: z.ZodOptional<z.ZodString>;
|
|
101
|
-
}, "strip", z.ZodTypeAny, {
|
|
102
|
-
opacity: number;
|
|
103
|
-
blur: number;
|
|
104
|
-
parameters?: any;
|
|
105
|
-
blendMode?: string | undefined;
|
|
106
|
-
}, {
|
|
107
|
-
opacity: number;
|
|
108
|
-
blur: number;
|
|
109
|
-
parameters?: any;
|
|
110
|
-
blendMode?: string | undefined;
|
|
111
|
-
}>;
|
|
112
40
|
export declare const ItemSchema: ZodType<ItemAny>;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ItemSchema = exports.
|
|
3
|
+
exports.ItemSchema = exports.FXControlSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const ItemState_schema_1 = require("./ItemState.schema");
|
|
6
6
|
const RichTextItem_schema_1 = require("./RichTextItem.schema");
|
|
7
7
|
const ItemBase_schema_1 = require("./ItemBase.schema");
|
|
8
8
|
const ArticleItemType_1 = require("../../types/article/ArticleItemType");
|
|
9
|
-
const
|
|
10
|
-
const FillLayer_schema_1 = require("./FillLayer.schema");
|
|
9
|
+
const ElementLayoutParams_schema_1 = require("./ElementLayoutParams.schema");
|
|
11
10
|
const pointerEvents = zod_1.z.enum(['never', 'when_visible', 'always']).optional();
|
|
12
11
|
exports.FXControlSchema = zod_1.z.discriminatedUnion('type', [
|
|
13
12
|
zod_1.z.object({
|
|
@@ -42,15 +41,7 @@ const ImageItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
|
|
|
42
41
|
from: zod_1.z.number(),
|
|
43
42
|
to: zod_1.z.number().optional()
|
|
44
43
|
}).nullable()),
|
|
45
|
-
layoutParams: zod_1.z.record(
|
|
46
|
-
opacity: zod_1.z.number().nonnegative(),
|
|
47
|
-
radius: zod_1.z.number(),
|
|
48
|
-
strokeWidth: zod_1.z.number(),
|
|
49
|
-
strokeFill: zod_1.z.array(FillLayer_schema_1.FillLayerSchema),
|
|
50
|
-
blur: zod_1.z.number(),
|
|
51
|
-
isDraggable: zod_1.z.boolean().optional(),
|
|
52
|
-
blendMode: zod_1.z.string().optional()
|
|
53
|
-
})),
|
|
44
|
+
layoutParams: zod_1.z.record(ElementLayoutParams_schema_1.ImageLayoutParamsSchema),
|
|
54
45
|
state: zod_1.z.record(ItemState_schema_1.MediaStateParamsSchema)
|
|
55
46
|
});
|
|
56
47
|
const ScrollPlaybackFrameDataSchema = zod_1.z.object({
|
|
@@ -72,22 +63,7 @@ const VideoItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
|
|
|
72
63
|
from: zod_1.z.number(),
|
|
73
64
|
to: zod_1.z.number().optional()
|
|
74
65
|
}).nullable()),
|
|
75
|
-
layoutParams: zod_1.z.record(
|
|
76
|
-
scrollPlayback: zod_1.z.object({
|
|
77
|
-
from: zod_1.z.number(),
|
|
78
|
-
to: zod_1.z.number()
|
|
79
|
-
}).nullable(),
|
|
80
|
-
opacity: zod_1.z.number().nonnegative(),
|
|
81
|
-
radius: zod_1.z.number(),
|
|
82
|
-
strokeWidth: zod_1.z.number(),
|
|
83
|
-
strokeFill: zod_1.z.array(FillLayer_schema_1.FillLayerSchema),
|
|
84
|
-
blur: zod_1.z.number(),
|
|
85
|
-
isDraggable: zod_1.z.boolean().optional(),
|
|
86
|
-
blendMode: zod_1.z.string().optional(),
|
|
87
|
-
play: zod_1.z.enum(['on-hover', 'on-click', 'auto']),
|
|
88
|
-
muted: zod_1.z.boolean(),
|
|
89
|
-
controls: zod_1.z.boolean(),
|
|
90
|
-
})),
|
|
66
|
+
layoutParams: zod_1.z.record(ElementLayoutParams_schema_1.VideoLayoutParamsSchema),
|
|
91
67
|
state: zod_1.z.record(ItemState_schema_1.MediaStateParamsSchema)
|
|
92
68
|
});
|
|
93
69
|
const RectangleItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
|
|
@@ -100,17 +76,7 @@ const RectangleItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
|
|
|
100
76
|
from: zod_1.z.number(),
|
|
101
77
|
to: zod_1.z.number().optional()
|
|
102
78
|
}).nullable()),
|
|
103
|
-
layoutParams: zod_1.z.record(
|
|
104
|
-
radius: zod_1.z.number(),
|
|
105
|
-
strokeWidth: zod_1.z.number(),
|
|
106
|
-
fill: zod_1.z.array(FillLayer_schema_1.FillLayerSchema),
|
|
107
|
-
strokeFill: zod_1.z.array(FillLayer_schema_1.FillLayerSchema),
|
|
108
|
-
blur: zod_1.z.number(),
|
|
109
|
-
backdropBlur: zod_1.z.number(),
|
|
110
|
-
blurMode: zod_1.z.enum(['default', 'backdrop']),
|
|
111
|
-
isDraggable: zod_1.z.boolean().optional(),
|
|
112
|
-
blendMode: zod_1.z.string().optional()
|
|
113
|
-
})),
|
|
79
|
+
layoutParams: zod_1.z.record(ElementLayoutParams_schema_1.RectangleLayoutParamsSchema),
|
|
114
80
|
state: zod_1.z.record(ItemState_schema_1.RectangleStateParamsSchema)
|
|
115
81
|
});
|
|
116
82
|
const CustomItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
|
|
@@ -123,23 +89,9 @@ const CustomItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
|
|
|
123
89
|
from: zod_1.z.number(),
|
|
124
90
|
to: zod_1.z.number().optional()
|
|
125
91
|
}).nullable()),
|
|
126
|
-
layoutParams: zod_1.z.record(
|
|
127
|
-
isDraggable: zod_1.z.boolean().optional(),
|
|
128
|
-
blendMode: zod_1.z.string().optional()
|
|
129
|
-
})),
|
|
92
|
+
layoutParams: zod_1.z.record(ElementLayoutParams_schema_1.CustomLayoutParamsSchema),
|
|
130
93
|
state: zod_1.z.record(ItemState_schema_1.CustomItemStateParamsSchema)
|
|
131
94
|
});
|
|
132
|
-
exports.VimeoEmbedLayoutParamsSchema = zod_1.z.object({
|
|
133
|
-
radius: zod_1.z.number(),
|
|
134
|
-
blur: zod_1.z.number(),
|
|
135
|
-
opacity: zod_1.z.number().nonnegative(),
|
|
136
|
-
play: zod_1.z.union([zod_1.z.literal('on-hover'), zod_1.z.literal('on-click'), zod_1.z.literal('auto')]),
|
|
137
|
-
controls: zod_1.z.boolean(),
|
|
138
|
-
loop: zod_1.z.boolean(),
|
|
139
|
-
muted: zod_1.z.boolean(),
|
|
140
|
-
pictureInPicture: zod_1.z.boolean(),
|
|
141
|
-
blendMode: zod_1.z.string().optional()
|
|
142
|
-
});
|
|
143
95
|
const VimeoEmbedItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
|
|
144
96
|
type: zod_1.z.literal(ArticleItemType_1.ArticleItemType.VimeoEmbed),
|
|
145
97
|
commonParams: zod_1.z.object({
|
|
@@ -152,18 +104,9 @@ const VimeoEmbedItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
|
|
|
152
104
|
from: zod_1.z.number(),
|
|
153
105
|
to: zod_1.z.number().optional()
|
|
154
106
|
}).nullable()),
|
|
155
|
-
layoutParams: zod_1.z.record(
|
|
107
|
+
layoutParams: zod_1.z.record(ElementLayoutParams_schema_1.VimeoEmbedLayoutParamsSchema),
|
|
156
108
|
state: zod_1.z.record(ItemState_schema_1.EmbedStateParamsSchema)
|
|
157
109
|
});
|
|
158
|
-
exports.YoutubeEmbedLayoutParamsSchema = zod_1.z.object({
|
|
159
|
-
radius: zod_1.z.number(),
|
|
160
|
-
blur: zod_1.z.number(),
|
|
161
|
-
opacity: zod_1.z.number().nonnegative(),
|
|
162
|
-
play: zod_1.z.enum(['on-hover', 'on-click', 'auto']),
|
|
163
|
-
controls: zod_1.z.boolean(),
|
|
164
|
-
loop: zod_1.z.boolean(),
|
|
165
|
-
blendMode: zod_1.z.string().optional()
|
|
166
|
-
});
|
|
167
110
|
const YoutubeEmbedItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
|
|
168
111
|
type: zod_1.z.literal(ArticleItemType_1.ArticleItemType.YoutubeEmbed),
|
|
169
112
|
commonParams: zod_1.z.object({
|
|
@@ -175,7 +118,7 @@ const YoutubeEmbedItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
|
|
|
175
118
|
from: zod_1.z.number(),
|
|
176
119
|
to: zod_1.z.number().optional()
|
|
177
120
|
}).nullable()),
|
|
178
|
-
layoutParams: zod_1.z.record(
|
|
121
|
+
layoutParams: zod_1.z.record(ElementLayoutParams_schema_1.YoutubeEmbedLayoutParamsSchema),
|
|
179
122
|
state: zod_1.z.record(ItemState_schema_1.EmbedStateParamsSchema)
|
|
180
123
|
});
|
|
181
124
|
const CodeEmbedItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
|
|
@@ -190,21 +133,9 @@ const CodeEmbedItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
|
|
|
190
133
|
from: zod_1.z.number(),
|
|
191
134
|
to: zod_1.z.number().optional()
|
|
192
135
|
}).nullable()),
|
|
193
|
-
layoutParams: zod_1.z.record(
|
|
194
|
-
areaAnchor: zod_1.z.nativeEnum(ItemArea_1.AreaAnchor),
|
|
195
|
-
opacity: zod_1.z.number().nonnegative(),
|
|
196
|
-
blur: zod_1.z.number(),
|
|
197
|
-
isDraggable: zod_1.z.boolean().optional(),
|
|
198
|
-
blendMode: zod_1.z.string().optional()
|
|
199
|
-
})),
|
|
136
|
+
layoutParams: zod_1.z.record(ElementLayoutParams_schema_1.CodeEmbedLayoutParamsSchema),
|
|
200
137
|
state: zod_1.z.record(ItemState_schema_1.CodeEmbedStateParamsSchema)
|
|
201
138
|
});
|
|
202
|
-
exports.ComponentItemLayoutParamsSchema = zod_1.z.object({
|
|
203
|
-
opacity: zod_1.z.number().nonnegative(),
|
|
204
|
-
blur: zod_1.z.number(),
|
|
205
|
-
parameters: zod_1.z.any().optional(),
|
|
206
|
-
blendMode: zod_1.z.string().optional(),
|
|
207
|
-
});
|
|
208
139
|
const ComponentItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
|
|
209
140
|
type: zod_1.z.literal(ArticleItemType_1.ArticleItemType.Component),
|
|
210
141
|
commonParams: zod_1.z.object({
|
|
@@ -216,7 +147,7 @@ const ComponentItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
|
|
|
216
147
|
from: zod_1.z.number(),
|
|
217
148
|
to: zod_1.z.number().optional()
|
|
218
149
|
}).nullable()),
|
|
219
|
-
layoutParams: zod_1.z.record(
|
|
150
|
+
layoutParams: zod_1.z.record(ElementLayoutParams_schema_1.ComponentItemLayoutParamsSchema),
|
|
220
151
|
state: zod_1.z.record(ItemState_schema_1.ComponentStateParamsSchema)
|
|
221
152
|
});
|
|
222
153
|
exports.ItemSchema = zod_1.z.lazy(() => zod_1.z.discriminatedUnion('type', [
|
|
@@ -239,12 +170,7 @@ exports.ItemSchema = zod_1.z.lazy(() => zod_1.z.discriminatedUnion('type', [
|
|
|
239
170
|
from: zod_1.z.number(),
|
|
240
171
|
to: zod_1.z.number().optional()
|
|
241
172
|
}).nullable()),
|
|
242
|
-
layoutParams: zod_1.z.record(
|
|
243
|
-
opacity: zod_1.z.number().nonnegative(),
|
|
244
|
-
blur: zod_1.z.number(),
|
|
245
|
-
isDraggable: zod_1.z.boolean().optional(),
|
|
246
|
-
blendMode: zod_1.z.string().optional()
|
|
247
|
-
})),
|
|
173
|
+
layoutParams: zod_1.z.record(ElementLayoutParams_schema_1.GroupLayoutParamsSchema),
|
|
248
174
|
state: zod_1.z.record(ItemState_schema_1.GroupStateParamsSchema)
|
|
249
175
|
}),
|
|
250
176
|
ItemBase_schema_1.ItemBaseSchema.extend({
|
|
@@ -258,11 +184,7 @@ exports.ItemSchema = zod_1.z.lazy(() => zod_1.z.discriminatedUnion('type', [
|
|
|
258
184
|
from: zod_1.z.number(),
|
|
259
185
|
to: zod_1.z.number().optional()
|
|
260
186
|
}).nullable()),
|
|
261
|
-
layoutParams: zod_1.z.record(
|
|
262
|
-
opacity: zod_1.z.number().nonnegative(),
|
|
263
|
-
isDraggable: zod_1.z.boolean().optional(),
|
|
264
|
-
blendMode: zod_1.z.string().optional()
|
|
265
|
-
})),
|
|
187
|
+
layoutParams: zod_1.z.record(ElementLayoutParams_schema_1.CompoundLayoutParamsSchema),
|
|
266
188
|
state: zod_1.z.record(ItemState_schema_1.CompoundStateParamsSchema)
|
|
267
189
|
})
|
|
268
190
|
]));
|
|
@@ -13,8 +13,8 @@ export declare const ItemAreaSchema: z.ZodObject<{
|
|
|
13
13
|
dimensionsType: z.ZodOptional<z.ZodNativeEnum<typeof DimensionsType>>;
|
|
14
14
|
scaleAnchor: z.ZodNativeEnum<typeof AreaAnchor>;
|
|
15
15
|
}, "strip", z.ZodTypeAny, {
|
|
16
|
-
left: number;
|
|
17
16
|
top: number;
|
|
17
|
+
left: number;
|
|
18
18
|
scale: number;
|
|
19
19
|
angle: number;
|
|
20
20
|
width: number;
|
|
@@ -25,8 +25,8 @@ export declare const ItemAreaSchema: z.ZodObject<{
|
|
|
25
25
|
anchorSide?: AnchorSide | undefined;
|
|
26
26
|
dimensionsType?: DimensionsType | undefined;
|
|
27
27
|
}, {
|
|
28
|
-
left: number;
|
|
29
28
|
top: number;
|
|
29
|
+
left: number;
|
|
30
30
|
scale: number;
|
|
31
31
|
angle: number;
|
|
32
32
|
width: number;
|
|
@@ -38,8 +38,8 @@ export declare const ItemBaseSchema: z.ZodObject<{
|
|
|
38
38
|
dimensionsType: z.ZodOptional<z.ZodNativeEnum<typeof import("../../types/article/ItemArea").DimensionsType>>;
|
|
39
39
|
scaleAnchor: z.ZodNativeEnum<typeof AreaAnchor>;
|
|
40
40
|
}, "strip", z.ZodTypeAny, {
|
|
41
|
-
left: number;
|
|
42
41
|
top: number;
|
|
42
|
+
left: number;
|
|
43
43
|
scale: number;
|
|
44
44
|
angle: number;
|
|
45
45
|
width: number;
|
|
@@ -50,8 +50,8 @@ export declare const ItemBaseSchema: z.ZodObject<{
|
|
|
50
50
|
anchorSide?: import("../../types/article/ItemArea").AnchorSide | undefined;
|
|
51
51
|
dimensionsType?: import("../../types/article/ItemArea").DimensionsType | undefined;
|
|
52
52
|
}, {
|
|
53
|
-
left: number;
|
|
54
53
|
top: number;
|
|
54
|
+
left: number;
|
|
55
55
|
scale: number;
|
|
56
56
|
angle: number;
|
|
57
57
|
width: number;
|
|
@@ -91,8 +91,8 @@ export declare const ItemBaseSchema: z.ZodObject<{
|
|
|
91
91
|
hidden: Record<string, boolean>;
|
|
92
92
|
id: string;
|
|
93
93
|
area: Record<string, {
|
|
94
|
-
left: number;
|
|
95
94
|
top: number;
|
|
95
|
+
left: number;
|
|
96
96
|
scale: number;
|
|
97
97
|
angle: number;
|
|
98
98
|
width: number;
|
|
@@ -117,8 +117,8 @@ export declare const ItemBaseSchema: z.ZodObject<{
|
|
|
117
117
|
hidden: Record<string, boolean>;
|
|
118
118
|
id: string;
|
|
119
119
|
area: Record<string, {
|
|
120
|
-
left: number;
|
|
121
120
|
top: number;
|
|
121
|
+
left: number;
|
|
122
122
|
scale: number;
|
|
123
123
|
angle: number;
|
|
124
124
|
width: number;
|
|
@@ -60,8 +60,8 @@ export declare const RichTextItemSchema: z.ZodObject<{
|
|
|
60
60
|
dimensionsType: z.ZodOptional<z.ZodNativeEnum<typeof import("../..").DimensionsType>>;
|
|
61
61
|
scaleAnchor: z.ZodNativeEnum<typeof import("../..").AreaAnchor>;
|
|
62
62
|
}, "strip", z.ZodTypeAny, {
|
|
63
|
-
left: number;
|
|
64
63
|
top: number;
|
|
64
|
+
left: number;
|
|
65
65
|
scale: number;
|
|
66
66
|
angle: number;
|
|
67
67
|
width: number;
|
|
@@ -72,8 +72,8 @@ export declare const RichTextItemSchema: z.ZodObject<{
|
|
|
72
72
|
anchorSide?: import("../..").AnchorSide | undefined;
|
|
73
73
|
dimensionsType?: import("../..").DimensionsType | undefined;
|
|
74
74
|
}, {
|
|
75
|
-
left: number;
|
|
76
75
|
top: number;
|
|
76
|
+
left: number;
|
|
77
77
|
scale: number;
|
|
78
78
|
angle: number;
|
|
79
79
|
width: number;
|
|
@@ -1000,8 +1000,8 @@ export declare const RichTextItemSchema: z.ZodObject<{
|
|
|
1000
1000
|
id: string;
|
|
1001
1001
|
type: ArticleItemType.RichText;
|
|
1002
1002
|
area: Record<string, {
|
|
1003
|
-
left: number;
|
|
1004
1003
|
top: number;
|
|
1004
|
+
left: number;
|
|
1005
1005
|
scale: number;
|
|
1006
1006
|
angle: number;
|
|
1007
1007
|
width: number;
|
|
@@ -1191,8 +1191,8 @@ export declare const RichTextItemSchema: z.ZodObject<{
|
|
|
1191
1191
|
id: string;
|
|
1192
1192
|
type: ArticleItemType.RichText;
|
|
1193
1193
|
area: Record<string, {
|
|
1194
|
-
left: number;
|
|
1195
1194
|
top: number;
|
|
1195
|
+
left: number;
|
|
1196
1196
|
scale: number;
|
|
1197
1197
|
angle: number;
|
|
1198
1198
|
width: number;
|
|
@@ -7,6 +7,7 @@ const Item_schema_1 = require("./Item.schema");
|
|
|
7
7
|
const FillLayer_schema_1 = require("./FillLayer.schema");
|
|
8
8
|
const StructuredBlockType_1 = require("../../types/article/StructuredBlockType");
|
|
9
9
|
const ItemState_schema_1 = require("./ItemState.schema");
|
|
10
|
+
const ElementLayoutParams_schema_1 = require("./ElementLayoutParams.schema");
|
|
10
11
|
exports.StructuredBlockAreaSchema = zod_1.z.object({
|
|
11
12
|
width: zod_1.z.number().nonnegative().optional(),
|
|
12
13
|
height: zod_1.z.number().nonnegative().optional(),
|
|
@@ -60,7 +61,7 @@ const StructuredBlockBaseSchema = zod_1.z.object({
|
|
|
60
61
|
const ComponentStructuredBlockSchema = StructuredBlockBaseSchema.extend({
|
|
61
62
|
type: zod_1.z.literal(StructuredBlockType_1.StructuredBlockType.Component),
|
|
62
63
|
commonParams: exports.StructuredBlockComponentCommonParamsSchema,
|
|
63
|
-
layoutParams: zod_1.z.record(
|
|
64
|
+
layoutParams: zod_1.z.record(ElementLayoutParams_schema_1.ComponentItemLayoutParamsSchema),
|
|
64
65
|
state: zod_1.z.record(ItemState_schema_1.ComponentBlockStateParamsSchema)
|
|
65
66
|
});
|
|
66
67
|
const RichTextStructuredBlockSchema = StructuredBlockBaseSchema.extend({
|
|
@@ -83,7 +84,7 @@ const VimeoEmbedStructuredBlockSchema = StructuredBlockBaseSchema.extend({
|
|
|
83
84
|
ratioLock: zod_1.z.boolean(),
|
|
84
85
|
pointerEvents
|
|
85
86
|
}),
|
|
86
|
-
layoutParams: zod_1.z.record(
|
|
87
|
+
layoutParams: zod_1.z.record(ElementLayoutParams_schema_1.VimeoEmbedLayoutParamsSchema),
|
|
87
88
|
state: zod_1.z.record(ItemState_schema_1.VideoEmbedBlockStateParamsSchema)
|
|
88
89
|
});
|
|
89
90
|
const YoutubeEmbedStructuredBlockSchema = StructuredBlockBaseSchema.extend({
|
|
@@ -94,7 +95,7 @@ const YoutubeEmbedStructuredBlockSchema = StructuredBlockBaseSchema.extend({
|
|
|
94
95
|
ratioLock: zod_1.z.boolean(),
|
|
95
96
|
pointerEvents
|
|
96
97
|
}),
|
|
97
|
-
layoutParams: zod_1.z.record(
|
|
98
|
+
layoutParams: zod_1.z.record(ElementLayoutParams_schema_1.YoutubeEmbedLayoutParamsSchema),
|
|
98
99
|
state: zod_1.z.record(ItemState_schema_1.VideoEmbedBlockStateParamsSchema)
|
|
99
100
|
});
|
|
100
101
|
exports.StructuredBlockCommonParamsSchema = zod_1.z.union([
|
|
@@ -103,7 +104,7 @@ exports.StructuredBlockCommonParamsSchema = zod_1.z.union([
|
|
|
103
104
|
exports.StructuredBlockImageCommonParamsSchema
|
|
104
105
|
]);
|
|
105
106
|
exports.StructuredBlockLayoutParamsSchema = zod_1.z.union([
|
|
106
|
-
|
|
107
|
+
ElementLayoutParams_schema_1.ComponentItemLayoutParamsSchema,
|
|
107
108
|
exports.StructuredBlockRichTextLayoutParamsSchema,
|
|
108
109
|
exports.StructuredBlockImageLayoutParamsSchema
|
|
109
110
|
]);
|
|
@@ -46,18 +46,18 @@ export declare const KeyframeSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
|
|
|
46
46
|
top: z.ZodNumber;
|
|
47
47
|
left: z.ZodNumber;
|
|
48
48
|
}, "strip", z.ZodTypeAny, {
|
|
49
|
-
left: number;
|
|
50
49
|
top: number;
|
|
51
|
-
}, {
|
|
52
50
|
left: number;
|
|
51
|
+
}, {
|
|
53
52
|
top: number;
|
|
53
|
+
left: number;
|
|
54
54
|
}>;
|
|
55
55
|
}, "strip", z.ZodTypeAny, {
|
|
56
56
|
position: number;
|
|
57
57
|
id: string;
|
|
58
58
|
value: {
|
|
59
|
-
left: number;
|
|
60
59
|
top: number;
|
|
60
|
+
left: number;
|
|
61
61
|
};
|
|
62
62
|
type: KeyframeType.Position;
|
|
63
63
|
itemId: string;
|
|
@@ -66,8 +66,8 @@ export declare const KeyframeSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
|
|
|
66
66
|
position: number;
|
|
67
67
|
id: string;
|
|
68
68
|
value: {
|
|
69
|
-
left: number;
|
|
70
69
|
top: number;
|
|
70
|
+
left: number;
|
|
71
71
|
};
|
|
72
72
|
type: KeyframeType.Position;
|
|
73
73
|
itemId: string;
|
|
@@ -980,18 +980,18 @@ export declare const KeyframesSchema: z.ZodArray<z.ZodDiscriminatedUnion<"type",
|
|
|
980
980
|
top: z.ZodNumber;
|
|
981
981
|
left: z.ZodNumber;
|
|
982
982
|
}, "strip", z.ZodTypeAny, {
|
|
983
|
-
left: number;
|
|
984
983
|
top: number;
|
|
985
|
-
}, {
|
|
986
984
|
left: number;
|
|
985
|
+
}, {
|
|
987
986
|
top: number;
|
|
987
|
+
left: number;
|
|
988
988
|
}>;
|
|
989
989
|
}, "strip", z.ZodTypeAny, {
|
|
990
990
|
position: number;
|
|
991
991
|
id: string;
|
|
992
992
|
value: {
|
|
993
|
-
left: number;
|
|
994
993
|
top: number;
|
|
994
|
+
left: number;
|
|
995
995
|
};
|
|
996
996
|
type: KeyframeType.Position;
|
|
997
997
|
itemId: string;
|
|
@@ -1000,8 +1000,8 @@ export declare const KeyframesSchema: z.ZodArray<z.ZodDiscriminatedUnion<"type",
|
|
|
1000
1000
|
position: number;
|
|
1001
1001
|
id: string;
|
|
1002
1002
|
value: {
|
|
1003
|
-
left: number;
|
|
1004
1003
|
top: number;
|
|
1004
|
+
left: number;
|
|
1005
1005
|
};
|
|
1006
1006
|
type: KeyframeType.Position;
|
|
1007
1007
|
itemId: string;
|