@vkontakte/videoplayer-interactive 1.0.19-dev.c9e593de.0 → 1.0.19-dev.d5db4341.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 +2 -3
- package/types/manifest/index.d.ts +3 -0
- package/types/manifest/utils.d.ts +11 -0
- package/types/modules/Graph/Graph.d.ts +2 -2
- package/types/modules/Interactives/Interactives.d.ts +21 -16
- package/types/modules/Interactives/Layout.d.ts +7 -7
- package/types/modules/Interactives/controls/Control.d.ts +3 -4
- package/types/modules/Interactives/controls/types.d.ts +4 -5
- package/types/modules/Interactives/index.d.ts +2 -1
- package/types/modules/Interactives/types.d.ts +12 -15
- package/types/modules/Interactives/utils/GameController.d.ts +35 -16
- package/types/modules/Interactives/utils/GroupsStack.d.ts +31 -21
- package/types/modules/Interactives/utils/HistoryController.d.ts +4 -4
- package/types/modules/Interactives/utils/InteractiveEvents.d.ts +16 -10
- package/types/modules/Interactives/utils/ResizeManager.d.ts +8 -1
- package/types/modules/Interactives/utils/SelectBranches.d.ts +15 -51
- package/types/modules/Interactives/utils/SelectBranches.types.d.ts +73 -0
- package/types/modules/Interactives/utils/events.d.ts +8 -0
- package/types/modules/Interactives/utils/fallbackStrategies.d.ts +23 -6
- package/types/modules/Interactives/utils/gameUtils.d.ts +28 -26
- package/types/modules/Interactives/utils/getInteractiveRanges.d.ts +2 -3
- package/types/modules/Interactives/utils/renderingUtils.d.ts +64 -59
- 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 +11 -12
- package/types/modules/ManifestController/utils.d.ts +6 -6
- package/types/modules/SeamlessController/SeamlessController.d.ts +10 -12
- package/types/modules/SeamlessController/utils.d.ts +2 -2
- package/types/modules/SeekToInteractiveController/SeekToInteractiveController.d.ts +2 -2
- package/types/utils/LastFrame.d.ts +1 -1
- package/types/utils/chapterHelpers.d.ts +1 -1
- package/types/utils/extractVkMovieId.d.ts +2 -2
- package/types/movika.core/manifest/index.d.ts +0 -23
- package/types/movika.core/manifest/manifest_3_2/chapter.d.ts +0 -62
- package/types/movika.core/manifest/manifest_3_2/control.d.ts +0 -67
- package/types/movika.core/manifest/manifest_3_2/manifest.d.ts +0 -50
- package/types/movika.core/manifest/manifest_3_2/template.d.ts +0 -34
- package/types/movika.core/manifest/manifest_3_3/chapter.d.ts +0 -70
- package/types/movika.core/manifest/manifest_3_3/control.d.ts +0 -66
- package/types/movika.core/manifest/manifest_3_3/graph.d.ts +0 -73
- package/types/movika.core/manifest/manifest_3_3/manifest.d.ts +0 -52
- package/types/movika.core/manifest/manifest_3_3/template.d.ts +0 -34
- package/types/movika.core/manifest/migrations/index.d.ts +0 -1
- package/types/movika.core/manifest/migrations/migrateManifestToLatestVersion.d.ts +0 -1
- package/types/movika.core/manifest/migrations/migrate_from_3_0_to_3_1.d.ts +0 -21
- package/types/movika.core/manifest/migrations/migrate_from_3_1_to_3_2.d.ts +0 -2
- package/types/movika.core/manifest/migrations/migrate_from_3_2_to_3_3.d.ts +0 -8
- package/types/movika.core/manifest/types.d.ts +0 -29
- package/types/movika.core/manifest/utils.d.ts +0 -5
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { Loaders } from '../../modules/ManifestController/Loadable';
|
|
5
|
-
import {
|
|
6
|
-
export type InteractiveRange = {
|
|
7
|
-
range: [number, number];
|
|
8
|
-
subjects: string[];
|
|
9
|
-
};
|
|
10
|
-
export type VideoInfo = {
|
|
11
|
-
id: string;
|
|
12
|
-
cover: string;
|
|
13
|
-
title?: string;
|
|
14
|
-
};
|
|
1
|
+
import type { InterfaceLanguage } from '@vkontakte/videoplayer-shared';
|
|
2
|
+
import type { IOptionalTuningConfig } from '@vkontakte/videoplayer-core';
|
|
3
|
+
import type { IOneStat } from '@vkontakte/videoplayer-statistics';
|
|
4
|
+
import type { Loaders } from '../../modules/ManifestController/Loadable';
|
|
5
|
+
import type { HistoryApi, HistorySettings } from '../../modules/Interactives/utils/HistoryController';
|
|
15
6
|
export type InteractiveProjectInfo = {
|
|
16
7
|
videoId: string;
|
|
17
8
|
pid?: string;
|
|
@@ -19,7 +10,9 @@ export type InteractiveProjectInfo = {
|
|
|
19
10
|
variantPayloadType?: string;
|
|
20
11
|
};
|
|
21
12
|
export type RequiredOptions = 'parentElement' | 'fullscreenTargetElement';
|
|
22
|
-
export type IOptionalInteractiveOptions = Partial<
|
|
13
|
+
export type IOptionalInteractiveOptions = Partial<Omit<IInteractiveOptions, RequiredOptions | 'config'>> & Required<Pick<IInteractiveOptions, RequiredOptions>> & {
|
|
14
|
+
config?: Partial<IInteractiveOptions['config']>;
|
|
15
|
+
};
|
|
23
16
|
export interface IInteractiveOptions {
|
|
24
17
|
parentElement: HTMLElement;
|
|
25
18
|
fullscreenTargetElement: HTMLElement;
|
|
@@ -40,4 +33,8 @@ export interface IInteractiveOptions {
|
|
|
40
33
|
coreConfig?: IOptionalTuningConfig;
|
|
41
34
|
vkVideoLoader?: (owner_id: string, video_id: string) => unknown;
|
|
42
35
|
createOneStat?: (video: any, configOverwrite?: any) => IOneStat | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated
|
|
38
|
+
* */
|
|
39
|
+
disableControlsOnPause?: boolean;
|
|
43
40
|
}
|
|
@@ -1,4 +1,37 @@
|
|
|
1
|
-
|
|
1
|
+
import { type ISubscription, type IValueSubject } from '@vkontakte/videoplayer-shared';
|
|
2
|
+
import { type IPlayer } from '@vkontakte/videoplayer-core';
|
|
3
|
+
import type { InteractiveEventsType } from './InteractiveEvents';
|
|
4
|
+
import type { ChapterBranch, ChapterContainer } from '../../../manifest';
|
|
5
|
+
import type { EventEmitter } from '../../../utils/EventEmitter';
|
|
6
|
+
import { SelectBranches } from './SelectBranches';
|
|
7
|
+
import { GameStates } from './gameUtils';
|
|
8
|
+
type Container = {
|
|
9
|
+
container: ChapterContainer;
|
|
10
|
+
getElement: () => HTMLElement;
|
|
11
|
+
disable: () => void;
|
|
12
|
+
enable: () => void;
|
|
13
|
+
hide: () => void;
|
|
14
|
+
show: () => void;
|
|
15
|
+
createView: AnyFn;
|
|
16
|
+
removeView: () => void;
|
|
17
|
+
isDisabled: boolean;
|
|
18
|
+
isRemoved: boolean;
|
|
19
|
+
};
|
|
20
|
+
export declare class GameController {
|
|
21
|
+
container: Container;
|
|
22
|
+
branches: ChapterBranch[];
|
|
23
|
+
selectBranches: ReturnType<typeof SelectBranches>;
|
|
24
|
+
subscription: ISubscription;
|
|
25
|
+
player: IPlayer;
|
|
26
|
+
interactiveEvents: InteractiveEventsType;
|
|
27
|
+
ignoreContainerEvent: () => boolean;
|
|
28
|
+
isPermanentText: boolean;
|
|
29
|
+
disabledControls$: IValueSubject<boolean>;
|
|
30
|
+
onRemove: () => void;
|
|
31
|
+
globalEventEmitter: EventEmitter;
|
|
32
|
+
gameState: GameStates;
|
|
33
|
+
isSelectedControlEvent: boolean;
|
|
34
|
+
isSelectedContainerEvent: boolean;
|
|
2
35
|
constructor({ player, container, branches, selectBranches, interactiveEvents, globalEventEmitter, ignoreContainerEvent, permanentTextControls, disabledControls$, onRemove, }: {
|
|
3
36
|
player: any;
|
|
4
37
|
container: any;
|
|
@@ -11,20 +44,6 @@ export class GameController {
|
|
|
11
44
|
disabledControls$: any;
|
|
12
45
|
onRemove: any;
|
|
13
46
|
});
|
|
14
|
-
container: any;
|
|
15
|
-
branches: any;
|
|
16
|
-
selectBranches: any;
|
|
17
|
-
subscription: Subscription;
|
|
18
|
-
player: any;
|
|
19
|
-
interactiveEvents: any;
|
|
20
|
-
ignoreContainerEvent: any;
|
|
21
|
-
isPermanentText: any;
|
|
22
|
-
disabledControls$: any;
|
|
23
|
-
onRemove: any;
|
|
24
|
-
globalEventEmitter: any;
|
|
25
|
-
gameState: 0;
|
|
26
|
-
isSelectedControlEvent: boolean;
|
|
27
|
-
isSelectedContainerEvent: boolean;
|
|
28
47
|
registerEvents(): void;
|
|
29
48
|
hide: () => void;
|
|
30
49
|
show: () => void;
|
|
@@ -38,4 +57,4 @@ export class GameController {
|
|
|
38
57
|
removeView(): void;
|
|
39
58
|
destroy(): void;
|
|
40
59
|
}
|
|
41
|
-
|
|
60
|
+
export {};
|
|
@@ -1,22 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
initiator: any;
|
|
7
|
-
}) => boolean | undefined;
|
|
8
|
-
add: ({ timestamp, priority, initiator, ...rest }: {
|
|
9
|
-
[x: string]: any;
|
|
10
|
-
timestamp: any;
|
|
11
|
-
priority: any;
|
|
12
|
-
initiator: any;
|
|
13
|
-
}) => void;
|
|
14
|
-
removeAll: () => boolean;
|
|
15
|
-
get: ({ timestamp, priority, initiator }: {
|
|
16
|
-
timestamp: any;
|
|
17
|
-
priority: any;
|
|
18
|
-
initiator: any;
|
|
19
|
-
}) => any;
|
|
20
|
-
getLte: (timestamp: any) => {};
|
|
21
|
-
getGte: (timestamp: any) => {};
|
|
1
|
+
import type { EventActionKeys } from '../../../manifest';
|
|
2
|
+
export type TPriority = 'chapter' | 'container' | 'control';
|
|
3
|
+
export type TPayload = {
|
|
4
|
+
actionType: EventActionKeys;
|
|
5
|
+
action: AnyFn;
|
|
22
6
|
};
|
|
7
|
+
export type TMapInitiator = {
|
|
8
|
+
[initiator: string]: TPayload[];
|
|
9
|
+
};
|
|
10
|
+
type TMapPriority = {
|
|
11
|
+
[priority in TPriority]?: TMapInitiator;
|
|
12
|
+
};
|
|
13
|
+
type TMap = {
|
|
14
|
+
[timestamp: number]: TMapPriority;
|
|
15
|
+
};
|
|
16
|
+
export type TMapFlattened = {
|
|
17
|
+
timestamp: number;
|
|
18
|
+
priority: TPriority;
|
|
19
|
+
initiator: string;
|
|
20
|
+
} & TPayload;
|
|
21
|
+
type GetAndRemoveArgType = Partial<Omit<TMapFlattened, keyof TPayload>> & Pick<TMapFlattened, 'timestamp'>;
|
|
22
|
+
export type TGroupsStack = ReturnType<typeof GroupsStack>;
|
|
23
|
+
export declare function GroupsStack(): {
|
|
24
|
+
map: TMap;
|
|
25
|
+
remove: ({ timestamp, priority, initiator }: GetAndRemoveArgType) => boolean;
|
|
26
|
+
add: ({ timestamp, priority, initiator, ...rest }: TMapFlattened) => void;
|
|
27
|
+
removeAll: () => void;
|
|
28
|
+
get: ({ timestamp, priority, initiator }: GetAndRemoveArgType) => TMapInitiator | TPayload[] | TMapPriority | null;
|
|
29
|
+
getLte: (timestamp: number) => TMap;
|
|
30
|
+
getGte: (timestamp: number) => TMap;
|
|
31
|
+
};
|
|
32
|
+
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Nullable } from '@vkontakte/videoplayer-shared';
|
|
2
2
|
import type { IValueSubject } from '@vkontakte/videoplayer-shared';
|
|
3
3
|
import { EventEmitter } from '../../../utils/EventEmitter';
|
|
4
|
-
import type { VideoId } from '../../../
|
|
4
|
+
import type { VideoId } from '../../../manifest';
|
|
5
5
|
import type { Interactives } from '../../../modules/Interactives';
|
|
6
6
|
export interface HistoryApi {
|
|
7
|
-
get: (
|
|
8
|
-
save: (
|
|
7
|
+
get: (rawId: string) => Promise<number[]>;
|
|
8
|
+
save: (rawId: string, videoIds: number[]) => Promise<void>;
|
|
9
9
|
}
|
|
10
10
|
export interface HistorySettings {
|
|
11
11
|
maxLength: number;
|
|
@@ -35,7 +35,7 @@ export default class HistoryController {
|
|
|
35
35
|
goBack(): Promise<boolean | undefined>;
|
|
36
36
|
getProjectHistory(): Promise<void>;
|
|
37
37
|
getInitialChapterId(): string;
|
|
38
|
-
getInitialVideoId():
|
|
38
|
+
getInitialVideoId(): VideoId | null;
|
|
39
39
|
destroy(): void;
|
|
40
40
|
}
|
|
41
41
|
export {};
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
+
import { type Container } from '../../../manifest';
|
|
2
|
+
import { type TPayload, type TGroupsStack } from './GroupsStack';
|
|
3
|
+
import type { IPlayer } from '@vkontakte/videoplayer-core';
|
|
4
|
+
export type InteractiveEventsType = ReturnType<typeof InteractiveEvents>;
|
|
5
|
+
type AddMethodParamType = Parameters<TGroupsStack['add']>[0];
|
|
6
|
+
type RemoveMethodParamType = Parameters<TGroupsStack['remove']>[0];
|
|
1
7
|
/**
|
|
2
8
|
* Executes an events at different times of the current chapter
|
|
3
|
-
* @param {object} player
|
|
4
9
|
*/
|
|
5
|
-
export function InteractiveEvents(player:
|
|
6
|
-
setPlayer: (player:
|
|
7
|
-
add: (args:
|
|
8
|
-
remove: (args:
|
|
9
|
-
exec: (timestamp:
|
|
10
|
+
export declare function InteractiveEvents(player: IPlayer): {
|
|
11
|
+
setPlayer: (player: IPlayer) => void;
|
|
12
|
+
add: (args: AddMethodParamType) => void;
|
|
13
|
+
remove: (args: RemoveMethodParamType) => void;
|
|
14
|
+
exec: (timestamp: number) => void;
|
|
10
15
|
execEndOfVideo: () => void;
|
|
11
16
|
listen: () => void;
|
|
12
17
|
unlisten: () => void;
|
|
@@ -16,10 +21,11 @@ export function InteractiveEvents(player: object): {
|
|
|
16
21
|
timestamp: any;
|
|
17
22
|
id: any;
|
|
18
23
|
}) => void;
|
|
19
|
-
setData: (containers?:
|
|
20
|
-
resetCalled: (timestamp:
|
|
21
|
-
isReady: (timestamp:
|
|
24
|
+
setData: (containers?: Container[]) => void;
|
|
25
|
+
resetCalled: (timestamp: number) => void;
|
|
26
|
+
isReady: (timestamp: number) => boolean;
|
|
22
27
|
release: () => void;
|
|
23
28
|
};
|
|
24
|
-
getPreparedToExecActions: (timestamp?: number) =>
|
|
29
|
+
getPreparedToExecActions: (timestamp?: number) => TPayload[];
|
|
25
30
|
};
|
|
31
|
+
export {};
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import type { IPlayer } from '@vkontakte/videoplayer-core';
|
|
2
|
+
type ResizeManagerArg = () => {
|
|
3
|
+
parentElement: HTMLElement;
|
|
4
|
+
player?: Nullable<IPlayer>;
|
|
5
|
+
fns?: AnyFn[];
|
|
6
|
+
};
|
|
7
|
+
export declare function ResizeManager(getOptions: ResizeManagerArg): {
|
|
2
8
|
resizeObserver: ResizeObserver;
|
|
3
9
|
calc: () => void;
|
|
4
10
|
release: () => void;
|
|
5
11
|
};
|
|
12
|
+
export {};
|
|
@@ -1,54 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
containerId: any;
|
|
17
|
-
branches?: any[] | undefined;
|
|
18
|
-
onEvent: any;
|
|
19
|
-
isEOV?: (() => boolean) | undefined;
|
|
20
|
-
isDisabled?: (() => boolean) | undefined;
|
|
21
|
-
}) => void;
|
|
22
|
-
onContainerEvent: ({ action, container: { id: containerId, endTime }, branches, isEOV, autoSelected, }: {
|
|
23
|
-
action: any;
|
|
24
|
-
container: {
|
|
25
|
-
id: any;
|
|
26
|
-
endTime: any;
|
|
27
|
-
};
|
|
28
|
-
branches?: any[] | undefined;
|
|
29
|
-
isEOV?: boolean | undefined;
|
|
30
|
-
autoSelected?: boolean | undefined;
|
|
31
|
-
}) => void;
|
|
32
|
-
onChapterEvent: ({ chapterId, action, branches }: {
|
|
33
|
-
chapterId: any;
|
|
34
|
-
action: any;
|
|
35
|
-
branches?: any[] | undefined;
|
|
36
|
-
}) => (() => void) | undefined;
|
|
37
|
-
onExpectEvent: ({ subjectId, subjectName, action }: {
|
|
38
|
-
subjectId: any;
|
|
39
|
-
subjectName: any;
|
|
40
|
-
action: any;
|
|
41
|
-
}) => void;
|
|
42
|
-
expectEventHandler: ({ subjectId, subjectName }: {
|
|
43
|
-
subjectId: any;
|
|
44
|
-
subjectName: any;
|
|
45
|
-
}) => void;
|
|
46
|
-
setManifestChapterEvents: (chapter: any) => void;
|
|
47
|
-
setManifestContainerEvents: ({ container, branches, isEOV }: {
|
|
48
|
-
container: any;
|
|
49
|
-
branches: any;
|
|
50
|
-
isEOV?: boolean | undefined;
|
|
51
|
-
}) => void;
|
|
1
|
+
import type { Chapter } from '../../../manifest';
|
|
2
|
+
import type { SelectBranchesArg, OnControlEventArg, ContinuePlaybackArg, ExpectEventHandlerArg, OnChapterEventArg, OnContainerEventArg, OnExpectEventArg, SetManifestContainerEventsArg, ActionMap, AnyAction } from './SelectBranches.types';
|
|
3
|
+
export declare const defaultArgs: {
|
|
4
|
+
readonly shouldOpenNow: true;
|
|
5
|
+
readonly isDetachContainer: true;
|
|
6
|
+
};
|
|
7
|
+
export declare const extendArgs: <T extends AnyAction>(action: T, rewrite?: boolean) => T;
|
|
8
|
+
export declare const SelectBranches: ({ globalEventEmitter, player, interactiveEvents, removeControllers, }: SelectBranchesArg) => {
|
|
9
|
+
onControlEvent: ({ action, controlType, controlId, containerId, branches, onEvent, isEOV, isDisabled, }: OnControlEventArg) => void;
|
|
10
|
+
onContainerEvent: ({ action, container: { id: containerId, endTime }, branches, isEOV, autoSelected, }: OnContainerEventArg) => void;
|
|
11
|
+
onChapterEvent: ({ chapterId, action, branches }: OnChapterEventArg) => (() => ContinuePlaybackArg<"chapter">) | undefined;
|
|
12
|
+
onExpectEvent: <T extends keyof ActionMap>({ subjectId, subjectName }: OnExpectEventArg<T>) => void;
|
|
13
|
+
expectEventHandler: <T extends keyof ActionMap>({ subjectId, subjectName }: ExpectEventHandlerArg<T>) => void;
|
|
14
|
+
setManifestChapterEvents: (chapter: Chapter) => void;
|
|
15
|
+
setManifestContainerEvents: ({ container, branches, isEOV }: SetManifestContainerEventsArg) => void;
|
|
52
16
|
stopExpect: () => void;
|
|
53
17
|
state: {
|
|
54
18
|
isExpect: boolean;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { ChapterContainer, Control, ChapterBranch, ControlEvent, ContainerEvent, ChapterEvent } from '../../../manifest';
|
|
2
|
+
import type { EventEmitter } from '../../../utils/EventEmitter';
|
|
3
|
+
import type { IPlayer } from '@vkontakte/videoplayer-core';
|
|
4
|
+
import type { InteractiveEventsType } from './InteractiveEvents';
|
|
5
|
+
export type SubjectName = 'chapter' | 'container' | 'control';
|
|
6
|
+
export type SelectBranchesArg = {
|
|
7
|
+
globalEventEmitter: EventEmitter;
|
|
8
|
+
player: IPlayer;
|
|
9
|
+
interactiveEvents: InteractiveEventsType;
|
|
10
|
+
removeControllers?: AnyFn;
|
|
11
|
+
};
|
|
12
|
+
export type OnControlEventArg = {
|
|
13
|
+
action: ControlEvent['action'];
|
|
14
|
+
controlType: Control['type'];
|
|
15
|
+
controlId: Control['id'];
|
|
16
|
+
containerId: ChapterContainer['id'];
|
|
17
|
+
onEvent: AnyFn;
|
|
18
|
+
branches?: ChapterBranch[];
|
|
19
|
+
isEOV?: () => boolean;
|
|
20
|
+
isDisabled?: () => boolean;
|
|
21
|
+
};
|
|
22
|
+
export type OnContainerEventArg = {
|
|
23
|
+
action: ContainerEvent['action'];
|
|
24
|
+
container: ChapterContainer;
|
|
25
|
+
autoSelected?: boolean;
|
|
26
|
+
branches?: ChapterBranch[];
|
|
27
|
+
isEOV?: boolean;
|
|
28
|
+
};
|
|
29
|
+
export type OnChapterEventArg = {
|
|
30
|
+
action: ChapterEvent['action'];
|
|
31
|
+
chapterId: string;
|
|
32
|
+
branches?: ChapterBranch[];
|
|
33
|
+
};
|
|
34
|
+
export type SetManifestContainerEventsArg = {
|
|
35
|
+
container: ChapterContainer;
|
|
36
|
+
branches: ChapterBranch[];
|
|
37
|
+
isEOV?: boolean;
|
|
38
|
+
};
|
|
39
|
+
export type AnyAction = ControlEvent['action'] | ContainerEvent['action'] | ChapterEvent['action'];
|
|
40
|
+
export type ActionMap = {
|
|
41
|
+
control: ControlEvent['action'];
|
|
42
|
+
container: ContainerEvent['action'];
|
|
43
|
+
chapter: ChapterEvent['action'];
|
|
44
|
+
};
|
|
45
|
+
export type SubjectType<T extends keyof ActionMap> = T extends 'control' ? Control['type'] : undefined;
|
|
46
|
+
export type EventActionCommon<T extends keyof ActionMap> = {
|
|
47
|
+
subjectId: string;
|
|
48
|
+
subjectName: T;
|
|
49
|
+
subjectType?: SubjectType<T>;
|
|
50
|
+
};
|
|
51
|
+
export type EventActionCommonWithAction<T extends keyof ActionMap> = EventActionCommon<T> & {
|
|
52
|
+
action: ActionMap[T];
|
|
53
|
+
};
|
|
54
|
+
export type OpenURIArg<T extends keyof ActionMap> = EventActionCommonWithAction<T> & {
|
|
55
|
+
payload: {
|
|
56
|
+
URI?: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
export type ChangeManifestArg<T extends keyof ActionMap> = EventActionCommonWithAction<T> & {
|
|
60
|
+
payload: {
|
|
61
|
+
behaviour?: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
export type ChangeChapterArg<T extends keyof ActionMap> = EventActionCommonWithAction<T> & {
|
|
65
|
+
payload: {
|
|
66
|
+
chapterId: string;
|
|
67
|
+
autoSelect: boolean;
|
|
68
|
+
behaviour?: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
export type ContinuePlaybackArg<T extends keyof ActionMap> = EventActionCommonWithAction<T>;
|
|
72
|
+
export type OnExpectEventArg<T extends keyof ActionMap> = EventActionCommon<T>;
|
|
73
|
+
export type ExpectEventHandlerArg<T extends keyof ActionMap> = EventActionCommon<T>;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export declare const EVENT_NAMES: {
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Используйте interactivesInstance.events.graphVisibilityChanged$
|
|
4
|
+
* & interactivesInstance.events.watchAgainIsClicked$
|
|
5
|
+
*/
|
|
2
6
|
readonly graph: "graph";
|
|
3
7
|
readonly interactives: "interactives";
|
|
4
8
|
readonly chapterChanged: "chapter-changed";
|
|
@@ -9,6 +13,10 @@ export declare const EVENT_NAMES: {
|
|
|
9
13
|
readonly historyInited: "history-inited";
|
|
10
14
|
readonly historyDestroyed: "history-destroyed";
|
|
11
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated Используйте interactivesInstance.events.graphVisibilityChanged$ &
|
|
18
|
+
* interactivesInstance.events.watchAgainIsClicked$
|
|
19
|
+
*/
|
|
12
20
|
export declare const graphEventTypes: {
|
|
13
21
|
readonly visibility: "visibility";
|
|
14
22
|
readonly watchAgainClicked: "watchAgainClicked";
|
|
@@ -1,6 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
1
|
+
import { type ChapterBranch } from '../../../manifest';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a random number in the range [0, limit) or [limit, 0) if the 'limit'
|
|
4
|
+
* value is negative
|
|
5
|
+
*/
|
|
6
|
+
export declare const getRandomNumber: (limit: number) => number;
|
|
7
|
+
/**
|
|
8
|
+
* Finds the value with minimal weight number
|
|
9
|
+
*/
|
|
10
|
+
export declare const minFallbackStrategy: (branches: ChapterBranch[]) => Nullable<ChapterBranch>;
|
|
11
|
+
/**
|
|
12
|
+
* Finds the value with maximal weight number
|
|
13
|
+
*/
|
|
14
|
+
export declare const maxFallbackStrategy: (branches: ChapterBranch[]) => Nullable<ChapterBranch>;
|
|
15
|
+
/**
|
|
16
|
+
* Finds first branch with `isDefault === true` value
|
|
17
|
+
*/
|
|
18
|
+
export declare const defaultFallbackStrategy: (branches: ChapterBranch[]) => ChapterBranch | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Returns the random branch
|
|
21
|
+
*/
|
|
22
|
+
export declare const weightlessRandomFallbackStrategy: (branches: ChapterBranch[]) => ChapterBranch;
|
|
23
|
+
export declare const weightyRandomFallbackStrategy: (branches: ChapterBranch[]) => ChapterBranch;
|
|
@@ -1,26 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export function
|
|
1
|
+
import { type Control, type Chapter, type ChapterContainer } from '../../../manifest';
|
|
2
|
+
import type { GameController } from './GameController';
|
|
3
|
+
export declare enum GameStates {
|
|
4
|
+
nothing = 0,
|
|
5
|
+
beforeInteractive = 1,
|
|
6
|
+
interactive = 2,
|
|
7
|
+
afterInteractive = 3,
|
|
8
|
+
end = 4,
|
|
9
|
+
removed = 5,
|
|
10
|
+
destroyed = 6
|
|
11
|
+
}
|
|
12
|
+
export declare const isControlsExist: (controls: Control[]) => boolean;
|
|
13
|
+
export declare const isLastChapter: (chapter: Chapter) => boolean;
|
|
14
|
+
export declare const hasEndTemplate: (chapter: Chapter) => boolean;
|
|
15
|
+
export declare const isBeforeStartTime: (currentTime: number, container: ChapterContainer) => boolean;
|
|
16
|
+
export declare const isInteractiveTime: (currentTime: number, container: ChapterContainer) => boolean;
|
|
17
|
+
export declare const isAfterInteractiveTime: (currentTime: number, container: ChapterContainer) => boolean;
|
|
18
|
+
type AnyEvent = ChapterContainer['events'] | Chapter['events'] | Control['events'];
|
|
19
|
+
export declare const isExpectEvent: (events?: AnyEvent) => boolean;
|
|
20
|
+
export declare const getExpectEvent: (events?: AnyEvent) => import("@interactiveplatform/movika-graph-editor").ChapterEvent | import("@interactiveplatform/movika-graph-editor").ContainerEvent | import("@interactiveplatform/movika-graph-editor").ControlEvent | undefined;
|
|
21
|
+
export declare const isOneCtrlOneContainer: (controls: Control[]) => boolean;
|
|
22
|
+
export declare const isOneTextCtrlContainer: (controls: Control[]) => boolean;
|
|
23
|
+
export declare function excludeTextControl(containers?: ChapterContainer[]): ChapterContainer[];
|
|
24
|
+
export declare const isEOVEndTime: (target: HTMLVideoElement, endTime: ChapterContainer["endTime"]) => boolean;
|
|
25
|
+
export declare function partial<T extends unknown[], U extends unknown[], R>(fn: (...args: [...T, ...U]) => R, ...presetArgs: T): (...laterArgs: U) => R;
|
|
26
|
+
export declare function partial<T extends Record<string, unknown>, P extends Partial<T>>(fn: (args: T) => unknown, presetArgs: P): (laterArgs: Omit<T, keyof P>) => ReturnType<typeof fn>;
|
|
27
|
+
export declare const shouldIgnoreContainerEvent: (container: ChapterContainer, gameControllers: GameController[]) => boolean;
|
|
28
|
+
export {};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { type Container } from '../../../
|
|
2
|
-
type InteractiveRange = {
|
|
1
|
+
import { type Container } from '../../../manifest';
|
|
2
|
+
export type InteractiveRange = {
|
|
3
3
|
subjects: string[];
|
|
4
4
|
range: [number, number];
|
|
5
5
|
};
|
|
6
6
|
export type InteractiveRanges = Array<InteractiveRange>;
|
|
7
7
|
export declare const getInteractiveRanges: (containers?: Container[]) => InteractiveRanges;
|
|
8
|
-
export {};
|
|
@@ -1,62 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export const
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { type Control } from '../../../manifest';
|
|
2
|
+
import { type Dimensions } from '../../../modules/Interactives/controls';
|
|
3
|
+
export declare const classnamesPrefix = "interactive";
|
|
4
|
+
export declare const rootElClassName = "interactive-controls-container";
|
|
5
|
+
export declare const getRootEl: () => Element | null;
|
|
6
|
+
export declare const DISABLE_OPACITY = 0.4;
|
|
7
|
+
export declare const controlStylesFallbacks: {
|
|
8
|
+
textColor: string;
|
|
9
|
+
textSize: number;
|
|
10
|
+
textContent: string;
|
|
11
|
+
roundCorners: number;
|
|
12
|
+
borderWidth: number;
|
|
13
|
+
borderColor: string;
|
|
14
|
+
borderAlpha: number;
|
|
15
|
+
backgroundColor: string;
|
|
16
|
+
backgroundAlpha: number;
|
|
17
|
+
innerSizesDependOn: string;
|
|
18
|
+
angle: number;
|
|
19
|
+
};
|
|
20
|
+
type ControlStylesFallbacks = typeof controlStylesFallbacks;
|
|
21
|
+
export declare enum ALIGN_ITEMS {
|
|
22
|
+
top = "flex-start",
|
|
23
|
+
bottom = "flex-end",
|
|
24
|
+
center = "center"
|
|
17
25
|
}
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
26
|
+
export declare enum JUSTIFY_CONTENT {
|
|
27
|
+
start = "flex-start",
|
|
28
|
+
end = "flex-end",
|
|
29
|
+
center = "center"
|
|
22
30
|
}
|
|
23
|
-
export
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
export { center_1 as center };
|
|
31
|
+
export declare enum TEXT_ALIGN {
|
|
32
|
+
start = "left",
|
|
33
|
+
end = "right",
|
|
34
|
+
center = "center"
|
|
28
35
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
target:
|
|
43
|
-
props:
|
|
44
|
-
fallback:
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
target:
|
|
49
|
-
props:
|
|
50
|
-
fallback:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
fallback: any;
|
|
62
|
-
}): void;
|
|
36
|
+
type SetTextPositionStylesProps = {
|
|
37
|
+
target: HTMLElement;
|
|
38
|
+
props: Control['props'];
|
|
39
|
+
};
|
|
40
|
+
export declare const setTextPositionStyles: ({ target, props }: SetTextPositionStylesProps) => void;
|
|
41
|
+
type SetTextStylesProps = {
|
|
42
|
+
target: HTMLElement;
|
|
43
|
+
props: Control['props'];
|
|
44
|
+
fallback: ControlStylesFallbacks;
|
|
45
|
+
dependsOn: Dimensions;
|
|
46
|
+
};
|
|
47
|
+
export declare const setTextStyles: ({ target, props, fallback, dependsOn }: SetTextStylesProps) => void;
|
|
48
|
+
type SetBackgroundStylesProps = {
|
|
49
|
+
target: HTMLElement;
|
|
50
|
+
props: Control['props'];
|
|
51
|
+
fallback: ControlStylesFallbacks;
|
|
52
|
+
};
|
|
53
|
+
export declare const setBackgroundStyles: ({ target, props, fallback }: SetBackgroundStylesProps) => void;
|
|
54
|
+
type SetBorderStylesProps = {
|
|
55
|
+
target: HTMLElement;
|
|
56
|
+
props: Control['props'];
|
|
57
|
+
fallback: ControlStylesFallbacks;
|
|
58
|
+
dependsOn: Dimensions;
|
|
59
|
+
};
|
|
60
|
+
export declare const setBorderStyles: ({ target, props, fallback, dependsOn }: SetBorderStylesProps) => void;
|
|
61
|
+
type SetAngleProps = {
|
|
62
|
+
target: HTMLElement;
|
|
63
|
+
fallback: ControlStylesFallbacks;
|
|
64
|
+
layoutParams: Control['layoutParams'];
|
|
65
|
+
};
|
|
66
|
+
export declare const setAngle: ({ target, layoutParams, fallback }: SetAngleProps) => void;
|
|
67
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ManifestVideo, ManifestVideoVariant } from '../../../
|
|
2
|
-
export type {
|
|
1
|
+
import type { ManifestVideo, ManifestVideoVariant } from '../../../manifest';
|
|
2
|
+
export type { Extension, Standard } from '../../../manifest';
|
|
3
3
|
export interface GetVKVideoParams {
|
|
4
4
|
access_token: string;
|
|
5
5
|
owner_id?: number;
|