@ngxs/router-plugin 3.8.2-dev.master-0fd1fe5 → 3.8.2

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 (34) hide show
  1. package/bundles/ngxs-router-plugin.umd.js +903 -0
  2. package/bundles/ngxs-router-plugin.umd.js.map +1 -0
  3. package/esm2015/src/public_api.js +5 -0
  4. package/esm2015/src/router.module.js +33 -0
  5. package/esm2015/src/router.state.js +222 -0
  6. package/esm2015/src/serializer.js +32 -0
  7. package/esm2015/src/symbols.js +9 -0
  8. package/fesm2015/{ngxs-router-plugin.mjs → ngxs-router-plugin.js} +34 -39
  9. package/fesm2015/ngxs-router-plugin.js.map +1 -0
  10. package/ngxs-router-plugin.d.ts +5 -0
  11. package/package.json +12 -32
  12. package/src/public_api.d.ts +2 -2
  13. package/src/router.module.d.ts +2 -3
  14. package/src/router.state.d.ts +1 -1
  15. package/src/symbols.d.ts +11 -0
  16. package/esm2020/internals/index.mjs +0 -2
  17. package/esm2020/internals/ngxs-router-plugin-internals.mjs +0 -5
  18. package/esm2020/internals/symbols.mjs +0 -10
  19. package/esm2020/src/public_api.mjs +0 -5
  20. package/esm2020/src/router.module.mjs +0 -45
  21. package/esm2020/src/router.state.mjs +0 -224
  22. package/esm2020/src/serializer.mjs +0 -33
  23. package/fesm2015/ngxs-router-plugin-internals.mjs +0 -17
  24. package/fesm2015/ngxs-router-plugin-internals.mjs.map +0 -1
  25. package/fesm2015/ngxs-router-plugin.mjs.map +0 -1
  26. package/fesm2020/ngxs-router-plugin-internals.mjs +0 -17
  27. package/fesm2020/ngxs-router-plugin-internals.mjs.map +0 -1
  28. package/fesm2020/ngxs-router-plugin.mjs +0 -387
  29. package/fesm2020/ngxs-router-plugin.mjs.map +0 -1
  30. package/internals/index.d.ts +0 -1
  31. package/internals/symbols.d.ts +0 -11
  32. /package/{esm2020/index.mjs → esm2015/index.js} +0 -0
  33. /package/{esm2020/ngxs-router-plugin.mjs → esm2015/ngxs-router-plugin.js} +0 -0
  34. /package/{esm2020/src/router.actions.mjs → esm2015/src/router.actions.js} +0 -0
@@ -1,13 +1,11 @@
1
1
  import * as i0 from '@angular/core';
2
- import { NgZone, Injector, Injectable, NgModule, makeEnvironmentProviders } from '@angular/core';
2
+ import { InjectionToken, NgZone, Injector, Injectable, NgModule } from '@angular/core';
3
3
  import * as i1 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';
4
+ import { Action, Selector, State, Store, NgxsModule } from '@ngxs/store';
6
5
  import { __decorate, __metadata } from 'tslib';
7
6
  import * as i2 from '@angular/router';
8
7
  import { NavigationStart, RoutesRecognized, ResolveEnd, NavigationCancel, NavigationError, NavigationEnd, Router } from '@angular/router';
9
- import { ReplaySubject } from 'rxjs';
10
- import { takeUntil } from 'rxjs/operators';
8
+ import { Subscription } from 'rxjs';
11
9
 
12
10
  /**
13
11
  * Public event api of the router
@@ -107,7 +105,6 @@ class DefaultRouterStateSerializer {
107
105
  const children = route.children.map(c => this.serializeRoute(c));
108
106
  return {
109
107
  url: route.url,
110
- title: route.title,
111
108
  params: route.params,
112
109
  queryParams: route.queryParams,
113
110
  fragment: route.fragment,
@@ -127,6 +124,14 @@ class DefaultRouterStateSerializer {
127
124
  }
128
125
  }
129
126
 
127
+ const USER_OPTIONS = new InjectionToken('USER_OPTIONS', { providedIn: 'root', factory: () => undefined });
128
+ const NGXS_ROUTER_PLUGIN_OPTIONS = new InjectionToken('NGXS_ROUTER_PLUGIN_OPTIONS', { providedIn: 'root', factory: () => ({}) });
129
+ function createRouterPluginOptions(options) {
130
+ return {
131
+ navigationActionTiming: (options && options.navigationActionTiming) || 1 /* PreActivation */
132
+ };
133
+ }
134
+
130
135
  var RouterState_1;
131
136
  let RouterState = RouterState_1 = class RouterState {
132
137
  constructor(_store, _router, _serializer, _ngZone, injector) {
@@ -148,11 +153,11 @@ let RouterState = RouterState_1 = class RouterState {
148
153
  */
149
154
  this._storeState = null;
150
155
  this._lastEvent = null;
156
+ this._subscription = new Subscription();
151
157
  this._options = null;
152
- this._destroy$ = new ReplaySubject(1);
153
158
  // Note: do not use `@Inject` since it fails on lower versions of Angular with Jest
154
159
  // integration, it cannot resolve the token provider.
155
- this._options = injector.get(ɵNGXS_ROUTER_PLUGIN_OPTIONS, null);
160
+ this._options = injector.get(NGXS_ROUTER_PLUGIN_OPTIONS, null);
156
161
  this._setUpStoreListener();
157
162
  this._setUpRouterEventsListener();
158
163
  }
@@ -163,7 +168,7 @@ let RouterState = RouterState_1 = class RouterState {
163
168
  return state && state.state && state.state.url;
164
169
  }
165
170
  ngOnDestroy() {
166
- this._destroy$.next();
171
+ this._subscription.unsubscribe();
167
172
  }
168
173
  navigate(_, action) {
169
174
  return this._ngZone.run(() => this._router.navigate(action.path, Object.assign({ queryParams: action.queryParams }, action.extras)));
@@ -176,10 +181,12 @@ let RouterState = RouterState_1 = class RouterState {
176
181
  });
177
182
  }
178
183
  _setUpStoreListener() {
179
- const routerState$ = this._store.select(RouterState_1).pipe(takeUntil(this._destroy$));
180
- routerState$.subscribe((state) => {
184
+ const subscription = this._store
185
+ .select(RouterState_1)
186
+ .subscribe((state) => {
181
187
  this._navigateIfNeeded(state);
182
188
  });
189
+ this._subscription.add(subscription);
183
190
  }
184
191
  _navigateIfNeeded(routerState) {
185
192
  if (routerState && routerState.trigger === 'devtools') {
@@ -200,10 +207,9 @@ let RouterState = RouterState_1 = class RouterState {
200
207
  }
201
208
  _setUpRouterEventsListener() {
202
209
  const dispatchRouterNavigationLate = this._options != null &&
203
- this._options.navigationActionTiming === 2 /* NavigationActionTiming.PostActivation */;
210
+ this._options.navigationActionTiming === 2 /* PostActivation */;
204
211
  let lastRoutesRecognized;
205
- const events$ = this._router.events.pipe(takeUntil(this._destroy$));
206
- events$.subscribe(event => {
212
+ const subscription = this._router.events.subscribe(event => {
207
213
  this._lastEvent = event;
208
214
  if (event instanceof NavigationStart) {
209
215
  this._navigationStart(event);
@@ -235,6 +241,7 @@ let RouterState = RouterState_1 = class RouterState {
235
241
  this._reset();
236
242
  }
237
243
  });
244
+ this._subscription.add(subscription);
238
245
  }
239
246
  /** Reacts to `NavigationStart`. */
240
247
  _navigationStart(event) {
@@ -282,8 +289,8 @@ let RouterState = RouterState_1 = class RouterState {
282
289
  this._routerState = null;
283
290
  }
284
291
  };
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 });
292
+ /** @nocollapse */ RouterState.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: RouterState, deps: [{ token: i1.Store }, { token: i2.Router }, { token: RouterStateSerializer }, { token: i0.NgZone }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
293
+ /** @nocollapse */ RouterState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: RouterState });
287
294
  __decorate([
288
295
  Action(Navigate),
289
296
  __metadata("design:type", Function),
@@ -330,7 +337,7 @@ RouterState = RouterState_1 = __decorate([
330
337
  NgZone,
331
338
  Injector])
332
339
  ], RouterState);
333
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: RouterState, decorators: [{
340
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: RouterState, decorators: [{
334
341
  type: Injectable
335
342
  }], ctorParameters: function () { return [{ type: i1.Store }, { type: i2.Router }, { type: RouterStateSerializer }, { type: i0.NgZone }, { type: i0.Injector }]; }, propDecorators: { navigate: [], angularRouterAction: [] } });
336
343
 
@@ -339,38 +346,26 @@ class NgxsRouterPluginModule {
339
346
  return {
340
347
  ngModule: NgxsRouterPluginModule,
341
348
  providers: [
342
- { provide: ɵUSER_OPTIONS, useValue: options },
349
+ { provide: USER_OPTIONS, useValue: options },
343
350
  {
344
- provide: ɵNGXS_ROUTER_PLUGIN_OPTIONS,
345
- useFactory: ɵcreateRouterPluginOptions,
346
- deps: [ɵUSER_OPTIONS]
351
+ provide: NGXS_ROUTER_PLUGIN_OPTIONS,
352
+ useFactory: createRouterPluginOptions,
353
+ deps: [USER_OPTIONS]
347
354
  },
348
355
  { provide: RouterStateSerializer, useClass: DefaultRouterStateSerializer }
349
356
  ]
350
357
  };
351
358
  }
352
359
  }
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: [{
360
+ /** @nocollapse */ NgxsRouterPluginModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NgxsRouterPluginModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
361
+ /** @nocollapse */ NgxsRouterPluginModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NgxsRouterPluginModule, imports: [i1.ɵNgxsFeatureModule] });
362
+ /** @nocollapse */ NgxsRouterPluginModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NgxsRouterPluginModule, imports: [[NgxsModule.forFeature([RouterState])]] });
363
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NgxsRouterPluginModule, decorators: [{
357
364
  type: NgModule,
358
365
  args: [{
359
366
  imports: [NgxsModule.forFeature([RouterState])]
360
367
  }]
361
368
  }] });
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
- }
374
369
 
375
370
  /**
376
371
  * The public api for consumers of @ngxs/router-plugin
@@ -380,5 +375,5 @@ function withNgxsRouterPlugin(options) {
380
375
  * Generated bundle index. Do not edit.
381
376
  */
382
377
 
383
- export { DefaultRouterStateSerializer, Navigate, NgxsRouterPluginModule, RouterCancel, RouterDataResolved, RouterError, RouterNavigated, RouterNavigation, RouterRequest, RouterState, RouterStateSerializer, withNgxsRouterPlugin };
384
- //# sourceMappingURL=ngxs-router-plugin.mjs.map
378
+ export { DefaultRouterStateSerializer, Navigate, NgxsRouterPluginModule, RouterCancel, RouterDataResolved, RouterError, RouterNavigated, RouterNavigation, RouterRequest, RouterState, RouterStateSerializer };
379
+ //# sourceMappingURL=ngxs-router-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngxs-router-plugin.js","sources":["../../../packages/router-plugin/src/router.actions.ts","../../../packages/router-plugin/src/serializer.ts","../../../packages/router-plugin/src/symbols.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 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 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 { InjectionToken } from '@angular/core';\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 'USER_OPTIONS',\n { providedIn: 'root', factory: () => undefined }\n);\n\nexport const NGXS_ROUTER_PLUGIN_OPTIONS = new InjectionToken<NgxsRouterPluginOptions>(\n '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","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 { Subscription } from 'rxjs';\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';\nimport {\n NavigationActionTiming,\n NgxsRouterPluginOptions,\n NGXS_ROUTER_PLUGIN_OPTIONS\n} from './symbols';\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 _subscription = new Subscription();\n\n private _options: NgxsRouterPluginOptions | null = null;\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._subscription.unsubscribe();\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 subscription = this._store\n .select(RouterState)\n .subscribe((state: RouterStateModel | undefined) => {\n this._navigateIfNeeded(state);\n });\n\n this._subscription.add(subscription);\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 subscription = this._router.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 this._subscription.add(subscription);\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 { ModuleWithProviders, NgModule } from '@angular/core';\nimport { NgxsModule } from '@ngxs/store';\n\nimport { RouterState } from './router.state';\nimport { DefaultRouterStateSerializer, RouterStateSerializer } from './serializer';\nimport {\n USER_OPTIONS,\n NGXS_ROUTER_PLUGIN_OPTIONS,\n NgxsRouterPluginOptions,\n createRouterPluginOptions\n} from './symbols';\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","/**\n * The public api for consumers of @ngxs/router-plugin\n */\nexport * from './src/public_api';\n","/**\n * Generated bundle index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B,sBAAsB,EAAA,OAAA,EAAA,CAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,CAAA,CAAA;wIAAtB,sBAAsB,EAAA,OAAA,EAAA,CAFxB,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAA,EAAA,CAAA,CAAA;4FAEpC,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAHlC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;AAChD,iBAAA,CAAA;;;ACdD;;AAEG;;ACFH;;AAEG;;;;"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@ngxs/router-plugin" />
5
+ export * from './index';
package/package.json CHANGED
@@ -1,43 +1,23 @@
1
1
  {
2
+ "$schema": "../../node_modules/ng-packagr/package.schema.json",
2
3
  "name": "@ngxs/router-plugin",
3
4
  "description": "router plugin for @ngxs/store",
4
- "version": "3.8.2-dev.master-0fd1fe5",
5
- "sideEffects": false,
5
+ "version": "3.8.2",
6
+ "sideEffects": true,
6
7
  "peerDependencies": {
8
+ "@ngxs/store": "^3.8.2 || ^3.8.2-dev",
7
9
  "@angular/core": ">=12.0.0 <18.0.0",
8
10
  "@angular/router": ">=12.0.0 <18.0.0",
9
- "@ngxs/store": "^3.8.2 || ^3.8.2-dev",
10
11
  "rxjs": ">=6.5.5"
11
12
  },
12
- "module": "fesm2015/ngxs-router-plugin.mjs",
13
- "es2020": "fesm2020/ngxs-router-plugin.mjs",
14
- "esm2020": "esm2020/ngxs-router-plugin.mjs",
15
- "fesm2020": "fesm2020/ngxs-router-plugin.mjs",
16
- "fesm2015": "fesm2015/ngxs-router-plugin.mjs",
17
- "typings": "index.d.ts",
18
- "exports": {
19
- "./package.json": {
20
- "default": "./package.json"
21
- },
22
- ".": {
23
- "types": "./index.d.ts",
24
- "esm2020": "./esm2020/ngxs-router-plugin.mjs",
25
- "es2020": "./fesm2020/ngxs-router-plugin.mjs",
26
- "es2015": "./fesm2015/ngxs-router-plugin.mjs",
27
- "node": "./fesm2015/ngxs-router-plugin.mjs",
28
- "default": "./fesm2020/ngxs-router-plugin.mjs"
29
- },
30
- "./internals": {
31
- "types": "./internals/index.d.ts",
32
- "esm2020": "./esm2020/internals/ngxs-router-plugin-internals.mjs",
33
- "es2020": "./fesm2020/ngxs-router-plugin-internals.mjs",
34
- "es2015": "./fesm2015/ngxs-router-plugin-internals.mjs",
35
- "node": "./fesm2015/ngxs-router-plugin-internals.mjs",
36
- "default": "./fesm2020/ngxs-router-plugin-internals.mjs"
37
- }
38
- },
13
+ "main": "bundles/ngxs-router-plugin.umd.js",
14
+ "module": "fesm2015/ngxs-router-plugin.js",
15
+ "es2015": "fesm2015/ngxs-router-plugin.js",
16
+ "esm2015": "esm2015/ngxs-router-plugin.js",
17
+ "fesm2015": "fesm2015/ngxs-router-plugin.js",
18
+ "typings": "ngxs-router-plugin.d.ts",
39
19
  "dependencies": {
40
- "tslib": "^2.3.0"
20
+ "tslib": "^2.2.0"
41
21
  },
42
22
  "repository": {
43
23
  "type": "git",
@@ -83,4 +63,4 @@
83
63
  "type": "opencollective",
84
64
  "url": "https://opencollective.com/ngxs"
85
65
  }
86
- }
66
+ }
@@ -1,5 +1,5 @@
1
- export { NgxsRouterPluginModule, withNgxsRouterPlugin } from './router.module';
1
+ export { NgxsRouterPluginModule } from './router.module';
2
2
  export { RouterState, RouterStateModel } from './router.state';
3
3
  export { RouterStateSerializer, DefaultRouterStateSerializer, SerializedRouterStateSnapshot } from './serializer';
4
+ export { NavigationActionTiming, NgxsRouterPluginOptions } from './symbols';
4
5
  export * from './router.actions';
5
- export { NavigationActionTiming, NgxsRouterPluginOptions } from '@ngxs/router-plugin/internals';
@@ -1,5 +1,5 @@
1
- import { EnvironmentProviders, ModuleWithProviders } from '@angular/core';
2
- import { NgxsRouterPluginOptions } from '@ngxs/router-plugin/internals';
1
+ import { ModuleWithProviders } from '@angular/core';
2
+ import { NgxsRouterPluginOptions } from './symbols';
3
3
  import * as i0 from "@angular/core";
4
4
  import * as i1 from "@ngxs/store";
5
5
  export declare class NgxsRouterPluginModule {
@@ -8,4 +8,3 @@ export declare class NgxsRouterPluginModule {
8
8
  static ɵmod: i0.ɵɵNgModuleDeclaration<NgxsRouterPluginModule, never, [typeof i1.ɵNgxsFeatureModule], never>;
9
9
  static ɵinj: i0.ɵɵInjectorDeclaration<NgxsRouterPluginModule>;
10
10
  }
11
- export declare function withNgxsRouterPlugin(options?: NgxsRouterPluginOptions): EnvironmentProviders;
@@ -29,8 +29,8 @@ export declare class RouterState implements OnDestroy {
29
29
  */
30
30
  private _storeState;
31
31
  private _lastEvent;
32
+ private _subscription;
32
33
  private _options;
33
- private _destroy$;
34
34
  static state<T = RouterStateSnapshot>(state: RouterStateModel<T>): T | undefined;
35
35
  static url(state: RouterStateModel): string | undefined;
36
36
  constructor(_store: Store, _router: Router, _serializer: RouterStateSerializer<RouterStateSnapshot>, _ngZone: NgZone, injector: Injector);
@@ -0,0 +1,11 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ export declare const enum NavigationActionTiming {
3
+ PreActivation = 1,
4
+ PostActivation = 2
5
+ }
6
+ export interface NgxsRouterPluginOptions {
7
+ navigationActionTiming?: NavigationActionTiming;
8
+ }
9
+ export declare const USER_OPTIONS: InjectionToken<NgxsRouterPluginOptions | undefined>;
10
+ export declare const NGXS_ROUTER_PLUGIN_OPTIONS: InjectionToken<NgxsRouterPluginOptions>;
11
+ export declare function createRouterPluginOptions(options: NgxsRouterPluginOptions | undefined): NgxsRouterPluginOptions;
@@ -1,2 +0,0 @@
1
- export * from './symbols';
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wYWNrYWdlcy9yb3V0ZXItcGx1Z2luL2ludGVybmFscy9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxXQUFXLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL3N5bWJvbHMnO1xuIl19
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './index';
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4cy1yb3V0ZXItcGx1Z2luLWludGVybmFscy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL3JvdXRlci1wbHVnaW4vaW50ZXJuYWxzL3NyYy9uZ3hzLXJvdXRlci1wbHVnaW4taW50ZXJuYWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vaW5kZXgnO1xuIl19
@@ -1,10 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- const NG_DEV_MODE = typeof ngDevMode === 'undefined' || ngDevMode;
3
- export const ɵUSER_OPTIONS = new InjectionToken(NG_DEV_MODE ? 'USER_OPTIONS' : '', { providedIn: 'root', factory: () => undefined });
4
- export const ɵNGXS_ROUTER_PLUGIN_OPTIONS = new InjectionToken(NG_DEV_MODE ? 'NGXS_ROUTER_PLUGIN_OPTIONS' : '', { providedIn: 'root', factory: () => ({}) });
5
- export function ɵcreateRouterPluginOptions(options) {
6
- return {
7
- navigationActionTiming: (options && options.navigationActionTiming) || 1 /* NavigationActionTiming.PreActivation */
8
- };
9
- }
10
- //# sourceMappingURL=data:application/json;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XRlclBsdWdpbk9wdGlvbnMge1xuICByZXR1cm4ge1xuICAgIG5hdmlnYXRpb25BY3Rpb25UaW1pbmc6XG4gICAgICAob3B0aW9ucyAmJiBvcHRpb25zLm5hdmlnYXRpb25BY3Rpb25UaW1pbmcpIHx8IE5hdmlnYXRpb25BY3Rpb25UaW1pbmcuUHJlQWN0aXZhdGlvblxuICB9O1xufVxuIl19
@@ -1,5 +0,0 @@
1
- export { NgxsRouterPluginModule, withNgxsRouterPlugin } from './router.module';
2
- export { RouterState } from './router.state';
3
- export { RouterStateSerializer, DefaultRouterStateSerializer } from './serializer';
4
- export * from './router.actions';
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL3JvdXRlci1wbHVnaW4vc3JjL3B1YmxpY19hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLHNCQUFzQixFQUFFLG9CQUFvQixFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDL0UsT0FBTyxFQUFFLFdBQVcsRUFBb0IsTUFBTSxnQkFBZ0IsQ0FBQztBQUMvRCxPQUFPLEVBQ0wscUJBQXFCLEVBQ3JCLDRCQUE0QixFQUU3QixNQUFNLGNBQWMsQ0FBQztBQUN0QixjQUFjLGtCQUFrQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHsgTmd4c1JvdXRlclBsdWdpbk1vZHVsZSwgd2l0aE5neHNSb3V0ZXJQbHVnaW4gfSBmcm9tICcuL3JvdXRlci5tb2R1bGUnO1xuZXhwb3J0IHsgUm91dGVyU3RhdGUsIFJvdXRlclN0YXRlTW9kZWwgfSBmcm9tICcuL3JvdXRlci5zdGF0ZSc7XG5leHBvcnQge1xuICBSb3V0ZXJTdGF0ZVNlcmlhbGl6ZXIsXG4gIERlZmF1bHRSb3V0ZXJTdGF0ZVNlcmlhbGl6ZXIsXG4gIFNlcmlhbGl6ZWRSb3V0ZXJTdGF0ZVNuYXBzaG90XG59IGZyb20gJy4vc2VyaWFsaXplcic7XG5leHBvcnQgKiBmcm9tICcuL3JvdXRlci5hY3Rpb25zJztcbmV4cG9ydCB7XG4gIE5hdmlnYXRpb25BY3Rpb25UaW1pbmcsXG4gIE5neHNSb3V0ZXJQbHVnaW5PcHRpb25zXG59IGZyb20gJ0BuZ3hzL3JvdXRlci1wbHVnaW4vaW50ZXJuYWxzJztcbiJdfQ==
@@ -1,45 +0,0 @@
1
- import { NgModule, makeEnvironmentProviders } from '@angular/core';
2
- import { NgxsModule, provideStates } from '@ngxs/store';
3
- import { ɵcreateRouterPluginOptions, ɵNGXS_ROUTER_PLUGIN_OPTIONS, ɵUSER_OPTIONS } from '@ngxs/router-plugin/internals';
4
- import { RouterState } from './router.state';
5
- import { DefaultRouterStateSerializer, RouterStateSerializer } from './serializer';
6
- import * as i0 from "@angular/core";
7
- import * as i1 from "@ngxs/store";
8
- export class NgxsRouterPluginModule {
9
- static forRoot(options) {
10
- return {
11
- ngModule: NgxsRouterPluginModule,
12
- providers: [
13
- { provide: ɵUSER_OPTIONS, useValue: options },
14
- {
15
- provide: ɵNGXS_ROUTER_PLUGIN_OPTIONS,
16
- useFactory: ɵcreateRouterPluginOptions,
17
- deps: [ɵUSER_OPTIONS]
18
- },
19
- { provide: RouterStateSerializer, useClass: DefaultRouterStateSerializer }
20
- ]
21
- };
22
- }
23
- }
24
- /** @nocollapse */ NgxsRouterPluginModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgxsRouterPluginModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
25
- /** @nocollapse */ NgxsRouterPluginModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.4", ngImport: i0, type: NgxsRouterPluginModule, imports: [i1.ɵNgxsFeatureModule] });
26
- /** @nocollapse */ NgxsRouterPluginModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgxsRouterPluginModule, imports: [NgxsModule.forFeature([RouterState])] });
27
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgxsRouterPluginModule, decorators: [{
28
- type: NgModule,
29
- args: [{
30
- imports: [NgxsModule.forFeature([RouterState])]
31
- }]
32
- }] });
33
- export function withNgxsRouterPlugin(options) {
34
- return makeEnvironmentProviders([
35
- provideStates([RouterState]),
36
- { provide: ɵUSER_OPTIONS, useValue: options },
37
- {
38
- provide: ɵNGXS_ROUTER_PLUGIN_OPTIONS,
39
- useFactory: ɵcreateRouterPluginOptions,
40
- deps: [ɵUSER_OPTIONS]
41
- },
42
- { provide: RouterStateSerializer, useClass: DefaultRouterStateSerializer }
43
- ]);
44
- }
45
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm91dGVyLm1vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL3JvdXRlci1wbHVnaW4vc3JjL3JvdXRlci5tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUdMLFFBQVEsRUFDUix3QkFBd0IsRUFDekIsTUFBTSxlQUFlLENBQUM7QUFDdkIsT0FBTyxFQUFFLFVBQVUsRUFBRSxhQUFhLEVBQUUsTUFBTSxhQUFhLENBQUM7QUFDeEQsT0FBTyxFQUVMLDBCQUEwQixFQUMxQiwyQkFBMkIsRUFDM0IsYUFBYSxFQUNkLE1BQU0sK0JBQStCLENBQUM7QUFFdkMsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQzdDLE9BQU8sRUFBRSw0QkFBNEIsRUFBRSxxQkFBc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