vue-jsx-vapor 3.2.23 → 3.2.25
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/volar.cjs +6 -6
- package/dist/volar.js +6 -6
- package/jsx-runtime/vapor.d.ts +11 -3
- package/jsx-runtime/vdom.d.ts +10 -2
- package/package.json +6 -6
package/dist/volar.cjs
CHANGED
|
@@ -5,7 +5,7 @@ _vue_jsx_vapor_macros_volar = require_chunk.__toESM(_vue_jsx_vapor_macros_volar)
|
|
|
5
5
|
let ts_macro = require("ts-macro");
|
|
6
6
|
let _vue_shared = require("@vue/shared");
|
|
7
7
|
|
|
8
|
-
//#region ../../node_modules/.pnpm/@vue-macros+volar@3.1.4_patch_hash=
|
|
8
|
+
//#region ../../node_modules/.pnpm/@vue-macros+volar@3.1.4_patch_hash=fd21154639cf4ca643d5e6948fd8469d3640226ab245fd5d0068_98acbb9d3ff744314cc8fc3f77242c15/node_modules/@vue-macros/volar/dist/jsx-directive-w2gUTWdx.js
|
|
9
9
|
function getDirectiveArgs(attribute, options) {
|
|
10
10
|
const { ts, ast } = options;
|
|
11
11
|
const attributeName = attribute.name.getText(ast);
|
|
@@ -63,7 +63,7 @@ declare function __VLS_asFunctionalComponent<
|
|
|
63
63
|
? Props
|
|
64
64
|
: any),
|
|
65
65
|
ctx?: any,
|
|
66
|
-
) =>
|
|
66
|
+
) => {
|
|
67
67
|
__ctx: {
|
|
68
68
|
attrs: Record<string, any>,
|
|
69
69
|
props: (K extends { $props: infer Props }
|
|
@@ -153,7 +153,7 @@ function transformCtx(node, root, index, options) {
|
|
|
153
153
|
const ctxName = `__VLS_ctx_${refValue || index}`;
|
|
154
154
|
let tagName = "";
|
|
155
155
|
const originTagName = tagName = getTagName(node, options);
|
|
156
|
-
if ((
|
|
156
|
+
if (!tagName.includes(".") && /^[a-z]/.test(tagName) || tagName.includes("-")) tagName = `{}`;
|
|
157
157
|
else {
|
|
158
158
|
let types = "";
|
|
159
159
|
if (openingElement.typeArguments?.length) {
|
|
@@ -541,10 +541,10 @@ function transformVSlot(nodeMap, ctxMap, options) {
|
|
|
541
541
|
function transformVSlots(nodes, ctxMap, options) {
|
|
542
542
|
const { codes, ts } = options;
|
|
543
543
|
for (const { node, attribute: { initializer } } of nodes) if (initializer && ts.isJsxExpression(initializer) && initializer.expression) {
|
|
544
|
-
if (ts.isObjectLiteralExpression(initializer.expression)) codes.replaceRange(initializer.expression.end, initializer.expression.end, ` satisfies typeof ${ctxMap.get(node)}.slots
|
|
544
|
+
if (ts.isObjectLiteralExpression(initializer.expression)) codes.replaceRange(initializer.expression.end, initializer.expression.end, ` satisfies typeof ${ctxMap.get(node)}.slots as Record<string, any>`);
|
|
545
545
|
else if (ts.isFunctionExpression(initializer.expression) || ts.isArrowFunction(initializer.expression)) {
|
|
546
546
|
codes.replaceRange(initializer.expression.pos, initializer.expression.pos, "(");
|
|
547
|
-
codes.replaceRange(initializer.expression.end, initializer.expression.end, `) satisfies typeof ${ctxMap.get(node)}.slots.default`);
|
|
547
|
+
codes.replaceRange(initializer.expression.end, initializer.expression.end, `) satisfies typeof ${ctxMap.get(node)}.slots.default as any`);
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
550
|
}
|
|
@@ -722,7 +722,7 @@ const plugin$2 = (0, ts_macro.createPlugin)(({ ts, vueCompilerOptions }, options
|
|
|
722
722
|
var jsx_directive_default = plugin$2;
|
|
723
723
|
|
|
724
724
|
//#endregion
|
|
725
|
-
//#region ../../node_modules/.pnpm/@vue-macros+volar@3.1.4_patch_hash=
|
|
725
|
+
//#region ../../node_modules/.pnpm/@vue-macros+volar@3.1.4_patch_hash=fd21154639cf4ca643d5e6948fd8469d3640226ab245fd5d0068_98acbb9d3ff744314cc8fc3f77242c15/node_modules/@vue-macros/volar/dist/jsx-ref-DZlb-F7c.js
|
|
726
726
|
function transformRef({ nodes, codes, ts }) {
|
|
727
727
|
for (const { name, initializer } of nodes) if (ts.isCallExpression(initializer)) codes.replaceRange(initializer.expression.end, initializer.expression.end, `<Parameters<typeof __VLS_ctx_${name.text}['expose']>[0] | null>`);
|
|
728
728
|
}
|
package/dist/volar.js
CHANGED
|
@@ -2,7 +2,7 @@ import jsxMacros from "@vue-jsx-vapor/macros/volar";
|
|
|
2
2
|
import { allCodeFeatures, createPlugin } from "ts-macro";
|
|
3
3
|
import { isHTMLTag, isSVGTag } from "@vue/shared";
|
|
4
4
|
|
|
5
|
-
//#region ../../node_modules/.pnpm/@vue-macros+volar@3.1.4_patch_hash=
|
|
5
|
+
//#region ../../node_modules/.pnpm/@vue-macros+volar@3.1.4_patch_hash=fd21154639cf4ca643d5e6948fd8469d3640226ab245fd5d0068_98acbb9d3ff744314cc8fc3f77242c15/node_modules/@vue-macros/volar/dist/jsx-directive-w2gUTWdx.js
|
|
6
6
|
function getDirectiveArgs(attribute, options) {
|
|
7
7
|
const { ts, ast } = options;
|
|
8
8
|
const attributeName = attribute.name.getText(ast);
|
|
@@ -60,7 +60,7 @@ declare function __VLS_asFunctionalComponent<
|
|
|
60
60
|
? Props
|
|
61
61
|
: any),
|
|
62
62
|
ctx?: any,
|
|
63
|
-
) =>
|
|
63
|
+
) => {
|
|
64
64
|
__ctx: {
|
|
65
65
|
attrs: Record<string, any>,
|
|
66
66
|
props: (K extends { $props: infer Props }
|
|
@@ -150,7 +150,7 @@ function transformCtx(node, root, index, options) {
|
|
|
150
150
|
const ctxName = `__VLS_ctx_${refValue || index}`;
|
|
151
151
|
let tagName = "";
|
|
152
152
|
const originTagName = tagName = getTagName(node, options);
|
|
153
|
-
if (
|
|
153
|
+
if (!tagName.includes(".") && /^[a-z]/.test(tagName) || tagName.includes("-")) tagName = `{}`;
|
|
154
154
|
else {
|
|
155
155
|
let types = "";
|
|
156
156
|
if (openingElement.typeArguments?.length) {
|
|
@@ -538,10 +538,10 @@ function transformVSlot(nodeMap, ctxMap, options) {
|
|
|
538
538
|
function transformVSlots(nodes, ctxMap, options) {
|
|
539
539
|
const { codes, ts } = options;
|
|
540
540
|
for (const { node, attribute: { initializer } } of nodes) if (initializer && ts.isJsxExpression(initializer) && initializer.expression) {
|
|
541
|
-
if (ts.isObjectLiteralExpression(initializer.expression)) codes.replaceRange(initializer.expression.end, initializer.expression.end, ` satisfies typeof ${ctxMap.get(node)}.slots
|
|
541
|
+
if (ts.isObjectLiteralExpression(initializer.expression)) codes.replaceRange(initializer.expression.end, initializer.expression.end, ` satisfies typeof ${ctxMap.get(node)}.slots as Record<string, any>`);
|
|
542
542
|
else if (ts.isFunctionExpression(initializer.expression) || ts.isArrowFunction(initializer.expression)) {
|
|
543
543
|
codes.replaceRange(initializer.expression.pos, initializer.expression.pos, "(");
|
|
544
|
-
codes.replaceRange(initializer.expression.end, initializer.expression.end, `) satisfies typeof ${ctxMap.get(node)}.slots.default`);
|
|
544
|
+
codes.replaceRange(initializer.expression.end, initializer.expression.end, `) satisfies typeof ${ctxMap.get(node)}.slots.default as any`);
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
547
|
}
|
|
@@ -719,7 +719,7 @@ const plugin$2 = createPlugin(({ ts, vueCompilerOptions }, options = vueCompiler
|
|
|
719
719
|
var jsx_directive_default = plugin$2;
|
|
720
720
|
|
|
721
721
|
//#endregion
|
|
722
|
-
//#region ../../node_modules/.pnpm/@vue-macros+volar@3.1.4_patch_hash=
|
|
722
|
+
//#region ../../node_modules/.pnpm/@vue-macros+volar@3.1.4_patch_hash=fd21154639cf4ca643d5e6948fd8469d3640226ab245fd5d0068_98acbb9d3ff744314cc8fc3f77242c15/node_modules/@vue-macros/volar/dist/jsx-ref-DZlb-F7c.js
|
|
723
723
|
function transformRef({ nodes, codes, ts }) {
|
|
724
724
|
for (const { name, initializer } of nodes) if (ts.isCallExpression(initializer)) codes.replaceRange(initializer.expression.end, initializer.expression.end, `<Parameters<typeof __VLS_ctx_${name.text}['expose']>[0] | null>`);
|
|
725
725
|
}
|
package/jsx-runtime/vapor.d.ts
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { Fragment } from 'vue'
|
|
2
|
-
import type {
|
|
2
|
+
import type { RenderResult, JSX as VueJSX } from 'vue-jsx-vapor'
|
|
3
3
|
|
|
4
4
|
declare global {
|
|
5
|
-
|
|
5
|
+
namespace JSX {
|
|
6
|
+
type Element = VueJSX.Element
|
|
7
|
+
type ElementAttributesProperty = VueJSX.ElementAttributesProperty
|
|
8
|
+
type ElementChildrenAttribute = VueJSX.ElementChildrenAttribute
|
|
9
|
+
type IntrinsicElements = VueJSX.IntrinsicElements
|
|
10
|
+
type IntrinsicAttributes = VueJSX.IntrinsicAttributes
|
|
11
|
+
type LibraryManagedAttributes<Component, Props> =
|
|
12
|
+
VueJSX.LibraryManagedAttributes<Component, Props>
|
|
13
|
+
}
|
|
6
14
|
}
|
|
7
15
|
|
|
8
16
|
declare function jsx(type: any, props: any, key: any): RenderResult
|
|
9
17
|
|
|
10
|
-
export { Fragment, jsx, jsx as jsxDEV, jsx as jsxs
|
|
18
|
+
export { Fragment, jsx, jsx as jsxDEV, jsx as jsxs }
|
package/jsx-runtime/vdom.d.ts
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import type { Fragment, VNode } from 'vue'
|
|
2
|
-
|
|
2
|
+
import type { JSX as VueJSX } from 'vue-jsx-vapor'
|
|
3
3
|
|
|
4
4
|
declare global {
|
|
5
|
-
|
|
5
|
+
namespace JSX {
|
|
6
|
+
type Element = VueJSX.Element
|
|
7
|
+
type ElementAttributesProperty = VueJSX.ElementAttributesProperty
|
|
8
|
+
type ElementChildrenAttribute = VueJSX.ElementChildrenAttribute
|
|
9
|
+
type IntrinsicElements = VueJSX.IntrinsicElements
|
|
10
|
+
type IntrinsicAttributes = VueJSX.IntrinsicAttributes
|
|
11
|
+
type LibraryManagedAttributes<Component, Props> =
|
|
12
|
+
VueJSX.LibraryManagedAttributes<Component, Props>
|
|
13
|
+
}
|
|
6
14
|
}
|
|
7
15
|
|
|
8
16
|
declare function jsx(type: any, props: any, key: any): VNode
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-jsx-vapor",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.2.
|
|
4
|
+
"version": "3.2.25",
|
|
5
5
|
"description": "Vapor Mode of Vue JSX",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/vuejs/vue-jsx-vapor#readme",
|
|
@@ -171,20 +171,20 @@
|
|
|
171
171
|
}
|
|
172
172
|
},
|
|
173
173
|
"dependencies": {
|
|
174
|
-
"@vue/shared": "3.6.0-rc.
|
|
174
|
+
"@vue/shared": "3.6.0-rc.9",
|
|
175
175
|
"pathe": "^2.0.3",
|
|
176
176
|
"ts-macro": "^0.3.7",
|
|
177
177
|
"unplugin": "^3.0.0",
|
|
178
178
|
"unplugin-utils": "^0.3.1",
|
|
179
|
-
"@vue-jsx-vapor/
|
|
180
|
-
"@vue-jsx-vapor/
|
|
181
|
-
"@vue-jsx-vapor/
|
|
179
|
+
"@vue-jsx-vapor/macros": "3.2.25",
|
|
180
|
+
"@vue-jsx-vapor/runtime": "3.2.25",
|
|
181
|
+
"@vue-jsx-vapor/compiler-rs": "3.2.25"
|
|
182
182
|
},
|
|
183
183
|
"devDependencies": {
|
|
184
184
|
"@nuxt/kit": "^3.21.4",
|
|
185
185
|
"@nuxt/schema": "^3.21.4",
|
|
186
186
|
"@vue-macros/volar": "^3.1.4",
|
|
187
|
-
"vue": "3.6.0-rc.
|
|
187
|
+
"vue": "3.6.0-rc.9"
|
|
188
188
|
},
|
|
189
189
|
"scripts": {
|
|
190
190
|
"build": "tsdown",
|