@vkontakte/videoplayer 1.1.95-dev.0bbcbb01d.0 → 1.1.95-dev.1313ba86c.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/videoplayer",
3
- "version": "1.1.95-dev.0bbcbb01d.0",
3
+ "version": "1.1.95-dev.1313ba86c.0",
4
4
  "author": "vk.com",
5
5
  "description": "Videoplayer based on the vk.com platform",
6
6
  "homepage": "https://vk.com",
@@ -43,9 +43,9 @@
43
43
  ],
44
44
  "dependencies": {
45
45
  "@adtech/rbadman": "2.2.57",
46
- "@vkontakte/videoplayer-core": "2.0.164-dev.0bbcbb01d.0",
47
- "@vkontakte/videoplayer-interactive": "1.0.70-dev.0bbcbb01d.0",
48
- "@vkontakte/videoplayer-shared": "1.0.93-dev.0bbcbb01d.0",
49
- "@vkontakte/videoplayer-statistics": "1.0.110-dev.0bbcbb01d.0"
46
+ "@vkontakte/videoplayer-core": "2.0.164-dev.1313ba86c.0",
47
+ "@vkontakte/videoplayer-interactive": "1.0.70-dev.1313ba86c.0",
48
+ "@vkontakte/videoplayer-shared": "1.0.93-dev.1313ba86c.0",
49
+ "@vkontakte/videoplayer-statistics": "1.0.110-dev.1313ba86c.0"
50
50
  }
51
51
  }
@@ -7,7 +7,7 @@ import type { PlaybackRate } from "@vkontakte/videoplayer-core";
7
7
  import { type IStatContext } from "@vkontakte/videoplayer-statistics";
8
8
  import { ThinOneStat } from "@vkontakte/videoplayer-statistics";
9
9
  import { AnnotationsApi } from "../utils/webAPI/annotationsApi/annotationsApi";
10
- import type { AdditionalContextMenuItem, AdditionalSettingsMenuItem } from "../components/Menus/subMenuTabs/types";
10
+ import type { AdditionalContextMenuItem, AdditionalSettingsMenuItem, MenuItemHighlight, RootMenuId } from "../components/Menus/subMenuTabs/types";
11
11
  import type { AdditionalButton } from "../components/Controls/types";
12
12
  import { SlotsApi } from "../utils/webAPI/slotsApi";
13
13
  import { HTMLElement } from "./HTMLElement";
@@ -158,6 +158,7 @@ export declare class VKVideoPlayer extends HTMLElement {
158
158
  */
159
159
  toggleHighQuality(value: boolean): void;
160
160
  changeAudioStream(id: string): void;
161
+ setHighlightedMenuItems(items: Partial<Record<RootMenuId, MenuItemHighlight>> | undefined): void;
161
162
  addLanguage(config: LanguageConfig): void;
162
163
  setLanguage(language: InterfaceLanguage | string): Promise<void>;
163
164
  private replaceVideoDataInConfig;
@@ -193,6 +194,16 @@ export declare class VKVideoPlayer extends HTMLElement {
193
194
  updateStatContext(statContext: Partial<IStatContext | ThinOneStat.IStatContext>): void;
194
195
  handleTimerNextVideo(state: boolean): void;
195
196
  togglePictureInPicture(): void;
197
+ /**
198
+ * Переключает видимость меню настроек.
199
+ * @param force Если true — открыть, если false — закрыть, если не указано — toggle.
200
+ */
201
+ toggleSettingsMenu(force?: boolean): void;
202
+ /**
203
+ * Переключает видимость плашки качества (HD, FHD, 4K и т.д.) около иконки настроек.
204
+ * @param force Если true — показать, если false — скрыть, если не указано — toggle.
205
+ */
206
+ toggleQualityBadge(force?: boolean): void;
196
207
  focus(): void;
197
208
  /**
198
209
  * Восстанавливает фокус на последнем сфокусированном элементе в плеере.
@@ -111,6 +111,12 @@ export declare enum MenuItemType {
111
111
  CLICK = "CLICK",
112
112
  SWITCH = "SWITCH"
113
113
  }
114
+ export interface MenuItemHighlight {
115
+ /** SVG как строка или URL на SVG-файл */
116
+ svg: string;
117
+ /** CSS стили для контейнера с SVG */
118
+ styleSvgContainer?: string;
119
+ }
114
120
  export declare enum SubMenuItemType {
115
121
  OPEN_SUB_MENU = "OPEN_SUB_MENU",
116
122
  SELECT_VALUE = "SELECT_VALUE"
@@ -7,4 +7,5 @@ export declare const getSubMenusStack: () => {
7
7
  pushSubMenu: (subMenuId: SubMenuId) => void;
8
8
  popSubMenu: () => void;
9
9
  popAllSubMenus: () => void;
10
+ readonly length: number;
10
11
  };
package/types/index.d.ts CHANGED
@@ -6,7 +6,7 @@ import type { ISources, IDashSource, URLSource, RawSource, URLSourceWithSeek } f
6
6
  import type { Milliseconds, QualityLimits } from "@vkontakte/videoplayer-shared";
7
7
  export { VERSION } from "./env";
8
8
  export declare const registerPlayerWebComponent: () => void;
9
- export { type AdditionalSettingsMenuItem, MenuItemType, type AdditionalClickSettingsMenuItem, type AdditionalSwitchSettingsMenuItem, type AdditionalContextMenuItem } from "./components/Menus/subMenuTabs/types";
9
+ export { type AdditionalSettingsMenuItem, MenuItemType, type AdditionalClickSettingsMenuItem, type AdditionalSwitchSettingsMenuItem, type AdditionalContextMenuItem, RootMenuId, SubMenuId } from "./components/Menus/subMenuTabs/types";
10
10
  export { type AdditionalButton, ControlButtonType } from "./components/Controls/types";
11
11
  export type { VKVideoPlayer, IVKVideoPlayerConfig, IUpdatableVKVideoPlayerConfig, IControlInfo, ITimelinePreviewThumbsData, IUpcomingLiveViewControlInfo, IVKVideoPlayerCallbacks, IVideoData, AdsParams, HotKeyMapData, HotKeyMapItem, HotKeyMapGroup, ISources, IDashSource, URLSource, RawSource, URLSourceWithSeek, LanguagePack, LanguageConfig, Milliseconds, IVideoLive, IInteractiveData, AdditionalButtonDeprecated, QualityLimits, IAdsConfig, IVideoEpisode, IDpipConfig, ISDKConfig, VideoPlayerView, IAdmanInitParamsExternalApi, VKLogoType };
12
12
  export { GridTypes } from "./constans";
@@ -1,7 +1,7 @@
1
1
  import type { IUIConfig } from "../config";
2
2
  import type { IVKVideoPlayerConfig } from "../types";
3
3
  import type { IStore } from "./index";
4
- import type { FakeIsPlayingStore, GraphIsOpenedStore, InteractiveControlsOpacityStore, NotificationsStore, PictureInPictureStore, SeekToInteractiveDisabledTooltipStore, ShowInteractiveTimeIndicatorTooltipStore } from "./modules";
4
+ import type { FakeIsPlayingStore, GraphIsOpenedStore, HighlightedMenuItemsStore, InteractiveControlsOpacityStore, NotificationsStore, PictureInPictureStore, SeekToInteractiveDisabledTooltipStore, ShowInteractiveTimeIndicatorTooltipStore } from "./modules";
5
5
  import type { Interactives } from "@vkontakte/videoplayer-interactive";
6
6
  export interface ICompositionParams {
7
7
  legacyStore: IStore;
@@ -18,6 +18,7 @@ export interface ICompositionResult {
18
18
  showInteractiveTimeIndicatorTooltipStore: ShowInteractiveTimeIndicatorTooltipStore;
19
19
  graphIsOpenedStore: GraphIsOpenedStore;
20
20
  interactiveControlsOpacityStore: InteractiveControlsOpacityStore;
21
+ highlightedMenuItemsStore: HighlightedMenuItemsStore;
21
22
  };
22
23
  /** Очистка ресурсов */
23
24
  destroy(): void;
@@ -0,0 +1,3 @@
1
+ import { type HighlightedMenuItemsStore } from "./highlightedMenuItems.store";
2
+ import type { Module } from "../utils";
3
+ export declare const highlightedMenuItemsModule: Module<HighlightedMenuItemsStore>;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * HighlightedMenuItems Store
3
+ *
4
+ * Управляет подсветкой пунктов меню настроек.
5
+ */
6
+ import type { Writable } from "svelte/store";
7
+ import type { MenuItemHighlight, RootMenuId } from "../../../components/Menus/subMenuTabs/types";
8
+ export interface HighlightedMenuItemsStoreState {
9
+ items$: Writable<Partial<Record<RootMenuId, MenuItemHighlight>> | undefined>;
10
+ }
11
+ export interface HighlightedMenuItemsStoreActions {
12
+ /** Установить подсвеченные пункты меню */
13
+ setHighlightedMenuItems(items: Partial<Record<RootMenuId, MenuItemHighlight>> | undefined): void;
14
+ /** Очистить подсветку */
15
+ clear(): void;
16
+ }
17
+ export interface HighlightedMenuItemsStore {
18
+ state: HighlightedMenuItemsStoreState;
19
+ actions: HighlightedMenuItemsStoreActions;
20
+ }
21
+ export declare const createHighlightedMenuItemsStore: () => HighlightedMenuItemsStore;
@@ -0,0 +1,5 @@
1
+ import { InjectionToken } from "@vkontakte/videoplayer-shared";
2
+ export declare const HIGHLIGHTED_MENU_ITEMS_STORE_TOKEN: InjectionToken<HIGHLIGHTED_MENU_ITEMS_STORE_STORE>;
3
+ import type { HighlightedMenuItemsStore } from "./highlightedMenuItems.store";
4
+ type HIGHLIGHTED_MENU_ITEMS_STORE_STORE = HighlightedMenuItemsStore;
5
+ export {};
@@ -0,0 +1,3 @@
1
+ export type { HighlightedMenuItemsStoreState, HighlightedMenuItemsStore, HighlightedMenuItemsStoreActions } from "./highlightedMenuItems.store";
2
+ export { highlightedMenuItemsModule } from "./highlightedMenuItems.module";
3
+ export { HIGHLIGHTED_MENU_ITEMS_STORE_TOKEN } from "./highlightedMenuItems.token";
@@ -16,3 +16,5 @@ export type { SeekToInteractiveDisabledTooltipStoreState, SeekToInteractiveDisab
16
16
  export { seekToInteractiveDisabledTooltipModule, SEEK_TO_INTERACTIVE_DISABLED_TOOLTIP_STORE_TOKEN } from "./seekToInteractiveDisabledTooltipStore";
17
17
  export type { ShowInteractiveTimeIndicatorTooltipStoreState, ShowInteractiveTimeIndicatorTooltipStore, ShowInteractiveTimeIndicatorTooltipStoreActions, ShowInteractiveTimeIndicatorTooltipStoreDeps } from "./showInteractiveTimeIndicatorTooltipStore";
18
18
  export { showInteractiveTimeIndicatorTooltipModule, SHOW_INTERACTIVE_TIME_INDICATOR_TOOLTIP_STORE_TOKEN } from "./showInteractiveTimeIndicatorTooltipStore";
19
+ export type { HighlightedMenuItemsStoreState, HighlightedMenuItemsStore, HighlightedMenuItemsStoreActions } from "./highlightedMenuItemsStore";
20
+ export { highlightedMenuItemsModule, HIGHLIGHTED_MENU_ITEMS_STORE_TOKEN } from "./highlightedMenuItemsStore";
@@ -141,6 +141,10 @@ export interface IUIState {
141
141
  previewTrackDragInProgress: Writable<boolean>;
142
142
  previewTrackAvailable: Readable<boolean>;
143
143
  isPreviewTrackHorizontallyAligned: Readable<boolean>;
144
+ /**
145
+ * Видимость плашки качества (HD, FHD, 4K и т.д.) около иконки настроек.
146
+ */
147
+ qualityBadgeVisible: Writable<boolean>;
144
148
  }
145
149
  export interface IWebApi {
146
150
  pictureInPictureApi?: IPictureInPictureApi;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Базовая санитизация SVG для защиты от XSS.
3
+ * Удаляет опасные паттерны: script-теги, event handlers, javascript: URLs.
4
+ */
5
+ export declare function sanitizeSvg(svg: string | undefined): string;