@inappstory/slide-api 0.1.44 → 0.1.46
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 +138 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +51 -12
- package/dist/index.d.ts +51 -12
- package/dist/index.js +138 -34
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1067,10 +1067,10 @@ class EsModuleSdkApi {
|
|
|
1067
1067
|
onWidgetRequireResumeUI() {
|
|
1068
1068
|
return this.sdkBinding.onWidgetRequireResumeUI();
|
|
1069
1069
|
}
|
|
1070
|
-
getCardServerData(
|
|
1071
|
-
return this.sdkBinding.getCardServerData(
|
|
1070
|
+
getCardServerData() {
|
|
1071
|
+
return this.sdkBinding.getCardServerData();
|
|
1072
1072
|
}
|
|
1073
|
-
updateCardServerDataLocally(
|
|
1073
|
+
updateCardServerDataLocally(data) {
|
|
1074
1074
|
return this.sdkBinding.updateCardServerDataLocally(data);
|
|
1075
1075
|
}
|
|
1076
1076
|
showNextSlide(duration) {
|
|
@@ -1109,8 +1109,8 @@ class EsModuleSdkApi {
|
|
|
1109
1109
|
setCardLocalData(keyValue, sendToServer) {
|
|
1110
1110
|
this.sdkBinding.setCardLocalData(keyValue, sendToServer);
|
|
1111
1111
|
}
|
|
1112
|
-
getWidgetsSharedData(
|
|
1113
|
-
return this.sdkBinding.getWidgetsSharedData(
|
|
1112
|
+
getWidgetsSharedData(widget) {
|
|
1113
|
+
return this.sdkBinding.getWidgetsSharedData(widget);
|
|
1114
1114
|
}
|
|
1115
1115
|
vibrate(pattern) {
|
|
1116
1116
|
navigator.vibrate(pattern);
|
|
@@ -1222,6 +1222,9 @@ class EsModuleSdkApi {
|
|
|
1222
1222
|
productCartClicked() {
|
|
1223
1223
|
this.sdkBinding.productCartClicked();
|
|
1224
1224
|
}
|
|
1225
|
+
onVerticalScrollChange(data) {
|
|
1226
|
+
this.sdkBinding.onVerticalScrollChange(data);
|
|
1227
|
+
}
|
|
1225
1228
|
static get [Symbol.for("___CTOR_ARGS___")]() { return [`SDKInterface`]; }
|
|
1226
1229
|
}
|
|
1227
1230
|
|
|
@@ -1464,7 +1467,7 @@ class PromocodeLocalRepository {
|
|
|
1464
1467
|
this.sdkApi = sdkApi;
|
|
1465
1468
|
}
|
|
1466
1469
|
init({ localData, cardId }) {
|
|
1467
|
-
const savedData = this.sdkApi.getCardServerData(
|
|
1470
|
+
const savedData = this.sdkApi.getCardServerData() ?? {};
|
|
1468
1471
|
this.localData = extend({}, savedData, localData ?? {});
|
|
1469
1472
|
}
|
|
1470
1473
|
getPromocode() {
|
|
@@ -2630,9 +2633,15 @@ const waitForImageHtmlElementLoad = async (nodeRef) => {
|
|
|
2630
2633
|
}));
|
|
2631
2634
|
}
|
|
2632
2635
|
nodeRef.removeEventListener("load", onLoad);
|
|
2636
|
+
nodeRef.removeEventListener("error", onError);
|
|
2637
|
+
};
|
|
2638
|
+
const onError = () => {
|
|
2639
|
+
nodeRef.removeEventListener("load", onLoad);
|
|
2640
|
+
nodeRef.removeEventListener("error", onError);
|
|
2641
|
+
reject(new Error(`Could not load (Network error) Image from URL: ${nodeRef.src}`));
|
|
2633
2642
|
};
|
|
2634
2643
|
nodeRef.addEventListener("load", onLoad);
|
|
2635
|
-
nodeRef.addEventListener("error",
|
|
2644
|
+
nodeRef.addEventListener("error", onError);
|
|
2636
2645
|
if (nodeRef.complete && nodeRef.naturalHeight !== 0) {
|
|
2637
2646
|
if (nodeRef.decode != null) {
|
|
2638
2647
|
nodeRef.decode().then(() => resolve(nodeRef), reason => reject(reason));
|
|
@@ -3044,11 +3053,12 @@ class Video {
|
|
|
3044
3053
|
return false;
|
|
3045
3054
|
}
|
|
3046
3055
|
start(muted = true, getIsLooped) {
|
|
3047
|
-
this._videoStartedPromise = new Promise(async (resolve) => {
|
|
3056
|
+
this._videoStartedPromise = new Promise(async (resolve, reject) => {
|
|
3048
3057
|
// invariant - always wait for mediaElementsLoadingPromises
|
|
3049
3058
|
// else call of _initVOD can start and onAllMediaLoaded failed
|
|
3050
3059
|
// TODO - add for all Elements state invariant protection
|
|
3051
|
-
Promise.all(this.mediaElementsLoadingPromises)
|
|
3060
|
+
Promise.all(this.mediaElementsLoadingPromises)
|
|
3061
|
+
.then(async () => {
|
|
3052
3062
|
if (this._video) {
|
|
3053
3063
|
if (this._isVOD && this._vodPlayerInstance === null) {
|
|
3054
3064
|
// console.log("_initVOD 5.1");
|
|
@@ -3095,7 +3105,8 @@ class Video {
|
|
|
3095
3105
|
getVideoCurrentTime: () => 0,
|
|
3096
3106
|
});
|
|
3097
3107
|
}
|
|
3098
|
-
})
|
|
3108
|
+
})
|
|
3109
|
+
.catch(reject);
|
|
3099
3110
|
});
|
|
3100
3111
|
return this._videoStartedPromise;
|
|
3101
3112
|
}
|
|
@@ -3601,6 +3612,64 @@ const tryCreateFromHtmlElement = (nodeRef, layer, widgetCallbacks, widgetDeps) =
|
|
|
3601
3612
|
return null;
|
|
3602
3613
|
};
|
|
3603
3614
|
|
|
3615
|
+
class LayerVerticalScrollNotifier {
|
|
3616
|
+
scrollable;
|
|
3617
|
+
cardId;
|
|
3618
|
+
slideIndex;
|
|
3619
|
+
layerIndex;
|
|
3620
|
+
scrollView;
|
|
3621
|
+
onVerticalScrollChange;
|
|
3622
|
+
constructor(scrollable, cardId, slideIndex, layerIndex, scrollView, onVerticalScrollChange) {
|
|
3623
|
+
this.scrollable = scrollable;
|
|
3624
|
+
this.cardId = cardId;
|
|
3625
|
+
this.slideIndex = slideIndex;
|
|
3626
|
+
this.layerIndex = layerIndex;
|
|
3627
|
+
this.scrollView = scrollView;
|
|
3628
|
+
this.onVerticalScrollChange = onVerticalScrollChange;
|
|
3629
|
+
// Store context
|
|
3630
|
+
this.onScroll = this.onScroll.bind(this);
|
|
3631
|
+
this.onUpdateSizeMetrics();
|
|
3632
|
+
}
|
|
3633
|
+
scrollViewHeight = 0;
|
|
3634
|
+
scrollHeight = 0;
|
|
3635
|
+
start() {
|
|
3636
|
+
// emit event with actual scrollPercent at layer start - for SDK synchronization
|
|
3637
|
+
this.onScroll();
|
|
3638
|
+
if (this.scrollable && this.scrollView != null) {
|
|
3639
|
+
this.scrollView.addEventListener("scroll", this.onScroll);
|
|
3640
|
+
}
|
|
3641
|
+
}
|
|
3642
|
+
onUpdateSizeMetrics(metrics) {
|
|
3643
|
+
if (this.scrollView != null) {
|
|
3644
|
+
this.scrollViewHeight = this.scrollView.getBoundingClientRect().height;
|
|
3645
|
+
this.scrollHeight = this.scrollView.scrollHeight;
|
|
3646
|
+
}
|
|
3647
|
+
}
|
|
3648
|
+
onScroll(event) {
|
|
3649
|
+
this.emitEvent(this.scrollView?.scrollTop);
|
|
3650
|
+
}
|
|
3651
|
+
emitEvent(scrollY = 0) {
|
|
3652
|
+
const height = this.scrollHeight - this.scrollViewHeight;
|
|
3653
|
+
// scroll / (full scroll height - viewport height)
|
|
3654
|
+
let scrollPercent = (scrollY / (height > 0 ? height : 1)) * 100;
|
|
3655
|
+
scrollPercent = Math.min(100, Math.round(scrollPercent));
|
|
3656
|
+
this.onVerticalScrollChange({
|
|
3657
|
+
scrollY,
|
|
3658
|
+
scrollPercent,
|
|
3659
|
+
isScrollableLayer: this.scrollable,
|
|
3660
|
+
cardId: this.cardId,
|
|
3661
|
+
slideIndex: this.slideIndex,
|
|
3662
|
+
layerIndex: this.layerIndex,
|
|
3663
|
+
});
|
|
3664
|
+
}
|
|
3665
|
+
destroy() {
|
|
3666
|
+
if (this.scrollable && this.scrollView != null) {
|
|
3667
|
+
this.scrollView.removeEventListener("scroll", this.onScroll);
|
|
3668
|
+
}
|
|
3669
|
+
}
|
|
3670
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`boolean`, `number`, `number`, `number`, `HTMLElement | null`, `SDKApi["onVerticalScrollChange"]`]; }
|
|
3671
|
+
}
|
|
3672
|
+
|
|
3604
3673
|
var TimelineDisabledState;
|
|
3605
3674
|
(function (TimelineDisabledState) {
|
|
3606
3675
|
TimelineDisabledState[TimelineDisabledState["disabled"] = 0] = "disabled";
|
|
@@ -3869,6 +3938,7 @@ class SlideTimeline {
|
|
|
3869
3938
|
class Layer {
|
|
3870
3939
|
_nodeRef;
|
|
3871
3940
|
_slide;
|
|
3941
|
+
_layerIndex;
|
|
3872
3942
|
_slideReadyPromise;
|
|
3873
3943
|
_afterAppResumeQueuePush;
|
|
3874
3944
|
_afterStartInitQueuePush;
|
|
@@ -3885,12 +3955,16 @@ class Layer {
|
|
|
3885
3955
|
_duration;
|
|
3886
3956
|
_disabledTimer;
|
|
3887
3957
|
_disabledNavigation;
|
|
3958
|
+
_scrollable;
|
|
3959
|
+
_scrollView;
|
|
3960
|
+
_layerVerticalScrollNotifier;
|
|
3888
3961
|
_elements = [];
|
|
3889
3962
|
_timeline;
|
|
3890
3963
|
_widgetDeps;
|
|
3891
|
-
constructor(_nodeRef, _slide, _slideReadyPromise, _afterAppResumeQueuePush, _afterStartInitQueuePush, slideApiDeps, _slideRoot, _getLayoutDirection, _slidePauseUI, _slideResumeUI, _getSdkClientVariables) {
|
|
3964
|
+
constructor(_nodeRef, _slide, _layerIndex, _slideReadyPromise, _afterAppResumeQueuePush, _afterStartInitQueuePush, slideApiDeps, _slideRoot, _getLayoutDirection, _slidePauseUI, _slideResumeUI, _getSdkClientVariables) {
|
|
3892
3965
|
this._nodeRef = _nodeRef;
|
|
3893
3966
|
this._slide = _slide;
|
|
3967
|
+
this._layerIndex = _layerIndex;
|
|
3894
3968
|
this._slideReadyPromise = _slideReadyPromise;
|
|
3895
3969
|
this._afterAppResumeQueuePush = _afterAppResumeQueuePush;
|
|
3896
3970
|
this._afterStartInitQueuePush = _afterStartInitQueuePush;
|
|
@@ -3907,6 +3981,9 @@ class Layer {
|
|
|
3907
3981
|
this._duration = parseInt(this._nodeRef.getAttribute("data-duration") ?? "") || DEFAULT_SLIDE_DURATION;
|
|
3908
3982
|
this._disabledTimer = this._nodeRef.getAttribute("data-disable-timer") === "1";
|
|
3909
3983
|
this._disabledNavigation = this._nodeRef.getAttribute("data-disable-navigation") === "1";
|
|
3984
|
+
this._scrollable = this._nodeRef.getAttribute("data-scrollable") === "1";
|
|
3985
|
+
this._scrollView = _nodeRef.querySelector(".narrative-layer-scroll-view");
|
|
3986
|
+
this._layerVerticalScrollNotifier = new LayerVerticalScrollNotifier(this._scrollable, this._cardId, this._slideIndex, this._layerIndex, this._scrollView, this.slideApiDeps.onVerticalScrollChange.bind(this.slideApiDeps));
|
|
3910
3987
|
this._timeline = new SlideTimeline(this._slideIndex, this._duration, this._disabledTimer, this._slideReadyPromise, this._afterAppResumeQueuePush, this.slideApiDeps);
|
|
3911
3988
|
this._widgetDeps = {
|
|
3912
3989
|
slideApiDeps: this.slideApiDeps,
|
|
@@ -3938,7 +4015,7 @@ class Layer {
|
|
|
3938
4015
|
this._slideResumeUI();
|
|
3939
4016
|
}
|
|
3940
4017
|
};
|
|
3941
|
-
const _elementsNodes = this._nodeRef.querySelectorAll(".narrative-slide-elements .narrative-element:not(.narrative-element-child-element)");
|
|
4018
|
+
const _elementsNodes = this._nodeRef.querySelectorAll(".narrative-slide-elements .narrative-element:not(.narrative-element-child-element), .narrative-slide-background .narrative-element:not(.narrative-element-child-element)");
|
|
3942
4019
|
let layerWithWidgetQuest = false;
|
|
3943
4020
|
_elementsNodes.forEach(item => {
|
|
3944
4021
|
let element = tryCreateFromHtmlElement(item, this, {
|
|
@@ -3955,7 +4032,7 @@ class Layer {
|
|
|
3955
4032
|
});
|
|
3956
4033
|
// console.log({ _elementsNodes }, this._elements);
|
|
3957
4034
|
/**
|
|
3958
|
-
* Special
|
|
4035
|
+
* Special behavior for widget Quest
|
|
3959
4036
|
* if current slide/layer without WidgetQuest element explicit but story has type Quest
|
|
3960
4037
|
* - then init WidgetQuest with layer instead of WidgetQuest element (required for WidgetQuest slides navigation)
|
|
3961
4038
|
*/
|
|
@@ -3977,6 +4054,9 @@ class Layer {
|
|
|
3977
4054
|
const promises = this._elements.map(element => element.init(localData));
|
|
3978
4055
|
return promises;
|
|
3979
4056
|
}
|
|
4057
|
+
onUpdateSizeMetrics(metrics) {
|
|
4058
|
+
this._layerVerticalScrollNotifier?.onUpdateSizeMetrics(metrics);
|
|
4059
|
+
}
|
|
3980
4060
|
onAfterAllMediaResourcesLoaded() {
|
|
3981
4061
|
if (this.slideApiDeps.isIOS) ;
|
|
3982
4062
|
this._initTextFit();
|
|
@@ -4032,6 +4112,9 @@ class Layer {
|
|
|
4032
4112
|
get disabledNavigation() {
|
|
4033
4113
|
return this._disabledNavigation;
|
|
4034
4114
|
}
|
|
4115
|
+
get scrollable() {
|
|
4116
|
+
return this._scrollable;
|
|
4117
|
+
}
|
|
4035
4118
|
get videoElement() {
|
|
4036
4119
|
for (const element of this._elements) {
|
|
4037
4120
|
if (Video.isTypeOf(element)) {
|
|
@@ -4161,6 +4244,15 @@ class Layer {
|
|
|
4161
4244
|
_animationPauseCb;
|
|
4162
4245
|
_animationResumeCb;
|
|
4163
4246
|
async start(muted = true) {
|
|
4247
|
+
if (this._layerVerticalScrollNotifier === null) {
|
|
4248
|
+
this._layerVerticalScrollNotifier = new LayerVerticalScrollNotifier(this._scrollable, this._cardId, this._slideIndex, this._layerIndex, this._scrollView, this.slideApiDeps.onVerticalScrollChange.bind(this.slideApiDeps));
|
|
4249
|
+
}
|
|
4250
|
+
// push _layerVerticalScrollNotifier?.start to EventLoop queue
|
|
4251
|
+
// complete story_slide_start, after that - call _layerVerticalScrollNotifier
|
|
4252
|
+
// prevent call _layerVerticalScrollNotifier before storyStarted SDK callback
|
|
4253
|
+
setTimeout(() => {
|
|
4254
|
+
this._layerVerticalScrollNotifier?.start();
|
|
4255
|
+
});
|
|
4164
4256
|
const videoElement = this.videoElement;
|
|
4165
4257
|
let currentTime = 0;
|
|
4166
4258
|
if (videoElement != null) {
|
|
@@ -4191,6 +4283,8 @@ class Layer {
|
|
|
4191
4283
|
return { currentTime };
|
|
4192
4284
|
}
|
|
4193
4285
|
async stop(options) {
|
|
4286
|
+
this._layerVerticalScrollNotifier?.destroy();
|
|
4287
|
+
this._layerVerticalScrollNotifier = null;
|
|
4194
4288
|
this.videoElement?.stop(options);
|
|
4195
4289
|
this.slideApiDeps.cardAnimation?.stop(this._nodeRef);
|
|
4196
4290
|
for (const element of this._elements) {
|
|
@@ -4281,7 +4375,7 @@ class Layer {
|
|
|
4281
4375
|
get isLayerForcePaused() {
|
|
4282
4376
|
return this.elements.some(element => element.isLayerForcePaused);
|
|
4283
4377
|
}
|
|
4284
|
-
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Slide`, `Promise`, `(cb: () => void) => void`, `(cb: () => void) => void`, `ISlideApiDeps`, `HTMLElement`, `() => "ltr" | "rtl"`, `() => Promise<void>`, `() => Promise<void>`, `GetSdkClientVariables`]; }
|
|
4378
|
+
static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Slide`, `number`, `Promise`, `(cb: () => void) => void`, `(cb: () => void) => void`, `ISlideApiDeps`, `HTMLElement`, `() => "ltr" | "rtl"`, `() => Promise<void>`, `() => Promise<void>`, `GetSdkClientVariables`]; }
|
|
4285
4379
|
}
|
|
4286
4380
|
const TextFit = (function () {
|
|
4287
4381
|
const defaultSettings = {
|
|
@@ -4495,9 +4589,12 @@ class Slide {
|
|
|
4495
4589
|
if (!this._slidesNodesRefs.length) {
|
|
4496
4590
|
throw new Error("No slides found.");
|
|
4497
4591
|
}
|
|
4498
|
-
this._layers = this._slidesNodesRefs.map(item => new Layer(item, this, this._slideReadyPromise, this._afterAppResumeQueuePush, this._afterStartInitQueuePush, this.slideApiDeps, this._slideRoot, this._getLayoutDirection, this._slidePauseUI, this._slideResumeUI, this._getSdkClientVariables));
|
|
4592
|
+
this._layers = this._slidesNodesRefs.map((item, layerIndex) => new Layer(item, this, layerIndex, this._slideReadyPromise, this._afterAppResumeQueuePush, this._afterStartInitQueuePush, this.slideApiDeps, this._slideRoot, this._getLayoutDirection, this._slidePauseUI, this._slideResumeUI, this._getSdkClientVariables));
|
|
4499
4593
|
this._activeLayer = this._layers[0];
|
|
4500
4594
|
}
|
|
4595
|
+
onUpdateSizeMetrics(metrics) {
|
|
4596
|
+
this.layers.forEach(layer => layer.onUpdateSizeMetrics(metrics));
|
|
4597
|
+
}
|
|
4501
4598
|
_activeLayer;
|
|
4502
4599
|
get activeLayer() {
|
|
4503
4600
|
return this._activeLayer;
|
|
@@ -4660,6 +4757,7 @@ let SlideApi$1 = class SlideApi {
|
|
|
4660
4757
|
}
|
|
4661
4758
|
this.slideOffsetElement.style.margin = slideOffsetMargin;
|
|
4662
4759
|
}
|
|
4760
|
+
this.slide?.onUpdateSizeMetrics({ fontSize, xOffset, yOffset, isFullscreen, slideOffsetMargin });
|
|
4663
4761
|
}
|
|
4664
4762
|
get slideWrapperElement() {
|
|
4665
4763
|
return this._slideWrapper;
|
|
@@ -5518,7 +5616,7 @@ let SlideApi$1 = class SlideApi {
|
|
|
5518
5616
|
if (element) {
|
|
5519
5617
|
propagation = false;
|
|
5520
5618
|
this.slideApiDeps.setCardLocalData({}, true);
|
|
5521
|
-
this.slideApiDeps.updateCardServerDataLocally(
|
|
5619
|
+
this.slideApiDeps.updateCardServerDataLocally({});
|
|
5522
5620
|
// window._resetTimers();
|
|
5523
5621
|
// сделать async в ios
|
|
5524
5622
|
let slideIndex = this.slide.slideIndex;
|
|
@@ -5816,8 +5914,8 @@ class SlideApiDepsMultiSlideMode {
|
|
|
5816
5914
|
onWidgetRequireResumeUI() {
|
|
5817
5915
|
return this.sdkApi.onWidgetRequireResumeUI();
|
|
5818
5916
|
}
|
|
5819
|
-
getWidgetsSharedData(
|
|
5820
|
-
return this.sdkApi.getWidgetsSharedData(
|
|
5917
|
+
getWidgetsSharedData(widget) {
|
|
5918
|
+
return this.sdkApi.getWidgetsSharedData(widget);
|
|
5821
5919
|
}
|
|
5822
5920
|
showToast(text) {
|
|
5823
5921
|
return this.sdkApi.showToast(text);
|
|
@@ -5905,14 +6003,14 @@ class SlideApiDepsMultiSlideMode {
|
|
|
5905
6003
|
getCardLocalData() {
|
|
5906
6004
|
return this.sdkApi.getCardLocalData();
|
|
5907
6005
|
}
|
|
5908
|
-
getCardServerData(
|
|
5909
|
-
return this.sdkApi.getCardServerData(
|
|
6006
|
+
getCardServerData() {
|
|
6007
|
+
return this.sdkApi.getCardServerData();
|
|
5910
6008
|
}
|
|
5911
6009
|
get cardAnimation() {
|
|
5912
6010
|
return this.sdkApi.cardAnimation;
|
|
5913
6011
|
}
|
|
5914
|
-
updateCardServerDataLocally(
|
|
5915
|
-
this.sdkApi.updateCardServerDataLocally(
|
|
6012
|
+
updateCardServerDataLocally(data) {
|
|
6013
|
+
this.sdkApi.updateCardServerDataLocally(data);
|
|
5916
6014
|
}
|
|
5917
6015
|
get isExistsShowNextCard() {
|
|
5918
6016
|
return this.sdkApi.isExistsShowNextCard;
|
|
@@ -5954,6 +6052,9 @@ class SlideApiDepsMultiSlideMode {
|
|
|
5954
6052
|
productCartClicked() {
|
|
5955
6053
|
this.sdkApi.productCartClicked();
|
|
5956
6054
|
}
|
|
6055
|
+
onVerticalScrollChange(data) {
|
|
6056
|
+
this.sdkApi.onVerticalScrollChange(data);
|
|
6057
|
+
}
|
|
5957
6058
|
/**
|
|
5958
6059
|
* For single slide mode - proxy these methods via SDKApi
|
|
5959
6060
|
* =================================================================================================================
|
|
@@ -5993,8 +6094,8 @@ class SlideApiDepsSingleSlideMode {
|
|
|
5993
6094
|
onWidgetRequireResumeUI() {
|
|
5994
6095
|
return this.sdkApi.onWidgetRequireResumeUI();
|
|
5995
6096
|
}
|
|
5996
|
-
getWidgetsSharedData(
|
|
5997
|
-
return this.sdkApi.getWidgetsSharedData(
|
|
6097
|
+
getWidgetsSharedData(widget) {
|
|
6098
|
+
return this.sdkApi.getWidgetsSharedData(widget);
|
|
5998
6099
|
}
|
|
5999
6100
|
showToast(text) {
|
|
6000
6101
|
return this.sdkApi.showToast(text);
|
|
@@ -6082,14 +6183,14 @@ class SlideApiDepsSingleSlideMode {
|
|
|
6082
6183
|
getCardLocalData() {
|
|
6083
6184
|
return this.sdkApi.getCardLocalData();
|
|
6084
6185
|
}
|
|
6085
|
-
getCardServerData(
|
|
6086
|
-
return this.sdkApi.getCardServerData(
|
|
6186
|
+
getCardServerData() {
|
|
6187
|
+
return this.sdkApi.getCardServerData();
|
|
6087
6188
|
}
|
|
6088
6189
|
get cardAnimation() {
|
|
6089
6190
|
return this.sdkApi.cardAnimation;
|
|
6090
6191
|
}
|
|
6091
|
-
updateCardServerDataLocally(
|
|
6092
|
-
this.sdkApi.updateCardServerDataLocally(
|
|
6192
|
+
updateCardServerDataLocally(data) {
|
|
6193
|
+
this.sdkApi.updateCardServerDataLocally(data);
|
|
6093
6194
|
}
|
|
6094
6195
|
get isExistsShowNextCard() {
|
|
6095
6196
|
return this.sdkApi.isExistsShowNextCard;
|
|
@@ -6153,6 +6254,9 @@ class SlideApiDepsSingleSlideMode {
|
|
|
6153
6254
|
showNextSlide(duration) {
|
|
6154
6255
|
this.sdkApi.showNextSlide(duration);
|
|
6155
6256
|
}
|
|
6257
|
+
onVerticalScrollChange(data) {
|
|
6258
|
+
this.sdkApi.onVerticalScrollChange(data);
|
|
6259
|
+
}
|
|
6156
6260
|
static get [Symbol.for("___CTOR_ARGS___")]() { return [`SDKApi`]; }
|
|
6157
6261
|
}
|
|
6158
6262
|
|
|
@@ -7522,7 +7626,7 @@ class WidgetBase {
|
|
|
7522
7626
|
this.submitButtonView = this.submitButtonAnimatedView.querySelector(".submit-button-view");
|
|
7523
7627
|
}
|
|
7524
7628
|
}
|
|
7525
|
-
this.savedData = this.widgetDeps.slideApiDeps.getCardServerData(
|
|
7629
|
+
this.savedData = this.widgetDeps.slideApiDeps.getCardServerData();
|
|
7526
7630
|
this.localData = extend({}, this.savedData ?? {}, this.options.localData ?? {});
|
|
7527
7631
|
this.id = `w_${this.elementId}_${WidgetBase.widgetIndex}`;
|
|
7528
7632
|
++WidgetBase.widgetIndex;
|
|
@@ -7544,7 +7648,7 @@ class WidgetBase {
|
|
|
7544
7648
|
* @param localData
|
|
7545
7649
|
*/
|
|
7546
7650
|
onRefreshUserData(localData) {
|
|
7547
|
-
this.savedData = this.widgetDeps.slideApiDeps.getCardServerData(
|
|
7651
|
+
this.savedData = this.widgetDeps.slideApiDeps.getCardServerData();
|
|
7548
7652
|
this.localData = extend({}, this.savedData ?? {}, localData);
|
|
7549
7653
|
}
|
|
7550
7654
|
onStart() {
|
|
@@ -18976,7 +19080,7 @@ class WidgetPoll extends WidgetBase {
|
|
|
18976
19080
|
displayPercents(selectedVariantIndex, filled = false) {
|
|
18977
19081
|
let pollAllocation = [0, 0];
|
|
18978
19082
|
let pollAllocationTs = undefined;
|
|
18979
|
-
const sharedData = this.widgetDeps.slideApiDeps.getWidgetsSharedData(
|
|
19083
|
+
const sharedData = this.widgetDeps.slideApiDeps.getWidgetsSharedData("poll" /* Widgets.Poll */);
|
|
18980
19084
|
if (sharedData && sharedData[this.elementId] != null && (isObject$1(sharedData[this.elementId]) || isArray(sharedData[this.elementId]))) {
|
|
18981
19085
|
pollAllocation = sharedData[this.elementId];
|
|
18982
19086
|
if (isObject$1(sharedData[this.elementId])) {
|
|
@@ -23184,7 +23288,7 @@ class WidgetRangeSlider extends WidgetBase {
|
|
|
23184
23288
|
total_user: 0,
|
|
23185
23289
|
};
|
|
23186
23290
|
let answerAllocationTs = undefined;
|
|
23187
|
-
const sharedData = this.widgetDeps.slideApiDeps.getWidgetsSharedData(
|
|
23291
|
+
const sharedData = this.widgetDeps.slideApiDeps.getWidgetsSharedData("rangeSlider" /* Widgets.RangeSlider */);
|
|
23188
23292
|
if (sharedData && sharedData[this.elementId] != null && (isObject$1(sharedData[this.elementId]) || isArray(sharedData[this.elementId]))) {
|
|
23189
23293
|
answerAllocation = sharedData[this.elementId];
|
|
23190
23294
|
answerAllocationTs = sharedData.ts;
|
|
@@ -24881,7 +24985,7 @@ class WidgetVote extends WidgetBase {
|
|
|
24881
24985
|
// voteAllocation[7]
|
|
24882
24986
|
let voteAllocation = [];
|
|
24883
24987
|
let voteAllocationTs = undefined;
|
|
24884
|
-
const sharedData = this.widgetDeps.slideApiDeps.getWidgetsSharedData(
|
|
24988
|
+
const sharedData = this.widgetDeps.slideApiDeps.getWidgetsSharedData("vote" /* Widgets.Vote */);
|
|
24885
24989
|
if (sharedData && sharedData[this.elementId] != null && (isObject$1(sharedData[this.elementId]) || isArray(sharedData[this.elementId]))) {
|
|
24886
24990
|
voteAllocation = sharedData[this.elementId];
|
|
24887
24991
|
if (isObject$1(sharedData[this.elementId])) {
|
|
@@ -25285,7 +25389,7 @@ class WidgetReactions extends WidgetBase {
|
|
|
25285
25389
|
this.element.classList.add("narrative-element-reactions--done");
|
|
25286
25390
|
}
|
|
25287
25391
|
getReactionsSummary() {
|
|
25288
|
-
const sharedData = this.widgetDeps.slideApiDeps.getWidgetsSharedData(
|
|
25392
|
+
const sharedData = this.widgetDeps.slideApiDeps.getWidgetsSharedData("reactions" /* Widgets.Reactions */);
|
|
25289
25393
|
let allocation = [];
|
|
25290
25394
|
let timestamp = null;
|
|
25291
25395
|
if (this.hasValidSharedData(sharedData)) {
|