@tivio/sdk-react 3.2.4 → 3.2.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
3
3
  * nangu.TV, a.s PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4
4
  */
5
- import { InternalConfig, RemoteBundleState, TivioBundle } from '../types/bundle.types';
5
+ import type { InternalConfig, RemoteBundleState, TivioBundle } from '../types/bundle.types';
6
6
  /**
7
7
  * @throws if fetch fails
8
8
  */
@@ -13,4 +13,3 @@ declare const fetchBundle: (secret: string, conf: InternalConfig) => Promise<str
13
13
  declare const createRemotePackageLoader: () => (secret: string, conf: InternalConfig) => Promise<TivioBundle>;
14
14
  declare const createUseRemoteBundle: () => (conf: InternalConfig) => RemoteBundleState;
15
15
  export { fetchBundle, createRemotePackageLoader, createUseRemoteBundle, };
16
- export type { RemoteBundleState, };
@@ -1,5 +1,5 @@
1
1
  import { TivioBundle } from '../types/bundle.types';
2
- import type { RemoteBundleState } from './bundleLoader';
2
+ import type { RemoteBundleState } from '../types/bundle.types';
3
3
  export declare let tivioBundle: TivioBundle | null;
4
4
  /**
5
5
  * rejects when bundle is not available
@@ -1,4 +1,4 @@
1
- import { Currency, ItemsInRow, PaginationInterface, PaginationOptions, QerkoCancellationInfo, Row, ROW_ITEM_TYPES, SubscribeToItemsInRowOptions, SubscribeToTaggedVideos, Tag, TilePropsPartial, UseCancelSubscription } from '@tivio/common';
1
+ import { Currency, ItemsInRow, PaginationInterface, PaginationOptions, QerkoCancellationInfo, Row, ROW_ITEM_TYPES, SubscribeToItemsInRowOptions, SubscribeToTaggedVideos, Tag, TilePropsPartial, UseCancelSubscription, CUSTOMER_BUILD, PLATFORM, WebRowProps } from '@tivio/common';
2
2
  import { ComponentType } from 'react';
3
3
  import { Logger } from '../services/logger';
4
4
  import { FetchPackage } from '../services/packageLoader';
@@ -243,7 +243,7 @@ declare type TivioComponents = {
243
243
  tagId: string;
244
244
  onError?: (error: Error) => void;
245
245
  }>;
246
- WebRow: React.ReactNode;
246
+ WebRow: React.ComponentType<WebRowProps>;
247
247
  WebTile: React.ComponentType<{
248
248
  item?: Video | Tag;
249
249
  } & TilePropsPartial>;
@@ -291,6 +291,10 @@ declare type TivioHooks = {
291
291
  error: Error | null;
292
292
  };
293
293
  useSearch: UseSearch;
294
+ useVideo: (videoId: string) => {
295
+ data: Video | null;
296
+ error: string | null;
297
+ };
294
298
  useVoucher: (voucherId: string) => any;
295
299
  /**
296
300
  * @deprecated will be removed in version
@@ -334,6 +338,9 @@ declare type TivioBundle = {
334
338
  declare type TivioInternalComponents = {
335
339
  CustomButton: React.ComponentType;
336
340
  WebLandingScreen: React.ComponentType;
341
+ WebVideoScreen: React.ComponentType<{
342
+ videoId: string;
343
+ }>;
337
344
  };
338
345
  declare type TivioInternalHooks = {
339
346
  useAuthOverlay: () => AuthOverlayState;
@@ -353,7 +360,11 @@ declare type TivioInternalHooks = {
353
360
  declare type TivioInternalProviders = {
354
361
  AppThemeProvider: React.ComponentType;
355
362
  AuthOverlayContextProvider: React.ComponentType;
356
- CustomerProvider: React.ComponentType;
363
+ CustomerProvider: React.ComponentType<{
364
+ customer: CUSTOMER_BUILD;
365
+ platform: PLATFORM;
366
+ children: any;
367
+ }>;
357
368
  ConfigProvider: React.ComponentType;
358
369
  UserContextProvider: React.ComponentType;
359
370
  SubscriptionOverlayContextProvider: React.ComponentType;
@@ -398,4 +409,4 @@ declare type RemoteBundleState = {
398
409
  settings: Settings;
399
410
  state: 'loading' | 'error' | 'ready';
400
411
  } & Nullable<TivioBundle>;
401
- export type { RemoteBundleState, Config, Settings, InternalConfig, TivioBundle, TivioBundleFile, TivioHooks, TivioComponents, TivioAuth, TivioGetters, TivioSubscriptions, TivioInternalComponents, TivioInternalHooks, TivioInternalProviders, Events, PubSub, PlayerCapability, Currency, };
412
+ export type { RemoteBundleState, Config, Settings, InternalConfig, TivioBundle, TivioBundleFile, TivioHooks, TivioComponents, TivioAuth, TivioGetters, TivioSubscriptions, TivioInternalComponents, TivioInternalHooks, TivioInternalProviders, Events, PubSub, PlayerCapability, Currency, AuthOverlayState, AuthOverlayType, SubscriptionOverlayData, SubscriptionOverlayState, QerkoData, QerkoOverlayState, };
@@ -5,8 +5,7 @@
5
5
  /**
6
6
  * Export public client side API
7
7
  */
8
- import { USER_TYPE } from '@tivio/common';
9
- import type { Monetization, Video } from '@tivio/common';
8
+ import type { Monetization, Video, User } from '@tivio/common';
10
9
  import type React from 'react';
11
10
  declare type RemoteProviderProps = {
12
11
  disableUnmounting?: boolean;
@@ -21,19 +20,6 @@ declare enum Language {
21
20
  SK = "sk",
22
21
  SP = "sp"
23
22
  }
24
- declare type User = {
25
- purchases: Purchase[];
26
- purchasedVods: Purchase[];
27
- purchasedSubscriptions: Purchase[];
28
- getPurchasedVodsWithInitializedVideos: () => Promise<Purchase[]>;
29
- isPurchasesInitialized: boolean;
30
- isSignedIn: boolean;
31
- email: string;
32
- type?: USER_TYPE;
33
- photoURL: string | null;
34
- name?: string;
35
- authUserId?: string;
36
- };
37
23
  interface UserData {
38
24
  name?: string;
39
25
  }
@@ -135,6 +121,10 @@ interface WebPlayerProps {
135
121
  id: string;
136
122
  source?: VodTivioSourcePojo | ChannelSourcePojo | VideoPath | null;
137
123
  onEnded?: () => any;
124
+ /**
125
+ * If this function is specified, then "Back" button is shown in top right corner.
126
+ */
127
+ onBack?: () => void;
138
128
  className?: string;
139
129
  /**
140
130
  * default false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tivio/sdk-react",
3
- "version": "3.2.4",
3
+ "version": "3.2.5",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "source": "src/index.ts",
@@ -28,7 +28,7 @@
28
28
  "@material-ui/core": "^4.11.2",
29
29
  "@material-ui/icons": "^4.11.2",
30
30
  "@sentry/browser": "^6.1.0",
31
- "@tivio/common": "1.1.80",
31
+ "@tivio/common": "1.1.81",
32
32
  "es7-object-polyfill": "^1.0.1",
33
33
  "firebase": "^8.2.3",
34
34
  "formik": "^2.2.7",