@angular/common 21.1.4 → 21.1.6

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.1.4
2
+ * @license Angular v21.1.6
3
3
  * (c) 2010-2026 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -64,7 +64,7 @@ class NavigationAdapterForLocation extends Location {
64
64
  }
65
65
  static ɵfac = i0.ɵɵngDeclareFactory({
66
66
  minVersion: "12.0.0",
67
- version: "21.1.4",
67
+ version: "21.1.6",
68
68
  ngImport: i0,
69
69
  type: NavigationAdapterForLocation,
70
70
  deps: [],
@@ -72,14 +72,14 @@ class NavigationAdapterForLocation extends Location {
72
72
  });
73
73
  static ɵprov = i0.ɵɵngDeclareInjectable({
74
74
  minVersion: "12.0.0",
75
- version: "21.1.4",
75
+ version: "21.1.6",
76
76
  ngImport: i0,
77
77
  type: NavigationAdapterForLocation
78
78
  });
79
79
  }
80
80
  i0.ɵɵngDeclareClassMetadata({
81
81
  minVersion: "12.0.0",
82
- version: "21.1.4",
82
+ version: "21.1.6",
83
83
  ngImport: i0,
84
84
  type: NavigationAdapterForLocation,
85
85
  decorators: [{
@@ -101,7 +101,7 @@ function isPlatformServer(platformId) {
101
101
  return platformId === PLATFORM_SERVER_ID;
102
102
  }
103
103
 
104
- const VERSION = /* @__PURE__ */new Version('21.1.4');
104
+ const VERSION = /* @__PURE__ */new Version('21.1.6');
105
105
 
106
106
  class ViewportScroller {
107
107
  static ɵprov =
@@ -459,29 +459,62 @@ class LCPImageObserver {
459
459
  });
460
460
  return observer;
461
461
  }
462
- registerImage(rewrittenSrc, originalNgSrc, isPriority) {
462
+ registerImage(rewrittenSrc, isPriority) {
463
463
  if (!this.observer) return;
464
- const newObservedImageState = {
465
- priority: isPriority,
466
- modified: false,
467
- alreadyWarnedModified: false,
468
- alreadyWarnedPriority: false
469
- };
470
- this.images.set(getUrl(rewrittenSrc, this.window).href, newObservedImageState);
464
+ const url = getUrl(rewrittenSrc, this.window).href;
465
+ const existingState = this.images.get(url);
466
+ if (existingState) {
467
+ existingState.priority = existingState.priority || isPriority;
468
+ existingState.count++;
469
+ } else {
470
+ const newObservedImageState = {
471
+ priority: isPriority,
472
+ modified: false,
473
+ alreadyWarnedModified: false,
474
+ alreadyWarnedPriority: false,
475
+ count: 1
476
+ };
477
+ this.images.set(url, newObservedImageState);
478
+ }
471
479
  }
472
480
  unregisterImage(rewrittenSrc) {
473
481
  if (!this.observer) return;
474
- this.images.delete(getUrl(rewrittenSrc, this.window).href);
482
+ const url = getUrl(rewrittenSrc, this.window).href;
483
+ const existingState = this.images.get(url);
484
+ if (existingState) {
485
+ existingState.count--;
486
+ if (existingState.count <= 0) {
487
+ this.images.delete(url);
488
+ }
489
+ }
475
490
  }
476
491
  updateImage(originalSrc, newSrc) {
477
492
  if (!this.observer) return;
478
493
  const originalUrl = getUrl(originalSrc, this.window).href;
479
- const img = this.images.get(originalUrl);
480
- if (img) {
481
- img.modified = true;
482
- this.images.set(getUrl(newSrc, this.window).href, img);
494
+ const newUrl = getUrl(newSrc, this.window).href;
495
+ if (originalUrl === newUrl) return;
496
+ const originalState = this.images.get(originalUrl);
497
+ if (!originalState) return;
498
+ originalState.count--;
499
+ if (originalState.count <= 0) {
483
500
  this.images.delete(originalUrl);
484
501
  }
502
+ const newState = this.images.get(newUrl);
503
+ if (newState) {
504
+ newState.priority = newState.priority || originalState.priority;
505
+ newState.modified = true;
506
+ newState.alreadyWarnedPriority = newState.alreadyWarnedPriority || originalState.alreadyWarnedPriority;
507
+ newState.alreadyWarnedModified = newState.alreadyWarnedModified || originalState.alreadyWarnedModified;
508
+ newState.count++;
509
+ } else {
510
+ this.images.set(newUrl, {
511
+ priority: originalState.priority,
512
+ modified: true,
513
+ alreadyWarnedModified: originalState.alreadyWarnedModified,
514
+ alreadyWarnedPriority: originalState.alreadyWarnedPriority,
515
+ count: 1
516
+ });
517
+ }
485
518
  }
486
519
  ngOnDestroy() {
487
520
  if (!this.observer) return;
@@ -490,7 +523,7 @@ class LCPImageObserver {
490
523
  }
491
524
  static ɵfac = i0.ɵɵngDeclareFactory({
492
525
  minVersion: "12.0.0",
493
- version: "21.1.4",
526
+ version: "21.1.6",
494
527
  ngImport: i0,
495
528
  type: LCPImageObserver,
496
529
  deps: [],
@@ -498,7 +531,7 @@ class LCPImageObserver {
498
531
  });
499
532
  static ɵprov = i0.ɵɵngDeclareInjectable({
500
533
  minVersion: "12.0.0",
501
- version: "21.1.4",
534
+ version: "21.1.6",
502
535
  ngImport: i0,
503
536
  type: LCPImageObserver,
504
537
  providedIn: 'root'
@@ -506,7 +539,7 @@ class LCPImageObserver {
506
539
  }
507
540
  i0.ɵɵngDeclareClassMetadata({
508
541
  minVersion: "12.0.0",
509
- version: "21.1.4",
542
+ version: "21.1.6",
510
543
  ngImport: i0,
511
544
  type: LCPImageObserver,
512
545
  decorators: [{
@@ -577,7 +610,7 @@ class PreconnectLinkChecker {
577
610
  }
578
611
  static ɵfac = i0.ɵɵngDeclareFactory({
579
612
  minVersion: "12.0.0",
580
- version: "21.1.4",
613
+ version: "21.1.6",
581
614
  ngImport: i0,
582
615
  type: PreconnectLinkChecker,
583
616
  deps: [],
@@ -585,7 +618,7 @@ class PreconnectLinkChecker {
585
618
  });
586
619
  static ɵprov = i0.ɵɵngDeclareInjectable({
587
620
  minVersion: "12.0.0",
588
- version: "21.1.4",
621
+ version: "21.1.6",
589
622
  ngImport: i0,
590
623
  type: PreconnectLinkChecker,
591
624
  providedIn: 'root'
@@ -593,7 +626,7 @@ class PreconnectLinkChecker {
593
626
  }
594
627
  i0.ɵɵngDeclareClassMetadata({
595
628
  minVersion: "12.0.0",
596
- version: "21.1.4",
629
+ version: "21.1.6",
597
630
  ngImport: i0,
598
631
  type: PreconnectLinkChecker,
599
632
  decorators: [{
@@ -643,7 +676,7 @@ class PreloadLinkCreator {
643
676
  }
644
677
  static ɵfac = i0.ɵɵngDeclareFactory({
645
678
  minVersion: "12.0.0",
646
- version: "21.1.4",
679
+ version: "21.1.6",
647
680
  ngImport: i0,
648
681
  type: PreloadLinkCreator,
649
682
  deps: [],
@@ -651,7 +684,7 @@ class PreloadLinkCreator {
651
684
  });
652
685
  static ɵprov = i0.ɵɵngDeclareInjectable({
653
686
  minVersion: "12.0.0",
654
- version: "21.1.4",
687
+ version: "21.1.6",
655
688
  ngImport: i0,
656
689
  type: PreloadLinkCreator,
657
690
  providedIn: 'root'
@@ -659,7 +692,7 @@ class PreloadLinkCreator {
659
692
  }
660
693
  i0.ɵɵngDeclareClassMetadata({
661
694
  minVersion: "12.0.0",
662
- version: "21.1.4",
695
+ version: "21.1.6",
663
696
  ngImport: i0,
664
697
  type: PreloadLinkCreator,
665
698
  decorators: [{
@@ -756,7 +789,7 @@ class NgOptimizedImage {
756
789
  assertNoNgSrcsetWithoutLoader(this, this.imageLoader);
757
790
  assertNoLoaderParamsWithoutLoader(this, this.imageLoader);
758
791
  ngZone.runOutsideAngular(() => {
759
- this.lcpObserver.registerImage(this.getRewrittenSrc(), this.ngSrc, this.priority);
792
+ this.lcpObserver.registerImage(this.getRewrittenSrc(), this.priority);
760
793
  });
761
794
  if (this.priority) {
762
795
  const checker = this.injector.get(PreconnectLinkChecker);
@@ -958,7 +991,7 @@ class NgOptimizedImage {
958
991
  }
959
992
  static ɵfac = i0.ɵɵngDeclareFactory({
960
993
  minVersion: "12.0.0",
961
- version: "21.1.4",
994
+ version: "21.1.6",
962
995
  ngImport: i0,
963
996
  type: NgOptimizedImage,
964
997
  deps: [],
@@ -966,7 +999,7 @@ class NgOptimizedImage {
966
999
  });
967
1000
  static ɵdir = i0.ɵɵngDeclareDirective({
968
1001
  minVersion: "16.1.0",
969
- version: "21.1.4",
1002
+ version: "21.1.6",
970
1003
  type: NgOptimizedImage,
971
1004
  isStandalone: true,
972
1005
  selector: "img[ngSrc]",
@@ -1006,7 +1039,7 @@ class NgOptimizedImage {
1006
1039
  }
1007
1040
  i0.ɵɵngDeclareClassMetadata({
1008
1041
  minVersion: "12.0.0",
1009
- version: "21.1.4",
1042
+ version: "21.1.6",
1010
1043
  ngImport: i0,
1011
1044
  type: NgOptimizedImage,
1012
1045
  decorators: [{