@inappstory/slide-api 0.0.5 → 0.0.7
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.cjs +13 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +13 -30
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1126,6 +1126,12 @@ class EsModuleSdkApi {
|
|
|
1126
1126
|
storyShowNext() {
|
|
1127
1127
|
this.sdkBinding().storyShowNext();
|
|
1128
1128
|
}
|
|
1129
|
+
setStorySessionValue(element, key, value) {
|
|
1130
|
+
this.sdkBinding().setStorySessionValue(key, value);
|
|
1131
|
+
}
|
|
1132
|
+
getStorySessionValue(element, key) {
|
|
1133
|
+
return this.sdkBinding().getStorySessionValue(key);
|
|
1134
|
+
}
|
|
1129
1135
|
static get [Symbol.for("___CTOR_ARGS___")]() { return [`() => SDKInterface`]; }
|
|
1130
1136
|
}
|
|
1131
1137
|
|
|
@@ -2823,35 +2829,10 @@ class WidgetQuest extends WidgetBase {
|
|
|
2823
2829
|
}
|
|
2824
2830
|
refreshUserData(localData) { }
|
|
2825
2831
|
setStorySessionValue(name, value) {
|
|
2826
|
-
|
|
2827
|
-
var parent = this.element.closest(".stories-item");
|
|
2828
|
-
if (parent) {
|
|
2829
|
-
parent.dataset[name] = value;
|
|
2830
|
-
}
|
|
2831
|
-
else {
|
|
2832
|
-
//@ts-ignore
|
|
2833
|
-
this.env[name] = value;
|
|
2834
|
-
}
|
|
2835
|
-
}
|
|
2836
|
-
catch (e) {
|
|
2837
|
-
console.error(e);
|
|
2838
|
-
}
|
|
2832
|
+
this.sdkApi.setStorySessionValue(this.element, name, value);
|
|
2839
2833
|
}
|
|
2840
2834
|
getStorySessionValue(name) {
|
|
2841
|
-
|
|
2842
|
-
var parent = this.element.closest(".stories-item");
|
|
2843
|
-
if (parent) {
|
|
2844
|
-
return parent.dataset[name];
|
|
2845
|
-
}
|
|
2846
|
-
else {
|
|
2847
|
-
// @ts-ignore
|
|
2848
|
-
return this.env[name];
|
|
2849
|
-
}
|
|
2850
|
-
}
|
|
2851
|
-
catch (e) {
|
|
2852
|
-
console.error(e);
|
|
2853
|
-
return undefined;
|
|
2854
|
-
}
|
|
2835
|
+
return this.sdkApi.getStorySessionValue(this.element, name);
|
|
2855
2836
|
}
|
|
2856
2837
|
init() {
|
|
2857
2838
|
if (this.localData) {
|
|
@@ -2868,6 +2849,7 @@ class WidgetQuest extends WidgetBase {
|
|
|
2868
2849
|
lastSlideIdx !== this.slideIndex /*&& this.slideIndex === this.firstSlideWithQuestIndex()*/) {
|
|
2869
2850
|
if (this.getStorySessionValue("__storyQuestSlideChanged") === undefined) {
|
|
2870
2851
|
// global flag - был сделан переход на нужный слайд, больше не нужно повторять за эту сессию
|
|
2852
|
+
// perform showStorySlide with lastSlideIdx only on story open first time (not on second slide, etc)
|
|
2871
2853
|
this.setStorySessionValue("__storyQuestSlideChanged", "1");
|
|
2872
2854
|
if (this.sdkApi.isExistsShowStorySlide) {
|
|
2873
2855
|
this.sdkApi.showStorySlide(lastSlideIdx);
|
|
@@ -4218,8 +4200,8 @@ class WidgetRate extends WidgetBase {
|
|
|
4218
4200
|
// 1-3 stars (default)
|
|
4219
4201
|
if (value + 1 >= this.showDialogueMin && value + 1 <= this.showDialogueMax) {
|
|
4220
4202
|
this.selectedStar = value;
|
|
4221
|
-
this._selectStar(this.selectedStar, false);
|
|
4222
4203
|
if (this.showDialogOnLowRate) {
|
|
4204
|
+
this._selectStar(this.selectedStar, false);
|
|
4223
4205
|
if (this.sdkApi.isAndroid) {
|
|
4224
4206
|
this.slide.classList.add("blured");
|
|
4225
4207
|
}
|
|
@@ -4251,6 +4233,7 @@ class WidgetRate extends WidgetBase {
|
|
|
4251
4233
|
}
|
|
4252
4234
|
}
|
|
4253
4235
|
else {
|
|
4236
|
+
this._selectStar(this.selectedStar, true);
|
|
4254
4237
|
this.completeWidget();
|
|
4255
4238
|
this._statEventRateUsAnswer("");
|
|
4256
4239
|
}
|
|
@@ -4264,7 +4247,7 @@ class WidgetRate extends WidgetBase {
|
|
|
4264
4247
|
else if (this.sdkApi.isIOS) {
|
|
4265
4248
|
target = getTagData(this.element, "appleLink");
|
|
4266
4249
|
}
|
|
4267
|
-
this._selectStar(value,
|
|
4250
|
+
this._selectStar(value, true);
|
|
4268
4251
|
this.completeWidget();
|
|
4269
4252
|
this._statEventRateUsAnswer("");
|
|
4270
4253
|
if (this.submitToStores && target) {
|
|
@@ -4272,7 +4255,7 @@ class WidgetRate extends WidgetBase {
|
|
|
4272
4255
|
}
|
|
4273
4256
|
}
|
|
4274
4257
|
else {
|
|
4275
|
-
this._selectStar(value,
|
|
4258
|
+
this._selectStar(value, true);
|
|
4276
4259
|
this.completeWidget();
|
|
4277
4260
|
this._statEventRateUsAnswer("");
|
|
4278
4261
|
}
|