@vkontakte/videoplayer-interactive 1.0.60-dev.04f0bb5f.0 → 1.0.60-dev.bdbbdd48.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/index.d.ts +11 -0
- package/{types/manifest → manifest}/utils.d.ts +2 -1
- package/{types/modules → modules}/Graph/Graph.d.ts +4 -3
- package/{types/modules → modules}/Interactives/Interactives.d.ts +16 -13
- package/{types/modules → modules}/Interactives/Layout.d.ts +2 -2
- package/{types/modules → modules}/Interactives/containers/ChoiceContainer.d.ts +3 -3
- package/{types/modules → modules}/Interactives/containers/Container.d.ts +5 -5
- package/{types/modules → modules}/Interactives/containers/types.d.ts +2 -2
- package/{types/modules → modules}/Interactives/controls/AreaControl.d.ts +2 -1
- package/{types/modules → modules}/Interactives/controls/ButtonControl.d.ts +2 -1
- package/{types/modules → modules}/Interactives/controls/Control.d.ts +7 -6
- package/{types/modules → modules}/Interactives/controls/TextControl.d.ts +2 -1
- package/{types/modules → modules}/Interactives/controls/types.d.ts +4 -4
- package/modules/Interactives/index.d.ts +16 -0
- package/{types/modules → modules}/Interactives/types.d.ts +3 -3
- package/{types/modules → modules}/Interactives/utils/GameController.d.ts +5 -5
- package/{types/modules → modules}/Interactives/utils/GroupsStack.d.ts +4 -4
- package/{types/modules → modules}/Interactives/utils/HistoryController.d.ts +9 -9
- package/{types/modules → modules}/Interactives/utils/InteractiveEvents.d.ts +18 -17
- package/{types/modules → modules}/Interactives/utils/ResizeManager.d.ts +2 -2
- package/modules/Interactives/utils/SelectBranches.d.ts +23 -0
- package/{types/modules → modules}/Interactives/utils/SelectBranches.types.d.ts +3 -3
- package/{types/modules → modules}/Interactives/utils/angleUtils.d.ts +1 -1
- package/{types/modules → modules}/Interactives/utils/createControlText.d.ts +1 -1
- package/{types/modules → modules}/Interactives/utils/emitOnError.d.ts +3 -3
- package/{types/modules → modules}/Interactives/utils/events.d.ts +4 -4
- package/{types/modules → modules}/Interactives/utils/events.types.d.ts +3 -3
- package/{types/modules → modules}/Interactives/utils/fallbackStrategies.d.ts +4 -3
- package/{types/modules → modules}/Interactives/utils/gameUtils.d.ts +4 -3
- package/{types/modules → modules}/Interactives/utils/getInteractiveRanges.d.ts +1 -1
- package/{types/modules → modules}/Interactives/utils/renderingUtils.d.ts +2 -7
- package/{types/modules → modules}/Loaders/vkVideoLoader/types.d.ts +2 -2
- package/{types/modules → modules}/ManifestController/ManifestController.d.ts +6 -6
- package/{types/modules → modules}/ManifestController/utils.d.ts +4 -4
- package/{types/modules → modules}/SeamlessController/SeamlessController.d.ts +15 -11
- package/{types/modules → modules}/SeamlessController/utils.d.ts +2 -2
- package/{types/modules → modules}/SeekToInteractiveController/SeekToInteractiveController.d.ts +1 -1
- package/package.json +5 -4
- package/types/index.d.ts +2 -10
- package/{types/utils → utils}/Error.d.ts +1 -1
- package/{types/utils → utils}/LastFrame.d.ts +2 -2
- package/{types/utils → utils}/chapterHelpers.d.ts +1 -1
- package/{types/utils → utils}/extractVkMovieId.d.ts +1 -1
- package/{types/utils → utils}/typeCheck.d.ts +1 -1
- package/es2015.cjs +0 -285
- package/es2015.esm.js +0 -285
- package/es2018.cjs +0 -285
- package/es2018.esm.js +0 -285
- package/es2024.cjs +0 -285
- package/es2024.esm.js +0 -285
- package/esnext.cjs +0 -285
- package/esnext.esm.js +0 -285
- package/evergreen.esm.js +0 -285
- package/types/modules/Interactives/index.d.ts +0 -97
- package/types/modules/Interactives/utils/SelectBranches.d.ts +0 -23
- package/types/types/index.d.ts +0 -2
- package/{types/constants.d.ts → constants.d.ts} +0 -0
- package/{types/env.d.ts → env.d.ts} +0 -0
- package/{types/manifest → manifest}/index.d.ts +0 -0
- package/{types/modules → modules}/Graph/index.d.ts +0 -0
- package/{types/modules → modules}/Interactives/containers/index.d.ts +0 -0
- package/{types/modules → modules}/Interactives/containers/utils.d.ts +0 -0
- package/{types/modules → modules}/Interactives/controls/index.d.ts +0 -0
- package/{types/modules → modules}/Interactives/controls/utils.d.ts +0 -0
- package/{types/modules → modules}/Interactives/styles/index.d.ts +0 -0
- package/{types/modules → modules}/Interactives/styles/utils.d.ts +0 -0
- package/{types/modules → modules}/Interactives/utils/BlinkAnimationRef.d.ts +0 -0
- package/{types/modules → modules}/Interactives/utils/ControlFillAnimation/ControlFillAnimation.d.ts +0 -0
- package/{types/modules → modules}/Interactives/utils/ControlFillAnimation/index.d.ts +0 -0
- package/{types/modules → modules}/Interactives/utils/ControlFillAnimation/utils.d.ts +0 -0
- package/{types/modules → modules}/Interactives/utils/ControlTap/ControlTap.d.ts +0 -0
- package/{types/modules → modules}/Interactives/utils/ControlTap/index.d.ts +0 -0
- package/{types/modules → modules}/Interactives/utils/ControlTap/utils.d.ts +0 -0
- package/{types/modules → modules}/Interactives/utils/functionUtils.d.ts +0 -0
- package/{types/modules → modules}/Loaders/index.d.ts +0 -0
- package/{types/modules → modules}/Loaders/movikaProjectIdLoader/index.d.ts +0 -0
- package/{types/modules → modules}/Loaders/movikaProjectIdLoader/movikaProjectIdLoader.d.ts +0 -0
- package/{types/modules → modules}/Loaders/vkVideoLoader/CustomVkVideoLoader.d.ts +0 -0
- package/{types/modules → modules}/Loaders/vkVideoLoader/index.d.ts +0 -0
- package/{types/modules → modules}/Loaders/vkVideoLoader/utils.d.ts +0 -0
- package/{types/modules → modules}/ManifestController/Loadable.d.ts +0 -0
- package/{types/modules → modules}/ManifestController/index.d.ts +0 -0
- package/{types/modules → modules}/SeamlessController/InstanceManager.d.ts +0 -0
- package/{types/modules → modules}/SeekToInteractiveController/index.d.ts +0 -0
- package/types/{types/CustomError.d.ts → CustomError.d.ts} +0 -0
- package/types/{types/dom.d.ts → dom.d.ts} +0 -0
- package/{types/utils → utils}/CssVarsManager.d.ts +0 -0
- package/{types/utils → utils}/EventEmitter.d.ts +0 -0
- package/{types/utils → utils}/LastFrameCanvasAPI.d.ts +0 -0
- package/{types/utils → utils}/MultiMap.d.ts +0 -0
- package/{types/utils → utils}/Raf.d.ts +0 -0
- package/{types/utils → utils}/compareVersions.d.ts +0 -0
- package/{types/utils → utils}/debounce.d.ts +0 -0
- package/{types/utils → utils}/getVideoContentSize.d.ts +1 -1
- /package/{types/utils → utils}/hexToRgb.d.ts +0 -0
- /package/{types/utils → utils}/throttle.d.ts +0 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type { HistoryApi } from './modules/Interactives';
|
|
2
|
+
export { EVENT_NAMES, Interactives, utils, graphEventTypes, interactivesEventTypes, isLastChapter, hasEndTemplate, isOneTextCtrlContainer } from './modules/Interactives';
|
|
3
|
+
export type { IInteractiveOptions, InteractiveRange, InteractiveProjectInfo, PlayerChangedData, VideoInfo } from './modules/Interactives';
|
|
4
|
+
export { ManifestController } from './modules/ManifestController';
|
|
5
|
+
export * from './manifest';
|
|
6
|
+
export { compareVersions } from './utils/compareVersions';
|
|
7
|
+
export { CustomError } from './utils/Error';
|
|
8
|
+
export * from './utils/chapterHelpers';
|
|
9
|
+
export declare const SDKInfo: {
|
|
10
|
+
version: string;
|
|
11
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { EventActionTypes
|
|
1
|
+
import type { EventActionTypes } from '#/manifest';
|
|
2
|
+
import { type AnyManifest, type AnyControl } from '#/manifest';
|
|
2
3
|
/**
|
|
3
4
|
* checks manifest object validity
|
|
4
5
|
* @param manifest - manifest to check
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type
|
|
1
|
+
import type { Nullable } from '@vkontakte/videoplayer-shared';
|
|
2
|
+
import { type InterfaceLanguage } from '@vkontakte/videoplayer-shared';
|
|
3
|
+
import type { VideoInfo } from '#/modules/Interactives';
|
|
3
4
|
import type { GraphEditor } from '@interactiveplatform/movika-graph-editor';
|
|
4
|
-
import type { Chapter, Manifest } from '
|
|
5
|
+
import type { Chapter, Manifest } from '#/manifest';
|
|
5
6
|
interface GraphOptions {
|
|
6
7
|
lang: InterfaceLanguage | string;
|
|
7
8
|
root: HTMLElement;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import type { Nullable } from '@vkontakte/videoplayer-shared';
|
|
2
|
+
import { Observable, ValueSubject } from '@vkontakte/videoplayer-shared';
|
|
3
|
+
import { InteractiveInterfaceClick } from '@vkontakte/videoplayer-statistics';
|
|
4
|
+
import type { Chapter, Manifest, AnyManifest, ManifestVideo, GraphEditChapter, GraphViewChapter } from '#/manifest';
|
|
3
5
|
import { type GlobalEvents } from './utils/events';
|
|
4
6
|
import { type InteractiveRange } from './utils/getInteractiveRanges';
|
|
7
|
+
import { type HistoryControllerState } from './utils/HistoryController';
|
|
5
8
|
import type { IInteractiveOptions, IOptionalInteractiveOptions, VideoInfo } from './types';
|
|
6
9
|
import type { IPlayer } from '@vkontakte/videoplayer-core';
|
|
7
|
-
import type { InstanceStatistics } from '
|
|
10
|
+
import type { InstanceStatistics } from '#/modules/SeamlessController/InstanceManager';
|
|
8
11
|
declare enum INTERACTIVE_APP_STATES {
|
|
9
12
|
created = 0,
|
|
10
13
|
initiated = 1,
|
|
@@ -84,8 +87,8 @@ export declare class Interactives {
|
|
|
84
87
|
playPrev?: boolean;
|
|
85
88
|
}): Promise<void>;
|
|
86
89
|
getStatEvents(): {
|
|
87
|
-
click$: Observable<
|
|
88
|
-
nextMovie$: Observable<
|
|
90
|
+
click$: Observable<InteractiveInterfaceClick>;
|
|
91
|
+
nextMovie$: Observable<number>;
|
|
89
92
|
};
|
|
90
93
|
toggleGraphView(show?: boolean): Promise<void>;
|
|
91
94
|
setVisitedChapters(chapterIds: string[]): void;
|
|
@@ -114,22 +117,22 @@ export declare class Interactives {
|
|
|
114
117
|
videoId: string | null;
|
|
115
118
|
chapterId: string;
|
|
116
119
|
};
|
|
117
|
-
getHistoryState():
|
|
120
|
+
getHistoryState(): HistoryControllerState;
|
|
118
121
|
/**
|
|
119
122
|
* @deprecated Используйте this.state.isSeekable$
|
|
120
123
|
*/
|
|
121
124
|
getIsSeekable(): ValueSubject<boolean>;
|
|
122
|
-
getInteractiveRanges():
|
|
125
|
+
getInteractiveRanges(): InteractiveRange[];
|
|
123
126
|
getNextInteractiveStartTime(offsetMs?: number): number | null;
|
|
124
|
-
getChapterBranches(chapterId?: string): {
|
|
127
|
+
getChapterBranches(chapterId?: string): Array<{
|
|
125
128
|
chapter: Chapter;
|
|
126
|
-
graph:
|
|
127
|
-
media:
|
|
128
|
-
}
|
|
129
|
+
graph: GraphEditChapter | GraphViewChapter | undefined;
|
|
130
|
+
media: ManifestVideo;
|
|
131
|
+
}>;
|
|
129
132
|
getCurrentChapter(): {
|
|
130
133
|
chapter: Nullable<Chapter>;
|
|
131
|
-
media: Nullable<
|
|
132
|
-
graph: Nullable<
|
|
134
|
+
media: Nullable<ManifestVideo>;
|
|
135
|
+
graph: Nullable<Manifest['graph']>;
|
|
133
136
|
};
|
|
134
137
|
getCurrentManifest(): Nullable<Manifest>;
|
|
135
138
|
on(eventName: string, fn: AnyFn): this;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ChapterContainer, ControlLayoutParams } from '
|
|
2
|
-
import { CssVarsManager } from '
|
|
1
|
+
import type { ChapterContainer, ControlLayoutParams } from '#/manifest';
|
|
2
|
+
import type { CssVarsManager } from '#/utils/CssVarsManager';
|
|
3
3
|
declare abstract class Layout {
|
|
4
4
|
layout: ChapterContainer['layout'];
|
|
5
5
|
cssVarsManager: CssVarsManager;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Container } from './Container';
|
|
2
|
-
import { ChapterContainer } from '
|
|
2
|
+
import type { ChapterContainer } from '#/manifest';
|
|
3
3
|
import type { ChoiceContainerOptions, ContainerCreateViewParams } from './types';
|
|
4
|
-
import { Nullable } from '@vkontakte/videoplayer-shared';
|
|
5
|
-
import { CssVarsManager } from '
|
|
4
|
+
import type { Nullable } from '@vkontakte/videoplayer-shared';
|
|
5
|
+
import type { CssVarsManager } from '#/utils/CssVarsManager';
|
|
6
6
|
export declare const createChoiceContainer: (container: ChapterContainer, rootElement: HTMLElement, cssVarsManager: CssVarsManager, options?: ChoiceContainerOptions) => ChoiceContainer | undefined;
|
|
7
7
|
export declare class ChoiceContainer extends Container {
|
|
8
8
|
private rootElement;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Subject } from '@vkontakte/videoplayer-shared';
|
|
2
|
-
import { CustomError } from '
|
|
3
|
-
import type { ChapterContainer } from '
|
|
4
|
-
import { type Control, type ControlCreator, type Options } from '
|
|
2
|
+
import type { CustomError } from '#/utils/Error';
|
|
3
|
+
import type { ChapterContainer } from '#/manifest';
|
|
4
|
+
import { type Control, type ControlCreator, type Options } from '#/modules/Interactives/controls';
|
|
5
5
|
import { type ChoiceContainerOptions } from './types';
|
|
6
|
-
import { CssVarsManager } from '
|
|
6
|
+
import type { CssVarsManager } from '#/utils/CssVarsManager';
|
|
7
7
|
export declare class Container {
|
|
8
8
|
container: ChapterContainer;
|
|
9
9
|
options?: Options;
|
|
@@ -12,7 +12,7 @@ export declare class Container {
|
|
|
12
12
|
error$: Subject<CustomError>;
|
|
13
13
|
readonly cssVarsManager: CssVarsManager;
|
|
14
14
|
constructor(container: ChapterContainer, cssVarsManager: CssVarsManager, options?: Options);
|
|
15
|
-
featureIsEnabled(name: keyof ChoiceContainerOptions['features']):
|
|
15
|
+
featureIsEnabled(name: keyof ChoiceContainerOptions['features']): boolean;
|
|
16
16
|
onError(message: string | undefined, error: unknown): void;
|
|
17
17
|
addControlFactory(type: string, factory: ControlCreator<any>): void;
|
|
18
18
|
removeControlFactory(type: string): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Options, ControlEventCallback } from '../controls';
|
|
2
|
-
import { AnimationsFeatureToggles } from '../types';
|
|
1
|
+
import type { Options, ControlEventCallback } from '../controls';
|
|
2
|
+
import type { AnimationsFeatureToggles } from '../types';
|
|
3
3
|
export type ChoiceContainerOptions = {
|
|
4
4
|
isTouch: boolean;
|
|
5
5
|
features: Pick<AnimationsFeatureToggles, 'controlsExpectTimeBlinkAnimation' | 'controlsTapPlace' | 'controlsFillAnimation'>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Nullable } from '@vkontakte/videoplayer-shared';
|
|
1
2
|
import { Control } from './Control';
|
|
2
3
|
import { type ControlCreator, type ControlCreateViewParams, type TControl, type ControlOptions } from './types';
|
|
3
4
|
export declare const createAreaControl: ControlCreator<ControlOptions, AreaControl>;
|
|
@@ -7,7 +8,7 @@ declare class AreaControl extends Control {
|
|
|
7
8
|
registerBlinkAnimationEvents(): void;
|
|
8
9
|
disable(): void;
|
|
9
10
|
enable(): void;
|
|
10
|
-
getElement():
|
|
11
|
+
getElement(): Nullable<HTMLElement>;
|
|
11
12
|
updateShadowStyles(isDark?: boolean): void;
|
|
12
13
|
toggleBlinkAnimation(enable?: boolean): void;
|
|
13
14
|
syncBlinkAnimation(refAnim: HTMLElement): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Nullable } from '@vkontakte/videoplayer-shared';
|
|
1
2
|
import { Control } from './Control';
|
|
2
3
|
import { type ControlCreator, type ControlCreateViewParams, type TControl, type ControlOptions } from './types';
|
|
3
4
|
import { ControlFillAnimation } from '../utils/ControlFillAnimation';
|
|
@@ -11,7 +12,7 @@ declare class ButtonControl extends Control {
|
|
|
11
12
|
registerBlinkAnimationEvents(): void;
|
|
12
13
|
disable(): void;
|
|
13
14
|
enable(): void;
|
|
14
|
-
getElement():
|
|
15
|
+
getElement(): Nullable<HTMLElement>;
|
|
15
16
|
toggleBlinkAnimation(enable?: boolean): void;
|
|
16
17
|
syncBlinkAnimation(refAnim: HTMLElement): void;
|
|
17
18
|
onBlinkHovering(): void;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Nullable } from '@vkontakte/videoplayer-shared';
|
|
2
|
+
import { Subject, Subscription } from '@vkontakte/videoplayer-shared';
|
|
3
|
+
import type { CustomError } from '#/utils/Error';
|
|
3
4
|
import { ControlTap } from '../utils/ControlTap';
|
|
4
5
|
import type { ControlEventCallback, ControlCreateViewParams, Dimensions, Callbacks, Options, TControl, ControlOptions } from './types';
|
|
5
|
-
import { CssVarsManager } from '
|
|
6
|
+
import type { CssVarsManager } from '#/utils/CssVarsManager';
|
|
6
7
|
type ControlContainer = {
|
|
7
8
|
element: HTMLElement;
|
|
8
9
|
dimensions: Dimensions;
|
|
@@ -11,7 +12,7 @@ type ControlContainer = {
|
|
|
11
12
|
type ClickListener = (event: MouseEvent) => void;
|
|
12
13
|
export declare abstract class Control {
|
|
13
14
|
control: TControl;
|
|
14
|
-
options
|
|
15
|
+
options: Options | undefined;
|
|
15
16
|
container: Nullable<ControlContainer>;
|
|
16
17
|
controlElement: Nullable<HTMLElement>;
|
|
17
18
|
subscriptions: Subscription;
|
|
@@ -39,8 +40,8 @@ export declare abstract class Control {
|
|
|
39
40
|
addControlTap(controlElement: HTMLElement): void;
|
|
40
41
|
createContainerElement(callbacks: Callbacks): void;
|
|
41
42
|
createClickListener(callback: AnyFn): ClickListener;
|
|
42
|
-
featureIsEnabled(name: keyof ControlOptions['features']): boolean
|
|
43
|
-
isTouch(): boolean
|
|
43
|
+
featureIsEnabled(name: keyof ControlOptions['features']): boolean;
|
|
44
|
+
isTouch(): boolean;
|
|
44
45
|
setEvents(callback: ControlEventCallback): void;
|
|
45
46
|
removeListeners(): void;
|
|
46
47
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import type { Nullable } from '@vkontakte/videoplayer-shared';
|
|
1
2
|
import { Control } from './Control';
|
|
2
3
|
import { type ControlCreator, type ControlCreateViewParams, type TControl, type ControlOptions } from './types';
|
|
3
4
|
export declare const createTextControl: ControlCreator<ControlOptions, TextControl>;
|
|
4
5
|
declare class TextControl extends Control {
|
|
5
6
|
constructor(control: TControl, options?: ControlOptions);
|
|
6
7
|
createView({ parentElement, callbacks }: ControlCreateViewParams): void;
|
|
7
|
-
getElement():
|
|
8
|
+
getElement(): Nullable<HTMLElement>;
|
|
8
9
|
disable(): void;
|
|
9
10
|
enable(): void;
|
|
10
11
|
onProgress(): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Control as TControl, ControlEvent, ControlLayoutParams } from '
|
|
2
|
-
import type { Control } from '
|
|
3
|
-
import { AnimationsFeatureToggles } from '
|
|
4
|
-
export { TControl };
|
|
1
|
+
import type { Control as TControl, ControlEvent, ControlLayoutParams } from '#/manifest';
|
|
2
|
+
import type { Control } from '#/modules/Interactives/controls/Control';
|
|
3
|
+
import type { AnimationsFeatureToggles } from '#/modules/Interactives/types';
|
|
4
|
+
export type { TControl };
|
|
5
5
|
export declare const CONTROLLER_PREFIX = "int";
|
|
6
6
|
export declare enum CONTROLLER_IDS {
|
|
7
7
|
AREA = "int_area",
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Container, createChoiceContainer } from './containers/index';
|
|
2
|
+
import { createAreaControl, createButtonControl } from './controls';
|
|
3
|
+
import { classnamesPrefix } from './utils/renderingUtils';
|
|
4
|
+
export { Interactives } from './Interactives';
|
|
5
|
+
export { EVENT_NAMES, graphEventTypes, interactivesEventTypes } from './utils/events';
|
|
6
|
+
export type { InteractiveProjectInfo, PlayerChangedData, VideoInfo, IInteractiveOptions } from './types';
|
|
7
|
+
export type { HistoryApi } from './utils/HistoryController';
|
|
8
|
+
export { isLastChapter, hasEndTemplate, isOneTextCtrlContainer } from './utils/gameUtils';
|
|
9
|
+
export type { InteractiveRange } from './utils/getInteractiveRanges';
|
|
10
|
+
export declare const utils: {
|
|
11
|
+
Container: typeof Container;
|
|
12
|
+
createChoiceContainer: typeof createChoiceContainer;
|
|
13
|
+
createAreaControl: typeof createAreaControl;
|
|
14
|
+
createButtonControl: typeof createButtonControl;
|
|
15
|
+
classnamesPrefix: typeof classnamesPrefix;
|
|
16
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { InterfaceLanguage } from '@vkontakte/videoplayer-shared';
|
|
2
2
|
import type { IOptionalTuningConfig, IPlayer } from '@vkontakte/videoplayer-core';
|
|
3
3
|
import type { IOneStat } from '@vkontakte/videoplayer-statistics';
|
|
4
|
-
import type { Loaders } from '
|
|
5
|
-
import type { HistoryApi, HistorySettings } from '
|
|
6
|
-
import type { Chapter, ManifestVideo } from '
|
|
4
|
+
import type { Loaders } from '#/modules/ManifestController/Loadable';
|
|
5
|
+
import type { HistoryApi, HistorySettings } from '#/modules/Interactives/utils/HistoryController';
|
|
6
|
+
import type { Chapter, ManifestVideo } from '#/manifest';
|
|
7
7
|
export type { VideoInfo } from '@interactiveplatform/movika-graph-editor';
|
|
8
8
|
export type InteractiveProjectInfo = {
|
|
9
9
|
videoId: string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type ISubscription, type IValueSubject } from '@vkontakte/videoplayer-shared';
|
|
2
2
|
import { type IPlayer } from '@vkontakte/videoplayer-core';
|
|
3
3
|
import type { InteractiveEventsType } from './InteractiveEvents';
|
|
4
|
-
import type { ChapterBranch } from '
|
|
5
|
-
import type { EventEmitter } from '
|
|
6
|
-
import { CustomError } from '
|
|
4
|
+
import type { ChapterBranch } from '#/manifest';
|
|
5
|
+
import type { EventEmitter } from '#/utils/EventEmitter';
|
|
6
|
+
import type { CustomError } from '#/utils/Error';
|
|
7
7
|
import type { SelectBranchesType } from './SelectBranches';
|
|
8
|
-
import type { IgnoreExpectState, AnimationsFeatureToggles, IInteractiveOptions } from '
|
|
9
|
-
import type { ChoiceContainer } from '
|
|
8
|
+
import type { IgnoreExpectState, AnimationsFeatureToggles, IInteractiveOptions } from '#/modules/Interactives/types';
|
|
9
|
+
import type { ChoiceContainer } from '#/modules/Interactives/containers';
|
|
10
10
|
import { type GlobalEvents } from './events';
|
|
11
11
|
import { GameStates } from './gameUtils';
|
|
12
12
|
type Features = Pick<AnimationsFeatureToggles, 'controlsHideAnimation'> & Pick<IInteractiveOptions, 'enableAvPlayerSupport'>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { EventActionKeys } from '
|
|
1
|
+
import type { EventActionKeys } from '#/manifest';
|
|
2
2
|
export type TPriority = 'chapter' | 'container' | 'control';
|
|
3
3
|
export type TPayload = {
|
|
4
4
|
actionType: EventActionKeys;
|
|
@@ -22,10 +22,10 @@ type GetAndRemoveArgType = Partial<Omit<TMapFlattened, keyof TPayload>> & Pick<T
|
|
|
22
22
|
export type TGroupsStack = ReturnType<typeof GroupsStack>;
|
|
23
23
|
export declare function GroupsStack(): {
|
|
24
24
|
map: TMap;
|
|
25
|
-
remove: (
|
|
26
|
-
add: (
|
|
25
|
+
remove: (args: GetAndRemoveArgType) => boolean;
|
|
26
|
+
add: (args: TMapFlattened) => void;
|
|
27
27
|
removeAll: () => void;
|
|
28
|
-
get: (
|
|
28
|
+
get: (args: GetAndRemoveArgType) => TMapPriority | TMapInitiator | TPayload[] | null;
|
|
29
29
|
getLte: (timestamp: number) => TMap;
|
|
30
30
|
getGte: (timestamp: number) => TMap;
|
|
31
31
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { IValueSubject } from '@vkontakte/videoplayer-shared';
|
|
3
|
-
import { EventEmitter } from '
|
|
4
|
-
import type { VideoId } from '
|
|
5
|
-
import type { VideoInfo } from '
|
|
6
|
-
import type { Interactives } from '
|
|
7
|
-
import { CustomError } from '
|
|
1
|
+
import { Subject } from '@vkontakte/videoplayer-shared';
|
|
2
|
+
import type { IValueSubject, Nullable } from '@vkontakte/videoplayer-shared';
|
|
3
|
+
import type { EventEmitter } from '#/utils/EventEmitter';
|
|
4
|
+
import type { Manifest, VideoId } from '#/manifest';
|
|
5
|
+
import type { VideoInfo } from '#/modules/Interactives';
|
|
6
|
+
import type { Interactives } from '#/modules/Interactives';
|
|
7
|
+
import { CustomError } from '#/utils/Error';
|
|
8
8
|
export interface HistoryApi {
|
|
9
9
|
get: (rawId: string) => Promise<number[]>;
|
|
10
10
|
save: (rawId: string, videoIds: number[]) => Promise<void>;
|
|
@@ -40,10 +40,10 @@ export default class HistoryController {
|
|
|
40
40
|
error$: Subject<CustomError>;
|
|
41
41
|
};
|
|
42
42
|
constructor({ globalEventEmitter, videoId, interactiveController, historyApi, settings }: HistoryControllerParams);
|
|
43
|
-
setManifest(manifest:
|
|
43
|
+
setManifest(manifest: Manifest): Promise<void>;
|
|
44
44
|
get inited(): boolean;
|
|
45
45
|
updateHistory(chapterIds: string[], shouldSave?: boolean): Promise<void>;
|
|
46
|
-
goBack(): Promise<
|
|
46
|
+
goBack(): Promise<void>;
|
|
47
47
|
getProjectHistory(): Promise<void>;
|
|
48
48
|
getInitialChapterId(): string;
|
|
49
49
|
getInitialVideoId(): VideoId | null;
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import { type Container } from '
|
|
1
|
+
import { type Container } from '#/manifest';
|
|
2
2
|
import { type TPayload, type TGroupsStack } from './GroupsStack';
|
|
3
3
|
import type { IPlayer } from '@vkontakte/videoplayer-core';
|
|
4
|
-
export type InteractiveEventsType = ReturnType<typeof InteractiveEvents>;
|
|
5
4
|
type AddMethodParamType = Parameters<TGroupsStack['add']>[0];
|
|
6
5
|
type RemoveMethodParamType = Parameters<TGroupsStack['remove']>[0];
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
export interface ContainersEventsCallStateType {
|
|
7
|
+
setCalled: (args: {
|
|
8
|
+
timestamp: number;
|
|
9
|
+
id: string;
|
|
10
|
+
}) => void;
|
|
11
|
+
setData: (containers?: Container[]) => void;
|
|
12
|
+
resetCalled: (timestamp: number) => void;
|
|
13
|
+
isReady: (timestamp: number) => boolean;
|
|
14
|
+
release: () => void;
|
|
15
|
+
}
|
|
16
|
+
export interface InteractiveEventsType {
|
|
11
17
|
setPlayer: (player: IPlayer) => void;
|
|
12
18
|
add: (args: AddMethodParamType) => void;
|
|
13
19
|
remove: (args: RemoveMethodParamType) => void;
|
|
@@ -16,16 +22,11 @@ export declare function InteractiveEvents(player: IPlayer, interactiveTimeOpenUr
|
|
|
16
22
|
listen: () => void;
|
|
17
23
|
unlisten: () => void;
|
|
18
24
|
release: () => void;
|
|
19
|
-
containersEventsCallState:
|
|
20
|
-
setCalled: ({ timestamp, id }: {
|
|
21
|
-
timestamp: number;
|
|
22
|
-
id: string;
|
|
23
|
-
}) => void;
|
|
24
|
-
setData: (containers?: Container[]) => void;
|
|
25
|
-
resetCalled: (timestamp: number) => void;
|
|
26
|
-
isReady: (timestamp: number) => boolean;
|
|
27
|
-
release: () => void;
|
|
28
|
-
};
|
|
25
|
+
containersEventsCallState: ContainersEventsCallStateType;
|
|
29
26
|
getPreparedToExecActions: (timestamp?: number) => TPayload[];
|
|
30
|
-
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Executes an events at different times of the current chapter
|
|
30
|
+
*/
|
|
31
|
+
export declare function InteractiveEvents(player: IPlayer, interactiveTimeOpenUri: boolean): InteractiveEventsType;
|
|
31
32
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IPlayer } from '@vkontakte/videoplayer-core';
|
|
2
|
-
import { Nullable } from '@vkontakte/videoplayer-shared';
|
|
3
|
-
import { CssVarsManager } from '
|
|
2
|
+
import type { Nullable } from '@vkontakte/videoplayer-shared';
|
|
3
|
+
import type { CssVarsManager } from '#/utils/CssVarsManager';
|
|
4
4
|
type ResizeManagerArg = () => {
|
|
5
5
|
parentElement: HTMLElement;
|
|
6
6
|
cssVarsManager: CssVarsManager;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Chapter } from '#/manifest';
|
|
2
|
+
import type { SelectBranchesArg, OnControlEventArg, ChangeChapterArg, ContinuePlaybackArg, ExpectEventHandlerArg, OnChapterEventArg, OnContainerEventArg, OnExpectEventArg, SetManifestContainerEventsArg, OpenURIArg, ActionMap, AnyAction, AfterExpectActionType } from './SelectBranches.types';
|
|
3
|
+
export declare const defaultArgs: {
|
|
4
|
+
readonly shouldOpenNow: true;
|
|
5
|
+
readonly isDetachContainer: true;
|
|
6
|
+
};
|
|
7
|
+
export declare const AFTER_EXPECT_ACTION: AfterExpectActionType;
|
|
8
|
+
export declare const extendArgs: <T extends AnyAction>(action: T, rewrite?: boolean) => T;
|
|
9
|
+
export type ExtendArgsReturnType = ReturnType<typeof extendArgs>;
|
|
10
|
+
export declare const SelectBranches: ({ globalEventEmitter, globalEvents, player, interactiveEvents }: SelectBranchesArg) => {
|
|
11
|
+
onControlEvent: (arg: OnControlEventArg) => void;
|
|
12
|
+
onContainerEvent: (arg: OnContainerEventArg) => void;
|
|
13
|
+
onChapterEvent: (arg: OnChapterEventArg) => (() => ChangeChapterArg<"chapter">) | (() => ContinuePlaybackArg<"chapter">) | (() => OpenURIArg<"chapter">) | undefined;
|
|
14
|
+
onExpectEvent: <T extends keyof ActionMap>(arg: OnExpectEventArg<T>) => void;
|
|
15
|
+
expectEventHandler: <T extends keyof ActionMap>(arg: ExpectEventHandlerArg<T>) => void;
|
|
16
|
+
setManifestChapterEvents: (chapter: Chapter) => void;
|
|
17
|
+
setManifestContainerEvents: (arg: SetManifestContainerEventsArg) => void;
|
|
18
|
+
stopExpect: () => void;
|
|
19
|
+
state: {
|
|
20
|
+
isExpect: boolean;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export type SelectBranchesType = typeof SelectBranches;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { ChapterContainer, Control, ChapterBranch, ControlEvent, ContainerEvent, ChapterEvent } from '
|
|
2
|
-
import type { EventEmitter } from '
|
|
1
|
+
import type { ChapterContainer, Control, ChapterBranch, ControlEvent, ContainerEvent, ChapterEvent } from '#/manifest';
|
|
2
|
+
import type { EventEmitter } from '#/utils/EventEmitter';
|
|
3
3
|
import type { IPlayer } from '@vkontakte/videoplayer-core';
|
|
4
4
|
import type { InteractiveEventsType } from './InteractiveEvents';
|
|
5
5
|
import type { GlobalEvents } from './events';
|
|
6
|
-
import { Nullable } from '@vkontakte/videoplayer-shared';
|
|
6
|
+
import type { Nullable } from '@vkontakte/videoplayer-shared';
|
|
7
7
|
export type SubjectName = 'chapter' | 'container' | 'control';
|
|
8
8
|
export type AfterExpectActionType = 'after-expect';
|
|
9
9
|
export type Behaviour = 'change-chapter' | 'change-manifest';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ErrorCategoryEnum, ErrorSeverityEnum } from '
|
|
2
|
-
import { CustomError } from '
|
|
3
|
-
import { Subject } from '@vkontakte/videoplayer-shared';
|
|
1
|
+
import { ErrorCategoryEnum, ErrorSeverityEnum } from '#/types';
|
|
2
|
+
import { CustomError } from '#/utils/Error';
|
|
3
|
+
import type { Subject } from '@vkontakte/videoplayer-shared';
|
|
4
4
|
type EmitOnErrorArg = {
|
|
5
5
|
emitter$: Subject<CustomError>;
|
|
6
6
|
error?: unknown;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Subject } from '@vkontakte/videoplayer-shared';
|
|
2
|
-
import type { ChapterChangedData, EachTickData, PlayerChangedData } from '
|
|
3
|
-
import type { CustomError } from '
|
|
4
|
-
import type { Manifest } from '
|
|
5
|
-
import { TInteractiveRangeEndedEvent, TInteractivesActionChoiceEvent, TInteractivesActionExecutionEvent, TInteractivesContainerRemoved, TInteractivesContainerFakeRemoved, SubjectName, TInteractivesVisibility } from './events.types';
|
|
2
|
+
import type { ChapterChangedData, EachTickData, PlayerChangedData } from '#/modules/Interactives/types';
|
|
3
|
+
import type { CustomError } from '#/utils/Error';
|
|
4
|
+
import type { Manifest } from '#/manifest';
|
|
5
|
+
import type { TInteractiveRangeEndedEvent, TInteractivesActionChoiceEvent, TInteractivesActionExecutionEvent, TInteractivesContainerRemoved, TInteractivesContainerFakeRemoved, SubjectName, TInteractivesVisibility } from './events.types';
|
|
6
6
|
export interface GlobalEvents {
|
|
7
7
|
noInteraction$: Subject<void>;
|
|
8
8
|
graphVisibilityChanged$: Subject<boolean>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SubjectName, ActionMap, SubjectType, AfterExpectActionType, Behaviour } from './SelectBranches.types';
|
|
2
|
-
import { InteractivesEventTypes } from './events';
|
|
3
|
-
import { EventActionTypes } from '
|
|
4
|
-
import type { ControlEvent, ContainerEvent, ChapterEvent, ChapterContainer, Control } from '
|
|
2
|
+
import type { InteractivesEventTypes } from './events';
|
|
3
|
+
import type { EventActionTypes } from '#/manifest';
|
|
4
|
+
import type { ControlEvent, ContainerEvent, ChapterEvent, ChapterContainer, Control } from '#/manifest';
|
|
5
5
|
import type { InteractiveRange } from './getInteractiveRanges';
|
|
6
6
|
export type { SubjectName };
|
|
7
7
|
type InteractivesEventTypesValues = `${InteractivesEventTypes}`;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type ChapterBranch } from '
|
|
1
|
+
import { type ChapterBranch } from '#/manifest';
|
|
2
|
+
import type { Nullable } from '@vkontakte/videoplayer-shared';
|
|
2
3
|
/**
|
|
3
4
|
* Returns a random number in the range [0, limit) or [limit, 0) if the 'limit'
|
|
4
5
|
* value is negative
|
|
@@ -7,11 +8,11 @@ export declare const getRandomNumber: (limit: number) => number;
|
|
|
7
8
|
/**
|
|
8
9
|
* Finds the value with minimal weight number
|
|
9
10
|
*/
|
|
10
|
-
export declare const minFallbackStrategy: (branches: ChapterBranch[]) => ChapterBranch
|
|
11
|
+
export declare const minFallbackStrategy: (branches: ChapterBranch[]) => Nullable<ChapterBranch>;
|
|
11
12
|
/**
|
|
12
13
|
* Finds the value with maximal weight number
|
|
13
14
|
*/
|
|
14
|
-
export declare const maxFallbackStrategy: (branches: ChapterBranch[]) => ChapterBranch
|
|
15
|
+
export declare const maxFallbackStrategy: (branches: ChapterBranch[]) => Nullable<ChapterBranch>;
|
|
15
16
|
/**
|
|
16
17
|
* Finds first branch with `isDefault === true` value
|
|
17
18
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type Control, type Chapter, type ChapterContainer } from '
|
|
1
|
+
import { type Control, type Chapter, type ChapterContainer } from '#/manifest';
|
|
2
2
|
import type { GameController } from './GameController';
|
|
3
|
-
import type { IgnoreExpectState } from '
|
|
3
|
+
import type { IgnoreExpectState } from '#/modules/Interactives/types';
|
|
4
4
|
export declare enum GameStates {
|
|
5
5
|
nothing = 0,
|
|
6
6
|
beforeInteractive = 1,
|
|
@@ -17,8 +17,9 @@ export declare const isBeforeStartTime: (currentTime: number, container: Chapter
|
|
|
17
17
|
export declare const isInteractiveTime: (currentTime: number, container: ChapterContainer) => boolean;
|
|
18
18
|
export declare const isAfterInteractiveTime: (currentTime: number, container: ChapterContainer) => boolean;
|
|
19
19
|
type AnyEvent = (ChapterContainer | Chapter | Control)['events'];
|
|
20
|
+
type ExtractItemFromArray<T> = T extends (infer U)[] ? U : never;
|
|
20
21
|
export declare const isExpectEvent: (events?: AnyEvent) => boolean;
|
|
21
|
-
export declare const getExpectEvent: (events?: AnyEvent) =>
|
|
22
|
+
export declare const getExpectEvent: (events?: AnyEvent) => ExtractItemFromArray<AnyEvent> | undefined;
|
|
22
23
|
export declare const isOneCtrlOneContainer: (controls: Control[]) => boolean;
|
|
23
24
|
export declare const isOneTextCtrlContainer: (controls: Control[]) => boolean;
|
|
24
25
|
export declare function excludeTextControl(containers?: ChapterContainer[]): ChapterContainer[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Control } from '
|
|
2
|
-
import { type Dimensions } from '
|
|
1
|
+
import { type Control } from '#/manifest';
|
|
2
|
+
import { type Dimensions } from '#/modules/Interactives/controls';
|
|
3
3
|
export declare const classnamesPrefix = "interactive";
|
|
4
4
|
export declare const controlStylesFallbacks: {
|
|
5
5
|
textColor: string;
|
|
@@ -30,11 +30,6 @@ export declare enum JUSTIFY_CONTENT {
|
|
|
30
30
|
end = "flex-end",
|
|
31
31
|
center = "center"
|
|
32
32
|
}
|
|
33
|
-
export declare enum TEXT_ALIGN {
|
|
34
|
-
start = "left",
|
|
35
|
-
end = "right",
|
|
36
|
-
center = "center"
|
|
37
|
-
}
|
|
38
33
|
export type SetTextPositionStylesProps = {
|
|
39
34
|
target: HTMLElement;
|
|
40
35
|
props: Control['props']['text'] & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ManifestVideo, ManifestVideoVariant } from '
|
|
2
|
-
export type { Extension, Standard } from '
|
|
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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IValueSubject, Nullable } from '@vkontakte/videoplayer-shared';
|
|
2
|
-
import type { ChapterBranch, ManifestVideo, Chapter, Manifest, GraphEditChapter, GraphViewChapter, AnyManifest } from '
|
|
3
|
-
import { Loadable } from './Loadable';
|
|
2
|
+
import type { ChapterBranch, ManifestVideo, Chapter, Manifest, GraphEditChapter, GraphViewChapter, AnyManifest } from '#/manifest';
|
|
3
|
+
import { Loadable, type Loaders } from './Loadable';
|
|
4
4
|
type BranchesData = {
|
|
5
5
|
chapter: Chapter;
|
|
6
6
|
graph: GraphEditChapter | GraphViewChapter | undefined;
|
|
@@ -12,21 +12,21 @@ export declare class ManifestController extends Loadable {
|
|
|
12
12
|
media: Nullable<ManifestVideo>;
|
|
13
13
|
graph: Nullable<Manifest['graph']>;
|
|
14
14
|
prevChapter$: IValueSubject<Chapter | null>;
|
|
15
|
-
onError:
|
|
16
|
-
constructor(loaders:
|
|
15
|
+
onError: (err: unknown) => void;
|
|
16
|
+
constructor(loaders: Partial<Loaders>, onError: (err: unknown) => void);
|
|
17
17
|
release(): this;
|
|
18
18
|
setManifest(source: AnyManifest | string): Promise<ManifestController>;
|
|
19
19
|
setInitial(): Promise<ManifestController>;
|
|
20
20
|
setNext(chapterId?: string | undefined): Promise<ManifestController>;
|
|
21
21
|
errorHandler(errors: unknown): void;
|
|
22
|
-
getInitial(): BranchesData
|
|
22
|
+
getInitial(): Nullable<BranchesData>;
|
|
23
23
|
getByChapterId(chapterId?: string | undefined): Nullable<BranchesData>;
|
|
24
24
|
getBranches(chapterId?: string | undefined): BranchesData[];
|
|
25
25
|
getByBranches(branches?: ChapterBranch[]): BranchesData[];
|
|
26
26
|
getCurrent(): {
|
|
27
27
|
chapter: Nullable<Chapter>;
|
|
28
28
|
media: Nullable<ManifestVideo>;
|
|
29
|
-
graph: Nullable<
|
|
29
|
+
graph: Nullable<Manifest['graph']>;
|
|
30
30
|
};
|
|
31
31
|
isInitialChapter(): boolean;
|
|
32
32
|
isEndChapter(): boolean;
|