@barefootjs/jsx 0.31.8 → 0.31.9

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.
Files changed (29) hide show
  1. package/dist/index.js +127 -57
  2. package/dist/ir-to-client-js/collect-elements.d.ts.map +1 -1
  3. package/dist/ir-to-client-js/control-flow/stringify/loop-child-arm.d.ts.map +1 -1
  4. package/dist/ir-to-client-js/control-flow/stringify/loop.d.ts.map +1 -1
  5. package/dist/ir-to-client-js/control-flow/stringify/template-parse.d.ts +66 -38
  6. package/dist/ir-to-client-js/control-flow/stringify/template-parse.d.ts.map +1 -1
  7. package/dist/ir-to-client-js/emit-registration.d.ts.map +1 -1
  8. package/dist/ir-to-client-js/html-template.d.ts +15 -1
  9. package/dist/ir-to-client-js/html-template.d.ts.map +1 -1
  10. package/dist/ir-to-client-js/imports.d.ts +2 -2
  11. package/dist/ir-to-client-js/imports.d.ts.map +1 -1
  12. package/package.json +2 -2
  13. package/src/__tests__/__snapshots__/doc-examples.test.ts.snap +210 -210
  14. package/src/__tests__/aliased-destructured-prop-csr.test.ts +8 -2
  15. package/src/__tests__/csr-template-loop-shadowing.test.ts +5 -2
  16. package/src/__tests__/env-signal-template-prelude.test.ts +4 -2
  17. package/src/__tests__/inner-loop-mathml-namespace.test.ts +135 -0
  18. package/src/__tests__/markup-prop-brand.test.ts +161 -0
  19. package/src/__tests__/mathml-mapArray-namespace.test.ts +230 -0
  20. package/src/__tests__/text-slot-escaping.test.ts +21 -12
  21. package/src/ir-to-client-js/collect-elements.ts +38 -5
  22. package/src/ir-to-client-js/control-flow/stringify/inner-loop.ts +10 -10
  23. package/src/ir-to-client-js/control-flow/stringify/loop-child-arm.ts +3 -4
  24. package/src/ir-to-client-js/control-flow/stringify/loop.ts +18 -14
  25. package/src/ir-to-client-js/control-flow/stringify/template-parse.ts +142 -78
  26. package/src/ir-to-client-js/emit-registration.ts +5 -1
  27. package/src/ir-to-client-js/html-template.ts +103 -12
  28. package/src/ir-to-client-js/imports.ts +4 -0
  29. package/src/ir-to-client-js/index.ts +6 -1
package/dist/index.js CHANGED
@@ -3351,8 +3351,8 @@ function templateAttrExpr(attrName, valExpr, presenceOrUndefined) {
3351
3351
  function escapeAttrValueExpr(valExpr) {
3352
3352
  return `escapeAttr(${valExpr})`;
3353
3353
  }
3354
- function escapeTextSlotExpr(innerExpr) {
3355
- return `escapeText(${innerExpr})`;
3354
+ function escapeTextSlotExpr(innerExpr, isMarkup = false) {
3355
+ return `${isMarkup ? "escapeTextOrMarkup" : "escapeText"}(${innerExpr})`;
3356
3356
  }
3357
3357
  function dangerouslyHtmlChildren(attrs, toExpr) {
3358
3358
  const attr = attrs.find((a) => a.name === "dangerouslySetInnerHTML");
@@ -3629,7 +3629,7 @@ function irToHtmlTemplate(node, restSpreadNames, loopDepth = 0, loopParams, bran
3629
3629
  case "jsx-children": {
3630
3630
  const hoistedRecurse = (n) => irToHtmlTemplate(n, restSpreadNames, loopDepth, loopParams, branchSlotsVar, true);
3631
3631
  const childHtml = p.value.children.map((c) => hoistedRecurse(c)).join("");
3632
- return `${quotePropName(p.name)}: \`${childHtml}\``;
3632
+ return p.name === "children" ? `${quotePropName(p.name)}: \`${childHtml}\`` : `${quotePropName(p.name)}: bfMarkup(\`${childHtml}\`)`;
3633
3633
  }
3634
3634
  case "literal":
3635
3635
  return `${quotePropName(p.name)}: ${JSON.stringify(p.value.value)}`;
@@ -3988,6 +3988,9 @@ function irChildrenToJsExpr(children) {
3988
3988
  return exprs[0];
3989
3989
  return `[${exprs.join(", ")}]`;
3990
3990
  }
3991
+ function isSingleElementJsxChildren(nodes) {
3992
+ return nodes.length === 1 && nodes[0].type === "element";
3993
+ }
3991
3994
  function irNodeToJsExprs(node) {
3992
3995
  switch (node.type) {
3993
3996
  case "component": {
@@ -3996,8 +3999,11 @@ function irNodeToJsExprs(node) {
3996
3999
  return `${quotePropName(p.name)}: ${attrValueToString(p.value) ?? "undefined"}`;
3997
4000
  }
3998
4001
  switch (p.value.kind) {
3999
- case "jsx-children":
4000
- return `get ${quotePropName(p.name)}() { return ${irChildrenToJsExpr(p.value.children)} }`;
4002
+ case "jsx-children": {
4003
+ const jsxExpr = irChildrenToJsExpr(p.value.children);
4004
+ const wrapped = p.name !== "children" && isSingleElementJsxChildren(p.value.children) ? `bfMarkup(${jsxExpr})` : jsxExpr;
4005
+ return `get ${quotePropName(p.name)}() { return ${wrapped} }`;
4006
+ }
4001
4007
  case "literal":
4002
4008
  return `get ${quotePropName(p.name)}() { return ${JSON.stringify(p.value.value)} }`;
4003
4009
  case "boolean-shorthand":
@@ -4056,8 +4062,8 @@ function isSingleRootElement(html) {
4056
4062
  const closingPattern = new RegExp(`</${tag}>\\s*$`);
4057
4063
  return closingPattern.test(html.trim());
4058
4064
  }
4059
- function irToComponentTemplate(node, inlinableConstants, restSpreadNames, propsObjectName) {
4060
- return irToComponentTemplateWithOpts(node, { inlinableConstants, restSpreadNames, propsObjectName, loopDepth: -1 });
4065
+ function irToComponentTemplate(node, inlinableConstants, restSpreadNames, propsObjectName, markupSlotIds) {
4066
+ return irToComponentTemplateWithOpts(node, { inlinableConstants, restSpreadNames, propsObjectName, loopDepth: -1, markupSlotIds });
4061
4067
  }
4062
4068
  function irToComponentTemplateWithOpts(node, opts) {
4063
4069
  const { inlinableConstants, restSpreadNames, propsObjectName, loopDepth = 0 } = opts;
@@ -4162,7 +4168,8 @@ function irToComponentTemplateWithOpts(node, opts) {
4162
4168
  const wrapped = transformExpr(node.expr, node.templateExpr);
4163
4169
  const value = node.joinArrayChild ? `Array.isArray(${wrapped}) ? ${wrapped}.join('') : (${wrapped} ?? '')` : wrapped;
4164
4170
  if (node.slotId) {
4165
- return `<!--bf:${node.slotId}-->\${${node.joinArrayChild ? value : escapeTextSlotExpr(wrapped)}}<!--/-->`;
4171
+ const isMarkup = opts.markupSlotIds?.has(node.slotId) ?? false;
4172
+ return `<!--bf:${node.slotId}-->\${${node.joinArrayChild ? value : escapeTextSlotExpr(wrapped, isMarkup)}}<!--/-->`;
4166
4173
  }
4167
4174
  return `\${${value}}`;
4168
4175
  }
@@ -4189,7 +4196,7 @@ function irToComponentTemplateWithOpts(node, opts) {
4189
4196
  case "jsx-children": {
4190
4197
  const hoistedRecurse = (n) => irToComponentTemplateWithOpts(n, { ...opts, inHoistedChildren: true });
4191
4198
  const childHtml = p.value.children.map((c) => hoistedRecurse(c)).join("");
4192
- return `${quotePropName(p.name)}: \`${childHtml}\``;
4199
+ return p.name === "children" ? `${quotePropName(p.name)}: \`${childHtml}\`` : `${quotePropName(p.name)}: bfMarkup(\`${childHtml}\`)`;
4193
4200
  }
4194
4201
  case "literal":
4195
4202
  return `${quotePropName(p.name)}: ${JSON.stringify(p.value.value)}`;
@@ -4310,7 +4317,8 @@ function generateCsrTemplate(node, inlinableConstants, ctx, restSpreadNames, pro
4310
4317
  }
4311
4318
  }
4312
4319
  const effectiveUnsafeLocalNames = mergeCsrNullUnsafe(ctx, unsafeLocalNames);
4313
- return generateCsrTemplateWithOpts(node, { inlinableConstants, restSpreadNames, propsObjectName, csrEnv, unsafeLocalNames: effectiveUnsafeLocalNames, deferredChildSlots, loopDepth: -1 });
4320
+ const markupSlotIds = new Set(ctx.dynamicElements.map((e) => e.slotId));
4321
+ return generateCsrTemplateWithOpts(node, { inlinableConstants, restSpreadNames, propsObjectName, csrEnv, unsafeLocalNames: effectiveUnsafeLocalNames, deferredChildSlots, loopDepth: -1, markupSlotIds });
4314
4322
  }
4315
4323
  function mergeCsrNullUnsafe(ctx, unsafeLocalNames) {
4316
4324
  let merged = null;
@@ -4491,7 +4499,8 @@ function generateCsrTemplateWithOpts(node, opts) {
4491
4499
  const expr = transformed === UNSAFE_TEMPLATE_EXPR ? "''" : transformed;
4492
4500
  const value = node.joinArrayChild ? `Array.isArray(${expr}) ? ${expr}.join('') : (${expr} ?? '')` : expr;
4493
4501
  if (node.slotId) {
4494
- return `<!--bf:${node.slotId}-->\${${node.joinArrayChild ? value : escapeTextSlotExpr(expr)}}<!--/-->`;
4502
+ const isMarkup = opts.markupSlotIds?.has(node.slotId) ?? false;
4503
+ return `<!--bf:${node.slotId}-->\${${node.joinArrayChild ? value : escapeTextSlotExpr(expr, isMarkup)}}<!--/-->`;
4495
4504
  }
4496
4505
  return `\${${value}}`;
4497
4506
  }
@@ -4521,7 +4530,7 @@ function generateCsrTemplateWithOpts(node, opts) {
4521
4530
  case "jsx-children": {
4522
4531
  const hoistedRecurse = (n) => generateCsrTemplateWithOpts(n, { ...opts, inHoistedChildren: true });
4523
4532
  const childHtml = p.value.children.map((c) => hoistedRecurse(c)).join("");
4524
- return `${quotePropName(p.name)}: \`${childHtml}\``;
4533
+ return p.name === "children" ? `${quotePropName(p.name)}: \`${childHtml}\`` : `${quotePropName(p.name)}: bfMarkup(\`${childHtml}\`)`;
4525
4534
  }
4526
4535
  case "literal":
4527
4536
  return `${quotePropName(p.name)}: ${JSON.stringify(p.value.value)}`;
@@ -14585,25 +14594,85 @@ var SVG_ROOT_TAGS = new Set([
14585
14594
  "animateTransform",
14586
14595
  "animateMotion"
14587
14596
  ]);
14588
- function templateRootIsSvg(template) {
14597
+ var MATHML_ROOT_TAGS = new Set([
14598
+ "math",
14599
+ "mrow",
14600
+ "mfrac",
14601
+ "msup",
14602
+ "msub",
14603
+ "msubsup",
14604
+ "mn",
14605
+ "mi",
14606
+ "mo",
14607
+ "mtext",
14608
+ "munder",
14609
+ "mover",
14610
+ "munderover",
14611
+ "mtable",
14612
+ "mtr",
14613
+ "mtd",
14614
+ "msqrt",
14615
+ "mroot",
14616
+ "mstyle",
14617
+ "merror",
14618
+ "mpadded",
14619
+ "mphantom",
14620
+ "menclose",
14621
+ "semantics",
14622
+ "annotation",
14623
+ "annotation-xml"
14624
+ ]);
14625
+ function namespaceForTag(tag) {
14626
+ if (SVG_ROOT_TAGS.has(tag) || SVG_ROOT_TAGS.has(tag.toLowerCase()))
14627
+ return "svg";
14628
+ if (MATHML_ROOT_TAGS.has(tag) || MATHML_ROOT_TAGS.has(tag.toLowerCase()))
14629
+ return "math";
14630
+ return null;
14631
+ }
14632
+ function detectRootNamespaceWrapTag(template) {
14589
14633
  const stripped = stripLeadingNonContent(template);
14590
14634
  const m = stripped.match(/^<\s*([A-Za-z][A-Za-z0-9-]*)/);
14591
- if (m) {
14592
- const tag = m[1];
14593
- if (SVG_ROOT_TAGS.has(tag))
14594
- return true;
14595
- return SVG_ROOT_TAGS.has(tag.toLowerCase());
14596
- }
14635
+ if (m)
14636
+ return namespaceForTag(m[1]);
14597
14637
  const branches = extractConditionalBranchTemplates(stripped);
14598
14638
  if (branches === null || branches.length === 0)
14599
- return false;
14600
- return branches.every(templateRootIsSvg);
14639
+ return null;
14640
+ let result;
14641
+ for (const branch of branches) {
14642
+ const branchNs = detectRootNamespaceWrapTag(branch);
14643
+ if (result === undefined) {
14644
+ result = branchNs;
14645
+ } else if (result !== branchNs) {
14646
+ return null;
14647
+ }
14648
+ }
14649
+ return result ?? null;
14601
14650
  }
14602
- function multiRootTemplateNeedsSvgWrap(template) {
14651
+ function multiRootTemplateNeedsNamespaceWrap(template) {
14603
14652
  const m = stripLeadingNonContent(template).match(/^<\s*([A-Za-z][A-Za-z0-9-]*)/);
14604
- if (m && m[1].toLowerCase() === "svg")
14605
- return false;
14606
- return templateRootIsSvg(template);
14653
+ if (m) {
14654
+ const tagLower = m[1].toLowerCase();
14655
+ if (tagLower === "svg" || tagLower === "math")
14656
+ return null;
14657
+ }
14658
+ return detectRootNamespaceWrapTag(template);
14659
+ }
14660
+ function namespaceWrapForTemplate(template) {
14661
+ const wrapTag = detectRootNamespaceWrapTag(template);
14662
+ return {
14663
+ wrapTag,
14664
+ childPath: wrapTag ? ".firstElementChild.firstElementChild" : ".firstElementChild"
14665
+ };
14666
+ }
14667
+ function multiRootNamespaceWrapForTemplate(template) {
14668
+ const wrapTag = multiRootTemplateNeedsNamespaceWrap(template);
14669
+ return {
14670
+ wrapTag,
14671
+ childPath: wrapTag ? ".firstElementChild" : ""
14672
+ };
14673
+ }
14674
+ function wrapHtmlForNamespace(html, wrapTag) {
14675
+ return wrapTag ? `<${wrapTag}>${html}</${wrapTag}>` : html;
14607
14676
  }
14608
14677
  function stripLeadingNonContent(template) {
14609
14678
  let s = template.trimStart();
@@ -14628,32 +14697,26 @@ function extractConditionalBranchTemplates(template) {
14628
14697
  return findTopLevelTemplateLiterals(expr);
14629
14698
  }
14630
14699
  function emitTemplateCloneInline(template) {
14631
- if (templateRootIsSvg(template)) {
14632
- return `const __tpl = document.createElement('template'); __tpl.innerHTML = \`<svg>${template}</svg>\`; return __tpl.content.firstElementChild.firstElementChild.cloneNode(true)`;
14633
- }
14634
- return `const __tpl = document.createElement('template'); __tpl.innerHTML = \`${template}\`; return __tpl.content.firstElementChild.cloneNode(true)`;
14700
+ const { wrapTag, childPath } = namespaceWrapForTemplate(template);
14701
+ const html = wrapHtmlForNamespace(template, wrapTag);
14702
+ return `const __tpl = document.createElement('template'); __tpl.innerHTML = \`${html}\`; return __tpl.content${childPath}.cloneNode(true)`;
14635
14703
  }
14636
14704
  function emitHoistedTemplateDecl(lines, indent, tplVar, skeletonTemplate) {
14637
- const isSvg = templateRootIsSvg(skeletonTemplate);
14638
- const html = isSvg ? `<svg>${skeletonTemplate}</svg>` : skeletonTemplate;
14705
+ const { wrapTag } = namespaceWrapForTemplate(skeletonTemplate);
14706
+ const html = wrapHtmlForNamespace(skeletonTemplate, wrapTag);
14639
14707
  lines.push(`${indent}const ${tplVar} = document.createElement('template')`);
14640
14708
  lines.push(`${indent}${tplVar}.innerHTML = \`${html}\``);
14641
14709
  }
14642
14710
  function hoistedCloneExpr(tplVar, skeletonTemplate) {
14643
- return templateRootIsSvg(skeletonTemplate) ? `${tplVar}.content.firstElementChild.firstElementChild.cloneNode(true)` : `${tplVar}.content.firstElementChild.cloneNode(true)`;
14711
+ return `${tplVar}.content${namespaceWrapForTemplate(skeletonTemplate).childPath}.cloneNode(true)`;
14644
14712
  }
14645
14713
  function emitTemplateCloneLines(template, indent) {
14646
- if (templateRootIsSvg(template)) {
14647
- return [
14648
- `${indent}const __tpl = document.createElement('template')`,
14649
- `${indent}__tpl.innerHTML = \`<svg>${template}</svg>\``,
14650
- `${indent}return __tpl.content.firstElementChild.firstElementChild.cloneNode(true)`
14651
- ];
14652
- }
14714
+ const { wrapTag, childPath } = namespaceWrapForTemplate(template);
14715
+ const html = wrapHtmlForNamespace(template, wrapTag);
14653
14716
  return [
14654
14717
  `${indent}const __tpl = document.createElement('template')`,
14655
- `${indent}__tpl.innerHTML = \`${template}\``,
14656
- `${indent}return __tpl.content.firstElementChild.cloneNode(true)`
14718
+ `${indent}__tpl.innerHTML = \`${html}\``,
14719
+ `${indent}return __tpl.content${childPath}.cloneNode(true)`
14657
14720
  ];
14658
14721
  }
14659
14722
  function emitLoopItemElementSetup(lines, opts) {
@@ -14685,9 +14748,9 @@ function emitLoopItemElementSetup(lines, opts) {
14685
14748
  lines.push(`${indent}})()${mountRow ? ")" : ""}`);
14686
14749
  }
14687
14750
  function emitMultiRootTemplateCloneLines(template, indent, varEl, varExtras) {
14688
- const isSvg = multiRootTemplateNeedsSvgWrap(template);
14689
- const innerHtmlExpr = isSvg ? `\`<svg>${template}</svg>\`` : `\`${template}\``;
14690
- const parentExpr = isSvg ? `__tpl.content.firstElementChild` : `__tpl.content`;
14751
+ const { wrapTag, childPath } = multiRootNamespaceWrapForTemplate(template);
14752
+ const innerHtmlExpr = `\`${wrapHtmlForNamespace(template, wrapTag)}\``;
14753
+ const parentExpr = `__tpl.content${childPath}`;
14691
14754
  return [
14692
14755
  `${indent}const __tpl = document.createElement('template')`,
14693
14756
  `${indent}__tpl.innerHTML = ${innerHtmlExpr}`,
@@ -14918,6 +14981,9 @@ function jsxChildrenContainComponent(nodes) {
14918
14981
  }
14919
14982
  return false;
14920
14983
  }
14984
+ function isSingleElementJsxChildren2(nodes) {
14985
+ return nodes.length === 1 && nodes[0].type === "element";
14986
+ }
14921
14987
  function buildRestSpreadNames(ctx) {
14922
14988
  const names = new Set;
14923
14989
  if (ctx.restPropsName)
@@ -14954,6 +15020,8 @@ function buildComponentPropsExpr(props, ctx) {
14954
15020
  const jsxExpr = irChildrenToJsExpr(prop.value.children);
14955
15021
  if (jsxChildrenContainComponent(prop.value.children)) {
14956
15022
  propsForInit.push(`get ${quotePropName(prop.name)}() { return __slot(() => ${jsxExpr}) }`);
15023
+ } else if (prop.name !== "children" && isSingleElementJsxChildren2(prop.value.children)) {
15024
+ propsForInit.push(`get ${quotePropName(prop.name)}() { return bfMarkup(${jsxExpr}) }`);
14957
15025
  } else {
14958
15026
  propsForInit.push(`get ${quotePropName(prop.name)}() { return ${jsxExpr} }`);
14959
15027
  }
@@ -15094,7 +15162,7 @@ function collectElements(node, ctx, siblingOffsets, insideConditional = false) {
15094
15162
  reactiveTextSlotIds: new Set(bindings.reactiveTexts.map((t) => t.slotId))
15095
15163
  };
15096
15164
  skeletonTemplate = buildLoopSkeletonTemplate(l.children[0], skeletonSafeSlots) ?? undefined;
15097
- if (skeletonTemplate && !templateRootIsSvg(skeletonTemplate)) {
15165
+ if (skeletonTemplate && !detectRootNamespaceWrapTag(skeletonTemplate)) {
15098
15166
  skeletonPaths = computeSkeletonSlotPaths(l.children[0], skeletonSafeSlots) ?? undefined;
15099
15167
  }
15100
15168
  }
@@ -16013,6 +16081,8 @@ var RUNTIME_IMPORT_CANDIDATES = [
16013
16081
  "escapeAttr",
16014
16082
  "escapeText",
16015
16083
  "escapeTextOrNode",
16084
+ "bfMarkup",
16085
+ "escapeTextOrMarkup",
16016
16086
  "qsa",
16017
16087
  "qsaItem",
16018
16088
  "qsaChildScope",
@@ -17027,7 +17097,8 @@ function emitRegistrationAndHydration(lines, ctx, _ir, graph, inlinability) {
17027
17097
  const isCommentScope = _ir.root.type === "fragment" && _ir.root.needsScopeComment || _ir.root.type === "component";
17028
17098
  const defParts = [`init: init${name}`];
17029
17099
  if (canGenerateStaticTemplate(_ir.root, propNamesForStaticCheck, inlinableConstants, unsafeLocalNames)) {
17030
- const templateHtml = irToComponentTemplate(_ir.root, inlinableConstants, restSpreadNames, ctx.propsObjectName);
17100
+ const markupSlotIds = new Set(ctx.dynamicElements.map((e) => e.slotId));
17101
+ const templateHtml = irToComponentTemplate(_ir.root, inlinableConstants, restSpreadNames, ctx.propsObjectName, markupSlotIds);
17031
17102
  if (templateHtml) {
17032
17103
  defParts.push(buildTemplateDefPart(ctx, templateHtml));
17033
17104
  }
@@ -20279,9 +20350,8 @@ function stringifyBranchInnerLoops(lines, plan, indent, pc) {
20279
20350
  lines.push(`${indent} ${inner.paramUnwrap}`);
20280
20351
  }
20281
20352
  {
20282
- const isSvg = templateRootIsSvg(inner.wrappedTemplate);
20283
- const innerHtml = isSvg ? `<svg>${inner.wrappedTemplate}</svg>` : inner.wrappedTemplate;
20284
- const childPath = isSvg ? ".firstElementChild.firstElementChild" : ".firstElementChild";
20353
+ const { wrapTag, childPath } = namespaceWrapForTemplate(inner.wrappedTemplate);
20354
+ const innerHtml = wrapTag ? `<${wrapTag}>${inner.wrappedTemplate}</${wrapTag}>` : inner.wrappedTemplate;
20285
20355
  lines.push(`${indent} let __bel${uid} = __existing ?? (() => { const __t = document.createElement('template'); __t.innerHTML = \`${innerHtml}\`; return __t.content${childPath}.cloneNode(true) })()`);
20286
20356
  }
20287
20357
  if (inner.wrappedKey) {
@@ -21022,14 +21092,14 @@ function stringifyStaticLoop(lines, plan) {
21022
21092
  lines.push(` let __iterEl = ${containerVar}.children[${childIndexExpr}]`);
21023
21093
  if (csrMaterialize) {
21024
21094
  lines.push(` if (!__iterEl) {`);
21025
- const isSvg = csrMaterialize.bodyIsMultiRoot ? multiRootTemplateNeedsSvgWrap(csrMaterialize.itemTemplate) : templateRootIsSvg(csrMaterialize.itemTemplate);
21026
- const itemHtml = isSvg ? `<svg>${csrMaterialize.itemTemplate}</svg>` : csrMaterialize.itemTemplate;
21095
+ const { wrapTag, childPath } = csrMaterialize.bodyIsMultiRoot ? multiRootNamespaceWrapForTemplate(csrMaterialize.itemTemplate) : namespaceWrapForTemplate(csrMaterialize.itemTemplate);
21096
+ const itemHtml = wrapHtmlForNamespace(csrMaterialize.itemTemplate, wrapTag);
21027
21097
  if (csrMaterialize.bodyIsMultiRoot) {
21028
21098
  lines.push(` const __mtpl = document.createElement('template')`);
21029
21099
  lines.push(` __mtpl.innerHTML = \`${itemHtml}\``);
21030
21100
  lines.push(` const __anchor = ${containerVar}.children[${childIndexExpr}] ?? null`);
21031
21101
  lines.push(` let __first = null`);
21032
- lines.push(` let __sib = __mtpl.content${isSvg ? ".firstElementChild" : ""}.firstElementChild`);
21102
+ lines.push(` let __sib = __mtpl.content${childPath}.firstElementChild`);
21033
21103
  lines.push(` while (__sib) {`);
21034
21104
  lines.push(` const __next = __sib.nextElementSibling`);
21035
21105
  lines.push(` const __cloned = __sib.cloneNode(true)`);
@@ -21041,7 +21111,7 @@ function stringifyStaticLoop(lines, plan) {
21041
21111
  } else {
21042
21112
  lines.push(` const __tpl = document.createElement('template')`);
21043
21113
  lines.push(` __tpl.innerHTML = \`${itemHtml}\``);
21044
- lines.push(` const __cloned = __tpl.content${isSvg ? ".firstElementChild" : ""}.firstElementChild`);
21114
+ lines.push(` const __cloned = __tpl.content${childPath}`);
21045
21115
  lines.push(` if (__cloned) {`);
21046
21116
  lines.push(` const __anchor = ${containerVar}.children[${childIndexExpr}] ?? null`);
21047
21117
  lines.push(` ${containerVar}.insertBefore(__cloned, __anchor)`);
@@ -21111,9 +21181,8 @@ function emitReactive(lines, inner, indent, pc) {
21111
21181
  lines.push(`${innerIndent} __innerEl${uid}.__bfExtras = __innerExtras${uid}`);
21112
21182
  lines.push(`${indent} }`);
21113
21183
  } else {
21114
- const isSvg = templateRootIsSvg(emit.wrappedTemplate);
21115
- const innerHtml = isSvg ? `<svg>${emit.wrappedTemplate}</svg>` : emit.wrappedTemplate;
21116
- const childPath = isSvg ? ".firstElementChild.firstElementChild" : ".firstElementChild";
21184
+ const { wrapTag, childPath } = namespaceWrapForTemplate(emit.wrappedTemplate);
21185
+ const innerHtml = wrapTag ? `<${wrapTag}>${emit.wrappedTemplate}</${wrapTag}>` : emit.wrappedTemplate;
21117
21186
  lines.push(`${indent} let __innerEl${uid} = __existing ?? (() => { const __t = document.createElement('template'); __t.innerHTML = \`${innerHtml}\`; return __t.content${childPath}.cloneNode(true) })()`);
21118
21187
  }
21119
21188
  if (emit.wrappedKey) {
@@ -22440,7 +22509,8 @@ function generateTemplateOnlyMount(ir, ctx) {
22440
22509
  restSpreadNames.add(ctx.propsObjectName);
22441
22510
  let templateHtml;
22442
22511
  if (canGenerateStaticTemplate(ir.root, propNamesForStaticCheck, inlinableConstants, unsafeLocalNames)) {
22443
- templateHtml = irToComponentTemplate(ir.root, inlinableConstants, restSpreadNames, ctx.propsObjectName);
22512
+ const markupSlotIds = new Set(ctx.dynamicElements.map((e) => e.slotId));
22513
+ templateHtml = irToComponentTemplate(ir.root, inlinableConstants, restSpreadNames, ctx.propsObjectName, markupSlotIds);
22444
22514
  }
22445
22515
  if (!templateHtml) {
22446
22516
  const csrInlinableConstants = csrInlinableConstantsFromCtx(ctx);
@@ -1 +1 @@
1
- {"version":3,"file":"collect-elements.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/collect-elements.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAoC,KAAK,MAAM,EAAmC,MAAM,aAAa,CAAA;AACzH,OAAO,KAAK,EAAE,eAAe,EAA+H,iBAAiB,EAA0B,oBAAoB,EAAc,UAAU,EAAE,MAAM,YAAY,CAAA;AA2GvQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CA0C7E;AAyBD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC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EAAE,MAAM,EAAE,CAAC,EACrC,iBAAiB,UAAQ,GACxB,IAAI,CAsSN;AAocD,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,GAAG,EAAE,eAAe,EACpB,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EACrC,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,SAAS,OAAO,aAAa,EAAE,gBAAgB,EAAE,GAAG,SAAS;AAChF;;;;GAIG;AACH,aAAa,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC;AACnC;;;;GAIG;AACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GACxB,iBAAiB,CAenB;AAED,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,eAAe,EACpB,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EACrC,SAAS,CAAC,EAAE,MAAM,EAClB,iBAAiB,CAAC,EAAE,SAAS,OAAO,aAAa,EAAE,gBAAgB,EAAE;AACrE;;;;;;;;GAQG;AACH,aAAa,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC;AACnC;;;GAGG;AACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GACxB,oBAAoB,EAAE,CA2ExB"}
@@ -1 +1 @@
1
- {"version":3,"file":"loop-child-arm.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/stringify/loop-child-arm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AASH,OAAO,KAAK,EACV,6BAA6B,EAC7B,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,wBAAwB,EACzB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEnE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,SAAS,gBAAgB,EAAE,EACjC,MAAM,EAAE,MAAM,EACd,EAAE,CAAC,EAAE,MAAM,GACV,IAAI,CAcN;AAED;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,uBAAuB,EAC7B,MAAM,EAAE,MAAM,GACb,IAAI,CAYN;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,6BAA6B,EACnC,MAAM,EAAE,MAAM,GACb,IAAI,CAIN;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,oBAAoB,EAC1B,MAAM,EAAE,MAAM,EACd,EAAE,CAAC,EAAE,MAAM,GACV,IAAI,CA0DN;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,MAAM,EAAE,EACf,YAAY,EAAE,SAAS,wBAAwB,EAAE,EACjD,MAAM,EAAE,MAAM,EACd,EAAE,CAAC,EAAE,MAAM,GACV,IAAI,CAIN;AA0BD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,EAAE,EACf,GAAG,EAAE,gBAAgB,EACrB,SAAS,EAAE,MAAM,EACjB,EAAE,EAAE,MAAM,GAAG,SAAS,GACrB,IAAI,CAiDN"}
1
+ {"version":3,"file":"loop-child-arm.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/stringify/loop-child-arm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AASH,OAAO,KAAK,EACV,6BAA6B,EAC7B,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,wBAAwB,EACzB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEnE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,SAAS,gBAAgB,EAAE,EACjC,MAAM,EAAE,MAAM,EACd,EAAE,CAAC,EAAE,MAAM,GACV,IAAI,CAcN;AAED;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,uBAAuB,EAC7B,MAAM,EAAE,MAAM,GACb,IAAI,CAYN;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,6BAA6B,EACnC,MAAM,EAAE,MAAM,GACb,IAAI,CAIN;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,oBAAoB,EAC1B,MAAM,EAAE,MAAM,EACd,EAAE,CAAC,EAAE,MAAM,GACV,IAAI,CAyDN;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,MAAM,EAAE,EACf,YAAY,EAAE,SAAS,wBAAwB,EAAE,EACjD,MAAM,EAAE,MAAM,EACd,EAAE,CAAC,EAAE,MAAM,GACV,IAAI,CAIN;AA0BD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,EAAE,EACf,GAAG,EAAE,gBAAgB,EACrB,SAAS,EAAE,MAAM,EACjB,EAAE,EAAE,MAAM,GAAG,SAAS,GACrB,IAAI,CAiDN"}
@@ -1 +1 @@
1
- {"version":3,"file":"loop.d.ts","sourceRoot":"","sources":["../../../../src/ir-to-client-js/control-flow/stringify/loop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAWH,OAAO,KAAK,EAAE,mBAAmB,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEpG;;;;;;;;;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;AAEH;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI,CAoBnE;AAYD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,aAAa,EACnB,SAAS,GAAE,MAAa,GACvB,IAAI,CA+KN;AAoDD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,cAAc,GAAG,IAAI,CAsH/E"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Helpers for emitting code that parses a template literal into a DOM
3
- * element clone, while preserving the SVG namespace when the loop body
4
- * root is an SVG element.
3
+ * element clone, while preserving the SVG/MathML namespace when the loop
4
+ * body root is a foreign-content element.
5
5
  *
6
6
  * Background (#135): the standard pattern
7
7
  * `const __tpl = document.createElement('template')`
@@ -14,60 +14,87 @@
14
14
  * Editor block when a new edge `<path>` was appended via mapArray and
15
15
  * never showed up on the canvas.
16
16
  *
17
- * Fix: when the template's root tag is an SVG element, wrap the parsed
18
- * markup in a synthetic `<svg>` so the HTML5 parser walks into SVG
19
- * foreign content and assigns the correct namespace, then descend one
20
- * extra level to get the real root.
17
+ * Fix: when the template's root tag is an SVG (or, #1096, MathML) element,
18
+ * wrap the parsed markup in the matching synthetic namespace root
19
+ * (`<svg>` / `<math>`) so the HTML5 parser walks into foreign content and
20
+ * assigns the correct namespace, then descend one extra level to get the
21
+ * real root. The two namespaces share every byte of this machinery —
22
+ * only the wrap tag name differs — so `detectRootNamespaceWrapTag` and
23
+ * `namespaceWrapForTemplate` below are the single door every emitter
24
+ * (in this file and its consumers) reads the wrap decision through.
21
25
  */
26
+ /** Namespaces whose root tags need the synthetic-wrap parser nudge. */
27
+ export type NamespaceWrapTag = 'svg' | 'math';
22
28
  /**
23
- * Decide whether a template literal needs SVG-context parsing.
24
- * Looks at the first opening tag in the literal. The check is purely
25
- * lexical so that interpolations inside attribute values do not
26
- * confuse it.
29
+ * Decide whether a template literal needs foreign-content (SVG or MathML)
30
+ * parsing, and which. Looks at the first opening tag in the literal. The
31
+ * check is purely lexical so that interpolations inside attribute values
32
+ * do not confuse it.
27
33
  *
28
34
  * Three shapes are recognised:
29
- * 1. Direct element root — `<circle .../>`
35
+ * 1. Direct element root — `<circle .../>` / `<mrow>...</mrow>`
30
36
  * 2. Conditional body (#1088) — `${cond ? `<circle .../>` : `<rect .../>`}`
31
- * where every result-position template literal starts with an SVG
32
- * tag. The compiler emits this shape for `.map(s => cond ? <a/> : <b/>)`
33
- * bodies; without the wrap the cloned element ends up in the xhtml
34
- * namespace and renders nothing.
37
+ * where every result-position template literal (recursively) resolves
38
+ * to the SAME namespace. The compiler emits this shape for
39
+ * `.map(s => cond ? <a/> : <b/>)` bodies; without the wrap the cloned
40
+ * element ends up in the xhtml namespace and renders nothing.
35
41
  * 3. Reactive-conditional body — a branch wrapped in `<!--bf-cond-start:sX-->`
36
42
  * / `<!--bf-cond-end:sX-->` markers (emitted for nested reactive
37
43
  * conditionals). The check skips leading HTML comments and recurses
38
44
  * into the inner `${...}`.
39
45
  *
40
- * Mixed-namespace branches (one HTML, one SVG) intentionally fall through
41
- * to no-wrap so the user sees the same broken output as before instead of
42
- * a silent over-wrap into a `<foreignObject>`-style mismatch.
46
+ * Mixed-namespace branches (HTML+SVG, HTML+MathML, or SVG+MathML)
47
+ * intentionally fall through to no-wrap so the user sees the same broken
48
+ * output as before instead of a silent over-wrap that would drag one
49
+ * branch into the wrong foreign-content namespace.
43
50
  */
44
- export declare function templateRootIsSvg(template: string): boolean;
51
+ export declare function detectRootNamespaceWrapTag(template: string): NamespaceWrapTag | null;
45
52
  /**
46
53
  * Wrap decision for MULTI-ROOT (fragment) templates, where the synthetic
47
- * `<svg>` wrap swallows every sibling root at once (#2233 Copilot review).
54
+ * namespace wrap swallows every sibling root at once (#2233 Copilot
55
+ * review, generalised to MathML in #1096).
48
56
  *
49
- * `templateRootIsSvg` inspects only the FIRST root tag. For single-root
50
- * templates that's exact, but a fragment whose first root is an `<svg>`
51
- * CONTAINER (`<><svg/><span/></>`) doesn't need the wrap at all — the
52
- * HTML parser enters foreign content at `<svg>` on its own and wrapping
53
- * would drag the HTML siblings into the SVG namespace (`<span>` becomes an
54
- * SVGUnknownElement, silently undrawn). So `<svg>`-first fragments skip
55
- * the wrap; only leaf-rooted fragments (`<line>`, `<circle>`, ...) get it.
57
+ * `detectRootNamespaceWrapTag` inspects only the FIRST root tag. For
58
+ * single-root templates that's exact, but a fragment whose first root is
59
+ * the namespace CONTAINER itself (`<><svg/><span/></>`, `<><math/><span/></>`)
60
+ * doesn't need the wrap at all the HTML parser enters foreign content at
61
+ * `<svg>`/`<math>` on its own and wrapping would drag the HTML siblings
62
+ * into the foreign namespace (`<span>` becomes an SVGUnknownElement/etc.,
63
+ * silently undrawn). So container-first fragments skip the wrap; only
64
+ * leaf-rooted fragments (`<line>`, `<circle>`, `<mrow>`, ...) get it.
56
65
  *
57
- * Known edge (degenerate, pre-existing): an `<svg>`-first fragment with
58
- * SVG-LEAF siblings (`<><svg/><line/></>`) leaves the bare leaf siblings
59
- * in the HTML namespace — exactly the pre-#2219 behavior. Deciding that
60
- * shape correctly needs a scan of every top-level root tag; not worth the
61
- * parser until a real component hits it.
66
+ * Known edge (degenerate, pre-existing): a container-first fragment with
67
+ * LEAF siblings of the same namespace (`<><svg/><line/></>`) leaves the
68
+ * bare leaf siblings in the HTML namespace — exactly the pre-#2219
69
+ * behavior. Deciding that shape correctly needs a scan of every top-level
70
+ * root tag; not worth the parser until a real component hits it.
62
71
  */
63
- export declare function multiRootTemplateNeedsSvgWrap(template: string): boolean;
72
+ export declare function multiRootTemplateNeedsNamespaceWrap(template: string): NamespaceWrapTag | null;
73
+ /**
74
+ * Single door for the "wrap tag + descent path" pair every namespace-aware
75
+ * clone site needs. Consumers outside this file (`inner-loop.ts`,
76
+ * `loop-child-arm.ts`, `loop.ts`) read the wrap decision through this
77
+ * function instead of re-deriving `isSvg ? '<svg>' : ...` locally — keeps
78
+ * the SVG/MathML wrap code path in exactly one place (#1096).
79
+ */
80
+ export declare function namespaceWrapForTemplate(template: string): {
81
+ wrapTag: NamespaceWrapTag | null;
82
+ childPath: string;
83
+ };
84
+ /** `namespaceWrapForTemplate`, but for the multi-root fragment predicate. */
85
+ export declare function multiRootNamespaceWrapForTemplate(template: string): {
86
+ wrapTag: NamespaceWrapTag | null;
87
+ childPath: string;
88
+ };
89
+ /** Wrap `html` in the namespace's synthetic root tag, or return it as-is. */
90
+ export declare function wrapHtmlForNamespace(html: string, wrapTag: NamespaceWrapTag | null): string;
64
91
  /**
65
92
  * Build the inline template-clone expression as one line.
66
93
  *
67
94
  * ` const __tpl = document.createElement('template'); __tpl.innerHTML = \`${template}\`; return __tpl.content.firstElementChild.cloneNode(true) `
68
95
  *
69
- * For SVG roots, the `innerHTML` is wrapped in `<svg>...</svg>` and the
70
- * traversal descends one extra level.
96
+ * For SVG/MathML roots, the `innerHTML` is wrapped in the matching
97
+ * namespace root tag and the traversal descends one extra level.
71
98
  */
72
99
  export declare function emitTemplateCloneInline(template: string): string;
73
100
  /**
@@ -78,9 +105,10 @@ export declare function emitTemplateCloneInline(template: string): string;
78
105
  * STATIC-ONLY skeleton produced by `buildLoopSkeletonTemplate` (dynamic attrs
79
106
  * omitted, text markers empty) — never the per-row interpolated `template`.
80
107
  *
81
- * SVG namespace wrap mirrors `emitTemplateCloneLines` (#135 / #1088):
82
- * `templateRootIsSvg` is re-checked against the skeleton (same root tag as
83
- * the interpolated template, so the same wrap decision applies).
108
+ * Namespace wrap mirrors `emitTemplateCloneLines` (#135 / #1088 / #1096):
109
+ * `detectRootNamespaceWrapTag` is re-checked against the skeleton (same
110
+ * root tag as the interpolated template, so the same wrap decision
111
+ * applies).
84
112
  */
85
113
  export declare function emitHoistedTemplateDecl(lines: string[], indent: string, tplVar: string, skeletonTemplate: string): void;
86
114
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"template-par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E,GAAG,CAAC,MAAM,CAAC,CAAA;CAC9B,CAGA;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,eAAe,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAMtF;AAkDD,4EAA4E;AAC5E;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,MAAM,EAAE,EACf,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,eAAe;AACtB;;;;;;GAMG;AACH,YAAY,CAAC,EAAE;IAAE,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAAE,GACxF,MAAM,CAyFR"}
@@ -323,6 +323,20 @@ export interface TemplateOptions {
323
323
  * the template phase agree on which children defer (dropped-prop fix).
324
324
  */
325
325
  deferredChildSlots?: ReadonlySet<string>;
326
+ /**
327
+ * Slot ids of top-level, non-conditional dynamic expressions
328
+ * (`ctx.dynamicElements`, populated by `collectElements` — the exact set
329
+ * `emit-reactive.ts`'s `emitDynamicTextUpdates` claims `kind: 'markup'`
330
+ * for on the REACTIVE side, #2651). When a text-marker expression's
331
+ * `slotId` is a member, `escapeTextSlotExpr` emits `escapeTextOrMarkup`
332
+ * instead of `escapeText` so a `bfMarkup()`-branded prop value (a JSX
333
+ * element passed at a non-`children` component prop position) reaches
334
+ * the initial-render template raw, matching what the reactive writer
335
+ * already does via `escapeTextOrNode`. Computed once per component from
336
+ * `ctx.dynamicElements` by `irToComponentTemplate` / `generateCsrTemplate`
337
+ * — never re-derived here.
338
+ */
339
+ markupSlotIds?: ReadonlySet<string>;
326
340
  }
327
341
  /**
328
342
  * Generate HTML template for registerTemplate().
@@ -333,7 +347,7 @@ export interface TemplateOptions {
333
347
  * - Local constant references are inlined with their resolved values (#343)
334
348
  * - bf markers ARE included so client code can find elements
335
349
  */
336
- export declare function irToComponentTemplate(node: IRNode, inlinableConstants?: Map<string, string>, restSpreadNames?: Set<string>, propsObjectName?: string | null): string;
350
+ export declare function irToComponentTemplate(node: IRNode, inlinableConstants?: Map<string, string>, restSpreadNames?: Set<string>, propsObjectName?: string | null, markupSlotIds?: ReadonlySet<string>): string;
337
351
  /**
338
352
  * Check if a component can have a simple static template generated.
339
353
  * Returns false if the component has:
@@ -1 +1 @@
1
- {"version":3,"file":"html-template.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/html-template.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAe,MAAM,EAAU,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAG/G,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAG/C,OAAO,EAAwD,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACvG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAIjD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAExD;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI;IACvC,OAAO,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;IAC9B,OAAO,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;CAC/B,CAaA;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAwBnE;AAED;;;;;GAKG;AACH,wBAAgB,kCAAkC,IAAI;IACpD,OAAO,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;IAC9B,OAAO,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;IAC9B,oBAAoB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,MAAM,KAAK,MAAM,CAAA;CAC9F,CAgDA;AAMD,e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