@worktile/planet 12.1.0 → 13.0.0
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/application/planet-application-loader.d.ts +3 -0
- package/application/planet-application-loader.d.ts.map +1 -1
- package/application/planet-application-ref.d.ts +8 -8
- package/application/planet-application-ref.d.ts.map +1 -1
- package/application/planet-application.service.d.ts +4 -1
- package/application/planet-application.service.d.ts.map +1 -1
- package/application/portal-application.d.ts +6 -6
- package/application/portal-application.d.ts.map +1 -1
- package/assets-loader.d.ts +3 -0
- package/assets-loader.d.ts.map +1 -1
- package/component/planet-component-loader.d.ts +3 -0
- package/component/planet-component-loader.d.ts.map +1 -1
- package/empty/empty.component.d.ts +3 -0
- package/empty/empty.component.d.ts.map +1 -1
- package/esm2020/application/planet-application-loader.mjs +454 -0
- package/esm2020/application/planet-application-ref.mjs +94 -0
- package/esm2020/application/planet-application.service.mjs +85 -0
- package/esm2020/application/portal-application.mjs +16 -0
- package/{esm2015/assets-loader.js → esm2020/assets-loader.mjs} +9 -10
- package/esm2020/component/planet-component-loader.mjs +153 -0
- package/{esm2015/component/planet-component-ref.js → esm2020/component/planet-component-ref.mjs} +0 -0
- package/{esm2015/component/plant-component.config.js → esm2020/component/plant-component.config.mjs} +0 -0
- package/esm2020/debug.mjs +33 -0
- package/esm2020/empty/empty.component.mjs +15 -0
- package/{esm2015/global-event-dispatcher.js → esm2020/global-event-dispatcher.mjs} +9 -10
- package/esm2020/global-planet.mjs +53 -0
- package/esm2020/helpers.mjs +119 -0
- package/esm2020/module.mjs +31 -0
- package/{esm2015/planet.class.js → esm2020/planet.class.mjs} +0 -0
- package/esm2020/planet.mjs +91 -0
- package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
- package/{esm2015/sandbox/constants.js → esm2020/sandbox/constants.mjs} +0 -0
- package/{esm2015/sandbox/exec.js → esm2020/sandbox/exec.mjs} +0 -0
- package/{esm2015/sandbox/index.js → esm2020/sandbox/index.mjs} +0 -0
- package/{esm2015/sandbox/proxy/patches/document.js → esm2020/sandbox/proxy/patches/document.mjs} +0 -0
- package/{esm2015/sandbox/proxy/patches/eventListener.js → esm2020/sandbox/proxy/patches/eventListener.mjs} +0 -0
- package/{esm2015/sandbox/proxy/patches/index.js → esm2020/sandbox/proxy/patches/index.mjs} +0 -0
- package/{esm2015/sandbox/proxy/patches/storage.js → esm2020/sandbox/proxy/patches/storage.mjs} +0 -0
- package/{esm2015/sandbox/proxy/patches/timer.js → esm2020/sandbox/proxy/patches/timer.mjs} +0 -0
- package/esm2020/sandbox/proxy/proxies/common.mjs +132 -0
- package/esm2020/sandbox/proxy/proxies/document.mjs +126 -0
- package/esm2020/sandbox/proxy/proxies/window.mjs +158 -0
- package/{esm2015/sandbox/proxy/proxy-sandbox.js → esm2020/sandbox/proxy/proxy-sandbox.mjs} +2 -2
- package/{esm2015/sandbox/proxy/types.js → esm2020/sandbox/proxy/types.mjs} +0 -0
- package/esm2020/sandbox/sandbox.mjs +7 -0
- package/{esm2015/sandbox/snapshot/snapshot-sandbox.js → esm2020/sandbox/snapshot/snapshot-sandbox.mjs} +0 -0
- package/{esm2015/sandbox/types.js → esm2020/sandbox/types.mjs} +0 -0
- package/esm2020/worktile-planet.mjs +5 -0
- package/fesm2015/worktile-planet.mjs +2049 -0
- package/fesm2015/worktile-planet.mjs.map +1 -0
- package/{fesm2015/worktile-planet.js → fesm2020/worktile-planet.mjs} +129 -119
- package/fesm2020/worktile-planet.mjs.map +1 -0
- package/global-event-dispatcher.d.ts +3 -0
- package/global-event-dispatcher.d.ts.map +1 -1
- package/global-planet.d.ts +3 -3
- package/global-planet.d.ts.map +1 -1
- package/helpers.d.ts +1 -1
- package/helpers.d.ts.map +1 -1
- package/module.d.ts +6 -0
- package/module.d.ts.map +1 -1
- package/package.json +28 -12
- package/planet.d.ts +4 -1
- package/planet.d.ts.map +1 -1
- package/sandbox/proxy/proxy-sandbox.d.ts.map +1 -1
- package/sandbox/sandbox.d.ts.map +1 -1
- package/worktile-planet.d.ts +1 -1
- package/worktile-planet.d.ts.map +1 -1
- package/application/planet-application-loader.ngfactory.d.ts.map +0 -1
- package/application/planet-application.service.ngfactory.d.ts.map +0 -1
- package/assets-loader.ngfactory.d.ts.map +0 -1
- package/bundles/worktile-planet.umd.js +0 -2552
- package/bundles/worktile-planet.umd.js.map +0 -1
- package/component/planet-component-loader.ngfactory.d.ts.map +0 -1
- package/empty/empty.component.ngfactory.d.ts.map +0 -1
- package/esm2015/application/planet-application-loader.js +0 -452
- package/esm2015/application/planet-application-ref.js +0 -94
- package/esm2015/application/planet-application.service.js +0 -87
- package/esm2015/application/portal-application.js +0 -16
- package/esm2015/component/planet-component-loader.js +0 -155
- package/esm2015/debug.js +0 -33
- package/esm2015/empty/empty.component.js +0 -10
- package/esm2015/global-planet.js +0 -51
- package/esm2015/helpers.js +0 -119
- package/esm2015/module.js +0 -27
- package/esm2015/planet.js +0 -90
- package/esm2015/sandbox/proxy/proxies/common.js +0 -132
- package/esm2015/sandbox/proxy/proxies/document.js +0 -126
- package/esm2015/sandbox/proxy/proxies/window.js +0 -155
- package/esm2015/sandbox/sandbox.js +0 -7
- package/esm2015/worktile-planet.js +0 -6
- package/fesm2015/worktile-planet.js.map +0 -1
- package/global-event-dispatcher.ngfactory.d.ts.map +0 -1
- package/module.ngfactory.d.ts.map +0 -1
- package/planet.ngfactory.d.ts.map +0 -1
- package/worktile-planet.metadata.json +0 -1
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, Injectable, NgZone,
|
|
2
|
+
import { InjectionToken, Injectable, NgZone, Inject, Optional, Component, NgModule } from '@angular/core';
|
|
3
3
|
import * as i3 from '@angular/router';
|
|
4
4
|
import { Router, NavigationEnd } from '@angular/router';
|
|
5
5
|
import * as i1 from '@angular/common/http';
|
|
6
|
-
import {
|
|
6
|
+
import { HttpClientModule } from '@angular/common/http';
|
|
7
7
|
import { map, concatAll, switchMap, take, shareReplay, filter, distinctUntilChanged, catchError, tap, share, startWith, delayWhen } from 'rxjs/operators';
|
|
8
8
|
import { Observable, of, concat, forkJoin, from, Subject, timer } from 'rxjs';
|
|
9
9
|
import { PortalInjector, DomPortalOutlet, ComponentPortal } from '@angular/cdk/portal';
|
|
10
|
-
import * as i1$1 from '@angular/common';
|
|
11
10
|
import { DOCUMENT } from '@angular/common';
|
|
12
11
|
|
|
13
12
|
var SwitchModes;
|
|
@@ -41,14 +40,14 @@ function getHTMLElement(selector) {
|
|
|
41
40
|
}
|
|
42
41
|
function getTagNameByTemplate(template) {
|
|
43
42
|
const element = createElementByTemplate(template);
|
|
44
|
-
return element ? element.nodeName :
|
|
43
|
+
return element ? element.nodeName : '';
|
|
45
44
|
}
|
|
46
45
|
function createElementByTemplate(template) {
|
|
47
46
|
if (!template) {
|
|
48
47
|
return null;
|
|
49
48
|
}
|
|
50
49
|
const element = document.createRange().createContextualFragment(template).firstChild;
|
|
51
|
-
if (element.nodeType === ELEMENT_NODE_TYPE) {
|
|
50
|
+
if (element && element.nodeType === ELEMENT_NODE_TYPE) {
|
|
52
51
|
return element;
|
|
53
52
|
}
|
|
54
53
|
else {
|
|
@@ -233,7 +232,7 @@ function createFakeObject(target, writableKeys) {
|
|
|
233
232
|
const propertyNames = Object.getOwnPropertyNames(target);
|
|
234
233
|
const def = (p) => {
|
|
235
234
|
const descriptor = Object.getOwnPropertyDescriptor(target, p);
|
|
236
|
-
if (descriptor
|
|
235
|
+
if (descriptor?.configurable) {
|
|
237
236
|
const hasGetter = hasOwnProp(descriptor, 'get');
|
|
238
237
|
const hasSetter = hasOwnProp(descriptor, 'set');
|
|
239
238
|
const canWritable = writableKeys && writableKeys.length > 0 && writableKeys.includes(p);
|
|
@@ -351,7 +350,7 @@ class ProxyWindow {
|
|
|
351
350
|
createSetter() {
|
|
352
351
|
return (target, key, value, receiver) => {
|
|
353
352
|
const desc = Object.getOwnPropertyDescriptor(whitelistVariables.includes(key) ? window : receiver ? receiver : target, key);
|
|
354
|
-
if (isNonWriteableValue(desc)) {
|
|
353
|
+
if (desc && isNonWriteableValue(desc)) {
|
|
355
354
|
if (!Object.is(value, desc.value)) {
|
|
356
355
|
return false;
|
|
357
356
|
}
|
|
@@ -414,7 +413,10 @@ class ProxyWindow {
|
|
|
414
413
|
defineProperty: this.createDefineProperty(),
|
|
415
414
|
deleteProperty: this.createDeleteProperty()
|
|
416
415
|
};
|
|
417
|
-
const proxy = new Proxy(fakeWindow,
|
|
416
|
+
const proxy = new Proxy(fakeWindow, {
|
|
417
|
+
...baseHandlers,
|
|
418
|
+
has: this.createHas()
|
|
419
|
+
});
|
|
418
420
|
const subProxy = new Proxy(fakeWindow, baseHandlers);
|
|
419
421
|
proxy.self = subProxy;
|
|
420
422
|
proxy.window = subProxy;
|
|
@@ -491,7 +493,7 @@ class ProxyDocument {
|
|
|
491
493
|
newValue = bind(value, document);
|
|
492
494
|
}
|
|
493
495
|
const desc = Object.getOwnPropertyDescriptor(target, p);
|
|
494
|
-
if (isNonWriteableValue(desc)) {
|
|
496
|
+
if (desc && isNonWriteableValue(desc)) {
|
|
495
497
|
if (!Object.is(newValue, desc.value)) {
|
|
496
498
|
return value;
|
|
497
499
|
}
|
|
@@ -508,7 +510,7 @@ class ProxyDocument {
|
|
|
508
510
|
createSetter() {
|
|
509
511
|
return (target, p, value, receiver) => {
|
|
510
512
|
const desc = Object.getOwnPropertyDescriptor(whitelist.includes(p) ? document : receiver || target, p);
|
|
511
|
-
if (isNonWriteableValue(desc)) {
|
|
513
|
+
if (desc && isNonWriteableValue(desc)) {
|
|
512
514
|
if (Object.is(value, desc.value)) {
|
|
513
515
|
return true;
|
|
514
516
|
}
|
|
@@ -706,7 +708,7 @@ function execScript(code, url, global, strictGlobal) {
|
|
|
706
708
|
|
|
707
709
|
class Sandbox {
|
|
708
710
|
execScript(code, url = '') {
|
|
709
|
-
execScript(code, url, this.global, this.options.strictGlobal);
|
|
711
|
+
execScript(code, url, this.global, !!this.options.strictGlobal);
|
|
710
712
|
}
|
|
711
713
|
}
|
|
712
714
|
|
|
@@ -750,7 +752,7 @@ class ProxySandbox extends Sandbox {
|
|
|
750
752
|
}
|
|
751
753
|
}
|
|
752
754
|
if (handler.init) {
|
|
753
|
-
handler
|
|
755
|
+
handler?.init();
|
|
754
756
|
}
|
|
755
757
|
});
|
|
756
758
|
}
|
|
@@ -982,22 +984,21 @@ class AssetsLoader {
|
|
|
982
984
|
}));
|
|
983
985
|
}
|
|
984
986
|
}
|
|
985
|
-
AssetsLoader.ɵ
|
|
986
|
-
AssetsLoader
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
];
|
|
987
|
+
AssetsLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: AssetsLoader, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
988
|
+
AssetsLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: AssetsLoader, providedIn: 'root' });
|
|
989
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: AssetsLoader, decorators: [{
|
|
990
|
+
type: Injectable,
|
|
991
|
+
args: [{
|
|
992
|
+
providedIn: 'root'
|
|
993
|
+
}]
|
|
994
|
+
}], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
|
|
994
995
|
|
|
995
996
|
class PlanetApplicationRef {
|
|
996
997
|
constructor(name, options) {
|
|
997
998
|
this.name = name;
|
|
998
999
|
if (options) {
|
|
999
1000
|
this.template = options.template;
|
|
1000
|
-
this.innerSelector = this.template ? getTagNameByTemplate(this.template) :
|
|
1001
|
+
this.innerSelector = this.template ? getTagNameByTemplate(this.template) : '';
|
|
1001
1002
|
this.appModuleBootstrap = options.bootstrap;
|
|
1002
1003
|
}
|
|
1003
1004
|
// This is a hack, since NgZone doesn't allow you to configure the property that identifies your zone.
|
|
@@ -1014,18 +1015,18 @@ class PlanetApplicationRef {
|
|
|
1014
1015
|
return !!this.appModuleRef;
|
|
1015
1016
|
}
|
|
1016
1017
|
get ngZone() {
|
|
1017
|
-
return this.appModuleRef
|
|
1018
|
+
return this.appModuleRef?.injector.get(NgZone);
|
|
1018
1019
|
}
|
|
1019
1020
|
get sandbox() {
|
|
1020
1021
|
return getSandboxInstance();
|
|
1021
1022
|
}
|
|
1022
1023
|
// 子应用路由变化后同步修改 portal 的 Route
|
|
1023
1024
|
syncPortalRouteWhenNavigationEnd() {
|
|
1024
|
-
const router = this.appModuleRef
|
|
1025
|
+
const router = this.appModuleRef?.injector.get(Router);
|
|
1025
1026
|
if (router) {
|
|
1026
1027
|
router.events.subscribe(event => {
|
|
1027
1028
|
if (event instanceof NavigationEnd) {
|
|
1028
|
-
this.ngZone
|
|
1029
|
+
this.ngZone?.onStable
|
|
1029
1030
|
.asObservable()
|
|
1030
1031
|
.pipe(take(1))
|
|
1031
1032
|
.subscribe(() => {
|
|
@@ -1048,15 +1049,15 @@ class PlanetApplicationRef {
|
|
|
1048
1049
|
}));
|
|
1049
1050
|
}
|
|
1050
1051
|
getRouter() {
|
|
1051
|
-
return this.appModuleRef
|
|
1052
|
+
return this.appModuleRef?.injector.get(Router);
|
|
1052
1053
|
}
|
|
1053
1054
|
getCurrentRouterStateUrl() {
|
|
1054
|
-
return this.getRouter()
|
|
1055
|
+
return this.getRouter()?.routerState.snapshot.url;
|
|
1055
1056
|
}
|
|
1056
1057
|
navigateByUrl(url) {
|
|
1057
1058
|
const router = this.getRouter();
|
|
1058
|
-
this.ngZone
|
|
1059
|
-
router
|
|
1059
|
+
this.ngZone?.run(() => {
|
|
1060
|
+
router?.navigateByUrl(url);
|
|
1060
1061
|
});
|
|
1061
1062
|
}
|
|
1062
1063
|
getComponentFactory() {
|
|
@@ -1075,7 +1076,7 @@ class PlanetApplicationRef {
|
|
|
1075
1076
|
this.sandbox.destroy();
|
|
1076
1077
|
}
|
|
1077
1078
|
this.appModuleRef.destroy();
|
|
1078
|
-
|
|
1079
|
+
this.appModuleRef = undefined;
|
|
1079
1080
|
}
|
|
1080
1081
|
}
|
|
1081
1082
|
}
|
|
@@ -1105,10 +1106,12 @@ function getPlanetApplicationRef(appName) {
|
|
|
1105
1106
|
}
|
|
1106
1107
|
}
|
|
1107
1108
|
function setPortalApplicationData(data) {
|
|
1108
|
-
globalPlanet.portalApplication
|
|
1109
|
+
if (globalPlanet.portalApplication) {
|
|
1110
|
+
globalPlanet.portalApplication.data = data;
|
|
1111
|
+
}
|
|
1109
1112
|
}
|
|
1110
1113
|
function getPortalApplicationData() {
|
|
1111
|
-
return globalPlanet.portalApplication
|
|
1114
|
+
return globalPlanet.portalApplication?.data;
|
|
1112
1115
|
}
|
|
1113
1116
|
function setApplicationLoader(loader) {
|
|
1114
1117
|
globalPlanet.applicationLoader = loader;
|
|
@@ -1196,16 +1199,14 @@ class PlanetApplicationService {
|
|
|
1196
1199
|
return this.apps;
|
|
1197
1200
|
}
|
|
1198
1201
|
}
|
|
1199
|
-
PlanetApplicationService.ɵ
|
|
1200
|
-
PlanetApplicationService
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
{ type: AssetsLoader }
|
|
1208
|
-
];
|
|
1202
|
+
PlanetApplicationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: PlanetApplicationService, deps: [{ token: i1.HttpClient }, { token: AssetsLoader }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1203
|
+
PlanetApplicationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: PlanetApplicationService, providedIn: 'root' });
|
|
1204
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: PlanetApplicationService, decorators: [{
|
|
1205
|
+
type: Injectable,
|
|
1206
|
+
args: [{
|
|
1207
|
+
providedIn: 'root'
|
|
1208
|
+
}]
|
|
1209
|
+
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: AssetsLoader }]; } });
|
|
1209
1210
|
|
|
1210
1211
|
class PlanetPortalApplication {
|
|
1211
1212
|
navigateByUrl(url, extras) {
|
|
@@ -1280,15 +1281,14 @@ class GlobalEventDispatcher {
|
|
|
1280
1281
|
return this.subscriptionCount;
|
|
1281
1282
|
}
|
|
1282
1283
|
}
|
|
1283
|
-
GlobalEventDispatcher.ɵ
|
|
1284
|
-
GlobalEventDispatcher
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
];
|
|
1284
|
+
GlobalEventDispatcher.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: GlobalEventDispatcher, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1285
|
+
GlobalEventDispatcher.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: GlobalEventDispatcher, providedIn: 'root' });
|
|
1286
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: GlobalEventDispatcher, decorators: [{
|
|
1287
|
+
type: Injectable,
|
|
1288
|
+
args: [{
|
|
1289
|
+
providedIn: 'root'
|
|
1290
|
+
}]
|
|
1291
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }]; } });
|
|
1292
1292
|
|
|
1293
1293
|
/**
|
|
1294
1294
|
* Debug factory for debug module
|
|
@@ -1315,7 +1315,7 @@ function setDebugFactory(debug) {
|
|
|
1315
1315
|
_debugFactory = debug;
|
|
1316
1316
|
}
|
|
1317
1317
|
function clearDebugFactory() {
|
|
1318
|
-
|
|
1318
|
+
_debugFactory = undefined;
|
|
1319
1319
|
_debuggerMap = {};
|
|
1320
1320
|
}
|
|
1321
1321
|
function getDebugFactory() {
|
|
@@ -1468,7 +1468,7 @@ class PlanetApplicationLoader {
|
|
|
1468
1468
|
debug(`[routeChange] app(${app.name}) status is bootstrapped, show app and active`);
|
|
1469
1469
|
this.showApp(app);
|
|
1470
1470
|
const appRef = getPlanetApplicationRef(app.name);
|
|
1471
|
-
appRef
|
|
1471
|
+
appRef?.navigateByUrl(event.url);
|
|
1472
1472
|
this.setAppStatus(app, ApplicationStatus.active);
|
|
1473
1473
|
this.setLoadingDone();
|
|
1474
1474
|
return of(app);
|
|
@@ -1486,11 +1486,11 @@ class PlanetApplicationLoader {
|
|
|
1486
1486
|
debug(`[routeChange] app(${app.name}) is active, do nothings`);
|
|
1487
1487
|
const appRef = getPlanetApplicationRef(app.name);
|
|
1488
1488
|
// Backwards compatibility sub app use old version which has not getCurrentRouterStateUrl
|
|
1489
|
-
const currentUrl = appRef
|
|
1489
|
+
const currentUrl = appRef?.getCurrentRouterStateUrl
|
|
1490
1490
|
? appRef.getCurrentRouterStateUrl()
|
|
1491
1491
|
: '';
|
|
1492
1492
|
if (currentUrl !== event.url) {
|
|
1493
|
-
appRef
|
|
1493
|
+
appRef?.navigateByUrl(event.url);
|
|
1494
1494
|
}
|
|
1495
1495
|
return of(app);
|
|
1496
1496
|
}
|
|
@@ -1561,14 +1561,14 @@ class PlanetApplicationLoader {
|
|
|
1561
1561
|
}
|
|
1562
1562
|
hideApp(planetApp) {
|
|
1563
1563
|
const appRef = getPlanetApplicationRef(planetApp.name);
|
|
1564
|
-
const appRootElement = document.querySelector(appRef
|
|
1564
|
+
const appRootElement = document.querySelector(appRef?.selector || planetApp.selector);
|
|
1565
1565
|
if (appRootElement) {
|
|
1566
1566
|
appRootElement.setAttribute('style', 'display:none;');
|
|
1567
1567
|
}
|
|
1568
1568
|
}
|
|
1569
1569
|
showApp(planetApp) {
|
|
1570
1570
|
const appRef = getPlanetApplicationRef(planetApp.name);
|
|
1571
|
-
const appRootElement = document.querySelector(appRef
|
|
1571
|
+
const appRootElement = document.querySelector(appRef?.selector || planetApp.selector);
|
|
1572
1572
|
if (appRootElement) {
|
|
1573
1573
|
appRootElement.setAttribute('style', '');
|
|
1574
1574
|
}
|
|
@@ -1579,9 +1579,9 @@ class PlanetApplicationLoader {
|
|
|
1579
1579
|
appRef.destroy();
|
|
1580
1580
|
}
|
|
1581
1581
|
const container = getHTMLElement(planetApp.hostParent);
|
|
1582
|
-
const appRootElement = container
|
|
1582
|
+
const appRootElement = container?.querySelector((appRef && appRef.selector) || planetApp.selector);
|
|
1583
1583
|
if (appRootElement) {
|
|
1584
|
-
container
|
|
1584
|
+
container?.removeChild(appRootElement);
|
|
1585
1585
|
}
|
|
1586
1586
|
}
|
|
1587
1587
|
bootstrapApp(app, defaultStatus = 'display') {
|
|
@@ -1675,13 +1675,15 @@ class PlanetApplicationLoader {
|
|
|
1675
1675
|
}
|
|
1676
1676
|
preloadApps(activeApps) {
|
|
1677
1677
|
setTimeout(() => {
|
|
1678
|
-
const toPreloadApps = this.planetApplicationService.getAppsToPreload(activeApps ? activeApps.map(item => item.name) :
|
|
1678
|
+
const toPreloadApps = this.planetApplicationService.getAppsToPreload(activeApps ? activeApps.map(item => item.name) : undefined);
|
|
1679
1679
|
debug(`start preload apps: ${this.getAppNames(toPreloadApps)}`);
|
|
1680
1680
|
const loadApps$ = toPreloadApps.map(preloadApp => {
|
|
1681
1681
|
return this.preloadInternal(preloadApp);
|
|
1682
1682
|
});
|
|
1683
1683
|
forkJoin(loadApps$).subscribe({
|
|
1684
|
-
error: error =>
|
|
1684
|
+
error: error => {
|
|
1685
|
+
this.errorHandler(error);
|
|
1686
|
+
}
|
|
1685
1687
|
});
|
|
1686
1688
|
});
|
|
1687
1689
|
}
|
|
@@ -1694,7 +1696,10 @@ class PlanetApplicationLoader {
|
|
|
1694
1696
|
}
|
|
1695
1697
|
}
|
|
1696
1698
|
setOptions(options) {
|
|
1697
|
-
this.options =
|
|
1699
|
+
this.options = {
|
|
1700
|
+
...this.options,
|
|
1701
|
+
...options
|
|
1702
|
+
};
|
|
1698
1703
|
}
|
|
1699
1704
|
/**
|
|
1700
1705
|
* reset route by current router
|
|
@@ -1716,6 +1721,9 @@ class PlanetApplicationLoader {
|
|
|
1716
1721
|
return this.bootstrapApp(app, 'hidden');
|
|
1717
1722
|
});
|
|
1718
1723
|
}
|
|
1724
|
+
}), catchError(error => {
|
|
1725
|
+
this.errorHandler(error);
|
|
1726
|
+
return of(null);
|
|
1719
1727
|
}), map(() => {
|
|
1720
1728
|
return getPlanetApplicationRef(app.name);
|
|
1721
1729
|
}));
|
|
@@ -1743,20 +1751,14 @@ class PlanetApplicationLoader {
|
|
|
1743
1751
|
return this.preloadInternal(app, immediate);
|
|
1744
1752
|
}
|
|
1745
1753
|
}
|
|
1746
|
-
PlanetApplicationLoader.ɵ
|
|
1747
|
-
PlanetApplicationLoader
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
{ type: PlanetApplicationService },
|
|
1755
|
-
{ type: NgZone },
|
|
1756
|
-
{ type: Router },
|
|
1757
|
-
{ type: Injector },
|
|
1758
|
-
{ type: ApplicationRef }
|
|
1759
|
-
];
|
|
1754
|
+
PlanetApplicationLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: PlanetApplicationLoader, deps: [{ token: AssetsLoader }, { token: PlanetApplicationService }, { token: i0.NgZone }, { token: i3.Router }, { token: i0.Injector }, { token: i0.ApplicationRef }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1755
|
+
PlanetApplicationLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: PlanetApplicationLoader, providedIn: 'root' });
|
|
1756
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: PlanetApplicationLoader, decorators: [{
|
|
1757
|
+
type: Injectable,
|
|
1758
|
+
args: [{
|
|
1759
|
+
providedIn: 'root'
|
|
1760
|
+
}]
|
|
1761
|
+
}], ctorParameters: function () { return [{ type: AssetsLoader }, { type: PlanetApplicationService }, { type: i0.NgZone }, { type: i3.Router }, { type: i0.Injector }, { type: i0.ApplicationRef }]; } });
|
|
1760
1762
|
|
|
1761
1763
|
class Planet {
|
|
1762
1764
|
constructor(injector, router, planetApplications) {
|
|
@@ -1812,7 +1814,7 @@ class Planet {
|
|
|
1812
1814
|
this.subscription = this.router.events
|
|
1813
1815
|
.pipe(filter(event => {
|
|
1814
1816
|
return event instanceof NavigationEnd;
|
|
1815
|
-
}), map(
|
|
1817
|
+
}), map(event => {
|
|
1816
1818
|
return event.urlAfterRedirects || event.url;
|
|
1817
1819
|
}), startWith(location.pathname), distinctUntilChanged())
|
|
1818
1820
|
.subscribe((url) => {
|
|
@@ -1822,29 +1824,35 @@ class Planet {
|
|
|
1822
1824
|
});
|
|
1823
1825
|
}
|
|
1824
1826
|
stop() {
|
|
1825
|
-
this.subscription
|
|
1827
|
+
this.subscription?.unsubscribe();
|
|
1826
1828
|
}
|
|
1827
1829
|
}
|
|
1828
|
-
Planet.ɵ
|
|
1829
|
-
Planet
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1830
|
+
Planet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: Planet, deps: [{ token: i0.Injector }, { token: i3.Router }, { token: PLANET_APPLICATIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1831
|
+
Planet.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: Planet, providedIn: 'root' });
|
|
1832
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: Planet, decorators: [{
|
|
1833
|
+
type: Injectable,
|
|
1834
|
+
args: [{
|
|
1835
|
+
providedIn: 'root'
|
|
1836
|
+
}]
|
|
1837
|
+
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i3.Router }, { type: undefined, decorators: [{
|
|
1838
|
+
type: Inject,
|
|
1839
|
+
args: [PLANET_APPLICATIONS]
|
|
1840
|
+
}, {
|
|
1841
|
+
type: Optional
|
|
1842
|
+
}] }]; } });
|
|
1839
1843
|
|
|
1840
1844
|
class EmptyComponent {
|
|
1841
1845
|
}
|
|
1842
|
-
EmptyComponent
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1846
|
+
EmptyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: EmptyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1847
|
+
EmptyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.6", type: EmptyComponent, selector: "empty-component", ngImport: i0, template: ``, isInline: true });
|
|
1848
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: EmptyComponent, decorators: [{
|
|
1849
|
+
type: Component,
|
|
1850
|
+
args: [{
|
|
1851
|
+
// eslint-disable-next-line @angular-eslint/component-selector
|
|
1852
|
+
selector: 'empty-component',
|
|
1853
|
+
template: ``
|
|
1854
|
+
}]
|
|
1855
|
+
}] });
|
|
1848
1856
|
|
|
1849
1857
|
class NgxPlanetModule {
|
|
1850
1858
|
static forRoot(apps) {
|
|
@@ -1859,15 +1867,18 @@ class NgxPlanetModule {
|
|
|
1859
1867
|
};
|
|
1860
1868
|
}
|
|
1861
1869
|
}
|
|
1862
|
-
NgxPlanetModule
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
]
|
|
1870
|
+
NgxPlanetModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: NgxPlanetModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1871
|
+
NgxPlanetModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: NgxPlanetModule, declarations: [EmptyComponent], imports: [HttpClientModule], exports: [HttpClientModule, EmptyComponent] });
|
|
1872
|
+
NgxPlanetModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: NgxPlanetModule, providers: [], imports: [[HttpClientModule], HttpClientModule] });
|
|
1873
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: NgxPlanetModule, decorators: [{
|
|
1874
|
+
type: NgModule,
|
|
1875
|
+
args: [{
|
|
1876
|
+
declarations: [EmptyComponent],
|
|
1877
|
+
imports: [HttpClientModule],
|
|
1878
|
+
providers: [],
|
|
1879
|
+
exports: [HttpClientModule, EmptyComponent]
|
|
1880
|
+
}]
|
|
1881
|
+
}] });
|
|
1871
1882
|
|
|
1872
1883
|
class PlanetComponentRef {
|
|
1873
1884
|
}
|
|
@@ -1985,7 +1996,7 @@ class PlanetComponentLoader {
|
|
|
1985
1996
|
load(app, componentName, config) {
|
|
1986
1997
|
const result = this.getPlantAppRef(app).pipe(delayWhen(appRef => {
|
|
1987
1998
|
if (appRef.getComponentFactory()) {
|
|
1988
|
-
return of();
|
|
1999
|
+
return of('');
|
|
1989
2000
|
}
|
|
1990
2001
|
else {
|
|
1991
2002
|
// Because register use 'setTimeout',so timer 20
|
|
@@ -2004,18 +2015,17 @@ class PlanetComponentLoader {
|
|
|
2004
2015
|
return result;
|
|
2005
2016
|
}
|
|
2006
2017
|
}
|
|
2007
|
-
PlanetComponentLoader.ɵ
|
|
2008
|
-
PlanetComponentLoader
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
];
|
|
2018
|
+
PlanetComponentLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: PlanetComponentLoader, deps: [{ token: i0.ApplicationRef }, { token: i0.NgModuleRef }, { token: i0.NgZone }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2019
|
+
PlanetComponentLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: PlanetComponentLoader, providedIn: 'root' });
|
|
2020
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: PlanetComponentLoader, decorators: [{
|
|
2021
|
+
type: Injectable,
|
|
2022
|
+
args: [{
|
|
2023
|
+
providedIn: 'root'
|
|
2024
|
+
}]
|
|
2025
|
+
}], ctorParameters: function () { return [{ type: i0.ApplicationRef }, { type: i0.NgModuleRef }, { type: i0.NgZone }, { type: undefined, decorators: [{
|
|
2026
|
+
type: Inject,
|
|
2027
|
+
args: [DOCUMENT]
|
|
2028
|
+
}] }]; } });
|
|
2019
2029
|
|
|
2020
2030
|
class PlantComponentConfig {
|
|
2021
2031
|
constructor() {
|
|
@@ -2032,5 +2042,5 @@ class PlantComponentConfig {
|
|
|
2032
2042
|
* Generated bundle index. Do not edit.
|
|
2033
2043
|
*/
|
|
2034
2044
|
|
|
2035
|
-
export { ApplicationStatus, AssetsLoader, EmptyComponent, GlobalEventDispatcher, NgxPlanetModule, PLANET_APPLICATIONS, Planet, PlanetApplicationLoader, PlanetApplicationRef, PlanetApplicationService, PlanetComponentLoader, PlanetComponentRef, PlanetPortalApplication, PlantComponentConfig, SwitchModes, defineApplication, getPlanetApplicationRef, getPortalApplicationData
|
|
2036
|
-
//# sourceMappingURL=worktile-planet.
|
|
2045
|
+
export { ApplicationStatus, AssetsLoader, EmptyComponent, GlobalEventDispatcher, NgxPlanetModule, PLANET_APPLICATIONS, Planet, PlanetApplicationLoader, PlanetApplicationRef, PlanetApplicationService, PlanetComponentLoader, PlanetComponentRef, PlanetPortalApplication, PlantComponentConfig, SwitchModes, defineApplication, getPlanetApplicationRef, getPortalApplicationData };
|
|
2046
|
+
//# sourceMappingURL=worktile-planet.mjs.map
|