@vkontakte/videoplayer-interactive 1.0.31-dev.a65d13ac.0 → 1.0.31-dev.a8108f50.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,24 +1,33 @@
1
1
  import type { Control as TControl, ControlEvent, ControlLayoutParams } from '../../../manifest';
2
- import Control from '../../../modules/Interactives/controls/Control';
2
+ import type { Control } from '../../../modules/Interactives/controls/Control';
3
+ import { AnimationsFeatureToggles } from '../../../modules/Interactives/types';
3
4
  export { TControl };
5
+ export declare const CONTROLLER_PREFIX = "int";
4
6
  export declare enum CONTROLLER_IDS {
5
7
  AREA = "int_area",
6
8
  TEXT = "int_text",
7
9
  BUTTON = "int_bttn"
8
10
  }
9
- export type Dimensions = {
10
- width: string;
11
- height: string;
11
+ export type Dimensions<T = string> = {
12
+ width: T;
13
+ height: T;
12
14
  };
13
- export type LayoutCallback = (element: HTMLElement, controlLayoutParams: ControlLayoutParams) => void;
14
- export type CreateViewParams = {
15
+ export type Callbacks = {
16
+ setControlLayout: (element: HTMLElement, controlLayoutParams: ControlLayoutParams) => void;
17
+ };
18
+ export type ControlCreateViewParams = {
15
19
  parentElement: HTMLElement;
16
- layoutCallback: LayoutCallback;
20
+ callbacks: Callbacks;
21
+ };
22
+ export type Options = Record<string, unknown>;
23
+ export type ControlOptions = {
24
+ features: Pick<AnimationsFeatureToggles, never>;
17
25
  };
26
+ export declare function isControlOptions(options: Options): options is ControlOptions;
18
27
  type ControlEventCallbackParams = {
19
28
  action: ControlEvent['action'];
20
29
  controlId: string;
21
30
  controlType: TControl['type'];
22
31
  };
23
32
  export type ControlEventCallback = (params: ControlEventCallbackParams) => void;
24
- export type ControlCreator = (control: TControl) => Control | undefined;
33
+ export type ControlCreator<O extends Options = Options, C extends Control = Control> = (control: TControl, options?: O) => C | undefined;
@@ -0,0 +1,9 @@
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
+ };
@@ -6,9 +6,44 @@ 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) => import("./containers/ChoiceContainer").ChoiceContainer | undefined;
10
- createAreaControl: import("./controls").ControlCreator;
11
- createButtonControl: import("./controls").ControlCreator;
12
- getRootEl: () => Element | null;
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
+ }>;
13
48
  classnamesPrefix: string;
14
49
  };
@@ -0,0 +1 @@
1
+ export declare const applyStyles: (attachToElement: HTMLElement) => void;
@@ -19,6 +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 = {};
22
23
  export interface IInteractiveOptions {
23
24
  parentElement: HTMLElement;
24
25
  fullscreenTargetElement: HTMLElement;
@@ -40,9 +41,10 @@ export interface IInteractiveOptions {
40
41
  vkVideoLoader?: (owner_id: string, video_id: string) => unknown;
41
42
  createOneStat?: (video: any, configOverwrite?: any) => IOneStat | undefined;
42
43
  /**
43
- * @deprecated
44
- * */
44
+ * @deprecated
45
+ * */
45
46
  disableControlsOnPause?: boolean;
47
+ animationFeatureToggles?: AnimationsFeatureToggles;
46
48
  }
47
49
  export type ChapterChangedData = {
48
50
  chapter: Chapter;
@@ -1,9 +1,6 @@
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;
7
4
  export declare const controlStylesFallbacks: {
8
5
  textColor: string;
9
6
  textSize: number;