@cntrl-site/sdk 1.16.0 → 1.17.0

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.
@@ -8,8 +8,13 @@ const TriggerSchema = zod_1.z.object({
8
8
  from: zod_1.z.string(),
9
9
  to: zod_1.z.string()
10
10
  });
11
+ const VideoInteractionActionSchema = zod_1.z.object({
12
+ type: zod_1.z.enum(['play', 'pause']),
13
+ itemId: zod_1.z.string()
14
+ });
11
15
  const StateSchema = zod_1.z.object({
12
- id: zod_1.z.string()
16
+ id: zod_1.z.string(),
17
+ actions: zod_1.z.array(VideoInteractionActionSchema).optional()
13
18
  });
14
19
  exports.InteractionSchema = zod_1.z.object({
15
20
  id: zod_1.z.string(),
@@ -38,7 +38,9 @@ const FXParams = zod_1.z.object({
38
38
  });
39
39
  const ImageItemSchema = ItemBase_schema_1.ItemBaseSchema.extend({
40
40
  type: zod_1.z.literal(ArticleItemType_1.ArticleItemType.Image),
41
- commonParams: FXParams,
41
+ commonParams: zod_1.z.object({
42
+ pointerEvents
43
+ }).merge(FXParams),
42
44
  sticky: zod_1.z.record(zod_1.z.object({
43
45
  from: zod_1.z.number(),
44
46
  to: zod_1.z.number().optional()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cntrl-site/sdk",
3
- "version": "1.16.0",
3
+ "version": "1.17.0",
4
4
  "description": "Generic SDK for use in public websites.",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/index.ts",
@@ -1,5 +1,5 @@
1
1
  import { z, ZodType } from 'zod';
2
- import { Interaction, InteractionTrigger } from '../../types/article/Interaction';
2
+ import { Interaction, InteractionTrigger, VideoInteractionAction } from '../../types/article/Interaction';
3
3
 
4
4
  const TriggerSchema = z.object({
5
5
  itemId: z.string(),
@@ -8,8 +8,14 @@ const TriggerSchema = z.object({
8
8
  to: z.string()
9
9
  }) satisfies ZodType<InteractionTrigger>;
10
10
 
11
+ const VideoInteractionActionSchema = z.object({
12
+ type: z.enum(['play', 'pause']),
13
+ itemId: z.string()
14
+ }) satisfies ZodType<VideoInteractionAction>;
15
+
11
16
  const StateSchema = z.object({
12
- id: z.string()
17
+ id: z.string(),
18
+ actions: z.array(VideoInteractionActionSchema).optional()
13
19
  });
14
20
 
15
21
  export const InteractionSchema = z.object({
@@ -56,7 +56,9 @@ const FXParams = z.object({
56
56
 
57
57
  const ImageItemSchema = ItemBaseSchema.extend({
58
58
  type: z.literal(ArticleItemType.Image),
59
- commonParams: FXParams,
59
+ commonParams: z.object({
60
+ pointerEvents
61
+ }).merge(FXParams),
60
62
  sticky: z.record(
61
63
  z.object({
62
64
  from: z.number(),
@@ -12,8 +12,14 @@ export interface InteractionTrigger {
12
12
  to: StateId;
13
13
  }
14
14
 
15
+ export type VideoInteractionAction = {
16
+ type: 'play' | 'pause';
17
+ itemId: string;
18
+ }
19
+
15
20
  export interface InteractionState {
16
21
  id: StateId;
22
+ actions?: VideoInteractionAction[];
17
23
  }
18
24
 
19
25
  type StateId = string;