vue-jsx-vapor 2.5.2 → 2.5.4-beta.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/api.d.ts +2 -2
- package/dist/astro.cjs +2 -2
- package/dist/astro.js +2 -2
- package/dist/esbuild.cjs +2 -2
- package/dist/esbuild.d.cts +2 -2
- package/dist/esbuild.d.ts +2 -2
- package/dist/esbuild.js +2 -2
- package/dist/index.cjs +40 -6
- package/dist/index.d.cts +40 -3
- package/dist/index.d.ts +42 -5
- package/dist/index.js +39 -8
- package/dist/nuxt.cjs +4 -4
- package/dist/nuxt.d.cts +2 -2
- package/dist/nuxt.d.ts +2 -2
- package/dist/nuxt.js +4 -4
- package/dist/{raw-CYDpZE8-.cjs → raw-B2YMrqwY.cjs} +1 -12
- package/dist/{raw-yXCo36CS.js → raw-CWZ5g7Vk.js} +1 -12
- package/dist/raw.cjs +1 -1
- package/dist/raw.js +1 -1
- package/dist/rolldown.cjs +2 -2
- package/dist/rolldown.d.cts +2 -2
- package/dist/rolldown.d.ts +2 -2
- package/dist/rolldown.js +2 -2
- package/dist/rollup.cjs +2 -2
- package/dist/rollup.d.cts +2 -2
- package/dist/rollup.d.ts +2 -2
- package/dist/rollup.js +2 -2
- package/dist/rspack.cjs +2 -2
- package/dist/rspack.js +2 -2
- package/dist/{unplugin-Cv5nDfeb.js → unplugin-CyifZGPt.js} +1 -1
- package/dist/{unplugin-DBHzlOuN.cjs → unplugin-aKVZLoq9.cjs} +1 -1
- package/dist/unplugin.cjs +2 -2
- package/dist/unplugin.d.cts +2 -2
- package/dist/unplugin.d.ts +2 -2
- package/dist/unplugin.js +2 -2
- package/dist/{vite-BwPOjczq.cjs → vite-C63GJQHT.cjs} +1 -1
- package/dist/vite-Djd6MAt9.js +7 -0
- package/dist/vite.cjs +3 -3
- package/dist/vite.d.cts +2 -2
- package/dist/vite.d.ts +2 -2
- package/dist/vite.js +3 -3
- package/dist/{webpack-BBIFuz_t.js → webpack-3fgVTA33.js} +1 -1
- package/dist/{webpack-srNWU-jd.cjs → webpack-CeAur76z.cjs} +1 -1
- package/dist/webpack.cjs +3 -3
- package/dist/webpack.d.cts +2 -2
- package/dist/webpack.d.ts +2 -2
- package/dist/webpack.js +3 -3
- package/jsx-runtime/index.cjs +4 -2
- package/jsx-runtime/index.d.cts +3 -3
- package/jsx-runtime/index.d.ts +3 -3
- package/jsx-runtime/index.js +5 -3
- package/package.json +6 -6
- package/dist/vite-BtTbvmfA.js +0 -7
package/dist/api.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Options } from "./options-CBMw6D8V.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _babel_core14 from "@babel/core";
|
|
3
3
|
|
|
4
4
|
//#region src/core/index.d.ts
|
|
5
|
-
declare function transformVueJsxVapor(code: string, id: string, options?: Options, needSourceMap?: boolean):
|
|
5
|
+
declare function transformVueJsxVapor(code: string, id: string, options?: Options, needSourceMap?: boolean): _babel_core14.BabelFileResult | null;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Options, transformVueJsxVapor };
|
package/dist/astro.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
require('./core-C-41-Q2Y.cjs');
|
|
3
|
-
require('./raw-
|
|
4
|
-
const require_unplugin = require('./unplugin-
|
|
3
|
+
require('./raw-B2YMrqwY.cjs');
|
|
4
|
+
const require_unplugin = require('./unplugin-aKVZLoq9.cjs');
|
|
5
5
|
|
|
6
6
|
//#region src/astro.ts
|
|
7
7
|
var astro_default = (options) => ({
|
package/dist/astro.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./core-CJgJmh2O.js";
|
|
2
|
-
import "./raw-
|
|
3
|
-
import { unplugin_default } from "./unplugin-
|
|
2
|
+
import "./raw-CWZ5g7Vk.js";
|
|
3
|
+
import { unplugin_default } from "./unplugin-CyifZGPt.js";
|
|
4
4
|
|
|
5
5
|
//#region src/astro.ts
|
|
6
6
|
var astro_default = (options) => ({
|
package/dist/esbuild.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
require('./core-C-41-Q2Y.cjs');
|
|
3
|
-
require('./raw-
|
|
4
|
-
const require_unplugin = require('./unplugin-
|
|
3
|
+
require('./raw-B2YMrqwY.cjs');
|
|
4
|
+
const require_unplugin = require('./unplugin-aKVZLoq9.cjs');
|
|
5
5
|
|
|
6
6
|
//#region src/esbuild.ts
|
|
7
7
|
var esbuild_default = require_unplugin.unplugin_default.esbuild;
|
package/dist/esbuild.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Options } from "./options-jKAq0dFf.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as esbuild4 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) => esbuild4.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 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.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./core-CJgJmh2O.js";
|
|
2
|
-
import "./raw-
|
|
3
|
-
import { unplugin_default } from "./unplugin-
|
|
2
|
+
import "./raw-CWZ5g7Vk.js";
|
|
3
|
+
import { unplugin_default } from "./unplugin-CyifZGPt.js";
|
|
4
4
|
|
|
5
5
|
//#region src/esbuild.ts
|
|
6
6
|
var esbuild_default = unplugin_default.esbuild;
|
package/dist/index.cjs
CHANGED
|
@@ -2,13 +2,24 @@ const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
|
2
2
|
const vue = require_chunk.__toESM(require("vue"));
|
|
3
3
|
|
|
4
4
|
//#region src/core/runtime.ts
|
|
5
|
+
function isBlock(val) {
|
|
6
|
+
return val instanceof Node || Array.isArray(val) || (0, vue.isVaporComponent)(val) || (0, vue.isFragment)(val);
|
|
7
|
+
}
|
|
5
8
|
function getCurrentInstance() {
|
|
6
9
|
return vue.currentInstance || vue.getCurrentInstance();
|
|
7
10
|
}
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
const createProxyComponent = (createComponent$1, type, props, ...args) => {
|
|
12
|
+
if (type === vue.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$1(type, props, ...args);
|
|
11
18
|
};
|
|
19
|
+
const createComponent = (type, ...args) => {
|
|
20
|
+
return createProxyComponent(vue.createComponent, type, ...args);
|
|
21
|
+
};
|
|
22
|
+
const createComponentWithFallback = (type, ...args) => createProxyComponent(vue.createComponentWithFallback, type, ...args);
|
|
12
23
|
/**
|
|
13
24
|
* Returns the props of the current component instance.
|
|
14
25
|
*
|
|
@@ -48,7 +59,7 @@ function createFragment(nodes, anchor = document.createTextNode("")) {
|
|
|
48
59
|
frag.anchor = anchor;
|
|
49
60
|
return frag;
|
|
50
61
|
}
|
|
51
|
-
function normalizeNode(node, anchor) {
|
|
62
|
+
function normalizeNode$1(node, anchor) {
|
|
52
63
|
if (node instanceof Node || (0, vue.isFragment)(node)) {
|
|
53
64
|
anchor && (anchor.textContent = "");
|
|
54
65
|
return node;
|
|
@@ -57,7 +68,7 @@ function normalizeNode(node, anchor) {
|
|
|
57
68
|
return createFragment(node, anchor);
|
|
58
69
|
} else if (Array.isArray(node)) {
|
|
59
70
|
anchor && (anchor.textContent = "");
|
|
60
|
-
return createFragment(node.map((i) => normalizeNode(i)), anchor);
|
|
71
|
+
return createFragment(node.map((i) => normalizeNode$1(i)), anchor);
|
|
61
72
|
} else {
|
|
62
73
|
const result = node == null || typeof node === "boolean" ? "" : String(node);
|
|
63
74
|
if (anchor) {
|
|
@@ -67,7 +78,7 @@ function normalizeNode(node, anchor) {
|
|
|
67
78
|
}
|
|
68
79
|
}
|
|
69
80
|
function resolveValue(current, value, _anchor) {
|
|
70
|
-
const node = normalizeNode(value, _anchor);
|
|
81
|
+
const node = normalizeNode$1(value, _anchor);
|
|
71
82
|
if (current) {
|
|
72
83
|
if ((0, vue.isFragment)(current)) {
|
|
73
84
|
const { anchor } = current;
|
|
@@ -113,10 +124,33 @@ function createNodes(...values) {
|
|
|
113
124
|
return resolveValues(values);
|
|
114
125
|
}
|
|
115
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 (0, vue.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
|
+
|
|
116
147
|
//#endregion
|
|
117
148
|
exports.createComponent = createComponent;
|
|
149
|
+
exports.createComponentWithFallback = createComponentWithFallback;
|
|
118
150
|
exports.createNodes = createNodes;
|
|
119
151
|
exports.getCurrentInstance = getCurrentInstance;
|
|
152
|
+
exports.h = h;
|
|
153
|
+
exports.isBlock = isBlock;
|
|
120
154
|
exports.setNodes = setNodes;
|
|
121
155
|
exports.useFullProps = useFullProps;
|
|
122
156
|
exports.useProps = useProps;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import * as Vue from "vue";
|
|
2
2
|
import * as vue15 from "vue";
|
|
3
|
-
import { GenericComponentInstance, VaporFragment, createComponent as createComponent$1, shallowRef as useRef } from "vue";
|
|
3
|
+
import { Block, Component, ComponentOptions, ConcreteComponent, DefineComponent, EmitsOptions, Fragment, FunctionalComponent, GenericComponentInstance, RawSlots, Suspense, SuspenseProps, Teleport, TeleportProps, VNodeRef, VaporComponent, VaporFragment, createComponent as createComponent$1, createComponentWithFallback as createComponentWithFallback$1, shallowRef as useRef } from "vue";
|
|
4
4
|
import * as CSS from "csstype";
|
|
5
5
|
|
|
6
6
|
//#region src/core/runtime.d.ts
|
|
7
|
+
declare function isBlock(val: NonNullable<unknown>): val is Block;
|
|
7
8
|
declare function getCurrentInstance(): GenericComponentInstance | null;
|
|
8
|
-
|
|
9
|
+
type Tail<T extends any[]> = T extends [any, ...infer R] ? R : never;
|
|
10
|
+
declare const createComponent: (type: VaporComponent | typeof Fragment, ...args: Tail<Parameters<typeof createComponent$1>>) => Vue.VaporComponentInstance | HTMLElement;
|
|
11
|
+
declare const createComponentWithFallback: (type: VaporComponent | typeof Fragment, ...args: Tail<Parameters<typeof createComponentWithFallback$1>>) => Vue.VaporComponentInstance | HTMLElement;
|
|
9
12
|
/**
|
|
10
13
|
* Returns the props of the current component instance.
|
|
11
14
|
*
|
|
@@ -1360,4 +1363,38 @@ interface TransitionEvent<T = Element> extends SyntheticEvent<T, globalThis.Tran
|
|
|
1360
1363
|
}
|
|
1361
1364
|
type TransitionEventHandler<T = Element> = EventHandler<TransitionEvent<T>>;
|
|
1362
1365
|
//#endregion
|
|
1363
|
-
|
|
1366
|
+
//#region src/core/h.d.ts
|
|
1367
|
+
type NodeChildAtom = Block | string | number | boolean | null | undefined | void;
|
|
1368
|
+
type NodeArrayChildren = Array<NodeArrayChildren | NodeChildAtom>;
|
|
1369
|
+
type RawChildren = NodeChildAtom | NodeArrayChildren;
|
|
1370
|
+
interface Constructor<P = any> {
|
|
1371
|
+
__isFragment?: never;
|
|
1372
|
+
__isTeleport?: never;
|
|
1373
|
+
__isSuspense?: never;
|
|
1374
|
+
new (...args: any[]): {
|
|
1375
|
+
$props: P;
|
|
1376
|
+
};
|
|
1377
|
+
}
|
|
1378
|
+
type HTMLElementEventHandler = { [K in keyof HTMLElementEventMap as `on${Capitalize<K>}`]?: (ev: HTMLElementEventMap[K]) => any };
|
|
1379
|
+
type IfAny<T, Y, N> = 0 extends 1 & T ? Y : N;
|
|
1380
|
+
type RawProps = Record<string, any>;
|
|
1381
|
+
declare function h<K extends keyof HTMLElementTagNameMap>(type: K, children?: RawChildren): Block;
|
|
1382
|
+
declare function h<K extends keyof HTMLElementTagNameMap>(type: K, props?: (RawProps & HTMLElementEventHandler) | null, children?: RawChildren | RawSlots): Block;
|
|
1383
|
+
declare function h(type: string, children?: RawChildren): Block;
|
|
1384
|
+
declare function h(type: string, props?: RawProps | null, children?: RawChildren | RawSlots): Block;
|
|
1385
|
+
declare function h(type: typeof Text | typeof Comment, children?: string | number | boolean): Block;
|
|
1386
|
+
declare function h(type: typeof Text | typeof Comment, props?: null, children?: string | number | boolean): Block;
|
|
1387
|
+
declare function h(type: typeof Fragment, children?: NodeArrayChildren): Block;
|
|
1388
|
+
declare function h(type: typeof Fragment, props?: {
|
|
1389
|
+
key?: PropertyKey;
|
|
1390
|
+
ref?: VNodeRef;
|
|
1391
|
+
} | null, children?: NodeArrayChildren): Block;
|
|
1392
|
+
declare function h(type: typeof Teleport, props: RawProps & TeleportProps, children: RawChildren | RawSlots): Block;
|
|
1393
|
+
declare function h(type: typeof Suspense, children?: RawChildren): Block;
|
|
1394
|
+
declare function h(type: typeof Suspense, props?: (RawProps & SuspenseProps) | null, children?: RawChildren | RawSlots): Block;
|
|
1395
|
+
declare function h(type: FunctionalComponent, children?: RawChildren): Block;
|
|
1396
|
+
declare function h<P, E extends EmitsOptions = {}, S extends Record<string, any> = any>(type: FunctionalComponent<P, E, S>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | IfAny<S, RawSlots, S>): Block;
|
|
1397
|
+
declare function h(type: string | ConcreteComponent | Component | ComponentOptions | Constructor | DefineComponent, children?: RawChildren): Block;
|
|
1398
|
+
declare function h<P>(type: string | ConcreteComponent<P> | Component<P> | ComponentOptions<P> | Constructor<P> | DefineComponent<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): Block;
|
|
1399
|
+
//#endregion
|
|
1400
|
+
export { AbstractView, AnchorHTMLAttributes, AnimationEvent, AnimationEventHandler, AreaHTMLAttributes, AriaAttributes, AudioHTMLAttributes, BaseEventHandler, BaseHTMLAttributes, BaseSyntheticEvent, BlockquoteHTMLAttributes, ButtonHTMLAttributes, CSSProperties, CanvasHTMLAttributes, ChangeEvent, ChangeEventHandler, ClipboardEvent, ClipboardEventHandler, ColHTMLAttributes, ColgroupHTMLAttributes, CompositionEvent, CompositionEventHandler, DataHTMLAttributes, DelHTMLAttributes, DetailsHTMLAttributes, DialogHTMLAttributes, DragEvent, DragEventHandler, EmbedHTMLAttributes, EventHandler, EventHandlers, Events, FieldsetHTMLAttributes, FocusEvent, FocusEventHandler, FormEvent, FormEventHandler, FormHTMLAttributes, HTMLAttributes, HtmlHTMLAttributes, IframeHTMLAttributes, ImgHTMLAttributes, InputHTMLAttributes, InputTypeHTMLAttribute, InsHTMLAttributes, IntrinsicElementAttributes, KeyboardEvent, KeyboardEventHandler, KeygenHTMLAttributes, LabelHTMLAttributes, LiHTMLAttributes, LinkHTMLAttributes, MapHTMLAttributes, MediaHTMLAttributes, MenuHTMLAttributes, MetaHTMLAttributes, MeterHTMLAttributes, ModifierKey, MouseEvent, MouseEventHandler, NativeElements, ObjectHTMLAttributes, OlHTMLAttributes, OptgroupHTMLAttributes, OptionHTMLAttributes, OutputHTMLAttributes, ParamHTMLAttributes, ProgressHTMLAttributes, QuoteHTMLAttributes, ReservedProps, SVGAttributes, ScriptHTMLAttributes, SelectHTMLAttributes, SourceHTMLAttributes, StyleHTMLAttributes, StyleValue, SyntheticEvent, TableHTMLAttributes, TdHTMLAttributes, TextareaHTMLAttributes, ThHTMLAttributes, TimeHTMLAttributes, TrackHTMLAttributes, TransitionEvent, TransitionEventHandler, UIEvent, UIEventHandler, VideoHTMLAttributes, WebViewHTMLAttributes, WheelEvent, WheelEventHandler, createComponent, createComponentWithFallback, createNodes, getCurrentInstance, h, isBlock, setNodes, useFullProps, useProps, useRef };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import * as Vue from "vue";
|
|
2
|
-
import * as
|
|
3
|
-
import { GenericComponentInstance, VaporFragment, createComponent as createComponent$1, shallowRef as useRef } from "vue";
|
|
2
|
+
import * as vue15 from "vue";
|
|
3
|
+
import { Block, Component, ComponentOptions, ConcreteComponent, DefineComponent, EmitsOptions, Fragment, FunctionalComponent, GenericComponentInstance, RawSlots, Suspense, SuspenseProps, Teleport, TeleportProps, VNodeRef, VaporComponent, VaporFragment, createComponent as createComponent$1, createComponentWithFallback as createComponentWithFallback$1, shallowRef as useRef } from "vue";
|
|
4
4
|
import * as CSS from "csstype";
|
|
5
5
|
|
|
6
6
|
//#region src/core/runtime.d.ts
|
|
7
|
+
declare function isBlock(val: NonNullable<unknown>): val is Block;
|
|
7
8
|
declare function getCurrentInstance(): GenericComponentInstance | null;
|
|
8
|
-
|
|
9
|
+
type Tail<T extends any[]> = T extends [any, ...infer R] ? R : never;
|
|
10
|
+
declare const createComponent: (type: VaporComponent | typeof Fragment, ...args: Tail<Parameters<typeof createComponent$1>>) => Vue.VaporComponentInstance | HTMLElement;
|
|
11
|
+
declare const createComponentWithFallback: (type: VaporComponent | typeof Fragment, ...args: Tail<Parameters<typeof createComponentWithFallback$1>>) => Vue.VaporComponentInstance | HTMLElement;
|
|
9
12
|
/**
|
|
10
13
|
* Returns the props of the current component instance.
|
|
11
14
|
*
|
|
@@ -1228,7 +1231,7 @@ interface Events<T = Element> {
|
|
|
1228
1231
|
onTransitionstart: TransitionEventHandler<T>;
|
|
1229
1232
|
}
|
|
1230
1233
|
type EventHandlers<E> = { [K in keyof E]?: E[K] extends ((...args: any) => any) ? E[K] : (payload: E[K]) => void };
|
|
1231
|
-
type _ReservedProps =
|
|
1234
|
+
type _ReservedProps = vue15.ReservedProps;
|
|
1232
1235
|
interface ReservedProps extends _ReservedProps {}
|
|
1233
1236
|
type NativeElements = { [K in keyof IntrinsicElementAttributes]: IntrinsicElementAttributes[K] & ReservedProps };
|
|
1234
1237
|
interface BaseSyntheticEvent<E = object, C = unknown, T = unknown> {
|
|
@@ -1360,4 +1363,38 @@ interface TransitionEvent<T = Element> extends SyntheticEvent<T, globalThis.Tran
|
|
|
1360
1363
|
}
|
|
1361
1364
|
type TransitionEventHandler<T = Element> = EventHandler<TransitionEvent<T>>;
|
|
1362
1365
|
//#endregion
|
|
1363
|
-
|
|
1366
|
+
//#region src/core/h.d.ts
|
|
1367
|
+
type NodeChildAtom = Block | string | number | boolean | null | undefined | void;
|
|
1368
|
+
type NodeArrayChildren = Array<NodeArrayChildren | NodeChildAtom>;
|
|
1369
|
+
type RawChildren = NodeChildAtom | NodeArrayChildren;
|
|
1370
|
+
interface Constructor<P = any> {
|
|
1371
|
+
__isFragment?: never;
|
|
1372
|
+
__isTeleport?: never;
|
|
1373
|
+
__isSuspense?: never;
|
|
1374
|
+
new (...args: any[]): {
|
|
1375
|
+
$props: P;
|
|
1376
|
+
};
|
|
1377
|
+
}
|
|
1378
|
+
type HTMLElementEventHandler = { [K in keyof HTMLElementEventMap as `on${Capitalize<K>}`]?: (ev: HTMLElementEventMap[K]) => any };
|
|
1379
|
+
type IfAny<T, Y, N> = 0 extends 1 & T ? Y : N;
|
|
1380
|
+
type RawProps = Record<string, any>;
|
|
1381
|
+
declare function h<K extends keyof HTMLElementTagNameMap>(type: K, children?: RawChildren): Block;
|
|
1382
|
+
declare function h<K extends keyof HTMLElementTagNameMap>(type: K, props?: (RawProps & HTMLElementEventHandler) | null, children?: RawChildren | RawSlots): Block;
|
|
1383
|
+
declare function h(type: string, children?: RawChildren): Block;
|
|
1384
|
+
declare function h(type: string, props?: RawProps | null, children?: RawChildren | RawSlots): Block;
|
|
1385
|
+
declare function h(type: typeof Text | typeof Comment, children?: string | number | boolean): Block;
|
|
1386
|
+
declare function h(type: typeof Text | typeof Comment, props?: null, children?: string | number | boolean): Block;
|
|
1387
|
+
declare function h(type: typeof Fragment, children?: NodeArrayChildren): Block;
|
|
1388
|
+
declare function h(type: typeof Fragment, props?: {
|
|
1389
|
+
key?: PropertyKey;
|
|
1390
|
+
ref?: VNodeRef;
|
|
1391
|
+
} | null, children?: NodeArrayChildren): Block;
|
|
1392
|
+
declare function h(type: typeof Teleport, props: RawProps & TeleportProps, children: RawChildren | RawSlots): Block;
|
|
1393
|
+
declare function h(type: typeof Suspense, children?: RawChildren): Block;
|
|
1394
|
+
declare function h(type: typeof Suspense, props?: (RawProps & SuspenseProps) | null, children?: RawChildren | RawSlots): Block;
|
|
1395
|
+
declare function h(type: FunctionalComponent, children?: RawChildren): Block;
|
|
1396
|
+
declare function h<P, E extends EmitsOptions = {}, S extends Record<string, any> = any>(type: FunctionalComponent<P, E, S>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | IfAny<S, RawSlots, S>): Block;
|
|
1397
|
+
declare function h(type: string | ConcreteComponent | Component | ComponentOptions | Constructor | DefineComponent, children?: RawChildren): Block;
|
|
1398
|
+
declare function h<P>(type: string | ConcreteComponent<P> | Component<P> | ComponentOptions<P> | Constructor<P> | DefineComponent<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): Block;
|
|
1399
|
+
//#endregion
|
|
1400
|
+
export { AbstractView, AnchorHTMLAttributes, AnimationEvent, AnimationEventHandler, AreaHTMLAttributes, AriaAttributes, AudioHTMLAttributes, BaseEventHandler, BaseHTMLAttributes, BaseSyntheticEvent, BlockquoteHTMLAttributes, ButtonHTMLAttributes, CSSProperties, CanvasHTMLAttributes, ChangeEvent, ChangeEventHandler, ClipboardEvent, ClipboardEventHandler, ColHTMLAttributes, ColgroupHTMLAttributes, CompositionEvent, CompositionEventHandler, DataHTMLAttributes, DelHTMLAttributes, DetailsHTMLAttributes, DialogHTMLAttributes, DragEvent, DragEventHandler, EmbedHTMLAttributes, EventHandler, EventHandlers, Events, FieldsetHTMLAttributes, FocusEvent, FocusEventHandler, FormEvent, FormEventHandler, FormHTMLAttributes, HTMLAttributes, HtmlHTMLAttributes, IframeHTMLAttributes, ImgHTMLAttributes, InputHTMLAttributes, InputTypeHTMLAttribute, InsHTMLAttributes, IntrinsicElementAttributes, KeyboardEvent, KeyboardEventHandler, KeygenHTMLAttributes, LabelHTMLAttributes, LiHTMLAttributes, LinkHTMLAttributes, MapHTMLAttributes, MediaHTMLAttributes, MenuHTMLAttributes, MetaHTMLAttributes, MeterHTMLAttributes, ModifierKey, MouseEvent, MouseEventHandler, NativeElements, ObjectHTMLAttributes, OlHTMLAttributes, OptgroupHTMLAttributes, OptionHTMLAttributes, OutputHTMLAttributes, ParamHTMLAttributes, ProgressHTMLAttributes, QuoteHTMLAttributes, ReservedProps, SVGAttributes, ScriptHTMLAttributes, SelectHTMLAttributes, SourceHTMLAttributes, StyleHTMLAttributes, StyleValue, SyntheticEvent, TableHTMLAttributes, TdHTMLAttributes, TextareaHTMLAttributes, ThHTMLAttributes, TimeHTMLAttributes, TrackHTMLAttributes, TransitionEvent, TransitionEventHandler, UIEvent, UIEventHandler, VideoHTMLAttributes, WebViewHTMLAttributes, WheelEvent, WheelEventHandler, createComponent, createComponentWithFallback, createNodes, getCurrentInstance, h, isBlock, setNodes, useFullProps, useProps, useRef };
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
import * as Vue from "vue";
|
|
2
|
-
import { EffectScope, VaporFragment, createComponent as createComponent$1, insert, isFragment, isVaporComponent, proxyRefs, remove, renderEffect, shallowRef as useRef, toRefs, useAttrs } from "vue";
|
|
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
3
|
|
|
4
4
|
//#region src/core/runtime.ts
|
|
5
|
+
function isBlock(val) {
|
|
6
|
+
return val instanceof Node || Array.isArray(val) || isVaporComponent(val) || isFragment(val);
|
|
7
|
+
}
|
|
5
8
|
function getCurrentInstance() {
|
|
6
9
|
return Vue.currentInstance || Vue.getCurrentInstance();
|
|
7
10
|
}
|
|
8
|
-
const
|
|
9
|
-
|
|
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);
|
|
11
18
|
};
|
|
19
|
+
const createComponent = (type, ...args) => {
|
|
20
|
+
return createProxyComponent(createComponent$1, type, ...args);
|
|
21
|
+
};
|
|
22
|
+
const createComponentWithFallback = (type, ...args) => createProxyComponent(createComponentWithFallback$1, type, ...args);
|
|
12
23
|
/**
|
|
13
24
|
* Returns the props of the current component instance.
|
|
14
25
|
*
|
|
@@ -48,7 +59,7 @@ function createFragment(nodes, anchor = document.createTextNode("")) {
|
|
|
48
59
|
frag.anchor = anchor;
|
|
49
60
|
return frag;
|
|
50
61
|
}
|
|
51
|
-
function normalizeNode(node, anchor) {
|
|
62
|
+
function normalizeNode$1(node, anchor) {
|
|
52
63
|
if (node instanceof Node || isFragment(node)) {
|
|
53
64
|
anchor && (anchor.textContent = "");
|
|
54
65
|
return node;
|
|
@@ -57,7 +68,7 @@ function normalizeNode(node, anchor) {
|
|
|
57
68
|
return createFragment(node, anchor);
|
|
58
69
|
} else if (Array.isArray(node)) {
|
|
59
70
|
anchor && (anchor.textContent = "");
|
|
60
|
-
return createFragment(node.map((i) => normalizeNode(i)), anchor);
|
|
71
|
+
return createFragment(node.map((i) => normalizeNode$1(i)), anchor);
|
|
61
72
|
} else {
|
|
62
73
|
const result = node == null || typeof node === "boolean" ? "" : String(node);
|
|
63
74
|
if (anchor) {
|
|
@@ -67,7 +78,7 @@ function normalizeNode(node, anchor) {
|
|
|
67
78
|
}
|
|
68
79
|
}
|
|
69
80
|
function resolveValue(current, value, _anchor) {
|
|
70
|
-
const node = normalizeNode(value, _anchor);
|
|
81
|
+
const node = normalizeNode$1(value, _anchor);
|
|
71
82
|
if (current) {
|
|
72
83
|
if (isFragment(current)) {
|
|
73
84
|
const { anchor } = current;
|
|
@@ -114,4 +125,24 @@ function createNodes(...values) {
|
|
|
114
125
|
}
|
|
115
126
|
|
|
116
127
|
//#endregion
|
|
117
|
-
|
|
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 };
|
package/dist/nuxt.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
3
3
|
require('./core-C-41-Q2Y.cjs');
|
|
4
|
-
require('./raw-
|
|
5
|
-
require('./unplugin-
|
|
6
|
-
const require_vite = require('./vite-
|
|
7
|
-
const require_webpack = require('./webpack-
|
|
4
|
+
require('./raw-B2YMrqwY.cjs');
|
|
5
|
+
require('./unplugin-aKVZLoq9.cjs');
|
|
6
|
+
const require_vite = require('./vite-C63GJQHT.cjs');
|
|
7
|
+
const require_webpack = require('./webpack-CeAur76z.cjs');
|
|
8
8
|
const __nuxt_kit = require_chunk.__toESM(require("@nuxt/kit"));
|
|
9
9
|
require("@nuxt/schema");
|
|
10
10
|
|
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_schema9 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_schema9.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_schema0 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_schema0.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { ModuleOptions, _default as default };
|
package/dist/nuxt.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./core-CJgJmh2O.js";
|
|
2
|
-
import "./raw-
|
|
3
|
-
import "./unplugin-
|
|
4
|
-
import { vite_default } from "./vite-
|
|
5
|
-
import { webpack_default } from "./webpack-
|
|
2
|
+
import "./raw-CWZ5g7Vk.js";
|
|
3
|
+
import "./unplugin-CyifZGPt.js";
|
|
4
|
+
import { vite_default } from "./vite-Djd6MAt9.js";
|
|
5
|
+
import { webpack_default } from "./webpack-3fgVTA33.js";
|
|
6
6
|
import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from "@nuxt/kit";
|
|
7
7
|
import "@nuxt/schema";
|
|
8
8
|
|
|
@@ -90,11 +90,7 @@ function injectHMRAndSSR(result, id, options) {
|
|
|
90
90
|
for (const { local, exported, id: id$1 } of hotComponents) {
|
|
91
91
|
code += `\n${local}.__hmrId = "${id$1}";\n__VUE_HMR_RUNTIME__.createRecord("${id$1}", ${local});`;
|
|
92
92
|
callbackCode += `
|
|
93
|
-
|
|
94
|
-
__VUE_HMR_RUNTIME__.rerender(mod['${exported}'].__hmrId, mod['${exported}']);
|
|
95
|
-
} else {
|
|
96
|
-
__VUE_HMR_RUNTIME__.reload(mod['${exported}'].__hmrId, mod['${exported}']);
|
|
97
|
-
};`;
|
|
93
|
+
__VUE_HMR_RUNTIME__[typeof mod['${exported}'] === 'function' ? 'rerender' : 'reload'](mod['${exported}'].__hmrId, mod['${exported}']);`;
|
|
98
94
|
}
|
|
99
95
|
code += `
|
|
100
96
|
if (import.meta.hot) {
|
|
@@ -114,10 +110,6 @@ function isDefineComponentCall(node, names) {
|
|
|
114
110
|
return !!(node && node.type === "CallExpression" && node.callee.type === "Identifier" && names.includes(node.callee.name));
|
|
115
111
|
}
|
|
116
112
|
|
|
117
|
-
//#endregion
|
|
118
|
-
//#region src/core/runtime.ts?raw
|
|
119
|
-
var runtime_default = "import {\n createComponent as _createComponent,\n EffectScope,\n insert,\n isFragment,\n isVaporComponent,\n proxyRefs,\n remove,\n renderEffect,\n toRefs,\n useAttrs,\n VaporFragment\n} from \"vue\";\nimport * as Vue from \"vue\";\nexport function getCurrentInstance() {\n return Vue.currentInstance || Vue.getCurrentInstance();\n}\nexport { shallowRef as useRef } from \"vue\";\nexport const createComponent = (...args) => {\n typeof args[0] === \"function\" && (args[0].__vapor = true);\n return _createComponent(...args);\n};\nexport function useProps() {\n const i = getCurrentInstance();\n return i.props;\n}\nexport function useFullProps() {\n return proxyRefs({\n ...toRefs(useProps()),\n ...toRefs(useAttrs())\n });\n}\nfunction createFragment(nodes, anchor = document.createTextNode(\"\")) {\n const frag = new VaporFragment(nodes);\n frag.anchor = anchor;\n return frag;\n}\nfunction normalizeNode(node, anchor) {\n if (node instanceof Node || isFragment(node)) {\n anchor && (anchor.textContent = \"\");\n return node;\n } else if (isVaporComponent(node)) {\n anchor && (anchor.textContent = \"\");\n return createFragment(node, anchor);\n } else if (Array.isArray(node)) {\n anchor && (anchor.textContent = \"\");\n return createFragment(\n node.map((i) => normalizeNode(i)),\n anchor\n );\n } else {\n const result = node == null || typeof node === \"boolean\" ? \"\" : String(node);\n if (anchor) {\n anchor.textContent = result;\n return anchor;\n } else {\n return document.createTextNode(result);\n }\n }\n}\nfunction resolveValue(current, value, _anchor) {\n const node = normalizeNode(value, _anchor);\n if (current) {\n if (isFragment(current)) {\n const { anchor } = current;\n if (anchor && anchor.parentNode) {\n remove(current.nodes, anchor.parentNode);\n insert(node, anchor.parentNode, anchor);\n !_anchor && anchor.parentNode.removeChild(anchor);\n }\n } else if (current instanceof Node) {\n if (isFragment(node) && current.parentNode) {\n insert(node, current.parentNode, current);\n current.parentNode.removeChild(current);\n } else if (node instanceof Node) {\n if (current.nodeType === 3 && node.nodeType === 3) {\n current.textContent = node.textContent;\n return current;\n } else if (current.parentNode) {\n current.parentNode.replaceChild(node, current);\n }\n }\n }\n }\n return node;\n}\nfunction resolveValues(values = [], _anchor) {\n const nodes = [];\n const frag = createFragment(nodes, _anchor);\n const scopes = [];\n for (const [index, value] of values.entries()) {\n const anchor = index === values.length - 1 ? _anchor : void 0;\n if (typeof value === \"function\") {\n renderEffect(() => {\n if (scopes[index]) scopes[index].stop();\n scopes[index] = new EffectScope();\n nodes[index] = scopes[index].run(\n () => resolveValue(nodes[index], value(), anchor)\n );\n });\n } else {\n nodes[index] = resolveValue(nodes[index], value, anchor);\n }\n }\n return frag;\n}\nexport function setNodes(anchor, ...values) {\n const resolvedValues = resolveValues(values, anchor);\n anchor.parentNode && insert(resolvedValues, anchor.parentNode, anchor);\n}\nexport function createNodes(...values) {\n return resolveValues(values);\n}\n";
|
|
120
|
-
|
|
121
113
|
//#endregion
|
|
122
114
|
//#region src/core/vue-jsx.ts
|
|
123
115
|
function transformVueJsx(code, id, needSourceMap = false) {
|
|
@@ -167,15 +159,12 @@ const plugin = (options = {}) => {
|
|
|
167
159
|
},
|
|
168
160
|
resolveId(id) {
|
|
169
161
|
if (id === ssrRegisterHelperId) return id;
|
|
170
|
-
if ((0, unplugin_utils.normalizePath)(id) === "vue-jsx-vapor/runtime") return id;
|
|
171
162
|
},
|
|
172
163
|
loadInclude(id) {
|
|
173
164
|
if (id === ssrRegisterHelperId) return true;
|
|
174
|
-
return (0, unplugin_utils.normalizePath)(id) === "vue-jsx-vapor/runtime";
|
|
175
165
|
},
|
|
176
166
|
load(id) {
|
|
177
167
|
if (id === ssrRegisterHelperId) return ssrRegisterHelperCode;
|
|
178
|
-
if ((0, unplugin_utils.normalizePath)(id) === "vue-jsx-vapor/runtime") return runtime_default;
|
|
179
168
|
},
|
|
180
169
|
transformInclude,
|
|
181
170
|
transform(code, id, opt) {
|
|
@@ -89,11 +89,7 @@ function injectHMRAndSSR(result, id, options) {
|
|
|
89
89
|
for (const { local, exported, id: id$1 } of hotComponents) {
|
|
90
90
|
code += `\n${local}.__hmrId = "${id$1}";\n__VUE_HMR_RUNTIME__.createRecord("${id$1}", ${local});`;
|
|
91
91
|
callbackCode += `
|
|
92
|
-
|
|
93
|
-
__VUE_HMR_RUNTIME__.rerender(mod['${exported}'].__hmrId, mod['${exported}']);
|
|
94
|
-
} else {
|
|
95
|
-
__VUE_HMR_RUNTIME__.reload(mod['${exported}'].__hmrId, mod['${exported}']);
|
|
96
|
-
};`;
|
|
92
|
+
__VUE_HMR_RUNTIME__[typeof mod['${exported}'] === 'function' ? 'rerender' : 'reload'](mod['${exported}'].__hmrId, mod['${exported}']);`;
|
|
97
93
|
}
|
|
98
94
|
code += `
|
|
99
95
|
if (import.meta.hot) {
|
|
@@ -113,10 +109,6 @@ function isDefineComponentCall(node, names) {
|
|
|
113
109
|
return !!(node && node.type === "CallExpression" && node.callee.type === "Identifier" && names.includes(node.callee.name));
|
|
114
110
|
}
|
|
115
111
|
|
|
116
|
-
//#endregion
|
|
117
|
-
//#region src/core/runtime.ts?raw
|
|
118
|
-
var runtime_default = "import {\n createComponent as _createComponent,\n EffectScope,\n insert,\n isFragment,\n isVaporComponent,\n proxyRefs,\n remove,\n renderEffect,\n toRefs,\n useAttrs,\n VaporFragment\n} from \"vue\";\nimport * as Vue from \"vue\";\nexport function getCurrentInstance() {\n return Vue.currentInstance || Vue.getCurrentInstance();\n}\nexport { shallowRef as useRef } from \"vue\";\nexport const createComponent = (...args) => {\n typeof args[0] === \"function\" && (args[0].__vapor = true);\n return _createComponent(...args);\n};\nexport function useProps() {\n const i = getCurrentInstance();\n return i.props;\n}\nexport function useFullProps() {\n return proxyRefs({\n ...toRefs(useProps()),\n ...toRefs(useAttrs())\n });\n}\nfunction createFragment(nodes, anchor = document.createTextNode(\"\")) {\n const frag = new VaporFragment(nodes);\n frag.anchor = anchor;\n return frag;\n}\nfunction normalizeNode(node, anchor) {\n if (node instanceof Node || isFragment(node)) {\n anchor && (anchor.textContent = \"\");\n return node;\n } else if (isVaporComponent(node)) {\n anchor && (anchor.textContent = \"\");\n return createFragment(node, anchor);\n } else if (Array.isArray(node)) {\n anchor && (anchor.textContent = \"\");\n return createFragment(\n node.map((i) => normalizeNode(i)),\n anchor\n );\n } else {\n const result = node == null || typeof node === \"boolean\" ? \"\" : String(node);\n if (anchor) {\n anchor.textContent = result;\n return anchor;\n } else {\n return document.createTextNode(result);\n }\n }\n}\nfunction resolveValue(current, value, _anchor) {\n const node = normalizeNode(value, _anchor);\n if (current) {\n if (isFragment(current)) {\n const { anchor } = current;\n if (anchor && anchor.parentNode) {\n remove(current.nodes, anchor.parentNode);\n insert(node, anchor.parentNode, anchor);\n !_anchor && anchor.parentNode.removeChild(anchor);\n }\n } else if (current instanceof Node) {\n if (isFragment(node) && current.parentNode) {\n insert(node, current.parentNode, current);\n current.parentNode.removeChild(current);\n } else if (node instanceof Node) {\n if (current.nodeType === 3 && node.nodeType === 3) {\n current.textContent = node.textContent;\n return current;\n } else if (current.parentNode) {\n current.parentNode.replaceChild(node, current);\n }\n }\n }\n }\n return node;\n}\nfunction resolveValues(values = [], _anchor) {\n const nodes = [];\n const frag = createFragment(nodes, _anchor);\n const scopes = [];\n for (const [index, value] of values.entries()) {\n const anchor = index === values.length - 1 ? _anchor : void 0;\n if (typeof value === \"function\") {\n renderEffect(() => {\n if (scopes[index]) scopes[index].stop();\n scopes[index] = new EffectScope();\n nodes[index] = scopes[index].run(\n () => resolveValue(nodes[index], value(), anchor)\n );\n });\n } else {\n nodes[index] = resolveValue(nodes[index], value, anchor);\n }\n }\n return frag;\n}\nexport function setNodes(anchor, ...values) {\n const resolvedValues = resolveValues(values, anchor);\n anchor.parentNode && insert(resolvedValues, anchor.parentNode, anchor);\n}\nexport function createNodes(...values) {\n return resolveValues(values);\n}\n";
|
|
119
|
-
|
|
120
112
|
//#endregion
|
|
121
113
|
//#region src/core/vue-jsx.ts
|
|
122
114
|
function transformVueJsx(code, id, needSourceMap = false) {
|
|
@@ -166,15 +158,12 @@ const plugin = (options = {}) => {
|
|
|
166
158
|
},
|
|
167
159
|
resolveId(id) {
|
|
168
160
|
if (id === ssrRegisterHelperId) return id;
|
|
169
|
-
if (normalizePath(id) === "vue-jsx-vapor/runtime") return id;
|
|
170
161
|
},
|
|
171
162
|
loadInclude(id) {
|
|
172
163
|
if (id === ssrRegisterHelperId) return true;
|
|
173
|
-
return normalizePath(id) === "vue-jsx-vapor/runtime";
|
|
174
164
|
},
|
|
175
165
|
load(id) {
|
|
176
166
|
if (id === ssrRegisterHelperId) return ssrRegisterHelperCode;
|
|
177
|
-
if (normalizePath(id) === "vue-jsx-vapor/runtime") return runtime_default;
|
|
178
167
|
},
|
|
179
168
|
transformInclude,
|
|
180
169
|
transform(code, id, opt) {
|
package/dist/raw.cjs
CHANGED
package/dist/raw.js
CHANGED
package/dist/rolldown.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
3
3
|
require('./core-C-41-Q2Y.cjs');
|
|
4
|
-
require('./raw-
|
|
5
|
-
const require_unplugin = require('./unplugin-
|
|
4
|
+
require('./raw-B2YMrqwY.cjs');
|
|
5
|
+
const require_unplugin = require('./unplugin-aKVZLoq9.cjs');
|
|
6
6
|
const unplugin = require_chunk.__toESM(require("unplugin"));
|
|
7
7
|
|
|
8
8
|
//#region src/rolldown.ts
|
package/dist/rolldown.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Options } from "./options-jKAq0dFf.cjs";
|
|
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/rolldown.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Options } from "./options-CBMw6D8V.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as rollup10 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) => rollup10.Plugin<any> | rollup10.Plugin<any>[];
|
|
6
6
|
//#endregion
|
|
7
7
|
export { _default as default };
|
package/dist/rolldown.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./core-CJgJmh2O.js";
|
|
2
|
-
import "./raw-
|
|
3
|
-
import { unpluginFactory } from "./unplugin-
|
|
2
|
+
import "./raw-CWZ5g7Vk.js";
|
|
3
|
+
import { unpluginFactory } from "./unplugin-CyifZGPt.js";
|
|
4
4
|
import { createRollupPlugin } from "unplugin";
|
|
5
5
|
|
|
6
6
|
//#region src/rolldown.ts
|
package/dist/rollup.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
require('./core-C-41-Q2Y.cjs');
|
|
3
|
-
require('./raw-
|
|
4
|
-
const require_unplugin = require('./unplugin-
|
|
3
|
+
require('./raw-B2YMrqwY.cjs');
|
|
4
|
+
const require_unplugin = require('./unplugin-aKVZLoq9.cjs');
|
|
5
5
|
|
|
6
6
|
//#region src/rollup.ts
|
|
7
7
|
var rollup_default = require_unplugin.unplugin_default.rollup;
|
package/dist/rollup.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Options } from "./options-jKAq0dFf.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as rollup6 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) => rollup6.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/rollup.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./core-CJgJmh2O.js";
|
|
2
|
-
import "./raw-
|
|
3
|
-
import { unplugin_default } from "./unplugin-
|
|
2
|
+
import "./raw-CWZ5g7Vk.js";
|
|
3
|
+
import { unplugin_default } from "./unplugin-CyifZGPt.js";
|
|
4
4
|
|
|
5
5
|
//#region src/rollup.ts
|
|
6
6
|
var rollup_default = unplugin_default.rollup;
|
package/dist/rspack.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
require('./core-C-41-Q2Y.cjs');
|
|
3
|
-
require('./raw-
|
|
4
|
-
const require_unplugin = require('./unplugin-
|
|
3
|
+
require('./raw-B2YMrqwY.cjs');
|
|
4
|
+
const require_unplugin = require('./unplugin-aKVZLoq9.cjs');
|
|
5
5
|
|
|
6
6
|
//#region src/rspack.ts
|
|
7
7
|
var rspack_default = require_unplugin.unplugin_default.rspack;
|
package/dist/rspack.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./core-CJgJmh2O.js";
|
|
2
|
-
import "./raw-
|
|
3
|
-
import { unplugin_default } from "./unplugin-
|
|
2
|
+
import "./raw-CWZ5g7Vk.js";
|
|
3
|
+
import { unplugin_default } from "./unplugin-CyifZGPt.js";
|
|
4
4
|
|
|
5
5
|
//#region src/rspack.ts
|
|
6
6
|
var rspack_default = unplugin_default.rspack;
|
package/dist/unplugin.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
require('./core-C-41-Q2Y.cjs');
|
|
3
|
-
require('./raw-
|
|
4
|
-
const require_unplugin = require('./unplugin-
|
|
3
|
+
require('./raw-B2YMrqwY.cjs');
|
|
4
|
+
const require_unplugin = require('./unplugin-aKVZLoq9.cjs');
|
|
5
5
|
|
|
6
6
|
exports.default = require_unplugin.unplugin_default;
|
|
7
7
|
exports.unplugin = require_unplugin.unplugin;
|
package/dist/unplugin.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Options } from "./options-jKAq0dFf.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as unplugin8 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: unplugin8.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 unplugin3 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: unplugin3.UnpluginInstance<Options | undefined, true>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { Options, unplugin as default, unplugin, unpluginFactory };
|
package/dist/unplugin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./core-CJgJmh2O.js";
|
|
2
|
-
import "./raw-
|
|
3
|
-
import { unplugin, unpluginFactory, unplugin_default } from "./unplugin-
|
|
2
|
+
import "./raw-CWZ5g7Vk.js";
|
|
3
|
+
import { unplugin, unpluginFactory, unplugin_default } from "./unplugin-CyifZGPt.js";
|
|
4
4
|
|
|
5
5
|
export { unplugin_default as default, unplugin, unpluginFactory };
|
package/dist/vite.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
require('./core-C-41-Q2Y.cjs');
|
|
3
|
-
require('./raw-
|
|
4
|
-
require('./unplugin-
|
|
5
|
-
const require_vite = require('./vite-
|
|
3
|
+
require('./raw-B2YMrqwY.cjs');
|
|
4
|
+
require('./unplugin-aKVZLoq9.cjs');
|
|
5
|
+
const require_vite = require('./vite-C63GJQHT.cjs');
|
|
6
6
|
|
|
7
7
|
exports.default = require_vite.vite_default;
|
package/dist/vite.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Options } from "./options-jKAq0dFf.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vite11 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) => vite11.Plugin<any>[];
|
|
6
6
|
//#endregion
|
|
7
7
|
export { _default as default };
|
package/dist/vite.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Options } from "./options-CBMw6D8V.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vite5 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) => vite5.Plugin<any>[];
|
|
6
6
|
//#endregion
|
|
7
7
|
export { _default as default };
|
package/dist/vite.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./core-CJgJmh2O.js";
|
|
2
|
-
import "./raw-
|
|
3
|
-
import "./unplugin-
|
|
4
|
-
import { vite_default } from "./vite-
|
|
2
|
+
import "./raw-CWZ5g7Vk.js";
|
|
3
|
+
import "./unplugin-CyifZGPt.js";
|
|
4
|
+
import { vite_default } from "./vite-Djd6MAt9.js";
|
|
5
5
|
|
|
6
6
|
export { vite_default as default };
|
package/dist/webpack.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
require('./core-C-41-Q2Y.cjs');
|
|
3
|
-
require('./raw-
|
|
4
|
-
require('./unplugin-
|
|
5
|
-
const require_webpack = require('./webpack-
|
|
3
|
+
require('./raw-B2YMrqwY.cjs');
|
|
4
|
+
require('./unplugin-aKVZLoq9.cjs');
|
|
5
|
+
const require_webpack = require('./webpack-CeAur76z.cjs');
|
|
6
6
|
|
|
7
7
|
exports.default = require_webpack.webpack_default;
|
package/dist/webpack.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Options } from "./options-jKAq0dFf.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as webpack13 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) => webpack13.WebpackPluginInstance;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { _default as default };
|
package/dist/webpack.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Options } from "./options-CBMw6D8V.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as webpack13 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) => webpack13.WebpackPluginInstance;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { _default as default };
|
package/dist/webpack.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./core-CJgJmh2O.js";
|
|
2
|
-
import "./raw-
|
|
3
|
-
import "./unplugin-
|
|
4
|
-
import { webpack_default } from "./webpack-
|
|
2
|
+
import "./raw-CWZ5g7Vk.js";
|
|
3
|
+
import "./unplugin-CyifZGPt.js";
|
|
4
|
+
import { webpack_default } from "./webpack-3fgVTA33.js";
|
|
5
5
|
|
|
6
6
|
export { webpack_default as default };
|
package/jsx-runtime/index.cjs
CHANGED
|
@@ -22,13 +22,15 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
22
|
|
|
23
23
|
//#endregion
|
|
24
24
|
const vue = __toESM(require("vue"));
|
|
25
|
+
const vue_jsx_vapor = __toESM(require("vue-jsx-vapor"));
|
|
25
26
|
|
|
26
27
|
//#region src/jsx-runtime.ts
|
|
27
28
|
function jsx(type, props, key) {
|
|
28
|
-
const { children } = props;
|
|
29
|
+
const { children, ["v-slots"]: vSlots } = props;
|
|
29
30
|
delete props.children;
|
|
31
|
+
delete props["v-slots"];
|
|
30
32
|
if (arguments.length > 2) props.key = key;
|
|
31
|
-
return (0,
|
|
33
|
+
return (0, vue_jsx_vapor.h)(type, props, vSlots || children);
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
//#endregion
|
package/jsx-runtime/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { NativeElements, ReservedProps } from "vue-jsx-vapor";
|
|
1
|
+
import { Block, Fragment } from "vue";
|
|
2
|
+
import { NativeElements, ReservedProps, h } from "vue-jsx-vapor";
|
|
3
3
|
|
|
4
4
|
//#region src/jsx-runtime.d.ts
|
|
5
5
|
declare function jsx(type: any, props: any, key: any): ReturnType<typeof h>;
|
|
6
6
|
declare global {
|
|
7
7
|
namespace JSX {
|
|
8
|
-
|
|
8
|
+
type Element = Block;
|
|
9
9
|
interface ElementClass {
|
|
10
10
|
$props: {};
|
|
11
11
|
}
|
package/jsx-runtime/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { NativeElements, ReservedProps } from "vue-jsx-vapor";
|
|
1
|
+
import { Block, Fragment } from "vue";
|
|
2
|
+
import { NativeElements, ReservedProps, h } from "vue-jsx-vapor";
|
|
3
3
|
|
|
4
4
|
//#region src/jsx-runtime.d.ts
|
|
5
5
|
declare function jsx(type: any, props: any, key: any): ReturnType<typeof h>;
|
|
6
6
|
declare global {
|
|
7
7
|
namespace JSX {
|
|
8
|
-
|
|
8
|
+
type Element = Block;
|
|
9
9
|
interface ElementClass {
|
|
10
10
|
$props: {};
|
|
11
11
|
}
|
package/jsx-runtime/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { Fragment
|
|
1
|
+
import { Fragment } from "vue";
|
|
2
|
+
import { h } from "vue-jsx-vapor";
|
|
2
3
|
|
|
3
4
|
//#region src/jsx-runtime.ts
|
|
4
5
|
function jsx(type, props, key) {
|
|
5
|
-
const { children } = props;
|
|
6
|
+
const { children, ["v-slots"]: vSlots } = props;
|
|
6
7
|
delete props.children;
|
|
8
|
+
delete props["v-slots"];
|
|
7
9
|
if (arguments.length > 2) props.key = key;
|
|
8
|
-
return h(type, props, children);
|
|
10
|
+
return h(type, props, vSlots || children);
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-jsx-vapor",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.4-beta.1",
|
|
4
4
|
"description": "Convert Vue JSX to Vapor",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
"esbuild": "*",
|
|
140
140
|
"rollup": "^3",
|
|
141
141
|
"vite": ">=3",
|
|
142
|
-
"vue": "^3.
|
|
142
|
+
"vue": "^3.6.0",
|
|
143
143
|
"webpack": "^4 || ^5"
|
|
144
144
|
},
|
|
145
145
|
"peerDependenciesMeta": {
|
|
@@ -173,9 +173,9 @@
|
|
|
173
173
|
"ts-macro": "^0.2.7",
|
|
174
174
|
"unplugin": "^2.3.5",
|
|
175
175
|
"unplugin-utils": "^0.2.4",
|
|
176
|
-
"@vue-jsx-vapor/babel": "2.5.
|
|
177
|
-
"@vue-jsx-vapor/compiler": "2.5.
|
|
178
|
-
"@vue-jsx-vapor/macros": "2.5.
|
|
176
|
+
"@vue-jsx-vapor/babel": "2.5.4-beta.1",
|
|
177
|
+
"@vue-jsx-vapor/compiler": "2.5.4-beta.1",
|
|
178
|
+
"@vue-jsx-vapor/macros": "2.5.4-beta.1"
|
|
179
179
|
},
|
|
180
180
|
"devDependencies": {
|
|
181
181
|
"@nuxt/kit": "^3.17.6",
|
|
@@ -183,7 +183,7 @@
|
|
|
183
183
|
"@types/babel__core": "^7.20.5",
|
|
184
184
|
"@types/hash-sum": "^1.0.2",
|
|
185
185
|
"csstype": "^3.1.3",
|
|
186
|
-
"vue": "
|
|
186
|
+
"vue": "3.6.0-alpha.2"
|
|
187
187
|
},
|
|
188
188
|
"scripts": {
|
|
189
189
|
"build": "tsdown",
|