@wevu/compiler 6.16.9 → 6.16.10

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 (2) hide show
  1. package/dist/index.mjs +6 -5
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -6587,8 +6587,12 @@ function hasDirectComponentSlotChild(children, context) {
6587
6587
  return /^[A-Z]/.test(child.tag);
6588
6588
  });
6589
6589
  }
6590
- function shouldAugmentPlainDefaultSlot(decl, context) {
6590
+ function isWevuComponentTag(node, context) {
6591
+ return context.wevuComponentTags ? context.wevuComponentTags.has(node.tag) : /^[A-Z]/.test(node.tag);
6592
+ }
6593
+ function shouldAugmentPlainDefaultSlot(decl, context, ownerNode) {
6591
6594
  if (context.scopedSlotsRequireProps || !decl.implicitDefault) return false;
6595
+ if (context.rewriteScopedSlot && !isWevuComponentTag(ownerNode, context)) return false;
6592
6596
  if (context.scopedSlotsCompiler === "augmented") return true;
6593
6597
  return hasDirectComponentSlotChild(decl.children, context);
6594
6598
  }
@@ -6628,9 +6632,6 @@ function pushSlotNamesAttr(attrs, slotNames, context) {
6628
6632
  function shouldExposePlainSlotPresence(node) {
6629
6633
  return node.tag === "component";
6630
6634
  }
6631
- function isWevuComponentTag(node, context) {
6632
- return context.wevuComponentTags ? context.wevuComponentTags.has(node.tag) : /^[A-Z]/.test(node.tag);
6633
- }
6634
6635
  function shouldTransformAsComponentWithSlots(node, context, resolvedTag = resolveTemplateTagName(node.tag, context)) {
6635
6636
  const slotDirective = findSlotDirective(node);
6636
6637
  const templateSlotChildren = node.children.filter((child) => child.type === NodeTypes.ELEMENT && child.tag === "template" && findSlotDirective(child));
@@ -6679,7 +6680,7 @@ function transformComponentWithSlots(node, context, transformNode, options) {
6679
6680
  }
6680
6681
  const scopedSlotDeclarations = [];
6681
6682
  const plainSlotDeclarations = [];
6682
- for (const decl of slotDeclarations) if (Object.keys(decl.props).length > 0 || shouldAugmentPlainDefaultSlot(decl, context)) scopedSlotDeclarations.push(decl);
6683
+ for (const decl of slotDeclarations) if (Object.keys(decl.props).length > 0 || shouldAugmentPlainDefaultSlot(decl, context, node)) scopedSlotDeclarations.push(decl);
6683
6684
  else plainSlotDeclarations.push(decl);
6684
6685
  const slotNames = [];
6685
6686
  const slotGenericAttrs = [];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wevu/compiler",
3
3
  "type": "module",
4
- "version": "6.16.9",
4
+ "version": "6.16.10",
5
5
  "description": "wevu 编译器基础包,面向小程序模板的编译与转换",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -52,7 +52,7 @@
52
52
  "vue": "^3.5.34",
53
53
  "@weapp-core/constants": "^0.1.6",
54
54
  "@weapp-core/shared": "3.0.4",
55
- "@weapp-vite/ast": "6.16.9",
55
+ "@weapp-vite/ast": "6.16.10",
56
56
  "rolldown-require": "2.0.15"
57
57
  },
58
58
  "publishConfig": {