@inappstory/react-sdk 1.8.0-rc.11 → 1.8.0-rc.13

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.
@@ -2406,11 +2406,39 @@ function queryCache(originalMethod, context) {
2406
2406
  };
2407
2407
  }
2408
2408
 
2409
+ ;// CONCATENATED MODULE: ../core/src/helpers/decorators/safeCustomElement.ts
2410
+ /**
2411
+ * HMR-safe version of @customElement
2412
+ * Prevents an error when re-registering a component.
2413
+ */
2414
+ function safeCustomElement(tagName) {
2415
+ return function (classDef, context) {
2416
+ const defineIfNeeded = (ctor) => {
2417
+ if (!customElements.get(tagName)) {
2418
+ customElements.define(tagName, ctor);
2419
+ }
2420
+ else {
2421
+ console.warn(`[IAS] Element "${tagName}" is already registered. Skipping re-definition`);
2422
+ }
2423
+ };
2424
+ // New decorator specification: context is available and has addInitializer
2425
+ if (context && typeof context.addInitializer === "function") {
2426
+ context.addInitializer(() => defineIfNeeded(classDef));
2427
+ }
2428
+ else {
2429
+ // Legacy-style decorators: just call define right away
2430
+ defineIfNeeded(classDef);
2431
+ }
2432
+ return classDef;
2433
+ };
2434
+ }
2435
+
2409
2436
  ;// CONCATENATED MODULE: ../core/src/helpers/decorators/index.ts
2410
2437
 
2411
2438
 
2412
2439
 
2413
2440
 
2441
+
2414
2442
  ;// CONCATENATED MODULE: ../core/src/helpers/encodeSvg.ts
2415
2443
  const symbols = /[\r\n%#()<>?[\\\]^`{|}]/g;
2416
2444
  function encodeSVG(data, externalQuotesValue = "double") {
@@ -7974,9 +8002,6 @@ let StorySlideViewModel = (() => {
7974
8002
  }
7975
8003
  });
7976
8004
  }
7977
- get state() {
7978
- return this.slideApi.state;
7979
- }
7980
8005
  get index() {
7981
8006
  return this._index;
7982
8007
  }
@@ -8206,17 +8231,20 @@ let StorySlideViewModel = (() => {
8206
8231
  }
8207
8232
  }
8208
8233
  async destroy() {
8234
+ const release = await this.mutex.acquire();
8209
8235
  try {
8210
8236
  this.isStarted = false;
8211
8237
  this.isInited = false;
8212
8238
  this.story.touchController.off(TouchControllerEvent.TouchEnd, this.handleTouchEnd);
8213
8239
  if (this.cacheManager)
8214
8240
  this.slide.restoreOriginalResourceUrls();
8215
- await this.slideApi.destroy();
8216
8241
  }
8217
8242
  catch (error) {
8218
8243
  console.error(error);
8219
8244
  }
8245
+ finally {
8246
+ release();
8247
+ }
8220
8248
  }
8221
8249
  getNavigationDirection(event, currentTarget) {
8222
8250
  const xPercent = this.getClickPosition(event, currentTarget);
@@ -10172,8 +10200,6 @@ let StoryViewModel = (() => {
10172
10200
  async onSlideChange(index) {
10173
10201
  var _b;
10174
10202
  try {
10175
- if (!this.isInited || !this.isStarted)
10176
- return;
10177
10203
  const lastSlide = this.getSlideByIndex(this._activeSlideIndex);
10178
10204
  const activeSlide = this.getSlideByIndex(index);
10179
10205
  this._activeSlideIndex = index;
@@ -10709,7 +10735,7 @@ class GameClientConfig {
10709
10735
  value: void 0
10710
10736
  });
10711
10737
  const storyManagerConfig = this.storyManager.config;
10712
- const sdkVersion = "1.8.0-rc.11";
10738
+ const sdkVersion = "1.8.0-rc.13";
10713
10739
  const placeholders = this.storyManager.rootStore.placeholderStore.placeholders;
10714
10740
  const session = this.storyManager.rootStore.sessionStore.session;
10715
10741
  this.sessionId = session.id;
@@ -20982,7 +21008,7 @@ class UgcEditorStore {
20982
21008
  const session = await this.storyManager.rootStore.sessionStore.open();
20983
21009
  const ugcEditorConfigDto = await this.ugcEditorApi.fetchUgcEditorConfig();
20984
21010
  const storyManagerConfig = this.storyManager.config;
20985
- const sdkVersion = "1.8.0-rc.11";
21011
+ const sdkVersion = "1.8.0-rc.13";
20986
21012
  this._config = {
20987
21013
  sessionId: session.id,
20988
21014
  apiKey: storyManagerConfig.apiKey,
@@ -21413,7 +21439,7 @@ class StoryManager extends TypedEventEmitter {
21413
21439
  return this._userAgent;
21414
21440
  }
21415
21441
  get sdkVersionName() {
21416
- const sdkVersionName = "1.8.0-rc.11";
21442
+ const sdkVersionName = "1.8.0-rc.13";
21417
21443
  return sdkVersionName || "0.0.0";
21418
21444
  }
21419
21445
  get sdkVersionCode() {
@@ -26856,7 +26882,7 @@ var decorators_js_x = (y) => {
26856
26882
  var x = {}; __webpack_require__.d(x, y); return x
26857
26883
  }
26858
26884
  var decorators_js_y = (x) => (() => (x))
26859
- const decorators_js_namespaceObject = decorators_js_x({ ["customElement"]: () => (__WEBPACK_EXTERNAL_MODULE_lit_decorators_js_226d44c5__.customElement), ["property"]: () => (__WEBPACK_EXTERNAL_MODULE_lit_decorators_js_226d44c5__.property), ["query"]: () => (__WEBPACK_EXTERNAL_MODULE_lit_decorators_js_226d44c5__.query), ["state"]: () => (__WEBPACK_EXTERNAL_MODULE_lit_decorators_js_226d44c5__.state) });
26885
+ const decorators_js_namespaceObject = decorators_js_x({ ["property"]: () => (__WEBPACK_EXTERNAL_MODULE_lit_decorators_js_226d44c5__.property), ["query"]: () => (__WEBPACK_EXTERNAL_MODULE_lit_decorators_js_226d44c5__.query), ["state"]: () => (__WEBPACK_EXTERNAL_MODULE_lit_decorators_js_226d44c5__.state) });
26860
26886
  ;// CONCATENATED MODULE: ./src/InAppMessaging/controllers/viewportController.ts
26861
26887
  class ViewportController {
26862
26888
  constructor(host) {
@@ -27066,7 +27092,7 @@ var BottomSheet_classPrivateFieldSet = (undefined && undefined.__classPrivateFie
27066
27092
 
27067
27093
  let BottomSheet = (() => {
27068
27094
  var _BottomSheet_open_accessor_storage, _BottomSheet_disableClose_accessor_storage, _BottomSheet_geometry_accessor_storage, _BottomSheet_appearanceOptions_accessor_storage, _BottomSheet_touchController_accessor_storage, _BottomSheet_desktopMode_accessor_storage, _BottomSheet_isVisible_accessor_storage, _BottomSheet_isClosed_accessor_storage, _BottomSheet_backdropRef_accessor_storage, _BottomSheet_bottomSheetBoxRef_accessor_storage, _BottomSheet_bottomSheetRef_accessor_storage;
27069
- let _classDecorators = [(0,decorators_js_namespaceObject.customElement)("iam-bottom-sheet")];
27095
+ let _classDecorators = [safeCustomElement("iam-bottom-sheet")];
27070
27096
  let _classDescriptor;
27071
27097
  let _classExtraInitializers = [];
27072
27098
  let _classThis;
@@ -27345,9 +27371,10 @@ var ModalCloseButton_classPrivateFieldSet = (undefined && undefined.__classPriva
27345
27371
 
27346
27372
 
27347
27373
 
27374
+
27348
27375
  let Modal = (() => {
27349
27376
  var _Modal_closeBtnPosition_accessor_storage, _Modal_dir_accessor_storage;
27350
- let _classDecorators = [(0,decorators_js_namespaceObject.customElement)("iam-modal-close-btn")];
27377
+ let _classDecorators = [safeCustomElement("iam-modal-close-btn")];
27351
27378
  let _classDescriptor;
27352
27379
  let _classExtraInitializers = [];
27353
27380
  let _classThis;
@@ -27465,9 +27492,10 @@ var Modal_classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet)
27465
27492
 
27466
27493
  const ANIMATION_DURATION = 350;
27467
27494
 
27495
+
27468
27496
  let Modal_Modal = (() => {
27469
27497
  var _Modal_open_accessor_storage, _Modal_disableClose_accessor_storage, _Modal_fullscreen_accessor_storage, _Modal_geometry_accessor_storage, _Modal_appearanceOptions_accessor_storage, _Modal_dir_accessor_storage, _Modal_isVisible_accessor_storage, _Modal_isClosed_accessor_storage, _Modal_backdropRef_accessor_storage;
27470
- let _classDecorators = [(0,decorators_js_namespaceObject.customElement)("iam-modal")];
27498
+ let _classDecorators = [safeCustomElement("iam-modal")];
27471
27499
  let _classDescriptor;
27472
27500
  let _classExtraInitializers = [];
27473
27501
  let _classThis;
@@ -27717,9 +27745,10 @@ var FullscreenModal_classPrivateFieldSet = (undefined && undefined.__classPrivat
27717
27745
 
27718
27746
 
27719
27747
 
27748
+
27720
27749
  let FullscreenModal = (() => {
27721
27750
  var _FullscreenModal_open_accessor_storage, _FullscreenModal_geometry_accessor_storage, _FullscreenModal_appearanceOptions_accessor_storage;
27722
- let _classDecorators = [(0,decorators_js_namespaceObject.customElement)("iam-fullscreen-modal")];
27751
+ let _classDecorators = [safeCustomElement("iam-fullscreen-modal")];
27723
27752
  let _classDescriptor;
27724
27753
  let _classExtraInitializers = [];
27725
27754
  let _classThis;
@@ -27836,9 +27865,10 @@ var MessageViewFactory_classPrivateFieldSet = (undefined && undefined.__classPri
27836
27865
 
27837
27866
 
27838
27867
 
27868
+
27839
27869
  let MessageViewFactory = (() => {
27840
27870
  var _MessageViewFactory_appearanceOptions_accessor_storage, _MessageViewFactory_type_accessor_storage, _MessageViewFactory_open_accessor_storage, _MessageViewFactory_disableClose_accessor_storage, _MessageViewFactory_geometry_accessor_storage, _MessageViewFactory_touchController_accessor_storage, _MessageViewFactory_desktopMode_accessor_storage, _MessageViewFactory_dir_accessor_storage;
27841
- let _classDecorators = [(0,decorators_js_namespaceObject.customElement)("message-view-factory")];
27871
+ let _classDecorators = [safeCustomElement("message-view-factory")];
27842
27872
  let _classDescriptor;
27843
27873
  let _classExtraInitializers = [];
27844
27874
  let _classThis;
@@ -28019,7 +28049,7 @@ var MessageSlide_classPrivateFieldSet = (undefined && undefined.__classPrivateFi
28019
28049
 
28020
28050
  let MessageSlide = (() => {
28021
28051
  var _MessageSlide_message_accessor_storage, _MessageSlide_styleContext_accessor_storage, _MessageSlide_geometry_accessor_storage, _MessageSlide_slidesContainer_accessor_storage;
28022
- let _classDecorators = [(0,decorators_js_namespaceObject.customElement)("message-slide")];
28052
+ let _classDecorators = [safeCustomElement("message-slide")];
28023
28053
  let _classDescriptor;
28024
28054
  let _classExtraInitializers = [];
28025
28055
  let _classThis;
@@ -28175,9 +28205,10 @@ var RefreshIcon_classPrivateFieldSet = (undefined && undefined.__classPrivateFie
28175
28205
  };
28176
28206
 
28177
28207
 
28208
+
28178
28209
  let RefreshIcon_RefreshIcon = (() => {
28179
28210
  var _RefreshIcon_className_accessor_storage;
28180
- let _classDecorators = [(0,decorators_js_namespaceObject.customElement)("iam-refresh-icon")];
28211
+ let _classDecorators = [safeCustomElement("iam-refresh-icon")];
28181
28212
  let _classDescriptor;
28182
28213
  let _classExtraInitializers = [];
28183
28214
  let _classThis;
@@ -28277,9 +28308,10 @@ var Loader_classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet
28277
28308
 
28278
28309
 
28279
28310
 
28311
+
28280
28312
  let Loader_Loader = (() => {
28281
28313
  var _Loader_background_accessor_storage, _Loader_color_accessor_storage, _Loader_needShowErrorScreen_accessor_storage, _Loader_needShowLoaderScreen_accessor_storage;
28282
- let _classDecorators = [(0,decorators_js_namespaceObject.customElement)("iam-loader")];
28314
+ let _classDecorators = [safeCustomElement("iam-loader")];
28283
28315
  let _classDescriptor;
28284
28316
  let _classExtraInitializers = [];
28285
28317
  let _classThis;
@@ -28428,7 +28460,7 @@ var InAppMessagingReader_classPrivateFieldSet = (undefined && undefined.__classP
28428
28460
 
28429
28461
  let InAppMessagingReader = (() => {
28430
28462
  var _InAppMessagingReader_options_accessor_storage, _InAppMessagingReader_desktopMode_accessor_storage, _InAppMessagingReader_dir_accessor_storage, _InAppMessagingReader_viewModel_accessor_storage, _InAppMessagingReader_open_accessor_storage;
28431
- let _classDecorators = [(0,decorators_js_namespaceObject.customElement)("iam-reader"), mobxObserver];
28463
+ let _classDecorators = [safeCustomElement("iam-reader"), mobxObserver];
28432
28464
  let _classDescriptor;
28433
28465
  let _classExtraInitializers = [];
28434
28466
  let _classThis;