@vue-jsx/runtime 3.3.0-beta.0 → 3.3.0-rc.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/h.d.ts +19 -16
- package/dist/h.js +3 -3
- package/dist/index.d.ts +5 -5
- package/dist/index.js +2 -2
- package/dist/jsx.d.ts +96 -95
- package/dist/props.d.ts +6 -9
- package/dist/props.js +5 -5
- package/dist/raw.d.ts +9 -10
- package/dist/raw.js +5 -5
- package/dist/ssr.d.ts +2 -4
- package/dist/types.d.ts +17 -20
- package/dist/vapor.d.ts +39 -83
- package/dist/vapor.js +8 -6
- package/dist/vdom.d.ts +20 -46
- package/package.json +20 -20
package/dist/h.d.ts
CHANGED
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
import { NodeChild } from "./types.js";
|
|
2
|
-
import { Block,
|
|
3
|
-
|
|
1
|
+
import { EmitFnToProps, ExposedToProps, NodeChild, NodeRef, SlotsToProps } from "./types.js";
|
|
2
|
+
import { Block, Fragment, Suspense, SuspenseProps, TeleportProps, VaporComponentInstance, VaporTeleport } from "vue";
|
|
4
3
|
//#region src/h.d.ts
|
|
5
|
-
type HTMLElementEventHandler = { [K in keyof HTMLElementEventMap as `on${Capitalize<K>}`]?: (ev: HTMLElementEventMap[K]) => any };
|
|
6
|
-
type NodeRef = string | Ref | ((ref: Element | VaporComponentInstance, refs: Record<string, any>) => void);
|
|
4
|
+
type HTMLElementEventHandler = { [K in keyof HTMLElementEventMap as `on${Capitalize<K>}`]?: (ev: HTMLElementEventMap[K]) => any; };
|
|
7
5
|
type ReservedProps$1 = {
|
|
8
6
|
key?: () => PropertyKey;
|
|
9
|
-
ref?: NodeRef;
|
|
10
7
|
};
|
|
11
8
|
type RawProps = Record<string, any> & ReservedProps$1;
|
|
12
|
-
type
|
|
13
|
-
type
|
|
9
|
+
type RawNodeChild = NodeChild<Block | (() => RawNodeChild)>;
|
|
10
|
+
type RawSlot = (...args: any[]) => RawNodeChild;
|
|
11
|
+
type RawChildren = RawNodeChild | RawSlot;
|
|
14
12
|
type RawSlots = Record<string, RawSlot>;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
type VaporHType = string | typeof Fragment | typeof Suspense | typeof VaporTeleport | ((...args: any[]) => any) | (new (...args: any[]) => VaporComponentInstance);
|
|
14
|
+
type ResolveProps<T> = T extends Record<string, any> ? { [K in keyof T]: T[K] | (() => T[K]); } : T;
|
|
15
|
+
type ResolveSlots<T> = T extends ((...args: infer Args) => any) ? (...args: Args) => RawNodeChild : T extends Record<string, any> ? { [K in keyof T]?: ResolveSlots<T[K]>; } : RawNodeChild;
|
|
16
|
+
type VaporHArgs<T extends VaporHType> = T extends string ? [props?: (RawProps & {
|
|
17
|
+
ref?: NodeRef<T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element | VaporComponentInstance>;
|
|
18
|
+
} & (T extends keyof HTMLElementTagNameMap ? HTMLElementEventHandler : {})) | null, children?: T extends keyof HTMLElementTagNameMap ? RawChildren : RawChildren | RawSlots] : T extends typeof Fragment ? [props?: ReservedProps$1 | null, children?: RawChildren] : T extends typeof Suspense ? [props?: (RawProps & SuspenseProps) | null, children?: RawChildren | RawSlots] : T extends typeof VaporTeleport ? [props: RawProps & TeleportProps, children: RawChildren | RawSlots] : T extends (new (...args: any[]) => infer Instance) ? Instance extends VaporComponentInstance ? [props?: (ResolveProps<Omit<Instance['props'], 'ref'>> & ExposedToProps<string extends keyof NonNullable<Instance['exposed']> ? VaporComponentInstance : NonNullable<Instance['exposed']>>) | null, children?: SlotsToProps<Instance['slots']> extends (infer SlotsProps) ? 'v-slots' extends keyof SlotsProps ? ResolveSlots<SlotsProps['v-slots']> : RawChildren | RawSlots : RawChildren | RawSlots] : [] : T extends ((props: infer Props, ctx: {
|
|
19
|
+
slots: infer Slots extends Record<string, any>;
|
|
20
|
+
expose: (exposed: infer Exposed extends Record<string, any>) => void;
|
|
21
|
+
attrs: any;
|
|
22
|
+
emit: infer Emit;
|
|
23
|
+
}) => any) ? [props?: (ResolveProps<Props> & EmitFnToProps<Emit> & ExposedToProps<Exposed>) | null, children?: SlotsToProps<Slots> extends (infer SlotsProps) ? 'v-slots' extends keyof SlotsProps ? ResolveSlots<SlotsProps['v-slots']> : RawChildren | RawSlots : RawChildren | RawSlots] : never;
|
|
24
|
+
export declare function vaporH<T extends VaporHType>(type: T, ...[props, children]: VaporHArgs<T>): any;
|
|
25
|
+
//#endregion
|
package/dist/h.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createComponent, createProxyComponent, normalizeNode } from "./vapor.js";
|
|
2
2
|
import * as Vue from "vue";
|
|
3
3
|
//#region src/h.ts
|
|
4
|
-
|
|
5
|
-
function
|
|
4
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
5
|
+
function vaporH(type, ...[props, children]) {
|
|
6
6
|
const { props: resolvedProps, key, ref } = resolveProps(props);
|
|
7
7
|
const render = () => {
|
|
8
8
|
const comp = createComponent(type, resolvedProps, children ? typeof children === "object" && !Array.isArray(children) ? new Proxy(children, { get: (target, key, receiver) => createProxyComponent(Reflect.get(target, key, receiver), normalizeNode) }) : { default: typeof children === "function" ? createProxyComponent(children, normalizeNode) : () => normalizeNode(children) } : void 0);
|
|
@@ -30,4 +30,4 @@ function resolveProps(props) {
|
|
|
30
30
|
return resolvedProps;
|
|
31
31
|
}
|
|
32
32
|
//#endregion
|
|
33
|
-
export {
|
|
33
|
+
export { vaporH };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { DirectiveArgs, EmitFnToProps, ExposedToProps, ExtractExposed,
|
|
2
|
-
import {
|
|
1
|
+
import { DirectiveArgs, EmitFnToEmits, EmitFnToProps, ExposedToProps, ExtractExposed, NodeArrayChildren, NodeChild, NodeRef, RenderResult, SetupContextToProps, SlotsToProps } from "./types.js";
|
|
2
|
+
import { vaporH } from "./h.js";
|
|
3
3
|
import { getCurrentInstance, useFullProps, useProps } from "./props.js";
|
|
4
4
|
import { ssrRegisterHelper } from "./ssr.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { VaporFor, createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, normalizeVaporSlots, setNodes } from "./vapor.js";
|
|
6
|
+
import { DefineSetupFnComponent, For, createVNodeCache, defineComponent, normalizeClass, normalizeSlot, normalizeSlots, normalizeVNode } from "./vdom.js";
|
|
7
7
|
import { AbstractView, AnchorHTMLAttributes, AnimationEvent, AnimationEventHandler, AreaHTMLAttributes, AudioHTMLAttributes, BaseEventHandler, BaseHTMLAttributes, BaseSyntheticEvent, BlockquoteHTMLAttributes, ButtonHTMLAttributes, 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, JSX, 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, SyntheticEvent, TableHTMLAttributes, TdHTMLAttributes, TextareaHTMLAttributes, ThHTMLAttributes, TimeHTMLAttributes, TrackHTMLAttributes, TransitionEvent, TransitionEventHandler, UIEvent, UIEventHandler, VideoHTMLAttributes, WebViewHTMLAttributes, WheelEvent, WheelEventHandler } from "./jsx.js";
|
|
8
8
|
import { shallowRef as useRef } from "vue";
|
|
9
|
-
export { AbstractView, AnchorHTMLAttributes, AnimationEvent, AnimationEventHandler, AreaHTMLAttributes, AudioHTMLAttributes, BaseEventHandler, BaseHTMLAttributes, BaseSyntheticEvent, BlockquoteHTMLAttributes, ButtonHTMLAttributes, CanvasHTMLAttributes, ChangeEvent, ChangeEventHandler, ClipboardEvent, ClipboardEventHandler, ColHTMLAttributes, ColgroupHTMLAttributes, CompositionEvent, CompositionEventHandler, DataHTMLAttributes,
|
|
9
|
+
export { type AbstractView, type AnchorHTMLAttributes, type AnimationEvent, type AnimationEventHandler, type AreaHTMLAttributes, type AudioHTMLAttributes, type BaseEventHandler, type BaseHTMLAttributes, type BaseSyntheticEvent, type BlockquoteHTMLAttributes, type ButtonHTMLAttributes, type CanvasHTMLAttributes, type ChangeEvent, type ChangeEventHandler, type ClipboardEvent, type ClipboardEventHandler, type ColHTMLAttributes, type ColgroupHTMLAttributes, type CompositionEvent, type CompositionEventHandler, type DataHTMLAttributes, DefineSetupFnComponent, type DelHTMLAttributes, type DetailsHTMLAttributes, type DialogHTMLAttributes, type DirectiveArgs, type DragEvent, type DragEventHandler, type EmbedHTMLAttributes, type EmitFnToEmits, type EmitFnToProps, type EventHandler, type EventHandlers, type Events, type ExposedToProps, type ExtractExposed, type FieldsetHTMLAttributes, type FocusEvent, type FocusEventHandler, For, type FormEvent, type FormEventHandler, type FormHTMLAttributes, type HTMLAttributes, type HtmlHTMLAttributes, type IframeHTMLAttributes, type ImgHTMLAttributes, type InputHTMLAttributes, type InputTypeHTMLAttribute, type InsHTMLAttributes, type IntrinsicElementAttributes, type JSX, type KeyboardEvent, type KeyboardEventHandler, type KeygenHTMLAttributes, type LabelHTMLAttributes, type LiHTMLAttributes, type LinkHTMLAttributes, type MapHTMLAttributes, type MediaHTMLAttributes, type MenuHTMLAttributes, type MetaHTMLAttributes, type MeterHTMLAttributes, type ModifierKey, type MouseEvent, type MouseEventHandler, type NativeElements, type NodeArrayChildren, type NodeChild, type NodeRef, type ObjectHTMLAttributes, type OlHTMLAttributes, type OptgroupHTMLAttributes, type OptionHTMLAttributes, type OutputHTMLAttributes, type ParamHTMLAttributes, type ProgressHTMLAttributes, type QuoteHTMLAttributes, type RenderResult, type SVGAttributes, type ScriptHTMLAttributes, type SelectHTMLAttributes, type SetupContextToProps, type SlotsToProps, type SourceHTMLAttributes, type StyleHTMLAttributes, type SyntheticEvent, type TableHTMLAttributes, type TdHTMLAttributes, type TextareaHTMLAttributes, type ThHTMLAttributes, type TimeHTMLAttributes, type TrackHTMLAttributes, type TransitionEvent, type TransitionEventHandler, type UIEvent, type UIEventHandler, VaporFor, type VideoHTMLAttributes, type WebViewHTMLAttributes, type WheelEvent, type WheelEventHandler, createComponent, createNodes, createProxyComponent, createVNodeCache, defineComponent, defineVaporComponent, defineVaporSSRComponent, getCurrentInstance, isBlock, normalizeClass, normalizeNode, normalizeSlot, normalizeSlots, normalizeVNode, normalizeVaporSlots, setNodes, ssrRegisterHelper, useFullProps, useProps, useRef, vaporH };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VaporFor, createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, normalizeVaporSlots, setNodes } from "./vapor.js";
|
|
2
|
-
import {
|
|
2
|
+
import { vaporH } from "./h.js";
|
|
3
3
|
import { getCurrentInstance, useFullProps, useProps } from "./props.js";
|
|
4
4
|
import { ssrRegisterHelper } from "./ssr.js";
|
|
5
5
|
import { For, createVNodeCache, defineComponent, normalizeClass, normalizeSlot, normalizeSlots, normalizeVNode } from "./vdom.js";
|
|
6
6
|
import { shallowRef as useRef } from "vue";
|
|
7
|
-
export { For, VaporFor, createComponent, createNodes, createProxyComponent, createVNodeCache, defineComponent, defineVaporComponent, defineVaporSSRComponent, getCurrentInstance,
|
|
7
|
+
export { For, VaporFor, createComponent, createNodes, createProxyComponent, createVNodeCache, defineComponent, defineVaporComponent, defineVaporSSRComponent, getCurrentInstance, isBlock, normalizeClass, normalizeNode, normalizeSlot, normalizeSlots, normalizeVNode, normalizeVaporSlots, setNodes, ssrRegisterHelper, useFullProps, useProps, useRef, vaporH };
|