@angular/platform-browser 15.2.1 → 16.0.0-next.1
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/animations/index.d.ts +1 -1
- package/esm2020/animations/src/animation_builder.mjs +6 -5
- package/esm2020/animations/src/animation_renderer.mjs +6 -5
- package/esm2020/animations/src/module.mjs +13 -11
- package/esm2020/animations/src/providers.mjs +6 -5
- package/esm2020/src/browser/meta.mjs +6 -5
- package/esm2020/src/browser/title.mjs +6 -5
- package/esm2020/src/browser/transfer_state_module.mjs +28 -0
- package/esm2020/src/browser/xhr.mjs +6 -5
- package/esm2020/src/browser.mjs +7 -6
- package/esm2020/src/dom/dom_renderer.mjs +10 -11
- package/esm2020/src/dom/events/dom_events.mjs +6 -5
- package/esm2020/src/dom/events/event_manager.mjs +6 -5
- package/esm2020/src/dom/events/hammer_gestures.mjs +17 -14
- package/esm2020/src/dom/events/key_events.mjs +6 -5
- package/esm2020/src/dom/shared_styles_host.mjs +11 -9
- package/esm2020/src/platform-browser.mjs +4 -2
- package/esm2020/src/private_export.mjs +2 -3
- package/esm2020/src/security/dom_sanitization_service.mjs +11 -9
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/testing/src/browser.mjs +9 -11
- package/fesm2015/animations.mjs +18 -18
- package/fesm2015/animations.mjs.map +1 -1
- package/fesm2015/platform-browser.mjs +63 -196
- package/fesm2015/platform-browser.mjs.map +1 -1
- package/fesm2015/testing.mjs +7 -19
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2020/animations.mjs +18 -18
- package/fesm2020/animations.mjs.map +1 -1
- package/fesm2020/platform-browser.mjs +63 -196
- package/fesm2020/platform-browser.mjs.map +1 -1
- package/fesm2020/testing.mjs +7 -19
- package/fesm2020/testing.mjs.map +1 -1
- package/index.d.ts +9 -88
- package/package.json +5 -5
- package/testing/index.d.ts +1 -1
- package/esm2020/src/browser/transfer_state.mjs +0 -162
- package/esm2020/testing/src/mock_platform_location_flag.mjs +0 -17
@@ -1,13 +1,14 @@
|
|
1
1
|
/**
|
2
|
-
* @license Angular
|
2
|
+
* @license Angular v16.0.0-next.1
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
4
4
|
* License: MIT
|
5
5
|
*/
|
6
6
|
|
7
|
+
import * as i0 from '@angular/core';
|
8
|
+
import { InjectionToken, ApplicationInitStatus, APP_INITIALIZER, Injector, ɵglobal, Injectable, Inject, ViewEncapsulation, APP_ID, RendererStyleFlags2, ɵinternalCreateApplication, ErrorHandler, ɵsetDocument, PLATFORM_ID, PLATFORM_INITIALIZER, createPlatformFactory, platformCore, ɵTESTABILITY_GETTER, ɵTESTABILITY, Testability, NgZone, TestabilityRegistry, ɵINJECTOR_SCOPE, RendererFactory2, ApplicationModule, NgModule, Optional, SkipSelf, ɵɵinject, ApplicationRef, ɵConsole, forwardRef, ɵXSS_SECURITY_URL, SecurityContext, ɵallowSanitizationBypassAndThrow, ɵunwrapSafeValue, ɵ_sanitizeUrl, ɵ_sanitizeHtml, ɵbypassSanitizationTrustHtml, ɵbypassSanitizationTrustStyle, ɵbypassSanitizationTrustScript, ɵbypassSanitizationTrustUrl, ɵbypassSanitizationTrustResourceUrl, Version } from '@angular/core';
|
9
|
+
export { ɵTransferState as TransferState, ɵmakeStateKey as makeStateKey } from '@angular/core';
|
7
10
|
import { ɵDomAdapter, ɵsetRootDomAdapter, ɵparseCookieValue, ɵgetDOM, DOCUMENT, ɵPLATFORM_BROWSER_ID, XhrFactory, CommonModule } from '@angular/common';
|
8
11
|
export { ɵgetDOM } from '@angular/common';
|
9
|
-
import * as i0 from '@angular/core';
|
10
|
-
import { InjectionToken, ApplicationInitStatus, APP_INITIALIZER, Injector, ɵglobal, Injectable, Inject, ViewEncapsulation, APP_ID, RendererStyleFlags2, ɵinternalCreateApplication, ErrorHandler, ɵsetDocument, PLATFORM_ID, PLATFORM_INITIALIZER, createPlatformFactory, platformCore, ɵTESTABILITY_GETTER, ɵTESTABILITY, Testability, NgZone, TestabilityRegistry, ɵINJECTOR_SCOPE, RendererFactory2, ApplicationModule, NgModule, Optional, SkipSelf, ɵɵinject, ApplicationRef, inject, ɵConsole, forwardRef, ɵXSS_SECURITY_URL, SecurityContext, ɵallowSanitizationBypassAndThrow, ɵunwrapSafeValue, ɵ_sanitizeUrl, ɵ_sanitizeHtml, ɵbypassSanitizationTrustHtml, ɵbypassSanitizationTrustStyle, ɵbypassSanitizationTrustScript, ɵbypassSanitizationTrustUrl, ɵbypassSanitizationTrustResourceUrl, Version } from '@angular/core';
|
11
12
|
|
12
13
|
/**
|
13
14
|
* Provides DOM operations in any browser environment.
|
@@ -190,9 +191,9 @@ class BrowserXhr {
|
|
190
191
|
return new XMLHttpRequest();
|
191
192
|
}
|
192
193
|
}
|
193
|
-
BrowserXhr.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
194
|
-
BrowserXhr.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
195
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
194
|
+
BrowserXhr.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: BrowserXhr, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
195
|
+
BrowserXhr.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: BrowserXhr });
|
196
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: BrowserXhr, decorators: [{
|
196
197
|
type: Injectable
|
197
198
|
}] });
|
198
199
|
|
@@ -268,9 +269,9 @@ class EventManager {
|
|
268
269
|
throw new Error(`No event manager plugin found for event ${eventName}`);
|
269
270
|
}
|
270
271
|
}
|
271
|
-
EventManager.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
272
|
-
EventManager.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
273
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
272
|
+
EventManager.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: EventManager, deps: [{ token: EVENT_MANAGER_PLUGINS }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
273
|
+
EventManager.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: EventManager });
|
274
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: EventManager, decorators: [{
|
274
275
|
type: Injectable
|
275
276
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
276
277
|
type: Inject,
|
@@ -333,9 +334,9 @@ class SharedStylesHost {
|
|
333
334
|
this.usageCount.clear();
|
334
335
|
}
|
335
336
|
}
|
336
|
-
SharedStylesHost.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
337
|
-
SharedStylesHost.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
338
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
337
|
+
SharedStylesHost.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: SharedStylesHost, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
338
|
+
SharedStylesHost.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: SharedStylesHost });
|
339
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: SharedStylesHost, decorators: [{
|
339
340
|
type: Injectable
|
340
341
|
}] });
|
341
342
|
class DomSharedStylesHost extends SharedStylesHost {
|
@@ -391,9 +392,9 @@ class DomSharedStylesHost extends SharedStylesHost {
|
|
391
392
|
hostNodes.add(this.doc.head);
|
392
393
|
}
|
393
394
|
}
|
394
|
-
DomSharedStylesHost.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
395
|
-
DomSharedStylesHost.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
396
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
395
|
+
DomSharedStylesHost.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: DomSharedStylesHost, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
396
|
+
DomSharedStylesHost.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: DomSharedStylesHost });
|
397
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: DomSharedStylesHost, decorators: [{
|
397
398
|
type: Injectable
|
398
399
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
399
400
|
type: Inject,
|
@@ -434,10 +435,8 @@ function shimContentAttribute(componentShortId) {
|
|
434
435
|
function shimHostAttribute(componentShortId) {
|
435
436
|
return HOST_ATTR.replace(COMPONENT_REGEX, componentShortId);
|
436
437
|
}
|
437
|
-
function
|
438
|
-
|
439
|
-
// See: https://github.com/microsoft/TypeScript/issues/32277
|
440
|
-
return styles.flat(100).map(s => s.replace(COMPONENT_REGEX, compId));
|
438
|
+
function shimStylesContent(compId, styles) {
|
439
|
+
return styles.map(s => s.replace(COMPONENT_REGEX, compId));
|
441
440
|
}
|
442
441
|
function decoratePreventDefault(eventHandler) {
|
443
442
|
// `DebugNode.triggerEventHandler` needs to know if the listener was created with
|
@@ -513,9 +512,9 @@ class DomRendererFactory2 {
|
|
513
512
|
begin() { }
|
514
513
|
end() { }
|
515
514
|
}
|
516
|
-
DomRendererFactory2.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
517
|
-
DomRendererFactory2.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
518
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
515
|
+
DomRendererFactory2.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: DomRendererFactory2, deps: [{ token: EventManager }, { token: DomSharedStylesHost }, { token: APP_ID }, { token: REMOVE_STYLES_ON_COMPONENT_DESTROY }], target: i0.ɵɵFactoryTarget.Injectable });
|
516
|
+
DomRendererFactory2.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: DomRendererFactory2 });
|
517
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: DomRendererFactory2, decorators: [{
|
519
518
|
type: Injectable
|
520
519
|
}], ctorParameters: function () { return [{ type: EventManager }, { type: DomSharedStylesHost }, { type: undefined, decorators: [{
|
521
520
|
type: Inject,
|
@@ -670,7 +669,7 @@ class ShadowDomRenderer extends DefaultDomRenderer2 {
|
|
670
669
|
this.hostEl = hostEl;
|
671
670
|
this.shadowRoot = hostEl.attachShadow({ mode: 'open' });
|
672
671
|
this.sharedStylesHost.addHost(this.shadowRoot);
|
673
|
-
const styles =
|
672
|
+
const styles = shimStylesContent(component.id, component.styles);
|
674
673
|
for (const style of styles) {
|
675
674
|
const styleEl = document.createElement('style');
|
676
675
|
styleEl.textContent = style;
|
@@ -702,7 +701,7 @@ class NoneEncapsulationDomRenderer extends DefaultDomRenderer2 {
|
|
702
701
|
this.sharedStylesHost = sharedStylesHost;
|
703
702
|
this.removeStylesOnCompDestory = removeStylesOnCompDestory;
|
704
703
|
this.rendererUsageCount = 0;
|
705
|
-
this.styles =
|
704
|
+
this.styles = shimStylesContent(compId, component.styles);
|
706
705
|
}
|
707
706
|
applyStyles() {
|
708
707
|
this.sharedStylesHost.addStyles(this.styles);
|
@@ -754,9 +753,9 @@ class DomEventsPlugin extends EventManagerPlugin {
|
|
754
753
|
return target.removeEventListener(eventName, callback);
|
755
754
|
}
|
756
755
|
}
|
757
|
-
DomEventsPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
758
|
-
DomEventsPlugin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
759
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
756
|
+
DomEventsPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: DomEventsPlugin, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
757
|
+
DomEventsPlugin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: DomEventsPlugin });
|
758
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: DomEventsPlugin, decorators: [{
|
760
759
|
type: Injectable
|
761
760
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
762
761
|
type: Inject,
|
@@ -933,9 +932,9 @@ class KeyEventsPlugin extends EventManagerPlugin {
|
|
933
932
|
}
|
934
933
|
}
|
935
934
|
}
|
936
|
-
KeyEventsPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
937
|
-
KeyEventsPlugin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
938
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
935
|
+
KeyEventsPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: KeyEventsPlugin, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
936
|
+
KeyEventsPlugin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: KeyEventsPlugin });
|
937
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: KeyEventsPlugin, decorators: [{
|
939
938
|
type: Injectable
|
940
939
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
941
940
|
type: Inject,
|
@@ -1147,13 +1146,13 @@ class BrowserModule {
|
|
1147
1146
|
};
|
1148
1147
|
}
|
1149
1148
|
}
|
1150
|
-
BrowserModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
1151
|
-
BrowserModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
1152
|
-
BrowserModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
1149
|
+
BrowserModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: BrowserModule, deps: [{ token: BROWSER_MODULE_PROVIDERS_MARKER, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
|
1150
|
+
BrowserModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.0-next.1", ngImport: i0, type: BrowserModule, exports: [CommonModule, ApplicationModule] });
|
1151
|
+
BrowserModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: BrowserModule, providers: [
|
1153
1152
|
...BROWSER_MODULE_PROVIDERS,
|
1154
1153
|
...TESTABILITY_PROVIDERS
|
1155
1154
|
], imports: [CommonModule, ApplicationModule] });
|
1156
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
1155
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: BrowserModule, decorators: [{
|
1157
1156
|
type: NgModule,
|
1158
1157
|
args: [{
|
1159
1158
|
providers: [
|
@@ -1327,9 +1326,9 @@ class Meta {
|
|
1327
1326
|
return META_KEYS_MAP[prop] || prop;
|
1328
1327
|
}
|
1329
1328
|
}
|
1330
|
-
Meta.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
1331
|
-
Meta.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
1332
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
1329
|
+
Meta.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: Meta, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
1330
|
+
Meta.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: Meta, providedIn: 'root', useFactory: createMeta, deps: [] });
|
1331
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: Meta, decorators: [{
|
1333
1332
|
type: Injectable,
|
1334
1333
|
args: [{ providedIn: 'root', useFactory: createMeta, deps: [] }]
|
1335
1334
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
@@ -1377,9 +1376,9 @@ class Title {
|
|
1377
1376
|
this._doc.title = newTitle || '';
|
1378
1377
|
}
|
1379
1378
|
}
|
1380
|
-
Title.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
1381
|
-
Title.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
1382
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
1379
|
+
Title.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: Title, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
1380
|
+
Title.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: Title, providedIn: 'root', useFactory: createTitle, deps: [] });
|
1381
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: Title, decorators: [{
|
1383
1382
|
type: Injectable,
|
1384
1383
|
args: [{ providedIn: 'root', useFactory: createTitle, deps: [] }]
|
1385
1384
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
@@ -1502,140 +1501,6 @@ function disableDebugTools() {
|
|
1502
1501
|
exportNgVar(PROFILER_GLOBAL_NAME, null);
|
1503
1502
|
}
|
1504
1503
|
|
1505
|
-
function escapeHtml(text) {
|
1506
|
-
const escapedText = {
|
1507
|
-
'&': '&a;',
|
1508
|
-
'"': '&q;',
|
1509
|
-
'\'': '&s;',
|
1510
|
-
'<': '&l;',
|
1511
|
-
'>': '&g;',
|
1512
|
-
};
|
1513
|
-
return text.replace(/[&"'<>]/g, s => escapedText[s]);
|
1514
|
-
}
|
1515
|
-
function unescapeHtml(text) {
|
1516
|
-
const unescapedText = {
|
1517
|
-
'&a;': '&',
|
1518
|
-
'&q;': '"',
|
1519
|
-
'&s;': '\'',
|
1520
|
-
'&l;': '<',
|
1521
|
-
'&g;': '>',
|
1522
|
-
};
|
1523
|
-
return text.replace(/&[^;]+;/g, s => unescapedText[s]);
|
1524
|
-
}
|
1525
|
-
/**
|
1526
|
-
* Create a `StateKey<T>` that can be used to store value of type T with `TransferState`.
|
1527
|
-
*
|
1528
|
-
* Example:
|
1529
|
-
*
|
1530
|
-
* ```
|
1531
|
-
* const COUNTER_KEY = makeStateKey<number>('counter');
|
1532
|
-
* let value = 10;
|
1533
|
-
*
|
1534
|
-
* transferState.set(COUNTER_KEY, value);
|
1535
|
-
* ```
|
1536
|
-
*
|
1537
|
-
* @publicApi
|
1538
|
-
*/
|
1539
|
-
function makeStateKey(key) {
|
1540
|
-
return key;
|
1541
|
-
}
|
1542
|
-
/**
|
1543
|
-
* A key value store that is transferred from the application on the server side to the application
|
1544
|
-
* on the client side.
|
1545
|
-
*
|
1546
|
-
* The `TransferState` is available as an injectable token.
|
1547
|
-
* On the client, just inject this token using DI and use it, it will be lazily initialized.
|
1548
|
-
* On the server it's already included if `renderApplication` function is used. Otherwise, import
|
1549
|
-
* the `ServerTransferStateModule` module to make the `TransferState` available.
|
1550
|
-
*
|
1551
|
-
* The values in the store are serialized/deserialized using JSON.stringify/JSON.parse. So only
|
1552
|
-
* boolean, number, string, null and non-class objects will be serialized and deserialized in a
|
1553
|
-
* non-lossy manner.
|
1554
|
-
*
|
1555
|
-
* @publicApi
|
1556
|
-
*/
|
1557
|
-
class TransferState {
|
1558
|
-
constructor() {
|
1559
|
-
this.store = {};
|
1560
|
-
this.onSerializeCallbacks = {};
|
1561
|
-
this.store = retrieveTransferredState(inject(DOCUMENT), inject(APP_ID));
|
1562
|
-
}
|
1563
|
-
/**
|
1564
|
-
* Get the value corresponding to a key. Return `defaultValue` if key is not found.
|
1565
|
-
*/
|
1566
|
-
get(key, defaultValue) {
|
1567
|
-
return this.store[key] !== undefined ? this.store[key] : defaultValue;
|
1568
|
-
}
|
1569
|
-
/**
|
1570
|
-
* Set the value corresponding to a key.
|
1571
|
-
*/
|
1572
|
-
set(key, value) {
|
1573
|
-
this.store[key] = value;
|
1574
|
-
}
|
1575
|
-
/**
|
1576
|
-
* Remove a key from the store.
|
1577
|
-
*/
|
1578
|
-
remove(key) {
|
1579
|
-
delete this.store[key];
|
1580
|
-
}
|
1581
|
-
/**
|
1582
|
-
* Test whether a key exists in the store.
|
1583
|
-
*/
|
1584
|
-
hasKey(key) {
|
1585
|
-
return this.store.hasOwnProperty(key);
|
1586
|
-
}
|
1587
|
-
/**
|
1588
|
-
* Indicates whether the state is empty.
|
1589
|
-
*/
|
1590
|
-
get isEmpty() {
|
1591
|
-
return Object.keys(this.store).length === 0;
|
1592
|
-
}
|
1593
|
-
/**
|
1594
|
-
* Register a callback to provide the value for a key when `toJson` is called.
|
1595
|
-
*/
|
1596
|
-
onSerialize(key, callback) {
|
1597
|
-
this.onSerializeCallbacks[key] = callback;
|
1598
|
-
}
|
1599
|
-
/**
|
1600
|
-
* Serialize the current state of the store to JSON.
|
1601
|
-
*/
|
1602
|
-
toJson() {
|
1603
|
-
// Call the onSerialize callbacks and put those values into the store.
|
1604
|
-
for (const key in this.onSerializeCallbacks) {
|
1605
|
-
if (this.onSerializeCallbacks.hasOwnProperty(key)) {
|
1606
|
-
try {
|
1607
|
-
this.store[key] = this.onSerializeCallbacks[key]();
|
1608
|
-
}
|
1609
|
-
catch (e) {
|
1610
|
-
console.warn('Exception in onSerialize callback: ', e);
|
1611
|
-
}
|
1612
|
-
}
|
1613
|
-
}
|
1614
|
-
return JSON.stringify(this.store);
|
1615
|
-
}
|
1616
|
-
}
|
1617
|
-
TransferState.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TransferState, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
1618
|
-
TransferState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TransferState, providedIn: 'root' });
|
1619
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TransferState, decorators: [{
|
1620
|
-
type: Injectable,
|
1621
|
-
args: [{ providedIn: 'root' }]
|
1622
|
-
}], ctorParameters: function () { return []; } });
|
1623
|
-
function retrieveTransferredState(doc, appId) {
|
1624
|
-
// Locate the script tag with the JSON data transferred from the server.
|
1625
|
-
// The id of the script tag is set to the Angular appId + 'state'.
|
1626
|
-
const script = doc.getElementById(appId + '-state');
|
1627
|
-
let initialState = {};
|
1628
|
-
if (script && script.textContent) {
|
1629
|
-
try {
|
1630
|
-
// Avoid using any here as it triggers lint errors in google3 (any is not allowed).
|
1631
|
-
initialState = JSON.parse(unescapeHtml(script.textContent));
|
1632
|
-
}
|
1633
|
-
catch (e) {
|
1634
|
-
console.warn('Exception while restoring TransferState for app ' + appId, e);
|
1635
|
-
}
|
1636
|
-
}
|
1637
|
-
return initialState;
|
1638
|
-
}
|
1639
1504
|
/**
|
1640
1505
|
* NgModule to install on the client side while using the `TransferState` to transfer state from
|
1641
1506
|
* server to client.
|
@@ -1646,10 +1511,10 @@ function retrieveTransferredState(doc, appId) {
|
|
1646
1511
|
*/
|
1647
1512
|
class BrowserTransferStateModule {
|
1648
1513
|
}
|
1649
|
-
BrowserTransferStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
1650
|
-
BrowserTransferStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
1651
|
-
BrowserTransferStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
1652
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
1514
|
+
BrowserTransferStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: BrowserTransferStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
1515
|
+
BrowserTransferStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.0-next.1", ngImport: i0, type: BrowserTransferStateModule });
|
1516
|
+
BrowserTransferStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: BrowserTransferStateModule });
|
1517
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: BrowserTransferStateModule, decorators: [{
|
1653
1518
|
type: NgModule,
|
1654
1519
|
args: [{}]
|
1655
1520
|
}] });
|
@@ -1809,9 +1674,9 @@ class HammerGestureConfig {
|
|
1809
1674
|
return mc;
|
1810
1675
|
}
|
1811
1676
|
}
|
1812
|
-
HammerGestureConfig.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
1813
|
-
HammerGestureConfig.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
1814
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
1677
|
+
HammerGestureConfig.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: HammerGestureConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
1678
|
+
HammerGestureConfig.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: HammerGestureConfig });
|
1679
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: HammerGestureConfig, decorators: [{
|
1815
1680
|
type: Injectable
|
1816
1681
|
}] });
|
1817
1682
|
/**
|
@@ -1907,9 +1772,9 @@ class HammerGesturesPlugin extends EventManagerPlugin {
|
|
1907
1772
|
return this._config.events.indexOf(eventName) > -1;
|
1908
1773
|
}
|
1909
1774
|
}
|
1910
|
-
HammerGesturesPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
1911
|
-
HammerGesturesPlugin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
1912
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
1775
|
+
HammerGesturesPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: HammerGesturesPlugin, deps: [{ token: DOCUMENT }, { token: HAMMER_GESTURE_CONFIG }, { token: i0.ɵConsole }, { token: HAMMER_LOADER, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
1776
|
+
HammerGesturesPlugin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: HammerGesturesPlugin });
|
1777
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: HammerGesturesPlugin, decorators: [{
|
1913
1778
|
type: Injectable
|
1914
1779
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
1915
1780
|
type: Inject,
|
@@ -1936,9 +1801,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImpor
|
|
1936
1801
|
*/
|
1937
1802
|
class HammerModule {
|
1938
1803
|
}
|
1939
|
-
HammerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
1940
|
-
HammerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
1941
|
-
HammerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
1804
|
+
HammerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: HammerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
1805
|
+
HammerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.0-next.1", ngImport: i0, type: HammerModule });
|
1806
|
+
HammerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: HammerModule, providers: [
|
1942
1807
|
{
|
1943
1808
|
provide: EVENT_MANAGER_PLUGINS,
|
1944
1809
|
useClass: HammerGesturesPlugin,
|
@@ -1947,7 +1812,7 @@ HammerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
1947
1812
|
},
|
1948
1813
|
{ provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig, deps: [] },
|
1949
1814
|
] });
|
1950
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
1815
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: HammerModule, decorators: [{
|
1951
1816
|
type: NgModule,
|
1952
1817
|
args: [{
|
1953
1818
|
providers: [
|
@@ -1995,9 +1860,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImpor
|
|
1995
1860
|
*/
|
1996
1861
|
class DomSanitizer {
|
1997
1862
|
}
|
1998
|
-
DomSanitizer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
1999
|
-
DomSanitizer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
2000
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
1863
|
+
DomSanitizer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: DomSanitizer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
1864
|
+
DomSanitizer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: DomSanitizer, providedIn: 'root', useExisting: i0.forwardRef(function () { return DomSanitizerImpl; }) });
|
1865
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: DomSanitizer, decorators: [{
|
2001
1866
|
type: Injectable,
|
2002
1867
|
args: [{ providedIn: 'root', useExisting: forwardRef(() => DomSanitizerImpl) }]
|
2003
1868
|
}] });
|
@@ -2060,9 +1925,9 @@ class DomSanitizerImpl extends DomSanitizer {
|
|
2060
1925
|
return ɵbypassSanitizationTrustResourceUrl(value);
|
2061
1926
|
}
|
2062
1927
|
}
|
2063
|
-
DomSanitizerImpl.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
2064
|
-
DomSanitizerImpl.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
2065
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
1928
|
+
DomSanitizerImpl.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: DomSanitizerImpl, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
1929
|
+
DomSanitizerImpl.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: DomSanitizerImpl, providedIn: 'root', useFactory: domSanitizerImplFactory, deps: [{ token: Injector }] });
|
1930
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.1", ngImport: i0, type: DomSanitizerImpl, decorators: [{
|
2066
1931
|
type: Injectable,
|
2067
1932
|
args: [{ providedIn: 'root', useFactory: domSanitizerImplFactory, deps: [Injector] }]
|
2068
1933
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
@@ -2078,7 +1943,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImpor
|
|
2078
1943
|
/**
|
2079
1944
|
* @publicApi
|
2080
1945
|
*/
|
2081
|
-
const VERSION = new Version('
|
1946
|
+
const VERSION = new Version('16.0.0-next.1');
|
1947
|
+
|
1948
|
+
// Re-export TransferState to the public API of the `platform-browser` for backwards-compatibility.
|
2082
1949
|
|
2083
1950
|
/**
|
2084
1951
|
* @module
|
@@ -2093,5 +1960,5 @@ const VERSION = new Version('15.2.1');
|
|
2093
1960
|
* Generated bundle index. Do not edit.
|
2094
1961
|
*/
|
2095
1962
|
|
2096
|
-
export { BrowserModule, BrowserTransferStateModule, By, DomSanitizer, EVENT_MANAGER_PLUGINS, EventManager, HAMMER_GESTURE_CONFIG, HAMMER_LOADER, HammerGestureConfig, HammerModule, Meta, REMOVE_STYLES_ON_COMPONENT_DESTROY, Title,
|
1963
|
+
export { BrowserModule, BrowserTransferStateModule, By, DomSanitizer, EVENT_MANAGER_PLUGINS, EventManager, HAMMER_GESTURE_CONFIG, HAMMER_LOADER, HammerGestureConfig, HammerModule, Meta, REMOVE_STYLES_ON_COMPONENT_DESTROY, Title, VERSION, bootstrapApplication, createApplication, disableDebugTools, enableDebugTools, platformBrowser, provideProtractorTestingSupport, BrowserDomAdapter as ɵBrowserDomAdapter, BrowserGetTestability as ɵBrowserGetTestability, DomEventsPlugin as ɵDomEventsPlugin, DomRendererFactory2 as ɵDomRendererFactory2, DomSanitizerImpl as ɵDomSanitizerImpl, DomSharedStylesHost as ɵDomSharedStylesHost, HammerGesturesPlugin as ɵHammerGesturesPlugin, INTERNAL_BROWSER_PLATFORM_PROVIDERS as ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS, KeyEventsPlugin as ɵKeyEventsPlugin, NAMESPACE_URIS as ɵNAMESPACE_URIS, SharedStylesHost as ɵSharedStylesHost, TRANSITION_ID as ɵTRANSITION_ID, initDomAdapter as ɵinitDomAdapter, shimContentAttribute as ɵshimContentAttribute, shimHostAttribute as ɵshimHostAttribute, shimStylesContent as ɵshimStyles };
|
2097
1964
|
//# sourceMappingURL=platform-browser.mjs.map
|