@streamlayer/web-os 0.4.3 → 0.5.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.
Files changed (35) hide show
  1. package/lib/cjs/index.js +80 -1
  2. package/lib/cjs/index2.js +5 -95
  3. package/lib/classic/cjs/classic.js +1 -1
  4. package/lib/classic/cjs/index.js +1 -1
  5. package/lib/classic/cjs/index2.js +1 -10
  6. package/lib/classic/cjs/index3.js +1 -1
  7. package/lib/classic/classic.d.ts +2 -13
  8. package/lib/classic/es/classic.js +79 -12
  9. package/lib/classic/es/index.js +158 -14
  10. package/lib/classic/es/index2.js +19011 -12104
  11. package/lib/classic/es/index3.js +4321 -14767
  12. package/lib/classic/index.d.ts +2 -13
  13. package/lib/classic/style.css +1 -1
  14. package/lib/classic.d.ts +2 -13
  15. package/lib/es/index.js +17785 -13
  16. package/lib/es/index2.js +3654 -25004
  17. package/lib/index.d.ts +2 -13
  18. package/lib/style.css +1 -1
  19. package/package.json +18 -55
  20. package/lib/cjs/gamification-feature.js +0 -1
  21. package/lib/cjs/gamification-feature2.js +0 -1
  22. package/lib/cjs/index-l-eyvmpL.js +0 -5
  23. package/lib/classic/cjs/classic2.js +0 -10
  24. package/lib/classic/cjs/gamification-feature.js +0 -1
  25. package/lib/classic/cjs/gamification-feature2.js +0 -1
  26. package/lib/classic/cjs/gamification-feature3.js +0 -1
  27. package/lib/classic/cjs/index-l-eyvmpL.js +0 -1
  28. package/lib/classic/es/classic2.js +0 -13037
  29. package/lib/classic/es/gamification-feature.js +0 -4
  30. package/lib/classic/es/gamification-feature2.js +0 -4
  31. package/lib/classic/es/gamification-feature3.js +0 -643
  32. package/lib/classic/es/index-l-eyvmpL.js +0 -3758
  33. package/lib/es/gamification-feature.js +0 -4
  34. package/lib/es/gamification-feature2.js +0 -608
  35. package/lib/es/index-l-eyvmpL.js +0 -3758
@@ -1,18 +1,7 @@
1
1
  import { StreamLayerSDKTvOptions } from '@streamlayer/react-ui/webos';
2
- import { StreamLayerProvider as DefaultStreamLayerProvider, VideoPlayerCallback } from '@streamlayer/react/classic';
3
- import '@streamlayer/sdk-web-api';
4
- import '@streamlayer/sdk-web-core';
5
- import '@streamlayer/sdk-web-types';
6
- import '@streamlayer/sdk-web-logger';
7
- import '@streamlayer/sdk-web-storage';
8
- import '@streamlayer/sdk-web-features';
9
- import '@streamlayer/sdk-web-interfaces';
10
- import '@streamlayer/sdk-web-notifications';
11
- import '@streamlayer/feature-gamification';
12
- import '@streamlayer/sdk-web-anonymous-auth';
13
- import '@streamlayer/react/classic';
2
+ import { StreamLayerProvider as DefaultStreamLayerProvider, VideoPlayerCallback } from '@streamlayer/react-ui/core/provider';
14
3
  import '@streamlayer/react-ui/style.css';
15
- export { useStreamLayer, useStreamLayerUI, type VideoPlayerCallback, type VideoPlayerData, } from '@streamlayer/react/classic';
4
+ export { useStreamLayer, useStreamLayerTheme, useStreamLayerUI } from '@streamlayer/react-ui/core/hooks';
16
5
  type StreamLayerProviderProps = Omit<Parameters<typeof DefaultStreamLayerProvider>[0], 'themeMode' | 'withAd' | 'withAdNotification' | 'autoEnable' | 'plugins' | 'webOS' | 'friendsTab' | 'hideFriends' | 'onDeepLinkHandled' | 'videoPlayerController' | 'skipOnboarding'>;
17
6
  export declare const StreamLayerProvider: React.FC<StreamLayerProviderProps>;
18
7
  export type StreamLayerSDKTvProps = {
@@ -1,14 +1,81 @@
1
- import "react/jsx-runtime";
2
- import "./index3.js";
3
- import "nanostores";
4
- import { S, a, n, b } from "./classic2.js";
5
- import "react";
6
- import "lodash.throttle";
7
- import "react-dom";
8
- import "react-countup";
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { q, B, z, h, W, a as anonymous } from "./index2.js";
3
+ import { F } from "./index2.js";
4
+ import { useRef, useEffect } from "react";
5
+ const plugins = /* @__PURE__ */ new Set([anonymous]);
6
+ const StreamLayerProvider = (props) => {
7
+ return /* @__PURE__ */ jsx(
8
+ q,
9
+ {
10
+ ...props,
11
+ themeMode: "dark",
12
+ withAd: true,
13
+ skipOnboarding: true,
14
+ withAdNotification: true,
15
+ autoEnable: true,
16
+ plugins,
17
+ friendsTab: "disabled",
18
+ hideFriends: true,
19
+ webOS: true
20
+ }
21
+ );
22
+ };
23
+ const AnonymousLogin = ({ sdk }) => {
24
+ useEffect(() => {
25
+ sdk.anonymousAuthorization();
26
+ }, [sdk]);
27
+ return null;
28
+ };
29
+ const StreamLayerSDKTv = ({
30
+ persistent,
31
+ children,
32
+ showPauseAd,
33
+ pauseAdVastUrl,
34
+ videoPlayerController,
35
+ onRenderPauseAd,
36
+ onClosePauseAd,
37
+ options
38
+ }) => {
39
+ const sdk = B();
40
+ const baseTheme = z();
41
+ const ref = useRef();
42
+ useEffect(() => {
43
+ if (sdk) {
44
+ if (videoPlayerController) {
45
+ ref.current = videoPlayerController;
46
+ sdk.addVideoPlayerController(ref.current);
47
+ }
48
+ return () => {
49
+ if (ref.current) {
50
+ sdk.removeVideoPlayerController(ref.current);
51
+ }
52
+ };
53
+ }
54
+ }, [sdk]);
55
+ if (!sdk) {
56
+ return null;
57
+ }
58
+ return /* @__PURE__ */ jsx("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ jsxs(h, { customTheme: baseTheme.theme, themeMode: baseTheme.themeMode, children: [
59
+ /* @__PURE__ */ jsx(
60
+ W,
61
+ {
62
+ sdk,
63
+ persistent,
64
+ showPauseAd,
65
+ onRenderPauseAd,
66
+ pauseAdVastUrl,
67
+ onClosePauseAd,
68
+ options,
69
+ children
70
+ }
71
+ ),
72
+ /* @__PURE__ */ jsx(AnonymousLogin, { sdk })
73
+ ] }) });
74
+ };
9
75
  export {
10
- S as StreamLayerProvider,
11
- a as StreamLayerSDKTv,
12
- n as useStreamLayer,
13
- b as useStreamLayerUI
76
+ StreamLayerProvider,
77
+ StreamLayerSDKTv,
78
+ B as useStreamLayer,
79
+ z as useStreamLayerTheme,
80
+ F as useStreamLayerUI
14
81
  };
@@ -1,16 +1,160 @@
1
- import "react/jsx-runtime";
2
- import "./index3.js";
3
- import "nanostores";
4
- import { S, c, a, b, u, h } from "./index2.js";
5
- import "react";
6
- import "lodash.throttle";
7
- import "react-dom";
8
- import "react-countup";
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { q, B, z, h, t as te, W, a as anonymous, u as useStore, g as ge, Z } from "./index2.js";
3
+ import { F } from "./index2.js";
4
+ import { useRef, useEffect } from "react";
5
+ const plugins = /* @__PURE__ */ new Set([anonymous]);
6
+ const RegisterVideoPlayerController = ({
7
+ videoPlayerController
8
+ }) => {
9
+ const sdk = B();
10
+ const ref = useRef();
11
+ useEffect(() => {
12
+ if (sdk) {
13
+ ref.current = videoPlayerController;
14
+ sdk.addVideoPlayerController(ref.current);
15
+ return () => {
16
+ if (ref.current) {
17
+ sdk.removeVideoPlayerController(ref.current);
18
+ }
19
+ };
20
+ }
21
+ }, [sdk]);
22
+ return null;
23
+ };
24
+ const StreamLayerProvider = ({
25
+ children,
26
+ videoPlayerController,
27
+ ...props
28
+ }) => {
29
+ return /* @__PURE__ */ jsxs(
30
+ q,
31
+ {
32
+ ...props,
33
+ themeMode: "dark",
34
+ withAd: true,
35
+ skipOnboarding: true,
36
+ withAdNotification: true,
37
+ autoEnable: true,
38
+ plugins,
39
+ friendsTab: "disabled",
40
+ hideFriends: true,
41
+ webOS: true,
42
+ children: [
43
+ children,
44
+ videoPlayerController && /* @__PURE__ */ jsx(RegisterVideoPlayerController, { videoPlayerController })
45
+ ]
46
+ }
47
+ );
48
+ };
49
+ const AnonymousLogin = ({ sdk }) => {
50
+ useEffect(() => {
51
+ sdk.anonymousAuthorization();
52
+ }, [sdk]);
53
+ return null;
54
+ };
55
+ const StreamLayerSDKTvContentPure = ({ persistent, notification, banner, sdk }) => {
56
+ const uiState = useStore(sdk.uiState);
57
+ if (uiState.exposedPauseAd) {
58
+ return null;
59
+ }
60
+ if (banner) {
61
+ return /* @__PURE__ */ jsx(ge, { sdk, persistent, banner: "bottom" });
62
+ }
63
+ if (notification) {
64
+ if (!!uiState.promotionNotification) {
65
+ return /* @__PURE__ */ jsx(ge, { sdk, notification: true, persistent, sidebar: "right" });
66
+ }
67
+ return /* @__PURE__ */ jsx(Z, { sdk, notification: true, persistent });
68
+ }
69
+ if (!!uiState.promotionSidebar) {
70
+ return /* @__PURE__ */ jsx(ge, { sdk, persistent, sidebar: "right" });
71
+ }
72
+ return /* @__PURE__ */ jsx(Z, { sdk, persistent });
73
+ };
74
+ const StreamLayerSDKTvContent = (props) => {
75
+ const sdk = B();
76
+ const baseTheme = z();
77
+ if (!sdk) {
78
+ return null;
79
+ }
80
+ return /* @__PURE__ */ jsx("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ jsx(
81
+ h,
82
+ {
83
+ style: { position: "relative" },
84
+ customTheme: baseTheme.theme,
85
+ themeMode: baseTheme.themeMode,
86
+ children: /* @__PURE__ */ jsx(StreamLayerSDKTvContentPure, { sdk, ...props })
87
+ }
88
+ ) });
89
+ };
90
+ const StreamLayerSDKTvPauseAd = (props) => {
91
+ const sdk = B();
92
+ const baseTheme = z();
93
+ if (!sdk) {
94
+ return null;
95
+ }
96
+ return /* @__PURE__ */ jsx("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ jsx(
97
+ h,
98
+ {
99
+ style: { position: "relative" },
100
+ customTheme: baseTheme.theme,
101
+ themeMode: baseTheme.themeMode,
102
+ children: /* @__PURE__ */ jsx(te, { ...props, sdk, isDesktop: false })
103
+ }
104
+ ) });
105
+ };
106
+ const StreamLayerSDKTv = ({
107
+ persistent,
108
+ children,
109
+ showPauseAd,
110
+ pauseAdVastUrl,
111
+ videoPlayerController,
112
+ onRenderPauseAd,
113
+ onClosePauseAd,
114
+ options
115
+ }) => {
116
+ const sdk = B();
117
+ const baseTheme = z();
118
+ const ref = useRef();
119
+ useEffect(() => {
120
+ if (sdk) {
121
+ if (videoPlayerController) {
122
+ ref.current = videoPlayerController;
123
+ sdk.addVideoPlayerController(ref.current);
124
+ }
125
+ return () => {
126
+ if (ref.current) {
127
+ sdk.removeVideoPlayerController(ref.current);
128
+ }
129
+ };
130
+ }
131
+ }, [sdk]);
132
+ if (!sdk) {
133
+ return null;
134
+ }
135
+ return /* @__PURE__ */ jsx("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ jsxs(h, { customTheme: baseTheme.theme, themeMode: baseTheme.themeMode, children: [
136
+ /* @__PURE__ */ jsx(
137
+ W,
138
+ {
139
+ sdk,
140
+ persistent,
141
+ showPauseAd,
142
+ onRenderPauseAd,
143
+ pauseAdVastUrl,
144
+ onClosePauseAd,
145
+ options,
146
+ children
147
+ }
148
+ ),
149
+ /* @__PURE__ */ jsx(AnonymousLogin, { sdk })
150
+ ] }) });
151
+ };
9
152
  export {
10
- S as StreamLayerProvider,
11
- c as StreamLayerSDKTv,
12
- a as StreamLayerSDKTvContent,
13
- b as StreamLayerSDKTvPauseAd,
14
- u as useStreamLayer,
15
- h as useStreamLayerUI
153
+ StreamLayerProvider,
154
+ StreamLayerSDKTv,
155
+ StreamLayerSDKTvContent,
156
+ StreamLayerSDKTvPauseAd,
157
+ B as useStreamLayer,
158
+ z as useStreamLayerTheme,
159
+ F as useStreamLayerUI
16
160
  };