@streamlayer/web-os 0.3.7 → 0.3.8

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.
@@ -17787,7 +17787,7 @@ const Re = O$9(tt, {
17787
17787
  open: c2,
17788
17788
  togglePause: a2,
17789
17789
  controlVideo: s2,
17790
- promotionId: i4,
17790
+ promotionId: r2,
17791
17791
  onClose: b2,
17792
17792
  markAsViewed: A2,
17793
17793
  advertisementPaused: H2,
@@ -17795,11 +17795,11 @@ const Re = O$9(tt, {
17795
17795
  fireEvent: t2,
17796
17796
  muted: $2
17797
17797
  } = j2, q2 = useRef(null), B2 = useRef(null), [M2, z2] = useState$1(0), K2 = e2.type === PromotionType.INGAME_IAB11_LBAR ? M2 : M2 / 2, R2 = !!((_3 = (N2 = e2.banner) == null ? void 0 : N2.video) != null && _3.url), y3 = e2.autoPlayVideo === AutoPlayVideo.ENABLED, V2 = e2.playVideoMuted === PlayVideoMuted.ENABLED, Q2 = V2 && y3, J2 = e2.type === PromotionType.INGAME_IAB11_LBAR || e2.type === PromotionType.INGAME_IAB11 || e2.type === PromotionType.INGAME_IAB11_SIDEBAR, [f2, X2] = useState$1(true), [Y2, Z2] = useState$1(void 0);
17798
- let m2 = (w2 = e2.banner) == null ? void 0 : w2.url;
17799
- return m2 && !m2.startsWith("http") && (m2 = `https://${m2}`), useEffect$1(() => {
17798
+ let u2 = (w2 = e2.banner) == null ? void 0 : w2.url;
17799
+ return u2 && !u2.startsWith("http") && (u2 = `https://${u2}`), useEffect$1(() => {
17800
17800
  if (!B2.current) return;
17801
- const n2 = new ResizeObserver(([u2]) => {
17802
- const E2 = u2.contentRect.width;
17801
+ const n2 = new ResizeObserver(([m2]) => {
17802
+ const E2 = m2.contentRect.width;
17803
17803
  z2(E2);
17804
17804
  });
17805
17805
  return n2.observe(B2.current), updateAllLayouts(), () => {
@@ -17808,8 +17808,8 @@ const Re = O$9(tt, {
17808
17808
  }, []), useEffect$1(() => {
17809
17809
  a2 == null || a2(R2 || y3), c2 == null || c2();
17810
17810
  }, [R2, y3, c2, a2]), useEffect$1(() => {
17811
- i4 && e2.type && A2 && A2();
17812
- }, [i4, e2.type, A2]), useEffect$1(() => () => {
17811
+ r2 && e2.type && A2 && A2();
17812
+ }, [r2, e2.type, A2]), useEffect$1(() => () => {
17813
17813
  s2 == null || s2({ muted: false });
17814
17814
  }, [s2]), /* @__PURE__ */ jsx(Ge, { children: /* @__PURE__ */ jsxs(We, { ref: B2, children: [
17815
17815
  /* @__PURE__ */ jsxs(Ke, { children: [
@@ -17821,7 +17821,17 @@ const Re = O$9(tt, {
17821
17821
  ] })
17822
17822
  ] }),
17823
17823
  e2.logoMode === 2 && e2.type === PromotionType.INGAME_IAB11_LBAR && /* @__PURE__ */ jsx("img", { src: (g2 = e2.sponsor) == null ? void 0 : g2.logo, alt: "Video paused preview", style: { height: "56px" } }),
17824
- /* @__PURE__ */ jsx(Re, { options: { focusKey: "close-ad-button" }, webos: true, onClick: b2, "data-close-btn": "true", children: /* @__PURE__ */ jsx(et, {}) })
17824
+ /* @__PURE__ */ jsx(
17825
+ Re,
17826
+ {
17827
+ autoFocus: true,
17828
+ options: { focusKey: "close-ad-button" },
17829
+ webos: true,
17830
+ onClick: b2,
17831
+ "data-close-btn": "true",
17832
+ children: /* @__PURE__ */ jsx(et, {})
17833
+ }
17834
+ )
17825
17835
  ] }),
17826
17836
  e2.logoMode === 2 && e2.type !== PromotionType.INGAME_IAB11_LBAR && /* @__PURE__ */ jsx(
17827
17837
  "img",
@@ -17857,7 +17867,7 @@ const Re = O$9(tt, {
17857
17867
  o2 != null && o2("video-rendered") || (eventBus.emit("advertisement", {
17858
17868
  action: "videoRendered",
17859
17869
  payload: {
17860
- id: i4,
17870
+ id: r2,
17861
17871
  type: e2.type
17862
17872
  }
17863
17873
  }), t2 == null || t2("video-rendered"));
@@ -17866,21 +17876,21 @@ const Re = O$9(tt, {
17866
17876
  o2 != null && o2(`video-quartile-${n2}`) || (eventBus.emit("advertisement", {
17867
17877
  action: "quartileCompleted",
17868
17878
  payload: {
17869
- id: i4,
17879
+ id: r2,
17870
17880
  type: e2.type,
17871
17881
  quartile: n2
17872
17882
  }
17873
17883
  }), t2 == null || t2(`video-quartile-${n2}`));
17874
17884
  },
17875
17885
  onMute: (n2) => {
17876
- const u2 = n2 ? "muted" : "unmuted";
17877
- o2 != null && o2(u2) || (eventBus.emit("advertisement", {
17886
+ const m2 = n2 ? "muted" : "unmuted";
17887
+ o2 != null && o2(m2) || (eventBus.emit("advertisement", {
17878
17888
  action: n2 ? "videoMuted" : "videoUnmuted",
17879
17889
  payload: {
17880
- id: i4,
17890
+ id: r2,
17881
17891
  type: e2.type
17882
17892
  }
17883
- }), t2 == null || t2(u2)), Z2(n2);
17893
+ }), t2 == null || t2(m2)), Z2(n2);
17884
17894
  },
17885
17895
  onPause: () => {
17886
17896
  a2 == null || a2(true), X2(false);
@@ -17889,7 +17899,7 @@ const Re = O$9(tt, {
17889
17899
  o2 != null && o2("replayed") || (eventBus.emit("advertisement", {
17890
17900
  action: "videoReplayed",
17891
17901
  payload: {
17892
- id: i4,
17902
+ id: r2,
17893
17903
  type: e2.type
17894
17904
  }
17895
17905
  }), t2 == null || t2("replayed"));
@@ -17898,13 +17908,13 @@ const Re = O$9(tt, {
17898
17908
  o2 != null && o2("played") || (eventBus.emit("advertisement", {
17899
17909
  action: "videoPlay",
17900
17910
  payload: {
17901
- id: i4,
17911
+ id: r2,
17902
17912
  type: e2.type
17903
17913
  }
17904
17914
  }), t2 == null || t2("played")), a2 == null || a2(false), o2 != null && o2("played") && (o2 != null && o2("ended")) && !(o2 != null && o2("replayed")) && (eventBus.emit("advertisement", {
17905
17915
  action: "videoReplayed",
17906
17916
  payload: {
17907
- id: i4,
17917
+ id: r2,
17908
17918
  type: e2.type
17909
17919
  }
17910
17920
  }), t2 == null || t2("replayed"));
@@ -17913,7 +17923,7 @@ const Re = O$9(tt, {
17913
17923
  o2 != null && o2("ended") || (eventBus.emit("advertisement", {
17914
17924
  action: "videoEnd",
17915
17925
  payload: {
17916
- id: i4,
17926
+ id: r2,
17917
17927
  type: e2.type
17918
17928
  }
17919
17929
  }), t2 == null || t2("ended"));
@@ -19250,39 +19260,39 @@ const e$3 = /* @__PURE__ */ styled_default("div")({
19250
19260
  class: "p8lpomy",
19251
19261
  propsAsIs: false
19252
19262
  }), o$4 = /* @__PURE__ */ styled_default("div")({
19253
- name: "PauseAdGradientLeft",
19254
- class: "pv7u167",
19255
- propsAsIs: false
19256
- }), n$3 = /* @__PURE__ */ styled_default("div")({
19257
19263
  name: "PauseAdGradientRight",
19258
- class: "p1kh2yb0",
19264
+ class: "pv7u167",
19259
19265
  propsAsIs: false
19260
19266
  }), p$9 = /* @__PURE__ */ styled_default("div")({
19261
19267
  name: "PauseAdGradientBottom",
19262
- class: "pl8f94x",
19268
+ class: "p1kh2yb0",
19263
19269
  propsAsIs: false
19264
- }), d$2 = /* @__PURE__ */ styled_default("div")({
19270
+ }), n$3 = /* @__PURE__ */ styled_default("div")({
19265
19271
  name: "PauseAdTopLeft",
19266
- class: "p1m6zmrt",
19272
+ class: "pl8f94x",
19267
19273
  propsAsIs: false
19268
- }), l$7 = /* @__PURE__ */ styled_default("h2")({
19274
+ }), d$2 = /* @__PURE__ */ styled_default("h2")({
19269
19275
  name: "PauseAdTitle",
19270
- class: "pm3vwfa",
19276
+ class: "p1m6zmrt",
19271
19277
  propsAsIs: false
19272
- }), A$4 = /* @__PURE__ */ styled_default("p")({
19278
+ }), l$7 = /* @__PURE__ */ styled_default("p")({
19273
19279
  name: "PauseAdCaption",
19274
- class: "p1tibuhw",
19280
+ class: "pm3vwfa",
19275
19281
  propsAsIs: false
19276
- }), r$7 = /* @__PURE__ */ styled_default("div")({
19282
+ }), A$4 = /* @__PURE__ */ styled_default("div")({
19277
19283
  name: "PauseAdBottomLeft",
19278
- class: "ptqqrqd",
19284
+ class: "p1tibuhw",
19279
19285
  propsAsIs: false
19280
- }), i$8 = /* @__PURE__ */ styled_default("button")({
19286
+ }), r$7 = /* @__PURE__ */ styled_default("button")({
19281
19287
  name: "PauseAdPlayButton",
19282
- class: "p14estxv",
19288
+ class: "ptqqrqd",
19283
19289
  propsAsIs: false
19284
- }), u$4 = /* @__PURE__ */ styled_default("div")({
19290
+ }), i$8 = /* @__PURE__ */ styled_default("div")({
19285
19291
  name: "PauseAdSidebar",
19292
+ class: "p14estxv",
19293
+ propsAsIs: false
19294
+ }), u$4 = /* @__PURE__ */ styled_default("span")({
19295
+ name: "PauseAdTitleDescription",
19286
19296
  class: "p1dpvfl1",
19287
19297
  propsAsIs: false
19288
19298
  }), c$8 = /* @__PURE__ */ styled_default("img")({
@@ -19291,62 +19301,61 @@ const e$3 = /* @__PURE__ */ styled_default("div")({
19291
19301
  propsAsIs: false
19292
19302
  });
19293
19303
  const z$1 = ({ vastUrl: t2 }) => {
19294
- var n2;
19304
+ var s2;
19295
19305
  const [, d2] = _$2(), u2 = useStore(d2, { keys: [t2] });
19296
- return (n2 = u2 == null ? void 0 : u2[t2]) != null && n2.imageSrc ? u2[t2].adUrl ? /* @__PURE__ */ jsx("a", { href: u2[t2].adUrl, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ jsx(c$8, { src: u2[t2].imageSrc }) }) : /* @__PURE__ */ jsx(c$8, { src: u2[t2].imageSrc }) : null;
19297
- }, H = ({ isClosing: t2, title: d2, caption: u2, onPlay: n2, onClose: o2, vastUrl: a2, options: r2 }) => {
19306
+ return (s2 = u2 == null ? void 0 : u2[t2]) != null && s2.imageSrc ? u2[t2].adUrl ? /* @__PURE__ */ jsx("a", { href: u2[t2].adUrl, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ jsx(c$8, { src: u2[t2].imageSrc }) }) : /* @__PURE__ */ jsx(c$8, { src: u2[t2].imageSrc }) : null;
19307
+ }, H = ({ isClosing: t2, title: d2, caption: u2, onPlay: s2, onClose: f2, vastUrl: a2, options: r2 }) => {
19298
19308
  var _a;
19299
- const f2 = (_a = r2 == null ? void 0 : r2.showPauseButton) != null ? _a : true, { ref: s2, focusSelf: m2 } = useFocusable({
19309
+ const m2 = (_a = r2 == null ? void 0 : r2.showPauseButton) != null ? _a : true, { ref: n2, focusSelf: l2 } = useFocusable({
19300
19310
  focusKey: "sl-pause-ad-play",
19301
- onEnterRelease: n2,
19311
+ onEnterRelease: s2,
19302
19312
  isFocusBoundary: true,
19303
19313
  forceFocus: true
19304
19314
  });
19305
19315
  return useEffect$1(() => {
19306
- s2.current && m2();
19307
- }, [s2, m2]), useEffect$1(() => {
19308
- const P2 = (l2) => {
19309
- const p2 = l2.keyCode;
19310
- if (p2 === 461 || p2 === 10009 || p2 === 27) {
19311
- l2.preventDefault(), l2.stopPropagation(), l2.stopImmediatePropagation(), o2 == null || o2();
19316
+ n2.current && l2();
19317
+ }, [n2, l2]), useEffect$1(() => {
19318
+ const P2 = (p2) => {
19319
+ const o2 = p2.keyCode;
19320
+ if (o2 === 461 || o2 === 10009 || o2 === 27 || o2 === 8) {
19321
+ p2.preventDefault(), p2.stopPropagation(), p2.stopImmediatePropagation(), f2 == null || f2();
19312
19322
  return;
19313
19323
  }
19314
19324
  };
19315
19325
  return window.addEventListener("keydown", P2, { capture: true }), () => window.removeEventListener("keydown", P2, { capture: true });
19316
- }, [o2]), /* @__PURE__ */ jsx(e$3, { className: cx_default(t2 && "pause-ad-closing"), children: /* @__PURE__ */ jsxs(t$a, { children: [
19326
+ }, [f2]), /* @__PURE__ */ jsx(e$3, { className: cx_default(t2 && "pause-ad-closing"), children: /* @__PURE__ */ jsxs(t$a, { children: [
19317
19327
  /* @__PURE__ */ jsx(o$4, {}),
19318
- /* @__PURE__ */ jsx(n$3, {}),
19319
19328
  /* @__PURE__ */ jsx(p$9, {}),
19320
- /* @__PURE__ */ jsxs(d$2, { children: [
19321
- /* @__PURE__ */ jsx(l$7, { children: d2 }),
19322
- /* @__PURE__ */ jsx(A$4, { children: u2 })
19329
+ /* @__PURE__ */ jsxs(n$3, { children: [
19330
+ /* @__PURE__ */ jsx(d$2, { children: d2 }),
19331
+ /* @__PURE__ */ jsx(l$7, { children: u2 })
19323
19332
  ] }),
19324
- f2 && /* @__PURE__ */ jsx(r$7, { children: /* @__PURE__ */ jsx(
19325
- i$8,
19333
+ m2 && /* @__PURE__ */ jsx(A$4, { children: /* @__PURE__ */ jsx(
19334
+ r$7,
19326
19335
  {
19327
- ref: s2,
19328
- onClick: n2,
19329
- onMouseEnter: () => s2.current.focus(),
19336
+ ref: n2,
19337
+ onClick: s2,
19338
+ onMouseEnter: () => n2.current.focus(),
19330
19339
  "aria-label": "Resume playback"
19331
19340
  }
19332
19341
  ) }),
19333
- /* @__PURE__ */ jsxs(u$4, { children: [
19342
+ /* @__PURE__ */ jsxs(i$8, { children: [
19334
19343
  a2 && /* @__PURE__ */ jsx(z$1, { vastUrl: a2 }),
19335
- /* @__PURE__ */ jsx("span", { children: "ADVERTISEMENT" })
19344
+ /* @__PURE__ */ jsx(u$4, { children: "ADVERTISEMENT" })
19336
19345
  ] })
19337
19346
  ] }) });
19338
19347
  }, U = ({
19339
19348
  showPauseAd: t2,
19340
19349
  vastUrls: d2,
19341
19350
  title: u2,
19342
- caption: n2,
19343
- onPlay: o2,
19351
+ caption: s2,
19352
+ onPlay: f2,
19344
19353
  onClose: a2,
19345
19354
  onRender: r2,
19346
- options: f2
19355
+ options: m2
19347
19356
  }) => {
19348
19357
  var _a;
19349
- const s2 = (_a = f2 == null ? void 0 : f2.pauseAdDelay) != null ? _a : 5e3, [m2, P2] = useState$1(false), [l2, p2] = useState$1(false), c2 = useRef(), i4 = d2 == null ? void 0 : d2[0].url, y3 = useRef(i4);
19358
+ const n2 = (_a = m2 == null ? void 0 : m2.pauseAdDelay) != null ? _a : 5e3, [l2, P2] = useState$1(false), [p2, o2] = useState$1(false), c2 = useRef(), i4 = d2 == null ? void 0 : d2[0].url, y3 = useRef(i4);
19350
19359
  y3.current = i4;
19351
19360
  const [T2, E2] = _$2();
19352
19361
  return useEffect$1(() => {
@@ -19361,7 +19370,7 @@ const z$1 = ({ vastUrl: t2 }) => {
19361
19370
  });
19362
19371
  const w2 = () => {
19363
19372
  var A2;
19364
- (A2 = E2.get()[y3.current]) != null && A2.imageSrc ? (clearTimeout(c2.current), p2(false), P2(true), eventBus.emit("exposedPauseAd", {
19373
+ (A2 = E2.get()[y3.current]) != null && A2.imageSrc ? (clearTimeout(c2.current), o2(false), P2(true), eventBus.emit("exposedPauseAd", {
19365
19374
  action: "rendered",
19366
19375
  payload: {}
19367
19376
  })) : c2.current = setTimeout(() => {
@@ -19370,31 +19379,31 @@ const z$1 = ({ vastUrl: t2 }) => {
19370
19379
  };
19371
19380
  c2.current = setTimeout(() => {
19372
19381
  w2();
19373
- }, s2);
19382
+ }, n2);
19374
19383
  } else
19375
19384
  eventBus.emit("exposedPauseAd", {
19376
19385
  action: "disabled",
19377
19386
  payload: {}
19378
- }), p2(true), c2.current = setTimeout(() => {
19387
+ }), o2(true), c2.current = setTimeout(() => {
19379
19388
  P2(false);
19380
19389
  }, 400);
19381
19390
  return () => {
19382
19391
  c2.current && clearTimeout(c2.current);
19383
19392
  };
19384
- }, [E2, T2, a2, s2, t2, i4]), useEffect$1(() => {
19385
- r2 == null || r2({ rendered: m2 });
19386
- }, [m2, r2]), useEffect$1(() => () => {
19393
+ }, [E2, T2, a2, n2, t2, i4]), useEffect$1(() => {
19394
+ r2 == null || r2({ rendered: l2 });
19395
+ }, [l2, r2]), useEffect$1(() => () => {
19387
19396
  r2 == null || r2({ rendered: false });
19388
- }, [r2]), m2 ? /* @__PURE__ */ jsx(
19397
+ }, [r2]), l2 ? /* @__PURE__ */ jsx(
19389
19398
  H,
19390
19399
  {
19391
19400
  onClose: a2,
19392
- isClosing: l2,
19401
+ isClosing: p2,
19393
19402
  title: u2,
19394
- caption: n2,
19395
- onPlay: o2,
19403
+ caption: s2,
19404
+ onPlay: f2,
19396
19405
  vastUrl: i4,
19397
- options: f2
19406
+ options: m2
19398
19407
  }
19399
19408
  ) : null;
19400
19409
  };