@gxpl/sdk 0.0.8 → 0.0.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/lib/index.d.ts +1 -4
- package/lib/index.js +1 -4
- package/lib/sdk/Client/Client.d.ts +0 -2
- package/lib/sdk/Client/Client.js +0 -11
- package/lib/sdk/schemas/article/Article.schema.d.ts +40 -45
- package/lib/sdk/schemas/article/Article.schema.js +1 -1
- package/lib/sdk/schemas/article/Item.schema.js +64 -84
- package/lib/sdk/schemas/article/ItemBase.schema.d.ts +15 -18
- package/lib/sdk/schemas/article/ItemBase.schema.js +3 -4
- package/lib/sdk/schemas/article/ItemState.schema.d.ts +76 -76
- package/lib/sdk/schemas/article/RichTextItem.schema.d.ts +78 -86
- package/lib/sdk/schemas/article/RichTextItem.schema.js +9 -11
- package/lib/sdk/schemas/article/Section.schema.d.ts +20 -23
- package/lib/sdk/schemas/article/Section.schema.js +4 -5
- package/lib/sdk/schemas/keyframe/Keyframes.schema.d.ts +0 -90
- package/lib/sdk/schemas/keyframe/Keyframes.schema.js +0 -1
- package/lib/sdk/schemas/project/Project.schema.d.ts +3 -28
- package/lib/sdk/schemas/project/Project.schema.js +1 -2
- package/lib/sdk/types/article/Article.d.ts +1 -1
- package/lib/sdk/types/article/Item.d.ts +75 -114
- package/lib/sdk/types/article/Section.d.ts +4 -5
- package/lib/sdk/types/keyframe/Keyframe.d.ts +0 -1
- package/lib/sdk/types/project/Project.d.ts +1 -2
- package/lib/sdk-nextjs/common/useExemplary.js +1 -5
- package/lib/sdk-nextjs/common/useItemFXData.js +1 -1
- package/lib/sdk-nextjs/common/useKeyframeValue.d.ts +1 -1
- package/lib/sdk-nextjs/common/useKeyframeValue.js +4 -7
- package/lib/sdk-nextjs/common/useLayoutDeviation.d.ts +5 -0
- package/lib/sdk-nextjs/common/useLayoutDeviation.js +20 -0
- package/lib/sdk-nextjs/components/ArticleWrapper.js +3 -4
- package/lib/sdk-nextjs/components/Section/Section.js +12 -31
- package/lib/sdk-nextjs/components/Section/useSectionHeightMap.d.ts +1 -3
- package/lib/sdk-nextjs/components/Section/useSectionHeightMap.js +1 -9
- package/lib/sdk-nextjs/components/items/CodeEmbedItem/CodeEmbedItem.js +16 -35
- package/lib/sdk-nextjs/components/items/CodeEmbedItem/useCodeEmbedItem.d.ts +2 -4
- package/lib/sdk-nextjs/components/items/CodeEmbedItem/useCodeEmbedItem.js +3 -17
- package/lib/sdk-nextjs/components/items/ComponentItem/ComponentItem.js +13 -23
- package/lib/sdk-nextjs/components/items/ComponentItem/useComponentItem.d.ts +2 -2
- package/lib/sdk-nextjs/components/items/ComponentItem/useComponentItem.js +2 -14
- package/lib/sdk-nextjs/components/items/CompoundItem/CompoundChild.js +40 -46
- package/lib/sdk-nextjs/components/items/CompoundItem/CompoundItem.js +8 -14
- package/lib/sdk-nextjs/components/items/CompoundItem/useCompoundItem.d.ts +1 -1
- package/lib/sdk-nextjs/components/items/CompoundItem/useCompoundItem.js +1 -8
- package/lib/sdk-nextjs/components/items/CustomItem/CustomItem.js +11 -16
- package/lib/sdk-nextjs/components/items/EmbedVideoItem/VimeoEmbed.js +28 -37
- package/lib/sdk-nextjs/components/items/EmbedVideoItem/YoutubeEmbed.js +17 -29
- package/lib/sdk-nextjs/components/items/EmbedVideoItem/useEmbedVideoItem.d.ts +3 -3
- package/lib/sdk-nextjs/components/items/EmbedVideoItem/useEmbedVideoItem.js +3 -20
- package/lib/sdk-nextjs/components/items/FileItem/ImageItem.js +48 -54
- package/lib/sdk-nextjs/components/items/FileItem/VideoItem.js +53 -64
- package/lib/sdk-nextjs/components/items/FileItem/useFileItem.d.ts +6 -6
- package/lib/sdk-nextjs/components/items/FileItem/useFileItem.js +5 -32
- package/lib/sdk-nextjs/components/items/GroupItem/GroupItem.js +3 -13
- package/lib/sdk-nextjs/components/items/GroupItem/useGroupItem.d.ts +2 -2
- package/lib/sdk-nextjs/components/items/GroupItem/useGroupItem.js +2 -14
- package/lib/sdk-nextjs/components/items/Item.js +23 -48
- package/lib/sdk-nextjs/components/items/RectangleItem/RectangleItem.js +19 -29
- package/lib/sdk-nextjs/components/items/RectangleItem/useRectangleItem.d.ts +6 -6
- package/lib/sdk-nextjs/components/items/RectangleItem/useRectangleItem.js +6 -38
- package/lib/sdk-nextjs/components/items/RichTextItem/RichTextItem.js +23 -31
- package/lib/sdk-nextjs/components/items/RichTextItem/useRichTextItem.js +2 -2
- package/lib/sdk-nextjs/components/items/useItemAngle.d.ts +1 -1
- package/lib/sdk-nextjs/components/items/useItemAngle.js +1 -1
- package/lib/sdk-nextjs/components/items/useItemArea.d.ts +4 -4
- package/lib/sdk-nextjs/components/items/useItemArea.js +2 -8
- package/lib/sdk-nextjs/components/items/useItemScale.d.ts +1 -1
- package/lib/sdk-nextjs/components/items/useItemScale.js +1 -3
- package/lib/sdk-nextjs/components/items/useRichTextItemValues.d.ts +6 -6
- package/lib/sdk-nextjs/components/items/useRichTextItemValues.js +6 -28
- package/lib/sdk-nextjs/components/items/useSizing.js +2 -4
- package/lib/sdk-nextjs/components/items/useStickyItemTop.js +3 -9
- package/lib/sdk-nextjs/interactions/InteractionsRegistry.d.ts +1 -1
- package/lib/sdk-nextjs/interactions/InteractionsRegistry.js +2 -2
- package/lib/sdk-nextjs/provider/CntrlSdkContext.d.ts +5 -6
- package/lib/sdk-nextjs/provider/CntrlSdkContext.js +6 -6
- package/lib/sdk-nextjs/provider/InteractionsContext.js +2 -6
- package/lib/sdk-nextjs/utils/RichTextConverter/RichTextConverter.d.ts +1 -2
- package/lib/sdk-nextjs/utils/RichTextConverter/RichTextConverter.js +37 -62
- package/lib/sdk-nextjs/utils/getStyleFromItemStateAndParams.d.ts +1 -1
- package/package.json +1 -1
- package/lib/cli.d.ts +0 -10
- package/lib/cli.js +0 -64
- package/lib/sdk/schemas/project/Layout.schema.d.ts +0 -17
- package/lib/sdk/schemas/project/Layout.schema.js +0 -10
- package/lib/sdk/types/component/Component.d.ts +0 -15
- package/lib/sdk/types/component/Component.js +0 -2
- package/lib/sdk/types/project/Layout.d.ts +0 -6
- package/lib/sdk/types/project/Layout.js +0 -2
- package/lib/sdk-nextjs/common/useCurrentLayout.d.ts +0 -6
- package/lib/sdk-nextjs/common/useCurrentLayout.js +0 -42
- package/lib/sdk-nextjs/components/useLayoutContext.d.ts +0 -1
- package/lib/sdk-nextjs/components/useLayoutContext.js +0 -9
- package/lib/sdk-nextjs/provider/LayoutContext.d.ts +0 -1
- package/lib/sdk-nextjs/provider/LayoutContext.js +0 -5
- package/lib/utils.d.ts +0 -3
- package/lib/utils.js +0 -30
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { Client as CntrlClient } from './sdk/Client/Client';
|
|
2
2
|
export { FontFaceGenerator } from './sdk/FontFaceGenerator/FontFaceGenerator';
|
|
3
|
-
export { getLayoutStyles, getLayoutMediaQuery } from './utils';
|
|
4
3
|
export { ScrollPlaybackVideoManager } from './sdk/ScrollPlaybackVideoManager/ScrollPlaybackVideoManager';
|
|
5
4
|
export { SectionHeightMode } from './sdk/types/article/Section';
|
|
6
5
|
export { TextAlign, TextDecoration, TextTransform, VerticalAlign } from './sdk/types/article/RichText';
|
|
@@ -9,17 +8,15 @@ export { AreaAnchor, AnchorSide, DimensionMode, PositionType } from './sdk/types
|
|
|
9
8
|
export { KeyframeType } from './sdk/types/keyframe/Keyframe';
|
|
10
9
|
export type { Article } from './sdk/types/article/Article';
|
|
11
10
|
export type { Section, SectionHeight } from './sdk/types/article/Section';
|
|
12
|
-
export type { Item, ImageItem, ItemAny, CustomItem,
|
|
11
|
+
export type { Item, ImageItem, ItemAny, CustomItem, ItemParamsMap, RectangleItem, StickyParams, VideoItem, RichTextItem, Link, VimeoEmbedItem, YoutubeEmbedItem, GroupItem, CodeEmbedItem, CompoundItem, ComponentItem, FillLayer } from './sdk/types/article/Item';
|
|
13
12
|
export type { RichTextBlock, RichTextEntity, RichTextStyle } from './sdk/types/article/RichText';
|
|
14
13
|
export type { ItemArea } from './sdk/types/article/ItemArea';
|
|
15
14
|
export type { ItemState, ItemStateParams, StateParams, ItemStatesMap } from './sdk/types/article/ItemState';
|
|
16
15
|
export type { Interaction, InteractionItemTrigger, InteractionScrollTrigger, InteractionState } from './sdk/types/article/Interaction';
|
|
17
|
-
export type { Layout } from './sdk/types/project/Layout';
|
|
18
16
|
export type { Project } from './sdk/types/project/Project';
|
|
19
17
|
export type { Meta } from './sdk/types/project/Meta';
|
|
20
18
|
export type { KeyframeValueMap, KeyframeAny } from './sdk/types/keyframe/Keyframe';
|
|
21
19
|
export type { CompoundSettings } from './sdk/types/article/CompoundSettings';
|
|
22
|
-
export type { Component } from './sdk/types/component/Component';
|
|
23
20
|
export { RichTextConverter } from './sdk-nextjs/utils/RichTextConverter/RichTextConverter';
|
|
24
21
|
export { Page } from './sdk-nextjs/components/Page';
|
|
25
22
|
export type { PageProps } from './sdk-nextjs/components/Page';
|
package/lib/index.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cntrlSdkContext = exports.customSections = exports.customItems = exports.useCntrlContext = exports.CntrlProvider = exports.Head = exports.Page = exports.RichTextConverter = exports.KeyframeType = exports.PositionType = exports.DimensionMode = exports.AnchorSide = exports.AreaAnchor = exports.ArticleItemType = exports.VerticalAlign = exports.TextTransform = exports.TextDecoration = exports.TextAlign = exports.SectionHeightMode = exports.ScrollPlaybackVideoManager = exports.
|
|
3
|
+
exports.cntrlSdkContext = exports.customSections = exports.customItems = exports.useCntrlContext = exports.CntrlProvider = exports.Head = exports.Page = exports.RichTextConverter = exports.KeyframeType = exports.PositionType = exports.DimensionMode = exports.AnchorSide = exports.AreaAnchor = exports.ArticleItemType = exports.VerticalAlign = exports.TextTransform = exports.TextDecoration = exports.TextAlign = exports.SectionHeightMode = exports.ScrollPlaybackVideoManager = exports.FontFaceGenerator = exports.CntrlClient = void 0;
|
|
4
4
|
// SDK
|
|
5
5
|
var Client_1 = require("./sdk/Client/Client");
|
|
6
6
|
Object.defineProperty(exports, "CntrlClient", { enumerable: true, get: function () { return Client_1.Client; } });
|
|
7
7
|
var FontFaceGenerator_1 = require("./sdk/FontFaceGenerator/FontFaceGenerator");
|
|
8
8
|
Object.defineProperty(exports, "FontFaceGenerator", { enumerable: true, get: function () { return FontFaceGenerator_1.FontFaceGenerator; } });
|
|
9
|
-
var utils_1 = require("./utils");
|
|
10
|
-
Object.defineProperty(exports, "getLayoutStyles", { enumerable: true, get: function () { return utils_1.getLayoutStyles; } });
|
|
11
|
-
Object.defineProperty(exports, "getLayoutMediaQuery", { enumerable: true, get: function () { return utils_1.getLayoutMediaQuery; } });
|
|
12
9
|
var ScrollPlaybackVideoManager_1 = require("./sdk/ScrollPlaybackVideoManager/ScrollPlaybackVideoManager");
|
|
13
10
|
Object.defineProperty(exports, "ScrollPlaybackVideoManager", { enumerable: true, get: function () { return ScrollPlaybackVideoManager_1.ScrollPlaybackVideoManager; } });
|
|
14
11
|
// enums
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Meta } from '../types/project/Meta';
|
|
2
2
|
import { Project } from '../types/project/Project';
|
|
3
|
-
import { Layout } from '../types/project/Layout';
|
|
4
3
|
import { Article } from '../types/article/Article';
|
|
5
4
|
import { KeyframeAny } from '../types/keyframe/Keyframe';
|
|
6
5
|
export declare class Client {
|
|
@@ -10,7 +9,6 @@ export declare class Client {
|
|
|
10
9
|
private static getPageMeta;
|
|
11
10
|
getPageData(pageSlug: string, buildMode?: 'default' | 'self-hosted'): Promise<CntrlPageData>;
|
|
12
11
|
getProjectPagesPaths(): Promise<string[]>;
|
|
13
|
-
getLayouts(): Promise<Layout[]>;
|
|
14
12
|
private fetchProject;
|
|
15
13
|
private fetchArticle;
|
|
16
14
|
private findArticleIdByPageSlug;
|
package/lib/sdk/Client/Client.js
CHANGED
|
@@ -70,17 +70,6 @@ class Client {
|
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
-
getLayouts() {
|
|
74
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
-
try {
|
|
76
|
-
const { layouts } = yield this.fetchProject();
|
|
77
|
-
return layouts;
|
|
78
|
-
}
|
|
79
|
-
catch (e) {
|
|
80
|
-
throw e;
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
73
|
fetchProject() {
|
|
85
74
|
return __awaiter(this, arguments, void 0, function* (buildMode = 'default') {
|
|
86
75
|
const { username: projectId, password: apiKey, origin } = this.url;
|
|
@@ -5,7 +5,7 @@ export declare const ArticleSchema: z.ZodObject<{
|
|
|
5
5
|
id: z.ZodString;
|
|
6
6
|
items: z.ZodArray<z.ZodType<import("../../..").ItemAny, z.ZodTypeDef, import("../../..").ItemAny>, "many">;
|
|
7
7
|
name: z.ZodOptional<z.ZodString>;
|
|
8
|
-
height: z.
|
|
8
|
+
height: z.ZodObject<{
|
|
9
9
|
mode: z.ZodNativeEnum<typeof import("../../..").SectionHeightMode>;
|
|
10
10
|
units: z.ZodNumber;
|
|
11
11
|
vhUnits: z.ZodOptional<z.ZodNumber>;
|
|
@@ -17,11 +17,10 @@ export declare const ArticleSchema: z.ZodObject<{
|
|
|
17
17
|
mode: import("../../..").SectionHeightMode;
|
|
18
18
|
units: number;
|
|
19
19
|
vhUnits?: number | undefined;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
media: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
20
|
+
}>;
|
|
21
|
+
hidden: z.ZodBoolean;
|
|
22
|
+
color: z.ZodNullable<z.ZodString>;
|
|
23
|
+
media: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
25
24
|
url: z.ZodString;
|
|
26
25
|
size: z.ZodString;
|
|
27
26
|
type: z.ZodLiteral<"video">;
|
|
@@ -63,20 +62,18 @@ export declare const ArticleSchema: z.ZodObject<{
|
|
|
63
62
|
type: "image";
|
|
64
63
|
size: string;
|
|
65
64
|
offsetX: number | null;
|
|
66
|
-
}>]
|
|
65
|
+
}>]>;
|
|
67
66
|
}, "strip", z.ZodTypeAny, {
|
|
68
|
-
color:
|
|
69
|
-
hidden:
|
|
70
|
-
position: Record<string, number>;
|
|
67
|
+
color: string | null;
|
|
68
|
+
hidden: boolean;
|
|
71
69
|
id: string;
|
|
72
|
-
height:
|
|
70
|
+
height: {
|
|
73
71
|
mode: import("../../..").SectionHeightMode;
|
|
74
72
|
units: number;
|
|
75
73
|
vhUnits?: number | undefined;
|
|
76
|
-
}
|
|
74
|
+
};
|
|
77
75
|
items: import("../../..").ItemAny[];
|
|
78
|
-
|
|
79
|
-
media?: Record<string, {
|
|
76
|
+
media: {
|
|
80
77
|
url: string;
|
|
81
78
|
coverUrl: string | null;
|
|
82
79
|
play: "on-click" | "auto";
|
|
@@ -90,20 +87,19 @@ export declare const ArticleSchema: z.ZodObject<{
|
|
|
90
87
|
type: "image";
|
|
91
88
|
size: string;
|
|
92
89
|
offsetX: number | null;
|
|
93
|
-
}
|
|
90
|
+
};
|
|
91
|
+
name?: string | undefined;
|
|
94
92
|
}, {
|
|
95
|
-
color:
|
|
96
|
-
hidden:
|
|
97
|
-
position: Record<string, number>;
|
|
93
|
+
color: string | null;
|
|
94
|
+
hidden: boolean;
|
|
98
95
|
id: string;
|
|
99
|
-
height:
|
|
96
|
+
height: {
|
|
100
97
|
mode: import("../../..").SectionHeightMode;
|
|
101
98
|
units: number;
|
|
102
99
|
vhUnits?: number | undefined;
|
|
103
|
-
}
|
|
100
|
+
};
|
|
104
101
|
items: import("../../..").ItemAny[];
|
|
105
|
-
|
|
106
|
-
media?: Record<string, {
|
|
102
|
+
media: {
|
|
107
103
|
url: string;
|
|
108
104
|
coverUrl: string | null;
|
|
109
105
|
play: "on-click" | "auto";
|
|
@@ -117,9 +113,10 @@ export declare const ArticleSchema: z.ZodObject<{
|
|
|
117
113
|
type: "image";
|
|
118
114
|
size: string;
|
|
119
115
|
offsetX: number | null;
|
|
120
|
-
}
|
|
116
|
+
};
|
|
117
|
+
name?: string | undefined;
|
|
121
118
|
}>, "many">;
|
|
122
|
-
interactions: z.
|
|
119
|
+
interactions: z.ZodArray<z.ZodObject<{
|
|
123
120
|
id: z.ZodString;
|
|
124
121
|
triggers: z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
125
122
|
itemId: z.ZodString;
|
|
@@ -220,22 +217,20 @@ export declare const ArticleSchema: z.ZodObject<{
|
|
|
220
217
|
}[] | undefined;
|
|
221
218
|
}[];
|
|
222
219
|
startStateId: string;
|
|
223
|
-
}>, "many"
|
|
220
|
+
}>, "many">;
|
|
224
221
|
}, "strip", z.ZodTypeAny, {
|
|
225
222
|
id: string;
|
|
226
223
|
sections: {
|
|
227
|
-
color:
|
|
228
|
-
hidden:
|
|
229
|
-
position: Record<string, number>;
|
|
224
|
+
color: string | null;
|
|
225
|
+
hidden: boolean;
|
|
230
226
|
id: string;
|
|
231
|
-
height:
|
|
227
|
+
height: {
|
|
232
228
|
mode: import("../../..").SectionHeightMode;
|
|
233
229
|
units: number;
|
|
234
230
|
vhUnits?: number | undefined;
|
|
235
|
-
}
|
|
231
|
+
};
|
|
236
232
|
items: import("../../..").ItemAny[];
|
|
237
|
-
|
|
238
|
-
media?: Record<string, {
|
|
233
|
+
media: {
|
|
239
234
|
url: string;
|
|
240
235
|
coverUrl: string | null;
|
|
241
236
|
play: "on-click" | "auto";
|
|
@@ -249,9 +244,10 @@ export declare const ArticleSchema: z.ZodObject<{
|
|
|
249
244
|
type: "image";
|
|
250
245
|
size: string;
|
|
251
246
|
offsetX: number | null;
|
|
252
|
-
}
|
|
247
|
+
};
|
|
248
|
+
name?: string | undefined;
|
|
253
249
|
}[];
|
|
254
|
-
interactions:
|
|
250
|
+
interactions: {
|
|
255
251
|
id: string;
|
|
256
252
|
triggers: ({
|
|
257
253
|
type: "hover-in" | "hover-out" | "click";
|
|
@@ -272,22 +268,20 @@ export declare const ArticleSchema: z.ZodObject<{
|
|
|
272
268
|
}[] | undefined;
|
|
273
269
|
}[];
|
|
274
270
|
startStateId: string;
|
|
275
|
-
}[]
|
|
271
|
+
}[];
|
|
276
272
|
}, {
|
|
277
273
|
id: string;
|
|
278
274
|
sections: {
|
|
279
|
-
color:
|
|
280
|
-
hidden:
|
|
281
|
-
position: Record<string, number>;
|
|
275
|
+
color: string | null;
|
|
276
|
+
hidden: boolean;
|
|
282
277
|
id: string;
|
|
283
|
-
height:
|
|
278
|
+
height: {
|
|
284
279
|
mode: import("../../..").SectionHeightMode;
|
|
285
280
|
units: number;
|
|
286
281
|
vhUnits?: number | undefined;
|
|
287
|
-
}
|
|
282
|
+
};
|
|
288
283
|
items: import("../../..").ItemAny[];
|
|
289
|
-
|
|
290
|
-
media?: Record<string, {
|
|
284
|
+
media: {
|
|
291
285
|
url: string;
|
|
292
286
|
coverUrl: string | null;
|
|
293
287
|
play: "on-click" | "auto";
|
|
@@ -301,9 +295,10 @@ export declare const ArticleSchema: z.ZodObject<{
|
|
|
301
295
|
type: "image";
|
|
302
296
|
size: string;
|
|
303
297
|
offsetX: number | null;
|
|
304
|
-
}
|
|
298
|
+
};
|
|
299
|
+
name?: string | undefined;
|
|
305
300
|
}[];
|
|
306
|
-
interactions:
|
|
301
|
+
interactions: {
|
|
307
302
|
id: string;
|
|
308
303
|
triggers: ({
|
|
309
304
|
type: "hover-in" | "hover-out" | "click";
|
|
@@ -324,5 +319,5 @@ export declare const ArticleSchema: z.ZodObject<{
|
|
|
324
319
|
}[] | undefined;
|
|
325
320
|
}[];
|
|
326
321
|
startStateId: string;
|
|
327
|
-
}[]
|
|
322
|
+
}[];
|
|
328
323
|
}>;
|
|
@@ -7,5 +7,5 @@ const Interaction_schema_1 = require("./Interaction.schema");
|
|
|
7
7
|
exports.ArticleSchema = zod_1.z.object({
|
|
8
8
|
id: zod_1.z.string().min(1),
|
|
9
9
|
sections: zod_1.z.array(Section_schema_1.SectionSchema),
|
|
10
|
-
interactions: zod_1.z.
|
|
10
|
+
interactions: zod_1.z.array(Interaction_schema_1.InteractionSchema)
|
|
11
11
|
});
|
|
@@ -34,34 +34,26 @@ const FXParams = zod_1.z.object({
|
|
|
34
34
|
});
|
|
35
35
|
const ImageItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
|
|
36
36
|
type: zod_1.z.literal(ArticleItemType_1.ArticleItemType.Image),
|
|
37
|
-
|
|
38
|
-
pointerEvents
|
|
39
|
-
}).merge(FXParams),
|
|
40
|
-
sticky: zod_1.z.record(zod_1.z.object({
|
|
41
|
-
from: zod_1.z.number(),
|
|
42
|
-
to: zod_1.z.number().optional()
|
|
43
|
-
}).nullable()),
|
|
44
|
-
layoutParams: zod_1.z.record(zod_1.z.object({
|
|
37
|
+
params: zod_1.z.object({
|
|
38
|
+
pointerEvents,
|
|
45
39
|
opacity: zod_1.z.number().nonnegative(),
|
|
46
40
|
radius: zod_1.z.number(),
|
|
47
41
|
strokeWidth: zod_1.z.number(),
|
|
48
42
|
strokeFill: zod_1.z.array(FillLayer_schema_1.FillLayerSchema),
|
|
49
43
|
blur: zod_1.z.number(),
|
|
50
44
|
isDraggable: zod_1.z.boolean().optional()
|
|
51
|
-
})),
|
|
45
|
+
}).merge(FXParams),
|
|
46
|
+
sticky: zod_1.z.object({
|
|
47
|
+
from: zod_1.z.number(),
|
|
48
|
+
to: zod_1.z.number().optional()
|
|
49
|
+
}).nullable(),
|
|
52
50
|
state: zod_1.z.record(ItemState_schema_1.MediaStateParamsSchema)
|
|
53
51
|
});
|
|
54
52
|
const VideoItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
|
|
55
53
|
type: zod_1.z.literal(ArticleItemType_1.ArticleItemType.Video),
|
|
56
|
-
|
|
54
|
+
params: zod_1.z.object({
|
|
57
55
|
coverUrl: zod_1.z.string().nullable(),
|
|
58
|
-
pointerEvents
|
|
59
|
-
}).merge(FXParams),
|
|
60
|
-
sticky: zod_1.z.record(zod_1.z.object({
|
|
61
|
-
from: zod_1.z.number(),
|
|
62
|
-
to: zod_1.z.number().optional()
|
|
63
|
-
}).nullable()),
|
|
64
|
-
layoutParams: zod_1.z.record(zod_1.z.object({
|
|
56
|
+
pointerEvents,
|
|
65
57
|
scrollPlayback: zod_1.z.object({
|
|
66
58
|
from: zod_1.z.number(),
|
|
67
59
|
to: zod_1.z.number()
|
|
@@ -75,20 +67,18 @@ const VideoItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
|
|
|
75
67
|
play: zod_1.z.enum(['on-hover', 'on-click', 'auto']),
|
|
76
68
|
muted: zod_1.z.boolean(),
|
|
77
69
|
controls: zod_1.z.boolean(),
|
|
78
|
-
})),
|
|
70
|
+
}).merge(FXParams),
|
|
71
|
+
sticky: zod_1.z.object({
|
|
72
|
+
from: zod_1.z.number(),
|
|
73
|
+
to: zod_1.z.number().optional()
|
|
74
|
+
}).nullable(),
|
|
79
75
|
state: 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),
|
|
83
|
-
|
|
79
|
+
params: zod_1.z.object({
|
|
84
80
|
ratioLock: zod_1.z.boolean(),
|
|
85
|
-
pointerEvents
|
|
86
|
-
}),
|
|
87
|
-
sticky: zod_1.z.record(zod_1.z.object({
|
|
88
|
-
from: zod_1.z.number(),
|
|
89
|
-
to: zod_1.z.number().optional()
|
|
90
|
-
}).nullable()),
|
|
91
|
-
layoutParams: zod_1.z.record(zod_1.z.object({
|
|
81
|
+
pointerEvents,
|
|
92
82
|
radius: zod_1.z.number(),
|
|
93
83
|
strokeWidth: zod_1.z.number(),
|
|
94
84
|
fill: zod_1.z.array(FillLayer_schema_1.FillLayerSchema),
|
|
@@ -97,37 +87,33 @@ const RectangleItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
|
|
|
97
87
|
backdropBlur: zod_1.z.number(),
|
|
98
88
|
blurMode: zod_1.z.enum(['default', 'backdrop']),
|
|
99
89
|
isDraggable: zod_1.z.boolean().optional()
|
|
100
|
-
})
|
|
90
|
+
}),
|
|
91
|
+
sticky: zod_1.z.object({
|
|
92
|
+
from: zod_1.z.number(),
|
|
93
|
+
to: zod_1.z.number().optional()
|
|
94
|
+
}).nullable(),
|
|
101
95
|
state: 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),
|
|
105
|
-
|
|
99
|
+
params: zod_1.z.object({
|
|
106
100
|
name: zod_1.z.string(),
|
|
107
|
-
pointerEvents
|
|
101
|
+
pointerEvents,
|
|
102
|
+
isDraggable: zod_1.z.boolean().optional()
|
|
108
103
|
}),
|
|
109
|
-
sticky: zod_1.z.
|
|
104
|
+
sticky: zod_1.z.object({
|
|
110
105
|
from: zod_1.z.number(),
|
|
111
106
|
to: zod_1.z.number().optional()
|
|
112
|
-
}).nullable()
|
|
113
|
-
layoutParams: zod_1.z.record(zod_1.z.object({
|
|
114
|
-
isDraggable: zod_1.z.boolean().optional()
|
|
115
|
-
})),
|
|
107
|
+
}).nullable(),
|
|
116
108
|
state: zod_1.z.record(ItemState_schema_1.CustomItemStateParamsSchema)
|
|
117
109
|
});
|
|
118
110
|
const VimeoEmbedItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
|
|
119
111
|
type: zod_1.z.literal(ArticleItemType_1.ArticleItemType.VimeoEmbed),
|
|
120
|
-
|
|
112
|
+
params: zod_1.z.object({
|
|
121
113
|
url: zod_1.z.string().min(1),
|
|
122
114
|
coverUrl: zod_1.z.string().nullable(),
|
|
123
115
|
ratioLock: zod_1.z.boolean(),
|
|
124
|
-
pointerEvents
|
|
125
|
-
}),
|
|
126
|
-
sticky: zod_1.z.record(zod_1.z.object({
|
|
127
|
-
from: zod_1.z.number(),
|
|
128
|
-
to: zod_1.z.number().optional()
|
|
129
|
-
}).nullable()),
|
|
130
|
-
layoutParams: zod_1.z.record(zod_1.z.object({
|
|
116
|
+
pointerEvents,
|
|
131
117
|
radius: zod_1.z.number(),
|
|
132
118
|
blur: zod_1.z.number(),
|
|
133
119
|
opacity: zod_1.z.number().nonnegative(),
|
|
@@ -136,65 +122,63 @@ const VimeoEmbedItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
|
|
|
136
122
|
loop: zod_1.z.boolean(),
|
|
137
123
|
muted: zod_1.z.boolean(),
|
|
138
124
|
pictureInPicture: zod_1.z.boolean()
|
|
139
|
-
})
|
|
125
|
+
}),
|
|
126
|
+
sticky: zod_1.z.object({
|
|
127
|
+
from: zod_1.z.number(),
|
|
128
|
+
to: zod_1.z.number().optional()
|
|
129
|
+
}).nullable(),
|
|
140
130
|
state: 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),
|
|
144
|
-
|
|
134
|
+
params: zod_1.z.object({
|
|
145
135
|
url: zod_1.z.string().min(1),
|
|
146
136
|
coverUrl: zod_1.z.string().nullable(),
|
|
147
|
-
pointerEvents
|
|
148
|
-
}),
|
|
149
|
-
sticky: zod_1.z.record(zod_1.z.object({
|
|
150
|
-
from: zod_1.z.number(),
|
|
151
|
-
to: zod_1.z.number().optional()
|
|
152
|
-
}).nullable()),
|
|
153
|
-
layoutParams: zod_1.z.record(zod_1.z.object({
|
|
137
|
+
pointerEvents,
|
|
154
138
|
radius: zod_1.z.number(),
|
|
155
139
|
blur: zod_1.z.number(),
|
|
156
140
|
opacity: zod_1.z.number().nonnegative(),
|
|
157
141
|
play: zod_1.z.enum(['on-hover', 'on-click', 'auto']),
|
|
158
142
|
controls: zod_1.z.boolean(),
|
|
159
143
|
loop: zod_1.z.boolean(),
|
|
160
|
-
})
|
|
144
|
+
}),
|
|
145
|
+
sticky: zod_1.z.object({
|
|
146
|
+
from: zod_1.z.number(),
|
|
147
|
+
to: zod_1.z.number().optional()
|
|
148
|
+
}).nullable(),
|
|
161
149
|
state: zod_1.z.record(ItemState_schema_1.EmbedStateParamsSchema)
|
|
162
150
|
});
|
|
163
151
|
const CodeEmbedItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
|
|
164
152
|
type: zod_1.z.literal(ArticleItemType_1.ArticleItemType.CodeEmbed),
|
|
165
|
-
|
|
153
|
+
params: zod_1.z.object({
|
|
166
154
|
html: zod_1.z.string(),
|
|
167
155
|
scale: zod_1.z.boolean(),
|
|
168
156
|
iframe: zod_1.z.boolean(),
|
|
157
|
+
areaAnchor: zod_1.z.nativeEnum(ItemArea_1.AreaAnchor),
|
|
158
|
+
opacity: zod_1.z.number().nonnegative(),
|
|
159
|
+
blur: zod_1.z.number(),
|
|
160
|
+
isDraggable: zod_1.z.boolean().optional(),
|
|
169
161
|
pointerEvents
|
|
170
162
|
}),
|
|
171
|
-
sticky: zod_1.z.
|
|
163
|
+
sticky: zod_1.z.object({
|
|
172
164
|
from: zod_1.z.number(),
|
|
173
165
|
to: zod_1.z.number().optional()
|
|
174
|
-
}).nullable()
|
|
175
|
-
layoutParams: zod_1.z.record(zod_1.z.object({
|
|
176
|
-
areaAnchor: zod_1.z.nativeEnum(ItemArea_1.AreaAnchor),
|
|
177
|
-
opacity: zod_1.z.number().nonnegative(),
|
|
178
|
-
blur: zod_1.z.number(),
|
|
179
|
-
isDraggable: zod_1.z.boolean().optional()
|
|
180
|
-
})),
|
|
166
|
+
}).nullable(),
|
|
181
167
|
state: zod_1.z.record(ItemState_schema_1.CodeEmbedStateParamsSchema)
|
|
182
168
|
});
|
|
183
169
|
const ComponentItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
|
|
184
170
|
type: zod_1.z.literal(ArticleItemType_1.ArticleItemType.Component),
|
|
185
|
-
|
|
171
|
+
params: zod_1.z.object({
|
|
186
172
|
componentId: zod_1.z.string(),
|
|
187
|
-
content: zod_1.z.any().optional()
|
|
188
|
-
}),
|
|
189
|
-
sticky: zod_1.z.record(zod_1.z.object({
|
|
190
|
-
from: zod_1.z.number(),
|
|
191
|
-
to: zod_1.z.number().optional()
|
|
192
|
-
}).nullable()),
|
|
193
|
-
layoutParams: zod_1.z.record(zod_1.z.object({
|
|
173
|
+
content: zod_1.z.any().optional(),
|
|
194
174
|
parameters: zod_1.z.any().optional(),
|
|
195
175
|
opacity: zod_1.z.number().nonnegative(),
|
|
196
176
|
blur: zod_1.z.number()
|
|
197
|
-
})
|
|
177
|
+
}),
|
|
178
|
+
sticky: zod_1.z.object({
|
|
179
|
+
from: zod_1.z.number(),
|
|
180
|
+
to: zod_1.z.number().optional()
|
|
181
|
+
}).nullable(),
|
|
198
182
|
state: zod_1.z.record(ItemState_schema_1.ComponentStateParamsSchema)
|
|
199
183
|
});
|
|
200
184
|
exports.ItemSchema = zod_1.z.lazy(() => zod_1.z.discriminatedUnion('type', [
|
|
@@ -209,34 +193,30 @@ exports.ItemSchema = zod_1.z.lazy(() => zod_1.z.discriminatedUnion('type', [
|
|
|
209
193
|
ComponentItemSchema,
|
|
210
194
|
ItemBase_schema_1.ItemBaseSchema.extend({
|
|
211
195
|
type: zod_1.z.literal(ArticleItemType_1.ArticleItemType.Group),
|
|
212
|
-
|
|
213
|
-
pointerEvents
|
|
196
|
+
params: zod_1.z.object({
|
|
197
|
+
pointerEvents,
|
|
198
|
+
opacity: zod_1.z.number().nonnegative(),
|
|
199
|
+
blur: zod_1.z.number()
|
|
214
200
|
}),
|
|
215
201
|
items: zod_1.z.array(exports.ItemSchema),
|
|
216
|
-
sticky: zod_1.z.
|
|
202
|
+
sticky: zod_1.z.object({
|
|
217
203
|
from: zod_1.z.number(),
|
|
218
204
|
to: zod_1.z.number().optional()
|
|
219
|
-
}).nullable()
|
|
220
|
-
layoutParams: zod_1.z.record(zod_1.z.object({
|
|
221
|
-
opacity: zod_1.z.number().nonnegative(),
|
|
222
|
-
blur: zod_1.z.number()
|
|
223
|
-
})),
|
|
205
|
+
}).nullable(),
|
|
224
206
|
state: zod_1.z.record(ItemState_schema_1.GroupStateParamsSchema)
|
|
225
207
|
}),
|
|
226
208
|
ItemBase_schema_1.ItemBaseSchema.extend({
|
|
227
209
|
type: zod_1.z.literal(ArticleItemType_1.ArticleItemType.Compound),
|
|
228
|
-
|
|
210
|
+
params: zod_1.z.object({
|
|
229
211
|
overflow: zod_1.z.enum(['hidden', 'visible']),
|
|
212
|
+
opacity: zod_1.z.number().nonnegative(),
|
|
230
213
|
pointerEvents,
|
|
231
214
|
}),
|
|
232
215
|
items: zod_1.z.array(exports.ItemSchema),
|
|
233
|
-
sticky: zod_1.z.
|
|
216
|
+
sticky: zod_1.z.object({
|
|
234
217
|
from: zod_1.z.number(),
|
|
235
218
|
to: zod_1.z.number().optional()
|
|
236
|
-
}).nullable()
|
|
237
|
-
layoutParams: zod_1.z.record(zod_1.z.object({
|
|
238
|
-
opacity: zod_1.z.number().nonnegative()
|
|
239
|
-
})),
|
|
219
|
+
}).nullable(),
|
|
240
220
|
state: zod_1.z.record(ItemState_schema_1.CompoundStateParamsSchema)
|
|
241
221
|
})
|
|
242
222
|
]));
|
|
@@ -25,7 +25,7 @@ export declare const CompoundSettingsSchema: z.ZodObject<{
|
|
|
25
25
|
}>;
|
|
26
26
|
export declare const ItemBaseSchema: z.ZodObject<{
|
|
27
27
|
id: z.ZodString;
|
|
28
|
-
area: z.
|
|
28
|
+
area: z.ZodObject<{
|
|
29
29
|
top: z.ZodNumber;
|
|
30
30
|
left: z.ZodNumber;
|
|
31
31
|
width: z.ZodNumber;
|
|
@@ -58,8 +58,8 @@ export declare const ItemBaseSchema: z.ZodObject<{
|
|
|
58
58
|
positionType: import("../../types/article/ItemArea").PositionType;
|
|
59
59
|
scaleAnchor: AreaAnchor;
|
|
60
60
|
anchorSide?: import("../../types/article/ItemArea").AnchorSide | undefined;
|
|
61
|
-
}
|
|
62
|
-
hidden: z.
|
|
61
|
+
}>;
|
|
62
|
+
hidden: z.ZodBoolean;
|
|
63
63
|
link: z.ZodOptional<z.ZodObject<{
|
|
64
64
|
url: z.ZodString;
|
|
65
65
|
target: z.ZodString;
|
|
@@ -70,7 +70,7 @@ export declare const ItemBaseSchema: z.ZodObject<{
|
|
|
70
70
|
url: string;
|
|
71
71
|
target: string;
|
|
72
72
|
}>>;
|
|
73
|
-
compoundSettings: z.ZodOptional<z.
|
|
73
|
+
compoundSettings: z.ZodOptional<z.ZodObject<{
|
|
74
74
|
positionAnchor: z.ZodNativeEnum<typeof AreaAnchor>;
|
|
75
75
|
widthMode: z.ZodNativeEnum<typeof DimensionMode>;
|
|
76
76
|
heightMode: z.ZodNativeEnum<typeof DimensionMode>;
|
|
@@ -82,12 +82,11 @@ export declare const ItemBaseSchema: z.ZodObject<{
|
|
|
82
82
|
positionAnchor: AreaAnchor;
|
|
83
83
|
widthMode: DimensionMode;
|
|
84
84
|
heightMode: DimensionMode;
|
|
85
|
-
}
|
|
86
|
-
layoutParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
85
|
+
}>>;
|
|
87
86
|
}, "strip", z.ZodTypeAny, {
|
|
88
|
-
hidden:
|
|
87
|
+
hidden: boolean;
|
|
89
88
|
id: string;
|
|
90
|
-
area:
|
|
89
|
+
area: {
|
|
91
90
|
left: number;
|
|
92
91
|
top: number;
|
|
93
92
|
scale: number;
|
|
@@ -98,21 +97,20 @@ export declare const ItemBaseSchema: z.ZodObject<{
|
|
|
98
97
|
positionType: import("../../types/article/ItemArea").PositionType;
|
|
99
98
|
scaleAnchor: AreaAnchor;
|
|
100
99
|
anchorSide?: import("../../types/article/ItemArea").AnchorSide | undefined;
|
|
101
|
-
}
|
|
100
|
+
};
|
|
102
101
|
link?: {
|
|
103
102
|
url: string;
|
|
104
103
|
target: string;
|
|
105
104
|
} | undefined;
|
|
106
|
-
compoundSettings?:
|
|
105
|
+
compoundSettings?: {
|
|
107
106
|
positionAnchor: AreaAnchor;
|
|
108
107
|
widthMode: DimensionMode;
|
|
109
108
|
heightMode: DimensionMode;
|
|
110
|
-
}
|
|
111
|
-
layoutParams?: Record<string, any> | undefined;
|
|
109
|
+
} | undefined;
|
|
112
110
|
}, {
|
|
113
|
-
hidden:
|
|
111
|
+
hidden: boolean;
|
|
114
112
|
id: string;
|
|
115
|
-
area:
|
|
113
|
+
area: {
|
|
116
114
|
left: number;
|
|
117
115
|
top: number;
|
|
118
116
|
scale: number;
|
|
@@ -123,15 +121,14 @@ export declare const ItemBaseSchema: z.ZodObject<{
|
|
|
123
121
|
positionType: import("../../types/article/ItemArea").PositionType;
|
|
124
122
|
scaleAnchor: AreaAnchor;
|
|
125
123
|
anchorSide?: import("../../types/article/ItemArea").AnchorSide | undefined;
|
|
126
|
-
}
|
|
124
|
+
};
|
|
127
125
|
link?: {
|
|
128
126
|
url: string;
|
|
129
127
|
target: string;
|
|
130
128
|
} | undefined;
|
|
131
|
-
compoundSettings?:
|
|
129
|
+
compoundSettings?: {
|
|
132
130
|
positionAnchor: AreaAnchor;
|
|
133
131
|
widthMode: DimensionMode;
|
|
134
132
|
heightMode: DimensionMode;
|
|
135
|
-
}
|
|
136
|
-
layoutParams?: Record<string, any> | undefined;
|
|
133
|
+
} | undefined;
|
|
137
134
|
}>;
|
|
@@ -15,9 +15,8 @@ exports.CompoundSettingsSchema = zod_1.z.object({
|
|
|
15
15
|
});
|
|
16
16
|
exports.ItemBaseSchema = zod_1.z.object({
|
|
17
17
|
id: zod_1.z.string().min(1),
|
|
18
|
-
area:
|
|
19
|
-
hidden: zod_1.z.
|
|
18
|
+
area: ItemArea_schema_1.ItemAreaSchema,
|
|
19
|
+
hidden: zod_1.z.boolean(),
|
|
20
20
|
link: exports.Link.optional(),
|
|
21
|
-
compoundSettings:
|
|
22
|
-
layoutParams: zod_1.z.record(zod_1.z.any()).optional()
|
|
21
|
+
compoundSettings: exports.CompoundSettingsSchema.optional(),
|
|
23
22
|
});
|