storyly-placement 1.13.0 → 1.14.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.
Files changed (43) hide show
  1. package/dist/{BaseStory-CKQJ7Wfh.js → BaseStory-CGJPJF3C.js} +55 -55
  2. package/dist/{create-product-feed-impl-DWP-VfPV.js → create-product-feed-impl-C1fMHCQz.js} +1 -1
  3. package/dist/{index-BRNobzkS.js → index-29Rc3QQE.js} +101 -101
  4. package/dist/{index-C8jfT4zH.js → index-3J0nu6ui.js} +2 -2
  5. package/dist/{index-BoLwBbh6.js → index-B-RkzgeK.js} +3 -3
  6. package/dist/{index-BbTbm52c.js → index-B8ETjpoy.js} +2 -2
  7. package/dist/{index-G2gLWeLd.js → index-B8tMKFIN.js} +2 -2
  8. package/dist/{index-BIdztBXW.js → index-BAVBf89P.js} +7 -7
  9. package/dist/{index-DsAB9NU-.js → index-BFHbHO6s.js} +1 -1
  10. package/dist/{index-DIamCtiB.js → index-BPl5l8-U.js} +2 -2
  11. package/dist/{index-DbNQjd-Z.js → index-Bc8sEKZQ.js} +2 -2
  12. package/dist/{index-BVcIraN4.js → index-CLKZi4yw.js} +548 -537
  13. package/dist/{index-CnfOrPuP.js → index-CMOqL0Eu.js} +612 -594
  14. package/dist/{index-B8EOwrLD.js → index-CQ5hHqHC.js} +14 -8
  15. package/dist/{index-DKlS9bix.js → index-CmCBrytS.js} +1 -1
  16. package/dist/{index-BEKrXw-_.js → index-CrjY03GE.js} +25 -17
  17. package/dist/{index--zTfefLS.js → index-CtAqM5FE.js} +2 -2
  18. package/dist/{index-CfYkM3hj.js → index-CufWPcHg.js} +105 -98
  19. package/dist/{index-Dok6czQi.js → index-DFW1ha19.js} +3 -3
  20. package/dist/{index-6wtUk9f6.js → index-DGuwGtnd.js} +2 -2
  21. package/dist/{index-BGbP8u-0.js → index-DKFaAHfq.js} +2 -2
  22. package/dist/{index-DG2IQ_CD.js → index-DL0BHipn.js} +2 -2
  23. package/dist/{index-DucyXhox.js → index-DQc5QdIL.js} +1 -1
  24. package/dist/{index-CW9MZ0c0.js → index-DR6ySAAb.js} +3 -3
  25. package/dist/{index-DumxlWIz.js → index-DX6N8yaZ.js} +2 -2
  26. package/dist/{index-CXOGsXCL.js → index-D_3_0Hhl.js} +518 -502
  27. package/dist/{index-Cy1z81N9.js → index-DdFdoS0w.js} +45 -42
  28. package/dist/{index-wTVvre3-.js → index-DwhocU4G.js} +168 -156
  29. package/dist/index-DyISEq76.js +838 -0
  30. package/dist/{index-oibHjkIZ.js → index-R4VcMvSw.js} +15 -14
  31. package/dist/{index-B0Ost33B.js → index-S43iBrvY.js} +3 -3
  32. package/dist/{index-LGUwijVR.js → index-sFpjJo45.js} +3 -3
  33. package/dist/index-tXY4e4qB.js +667 -0
  34. package/dist/index.d.ts +3 -0
  35. package/dist/{intersection-observer-impl-Sw_z_-P1.js → intersection-observer-impl-CEqLBxdz.js} +1 -1
  36. package/dist/{nudge-story-groups-impl-CvbNudzH.js → nudge-story-groups-impl-CgexExyl.js} +1 -1
  37. package/dist/{ref-HTLydA7U.js → ref-Co9PvI6U.js} +1 -1
  38. package/dist/{rule-engine-LbPIGDKh.js → rule-engine-BlIEGanT.js} +1 -1
  39. package/dist/{story-group-animation-impl-BU28Y9vs.js → story-group-animation-impl-BYzGCkyZ.js} +1 -1
  40. package/dist/storyly-placement.js +1 -1
  41. package/package.json +1 -1
  42. package/dist/index-D-m3Dnsg.js +0 -858
  43. package/dist/index-DtF03n15.js +0 -628
@@ -1,7 +1,7 @@
1
- import { S as T, s as _, l as a, J as L, m as y, h as d, a0 as p, M as n, C as l, a1 as A, b as v, a2 as c, u as r, a3 as h, P as u, o as S, _ as w, a4 as x, K as b, n as P, a5 as O, c as q, a6 as I, f as m, k as V } from "./index-BEKrXw-_.js";
2
- import { d as k } from "./intersection-observer-impl-Sw_z_-P1.js";
3
- import { H as W, C as B, r as g, A as R, S as G } from "./index-CfYkM3hj.js";
4
- class Q {
1
+ import { S as E, s as _, h as r, J as L, m as y, j as d, a1 as p, M as n, C as l, a2 as A, b as v, a3 as c, u as a, $ as h, P as u, o as S, _ as w, a4 as x, K as b, n as P, a5 as O, c as q, a6 as I, f as m, l as V } from "./index-CrjY03GE.js";
2
+ import { d as k } from "./intersection-observer-impl-CEqLBxdz.js";
3
+ import { H as W, C as B, r as g, A as R, S as G } from "./index-CufWPcHg.js";
4
+ class H {
5
5
  constructor({
6
6
  story: t,
7
7
  key: s,
@@ -11,9 +11,9 @@ class Q {
11
11
  progressDoms: f,
12
12
  instanceId: D,
13
13
  condition: C,
14
- getActiveStory: E
14
+ getActiveStory: T
15
15
  }) {
16
- this.storyDom_ = null, this.layersContainer_ = document.createElement("div"), this.story_ = t, this.storyData_ = {}, this.layers_ = [], this.group_ = e, this.key_ = s, this.storiesContainer_ = o, this.groupWrapper_ = i, this.progressDoms_ = new Proxy(f, []), this.storyProgressSecond_ = 7, this.progressPaused_ = !0, this.imageAsset_ = null, this.videoAsset_ = null, this.videoAssetLoadingStarted_ = !1, this.storyProgressRemain_ = this.storyProgressSecond_, this.progressTime_ = 0, this.isBlankStory_ = !1, this.imageAssetLoaded_ = !1, this.instanceId_ = D, this.timedLayers_ = [], this.condition_ = C, this.getActiveStory = E, this.storylyContext = T.getContext(this.instanceId_), this.isSharing_ = !1, _(this.layersContainer_, "layers-container"), a(this.layersContainer_, "dir", k.LTR), this.attachCallbacksToElement_();
16
+ this.storyDom_ = null, this.layersContainer_ = document.createElement("div"), this.story_ = t, this.storyData_ = {}, this.layers_ = [], this.group_ = e, this.key_ = s, this.storiesContainer_ = o, this.groupWrapper_ = i, this.progressDoms_ = new Proxy(f, []), this.storyProgressSecond_ = 7, this.progressPaused_ = !0, this.imageAsset_ = null, this.videoAsset_ = null, this.videoAssetLoadingStarted_ = !1, this.storyProgressRemain_ = this.storyProgressSecond_, this.progressTime_ = 0, this.isBlankStory_ = !1, this.imageAssetLoaded_ = !1, this.instanceId_ = D, this.timedLayers_ = [], this.condition_ = C, this.getActiveStory = T, this.storylyContext = E.getContext(this.instanceId_), this.isSharing_ = !1, _(this.layersContainer_, "layers-container"), r(this.layersContainer_, "dir", k.LTR), this.attachCallbacksToElement_();
17
17
  }
18
18
  /**
19
19
  * Attaches callbacks to the DOM element for them to be used by publishers.
@@ -92,7 +92,7 @@ class Q {
92
92
  height: this.videoAsset_.videoHeight,
93
93
  width: this.videoAsset_.videoWidth
94
94
  }), this.storyProgressRemain_ = this.videoAsset_.duration, this.storyProgressSecond_ = this.videoAsset_.duration, this.videoAsset_.duration >= 120 && !p(this.storyData_.video_type)) {
95
- const t = await (await import("./index-DKlS9bix.js")).default;
95
+ const t = await (await import("./index-CmCBrytS.js")).default;
96
96
  this.videoSeekbar_ = new t({
97
97
  storyDom: this.storyDom_,
98
98
  videoDom: this.videoAsset_,
@@ -179,64 +179,64 @@ class Q {
179
179
  };
180
180
  if (t.is_bg && (t.bg_color || t.gradient_colors)) {
181
181
  this.isBlankStory_ = !0;
182
- const i = (await import("./index-BGbP8u-0.js")).default;
182
+ const i = (await import("./index-DKFaAHfq.js")).default;
183
183
  e.instance = new i({ ...o });
184
184
  }
185
- if (t.type === r.EMOJI) {
186
- const i = (await import("./index-6wtUk9f6.js")).default;
185
+ if (t.type === a.EMOJI) {
186
+ const i = (await import("./index-DGuwGtnd.js")).default;
187
187
  e.instance = new i({ ...o });
188
- } else if (t.type === r.POLL) {
189
- const i = (await import("./index-BbTbm52c.js")).default;
188
+ } else if (t.type === a.POLL) {
189
+ const i = (await import("./index-B8ETjpoy.js")).default;
190
190
  e.instance = new i({ ...o });
191
- } else if (t.type === r.RATING) {
192
- const i = (await import("./index-DumxlWIz.js")).default;
191
+ } else if (t.type === a.RATING) {
192
+ const i = (await import("./index-DX6N8yaZ.js")).default;
193
193
  e.instance = new i({ ...o });
194
- } else if (t.type === r.QUIZ) {
195
- const i = (await import("./index-C8jfT4zH.js")).default;
194
+ } else if (t.type === a.QUIZ) {
195
+ const i = (await import("./index-3J0nu6ui.js")).default;
196
196
  e.instance = new i({ ...o });
197
- } else if (t.type === r.COUNTDOWN) {
198
- const i = (await import("./index--zTfefLS.js")).default;
197
+ } else if (t.type === a.COUNTDOWN) {
198
+ const i = (await import("./index-CtAqM5FE.js")).default;
199
199
  e.instance = new i({ ...o });
200
- } else if (t.type === r.IMAGE_CTA) {
201
- const i = (await import("./index-B8EOwrLD.js")).default;
200
+ } else if (t.type === a.IMAGE_CTA) {
201
+ const i = (await import("./index-CQ5hHqHC.js")).default;
202
202
  e.instance = new i({
203
203
  ...o,
204
- type: r.IMAGE_CTA
204
+ type: a.IMAGE_CTA
205
205
  });
206
- } else if (t.type === r.BUTTON || t.type === r.SWIPE)
206
+ } else if (t.type === a.BUTTON || t.type === a.SWIPE)
207
207
  this.ctaLayer_ = new B({
208
208
  ...o,
209
- type: t.type === r.BUTTON ? r.BUTTON : r.SWIPE
209
+ type: t.type === a.BUTTON ? a.BUTTON : a.SWIPE
210
210
  }), e.instance = this.ctaLayer_;
211
211
  else if ((t.image_path || t.video_path || t.image_url) && t.studio_component_type) {
212
- const i = (await import("./index-DbNQjd-Z.js")).default;
212
+ const i = (await import("./index-Bc8sEKZQ.js")).default;
213
213
  e.instance = new i({
214
214
  ...o,
215
215
  mediaHost: this.group_.media_host
216
216
  });
217
- } else if (t.type === r.TEXT) {
218
- const i = (await import("./index-DG2IQ_CD.js")).default;
217
+ } else if (t.type === a.TEXT) {
218
+ const i = (await import("./index-DL0BHipn.js")).default;
219
219
  e.instance = new i({ ...o });
220
- } else if (t.type === r.PRODUCT_TAG) {
221
- const i = (await import("./index-LGUwijVR.js")).default;
220
+ } else if (t.type === a.PRODUCT_TAG) {
221
+ const i = (await import("./index-sFpjJo45.js")).default;
222
222
  e.instance = new i({ ...o });
223
- } else if (t.type === r.PROMO_CODE) {
224
- const i = (await import("./index-BoLwBbh6.js")).default;
223
+ } else if (t.type === a.PROMO_CODE) {
224
+ const i = (await import("./index-B-RkzgeK.js")).default;
225
225
  e.instance = new i({ ...o });
226
- } else if (t.type === r.QUESTION) {
227
- const i = (await import("./index-B0Ost33B.js")).default;
226
+ } else if (t.type === a.QUESTION) {
227
+ const i = (await import("./index-S43iBrvY.js")).default;
228
228
  e.instance = new i({
229
229
  ...o,
230
230
  storiesContainer: this.storiesContainer_
231
231
  });
232
- } else if (t.type === r.PRODUCT_CARD) {
233
- const i = (await import("./index-DIamCtiB.js")).default;
232
+ } else if (t.type === a.PRODUCT_CARD) {
233
+ const i = (await import("./index-BPl5l8-U.js")).default;
234
234
  e.instance = new i({ ...o });
235
- } else if (t.type === r.PRODUCT_CATALOG) {
236
- const i = (await import("./index-G2gLWeLd.js")).default;
235
+ } else if (t.type === a.PRODUCT_CATALOG) {
236
+ const i = (await import("./index-B8tMKFIN.js")).default;
237
237
  e.instance = new i({ ...o });
238
- } else if (t.type === r.IMAGE_QUIZ) {
239
- const i = (await import("./index-CW9MZ0c0.js")).default;
238
+ } else if (t.type === a.IMAGE_QUIZ) {
239
+ const i = (await import("./index-DR6ySAAb.js")).default;
240
240
  e.instance = new i({ ...o });
241
241
  }
242
242
  (e.start_time || e.end_time) && (e.instance.hideLayer(), this.timedLayers_.push(e));
@@ -292,7 +292,7 @@ class Q {
292
292
  );
293
293
  this.playPauseAction_ = t.querySelector(
294
294
  'button[data-type="play-pause"]'
295
- ), o && (h(o, "hidden"), u(o, this.handleCloseGroup_)), v() ? (a(this.playPauseAction_, "hidden", !0), this.accessibilityAction_ = this.storiesContainer_.querySelector(
295
+ ), o && (h(o, "hidden"), u(o, this.handleCloseGroup_)), v() ? (r(this.playPauseAction_, "hidden", !0), this.accessibilityAction_ = this.storiesContainer_.querySelector(
296
296
  ".accessibility-switch-button"
297
297
  ), this.accessibilityAction_ && (this.accessibilityAction_.addEventListener(
298
298
  "pointerdown",
@@ -301,7 +301,7 @@ class Q {
301
301
  accessibilityEnabled: !0
302
302
  })) : (this.accessibilityAction_.setAttribute("data-pressed", "false"), n(this.storyDom_, "onAccessibilityTriggered", {
303
303
  accessibilityEnabled: !1
304
- })))) : (h(this.playPauseAction_, "hidden"), this.playPauseAction_.classList.replace("play", "pause"), u(this.playPauseAction_, this.playAndPauseStory)), this.videoAsset_ ? (h(s, "hidden"), u(s, this.handleSoundStory_), this.story_.alt_text && (h(i, "hidden"), u(i, this.handleTranscript_))) : (a(s, "hidden", !0), a(i, "hidden", !0)), this.storylyContext.getState().videoMuted === !1 && this.videoAsset_ ? (this.videoAsset_.muted = !1, this.soundOn_ = !0, s.classList.replace("sound-off", "sound-on")) : this.videoAsset_ && (this.videoAsset_.muted = !0, this.soundOn_ = !1, s.classList.replace("sound-on", "sound-off")), this.story_.is_sharable && (h(e, "hidden"), u(e, this.renderShareWidget));
304
+ })))) : (h(this.playPauseAction_, "hidden"), this.playPauseAction_.classList.replace("play", "pause"), u(this.playPauseAction_, this.playAndPauseStory)), this.videoAsset_ ? (h(s, "hidden"), u(s, this.handleSoundStory_), this.story_.alt_text && (h(i, "hidden"), u(i, this.handleTranscript_))) : (r(s, "hidden", !0), r(i, "hidden", !0)), this.storylyContext.getState().videoMuted === !1 && this.videoAsset_ ? (this.videoAsset_.muted = !1, this.soundOn_ = !0, s.classList.replace("sound-off", "sound-on")) : this.videoAsset_ && (this.videoAsset_.muted = !0, this.soundOn_ = !1, s.classList.replace("sound-on", "sound-off")), this.story_.is_sharable && (h(e, "hidden"), u(e, this.renderShareWidget));
305
305
  }
306
306
  /**
307
307
  * @param {PointerEvent} e
@@ -381,14 +381,14 @@ class Q {
381
381
  * @private
382
382
  */
383
383
  exposeAccessibilityElements_() {
384
- this.storyDom_.querySelectorAll(".cta-button").forEach((t) => {
385
- a(t, "tabindex", "21"), a(t, "aria-hidden", "false");
384
+ r(this.storyDom_, "aria-hidden", "false"), this.storyDom_.querySelectorAll(".cta-button").forEach((t) => {
385
+ r(t, "tabindex", "21"), r(t, "aria-hidden", "false");
386
386
  }), this.storyDom_.querySelectorAll(".swipe-up-button").forEach((t) => {
387
- a(t, "tabindex", "21"), a(t, "aria-hidden", "false");
387
+ r(t, "tabindex", "21"), r(t, "aria-hidden", "false");
388
388
  }), this.storyDom_.querySelectorAll(".product-tag-tooltip").forEach((t) => {
389
- a(t, "tabindex", "21"), a(t, "aria-hidden", "false");
389
+ r(t, "tabindex", "21"), r(t, "aria-hidden", "false");
390
390
  }), this.storyDom_.querySelectorAll(".poll-component").forEach((t) => {
391
- t.querySelectorAll("button").forEach((s) => a(s, "tabindex", "22")), a(t, "tabindex", "22"), a(t, "aria-hidden", "false");
391
+ t.querySelectorAll("button").forEach((s) => r(s, "tabindex", "22")), r(t, "tabindex", "22"), r(t, "aria-hidden", "false");
392
392
  });
393
393
  }
394
394
  /**
@@ -396,14 +396,14 @@ class Q {
396
396
  * @private
397
397
  */
398
398
  hideAccessibilityElements_() {
399
- this.storyDom_.querySelectorAll(".cta-button").forEach((t) => {
400
- h(t, "tabindex"), a(t, "aria-hidden", "true");
399
+ r(this.storyDom_, "aria-hidden", "true"), this.storyDom_.querySelectorAll(".cta-button").forEach((t) => {
400
+ h(t, "tabindex"), r(t, "aria-hidden", "true");
401
401
  }), this.storyDom_.querySelectorAll(".swipe-up-button").forEach((t) => {
402
- h(t, "tabindex"), a(t, "aria-hidden", "true");
402
+ h(t, "tabindex"), r(t, "aria-hidden", "true");
403
403
  }), this.storyDom_.querySelectorAll(".product-tag-tooltip").forEach((t) => {
404
- h(t, "tabindex"), a(t, "aria-hidden", "true");
404
+ h(t, "tabindex"), r(t, "aria-hidden", "true");
405
405
  }), this.storyDom_.querySelectorAll(".poll-component").forEach((t) => {
406
- t.querySelectorAll("button").forEach((s) => h(s, "tabindex")), h(t, "tabindex"), a(t, "aria-hidden", "true");
406
+ t.querySelectorAll("button").forEach((s) => h(s, "tabindex")), h(t, "tabindex"), r(t, "aria-hidden", "true");
407
407
  });
408
408
  }
409
409
  /**
@@ -470,7 +470,7 @@ class Q {
470
470
  path: this.story_.media.thumbnail_url,
471
471
  story: this.storyData_
472
472
  });
473
- a(this.storyDom_.querySelector("video"), "poster", t);
473
+ r(this.storyDom_.querySelector("video"), "poster", t);
474
474
  }
475
475
  /**
476
476
  * handle pause or play of active story
@@ -548,8 +548,8 @@ class Q {
548
548
  this.group_.group_id,
549
549
  this.story_.story_id,
550
550
  this.storylyContext.getState().shareParams
551
- ), this.handleStoryActions_(), this.handleStoryTitleOnChange_(), this.progressPaused_ = !1, this.storyProgressRemain_ = this.storyProgressSecond_, this.progressTime_ = 0, m(this.progressDoms_[this.key_], "seen"), this.videoAsset_ ? this.onVideoShown_() : this.isBlankStory_ || this.imageAssetLoaded_ ? this.handleProgressBar_() : this.imageAsset_.style.paddingBottom = "0.5px", this.storylyContext.getState().accessibility && d(this.playPauseAction_, ["display", "none"]), this.exposeAccessibilityElements_(), _(this.progressDoms_[this.key_], "active"), _(this.storyDom_, "active"), setTimeout(() => {
552
- this.storyDom_.focus();
551
+ ), this.handleStoryActions_(), this.handleStoryTitleOnChange_(), this.progressPaused_ = !1, this.storyProgressRemain_ = this.storyProgressSecond_, this.progressTime_ = 0, m(this.progressDoms_[this.key_], "seen"), this.videoAsset_ ? this.onVideoShown_() : this.isBlankStory_ || this.imageAssetLoaded_ ? this.handleProgressBar_() : this.imageAsset_.style.paddingBottom = "0.5px", this.storylyContext.getState().accessibility && d(this.playPauseAction_, ["display", "none"]), this.exposeAccessibilityElements_(), _(this.progressDoms_[this.key_], "active"), _(this.storyDom_, "active"), clearTimeout(this.storyFocusTimeout_), this.storyFocusTimeout_ = setTimeout(() => {
552
+ this.storyFocusTimeout_ = null, this.storyDom_.getAttribute("aria-hidden") !== "true" && this.storyDom_.focus();
553
553
  }, 500), this.sendStoryViewedEvent_(), n(this.storyDom_, "onShortcut", {
554
554
  is_sharable: this.story_.is_sharable
555
555
  });
@@ -562,7 +562,7 @@ class Q {
562
562
  */
563
563
  hide({ isBack: t = !1, holdActive: s = !1 } = {}) {
564
564
  var e;
565
- if (this.storyDom_.removeAttribute("show"), this.storyDom_.hasAttribute("paused") && this.storyDom_.removeAttribute("paused"), this.hideAccessibilityElements_(), clearInterval(this.progressInterval_), clearInterval(this.startInterval_), this.progressInterval_ = null, this.startInterval_ = null, this.videoAsset_) {
565
+ if (this.storyDom_.removeAttribute("show"), this.storyDom_.hasAttribute("paused") && this.storyDom_.removeAttribute("paused"), this.hideAccessibilityElements_(), clearTimeout(this.storyFocusTimeout_), this.storyFocusTimeout_ = null, clearInterval(this.progressInterval_), clearInterval(this.startInterval_), this.progressInterval_ = null, this.startInterval_ = null, this.videoAsset_) {
566
566
  if (this.videoAsset_.currentTime = 0, this.videoPlayedPromise_ ? this.videoPlayedPromise_.then(() => {
567
567
  this.videoPausedPromise_ = this.videoAsset_.pause();
568
568
  }) : this.videoPausedPromise_ = this.videoAsset_.pause(), this.hls_) {
@@ -663,5 +663,5 @@ class Q {
663
663
  }
664
664
  }
665
665
  export {
666
- Q as B
666
+ H as B
667
667
  };
@@ -1,4 +1,4 @@
1
- import { Y as b, W as A } from "./index-BEKrXw-_.js";
1
+ import { Y as b, W as A } from "./index-CrjY03GE.js";
2
2
  function v(g, D) {
3
3
  const _ = /@{p_(\d).+?}/, s = Object.freeze({
4
4
  TITLE: /@{p_\d_title}/,