@streamlayer/feature-gamification 1.10.1 → 1.11.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.
@@ -28,6 +28,9 @@ import { processGamAdvertisement } from './externalAd';
28
28
  // const manager = await nonceLoader.loadNonceManager(request)
29
29
  // return manager.getNonce()
30
30
  // }
31
+ const adHasBanner = (data) => (data?.promotion?.type === PromotionType.INGAME_IAB11_LBAR ||
32
+ data?.promotion?.type === PromotionType.INGAME_IAB21_LBAR) &&
33
+ !!data.promotion.additionalBanner?.imageUrl;
31
34
  /**
32
35
  * @name Advertisement
33
36
  * @description advertisement functionality, show, hide
@@ -58,6 +61,7 @@ export const advertisement = ($slStreamId, $feedSubscription, instance) => {
58
61
  payload: {
59
62
  id,
60
63
  type,
64
+ hasBanner: adHasBanner(payload.data),
61
65
  },
62
66
  });
63
67
  }
@@ -76,6 +80,7 @@ export const advertisement = ($slStreamId, $feedSubscription, instance) => {
76
80
  payload: {
77
81
  id,
78
82
  type,
83
+ hasBanner: adHasBanner(payload.data),
79
84
  },
80
85
  });
81
86
  }
@@ -133,6 +138,7 @@ export const advertisement = ($slStreamId, $feedSubscription, instance) => {
133
138
  id: active.data.question.id,
134
139
  type: active.data.promotion.type,
135
140
  hasNotification: !!active.hasNotification,
141
+ hasBanner: adHasBanner(active.data),
136
142
  isViewed: !!storage.isViewed(active.data.question.id),
137
143
  },
138
144
  skipAnalytics: active.data.question.id === prevActive?.data?.question.id,
@@ -145,6 +151,7 @@ export const advertisement = ($slStreamId, $feedSubscription, instance) => {
145
151
  id: prevActive.data.question.id,
146
152
  type: prevActive.data.promotion?.type,
147
153
  hasNotification: !!prevActive.hasNotification,
154
+ hasBanner: adHasBanner(prevActive.data),
148
155
  isViewed: !!storage.isViewed(prevActive.data.question.id),
149
156
  },
150
157
  });
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@streamlayer/feature-gamification",
3
- "version": "1.10.1",
3
+ "version": "1.11.1",
4
4
  "peerDependencies": {
5
5
  "@bufbuild/protobuf": "^1.10.0",
6
6
  "@fastify/deepmerge": "^2.0.0",
7
7
  "@streamlayer/sl-eslib": "^5.130.0",
8
8
  "nanostores": "^0.10.3",
9
- "@streamlayer/sdk-web-api": "^1.6.10",
10
- "@streamlayer/sdk-web-core": "^1.7.2",
11
- "@streamlayer/sdk-web-interfaces": "^1.2.10",
12
- "@streamlayer/sdk-web-logger": "^1.0.31",
13
- "@streamlayer/sdk-web-notifications": "^1.2.10",
14
- "@streamlayer/sdk-web-storage": "^1.0.31",
15
- "@streamlayer/sdk-web-types": "^1.8.4"
9
+ "@streamlayer/sdk-web-api": "^1.6.12",
10
+ "@streamlayer/sdk-web-core": "^1.8.1",
11
+ "@streamlayer/sdk-web-logger": "^1.0.33",
12
+ "@streamlayer/sdk-web-notifications": "^1.2.12",
13
+ "@streamlayer/sdk-web-interfaces": "^1.3.1",
14
+ "@streamlayer/sdk-web-storage": "^1.0.33",
15
+ "@streamlayer/sdk-web-types": "^1.8.6"
16
16
  },
17
17
  "devDependencies": {
18
18
  "tslib": "^2.7.0"