@inappstory/react-sdk 1.11.0 → 1.11.2

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.
@@ -9818,7 +9818,7 @@ class GameClientConfig {
9818
9818
  value: void 0
9819
9819
  });
9820
9820
  const storyManagerConfig = this.storyManager.config;
9821
- const sdkVersion = "1.11.0";
9821
+ const sdkVersion = "1.11.2";
9822
9822
  const placeholders = this.storyManager.rootStore.placeholderStore.placeholders;
9823
9823
  const session = this.storyManager.rootStore.sessionStore.session;
9824
9824
  this.sessionId = session.id;
@@ -14988,7 +14988,7 @@ var iamApi_esDecorate = (undefined && undefined.__esDecorate) || function (ctor,
14988
14988
 
14989
14989
 
14990
14990
 
14991
- const messageFields = "campaign_name,id,events,appearance,slides_html,type,frequency_limit,display_to,display_from,disable_close,need_placeholders,has_limit";
14991
+ const messageFields = "campaign_name,id,events,appearance,type,frequency_limit,display_to,display_from,disable_close,need_placeholders,has_limit,slides";
14992
14992
  const messageFieldsWithPrefix = messageFields
14993
14993
  .split(",")
14994
14994
  .map(field => `messages.${field}`)
@@ -15014,7 +15014,8 @@ let IamApi = (() => {
15014
15014
  options
15015
15015
  }, {
15016
15016
  params: {
15017
- fields: messageFieldsWithPrefix
15017
+ fields: messageFieldsWithPrefix,
15018
+ expand: "messages.slides"
15018
15019
  }
15019
15020
  });
15020
15021
  return response.data.messages;
@@ -15028,8 +15029,8 @@ let IamApi = (() => {
15028
15029
  async fetchById(messageId) {
15029
15030
  const response = await api.get(`inappmessaging/message/${messageId}`, {
15030
15031
  params: {
15031
- expand: "slides_html",
15032
- fields: messageFields
15032
+ expand: "slides",
15033
+ fields: messageFields,
15033
15034
  }
15034
15035
  });
15035
15036
  const messageDto = response.data;
@@ -15492,18 +15493,27 @@ let IamMessageSlide = (() => {
15492
15493
  value: (iamMessageSlide_runInitializers(this, _instanceExtraInitializers), message)
15493
15494
  });
15494
15495
  _IamMessageSlide__html_accessor_storage.set(this, iamMessageSlide_runInitializers(this, __html_initializers, ""));
15495
- iamMessageSlide_runInitializers(this, __html_extraInitializers);
15496
- this.message = message;
15496
+ Object.defineProperty(this, "_payload", {
15497
+ enumerable: true,
15498
+ configurable: true,
15499
+ writable: true,
15500
+ value: iamMessageSlide_runInitializers(this, __html_extraInitializers)
15501
+ });
15497
15502
  }
15498
15503
  get html() {
15499
15504
  return this._html;
15500
15505
  }
15506
+ get payload() {
15507
+ return this._payload;
15508
+ }
15501
15509
  updateByDto(messageSlideDto) {
15510
+ var _b;
15502
15511
  this._html = this.getSlideHtml(messageSlideDto);
15512
+ this._payload = (_b = messageSlideDto.event_payload) === null || _b === void 0 ? void 0 : _b.payload;
15503
15513
  }
15504
15514
  getSlideHtml(messageSlideDto) {
15505
15515
  var _b;
15506
- let slideHtml = messageSlideDto;
15516
+ let slideHtml = messageSlideDto.html;
15507
15517
  slideHtml = replaceAll(slideHtml, `{{nonce}}`, (_b = getNonce()) !== null && _b !== void 0 ? _b : "");
15508
15518
  return slideHtml;
15509
15519
  }
@@ -15854,7 +15864,7 @@ let IamMessage = (() => {
15854
15864
  this._hasLimit = Boolean(messageDto.has_limit);
15855
15865
  this._appearanceOptions = new IamAppearanceOptionsFactory().create(this._type, messageDto.appearance);
15856
15866
  this._needPlaceholders = messageDto.need_placeholders;
15857
- this.updateMessageSlides(messageDto.slides_html);
15867
+ this.updateMessageSlides(messageDto.slides);
15858
15868
  }
15859
15869
  hasEvent(eventName) {
15860
15870
  return Boolean(this._events[eventName]);
@@ -16754,6 +16764,7 @@ let IamReaderViewModel = (() => {
16754
16764
  if (!this.activeMessage)
16755
16765
  return;
16756
16766
  this.emit(IamReaderEvent.WidgetEvent, {
16767
+ payload: this.activeMessage.payload,
16757
16768
  message: this.activeMessage.toPublicDto(),
16758
16769
  name: widgetEvent.type,
16759
16770
  data: widgetEvent.widgetPayload
@@ -16765,6 +16776,7 @@ let IamReaderViewModel = (() => {
16765
16776
  }
16766
16777
  emitCloseEvent(message) {
16767
16778
  this.emit(IamReaderEvent.Close, {
16779
+ payload: message.payload,
16768
16780
  message: message.toPublicDto()
16769
16781
  });
16770
16782
  }
@@ -16873,10 +16885,12 @@ class openUrlAction_OpenUrlAction {
16873
16885
  const event = {
16874
16886
  src: StoryManagerLinkEventSource.IamReader,
16875
16887
  data: {
16888
+ type: this.iamMessage.type,
16876
16889
  id: this.iamMessage.id,
16877
16890
  index: this.iamMessage.activeSlideIndex,
16878
16891
  url,
16879
- elementId: payload.elementId
16892
+ elementId: payload.elementId,
16893
+ payload: this.iamMessage.payload,
16880
16894
  }
16881
16895
  };
16882
16896
  this.storyManager.storyLinkClickHandler(event);
@@ -17390,6 +17404,11 @@ let IamMultiSlideMessageViewModel = (() => {
17390
17404
  get type() {
17391
17405
  return this.iamMessage.type;
17392
17406
  }
17407
+ get payload() {
17408
+ var _b;
17409
+ const slide = this.iamMessage.slides[this._activeSlideIndex];
17410
+ return (_b = slide === null || slide === void 0 ? void 0 : slide.payload) !== null && _b !== void 0 ? _b : null;
17411
+ }
17393
17412
  get needShowErrorScreen() {
17394
17413
  return this._needShowErrorScreen;
17395
17414
  }
@@ -20887,7 +20906,7 @@ class UgcEditorStore {
20887
20906
  const session = await this.storyManager.rootStore.sessionStore.open();
20888
20907
  const ugcEditorConfigDto = await this.ugcEditorApi.fetchUgcEditorConfig();
20889
20908
  const storyManagerConfig = this.storyManager.config;
20890
- const sdkVersion = "1.11.0";
20909
+ const sdkVersion = "1.11.2";
20891
20910
  this._config = {
20892
20911
  sessionId: session.id,
20893
20912
  apiKey: storyManagerConfig.apiKey,
@@ -21347,11 +21366,11 @@ class StoryManager extends TypedEventEmitter {
21347
21366
  return deviceDescriptor.deviceId;
21348
21367
  }
21349
21368
  get sdkVersionName() {
21350
- const sdkVersionName = "1.11.0";
21369
+ const sdkVersionName = "1.11.2";
21351
21370
  return sdkVersionName || "0.0.0";
21352
21371
  }
21353
21372
  get sdkVersionCode() {
21354
- const sdkVersionCode = 11100;
21373
+ const sdkVersionCode = 11102;
21355
21374
  return sdkVersionCode ? parseInt(sdkVersionCode) : 0;
21356
21375
  }
21357
21376
  get lang() {
@@ -21415,7 +21434,7 @@ class StoryManager extends TypedEventEmitter {
21415
21434
  this.rootStore.storyManagerConfigStore.setConfig(configDto);
21416
21435
  }
21417
21436
  setUserAgent(userAgent) {
21418
- const sdkVersionCode = 11100;
21437
+ const sdkVersionCode = 11102;
21419
21438
  const buildVersion = sdkVersionCode ? parseInt(sdkVersionCode) : 0;
21420
21439
  // According to RFC5987, HTTP header values can legitimately be supplied using the ISO-8859-1 encoding.
21421
21440
  this._userAgent = `${userAgent} ${convertStrToLatin1(navigator.userAgent)}`;