@vkontakte/videoplayer-interactive 1.0.30-dev.f10d9ff4.0 → 1.0.30-dev.f55796c8.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.
Files changed (37) hide show
  1. package/es2015.cjs.js +5 -196
  2. package/es2015.esm.js +6 -197
  3. package/es2018.cjs.js +6 -197
  4. package/es2018.esm.js +5 -196
  5. package/esnext.cjs.js +6 -197
  6. package/esnext.esm.js +6 -197
  7. package/evergreen.esm.js +6 -197
  8. package/package.json +4 -4
  9. package/types/modules/Interactives/Interactives.d.ts +9 -19
  10. package/types/modules/Interactives/Layout.d.ts +0 -4
  11. package/types/modules/Interactives/containers/ChoiceContainer.d.ts +7 -16
  12. package/types/modules/Interactives/containers/Container.d.ts +6 -9
  13. package/types/modules/Interactives/controls/AreaControl.d.ts +2 -22
  14. package/types/modules/Interactives/controls/ButtonControl.d.ts +2 -27
  15. package/types/modules/Interactives/controls/Control.d.ts +9 -22
  16. package/types/modules/Interactives/controls/types.d.ts +7 -21
  17. package/types/modules/Interactives/index.d.ts +4 -69
  18. package/types/modules/Interactives/types.d.ts +12 -12
  19. package/types/modules/Interactives/utils/GameController.d.ts +12 -16
  20. package/types/modules/Interactives/utils/InteractiveEvents.d.ts +3 -3
  21. package/types/modules/Interactives/utils/SelectBranches.d.ts +1 -2
  22. package/types/modules/Interactives/utils/SelectBranches.types.d.ts +0 -1
  23. package/types/modules/Interactives/utils/events.d.ts +1 -0
  24. package/types/modules/Interactives/utils/events.types.d.ts +1 -3
  25. package/types/modules/Interactives/utils/gameUtils.d.ts +2 -1
  26. package/types/modules/Interactives/utils/getInteractiveRanges.d.ts +5 -1
  27. package/types/modules/Interactives/utils/renderingUtils.d.ts +3 -15
  28. package/types/utils/Binding.d.ts +34 -0
  29. package/types/utils/EventManager.d.ts +13 -0
  30. package/types/utils/getVideoContentSize.d.ts +1 -1
  31. package/types/modules/Interactives/styles.d.ts +0 -1
  32. package/types/modules/Interactives/utils/BlinkAnimationReference.d.ts +0 -2
  33. package/types/modules/Interactives/utils/FillAnimation.d.ts +0 -29
  34. package/types/modules/Interactives/utils/TapElement.d.ts +0 -10
  35. package/types/utils/AverageColor/FrameAverageColor.d.ts +0 -19
  36. package/types/utils/AverageColor/helpers.d.ts +0 -17
  37. package/types/utils/AverageColor/index.d.ts +0 -2
@@ -0,0 +1,34 @@
1
+ import type { Nullable } from '@vkontakte/videoplayer-shared';
2
+ import type { HtmlEventType } from '../types';
3
+ type OptionsType = undefined | boolean | AddEventListenerOptions;
4
+ export declare class Binding {
5
+ target: Nullable<Element>;
6
+ type: Nullable<HtmlEventType>;
7
+ listener: Nullable<EventListener>;
8
+ options: Nullable<OptionsType>;
9
+ /**
10
+ * passive = true -> function never call preventDefault()
11
+ */
12
+ constructor(target: Element, type: HtmlEventType, listener: EventListener, options: OptionsType);
13
+ /**
14
+ * Detaches the event listener from the event target. This does nothing if
15
+ * the event listener is already detached.
16
+ */
17
+ unlisten(): void;
18
+ /**
19
+ * Converts the provided options value into a value accepted by the browser.
20
+ * Some browsers (e.g. Tizen) don't support passing options as an
21
+ * object. So this detects this case and converts it.
22
+ */
23
+ private static _convertOptions;
24
+ /**
25
+ * Checks whether the browser supports passing objects as the third argument
26
+ * to addEventListener. This caches the result value in a static field to
27
+ * avoid a bunch of checks.
28
+ *
29
+ * See https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support
30
+ */
31
+ private static _supportsObject;
32
+ private static _doesSupportObject;
33
+ }
34
+ export {};
@@ -0,0 +1,13 @@
1
+ import { Binding } from './Binding';
2
+ import { MultiMap } from './MultiMap';
3
+ import type { HtmlEventType } from '../types';
4
+ type OptionsType = boolean | AddEventListenerOptions;
5
+ export declare class EventManager {
6
+ bindingMap: MultiMap<Binding> | null;
7
+ release(): void;
8
+ listen(target: Element, type: HtmlEventType, listener: EventListener, options?: OptionsType): void;
9
+ listenOnce(target: Element, type: HtmlEventType, listener: EventListener, options?: OptionsType): void;
10
+ unlisten(target: Element, type: HtmlEventType, listener: EventListener): void;
11
+ removeAll(): void;
12
+ }
13
+ export {};
@@ -1,5 +1,5 @@
1
1
  import type { IPlayer } from '@vkontakte/videoplayer-core';
2
- export declare const getVideoContentSize: (player: IPlayer) => {
2
+ export declare const getVideoContentSize: (containerEl: Element, player: IPlayer) => {
3
3
  videoContentHeight: number;
4
4
  videoContentWidth: number;
5
5
  };
@@ -1 +0,0 @@
1
- export declare const apply: (attachToElement: HTMLElement) => void;
@@ -1,2 +0,0 @@
1
- export declare const createBlinkAnimationRef: () => HTMLDivElement;
2
- export declare const restartBlinkAnimationRef: (blinkAnimationRefElement: HTMLElement) => void;
@@ -1,29 +0,0 @@
1
- export declare function normalizeRadians(rad: number): number;
2
- export declare function radiansToDegrees(rad: number): number;
3
- export type Options = {
4
- startTime: number;
5
- endTime: number;
6
- rotateAngle: number;
7
- borderRadius: string;
8
- debug?: boolean;
9
- };
10
- export declare class FillAnimation {
11
- fillAnimationElement: HTMLDivElement;
12
- private fillAnimationFillerElement;
13
- private startTime;
14
- private endTime;
15
- private shouldFillHeight;
16
- private widthExpansionCoef;
17
- private isDebug;
18
- private fromLeft;
19
- private useSkew;
20
- private rotateAngle;
21
- constructor(opts: Options);
22
- updateDimension(opts: {
23
- width: number;
24
- height: number;
25
- borderWidth: number;
26
- }): void;
27
- updateAnimation(currentTime: number): void;
28
- private calcWidthExpansionCoef;
29
- }
@@ -1,10 +0,0 @@
1
- export declare class TapElement {
2
- element: HTMLDivElement;
3
- controlRotateAngleRad: number;
4
- clickCancelCondition: () => boolean;
5
- constructor(controlRotateAngleRad: number, clickCancelCondition: () => boolean);
6
- onElementClick: (e: Event & {
7
- clientX: number;
8
- clientY: number;
9
- }) => void;
10
- }
@@ -1,19 +0,0 @@
1
- import { type Options } from './helpers';
2
- export declare class FrameAverageColor {
3
- canvas: HTMLCanvasElement | OffscreenCanvas | null;
4
- ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D | null;
5
- getColorAsync(resource: HTMLVideoElement, options: Options): Promise<{
6
- rgba: string;
7
- isDark: boolean;
8
- error: Error | undefined;
9
- }>;
10
- getColor(resource: HTMLVideoElement, options: Options): {
11
- rgba: string;
12
- isDark: boolean;
13
- error: Error | undefined;
14
- };
15
- private getColorFromArray;
16
- private sqrtAlgorithm;
17
- private prepareResult;
18
- destroy(): void;
19
- }
@@ -1,17 +0,0 @@
1
- export type Color = [number, number, number, number];
2
- export type Options = {
3
- width: number;
4
- height: number;
5
- step?: number;
6
- defaultColor?: Color;
7
- debug?: boolean;
8
- };
9
- export declare function makeCanvas(): OffscreenCanvas | HTMLCanvasElement | null;
10
- export declare function isDark(color: Color): boolean;
11
- export declare const DEFAULT_COLOR: Color;
12
- export declare const DEFAULT_STEP = 1;
13
- export declare function getError(message: string): Error;
14
- export declare function getVideoContentSize(element: HTMLElement): {
15
- width: number;
16
- height: number;
17
- };
@@ -1,2 +0,0 @@
1
- export { FrameAverageColor } from './FrameAverageColor';
2
- export { getVideoContentSize } from './helpers';