@worktile/planet 19.0.0-next.1 → 20.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 +20 -0
- package/README.md +0 -5
- package/fesm2022/worktile-planet.mjs +310 -318
- package/fesm2022/worktile-planet.mjs.map +1 -1
- package/index.d.ts +467 -6
- package/index.d.ts.map +1 -0
- package/package.json +3 -5
- package/application/ng-planet-application-ref.d.ts +0 -46
- package/application/ng-planet-application-ref.d.ts.map +0 -1
- package/application/planet-application-loader.d.ts +0 -78
- package/application/planet-application-loader.d.ts.map +0 -1
- package/application/planet-application-ref.d.ts +0 -12
- package/application/planet-application-ref.d.ts.map +0 -1
- package/application/planet-application.service.d.ts +0 -22
- package/application/planet-application.service.d.ts.map +0 -1
- package/application/portal-application.d.ts +0 -20
- package/application/portal-application.d.ts.map +0 -1
- package/assets-loader.d.ts +0 -47
- package/assets-loader.d.ts.map +0 -1
- package/component/planet-component-loader.d.ts +0 -31
- package/component/planet-component-loader.d.ts.map +0 -1
- package/component/planet-component-outlet.d.ts +0 -26
- package/component/planet-component-outlet.d.ts.map +0 -1
- package/component/planet-component-types.d.ts +0 -11
- package/component/planet-component-types.d.ts.map +0 -1
- package/component/plant-component.config.d.ts +0 -22
- package/component/plant-component.config.d.ts.map +0 -1
- package/debug.d.ts +0 -22
- package/debug.d.ts.map +0 -1
- package/empty/empty.component.d.ts +0 -6
- package/empty/empty.component.d.ts.map +0 -1
- package/esm2022/application/ng-planet-application-ref.mjs +0 -116
- package/esm2022/application/planet-application-loader.mjs +0 -459
- package/esm2022/application/planet-application-ref.mjs +0 -2
- package/esm2022/application/planet-application.service.mjs +0 -86
- package/esm2022/application/portal-application.mjs +0 -25
- package/esm2022/assets-loader.mjs +0 -332
- package/esm2022/component/planet-component-loader.mjs +0 -213
- package/esm2022/component/planet-component-outlet.mjs +0 -72
- package/esm2022/component/planet-component-types.mjs +0 -3
- package/esm2022/component/plant-component.config.mjs +0 -7
- package/esm2022/debug.mjs +0 -33
- package/esm2022/empty/empty.component.mjs +0 -17
- package/esm2022/global-event-dispatcher.mjs +0 -70
- package/esm2022/global-planet.mjs +0 -63
- package/esm2022/helpers.mjs +0 -187
- package/esm2022/inner-types.mjs +0 -2
- package/esm2022/module.mjs +0 -33
- package/esm2022/planet.class.mjs +0 -9
- package/esm2022/planet.mjs +0 -97
- package/esm2022/public-api.mjs +0 -19
- package/esm2022/router/route-redirect.mjs +0 -63
- package/esm2022/sandbox/constants.mjs +0 -7
- package/esm2022/sandbox/exec.mjs +0 -15
- package/esm2022/sandbox/index.mjs +0 -20
- package/esm2022/sandbox/proxy/patches/document.mjs +0 -12
- package/esm2022/sandbox/proxy/patches/eventListener.mjs +0 -41
- package/esm2022/sandbox/proxy/patches/index.mjs +0 -11
- package/esm2022/sandbox/proxy/patches/storage.mjs +0 -40
- package/esm2022/sandbox/proxy/patches/timer.mjs +0 -43
- package/esm2022/sandbox/proxy/proxies/common.mjs +0 -132
- package/esm2022/sandbox/proxy/proxies/document.mjs +0 -126
- package/esm2022/sandbox/proxy/proxies/window.mjs +0 -158
- package/esm2022/sandbox/proxy/proxy-sandbox.mjs +0 -49
- package/esm2022/sandbox/proxy/types.mjs +0 -2
- package/esm2022/sandbox/sandbox.mjs +0 -7
- package/esm2022/sandbox/snapshot/snapshot-sandbox.mjs +0 -12
- package/esm2022/sandbox/types.mjs +0 -2
- package/esm2022/worktile-planet.mjs +0 -5
- package/global-event-dispatcher.d.ts +0 -23
- package/global-event-dispatcher.d.ts.map +0 -1
- package/global-planet.d.ts +0 -25
- package/global-planet.d.ts.map +0 -1
- package/helpers.d.ts +0 -36
- package/helpers.d.ts.map +0 -1
- package/inner-types.d.ts +0 -15
- package/inner-types.d.ts.map +0 -1
- package/module.d.ts +0 -13
- package/module.d.ts.map +0 -1
- package/planet.class.d.ts +0 -118
- package/planet.class.d.ts.map +0 -1
- package/planet.d.ts +0 -32
- package/planet.d.ts.map +0 -1
- package/public-api.d.ts +0 -17
- package/public-api.d.ts.map +0 -1
- package/router/route-redirect.d.ts +0 -16
- package/router/route-redirect.d.ts.map +0 -1
- package/sandbox/constants.d.ts +0 -7
- package/sandbox/constants.d.ts.map +0 -1
- package/sandbox/exec.d.ts +0 -3
- package/sandbox/exec.d.ts.map +0 -1
- package/sandbox/index.d.ts +0 -7
- package/sandbox/index.d.ts.map +0 -1
- package/sandbox/proxy/patches/document.d.ts +0 -3
- package/sandbox/proxy/patches/document.d.ts.map +0 -1
- package/sandbox/proxy/patches/eventListener.d.ts +0 -3
- package/sandbox/proxy/patches/eventListener.d.ts.map +0 -1
- package/sandbox/proxy/patches/index.d.ts +0 -3
- package/sandbox/proxy/patches/index.d.ts.map +0 -1
- package/sandbox/proxy/patches/storage.d.ts +0 -15
- package/sandbox/proxy/patches/storage.d.ts.map +0 -1
- package/sandbox/proxy/patches/timer.d.ts +0 -3
- package/sandbox/proxy/patches/timer.d.ts.map +0 -1
- package/sandbox/proxy/proxies/common.d.ts +0 -13
- package/sandbox/proxy/proxies/common.d.ts.map +0 -1
- package/sandbox/proxy/proxies/document.d.ts +0 -14
- package/sandbox/proxy/proxies/document.d.ts.map +0 -1
- package/sandbox/proxy/proxies/window.d.ts +0 -13
- package/sandbox/proxy/proxies/window.d.ts.map +0 -1
- package/sandbox/proxy/proxy-sandbox.d.ts +0 -16
- package/sandbox/proxy/proxy-sandbox.d.ts.map +0 -1
- package/sandbox/proxy/types.d.ts +0 -14
- package/sandbox/proxy/types.d.ts.map +0 -1
- package/sandbox/sandbox.d.ts +0 -12
- package/sandbox/sandbox.d.ts.map +0 -1
- package/sandbox/snapshot/snapshot-sandbox.d.ts +0 -9
- package/sandbox/snapshot/snapshot-sandbox.d.ts.map +0 -1
- package/sandbox/types.d.ts +0 -2
- package/sandbox/types.d.ts.map +0 -1
- package/worktile-planet.d.ts.map +0 -1
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken,
|
|
3
|
-
import * as i3 from '@angular/router';
|
|
2
|
+
import { InjectionToken, NgZone, NgModuleRef, inject, Injectable, signal, Injector, ApplicationRef, ChangeDetectionStrategy, Component, createComponent, reflectComponentType, TemplateRef, ElementRef, EventEmitter, Output, Input, Directive, NgModule } from '@angular/core';
|
|
4
3
|
import { Router, NavigationEnd, ActivatedRoute } from '@angular/router';
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { Observable, of, concat, forkJoin, from, Subject, timer } from 'rxjs';
|
|
9
|
-
import { DOCUMENT } from '@angular/common';
|
|
4
|
+
import { HttpClient, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
|
5
|
+
import { take, map, shareReplay, concatAll, switchMap, filter, distinctUntilChanged, catchError, tap, share, startWith, delayWhen, takeUntil } from 'rxjs/operators';
|
|
6
|
+
import { Observable, from, of, concat, forkJoin, Subject, timer } from 'rxjs';
|
|
10
7
|
|
|
11
8
|
var SwitchModes;
|
|
12
9
|
(function (SwitchModes) {
|
|
@@ -852,12 +849,259 @@ function getSandboxInstance() {
|
|
|
852
849
|
return window[SANDBOX_INSTANCE];
|
|
853
850
|
}
|
|
854
851
|
|
|
852
|
+
class NgPlanetApplicationRef {
|
|
853
|
+
get selector() {
|
|
854
|
+
return this.innerSelector;
|
|
855
|
+
}
|
|
856
|
+
get ngZone() {
|
|
857
|
+
return (this.injector || this.appModuleRef?.injector)?.get(NgZone);
|
|
858
|
+
}
|
|
859
|
+
get sandbox() {
|
|
860
|
+
return getSandboxInstance();
|
|
861
|
+
}
|
|
862
|
+
get bootstrapped() {
|
|
863
|
+
return !!(this.appModuleRef || this.appRef);
|
|
864
|
+
}
|
|
865
|
+
constructor(name, options) {
|
|
866
|
+
this.name = name;
|
|
867
|
+
if (options) {
|
|
868
|
+
this.template = options.template;
|
|
869
|
+
this.innerSelector = this.template ? getTagNameByTemplate(this.template) : '';
|
|
870
|
+
this.appModuleBootstrap = options.bootstrap;
|
|
871
|
+
}
|
|
872
|
+
// This is a hack, since NgZone doesn't allow you to configure the property that identifies your zone.
|
|
873
|
+
// See https://github.com/PlaceMe-SAS/single-spa-angular-cli/issues/33,
|
|
874
|
+
// NgZone.isInAngularZone = () => {
|
|
875
|
+
// // @ts-ignore
|
|
876
|
+
// return window.Zone.current._properties[`ngx-planet-${name}`] === true;
|
|
877
|
+
// };
|
|
878
|
+
}
|
|
879
|
+
// 子应用路由变化后同步修改 portal 的 Route
|
|
880
|
+
syncPortalRouteWhenNavigationEnd() {
|
|
881
|
+
const router = (this.injector || this.appModuleRef?.injector)?.get(Router);
|
|
882
|
+
if (router) {
|
|
883
|
+
router.events.subscribe(event => {
|
|
884
|
+
if (event instanceof NavigationEnd) {
|
|
885
|
+
const currentNavigation = router.getCurrentNavigation();
|
|
886
|
+
this.ngZone?.onStable
|
|
887
|
+
.asObservable()
|
|
888
|
+
.pipe(take(1))
|
|
889
|
+
.subscribe(() => {
|
|
890
|
+
this.portalApp.ngZone.run(() => {
|
|
891
|
+
if (currentNavigation?.extras?.browserUrl) {
|
|
892
|
+
this.portalApp.router.navigateByUrl(event.url, {
|
|
893
|
+
browserUrl: currentNavigation.extras.browserUrl
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
else {
|
|
897
|
+
this.portalApp.router.navigateByUrl(event.url);
|
|
898
|
+
}
|
|
899
|
+
});
|
|
900
|
+
});
|
|
901
|
+
}
|
|
902
|
+
});
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
bootstrap(app) {
|
|
906
|
+
if (!this.appModuleBootstrap) {
|
|
907
|
+
throw new Error(`app(${this.name}) is not defined`);
|
|
908
|
+
}
|
|
909
|
+
this.portalApp = app;
|
|
910
|
+
return from(this.appModuleBootstrap(app).then(appModuleRef => {
|
|
911
|
+
if (appModuleRef['instance']) {
|
|
912
|
+
this.appModuleRef = appModuleRef;
|
|
913
|
+
this.appModuleRef.instance.appName = this.name;
|
|
914
|
+
this.injector = this.appModuleRef.injector;
|
|
915
|
+
}
|
|
916
|
+
else {
|
|
917
|
+
this.appRef = appModuleRef;
|
|
918
|
+
this.injector = this.appRef.injector;
|
|
919
|
+
const moduleRef = this.appRef.injector.get(NgModuleRef);
|
|
920
|
+
moduleRef.instance = { appName: this.name };
|
|
921
|
+
}
|
|
922
|
+
this.syncPortalRouteWhenNavigationEnd();
|
|
923
|
+
return this;
|
|
924
|
+
}));
|
|
925
|
+
}
|
|
926
|
+
getRouter() {
|
|
927
|
+
return (this.injector || this.appModuleRef?.injector)?.get(Router);
|
|
928
|
+
}
|
|
929
|
+
getCurrentRouterStateUrl() {
|
|
930
|
+
return this.getRouter()?.routerState.snapshot.url;
|
|
931
|
+
}
|
|
932
|
+
navigateByUrl(url, extras) {
|
|
933
|
+
const router = this.getRouter();
|
|
934
|
+
this.ngZone?.run(() => {
|
|
935
|
+
router?.navigateByUrl(url, extras);
|
|
936
|
+
});
|
|
937
|
+
}
|
|
938
|
+
getComponentFactory() {
|
|
939
|
+
return this.componentFactory;
|
|
940
|
+
}
|
|
941
|
+
registerComponentFactory(componentFactory) {
|
|
942
|
+
this.componentFactory = componentFactory;
|
|
943
|
+
}
|
|
944
|
+
destroy() {
|
|
945
|
+
if (this.appModuleRef || this.appRef) {
|
|
946
|
+
const router = (this.injector || this.appModuleRef?.injector)?.get(Router);
|
|
947
|
+
if (router) {
|
|
948
|
+
router.dispose();
|
|
949
|
+
}
|
|
950
|
+
if (this.sandbox) {
|
|
951
|
+
this.sandbox.destroy();
|
|
952
|
+
}
|
|
953
|
+
this.appModuleRef?.destroy();
|
|
954
|
+
this.appModuleRef = undefined;
|
|
955
|
+
this.appRef?.destroy();
|
|
956
|
+
this.appRef = undefined;
|
|
957
|
+
this.injector = undefined;
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
const globalPlanet = (window.planet = window.planet || {
|
|
963
|
+
apps: {}
|
|
964
|
+
});
|
|
965
|
+
function defineApplication(name, options) {
|
|
966
|
+
if (globalPlanet.apps[name]) {
|
|
967
|
+
throw new Error(`${name} application has exist.`);
|
|
968
|
+
}
|
|
969
|
+
if (isFunction(options)) {
|
|
970
|
+
options = {
|
|
971
|
+
template: '',
|
|
972
|
+
bootstrap: options
|
|
973
|
+
};
|
|
974
|
+
}
|
|
975
|
+
const appRef = new NgPlanetApplicationRef(name, options);
|
|
976
|
+
globalPlanet.apps[name] = appRef;
|
|
977
|
+
}
|
|
978
|
+
function getPlanetApplicationRef(appName) {
|
|
979
|
+
if (globalPlanet && globalPlanet.apps && globalPlanet.apps[appName]) {
|
|
980
|
+
return globalPlanet.apps[appName];
|
|
981
|
+
}
|
|
982
|
+
else {
|
|
983
|
+
return null;
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
function getBootstrappedPlanetApplicationRef(appName) {
|
|
987
|
+
const plantAppRef = getPlanetApplicationRef(appName);
|
|
988
|
+
if (plantAppRef) {
|
|
989
|
+
// 兼容之前的版本,之前是通过 appModuleRef 来判断是否启用的
|
|
990
|
+
if (plantAppRef.bootstrapped || plantAppRef['appModuleRef']) {
|
|
991
|
+
return plantAppRef;
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
return null;
|
|
995
|
+
}
|
|
996
|
+
function setPortalApplicationData(data) {
|
|
997
|
+
if (globalPlanet.portalApplication) {
|
|
998
|
+
globalPlanet.portalApplication.data = data;
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
function getPortalApplicationData() {
|
|
1002
|
+
return globalPlanet.portalApplication?.data;
|
|
1003
|
+
}
|
|
1004
|
+
function setApplicationLoader(loader) {
|
|
1005
|
+
globalPlanet.applicationLoader = loader;
|
|
1006
|
+
}
|
|
1007
|
+
function getApplicationLoader() {
|
|
1008
|
+
return globalPlanet.applicationLoader;
|
|
1009
|
+
}
|
|
1010
|
+
function setApplicationService(service) {
|
|
1011
|
+
globalPlanet.applicationService = service;
|
|
1012
|
+
}
|
|
1013
|
+
function getApplicationService() {
|
|
1014
|
+
return globalPlanet.applicationService;
|
|
1015
|
+
}
|
|
1016
|
+
function clearGlobalPlanet() {
|
|
1017
|
+
window.planet.apps = {};
|
|
1018
|
+
window.planet.portalApplication = null;
|
|
1019
|
+
window.planet.applicationLoader = null;
|
|
1020
|
+
window.planet.applicationService = null;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
class PlanetApplicationService {
|
|
1024
|
+
constructor() {
|
|
1025
|
+
this.http = inject(HttpClient);
|
|
1026
|
+
this.apps = [];
|
|
1027
|
+
this.appsMap = {};
|
|
1028
|
+
if (getApplicationService()) {
|
|
1029
|
+
throw new Error('PlanetApplicationService has been injected in the portal, repeated injection is not allowed');
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
register(appOrApps) {
|
|
1033
|
+
const apps = coerceArray(appOrApps);
|
|
1034
|
+
apps.forEach(app => {
|
|
1035
|
+
if (this.appsMap[app.name]) {
|
|
1036
|
+
throw new Error(`${app.name} has be registered.`);
|
|
1037
|
+
}
|
|
1038
|
+
this.apps.push(app);
|
|
1039
|
+
this.appsMap[app.name] = app;
|
|
1040
|
+
});
|
|
1041
|
+
}
|
|
1042
|
+
registerByUrl(url) {
|
|
1043
|
+
const result = this.http.get(`${url}`).pipe(map(apps => {
|
|
1044
|
+
if (apps && Array.isArray(apps)) {
|
|
1045
|
+
this.register(apps);
|
|
1046
|
+
}
|
|
1047
|
+
else {
|
|
1048
|
+
this.register(apps);
|
|
1049
|
+
}
|
|
1050
|
+
}), shareReplay());
|
|
1051
|
+
result.subscribe();
|
|
1052
|
+
return result;
|
|
1053
|
+
}
|
|
1054
|
+
unregister(name) {
|
|
1055
|
+
if (this.appsMap[name]) {
|
|
1056
|
+
delete this.appsMap[name];
|
|
1057
|
+
this.apps = this.apps.filter(app => {
|
|
1058
|
+
return app.name !== name;
|
|
1059
|
+
});
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
getAppsByMatchedUrl(url) {
|
|
1063
|
+
return this.getApps().filter(app => {
|
|
1064
|
+
if (app.routerPathPrefix instanceof RegExp) {
|
|
1065
|
+
return app.routerPathPrefix.test(url);
|
|
1066
|
+
}
|
|
1067
|
+
else {
|
|
1068
|
+
return (url === app.routerPathPrefix ||
|
|
1069
|
+
(url.startsWith(app.routerPathPrefix) && ['/', '?'].includes(url[app.routerPathPrefix.length])));
|
|
1070
|
+
}
|
|
1071
|
+
});
|
|
1072
|
+
}
|
|
1073
|
+
getAppByName(name) {
|
|
1074
|
+
return this.appsMap[name];
|
|
1075
|
+
}
|
|
1076
|
+
getAppsToPreload(excludeAppNames) {
|
|
1077
|
+
return this.getApps().filter(app => {
|
|
1078
|
+
if (excludeAppNames) {
|
|
1079
|
+
return app.preload && !excludeAppNames.includes(app.name);
|
|
1080
|
+
}
|
|
1081
|
+
else {
|
|
1082
|
+
return app.preload;
|
|
1083
|
+
}
|
|
1084
|
+
});
|
|
1085
|
+
}
|
|
1086
|
+
getApps() {
|
|
1087
|
+
return this.apps;
|
|
1088
|
+
}
|
|
1089
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: PlanetApplicationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1090
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: PlanetApplicationService, providedIn: 'root' }); }
|
|
1091
|
+
}
|
|
1092
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: PlanetApplicationService, decorators: [{
|
|
1093
|
+
type: Injectable,
|
|
1094
|
+
args: [{
|
|
1095
|
+
providedIn: 'root'
|
|
1096
|
+
}]
|
|
1097
|
+
}], ctorParameters: () => [] });
|
|
1098
|
+
|
|
855
1099
|
const STYLE_LINK_OR_SCRIPT_REG = /<[script|link].*?>/gi;
|
|
856
1100
|
const LINK_OR_SRC_REG = /(src|href)=["'](.*?[\.js|\.css])["']/i;
|
|
857
1101
|
const TAG_ATTRS_REG = /(type|defer|async|rel)((=["'].*?["'])|\s|\>)/gi;
|
|
858
1102
|
class AssetsLoader {
|
|
859
|
-
constructor(
|
|
860
|
-
this.http =
|
|
1103
|
+
constructor() {
|
|
1104
|
+
this.http = inject(HttpClient);
|
|
861
1105
|
this.loadedSources = [];
|
|
862
1106
|
}
|
|
863
1107
|
loadScript(scriptAsset) {
|
|
@@ -1166,263 +1410,15 @@ class AssetsLoader {
|
|
|
1166
1410
|
}
|
|
1167
1411
|
}));
|
|
1168
1412
|
}
|
|
1169
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1170
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1171
|
-
}
|
|
1172
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: AssetsLoader, decorators: [{
|
|
1173
|
-
type: Injectable,
|
|
1174
|
-
args: [{
|
|
1175
|
-
providedIn: 'root'
|
|
1176
|
-
}]
|
|
1177
|
-
}], ctorParameters: () => [{ type: i1.HttpClient }] });
|
|
1178
|
-
|
|
1179
|
-
class NgPlanetApplicationRef {
|
|
1180
|
-
get selector() {
|
|
1181
|
-
return this.innerSelector;
|
|
1182
|
-
}
|
|
1183
|
-
get ngZone() {
|
|
1184
|
-
return (this.injector || this.appModuleRef?.injector)?.get(NgZone);
|
|
1185
|
-
}
|
|
1186
|
-
get sandbox() {
|
|
1187
|
-
return getSandboxInstance();
|
|
1188
|
-
}
|
|
1189
|
-
get bootstrapped() {
|
|
1190
|
-
return !!(this.appModuleRef || this.appRef);
|
|
1191
|
-
}
|
|
1192
|
-
constructor(name, options) {
|
|
1193
|
-
this.name = name;
|
|
1194
|
-
if (options) {
|
|
1195
|
-
this.template = options.template;
|
|
1196
|
-
this.innerSelector = this.template ? getTagNameByTemplate(this.template) : '';
|
|
1197
|
-
this.appModuleBootstrap = options.bootstrap;
|
|
1198
|
-
}
|
|
1199
|
-
// This is a hack, since NgZone doesn't allow you to configure the property that identifies your zone.
|
|
1200
|
-
// See https://github.com/PlaceMe-SAS/single-spa-angular-cli/issues/33,
|
|
1201
|
-
// NgZone.isInAngularZone = () => {
|
|
1202
|
-
// // @ts-ignore
|
|
1203
|
-
// return window.Zone.current._properties[`ngx-planet-${name}`] === true;
|
|
1204
|
-
// };
|
|
1205
|
-
}
|
|
1206
|
-
// 子应用路由变化后同步修改 portal 的 Route
|
|
1207
|
-
syncPortalRouteWhenNavigationEnd() {
|
|
1208
|
-
const router = (this.injector || this.appModuleRef?.injector)?.get(Router);
|
|
1209
|
-
if (router) {
|
|
1210
|
-
router.events.subscribe(event => {
|
|
1211
|
-
if (event instanceof NavigationEnd) {
|
|
1212
|
-
const currentNavigation = router.getCurrentNavigation();
|
|
1213
|
-
this.ngZone?.onStable
|
|
1214
|
-
.asObservable()
|
|
1215
|
-
.pipe(take(1))
|
|
1216
|
-
.subscribe(() => {
|
|
1217
|
-
this.portalApp.ngZone.run(() => {
|
|
1218
|
-
if (currentNavigation?.extras?.browserUrl) {
|
|
1219
|
-
this.portalApp.router.navigateByUrl(event.url, {
|
|
1220
|
-
browserUrl: currentNavigation.extras.browserUrl
|
|
1221
|
-
});
|
|
1222
|
-
}
|
|
1223
|
-
else {
|
|
1224
|
-
this.portalApp.router.navigateByUrl(event.url);
|
|
1225
|
-
}
|
|
1226
|
-
});
|
|
1227
|
-
});
|
|
1228
|
-
}
|
|
1229
|
-
});
|
|
1230
|
-
}
|
|
1231
|
-
}
|
|
1232
|
-
bootstrap(app) {
|
|
1233
|
-
if (!this.appModuleBootstrap) {
|
|
1234
|
-
throw new Error(`app(${this.name}) is not defined`);
|
|
1235
|
-
}
|
|
1236
|
-
this.portalApp = app;
|
|
1237
|
-
return from(this.appModuleBootstrap(app).then(appModuleRef => {
|
|
1238
|
-
if (appModuleRef['instance']) {
|
|
1239
|
-
this.appModuleRef = appModuleRef;
|
|
1240
|
-
this.appModuleRef.instance.appName = this.name;
|
|
1241
|
-
this.injector = this.appModuleRef.injector;
|
|
1242
|
-
}
|
|
1243
|
-
else {
|
|
1244
|
-
this.appRef = appModuleRef;
|
|
1245
|
-
this.injector = this.appRef.injector;
|
|
1246
|
-
const moduleRef = this.appRef.injector.get(NgModuleRef);
|
|
1247
|
-
moduleRef.instance = { appName: this.name };
|
|
1248
|
-
}
|
|
1249
|
-
this.syncPortalRouteWhenNavigationEnd();
|
|
1250
|
-
return this;
|
|
1251
|
-
}));
|
|
1252
|
-
}
|
|
1253
|
-
getRouter() {
|
|
1254
|
-
return (this.injector || this.appModuleRef?.injector)?.get(Router);
|
|
1255
|
-
}
|
|
1256
|
-
getCurrentRouterStateUrl() {
|
|
1257
|
-
return this.getRouter()?.routerState.snapshot.url;
|
|
1258
|
-
}
|
|
1259
|
-
navigateByUrl(url, extras) {
|
|
1260
|
-
const router = this.getRouter();
|
|
1261
|
-
this.ngZone?.run(() => {
|
|
1262
|
-
router?.navigateByUrl(url, extras);
|
|
1263
|
-
});
|
|
1264
|
-
}
|
|
1265
|
-
getComponentFactory() {
|
|
1266
|
-
return this.componentFactory;
|
|
1267
|
-
}
|
|
1268
|
-
registerComponentFactory(componentFactory) {
|
|
1269
|
-
this.componentFactory = componentFactory;
|
|
1270
|
-
}
|
|
1271
|
-
destroy() {
|
|
1272
|
-
if (this.appModuleRef || this.appRef) {
|
|
1273
|
-
const router = (this.injector || this.appModuleRef?.injector)?.get(Router);
|
|
1274
|
-
if (router) {
|
|
1275
|
-
router.dispose();
|
|
1276
|
-
}
|
|
1277
|
-
if (this.sandbox) {
|
|
1278
|
-
this.sandbox.destroy();
|
|
1279
|
-
}
|
|
1280
|
-
this.appModuleRef?.destroy();
|
|
1281
|
-
this.appModuleRef = undefined;
|
|
1282
|
-
this.appRef?.destroy();
|
|
1283
|
-
this.appRef = undefined;
|
|
1284
|
-
this.injector = undefined;
|
|
1285
|
-
}
|
|
1286
|
-
}
|
|
1413
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AssetsLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1414
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AssetsLoader, providedIn: 'root' }); }
|
|
1287
1415
|
}
|
|
1288
|
-
|
|
1289
|
-
const globalPlanet = (window.planet = window.planet || {
|
|
1290
|
-
apps: {}
|
|
1291
|
-
});
|
|
1292
|
-
function defineApplication(name, options) {
|
|
1293
|
-
if (globalPlanet.apps[name]) {
|
|
1294
|
-
throw new Error(`${name} application has exist.`);
|
|
1295
|
-
}
|
|
1296
|
-
if (isFunction(options)) {
|
|
1297
|
-
options = {
|
|
1298
|
-
template: '',
|
|
1299
|
-
bootstrap: options
|
|
1300
|
-
};
|
|
1301
|
-
}
|
|
1302
|
-
const appRef = new NgPlanetApplicationRef(name, options);
|
|
1303
|
-
globalPlanet.apps[name] = appRef;
|
|
1304
|
-
}
|
|
1305
|
-
function getPlanetApplicationRef(appName) {
|
|
1306
|
-
if (globalPlanet && globalPlanet.apps && globalPlanet.apps[appName]) {
|
|
1307
|
-
return globalPlanet.apps[appName];
|
|
1308
|
-
}
|
|
1309
|
-
else {
|
|
1310
|
-
return null;
|
|
1311
|
-
}
|
|
1312
|
-
}
|
|
1313
|
-
function getBootstrappedPlanetApplicationRef(appName) {
|
|
1314
|
-
const plantAppRef = getPlanetApplicationRef(appName);
|
|
1315
|
-
if (plantAppRef) {
|
|
1316
|
-
// 兼容之前的版本,之前是通过 appModuleRef 来判断是否启用的
|
|
1317
|
-
if (plantAppRef.bootstrapped || plantAppRef['appModuleRef']) {
|
|
1318
|
-
return plantAppRef;
|
|
1319
|
-
}
|
|
1320
|
-
}
|
|
1321
|
-
return null;
|
|
1322
|
-
}
|
|
1323
|
-
function setPortalApplicationData(data) {
|
|
1324
|
-
if (globalPlanet.portalApplication) {
|
|
1325
|
-
globalPlanet.portalApplication.data = data;
|
|
1326
|
-
}
|
|
1327
|
-
}
|
|
1328
|
-
function getPortalApplicationData() {
|
|
1329
|
-
return globalPlanet.portalApplication?.data;
|
|
1330
|
-
}
|
|
1331
|
-
function setApplicationLoader(loader) {
|
|
1332
|
-
globalPlanet.applicationLoader = loader;
|
|
1333
|
-
}
|
|
1334
|
-
function getApplicationLoader() {
|
|
1335
|
-
return globalPlanet.applicationLoader;
|
|
1336
|
-
}
|
|
1337
|
-
function setApplicationService(service) {
|
|
1338
|
-
globalPlanet.applicationService = service;
|
|
1339
|
-
}
|
|
1340
|
-
function getApplicationService() {
|
|
1341
|
-
return globalPlanet.applicationService;
|
|
1342
|
-
}
|
|
1343
|
-
function clearGlobalPlanet() {
|
|
1344
|
-
window.planet.apps = {};
|
|
1345
|
-
window.planet.portalApplication = null;
|
|
1346
|
-
window.planet.applicationLoader = null;
|
|
1347
|
-
window.planet.applicationService = null;
|
|
1348
|
-
}
|
|
1349
|
-
|
|
1350
|
-
class PlanetApplicationService {
|
|
1351
|
-
constructor(http, assetsLoader) {
|
|
1352
|
-
this.http = http;
|
|
1353
|
-
this.assetsLoader = assetsLoader;
|
|
1354
|
-
this.apps = [];
|
|
1355
|
-
this.appsMap = {};
|
|
1356
|
-
if (getApplicationService()) {
|
|
1357
|
-
throw new Error('PlanetApplicationService has been injected in the portal, repeated injection is not allowed');
|
|
1358
|
-
}
|
|
1359
|
-
}
|
|
1360
|
-
register(appOrApps) {
|
|
1361
|
-
const apps = coerceArray(appOrApps);
|
|
1362
|
-
apps.forEach(app => {
|
|
1363
|
-
if (this.appsMap[app.name]) {
|
|
1364
|
-
throw new Error(`${app.name} has be registered.`);
|
|
1365
|
-
}
|
|
1366
|
-
this.apps.push(app);
|
|
1367
|
-
this.appsMap[app.name] = app;
|
|
1368
|
-
});
|
|
1369
|
-
}
|
|
1370
|
-
registerByUrl(url) {
|
|
1371
|
-
const result = this.http.get(`${url}`).pipe(map(apps => {
|
|
1372
|
-
if (apps && Array.isArray(apps)) {
|
|
1373
|
-
this.register(apps);
|
|
1374
|
-
}
|
|
1375
|
-
else {
|
|
1376
|
-
this.register(apps);
|
|
1377
|
-
}
|
|
1378
|
-
}), shareReplay());
|
|
1379
|
-
result.subscribe();
|
|
1380
|
-
return result;
|
|
1381
|
-
}
|
|
1382
|
-
unregister(name) {
|
|
1383
|
-
if (this.appsMap[name]) {
|
|
1384
|
-
delete this.appsMap[name];
|
|
1385
|
-
this.apps = this.apps.filter(app => {
|
|
1386
|
-
return app.name !== name;
|
|
1387
|
-
});
|
|
1388
|
-
}
|
|
1389
|
-
}
|
|
1390
|
-
getAppsByMatchedUrl(url) {
|
|
1391
|
-
return this.getApps().filter(app => {
|
|
1392
|
-
if (app.routerPathPrefix instanceof RegExp) {
|
|
1393
|
-
return app.routerPathPrefix.test(url);
|
|
1394
|
-
}
|
|
1395
|
-
else {
|
|
1396
|
-
return (url === app.routerPathPrefix ||
|
|
1397
|
-
(url.startsWith(app.routerPathPrefix) && ['/', '?'].includes(url[app.routerPathPrefix.length])));
|
|
1398
|
-
}
|
|
1399
|
-
});
|
|
1400
|
-
}
|
|
1401
|
-
getAppByName(name) {
|
|
1402
|
-
return this.appsMap[name];
|
|
1403
|
-
}
|
|
1404
|
-
getAppsToPreload(excludeAppNames) {
|
|
1405
|
-
return this.getApps().filter(app => {
|
|
1406
|
-
if (excludeAppNames) {
|
|
1407
|
-
return app.preload && !excludeAppNames.includes(app.name);
|
|
1408
|
-
}
|
|
1409
|
-
else {
|
|
1410
|
-
return app.preload;
|
|
1411
|
-
}
|
|
1412
|
-
});
|
|
1413
|
-
}
|
|
1414
|
-
getApps() {
|
|
1415
|
-
return this.apps;
|
|
1416
|
-
}
|
|
1417
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: PlanetApplicationService, deps: [{ token: i1.HttpClient }, { token: AssetsLoader }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1418
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: PlanetApplicationService, providedIn: 'root' }); }
|
|
1419
|
-
}
|
|
1420
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: PlanetApplicationService, decorators: [{
|
|
1416
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AssetsLoader, decorators: [{
|
|
1421
1417
|
type: Injectable,
|
|
1422
1418
|
args: [{
|
|
1423
1419
|
providedIn: 'root'
|
|
1424
1420
|
}]
|
|
1425
|
-
}], ctorParameters: () => [
|
|
1421
|
+
}], ctorParameters: () => [] });
|
|
1426
1422
|
|
|
1427
1423
|
class PlanetPortalApplication {
|
|
1428
1424
|
constructor() {
|
|
@@ -1459,8 +1455,8 @@ class GlobalEventDispatcher {
|
|
|
1459
1455
|
this.hasAddGlobalEventListener = false;
|
|
1460
1456
|
window.removeEventListener(CUSTOM_EVENT_NAME, this.globalEventListener);
|
|
1461
1457
|
}
|
|
1462
|
-
constructor(
|
|
1463
|
-
this.ngZone =
|
|
1458
|
+
constructor() {
|
|
1459
|
+
this.ngZone = inject(NgZone);
|
|
1464
1460
|
this.subject$ = new Subject();
|
|
1465
1461
|
this.hasAddGlobalEventListener = false;
|
|
1466
1462
|
this.subscriptionCount = 0;
|
|
@@ -1505,15 +1501,15 @@ class GlobalEventDispatcher {
|
|
|
1505
1501
|
getSubscriptionCount() {
|
|
1506
1502
|
return this.subscriptionCount;
|
|
1507
1503
|
}
|
|
1508
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1509
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1504
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GlobalEventDispatcher, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1505
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GlobalEventDispatcher, providedIn: 'root' }); }
|
|
1510
1506
|
}
|
|
1511
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1507
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GlobalEventDispatcher, decorators: [{
|
|
1512
1508
|
type: Injectable,
|
|
1513
1509
|
args: [{
|
|
1514
1510
|
providedIn: 'root'
|
|
1515
1511
|
}]
|
|
1516
|
-
}], ctorParameters: () => [
|
|
1512
|
+
}], ctorParameters: () => [] });
|
|
1517
1513
|
|
|
1518
1514
|
/**
|
|
1519
1515
|
* Debug factory for debug module
|
|
@@ -1564,10 +1560,10 @@ class PlanetApplicationLoader {
|
|
|
1564
1560
|
get appsLoadingStart() {
|
|
1565
1561
|
return this.appsLoadingStart$.asObservable();
|
|
1566
1562
|
}
|
|
1567
|
-
constructor(
|
|
1568
|
-
this.assetsLoader =
|
|
1569
|
-
this.planetApplicationService =
|
|
1570
|
-
this.ngZone =
|
|
1563
|
+
constructor() {
|
|
1564
|
+
this.assetsLoader = inject(AssetsLoader);
|
|
1565
|
+
this.planetApplicationService = inject(PlanetApplicationService);
|
|
1566
|
+
this.ngZone = inject(NgZone);
|
|
1571
1567
|
this.firstLoad = true;
|
|
1572
1568
|
this.inProgressAppAssetsLoads = new Map();
|
|
1573
1569
|
this.appsStatus = new Map();
|
|
@@ -1575,12 +1571,16 @@ class PlanetApplicationLoader {
|
|
|
1575
1571
|
this.routeChange$ = new Subject();
|
|
1576
1572
|
this.appStatusChange$ = new Subject();
|
|
1577
1573
|
this.appsLoadingStart$ = new Subject();
|
|
1578
|
-
this.innerLoading = signal(false);
|
|
1574
|
+
this.innerLoading = signal(false, ...(ngDevMode ? [{ debugName: "innerLoading" }] : []));
|
|
1579
1575
|
/**
|
|
1580
1576
|
* @deprecated please use loading signal
|
|
1581
1577
|
*/
|
|
1582
1578
|
this.loadingDone = false;
|
|
1583
1579
|
this.loading = this.innerLoading.asReadonly();
|
|
1580
|
+
const ngZone = this.ngZone;
|
|
1581
|
+
const router = inject(Router);
|
|
1582
|
+
const injector = inject(Injector);
|
|
1583
|
+
const applicationRef = inject(ApplicationRef);
|
|
1584
1584
|
if (getApplicationLoader()) {
|
|
1585
1585
|
throw new Error('PlanetApplicationLoader has been injected in the portal, repeated injection is not allowed');
|
|
1586
1586
|
}
|
|
@@ -1980,15 +1980,15 @@ class PlanetApplicationLoader {
|
|
|
1980
1980
|
preload(app, immediate) {
|
|
1981
1981
|
return this.preloadInternal(app, immediate);
|
|
1982
1982
|
}
|
|
1983
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1984
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1983
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: PlanetApplicationLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1984
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: PlanetApplicationLoader, providedIn: 'root' }); }
|
|
1985
1985
|
}
|
|
1986
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1986
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: PlanetApplicationLoader, decorators: [{
|
|
1987
1987
|
type: Injectable,
|
|
1988
1988
|
args: [{
|
|
1989
1989
|
providedIn: 'root'
|
|
1990
1990
|
}]
|
|
1991
|
-
}], ctorParameters: () => [
|
|
1991
|
+
}], ctorParameters: () => [] });
|
|
1992
1992
|
|
|
1993
1993
|
class Planet {
|
|
1994
1994
|
get planetApplicationLoader() {
|
|
@@ -2012,9 +2012,10 @@ class Planet {
|
|
|
2012
2012
|
get appsLoadingStart() {
|
|
2013
2013
|
return this.planetApplicationLoader.appsLoadingStart;
|
|
2014
2014
|
}
|
|
2015
|
-
constructor(
|
|
2016
|
-
this.injector =
|
|
2017
|
-
this.router =
|
|
2015
|
+
constructor() {
|
|
2016
|
+
this.injector = inject(Injector);
|
|
2017
|
+
this.router = inject(Router);
|
|
2018
|
+
const planetApplications = inject(PLANET_APPLICATIONS, { optional: true });
|
|
2018
2019
|
if (!this.planetApplicationLoader) {
|
|
2019
2020
|
setApplicationLoader(this.injector.get(PlanetApplicationLoader));
|
|
2020
2021
|
}
|
|
@@ -2062,26 +2063,21 @@ class Planet {
|
|
|
2062
2063
|
stop() {
|
|
2063
2064
|
this.subscription?.unsubscribe();
|
|
2064
2065
|
}
|
|
2065
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2066
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2066
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: Planet, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2067
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: Planet, providedIn: 'root' }); }
|
|
2067
2068
|
}
|
|
2068
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2069
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: Planet, decorators: [{
|
|
2069
2070
|
type: Injectable,
|
|
2070
2071
|
args: [{
|
|
2071
2072
|
providedIn: 'root'
|
|
2072
2073
|
}]
|
|
2073
|
-
}], ctorParameters: () => [
|
|
2074
|
-
type: Inject,
|
|
2075
|
-
args: [PLANET_APPLICATIONS]
|
|
2076
|
-
}, {
|
|
2077
|
-
type: Optional
|
|
2078
|
-
}] }] });
|
|
2074
|
+
}], ctorParameters: () => [] });
|
|
2079
2075
|
|
|
2080
2076
|
class EmptyComponent {
|
|
2081
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2082
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
2077
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: EmptyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2078
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.10", type: EmptyComponent, isStandalone: true, selector: "empty-component", ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2083
2079
|
}
|
|
2084
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2080
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: EmptyComponent, decorators: [{
|
|
2085
2081
|
type: Component,
|
|
2086
2082
|
args: [{
|
|
2087
2083
|
// eslint-disable-next-line @angular-eslint/component-selector
|
|
@@ -2106,11 +2102,10 @@ class PlanetComponentLoader {
|
|
|
2106
2102
|
get applicationService() {
|
|
2107
2103
|
return getApplicationService();
|
|
2108
2104
|
}
|
|
2109
|
-
constructor(
|
|
2110
|
-
this.applicationRef =
|
|
2111
|
-
this.ngModuleRef =
|
|
2112
|
-
this.ngZone =
|
|
2113
|
-
this.document = document;
|
|
2105
|
+
constructor() {
|
|
2106
|
+
this.applicationRef = inject(ApplicationRef);
|
|
2107
|
+
this.ngModuleRef = inject(NgModuleRef);
|
|
2108
|
+
this.ngZone = inject(NgZone);
|
|
2114
2109
|
}
|
|
2115
2110
|
getPlantAppRef(name) {
|
|
2116
2111
|
const plantAppRef = getBootstrappedPlanetApplicationRef(name);
|
|
@@ -2286,25 +2281,22 @@ class PlanetComponentLoader {
|
|
|
2286
2281
|
result.subscribe();
|
|
2287
2282
|
return result;
|
|
2288
2283
|
}
|
|
2289
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2290
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2284
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: PlanetComponentLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2285
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: PlanetComponentLoader, providedIn: 'root' }); }
|
|
2291
2286
|
}
|
|
2292
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2287
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: PlanetComponentLoader, decorators: [{
|
|
2293
2288
|
type: Injectable,
|
|
2294
2289
|
args: [{
|
|
2295
2290
|
providedIn: 'root'
|
|
2296
2291
|
}]
|
|
2297
|
-
}], ctorParameters: () => [
|
|
2298
|
-
type: Inject,
|
|
2299
|
-
args: [DOCUMENT]
|
|
2300
|
-
}] }] });
|
|
2292
|
+
}], ctorParameters: () => [] });
|
|
2301
2293
|
|
|
2302
2294
|
// eslint-disable-next-line @angular-eslint/directive-class-suffix
|
|
2303
2295
|
class PlanetComponentOutlet {
|
|
2304
|
-
constructor(
|
|
2305
|
-
this.elementRef =
|
|
2306
|
-
this.planetComponentLoader =
|
|
2307
|
-
this.ngZone =
|
|
2296
|
+
constructor() {
|
|
2297
|
+
this.elementRef = inject(ElementRef);
|
|
2298
|
+
this.planetComponentLoader = inject(PlanetComponentLoader);
|
|
2299
|
+
this.ngZone = inject(NgZone);
|
|
2308
2300
|
this.planetComponentLoaded = new EventEmitter();
|
|
2309
2301
|
this.destroyed$ = new Subject();
|
|
2310
2302
|
}
|
|
@@ -2344,16 +2336,16 @@ class PlanetComponentOutlet {
|
|
|
2344
2336
|
this.componentRef?.dispose();
|
|
2345
2337
|
this.destroyed$.next();
|
|
2346
2338
|
}
|
|
2347
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2348
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
2339
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: PlanetComponentOutlet, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2340
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.10", type: PlanetComponentOutlet, isStandalone: true, selector: "[planetComponentOutlet]", inputs: { planetComponentOutlet: "planetComponentOutlet", planetComponentOutletApp: "planetComponentOutletApp", planetComponentOutletProjectableNodes: "planetComponentOutletProjectableNodes", planetComponentOutletInitialState: "planetComponentOutletInitialState" }, outputs: { planetComponentLoaded: "planetComponentLoaded" }, usesOnChanges: true, ngImport: i0 }); }
|
|
2349
2341
|
}
|
|
2350
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2342
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: PlanetComponentOutlet, decorators: [{
|
|
2351
2343
|
type: Directive,
|
|
2352
2344
|
args: [{
|
|
2353
2345
|
selector: '[planetComponentOutlet]',
|
|
2354
2346
|
standalone: true
|
|
2355
2347
|
}]
|
|
2356
|
-
}], ctorParameters: () => [
|
|
2348
|
+
}], ctorParameters: () => [], propDecorators: { planetComponentOutlet: [{
|
|
2357
2349
|
type: Input
|
|
2358
2350
|
}], planetComponentOutletApp: [{
|
|
2359
2351
|
type: Input
|
|
@@ -2404,10 +2396,10 @@ class RedirectToRouteComponent {
|
|
|
2404
2396
|
constructor() {
|
|
2405
2397
|
this.routeRedirect = routeRedirect();
|
|
2406
2398
|
}
|
|
2407
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2408
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
2399
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: RedirectToRouteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2400
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.10", type: RedirectToRouteComponent, isStandalone: true, selector: "planet-redirect-to-route", ngImport: i0, template: '', isInline: true }); }
|
|
2409
2401
|
}
|
|
2410
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2402
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: RedirectToRouteComponent, decorators: [{
|
|
2411
2403
|
type: Component,
|
|
2412
2404
|
args: [{
|
|
2413
2405
|
selector: 'planet-redirect-to-route',
|
|
@@ -2437,11 +2429,11 @@ class NgxPlanetModule {
|
|
|
2437
2429
|
]
|
|
2438
2430
|
};
|
|
2439
2431
|
}
|
|
2440
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2441
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
2442
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
2432
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxPlanetModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2433
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.10", ngImport: i0, type: NgxPlanetModule, imports: [PlanetComponentOutlet, EmptyComponent, RedirectToRouteComponent], exports: [EmptyComponent, PlanetComponentOutlet] }); }
|
|
2434
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxPlanetModule, providers: [provideHttpClient(withInterceptorsFromDi())] }); }
|
|
2443
2435
|
}
|
|
2444
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2436
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxPlanetModule, decorators: [{
|
|
2445
2437
|
type: NgModule,
|
|
2446
2438
|
args: [{
|
|
2447
2439
|
declarations: [],
|