@vkontakte/videoplayer-interactive 1.0.34-dev.5fec3796.0 → 1.0.34-dev.740b6a98.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 +36 -125
- package/es2015.esm.js +36 -125
- package/es2018.cjs.js +36 -125
- package/es2018.esm.js +36 -125
- package/esnext.cjs.js +36 -125
- package/esnext.esm.js +36 -125
- package/evergreen.esm.js +36 -125
- package/package.json +4 -4
- package/types/modules/Interactives/Interactives.d.ts +0 -3
- package/types/modules/Interactives/containers/ChoiceContainer.d.ts +0 -6
- 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 +0 -6
- package/types/modules/Interactives/controls/ButtonControl.d.ts +0 -6
- package/types/modules/Interactives/controls/Control.d.ts +2 -8
- package/types/modules/Interactives/controls/TextControl.d.ts +0 -3
- package/types/modules/Interactives/controls/types.d.ts +1 -1
- package/types/modules/Interactives/controls/utils.d.ts +0 -4
- package/types/modules/Interactives/index.d.ts +4 -18
- package/types/modules/Interactives/types.d.ts +2 -5
- package/types/modules/Interactives/utils/GameController.d.ts +1 -6
- package/types/modules/Interactives/utils/gameUtils.d.ts +2 -13
- package/types/modules/Interactives/utils/renderingUtils.d.ts +1 -15
- package/types/utils/typeCheck.d.ts +2 -2
- package/types/modules/Interactives/styles/index.d.ts +0 -1
- package/types/modules/Interactives/utils/BlinkAnimationRef.d.ts +0 -15
- package/types/modules/Interactives/utils/functionUtils.d.ts +0 -5
- /package/types/modules/Interactives/{styles/utils.d.ts → styles.d.ts} +0 -0
|
@@ -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']): false | 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, never>;
|
|
5
5
|
};
|
|
6
6
|
export declare function isChoiceContainerOptions(options: Options): options is ChoiceContainerOptions;
|
|
7
7
|
export type ContainerCreateViewParams = {
|
|
@@ -4,15 +4,9 @@ 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;
|
|
8
7
|
disable(): void;
|
|
9
8
|
enable(): void;
|
|
10
9
|
getElement(): 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;
|
|
16
10
|
onProgress(): void;
|
|
17
11
|
onResize(): void;
|
|
18
12
|
}
|
|
@@ -4,16 +4,10 @@ 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;
|
|
8
7
|
disable(): void;
|
|
9
8
|
enable(): void;
|
|
10
9
|
getElement(): Nullable<HTMLElement>;
|
|
11
|
-
toggleBlinkAnimation(enable?: boolean): void;
|
|
12
|
-
syncBlinkAnimation(refAnim: HTMLElement): void;
|
|
13
|
-
onBlinkHovering(): void;
|
|
14
|
-
onError(message: string | undefined, error: unknown): void;
|
|
15
10
|
onProgress(): void;
|
|
16
11
|
onResize(): void;
|
|
17
|
-
updateShadowStyles(): void;
|
|
18
12
|
}
|
|
19
13
|
export {};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { Subject, Subscription } from '@vkontakte/videoplayer-shared';
|
|
2
1
|
import type { ControlEventCallback, ControlCreateViewParams, Dimensions, Callbacks, Options, TControl, ControlOptions } from './types';
|
|
3
|
-
import { CustomError } from '../../../utils/Error';
|
|
4
2
|
type ControlContainer = {
|
|
5
3
|
element: HTMLElement;
|
|
6
4
|
dimensions: Dimensions;
|
|
@@ -11,8 +9,7 @@ export declare abstract class Control {
|
|
|
11
9
|
options?: Options | undefined;
|
|
12
10
|
container: Nullable<ControlContainer>;
|
|
13
11
|
controlElement: Nullable<HTMLElement>;
|
|
14
|
-
|
|
15
|
-
error$: Subject<CustomError>;
|
|
12
|
+
clickListener: Nullable<ClickListener>;
|
|
16
13
|
constructor(control: TControl, options?: Options | undefined);
|
|
17
14
|
abstract createView(params: ControlCreateViewParams): void;
|
|
18
15
|
abstract getElement(): Nullable<HTMLElement>;
|
|
@@ -20,12 +17,9 @@ export declare abstract class Control {
|
|
|
20
17
|
abstract enable(): void;
|
|
21
18
|
abstract onProgress(currentTimeMs: number): void;
|
|
22
19
|
abstract onResize(): void;
|
|
23
|
-
abstract onError(message: string, error?: string | Error | CustomError): void;
|
|
24
|
-
abstract updateShadowStyles(isDark?: boolean): void;
|
|
25
|
-
abstract toggleBlinkAnimation(enable?: boolean): void;
|
|
26
20
|
createContainerElement(callbacks: Callbacks): void;
|
|
27
21
|
createClickListener(callback: AnyFn): ClickListener;
|
|
28
|
-
featureIsEnabled(name: keyof ControlOptions['features']):
|
|
22
|
+
featureIsEnabled(name: keyof ControlOptions['features']): false | undefined;
|
|
29
23
|
setEvents(callback: ControlEventCallback): void;
|
|
30
24
|
removeListeners(): void;
|
|
31
25
|
}
|
|
@@ -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, never>;
|
|
25
25
|
};
|
|
26
26
|
export declare function isControlOptions(options: Options): options is ControlOptions;
|
|
27
27
|
type ControlEventCallbackParams = {
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
export declare const CONTROLS_CLASSNAME_PREFIX = "interactive-control";
|
|
2
2
|
export declare const controlsClassNames: {
|
|
3
3
|
common: string;
|
|
4
|
-
selected: string;
|
|
5
4
|
wrapper: string;
|
|
6
5
|
disabled: string;
|
|
7
6
|
button: string;
|
|
8
7
|
area: string;
|
|
9
8
|
text: string;
|
|
10
|
-
blinkAnim: string;
|
|
11
|
-
blinkAnimButton: string;
|
|
12
|
-
blinkAnimArea: string;
|
|
13
9
|
};
|
|
@@ -9,15 +9,9 @@ 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;
|
|
13
12
|
disable(): void;
|
|
14
13
|
enable(): void;
|
|
15
14
|
getElement(): 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;
|
|
21
15
|
onProgress(): void;
|
|
22
16
|
onResize(): void;
|
|
23
17
|
container: Nullable<{
|
|
@@ -25,41 +19,33 @@ export declare const utils: {
|
|
|
25
19
|
dimensions: import("./controls").Dimensions;
|
|
26
20
|
}>;
|
|
27
21
|
controlElement: Nullable<HTMLElement>;
|
|
28
|
-
|
|
29
|
-
error$: import("@vkontakte/videoplayer-shared").Subject<import("../..").CustomError>;
|
|
22
|
+
clickListener: Nullable<(event: MouseEvent) => void>;
|
|
30
23
|
control: import("@interactiveplatform/movika-manifest/dist/chapter-DI_7rDZW").e;
|
|
31
24
|
options?: import("./controls").Options;
|
|
32
25
|
createContainerElement(callbacks: import("./controls").Callbacks): void;
|
|
33
26
|
createClickListener(callback: AnyFn): (event: MouseEvent) => void;
|
|
34
|
-
featureIsEnabled(name: keyof import("./controls").ControlOptions["features"]):
|
|
27
|
+
featureIsEnabled(name: keyof import("./controls").ControlOptions["features"]): false | undefined;
|
|
35
28
|
setEvents(callback: import("./controls").ControlEventCallback): void;
|
|
36
29
|
removeListeners(): void;
|
|
37
30
|
}>;
|
|
38
31
|
createButtonControl: import("./controls").ControlCreator<import("./controls").ControlOptions, {
|
|
39
32
|
createView({ parentElement, callbacks }: import("./controls").ControlCreateViewParams): void;
|
|
40
|
-
registerEvents(): void;
|
|
41
33
|
disable(): void;
|
|
42
34
|
enable(): void;
|
|
43
35
|
getElement(): Nullable<HTMLElement>;
|
|
44
|
-
toggleBlinkAnimation(enable?: boolean): void;
|
|
45
|
-
syncBlinkAnimation(refAnim: HTMLElement): void;
|
|
46
|
-
onBlinkHovering(): void;
|
|
47
|
-
onError(message: string | undefined, error: unknown): void;
|
|
48
36
|
onProgress(): void;
|
|
49
37
|
onResize(): void;
|
|
50
|
-
updateShadowStyles(): void;
|
|
51
38
|
container: Nullable<{
|
|
52
39
|
element: HTMLElement;
|
|
53
40
|
dimensions: import("./controls").Dimensions;
|
|
54
41
|
}>;
|
|
55
42
|
controlElement: Nullable<HTMLElement>;
|
|
56
|
-
|
|
57
|
-
error$: import("@vkontakte/videoplayer-shared").Subject<import("../..").CustomError>;
|
|
43
|
+
clickListener: Nullable<(event: MouseEvent) => void>;
|
|
58
44
|
control: import("@interactiveplatform/movika-manifest/dist/chapter-DI_7rDZW").e;
|
|
59
45
|
options?: import("./controls").Options;
|
|
60
46
|
createContainerElement(callbacks: import("./controls").Callbacks): void;
|
|
61
47
|
createClickListener(callback: AnyFn): (event: MouseEvent) => void;
|
|
62
|
-
featureIsEnabled(name: keyof import("./controls").ControlOptions["features"]):
|
|
48
|
+
featureIsEnabled(name: keyof import("./controls").ControlOptions["features"]): false | undefined;
|
|
63
49
|
setEvents(callback: import("./controls").ControlEventCallback): void;
|
|
64
50
|
removeListeners(): void;
|
|
65
51
|
}>;
|
|
@@ -19,10 +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 type AnimationsFeatureToggles =
|
|
23
|
-
areaControlShadow: boolean;
|
|
24
|
-
controlsExpectTimeBlinkAnimation: boolean;
|
|
25
|
-
}>;
|
|
22
|
+
export type AnimationsFeatureToggles = {};
|
|
26
23
|
export interface IInteractiveOptions {
|
|
27
24
|
parentElement: HTMLElement;
|
|
28
25
|
fullscreenTargetElement: HTMLElement;
|
|
@@ -48,7 +45,7 @@ export interface IInteractiveOptions {
|
|
|
48
45
|
* @deprecated
|
|
49
46
|
* */
|
|
50
47
|
disableControlsOnPause?: boolean;
|
|
51
|
-
|
|
48
|
+
animationFeatureToggles?: AnimationsFeatureToggles;
|
|
52
49
|
}
|
|
53
50
|
export type ChapterChangedData = {
|
|
54
51
|
chapter: Chapter;
|
|
@@ -3,7 +3,6 @@ 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';
|
|
7
6
|
import type { SelectBranchesType } from './SelectBranches';
|
|
8
7
|
import type { IgnoreExpectState } from '../../../modules/Interactives/types';
|
|
9
8
|
import type { ChoiceContainer } from '../../../modules/Interactives/containers';
|
|
@@ -22,7 +21,6 @@ type ConstructorArg = {
|
|
|
22
21
|
interactiveTimeOpenUri: boolean;
|
|
23
22
|
disabledControls$: IValueSubject<boolean>;
|
|
24
23
|
onRemove: () => void;
|
|
25
|
-
onError: (error: CustomError) => void;
|
|
26
24
|
};
|
|
27
25
|
export declare class GameController {
|
|
28
26
|
container: ChoiceContainer;
|
|
@@ -41,8 +39,7 @@ export declare class GameController {
|
|
|
41
39
|
isSelectedControlEvent: boolean;
|
|
42
40
|
isSelectedContainerEvent: boolean;
|
|
43
41
|
globalEvents: GlobalEvents;
|
|
44
|
-
|
|
45
|
-
constructor({ player, container, branches, selectBranches, interactiveEvents, globalEvents, globalEventEmitter, getContainerEventState, permanentTextControls, interactiveTimeOpenUri, disabledControls$, onRemove, onError, }: ConstructorArg);
|
|
42
|
+
constructor({ player, container, branches, selectBranches, interactiveEvents, globalEvents, globalEventEmitter, getContainerEventState, permanentTextControls, interactiveTimeOpenUri, disabledControls$, onRemove, }: ConstructorArg);
|
|
46
43
|
private emitContainerVisibilityEvent;
|
|
47
44
|
registerEvents(): void;
|
|
48
45
|
hide: () => void;
|
|
@@ -57,8 +54,6 @@ export declare class GameController {
|
|
|
57
54
|
reset(): void;
|
|
58
55
|
removeView(): void;
|
|
59
56
|
fakeRemoveView(remove?: boolean): void;
|
|
60
|
-
updateControlsShadowStyles(isDark?: boolean): void;
|
|
61
|
-
toggleBlinkAnimation(value: boolean): void;
|
|
62
57
|
destroy(): void;
|
|
63
58
|
}
|
|
64
59
|
export {};
|
|
@@ -23,18 +23,7 @@ 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
|
-
|
|
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;
|
|
26
|
+
export declare function partial<T extends unknown[], U extends unknown[], R>(fn: (...args: [...T, ...U]) => R, ...presetArgs: T): (...laterArgs: U) => R;
|
|
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>;
|
|
39
28
|
export declare const evaluateContainerEventStatus: (container: ChapterContainer, gameControllers: GameController[]) => IgnoreExpectState;
|
|
40
29
|
export {};
|
|
@@ -7,17 +7,12 @@ export declare const controlStylesFallbacks: {
|
|
|
7
7
|
textContent: string;
|
|
8
8
|
roundCorners: number;
|
|
9
9
|
borderWidth: number;
|
|
10
|
-
borderWidthRawValue: string;
|
|
11
|
-
roundCornersRawValue: string;
|
|
12
10
|
borderColor: string;
|
|
13
11
|
borderAlpha: number;
|
|
14
12
|
backgroundColor: string;
|
|
15
13
|
backgroundAlpha: number;
|
|
16
14
|
innerSizesDependOn: string;
|
|
17
15
|
angle: number;
|
|
18
|
-
shadowColorLight: string;
|
|
19
|
-
shadowColorDark: string;
|
|
20
|
-
shadowColorAlpha: number;
|
|
21
16
|
};
|
|
22
17
|
type ControlStylesFallbacks = typeof controlStylesFallbacks;
|
|
23
18
|
export declare enum ALIGN_ITEMS {
|
|
@@ -60,17 +55,8 @@ type SetBorderStylesProps = {
|
|
|
60
55
|
props: Control['props'];
|
|
61
56
|
fallback: ControlStylesFallbacks;
|
|
62
57
|
dependsOn: Dimensions;
|
|
63
|
-
useRawValues?: boolean;
|
|
64
58
|
};
|
|
65
|
-
export declare const setBorderStyles: ({ target, props, fallback, dependsOn
|
|
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;
|
|
59
|
+
export declare const setBorderStyles: ({ target, props, fallback, dependsOn }: SetBorderStylesProps) => void;
|
|
74
60
|
type SetAngleProps = {
|
|
75
61
|
target: HTMLElement;
|
|
76
62
|
fallback: ControlStylesFallbacks;
|
|
@@ -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 Object;
|
|
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 Function;
|
|
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;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './utils';
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
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 {};
|
|
File without changes
|