@micro-zoe/micro-app 0.8.8 → 0.8.9

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/lib/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- const version = '0.8.8';
1
+ const version = '0.8.9';
2
2
  // do not use isUndefined
3
3
  const isBrowser = typeof window !== 'undefined';
4
4
  // do not use isUndefined
@@ -2581,20 +2581,22 @@ class SandBox {
2581
2581
  }
2582
2582
  }
2583
2583
  }
2584
- stop() {
2584
+ stop(umdMode) {
2585
2585
  if (this.active) {
2586
2586
  this.active = false;
2587
2587
  this.releaseEffect();
2588
2588
  this.microAppWindow.microApp.clearDataListener();
2589
2589
  this.microAppWindow.microApp.clearGlobalDataListener();
2590
- this.injectedKeys.forEach((key) => {
2591
- Reflect.deleteProperty(this.microAppWindow, key);
2592
- });
2593
- this.injectedKeys.clear();
2594
- this.escapeKeys.forEach((key) => {
2595
- Reflect.deleteProperty(globalEnv.rawWindow, key);
2596
- });
2597
- this.escapeKeys.clear();
2590
+ if (!umdMode) {
2591
+ this.injectedKeys.forEach((key) => {
2592
+ Reflect.deleteProperty(this.microAppWindow, key);
2593
+ });
2594
+ this.injectedKeys.clear();
2595
+ this.escapeKeys.forEach((key) => {
2596
+ Reflect.deleteProperty(globalEnv.rawWindow, key);
2597
+ });
2598
+ this.escapeKeys.clear();
2599
+ }
2598
2600
  if (--SandBox.activeCount === 0) {
2599
2601
  releaseEffectDocumentEvent();
2600
2602
  releasePatches();
@@ -3098,7 +3100,7 @@ class CreateApp {
3098
3100
  cloneContainer(this.container, this.source.html, false);
3099
3101
  }
3100
3102
  // this.container maybe contains micro-app element, stop sandbox should exec after cloneContainer
3101
- (_a = this.sandBox) === null || _a === void 0 ? void 0 : _a.stop();
3103
+ (_a = this.sandBox) === null || _a === void 0 ? void 0 : _a.stop(this.umdMode);
3102
3104
  if (!getActiveApps().length) {
3103
3105
  releasePatchSetAttribute();
3104
3106
  }