@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 CHANGED
@@ -1069,10 +1069,10 @@ class EsModuleSdkApi {
1069
1069
  onWidgetRequireResumeUI() {
1070
1070
  return this.sdkBinding.onWidgetRequireResumeUI();
1071
1071
  }
1072
- getCardServerData(cardId) {
1073
- return this.sdkBinding.getCardServerData(cardId);
1072
+ getCardServerData() {
1073
+ return this.sdkBinding.getCardServerData();
1074
1074
  }
1075
- updateCardServerDataLocally(cardId, data) {
1075
+ updateCardServerDataLocally(data) {
1076
1076
  return this.sdkBinding.updateCardServerDataLocally(data);
1077
1077
  }
1078
1078
  showNextSlide(duration) {
@@ -1111,8 +1111,8 @@ class EsModuleSdkApi {
1111
1111
  setCardLocalData(keyValue, sendToServer) {
1112
1112
  this.sdkBinding.setCardLocalData(keyValue, sendToServer);
1113
1113
  }
1114
- getWidgetsSharedData(cardId, widget) {
1115
- return this.sdkBinding.getWidgetsSharedData(cardId, widget);
1114
+ getWidgetsSharedData(widget) {
1115
+ return this.sdkBinding.getWidgetsSharedData(widget);
1116
1116
  }
1117
1117
  vibrate(pattern) {
1118
1118
  navigator.vibrate(pattern);
@@ -1224,6 +1224,9 @@ class EsModuleSdkApi {
1224
1224
  productCartClicked() {
1225
1225
  this.sdkBinding.productCartClicked();
1226
1226
  }
1227
+ onVerticalScrollChange(data) {
1228
+ this.sdkBinding.onVerticalScrollChange(data);
1229
+ }
1227
1230
  static get [Symbol.for("___CTOR_ARGS___")]() { return [`SDKInterface`]; }
1228
1231
  }
1229
1232
 
@@ -1466,7 +1469,7 @@ class PromocodeLocalRepository {
1466
1469
  this.sdkApi = sdkApi;
1467
1470
  }
1468
1471
  init({ localData, cardId }) {
1469
- const savedData = this.sdkApi.getCardServerData(cardId) ?? {};
1472
+ const savedData = this.sdkApi.getCardServerData() ?? {};
1470
1473
  this.localData = extend({}, savedData, localData ?? {});
1471
1474
  }
1472
1475
  getPromocode() {
@@ -2632,9 +2635,15 @@ const waitForImageHtmlElementLoad = async (nodeRef) => {
2632
2635
  }));
2633
2636
  }
2634
2637
  nodeRef.removeEventListener("load", onLoad);
2638
+ nodeRef.removeEventListener("error", onError);
2639
+ };
2640
+ const onError = () => {
2641
+ nodeRef.removeEventListener("load", onLoad);
2642
+ nodeRef.removeEventListener("error", onError);
2643
+ reject(new Error(`Could not load (Network error) Image from URL: ${nodeRef.src}`));
2635
2644
  };
2636
2645
  nodeRef.addEventListener("load", onLoad);
2637
- nodeRef.addEventListener("error", _ => reject(new Error(`Could not load (Network error) Image from URL: ${nodeRef.src}`)));
2646
+ nodeRef.addEventListener("error", onError);
2638
2647
  if (nodeRef.complete && nodeRef.naturalHeight !== 0) {
2639
2648
  if (nodeRef.decode != null) {
2640
2649
  nodeRef.decode().then(() => resolve(nodeRef), reason => reject(reason));
@@ -3046,11 +3055,12 @@ class Video {
3046
3055
  return false;
3047
3056
  }
3048
3057
  start(muted = true, getIsLooped) {
3049
- this._videoStartedPromise = new Promise(async (resolve) => {
3058
+ this._videoStartedPromise = new Promise(async (resolve, reject) => {
3050
3059
  // invariant - always wait for mediaElementsLoadingPromises
3051
3060
  // else call of _initVOD can start and onAllMediaLoaded failed
3052
3061
  // TODO - add for all Elements state invariant protection
3053
- Promise.all(this.mediaElementsLoadingPromises).finally(async () => {
3062
+ Promise.all(this.mediaElementsLoadingPromises)
3063
+ .then(async () => {
3054
3064
  if (this._video) {
3055
3065
  if (this._isVOD && this._vodPlayerInstance === null) {
3056
3066
  // console.log("_initVOD 5.1");
@@ -3097,7 +3107,8 @@ class Video {
3097
3107
  getVideoCurrentTime: () => 0,
3098
3108
  });
3099
3109
  }
3100
- });
3110
+ })
3111
+ .catch(reject);
3101
3112
  });
3102
3113
  return this._videoStartedPromise;
3103
3114
  }
@@ -3603,6 +3614,64 @@ const tryCreateFromHtmlElement = (nodeRef, layer, widgetCallbacks, widgetDeps) =
3603
3614
  return null;
3604
3615
  };
3605
3616
 
3617
+ class LayerVerticalScrollNotifier {
3618
+ scrollable;
3619
+ cardId;
3620
+ slideIndex;
3621
+ layerIndex;
3622
+ scrollView;
3623
+ onVerticalScrollChange;
3624
+ constructor(scrollable, cardId, slideIndex, layerIndex, scrollView, onVerticalScrollChange) {
3625
+ this.scrollable = scrollable;
3626
+ this.cardId = cardId;
3627
+ this.slideIndex = slideIndex;
3628
+ this.layerIndex = layerIndex;
3629
+ this.scrollView = scrollView;
3630
+ this.onVerticalScrollChange = onVerticalScrollChange;
3631
+ // Store context
3632
+ this.onScroll = this.onScroll.bind(this);
3633
+ this.onUpdateSizeMetrics();
3634
+ }
3635
+ scrollViewHeight = 0;
3636
+ scrollHeight = 0;
3637
+ start() {
3638
+ // emit event with actual scrollPercent at layer start - for SDK synchronization
3639
+ this.onScroll();
3640
+ if (this.scrollable && this.scrollView != null) {
3641
+ this.scrollView.addEventListener("scroll", this.onScroll);
3642
+ }
3643
+ }
3644
+ onUpdateSizeMetrics(metrics) {
3645
+ if (this.scrollView != null) {
3646
+ this.scrollViewHeight = this.scrollView.getBoundingClientRect().height;
3647
+ this.scrollHeight = this.scrollView.scrollHeight;
3648
+ }
3649
+ }
3650
+ onScroll(event) {
3651
+ this.emitEvent(this.scrollView?.scrollTop);
3652
+ }
3653
+ emitEvent(scrollY = 0) {
3654
+ const height = this.scrollHeight - this.scrollViewHeight;
3655
+ // scroll / (full scroll height - viewport height)
3656
+ let scrollPercent = (scrollY / (height > 0 ? height : 1)) * 100;
3657
+ scrollPercent = Math.min(100, Math.round(scrollPercent));
3658
+ this.onVerticalScrollChange({
3659
+ scrollY,
3660
+ scrollPercent,
3661
+ isScrollableLayer: this.scrollable,
3662
+ cardId: this.cardId,
3663
+ slideIndex: this.slideIndex,
3664
+ layerIndex: this.layerIndex,
3665
+ });
3666
+ }
3667
+ destroy() {
3668
+ if (this.scrollable && this.scrollView != null) {
3669
+ this.scrollView.removeEventListener("scroll", this.onScroll);
3670
+ }
3671
+ }
3672
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`boolean`, `number`, `number`, `number`, `HTMLElement | null`, `SDKApi["onVerticalScrollChange"]`]; }
3673
+ }
3674
+
3606
3675
  var TimelineDisabledState;
3607
3676
  (function (TimelineDisabledState) {
3608
3677
  TimelineDisabledState[TimelineDisabledState["disabled"] = 0] = "disabled";
@@ -3871,6 +3940,7 @@ class SlideTimeline {
3871
3940
  class Layer {
3872
3941
  _nodeRef;
3873
3942
  _slide;
3943
+ _layerIndex;
3874
3944
  _slideReadyPromise;
3875
3945
  _afterAppResumeQueuePush;
3876
3946
  _afterStartInitQueuePush;
@@ -3887,12 +3957,16 @@ class Layer {
3887
3957
  _duration;
3888
3958
  _disabledTimer;
3889
3959
  _disabledNavigation;
3960
+ _scrollable;
3961
+ _scrollView;
3962
+ _layerVerticalScrollNotifier;
3890
3963
  _elements = [];
3891
3964
  _timeline;
3892
3965
  _widgetDeps;
3893
- constructor(_nodeRef, _slide, _slideReadyPromise, _afterAppResumeQueuePush, _afterStartInitQueuePush, slideApiDeps, _slideRoot, _getLayoutDirection, _slidePauseUI, _slideResumeUI, _getSdkClientVariables) {
3966
+ constructor(_nodeRef, _slide, _layerIndex, _slideReadyPromise, _afterAppResumeQueuePush, _afterStartInitQueuePush, slideApiDeps, _slideRoot, _getLayoutDirection, _slidePauseUI, _slideResumeUI, _getSdkClientVariables) {
3894
3967
  this._nodeRef = _nodeRef;
3895
3968
  this._slide = _slide;
3969
+ this._layerIndex = _layerIndex;
3896
3970
  this._slideReadyPromise = _slideReadyPromise;
3897
3971
  this._afterAppResumeQueuePush = _afterAppResumeQueuePush;
3898
3972
  this._afterStartInitQueuePush = _afterStartInitQueuePush;
@@ -3909,6 +3983,9 @@ class Layer {
3909
3983
  this._duration = parseInt(this._nodeRef.getAttribute("data-duration") ?? "") || DEFAULT_SLIDE_DURATION;
3910
3984
  this._disabledTimer = this._nodeRef.getAttribute("data-disable-timer") === "1";
3911
3985
  this._disabledNavigation = this._nodeRef.getAttribute("data-disable-navigation") === "1";
3986
+ this._scrollable = this._nodeRef.getAttribute("data-scrollable") === "1";
3987
+ this._scrollView = _nodeRef.querySelector(".narrative-layer-scroll-view");
3988
+ this._layerVerticalScrollNotifier = new LayerVerticalScrollNotifier(this._scrollable, this._cardId, this._slideIndex, this._layerIndex, this._scrollView, this.slideApiDeps.onVerticalScrollChange.bind(this.slideApiDeps));
3912
3989
  this._timeline = new SlideTimeline(this._slideIndex, this._duration, this._disabledTimer, this._slideReadyPromise, this._afterAppResumeQueuePush, this.slideApiDeps);
3913
3990
  this._widgetDeps = {
3914
3991
  slideApiDeps: this.slideApiDeps,
@@ -3940,7 +4017,7 @@ class Layer {
3940
4017
  this._slideResumeUI();
3941
4018
  }
3942
4019
  };
3943
- const _elementsNodes = this._nodeRef.querySelectorAll(".narrative-slide-elements .narrative-element:not(.narrative-element-child-element)");
4020
+ 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)");
3944
4021
  let layerWithWidgetQuest = false;
3945
4022
  _elementsNodes.forEach(item => {
3946
4023
  let element = tryCreateFromHtmlElement(item, this, {
@@ -3957,7 +4034,7 @@ class Layer {
3957
4034
  });
3958
4035
  // console.log({ _elementsNodes }, this._elements);
3959
4036
  /**
3960
- * Special behaviour for widget Quest
4037
+ * Special behavior for widget Quest
3961
4038
  * if current slide/layer without WidgetQuest element explicit but story has type Quest
3962
4039
  * - then init WidgetQuest with layer instead of WidgetQuest element (required for WidgetQuest slides navigation)
3963
4040
  */
@@ -3979,6 +4056,9 @@ class Layer {
3979
4056
  const promises = this._elements.map(element => element.init(localData));
3980
4057
  return promises;
3981
4058
  }
4059
+ onUpdateSizeMetrics(metrics) {
4060
+ this._layerVerticalScrollNotifier?.onUpdateSizeMetrics(metrics);
4061
+ }
3982
4062
  onAfterAllMediaResourcesLoaded() {
3983
4063
  if (this.slideApiDeps.isIOS) ;
3984
4064
  this._initTextFit();
@@ -4034,6 +4114,9 @@ class Layer {
4034
4114
  get disabledNavigation() {
4035
4115
  return this._disabledNavigation;
4036
4116
  }
4117
+ get scrollable() {
4118
+ return this._scrollable;
4119
+ }
4037
4120
  get videoElement() {
4038
4121
  for (const element of this._elements) {
4039
4122
  if (Video.isTypeOf(element)) {
@@ -4163,6 +4246,15 @@ class Layer {
4163
4246
  _animationPauseCb;
4164
4247
  _animationResumeCb;
4165
4248
  async start(muted = true) {
4249
+ if (this._layerVerticalScrollNotifier === null) {
4250
+ this._layerVerticalScrollNotifier = new LayerVerticalScrollNotifier(this._scrollable, this._cardId, this._slideIndex, this._layerIndex, this._scrollView, this.slideApiDeps.onVerticalScrollChange.bind(this.slideApiDeps));
4251
+ }
4252
+ // push _layerVerticalScrollNotifier?.start to EventLoop queue
4253
+ // complete story_slide_start, after that - call _layerVerticalScrollNotifier
4254
+ // prevent call _layerVerticalScrollNotifier before storyStarted SDK callback
4255
+ setTimeout(() => {
4256
+ this._layerVerticalScrollNotifier?.start();
4257
+ });
4166
4258
  const videoElement = this.videoElement;
4167
4259
  let currentTime = 0;
4168
4260
  if (videoElement != null) {
@@ -4193,6 +4285,8 @@ class Layer {
4193
4285
  return { currentTime };
4194
4286
  }
4195
4287
  async stop(options) {
4288
+ this._layerVerticalScrollNotifier?.destroy();
4289
+ this._layerVerticalScrollNotifier = null;
4196
4290
  this.videoElement?.stop(options);
4197
4291
  this.slideApiDeps.cardAnimation?.stop(this._nodeRef);
4198
4292
  for (const element of this._elements) {
@@ -4283,7 +4377,7 @@ class Layer {
4283
4377
  get isLayerForcePaused() {
4284
4378
  return this.elements.some(element => element.isLayerForcePaused);
4285
4379
  }
4286
- 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`]; }
4380
+ 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`]; }
4287
4381
  }
4288
4382
  const TextFit = (function () {
4289
4383
  const defaultSettings = {
@@ -4497,9 +4591,12 @@ class Slide {
4497
4591
  if (!this._slidesNodesRefs.length) {
4498
4592
  throw new Error("No slides found.");
4499
4593
  }
4500
- 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));
4594
+ 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));
4501
4595
  this._activeLayer = this._layers[0];
4502
4596
  }
4597
+ onUpdateSizeMetrics(metrics) {
4598
+ this.layers.forEach(layer => layer.onUpdateSizeMetrics(metrics));
4599
+ }
4503
4600
  _activeLayer;
4504
4601
  get activeLayer() {
4505
4602
  return this._activeLayer;
@@ -4662,6 +4759,7 @@ let SlideApi$1 = class SlideApi {
4662
4759
  }
4663
4760
  this.slideOffsetElement.style.margin = slideOffsetMargin;
4664
4761
  }
4762
+ this.slide?.onUpdateSizeMetrics({ fontSize, xOffset, yOffset, isFullscreen, slideOffsetMargin });
4665
4763
  }
4666
4764
  get slideWrapperElement() {
4667
4765
  return this._slideWrapper;
@@ -5520,7 +5618,7 @@ let SlideApi$1 = class SlideApi {
5520
5618
  if (element) {
5521
5619
  propagation = false;
5522
5620
  this.slideApiDeps.setCardLocalData({}, true);
5523
- this.slideApiDeps.updateCardServerDataLocally(this.slide.cardId, {});
5621
+ this.slideApiDeps.updateCardServerDataLocally({});
5524
5622
  // window._resetTimers();
5525
5623
  // сделать async в ios
5526
5624
  let slideIndex = this.slide.slideIndex;
@@ -5818,8 +5916,8 @@ class SlideApiDepsMultiSlideMode {
5818
5916
  onWidgetRequireResumeUI() {
5819
5917
  return this.sdkApi.onWidgetRequireResumeUI();
5820
5918
  }
5821
- getWidgetsSharedData(cardId, widget) {
5822
- return this.sdkApi.getWidgetsSharedData(cardId, widget);
5919
+ getWidgetsSharedData(widget) {
5920
+ return this.sdkApi.getWidgetsSharedData(widget);
5823
5921
  }
5824
5922
  showToast(text) {
5825
5923
  return this.sdkApi.showToast(text);
@@ -5907,14 +6005,14 @@ class SlideApiDepsMultiSlideMode {
5907
6005
  getCardLocalData() {
5908
6006
  return this.sdkApi.getCardLocalData();
5909
6007
  }
5910
- getCardServerData(cardId) {
5911
- return this.sdkApi.getCardServerData(cardId);
6008
+ getCardServerData() {
6009
+ return this.sdkApi.getCardServerData();
5912
6010
  }
5913
6011
  get cardAnimation() {
5914
6012
  return this.sdkApi.cardAnimation;
5915
6013
  }
5916
- updateCardServerDataLocally(cardId, data) {
5917
- this.sdkApi.updateCardServerDataLocally(cardId, data);
6014
+ updateCardServerDataLocally(data) {
6015
+ this.sdkApi.updateCardServerDataLocally(data);
5918
6016
  }
5919
6017
  get isExistsShowNextCard() {
5920
6018
  return this.sdkApi.isExistsShowNextCard;
@@ -5956,6 +6054,9 @@ class SlideApiDepsMultiSlideMode {
5956
6054
  productCartClicked() {
5957
6055
  this.sdkApi.productCartClicked();
5958
6056
  }
6057
+ onVerticalScrollChange(data) {
6058
+ this.sdkApi.onVerticalScrollChange(data);
6059
+ }
5959
6060
  /**
5960
6061
  * For single slide mode - proxy these methods via SDKApi
5961
6062
  * =================================================================================================================
@@ -5995,8 +6096,8 @@ class SlideApiDepsSingleSlideMode {
5995
6096
  onWidgetRequireResumeUI() {
5996
6097
  return this.sdkApi.onWidgetRequireResumeUI();
5997
6098
  }
5998
- getWidgetsSharedData(cardId, widget) {
5999
- return this.sdkApi.getWidgetsSharedData(cardId, widget);
6099
+ getWidgetsSharedData(widget) {
6100
+ return this.sdkApi.getWidgetsSharedData(widget);
6000
6101
  }
6001
6102
  showToast(text) {
6002
6103
  return this.sdkApi.showToast(text);
@@ -6084,14 +6185,14 @@ class SlideApiDepsSingleSlideMode {
6084
6185
  getCardLocalData() {
6085
6186
  return this.sdkApi.getCardLocalData();
6086
6187
  }
6087
- getCardServerData(cardId) {
6088
- return this.sdkApi.getCardServerData(cardId);
6188
+ getCardServerData() {
6189
+ return this.sdkApi.getCardServerData();
6089
6190
  }
6090
6191
  get cardAnimation() {
6091
6192
  return this.sdkApi.cardAnimation;
6092
6193
  }
6093
- updateCardServerDataLocally(cardId, data) {
6094
- this.sdkApi.updateCardServerDataLocally(cardId, data);
6194
+ updateCardServerDataLocally(data) {
6195
+ this.sdkApi.updateCardServerDataLocally(data);
6095
6196
  }
6096
6197
  get isExistsShowNextCard() {
6097
6198
  return this.sdkApi.isExistsShowNextCard;
@@ -6155,6 +6256,9 @@ class SlideApiDepsSingleSlideMode {
6155
6256
  showNextSlide(duration) {
6156
6257
  this.sdkApi.showNextSlide(duration);
6157
6258
  }
6259
+ onVerticalScrollChange(data) {
6260
+ this.sdkApi.onVerticalScrollChange(data);
6261
+ }
6158
6262
  static get [Symbol.for("___CTOR_ARGS___")]() { return [`SDKApi`]; }
6159
6263
  }
6160
6264
 
@@ -7524,7 +7628,7 @@ class WidgetBase {
7524
7628
  this.submitButtonView = this.submitButtonAnimatedView.querySelector(".submit-button-view");
7525
7629
  }
7526
7630
  }
7527
- this.savedData = this.widgetDeps.slideApiDeps.getCardServerData(this.cardId);
7631
+ this.savedData = this.widgetDeps.slideApiDeps.getCardServerData();
7528
7632
  this.localData = extend({}, this.savedData ?? {}, this.options.localData ?? {});
7529
7633
  this.id = `w_${this.elementId}_${WidgetBase.widgetIndex}`;
7530
7634
  ++WidgetBase.widgetIndex;
@@ -7546,7 +7650,7 @@ class WidgetBase {
7546
7650
  * @param localData
7547
7651
  */
7548
7652
  onRefreshUserData(localData) {
7549
- this.savedData = this.widgetDeps.slideApiDeps.getCardServerData(this.cardId);
7653
+ this.savedData = this.widgetDeps.slideApiDeps.getCardServerData();
7550
7654
  this.localData = extend({}, this.savedData ?? {}, localData);
7551
7655
  }
7552
7656
  onStart() {
@@ -18978,7 +19082,7 @@ class WidgetPoll extends WidgetBase {
18978
19082
  displayPercents(selectedVariantIndex, filled = false) {
18979
19083
  let pollAllocation = [0, 0];
18980
19084
  let pollAllocationTs = undefined;
18981
- const sharedData = this.widgetDeps.slideApiDeps.getWidgetsSharedData(this.cardId, "poll" /* Widgets.Poll */);
19085
+ const sharedData = this.widgetDeps.slideApiDeps.getWidgetsSharedData("poll" /* Widgets.Poll */);
18982
19086
  if (sharedData && sharedData[this.elementId] != null && (isObject$1(sharedData[this.elementId]) || isArray(sharedData[this.elementId]))) {
18983
19087
  pollAllocation = sharedData[this.elementId];
18984
19088
  if (isObject$1(sharedData[this.elementId])) {
@@ -23186,7 +23290,7 @@ class WidgetRangeSlider extends WidgetBase {
23186
23290
  total_user: 0,
23187
23291
  };
23188
23292
  let answerAllocationTs = undefined;
23189
- const sharedData = this.widgetDeps.slideApiDeps.getWidgetsSharedData(this.cardId, "rangeSlider" /* Widgets.RangeSlider */);
23293
+ const sharedData = this.widgetDeps.slideApiDeps.getWidgetsSharedData("rangeSlider" /* Widgets.RangeSlider */);
23190
23294
  if (sharedData && sharedData[this.elementId] != null && (isObject$1(sharedData[this.elementId]) || isArray(sharedData[this.elementId]))) {
23191
23295
  answerAllocation = sharedData[this.elementId];
23192
23296
  answerAllocationTs = sharedData.ts;
@@ -24883,7 +24987,7 @@ class WidgetVote extends WidgetBase {
24883
24987
  // voteAllocation[7]
24884
24988
  let voteAllocation = [];
24885
24989
  let voteAllocationTs = undefined;
24886
- const sharedData = this.widgetDeps.slideApiDeps.getWidgetsSharedData(this.cardId, "vote" /* Widgets.Vote */);
24990
+ const sharedData = this.widgetDeps.slideApiDeps.getWidgetsSharedData("vote" /* Widgets.Vote */);
24887
24991
  if (sharedData && sharedData[this.elementId] != null && (isObject$1(sharedData[this.elementId]) || isArray(sharedData[this.elementId]))) {
24888
24992
  voteAllocation = sharedData[this.elementId];
24889
24993
  if (isObject$1(sharedData[this.elementId])) {
@@ -25287,7 +25391,7 @@ class WidgetReactions extends WidgetBase {
25287
25391
  this.element.classList.add("narrative-element-reactions--done");
25288
25392
  }
25289
25393
  getReactionsSummary() {
25290
- const sharedData = this.widgetDeps.slideApiDeps.getWidgetsSharedData(this.cardId, "reactions" /* Widgets.Reactions */);
25394
+ const sharedData = this.widgetDeps.slideApiDeps.getWidgetsSharedData("reactions" /* Widgets.Reactions */);
25291
25395
  let allocation = [];
25292
25396
  let timestamp = null;
25293
25397
  if (this.hasValidSharedData(sharedData)) {