@vkontakte/videoplayer-interactive 1.0.28 → 1.0.29-dev.0e646848.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 (57) hide show
  1. package/es2015.cjs.js +7 -7
  2. package/es2015.esm.js +6 -6
  3. package/es2018.cjs.js +7 -7
  4. package/es2018.esm.js +7 -7
  5. package/esnext.cjs.js +6 -6
  6. package/esnext.esm.js +6 -6
  7. package/evergreen.esm.js +7 -7
  8. package/package.json +6 -6
  9. package/types/index.d.ts +2 -3
  10. package/types/manifest/index.d.ts +3 -0
  11. package/types/{movika.core/manifest/types.d.ts → manifest/utils.d.ts} +23 -6
  12. package/types/modules/Graph/Graph.d.ts +3 -2
  13. package/types/modules/Interactives/Interactives.d.ts +13 -13
  14. package/types/modules/Interactives/Layout.d.ts +7 -7
  15. package/types/modules/Interactives/containers/ChoiceContainer.d.ts +3 -3
  16. package/types/modules/Interactives/containers/Container.d.ts +4 -4
  17. package/types/modules/Interactives/controls/Control.d.ts +3 -4
  18. package/types/modules/Interactives/controls/types.d.ts +4 -5
  19. package/types/modules/Interactives/index.d.ts +2 -2
  20. package/types/modules/Interactives/types.d.ts +3 -3
  21. package/types/modules/Interactives/utils/GameController.d.ts +2 -2
  22. package/types/modules/Interactives/utils/GroupsStack.d.ts +5 -5
  23. package/types/modules/Interactives/utils/HistoryController.d.ts +3 -2
  24. package/types/modules/Interactives/utils/InteractiveEvents.d.ts +2 -2
  25. package/types/modules/Interactives/utils/SelectBranches.d.ts +2 -2
  26. package/types/modules/Interactives/utils/SelectBranches.types.d.ts +12 -12
  27. package/types/modules/Interactives/utils/events.d.ts +2 -2
  28. package/types/modules/Interactives/utils/fallbackStrategies.d.ts +6 -6
  29. package/types/modules/Interactives/utils/gameUtils.d.ts +14 -14
  30. package/types/modules/Interactives/utils/getInteractiveRanges.d.ts +1 -1
  31. package/types/modules/Interactives/utils/renderingUtils.d.ts +9 -7
  32. package/types/modules/Loaders/vkVideoLoader/types.d.ts +2 -2
  33. package/types/modules/Loaders/vkVideoLoader/utils.d.ts +0 -2
  34. package/types/modules/ManifestController/ManifestController.d.ts +11 -12
  35. package/types/modules/ManifestController/utils.d.ts +6 -6
  36. package/types/modules/SeamlessController/SeamlessController.d.ts +2 -2
  37. package/types/modules/SeamlessController/utils.d.ts +2 -2
  38. package/types/modules/SeekToInteractiveController/SeekToInteractiveController.d.ts +2 -2
  39. package/types/utils/LastFrame.d.ts +1 -1
  40. package/types/utils/chapterHelpers.d.ts +1 -1
  41. package/types/utils/extractVkMovieId.d.ts +1 -1
  42. package/types/movika.core/manifest/index.d.ts +0 -28
  43. package/types/movika.core/manifest/manifest_3_2/chapter.d.ts +0 -63
  44. package/types/movika.core/manifest/manifest_3_2/control.d.ts +0 -67
  45. package/types/movika.core/manifest/manifest_3_2/manifest.d.ts +0 -50
  46. package/types/movika.core/manifest/manifest_3_2/template.d.ts +0 -34
  47. package/types/movika.core/manifest/manifest_3_3/chapter.d.ts +0 -72
  48. package/types/movika.core/manifest/manifest_3_3/control.d.ts +0 -66
  49. package/types/movika.core/manifest/manifest_3_3/graph.d.ts +0 -73
  50. package/types/movika.core/manifest/manifest_3_3/manifest.d.ts +0 -52
  51. package/types/movika.core/manifest/manifest_3_3/template.d.ts +0 -34
  52. package/types/movika.core/manifest/migrations/index.d.ts +0 -1
  53. package/types/movika.core/manifest/migrations/migrateManifestToLatestVersion.d.ts +0 -1
  54. package/types/movika.core/manifest/migrations/migrate_from_3_0_to_3_1.d.ts +0 -21
  55. package/types/movika.core/manifest/migrations/migrate_from_3_1_to_3_2.d.ts +0 -2
  56. package/types/movika.core/manifest/migrations/migrate_from_3_2_to_3_3.d.ts +0 -8
  57. package/types/movika.core/manifest/utils.d.ts +0 -5
@@ -1,15 +1,14 @@
1
- import { LatestControl } from '../../../movika.core/manifest';
2
- import { ControlEventCallback, CreateViewParams, Dimensions, LayoutCallback } from './types';
1
+ import type { ControlEventCallback, CreateViewParams, Dimensions, LayoutCallback, TControl } from './types';
3
2
  type ControlContainer = {
4
3
  element: HTMLElement;
5
4
  dimensions: Dimensions;
6
5
  };
7
6
  export default abstract class Control {
8
- control: LatestControl;
7
+ control: TControl;
9
8
  protected container: Nullable<ControlContainer>;
10
9
  protected controlElement: Nullable<HTMLElement>;
11
10
  private clickListener;
12
- protected constructor(control: LatestControl);
11
+ protected constructor(control: TControl);
13
12
  abstract createView(params: CreateViewParams): void;
14
13
  abstract getElement(): Nullable<HTMLElement>;
15
14
  abstract disable(): void;
@@ -1,6 +1,6 @@
1
- import { ControlEvent, ControlLayoutParams } from '../../../movika.core/manifest/manifest_3_3/control';
2
- import { LatestControl } from '../../../movika.core/manifest';
1
+ import type { Control as TControl, ControlEvent, ControlLayoutParams } from '../../../manifest';
3
2
  import Control from '../../../modules/Interactives/controls/Control';
3
+ export { TControl };
4
4
  export declare enum CONTROLLER_IDS {
5
5
  AREA = "int_area",
6
6
  TEXT = "int_text",
@@ -18,8 +18,7 @@ export type CreateViewParams = {
18
18
  type ControlEventCallbackParams = {
19
19
  action: ControlEvent['action'];
20
20
  controlId: string;
21
- controlType: LatestControl['type'];
21
+ controlType: TControl['type'];
22
22
  };
23
23
  export type ControlEventCallback = (params: ControlEventCallbackParams) => void;
24
- export type ControlCreator = (control: LatestControl) => Control | undefined;
25
- export {};
24
+ export type ControlCreator = (control: TControl) => Control | undefined;
@@ -1,12 +1,12 @@
1
1
  import { Container } from './containers/index';
2
2
  export { Interactives } from './Interactives';
3
3
  export { EVENT_NAMES, graphEventTypes, interactivesEventTypes } from './utils/events';
4
- export type { VideoInfo, InteractiveProjectInfo, PlayerChangedData } from './types';
4
+ export type { InteractiveProjectInfo, PlayerChangedData, VideoInfo } from './types';
5
5
  export { isLastChapter, hasEndTemplate, isOneTextCtrlContainer } from './utils/gameUtils';
6
6
  export type { InteractiveRange } from './utils/getInteractiveRanges';
7
7
  export declare const utils: {
8
8
  Container: typeof Container;
9
- createChoiceContainer: (container: import("../../movika.core/manifest").LatestContainer, rootElement: HTMLElement) => import("./containers/ChoiceContainer").ChoiceContainer | undefined;
9
+ createChoiceContainer: (container: import("@interactiveplatform/movika-manifest").ChapterContainer, rootElement: HTMLElement) => import("./containers/ChoiceContainer").ChoiceContainer | undefined;
10
10
  createAreaControl: import("./controls").ControlCreator;
11
11
  createButtonControl: import("./controls").ControlCreator;
12
12
  getRootEl: () => Element | null;
@@ -3,7 +3,7 @@ import type { IOptionalTuningConfig, IPlayer } from '@vkontakte/videoplayer-core
3
3
  import type { IOneStat } from '@vkontakte/videoplayer-statistics';
4
4
  import type { Loaders } from '../../modules/ManifestController/Loadable';
5
5
  import type { HistoryApi, HistorySettings } from '../../modules/Interactives/utils/HistoryController';
6
- import type { LatestChapter, LatestManifestVideo } from '../../movika.core/manifest';
6
+ import type { Chapter, ManifestVideo } from '../../manifest';
7
7
  export type VideoInfo = {
8
8
  id: string;
9
9
  cover: string;
@@ -45,8 +45,8 @@ export interface IInteractiveOptions {
45
45
  disableControlsOnPause?: boolean;
46
46
  }
47
47
  export type ChapterChangedData = {
48
- chapter: LatestChapter;
49
- manifestVideo: LatestManifestVideo;
48
+ chapter: Chapter;
49
+ manifestVideo: ManifestVideo;
50
50
  };
51
51
  export type PlayerChangedData<T = any> = {
52
52
  player: IPlayer;
@@ -1,7 +1,7 @@
1
1
  import { type ISubscription, type IValueSubject } from '@vkontakte/videoplayer-shared';
2
2
  import { type IPlayer } from '@vkontakte/videoplayer-core';
3
3
  import type { InteractiveEventsType } from './InteractiveEvents';
4
- import type { LatestChapterBranch } from '../../../movika.core/manifest';
4
+ import type { ChapterBranch } from '../../../manifest';
5
5
  import type { EventEmitter } from '../../../utils/EventEmitter';
6
6
  import type { ChoiceContainer } from "../../../modules/Interactives/containers";
7
7
  import { SelectBranches } from './SelectBranches';
@@ -9,7 +9,7 @@ import { type GlobalEvents } from './events';
9
9
  import { GameStates } from './gameUtils';
10
10
  export declare class GameController {
11
11
  container: ChoiceContainer;
12
- branches: LatestChapterBranch[];
12
+ branches: ChapterBranch[];
13
13
  selectBranches: ReturnType<typeof SelectBranches>;
14
14
  subscription: ISubscription;
15
15
  player: IPlayer;
@@ -1,7 +1,7 @@
1
- import { type EventActionTypes } from '../../../movika.core/manifest';
1
+ import type { EventActionKeys } from '../../../manifest';
2
2
  export type TPriority = 'chapter' | 'container' | 'control';
3
3
  export type TPayload = {
4
- actionType: EventActionTypes;
4
+ actionType: EventActionKeys;
5
5
  action: AnyFn;
6
6
  };
7
7
  export type TMapInitiator = {
@@ -13,17 +13,17 @@ type TMapPriority = {
13
13
  type TMap = {
14
14
  [timestamp: number]: TMapPriority;
15
15
  };
16
- export type TMapMapFlattened = {
16
+ export type TMapFlattened = {
17
17
  timestamp: number;
18
18
  priority: TPriority;
19
19
  initiator: string;
20
20
  } & TPayload;
21
- type GetAndRemoveArgType = Partial<Omit<TMapMapFlattened, keyof TPayload>> & Pick<TMapMapFlattened, 'timestamp'>;
21
+ type GetAndRemoveArgType = Partial<Omit<TMapFlattened, keyof TPayload>> & Pick<TMapFlattened, 'timestamp'>;
22
22
  export type TGroupsStack = ReturnType<typeof GroupsStack>;
23
23
  export declare function GroupsStack(): {
24
24
  map: TMap;
25
25
  remove: ({ timestamp, priority, initiator }: GetAndRemoveArgType) => boolean;
26
- add: ({ timestamp, priority, initiator, ...rest }: TMapMapFlattened) => void;
26
+ add: ({ timestamp, priority, initiator, ...rest }: TMapFlattened) => void;
27
27
  removeAll: () => void;
28
28
  get: ({ timestamp, priority, initiator }: GetAndRemoveArgType) => TMapInitiator | TPayload[] | TMapPriority | null;
29
29
  getLte: (timestamp: number) => TMap;
@@ -1,8 +1,9 @@
1
1
  import { Nullable, Subject } from '@vkontakte/videoplayer-shared';
2
2
  import type { IValueSubject } from '@vkontakte/videoplayer-shared';
3
3
  import { EventEmitter } from '../../../utils/EventEmitter';
4
- import type { VideoId } from '../../../movika.core/manifest';
5
- import type { Interactives, VideoInfo } from '../../../modules/Interactives';
4
+ import type { VideoId } from '../../../manifest';
5
+ import type { VideoInfo } from "../../../modules/Interactives";
6
+ import type { Interactives } from '../../../modules/Interactives';
6
7
  import { CustomError } from '../../../utils/Error';
7
8
  export interface HistoryApi {
8
9
  get: (rawId: string) => Promise<number[]>;
@@ -1,4 +1,4 @@
1
- import { type LatestContainer } from '../../../movika.core/manifest';
1
+ import { type Container } from '../../../manifest';
2
2
  import { type TPayload, type TGroupsStack } from './GroupsStack';
3
3
  import type { IPlayer } from '@vkontakte/videoplayer-core';
4
4
  export type InteractiveEventsType = ReturnType<typeof InteractiveEvents>;
@@ -21,7 +21,7 @@ export declare function InteractiveEvents(player: IPlayer): {
21
21
  timestamp: any;
22
22
  id: any;
23
23
  }) => void;
24
- setData: (containers?: LatestContainer[]) => void;
24
+ setData: (containers?: Container[]) => void;
25
25
  resetCalled: (timestamp: number) => void;
26
26
  isReady: (timestamp: number) => boolean;
27
27
  release: () => void;
@@ -1,4 +1,4 @@
1
- import type { LatestChapter } from '../../../movika.core/manifest';
1
+ import type { Chapter } from '../../../manifest';
2
2
  import type { SelectBranchesArg, OnControlEventArg, ContinuePlaybackArg, ExpectEventHandlerArg, OnChapterEventArg, OnContainerEventArg, OnExpectEventArg, SetManifestContainerEventsArg, ActionMap, AnyAction } from './SelectBranches.types';
3
3
  export declare const defaultArgs: {
4
4
  readonly shouldOpenNow: true;
@@ -11,7 +11,7 @@ export declare const SelectBranches: ({ globalEventEmitter, player, interactiveE
11
11
  onChapterEvent: ({ chapterId, action, branches }: OnChapterEventArg) => (() => ContinuePlaybackArg<"chapter">) | undefined;
12
12
  onExpectEvent: <T extends keyof ActionMap>({ subjectId, subjectName }: OnExpectEventArg<T>) => void;
13
13
  expectEventHandler: <T extends keyof ActionMap>({ subjectId, subjectName }: ExpectEventHandlerArg<T>) => void;
14
- setManifestChapterEvents: (chapter: LatestChapter) => void;
14
+ setManifestChapterEvents: (chapter: Chapter) => void;
15
15
  setManifestContainerEvents: ({ container, branches, isEOV }: SetManifestContainerEventsArg) => void;
16
16
  stopExpect: () => void;
17
17
  state: {
@@ -1,4 +1,4 @@
1
- import type { LatestContainer, ControlEvent, LatestControl, LatestChapterBranch, ContainerEvent, ChapterEvent } from '../../../movika.core/manifest';
1
+ import type { ChapterContainer, Control, ChapterBranch, ControlEvent, ContainerEvent, ChapterEvent } from '../../../manifest';
2
2
  import type { EventEmitter } from '../../../utils/EventEmitter';
3
3
  import type { IPlayer } from '@vkontakte/videoplayer-core';
4
4
  import type { InteractiveEventsType } from './InteractiveEvents';
@@ -11,29 +11,29 @@ export type SelectBranchesArg = {
11
11
  };
12
12
  export type OnControlEventArg = {
13
13
  action: ControlEvent['action'];
14
- controlType: LatestControl['type'];
15
- controlId: LatestControl['id'];
16
- containerId: LatestContainer['id'];
14
+ controlType: Control['type'];
15
+ controlId: Control['id'];
16
+ containerId: ChapterContainer['id'];
17
17
  onEvent: AnyFn;
18
- branches?: LatestChapterBranch[];
18
+ branches?: ChapterBranch[];
19
19
  isEOV?: () => boolean;
20
20
  isDisabled?: () => boolean;
21
21
  };
22
22
  export type OnContainerEventArg = {
23
23
  action: ContainerEvent['action'];
24
- container: LatestContainer;
24
+ container: ChapterContainer;
25
25
  autoSelected?: boolean;
26
- branches?: LatestChapterBranch[];
26
+ branches?: ChapterBranch[];
27
27
  isEOV?: boolean;
28
28
  };
29
29
  export type OnChapterEventArg = {
30
30
  action: ChapterEvent['action'];
31
31
  chapterId: string;
32
- branches?: LatestChapterBranch[];
32
+ branches?: ChapterBranch[];
33
33
  };
34
34
  export type SetManifestContainerEventsArg = {
35
- container: LatestContainer;
36
- branches: LatestChapterBranch[];
35
+ container: ChapterContainer;
36
+ branches: ChapterBranch[];
37
37
  isEOV?: boolean;
38
38
  };
39
39
  export type AnyAction = ControlEvent['action'] | ContainerEvent['action'] | ChapterEvent['action'];
@@ -42,7 +42,7 @@ export type ActionMap = {
42
42
  container: ContainerEvent['action'];
43
43
  chapter: ChapterEvent['action'];
44
44
  };
45
- export type SubjectType<T extends keyof ActionMap> = T extends 'control' ? LatestControl['type'] : undefined;
45
+ export type SubjectType<T extends keyof ActionMap> = T extends 'control' ? Control['type'] : undefined;
46
46
  export type EventActionCommon<T extends keyof ActionMap> = {
47
47
  subjectId: string;
48
48
  subjectName: T;
@@ -53,7 +53,7 @@ export type EventActionCommonWithAction<T extends keyof ActionMap> = EventAction
53
53
  };
54
54
  export type OpenURIArg<T extends keyof ActionMap> = EventActionCommonWithAction<T> & {
55
55
  payload: {
56
- URI?: string;
56
+ URI?: Nullable<string>;
57
57
  };
58
58
  };
59
59
  export type ChangeManifestArg<T extends keyof ActionMap> = EventActionCommonWithAction<T> & {
@@ -1,7 +1,7 @@
1
1
  import type { Subject } from '@vkontakte/videoplayer-shared';
2
2
  import type { ChapterChangedData, EachTickData, PlayerChangedData } from '../../../modules/Interactives/types';
3
3
  import type { CustomError } from '../../../utils/Error';
4
- import type { LatestManifest } from '../../../movika.core/manifest';
4
+ import type { Manifest } from '../../../manifest';
5
5
  export interface GlobalEvents {
6
6
  noInteraction$: Subject<void>;
7
7
  graphVisibilityChanged$: Subject<boolean>;
@@ -10,7 +10,7 @@ export interface GlobalEvents {
10
10
  playerChanged$: Subject<PlayerChangedData>;
11
11
  error$: Subject<CustomError>;
12
12
  eachTick$: Subject<EachTickData>;
13
- manifestChanged$: Subject<LatestManifest>;
13
+ manifestChanged$: Subject<Manifest>;
14
14
  }
15
15
  export declare const EVENT_NAMES: {
16
16
  /**
@@ -1,4 +1,4 @@
1
- import { type LatestChapterBranch } from '../../../movika.core/manifest';
1
+ import { type ChapterBranch } from '../../../manifest';
2
2
  /**
3
3
  * Returns a random number in the range [0, limit) or [limit, 0) if the 'limit'
4
4
  * value is negative
@@ -7,17 +7,17 @@ export declare const getRandomNumber: (limit: number) => number;
7
7
  /**
8
8
  * Finds the value with minimal weight number
9
9
  */
10
- export declare const minFallbackStrategy: (branches: LatestChapterBranch[]) => Nullable<import("../../../movika.core/manifest/manifest_3_3/chapter").ChapterBranch>;
10
+ export declare const minFallbackStrategy: (branches: ChapterBranch[]) => Nullable<ChapterBranch>;
11
11
  /**
12
12
  * Finds the value with maximal weight number
13
13
  */
14
- export declare const maxFallbackStrategy: (branches: LatestChapterBranch[]) => Nullable<import("../../../movika.core/manifest/manifest_3_3/chapter").ChapterBranch>;
14
+ export declare const maxFallbackStrategy: (branches: ChapterBranch[]) => Nullable<ChapterBranch>;
15
15
  /**
16
16
  * Finds first branch with `isDefault === true` value
17
17
  */
18
- export declare const defaultFallbackStrategy: (branches: LatestChapterBranch[]) => import("../../../movika.core/manifest/manifest_3_3/chapter").ChapterBranch | undefined;
18
+ export declare const defaultFallbackStrategy: (branches: ChapterBranch[]) => ChapterBranch | undefined;
19
19
  /**
20
20
  * Returns the random branch
21
21
  */
22
- export declare const weightlessRandomFallbackStrategy: (branches: LatestChapterBranch[]) => import("../../../movika.core/manifest/manifest_3_3/chapter").ChapterBranch;
23
- export declare const weightyRandomFallbackStrategy: (branches: LatestChapterBranch[]) => import("../../../movika.core/manifest/manifest_3_3/chapter").ChapterBranch;
22
+ export declare const weightlessRandomFallbackStrategy: (branches: ChapterBranch[]) => ChapterBranch;
23
+ export declare const weightyRandomFallbackStrategy: (branches: ChapterBranch[]) => ChapterBranch;
@@ -1,4 +1,4 @@
1
- import { type LatestControl, type LatestChapter, type LatestContainer } from '../../../movika.core/manifest';
1
+ import { type Control, type Chapter, type ChapterContainer } from '../../../manifest';
2
2
  import type { GameController } from './GameController';
3
3
  export declare enum GameStates {
4
4
  nothing = 0,
@@ -9,20 +9,20 @@ export declare enum GameStates {
9
9
  removed = 5,
10
10
  destroyed = 6
11
11
  }
12
- export declare const isControlsExist: (controls: LatestControl[]) => boolean;
13
- export declare const isLastChapter: (chapter: LatestChapter) => boolean;
14
- export declare const hasEndTemplate: (chapter: LatestChapter) => boolean;
15
- export declare const isBeforeStartTime: (currentTime: number, container: LatestContainer) => boolean;
16
- export declare const isInteractiveTime: (currentTime: number, container: LatestContainer) => boolean;
17
- export declare const isAfterInteractiveTime: (currentTime: number, container: LatestContainer) => boolean;
18
- type AnyEvent = LatestContainer['events'] | LatestChapter['events'] | LatestControl['events'];
12
+ export declare const isControlsExist: (controls: Control[]) => boolean;
13
+ export declare const isLastChapter: (chapter: Chapter) => boolean;
14
+ export declare const hasEndTemplate: (chapter: Chapter) => boolean;
15
+ export declare const isBeforeStartTime: (currentTime: number, container: ChapterContainer) => boolean;
16
+ export declare const isInteractiveTime: (currentTime: number, container: ChapterContainer) => boolean;
17
+ export declare const isAfterInteractiveTime: (currentTime: number, container: ChapterContainer) => boolean;
18
+ type AnyEvent = (ChapterContainer | Chapter | Control)['events'];
19
19
  export declare const isExpectEvent: (events?: AnyEvent) => boolean;
20
- export declare const getExpectEvent: (events?: AnyEvent) => import("../../../movika.core/manifest").ControlEvent | import("../../../movika.core/manifest").ChapterEvent | import("../../../movika.core/manifest").ContainerEvent | undefined;
21
- export declare const isOneCtrlOneContainer: (controls: LatestControl[]) => boolean;
22
- export declare const isOneTextCtrlContainer: (controls: LatestControl[]) => boolean;
23
- export declare function excludeTextControl(containers?: LatestContainer[]): import("../../../movika.core/manifest/manifest_3_3/chapter").ChapterContainer[];
24
- export declare const isEOVEndTime: (target: HTMLVideoElement, endTime: LatestContainer["endTime"]) => boolean;
20
+ export declare const getExpectEvent: (events?: AnyEvent) => import("../../../manifest").ControlEvent | import("../../../manifest").ChapterEvent | import("../../../manifest").ContainerEvent | undefined;
21
+ export declare const isOneCtrlOneContainer: (controls: Control[]) => boolean;
22
+ export declare const isOneTextCtrlContainer: (controls: Control[]) => boolean;
23
+ export declare function excludeTextControl(containers?: ChapterContainer[]): ChapterContainer[];
24
+ export declare const isEOVEndTime: (target: HTMLVideoElement, endTime: ChapterContainer["endTime"]) => boolean;
25
25
  export declare function partial<T extends unknown[], U extends unknown[], R>(fn: (...args: [...T, ...U]) => R, ...presetArgs: T): (...laterArgs: U) => R;
26
26
  export declare function partial<T extends Record<string, unknown>, P extends Partial<T>>(fn: (args: T) => unknown, presetArgs: P): (laterArgs: Omit<T, keyof P>) => ReturnType<typeof fn>;
27
- export declare const shouldIgnoreContainerEvent: (container: LatestContainer, gameControllers: GameController[]) => boolean;
27
+ export declare const shouldIgnoreContainerEvent: (container: ChapterContainer, gameControllers: GameController[]) => boolean;
28
28
  export {};
@@ -1,4 +1,4 @@
1
- import { type Container } from '../../../movika.core/manifest';
1
+ import { type Container } from '../../../manifest';
2
2
  export type InteractiveRange = {
3
3
  subjects: string[];
4
4
  range: [number, number];
@@ -1,4 +1,4 @@
1
- import { type LatestControl } from '../../../movika.core/manifest';
1
+ import { type Control } from '../../../manifest';
2
2
  import { type Dimensions } from '../../../modules/Interactives/controls';
3
3
  export declare const classnamesPrefix = "interactive";
4
4
  export declare const rootElClassName = "interactive-controls-container";
@@ -33,27 +33,29 @@ export declare enum TEXT_ALIGN {
33
33
  end = "right",
34
34
  center = "center"
35
35
  }
36
- type SetTextPositionStylesProps = {
36
+ export type SetTextPositionStylesProps = {
37
37
  target: HTMLElement;
38
- props: LatestControl['props'];
38
+ props: Control['props']['text'] & {
39
+ alignment: Control['layoutParams']['alignment'];
40
+ };
39
41
  };
40
42
  export declare const setTextPositionStyles: ({ target, props }: SetTextPositionStylesProps) => void;
41
43
  type SetTextStylesProps = {
42
44
  target: HTMLElement;
43
- props: LatestControl['props'];
45
+ props: Control['props'];
44
46
  fallback: ControlStylesFallbacks;
45
47
  dependsOn: Dimensions;
46
48
  };
47
49
  export declare const setTextStyles: ({ target, props, fallback, dependsOn }: SetTextStylesProps) => void;
48
50
  type SetBackgroundStylesProps = {
49
51
  target: HTMLElement;
50
- props: LatestControl['props'];
52
+ props: Control['props'];
51
53
  fallback: ControlStylesFallbacks;
52
54
  };
53
55
  export declare const setBackgroundStyles: ({ target, props, fallback }: SetBackgroundStylesProps) => void;
54
56
  type SetBorderStylesProps = {
55
57
  target: HTMLElement;
56
- props: LatestControl['props'];
58
+ props: Control['props'];
57
59
  fallback: ControlStylesFallbacks;
58
60
  dependsOn: Dimensions;
59
61
  };
@@ -61,7 +63,7 @@ export declare const setBorderStyles: ({ target, props, fallback, dependsOn }: S
61
63
  type SetAngleProps = {
62
64
  target: HTMLElement;
63
65
  fallback: ControlStylesFallbacks;
64
- layoutParams: LatestControl['layoutParams'];
66
+ layoutParams: Control['layoutParams'];
65
67
  };
66
68
  export declare const setAngle: ({ target, layoutParams, fallback }: SetAngleProps) => void;
67
69
  export {};
@@ -1,5 +1,5 @@
1
- import type { ManifestVideo, ManifestVideoVariant } from '../../../movika.core/manifest';
2
- export type { Extensions, Standard } from '../../../movika.core/manifest';
1
+ import type { ManifestVideo, ManifestVideoVariant } from '../../../manifest';
2
+ export type { Extension, Standard } from '../../../manifest';
3
3
  export interface GetVKVideoParams {
4
4
  access_token: string;
5
5
  owner_id?: number;
@@ -1,5 +1,3 @@
1
- import type { ManifestVideoVariant } from '../../../movika.core/manifest';
2
1
  import type { FullRequestParams, VideoVideoImage } from './types';
3
2
  export declare function createRequestURL({ baseURL, requestParams }: FullRequestParams): string;
4
3
  export declare function findMaxResolutionFrame(frames?: VideoVideoImage[]): VideoVideoImage | undefined;
5
- export declare function isVKVariantItem(variantItem: ManifestVideoVariant): boolean;
@@ -1,22 +1,21 @@
1
1
  import type { IValueSubject } from '@vkontakte/videoplayer-shared';
2
- import type { ChapterBranch, ManifestVideo, LatestChapter, LatestManifest, LatestManifestVideo } from '../../movika.core/manifest';
3
- import type { GraphEditChapter, GraphViewChapter } from '../../movika.core/manifest/manifest_3_3/graph';
2
+ import type { ChapterBranch, ManifestVideo, Chapter, Manifest, GraphEditChapter, GraphViewChapter, AnyManifest } from '../../manifest';
4
3
  import { Loadable } from './Loadable';
5
4
  type BranchesData = {
6
- chapter: LatestChapter;
5
+ chapter: Chapter;
7
6
  graph: GraphEditChapter | GraphViewChapter | undefined;
8
7
  media: ManifestVideo;
9
8
  };
10
9
  export declare class ManifestController extends Loadable {
11
- manifest: Nullable<LatestManifest>;
12
- chapter: Nullable<LatestChapter>;
13
- media: Nullable<LatestManifestVideo>;
14
- graph: Nullable<LatestManifest['graph']>;
15
- prevChapter$: IValueSubject<LatestChapter | null>;
10
+ manifest: Nullable<Manifest>;
11
+ chapter: Nullable<Chapter>;
12
+ media: Nullable<ManifestVideo>;
13
+ graph: Nullable<Manifest['graph']>;
14
+ prevChapter$: IValueSubject<Chapter | null>;
16
15
  onError: Function;
17
16
  constructor(loaders: any, onError: Function);
18
17
  release(): this;
19
- setManifest(source: LatestManifest): Promise<ManifestController>;
18
+ setManifest(source: AnyManifest | string): Promise<ManifestController>;
20
19
  setInitial(): Promise<ManifestController>;
21
20
  setNext(chapterId?: string | undefined): Promise<ManifestController>;
22
21
  errorHandler(errors: unknown): void;
@@ -25,9 +24,9 @@ export declare class ManifestController extends Loadable {
25
24
  getBranches(chapterId?: string | undefined): BranchesData[];
26
25
  getByBranches(branches?: ChapterBranch[]): BranchesData[];
27
26
  getCurrent(): {
28
- chapter: Nullable<import("../../movika.core/manifest/types").Chapter>;
29
- media: Nullable<import("../../movika.core/manifest/manifest_3_3/manifest").ManifestVideo>;
30
- graph: Nullable<import("../../movika.core/manifest/manifest_3_3/graph").GraphDesign>;
27
+ chapter: Nullable<Chapter>;
28
+ media: Nullable<ManifestVideo>;
29
+ graph: Nullable<import("@interactiveplatform/movika-manifest").GraphDesign>;
31
30
  };
32
31
  isInitialChapter(): boolean;
33
32
  isEndChapter(): boolean;
@@ -1,12 +1,12 @@
1
- import type { Manifest, LatestManifest, Media, Chapter } from '../../movika.core/manifest';
1
+ import type { Manifest, AnyManifest, Media, Chapter } from '../../manifest';
2
2
  type ManifestInfo = {
3
- manifest: Manifest;
3
+ manifest: AnyManifest;
4
4
  manifestURL: string;
5
5
  };
6
- export declare const convertToObject: (manifest: Manifest | string) => Promise<Partial<ManifestInfo>>;
7
- export declare function fetchManifest(manifest: Manifest): Promise<LatestManifest>;
6
+ export declare const convertToObject: (manifest: AnyManifest | string) => Promise<Partial<ManifestInfo>>;
7
+ export declare function fetchManifest(manifest: AnyManifest | string): Promise<Manifest>;
8
8
  export declare function getInitialChapter(manifest: any): Chapter | undefined;
9
9
  export declare function getChapter(chapters: Chapter[], chapterId?: string): Chapter | undefined;
10
- export declare function getGraphItem(graphObj: LatestManifest['graph'], chapterId: string): import("../../movika.core/manifest/manifest_3_3/graph").GraphEditChapter | import("../../movika.core/manifest/manifest_3_3/graph").GraphViewChapter | undefined;
11
- export declare function getMedia(media: Media, videoId?: string): import("../../movika.core/manifest/manifest_3_2/manifest").ManifestVideo | undefined;
10
+ export declare function getGraphItem(graphObj: Manifest['graph'], chapterId: string): import("../../manifest").GraphEditChapter | import("../../manifest").GraphViewChapter | undefined;
11
+ export declare function getMedia(media: Media, videoId?: string): import("../../manifest").ManifestVideo | undefined;
12
12
  export {};
@@ -1,6 +1,6 @@
1
1
  import type { IConfig, PlaybackRate, VideoQuality } from '@vkontakte/videoplayer-core';
2
2
  import { ValueSubject } from '@vkontakte/videoplayer-shared';
3
- import type { ManifestVideo, Extensions } from '../../movika.core/manifest';
3
+ import type { ManifestVideo, Extension } from '../../manifest';
4
4
  import type { Interactives } from '../../modules/Interactives';
5
5
  import type { Instance } from './InstanceManager';
6
6
  interface CreatePlayerParams extends Omit<IConfig, 'sources' | 'container'> {
@@ -9,7 +9,7 @@ interface CreatePlayerParams extends Omit<IConfig, 'sources' | 'container'> {
9
9
  prefetch?: boolean;
10
10
  setAsActive?: boolean;
11
11
  autoplay?: boolean;
12
- preferredExt?: Array<Extensions>;
12
+ preferredExt?: Array<Extension>;
13
13
  quality?: VideoQuality;
14
14
  playbackRate?: PlaybackRate;
15
15
  title?: string;
@@ -1,7 +1,7 @@
1
1
  import type { IPlayer, ISources } from '@vkontakte/videoplayer-core';
2
- import type { ManifestVideo, Extensions } from '../../movika.core/manifest';
2
+ import type { ManifestVideo, Extension } from '../../manifest';
3
3
  import { VideoQuality } from '@vkontakte/videoplayer-core';
4
- export declare function genPlayerCfgVideoData(mediaObj: ManifestVideo, allowList?: Array<Extensions>): {
4
+ export declare function genPlayerCfgVideoData(mediaObj: ManifestVideo, allowList?: Array<Extension>): {
5
5
  sources: ISources;
6
6
  thumbUrl?: string | null;
7
7
  title: string;
@@ -1,10 +1,10 @@
1
1
  import type { IPlayer } from '@vkontakte/videoplayer-core';
2
- import type { ChapterContainers } from '../../movika.core/manifest/types';
2
+ import type { ChapterContainer } from '../../manifest';
3
3
  export declare class SeekToInteractiveController {
4
4
  private _containers;
5
5
  private _player;
6
6
  setPlayer: (player: IPlayer) => void;
7
- setContainers: (containers: ChapterContainers) => void;
7
+ setContainers: (containers: ChapterContainer[]) => void;
8
8
  deleteContainer: (id: string) => void;
9
9
  getNextInteractiveTime: (offsetMs?: number) => number | null;
10
10
  }
@@ -1,4 +1,4 @@
1
- import type { Chapter } from '../movika.core/manifest';
1
+ import type { Chapter } from '../manifest';
2
2
  import { LastFrameCanvasAPI } from './LastFrameCanvasAPI';
3
3
  type ConstructorParams = {
4
4
  parentElement: HTMLElement;
@@ -1,4 +1,4 @@
1
- import type { Manifest, ManifestVideoVariant, ManifestVideo, VideoId } from '../movika.core/manifest';
1
+ import type { Manifest, ManifestVideoVariant, ManifestVideo, VideoId } from '../manifest';
2
2
  export declare const chapterIdsToVKVideoIds: (chapterIds: string[], interactiveManifest: Manifest) => number[];
3
3
  export declare const getVideoRawIdByMedia: (mediaVideo: ManifestVideo) => string | undefined;
4
4
  export declare const isVKVariantItem: (variantItem: ManifestVideoVariant) => boolean;
@@ -1,2 +1,2 @@
1
- import type { ManifestVideo } from '../movika.core/manifest';
1
+ import type { ManifestVideo } from '../manifest';
2
2
  export declare const extractVkMovieId: (media: ManifestVideo) => [] | [string, string];
@@ -1,28 +0,0 @@
1
- import type { Chapter as Chapter_3_2, ChapterContainer as ChapterContainer_3_2, ChapterBranch as ChapterBranch_3_2 } from './manifest_3_2/chapter';
2
- import type { Manifest_3_2, ManifestVideo as ManifestVideo_3_2, ManifestVideoVariant as ManifestVideoVariant_3_2, Media as Media_3_2, Metadata as Metadata_3_2 } from './manifest_3_2/manifest';
3
- import type { Chapter as Chapter_3_3, ChapterContainer as ChapterContainer_3_3, ChapterBranch as ChapterBranch_3_3 } from './manifest_3_3/chapter';
4
- import type { Manifest_3_3, ManifestVideo as ManifestVideo_3_3, ManifestVideoVariant as ManifestVideoVariant_3_3, Media as Media_3_3, Metadata as Metadata_3_3, ManifestVideoVariantType, Extensions, Standard } from './manifest_3_3/manifest';
5
- import type { Control, ControlLayoutParams } from './manifest_3_3/control';
6
- export type Container = ChapterContainer_3_2 | ChapterContainer_3_3;
7
- export type Media = Media_3_2 | Media_3_3;
8
- export type Chapter = Chapter_3_2 | Chapter_3_3;
9
- export type Manifest = Manifest_3_2 | Manifest_3_3;
10
- export type Metadata = Metadata_3_2 | Metadata_3_3;
11
- export type ManifestVideo = ManifestVideo_3_2 | ManifestVideo_3_3;
12
- export type ManifestVideoVariant = ManifestVideoVariant_3_2 | ManifestVideoVariant_3_3;
13
- export type ChapterBranch = ChapterBranch_3_2 | ChapterBranch_3_3;
14
- export type { ManifestVideoVariantType, Extensions, Standard };
15
- export type LatestMedia = Media_3_3;
16
- export type LatestManifestVideo = ManifestVideo_3_3;
17
- export type LatestChapter = Chapter_3_3;
18
- export type LatestManifest = Manifest_3_3;
19
- export type LatestContainer = ChapterContainer_3_3;
20
- export type LatestControl = Control;
21
- export type LatestControlLayoutParams = ControlLayoutParams;
22
- export type LatestChapterBranch = ChapterBranch_3_3;
23
- export type { ControlEvent } from './manifest_3_3/control';
24
- export type { ContainerEvent } from './manifest_3_3/chapter';
25
- export type { ChapterEvent } from './manifest_3_3/chapter';
26
- export * from './migrations';
27
- export * from './types';
28
- export * from './utils';
@@ -1,63 +0,0 @@
1
- import type { Control } from './control';
2
- export type ChapterEventType = 'onSuspense';
3
- export type ContainerEventType = 'onSuspense';
4
- export type ChapterSuspenseActionType = 'setNextBranch' | 'setWeightlessRandomBranch' | 'setRandomBranch' | 'setMaxWeightBranch' | 'setMinWeightBranch' | 'setDefaultBranch' | 'continuePlayback' | 'openURI';
5
- export type ContainerSuspenseActionType = 'setNextBranch' | 'continuePlayback';
6
- export interface ChapterEvent {
7
- type: ChapterEventType;
8
- action: {
9
- type: ChapterSuspenseActionType;
10
- args: {
11
- branchId?: string;
12
- shouldOpenNow: boolean;
13
- isDetachContainer?: boolean;
14
- };
15
- };
16
- }
17
- export interface ChapterBranch {
18
- id: string;
19
- chapterId: string;
20
- weight?: number;
21
- manifestUrl?: string;
22
- isDefault?: boolean;
23
- }
24
- export interface ContainerEvent {
25
- type: ContainerEventType;
26
- action: {
27
- type: ContainerSuspenseActionType;
28
- args: {
29
- branchId?: string;
30
- shouldOpenNow: boolean;
31
- isDetachContainer?: boolean;
32
- uri?: string;
33
- };
34
- };
35
- }
36
- export interface ChapterContainer {
37
- id: string;
38
- /**
39
- * Interactivity start time in milliseconds
40
- */
41
- startTime: number;
42
- /**
43
- * Interactivity end time in milliseconds
44
- */
45
- endTime?: number | null;
46
- controls: Control[];
47
- layout: {
48
- type: 'Relative';
49
- };
50
- type: 'Choice' | 'TextInput';
51
- events?: ContainerEvent[];
52
- }
53
- export interface Chapter {
54
- id: string;
55
- videoId?: string;
56
- containers: ChapterContainer[];
57
- branches: ChapterBranch[];
58
- events?: ChapterEvent[];
59
- label: string;
60
- x: number;
61
- y: number;
62
- order: 'start' | 'end' | 'simple';
63
- }