@vue-jsx-vapor/compiler 2.1.4 → 2.1.5
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 +19 -27
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +19 -27
- package/package.json +1 -1
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 (
|
1596
|
-
|
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(
|
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
@@ -361,7 +361,7 @@ declare const transformVOn: DirectiveTransform;
|
|
361
361
|
|
362
362
|
declare const transformVSlot: NodeTransform;
|
363
363
|
|
364
|
-
declare const transformVSlots:
|
364
|
+
declare const transformVSlots: DirectiveTransform;
|
365
365
|
|
366
366
|
declare const transformVModel: DirectiveTransform;
|
367
367
|
|
package/dist/index.d.ts
CHANGED
@@ -361,7 +361,7 @@ declare const transformVOn: DirectiveTransform;
|
|
361
361
|
|
362
362
|
declare const transformVSlot: NodeTransform;
|
363
363
|
|
364
|
-
declare const transformVSlots:
|
364
|
+
declare const transformVSlots: DirectiveTransform;
|
365
365
|
|
366
366
|
declare const transformVModel: DirectiveTransform;
|
367
367
|
|
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 (
|
1596
|
-
|
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(
|
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,
|