@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.
Files changed (96) hide show
  1. package/lib/index.d.ts +1 -4
  2. package/lib/index.js +1 -4
  3. package/lib/sdk/Client/Client.d.ts +0 -2
  4. package/lib/sdk/Client/Client.js +0 -11
  5. package/lib/sdk/schemas/article/Article.schema.d.ts +40 -45
  6. package/lib/sdk/schemas/article/Article.schema.js +1 -1
  7. package/lib/sdk/schemas/article/Item.schema.js +64 -84
  8. package/lib/sdk/schemas/article/ItemBase.schema.d.ts +15 -18
  9. package/lib/sdk/schemas/article/ItemBase.schema.js +3 -4
  10. package/lib/sdk/schemas/article/ItemState.schema.d.ts +76 -76
  11. package/lib/sdk/schemas/article/RichTextItem.schema.d.ts +78 -86
  12. package/lib/sdk/schemas/article/RichTextItem.schema.js +9 -11
  13. package/lib/sdk/schemas/article/Section.schema.d.ts +20 -23
  14. package/lib/sdk/schemas/article/Section.schema.js +4 -5
  15. package/lib/sdk/schemas/keyframe/Keyframes.schema.d.ts +0 -90
  16. package/lib/sdk/schemas/keyframe/Keyframes.schema.js +0 -1
  17. package/lib/sdk/schemas/project/Project.schema.d.ts +3 -28
  18. package/lib/sdk/schemas/project/Project.schema.js +1 -2
  19. package/lib/sdk/types/article/Article.d.ts +1 -1
  20. package/lib/sdk/types/article/Item.d.ts +75 -114
  21. package/lib/sdk/types/article/Section.d.ts +4 -5
  22. package/lib/sdk/types/keyframe/Keyframe.d.ts +0 -1
  23. package/lib/sdk/types/project/Project.d.ts +1 -2
  24. package/lib/sdk-nextjs/common/useExemplary.js +1 -5
  25. package/lib/sdk-nextjs/common/useItemFXData.js +1 -1
  26. package/lib/sdk-nextjs/common/useKeyframeValue.d.ts +1 -1
  27. package/lib/sdk-nextjs/common/useKeyframeValue.js +4 -7
  28. package/lib/sdk-nextjs/common/useLayoutDeviation.d.ts +5 -0
  29. package/lib/sdk-nextjs/common/useLayoutDeviation.js +20 -0
  30. package/lib/sdk-nextjs/components/ArticleWrapper.js +3 -4
  31. package/lib/sdk-nextjs/components/Section/Section.js +12 -31
  32. package/lib/sdk-nextjs/components/Section/useSectionHeightMap.d.ts +1 -3
  33. package/lib/sdk-nextjs/components/Section/useSectionHeightMap.js +1 -9
  34. package/lib/sdk-nextjs/components/items/CodeEmbedItem/CodeEmbedItem.js +16 -35
  35. package/lib/sdk-nextjs/components/items/CodeEmbedItem/useCodeEmbedItem.d.ts +2 -4
  36. package/lib/sdk-nextjs/components/items/CodeEmbedItem/useCodeEmbedItem.js +3 -17
  37. package/lib/sdk-nextjs/components/items/ComponentItem/ComponentItem.js +13 -23
  38. package/lib/sdk-nextjs/components/items/ComponentItem/useComponentItem.d.ts +2 -2
  39. package/lib/sdk-nextjs/components/items/ComponentItem/useComponentItem.js +2 -14
  40. package/lib/sdk-nextjs/components/items/CompoundItem/CompoundChild.js +40 -46
  41. package/lib/sdk-nextjs/components/items/CompoundItem/CompoundItem.js +8 -14
  42. package/lib/sdk-nextjs/components/items/CompoundItem/useCompoundItem.d.ts +1 -1
  43. package/lib/sdk-nextjs/components/items/CompoundItem/useCompoundItem.js +1 -8
  44. package/lib/sdk-nextjs/components/items/CustomItem/CustomItem.js +11 -16
  45. package/lib/sdk-nextjs/components/items/EmbedVideoItem/VimeoEmbed.js +28 -37
  46. package/lib/sdk-nextjs/components/items/EmbedVideoItem/YoutubeEmbed.js +17 -29
  47. package/lib/sdk-nextjs/components/items/EmbedVideoItem/useEmbedVideoItem.d.ts +3 -3
  48. package/lib/sdk-nextjs/components/items/EmbedVideoItem/useEmbedVideoItem.js +3 -20
  49. package/lib/sdk-nextjs/components/items/FileItem/ImageItem.js +48 -54
  50. package/lib/sdk-nextjs/components/items/FileItem/VideoItem.js +53 -64
  51. package/lib/sdk-nextjs/components/items/FileItem/useFileItem.d.ts +6 -6
  52. package/lib/sdk-nextjs/components/items/FileItem/useFileItem.js +5 -32
  53. package/lib/sdk-nextjs/components/items/GroupItem/GroupItem.js +3 -13
  54. package/lib/sdk-nextjs/components/items/GroupItem/useGroupItem.d.ts +2 -2
  55. package/lib/sdk-nextjs/components/items/GroupItem/useGroupItem.js +2 -14
  56. package/lib/sdk-nextjs/components/items/Item.js +23 -48
  57. package/lib/sdk-nextjs/components/items/RectangleItem/RectangleItem.js +19 -29
  58. package/lib/sdk-nextjs/components/items/RectangleItem/useRectangleItem.d.ts +6 -6
  59. package/lib/sdk-nextjs/components/items/RectangleItem/useRectangleItem.js +6 -38
  60. package/lib/sdk-nextjs/components/items/RichTextItem/RichTextItem.js +23 -31
  61. package/lib/sdk-nextjs/components/items/RichTextItem/useRichTextItem.js +2 -2
  62. package/lib/sdk-nextjs/components/items/useItemAngle.d.ts +1 -1
  63. package/lib/sdk-nextjs/components/items/useItemAngle.js +1 -1
  64. package/lib/sdk-nextjs/components/items/useItemArea.d.ts +4 -4
  65. package/lib/sdk-nextjs/components/items/useItemArea.js +2 -8
  66. package/lib/sdk-nextjs/components/items/useItemScale.d.ts +1 -1
  67. package/lib/sdk-nextjs/components/items/useItemScale.js +1 -3
  68. package/lib/sdk-nextjs/components/items/useRichTextItemValues.d.ts +6 -6
  69. package/lib/sdk-nextjs/components/items/useRichTextItemValues.js +6 -28
  70. package/lib/sdk-nextjs/components/items/useSizing.js +2 -4
  71. package/lib/sdk-nextjs/components/items/useStickyItemTop.js +3 -9
  72. package/lib/sdk-nextjs/interactions/InteractionsRegistry.d.ts +1 -1
  73. package/lib/sdk-nextjs/interactions/InteractionsRegistry.js +2 -2
  74. package/lib/sdk-nextjs/provider/CntrlSdkContext.d.ts +5 -6
  75. package/lib/sdk-nextjs/provider/CntrlSdkContext.js +6 -6
  76. package/lib/sdk-nextjs/provider/InteractionsContext.js +2 -6
  77. package/lib/sdk-nextjs/utils/RichTextConverter/RichTextConverter.d.ts +1 -2
  78. package/lib/sdk-nextjs/utils/RichTextConverter/RichTextConverter.js +37 -62
  79. package/lib/sdk-nextjs/utils/getStyleFromItemStateAndParams.d.ts +1 -1
  80. package/package.json +1 -1
  81. package/lib/cli.d.ts +0 -10
  82. package/lib/cli.js +0 -64
  83. package/lib/sdk/schemas/project/Layout.schema.d.ts +0 -17
  84. package/lib/sdk/schemas/project/Layout.schema.js +0 -10
  85. package/lib/sdk/types/component/Component.d.ts +0 -15
  86. package/lib/sdk/types/component/Component.js +0 -2
  87. package/lib/sdk/types/project/Layout.d.ts +0 -6
  88. package/lib/sdk/types/project/Layout.js +0 -2
  89. package/lib/sdk-nextjs/common/useCurrentLayout.d.ts +0 -6
  90. package/lib/sdk-nextjs/common/useCurrentLayout.js +0 -42
  91. package/lib/sdk-nextjs/components/useLayoutContext.d.ts +0 -1
  92. package/lib/sdk-nextjs/components/useLayoutContext.js +0 -9
  93. package/lib/sdk-nextjs/provider/LayoutContext.d.ts +0 -1
  94. package/lib/sdk-nextjs/provider/LayoutContext.js +0 -5
  95. package/lib/utils.d.ts +0 -3
  96. 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, ItemCommonParamsMap, ItemLayoutParamsMap, RectangleItem, StickyParams, VideoItem, RichTextItem, Link, VimeoEmbedItem, YoutubeEmbedItem, GroupItem, CodeEmbedItem, CompoundItem, ComponentItem, FillLayer } from './sdk/types/article/Item';
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.getLayoutMediaQuery = exports.getLayoutStyles = exports.FontFaceGenerator = exports.CntrlClient = void 0;
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;
@@ -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.ZodRecord<z.ZodString, z.ZodObject<{
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
- position: z.ZodRecord<z.ZodString, z.ZodNumber>;
22
- hidden: z.ZodRecord<z.ZodString, z.ZodBoolean>;
23
- color: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
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: Record<string, string | null>;
69
- hidden: Record<string, boolean>;
70
- position: Record<string, number>;
67
+ color: string | null;
68
+ hidden: boolean;
71
69
  id: string;
72
- height: Record<string, {
70
+ height: {
73
71
  mode: import("../../..").SectionHeightMode;
74
72
  units: number;
75
73
  vhUnits?: number | undefined;
76
- }>;
74
+ };
77
75
  items: import("../../..").ItemAny[];
78
- name?: string | undefined;
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
- }> | undefined;
90
+ };
91
+ name?: string | undefined;
94
92
  }, {
95
- color: Record<string, string | null>;
96
- hidden: Record<string, boolean>;
97
- position: Record<string, number>;
93
+ color: string | null;
94
+ hidden: boolean;
98
95
  id: string;
99
- height: Record<string, {
96
+ height: {
100
97
  mode: import("../../..").SectionHeightMode;
101
98
  units: number;
102
99
  vhUnits?: number | undefined;
103
- }>;
100
+ };
104
101
  items: import("../../..").ItemAny[];
105
- name?: string | undefined;
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
- }> | undefined;
116
+ };
117
+ name?: string | undefined;
121
118
  }>, "many">;
122
- interactions: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
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: Record<string, string | null>;
228
- hidden: Record<string, boolean>;
229
- position: Record<string, number>;
224
+ color: string | null;
225
+ hidden: boolean;
230
226
  id: string;
231
- height: Record<string, {
227
+ height: {
232
228
  mode: import("../../..").SectionHeightMode;
233
229
  units: number;
234
230
  vhUnits?: number | undefined;
235
- }>;
231
+ };
236
232
  items: import("../../..").ItemAny[];
237
- name?: string | undefined;
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
- }> | undefined;
247
+ };
248
+ name?: string | undefined;
253
249
  }[];
254
- interactions: Record<string, {
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: Record<string, string | null>;
280
- hidden: Record<string, boolean>;
281
- position: Record<string, number>;
275
+ color: string | null;
276
+ hidden: boolean;
282
277
  id: string;
283
- height: Record<string, {
278
+ height: {
284
279
  mode: import("../../..").SectionHeightMode;
285
280
  units: number;
286
281
  vhUnits?: number | undefined;
287
- }>;
282
+ };
288
283
  items: import("../../..").ItemAny[];
289
- name?: string | undefined;
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
- }> | undefined;
298
+ };
299
+ name?: string | undefined;
305
300
  }[];
306
- interactions: Record<string, {
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.record(zod_1.z.array(Interaction_schema_1.InteractionSchema))
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
- commonParams: zod_1.z.object({
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
- commonParams: zod_1.z.object({
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
- commonParams: zod_1.z.object({
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
- commonParams: zod_1.z.object({
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.record(zod_1.z.object({
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
- commonParams: zod_1.z.object({
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
- commonParams: zod_1.z.object({
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
- commonParams: zod_1.z.object({
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.record(zod_1.z.object({
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
- commonParams: zod_1.z.object({
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
- commonParams: zod_1.z.object({
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.record(zod_1.z.object({
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
- commonParams: zod_1.z.object({
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.record(zod_1.z.object({
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.ZodRecord<z.ZodString, z.ZodObject<{
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.ZodRecord<z.ZodString, z.ZodBoolean>;
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.ZodRecord<z.ZodString, z.ZodObject<{
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: Record<string, boolean>;
87
+ hidden: boolean;
89
88
  id: string;
90
- area: Record<string, {
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?: Record<string, {
105
+ compoundSettings?: {
107
106
  positionAnchor: AreaAnchor;
108
107
  widthMode: DimensionMode;
109
108
  heightMode: DimensionMode;
110
- }> | undefined;
111
- layoutParams?: Record<string, any> | undefined;
109
+ } | undefined;
112
110
  }, {
113
- hidden: Record<string, boolean>;
111
+ hidden: boolean;
114
112
  id: string;
115
- area: Record<string, {
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?: Record<string, {
129
+ compoundSettings?: {
132
130
  positionAnchor: AreaAnchor;
133
131
  widthMode: DimensionMode;
134
132
  heightMode: DimensionMode;
135
- }> | undefined;
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: zod_1.z.record(ItemArea_schema_1.ItemAreaSchema),
19
- hidden: zod_1.z.record(zod_1.z.boolean()),
18
+ area: ItemArea_schema_1.ItemAreaSchema,
19
+ hidden: zod_1.z.boolean(),
20
20
  link: exports.Link.optional(),
21
- compoundSettings: zod_1.z.record(exports.CompoundSettingsSchema).optional(),
22
- layoutParams: zod_1.z.record(zod_1.z.any()).optional()
21
+ compoundSettings: exports.CompoundSettingsSchema.optional(),
23
22
  });