@lwc/template-compiler 9.0.3 → 9.0.4-alpha.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.cjs CHANGED
@@ -10609,8 +10609,7 @@ function parseExpression(ctx, source, location, unquotedAttributeExpression) {
10609
10609
  }, errors.ParserDiagnostics.TEMPLATE_EXPRESSION_PARSING_ERROR, location, (err) => `Invalid expression ${source} - ${err.message}`);
10610
10610
  }
10611
10611
  function parseIdentifier(ctx, source, location) {
10612
- let isValid = true;
10613
- isValid = acorn.isIdentifierStart(source.charCodeAt(0));
10612
+ let isValid = acorn.isIdentifierStart(source.charCodeAt(0));
10614
10613
  for (let i = 1; i < source.length && isValid; i++) {
10615
10614
  isValid = acorn.isIdentifierChar(source.charCodeAt(i));
10616
10615
  }
@@ -10759,7 +10758,7 @@ const HTML_ELEMENT_ATTRIBUTE_MAP = {
10759
10758
  colgroup: ['align', 'char', 'charoff', 'span', 'valign', 'width'],
10760
10759
  data: ['value'],
10761
10760
  del: ['cite', 'datetime'],
10762
- details: ['open'],
10761
+ details: ['name', 'open'],
10763
10762
  dialog: ['open'],
10764
10763
  dir: ['compact'],
10765
10764
  div: ['align'],
@@ -12527,9 +12526,8 @@ function shouldAddCustomRenderer(element, state) {
12527
12526
  }
12528
12527
  const { attributes, directives } = element;
12529
12528
  if (directives.length) {
12530
- let directiveMatched = false;
12531
12529
  // If any directives require custom renderer
12532
- directiveMatched = directives.some((dir) => {
12530
+ const directiveMatched = directives.some((dir) => {
12533
12531
  return state.crDirectives.has(ElementDirectiveName[dir.name]);
12534
12532
  });
12535
12533
  if (directiveMatched) {
@@ -13764,7 +13762,7 @@ class CodeGen {
13764
13762
  // then static IDs/IDrefs/fragment refs will be rendered directly into HTML strings.
13765
13763
  const needsScoping = this.isSyntheticShadow && (isIdOrIdRef || isScopedFragmentRef);
13766
13764
  if (isExpression$1(value) || isSvgHref || needsScoping) {
13767
- let partToken = '';
13765
+ let partToken;
13768
13766
  if (name === 'style') {
13769
13767
  partToken = `${"s" /* STATIC_PART_TOKEN_ID.STYLE */}${partId}`;
13770
13768
  databag.push(property$1(identifier('style'), this.bindExpression(value)));
@@ -14578,5 +14576,5 @@ exports.generateScopeTokens = generateScopeTokens;
14578
14576
  exports.kebabcaseToCamelcase = kebabcaseToCamelcase;
14579
14577
  exports.parse = parse;
14580
14578
  exports.toPropertyName = toPropertyName;
14581
- /** version: 9.0.3 */
14579
+ /** version: 9.0.4-alpha.0 */
14582
14580
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -10586,8 +10586,7 @@ function parseExpression(ctx, source, location, unquotedAttributeExpression) {
10586
10586
  }, ParserDiagnostics.TEMPLATE_EXPRESSION_PARSING_ERROR, location, (err) => `Invalid expression ${source} - ${err.message}`);
10587
10587
  }
10588
10588
  function parseIdentifier(ctx, source, location) {
10589
- let isValid = true;
10590
- isValid = isIdentifierStart(source.charCodeAt(0));
10589
+ let isValid = isIdentifierStart(source.charCodeAt(0));
10591
10590
  for (let i = 1; i < source.length && isValid; i++) {
10592
10591
  isValid = isIdentifierChar(source.charCodeAt(i));
10593
10592
  }
@@ -10736,7 +10735,7 @@ const HTML_ELEMENT_ATTRIBUTE_MAP = {
10736
10735
  colgroup: ['align', 'char', 'charoff', 'span', 'valign', 'width'],
10737
10736
  data: ['value'],
10738
10737
  del: ['cite', 'datetime'],
10739
- details: ['open'],
10738
+ details: ['name', 'open'],
10740
10739
  dialog: ['open'],
10741
10740
  dir: ['compact'],
10742
10741
  div: ['align'],
@@ -12504,9 +12503,8 @@ function shouldAddCustomRenderer(element, state) {
12504
12503
  }
12505
12504
  const { attributes, directives } = element;
12506
12505
  if (directives.length) {
12507
- let directiveMatched = false;
12508
12506
  // If any directives require custom renderer
12509
- directiveMatched = directives.some((dir) => {
12507
+ const directiveMatched = directives.some((dir) => {
12510
12508
  return state.crDirectives.has(ElementDirectiveName[dir.name]);
12511
12509
  });
12512
12510
  if (directiveMatched) {
@@ -13741,7 +13739,7 @@ class CodeGen {
13741
13739
  // then static IDs/IDrefs/fragment refs will be rendered directly into HTML strings.
13742
13740
  const needsScoping = this.isSyntheticShadow && (isIdOrIdRef || isScopedFragmentRef);
13743
13741
  if (isExpression$1(value) || isSvgHref || needsScoping) {
13744
- let partToken = '';
13742
+ let partToken;
13745
13743
  if (name === 'style') {
13746
13744
  partToken = `${"s" /* STATIC_PART_TOKEN_ID.STYLE */}${partId}`;
13747
13745
  databag.push(property$1(identifier('style'), this.bindExpression(value)));
@@ -14543,5 +14541,5 @@ function compile(source, filename, config) {
14543
14541
  }
14544
14542
 
14545
14543
  export { ElementDirectiveName, LWCDirectiveDomMode, LWCDirectiveRenderMode, LwcTagName, RootDirectiveName, TemplateDirectiveName, bindExpression, compile, compile as default, generateScopeTokens, kebabcaseToCamelcase, parse, toPropertyName };
14546
- /** version: 9.0.3 */
14544
+ /** version: 9.0.4-alpha.0 */
14547
14545
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "You can safely modify dependencies, devDependencies, keywords, etc., but other props will be overwritten."
5
5
  ],
6
6
  "name": "@lwc/template-compiler",
7
- "version": "9.0.3",
7
+ "version": "9.0.4-alpha.0",
8
8
  "description": "Template compiler package",
9
9
  "keywords": [
10
10
  "lwc"
@@ -51,8 +51,8 @@
51
51
  }
52
52
  },
53
53
  "dependencies": {
54
- "@lwc/errors": "9.0.3",
55
- "@lwc/shared": "9.0.3",
54
+ "@lwc/errors": "9.0.4-alpha.0",
55
+ "@lwc/shared": "9.0.4-alpha.0",
56
56
  "acorn": "~8.16.0",
57
57
  "astring": "~1.9.0",
58
58
  "he": "~1.2.0"