@inappstory/react-sdk 1.15.3 → 1.15.4

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.
@@ -7759,6 +7759,12 @@ let StorySlideViewModel = (() => {
7759
7759
  paused: false
7760
7760
  })
7761
7761
  });
7762
+ Object.defineProperty(this, "_activeLayerIndex", {
7763
+ enumerable: true,
7764
+ configurable: true,
7765
+ writable: true,
7766
+ value: 0
7767
+ });
7762
7768
  Object.defineProperty(this, "handleTouchEnd", {
7763
7769
  enumerable: true,
7764
7770
  configurable: true,
@@ -7774,6 +7780,9 @@ let StorySlideViewModel = (() => {
7774
7780
  get index() {
7775
7781
  return this._index;
7776
7782
  }
7783
+ get activeLayerIndex() {
7784
+ return this._activeLayerIndex;
7785
+ }
7777
7786
  get story() {
7778
7787
  return this._story;
7779
7788
  }
@@ -7868,7 +7877,8 @@ let StorySlideViewModel = (() => {
7868
7877
  async restart() {
7869
7878
  try {
7870
7879
  this.story.hideErrorScreen();
7871
- this.story.showLoaderScreen();
7880
+ this.commit({ inited: false, started: false, paused: false });
7881
+ await this.init();
7872
7882
  await this.slideApi.slideRestart({ muted: this._story.muted });
7873
7883
  this.commit({ inited: true, started: true, paused: false });
7874
7884
  }
@@ -7950,6 +7960,7 @@ let StorySlideViewModel = (() => {
7950
7960
  }
7951
7961
  }
7952
7962
  showLayerByIndex(index) {
7963
+ this._activeLayerIndex = index;
7953
7964
  this.slideApi.showLayer(index);
7954
7965
  this._cover = this.getCoverByLayer();
7955
7966
  }
@@ -9765,10 +9776,6 @@ let StoryViewModel = (() => {
9765
9776
  if (error)
9766
9777
  this.handleStoryError(error);
9767
9778
  }
9768
- async reset() {
9769
- this.textInput.close();
9770
- await this.slideApiHandlers.resetStory();
9771
- }
9772
9779
  async recover() {
9773
9780
  const storyError = Boolean(this.error);
9774
9781
  this.hideErrorScreen();
@@ -9812,8 +9819,12 @@ let StoryViewModel = (() => {
9812
9819
  this.storyReader.unmute();
9813
9820
  this.activeSlide.unmute();
9814
9821
  }
9815
- showLayer(index) {
9822
+ async showLayer(index) {
9816
9823
  var _b;
9824
+ if (this.activeSlide.activeLayerIndex === index) {
9825
+ await this.activeSlide.restart();
9826
+ return;
9827
+ }
9817
9828
  this.statisticV2Service.sendSlideLayout({
9818
9829
  layoutIndex: index,
9819
9830
  storyId: this.id,
@@ -10356,7 +10367,7 @@ class GameClientConfig {
10356
10367
  value: void 0
10357
10368
  });
10358
10369
  const storyManagerConfig = this.storyManager.config;
10359
- const sdkVersion = "1.15.3";
10370
+ const sdkVersion = "1.15.4";
10360
10371
  const placeholders = this.storyManager.rootStore.placeholderStore.placeholders;
10361
10372
  const session = this.storyManager.rootStore.sessionStore.session;
10362
10373
  this.sessionId = session.id;
@@ -11850,21 +11861,6 @@ class StorySlideApiHandlers {
11850
11861
  feedSlug: (_b = this.story.feed) === null || _b === void 0 ? void 0 : _b.slug
11851
11862
  }, forceEnableStatisticV2);
11852
11863
  }
11853
- async resetStory() {
11854
- var _a;
11855
- let savedData = {};
11856
- let data = await this.getCardLocalData();
11857
- data = Object.assign({}, (_a = this.getCardServerData()) !== null && _a !== void 0 ? _a : {}, data);
11858
- for (let key in data) {
11859
- if (data.hasOwnProperty(key) && /^_gm_[A-z0-9-_]+_attempts$/.test(key)) {
11860
- savedData[key] = data[key];
11861
- }
11862
- }
11863
- this.updateCardServerDataLocally(savedData);
11864
- this.setCardLocalData(savedData, true);
11865
- this.showCardSlide(0);
11866
- this.showLayer(0);
11867
- }
11868
11864
  getCardFonts() {
11869
11865
  var _a;
11870
11866
  const session = this.storyManager.rootStore.sessionStore.session;
@@ -21933,7 +21929,7 @@ class UgcEditorStore {
21933
21929
  const session = await this.storyManager.rootStore.sessionStore.open();
21934
21930
  const ugcEditorConfigDto = await this.ugcEditorApi.fetchUgcEditorConfig();
21935
21931
  const storyManagerConfig = this.storyManager.config;
21936
- const sdkVersion = "1.15.3";
21932
+ const sdkVersion = "1.15.4";
21937
21933
  this._config = {
21938
21934
  sessionId: session.id,
21939
21935
  apiKey: storyManagerConfig.apiKey,
@@ -22393,11 +22389,11 @@ class StoryManager extends TypedEventEmitter {
22393
22389
  return deviceDescriptor.deviceId;
22394
22390
  }
22395
22391
  get sdkVersionName() {
22396
- const sdkVersionName = "1.15.3";
22392
+ const sdkVersionName = "1.15.4";
22397
22393
  return sdkVersionName || "0.0.0";
22398
22394
  }
22399
22395
  get sdkVersionCode() {
22400
- const sdkVersionCode = 11503;
22396
+ const sdkVersionCode = 11504;
22401
22397
  return sdkVersionCode ? parseInt(sdkVersionCode) : 0;
22402
22398
  }
22403
22399
  get lang() {
@@ -22461,7 +22457,7 @@ class StoryManager extends TypedEventEmitter {
22461
22457
  this.rootStore.storyManagerConfigStore.setConfig(configDto);
22462
22458
  }
22463
22459
  setUserAgent(userAgent) {
22464
- const sdkVersionCode = 11503;
22460
+ const sdkVersionCode = 11504;
22465
22461
  const buildVersion = sdkVersionCode ? parseInt(sdkVersionCode) : 0;
22466
22462
  // According to RFC5987, HTTP header values can legitimately be supplied using the ISO-8859-1 encoding.
22467
22463
  this._userAgent = `${userAgent} ${convertStrToLatin1(navigator.userAgent)}`;