@vue-jsx-vapor/runtime 3.2.10 → 3.2.12
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/{chunk-CbDLau6x.cjs → chunk-CKQMccvm.cjs} +13 -19
- package/dist/h.cjs +5 -6
- package/dist/h.d.cts +0 -1
- package/dist/h.d.ts +0 -1
- package/dist/h.js +1 -3
- package/dist/index.cjs +16 -14
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -4
- package/dist/jsx.cjs +1 -0
- package/dist/jsx.d.cts +3 -2
- package/dist/jsx.d.ts +3 -2
- package/dist/jsx.js +1 -1
- package/dist/props.cjs +7 -10
- package/dist/props.d.cts +2 -2
- package/dist/props.d.ts +2 -2
- package/dist/props.js +5 -9
- package/dist/raw.cjs +5 -10
- package/dist/raw.js +4 -9
- package/dist/ssr.cjs +3 -4
- package/dist/ssr.js +1 -3
- package/dist/types.cjs +1 -0
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/vapor.cjs +19 -6
- package/dist/vapor.d.cts +18 -8
- package/dist/vapor.d.ts +18 -8
- package/dist/vapor.js +16 -5
- package/dist/vdom.cjs +11 -4
- package/dist/vdom.d.cts +18 -2
- package/dist/vdom.d.ts +18 -2
- package/dist/vdom.js +9 -4
- package/package.json +5 -5
- /package/dist/{types-BKjMGTxH.d.cts → types-C847TkaY.d.cts} +0 -0
- /package/dist/{types-CqAkLSQ8.d.ts → types-CLKH5kLf.d.ts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -6,16 +6,12 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
8
|
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
}
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
19
15
|
}
|
|
20
16
|
return to;
|
|
21
17
|
};
|
|
@@ -23,12 +19,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
23
19
|
value: mod,
|
|
24
20
|
enumerable: true
|
|
25
21
|
}) : target, mod));
|
|
26
|
-
|
|
27
22
|
//#endregion
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
});
|
|
23
|
+
Object.defineProperty(exports, "__toESM", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function() {
|
|
26
|
+
return __toESM;
|
|
27
|
+
}
|
|
28
|
+
});
|
package/dist/h.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
const
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_chunk = require("./chunk-CKQMccvm.cjs");
|
|
3
|
+
const require_vapor = require("./vapor.cjs");
|
|
3
4
|
let vue = require("vue");
|
|
4
|
-
vue = require_chunk.__toESM(vue);
|
|
5
|
-
|
|
5
|
+
vue = require_chunk.__toESM(vue, 1);
|
|
6
6
|
//#region src/h.ts
|
|
7
7
|
/* @__NO_SIDE_EFFECTS__ */
|
|
8
8
|
function h(type, props, children) {
|
|
@@ -32,6 +32,5 @@ function resolveProps(props) {
|
|
|
32
32
|
}
|
|
33
33
|
return resolvedProps;
|
|
34
34
|
}
|
|
35
|
-
|
|
36
35
|
//#endregion
|
|
37
|
-
exports.h = h;
|
|
36
|
+
exports.h = h;
|
package/dist/h.d.cts
CHANGED
package/dist/h.d.ts
CHANGED
package/dist/h.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createComponent, createProxyComponent, normalizeNode } from "./vapor.js";
|
|
2
2
|
import * as Vue from "vue";
|
|
3
|
-
|
|
4
3
|
//#region src/h.ts
|
|
5
4
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6
5
|
function h(type, props, children) {
|
|
@@ -30,6 +29,5 @@ function resolveProps(props) {
|
|
|
30
29
|
}
|
|
31
30
|
return resolvedProps;
|
|
32
31
|
}
|
|
33
|
-
|
|
34
32
|
//#endregion
|
|
35
|
-
export { h };
|
|
33
|
+
export { h };
|
package/dist/index.cjs
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
require(
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("./chunk-CKQMccvm.cjs");
|
|
3
|
+
const require_vapor = require("./vapor.cjs");
|
|
4
|
+
const require_h = require("./h.cjs");
|
|
5
|
+
require("./jsx.cjs");
|
|
6
|
+
const require_props = require("./props.cjs");
|
|
7
|
+
const require_ssr = require("./ssr.cjs");
|
|
8
|
+
const require_vdom = require("./vdom.cjs");
|
|
8
9
|
let vue = require("vue");
|
|
9
|
-
|
|
10
|
+
exports.For = require_vdom.For;
|
|
11
|
+
exports.VaporFor = require_vapor.VaporFor;
|
|
10
12
|
exports.createComponent = require_vapor.createComponent;
|
|
11
13
|
exports.createNodes = require_vapor.createNodes;
|
|
12
14
|
exports.createProxyComponent = require_vapor.createProxyComponent;
|
|
@@ -24,9 +26,9 @@ exports.setNodes = require_vapor.setNodes;
|
|
|
24
26
|
exports.ssrRegisterHelper = require_ssr.ssrRegisterHelper;
|
|
25
27
|
exports.useFullProps = require_props.useFullProps;
|
|
26
28
|
exports.useProps = require_props.useProps;
|
|
27
|
-
Object.defineProperty(exports,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
});
|
|
29
|
+
Object.defineProperty(exports, "useRef", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: function() {
|
|
32
|
+
return vue.shallowRef;
|
|
33
|
+
}
|
|
34
|
+
});
|
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "./types-
|
|
2
|
-
import { DefineVaporComponent, DefineVaporSetupFnComponent, NodeArrayChildren, NodeChild, createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes } from "./vapor.cjs";
|
|
1
|
+
import { i as SlotsToProps } from "./types-C847TkaY.cjs";
|
|
2
|
+
import { DefineVaporComponent, DefineVaporSetupFnComponent, NodeArrayChildren, NodeChild, VaporFor, createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes } from "./vapor.cjs";
|
|
3
3
|
import { h } from "./h.cjs";
|
|
4
4
|
import { 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, SVGAttributes, ScriptHTMLAttributes, SelectHTMLAttributes, SourceHTMLAttributes, StyleHTMLAttributes, StyleValue, SyntheticEvent, TableHTMLAttributes, TdHTMLAttributes, TextareaHTMLAttributes, ThHTMLAttributes, TimeHTMLAttributes, TrackHTMLAttributes, TransitionEvent, TransitionEventHandler, UIEvent, UIEventHandler, VideoHTMLAttributes, WebViewHTMLAttributes, WheelEvent, WheelEventHandler } from "./jsx.cjs";
|
|
5
5
|
import { getCurrentInstance, useFullProps, useProps } from "./props.cjs";
|
|
6
6
|
import { ssrRegisterHelper } from "./ssr.cjs";
|
|
7
|
-
import { DefineComponent, DefineSetupFnComponent, createVNodeCache, defineComponent, normalizeSlot, normalizeVNode } from "./vdom.cjs";
|
|
7
|
+
import { DefineComponent, DefineSetupFnComponent, For, createVNodeCache, defineComponent, normalizeSlot, normalizeVNode } from "./vdom.cjs";
|
|
8
8
|
import { shallowRef as useRef } from "vue";
|
|
9
|
-
export { AbstractView, AnchorHTMLAttributes, AnimationEvent, AnimationEventHandler, AreaHTMLAttributes, AriaAttributes, AudioHTMLAttributes, BaseEventHandler, BaseHTMLAttributes, BaseSyntheticEvent, BlockquoteHTMLAttributes, ButtonHTMLAttributes, CSSProperties, CanvasHTMLAttributes, ChangeEvent, ChangeEventHandler, ClipboardEvent, ClipboardEventHandler, ColHTMLAttributes, ColgroupHTMLAttributes, CompositionEvent, CompositionEventHandler, DataHTMLAttributes, DefineComponent, DefineSetupFnComponent, DefineVaporComponent, DefineVaporSetupFnComponent, 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, NodeArrayChildren, NodeChild, ObjectHTMLAttributes, OlHTMLAttributes, OptgroupHTMLAttributes, OptionHTMLAttributes, OutputHTMLAttributes, ParamHTMLAttributes, ProgressHTMLAttributes, QuoteHTMLAttributes, SVGAttributes, ScriptHTMLAttributes, SelectHTMLAttributes, SourceHTMLAttributes, StyleHTMLAttributes, StyleValue, SyntheticEvent, TableHTMLAttributes, TdHTMLAttributes, TextareaHTMLAttributes, ThHTMLAttributes, TimeHTMLAttributes, TrackHTMLAttributes, TransitionEvent, TransitionEventHandler, UIEvent, UIEventHandler, VideoHTMLAttributes, WebViewHTMLAttributes, WheelEvent, WheelEventHandler, createComponent, createNodes, createProxyComponent, createVNodeCache, defineComponent, defineVaporComponent, defineVaporSSRComponent, getCurrentInstance, h, isBlock, normalizeNode, normalizeSlot, normalizeVNode, setNodes, ssrRegisterHelper, useFullProps, useProps, useRef };
|
|
9
|
+
export { AbstractView, AnchorHTMLAttributes, AnimationEvent, AnimationEventHandler, AreaHTMLAttributes, AriaAttributes, AudioHTMLAttributes, BaseEventHandler, BaseHTMLAttributes, BaseSyntheticEvent, BlockquoteHTMLAttributes, ButtonHTMLAttributes, CSSProperties, CanvasHTMLAttributes, ChangeEvent, ChangeEventHandler, ClipboardEvent, ClipboardEventHandler, ColHTMLAttributes, ColgroupHTMLAttributes, CompositionEvent, CompositionEventHandler, DataHTMLAttributes, DefineComponent, DefineSetupFnComponent, DefineVaporComponent, DefineVaporSetupFnComponent, DelHTMLAttributes, DetailsHTMLAttributes, DialogHTMLAttributes, DragEvent, DragEventHandler, EmbedHTMLAttributes, EventHandler, EventHandlers, Events, FieldsetHTMLAttributes, FocusEvent, FocusEventHandler, For, 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, NodeArrayChildren, NodeChild, ObjectHTMLAttributes, OlHTMLAttributes, OptgroupHTMLAttributes, OptionHTMLAttributes, OutputHTMLAttributes, ParamHTMLAttributes, ProgressHTMLAttributes, QuoteHTMLAttributes, SVGAttributes, ScriptHTMLAttributes, SelectHTMLAttributes, type SlotsToProps, SourceHTMLAttributes, StyleHTMLAttributes, StyleValue, SyntheticEvent, TableHTMLAttributes, TdHTMLAttributes, TextareaHTMLAttributes, ThHTMLAttributes, TimeHTMLAttributes, TrackHTMLAttributes, TransitionEvent, TransitionEventHandler, UIEvent, UIEventHandler, VaporFor, VideoHTMLAttributes, WebViewHTMLAttributes, WheelEvent, WheelEventHandler, createComponent, createNodes, createProxyComponent, createVNodeCache, defineComponent, defineVaporComponent, defineVaporSSRComponent, getCurrentInstance, h, isBlock, normalizeNode, normalizeSlot, normalizeVNode, setNodes, ssrRegisterHelper, useFullProps, useProps, useRef };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "./types-
|
|
2
|
-
import { DefineVaporComponent, DefineVaporSetupFnComponent, NodeArrayChildren, NodeChild, createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes } from "./vapor.js";
|
|
1
|
+
import { i as SlotsToProps } from "./types-CLKH5kLf.js";
|
|
2
|
+
import { DefineVaporComponent, DefineVaporSetupFnComponent, NodeArrayChildren, NodeChild, VaporFor, createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes } from "./vapor.js";
|
|
3
3
|
import { h } from "./h.js";
|
|
4
4
|
import { 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, SVGAttributes, ScriptHTMLAttributes, SelectHTMLAttributes, SourceHTMLAttributes, StyleHTMLAttributes, StyleValue, SyntheticEvent, TableHTMLAttributes, TdHTMLAttributes, TextareaHTMLAttributes, ThHTMLAttributes, TimeHTMLAttributes, TrackHTMLAttributes, TransitionEvent, TransitionEventHandler, UIEvent, UIEventHandler, VideoHTMLAttributes, WebViewHTMLAttributes, WheelEvent, WheelEventHandler } from "./jsx.js";
|
|
5
5
|
import { getCurrentInstance, useFullProps, useProps } from "./props.js";
|
|
6
6
|
import { ssrRegisterHelper } from "./ssr.js";
|
|
7
|
-
import { DefineComponent, DefineSetupFnComponent, createVNodeCache, defineComponent, normalizeSlot, normalizeVNode } from "./vdom.js";
|
|
7
|
+
import { DefineComponent, DefineSetupFnComponent, For, createVNodeCache, defineComponent, normalizeSlot, normalizeVNode } from "./vdom.js";
|
|
8
8
|
import { shallowRef as useRef } from "vue";
|
|
9
|
-
export { AbstractView, AnchorHTMLAttributes, AnimationEvent, AnimationEventHandler, AreaHTMLAttributes, AriaAttributes, AudioHTMLAttributes, BaseEventHandler, BaseHTMLAttributes, BaseSyntheticEvent, BlockquoteHTMLAttributes, ButtonHTMLAttributes, CSSProperties, CanvasHTMLAttributes, ChangeEvent, ChangeEventHandler, ClipboardEvent, ClipboardEventHandler, ColHTMLAttributes, ColgroupHTMLAttributes, CompositionEvent, CompositionEventHandler, DataHTMLAttributes, DefineComponent, DefineSetupFnComponent, DefineVaporComponent, DefineVaporSetupFnComponent, 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, NodeArrayChildren, NodeChild, ObjectHTMLAttributes, OlHTMLAttributes, OptgroupHTMLAttributes, OptionHTMLAttributes, OutputHTMLAttributes, ParamHTMLAttributes, ProgressHTMLAttributes, QuoteHTMLAttributes, SVGAttributes, ScriptHTMLAttributes, SelectHTMLAttributes, SourceHTMLAttributes, StyleHTMLAttributes, StyleValue, SyntheticEvent, TableHTMLAttributes, TdHTMLAttributes, TextareaHTMLAttributes, ThHTMLAttributes, TimeHTMLAttributes, TrackHTMLAttributes, TransitionEvent, TransitionEventHandler, UIEvent, UIEventHandler, VideoHTMLAttributes, WebViewHTMLAttributes, WheelEvent, WheelEventHandler, createComponent, createNodes, createProxyComponent, createVNodeCache, defineComponent, defineVaporComponent, defineVaporSSRComponent, getCurrentInstance, h, isBlock, normalizeNode, normalizeSlot, normalizeVNode, setNodes, ssrRegisterHelper, useFullProps, useProps, useRef };
|
|
9
|
+
export { AbstractView, AnchorHTMLAttributes, AnimationEvent, AnimationEventHandler, AreaHTMLAttributes, AriaAttributes, AudioHTMLAttributes, BaseEventHandler, BaseHTMLAttributes, BaseSyntheticEvent, BlockquoteHTMLAttributes, ButtonHTMLAttributes, CSSProperties, CanvasHTMLAttributes, ChangeEvent, ChangeEventHandler, ClipboardEvent, ClipboardEventHandler, ColHTMLAttributes, ColgroupHTMLAttributes, CompositionEvent, CompositionEventHandler, DataHTMLAttributes, DefineComponent, DefineSetupFnComponent, DefineVaporComponent, DefineVaporSetupFnComponent, DelHTMLAttributes, DetailsHTMLAttributes, DialogHTMLAttributes, DragEvent, DragEventHandler, EmbedHTMLAttributes, EventHandler, EventHandlers, Events, FieldsetHTMLAttributes, FocusEvent, FocusEventHandler, For, 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, NodeArrayChildren, NodeChild, ObjectHTMLAttributes, OlHTMLAttributes, OptgroupHTMLAttributes, OptionHTMLAttributes, OutputHTMLAttributes, ParamHTMLAttributes, ProgressHTMLAttributes, QuoteHTMLAttributes, SVGAttributes, ScriptHTMLAttributes, SelectHTMLAttributes, type SlotsToProps, SourceHTMLAttributes, StyleHTMLAttributes, StyleValue, SyntheticEvent, TableHTMLAttributes, TdHTMLAttributes, TextareaHTMLAttributes, ThHTMLAttributes, TimeHTMLAttributes, TrackHTMLAttributes, TransitionEvent, TransitionEventHandler, UIEvent, UIEventHandler, VaporFor, VideoHTMLAttributes, WebViewHTMLAttributes, WheelEvent, WheelEventHandler, createComponent, createNodes, createProxyComponent, createVNodeCache, defineComponent, defineVaporComponent, defineVaporSSRComponent, getCurrentInstance, h, isBlock, normalizeNode, normalizeSlot, normalizeVNode, setNodes, ssrRegisterHelper, useFullProps, useProps, useRef };
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes } from "./vapor.js";
|
|
1
|
+
import { VaporFor, createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes } from "./vapor.js";
|
|
2
2
|
import { h } from "./h.js";
|
|
3
3
|
import "./jsx.js";
|
|
4
4
|
import { getCurrentInstance, useFullProps, useProps } from "./props.js";
|
|
5
5
|
import { ssrRegisterHelper } from "./ssr.js";
|
|
6
|
-
import { createVNodeCache, defineComponent, normalizeSlot, normalizeVNode } from "./vdom.js";
|
|
6
|
+
import { For, createVNodeCache, defineComponent, normalizeSlot, normalizeVNode } from "./vdom.js";
|
|
7
7
|
import { shallowRef as useRef } from "vue";
|
|
8
|
-
|
|
9
|
-
export { createComponent, createNodes, createProxyComponent, createVNodeCache, defineComponent, defineVaporComponent, defineVaporSSRComponent, getCurrentInstance, h, isBlock, normalizeNode, normalizeSlot, normalizeVNode, setNodes, ssrRegisterHelper, useFullProps, useProps, useRef };
|
|
8
|
+
export { For, VaporFor, createComponent, createNodes, createProxyComponent, createVNodeCache, defineComponent, defineVaporComponent, defineVaporSSRComponent, getCurrentInstance, h, isBlock, normalizeNode, normalizeSlot, normalizeVNode, setNodes, ssrRegisterHelper, useFullProps, useProps, useRef };
|
package/dist/jsx.cjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
package/dist/jsx.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _$vue from "vue";
|
|
2
2
|
import * as CSS from "csstype";
|
|
3
3
|
|
|
4
4
|
//#region src/jsx.d.ts
|
|
@@ -16,6 +16,7 @@ interface CSSProperties extends CSS.Properties<string | number>, CSS.PropertiesH
|
|
|
16
16
|
type Booleanish = boolean | 'true' | 'false';
|
|
17
17
|
type Numberish = number | string;
|
|
18
18
|
interface HTMLWebViewElement extends HTMLElement {}
|
|
19
|
+
interface StyleMedia {}
|
|
19
20
|
interface AriaAttributes {
|
|
20
21
|
/** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */
|
|
21
22
|
'aria-activedescendant'?: string | undefined;
|
|
@@ -1191,7 +1192,7 @@ interface Events<T = Element> {
|
|
|
1191
1192
|
onTransitionstart: TransitionEventHandler<T>;
|
|
1192
1193
|
}
|
|
1193
1194
|
type EventHandlers<E> = { [K in keyof E]?: E[K] extends ((...args: any) => any) ? E[K] : (payload: E[K]) => void };
|
|
1194
|
-
type NativeElements = { [K in keyof IntrinsicElementAttributes]: IntrinsicElementAttributes[K] &
|
|
1195
|
+
type NativeElements = { [K in keyof IntrinsicElementAttributes]: IntrinsicElementAttributes[K] & _$vue.ReservedProps };
|
|
1195
1196
|
interface BaseSyntheticEvent<E = object, C = unknown, T = unknown> {
|
|
1196
1197
|
nativeEvent: E;
|
|
1197
1198
|
currentTarget: C;
|
package/dist/jsx.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _$vue from "vue";
|
|
2
2
|
import * as CSS from "csstype";
|
|
3
3
|
|
|
4
4
|
//#region src/jsx.d.ts
|
|
@@ -16,6 +16,7 @@ interface CSSProperties extends CSS.Properties<string | number>, CSS.PropertiesH
|
|
|
16
16
|
type Booleanish = boolean | 'true' | 'false';
|
|
17
17
|
type Numberish = number | string;
|
|
18
18
|
interface HTMLWebViewElement extends HTMLElement {}
|
|
19
|
+
interface StyleMedia {}
|
|
19
20
|
interface AriaAttributes {
|
|
20
21
|
/** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */
|
|
21
22
|
'aria-activedescendant'?: string | undefined;
|
|
@@ -1191,7 +1192,7 @@ interface Events<T = Element> {
|
|
|
1191
1192
|
onTransitionstart: TransitionEventHandler<T>;
|
|
1192
1193
|
}
|
|
1193
1194
|
type EventHandlers<E> = { [K in keyof E]?: E[K] extends ((...args: any) => any) ? E[K] : (payload: E[K]) => void };
|
|
1194
|
-
type NativeElements = { [K in keyof IntrinsicElementAttributes]: IntrinsicElementAttributes[K] &
|
|
1195
|
+
type NativeElements = { [K in keyof IntrinsicElementAttributes]: IntrinsicElementAttributes[K] & _$vue.ReservedProps };
|
|
1195
1196
|
interface BaseSyntheticEvent<E = object, C = unknown, T = unknown> {
|
|
1196
1197
|
nativeEvent: E;
|
|
1197
1198
|
currentTarget: C;
|
package/dist/jsx.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
package/dist/props.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_chunk = require("./chunk-CKQMccvm.cjs");
|
|
2
3
|
let vue = require("vue");
|
|
3
|
-
vue = require_chunk.__toESM(vue);
|
|
4
|
-
|
|
4
|
+
vue = require_chunk.__toESM(vue, 1);
|
|
5
5
|
//#region src/props.ts
|
|
6
6
|
/* @__NO_SIDE_EFFECTS__ */
|
|
7
7
|
function getCurrentInstance() {
|
|
@@ -46,12 +46,10 @@ function useFullProps() {
|
|
|
46
46
|
}));
|
|
47
47
|
return new Proxy({}, {
|
|
48
48
|
get(_, p, receiver) {
|
|
49
|
-
return
|
|
49
|
+
return Reflect.get(fullProps.value, p, receiver);
|
|
50
50
|
},
|
|
51
|
-
set(_, p,
|
|
52
|
-
|
|
53
|
-
else fullProps.value[p] = value;
|
|
54
|
-
return true;
|
|
51
|
+
set(_, p, v, r) {
|
|
52
|
+
return Reflect.set(fullProps.value, p, v, r);
|
|
55
53
|
},
|
|
56
54
|
deleteProperty(_, p) {
|
|
57
55
|
return Reflect.deleteProperty(fullProps.value, p);
|
|
@@ -70,8 +68,7 @@ function useFullProps() {
|
|
|
70
68
|
}
|
|
71
69
|
});
|
|
72
70
|
}
|
|
73
|
-
|
|
74
71
|
//#endregion
|
|
75
72
|
exports.getCurrentInstance = getCurrentInstance;
|
|
76
73
|
exports.useFullProps = useFullProps;
|
|
77
|
-
exports.useProps = useProps;
|
|
74
|
+
exports.useProps = useProps;
|
package/dist/props.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _$vue from "vue";
|
|
2
2
|
|
|
3
3
|
//#region src/props.d.ts
|
|
4
|
-
declare function getCurrentInstance():
|
|
4
|
+
declare function getCurrentInstance(): _$vue.GenericComponentInstance | null;
|
|
5
5
|
/**
|
|
6
6
|
* Returns the props of the current component instance.
|
|
7
7
|
*
|
package/dist/props.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _$vue from "vue";
|
|
2
2
|
|
|
3
3
|
//#region src/props.d.ts
|
|
4
|
-
declare function getCurrentInstance():
|
|
4
|
+
declare function getCurrentInstance(): _$vue.GenericComponentInstance | null;
|
|
5
5
|
/**
|
|
6
6
|
* Returns the props of the current component instance.
|
|
7
7
|
*
|
package/dist/props.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as Vue from "vue";
|
|
2
|
-
import { computed,
|
|
3
|
-
|
|
2
|
+
import { computed, useAttrs } from "vue";
|
|
4
3
|
//#region src/props.ts
|
|
5
4
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6
5
|
function getCurrentInstance() {
|
|
@@ -45,12 +44,10 @@ function useFullProps() {
|
|
|
45
44
|
}));
|
|
46
45
|
return new Proxy({}, {
|
|
47
46
|
get(_, p, receiver) {
|
|
48
|
-
return
|
|
47
|
+
return Reflect.get(fullProps.value, p, receiver);
|
|
49
48
|
},
|
|
50
|
-
set(_, p,
|
|
51
|
-
|
|
52
|
-
else fullProps.value[p] = value;
|
|
53
|
-
return true;
|
|
49
|
+
set(_, p, v, r) {
|
|
50
|
+
return Reflect.set(fullProps.value, p, v, r);
|
|
54
51
|
},
|
|
55
52
|
deleteProperty(_, p) {
|
|
56
53
|
return Reflect.deleteProperty(fullProps.value, p);
|
|
@@ -69,6 +66,5 @@ function useFullProps() {
|
|
|
69
66
|
}
|
|
70
67
|
});
|
|
71
68
|
}
|
|
72
|
-
|
|
73
69
|
//#endregion
|
|
74
|
-
export { getCurrentInstance, useFullProps, useProps };
|
|
70
|
+
export { getCurrentInstance, useFullProps, useProps };
|
package/dist/raw.cjs
CHANGED
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
//#region src/props.ts?raw
|
|
3
|
-
var props_default = "import { computed,
|
|
4
|
-
|
|
3
|
+
var props_default = "import { computed, useAttrs } from \"vue\";\nimport * as Vue from \"vue\";\n// @__NO_SIDE_EFFECTS__\nexport function getCurrentInstance() {\n return Vue.currentInstance || Vue.getCurrentInstance();\n}\n// @__NO_SIDE_EFFECTS__\nexport function useProps() {\n const i = /* @__PURE__ */ getCurrentInstance();\n return i.props;\n}\n// @__NO_SIDE_EFFECTS__\nexport function useFullProps() {\n const attrs = useAttrs();\n const i = /* @__PURE__ */ getCurrentInstance();\n if (!i.type.props) {\n return attrs;\n }\n const props = /* @__PURE__ */ useProps();\n const fullProps = computed(() => ({ ...props, ...attrs }));\n return new Proxy(\n {},\n {\n get(_, p, receiver) {\n return Reflect.get(fullProps.value, p, receiver);\n },\n set(_, p, v, r) {\n return Reflect.set(fullProps.value, p, v, r);\n },\n deleteProperty(_, p) {\n return Reflect.deleteProperty(fullProps.value, p);\n },\n has(_, p) {\n return Reflect.has(fullProps.value, p);\n },\n ownKeys() {\n return Object.keys(fullProps.value);\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true\n };\n }\n }\n );\n}\n";
|
|
5
4
|
//#endregion
|
|
6
5
|
//#region src/ssr.ts?raw
|
|
7
6
|
var ssr_default = "import { useSSRContext } from \"vue\";\nexport function ssrRegisterHelper(comp, filename) {\n if (typeof comp === \"function\") {\n comp.__setup = () => {\n const ssrContext = useSSRContext();\n (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add(filename);\n };\n } else {\n const setup = comp.setup;\n comp.setup = (props, ctx) => {\n const ssrContext = useSSRContext();\n (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add(filename);\n if (setup) {\n return setup(props, ctx);\n }\n };\n }\n}\n";
|
|
8
|
-
|
|
9
7
|
//#endregion
|
|
10
8
|
//#region src/vapor.ts?raw
|
|
11
|
-
var vapor_default = "import {\n
|
|
12
|
-
|
|
9
|
+
var vapor_default = "import {\n EffectScope,\n Fragment,\n getCurrentInstance\n} from \"vue\";\nimport * as Vue from \"vue\";\n// @__NO_SIDE_EFFECTS__\nexport function defineVaporSSRComponent(comp, extraOptions) {\n if (typeof comp === \"function\") {\n return Object.assign({ name: comp.name }, extraOptions, {\n setup(props, ctx) {\n const result = comp(props, ctx);\n return () => result;\n },\n __vapor: true\n });\n }\n const setup = comp.setup;\n if (setup) {\n comp.setup = (props, ctx) => {\n const result = setup(props, ctx);\n return () => result;\n };\n }\n comp.__vapor = true;\n return comp;\n}\nexport const createComponent = (type, ...args) => {\n if (type === Fragment) {\n const slots = args[1];\n return slots && typeof slots.default === \"function\" ? slots.default() : [];\n }\n return Vue.createComponentWithFallback(\n createProxyComponent(Vue.resolveDynamicComponent(type)),\n ...args\n );\n};\nconst proxyCache = /* @__PURE__ */ new WeakMap();\nexport function createProxyComponent(type, normalizeNode2) {\n if (typeof type === \"function\") {\n const existing = proxyCache.get(type);\n if (existing) return existing;\n const i = Vue.currentInstance || getCurrentInstance();\n const proxy = new Proxy(type, {\n apply(target, ctx, args) {\n if (typeof target.__setup === \"function\") {\n target.__setup.apply(ctx, args);\n }\n const node = Reflect.apply(target, ctx, args);\n return normalizeNode2 ? normalizeNode2(node) : node;\n },\n get(target, p, receiver) {\n if (i && i.appContext.vapor && p === \"__vapor\") {\n return true;\n }\n return Reflect.get(target, p, receiver);\n }\n });\n proxyCache.set(type, proxy);\n return proxy;\n }\n return type;\n}\nexport function normalizeNode(node) {\n if (node == null || typeof node === \"boolean\") {\n return document.createComment(\"\");\n } else if (Array.isArray(node) && node.length) {\n return node.map(normalizeNode);\n } else if (isBlock(node)) {\n return node;\n } else if (typeof node === \"function\") {\n return resolveValues([node], void 0, true)[0];\n } else {\n return document.createTextNode(String(node));\n }\n}\nexport function isBlock(val) {\n return val instanceof Node || Array.isArray(val) || Vue.isVaporComponent(val) || Vue.isFragment(val);\n}\nfunction createFragment(nodes, anchor = document.createTextNode(\"\")) {\n const frag = new Vue.VaporFragment(nodes);\n frag.anchor = anchor;\n return frag;\n}\nfunction normalizeBlock(node, anchor, processFunction = false) {\n if (node instanceof Node || Vue.isFragment(node)) {\n return node;\n } else if (Vue.isVaporComponent(node)) {\n return createFragment(node, anchor);\n } else if (Array.isArray(node)) {\n return createFragment(\n node.map((i) => normalizeBlock(i, void 0, processFunction)),\n anchor\n );\n } else if (processFunction && typeof node === \"function\") {\n return resolveValues([node], anchor, true)[0];\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, processFunction = false) {\n anchor = anchor || (current instanceof Node && current.nodeType === 3 ? current : void 0);\n const node = normalizeBlock(value, anchor, processFunction);\n if (current) {\n if (Vue.isFragment(current)) {\n if (current.anchor && current.anchor.parentNode) {\n Vue.remove(current.nodes, current.anchor.parentNode);\n Vue.insert(node, current.anchor.parentNode, current.anchor);\n if (!anchor) current.anchor.parentNode.removeChild(current.anchor);\n if (current.scope) current.scope.stop();\n }\n } else if (current instanceof Node) {\n if (current.nodeType === 3 && (!(node instanceof Node) || node.nodeType !== 3)) {\n current.textContent = \"\";\n }\n if (Vue.isFragment(node) && current.parentNode) {\n Vue.insert(node, current.parentNode, current);\n if (!anchor || current.nodeType !== 3) {\n current.parentNode.removeChild(current);\n }\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, processFunction = false) {\n const nodes = [];\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 Vue.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, processFunction)\n );\n });\n } else {\n nodes[index] = resolveValue(nodes[index], value, anchor, processFunction);\n }\n }\n return nodes;\n}\nexport function setNodes(anchor, ...values) {\n const resolvedValues = resolveValues(values, anchor);\n if (anchor.parentNode) Vue.insert(resolvedValues, anchor.parentNode, anchor);\n}\nexport function createNodes(...values) {\n return resolveValues(values);\n}\n// @__NO_SIDE_EFFECTS__\nexport function defineVaporComponent(comp, extraOptions) {\n if (typeof comp === \"function\") {\n return Object.assign({ name: comp.name }, extraOptions, {\n setup: comp,\n __vapor: true\n });\n }\n comp.__vapor = true;\n return comp;\n}\nexport const VaporFor = /* @__PURE__ */ defineVaporComponent(\n (props, {\n slots\n }) => {\n return Vue.createFor(\n () => props.in,\n (item, key, index) => {\n return slots.default ? slots.default(\n // @ts-ignore\n props.getKey === void 0 ? item.value : item,\n key,\n index\n ) : [];\n },\n props.getKey === void 0 ? (item) => item : props.getKey\n );\n },\n { props: [\"in\", \"getKey\"] }\n);\n";
|
|
13
10
|
//#endregion
|
|
14
11
|
//#region src/vdom.ts?raw
|
|
15
|
-
var vdom_default = "import {\n defineComponent as __defineComponent,\n cloneVNode,\n Comment,\n createBlock,\n createElementBlock,\n createElementVNode,\n createVNode,\n Fragment,\n getCurrentInstance,\n isVNode,\n openBlock,\n Text,\n withCtx\n} from \"vue\";\nconst cacheMap = /* @__PURE__ */ new WeakMap();\nexport function createVNodeCache(key) {\n const i = getCurrentInstance();\n if (i) {\n if (!cacheMap.has(i)) cacheMap.set(i, {});\n const caches = cacheMap.get(i);\n return caches[key] || (caches[key] = []);\n } else {\n return [];\n }\n}\nexport function normalizeVNode(value, flag = 1) {\n let create = createVNode;\n let isBlock = false;\n if (typeof value === \"function\") {\n isBlock = true;\n openBlock();\n create = createBlock;\n value = value();\n }\n return isVNode(value) ? isBlock ? createBlock(cloneIfMounted(value)) : cloneIfMounted(value) : Array.isArray(value) ? isBlock ? createElementBlock(\n Fragment,\n null,\n value.map((n) => normalizeVNode(() => n)),\n -2\n ) : createElementVNode(Fragment, null, value.slice()) : value == null || typeof value === \"boolean\" ? create(Comment) : create(Text, null, String(value), flag);\n}\nfunction cloneIfMounted(child) {\n return child.el === null && child.patchFlag !== -1 || // @ts-ignore\n child.memo ? child : cloneVNode(child);\n}\nconst normalizeSlotValue = (value) => Array.isArray(value) ? value.map((n) => normalizeVNode(n)) : [normalizeVNode(value)];\nexport const normalizeSlot = (rawSlot) => {\n if (rawSlot._n) {\n return rawSlot;\n }\n return withCtx((...args) => {\n return normalizeSlotValue(rawSlot(...args));\n });\n};\nexport const defineComponent = __defineComponent;\n";
|
|
16
|
-
|
|
12
|
+
var vdom_default = "import {\n defineComponent as __defineComponent,\n cloneVNode,\n Comment,\n createBlock,\n createElementBlock,\n createElementVNode,\n createVNode,\n Fragment,\n getCurrentInstance,\n isVNode,\n openBlock,\n renderList,\n Text,\n withCtx\n} from \"vue\";\nconst cacheMap = /* @__PURE__ */ new WeakMap();\nexport function createVNodeCache(key) {\n const i = getCurrentInstance();\n if (i) {\n if (!cacheMap.has(i)) cacheMap.set(i, {});\n const caches = cacheMap.get(i);\n return caches[key] || (caches[key] = []);\n } else {\n return [];\n }\n}\nexport function normalizeVNode(value, flag = 1) {\n let create = createVNode;\n let isBlock = false;\n if (typeof value === \"function\") {\n isBlock = true;\n openBlock();\n create = createBlock;\n value = value();\n }\n return isVNode(value) ? isBlock ? createBlock(cloneIfMounted(value)) : cloneIfMounted(value) : Array.isArray(value) ? isBlock ? createElementBlock(\n Fragment,\n null,\n value.map((n) => normalizeVNode(() => n)),\n -2\n ) : createElementVNode(Fragment, null, value.slice()) : value == null || typeof value === \"boolean\" ? create(Comment) : create(Text, null, String(value), flag);\n}\nfunction cloneIfMounted(child) {\n return child.el === null && child.patchFlag !== -1 || // @ts-ignore\n child.memo ? child : cloneVNode(child);\n}\nconst normalizeSlotValue = (value) => Array.isArray(value) ? value.map((n) => normalizeVNode(n)) : [normalizeVNode(value)];\nexport const normalizeSlot = (rawSlot) => {\n if (rawSlot._n) {\n return rawSlot;\n }\n return withCtx((...args) => {\n return normalizeSlotValue(rawSlot(...args));\n });\n};\nexport const defineComponent = __defineComponent;\nexport const For = defineComponent(\n (props, {\n slots\n }) => {\n const defaultSlot = slots.default;\n return () => (openBlock(true), createElementBlock(\n Fragment,\n null,\n renderList(props.in, (item, key, index) => {\n const result = defaultSlot(item, key, index);\n return Array.isArray(result) ? result.length === 1 ? result[0] : normalizeVNode(result) : result;\n }),\n 128\n ));\n },\n { props: [\"in\"] }\n);\n";
|
|
17
13
|
//#endregion
|
|
18
14
|
//#region src/raw.ts
|
|
19
15
|
const propsHelperCode = props_default;
|
|
@@ -24,7 +20,6 @@ const propsHelperId = "/vue-jsx-vapor/props";
|
|
|
24
20
|
const vdomHelperId = "/vue-jsx-vapor/vdom";
|
|
25
21
|
const vaporHelperId = "/vue-jsx-vapor/vapor";
|
|
26
22
|
const ssrHelperId = "/vue-jsx-vapor/ssr";
|
|
27
|
-
|
|
28
23
|
//#endregion
|
|
29
24
|
exports.propsHelperCode = propsHelperCode;
|
|
30
25
|
exports.propsHelperId = propsHelperId;
|
|
@@ -33,4 +28,4 @@ exports.ssrHelperId = ssrHelperId;
|
|
|
33
28
|
exports.vaporHelperCode = vaporHelperCode;
|
|
34
29
|
exports.vaporHelperId = vaporHelperId;
|
|
35
30
|
exports.vdomHelperCode = vdomHelperCode;
|
|
36
|
-
exports.vdomHelperId = vdomHelperId;
|
|
31
|
+
exports.vdomHelperId = vdomHelperId;
|
package/dist/raw.js
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
//#region src/props.ts?raw
|
|
2
|
-
var props_default = "import { computed,
|
|
3
|
-
|
|
2
|
+
var props_default = "import { computed, useAttrs } from \"vue\";\nimport * as Vue from \"vue\";\n// @__NO_SIDE_EFFECTS__\nexport function getCurrentInstance() {\n return Vue.currentInstance || Vue.getCurrentInstance();\n}\n// @__NO_SIDE_EFFECTS__\nexport function useProps() {\n const i = /* @__PURE__ */ getCurrentInstance();\n return i.props;\n}\n// @__NO_SIDE_EFFECTS__\nexport function useFullProps() {\n const attrs = useAttrs();\n const i = /* @__PURE__ */ getCurrentInstance();\n if (!i.type.props) {\n return attrs;\n }\n const props = /* @__PURE__ */ useProps();\n const fullProps = computed(() => ({ ...props, ...attrs }));\n return new Proxy(\n {},\n {\n get(_, p, receiver) {\n return Reflect.get(fullProps.value, p, receiver);\n },\n set(_, p, v, r) {\n return Reflect.set(fullProps.value, p, v, r);\n },\n deleteProperty(_, p) {\n return Reflect.deleteProperty(fullProps.value, p);\n },\n has(_, p) {\n return Reflect.has(fullProps.value, p);\n },\n ownKeys() {\n return Object.keys(fullProps.value);\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true\n };\n }\n }\n );\n}\n";
|
|
4
3
|
//#endregion
|
|
5
4
|
//#region src/ssr.ts?raw
|
|
6
5
|
var ssr_default = "import { useSSRContext } from \"vue\";\nexport function ssrRegisterHelper(comp, filename) {\n if (typeof comp === \"function\") {\n comp.__setup = () => {\n const ssrContext = useSSRContext();\n (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add(filename);\n };\n } else {\n const setup = comp.setup;\n comp.setup = (props, ctx) => {\n const ssrContext = useSSRContext();\n (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add(filename);\n if (setup) {\n return setup(props, ctx);\n }\n };\n }\n}\n";
|
|
7
|
-
|
|
8
6
|
//#endregion
|
|
9
7
|
//#region src/vapor.ts?raw
|
|
10
|
-
var vapor_default = "import {\n
|
|
11
|
-
|
|
8
|
+
var vapor_default = "import {\n EffectScope,\n Fragment,\n getCurrentInstance\n} from \"vue\";\nimport * as Vue from \"vue\";\n// @__NO_SIDE_EFFECTS__\nexport function defineVaporSSRComponent(comp, extraOptions) {\n if (typeof comp === \"function\") {\n return Object.assign({ name: comp.name }, extraOptions, {\n setup(props, ctx) {\n const result = comp(props, ctx);\n return () => result;\n },\n __vapor: true\n });\n }\n const setup = comp.setup;\n if (setup) {\n comp.setup = (props, ctx) => {\n const result = setup(props, ctx);\n return () => result;\n };\n }\n comp.__vapor = true;\n return comp;\n}\nexport const createComponent = (type, ...args) => {\n if (type === Fragment) {\n const slots = args[1];\n return slots && typeof slots.default === \"function\" ? slots.default() : [];\n }\n return Vue.createComponentWithFallback(\n createProxyComponent(Vue.resolveDynamicComponent(type)),\n ...args\n );\n};\nconst proxyCache = /* @__PURE__ */ new WeakMap();\nexport function createProxyComponent(type, normalizeNode2) {\n if (typeof type === \"function\") {\n const existing = proxyCache.get(type);\n if (existing) return existing;\n const i = Vue.currentInstance || getCurrentInstance();\n const proxy = new Proxy(type, {\n apply(target, ctx, args) {\n if (typeof target.__setup === \"function\") {\n target.__setup.apply(ctx, args);\n }\n const node = Reflect.apply(target, ctx, args);\n return normalizeNode2 ? normalizeNode2(node) : node;\n },\n get(target, p, receiver) {\n if (i && i.appContext.vapor && p === \"__vapor\") {\n return true;\n }\n return Reflect.get(target, p, receiver);\n }\n });\n proxyCache.set(type, proxy);\n return proxy;\n }\n return type;\n}\nexport function normalizeNode(node) {\n if (node == null || typeof node === \"boolean\") {\n return document.createComment(\"\");\n } else if (Array.isArray(node) && node.length) {\n return node.map(normalizeNode);\n } else if (isBlock(node)) {\n return node;\n } else if (typeof node === \"function\") {\n return resolveValues([node], void 0, true)[0];\n } else {\n return document.createTextNode(String(node));\n }\n}\nexport function isBlock(val) {\n return val instanceof Node || Array.isArray(val) || Vue.isVaporComponent(val) || Vue.isFragment(val);\n}\nfunction createFragment(nodes, anchor = document.createTextNode(\"\")) {\n const frag = new Vue.VaporFragment(nodes);\n frag.anchor = anchor;\n return frag;\n}\nfunction normalizeBlock(node, anchor, processFunction = false) {\n if (node instanceof Node || Vue.isFragment(node)) {\n return node;\n } else if (Vue.isVaporComponent(node)) {\n return createFragment(node, anchor);\n } else if (Array.isArray(node)) {\n return createFragment(\n node.map((i) => normalizeBlock(i, void 0, processFunction)),\n anchor\n );\n } else if (processFunction && typeof node === \"function\") {\n return resolveValues([node], anchor, true)[0];\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, processFunction = false) {\n anchor = anchor || (current instanceof Node && current.nodeType === 3 ? current : void 0);\n const node = normalizeBlock(value, anchor, processFunction);\n if (current) {\n if (Vue.isFragment(current)) {\n if (current.anchor && current.anchor.parentNode) {\n Vue.remove(current.nodes, current.anchor.parentNode);\n Vue.insert(node, current.anchor.parentNode, current.anchor);\n if (!anchor) current.anchor.parentNode.removeChild(current.anchor);\n if (current.scope) current.scope.stop();\n }\n } else if (current instanceof Node) {\n if (current.nodeType === 3 && (!(node instanceof Node) || node.nodeType !== 3)) {\n current.textContent = \"\";\n }\n if (Vue.isFragment(node) && current.parentNode) {\n Vue.insert(node, current.parentNode, current);\n if (!anchor || current.nodeType !== 3) {\n current.parentNode.removeChild(current);\n }\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, processFunction = false) {\n const nodes = [];\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 Vue.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, processFunction)\n );\n });\n } else {\n nodes[index] = resolveValue(nodes[index], value, anchor, processFunction);\n }\n }\n return nodes;\n}\nexport function setNodes(anchor, ...values) {\n const resolvedValues = resolveValues(values, anchor);\n if (anchor.parentNode) Vue.insert(resolvedValues, anchor.parentNode, anchor);\n}\nexport function createNodes(...values) {\n return resolveValues(values);\n}\n// @__NO_SIDE_EFFECTS__\nexport function defineVaporComponent(comp, extraOptions) {\n if (typeof comp === \"function\") {\n return Object.assign({ name: comp.name }, extraOptions, {\n setup: comp,\n __vapor: true\n });\n }\n comp.__vapor = true;\n return comp;\n}\nexport const VaporFor = /* @__PURE__ */ defineVaporComponent(\n (props, {\n slots\n }) => {\n return Vue.createFor(\n () => props.in,\n (item, key, index) => {\n return slots.default ? slots.default(\n // @ts-ignore\n props.getKey === void 0 ? item.value : item,\n key,\n index\n ) : [];\n },\n props.getKey === void 0 ? (item) => item : props.getKey\n );\n },\n { props: [\"in\", \"getKey\"] }\n);\n";
|
|
12
9
|
//#endregion
|
|
13
10
|
//#region src/vdom.ts?raw
|
|
14
|
-
var vdom_default = "import {\n defineComponent as __defineComponent,\n cloneVNode,\n Comment,\n createBlock,\n createElementBlock,\n createElementVNode,\n createVNode,\n Fragment,\n getCurrentInstance,\n isVNode,\n openBlock,\n Text,\n withCtx\n} from \"vue\";\nconst cacheMap = /* @__PURE__ */ new WeakMap();\nexport function createVNodeCache(key) {\n const i = getCurrentInstance();\n if (i) {\n if (!cacheMap.has(i)) cacheMap.set(i, {});\n const caches = cacheMap.get(i);\n return caches[key] || (caches[key] = []);\n } else {\n return [];\n }\n}\nexport function normalizeVNode(value, flag = 1) {\n let create = createVNode;\n let isBlock = false;\n if (typeof value === \"function\") {\n isBlock = true;\n openBlock();\n create = createBlock;\n value = value();\n }\n return isVNode(value) ? isBlock ? createBlock(cloneIfMounted(value)) : cloneIfMounted(value) : Array.isArray(value) ? isBlock ? createElementBlock(\n Fragment,\n null,\n value.map((n) => normalizeVNode(() => n)),\n -2\n ) : createElementVNode(Fragment, null, value.slice()) : value == null || typeof value === \"boolean\" ? create(Comment) : create(Text, null, String(value), flag);\n}\nfunction cloneIfMounted(child) {\n return child.el === null && child.patchFlag !== -1 || // @ts-ignore\n child.memo ? child : cloneVNode(child);\n}\nconst normalizeSlotValue = (value) => Array.isArray(value) ? value.map((n) => normalizeVNode(n)) : [normalizeVNode(value)];\nexport const normalizeSlot = (rawSlot) => {\n if (rawSlot._n) {\n return rawSlot;\n }\n return withCtx((...args) => {\n return normalizeSlotValue(rawSlot(...args));\n });\n};\nexport const defineComponent = __defineComponent;\n";
|
|
15
|
-
|
|
11
|
+
var vdom_default = "import {\n defineComponent as __defineComponent,\n cloneVNode,\n Comment,\n createBlock,\n createElementBlock,\n createElementVNode,\n createVNode,\n Fragment,\n getCurrentInstance,\n isVNode,\n openBlock,\n renderList,\n Text,\n withCtx\n} from \"vue\";\nconst cacheMap = /* @__PURE__ */ new WeakMap();\nexport function createVNodeCache(key) {\n const i = getCurrentInstance();\n if (i) {\n if (!cacheMap.has(i)) cacheMap.set(i, {});\n const caches = cacheMap.get(i);\n return caches[key] || (caches[key] = []);\n } else {\n return [];\n }\n}\nexport function normalizeVNode(value, flag = 1) {\n let create = createVNode;\n let isBlock = false;\n if (typeof value === \"function\") {\n isBlock = true;\n openBlock();\n create = createBlock;\n value = value();\n }\n return isVNode(value) ? isBlock ? createBlock(cloneIfMounted(value)) : cloneIfMounted(value) : Array.isArray(value) ? isBlock ? createElementBlock(\n Fragment,\n null,\n value.map((n) => normalizeVNode(() => n)),\n -2\n ) : createElementVNode(Fragment, null, value.slice()) : value == null || typeof value === \"boolean\" ? create(Comment) : create(Text, null, String(value), flag);\n}\nfunction cloneIfMounted(child) {\n return child.el === null && child.patchFlag !== -1 || // @ts-ignore\n child.memo ? child : cloneVNode(child);\n}\nconst normalizeSlotValue = (value) => Array.isArray(value) ? value.map((n) => normalizeVNode(n)) : [normalizeVNode(value)];\nexport const normalizeSlot = (rawSlot) => {\n if (rawSlot._n) {\n return rawSlot;\n }\n return withCtx((...args) => {\n return normalizeSlotValue(rawSlot(...args));\n });\n};\nexport const defineComponent = __defineComponent;\nexport const For = defineComponent(\n (props, {\n slots\n }) => {\n const defaultSlot = slots.default;\n return () => (openBlock(true), createElementBlock(\n Fragment,\n null,\n renderList(props.in, (item, key, index) => {\n const result = defaultSlot(item, key, index);\n return Array.isArray(result) ? result.length === 1 ? result[0] : normalizeVNode(result) : result;\n }),\n 128\n ));\n },\n { props: [\"in\"] }\n);\n";
|
|
16
12
|
//#endregion
|
|
17
13
|
//#region src/raw.ts
|
|
18
14
|
const propsHelperCode = props_default;
|
|
@@ -23,6 +19,5 @@ const propsHelperId = "/vue-jsx-vapor/props";
|
|
|
23
19
|
const vdomHelperId = "/vue-jsx-vapor/vdom";
|
|
24
20
|
const vaporHelperId = "/vue-jsx-vapor/vapor";
|
|
25
21
|
const ssrHelperId = "/vue-jsx-vapor/ssr";
|
|
26
|
-
|
|
27
22
|
//#endregion
|
|
28
|
-
export { propsHelperCode, propsHelperId, ssrHelperCode, ssrHelperId, vaporHelperCode, vaporHelperId, vdomHelperCode, vdomHelperId };
|
|
23
|
+
export { propsHelperCode, propsHelperId, ssrHelperCode, ssrHelperId, vaporHelperCode, vaporHelperId, vdomHelperCode, vdomHelperId };
|
package/dist/ssr.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("./chunk-CKQMccvm.cjs");
|
|
2
3
|
let vue = require("vue");
|
|
3
|
-
|
|
4
4
|
//#region src/ssr.ts
|
|
5
5
|
function ssrRegisterHelper(comp, filename) {
|
|
6
6
|
if (typeof comp === "function") comp.__setup = () => {
|
|
@@ -16,6 +16,5 @@ function ssrRegisterHelper(comp, filename) {
|
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
|
|
20
19
|
//#endregion
|
|
21
|
-
exports.ssrRegisterHelper = ssrRegisterHelper;
|
|
20
|
+
exports.ssrRegisterHelper = ssrRegisterHelper;
|
package/dist/ssr.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useSSRContext } from "vue";
|
|
2
|
-
|
|
3
2
|
//#region src/ssr.ts
|
|
4
3
|
function ssrRegisterHelper(comp, filename) {
|
|
5
4
|
if (typeof comp === "function") comp.__setup = () => {
|
|
@@ -15,6 +14,5 @@ function ssrRegisterHelper(comp, filename) {
|
|
|
15
14
|
};
|
|
16
15
|
}
|
|
17
16
|
}
|
|
18
|
-
|
|
19
17
|
//#endregion
|
|
20
|
-
export { ssrRegisterHelper };
|
|
18
|
+
export { ssrRegisterHelper };
|
package/dist/types.cjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
package/dist/types.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ToResolvedProps, i as SlotsToProps, n as IsKeyValues, r as Prettify, t as IfAny } from "./types-
|
|
1
|
+
import { a as ToResolvedProps, i as SlotsToProps, n as IsKeyValues, r as Prettify, t as IfAny } from "./types-C847TkaY.cjs";
|
|
2
2
|
export { IfAny, IsKeyValues, Prettify, SlotsToProps, ToResolvedProps };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ToResolvedProps, i as SlotsToProps, n as IsKeyValues, r as Prettify, t as IfAny } from "./types-
|
|
1
|
+
import { a as ToResolvedProps, i as SlotsToProps, n as IsKeyValues, r as Prettify, t as IfAny } from "./types-CLKH5kLf.js";
|
|
2
2
|
export { IfAny, IsKeyValues, Prettify, SlotsToProps, ToResolvedProps };
|
package/dist/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
package/dist/vapor.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_chunk = require("./chunk-CKQMccvm.cjs");
|
|
2
3
|
let vue = require("vue");
|
|
3
|
-
vue = require_chunk.__toESM(vue);
|
|
4
|
-
|
|
4
|
+
vue = require_chunk.__toESM(vue, 1);
|
|
5
5
|
//#region src/vapor.ts
|
|
6
6
|
/* @__NO_SIDE_EFFECTS__ */
|
|
7
7
|
function defineVaporSSRComponent(comp, extraOptions) {
|
|
@@ -124,9 +124,22 @@ function setNodes(anchor, ...values) {
|
|
|
124
124
|
function createNodes(...values) {
|
|
125
125
|
return resolveValues(values);
|
|
126
126
|
}
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
128
|
+
function defineVaporComponent(comp, extraOptions) {
|
|
129
|
+
if (typeof comp === "function") return Object.assign({ name: comp.name }, extraOptions, {
|
|
130
|
+
setup: comp,
|
|
131
|
+
__vapor: true
|
|
132
|
+
});
|
|
133
|
+
comp.__vapor = true;
|
|
134
|
+
return comp;
|
|
135
|
+
}
|
|
136
|
+
const VaporFor = /* @__PURE__ */ defineVaporComponent((props, { slots }) => {
|
|
137
|
+
return vue.createFor(() => props.in, (item, key, index) => {
|
|
138
|
+
return slots.default ? slots.default(props.getKey === void 0 ? item.value : item, key, index) : [];
|
|
139
|
+
}, props.getKey === void 0 ? (item) => item : props.getKey);
|
|
140
|
+
}, { props: ["in", "getKey"] });
|
|
129
141
|
//#endregion
|
|
142
|
+
exports.VaporFor = VaporFor;
|
|
130
143
|
exports.createComponent = createComponent;
|
|
131
144
|
exports.createNodes = createNodes;
|
|
132
145
|
exports.createProxyComponent = createProxyComponent;
|
|
@@ -134,4 +147,4 @@ exports.defineVaporComponent = defineVaporComponent;
|
|
|
134
147
|
exports.defineVaporSSRComponent = defineVaporSSRComponent;
|
|
135
148
|
exports.isBlock = isBlock;
|
|
136
149
|
exports.normalizeNode = normalizeNode;
|
|
137
|
-
exports.setNodes = setNodes;
|
|
150
|
+
exports.setNodes = setNodes;
|
package/dist/vapor.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as ToResolvedProps, i as SlotsToProps, n as IsKeyValues, r as Prettify } from "./types-
|
|
1
|
+
import { a as ToResolvedProps, i as SlotsToProps, n as IsKeyValues, r as Prettify } from "./types-C847TkaY.cjs";
|
|
2
2
|
import * as Vue from "vue";
|
|
3
|
-
import { Block, ComponentObjectPropsOptions, ComponentTypeEmits, EmitFn, EmitsOptions, ExtractDefaultPropTypes, ExtractPropTypes, Fragment, StaticSlots, TypeEmitsToOptions, VNode, VaporComponent, VaporComponentInstance, VaporComponentInstanceConstructor, VaporComponentOptions, VaporPublicProps, VaporRenderResult } from "vue";
|
|
3
|
+
import { Block, ComponentObjectPropsOptions, ComponentTypeEmits, EmitFn, EmitsOptions, ExtractDefaultPropTypes, ExtractPropTypes, Fragment, ShallowRef, StaticSlots, TypeEmitsToOptions, VNode, VaporComponent, VaporComponentInstance, VaporComponentInstanceConstructor, VaporComponentOptions, VaporPublicProps, VaporRenderResult } from "vue";
|
|
4
4
|
|
|
5
5
|
//#region src/vapor.d.ts
|
|
6
6
|
declare function defineVaporSSRComponent(comp: VaporComponent, extraOptions: VaporComponent): VaporComponent;
|
|
@@ -16,19 +16,19 @@ declare function setNodes(anchor: Node, ...values: any[]): void;
|
|
|
16
16
|
declare function createNodes(...values: any[]): Block[];
|
|
17
17
|
type DefineVaporComponent<RuntimePropsOptions = {}, RuntimePropsKeys extends string = string, InferredProps = (string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : { [key in RuntimePropsKeys]?: any }), Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block, TypeRefs extends Record<string, unknown> = {}, MakeDefaultsOptional extends boolean = true, PublicProps = VaporPublicProps, ResolvedProps = ToResolvedProps<InferredProps, Emits>, Defaults = ExtractDefaultPropTypes<RuntimePropsOptions>> = VaporComponentInstanceConstructor<VaporComponentInstance<(MakeDefaultsOptional extends true ? keyof Defaults extends never ? Prettify<ResolvedProps> & PublicProps : Partial<Defaults> & Omit<Prettify<ResolvedProps> & PublicProps, keyof Defaults> : Prettify<ResolvedProps> & PublicProps) & SlotsToProps<Slots, NodeChild>, Emits, Slots, Exposed, TypeBlock, TypeRefs>> & VaporComponentOptions<RuntimePropsOptions | RuntimePropsKeys[], Emits, RuntimeEmitsKeys, Slots, Exposed>;
|
|
18
18
|
type DefineVaporSetupFnComponent<Props extends Record<string, any> = {}, Emits extends EmitsOptions = {}, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block, ResolvedProps extends Record<string, any> = ToResolvedProps<Props & VaporPublicProps, Emits>> = new () => VaporComponentInstance<ResolvedProps & SlotsToProps<Slots, NodeChild>, Emits, Slots, Exposed, TypeBlock>;
|
|
19
|
-
declare function
|
|
19
|
+
declare function defineVaporComponent<Props extends Record<string, any>, Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block>(setup: (this: void, props: Props, ctx: {
|
|
20
20
|
emit: EmitFn<Emits>;
|
|
21
21
|
slots: Slots;
|
|
22
22
|
attrs: Record<string, any>;
|
|
23
23
|
expose: (exposed?: Exposed) => void;
|
|
24
|
-
}) => VaporRenderResult<TypeBlock> | void, extraOptions?: VaporComponentOptions<(keyof Props)[], Emits, RuntimeEmitsKeys, Slots, Exposed> & ThisType<void>): DefineVaporSetupFnComponent<Props, Emits, Slots, Exposed, TypeBlock>;
|
|
25
|
-
declare function
|
|
24
|
+
}) => VaporRenderResult<TypeBlock> | void, extraOptions?: VaporComponentOptions<(keyof NoInfer<Props>)[], Emits, RuntimeEmitsKeys, Slots, Exposed> & ThisType<void>): DefineVaporSetupFnComponent<Props, Emits, Slots, Exposed, TypeBlock>;
|
|
25
|
+
declare function defineVaporComponent<Props extends Record<string, any>, Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block>(this: void, setup: (props: Props, ctx: {
|
|
26
26
|
emit: EmitFn<Emits>;
|
|
27
27
|
slots: Slots;
|
|
28
28
|
attrs: Record<string, any>;
|
|
29
29
|
expose: (exposed?: Exposed) => void;
|
|
30
30
|
}) => VaporRenderResult<TypeBlock> | void, extraOptions?: VaporComponentOptions<ComponentObjectPropsOptions<Props>, Emits, RuntimeEmitsKeys, Slots, Exposed> & ThisType<void>): DefineVaporSetupFnComponent<Props, Emits, Slots, Exposed, TypeBlock>;
|
|
31
|
-
declare function
|
|
31
|
+
declare function defineVaporComponent<TypeProps, RuntimePropsOptions extends ComponentObjectPropsOptions = ComponentObjectPropsOptions, RuntimePropsKeys extends string = string, TypeEmits extends ComponentTypeEmits = {}, RuntimeEmitsOptions extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, ResolvedEmits extends EmitsOptions = ({} extends RuntimeEmitsOptions ? TypeEmitsToOptions<TypeEmits> : RuntimeEmitsOptions), InferredProps = (IsKeyValues<TypeProps> extends true ? TypeProps : string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : { [key in RuntimePropsKeys]?: any }), TypeRefs extends Record<string, unknown> = {}, TypeBlock extends Block = Block>(options: VaporComponentOptions<RuntimePropsOptions | RuntimePropsKeys[], ResolvedEmits, RuntimeEmitsKeys, Slots, Exposed, TypeBlock, InferredProps> & {
|
|
32
32
|
[key: string]: any;
|
|
33
33
|
/**
|
|
34
34
|
* @private
|
|
@@ -47,6 +47,16 @@ declare function _defineVaporComponent<TypeProps, RuntimePropsOptions extends Co
|
|
|
47
47
|
*/
|
|
48
48
|
__typeEl?: TypeBlock;
|
|
49
49
|
} & ThisType<void>): DefineVaporComponent<RuntimePropsOptions, RuntimePropsKeys, InferredProps, ResolvedEmits, RuntimeEmitsKeys, Slots, Exposed extends Block ? Record<string, any> : Exposed, TypeBlock, TypeRefs, unknown extends TypeProps ? true : false>;
|
|
50
|
-
|
|
50
|
+
type ResolveItem<Item, GetKey> = GetKey extends undefined ? Item : ShallowRef<Item>;
|
|
51
|
+
declare const VaporFor: new <T extends any[] | Record<any, any> | number | string | Set<any> | Map<any, any>, Item = (T extends number ? number : T extends string ? string : T extends any[] ? T[number] : T extends Iterable<infer T1> ? T1 : Record<any, any>), GetKeyDetault = (...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => any, GetKey extends GetKeyDetault | null | undefined = undefined>() => VaporComponentInstance<Readonly<{
|
|
52
|
+
in: T;
|
|
53
|
+
getKey?: GetKey extends undefined ? GetKeyDetault : GetKey;
|
|
54
|
+
} & Vue.ReservedProps & Vue.AllowedComponentProps & Vue.ComponentCustomProps> & Readonly<{}> & {
|
|
55
|
+
'v-slots'?: {
|
|
56
|
+
default: (...args: string extends keyof Item ? [item: ResolveItem<T[keyof T], GetKey>, key: ShallowRef<keyof T>, index: ShallowRef<number>] : [item: ResolveItem<Item, GetKey>, index: ShallowRef<number>]) => any;
|
|
57
|
+
} | ((...args: string extends keyof Item ? [item: ResolveItem<T[keyof T], GetKey>, key: ShallowRef<keyof T>, index: ShallowRef<number>] : [item: ResolveItem<Item, GetKey>, index: ShallowRef<number>]) => any) | NoInfer<NodeChild<undefined>> | undefined;
|
|
58
|
+
}, {}, {
|
|
59
|
+
default: (...args: string extends keyof Item ? [item: ResolveItem<T[keyof T], GetKey>, key: ShallowRef<keyof T>, index: ShallowRef<number>] : [item: ResolveItem<Item, GetKey>, index: ShallowRef<number>]) => any;
|
|
60
|
+
}, Record<string, any>, Vue.ForFragment, Record<string, any>>;
|
|
51
61
|
//#endregion
|
|
52
|
-
export { DefineVaporComponent, DefineVaporSetupFnComponent, NodeArrayChildren, NodeChild, createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes };
|
|
62
|
+
export { DefineVaporComponent, DefineVaporSetupFnComponent, NodeArrayChildren, NodeChild, VaporFor, createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes };
|
package/dist/vapor.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as ToResolvedProps, i as SlotsToProps, n as IsKeyValues, r as Prettify } from "./types-
|
|
1
|
+
import { a as ToResolvedProps, i as SlotsToProps, n as IsKeyValues, r as Prettify } from "./types-CLKH5kLf.js";
|
|
2
2
|
import * as Vue from "vue";
|
|
3
|
-
import { Block, ComponentObjectPropsOptions, ComponentTypeEmits, EmitFn, EmitsOptions, ExtractDefaultPropTypes, ExtractPropTypes, Fragment, StaticSlots, TypeEmitsToOptions, VNode, VaporComponent, VaporComponentInstance, VaporComponentInstanceConstructor, VaporComponentOptions, VaporPublicProps, VaporRenderResult } from "vue";
|
|
3
|
+
import { Block, ComponentObjectPropsOptions, ComponentTypeEmits, EmitFn, EmitsOptions, ExtractDefaultPropTypes, ExtractPropTypes, Fragment, ShallowRef, StaticSlots, TypeEmitsToOptions, VNode, VaporComponent, VaporComponentInstance, VaporComponentInstanceConstructor, VaporComponentOptions, VaporPublicProps, VaporRenderResult } from "vue";
|
|
4
4
|
|
|
5
5
|
//#region src/vapor.d.ts
|
|
6
6
|
declare function defineVaporSSRComponent(comp: VaporComponent, extraOptions: VaporComponent): VaporComponent;
|
|
@@ -16,19 +16,19 @@ declare function setNodes(anchor: Node, ...values: any[]): void;
|
|
|
16
16
|
declare function createNodes(...values: any[]): Block[];
|
|
17
17
|
type DefineVaporComponent<RuntimePropsOptions = {}, RuntimePropsKeys extends string = string, InferredProps = (string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : { [key in RuntimePropsKeys]?: any }), Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block, TypeRefs extends Record<string, unknown> = {}, MakeDefaultsOptional extends boolean = true, PublicProps = VaporPublicProps, ResolvedProps = ToResolvedProps<InferredProps, Emits>, Defaults = ExtractDefaultPropTypes<RuntimePropsOptions>> = VaporComponentInstanceConstructor<VaporComponentInstance<(MakeDefaultsOptional extends true ? keyof Defaults extends never ? Prettify<ResolvedProps> & PublicProps : Partial<Defaults> & Omit<Prettify<ResolvedProps> & PublicProps, keyof Defaults> : Prettify<ResolvedProps> & PublicProps) & SlotsToProps<Slots, NodeChild>, Emits, Slots, Exposed, TypeBlock, TypeRefs>> & VaporComponentOptions<RuntimePropsOptions | RuntimePropsKeys[], Emits, RuntimeEmitsKeys, Slots, Exposed>;
|
|
18
18
|
type DefineVaporSetupFnComponent<Props extends Record<string, any> = {}, Emits extends EmitsOptions = {}, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block, ResolvedProps extends Record<string, any> = ToResolvedProps<Props & VaporPublicProps, Emits>> = new () => VaporComponentInstance<ResolvedProps & SlotsToProps<Slots, NodeChild>, Emits, Slots, Exposed, TypeBlock>;
|
|
19
|
-
declare function
|
|
19
|
+
declare function defineVaporComponent<Props extends Record<string, any>, Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block>(setup: (this: void, props: Props, ctx: {
|
|
20
20
|
emit: EmitFn<Emits>;
|
|
21
21
|
slots: Slots;
|
|
22
22
|
attrs: Record<string, any>;
|
|
23
23
|
expose: (exposed?: Exposed) => void;
|
|
24
|
-
}) => VaporRenderResult<TypeBlock> | void, extraOptions?: VaporComponentOptions<(keyof Props)[], Emits, RuntimeEmitsKeys, Slots, Exposed> & ThisType<void>): DefineVaporSetupFnComponent<Props, Emits, Slots, Exposed, TypeBlock>;
|
|
25
|
-
declare function
|
|
24
|
+
}) => VaporRenderResult<TypeBlock> | void, extraOptions?: VaporComponentOptions<(keyof NoInfer<Props>)[], Emits, RuntimeEmitsKeys, Slots, Exposed> & ThisType<void>): DefineVaporSetupFnComponent<Props, Emits, Slots, Exposed, TypeBlock>;
|
|
25
|
+
declare function defineVaporComponent<Props extends Record<string, any>, Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block>(this: void, setup: (props: Props, ctx: {
|
|
26
26
|
emit: EmitFn<Emits>;
|
|
27
27
|
slots: Slots;
|
|
28
28
|
attrs: Record<string, any>;
|
|
29
29
|
expose: (exposed?: Exposed) => void;
|
|
30
30
|
}) => VaporRenderResult<TypeBlock> | void, extraOptions?: VaporComponentOptions<ComponentObjectPropsOptions<Props>, Emits, RuntimeEmitsKeys, Slots, Exposed> & ThisType<void>): DefineVaporSetupFnComponent<Props, Emits, Slots, Exposed, TypeBlock>;
|
|
31
|
-
declare function
|
|
31
|
+
declare function defineVaporComponent<TypeProps, RuntimePropsOptions extends ComponentObjectPropsOptions = ComponentObjectPropsOptions, RuntimePropsKeys extends string = string, TypeEmits extends ComponentTypeEmits = {}, RuntimeEmitsOptions extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, ResolvedEmits extends EmitsOptions = ({} extends RuntimeEmitsOptions ? TypeEmitsToOptions<TypeEmits> : RuntimeEmitsOptions), InferredProps = (IsKeyValues<TypeProps> extends true ? TypeProps : string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : { [key in RuntimePropsKeys]?: any }), TypeRefs extends Record<string, unknown> = {}, TypeBlock extends Block = Block>(options: VaporComponentOptions<RuntimePropsOptions | RuntimePropsKeys[], ResolvedEmits, RuntimeEmitsKeys, Slots, Exposed, TypeBlock, InferredProps> & {
|
|
32
32
|
[key: string]: any;
|
|
33
33
|
/**
|
|
34
34
|
* @private
|
|
@@ -47,6 +47,16 @@ declare function _defineVaporComponent<TypeProps, RuntimePropsOptions extends Co
|
|
|
47
47
|
*/
|
|
48
48
|
__typeEl?: TypeBlock;
|
|
49
49
|
} & ThisType<void>): DefineVaporComponent<RuntimePropsOptions, RuntimePropsKeys, InferredProps, ResolvedEmits, RuntimeEmitsKeys, Slots, Exposed extends Block ? Record<string, any> : Exposed, TypeBlock, TypeRefs, unknown extends TypeProps ? true : false>;
|
|
50
|
-
|
|
50
|
+
type ResolveItem<Item, GetKey> = GetKey extends undefined ? Item : ShallowRef<Item>;
|
|
51
|
+
declare const VaporFor: new <T extends any[] | Record<any, any> | number | string | Set<any> | Map<any, any>, Item = (T extends number ? number : T extends string ? string : T extends any[] ? T[number] : T extends Iterable<infer T1> ? T1 : Record<any, any>), GetKeyDetault = (...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => any, GetKey extends GetKeyDetault | null | undefined = undefined>() => VaporComponentInstance<Readonly<{
|
|
52
|
+
in: T;
|
|
53
|
+
getKey?: GetKey extends undefined ? GetKeyDetault : GetKey;
|
|
54
|
+
} & Vue.ReservedProps & Vue.AllowedComponentProps & Vue.ComponentCustomProps> & Readonly<{}> & {
|
|
55
|
+
'v-slots'?: {
|
|
56
|
+
default: (...args: string extends keyof Item ? [item: ResolveItem<T[keyof T], GetKey>, key: ShallowRef<keyof T>, index: ShallowRef<number>] : [item: ResolveItem<Item, GetKey>, index: ShallowRef<number>]) => any;
|
|
57
|
+
} | ((...args: string extends keyof Item ? [item: ResolveItem<T[keyof T], GetKey>, key: ShallowRef<keyof T>, index: ShallowRef<number>] : [item: ResolveItem<Item, GetKey>, index: ShallowRef<number>]) => any) | NoInfer<NodeChild<undefined>> | undefined;
|
|
58
|
+
}, {}, {
|
|
59
|
+
default: (...args: string extends keyof Item ? [item: ResolveItem<T[keyof T], GetKey>, key: ShallowRef<keyof T>, index: ShallowRef<number>] : [item: ResolveItem<Item, GetKey>, index: ShallowRef<number>]) => any;
|
|
60
|
+
}, Record<string, any>, Vue.ForFragment, Record<string, any>>;
|
|
51
61
|
//#endregion
|
|
52
|
-
export { DefineVaporComponent, DefineVaporSetupFnComponent, NodeArrayChildren, NodeChild, createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes };
|
|
62
|
+
export { DefineVaporComponent, DefineVaporSetupFnComponent, NodeArrayChildren, NodeChild, VaporFor, createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes };
|
package/dist/vapor.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as Vue from "vue";
|
|
2
|
-
import { EffectScope, Fragment,
|
|
3
|
-
|
|
2
|
+
import { EffectScope, Fragment, getCurrentInstance } from "vue";
|
|
4
3
|
//#region src/vapor.ts
|
|
5
4
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6
5
|
function defineVaporSSRComponent(comp, extraOptions) {
|
|
@@ -123,7 +122,19 @@ function setNodes(anchor, ...values) {
|
|
|
123
122
|
function createNodes(...values) {
|
|
124
123
|
return resolveValues(values);
|
|
125
124
|
}
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
126
|
+
function defineVaporComponent(comp, extraOptions) {
|
|
127
|
+
if (typeof comp === "function") return Object.assign({ name: comp.name }, extraOptions, {
|
|
128
|
+
setup: comp,
|
|
129
|
+
__vapor: true
|
|
130
|
+
});
|
|
131
|
+
comp.__vapor = true;
|
|
132
|
+
return comp;
|
|
133
|
+
}
|
|
134
|
+
const VaporFor = /* @__PURE__ */ defineVaporComponent((props, { slots }) => {
|
|
135
|
+
return Vue.createFor(() => props.in, (item, key, index) => {
|
|
136
|
+
return slots.default ? slots.default(props.getKey === void 0 ? item.value : item, key, index) : [];
|
|
137
|
+
}, props.getKey === void 0 ? (item) => item : props.getKey);
|
|
138
|
+
}, { props: ["in", "getKey"] });
|
|
128
139
|
//#endregion
|
|
129
|
-
export { createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes };
|
|
140
|
+
export { VaporFor, createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes };
|
package/dist/vdom.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("./chunk-CKQMccvm.cjs");
|
|
2
3
|
let vue = require("vue");
|
|
3
|
-
|
|
4
4
|
//#region src/vdom.ts
|
|
5
5
|
const cacheMap = /* @__PURE__ */ new WeakMap();
|
|
6
6
|
function createVNodeCache(key) {
|
|
@@ -33,9 +33,16 @@ const normalizeSlot = (rawSlot) => {
|
|
|
33
33
|
});
|
|
34
34
|
};
|
|
35
35
|
const defineComponent = vue.defineComponent;
|
|
36
|
-
|
|
36
|
+
const For = defineComponent((props, { slots }) => {
|
|
37
|
+
const defaultSlot = slots.default;
|
|
38
|
+
return () => ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(props.in, (item, key, index) => {
|
|
39
|
+
const result = defaultSlot(item, key, index);
|
|
40
|
+
return Array.isArray(result) ? result.length === 1 ? result[0] : normalizeVNode(result) : result;
|
|
41
|
+
}), 128));
|
|
42
|
+
}, { props: ["in"] });
|
|
37
43
|
//#endregion
|
|
44
|
+
exports.For = For;
|
|
38
45
|
exports.createVNodeCache = createVNodeCache;
|
|
39
46
|
exports.defineComponent = defineComponent;
|
|
40
47
|
exports.normalizeSlot = normalizeSlot;
|
|
41
|
-
exports.normalizeVNode = normalizeVNode;
|
|
48
|
+
exports.normalizeVNode = normalizeVNode;
|
package/dist/vdom.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { a as ToResolvedProps, i as SlotsToProps, n as IsKeyValues } from "./types-
|
|
1
|
+
import { a as ToResolvedProps, i as SlotsToProps, n as IsKeyValues } from "./types-C847TkaY.cjs";
|
|
2
|
+
import * as _$vue from "vue";
|
|
2
3
|
import { Component, ComponentInjectOptions, ComponentObjectPropsOptions, ComponentOptions, ComponentOptionsBase, ComponentOptionsMixin, ComponentPropsOptions, ComponentProvideOptions, ComponentPublicInstance, ComponentTypeEmits, ComputedOptions, CreateComponentPublicInstanceWithMixins, Directive, EmitFn, EmitsOptions, EmitsToProps, ExtractDefaultPropTypes, ExtractPropTypes, GlobalComponents, GlobalDirectives, MethodOptions, PublicProps, Slot, SlotsType, TypeEmitsToOptions, VNode, VNodeChild } from "vue";
|
|
3
4
|
|
|
4
5
|
//#region src/vdom.d.ts
|
|
@@ -56,5 +57,20 @@ declare function _defineComponent<TypeProps, RuntimePropsOptions extends Compone
|
|
|
56
57
|
} & ComponentOptionsBase<ToResolvedProps<InferredProps, ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, RuntimeEmitsOptions, RuntimeEmitsKeys, {}, // Defaults
|
|
57
58
|
InjectOptions, InjectKeys, Slots, LocalComponents, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstanceWithMixins<ToResolvedProps<InferredProps, ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, {}, {}, false, InjectOptions, Slots, LocalComponents, Directives, string>>): DefineComponent<InferredProps, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, RuntimeEmitsKeys, PublicProps, ToResolvedProps<InferredProps, ResolvedEmits>, ExtractDefaultPropTypes<RuntimePropsOptions>, Slots, LocalComponents, Directives, Exposed, Provide, unknown extends TypeProps ? true : false, TypeRefs, TypeEl>;
|
|
58
59
|
declare const defineComponent: typeof _defineComponent;
|
|
60
|
+
declare const For: new <T extends any[] | Record<any, any> | number | string | Set<any> | Map<any, any>, Item = (T extends number ? number : T extends string ? string : T extends any[] ? T[number] : T extends Iterable<infer T1> ? T1 : Record<any, any>)>(props: {
|
|
61
|
+
in: T;
|
|
62
|
+
} & {} & {
|
|
63
|
+
'v-slots'?: ((...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => any) | Readonly<{
|
|
64
|
+
default: (...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => any;
|
|
65
|
+
}> | NoInfer<VNodeChild> | undefined;
|
|
66
|
+
} & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps) => CreateComponentPublicInstanceWithMixins<{
|
|
67
|
+
in: T;
|
|
68
|
+
} & {} & {
|
|
69
|
+
'v-slots'?: ((...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => any) | Readonly<{
|
|
70
|
+
default: (...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => any;
|
|
71
|
+
}> | NoInfer<VNodeChild> | undefined;
|
|
72
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {}, false, {}, SlotsType<{
|
|
73
|
+
default: (...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => any;
|
|
74
|
+
}>, {}, {}, never>;
|
|
59
75
|
//#endregion
|
|
60
|
-
export { DefineComponent, DefineSetupFnComponent, createVNodeCache, defineComponent, normalizeSlot, normalizeVNode };
|
|
76
|
+
export { DefineComponent, DefineSetupFnComponent, For, createVNodeCache, defineComponent, normalizeSlot, normalizeVNode };
|
package/dist/vdom.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { a as ToResolvedProps, i as SlotsToProps, n as IsKeyValues } from "./types-
|
|
1
|
+
import { a as ToResolvedProps, i as SlotsToProps, n as IsKeyValues } from "./types-CLKH5kLf.js";
|
|
2
|
+
import * as _$vue from "vue";
|
|
2
3
|
import { Component, ComponentInjectOptions, ComponentObjectPropsOptions, ComponentOptions, ComponentOptionsBase, ComponentOptionsMixin, ComponentPropsOptions, ComponentProvideOptions, ComponentPublicInstance, ComponentTypeEmits, ComputedOptions, CreateComponentPublicInstanceWithMixins, Directive, EmitFn, EmitsOptions, EmitsToProps, ExtractDefaultPropTypes, ExtractPropTypes, GlobalComponents, GlobalDirectives, MethodOptions, PublicProps, Slot, SlotsType, TypeEmitsToOptions, VNode, VNodeChild } from "vue";
|
|
3
4
|
|
|
4
5
|
//#region src/vdom.d.ts
|
|
@@ -56,5 +57,20 @@ declare function _defineComponent<TypeProps, RuntimePropsOptions extends Compone
|
|
|
56
57
|
} & ComponentOptionsBase<ToResolvedProps<InferredProps, ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, RuntimeEmitsOptions, RuntimeEmitsKeys, {}, // Defaults
|
|
57
58
|
InjectOptions, InjectKeys, Slots, LocalComponents, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstanceWithMixins<ToResolvedProps<InferredProps, ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, {}, {}, false, InjectOptions, Slots, LocalComponents, Directives, string>>): DefineComponent<InferredProps, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, RuntimeEmitsKeys, PublicProps, ToResolvedProps<InferredProps, ResolvedEmits>, ExtractDefaultPropTypes<RuntimePropsOptions>, Slots, LocalComponents, Directives, Exposed, Provide, unknown extends TypeProps ? true : false, TypeRefs, TypeEl>;
|
|
58
59
|
declare const defineComponent: typeof _defineComponent;
|
|
60
|
+
declare const For: new <T extends any[] | Record<any, any> | number | string | Set<any> | Map<any, any>, Item = (T extends number ? number : T extends string ? string : T extends any[] ? T[number] : T extends Iterable<infer T1> ? T1 : Record<any, any>)>(props: {
|
|
61
|
+
in: T;
|
|
62
|
+
} & {} & {
|
|
63
|
+
'v-slots'?: ((...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => any) | Readonly<{
|
|
64
|
+
default: (...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => any;
|
|
65
|
+
}> | NoInfer<VNodeChild> | undefined;
|
|
66
|
+
} & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps) => CreateComponentPublicInstanceWithMixins<{
|
|
67
|
+
in: T;
|
|
68
|
+
} & {} & {
|
|
69
|
+
'v-slots'?: ((...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => any) | Readonly<{
|
|
70
|
+
default: (...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => any;
|
|
71
|
+
}> | NoInfer<VNodeChild> | undefined;
|
|
72
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {}, false, {}, SlotsType<{
|
|
73
|
+
default: (...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => any;
|
|
74
|
+
}>, {}, {}, never>;
|
|
59
75
|
//#endregion
|
|
60
|
-
export { DefineComponent, DefineSetupFnComponent, createVNodeCache, defineComponent, normalizeSlot, normalizeVNode };
|
|
76
|
+
export { DefineComponent, DefineSetupFnComponent, For, createVNodeCache, defineComponent, normalizeSlot, normalizeVNode };
|
package/dist/vdom.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Comment, Fragment, Text, cloneVNode, createBlock, createElementBlock, createElementVNode, createVNode, defineComponent as defineComponent$1, getCurrentInstance, isVNode, openBlock, withCtx } from "vue";
|
|
2
|
-
|
|
1
|
+
import { Comment, Fragment, Text, cloneVNode, createBlock, createElementBlock, createElementVNode, createVNode, defineComponent as defineComponent$1, getCurrentInstance, isVNode, openBlock, renderList, withCtx } from "vue";
|
|
3
2
|
//#region src/vdom.ts
|
|
4
3
|
const cacheMap = /* @__PURE__ */ new WeakMap();
|
|
5
4
|
function createVNodeCache(key) {
|
|
@@ -32,6 +31,12 @@ const normalizeSlot = (rawSlot) => {
|
|
|
32
31
|
});
|
|
33
32
|
};
|
|
34
33
|
const defineComponent = defineComponent$1;
|
|
35
|
-
|
|
34
|
+
const For = defineComponent((props, { slots }) => {
|
|
35
|
+
const defaultSlot = slots.default;
|
|
36
|
+
return () => (openBlock(true), createElementBlock(Fragment, null, renderList(props.in, (item, key, index) => {
|
|
37
|
+
const result = defaultSlot(item, key, index);
|
|
38
|
+
return Array.isArray(result) ? result.length === 1 ? result[0] : normalizeVNode(result) : result;
|
|
39
|
+
}), 128));
|
|
40
|
+
}, { props: ["in"] });
|
|
36
41
|
//#endregion
|
|
37
|
-
export { createVNodeCache, defineComponent, normalizeSlot, normalizeVNode };
|
|
42
|
+
export { For, createVNodeCache, defineComponent, normalizeSlot, normalizeVNode };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue-jsx-vapor/runtime",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.2.
|
|
4
|
+
"version": "3.2.12",
|
|
5
5
|
"description": "Vue JSX Vapor Runtime",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/vuejs/vue-jsx-vapor#readme",
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
".": {
|
|
23
23
|
"types": "./dist/index.d.ts",
|
|
24
24
|
"jsx-vapor-dev": "./src/index.ts",
|
|
25
|
-
"
|
|
26
|
-
"
|
|
25
|
+
"import": "./dist/index.js",
|
|
26
|
+
"require": "./dist/index.cjs"
|
|
27
27
|
},
|
|
28
28
|
"./raw": {
|
|
29
29
|
"types": "./dist/raw.d.ts",
|
|
30
30
|
"jsx-vapor-dev": "./src/raw.ts",
|
|
31
|
-
"
|
|
32
|
-
"
|
|
31
|
+
"import": "./dist/raw.js",
|
|
32
|
+
"require": "./dist/raw.cjs"
|
|
33
33
|
},
|
|
34
34
|
"./*": "./*"
|
|
35
35
|
},
|
|
File without changes
|
|
File without changes
|