@jolibox/implement 1.1.40 → 1.1.41
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/.rush/temp/package-deps_build.json +6 -6
- package/dist/common/context/index.d.ts +1 -0
- package/dist/index.js +3 -3
- package/dist/index.native.js +8 -8
- package/implement.build.log +2 -2
- package/package.json +5 -5
- package/src/common/context/index.ts +3 -0
- package/src/h5/api/platformAdsHandle/DlightekAdsHandler.ts +1 -1
- package/src/h5/api/platformAdsHandle/HuaweiQuickAdsHandler.ts +12 -6
- package/src/h5/api/runtime.ts +6 -1
- package/src/native/api/runtime.ts +4 -0
package/implement.build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Invoking: npm run clean && npm run build:esm && tsc
|
|
2
2
|
|
|
3
|
-
> @jolibox/implement@1.1.
|
|
3
|
+
> @jolibox/implement@1.1.41 clean
|
|
4
4
|
> rimraf ./dist
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
> @jolibox/implement@1.1.
|
|
7
|
+
> @jolibox/implement@1.1.41 build:esm
|
|
8
8
|
> BUILD_VERSION=$(node -p "require('./package.json').version") node esbuild.config.js --format=esm
|
|
9
9
|
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jolibox/implement",
|
|
3
3
|
"description": "This project is Jolibox JS-SDk implement for Native && H5",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.41",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@jolibox/common": "1.1.
|
|
10
|
-
"@jolibox/types": "1.1.
|
|
11
|
-
"@jolibox/native-bridge": "1.1.
|
|
12
|
-
"@jolibox/ads": "1.1.
|
|
9
|
+
"@jolibox/common": "1.1.41",
|
|
10
|
+
"@jolibox/types": "1.1.41",
|
|
11
|
+
"@jolibox/native-bridge": "1.1.41",
|
|
12
|
+
"@jolibox/ads": "1.1.41",
|
|
13
13
|
"localforage": "1.10.0",
|
|
14
14
|
"@jolibox/ui": "1.0.0",
|
|
15
15
|
"web-vitals": "4.2.4"
|
|
@@ -75,6 +75,9 @@ const wrapContext = () => {
|
|
|
75
75
|
let shouldInterupt = payloadJson?.__shouldInterupt;
|
|
76
76
|
|
|
77
77
|
return {
|
|
78
|
+
get startTime(): number {
|
|
79
|
+
return performance.timeOrigin ?? performance.timing.navigationStart;
|
|
80
|
+
},
|
|
78
81
|
get testMode(): boolean {
|
|
79
82
|
return testMode; // TODO: true test mode
|
|
80
83
|
},
|
|
@@ -79,7 +79,7 @@ export default class HuaweiQuickAdsHandler implements IAdsHandler {
|
|
|
79
79
|
console.log(`HuaweiQuickAdsHandler,event => ${event}`);
|
|
80
80
|
if (event.origin != window.location.origin) return;
|
|
81
81
|
|
|
82
|
-
console.log(`data => ${event.data}`);
|
|
82
|
+
// console.log(`data => ${event.data}`);
|
|
83
83
|
|
|
84
84
|
if (event.data && event.data.type == null) {
|
|
85
85
|
const data = JSON.parse(event.data);
|
|
@@ -120,19 +120,25 @@ export default class HuaweiQuickAdsHandler implements IAdsHandler {
|
|
|
120
120
|
case 'viewed':
|
|
121
121
|
adsRes = 'viewed';
|
|
122
122
|
callbacks?.adViewed?.();
|
|
123
|
-
isBreakDone =
|
|
123
|
+
isBreakDone = false;
|
|
124
124
|
break;
|
|
125
125
|
case 'dismissed':
|
|
126
126
|
adsRes = 'dismissed';
|
|
127
127
|
callbacks?.adDismissed?.();
|
|
128
|
-
isBreakDone =
|
|
128
|
+
isBreakDone = false;
|
|
129
129
|
break;
|
|
130
|
+
case 'notReady':
|
|
131
|
+
case 'timeout':
|
|
130
132
|
case 'error':
|
|
131
|
-
|
|
133
|
+
case 'noAdPreloaded':
|
|
134
|
+
case 'frequencyCapped':
|
|
135
|
+
case 'ignored':
|
|
136
|
+
case 'other':
|
|
137
|
+
adsRes = data.adsRes;
|
|
132
138
|
isBreakDone = true;
|
|
133
139
|
break;
|
|
134
|
-
case '
|
|
135
|
-
adsRes =
|
|
140
|
+
case 'breakDone':
|
|
141
|
+
adsRes = data.params;
|
|
136
142
|
isBreakDone = true;
|
|
137
143
|
break;
|
|
138
144
|
|
package/src/h5/api/runtime.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { createCommands } from '@jolibox/common';
|
|
2
|
+
import { track } from '../report';
|
|
3
|
+
import { context } from '@/common/context';
|
|
2
4
|
|
|
3
5
|
const commands = createCommands();
|
|
4
6
|
|
|
5
7
|
commands.registerCommand('RuntimeSDK.loadFinishedEvent', () => {
|
|
6
|
-
|
|
8
|
+
const duration = performance.now();
|
|
9
|
+
track('loadFinished', {
|
|
10
|
+
duration
|
|
11
|
+
});
|
|
7
12
|
});
|
|
8
13
|
|
|
9
14
|
commands.registerCommand('RuntimeSDK.loadProgressEvent', (progress) => {
|
|
@@ -2,12 +2,16 @@ import { createCommands } from '@jolibox/common';
|
|
|
2
2
|
import { t, createSyncAPI } from './base';
|
|
3
3
|
import { emitNative } from '@jolibox/native-bridge';
|
|
4
4
|
import { context } from '@/common/context';
|
|
5
|
+
import { track } from '../report';
|
|
5
6
|
|
|
6
7
|
const commands = createCommands();
|
|
7
8
|
|
|
8
9
|
const onLoadFinished = createSyncAPI('onLoadFinished', {
|
|
9
10
|
implement: () => {
|
|
10
11
|
emitNative('cpLoadFinishEvent', {}, context.webviewId, true);
|
|
12
|
+
track('loadFinished', {
|
|
13
|
+
duration: performance.now()
|
|
14
|
+
});
|
|
11
15
|
}
|
|
12
16
|
});
|
|
13
17
|
|