vue-jsx-vapor 2.6.1 → 2.6.3
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/esbuild.d.cts +2 -2
- package/dist/esbuild.d.ts +2 -2
- package/dist/nuxt.d.cts +2 -2
- package/dist/nuxt.d.ts +2 -2
- package/dist/rolldown.d.cts +2 -2
- package/dist/rolldown.d.ts +2 -2
- package/dist/rollup.d.cts +2 -2
- package/dist/rollup.d.ts +2 -2
- package/dist/unplugin.d.cts +2 -2
- package/dist/unplugin.d.ts +2 -2
- package/dist/vite.d.ts +2 -2
- package/dist/volar.cjs +44 -1
- package/dist/volar.js +44 -1
- package/dist/webpack.d.ts +2 -2
- package/jsx-runtime/index.cjs +10 -11
- package/jsx-runtime/index.d.ts +1 -1
- package/jsx-runtime/index.js +1 -1
- package/package.json +16 -15
package/dist/esbuild.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Options } from "./options-jKAq0dFf.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as esbuild2 from "esbuild";
|
|
3
3
|
|
|
4
4
|
//#region src/esbuild.d.ts
|
|
5
|
-
declare const _default: (options?: Options | undefined) =>
|
|
5
|
+
declare const _default: (options?: Options | undefined) => esbuild2.Plugin;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { _default as default };
|
package/dist/esbuild.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Options } from "./options-CBMw6D8V.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as esbuild13 from "esbuild";
|
|
3
3
|
|
|
4
4
|
//#region src/esbuild.d.ts
|
|
5
|
-
declare const _default: (options?: Options | undefined) =>
|
|
5
|
+
declare const _default: (options?: Options | undefined) => esbuild13.Plugin;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { _default as default };
|
package/dist/nuxt.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Options } from "./options-jKAq0dFf.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _nuxt_schema7 from "@nuxt/schema";
|
|
3
3
|
|
|
4
4
|
//#region src/nuxt.d.ts
|
|
5
5
|
interface ModuleOptions extends Options {}
|
|
6
|
-
declare const _default:
|
|
6
|
+
declare const _default: _nuxt_schema7.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { ModuleOptions, _default as default };
|
package/dist/nuxt.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Options } from "./options-CBMw6D8V.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _nuxt_schema11 from "@nuxt/schema";
|
|
3
3
|
|
|
4
4
|
//#region src/nuxt.d.ts
|
|
5
5
|
interface ModuleOptions extends Options {}
|
|
6
|
-
declare const _default:
|
|
6
|
+
declare const _default: _nuxt_schema11.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { ModuleOptions, _default as default };
|
package/dist/rolldown.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Options } from "./options-jKAq0dFf.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as rollup4 from "rollup";
|
|
3
3
|
|
|
4
4
|
//#region src/rolldown.d.ts
|
|
5
|
-
declare const _default: (options?: Options | undefined) =>
|
|
5
|
+
declare const _default: (options?: Options | undefined) => rollup4.Plugin<any> | rollup4.Plugin<any>[];
|
|
6
6
|
//#endregion
|
|
7
7
|
export { _default as default };
|
package/dist/rolldown.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Options } from "./options-CBMw6D8V.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as rollup1 from "rollup";
|
|
3
3
|
|
|
4
4
|
//#region src/rolldown.d.ts
|
|
5
|
-
declare const _default: (options?: Options | undefined) =>
|
|
5
|
+
declare const _default: (options?: Options | undefined) => rollup1.Plugin<any> | rollup1.Plugin<any>[];
|
|
6
6
|
//#endregion
|
|
7
7
|
export { _default as default };
|
package/dist/rollup.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Options } from "./options-jKAq0dFf.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as rollup9 from "rollup";
|
|
3
3
|
|
|
4
4
|
//#region src/rollup.d.ts
|
|
5
|
-
declare const _default: (options?: Options | undefined) =>
|
|
5
|
+
declare const _default: (options?: Options | undefined) => rollup9.Plugin<any>[];
|
|
6
6
|
//#endregion
|
|
7
7
|
export { _default as default };
|
package/dist/rollup.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Options } from "./options-CBMw6D8V.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as rollup7 from "rollup";
|
|
3
3
|
|
|
4
4
|
//#region src/rollup.d.ts
|
|
5
|
-
declare const _default: (options?: Options | undefined) =>
|
|
5
|
+
declare const _default: (options?: Options | undefined) => rollup7.Plugin<any>[];
|
|
6
6
|
//#endregion
|
|
7
7
|
export { _default as default };
|
package/dist/unplugin.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Options } from "./options-jKAq0dFf.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as unplugin6 from "unplugin";
|
|
3
3
|
import { UnpluginFactory } from "unplugin";
|
|
4
4
|
|
|
5
5
|
//#region src/unplugin.d.ts
|
|
6
6
|
declare const unpluginFactory: UnpluginFactory<Options | undefined, true>;
|
|
7
|
-
declare const unplugin:
|
|
7
|
+
declare const unplugin: unplugin6.UnpluginInstance<Options | undefined, true>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { Options, unplugin as default, unplugin, unpluginFactory };
|
package/dist/unplugin.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Options } from "./options-CBMw6D8V.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as unplugin5 from "unplugin";
|
|
3
3
|
import { UnpluginFactory } from "unplugin";
|
|
4
4
|
|
|
5
5
|
//#region src/unplugin.d.ts
|
|
6
6
|
declare const unpluginFactory: UnpluginFactory<Options | undefined, true>;
|
|
7
|
-
declare const unplugin:
|
|
7
|
+
declare const unplugin: unplugin5.UnpluginInstance<Options | undefined, true>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { Options, unplugin as default, unplugin, unpluginFactory };
|
package/dist/vite.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Options } from "./options-CBMw6D8V.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vite4 from "vite";
|
|
3
3
|
|
|
4
4
|
//#region src/vite.d.ts
|
|
5
|
-
declare const _default: (options?: Options | undefined) =>
|
|
5
|
+
declare const _default: (options?: Options | undefined) => vite4.Plugin<any>[];
|
|
6
6
|
//#endregion
|
|
7
7
|
export { _default as default };
|
package/dist/volar.cjs
CHANGED
|
@@ -4,13 +4,56 @@ const __vue_jsx_vapor_macros_volar = require_chunk.__toESM(require("@vue-jsx-vap
|
|
|
4
4
|
const __vue_macros_volar_jsx_directive = require_chunk.__toESM(require("@vue-macros/volar/jsx-directive"));
|
|
5
5
|
const __vue_macros_volar_jsx_ref = require_chunk.__toESM(require("@vue-macros/volar/jsx-ref"));
|
|
6
6
|
const ts_macro = require_chunk.__toESM(require("ts-macro"));
|
|
7
|
+
const __vue_shared = require_chunk.__toESM(require("@vue/shared"));
|
|
7
8
|
|
|
9
|
+
//#region src/volar/jsx-element.ts
|
|
10
|
+
var jsx_element_default = (0, ts_macro.createPlugin)(({ ts }) => {
|
|
11
|
+
return {
|
|
12
|
+
name: "@vue-jsx-vapor/jsx-element",
|
|
13
|
+
resolveVirtualCode({ ast, codes }) {
|
|
14
|
+
let transformed = false;
|
|
15
|
+
ast.forEachChild(function walk(node, parent = ast) {
|
|
16
|
+
if (!ts.isJsxElement(parent) && !ts.isJsxFragment(parent) && !ts.isJsxExpression(parent) && !(parent.parent ? isConditionalExpression(ts, parent) : false)) {
|
|
17
|
+
const openingElement = ts.isJsxElement(node) ? node.openingElement : ts.isJsxSelfClosingElement(node) ? node : null;
|
|
18
|
+
if (openingElement) {
|
|
19
|
+
const tagName = openingElement.tagName.getText(ast);
|
|
20
|
+
if (!tagName.includes("-")) {
|
|
21
|
+
transformed = true;
|
|
22
|
+
codes.replaceRange(node.getStart(ast), node.getStart(ast) + 1, "(<");
|
|
23
|
+
codes.replaceRange(node.end, node.end, " as unknown as __InferJsxElement<", (0, __vue_shared.isHTMLTag)(tagName) || (0, __vue_shared.isSVGTag)(tagName) ? `'${tagName}'` : `typeof ${tagName}`, ">)");
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if (!ts.isCallExpression(node) || node.expression.getText(ast) !== "defineSlots") node.forEachChild((child) => walk(child, node));
|
|
28
|
+
});
|
|
29
|
+
transformed && codes.push(`
|
|
30
|
+
type __InferJsxElement<T> = T extends keyof HTMLElementTagNameMap
|
|
31
|
+
? HTMLElementTagNameMap[T]
|
|
32
|
+
: T extends keyof SVGElementTagNameMap
|
|
33
|
+
? SVGElementTagNameMap[T]
|
|
34
|
+
: T extends (...args: any[]) => any
|
|
35
|
+
? ReturnType<T>
|
|
36
|
+
: T extends { new (...args: any[]): infer Instance }
|
|
37
|
+
? Instance extends { $: any }
|
|
38
|
+
? import('vue').VNode
|
|
39
|
+
: Instance
|
|
40
|
+
: JSX.Element
|
|
41
|
+
`);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
function isConditionalExpression(ts, node) {
|
|
46
|
+
return !!(node && (ts.isBinaryExpression(node) || ts.isConditionalExpression(node)) && node.parent && (ts.isJsxExpression(node.parent) || isConditionalExpression(ts, node.parent)));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
8
50
|
//#region src/volar.ts
|
|
9
51
|
const plugin = (0, ts_macro.createPlugin)((ctx, options = ctx.vueCompilerOptions?.["vue-jsx-vapor"]) => {
|
|
10
52
|
return [
|
|
11
53
|
(0, __vue_macros_volar_jsx_directive.default)()(ctx),
|
|
12
54
|
options?.ref === false ? [] : (0, __vue_macros_volar_jsx_ref.default)(options?.ref === true ? void 0 : options?.ref)(ctx),
|
|
13
|
-
options?.macros === false ? [] : options?.macros ? (0, __vue_jsx_vapor_macros_volar.default)(options.macros === true ? void 0 : options.macros)(ctx) : []
|
|
55
|
+
options?.macros === false ? [] : options?.macros ? (0, __vue_jsx_vapor_macros_volar.default)(options.macros === true ? void 0 : options.macros)(ctx) : [],
|
|
56
|
+
options?.interop ? [] : jsx_element_default()(ctx)
|
|
14
57
|
].flat();
|
|
15
58
|
});
|
|
16
59
|
var volar_default = plugin;
|
package/dist/volar.js
CHANGED
|
@@ -2,13 +2,56 @@ import jsxMacros from "@vue-jsx-vapor/macros/volar";
|
|
|
2
2
|
import jsxDirective from "@vue-macros/volar/jsx-directive";
|
|
3
3
|
import jsxRef from "@vue-macros/volar/jsx-ref";
|
|
4
4
|
import { createPlugin } from "ts-macro";
|
|
5
|
+
import { isHTMLTag, isSVGTag } from "@vue/shared";
|
|
5
6
|
|
|
7
|
+
//#region src/volar/jsx-element.ts
|
|
8
|
+
var jsx_element_default = createPlugin(({ ts }) => {
|
|
9
|
+
return {
|
|
10
|
+
name: "@vue-jsx-vapor/jsx-element",
|
|
11
|
+
resolveVirtualCode({ ast, codes }) {
|
|
12
|
+
let transformed = false;
|
|
13
|
+
ast.forEachChild(function walk(node, parent = ast) {
|
|
14
|
+
if (!ts.isJsxElement(parent) && !ts.isJsxFragment(parent) && !ts.isJsxExpression(parent) && !(parent.parent ? isConditionalExpression(ts, parent) : false)) {
|
|
15
|
+
const openingElement = ts.isJsxElement(node) ? node.openingElement : ts.isJsxSelfClosingElement(node) ? node : null;
|
|
16
|
+
if (openingElement) {
|
|
17
|
+
const tagName = openingElement.tagName.getText(ast);
|
|
18
|
+
if (!tagName.includes("-")) {
|
|
19
|
+
transformed = true;
|
|
20
|
+
codes.replaceRange(node.getStart(ast), node.getStart(ast) + 1, "(<");
|
|
21
|
+
codes.replaceRange(node.end, node.end, " as unknown as __InferJsxElement<", isHTMLTag(tagName) || isSVGTag(tagName) ? `'${tagName}'` : `typeof ${tagName}`, ">)");
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (!ts.isCallExpression(node) || node.expression.getText(ast) !== "defineSlots") node.forEachChild((child) => walk(child, node));
|
|
26
|
+
});
|
|
27
|
+
transformed && codes.push(`
|
|
28
|
+
type __InferJsxElement<T> = T extends keyof HTMLElementTagNameMap
|
|
29
|
+
? HTMLElementTagNameMap[T]
|
|
30
|
+
: T extends keyof SVGElementTagNameMap
|
|
31
|
+
? SVGElementTagNameMap[T]
|
|
32
|
+
: T extends (...args: any[]) => any
|
|
33
|
+
? ReturnType<T>
|
|
34
|
+
: T extends { new (...args: any[]): infer Instance }
|
|
35
|
+
? Instance extends { $: any }
|
|
36
|
+
? import('vue').VNode
|
|
37
|
+
: Instance
|
|
38
|
+
: JSX.Element
|
|
39
|
+
`);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
function isConditionalExpression(ts, node) {
|
|
44
|
+
return !!(node && (ts.isBinaryExpression(node) || ts.isConditionalExpression(node)) && node.parent && (ts.isJsxExpression(node.parent) || isConditionalExpression(ts, node.parent)));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
6
48
|
//#region src/volar.ts
|
|
7
49
|
const plugin = createPlugin((ctx, options = ctx.vueCompilerOptions?.["vue-jsx-vapor"]) => {
|
|
8
50
|
return [
|
|
9
51
|
jsxDirective()(ctx),
|
|
10
52
|
options?.ref === false ? [] : jsxRef(options?.ref === true ? void 0 : options?.ref)(ctx),
|
|
11
|
-
options?.macros === false ? [] : options?.macros ? jsxMacros(options.macros === true ? void 0 : options.macros)(ctx) : []
|
|
53
|
+
options?.macros === false ? [] : options?.macros ? jsxMacros(options.macros === true ? void 0 : options.macros)(ctx) : [],
|
|
54
|
+
options?.interop ? [] : jsx_element_default()(ctx)
|
|
12
55
|
].flat();
|
|
13
56
|
});
|
|
14
57
|
var volar_default = plugin;
|
package/dist/webpack.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Options } from "./options-CBMw6D8V.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as webpack9 from "webpack";
|
|
3
3
|
|
|
4
4
|
//#region src/webpack.d.ts
|
|
5
|
-
declare const _default: (options?: Options | undefined) =>
|
|
5
|
+
declare const _default: (options?: Options | undefined) => webpack9.WebpackPluginInstance;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { _default as default };
|
package/jsx-runtime/index.cjs
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
//#region rolldown:runtime
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
const __create = Object.create
|
|
3
|
+
const __defProp = Object.defineProperty
|
|
4
|
+
const __getOwnPropDesc = Object.getOwnPropertyDescriptor
|
|
5
|
+
const __getOwnPropNames = Object.getOwnPropertyNames
|
|
6
|
+
const __getProtoOf = Object.getPrototypeOf
|
|
7
|
+
const __hasOwnProp = Object.prototype.hasOwnProperty
|
|
8
|
+
const __copyProps = (to, from, except, desc) => {
|
|
9
9
|
if ((from && typeof from === 'object') || typeof from === 'function')
|
|
10
10
|
for (
|
|
11
|
-
|
|
12
|
-
var keys = __getOwnPropNames(from), i = 0, n = keys.length, key;
|
|
11
|
+
let keys = __getOwnPropNames(from), i = 0, n = keys.length, key;
|
|
13
12
|
i < n;
|
|
14
13
|
i++
|
|
15
14
|
) {
|
|
@@ -22,7 +21,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
22
21
|
}
|
|
23
22
|
return to
|
|
24
23
|
}
|
|
25
|
-
|
|
24
|
+
const __toESM = (mod, isNodeMode, target) => (
|
|
26
25
|
(target = mod != null ? __create(__getProtoOf(mod)) : {}),
|
|
27
26
|
__copyProps(
|
|
28
27
|
isNodeMode || !mod || !mod.__esModule
|
|
@@ -39,7 +38,7 @@ const vue = __toESM(require('vue'))
|
|
|
39
38
|
const vue_jsx_vapor = __toESM(require('vue-jsx-vapor'))
|
|
40
39
|
|
|
41
40
|
function jsx(type, props, key) {
|
|
42
|
-
const { children,
|
|
41
|
+
const { children, 'v-slots': vSlots } = props
|
|
43
42
|
delete props.children
|
|
44
43
|
delete props['v-slots']
|
|
45
44
|
if (arguments.length > 2) props.key = key
|
package/jsx-runtime/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { h, NativeElements, ReservedProps } from 'vue-jsx-vapor'
|
|
|
4
4
|
declare function jsx(type: any, props: any, key: any): ReturnType<typeof h>
|
|
5
5
|
declare global {
|
|
6
6
|
namespace JSX {
|
|
7
|
-
type Element = Block
|
|
7
|
+
type Element = VNode | Block | Element[]
|
|
8
8
|
interface ElementAttributesProperty {
|
|
9
9
|
$props
|
|
10
10
|
}
|
package/jsx-runtime/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Fragment } from 'vue'
|
|
|
2
2
|
import { h } from 'vue-jsx-vapor'
|
|
3
3
|
|
|
4
4
|
function jsx(type, props, key) {
|
|
5
|
-
const { children,
|
|
5
|
+
const { children, 'v-slots': vSlots } = props
|
|
6
6
|
delete props.children
|
|
7
7
|
delete props['v-slots']
|
|
8
8
|
if (arguments.length > 2) props.key = key
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-jsx-vapor",
|
|
3
|
-
"version": "2.6.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.6.3",
|
|
4
|
+
"description": "Vapor Mode of Vue JSX",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"unplugin",
|
|
@@ -161,24 +161,25 @@
|
|
|
161
161
|
}
|
|
162
162
|
},
|
|
163
163
|
"dependencies": {
|
|
164
|
-
"@babel/core": "^7.28.
|
|
164
|
+
"@babel/core": "^7.28.4",
|
|
165
165
|
"@babel/plugin-transform-typescript": "^7.28.0",
|
|
166
|
-
"@vue-macros/jsx-directive": "^3.0.0-beta.
|
|
167
|
-
"@vue-macros/volar": "^3.0.0-beta.
|
|
168
|
-
"@vue/babel-plugin-jsx": "^1.
|
|
166
|
+
"@vue-macros/jsx-directive": "^3.0.0-beta.23",
|
|
167
|
+
"@vue-macros/volar": "^3.0.0-beta.23",
|
|
168
|
+
"@vue/babel-plugin-jsx": "^1.5.0",
|
|
169
|
+
"@vue/shared": "3.6.0-alpha.2",
|
|
169
170
|
"hash-sum": "^2.0.0",
|
|
170
171
|
"pathe": "^2.0.3",
|
|
171
|
-
"ts-macro": "^0.3.
|
|
172
|
-
"unplugin": "^2.3.
|
|
173
|
-
"unplugin-utils": "^0.2.
|
|
174
|
-
"@vue-jsx-vapor/
|
|
175
|
-
"@vue-jsx-vapor/
|
|
176
|
-
"@vue-jsx-vapor/runtime": "2.6.
|
|
177
|
-
"@vue-jsx-vapor/macros": "2.6.
|
|
172
|
+
"ts-macro": "^0.3.4",
|
|
173
|
+
"unplugin": "^2.3.10",
|
|
174
|
+
"unplugin-utils": "^0.2.5",
|
|
175
|
+
"@vue-jsx-vapor/babel": "2.6.3",
|
|
176
|
+
"@vue-jsx-vapor/compiler": "2.6.3",
|
|
177
|
+
"@vue-jsx-vapor/runtime": "2.6.3",
|
|
178
|
+
"@vue-jsx-vapor/macros": "2.6.3"
|
|
178
179
|
},
|
|
179
180
|
"devDependencies": {
|
|
180
|
-
"@nuxt/kit": "^3.
|
|
181
|
-
"@nuxt/schema": "^3.
|
|
181
|
+
"@nuxt/kit": "^3.19.1",
|
|
182
|
+
"@nuxt/schema": "^3.19.1",
|
|
182
183
|
"@types/babel__core": "^7.20.5",
|
|
183
184
|
"@types/hash-sum": "^1.0.2"
|
|
184
185
|
},
|