vue-jsx-vapor 2.5.4-beta.1 → 2.6.1
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/index.cjs +7 -160
- package/dist/index.d.cts +1 -1400
- package/dist/index.d.ts +1 -1400
- package/dist/index.js +1 -148
- 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 +1 -1
- package/dist/volar.js +1 -1
- package/dist/webpack.d.ts +2 -2
- package/jsx-runtime/index.cjs +45 -33
- package/jsx-runtime/index.d.ts +9 -14
- package/jsx-runtime/index.js +8 -10
- package/package.json +12 -15
- package/jsx-runtime/index.d.cts +0 -25
package/dist/index.js
CHANGED
|
@@ -1,148 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { EffectScope, Fragment, VaporFragment, createComponent as createComponent$1, createComponentWithFallback as createComponentWithFallback$1, createTextNode, insert, isFragment, isVaporComponent, proxyRefs, remove, renderEffect, shallowRef as useRef, toRefs, useAttrs } from "vue";
|
|
3
|
-
|
|
4
|
-
//#region src/core/runtime.ts
|
|
5
|
-
function isBlock(val) {
|
|
6
|
-
return val instanceof Node || Array.isArray(val) || isVaporComponent(val) || isFragment(val);
|
|
7
|
-
}
|
|
8
|
-
function getCurrentInstance() {
|
|
9
|
-
return Vue.currentInstance || Vue.getCurrentInstance();
|
|
10
|
-
}
|
|
11
|
-
const createProxyComponent = (createComponent$2, type, props, ...args) => {
|
|
12
|
-
if (type === Fragment) {
|
|
13
|
-
type = (_, { slots }) => slots.default();
|
|
14
|
-
props = null;
|
|
15
|
-
}
|
|
16
|
-
if (Vue.currentInstance && Vue.currentInstance.appContext.vapor) typeof type === "function" && (type.__vapor = true);
|
|
17
|
-
return createComponent$2(type, props, ...args);
|
|
18
|
-
};
|
|
19
|
-
const createComponent = (type, ...args) => {
|
|
20
|
-
return createProxyComponent(createComponent$1, type, ...args);
|
|
21
|
-
};
|
|
22
|
-
const createComponentWithFallback = (type, ...args) => createProxyComponent(createComponentWithFallback$1, type, ...args);
|
|
23
|
-
/**
|
|
24
|
-
* Returns the props of the current component instance.
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```tsx
|
|
28
|
-
* import { useProps } from 'vue-jsx-vapor'
|
|
29
|
-
*
|
|
30
|
-
* defineComponent(({ foo = '' })=>{
|
|
31
|
-
* const props = useProps() // { foo: '' }
|
|
32
|
-
* })
|
|
33
|
-
* ```
|
|
34
|
-
*/
|
|
35
|
-
function useProps() {
|
|
36
|
-
const i = getCurrentInstance();
|
|
37
|
-
return i.props;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Returns the merged props and attrs of the current component.\
|
|
41
|
-
* Equivalent to `useProps()` + `useAttrs()`.
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* ```tsx
|
|
45
|
-
* import { useFullProps } from 'vue-jsx-vapor'
|
|
46
|
-
*
|
|
47
|
-
* defineComponent((props) => {
|
|
48
|
-
* const fullProps = useFullProps() // = useAttrs() + useProps()
|
|
49
|
-
* })
|
|
50
|
-
*/
|
|
51
|
-
function useFullProps() {
|
|
52
|
-
return proxyRefs({
|
|
53
|
-
...toRefs(useProps()),
|
|
54
|
-
...toRefs(useAttrs())
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
function createFragment(nodes, anchor = document.createTextNode("")) {
|
|
58
|
-
const frag = new VaporFragment(nodes);
|
|
59
|
-
frag.anchor = anchor;
|
|
60
|
-
return frag;
|
|
61
|
-
}
|
|
62
|
-
function normalizeNode$1(node, anchor) {
|
|
63
|
-
if (node instanceof Node || isFragment(node)) {
|
|
64
|
-
anchor && (anchor.textContent = "");
|
|
65
|
-
return node;
|
|
66
|
-
} else if (isVaporComponent(node)) {
|
|
67
|
-
anchor && (anchor.textContent = "");
|
|
68
|
-
return createFragment(node, anchor);
|
|
69
|
-
} else if (Array.isArray(node)) {
|
|
70
|
-
anchor && (anchor.textContent = "");
|
|
71
|
-
return createFragment(node.map((i) => normalizeNode$1(i)), anchor);
|
|
72
|
-
} else {
|
|
73
|
-
const result = node == null || typeof node === "boolean" ? "" : String(node);
|
|
74
|
-
if (anchor) {
|
|
75
|
-
anchor.textContent = result;
|
|
76
|
-
return anchor;
|
|
77
|
-
} else return document.createTextNode(result);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
function resolveValue(current, value, _anchor) {
|
|
81
|
-
const node = normalizeNode$1(value, _anchor);
|
|
82
|
-
if (current) {
|
|
83
|
-
if (isFragment(current)) {
|
|
84
|
-
const { anchor } = current;
|
|
85
|
-
if (anchor && anchor.parentNode) {
|
|
86
|
-
remove(current.nodes, anchor.parentNode);
|
|
87
|
-
insert(node, anchor.parentNode, anchor);
|
|
88
|
-
!_anchor && anchor.parentNode.removeChild(anchor);
|
|
89
|
-
}
|
|
90
|
-
} else if (current instanceof Node) {
|
|
91
|
-
if (isFragment(node) && current.parentNode) {
|
|
92
|
-
insert(node, current.parentNode, current);
|
|
93
|
-
current.parentNode.removeChild(current);
|
|
94
|
-
} else if (node instanceof Node) {
|
|
95
|
-
if (current.nodeType === 3 && node.nodeType === 3) {
|
|
96
|
-
current.textContent = node.textContent;
|
|
97
|
-
return current;
|
|
98
|
-
} else if (current.parentNode) current.parentNode.replaceChild(node, current);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
return node;
|
|
103
|
-
}
|
|
104
|
-
function resolveValues(values = [], _anchor) {
|
|
105
|
-
const nodes = [];
|
|
106
|
-
const frag = createFragment(nodes, _anchor);
|
|
107
|
-
const scopes = [];
|
|
108
|
-
for (const [index, value] of values.entries()) {
|
|
109
|
-
const anchor = index === values.length - 1 ? _anchor : void 0;
|
|
110
|
-
if (typeof value === "function") renderEffect(() => {
|
|
111
|
-
if (scopes[index]) scopes[index].stop();
|
|
112
|
-
scopes[index] = new EffectScope();
|
|
113
|
-
nodes[index] = scopes[index].run(() => resolveValue(nodes[index], value(), anchor));
|
|
114
|
-
});
|
|
115
|
-
else nodes[index] = resolveValue(nodes[index], value, anchor);
|
|
116
|
-
}
|
|
117
|
-
return frag;
|
|
118
|
-
}
|
|
119
|
-
function setNodes(anchor, ...values) {
|
|
120
|
-
const resolvedValues = resolveValues(values, anchor);
|
|
121
|
-
anchor.parentNode && insert(resolvedValues, anchor.parentNode, anchor);
|
|
122
|
-
}
|
|
123
|
-
function createNodes(...values) {
|
|
124
|
-
return resolveValues(values);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
//#endregion
|
|
128
|
-
//#region src/core/h.ts
|
|
129
|
-
function normalizeNode(node) {
|
|
130
|
-
if (node == null || typeof node === "boolean") return [];
|
|
131
|
-
else if (Array.isArray(node) && node.length) return node.map(normalizeNode);
|
|
132
|
-
else if (isBlock(node)) return node;
|
|
133
|
-
else return createTextNode(String(node));
|
|
134
|
-
}
|
|
135
|
-
function h(type, propsOrChildren, children) {
|
|
136
|
-
const l = arguments.length;
|
|
137
|
-
if (l === 2) if (typeof propsOrChildren === "object" && !Array.isArray(propsOrChildren)) {
|
|
138
|
-
if (isBlock(propsOrChildren)) return createComponentWithFallback(type, null, { default: () => normalizeNode(propsOrChildren) });
|
|
139
|
-
return createComponentWithFallback(type, propsOrChildren ? { $: [() => propsOrChildren] } : null);
|
|
140
|
-
} else return createComponentWithFallback(type, null, { default: () => normalizeNode(propsOrChildren) });
|
|
141
|
-
else {
|
|
142
|
-
if (l > 3) children = Array.prototype.slice.call(arguments, 2);
|
|
143
|
-
return createComponentWithFallback(type, propsOrChildren ? { $: [() => propsOrChildren] } : null, children ? typeof children === "object" && !Array.isArray(children) ? children : { default: () => normalizeNode(children) } : void 0);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
//#endregion
|
|
148
|
-
export { createComponent, createComponentWithFallback, createNodes, getCurrentInstance, h, isBlock, setNodes, useFullProps, useProps, useRef };
|
|
1
|
+
export * from "@vue-jsx-vapor/runtime"
|
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_schema10 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_schema10.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 rollup7 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) => rollup7.Plugin<any> | rollup7.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 rollup12 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) => rollup12.Plugin<any> | rollup12.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 rollup3 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) => rollup3.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 rollup5 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) => rollup5.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 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/unplugin.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Options } from "./options-CBMw6D8V.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as unplugin9 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: unplugin9.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 vite3 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) => vite3.Plugin<any>[];
|
|
6
6
|
//#endregion
|
|
7
7
|
export { _default as default };
|
package/dist/volar.cjs
CHANGED
|
@@ -6,7 +6,7 @@ const __vue_macros_volar_jsx_ref = require_chunk.__toESM(require("@vue-macros/vo
|
|
|
6
6
|
const ts_macro = require_chunk.__toESM(require("ts-macro"));
|
|
7
7
|
|
|
8
8
|
//#region src/volar.ts
|
|
9
|
-
const plugin = (0, ts_macro.createPlugin)((ctx, options = ctx.vueCompilerOptions["vue-jsx-vapor"]) => {
|
|
9
|
+
const plugin = (0, ts_macro.createPlugin)((ctx, options = ctx.vueCompilerOptions?.["vue-jsx-vapor"]) => {
|
|
10
10
|
return [
|
|
11
11
|
(0, __vue_macros_volar_jsx_directive.default)()(ctx),
|
|
12
12
|
options?.ref === false ? [] : (0, __vue_macros_volar_jsx_ref.default)(options?.ref === true ? void 0 : options?.ref)(ctx),
|
package/dist/volar.js
CHANGED
|
@@ -4,7 +4,7 @@ import jsxRef from "@vue-macros/volar/jsx-ref";
|
|
|
4
4
|
import { createPlugin } from "ts-macro";
|
|
5
5
|
|
|
6
6
|
//#region src/volar.ts
|
|
7
|
-
const plugin = createPlugin((ctx, options = ctx.vueCompilerOptions["vue-jsx-vapor"]) => {
|
|
7
|
+
const plugin = createPlugin((ctx, options = ctx.vueCompilerOptions?.["vue-jsx-vapor"]) => {
|
|
8
8
|
return [
|
|
9
9
|
jsxDirective()(ctx),
|
|
10
10
|
options?.ref === false ? [] : jsxRef(options?.ref === true ? void 0 : options?.ref)(ctx),
|
package/dist/webpack.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Options } from "./options-CBMw6D8V.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as webpack8 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) => webpack8.WebpackPluginInstance;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { _default as default };
|
package/jsx-runtime/index.cjs
CHANGED
|
@@ -1,40 +1,52 @@
|
|
|
1
1
|
//#region rolldown:runtime
|
|
2
|
-
var __create = Object.create
|
|
3
|
-
var __defProp = Object.defineProperty
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty
|
|
2
|
+
var __create = Object.create
|
|
3
|
+
var __defProp = Object.defineProperty
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty
|
|
8
8
|
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
})
|
|
22
|
-
|
|
9
|
+
if ((from && typeof from === 'object') || typeof from === 'function')
|
|
10
|
+
for (
|
|
11
|
+
// eslint-disable-next-line vars-on-top
|
|
12
|
+
var keys = __getOwnPropNames(from), i = 0, n = keys.length, key;
|
|
13
|
+
i < n;
|
|
14
|
+
i++
|
|
15
|
+
) {
|
|
16
|
+
key = keys[i]
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
+
__defProp(to, key, {
|
|
19
|
+
get: ((k) => from[k]).bind(null, key),
|
|
20
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,
|
|
21
|
+
})
|
|
22
|
+
}
|
|
23
|
+
return to
|
|
24
|
+
}
|
|
25
|
+
var __toESM = (mod, isNodeMode, target) => (
|
|
26
|
+
(target = mod != null ? __create(__getProtoOf(mod)) : {}),
|
|
27
|
+
__copyProps(
|
|
28
|
+
isNodeMode || !mod || !mod.__esModule
|
|
29
|
+
? __defProp(target, 'default', {
|
|
30
|
+
value: mod,
|
|
31
|
+
enumerable: true,
|
|
32
|
+
})
|
|
33
|
+
: target,
|
|
34
|
+
mod,
|
|
35
|
+
)
|
|
36
|
+
)
|
|
23
37
|
//#endregion
|
|
24
|
-
const vue = __toESM(require(
|
|
25
|
-
const vue_jsx_vapor = __toESM(require(
|
|
38
|
+
const vue = __toESM(require('vue'))
|
|
39
|
+
const vue_jsx_vapor = __toESM(require('vue-jsx-vapor'))
|
|
26
40
|
|
|
27
|
-
//#region src/jsx-runtime.ts
|
|
28
41
|
function jsx(type, props, key) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
42
|
+
const { children, ['v-slots']: vSlots } = props
|
|
43
|
+
delete props.children
|
|
44
|
+
delete props['v-slots']
|
|
45
|
+
if (arguments.length > 2) props.key = key
|
|
46
|
+
return (0, vue_jsx_vapor.h)(type, props, vSlots || children)
|
|
34
47
|
}
|
|
35
48
|
|
|
36
|
-
|
|
37
|
-
exports.
|
|
38
|
-
exports.
|
|
39
|
-
exports.
|
|
40
|
-
exports.jsxs = jsx;
|
|
49
|
+
exports.Fragment = vue.Fragment
|
|
50
|
+
exports.jsx = jsx
|
|
51
|
+
exports.jsxDEV = jsx
|
|
52
|
+
exports.jsxs = jsx
|
package/jsx-runtime/index.d.ts
CHANGED
|
@@ -1,25 +1,20 @@
|
|
|
1
|
-
import { Block,
|
|
2
|
-
import { NativeElements, ReservedProps
|
|
1
|
+
import { Fragment, type Block, type VNode } from 'vue'
|
|
2
|
+
import type { h, NativeElements, ReservedProps } from 'vue-jsx-vapor'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
declare function jsx(type: any, props: any, key: any): ReturnType<typeof h>;
|
|
4
|
+
declare function jsx(type: any, props: any, key: any): ReturnType<typeof h>
|
|
6
5
|
declare global {
|
|
7
6
|
namespace JSX {
|
|
8
|
-
type Element = Block
|
|
9
|
-
interface ElementClass {
|
|
10
|
-
$props: {};
|
|
11
|
-
}
|
|
7
|
+
type Element = Block & VNode
|
|
12
8
|
interface ElementAttributesProperty {
|
|
13
|
-
$props
|
|
9
|
+
$props
|
|
14
10
|
}
|
|
15
11
|
interface IntrinsicElements extends NativeElements {
|
|
16
|
-
[name: string]: any
|
|
12
|
+
[name: string]: any
|
|
17
13
|
}
|
|
18
14
|
interface IntrinsicAttributes extends ReservedProps {
|
|
19
|
-
class?: unknown
|
|
20
|
-
style?: unknown
|
|
15
|
+
class?: unknown
|
|
16
|
+
style?: unknown
|
|
21
17
|
}
|
|
22
18
|
}
|
|
23
19
|
}
|
|
24
|
-
|
|
25
|
-
export { Fragment, jsx, jsx as jsxDEV, jsx as jsxs };
|
|
20
|
+
export { Fragment, jsx, jsx as jsxDEV, jsx as jsxs }
|
package/jsx-runtime/index.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { Fragment } from
|
|
2
|
-
import { h } from
|
|
1
|
+
import { Fragment } from 'vue'
|
|
2
|
+
import { h } from 'vue-jsx-vapor'
|
|
3
3
|
|
|
4
|
-
//#region src/jsx-runtime.ts
|
|
5
4
|
function jsx(type, props, key) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
const { children, ['v-slots']: vSlots } = props
|
|
6
|
+
delete props.children
|
|
7
|
+
delete props['v-slots']
|
|
8
|
+
if (arguments.length > 2) props.key = key
|
|
9
|
+
return h(type, props, vSlots || children)
|
|
11
10
|
}
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
export { Fragment, jsx, jsx as jsxDEV, jsx as jsxs };
|
|
12
|
+
export { Fragment, jsx, jsx as jsxDEV, jsx as jsxs }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-jsx-vapor",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.1",
|
|
4
4
|
"description": "Convert Vue JSX to Vapor",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -104,13 +104,11 @@
|
|
|
104
104
|
},
|
|
105
105
|
"./jsx-runtime": {
|
|
106
106
|
"types": "./jsx-runtime/index.d.ts",
|
|
107
|
-
"jsx-vapor-dev": "./src/jsx-runtime.ts",
|
|
108
107
|
"require": "./jsx-runtime/index.cjs",
|
|
109
108
|
"default": "./jsx-runtime/index.js"
|
|
110
109
|
},
|
|
111
110
|
"./jsx-dev-runtime": {
|
|
112
111
|
"types": "./jsx-runtime/index.d.ts",
|
|
113
|
-
"jsx-vapor-dev": "./src/jsx-runtime.ts",
|
|
114
112
|
"require": "./jsx-runtime/index.cjs",
|
|
115
113
|
"default": "./jsx-runtime/index.js"
|
|
116
114
|
},
|
|
@@ -139,7 +137,7 @@
|
|
|
139
137
|
"esbuild": "*",
|
|
140
138
|
"rollup": "^3",
|
|
141
139
|
"vite": ">=3",
|
|
142
|
-
"vue": "^3.6.0",
|
|
140
|
+
"vue": "^3.6.0-alpha.2",
|
|
143
141
|
"webpack": "^4 || ^5"
|
|
144
142
|
},
|
|
145
143
|
"peerDependenciesMeta": {
|
|
@@ -165,25 +163,24 @@
|
|
|
165
163
|
"dependencies": {
|
|
166
164
|
"@babel/core": "^7.28.0",
|
|
167
165
|
"@babel/plugin-transform-typescript": "^7.28.0",
|
|
168
|
-
"@vue-macros/jsx-directive": "^3.0.0-beta.
|
|
169
|
-
"@vue-macros/volar": "^3.0.0-beta.
|
|
166
|
+
"@vue-macros/jsx-directive": "^3.0.0-beta.20",
|
|
167
|
+
"@vue-macros/volar": "^3.0.0-beta.20",
|
|
170
168
|
"@vue/babel-plugin-jsx": "^1.4.0",
|
|
171
169
|
"hash-sum": "^2.0.0",
|
|
172
170
|
"pathe": "^2.0.3",
|
|
173
|
-
"ts-macro": "^0.2
|
|
171
|
+
"ts-macro": "^0.3.2",
|
|
174
172
|
"unplugin": "^2.3.5",
|
|
175
173
|
"unplugin-utils": "^0.2.4",
|
|
176
|
-
"@vue-jsx-vapor/
|
|
177
|
-
"@vue-jsx-vapor/
|
|
178
|
-
"@vue-jsx-vapor/
|
|
174
|
+
"@vue-jsx-vapor/compiler": "2.6.1",
|
|
175
|
+
"@vue-jsx-vapor/babel": "2.6.1",
|
|
176
|
+
"@vue-jsx-vapor/runtime": "2.6.1",
|
|
177
|
+
"@vue-jsx-vapor/macros": "2.6.1"
|
|
179
178
|
},
|
|
180
179
|
"devDependencies": {
|
|
181
|
-
"@nuxt/kit": "^3.
|
|
182
|
-
"@nuxt/schema": "^3.
|
|
180
|
+
"@nuxt/kit": "^3.18.1",
|
|
181
|
+
"@nuxt/schema": "^3.18.1",
|
|
183
182
|
"@types/babel__core": "^7.20.5",
|
|
184
|
-
"@types/hash-sum": "^1.0.2"
|
|
185
|
-
"csstype": "^3.1.3",
|
|
186
|
-
"vue": "3.6.0-alpha.2"
|
|
183
|
+
"@types/hash-sum": "^1.0.2"
|
|
187
184
|
},
|
|
188
185
|
"scripts": {
|
|
189
186
|
"build": "tsdown",
|
package/jsx-runtime/index.d.cts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Block, Fragment } from "vue";
|
|
2
|
-
import { NativeElements, ReservedProps, h } from "vue-jsx-vapor";
|
|
3
|
-
|
|
4
|
-
//#region src/jsx-runtime.d.ts
|
|
5
|
-
declare function jsx(type: any, props: any, key: any): ReturnType<typeof h>;
|
|
6
|
-
declare global {
|
|
7
|
-
namespace JSX {
|
|
8
|
-
type Element = Block;
|
|
9
|
-
interface ElementClass {
|
|
10
|
-
$props: {};
|
|
11
|
-
}
|
|
12
|
-
interface ElementAttributesProperty {
|
|
13
|
-
$props: {};
|
|
14
|
-
}
|
|
15
|
-
interface IntrinsicElements extends NativeElements {
|
|
16
|
-
[name: string]: any;
|
|
17
|
-
}
|
|
18
|
-
interface IntrinsicAttributes extends ReservedProps {
|
|
19
|
-
class?: unknown;
|
|
20
|
-
style?: unknown;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
//#endregion
|
|
25
|
-
export { Fragment, jsx, jsx as jsxDEV, jsx as jsxs };
|