@angular/common 21.1.0-next.4 → 21.1.0-rc.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.
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @license Angular v21.1.0-next.4
3
- * (c) 2010-2025 Google LLC. https://angular.dev/
2
+ * @license Angular v21.1.0-rc.0
3
+ * (c) 2010-2026 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
6
6
 
@@ -9,6 +9,7 @@ import * as i0 from '@angular/core';
9
9
  import { inject, DestroyRef, Injectable, ɵregisterLocaleData as _registerLocaleData, Version, ɵɵdefineInjectable as __defineInjectable, DOCUMENT, ɵformatRuntimeError as _formatRuntimeError, InjectionToken, ɵRuntimeError as _RuntimeError, ɵIMAGE_CONFIG as _IMAGE_CONFIG, Renderer2, ElementRef, Injector, ɵperformanceMarkFeature as _performanceMarkFeature, NgZone, ApplicationRef, numberAttribute, booleanAttribute, Directive, Input, ɵIMAGE_CONFIG_DEFAULTS as _IMAGE_CONFIG_DEFAULTS, ɵunwrapSafeValue as _unwrapSafeValue, ChangeDetectorRef } from '@angular/core';
10
10
  export { DOCUMENT, ɵIMAGE_CONFIG as IMAGE_CONFIG } from '@angular/core';
11
11
  import { PlatformNavigation } from './_platform_navigation-chunk.mjs';
12
+ export { PRECOMMIT_HANDLER_SUPPORTED as ɵPRECOMMIT_HANDLER_SUPPORTED } from './_platform_navigation-chunk.mjs';
12
13
  export { XhrFactory, parseCookieValue as ɵparseCookieValue } from './_xhr-chunk.mjs';
13
14
  import { Location, LocationStrategy, normalizeQueryParams } from './_location-chunk.mjs';
14
15
  export { APP_BASE_HREF, PathLocationStrategy } from './_location-chunk.mjs';
@@ -63,7 +64,7 @@ class NavigationAdapterForLocation extends Location {
63
64
  }
64
65
  static ɵfac = i0.ɵɵngDeclareFactory({
65
66
  minVersion: "12.0.0",
66
- version: "21.1.0-next.4",
67
+ version: "21.1.0-rc.0",
67
68
  ngImport: i0,
68
69
  type: NavigationAdapterForLocation,
69
70
  deps: [],
@@ -71,14 +72,14 @@ class NavigationAdapterForLocation extends Location {
71
72
  });
72
73
  static ɵprov = i0.ɵɵngDeclareInjectable({
73
74
  minVersion: "12.0.0",
74
- version: "21.1.0-next.4",
75
+ version: "21.1.0-rc.0",
75
76
  ngImport: i0,
76
77
  type: NavigationAdapterForLocation
77
78
  });
78
79
  }
79
80
  i0.ɵɵngDeclareClassMetadata({
80
81
  minVersion: "12.0.0",
81
- version: "21.1.0-next.4",
82
+ version: "21.1.0-rc.0",
82
83
  ngImport: i0,
83
84
  type: NavigationAdapterForLocation,
84
85
  decorators: [{
@@ -100,7 +101,7 @@ function isPlatformServer(platformId) {
100
101
  return platformId === PLATFORM_SERVER_ID;
101
102
  }
102
103
 
103
- const VERSION = /* @__PURE__ */new Version('21.1.0-next.4');
104
+ const VERSION = /* @__PURE__ */new Version('21.1.0-rc.0');
104
105
 
105
106
  class ViewportScroller {
106
107
  static ɵprov =
@@ -256,6 +257,13 @@ function throwUnexpectedAbsoluteUrlError(path, url) {
256
257
  throw new _RuntimeError(2959, ngDevMode && `Image loader has detected a \`<img>\` tag with an invalid \`ngSrc\` attribute: ${url}. ` + `This image loader expects \`ngSrc\` to be a relative URL - ` + `however the provided value is an absolute URL. ` + `To fix this, provide \`ngSrc\` as a path relative to the base URL ` + `configured for this loader (\`${path}\`).`);
257
258
  }
258
259
 
260
+ function normalizeLoaderTransform(transform, separator) {
261
+ if (typeof transform === 'string') {
262
+ return transform;
263
+ }
264
+ return Object.entries(transform).map(([key, value]) => `${key}${separator}${value}`).join(',');
265
+ }
266
+
259
267
  const provideCloudflareLoader = createImageLoader(createCloudflareUrl, ngDevMode ? ['https://<ZONE>/cdn-cgi/image/<OPTIONS>/<SOURCE-IMAGE>'] : undefined);
260
268
  function createCloudflareUrl(path, config) {
261
269
  let params = `format=auto`;
@@ -265,6 +273,10 @@ function createCloudflareUrl(path, config) {
265
273
  if (config.isPlaceholder) {
266
274
  params += `,quality=${PLACEHOLDER_QUALITY}`;
267
275
  }
276
+ if (config.loaderParams?.['transform']) {
277
+ const transformStr = normalizeLoaderTransform(config.loaderParams['transform'], '=');
278
+ params += `,${transformStr}`;
279
+ }
268
280
  return `${path}/cdn-cgi/image/${params}/${config.src}`;
269
281
  }
270
282
 
@@ -286,6 +298,10 @@ function createCloudinaryUrl(path, config) {
286
298
  if (config.loaderParams?.['rounded']) {
287
299
  params += `,r_max`;
288
300
  }
301
+ if (config.loaderParams?.['transform']) {
302
+ const transformStr = normalizeLoaderTransform(config.loaderParams['transform'], '_');
303
+ params += `,${transformStr}`;
304
+ }
289
305
  return `${path}/image/upload/${params}/${config.src}`;
290
306
  }
291
307
 
@@ -310,6 +326,10 @@ function createImagekitUrl(path, config) {
310
326
  if (config.isPlaceholder) {
311
327
  params.push(`q-${PLACEHOLDER_QUALITY}`);
312
328
  }
329
+ if (config.loaderParams?.['transform']) {
330
+ const transformStr = normalizeLoaderTransform(config.loaderParams['transform'], '-');
331
+ params.push(transformStr);
332
+ }
313
333
  const urlSegments = params.length ? [path, `tr:${params.join(',')}`, src] : [path, src];
314
334
  const url = new URL(urlSegments.join('/'));
315
335
  return url.href;
@@ -325,14 +345,20 @@ function isImgixUrl(url) {
325
345
  }
326
346
  const provideImgixLoader = createImageLoader(createImgixUrl, ngDevMode ? ['https://somepath.imgix.net/'] : undefined);
327
347
  function createImgixUrl(path, config) {
328
- const url = new URL(`${path}/${config.src}`);
329
- url.searchParams.set('auto', 'format');
348
+ const params = [];
349
+ params.push('auto=format');
330
350
  if (config.width) {
331
- url.searchParams.set('w', config.width.toString());
351
+ params.push(`w=${config.width}`);
332
352
  }
333
353
  if (config.isPlaceholder) {
334
- url.searchParams.set('q', PLACEHOLDER_QUALITY);
354
+ params.push(`q=${PLACEHOLDER_QUALITY}`);
355
+ }
356
+ if (config.loaderParams?.['transform']) {
357
+ const transform = normalizeLoaderTransform(config.loaderParams['transform'], '=').split(',');
358
+ params.push(...transform);
335
359
  }
360
+ const url = new URL(`${path}/${config.src}`);
361
+ url.search = params.join('&');
336
362
  return url.href;
337
363
  }
338
364
 
@@ -464,7 +490,7 @@ class LCPImageObserver {
464
490
  }
465
491
  static ɵfac = i0.ɵɵngDeclareFactory({
466
492
  minVersion: "12.0.0",
467
- version: "21.1.0-next.4",
493
+ version: "21.1.0-rc.0",
468
494
  ngImport: i0,
469
495
  type: LCPImageObserver,
470
496
  deps: [],
@@ -472,7 +498,7 @@ class LCPImageObserver {
472
498
  });
473
499
  static ɵprov = i0.ɵɵngDeclareInjectable({
474
500
  minVersion: "12.0.0",
475
- version: "21.1.0-next.4",
501
+ version: "21.1.0-rc.0",
476
502
  ngImport: i0,
477
503
  type: LCPImageObserver,
478
504
  providedIn: 'root'
@@ -480,7 +506,7 @@ class LCPImageObserver {
480
506
  }
481
507
  i0.ɵɵngDeclareClassMetadata({
482
508
  minVersion: "12.0.0",
483
- version: "21.1.0-next.4",
509
+ version: "21.1.0-rc.0",
484
510
  ngImport: i0,
485
511
  type: LCPImageObserver,
486
512
  decorators: [{
@@ -551,7 +577,7 @@ class PreconnectLinkChecker {
551
577
  }
552
578
  static ɵfac = i0.ɵɵngDeclareFactory({
553
579
  minVersion: "12.0.0",
554
- version: "21.1.0-next.4",
580
+ version: "21.1.0-rc.0",
555
581
  ngImport: i0,
556
582
  type: PreconnectLinkChecker,
557
583
  deps: [],
@@ -559,7 +585,7 @@ class PreconnectLinkChecker {
559
585
  });
560
586
  static ɵprov = i0.ɵɵngDeclareInjectable({
561
587
  minVersion: "12.0.0",
562
- version: "21.1.0-next.4",
588
+ version: "21.1.0-rc.0",
563
589
  ngImport: i0,
564
590
  type: PreconnectLinkChecker,
565
591
  providedIn: 'root'
@@ -567,7 +593,7 @@ class PreconnectLinkChecker {
567
593
  }
568
594
  i0.ɵɵngDeclareClassMetadata({
569
595
  minVersion: "12.0.0",
570
- version: "21.1.0-next.4",
596
+ version: "21.1.0-rc.0",
571
597
  ngImport: i0,
572
598
  type: PreconnectLinkChecker,
573
599
  decorators: [{
@@ -617,7 +643,7 @@ class PreloadLinkCreator {
617
643
  }
618
644
  static ɵfac = i0.ɵɵngDeclareFactory({
619
645
  minVersion: "12.0.0",
620
- version: "21.1.0-next.4",
646
+ version: "21.1.0-rc.0",
621
647
  ngImport: i0,
622
648
  type: PreloadLinkCreator,
623
649
  deps: [],
@@ -625,7 +651,7 @@ class PreloadLinkCreator {
625
651
  });
626
652
  static ɵprov = i0.ɵɵngDeclareInjectable({
627
653
  minVersion: "12.0.0",
628
- version: "21.1.0-next.4",
654
+ version: "21.1.0-rc.0",
629
655
  ngImport: i0,
630
656
  type: PreloadLinkCreator,
631
657
  providedIn: 'root'
@@ -633,7 +659,7 @@ class PreloadLinkCreator {
633
659
  }
634
660
  i0.ɵɵngDeclareClassMetadata({
635
661
  minVersion: "12.0.0",
636
- version: "21.1.0-next.4",
662
+ version: "21.1.0-rc.0",
637
663
  ngImport: i0,
638
664
  type: PreloadLinkCreator,
639
665
  decorators: [{
@@ -932,7 +958,7 @@ class NgOptimizedImage {
932
958
  }
933
959
  static ɵfac = i0.ɵɵngDeclareFactory({
934
960
  minVersion: "12.0.0",
935
- version: "21.1.0-next.4",
961
+ version: "21.1.0-rc.0",
936
962
  ngImport: i0,
937
963
  type: NgOptimizedImage,
938
964
  deps: [],
@@ -940,7 +966,7 @@ class NgOptimizedImage {
940
966
  });
941
967
  static ɵdir = i0.ɵɵngDeclareDirective({
942
968
  minVersion: "16.1.0",
943
- version: "21.1.0-next.4",
969
+ version: "21.1.0-rc.0",
944
970
  type: NgOptimizedImage,
945
971
  isStandalone: true,
946
972
  selector: "img[ngSrc]",
@@ -980,7 +1006,7 @@ class NgOptimizedImage {
980
1006
  }
981
1007
  i0.ɵɵngDeclareClassMetadata({
982
1008
  minVersion: "12.0.0",
983
- version: "21.1.0-next.4",
1009
+ version: "21.1.0-rc.0",
984
1010
  ngImport: i0,
985
1011
  type: NgOptimizedImage,
986
1012
  decorators: [{