@tivio/sdk-react 9.6.0 → 9.7.1

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
  */
@@ -1898,7 +1927,8 @@ export declare enum ForbiddenReason {
1898
1927
  NAME_CONTAINS_INVALID_CHAR = "NAME_CONTAINS_INVALID_CHAR",
1899
1928
  USER_ACCOUNT_LOCKED = "USER_ACCOUNT_LOCKED",
1900
1929
  USER_NOT_FOUND = "USER_NOT_FOUND",
1901
- UNSUPPORTED_BROWSER = "UNSUPPORTED_BROWSER"
1930
+ UNSUPPORTED_BROWSER = "UNSUPPORTED_BROWSER",
1931
+ ANONYMOUS_USER = "ANONYMOUS_USER"
1902
1932
  }
1903
1933
 
1904
1934
  /**
@@ -1950,9 +1980,13 @@ export declare type GeoBlocking = {
1950
1980
  blacklist: Array<any>;
1951
1981
  };
1952
1982
 
1953
- export declare interface GetArticleRequest {
1983
+ export declare type GetArticleRequest = {
1954
1984
  id: string;
1955
- }
1985
+ } | {
1986
+ idOrUrlName: string;
1987
+ organizationId: string;
1988
+ language: LangCode;
1989
+ };
1956
1990
 
1957
1991
  export declare interface GetArticleResponse {
1958
1992
  article: ArticleDocumentSerialized;
@@ -2575,12 +2609,16 @@ export declare enum LangCode {
2575
2609
  HU = "hu"
2576
2610
  }
2577
2611
 
2612
+ export declare const LangCodeToTitle: Partial<Record<LangCode, string>>;
2613
+
2578
2614
  /**
2579
2615
  * All supported languages codes as in ISO 639-1
2580
2616
  * @public
2581
2617
  */
2582
2618
  export declare const languages: LangCode[];
2583
2619
 
2620
+ export declare type LanguageSelector = 'application' | 'content';
2621
+
2584
2622
  /**
2585
2623
  * Possible language key of all supported language mutations.
2586
2624
  * @public
@@ -2629,7 +2667,13 @@ export declare interface LeaderboardsRequest {
2629
2667
  */
2630
2668
  export declare interface LinkedVideo {
2631
2669
  video: Video;
2632
- type: 'CUT' | 'TRAILER' | 'BONUS' | 'CHILD' | 'TEASER' | 'TASTING' | 'VIRTUAL_PROGRAM' | 'LANGUAGE'
2670
+ type: 'CUT' | 'TRAILER' | 'BONUS' | 'CHILD'
2671
+ /**
2672
+ * Recommendation for the video that appears ahead of
2673
+ * algorithmic recommendations on the detail page. Works one-way: if A
2674
+ * links to B, B is recommended for A only (unless B links back).
2675
+ */
2676
+ | 'RECOMMENDED' | 'TEASER' | 'TASTING' | 'VIRTUAL_PROGRAM' | 'LANGUAGE'
2633
2677
  /**
2634
2678
  * Will render separate mini-player on top of the main one, playing given video.
2635
2679
  */
@@ -3169,11 +3213,6 @@ export declare type Nullable<T> = {
3169
3213
  [P in keyof T]: T[P] | null;
3170
3214
  };
3171
3215
 
3172
- /**
3173
- * @public
3174
- */
3175
- export declare type ObjectType = Record<string, any>;
3176
-
3177
3216
  /**
3178
3217
  * @public
3179
3218
  */
@@ -3929,6 +3968,7 @@ export declare interface PlayerWrapper {
3929
3968
  isPaused: boolean;
3930
3969
  isPlaying: boolean;
3931
3970
  isIdle: boolean;
3971
+ isFullscreen: boolean;
3932
3972
  language: LangCode | null;
3933
3973
  nextRecommendedVideo: Video | null;
3934
3974
  prerollCheck: PrerollCheck;
@@ -4018,7 +4058,11 @@ export declare enum PlayerWrapperEvents {
4018
4058
  /**
4019
4059
  * Triggered when an ad finishes playing
4020
4060
  */
4021
- 'ad-ended' = "ad-ended"
4061
+ 'ad-ended' = "ad-ended",
4062
+ /**
4063
+ * Triggered when companion ads are available for the current ad
4064
+ */
4065
+ 'companion-ads' = "companion-ads"
4022
4066
  }
4023
4067
 
4024
4068
  /**
@@ -5737,6 +5781,12 @@ export declare interface SimplifiedVideoController {
5737
5781
  * @param callback - Function called when an ad finishes playing
5738
5782
  */
5739
5783
  addEventListener(event: 'ad-ended', callback: () => void): void;
5784
+ /**
5785
+ * Add an event listener for companion ads events
5786
+ * @param event - Must be 'companion-ads'
5787
+ * @param callback - Function called when companion ads are available
5788
+ */
5789
+ addEventListener(event: 'companion-ads', callback: (companionAds: CompanionAd[]) => void): void;
5740
5790
  /**
5741
5791
  * Remove an event listener
5742
5792
  * @param event - The event name to stop listening for
@@ -5868,7 +5918,7 @@ export declare interface StartLiveStreamResponse {
5868
5918
  error?: string;
5869
5919
  }
5870
5920
 
5871
- export declare type StaticAdsBreak = StaticAdsBreakPostrollPreroll | StaticAdsBreakMidroll;
5921
+ export declare type StaticAdsBreak = StaticAdsBreakPostrollPreroll | StaticAdsBreakMidroll | StaticAdsBreakReplacement;
5872
5922
 
5873
5923
  export declare interface StaticAdsBreakMidroll {
5874
5924
  type: 'midroll';
@@ -5881,6 +5931,11 @@ declare interface StaticAdsBreakPostrollPreroll {
5881
5931
  url: string;
5882
5932
  }
5883
5933
 
5934
+ export declare interface StaticAdsBreakReplacement {
5935
+ type: 'replacement';
5936
+ url: string;
5937
+ }
5938
+
5884
5939
  /**
5885
5940
  * @public
5886
5941
  */
@@ -6411,7 +6466,7 @@ export declare interface TivioConfig {
6411
6466
  };
6412
6467
  secret: string;
6413
6468
  /**
6414
- * Language used when isLanguageSelectionEnabled is false | undefined or when not possible to load language from local storage or localization worker
6469
+ * Language used when no languageSelector is set or when not possible to load language from local storage or localization worker
6415
6470
  */
6416
6471
  language: LangCode;
6417
6472
  debug?: boolean;
@@ -6419,15 +6474,16 @@ export declare interface TivioConfig {
6419
6474
  firebaseApp?: any | null;
6420
6475
  firebaseFactory?: (config: object, appName?: string) => firebase_2.FirebaseApp;
6421
6476
  authDomainOverride?: string;
6477
+ /**
6478
+ * @deprecated this field is no longer in use and has no impact when set.
6479
+ */
6422
6480
  firestore?: any | null;
6423
6481
  currency: Currency;
6424
6482
  /**
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
6483
+ * Represents an optional array of LanguageSelector objects.
6484
+ * Used to define and manage a list of supported languages for different language-usages (user, content,...).
6429
6485
  */
6430
- isLanguageSelectionEnabled?: boolean;
6486
+ languageSelectors?: Partial<Record<LanguageSelector, LangCode[]>>;
6431
6487
  applicationId?: string;
6432
6488
  isTivioProApp?: boolean;
6433
6489
  lockApplicationHandle?: string;
@@ -6454,6 +6510,7 @@ export declare interface TivioConfig {
6454
6510
  * customTokenCookiesDomain: 'example.com'
6455
6511
  */
6456
6512
  customTokenCookiesDomain?: string;
6513
+ enableGtmPlayerEvents?: boolean;
6457
6514
  }
6458
6515
 
6459
6516
  /**
@@ -6707,12 +6764,18 @@ export declare type TivioJsBundleExposedApi = {
6707
6764
  /**
6708
6765
  * Get tag by its id.
6709
6766
  * @param tagId - tag id
6710
- * @returns {Promise<Tag | null>} widget or null if tag does not exists
6767
+ * @returns {Promise<Tag | null>} tag or null if tag does not exists
6711
6768
  */
6712
6769
  getTagById: (tagId: string) => Promise<Tag | null>;
6770
+ /**
6771
+ * Get tags by their ids.
6772
+ * @param tagIds - tag ids
6773
+ * @returns {Promise<Tag[]} list of tags for given ids
6774
+ */
6775
+ getTagsByIds: (tagIds: string[]) => Promise<Tag[]>;
6713
6776
  createPlayerWrapper: (playerImplementation: PlayerInterfaceForPlayerWrapper) => TivioPlayerWrapper;
6714
6777
  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'>;
6778
+ } & 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
6779
 
6717
6780
  /**
6718
6781
  * @public
@@ -6784,6 +6847,7 @@ export declare type TivioSetters = {
6784
6847
  * @param language
6785
6848
  */
6786
6849
  setLanguage: (language: LangCode) => void;
6850
+ setContentLanguage: (language: LangCode) => void;
6787
6851
  setStorageManager: (storageManager: StorageManager_2) => void;
6788
6852
  setUser: (userId: string | null, userPayload?: UserPayload) => Promise<void>;
6789
6853
  };
@@ -6812,10 +6876,6 @@ export declare type TivioSubscriptions = {
6812
6876
  subscribeToItemsInRow: SubscribeToItemsInRow;
6813
6877
  subscribeToRowsInScreen: SubscribeToRowsInScreen;
6814
6878
  subscribeToTaggedVideos: SubscribeToTaggedVideos;
6815
- registerOverlayCallbacks: (callbacks: {
6816
- onShow: () => void;
6817
- onHide: () => void;
6818
- }) => void;
6819
6879
  };
6820
6880
 
6821
6881
  /**
@@ -7031,6 +7091,10 @@ export declare type UpdateNotificationSettingsResponse = Promise<boolean>;
7031
7091
 
7032
7092
  export declare type UpsertCommentResponse = AddEditCommentResponse | DeleteCommentResponse;
7033
7093
 
7094
+ export declare type UrlNamesType = {
7095
+ [key in LangCode]?: string[];
7096
+ };
7097
+
7034
7098
  /**
7035
7099
  * @public
7036
7100
  */
@@ -7660,23 +7724,18 @@ export declare type VastApiFramework = string | 'VPAID' | null;
7660
7724
  * @public
7661
7725
  */
7662
7726
  export declare enum VastProvider {
7663
- CNC_PREBID = "cnc-prebid",
7664
7727
  CNC_STARGAZE_PREROLL_1 = "cnc-stargaze-preroll-1",
7665
7728
  CNC_STARGAZE_PREROLL_2 = "cnc-stargaze-preroll-2",
7666
7729
  CNC_STARGAZE_MIDROLL = "cnc-stargaze-midroll",
7667
- ETARGET_PREBID = "etarget-prebid",
7668
7730
  FALLBACK_HLS = "fallback-hls",
7669
7731
  FALLBACK_MP4 = "fallback",
7670
7732
  GARAZ_TV = "garaz.tv",
7671
7733
  GARAZ_TV_DEV = "garaz.tv.dev",
7672
- IMPRESSION_MEDIA_PREBID = "impressionMedia-prebid",
7673
7734
  JOJ_ADFORM = "joj",
7674
7735
  JOJ_SMART = "joj-smart",
7675
7736
  JOJ_AD_MANAGER_VOD_PREROLL = "joj-ad-manager-vod-preroll",
7676
7737
  JOJ_AD_MANAGER_VOD_MIDROLL = "joj-ad-manager-vod-midroll",
7677
7738
  JOJ_AD_MANAGER_LIVE_PREROLL = "joj-ad-manager-live-preroll",
7678
- MALL_TV = "malltv",
7679
- MALL_TV_PREBID = "malltv-prebid",
7680
7739
  PRIMA = "prima",
7681
7740
  TEST = "test",
7682
7741
  TEST_VPAID = "test-vpaid",
@@ -7788,6 +7847,7 @@ export declare interface Video extends RowItem, MonetizableItem, ReactableConten
7788
7847
  forcedCapabilities: PlayerCapability[] | null;
7789
7848
  mainLinkedVideoId?: string;
7790
7849
  getLinkedVideoIdByLanguage: (lang: LangCode) => string | undefined;
7850
+ externals?: VideoExternals;
7791
7851
  }
7792
7852
 
7793
7853
  /**
@@ -7826,6 +7886,7 @@ export declare interface VideoController {
7826
7886
  addEventListener(event: 'ad-started', callback: (value: AdMetadata & {
7827
7887
  adCtaElement: HTMLElement | null;
7828
7888
  }) => void): void;
7889
+ addEventListener(event: 'companion-ads', callback: (value: CompanionAd[]) => void): void;
7829
7890
  /**
7830
7891
  * Remove an event listener
7831
7892
  * @param event - The event name to stop listening for
@@ -8081,7 +8142,7 @@ export declare interface VideoTileSpecificData {
8081
8142
  assets?: AssetsField;
8082
8143
  episodeNumber?: number;
8083
8144
  seasonNumber?: number;
8084
- urlName?: VideoUrlNames;
8145
+ urlName?: UrlNamesType;
8085
8146
  monetizations?: VideoTileMonetizationData[];
8086
8147
  description?: Translation;
8087
8148
  }
@@ -8150,13 +8211,6 @@ export declare enum VideoType {
8150
8211
  CHILD = "CHILD"
8151
8212
  }
8152
8213
 
8153
- /**
8154
- * @public
8155
- */
8156
- export declare type VideoUrlNames = {
8157
- [key in LangCode]?: string[];
8158
- };
8159
-
8160
8214
  export declare interface ViewCountItem {
8161
8215
  /**
8162
8216
  * Unix timestamp
@@ -8603,6 +8657,10 @@ export declare interface WebConfig {
8603
8657
  * Map for all handlers
8604
8658
  */
8605
8659
  handlers?: PurchaseEventHandlers;
8660
+ homeScreen?: {
8661
+ useFullHeight?: boolean;
8662
+ };
8663
+ disableModalSwitcher?: boolean;
8606
8664
  }
8607
8665
 
8608
8666
  /**
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.1",
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.140",
42
42
  "dayjs": "^1.11.0",
43
43
  "es7-object-polyfill": "^1.0.1",
44
44
  "firebase": "8.10.1",