@tivio/sdk-react 9.6.0 → 9.7.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.
@@ -7,6 +7,7 @@ import type { default as firebase_2 } from '@firebase/app-types';
7
7
  import type { default as firebase_3 } from 'firebase';
8
8
  import { FunctionComponentElement } from 'react';
9
9
  import type { GeoPoint } from '@firebase/firestore-types';
10
+ import type { google } from '@alugha/ima';
10
11
  import { OperatingSystem } from 'detect-browser';
11
12
  import type { PaletteType } from '@material-ui/core';
12
13
  import { default as React_2 } from 'react';
@@ -429,6 +430,8 @@ export declare interface Article extends RowItem, MonetizableItem, ReactableCont
429
430
  detailBanner?: string;
430
431
  episodeNumber?: number;
431
432
  seasonNumber?: number;
433
+ urlNames?: string[];
434
+ urlName?: string;
432
435
  }
433
436
 
434
437
  /**
@@ -440,10 +443,13 @@ export declare interface ArticleBlock {
440
443
  type: ArticleBlockType;
441
444
  htmlContent?: string;
442
445
  imageUrl?: string;
446
+ imageUrlOriginal?: string;
447
+ imageUrlContain?: string;
443
448
  textContent?: string;
444
449
  videoId?: string;
445
450
  isOverflowImage?: boolean;
446
451
  imageDescription?: string;
452
+ use16By9Container?: boolean;
447
453
  }
448
454
 
449
455
  export declare interface ArticleBlockField extends Omit<ArticleBlock, 'textContent' | 'htmlContent'> {
@@ -462,6 +468,7 @@ export declare type ArticleBlockType = 'PARAGRAPH' | 'IMAGE' | 'VIDEO' | 'HEADIN
462
468
  */
463
469
  declare interface ArticleDocumentSerialized {
464
470
  type: 'ARTICLE';
471
+ id: string;
465
472
  name: Translation;
466
473
  description?: Translation;
467
474
  metadata?: ArticleMetadata;
@@ -503,6 +510,7 @@ export declare interface ArticleTileSpecificData {
503
510
  description?: Translation;
504
511
  monetizations?: TileMonetizationData[];
505
512
  externalUrl?: string;
513
+ urlName?: UrlNamesType;
506
514
  }
507
515
 
508
516
  /**
@@ -835,6 +843,12 @@ export declare interface CommonSourceParams<T extends SourceType = SourceType> {
835
843
  videoPath?: string;
836
844
  }
837
845
 
846
+ /**
847
+ * @public
848
+ * Re-export of Google IMA CompanionAd type for use throughout the SDK
849
+ */
850
+ export declare type CompanionAd = google.ima.CompanionAd;
851
+
838
852
  /**
839
853
  * TODO it's the same as Customizations, not?
840
854
  * @internal
@@ -1112,6 +1126,9 @@ export declare const CountryToLangCodeMap: {
1112
1126
  CZ: LangCode;
1113
1127
  PL: LangCode;
1114
1128
  SK: LangCode;
1129
+ DE: LangCode;
1130
+ AT: LangCode;
1131
+ CH: LangCode;
1115
1132
  };
1116
1133
 
1117
1134
  /**
@@ -1251,6 +1268,7 @@ export declare enum CustomerId {
1251
1268
  MIRA_BOSAK = "MIRA_BOSAK",
1252
1269
  KOVACIC_360 = "KOVACIC_360",
1253
1270
  SIFRA_TV = "SIFRA_TV",
1271
+ TBL = "TBL",
1254
1272
  BLESK = "BLESK",
1255
1273
  NERUDA_TV = "NERUDA_TV",
1256
1274
  DAVID_FRANK_TV = "DAVID_FRANK_TV",
@@ -1492,6 +1510,7 @@ export declare interface CustomScript {
1492
1510
  src: string;
1493
1511
  event?: EventName;
1494
1512
  isAsync?: boolean;
1513
+ defer?: boolean;
1495
1514
  }
1496
1515
 
1497
1516
  /**
@@ -1794,6 +1813,7 @@ export declare interface EmitterInterface {
1794
1813
  isSupported: (even: string) => boolean;
1795
1814
  addListener: <T = unknown>(event: string, cb: (value: T) => Empty_2) => void;
1796
1815
  removeListener: <T = unknown>(event: string, cb: (value: T) => Empty_2) => void;
1816
+ emitEvent: (event: string, value?: unknown) => void;
1797
1817
  }
1798
1818
 
1799
1819
  /**
@@ -1860,6 +1880,15 @@ export declare const fetchBundle: (secret: string, conf: InternalConfig, checkBu
1860
1880
  */
1861
1881
  declare type FetchPackage = (url: string) => Promise<string>;
1862
1882
 
1883
+ export declare interface FinishSignUpRequest {
1884
+ token: string;
1885
+ fName: string;
1886
+ lName: string;
1887
+ email: string;
1888
+ password: string;
1889
+ langCode?: LangCode;
1890
+ }
1891
+
1863
1892
  /**
1864
1893
  * @public
1865
1894
  */
@@ -1950,9 +1979,13 @@ export declare type GeoBlocking = {
1950
1979
  blacklist: Array<any>;
1951
1980
  };
1952
1981
 
1953
- export declare interface GetArticleRequest {
1982
+ export declare type GetArticleRequest = {
1954
1983
  id: string;
1955
- }
1984
+ } | {
1985
+ idOrUrlName: string;
1986
+ organizationId: string;
1987
+ language: LangCode;
1988
+ };
1956
1989
 
1957
1990
  export declare interface GetArticleResponse {
1958
1991
  article: ArticleDocumentSerialized;
@@ -2575,12 +2608,16 @@ export declare enum LangCode {
2575
2608
  HU = "hu"
2576
2609
  }
2577
2610
 
2611
+ export declare const LangCodeToTitle: Partial<Record<LangCode, string>>;
2612
+
2578
2613
  /**
2579
2614
  * All supported languages codes as in ISO 639-1
2580
2615
  * @public
2581
2616
  */
2582
2617
  export declare const languages: LangCode[];
2583
2618
 
2619
+ export declare type LanguageSelector = 'application' | 'content';
2620
+
2584
2621
  /**
2585
2622
  * Possible language key of all supported language mutations.
2586
2623
  * @public
@@ -2629,7 +2666,13 @@ export declare interface LeaderboardsRequest {
2629
2666
  */
2630
2667
  export declare interface LinkedVideo {
2631
2668
  video: Video;
2632
- type: 'CUT' | 'TRAILER' | 'BONUS' | 'CHILD' | 'TEASER' | 'TASTING' | 'VIRTUAL_PROGRAM' | 'LANGUAGE'
2669
+ type: 'CUT' | 'TRAILER' | 'BONUS' | 'CHILD'
2670
+ /**
2671
+ * Recommendation for the video that appears ahead of
2672
+ * algorithmic recommendations on the detail page. Works one-way: if A
2673
+ * links to B, B is recommended for A only (unless B links back).
2674
+ */
2675
+ | 'RECOMMENDED' | 'TEASER' | 'TASTING' | 'VIRTUAL_PROGRAM' | 'LANGUAGE'
2633
2676
  /**
2634
2677
  * Will render separate mini-player on top of the main one, playing given video.
2635
2678
  */
@@ -3169,11 +3212,6 @@ export declare type Nullable<T> = {
3169
3212
  [P in keyof T]: T[P] | null;
3170
3213
  };
3171
3214
 
3172
- /**
3173
- * @public
3174
- */
3175
- export declare type ObjectType = Record<string, any>;
3176
-
3177
3215
  /**
3178
3216
  * @public
3179
3217
  */
@@ -3929,6 +3967,7 @@ export declare interface PlayerWrapper {
3929
3967
  isPaused: boolean;
3930
3968
  isPlaying: boolean;
3931
3969
  isIdle: boolean;
3970
+ isFullscreen: boolean;
3932
3971
  language: LangCode | null;
3933
3972
  nextRecommendedVideo: Video | null;
3934
3973
  prerollCheck: PrerollCheck;
@@ -4018,7 +4057,11 @@ export declare enum PlayerWrapperEvents {
4018
4057
  /**
4019
4058
  * Triggered when an ad finishes playing
4020
4059
  */
4021
- 'ad-ended' = "ad-ended"
4060
+ 'ad-ended' = "ad-ended",
4061
+ /**
4062
+ * Triggered when companion ads are available for the current ad
4063
+ */
4064
+ 'companion-ads' = "companion-ads"
4022
4065
  }
4023
4066
 
4024
4067
  /**
@@ -5737,6 +5780,12 @@ export declare interface SimplifiedVideoController {
5737
5780
  * @param callback - Function called when an ad finishes playing
5738
5781
  */
5739
5782
  addEventListener(event: 'ad-ended', callback: () => void): void;
5783
+ /**
5784
+ * Add an event listener for companion ads events
5785
+ * @param event - Must be 'companion-ads'
5786
+ * @param callback - Function called when companion ads are available
5787
+ */
5788
+ addEventListener(event: 'companion-ads', callback: (companionAds: CompanionAd[]) => void): void;
5740
5789
  /**
5741
5790
  * Remove an event listener
5742
5791
  * @param event - The event name to stop listening for
@@ -6411,7 +6460,7 @@ export declare interface TivioConfig {
6411
6460
  };
6412
6461
  secret: string;
6413
6462
  /**
6414
- * Language used when isLanguageSelectionEnabled is false | undefined or when not possible to load language from local storage or localization worker
6463
+ * Language used when no languageSelector is set or when not possible to load language from local storage or localization worker
6415
6464
  */
6416
6465
  language: LangCode;
6417
6466
  debug?: boolean;
@@ -6419,15 +6468,16 @@ export declare interface TivioConfig {
6419
6468
  firebaseApp?: any | null;
6420
6469
  firebaseFactory?: (config: object, appName?: string) => firebase_2.FirebaseApp;
6421
6470
  authDomainOverride?: string;
6471
+ /**
6472
+ * @deprecated this field is no longer in use and has no impact when set.
6473
+ */
6422
6474
  firestore?: any | null;
6423
6475
  currency: Currency;
6424
6476
  /**
6425
- * A flag that indicates whether the language selection feature is enabled.
6426
- * Language is then stored to local storage 'tivio-user-language'.
6427
- * If nothing is stored in local storage, then language is set according to location
6428
- * When set to `true`, users are allowed to choose their preferred language
6477
+ * Represents an optional array of LanguageSelector objects.
6478
+ * Used to define and manage a list of supported languages for different language-usages (user, content,...).
6429
6479
  */
6430
- isLanguageSelectionEnabled?: boolean;
6480
+ languageSelectors?: Partial<Record<LanguageSelector, LangCode[]>>;
6431
6481
  applicationId?: string;
6432
6482
  isTivioProApp?: boolean;
6433
6483
  lockApplicationHandle?: string;
@@ -6454,6 +6504,7 @@ export declare interface TivioConfig {
6454
6504
  * customTokenCookiesDomain: 'example.com'
6455
6505
  */
6456
6506
  customTokenCookiesDomain?: string;
6507
+ enableGtmPlayerEvents?: boolean;
6457
6508
  }
6458
6509
 
6459
6510
  /**
@@ -6707,12 +6758,18 @@ export declare type TivioJsBundleExposedApi = {
6707
6758
  /**
6708
6759
  * Get tag by its id.
6709
6760
  * @param tagId - tag id
6710
- * @returns {Promise<Tag | null>} widget or null if tag does not exists
6761
+ * @returns {Promise<Tag | null>} tag or null if tag does not exists
6711
6762
  */
6712
6763
  getTagById: (tagId: string) => Promise<Tag | null>;
6764
+ /**
6765
+ * Get tags by their ids.
6766
+ * @param tagIds - tag ids
6767
+ * @returns {Promise<Tag[]} list of tags for given ids
6768
+ */
6769
+ getTagsByIds: (tagIds: string[]) => Promise<Tag[]>;
6713
6770
  createPlayerWrapper: (playerImplementation: PlayerInterfaceForPlayerWrapper) => TivioPlayerWrapper;
6714
6771
  destroy: () => Promise<void>;
6715
- } & Pick<TivioGetters, 'getVideoById' | 'getScreenById' | 'organization' | 'getUser'> & Pick<TivioSubscriptions, 'subscribeToVideo' | 'subscribeToItemsInRow' | 'subscribeToRowsInScreen'> & Pick<TivioAuth, 'createUserWithEmailAndPassword' | 'signInWithEmailAndPassword' | 'resetPassword' | 'signOut'> & Pick<TivioSetters, 'setBundleVersion' | 'setUser' | 'setLanguage' | 'setStorageManager'>;
6772
+ } & Pick<TivioGetters, 'getVideoById' | 'getScreenById' | 'organization' | 'getUser'> & Pick<TivioSubscriptions, 'subscribeToVideo' | 'subscribeToItemsInRow' | 'subscribeToRowsInScreen'> & Pick<TivioAuth, 'createUserWithEmailAndPassword' | 'signInWithEmailAndPassword' | 'resetPassword' | 'signOut'> & Pick<TivioSetters, 'setBundleVersion' | 'setUser' | 'setLanguage' | 'setContentLanguage' | 'setStorageManager'>;
6716
6773
 
6717
6774
  /**
6718
6775
  * @public
@@ -6784,6 +6841,7 @@ export declare type TivioSetters = {
6784
6841
  * @param language
6785
6842
  */
6786
6843
  setLanguage: (language: LangCode) => void;
6844
+ setContentLanguage: (language: LangCode) => void;
6787
6845
  setStorageManager: (storageManager: StorageManager_2) => void;
6788
6846
  setUser: (userId: string | null, userPayload?: UserPayload) => Promise<void>;
6789
6847
  };
@@ -6812,10 +6870,6 @@ export declare type TivioSubscriptions = {
6812
6870
  subscribeToItemsInRow: SubscribeToItemsInRow;
6813
6871
  subscribeToRowsInScreen: SubscribeToRowsInScreen;
6814
6872
  subscribeToTaggedVideos: SubscribeToTaggedVideos;
6815
- registerOverlayCallbacks: (callbacks: {
6816
- onShow: () => void;
6817
- onHide: () => void;
6818
- }) => void;
6819
6873
  };
6820
6874
 
6821
6875
  /**
@@ -7031,6 +7085,10 @@ export declare type UpdateNotificationSettingsResponse = Promise<boolean>;
7031
7085
 
7032
7086
  export declare type UpsertCommentResponse = AddEditCommentResponse | DeleteCommentResponse;
7033
7087
 
7088
+ export declare type UrlNamesType = {
7089
+ [key in LangCode]?: string[];
7090
+ };
7091
+
7034
7092
  /**
7035
7093
  * @public
7036
7094
  */
@@ -7660,23 +7718,18 @@ export declare type VastApiFramework = string | 'VPAID' | null;
7660
7718
  * @public
7661
7719
  */
7662
7720
  export declare enum VastProvider {
7663
- CNC_PREBID = "cnc-prebid",
7664
7721
  CNC_STARGAZE_PREROLL_1 = "cnc-stargaze-preroll-1",
7665
7722
  CNC_STARGAZE_PREROLL_2 = "cnc-stargaze-preroll-2",
7666
7723
  CNC_STARGAZE_MIDROLL = "cnc-stargaze-midroll",
7667
- ETARGET_PREBID = "etarget-prebid",
7668
7724
  FALLBACK_HLS = "fallback-hls",
7669
7725
  FALLBACK_MP4 = "fallback",
7670
7726
  GARAZ_TV = "garaz.tv",
7671
7727
  GARAZ_TV_DEV = "garaz.tv.dev",
7672
- IMPRESSION_MEDIA_PREBID = "impressionMedia-prebid",
7673
7728
  JOJ_ADFORM = "joj",
7674
7729
  JOJ_SMART = "joj-smart",
7675
7730
  JOJ_AD_MANAGER_VOD_PREROLL = "joj-ad-manager-vod-preroll",
7676
7731
  JOJ_AD_MANAGER_VOD_MIDROLL = "joj-ad-manager-vod-midroll",
7677
7732
  JOJ_AD_MANAGER_LIVE_PREROLL = "joj-ad-manager-live-preroll",
7678
- MALL_TV = "malltv",
7679
- MALL_TV_PREBID = "malltv-prebid",
7680
7733
  PRIMA = "prima",
7681
7734
  TEST = "test",
7682
7735
  TEST_VPAID = "test-vpaid",
@@ -7788,6 +7841,7 @@ export declare interface Video extends RowItem, MonetizableItem, ReactableConten
7788
7841
  forcedCapabilities: PlayerCapability[] | null;
7789
7842
  mainLinkedVideoId?: string;
7790
7843
  getLinkedVideoIdByLanguage: (lang: LangCode) => string | undefined;
7844
+ externals?: VideoExternals;
7791
7845
  }
7792
7846
 
7793
7847
  /**
@@ -7826,6 +7880,7 @@ export declare interface VideoController {
7826
7880
  addEventListener(event: 'ad-started', callback: (value: AdMetadata & {
7827
7881
  adCtaElement: HTMLElement | null;
7828
7882
  }) => void): void;
7883
+ addEventListener(event: 'companion-ads', callback: (value: CompanionAd[]) => void): void;
7829
7884
  /**
7830
7885
  * Remove an event listener
7831
7886
  * @param event - The event name to stop listening for
@@ -8081,7 +8136,7 @@ export declare interface VideoTileSpecificData {
8081
8136
  assets?: AssetsField;
8082
8137
  episodeNumber?: number;
8083
8138
  seasonNumber?: number;
8084
- urlName?: VideoUrlNames;
8139
+ urlName?: UrlNamesType;
8085
8140
  monetizations?: VideoTileMonetizationData[];
8086
8141
  description?: Translation;
8087
8142
  }
@@ -8150,13 +8205,6 @@ export declare enum VideoType {
8150
8205
  CHILD = "CHILD"
8151
8206
  }
8152
8207
 
8153
- /**
8154
- * @public
8155
- */
8156
- export declare type VideoUrlNames = {
8157
- [key in LangCode]?: string[];
8158
- };
8159
-
8160
8208
  export declare interface ViewCountItem {
8161
8209
  /**
8162
8210
  * Unix timestamp
@@ -8603,6 +8651,10 @@ export declare interface WebConfig {
8603
8651
  * Map for all handlers
8604
8652
  */
8605
8653
  handlers?: PurchaseEventHandlers;
8654
+ homeScreen?: {
8655
+ useFullHeight?: boolean;
8656
+ };
8657
+ disableModalSwitcher?: boolean;
8606
8658
  }
8607
8659
 
8608
8660
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tivio/sdk-react",
3
- "version": "9.6.0",
3
+ "version": "9.7.0",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "source": "src/index.ts",
@@ -38,7 +38,7 @@
38
38
  "@material-ui/core": "^4.11.2",
39
39
  "@material-ui/icons": "^4.11.2",
40
40
  "@sentry/browser": "^6.1.0",
41
- "@tivio/common": "1.1.136",
41
+ "@tivio/common": "1.1.138",
42
42
  "dayjs": "^1.11.0",
43
43
  "es7-object-polyfill": "^1.0.1",
44
44
  "firebase": "8.10.1",