@streamlayer/sdk-web-core 1.1.3 → 1.2.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/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/ui/index.d.ts +23 -0
- package/lib/ui/index.js +14 -0
- package/package.json +7 -7
package/lib/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { bypass, storage } from './auth';
|
|
|
3
3
|
export { store } from './store';
|
|
4
4
|
export { deepLink, type DeepLinkUrlParams, type DeepLinkCallback, type DeepLinkContext, DEEP_LINK_PREFIX, DEEP_LINK_USER_ID, DEEP_LINK_EVENT_ID, DEEP_LINK_EXTERNAL_EVENT_ID, } from './deepLink';
|
|
5
5
|
export { videoPlayer, type VideoPlayerCallback } from './videoPlayer';
|
|
6
|
+
export { ui, type UIContext, type OnContentActivateCallback } from './ui';
|
|
6
7
|
import './store';
|
|
7
8
|
import './auth';
|
|
8
9
|
declare module '@streamlayer/sdk-web-interfaces' {
|
package/lib/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export { bypass, storage } from './auth';
|
|
|
3
3
|
export { store } from './store';
|
|
4
4
|
export { deepLink, DEEP_LINK_PREFIX, DEEP_LINK_USER_ID, DEEP_LINK_EVENT_ID, DEEP_LINK_EXTERNAL_EVENT_ID, } from './deepLink';
|
|
5
5
|
export { videoPlayer } from './videoPlayer';
|
|
6
|
+
export { ui } from './ui';
|
|
6
7
|
import './store';
|
|
7
8
|
import './auth';
|
|
8
9
|
/**
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { StreamLayerContext } from '@streamlayer/sdk-web-interfaces';
|
|
2
|
+
export type UIData = {
|
|
3
|
+
stage: 'activate' | 'deactivate';
|
|
4
|
+
id: string;
|
|
5
|
+
isShowed?: boolean;
|
|
6
|
+
type: 'advertisement';
|
|
7
|
+
};
|
|
8
|
+
export type OnContentActivateCallback = (renderData: UIData) => void;
|
|
9
|
+
export interface UIContext {
|
|
10
|
+
state: Set<string>;
|
|
11
|
+
onContentActivate?: OnContentActivateCallback;
|
|
12
|
+
}
|
|
13
|
+
declare module '@streamlayer/sdk-web-interfaces' {
|
|
14
|
+
interface StreamLayerContext {
|
|
15
|
+
ui: UIContext;
|
|
16
|
+
}
|
|
17
|
+
interface StreamLayerSDK {
|
|
18
|
+
onAdvertisementActivate: (params: Omit<UIData, 'type'>) => void;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export declare const ui: (instance: StreamLayerContext, opts: {
|
|
22
|
+
onContentActivate?: OnContentActivateCallback;
|
|
23
|
+
}, done: () => void) => void;
|
package/lib/ui/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const ui = (instance, opts, done) => {
|
|
2
|
+
instance.ui = {
|
|
3
|
+
state: new Set(),
|
|
4
|
+
};
|
|
5
|
+
if (opts.onContentActivate) {
|
|
6
|
+
instance.ui.onContentActivate = opts.onContentActivate;
|
|
7
|
+
}
|
|
8
|
+
instance.sdk.onAdvertisementActivate = (params) => {
|
|
9
|
+
if (instance.ui.onContentActivate) {
|
|
10
|
+
instance.ui.onContentActivate({ ...params, type: 'advertisement' });
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
done();
|
|
14
|
+
};
|
package/package.json
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
},
|
|
6
6
|
"peerDependencies": {
|
|
7
7
|
"@nanostores/query": "^0.2.10",
|
|
8
|
-
"@streamlayer/sl-eslib": "^5.
|
|
8
|
+
"@streamlayer/sl-eslib": "^5.122.0",
|
|
9
9
|
"nanostores": "^0.10.3",
|
|
10
|
-
"@streamlayer/sdk-web-api": "^1.
|
|
11
|
-
"@streamlayer/sdk-web-interfaces": "^1.1.
|
|
12
|
-
"@streamlayer/sdk-web-logger": "^1.0.
|
|
13
|
-
"@streamlayer/sdk-web-storage": "^1.0.
|
|
14
|
-
"@streamlayer/sdk-web-types": "^1.
|
|
10
|
+
"@streamlayer/sdk-web-api": "^1.3.1",
|
|
11
|
+
"@streamlayer/sdk-web-interfaces": "^1.1.5",
|
|
12
|
+
"@streamlayer/sdk-web-logger": "^1.0.10",
|
|
13
|
+
"@streamlayer/sdk-web-storage": "^1.0.10",
|
|
14
|
+
"@streamlayer/sdk-web-types": "^1.3.1"
|
|
15
15
|
},
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"default": "./lib/auth/index.js"
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
|
-
"version": "1.1
|
|
43
|
+
"version": "1.2.1",
|
|
44
44
|
"type": "module",
|
|
45
45
|
"main": "./lib/index.js",
|
|
46
46
|
"module": "./lib/index.js",
|