@inappstory/react-sdk 1.16.7 → 1.16.8
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 +54 -22
- package/dist/index.esm.mjs.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/types/events.d.ts +2 -0
- package/dist/types/in-app-messaging/inAppMessaging.d.ts +14 -0
- package/package.json +1 -1
- package/plugins/banners/index.esm.mjs +1 -1
- package/plugins/banners/index.umd.js +1 -1
- package/plugins/banners/types/events.d.ts +26 -0
package/dist/index.esm.mjs
CHANGED
|
@@ -4851,7 +4851,7 @@ class GameClientConfig {
|
|
|
4851
4851
|
value: void 0
|
|
4852
4852
|
});
|
|
4853
4853
|
const storyManagerConfig = this.storyManager.config;
|
|
4854
|
-
const sdkVersion = "1.16.
|
|
4854
|
+
const sdkVersion = "1.16.8";
|
|
4855
4855
|
const placeholders = this.storyManager.rootStore.placeholderStore.placeholders;
|
|
4856
4856
|
const session = this.storyManager.rootStore.sessionStore.session;
|
|
4857
4857
|
this.sessionId = session.id;
|
|
@@ -6095,7 +6095,7 @@ let IamApi = (() => {
|
|
|
6095
6095
|
}, {
|
|
6096
6096
|
params: {
|
|
6097
6097
|
fields: messageFieldsWithPrefix,
|
|
6098
|
-
expand: "messages.slides"
|
|
6098
|
+
expand: "messages.slides,messages.custom_attributes"
|
|
6099
6099
|
},
|
|
6100
6100
|
signal
|
|
6101
6101
|
});
|
|
@@ -6114,7 +6114,7 @@ let IamApi = (() => {
|
|
|
6114
6114
|
async fetchById(messageId, signal) {
|
|
6115
6115
|
const response = await api["default"].get(`inappmessaging/message/${messageId}`, {
|
|
6116
6116
|
params: {
|
|
6117
|
-
expand: "slides",
|
|
6117
|
+
expand: "slides,custom_attributes",
|
|
6118
6118
|
fields: messageFields
|
|
6119
6119
|
},
|
|
6120
6120
|
signal
|
|
@@ -6908,6 +6908,12 @@ let IamMessage = (() => {
|
|
|
6908
6908
|
writable: true,
|
|
6909
6909
|
value: ""
|
|
6910
6910
|
});
|
|
6911
|
+
Object.defineProperty(this, "_customAttributes", {
|
|
6912
|
+
enumerable: true,
|
|
6913
|
+
configurable: true,
|
|
6914
|
+
writable: true,
|
|
6915
|
+
value: void 0
|
|
6916
|
+
});
|
|
6911
6917
|
Object.defineProperty(this, "_openTime", {
|
|
6912
6918
|
enumerable: true,
|
|
6913
6919
|
configurable: true,
|
|
@@ -6973,6 +6979,9 @@ let IamMessage = (() => {
|
|
|
6973
6979
|
get disableClose() {
|
|
6974
6980
|
return this._disableClose;
|
|
6975
6981
|
}
|
|
6982
|
+
get customAttributes() {
|
|
6983
|
+
return this._customAttributes;
|
|
6984
|
+
}
|
|
6976
6985
|
destroy() { }
|
|
6977
6986
|
updateByDto(messageDto) {
|
|
6978
6987
|
var _b, _c, _d;
|
|
@@ -6986,6 +6995,7 @@ let IamMessage = (() => {
|
|
|
6986
6995
|
this._hasLimit = Boolean(messageDto.has_limit);
|
|
6987
6996
|
this._appearanceOptions = new IamAppearanceOptionsFactory().create(this._type, messageDto.appearance);
|
|
6988
6997
|
this._needPlaceholders = messageDto.need_placeholders;
|
|
6998
|
+
this._customAttributes = messageDto.custom_attributes;
|
|
6989
6999
|
this.updateMessageSlides(messageDto.slides);
|
|
6990
7000
|
}
|
|
6991
7001
|
hasEvent(eventName) {
|
|
@@ -7001,7 +7011,8 @@ let IamMessage = (() => {
|
|
|
7001
7011
|
return {
|
|
7002
7012
|
id: this._id,
|
|
7003
7013
|
campaignName: this._campaignName,
|
|
7004
|
-
type: this._type
|
|
7014
|
+
type: this._type,
|
|
7015
|
+
extraFields: this._customAttributes
|
|
7005
7016
|
};
|
|
7006
7017
|
}
|
|
7007
7018
|
updateMessageSlides(slideDtos) {
|
|
@@ -7967,7 +7978,7 @@ class StoriesApi {
|
|
|
7967
7978
|
});
|
|
7968
7979
|
}
|
|
7969
7980
|
getStoryRequestConfig(id, feedSlug, allFields = false, fetchShareUrl, once) {
|
|
7970
|
-
const expandFields = ["slides"];
|
|
7981
|
+
const expandFields = ["slides", "custom_attributes"];
|
|
7971
7982
|
if (fetchShareUrl) {
|
|
7972
7983
|
expandFields.push("share_url");
|
|
7973
7984
|
}
|
|
@@ -8600,7 +8611,7 @@ let Story = (() => {
|
|
|
8600
8611
|
get _title() { return story_classPrivateFieldGet(this, _Story__title_accessor_storage, "f"); }
|
|
8601
8612
|
set _title(value) { story_classPrivateFieldSet(this, _Story__title_accessor_storage, value, "f"); }
|
|
8602
8613
|
constructor(storyDto) {
|
|
8603
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
8614
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
8604
8615
|
Object.defineProperty(this, "id", {
|
|
8605
8616
|
enumerable: true,
|
|
8606
8617
|
configurable: true,
|
|
@@ -8742,12 +8753,6 @@ let Story = (() => {
|
|
|
8742
8753
|
writable: true,
|
|
8743
8754
|
value: void 0
|
|
8744
8755
|
});
|
|
8745
|
-
Object.defineProperty(this, "_parsedSlideImage", {
|
|
8746
|
-
enumerable: true,
|
|
8747
|
-
configurable: true,
|
|
8748
|
-
writable: true,
|
|
8749
|
-
value: null
|
|
8750
|
-
});
|
|
8751
8756
|
Object.defineProperty(this, "_videoCoverSrc", {
|
|
8752
8757
|
enumerable: true,
|
|
8753
8758
|
configurable: true,
|
|
@@ -8766,6 +8771,12 @@ let Story = (() => {
|
|
|
8766
8771
|
writable: true,
|
|
8767
8772
|
value: false
|
|
8768
8773
|
});
|
|
8774
|
+
Object.defineProperty(this, "_customAttributes", {
|
|
8775
|
+
enumerable: true,
|
|
8776
|
+
configurable: true,
|
|
8777
|
+
writable: true,
|
|
8778
|
+
value: null
|
|
8779
|
+
});
|
|
8769
8780
|
_Story__slidesLoaded_accessor_storage.set(this, story_runInitializers(this, __slidesLoaded_initializers, false));
|
|
8770
8781
|
_Story__error_accessor_storage.set(this, (story_runInitializers(this, __slidesLoaded_extraInitializers), story_runInitializers(this, __error_initializers, null)));
|
|
8771
8782
|
_Story__context_accessor_storage.set(this, (story_runInitializers(this, __error_extraInitializers), story_runInitializers(this, __context_initializers, void 0)));
|
|
@@ -8802,10 +8813,11 @@ let Story = (() => {
|
|
|
8802
8813
|
this.deeplink = (_v = storyDto.deeplink) !== null && _v !== void 0 ? _v : "";
|
|
8803
8814
|
this.hideTimeline = (_w = storyDto.hide_timeline) !== null && _w !== void 0 ? _w : false;
|
|
8804
8815
|
this.ugcPayload = (_x = storyDto.payload) !== null && _x !== void 0 ? _x : {};
|
|
8805
|
-
this.
|
|
8816
|
+
this._customAttributes = (_y = storyDto.custom_attributes) !== null && _y !== void 0 ? _y : null;
|
|
8817
|
+
this._shareUrl = (_z = storyDto.share_url) !== null && _z !== void 0 ? _z : null;
|
|
8806
8818
|
this._image = StoryImageSet.createByRawData(storyDto.image);
|
|
8807
8819
|
this._videoCover = StoryImageSet.createByRawData(storyDto.video_cover);
|
|
8808
|
-
const slides = (
|
|
8820
|
+
const slides = (_0 = storyDto.slides) !== null && _0 !== void 0 ? _0 : [];
|
|
8809
8821
|
this.setSlides(slides);
|
|
8810
8822
|
}
|
|
8811
8823
|
get like() {
|
|
@@ -8867,6 +8879,12 @@ let Story = (() => {
|
|
|
8867
8879
|
}
|
|
8868
8880
|
return null;
|
|
8869
8881
|
}
|
|
8882
|
+
get customAttributes() {
|
|
8883
|
+
return this._customAttributes;
|
|
8884
|
+
}
|
|
8885
|
+
setCustomAttributes(customAttributes) {
|
|
8886
|
+
this._customAttributes = customAttributes !== null && customAttributes !== void 0 ? customAttributes : null;
|
|
8887
|
+
}
|
|
8870
8888
|
setSlides(slideDtos) {
|
|
8871
8889
|
if (this._slidesLoaded || !slideDtos.length)
|
|
8872
8890
|
return;
|
|
@@ -13851,7 +13869,8 @@ let IamReaderViewModel = (() => {
|
|
|
13851
13869
|
payload: this.activeMessage.payload,
|
|
13852
13870
|
message: this.activeMessage.toPublicDto(),
|
|
13853
13871
|
name: widgetEvent.type,
|
|
13854
|
-
data: widgetEvent.widgetPayload
|
|
13872
|
+
data: widgetEvent.widgetPayload,
|
|
13873
|
+
extraFields: this.activeMessage.customAttributes
|
|
13855
13874
|
});
|
|
13856
13875
|
this.storyManager.emit(types/* StoryManagerEvent */.ph.WidgetEvent, {
|
|
13857
13876
|
name: widgetEvent.type,
|
|
@@ -13861,7 +13880,8 @@ let IamReaderViewModel = (() => {
|
|
|
13861
13880
|
emitCloseEvent(message) {
|
|
13862
13881
|
this.emit(IamReaderEvent.Close, {
|
|
13863
13882
|
payload: message.payload,
|
|
13864
|
-
message: message.toPublicDto()
|
|
13883
|
+
message: message.toPublicDto(),
|
|
13884
|
+
extraFields: message.customAttributes
|
|
13865
13885
|
});
|
|
13866
13886
|
}
|
|
13867
13887
|
setActiveMessage(message) {
|
|
@@ -13978,7 +13998,8 @@ class OpenUrlAction {
|
|
|
13978
13998
|
url,
|
|
13979
13999
|
elementId: payload.elementId,
|
|
13980
14000
|
payload: this.iamMessage.payload,
|
|
13981
|
-
}
|
|
14001
|
+
},
|
|
14002
|
+
extraFields: this.iamMessage.customAttributes
|
|
13982
14003
|
};
|
|
13983
14004
|
this.storyManager.storyLinkClickHandler(event);
|
|
13984
14005
|
this.iamReader.emit(IamReaderEvent.ClickOnButton, event);
|
|
@@ -14602,6 +14623,9 @@ let IamMultiSlideMessageViewModel = (() => {
|
|
|
14602
14623
|
get disableClose() {
|
|
14603
14624
|
return this.iamMessage.disableClose;
|
|
14604
14625
|
}
|
|
14626
|
+
get customAttributes() {
|
|
14627
|
+
return this.iamMessage.customAttributes;
|
|
14628
|
+
}
|
|
14605
14629
|
get slidesAnalytics() {
|
|
14606
14630
|
return Array.from(this.slidesMetrics.values()).map(metrics => {
|
|
14607
14631
|
var _b;
|
|
@@ -20899,6 +20923,12 @@ class BaseStoryReaderEvent {
|
|
|
20899
20923
|
writable: true,
|
|
20900
20924
|
value: null
|
|
20901
20925
|
});
|
|
20926
|
+
Object.defineProperty(this, "extraFields", {
|
|
20927
|
+
enumerable: true,
|
|
20928
|
+
configurable: true,
|
|
20929
|
+
writable: true,
|
|
20930
|
+
value: null
|
|
20931
|
+
});
|
|
20902
20932
|
Object.defineProperty(this, "slideEventPayload", {
|
|
20903
20933
|
enumerable: true,
|
|
20904
20934
|
configurable: true,
|
|
@@ -20915,10 +20945,11 @@ class BaseStoryReaderEvent {
|
|
|
20915
20945
|
this.feedSlug = feedType === domain/* StoryFeedType */.Wf.DEFAULT ? feedSlug : null;
|
|
20916
20946
|
this.filter = filter;
|
|
20917
20947
|
this.actionSource = feedType != null ? this.getStorySourceByFeedType(feedType) : types/* StoryActionSource */.Vq.direct;
|
|
20948
|
+
this.extraFields = story.model.customAttributes;
|
|
20918
20949
|
this.slideEventPayload = (_d = (_c = story.activeSlide.eventPayload) === null || _c === void 0 ? void 0 : _c.payload) !== null && _d !== void 0 ? _d : null;
|
|
20919
20950
|
}
|
|
20920
20951
|
toJSON() {
|
|
20921
|
-
return Object.assign({ id: this.story.id, index: this.story.activeSlideIndex, title: this.title, tags: this.tags, slidesCount: this.slidesCount, feed: this.feedSlug, filter: this.filter, source: this.actionSource, ugcPayload: this.ugcPayload, payload: this.slideEventPayload }, this.payload);
|
|
20952
|
+
return Object.assign({ id: this.story.id, index: this.story.activeSlideIndex, title: this.title, tags: this.tags, slidesCount: this.slidesCount, feed: this.feedSlug, filter: this.filter, source: this.actionSource, ugcPayload: this.ugcPayload, extraFields: this.extraFields, payload: this.slideEventPayload }, this.payload);
|
|
20922
20953
|
}
|
|
20923
20954
|
getStorySourceByFeedType(feedType) {
|
|
20924
20955
|
switch (feedType) {
|
|
@@ -23010,6 +23041,7 @@ let StoryStore = (() => {
|
|
|
23010
23041
|
story.setError(null);
|
|
23011
23042
|
story.setContext(storyContext);
|
|
23012
23043
|
const storyDto = await this.storiesApi.fetchStorySlides({ id: story.id, feedSlug });
|
|
23044
|
+
story.setCustomAttributes(storyDto.custom_attributes);
|
|
23013
23045
|
story.setSlides((_b = storyDto.slides) !== null && _b !== void 0 ? _b : []);
|
|
23014
23046
|
story.applyFontPrefix(this.storyManager.config.fontPrefix);
|
|
23015
23047
|
story.updatePlaceholders(this.rootStore.placeholderStore.placeholders);
|
|
@@ -23420,7 +23452,7 @@ class UgcEditorStore {
|
|
|
23420
23452
|
const session = await this.storyManager.rootStore.sessionStore.open();
|
|
23421
23453
|
const ugcEditorConfigDto = await this.ugcEditorApi.fetchUgcEditorConfig();
|
|
23422
23454
|
const storyManagerConfig = this.storyManager.config;
|
|
23423
|
-
const sdkVersion = "1.16.
|
|
23455
|
+
const sdkVersion = "1.16.8";
|
|
23424
23456
|
this._config = {
|
|
23425
23457
|
sessionId: session.id,
|
|
23426
23458
|
apiKey: storyManagerConfig.apiKey,
|
|
@@ -23896,11 +23928,11 @@ class StoryManager extends types/* TypedEventEmitter */.Xl {
|
|
|
23896
23928
|
return api/* deviceDescriptor */.c2.deviceId;
|
|
23897
23929
|
}
|
|
23898
23930
|
get sdkVersionName() {
|
|
23899
|
-
const sdkVersionName = "1.16.
|
|
23931
|
+
const sdkVersionName = "1.16.8";
|
|
23900
23932
|
return sdkVersionName || "0.0.0";
|
|
23901
23933
|
}
|
|
23902
23934
|
get sdkVersionCode() {
|
|
23903
|
-
const sdkVersionCode =
|
|
23935
|
+
const sdkVersionCode = 11608;
|
|
23904
23936
|
return sdkVersionCode ? parseInt(sdkVersionCode) : 0;
|
|
23905
23937
|
}
|
|
23906
23938
|
get lang() {
|
|
@@ -23964,7 +23996,7 @@ class StoryManager extends types/* TypedEventEmitter */.Xl {
|
|
|
23964
23996
|
this.rootStore.storyManagerConfigStore.setConfig(configDto);
|
|
23965
23997
|
}
|
|
23966
23998
|
setUserAgent(userAgent) {
|
|
23967
|
-
const sdkVersionCode =
|
|
23999
|
+
const sdkVersionCode = 11608;
|
|
23968
24000
|
const buildVersion = sdkVersionCode ? parseInt(sdkVersionCode) : 0;
|
|
23969
24001
|
// According to RFC5987, HTTP header values can legitimately be supplied using the ISO-8859-1 encoding.
|
|
23970
24002
|
this._userAgent = `${userAgent} ${convertStrToLatin1(navigator.userAgent)}`;
|