@angular/core 15.2.5 → 15.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v15.2.5
2
+ * @license Angular v15.2.7
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -261,7 +261,7 @@ function resetFakeAsyncZone() {
261
261
  *
262
262
  * Can be used to wrap `inject()` calls.
263
263
  *
264
- * @param fn The function that you want to wrap in the `fakeAysnc` zone.
264
+ * @param fn The function that you want to wrap in the `fakeAsync` zone.
265
265
  *
266
266
  * @usageNotes
267
267
  * ### Example
@@ -3494,20 +3494,20 @@ function getNamespace$1() {
3494
3494
  * @param tView The current TView
3495
3495
  */
3496
3496
  function registerPreOrderHooks(directiveIndex, directiveDef, tView) {
3497
+ var _a, _b, _c, _d, _e;
3497
3498
  ngDevMode && assertFirstCreatePass(tView);
3498
3499
  const { ngOnChanges, ngOnInit, ngDoCheck } = directiveDef.type.prototype;
3499
3500
  if (ngOnChanges) {
3500
3501
  const wrappedOnChanges = NgOnChangesFeatureImpl(directiveDef);
3501
- (tView.preOrderHooks || (tView.preOrderHooks = [])).push(directiveIndex, wrappedOnChanges);
3502
- (tView.preOrderCheckHooks || (tView.preOrderCheckHooks = []))
3503
- .push(directiveIndex, wrappedOnChanges);
3502
+ ((_a = tView.preOrderHooks) !== null && _a !== void 0 ? _a : (tView.preOrderHooks = [])).push(directiveIndex, wrappedOnChanges);
3503
+ ((_b = tView.preOrderCheckHooks) !== null && _b !== void 0 ? _b : (tView.preOrderCheckHooks = [])).push(directiveIndex, wrappedOnChanges);
3504
3504
  }
3505
3505
  if (ngOnInit) {
3506
- (tView.preOrderHooks || (tView.preOrderHooks = [])).push(0 - directiveIndex, ngOnInit);
3506
+ ((_c = tView.preOrderHooks) !== null && _c !== void 0 ? _c : (tView.preOrderHooks = [])).push(0 - directiveIndex, ngOnInit);
3507
3507
  }
3508
3508
  if (ngDoCheck) {
3509
- (tView.preOrderHooks || (tView.preOrderHooks = [])).push(directiveIndex, ngDoCheck);
3510
- (tView.preOrderCheckHooks || (tView.preOrderCheckHooks = [])).push(directiveIndex, ngDoCheck);
3509
+ ((_d = tView.preOrderHooks) !== null && _d !== void 0 ? _d : (tView.preOrderHooks = [])).push(directiveIndex, ngDoCheck);
3510
+ ((_e = tView.preOrderCheckHooks) !== null && _e !== void 0 ? _e : (tView.preOrderCheckHooks = [])).push(directiveIndex, ngDoCheck);
3511
3511
  }
3512
3512
  }
3513
3513
  /**
@@ -3529,6 +3529,7 @@ function registerPreOrderHooks(directiveIndex, directiveDef, tView) {
3529
3529
  * @param tNode The TNode whose directives are to be searched for hooks to queue
3530
3530
  */
3531
3531
  function registerPostOrderHooks(tView, tNode) {
3532
+ var _a, _b, _c, _d, _e, _f, _g;
3532
3533
  ngDevMode && assertFirstCreatePass(tView);
3533
3534
  // It's necessary to loop through the directives at elementEnd() (rather than processing in
3534
3535
  // directiveCreate) so we can preserve the current hook order. Content, view, and destroy
@@ -3539,21 +3540,21 @@ function registerPostOrderHooks(tView, tNode) {
3539
3540
  const lifecycleHooks = directiveDef.type.prototype;
3540
3541
  const { ngAfterContentInit, ngAfterContentChecked, ngAfterViewInit, ngAfterViewChecked, ngOnDestroy } = lifecycleHooks;
3541
3542
  if (ngAfterContentInit) {
3542
- (tView.contentHooks || (tView.contentHooks = [])).push(-i, ngAfterContentInit);
3543
+ ((_a = tView.contentHooks) !== null && _a !== void 0 ? _a : (tView.contentHooks = [])).push(-i, ngAfterContentInit);
3543
3544
  }
3544
3545
  if (ngAfterContentChecked) {
3545
- (tView.contentHooks || (tView.contentHooks = [])).push(i, ngAfterContentChecked);
3546
- (tView.contentCheckHooks || (tView.contentCheckHooks = [])).push(i, ngAfterContentChecked);
3546
+ ((_b = tView.contentHooks) !== null && _b !== void 0 ? _b : (tView.contentHooks = [])).push(i, ngAfterContentChecked);
3547
+ ((_c = tView.contentCheckHooks) !== null && _c !== void 0 ? _c : (tView.contentCheckHooks = [])).push(i, ngAfterContentChecked);
3547
3548
  }
3548
3549
  if (ngAfterViewInit) {
3549
- (tView.viewHooks || (tView.viewHooks = [])).push(-i, ngAfterViewInit);
3550
+ ((_d = tView.viewHooks) !== null && _d !== void 0 ? _d : (tView.viewHooks = [])).push(-i, ngAfterViewInit);
3550
3551
  }
3551
3552
  if (ngAfterViewChecked) {
3552
- (tView.viewHooks || (tView.viewHooks = [])).push(i, ngAfterViewChecked);
3553
- (tView.viewCheckHooks || (tView.viewCheckHooks = [])).push(i, ngAfterViewChecked);
3553
+ ((_e = tView.viewHooks) !== null && _e !== void 0 ? _e : (tView.viewHooks = [])).push(i, ngAfterViewChecked);
3554
+ ((_f = tView.viewCheckHooks) !== null && _f !== void 0 ? _f : (tView.viewCheckHooks = [])).push(i, ngAfterViewChecked);
3554
3555
  }
3555
3556
  if (ngOnDestroy != null) {
3556
- (tView.destroyHooks || (tView.destroyHooks = [])).push(i, ngOnDestroy);
3557
+ ((_g = tView.destroyHooks) !== null && _g !== void 0 ? _g : (tView.destroyHooks = [])).push(i, ngOnDestroy);
3557
3558
  }
3558
3559
  }
3559
3560
  }
@@ -7232,13 +7233,14 @@ function isDOMParserAvailable() {
7232
7233
  }
7233
7234
 
7234
7235
  /**
7235
- * A pattern that recognizes a commonly useful subset of URLs that are safe.
7236
+ * A pattern that recognizes URLs that are safe wrt. XSS in URL navigation
7237
+ * contexts.
7236
7238
  *
7237
7239
  * This regular expression matches a subset of URLs that will not cause script
7238
7240
  * execution if used in URL context within a HTML document. Specifically, this
7239
- * regular expression matches if (comment from here on and regex copied from
7240
- * Soy's EscapingConventions):
7241
- * (1) Either an allowed protocol (http, https, mailto or ftp).
7241
+ * regular expression matches if:
7242
+ * (1) Either a protocol that is not javascript:, and that has valid characters
7243
+ * (alphanumeric or [+-.]).
7242
7244
  * (2) or no protocol. A protocol must be followed by a colon. The below
7243
7245
  * allows that by allowing colons only after one of the characters [/?#].
7244
7246
  * A colon after a hash (#) must be in the fragment.
@@ -7257,7 +7259,7 @@ function isDOMParserAvailable() {
7257
7259
  *
7258
7260
  * This regular expression was taken from the Closure sanitization library.
7259
7261
  */
7260
- const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|data|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi;
7262
+ const SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;
7261
7263
  function _sanitizeUrl(url) {
7262
7264
  url = String(url);
7263
7265
  if (url.match(SAFE_URL_PATTERN))
@@ -8695,7 +8697,7 @@ class Version {
8695
8697
  /**
8696
8698
  * @publicApi
8697
8699
  */
8698
- const VERSION = new Version('15.2.5');
8700
+ const VERSION = new Version('15.2.7');
8699
8701
 
8700
8702
  // This default value is when checking the hierarchy for a token.
8701
8703
  //
@@ -11194,6 +11196,7 @@ function resolveDirectives(tView, lView, tNode, localRefs) {
11194
11196
  }
11195
11197
  /** Initializes the data structures necessary for a list of directives to be instantiated. */
11196
11198
  function initializeDirectives(tView, lView, tNode, directives, exportsMap, hostDirectiveDefs) {
11199
+ var _a, _b;
11197
11200
  ngDevMode && assertFirstCreatePass(tView);
11198
11201
  // Publishes the directive types to DI so they can be injected. Needs to
11199
11202
  // happen in a separate pass before the TNode flags have been initialized.
@@ -11236,11 +11239,11 @@ function initializeDirectives(tView, lView, tNode, directives, exportsMap, hostD
11236
11239
  // We will push the actual hook function into this array later during dir instantiation.
11237
11240
  // We cannot do it now because we must ensure hooks are registered in the same
11238
11241
  // order that directives are created (i.e. injection order).
11239
- (tView.preOrderHooks || (tView.preOrderHooks = [])).push(tNode.index);
11242
+ ((_a = tView.preOrderHooks) !== null && _a !== void 0 ? _a : (tView.preOrderHooks = [])).push(tNode.index);
11240
11243
  preOrderHooksFound = true;
11241
11244
  }
11242
11245
  if (!preOrderCheckHooksFound && (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngDoCheck)) {
11243
- (tView.preOrderCheckHooks || (tView.preOrderCheckHooks = [])).push(tNode.index);
11246
+ ((_b = tView.preOrderCheckHooks) !== null && _b !== void 0 ? _b : (tView.preOrderCheckHooks = [])).push(tNode.index);
11244
11247
  preOrderCheckHooksFound = true;
11245
11248
  }
11246
11249
  directiveIdx++;
@@ -11424,10 +11427,11 @@ function findDirectiveDefMatches(tView, tNode) {
11424
11427
  * - storing index of component's host element so it will be queued for view refresh during CD.
11425
11428
  */
11426
11429
  function markAsComponentHost(tView, hostTNode, componentOffset) {
11430
+ var _a;
11427
11431
  ngDevMode && assertFirstCreatePass(tView);
11428
11432
  ngDevMode && assertGreaterThan(componentOffset, -1, 'componentOffset must be great than -1');
11429
11433
  hostTNode.componentOffset = componentOffset;
11430
- (tView.components || (tView.components = [])).push(hostTNode.index);
11434
+ ((_a = tView.components) !== null && _a !== void 0 ? _a : (tView.components = [])).push(hostTNode.index);
11431
11435
  }
11432
11436
  /** Caches local names and their matching directive indices for query and template lookups. */
11433
11437
  function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {
@@ -12525,7 +12529,8 @@ class ComponentRef extends ComponentRef$1 {
12525
12529
  if (inputData !== null && (dataValue = inputData[name])) {
12526
12530
  const lView = this._rootLView;
12527
12531
  setInputsForProperty(lView[TVIEW], lView, dataValue, name, value);
12528
- markDirtyIfOnPush(lView, this._tNode.index);
12532
+ const childComponentLView = getComponentLViewByIndex(this._tNode.index, lView);
12533
+ markViewDirty(childComponentLView);
12529
12534
  }
12530
12535
  else {
12531
12536
  if (ngDevMode) {
@@ -21008,6 +21013,7 @@ function pureFunctionVInternal(lView, bindingRoot, slotOffset, pureFn, exps, thi
21008
21013
  * @codeGenApi
21009
21014
  */
21010
21015
  function ɵɵpipe(index, pipeName) {
21016
+ var _a;
21011
21017
  const tView = getTView();
21012
21018
  let pipeDef;
21013
21019
  const adjustedIndex = index + HEADER_OFFSET;
@@ -21017,7 +21023,7 @@ function ɵɵpipe(index, pipeName) {
21017
21023
  pipeDef = getPipeDef(pipeName, tView.pipeRegistry);
21018
21024
  tView.data[adjustedIndex] = pipeDef;
21019
21025
  if (pipeDef.onDestroy) {
21020
- (tView.destroyHooks || (tView.destroyHooks = [])).push(adjustedIndex, pipeDef.onDestroy);
21026
+ ((_a = tView.destroyHooks) !== null && _a !== void 0 ? _a : (tView.destroyHooks = [])).push(adjustedIndex, pipeDef.onDestroy);
21021
21027
  }
21022
21028
  }
21023
21029
  else {
@@ -21473,7 +21479,7 @@ function createTemplateRef(hostTNode, hostLView) {
21473
21479
  * (created by instantiating a `TemplateRef` with the `createEmbeddedView()` method).
21474
21480
  *
21475
21481
  * A view container instance can contain other view containers,
21476
- * creating a [view hierarchy](guide/glossary#view-tree).
21482
+ * creating a [view hierarchy](guide/glossary#view-hierarchy).
21477
21483
  *
21478
21484
  * @see `ComponentRef`
21479
21485
  * @see `EmbeddedViewRef`