@vkontakte/videoplayer-interactive 1.0.37-dev.a47f72c3.0 → 1.0.37-dev.af36d24f.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 +111 -6
- package/es2015.esm.js +111 -6
- package/es2018.cjs.js +111 -6
- package/es2018.esm.js +111 -6
- package/es2024.cjs.js +111 -6
- package/es2024.esm.js +111 -6
- package/esnext.cjs.js +111 -6
- package/esnext.esm.js +111 -6
- package/evergreen.esm.js +111 -6
- package/package.json +4 -4
- package/types/modules/Interactives/Interactives.d.ts +0 -1
- package/types/modules/Interactives/Layout.d.ts +2 -4
- package/types/modules/Interactives/containers/ChoiceContainer.d.ts +4 -5
- package/types/modules/Interactives/containers/Container.d.ts +1 -3
- package/types/modules/Interactives/containers/types.d.ts +3 -1
- package/types/modules/Interactives/controls/AreaControl.d.ts +4 -2
- package/types/modules/Interactives/controls/ButtonControl.d.ts +9 -3
- package/types/modules/Interactives/controls/Control.d.ts +10 -5
- package/types/modules/Interactives/controls/TextControl.d.ts +2 -0
- package/types/modules/Interactives/controls/types.d.ts +4 -2
- package/types/modules/Interactives/controls/utils.d.ts +1 -0
- package/types/modules/Interactives/index.d.ts +75 -7
- package/types/modules/Interactives/types.d.ts +3 -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/ResizeManager.d.ts +0 -2
- package/types/modules/Interactives/utils/angleUtils.d.ts +25 -0
- package/types/utils/CssVarsManager.d.ts +0 -23
|
@@ -4,8 +4,7 @@ import { ChapterContainer } from '../../../manifest';
|
|
|
4
4
|
import type { ChoiceContainerOptions, ContainerCreateViewParams } from './types';
|
|
5
5
|
import { CustomError } from '../../../utils/Error';
|
|
6
6
|
import { Nullable } from '@vkontakte/videoplayer-shared';
|
|
7
|
-
|
|
8
|
-
export declare const createChoiceContainer: (container: ChapterContainer, rootElement: HTMLElement, cssVarsManager: CssVarsManager, options?: ChoiceContainerOptions) => ChoiceContainer | undefined;
|
|
7
|
+
export declare const createChoiceContainer: (container: ChapterContainer, rootElement: HTMLElement, options?: ChoiceContainerOptions) => ChoiceContainer | undefined;
|
|
9
8
|
export declare class ChoiceContainer extends Container {
|
|
10
9
|
private rootElement;
|
|
11
10
|
private containerElement;
|
|
@@ -14,9 +13,9 @@ export declare class ChoiceContainer extends Container {
|
|
|
14
13
|
isRemoved: boolean;
|
|
15
14
|
isDisabled: boolean;
|
|
16
15
|
error$: Subject<CustomError>;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
constructor(container: ChapterContainer, rootElement: HTMLElement, options?: ChoiceContainerOptions);
|
|
17
|
+
createView({ eventCallback, videoDurationMs }: ContainerCreateViewParams): HTMLElement;
|
|
18
|
+
updateControlsFillAnimationDimensions(): void;
|
|
20
19
|
hide(): void;
|
|
21
20
|
show(): void;
|
|
22
21
|
enable(): void;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import type { ChapterContainer } from '../../../manifest';
|
|
2
2
|
import { type Control, type ControlCreator, type Options } from '../../../modules/Interactives/controls';
|
|
3
3
|
import { type ChoiceContainerOptions } from './types';
|
|
4
|
-
import { CssVarsManager } from '../../../utils/CssVarsManager';
|
|
5
4
|
export declare class Container {
|
|
6
5
|
container: ChapterContainer;
|
|
7
6
|
options?: Options;
|
|
8
7
|
private factories;
|
|
9
8
|
controls: Control[];
|
|
10
|
-
|
|
11
|
-
constructor(container: ChapterContainer, cssVarsManager: CssVarsManager, options?: Options);
|
|
9
|
+
constructor(container: ChapterContainer, options?: Options);
|
|
12
10
|
featureIsEnabled(name: keyof ChoiceContainerOptions['features']): boolean | undefined;
|
|
13
11
|
addControlFactory(type: string, factory: ControlCreator<any>): void;
|
|
14
12
|
removeControlFactory(type: string): void;
|
|
@@ -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
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Control } from './Control';
|
|
2
2
|
import { type ControlCreator, type ControlCreateViewParams, type TControl, type ControlOptions } from './types';
|
|
3
3
|
export declare const createAreaControl: ControlCreator<ControlOptions, AreaControl>;
|
|
4
|
-
|
|
4
|
+
declare class AreaControl extends Control {
|
|
5
5
|
constructor(control: TControl, options?: ControlOptions);
|
|
6
6
|
createView({ parentElement, callbacks }: ControlCreateViewParams): void;
|
|
7
7
|
registerEvents(): void;
|
|
@@ -12,7 +12,9 @@ export 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
|
}
|
|
20
|
+
export {};
|
|
@@ -1,7 +1,11 @@
|
|
|
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
|
registerEvents(): void;
|
|
@@ -11,8 +15,10 @@ export declare class ButtonControl extends Control {
|
|
|
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
|
}
|
|
24
|
+
export {};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { Subject, Subscription } from '@vkontakte/videoplayer-shared';
|
|
1
|
+
import { Subject, Subscription, ValueSubject } from '@vkontakte/videoplayer-shared';
|
|
2
|
+
import { ControlTap } from '../utils/ControlTap';
|
|
2
3
|
import type { ControlEventCallback, ControlCreateViewParams, Dimensions, Callbacks, Options, TControl, ControlOptions } from './types';
|
|
3
4
|
import { CustomError } from '../../../utils/Error';
|
|
4
5
|
import { Nullable } from '@vkontakte/videoplayer-shared';
|
|
5
|
-
import { CssVarsManager } from '../../../utils/CssVarsManager';
|
|
6
6
|
type ControlContainer = {
|
|
7
7
|
element: HTMLElement;
|
|
8
8
|
dimensions: Dimensions;
|
|
9
|
+
isManifestContainerDisabled: () => boolean;
|
|
9
10
|
};
|
|
10
11
|
type ClickListener = (event: MouseEvent) => void;
|
|
11
12
|
export declare abstract class Control {
|
|
@@ -15,21 +16,25 @@ export declare abstract class Control {
|
|
|
15
16
|
controlElement: Nullable<HTMLElement>;
|
|
16
17
|
subscriptions: Subscription;
|
|
17
18
|
error$: Subject<CustomError>;
|
|
18
|
-
|
|
19
|
+
isInteracted$: ValueSubject<boolean>;
|
|
20
|
+
controlTap?: ControlTap;
|
|
19
21
|
constructor(control: TControl, options?: Options | undefined);
|
|
20
|
-
setCssVarsManager(cssVarsManager: CssVarsManager): void;
|
|
21
22
|
abstract createView(params: ControlCreateViewParams): void;
|
|
22
23
|
abstract getElement(): Nullable<HTMLElement>;
|
|
23
24
|
abstract disable(): void;
|
|
24
25
|
abstract enable(): void;
|
|
25
26
|
abstract onProgress(currentTimeMs: number): void;
|
|
26
27
|
abstract onResize(): void;
|
|
27
|
-
abstract
|
|
28
|
+
abstract setShowTimeRange(startTime: number, endTime: number): void;
|
|
29
|
+
abstract updateFillAnimationDimensions(): void;
|
|
28
30
|
abstract updateShadowStyles(isDark?: boolean): void;
|
|
29
31
|
abstract toggleBlinkAnimation(enable?: boolean): void;
|
|
32
|
+
onError(message: string | undefined, error: unknown): void;
|
|
33
|
+
addControlTap(controlElement: HTMLElement): void;
|
|
30
34
|
createContainerElement(callbacks: Callbacks): void;
|
|
31
35
|
createClickListener(callback: AnyFn): ClickListener;
|
|
32
36
|
featureIsEnabled(name: keyof ControlOptions['features']): boolean | undefined;
|
|
37
|
+
isTouch(): boolean | undefined;
|
|
33
38
|
setEvents(callback: ControlEventCallback): void;
|
|
34
39
|
removeListeners(): void;
|
|
35
40
|
}
|
|
@@ -8,12 +8,13 @@ export declare enum CONTROLLER_IDS {
|
|
|
8
8
|
TEXT = "int_text",
|
|
9
9
|
BUTTON = "int_bttn"
|
|
10
10
|
}
|
|
11
|
-
export type Dimensions<T = string
|
|
11
|
+
export type Dimensions<T = string> = {
|
|
12
12
|
width: T;
|
|
13
13
|
height: T;
|
|
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 = {
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { Container
|
|
2
|
-
import { CssVarsManager } from '../../utils/CssVarsManager';
|
|
3
|
-
import { ChapterContainer } from '../../manifest';
|
|
4
|
-
import type { ControlCreator, ButtonControl, ControlOptions, AreaControl } from '../../modules/Interactives/controls';
|
|
1
|
+
import { Container } from './containers/index';
|
|
5
2
|
export { Interactives } from './Interactives';
|
|
6
3
|
export { EVENT_NAMES, graphEventTypes, interactivesEventTypes } from './utils/events';
|
|
7
4
|
export type { InteractiveProjectInfo, PlayerChangedData, VideoInfo, IInteractiveOptions } from './types';
|
|
@@ -9,8 +6,79 @@ export { isLastChapter, hasEndTemplate, isOneTextCtrlContainer } from './utils/g
|
|
|
9
6
|
export type { InteractiveRange } from './utils/getInteractiveRanges';
|
|
10
7
|
export declare const utils: {
|
|
11
8
|
Container: typeof Container;
|
|
12
|
-
createChoiceContainer: (container: ChapterContainer, rootElement: HTMLElement,
|
|
13
|
-
createAreaControl: ControlCreator<ControlOptions,
|
|
14
|
-
|
|
9
|
+
createChoiceContainer: (container: import("@interactiveplatform/movika-manifest").ChapterContainer, rootElement: HTMLElement, options?: import("./containers/types").ChoiceContainerOptions) => import("./containers/ChoiceContainer").ChoiceContainer | undefined;
|
|
10
|
+
createAreaControl: import("./controls").ControlCreator<import("./controls").ControlOptions, {
|
|
11
|
+
createView({ parentElement, callbacks }: import("./controls").ControlCreateViewParams): void;
|
|
12
|
+
registerEvents(): void;
|
|
13
|
+
disable(): void;
|
|
14
|
+
enable(): void;
|
|
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
|
+
setShowTimeRange(): void;
|
|
21
|
+
updateFillAnimationDimensions(): void;
|
|
22
|
+
onProgress(): void;
|
|
23
|
+
onResize(): void;
|
|
24
|
+
container: import("@vkontakte/videoplayer-shared").Nullable<{
|
|
25
|
+
element: HTMLElement;
|
|
26
|
+
dimensions: import("./controls").Dimensions;
|
|
27
|
+
isManifestContainerDisabled: () => boolean;
|
|
28
|
+
}>;
|
|
29
|
+
controlElement: import("@vkontakte/videoplayer-shared").Nullable<HTMLElement>;
|
|
30
|
+
subscriptions: import("@vkontakte/videoplayer-shared").Subscription;
|
|
31
|
+
error$: import("@vkontakte/videoplayer-shared").Subject<import("../..").CustomError>;
|
|
32
|
+
isInteracted$: import("@vkontakte/videoplayer-shared").ValueSubject<boolean>;
|
|
33
|
+
controlTap?: import("./utils/ControlTap").ControlTap;
|
|
34
|
+
control: import("@interactiveplatform/movika-manifest/dist/chapter-DI_7rDZW").e;
|
|
35
|
+
options?: import("./controls").Options | undefined;
|
|
36
|
+
onError(message: string | undefined, error: unknown): void;
|
|
37
|
+
addControlTap(controlElement: HTMLElement): void;
|
|
38
|
+
createContainerElement(callbacks: import("./controls").Callbacks): void;
|
|
39
|
+
createClickListener(callback: AnyFn): (event: MouseEvent) => void;
|
|
40
|
+
featureIsEnabled(name: keyof import("./controls").ControlOptions["features"]): boolean | undefined;
|
|
41
|
+
isTouch(): boolean | undefined;
|
|
42
|
+
setEvents(callback: import("./controls").ControlEventCallback): void;
|
|
43
|
+
removeListeners(): void;
|
|
44
|
+
}>;
|
|
45
|
+
createButtonControl: import("./controls").ControlCreator<import("./controls").ControlOptions, {
|
|
46
|
+
startTime?: number;
|
|
47
|
+
endTime?: number;
|
|
48
|
+
controlFillAnimation?: import("./utils/ControlFillAnimation").ControlFillAnimation;
|
|
49
|
+
createView({ parentElement, callbacks }: import("./controls").ControlCreateViewParams): void;
|
|
50
|
+
registerEvents(): void;
|
|
51
|
+
disable(): void;
|
|
52
|
+
enable(): void;
|
|
53
|
+
getElement(): import("@vkontakte/videoplayer-shared").Nullable<HTMLElement>;
|
|
54
|
+
toggleBlinkAnimation(enable?: boolean): void;
|
|
55
|
+
syncBlinkAnimation(refAnim: HTMLElement): void;
|
|
56
|
+
onBlinkHovering(): void;
|
|
57
|
+
updateFillAnimationDimensions(): void;
|
|
58
|
+
setShowTimeRange(startTime: number, endTime: number): void;
|
|
59
|
+
onProgress(currentTime: number): void;
|
|
60
|
+
onResize(): void;
|
|
61
|
+
updateShadowStyles(): void;
|
|
62
|
+
container: import("@vkontakte/videoplayer-shared").Nullable<{
|
|
63
|
+
element: HTMLElement;
|
|
64
|
+
dimensions: import("./controls").Dimensions;
|
|
65
|
+
isManifestContainerDisabled: () => boolean;
|
|
66
|
+
}>;
|
|
67
|
+
controlElement: import("@vkontakte/videoplayer-shared").Nullable<HTMLElement>;
|
|
68
|
+
subscriptions: import("@vkontakte/videoplayer-shared").Subscription;
|
|
69
|
+
error$: import("@vkontakte/videoplayer-shared").Subject<import("../..").CustomError>;
|
|
70
|
+
isInteracted$: import("@vkontakte/videoplayer-shared").ValueSubject<boolean>;
|
|
71
|
+
controlTap?: import("./utils/ControlTap").ControlTap;
|
|
72
|
+
control: import("@interactiveplatform/movika-manifest/dist/chapter-DI_7rDZW").e;
|
|
73
|
+
options?: import("./controls").Options | undefined;
|
|
74
|
+
onError(message: string | undefined, error: unknown): void;
|
|
75
|
+
addControlTap(controlElement: HTMLElement): void;
|
|
76
|
+
createContainerElement(callbacks: import("./controls").Callbacks): void;
|
|
77
|
+
createClickListener(callback: AnyFn): (event: MouseEvent) => void;
|
|
78
|
+
featureIsEnabled(name: keyof import("./controls").ControlOptions["features"]): boolean | undefined;
|
|
79
|
+
isTouch(): boolean | undefined;
|
|
80
|
+
setEvents(callback: import("./controls").ControlEventCallback): void;
|
|
81
|
+
removeListeners(): void;
|
|
82
|
+
}>;
|
|
15
83
|
classnamesPrefix: string;
|
|
16
84
|
};
|
|
@@ -18,6 +18,8 @@ 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;
|
|
21
23
|
}>;
|
|
22
24
|
export interface IInteractiveOptions {
|
|
23
25
|
parentElement: HTMLElement;
|
|
@@ -44,6 +46,7 @@ export interface IInteractiveOptions {
|
|
|
44
46
|
* @deprecated
|
|
45
47
|
* */
|
|
46
48
|
disableControlsOnPause?: boolean;
|
|
49
|
+
isTouch?: boolean;
|
|
47
50
|
animationsFeatureToggles?: AnimationsFeatureToggles;
|
|
48
51
|
}
|
|
49
52
|
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';
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { IPlayer } from '@vkontakte/videoplayer-core';
|
|
2
2
|
import { Nullable } from '@vkontakte/videoplayer-shared';
|
|
3
|
-
import { CssVarsManager } from '../../../utils/CssVarsManager';
|
|
4
3
|
type ResizeManagerArg = () => {
|
|
5
4
|
parentElement: HTMLElement;
|
|
6
|
-
cssVarsManager: CssVarsManager;
|
|
7
5
|
player?: Nullable<IPlayer>;
|
|
8
6
|
fns?: AnyFn[];
|
|
9
7
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* use normalizeRadians before use
|
|
3
|
+
*/
|
|
4
|
+
export declare function isPositiveXAxis(angle: number): angle is 0;
|
|
5
|
+
/**
|
|
6
|
+
* use normalizeRadians before use
|
|
7
|
+
*/
|
|
8
|
+
export declare function isPositiveYAxis(angle: number): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* use normalizeRadians before use
|
|
11
|
+
*/
|
|
12
|
+
export declare function isNegativeXAxis(angle: number): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* use normalizeRadians before use
|
|
15
|
+
*/
|
|
16
|
+
export declare function isNegativeYAxis(angle: number): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* normalizes to [0, 2π)
|
|
19
|
+
*/
|
|
20
|
+
export declare function normalizeRadians(rad: number): number;
|
|
21
|
+
/**
|
|
22
|
+
* use normalizeRadians before use
|
|
23
|
+
*/
|
|
24
|
+
export declare function getQuadrant(rad: number): number | null;
|
|
25
|
+
export declare function radiansToDegrees(rad: number): number;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export declare class CssVarsManager {
|
|
2
|
-
rootElement: HTMLElement;
|
|
3
|
-
private readonly isCssVarsSupported;
|
|
4
|
-
private rootElementProps;
|
|
5
|
-
constructor(rootElement: HTMLElement);
|
|
6
|
-
private static checkCssVarsSupport;
|
|
7
|
-
/**
|
|
8
|
-
* Возвращает значение CSS-переменной или фолбэк из JS.
|
|
9
|
-
*/
|
|
10
|
-
getPropValue(propKey: string): string | undefined;
|
|
11
|
-
/**
|
|
12
|
-
* Применяет несколько свойств
|
|
13
|
-
*/
|
|
14
|
-
setup(props: Record<string, string>): void;
|
|
15
|
-
/**
|
|
16
|
-
* Удаляет все сохранённые переменные со стилевого элемента
|
|
17
|
-
*/
|
|
18
|
-
cleanup(): void;
|
|
19
|
-
/**
|
|
20
|
-
* Применяет одну переменную
|
|
21
|
-
*/
|
|
22
|
-
setProp(key: string, value: string): void;
|
|
23
|
-
}
|