@angular/core 14.2.0-next.1 → 15.0.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.2.0-next.1
2
+ * @license Angular v15.0.0-next.0
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -2569,6 +2569,7 @@ function ɵɵdefineComponent(componentDefinition) {
2569
2569
  setInput: null,
2570
2570
  schemas: componentDefinition.schemas || null,
2571
2571
  tView: null,
2572
+ applyHostDirectives: null,
2572
2573
  };
2573
2574
  const dependencies = componentDefinition.dependencies;
2574
2575
  const feature = componentDefinition.features;
@@ -6091,14 +6092,10 @@ function isDOMParserAvailable() {
6091
6092
  *
6092
6093
  * This regular expression was taken from the Closure sanitization library.
6093
6094
  */
6094
- const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi;
6095
- /* A pattern that matches safe srcset values */
6096
- const SAFE_SRCSET_PATTERN = /^(?:(?:https?|file):|[^&:/?#]*(?:[/?#]|$))/gi;
6097
- /** A pattern that matches safe data URLs. Only matches image, video and audio types. */
6098
- const DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\/]+=*$/i;
6095
+ const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|data|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi;
6099
6096
  function _sanitizeUrl(url) {
6100
6097
  url = String(url);
6101
- if (url.match(SAFE_URL_PATTERN) || url.match(DATA_URL_PATTERN))
6098
+ if (url.match(SAFE_URL_PATTERN))
6102
6099
  return url;
6103
6100
  if (typeof ngDevMode === 'undefined' || ngDevMode) {
6104
6101
  console.warn(`WARNING: sanitizing unsafe URL value ${url} (see https://g.co/ng/security#xss)`);
@@ -7647,7 +7644,7 @@ class Version {
7647
7644
  /**
7648
7645
  * @publicApi
7649
7646
  */
7650
- const VERSION = new Version('14.2.0-next.1');
7647
+ const VERSION = new Version('15.0.0-next.0');
7651
7648
 
7652
7649
  /**
7653
7650
  * @license
@@ -13101,6 +13098,7 @@ function invokeHostBindingsInCreationMode(def, directive) {
13101
13098
  * If a component is matched (at most one), it is returned in first position in the array.
13102
13099
  */
13103
13100
  function findDirectiveDefMatches(tView, viewData, tNode) {
13101
+ var _a;
13104
13102
  ngDevMode && assertFirstCreatePass(tView);
13105
13103
  ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */);
13106
13104
  const registry = tView.directiveRegistry;
@@ -13128,6 +13126,7 @@ function findDirectiveDefMatches(tView, viewData, tNode) {
13128
13126
  else {
13129
13127
  matches.push(def);
13130
13128
  }
13129
+ (_a = def.applyHostDirectives) === null || _a === void 0 ? void 0 : _a.call(def, tView, viewData, tNode, matches);
13131
13130
  }
13132
13131
  }
13133
13132
  }
@@ -14667,6 +14666,54 @@ function ɵɵCopyDefinitionFeature(definition) {
14667
14666
  }
14668
14667
  }
14669
14668
 
14669
+ /**
14670
+ * This feature add the host directives behavior to a directive definition by patching a
14671
+ * function onto it. The expectation is that the runtime will invoke the function during
14672
+ * directive matching.
14673
+ *
14674
+ * For example:
14675
+ * ```ts
14676
+ * class ComponentWithHostDirective {
14677
+ * static ɵcmp = defineComponent({
14678
+ * type: ComponentWithHostDirective,
14679
+ * features: [ɵɵHostDirectivesFeature([
14680
+ * SimpleHostDirective,
14681
+ * {directive: AdvancedHostDirective, inputs: ['foo: alias'], outputs: ['bar']},
14682
+ * ])]
14683
+ * });
14684
+ * }
14685
+ * ```
14686
+ *
14687
+ * @codeGenApi
14688
+ */
14689
+ function ɵɵHostDirectivesFeature(rawHostDirectives) {
14690
+ const unwrappedHostDirectives = Array.isArray(rawHostDirectives) ? rawHostDirectives : rawHostDirectives();
14691
+ const hostDirectives = unwrappedHostDirectives.map(dir => typeof dir === 'function' ? { directive: dir, inputs: EMPTY_OBJ, outputs: EMPTY_OBJ } : {
14692
+ directive: dir.directive,
14693
+ inputs: bindingArrayToMap(dir.inputs),
14694
+ outputs: bindingArrayToMap(dir.outputs)
14695
+ });
14696
+ return (definition) => {
14697
+ // TODO(crisbeto): implement host directive matching logic.
14698
+ definition.applyHostDirectives =
14699
+ (tView, viewData, tNode, matches) => { };
14700
+ };
14701
+ }
14702
+ /**
14703
+ * Converts an array in the form of `['publicName', 'alias', 'otherPublicName', 'otherAlias']` into
14704
+ * a map in the form of `{publicName: 'alias', otherPublicName: 'otherAlias'}`.
14705
+ */
14706
+ function bindingArrayToMap(bindings) {
14707
+ if (!bindings || bindings.length === 0) {
14708
+ return EMPTY_OBJ;
14709
+ }
14710
+ const result = {};
14711
+ for (let i = 1; i < bindings.length; i += 2) {
14712
+ result[bindings[i - 1]] = bindings[i];
14713
+ }
14714
+ return result;
14715
+ }
14716
+
14670
14717
  /**
14671
14718
  * @license
14672
14719
  * Copyright Google LLC All Rights Reserved.
@@ -24269,6 +24316,7 @@ const angularCoreEnv = (() => ({
24269
24316
  'ɵɵinvalidFactoryDep': ɵɵinvalidFactoryDep,
24270
24317
  'ɵɵtemplateRefExtractor': ɵɵtemplateRefExtractor,
24271
24318
  'ɵɵresetView': ɵɵresetView,
24319
+ 'ɵɵHostDirectivesFeature': ɵɵHostDirectivesFeature,
24272
24320
  'ɵɵNgOnChangesFeature': ɵɵNgOnChangesFeature,
24273
24321
  'ɵɵProvidersFeature': ɵɵProvidersFeature,
24274
24322
  'ɵɵCopyDefinitionFeature': ɵɵCopyDefinitionFeature,