@jskit-ai/google-rewarded-web 0.1.95 → 0.1.97
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jskit-ai/google-rewarded-web",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.97",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./src/index.js",
|
|
@@ -37,37 +37,14 @@
|
|
|
37
37
|
"subpath": "./client",
|
|
38
38
|
"summary": "Exports the Google rewarded client provider, runtime composable, and fullscreen gate host."
|
|
39
39
|
}
|
|
40
|
-
]
|
|
41
|
-
"containerTokens": {
|
|
42
|
-
"server": [],
|
|
43
|
-
"client": [
|
|
44
|
-
"google-rewarded.web.runtime"
|
|
45
|
-
]
|
|
46
|
-
}
|
|
40
|
+
]
|
|
47
41
|
}
|
|
48
|
-
},
|
|
49
|
-
"mutations": {
|
|
50
|
-
"dependencies": {
|
|
51
|
-
"runtime": {
|
|
52
|
-
"@jskit-ai/google-rewarded-core": "0.1.95",
|
|
53
|
-
"@jskit-ai/http-runtime": "0.1.157",
|
|
54
|
-
"@jskit-ai/kernel": "0.1.159",
|
|
55
|
-
"@jskit-ai/shell-web": "0.1.163"
|
|
56
|
-
},
|
|
57
|
-
"dev": {}
|
|
58
|
-
},
|
|
59
|
-
"packageJson": {
|
|
60
|
-
"scripts": {}
|
|
61
|
-
},
|
|
62
|
-
"procfile": {},
|
|
63
|
-
"text": [],
|
|
64
|
-
"files": []
|
|
65
42
|
}
|
|
66
43
|
},
|
|
67
44
|
"dependencies": {
|
|
68
|
-
"@jskit-ai/google-rewarded-core": "0.1.
|
|
69
|
-
"@jskit-ai/http-runtime": "0.1.
|
|
70
|
-
"@jskit-ai/kernel": "0.1.
|
|
71
|
-
"@jskit-ai/shell-web": "0.1.
|
|
45
|
+
"@jskit-ai/google-rewarded-core": "0.1.97",
|
|
46
|
+
"@jskit-ai/http-runtime": "0.1.159",
|
|
47
|
+
"@jskit-ai/kernel": "0.1.161",
|
|
48
|
+
"@jskit-ai/shell-web": "0.1.165"
|
|
72
49
|
}
|
|
73
50
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { defineProvider } from "@jskit-ai/kernel/shared/capabilities";
|
|
1
2
|
import { h, render } from "vue";
|
|
2
3
|
import GoogleRewardedGateHost from "../components/GoogleRewardedGateHost.vue";
|
|
3
4
|
import {
|
|
@@ -5,53 +6,53 @@ import {
|
|
|
5
6
|
createGoogleRewardedRuntime
|
|
6
7
|
} from "../runtime/googleRewardedRuntime.js";
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (
|
|
9
|
+
const mountedHosts = new WeakMap();
|
|
10
|
+
|
|
11
|
+
const GoogleRewardedClientProvider = defineProvider({
|
|
12
|
+
id: "google-rewarded.web.client",
|
|
13
|
+
requires: {
|
|
14
|
+
vueApp: "client.vue"
|
|
15
|
+
},
|
|
16
|
+
provides: {
|
|
17
|
+
googleRewarded: "client.google-rewarded"
|
|
18
|
+
},
|
|
19
|
+
setup() {
|
|
20
|
+
return {
|
|
21
|
+
googleRewarded: createGoogleRewardedRuntime()
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
async boot({ vueApp }, { outputs }) {
|
|
25
|
+
if (typeof document === "undefined") {
|
|
25
26
|
return;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
|
-
const
|
|
29
|
-
const runtime = app.make("google-rewarded.web.runtime");
|
|
29
|
+
const runtime = outputs.googleRewarded;
|
|
30
30
|
|
|
31
31
|
if (vueApp && typeof vueApp.provide === "function") {
|
|
32
32
|
vueApp.provide(GOOGLE_REWARDED_RUNTIME_INJECTION_KEY, runtime);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
document.body.appendChild(
|
|
35
|
+
const hostContainer = document.createElement("div");
|
|
36
|
+
hostContainer.dataset.jskitGoogleRewardedHost = "true";
|
|
37
|
+
document.body.appendChild(hostContainer);
|
|
38
38
|
|
|
39
39
|
const vnode = h(GoogleRewardedGateHost, {
|
|
40
40
|
runtime
|
|
41
41
|
});
|
|
42
42
|
vnode.appContext = vueApp?._context || null;
|
|
43
|
-
render(vnode,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
shutdown() {
|
|
47
|
-
|
|
43
|
+
render(vnode, hostContainer);
|
|
44
|
+
mountedHosts.set(runtime, hostContainer);
|
|
45
|
+
},
|
|
46
|
+
shutdown(_dependencies, { outputs }) {
|
|
47
|
+
const hostContainer = mountedHosts.get(outputs.googleRewarded);
|
|
48
|
+
if (!hostContainer) {
|
|
48
49
|
return;
|
|
49
50
|
}
|
|
50
51
|
|
|
51
|
-
render(null,
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
render(null, hostContainer);
|
|
53
|
+
hostContainer.remove();
|
|
54
|
+
mountedHosts.delete(outputs.googleRewarded);
|
|
54
55
|
}
|
|
55
|
-
}
|
|
56
|
+
});
|
|
56
57
|
|
|
57
58
|
export { GoogleRewardedClientProvider };
|