@vkontakte/videoplayer-interactive 1.0.36-dev.c84721ac.0 → 1.0.36-dev.ca6258d6.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 +147 -11
- package/es2015.esm.js +147 -11
- package/es2018.cjs.js +147 -11
- package/es2018.esm.js +147 -11
- package/es2024.cjs.js +147 -11
- package/es2024.esm.js +147 -11
- package/esnext.cjs.js +147 -11
- package/esnext.esm.js +147 -11
- package/evergreen.esm.js +147 -11
- package/package.json +4 -4
- package/types/modules/Interactives/Interactives.d.ts +8 -4
- package/types/modules/Interactives/containers/ChoiceContainer.d.ts +9 -6
- package/types/modules/Interactives/containers/Container.d.ts +4 -0
- package/types/modules/Interactives/containers/types.d.ts +3 -1
- package/types/modules/Interactives/controls/AreaControl.d.ts +3 -2
- package/types/modules/Interactives/controls/ButtonControl.d.ts +8 -3
- package/types/modules/Interactives/controls/Control.d.ts +15 -4
- package/types/modules/Interactives/controls/TextControl.d.ts +2 -1
- package/types/modules/Interactives/controls/types.d.ts +3 -1
- package/types/modules/Interactives/controls/utils.d.ts +1 -0
- package/types/modules/Interactives/index.d.ts +30 -5
- package/types/modules/Interactives/types.d.ts +4 -0
- package/types/modules/Interactives/utils/ControlFillAnimation/ControlFillAnimation.d.ts +34 -0
- package/types/modules/Interactives/utils/ControlFillAnimation/index.d.ts +1 -0
- package/types/modules/Interactives/utils/ControlFillAnimation/utils.d.ts +12 -0
- package/types/modules/Interactives/utils/ControlTap/ControlTap.d.ts +17 -0
- package/types/modules/Interactives/utils/ControlTap/index.d.ts +1 -0
- package/types/modules/Interactives/utils/ControlTap/utils.d.ts +6 -0
- package/types/modules/Interactives/utils/GameController.d.ts +9 -4
- package/types/modules/Interactives/utils/angleUtils.d.ts +2 -0
- package/types/modules/Interactives/utils/emitOnError.d.ts +13 -0
- package/types/modules/Interactives/utils/gameUtils.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer-interactive",
|
|
3
|
-
"version": "1.0.36-dev.
|
|
3
|
+
"version": "1.0.36-dev.ca6258d6.0",
|
|
4
4
|
"author": "vk.com",
|
|
5
5
|
"description": "Movika interactive SDK",
|
|
6
6
|
"homepage": "https://vk.com",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@interactiveplatform/movika-graph-editor": "2.1.7",
|
|
58
58
|
"@interactiveplatform/movika-manifest": "1.0.1",
|
|
59
|
-
"@vkontakte/videoplayer-core": "2.0.131-dev.
|
|
60
|
-
"@vkontakte/videoplayer-shared": "1.0.59-dev.
|
|
61
|
-
"@vkontakte/videoplayer-statistics": "1.0.77-dev.
|
|
59
|
+
"@vkontakte/videoplayer-core": "2.0.131-dev.1b9d4a49.0",
|
|
60
|
+
"@vkontakte/videoplayer-shared": "1.0.59-dev.4d0599d9.0",
|
|
61
|
+
"@vkontakte/videoplayer-statistics": "1.0.77-dev.91b6acbc.0"
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -95,12 +95,16 @@ export declare class Interactives {
|
|
|
95
95
|
*
|
|
96
96
|
* Контрол считается удалённым, если его флаг `isRemoved` установлен в `true`.
|
|
97
97
|
* Однако, есть исключение для `openURI` — если с ним было взаимодействие, он
|
|
98
|
-
* получит `isRemoved = true`, но может оставаться в DOM до завершения эпизода
|
|
98
|
+
* получит `isRemoved = true`, но может оставаться в DOM до завершения эпизода
|
|
99
|
+
* (`endTime`).
|
|
99
100
|
*
|
|
100
|
-
* Из-за этого метод может вернуть `true` (что все контроллы "удалены"),
|
|
101
|
-
*
|
|
101
|
+
* Из-за этого метод может вернуть `true` (что все контроллы "удалены"), хотя
|
|
102
|
+
* `openURI` всё ещё присутствует в DOM.
|
|
103
|
+
*
|
|
104
|
+
* includeWillRemovedState - нужно ли считать состояние 'willRemoved' как
|
|
105
|
+
* 'removed'
|
|
102
106
|
*/
|
|
103
|
-
allControlsAreRemoved(): boolean;
|
|
107
|
+
allControlsAreRemoved(includeWillRemovedState?: boolean): boolean;
|
|
104
108
|
isEndedExpectation(): boolean;
|
|
105
109
|
playPrevChapter(): void;
|
|
106
110
|
setDisabledControls(value: boolean): void;
|
|
@@ -1,25 +1,28 @@
|
|
|
1
|
-
import { Subject } from '@vkontakte/videoplayer-shared';
|
|
2
1
|
import { Container } from './Container';
|
|
3
2
|
import { ChapterContainer } from '../../../manifest';
|
|
4
3
|
import type { ChoiceContainerOptions, ContainerCreateViewParams } from './types';
|
|
5
|
-
import { CustomError } from '../../../utils/Error';
|
|
6
4
|
import { Nullable } from '@vkontakte/videoplayer-shared';
|
|
7
5
|
export declare const createChoiceContainer: (container: ChapterContainer, rootElement: HTMLElement, options?: ChoiceContainerOptions) => ChoiceContainer | undefined;
|
|
8
6
|
export declare class ChoiceContainer extends Container {
|
|
9
7
|
private rootElement;
|
|
10
8
|
private containerElement;
|
|
11
9
|
private layout;
|
|
12
|
-
private
|
|
10
|
+
private subscriptions;
|
|
13
11
|
isRemoved: boolean;
|
|
14
12
|
isDisabled: boolean;
|
|
15
|
-
|
|
13
|
+
willRemoved: boolean;
|
|
16
14
|
constructor(container: ChapterContainer, rootElement: HTMLElement, options?: ChoiceContainerOptions);
|
|
17
|
-
createView({ eventCallback }: ContainerCreateViewParams): HTMLElement;
|
|
15
|
+
createView({ eventCallback, videoDurationMs }: ContainerCreateViewParams): HTMLElement;
|
|
16
|
+
updateControlsFillAnimationDimensions(): void;
|
|
18
17
|
hide(): void;
|
|
19
18
|
show(): void;
|
|
20
19
|
enable(): void;
|
|
21
20
|
disable(): void;
|
|
22
|
-
removeView(): void;
|
|
21
|
+
removeView(withTransition?: boolean, useDelay?: boolean): void;
|
|
22
|
+
private onTransitionEnd;
|
|
23
|
+
removeAllControls(withTransition?: boolean): void;
|
|
24
|
+
removeNonInteractedControls(withTransition?: boolean): void;
|
|
25
|
+
isInteracted(): boolean;
|
|
23
26
|
fakeRemove(): void;
|
|
24
27
|
getElement(): Nullable<HTMLElement>;
|
|
25
28
|
onProgress(currentTimeMs: number, isInteractiveTime: boolean): void;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Subject } from '@vkontakte/videoplayer-shared';
|
|
2
|
+
import { CustomError } from '../../../utils/Error';
|
|
1
3
|
import type { ChapterContainer } from '../../../manifest';
|
|
2
4
|
import { type Control, type ControlCreator, type Options } from '../../../modules/Interactives/controls';
|
|
3
5
|
import { type ChoiceContainerOptions } from './types';
|
|
@@ -6,8 +8,10 @@ export declare class Container {
|
|
|
6
8
|
options?: Options;
|
|
7
9
|
private factories;
|
|
8
10
|
controls: Control[];
|
|
11
|
+
error$: Subject<CustomError>;
|
|
9
12
|
constructor(container: ChapterContainer, options?: Options);
|
|
10
13
|
featureIsEnabled(name: keyof ChoiceContainerOptions['features']): boolean | undefined;
|
|
14
|
+
onError(message: string | undefined, error: unknown): void;
|
|
11
15
|
addControlFactory(type: string, factory: ControlCreator<any>): void;
|
|
12
16
|
removeControlFactory(type: string): void;
|
|
13
17
|
private setControls;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Options, ControlEventCallback } from '../controls';
|
|
2
2
|
import { AnimationsFeatureToggles } from '../types';
|
|
3
3
|
export type ChoiceContainerOptions = {
|
|
4
|
-
|
|
4
|
+
isTouch: boolean;
|
|
5
|
+
features: Pick<AnimationsFeatureToggles, 'controlsExpectTimeBlinkAnimation' | 'controlsTapPlace' | 'controlsFillAnimation'>;
|
|
5
6
|
};
|
|
6
7
|
export declare function isChoiceContainerOptions(options: Options): options is ChoiceContainerOptions;
|
|
7
8
|
export type ContainerCreateViewParams = {
|
|
8
9
|
eventCallback: ControlEventCallback;
|
|
10
|
+
videoDurationMs: number;
|
|
9
11
|
};
|
|
@@ -4,7 +4,7 @@ export declare const createAreaControl: ControlCreator<ControlOptions, AreaContr
|
|
|
4
4
|
declare class AreaControl extends Control {
|
|
5
5
|
constructor(control: TControl, options?: ControlOptions);
|
|
6
6
|
createView({ parentElement, callbacks }: ControlCreateViewParams): void;
|
|
7
|
-
|
|
7
|
+
registerBlinkAnimationEvents(): void;
|
|
8
8
|
disable(): void;
|
|
9
9
|
enable(): void;
|
|
10
10
|
getElement(): import("@vkontakte/videoplayer-shared").Nullable<HTMLElement>;
|
|
@@ -12,7 +12,8 @@ declare class AreaControl extends Control {
|
|
|
12
12
|
toggleBlinkAnimation(enable?: boolean): void;
|
|
13
13
|
syncBlinkAnimation(refAnim: HTMLElement): void;
|
|
14
14
|
onBlinkHovering(): void;
|
|
15
|
-
|
|
15
|
+
setShowTimeRange(): void;
|
|
16
|
+
updateFillAnimationDimensions(): void;
|
|
16
17
|
onProgress(): void;
|
|
17
18
|
onResize(): void;
|
|
18
19
|
}
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import { Control } from './Control';
|
|
2
2
|
import { type ControlCreator, type ControlCreateViewParams, type TControl, type ControlOptions } from './types';
|
|
3
|
+
import { ControlFillAnimation } from '../utils/ControlFillAnimation';
|
|
3
4
|
export declare const createButtonControl: ControlCreator<ControlOptions, ButtonControl>;
|
|
4
5
|
declare class ButtonControl extends Control {
|
|
6
|
+
startTime?: number;
|
|
7
|
+
endTime?: number;
|
|
8
|
+
controlFillAnimation?: ControlFillAnimation;
|
|
5
9
|
constructor(control: TControl, options?: ControlOptions);
|
|
6
10
|
createView({ parentElement, callbacks }: ControlCreateViewParams): void;
|
|
7
|
-
|
|
11
|
+
registerBlinkAnimationEvents(): void;
|
|
8
12
|
disable(): void;
|
|
9
13
|
enable(): void;
|
|
10
14
|
getElement(): import("@vkontakte/videoplayer-shared").Nullable<HTMLElement>;
|
|
11
15
|
toggleBlinkAnimation(enable?: boolean): void;
|
|
12
16
|
syncBlinkAnimation(refAnim: HTMLElement): void;
|
|
13
17
|
onBlinkHovering(): void;
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
updateFillAnimationDimensions(): void;
|
|
19
|
+
setShowTimeRange(startTime: number, endTime: number): void;
|
|
20
|
+
onProgress(currentTime: number): void;
|
|
16
21
|
onResize(): void;
|
|
17
22
|
updateShadowStyles(): void;
|
|
18
23
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { Subject, Subscription } from '@vkontakte/videoplayer-shared';
|
|
2
|
-
import type { ControlEventCallback, ControlCreateViewParams, Dimensions, Callbacks, Options, TControl, ControlOptions } from './types';
|
|
1
|
+
import { Subject, Subscription, Nullable } from '@vkontakte/videoplayer-shared';
|
|
3
2
|
import { CustomError } from '../../../utils/Error';
|
|
4
|
-
import {
|
|
3
|
+
import { ControlTap } from '../utils/ControlTap';
|
|
4
|
+
import type { ControlEventCallback, ControlCreateViewParams, Dimensions, Callbacks, Options, TControl, ControlOptions } from './types';
|
|
5
5
|
type ControlContainer = {
|
|
6
6
|
element: HTMLElement;
|
|
7
7
|
dimensions: Dimensions;
|
|
8
|
+
isManifestContainerDisabled: () => boolean;
|
|
8
9
|
};
|
|
9
10
|
type ClickListener = (event: MouseEvent) => void;
|
|
10
11
|
export declare abstract class Control {
|
|
@@ -14,6 +15,9 @@ export declare abstract class Control {
|
|
|
14
15
|
controlElement: Nullable<HTMLElement>;
|
|
15
16
|
subscriptions: Subscription;
|
|
16
17
|
error$: Subject<CustomError>;
|
|
18
|
+
controlTap?: ControlTap;
|
|
19
|
+
isInteracted: boolean;
|
|
20
|
+
isRemoved: boolean;
|
|
17
21
|
constructor(control: TControl, options?: Options | undefined);
|
|
18
22
|
abstract createView(params: ControlCreateViewParams): void;
|
|
19
23
|
abstract getElement(): Nullable<HTMLElement>;
|
|
@@ -21,12 +25,19 @@ export declare abstract class Control {
|
|
|
21
25
|
abstract enable(): void;
|
|
22
26
|
abstract onProgress(currentTimeMs: number): void;
|
|
23
27
|
abstract onResize(): void;
|
|
24
|
-
abstract
|
|
28
|
+
abstract setShowTimeRange(startTime: number, endTime: number): void;
|
|
29
|
+
abstract updateFillAnimationDimensions(): void;
|
|
25
30
|
abstract updateShadowStyles(isDark?: boolean): void;
|
|
26
31
|
abstract toggleBlinkAnimation(enable?: boolean): void;
|
|
32
|
+
onControlSelect: () => void;
|
|
33
|
+
removeView(withTransition?: boolean): void;
|
|
34
|
+
onTransitionEnd: (event: TransitionEvent) => void;
|
|
35
|
+
onError(message: string | undefined, error: unknown): void;
|
|
36
|
+
addControlTap(controlElement: HTMLElement): void;
|
|
27
37
|
createContainerElement(callbacks: Callbacks): void;
|
|
28
38
|
createClickListener(callback: AnyFn): ClickListener;
|
|
29
39
|
featureIsEnabled(name: keyof ControlOptions['features']): boolean | undefined;
|
|
40
|
+
isTouch(): boolean | undefined;
|
|
30
41
|
setEvents(callback: ControlEventCallback): void;
|
|
31
42
|
removeListeners(): void;
|
|
32
43
|
}
|
|
@@ -14,6 +14,7 @@ export type Dimensions<T = string> = {
|
|
|
14
14
|
};
|
|
15
15
|
export type Callbacks = {
|
|
16
16
|
setControlLayout: (element: HTMLElement, controlLayoutParams: ControlLayoutParams) => void;
|
|
17
|
+
isContainerDisabled: () => boolean;
|
|
17
18
|
};
|
|
18
19
|
export type ControlCreateViewParams = {
|
|
19
20
|
parentElement: HTMLElement;
|
|
@@ -21,7 +22,8 @@ export type ControlCreateViewParams = {
|
|
|
21
22
|
};
|
|
22
23
|
export type Options = Record<string, unknown>;
|
|
23
24
|
export type ControlOptions = {
|
|
24
|
-
|
|
25
|
+
isTouch: boolean;
|
|
26
|
+
features: Pick<AnimationsFeatureToggles, 'controlsExpectTimeBlinkAnimation' | 'controlsTapPlace' | 'controlsFillAnimation'>;
|
|
25
27
|
};
|
|
26
28
|
export declare function isControlOptions(options: Options): options is ControlOptions;
|
|
27
29
|
type ControlEventCallbackParams = {
|
|
@@ -9,7 +9,7 @@ export declare const utils: {
|
|
|
9
9
|
createChoiceContainer: (container: import("@interactiveplatform/movika-manifest").ChapterContainer, rootElement: HTMLElement, options?: import("./containers/types").ChoiceContainerOptions) => import("./containers/ChoiceContainer").ChoiceContainer | undefined;
|
|
10
10
|
createAreaControl: import("./controls").ControlCreator<import("./controls").ControlOptions, {
|
|
11
11
|
createView({ parentElement, callbacks }: import("./controls").ControlCreateViewParams): void;
|
|
12
|
-
|
|
12
|
+
registerBlinkAnimationEvents(): void;
|
|
13
13
|
disable(): void;
|
|
14
14
|
enable(): void;
|
|
15
15
|
getElement(): import("@vkontakte/videoplayer-shared").Nullable<HTMLElement>;
|
|
@@ -17,49 +17,74 @@ export declare const utils: {
|
|
|
17
17
|
toggleBlinkAnimation(enable?: boolean): void;
|
|
18
18
|
syncBlinkAnimation(refAnim: HTMLElement): void;
|
|
19
19
|
onBlinkHovering(): void;
|
|
20
|
-
|
|
20
|
+
setShowTimeRange(): void;
|
|
21
|
+
updateFillAnimationDimensions(): void;
|
|
21
22
|
onProgress(): void;
|
|
22
23
|
onResize(): void;
|
|
23
24
|
container: import("@vkontakte/videoplayer-shared").Nullable<{
|
|
24
25
|
element: HTMLElement;
|
|
25
26
|
dimensions: import("./controls").Dimensions;
|
|
27
|
+
isManifestContainerDisabled: () => boolean;
|
|
26
28
|
}>;
|
|
27
29
|
controlElement: import("@vkontakte/videoplayer-shared").Nullable<HTMLElement>;
|
|
28
30
|
subscriptions: import("@vkontakte/videoplayer-shared").Subscription;
|
|
29
31
|
error$: import("@vkontakte/videoplayer-shared").Subject<import("../..").CustomError>;
|
|
32
|
+
controlTap?: import("./utils/ControlTap").ControlTap;
|
|
33
|
+
isInteracted: boolean;
|
|
34
|
+
isRemoved: boolean;
|
|
30
35
|
control: import("@interactiveplatform/movika-manifest/dist/chapter-DI_7rDZW").e;
|
|
31
36
|
options?: import("./controls").Options | undefined;
|
|
37
|
+
onControlSelect: () => void;
|
|
38
|
+
removeView(withTransition?: boolean): void;
|
|
39
|
+
onTransitionEnd: (event: TransitionEvent) => void;
|
|
40
|
+
onError(message: string | undefined, error: unknown): void;
|
|
41
|
+
addControlTap(controlElement: HTMLElement): void;
|
|
32
42
|
createContainerElement(callbacks: import("./controls").Callbacks): void;
|
|
33
43
|
createClickListener(callback: AnyFn): (event: MouseEvent) => void;
|
|
34
44
|
featureIsEnabled(name: keyof import("./controls").ControlOptions["features"]): boolean | undefined;
|
|
45
|
+
isTouch(): boolean | undefined;
|
|
35
46
|
setEvents(callback: import("./controls").ControlEventCallback): void;
|
|
36
47
|
removeListeners(): void;
|
|
37
48
|
}>;
|
|
38
49
|
createButtonControl: import("./controls").ControlCreator<import("./controls").ControlOptions, {
|
|
50
|
+
startTime?: number;
|
|
51
|
+
endTime?: number;
|
|
52
|
+
controlFillAnimation?: import("./utils/ControlFillAnimation").ControlFillAnimation;
|
|
39
53
|
createView({ parentElement, callbacks }: import("./controls").ControlCreateViewParams): void;
|
|
40
|
-
|
|
54
|
+
registerBlinkAnimationEvents(): void;
|
|
41
55
|
disable(): void;
|
|
42
56
|
enable(): void;
|
|
43
57
|
getElement(): import("@vkontakte/videoplayer-shared").Nullable<HTMLElement>;
|
|
44
58
|
toggleBlinkAnimation(enable?: boolean): void;
|
|
45
59
|
syncBlinkAnimation(refAnim: HTMLElement): void;
|
|
46
60
|
onBlinkHovering(): void;
|
|
47
|
-
|
|
48
|
-
|
|
61
|
+
updateFillAnimationDimensions(): void;
|
|
62
|
+
setShowTimeRange(startTime: number, endTime: number): void;
|
|
63
|
+
onProgress(currentTime: number): void;
|
|
49
64
|
onResize(): void;
|
|
50
65
|
updateShadowStyles(): void;
|
|
51
66
|
container: import("@vkontakte/videoplayer-shared").Nullable<{
|
|
52
67
|
element: HTMLElement;
|
|
53
68
|
dimensions: import("./controls").Dimensions;
|
|
69
|
+
isManifestContainerDisabled: () => boolean;
|
|
54
70
|
}>;
|
|
55
71
|
controlElement: import("@vkontakte/videoplayer-shared").Nullable<HTMLElement>;
|
|
56
72
|
subscriptions: import("@vkontakte/videoplayer-shared").Subscription;
|
|
57
73
|
error$: import("@vkontakte/videoplayer-shared").Subject<import("../..").CustomError>;
|
|
74
|
+
controlTap?: import("./utils/ControlTap").ControlTap;
|
|
75
|
+
isInteracted: boolean;
|
|
76
|
+
isRemoved: boolean;
|
|
58
77
|
control: import("@interactiveplatform/movika-manifest/dist/chapter-DI_7rDZW").e;
|
|
59
78
|
options?: import("./controls").Options | undefined;
|
|
79
|
+
onControlSelect: () => void;
|
|
80
|
+
removeView(withTransition?: boolean): void;
|
|
81
|
+
onTransitionEnd: (event: TransitionEvent) => void;
|
|
82
|
+
onError(message: string | undefined, error: unknown): void;
|
|
83
|
+
addControlTap(controlElement: HTMLElement): void;
|
|
60
84
|
createContainerElement(callbacks: import("./controls").Callbacks): void;
|
|
61
85
|
createClickListener(callback: AnyFn): (event: MouseEvent) => void;
|
|
62
86
|
featureIsEnabled(name: keyof import("./controls").ControlOptions["features"]): boolean | undefined;
|
|
87
|
+
isTouch(): boolean | undefined;
|
|
63
88
|
setEvents(callback: import("./controls").ControlEventCallback): void;
|
|
64
89
|
removeListeners(): void;
|
|
65
90
|
}>;
|
|
@@ -18,6 +18,9 @@ export type IOptionalInteractiveOptions = Partial<Omit<IInteractiveOptions, Requ
|
|
|
18
18
|
export type AnimationsFeatureToggles = Partial<{
|
|
19
19
|
areaControlShadow: boolean;
|
|
20
20
|
controlsExpectTimeBlinkAnimation: boolean;
|
|
21
|
+
controlsTapPlace: boolean;
|
|
22
|
+
controlsFillAnimation: boolean;
|
|
23
|
+
controlsHideAnimation: boolean;
|
|
21
24
|
}>;
|
|
22
25
|
export interface IInteractiveOptions {
|
|
23
26
|
parentElement: HTMLElement;
|
|
@@ -44,6 +47,7 @@ export interface IInteractiveOptions {
|
|
|
44
47
|
* @deprecated
|
|
45
48
|
* */
|
|
46
49
|
disableControlsOnPause?: boolean;
|
|
50
|
+
isTouch?: boolean;
|
|
47
51
|
animationsFeatureToggles?: AnimationsFeatureToggles;
|
|
48
52
|
}
|
|
49
53
|
export type ChapterChangedData = {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type Options = {
|
|
2
|
+
startTime: number;
|
|
3
|
+
endTime: number;
|
|
4
|
+
rotateAngle: number;
|
|
5
|
+
borderRadius: string;
|
|
6
|
+
debug?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare class ControlFillAnimation {
|
|
9
|
+
fillAnimationElement: HTMLDivElement;
|
|
10
|
+
private fillAnimationFillerElement;
|
|
11
|
+
private fillAnimationFillerWrapperElement;
|
|
12
|
+
private startTime;
|
|
13
|
+
private endTime;
|
|
14
|
+
private shouldFillHeight;
|
|
15
|
+
private widthExpansionCoef;
|
|
16
|
+
private isDebug;
|
|
17
|
+
private fromLeft;
|
|
18
|
+
private useSkew;
|
|
19
|
+
private rotateAngle;
|
|
20
|
+
constructor(opts: Options);
|
|
21
|
+
updateDimension(opts: {
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
borderWidth: number;
|
|
25
|
+
}): void;
|
|
26
|
+
updateAnimation(currentTime: number): void;
|
|
27
|
+
/**
|
|
28
|
+
* Когда мы применяем scew для контрол, расстояние между крайними left & right
|
|
29
|
+
* точками становится больше. Это значит, что нужно увеличивать
|
|
30
|
+
* элемент-заполнитель, чтобы он заполнял контрол полностью. Этот метод
|
|
31
|
+
* возвращает коэффцицент увеличения для элемента-заполнителя.
|
|
32
|
+
*/
|
|
33
|
+
private calcWidthExpansionCoef;
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ControlFillAnimation';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const CONTROL_FILL_ANIMATION_CLASSNAME_PREFIX = "interactive-control-fill-animation";
|
|
2
|
+
export declare const controlFillAnimationClassNames: {
|
|
3
|
+
common: string;
|
|
4
|
+
fillerWrapper: string;
|
|
5
|
+
filler: string;
|
|
6
|
+
fillHeight: string;
|
|
7
|
+
fillWidth: string;
|
|
8
|
+
fromTop: string;
|
|
9
|
+
fromBottom: string;
|
|
10
|
+
fromLeft: string;
|
|
11
|
+
fromRight: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type Options = {
|
|
2
|
+
controlRotateAngleRad: number;
|
|
3
|
+
circleDiameterPx?: number;
|
|
4
|
+
useDimensionsBasedSize?: boolean;
|
|
5
|
+
clickCancelCondition: () => boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare class ControlTap {
|
|
8
|
+
element: HTMLDivElement;
|
|
9
|
+
controlRotateAngleRad: number;
|
|
10
|
+
clickCancelCondition: () => boolean;
|
|
11
|
+
circleDiameterPx: number;
|
|
12
|
+
useDimensionsBasedSize: boolean;
|
|
13
|
+
constructor({ controlRotateAngleRad, clickCancelCondition, circleDiameterPx, useDimensionsBasedSize, }: Options);
|
|
14
|
+
onElementClick: (e: MouseEvent) => void;
|
|
15
|
+
onAnimationEnd: (e: TransitionEvent) => void;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ControlTap';
|
|
@@ -5,10 +5,11 @@ import type { ChapterBranch } from '../../../manifest';
|
|
|
5
5
|
import type { EventEmitter } from '../../../utils/EventEmitter';
|
|
6
6
|
import { CustomError } from '../../../utils/Error';
|
|
7
7
|
import type { SelectBranchesType } from './SelectBranches';
|
|
8
|
-
import type { IgnoreExpectState } from '../../../modules/Interactives/types';
|
|
8
|
+
import type { IgnoreExpectState, AnimationsFeatureToggles } from '../../../modules/Interactives/types';
|
|
9
9
|
import type { ChoiceContainer } from '../../../modules/Interactives/containers';
|
|
10
10
|
import { type GlobalEvents } from './events';
|
|
11
11
|
import { GameStates } from './gameUtils';
|
|
12
|
+
type Features = Pick<AnimationsFeatureToggles, 'controlsHideAnimation'>;
|
|
12
13
|
type ConstructorArg = {
|
|
13
14
|
player: IPlayer;
|
|
14
15
|
container: ChoiceContainer;
|
|
@@ -23,6 +24,7 @@ type ConstructorArg = {
|
|
|
23
24
|
disabledControls$: IValueSubject<boolean>;
|
|
24
25
|
onRemove: () => void;
|
|
25
26
|
onError: (error: CustomError) => void;
|
|
27
|
+
features: Features;
|
|
26
28
|
};
|
|
27
29
|
export declare class GameController {
|
|
28
30
|
container: ChoiceContainer;
|
|
@@ -42,7 +44,8 @@ export declare class GameController {
|
|
|
42
44
|
isSelectedContainerEvent: boolean;
|
|
43
45
|
globalEvents: GlobalEvents;
|
|
44
46
|
onError: ConstructorArg['onError'];
|
|
45
|
-
|
|
47
|
+
features: Features;
|
|
48
|
+
constructor({ player, container, branches, selectBranches, interactiveEvents, globalEvents, globalEventEmitter, getContainerEventState, permanentTextControls, interactiveTimeOpenUri, disabledControls$, onRemove, onError, features, }: ConstructorArg);
|
|
46
49
|
private emitContainerVisibilityEvent;
|
|
47
50
|
registerEvents(): void;
|
|
48
51
|
hide: () => void;
|
|
@@ -55,10 +58,12 @@ export declare class GameController {
|
|
|
55
58
|
whilePlaying: () => void;
|
|
56
59
|
onResize(isInteractiveTime: boolean): void;
|
|
57
60
|
reset(): void;
|
|
58
|
-
removeView(): void;
|
|
61
|
+
removeView(withTransition?: boolean | undefined): void;
|
|
59
62
|
fakeRemoveView(remove?: boolean): void;
|
|
60
63
|
updateControlsShadowStyles(isDark?: boolean): void;
|
|
61
64
|
toggleBlinkAnimation(value: boolean): void;
|
|
62
|
-
|
|
65
|
+
isInteracted(): boolean;
|
|
66
|
+
isRemovedOrDestroyed(includeWillRemovedState?: boolean): boolean;
|
|
67
|
+
destroy(withTransition?: boolean): void;
|
|
63
68
|
}
|
|
64
69
|
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ErrorCategoryEnum, ErrorSeverityEnum } from '../../../types';
|
|
2
|
+
import { CustomError } from '../../../utils/Error';
|
|
3
|
+
import { Subject } from '@vkontakte/videoplayer-shared';
|
|
4
|
+
type EmitOnErrorArg = {
|
|
5
|
+
emitter$: Subject<CustomError>;
|
|
6
|
+
error?: unknown;
|
|
7
|
+
subjectId?: string;
|
|
8
|
+
message?: string;
|
|
9
|
+
severity?: ErrorSeverityEnum;
|
|
10
|
+
category?: ErrorCategoryEnum;
|
|
11
|
+
};
|
|
12
|
+
export declare function emitOnError({ emitter$, error, subjectId, message, severity, category, }: EmitOnErrorArg): void;
|
|
13
|
+
export {};
|
|
@@ -36,5 +36,6 @@ type ExecForAllExpectContainersParamsType = {
|
|
|
36
36
|
execFn: (gameController: GameController) => void;
|
|
37
37
|
};
|
|
38
38
|
export declare function execForAllExpectContainers({ gameControllers, subjectName, subjectId, execFn, }: ExecForAllExpectContainersParamsType): void;
|
|
39
|
+
export declare function isControlHasOpenURIEvent(control: Control): boolean;
|
|
39
40
|
export declare const evaluateContainerEventStatus: (container: ChapterContainer, gameControllers: GameController[]) => IgnoreExpectState;
|
|
40
41
|
export {};
|