@vkontakte/videoplayer-interactive 1.0.34 → 1.0.35-beta.1
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 +126 -37
- package/es2015.esm.js +126 -37
- package/es2018.cjs.js +126 -37
- package/es2018.esm.js +126 -37
- package/es2024.cjs.js +149 -0
- package/es2024.esm.js +149 -0
- package/esnext.cjs.js +126 -37
- package/esnext.esm.js +126 -37
- package/evergreen.esm.js +126 -37
- package/package.json +20 -15
- package/types/modules/Graph/Graph.d.ts +1 -1
- package/types/modules/Interactives/Interactives.d.ts +4 -1
- package/types/modules/Interactives/containers/ChoiceContainer.d.ts +7 -0
- package/types/modules/Interactives/containers/Container.d.ts +1 -1
- package/types/modules/Interactives/containers/types.d.ts +1 -1
- package/types/modules/Interactives/controls/AreaControl.d.ts +7 -1
- package/types/modules/Interactives/controls/ButtonControl.d.ts +7 -1
- package/types/modules/Interactives/controls/Control.d.ts +9 -2
- package/types/modules/Interactives/controls/TextControl.d.ts +4 -1
- package/types/modules/Interactives/controls/types.d.ts +1 -1
- package/types/modules/Interactives/controls/utils.d.ts +4 -0
- package/types/modules/Interactives/index.d.ts +26 -12
- package/types/modules/Interactives/styles/index.d.ts +1 -0
- package/types/modules/Interactives/types.d.ts +6 -7
- package/types/modules/Interactives/utils/BlinkAnimationRef.d.ts +15 -0
- package/types/modules/Interactives/utils/GameController.d.ts +6 -1
- package/types/modules/Interactives/utils/ResizeManager.d.ts +1 -0
- package/types/modules/Interactives/utils/SelectBranches.types.d.ts +1 -0
- package/types/modules/Interactives/utils/fallbackStrategies.d.ts +2 -2
- package/types/modules/Interactives/utils/functionUtils.d.ts +5 -0
- package/types/modules/Interactives/utils/gameUtils.d.ts +13 -2
- package/types/modules/Interactives/utils/renderingUtils.d.ts +15 -1
- package/types/modules/ManifestController/ManifestController.d.ts +1 -1
- package/types/modules/SeamlessController/SeamlessController.d.ts +1 -1
- package/types/utils/typeCheck.d.ts +2 -2
- /package/types/modules/Interactives/{styles.d.ts → styles/utils.d.ts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type InterfaceLanguage } from '@vkontakte/videoplayer-shared';
|
|
1
|
+
import { type InterfaceLanguage, Nullable } from '@vkontakte/videoplayer-shared';
|
|
2
2
|
import type { VideoInfo } from '../../modules/Interactives';
|
|
3
3
|
import type { GraphEditor } from '@interactiveplatform/movika-graph-editor';
|
|
4
4
|
import type { Chapter, Manifest } from '../../manifest';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Observable, ValueSubject } from '@vkontakte/videoplayer-shared';
|
|
1
|
+
import { Observable, ValueSubject, Nullable } from '@vkontakte/videoplayer-shared';
|
|
2
2
|
import type { Chapter, Manifest, AnyManifest } from '../../manifest';
|
|
3
3
|
import { type GlobalEvents } from './utils/events';
|
|
4
4
|
import { type InteractiveRange } from './utils/getInteractiveRanges';
|
|
@@ -34,6 +34,7 @@ export declare class Interactives {
|
|
|
34
34
|
private graph;
|
|
35
35
|
private lastFrame;
|
|
36
36
|
private noInteractionTimeout;
|
|
37
|
+
private blinkAnimationRef;
|
|
37
38
|
appState: INTERACTIVE_APP_STATES;
|
|
38
39
|
state: {
|
|
39
40
|
prevChapter$: ValueSubject<Nullable<Chapter>>;
|
|
@@ -70,6 +71,8 @@ export declare class Interactives {
|
|
|
70
71
|
private handleFakeRemoval;
|
|
71
72
|
private clearNoInteractionTimeout;
|
|
72
73
|
private reset;
|
|
74
|
+
private toggleBlinkAnimation;
|
|
75
|
+
private updateControlsShadowStyles;
|
|
73
76
|
get options(): IInteractiveOptions;
|
|
74
77
|
init(): void;
|
|
75
78
|
setManifest(manifest: AnyManifest | string): Promise<Manifest | undefined>;
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
+
import { Subject } from '@vkontakte/videoplayer-shared';
|
|
1
2
|
import { Container } from './Container';
|
|
2
3
|
import { ChapterContainer } from '../../../manifest';
|
|
3
4
|
import type { ChoiceContainerOptions, ContainerCreateViewParams } from './types';
|
|
5
|
+
import { CustomError } from '../../../utils/Error';
|
|
6
|
+
import { Nullable } from '@vkontakte/videoplayer-shared';
|
|
4
7
|
export declare const createChoiceContainer: (container: ChapterContainer, rootElement: HTMLElement, options?: ChoiceContainerOptions) => ChoiceContainer | undefined;
|
|
5
8
|
export declare class ChoiceContainer extends Container {
|
|
6
9
|
private rootElement;
|
|
7
10
|
private containerElement;
|
|
8
11
|
private layout;
|
|
12
|
+
private controlSubscriptions;
|
|
9
13
|
isRemoved: boolean;
|
|
10
14
|
isDisabled: boolean;
|
|
15
|
+
error$: Subject<CustomError>;
|
|
11
16
|
constructor(container: ChapterContainer, rootElement: HTMLElement, options?: ChoiceContainerOptions);
|
|
12
17
|
createView({ eventCallback }: ContainerCreateViewParams): HTMLElement;
|
|
13
18
|
hide(): void;
|
|
@@ -19,4 +24,6 @@ export declare class ChoiceContainer extends Container {
|
|
|
19
24
|
getElement(): Nullable<HTMLElement>;
|
|
20
25
|
onProgress(currentTimeMs: number, isInteractiveTime: boolean): void;
|
|
21
26
|
onResize(isInteractiveTime: boolean): void;
|
|
27
|
+
updateControlsShadowStyles(isDark?: boolean): void;
|
|
28
|
+
toggleBlinkAnimation(enable?: boolean): void;
|
|
22
29
|
}
|
|
@@ -7,7 +7,7 @@ export declare class Container {
|
|
|
7
7
|
private factories;
|
|
8
8
|
controls: Control[];
|
|
9
9
|
constructor(container: ChapterContainer, options?: Options);
|
|
10
|
-
featureIsEnabled(name: keyof ChoiceContainerOptions['features']):
|
|
10
|
+
featureIsEnabled(name: keyof ChoiceContainerOptions['features']): boolean | undefined;
|
|
11
11
|
addControlFactory(type: string, factory: ControlCreator<any>): void;
|
|
12
12
|
removeControlFactory(type: string): void;
|
|
13
13
|
private setControls;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Options, ControlEventCallback } from '../controls';
|
|
2
2
|
import { AnimationsFeatureToggles } from '../types';
|
|
3
3
|
export type ChoiceContainerOptions = {
|
|
4
|
-
features: Pick<AnimationsFeatureToggles,
|
|
4
|
+
features: Pick<AnimationsFeatureToggles, 'controlsExpectTimeBlinkAnimation'>;
|
|
5
5
|
};
|
|
6
6
|
export declare function isChoiceContainerOptions(options: Options): options is ChoiceContainerOptions;
|
|
7
7
|
export type ContainerCreateViewParams = {
|
|
@@ -4,9 +4,15 @@ 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
|
+
registerEvents(): void;
|
|
7
8
|
disable(): void;
|
|
8
9
|
enable(): void;
|
|
9
|
-
getElement(): Nullable<HTMLElement>;
|
|
10
|
+
getElement(): import("@vkontakte/videoplayer-shared").Nullable<HTMLElement>;
|
|
11
|
+
updateShadowStyles(isDark?: boolean): void;
|
|
12
|
+
toggleBlinkAnimation(enable?: boolean): void;
|
|
13
|
+
syncBlinkAnimation(refAnim: HTMLElement): void;
|
|
14
|
+
onBlinkHovering(): void;
|
|
15
|
+
onError(message: string | undefined, error: unknown): void;
|
|
10
16
|
onProgress(): void;
|
|
11
17
|
onResize(): void;
|
|
12
18
|
}
|
|
@@ -4,10 +4,16 @@ export declare const createButtonControl: ControlCreator<ControlOptions, ButtonC
|
|
|
4
4
|
declare class ButtonControl extends Control {
|
|
5
5
|
constructor(control: TControl, options?: ControlOptions);
|
|
6
6
|
createView({ parentElement, callbacks }: ControlCreateViewParams): void;
|
|
7
|
+
registerEvents(): void;
|
|
7
8
|
disable(): void;
|
|
8
9
|
enable(): void;
|
|
9
|
-
getElement(): Nullable<HTMLElement>;
|
|
10
|
+
getElement(): import("@vkontakte/videoplayer-shared").Nullable<HTMLElement>;
|
|
11
|
+
toggleBlinkAnimation(enable?: boolean): void;
|
|
12
|
+
syncBlinkAnimation(refAnim: HTMLElement): void;
|
|
13
|
+
onBlinkHovering(): void;
|
|
14
|
+
onError(message: string | undefined, error: unknown): void;
|
|
10
15
|
onProgress(): void;
|
|
11
16
|
onResize(): void;
|
|
17
|
+
updateShadowStyles(): void;
|
|
12
18
|
}
|
|
13
19
|
export {};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { Subject, Subscription } from '@vkontakte/videoplayer-shared';
|
|
1
2
|
import type { ControlEventCallback, ControlCreateViewParams, Dimensions, Callbacks, Options, TControl, ControlOptions } from './types';
|
|
3
|
+
import { CustomError } from '../../../utils/Error';
|
|
4
|
+
import { Nullable } from '@vkontakte/videoplayer-shared';
|
|
2
5
|
type ControlContainer = {
|
|
3
6
|
element: HTMLElement;
|
|
4
7
|
dimensions: Dimensions;
|
|
@@ -9,7 +12,8 @@ export declare abstract class Control {
|
|
|
9
12
|
options?: Options | undefined;
|
|
10
13
|
container: Nullable<ControlContainer>;
|
|
11
14
|
controlElement: Nullable<HTMLElement>;
|
|
12
|
-
|
|
15
|
+
subscriptions: Subscription;
|
|
16
|
+
error$: Subject<CustomError>;
|
|
13
17
|
constructor(control: TControl, options?: Options | undefined);
|
|
14
18
|
abstract createView(params: ControlCreateViewParams): void;
|
|
15
19
|
abstract getElement(): Nullable<HTMLElement>;
|
|
@@ -17,9 +21,12 @@ export declare abstract class Control {
|
|
|
17
21
|
abstract enable(): void;
|
|
18
22
|
abstract onProgress(currentTimeMs: number): void;
|
|
19
23
|
abstract onResize(): void;
|
|
24
|
+
abstract onError(message: string, error?: string | Error | CustomError): void;
|
|
25
|
+
abstract updateShadowStyles(isDark?: boolean): void;
|
|
26
|
+
abstract toggleBlinkAnimation(enable?: boolean): void;
|
|
20
27
|
createContainerElement(callbacks: Callbacks): void;
|
|
21
28
|
createClickListener(callback: AnyFn): ClickListener;
|
|
22
|
-
featureIsEnabled(name: keyof ControlOptions['features']):
|
|
29
|
+
featureIsEnabled(name: keyof ControlOptions['features']): boolean | undefined;
|
|
23
30
|
setEvents(callback: ControlEventCallback): void;
|
|
24
31
|
removeListeners(): void;
|
|
25
32
|
}
|
|
@@ -4,10 +4,13 @@ export declare const createTextControl: ControlCreator<ControlOptions, TextContr
|
|
|
4
4
|
declare class TextControl extends Control {
|
|
5
5
|
constructor(control: TControl, options?: ControlOptions);
|
|
6
6
|
createView({ parentElement, callbacks }: ControlCreateViewParams): void;
|
|
7
|
-
getElement(): Nullable<HTMLElement>;
|
|
7
|
+
getElement(): import("@vkontakte/videoplayer-shared").Nullable<HTMLElement>;
|
|
8
8
|
disable(): void;
|
|
9
9
|
enable(): void;
|
|
10
10
|
onProgress(): void;
|
|
11
11
|
onResize(): void;
|
|
12
|
+
updateShadowStyles(): void;
|
|
13
|
+
toggleBlinkAnimation(): void;
|
|
14
|
+
onError(): void;
|
|
12
15
|
}
|
|
13
16
|
export {};
|
|
@@ -21,7 +21,7 @@ export type ControlCreateViewParams = {
|
|
|
21
21
|
};
|
|
22
22
|
export type Options = Record<string, unknown>;
|
|
23
23
|
export type ControlOptions = {
|
|
24
|
-
features: Pick<AnimationsFeatureToggles,
|
|
24
|
+
features: Pick<AnimationsFeatureToggles, 'controlsExpectTimeBlinkAnimation'>;
|
|
25
25
|
};
|
|
26
26
|
export declare function isControlOptions(options: Options): options is ControlOptions;
|
|
27
27
|
type ControlEventCallbackParams = {
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
export declare const CONTROLS_CLASSNAME_PREFIX = "interactive-control";
|
|
2
2
|
export declare const controlsClassNames: {
|
|
3
3
|
common: string;
|
|
4
|
+
selected: string;
|
|
4
5
|
wrapper: string;
|
|
5
6
|
disabled: string;
|
|
6
7
|
button: string;
|
|
7
8
|
area: string;
|
|
8
9
|
text: string;
|
|
10
|
+
blinkAnim: string;
|
|
11
|
+
blinkAnimButton: string;
|
|
12
|
+
blinkAnimArea: string;
|
|
9
13
|
};
|
|
@@ -9,43 +9,57 @@ 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
|
+
registerEvents(): void;
|
|
12
13
|
disable(): void;
|
|
13
14
|
enable(): void;
|
|
14
|
-
getElement(): Nullable<HTMLElement>;
|
|
15
|
+
getElement(): import("@vkontakte/videoplayer-shared").Nullable<HTMLElement>;
|
|
16
|
+
updateShadowStyles(isDark?: boolean): void;
|
|
17
|
+
toggleBlinkAnimation(enable?: boolean): void;
|
|
18
|
+
syncBlinkAnimation(refAnim: HTMLElement): void;
|
|
19
|
+
onBlinkHovering(): void;
|
|
20
|
+
onError(message: string | undefined, error: unknown): void;
|
|
15
21
|
onProgress(): void;
|
|
16
22
|
onResize(): void;
|
|
17
|
-
container: Nullable<{
|
|
23
|
+
container: import("@vkontakte/videoplayer-shared").Nullable<{
|
|
18
24
|
element: HTMLElement;
|
|
19
25
|
dimensions: import("./controls").Dimensions;
|
|
20
26
|
}>;
|
|
21
|
-
controlElement: Nullable<HTMLElement>;
|
|
22
|
-
|
|
27
|
+
controlElement: import("@vkontakte/videoplayer-shared").Nullable<HTMLElement>;
|
|
28
|
+
subscriptions: import("@vkontakte/videoplayer-shared").Subscription;
|
|
29
|
+
error$: import("@vkontakte/videoplayer-shared").Subject<import("../..").CustomError>;
|
|
23
30
|
control: import("@interactiveplatform/movika-manifest/dist/chapter-DI_7rDZW").e;
|
|
24
|
-
options?: import("./controls").Options;
|
|
31
|
+
options?: import("./controls").Options | undefined;
|
|
25
32
|
createContainerElement(callbacks: import("./controls").Callbacks): void;
|
|
26
33
|
createClickListener(callback: AnyFn): (event: MouseEvent) => void;
|
|
27
|
-
featureIsEnabled(name: keyof import("./controls").ControlOptions["features"]):
|
|
34
|
+
featureIsEnabled(name: keyof import("./controls").ControlOptions["features"]): boolean | undefined;
|
|
28
35
|
setEvents(callback: import("./controls").ControlEventCallback): void;
|
|
29
36
|
removeListeners(): void;
|
|
30
37
|
}>;
|
|
31
38
|
createButtonControl: import("./controls").ControlCreator<import("./controls").ControlOptions, {
|
|
32
39
|
createView({ parentElement, callbacks }: import("./controls").ControlCreateViewParams): void;
|
|
40
|
+
registerEvents(): void;
|
|
33
41
|
disable(): void;
|
|
34
42
|
enable(): void;
|
|
35
|
-
getElement(): Nullable<HTMLElement>;
|
|
43
|
+
getElement(): import("@vkontakte/videoplayer-shared").Nullable<HTMLElement>;
|
|
44
|
+
toggleBlinkAnimation(enable?: boolean): void;
|
|
45
|
+
syncBlinkAnimation(refAnim: HTMLElement): void;
|
|
46
|
+
onBlinkHovering(): void;
|
|
47
|
+
onError(message: string | undefined, error: unknown): void;
|
|
36
48
|
onProgress(): void;
|
|
37
49
|
onResize(): void;
|
|
38
|
-
|
|
50
|
+
updateShadowStyles(): void;
|
|
51
|
+
container: import("@vkontakte/videoplayer-shared").Nullable<{
|
|
39
52
|
element: HTMLElement;
|
|
40
53
|
dimensions: import("./controls").Dimensions;
|
|
41
54
|
}>;
|
|
42
|
-
controlElement: Nullable<HTMLElement>;
|
|
43
|
-
|
|
55
|
+
controlElement: import("@vkontakte/videoplayer-shared").Nullable<HTMLElement>;
|
|
56
|
+
subscriptions: import("@vkontakte/videoplayer-shared").Subscription;
|
|
57
|
+
error$: import("@vkontakte/videoplayer-shared").Subject<import("../..").CustomError>;
|
|
44
58
|
control: import("@interactiveplatform/movika-manifest/dist/chapter-DI_7rDZW").e;
|
|
45
|
-
options?: import("./controls").Options;
|
|
59
|
+
options?: import("./controls").Options | undefined;
|
|
46
60
|
createContainerElement(callbacks: import("./controls").Callbacks): void;
|
|
47
61
|
createClickListener(callback: AnyFn): (event: MouseEvent) => void;
|
|
48
|
-
featureIsEnabled(name: keyof import("./controls").ControlOptions["features"]):
|
|
62
|
+
featureIsEnabled(name: keyof import("./controls").ControlOptions["features"]): boolean | undefined;
|
|
49
63
|
setEvents(callback: import("./controls").ControlEventCallback): void;
|
|
50
64
|
removeListeners(): void;
|
|
51
65
|
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './utils';
|
|
@@ -4,11 +4,7 @@ import type { IOneStat } from '@vkontakte/videoplayer-statistics';
|
|
|
4
4
|
import type { Loaders } from '../../modules/ManifestController/Loadable';
|
|
5
5
|
import type { HistoryApi, HistorySettings } from '../../modules/Interactives/utils/HistoryController';
|
|
6
6
|
import type { Chapter, ManifestVideo } from '../../manifest';
|
|
7
|
-
export type VideoInfo
|
|
8
|
-
id: string;
|
|
9
|
-
cover: string;
|
|
10
|
-
title?: string;
|
|
11
|
-
};
|
|
7
|
+
export type { VideoInfo } from '@interactiveplatform/movika-graph-editor';
|
|
12
8
|
export type InteractiveProjectInfo = {
|
|
13
9
|
videoId: string;
|
|
14
10
|
pid?: string;
|
|
@@ -19,7 +15,10 @@ export type RequiredOptions = 'parentElement' | 'fullscreenTargetElement';
|
|
|
19
15
|
export type IOptionalInteractiveOptions = Partial<Omit<IInteractiveOptions, RequiredOptions | 'config'>> & Required<Pick<IInteractiveOptions, RequiredOptions>> & {
|
|
20
16
|
config?: Partial<IInteractiveOptions['config']>;
|
|
21
17
|
};
|
|
22
|
-
export type AnimationsFeatureToggles = {
|
|
18
|
+
export type AnimationsFeatureToggles = Partial<{
|
|
19
|
+
areaControlShadow: boolean;
|
|
20
|
+
controlsExpectTimeBlinkAnimation: boolean;
|
|
21
|
+
}>;
|
|
23
22
|
export interface IInteractiveOptions {
|
|
24
23
|
parentElement: HTMLElement;
|
|
25
24
|
fullscreenTargetElement: HTMLElement;
|
|
@@ -45,7 +44,7 @@ export interface IInteractiveOptions {
|
|
|
45
44
|
* @deprecated
|
|
46
45
|
* */
|
|
47
46
|
disableControlsOnPause?: boolean;
|
|
48
|
-
|
|
47
|
+
animationsFeatureToggles?: AnimationsFeatureToggles;
|
|
49
48
|
}
|
|
50
49
|
export type ChapterChangedData = {
|
|
51
50
|
chapter: Chapter;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const BLINK_ANIM_CLASSNAME_PREFIX = "interactive-blink-anim-reference";
|
|
2
|
+
export declare const blinkAnimClassNames: {
|
|
3
|
+
common: string;
|
|
4
|
+
animation: string;
|
|
5
|
+
disabled: string;
|
|
6
|
+
};
|
|
7
|
+
export declare class BlinkAnimationRef {
|
|
8
|
+
private _RAFId;
|
|
9
|
+
private _element;
|
|
10
|
+
get element(): HTMLDivElement | undefined;
|
|
11
|
+
create(): void;
|
|
12
|
+
restart(): void;
|
|
13
|
+
private cleanupRAF;
|
|
14
|
+
destroy(): void;
|
|
15
|
+
}
|
|
@@ -3,6 +3,7 @@ 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 { CustomError } from '../../../utils/Error';
|
|
6
7
|
import type { SelectBranchesType } from './SelectBranches';
|
|
7
8
|
import type { IgnoreExpectState } from '../../../modules/Interactives/types';
|
|
8
9
|
import type { ChoiceContainer } from '../../../modules/Interactives/containers';
|
|
@@ -21,6 +22,7 @@ type ConstructorArg = {
|
|
|
21
22
|
interactiveTimeOpenUri: boolean;
|
|
22
23
|
disabledControls$: IValueSubject<boolean>;
|
|
23
24
|
onRemove: () => void;
|
|
25
|
+
onError: (error: CustomError) => void;
|
|
24
26
|
};
|
|
25
27
|
export declare class GameController {
|
|
26
28
|
container: ChoiceContainer;
|
|
@@ -39,7 +41,8 @@ export declare class GameController {
|
|
|
39
41
|
isSelectedControlEvent: boolean;
|
|
40
42
|
isSelectedContainerEvent: boolean;
|
|
41
43
|
globalEvents: GlobalEvents;
|
|
42
|
-
|
|
44
|
+
onError: ConstructorArg['onError'];
|
|
45
|
+
constructor({ player, container, branches, selectBranches, interactiveEvents, globalEvents, globalEventEmitter, getContainerEventState, permanentTextControls, interactiveTimeOpenUri, disabledControls$, onRemove, onError, }: ConstructorArg);
|
|
43
46
|
private emitContainerVisibilityEvent;
|
|
44
47
|
registerEvents(): void;
|
|
45
48
|
hide: () => void;
|
|
@@ -54,6 +57,8 @@ export declare class GameController {
|
|
|
54
57
|
reset(): void;
|
|
55
58
|
removeView(): void;
|
|
56
59
|
fakeRemoveView(remove?: boolean): void;
|
|
60
|
+
updateControlsShadowStyles(isDark?: boolean): void;
|
|
61
|
+
toggleBlinkAnimation(value: boolean): void;
|
|
57
62
|
destroy(): void;
|
|
58
63
|
}
|
|
59
64
|
export {};
|
|
@@ -3,6 +3,7 @@ import type { EventEmitter } from '../../../utils/EventEmitter';
|
|
|
3
3
|
import type { IPlayer } from '@vkontakte/videoplayer-core';
|
|
4
4
|
import type { InteractiveEventsType } from './InteractiveEvents';
|
|
5
5
|
import type { GlobalEvents } from './events';
|
|
6
|
+
import { Nullable } from '@vkontakte/videoplayer-shared';
|
|
6
7
|
export type SubjectName = 'chapter' | 'container' | 'control';
|
|
7
8
|
export type AfterExpectActionType = 'after-expect';
|
|
8
9
|
export type Behaviour = 'change-chapter' | 'change-manifest';
|
|
@@ -7,11 +7,11 @@ export declare const getRandomNumber: (limit: number) => number;
|
|
|
7
7
|
/**
|
|
8
8
|
* Finds the value with minimal weight number
|
|
9
9
|
*/
|
|
10
|
-
export declare const minFallbackStrategy: (branches: ChapterBranch[]) =>
|
|
10
|
+
export declare const minFallbackStrategy: (branches: ChapterBranch[]) => ChapterBranch | null;
|
|
11
11
|
/**
|
|
12
12
|
* Finds the value with maximal weight number
|
|
13
13
|
*/
|
|
14
|
-
export declare const maxFallbackStrategy: (branches: ChapterBranch[]) =>
|
|
14
|
+
export declare const maxFallbackStrategy: (branches: ChapterBranch[]) => ChapterBranch | null;
|
|
15
15
|
/**
|
|
16
16
|
* Finds first branch with `isDefault === true` value
|
|
17
17
|
*/
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
type Reverse<T extends unknown[]> = T extends [infer First, ...infer Rest] ? [...Reverse<Rest>, First] : T;
|
|
2
|
+
export declare function reverseArgs<Fn extends AnyFn>(fn: Fn): (...args: Reverse<Parameters<Fn>>) => ReturnType<Fn>;
|
|
3
|
+
export declare function partial<T extends unknown[], U extends unknown[], R>(fn: (...args: [...T, ...U]) => R, ...presetArgs: T): (...laterArgs: U) => R;
|
|
4
|
+
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>;
|
|
5
|
+
export {};
|
|
@@ -23,7 +23,18 @@ export declare const isOneCtrlOneContainer: (controls: Control[]) => boolean;
|
|
|
23
23
|
export declare const isOneTextCtrlContainer: (controls: Control[]) => boolean;
|
|
24
24
|
export declare function excludeTextControl(containers?: ChapterContainer[]): ChapterContainer[];
|
|
25
25
|
export declare const isEOVEndTime: (target: HTMLVideoElement, endTime: ChapterContainer["endTime"]) => boolean;
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
/**
|
|
27
|
+
* @param {GameController[]} [gameControllers=[]] список контрллеров
|
|
28
|
+
* @param {(number | null | undefined)} [expectTime=Infinity] expectTime = endTime - какой expectTime мы ищем
|
|
29
|
+
* @param {string[]} [ignoreIds=[]] какие контейнеры игнорировать
|
|
30
|
+
*/
|
|
31
|
+
export declare function getGameControllerContainersWithExpect(gameControllers?: GameController[], expectTime?: number | null | undefined, ignoreIds?: string[]): GameController[];
|
|
32
|
+
type ExecForAllExpectContainersParamsType = {
|
|
33
|
+
gameControllers: GameController[];
|
|
34
|
+
subjectName: string;
|
|
35
|
+
subjectId: string;
|
|
36
|
+
execFn: (gameController: GameController) => void;
|
|
37
|
+
};
|
|
38
|
+
export declare function execForAllExpectContainers({ gameControllers, subjectName, subjectId, execFn, }: ExecForAllExpectContainersParamsType): void;
|
|
28
39
|
export declare const evaluateContainerEventStatus: (container: ChapterContainer, gameControllers: GameController[]) => IgnoreExpectState;
|
|
29
40
|
export {};
|
|
@@ -7,12 +7,17 @@ export declare const controlStylesFallbacks: {
|
|
|
7
7
|
textContent: string;
|
|
8
8
|
roundCorners: number;
|
|
9
9
|
borderWidth: number;
|
|
10
|
+
borderWidthRawValue: string;
|
|
11
|
+
roundCornersRawValue: string;
|
|
10
12
|
borderColor: string;
|
|
11
13
|
borderAlpha: number;
|
|
12
14
|
backgroundColor: string;
|
|
13
15
|
backgroundAlpha: number;
|
|
14
16
|
innerSizesDependOn: string;
|
|
15
17
|
angle: number;
|
|
18
|
+
shadowColorLight: string;
|
|
19
|
+
shadowColorDark: string;
|
|
20
|
+
shadowColorAlpha: number;
|
|
16
21
|
};
|
|
17
22
|
type ControlStylesFallbacks = typeof controlStylesFallbacks;
|
|
18
23
|
export declare enum ALIGN_ITEMS {
|
|
@@ -55,8 +60,17 @@ type SetBorderStylesProps = {
|
|
|
55
60
|
props: Control['props'];
|
|
56
61
|
fallback: ControlStylesFallbacks;
|
|
57
62
|
dependsOn: Dimensions;
|
|
63
|
+
useRawValues?: boolean;
|
|
58
64
|
};
|
|
59
|
-
export declare const setBorderStyles: ({ target, props, fallback, dependsOn }: SetBorderStylesProps) => void;
|
|
65
|
+
export declare const setBorderStyles: ({ target, props, fallback, dependsOn, useRawValues }: SetBorderStylesProps) => void;
|
|
66
|
+
type SetShadowStylesProps = {
|
|
67
|
+
target: HTMLElement;
|
|
68
|
+
props?: Control['props'];
|
|
69
|
+
fallback: ControlStylesFallbacks;
|
|
70
|
+
isDark: boolean;
|
|
71
|
+
baseDimension: string;
|
|
72
|
+
};
|
|
73
|
+
export declare const setShadowStyles: ({ target, isDark, baseDimension, fallback }: SetShadowStylesProps) => void;
|
|
60
74
|
type SetAngleProps = {
|
|
61
75
|
target: HTMLElement;
|
|
62
76
|
fallback: ControlStylesFallbacks;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IValueSubject } from '@vkontakte/videoplayer-shared';
|
|
1
|
+
import type { IValueSubject, Nullable } from '@vkontakte/videoplayer-shared';
|
|
2
2
|
import type { ChapterBranch, ManifestVideo, Chapter, Manifest, GraphEditChapter, GraphViewChapter, AnyManifest } from '../../manifest';
|
|
3
3
|
import { Loadable } from './Loadable';
|
|
4
4
|
type BranchesData = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IConfig, PlaybackRate, VideoQuality } from '@vkontakte/videoplayer-core';
|
|
2
|
-
import { ValueSubject } from '@vkontakte/videoplayer-shared';
|
|
2
|
+
import { Nullable, ValueSubject } from '@vkontakte/videoplayer-shared';
|
|
3
3
|
import type { ManifestVideo, Extension } from '../../manifest';
|
|
4
4
|
import type { Interactives } from '../../modules/Interactives';
|
|
5
5
|
import type { Instance } from './InstanceManager';
|
|
@@ -8,11 +8,11 @@ export declare enum TypesEnum {
|
|
|
8
8
|
}
|
|
9
9
|
type TypesEnumKeys = `${TypesEnum}`;
|
|
10
10
|
export declare const isType: (value: unknown, is: TypesEnumKeys) => boolean;
|
|
11
|
-
export declare const isObject: (value: unknown) => value is
|
|
11
|
+
export declare const isObject: (value: unknown) => value is Record<string, unknown>;
|
|
12
12
|
export declare const isString: (value: unknown) => value is string;
|
|
13
13
|
export declare const isArray: (value: unknown) => value is Array<unknown>;
|
|
14
14
|
export declare const isNumber: (value: unknown) => value is number;
|
|
15
|
-
export declare const isFunction: (value: unknown) => value is
|
|
15
|
+
export declare const isFunction: (value: unknown) => value is AnyFn;
|
|
16
16
|
export declare const isBoolean: (value: unknown) => value is boolean;
|
|
17
17
|
export declare const isNotNaNNumber: (value: unknown) => boolean;
|
|
18
18
|
export declare const isNaNNumber: (value: unknown) => boolean;
|
|
File without changes
|