@tarojs/router 3.6.23 → 3.6.24-nightly.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/dist/index.cjs.js CHANGED
@@ -720,6 +720,15 @@ function createMultiRouter(history, app, config, framework) {
720
720
  const page = runtime.createPageConfig(enablePullDownRefresh ? runtime.hooks.call('createPullDownComponent', el, pathName, framework, handler.PullDownRefresh) : el, pathName + runtime.stringify(launchParam), {}, loadConfig);
721
721
  handler.load(page, pageConfig);
722
722
  (_f = app.onShow) === null || _f === void 0 ? void 0 : _f.call(app, launchParam);
723
+ window.addEventListener('visibilitychange', () => {
724
+ var _a, _b;
725
+ if (document.visibilityState === 'visible') {
726
+ (_a = app.onShow) === null || _a === void 0 ? void 0 : _a.call(app, launchParam);
727
+ }
728
+ else {
729
+ (_b = app.onHide) === null || _b === void 0 ? void 0 : _b.call(app, launchParam);
730
+ }
731
+ });
723
732
  });
724
733
  }
725
734
 
@@ -1213,6 +1222,15 @@ function createRouter(history$1, app, config, framework) {
1213
1222
  }
1214
1223
  render({ location: history$1.location, action: history.Action.Push });
1215
1224
  (_b = app.onShow) === null || _b === void 0 ? void 0 : _b.call(app, launchParam);
1225
+ window.addEventListener('visibilitychange', () => {
1226
+ var _a, _b;
1227
+ if (document.visibilityState === 'visible') {
1228
+ (_a = app.onShow) === null || _a === void 0 ? void 0 : _a.call(app, launchParam);
1229
+ }
1230
+ else {
1231
+ (_b = app.onHide) === null || _b === void 0 ? void 0 : _b.call(app, launchParam);
1232
+ }
1233
+ });
1216
1234
  return history$1.listen(render);
1217
1235
  }
1218
1236
 
package/dist/index.esm.js CHANGED
@@ -719,6 +719,15 @@ function createMultiRouter(history, app, config, framework) {
719
719
  const page = createPageConfig(enablePullDownRefresh ? hooks.call('createPullDownComponent', el, pathName, framework, handler.PullDownRefresh) : el, pathName + stringify(launchParam), {}, loadConfig);
720
720
  handler.load(page, pageConfig);
721
721
  (_f = app.onShow) === null || _f === void 0 ? void 0 : _f.call(app, launchParam);
722
+ window.addEventListener('visibilitychange', () => {
723
+ var _a, _b;
724
+ if (document.visibilityState === 'visible') {
725
+ (_a = app.onShow) === null || _a === void 0 ? void 0 : _a.call(app, launchParam);
726
+ }
727
+ else {
728
+ (_b = app.onHide) === null || _b === void 0 ? void 0 : _b.call(app, launchParam);
729
+ }
730
+ });
722
731
  });
723
732
  }
724
733
 
@@ -1212,6 +1221,15 @@ function createRouter(history, app, config, framework) {
1212
1221
  }
1213
1222
  render({ location: history.location, action: Action.Push });
1214
1223
  (_b = app.onShow) === null || _b === void 0 ? void 0 : _b.call(app, launchParam);
1224
+ window.addEventListener('visibilitychange', () => {
1225
+ var _a, _b;
1226
+ if (document.visibilityState === 'visible') {
1227
+ (_a = app.onShow) === null || _a === void 0 ? void 0 : _a.call(app, launchParam);
1228
+ }
1229
+ else {
1230
+ (_b = app.onHide) === null || _b === void 0 ? void 0 : _b.call(app, launchParam);
1231
+ }
1232
+ });
1215
1233
  return history.listen(render);
1216
1234
  }
1217
1235
 
@@ -65,6 +65,15 @@ function createMultiRouter(history, app, config, framework) {
65
65
  const page = createPageConfig(enablePullDownRefresh ? hooks.call('createPullDownComponent', el, pathName, framework, handler.PullDownRefresh) : el, pathName + stringify(launchParam), {}, loadConfig);
66
66
  handler.load(page, pageConfig);
67
67
  (_f = app.onShow) === null || _f === void 0 ? void 0 : _f.call(app, launchParam);
68
+ window.addEventListener('visibilitychange', () => {
69
+ var _a, _b;
70
+ if (document.visibilityState === 'visible') {
71
+ (_a = app.onShow) === null || _a === void 0 ? void 0 : _a.call(app, launchParam);
72
+ }
73
+ else {
74
+ (_b = app.onHide) === null || _b === void 0 ? void 0 : _b.call(app, launchParam);
75
+ }
76
+ });
68
77
  });
69
78
  }
70
79
 
@@ -188,6 +188,15 @@ function createRouter(history, app, config, framework) {
188
188
  }
189
189
  render({ location: history.location, action: Action.Push });
190
190
  (_b = app.onShow) === null || _b === void 0 ? void 0 : _b.call(app, launchParam);
191
+ window.addEventListener('visibilitychange', () => {
192
+ var _a, _b;
193
+ if (document.visibilityState === 'visible') {
194
+ (_a = app.onShow) === null || _a === void 0 ? void 0 : _a.call(app, launchParam);
195
+ }
196
+ else {
197
+ (_b = app.onHide) === null || _b === void 0 ? void 0 : _b.call(app, launchParam);
198
+ }
199
+ });
191
200
  return history.listen(render);
192
201
  }
193
202
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tarojs/router",
3
- "version": "3.6.23",
3
+ "version": "3.6.24-nightly.1",
4
4
  "description": "Taro-router",
5
5
  "browser": "dist/index.js",
6
6
  "main:h5": "dist/index.esm.js",
@@ -44,12 +44,12 @@
44
44
  "rollup-plugin-ts": "^3.0.2",
45
45
  "ts-jest": "^29.0.5",
46
46
  "typescript": "^4.7.4",
47
- "@tarojs/runtime": "3.6.23",
48
- "@tarojs/taro": "3.6.23"
47
+ "@tarojs/runtime": "3.6.24-nightly.1",
48
+ "@tarojs/taro": "3.6.24-nightly.1"
49
49
  },
50
50
  "peerDependencies": {
51
- "@tarojs/runtime": "3.6.23",
52
- "@tarojs/taro": "3.6.23"
51
+ "@tarojs/runtime": "3.6.24-nightly.1",
52
+ "@tarojs/taro": "3.6.24-nightly.1"
53
53
  },
54
54
  "scripts": {
55
55
  "prebuild": "pnpm run clean",