@streamlayer/web-os 0.6.0 → 0.6.1

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.
@@ -6725,7 +6725,7 @@ const D$6 = /* @__PURE__ */ styled_default("div")({
6725
6725
  persistent: c2,
6726
6726
  controlVideo: p2
6727
6727
  }, m2) => {
6728
- var A2, g2, b2, S2, y3, L2, U2, P2, I2, W3, O2, h2, k2, E2, T2, B2;
6728
+ var A2, b2, g2, S2, L2, y3, U2, P2, I2, W3, O2, k2, E2, T2, h2, B2;
6729
6729
  const e2 = useStore(t6.advertisement.$store), o2 = useStore(t6.openedQuestion.$store), f2 = useStore(t6.openedQuestion.$extendedStore), {
6730
6730
  finished: v2
6731
6731
  } = S$8();
@@ -6737,16 +6737,13 @@ const D$6 = /* @__PURE__ */ styled_default("div")({
6737
6737
  var w2;
6738
6738
  v2 && ((w2 = e2.close) == null || w2.call(e2));
6739
6739
  }, [v2]);
6740
- const F2 = ((b2 = (g2 = (A2 = e2.data) == null ? void 0 : A2.question) == null ? void 0 : g2.backgroundImage) == null ? void 0 : b2.landscapeUrl) || ((y3 = (S2 = e2.data) == null ? void 0 : S2.promotion) == null ? void 0 : y3.backgroundImageLandscapeUrl), M2 = ((P2 = (U2 = (L2 = e2.data) == null ? void 0 : L2.question) == null ? void 0 : U2.backgroundImage) == null ? void 0 : P2.portraitUrl) || ((W3 = (I2 = e2.data) == null ? void 0 : I2.promotion) == null ? void 0 : W3.backgroundImagePortraitUrl), R2 = y$g({
6740
+ const F2 = ((g2 = (b2 = (A2 = e2.data) == null ? void 0 : A2.question) == null ? void 0 : b2.backgroundImage) == null ? void 0 : g2.landscapeUrl) || ((L2 = (S2 = e2.data) == null ? void 0 : S2.promotion) == null ? void 0 : L2.backgroundImageLandscapeUrl), M2 = ((P2 = (U2 = (y3 = e2.data) == null ? void 0 : y3.question) == null ? void 0 : U2.backgroundImage) == null ? void 0 : P2.portraitUrl) || ((W3 = (I2 = e2.data) == null ? void 0 : I2.promotion) == null ? void 0 : W3.backgroundImagePortraitUrl), R2 = y$g({
6741
6741
  containerId: s2,
6742
6742
  landscapeUrl: F2,
6743
6743
  portraitUrl: M2
6744
- }), K2 = ((h2 = (O2 = f2 == null ? void 0 : f2.data) == null ? void 0 : O2.appearance) == null ? void 0 : h2.position) === QuestionPosition.LBAR;
6745
- return n2 && e2.data === void 0 && ((k2 = o2 == null ? void 0 : o2.attributes) == null ? void 0 : k2.adUnit) === AdUnit.STANDART && K2 && ((B2 = (T2 = (E2 = o2 == null ? void 0 : o2.attributes) == null ? void 0 : E2.adPromotion) == null ? void 0 : T2.banner) != null && B2.imageUrl) ? /* @__PURE__ */ jsx(D$6, {
6744
+ }), K2 = ((k2 = (O2 = f2 == null ? void 0 : f2.data) == null ? void 0 : O2.appearance) == null ? void 0 : k2.position) === QuestionPosition.LBAR;
6745
+ return n2 && e2.data === void 0 && ((E2 = o2 == null ? void 0 : o2.attributes) == null ? void 0 : E2.adUnit) === AdUnit.STANDART && K2 && ((B2 = (h2 = (T2 = o2 == null ? void 0 : o2.attributes) == null ? void 0 : T2.adPromotion) == null ? void 0 : h2.banner) != null && B2.imageUrl) ? /* @__PURE__ */ jsx(D$6, {
6746
6746
  ref: m2,
6747
- style: {
6748
- height: "100%"
6749
- },
6750
6747
  className: cx_default("SL-AdvertisementWebOs", "SL-AdvertisementWebOs--banner"),
6751
6748
  children: /* @__PURE__ */ jsx(a$u, {
6752
6749
  cardId: o2.id,
@@ -6759,7 +6756,7 @@ const D$6 = /* @__PURE__ */ styled_default("div")({
6759
6756
  }) : e2.data === void 0 || !c2 && e2.isViewed ? null : /* @__PURE__ */ jsxs(D$6, {
6760
6757
  ref: m2,
6761
6758
  style: {
6762
- height: d2 || n2 ? "100%" : "auto"
6759
+ height: d2 ? "100%" : n2 ? void 0 : "auto"
6763
6760
  },
6764
6761
  className: cx_default("SL-AdvertisementWebOs", !d2 && !n2 && !i2 && "SL-AdvertisementWebOs--overlay", d2 && "SL-AdvertisementWebOs--sidebar", n2 && "SL-AdvertisementWebOs--banner", i2 && "SL-AdvertisementWebOs--notification"),
6765
6762
  children: [!i2 && R2, /* @__PURE__ */ jsx(A$d, {
@@ -6886,7 +6883,7 @@ const W$3 = ({
6886
6883
  }
6887
6884
  ) : null), X$1 = ({ isClosing: l2, content: o2, externalPauseAdStore: r2, title: k2, caption: y3, onPlay: f2, onClose: a2, vastUrl: c2, options: A2, isDesktop: m2 }) => {
6888
6885
  var _a2;
6889
- const b2 = (_a2 = A2 == null ? void 0 : A2.showPauseButton) != null ? _a2 : true, { ref: s2, focusSelf: I2 } = useFocusable({
6886
+ const v2 = (_a2 = A2 == null ? void 0 : A2.showPauseButton) != null ? _a2 : true, { ref: s2, focusSelf: I2 } = useFocusable({
6890
6887
  focusKey: "sl-pause-ad-play",
6891
6888
  onEnterRelease: f2,
6892
6889
  isFocusBoundary: true,
@@ -6908,12 +6905,12 @@ const W$3 = ({
6908
6905
  }
6909
6906
  };
6910
6907
  return window.addEventListener("keydown", E2, { capture: true }), () => window.removeEventListener("keydown", E2, { capture: true });
6911
- }, [a2]), /* @__PURE__ */ jsx(e$d, { className: cx_default("SL_PauseAdOverlay", l2 && "pause-ad-closing"), children: /* @__PURE__ */ jsxs(t$l, { children: [
6908
+ }, [a2]), /* @__PURE__ */ jsx(e$d, { className: cx_default("SL_PauseAd", l2 && "pause-ad-closing"), children: /* @__PURE__ */ jsxs(t$l, { children: [
6912
6909
  /* @__PURE__ */ jsxs(p$i, { children: [
6913
6910
  /* @__PURE__ */ jsx(o$9, { children: k2 }),
6914
6911
  /* @__PURE__ */ jsx(n$8, { children: y3 })
6915
6912
  ] }),
6916
- b2 && /* @__PURE__ */ jsx(d$c, { children: /* @__PURE__ */ jsx(
6913
+ v2 && /* @__PURE__ */ jsx(d$c, { children: /* @__PURE__ */ jsx(
6917
6914
  l$i,
6918
6915
  {
6919
6916
  ref: s2,
@@ -6929,12 +6926,12 @@ const W$3 = ({
6929
6926
  ] }) });
6930
6927
  }, se$1 = ({ showPauseAd: l2, vastUrls: o2, title: r2, caption: k2, sdk: y3, onClose: f2, onRender: a2, options: c2, isDesktop: A2 }) => {
6931
6928
  var _a2, _b;
6932
- const m2 = (_a2 = c2 == null ? void 0 : c2.pauseAdDelay) != null ? _a2 : 0, b2 = (_b = c2 == null ? void 0 : c2.pauseAdRefetchInterval) != null ? _b : 1e3 * 60 * 50, [s2, I2] = useState$1(false), [E2, d2] = useState$1(false), t6 = useRef(), p2 = o2 == null ? void 0 : o2[0].url, P2 = useRef(p2), S2 = useRef(""), T2 = useRef("");
6929
+ const m2 = (_a2 = c2 == null ? void 0 : c2.pauseAdDelay) != null ? _a2 : 0, v2 = (_b = c2 == null ? void 0 : c2.pauseAdRefetchInterval) != null ? _b : 1e3 * 60 * 50, [s2, I2] = useState$1(false), [E2, d2] = useState$1(false), t6 = useRef(), p2 = o2 == null ? void 0 : o2[0].url, P2 = useRef(p2), S2 = useRef(""), T2 = useRef("");
6933
6930
  P2.current = p2;
6934
6931
  const [i2, D2] = y3.advertisement.getExternalPauseAd(p2, {
6935
- refetchInterval: b2,
6932
+ refetchInterval: v2,
6936
6933
  $enabled: m2 === 0 || !!l2,
6937
- prefetch: m2 === 0 && b2 > 0
6934
+ prefetch: m2 === 0 && v2 > 0
6938
6935
  }), x2 = useStore(i2), g2 = useCallback(() => {
6939
6936
  if (f2) {
6940
6937
  T2.current = P2.current;
@@ -6947,7 +6944,7 @@ const W$3 = ({
6947
6944
  } : {}
6948
6945
  }), f2();
6949
6946
  }
6950
- }, [f2, i2]), R2 = useCallback(() => {
6947
+ }, [f2, i2]), j2 = useCallback(() => {
6951
6948
  y3.controlVideoPlayer({ play: true });
6952
6949
  }, [y3]);
6953
6950
  return useEffect$1(() => {
@@ -7001,7 +6998,7 @@ const W$3 = ({
7001
6998
  isClosing: E2,
7002
6999
  title: r2,
7003
7000
  caption: k2,
7004
- onPlay: R2,
7001
+ onPlay: j2,
7005
7002
  vastUrl: p2,
7006
7003
  options: c2,
7007
7004
  isDesktop: A2,
@@ -20191,18 +20188,27 @@ const StreamLayerSDKTvContentPure = ({ persistent, notification, banner, sdk })
20191
20188
  return null;
20192
20189
  }
20193
20190
  if (banner) {
20194
- return /* @__PURE__ */ jsx(ve, { sdk, persistent, banner: "bottom" });
20191
+ if (uiState.promotionBanner || uiState.appBanner) {
20192
+ return /* @__PURE__ */ jsx(ve, { sdk, persistent, banner: "bottom" });
20193
+ }
20194
+ return null;
20195
20195
  }
20196
20196
  if (notification) {
20197
- if (!!uiState.promotionNotification) {
20198
- return /* @__PURE__ */ jsx(ve, { sdk, notification: true, persistent, sidebar: "right" });
20197
+ if (uiState.promotionNotification) {
20198
+ return /* @__PURE__ */ jsx(ve, { sdk, notification: true, persistent });
20199
20199
  }
20200
- return /* @__PURE__ */ jsx(Z, { sdk, notification: true, persistent });
20200
+ if (uiState.onboardingNotification || uiState.appNotification) {
20201
+ return /* @__PURE__ */ jsx(Z, { sdk, notification: true, persistent });
20202
+ }
20203
+ return null;
20201
20204
  }
20202
- if (!!uiState.promotionSidebar) {
20205
+ if (uiState.promotionSidebar) {
20203
20206
  return /* @__PURE__ */ jsx(ve, { sdk, persistent, sidebar: "right" });
20204
20207
  }
20205
- return /* @__PURE__ */ jsx(Z, { sdk, persistent });
20208
+ if (uiState.app || uiState.appSidebar) {
20209
+ return /* @__PURE__ */ jsx(Z, { sdk, persistent });
20210
+ }
20211
+ return null;
20206
20212
  };
20207
20213
  const StreamLayerSDKTvContent = (props) => {
20208
20214
  const sdk = B();
@@ -20210,23 +20216,21 @@ const StreamLayerSDKTvContent = (props) => {
20210
20216
  if (!sdk) {
20211
20217
  return null;
20212
20218
  }
20213
- return /* @__PURE__ */ jsx("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ jsx(h$9, { customTheme: baseTheme.theme, themeMode: baseTheme.themeMode, children: /* @__PURE__ */ jsx(StreamLayerSDKTvContentPure, { sdk, ...props }) }) });
20219
+ return /* @__PURE__ */ jsx("div", { className: "StreamLayerSDK StreamLayerSDKTvContent", children: /* @__PURE__ */ jsx(h$9, { customTheme: baseTheme.theme, themeMode: baseTheme.themeMode, children: /* @__PURE__ */ jsx(StreamLayerSDKTvContentPure, { sdk, ...props }) }) });
20214
20220
  };
20215
- const StreamLayerSDKTvPauseAd = (props) => {
20221
+ const StreamLayerSDKTvPauseAd = ({
20222
+ videoPlayerController,
20223
+ ...props
20224
+ }) => {
20216
20225
  const sdk = B();
20217
20226
  const baseTheme = z();
20218
20227
  if (!sdk) {
20219
20228
  return null;
20220
20229
  }
20221
- return /* @__PURE__ */ jsx("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ jsx(
20222
- h$9,
20223
- {
20224
- style: { position: "relative" },
20225
- customTheme: baseTheme.theme,
20226
- themeMode: baseTheme.themeMode,
20227
- children: /* @__PURE__ */ jsx(se$1, { ...props, sdk, isDesktop: false })
20228
- }
20229
- ) });
20230
+ return /* @__PURE__ */ jsxs("div", { className: "StreamLayerSDK StreamLayerSDKTvPauseAd", children: [
20231
+ /* @__PURE__ */ jsx(h$9, { customTheme: baseTheme.theme, themeMode: baseTheme.themeMode, children: /* @__PURE__ */ jsx(se$1, { ...props, sdk, isDesktop: false }) }),
20232
+ videoPlayerController && /* @__PURE__ */ jsx(RegisterVideoPlayerController, { videoPlayerController })
20233
+ ] });
20230
20234
  };
20231
20235
  const StreamLayerSDKTv = ({
20232
20236
  persistent,
@@ -20257,7 +20261,7 @@ const StreamLayerSDKTv = ({
20257
20261
  if (!sdk) {
20258
20262
  return null;
20259
20263
  }
20260
- return /* @__PURE__ */ jsx("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ jsxs(h$9, { customTheme: baseTheme.theme, themeMode: baseTheme.themeMode, children: [
20264
+ return /* @__PURE__ */ jsx("div", { className: "StreamLayerSDK StreamLayerSDKTv", children: /* @__PURE__ */ jsxs(h$9, { customTheme: baseTheme.theme, themeMode: baseTheme.themeMode, children: [
20261
20265
  /* @__PURE__ */ jsx(
20262
20266
  W$1,
20263
20267
  {
@@ -25,5 +25,7 @@ export declare const StreamLayerSDKTvContent: React.FC<{
25
25
  notification?: boolean;
26
26
  banner?: boolean;
27
27
  }>;
28
- export declare const StreamLayerSDKTvPauseAd: React.FC<PauseAdProps>;
28
+ export declare const StreamLayerSDKTvPauseAd: React.FC<PauseAdProps & {
29
+ videoPlayerController: VideoPlayerCallback;
30
+ }>;
29
31
  export declare const StreamLayerSDKTv: React.FC<StreamLayerSDKTvProps>;