@streamlayer/react-ui 1.22.3 → 1.22.5
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/masters/BetPack/BetPackContent/EmergencyScreen/styles.js +1 -1
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.js +7 -7
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/styles.js +1 -1
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.d.ts +0 -1
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.js +3 -3
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.d.ts +4 -3
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.js +17 -18
- package/lib/app/masters/BetPack/BetPackContent/index.js +335 -87
- package/lib/app/masters/BetPack/BetPackContent/styles.d.ts +95 -3
- package/lib/app/masters/BetPack/BetPackContent/styles.js +11 -57
- package/lib/app/masters/Features/Gamification/index.d.ts +1 -0
- package/lib/app/masters/Features/Gamification/index.js +36 -30
- package/lib/app/masters/Features/index.d.ts +1 -0
- package/lib/app/masters/Features/index.js +13 -12
- package/lib/app/masters/Notifications/index.d.ts +1 -0
- package/lib/app/masters/Notifications/index.js +97 -94
- package/lib/app/masters/Points/index.js +16 -25
- package/lib/app/masters/masters.d.ts +1 -0
- package/lib/app/masters/masters.js +71 -60
- package/lib/app/masters/story/index.d.ts +0 -1
- package/lib/app/masters/story/index.js +25 -37
- package/lib/app/masters/styles.d.ts +1 -0
- package/lib/app/masters/styles.js +16 -15
- package/lib/app/masters/useSdkResponsive.js +20 -19
- package/lib/app/masters/useSdkScroll.d.ts +1 -1
- package/lib/app/masters/useSdkScroll.js +33 -33
- package/lib/assets/style.css +1 -1
- package/lib/styles-BfnMua4o.js +2841 -0
- package/lib/ui/advertisement/overlay/externalAd/index.js +49 -41
- package/lib/ui/advertisement/overlay/externalAd/styles.d.ts +11 -2
- package/lib/ui/advertisement/overlay/externalAd/styles.js +55 -38
- package/lib/ui/gamification/question/notification/prediction-result/index.js +43 -43
- package/lib/ui/modal/index.d.ts +1 -0
- package/lib/ui/modal/index.js +36 -31
- package/lib/ui/questions/insight/index.js +24 -16
- package/lib/ui/questions/insight/styles.d.ts +1 -0
- package/lib/ui/questions/insight/styles.js +14 -13
- package/lib/ui/theme/constants.d.ts +2 -0
- package/lib/ui/theme/constants.js +6 -4
- package/lib/ui/theme/masters-theme.js +7 -4
- package/lib/ui/theme/theme.js +3 -0
- package/lib/ui/video-player/index.d.ts +1 -0
- package/lib/ui/video-player/index.js +29 -28
- package/package.json +16 -17
- package/lib/app/masters/BetPack/BetPackContent/constants.d.ts +0 -13
- package/lib/app/masters/BetPack/BetPackContent/constants.js +0 -22
- package/lib/app/masters/BetPack/typings.d.js +0 -1
|
@@ -1,6 +1,98 @@
|
|
|
1
|
-
export declare const Carousel:
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export declare const Carousel: {
|
|
2
|
+
__wyw_meta: unknown;
|
|
3
|
+
} & import('react').FunctionComponent<import('react').RefAttributes<import('swiper/react').SwiperRef> & Omit<import('react').HTMLAttributes<HTMLElement>, "onClick" | "onProgress" | "onTouchEnd" | "onTouchMove" | "onTouchStart" | "onTransitionEnd" | "onKeyPress" | "onDoubleClick" | "onScroll" | "onResize"> & import('swiper/types').SwiperOptions & {
|
|
4
|
+
tag?: string;
|
|
5
|
+
wrapperTag?: string;
|
|
6
|
+
onSwiper?: (swiper: import('swiper/types').Swiper) => void;
|
|
7
|
+
onAutoplayStart?: (swiper: import('swiper/types').Swiper) => void;
|
|
8
|
+
onAutoplayStop?: (swiper: import('swiper/types').Swiper) => void;
|
|
9
|
+
onAutoplayPause?: (swiper: import('swiper/types').Swiper) => void;
|
|
10
|
+
onAutoplayResume?: (swiper: import('swiper/types').Swiper) => void;
|
|
11
|
+
onAutoplayTimeLeft?: (swiper: import('swiper/types').Swiper, timeLeft: number, percentage: number) => void;
|
|
12
|
+
onAutoplay?: (swiper: import('swiper/types').Swiper) => void;
|
|
13
|
+
onHashChange?: (swiper: import('swiper/types').Swiper) => void;
|
|
14
|
+
onHashSet?: (swiper: import('swiper/types').Swiper) => void;
|
|
15
|
+
onScroll?: (swiper: import('swiper/types').Swiper, event: WheelEvent) => void;
|
|
16
|
+
onKeyPress?: (swiper: import('swiper/types').Swiper, keyCode: string) => void;
|
|
17
|
+
onNavigationHide?: (swiper: import('swiper/types').Swiper) => void;
|
|
18
|
+
onNavigationShow?: (swiper: import('swiper/types').Swiper) => void;
|
|
19
|
+
onNavigationPrev?: (swiper: import('swiper/types').Swiper) => void;
|
|
20
|
+
onNavigationNext?: (swiper: import('swiper/types').Swiper) => void;
|
|
21
|
+
onPaginationRender?: (swiper: import('swiper/types').Swiper, paginationEl: HTMLElement) => void;
|
|
22
|
+
onPaginationUpdate?: (swiper: import('swiper/types').Swiper, paginationEl: HTMLElement) => void;
|
|
23
|
+
onPaginationHide?: (swiper: import('swiper/types').Swiper) => void;
|
|
24
|
+
onPaginationShow?: (swiper: import('swiper/types').Swiper) => void;
|
|
25
|
+
onScrollbarDragStart?: (swiper: import('swiper/types').Swiper, event: MouseEvent | TouchEvent | PointerEvent) => void;
|
|
26
|
+
onScrollbarDragMove?: (swiper: import('swiper/types').Swiper, event: MouseEvent | TouchEvent | PointerEvent) => void;
|
|
27
|
+
onScrollbarDragEnd?: (swiper: import('swiper/types').Swiper, event: MouseEvent | TouchEvent | PointerEvent) => void;
|
|
28
|
+
onZoomChange?: (swiper: import('swiper/types').Swiper, scale: number, imageEl: HTMLElement, slideEl: HTMLElement) => void;
|
|
29
|
+
onInit?: (swiper: import('swiper/types').Swiper) => any;
|
|
30
|
+
onBeforeDestroy?: (swiper: import('swiper/types').Swiper) => void;
|
|
31
|
+
onSlidesUpdated?: (swiper: import('swiper/types').Swiper) => void;
|
|
32
|
+
onSlideChange?: (swiper: import('swiper/types').Swiper) => void;
|
|
33
|
+
onSlideChangeTransitionStart?: (swiper: import('swiper/types').Swiper) => void;
|
|
34
|
+
onSlideChangeTransitionEnd?: (swiper: import('swiper/types').Swiper) => void;
|
|
35
|
+
onSlideNextTransitionStart?: (swiper: import('swiper/types').Swiper) => void;
|
|
36
|
+
onSlideNextTransitionEnd?: (swiper: import('swiper/types').Swiper) => void;
|
|
37
|
+
onSlidePrevTransitionStart?: (swiper: import('swiper/types').Swiper) => void;
|
|
38
|
+
onSlidePrevTransitionEnd?: (swiper: import('swiper/types').Swiper) => void;
|
|
39
|
+
onTransitionStart?: (swiper: import('swiper/types').Swiper) => void;
|
|
40
|
+
onTransitionEnd?: (swiper: import('swiper/types').Swiper) => void;
|
|
41
|
+
onTouchStart?: (swiper: import('swiper/types').Swiper, event: MouseEvent | TouchEvent | PointerEvent) => void;
|
|
42
|
+
onTouchMove?: (swiper: import('swiper/types').Swiper, event: MouseEvent | TouchEvent | PointerEvent) => void;
|
|
43
|
+
onTouchMoveOpposite?: (swiper: import('swiper/types').Swiper, event: MouseEvent | TouchEvent | PointerEvent) => void;
|
|
44
|
+
onSliderMove?: (swiper: import('swiper/types').Swiper, event: MouseEvent | TouchEvent | PointerEvent) => void;
|
|
45
|
+
onTouchEnd?: (swiper: import('swiper/types').Swiper, event: MouseEvent | TouchEvent | PointerEvent) => void;
|
|
46
|
+
onClick?: (swiper: import('swiper/types').Swiper, event: MouseEvent | TouchEvent | PointerEvent) => void;
|
|
47
|
+
onTap?: (swiper: import('swiper/types').Swiper, event: MouseEvent | TouchEvent | PointerEvent) => void;
|
|
48
|
+
onDoubleTap?: (swiper: import('swiper/types').Swiper, event: MouseEvent | TouchEvent | PointerEvent) => void;
|
|
49
|
+
onProgress?: (swiper: import('swiper/types').Swiper, progress: number) => void;
|
|
50
|
+
onReachBeginning?: (swiper: import('swiper/types').Swiper) => void;
|
|
51
|
+
onReachEnd?: (swiper: import('swiper/types').Swiper) => void;
|
|
52
|
+
onToEdge?: (swiper: import('swiper/types').Swiper) => void;
|
|
53
|
+
onFromEdge?: (swiper: import('swiper/types').Swiper) => void;
|
|
54
|
+
onSetTranslate?: (swiper: import('swiper/types').Swiper, translate: number) => void;
|
|
55
|
+
onSetTransition?: (swiper: import('swiper/types').Swiper, transition: number) => void;
|
|
56
|
+
onResize?: (swiper: import('swiper/types').Swiper) => void;
|
|
57
|
+
onObserverUpdate?: (swiper: import('swiper/types').Swiper) => void;
|
|
58
|
+
onBeforeLoopFix?: (swiper: import('swiper/types').Swiper) => void;
|
|
59
|
+
onLoopFix?: (swiper: import('swiper/types').Swiper) => void;
|
|
60
|
+
onBreakpoint?: (swiper: import('swiper/types').Swiper, breakpointParams: import('swiper/types').SwiperOptions) => void;
|
|
61
|
+
_beforeBreakpoint?: (swiper: import('swiper/types').Swiper, breakpointParams: import('swiper/types').SwiperOptions) => void;
|
|
62
|
+
_containerClasses?: (swiper: import('swiper/types').Swiper, classNames: string) => void;
|
|
63
|
+
_slideClass?: (swiper: import('swiper/types').Swiper, slideEl: HTMLElement, classNames: string) => void;
|
|
64
|
+
_slideClasses?: (swiper: import('swiper/types').Swiper, slides: {
|
|
65
|
+
slideEl: HTMLElement;
|
|
66
|
+
classNames: string;
|
|
67
|
+
index: number;
|
|
68
|
+
}[]) => void;
|
|
69
|
+
_swiper?: (swiper: import('swiper/types').Swiper) => void;
|
|
70
|
+
_freeModeNoMomentumRelease?: (swiper: import('swiper/types').Swiper) => void;
|
|
71
|
+
onActiveIndexChange?: (swiper: import('swiper/types').Swiper) => void;
|
|
72
|
+
onSnapIndexChange?: (swiper: import('swiper/types').Swiper) => void;
|
|
73
|
+
onRealIndexChange?: (swiper: import('swiper/types').Swiper) => void;
|
|
74
|
+
onAfterInit?: (swiper: import('swiper/types').Swiper) => void;
|
|
75
|
+
onBeforeInit?: (swiper: import('swiper/types').Swiper) => void;
|
|
76
|
+
onBeforeResize?: (swiper: import('swiper/types').Swiper) => void;
|
|
77
|
+
onBeforeSlideChangeStart?: (swiper: import('swiper/types').Swiper) => void;
|
|
78
|
+
onBeforeTransitionStart?: (swiper: import('swiper/types').Swiper, speed: number, internal: any) => void;
|
|
79
|
+
onChangeDirection?: (swiper: import('swiper/types').Swiper) => void;
|
|
80
|
+
onDoubleClick?: (swiper: import('swiper/types').Swiper, event: MouseEvent | TouchEvent | PointerEvent) => void;
|
|
81
|
+
onDestroy?: (swiper: import('swiper/types').Swiper) => void;
|
|
82
|
+
onMomentumBounce?: (swiper: import('swiper/types').Swiper) => void;
|
|
83
|
+
onOrientationchange?: (swiper: import('swiper/types').Swiper) => void;
|
|
84
|
+
onSlideResetTransitionStart?: (swiper: import('swiper/types').Swiper) => void;
|
|
85
|
+
onSlideResetTransitionEnd?: (swiper: import('swiper/types').Swiper) => void;
|
|
86
|
+
onSliderFirstMove?: (swiper: import('swiper/types').Swiper, event: TouchEvent) => void;
|
|
87
|
+
onSlidesLengthChange?: (swiper: import('swiper/types').Swiper) => void;
|
|
88
|
+
onSlidesGridLengthChange?: (swiper: import('swiper/types').Swiper) => void;
|
|
89
|
+
onSnapGridLengthChange?: (swiper: import('swiper/types').Swiper) => void;
|
|
90
|
+
onUpdate?: (swiper: import('swiper/types').Swiper) => void;
|
|
91
|
+
onLock?: (swiper: import('swiper/types').Swiper) => void;
|
|
92
|
+
onUnlock?: (swiper: import('swiper/types').Swiper) => void;
|
|
93
|
+
} & {
|
|
94
|
+
children?: import('react').ReactNode | undefined;
|
|
95
|
+
}>;
|
|
4
96
|
export declare const ScreenWrap: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
5
97
|
export declare const SponsorIcon: React.FC<{
|
|
6
98
|
style?: React.CSSProperties;
|
|
@@ -1,59 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
const t = () => r, S = /* @__PURE__ */ s(t())({
|
|
6
|
-
name: "Carousel",
|
|
7
|
-
class: "c1f9jjsn",
|
|
8
|
-
propsAsIs: !0
|
|
9
|
-
}), d = /* @__PURE__ */ s("div")({
|
|
10
|
-
name: "Dot",
|
|
11
|
-
class: "d25r51y",
|
|
12
|
-
propsAsIs: !1
|
|
13
|
-
}), f = /* @__PURE__ */ s("div")({
|
|
14
|
-
name: "Dots",
|
|
15
|
-
class: "d1lvrmx8",
|
|
16
|
-
propsAsIs: !1
|
|
17
|
-
}), v = /* @__PURE__ */ s("div")({
|
|
18
|
-
name: "ScreenWrap",
|
|
19
|
-
class: "s11xps29",
|
|
20
|
-
propsAsIs: !1
|
|
21
|
-
}), p = () => c, a = /* @__PURE__ */ s(p())({
|
|
22
|
-
name: "SponsorIconI",
|
|
23
|
-
class: "s14qstuv",
|
|
24
|
-
propsAsIs: !0
|
|
25
|
-
}), A = ({
|
|
26
|
-
style: o,
|
|
27
|
-
className: e
|
|
28
|
-
}) => /* @__PURE__ */ n(a, {
|
|
29
|
-
className: e,
|
|
30
|
-
style: o,
|
|
31
|
-
name: "icon-masters-logo"
|
|
32
|
-
}), u = /* @__PURE__ */ s("div")({
|
|
33
|
-
name: "ScreenTextBlock",
|
|
34
|
-
class: "s14mdh2e",
|
|
35
|
-
propsAsIs: !1
|
|
36
|
-
}), x = /* @__PURE__ */ s("div")({
|
|
37
|
-
name: "ScreenTitle",
|
|
38
|
-
class: "sqtjig9",
|
|
39
|
-
propsAsIs: !1
|
|
40
|
-
}), D = /* @__PURE__ */ s("div")({
|
|
41
|
-
name: "ScreenDescription",
|
|
42
|
-
class: "ss0mt",
|
|
43
|
-
propsAsIs: !1
|
|
44
|
-
}), j = /* @__PURE__ */ s("button")({
|
|
45
|
-
name: "ScreenButton",
|
|
46
|
-
class: "s10dmski",
|
|
47
|
-
propsAsIs: !1
|
|
48
|
-
});
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "@linaria/react";
|
|
3
|
+
import { C as c, d as n, c as t, a as p, b as S, S as i, e as m } from "../../../../styles-BfnMua4o.js";
|
|
4
|
+
import "../../../../ui/icons/index.js";
|
|
49
5
|
export {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
v as ScreenWrap,
|
|
58
|
-
A as SponsorIcon
|
|
6
|
+
c as Carousel,
|
|
7
|
+
n as ScreenButton,
|
|
8
|
+
t as ScreenDescription,
|
|
9
|
+
p as ScreenTextBlock,
|
|
10
|
+
S as ScreenTitle,
|
|
11
|
+
i as ScreenWrap,
|
|
12
|
+
m as SponsorIcon
|
|
59
13
|
};
|
|
@@ -1,49 +1,55 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { styled as
|
|
3
|
-
import { useHideTransition as
|
|
4
|
-
import { useStore as
|
|
5
|
-
import { ModalPortal as
|
|
6
|
-
import { ShowIn as
|
|
7
|
-
import { Question as
|
|
8
|
-
import { Tabs as
|
|
9
|
-
const
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { styled as l } from "@linaria/react";
|
|
3
|
+
import { useHideTransition as d } from "../../../../hooks/showIn.js";
|
|
4
|
+
import { useStore as i } from "@streamlayer/react-polyfills";
|
|
5
|
+
import { ModalPortal as f } from "../../../../ui/modal/index.js";
|
|
6
|
+
import { ShowIn as u } from "../../../../ui/show-in/index.js";
|
|
7
|
+
import { Question as y } from "./Question.js";
|
|
8
|
+
import { Tabs as S } from "./Tabs.js";
|
|
9
|
+
const k = () => u, h = /* @__PURE__ */ l(k())({
|
|
10
10
|
name: "OpenedContainer",
|
|
11
11
|
class: "o1seszvt",
|
|
12
12
|
propsAsIs: !0
|
|
13
|
-
}),
|
|
13
|
+
}), C = ({
|
|
14
14
|
gamification: o,
|
|
15
|
-
className:
|
|
16
|
-
}) => /* @__PURE__ */
|
|
17
|
-
className:
|
|
15
|
+
className: n
|
|
16
|
+
}) => /* @__PURE__ */ t(S, {
|
|
17
|
+
className: n,
|
|
18
18
|
gamification: o
|
|
19
|
-
}),
|
|
19
|
+
}), I = `
|
|
20
|
+
.SDKContainer {
|
|
21
|
+
position: static !important;
|
|
22
|
+
}
|
|
23
|
+
`, G = ({
|
|
20
24
|
gamification: o,
|
|
21
|
-
responsiveStore:
|
|
22
|
-
|
|
25
|
+
responsiveStore: n,
|
|
26
|
+
useContainer: e,
|
|
27
|
+
className: s,
|
|
23
28
|
appNode: r
|
|
24
29
|
}) => {
|
|
25
|
-
const
|
|
30
|
+
const a = i(o.openedQuestion.$store), {
|
|
26
31
|
sdkInDesktopView: m
|
|
27
|
-
} =
|
|
32
|
+
} = i(n, {
|
|
28
33
|
keys: ["sdkInDesktopView"]
|
|
29
34
|
}), {
|
|
30
|
-
hiding:
|
|
31
|
-
onAnimationEnd:
|
|
32
|
-
} =
|
|
33
|
-
return !r.current || !
|
|
35
|
+
hiding: p,
|
|
36
|
+
onAnimationEnd: c
|
|
37
|
+
} = d();
|
|
38
|
+
return !r.current || !a ? null : /* @__PURE__ */ t(f, {
|
|
34
39
|
container: r,
|
|
35
|
-
useContainer: !m,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
useContainer: typeof e == "boolean" ? !e : !m,
|
|
41
|
+
staticStyles: typeof e == "boolean" ? I : "",
|
|
42
|
+
children: /* @__PURE__ */ t(h, {
|
|
43
|
+
className: s,
|
|
44
|
+
hiding: p,
|
|
45
|
+
onAnimationEnd: c,
|
|
46
|
+
children: /* @__PURE__ */ t(y, {
|
|
41
47
|
gamification: o
|
|
42
48
|
})
|
|
43
49
|
})
|
|
44
50
|
});
|
|
45
51
|
};
|
|
46
52
|
export {
|
|
47
|
-
|
|
48
|
-
|
|
53
|
+
C as GamificationOverlay,
|
|
54
|
+
G as GamificationOverlayStandalone
|
|
49
55
|
};
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { lazy as
|
|
2
|
+
import { lazy as a, useMemo as m, Suspense as u } from "react";
|
|
3
3
|
import { FeatureType as o } from "@streamlayer/sdk-web-types";
|
|
4
|
-
import { FeatureProvider as
|
|
5
|
-
import { GamificationOverlayStandalone as
|
|
6
|
-
const
|
|
7
|
-
const n =
|
|
4
|
+
import { FeatureProvider as f } from "./FeatureProvider.js";
|
|
5
|
+
import { GamificationOverlayStandalone as c } from "./Gamification/index.js";
|
|
6
|
+
const p = a(() => import("./Gamification/gamification-feature.js")), v = ({ sdk: e, feature: t, className: i }) => {
|
|
7
|
+
const n = m(() => t && t.featureConfig.get().type === o.GAMES ? /* @__PURE__ */ r(f, { className: i, sdk: e, feature: t, children: /* @__PURE__ */ r(p, { className: i, gamification: t }) }) : null, [e, t, i]);
|
|
8
8
|
return /* @__PURE__ */ r(
|
|
9
|
-
|
|
9
|
+
u,
|
|
10
10
|
{
|
|
11
11
|
fallback: /* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "100%" }, children: "page loading..." }),
|
|
12
12
|
children: n
|
|
13
13
|
}
|
|
14
14
|
);
|
|
15
|
-
},
|
|
16
|
-
|
|
15
|
+
}, F = ({ feature: e, className: t, useContainer: i, appNode: n, responsiveStore: l }) => e && e.featureConfig.get().type === o.GAMES ? /* @__PURE__ */ r(
|
|
16
|
+
c,
|
|
17
17
|
{
|
|
18
|
-
responsiveStore:
|
|
18
|
+
responsiveStore: l,
|
|
19
19
|
className: t,
|
|
20
|
-
appNode:
|
|
20
|
+
appNode: n,
|
|
21
|
+
useContainer: i,
|
|
21
22
|
gamification: e
|
|
22
23
|
}
|
|
23
24
|
) : null;
|
|
24
25
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
v as ActiveFeature,
|
|
27
|
+
F as StandaloneFeature
|
|
27
28
|
};
|
|
@@ -1,159 +1,162 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cx as
|
|
3
|
-
import { useMastersContext as
|
|
4
|
-
import { scrollIntoAppView as
|
|
5
|
-
import { useState as
|
|
6
|
-
import { r as
|
|
7
|
-
import { useStore as
|
|
1
|
+
import { jsxs as f, Fragment as D, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { cx as T } from "@linaria/core";
|
|
3
|
+
import { useMastersContext as q } from "../useMastersContext.js";
|
|
4
|
+
import { scrollIntoAppView as E } from "../useSdkScroll.js";
|
|
5
|
+
import { useState as p, useMemo as O, useEffect as a, useRef as b, useCallback as N } from "react";
|
|
6
|
+
import { r as R } from "../../../index-DALxy-8N.js";
|
|
7
|
+
import { useStore as y } from "@streamlayer/react-polyfills";
|
|
8
8
|
import { eventBus as C } from "@streamlayer/sdk-web-interfaces";
|
|
9
|
-
import { NotificationType as
|
|
10
|
-
import { QuestionTypeData as
|
|
11
|
-
import { Notification as
|
|
12
|
-
import { PredictionResult as
|
|
13
|
-
import { Onboarding as
|
|
14
|
-
import { HiddenContainer as
|
|
15
|
-
const
|
|
16
|
-
const [t,
|
|
17
|
-
|
|
9
|
+
import { NotificationType as g } from "@streamlayer/sdk-web-notifications";
|
|
10
|
+
import { QuestionTypeData as P } from "../../../ui/gamification/constants.js";
|
|
11
|
+
import { Notification as V } from "../../../ui/gamification/question/notification/index.js";
|
|
12
|
+
import { PredictionResult as x } from "../../../ui/gamification/question/notification/prediction-result/index.js";
|
|
13
|
+
import { Onboarding as A } from "./Onboarding/index.js";
|
|
14
|
+
import { HiddenContainer as B, Container as H, InnerContainer as Q, NotificationRefreshing as U, Pill as j } from "./styles.js";
|
|
15
|
+
const z = (n) => {
|
|
16
|
+
const [t, c] = p(0), u = b(null), e = N((o) => {
|
|
17
|
+
u.current = o;
|
|
18
18
|
}, []);
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
const o = (
|
|
22
|
-
o &&
|
|
19
|
+
a(() => {
|
|
20
|
+
var s;
|
|
21
|
+
const o = (s = u.current) == null ? void 0 : s.getBoundingClientRect();
|
|
22
|
+
o && c(o.height);
|
|
23
23
|
}, [n]);
|
|
24
|
-
const r =
|
|
25
|
-
|
|
24
|
+
const r = N((o) => {
|
|
25
|
+
c(o);
|
|
26
26
|
}, []);
|
|
27
|
-
return [
|
|
28
|
-
},
|
|
27
|
+
return [e, t, r];
|
|
28
|
+
}, F = ({
|
|
29
29
|
sdk: n,
|
|
30
30
|
notification: t,
|
|
31
|
-
appNode:
|
|
32
|
-
responsiveStore:
|
|
31
|
+
appNode: c,
|
|
32
|
+
responsiveStore: u
|
|
33
33
|
}) => {
|
|
34
|
-
var
|
|
34
|
+
var h, d;
|
|
35
35
|
const {
|
|
36
|
-
sdk:
|
|
37
|
-
} =
|
|
38
|
-
return t.type ===
|
|
39
|
-
children: [/* @__PURE__ */
|
|
36
|
+
sdk: e
|
|
37
|
+
} = q(), [r, o, s] = z(t.id);
|
|
38
|
+
return t.type === g.QUESTION ? /* @__PURE__ */ f(D, {
|
|
39
|
+
children: [/* @__PURE__ */ l(B, {
|
|
40
40
|
ref: r,
|
|
41
|
-
children: /* @__PURE__ */
|
|
41
|
+
children: /* @__PURE__ */ l(V, {
|
|
42
42
|
...t
|
|
43
43
|
})
|
|
44
|
-
}), /* @__PURE__ */
|
|
44
|
+
}), /* @__PURE__ */ f(H, {
|
|
45
45
|
style: {
|
|
46
46
|
height: t.hiding ? 0 : o
|
|
47
47
|
},
|
|
48
48
|
hiding: t.hiding,
|
|
49
|
-
children: [/* @__PURE__ */
|
|
49
|
+
children: [/* @__PURE__ */ l(Q, {
|
|
50
50
|
style: {
|
|
51
51
|
height: "100%"
|
|
52
52
|
},
|
|
53
|
-
children: /* @__PURE__ */
|
|
53
|
+
children: /* @__PURE__ */ l(V, {
|
|
54
54
|
...t,
|
|
55
|
-
controlVideo:
|
|
55
|
+
controlVideo: e == null ? void 0 : e.controlVideoPlayer
|
|
56
56
|
})
|
|
57
|
-
}), /* @__PURE__ */
|
|
57
|
+
}), /* @__PURE__ */ l(U, {}, t.id)]
|
|
58
58
|
})]
|
|
59
|
-
}) : t.type ===
|
|
59
|
+
}) : t.type === g.QUESTION_RESOLVED && ((d = (h = t.data) == null ? void 0 : h.question) != null && d.predictionResult) ? /* @__PURE__ */ l(x, {
|
|
60
60
|
style: {
|
|
61
61
|
height: t.hiding ? 0 : o
|
|
62
62
|
},
|
|
63
|
-
saveHeight:
|
|
63
|
+
saveHeight: s,
|
|
64
64
|
close: t.close,
|
|
65
65
|
hiding: t.hiding,
|
|
66
66
|
...t.data.question,
|
|
67
67
|
mastersApp: !0
|
|
68
|
-
}) : t.type ===
|
|
68
|
+
}) : t.type === g.ONBOARDING ? /* @__PURE__ */ l(A, {
|
|
69
69
|
style: {
|
|
70
70
|
height: t.hiding ? 0 : o
|
|
71
71
|
},
|
|
72
|
-
saveHeight:
|
|
72
|
+
saveHeight: s,
|
|
73
73
|
sdk: n,
|
|
74
74
|
notification: t,
|
|
75
|
-
appNode:
|
|
76
|
-
responsiveStore:
|
|
75
|
+
appNode: c,
|
|
76
|
+
responsiveStore: u
|
|
77
77
|
}) : null;
|
|
78
|
-
},
|
|
78
|
+
}, L = "p1co32q0", M = ({
|
|
79
79
|
pill: n,
|
|
80
80
|
setPill: t,
|
|
81
|
-
appNode:
|
|
82
|
-
headerNode:
|
|
83
|
-
scrollNode:
|
|
81
|
+
appNode: c,
|
|
82
|
+
headerNode: u,
|
|
83
|
+
scrollNode: e,
|
|
84
84
|
responsiveStore: r,
|
|
85
|
-
scrollStore: o
|
|
85
|
+
scrollStore: o,
|
|
86
|
+
useContainer: s
|
|
86
87
|
}) => {
|
|
87
|
-
var
|
|
88
|
+
var I, k;
|
|
88
89
|
const {
|
|
89
|
-
screen:
|
|
90
|
-
} =
|
|
90
|
+
screen: h
|
|
91
|
+
} = y(r, {
|
|
91
92
|
keys: ["screen"]
|
|
92
93
|
}), {
|
|
93
|
-
tabsShown:
|
|
94
|
-
scrollPosition:
|
|
95
|
-
} =
|
|
94
|
+
tabsShown: d,
|
|
95
|
+
scrollPosition: m
|
|
96
|
+
} = y(o, {
|
|
96
97
|
keys: ["tabsShown", "scrollPosition"]
|
|
97
98
|
});
|
|
98
|
-
|
|
99
|
-
r.get().sdkInDesktopView
|
|
100
|
-
}, [
|
|
101
|
-
const
|
|
102
|
-
return !n || !
|
|
103
|
-
title: n.type ===
|
|
99
|
+
a(() => {
|
|
100
|
+
r.get().sdkInDesktopView || s ? m < 50 && t(null) : m > -50 && t(null);
|
|
101
|
+
}, [m, r, t, s]);
|
|
102
|
+
const i = r.get().sdkInDesktopView ? c : u;
|
|
103
|
+
return !n || !i.current ? null : R.createPortal(/* @__PURE__ */ l(j, {
|
|
104
|
+
title: n.type === g.QUESTION_RESOLVED ? "Prediction result" : `New ${((k = P[(I = n.data) == null ? void 0 : I.questionType]) == null ? void 0 : k.label) || "notification"}`,
|
|
104
105
|
onClick: () => {
|
|
105
|
-
var
|
|
106
|
-
r.get().sdkInDesktopView ? (
|
|
106
|
+
var w;
|
|
107
|
+
r.get().sdkInDesktopView ? (w = e.current) == null || w.scrollTo({
|
|
107
108
|
top: 0,
|
|
108
109
|
behavior: "smooth"
|
|
109
|
-
}) :
|
|
110
|
+
}) : E(e, h.size, {
|
|
110
111
|
behavior: "smooth"
|
|
111
112
|
}), t(null);
|
|
112
113
|
},
|
|
113
|
-
className:
|
|
114
|
-
}),
|
|
115
|
-
},
|
|
114
|
+
className: T(d && L, "sl-pill-button")
|
|
115
|
+
}), i.current);
|
|
116
|
+
}, ot = ({
|
|
116
117
|
sdk: n,
|
|
117
118
|
headerNode: t,
|
|
118
|
-
scrollNode:
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
scrollNode: c,
|
|
120
|
+
useContainer: u,
|
|
121
|
+
responsiveStore: e,
|
|
122
|
+
appNode: r,
|
|
123
|
+
scrollStore: o
|
|
122
124
|
}) => {
|
|
123
|
-
const [
|
|
124
|
-
return
|
|
125
|
-
|
|
125
|
+
const [s] = p(n.getNotificationsStore()), h = y(s), [d, m] = p(null), i = O(() => n.getActiveNotification(), [n, h]);
|
|
126
|
+
return a(() => {
|
|
127
|
+
i && C.emit("notification", {
|
|
126
128
|
action: "rendered",
|
|
127
129
|
payload: {
|
|
128
|
-
questionId:
|
|
129
|
-
questionType:
|
|
130
|
+
questionId: i.data.questionId,
|
|
131
|
+
questionType: i.data.questionType
|
|
130
132
|
}
|
|
131
133
|
});
|
|
132
|
-
}, [
|
|
133
|
-
|
|
134
|
-
|
|
134
|
+
}, [i]), a(() => {
|
|
135
|
+
i && (e.get().sdkInDesktopView || e.get().sdkInView) && (!e.get().sdkInDesktopView && e.get().sdkInView && m(i), e.get().sdkInDesktopView && window.requestAnimationFrame(() => {
|
|
136
|
+
o.get().scrollPosition !== 0 && m(i);
|
|
135
137
|
}));
|
|
136
|
-
}, [
|
|
137
|
-
|
|
138
|
-
}, [
|
|
139
|
-
children: [!
|
|
138
|
+
}, [i]), a(() => {
|
|
139
|
+
i || m(null);
|
|
140
|
+
}, [i]), /* @__PURE__ */ f(D, {
|
|
141
|
+
children: [!d && i && /* @__PURE__ */ l(F, {
|
|
140
142
|
headerNode: t,
|
|
141
|
-
appNode:
|
|
143
|
+
appNode: r,
|
|
142
144
|
sdk: n,
|
|
143
|
-
notification:
|
|
144
|
-
responsiveStore:
|
|
145
|
-
}),
|
|
146
|
-
pill:
|
|
147
|
-
setPill:
|
|
148
|
-
appNode:
|
|
149
|
-
notification:
|
|
145
|
+
notification: i,
|
|
146
|
+
responsiveStore: e
|
|
147
|
+
}), d && /* @__PURE__ */ l(M, {
|
|
148
|
+
pill: d,
|
|
149
|
+
setPill: m,
|
|
150
|
+
appNode: r,
|
|
151
|
+
notification: i,
|
|
150
152
|
headerNode: t,
|
|
151
|
-
scrollNode:
|
|
152
|
-
scrollStore:
|
|
153
|
-
|
|
153
|
+
scrollNode: c,
|
|
154
|
+
scrollStore: o,
|
|
155
|
+
useContainer: u,
|
|
156
|
+
responsiveStore: e
|
|
154
157
|
})]
|
|
155
158
|
});
|
|
156
159
|
};
|
|
157
160
|
export {
|
|
158
|
-
|
|
161
|
+
ot as SDKNotifications
|
|
159
162
|
};
|
|
@@ -1,34 +1,25 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useStore as
|
|
4
|
-
import {
|
|
5
|
-
import { FeatureType as f } from "@streamlayer/sdk-web-types";
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useState as m, useEffect as f } from "react";
|
|
3
|
+
import { useStore as c } from "@streamlayer/react-polyfills";
|
|
4
|
+
import { FeatureType as p } from "@streamlayer/sdk-web-types";
|
|
6
5
|
import { Points as S } from "../../../ui/gamification/points/index.js";
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
return
|
|
10
|
-
const i =
|
|
11
|
-
var
|
|
12
|
-
(
|
|
6
|
+
const a = ({ gamification: r }) => {
|
|
7
|
+
const o = r.userSummary.$store, [t, u] = m(0);
|
|
8
|
+
return f(() => {
|
|
9
|
+
const i = o.subscribe((e) => {
|
|
10
|
+
var s;
|
|
11
|
+
(s = e == null ? void 0 : e.summary) != null && s.points && u(e.summary.points);
|
|
13
12
|
});
|
|
14
13
|
return () => {
|
|
15
14
|
i();
|
|
16
15
|
};
|
|
17
|
-
}, [
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
payload: {}
|
|
21
|
-
})) : e.status.get() === u.Ready && (e.closeFeature(!1), n.emit("app", {
|
|
22
|
-
action: "close",
|
|
23
|
-
payload: {}
|
|
24
|
-
}));
|
|
25
|
-
} });
|
|
26
|
-
}, k = ({ sdk: e }) => {
|
|
27
|
-
if (!l(e.featuresList.getStore()))
|
|
16
|
+
}, [o]), /* @__PURE__ */ n(S, { points: t });
|
|
17
|
+
}, b = ({ sdk: r }) => {
|
|
18
|
+
if (!c(r.featuresList.getStore()))
|
|
28
19
|
return null;
|
|
29
|
-
const t =
|
|
30
|
-
return t ? /* @__PURE__ */
|
|
20
|
+
const t = r.getFeature(p.GAMES);
|
|
21
|
+
return t ? /* @__PURE__ */ n(a, { gamification: t }) : null;
|
|
31
22
|
};
|
|
32
23
|
export {
|
|
33
|
-
|
|
24
|
+
b as StreamLayerSDKPoints
|
|
34
25
|
};
|