@worktile/planet 14.1.1 → 15.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.
@@ -983,9 +983,9 @@ class AssetsLoader {
983
983
  }));
984
984
  }
985
985
  }
986
- AssetsLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: AssetsLoader, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
987
- AssetsLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: AssetsLoader, providedIn: 'root' });
988
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: AssetsLoader, decorators: [{
986
+ AssetsLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: AssetsLoader, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
987
+ AssetsLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: AssetsLoader, providedIn: 'root' });
988
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: AssetsLoader, decorators: [{
989
989
  type: Injectable,
990
990
  args: [{
991
991
  providedIn: 'root'
@@ -993,6 +993,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImpor
993
993
  }], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
994
994
 
995
995
  class PlanetApplicationRef {
996
+ get selector() {
997
+ return this.innerSelector;
998
+ }
999
+ get bootstrapped() {
1000
+ return !!this.appModuleRef;
1001
+ }
1002
+ get ngZone() {
1003
+ return this.appModuleRef?.injector.get(NgZone);
1004
+ }
1005
+ get sandbox() {
1006
+ return getSandboxInstance();
1007
+ }
996
1008
  constructor(name, options) {
997
1009
  this.name = name;
998
1010
  if (options) {
@@ -1007,18 +1019,6 @@ class PlanetApplicationRef {
1007
1019
  return window.Zone.current._properties[`ngx-planet-${name}`] === true;
1008
1020
  };
1009
1021
  }
1010
- get selector() {
1011
- return this.innerSelector;
1012
- }
1013
- get bootstrapped() {
1014
- return !!this.appModuleRef;
1015
- }
1016
- get ngZone() {
1017
- return this.appModuleRef?.injector.get(NgZone);
1018
- }
1019
- get sandbox() {
1020
- return getSandboxInstance();
1021
- }
1022
1022
  // 子应用路由变化后同步修改 portal 的 Route
1023
1023
  syncPortalRouteWhenNavigationEnd() {
1024
1024
  const router = this.appModuleRef?.injector.get(Router);
@@ -1198,9 +1198,9 @@ class PlanetApplicationService {
1198
1198
  return this.apps;
1199
1199
  }
1200
1200
  }
1201
- PlanetApplicationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: PlanetApplicationService, deps: [{ token: i1.HttpClient }, { token: AssetsLoader }], target: i0.ɵɵFactoryTarget.Injectable });
1202
- PlanetApplicationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: PlanetApplicationService, providedIn: 'root' });
1203
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: PlanetApplicationService, decorators: [{
1201
+ PlanetApplicationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", 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.1.2", ngImport: i0, type: PlanetApplicationService, providedIn: 'root' });
1203
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: PlanetApplicationService, decorators: [{
1204
1204
  type: Injectable,
1205
1205
  args: [{
1206
1206
  providedIn: 'root'
@@ -1225,6 +1225,14 @@ class PlanetPortalApplication {
1225
1225
 
1226
1226
  const CUSTOM_EVENT_NAME = 'PLANET_GLOBAL_EVENT_DISPATCHER';
1227
1227
  class GlobalEventDispatcher {
1228
+ addGlobalEventListener() {
1229
+ this.hasAddGlobalEventListener = true;
1230
+ window.addEventListener(CUSTOM_EVENT_NAME, this.globalEventListener);
1231
+ }
1232
+ removeGlobalEventListener() {
1233
+ this.hasAddGlobalEventListener = false;
1234
+ window.removeEventListener(CUSTOM_EVENT_NAME, this.globalEventListener);
1235
+ }
1228
1236
  constructor(ngZone) {
1229
1237
  this.ngZone = ngZone;
1230
1238
  this.subject$ = new Subject();
@@ -1234,14 +1242,6 @@ class GlobalEventDispatcher {
1234
1242
  this.subject$.next(event.detail);
1235
1243
  };
1236
1244
  }
1237
- addGlobalEventListener() {
1238
- this.hasAddGlobalEventListener = true;
1239
- window.addEventListener(CUSTOM_EVENT_NAME, this.globalEventListener);
1240
- }
1241
- removeGlobalEventListener() {
1242
- this.hasAddGlobalEventListener = false;
1243
- window.removeEventListener(CUSTOM_EVENT_NAME, this.globalEventListener);
1244
- }
1245
1245
  dispatch(name, payload) {
1246
1246
  window.dispatchEvent(new CustomEvent(CUSTOM_EVENT_NAME, {
1247
1247
  detail: {
@@ -1280,9 +1280,9 @@ class GlobalEventDispatcher {
1280
1280
  return this.subscriptionCount;
1281
1281
  }
1282
1282
  }
1283
- GlobalEventDispatcher.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: GlobalEventDispatcher, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
1284
- GlobalEventDispatcher.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: GlobalEventDispatcher, providedIn: 'root' });
1285
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: GlobalEventDispatcher, decorators: [{
1283
+ GlobalEventDispatcher.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: GlobalEventDispatcher, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
1284
+ GlobalEventDispatcher.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: GlobalEventDispatcher, providedIn: 'root' });
1285
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: GlobalEventDispatcher, decorators: [{
1286
1286
  type: Injectable,
1287
1287
  args: [{
1288
1288
  providedIn: 'root'
@@ -1332,6 +1332,12 @@ var ApplicationStatus;
1332
1332
  ApplicationStatus[ApplicationStatus["loadError"] = 10] = "loadError";
1333
1333
  })(ApplicationStatus || (ApplicationStatus = {}));
1334
1334
  class PlanetApplicationLoader {
1335
+ get appStatusChange() {
1336
+ return this.appStatusChange$.asObservable();
1337
+ }
1338
+ get appsLoadingStart() {
1339
+ return this.appsLoadingStart$.asObservable();
1340
+ }
1335
1341
  constructor(assetsLoader, planetApplicationService, ngZone, router, injector, applicationRef) {
1336
1342
  this.assetsLoader = assetsLoader;
1337
1343
  this.planetApplicationService = planetApplicationService;
@@ -1361,12 +1367,6 @@ class PlanetApplicationLoader {
1361
1367
  globalPlanet.portalApplication = this.portalApp;
1362
1368
  this.setupRouteChange();
1363
1369
  }
1364
- get appStatusChange() {
1365
- return this.appStatusChange$.asObservable();
1366
- }
1367
- get appsLoadingStart() {
1368
- return this.appsLoadingStart$.asObservable();
1369
- }
1370
1370
  setAppStatus(app, status) {
1371
1371
  this.ngZone.run(() => {
1372
1372
  const fromStatus = this.appsStatus.get(app);
@@ -1750,9 +1750,9 @@ class PlanetApplicationLoader {
1750
1750
  return this.preloadInternal(app, immediate);
1751
1751
  }
1752
1752
  }
1753
- PlanetApplicationLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", 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: "14.1.2", ngImport: i0, type: PlanetApplicationLoader, providedIn: 'root' });
1755
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: PlanetApplicationLoader, decorators: [{
1753
+ PlanetApplicationLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", 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.1.2", ngImport: i0, type: PlanetApplicationLoader, providedIn: 'root' });
1755
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: PlanetApplicationLoader, decorators: [{
1756
1756
  type: Injectable,
1757
1757
  args: [{
1758
1758
  providedIn: 'root'
@@ -1760,19 +1760,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImpor
1760
1760
  }], ctorParameters: function () { return [{ type: AssetsLoader }, { type: PlanetApplicationService }, { type: i0.NgZone }, { type: i3.Router }, { type: i0.Injector }, { type: i0.ApplicationRef }]; } });
1761
1761
 
1762
1762
  class Planet {
1763
- constructor(injector, router, planetApplications) {
1764
- this.injector = injector;
1765
- this.router = router;
1766
- if (!this.planetApplicationLoader) {
1767
- setApplicationLoader(this.injector.get(PlanetApplicationLoader));
1768
- }
1769
- if (!this.planetApplicationService) {
1770
- setApplicationService(this.injector.get(PlanetApplicationService));
1771
- }
1772
- if (planetApplications) {
1773
- this.registerApps(planetApplications);
1774
- }
1775
- }
1776
1763
  get planetApplicationLoader() {
1777
1764
  return getApplicationLoader();
1778
1765
  }
@@ -1788,6 +1775,19 @@ class Planet {
1788
1775
  get appsLoadingStart() {
1789
1776
  return this.planetApplicationLoader.appsLoadingStart;
1790
1777
  }
1778
+ constructor(injector, router, planetApplications) {
1779
+ this.injector = injector;
1780
+ this.router = router;
1781
+ if (!this.planetApplicationLoader) {
1782
+ setApplicationLoader(this.injector.get(PlanetApplicationLoader));
1783
+ }
1784
+ if (!this.planetApplicationService) {
1785
+ setApplicationService(this.injector.get(PlanetApplicationService));
1786
+ }
1787
+ if (planetApplications) {
1788
+ this.registerApps(planetApplications);
1789
+ }
1790
+ }
1791
1791
  setOptions(options) {
1792
1792
  this.planetApplicationLoader.setOptions(options);
1793
1793
  if (options.debugFactory) {
@@ -1826,9 +1826,9 @@ class Planet {
1826
1826
  this.subscription?.unsubscribe();
1827
1827
  }
1828
1828
  }
1829
- Planet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", 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: "14.1.2", ngImport: i0, type: Planet, providedIn: 'root' });
1831
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: Planet, decorators: [{
1829
+ Planet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", 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.1.2", ngImport: i0, type: Planet, providedIn: 'root' });
1831
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: Planet, decorators: [{
1832
1832
  type: Injectable,
1833
1833
  args: [{
1834
1834
  providedIn: 'root'
@@ -1842,9 +1842,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImpor
1842
1842
 
1843
1843
  class EmptyComponent {
1844
1844
  }
1845
- EmptyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: EmptyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1846
- EmptyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: EmptyComponent, selector: "empty-component", ngImport: i0, template: ``, isInline: true });
1847
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: EmptyComponent, decorators: [{
1845
+ EmptyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: EmptyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1846
+ EmptyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.2", type: EmptyComponent, selector: "empty-component", ngImport: i0, template: ``, isInline: true });
1847
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: EmptyComponent, decorators: [{
1848
1848
  type: Component,
1849
1849
  args: [{
1850
1850
  // eslint-disable-next-line @angular-eslint/component-selector
@@ -1858,18 +1858,18 @@ class PlanetComponentRef {
1858
1858
 
1859
1859
  const componentWrapperClass = 'planet-component-wrapper';
1860
1860
  class PlanetComponentLoader {
1861
- constructor(applicationRef, ngModuleRef, ngZone, document) {
1862
- this.applicationRef = applicationRef;
1863
- this.ngModuleRef = ngModuleRef;
1864
- this.ngZone = ngZone;
1865
- this.document = document;
1866
- }
1867
1861
  get applicationLoader() {
1868
1862
  return getApplicationLoader();
1869
1863
  }
1870
1864
  get applicationService() {
1871
1865
  return getApplicationService();
1872
1866
  }
1867
+ constructor(applicationRef, ngModuleRef, ngZone, document) {
1868
+ this.applicationRef = applicationRef;
1869
+ this.ngModuleRef = ngModuleRef;
1870
+ this.ngZone = ngZone;
1871
+ this.document = document;
1872
+ }
1873
1873
  getPlantAppRef(name) {
1874
1874
  if (globalPlanet.apps[name] && globalPlanet.apps[name].appModuleRef) {
1875
1875
  return of(globalPlanet.apps[name]);
@@ -1999,9 +1999,9 @@ class PlanetComponentLoader {
1999
1999
  return result;
2000
2000
  }
2001
2001
  }
2002
- PlanetComponentLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: PlanetComponentLoader, deps: [{ token: i0.ApplicationRef }, { token: i0.NgModuleRef }, { token: i0.NgZone }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
2003
- PlanetComponentLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: PlanetComponentLoader, providedIn: 'root' });
2004
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: PlanetComponentLoader, decorators: [{
2002
+ PlanetComponentLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: PlanetComponentLoader, deps: [{ token: i0.ApplicationRef }, { token: i0.NgModuleRef }, { token: i0.NgZone }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
2003
+ PlanetComponentLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: PlanetComponentLoader, providedIn: 'root' });
2004
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: PlanetComponentLoader, decorators: [{
2005
2005
  type: Injectable,
2006
2006
  args: [{
2007
2007
  providedIn: 'root'
@@ -2056,9 +2056,9 @@ class PlanetComponentOutlet {
2056
2056
  this.destroyed$.next();
2057
2057
  }
2058
2058
  }
2059
- PlanetComponentOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: PlanetComponentOutlet, deps: [{ token: i0.ElementRef }, { token: PlanetComponentLoader }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
2060
- PlanetComponentOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.2", type: PlanetComponentOutlet, selector: "[planetComponentOutlet]", inputs: { planetComponentOutlet: "planetComponentOutlet", planetComponentOutletApp: "planetComponentOutletApp", planetComponentOutletInitialState: "planetComponentOutletInitialState" }, outputs: { planetComponentLoaded: "planetComponentLoaded" }, usesOnChanges: true, ngImport: i0 });
2061
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: PlanetComponentOutlet, decorators: [{
2059
+ PlanetComponentOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: PlanetComponentOutlet, deps: [{ token: i0.ElementRef }, { token: PlanetComponentLoader }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
2060
+ PlanetComponentOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.2", type: PlanetComponentOutlet, selector: "[planetComponentOutlet]", inputs: { planetComponentOutlet: "planetComponentOutlet", planetComponentOutletApp: "planetComponentOutletApp", planetComponentOutletInitialState: "planetComponentOutletInitialState" }, outputs: { planetComponentLoaded: "planetComponentLoaded" }, usesOnChanges: true, ngImport: i0 });
2061
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: PlanetComponentOutlet, decorators: [{
2062
2062
  type: Directive,
2063
2063
  args: [{
2064
2064
  selector: '[planetComponentOutlet]'
@@ -2086,10 +2086,10 @@ class NgxPlanetModule {
2086
2086
  };
2087
2087
  }
2088
2088
  }
2089
- NgxPlanetModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: NgxPlanetModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2090
- NgxPlanetModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.2", ngImport: i0, type: NgxPlanetModule, declarations: [EmptyComponent, PlanetComponentOutlet], imports: [HttpClientModule], exports: [HttpClientModule, EmptyComponent, PlanetComponentOutlet] });
2091
- NgxPlanetModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: NgxPlanetModule, imports: [HttpClientModule, HttpClientModule] });
2092
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: NgxPlanetModule, decorators: [{
2089
+ NgxPlanetModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: NgxPlanetModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2090
+ NgxPlanetModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.2", ngImport: i0, type: NgxPlanetModule, declarations: [EmptyComponent, PlanetComponentOutlet], imports: [HttpClientModule], exports: [HttpClientModule, EmptyComponent, PlanetComponentOutlet] });
2091
+ NgxPlanetModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: NgxPlanetModule, imports: [HttpClientModule, HttpClientModule] });
2092
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: NgxPlanetModule, decorators: [{
2093
2093
  type: NgModule,
2094
2094
  args: [{
2095
2095
  declarations: [EmptyComponent, PlanetComponentOutlet],