@angular/common 14.2.0-next.1 → 15.0.0-next.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/esm2020/http/src/client.mjs +3 -3
- package/esm2020/http/src/interceptor.mjs +3 -3
- package/esm2020/http/src/jsonp.mjs +7 -7
- package/esm2020/http/src/module.mjs +15 -15
- package/esm2020/http/src/xhr.mjs +3 -3
- package/esm2020/http/src/xsrf.mjs +7 -7
- package/esm2020/http/testing/src/backend.mjs +3 -3
- package/esm2020/http/testing/src/module.mjs +4 -4
- package/esm2020/src/common.mjs +2 -1
- package/esm2020/src/common_module.mjs +4 -4
- package/esm2020/src/directives/ng_class.mjs +3 -3
- package/esm2020/src/directives/ng_component_outlet.mjs +3 -3
- package/esm2020/src/directives/ng_for_of.mjs +3 -3
- package/esm2020/src/directives/ng_if.mjs +3 -3
- package/esm2020/src/directives/ng_optimized_image/asserts.mjs +20 -0
- package/esm2020/src/directives/ng_optimized_image/error_helper.mjs +13 -0
- package/esm2020/src/directives/ng_optimized_image/image_loaders/cloudflare_loader.mjs +35 -0
- package/esm2020/src/directives/ng_optimized_image/image_loaders/cloudinary_loader.mjs +43 -0
- package/esm2020/src/directives/ng_optimized_image/image_loaders/image_loader.mjs +79 -0
- package/esm2020/src/directives/ng_optimized_image/image_loaders/imagekit_loader.mjs +35 -0
- package/esm2020/src/directives/ng_optimized_image/image_loaders/imgix_loader.mjs +33 -0
- package/esm2020/src/directives/ng_optimized_image/index.mjs +16 -0
- package/esm2020/src/directives/ng_optimized_image/lcp_image_observer.mjs +99 -0
- package/esm2020/src/directives/ng_optimized_image/ng_optimized_image.mjs +559 -0
- package/esm2020/src/directives/ng_optimized_image/preconnect_link_checker.mjs +137 -0
- package/esm2020/src/directives/ng_optimized_image/url.mjs +42 -0
- package/esm2020/src/directives/ng_plural.mjs +7 -7
- package/esm2020/src/directives/ng_style.mjs +3 -3
- package/esm2020/src/directives/ng_switch.mjs +10 -10
- package/esm2020/src/directives/ng_template_outlet.mjs +3 -3
- package/esm2020/src/errors.mjs +1 -1
- package/esm2020/src/i18n/localization.mjs +6 -6
- package/esm2020/src/location/hash_location_strategy.mjs +3 -3
- package/esm2020/src/location/location.mjs +4 -4
- package/esm2020/src/location/location_strategy.mjs +6 -6
- package/esm2020/src/location/platform_location.mjs +6 -6
- package/esm2020/src/pipes/async_pipe.mjs +3 -3
- package/esm2020/src/pipes/case_conversion_pipes.mjs +9 -9
- package/esm2020/src/pipes/date_pipe.mjs +3 -3
- package/esm2020/src/pipes/i18n_plural_pipe.mjs +3 -3
- package/esm2020/src/pipes/i18n_select_pipe.mjs +3 -3
- package/esm2020/src/pipes/json_pipe.mjs +3 -3
- package/esm2020/src/pipes/keyvalue_pipe.mjs +3 -3
- package/esm2020/src/pipes/number_pipe.mjs +9 -9
- package/esm2020/src/pipes/slice_pipe.mjs +3 -3
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/testing/src/location_mock.mjs +3 -3
- package/esm2020/testing/src/mock_location_strategy.mjs +3 -3
- package/esm2020/testing/src/mock_platform_location.mjs +3 -3
- package/esm2020/upgrade/src/location_upgrade_module.mjs +4 -4
- package/fesm2015/common.mjs +1183 -104
- package/fesm2015/common.mjs.map +1 -1
- package/fesm2015/http/testing.mjs +8 -8
- package/fesm2015/http.mjs +37 -37
- package/fesm2015/http.mjs.map +1 -1
- package/fesm2015/testing.mjs +10 -10
- package/fesm2015/upgrade.mjs +5 -5
- package/fesm2020/common.mjs +1181 -104
- package/fesm2020/common.mjs.map +1 -1
- package/fesm2020/http/testing.mjs +8 -8
- package/fesm2020/http.mjs +37 -37
- package/fesm2020/http.mjs.map +1 -1
- package/fesm2020/testing.mjs +10 -10
- package/fesm2020/upgrade.mjs +5 -5
- package/http/index.d.ts +1 -1
- package/http/testing/index.d.ts +1 -1
- package/index.d.ts +319 -12
- package/package.json +2 -2
- package/testing/index.d.ts +1 -1
- package/upgrade/index.d.ts +1 -1
package/fesm2020/testing.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular
|
|
2
|
+
* @license Angular v15.0.0-next.0
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -210,9 +210,9 @@ class SpyLocation {
|
|
|
210
210
|
this._historyIndex = this._history.length - 1;
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
|
-
SpyLocation.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
214
|
-
SpyLocation.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
215
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
213
|
+
SpyLocation.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: SpyLocation, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
214
|
+
SpyLocation.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: SpyLocation });
|
|
215
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: SpyLocation, decorators: [{
|
|
216
216
|
type: Injectable
|
|
217
217
|
}] });
|
|
218
218
|
class LocationState {
|
|
@@ -299,9 +299,9 @@ class MockLocationStrategy extends LocationStrategy {
|
|
|
299
299
|
return this.stateChanges[(this.stateChanges.length || 1) - 1];
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
|
-
MockLocationStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
303
|
-
MockLocationStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
304
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
302
|
+
MockLocationStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: MockLocationStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
303
|
+
MockLocationStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: MockLocationStrategy });
|
|
304
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: MockLocationStrategy, decorators: [{
|
|
305
305
|
type: Injectable
|
|
306
306
|
}], ctorParameters: function () { return []; } });
|
|
307
307
|
class _MockPopStateEvent {
|
|
@@ -487,9 +487,9 @@ class MockPlatformLocation {
|
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
489
|
}
|
|
490
|
-
MockPlatformLocation.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
491
|
-
MockPlatformLocation.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
492
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
490
|
+
MockPlatformLocation.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: MockPlatformLocation, deps: [{ token: MOCK_PLATFORM_LOCATION_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
491
|
+
MockPlatformLocation.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: MockPlatformLocation });
|
|
492
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: MockPlatformLocation, decorators: [{
|
|
493
493
|
type: Injectable
|
|
494
494
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
495
495
|
type: Inject,
|
package/fesm2020/upgrade.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular
|
|
2
|
+
* @license Angular v15.0.0-next.0
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -881,10 +881,10 @@ class LocationUpgradeModule {
|
|
|
881
881
|
};
|
|
882
882
|
}
|
|
883
883
|
}
|
|
884
|
-
LocationUpgradeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
885
|
-
LocationUpgradeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
886
|
-
LocationUpgradeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
887
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
884
|
+
LocationUpgradeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: LocationUpgradeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
885
|
+
LocationUpgradeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.0-next.0", ngImport: i0, type: LocationUpgradeModule, imports: [CommonModule] });
|
|
886
|
+
LocationUpgradeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: LocationUpgradeModule, imports: [CommonModule] });
|
|
887
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: LocationUpgradeModule, decorators: [{
|
|
888
888
|
type: NgModule,
|
|
889
889
|
args: [{ imports: [CommonModule] }]
|
|
890
890
|
}] });
|
package/http/index.d.ts
CHANGED
package/http/testing/index.d.ts
CHANGED
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular
|
|
2
|
+
* @license Angular v15.0.0-next.0
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -18,7 +18,9 @@ import { NgModuleFactory } from '@angular/core';
|
|
|
18
18
|
import { Observable } from 'rxjs';
|
|
19
19
|
import { OnChanges } from '@angular/core';
|
|
20
20
|
import { OnDestroy } from '@angular/core';
|
|
21
|
+
import { OnInit } from '@angular/core';
|
|
21
22
|
import { PipeTransform } from '@angular/core';
|
|
23
|
+
import { Provider } from '@angular/core';
|
|
22
24
|
import { Renderer2 } from '@angular/core';
|
|
23
25
|
import { SimpleChanges } from '@angular/core';
|
|
24
26
|
import { Subscribable } from 'rxjs';
|
|
@@ -1092,6 +1094,44 @@ declare namespace i9 {
|
|
|
1092
1094
|
}
|
|
1093
1095
|
}
|
|
1094
1096
|
|
|
1097
|
+
/**
|
|
1098
|
+
* Injection token that configures the image loader function.
|
|
1099
|
+
*
|
|
1100
|
+
* @see `ImageLoader`
|
|
1101
|
+
* @see `NgOptimizedImage`
|
|
1102
|
+
* @publicApi
|
|
1103
|
+
* @developerPreview
|
|
1104
|
+
*/
|
|
1105
|
+
export declare const IMAGE_LOADER: InjectionToken<ImageLoader>;
|
|
1106
|
+
|
|
1107
|
+
/**
|
|
1108
|
+
* Represents an image loader function. Image loader functions are used by the
|
|
1109
|
+
* NgOptimizedImage directive to produce full image URL based on the image name and its width.
|
|
1110
|
+
*
|
|
1111
|
+
* @publicApi
|
|
1112
|
+
* @developerPreview
|
|
1113
|
+
*/
|
|
1114
|
+
export declare type ImageLoader = (config: ImageLoaderConfig) => string;
|
|
1115
|
+
|
|
1116
|
+
/**
|
|
1117
|
+
* Config options recognized by the image loader function.
|
|
1118
|
+
*
|
|
1119
|
+
* @see `ImageLoader`
|
|
1120
|
+
* @see `NgOptimizedImage`
|
|
1121
|
+
* @publicApi
|
|
1122
|
+
* @developerPreview
|
|
1123
|
+
*/
|
|
1124
|
+
export declare interface ImageLoaderConfig {
|
|
1125
|
+
/**
|
|
1126
|
+
* Image file name to be added to the image request URL.
|
|
1127
|
+
*/
|
|
1128
|
+
src: string;
|
|
1129
|
+
/**
|
|
1130
|
+
* Width of the requested image (to be used when generating srcset).
|
|
1131
|
+
*/
|
|
1132
|
+
width?: number;
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1095
1135
|
/**
|
|
1096
1136
|
* Returns whether a platform id represents a browser platform.
|
|
1097
1137
|
* @publicApi
|
|
@@ -1502,7 +1542,7 @@ export declare class NgClass implements DoCheck {
|
|
|
1502
1542
|
private _removeClasses;
|
|
1503
1543
|
private _toggleClass;
|
|
1504
1544
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgClass, never>;
|
|
1505
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgClass, "[ngClass]", never, { "klass": "class"; "ngClass": "ngClass"; }, {}, never, never, true>;
|
|
1545
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgClass, "[ngClass]", never, { "klass": "class"; "ngClass": "ngClass"; }, {}, never, never, true, never>;
|
|
1506
1546
|
}
|
|
1507
1547
|
|
|
1508
1548
|
/**
|
|
@@ -1582,7 +1622,7 @@ export declare class NgComponentOutlet implements OnChanges, OnDestroy {
|
|
|
1582
1622
|
/** @nodoc */
|
|
1583
1623
|
ngOnDestroy(): void;
|
|
1584
1624
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgComponentOutlet, never>;
|
|
1585
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgComponentOutlet, "[ngComponentOutlet]", never, { "ngComponentOutlet": "ngComponentOutlet"; "ngComponentOutletInjector": "ngComponentOutletInjector"; "ngComponentOutletContent": "ngComponentOutletContent"; "ngComponentOutletNgModule": "ngComponentOutletNgModule"; "ngComponentOutletNgModuleFactory": "ngComponentOutletNgModuleFactory"; }, {}, never, never, true>;
|
|
1625
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgComponentOutlet, "[ngComponentOutlet]", never, { "ngComponentOutlet": "ngComponentOutlet"; "ngComponentOutletInjector": "ngComponentOutletInjector"; "ngComponentOutletContent": "ngComponentOutletContent"; "ngComponentOutletNgModule": "ngComponentOutletNgModule"; "ngComponentOutletNgModuleFactory": "ngComponentOutletNgModuleFactory"; }, {}, never, never, true, never>;
|
|
1586
1626
|
}
|
|
1587
1627
|
|
|
1588
1628
|
/**
|
|
@@ -1736,7 +1776,7 @@ export declare class NgForOf<T, U extends NgIterable<T> = NgIterable<T>> impleme
|
|
|
1736
1776
|
*/
|
|
1737
1777
|
static ngTemplateContextGuard<T, U extends NgIterable<T>>(dir: NgForOf<T, U>, ctx: any): ctx is NgForOfContext<T, U>;
|
|
1738
1778
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgForOf<any, any>, never>;
|
|
1739
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgForOf<any, any>, "[ngFor][ngForOf]", never, { "ngForOf": "ngForOf"; "ngForTrackBy": "ngForTrackBy"; "ngForTemplate": "ngForTemplate"; }, {}, never, never, true>;
|
|
1779
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgForOf<any, any>, "[ngFor][ngForOf]", never, { "ngForOf": "ngForOf"; "ngForTrackBy": "ngForTrackBy"; "ngForTemplate": "ngForTemplate"; }, {}, never, never, true, never>;
|
|
1740
1780
|
}
|
|
1741
1781
|
|
|
1742
1782
|
/**
|
|
@@ -1931,7 +1971,7 @@ export declare class NgIf<T = unknown> {
|
|
|
1931
1971
|
*/
|
|
1932
1972
|
static ngTemplateContextGuard<T>(dir: NgIf<T>, ctx: any): ctx is NgIfContext<Exclude<T, false | 0 | '' | null | undefined>>;
|
|
1933
1973
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgIf<any>, never>;
|
|
1934
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgIf<any>, "[ngIf]", never, { "ngIf": "ngIf"; "ngIfThen": "ngIfThen"; "ngIfElse": "ngIfElse"; }, {}, never, never, true>;
|
|
1974
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgIf<any>, "[ngIf]", never, { "ngIf": "ngIf"; "ngIfThen": "ngIfThen"; "ngIfElse": "ngIfElse"; }, {}, never, never, true, never>;
|
|
1935
1975
|
}
|
|
1936
1976
|
|
|
1937
1977
|
/**
|
|
@@ -1964,6 +2004,173 @@ export declare abstract class NgLocalization {
|
|
|
1964
2004
|
static ɵprov: i0.ɵɵInjectableDeclaration<NgLocalization>;
|
|
1965
2005
|
}
|
|
1966
2006
|
|
|
2007
|
+
/**
|
|
2008
|
+
* Directive that improves image loading performance by enforcing best practices.
|
|
2009
|
+
*
|
|
2010
|
+
* `NgOptimizedImage` ensures that the loading of the Largest Contentful Paint (LCP) image is
|
|
2011
|
+
* prioritized by:
|
|
2012
|
+
* - Automatically setting the `fetchpriority` attribute on the `<img>` tag
|
|
2013
|
+
* - Lazy loading non-priority images by default
|
|
2014
|
+
* - Asserting that there is a corresponding preconnect link tag in the document head
|
|
2015
|
+
*
|
|
2016
|
+
* In addition, the directive:
|
|
2017
|
+
* - Generates appropriate asset URLs if a corresponding `ImageLoader` function is provided
|
|
2018
|
+
* - Requires that `width` and `height` are set
|
|
2019
|
+
* - Warns if `width` or `height` have been set incorrectly
|
|
2020
|
+
* - Warns if the image will be visually distorted when rendered
|
|
2021
|
+
*
|
|
2022
|
+
* @usageNotes
|
|
2023
|
+
* The `NgOptimizedImage` directive is marked as [standalone](guide/standalone-components) and can
|
|
2024
|
+
* be imported directly.
|
|
2025
|
+
*
|
|
2026
|
+
* Follow the steps below to enable and use the directive:
|
|
2027
|
+
* 1. Import it into the necessary NgModule or a standalone Component.
|
|
2028
|
+
* 2. Optionally provide an `ImageLoader` if you use an image hosting service.
|
|
2029
|
+
* 3. Update the necessary `<img>` tags in templates and replace `src` attributes with `rawSrc`.
|
|
2030
|
+
* Using a `rawSrc` allows the directive to control when the `src` gets set, which triggers an image
|
|
2031
|
+
* download.
|
|
2032
|
+
*
|
|
2033
|
+
* Step 1: import the `NgOptimizedImage` directive.
|
|
2034
|
+
*
|
|
2035
|
+
* ```typescript
|
|
2036
|
+
* import { NgOptimizedImage } from '@angular/common';
|
|
2037
|
+
*
|
|
2038
|
+
* // Include it into the necessary NgModule
|
|
2039
|
+
* @NgModule({
|
|
2040
|
+
* imports: [NgOptimizedImage],
|
|
2041
|
+
* })
|
|
2042
|
+
* class AppModule {}
|
|
2043
|
+
*
|
|
2044
|
+
* // ... or a standalone Component
|
|
2045
|
+
* @Component({
|
|
2046
|
+
* standalone: true
|
|
2047
|
+
* imports: [NgOptimizedImage],
|
|
2048
|
+
* })
|
|
2049
|
+
* class MyStandaloneComponent {}
|
|
2050
|
+
* ```
|
|
2051
|
+
*
|
|
2052
|
+
* Step 2: configure a loader.
|
|
2053
|
+
*
|
|
2054
|
+
* To use the **default loader**: no additional code changes are necessary. The URL returned by the
|
|
2055
|
+
* generic loader will always match the value of "src". In other words, this loader applies no
|
|
2056
|
+
* transformations to the resource URL and the value of the `rawSrc` attribute will be used as is.
|
|
2057
|
+
*
|
|
2058
|
+
* To use an existing loader for a **third-party image service**: add the provider factory for your
|
|
2059
|
+
* chosen service to the `providers` array. In the example below, the Imgix loader is used:
|
|
2060
|
+
*
|
|
2061
|
+
* ```typescript
|
|
2062
|
+
* import {provideImgixLoader} from '@angular/common';
|
|
2063
|
+
*
|
|
2064
|
+
* // Call the function and add the result to the `providers` array:
|
|
2065
|
+
* providers: [
|
|
2066
|
+
* provideImgixLoader("https://my.base.url/"),
|
|
2067
|
+
* ],
|
|
2068
|
+
* ```
|
|
2069
|
+
*
|
|
2070
|
+
* The `NgOptimizedImage` directive provides the following functions:
|
|
2071
|
+
* - `provideCloudflareLoader`
|
|
2072
|
+
* - `provideCloudinaryLoader`
|
|
2073
|
+
* - `provideImageKitLoader`
|
|
2074
|
+
* - `provideImgixLoader`
|
|
2075
|
+
*
|
|
2076
|
+
* If you use a different image provider, you can create a custom loader function as described
|
|
2077
|
+
* below.
|
|
2078
|
+
*
|
|
2079
|
+
* To use a **custom loader**: provide your loader function as a value for the `IMAGE_LOADER` DI
|
|
2080
|
+
* token.
|
|
2081
|
+
*
|
|
2082
|
+
* ```typescript
|
|
2083
|
+
* import {IMAGE_LOADER, ImageLoaderConfig} from '@angular/common';
|
|
2084
|
+
*
|
|
2085
|
+
* // Configure the loader using the `IMAGE_LOADER` token.
|
|
2086
|
+
* providers: [
|
|
2087
|
+
* {
|
|
2088
|
+
* provide: IMAGE_LOADER,
|
|
2089
|
+
* useValue: (config: ImageLoaderConfig) => {
|
|
2090
|
+
* return `https://example.com/${config.src}-${config.width}.jpg}`;
|
|
2091
|
+
* }
|
|
2092
|
+
* },
|
|
2093
|
+
* ],
|
|
2094
|
+
* ```
|
|
2095
|
+
*
|
|
2096
|
+
* Step 3: update `<img>` tags in templates to use `rawSrc` instead of `src`.
|
|
2097
|
+
*
|
|
2098
|
+
* ```
|
|
2099
|
+
* <img rawSrc="logo.png" width="200" height="100">
|
|
2100
|
+
* ```
|
|
2101
|
+
*
|
|
2102
|
+
* @publicApi
|
|
2103
|
+
* @developerPreview
|
|
2104
|
+
*/
|
|
2105
|
+
export declare class NgOptimizedImage implements OnInit, OnChanges, OnDestroy {
|
|
2106
|
+
private imageLoader;
|
|
2107
|
+
private renderer;
|
|
2108
|
+
private imgElement;
|
|
2109
|
+
private injector;
|
|
2110
|
+
private lcpObserver;
|
|
2111
|
+
/**
|
|
2112
|
+
* Calculate the rewritten `src` once and store it.
|
|
2113
|
+
* This is needed to avoid repetitive calculations and make sure the directive cleanup in the
|
|
2114
|
+
* `ngOnDestroy` does not rely on the `IMAGE_LOADER` logic (which in turn can rely on some other
|
|
2115
|
+
* instance that might be already destroyed).
|
|
2116
|
+
*/
|
|
2117
|
+
private _renderedSrc;
|
|
2118
|
+
/**
|
|
2119
|
+
* Name of the source image.
|
|
2120
|
+
* Image name will be processed by the image loader and the final URL will be applied as the `src`
|
|
2121
|
+
* property of the image.
|
|
2122
|
+
*/
|
|
2123
|
+
rawSrc: string;
|
|
2124
|
+
/**
|
|
2125
|
+
* A comma separated list of width or density descriptors.
|
|
2126
|
+
* The image name will be taken from `rawSrc` and combined with the list of width or density
|
|
2127
|
+
* descriptors to generate the final `srcset` property of the image.
|
|
2128
|
+
*
|
|
2129
|
+
* Example:
|
|
2130
|
+
* ```
|
|
2131
|
+
* <img rawSrc="hello.jpg" rawSrcset="100w, 200w" /> =>
|
|
2132
|
+
* <img src="path/hello.jpg" srcset="path/hello.jpg?w=100 100w, path/hello.jpg?w=200 200w" />
|
|
2133
|
+
* ```
|
|
2134
|
+
*/
|
|
2135
|
+
rawSrcset: string;
|
|
2136
|
+
/**
|
|
2137
|
+
* The intrinsic width of the image in pixels.
|
|
2138
|
+
*/
|
|
2139
|
+
set width(value: string | number | undefined);
|
|
2140
|
+
get width(): number | undefined;
|
|
2141
|
+
private _width?;
|
|
2142
|
+
/**
|
|
2143
|
+
* The intrinsic height of the image in pixels.
|
|
2144
|
+
*/
|
|
2145
|
+
set height(value: string | number | undefined);
|
|
2146
|
+
get height(): number | undefined;
|
|
2147
|
+
private _height?;
|
|
2148
|
+
/**
|
|
2149
|
+
* The desired loading behavior (lazy, eager, or auto).
|
|
2150
|
+
*
|
|
2151
|
+
* Setting images as loading='eager' or loading='auto' marks them
|
|
2152
|
+
* as non-priority images. Avoid changing this input for priority images.
|
|
2153
|
+
*/
|
|
2154
|
+
loading?: 'lazy' | 'eager' | 'auto';
|
|
2155
|
+
/**
|
|
2156
|
+
* Indicates whether this image should have a high priority.
|
|
2157
|
+
*/
|
|
2158
|
+
set priority(value: string | boolean | undefined);
|
|
2159
|
+
get priority(): boolean;
|
|
2160
|
+
private _priority;
|
|
2161
|
+
ngOnInit(): void;
|
|
2162
|
+
private setHostAttributes;
|
|
2163
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
2164
|
+
private getLoadingBehavior;
|
|
2165
|
+
private getFetchPriority;
|
|
2166
|
+
private getRewrittenSrc;
|
|
2167
|
+
private getRewrittenSrcset;
|
|
2168
|
+
ngOnDestroy(): void;
|
|
2169
|
+
private setHostAttribute;
|
|
2170
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgOptimizedImage, never>;
|
|
2171
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgOptimizedImage, "img[rawSrc]", never, { "rawSrc": "rawSrc"; "rawSrcset": "rawSrcset"; "width": "width"; "height": "height"; "loading": "loading"; "priority": "priority"; "src": "src"; "srcset": "srcset"; }, {}, never, never, true, never>;
|
|
2172
|
+
}
|
|
2173
|
+
|
|
1967
2174
|
/**
|
|
1968
2175
|
* @ngModule CommonModule
|
|
1969
2176
|
*
|
|
@@ -2007,7 +2214,7 @@ export declare class NgPlural {
|
|
|
2007
2214
|
private _clearViews;
|
|
2008
2215
|
private _activateView;
|
|
2009
2216
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgPlural, never>;
|
|
2010
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgPlural, "[ngPlural]", never, { "ngPlural": "ngPlural"; }, {}, never, never, true>;
|
|
2217
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgPlural, "[ngPlural]", never, { "ngPlural": "ngPlural"; }, {}, never, never, true, never>;
|
|
2011
2218
|
}
|
|
2012
2219
|
|
|
2013
2220
|
/**
|
|
@@ -2034,7 +2241,7 @@ export declare class NgPluralCase {
|
|
|
2034
2241
|
value: string;
|
|
2035
2242
|
constructor(value: string, template: TemplateRef<Object>, viewContainer: ViewContainerRef, ngPlural: NgPlural);
|
|
2036
2243
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgPluralCase, [{ attribute: "ngPluralCase"; }, null, null, { host: true; }]>;
|
|
2037
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgPluralCase, "[ngPluralCase]", never, {}, {}, never, never, true>;
|
|
2244
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgPluralCase, "[ngPluralCase]", never, {}, {}, never, never, true, never>;
|
|
2038
2245
|
}
|
|
2039
2246
|
|
|
2040
2247
|
/**
|
|
@@ -2087,7 +2294,7 @@ export declare class NgStyle implements DoCheck {
|
|
|
2087
2294
|
private _setStyle;
|
|
2088
2295
|
private _applyChanges;
|
|
2089
2296
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgStyle, never>;
|
|
2090
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgStyle, "[ngStyle]", never, { "ngStyle": "ngStyle"; }, {}, never, never, true>;
|
|
2297
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgStyle, "[ngStyle]", never, { "ngStyle": "ngStyle"; }, {}, never, never, true, never>;
|
|
2091
2298
|
}
|
|
2092
2299
|
|
|
2093
2300
|
/**
|
|
@@ -2166,7 +2373,7 @@ export declare class NgSwitch {
|
|
|
2166
2373
|
set ngSwitch(newValue: any);
|
|
2167
2374
|
private _updateDefaultCases;
|
|
2168
2375
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgSwitch, never>;
|
|
2169
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgSwitch, "[ngSwitch]", never, { "ngSwitch": "ngSwitch"; }, {}, never, never, true>;
|
|
2376
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgSwitch, "[ngSwitch]", never, { "ngSwitch": "ngSwitch"; }, {}, never, never, true, never>;
|
|
2170
2377
|
}
|
|
2171
2378
|
|
|
2172
2379
|
/**
|
|
@@ -2216,7 +2423,7 @@ export declare class NgSwitchCase implements DoCheck {
|
|
|
2216
2423
|
*/
|
|
2217
2424
|
ngDoCheck(): void;
|
|
2218
2425
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgSwitchCase, [null, null, { optional: true; host: true; }]>;
|
|
2219
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgSwitchCase, "[ngSwitchCase]", never, { "ngSwitchCase": "ngSwitchCase"; }, {}, never, never, true>;
|
|
2426
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgSwitchCase, "[ngSwitchCase]", never, { "ngSwitchCase": "ngSwitchCase"; }, {}, never, never, true, never>;
|
|
2220
2427
|
}
|
|
2221
2428
|
|
|
2222
2429
|
/**
|
|
@@ -2236,7 +2443,7 @@ export declare class NgSwitchCase implements DoCheck {
|
|
|
2236
2443
|
export declare class NgSwitchDefault {
|
|
2237
2444
|
constructor(viewContainer: ViewContainerRef, templateRef: TemplateRef<Object>, ngSwitch: NgSwitch);
|
|
2238
2445
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgSwitchDefault, [null, null, { optional: true; host: true; }]>;
|
|
2239
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgSwitchDefault, "[ngSwitchDefault]", never, {}, {}, never, never, true>;
|
|
2446
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgSwitchDefault, "[ngSwitchDefault]", never, {}, {}, never, never, true, never>;
|
|
2240
2447
|
}
|
|
2241
2448
|
|
|
2242
2449
|
/**
|
|
@@ -2283,7 +2490,7 @@ export declare class NgTemplateOutlet implements OnChanges {
|
|
|
2283
2490
|
/** @nodoc */
|
|
2284
2491
|
ngOnChanges(changes: SimpleChanges): void;
|
|
2285
2492
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgTemplateOutlet, never>;
|
|
2286
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgTemplateOutlet, "[ngTemplateOutlet]", never, { "ngTemplateOutletContext": "ngTemplateOutletContext"; "ngTemplateOutlet": "ngTemplateOutlet"; "ngTemplateOutletInjector": "ngTemplateOutletInjector"; }, {}, never, never, true>;
|
|
2493
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgTemplateOutlet, "[ngTemplateOutlet]", never, { "ngTemplateOutletContext": "ngTemplateOutletContext"; "ngTemplateOutlet": "ngTemplateOutlet"; "ngTemplateOutletInjector": "ngTemplateOutletInjector"; }, {}, never, never, true, never>;
|
|
2287
2494
|
}
|
|
2288
2495
|
|
|
2289
2496
|
|
|
@@ -2543,6 +2750,106 @@ declare interface PopStateEvent_2 {
|
|
|
2543
2750
|
}
|
|
2544
2751
|
export { PopStateEvent_2 as PopStateEvent }
|
|
2545
2752
|
|
|
2753
|
+
/**
|
|
2754
|
+
* Multi-provider injection token to configure which origins should be excluded
|
|
2755
|
+
* from the preconnect checks. It can either be a single string or an array of strings
|
|
2756
|
+
* to represent a group of origins, for example:
|
|
2757
|
+
*
|
|
2758
|
+
* ```typescript
|
|
2759
|
+
* {provide: PRECONNECT_CHECK_BLOCKLIST, multi: true, useValue: 'https://your-domain.com'}
|
|
2760
|
+
* ```
|
|
2761
|
+
*
|
|
2762
|
+
* or:
|
|
2763
|
+
*
|
|
2764
|
+
* ```typescript
|
|
2765
|
+
* {provide: PRECONNECT_CHECK_BLOCKLIST, multi: true,
|
|
2766
|
+
* useValue: ['https://your-domain-1.com', 'https://your-domain-2.com']}
|
|
2767
|
+
* ```
|
|
2768
|
+
*
|
|
2769
|
+
* @publicApi
|
|
2770
|
+
* @developerPreview
|
|
2771
|
+
*/
|
|
2772
|
+
export declare const PRECONNECT_CHECK_BLOCKLIST: InjectionToken<(string | string[])[]>;
|
|
2773
|
+
|
|
2774
|
+
/**
|
|
2775
|
+
* Function that generates an ImageLoader for [Cloudflare Image
|
|
2776
|
+
* Resizing](https://developers.cloudflare.com/images/image-resizing/) and turns it into an Angular
|
|
2777
|
+
* provider. Note: Cloudflare has multiple image products - this provider is specifically for
|
|
2778
|
+
* Cloudflare Image Resizing; it will not work with Cloudflare Images or Cloudflare Polish.
|
|
2779
|
+
*
|
|
2780
|
+
* @param path Your domain name, e.g. https://mysite.com
|
|
2781
|
+
* @param options An object with extra configuration:
|
|
2782
|
+
* - `ensurePreconnect`: boolean flag indicating whether the NgOptimizedImage directive
|
|
2783
|
+
* should verify that there is a corresponding `<link rel="preconnect">`
|
|
2784
|
+
* present in the document's `<head>`.
|
|
2785
|
+
* @returns Provider that provides an ImageLoader function
|
|
2786
|
+
*
|
|
2787
|
+
* @publicApi
|
|
2788
|
+
* @developerPreview
|
|
2789
|
+
*/
|
|
2790
|
+
export declare const provideCloudflareLoader: (path: string, options?: {
|
|
2791
|
+
ensurePreconnect?: boolean | undefined;
|
|
2792
|
+
}) => Provider[];
|
|
2793
|
+
|
|
2794
|
+
/**
|
|
2795
|
+
* Function that generates an ImageLoader for Cloudinary and turns it into an Angular provider.
|
|
2796
|
+
*
|
|
2797
|
+
* @param path Base URL of your Cloudinary images
|
|
2798
|
+
* This URL should match one of the following formats:
|
|
2799
|
+
* https://res.cloudinary.com/mysite
|
|
2800
|
+
* https://mysite.cloudinary.com
|
|
2801
|
+
* https://subdomain.mysite.com
|
|
2802
|
+
* @param options An object with extra configuration:
|
|
2803
|
+
* - `ensurePreconnect`: boolean flag indicating whether the NgOptimizedImage directive
|
|
2804
|
+
* should verify that there is a corresponding `<link rel="preconnect">`
|
|
2805
|
+
* present in the document's `<head>`.
|
|
2806
|
+
* @returns Set of providers to configure the Cloudinary loader.
|
|
2807
|
+
*
|
|
2808
|
+
* @publicApi
|
|
2809
|
+
* @developerPreview
|
|
2810
|
+
*/
|
|
2811
|
+
export declare const provideCloudinaryLoader: (path: string, options?: {
|
|
2812
|
+
ensurePreconnect?: boolean | undefined;
|
|
2813
|
+
}) => Provider[];
|
|
2814
|
+
|
|
2815
|
+
/**
|
|
2816
|
+
* Function that generates an ImageLoader for ImageKit and turns it into an Angular provider.
|
|
2817
|
+
*
|
|
2818
|
+
* @param path Base URL of your ImageKit images
|
|
2819
|
+
* This URL should match one of the following formats:
|
|
2820
|
+
* https://ik.imagekit.io/myaccount
|
|
2821
|
+
* https://subdomain.mysite.com
|
|
2822
|
+
* @param options An object with extra configuration:
|
|
2823
|
+
* - `ensurePreconnect`: boolean flag indicating whether the NgOptimizedImage directive
|
|
2824
|
+
* should verify that there is a corresponding `<link rel="preconnect">`
|
|
2825
|
+
* present in the document's `<head>`.
|
|
2826
|
+
* @returns Set of providers to configure the ImageKit loader.
|
|
2827
|
+
*
|
|
2828
|
+
* @publicApi
|
|
2829
|
+
* @developerPreview
|
|
2830
|
+
*/
|
|
2831
|
+
export declare const provideImageKitLoader: (path: string, options?: {
|
|
2832
|
+
ensurePreconnect?: boolean | undefined;
|
|
2833
|
+
}) => Provider[];
|
|
2834
|
+
|
|
2835
|
+
/**
|
|
2836
|
+
* Function that generates an ImageLoader for Imgix and turns it into an Angular provider.
|
|
2837
|
+
*
|
|
2838
|
+
* @param path path to the desired Imgix origin,
|
|
2839
|
+
* e.g. https://somepath.imgix.net or https://images.mysite.com
|
|
2840
|
+
* @param options An object with extra configuration:
|
|
2841
|
+
* - `ensurePreconnect`: boolean flag indicating whether the NgOptimizedImage directive
|
|
2842
|
+
* should verify that there is a corresponding `<link rel="preconnect">`
|
|
2843
|
+
* present in the document's `<head>`.
|
|
2844
|
+
* @returns Set of providers to configure the Imgix loader.
|
|
2845
|
+
*
|
|
2846
|
+
* @publicApi
|
|
2847
|
+
* @developerPreview
|
|
2848
|
+
*/
|
|
2849
|
+
export declare const provideImgixLoader: (path: string, options?: {
|
|
2850
|
+
ensurePreconnect?: boolean | undefined;
|
|
2851
|
+
}) => Provider[];
|
|
2852
|
+
|
|
2546
2853
|
|
|
2547
2854
|
/**
|
|
2548
2855
|
* Register global data to be used internally by Angular. See the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/common",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.0-next.0",
|
|
4
4
|
"description": "Angular - commonly needed directives and services",
|
|
5
5
|
"author": "angular",
|
|
6
6
|
"license": "MIT",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
|
-
"@angular/core": "
|
|
66
|
+
"@angular/core": "15.0.0-next.0",
|
|
67
67
|
"rxjs": "^6.5.3 || ^7.4.0"
|
|
68
68
|
},
|
|
69
69
|
"repository": {
|
package/testing/index.d.ts
CHANGED
package/upgrade/index.d.ts
CHANGED