@vkontakte/videoplayer-interactive 1.0.32-beta.0 → 1.0.32-dev.e345d5be.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.
@@ -1,33 +1,24 @@
1
1
  import type { Control as TControl, ControlEvent, ControlLayoutParams } from '../../../manifest';
2
- import type { Control } from '../../../modules/Interactives/controls/Control';
3
- import { AnimationsFeatureToggles } from '../../../modules/Interactives/types';
2
+ import Control from '../../../modules/Interactives/controls/Control';
4
3
  export { TControl };
5
- export declare const CONTROLLER_PREFIX = "int";
6
4
  export declare enum CONTROLLER_IDS {
7
5
  AREA = "int_area",
8
6
  TEXT = "int_text",
9
7
  BUTTON = "int_bttn"
10
8
  }
11
- export type Dimensions<T = string> = {
12
- width: T;
13
- height: T;
9
+ export type Dimensions = {
10
+ width: string;
11
+ height: string;
14
12
  };
15
- export type Callbacks = {
16
- setControlLayout: (element: HTMLElement, controlLayoutParams: ControlLayoutParams) => void;
17
- };
18
- export type ControlCreateViewParams = {
13
+ export type LayoutCallback = (element: HTMLElement, controlLayoutParams: ControlLayoutParams) => void;
14
+ export type CreateViewParams = {
19
15
  parentElement: HTMLElement;
20
- callbacks: Callbacks;
21
- };
22
- export type Options = Record<string, unknown>;
23
- export type ControlOptions = {
24
- features: Pick<AnimationsFeatureToggles, never>;
16
+ layoutCallback: LayoutCallback;
25
17
  };
26
- export declare function isControlOptions(options: Options): options is ControlOptions;
27
18
  type ControlEventCallbackParams = {
28
19
  action: ControlEvent['action'];
29
20
  controlId: string;
30
21
  controlType: TControl['type'];
31
22
  };
32
23
  export type ControlEventCallback = (params: ControlEventCallbackParams) => void;
33
- export type ControlCreator<O extends Options = Options, C extends Control = Control> = (control: TControl, options?: O) => C | undefined;
24
+ export type ControlCreator = (control: TControl) => Control | undefined;
@@ -6,44 +6,9 @@ export { isLastChapter, hasEndTemplate, isOneTextCtrlContainer } from './utils/g
6
6
  export type { InteractiveRange } from './utils/getInteractiveRanges';
7
7
  export declare const utils: {
8
8
  Container: typeof Container;
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
- disable(): void;
13
- enable(): void;
14
- getElement(): Nullable<HTMLElement>;
15
- container: Nullable<{
16
- element: HTMLElement;
17
- dimensions: import("./controls").Dimensions;
18
- }>;
19
- controlElement: Nullable<HTMLElement>;
20
- clickListener: Nullable<(event: MouseEvent) => void>;
21
- control: import("@interactiveplatform/movika-manifest/dist/chapter-COPBtRYg").e;
22
- options?: import("./controls").Options;
23
- createContainerElement(callbacks: import("./controls").Callbacks): void;
24
- createClickListener(callback: AnyFn): (event: MouseEvent) => void;
25
- featureIsEnabled(name: keyof import("./controls").ControlOptions["features"]): false | undefined;
26
- setEvents(callback: import("./controls").ControlEventCallback): void;
27
- removeListeners(): void;
28
- }>;
29
- createButtonControl: import("./controls").ControlCreator<import("./controls").ControlOptions, {
30
- createView({ parentElement, callbacks }: import("./controls").ControlCreateViewParams): void;
31
- disable(): void;
32
- enable(): void;
33
- getElement(): Nullable<HTMLElement>;
34
- container: Nullable<{
35
- element: HTMLElement;
36
- dimensions: import("./controls").Dimensions;
37
- }>;
38
- controlElement: Nullable<HTMLElement>;
39
- clickListener: Nullable<(event: MouseEvent) => void>;
40
- control: import("@interactiveplatform/movika-manifest/dist/chapter-COPBtRYg").e;
41
- options?: import("./controls").Options;
42
- createContainerElement(callbacks: import("./controls").Callbacks): void;
43
- createClickListener(callback: AnyFn): (event: MouseEvent) => void;
44
- featureIsEnabled(name: keyof import("./controls").ControlOptions["features"]): false | undefined;
45
- setEvents(callback: import("./controls").ControlEventCallback): void;
46
- removeListeners(): void;
47
- }>;
9
+ createChoiceContainer: (container: import("@interactiveplatform/movika-manifest").ChapterContainer, rootElement: HTMLElement) => import("./containers/ChoiceContainer").ChoiceContainer | undefined;
10
+ createAreaControl: import("./controls").ControlCreator;
11
+ createButtonControl: import("./controls").ControlCreator;
12
+ getRootEl: () => Element | null;
48
13
  classnamesPrefix: string;
49
14
  };
@@ -19,7 +19,6 @@ 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
22
  export interface IInteractiveOptions {
24
23
  parentElement: HTMLElement;
25
24
  fullscreenTargetElement: HTMLElement;
@@ -42,10 +41,9 @@ export interface IInteractiveOptions {
42
41
  vkVideoLoader?: (owner_id: string, video_id: string) => unknown;
43
42
  createOneStat?: (video: any, configOverwrite?: any) => IOneStat | undefined;
44
43
  /**
45
- * @deprecated
46
- * */
44
+ * @deprecated
45
+ * */
47
46
  disableControlsOnPause?: boolean;
48
- animationFeatureToggles?: AnimationsFeatureToggles;
49
47
  }
50
48
  export type ChapterChangedData = {
51
49
  chapter: Chapter;
@@ -51,7 +51,7 @@ export declare class GameController {
51
51
  onEndOfVideo: () => void;
52
52
  whilePlaying: () => void;
53
53
  reset(): void;
54
- removeView(): void;
54
+ removeView(destroy?: boolean): void;
55
55
  fakeRemoveView(remove?: boolean): void;
56
56
  destroy(): void;
57
57
  }
@@ -1,6 +1,9 @@
1
1
  import { type Control } from '../../../manifest';
2
2
  import { type Dimensions } from '../../../modules/Interactives/controls';
3
3
  export declare const classnamesPrefix = "interactive";
4
+ export declare const rootElClassName = "interactive-controls-container";
5
+ export declare const getRootEl: () => Element | null;
6
+ export declare const DISABLE_OPACITY = 0.4;
4
7
  export declare const controlStylesFallbacks: {
5
8
  textColor: string;
6
9
  textSize: number;
@@ -1,9 +0,0 @@
1
- import { Options, ControlEventCallback } from '../controls';
2
- import { AnimationsFeatureToggles } from '../types';
3
- export type ChoiceContainerOptions = {
4
- features: Pick<AnimationsFeatureToggles, never>;
5
- };
6
- export declare function isChoiceContainerOptions(options: Options): options is ChoiceContainerOptions;
7
- export type ContainerCreateViewParams = {
8
- eventCallback: ControlEventCallback;
9
- };
@@ -1,6 +0,0 @@
1
- export declare const CONTAINERS_CLASSNAME_PREFIX = "interactive-container";
2
- export declare const containersClassNames: {
3
- common: string;
4
- hidden: string;
5
- disabled: string;
6
- };
@@ -1,9 +0,0 @@
1
- export declare const CONTROLS_CLASSNAME_PREFIX = "interactive-control";
2
- export declare const controlsClassNames: {
3
- common: string;
4
- wrapper: string;
5
- disabled: string;
6
- button: string;
7
- area: string;
8
- text: string;
9
- };
@@ -1 +0,0 @@
1
- export declare const applyStyles: (attachToElement: HTMLElement) => void;