@vkontakte/videoplayer 1.0.9 → 1.0.95-dev.e4134bc49.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 (180) hide show
  1. package/es2015.cjs +20 -0
  2. package/es2015.esm.js +18 -4
  3. package/esnext.cjs +20 -0
  4. package/esnext.esm.js +18 -4
  5. package/evergreen.esm.js +20 -0
  6. package/package.json +38 -9
  7. package/types/VKVideoPlayer/HTMLElement.d.ts +2 -0
  8. package/types/VKVideoPlayer/defaultConfig.d.ts +5 -0
  9. package/types/VKVideoPlayer/index.svelte.d.ts +211 -0
  10. package/types/components/Ads/admanWrapper.d.ts +84 -0
  11. package/types/components/Ads/types.d.ts +20 -0
  12. package/types/components/Ads/utils.d.ts +6 -0
  13. package/types/components/Controls/contants/desktopButtonsLeftIds.d.ts +10 -0
  14. package/types/components/Controls/contants/desktopButtonsLeftWeights.d.ts +2 -0
  15. package/types/components/Controls/contants/desktopButtonsRightIds.d.ts +11 -0
  16. package/types/components/Controls/contants/desktopButtonsRightWeights.d.ts +2 -0
  17. package/types/components/Controls/types.d.ts +41 -0
  18. package/types/components/Controls/utils/isInnerButtonGuard.d.ts +2 -0
  19. package/types/components/Icons/constants.d.ts +8 -0
  20. package/types/components/Icons/utils.d.ts +2 -0
  21. package/types/components/Menus/constants/contextMenuItemIds.d.ts +11 -0
  22. package/types/components/Menus/constants/contextMenuItemWeights.d.ts +2 -0
  23. package/types/components/Menus/constants/defaultSubMenuMinWidth.d.ts +1 -0
  24. package/types/components/Menus/constants/index.d.ts +4 -0
  25. package/types/components/Menus/constants/openSubMenuItemsIds.d.ts +3 -0
  26. package/types/components/Menus/constants/settingsMenuItemIds.d.ts +11 -0
  27. package/types/components/Menus/constants/settingsMenuItemWeights.d.ts +2 -0
  28. package/types/components/Menus/constants/subMenuIds.d.ts +8 -0
  29. package/types/components/Menus/constants/topOffset.d.ts +1 -0
  30. package/types/components/Menus/subMenuTabs/rootMenuItems.d.ts +33 -0
  31. package/types/components/Menus/subMenuTabs/sharedMenuItems.d.ts +17 -0
  32. package/types/components/Menus/subMenuTabs/subMenuItems.d.ts +7 -0
  33. package/types/components/Menus/subMenuTabs/types.d.ts +151 -0
  34. package/types/components/Menus/subMenuTabs/utils.d.ts +3 -0
  35. package/types/components/Menus/types.d.ts +96 -0
  36. package/types/components/Menus/utils/constants.d.ts +1 -0
  37. package/types/components/Menus/utils/getCurrentQualityDisplayValue.d.ts +21 -0
  38. package/types/components/Menus/utils/getQualityIcon.d.ts +3 -0
  39. package/types/components/Menus/utils/getSubMenusStack.svelte.d.ts +10 -0
  40. package/types/components/Menus/utils/menuNavigation.d.ts +20 -0
  41. package/types/components/Qoe/constants.d.ts +9 -0
  42. package/types/components/Qoe/utils.d.ts +1 -0
  43. package/types/components/Root/types.d.ts +47 -0
  44. package/types/components/Root/utils.d.ts +2 -0
  45. package/types/components/Timeline/PreviewTrack/useTransitionToPreviewTrack.svelte.d.ts +21 -0
  46. package/types/components/Timeline/consts.d.ts +4 -0
  47. package/types/components/Tooltips/TimelinePreview.utils.d.ts +1 -0
  48. package/types/components/shared/interpolateUtils.d.ts +7 -0
  49. package/types/config.d.ts +315 -0
  50. package/types/constans/controls.d.ts +28 -0
  51. package/types/constans/debounce-timers.d.ts +1 -0
  52. package/types/constans/grid.d.ts +14 -0
  53. package/types/constans/index.d.ts +8 -0
  54. package/types/constans/interactives.d.ts +7 -0
  55. package/types/constans/keyboard.d.ts +50 -0
  56. package/types/constans/lang.d.ts +2 -0
  57. package/types/constans/storage-keys.d.ts +1 -0
  58. package/types/constans/subtitles.d.ts +1 -0
  59. package/types/constans/throttle-timers.d.ts +1 -0
  60. package/types/env.d.ts +2 -0
  61. package/types/index.d.ts +16 -68
  62. package/types/services/statistics.d.ts +17 -0
  63. package/types/store/composition.d.ts +32 -0
  64. package/types/store/index.d.ts +7 -0
  65. package/types/store/modules/fakeIsPlayingStore/fakeIsPlayingStore.module.d.ts +3 -0
  66. package/types/store/modules/fakeIsPlayingStore/fakeIsPlayingStore.store.d.ts +26 -0
  67. package/types/store/modules/fakeIsPlayingStore/fakeIsPlayingStore.token.d.ts +3 -0
  68. package/types/store/modules/fakeIsPlayingStore/index.d.ts +3 -0
  69. package/types/store/modules/graphIsOpenedStore/graphIsOpenedStore.module.d.ts +3 -0
  70. package/types/store/modules/graphIsOpenedStore/graphIsOpenedStore.store.d.ts +50 -0
  71. package/types/store/modules/graphIsOpenedStore/graphIsOpenedStore.token.d.ts +3 -0
  72. package/types/store/modules/graphIsOpenedStore/index.d.ts +3 -0
  73. package/types/store/modules/index.d.ts +20 -0
  74. package/types/store/modules/infrastructure/index.d.ts +3 -0
  75. package/types/store/modules/infrastructure/infrastructure.module.d.ts +21 -0
  76. package/types/store/modules/infrastructure/infrastructure.token.d.ts +26 -0
  77. package/types/store/modules/interactiveControlsOpacityStore/index.d.ts +3 -0
  78. package/types/store/modules/interactiveControlsOpacityStore/interactiveControlsOpacityStore.module.d.ts +3 -0
  79. package/types/store/modules/interactiveControlsOpacityStore/interactiveControlsOpacityStore.store.d.ts +34 -0
  80. package/types/store/modules/interactiveControlsOpacityStore/interactiveControlsOpacityStore.token.d.ts +3 -0
  81. package/types/store/modules/notificationsStore/index.d.ts +3 -0
  82. package/types/store/modules/notificationsStore/notificationsStore.module.d.ts +3 -0
  83. package/types/store/modules/notificationsStore/notificationsStore.store.d.ts +34 -0
  84. package/types/store/modules/notificationsStore/notificationsStore.token.d.ts +3 -0
  85. package/types/store/modules/pictureInPictureStore/index.d.ts +3 -0
  86. package/types/store/modules/pictureInPictureStore/pictureInPictureStore.module.d.ts +3 -0
  87. package/types/store/modules/pictureInPictureStore/pictureInPictureStore.store.d.ts +42 -0
  88. package/types/store/modules/pictureInPictureStore/pictureInPictureStore.token.d.ts +3 -0
  89. package/types/store/modules/qoeStore/index.d.ts +3 -0
  90. package/types/store/modules/qoeStore/qoeStore.module.d.ts +3 -0
  91. package/types/store/modules/qoeStore/qoeStore.store.d.ts +4 -0
  92. package/types/store/modules/qoeStore/qoeStore.token.d.ts +3 -0
  93. package/types/store/modules/qoeStore/types.d.ts +24 -0
  94. package/types/store/modules/seekToInteractiveDisabledTooltipStore/index.d.ts +3 -0
  95. package/types/store/modules/seekToInteractiveDisabledTooltipStore/seekToInteractiveDisabledTooltipStore.module.d.ts +3 -0
  96. package/types/store/modules/seekToInteractiveDisabledTooltipStore/seekToInteractiveDisabledTooltipStore.store.d.ts +26 -0
  97. package/types/store/modules/seekToInteractiveDisabledTooltipStore/seekToInteractiveDisabledTooltipStore.token.d.ts +3 -0
  98. package/types/store/modules/showInteractiveTimeIndicatorTooltipStore/index.d.ts +3 -0
  99. package/types/store/modules/showInteractiveTimeIndicatorTooltipStore/showInteractiveTimeIndicatorTooltipStore.module.d.ts +3 -0
  100. package/types/store/modules/showInteractiveTimeIndicatorTooltipStore/showInteractiveTimeIndicatorTooltipStore.store.d.ts +44 -0
  101. package/types/store/modules/showInteractiveTimeIndicatorTooltipStore/showInteractiveTimeIndicatorTooltipStore.token.d.ts +3 -0
  102. package/types/store/modules/utils.d.ts +6 -0
  103. package/types/store/types.d.ts +419 -0
  104. package/types/store/utils.d.ts +53 -0
  105. package/types/translation/index.d.ts +6 -0
  106. package/types/translation/labels.d.ts +3 -0
  107. package/types/translation/packs/en.d.ts +3 -0
  108. package/types/translation/packs/ru.d.ts +3 -0
  109. package/types/translation/types.d.ts +8 -0
  110. package/types/types/ads.d.ts +20 -0
  111. package/types/types/index.d.ts +634 -0
  112. package/types/types/qoe.d.ts +59 -0
  113. package/types/types/svg.d.d.ts +5 -0
  114. package/types/types/tmp.d.ts +1 -0
  115. package/types/utils/CaptionsPrepared.d.ts +17 -0
  116. package/types/utils/WebVttParser.d.ts +19 -0
  117. package/types/utils/attachments/defferedDisableByCondition.d.ts +4 -0
  118. package/types/utils/changeVolume.d.ts +9 -0
  119. package/{utils → types/utils}/clipboard.d.ts +1 -1
  120. package/{utils → types/utils}/dom.d.ts +3 -2
  121. package/types/utils/elementHelpers.d.ts +4 -0
  122. package/types/utils/fetchFile.d.ts +1 -0
  123. package/types/utils/findCurrentSubtltlePhrase.d.ts +2 -0
  124. package/{utils → types/utils}/formatSeconds.d.ts +1 -1
  125. package/types/utils/fullscreen.d.ts +29 -0
  126. package/types/utils/getActualEpisode.d.ts +10 -0
  127. package/types/utils/getControlInfo.d.ts +5 -0
  128. package/types/utils/getHotKeyMapData.d.ts +2 -0
  129. package/types/utils/grid.d.ts +6 -0
  130. package/types/utils/hooks/useIosSafariFullscreen.d.ts +6 -0
  131. package/types/utils/hooks/useIosSafariFullscreenSubtitles.d.ts +7 -0
  132. package/types/utils/keyboardHandleCases.d.ts +2 -0
  133. package/types/utils/landscapeUtils.d.ts +1 -0
  134. package/types/utils/notificationShowManager.d.ts +10 -0
  135. package/types/utils/roundFps.d.ts +1 -0
  136. package/types/utils/sanitizeHtml.d.ts +5 -0
  137. package/types/utils/sorts.d.ts +5 -0
  138. package/types/utils/stack/index.d.ts +9 -0
  139. package/types/utils/stack/node.d.ts +5 -0
  140. package/types/utils/subtitleLanguages.d.ts +3 -0
  141. package/types/utils/subtitles.d.ts +10 -0
  142. package/types/utils/timeout.d.ts +4 -0
  143. package/types/utils/updatePlayerControlBlocks.d.ts +3 -0
  144. package/types/utils/updatePlayerControlsInfo.d.ts +3 -0
  145. package/types/utils/userSettings.d.ts +58 -0
  146. package/types/utils/videoConfig.d.ts +6 -0
  147. package/types/utils/volumeChange.d.ts +5 -0
  148. package/types/utils/webAPI/annotationsApi/annotationsApi.d.ts +34 -0
  149. package/types/utils/webAPI/annotationsApi/errors.d.ts +7 -0
  150. package/types/utils/webAPI/focusLock.d.ts +34 -0
  151. package/types/utils/webAPI/focusManager.d.ts +17 -0
  152. package/types/utils/webAPI/language.d.ts +2 -0
  153. package/types/utils/webAPI/mediaSessionApi.d.ts +16 -0
  154. package/types/utils/webAPI/pictureInPictureApi/documentPictureInPictureApi.svelte.d.ts +47 -0
  155. package/types/utils/webAPI/pictureInPictureApi/factory.d.ts +3 -0
  156. package/types/utils/webAPI/pictureInPictureApi/index.d.ts +4 -0
  157. package/types/utils/webAPI/pictureInPictureApi/pictureInPictureApi.d.ts +49 -0
  158. package/types/utils/webAPI/pictureInPictureApi/types.d.ts +6 -0
  159. package/types/utils/webAPI/pictureInPictureApi/utils.d.ts +10 -0
  160. package/types/utils/webAPI/slotsApi.d.ts +53 -0
  161. package/VKVideoPlayer/index.d.ts +0 -38
  162. package/components/Ads/admanWrapper.d.ts +0 -71
  163. package/components/Ads/utils.d.ts +0 -1
  164. package/constans.d.ts +0 -31
  165. package/env.d.ts +0 -3
  166. package/es2015.cjs.js +0 -6
  167. package/es2018.cjs.js +0 -6
  168. package/es2018.esm.js +0 -6
  169. package/esnext.cjs.js +0 -6
  170. package/index.d.ts +0 -6
  171. package/store/index.d.ts +0 -110
  172. package/store/initStatistics.d.ts +0 -5
  173. package/store/utils.d.ts +0 -27
  174. package/utils/fullscreen.d.ts +0 -20
  175. package/utils/isios.d.ts +0 -1
  176. package/utils/roundFps.d.ts +0 -1
  177. package/utils/stack/index.d.ts +0 -9
  178. package/utils/stack/node.d.ts +0 -5
  179. package/utils/storage.d.ts +0 -5
  180. package/utils/volume.d.ts +0 -4
@@ -0,0 +1,151 @@
1
+ import type { UIType, VideoPlaybackRate, VideoQualityForRender, VideoQualityUI, VideoSubtitle } from "../../../types";
2
+ import type { IAudioStream, PlaybackRate, VideoQuality } from "@vkontakte/videoplayer-core";
3
+ import type { QualitySettingsAppliesTo } from "../../../utils/userSettings";
4
+ import type { TmpComponentType } from "../../../types/tmp";
5
+ export declare enum SharedSubMenuItemId {
6
+ QUALITY_OTHER = "quality-other-settings",
7
+ QUALITY_AUTO = "quality-auto",
8
+ QUALITY_APPLIANCE = "quality-appliance-settings",
9
+ QUALITY_HIGH = "quality-high",
10
+ QUALITY_TRAFFIC_SAVING = "quality-traffic-saving"
11
+ }
12
+ export declare enum SubMenuId {
13
+ PLAYBACK_RATE = "playback-rate",
14
+ QUALITY_SETTINGS = "quality-settings",
15
+ QUALITY_OTHER_SETTINGS = "quality-other-settings",
16
+ QUALITY_APPLIANCE = "quality-appliance",
17
+ AUDIO_TRACKS = "audio-tracks",
18
+ SUBTITLES = "subtitles"
19
+ }
20
+ export declare enum RootMenuId {
21
+ QUALITY_SETTINGS = "quality-settings",
22
+ TRAFFIC_SAVING_SWITCH = "traffic-saving-switch",
23
+ AUDIO_TRACKS = "audio-tracks-settings",
24
+ PLAYBACK_RATE = "playback-rate-settings",
25
+ SUBTITLES = "subtitles-settings",
26
+ DOWNLOAD = "download",
27
+ SHOW_SUPPORT = "show-support",
28
+ COPY_DATA = "copy-data",
29
+ DEBUG_INFO = "debug-info"
30
+ }
31
+ export type Context = {
32
+ closeSettingsMenu: () => void;
33
+ isMobile: boolean;
34
+ /**
35
+ * Скорость.
36
+ */
37
+ availablePlaybackRates: VideoPlaybackRate[];
38
+ selectPlaybackRate: (playbackRate: PlaybackRate) => void;
39
+ /**
40
+ * Качество.
41
+ */
42
+ selectQuality: (quality: VideoQualityUI, appliesTo: QualitySettingsAppliesTo) => void;
43
+ isAutoQualityEnabled: boolean;
44
+ isAutoQualityAvailable: boolean;
45
+ highQualityEnabled: boolean;
46
+ toggleHighQuality: (value: boolean, appliesTo: QualitySettingsAppliesTo) => void;
47
+ trafficSavingEnabled: boolean;
48
+ toggleTrafficSaving: (value: boolean, appliesTo: QualitySettingsAppliesTo) => void;
49
+ currentQuality: VideoQuality;
50
+ availableQualities: VideoQualityForRender[];
51
+ /**
52
+ * Звуковые дорожки.
53
+ */
54
+ availableAudioStreams: IAudioStream[];
55
+ selectAudioLanguage: (stream: IAudioStream) => void;
56
+ currentAudioStream: IAudioStream | undefined;
57
+ /**
58
+ * Субтитры
59
+ */
60
+ availableSubtitlesList: VideoSubtitle[];
61
+ selectSubtitle: (subtitle: VideoSubtitle) => void;
62
+ isAudioChannelConfiguration: boolean;
63
+ };
64
+ export type SubMenuData = (context: Context) => {
65
+ title: string;
66
+ closeSettingsMenu?: () => void;
67
+ items: SubMenuItem[];
68
+ id: SubMenuId;
69
+ minWidth?: number;
70
+ };
71
+ export type SubMenuItem = SubMenuItemOpenSubMenu | SubMenuItemSelect;
72
+ type BaseSubMenuItem<U = any> = {
73
+ selected?: boolean;
74
+ valueComponent?: TmpComponentType;
75
+ valueComponentParams?: {
76
+ [key: string]: U;
77
+ };
78
+ bottomBordered?: boolean;
79
+ label?: string;
80
+ sublabel?: string;
81
+ ariaLabel?: string;
82
+ dataTestid?: string;
83
+ };
84
+ export type SubMenuItemOpenSubMenu = {
85
+ type: SubMenuItemType.OPEN_SUB_MENU;
86
+ children: SubMenuId;
87
+ id: SharedSubMenuItemId;
88
+ } & BaseSubMenuItem;
89
+ export type SubMenuItemSelect<T = any> = {
90
+ type: SubMenuItemType.SELECT_VALUE;
91
+ value: T;
92
+ dataValue?: T | keyof T;
93
+ selectItem: (value: T) => void;
94
+ } & BaseSubMenuItem;
95
+ interface BaseMenuItem<Id> {
96
+ id: Id;
97
+ weight: number;
98
+ ariaLabel?: string;
99
+ label: string;
100
+ }
101
+ export type IconPropsType = {
102
+ [key: string]: any;
103
+ };
104
+ interface BaseSettingsMenuItem extends BaseMenuItem<RootMenuId> {
105
+ icon: TmpComponentType;
106
+ iconProps?: IconPropsType;
107
+ isHiddenFor?: UIType[];
108
+ }
109
+ export declare enum MenuItemType {
110
+ OPEN_SUB_MENU = "OPEN_SUB_MENU",
111
+ CLICK = "CLICK",
112
+ SWITCH = "SWITCH"
113
+ }
114
+ export declare enum SubMenuItemType {
115
+ OPEN_SUB_MENU = "OPEN_SUB_MENU",
116
+ SELECT_VALUE = "SELECT_VALUE"
117
+ }
118
+ export interface OpenSubMenuSettingsMenuItem extends BaseSettingsMenuItem {
119
+ type: MenuItemType.OPEN_SUB_MENU;
120
+ value: string;
121
+ valueComponent?: TmpComponentType;
122
+ children: SubMenuId;
123
+ }
124
+ export interface ClickSettingsMenuItem extends BaseSettingsMenuItem {
125
+ type: MenuItemType.CLICK;
126
+ onClick: () => void;
127
+ }
128
+ export interface SwitchSettingsMenuItem extends BaseSettingsMenuItem {
129
+ type: MenuItemType.SWITCH;
130
+ onClick: (enabled: boolean) => void;
131
+ enabled: boolean;
132
+ tooltipText?: string;
133
+ maxTooltipWidth?: number;
134
+ }
135
+ export type AdditionalSwitchSettingsMenuItem = Omit<SwitchSettingsMenuItem, "icon" | "onClick"> & {
136
+ icon: string;
137
+ onChangeEnabled: (enabled: boolean) => void;
138
+ };
139
+ export type AdditionalClickSettingsMenuItem = Omit<SwitchSettingsMenuItem, "icon"> & {
140
+ icon: string;
141
+ };
142
+ export type SettingsMenuItem = OpenSubMenuSettingsMenuItem | ClickSettingsMenuItem | SwitchSettingsMenuItem;
143
+ export type AdditionalSettingsMenuItem = AdditionalSwitchSettingsMenuItem | AdditionalClickSettingsMenuItem;
144
+ export interface ContextMenuItem extends BaseMenuItem<string> {
145
+ onClick: () => void;
146
+ }
147
+ export type AdditionalContextMenuItem = ContextMenuItem;
148
+ export type MenuRefs = {
149
+ [key: string]: HTMLUListElement;
150
+ };
151
+ export {};
@@ -0,0 +1,3 @@
1
+ import { type QualitySettingsAppliesTo } from "../../../utils/userSettings";
2
+ export declare const getEnrichWithQualityAppliesTo: (appliesTo: QualitySettingsAppliesTo) => (<T>(fn: (value: T, appliesTo: QualitySettingsAppliesTo) => void) => (value: T) => void);
3
+ export declare function isDefined<T>(x: T | undefined): x is T;
@@ -0,0 +1,96 @@
1
+ import type { UIType } from "../../types";
2
+ import type { SubMenuIds } from "./constants/subMenuIds";
3
+ import type { TmpComponentType } from "../../types/tmp";
4
+ interface BaseMenuItem {
5
+ id: string;
6
+ weight: number;
7
+ ariaLabel?: string;
8
+ label: string;
9
+ }
10
+ interface BaseSettingsMenuItem extends BaseMenuItem {
11
+ icon: TmpComponentType | string;
12
+ isHiddenFor?: UIType[];
13
+ }
14
+ export declare enum MenuItemType {
15
+ OPEN_SUB_MENU = "OPEN_SUB_MENU",
16
+ CLICK = "CLICK",
17
+ SWITCH = "SWITCH"
18
+ }
19
+ export declare enum SubMenuItemType {
20
+ OPEN_SUB_MENU = "OPEN_SUB_MENU",
21
+ SELECT_VALUE = "SELECT_VALUE"
22
+ }
23
+ export interface OpenSubMenuSettingsMenuItem extends BaseSettingsMenuItem {
24
+ type: MenuItemType.OPEN_SUB_MENU;
25
+ subMenuId: SubMenuIds;
26
+ value: string;
27
+ valueComponent?: any;
28
+ getSubItemForFocus: () => HTMLLIElement;
29
+ }
30
+ export interface ClickSettingsMenuItem extends BaseSettingsMenuItem {
31
+ type: MenuItemType.CLICK;
32
+ onClick: () => void;
33
+ }
34
+ export interface SwitchSettingsMenuItem extends BaseSettingsMenuItem {
35
+ type: MenuItemType.SWITCH;
36
+ onClick: (enabled: boolean) => void;
37
+ enabled: boolean;
38
+ tooltipText?: string;
39
+ maxTooltipWidth?: number;
40
+ }
41
+ export type AdditionalSwitchSettingsMenuItem = Omit<SwitchSettingsMenuItem, "icon" | "onClick"> & {
42
+ icon: string;
43
+ onChangeEnabled: (enabled: boolean) => void;
44
+ };
45
+ export type AdditionalClickSettingsMenuItem = Omit<SwitchSettingsMenuItem, "icon"> & {
46
+ icon: string;
47
+ };
48
+ export type SettingsMenuItem = OpenSubMenuSettingsMenuItem | ClickSettingsMenuItem | SwitchSettingsMenuItem;
49
+ export type AdditionalSettingsMenuItem = AdditionalSwitchSettingsMenuItem | AdditionalClickSettingsMenuItem;
50
+ interface SubMenuItemBase<U = any> {
51
+ selected?: boolean;
52
+ valueComponent?: TmpComponentType;
53
+ valueComponentParams?: {
54
+ [key: string]: U;
55
+ };
56
+ bottomBordered?: boolean;
57
+ label?: string;
58
+ sublabel?: string;
59
+ ariaLabel?: string;
60
+ onClick?: () => void;
61
+ }
62
+ export interface SelectValueSubMenuItem<
63
+ T = any,
64
+ U = any
65
+ > extends SubMenuItemBase<U> {
66
+ type: SubMenuItemType.SELECT_VALUE;
67
+ value: T;
68
+ dataValue?: T | keyof T;
69
+ selectItem: (value: T) => void;
70
+ }
71
+ export interface OpenSubMenuSubMenuItem extends SubMenuItemBase {
72
+ type: SubMenuItemType.OPEN_SUB_MENU;
73
+ id: string;
74
+ subMenuId: SubMenuIds;
75
+ getSubItemForFocus?: () => HTMLLIElement;
76
+ }
77
+ export type SubMenuItem = SelectValueSubMenuItem | OpenSubMenuSubMenuItem;
78
+ export interface SubMenuList {
79
+ id: SubMenuIds;
80
+ parentItemId?: string;
81
+ items: SubMenuItem[];
82
+ returnFromSubMenu?: () => void;
83
+ ariaLabelReturnFromSubMenu?: string;
84
+ title: string;
85
+ closeSettingsMenu: () => void;
86
+ minWidth?: number;
87
+ onMount?: () => void;
88
+ }
89
+ export interface ContextMenuItem extends BaseMenuItem {
90
+ onClick: () => void;
91
+ }
92
+ export type AdditionalContextMenuItem = ContextMenuItem;
93
+ export type MenuRefs = {
94
+ [key: string]: HTMLUListElement;
95
+ };
96
+ export {};
@@ -0,0 +1 @@
1
+ export declare const FOCUS_HIDDEN_CLASS = "focus-hidden";
@@ -0,0 +1,21 @@
1
+ import { VideoQuality } from "@vkontakte/videoplayer-core";
2
+ import { type VideoQualityForRender } from "../../../types";
3
+ type Params = {
4
+ quality: VideoQuality;
5
+ availableQualities: VideoQualityForRender[];
6
+ };
7
+ export declare const getQualityDisplayValue: ({ quality, availableQualities }: Params) => string;
8
+ type CurrentQualityParams = {
9
+ isAutoQualityEnabled: boolean | undefined;
10
+ quality: VideoQuality | undefined;
11
+ availableQualities: VideoQualityForRender[];
12
+ };
13
+ export declare const getCurrentQualityDisplayValue: ({ quality, availableQualities, isAutoQualityEnabled }: CurrentQualityParams) => string;
14
+ type QualityWithPrefixParams = {
15
+ quality: VideoQuality | undefined;
16
+ availableQualities: VideoQualityForRender[];
17
+ prefix: string;
18
+ onlyPrefix: boolean;
19
+ };
20
+ export declare const getQualityWithPrefix: ({ quality, availableQualities, prefix, onlyPrefix }: QualityWithPrefixParams) => string;
21
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { VideoQualityUI } from "../../../types";
2
+ import type { TmpComponentType } from "../../../types/tmp";
3
+ export declare const getQualityIcon: (quality?: VideoQualityUI) => TmpComponentType | undefined;
@@ -0,0 +1,10 @@
1
+ import type { SubMenuId } from "../subMenuTabs/types";
2
+ /**
3
+ * Представляем цепочку открытия подменюшек стеком, таким образом можем открывать хоть сколько.
4
+ */
5
+ export declare const getSubMenusStack: () => {
6
+ readonly current: SubMenuId | null;
7
+ pushSubMenu: (subMenuId: SubMenuId) => void;
8
+ popSubMenu: () => void;
9
+ popAllSubMenus: () => void;
10
+ };
@@ -0,0 +1,20 @@
1
+ import { ProcessedKeysCodes } from "../../../constans";
2
+ import { type Writable } from "svelte/store";
3
+ import type { Position } from "../../../types";
4
+ export declare const eventStop: (event: Event) => void;
5
+ export declare const clearFocusHiddenClass: (target: HTMLElement) => void;
6
+ export declare const isChoseItemCase: (event: KeyboardEvent, extraKeys?: ProcessedKeysCodes[]) => boolean;
7
+ export declare const isKeyboardHandleCase: (event?: MouseEvent | PointerEvent) => boolean;
8
+ export declare const handleFocusReturnToBtn: (ref: HTMLButtonElement, menuVisible: boolean, openedByKeyboard$: Writable<boolean>) => Promise<void>;
9
+ export declare const handleFocusReturnToElem: (ref: HTMLButtonElement, menuVisible: boolean, openedByKeyboard$: Writable<boolean>) => Promise<void>;
10
+ export declare const handleFocusOnMenu: (ref: HTMLUListElement, menuVisible: boolean, isOpenedByKeyboard: boolean, isMobile?: boolean) => Promise<void>;
11
+ export declare const returnFocusToMenuItem: (refMenuItems: {
12
+ [key: string]: HTMLLIElement;
13
+ }, id: string) => Promise<void>;
14
+ export declare const handleKeyDownMainMenu: (event: KeyboardEvent, closeCallback: () => void) => void;
15
+ export declare const handleKeyDownOpenSubMenuItem: (event: KeyboardEvent, openSubmenuFn: () => void) => Promise<void>;
16
+ export declare const handleKeyDownSubMenu: (event: KeyboardEvent, returnFromSubMenu: () => void, closeSettingsMenuFn: () => void) => Promise<void>;
17
+ export declare const handleChoseMenuItem: (event: KeyboardEvent, selectFn: () => void) => void;
18
+ export declare const handleSwitchMenuItem: (event: KeyboardEvent, enabled: boolean, selectFn: (value: boolean) => void) => void;
19
+ export declare const getContextMenuPositionByButton: (btnRef: HTMLButtonElement) => Position;
20
+ export declare const getContextMenuPositionByHotKey: (overlayRef: HTMLDivElement | undefined) => Position;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Отступ снизу для контейнера опроса от нижнего края плеера.
3
+ * Включает высоту контролов и дополнительный отступ.
4
+ */
5
+ export declare const QOE_POLL_BOTTOM_OFFSET: number;
6
+ /**
7
+ * Верхний отступ для расчёта максимальной высоты опроса.
8
+ */
9
+ export declare const QOE_POLL_TOP_OFFSET: number;
@@ -0,0 +1 @@
1
+ export declare const stopPropagation: (e: MouseEvent | KeyboardEvent) => void;
@@ -0,0 +1,47 @@
1
+ import type { EnrichedStore } from "../../store";
2
+ import type { AdmanInitParams, IVideoData, IVKVideoPlayerConfig } from "../../types";
3
+ import type { IUIConfig } from "../../config";
4
+ import type { Interactives } from "@vkontakte/videoplayer-interactive";
5
+ import type KeyboardControls from "../KeyboardControls.svelte";
6
+ import type { AdmanWrapper } from "../Ads/admanWrapper";
7
+ export interface RootProps {
8
+ videoData: IVideoData;
9
+ store: EnrichedStore;
10
+ admanWrapper: AdmanWrapper;
11
+ videoConfig: IVKVideoPlayerConfig;
12
+ uiConfig: IUIConfig;
13
+ interactiveContainer: HTMLElement | undefined;
14
+ interactiveController: Interactives | undefined;
15
+ autoplay: boolean;
16
+ adsParams?: AdmanInitParams["params"];
17
+ isMobile: boolean;
18
+ showNextPrevButtons?: boolean;
19
+ nextButtonActive?: boolean;
20
+ prevButtonActive?: boolean;
21
+ endScreenVideoTitle?: string | undefined;
22
+ endScreenVideoThumb?: string | undefined;
23
+ isOneVideoPlaylist?: boolean;
24
+ shadowRootContainer: HTMLElement;
25
+ outerContainerRef: HTMLElement;
26
+ fullScreenTarget?: HTMLElement | undefined;
27
+ seekToInteractive?: () => void;
28
+ playPrevChapter?: () => void;
29
+ keyboardControls?: KeyboardControls | undefined;
30
+ needToRepeatPlaylist?: boolean;
31
+ getVideoDeeplink?: (timestamp: number) => string;
32
+ firstStart: (external?: boolean) => void;
33
+ seekTime: (Seconds: number) => void;
34
+ onDomReady: VoidFunction;
35
+ showEndScreen?: boolean;
36
+ }
37
+ export interface RootExports {
38
+ setPlayerStarted: (value: boolean) => void;
39
+ videoContainer?: HTMLElement;
40
+ keyboardControls?: {
41
+ focus: () => void;
42
+ handleExternalKeyboardEvent: (event: KeyboardEvent) => boolean;
43
+ };
44
+ }
45
+ export interface PersistentLayerExports {
46
+ startVideoChangedAnimation: (prev: boolean) => void;
47
+ }
@@ -0,0 +1,2 @@
1
+ import type { IUIConfig } from "../../config";
2
+ export declare function mapConfigStyle(options: IUIConfig["view"]): string | undefined;
@@ -0,0 +1,21 @@
1
+ type Params = {
2
+ onPreviewTrackOpened: () => void;
3
+ getTimelineRef: () => HTMLElement | undefined;
4
+ isHorizontal: boolean;
5
+ };
6
+ /**
7
+ * Координирует анимацию показа превью трека.
8
+ * Поднимает прогресс бар, опускает контролы, проявляет превью трек.
9
+ * Все строится вокруг progressToOpenTrack.
10
+ *
11
+ */
12
+ export declare const useTransitionToPreviewTrack: ({ onPreviewTrackOpened, getTimelineRef, isHorizontal }: Params) => {
13
+ progressBarY: () => number;
14
+ controlsY: () => number;
15
+ calculatedHeight: () => number;
16
+ onPointerDown: (e: PointerEvent) => void;
17
+ onPointerMove: (e: PointerEvent) => void;
18
+ onPointerUp: () => void;
19
+ closePreviewTrack: () => void;
20
+ };
21
+ export {};
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Сколько картинок показываем слева и справа от картинки, на которую указывает каретка с учетом картинки на которой находится каретка.
3
+ */
4
+ export declare const PREVIEW_IMAGE_BUFFER = 3;
@@ -0,0 +1 @@
1
+ export declare const isVerticallyAligned: (angle: number) => boolean;
@@ -0,0 +1,7 @@
1
+ type AllowedHTML = Record<string, boolean>;
2
+ /**
3
+ * В дальнейшем можно по надобности указывать возможные атрибуты.
4
+ */
5
+ export declare const DEFAULT_ALLOWED_HTML: AllowedHTML;
6
+ export declare const interpolateMessage: (message?: string, customAllowedHTML?: AllowedHTML) => string | undefined;
7
+ export {};