@angular/core 14.0.0-next.10 → 14.0.0-next.11

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 v14.0.0-next.10
2
+ * @license Angular v14.0.0-next.11
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
package/fesm2020/core.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.0.0-next.10
2
+ * @license Angular v14.0.0-next.11
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -10273,7 +10273,7 @@ function elementPropertyInternal(tView, tNode, lView, propName, value, renderer,
10273
10273
  else if (tNode.type & 12 /* AnyContainer */) {
10274
10274
  // If the node is a container and the property didn't
10275
10275
  // match any of the inputs or schemas we should throw.
10276
- if (ngDevMode && !matchingSchemas(tView, tNode.value)) {
10276
+ if (ngDevMode && !matchingSchemas(tView.schemas, tNode.value)) {
10277
10277
  logUnknownPropertyError(propName, tNode);
10278
10278
  }
10279
10279
  }
@@ -10335,15 +10335,20 @@ function validateProperty(tView, element, propName, tNode) {
10335
10335
  return true;
10336
10336
  // The property is considered valid if the element matches the schema, it exists on the element
10337
10337
  // or it is synthetic, and we are in a browser context (web worker nodes should be skipped).
10338
- if (matchingSchemas(tView, tNode.value) || propName in element || isAnimationProp(propName)) {
10338
+ if (matchingSchemas(tView.schemas, tNode.value) || propName in element ||
10339
+ isAnimationProp(propName)) {
10339
10340
  return true;
10340
10341
  }
10341
10342
  // Note: `typeof Node` returns 'function' in most browsers, but on IE it is 'object' so we
10342
10343
  // need to account for both here, while being careful for `typeof null` also returning 'object'.
10343
10344
  return typeof Node === 'undefined' || Node === null || !(element instanceof Node);
10344
10345
  }
10345
- function matchingSchemas(tView, tagName) {
10346
- const schemas = tView.schemas;
10346
+ /**
10347
+ * Returns true if the tag name is allowed by specified schemas.
10348
+ * @param schemas Array of schemas
10349
+ * @param tagName Name of the tag
10350
+ */
10351
+ function matchingSchemas(schemas, tagName) {
10347
10352
  if (schemas !== null) {
10348
10353
  for (let i = 0; i < schemas.length; i++) {
10349
10354
  const schema = schemas[i];
@@ -14637,7 +14642,7 @@ function elementStartFirstCreatePass(index, tView, lView, native, name, attrsInd
14637
14642
  const attrs = getConstant(tViewConsts, attrsIndex);
14638
14643
  const tNode = getOrCreateTNode(tView, index, 2 /* Element */, name, attrs);
14639
14644
  const hasDirectives = resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));
14640
- ngDevMode && logUnknownElementError(tView, native, tNode, hasDirectives);
14645
+ ngDevMode && validateElementIsKnown(native, tNode.value, tView.schemas, hasDirectives);
14641
14646
  if (tNode.attrs !== null) {
14642
14647
  computeStaticStyling(tNode, tNode.attrs, false);
14643
14648
  }
@@ -14761,18 +14766,33 @@ function ɵɵelement(index, name, attrsIndex, localRefsIndex) {
14761
14766
  ɵɵelementEnd();
14762
14767
  return ɵɵelement;
14763
14768
  }
14764
- function logUnknownElementError(tView, element, tNode, hasDirectives) {
14765
- const schemas = tView.schemas;
14769
+ /**
14770
+ * Validates that the element is known at runtime and produces
14771
+ * an error if it's not the case.
14772
+ * This check is relevant for JIT-compiled components (for AOT-compiled
14773
+ * ones this check happens at build time).
14774
+ *
14775
+ * The element is considered known if either:
14776
+ * - it's a known HTML element
14777
+ * - it's a known custom element
14778
+ * - the element matches any directive
14779
+ * - the element is allowed by one of the schemas
14780
+ *
14781
+ * @param element Element to validate
14782
+ * @param tagName Name of the tag to check
14783
+ * @param schemas Array of schemas
14784
+ * @param hasDirectives Boolean indicating that the element matches any directive
14785
+ */
14786
+ function validateElementIsKnown(element, tagName, schemas, hasDirectives) {
14766
14787
  // If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT
14767
14788
  // mode where this check happens at compile time. In JIT mode, `schemas` is always present and
14768
14789
  // defined as an array (as an empty array in case `schemas` field is not defined) and we should
14769
14790
  // execute the check below.
14770
14791
  if (schemas === null)
14771
14792
  return;
14772
- const tagName = tNode.value;
14773
14793
  // If the element matches any directive, it's considered as valid.
14774
14794
  if (!hasDirectives && tagName !== null) {
14775
- // The element is unknown if it's an instance of HTMLUnknownElement or it isn't registered
14795
+ // The element is unknown if it's an instance of HTMLUnknownElement, or it isn't registered
14776
14796
  // as a custom element. Note that unknown elements with a dash in their name won't be instances
14777
14797
  // of HTMLUnknownElement in browsers that support web components.
14778
14798
  const isUnknown =
@@ -14782,7 +14802,7 @@ function logUnknownElementError(tView, element, tNode, hasDirectives) {
14782
14802
  element instanceof HTMLUnknownElement) ||
14783
14803
  (typeof customElements !== 'undefined' && tagName.indexOf('-') > -1 &&
14784
14804
  !customElements.get(tagName));
14785
- if (isUnknown && !matchingSchemas(tView, tagName)) {
14805
+ if (isUnknown && !matchingSchemas(schemas, tagName)) {
14786
14806
  let message = `'${tagName}' is not a known element:\n`;
14787
14807
  message += `1. If '${tagName}' is an Angular component, then verify that it is part of this module.\n`;
14788
14808
  if (tagName && tagName.indexOf('-') > -1) {
@@ -21252,7 +21272,7 @@ class Version {
21252
21272
  /**
21253
21273
  * @publicApi
21254
21274
  */
21255
- const VERSION = new Version('14.0.0-next.10');
21275
+ const VERSION = new Version('14.0.0-next.11');
21256
21276
 
21257
21277
  /**
21258
21278
  * @license