@tivio/sdk-react 3.1.2 → 3.2.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.
@@ -1,4 +1,4 @@
1
- import { Currency, QerkoCancellationInfo, SubscribeToTaggedVideos, UseCancelSubscription } from '@tivio/common';
1
+ import { Currency, QerkoCancellationInfo, ROW_ITEM_TYPES, SubscribeToTaggedVideos, TileProps, UseCancelSubscription } from '@tivio/common';
2
2
  import { ComponentType } from 'react';
3
3
  import { Logger } from '../services/logger';
4
4
  import { FetchPackage } from '../services/packageLoader';
@@ -25,6 +25,17 @@ declare type InternalConfig = {
25
25
  bundleUrlOverride?: string;
26
26
  currency: Currency;
27
27
  deviceCapabilities: PlayerCapability[];
28
+ /**
29
+ * Additional options for deviceCapabilities
30
+ */
31
+ capabilitiesOptions?: {
32
+ /**
33
+ * Should the player prefer HTTP sources instead HTTPs if they are available.
34
+ * This can be used on platforms that support mixed content but do not support
35
+ * specific HTTPS certificates. (e.g. certificates from Letsencrypt not supported on LG TVs)
36
+ */
37
+ preferHttp?: boolean;
38
+ };
28
39
  disableUnmounting?: boolean;
29
40
  enable?: boolean;
30
41
  enableSentry?: boolean;
@@ -32,7 +43,7 @@ declare type InternalConfig = {
32
43
  error: string | null;
33
44
  }>;
34
45
  fetchPackage: FetchPackage;
35
- language?: string;
46
+ language?: Language;
36
47
  LoaderComponent?: ComponentType;
37
48
  logger?: Logger | null;
38
49
  pubSub: PubSub;
@@ -52,7 +63,7 @@ interface PubSub {
52
63
  publish: <K extends keyof Events>(triggerName: K, payload: Events[K]) => Empty;
53
64
  subscribe: <K extends keyof Events>(triggerName: K, onMessage: (data: Events[K]) => Empty) => Disposer;
54
65
  }
55
- declare type Config = Pick<InternalConfig, 'bundleUrlOverride' | 'currency' | 'disableUnmounting' | 'enable' | 'enableSentry' | 'ErrorComponent' | 'language' | 'LoaderComponent' | 'logger' | 'secret' | 'verbose'> & {
66
+ declare type Config = Pick<InternalConfig, 'bundleUrlOverride' | 'currency' | 'disableUnmounting' | 'capabilitiesOptions' | 'enable' | 'enableSentry' | 'ErrorComponent' | 'language' | 'LoaderComponent' | 'logger' | 'secret' | 'verbose'> & {
56
67
  deviceCapabilities: PlayerCapability[] | 'auto';
57
68
  /**
58
69
  * @private
@@ -183,6 +194,10 @@ interface TivioAuth {
183
194
  signOut: () => Promise<void>;
184
195
  createFreePurchase: (monetizationId: string) => Promise<void>;
185
196
  }
197
+ interface TileActionProps {
198
+ goToPlayer?: (videoId: string, type: ROW_ITEM_TYPES, rowId?: string) => void;
199
+ goToLoginScreen?: () => void;
200
+ }
186
201
  declare type TivioComponents = {
187
202
  AdIndicationButtonWeb: React.ReactNode;
188
203
  Markers: React.ReactNode;
@@ -205,6 +220,12 @@ declare type TivioComponents = {
205
220
  onEnded?: () => any;
206
221
  }>;
207
222
  TvApp: React.ComponentType<TvAppProps>;
223
+ CustomerScreen: React.ComponentType<{
224
+ screenId: string;
225
+ } & TileActionProps>;
226
+ Row: React.ReactNode;
227
+ AppTile: React.ComponentType<TileProps>;
228
+ FeatureSupportCheck: React.ComponentType<{}>;
208
229
  };
209
230
  declare type AdSegment = {
210
231
  id: string;
@@ -255,14 +276,62 @@ declare type TivioBundle = {
255
276
  setUser: (userId: string, userPayload: UserPayload | null) => Promise<void>;
256
277
  sources: TivioSources;
257
278
  subscriptions: TivioSubscriptions;
279
+ internal: {
280
+ hooks: TivioInternalHooks;
281
+ providers: TivioInternalProviders;
282
+ };
283
+ };
284
+ declare type TivioInternalHooks = {
285
+ useSubscriptionsOverlay: () => SubscriptionOverlayState;
286
+ useQerkoOverlay: () => QerkoOverlayState;
287
+ usePurchasesWithVideos: () => {
288
+ purchases: Purchase[];
289
+ };
290
+ useOrganizationSubscriptions: () => {
291
+ subscriptions: Monetization[];
292
+ };
293
+ useUser: () => {
294
+ user: User | null;
295
+ error: string | null;
296
+ };
297
+ };
298
+ declare type TivioInternalProviders = {
299
+ AppThemeProvider: React.ComponentType;
300
+ CustomerProvider: React.ComponentType;
301
+ UserContextProvider: React.ComponentType;
302
+ SubscriptionOverlayContextProvider: React.ComponentType;
303
+ QerkoOverlayContextProvider: React.ComponentType;
304
+ PurchasesWithVideosContextProvider: React.ComponentType;
305
+ OrganizationSubscriptionsContextProvider: React.ComponentType;
258
306
  };
259
307
  declare type TivioBundleFile = {
260
308
  Tivio: TivioBundle;
261
309
  };
310
+ interface SubscriptionOverlayData {
311
+ subscriptions?: Monetization[];
312
+ onPurchase?: () => void;
313
+ onClose?: () => void;
314
+ }
315
+ declare type SubscriptionOverlayState = {
316
+ data: SubscriptionOverlayData | null;
317
+ closeSubscriptionOverlay: () => void;
318
+ openSubscriptionOverlay: (data: SubscriptionOverlayData) => void;
319
+ };
320
+ interface QerkoData {
321
+ monetization: Monetization;
322
+ video?: Video;
323
+ onPurchase?: () => void;
324
+ onClose?: () => void;
325
+ }
326
+ interface QerkoOverlayState {
327
+ data: QerkoData | null;
328
+ openQerkoOverlay: ((data: QerkoData) => void);
329
+ closeQerkoOverlay: () => void;
330
+ }
262
331
  declare type RemoteBundleState = {
263
332
  config: InternalConfig;
264
333
  error: string | null;
265
334
  settings: Settings;
266
335
  state: 'loading' | 'error' | 'ready';
267
336
  } & Nullable<TivioBundle>;
268
- export type { RemoteBundleState, Config, Settings, InternalConfig, TivioBundle, TivioBundleFile, TivioHooks, TivioComponents, TivioAuth, TivioGetters, TivioSubscriptions, Events, PubSub, PlayerCapability, Currency, };
337
+ export type { RemoteBundleState, Config, Settings, InternalConfig, TivioBundle, TivioBundleFile, TivioHooks, TivioComponents, TivioAuth, TivioGetters, TivioSubscriptions, TivioInternalHooks, TivioInternalProviders, Events, PubSub, PlayerCapability, Currency, };
@@ -12,7 +12,15 @@ declare type RemoteProviderProps = {
12
12
  disableUnmounting?: boolean;
13
13
  language?: string;
14
14
  };
15
- declare type Language = 'cs' | 'en' | 'sk' | 'de' | 'pl';
15
+ declare enum Language {
16
+ CS = "cs",
17
+ DE = "de",
18
+ EN = "en",
19
+ FR = "fr",
20
+ PL = "pl",
21
+ SK = "sk",
22
+ SP = "sp"
23
+ }
16
24
  declare type User = {
17
25
  purchases: Purchase[];
18
26
  purchasedVods: Purchase[];
@@ -173,4 +181,5 @@ declare type TivioSources = {
173
181
  VodExternalSource: any;
174
182
  VodTivioSource: any;
175
183
  };
176
- export type { RemoteProviderProps, WebPlayerProps, Marker, BetOffer, Purchase, Chapter, Language, Widget, Channel, Section, Video, TivioSources, UserData, User, Monetization, VodTivioSourcePojo, ChannelSourcePojo, };
184
+ export type { RemoteProviderProps, WebPlayerProps, Marker, BetOffer, Purchase, Chapter, Widget, Channel, Section, Video, TivioSources, UserData, User, Monetization, VodTivioSourcePojo, ChannelSourcePojo, };
185
+ export { Language };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tivio/sdk-react",
3
- "version": "3.1.2",
3
+ "version": "3.2.0",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "source": "src/index.ts",
@@ -27,7 +27,7 @@
27
27
  "@material-ui/core": "^4.11.2",
28
28
  "@material-ui/icons": "^4.11.2",
29
29
  "@sentry/browser": "^6.1.0",
30
- "@tivio/common": "1.1.74",
30
+ "@tivio/common": "1.1.76",
31
31
  "firebase": "^8.2.3",
32
32
  "formik": "^2.2.7",
33
33
  "i18next": "^19.8.4",
@@ -1,9 +0,0 @@
1
- import { Monetization } from '@tivio/common';
2
- import React from 'react';
3
- interface OrganizationSubscriptionsContextState {
4
- subscriptions: Monetization[];
5
- setSubscriptions: (subscriptions: Monetization[]) => void;
6
- }
7
- declare const OrganizationSubscriptionsContext: React.Context<OrganizationSubscriptionsContextState>;
8
- declare const OrganizationSubscriptionsContextProvider: React.FC;
9
- export { OrganizationSubscriptionsContextProvider, OrganizationSubscriptionsContext, };
@@ -1,9 +0,0 @@
1
- import { Purchase } from '@tivio/common';
2
- import React from 'react';
3
- interface PurchasesWithVideosContextState {
4
- purchases: Purchase[];
5
- setPurchases: (purchases: Purchase[]) => void;
6
- }
7
- declare const PurchasesWithVideosContext: React.Context<PurchasesWithVideosContextState>;
8
- declare const PurchasesWithVideosContextProvider: React.FC;
9
- export { PurchasesWithVideosContext, PurchasesWithVideosContextProvider, };
@@ -1,9 +0,0 @@
1
- import { User } from '@tivio/common';
2
- import React from 'react';
3
- interface UserContextState {
4
- user: User | null;
5
- setUser: (user: User) => void;
6
- }
7
- declare const UserContext: React.Context<UserContextState>;
8
- declare const UserContextProvider: React.FC;
9
- export { UserContextProvider, UserContext, };
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- /**
3
- * See device_compatibility.md
4
- */
5
- export declare const FeatureSupportCheck: React.FC;