@streamlayer/web-os 0.4.2 → 0.4.4
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/cjs/gamification-feature.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/index2.js +25 -40
- package/lib/classic/cjs/classic.js +1 -1
- package/lib/classic/cjs/gamification-feature.js +1 -1
- package/lib/classic/cjs/index.js +1 -1
- package/lib/classic/cjs/index2.js +1 -10
- package/lib/classic/classic.d.ts +2 -13
- package/lib/classic/core/app/app.d.ts +16 -0
- package/lib/classic/core/app/event.d.ts +6 -0
- package/lib/classic/core/app/provider.d.ts +49 -0
- package/lib/classic/core/app/useStreamLayerApp.d.ts +23 -0
- package/lib/classic/core/index.d.ts +4 -0
- package/lib/classic/es/classic.js +78 -8
- package/lib/classic/es/gamification-feature.js +638 -2
- package/lib/classic/es/index.js +157 -10
- package/lib/classic/es/index2.js +19054 -11977
- package/lib/classic/index.d.ts +2 -13
- package/lib/classic.d.ts +2 -13
- package/lib/core/app/app.d.ts +16 -0
- package/lib/core/app/event.d.ts +6 -0
- package/lib/core/app/provider.d.ts +49 -0
- package/lib/core/app/useStreamLayerApp.d.ts +23 -0
- package/lib/core/index.d.ts +4 -0
- package/lib/es/gamification-feature.js +606 -2
- package/lib/es/index.js +2 -2
- package/lib/es/index2.js +16237 -23252
- package/lib/index.d.ts +2 -13
- package/package.json +19 -20
- package/lib/cjs/gamification-feature2.js +0 -1
- package/lib/classic/cjs/classic2.js +0 -10
- package/lib/classic/cjs/gamification-feature2.js +0 -1
- package/lib/classic/cjs/gamification-feature3.js +0 -1
- package/lib/classic/cjs/index3.js +0 -1
- package/lib/classic/es/classic2.js +0 -13037
- package/lib/classic/es/gamification-feature2.js +0 -4
- package/lib/classic/es/gamification-feature3.js +0 -643
- package/lib/classic/es/index3.js +0 -14930
- package/lib/es/gamification-feature2.js +0 -608
package/lib/classic/classic.d.ts
CHANGED
|
@@ -1,18 +1,7 @@
|
|
|
1
1
|
import { StreamLayerSDKTvOptions } from '@streamlayer/react-ui/webos';
|
|
2
|
-
import { StreamLayerProvider as DefaultStreamLayerProvider, VideoPlayerCallback } from '
|
|
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 './core';
|
|
14
3
|
import '@streamlayer/react-ui/style.css';
|
|
15
|
-
export { useStreamLayer, useStreamLayerUI, type VideoPlayerCallback, type VideoPlayerData
|
|
4
|
+
export { useStreamLayer, useStreamLayerUI, type VideoPlayerCallback, type VideoPlayerData } from './core';
|
|
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 = {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StreamLayerOptions, StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
2
|
+
export declare const useStreamLayer: () => StreamLayerSDK | null;
|
|
3
|
+
export declare const useStreamLayerEvent: () => import('react').MutableRefObject<string> | undefined;
|
|
4
|
+
export declare const useStreamLayerTheme: () => Pick<StreamLayerOptions, "theme" | "themeMode">;
|
|
5
|
+
export declare const useStreamLayerUI: () => {
|
|
6
|
+
promotionExternalAd?: boolean;
|
|
7
|
+
promotionSidebar?: boolean;
|
|
8
|
+
promotionOverlay?: boolean;
|
|
9
|
+
promotionNotification?: boolean;
|
|
10
|
+
promotionBanner?: boolean;
|
|
11
|
+
app?: boolean;
|
|
12
|
+
appNotification?: boolean;
|
|
13
|
+
appSidebar?: boolean;
|
|
14
|
+
appBanner?: boolean;
|
|
15
|
+
onboardingNotification?: boolean;
|
|
16
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { StreamLayerSDK, StreamLayerPlugin } from '@streamlayer/sdk-web-interfaces';
|
|
2
|
+
import { DeepLinkCallback } from '@streamlayer/sdk-web-core';
|
|
3
|
+
export type { DeepLinkCallback } from '@streamlayer/sdk-web-core';
|
|
4
|
+
export type ContentActivateParams = {
|
|
5
|
+
stage: 'activate' | 'deactivate';
|
|
6
|
+
id: string;
|
|
7
|
+
isViewed?: boolean;
|
|
8
|
+
hasNotification?: boolean;
|
|
9
|
+
type: 'advertisement' | 'insight' | 'poll' | 'trivia' | 'prediction' | 'tweet' | 'question';
|
|
10
|
+
};
|
|
11
|
+
export type VideoPlayerData = {
|
|
12
|
+
muted?: boolean;
|
|
13
|
+
play?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type VideoPlayerCallback = (videoPlayerData: VideoPlayerData) => void;
|
|
16
|
+
export type OnContentActivateCallback = (renderData: ContentActivateParams) => void;
|
|
17
|
+
export declare enum StreamLayerStatus {
|
|
18
|
+
UNSET = 0,
|
|
19
|
+
CONNECTED = 1,
|
|
20
|
+
READY = 2
|
|
21
|
+
}
|
|
22
|
+
export declare const StreamLayerContext: import('react').Context<{
|
|
23
|
+
status: StreamLayerStatus;
|
|
24
|
+
sdk: StreamLayerSDK | null;
|
|
25
|
+
event?: React.MutableRefObject<string>;
|
|
26
|
+
}>;
|
|
27
|
+
export type StreamLayerProps = {
|
|
28
|
+
sdkKey: string;
|
|
29
|
+
plugins?: Set<StreamLayerPlugin>;
|
|
30
|
+
event?: string;
|
|
31
|
+
production?: boolean;
|
|
32
|
+
autoEnable?: boolean;
|
|
33
|
+
onDeepLinkHandled?: DeepLinkCallback;
|
|
34
|
+
videoPlayerController?: VideoPlayerCallback;
|
|
35
|
+
onContentActivate?: OnContentActivateCallback;
|
|
36
|
+
theme?: string;
|
|
37
|
+
withAdNotification?: boolean;
|
|
38
|
+
withAd?: boolean;
|
|
39
|
+
hideFriends?: boolean;
|
|
40
|
+
friendsTab?: 'enabled' | 'disabled' | 'activatedGame';
|
|
41
|
+
themeMode?: 'light' | 'dark';
|
|
42
|
+
containerId?: string;
|
|
43
|
+
};
|
|
44
|
+
export declare const StreamLayerProvider: React.FC<StreamLayerProps & {
|
|
45
|
+
children: React.ReactNode;
|
|
46
|
+
skipOnboarding?: boolean;
|
|
47
|
+
betPack?: boolean;
|
|
48
|
+
webOS?: boolean;
|
|
49
|
+
}>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { StreamLayerSDK, StreamLayerPlugin } from '@streamlayer/sdk-web-interfaces';
|
|
2
|
+
import { DeepLinkCallback, VideoPlayerCallback, OnContentActivateCallback } from '@streamlayer/sdk-web-core';
|
|
3
|
+
declare global {
|
|
4
|
+
interface Window {
|
|
5
|
+
sl: unknown;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export declare const useStreamLayerApp: ({ sdkKey, plugins, production, autoEnable, onDeepLinkHandled, videoPlayerController, onContentActivate, hideFriends, skipOnboarding, withAdNotification, withAd, friendsTab, betPack, webOS, }: {
|
|
9
|
+
sdkKey: string;
|
|
10
|
+
plugins?: Set<StreamLayerPlugin>;
|
|
11
|
+
production?: boolean;
|
|
12
|
+
autoEnable?: boolean;
|
|
13
|
+
onDeepLinkHandled?: DeepLinkCallback;
|
|
14
|
+
videoPlayerController?: VideoPlayerCallback;
|
|
15
|
+
onContentActivate?: OnContentActivateCallback;
|
|
16
|
+
skipOnboarding?: boolean;
|
|
17
|
+
withAdNotification?: boolean;
|
|
18
|
+
hideFriends?: boolean;
|
|
19
|
+
withAd?: boolean;
|
|
20
|
+
betPack?: boolean;
|
|
21
|
+
webOS?: boolean;
|
|
22
|
+
friendsTab: "enabled" | "disabled" | "activatedGame";
|
|
23
|
+
}) => StreamLayerSDK | null;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { StreamLayerProvider, type DeepLinkCallback, type VideoPlayerCallback, type VideoPlayerData, type ContentActivateParams, type OnContentActivateCallback, } from './app/provider';
|
|
2
|
+
export { StreamLayerThemeProvider } from '@streamlayer/react-ui';
|
|
3
|
+
export { StreamLayerSDKEvent, type StreamLayerSDKEventProps } from './app/event';
|
|
4
|
+
export { useStreamLayer, useStreamLayerUI, useStreamLayerTheme } from './app/app';
|
|
@@ -1,14 +1,84 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "./
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { S as StreamLayerProvider$1, u as useStreamLayer, a as useStreamLayerTheme, h, W, b as anonymous } from "./index2.js";
|
|
3
|
+
import { d } from "./index2.js";
|
|
4
|
+
import { useRef, useEffect } from "react";
|
|
3
5
|
import "nanostores";
|
|
4
|
-
import { S, a, n, b } from "./classic2.js";
|
|
5
|
-
import "react";
|
|
6
6
|
import "lodash.throttle";
|
|
7
7
|
import "react-dom";
|
|
8
8
|
import "react-countup";
|
|
9
|
+
const plugins = /* @__PURE__ */ new Set([anonymous]);
|
|
10
|
+
const StreamLayerProvider = (props) => {
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
StreamLayerProvider$1,
|
|
13
|
+
{
|
|
14
|
+
...props,
|
|
15
|
+
themeMode: "dark",
|
|
16
|
+
withAd: true,
|
|
17
|
+
skipOnboarding: true,
|
|
18
|
+
withAdNotification: true,
|
|
19
|
+
autoEnable: true,
|
|
20
|
+
plugins,
|
|
21
|
+
friendsTab: "disabled",
|
|
22
|
+
hideFriends: true,
|
|
23
|
+
webOS: true
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
const AnonymousLogin = ({ sdk }) => {
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
sdk.anonymousAuthorization();
|
|
30
|
+
}, [sdk]);
|
|
31
|
+
return null;
|
|
32
|
+
};
|
|
33
|
+
const StreamLayerSDKTv = ({
|
|
34
|
+
persistent,
|
|
35
|
+
children,
|
|
36
|
+
showPauseAd,
|
|
37
|
+
pauseAdVastUrl,
|
|
38
|
+
videoPlayerController,
|
|
39
|
+
onRenderPauseAd,
|
|
40
|
+
onClosePauseAd,
|
|
41
|
+
options
|
|
42
|
+
}) => {
|
|
43
|
+
const sdk = useStreamLayer();
|
|
44
|
+
const baseTheme = useStreamLayerTheme();
|
|
45
|
+
const ref = useRef();
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (sdk) {
|
|
48
|
+
if (videoPlayerController) {
|
|
49
|
+
ref.current = videoPlayerController;
|
|
50
|
+
sdk.addVideoPlayerController(ref.current);
|
|
51
|
+
}
|
|
52
|
+
return () => {
|
|
53
|
+
if (ref.current) {
|
|
54
|
+
sdk.removeVideoPlayerController(ref.current);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}, [sdk]);
|
|
59
|
+
if (!sdk) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
return /* @__PURE__ */ jsx("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ jsxs(h, { customTheme: baseTheme.theme, themeMode: baseTheme.themeMode, children: [
|
|
63
|
+
/* @__PURE__ */ jsx(
|
|
64
|
+
W,
|
|
65
|
+
{
|
|
66
|
+
sdk,
|
|
67
|
+
persistent,
|
|
68
|
+
showPauseAd,
|
|
69
|
+
onRenderPauseAd,
|
|
70
|
+
pauseAdVastUrl,
|
|
71
|
+
onClosePauseAd,
|
|
72
|
+
options,
|
|
73
|
+
children
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
/* @__PURE__ */ jsx(AnonymousLogin, { sdk })
|
|
77
|
+
] }) });
|
|
78
|
+
};
|
|
9
79
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
80
|
+
StreamLayerProvider,
|
|
81
|
+
StreamLayerSDKTv,
|
|
82
|
+
useStreamLayer,
|
|
83
|
+
d as useStreamLayerUI
|
|
14
84
|
};
|