@angular/router 12.2.0-rc.0 → 12.2.3

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.
@@ -14,5 +14,5 @@ import { Version } from '@angular/core';
14
14
  /**
15
15
  * @publicApi
16
16
  */
17
- export const VERSION = new Version('12.2.0-rc.0');
17
+ export const VERSION = new Version('12.2.3');
18
18
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3JvdXRlci9zcmMvdmVyc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7QUFFSDs7OztHQUlHO0FBRUgsT0FBTyxFQUFDLE9BQU8sRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUV0Qzs7R0FFRztBQUNILE1BQU0sQ0FBQyxNQUFNLE9BQU8sR0FBRyxJQUFJLE9BQU8sQ0FBQyxtQkFBbUIsQ0FBQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBAbGljZW5zZVxuICogQ29weXJpZ2h0IEdvb2dsZSBMTEMgQWxsIFJpZ2h0cyBSZXNlcnZlZC5cbiAqXG4gKiBVc2Ugb2YgdGhpcyBzb3VyY2UgY29kZSBpcyBnb3Zlcm5lZCBieSBhbiBNSVQtc3R5bGUgbGljZW5zZSB0aGF0IGNhbiBiZVxuICogZm91bmQgaW4gdGhlIExJQ0VOU0UgZmlsZSBhdCBodHRwczovL2FuZ3VsYXIuaW8vbGljZW5zZVxuICovXG5cbi8qKlxuICogQG1vZHVsZVxuICogQGRlc2NyaXB0aW9uXG4gKiBFbnRyeSBwb2ludCBmb3IgYWxsIHB1YmxpYyBBUElzIG9mIHRoZSByb3V0ZXIgcGFja2FnZS5cbiAqL1xuXG5pbXBvcnQge1ZlcnNpb259IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuXG4vKipcbiAqIEBwdWJsaWNBcGlcbiAqL1xuZXhwb3J0IGNvbnN0IFZFUlNJT04gPSBuZXcgVmVyc2lvbignMC4wLjAtUExBQ0VIT0xERVInKTtcbiJdfQ==
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v12.2.0-rc.0
2
+ * @license Angular v12.2.3
3
3
  * (c) 2010-2021 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -4052,6 +4052,11 @@ class Router {
4052
4052
  t.extractedUrl.toString() !== this.browserUrlTree.toString();
4053
4053
  const processCurrentUrl = (this.onSameUrlNavigation === 'reload' ? true : urlTransition) &&
4054
4054
  this.urlHandlingStrategy.shouldProcessUrl(t.rawUrl);
4055
+ // If the source of the navigation is from a browser event, the URL is
4056
+ // already updated. We already need to sync the internal state.
4057
+ if (isBrowserTriggeredNavigation(t.source)) {
4058
+ this.browserUrlTree = t.rawUrl;
4059
+ }
4055
4060
  if (processCurrentUrl) {
4056
4061
  return of(t).pipe(
4057
4062
  // Fire NavigationStart event
@@ -4283,7 +4288,12 @@ class Router {
4283
4288
  const mergedTree = this.urlHandlingStrategy.merge(e.url, this.rawUrlTree);
4284
4289
  const extras = {
4285
4290
  skipLocationChange: t.extras.skipLocationChange,
4286
- replaceUrl: this.urlUpdateStrategy === 'eager'
4291
+ // The URL is already updated at this point if we have 'eager' URL
4292
+ // updates or if the navigation was triggered by the browser (back
4293
+ // button, URL bar, etc). We want to replace that item in history if
4294
+ // the navigation is rejected.
4295
+ replaceUrl: this.urlUpdateStrategy === 'eager' ||
4296
+ isBrowserTriggeredNavigation(t.source)
4287
4297
  };
4288
4298
  this.scheduleNavigation(mergedTree, 'imperative', null, extras, { resolve: t.resolve, reject: t.reject, promise: t.promise });
4289
4299
  }, 0);
@@ -4660,7 +4670,8 @@ class Router {
4660
4670
  const lastNavigation = this.getTransition();
4661
4671
  // We don't want to skip duplicate successful navs if they're imperative because
4662
4672
  // onSameUrlNavigation could be 'reload' (so the duplicate is intended).
4663
- const browserNavPrecededByRouterNav = source !== 'imperative' && (lastNavigation === null || lastNavigation === void 0 ? void 0 : lastNavigation.source) === 'imperative';
4673
+ const browserNavPrecededByRouterNav = isBrowserTriggeredNavigation(source) && lastNavigation &&
4674
+ !isBrowserTriggeredNavigation(lastNavigation.source);
4664
4675
  const lastNavigationSucceeded = this.lastSuccessfulId === lastNavigation.id;
4665
4676
  // If the last navigation succeeded or is in flight, we can use the rawUrl as the comparison.
4666
4677
  // However, if it failed, we should compare to the final result (urlAfterRedirects).
@@ -4829,6 +4840,9 @@ function validateCommands(commands) {
4829
4840
  }
4830
4841
  }
4831
4842
  }
4843
+ function isBrowserTriggeredNavigation(source) {
4844
+ return source !== 'imperative';
4845
+ }
4832
4846
 
4833
4847
  /**
4834
4848
  * @license
@@ -5261,7 +5275,7 @@ class RouterLinkActive {
5261
5275
  });
5262
5276
  }
5263
5277
  isLinkActive(router) {
5264
- const options = 'paths' in this.routerLinkActiveOptions ?
5278
+ const options = isActiveMatchOptions(this.routerLinkActiveOptions) ?
5265
5279
  this.routerLinkActiveOptions :
5266
5280
  // While the types should disallow `undefined` here, it's possible without strict inputs
5267
5281
  (this.routerLinkActiveOptions.exact || false);
@@ -5294,6 +5308,12 @@ RouterLinkActive.propDecorators = {
5294
5308
  routerLinkActiveOptions: [{ type: Input }],
5295
5309
  routerLinkActive: [{ type: Input }]
5296
5310
  };
5311
+ /**
5312
+ * Use instead of `'paths' in options` to be compatible with property renaming
5313
+ */
5314
+ function isActiveMatchOptions(options) {
5315
+ return !!options.paths;
5316
+ }
5297
5317
 
5298
5318
  /**
5299
5319
  * @license
@@ -6054,7 +6074,7 @@ function provideRouterInitializer() {
6054
6074
  /**
6055
6075
  * @publicApi
6056
6076
  */
6057
- const VERSION = new Version('12.2.0-rc.0');
6077
+ const VERSION = new Version('12.2.3');
6058
6078
 
6059
6079
  /**
6060
6080
  * @license