@vkontakte/videoplayer-interactive 1.0.30-dev.f10d9ff4.0 → 1.0.30-dev.f55796c8.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 -196
- package/es2015.esm.js +6 -197
- package/es2018.cjs.js +6 -197
- package/es2018.esm.js +5 -196
- package/esnext.cjs.js +6 -197
- package/esnext.esm.js +6 -197
- package/evergreen.esm.js +6 -197
- package/package.json +4 -4
- package/types/modules/Interactives/Interactives.d.ts +9 -19
- package/types/modules/Interactives/Layout.d.ts +0 -4
- package/types/modules/Interactives/containers/ChoiceContainer.d.ts +7 -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 +12 -12
- package/types/modules/Interactives/utils/GameController.d.ts +12 -16
- package/types/modules/Interactives/utils/InteractiveEvents.d.ts +3 -3
- 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.d.ts +1 -0
- package/types/modules/Interactives/utils/events.types.d.ts +1 -3
- package/types/modules/Interactives/utils/gameUtils.d.ts +2 -1
- package/types/modules/Interactives/utils/getInteractiveRanges.d.ts +5 -1
- 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 -29
- 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
|
@@ -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,31 +53,22 @@ 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;
|
|
81
70
|
private completeInteractiveRange;
|
|
71
|
+
private handleFakeRemoval;
|
|
82
72
|
private clearNoInteractionTimeout;
|
|
83
73
|
private reset;
|
|
84
74
|
get options(): IInteractiveOptions;
|
|
@@ -98,7 +88,7 @@ export declare class Interactives {
|
|
|
98
88
|
setVisitedChapters(chapterIds: string[]): void;
|
|
99
89
|
updateGraphVideosInfo(videosInfo: VideoInfo[]): void;
|
|
100
90
|
deadEndCheck(): boolean;
|
|
101
|
-
allControlsAreRemoved(
|
|
91
|
+
allControlsAreRemoved(): boolean;
|
|
102
92
|
isEndedExpectation(): boolean;
|
|
103
93
|
playPrevChapter(): void;
|
|
104
94
|
setDisabledControls(value: boolean): void;
|
|
@@ -125,9 +115,9 @@ export declare class Interactives {
|
|
|
125
115
|
graph: Nullable<import("@interactiveplatform/movika-manifest").GraphDesign>;
|
|
126
116
|
};
|
|
127
117
|
getCurrentManifest(): Nullable<Manifest>;
|
|
128
|
-
on(eventName: string, fn:
|
|
129
|
-
off(eventName: string, fn:
|
|
130
|
-
once(eventName: string, fn:
|
|
118
|
+
on(eventName: string, fn: Function): this;
|
|
119
|
+
off(eventName: string, fn: Function): this;
|
|
120
|
+
once(eventName: string, fn: Function): this;
|
|
131
121
|
destroy(): void;
|
|
132
122
|
}
|
|
133
123
|
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,19 @@
|
|
|
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
|
-
|
|
21
|
-
removeAllControls(withTransition?: boolean): void;
|
|
22
|
-
removeNonInteractedControls(withTransition?: boolean): void;
|
|
23
|
-
isInteracted(): boolean;
|
|
16
|
+
removeView(destroy?: boolean): void;
|
|
17
|
+
fakeRemove(): void;
|
|
24
18
|
getElement(): HTMLElement | null;
|
|
25
|
-
toggleCTAAnimation(enable?: boolean): void;
|
|
26
|
-
updateControlsShadowStyles(isFrameBased?: boolean): void;
|
|
27
|
-
setupControlsBlinkAnimSync(ctrlElement: HTMLElement, controlType: Extract<`${ControlTypes}`, 'Button' | 'Area'>): void;
|
|
28
19
|
}
|
|
@@ -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;
|
|
@@ -39,6 +31,7 @@ export type IInteractiveOptions = {
|
|
|
39
31
|
lastFrame: boolean;
|
|
40
32
|
initSeamless: boolean;
|
|
41
33
|
permanentTextControls: boolean;
|
|
34
|
+
interactiveTimeOpenUri: boolean;
|
|
42
35
|
loaders: Partial<Loaders>;
|
|
43
36
|
initChapterId?: string;
|
|
44
37
|
projectInfo?: InteractiveProjectInfo;
|
|
@@ -48,10 +41,10 @@ export type IInteractiveOptions = {
|
|
|
48
41
|
vkVideoLoader?: (owner_id: string, video_id: string) => unknown;
|
|
49
42
|
createOneStat?: (video: any, configOverwrite?: any) => IOneStat | undefined;
|
|
50
43
|
/**
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
* @deprecated
|
|
45
|
+
* */
|
|
53
46
|
disableControlsOnPause?: boolean;
|
|
54
|
-
}
|
|
47
|
+
}
|
|
55
48
|
export type ChapterChangedData = {
|
|
56
49
|
chapter: Chapter;
|
|
57
50
|
manifestVideo: ManifestVideo;
|
|
@@ -67,3 +60,10 @@ export interface EachTickData {
|
|
|
67
60
|
currentTime: number;
|
|
68
61
|
isInteractiveTime: boolean;
|
|
69
62
|
}
|
|
63
|
+
export type IgnoreExpectState = {
|
|
64
|
+
isExpectTime: boolean;
|
|
65
|
+
hasOtherExpect: boolean;
|
|
66
|
+
hasOpenURIEvent: boolean;
|
|
67
|
+
hasOpenURIEventInCurrentContainer: boolean;
|
|
68
|
+
isAllOpenURIEventsValid: boolean;
|
|
69
|
+
};
|
|
@@ -3,35 +3,35 @@ 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 type { ChoiceContainer } from
|
|
8
|
-
import
|
|
6
|
+
import type { IgnoreExpectState } from '../../../modules/Interactives/types';
|
|
7
|
+
import type { ChoiceContainer } from "../../../modules/Interactives/containers";
|
|
8
|
+
import { SelectBranches } from './SelectBranches';
|
|
9
9
|
import { type GlobalEvents } from './events';
|
|
10
10
|
import { GameStates } from './gameUtils';
|
|
11
|
-
type Features = Pick<ControlsAnimationFeatureToggles, 'controlsHideAnimation'>;
|
|
12
11
|
type ConstructorArg = {
|
|
13
12
|
player: IPlayer;
|
|
14
13
|
container: ChoiceContainer;
|
|
15
14
|
branches: ChapterBranch[];
|
|
16
|
-
selectBranches: ReturnType<
|
|
15
|
+
selectBranches: ReturnType<typeof SelectBranches>;
|
|
17
16
|
interactiveEvents: InteractiveEventsType;
|
|
18
17
|
globalEventEmitter: EventEmitter;
|
|
19
18
|
globalEvents: GlobalEvents;
|
|
20
|
-
ignoreContainerEvent: () => boolean;
|
|
21
19
|
permanentTextControls: boolean;
|
|
22
20
|
disabledControls$: IValueSubject<boolean>;
|
|
23
21
|
onRemove: () => void;
|
|
24
|
-
|
|
22
|
+
getContainerEventState: () => IgnoreExpectState;
|
|
23
|
+
interactiveTimeOpenUri: boolean;
|
|
25
24
|
};
|
|
26
25
|
export declare class GameController {
|
|
27
26
|
container: ChoiceContainer;
|
|
28
27
|
branches: ChapterBranch[];
|
|
29
|
-
selectBranches: ReturnType<
|
|
28
|
+
selectBranches: ReturnType<typeof SelectBranches>;
|
|
30
29
|
subscription: ISubscription;
|
|
31
30
|
player: IPlayer;
|
|
32
31
|
interactiveEvents: InteractiveEventsType;
|
|
33
|
-
|
|
32
|
+
getContainerEventState: () => IgnoreExpectState;
|
|
34
33
|
isPermanentText: boolean;
|
|
34
|
+
interactiveTimeOpenUri: boolean;
|
|
35
35
|
disabledControls$: IValueSubject<boolean>;
|
|
36
36
|
onRemove: () => void;
|
|
37
37
|
globalEventEmitter: EventEmitter;
|
|
@@ -39,8 +39,7 @@ export declare class GameController {
|
|
|
39
39
|
isSelectedControlEvent: boolean;
|
|
40
40
|
isSelectedContainerEvent: boolean;
|
|
41
41
|
globalEvents: GlobalEvents;
|
|
42
|
-
|
|
43
|
-
constructor({ player, container, branches, selectBranches, interactiveEvents, globalEvents, globalEventEmitter, ignoreContainerEvent, permanentTextControls, disabledControls$, onRemove, features, }: ConstructorArg);
|
|
42
|
+
constructor({ player, container, branches, selectBranches, interactiveEvents, globalEvents, globalEventEmitter, getContainerEventState, permanentTextControls, interactiveTimeOpenUri, disabledControls$, onRemove, }: ConstructorArg);
|
|
44
43
|
private emitContainerVisibilityEvent;
|
|
45
44
|
registerEvents(): void;
|
|
46
45
|
hide: () => void;
|
|
@@ -52,11 +51,8 @@ export declare class GameController {
|
|
|
52
51
|
onEndOfVideo: () => void;
|
|
53
52
|
whilePlaying: () => void;
|
|
54
53
|
reset(): void;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
removeView(withTransition?: boolean): void;
|
|
58
|
-
toggleControlsCTAAnimation(value: boolean): void;
|
|
59
|
-
updateControlsShadowStyles(isFrameBased?: boolean): void;
|
|
54
|
+
removeView(destroy?: boolean): void;
|
|
55
|
+
fakeRemoveView(remove?: boolean): void;
|
|
60
56
|
destroy(): void;
|
|
61
57
|
}
|
|
62
58
|
export {};
|
|
@@ -7,7 +7,7 @@ type RemoveMethodParamType = Parameters<TGroupsStack['remove']>[0];
|
|
|
7
7
|
/**
|
|
8
8
|
* Executes an events at different times of the current chapter
|
|
9
9
|
*/
|
|
10
|
-
export declare function InteractiveEvents(player: IPlayer): {
|
|
10
|
+
export declare function InteractiveEvents(player: IPlayer, interactiveTimeOpenUri: any): {
|
|
11
11
|
setPlayer: (player: IPlayer) => void;
|
|
12
12
|
add: (args: AddMethodParamType) => void;
|
|
13
13
|
remove: (args: RemoveMethodParamType) => void;
|
|
@@ -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;
|
|
@@ -65,6 +65,7 @@ export declare const interactivesEventTypes: {
|
|
|
65
65
|
readonly actionExecution: "action-execution";
|
|
66
66
|
readonly visibility: "visibility";
|
|
67
67
|
readonly containerRemoved: "container-removed";
|
|
68
|
+
readonly containerFakeRemoved: "container-fake-removed";
|
|
68
69
|
readonly rangeEnded: "range-ended";
|
|
69
70
|
};
|
|
70
71
|
export declare enum InteractivesEventTypes {
|
|
@@ -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>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type Control, type Chapter, type ChapterContainer } from '../../../manifest';
|
|
2
2
|
import type { GameController } from './GameController';
|
|
3
|
+
import type { IgnoreExpectState } from '../../../modules/Interactives/types';
|
|
3
4
|
export declare enum GameStates {
|
|
4
5
|
nothing = 0,
|
|
5
6
|
beforeInteractive = 1,
|
|
@@ -24,5 +25,5 @@ export declare function excludeTextControl(containers?: ChapterContainer[]): Cha
|
|
|
24
25
|
export declare const isEOVEndTime: (target: HTMLVideoElement, endTime: ChapterContainer["endTime"]) => boolean;
|
|
25
26
|
export declare function partial<T extends unknown[], U extends unknown[], R>(fn: (...args: [...T, ...U]) => R, ...presetArgs: T): (...laterArgs: U) => R;
|
|
26
27
|
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
|
|
28
|
+
export declare const evaluateContainerEventStatus: (container: ChapterContainer, gameControllers: GameController[]) => IgnoreExpectState;
|
|
28
29
|
export {};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { type Container } from '../../../manifest';
|
|
2
|
+
export type Subject = {
|
|
3
|
+
id: string;
|
|
4
|
+
isRemoved: boolean;
|
|
5
|
+
};
|
|
2
6
|
export type InteractiveRange = {
|
|
3
|
-
subjects:
|
|
7
|
+
subjects: Subject[];
|
|
4
8
|
range: [number, number];
|
|
5
9
|
};
|
|
6
10
|
export type InteractiveRanges = Array<InteractiveRange>;
|
|
@@ -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;
|