@streamlayer/sdk-web-core 1.7.2 → 1.8.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/ui/index.d.ts CHANGED
@@ -6,6 +6,7 @@ export type UIData = {
6
6
  isViewed?: boolean;
7
7
  hasNotification?: boolean;
8
8
  type: 'advertisement' | 'insight' | 'poll' | 'trivia' | 'prediction' | 'tweet' | 'question';
9
+ hasBanner?: boolean;
9
10
  };
10
11
  export type OnContentActivateCallback = (renderData: UIData) => void;
11
12
  export type UIState = {
package/lib/ui/index.js CHANGED
@@ -61,12 +61,12 @@ export const ui = (instance, opts, done) => {
61
61
  }
62
62
  if (event.slEventBus?.type === 'advertisement' && opts.withAd) {
63
63
  const ctx = event.slEventBus;
64
- const { hasNotification, id, isViewed, type } = ctx.payload;
64
+ const { hasNotification, hasBanner, id, isViewed, type } = ctx.payload;
65
65
  switch (ctx.action) {
66
66
  case 'notification-opened':
67
67
  instance.sdk.uiState.set({
68
68
  promotionExternalAd: type === PromotionType.EXTERNAL_AD,
69
- promotionBanner: true,
69
+ promotionBanner: hasBanner,
70
70
  promotionNotification: false,
71
71
  promotionOverlay: true,
72
72
  promotionSidebar: true,
@@ -78,11 +78,12 @@ export const ui = (instance, opts, done) => {
78
78
  stage: 'activate',
79
79
  id,
80
80
  hasNotification,
81
+ hasBanner,
81
82
  isViewed,
82
83
  });
83
84
  if (!opts.withAdNotification) {
84
85
  instance.sdk.uiState.set({
85
- promotionBanner: true,
86
+ promotionBanner: hasBanner,
86
87
  promotionOverlay: true,
87
88
  promotionSidebar: true,
88
89
  promotionExternalAd: type === PromotionType.EXTERNAL_AD,
@@ -96,7 +97,7 @@ export const ui = (instance, opts, done) => {
96
97
  }
97
98
  else {
98
99
  instance.sdk.uiState.set({
99
- promotionBanner: true,
100
+ promotionBanner: hasBanner,
100
101
  promotionOverlay: true,
101
102
  promotionSidebar: true,
102
103
  promotionExternalAd: type === PromotionType.EXTERNAL_AD,
@@ -104,7 +105,6 @@ export const ui = (instance, opts, done) => {
104
105
  }
105
106
  break;
106
107
  case 'closed':
107
- console.log('closed', ctx.payload);
108
108
  instance.sdk.uiState.set({
109
109
  ...instance.sdk.uiState.get(),
110
110
  promotionNotification: false,
@@ -117,6 +117,7 @@ export const ui = (instance, opts, done) => {
117
117
  stage: 'deactivate',
118
118
  id,
119
119
  hasNotification,
120
+ hasBanner,
120
121
  isViewed,
121
122
  });
122
123
  break;
package/package.json CHANGED
@@ -7,11 +7,11 @@
7
7
  "@nanostores/query": "^0.2.10",
8
8
  "@streamlayer/sl-eslib": "^5.130.0",
9
9
  "nanostores": "^0.10.3",
10
- "@streamlayer/sdk-web-api": "^1.6.10",
11
- "@streamlayer/sdk-web-interfaces": "^1.2.10",
12
- "@streamlayer/sdk-web-logger": "^1.0.31",
13
- "@streamlayer/sdk-web-storage": "^1.0.31",
14
- "@streamlayer/sdk-web-types": "^1.8.4"
10
+ "@streamlayer/sdk-web-api": "^1.6.12",
11
+ "@streamlayer/sdk-web-interfaces": "^1.3.1",
12
+ "@streamlayer/sdk-web-logger": "^1.0.33",
13
+ "@streamlayer/sdk-web-storage": "^1.0.33",
14
+ "@streamlayer/sdk-web-types": "^1.8.6"
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.7.2",
43
+ "version": "1.8.1",
44
44
  "type": "module",
45
45
  "main": "./lib/index.js",
46
46
  "module": "./lib/index.js",