@angular/common 21.2.0-next.1 → 21.2.0-next.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.2.0-next.1
2
+ * @license Angular v21.2.0-next.3
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-next.1",
67
+ version: "21.2.0-next.3",
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-next.1",
75
+ version: "21.2.0-next.3",
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-next.1",
82
+ version: "21.2.0-next.3",
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-next.1');
104
+ const VERSION = /* @__PURE__ */new Version('21.2.0-next.3');
105
105
 
106
106
  class ViewportScroller {
107
107
  static ɵprov =
@@ -270,6 +270,9 @@ function createCloudflareUrl(path, config) {
270
270
  if (config.width) {
271
271
  params += `,width=${config.width}`;
272
272
  }
273
+ if (config.height) {
274
+ params += `,height=${config.height}`;
275
+ }
273
276
  if (config.isPlaceholder) {
274
277
  params += `,quality=${PLACEHOLDER_QUALITY}`;
275
278
  }
@@ -295,6 +298,9 @@ function createCloudinaryUrl(path, config) {
295
298
  if (config.width) {
296
299
  params += `,w_${config.width}`;
297
300
  }
301
+ if (config.height) {
302
+ params += `,h_${config.height}`;
303
+ }
298
304
  if (config.loaderParams?.['rounded']) {
299
305
  params += `,r_max`;
300
306
  }
@@ -323,6 +329,9 @@ function createImagekitUrl(path, config) {
323
329
  if (width) {
324
330
  params.push(`w-${width}`);
325
331
  }
332
+ if (config.height) {
333
+ params.push(`h-${config.height}`);
334
+ }
326
335
  if (config.isPlaceholder) {
327
336
  params.push(`q-${PLACEHOLDER_QUALITY}`);
328
337
  }
@@ -350,6 +359,9 @@ function createImgixUrl(path, config) {
350
359
  if (config.width) {
351
360
  params.push(`w=${config.width}`);
352
361
  }
362
+ if (config.height) {
363
+ params.push(`h=${config.height}`);
364
+ }
353
365
  if (config.isPlaceholder) {
354
366
  params.push(`q=${PLACEHOLDER_QUALITY}`);
355
367
  }
@@ -398,6 +410,9 @@ function createNetlifyUrl(config, path) {
398
410
  if (config.width) {
399
411
  url.searchParams.set('w', config.width.toString());
400
412
  }
413
+ if (config.height) {
414
+ url.searchParams.set('h', config.height.toString());
415
+ }
401
416
  const configQuality = config.loaderParams?.['quality'] ?? config.loaderParams?.['q'];
402
417
  if (config.isPlaceholder && !configQuality) {
403
418
  url.searchParams.set('q', PLACEHOLDER_QUALITY);
@@ -490,7 +505,7 @@ class LCPImageObserver {
490
505
  }
491
506
  static ɵfac = i0.ɵɵngDeclareFactory({
492
507
  minVersion: "12.0.0",
493
- version: "21.2.0-next.1",
508
+ version: "21.2.0-next.3",
494
509
  ngImport: i0,
495
510
  type: LCPImageObserver,
496
511
  deps: [],
@@ -498,7 +513,7 @@ class LCPImageObserver {
498
513
  });
499
514
  static ɵprov = i0.ɵɵngDeclareInjectable({
500
515
  minVersion: "12.0.0",
501
- version: "21.2.0-next.1",
516
+ version: "21.2.0-next.3",
502
517
  ngImport: i0,
503
518
  type: LCPImageObserver,
504
519
  providedIn: 'root'
@@ -506,7 +521,7 @@ class LCPImageObserver {
506
521
  }
507
522
  i0.ɵɵngDeclareClassMetadata({
508
523
  minVersion: "12.0.0",
509
- version: "21.2.0-next.1",
524
+ version: "21.2.0-next.3",
510
525
  ngImport: i0,
511
526
  type: LCPImageObserver,
512
527
  decorators: [{
@@ -577,7 +592,7 @@ class PreconnectLinkChecker {
577
592
  }
578
593
  static ɵfac = i0.ɵɵngDeclareFactory({
579
594
  minVersion: "12.0.0",
580
- version: "21.2.0-next.1",
595
+ version: "21.2.0-next.3",
581
596
  ngImport: i0,
582
597
  type: PreconnectLinkChecker,
583
598
  deps: [],
@@ -585,7 +600,7 @@ class PreconnectLinkChecker {
585
600
  });
586
601
  static ɵprov = i0.ɵɵngDeclareInjectable({
587
602
  minVersion: "12.0.0",
588
- version: "21.2.0-next.1",
603
+ version: "21.2.0-next.3",
589
604
  ngImport: i0,
590
605
  type: PreconnectLinkChecker,
591
606
  providedIn: 'root'
@@ -593,7 +608,7 @@ class PreconnectLinkChecker {
593
608
  }
594
609
  i0.ɵɵngDeclareClassMetadata({
595
610
  minVersion: "12.0.0",
596
- version: "21.2.0-next.1",
611
+ version: "21.2.0-next.3",
597
612
  ngImport: i0,
598
613
  type: PreconnectLinkChecker,
599
614
  decorators: [{
@@ -643,7 +658,7 @@ class PreloadLinkCreator {
643
658
  }
644
659
  static ɵfac = i0.ɵɵngDeclareFactory({
645
660
  minVersion: "12.0.0",
646
- version: "21.2.0-next.1",
661
+ version: "21.2.0-next.3",
647
662
  ngImport: i0,
648
663
  type: PreloadLinkCreator,
649
664
  deps: [],
@@ -651,7 +666,7 @@ class PreloadLinkCreator {
651
666
  });
652
667
  static ɵprov = i0.ɵɵngDeclareInjectable({
653
668
  minVersion: "12.0.0",
654
- version: "21.2.0-next.1",
669
+ version: "21.2.0-next.3",
655
670
  ngImport: i0,
656
671
  type: PreloadLinkCreator,
657
672
  providedIn: 'root'
@@ -659,7 +674,7 @@ class PreloadLinkCreator {
659
674
  }
660
675
  i0.ɵɵngDeclareClassMetadata({
661
676
  minVersion: "12.0.0",
662
- version: "21.2.0-next.1",
677
+ version: "21.2.0-next.3",
663
678
  ngImport: i0,
664
679
  type: PreloadLinkCreator,
665
680
  decorators: [{
@@ -821,11 +836,21 @@ class NgOptimizedImage {
821
836
  assertPlaceholderDimensions(this, this.imgElement);
822
837
  }
823
838
  }
839
+ getAspectRatio() {
840
+ if (this.width && this.height && this.height !== 0) {
841
+ return this.width / this.height;
842
+ }
843
+ return null;
844
+ }
824
845
  callImageLoader(configWithoutCustomParams) {
825
846
  let augmentedConfig = configWithoutCustomParams;
826
847
  if (this.loaderParams) {
827
848
  augmentedConfig.loaderParams = this.loaderParams;
828
849
  }
850
+ const ratio = this.getAspectRatio();
851
+ if (ratio !== null && augmentedConfig.width) {
852
+ augmentedConfig.height = Math.round(augmentedConfig.width / ratio);
853
+ }
829
854
  return this.imageLoader(augmentedConfig);
830
855
  }
831
856
  getLoadingBehavior() {
@@ -958,7 +983,7 @@ class NgOptimizedImage {
958
983
  }
959
984
  static ɵfac = i0.ɵɵngDeclareFactory({
960
985
  minVersion: "12.0.0",
961
- version: "21.2.0-next.1",
986
+ version: "21.2.0-next.3",
962
987
  ngImport: i0,
963
988
  type: NgOptimizedImage,
964
989
  deps: [],
@@ -966,7 +991,7 @@ class NgOptimizedImage {
966
991
  });
967
992
  static ɵdir = i0.ɵɵngDeclareDirective({
968
993
  minVersion: "16.1.0",
969
- version: "21.2.0-next.1",
994
+ version: "21.2.0-next.3",
970
995
  type: NgOptimizedImage,
971
996
  isStandalone: true,
972
997
  selector: "img[ngSrc]",
@@ -1006,7 +1031,7 @@ class NgOptimizedImage {
1006
1031
  }
1007
1032
  i0.ɵɵngDeclareClassMetadata({
1008
1033
  minVersion: "12.0.0",
1009
- version: "21.2.0-next.1",
1034
+ version: "21.2.0-next.3",
1010
1035
  ngImport: i0,
1011
1036
  type: NgOptimizedImage,
1012
1037
  decorators: [{