@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.
Files changed (75) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/application/ng-planet-application-ref.d.ts +48 -0
  3. package/application/ng-planet-application-ref.d.ts.map +1 -0
  4. package/application/planet-application-ref.d.ts +3 -27
  5. package/application/planet-application-ref.d.ts.map +1 -1
  6. package/component/planet-component-loader.d.ts.map +1 -1
  7. package/component/planet-component-outlet.d.ts +1 -1
  8. package/esm2022/application/ng-planet-application-ref.mjs +106 -0
  9. package/esm2022/application/planet-application-loader.mjs +454 -0
  10. package/esm2022/application/planet-application-ref.mjs +2 -0
  11. package/esm2022/application/planet-application.service.mjs +85 -0
  12. package/esm2022/assets-loader.mjs +216 -0
  13. package/esm2022/component/planet-component-loader.mjs +171 -0
  14. package/esm2022/component/planet-component-outlet.mjs +69 -0
  15. package/esm2022/debug.mjs +33 -0
  16. package/{esm2020 → esm2022}/empty/empty.component.mjs +4 -4
  17. package/esm2022/global-event-dispatcher.mjs +70 -0
  18. package/esm2022/global-planet.mjs +63 -0
  19. package/esm2022/helpers.mjs +119 -0
  20. package/esm2022/module.mjs +33 -0
  21. package/esm2022/planet.mjs +91 -0
  22. package/esm2022/public-api.mjs +19 -0
  23. package/esm2022/router/route-redirect.mjs +63 -0
  24. package/{esm2020 → esm2022}/sandbox/index.mjs +1 -1
  25. package/esm2022/sandbox/proxy/patches/eventListener.mjs +41 -0
  26. package/esm2022/sandbox/proxy/proxies/common.mjs +132 -0
  27. package/esm2022/sandbox/proxy/proxies/document.mjs +126 -0
  28. package/esm2022/sandbox/proxy/proxies/window.mjs +158 -0
  29. package/esm2022/sandbox/proxy/proxy-sandbox.mjs +49 -0
  30. package/esm2022/sandbox/snapshot/snapshot-sandbox.mjs +12 -0
  31. package/{fesm2020 → fesm2022}/worktile-planet.mjs +96 -73
  32. package/fesm2022/worktile-planet.mjs.map +1 -0
  33. package/global-planet.d.ts +4 -2
  34. package/global-planet.d.ts.map +1 -1
  35. package/package.json +7 -13
  36. package/sandbox/proxy/patches/eventListener.d.ts.map +1 -1
  37. package/sandbox/proxy/proxy-sandbox.d.ts.map +1 -1
  38. package/sandbox/snapshot/snapshot-sandbox.d.ts.map +1 -1
  39. package/esm2020/application/planet-application-loader.mjs +0 -454
  40. package/esm2020/application/planet-application-ref.mjs +0 -94
  41. package/esm2020/application/planet-application.service.mjs +0 -85
  42. package/esm2020/assets-loader.mjs +0 -216
  43. package/esm2020/component/planet-component-loader.mjs +0 -170
  44. package/esm2020/component/planet-component-outlet.mjs +0 -69
  45. package/esm2020/debug.mjs +0 -33
  46. package/esm2020/global-event-dispatcher.mjs +0 -70
  47. package/esm2020/global-planet.mjs +0 -53
  48. package/esm2020/helpers.mjs +0 -119
  49. package/esm2020/module.mjs +0 -33
  50. package/esm2020/planet.mjs +0 -91
  51. package/esm2020/public-api.mjs +0 -20
  52. package/esm2020/router/route-redirect.mjs +0 -63
  53. package/esm2020/sandbox/proxy/patches/eventListener.mjs +0 -41
  54. package/esm2020/sandbox/proxy/proxies/common.mjs +0 -132
  55. package/esm2020/sandbox/proxy/proxies/document.mjs +0 -126
  56. package/esm2020/sandbox/proxy/proxies/window.mjs +0 -158
  57. package/esm2020/sandbox/proxy/proxy-sandbox.mjs +0 -49
  58. package/esm2020/sandbox/snapshot/snapshot-sandbox.mjs +0 -12
  59. package/fesm2015/worktile-planet.mjs +0 -2193
  60. package/fesm2015/worktile-planet.mjs.map +0 -1
  61. package/fesm2020/worktile-planet.mjs.map +0 -1
  62. /package/{esm2020 → esm2022}/application/portal-application.mjs +0 -0
  63. /package/{esm2020 → esm2022}/component/planet-component-ref.mjs +0 -0
  64. /package/{esm2020 → esm2022}/component/plant-component.config.mjs +0 -0
  65. /package/{esm2020 → esm2022}/planet.class.mjs +0 -0
  66. /package/{esm2020 → esm2022}/sandbox/constants.mjs +0 -0
  67. /package/{esm2020 → esm2022}/sandbox/exec.mjs +0 -0
  68. /package/{esm2020 → esm2022}/sandbox/proxy/patches/document.mjs +0 -0
  69. /package/{esm2020 → esm2022}/sandbox/proxy/patches/index.mjs +0 -0
  70. /package/{esm2020 → esm2022}/sandbox/proxy/patches/storage.mjs +0 -0
  71. /package/{esm2020 → esm2022}/sandbox/proxy/patches/timer.mjs +0 -0
  72. /package/{esm2020 → esm2022}/sandbox/proxy/types.mjs +0 -0
  73. /package/{esm2020 → esm2022}/sandbox/sandbox.mjs +0 -0
  74. /package/{esm2020 → esm2022}/sandbox/types.mjs +0 -0
  75. /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.document;
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
- AssetsLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: AssetsLoader, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
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: function () { return [{ type: i1.HttpClient }]; } });
993
+ }], ctorParameters: () => [{ type: i1.HttpClient }] });
994
994
 
995
- class PlanetApplicationRef {
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.get(NgZone);
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
- // @ts-ignore
1019
- return window.Zone.current._properties[`ngx-planet-${name}`] === true;
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.get(Router);
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
- this.appModuleRef = appModuleRef;
1045
- this.appModuleRef.instance.appName = this.name;
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.get(Router);
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.injector.get(Router);
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.destroy();
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 PlanetApplicationRef(name, options);
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
- PlanetApplicationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: PlanetApplicationService, deps: [{ token: i1.HttpClient }, { token: AssetsLoader }], target: i0.ɵɵFactoryTarget.Injectable });
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: function () { return [{ type: i1.HttpClient }, { type: AssetsLoader }]; } });
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
- GlobalEventDispatcher.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: GlobalEventDispatcher, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
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: function () { return [{ type: i0.NgZone }]; } });
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
- PlanetApplicationLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", 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 });
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: function () { return [{ type: AssetsLoader }, { type: PlanetApplicationService }, { type: i0.NgZone }, { type: i3.Router }, { type: i0.Injector }, { type: i0.ApplicationRef }]; } });
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
- Planet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: Planet, deps: [{ token: i0.Injector }, { token: i3.Router }, { token: PLANET_APPLICATIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
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: function () { return [{ type: i0.Injector }, { type: i3.Router }, { type: undefined, decorators: [{
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
- EmptyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: EmptyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
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
- if (globalPlanet.apps[name] && globalPlanet.apps[name].appModuleRef) {
1880
- return of(globalPlanet.apps[name]);
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 globalPlanet.apps[name];
1908
+ return getPlanetApplicationRef(name);
1886
1909
  }));
1887
1910
  }
1888
1911
  }
1889
- createInjector(appModuleRef, componentRef) {
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: appModuleRef.injector
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, appModuleRef, config) {
1954
+ attachComponent(component, environmentInjector, config) {
1932
1955
  const plantComponentRef = new PlanetComponentRef();
1933
1956
  const appRef = this.applicationRef;
1934
- const injector = this.createInjector(appModuleRef, plantComponentRef);
1957
+ const injector = this.createInjector(environmentInjector, plantComponentRef);
1935
1958
  const container = this.getContainerElement(config);
1936
1959
  const componentRef = createComponent(component, {
1937
- environmentInjector: appModuleRef.injector,
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
- PlanetComponentLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: PlanetComponentLoader, deps: [{ token: i0.ApplicationRef }, { token: i0.NgModuleRef }, { token: i0.NgZone }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
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: function () { return [{ type: i0.ApplicationRef }, { type: i0.NgModuleRef }, { type: i0.NgZone }, { type: undefined, decorators: [{
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.planetComponentOutlet.isFirstChange()) {
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
- PlanetComponentOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: PlanetComponentOutlet, deps: [{ token: i0.ElementRef }, { token: PlanetComponentLoader }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
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: function () { return [{ type: i0.ElementRef }, { type: PlanetComponentLoader }, { type: i0.NgZone }]; }, propDecorators: { planetComponentOutlet: [{
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.redirectTo;
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
- RedirectToRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: RedirectToRouteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
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
- NgxPlanetModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgxPlanetModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
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, PlanetApplicationRef, PlanetApplicationService, PlanetComponentLoader, PlanetComponentOutlet, PlanetComponentRef, PlanetPortalApplication, PlantComponentConfig, RedirectToRouteComponent, SwitchModes, defineApplication, getPlanetApplicationRef, getPortalApplicationData, redirectToRoute, routeRedirect };
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