@vkontakte/videoplayer-interactive 1.0.63-dev.55dfadaf.0 → 1.0.63-dev.baccd7d5.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/index.d.ts +11 -0
- package/{types/manifest → manifest}/index.d.ts +3 -3
- package/manifest/utils.d.ts +48 -0
- package/modules/Graph/Graph.d.ts +54 -0
- package/modules/Graph/index.d.ts +1 -0
- package/modules/Interactives/Interactives.d.ts +143 -0
- package/modules/Interactives/Layout.d.ts +16 -0
- package/modules/Interactives/containers/ChoiceContainer.d.ts +34 -0
- package/modules/Interactives/containers/Container.d.ts +21 -0
- package/modules/Interactives/containers/index.d.ts +4 -0
- package/modules/Interactives/containers/types.d.ts +11 -0
- package/{types/modules → modules}/Interactives/containers/utils.d.ts +3 -3
- package/modules/Interactives/controls/AreaControl.d.ts +21 -0
- package/modules/Interactives/controls/ButtonControl.d.ts +25 -0
- package/modules/Interactives/controls/Control.d.ts +48 -0
- package/modules/Interactives/controls/TextControl.d.ts +18 -0
- package/modules/Interactives/controls/index.d.ts +6 -0
- package/modules/Interactives/controls/types.d.ts +35 -0
- package/modules/Interactives/controls/utils.d.ts +14 -0
- package/modules/Interactives/index.d.ts +16 -0
- package/modules/Interactives/styles/index.d.ts +1 -0
- package/modules/Interactives/types.d.ts +79 -0
- package/modules/Interactives/utils/BlinkAnimationRef.d.ts +15 -0
- package/modules/Interactives/utils/ControlFillAnimation/ControlFillAnimation.d.ts +34 -0
- package/modules/Interactives/utils/ControlFillAnimation/index.d.ts +1 -0
- package/modules/Interactives/utils/ControlFillAnimation/utils.d.ts +12 -0
- package/modules/Interactives/utils/ControlTap/ControlTap.d.ts +17 -0
- package/modules/Interactives/utils/ControlTap/index.d.ts +1 -0
- package/{types/modules → modules}/Interactives/utils/ControlTap/utils.d.ts +3 -3
- package/modules/Interactives/utils/GameController.d.ts +71 -0
- package/modules/Interactives/utils/GroupsStack.d.ts +32 -0
- package/modules/Interactives/utils/HistoryController.d.ts +52 -0
- package/modules/Interactives/utils/InteractiveEvents.d.ts +32 -0
- package/modules/Interactives/utils/ResizeManager.d.ts +15 -0
- package/modules/Interactives/utils/SelectBranches.d.ts +23 -0
- package/modules/Interactives/utils/SelectBranches.types.d.ts +78 -0
- package/{types/modules → modules}/Interactives/utils/angleUtils.d.ts +12 -12
- package/modules/Interactives/utils/createControlText.d.ts +4 -0
- package/modules/Interactives/utils/emitOnError.d.ts +13 -0
- package/modules/Interactives/utils/events.d.ts +79 -0
- package/modules/Interactives/utils/events.types.d.ts +52 -0
- package/{types/modules → modules}/Interactives/utils/fallbackStrategies.d.ts +13 -13
- package/modules/Interactives/utils/functionUtils.d.ts +5 -0
- package/{types/modules → modules}/Interactives/utils/gameUtils.d.ts +20 -20
- package/{types/modules → modules}/Interactives/utils/getInteractiveRanges.d.ts +5 -5
- package/modules/Interactives/utils/renderingUtils.d.ts +75 -0
- package/modules/Loaders/index.d.ts +1 -0
- package/modules/Loaders/movikaProjectIdLoader/index.d.ts +1 -0
- package/modules/Loaders/vkVideoLoader/CustomVkVideoLoader.d.ts +10 -0
- package/modules/Loaders/vkVideoLoader/index.d.ts +1 -0
- package/modules/Loaders/vkVideoLoader/types.d.ts +257 -0
- package/{types/modules → modules}/Loaders/vkVideoLoader/utils.d.ts +1 -1
- package/{types/modules → modules}/ManifestController/Loadable.d.ts +5 -5
- package/modules/ManifestController/ManifestController.d.ts +34 -0
- package/modules/ManifestController/index.d.ts +1 -0
- package/{types/modules → modules}/ManifestController/utils.d.ts +5 -5
- package/modules/SeamlessController/InstanceManager.d.ts +15 -0
- package/modules/SeamlessController/SeamlessController.d.ts +34 -0
- package/modules/SeamlessController/utils.d.ts +9 -0
- package/modules/SeekToInteractiveController/SeekToInteractiveController.d.ts +10 -0
- package/modules/SeekToInteractiveController/index.d.ts +1 -0
- package/package.json +9 -32
- package/types/CustomError.d.ts +13 -0
- package/types/index.d.ts +2 -11
- package/utils/CssVarsManager.d.ts +23 -0
- package/utils/Error.d.ts +8 -0
- package/utils/EventEmitter.d.ts +12 -0
- package/utils/LastFrame.d.ts +35 -0
- package/utils/LastFrameCanvasAPI.d.ts +19 -0
- package/utils/MultiMap.d.ts +10 -0
- package/utils/Raf.d.ts +13 -0
- package/{types/utils → utils}/chapterHelpers.d.ts +1 -1
- package/utils/compareVersions.d.ts +14 -0
- package/{types/utils → utils}/extractVkMovieId.d.ts +1 -1
- package/utils/getVideoContentSize.d.ts +5 -0
- package/{types/utils → utils}/hexToRgb.d.ts +2 -2
- package/{types/utils → utils}/typeCheck.d.ts +6 -6
- package/es2015.cjs +0 -286
- package/es2015.esm.js +0 -286
- package/es2018.cjs +0 -286
- package/es2018.esm.js +0 -286
- package/es2024.cjs +0 -286
- package/es2024.esm.js +0 -286
- package/esnext.cjs +0 -286
- package/esnext.esm.js +0 -286
- package/evergreen.esm.js +0 -286
- package/types/manifest/utils.d.ts +0 -48
- package/types/modules/Graph/Graph.d.ts +0 -54
- package/types/modules/Graph/index.d.ts +0 -1
- package/types/modules/Interactives/Interactives.d.ts +0 -143
- package/types/modules/Interactives/Layout.d.ts +0 -16
- package/types/modules/Interactives/containers/ChoiceContainer.d.ts +0 -34
- package/types/modules/Interactives/containers/Container.d.ts +0 -21
- package/types/modules/Interactives/containers/index.d.ts +0 -4
- package/types/modules/Interactives/containers/types.d.ts +0 -11
- package/types/modules/Interactives/controls/AreaControl.d.ts +0 -21
- package/types/modules/Interactives/controls/ButtonControl.d.ts +0 -25
- package/types/modules/Interactives/controls/Control.d.ts +0 -48
- package/types/modules/Interactives/controls/TextControl.d.ts +0 -18
- package/types/modules/Interactives/controls/index.d.ts +0 -6
- package/types/modules/Interactives/controls/types.d.ts +0 -38
- package/types/modules/Interactives/controls/utils.d.ts +0 -14
- package/types/modules/Interactives/index.d.ts +0 -16
- package/types/modules/Interactives/styles/index.d.ts +0 -1
- package/types/modules/Interactives/types.d.ts +0 -79
- package/types/modules/Interactives/utils/BlinkAnimationRef.d.ts +0 -15
- package/types/modules/Interactives/utils/ControlFillAnimation/ControlFillAnimation.d.ts +0 -34
- package/types/modules/Interactives/utils/ControlFillAnimation/index.d.ts +0 -1
- package/types/modules/Interactives/utils/ControlFillAnimation/utils.d.ts +0 -12
- package/types/modules/Interactives/utils/ControlTap/ControlTap.d.ts +0 -17
- package/types/modules/Interactives/utils/ControlTap/index.d.ts +0 -1
- package/types/modules/Interactives/utils/GameController.d.ts +0 -71
- package/types/modules/Interactives/utils/GroupsStack.d.ts +0 -30
- package/types/modules/Interactives/utils/HistoryController.d.ts +0 -51
- package/types/modules/Interactives/utils/InteractiveEvents.d.ts +0 -32
- package/types/modules/Interactives/utils/ResizeManager.d.ts +0 -15
- package/types/modules/Interactives/utils/SelectBranches.d.ts +0 -23
- package/types/modules/Interactives/utils/SelectBranches.types.d.ts +0 -78
- package/types/modules/Interactives/utils/createControlText.d.ts +0 -4
- package/types/modules/Interactives/utils/emitOnError.d.ts +0 -13
- package/types/modules/Interactives/utils/events.d.ts +0 -79
- package/types/modules/Interactives/utils/events.types.d.ts +0 -55
- package/types/modules/Interactives/utils/functionUtils.d.ts +0 -12
- package/types/modules/Interactives/utils/renderingUtils.d.ts +0 -75
- package/types/modules/Loaders/index.d.ts +0 -1
- package/types/modules/Loaders/movikaProjectIdLoader/index.d.ts +0 -1
- package/types/modules/Loaders/vkVideoLoader/CustomVkVideoLoader.d.ts +0 -10
- package/types/modules/Loaders/vkVideoLoader/index.d.ts +0 -1
- package/types/modules/Loaders/vkVideoLoader/types.d.ts +0 -257
- package/types/modules/ManifestController/ManifestController.d.ts +0 -34
- package/types/modules/ManifestController/index.d.ts +0 -1
- package/types/modules/SeamlessController/InstanceManager.d.ts +0 -15
- package/types/modules/SeamlessController/SeamlessController.d.ts +0 -33
- package/types/modules/SeamlessController/utils.d.ts +0 -9
- package/types/modules/SeekToInteractiveController/SeekToInteractiveController.d.ts +0 -10
- package/types/modules/SeekToInteractiveController/index.d.ts +0 -1
- package/types/types/CustomError.d.ts +0 -13
- package/types/types/index.d.ts +0 -2
- package/types/utils/CssVarsManager.d.ts +0 -23
- package/types/utils/Error.d.ts +0 -8
- package/types/utils/EventEmitter.d.ts +0 -12
- package/types/utils/LastFrame.d.ts +0 -35
- package/types/utils/LastFrameCanvasAPI.d.ts +0 -19
- package/types/utils/MultiMap.d.ts +0 -10
- package/types/utils/Raf.d.ts +0 -13
- package/types/utils/compareVersions.d.ts +0 -14
- package/types/utils/getVideoContentSize.d.ts +0 -5
- /package/{types/constants.d.ts → constants.d.ts} +0 -0
- /package/{types/env.d.ts → env.d.ts} +0 -0
- /package/{types/modules → modules}/Interactives/styles/utils.d.ts +0 -0
- /package/{types/modules → modules}/Loaders/movikaProjectIdLoader/movikaProjectIdLoader.d.ts +0 -0
- /package/types/{types/dom.d.ts → dom.d.ts} +0 -0
- /package/{types/utils → utils}/debounce.d.ts +0 -0
- /package/{types/utils → utils}/throttle.d.ts +0 -0
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { type ISubscription, type IValueSubject } from "@vkontakte/videoplayer-shared";
|
|
2
|
-
import { type IPlayer } from "@vkontakte/videoplayer-core";
|
|
3
|
-
import type { InteractiveEventsType } from "./InteractiveEvents";
|
|
4
|
-
import type { ChapterBranch } from "../../../manifest";
|
|
5
|
-
import type { EventEmitter } from "../../../utils/EventEmitter";
|
|
6
|
-
import type { CustomError } from "../../../utils/Error";
|
|
7
|
-
import type { SelectBranchesType } from "./SelectBranches";
|
|
8
|
-
import type { IgnoreExpectState, AnimationsFeatureToggles, IInteractiveOptions } from "../types";
|
|
9
|
-
import type { ChoiceContainer } from "../containers";
|
|
10
|
-
import { type GlobalEvents } from "./events";
|
|
11
|
-
import { GameStates } from "./gameUtils";
|
|
12
|
-
type Features = Pick<AnimationsFeatureToggles, "controlsHideAnimation"> & Pick<IInteractiveOptions, "enableAvPlayerSupport">;
|
|
13
|
-
type ConstructorArg = {
|
|
14
|
-
player: IPlayer;
|
|
15
|
-
container: ChoiceContainer;
|
|
16
|
-
branches: ChapterBranch[];
|
|
17
|
-
selectBranches: ReturnType<SelectBranchesType>;
|
|
18
|
-
interactiveEvents: InteractiveEventsType;
|
|
19
|
-
globalEventEmitter: EventEmitter;
|
|
20
|
-
globalEvents: GlobalEvents;
|
|
21
|
-
getContainerEventState: () => IgnoreExpectState;
|
|
22
|
-
permanentTextControls: boolean;
|
|
23
|
-
interactiveTimeOpenUri: boolean;
|
|
24
|
-
disabledControls$: IValueSubject<boolean>;
|
|
25
|
-
onRemove: () => void;
|
|
26
|
-
onError: (error: CustomError) => void;
|
|
27
|
-
disableTextControlContainerVisibilityEvents?: boolean;
|
|
28
|
-
features: Features;
|
|
29
|
-
};
|
|
30
|
-
export declare class GameController {
|
|
31
|
-
container: ChoiceContainer;
|
|
32
|
-
branches: ChapterBranch[];
|
|
33
|
-
selectBranches: ReturnType<SelectBranchesType>;
|
|
34
|
-
subscription: ISubscription;
|
|
35
|
-
player: IPlayer;
|
|
36
|
-
interactiveEvents: InteractiveEventsType;
|
|
37
|
-
getContainerEventState: () => IgnoreExpectState;
|
|
38
|
-
isPermanentText: boolean;
|
|
39
|
-
interactiveTimeOpenUri: boolean;
|
|
40
|
-
disabledControls$: IValueSubject<boolean>;
|
|
41
|
-
onRemove: () => void;
|
|
42
|
-
globalEventEmitter: EventEmitter;
|
|
43
|
-
gameState: GameStates;
|
|
44
|
-
isSelectedControlEvent: boolean;
|
|
45
|
-
isSelectedContainerEvent: boolean;
|
|
46
|
-
globalEvents: GlobalEvents;
|
|
47
|
-
onError: ConstructorArg["onError"];
|
|
48
|
-
disableTextControlContainerVisibilityEvents: boolean;
|
|
49
|
-
features: Features;
|
|
50
|
-
constructor({ player, container, branches, selectBranches, interactiveEvents, globalEvents, globalEventEmitter, getContainerEventState, permanentTextControls, interactiveTimeOpenUri, disabledControls$, onRemove, onError, disableTextControlContainerVisibilityEvents, features }: ConstructorArg);
|
|
51
|
-
private emitContainerVisibilityEvent;
|
|
52
|
-
registerEvents(): void;
|
|
53
|
-
hide: () => void;
|
|
54
|
-
show: () => void;
|
|
55
|
-
selectContainerEvent(isEOV?: boolean): void;
|
|
56
|
-
onStartTime(): void;
|
|
57
|
-
onEndTime(): void;
|
|
58
|
-
onBeforeStartTime(): void;
|
|
59
|
-
onEndOfVideo: () => void;
|
|
60
|
-
whilePlaying: () => void;
|
|
61
|
-
onResize(isInteractiveTime: boolean): void;
|
|
62
|
-
reset(): void;
|
|
63
|
-
removeView(withTransition?: boolean | undefined): void;
|
|
64
|
-
fakeRemoveView(remove?: boolean): void;
|
|
65
|
-
updateControlsShadowStyles(isDark?: boolean): void;
|
|
66
|
-
toggleBlinkAnimation(value: boolean): void;
|
|
67
|
-
isInteracted(): boolean;
|
|
68
|
-
isRemovedOrDestroyed(includeWillRemovedState?: boolean): boolean;
|
|
69
|
-
destroy(withTransition?: boolean): void;
|
|
70
|
-
}
|
|
71
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { EventActionKeys } from "../../../manifest";
|
|
2
|
-
export type TPriority = "chapter" | "container" | "control";
|
|
3
|
-
export type TPayload = {
|
|
4
|
-
actionType: EventActionKeys;
|
|
5
|
-
action: AnyFn;
|
|
6
|
-
};
|
|
7
|
-
export type TMapInitiator = {
|
|
8
|
-
[initiator: string]: TPayload[];
|
|
9
|
-
};
|
|
10
|
-
type TMapPriority = { [priority in TPriority]? : TMapInitiator };
|
|
11
|
-
type TMap = {
|
|
12
|
-
[timestamp: number]: TMapPriority;
|
|
13
|
-
};
|
|
14
|
-
export type TMapFlattened = {
|
|
15
|
-
timestamp: number;
|
|
16
|
-
priority: TPriority;
|
|
17
|
-
initiator: string;
|
|
18
|
-
} & TPayload;
|
|
19
|
-
type GetAndRemoveArgType = Partial<Omit<TMapFlattened, keyof TPayload>> & Pick<TMapFlattened, "timestamp">;
|
|
20
|
-
export type TGroupsStack = ReturnType<typeof GroupsStack>;
|
|
21
|
-
export declare function GroupsStack(): {
|
|
22
|
-
map: TMap;
|
|
23
|
-
remove: (args: GetAndRemoveArgType) => boolean;
|
|
24
|
-
add: (args: TMapFlattened) => void;
|
|
25
|
-
removeAll: () => void;
|
|
26
|
-
get: (args: GetAndRemoveArgType) => TMapPriority | TMapInitiator | TPayload[] | null;
|
|
27
|
-
getLte: (timestamp: number) => TMap;
|
|
28
|
-
getGte: (timestamp: number) => TMap;
|
|
29
|
-
};
|
|
30
|
-
export {};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Subject } from "@vkontakte/videoplayer-shared";
|
|
2
|
-
import type { IValueSubject, Nullable } from "@vkontakte/videoplayer-shared";
|
|
3
|
-
import type { EventEmitter } from "../../../utils/EventEmitter";
|
|
4
|
-
import type { Manifest, VideoId } from "../../../manifest";
|
|
5
|
-
import type { VideoInfo } from "..";
|
|
6
|
-
import type { Interactives } from "..";
|
|
7
|
-
import { CustomError } from "../../../utils/Error";
|
|
8
|
-
export interface HistoryApi {
|
|
9
|
-
get: (rawId: string) => Promise<number[]>;
|
|
10
|
-
save: (rawId: string, videoIds: number[]) => Promise<void>;
|
|
11
|
-
}
|
|
12
|
-
export interface HistorySettings {
|
|
13
|
-
maxLength: number;
|
|
14
|
-
initChapterId?: string;
|
|
15
|
-
}
|
|
16
|
-
interface HistoryControllerParams {
|
|
17
|
-
globalEventEmitter: EventEmitter;
|
|
18
|
-
interactiveController: Interactives;
|
|
19
|
-
settings: HistorySettings;
|
|
20
|
-
videoId?: string;
|
|
21
|
-
historyApi?: Nullable<HistoryApi>;
|
|
22
|
-
}
|
|
23
|
-
export interface HistoryControllerState {
|
|
24
|
-
history$: IValueSubject<string[]>;
|
|
25
|
-
hasPrevChapter$: IValueSubject<boolean>;
|
|
26
|
-
prevChapter$: IValueSubject<Nullable<string>>;
|
|
27
|
-
isInitialChapter$: IValueSubject<boolean>;
|
|
28
|
-
isGoBackLimited$: IValueSubject<boolean>;
|
|
29
|
-
}
|
|
30
|
-
interface HistoryInitedEventData {
|
|
31
|
-
initChapterId: string;
|
|
32
|
-
videosInfo?: VideoInfo[];
|
|
33
|
-
}
|
|
34
|
-
export default class HistoryController {
|
|
35
|
-
#private;
|
|
36
|
-
state: HistoryControllerState;
|
|
37
|
-
events: {
|
|
38
|
-
inited$: Subject<HistoryInitedEventData>;
|
|
39
|
-
destroyed$: Subject<void>;
|
|
40
|
-
error$: Subject<CustomError>;
|
|
41
|
-
};
|
|
42
|
-
constructor({ globalEventEmitter, videoId, interactiveController, historyApi, settings }: HistoryControllerParams);
|
|
43
|
-
setManifest(manifest: Manifest): Promise<void>;
|
|
44
|
-
get inited(): boolean;
|
|
45
|
-
updateHistory(chapterIds: string[], shouldSave?: boolean): Promise<void>;
|
|
46
|
-
goBack(): Promise<void>;
|
|
47
|
-
getProjectHistory(): Promise<void>;
|
|
48
|
-
getInitialChapterId(): string;
|
|
49
|
-
getInitialVideoId(): VideoId | null;
|
|
50
|
-
destroy(): void;
|
|
51
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { type Container } from "../../../manifest";
|
|
2
|
-
import { type TPayload, type TGroupsStack } from "./GroupsStack";
|
|
3
|
-
import type { IPlayer } from "@vkontakte/videoplayer-core";
|
|
4
|
-
type AddMethodParamType = Parameters<TGroupsStack["add"]>[0];
|
|
5
|
-
type RemoveMethodParamType = Parameters<TGroupsStack["remove"]>[0];
|
|
6
|
-
export interface ContainersEventsCallStateType {
|
|
7
|
-
setCalled: (args: {
|
|
8
|
-
timestamp: number;
|
|
9
|
-
id: string;
|
|
10
|
-
}) => void;
|
|
11
|
-
setData: (containers?: Container[]) => void;
|
|
12
|
-
resetCalled: (timestamp: number) => void;
|
|
13
|
-
isReady: (timestamp: number) => boolean;
|
|
14
|
-
release: () => void;
|
|
15
|
-
}
|
|
16
|
-
export interface InteractiveEventsType {
|
|
17
|
-
setPlayer: (player: IPlayer) => void;
|
|
18
|
-
add: (args: AddMethodParamType) => void;
|
|
19
|
-
remove: (args: RemoveMethodParamType) => void;
|
|
20
|
-
exec: (timestamp: number) => void;
|
|
21
|
-
execEndOfVideo: () => void;
|
|
22
|
-
listen: () => void;
|
|
23
|
-
unlisten: () => void;
|
|
24
|
-
release: () => void;
|
|
25
|
-
containersEventsCallState: ContainersEventsCallStateType;
|
|
26
|
-
getPreparedToExecActions: (timestamp?: number) => TPayload[];
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Executes an events at different times of the current chapter
|
|
30
|
-
*/
|
|
31
|
-
export declare function InteractiveEvents(player: IPlayer, interactiveTimeOpenUri: boolean): InteractiveEventsType;
|
|
32
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { IPlayer } from "@vkontakte/videoplayer-core";
|
|
2
|
-
import type { Nullable } from "@vkontakte/videoplayer-shared";
|
|
3
|
-
import type { CssVarsManager } from "../../../utils/CssVarsManager";
|
|
4
|
-
type ResizeManagerArg = () => {
|
|
5
|
-
parentElement: HTMLElement;
|
|
6
|
-
cssVarsManager: CssVarsManager;
|
|
7
|
-
player?: Nullable<IPlayer>;
|
|
8
|
-
fns?: AnyFn[];
|
|
9
|
-
};
|
|
10
|
-
export declare function ResizeManager(getOptions: ResizeManagerArg): {
|
|
11
|
-
resizeObserver: ResizeObserver;
|
|
12
|
-
calc: () => void;
|
|
13
|
-
release: () => void;
|
|
14
|
-
};
|
|
15
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { Chapter } from "../../../manifest";
|
|
2
|
-
import type { SelectBranchesArg, OnControlEventArg, ChangeChapterArg, ContinuePlaybackArg, ExpectEventHandlerArg, OnChapterEventArg, OnContainerEventArg, OnExpectEventArg, SetManifestContainerEventsArg, OpenURIArg, ActionMap, AnyAction, AfterExpectActionType } from "./SelectBranches.types";
|
|
3
|
-
export declare const defaultArgs: {
|
|
4
|
-
readonly shouldOpenNow: true;
|
|
5
|
-
readonly isDetachContainer: true;
|
|
6
|
-
};
|
|
7
|
-
export declare const AFTER_EXPECT_ACTION: AfterExpectActionType;
|
|
8
|
-
export declare const extendArgs: <T extends AnyAction>(action: T, rewrite?: boolean) => T;
|
|
9
|
-
export type ExtendArgsReturnType = ReturnType<typeof extendArgs>;
|
|
10
|
-
export declare const SelectBranches: ({ globalEventEmitter, globalEvents, player, interactiveEvents }: SelectBranchesArg) => {
|
|
11
|
-
onControlEvent: (arg: OnControlEventArg) => void;
|
|
12
|
-
onContainerEvent: (arg: OnContainerEventArg) => void;
|
|
13
|
-
onChapterEvent: (arg: OnChapterEventArg) => (() => ChangeChapterArg<"chapter">) | (() => ContinuePlaybackArg<"chapter">) | (() => OpenURIArg<"chapter">) | undefined;
|
|
14
|
-
onExpectEvent: <T extends keyof ActionMap>(arg: OnExpectEventArg<T>) => void;
|
|
15
|
-
expectEventHandler: <T extends keyof ActionMap>(arg: ExpectEventHandlerArg<T>) => void;
|
|
16
|
-
setManifestChapterEvents: (chapter: Chapter) => void;
|
|
17
|
-
setManifestContainerEvents: (arg: SetManifestContainerEventsArg) => void;
|
|
18
|
-
stopExpect: () => void;
|
|
19
|
-
state: {
|
|
20
|
-
isExpect: boolean;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
export type SelectBranchesType = typeof SelectBranches;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import type { ChapterContainer, Control, ChapterBranch, ControlEvent, ContainerEvent, ChapterEvent } from "../../../manifest";
|
|
2
|
-
import type { EventEmitter } from "../../../utils/EventEmitter";
|
|
3
|
-
import type { IPlayer } from "@vkontakte/videoplayer-core";
|
|
4
|
-
import type { InteractiveEventsType } from "./InteractiveEvents";
|
|
5
|
-
import type { GlobalEvents } from "./events";
|
|
6
|
-
import type { Nullable } from "@vkontakte/videoplayer-shared";
|
|
7
|
-
export type SubjectName = "chapter" | "container" | "control";
|
|
8
|
-
export type AfterExpectActionType = "after-expect";
|
|
9
|
-
export type Behaviour = "change-chapter" | "change-manifest";
|
|
10
|
-
export type ControlAfterExpectCallbackType = () => ExpectEventHandlerArg<"control">;
|
|
11
|
-
export type SelectBranchesArg = {
|
|
12
|
-
globalEventEmitter: EventEmitter;
|
|
13
|
-
globalEvents: GlobalEvents;
|
|
14
|
-
player: IPlayer;
|
|
15
|
-
interactiveEvents: InteractiveEventsType;
|
|
16
|
-
};
|
|
17
|
-
export type OnControlEventArg = {
|
|
18
|
-
action: ControlEvent["action"];
|
|
19
|
-
controlType: Control["type"];
|
|
20
|
-
controlId: Control["id"];
|
|
21
|
-
containerId: ChapterContainer["id"];
|
|
22
|
-
onEvent: AnyFn;
|
|
23
|
-
branches?: ChapterBranch[];
|
|
24
|
-
isEOV?: () => boolean;
|
|
25
|
-
isDisabled?: () => boolean;
|
|
26
|
-
};
|
|
27
|
-
export type OnContainerEventArg = {
|
|
28
|
-
action: ContainerEvent["action"];
|
|
29
|
-
container: ChapterContainer;
|
|
30
|
-
autoSelected?: boolean;
|
|
31
|
-
branches?: ChapterBranch[];
|
|
32
|
-
isEOV?: boolean;
|
|
33
|
-
};
|
|
34
|
-
export type OnChapterEventArg = {
|
|
35
|
-
action: ChapterEvent["action"];
|
|
36
|
-
chapterId: string;
|
|
37
|
-
branches?: ChapterBranch[];
|
|
38
|
-
};
|
|
39
|
-
export type SetManifestContainerEventsArg = {
|
|
40
|
-
container: ChapterContainer;
|
|
41
|
-
branches: ChapterBranch[];
|
|
42
|
-
isEOV?: boolean;
|
|
43
|
-
};
|
|
44
|
-
export type AnyAction = ControlEvent["action"] | ContainerEvent["action"] | ChapterEvent["action"];
|
|
45
|
-
export type ActionMap = {
|
|
46
|
-
control: ControlEvent["action"];
|
|
47
|
-
container: ContainerEvent["action"];
|
|
48
|
-
chapter: ChapterEvent["action"];
|
|
49
|
-
};
|
|
50
|
-
export type SubjectType<T extends keyof ActionMap> = T extends "control" ? Control["type"] : undefined;
|
|
51
|
-
export type EventActionCommon<T extends keyof ActionMap> = {
|
|
52
|
-
subjectId: string;
|
|
53
|
-
subjectName: T;
|
|
54
|
-
subjectType?: SubjectType<T>;
|
|
55
|
-
};
|
|
56
|
-
export type EventActionCommonWithAction<T extends keyof ActionMap> = EventActionCommon<T> & {
|
|
57
|
-
action: ActionMap[T];
|
|
58
|
-
};
|
|
59
|
-
export type OpenURIArg<T extends keyof ActionMap> = EventActionCommonWithAction<T> & {
|
|
60
|
-
payload: {
|
|
61
|
-
URI?: Nullable<string>;
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
export type ChangeManifestArg<T extends keyof ActionMap> = EventActionCommonWithAction<T> & {
|
|
65
|
-
payload: {
|
|
66
|
-
behaviour?: Behaviour;
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
export type ChangeChapterArg<T extends keyof ActionMap> = EventActionCommonWithAction<T> & {
|
|
70
|
-
payload: {
|
|
71
|
-
chapterId: string;
|
|
72
|
-
autoSelect: boolean;
|
|
73
|
-
behaviour?: Behaviour;
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
export type ContinuePlaybackArg<T extends keyof ActionMap> = EventActionCommonWithAction<T>;
|
|
77
|
-
export type OnExpectEventArg<T extends keyof ActionMap> = EventActionCommon<T>;
|
|
78
|
-
export type ExpectEventHandlerArg<T extends keyof ActionMap> = EventActionCommon<T>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ErrorCategoryEnum, ErrorSeverityEnum } from "../../../types";
|
|
2
|
-
import { CustomError } from "../../../utils/Error";
|
|
3
|
-
import type { Subject } from "@vkontakte/videoplayer-shared";
|
|
4
|
-
type EmitOnErrorArg = {
|
|
5
|
-
emitter$: Subject<CustomError>;
|
|
6
|
-
error?: unknown;
|
|
7
|
-
subjectId?: string;
|
|
8
|
-
message?: string;
|
|
9
|
-
severity?: ErrorSeverityEnum;
|
|
10
|
-
category?: ErrorCategoryEnum;
|
|
11
|
-
};
|
|
12
|
-
export declare function emitOnError({ emitter$, error, subjectId, message, severity, category }: EmitOnErrorArg): void;
|
|
13
|
-
export {};
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import type { Subject } from "@vkontakte/videoplayer-shared";
|
|
2
|
-
import type { ChapterChangedData, EachTickData, PlayerChangedData } from "../types";
|
|
3
|
-
import type { CustomError } from "../../../utils/Error";
|
|
4
|
-
import type { Manifest } from "../../../manifest";
|
|
5
|
-
import type { TInteractiveRangeEndedEvent, TInteractivesActionChoiceEvent, TInteractivesActionExecutionEvent, TInteractivesContainerRemoved, TInteractivesContainerFakeRemoved, SubjectName, TInteractivesVisibility } from "./events.types";
|
|
6
|
-
export interface GlobalEvents {
|
|
7
|
-
noInteraction$: Subject<void>;
|
|
8
|
-
graphVisibilityChanged$: Subject<boolean>;
|
|
9
|
-
watchAgainIsClicked$: Subject<string>;
|
|
10
|
-
chapterChanged$: Subject<ChapterChangedData>;
|
|
11
|
-
playerChanged$: Subject<PlayerChangedData>;
|
|
12
|
-
error$: Subject<CustomError>;
|
|
13
|
-
eachTick$: Subject<EachTickData>;
|
|
14
|
-
manifestChanged$: Subject<Manifest>;
|
|
15
|
-
interactiveRangeEnded$: Subject<TInteractiveRangeEndedEvent>;
|
|
16
|
-
interactiveContainerRemoved$: Subject<TInteractivesContainerRemoved>;
|
|
17
|
-
interactiveContainerFakeRemoved$: Subject<TInteractivesContainerFakeRemoved>;
|
|
18
|
-
interactiveActionExecution$: Subject<TInteractivesActionExecutionEvent<SubjectName>>;
|
|
19
|
-
interactiveActionChoice$: Subject<TInteractivesActionChoiceEvent<SubjectName>>;
|
|
20
|
-
interactiveVisibilityChanged$: Subject<TInteractivesVisibility<"container">>;
|
|
21
|
-
}
|
|
22
|
-
export declare const EVENT_NAMES: {
|
|
23
|
-
/**
|
|
24
|
-
* @deprecated Используйте interactivesInstance.events.graphVisibilityChanged$
|
|
25
|
-
* & interactivesInstance.events.watchAgainIsClicked$
|
|
26
|
-
*/
|
|
27
|
-
readonly graph: "graph";
|
|
28
|
-
/**
|
|
29
|
-
* @deprecated Используйте interactivesInstance.events
|
|
30
|
-
*/
|
|
31
|
-
readonly interactives: "interactives";
|
|
32
|
-
/**
|
|
33
|
-
* @deprecated Используйте interactivesInstance.events.chapterChanged$
|
|
34
|
-
*/
|
|
35
|
-
readonly chapterChanged: "chapter-changed";
|
|
36
|
-
/**
|
|
37
|
-
* @deprecated Используйте interactivesInstance.events.playerChanged$
|
|
38
|
-
*/
|
|
39
|
-
readonly playerChanged: "player-changed";
|
|
40
|
-
/**
|
|
41
|
-
* @deprecated Используйте interactivesInstance.events.manifestChanged$
|
|
42
|
-
*/
|
|
43
|
-
readonly manifestChanged: "manifest-changed";
|
|
44
|
-
/**
|
|
45
|
-
* @deprecated Используйте interactivesInstance.events.error$
|
|
46
|
-
*/
|
|
47
|
-
readonly errors: "errors";
|
|
48
|
-
readonly eachTick: "eachTick";
|
|
49
|
-
readonly historyInited: "history-inited";
|
|
50
|
-
readonly historyDestroyed: "history-destroyed";
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* @deprecated Используйте interactivesInstance.events.graphVisibilityChanged$ &
|
|
54
|
-
* interactivesInstance.events.watchAgainIsClicked$
|
|
55
|
-
*/
|
|
56
|
-
export declare const graphEventTypes: {
|
|
57
|
-
readonly visibility: "visibility";
|
|
58
|
-
readonly watchAgainClicked: "watchAgainClicked";
|
|
59
|
-
};
|
|
60
|
-
/**
|
|
61
|
-
* @deprecated use InteractivesEventTypes enum instead
|
|
62
|
-
*/
|
|
63
|
-
export declare const interactivesEventTypes: {
|
|
64
|
-
readonly actionChoiceCanceled: "action-choice-canceled";
|
|
65
|
-
readonly actionChoice: "action-choice";
|
|
66
|
-
readonly actionExecution: "action-execution";
|
|
67
|
-
readonly visibility: "visibility";
|
|
68
|
-
readonly containerRemoved: "container-removed";
|
|
69
|
-
readonly rangeEnded: "range-ended";
|
|
70
|
-
};
|
|
71
|
-
export declare enum InteractivesEventTypes {
|
|
72
|
-
ACTION_CHOICE_CANCELED = "action-choice-canceled",
|
|
73
|
-
ACTION_CHOICE = "action-choice",
|
|
74
|
-
ACTION_EXECUTION = "action-execution",
|
|
75
|
-
VISIBILITY = "visibility",
|
|
76
|
-
CONTAINER_REMOVED = "container-removed",
|
|
77
|
-
CONTAINER_FAKE_REMOVED = "container-fake-removed",
|
|
78
|
-
RANGE_ENDED = "range-ended"
|
|
79
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { SubjectName, ActionMap, SubjectType, AfterExpectActionType, Behaviour } from "./SelectBranches.types";
|
|
2
|
-
import type { InteractivesEventTypes } from "./events";
|
|
3
|
-
import type { EventActionTypes } from "../../../manifest";
|
|
4
|
-
import type { ControlEvent, ContainerEvent, ChapterEvent, ChapterContainer, Control } from "../../../manifest";
|
|
5
|
-
import type { InteractiveRange } from "./getInteractiveRanges";
|
|
6
|
-
export type { SubjectName };
|
|
7
|
-
type InteractivesEventTypesValues = `${InteractivesEventTypes}`;
|
|
8
|
-
type InteractivesEventTypesValuesChapter = InteractivesEventTypes.ACTION_CHOICE | InteractivesEventTypes.ACTION_CHOICE_CANCELED | InteractivesEventTypes.ACTION_EXECUTION;
|
|
9
|
-
type InteractivesEventTypesValuesContainer = InteractivesEventTypesValues;
|
|
10
|
-
type InteractivesEventTypesValuesControl = InteractivesEventTypesValuesChapter | InteractivesEventTypes.VISIBILITY;
|
|
11
|
-
type InteractiveEventType<T extends SubjectName> = T extends "container" ? InteractivesEventTypesValuesContainer : InteractivesEventTypesValuesControl;
|
|
12
|
-
type TInteractiveCommon<
|
|
13
|
-
T extends SubjectName,
|
|
14
|
-
U extends InteractiveEventType<T>
|
|
15
|
-
> = {
|
|
16
|
-
subjectId: string;
|
|
17
|
-
subjectName: T;
|
|
18
|
-
type: U;
|
|
19
|
-
};
|
|
20
|
-
export type TInteractivesVisibility<T extends Exclude<SubjectName, "chapter">> = TInteractiveCommon<T, InteractivesEventTypes.VISIBILITY> & {
|
|
21
|
-
visibility: boolean;
|
|
22
|
-
isFirst?: boolean;
|
|
23
|
-
};
|
|
24
|
-
type EventActionTypesValues = `${EventActionTypes}`;
|
|
25
|
-
export type TInteractiveRangeEndedEvent = {
|
|
26
|
-
type: InteractivesEventTypes.RANGE_ENDED;
|
|
27
|
-
payload: InteractiveRange;
|
|
28
|
-
};
|
|
29
|
-
type NonChapterChangeEvents = EventActionTypes.openURI | EventActionTypes.continuePlayback | EventActionTypes.expect;
|
|
30
|
-
type TInteractivesActionExecEventPayload<T extends EventActionTypesValues> = T extends Exclude<EventActionTypesValues, NonChapterChangeEvents> ? Partial<{
|
|
31
|
-
chapterId: string;
|
|
32
|
-
autoSelect: boolean;
|
|
33
|
-
behaviour: Behaviour;
|
|
34
|
-
manifestURL: string;
|
|
35
|
-
}> : undefined;
|
|
36
|
-
export type TInteractivesActionExecutionEvent<T extends SubjectName> = TInteractiveCommon<T, InteractivesEventTypes.ACTION_EXECUTION> & {
|
|
37
|
-
actionType: ActionMap[T]["type"] | AfterExpectActionType;
|
|
38
|
-
subjectType?: SubjectType<T>;
|
|
39
|
-
payload?: TInteractivesActionExecEventPayload<ActionMap[T]["type"]>;
|
|
40
|
-
};
|
|
41
|
-
type TControlPayloadExtra = {
|
|
42
|
-
containerId: string;
|
|
43
|
-
invokeImmediately: boolean;
|
|
44
|
-
};
|
|
45
|
-
type TInteractivesActionChoiceEventPayload<T extends SubjectName> = T extends "chapter" ? ChapterEvent["action"]["args"] : T extends "container" ? ContainerEvent["action"]["args"] & Pick<TControlPayloadExtra, "invokeImmediately"> : ControlEvent["action"]["args"] & TControlPayloadExtra;
|
|
46
|
-
type TSubjectTypeValues<T extends SubjectName> = T extends "chapter" ? undefined : T extends "container" ? ChapterContainer["type"] : Control["type"];
|
|
47
|
-
export type TInteractivesActionChoiceEvent<T extends SubjectName> = TInteractiveCommon<T, InteractivesEventTypes.ACTION_CHOICE | InteractivesEventTypes.ACTION_CHOICE_CANCELED> & {
|
|
48
|
-
subjectType?: TSubjectTypeValues<T>;
|
|
49
|
-
actionType: EventActionTypesValues;
|
|
50
|
-
payload: TInteractivesActionChoiceEventPayload<T>;
|
|
51
|
-
};
|
|
52
|
-
export type TInteractivesContainerRemoved = TInteractiveCommon<"container", InteractivesEventTypes.CONTAINER_REMOVED>;
|
|
53
|
-
export type TInteractivesContainerFakeRemoved = TInteractiveCommon<"container", InteractivesEventTypes.CONTAINER_FAKE_REMOVED> & {
|
|
54
|
-
removeAllOpenURI: boolean;
|
|
55
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
type Reverse<T extends unknown[]> = T extends [infer First, ...infer Rest] ? [...Reverse<Rest>, First] : T;
|
|
2
|
-
export declare function reverseArgs<Fn extends AnyFn>(fn: Fn): (...args: Reverse<Parameters<Fn>>) => ReturnType<Fn>;
|
|
3
|
-
export declare function partial<
|
|
4
|
-
T extends unknown[],
|
|
5
|
-
U extends unknown[],
|
|
6
|
-
R
|
|
7
|
-
>(fn: (...args: [...T, ...U]) => R, ...presetArgs: T): (...laterArgs: U) => R;
|
|
8
|
-
export declare function partial<
|
|
9
|
-
T extends Record<string, unknown>,
|
|
10
|
-
P extends Partial<T>
|
|
11
|
-
>(fn: (args: T) => unknown, presetArgs: P): (laterArgs: Omit<T, keyof P>) => ReturnType<typeof fn>;
|
|
12
|
-
export {};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { type Control } from "../../../manifest";
|
|
2
|
-
import { type Dimensions } from "../controls";
|
|
3
|
-
export declare const classnamesPrefix = "interactive";
|
|
4
|
-
export declare const controlStylesFallbacks: {
|
|
5
|
-
textColor: string;
|
|
6
|
-
textSize: number;
|
|
7
|
-
textContent: string;
|
|
8
|
-
roundCorners: number;
|
|
9
|
-
borderWidth: number;
|
|
10
|
-
borderWidthRawValue: string;
|
|
11
|
-
roundCornersRawValue: string;
|
|
12
|
-
borderColor: string;
|
|
13
|
-
borderAlpha: number;
|
|
14
|
-
backgroundColor: string;
|
|
15
|
-
backgroundAlpha: number;
|
|
16
|
-
innerSizesDependOn: string;
|
|
17
|
-
angle: number;
|
|
18
|
-
shadowColorLight: string;
|
|
19
|
-
shadowColorDark: string;
|
|
20
|
-
shadowColorAlpha: number;
|
|
21
|
-
};
|
|
22
|
-
type ControlStylesFallbacks = typeof controlStylesFallbacks;
|
|
23
|
-
export declare enum ALIGN_ITEMS {
|
|
24
|
-
top = "flex-start",
|
|
25
|
-
bottom = "flex-end",
|
|
26
|
-
center = "center"
|
|
27
|
-
}
|
|
28
|
-
export declare enum JUSTIFY_CONTENT {
|
|
29
|
-
start = "flex-start",
|
|
30
|
-
end = "flex-end",
|
|
31
|
-
center = "center"
|
|
32
|
-
}
|
|
33
|
-
export type SetTextPositionStylesProps = {
|
|
34
|
-
target: HTMLElement;
|
|
35
|
-
props: Control["props"]["text"] & {
|
|
36
|
-
alignment: Control["layoutParams"]["alignment"];
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
export declare const setTextPositionStyles: ({ target, props }: SetTextPositionStylesProps) => void;
|
|
40
|
-
type SetTextStylesProps = {
|
|
41
|
-
target: HTMLElement;
|
|
42
|
-
props: Control["props"];
|
|
43
|
-
fallback: ControlStylesFallbacks;
|
|
44
|
-
dependsOn: Dimensions;
|
|
45
|
-
};
|
|
46
|
-
export declare const setTextStyles: ({ target, props, fallback, dependsOn }: SetTextStylesProps) => void;
|
|
47
|
-
type SetBackgroundStylesProps = {
|
|
48
|
-
target: HTMLElement;
|
|
49
|
-
props: Control["props"];
|
|
50
|
-
fallback: ControlStylesFallbacks;
|
|
51
|
-
};
|
|
52
|
-
export declare const setBackgroundStyles: ({ target, props, fallback }: SetBackgroundStylesProps) => void;
|
|
53
|
-
type SetBorderStylesProps = {
|
|
54
|
-
target: HTMLElement;
|
|
55
|
-
props: Control["props"];
|
|
56
|
-
fallback: ControlStylesFallbacks;
|
|
57
|
-
dependsOn: Dimensions;
|
|
58
|
-
useRawValues?: boolean;
|
|
59
|
-
};
|
|
60
|
-
export declare const setBorderStyles: ({ target, props, fallback, dependsOn, useRawValues }: SetBorderStylesProps) => void;
|
|
61
|
-
type SetShadowStylesProps = {
|
|
62
|
-
target: HTMLElement;
|
|
63
|
-
props?: Control["props"];
|
|
64
|
-
fallback: ControlStylesFallbacks;
|
|
65
|
-
isDark: boolean;
|
|
66
|
-
baseDimension: string;
|
|
67
|
-
};
|
|
68
|
-
export declare const setShadowStyles: ({ target, isDark, baseDimension, fallback }: SetShadowStylesProps) => void;
|
|
69
|
-
type SetAngleProps = {
|
|
70
|
-
target: HTMLElement;
|
|
71
|
-
fallback: ControlStylesFallbacks;
|
|
72
|
-
layoutParams: Control["layoutParams"];
|
|
73
|
-
};
|
|
74
|
-
export declare const setAngle: ({ target, layoutParams, fallback }: SetAngleProps) => void;
|
|
75
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { movikaProjectIdLoader } from "./movikaProjectIdLoader";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { movikaProjectIdLoader } from "./movikaProjectIdLoader";
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { GetVKVideoParams, VKVideoLoaderInterface } from "./types";
|
|
2
|
-
export declare class CustomVkVideoLoader implements VKVideoLoaderInterface {
|
|
3
|
-
private _requestData;
|
|
4
|
-
private _mediaMap;
|
|
5
|
-
private _abortController;
|
|
6
|
-
constructor(options: GetVKVideoParams);
|
|
7
|
-
resolve({ actions, result, errors, ...args }: Record<string, any>): Promise<Promise<Record<string, any>>>;
|
|
8
|
-
private _transform;
|
|
9
|
-
private _send;
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { CustomVkVideoLoader } from "./CustomVkVideoLoader";
|