@worktile/planet 16.0.0-next.0 → 17.0.0-next.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/CHANGELOG.md +14 -0
- package/application/ng-planet-application-ref.d.ts +48 -0
- package/application/ng-planet-application-ref.d.ts.map +1 -0
- package/application/planet-application-ref.d.ts +3 -27
- package/application/planet-application-ref.d.ts.map +1 -1
- package/component/planet-component-loader.d.ts.map +1 -1
- package/component/planet-component-outlet.d.ts +1 -1
- package/esm2022/application/ng-planet-application-ref.mjs +106 -0
- package/esm2022/application/planet-application-loader.mjs +454 -0
- package/esm2022/application/planet-application-ref.mjs +2 -0
- package/esm2022/application/planet-application.service.mjs +85 -0
- package/esm2022/assets-loader.mjs +216 -0
- package/esm2022/component/planet-component-loader.mjs +171 -0
- package/esm2022/component/planet-component-outlet.mjs +69 -0
- package/esm2022/debug.mjs +33 -0
- package/{esm2020 → esm2022}/empty/empty.component.mjs +4 -4
- package/esm2022/global-event-dispatcher.mjs +70 -0
- package/esm2022/global-planet.mjs +63 -0
- package/esm2022/helpers.mjs +119 -0
- package/esm2022/module.mjs +33 -0
- package/esm2022/planet.mjs +91 -0
- package/esm2022/public-api.mjs +19 -0
- package/esm2022/router/route-redirect.mjs +63 -0
- package/{esm2020 → esm2022}/sandbox/index.mjs +1 -1
- package/esm2022/sandbox/proxy/patches/eventListener.mjs +41 -0
- package/esm2022/sandbox/proxy/proxies/common.mjs +132 -0
- package/esm2022/sandbox/proxy/proxies/document.mjs +126 -0
- package/esm2022/sandbox/proxy/proxies/window.mjs +158 -0
- package/esm2022/sandbox/proxy/proxy-sandbox.mjs +49 -0
- package/esm2022/sandbox/snapshot/snapshot-sandbox.mjs +12 -0
- package/{fesm2020 → fesm2022}/worktile-planet.mjs +96 -73
- package/fesm2022/worktile-planet.mjs.map +1 -0
- package/global-planet.d.ts +4 -2
- package/global-planet.d.ts.map +1 -1
- package/package.json +7 -13
- package/sandbox/proxy/patches/eventListener.d.ts.map +1 -1
- package/sandbox/proxy/proxy-sandbox.d.ts.map +1 -1
- package/sandbox/snapshot/snapshot-sandbox.d.ts.map +1 -1
- package/esm2020/application/planet-application-loader.mjs +0 -454
- package/esm2020/application/planet-application-ref.mjs +0 -94
- package/esm2020/application/planet-application.service.mjs +0 -85
- package/esm2020/assets-loader.mjs +0 -216
- package/esm2020/component/planet-component-loader.mjs +0 -170
- package/esm2020/component/planet-component-outlet.mjs +0 -69
- package/esm2020/debug.mjs +0 -33
- package/esm2020/global-event-dispatcher.mjs +0 -70
- package/esm2020/global-planet.mjs +0 -53
- package/esm2020/helpers.mjs +0 -119
- package/esm2020/module.mjs +0 -33
- package/esm2020/planet.mjs +0 -91
- package/esm2020/public-api.mjs +0 -20
- package/esm2020/router/route-redirect.mjs +0 -63
- package/esm2020/sandbox/proxy/patches/eventListener.mjs +0 -41
- package/esm2020/sandbox/proxy/proxies/common.mjs +0 -132
- package/esm2020/sandbox/proxy/proxies/document.mjs +0 -126
- package/esm2020/sandbox/proxy/proxies/window.mjs +0 -158
- package/esm2020/sandbox/proxy/proxy-sandbox.mjs +0 -49
- package/esm2020/sandbox/snapshot/snapshot-sandbox.mjs +0 -12
- package/fesm2015/worktile-planet.mjs +0 -2193
- package/fesm2015/worktile-planet.mjs.map +0 -1
- package/fesm2020/worktile-planet.mjs.map +0 -1
- /package/{esm2020 → esm2022}/application/portal-application.mjs +0 -0
- /package/{esm2020 → esm2022}/component/planet-component-ref.mjs +0 -0
- /package/{esm2020 → esm2022}/component/plant-component.config.mjs +0 -0
- /package/{esm2020 → esm2022}/planet.class.mjs +0 -0
- /package/{esm2020 → esm2022}/sandbox/constants.mjs +0 -0
- /package/{esm2020 → esm2022}/sandbox/exec.mjs +0 -0
- /package/{esm2020 → esm2022}/sandbox/proxy/patches/document.mjs +0 -0
- /package/{esm2020 → esm2022}/sandbox/proxy/patches/index.mjs +0 -0
- /package/{esm2020 → esm2022}/sandbox/proxy/patches/storage.mjs +0 -0
- /package/{esm2020 → esm2022}/sandbox/proxy/patches/timer.mjs +0 -0
- /package/{esm2020 → esm2022}/sandbox/proxy/types.mjs +0 -0
- /package/{esm2020 → esm2022}/sandbox/sandbox.mjs +0 -0
- /package/{esm2020 → esm2022}/sandbox/types.mjs +0 -0
- /package/{esm2020 → esm2022}/worktile-planet.mjs +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, Injectable, NgZone, Inject, Optional, Component, ChangeDetectionStrategy, Injector, createComponent, reflectComponentType, EventEmitter, Directive, Input, Output, inject, NgModule } from '@angular/core';
|
|
2
|
+
import { InjectionToken, Injectable, NgZone, NgModuleRef, Inject, Optional, Component, ChangeDetectionStrategy, Injector, createComponent, reflectComponentType, EventEmitter, Directive, Input, Output, inject, NgModule } from '@angular/core';
|
|
3
3
|
import * as i3 from '@angular/router';
|
|
4
4
|
import { Router, NavigationEnd, ActivatedRoute } from '@angular/router';
|
|
5
5
|
import * as i1 from '@angular/common/http';
|
|
@@ -453,7 +453,7 @@ function eventListenerPatch(sandbox) {
|
|
|
453
453
|
removeEventListener: removeEventListener.bind(window)
|
|
454
454
|
},
|
|
455
455
|
init() {
|
|
456
|
-
const fakeDocument = sandbox.global
|
|
456
|
+
const fakeDocument = sandbox.global['document'];
|
|
457
457
|
if (fakeDocument) {
|
|
458
458
|
fakeDocument.addEventListener = addEventListener.bind(document);
|
|
459
459
|
fakeDocument.removeEventListener = removeEventListener.bind(document);
|
|
@@ -982,29 +982,29 @@ class AssetsLoader {
|
|
|
982
982
|
return response;
|
|
983
983
|
}));
|
|
984
984
|
}
|
|
985
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: AssetsLoader, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
986
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: AssetsLoader, providedIn: 'root' }); }
|
|
985
987
|
}
|
|
986
|
-
|
|
987
|
-
AssetsLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: AssetsLoader, providedIn: 'root' });
|
|
988
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: AssetsLoader, decorators: [{
|
|
988
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: AssetsLoader, decorators: [{
|
|
989
989
|
type: Injectable,
|
|
990
990
|
args: [{
|
|
991
991
|
providedIn: 'root'
|
|
992
992
|
}]
|
|
993
|
-
}], ctorParameters:
|
|
993
|
+
}], ctorParameters: () => [{ type: i1.HttpClient }] });
|
|
994
994
|
|
|
995
|
-
class
|
|
995
|
+
class NgPlanetApplicationRef {
|
|
996
996
|
get selector() {
|
|
997
997
|
return this.innerSelector;
|
|
998
998
|
}
|
|
999
|
-
get bootstrapped() {
|
|
1000
|
-
return !!this.appModuleRef;
|
|
1001
|
-
}
|
|
1002
999
|
get ngZone() {
|
|
1003
|
-
return this.appModuleRef?.injector
|
|
1000
|
+
return (this.injector || this.appModuleRef?.injector)?.get(NgZone);
|
|
1004
1001
|
}
|
|
1005
1002
|
get sandbox() {
|
|
1006
1003
|
return getSandboxInstance();
|
|
1007
1004
|
}
|
|
1005
|
+
get bootstrapped() {
|
|
1006
|
+
return !!(this.appModuleRef || this.appRef);
|
|
1007
|
+
}
|
|
1008
1008
|
constructor(name, options) {
|
|
1009
1009
|
this.name = name;
|
|
1010
1010
|
if (options) {
|
|
@@ -1014,14 +1014,14 @@ class PlanetApplicationRef {
|
|
|
1014
1014
|
}
|
|
1015
1015
|
// This is a hack, since NgZone doesn't allow you to configure the property that identifies your zone.
|
|
1016
1016
|
// See https://github.com/PlaceMe-SAS/single-spa-angular-cli/issues/33,
|
|
1017
|
-
NgZone.isInAngularZone = () => {
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
};
|
|
1017
|
+
// NgZone.isInAngularZone = () => {
|
|
1018
|
+
// // @ts-ignore
|
|
1019
|
+
// return window.Zone.current._properties[`ngx-planet-${name}`] === true;
|
|
1020
|
+
// };
|
|
1021
1021
|
}
|
|
1022
1022
|
// 子应用路由变化后同步修改 portal 的 Route
|
|
1023
1023
|
syncPortalRouteWhenNavigationEnd() {
|
|
1024
|
-
const router = this.appModuleRef?.injector
|
|
1024
|
+
const router = (this.injector || this.appModuleRef?.injector)?.get(Router);
|
|
1025
1025
|
if (router) {
|
|
1026
1026
|
router.events.subscribe(event => {
|
|
1027
1027
|
if (event instanceof NavigationEnd) {
|
|
@@ -1041,14 +1041,23 @@ class PlanetApplicationRef {
|
|
|
1041
1041
|
}
|
|
1042
1042
|
this.portalApp = app;
|
|
1043
1043
|
return from(this.appModuleBootstrap(app).then(appModuleRef => {
|
|
1044
|
-
|
|
1045
|
-
|
|
1044
|
+
if (appModuleRef['instance']) {
|
|
1045
|
+
this.appModuleRef = appModuleRef;
|
|
1046
|
+
this.appModuleRef.instance.appName = this.name;
|
|
1047
|
+
this.injector = this.appModuleRef.injector;
|
|
1048
|
+
}
|
|
1049
|
+
else {
|
|
1050
|
+
this.appRef = appModuleRef;
|
|
1051
|
+
this.injector = this.appRef.injector;
|
|
1052
|
+
const moduleRef = this.appRef.injector.get(NgModuleRef);
|
|
1053
|
+
moduleRef.instance = { appName: this.name };
|
|
1054
|
+
}
|
|
1046
1055
|
this.syncPortalRouteWhenNavigationEnd();
|
|
1047
1056
|
return this;
|
|
1048
1057
|
}));
|
|
1049
1058
|
}
|
|
1050
1059
|
getRouter() {
|
|
1051
|
-
return this.appModuleRef?.injector
|
|
1060
|
+
return (this.injector || this.appModuleRef?.injector)?.get(Router);
|
|
1052
1061
|
}
|
|
1053
1062
|
getCurrentRouterStateUrl() {
|
|
1054
1063
|
return this.getRouter()?.routerState.snapshot.url;
|
|
@@ -1066,16 +1075,19 @@ class PlanetApplicationRef {
|
|
|
1066
1075
|
this.componentFactory = componentFactory;
|
|
1067
1076
|
}
|
|
1068
1077
|
destroy() {
|
|
1069
|
-
if (this.appModuleRef) {
|
|
1070
|
-
const router = this.appModuleRef
|
|
1078
|
+
if (this.appModuleRef || this.appRef) {
|
|
1079
|
+
const router = (this.injector || this.appModuleRef?.injector)?.get(Router);
|
|
1071
1080
|
if (router) {
|
|
1072
1081
|
router.dispose();
|
|
1073
1082
|
}
|
|
1074
1083
|
if (this.sandbox) {
|
|
1075
1084
|
this.sandbox.destroy();
|
|
1076
1085
|
}
|
|
1077
|
-
this.appModuleRef
|
|
1086
|
+
this.appModuleRef?.destroy();
|
|
1078
1087
|
this.appModuleRef = undefined;
|
|
1088
|
+
this.appRef?.destroy();
|
|
1089
|
+
this.appRef = undefined;
|
|
1090
|
+
this.injector = undefined;
|
|
1079
1091
|
}
|
|
1080
1092
|
}
|
|
1081
1093
|
}
|
|
@@ -1093,7 +1105,7 @@ function defineApplication(name, options) {
|
|
|
1093
1105
|
bootstrap: options
|
|
1094
1106
|
};
|
|
1095
1107
|
}
|
|
1096
|
-
const appRef = new
|
|
1108
|
+
const appRef = new NgPlanetApplicationRef(name, options);
|
|
1097
1109
|
globalPlanet.apps[name] = appRef;
|
|
1098
1110
|
}
|
|
1099
1111
|
function getPlanetApplicationRef(appName) {
|
|
@@ -1104,6 +1116,16 @@ function getPlanetApplicationRef(appName) {
|
|
|
1104
1116
|
return null;
|
|
1105
1117
|
}
|
|
1106
1118
|
}
|
|
1119
|
+
function getBootstrappedPlanetApplicationRef(appName) {
|
|
1120
|
+
const plantAppRef = getPlanetApplicationRef(appName);
|
|
1121
|
+
if (plantAppRef) {
|
|
1122
|
+
// 兼容之前的版本,之前是通过 appModuleRef 来判断是否启用的
|
|
1123
|
+
if (plantAppRef.bootstrapped || plantAppRef['appModuleRef']) {
|
|
1124
|
+
return plantAppRef;
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
return null;
|
|
1128
|
+
}
|
|
1107
1129
|
function setPortalApplicationData(data) {
|
|
1108
1130
|
if (globalPlanet.portalApplication) {
|
|
1109
1131
|
globalPlanet.portalApplication.data = data;
|
|
@@ -1197,15 +1219,15 @@ class PlanetApplicationService {
|
|
|
1197
1219
|
getApps() {
|
|
1198
1220
|
return this.apps;
|
|
1199
1221
|
}
|
|
1222
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: PlanetApplicationService, deps: [{ token: i1.HttpClient }, { token: AssetsLoader }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1223
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: PlanetApplicationService, providedIn: 'root' }); }
|
|
1200
1224
|
}
|
|
1201
|
-
|
|
1202
|
-
PlanetApplicationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: PlanetApplicationService, providedIn: 'root' });
|
|
1203
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: PlanetApplicationService, decorators: [{
|
|
1225
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: PlanetApplicationService, decorators: [{
|
|
1204
1226
|
type: Injectable,
|
|
1205
1227
|
args: [{
|
|
1206
1228
|
providedIn: 'root'
|
|
1207
1229
|
}]
|
|
1208
|
-
}], ctorParameters:
|
|
1230
|
+
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: AssetsLoader }] });
|
|
1209
1231
|
|
|
1210
1232
|
class PlanetPortalApplication {
|
|
1211
1233
|
navigateByUrl(url, extras) {
|
|
@@ -1279,15 +1301,15 @@ class GlobalEventDispatcher {
|
|
|
1279
1301
|
getSubscriptionCount() {
|
|
1280
1302
|
return this.subscriptionCount;
|
|
1281
1303
|
}
|
|
1304
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: GlobalEventDispatcher, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1305
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: GlobalEventDispatcher, providedIn: 'root' }); }
|
|
1282
1306
|
}
|
|
1283
|
-
|
|
1284
|
-
GlobalEventDispatcher.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: GlobalEventDispatcher, providedIn: 'root' });
|
|
1285
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: GlobalEventDispatcher, decorators: [{
|
|
1307
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: GlobalEventDispatcher, decorators: [{
|
|
1286
1308
|
type: Injectable,
|
|
1287
1309
|
args: [{
|
|
1288
1310
|
providedIn: 'root'
|
|
1289
1311
|
}]
|
|
1290
|
-
}], ctorParameters:
|
|
1312
|
+
}], ctorParameters: () => [{ type: i0.NgZone }] });
|
|
1291
1313
|
|
|
1292
1314
|
/**
|
|
1293
1315
|
* Debug factory for debug module
|
|
@@ -1749,15 +1771,15 @@ class PlanetApplicationLoader {
|
|
|
1749
1771
|
preload(app, immediate) {
|
|
1750
1772
|
return this.preloadInternal(app, immediate);
|
|
1751
1773
|
}
|
|
1774
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.3", 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 }); }
|
|
1775
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: PlanetApplicationLoader, providedIn: 'root' }); }
|
|
1752
1776
|
}
|
|
1753
|
-
|
|
1754
|
-
PlanetApplicationLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: PlanetApplicationLoader, providedIn: 'root' });
|
|
1755
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: PlanetApplicationLoader, decorators: [{
|
|
1777
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: PlanetApplicationLoader, decorators: [{
|
|
1756
1778
|
type: Injectable,
|
|
1757
1779
|
args: [{
|
|
1758
1780
|
providedIn: 'root'
|
|
1759
1781
|
}]
|
|
1760
|
-
}], ctorParameters:
|
|
1782
|
+
}], ctorParameters: () => [{ type: AssetsLoader }, { type: PlanetApplicationService }, { type: i0.NgZone }, { type: i3.Router }, { type: i0.Injector }, { type: i0.ApplicationRef }] });
|
|
1761
1783
|
|
|
1762
1784
|
class Planet {
|
|
1763
1785
|
get planetApplicationLoader() {
|
|
@@ -1825,26 +1847,26 @@ class Planet {
|
|
|
1825
1847
|
stop() {
|
|
1826
1848
|
this.subscription?.unsubscribe();
|
|
1827
1849
|
}
|
|
1850
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: Planet, deps: [{ token: i0.Injector }, { token: i3.Router }, { token: PLANET_APPLICATIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1851
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: Planet, providedIn: 'root' }); }
|
|
1828
1852
|
}
|
|
1829
|
-
|
|
1830
|
-
Planet.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: Planet, providedIn: 'root' });
|
|
1831
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: Planet, decorators: [{
|
|
1853
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: Planet, decorators: [{
|
|
1832
1854
|
type: Injectable,
|
|
1833
1855
|
args: [{
|
|
1834
1856
|
providedIn: 'root'
|
|
1835
1857
|
}]
|
|
1836
|
-
}], ctorParameters:
|
|
1858
|
+
}], ctorParameters: () => [{ type: i0.Injector }, { type: i3.Router }, { type: undefined, decorators: [{
|
|
1837
1859
|
type: Inject,
|
|
1838
1860
|
args: [PLANET_APPLICATIONS]
|
|
1839
1861
|
}, {
|
|
1840
1862
|
type: Optional
|
|
1841
|
-
}] }]
|
|
1863
|
+
}] }] });
|
|
1842
1864
|
|
|
1843
1865
|
class EmptyComponent {
|
|
1866
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: EmptyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1867
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.3", type: EmptyComponent, isStandalone: true, selector: "empty-component", ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1844
1868
|
}
|
|
1845
|
-
|
|
1846
|
-
EmptyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", type: EmptyComponent, isStandalone: true, selector: "empty-component", ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1847
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: EmptyComponent, decorators: [{
|
|
1869
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: EmptyComponent, decorators: [{
|
|
1848
1870
|
type: Component,
|
|
1849
1871
|
args: [{
|
|
1850
1872
|
// eslint-disable-next-line @angular-eslint/component-selector
|
|
@@ -1876,17 +1898,18 @@ class PlanetComponentLoader {
|
|
|
1876
1898
|
this.document = document;
|
|
1877
1899
|
}
|
|
1878
1900
|
getPlantAppRef(name) {
|
|
1879
|
-
|
|
1880
|
-
|
|
1901
|
+
const plantAppRef = getBootstrappedPlanetApplicationRef(name);
|
|
1902
|
+
if (plantAppRef) {
|
|
1903
|
+
return of(plantAppRef);
|
|
1881
1904
|
}
|
|
1882
1905
|
else {
|
|
1883
1906
|
const app = this.applicationService.getAppByName(name);
|
|
1884
1907
|
return this.applicationLoader.preload(app, true).pipe(map(() => {
|
|
1885
|
-
return
|
|
1908
|
+
return getPlanetApplicationRef(name);
|
|
1886
1909
|
}));
|
|
1887
1910
|
}
|
|
1888
1911
|
}
|
|
1889
|
-
createInjector(
|
|
1912
|
+
createInjector(parentInjector, componentRef) {
|
|
1890
1913
|
return Injector.create({
|
|
1891
1914
|
providers: [
|
|
1892
1915
|
{
|
|
@@ -1894,7 +1917,7 @@ class PlanetComponentLoader {
|
|
|
1894
1917
|
useValue: componentRef
|
|
1895
1918
|
}
|
|
1896
1919
|
],
|
|
1897
|
-
parent:
|
|
1920
|
+
parent: parentInjector
|
|
1898
1921
|
});
|
|
1899
1922
|
}
|
|
1900
1923
|
getContainerElement(config) {
|
|
@@ -1928,13 +1951,13 @@ class PlanetComponentLoader {
|
|
|
1928
1951
|
container.appendChild(componentRootNode);
|
|
1929
1952
|
}
|
|
1930
1953
|
}
|
|
1931
|
-
attachComponent(component,
|
|
1954
|
+
attachComponent(component, environmentInjector, config) {
|
|
1932
1955
|
const plantComponentRef = new PlanetComponentRef();
|
|
1933
1956
|
const appRef = this.applicationRef;
|
|
1934
|
-
const injector = this.createInjector(
|
|
1957
|
+
const injector = this.createInjector(environmentInjector, plantComponentRef);
|
|
1935
1958
|
const container = this.getContainerElement(config);
|
|
1936
1959
|
const componentRef = createComponent(component, {
|
|
1937
|
-
environmentInjector:
|
|
1960
|
+
environmentInjector: environmentInjector,
|
|
1938
1961
|
elementInjector: injector
|
|
1939
1962
|
});
|
|
1940
1963
|
appRef.attachView(componentRef.hostView);
|
|
@@ -1961,7 +1984,7 @@ class PlanetComponentLoader {
|
|
|
1961
1984
|
}
|
|
1962
1985
|
registerComponentFactory(componentOrComponents) {
|
|
1963
1986
|
const app = this.ngModuleRef.instance.appName;
|
|
1964
|
-
this.getPlantAppRef(app).subscribe(appRef => {
|
|
1987
|
+
this.getPlantAppRef(app).subscribe((appRef) => {
|
|
1965
1988
|
appRef.registerComponentFactory((componentName, config) => {
|
|
1966
1989
|
const components = coerceArray(componentOrComponents);
|
|
1967
1990
|
const planetComponent = components.find(item => {
|
|
@@ -1971,7 +1994,7 @@ class PlanetComponentLoader {
|
|
|
1971
1994
|
});
|
|
1972
1995
|
if (planetComponent) {
|
|
1973
1996
|
return this.ngZone.run(() => {
|
|
1974
|
-
const componentRef = this.attachComponent(isComponentType(planetComponent) ? planetComponent : planetComponent.component, appRef.appModuleRef, config);
|
|
1997
|
+
const componentRef = this.attachComponent(isComponentType(planetComponent) ? planetComponent : planetComponent.component, appRef.appModuleRef.injector, config);
|
|
1975
1998
|
return componentRef;
|
|
1976
1999
|
});
|
|
1977
2000
|
}
|
|
@@ -1987,7 +2010,7 @@ class PlanetComponentLoader {
|
|
|
1987
2010
|
});
|
|
1988
2011
|
}
|
|
1989
2012
|
load(app, componentName, config) {
|
|
1990
|
-
const result = this.getPlantAppRef(app).pipe(delayWhen(appRef => {
|
|
2013
|
+
const result = this.getPlantAppRef(app).pipe(delayWhen((appRef) => {
|
|
1991
2014
|
if (appRef.getComponentFactory()) {
|
|
1992
2015
|
return of('');
|
|
1993
2016
|
}
|
|
@@ -2007,18 +2030,18 @@ class PlanetComponentLoader {
|
|
|
2007
2030
|
result.subscribe();
|
|
2008
2031
|
return result;
|
|
2009
2032
|
}
|
|
2033
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: PlanetComponentLoader, deps: [{ token: i0.ApplicationRef }, { token: i0.NgModuleRef }, { token: i0.NgZone }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2034
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: PlanetComponentLoader, providedIn: 'root' }); }
|
|
2010
2035
|
}
|
|
2011
|
-
|
|
2012
|
-
PlanetComponentLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: PlanetComponentLoader, providedIn: 'root' });
|
|
2013
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: PlanetComponentLoader, decorators: [{
|
|
2036
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: PlanetComponentLoader, decorators: [{
|
|
2014
2037
|
type: Injectable,
|
|
2015
2038
|
args: [{
|
|
2016
2039
|
providedIn: 'root'
|
|
2017
2040
|
}]
|
|
2018
|
-
}], ctorParameters:
|
|
2041
|
+
}], ctorParameters: () => [{ type: i0.ApplicationRef }, { type: i0.NgModuleRef }, { type: i0.NgZone }, { type: undefined, decorators: [{
|
|
2019
2042
|
type: Inject,
|
|
2020
2043
|
args: [DOCUMENT]
|
|
2021
|
-
}] }]
|
|
2044
|
+
}] }] });
|
|
2022
2045
|
|
|
2023
2046
|
// eslint-disable-next-line @angular-eslint/directive-class-suffix
|
|
2024
2047
|
class PlanetComponentOutlet {
|
|
@@ -2030,7 +2053,7 @@ class PlanetComponentOutlet {
|
|
|
2030
2053
|
this.destroyed$ = new Subject();
|
|
2031
2054
|
}
|
|
2032
2055
|
ngOnChanges(changes) {
|
|
2033
|
-
if (this.planetComponentOutlet && !changes
|
|
2056
|
+
if (this.planetComponentOutlet && !changes['planetComponentOutlet'].isFirstChange()) {
|
|
2034
2057
|
this.loadComponent();
|
|
2035
2058
|
}
|
|
2036
2059
|
}
|
|
@@ -2064,16 +2087,16 @@ class PlanetComponentOutlet {
|
|
|
2064
2087
|
this.componentRef?.dispose();
|
|
2065
2088
|
this.destroyed$.next();
|
|
2066
2089
|
}
|
|
2090
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: PlanetComponentOutlet, deps: [{ token: i0.ElementRef }, { token: PlanetComponentLoader }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2091
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.2.3", type: PlanetComponentOutlet, isStandalone: true, selector: "[planetComponentOutlet]", inputs: { planetComponentOutlet: "planetComponentOutlet", planetComponentOutletApp: "planetComponentOutletApp", planetComponentOutletInitialState: "planetComponentOutletInitialState" }, outputs: { planetComponentLoaded: "planetComponentLoaded" }, usesOnChanges: true, ngImport: i0 }); }
|
|
2067
2092
|
}
|
|
2068
|
-
|
|
2069
|
-
PlanetComponentOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.5", type: PlanetComponentOutlet, isStandalone: true, selector: "[planetComponentOutlet]", inputs: { planetComponentOutlet: "planetComponentOutlet", planetComponentOutletApp: "planetComponentOutletApp", planetComponentOutletInitialState: "planetComponentOutletInitialState" }, outputs: { planetComponentLoaded: "planetComponentLoaded" }, usesOnChanges: true, ngImport: i0 });
|
|
2070
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: PlanetComponentOutlet, decorators: [{
|
|
2093
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: PlanetComponentOutlet, decorators: [{
|
|
2071
2094
|
type: Directive,
|
|
2072
2095
|
args: [{
|
|
2073
2096
|
selector: '[planetComponentOutlet]',
|
|
2074
2097
|
standalone: true
|
|
2075
2098
|
}]
|
|
2076
|
-
}], ctorParameters:
|
|
2099
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: PlanetComponentLoader }, { type: i0.NgZone }], propDecorators: { planetComponentOutlet: [{
|
|
2077
2100
|
type: Input
|
|
2078
2101
|
}], planetComponentOutletApp: [{
|
|
2079
2102
|
type: Input
|
|
@@ -2087,7 +2110,7 @@ class RouteRedirect {
|
|
|
2087
2110
|
constructor(redirectTo) {
|
|
2088
2111
|
this.activatedRoute = inject(ActivatedRoute);
|
|
2089
2112
|
this.router = inject(Router);
|
|
2090
|
-
const finalRedirectTo = redirectTo || this.activatedRoute.snapshot.data
|
|
2113
|
+
const finalRedirectTo = redirectTo || this.activatedRoute.snapshot.data['redirectTo'];
|
|
2091
2114
|
if (finalRedirectTo) {
|
|
2092
2115
|
const activatedRouteUrl = this.activatedRoute.pathFromRoot
|
|
2093
2116
|
.filter(route => {
|
|
@@ -2122,10 +2145,10 @@ class RedirectToRouteComponent {
|
|
|
2122
2145
|
constructor() {
|
|
2123
2146
|
this.routeRedirect = routeRedirect();
|
|
2124
2147
|
}
|
|
2148
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: RedirectToRouteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2149
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.3", type: RedirectToRouteComponent, isStandalone: true, selector: "planet-redirect-to-route", ngImport: i0, template: '', isInline: true }); }
|
|
2125
2150
|
}
|
|
2126
|
-
|
|
2127
|
-
RedirectToRouteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", type: RedirectToRouteComponent, isStandalone: true, selector: "planet-redirect-to-route", ngImport: i0, template: '', isInline: true });
|
|
2128
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: RedirectToRouteComponent, decorators: [{
|
|
2151
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: RedirectToRouteComponent, decorators: [{
|
|
2129
2152
|
type: Component,
|
|
2130
2153
|
args: [{
|
|
2131
2154
|
selector: 'planet-redirect-to-route',
|
|
@@ -2155,11 +2178,11 @@ class NgxPlanetModule {
|
|
|
2155
2178
|
]
|
|
2156
2179
|
};
|
|
2157
2180
|
}
|
|
2181
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: NgxPlanetModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2182
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.2.3", ngImport: i0, type: NgxPlanetModule, imports: [HttpClientModule, PlanetComponentOutlet, EmptyComponent, RedirectToRouteComponent], exports: [HttpClientModule, EmptyComponent, PlanetComponentOutlet] }); }
|
|
2183
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: NgxPlanetModule, imports: [HttpClientModule, HttpClientModule] }); }
|
|
2158
2184
|
}
|
|
2159
|
-
|
|
2160
|
-
NgxPlanetModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.5", ngImport: i0, type: NgxPlanetModule, imports: [HttpClientModule, PlanetComponentOutlet, EmptyComponent, RedirectToRouteComponent], exports: [HttpClientModule, EmptyComponent, PlanetComponentOutlet] });
|
|
2161
|
-
NgxPlanetModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgxPlanetModule, imports: [HttpClientModule, EmptyComponent, RedirectToRouteComponent, HttpClientModule] });
|
|
2162
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgxPlanetModule, decorators: [{
|
|
2185
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: NgxPlanetModule, decorators: [{
|
|
2163
2186
|
type: NgModule,
|
|
2164
2187
|
args: [{
|
|
2165
2188
|
declarations: [],
|
|
@@ -2184,5 +2207,5 @@ class PlantComponentConfig {
|
|
|
2184
2207
|
* Generated bundle index. Do not edit.
|
|
2185
2208
|
*/
|
|
2186
2209
|
|
|
2187
|
-
export { ApplicationStatus, AssetsLoader, EmptyComponent, GlobalEventDispatcher, NgxPlanetModule, PLANET_APPLICATIONS, Planet, PlanetApplicationLoader,
|
|
2210
|
+
export { ApplicationStatus, AssetsLoader, EmptyComponent, GlobalEventDispatcher, NgxPlanetModule, PLANET_APPLICATIONS, Planet, PlanetApplicationLoader, PlanetApplicationService, PlanetComponentLoader, PlanetComponentOutlet, PlanetComponentRef, PlanetPortalApplication, PlantComponentConfig, RedirectToRouteComponent, SwitchModes, defineApplication, getPlanetApplicationRef, getPortalApplicationData, redirectToRoute, routeRedirect };
|
|
2188
2211
|
//# sourceMappingURL=worktile-planet.mjs.map
|