@ngxs/router-plugin 3.8.1 → 3.8.2-dev.master-0fd1fe5
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/esm2020/internals/index.mjs +2 -0
- package/esm2020/internals/ngxs-router-plugin-internals.mjs +5 -0
- package/esm2020/internals/symbols.mjs +10 -0
- package/esm2020/src/public_api.mjs +5 -0
- package/esm2020/src/router.actions.mjs +85 -0
- package/esm2020/src/router.module.mjs +45 -0
- package/esm2020/src/router.state.mjs +224 -0
- package/esm2020/src/serializer.mjs +33 -0
- package/fesm2015/ngxs-router-plugin-internals.mjs +17 -0
- package/fesm2015/ngxs-router-plugin-internals.mjs.map +1 -0
- package/fesm2015/{ngxs-router-plugin.js → ngxs-router-plugin.mjs} +46 -62
- package/fesm2015/ngxs-router-plugin.mjs.map +1 -0
- package/fesm2020/ngxs-router-plugin-internals.mjs +17 -0
- package/fesm2020/ngxs-router-plugin-internals.mjs.map +1 -0
- package/fesm2020/ngxs-router-plugin.mjs +387 -0
- package/fesm2020/ngxs-router-plugin.mjs.map +1 -0
- package/internals/index.d.ts +1 -0
- package/internals/symbols.d.ts +11 -0
- package/package.json +34 -14
- package/src/public_api.d.ts +2 -2
- package/src/router.actions.d.ts +7 -7
- package/src/router.module.d.ts +3 -2
- package/src/router.state.d.ts +1 -1
- package/bundles/ngxs-router-plugin.umd.js +0 -815
- package/bundles/ngxs-router-plugin.umd.js.map +0 -1
- package/esm2015/src/public_api.js +0 -5
- package/esm2015/src/router.actions.js +0 -106
- package/esm2015/src/router.module.js +0 -33
- package/esm2015/src/router.state.js +0 -222
- package/esm2015/src/serializer.js +0 -32
- package/esm2015/src/symbols.js +0 -9
- package/fesm2015/ngxs-router-plugin.js.map +0 -1
- package/ngxs-router-plugin.d.ts +0 -5
- package/src/symbols.d.ts +0 -11
- /package/{esm2015/index.js → esm2020/index.mjs} +0 -0
- /package/{esm2015/ngxs-router-plugin.js → esm2020/ngxs-router-plugin.mjs} +0 -0
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { NgZone, Injector, Injectable, NgModule, makeEnvironmentProviders } from '@angular/core';
|
|
3
3
|
import * as i1 from '@ngxs/store';
|
|
4
|
-
import { Action, Selector, State, Store, NgxsModule } from '@ngxs/store';
|
|
4
|
+
import { Action, Selector, State, Store, NgxsModule, provideStates } from '@ngxs/store';
|
|
5
|
+
import { ɵNGXS_ROUTER_PLUGIN_OPTIONS, ɵUSER_OPTIONS, ɵcreateRouterPluginOptions } from '@ngxs/router-plugin/internals';
|
|
5
6
|
import { __decorate, __metadata } from 'tslib';
|
|
6
7
|
import * as i2 from '@angular/router';
|
|
7
8
|
import { NavigationStart, RoutesRecognized, ResolveEnd, NavigationCancel, NavigationError, NavigationEnd, Router } from '@angular/router';
|
|
8
|
-
import {
|
|
9
|
+
import { ReplaySubject } from 'rxjs';
|
|
10
|
+
import { takeUntil } from 'rxjs/operators';
|
|
9
11
|
|
|
10
12
|
/**
|
|
11
13
|
* Public event api of the router
|
|
@@ -16,11 +18,8 @@ class Navigate {
|
|
|
16
18
|
this.queryParams = queryParams;
|
|
17
19
|
this.extras = extras;
|
|
18
20
|
}
|
|
19
|
-
static get type() {
|
|
20
|
-
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
21
|
-
return '[Router] Navigate';
|
|
22
|
-
}
|
|
23
21
|
}
|
|
22
|
+
Navigate.type = '[Router] Navigate';
|
|
24
23
|
/**
|
|
25
24
|
*
|
|
26
25
|
* Angular Routers internal state events
|
|
@@ -35,11 +34,8 @@ class RouterRequest {
|
|
|
35
34
|
this.event = event;
|
|
36
35
|
this.trigger = trigger;
|
|
37
36
|
}
|
|
38
|
-
static get type() {
|
|
39
|
-
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
40
|
-
return '[Router] RouterRequest';
|
|
41
|
-
}
|
|
42
37
|
}
|
|
38
|
+
RouterRequest.type = '[Router] RouterRequest';
|
|
43
39
|
/**
|
|
44
40
|
* An action dispatched when the router navigates.
|
|
45
41
|
*/
|
|
@@ -49,11 +45,8 @@ class RouterNavigation {
|
|
|
49
45
|
this.event = event;
|
|
50
46
|
this.trigger = trigger;
|
|
51
47
|
}
|
|
52
|
-
static get type() {
|
|
53
|
-
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
54
|
-
return '[Router] RouterNavigation';
|
|
55
|
-
}
|
|
56
48
|
}
|
|
49
|
+
RouterNavigation.type = '[Router] RouterNavigation';
|
|
57
50
|
/**
|
|
58
51
|
* An action dispatched when the router cancel navigation.
|
|
59
52
|
*/
|
|
@@ -64,11 +57,8 @@ class RouterCancel {
|
|
|
64
57
|
this.event = event;
|
|
65
58
|
this.trigger = trigger;
|
|
66
59
|
}
|
|
67
|
-
static get type() {
|
|
68
|
-
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
69
|
-
return '[Router] RouterCancel';
|
|
70
|
-
}
|
|
71
60
|
}
|
|
61
|
+
RouterCancel.type = '[Router] RouterCancel';
|
|
72
62
|
/**
|
|
73
63
|
* An action dispatched when the router errors.
|
|
74
64
|
*/
|
|
@@ -79,11 +69,8 @@ class RouterError {
|
|
|
79
69
|
this.event = event;
|
|
80
70
|
this.trigger = trigger;
|
|
81
71
|
}
|
|
82
|
-
static get type() {
|
|
83
|
-
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
84
|
-
return '[Router] RouterError';
|
|
85
|
-
}
|
|
86
72
|
}
|
|
73
|
+
RouterError.type = '[Router] RouterError';
|
|
87
74
|
/**
|
|
88
75
|
* An action dispatched when the `ResolveEnd` event is triggered.
|
|
89
76
|
*/
|
|
@@ -93,11 +80,8 @@ class RouterDataResolved {
|
|
|
93
80
|
this.event = event;
|
|
94
81
|
this.trigger = trigger;
|
|
95
82
|
}
|
|
96
|
-
static get type() {
|
|
97
|
-
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
98
|
-
return '[Router] RouterDataResolved';
|
|
99
|
-
}
|
|
100
83
|
}
|
|
84
|
+
RouterDataResolved.type = '[Router] RouterDataResolved';
|
|
101
85
|
/**
|
|
102
86
|
* An action dispatched when the router navigation has been finished successfully.
|
|
103
87
|
*/
|
|
@@ -107,11 +91,8 @@ class RouterNavigated {
|
|
|
107
91
|
this.event = event;
|
|
108
92
|
this.trigger = trigger;
|
|
109
93
|
}
|
|
110
|
-
static get type() {
|
|
111
|
-
// NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
|
|
112
|
-
return '[Router] RouterNavigated';
|
|
113
|
-
}
|
|
114
94
|
}
|
|
95
|
+
RouterNavigated.type = '[Router] RouterNavigated';
|
|
115
96
|
|
|
116
97
|
class RouterStateSerializer {
|
|
117
98
|
}
|
|
@@ -126,6 +107,7 @@ class DefaultRouterStateSerializer {
|
|
|
126
107
|
const children = route.children.map(c => this.serializeRoute(c));
|
|
127
108
|
return {
|
|
128
109
|
url: route.url,
|
|
110
|
+
title: route.title,
|
|
129
111
|
params: route.params,
|
|
130
112
|
queryParams: route.queryParams,
|
|
131
113
|
fragment: route.fragment,
|
|
@@ -145,14 +127,6 @@ class DefaultRouterStateSerializer {
|
|
|
145
127
|
}
|
|
146
128
|
}
|
|
147
129
|
|
|
148
|
-
const USER_OPTIONS = new InjectionToken('USER_OPTIONS', { providedIn: 'root', factory: () => undefined });
|
|
149
|
-
const NGXS_ROUTER_PLUGIN_OPTIONS = new InjectionToken('NGXS_ROUTER_PLUGIN_OPTIONS', { providedIn: 'root', factory: () => ({}) });
|
|
150
|
-
function createRouterPluginOptions(options) {
|
|
151
|
-
return {
|
|
152
|
-
navigationActionTiming: (options && options.navigationActionTiming) || 1 /* PreActivation */
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
|
|
156
130
|
var RouterState_1;
|
|
157
131
|
let RouterState = RouterState_1 = class RouterState {
|
|
158
132
|
constructor(_store, _router, _serializer, _ngZone, injector) {
|
|
@@ -174,11 +148,11 @@ let RouterState = RouterState_1 = class RouterState {
|
|
|
174
148
|
*/
|
|
175
149
|
this._storeState = null;
|
|
176
150
|
this._lastEvent = null;
|
|
177
|
-
this._subscription = new Subscription();
|
|
178
151
|
this._options = null;
|
|
152
|
+
this._destroy$ = new ReplaySubject(1);
|
|
179
153
|
// Note: do not use `@Inject` since it fails on lower versions of Angular with Jest
|
|
180
154
|
// integration, it cannot resolve the token provider.
|
|
181
|
-
this._options = injector.get(NGXS_ROUTER_PLUGIN_OPTIONS, null);
|
|
155
|
+
this._options = injector.get(ɵNGXS_ROUTER_PLUGIN_OPTIONS, null);
|
|
182
156
|
this._setUpStoreListener();
|
|
183
157
|
this._setUpRouterEventsListener();
|
|
184
158
|
}
|
|
@@ -189,7 +163,7 @@ let RouterState = RouterState_1 = class RouterState {
|
|
|
189
163
|
return state && state.state && state.state.url;
|
|
190
164
|
}
|
|
191
165
|
ngOnDestroy() {
|
|
192
|
-
this.
|
|
166
|
+
this._destroy$.next();
|
|
193
167
|
}
|
|
194
168
|
navigate(_, action) {
|
|
195
169
|
return this._ngZone.run(() => this._router.navigate(action.path, Object.assign({ queryParams: action.queryParams }, action.extras)));
|
|
@@ -202,12 +176,10 @@ let RouterState = RouterState_1 = class RouterState {
|
|
|
202
176
|
});
|
|
203
177
|
}
|
|
204
178
|
_setUpStoreListener() {
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
.subscribe((state) => {
|
|
179
|
+
const routerState$ = this._store.select(RouterState_1).pipe(takeUntil(this._destroy$));
|
|
180
|
+
routerState$.subscribe((state) => {
|
|
208
181
|
this._navigateIfNeeded(state);
|
|
209
182
|
});
|
|
210
|
-
this._subscription.add(subscription);
|
|
211
183
|
}
|
|
212
184
|
_navigateIfNeeded(routerState) {
|
|
213
185
|
if (routerState && routerState.trigger === 'devtools') {
|
|
@@ -228,9 +200,10 @@ let RouterState = RouterState_1 = class RouterState {
|
|
|
228
200
|
}
|
|
229
201
|
_setUpRouterEventsListener() {
|
|
230
202
|
const dispatchRouterNavigationLate = this._options != null &&
|
|
231
|
-
this._options.navigationActionTiming === 2 /* PostActivation */;
|
|
203
|
+
this._options.navigationActionTiming === 2 /* NavigationActionTiming.PostActivation */;
|
|
232
204
|
let lastRoutesRecognized;
|
|
233
|
-
const
|
|
205
|
+
const events$ = this._router.events.pipe(takeUntil(this._destroy$));
|
|
206
|
+
events$.subscribe(event => {
|
|
234
207
|
this._lastEvent = event;
|
|
235
208
|
if (event instanceof NavigationStart) {
|
|
236
209
|
this._navigationStart(event);
|
|
@@ -262,7 +235,6 @@ let RouterState = RouterState_1 = class RouterState {
|
|
|
262
235
|
this._reset();
|
|
263
236
|
}
|
|
264
237
|
});
|
|
265
|
-
this._subscription.add(subscription);
|
|
266
238
|
}
|
|
267
239
|
/** Reacts to `NavigationStart`. */
|
|
268
240
|
_navigationStart(event) {
|
|
@@ -310,8 +282,8 @@ let RouterState = RouterState_1 = class RouterState {
|
|
|
310
282
|
this._routerState = null;
|
|
311
283
|
}
|
|
312
284
|
};
|
|
313
|
-
/** @nocollapse */ RouterState.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
314
|
-
/** @nocollapse */ RouterState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
285
|
+
/** @nocollapse */ RouterState.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: RouterState, deps: [{ token: i1.Store }, { token: i2.Router }, { token: RouterStateSerializer }, { token: i0.NgZone }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
286
|
+
/** @nocollapse */ RouterState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: RouterState });
|
|
315
287
|
__decorate([
|
|
316
288
|
Action(Navigate),
|
|
317
289
|
__metadata("design:type", Function),
|
|
@@ -358,7 +330,7 @@ RouterState = RouterState_1 = __decorate([
|
|
|
358
330
|
NgZone,
|
|
359
331
|
Injector])
|
|
360
332
|
], RouterState);
|
|
361
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
333
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: RouterState, decorators: [{
|
|
362
334
|
type: Injectable
|
|
363
335
|
}], ctorParameters: function () { return [{ type: i1.Store }, { type: i2.Router }, { type: RouterStateSerializer }, { type: i0.NgZone }, { type: i0.Injector }]; }, propDecorators: { navigate: [], angularRouterAction: [] } });
|
|
364
336
|
|
|
@@ -367,26 +339,38 @@ class NgxsRouterPluginModule {
|
|
|
367
339
|
return {
|
|
368
340
|
ngModule: NgxsRouterPluginModule,
|
|
369
341
|
providers: [
|
|
370
|
-
{ provide: USER_OPTIONS, useValue: options },
|
|
342
|
+
{ provide: ɵUSER_OPTIONS, useValue: options },
|
|
371
343
|
{
|
|
372
|
-
provide: NGXS_ROUTER_PLUGIN_OPTIONS,
|
|
373
|
-
useFactory:
|
|
374
|
-
deps: [USER_OPTIONS]
|
|
344
|
+
provide: ɵNGXS_ROUTER_PLUGIN_OPTIONS,
|
|
345
|
+
useFactory: ɵcreateRouterPluginOptions,
|
|
346
|
+
deps: [ɵUSER_OPTIONS]
|
|
375
347
|
},
|
|
376
348
|
{ provide: RouterStateSerializer, useClass: DefaultRouterStateSerializer }
|
|
377
349
|
]
|
|
378
350
|
};
|
|
379
351
|
}
|
|
380
352
|
}
|
|
381
|
-
/** @nocollapse */ NgxsRouterPluginModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
382
|
-
/** @nocollapse */ NgxsRouterPluginModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "
|
|
383
|
-
/** @nocollapse */ NgxsRouterPluginModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
384
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
353
|
+
/** @nocollapse */ NgxsRouterPluginModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgxsRouterPluginModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
354
|
+
/** @nocollapse */ NgxsRouterPluginModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.4", ngImport: i0, type: NgxsRouterPluginModule, imports: [i1.ɵNgxsFeatureModule] });
|
|
355
|
+
/** @nocollapse */ NgxsRouterPluginModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgxsRouterPluginModule, imports: [NgxsModule.forFeature([RouterState])] });
|
|
356
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgxsRouterPluginModule, decorators: [{
|
|
385
357
|
type: NgModule,
|
|
386
358
|
args: [{
|
|
387
359
|
imports: [NgxsModule.forFeature([RouterState])]
|
|
388
360
|
}]
|
|
389
361
|
}] });
|
|
362
|
+
function withNgxsRouterPlugin(options) {
|
|
363
|
+
return makeEnvironmentProviders([
|
|
364
|
+
provideStates([RouterState]),
|
|
365
|
+
{ provide: ɵUSER_OPTIONS, useValue: options },
|
|
366
|
+
{
|
|
367
|
+
provide: ɵNGXS_ROUTER_PLUGIN_OPTIONS,
|
|
368
|
+
useFactory: ɵcreateRouterPluginOptions,
|
|
369
|
+
deps: [ɵUSER_OPTIONS]
|
|
370
|
+
},
|
|
371
|
+
{ provide: RouterStateSerializer, useClass: DefaultRouterStateSerializer }
|
|
372
|
+
]);
|
|
373
|
+
}
|
|
390
374
|
|
|
391
375
|
/**
|
|
392
376
|
* The public api for consumers of @ngxs/router-plugin
|
|
@@ -396,5 +380,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
396
380
|
* Generated bundle index. Do not edit.
|
|
397
381
|
*/
|
|
398
382
|
|
|
399
|
-
export { DefaultRouterStateSerializer, Navigate, NgxsRouterPluginModule, RouterCancel, RouterDataResolved, RouterError, RouterNavigated, RouterNavigation, RouterRequest, RouterState, RouterStateSerializer };
|
|
400
|
-
//# sourceMappingURL=ngxs-router-plugin.
|
|
383
|
+
export { DefaultRouterStateSerializer, Navigate, NgxsRouterPluginModule, RouterCancel, RouterDataResolved, RouterError, RouterNavigated, RouterNavigation, RouterRequest, RouterState, RouterStateSerializer, withNgxsRouterPlugin };
|
|
384
|
+
//# sourceMappingURL=ngxs-router-plugin.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngxs-router-plugin.mjs","sources":["../../../packages/router-plugin/src/router.actions.ts","../../../packages/router-plugin/src/serializer.ts","../../../packages/router-plugin/src/router.state.ts","../../../packages/router-plugin/src/router.module.ts","../../../packages/router-plugin/index.ts","../../../packages/router-plugin/ngxs-router-plugin.ts"],"sourcesContent":["import {\n NavigationCancel,\n NavigationError,\n NavigationExtras,\n Params,\n RouterStateSnapshot,\n RoutesRecognized,\n ResolveEnd,\n NavigationStart,\n NavigationEnd\n} from '@angular/router';\n\nimport { RouterTrigger } from './router.state';\n\n/**\n * Public event api of the router\n */\nexport class Navigate {\n static readonly type = '[Router] Navigate';\n\n constructor(\n public path: any[],\n public queryParams?: Params,\n public extras?: NavigationExtras\n ) {}\n}\n\n/**\n *\n * Angular Routers internal state events\n *\n */\n\n/**\n * An action dispatched when the router starts the navigation.\n */\nexport class RouterRequest<T = RouterStateSnapshot> {\n static readonly type = '[Router] RouterRequest';\n\n constructor(\n public routerState: T,\n public event: NavigationStart,\n public trigger: RouterTrigger = 'none'\n ) {}\n}\n\n/**\n * An action dispatched when the router navigates.\n */\nexport class RouterNavigation<T = RouterStateSnapshot> {\n static readonly type = '[Router] RouterNavigation';\n\n constructor(\n public routerState: T,\n public event: RoutesRecognized,\n public trigger: RouterTrigger = 'none'\n ) {}\n}\n\n/**\n * An action dispatched when the router cancel navigation.\n */\nexport class RouterCancel<T, V = RouterStateSnapshot> {\n static readonly type = '[Router] RouterCancel';\n\n constructor(\n public routerState: V,\n public storeState: T,\n public event: NavigationCancel,\n public trigger: RouterTrigger = 'none'\n ) {}\n}\n\n/**\n * An action dispatched when the router errors.\n */\nexport class RouterError<T, V = RouterStateSnapshot> {\n static readonly type = '[Router] RouterError';\n\n constructor(\n public routerState: V,\n public storeState: T,\n public event: NavigationError,\n public trigger: RouterTrigger = 'none'\n ) {}\n}\n\n/**\n * An action dispatched when the `ResolveEnd` event is triggered.\n */\nexport class RouterDataResolved<T = RouterStateSnapshot> {\n static readonly type = '[Router] RouterDataResolved';\n\n constructor(\n public routerState: T,\n public event: ResolveEnd,\n public trigger: RouterTrigger = 'none'\n ) {}\n}\n\n/**\n * An action dispatched when the router navigation has been finished successfully.\n */\nexport class RouterNavigated<T = RouterStateSnapshot> {\n static readonly type = '[Router] RouterNavigated';\n\n constructor(\n public routerState: T,\n public event: NavigationEnd,\n public trigger: RouterTrigger = 'none'\n ) {}\n}\n\n/**\n * An union type of router actions.\n */\nexport type RouterAction<T, V = RouterStateSnapshot> =\n | RouterRequest<V>\n | RouterNavigation<V>\n | RouterCancel<T, V>\n | RouterError<T, V>\n | RouterDataResolved<V>\n | RouterNavigated<V>;\n","import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';\n\nexport abstract class RouterStateSerializer<T> {\n abstract serialize(routerState: RouterStateSnapshot): T;\n}\n\nexport interface SerializedRouterStateSnapshot {\n root: ActivatedRouteSnapshot;\n url: string;\n}\n\nexport class DefaultRouterStateSerializer\n implements RouterStateSerializer<SerializedRouterStateSnapshot>\n{\n serialize(routerState: RouterStateSnapshot): SerializedRouterStateSnapshot {\n return {\n root: this.serializeRoute(routerState.root),\n url: routerState.url\n };\n }\n\n private serializeRoute(route: ActivatedRouteSnapshot): ActivatedRouteSnapshot {\n const children = route.children.map(c => this.serializeRoute(c));\n return {\n url: route.url,\n title: route.title,\n params: route.params,\n queryParams: route.queryParams,\n fragment: route.fragment!,\n data: route.data,\n outlet: route.outlet,\n component: null,\n routeConfig: null,\n root: null as any,\n parent: null,\n firstChild: children[0],\n children: children,\n pathFromRoot: null as any,\n paramMap: route.paramMap,\n queryParamMap: route.queryParamMap,\n toString: route.toString\n };\n }\n}\n","import { NgZone, Injectable, OnDestroy, Injector } from '@angular/core';\nimport {\n NavigationCancel,\n NavigationError,\n Router,\n RouterStateSnapshot,\n RoutesRecognized,\n ResolveEnd,\n NavigationStart,\n NavigationEnd,\n Event\n} from '@angular/router';\nimport { Action, Selector, State, StateContext, Store } from '@ngxs/store';\nimport {\n NavigationActionTiming,\n NgxsRouterPluginOptions,\n ɵNGXS_ROUTER_PLUGIN_OPTIONS\n} from '@ngxs/router-plugin/internals';\nimport { ReplaySubject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport {\n Navigate,\n RouterAction,\n RouterCancel,\n RouterError,\n RouterNavigation,\n RouterDataResolved,\n RouterRequest,\n RouterNavigated\n} from './router.actions';\nimport { RouterStateSerializer } from './serializer';\n\nexport interface RouterStateModel<T = RouterStateSnapshot> {\n state?: T;\n navigationId?: number;\n trigger: RouterTrigger;\n}\n\nexport type RouterTrigger =\n | 'none'\n | 'router'\n | 'store'\n // The `devtools` trigger means that the state change has been triggered by Redux DevTools (e.g. when the time-traveling is used).\n | 'devtools';\n\n@State<RouterStateModel>({\n name: 'router',\n defaults: {\n state: undefined,\n navigationId: undefined,\n trigger: 'none'\n }\n})\n@Injectable()\nexport class RouterState implements OnDestroy {\n /**\n * Determines how navigation was performed by the `RouterState` itself\n * or outside via `new Navigate(...)`\n */\n private _trigger: RouterTrigger = 'none';\n\n /**\n * That's the serialized state from the `Router` class\n */\n private _routerState: RouterStateSnapshot | null = null;\n\n /**\n * That's the value of the `RouterState` state\n */\n private _storeState: RouterStateModel | null = null;\n\n private _lastEvent: Event | null = null;\n\n private _options: NgxsRouterPluginOptions | null = null;\n\n private _destroy$ = new ReplaySubject<void>(1);\n\n @Selector()\n static state<T = RouterStateSnapshot>(state: RouterStateModel<T>) {\n return state && state.state;\n }\n\n @Selector()\n static url(state: RouterStateModel): string | undefined {\n return state && state.state && state.state.url;\n }\n\n constructor(\n private _store: Store,\n private _router: Router,\n private _serializer: RouterStateSerializer<RouterStateSnapshot>,\n private _ngZone: NgZone,\n injector: Injector\n ) {\n // Note: do not use `@Inject` since it fails on lower versions of Angular with Jest\n // integration, it cannot resolve the token provider.\n this._options = injector.get(ɵNGXS_ROUTER_PLUGIN_OPTIONS, null);\n this._setUpStoreListener();\n this._setUpRouterEventsListener();\n }\n\n ngOnDestroy(): void {\n this._destroy$.next();\n }\n\n @Action(Navigate)\n navigate(_: StateContext<RouterStateModel>, action: Navigate) {\n return this._ngZone.run(() =>\n this._router.navigate(action.path, {\n queryParams: action.queryParams,\n ...action.extras\n })\n );\n }\n\n @Action([\n RouterRequest,\n RouterNavigation,\n RouterError,\n RouterCancel,\n RouterDataResolved,\n RouterNavigated\n ])\n angularRouterAction(\n ctx: StateContext<RouterStateModel>,\n action: RouterAction<RouterStateModel, RouterStateSnapshot>\n ): void {\n ctx.setState({\n trigger: action.trigger,\n state: action.routerState,\n navigationId: action.event.id\n });\n }\n\n private _setUpStoreListener(): void {\n const routerState$ = this._store.select(RouterState).pipe(takeUntil(this._destroy$));\n routerState$.subscribe((state: RouterStateModel | undefined) => {\n this._navigateIfNeeded(state);\n });\n }\n\n private _navigateIfNeeded(routerState: RouterStateModel | undefined): void {\n if (routerState && routerState.trigger === 'devtools') {\n this._storeState = this._store.selectSnapshot(RouterState);\n }\n\n const canSkipNavigation =\n !this._storeState ||\n !this._storeState.state ||\n !routerState ||\n routerState.trigger === 'router' ||\n this._router.url === this._storeState.state.url ||\n this._lastEvent instanceof NavigationStart;\n\n if (canSkipNavigation) {\n return;\n }\n\n this._storeState = this._store.selectSnapshot(RouterState);\n this._trigger = 'store';\n this._ngZone.run(() => this._router.navigateByUrl(this._storeState!.state!.url));\n }\n\n private _setUpRouterEventsListener(): void {\n const dispatchRouterNavigationLate =\n this._options != null &&\n this._options.navigationActionTiming === NavigationActionTiming.PostActivation;\n\n let lastRoutesRecognized: RoutesRecognized;\n\n const events$ = this._router.events.pipe(takeUntil(this._destroy$));\n events$.subscribe(event => {\n this._lastEvent = event;\n\n if (event instanceof NavigationStart) {\n this._navigationStart(event);\n } else if (event instanceof RoutesRecognized) {\n lastRoutesRecognized = event;\n if (!dispatchRouterNavigationLate && this._trigger !== 'store') {\n this._dispatchRouterNavigation(lastRoutesRecognized);\n }\n } else if (event instanceof ResolveEnd) {\n this._dispatchRouterDataResolved(event);\n } else if (event instanceof NavigationCancel) {\n this._dispatchRouterCancel(event);\n this._reset();\n } else if (event instanceof NavigationError) {\n this._dispatchRouterError(event);\n this._reset();\n } else if (event instanceof NavigationEnd) {\n if (this._trigger !== 'store') {\n if (dispatchRouterNavigationLate) {\n this._dispatchRouterNavigation(lastRoutesRecognized);\n }\n this._dispatchRouterNavigated(event);\n }\n this._reset();\n }\n });\n }\n\n /** Reacts to `NavigationStart`. */\n private _navigationStart(event: NavigationStart): void {\n this._routerState = this._serializer.serialize(this._router.routerState.snapshot);\n\n if (this._trigger !== 'none') {\n this._storeState = this._store.selectSnapshot(RouterState);\n this._dispatchRouterAction(new RouterRequest(this._routerState, event, this._trigger));\n }\n }\n\n /** Reacts to `ResolveEnd`. */\n private _dispatchRouterDataResolved(event: ResolveEnd): void {\n const routerState = this._serializer.serialize(event.state);\n this._dispatchRouterAction(new RouterDataResolved(routerState, event, this._trigger));\n }\n\n /** Reacts to `RoutesRecognized` or `NavigationEnd`, depends on the `navigationActionTiming`. */\n private _dispatchRouterNavigation(lastRoutesRecognized: RoutesRecognized): void {\n const nextRouterState = this._serializer.serialize(lastRoutesRecognized.state);\n\n this._dispatchRouterAction(\n new RouterNavigation(\n nextRouterState,\n new RoutesRecognized(\n lastRoutesRecognized.id,\n lastRoutesRecognized.url,\n lastRoutesRecognized.urlAfterRedirects,\n nextRouterState\n ),\n this._trigger\n )\n );\n }\n\n /** Reacts to `NavigationCancel`. */\n private _dispatchRouterCancel(event: NavigationCancel): void {\n this._dispatchRouterAction(\n new RouterCancel(this._routerState!, this._storeState, event, this._trigger)\n );\n }\n\n /** Reacts to `NavigationEnd`. */\n private _dispatchRouterError(event: NavigationError): void {\n this._dispatchRouterAction(\n new RouterError(\n this._routerState!,\n this._storeState,\n new NavigationError(event.id, event.url, `${event}`),\n this._trigger\n )\n );\n }\n\n /** Reacts to `NavigationEnd`. */\n private _dispatchRouterNavigated(event: NavigationEnd): void {\n const routerState = this._serializer.serialize(this._router.routerState.snapshot);\n this._dispatchRouterAction(new RouterNavigated(routerState, event, this._trigger));\n }\n\n private _dispatchRouterAction<T>(action: RouterAction<T>): void {\n this._trigger = 'router';\n\n try {\n this._store.dispatch(action);\n } finally {\n this._trigger = 'none';\n }\n }\n\n private _reset(): void {\n this._trigger = 'none';\n this._storeState = null;\n this._routerState = null;\n }\n}\n","import {\n EnvironmentProviders,\n ModuleWithProviders,\n NgModule,\n makeEnvironmentProviders\n} from '@angular/core';\nimport { NgxsModule, provideStates } from '@ngxs/store';\nimport {\n NgxsRouterPluginOptions,\n ɵcreateRouterPluginOptions,\n ɵNGXS_ROUTER_PLUGIN_OPTIONS,\n ɵUSER_OPTIONS\n} from '@ngxs/router-plugin/internals';\n\nimport { RouterState } from './router.state';\nimport { DefaultRouterStateSerializer, RouterStateSerializer } from './serializer';\n\n@NgModule({\n imports: [NgxsModule.forFeature([RouterState])]\n})\nexport class NgxsRouterPluginModule {\n static forRoot(\n options?: NgxsRouterPluginOptions\n ): ModuleWithProviders<NgxsRouterPluginModule> {\n return {\n ngModule: NgxsRouterPluginModule,\n providers: [\n { provide: ɵUSER_OPTIONS, useValue: options },\n {\n provide: ɵNGXS_ROUTER_PLUGIN_OPTIONS,\n useFactory: ɵcreateRouterPluginOptions,\n deps: [ɵUSER_OPTIONS]\n },\n { provide: RouterStateSerializer, useClass: DefaultRouterStateSerializer }\n ]\n };\n }\n}\n\nexport function withNgxsRouterPlugin(options?: NgxsRouterPluginOptions): EnvironmentProviders {\n return makeEnvironmentProviders([\n provideStates([RouterState]),\n { provide: ɵUSER_OPTIONS, useValue: options },\n {\n provide: ɵNGXS_ROUTER_PLUGIN_OPTIONS,\n useFactory: ɵcreateRouterPluginOptions,\n deps: [ɵUSER_OPTIONS]\n },\n { provide: RouterStateSerializer, useClass: DefaultRouterStateSerializer }\n ]);\n}\n","/**\n * The public api for consumers of @ngxs/router-plugin\n */\nexport * from './src/public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i3.RouterStateSerializer"],"mappings":";;;;;;;;;;;AAcA;;AAEG;MACU,QAAQ,CAAA;AAGnB,IAAA,WAAA,CACS,IAAW,EACX,WAAoB,EACpB,MAAyB,EAAA;AAFzB,QAAA,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAO;AACX,QAAA,IAAW,CAAA,WAAA,GAAX,WAAW,CAAS;AACpB,QAAA,IAAM,CAAA,MAAA,GAAN,MAAM,CAAmB;KAC9B;;AANY,QAAI,CAAA,IAAA,GAAG,mBAAmB,CAAC;AAS7C;;;;AAIG;AAEH;;AAEG;MACU,aAAa,CAAA;AAGxB,IAAA,WAAA,CACS,WAAc,EACd,KAAsB,EACtB,UAAyB,MAAM,EAAA;AAF/B,QAAA,IAAW,CAAA,WAAA,GAAX,WAAW,CAAG;AACd,QAAA,IAAK,CAAA,KAAA,GAAL,KAAK,CAAiB;AACtB,QAAA,IAAO,CAAA,OAAA,GAAP,OAAO,CAAwB;KACpC;;AANY,aAAI,CAAA,IAAA,GAAG,wBAAwB,CAAC;AASlD;;AAEG;MACU,gBA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import { InjectionToken } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
const NG_DEV_MODE = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
4
|
+
const ɵUSER_OPTIONS = new InjectionToken(NG_DEV_MODE ? 'USER_OPTIONS' : '', { providedIn: 'root', factory: () => undefined });
|
|
5
|
+
const ɵNGXS_ROUTER_PLUGIN_OPTIONS = new InjectionToken(NG_DEV_MODE ? 'NGXS_ROUTER_PLUGIN_OPTIONS' : '', { providedIn: 'root', factory: () => ({}) });
|
|
6
|
+
function ɵcreateRouterPluginOptions(options) {
|
|
7
|
+
return {
|
|
8
|
+
navigationActionTiming: (options && options.navigationActionTiming) || 1 /* NavigationActionTiming.PreActivation */
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Generated bundle index. Do not edit.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
export { ɵNGXS_ROUTER_PLUGIN_OPTIONS, ɵUSER_OPTIONS, ɵcreateRouterPluginOptions };
|
|
17
|
+
//# sourceMappingURL=ngxs-router-plugin-internals.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngxs-router-plugin-internals.mjs","sources":["../../../packages/router-plugin/internals/src/symbols.ts","../../../packages/router-plugin/internals/src/ngxs-router-plugin-internals.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\ndeclare const ngDevMode: boolean;\n\nconst NG_DEV_MODE = typeof ngDevMode === 'undefined' || ngDevMode;\n\nexport const enum NavigationActionTiming {\n PreActivation = 1,\n PostActivation = 2\n}\n\nexport interface NgxsRouterPluginOptions {\n navigationActionTiming?: NavigationActionTiming;\n}\n\nexport const ɵUSER_OPTIONS = new InjectionToken<NgxsRouterPluginOptions | undefined>(\n NG_DEV_MODE ? 'USER_OPTIONS' : '',\n { providedIn: 'root', factory: () => undefined }\n);\n\nexport const ɵNGXS_ROUTER_PLUGIN_OPTIONS = new InjectionToken<NgxsRouterPluginOptions>(\n NG_DEV_MODE ? 'NGXS_ROUTER_PLUGIN_OPTIONS' : '',\n { providedIn: 'root', factory: () => ({}) }\n);\n\nexport function ɵcreateRouterPluginOptions(\n options: NgxsRouterPluginOptions | undefined\n): NgxsRouterPluginOptions {\n return {\n navigationActionTiming:\n (options && options.navigationActionTiming) || NavigationActionTiming.PreActivation\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAIA,MAAM,WAAW,GAAG,OAAO,SAAS,KAAK,WAAW,IAAI,SAAS,CAAC;AAW3D,MAAM,aAAa,GAAG,IAAI,cAAc,CAC7C,WAAW,GAAG,cAAc,GAAG,EAAE,EACjC,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,SAAS,EAAE,EAChD;AAEK,MAAM,2BAA2B,GAAG,IAAI,cAAc,CAC3D,WAAW,GAAG,4BAA4B,GAAG,EAAE,EAC/C,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,EAC3C;AAEI,SAAU,0BAA0B,CACxC,OAA4C,EAAA;IAE5C,OAAO;QACL,sBAAsB,EACpB,CAAC,OAAO,IAAI,OAAO,CAAC,sBAAsB,KAAyC,CAAA;KACtF,CAAC;AACJ;;AChCA;;AAEG;;;;"}
|