@jolibox/ads 1.1.45 → 1.1.47
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/dist/afg/googlegpt/type.d.ts +2 -2
- package/dist/index.js +31 -22
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -898,7 +898,7 @@ class In {
|
|
|
898
898
|
const e = "google-adsense", i = (n = this.contextInfo.testAdsMode) != null ? n : !1;
|
|
899
899
|
if (!document.getElementById(e) && this.initParams.clientId) {
|
|
900
900
|
const r = document.createElement("script");
|
|
901
|
-
r.id = e, r.async = !0, r.crossOrigin = "anonymous", r.src = `https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${this.initParams.clientId}`, i && r.setAttribute("data-adbreak-test", "on"), this.initParams.channelId && r.setAttribute("data-ad-channel", this.initParams.channelId), this.initParams.admobInterstitialSlot &&
|
|
901
|
+
r.id = e, r.async = !0, r.crossOrigin = "anonymous", r.src = `https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${this.initParams.clientId}`, i && r.setAttribute("data-adbreak-test", "on"), this.initParams.channelId && r.setAttribute("data-ad-channel", this.initParams.channelId), this.initParams.admobInterstitialSlot && r.setAttribute("data-admob-interstitial-slot", this.initParams.admobInterstitialSlot), this.initParams.admobRewardedSlot && r.setAttribute("data-admob-rewarded-slot", this.initParams.admobRewardedSlot), this.initParams.admobOnly && r.setAttribute("data-admob-ads-only", "on"), document.head.appendChild(r), this.context.track("LoadAdsenseCompleted", null);
|
|
902
902
|
}
|
|
903
903
|
}
|
|
904
904
|
}
|
|
@@ -3144,24 +3144,15 @@ class Hr {
|
|
|
3144
3144
|
}
|
|
3145
3145
|
async init() {
|
|
3146
3146
|
const e = this.contextInfo.testAdsMode ? "/22639388115/rewarded_web_example" : this.initParams.rewardedSlot, i = this.contextInfo.testAdsMode ? "/6355419/Travel/Europe/France/Paris" : this.initParams.interstitialSlot, r = `minigame-${this.contextInfo.runtimeType === "APP" ? "app" : "h5"}`;
|
|
3147
|
-
this.rewardAdManager = new Ii(e, r, this.initParams.keyValue), this.interstitialManager = new zr(i, r, this.initParams.keyValue);
|
|
3147
|
+
e && (this.rewardAdManager = new Ii(e, r, this.initParams.keyValue)), i && (this.interstitialManager = new zr(i, r, this.initParams.keyValue));
|
|
3148
3148
|
}
|
|
3149
3149
|
adConfig(e, i) {
|
|
3150
3150
|
}
|
|
3151
3151
|
adBreak(e, i) {
|
|
3152
|
-
var n, r;
|
|
3153
|
-
if (!this.rewardAdManager || !this.interstitialManager) {
|
|
3154
|
-
(n = e.adBreakDone) == null || n.call(e, {
|
|
3155
|
-
breakName: e.type === "preroll" ? "" : e.name,
|
|
3156
|
-
breakType: e.type,
|
|
3157
|
-
breakFormat: e.type === "reward" ? "reward" : "interstitial",
|
|
3158
|
-
breakStatus: "error"
|
|
3159
|
-
});
|
|
3160
|
-
return;
|
|
3161
|
-
}
|
|
3152
|
+
var n, r, o;
|
|
3162
3153
|
switch (e.type) {
|
|
3163
3154
|
case "preroll": {
|
|
3164
|
-
(
|
|
3155
|
+
(n = e.adBreakDone) == null || n.call(e, {
|
|
3165
3156
|
breakType: "preroll",
|
|
3166
3157
|
breakFormat: "interstitial",
|
|
3167
3158
|
breakStatus: "noAdPreloaded"
|
|
@@ -3169,35 +3160,53 @@ class Hr {
|
|
|
3169
3160
|
break;
|
|
3170
3161
|
}
|
|
3171
3162
|
case "reward": {
|
|
3163
|
+
if (!this.rewardAdManager) {
|
|
3164
|
+
(r = e.adBreakDone) == null || r.call(e, {
|
|
3165
|
+
breakName: e.name,
|
|
3166
|
+
breakType: e.type,
|
|
3167
|
+
breakFormat: e.type === "reward" ? "reward" : "interstitial",
|
|
3168
|
+
breakStatus: "noAdPreloaded"
|
|
3169
|
+
});
|
|
3170
|
+
return;
|
|
3171
|
+
}
|
|
3172
3172
|
this.rewardAdManager.requestAds({
|
|
3173
3173
|
beforeAd: e.beforeAd,
|
|
3174
3174
|
afterAd: e.afterAd,
|
|
3175
3175
|
adDismissed: e.adDismissed,
|
|
3176
3176
|
adViewed: e.adViewed,
|
|
3177
3177
|
beforeReward: e.beforeReward,
|
|
3178
|
-
adBreakDone: (
|
|
3179
|
-
var
|
|
3180
|
-
(
|
|
3178
|
+
adBreakDone: (s) => {
|
|
3179
|
+
var a;
|
|
3180
|
+
(a = e.adBreakDone) == null || a.call(e, {
|
|
3181
3181
|
breakName: e.name,
|
|
3182
3182
|
breakType: e.type,
|
|
3183
3183
|
breakFormat: "reward",
|
|
3184
|
-
breakStatus:
|
|
3184
|
+
breakStatus: s
|
|
3185
3185
|
});
|
|
3186
3186
|
}
|
|
3187
3187
|
});
|
|
3188
3188
|
break;
|
|
3189
3189
|
}
|
|
3190
3190
|
default: {
|
|
3191
|
+
if (!this.interstitialManager) {
|
|
3192
|
+
(o = e.adBreakDone) == null || o.call(e, {
|
|
3193
|
+
breakName: e.name,
|
|
3194
|
+
breakType: e.type,
|
|
3195
|
+
breakFormat: "interstitial",
|
|
3196
|
+
breakStatus: "noAdPreloaded"
|
|
3197
|
+
});
|
|
3198
|
+
return;
|
|
3199
|
+
}
|
|
3191
3200
|
this.interstitialManager.requestAds({
|
|
3192
3201
|
beforeAd: e.beforeAd,
|
|
3193
3202
|
afterAd: e.afterAd,
|
|
3194
|
-
onEnd: (
|
|
3195
|
-
var
|
|
3196
|
-
(
|
|
3203
|
+
onEnd: (s) => {
|
|
3204
|
+
var a;
|
|
3205
|
+
(a = e.adBreakDone) == null || a.call(e, {
|
|
3197
3206
|
breakName: e.name,
|
|
3198
3207
|
breakType: e.type,
|
|
3199
3208
|
breakFormat: "interstitial",
|
|
3200
|
-
breakStatus:
|
|
3209
|
+
breakStatus: s
|
|
3201
3210
|
});
|
|
3202
3211
|
}
|
|
3203
3212
|
});
|
|
@@ -3966,7 +3975,7 @@ class bo {
|
|
|
3966
3975
|
constructor(e) {
|
|
3967
3976
|
te(this, "name", "GOOGLE_GPT"), te(this, "context", void 0), te(this, "contextInfo", void 0), te(this, "rewardAdManager", void 0), te(this, "init", async (i) => {
|
|
3968
3977
|
if (!this.rewardAdManager) {
|
|
3969
|
-
const n = this.contextInfo.testAdsMode ? "/22639388115/rewarded_web_example" : i.params.rewardedSlot, o = `
|
|
3978
|
+
const n = this.contextInfo.testAdsMode ? "/22639388115/rewarded_web_example" : i.params.rewardedSlot, o = `minidrama-${this.contextInfo.runtimeType === "APP" ? "app" : "h5"}`;
|
|
3970
3979
|
this.rewardAdManager = new Ii(n, o, i.params.keyValue);
|
|
3971
3980
|
}
|
|
3972
3981
|
}), te(this, "insertScript", () => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jolibox/ads",
|
|
3
3
|
"description": "This project is for integrating Jolibox ads providers",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.47",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
7
7
|
"type": "module",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
],
|
|
13
13
|
"types": "./dist/index.d.ts",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@jolibox/common": "1.1.
|
|
15
|
+
"@jolibox/common": "1.1.47",
|
|
16
16
|
"@emotion/css": "11.13.5",
|
|
17
|
-
"@jolibox/types": "1.1.
|
|
17
|
+
"@jolibox/types": "1.1.47",
|
|
18
18
|
"preact": "10.26.4",
|
|
19
19
|
"@preact/signals": "2.0.4"
|
|
20
20
|
},
|