@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
  */
@@ -2568,6 +2568,7 @@ function ɵɵdefineComponent(componentDefinition) {
2568
2568
  setInput: null,
2569
2569
  schemas: componentDefinition.schemas || null,
2570
2570
  tView: null,
2571
+ applyHostDirectives: null,
2571
2572
  };
2572
2573
  const dependencies = componentDefinition.dependencies;
2573
2574
  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
@@ -13126,6 +13123,7 @@ function findDirectiveDefMatches(tView, viewData, tNode) {
13126
13123
  else {
13127
13124
  matches.push(def);
13128
13125
  }
13126
+ def.applyHostDirectives?.(tView, viewData, tNode, matches);
13129
13127
  }
13130
13128
  }
13131
13129
  }
@@ -14665,6 +14663,54 @@ function ɵɵCopyDefinitionFeature(definition) {
14665
14663
  }
14666
14664
  }
14667
14665
 
14666
+ /**
14667
+ * This feature add the host directives behavior to a directive definition by patching a
14668
+ * function onto it. The expectation is that the runtime will invoke the function during
14669
+ * directive matching.
14670
+ *
14671
+ * For example:
14672
+ * ```ts
14673
+ * class ComponentWithHostDirective {
14674
+ * static ɵcmp = defineComponent({
14675
+ * type: ComponentWithHostDirective,
14676
+ * features: [ɵɵHostDirectivesFeature([
14677
+ * SimpleHostDirective,
14678
+ * {directive: AdvancedHostDirective, inputs: ['foo: alias'], outputs: ['bar']},
14679
+ * ])]
14680
+ * });
14681
+ * }
14682
+ * ```
14683
+ *
14684
+ * @codeGenApi
14685
+ */
14686
+ function ɵɵHostDirectivesFeature(rawHostDirectives) {
14687
+ const unwrappedHostDirectives = Array.isArray(rawHostDirectives) ? rawHostDirectives : rawHostDirectives();
14688
+ const hostDirectives = unwrappedHostDirectives.map(dir => typeof dir === 'function' ? { directive: dir, inputs: EMPTY_OBJ, outputs: EMPTY_OBJ } : {
14689
+ directive: dir.directive,
14690
+ inputs: bindingArrayToMap(dir.inputs),
14691
+ outputs: bindingArrayToMap(dir.outputs)
14692
+ });
14693
+ return (definition) => {
14694
+ // TODO(crisbeto): implement host directive matching logic.
14695
+ definition.applyHostDirectives =
14696
+ (tView, viewData, tNode, matches) => { };
14697
+ };
14698
+ }
14699
+ /**
14700
+ * Converts an array in the form of `['publicName', 'alias', 'otherPublicName', 'otherAlias']` into
14701
+ * a map in the form of `{publicName: 'alias', otherPublicName: 'otherAlias'}`.
14702
+ */
14703
+ function bindingArrayToMap(bindings) {
14704
+ if (!bindings || bindings.length === 0) {
14705
+ return EMPTY_OBJ;
14706
+ }
14707
+ const result = {};
14708
+ for (let i = 1; i < bindings.length; i += 2) {
14709
+ result[bindings[i - 1]] = bindings[i];
14710
+ }
14711
+ return result;
14712
+ }
14713
+
14668
14714
  /**
14669
14715
  * @license
14670
14716
  * Copyright Google LLC All Rights Reserved.
@@ -24266,6 +24312,7 @@ const angularCoreEnv = (() => ({
24266
24312
  'ɵɵinvalidFactoryDep': ɵɵinvalidFactoryDep,
24267
24313
  'ɵɵtemplateRefExtractor': ɵɵtemplateRefExtractor,
24268
24314
  'ɵɵresetView': ɵɵresetView,
24315
+ 'ɵɵHostDirectivesFeature': ɵɵHostDirectivesFeature,
24269
24316
  'ɵɵNgOnChangesFeature': ɵɵNgOnChangesFeature,
24270
24317
  'ɵɵProvidersFeature': ɵɵProvidersFeature,
24271
24318
  'ɵɵCopyDefinitionFeature': ɵɵCopyDefinitionFeature,