@inappstory/react-sdk 1.10.0 → 1.10.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.
@@ -9673,6 +9673,7 @@ const isObject_js_namespaceObject = isObject_js_x({ ["default"]: () => (__WEBPAC
9673
9673
  ;// CONCATENATED MODULE: ../core/src/domain/gameCenter/api/gameCenterApi.ts
9674
9674
 
9675
9675
 
9676
+ ;
9676
9677
  class GameCenterApi {
9677
9678
  async openGame({ gameInstanceId, gameOptions }) {
9678
9679
  const params = {
@@ -9866,7 +9867,7 @@ class GameClientConfig {
9866
9867
  value: void 0
9867
9868
  });
9868
9869
  const storyManagerConfig = this.storyManager.config;
9869
- const sdkVersion = "1.10.0";
9870
+ const sdkVersion = "1.10.1";
9870
9871
  const placeholders = this.storyManager.rootStore.placeholderStore.placeholders;
9871
9872
  const session = this.storyManager.rootStore.sessionStore.session;
9872
9873
  this.sessionId = session.id;
@@ -10096,7 +10097,7 @@ class GameSplashScreen {
10096
10097
 
10097
10098
 
10098
10099
  class Game {
10099
- constructor(id, storyManager, gameDto) {
10100
+ constructor(id, storyManager, gameDto, options) {
10100
10101
  var _a, _b;
10101
10102
  Object.defineProperty(this, "id", {
10102
10103
  enumerable: true,
@@ -10110,6 +10111,18 @@ class Game {
10110
10111
  writable: true,
10111
10112
  value: storyManager
10112
10113
  });
10114
+ Object.defineProperty(this, "gameDto", {
10115
+ enumerable: true,
10116
+ configurable: true,
10117
+ writable: true,
10118
+ value: gameDto
10119
+ });
10120
+ Object.defineProperty(this, "options", {
10121
+ enumerable: true,
10122
+ configurable: true,
10123
+ writable: true,
10124
+ value: options
10125
+ });
10113
10126
  Object.defineProperty(this, "splashScreen", {
10114
10127
  enumerable: true,
10115
10128
  configurable: true,
@@ -14553,10 +14566,10 @@ let StoryManagerConfig = (() => {
14553
14566
  this._appPackageId = (_b = configDto.appPackageId) !== null && _b !== void 0 ? _b : "";
14554
14567
  this._disableDeviceId = Boolean(configDto.disableDeviceId);
14555
14568
  this.setOptions(configDto.options);
14556
- this.setApiKey(configDto.apiKey);
14569
+ this.setApiKey(configDto.apiKey).catch(console.error);
14557
14570
  this.setAnonymous(configDto.anonymous);
14558
- this.setUserId((_c = configDto.userId) !== null && _c !== void 0 ? _c : "", configDto.userIdSign);
14559
- this.setLang(configDto.lang);
14571
+ this.setUserId((_c = configDto.userId) !== null && _c !== void 0 ? _c : "", configDto.userIdSign).catch(console.error);
14572
+ this.setLang(configDto.lang).catch(console.error);
14560
14573
  this.setTextPlaceholders((_d = configDto.placeholders) !== null && _d !== void 0 ? _d : {});
14561
14574
  this.setImagePlaceholders((_e = configDto.imagePlaceholders) !== null && _e !== void 0 ? _e : {});
14562
14575
  this.setTags((_f = configDto.tags) !== null && _f !== void 0 ? _f : []);
@@ -17798,12 +17811,6 @@ let GameReaderViewModel = (() => {
17798
17811
  writable: true,
17799
17812
  value: 0
17800
17813
  });
17801
- Object.defineProperty(this, "openGameOptions", {
17802
- enumerable: true,
17803
- configurable: true,
17804
- writable: true,
17805
- value: {}
17806
- });
17807
17814
  Object.defineProperty(this, "gameSession", {
17808
17815
  enumerable: true,
17809
17816
  configurable: true,
@@ -17869,10 +17876,9 @@ let GameReaderViewModel = (() => {
17869
17876
  try {
17870
17877
  this.isOpenGameInProgress = true;
17871
17878
  await this.ensureCanOpen(gameInstanceId);
17872
- await this.launchGameById(gameInstanceId);
17879
+ await this.launchGameById(gameInstanceId, options);
17873
17880
  this._isOpened = true;
17874
17881
  this._gameShouldBeShown = false;
17875
- this.openGameOptions = options;
17876
17882
  this.scrollbarHelper.hide();
17877
17883
  }
17878
17884
  catch (error) {
@@ -17898,15 +17904,15 @@ let GameReaderViewModel = (() => {
17898
17904
  if (this.game)
17899
17905
  throw new IasGameAlreadyOpenError(this.game.id);
17900
17906
  }
17901
- async launchGameById(gameInstanceId) {
17907
+ async launchGameById(gameInstanceId, options) {
17902
17908
  this._gameError = null;
17903
17909
  this._isGameLoading = true;
17904
17910
  await this.storyManager.rootStore.sessionStore.open();
17905
17911
  const gameDto = await this.gameCenterApi.openGame({
17906
17912
  gameInstanceId,
17907
- gameOptions: this.openGameOptions
17913
+ gameOptions: options
17908
17914
  });
17909
- this._game = new Game(gameInstanceId, this.storyManager, gameDto);
17915
+ this._game = new Game(gameInstanceId, this.storyManager, gameDto, options);
17910
17916
  }
17911
17917
  async initGame(iframe, params) {
17912
17918
  if (!this._game)
@@ -17958,7 +17964,7 @@ let GameReaderViewModel = (() => {
17958
17964
  this._game = null;
17959
17965
  if (!game)
17960
17966
  throw new IasNoOpenedGameError();
17961
- await this.launchGameById(game.id);
17967
+ await this.launchGameById(game.id, game.options);
17962
17968
  }
17963
17969
  handleGameLoadError(error) {
17964
17970
  if (error instanceof GameLoadFailedError && error.canTryReload && this.canRestartGame()) {
@@ -20897,7 +20903,7 @@ class UgcEditorStore {
20897
20903
  const session = await this.storyManager.rootStore.sessionStore.open();
20898
20904
  const ugcEditorConfigDto = await this.ugcEditorApi.fetchUgcEditorConfig();
20899
20905
  const storyManagerConfig = this.storyManager.config;
20900
- const sdkVersion = "1.10.0";
20906
+ const sdkVersion = "1.10.1";
20901
20907
  this._config = {
20902
20908
  sessionId: session.id,
20903
20909
  apiKey: storyManagerConfig.apiKey,
@@ -21357,11 +21363,11 @@ class StoryManager extends TypedEventEmitter {
21357
21363
  return deviceDescriptor.deviceId;
21358
21364
  }
21359
21365
  get sdkVersionName() {
21360
- const sdkVersionName = "1.10.0";
21366
+ const sdkVersionName = "1.10.1";
21361
21367
  return sdkVersionName || "0.0.0";
21362
21368
  }
21363
21369
  get sdkVersionCode() {
21364
- const sdkVersionCode = 11000;
21370
+ const sdkVersionCode = 11001;
21365
21371
  return sdkVersionCode ? parseInt(sdkVersionCode) : 0;
21366
21372
  }
21367
21373
  get lang() {
@@ -21425,7 +21431,7 @@ class StoryManager extends TypedEventEmitter {
21425
21431
  this.rootStore.storyManagerConfigStore.setConfig(configDto);
21426
21432
  }
21427
21433
  setUserAgent(userAgent) {
21428
- const sdkVersionCode = 11000;
21434
+ const sdkVersionCode = 11001;
21429
21435
  const buildVersion = sdkVersionCode ? parseInt(sdkVersionCode) : 0;
21430
21436
  // According to RFC5987, HTTP header values can legitimately be supplied using the ISO-8859-1 encoding.
21431
21437
  this._userAgent = `${userAgent} ${convertStrToLatin1(navigator.userAgent)}`;