@vkontakte/videoplayer-interactive 1.0.19-dev.d432d6cd.0 → 1.0.19-dev.d6f5a76a.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.
- package/es2015.cjs.js +6 -6
- package/es2015.esm.js +6 -6
- package/es2018.cjs.js +6 -6
- package/es2018.esm.js +6 -6
- package/esnext.cjs.js +6 -6
- package/esnext.esm.js +6 -6
- package/evergreen.esm.js +6 -6
- package/package.json +5 -5
- package/types/index.d.ts +3 -2
- package/types/modules/Graph/Graph.d.ts +2 -2
- package/types/modules/Interactives/Interactives.d.ts +18 -14
- package/types/modules/Interactives/Layout.d.ts +7 -7
- package/types/modules/Interactives/controls/Control.d.ts +4 -3
- package/types/modules/Interactives/controls/types.d.ts +5 -4
- package/types/modules/Interactives/index.d.ts +1 -1
- package/types/modules/Interactives/types.d.ts +5 -0
- package/types/modules/Interactives/utils/GameController.d.ts +19 -36
- package/types/modules/Interactives/utils/GroupsStack.d.ts +21 -31
- package/types/modules/Interactives/utils/HistoryController.d.ts +13 -3
- package/types/modules/Interactives/utils/InteractiveEvents.d.ts +10 -16
- package/types/modules/Interactives/utils/ResizeManager.d.ts +1 -8
- package/types/modules/Interactives/utils/SelectBranches.d.ts +51 -15
- package/types/modules/Interactives/utils/fallbackStrategies.d.ts +6 -23
- package/types/modules/Interactives/utils/gameUtils.d.ts +26 -28
- package/types/modules/Interactives/utils/getInteractiveRanges.d.ts +1 -1
- package/types/modules/Interactives/utils/renderingUtils.d.ts +59 -64
- package/types/modules/Loaders/vkVideoLoader/types.d.ts +2 -2
- package/types/modules/Loaders/vkVideoLoader/utils.d.ts +1 -1
- package/types/modules/ManifestController/ManifestController.d.ts +12 -11
- package/types/modules/ManifestController/utils.d.ts +6 -6
- package/types/modules/SeamlessController/SeamlessController.d.ts +2 -2
- package/types/modules/SeamlessController/utils.d.ts +2 -2
- package/types/modules/SeekToInteractiveController/SeekToInteractiveController.d.ts +2 -2
- package/types/movika.core/manifest/index.d.ts +24 -0
- package/types/movika.core/manifest/manifest_3_2/chapter.d.ts +62 -0
- package/types/movika.core/manifest/manifest_3_2/control.d.ts +67 -0
- package/types/movika.core/manifest/manifest_3_2/manifest.d.ts +50 -0
- package/types/movika.core/manifest/manifest_3_2/template.d.ts +34 -0
- package/types/movika.core/manifest/manifest_3_3/chapter.d.ts +70 -0
- package/types/movika.core/manifest/manifest_3_3/control.d.ts +66 -0
- package/types/movika.core/manifest/manifest_3_3/graph.d.ts +73 -0
- package/types/movika.core/manifest/manifest_3_3/manifest.d.ts +52 -0
- package/types/movika.core/manifest/manifest_3_3/template.d.ts +34 -0
- package/types/movika.core/manifest/migrations/index.d.ts +1 -0
- package/types/movika.core/manifest/migrations/migrateManifestToLatestVersion.d.ts +1 -0
- package/types/movika.core/manifest/migrations/migrate_from_3_0_to_3_1.d.ts +21 -0
- package/types/movika.core/manifest/migrations/migrate_from_3_1_to_3_2.d.ts +2 -0
- package/types/movika.core/manifest/migrations/migrate_from_3_2_to_3_3.d.ts +8 -0
- package/types/movika.core/manifest/types.d.ts +29 -0
- package/types/movika.core/manifest/utils.d.ts +5 -0
- package/types/utils/LastFrame.d.ts +1 -1
- package/types/utils/chapterHelpers.d.ts +1 -1
- package/types/utils/extractVkMovieId.d.ts +1 -1
- package/types/manifest/index.d.ts +0 -3
- package/types/manifest/utils.d.ts +0 -11
- package/types/modules/Interactives/utils/SelectBranches.types.d.ts +0 -73
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Chapter as Chapter_3_2, ChapterContainer as ChapterContainer_3_2, ChapterBranch as ChapterBranch_3_2 } from './manifest_3_2/chapter';
|
|
2
|
+
import type { Manifest_3_2, ManifestVideo as ManifestVideo_3_2, ManifestVideoVariant as ManifestVideoVariant_3_2, Media as Media_3_2, Metadata as Metadata_3_2 } from './manifest_3_2/manifest';
|
|
3
|
+
import type { Chapter as Chapter_3_3, ChapterContainer as ChapterContainer_3_3, ChapterBranch as ChapterBranch_3_3 } from './manifest_3_3/chapter';
|
|
4
|
+
import type { Manifest_3_3, ManifestVideo as ManifestVideo_3_3, ManifestVideoVariant as ManifestVideoVariant_3_3, Media as Media_3_3, Metadata as Metadata_3_3, ManifestVideoVariantType, Extensions, Standard } from './manifest_3_3/manifest';
|
|
5
|
+
import type { Control, ControlLayoutParams } from './manifest_3_3/control';
|
|
6
|
+
export type Container = ChapterContainer_3_2 | ChapterContainer_3_3;
|
|
7
|
+
export type Media = Media_3_2 | Media_3_3;
|
|
8
|
+
export type Chapter = Chapter_3_2 | Chapter_3_3;
|
|
9
|
+
export type Manifest = Manifest_3_2 | Manifest_3_3;
|
|
10
|
+
export type Metadata = Metadata_3_2 | Metadata_3_3;
|
|
11
|
+
export type ManifestVideo = ManifestVideo_3_2 | ManifestVideo_3_3;
|
|
12
|
+
export type ManifestVideoVariant = ManifestVideoVariant_3_2 | ManifestVideoVariant_3_3;
|
|
13
|
+
export type ChapterBranch = ChapterBranch_3_2 | ChapterBranch_3_3;
|
|
14
|
+
export type { ManifestVideoVariantType, Extensions, Standard };
|
|
15
|
+
export type LatestMedia = Media_3_3;
|
|
16
|
+
export type LatestManifestVideo = ManifestVideo_3_3;
|
|
17
|
+
export type LatestChapter = Chapter_3_3;
|
|
18
|
+
export type LatestManifest = Manifest_3_3;
|
|
19
|
+
export type LatestContainer = ChapterContainer_3_3;
|
|
20
|
+
export type LatestControl = Control;
|
|
21
|
+
export type LatestControlLayoutParams = ControlLayoutParams;
|
|
22
|
+
export * from './migrations';
|
|
23
|
+
export * from './types';
|
|
24
|
+
export * from './utils';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { Control } from './control';
|
|
2
|
+
export type ChapterEventType = 'onSuspense';
|
|
3
|
+
export type ContainerEventType = 'onSuspense';
|
|
4
|
+
export type ChapterSuspenseActionType = 'setNextBranch' | 'setWeightlessRandomBranch' | 'setRandomBranch' | 'setMaxWeightBranch' | 'setMinWeightBranch' | 'setDefaultBranch' | 'continuePlayback' | 'openURI';
|
|
5
|
+
export type ContainerSuspenseActionType = 'setNextBranch' | 'continuePlayback';
|
|
6
|
+
export interface ChapterEvent {
|
|
7
|
+
type: ChapterEventType;
|
|
8
|
+
action: {
|
|
9
|
+
type: ChapterSuspenseActionType;
|
|
10
|
+
args: {
|
|
11
|
+
branchId?: string;
|
|
12
|
+
shouldOpenNow: boolean;
|
|
13
|
+
isDetachContainer?: boolean;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export interface ChapterBranch {
|
|
18
|
+
id: string;
|
|
19
|
+
chapterId: string;
|
|
20
|
+
weight?: number;
|
|
21
|
+
manifestUrl?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ContainerEvent {
|
|
24
|
+
type: ContainerEventType;
|
|
25
|
+
action: {
|
|
26
|
+
type: ContainerSuspenseActionType;
|
|
27
|
+
args: {
|
|
28
|
+
branchId?: string;
|
|
29
|
+
shouldOpenNow: boolean;
|
|
30
|
+
isDetachContainer?: boolean;
|
|
31
|
+
uri?: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export interface ChapterContainer {
|
|
36
|
+
id: string;
|
|
37
|
+
/**
|
|
38
|
+
* Interactivity start time in milliseconds
|
|
39
|
+
*/
|
|
40
|
+
startTime: number;
|
|
41
|
+
/**
|
|
42
|
+
* Interactivity end time in milliseconds
|
|
43
|
+
*/
|
|
44
|
+
endTime?: number | null;
|
|
45
|
+
controls: Control[];
|
|
46
|
+
layout: {
|
|
47
|
+
type: 'Relative';
|
|
48
|
+
};
|
|
49
|
+
type: 'Choice' | 'TextInput';
|
|
50
|
+
events?: ContainerEvent[];
|
|
51
|
+
}
|
|
52
|
+
export interface Chapter {
|
|
53
|
+
id: string;
|
|
54
|
+
videoId?: string;
|
|
55
|
+
containers: ChapterContainer[];
|
|
56
|
+
branches: ChapterBranch[];
|
|
57
|
+
events?: ChapterEvent[];
|
|
58
|
+
label: string;
|
|
59
|
+
x: number;
|
|
60
|
+
y: number;
|
|
61
|
+
order: 'start' | 'end' | 'simple';
|
|
62
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export type ControlType = 'Text' | 'Button' | 'Area';
|
|
2
|
+
export type ControlEventType = 'onClick';
|
|
3
|
+
export type ControlActionType = 'setNextBranch' | 'continuePlayback' | 'openURI';
|
|
4
|
+
export interface ControlEvent {
|
|
5
|
+
type: ControlEventType;
|
|
6
|
+
action: {
|
|
7
|
+
type: ControlActionType;
|
|
8
|
+
args: {
|
|
9
|
+
branchId?: string;
|
|
10
|
+
shouldOpenNow: boolean;
|
|
11
|
+
isDetachContainer?: boolean;
|
|
12
|
+
uri?: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface ControlLayoutParams {
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
angle: number;
|
|
22
|
+
innerSizesDependOn?: 'video' | 'self';
|
|
23
|
+
}
|
|
24
|
+
export interface ControlProps {
|
|
25
|
+
text?: {
|
|
26
|
+
value: string;
|
|
27
|
+
gravityHorizontal: 'start' | 'end' | 'center';
|
|
28
|
+
gravityVertical: 'top' | 'bottom' | 'center';
|
|
29
|
+
color: string;
|
|
30
|
+
alpha: number;
|
|
31
|
+
size: number;
|
|
32
|
+
paddings?: {
|
|
33
|
+
top: number;
|
|
34
|
+
right: number;
|
|
35
|
+
bottom: number;
|
|
36
|
+
left: number;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated accepted but no one uses
|
|
40
|
+
*/
|
|
41
|
+
alignment?: 'left' | 'right' | 'center';
|
|
42
|
+
};
|
|
43
|
+
background: {
|
|
44
|
+
type: 'color';
|
|
45
|
+
color: string;
|
|
46
|
+
alpha: number;
|
|
47
|
+
src?: string;
|
|
48
|
+
};
|
|
49
|
+
shape: {
|
|
50
|
+
type: 'rectangle';
|
|
51
|
+
roundCorners: number;
|
|
52
|
+
border: {
|
|
53
|
+
width: number;
|
|
54
|
+
color: string;
|
|
55
|
+
alpha: number;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export interface Control {
|
|
60
|
+
id: string;
|
|
61
|
+
type: 'Button' | 'Area';
|
|
62
|
+
label: string;
|
|
63
|
+
subtype: ControlType;
|
|
64
|
+
layoutParams: ControlLayoutParams;
|
|
65
|
+
props: ControlProps;
|
|
66
|
+
events?: ControlEvent[];
|
|
67
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Chapter } from './chapter';
|
|
2
|
+
export type ManifestVideoVariantType = 'custom' | 'mp4' | 'hls' | 'dash' | 'mpeg';
|
|
3
|
+
export type Extensions = Exclude<ManifestVideoVariantType, 'custom'>;
|
|
4
|
+
export type Standard = '144p' | '240p' | '360p' | '480p' | '720p' | '1080p' | '1440p' | '2160p' | '4320p';
|
|
5
|
+
export interface CustomManifestVideoVariant {
|
|
6
|
+
type: Extract<ManifestVideoVariantType, 'custom'>;
|
|
7
|
+
payload: {
|
|
8
|
+
type: string;
|
|
9
|
+
id: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface DefaultManifestVideoVariant {
|
|
13
|
+
type: Extensions;
|
|
14
|
+
url: string;
|
|
15
|
+
size?: number | null;
|
|
16
|
+
standard?: Standard | null;
|
|
17
|
+
resolution?: string | null;
|
|
18
|
+
bitrate?: number | null;
|
|
19
|
+
cover?: string | null;
|
|
20
|
+
preview?: string | null;
|
|
21
|
+
}
|
|
22
|
+
export type ManifestVideoVariant = CustomManifestVideoVariant | DefaultManifestVideoVariant;
|
|
23
|
+
export interface ManifestVideo {
|
|
24
|
+
id: string;
|
|
25
|
+
duration?: number | null;
|
|
26
|
+
shortlink?: string | null;
|
|
27
|
+
variants: ManifestVideoVariant[];
|
|
28
|
+
title?: string;
|
|
29
|
+
}
|
|
30
|
+
export type Media = {
|
|
31
|
+
videos: ManifestVideo[];
|
|
32
|
+
};
|
|
33
|
+
export interface Metadata {
|
|
34
|
+
id: string;
|
|
35
|
+
version: '3.2';
|
|
36
|
+
build: number;
|
|
37
|
+
initChapterId?: string;
|
|
38
|
+
created: string;
|
|
39
|
+
updated: string;
|
|
40
|
+
types?: string[];
|
|
41
|
+
/**
|
|
42
|
+
* @deprecated
|
|
43
|
+
*/
|
|
44
|
+
media?: Media | string;
|
|
45
|
+
}
|
|
46
|
+
export interface Manifest_3_2 {
|
|
47
|
+
metadata: Metadata;
|
|
48
|
+
media: Media;
|
|
49
|
+
chapters: Chapter[];
|
|
50
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface ManifestDataTemplate {
|
|
2
|
+
/**
|
|
3
|
+
* uuid
|
|
4
|
+
*/
|
|
5
|
+
id: string;
|
|
6
|
+
/**
|
|
7
|
+
* Template name
|
|
8
|
+
*/
|
|
9
|
+
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* Chapter type this template can be applied to
|
|
12
|
+
*/
|
|
13
|
+
chapterType: 'start' | 'simple' | 'end';
|
|
14
|
+
/**
|
|
15
|
+
* Template includes stringified JSON object that applied to chapter
|
|
16
|
+
*/
|
|
17
|
+
template: string;
|
|
18
|
+
/**
|
|
19
|
+
* Template data type to apply to
|
|
20
|
+
*/
|
|
21
|
+
type: 'container';
|
|
22
|
+
/**
|
|
23
|
+
* Manifest version of template
|
|
24
|
+
*/
|
|
25
|
+
manifestVersion: string;
|
|
26
|
+
/**
|
|
27
|
+
* Date when template was created
|
|
28
|
+
*/
|
|
29
|
+
created?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Date when template was updated
|
|
32
|
+
*/
|
|
33
|
+
updated?: number;
|
|
34
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { Control } from './control';
|
|
2
|
+
export type ChapterEventType = 'onSuspense';
|
|
3
|
+
export type ContainerEventType = 'onSuspense';
|
|
4
|
+
export type ChapterSuspenseActionType = 'setNextBranch' | 'setWeightlessRandomBranch' | 'setRandomBranch' | 'setMaxWeightBranch' | 'setMinWeightBranch' | 'setDefaultBranch' | 'continuePlayback' | 'openURI' | 'expect';
|
|
5
|
+
export type ContainerSuspenseActionType = 'setNextBranch' | 'continuePlayback' | 'expect';
|
|
6
|
+
export interface ChapterEvent {
|
|
7
|
+
type: ChapterEventType;
|
|
8
|
+
action: {
|
|
9
|
+
type: ChapterSuspenseActionType;
|
|
10
|
+
args: {
|
|
11
|
+
branchId?: string;
|
|
12
|
+
shouldOpenNow: boolean;
|
|
13
|
+
isDetachContainer?: boolean;
|
|
14
|
+
uri?: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface ChapterBranch {
|
|
19
|
+
id: string;
|
|
20
|
+
chapterId: string;
|
|
21
|
+
weight?: number;
|
|
22
|
+
manifestUrl?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ContainerEvent {
|
|
25
|
+
type: ContainerEventType;
|
|
26
|
+
action: {
|
|
27
|
+
type: ContainerSuspenseActionType;
|
|
28
|
+
args: {
|
|
29
|
+
branchId?: string;
|
|
30
|
+
shouldOpenNow: boolean;
|
|
31
|
+
isDetachContainer?: boolean;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export interface ChapterContainer {
|
|
36
|
+
id: string;
|
|
37
|
+
/**
|
|
38
|
+
* Interactivity start time in milliseconds
|
|
39
|
+
*/
|
|
40
|
+
startTime: number;
|
|
41
|
+
/**
|
|
42
|
+
* Interactivity end time in milliseconds
|
|
43
|
+
*/
|
|
44
|
+
endTime?: number | null;
|
|
45
|
+
controls: Control[];
|
|
46
|
+
layout: {
|
|
47
|
+
type: 'Relative';
|
|
48
|
+
};
|
|
49
|
+
type: 'Choice' | 'TextInput';
|
|
50
|
+
events?: ContainerEvent[];
|
|
51
|
+
}
|
|
52
|
+
export interface Chapter {
|
|
53
|
+
id: string;
|
|
54
|
+
videoId?: string;
|
|
55
|
+
containers: ChapterContainer[];
|
|
56
|
+
branches: ChapterBranch[];
|
|
57
|
+
events?: ChapterEvent[];
|
|
58
|
+
label: string;
|
|
59
|
+
order: 'start' | 'end' | 'simple';
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* ------------ WARNING! ------------
|
|
63
|
+
* This is editor specific type only.
|
|
64
|
+
* Not used in stored manifest
|
|
65
|
+
*/
|
|
66
|
+
export declare enum ChapterError {
|
|
67
|
+
NoVideo = 0,
|
|
68
|
+
NoEOV = 1,
|
|
69
|
+
NoBranches = 2
|
|
70
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export type ControlType = 'Text' | 'Button' | 'Area';
|
|
2
|
+
export type ControlEventType = 'onClick';
|
|
3
|
+
export type ControlActionType = 'setNextBranch' | 'continuePlayback' | 'openURI';
|
|
4
|
+
export interface ControlEvent {
|
|
5
|
+
type: ControlEventType;
|
|
6
|
+
action: {
|
|
7
|
+
type: ControlActionType;
|
|
8
|
+
args: {
|
|
9
|
+
branchId?: string;
|
|
10
|
+
shouldOpenNow: boolean;
|
|
11
|
+
isDetachContainer?: boolean;
|
|
12
|
+
uri?: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface ControlLayoutParams {
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
angle: number;
|
|
22
|
+
innerSizesDependOn?: 'video' | 'self';
|
|
23
|
+
}
|
|
24
|
+
export interface ControlProps {
|
|
25
|
+
text?: {
|
|
26
|
+
value: string;
|
|
27
|
+
gravityHorizontal: 'start' | 'end' | 'center';
|
|
28
|
+
gravityVertical: 'top' | 'bottom' | 'center';
|
|
29
|
+
color: string;
|
|
30
|
+
alpha: number;
|
|
31
|
+
size: number;
|
|
32
|
+
paddings?: {
|
|
33
|
+
top: number;
|
|
34
|
+
right: number;
|
|
35
|
+
bottom: number;
|
|
36
|
+
left: number;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated accepted but no one uses
|
|
40
|
+
*/
|
|
41
|
+
alignment?: 'left' | 'right' | 'center';
|
|
42
|
+
};
|
|
43
|
+
background: {
|
|
44
|
+
type: 'color';
|
|
45
|
+
color: string;
|
|
46
|
+
alpha: number;
|
|
47
|
+
src?: string;
|
|
48
|
+
};
|
|
49
|
+
shape: {
|
|
50
|
+
type: 'rectangle';
|
|
51
|
+
roundCorners: number;
|
|
52
|
+
border: {
|
|
53
|
+
width: number;
|
|
54
|
+
color: string;
|
|
55
|
+
alpha: number;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export interface Control {
|
|
60
|
+
id: string;
|
|
61
|
+
type: ControlType;
|
|
62
|
+
label: string;
|
|
63
|
+
layoutParams: ControlLayoutParams;
|
|
64
|
+
props: ControlProps;
|
|
65
|
+
events?: ControlEvent[];
|
|
66
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export interface GraphBackground {
|
|
2
|
+
color?: string;
|
|
3
|
+
grid?: {
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
color?: string;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export interface GraphCustomChapter {
|
|
9
|
+
id: string;
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
}
|
|
13
|
+
export interface GraphEditDefaultChapter {
|
|
14
|
+
flipTo?: {
|
|
15
|
+
enabled?: boolean;
|
|
16
|
+
backgroundColor?: string;
|
|
17
|
+
textColor?: string;
|
|
18
|
+
};
|
|
19
|
+
controls?: {
|
|
20
|
+
enabled?: boolean;
|
|
21
|
+
backgroundColor?: string;
|
|
22
|
+
textColor?: string;
|
|
23
|
+
};
|
|
24
|
+
hover?: {
|
|
25
|
+
enabled?: boolean;
|
|
26
|
+
borderColor?: string;
|
|
27
|
+
shadowColor?: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export type GraphEditChapter = GraphCustomChapter & GraphEditDefaultChapter;
|
|
31
|
+
export interface GraphViewDefaultChapter extends GraphEditDefaultChapter {
|
|
32
|
+
watchAgain?: {
|
|
33
|
+
enabled?: boolean;
|
|
34
|
+
backgroundColor?: string;
|
|
35
|
+
textColor?: string;
|
|
36
|
+
};
|
|
37
|
+
preview?: {
|
|
38
|
+
enabled?: boolean;
|
|
39
|
+
backgroundColor?: string;
|
|
40
|
+
textColor?: string;
|
|
41
|
+
};
|
|
42
|
+
goBlind?: boolean;
|
|
43
|
+
}
|
|
44
|
+
export type GraphViewChapter = Pick<GraphCustomChapter, 'id'> & Partial<Pick<GraphCustomChapter, 'x' | 'y'>> & GraphViewDefaultChapter;
|
|
45
|
+
export interface GraphDefaultBranch {
|
|
46
|
+
display?: boolean;
|
|
47
|
+
color?: string;
|
|
48
|
+
connectionColor?: string;
|
|
49
|
+
actionConnectionColor?: string;
|
|
50
|
+
actionIconColor?: string;
|
|
51
|
+
inactionConnectionColor?: string;
|
|
52
|
+
inactionIconColor?: string;
|
|
53
|
+
displayActionConnections?: boolean;
|
|
54
|
+
}
|
|
55
|
+
export interface GraphBranch extends GraphDefaultBranch {
|
|
56
|
+
id: string;
|
|
57
|
+
}
|
|
58
|
+
export interface GraphDesign {
|
|
59
|
+
edit: {
|
|
60
|
+
background?: GraphBackground;
|
|
61
|
+
defaultChapter?: GraphEditDefaultChapter;
|
|
62
|
+
chapters: GraphEditChapter[];
|
|
63
|
+
defaultBranch?: GraphDefaultBranch;
|
|
64
|
+
branches?: GraphBranch[];
|
|
65
|
+
};
|
|
66
|
+
view: {
|
|
67
|
+
background?: GraphBackground;
|
|
68
|
+
defaultChapter?: GraphViewDefaultChapter;
|
|
69
|
+
chapters?: GraphViewChapter[];
|
|
70
|
+
defaultBranch?: GraphDefaultBranch;
|
|
71
|
+
branches?: GraphBranch[];
|
|
72
|
+
};
|
|
73
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { Chapter } from './chapter';
|
|
2
|
+
import type { GraphDesign } from './graph';
|
|
3
|
+
export type ManifestVideoVariantType = 'custom' | 'mp4' | 'hls' | 'dash' | 'mpeg';
|
|
4
|
+
export type Extensions = Exclude<ManifestVideoVariantType, 'custom'>;
|
|
5
|
+
export type Standard = '144p' | '240p' | '360p' | '480p' | '720p' | '1080p' | '1440p' | '2160p' | '4320p';
|
|
6
|
+
export interface CustomManifestVideoVariant {
|
|
7
|
+
type: Extract<ManifestVideoVariantType, 'custom'>;
|
|
8
|
+
payload: {
|
|
9
|
+
type: string;
|
|
10
|
+
id: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export interface DefaultManifestVideoVariant {
|
|
14
|
+
type: Extensions;
|
|
15
|
+
url: string;
|
|
16
|
+
size?: number | null;
|
|
17
|
+
standard?: Standard | null;
|
|
18
|
+
resolution?: string | null;
|
|
19
|
+
bitrate?: number | null;
|
|
20
|
+
cover?: string | null;
|
|
21
|
+
preview?: string | null;
|
|
22
|
+
}
|
|
23
|
+
export type ManifestVideoVariant = CustomManifestVideoVariant | DefaultManifestVideoVariant;
|
|
24
|
+
export interface ManifestVideo {
|
|
25
|
+
id: string;
|
|
26
|
+
duration?: number | null;
|
|
27
|
+
shortlink?: string | null;
|
|
28
|
+
variants: ManifestVideoVariant[];
|
|
29
|
+
title?: string;
|
|
30
|
+
}
|
|
31
|
+
export type Media = {
|
|
32
|
+
videos: ManifestVideo[];
|
|
33
|
+
};
|
|
34
|
+
export interface Metadata {
|
|
35
|
+
id: string;
|
|
36
|
+
version: '3.3';
|
|
37
|
+
build: number;
|
|
38
|
+
initChapterId?: string;
|
|
39
|
+
created: string;
|
|
40
|
+
updated: string;
|
|
41
|
+
types?: string[];
|
|
42
|
+
/**
|
|
43
|
+
* @deprecated
|
|
44
|
+
*/
|
|
45
|
+
media?: Media | string;
|
|
46
|
+
}
|
|
47
|
+
export interface Manifest_3_3 {
|
|
48
|
+
metadata: Metadata;
|
|
49
|
+
media: Media;
|
|
50
|
+
chapters: Chapter[];
|
|
51
|
+
graph: GraphDesign;
|
|
52
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface ManifestDataTemplate {
|
|
2
|
+
/**
|
|
3
|
+
* uuid
|
|
4
|
+
*/
|
|
5
|
+
id: string;
|
|
6
|
+
/**
|
|
7
|
+
* Template name
|
|
8
|
+
*/
|
|
9
|
+
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* Chapter type this template can be applied to
|
|
12
|
+
*/
|
|
13
|
+
chapterType: 'start' | 'simple' | 'end';
|
|
14
|
+
/**
|
|
15
|
+
* Template includes stringified JSON object that applied to chapter
|
|
16
|
+
*/
|
|
17
|
+
template: string;
|
|
18
|
+
/**
|
|
19
|
+
* Template data type to apply to
|
|
20
|
+
*/
|
|
21
|
+
type: 'container';
|
|
22
|
+
/**
|
|
23
|
+
* Manifest version of template
|
|
24
|
+
*/
|
|
25
|
+
manifestVersion: string;
|
|
26
|
+
/**
|
|
27
|
+
* Date when template was created
|
|
28
|
+
*/
|
|
29
|
+
created?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Date when template was updated
|
|
32
|
+
*/
|
|
33
|
+
updated?: number;
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { migrateManifestToLatestVersion } from "./migrateManifestToLatestVersion";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function migrateManifestToLatestVersion(manifest: any): any;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const DEFAULT_MANIFEST_VERSION: "3.1";
|
|
2
|
+
export namespace FALLBACK_STRATEGY_TO_ACTION_TYPE {
|
|
3
|
+
let _default: string;
|
|
4
|
+
export { _default as default };
|
|
5
|
+
export let random: string;
|
|
6
|
+
export let weightlessRandom: string;
|
|
7
|
+
export let max: string;
|
|
8
|
+
export let min: string;
|
|
9
|
+
}
|
|
10
|
+
export namespace defaultEvent {
|
|
11
|
+
let type: string;
|
|
12
|
+
namespace action {
|
|
13
|
+
let type_1: string;
|
|
14
|
+
export { type_1 as type };
|
|
15
|
+
export namespace args {
|
|
16
|
+
let shouldOpenNow: boolean;
|
|
17
|
+
let isDetachContainer: boolean;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export function migrate_from_3_0_to_3_1(manifest: any): any;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Manifest_3_2 } from '../manifest_3_2/manifest';
|
|
2
|
+
import type { ChapterEvent, ContainerEvent } from '../manifest_3_3/chapter';
|
|
3
|
+
import type { GraphCustomChapter, GraphDesign } from '../manifest_3_3/graph';
|
|
4
|
+
import type { Manifest_3_3 } from '../manifest_3_3/manifest';
|
|
5
|
+
export declare const DEFAULT_MANIFEST_VERSION = "3.3";
|
|
6
|
+
export declare const createDefaultGraphDesign: (chapters?: GraphCustomChapter[] | undefined) => GraphDesign;
|
|
7
|
+
export declare const expectEvent: ContainerEvent & ChapterEvent;
|
|
8
|
+
export declare const migrate_from_3_2_to_3_3: (manifest: Manifest_3_2) => Manifest_3_3;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type { Control } from './manifest_3_3/control';
|
|
2
|
+
import type { Chapter } from './manifest_3_3/chapter';
|
|
3
|
+
export declare const containerTypes: Readonly<{
|
|
4
|
+
Choice: "Choice";
|
|
5
|
+
TextInput: "TextInput";
|
|
6
|
+
}>;
|
|
7
|
+
export declare const controlTypes: Readonly<{
|
|
8
|
+
Button: "Button";
|
|
9
|
+
Area: "Area";
|
|
10
|
+
Text: "Text";
|
|
11
|
+
}>;
|
|
12
|
+
export declare const eventTypes: Readonly<{
|
|
13
|
+
onClick: "onClick";
|
|
14
|
+
onSuspense: "onSuspense";
|
|
15
|
+
}>;
|
|
16
|
+
export declare const eventActionTypes: Readonly<{
|
|
17
|
+
openURI: "openURI";
|
|
18
|
+
setNextBranch: "setNextBranch";
|
|
19
|
+
setWeightlessRandomBranch: "setWeightlessRandomBranch";
|
|
20
|
+
setRandomBranch: "setRandomBranch";
|
|
21
|
+
setMaxWeightBranch: "setMaxWeightBranch";
|
|
22
|
+
setMinWeightBranch: "setMinWeightBranch";
|
|
23
|
+
setDefaultBranch: "setDefaultBranch";
|
|
24
|
+
continuePlayback: "continuePlayback";
|
|
25
|
+
expect: "expect";
|
|
26
|
+
}>;
|
|
27
|
+
export type VideoId = number | string;
|
|
28
|
+
export type ChapterContainers = Chapter['containers'];
|
|
29
|
+
export type { Chapter } from './manifest_3_3/chapter';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export function isSupportedManifest(manifestVersion: string): boolean;
|
|
2
|
+
export function isValidManifest(manifest: object): boolean;
|
|
3
|
+
export function isTextControl(controlItem: any): boolean;
|
|
4
|
+
export function isButtonControl(controlItem: any): boolean;
|
|
5
|
+
export function isAreaControl(controlItem: any): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Manifest, ManifestVideoVariant, ManifestVideo, VideoId } from '../manifest';
|
|
1
|
+
import type { Manifest, ManifestVideoVariant, ManifestVideo, VideoId } from '../movika.core/manifest';
|
|
2
2
|
export declare const chapterIdsToVKVideoIds: (chapterIds: string[], interactiveManifest: Manifest) => number[];
|
|
3
3
|
export declare const getVideoRawIdByMedia: (mediaVideo: ManifestVideo) => string | undefined;
|
|
4
4
|
export declare const isVKVariantItem: (variantItem: ManifestVideoVariant) => boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ManifestVideo } from '../manifest';
|
|
1
|
+
import type { ManifestVideo } from '../movika.core/manifest';
|
|
2
2
|
export declare const extractVkMovieId: (media: ManifestVideo) => [] | [string, string];
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export type { ChapterContainer, ChapterContainer as Container, Chapter, Control, Manifest, ManifestVideo, ManifestVideoVariant, Media, Metadata, VideoInfo, VideoId, CustomManifestVideoVariant, Extension, AnyManifest, AnyControl, GraphEditChapter, GraphViewChapter, ChapterBranch, Standard, ControlLayoutParams, ControlEvent, ContainerEvent, ChapterEvent, } from '@interactiveplatform/movika-graph-editor';
|
|
2
|
-
export { isSupportedManifest, ControlTypes, EventActionTypes, migrateManifestToLatestVersion, compareVersions, } from '@interactiveplatform/movika-graph-editor';
|
|
3
|
-
export * from './utils';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { EventActionTypes, type AnyManifest, type AnyControl } from '../manifest';
|
|
2
|
-
/**
|
|
3
|
-
* checks manifest object validity
|
|
4
|
-
* @param manifest - manifest to check
|
|
5
|
-
* @returns true is valid, false is invalid
|
|
6
|
-
*/
|
|
7
|
-
export declare const isValidManifest: (manifest: AnyManifest) => boolean;
|
|
8
|
-
export declare const isTextControl: (controlItem: AnyControl) => boolean;
|
|
9
|
-
export declare const isButtonControl: (controlItem: AnyControl) => boolean;
|
|
10
|
-
export declare const isAreaControl: (controlItem: AnyControl) => boolean;
|
|
11
|
-
export type EventActionKeys = keyof typeof EventActionTypes;
|