@angular/platform-browser 21.0.0-next.0 → 21.0.0-next.10
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/_browser-chunk.mjs +424 -0
- package/fesm2022/_browser-chunk.mjs.map +1 -0
- package/fesm2022/_dom_renderer-chunk.mjs +796 -0
- package/fesm2022/_dom_renderer-chunk.mjs.map +1 -0
- package/fesm2022/animations-async.mjs +237 -0
- package/fesm2022/animations-async.mjs.map +1 -0
- package/fesm2022/animations.mjs +159 -173
- package/fesm2022/animations.mjs.map +1 -1
- package/fesm2022/platform-browser.mjs +619 -915
- package/fesm2022/platform-browser.mjs.map +1 -1
- package/fesm2022/testing.mjs +107 -75
- package/fesm2022/testing.mjs.map +1 -1
- package/package.json +10 -10
- package/{browser.d.d.ts → types/_browser-chunk.d.ts} +16 -11
- package/{animations/async/index.d.ts → types/animations-async.d.ts} +2 -2
- package/{animations/index.d.ts → types/animations.d.ts} +3 -3
- package/{index.d.ts → types/platform-browser.d.ts} +36 -30
- package/{testing/index.d.ts → types/testing.d.ts} +3 -3
- package/fesm2022/animations/async.mjs +0 -302
- package/fesm2022/animations/async.mjs.map +0 -1
- package/fesm2022/browser.mjs +0 -560
- package/fesm2022/browser.mjs.map +0 -1
- package/fesm2022/dom_renderer.mjs +0 -837
- package/fesm2022/dom_renderer.mjs.map +0 -1
|
@@ -1,995 +1,699 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v21.0.0-next.
|
|
3
|
-
* (c) 2010-2025 Google LLC. https://angular.
|
|
2
|
+
* @license Angular v21.0.0-next.10
|
|
3
|
+
* (c) 2010-2025 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
export { BrowserModule, bootstrapApplication, createApplication, platformBrowser, provideProtractorTestingSupport, BrowserDomAdapter as ɵBrowserDomAdapter, BrowserGetTestability as ɵBrowserGetTestability,
|
|
7
|
+
export { BrowserModule, bootstrapApplication, createApplication, platformBrowser, provideProtractorTestingSupport, BrowserDomAdapter as ɵBrowserDomAdapter, BrowserGetTestability as ɵBrowserGetTestability, KeyEventsPlugin as ɵKeyEventsPlugin } from './_browser-chunk.mjs';
|
|
8
8
|
import { ɵgetDOM as _getDOM, DOCUMENT } from '@angular/common';
|
|
9
9
|
export { ɵgetDOM } from '@angular/common';
|
|
10
10
|
import * as i0 from '@angular/core';
|
|
11
|
-
import { Injectable, Inject, ɵglobal as _global, ApplicationRef, InjectionToken, ɵConsole as _Console, Optional, Injector, NgModule, forwardRef, ɵRuntimeError as _RuntimeError, ɵXSS_SECURITY_URL as _XSS_SECURITY_URL, SecurityContext, ɵallowSanitizationBypassAndThrow as _allowSanitizationBypassAndThrow, ɵunwrapSafeValue as _unwrapSafeValue, ɵ_sanitizeUrl as __sanitizeUrl, ɵ_sanitizeHtml as __sanitizeHtml, ɵbypassSanitizationTrustHtml as _bypassSanitizationTrustHtml, ɵbypassSanitizationTrustStyle as _bypassSanitizationTrustStyle, ɵbypassSanitizationTrustScript as _bypassSanitizationTrustScript, ɵbypassSanitizationTrustUrl as _bypassSanitizationTrustUrl, ɵbypassSanitizationTrustResourceUrl as _bypassSanitizationTrustResourceUrl, ɵwithI18nSupport as _withI18nSupport, ɵwithEventReplay as _withEventReplay, ɵwithIncrementalHydration as _withIncrementalHydration, makeEnvironmentProviders, ɵwithDomHydration as _withDomHydration, ENVIRONMENT_INITIALIZER, inject,
|
|
12
|
-
import { EventManagerPlugin, EVENT_MANAGER_PLUGINS } from './
|
|
13
|
-
export { EventManager, REMOVE_STYLES_ON_COMPONENT_DESTROY, DomRendererFactory2 as ɵDomRendererFactory2, SharedStylesHost as ɵSharedStylesHost } from './
|
|
11
|
+
import { Injectable, Inject, ɵglobal as _global, ApplicationRef, InjectionToken, ɵConsole as _Console, Optional, Injector, NgModule, forwardRef, ɵRuntimeError as _RuntimeError, ɵXSS_SECURITY_URL as _XSS_SECURITY_URL, SecurityContext, ɵallowSanitizationBypassAndThrow as _allowSanitizationBypassAndThrow, ɵunwrapSafeValue as _unwrapSafeValue, ɵ_sanitizeUrl as __sanitizeUrl, ɵ_sanitizeHtml as __sanitizeHtml, ɵbypassSanitizationTrustHtml as _bypassSanitizationTrustHtml, ɵbypassSanitizationTrustStyle as _bypassSanitizationTrustStyle, ɵbypassSanitizationTrustScript as _bypassSanitizationTrustScript, ɵbypassSanitizationTrustUrl as _bypassSanitizationTrustUrl, ɵbypassSanitizationTrustResourceUrl as _bypassSanitizationTrustResourceUrl, ɵwithI18nSupport as _withI18nSupport, ɵwithEventReplay as _withEventReplay, ɵwithIncrementalHydration as _withIncrementalHydration, makeEnvironmentProviders, ɵwithDomHydration as _withDomHydration, ENVIRONMENT_INITIALIZER, inject, ɵIS_ENABLED_BLOCKING_INITIAL_NAVIGATION as _IS_ENABLED_BLOCKING_INITIAL_NAVIGATION, ɵformatRuntimeError as _formatRuntimeError, Version } from '@angular/core';
|
|
12
|
+
import { EventManagerPlugin, EVENT_MANAGER_PLUGINS } from './_dom_renderer-chunk.mjs';
|
|
13
|
+
export { EventManager, REMOVE_STYLES_ON_COMPONENT_DESTROY, DomEventsPlugin as ɵDomEventsPlugin, DomRendererFactory2 as ɵDomRendererFactory2, SharedStylesHost as ɵSharedStylesHost } from './_dom_renderer-chunk.mjs';
|
|
14
14
|
import { ɵwithHttpTransferCache as _withHttpTransferCache } from '@angular/common/http';
|
|
15
15
|
|
|
16
|
-
/**
|
|
17
|
-
* A service for managing HTML `<meta>` tags.
|
|
18
|
-
*
|
|
19
|
-
* Properties of the `MetaDefinition` object match the attributes of the
|
|
20
|
-
* HTML `<meta>` tag. These tags define document metadata that is important for
|
|
21
|
-
* things like configuring a Content Security Policy, defining browser compatibility
|
|
22
|
-
* and security settings, setting HTTP Headers, defining rich content for social sharing,
|
|
23
|
-
* and Search Engine Optimization (SEO).
|
|
24
|
-
*
|
|
25
|
-
* To identify specific `<meta>` tags in a document, use an attribute selection
|
|
26
|
-
* string in the format `"tag_attribute='value string'"`.
|
|
27
|
-
* For example, an `attrSelector` value of `"name='description'"` matches a tag
|
|
28
|
-
* whose `name` attribute has the value `"description"`.
|
|
29
|
-
* Selectors are used with the `querySelector()` Document method,
|
|
30
|
-
* in the format `meta[{attrSelector}]`.
|
|
31
|
-
*
|
|
32
|
-
* @see [HTML meta tag](https://developer.mozilla.org/docs/Web/HTML/Element/meta)
|
|
33
|
-
* @see [Document.querySelector()](https://developer.mozilla.org/docs/Web/API/Document/querySelector)
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* @publicApi
|
|
37
|
-
*/
|
|
38
16
|
class Meta {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Removes an existing `<meta>` tag element from the current HTML document.
|
|
130
|
-
* @param meta The tag definition to match against to identify an existing tag.
|
|
131
|
-
*/
|
|
132
|
-
removeTagElement(meta) {
|
|
133
|
-
if (meta) {
|
|
134
|
-
this._dom.remove(meta);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
_getOrCreateElement(meta, forceCreation = false) {
|
|
138
|
-
if (!forceCreation) {
|
|
139
|
-
const selector = this._parseSelector(meta);
|
|
140
|
-
// It's allowed to have multiple elements with the same name so it's not enough to
|
|
141
|
-
// just check that element with the same name already present on the page. We also need to
|
|
142
|
-
// check if element has tag attributes
|
|
143
|
-
const elem = this.getTags(selector).filter((elem) => this._containsAttributes(meta, elem))[0];
|
|
144
|
-
if (elem !== undefined)
|
|
145
|
-
return elem;
|
|
146
|
-
}
|
|
147
|
-
const element = this._dom.createElement('meta');
|
|
148
|
-
this._setMetaElementAttributes(meta, element);
|
|
149
|
-
const head = this._doc.getElementsByTagName('head')[0];
|
|
150
|
-
head.appendChild(element);
|
|
151
|
-
return element;
|
|
152
|
-
}
|
|
153
|
-
_setMetaElementAttributes(tag, el) {
|
|
154
|
-
Object.keys(tag).forEach((prop) => el.setAttribute(this._getMetaKeyMap(prop), tag[prop]));
|
|
155
|
-
return el;
|
|
156
|
-
}
|
|
157
|
-
_parseSelector(tag) {
|
|
158
|
-
const attr = tag.name ? 'name' : 'property';
|
|
159
|
-
return `${attr}="${tag[attr]}"`;
|
|
160
|
-
}
|
|
161
|
-
_containsAttributes(tag, elem) {
|
|
162
|
-
return Object.keys(tag).every((key) => elem.getAttribute(this._getMetaKeyMap(key)) === tag[key]);
|
|
163
|
-
}
|
|
164
|
-
_getMetaKeyMap(prop) {
|
|
165
|
-
return META_KEYS_MAP[prop] || prop;
|
|
166
|
-
}
|
|
167
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: Meta, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
168
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: Meta, providedIn: 'root' });
|
|
17
|
+
_doc;
|
|
18
|
+
_dom;
|
|
19
|
+
constructor(_doc) {
|
|
20
|
+
this._doc = _doc;
|
|
21
|
+
this._dom = _getDOM();
|
|
22
|
+
}
|
|
23
|
+
addTag(tag, forceCreation = false) {
|
|
24
|
+
if (!tag) return null;
|
|
25
|
+
return this._getOrCreateElement(tag, forceCreation);
|
|
26
|
+
}
|
|
27
|
+
addTags(tags, forceCreation = false) {
|
|
28
|
+
if (!tags) return [];
|
|
29
|
+
return tags.reduce((result, tag) => {
|
|
30
|
+
if (tag) {
|
|
31
|
+
result.push(this._getOrCreateElement(tag, forceCreation));
|
|
32
|
+
}
|
|
33
|
+
return result;
|
|
34
|
+
}, []);
|
|
35
|
+
}
|
|
36
|
+
getTag(attrSelector) {
|
|
37
|
+
if (!attrSelector) return null;
|
|
38
|
+
return this._doc.querySelector(`meta[${attrSelector}]`) || null;
|
|
39
|
+
}
|
|
40
|
+
getTags(attrSelector) {
|
|
41
|
+
if (!attrSelector) return [];
|
|
42
|
+
const list = this._doc.querySelectorAll(`meta[${attrSelector}]`);
|
|
43
|
+
return list ? [].slice.call(list) : [];
|
|
44
|
+
}
|
|
45
|
+
updateTag(tag, selector) {
|
|
46
|
+
if (!tag) return null;
|
|
47
|
+
selector = selector || this._parseSelector(tag);
|
|
48
|
+
const meta = this.getTag(selector);
|
|
49
|
+
if (meta) {
|
|
50
|
+
return this._setMetaElementAttributes(tag, meta);
|
|
51
|
+
}
|
|
52
|
+
return this._getOrCreateElement(tag, true);
|
|
53
|
+
}
|
|
54
|
+
removeTag(attrSelector) {
|
|
55
|
+
this.removeTagElement(this.getTag(attrSelector));
|
|
56
|
+
}
|
|
57
|
+
removeTagElement(meta) {
|
|
58
|
+
if (meta) {
|
|
59
|
+
this._dom.remove(meta);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
_getOrCreateElement(meta, forceCreation = false) {
|
|
63
|
+
if (!forceCreation) {
|
|
64
|
+
const selector = this._parseSelector(meta);
|
|
65
|
+
const elem = this.getTags(selector).filter(elem => this._containsAttributes(meta, elem))[0];
|
|
66
|
+
if (elem !== undefined) return elem;
|
|
67
|
+
}
|
|
68
|
+
const element = this._dom.createElement('meta');
|
|
69
|
+
this._setMetaElementAttributes(meta, element);
|
|
70
|
+
const head = this._doc.getElementsByTagName('head')[0];
|
|
71
|
+
head.appendChild(element);
|
|
72
|
+
return element;
|
|
73
|
+
}
|
|
74
|
+
_setMetaElementAttributes(tag, el) {
|
|
75
|
+
Object.keys(tag).forEach(prop => el.setAttribute(this._getMetaKeyMap(prop), tag[prop]));
|
|
76
|
+
return el;
|
|
77
|
+
}
|
|
78
|
+
_parseSelector(tag) {
|
|
79
|
+
const attr = tag.name ? 'name' : 'property';
|
|
80
|
+
return `${attr}="${tag[attr]}"`;
|
|
81
|
+
}
|
|
82
|
+
_containsAttributes(tag, elem) {
|
|
83
|
+
return Object.keys(tag).every(key => elem.getAttribute(this._getMetaKeyMap(key)) === tag[key]);
|
|
84
|
+
}
|
|
85
|
+
_getMetaKeyMap(prop) {
|
|
86
|
+
return META_KEYS_MAP[prop] || prop;
|
|
87
|
+
}
|
|
88
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
89
|
+
minVersion: "12.0.0",
|
|
90
|
+
version: "21.0.0-next.10",
|
|
91
|
+
ngImport: i0,
|
|
92
|
+
type: Meta,
|
|
93
|
+
deps: [{
|
|
94
|
+
token: DOCUMENT
|
|
95
|
+
}],
|
|
96
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
97
|
+
});
|
|
98
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
99
|
+
minVersion: "12.0.0",
|
|
100
|
+
version: "21.0.0-next.10",
|
|
101
|
+
ngImport: i0,
|
|
102
|
+
type: Meta,
|
|
103
|
+
providedIn: 'root'
|
|
104
|
+
});
|
|
169
105
|
}
|
|
170
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
106
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
107
|
+
minVersion: "12.0.0",
|
|
108
|
+
version: "21.0.0-next.10",
|
|
109
|
+
ngImport: i0,
|
|
110
|
+
type: Meta,
|
|
111
|
+
decorators: [{
|
|
112
|
+
type: Injectable,
|
|
113
|
+
args: [{
|
|
114
|
+
providedIn: 'root'
|
|
115
|
+
}]
|
|
116
|
+
}],
|
|
117
|
+
ctorParameters: () => [{
|
|
118
|
+
type: undefined,
|
|
119
|
+
decorators: [{
|
|
120
|
+
type: Inject,
|
|
121
|
+
args: [DOCUMENT]
|
|
122
|
+
}]
|
|
123
|
+
}]
|
|
124
|
+
});
|
|
180
125
|
const META_KEYS_MAP = {
|
|
181
|
-
|
|
126
|
+
httpEquiv: 'http-equiv'
|
|
182
127
|
};
|
|
183
128
|
|
|
184
|
-
/**
|
|
185
|
-
* A service that can be used to get and set the title of a current HTML document.
|
|
186
|
-
*
|
|
187
|
-
* Since an Angular application can't be bootstrapped on the entire HTML document (`<html>` tag)
|
|
188
|
-
* it is not possible to bind to the `text` property of the `HTMLTitleElement` elements
|
|
189
|
-
* (representing the `<title>` tag). Instead, this service can be used to set and get the current
|
|
190
|
-
* title value.
|
|
191
|
-
*
|
|
192
|
-
* @publicApi
|
|
193
|
-
*/
|
|
194
129
|
class Title {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
130
|
+
_doc;
|
|
131
|
+
constructor(_doc) {
|
|
132
|
+
this._doc = _doc;
|
|
133
|
+
}
|
|
134
|
+
getTitle() {
|
|
135
|
+
return this._doc.title;
|
|
136
|
+
}
|
|
137
|
+
setTitle(newTitle) {
|
|
138
|
+
this._doc.title = newTitle || '';
|
|
139
|
+
}
|
|
140
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
141
|
+
minVersion: "12.0.0",
|
|
142
|
+
version: "21.0.0-next.10",
|
|
143
|
+
ngImport: i0,
|
|
144
|
+
type: Title,
|
|
145
|
+
deps: [{
|
|
146
|
+
token: DOCUMENT
|
|
147
|
+
}],
|
|
148
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
149
|
+
});
|
|
150
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
151
|
+
minVersion: "12.0.0",
|
|
152
|
+
version: "21.0.0-next.10",
|
|
153
|
+
ngImport: i0,
|
|
154
|
+
type: Title,
|
|
155
|
+
providedIn: 'root'
|
|
156
|
+
});
|
|
214
157
|
}
|
|
215
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
158
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
159
|
+
minVersion: "12.0.0",
|
|
160
|
+
version: "21.0.0-next.10",
|
|
161
|
+
ngImport: i0,
|
|
162
|
+
type: Title,
|
|
163
|
+
decorators: [{
|
|
164
|
+
type: Injectable,
|
|
165
|
+
args: [{
|
|
166
|
+
providedIn: 'root'
|
|
167
|
+
}]
|
|
168
|
+
}],
|
|
169
|
+
ctorParameters: () => [{
|
|
170
|
+
type: undefined,
|
|
171
|
+
decorators: [{
|
|
172
|
+
type: Inject,
|
|
173
|
+
args: [DOCUMENT]
|
|
174
|
+
}]
|
|
175
|
+
}]
|
|
176
|
+
});
|
|
222
177
|
|
|
223
|
-
/// <reference path="../../../goog.d.ts" />
|
|
224
|
-
/**
|
|
225
|
-
* Exports the value under a given `name` in the global property `ng`. For example `ng.probe` if
|
|
226
|
-
* `name` is `'probe'`.
|
|
227
|
-
* @param name Name under which it will be exported. Keep in mind this will be a property of the
|
|
228
|
-
* global `ng` object.
|
|
229
|
-
* @param value The value to export.
|
|
230
|
-
*/
|
|
231
178
|
function exportNgVar(name, value) {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
// for typings for angularJS (via `goog.provide('ng....')`).
|
|
237
|
-
const ng = (_global['ng'] = _global['ng'] || {});
|
|
238
|
-
ng[name] = value;
|
|
239
|
-
}
|
|
179
|
+
if (typeof COMPILED === 'undefined' || !COMPILED) {
|
|
180
|
+
const ng = _global['ng'] = _global['ng'] || {};
|
|
181
|
+
ng[name] = value;
|
|
182
|
+
}
|
|
240
183
|
}
|
|
241
184
|
|
|
242
185
|
class ChangeDetectionPerfRecord {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
186
|
+
msPerTick;
|
|
187
|
+
numTicks;
|
|
188
|
+
constructor(msPerTick, numTicks) {
|
|
189
|
+
this.msPerTick = msPerTick;
|
|
190
|
+
this.numTicks = numTicks;
|
|
191
|
+
}
|
|
249
192
|
}
|
|
250
|
-
/**
|
|
251
|
-
* Entry point for all Angular profiling-related debug tools. This object
|
|
252
|
-
* corresponds to the `ng.profiler` in the dev console.
|
|
253
|
-
*/
|
|
254
193
|
class AngularProfiler {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
if (record && 'profile' in console && typeof console.profile === 'function') {
|
|
281
|
-
console.profile(profileName);
|
|
282
|
-
}
|
|
283
|
-
const start = performance.now();
|
|
284
|
-
let numTicks = 0;
|
|
285
|
-
while (numTicks < 5 || performance.now() - start < 500) {
|
|
286
|
-
this.appRef.tick();
|
|
287
|
-
numTicks++;
|
|
288
|
-
}
|
|
289
|
-
const end = performance.now();
|
|
290
|
-
if (record && 'profileEnd' in console && typeof console.profileEnd === 'function') {
|
|
291
|
-
console.profileEnd(profileName);
|
|
292
|
-
}
|
|
293
|
-
const msPerTick = (end - start) / numTicks;
|
|
294
|
-
console.log(`ran ${numTicks} change detection cycles`);
|
|
295
|
-
console.log(`${msPerTick.toFixed(2)} ms per check`);
|
|
296
|
-
return new ChangeDetectionPerfRecord(msPerTick, numTicks);
|
|
297
|
-
}
|
|
194
|
+
appRef;
|
|
195
|
+
constructor(ref) {
|
|
196
|
+
this.appRef = ref.injector.get(ApplicationRef);
|
|
197
|
+
}
|
|
198
|
+
timeChangeDetection(config) {
|
|
199
|
+
const record = config && config['record'];
|
|
200
|
+
const profileName = 'Change Detection';
|
|
201
|
+
if (record && 'profile' in console && typeof console.profile === 'function') {
|
|
202
|
+
console.profile(profileName);
|
|
203
|
+
}
|
|
204
|
+
const start = performance.now();
|
|
205
|
+
let numTicks = 0;
|
|
206
|
+
while (numTicks < 5 || performance.now() - start < 500) {
|
|
207
|
+
this.appRef.tick();
|
|
208
|
+
numTicks++;
|
|
209
|
+
}
|
|
210
|
+
const end = performance.now();
|
|
211
|
+
if (record && 'profileEnd' in console && typeof console.profileEnd === 'function') {
|
|
212
|
+
console.profileEnd(profileName);
|
|
213
|
+
}
|
|
214
|
+
const msPerTick = (end - start) / numTicks;
|
|
215
|
+
console.log(`ran ${numTicks} change detection cycles`);
|
|
216
|
+
console.log(`${msPerTick.toFixed(2)} ms per check`);
|
|
217
|
+
return new ChangeDetectionPerfRecord(msPerTick, numTicks);
|
|
218
|
+
}
|
|
298
219
|
}
|
|
299
220
|
|
|
300
221
|
const PROFILER_GLOBAL_NAME = 'profiler';
|
|
301
|
-
/**
|
|
302
|
-
* Enabled Angular debug tools that are accessible via your browser's
|
|
303
|
-
* developer console.
|
|
304
|
-
*
|
|
305
|
-
* Usage:
|
|
306
|
-
*
|
|
307
|
-
* 1. Open developer console (e.g. in Chrome Ctrl + Shift + j)
|
|
308
|
-
* 1. Type `ng.` (usually the console will show auto-complete suggestion)
|
|
309
|
-
* 1. Try the change detection profiler `ng.profiler.timeChangeDetection()`
|
|
310
|
-
* then hit Enter.
|
|
311
|
-
*
|
|
312
|
-
* @publicApi
|
|
313
|
-
*/
|
|
314
222
|
function enableDebugTools(ref) {
|
|
315
|
-
|
|
316
|
-
|
|
223
|
+
exportNgVar(PROFILER_GLOBAL_NAME, new AngularProfiler(ref));
|
|
224
|
+
return ref;
|
|
317
225
|
}
|
|
318
|
-
/**
|
|
319
|
-
* Disables Angular tools.
|
|
320
|
-
*
|
|
321
|
-
* @publicApi
|
|
322
|
-
*/
|
|
323
226
|
function disableDebugTools() {
|
|
324
|
-
|
|
227
|
+
exportNgVar(PROFILER_GLOBAL_NAME, null);
|
|
325
228
|
}
|
|
326
229
|
|
|
327
|
-
/**
|
|
328
|
-
* Predicates for use with {@link DebugElement}'s query functions.
|
|
329
|
-
*
|
|
330
|
-
* @publicApi
|
|
331
|
-
*/
|
|
332
230
|
class By {
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
/**
|
|
345
|
-
* Match elements by the given CSS selector.
|
|
346
|
-
*
|
|
347
|
-
* @usageNotes
|
|
348
|
-
* ### Example
|
|
349
|
-
*
|
|
350
|
-
* {@example platform-browser/dom/debug/ts/by/by.ts region='by_css'}
|
|
351
|
-
*/
|
|
352
|
-
static css(selector) {
|
|
353
|
-
return (debugElement) => {
|
|
354
|
-
return debugElement.nativeElement != null
|
|
355
|
-
? elementMatches(debugElement.nativeElement, selector)
|
|
356
|
-
: false;
|
|
357
|
-
};
|
|
358
|
-
}
|
|
359
|
-
/**
|
|
360
|
-
* Match nodes that have the given directive present.
|
|
361
|
-
*
|
|
362
|
-
* @usageNotes
|
|
363
|
-
* ### Example
|
|
364
|
-
*
|
|
365
|
-
* {@example platform-browser/dom/debug/ts/by/by.ts region='by_directive'}
|
|
366
|
-
*/
|
|
367
|
-
static directive(type) {
|
|
368
|
-
return (debugNode) => debugNode.providerTokens.indexOf(type) !== -1;
|
|
369
|
-
}
|
|
231
|
+
static all() {
|
|
232
|
+
return () => true;
|
|
233
|
+
}
|
|
234
|
+
static css(selector) {
|
|
235
|
+
return debugElement => {
|
|
236
|
+
return debugElement.nativeElement != null ? elementMatches(debugElement.nativeElement, selector) : false;
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
static directive(type) {
|
|
240
|
+
return debugNode => debugNode.providerTokens.indexOf(type) !== -1;
|
|
241
|
+
}
|
|
370
242
|
}
|
|
371
243
|
function elementMatches(n, selector) {
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
}
|
|
377
|
-
return false;
|
|
244
|
+
if (_getDOM().isElementNode(n)) {
|
|
245
|
+
return n.matches && n.matches(selector) || n.msMatchesSelector && n.msMatchesSelector(selector) || n.webkitMatchesSelector && n.webkitMatchesSelector(selector);
|
|
246
|
+
}
|
|
247
|
+
return false;
|
|
378
248
|
}
|
|
379
249
|
|
|
380
|
-
/// <reference types="hammerjs" />
|
|
381
|
-
/**
|
|
382
|
-
* Supported HammerJS recognizer event names.
|
|
383
|
-
*/
|
|
384
250
|
const EVENT_NAMES = {
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
'swiperight': true,
|
|
416
|
-
'swipeup': true,
|
|
417
|
-
'swipedown': true,
|
|
418
|
-
// tap
|
|
419
|
-
'tap': true,
|
|
420
|
-
'doubletap': true,
|
|
251
|
+
'pan': true,
|
|
252
|
+
'panstart': true,
|
|
253
|
+
'panmove': true,
|
|
254
|
+
'panend': true,
|
|
255
|
+
'pancancel': true,
|
|
256
|
+
'panleft': true,
|
|
257
|
+
'panright': true,
|
|
258
|
+
'panup': true,
|
|
259
|
+
'pandown': true,
|
|
260
|
+
'pinch': true,
|
|
261
|
+
'pinchstart': true,
|
|
262
|
+
'pinchmove': true,
|
|
263
|
+
'pinchend': true,
|
|
264
|
+
'pinchcancel': true,
|
|
265
|
+
'pinchin': true,
|
|
266
|
+
'pinchout': true,
|
|
267
|
+
'press': true,
|
|
268
|
+
'pressup': true,
|
|
269
|
+
'rotate': true,
|
|
270
|
+
'rotatestart': true,
|
|
271
|
+
'rotatemove': true,
|
|
272
|
+
'rotateend': true,
|
|
273
|
+
'rotatecancel': true,
|
|
274
|
+
'swipe': true,
|
|
275
|
+
'swipeleft': true,
|
|
276
|
+
'swiperight': true,
|
|
277
|
+
'swipeup': true,
|
|
278
|
+
'swipedown': true,
|
|
279
|
+
'tap': true,
|
|
280
|
+
'doubletap': true
|
|
421
281
|
};
|
|
422
|
-
/**
|
|
423
|
-
* DI token for providing [HammerJS](https://hammerjs.github.io/) support to Angular.
|
|
424
|
-
* @see {@link HammerGestureConfig}
|
|
425
|
-
*
|
|
426
|
-
* @ngModule HammerModule
|
|
427
|
-
* @publicApi
|
|
428
|
-
*
|
|
429
|
-
* @deprecated The HammerJS integration is deprecated. Replace it by your own implementation.
|
|
430
|
-
*/
|
|
431
282
|
const HAMMER_GESTURE_CONFIG = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'HammerGestureConfig' : '');
|
|
432
|
-
/**
|
|
433
|
-
* Injection token used to provide a HammerLoader to Angular.
|
|
434
|
-
*
|
|
435
|
-
* @see {@link HammerLoader}
|
|
436
|
-
*
|
|
437
|
-
* @publicApi
|
|
438
|
-
*
|
|
439
|
-
* @deprecated The HammerJS integration is deprecated. Replace it by your own implementation.
|
|
440
|
-
*/
|
|
441
283
|
const HAMMER_LOADER = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'HammerLoader' : '');
|
|
442
|
-
/**
|
|
443
|
-
* An injectable [HammerJS Manager](https://hammerjs.github.io/api/#hammermanager)
|
|
444
|
-
* for gesture recognition. Configures specific event recognition.
|
|
445
|
-
* @publicApi
|
|
446
|
-
*
|
|
447
|
-
* @deprecated The HammerJS integration is deprecated. Replace it by your own implementation.
|
|
448
|
-
*/
|
|
449
284
|
class HammerGestureConfig {
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
options;
|
|
481
|
-
/**
|
|
482
|
-
* Creates a [HammerJS Manager](https://hammerjs.github.io/api/#hammermanager)
|
|
483
|
-
* and attaches it to a given HTML element.
|
|
484
|
-
* @param element The element that will recognize gestures.
|
|
485
|
-
* @returns A HammerJS event-manager object.
|
|
486
|
-
*/
|
|
487
|
-
buildHammer(element) {
|
|
488
|
-
const mc = new Hammer(element, this.options);
|
|
489
|
-
mc.get('pinch').set({ enable: true });
|
|
490
|
-
mc.get('rotate').set({ enable: true });
|
|
491
|
-
for (const eventName in this.overrides) {
|
|
492
|
-
mc.get(eventName).set(this.overrides[eventName]);
|
|
493
|
-
}
|
|
494
|
-
return mc;
|
|
495
|
-
}
|
|
496
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: HammerGestureConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
497
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: HammerGestureConfig });
|
|
285
|
+
events = [];
|
|
286
|
+
overrides = {};
|
|
287
|
+
options;
|
|
288
|
+
buildHammer(element) {
|
|
289
|
+
const mc = new Hammer(element, this.options);
|
|
290
|
+
mc.get('pinch').set({
|
|
291
|
+
enable: true
|
|
292
|
+
});
|
|
293
|
+
mc.get('rotate').set({
|
|
294
|
+
enable: true
|
|
295
|
+
});
|
|
296
|
+
for (const eventName in this.overrides) {
|
|
297
|
+
mc.get(eventName).set(this.overrides[eventName]);
|
|
298
|
+
}
|
|
299
|
+
return mc;
|
|
300
|
+
}
|
|
301
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
302
|
+
minVersion: "12.0.0",
|
|
303
|
+
version: "21.0.0-next.10",
|
|
304
|
+
ngImport: i0,
|
|
305
|
+
type: HammerGestureConfig,
|
|
306
|
+
deps: [],
|
|
307
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
308
|
+
});
|
|
309
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
310
|
+
minVersion: "12.0.0",
|
|
311
|
+
version: "21.0.0-next.10",
|
|
312
|
+
ngImport: i0,
|
|
313
|
+
type: HammerGestureConfig
|
|
314
|
+
});
|
|
498
315
|
}
|
|
499
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
316
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
317
|
+
minVersion: "12.0.0",
|
|
318
|
+
version: "21.0.0-next.10",
|
|
319
|
+
ngImport: i0,
|
|
320
|
+
type: HammerGestureConfig,
|
|
321
|
+
decorators: [{
|
|
322
|
+
type: Injectable
|
|
323
|
+
}]
|
|
324
|
+
});
|
|
507
325
|
class HammerGesturesPlugin extends EventManagerPlugin {
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
326
|
+
_config;
|
|
327
|
+
_injector;
|
|
328
|
+
loader;
|
|
329
|
+
_loaderPromise = null;
|
|
330
|
+
constructor(doc, _config, _injector, loader) {
|
|
331
|
+
super(doc);
|
|
332
|
+
this._config = _config;
|
|
333
|
+
this._injector = _injector;
|
|
334
|
+
this.loader = loader;
|
|
335
|
+
}
|
|
336
|
+
supports(eventName) {
|
|
337
|
+
if (!EVENT_NAMES.hasOwnProperty(eventName.toLowerCase()) && !this.isCustomEvent(eventName)) {
|
|
338
|
+
return false;
|
|
339
|
+
}
|
|
340
|
+
if (!window.Hammer && !this.loader) {
|
|
341
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
342
|
+
const _console = this._injector.get(_Console);
|
|
343
|
+
_console.warn(`The "${eventName}" event cannot be bound because Hammer.JS is not ` + `loaded and no custom loader has been specified.`);
|
|
344
|
+
}
|
|
345
|
+
return false;
|
|
346
|
+
}
|
|
347
|
+
return true;
|
|
348
|
+
}
|
|
349
|
+
addEventListener(element, eventName, handler) {
|
|
350
|
+
const zone = this.manager.getZone();
|
|
351
|
+
eventName = eventName.toLowerCase();
|
|
352
|
+
if (!window.Hammer && this.loader) {
|
|
353
|
+
this._loaderPromise = this._loaderPromise || zone.runOutsideAngular(() => this.loader());
|
|
354
|
+
let cancelRegistration = false;
|
|
355
|
+
let deregister = () => {
|
|
356
|
+
cancelRegistration = true;
|
|
357
|
+
};
|
|
358
|
+
zone.runOutsideAngular(() => this._loaderPromise.then(() => {
|
|
359
|
+
if (!window.Hammer) {
|
|
360
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
361
|
+
const _console = this._injector.get(_Console);
|
|
362
|
+
_console.warn(`The custom HAMMER_LOADER completed, but Hammer.JS is not present.`);
|
|
363
|
+
}
|
|
364
|
+
deregister = () => {};
|
|
365
|
+
return;
|
|
521
366
|
}
|
|
522
|
-
if (!
|
|
523
|
-
|
|
524
|
-
// Get a `Console` through an injector to tree-shake the
|
|
525
|
-
// class when it is unused in production.
|
|
526
|
-
const _console = this._injector.get(_Console);
|
|
527
|
-
_console.warn(`The "${eventName}" event cannot be bound because Hammer.JS is not ` +
|
|
528
|
-
`loaded and no custom loader has been specified.`);
|
|
529
|
-
}
|
|
530
|
-
return false;
|
|
367
|
+
if (!cancelRegistration) {
|
|
368
|
+
deregister = this.addEventListener(element, eventName, handler);
|
|
531
369
|
}
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
eventName = eventName.toLowerCase();
|
|
537
|
-
// If Hammer is not present but a loader is specified, we defer adding the event listener
|
|
538
|
-
// until Hammer is loaded.
|
|
539
|
-
if (!window.Hammer && this.loader) {
|
|
540
|
-
this._loaderPromise = this._loaderPromise || zone.runOutsideAngular(() => this.loader());
|
|
541
|
-
// This `addEventListener` method returns a function to remove the added listener.
|
|
542
|
-
// Until Hammer is loaded, the returned function needs to *cancel* the registration rather
|
|
543
|
-
// than remove anything.
|
|
544
|
-
let cancelRegistration = false;
|
|
545
|
-
let deregister = () => {
|
|
546
|
-
cancelRegistration = true;
|
|
547
|
-
};
|
|
548
|
-
zone.runOutsideAngular(() => this._loaderPromise.then(() => {
|
|
549
|
-
// If Hammer isn't actually loaded when the custom loader resolves, give up.
|
|
550
|
-
if (!window.Hammer) {
|
|
551
|
-
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
552
|
-
const _console = this._injector.get(_Console);
|
|
553
|
-
_console.warn(`The custom HAMMER_LOADER completed, but Hammer.JS is not present.`);
|
|
554
|
-
}
|
|
555
|
-
deregister = () => { };
|
|
556
|
-
return;
|
|
557
|
-
}
|
|
558
|
-
if (!cancelRegistration) {
|
|
559
|
-
// Now that Hammer is loaded and the listener is being loaded for real,
|
|
560
|
-
// the deregistration function changes from canceling registration to
|
|
561
|
-
// removal.
|
|
562
|
-
deregister = this.addEventListener(element, eventName, handler);
|
|
563
|
-
}
|
|
564
|
-
}).catch(() => {
|
|
565
|
-
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
566
|
-
const _console = this._injector.get(_Console);
|
|
567
|
-
_console.warn(`The "${eventName}" event cannot be bound because the custom ` +
|
|
568
|
-
`Hammer.JS loader failed.`);
|
|
569
|
-
}
|
|
570
|
-
deregister = () => { };
|
|
571
|
-
}));
|
|
572
|
-
// Return a function that *executes* `deregister` (and not `deregister` itself) so that we
|
|
573
|
-
// can change the behavior of `deregister` once the listener is added. Using a closure in
|
|
574
|
-
// this way allows us to avoid any additional data structures to track listener removal.
|
|
575
|
-
return () => {
|
|
576
|
-
deregister();
|
|
577
|
-
};
|
|
370
|
+
}).catch(() => {
|
|
371
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
372
|
+
const _console = this._injector.get(_Console);
|
|
373
|
+
_console.warn(`The "${eventName}" event cannot be bound because the custom ` + `Hammer.JS loader failed.`);
|
|
578
374
|
}
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
// destroy mc to prevent memory leak
|
|
591
|
-
if (typeof mc.destroy === 'function') {
|
|
592
|
-
mc.destroy();
|
|
593
|
-
}
|
|
594
|
-
};
|
|
375
|
+
deregister = () => {};
|
|
376
|
+
}));
|
|
377
|
+
return () => {
|
|
378
|
+
deregister();
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
return zone.runOutsideAngular(() => {
|
|
382
|
+
const mc = this._config.buildHammer(element);
|
|
383
|
+
const callback = function (eventObj) {
|
|
384
|
+
zone.runGuarded(function () {
|
|
385
|
+
handler(eventObj);
|
|
595
386
|
});
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
387
|
+
};
|
|
388
|
+
mc.on(eventName, callback);
|
|
389
|
+
return () => {
|
|
390
|
+
mc.off(eventName, callback);
|
|
391
|
+
if (typeof mc.destroy === 'function') {
|
|
392
|
+
mc.destroy();
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
isCustomEvent(eventName) {
|
|
398
|
+
return this._config.events.indexOf(eventName) > -1;
|
|
399
|
+
}
|
|
400
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
401
|
+
minVersion: "12.0.0",
|
|
402
|
+
version: "21.0.0-next.10",
|
|
403
|
+
ngImport: i0,
|
|
404
|
+
type: HammerGesturesPlugin,
|
|
405
|
+
deps: [{
|
|
406
|
+
token: DOCUMENT
|
|
407
|
+
}, {
|
|
408
|
+
token: HAMMER_GESTURE_CONFIG
|
|
409
|
+
}, {
|
|
410
|
+
token: i0.Injector
|
|
411
|
+
}, {
|
|
412
|
+
token: HAMMER_LOADER,
|
|
413
|
+
optional: true
|
|
414
|
+
}],
|
|
415
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
416
|
+
});
|
|
417
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
418
|
+
minVersion: "12.0.0",
|
|
419
|
+
version: "21.0.0-next.10",
|
|
420
|
+
ngImport: i0,
|
|
421
|
+
type: HammerGesturesPlugin
|
|
422
|
+
});
|
|
602
423
|
}
|
|
603
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
424
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
425
|
+
minVersion: "12.0.0",
|
|
426
|
+
version: "21.0.0-next.10",
|
|
427
|
+
ngImport: i0,
|
|
428
|
+
type: HammerGesturesPlugin,
|
|
429
|
+
decorators: [{
|
|
430
|
+
type: Injectable
|
|
431
|
+
}],
|
|
432
|
+
ctorParameters: () => [{
|
|
433
|
+
type: undefined,
|
|
434
|
+
decorators: [{
|
|
435
|
+
type: Inject,
|
|
436
|
+
args: [DOCUMENT]
|
|
437
|
+
}]
|
|
438
|
+
}, {
|
|
439
|
+
type: HammerGestureConfig,
|
|
440
|
+
decorators: [{
|
|
441
|
+
type: Inject,
|
|
442
|
+
args: [HAMMER_GESTURE_CONFIG]
|
|
443
|
+
}]
|
|
444
|
+
}, {
|
|
445
|
+
type: i0.Injector
|
|
446
|
+
}, {
|
|
447
|
+
type: undefined,
|
|
448
|
+
decorators: [{
|
|
449
|
+
type: Optional
|
|
450
|
+
}, {
|
|
451
|
+
type: Inject,
|
|
452
|
+
args: [HAMMER_LOADER]
|
|
453
|
+
}]
|
|
454
|
+
}]
|
|
455
|
+
});
|
|
630
456
|
class HammerModule {
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
457
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
458
|
+
minVersion: "12.0.0",
|
|
459
|
+
version: "21.0.0-next.10",
|
|
460
|
+
ngImport: i0,
|
|
461
|
+
type: HammerModule,
|
|
462
|
+
deps: [],
|
|
463
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
464
|
+
});
|
|
465
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({
|
|
466
|
+
minVersion: "14.0.0",
|
|
467
|
+
version: "21.0.0-next.10",
|
|
468
|
+
ngImport: i0,
|
|
469
|
+
type: HammerModule
|
|
470
|
+
});
|
|
471
|
+
static ɵinj = i0.ɵɵngDeclareInjector({
|
|
472
|
+
minVersion: "12.0.0",
|
|
473
|
+
version: "21.0.0-next.10",
|
|
474
|
+
ngImport: i0,
|
|
475
|
+
type: HammerModule,
|
|
476
|
+
providers: [{
|
|
477
|
+
provide: EVENT_MANAGER_PLUGINS,
|
|
478
|
+
useClass: HammerGesturesPlugin,
|
|
479
|
+
multi: true,
|
|
480
|
+
deps: [DOCUMENT, HAMMER_GESTURE_CONFIG, Injector, [new Optional(), HAMMER_LOADER]]
|
|
481
|
+
}, {
|
|
482
|
+
provide: HAMMER_GESTURE_CONFIG,
|
|
483
|
+
useClass: HammerGestureConfig
|
|
484
|
+
}]
|
|
485
|
+
});
|
|
642
486
|
}
|
|
643
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
487
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
488
|
+
minVersion: "12.0.0",
|
|
489
|
+
version: "21.0.0-next.10",
|
|
490
|
+
ngImport: i0,
|
|
491
|
+
type: HammerModule,
|
|
492
|
+
decorators: [{
|
|
493
|
+
type: NgModule,
|
|
494
|
+
args: [{
|
|
495
|
+
providers: [{
|
|
496
|
+
provide: EVENT_MANAGER_PLUGINS,
|
|
497
|
+
useClass: HammerGesturesPlugin,
|
|
498
|
+
multi: true,
|
|
499
|
+
deps: [DOCUMENT, HAMMER_GESTURE_CONFIG, Injector, [new Optional(), HAMMER_LOADER]]
|
|
500
|
+
}, {
|
|
501
|
+
provide: HAMMER_GESTURE_CONFIG,
|
|
502
|
+
useClass: HammerGestureConfig
|
|
503
|
+
}]
|
|
504
|
+
}]
|
|
505
|
+
}]
|
|
506
|
+
});
|
|
657
507
|
|
|
658
|
-
/**
|
|
659
|
-
* DomSanitizer helps preventing Cross Site Scripting Security bugs (XSS) by sanitizing
|
|
660
|
-
* values to be safe to use in the different DOM contexts.
|
|
661
|
-
*
|
|
662
|
-
* For example, when binding a URL in an `<a [href]="someValue">` hyperlink, `someValue` will be
|
|
663
|
-
* sanitized so that an attacker cannot inject e.g. a `javascript:` URL that would execute code on
|
|
664
|
-
* the website.
|
|
665
|
-
*
|
|
666
|
-
* In specific situations, it might be necessary to disable sanitization, for example if the
|
|
667
|
-
* application genuinely needs to produce a `javascript:` style link with a dynamic value in it.
|
|
668
|
-
* Users can bypass security by constructing a value with one of the `bypassSecurityTrust...`
|
|
669
|
-
* methods, and then binding to that value from the template.
|
|
670
|
-
*
|
|
671
|
-
* These situations should be very rare, and extraordinary care must be taken to avoid creating a
|
|
672
|
-
* Cross Site Scripting (XSS) security bug!
|
|
673
|
-
*
|
|
674
|
-
* When using `bypassSecurityTrust...`, make sure to call the method as early as possible and as
|
|
675
|
-
* close as possible to the source of the value, to make it easy to verify no security bug is
|
|
676
|
-
* created by its use.
|
|
677
|
-
*
|
|
678
|
-
* It is not required (and not recommended) to bypass security if the value is safe, e.g. a URL that
|
|
679
|
-
* does not start with a suspicious protocol, or an HTML snippet that does not contain dangerous
|
|
680
|
-
* code. The sanitizer leaves safe values intact.
|
|
681
|
-
*
|
|
682
|
-
* @security Calling any of the `bypassSecurityTrust...` APIs disables Angular's built-in
|
|
683
|
-
* sanitization for the value passed in. Carefully check and audit all values and code paths going
|
|
684
|
-
* into this call. Make sure any user data is appropriately escaped for this security context.
|
|
685
|
-
* For more detail, see the [Security Guide](https://g.co/ng/security).
|
|
686
|
-
*
|
|
687
|
-
* @publicApi
|
|
688
|
-
*/
|
|
689
508
|
class DomSanitizer {
|
|
690
|
-
|
|
691
|
-
|
|
509
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
510
|
+
minVersion: "12.0.0",
|
|
511
|
+
version: "21.0.0-next.10",
|
|
512
|
+
ngImport: i0,
|
|
513
|
+
type: DomSanitizer,
|
|
514
|
+
deps: [],
|
|
515
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
516
|
+
});
|
|
517
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
518
|
+
minVersion: "12.0.0",
|
|
519
|
+
version: "21.0.0-next.10",
|
|
520
|
+
ngImport: i0,
|
|
521
|
+
type: DomSanitizer,
|
|
522
|
+
providedIn: 'root',
|
|
523
|
+
useExisting: i0.forwardRef(() => DomSanitizerImpl)
|
|
524
|
+
});
|
|
692
525
|
}
|
|
693
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
526
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
527
|
+
minVersion: "12.0.0",
|
|
528
|
+
version: "21.0.0-next.10",
|
|
529
|
+
ngImport: i0,
|
|
530
|
+
type: DomSanitizer,
|
|
531
|
+
decorators: [{
|
|
532
|
+
type: Injectable,
|
|
533
|
+
args: [{
|
|
534
|
+
providedIn: 'root',
|
|
535
|
+
useExisting: forwardRef(() => DomSanitizerImpl)
|
|
536
|
+
}]
|
|
537
|
+
}]
|
|
538
|
+
});
|
|
697
539
|
class DomSanitizerImpl extends DomSanitizer {
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
return _unwrapSafeValue(value);
|
|
712
|
-
}
|
|
713
|
-
return __sanitizeHtml(this._doc, String(value)).toString();
|
|
714
|
-
case SecurityContext.STYLE:
|
|
715
|
-
if (_allowSanitizationBypassAndThrow(value, "Style" /* BypassType.Style */)) {
|
|
716
|
-
return _unwrapSafeValue(value);
|
|
717
|
-
}
|
|
718
|
-
return value;
|
|
719
|
-
case SecurityContext.SCRIPT:
|
|
720
|
-
if (_allowSanitizationBypassAndThrow(value, "Script" /* BypassType.Script */)) {
|
|
721
|
-
return _unwrapSafeValue(value);
|
|
722
|
-
}
|
|
723
|
-
throw new _RuntimeError(5200 /* RuntimeErrorCode.SANITIZATION_UNSAFE_SCRIPT */, (typeof ngDevMode === 'undefined' || ngDevMode) &&
|
|
724
|
-
'unsafe value used in a script context');
|
|
725
|
-
case SecurityContext.URL:
|
|
726
|
-
if (_allowSanitizationBypassAndThrow(value, "URL" /* BypassType.Url */)) {
|
|
727
|
-
return _unwrapSafeValue(value);
|
|
728
|
-
}
|
|
729
|
-
return __sanitizeUrl(String(value));
|
|
730
|
-
case SecurityContext.RESOURCE_URL:
|
|
731
|
-
if (_allowSanitizationBypassAndThrow(value, "ResourceURL" /* BypassType.ResourceUrl */)) {
|
|
732
|
-
return _unwrapSafeValue(value);
|
|
733
|
-
}
|
|
734
|
-
throw new _RuntimeError(5201 /* RuntimeErrorCode.SANITIZATION_UNSAFE_RESOURCE_URL */, (typeof ngDevMode === 'undefined' || ngDevMode) &&
|
|
735
|
-
`unsafe value used in a resource URL context (see ${_XSS_SECURITY_URL})`);
|
|
736
|
-
default:
|
|
737
|
-
throw new _RuntimeError(5202 /* RuntimeErrorCode.SANITIZATION_UNEXPECTED_CTX */, (typeof ngDevMode === 'undefined' || ngDevMode) &&
|
|
738
|
-
`Unexpected SecurityContext ${ctx} (see ${_XSS_SECURITY_URL})`);
|
|
540
|
+
_doc;
|
|
541
|
+
constructor(_doc) {
|
|
542
|
+
super();
|
|
543
|
+
this._doc = _doc;
|
|
544
|
+
}
|
|
545
|
+
sanitize(ctx, value) {
|
|
546
|
+
if (value == null) return null;
|
|
547
|
+
switch (ctx) {
|
|
548
|
+
case SecurityContext.NONE:
|
|
549
|
+
return value;
|
|
550
|
+
case SecurityContext.HTML:
|
|
551
|
+
if (_allowSanitizationBypassAndThrow(value, "HTML")) {
|
|
552
|
+
return _unwrapSafeValue(value);
|
|
739
553
|
}
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
return
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
554
|
+
return __sanitizeHtml(this._doc, String(value)).toString();
|
|
555
|
+
case SecurityContext.STYLE:
|
|
556
|
+
if (_allowSanitizationBypassAndThrow(value, "Style")) {
|
|
557
|
+
return _unwrapSafeValue(value);
|
|
558
|
+
}
|
|
559
|
+
return value;
|
|
560
|
+
case SecurityContext.SCRIPT:
|
|
561
|
+
if (_allowSanitizationBypassAndThrow(value, "Script")) {
|
|
562
|
+
return _unwrapSafeValue(value);
|
|
563
|
+
}
|
|
564
|
+
throw new _RuntimeError(5200, (typeof ngDevMode === 'undefined' || ngDevMode) && 'unsafe value used in a script context');
|
|
565
|
+
case SecurityContext.URL:
|
|
566
|
+
if (_allowSanitizationBypassAndThrow(value, "URL")) {
|
|
567
|
+
return _unwrapSafeValue(value);
|
|
568
|
+
}
|
|
569
|
+
return __sanitizeUrl(String(value));
|
|
570
|
+
case SecurityContext.RESOURCE_URL:
|
|
571
|
+
if (_allowSanitizationBypassAndThrow(value, "ResourceURL")) {
|
|
572
|
+
return _unwrapSafeValue(value);
|
|
573
|
+
}
|
|
574
|
+
throw new _RuntimeError(5201, (typeof ngDevMode === 'undefined' || ngDevMode) && `unsafe value used in a resource URL context (see ${_XSS_SECURITY_URL})`);
|
|
575
|
+
default:
|
|
576
|
+
throw new _RuntimeError(5202, (typeof ngDevMode === 'undefined' || ngDevMode) && `Unexpected SecurityContext ${ctx} (see ${_XSS_SECURITY_URL})`);
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
bypassSecurityTrustHtml(value) {
|
|
580
|
+
return _bypassSanitizationTrustHtml(value);
|
|
581
|
+
}
|
|
582
|
+
bypassSecurityTrustStyle(value) {
|
|
583
|
+
return _bypassSanitizationTrustStyle(value);
|
|
584
|
+
}
|
|
585
|
+
bypassSecurityTrustScript(value) {
|
|
586
|
+
return _bypassSanitizationTrustScript(value);
|
|
587
|
+
}
|
|
588
|
+
bypassSecurityTrustUrl(value) {
|
|
589
|
+
return _bypassSanitizationTrustUrl(value);
|
|
590
|
+
}
|
|
591
|
+
bypassSecurityTrustResourceUrl(value) {
|
|
592
|
+
return _bypassSanitizationTrustResourceUrl(value);
|
|
593
|
+
}
|
|
594
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
595
|
+
minVersion: "12.0.0",
|
|
596
|
+
version: "21.0.0-next.10",
|
|
597
|
+
ngImport: i0,
|
|
598
|
+
type: DomSanitizerImpl,
|
|
599
|
+
deps: [{
|
|
600
|
+
token: DOCUMENT
|
|
601
|
+
}],
|
|
602
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
603
|
+
});
|
|
604
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
605
|
+
minVersion: "12.0.0",
|
|
606
|
+
version: "21.0.0-next.10",
|
|
607
|
+
ngImport: i0,
|
|
608
|
+
type: DomSanitizerImpl,
|
|
609
|
+
providedIn: 'root'
|
|
610
|
+
});
|
|
758
611
|
}
|
|
759
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
612
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
613
|
+
minVersion: "12.0.0",
|
|
614
|
+
version: "21.0.0-next.10",
|
|
615
|
+
ngImport: i0,
|
|
616
|
+
type: DomSanitizerImpl,
|
|
617
|
+
decorators: [{
|
|
618
|
+
type: Injectable,
|
|
619
|
+
args: [{
|
|
620
|
+
providedIn: 'root'
|
|
621
|
+
}]
|
|
622
|
+
}],
|
|
623
|
+
ctorParameters: () => [{
|
|
624
|
+
type: undefined,
|
|
625
|
+
decorators: [{
|
|
626
|
+
type: Inject,
|
|
627
|
+
args: [DOCUMENT]
|
|
628
|
+
}]
|
|
629
|
+
}]
|
|
630
|
+
});
|
|
766
631
|
|
|
767
|
-
/**
|
|
768
|
-
* The list of features as an enum to uniquely type each `HydrationFeature`.
|
|
769
|
-
* @see {@link HydrationFeature}
|
|
770
|
-
*
|
|
771
|
-
* @publicApi
|
|
772
|
-
*/
|
|
773
632
|
var HydrationFeatureKind;
|
|
774
633
|
(function (HydrationFeatureKind) {
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
634
|
+
HydrationFeatureKind[HydrationFeatureKind["NoHttpTransferCache"] = 0] = "NoHttpTransferCache";
|
|
635
|
+
HydrationFeatureKind[HydrationFeatureKind["HttpTransferCacheOptions"] = 1] = "HttpTransferCacheOptions";
|
|
636
|
+
HydrationFeatureKind[HydrationFeatureKind["I18nSupport"] = 2] = "I18nSupport";
|
|
637
|
+
HydrationFeatureKind[HydrationFeatureKind["EventReplay"] = 3] = "EventReplay";
|
|
638
|
+
HydrationFeatureKind[HydrationFeatureKind["IncrementalHydration"] = 4] = "IncrementalHydration";
|
|
780
639
|
})(HydrationFeatureKind || (HydrationFeatureKind = {}));
|
|
781
|
-
/**
|
|
782
|
-
* Helper function to create an object that represents a Hydration feature.
|
|
783
|
-
*/
|
|
784
640
|
function hydrationFeature(ɵkind, ɵproviders = [], ɵoptions = {}) {
|
|
785
|
-
|
|
641
|
+
return {
|
|
642
|
+
ɵkind,
|
|
643
|
+
ɵproviders
|
|
644
|
+
};
|
|
786
645
|
}
|
|
787
|
-
/**
|
|
788
|
-
* Disables HTTP transfer cache. Effectively causes HTTP requests to be performed twice: once on the
|
|
789
|
-
* server and other one on the browser.
|
|
790
|
-
*
|
|
791
|
-
* @publicApi
|
|
792
|
-
*/
|
|
793
646
|
function withNoHttpTransferCache() {
|
|
794
|
-
|
|
795
|
-
// HTTP transfer cache (which otherwise is turned on by default).
|
|
796
|
-
return hydrationFeature(HydrationFeatureKind.NoHttpTransferCache);
|
|
647
|
+
return hydrationFeature(HydrationFeatureKind.NoHttpTransferCache);
|
|
797
648
|
}
|
|
798
|
-
/**
|
|
799
|
-
* The function accepts an object, which allows to configure cache parameters,
|
|
800
|
-
* such as which headers should be included (no headers are included by default),
|
|
801
|
-
* whether POST requests should be cached or a callback function to determine if a
|
|
802
|
-
* particular request should be cached.
|
|
803
|
-
*
|
|
804
|
-
* @publicApi
|
|
805
|
-
*/
|
|
806
649
|
function withHttpTransferCacheOptions(options) {
|
|
807
|
-
|
|
808
|
-
return hydrationFeature(HydrationFeatureKind.HttpTransferCacheOptions, _withHttpTransferCache(options));
|
|
650
|
+
return hydrationFeature(HydrationFeatureKind.HttpTransferCacheOptions, _withHttpTransferCache(options));
|
|
809
651
|
}
|
|
810
|
-
/**
|
|
811
|
-
* Enables support for hydrating i18n blocks.
|
|
812
|
-
*
|
|
813
|
-
* @publicApi 20.0
|
|
814
|
-
*/
|
|
815
652
|
function withI18nSupport() {
|
|
816
|
-
|
|
653
|
+
return hydrationFeature(HydrationFeatureKind.I18nSupport, _withI18nSupport());
|
|
817
654
|
}
|
|
818
|
-
/**
|
|
819
|
-
* Enables support for replaying user events (e.g. `click`s) that happened on a page
|
|
820
|
-
* before hydration logic has completed. Once an application is hydrated, all captured
|
|
821
|
-
* events are replayed and relevant event listeners are executed.
|
|
822
|
-
*
|
|
823
|
-
* @usageNotes
|
|
824
|
-
*
|
|
825
|
-
* Basic example of how you can enable event replay in your application when
|
|
826
|
-
* `bootstrapApplication` function is used:
|
|
827
|
-
* ```ts
|
|
828
|
-
* bootstrapApplication(AppComponent, {
|
|
829
|
-
* providers: [provideClientHydration(withEventReplay())]
|
|
830
|
-
* });
|
|
831
|
-
* ```
|
|
832
|
-
* @publicApi
|
|
833
|
-
* @see {@link provideClientHydration}
|
|
834
|
-
*/
|
|
835
655
|
function withEventReplay() {
|
|
836
|
-
|
|
656
|
+
return hydrationFeature(HydrationFeatureKind.EventReplay, _withEventReplay());
|
|
837
657
|
}
|
|
838
|
-
/**
|
|
839
|
-
* Enables support for incremental hydration using the `hydrate` trigger syntax.
|
|
840
|
-
*
|
|
841
|
-
* @usageNotes
|
|
842
|
-
*
|
|
843
|
-
* Basic example of how you can enable incremental hydration in your application when
|
|
844
|
-
* the `bootstrapApplication` function is used:
|
|
845
|
-
* ```ts
|
|
846
|
-
* bootstrapApplication(AppComponent, {
|
|
847
|
-
* providers: [provideClientHydration(withIncrementalHydration())]
|
|
848
|
-
* });
|
|
849
|
-
* ```
|
|
850
|
-
* @publicApi 20.0
|
|
851
|
-
* @see {@link provideClientHydration}
|
|
852
|
-
*/
|
|
853
658
|
function withIncrementalHydration() {
|
|
854
|
-
|
|
855
|
-
}
|
|
856
|
-
/**
|
|
857
|
-
* Returns an `ENVIRONMENT_INITIALIZER` token setup with a function
|
|
858
|
-
* that verifies whether compatible ZoneJS was used in an application
|
|
859
|
-
* and logs a warning in a console if it's not the case.
|
|
860
|
-
*/
|
|
861
|
-
function provideZoneJsCompatibilityDetector() {
|
|
862
|
-
return [
|
|
863
|
-
{
|
|
864
|
-
provide: ENVIRONMENT_INITIALIZER,
|
|
865
|
-
useValue: () => {
|
|
866
|
-
const ngZone = inject(NgZone);
|
|
867
|
-
const isZoneless = inject(_ZONELESS_ENABLED);
|
|
868
|
-
// Checking `ngZone instanceof NgZone` would be insufficient here,
|
|
869
|
-
// because custom implementations might use NgZone as a base class.
|
|
870
|
-
if (!isZoneless && ngZone.constructor !== NgZone) {
|
|
871
|
-
const console = inject(_Console);
|
|
872
|
-
const message = _formatRuntimeError(-5000 /* RuntimeErrorCode.UNSUPPORTED_ZONEJS_INSTANCE */, 'Angular detected that hydration was enabled for an application ' +
|
|
873
|
-
'that uses a custom or a noop Zone.js implementation. ' +
|
|
874
|
-
'This is not yet a fully supported configuration.');
|
|
875
|
-
console.warn(message);
|
|
876
|
-
}
|
|
877
|
-
},
|
|
878
|
-
multi: true,
|
|
879
|
-
},
|
|
880
|
-
];
|
|
659
|
+
return hydrationFeature(HydrationFeatureKind.IncrementalHydration, _withIncrementalHydration());
|
|
881
660
|
}
|
|
882
|
-
/**
|
|
883
|
-
* Returns an `ENVIRONMENT_INITIALIZER` token setup with a function
|
|
884
|
-
* that verifies whether enabledBlocking initial navigation is used in an application
|
|
885
|
-
* and logs a warning in a console if it's not compatible with hydration.
|
|
886
|
-
*/
|
|
887
661
|
function provideEnabledBlockingInitialNavigationDetector() {
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
multi: true,
|
|
903
|
-
},
|
|
904
|
-
];
|
|
662
|
+
return [{
|
|
663
|
+
provide: ENVIRONMENT_INITIALIZER,
|
|
664
|
+
useValue: () => {
|
|
665
|
+
const isEnabledBlockingInitialNavigation = inject(_IS_ENABLED_BLOCKING_INITIAL_NAVIGATION, {
|
|
666
|
+
optional: true
|
|
667
|
+
});
|
|
668
|
+
if (isEnabledBlockingInitialNavigation) {
|
|
669
|
+
const console = inject(_Console);
|
|
670
|
+
const message = _formatRuntimeError(5001, 'Configuration error: found both hydration and enabledBlocking initial navigation ' + 'in the same application, which is a contradiction.');
|
|
671
|
+
console.warn(message);
|
|
672
|
+
}
|
|
673
|
+
},
|
|
674
|
+
multi: true
|
|
675
|
+
}];
|
|
905
676
|
}
|
|
906
|
-
/**
|
|
907
|
-
* Sets up providers necessary to enable hydration functionality for the application.
|
|
908
|
-
*
|
|
909
|
-
* By default, the function enables the recommended set of features for the optimal
|
|
910
|
-
* performance for most of the applications. It includes the following features:
|
|
911
|
-
*
|
|
912
|
-
* * Reconciling DOM hydration. Learn more about it [here](guide/hydration).
|
|
913
|
-
* * [`HttpClient`](api/common/http/HttpClient) response caching while running on the server and
|
|
914
|
-
* transferring this cache to the client to avoid extra HTTP requests. Learn more about data caching
|
|
915
|
-
* [here](guide/ssr#caching-data-when-using-httpclient).
|
|
916
|
-
*
|
|
917
|
-
* These functions allow you to disable some of the default features or enable new ones:
|
|
918
|
-
*
|
|
919
|
-
* * {@link withNoHttpTransferCache} to disable HTTP transfer cache
|
|
920
|
-
* * {@link withHttpTransferCacheOptions} to configure some HTTP transfer cache options
|
|
921
|
-
* * {@link withI18nSupport} to enable hydration support for i18n blocks
|
|
922
|
-
* * {@link withEventReplay} to enable support for replaying user events
|
|
923
|
-
*
|
|
924
|
-
* @usageNotes
|
|
925
|
-
*
|
|
926
|
-
* Basic example of how you can enable hydration in your application when
|
|
927
|
-
* `bootstrapApplication` function is used:
|
|
928
|
-
* ```ts
|
|
929
|
-
* bootstrapApplication(AppComponent, {
|
|
930
|
-
* providers: [provideClientHydration()]
|
|
931
|
-
* });
|
|
932
|
-
* ```
|
|
933
|
-
*
|
|
934
|
-
* Alternatively if you are using NgModules, you would add `provideClientHydration`
|
|
935
|
-
* to your root app module's provider list.
|
|
936
|
-
* ```ts
|
|
937
|
-
* @NgModule({
|
|
938
|
-
* declarations: [RootCmp],
|
|
939
|
-
* bootstrap: [RootCmp],
|
|
940
|
-
* providers: [provideClientHydration()],
|
|
941
|
-
* })
|
|
942
|
-
* export class AppModule {}
|
|
943
|
-
* ```
|
|
944
|
-
*
|
|
945
|
-
* @see {@link withNoHttpTransferCache}
|
|
946
|
-
* @see {@link withHttpTransferCacheOptions}
|
|
947
|
-
* @see {@link withI18nSupport}
|
|
948
|
-
* @see {@link withEventReplay}
|
|
949
|
-
*
|
|
950
|
-
* @param features Optional features to configure additional hydration behaviors.
|
|
951
|
-
* @returns A set of providers to enable hydration.
|
|
952
|
-
*
|
|
953
|
-
* @publicApi 17.0
|
|
954
|
-
*/
|
|
955
677
|
function provideClientHydration(...features) {
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
typeof ngDevMode !== 'undefined' && ngDevMode ? provideZoneJsCompatibilityDetector() : [],
|
|
973
|
-
typeof ngDevMode !== 'undefined' && ngDevMode
|
|
974
|
-
? provideEnabledBlockingInitialNavigationDetector()
|
|
975
|
-
: [],
|
|
976
|
-
_withDomHydration(),
|
|
977
|
-
featuresKind.has(HydrationFeatureKind.NoHttpTransferCache) || hasHttpTransferCacheOptions
|
|
978
|
-
? []
|
|
979
|
-
: _withHttpTransferCache({}),
|
|
980
|
-
providers,
|
|
981
|
-
]);
|
|
678
|
+
const providers = [];
|
|
679
|
+
const featuresKind = new Set();
|
|
680
|
+
for (const {
|
|
681
|
+
ɵproviders,
|
|
682
|
+
ɵkind
|
|
683
|
+
} of features) {
|
|
684
|
+
featuresKind.add(ɵkind);
|
|
685
|
+
if (ɵproviders.length) {
|
|
686
|
+
providers.push(ɵproviders);
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
const hasHttpTransferCacheOptions = featuresKind.has(HydrationFeatureKind.HttpTransferCacheOptions);
|
|
690
|
+
if (typeof ngDevMode !== 'undefined' && ngDevMode && featuresKind.has(HydrationFeatureKind.NoHttpTransferCache) && hasHttpTransferCacheOptions) {
|
|
691
|
+
throw new _RuntimeError(5001, 'Configuration error: found both withHttpTransferCacheOptions() and withNoHttpTransferCache() in the same call to provideClientHydration(), which is a contradiction.');
|
|
692
|
+
}
|
|
693
|
+
return makeEnvironmentProviders([typeof ngDevMode !== 'undefined' && ngDevMode ? provideEnabledBlockingInitialNavigationDetector() : [], _withDomHydration(), featuresKind.has(HydrationFeatureKind.NoHttpTransferCache) || hasHttpTransferCacheOptions ? [] : _withHttpTransferCache({}), providers]);
|
|
982
694
|
}
|
|
983
695
|
|
|
984
|
-
|
|
985
|
-
* @module
|
|
986
|
-
* @description
|
|
987
|
-
* Entry point for all public APIs of the platform-browser package.
|
|
988
|
-
*/
|
|
989
|
-
/**
|
|
990
|
-
* @publicApi
|
|
991
|
-
*/
|
|
992
|
-
const VERSION = new Version('21.0.0-next.0');
|
|
696
|
+
const VERSION = new Version('21.0.0-next.10');
|
|
993
697
|
|
|
994
698
|
export { By, DomSanitizer, EVENT_MANAGER_PLUGINS, EventManagerPlugin, HAMMER_GESTURE_CONFIG, HAMMER_LOADER, HammerGestureConfig, HammerModule, HydrationFeatureKind, Meta, Title, VERSION, disableDebugTools, enableDebugTools, provideClientHydration, withEventReplay, withHttpTransferCacheOptions, withI18nSupport, withIncrementalHydration, withNoHttpTransferCache, DomSanitizerImpl as ɵDomSanitizerImpl, HammerGesturesPlugin as ɵHammerGesturesPlugin };
|
|
995
699
|
//# sourceMappingURL=platform-browser.mjs.map
|