@inappstory/react-sdk 1.12.0 → 1.13.0
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.
package/dist/index.esm.mjs
CHANGED
|
@@ -9875,7 +9875,7 @@ class GameClientConfig {
|
|
|
9875
9875
|
value: void 0
|
|
9876
9876
|
});
|
|
9877
9877
|
const storyManagerConfig = this.storyManager.config;
|
|
9878
|
-
const sdkVersion = "1.
|
|
9878
|
+
const sdkVersion = "1.13.0";
|
|
9879
9879
|
const placeholders = this.storyManager.rootStore.placeholderStore.placeholders;
|
|
9880
9880
|
const session = this.storyManager.rootStore.sessionStore.session;
|
|
9881
9881
|
this.sessionId = session.id;
|
|
@@ -15203,15 +15203,18 @@ class IamAppearanceCommonOptions {
|
|
|
15203
15203
|
writable: true,
|
|
15204
15204
|
value: {}
|
|
15205
15205
|
});
|
|
15206
|
-
Object.defineProperty(this, "
|
|
15206
|
+
Object.defineProperty(this, "_zIndex", {
|
|
15207
15207
|
enumerable: true,
|
|
15208
15208
|
configurable: true,
|
|
15209
15209
|
writable: true,
|
|
15210
|
-
value:
|
|
15210
|
+
value: 1000
|
|
15211
15211
|
});
|
|
15212
15212
|
this.background = this.mapBackgroundDtoToModel(optionsDto.background);
|
|
15213
15213
|
this.cardAppearance = (_a = optionsDto.card_appearance) !== null && _a !== void 0 ? _a : {};
|
|
15214
15214
|
}
|
|
15215
|
+
get zIndex() {
|
|
15216
|
+
return this._zIndex;
|
|
15217
|
+
}
|
|
15215
15218
|
mapBackgroundDtoToModel(backgroundDto) {
|
|
15216
15219
|
if (!backgroundDto || backgroundDto.alpha === 0)
|
|
15217
15220
|
return "transparent";
|
|
@@ -15238,6 +15241,10 @@ class IamAppearanceCommonOptions {
|
|
|
15238
15241
|
}
|
|
15239
15242
|
return color;
|
|
15240
15243
|
}
|
|
15244
|
+
applyClientAppearance(options) {
|
|
15245
|
+
const zIndex = options === null || options === void 0 ? void 0 : options.zIndex;
|
|
15246
|
+
this._zIndex = zIndex != null ? parseInt(zIndex.toString()) : this._zIndex;
|
|
15247
|
+
}
|
|
15241
15248
|
}
|
|
15242
15249
|
|
|
15243
15250
|
;// ../core/src/domain/inAppMessaging/models/appearanceOptions/iamBottomSheetAppearanceOptions.ts
|
|
@@ -15421,6 +15428,12 @@ class IamToastAppearanceOptions extends IamAppearanceCommonOptions {
|
|
|
15421
15428
|
writable: true,
|
|
15422
15429
|
value: void 0
|
|
15423
15430
|
});
|
|
15431
|
+
Object.defineProperty(this, "maxWidth", {
|
|
15432
|
+
enumerable: true,
|
|
15433
|
+
configurable: true,
|
|
15434
|
+
writable: true,
|
|
15435
|
+
value: 320
|
|
15436
|
+
});
|
|
15424
15437
|
Object.defineProperty(this, "closeBtnPosition", {
|
|
15425
15438
|
enumerable: true,
|
|
15426
15439
|
configurable: true,
|
|
@@ -15464,13 +15477,23 @@ class IamToastAppearanceOptions extends IamAppearanceCommonOptions {
|
|
|
15464
15477
|
value: void 0
|
|
15465
15478
|
});
|
|
15466
15479
|
this.contentRatio = (_a = optionsDto.content_ratio) !== null && _a !== void 0 ? _a : 6.4; // 320 / 50 (default size)
|
|
15467
|
-
this.closeBtnPosition =
|
|
15468
|
-
|
|
15480
|
+
this.closeBtnPosition =
|
|
15481
|
+
(_b = optionsDto.close_button_position) !== null && _b !== void 0 ? _b : IamToastCloseButtonPosition.End;
|
|
15482
|
+
this.animationType =
|
|
15483
|
+
(_c = optionsDto.animation_type) !== null && _c !== void 0 ? _c : IamToastAnimationType.None;
|
|
15469
15484
|
this.borderRadius = (_d = optionsDto.corner_radius) !== null && _d !== void 0 ? _d : 16;
|
|
15470
15485
|
this.verticalOffset = (_e = optionsDto.vertical_offset) !== null && _e !== void 0 ? _e : 16;
|
|
15471
15486
|
this.horizontalOffset = (_f = optionsDto.horizontal_offset) !== null && _f !== void 0 ? _f : 16;
|
|
15472
|
-
this.verticalPosition =
|
|
15473
|
-
|
|
15487
|
+
this.verticalPosition =
|
|
15488
|
+
(_g = optionsDto.vertical_position) !== null && _g !== void 0 ? _g : IamToastVerticalPosition.Bottom;
|
|
15489
|
+
this.horizontalPosition =
|
|
15490
|
+
(_h = optionsDto.horizontal_position) !== null && _h !== void 0 ? _h : IamToastHorizontalPosition.Center;
|
|
15491
|
+
}
|
|
15492
|
+
applyClientAppearance(options) {
|
|
15493
|
+
var _a;
|
|
15494
|
+
super.applyClientAppearance(options);
|
|
15495
|
+
const toastWidth = (_a = options === null || options === void 0 ? void 0 : options.toast) === null || _a === void 0 ? void 0 : _a.width;
|
|
15496
|
+
this.maxWidth = toastWidth != null ? parseInt(toastWidth.toString()) : this.maxWidth;
|
|
15474
15497
|
}
|
|
15475
15498
|
}
|
|
15476
15499
|
|
|
@@ -15684,6 +15707,7 @@ var IamToastCloseButtonPositionDto;
|
|
|
15684
15707
|
|
|
15685
15708
|
|
|
15686
15709
|
|
|
15710
|
+
|
|
15687
15711
|
;// ../core/src/domain/inAppMessaging/models/message/iamMessageContext.ts
|
|
15688
15712
|
class IamMessageContext {
|
|
15689
15713
|
constructor(messageId, contextDto) {
|
|
@@ -15805,6 +15829,7 @@ let IamMessage = (() => {
|
|
|
15805
15829
|
let __context_initializers = [];
|
|
15806
15830
|
let __context_extraInitializers = [];
|
|
15807
15831
|
let _updateByDto_decorators;
|
|
15832
|
+
let _applyClientAppearance_decorators;
|
|
15808
15833
|
return _a = class IamMessage {
|
|
15809
15834
|
get _id() { return iamMessage_classPrivateFieldGet(this, _IamMessage__id_accessor_storage, "f"); }
|
|
15810
15835
|
set _id(value) { iamMessage_classPrivateFieldSet(this, _IamMessage__id_accessor_storage, value, "f"); }
|
|
@@ -15996,6 +16021,9 @@ let IamMessage = (() => {
|
|
|
15996
16021
|
for (const slide of this._slides)
|
|
15997
16022
|
slide.updatePlaceholders(placeholders);
|
|
15998
16023
|
}
|
|
16024
|
+
applyClientAppearance(options) {
|
|
16025
|
+
this.appearanceOptions.applyClientAppearance(options);
|
|
16026
|
+
}
|
|
15999
16027
|
},
|
|
16000
16028
|
_IamMessage__id_accessor_storage = new WeakMap(),
|
|
16001
16029
|
_IamMessage__events_accessor_storage = new WeakMap(),
|
|
@@ -16020,6 +16048,7 @@ let IamMessage = (() => {
|
|
|
16020
16048
|
__isOnceOpened_decorators = [__WEBPACK_EXTERNAL_MODULE_mobx_observable__];
|
|
16021
16049
|
__context_decorators = [__WEBPACK_EXTERNAL_MODULE_mobx_observable__];
|
|
16022
16050
|
_updateByDto_decorators = [__WEBPACK_EXTERNAL_MODULE_mobx_action__];
|
|
16051
|
+
_applyClientAppearance_decorators = [__WEBPACK_EXTERNAL_MODULE_mobx_action__];
|
|
16023
16052
|
iamMessage_esDecorate(_a, null, __id_decorators, { kind: "accessor", name: "_id", static: false, private: false, access: { has: obj => "_id" in obj, get: obj => obj._id, set: (obj, value) => { obj._id = value; } }, metadata: _metadata }, __id_initializers, __id_extraInitializers);
|
|
16024
16053
|
iamMessage_esDecorate(_a, null, __events_decorators, { kind: "accessor", name: "_events", static: false, private: false, access: { has: obj => "_events" in obj, get: obj => obj._events, set: (obj, value) => { obj._events = value; } }, metadata: _metadata }, __events_initializers, __events_extraInitializers);
|
|
16025
16054
|
iamMessage_esDecorate(_a, null, __type_decorators, { kind: "accessor", name: "_type", static: false, private: false, access: { has: obj => "_type" in obj, get: obj => obj._type, set: (obj, value) => { obj._type = value; } }, metadata: _metadata }, __type_initializers, __type_extraInitializers);
|
|
@@ -16031,6 +16060,7 @@ let IamMessage = (() => {
|
|
|
16031
16060
|
iamMessage_esDecorate(_a, null, __isOnceOpened_decorators, { kind: "accessor", name: "_isOnceOpened", static: false, private: false, access: { has: obj => "_isOnceOpened" in obj, get: obj => obj._isOnceOpened, set: (obj, value) => { obj._isOnceOpened = value; } }, metadata: _metadata }, __isOnceOpened_initializers, __isOnceOpened_extraInitializers);
|
|
16032
16061
|
iamMessage_esDecorate(_a, null, __context_decorators, { kind: "accessor", name: "_context", static: false, private: false, access: { has: obj => "_context" in obj, get: obj => obj._context, set: (obj, value) => { obj._context = value; } }, metadata: _metadata }, __context_initializers, __context_extraInitializers);
|
|
16033
16062
|
iamMessage_esDecorate(_a, null, _updateByDto_decorators, { kind: "method", name: "updateByDto", static: false, private: false, access: { has: obj => "updateByDto" in obj, get: obj => obj.updateByDto }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
16063
|
+
iamMessage_esDecorate(_a, null, _applyClientAppearance_decorators, { kind: "method", name: "applyClientAppearance", static: false, private: false, access: { has: obj => "applyClientAppearance" in obj, get: obj => obj.applyClientAppearance }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
16034
16064
|
if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
16035
16065
|
})(),
|
|
16036
16066
|
_a;
|
|
@@ -16478,7 +16508,7 @@ class ToastGeometry {
|
|
|
16478
16508
|
// Toast has max width of 320px
|
|
16479
16509
|
const widthWithOffset = Math.max(this.params.vw - 2 * this.params.horizontalOffset, 0);
|
|
16480
16510
|
if (this.params.desktopMode) {
|
|
16481
|
-
return Math.min(
|
|
16511
|
+
return Math.min(this.params.maxWidth, widthWithOffset);
|
|
16482
16512
|
}
|
|
16483
16513
|
else {
|
|
16484
16514
|
return widthWithOffset;
|
|
@@ -16505,14 +16535,17 @@ class MessageGeometryFactory {
|
|
|
16505
16535
|
return new ModalGeometry(params.vw, params.vh, params.appearanceOptions.contentRatio, params.desktopMode);
|
|
16506
16536
|
case IamMessageType.Fullscreen:
|
|
16507
16537
|
return new FullscreenModalGeometry(params.vw, params.vh);
|
|
16508
|
-
case IamMessageType.Toast:
|
|
16538
|
+
case IamMessageType.Toast: {
|
|
16539
|
+
const toastAppearance = params.appearanceOptions;
|
|
16509
16540
|
return new ToastGeometry({
|
|
16510
16541
|
vw: params.vw,
|
|
16511
16542
|
vh: params.vh,
|
|
16512
16543
|
desktopMode: params.desktopMode,
|
|
16513
16544
|
contentRatio: params.appearanceOptions.contentRatio,
|
|
16514
|
-
horizontalOffset:
|
|
16545
|
+
horizontalOffset: toastAppearance.horizontalOffset,
|
|
16546
|
+
maxWidth: toastAppearance.maxWidth
|
|
16515
16547
|
});
|
|
16548
|
+
}
|
|
16516
16549
|
}
|
|
16517
16550
|
}
|
|
16518
16551
|
}
|
|
@@ -16834,9 +16867,7 @@ let IamReaderViewModel = (() => {
|
|
|
16834
16867
|
}
|
|
16835
16868
|
async open(message, appearance) {
|
|
16836
16869
|
message.updatePlaceholders(this.storyManager.rootStore.placeholderStore.placeholders);
|
|
16837
|
-
|
|
16838
|
-
message.appearanceOptions.zIndex = appearance.zIndex;
|
|
16839
|
-
}
|
|
16870
|
+
message.applyClientAppearance(appearance);
|
|
16840
16871
|
this.touchController.init(document.body);
|
|
16841
16872
|
this.setActiveMessage(message);
|
|
16842
16873
|
this.visibilityObserver.subscribe();
|
|
@@ -20999,7 +21030,7 @@ class UgcEditorStore {
|
|
|
20999
21030
|
const session = await this.storyManager.rootStore.sessionStore.open();
|
|
21000
21031
|
const ugcEditorConfigDto = await this.ugcEditorApi.fetchUgcEditorConfig();
|
|
21001
21032
|
const storyManagerConfig = this.storyManager.config;
|
|
21002
|
-
const sdkVersion = "1.
|
|
21033
|
+
const sdkVersion = "1.13.0";
|
|
21003
21034
|
this._config = {
|
|
21004
21035
|
sessionId: session.id,
|
|
21005
21036
|
apiKey: storyManagerConfig.apiKey,
|
|
@@ -21459,11 +21490,11 @@ class StoryManager extends TypedEventEmitter {
|
|
|
21459
21490
|
return deviceDescriptor.deviceId;
|
|
21460
21491
|
}
|
|
21461
21492
|
get sdkVersionName() {
|
|
21462
|
-
const sdkVersionName = "1.
|
|
21493
|
+
const sdkVersionName = "1.13.0";
|
|
21463
21494
|
return sdkVersionName || "0.0.0";
|
|
21464
21495
|
}
|
|
21465
21496
|
get sdkVersionCode() {
|
|
21466
|
-
const sdkVersionCode =
|
|
21497
|
+
const sdkVersionCode = 11300;
|
|
21467
21498
|
return sdkVersionCode ? parseInt(sdkVersionCode) : 0;
|
|
21468
21499
|
}
|
|
21469
21500
|
get lang() {
|
|
@@ -21527,7 +21558,7 @@ class StoryManager extends TypedEventEmitter {
|
|
|
21527
21558
|
this.rootStore.storyManagerConfigStore.setConfig(configDto);
|
|
21528
21559
|
}
|
|
21529
21560
|
setUserAgent(userAgent) {
|
|
21530
|
-
const sdkVersionCode =
|
|
21561
|
+
const sdkVersionCode = 11300;
|
|
21531
21562
|
const buildVersion = sdkVersionCode ? parseInt(sdkVersionCode) : 0;
|
|
21532
21563
|
// According to RFC5987, HTTP header values can legitimately be supplied using the ISO-8859-1 encoding.
|
|
21533
21564
|
this._userAgent = `${userAgent} ${convertStrToLatin1(navigator.userAgent)}`;
|
|
@@ -29306,7 +29337,6 @@ let InAppMessagingReader = (() => {
|
|
|
29306
29337
|
}
|
|
29307
29338
|
}
|
|
29308
29339
|
render() {
|
|
29309
|
-
var _a;
|
|
29310
29340
|
if (!this.viewModel)
|
|
29311
29341
|
return null;
|
|
29312
29342
|
const message = this.viewModel.activeMessage;
|
|
@@ -29316,7 +29346,7 @@ let InAppMessagingReader = (() => {
|
|
|
29316
29346
|
const type = message.type;
|
|
29317
29347
|
const messageGeometry = this.createMessageGeometry(type, message.appearanceOptions);
|
|
29318
29348
|
const containerStyle = {
|
|
29319
|
-
zIndex:
|
|
29349
|
+
zIndex: message.appearanceOptions.zIndex
|
|
29320
29350
|
};
|
|
29321
29351
|
return __WEBPACK_EXTERNAL_MODULE_lit_html__ `<div class="${__WEBPACK_EXTERNAL_MODULE_lit_directives_class_map_js_2f88e643_classMap__({
|
|
29322
29352
|
"iam-container": true,
|