@worktile/planet 15.0.0 → 15.1.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 +10 -0
- package/README.md +2 -2
- package/component/planet-component-loader.d.ts +2 -2
- package/component/planet-component-loader.d.ts.map +1 -1
- package/esm2020/application/planet-application-loader.mjs +3 -3
- package/esm2020/application/planet-application.service.mjs +3 -3
- package/esm2020/assets-loader.mjs +3 -3
- package/esm2020/component/planet-component-loader.mjs +17 -10
- package/esm2020/component/planet-component-outlet.mjs +3 -3
- package/esm2020/empty/empty.component.mjs +3 -3
- package/esm2020/global-event-dispatcher.mjs +3 -3
- package/esm2020/module.mjs +4 -4
- package/esm2020/planet.mjs +3 -3
- package/esm2020/public-api.mjs +2 -1
- package/esm2020/router/route-redirect.mjs +23 -0
- package/fesm2015/worktile-planet.mjs +64 -36
- package/fesm2015/worktile-planet.mjs.map +1 -1
- package/fesm2020/worktile-planet.mjs +64 -36
- package/fesm2020/worktile-planet.mjs.map +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/public-api.d.ts.map +1 -1
- package/router/route-redirect.d.ts +9 -0
- package/router/route-redirect.d.ts.map +1 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, Injectable, NgZone, Inject, Optional, Component, ChangeDetectionStrategy, Injector, createComponent, EventEmitter, Directive, Input, Output, NgModule } from '@angular/core';
|
|
2
|
+
import { InjectionToken, Injectable, NgZone, Inject, Optional, Component, ChangeDetectionStrategy, Injector, createComponent, reflectComponentType, EventEmitter, Directive, Input, Output, NgModule, inject } from '@angular/core';
|
|
3
3
|
import * as i3 from '@angular/router';
|
|
4
|
-
import { Router, NavigationEnd } from '@angular/router';
|
|
4
|
+
import { Router, NavigationEnd, ActivatedRoute } from '@angular/router';
|
|
5
5
|
import * as i1 from '@angular/common/http';
|
|
6
6
|
import { HttpClientModule } from '@angular/common/http';
|
|
7
7
|
import { map, concatAll, switchMap, take, shareReplay, filter, distinctUntilChanged, catchError, tap, share, startWith, delayWhen, takeUntil } from 'rxjs/operators';
|
|
@@ -983,9 +983,9 @@ class AssetsLoader {
|
|
|
983
983
|
}));
|
|
984
984
|
}
|
|
985
985
|
}
|
|
986
|
-
AssetsLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
987
|
-
AssetsLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.
|
|
988
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
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: [{
|
|
989
989
|
type: Injectable,
|
|
990
990
|
args: [{
|
|
991
991
|
providedIn: 'root'
|
|
@@ -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: "15.2.
|
|
1202
|
-
PlanetApplicationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.
|
|
1203
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
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: [{
|
|
1204
1204
|
type: Injectable,
|
|
1205
1205
|
args: [{
|
|
1206
1206
|
providedIn: 'root'
|
|
@@ -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: "15.2.
|
|
1284
|
-
GlobalEventDispatcher.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.
|
|
1285
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
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: [{
|
|
1286
1286
|
type: Injectable,
|
|
1287
1287
|
args: [{
|
|
1288
1288
|
providedIn: 'root'
|
|
@@ -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: "15.2.
|
|
1754
|
-
PlanetApplicationLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.
|
|
1755
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
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: [{
|
|
1756
1756
|
type: Injectable,
|
|
1757
1757
|
args: [{
|
|
1758
1758
|
providedIn: 'root'
|
|
@@ -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: "15.2.
|
|
1830
|
-
Planet.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.
|
|
1831
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
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: [{
|
|
1832
1832
|
type: Injectable,
|
|
1833
1833
|
args: [{
|
|
1834
1834
|
providedIn: 'root'
|
|
@@ -1842,9 +1842,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
1842
1842
|
|
|
1843
1843
|
class EmptyComponent {
|
|
1844
1844
|
}
|
|
1845
|
-
EmptyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
1846
|
-
EmptyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.
|
|
1847
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
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: [{
|
|
1848
1848
|
type: Component,
|
|
1849
1849
|
args: [{
|
|
1850
1850
|
// eslint-disable-next-line @angular-eslint/component-selector
|
|
@@ -1859,6 +1859,9 @@ class PlanetComponentRef {
|
|
|
1859
1859
|
}
|
|
1860
1860
|
|
|
1861
1861
|
const componentWrapperClass = 'planet-component-wrapper';
|
|
1862
|
+
function isComponentType(component) {
|
|
1863
|
+
return typeof component === 'function' && component.constructor === Function;
|
|
1864
|
+
}
|
|
1862
1865
|
class PlanetComponentLoader {
|
|
1863
1866
|
get applicationLoader() {
|
|
1864
1867
|
return getApplicationLoader();
|
|
@@ -1925,12 +1928,12 @@ class PlanetComponentLoader {
|
|
|
1925
1928
|
container.appendChild(componentRootNode);
|
|
1926
1929
|
}
|
|
1927
1930
|
}
|
|
1928
|
-
attachComponent(
|
|
1931
|
+
attachComponent(component, appModuleRef, config) {
|
|
1929
1932
|
const plantComponentRef = new PlanetComponentRef();
|
|
1930
1933
|
const appRef = this.applicationRef;
|
|
1931
1934
|
const injector = this.createInjector(appModuleRef, plantComponentRef);
|
|
1932
1935
|
const container = this.getContainerElement(config);
|
|
1933
|
-
const componentRef = createComponent(
|
|
1936
|
+
const componentRef = createComponent(component, {
|
|
1934
1937
|
environmentInjector: appModuleRef.injector,
|
|
1935
1938
|
elementInjector: injector
|
|
1936
1939
|
});
|
|
@@ -1961,10 +1964,14 @@ class PlanetComponentLoader {
|
|
|
1961
1964
|
this.getPlantAppRef(app).subscribe(appRef => {
|
|
1962
1965
|
appRef.registerComponentFactory((componentName, config) => {
|
|
1963
1966
|
const components = coerceArray(componentOrComponents);
|
|
1964
|
-
const
|
|
1965
|
-
|
|
1967
|
+
const planetComponent = components.find(item => {
|
|
1968
|
+
return isComponentType(item)
|
|
1969
|
+
? reflectComponentType(item).selector.includes(componentName)
|
|
1970
|
+
: item.name === componentName;
|
|
1971
|
+
});
|
|
1972
|
+
if (planetComponent) {
|
|
1966
1973
|
return this.ngZone.run(() => {
|
|
1967
|
-
const componentRef = this.attachComponent(component, appRef.appModuleRef, config);
|
|
1974
|
+
const componentRef = this.attachComponent(isComponentType(planetComponent) ? planetComponent : planetComponent.component, appRef.appModuleRef, config);
|
|
1968
1975
|
return componentRef;
|
|
1969
1976
|
});
|
|
1970
1977
|
}
|
|
@@ -2001,9 +2008,9 @@ class PlanetComponentLoader {
|
|
|
2001
2008
|
return result;
|
|
2002
2009
|
}
|
|
2003
2010
|
}
|
|
2004
|
-
PlanetComponentLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
2005
|
-
PlanetComponentLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.
|
|
2006
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
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: [{
|
|
2007
2014
|
type: Injectable,
|
|
2008
2015
|
args: [{
|
|
2009
2016
|
providedIn: 'root'
|
|
@@ -2058,9 +2065,9 @@ class PlanetComponentOutlet {
|
|
|
2058
2065
|
this.destroyed$.next();
|
|
2059
2066
|
}
|
|
2060
2067
|
}
|
|
2061
|
-
PlanetComponentOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
2062
|
-
PlanetComponentOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.
|
|
2063
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
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: [{
|
|
2064
2071
|
type: Directive,
|
|
2065
2072
|
args: [{
|
|
2066
2073
|
selector: '[planetComponentOutlet]',
|
|
@@ -2089,10 +2096,10 @@ class NgxPlanetModule {
|
|
|
2089
2096
|
};
|
|
2090
2097
|
}
|
|
2091
2098
|
}
|
|
2092
|
-
NgxPlanetModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
2093
|
-
NgxPlanetModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.
|
|
2094
|
-
NgxPlanetModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.
|
|
2095
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
2099
|
+
NgxPlanetModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgxPlanetModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2100
|
+
NgxPlanetModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.5", ngImport: i0, type: NgxPlanetModule, imports: [HttpClientModule, PlanetComponentOutlet, EmptyComponent], exports: [HttpClientModule, EmptyComponent, PlanetComponentOutlet] });
|
|
2101
|
+
NgxPlanetModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgxPlanetModule, imports: [HttpClientModule, EmptyComponent, HttpClientModule] });
|
|
2102
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgxPlanetModule, decorators: [{
|
|
2096
2103
|
type: NgModule,
|
|
2097
2104
|
args: [{
|
|
2098
2105
|
declarations: [],
|
|
@@ -2109,6 +2116,27 @@ class PlantComponentConfig {
|
|
|
2109
2116
|
}
|
|
2110
2117
|
}
|
|
2111
2118
|
|
|
2119
|
+
class RouteRedirect {
|
|
2120
|
+
constructor(redirectTo) {
|
|
2121
|
+
this.activatedRoute = inject(ActivatedRoute);
|
|
2122
|
+
this.router = inject(Router);
|
|
2123
|
+
const finalRedirectTo = redirectTo || this.activatedRoute.snapshot.data.redirectTo;
|
|
2124
|
+
if (finalRedirectTo) {
|
|
2125
|
+
this.router.navigate([`${finalRedirectTo}`],
|
|
2126
|
+
// By replacing the current URL in the history, we keep the Browser's Back
|
|
2127
|
+
// Button behavior in tact. This will allow the user to easily navigate back
|
|
2128
|
+
// to the previous URL without getting caught in a redirect.
|
|
2129
|
+
{
|
|
2130
|
+
replaceUrl: true,
|
|
2131
|
+
relativeTo: this.activatedRoute
|
|
2132
|
+
});
|
|
2133
|
+
}
|
|
2134
|
+
}
|
|
2135
|
+
}
|
|
2136
|
+
function routeRedirect(redirectTo) {
|
|
2137
|
+
return new RouteRedirect(redirectTo);
|
|
2138
|
+
}
|
|
2139
|
+
|
|
2112
2140
|
/*
|
|
2113
2141
|
* Public API Surface of core
|
|
2114
2142
|
*/
|
|
@@ -2117,5 +2145,5 @@ class PlantComponentConfig {
|
|
|
2117
2145
|
* Generated bundle index. Do not edit.
|
|
2118
2146
|
*/
|
|
2119
2147
|
|
|
2120
|
-
export { ApplicationStatus, AssetsLoader, EmptyComponent, GlobalEventDispatcher, NgxPlanetModule, PLANET_APPLICATIONS, Planet, PlanetApplicationLoader, PlanetApplicationRef, PlanetApplicationService, PlanetComponentLoader, PlanetComponentOutlet, PlanetComponentRef, PlanetPortalApplication, PlantComponentConfig, SwitchModes, defineApplication, getPlanetApplicationRef, getPortalApplicationData };
|
|
2148
|
+
export { ApplicationStatus, AssetsLoader, EmptyComponent, GlobalEventDispatcher, NgxPlanetModule, PLANET_APPLICATIONS, Planet, PlanetApplicationLoader, PlanetApplicationRef, PlanetApplicationService, PlanetComponentLoader, PlanetComponentOutlet, PlanetComponentRef, PlanetPortalApplication, PlantComponentConfig, SwitchModes, defineApplication, getPlanetApplicationRef, getPortalApplicationData, routeRedirect };
|
|
2121
2149
|
//# sourceMappingURL=worktile-planet.mjs.map
|