@streamlayer/react-ui 1.26.1 → 1.27.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.
- package/lib/app/app/Advertisement/index.d.ts +1 -0
- package/lib/app/app/Advertisement/index.js +125 -92
- package/lib/app/app/Banner/index.d.ts +6 -0
- package/lib/app/app/Banner/index.js +6 -0
- package/lib/app/app/Features/Gamification/Question.d.ts +4 -0
- package/lib/app/app/Features/Gamification/Question.js +79 -50
- package/lib/app/app/Features/Gamification/QuestionAdvertisement.d.ts +6 -0
- package/lib/app/app/Features/Gamification/QuestionAdvertisement.js +46 -0
- package/lib/app/app/Features/Gamification/Tabs.js +12 -12
- package/lib/app/app/Features/Gamification/index.d.ts +3 -0
- package/lib/app/app/Features/Gamification/index.js +56 -52
- package/lib/app/app/Features/index.d.ts +1 -0
- package/lib/app/app/Features/index.js +6 -4
- package/lib/app/app/InApp/index.d.ts +1 -0
- package/lib/app/app/InApp/index.js +44 -17
- package/lib/app/app/Insight/index.d.ts +3 -0
- package/lib/app/app/Insight/index.js +33 -30
- package/lib/app/app/Layout/index.d.ts +17 -0
- package/lib/app/app/Layout/index.js +105 -0
- package/lib/app/app/Layout/styles.d.ts +12 -0
- package/lib/app/app/Layout/styles.js +64 -0
- package/lib/app/app/Notifications/Onboarding/Notification/styles.d.ts +7 -1
- package/lib/app/app/Notifications/styles.d.ts +18 -2
- package/lib/app/app/index.d.ts +1 -0
- package/lib/app/app/index.js +91 -85
- package/lib/app/app/story/index.js +56 -58
- package/lib/app/app/story/promotion/index.js +31 -36
- package/lib/app/app/story/promotion/styles.d.ts +3 -1
- package/lib/app/app/story/promotion/video.js +63 -81
- package/lib/app/app/story/promotion-notification/styles.d.ts +3 -1
- package/lib/app/app/story/styles.d.ts +5 -1
- package/lib/app/app/story/styles.js +36 -16
- package/lib/app/app/story/video.d.ts +5 -1
- package/lib/app/app/story/video.js +70 -33
- package/lib/app/app/useApp.d.ts +1 -2
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/styles.d.ts +7 -1
- package/lib/app/masters/BetPack/BetPackContent/index.js +175 -187
- package/lib/app/masters/BetPack/BetPackContent/styles.d.ts +84 -84
- package/lib/app/masters/BetPack/BetPackOverlay/styles.d.ts +14 -2
- package/lib/app/masters/Features/Gamification/Question.js +19 -17
- package/lib/app/masters/Notifications/Onboarding/Notification/styles.d.ts +7 -1
- package/lib/app/masters/Notifications/styles.d.ts +18 -2
- package/lib/app/masters/masters.d.ts +4 -1
- package/lib/app/masters/useMastersApp.d.ts +1 -1
- package/lib/app/tgl/styles.d.ts +3 -1
- package/lib/app/{tvos → webos/Advertisement}/AdvertisementUI.d.ts +7 -1
- package/lib/app/webos/Advertisement/AdvertisementUI.js +63 -0
- package/lib/app/{tvos/Advertisement.d.ts → webos/Advertisement/index.d.ts} +3 -1
- package/lib/app/webos/Advertisement/index.js +119 -0
- package/lib/app/webos/ExposedPauseAd/PauseAd.d.ts +15 -0
- package/lib/app/webos/ExposedPauseAd/PauseAd.js +93 -0
- package/lib/app/webos/ExposedPauseAd/styles.d.ts +12 -0
- package/lib/app/webos/ExposedPauseAd/styles.js +64 -0
- package/lib/app/webos/Question/index.d.ts +9 -0
- package/lib/app/webos/Question/index.js +56 -0
- package/lib/app/webos/index.d.ts +24 -0
- package/lib/app/webos/index.js +65 -0
- package/lib/app/webos/story.d.ts +9 -0
- package/lib/app/webos/story.js +74 -0
- package/lib/app/webos/styles.js +4 -0
- package/lib/app/webos/ui/Layout/index.js +78 -0
- package/lib/app/{tvos → webos}/ui/Layout/styles.js +25 -25
- package/lib/app/webos/ui/Sidebar/PromoAction.d.ts +7 -0
- package/lib/app/webos/ui/Sidebar/PromoAction.js +63 -0
- package/lib/app/{tvos → webos}/ui/Sidebar/index.d.ts +6 -0
- package/lib/app/webos/ui/Sidebar/index.js +176 -0
- package/lib/app/{tvos → webos}/ui/Sidebar/styles.d.ts +7 -3
- package/lib/app/{tvos → webos}/ui/Sidebar/styles.js +175 -170
- package/lib/app/webos/ui/insight/index.d.ts +9 -0
- package/lib/app/webos/ui/insight/index.js +100 -0
- package/lib/app/webos/ui/insight/styles.d.ts +12 -0
- package/lib/app/webos/ui/insight/styles.js +51 -0
- package/lib/app/webos/useTvButton.d.ts +9 -0
- package/lib/app/webos/useTvButton.js +23 -0
- package/lib/assets/style.css +1 -1
- package/lib/hooks/analytics.d.ts +14 -0
- package/lib/hooks/showIn.d.ts +9 -0
- package/lib/hooks/useKeyboardNavigation.d.ts +15 -0
- package/lib/hooks/useKeyboardNavigation.js +74 -0
- package/lib/index-T1iiS0ZO.js +17 -0
- package/lib/ui/advertisement/banner/index.d.ts +3 -0
- package/lib/ui/advertisement/banner/index.js +29 -17
- package/lib/ui/advertisement/banner/styles.d.ts +5 -1
- package/lib/ui/advertisement/index.d.ts +4 -1
- package/lib/ui/advertisement/index.js +56 -44
- package/lib/ui/advertisement/notification/index.d.ts +2 -0
- package/lib/ui/advertisement/notification/index.js +50 -34
- package/lib/ui/advertisement/notification/lower-third/index.d.ts +2 -0
- package/lib/ui/advertisement/notification/lower-third/index.js +42 -26
- package/lib/ui/advertisement/notification/lower-third/styles.d.ts +11 -0
- package/lib/ui/advertisement/notification/lower-third/styles.js +39 -24
- package/lib/ui/advertisement/notification/styles.d.ts +18 -1
- package/lib/ui/advertisement/notification/styles.js +48 -33
- package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMPlayer.d.ts +2 -2
- package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMPlayer.js +1 -1
- package/lib/ui/advertisement/overlay/index.d.ts +4 -1
- package/lib/ui/advertisement/overlay/index.js +135 -77
- package/lib/ui/gamification/detail/header/index.d.ts +2 -0
- package/lib/ui/gamification/detail/header/index.js +19 -16
- package/lib/ui/gamification/detail/header/styles.d.ts +15 -3
- package/lib/ui/gamification/detail/header/styles.js +1 -1
- package/lib/ui/gamification/detail/sponsor/index.d.ts +1 -0
- package/lib/ui/gamification/detail/sponsor/index.js +25 -13
- package/lib/ui/gamification/invite-link/styles.d.ts +14 -2
- package/lib/ui/gamification/leaderboard/list-item/styles.d.ts +7 -1
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/styles.d.ts +14 -2
- package/lib/ui/gamification/onboarding/styles.d.ts +10 -2
- package/lib/ui/gamification/points/styles.d.ts +7 -1
- package/lib/ui/gamification/question/inapp/notification/AdNotification/NotificationMedia/index.d.ts +48 -0
- package/lib/ui/gamification/question/inapp/notification/AdNotification/NotificationMedia/index.js +94 -0
- package/lib/ui/gamification/question/inapp/notification/AdNotification/index.d.ts +9 -0
- package/lib/ui/gamification/question/inapp/notification/AdNotification/index.js +99 -0
- package/lib/ui/gamification/question/inapp/notification/AdNotification/styles.d.ts +42 -0
- package/lib/ui/gamification/question/inapp/notification/AdNotification/styles.js +117 -0
- package/lib/ui/gamification/question/inapp/notification/NotificationMedia/index.js +9 -8
- package/lib/ui/gamification/question/inapp/notification/styles.d.ts +7 -1
- package/lib/ui/gamification/question/inapp/onboarding/index.js +12 -12
- package/lib/ui/gamification/question/inapp/onboarding/styles.d.ts +18 -2
- package/lib/ui/gamification/question/inapp/prediction-result/frames/content.js +9 -9
- package/lib/ui/gamification/question/inapp/prediction-result/frames/styles.d.ts +7 -1
- package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/content.d.ts +5 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/content.js +49 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/index.d.ts +12 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/index.js +56 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/lines.d.ts +1 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/lines.js +34 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/step1.d.ts +1 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/step1.js +19 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/step2.d.ts +4 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/step2.js +34 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/step3.d.ts +7 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/step3.js +43 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/styles.d.ts +9 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/styles.js +20 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/index.d.ts +10 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/index.js +20 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/styles.d.ts +11 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/styles.js +34 -0
- package/lib/ui/gamification/question/notification/prediction-result/styles.d.ts +38 -5
- package/lib/ui/gamification/question/notification/styles.d.ts +14 -2
- package/lib/ui/gamification/question/styles.d.ts +26 -4
- package/lib/ui/gamification/vote/alert/styles.d.ts +7 -1
- package/lib/ui/gamification/vote/feedback/styles.d.ts +19 -2
- package/lib/ui/gamification/vote/feedbackAlert/index.d.ts +9 -0
- package/lib/ui/gamification/vote/feedbackAlert/index.js +11 -0
- package/lib/ui/gamification/vote/feedbackAlert/styles.d.ts +11 -0
- package/lib/ui/gamification/vote/feedbackAlert/styles.js +30 -0
- package/lib/ui/gamification/vote/index.d.ts +3 -1
- package/lib/ui/gamification/vote/index.js +160 -130
- package/lib/ui/gamification/vote/insight-details/index.js +8 -7
- package/lib/ui/gamification/vote/insight-details/styles.d.ts +7 -1
- package/lib/ui/gamification/vote/styles.d.ts +29 -4
- package/lib/ui/gamification/vote/vote-option/index.d.ts +3 -0
- package/lib/ui/gamification/vote/vote-option/index.js +72 -64
- package/lib/ui/gamification/vote/vote-option/styles.d.ts +7 -1
- package/lib/ui/gamification/vote/win-bar/styles.d.ts +19 -2
- package/lib/ui/icons/index.d.ts +1 -0
- package/lib/ui/icons/index.js +80 -79
- package/lib/ui/modal/index.js +12 -17
- package/lib/ui/questions/insight/index.d.ts +4 -1
- package/lib/ui/questions/insight/index.js +29 -26
- package/lib/ui/questions/twitter/account/styles.d.ts +7 -1
- package/lib/ui/questions/twitter/index.d.ts +1 -0
- package/lib/ui/questions/twitter/index.js +27 -19
- package/lib/ui/theme/constants.d.ts +2 -0
- package/lib/ui/theme/constants.js +2 -0
- package/lib/ui/theme/masters-theme.js +1 -0
- package/lib/ui/theme/utils.d.ts +10 -0
- package/lib/ui/theme/utils.js +77 -0
- package/lib/ui/video-player/index.d.ts +10 -2
- package/lib/ui/video-player/index.js +189 -110
- package/lib/ui/video-player/styles.d.ts +36 -0
- package/lib/ui/video-player/styles.js +59 -11
- package/lib/utils/common.d.ts +6 -0
- package/lib/utils/createDemo.d.ts +12 -0
- package/lib/utils/debug/components/bypassLogin.d.ts +6 -0
- package/lib/utils/debug/components/copyLogs.d.ts +1 -0
- package/lib/utils/debug/components/developer.d.ts +14 -0
- package/lib/utils/debug/components/envToggle.d.ts +6 -0
- package/lib/utils/debug/components/eventInput.d.ts +8 -0
- package/lib/utils/debug/components/sdkKey.d.ts +6 -0
- package/lib/utils/debug/components/styles.d.ts +1 -0
- package/lib/utils/debug/index.d.ts +36 -0
- package/lib/utils/debug/storage.d.ts +14 -0
- package/lib/utils/decorators/container.d.ts +6 -0
- package/lib/utils/decorators/container.js +5 -5
- package/lib/utils/decorators/masters.d.ts +2 -0
- package/lib/utils/decorators/styles.d.ts +2 -0
- package/lib/utils/login.d.ts +3 -0
- package/lib/utils/storage.d.ts +14 -0
- package/package.json +27 -20
- package/lib/app/tvos/Advertisement.js +0 -88
- package/lib/app/tvos/AdvertisementUI.js +0 -40
- package/lib/app/tvos/index.d.ts +0 -16
- package/lib/app/tvos/index.js +0 -23
- package/lib/app/tvos/story.d.ts +0 -6
- package/lib/app/tvos/story.js +0 -34
- package/lib/app/tvos/styles.js +0 -4
- package/lib/app/tvos/ui/Layout/index.js +0 -76
- package/lib/app/tvos/ui/Sidebar/PromoAction.d.ts +0 -2
- package/lib/app/tvos/ui/Sidebar/PromoAction.js +0 -62
- package/lib/app/tvos/ui/Sidebar/index.js +0 -114
- /package/lib/app/{tvos → webos}/styles.d.ts +0 -0
- /package/lib/app/{tvos → webos}/ui/Layout/index.d.ts +0 -0
- /package/lib/app/{tvos → webos}/ui/Layout/styles.d.ts +0 -0
|
@@ -10,6 +10,7 @@ export type StreamLayerSDKAdvertisementProps = {
|
|
|
10
10
|
layoutMode?: 'cover' | 'side-by-side';
|
|
11
11
|
skipAutoClose?: boolean;
|
|
12
12
|
externalAd?: boolean;
|
|
13
|
+
muted?: boolean;
|
|
13
14
|
};
|
|
14
15
|
export declare const StreamLayerSDKAdvertisement: React.FC<StreamLayerSDKAdvertisementProps & {
|
|
15
16
|
sdk: StreamLayerSDK;
|
|
@@ -1,133 +1,166 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { cx as
|
|
3
|
-
import { styled as
|
|
4
|
-
import { useAnalyticsListener as
|
|
5
|
-
import { useState as
|
|
6
|
-
import { useStore as
|
|
7
|
-
import { eventBus as
|
|
8
|
-
import { FeatureType as
|
|
9
|
-
import {
|
|
10
|
-
|
|
1
|
+
import { jsx as n, jsxs as z } from "react/jsx-runtime";
|
|
2
|
+
import { cx as K } from "@linaria/core";
|
|
3
|
+
import { styled as J } from "@linaria/react";
|
|
4
|
+
import { useAnalyticsListener as X } from "../../../hooks/analytics.js";
|
|
5
|
+
import { useState as Y, useEffect as Z, useRef as Q } from "react";
|
|
6
|
+
import { useStore as u } from "@streamlayer/react-polyfills";
|
|
7
|
+
import { eventBus as q } from "@streamlayer/sdk-web-interfaces";
|
|
8
|
+
import { FeatureType as tt, AdUnit as et, NotificationPromotionMode as rt, PromotionType as ot } from "@streamlayer/sdk-web-types";
|
|
9
|
+
import { StreamLayerSDKBannerProvider as at } from "../Banner/index.js";
|
|
10
|
+
import { AdvertisementUI as it } from "../../../ui/advertisement/index.js";
|
|
11
|
+
import { useAdvertisementBackground as nt } from "../../../ui/theme/utils.js";
|
|
12
|
+
const H = /* @__PURE__ */ J("div")({
|
|
11
13
|
name: "AdvertisementUIWrap",
|
|
12
14
|
class: "aa6pjif",
|
|
13
15
|
propsAsIs: !1
|
|
14
|
-
}),
|
|
15
|
-
const
|
|
16
|
-
if (
|
|
17
|
-
const
|
|
18
|
-
|
|
16
|
+
}), st = (a) => {
|
|
17
|
+
const r = a.target;
|
|
18
|
+
if (r instanceof HTMLAnchorElement && r.target === "_blank") {
|
|
19
|
+
const o = r.getAttribute("data-promo-id") || "", i = r.getAttribute("data-promo-type") || ot.UNSET;
|
|
20
|
+
r.getAttribute("data-a") === "button" && q.emit("advertisement", {
|
|
19
21
|
action: "buttonSelect",
|
|
20
22
|
payload: {
|
|
21
|
-
id:
|
|
23
|
+
id: o,
|
|
22
24
|
type: i
|
|
23
25
|
}
|
|
24
|
-
}),
|
|
26
|
+
}), r.getAttribute("data-a") === "banner" && q.emit("advertisement", {
|
|
25
27
|
action: "bannerSelect",
|
|
26
28
|
payload: {
|
|
27
|
-
id:
|
|
29
|
+
id: o,
|
|
28
30
|
type: i
|
|
29
31
|
}
|
|
30
32
|
});
|
|
31
33
|
}
|
|
32
|
-
},
|
|
33
|
-
gamification:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
}, dt = ({
|
|
35
|
+
gamification: a,
|
|
36
|
+
advertisement: r,
|
|
37
|
+
layoutMode: o,
|
|
38
|
+
skipAutoClose: i,
|
|
39
|
+
skipTypeCheck: p,
|
|
40
|
+
sidebar: m,
|
|
41
|
+
banner: s,
|
|
42
|
+
notification: l,
|
|
43
|
+
isMobileScreen: c,
|
|
44
|
+
persistent: f,
|
|
45
|
+
containerId: v,
|
|
46
|
+
externalAd: g,
|
|
47
|
+
controlVideo: y,
|
|
48
|
+
muted: b
|
|
44
49
|
}) => {
|
|
45
|
-
var
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
enabled: !!
|
|
50
|
+
var A, U, S, h, I, L, P, E, k, w, T, N, W, D, V, j, x, B, F, M, R;
|
|
51
|
+
const d = Q(null), t = u(r.$store), e = u(a.openedQuestion.$store);
|
|
52
|
+
X(d, {
|
|
53
|
+
enabled: !!t.data,
|
|
49
54
|
event: "click",
|
|
50
|
-
listener:
|
|
55
|
+
listener: st
|
|
51
56
|
});
|
|
52
|
-
const
|
|
53
|
-
|
|
57
|
+
const O = ((S = (U = (A = t.data) == null ? void 0 : A.question) == null ? void 0 : U.backgroundImage) == null ? void 0 : S.landscapeUrl) || ((I = (h = t.data) == null ? void 0 : h.promotion) == null ? void 0 : I.backgroundImageLandscapeUrl), _ = ((E = (P = (L = t.data) == null ? void 0 : L.question) == null ? void 0 : P.backgroundImage) == null ? void 0 : E.portraitUrl) || ((w = (k = t.data) == null ? void 0 : k.promotion) == null ? void 0 : w.backgroundImagePortraitUrl), $ = nt({
|
|
58
|
+
containerId: v,
|
|
59
|
+
landscapeUrl: O,
|
|
60
|
+
portraitUrl: _
|
|
61
|
+
});
|
|
62
|
+
if (((T = e == null ? void 0 : e.attributes) == null ? void 0 : T.adUnit) === et.STANDART && ((D = (W = (N = e == null ? void 0 : e.attributes) == null ? void 0 : N.adPromotion) == null ? void 0 : W.banner) != null && D.imageUrl))
|
|
63
|
+
return s ? /* @__PURE__ */ n(H, {
|
|
64
|
+
ref: d,
|
|
65
|
+
style: {
|
|
66
|
+
height: "100%"
|
|
67
|
+
},
|
|
68
|
+
className: K("SL-AdvertisementUIWrap", c && "mobile-view"),
|
|
69
|
+
children: /* @__PURE__ */ n(at, {
|
|
70
|
+
cardId: e.id,
|
|
71
|
+
promotion: {
|
|
72
|
+
...(V = e == null ? void 0 : e.attributes) == null ? void 0 : V.adPromotion,
|
|
73
|
+
adUnit: (j = e == null ? void 0 : e.attributes) == null ? void 0 : j.adUnit
|
|
74
|
+
}
|
|
75
|
+
})
|
|
76
|
+
}) : null;
|
|
77
|
+
const C = !s && !m;
|
|
78
|
+
if (t.data === void 0 || !f && t.isViewed)
|
|
54
79
|
return null;
|
|
55
|
-
const
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
-
ref:
|
|
80
|
+
const G = ((F = (B = (x = t == null ? void 0 : t.data) == null ? void 0 : x.notification) == null ? void 0 : B.promotion) == null ? void 0 : F.mode) === rt.LOWER_THIRD;
|
|
81
|
+
return /* @__PURE__ */ z(H, {
|
|
82
|
+
ref: d,
|
|
58
83
|
style: {
|
|
59
|
-
height:
|
|
84
|
+
height: C ? "auto" : "100%"
|
|
60
85
|
},
|
|
61
|
-
className:
|
|
62
|
-
children: /* @__PURE__ */
|
|
63
|
-
skipTypeCheck:
|
|
64
|
-
sidebar:
|
|
65
|
-
banner:
|
|
66
|
-
advertisement:
|
|
67
|
-
advertisementPaused:
|
|
68
|
-
togglePause:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
86
|
+
className: K("SL-AdvertisementUIWrap", c && "mobile-view", G && "SL-AdvertisementUIWrap--lower-third"),
|
|
87
|
+
children: [!l && $, /* @__PURE__ */ n(it, {
|
|
88
|
+
skipTypeCheck: p,
|
|
89
|
+
sidebar: m,
|
|
90
|
+
banner: s,
|
|
91
|
+
advertisement: t.data,
|
|
92
|
+
advertisementPaused: !!t.isPaused,
|
|
93
|
+
togglePause: t.togglePause,
|
|
94
|
+
isEventFired: t.isEventFired,
|
|
95
|
+
toggleMute: t.toggleMute,
|
|
96
|
+
fireEvent: t.fireEvent,
|
|
97
|
+
close: t.close,
|
|
98
|
+
externalAd: g ? t.externalAd : void 0,
|
|
99
|
+
markAsViewed: (M = a.advertisement) == null ? void 0 : M.markAsViewed,
|
|
100
|
+
open: (R = a.advertisement) == null ? void 0 : R.open,
|
|
101
|
+
layoutMode: o,
|
|
102
|
+
isNotification: l,
|
|
103
|
+
skipAutoClose: i,
|
|
104
|
+
controlVideo: y,
|
|
105
|
+
muted: b
|
|
106
|
+
})]
|
|
78
107
|
});
|
|
79
|
-
},
|
|
80
|
-
sdk:
|
|
81
|
-
sidebar:
|
|
82
|
-
externalAd:
|
|
108
|
+
}, Ut = ({
|
|
109
|
+
sdk: a,
|
|
110
|
+
sidebar: r,
|
|
111
|
+
externalAd: o,
|
|
83
112
|
banner: i,
|
|
84
|
-
skipAutoClose:
|
|
85
|
-
skipTypeCheck:
|
|
86
|
-
layoutMode:
|
|
87
|
-
isMobileScreen:
|
|
88
|
-
persistent:
|
|
89
|
-
notification: f
|
|
113
|
+
skipAutoClose: p,
|
|
114
|
+
skipTypeCheck: m,
|
|
115
|
+
layoutMode: s,
|
|
116
|
+
isMobileScreen: l,
|
|
117
|
+
persistent: c,
|
|
118
|
+
notification: f,
|
|
119
|
+
muted: v
|
|
90
120
|
}) => {
|
|
91
|
-
const
|
|
92
|
-
if (
|
|
93
|
-
if (
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
121
|
+
const g = u(a.featuresList.getStore()), [y, b] = Y(!o), d = u(a.options);
|
|
122
|
+
if (Z(() => {
|
|
123
|
+
if (o) {
|
|
124
|
+
const e = document.createElement("script");
|
|
125
|
+
e.async = !0, e.src = "https://imasdk.googleapis.com/pal/sdkloader/pal.js", document.body.appendChild(e), e.onload = () => {
|
|
126
|
+
b(!0);
|
|
97
127
|
};
|
|
98
128
|
}
|
|
99
|
-
}, [
|
|
100
|
-
return /* @__PURE__ */
|
|
129
|
+
}, [o]), r && i)
|
|
130
|
+
return /* @__PURE__ */ n("div", {
|
|
101
131
|
style: {
|
|
102
132
|
color: "red"
|
|
103
133
|
},
|
|
104
134
|
children: "define either sidebar or banner, not both."
|
|
105
135
|
});
|
|
106
|
-
if (i &&
|
|
107
|
-
return /* @__PURE__ */
|
|
136
|
+
if (i && o)
|
|
137
|
+
return /* @__PURE__ */ n("div", {
|
|
108
138
|
style: {
|
|
109
139
|
color: "red"
|
|
110
140
|
},
|
|
111
141
|
children: "externalAd is not supported with banner"
|
|
112
142
|
});
|
|
113
|
-
if (!
|
|
143
|
+
if (!g)
|
|
114
144
|
return null;
|
|
115
|
-
const
|
|
116
|
-
return !
|
|
117
|
-
gamification:
|
|
118
|
-
|
|
145
|
+
const t = a.getFeature(tt.GAMES);
|
|
146
|
+
return !t || o && !y ? null : /* @__PURE__ */ n(dt, {
|
|
147
|
+
gamification: t,
|
|
148
|
+
advertisement: t.advertisement,
|
|
149
|
+
sidebar: r,
|
|
119
150
|
banner: i,
|
|
120
|
-
layoutMode:
|
|
121
|
-
isMobileScreen:
|
|
122
|
-
persistent:
|
|
151
|
+
layoutMode: s,
|
|
152
|
+
isMobileScreen: l,
|
|
153
|
+
persistent: c,
|
|
123
154
|
notification: f,
|
|
124
|
-
skipTypeCheck:
|
|
125
|
-
skipAutoClose:
|
|
126
|
-
externalAd:
|
|
127
|
-
controlVideo:
|
|
155
|
+
skipTypeCheck: m,
|
|
156
|
+
skipAutoClose: p,
|
|
157
|
+
externalAd: o,
|
|
158
|
+
controlVideo: a.controlVideoPlayer,
|
|
159
|
+
containerId: d.containerId,
|
|
160
|
+
muted: v
|
|
128
161
|
});
|
|
129
162
|
};
|
|
130
163
|
export {
|
|
131
|
-
|
|
132
|
-
|
|
164
|
+
H as AdvertisementUIWrap,
|
|
165
|
+
Ut as StreamLayerSDKAdvertisement
|
|
133
166
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Banner as n } from "../../../ui/advertisement/banner/index.js";
|
|
3
|
+
const a = ({ cardId: r, promotion: o, direction: t = "bottom" }) => /* @__PURE__ */ e(n, { promotion: o, promotionId: r, direction: t, hiding: !1 });
|
|
4
|
+
export {
|
|
5
|
+
a as StreamLayerSDKBannerProvider
|
|
6
|
+
};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { Gamification } from '@streamlayer/feature-gamification';
|
|
2
|
+
import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
2
3
|
export declare const Question: React.FC<{
|
|
3
4
|
gamification: Gamification;
|
|
5
|
+
sdk: StreamLayerSDK;
|
|
4
6
|
hideSponsor?: boolean;
|
|
5
7
|
className?: string;
|
|
6
8
|
skipAutoClose?: boolean;
|
|
7
9
|
hideHeader?: boolean;
|
|
10
|
+
muted?: boolean;
|
|
11
|
+
webos?: boolean;
|
|
8
12
|
}>;
|
|
@@ -1,75 +1,104 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { styled as
|
|
3
|
-
import { useAppContext as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
1
|
+
import { jsxs as E, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { styled as M } from "@linaria/react";
|
|
3
|
+
import { useAppContext as W } from "../../useAppContext.js";
|
|
4
|
+
import { useState as X } from "react";
|
|
5
|
+
import { useStore as u } from "@streamlayer/react-polyfills";
|
|
6
|
+
import { QuestionType as L, AdUnit as Y } from "@streamlayer/sdk-web-types";
|
|
7
|
+
import { VoteHeader as Z } from "../../../../ui/gamification/detail/header/index.js";
|
|
8
|
+
import { Sponsor as _ } from "../../../../ui/gamification/detail/sponsor/index.js";
|
|
9
|
+
import { Vote as k, VoteSkeleton as F } from "../../../../ui/gamification/vote/index.js";
|
|
10
|
+
import { InsightDetails as Q } from "../../../../ui/gamification/vote/insight-details/index.js";
|
|
11
|
+
import { TwitterDetails as tt } from "../../../../ui/gamification/vote/twitter-details/index.js";
|
|
12
|
+
import { useAdvertisementBackground as ot } from "../../../../ui/theme/utils.js";
|
|
13
|
+
import { QuestionAdvertisement as rt } from "./QuestionAdvertisement.js";
|
|
14
|
+
const N = /* @__PURE__ */ M("div")({
|
|
12
15
|
name: "QuestionContainer",
|
|
13
16
|
class: "q14ckf9e",
|
|
14
17
|
propsAsIs: !1
|
|
15
|
-
}),
|
|
16
|
-
openedQuestion: t
|
|
18
|
+
}), st = ({
|
|
19
|
+
openedQuestion: t,
|
|
20
|
+
muted: n,
|
|
21
|
+
webos: c
|
|
17
22
|
}) => {
|
|
18
|
-
var
|
|
23
|
+
var a, i;
|
|
19
24
|
const {
|
|
20
|
-
sdk:
|
|
21
|
-
} =
|
|
22
|
-
return ((
|
|
25
|
+
sdk: r
|
|
26
|
+
} = W();
|
|
27
|
+
return ((a = t == null ? void 0 : t.attributes) == null ? void 0 : a.attributes.case) === "insight" ? /* @__PURE__ */ e(Q, {
|
|
23
28
|
...t.attributes.attributes.value,
|
|
24
|
-
|
|
25
|
-
|
|
29
|
+
muted: n,
|
|
30
|
+
controlVideo: r == null ? void 0 : r.controlVideoPlayer,
|
|
31
|
+
webos: c
|
|
32
|
+
}) : ((i = t == null ? void 0 : t.attributes) == null ? void 0 : i.attributes.case) === "tweet" ? /* @__PURE__ */ e(tt, {
|
|
26
33
|
...t.attributes.attributes.value,
|
|
27
|
-
|
|
34
|
+
muted: n,
|
|
35
|
+
controlVideo: r == null ? void 0 : r.controlVideoPlayer
|
|
28
36
|
}) : null;
|
|
29
|
-
},
|
|
37
|
+
}, et = ({
|
|
30
38
|
extendedQuestion: t,
|
|
31
|
-
vote:
|
|
32
|
-
close:
|
|
39
|
+
vote: n,
|
|
40
|
+
close: c,
|
|
41
|
+
webos: r
|
|
33
42
|
}) => {
|
|
34
43
|
const {
|
|
35
|
-
loading:
|
|
44
|
+
loading: a,
|
|
36
45
|
data: i
|
|
37
46
|
} = t;
|
|
38
|
-
return i ? /* @__PURE__ */ e(
|
|
39
|
-
|
|
40
|
-
|
|
47
|
+
return i ? /* @__PURE__ */ e(k, {
|
|
48
|
+
webos: r,
|
|
49
|
+
vote: n,
|
|
50
|
+
close: c,
|
|
41
51
|
openedQuestion: i,
|
|
42
|
-
isLoading: !!
|
|
43
|
-
}) : /* @__PURE__ */ e(
|
|
44
|
-
},
|
|
52
|
+
isLoading: !!a
|
|
53
|
+
}) : /* @__PURE__ */ e(F, {});
|
|
54
|
+
}, Tt = ({
|
|
45
55
|
gamification: t,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
56
|
+
sdk: n,
|
|
57
|
+
muted: c,
|
|
58
|
+
skipAutoClose: r,
|
|
59
|
+
hideSponsor: a,
|
|
60
|
+
className: i,
|
|
61
|
+
hideHeader: O,
|
|
62
|
+
webos: d
|
|
50
63
|
}) => {
|
|
51
|
-
var
|
|
52
|
-
const
|
|
53
|
-
|
|
64
|
+
var A, S, T, v, b, y, U, V, x, D, g, q, C, w, j, H, I, P, $;
|
|
65
|
+
const s = u(t.openedQuestion.$store), o = u(t.openedQuestion.$extendedStore), [R, z] = X(!1), B = u(n.options), m = ((A = s == null ? void 0 : s.attributes) == null ? void 0 : A.type) === L.FACTOID, l = (S = s == null ? void 0 : s.attributes) == null ? void 0 : S.backgroundImage, p = (T = o.data) == null ? void 0 : T.backgroundImage, G = m ? l == null ? void 0 : l.landscapeUrl : p == null ? void 0 : p.landscapeUrl, J = m ? l == null ? void 0 : l.portraitUrl : p == null ? void 0 : p.portraitUrl, f = ot({
|
|
66
|
+
containerId: B.containerId,
|
|
67
|
+
landscapeUrl: G,
|
|
68
|
+
portraitUrl: J
|
|
69
|
+
});
|
|
70
|
+
if (!s)
|
|
54
71
|
return null;
|
|
55
|
-
const
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
-
className:
|
|
58
|
-
children: [
|
|
59
|
-
|
|
72
|
+
const h = s.type, K = ((b = (v = o.data) == null ? void 0 : v.options) == null ? void 0 : b.options.case) === "factoid" ? o.data.options.options.value.closeTimer : void 0;
|
|
73
|
+
return ((y = o.data) == null ? void 0 : y.adUnit) === Y.STANDART && !R ? /* @__PURE__ */ E(N, {
|
|
74
|
+
className: i,
|
|
75
|
+
children: [f, /* @__PURE__ */ e(rt, {
|
|
76
|
+
id: o.data.id,
|
|
77
|
+
hasBanner: !!((V = (U = o.data.promotion) == null ? void 0 : U.banner) != null && V.imageUrl),
|
|
78
|
+
setAdShowed: z,
|
|
79
|
+
sponsorLogo: ((g = (D = (x = o.data) == null ? void 0 : x.promotion) == null ? void 0 : D.sponsor) == null ? void 0 : g.logo) || ((C = (q = o.data) == null ? void 0 : q.sponsorship) == null ? void 0 : C.logo) || ""
|
|
80
|
+
})]
|
|
81
|
+
}) : /* @__PURE__ */ E(N, {
|
|
82
|
+
className: i,
|
|
83
|
+
children: [f, !O && /* @__PURE__ */ e(Z, {
|
|
84
|
+
closeTimer: r ? void 0 : K,
|
|
60
85
|
close: t.closeQuestion,
|
|
61
|
-
type: ((
|
|
62
|
-
|
|
86
|
+
type: ((w = s.attributes) == null ? void 0 : w.type) || L.UNSET,
|
|
87
|
+
webos: d
|
|
88
|
+
}), h === "question" && /* @__PURE__ */ e(et, {
|
|
89
|
+
webos: d,
|
|
63
90
|
vote: t.submitAnswer,
|
|
64
91
|
close: t.closeQuestion,
|
|
65
|
-
extendedQuestion:
|
|
66
|
-
}),
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
92
|
+
extendedQuestion: o
|
|
93
|
+
}), h !== "question" && /* @__PURE__ */ e(st, {
|
|
94
|
+
muted: c,
|
|
95
|
+
openedQuestion: s,
|
|
96
|
+
webos: d
|
|
97
|
+
}), !a && /* @__PURE__ */ e(_, {
|
|
98
|
+
sponsorLogo: ((I = (H = (j = o.data) == null ? void 0 : j.promotion) == null ? void 0 : H.sponsor) == null ? void 0 : I.logo) || (($ = (P = o.data) == null ? void 0 : P.sponsorship) == null ? void 0 : $.logo)
|
|
70
99
|
})]
|
|
71
100
|
});
|
|
72
101
|
};
|
|
73
102
|
export {
|
|
74
|
-
|
|
103
|
+
Tt as Question
|
|
75
104
|
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { styled as t } from "@linaria/react";
|
|
3
|
+
import { useRef as u, useEffect as a } from "react";
|
|
4
|
+
import { eventBus as c } from "@streamlayer/sdk-web-interfaces";
|
|
5
|
+
const d = /* @__PURE__ */ t("div")({
|
|
6
|
+
name: "QuestionAdvertisementContainer",
|
|
7
|
+
class: "qwludgs",
|
|
8
|
+
propsAsIs: !1
|
|
9
|
+
}), l = /* @__PURE__ */ t("div")({
|
|
10
|
+
name: "QuestionAdvertisementText",
|
|
11
|
+
class: "qvce6pv",
|
|
12
|
+
propsAsIs: !1
|
|
13
|
+
}), p = /* @__PURE__ */ t("div")({
|
|
14
|
+
name: "QuestionAdvertisementImage",
|
|
15
|
+
class: "qsid7hx",
|
|
16
|
+
propsAsIs: !1
|
|
17
|
+
}), x = ({
|
|
18
|
+
sponsorLogo: i,
|
|
19
|
+
id: s,
|
|
20
|
+
hasBanner: n,
|
|
21
|
+
setAdShowed: o
|
|
22
|
+
}) => {
|
|
23
|
+
const r = u();
|
|
24
|
+
return a(() => (r.current = setTimeout(() => {
|
|
25
|
+
o(!0), n && c.emit("poll", {
|
|
26
|
+
action: "bannerOpened",
|
|
27
|
+
payload: {
|
|
28
|
+
questionId: s
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}, 5e3), () => {
|
|
32
|
+
clearTimeout(r.current);
|
|
33
|
+
}), [o, s, n]), /* @__PURE__ */ m(d, {
|
|
34
|
+
children: [/* @__PURE__ */ e(l, {
|
|
35
|
+
children: "PRESENTED BY"
|
|
36
|
+
}), /* @__PURE__ */ e(p, {
|
|
37
|
+
children: /* @__PURE__ */ e("img", {
|
|
38
|
+
src: i,
|
|
39
|
+
alt: "ad-sponsor-logo"
|
|
40
|
+
})
|
|
41
|
+
})]
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
x as QuestionAdvertisement
|
|
46
|
+
};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as p, jsx as e, Fragment as D } from "react/jsx-runtime";
|
|
2
2
|
import { cx as C } from "@linaria/core";
|
|
3
3
|
import { TabsContainer as S, TabsNavContainer as E, SDKSummaryContainer as v, UserSummaryContainer as A, SDKContentContainer as I, LeaderboardContainer as L } from "../../styles.js";
|
|
4
4
|
import { scrollIntoAppView as P } from "../../../useSdkScroll.js";
|
|
5
|
-
import { useState as V, useEffect as
|
|
6
|
-
import { useStore as
|
|
5
|
+
import { useState as V, useEffect as f } from "react";
|
|
6
|
+
import { useStore as d, useTransition as K } from "@streamlayer/react-polyfills";
|
|
7
7
|
import { ActivePages as n, Tabs as F } from "../../../../ui/gamification/tabs/index.js";
|
|
8
8
|
import { Leaderboard as O } from "./Leaderboard.js";
|
|
9
9
|
import { QuestionsList as H } from "./QuestionsList.js";
|
|
10
10
|
import { UserSummary as M } from "./UserSummary.js";
|
|
11
|
-
const W = ({ gamification: s, className: w, scrollStore: t, scrollNode: y, appNode:
|
|
12
|
-
const { tabsShown: u } =
|
|
11
|
+
const W = ({ gamification: s, className: w, scrollStore: t, scrollNode: y, appNode: c, style: k, responsiveStore: i }) => {
|
|
12
|
+
const { tabsShown: u } = d(t, { keys: ["tabsShown"] }), o = d(s.friendsTabEnabled), [a, h] = V(n.HOME), [, T] = K(), { sdkInDesktopView: l, screen: g } = d(i, { keys: ["sdkInDesktopView"] }), x = (r) => {
|
|
13
13
|
T(() => {
|
|
14
|
-
var
|
|
15
|
-
|
|
14
|
+
var b;
|
|
15
|
+
h(r), l === !1 && (((b = c.current) == null ? void 0 : b.getBoundingClientRect().y) || 0) < 0 && P(c, g.size, { behavior: "instant" });
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
|
-
|
|
18
|
+
f(() => t.subscribe((r) => {
|
|
19
19
|
if (r.scrollPosition === 0) {
|
|
20
20
|
t.setKey("tabsShown", !0);
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
23
|
i.get().sdkInDesktopView ? t.setKey("tabsShown", r.scrollDirection === "backward") : t.setKey("tabsShown", r.scrollDirection === "forward");
|
|
24
|
-
}), [t, i]),
|
|
25
|
-
o ||
|
|
24
|
+
}), [t, i]), f(() => {
|
|
25
|
+
o || h(n.HOME);
|
|
26
26
|
}, [o]);
|
|
27
27
|
let m = "0px";
|
|
28
|
-
return
|
|
28
|
+
return l ? m = u ? "0px" : "calc(0px - var(--header-height))" : m = u ? "var(--header-height)" : "0px", /* @__PURE__ */ p(S, { className: C(w, "SL-Tabs", "sl-hide-on-modal"), style: k, children: [
|
|
29
29
|
o && /* @__PURE__ */ e(
|
|
30
30
|
E,
|
|
31
31
|
{
|
|
@@ -35,7 +35,7 @@ const W = ({ gamification: s, className: w, scrollStore: t, scrollNode: y, appNo
|
|
|
35
35
|
children: /* @__PURE__ */ e(F, { activePage: a, toggleActivePage: x })
|
|
36
36
|
}
|
|
37
37
|
),
|
|
38
|
-
a === n.HOME && /* @__PURE__ */
|
|
38
|
+
a === n.HOME && /* @__PURE__ */ p(D, { children: [
|
|
39
39
|
/* @__PURE__ */ e(v, { children: /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(M, { userSummary: s.userSummary }) }) }),
|
|
40
40
|
/* @__PURE__ */ e(I, { style: { flex: 1 }, children: /* @__PURE__ */ e(H, { openQuestion: s.openQuestion, store: s.feedList.getStore() }) })
|
|
41
41
|
] }),
|
|
@@ -2,6 +2,7 @@ import { AppNodeRef, ScrollNodeRef } from '../../..';
|
|
|
2
2
|
import { ResponsiveStore } from '../../../useSdkResponsive';
|
|
3
3
|
import { ScrollStore } from '../../../useSdkScroll';
|
|
4
4
|
import { Gamification as GamificationClass } from '@streamlayer/feature-gamification';
|
|
5
|
+
import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
5
6
|
export declare const GamificationOverlay: React.FC<{
|
|
6
7
|
gamification: GamificationClass;
|
|
7
8
|
className?: string;
|
|
@@ -16,7 +17,9 @@ export declare const GamificationOverlay: React.FC<{
|
|
|
16
17
|
*/
|
|
17
18
|
export declare const GamificationOverlayStandalone: React.FC<{
|
|
18
19
|
gamification: GamificationClass;
|
|
20
|
+
sdk: StreamLayerSDK;
|
|
19
21
|
className?: string;
|
|
20
22
|
responsiveStore: ResponsiveStore;
|
|
21
23
|
appNode: AppNodeRef;
|
|
24
|
+
muted?: boolean;
|
|
22
25
|
}>;
|