@angular/common 21.2.0-next.3 → 21.2.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/fesm2022/_common_module-chunk.mjs +94 -87
- package/fesm2022/_common_module-chunk.mjs.map +1 -1
- package/fesm2022/_location-chunk.mjs +16 -16
- package/fesm2022/_module-chunk.mjs +46 -46
- package/fesm2022/_platform_location-chunk.mjs +7 -7
- package/fesm2022/_platform_navigation-chunk.mjs +4 -4
- package/fesm2022/_xhr-chunk.mjs +1 -1
- package/fesm2022/common.mjs +64 -31
- package/fesm2022/common.mjs.map +1 -1
- package/fesm2022/http-testing.mjs +8 -8
- package/fesm2022/http.mjs +1 -1
- package/fesm2022/testing.mjs +13 -13
- package/fesm2022/upgrade.mjs +5 -5
- package/package.json +2 -2
- package/types/_common_module-chunk.d.ts +1 -1
- package/types/_module-chunk.d.ts +1 -1
- package/types/_platform_location-chunk.d.ts +1 -1
- package/types/_xhr-chunk.d.ts +1 -1
- package/types/common.d.ts +3 -3
- package/types/http-testing.d.ts +1 -1
- package/types/http.d.ts +1 -1
- package/types/testing.d.ts +1 -1
- package/types/upgrade.d.ts +1 -1
package/fesm2022/common.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v21.2.0
|
|
2
|
+
* @license Angular v21.2.0
|
|
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.2.0
|
|
67
|
+
version: "21.2.0",
|
|
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.2.0
|
|
75
|
+
version: "21.2.0",
|
|
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.2.0
|
|
82
|
+
version: "21.2.0",
|
|
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.2.0
|
|
104
|
+
const VERSION = /* @__PURE__ */new Version('21.2.0');
|
|
105
105
|
|
|
106
106
|
class ViewportScroller {
|
|
107
107
|
static ɵprov =
|
|
@@ -474,29 +474,62 @@ class LCPImageObserver {
|
|
|
474
474
|
});
|
|
475
475
|
return observer;
|
|
476
476
|
}
|
|
477
|
-
registerImage(rewrittenSrc,
|
|
477
|
+
registerImage(rewrittenSrc, isPriority) {
|
|
478
478
|
if (!this.observer) return;
|
|
479
|
-
const
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
}
|
|
485
|
-
|
|
479
|
+
const url = getUrl(rewrittenSrc, this.window).href;
|
|
480
|
+
const existingState = this.images.get(url);
|
|
481
|
+
if (existingState) {
|
|
482
|
+
existingState.priority = existingState.priority || isPriority;
|
|
483
|
+
existingState.count++;
|
|
484
|
+
} else {
|
|
485
|
+
const newObservedImageState = {
|
|
486
|
+
priority: isPriority,
|
|
487
|
+
modified: false,
|
|
488
|
+
alreadyWarnedModified: false,
|
|
489
|
+
alreadyWarnedPriority: false,
|
|
490
|
+
count: 1
|
|
491
|
+
};
|
|
492
|
+
this.images.set(url, newObservedImageState);
|
|
493
|
+
}
|
|
486
494
|
}
|
|
487
495
|
unregisterImage(rewrittenSrc) {
|
|
488
496
|
if (!this.observer) return;
|
|
489
|
-
|
|
497
|
+
const url = getUrl(rewrittenSrc, this.window).href;
|
|
498
|
+
const existingState = this.images.get(url);
|
|
499
|
+
if (existingState) {
|
|
500
|
+
existingState.count--;
|
|
501
|
+
if (existingState.count <= 0) {
|
|
502
|
+
this.images.delete(url);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
490
505
|
}
|
|
491
506
|
updateImage(originalSrc, newSrc) {
|
|
492
507
|
if (!this.observer) return;
|
|
493
508
|
const originalUrl = getUrl(originalSrc, this.window).href;
|
|
494
|
-
const
|
|
495
|
-
if (
|
|
496
|
-
|
|
497
|
-
|
|
509
|
+
const newUrl = getUrl(newSrc, this.window).href;
|
|
510
|
+
if (originalUrl === newUrl) return;
|
|
511
|
+
const originalState = this.images.get(originalUrl);
|
|
512
|
+
if (!originalState) return;
|
|
513
|
+
originalState.count--;
|
|
514
|
+
if (originalState.count <= 0) {
|
|
498
515
|
this.images.delete(originalUrl);
|
|
499
516
|
}
|
|
517
|
+
const newState = this.images.get(newUrl);
|
|
518
|
+
if (newState) {
|
|
519
|
+
newState.priority = newState.priority || originalState.priority;
|
|
520
|
+
newState.modified = true;
|
|
521
|
+
newState.alreadyWarnedPriority = newState.alreadyWarnedPriority || originalState.alreadyWarnedPriority;
|
|
522
|
+
newState.alreadyWarnedModified = newState.alreadyWarnedModified || originalState.alreadyWarnedModified;
|
|
523
|
+
newState.count++;
|
|
524
|
+
} else {
|
|
525
|
+
this.images.set(newUrl, {
|
|
526
|
+
priority: originalState.priority,
|
|
527
|
+
modified: true,
|
|
528
|
+
alreadyWarnedModified: originalState.alreadyWarnedModified,
|
|
529
|
+
alreadyWarnedPriority: originalState.alreadyWarnedPriority,
|
|
530
|
+
count: 1
|
|
531
|
+
});
|
|
532
|
+
}
|
|
500
533
|
}
|
|
501
534
|
ngOnDestroy() {
|
|
502
535
|
if (!this.observer) return;
|
|
@@ -505,7 +538,7 @@ class LCPImageObserver {
|
|
|
505
538
|
}
|
|
506
539
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
507
540
|
minVersion: "12.0.0",
|
|
508
|
-
version: "21.2.0
|
|
541
|
+
version: "21.2.0",
|
|
509
542
|
ngImport: i0,
|
|
510
543
|
type: LCPImageObserver,
|
|
511
544
|
deps: [],
|
|
@@ -513,7 +546,7 @@ class LCPImageObserver {
|
|
|
513
546
|
});
|
|
514
547
|
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
515
548
|
minVersion: "12.0.0",
|
|
516
|
-
version: "21.2.0
|
|
549
|
+
version: "21.2.0",
|
|
517
550
|
ngImport: i0,
|
|
518
551
|
type: LCPImageObserver,
|
|
519
552
|
providedIn: 'root'
|
|
@@ -521,7 +554,7 @@ class LCPImageObserver {
|
|
|
521
554
|
}
|
|
522
555
|
i0.ɵɵngDeclareClassMetadata({
|
|
523
556
|
minVersion: "12.0.0",
|
|
524
|
-
version: "21.2.0
|
|
557
|
+
version: "21.2.0",
|
|
525
558
|
ngImport: i0,
|
|
526
559
|
type: LCPImageObserver,
|
|
527
560
|
decorators: [{
|
|
@@ -592,7 +625,7 @@ class PreconnectLinkChecker {
|
|
|
592
625
|
}
|
|
593
626
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
594
627
|
minVersion: "12.0.0",
|
|
595
|
-
version: "21.2.0
|
|
628
|
+
version: "21.2.0",
|
|
596
629
|
ngImport: i0,
|
|
597
630
|
type: PreconnectLinkChecker,
|
|
598
631
|
deps: [],
|
|
@@ -600,7 +633,7 @@ class PreconnectLinkChecker {
|
|
|
600
633
|
});
|
|
601
634
|
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
602
635
|
minVersion: "12.0.0",
|
|
603
|
-
version: "21.2.0
|
|
636
|
+
version: "21.2.0",
|
|
604
637
|
ngImport: i0,
|
|
605
638
|
type: PreconnectLinkChecker,
|
|
606
639
|
providedIn: 'root'
|
|
@@ -608,7 +641,7 @@ class PreconnectLinkChecker {
|
|
|
608
641
|
}
|
|
609
642
|
i0.ɵɵngDeclareClassMetadata({
|
|
610
643
|
minVersion: "12.0.0",
|
|
611
|
-
version: "21.2.0
|
|
644
|
+
version: "21.2.0",
|
|
612
645
|
ngImport: i0,
|
|
613
646
|
type: PreconnectLinkChecker,
|
|
614
647
|
decorators: [{
|
|
@@ -658,7 +691,7 @@ class PreloadLinkCreator {
|
|
|
658
691
|
}
|
|
659
692
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
660
693
|
minVersion: "12.0.0",
|
|
661
|
-
version: "21.2.0
|
|
694
|
+
version: "21.2.0",
|
|
662
695
|
ngImport: i0,
|
|
663
696
|
type: PreloadLinkCreator,
|
|
664
697
|
deps: [],
|
|
@@ -666,7 +699,7 @@ class PreloadLinkCreator {
|
|
|
666
699
|
});
|
|
667
700
|
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
668
701
|
minVersion: "12.0.0",
|
|
669
|
-
version: "21.2.0
|
|
702
|
+
version: "21.2.0",
|
|
670
703
|
ngImport: i0,
|
|
671
704
|
type: PreloadLinkCreator,
|
|
672
705
|
providedIn: 'root'
|
|
@@ -674,7 +707,7 @@ class PreloadLinkCreator {
|
|
|
674
707
|
}
|
|
675
708
|
i0.ɵɵngDeclareClassMetadata({
|
|
676
709
|
minVersion: "12.0.0",
|
|
677
|
-
version: "21.2.0
|
|
710
|
+
version: "21.2.0",
|
|
678
711
|
ngImport: i0,
|
|
679
712
|
type: PreloadLinkCreator,
|
|
680
713
|
decorators: [{
|
|
@@ -771,7 +804,7 @@ class NgOptimizedImage {
|
|
|
771
804
|
assertNoNgSrcsetWithoutLoader(this, this.imageLoader);
|
|
772
805
|
assertNoLoaderParamsWithoutLoader(this, this.imageLoader);
|
|
773
806
|
ngZone.runOutsideAngular(() => {
|
|
774
|
-
this.lcpObserver.registerImage(this.getRewrittenSrc(), this.
|
|
807
|
+
this.lcpObserver.registerImage(this.getRewrittenSrc(), this.priority);
|
|
775
808
|
});
|
|
776
809
|
if (this.priority) {
|
|
777
810
|
const checker = this.injector.get(PreconnectLinkChecker);
|
|
@@ -983,7 +1016,7 @@ class NgOptimizedImage {
|
|
|
983
1016
|
}
|
|
984
1017
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
985
1018
|
minVersion: "12.0.0",
|
|
986
|
-
version: "21.2.0
|
|
1019
|
+
version: "21.2.0",
|
|
987
1020
|
ngImport: i0,
|
|
988
1021
|
type: NgOptimizedImage,
|
|
989
1022
|
deps: [],
|
|
@@ -991,7 +1024,7 @@ class NgOptimizedImage {
|
|
|
991
1024
|
});
|
|
992
1025
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
993
1026
|
minVersion: "16.1.0",
|
|
994
|
-
version: "21.2.0
|
|
1027
|
+
version: "21.2.0",
|
|
995
1028
|
type: NgOptimizedImage,
|
|
996
1029
|
isStandalone: true,
|
|
997
1030
|
selector: "img[ngSrc]",
|
|
@@ -1031,7 +1064,7 @@ class NgOptimizedImage {
|
|
|
1031
1064
|
}
|
|
1032
1065
|
i0.ɵɵngDeclareClassMetadata({
|
|
1033
1066
|
minVersion: "12.0.0",
|
|
1034
|
-
version: "21.2.0
|
|
1067
|
+
version: "21.2.0",
|
|
1035
1068
|
ngImport: i0,
|
|
1036
1069
|
type: NgOptimizedImage,
|
|
1037
1070
|
decorators: [{
|