@vkontakte/videoplayer-interactive 1.0.38-beta.2 → 1.0.39-dev.25a92534.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 +77 -7
- package/es2015.esm.js +77 -7
- package/es2018.cjs.js +77 -7
- package/es2018.esm.js +77 -7
- package/es2024.cjs.js +77 -7
- package/es2024.esm.js +77 -7
- package/esnext.cjs.js +77 -7
- package/esnext.esm.js +77 -7
- package/evergreen.esm.js +77 -7
- package/package.json +4 -4
- package/types/modules/Interactives/containers/ChoiceContainer.d.ts +2 -1
- package/types/modules/Interactives/containers/types.d.ts +2 -1
- package/types/modules/Interactives/controls/AreaControl.d.ts +2 -0
- package/types/modules/Interactives/controls/ButtonControl.d.ts +7 -1
- package/types/modules/Interactives/controls/Control.d.ts +2 -0
- package/types/modules/Interactives/controls/TextControl.d.ts +2 -0
- package/types/modules/Interactives/controls/types.d.ts +1 -1
- package/types/modules/Interactives/index.d.ts +8 -1
- package/types/modules/Interactives/types.d.ts +1 -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/angleUtils.d.ts +23 -0
|
@@ -23,7 +23,7 @@ export type ControlCreateViewParams = {
|
|
|
23
23
|
export type Options = Record<string, unknown>;
|
|
24
24
|
export type ControlOptions = {
|
|
25
25
|
isTouch: boolean;
|
|
26
|
-
features: Pick<AnimationsFeatureToggles, 'controlsExpectTimeBlinkAnimation' | 'controlsTapPlace'>;
|
|
26
|
+
features: Pick<AnimationsFeatureToggles, 'controlsExpectTimeBlinkAnimation' | 'controlsTapPlace' | 'controlsFillAnimation'>;
|
|
27
27
|
};
|
|
28
28
|
export declare function isControlOptions(options: Options): options is ControlOptions;
|
|
29
29
|
type ControlEventCallbackParams = {
|
|
@@ -17,6 +17,8 @@ export declare const utils: {
|
|
|
17
17
|
toggleBlinkAnimation(enable?: boolean): void;
|
|
18
18
|
syncBlinkAnimation(refAnim: HTMLElement): void;
|
|
19
19
|
onBlinkHovering(): void;
|
|
20
|
+
setShowTimeRange(): void;
|
|
21
|
+
updateFillAnimationDimensions(): void;
|
|
20
22
|
onProgress(): void;
|
|
21
23
|
onResize(): void;
|
|
22
24
|
container: import("@vkontakte/videoplayer-shared").Nullable<{
|
|
@@ -41,6 +43,9 @@ export declare const utils: {
|
|
|
41
43
|
removeListeners(): void;
|
|
42
44
|
}>;
|
|
43
45
|
createButtonControl: import("./controls").ControlCreator<import("./controls").ControlOptions, {
|
|
46
|
+
startTime?: number;
|
|
47
|
+
endTime?: number;
|
|
48
|
+
controlFillAnimation?: import("./utils/ControlFillAnimation").ControlFillAnimation;
|
|
44
49
|
createView({ parentElement, callbacks }: import("./controls").ControlCreateViewParams): void;
|
|
45
50
|
registerEvents(): void;
|
|
46
51
|
disable(): void;
|
|
@@ -49,7 +54,9 @@ export declare const utils: {
|
|
|
49
54
|
toggleBlinkAnimation(enable?: boolean): void;
|
|
50
55
|
syncBlinkAnimation(refAnim: HTMLElement): void;
|
|
51
56
|
onBlinkHovering(): void;
|
|
52
|
-
|
|
57
|
+
updateFillAnimationDimensions(): void;
|
|
58
|
+
setShowTimeRange(startTime: number, endTime: number): void;
|
|
59
|
+
onProgress(currentTime: number): void;
|
|
53
60
|
onResize(): void;
|
|
54
61
|
updateShadowStyles(): void;
|
|
55
62
|
container: import("@vkontakte/videoplayer-shared").Nullable<{
|
|
@@ -19,6 +19,7 @@ export type AnimationsFeatureToggles = Partial<{
|
|
|
19
19
|
areaControlShadow: boolean;
|
|
20
20
|
controlsExpectTimeBlinkAnimation: boolean;
|
|
21
21
|
controlsTapPlace: boolean;
|
|
22
|
+
controlsFillAnimation: boolean;
|
|
22
23
|
}>;
|
|
23
24
|
export interface IInteractiveOptions {
|
|
24
25
|
parentElement: HTMLElement;
|
|
@@ -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
|
+
};
|
|
@@ -1,2 +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
|
+
*/
|
|
1
20
|
export declare function normalizeRadians(rad: number): number;
|
|
21
|
+
/**
|
|
22
|
+
* use normalizeRadians before use
|
|
23
|
+
*/
|
|
24
|
+
export declare function getQuadrant(rad: number): number | null;
|
|
2
25
|
export declare function radiansToDegrees(rad: number): number;
|