@vue/babel-plugin-jsx
Advanced tools
Comparing version 1.1.3 to 1.1.4
"use strict"; | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __defProps = Object.defineProperties; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropDescs = Object.getOwnPropertyDescriptors; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getOwnPropSymbols = Object.getOwnPropertySymbols; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __propIsEnum = Object.prototype.propertyIsEnumerable; | ||
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; | ||
var __spreadValues = (a, b) => { | ||
for (var prop in b || (b = {})) | ||
if (__hasOwnProp.call(b, prop)) | ||
__defNormalProp(a, prop, b[prop]); | ||
if (__getOwnPropSymbols) | ||
for (var prop of __getOwnPropSymbols(b)) { | ||
if (__propIsEnum.call(b, prop)) | ||
__defNormalProp(a, prop, b[prop]); | ||
} | ||
return a; | ||
}; | ||
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); | ||
var __export = (target, all) => { | ||
@@ -66,2 +83,3 @@ for (var name in all) | ||
var checkIsComponent = (path, state) => { | ||
var _a, _b; | ||
const namePath = path.get("name"); | ||
@@ -72,3 +90,3 @@ if (namePath.isJSXMemberExpression()) { | ||
const tag = namePath.node.name; | ||
return !state.opts.isCustomElement?.(tag) && shouldTransformedToSlots(tag) && !import_html_tags.default.includes(tag) && !import_svg_tags.default.includes(tag); | ||
return !((_b = (_a = state.opts).isCustomElement) == null ? void 0 : _b.call(_a, tag)) && shouldTransformedToSlots(tag) && !import_html_tags.default.includes(tag) && !import_svg_tags.default.includes(tag); | ||
}; | ||
@@ -85,2 +103,3 @@ var transformJSXMemberExpression = (path) => { | ||
var getTag = (path, state) => { | ||
var _a, _b; | ||
const namePath = path.get("openingElement").get("name"); | ||
@@ -90,3 +109,3 @@ if (namePath.isJSXIdentifier()) { | ||
if (!import_html_tags.default.includes(name) && !import_svg_tags.default.includes(name)) { | ||
return name === FRAGMENT ? createIdentifier(state, FRAGMENT) : path.scope.hasBinding(name) ? t.identifier(name) : state.opts.isCustomElement?.(name) ? t.stringLiteral(name) : t.callExpression(createIdentifier(state, "resolveComponent"), [ | ||
return name === FRAGMENT ? createIdentifier(state, FRAGMENT) : path.scope.hasBinding(name) ? t.identifier(name) : ((_b = (_a = state.opts).isCustomElement) == null ? void 0 : _b.call(_a, name)) ? t.stringLiteral(name) : t.callExpression(createIdentifier(state, "resolveComponent"), [ | ||
t.stringLiteral(name) | ||
@@ -267,2 +286,3 @@ ]); | ||
var parseDirectives = (params) => { | ||
var _a, _b; | ||
const { path, value, state, tag, isComponent } = params; | ||
@@ -335,4 +355,4 @@ const args = []; | ||
vals[0] || value, | ||
modifiersSet[0]?.size ? args[0] || t2.unaryExpression("void", t2.numericLiteral(0), true) : args[0], | ||
!!modifiersSet[0]?.size && t2.objectExpression( | ||
((_a = modifiersSet[0]) == null ? void 0 : _a.size) ? args[0] || t2.unaryExpression("void", t2.numericLiteral(0), true) : args[0], | ||
!!((_b = modifiersSet[0]) == null ? void 0 : _b.size) && t2.objectExpression( | ||
[...modifiersSet[0]].map( | ||
@@ -361,3 +381,3 @@ (modifier) => t2.objectProperty(t2.identifier(modifier), t2.booleanLiteral(true)) | ||
if (t2.isStringLiteral(type) || !type) { | ||
switch (type?.value) { | ||
switch (type == null ? void 0 : type.value) { | ||
case "checkbox": | ||
@@ -491,2 +511,3 @@ modelToUse = createIdentifier(state, "vModelCheckbox"); | ||
values.forEach((value, index) => { | ||
var _a; | ||
const propName = args[index]; | ||
@@ -504,6 +525,6 @@ const isDynamic = propName && !t3.isStringLiteral(propName) && !t3.isNullLiteral(propName); | ||
dynamicPropNames.add( | ||
propName?.value || "modelValue" | ||
(propName == null ? void 0 : propName.value) || "modelValue" | ||
); | ||
} | ||
if (modifiers[index]?.size) { | ||
if ((_a = modifiers[index]) == null ? void 0 : _a.size) { | ||
properties.push( | ||
@@ -516,3 +537,3 @@ t3.objectProperty( | ||
) : t3.stringLiteral( | ||
`${propName?.value || "model"}Modifiers` | ||
`${(propName == null ? void 0 : propName.value) || "model"}Modifiers` | ||
), | ||
@@ -533,3 +554,3 @@ t3.objectExpression( | ||
const updateName = isDynamic ? t3.binaryExpression("+", t3.stringLiteral("onUpdate"), propName) : t3.stringLiteral( | ||
`onUpdate:${propName?.value || "modelValue"}` | ||
`onUpdate:${(propName == null ? void 0 : propName.value) || "modelValue"}` | ||
); | ||
@@ -858,5 +879,3 @@ properties.push( | ||
inherits: import_plugin_syntax_jsx.default, | ||
visitor: { | ||
...transform_vue_jsx_default, | ||
...sugar_fragment_default, | ||
visitor: __spreadProps(__spreadValues(__spreadValues({}, transform_vue_jsx_default), sugar_fragment_default), { | ||
Program: { | ||
@@ -950,3 +969,6 @@ enter(path, state) { | ||
(p) => p.isVariableDeclaration() && p.node.declarations.some( | ||
(d) => d.id?.name === sourceName.name | ||
(d) => { | ||
var _a; | ||
return ((_a = d.id) == null ? void 0 : _a.name) === sourceName.name; | ||
} | ||
) | ||
@@ -1007,3 +1029,3 @@ ).pop(); | ||
} | ||
} | ||
}) | ||
}); |
{ | ||
"name": "@vue/babel-plugin-jsx", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "Babel plugin for Vue 3 JSX", | ||
@@ -30,3 +30,3 @@ "author": "Amour1688 <lcz_1996@foxmail.com>", | ||
"svg-tags": "^1.0.0", | ||
"@vue/babel-helper-vue-transform-on": "^1.1.3" | ||
"@vue/babel-helper-vue-transform-on": "^1.1.4" | ||
}, | ||
@@ -33,0 +33,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
79487
7
2028
0
+ Addedcaniuse-lite@1.0.30001679(transitive)
+ Addedelectron-to-chromium@1.5.55(transitive)
- Removedcaniuse-lite@1.0.30001677(transitive)
- Removedelectron-to-chromium@1.5.50(transitive)