@vkontakte/videoplayer-interactive 1.0.30-dev.b736679d.0 → 1.0.30-dev.d16c215e.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 +5 -233
- package/es2015.esm.js +6 -234
- package/es2018.cjs.js +6 -234
- package/es2018.esm.js +5 -233
- package/esnext.cjs.js +6 -234
- package/esnext.esm.js +6 -234
- package/evergreen.esm.js +6 -234
- package/package.json +4 -4
- package/types/modules/Interactives/Interactives.d.ts +8 -19
- package/types/modules/Interactives/Layout.d.ts +0 -4
- package/types/modules/Interactives/containers/ChoiceContainer.d.ts +6 -16
- package/types/modules/Interactives/containers/Container.d.ts +6 -9
- package/types/modules/Interactives/controls/AreaControl.d.ts +2 -22
- package/types/modules/Interactives/controls/ButtonControl.d.ts +2 -27
- package/types/modules/Interactives/controls/Control.d.ts +9 -22
- package/types/modules/Interactives/controls/types.d.ts +7 -21
- package/types/modules/Interactives/index.d.ts +4 -69
- package/types/modules/Interactives/types.d.ts +4 -12
- package/types/modules/Interactives/utils/GameController.d.ts +6 -14
- package/types/modules/Interactives/utils/InteractiveEvents.d.ts +2 -2
- package/types/modules/Interactives/utils/SelectBranches.d.ts +1 -2
- package/types/modules/Interactives/utils/SelectBranches.types.d.ts +0 -1
- package/types/modules/Interactives/utils/events.types.d.ts +1 -3
- package/types/modules/Interactives/utils/renderingUtils.d.ts +3 -15
- package/types/utils/Binding.d.ts +34 -0
- package/types/utils/EventManager.d.ts +13 -0
- package/types/utils/getVideoContentSize.d.ts +1 -1
- package/types/modules/Interactives/styles.d.ts +0 -1
- package/types/modules/Interactives/utils/BlinkAnimationReference.d.ts +0 -2
- package/types/modules/Interactives/utils/FillAnimation.d.ts +0 -30
- package/types/modules/Interactives/utils/TapElement.d.ts +0 -10
- package/types/utils/AverageColor/FrameAverageColor.d.ts +0 -19
- package/types/utils/AverageColor/helpers.d.ts +0 -17
- package/types/utils/AverageColor/index.d.ts +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer-interactive",
|
|
3
|
-
"version": "1.0.30-dev.
|
|
3
|
+
"version": "1.0.30-dev.d16c215e.0",
|
|
4
4
|
"author": "vk.com",
|
|
5
5
|
"description": "Movika interactive SDK",
|
|
6
6
|
"homepage": "https://vk.com",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@interactiveplatform/movika-graph-editor": "1.11.0",
|
|
53
53
|
"@interactiveplatform/movika-manifest": "^1.0.0",
|
|
54
|
-
"@vkontakte/videoplayer-core": "2.0.124-dev.
|
|
55
|
-
"@vkontakte/videoplayer-shared": "1.0.53-dev.
|
|
56
|
-
"@vkontakte/videoplayer-statistics": "1.0.70-dev.
|
|
54
|
+
"@vkontakte/videoplayer-core": "2.0.124-dev.b149ab67.0",
|
|
55
|
+
"@vkontakte/videoplayer-shared": "1.0.53-dev.2195fbd7.0",
|
|
56
|
+
"@vkontakte/videoplayer-statistics": "1.0.70-dev.23b9fea2.0"
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -12,11 +12,11 @@ declare enum INTERACTIVE_APP_STATES {
|
|
|
12
12
|
destroyed = 3
|
|
13
13
|
}
|
|
14
14
|
export declare class Interactives {
|
|
15
|
-
private
|
|
16
|
-
private subscriptions;
|
|
15
|
+
private subscription;
|
|
17
16
|
private globalEventEmitter;
|
|
18
17
|
private eventsSubs;
|
|
19
18
|
private animation;
|
|
19
|
+
private eventManager;
|
|
20
20
|
private seekToInteractiveController;
|
|
21
21
|
private endedRanges;
|
|
22
22
|
private gameControllers;
|
|
@@ -35,7 +35,6 @@ export declare class Interactives {
|
|
|
35
35
|
private graph;
|
|
36
36
|
private lastFrame;
|
|
37
37
|
private noInteractionTimeout;
|
|
38
|
-
private frameAverageColor;
|
|
39
38
|
appState: INTERACTIVE_APP_STATES;
|
|
40
39
|
state: {
|
|
41
40
|
prevChapter$: ValueSubject<Nullable<Chapter>>;
|
|
@@ -54,27 +53,17 @@ export declare class Interactives {
|
|
|
54
53
|
};
|
|
55
54
|
events: GlobalEvents;
|
|
56
55
|
constructor(options: IOptionalInteractiveOptions);
|
|
57
|
-
private getVideoFrameAverageColorInfo;
|
|
58
56
|
private emitErrorEvent;
|
|
59
57
|
private clearHistoryIfEnded;
|
|
60
58
|
private initSubscriptions;
|
|
61
|
-
private getGameControllerContainersWithExpect;
|
|
62
|
-
private execForAllExpectContainers;
|
|
63
|
-
private updateControlsShadowStyles;
|
|
64
|
-
private toggleControlsCTAAnimation;
|
|
65
59
|
private initSeamless;
|
|
66
60
|
private handleSeamlessPlayerChanged;
|
|
67
61
|
private onPlaybackStarted;
|
|
68
62
|
private handlePositionChange;
|
|
69
63
|
private registerVideoEvents;
|
|
70
|
-
|
|
71
|
-
includeTextControls?: boolean | undefined;
|
|
72
|
-
}) => void;
|
|
73
|
-
destroyGameControllers: ({ includeTextControls }?: {
|
|
74
|
-
includeTextControls?: boolean | undefined;
|
|
75
|
-
}) => void;
|
|
64
|
+
private removeControllers;
|
|
76
65
|
private setGameControllers;
|
|
77
|
-
private
|
|
66
|
+
private filterGameControllers;
|
|
78
67
|
private checkIfSeekable;
|
|
79
68
|
private updateLastEventInfo;
|
|
80
69
|
private pushChapterToHistory;
|
|
@@ -98,7 +87,7 @@ export declare class Interactives {
|
|
|
98
87
|
setVisitedChapters(chapterIds: string[]): void;
|
|
99
88
|
updateGraphVideosInfo(videosInfo: VideoInfo[]): void;
|
|
100
89
|
deadEndCheck(): boolean;
|
|
101
|
-
allControlsAreRemoved(
|
|
90
|
+
allControlsAreRemoved(): boolean;
|
|
102
91
|
isEndedExpectation(): boolean;
|
|
103
92
|
playPrevChapter(): void;
|
|
104
93
|
setDisabledControls(value: boolean): void;
|
|
@@ -125,9 +114,9 @@ export declare class Interactives {
|
|
|
125
114
|
graph: Nullable<import("@interactiveplatform/movika-manifest").GraphDesign>;
|
|
126
115
|
};
|
|
127
116
|
getCurrentManifest(): Nullable<Manifest>;
|
|
128
|
-
on(eventName: string, fn:
|
|
129
|
-
off(eventName: string, fn:
|
|
130
|
-
once(eventName: string, fn:
|
|
117
|
+
on(eventName: string, fn: Function): this;
|
|
118
|
+
off(eventName: string, fn: Function): this;
|
|
119
|
+
once(eventName: string, fn: Function): this;
|
|
131
120
|
destroy(): void;
|
|
132
121
|
}
|
|
133
122
|
export {};
|
|
@@ -9,9 +9,5 @@ export declare class RelativeLayout extends Layout {
|
|
|
9
9
|
constructor(layout: ChapterContainer['layout']);
|
|
10
10
|
setContainerLayout(target: HTMLElement): void;
|
|
11
11
|
setControlLayout(target: HTMLElement, layoutParams: ControlLayoutParams): void;
|
|
12
|
-
getComputedDimensions(mountedElement: HTMLElement, layoutParams: ControlLayoutParams): {
|
|
13
|
-
width: number;
|
|
14
|
-
height: number;
|
|
15
|
-
};
|
|
16
12
|
}
|
|
17
13
|
export {};
|
|
@@ -1,28 +1,18 @@
|
|
|
1
1
|
import { Container } from './Container';
|
|
2
|
-
import { ChapterContainer
|
|
3
|
-
import
|
|
4
|
-
export declare const createChoiceContainer: (container: ChapterContainer, rootElement: HTMLElement
|
|
2
|
+
import { ChapterContainer } from "../../../manifest";
|
|
3
|
+
import { ControlEventCallback } from "../../../modules/Interactives/controls";
|
|
4
|
+
export declare const createChoiceContainer: (container: ChapterContainer, rootElement: HTMLElement) => ChoiceContainer | undefined;
|
|
5
5
|
export declare class ChoiceContainer extends Container {
|
|
6
6
|
private rootElement;
|
|
7
7
|
private layout;
|
|
8
8
|
isRemoved: boolean;
|
|
9
9
|
isDisabled: boolean;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
createView({ eventCallback, videoDurationMs }: ContainerCreateView): HTMLElement;
|
|
13
|
-
onProgress(currentTime: number, isInteractive: boolean): void;
|
|
14
|
-
onResize(): void;
|
|
10
|
+
constructor(container: ChapterContainer, rootElement: HTMLElement);
|
|
11
|
+
createView(eventCallback: ControlEventCallback): HTMLElement;
|
|
15
12
|
hide(): void;
|
|
16
13
|
show(): void;
|
|
17
14
|
enable(): void;
|
|
18
15
|
disable(): void;
|
|
19
|
-
removeView(
|
|
20
|
-
private onTransitionEnd;
|
|
21
|
-
removeAllControls(withTransition?: boolean): void;
|
|
22
|
-
removeNonInteractedControls(withTransition?: boolean): void;
|
|
23
|
-
isInteracted(): boolean;
|
|
16
|
+
removeView(): void;
|
|
24
17
|
getElement(): HTMLElement | null;
|
|
25
|
-
toggleCTAAnimation(enable?: boolean): void;
|
|
26
|
-
updateControlsShadowStyles(isFrameBased?: boolean): void;
|
|
27
|
-
setupControlsBlinkAnimSync(ctrlElement: HTMLElement, controlType: Extract<`${ControlTypes}`, 'Button' | 'Area'>): void;
|
|
28
18
|
}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { type ChoiceContainerOptions } from '../../../modules/Interactives/controls';
|
|
1
|
+
import Control from '../../../modules/Interactives/controls/Control';
|
|
2
|
+
import { ChapterContainer } from "../../../manifest";
|
|
3
|
+
import { ControlCreator } from "../../../modules/Interactives/controls";
|
|
5
4
|
export declare class Container {
|
|
6
5
|
container: ChapterContainer;
|
|
7
|
-
controls: Control[];
|
|
8
|
-
options?: Options;
|
|
9
6
|
private factories;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
controls: Control[];
|
|
8
|
+
constructor(container: ChapterContainer);
|
|
9
|
+
addControlFactory(type: string, factory: ControlCreator): void;
|
|
13
10
|
removeControlFactory(type: string): void;
|
|
14
11
|
private setControls;
|
|
15
12
|
private chooseControls;
|
|
@@ -1,22 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { TapElement } from '../utils/TapElement';
|
|
4
|
-
export declare const createAreaControl: ControlCreator<ChoiceContainerOptions, AreaControl>;
|
|
5
|
-
declare class AreaControl extends Control {
|
|
6
|
-
tapElement?: TapElement;
|
|
7
|
-
constructor(control: TControl, options?: ChoiceContainerOptions);
|
|
8
|
-
createView({ parentElement, callbacks }: CreateViewParams): void;
|
|
9
|
-
onControlSelect: () => void;
|
|
10
|
-
updateShadowStyles(dependOnFrameTone?: boolean): void;
|
|
11
|
-
disable(): void;
|
|
12
|
-
enable(): void;
|
|
13
|
-
setShowTimeRange(): void;
|
|
14
|
-
onProgress(): void;
|
|
15
|
-
onResize(): void;
|
|
16
|
-
removeView(withTransition?: boolean): void;
|
|
17
|
-
onTransitionEnd: (event: TransitionEvent) => void;
|
|
18
|
-
removeListeners(): void;
|
|
19
|
-
getElement(): Nullable<HTMLElement>;
|
|
20
|
-
toggleCTAAnimation(enable?: boolean): void;
|
|
21
|
-
}
|
|
22
|
-
export {};
|
|
1
|
+
import { type ControlCreator } from './types';
|
|
2
|
+
export declare const createAreaControl: ControlCreator;
|
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { FillAnimation } from '../utils/FillAnimation';
|
|
4
|
-
import { TapElement } from '../utils/TapElement';
|
|
5
|
-
export declare const createButtonControl: ControlCreator<ChoiceContainerOptions, ButtonControl>;
|
|
6
|
-
declare class ButtonControl extends Control {
|
|
7
|
-
startTime?: number;
|
|
8
|
-
endTime?: number;
|
|
9
|
-
fillAnimation?: FillAnimation;
|
|
10
|
-
tapElement?: TapElement;
|
|
11
|
-
constructor(control: TControl, options?: ChoiceContainerOptions);
|
|
12
|
-
createView({ parentElement, callbacks }: CreateViewParams): void;
|
|
13
|
-
onControlSelect: () => void;
|
|
14
|
-
disable(): void;
|
|
15
|
-
enable(): void;
|
|
16
|
-
setShowTimeRange(startTime: number, endTime: number): void;
|
|
17
|
-
onProgress(currentTime: number): void;
|
|
18
|
-
updateFillAnimationDimension(): void;
|
|
19
|
-
onResize(): void;
|
|
20
|
-
getElement(): Nullable<HTMLElement>;
|
|
21
|
-
removeView(withTransition?: boolean): void;
|
|
22
|
-
onTransitionEnd: (event: TransitionEvent) => void;
|
|
23
|
-
removeListeners(): void;
|
|
24
|
-
toggleCTAAnimation(enable?: boolean): void;
|
|
25
|
-
updateShadowStyles(): void;
|
|
26
|
-
}
|
|
27
|
-
export {};
|
|
1
|
+
import { type ControlCreator } from './types';
|
|
2
|
+
export declare const createButtonControl: ControlCreator;
|
|
@@ -1,33 +1,20 @@
|
|
|
1
|
-
import type { ControlEventCallback, CreateViewParams, Dimensions,
|
|
1
|
+
import type { ControlEventCallback, CreateViewParams, Dimensions, LayoutCallback, TControl } from './types';
|
|
2
2
|
type ControlContainer = {
|
|
3
3
|
element: HTMLElement;
|
|
4
|
-
dimensions: Dimensions
|
|
5
|
-
getComputedDimensions: () => Dimensions<number>;
|
|
6
|
-
isManifestContainerDisabled: () => boolean;
|
|
4
|
+
dimensions: Dimensions;
|
|
7
5
|
};
|
|
8
|
-
|
|
9
|
-
export declare abstract class Control {
|
|
6
|
+
export default abstract class Control {
|
|
10
7
|
control: TControl;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
isInteracted: boolean;
|
|
16
|
-
isRemoved: boolean;
|
|
17
|
-
constructor(control: TControl, options?: Options | undefined);
|
|
8
|
+
protected container: Nullable<ControlContainer>;
|
|
9
|
+
protected controlElement: Nullable<HTMLElement>;
|
|
10
|
+
private clickListener;
|
|
11
|
+
protected constructor(control: TControl);
|
|
18
12
|
abstract createView(params: CreateViewParams): void;
|
|
19
13
|
abstract getElement(): Nullable<HTMLElement>;
|
|
20
14
|
abstract disable(): void;
|
|
21
15
|
abstract enable(): void;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
abstract setShowTimeRange(startTime: number, endTime: number): void;
|
|
25
|
-
abstract removeView(withTransition?: boolean): void;
|
|
26
|
-
abstract toggleCTAAnimation(enable?: boolean): void;
|
|
27
|
-
abstract updateShadowStyles(isFrameBased?: boolean): void;
|
|
28
|
-
createContainerElement(callbacks: Callbacks): void;
|
|
29
|
-
createClickListener(callback: any): ClickListener;
|
|
30
|
-
featureIsEnabled(name: keyof ChoiceContainerOptions['features']): boolean | undefined;
|
|
16
|
+
protected createContainerElement(layoutCallback: LayoutCallback): void;
|
|
17
|
+
private createClickListener;
|
|
31
18
|
setEvents(callback: ControlEventCallback): void;
|
|
32
19
|
removeListeners(): void;
|
|
33
20
|
}
|
|
@@ -1,38 +1,24 @@
|
|
|
1
1
|
import type { Control as TControl, ControlEvent, ControlLayoutParams } from '../../../manifest';
|
|
2
|
-
import
|
|
3
|
-
import { Control } from '../../../modules/Interactives/controls/Control';
|
|
2
|
+
import Control from '../../../modules/Interactives/controls/Control';
|
|
4
3
|
export { TControl };
|
|
5
4
|
export declare enum CONTROLLER_IDS {
|
|
6
5
|
AREA = "int_area",
|
|
7
6
|
TEXT = "int_text",
|
|
8
7
|
BUTTON = "int_bttn"
|
|
9
8
|
}
|
|
10
|
-
export type Dimensions
|
|
11
|
-
width:
|
|
12
|
-
height:
|
|
13
|
-
};
|
|
14
|
-
export type Callbacks = {
|
|
15
|
-
setControlLayout: (element: HTMLElement, controlLayoutParams: ControlLayoutParams) => void;
|
|
16
|
-
getComputedDimensions: () => Dimensions<number>;
|
|
17
|
-
isContainerDisabled?: () => boolean;
|
|
9
|
+
export type Dimensions = {
|
|
10
|
+
width: string;
|
|
11
|
+
height: string;
|
|
18
12
|
};
|
|
13
|
+
export type LayoutCallback = (element: HTMLElement, controlLayoutParams: ControlLayoutParams) => void;
|
|
19
14
|
export type CreateViewParams = {
|
|
20
15
|
parentElement: HTMLElement;
|
|
21
|
-
|
|
16
|
+
layoutCallback: LayoutCallback;
|
|
22
17
|
};
|
|
23
18
|
type ControlEventCallbackParams = {
|
|
24
19
|
action: ControlEvent['action'];
|
|
25
20
|
controlId: string;
|
|
26
21
|
controlType: TControl['type'];
|
|
27
22
|
};
|
|
28
|
-
export type Options = Record<string, unknown>;
|
|
29
|
-
export type ChoiceContainerOptions = {
|
|
30
|
-
features: Pick<ControlsAnimationFeatureToggles, 'buttonControlInteractiveTimeTimer' | 'areaControlFrameBasedShadow' | 'tapPlaceShow' | 'controlsShowAnimation' | 'controlsCTAAnimation'>;
|
|
31
|
-
};
|
|
32
|
-
export declare function isChoiceContainerOptions(options: Options): options is ChoiceContainerOptions;
|
|
33
23
|
export type ControlEventCallback = (params: ControlEventCallbackParams) => void;
|
|
34
|
-
export type
|
|
35
|
-
videoDurationMs: number;
|
|
36
|
-
eventCallback: ControlEventCallback;
|
|
37
|
-
};
|
|
38
|
-
export type ControlCreator<O extends Options = Options, C extends Control = Control> = (control: TControl, options?: O) => C | undefined;
|
|
24
|
+
export type ControlCreator = (control: TControl) => Control | undefined;
|
|
@@ -6,74 +6,9 @@ export { isLastChapter, hasEndTemplate, isOneTextCtrlContainer } from './utils/g
|
|
|
6
6
|
export type { InteractiveRange } from './utils/getInteractiveRanges';
|
|
7
7
|
export declare const utils: {
|
|
8
8
|
Container: typeof Container;
|
|
9
|
-
createChoiceContainer: (container: import("@interactiveplatform/movika-manifest").ChapterContainer, rootElement: HTMLElement
|
|
10
|
-
createAreaControl: import("./controls").ControlCreator
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
onControlSelect: () => void;
|
|
14
|
-
updateShadowStyles(dependOnFrameTone?: boolean): void;
|
|
15
|
-
disable(): void;
|
|
16
|
-
enable(): void;
|
|
17
|
-
setShowTimeRange(): void;
|
|
18
|
-
onProgress(): void;
|
|
19
|
-
onResize(): void;
|
|
20
|
-
removeView(withTransition?: boolean): void;
|
|
21
|
-
onTransitionEnd: (event: TransitionEvent) => void;
|
|
22
|
-
removeListeners(): void;
|
|
23
|
-
getElement(): Nullable<HTMLElement>;
|
|
24
|
-
toggleCTAAnimation(enable?: boolean): void;
|
|
25
|
-
container: Nullable<{
|
|
26
|
-
element: HTMLElement;
|
|
27
|
-
dimensions: import("./controls").Dimensions<string>;
|
|
28
|
-
getComputedDimensions: () => import("./controls").Dimensions<number>;
|
|
29
|
-
isManifestContainerDisabled: () => boolean;
|
|
30
|
-
}>;
|
|
31
|
-
controlElement: Nullable<HTMLElement>;
|
|
32
|
-
clickListener: Nullable<(event: MouseEvent) => void>;
|
|
33
|
-
isInteracted: boolean;
|
|
34
|
-
isRemoved: boolean;
|
|
35
|
-
control: import("@interactiveplatform/movika-manifest/dist/chapter-COPBtRYg").e;
|
|
36
|
-
options?: import("./controls").Options;
|
|
37
|
-
createContainerElement(callbacks: import("./controls").Callbacks): void;
|
|
38
|
-
createClickListener(callback: any): (event: MouseEvent) => void;
|
|
39
|
-
featureIsEnabled(name: keyof import("./controls").ChoiceContainerOptions["features"]): boolean | undefined;
|
|
40
|
-
setEvents(callback: import("./controls").ControlEventCallback): void;
|
|
41
|
-
}>;
|
|
42
|
-
createButtonControl: import("./controls").ControlCreator<import("./controls").ChoiceContainerOptions, {
|
|
43
|
-
startTime?: number;
|
|
44
|
-
endTime?: number;
|
|
45
|
-
fillAnimation?: import("./utils/FillAnimation").FillAnimation;
|
|
46
|
-
tapElement?: import("./utils/TapElement").TapElement;
|
|
47
|
-
createView({ parentElement, callbacks }: import("./controls").CreateViewParams): void;
|
|
48
|
-
onControlSelect: () => void;
|
|
49
|
-
disable(): void;
|
|
50
|
-
enable(): void;
|
|
51
|
-
setShowTimeRange(startTime: number, endTime: number): void;
|
|
52
|
-
onProgress(currentTime: number): void;
|
|
53
|
-
updateFillAnimationDimension(): void;
|
|
54
|
-
onResize(): void;
|
|
55
|
-
getElement(): Nullable<HTMLElement>;
|
|
56
|
-
removeView(withTransition?: boolean): void;
|
|
57
|
-
onTransitionEnd: (event: TransitionEvent) => void;
|
|
58
|
-
removeListeners(): void;
|
|
59
|
-
toggleCTAAnimation(enable?: boolean): void;
|
|
60
|
-
updateShadowStyles(): void;
|
|
61
|
-
container: Nullable<{
|
|
62
|
-
element: HTMLElement;
|
|
63
|
-
dimensions: import("./controls").Dimensions<string>;
|
|
64
|
-
getComputedDimensions: () => import("./controls").Dimensions<number>;
|
|
65
|
-
isManifestContainerDisabled: () => boolean;
|
|
66
|
-
}>;
|
|
67
|
-
controlElement: Nullable<HTMLElement>;
|
|
68
|
-
clickListener: Nullable<(event: MouseEvent) => void>;
|
|
69
|
-
isInteracted: boolean;
|
|
70
|
-
isRemoved: boolean;
|
|
71
|
-
control: import("@interactiveplatform/movika-manifest/dist/chapter-COPBtRYg").e;
|
|
72
|
-
options?: import("./controls").Options;
|
|
73
|
-
createContainerElement(callbacks: import("./controls").Callbacks): void;
|
|
74
|
-
createClickListener(callback: any): (event: MouseEvent) => void;
|
|
75
|
-
featureIsEnabled(name: keyof import("./controls").ChoiceContainerOptions["features"]): boolean | undefined;
|
|
76
|
-
setEvents(callback: import("./controls").ControlEventCallback): void;
|
|
77
|
-
}>;
|
|
9
|
+
createChoiceContainer: (container: import("@interactiveplatform/movika-manifest").ChapterContainer, rootElement: HTMLElement) => import("./containers/ChoiceContainer").ChoiceContainer | undefined;
|
|
10
|
+
createAreaControl: import("./controls").ControlCreator;
|
|
11
|
+
createButtonControl: import("./controls").ControlCreator;
|
|
12
|
+
getRootEl: () => Element | null;
|
|
78
13
|
classnamesPrefix: string;
|
|
79
14
|
};
|
|
@@ -19,15 +19,7 @@ export type RequiredOptions = 'parentElement' | 'fullscreenTargetElement';
|
|
|
19
19
|
export type IOptionalInteractiveOptions = Partial<Omit<IInteractiveOptions, RequiredOptions | 'config'>> & Required<Pick<IInteractiveOptions, RequiredOptions>> & {
|
|
20
20
|
config?: Partial<IInteractiveOptions['config']>;
|
|
21
21
|
};
|
|
22
|
-
export
|
|
23
|
-
buttonControlInteractiveTimeTimer: boolean;
|
|
24
|
-
areaControlFrameBasedShadow: boolean;
|
|
25
|
-
tapPlaceShow: boolean;
|
|
26
|
-
controlsCTAAnimation: boolean;
|
|
27
|
-
controlsShowAnimation: boolean;
|
|
28
|
-
controlsHideAnimation: boolean;
|
|
29
|
-
};
|
|
30
|
-
export type IInteractiveOptions = {
|
|
22
|
+
export interface IInteractiveOptions {
|
|
31
23
|
parentElement: HTMLElement;
|
|
32
24
|
fullscreenTargetElement: HTMLElement;
|
|
33
25
|
lang: InterfaceLanguage | string;
|
|
@@ -48,10 +40,10 @@ export type IInteractiveOptions = {
|
|
|
48
40
|
vkVideoLoader?: (owner_id: string, video_id: string) => unknown;
|
|
49
41
|
createOneStat?: (video: any, configOverwrite?: any) => IOneStat | undefined;
|
|
50
42
|
/**
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
* @deprecated
|
|
44
|
+
* */
|
|
53
45
|
disableControlsOnPause?: boolean;
|
|
54
|
-
}
|
|
46
|
+
}
|
|
55
47
|
export type ChapterChangedData = {
|
|
56
48
|
chapter: Chapter;
|
|
57
49
|
manifestVideo: ManifestVideo;
|
|
@@ -3,17 +3,15 @@ import { type IPlayer } from '@vkontakte/videoplayer-core';
|
|
|
3
3
|
import type { InteractiveEventsType } from './InteractiveEvents';
|
|
4
4
|
import type { ChapterBranch } from '../../../manifest';
|
|
5
5
|
import type { EventEmitter } from '../../../utils/EventEmitter';
|
|
6
|
-
import type {
|
|
7
|
-
import
|
|
8
|
-
import type { SelectBranchesType } from './SelectBranches';
|
|
6
|
+
import type { ChoiceContainer } from "../../../modules/Interactives/containers";
|
|
7
|
+
import { SelectBranches } from './SelectBranches';
|
|
9
8
|
import { type GlobalEvents } from './events';
|
|
10
9
|
import { GameStates } from './gameUtils';
|
|
11
|
-
type Features = Pick<ControlsAnimationFeatureToggles, 'controlsHideAnimation'>;
|
|
12
10
|
type ConstructorArg = {
|
|
13
11
|
player: IPlayer;
|
|
14
12
|
container: ChoiceContainer;
|
|
15
13
|
branches: ChapterBranch[];
|
|
16
|
-
selectBranches: ReturnType<
|
|
14
|
+
selectBranches: ReturnType<typeof SelectBranches>;
|
|
17
15
|
interactiveEvents: InteractiveEventsType;
|
|
18
16
|
globalEventEmitter: EventEmitter;
|
|
19
17
|
globalEvents: GlobalEvents;
|
|
@@ -21,12 +19,11 @@ type ConstructorArg = {
|
|
|
21
19
|
permanentTextControls: boolean;
|
|
22
20
|
disabledControls$: IValueSubject<boolean>;
|
|
23
21
|
onRemove: () => void;
|
|
24
|
-
features: Features;
|
|
25
22
|
};
|
|
26
23
|
export declare class GameController {
|
|
27
24
|
container: ChoiceContainer;
|
|
28
25
|
branches: ChapterBranch[];
|
|
29
|
-
selectBranches: ReturnType<
|
|
26
|
+
selectBranches: ReturnType<typeof SelectBranches>;
|
|
30
27
|
subscription: ISubscription;
|
|
31
28
|
player: IPlayer;
|
|
32
29
|
interactiveEvents: InteractiveEventsType;
|
|
@@ -39,8 +36,7 @@ export declare class GameController {
|
|
|
39
36
|
isSelectedControlEvent: boolean;
|
|
40
37
|
isSelectedContainerEvent: boolean;
|
|
41
38
|
globalEvents: GlobalEvents;
|
|
42
|
-
|
|
43
|
-
constructor({ player, container, branches, selectBranches, interactiveEvents, globalEvents, globalEventEmitter, ignoreContainerEvent, permanentTextControls, disabledControls$, onRemove, features, }: ConstructorArg);
|
|
39
|
+
constructor({ player, container, branches, selectBranches, interactiveEvents, globalEvents, globalEventEmitter, ignoreContainerEvent, permanentTextControls, disabledControls$, onRemove, }: ConstructorArg);
|
|
44
40
|
private emitContainerVisibilityEvent;
|
|
45
41
|
registerEvents(): void;
|
|
46
42
|
hide: () => void;
|
|
@@ -52,11 +48,7 @@ export declare class GameController {
|
|
|
52
48
|
onEndOfVideo: () => void;
|
|
53
49
|
whilePlaying: () => void;
|
|
54
50
|
reset(): void;
|
|
55
|
-
|
|
56
|
-
isRemovedOrDestroyed(includeWillRemovedState?: boolean): boolean;
|
|
57
|
-
removeView(withTransition?: boolean): void;
|
|
58
|
-
toggleControlsCTAAnimation(value: boolean): void;
|
|
59
|
-
updateControlsShadowStyles(isFrameBased?: boolean): void;
|
|
51
|
+
removeView(): void;
|
|
60
52
|
destroy(): void;
|
|
61
53
|
}
|
|
62
54
|
export {};
|
|
@@ -18,8 +18,8 @@ export declare function InteractiveEvents(player: IPlayer): {
|
|
|
18
18
|
release: () => void;
|
|
19
19
|
containersEventsCallState: {
|
|
20
20
|
setCalled: ({ timestamp, id }: {
|
|
21
|
-
timestamp:
|
|
22
|
-
id:
|
|
21
|
+
timestamp: any;
|
|
22
|
+
id: any;
|
|
23
23
|
}) => void;
|
|
24
24
|
setData: (containers?: Container[]) => void;
|
|
25
25
|
resetCalled: (timestamp: number) => void;
|
|
@@ -7,7 +7,7 @@ export declare const defaultArgs: {
|
|
|
7
7
|
export declare const AFTER_EXPECT_ACTION: AfterExpectActionType;
|
|
8
8
|
export declare const extendArgs: <T extends AnyAction>(action: T, rewrite?: boolean) => T;
|
|
9
9
|
export type ExtendArgsReturnType = ReturnType<typeof extendArgs>;
|
|
10
|
-
export declare const SelectBranches: ({ globalEventEmitter, globalEvents, player, interactiveEvents }: SelectBranchesArg) => {
|
|
10
|
+
export declare const SelectBranches: ({ globalEventEmitter, globalEvents, player, interactiveEvents, removeControllers, }: SelectBranchesArg) => {
|
|
11
11
|
onControlEvent: ({ action, controlType, controlId, containerId, branches, onEvent, isEOV, isDisabled, }: OnControlEventArg) => void;
|
|
12
12
|
onContainerEvent: ({ action, container: { id: containerId, endTime }, branches, isEOV, autoSelected, }: OnContainerEventArg) => void;
|
|
13
13
|
onChapterEvent: ({ chapterId, action, branches }: OnChapterEventArg) => (() => ContinuePlaybackArg<"chapter">) | undefined;
|
|
@@ -20,4 +20,3 @@ export declare const SelectBranches: ({ globalEventEmitter, globalEvents, player
|
|
|
20
20
|
isExpect: boolean;
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
|
-
export type SelectBranchesType = typeof SelectBranches;
|
|
@@ -6,7 +6,6 @@ import type { GlobalEvents } from './events';
|
|
|
6
6
|
export type SubjectName = 'chapter' | 'container' | 'control';
|
|
7
7
|
export type AfterExpectActionType = 'after-expect';
|
|
8
8
|
export type Behaviour = 'change-chapter' | 'change-manifest';
|
|
9
|
-
export type ControlAfterExpectCallbackType = () => ExpectEventHandlerArg<'control'>;
|
|
10
9
|
export type SelectBranchesArg = {
|
|
11
10
|
globalEventEmitter: EventEmitter;
|
|
12
11
|
globalEvents: GlobalEvents;
|
|
@@ -35,11 +35,9 @@ export type TInteractivesActionExecutionEvent<T extends SubjectName> = TInteract
|
|
|
35
35
|
subjectType?: SubjectType<T>;
|
|
36
36
|
payload?: TInteractivesActionExecEventPayload<ActionMap[T]['type']>;
|
|
37
37
|
};
|
|
38
|
-
type
|
|
38
|
+
type TInteractivesActionChoiceEventPayload<T extends SubjectName> = T extends 'chapter' ? ChapterEvent['action']['args'] : T extends 'container' ? ContainerEvent['action']['args'] : ControlEvent['action']['args'] & {
|
|
39
39
|
containerId: string;
|
|
40
|
-
invokeImmediately: boolean;
|
|
41
40
|
};
|
|
42
|
-
type TInteractivesActionChoiceEventPayload<T extends SubjectName> = T extends 'chapter' ? ChapterEvent['action']['args'] : T extends 'container' ? ContainerEvent['action']['args'] & Pick<TControlPayloadExtra, 'invokeImmediately'> : ControlEvent['action']['args'] & TControlPayloadExtra;
|
|
43
41
|
type TSubjectTypeValues<T extends SubjectName> = T extends 'chapter' ? undefined : T extends 'container' ? ChapterContainer['type'] : Control['type'];
|
|
44
42
|
export type TInteractivesActionChoiceEvent<T extends SubjectName> = TInteractiveCommon<T, InteractivesEventTypes.ACTION_CHOICE | InteractivesEventTypes.ACTION_CHOICE_CANCELED> & {
|
|
45
43
|
subjectType?: TSubjectTypeValues<T>;
|
|
@@ -2,23 +2,20 @@ import { type Control } from '../../../manifest';
|
|
|
2
2
|
import { type Dimensions } from '../../../modules/Interactives/controls';
|
|
3
3
|
export declare const classnamesPrefix = "interactive";
|
|
4
4
|
export declare const rootElClassName = "interactive-controls-container";
|
|
5
|
+
export declare const getRootEl: () => Element | null;
|
|
6
|
+
export declare const DISABLE_OPACITY = 0.4;
|
|
5
7
|
export declare const controlStylesFallbacks: {
|
|
6
8
|
textColor: string;
|
|
7
9
|
textSize: number;
|
|
8
10
|
textContent: string;
|
|
9
11
|
roundCorners: number;
|
|
10
12
|
borderWidth: number;
|
|
11
|
-
borderWidthRawValue: string;
|
|
12
|
-
roundCornersRawValue: string;
|
|
13
13
|
borderColor: string;
|
|
14
14
|
borderAlpha: number;
|
|
15
15
|
backgroundColor: string;
|
|
16
16
|
backgroundAlpha: number;
|
|
17
17
|
innerSizesDependOn: string;
|
|
18
18
|
angle: number;
|
|
19
|
-
shadowColorLight: string;
|
|
20
|
-
shadowColorDark: string;
|
|
21
|
-
shadowColorAlpha: number;
|
|
22
19
|
};
|
|
23
20
|
type ControlStylesFallbacks = typeof controlStylesFallbacks;
|
|
24
21
|
export declare enum ALIGN_ITEMS {
|
|
@@ -61,17 +58,8 @@ type SetBorderStylesProps = {
|
|
|
61
58
|
props: Control['props'];
|
|
62
59
|
fallback: ControlStylesFallbacks;
|
|
63
60
|
dependsOn: Dimensions;
|
|
64
|
-
useRawValues?: boolean;
|
|
65
61
|
};
|
|
66
|
-
export declare const setBorderStyles: ({ target, props, fallback, dependsOn
|
|
67
|
-
type SetShadowStylesProps = {
|
|
68
|
-
target: HTMLElement;
|
|
69
|
-
props?: Control['props'];
|
|
70
|
-
fallback: ControlStylesFallbacks;
|
|
71
|
-
frameToneIsDark: boolean;
|
|
72
|
-
baseDimension: string;
|
|
73
|
-
};
|
|
74
|
-
export declare const setShadowStyles: ({ target, frameToneIsDark, baseDimension, fallback }: SetShadowStylesProps) => void;
|
|
62
|
+
export declare const setBorderStyles: ({ target, props, fallback, dependsOn }: SetBorderStylesProps) => void;
|
|
75
63
|
type SetAngleProps = {
|
|
76
64
|
target: HTMLElement;
|
|
77
65
|
fallback: ControlStylesFallbacks;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Nullable } from '@vkontakte/videoplayer-shared';
|
|
2
|
+
import type { HtmlEventType } from '../types';
|
|
3
|
+
type OptionsType = undefined | boolean | AddEventListenerOptions;
|
|
4
|
+
export declare class Binding {
|
|
5
|
+
target: Nullable<Element>;
|
|
6
|
+
type: Nullable<HtmlEventType>;
|
|
7
|
+
listener: Nullable<EventListener>;
|
|
8
|
+
options: Nullable<OptionsType>;
|
|
9
|
+
/**
|
|
10
|
+
* passive = true -> function never call preventDefault()
|
|
11
|
+
*/
|
|
12
|
+
constructor(target: Element, type: HtmlEventType, listener: EventListener, options: OptionsType);
|
|
13
|
+
/**
|
|
14
|
+
* Detaches the event listener from the event target. This does nothing if
|
|
15
|
+
* the event listener is already detached.
|
|
16
|
+
*/
|
|
17
|
+
unlisten(): void;
|
|
18
|
+
/**
|
|
19
|
+
* Converts the provided options value into a value accepted by the browser.
|
|
20
|
+
* Some browsers (e.g. Tizen) don't support passing options as an
|
|
21
|
+
* object. So this detects this case and converts it.
|
|
22
|
+
*/
|
|
23
|
+
private static _convertOptions;
|
|
24
|
+
/**
|
|
25
|
+
* Checks whether the browser supports passing objects as the third argument
|
|
26
|
+
* to addEventListener. This caches the result value in a static field to
|
|
27
|
+
* avoid a bunch of checks.
|
|
28
|
+
*
|
|
29
|
+
* See https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support
|
|
30
|
+
*/
|
|
31
|
+
private static _supportsObject;
|
|
32
|
+
private static _doesSupportObject;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Binding } from './Binding';
|
|
2
|
+
import { MultiMap } from './MultiMap';
|
|
3
|
+
import type { HtmlEventType } from '../types';
|
|
4
|
+
type OptionsType = boolean | AddEventListenerOptions;
|
|
5
|
+
export declare class EventManager {
|
|
6
|
+
bindingMap: MultiMap<Binding> | null;
|
|
7
|
+
release(): void;
|
|
8
|
+
listen(target: Element, type: HtmlEventType, listener: EventListener, options?: OptionsType): void;
|
|
9
|
+
listenOnce(target: Element, type: HtmlEventType, listener: EventListener, options?: OptionsType): void;
|
|
10
|
+
unlisten(target: Element, type: HtmlEventType, listener: EventListener): void;
|
|
11
|
+
removeAll(): void;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IPlayer } from '@vkontakte/videoplayer-core';
|
|
2
|
-
export declare const getVideoContentSize: (player: IPlayer) => {
|
|
2
|
+
export declare const getVideoContentSize: (containerEl: Element, player: IPlayer) => {
|
|
3
3
|
videoContentHeight: number;
|
|
4
4
|
videoContentWidth: number;
|
|
5
5
|
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const apply: (attachToElement: HTMLElement) => void;
|