@vue-jsx-vapor/compiler 2.1.4 → 2.1.6

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
@@ -1591,35 +1591,36 @@ function createSlotBlock(slotNode, dir, context) {
1591
1591
 
1592
1592
  // src/transforms/vSlots.ts
1593
1593
 
1594
- var transformVSlots = (node, context) => {
1595
- if (node.type !== "JSXElement" || !isJSXComponent(node)) return;
1596
- const {
1597
- openingElement: { attributes },
1598
- children
1599
- } = node;
1600
- const vSlotsIndex = attributes.findIndex(
1601
- (attr) => attr.type === "JSXAttribute" && attr.name.name.toString() === "v-slots"
1602
- );
1603
- const vSlotsDir = attributes[vSlotsIndex];
1604
- if (vSlotsDir && _optionalChain([vSlotsDir, 'access', _13 => _13.value, 'optionalAccess', _14 => _14.type]) === "JSXExpressionContainer") {
1605
- attributes.splice(vSlotsIndex, 1);
1594
+ var transformVSlots = (dir, node, context) => {
1595
+ if (!isJSXComponent(node)) return;
1596
+ if (_optionalChain([dir, 'access', _13 => _13.value, 'optionalAccess', _14 => _14.type]) === "JSXExpressionContainer") {
1606
1597
  context.slots = [
1607
1598
  {
1608
1599
  slotType: 4 /* EXPRESSION */,
1609
- slots: resolveExpression(vSlotsDir.value.expression, context)
1600
+ slots: resolveExpression(dir.value.expression, context)
1610
1601
  }
1611
1602
  ];
1612
- if (children.length) {
1603
+ if (node.children.length) {
1613
1604
  context.options.onError(
1614
1605
  _compilerdom.createCompilerError.call(void 0,
1615
1606
  _compilerdom.ErrorCodes.X_V_SLOT_MIXED_SLOT_USAGE,
1616
- resolveLocation(children[0].loc, context)
1607
+ resolveLocation(node.children[0].loc, context)
1617
1608
  )
1618
1609
  );
1619
1610
  }
1620
1611
  }
1621
1612
  };
1622
1613
 
1614
+ // src/transforms/vText.ts
1615
+
1616
+ var transformVText = (dir, node, context) => {
1617
+ return _compilervapor.transformVText.call(void 0,
1618
+ resolveDirectiveNode(dir, context),
1619
+ resolveNode(node, context),
1620
+ context
1621
+ );
1622
+ };
1623
+
1623
1624
  // src/compile.ts
1624
1625
  function compile(source, options = {}) {
1625
1626
  const resolvedOptions = _shared.extend.call(void 0, {}, options, {
@@ -1680,7 +1681,6 @@ function getBaseTransformPreset() {
1680
1681
  transformTemplateRef,
1681
1682
  transformText,
1682
1683
  transformElement,
1683
- transformVSlots,
1684
1684
  transformVSlot,
1685
1685
  transformChildren
1686
1686
  ],
@@ -1689,21 +1689,13 @@ function getBaseTransformPreset() {
1689
1689
  on: transformVOn,
1690
1690
  model: transformVModel,
1691
1691
  show: transformVShow,
1692
- html: transformVHtml
1692
+ html: transformVHtml,
1693
+ text: transformVText,
1694
+ slots: transformVSlots
1693
1695
  }
1694
1696
  ];
1695
1697
  }
1696
1698
 
1697
- // src/transforms/vText.ts
1698
-
1699
- var transformVText = (dir, node, context) => {
1700
- return _compilervapor.transformVText.call(void 0,
1701
- resolveDirectiveNode(dir, context),
1702
- resolveNode(node, context),
1703
- context
1704
- );
1705
- };
1706
-
1707
1699
 
1708
1700
 
1709
1701
 
package/dist/index.d.cts CHANGED
@@ -12,6 +12,7 @@ interface DirectiveTransformResult {
12
12
  modifier?: '.' | '^';
13
13
  runtimeCamelize?: boolean;
14
14
  handler?: boolean;
15
+ handlerModifiers?: SetEventIRNode['modifiers'];
15
16
  model?: boolean;
16
17
  modelModifiers?: string[];
17
18
  }
@@ -361,7 +362,7 @@ declare const transformVOn: DirectiveTransform;
361
362
 
362
363
  declare const transformVSlot: NodeTransform;
363
364
 
364
- declare const transformVSlots: NodeTransform;
365
+ declare const transformVSlots: DirectiveTransform;
365
366
 
366
367
  declare const transformVModel: DirectiveTransform;
367
368
 
package/dist/index.d.ts CHANGED
@@ -12,6 +12,7 @@ interface DirectiveTransformResult {
12
12
  modifier?: '.' | '^';
13
13
  runtimeCamelize?: boolean;
14
14
  handler?: boolean;
15
+ handlerModifiers?: SetEventIRNode['modifiers'];
15
16
  model?: boolean;
16
17
  modelModifiers?: string[];
17
18
  }
@@ -361,7 +362,7 @@ declare const transformVOn: DirectiveTransform;
361
362
 
362
363
  declare const transformVSlot: NodeTransform;
363
364
 
364
- declare const transformVSlots: NodeTransform;
365
+ declare const transformVSlots: DirectiveTransform;
365
366
 
366
367
  declare const transformVModel: DirectiveTransform;
367
368
 
package/dist/index.js CHANGED
@@ -1591,35 +1591,36 @@ function createSlotBlock(slotNode, dir, context) {
1591
1591
 
1592
1592
  // src/transforms/vSlots.ts
1593
1593
  import { createCompilerError as createCompilerError5, ErrorCodes as ErrorCodes5 } from "@vue/compiler-dom";
1594
- var transformVSlots = (node, context) => {
1595
- if (node.type !== "JSXElement" || !isJSXComponent(node)) return;
1596
- const {
1597
- openingElement: { attributes },
1598
- children
1599
- } = node;
1600
- const vSlotsIndex = attributes.findIndex(
1601
- (attr) => attr.type === "JSXAttribute" && attr.name.name.toString() === "v-slots"
1602
- );
1603
- const vSlotsDir = attributes[vSlotsIndex];
1604
- if (vSlotsDir && vSlotsDir.value?.type === "JSXExpressionContainer") {
1605
- attributes.splice(vSlotsIndex, 1);
1594
+ var transformVSlots = (dir, node, context) => {
1595
+ if (!isJSXComponent(node)) return;
1596
+ if (dir.value?.type === "JSXExpressionContainer") {
1606
1597
  context.slots = [
1607
1598
  {
1608
1599
  slotType: 4 /* EXPRESSION */,
1609
- slots: resolveExpression(vSlotsDir.value.expression, context)
1600
+ slots: resolveExpression(dir.value.expression, context)
1610
1601
  }
1611
1602
  ];
1612
- if (children.length) {
1603
+ if (node.children.length) {
1613
1604
  context.options.onError(
1614
1605
  createCompilerError5(
1615
1606
  ErrorCodes5.X_V_SLOT_MIXED_SLOT_USAGE,
1616
- resolveLocation(children[0].loc, context)
1607
+ resolveLocation(node.children[0].loc, context)
1617
1608
  )
1618
1609
  );
1619
1610
  }
1620
1611
  }
1621
1612
  };
1622
1613
 
1614
+ // src/transforms/vText.ts
1615
+ import { transformVText as _transformVText } from "@vue/compiler-vapor";
1616
+ var transformVText = (dir, node, context) => {
1617
+ return _transformVText(
1618
+ resolveDirectiveNode(dir, context),
1619
+ resolveNode(node, context),
1620
+ context
1621
+ );
1622
+ };
1623
+
1623
1624
  // src/compile.ts
1624
1625
  function compile(source, options = {}) {
1625
1626
  const resolvedOptions = extend5({}, options, {
@@ -1680,7 +1681,6 @@ function getBaseTransformPreset() {
1680
1681
  transformTemplateRef,
1681
1682
  transformText,
1682
1683
  transformElement,
1683
- transformVSlots,
1684
1684
  transformVSlot,
1685
1685
  transformChildren
1686
1686
  ],
@@ -1689,20 +1689,12 @@ function getBaseTransformPreset() {
1689
1689
  on: transformVOn,
1690
1690
  model: transformVModel,
1691
1691
  show: transformVShow,
1692
- html: transformVHtml
1692
+ html: transformVHtml,
1693
+ text: transformVText,
1694
+ slots: transformVSlots
1693
1695
  }
1694
1696
  ];
1695
1697
  }
1696
-
1697
- // src/transforms/vText.ts
1698
- import { transformVText as _transformVText } from "@vue/compiler-vapor";
1699
- var transformVText = (dir, node, context) => {
1700
- return _transformVText(
1701
- resolveDirectiveNode(dir, context),
1702
- resolveNode(node, context),
1703
- context
1704
- );
1705
- };
1706
1698
  export {
1707
1699
  DynamicFlag,
1708
1700
  IRDynamicPropsKind,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue-jsx-vapor/compiler",
3
- "version": "2.1.4",
3
+ "version": "2.1.6",
4
4
  "description": "Vue JSX Vapor Compiler",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -50,9 +50,9 @@
50
50
  "dependencies": {
51
51
  "@babel/parser": "^7.26.8",
52
52
  "@babel/types": "^7.26.8",
53
- "@vue/compiler-dom": "https://pkg.pr.new/@vue/compiler-dom@eeab9c4",
54
- "@vue/compiler-vapor": "https://pkg.pr.new/@vue/compiler-vapor@eeab9c4",
55
- "@vue/shared": "https://pkg.pr.new/@vue/shared@eeab9c4"
53
+ "@vue/compiler-dom": "https://pkg.pr.new/@vue/compiler-dom@3e7464f",
54
+ "@vue/compiler-vapor": "https://pkg.pr.new/@vue/compiler-vapor@3e7464f",
55
+ "@vue/shared": "https://pkg.pr.new/@vue/shared@3e7464f"
56
56
  },
57
57
  "scripts": {
58
58
  "build": "tsup",