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.
- package/dist/{BaseStory-CKQJ7Wfh.js → BaseStory-CGJPJF3C.js} +55 -55
- package/dist/{create-product-feed-impl-DWP-VfPV.js → create-product-feed-impl-C1fMHCQz.js} +1 -1
- package/dist/{index-BRNobzkS.js → index-29Rc3QQE.js} +101 -101
- package/dist/{index-C8jfT4zH.js → index-3J0nu6ui.js} +2 -2
- package/dist/{index-BoLwBbh6.js → index-B-RkzgeK.js} +3 -3
- package/dist/{index-BbTbm52c.js → index-B8ETjpoy.js} +2 -2
- package/dist/{index-G2gLWeLd.js → index-B8tMKFIN.js} +2 -2
- package/dist/{index-BIdztBXW.js → index-BAVBf89P.js} +7 -7
- package/dist/{index-DsAB9NU-.js → index-BFHbHO6s.js} +1 -1
- package/dist/{index-DIamCtiB.js → index-BPl5l8-U.js} +2 -2
- package/dist/{index-DbNQjd-Z.js → index-Bc8sEKZQ.js} +2 -2
- package/dist/{index-BVcIraN4.js → index-CLKZi4yw.js} +548 -537
- package/dist/{index-CnfOrPuP.js → index-CMOqL0Eu.js} +612 -594
- package/dist/{index-B8EOwrLD.js → index-CQ5hHqHC.js} +14 -8
- package/dist/{index-DKlS9bix.js → index-CmCBrytS.js} +1 -1
- package/dist/{index-BEKrXw-_.js → index-CrjY03GE.js} +25 -17
- package/dist/{index--zTfefLS.js → index-CtAqM5FE.js} +2 -2
- package/dist/{index-CfYkM3hj.js → index-CufWPcHg.js} +105 -98
- package/dist/{index-Dok6czQi.js → index-DFW1ha19.js} +3 -3
- package/dist/{index-6wtUk9f6.js → index-DGuwGtnd.js} +2 -2
- package/dist/{index-BGbP8u-0.js → index-DKFaAHfq.js} +2 -2
- package/dist/{index-DG2IQ_CD.js → index-DL0BHipn.js} +2 -2
- package/dist/{index-DucyXhox.js → index-DQc5QdIL.js} +1 -1
- package/dist/{index-CW9MZ0c0.js → index-DR6ySAAb.js} +3 -3
- package/dist/{index-DumxlWIz.js → index-DX6N8yaZ.js} +2 -2
- package/dist/{index-CXOGsXCL.js → index-D_3_0Hhl.js} +518 -502
- package/dist/{index-Cy1z81N9.js → index-DdFdoS0w.js} +45 -42
- package/dist/{index-wTVvre3-.js → index-DwhocU4G.js} +168 -156
- package/dist/index-DyISEq76.js +838 -0
- package/dist/{index-oibHjkIZ.js → index-R4VcMvSw.js} +15 -14
- package/dist/{index-B0Ost33B.js → index-S43iBrvY.js} +3 -3
- package/dist/{index-LGUwijVR.js → index-sFpjJo45.js} +3 -3
- package/dist/index-tXY4e4qB.js +667 -0
- package/dist/index.d.ts +3 -0
- package/dist/{intersection-observer-impl-Sw_z_-P1.js → intersection-observer-impl-CEqLBxdz.js} +1 -1
- package/dist/{nudge-story-groups-impl-CvbNudzH.js → nudge-story-groups-impl-CgexExyl.js} +1 -1
- package/dist/{ref-HTLydA7U.js → ref-Co9PvI6U.js} +1 -1
- package/dist/{rule-engine-LbPIGDKh.js → rule-engine-BlIEGanT.js} +1 -1
- package/dist/{story-group-animation-impl-BU28Y9vs.js → story-group-animation-impl-BYzGCkyZ.js} +1 -1
- package/dist/storyly-placement.js +1 -1
- package/package.json +1 -1
- package/dist/index-D-m3Dnsg.js +0 -858
- package/dist/index-DtF03n15.js +0 -628
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { S as
|
|
2
|
-
import { d as k } from "./intersection-observer-impl-
|
|
3
|
-
import { H as W, C as B, r as g, A as R, S as G } from "./index-
|
|
4
|
-
class
|
|
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:
|
|
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 =
|
|
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-
|
|
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-
|
|
182
|
+
const i = (await import("./index-DKFaAHfq.js")).default;
|
|
183
183
|
e.instance = new i({ ...o });
|
|
184
184
|
}
|
|
185
|
-
if (t.type ===
|
|
186
|
-
const i = (await import("./index-
|
|
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 ===
|
|
189
|
-
const i = (await import("./index-
|
|
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 ===
|
|
192
|
-
const i = (await import("./index-
|
|
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 ===
|
|
195
|
-
const i = (await import("./index-
|
|
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 ===
|
|
198
|
-
const i = (await import("./index
|
|
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 ===
|
|
201
|
-
const i = (await import("./index-
|
|
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:
|
|
204
|
+
type: a.IMAGE_CTA
|
|
205
205
|
});
|
|
206
|
-
} else if (t.type ===
|
|
206
|
+
} else if (t.type === a.BUTTON || t.type === a.SWIPE)
|
|
207
207
|
this.ctaLayer_ = new B({
|
|
208
208
|
...o,
|
|
209
|
-
type: t.type ===
|
|
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-
|
|
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 ===
|
|
218
|
-
const i = (await import("./index-
|
|
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 ===
|
|
221
|
-
const i = (await import("./index-
|
|
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 ===
|
|
224
|
-
const i = (await import("./index-
|
|
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 ===
|
|
227
|
-
const i = (await import("./index-
|
|
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 ===
|
|
233
|
-
const i = (await import("./index-
|
|
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 ===
|
|
236
|
-
const i = (await import("./index-
|
|
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 ===
|
|
239
|
-
const i = (await import("./index-
|
|
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() ? (
|
|
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_))) : (
|
|
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
|
-
|
|
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
|
-
|
|
387
|
+
r(t, "tabindex", "21"), r(t, "aria-hidden", "false");
|
|
388
388
|
}), this.storyDom_.querySelectorAll(".product-tag-tooltip").forEach((t) => {
|
|
389
|
-
|
|
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) =>
|
|
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"),
|
|
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"),
|
|
402
|
+
h(t, "tabindex"), r(t, "aria-hidden", "true");
|
|
403
403
|
}), this.storyDom_.querySelectorAll(".product-tag-tooltip").forEach((t) => {
|
|
404
|
-
h(t, "tabindex"),
|
|
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"),
|
|
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
|
-
|
|
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
|
-
|
|
666
|
+
H as B
|
|
667
667
|
};
|