@lwc/template-compiler 8.10.1 → 8.12.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.
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { invariant, TemplateErrors, generateCompilerError, CompilerError, normalizeToDiagnostic, generateCompilerDiagnostic, ParserDiagnostics, DiagnosticLevel, CompilerMetrics } from '@lwc/errors';
5
5
  import path from 'path';
6
- import { StringCharAt, hasOwnProperty, getAPIVersionFromNumber, HTML_NAMESPACE, AriaAttrNameToPropNameMap, fromEntries, ArrayFrom, SPECIAL_PROPERTY_ATTRIBUTE_MAPPING, isAPIFeatureEnabled, isBooleanAttribute, isGlobalHtmlAttribute, isAriaAttribute, SVG_NAMESPACE, ID_REFERENCING_ATTRIBUTES_SET, isUndefined, isVoidElement, MATHML_NAMESPACE, isNull, IMPORTANT_FLAG, isArray, ArrayEvery, ArraySome, normalizeStyleAttributeValue, htmlEscape, parseStyleText, LWC_VERSION_COMMENT } from '@lwc/shared';
6
+ import { StringCharAt, hasOwnProperty, getAPIVersionFromNumber, HTML_NAMESPACE, fromEntries, ArrayFrom, SPECIAL_PROPERTY_ATTRIBUTE_MAPPING, AriaAttrNameToPropNameMap, isAPIFeatureEnabled, ID_REFERENCING_ATTRIBUTES_SET, SVG_NAMESPACE, isBooleanAttribute, isGlobalHtmlAttribute, isAriaAttribute, isUndefined, isVoidElement, MATHML_NAMESPACE, isNull, IMPORTANT_FLAG, isArray, ArrayEvery, ArraySome, htmlEscape, normalizeStyleAttributeValue, LWC_VERSION_COMMENT, parseStyleText } from '@lwc/shared';
7
7
  import * as he from 'he';
8
8
  import { parseExpressionAt, isIdentifierStart, isIdentifierChar } from 'acorn';
9
9
  import * as astring from 'astring';
@@ -9601,6 +9601,18 @@ const KNOWN_HTML_AND_SVG_ELEMENTS = new Set([...HTML_ELEMENTS, ...SVG_ELEMENTS])
9601
9601
  const HTML_TAG = {
9602
9602
  A: 'a',
9603
9603
  AREA: 'area',
9604
+ BODY: 'body',
9605
+ CAPTION: 'caption',
9606
+ COL: 'col',
9607
+ COLGROUP: 'colgroup',
9608
+ HEAD: 'head',
9609
+ HTML: 'html',
9610
+ TBODY: 'tbody',
9611
+ TD: 'td',
9612
+ TFOOT: 'tfoot',
9613
+ TH: 'th',
9614
+ THEAD: 'thead',
9615
+ TR: 'tr',
9604
9616
  USE: 'use',
9605
9617
  };
9606
9618
  const ATTR_NAME = {
@@ -12193,9 +12205,12 @@ function parseScopedSlotFragment(ctx, parse5Elm, parse5ElmLocation, parent, pars
12193
12205
  if (ctx.findInCurrentElementScope(isElementDirective)) {
12194
12206
  ctx.throwAtLocation(ParserDiagnostics.SCOPED_SLOTDATA_CANNOT_BE_COMBINED_WITH_OTHER_DIRECTIVE, sourceLocation(parse5ElmLocation));
12195
12207
  }
12208
+ function isComponentOrLwcComponent(node) {
12209
+ return isComponent(node) || isLwcComponent(node);
12210
+ }
12196
12211
  // <template lwc:slot-data> element should always be the direct child of a custom element
12197
12212
  // The only exception is, a conditional block as parent
12198
- const parentCmp = ctx.findAncestor(isComponent, ({ current }) => current && isConditionalBlock(current));
12213
+ const parentCmp = ctx.findAncestor(isComponentOrLwcComponent, ({ current }) => current && isConditionalBlock(current));
12199
12214
  if (!parentCmp) {
12200
12215
  ctx.throwAtLocation(ParserDiagnostics.INVALID_PARENT_OF_LWC_SLOT_DATA, sourceLocation(parse5ElmLocation));
12201
12216
  }
@@ -14670,5 +14685,5 @@ function compile(source, filename, config) {
14670
14685
  }
14671
14686
 
14672
14687
  export { ElementDirectiveName, LWCDirectiveDomMode, LWCDirectiveRenderMode, LwcTagName, RootDirectiveName, TemplateDirectiveName, compile, compile as default, generateScopeTokens, kebabcaseToCamelcase, parse, toPropertyName };
14673
- /** version: 8.10.1 */
14688
+ /** version: 8.12.0 */
14674
14689
  //# sourceMappingURL=index.js.map