@vue-jsx/runtime 3.3.0-beta.1 → 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 +2 -2
- package/dist/index.d.ts +4 -4
- package/dist/jsx.d.ts +96 -95
- package/dist/props.d.ts +4 -7
- package/dist/props.js +3 -3
- 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 vaporH(type, props, children) {
|
|
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);
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { DirectiveArgs, EmitFnToProps, ExposedToProps, ExtractExposed,
|
|
1
|
+
import { DirectiveArgs, EmitFnToEmits, EmitFnToProps, ExposedToProps, ExtractExposed, NodeArrayChildren, NodeChild, NodeRef, RenderResult, SetupContextToProps, SlotsToProps } from "./types.js";
|
|
2
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/jsx.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { EmitFnToProps, ExtractExposed, NodeRef, RenderResult, SlotsToProps } from "./types.js";
|
|
2
2
|
import { AriaAttributes, ReservedProps, StyleValue, UnwrapRef, VNodeRef, VaporComponentInstance } from "vue";
|
|
3
|
-
|
|
4
3
|
//#region src/jsx.d.ts
|
|
5
4
|
type NativeElement = Element;
|
|
6
|
-
|
|
5
|
+
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
|
|
6
|
+
export declare namespace JSX {
|
|
7
7
|
type Element = RenderResult;
|
|
8
8
|
interface ElementAttributesProperty {
|
|
9
9
|
$props: {};
|
|
@@ -18,9 +18,9 @@ declare namespace JSX {
|
|
|
18
18
|
class?: ClassValue | undefined;
|
|
19
19
|
style?: StyleValue | undefined;
|
|
20
20
|
}
|
|
21
|
-
type LibraryManagedAttributes<Component, Props> =
|
|
21
|
+
type LibraryManagedAttributes<Component, Props> = DistributiveOmit<Props, 'ref'> & (Component extends (abstract new (...args: any[]) => infer Instance) ? {
|
|
22
22
|
ref?: NodeRef<ExtractExposed<Props, 'exposed' extends keyof Instance ? string extends keyof NonNullable<NonNullable<Instance['exposed']>> ? Instance : UnwrapRef<Instance['exposed']> : Instance>>;
|
|
23
|
-
} & ('v-slots' extends keyof Props ? {} : '$slots' extends keyof Instance ? SlotsToProps<Instance['$slots'] & {}> : 'slots' extends keyof Instance ? SlotsToProps<Instance['slots'] & {}> : {}) : Component extends ((props:
|
|
23
|
+
} & ('v-slots' extends keyof Props ? {} : '$slots' extends keyof Instance ? SlotsToProps<Instance['$slots'] & {}> : 'slots' extends keyof Instance ? SlotsToProps<Instance['slots'] & {}> : {}) : Component extends ((props: any, ctx: {
|
|
24
24
|
slots: infer Slots;
|
|
25
25
|
attrs: any;
|
|
26
26
|
emit: infer Emit;
|
|
@@ -40,7 +40,7 @@ interface StyleMedia {}
|
|
|
40
40
|
*/
|
|
41
41
|
type CrossOrigin = 'anonymous' | 'use-credentials' | '';
|
|
42
42
|
type ClassValue = false | null | undefined | string | Record<string, any> | Array<ClassValue>;
|
|
43
|
-
interface HTMLAttributes<T = HTMLElement> extends AriaAttributes, EventHandlers<Events<T>> {
|
|
43
|
+
export interface HTMLAttributes<T = HTMLElement> extends AriaAttributes, EventHandlers<Events<T>> {
|
|
44
44
|
innerHTML?: string | undefined;
|
|
45
45
|
class?: ClassValue | undefined;
|
|
46
46
|
style?: StyleValue | undefined;
|
|
@@ -63,6 +63,7 @@ interface HTMLAttributes<T = HTMLElement> extends AriaAttributes, EventHandlers<
|
|
|
63
63
|
nonce?: string | undefined;
|
|
64
64
|
placeholder?: string | undefined;
|
|
65
65
|
spellcheck?: Booleanish | undefined;
|
|
66
|
+
slot?: string | undefined;
|
|
66
67
|
tabindex?: Numberish | undefined;
|
|
67
68
|
title?: string | undefined;
|
|
68
69
|
translate?: 'yes' | 'no' | undefined;
|
|
@@ -110,7 +111,7 @@ interface HTMLAttributes<T = HTMLElement> extends AriaAttributes, EventHandlers<
|
|
|
110
111
|
part?: string;
|
|
111
112
|
}
|
|
112
113
|
type HTMLAttributeReferrerPolicy = '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
|
|
113
|
-
interface AnchorHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
114
|
+
export interface AnchorHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
114
115
|
download?: any | undefined;
|
|
115
116
|
href?: string | undefined;
|
|
116
117
|
hreflang?: string | undefined;
|
|
@@ -121,7 +122,7 @@ interface AnchorHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
121
122
|
type?: string | undefined;
|
|
122
123
|
referrerpolicy?: HTMLAttributeReferrerPolicy | undefined;
|
|
123
124
|
}
|
|
124
|
-
interface AreaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
125
|
+
export interface AreaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
125
126
|
alt?: string | undefined;
|
|
126
127
|
coords?: string | undefined;
|
|
127
128
|
download?: any | undefined;
|
|
@@ -132,15 +133,15 @@ interface AreaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
132
133
|
shape?: string | undefined;
|
|
133
134
|
target?: string | undefined;
|
|
134
135
|
}
|
|
135
|
-
interface AudioHTMLAttributes<T> extends MediaHTMLAttributes<T> {}
|
|
136
|
-
interface BaseHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
136
|
+
export interface AudioHTMLAttributes<T> extends MediaHTMLAttributes<T> {}
|
|
137
|
+
export interface BaseHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
137
138
|
href?: string | undefined;
|
|
138
139
|
target?: string | undefined;
|
|
139
140
|
}
|
|
140
|
-
interface BlockquoteHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
141
|
+
export interface BlockquoteHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
141
142
|
cite?: string | undefined;
|
|
142
143
|
}
|
|
143
|
-
interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
144
|
+
export interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
144
145
|
disabled?: Booleanish | undefined;
|
|
145
146
|
form?: string | undefined;
|
|
146
147
|
formaction?: string | undefined;
|
|
@@ -152,45 +153,45 @@ interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
152
153
|
type?: 'submit' | 'reset' | 'button' | undefined;
|
|
153
154
|
value?: string | ReadonlyArray<string> | number | undefined;
|
|
154
155
|
}
|
|
155
|
-
interface CanvasHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
156
|
+
export interface CanvasHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
156
157
|
height?: Numberish | undefined;
|
|
157
158
|
width?: Numberish | undefined;
|
|
158
159
|
}
|
|
159
|
-
interface ColHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
160
|
+
export interface ColHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
160
161
|
span?: Numberish | undefined;
|
|
161
162
|
width?: Numberish | undefined;
|
|
162
163
|
}
|
|
163
|
-
interface ColgroupHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
164
|
+
export interface ColgroupHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
164
165
|
span?: Numberish | undefined;
|
|
165
166
|
}
|
|
166
|
-
interface DataHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
167
|
+
export interface DataHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
167
168
|
value?: string | ReadonlyArray<string> | number | undefined;
|
|
168
169
|
}
|
|
169
|
-
interface DetailsHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
170
|
+
export interface DetailsHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
170
171
|
name?: string | undefined;
|
|
171
172
|
open?: Booleanish | undefined;
|
|
172
173
|
}
|
|
173
|
-
interface DelHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
174
|
+
export interface DelHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
174
175
|
cite?: string | undefined;
|
|
175
176
|
datetime?: string | undefined;
|
|
176
177
|
}
|
|
177
|
-
interface DialogHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
178
|
+
export interface DialogHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
178
179
|
onCancel?: EventHandler<SyntheticEvent<T>> | undefined;
|
|
179
180
|
onClose?: EventHandler<SyntheticEvent<T>> | undefined;
|
|
180
181
|
open?: boolean | undefined;
|
|
181
182
|
}
|
|
182
|
-
interface EmbedHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
183
|
+
export interface EmbedHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
183
184
|
height?: Numberish | undefined;
|
|
184
185
|
src?: string | undefined;
|
|
185
186
|
type?: string | undefined;
|
|
186
187
|
width?: Numberish | undefined;
|
|
187
188
|
}
|
|
188
|
-
interface FieldsetHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
189
|
+
export interface FieldsetHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
189
190
|
disabled?: Booleanish | undefined;
|
|
190
191
|
form?: string | undefined;
|
|
191
192
|
name?: string | undefined;
|
|
192
193
|
}
|
|
193
|
-
interface FormHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
194
|
+
export interface FormHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
194
195
|
acceptcharset?: string | undefined;
|
|
195
196
|
action?: string | undefined;
|
|
196
197
|
autocomplete?: string | undefined;
|
|
@@ -200,10 +201,10 @@ interface FormHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
200
201
|
novalidate?: Booleanish | undefined;
|
|
201
202
|
target?: string | undefined;
|
|
202
203
|
}
|
|
203
|
-
interface HtmlHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
204
|
+
export interface HtmlHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
204
205
|
manifest?: string | undefined;
|
|
205
206
|
}
|
|
206
|
-
interface IframeHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
207
|
+
export interface IframeHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
207
208
|
allow?: string | undefined;
|
|
208
209
|
allowfullscreen?: Booleanish | undefined;
|
|
209
210
|
allowtransparency?: Booleanish | undefined;
|
|
@@ -225,7 +226,7 @@ interface IframeHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
225
226
|
srcdoc?: string | undefined;
|
|
226
227
|
width?: Numberish | undefined;
|
|
227
228
|
}
|
|
228
|
-
interface ImgHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
229
|
+
export interface ImgHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
229
230
|
alt?: string | undefined;
|
|
230
231
|
crossorigin?: CrossOrigin | undefined;
|
|
231
232
|
decoding?: 'async' | 'auto' | 'sync' | undefined;
|
|
@@ -239,11 +240,11 @@ interface ImgHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
239
240
|
usemap?: string | undefined;
|
|
240
241
|
width?: Numberish | undefined;
|
|
241
242
|
}
|
|
242
|
-
interface InsHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
243
|
+
export interface InsHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
243
244
|
cite?: string | undefined;
|
|
244
245
|
datetime?: string | undefined;
|
|
245
246
|
}
|
|
246
|
-
type InputTypeHTMLAttribute = 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week' | (string & {});
|
|
247
|
+
export type InputTypeHTMLAttribute = 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week' | (string & {});
|
|
247
248
|
type AutoFillAddressKind = 'billing' | 'shipping';
|
|
248
249
|
type AutoFillBase = '' | 'off' | 'on';
|
|
249
250
|
type AutoFillContactField = 'email' | 'tel' | 'tel-area-code' | 'tel-country-code' | 'tel-extension' | 'tel-local' | 'tel-local-prefix' | 'tel-local-suffix' | 'tel-national';
|
|
@@ -256,7 +257,7 @@ type AutoFillField = AutoFillNormalField | `${OptionalPrefixToken<AutoFillContac
|
|
|
256
257
|
type AutoFillSection = `section-${string}`;
|
|
257
258
|
type AutoFill = AutoFillBase | `${OptionalPrefixToken<AutoFillSection>}${OptionalPrefixToken<AutoFillAddressKind>}${AutoFillField}${OptionalPostfixToken<AutoFillCredentialField>}`;
|
|
258
259
|
type HTMLInputAutoCompleteAttribute = AutoFill | (string & {});
|
|
259
|
-
interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
260
|
+
export interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
260
261
|
accept?: string | undefined;
|
|
261
262
|
alt?: string | undefined;
|
|
262
263
|
autocomplete?: HTMLInputAutoCompleteAttribute | undefined;
|
|
@@ -289,7 +290,7 @@ interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
289
290
|
value?: any;
|
|
290
291
|
width?: Numberish | undefined;
|
|
291
292
|
}
|
|
292
|
-
interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
293
|
+
export interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
293
294
|
challenge?: string | undefined;
|
|
294
295
|
disabled?: Booleanish | undefined;
|
|
295
296
|
form?: string | undefined;
|
|
@@ -297,14 +298,14 @@ interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
297
298
|
keyparams?: string | undefined;
|
|
298
299
|
name?: string | undefined;
|
|
299
300
|
}
|
|
300
|
-
interface LabelHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
301
|
+
export interface LabelHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
301
302
|
for?: string | undefined;
|
|
302
303
|
form?: string | undefined;
|
|
303
304
|
}
|
|
304
|
-
interface LiHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
305
|
+
export interface LiHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
305
306
|
value?: string | ReadonlyArray<string> | number | undefined;
|
|
306
307
|
}
|
|
307
|
-
interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
308
|
+
export interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
308
309
|
as?: string | undefined;
|
|
309
310
|
crossorigin?: CrossOrigin | undefined;
|
|
310
311
|
fetchPriority?: 'high' | 'low' | 'auto' | undefined;
|
|
@@ -319,13 +320,13 @@ interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
319
320
|
type?: string | undefined;
|
|
320
321
|
charset?: string | undefined;
|
|
321
322
|
}
|
|
322
|
-
interface MapHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
323
|
+
export interface MapHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
323
324
|
name?: string | undefined;
|
|
324
325
|
}
|
|
325
|
-
interface MenuHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
326
|
+
export interface MenuHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
326
327
|
type?: string | undefined;
|
|
327
328
|
}
|
|
328
|
-
interface MediaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
329
|
+
export interface MediaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
329
330
|
autoplay?: Booleanish | undefined;
|
|
330
331
|
controls?: Booleanish | undefined;
|
|
331
332
|
controlslist?: string | undefined;
|
|
@@ -337,14 +338,14 @@ interface MediaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
337
338
|
preload?: string | undefined;
|
|
338
339
|
src?: string | undefined;
|
|
339
340
|
}
|
|
340
|
-
interface MetaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
341
|
+
export interface MetaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
341
342
|
charset?: string | undefined;
|
|
342
343
|
content?: string | undefined;
|
|
343
344
|
httpequiv?: string | undefined;
|
|
344
345
|
media?: string | undefined | undefined;
|
|
345
346
|
name?: string | undefined;
|
|
346
347
|
}
|
|
347
|
-
interface MeterHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
348
|
+
export interface MeterHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
348
349
|
form?: string | undefined;
|
|
349
350
|
high?: Numberish | undefined;
|
|
350
351
|
low?: Numberish | undefined;
|
|
@@ -353,10 +354,10 @@ interface MeterHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
353
354
|
optimum?: Numberish | undefined;
|
|
354
355
|
value?: string | ReadonlyArray<string> | number | undefined;
|
|
355
356
|
}
|
|
356
|
-
interface QuoteHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
357
|
+
export interface QuoteHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
357
358
|
cite?: string | undefined;
|
|
358
359
|
}
|
|
359
|
-
interface ObjectHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
360
|
+
export interface ObjectHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
360
361
|
classid?: string | undefined;
|
|
361
362
|
data?: string | undefined;
|
|
362
363
|
form?: string | undefined;
|
|
@@ -367,35 +368,35 @@ interface ObjectHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
367
368
|
width?: Numberish | undefined;
|
|
368
369
|
wmode?: string | undefined;
|
|
369
370
|
}
|
|
370
|
-
interface OlHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
371
|
+
export interface OlHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
371
372
|
reversed?: Booleanish | undefined;
|
|
372
373
|
start?: Numberish | undefined;
|
|
373
374
|
type?: '1' | 'a' | 'A' | 'i' | 'I' | undefined;
|
|
374
375
|
}
|
|
375
|
-
interface OptgroupHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
376
|
+
export interface OptgroupHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
376
377
|
disabled?: Booleanish | undefined;
|
|
377
378
|
label?: string | undefined;
|
|
378
379
|
}
|
|
379
|
-
interface OptionHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
380
|
+
export interface OptionHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
380
381
|
disabled?: Booleanish | undefined;
|
|
381
382
|
label?: string | undefined;
|
|
382
383
|
selected?: Booleanish | undefined;
|
|
383
384
|
value?: any;
|
|
384
385
|
}
|
|
385
|
-
interface OutputHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
386
|
+
export interface OutputHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
386
387
|
for?: string | undefined;
|
|
387
388
|
form?: string | undefined;
|
|
388
389
|
name?: string | undefined;
|
|
389
390
|
}
|
|
390
|
-
interface ParamHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
391
|
+
export interface ParamHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
391
392
|
name?: string | undefined;
|
|
392
393
|
value?: string | ReadonlyArray<string> | number | undefined;
|
|
393
394
|
}
|
|
394
|
-
interface ProgressHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
395
|
+
export interface ProgressHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
395
396
|
max?: Numberish | undefined;
|
|
396
397
|
value?: string | ReadonlyArray<string> | number | undefined;
|
|
397
398
|
}
|
|
398
|
-
interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
399
|
+
export interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
399
400
|
async?: Booleanish | undefined;
|
|
400
401
|
/** @deprecated */
|
|
401
402
|
charset?: string | undefined;
|
|
@@ -407,7 +408,7 @@ interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
407
408
|
src?: string | undefined;
|
|
408
409
|
type?: string | undefined;
|
|
409
410
|
}
|
|
410
|
-
interface SelectHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
411
|
+
export interface SelectHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
411
412
|
autocomplete?: string | undefined;
|
|
412
413
|
disabled?: Booleanish | undefined;
|
|
413
414
|
form?: string | undefined;
|
|
@@ -417,7 +418,7 @@ interface SelectHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
417
418
|
size?: Numberish | undefined;
|
|
418
419
|
value?: any;
|
|
419
420
|
}
|
|
420
|
-
interface SourceHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
421
|
+
export interface SourceHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
421
422
|
height?: number | undefined;
|
|
422
423
|
media?: string | undefined;
|
|
423
424
|
sizes?: string | undefined;
|
|
@@ -426,12 +427,12 @@ interface SourceHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
426
427
|
type?: string | undefined;
|
|
427
428
|
width?: number | undefined;
|
|
428
429
|
}
|
|
429
|
-
interface StyleHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
430
|
+
export interface StyleHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
430
431
|
media?: string | undefined;
|
|
431
432
|
scoped?: Booleanish | undefined;
|
|
432
433
|
type?: string | undefined;
|
|
433
434
|
}
|
|
434
|
-
interface TableHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
435
|
+
export interface TableHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
435
436
|
align?: 'left' | 'center' | 'right' | undefined;
|
|
436
437
|
bgcolor?: string | undefined;
|
|
437
438
|
border?: number | undefined;
|
|
@@ -442,7 +443,7 @@ interface TableHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
442
443
|
summary?: string | undefined;
|
|
443
444
|
width?: Numberish | undefined;
|
|
444
445
|
}
|
|
445
|
-
interface TextareaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
446
|
+
export interface TextareaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
446
447
|
autocomplete?: string | undefined;
|
|
447
448
|
cols?: Numberish | undefined;
|
|
448
449
|
dirname?: string | undefined;
|
|
@@ -458,7 +459,7 @@ interface TextareaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
458
459
|
value?: string | ReadonlyArray<string> | number | null | undefined;
|
|
459
460
|
wrap?: string | undefined;
|
|
460
461
|
}
|
|
461
|
-
interface TdHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
462
|
+
export interface TdHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
462
463
|
align?: 'left' | 'center' | 'right' | 'justify' | 'char' | undefined;
|
|
463
464
|
colspan?: Numberish | undefined;
|
|
464
465
|
headers?: string | undefined;
|
|
@@ -469,7 +470,7 @@ interface TdHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
469
470
|
width?: Numberish | undefined;
|
|
470
471
|
valign?: 'top' | 'middle' | 'bottom' | 'baseline' | undefined;
|
|
471
472
|
}
|
|
472
|
-
interface ThHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
473
|
+
export interface ThHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
473
474
|
align?: 'left' | 'center' | 'right' | 'justify' | 'char' | undefined;
|
|
474
475
|
colspan?: Numberish | undefined;
|
|
475
476
|
headers?: string | undefined;
|
|
@@ -477,17 +478,17 @@ interface ThHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
477
478
|
scope?: string | undefined;
|
|
478
479
|
abbr?: string | undefined;
|
|
479
480
|
}
|
|
480
|
-
interface TimeHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
481
|
+
export interface TimeHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
481
482
|
datetime?: string | undefined;
|
|
482
483
|
}
|
|
483
|
-
interface TrackHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
484
|
+
export interface TrackHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
484
485
|
default?: Booleanish | undefined;
|
|
485
486
|
kind?: string | undefined;
|
|
486
487
|
label?: string | undefined;
|
|
487
488
|
src?: string | undefined;
|
|
488
489
|
srclang?: string | undefined;
|
|
489
490
|
}
|
|
490
|
-
interface VideoHTMLAttributes<T> extends MediaHTMLAttributes<T> {
|
|
491
|
+
export interface VideoHTMLAttributes<T> extends MediaHTMLAttributes<T> {
|
|
491
492
|
height?: Numberish | undefined;
|
|
492
493
|
playsinline?: Booleanish | undefined;
|
|
493
494
|
poster?: string | undefined;
|
|
@@ -495,7 +496,7 @@ interface VideoHTMLAttributes<T> extends MediaHTMLAttributes<T> {
|
|
|
495
496
|
disablePictureInPicture?: Booleanish | undefined;
|
|
496
497
|
disableRemotePlayback?: Booleanish | undefined;
|
|
497
498
|
}
|
|
498
|
-
interface WebViewHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
499
|
+
export interface WebViewHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
499
500
|
allowfullscreen?: Booleanish | undefined;
|
|
500
501
|
allowpopups?: Booleanish | undefined;
|
|
501
502
|
autosize?: Booleanish | undefined;
|
|
@@ -513,7 +514,7 @@ interface WebViewHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
513
514
|
useragent?: string | undefined;
|
|
514
515
|
webpreferences?: string | undefined;
|
|
515
516
|
}
|
|
516
|
-
interface SVGAttributes extends AriaAttributes, EventHandlers<Events> {
|
|
517
|
+
export interface SVGAttributes extends AriaAttributes, EventHandlers<Events> {
|
|
517
518
|
innerHTML?: string | undefined;
|
|
518
519
|
/**
|
|
519
520
|
* SVG Styling Attributes
|
|
@@ -774,7 +775,7 @@ interface SVGAttributes extends AriaAttributes, EventHandlers<Events> {
|
|
|
774
775
|
z?: Numberish | undefined;
|
|
775
776
|
zoomAndPan?: string | undefined;
|
|
776
777
|
}
|
|
777
|
-
interface IntrinsicElementAttributes {
|
|
778
|
+
export interface IntrinsicElementAttributes {
|
|
778
779
|
a: AnchorHTMLAttributes<HTMLAnchorElement>;
|
|
779
780
|
abbr: HTMLAttributes<HTMLElement>;
|
|
780
781
|
address: HTMLAttributes<HTMLElement>;
|
|
@@ -952,7 +953,7 @@ interface IntrinsicElementAttributes {
|
|
|
952
953
|
use: SVGAttributes;
|
|
953
954
|
view: SVGAttributes;
|
|
954
955
|
}
|
|
955
|
-
interface Events<T = Element> {
|
|
956
|
+
export interface Events<T = Element> {
|
|
956
957
|
onCopy: ClipboardEventHandler<T>;
|
|
957
958
|
onCut: ClipboardEventHandler<T>;
|
|
958
959
|
onPaste: ClipboardEventHandler<T>;
|
|
@@ -1037,11 +1038,12 @@ interface Events<T = Element> {
|
|
|
1037
1038
|
onTransitionend: TransitionEventHandler<T>;
|
|
1038
1039
|
onTransitionstart: TransitionEventHandler<T>;
|
|
1039
1040
|
}
|
|
1040
|
-
type EventHandlers<E> = { [K in keyof E]?: E[K] extends ((...args: any) => any) ? E[K] : (payload: E[K]) => void };
|
|
1041
|
-
type
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1041
|
+
export type EventHandlers<E> = { [K in keyof E]?: E[K] extends ((...args: any) => any) ? E[K] : (payload: E[K]) => void; };
|
|
1042
|
+
type IntrinsicElement<K> = K extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[K] : K extends keyof SVGElementTagNameMap ? SVGElementTagNameMap[K] : Element;
|
|
1043
|
+
export type NativeElements = { [K in keyof IntrinsicElementAttributes]: IntrinsicElementAttributes[K] & Omit<ReservedProps, 'ref'> & {
|
|
1044
|
+
ref?: NodeRef<IntrinsicElement<K>>;
|
|
1045
|
+
}; };
|
|
1046
|
+
export interface BaseSyntheticEvent<E = object, C = unknown, T = unknown> {
|
|
1045
1047
|
nativeEvent: E;
|
|
1046
1048
|
currentTarget: C;
|
|
1047
1049
|
target: T;
|
|
@@ -1065,35 +1067,35 @@ interface BaseSyntheticEvent<E = object, C = unknown, T = unknown> {
|
|
|
1065
1067
|
* This might be a child element to the element on which the event listener is registered.
|
|
1066
1068
|
* If you thought this should be `EventTarget & T`, see https://github.com/DefinitelyTyped/DefinitelyTyped/issues/11508#issuecomment-256045682
|
|
1067
1069
|
*/
|
|
1068
|
-
interface SyntheticEvent<T = Element, E = Event> extends BaseSyntheticEvent<E, EventTarget & T, EventTarget> {}
|
|
1069
|
-
type EventHandler<E extends SyntheticEvent<any>> = {
|
|
1070
|
+
export interface SyntheticEvent<T = Element, E = Event> extends BaseSyntheticEvent<E, EventTarget & T, EventTarget> {}
|
|
1071
|
+
export type EventHandler<E extends SyntheticEvent<any>> = {
|
|
1070
1072
|
bivarianceHack: (event: E) => void;
|
|
1071
1073
|
}['bivarianceHack'];
|
|
1072
|
-
type BaseEventHandler<T = Element> = EventHandler<SyntheticEvent<T>>;
|
|
1073
|
-
interface ClipboardEvent<T = Element> extends SyntheticEvent<T, globalThis.ClipboardEvent> {
|
|
1074
|
+
export type BaseEventHandler<T = Element> = EventHandler<SyntheticEvent<T>>;
|
|
1075
|
+
export interface ClipboardEvent<T = Element> extends SyntheticEvent<T, globalThis.ClipboardEvent> {
|
|
1074
1076
|
clipboardData: DataTransfer;
|
|
1075
1077
|
}
|
|
1076
|
-
type ClipboardEventHandler<T = Element> = EventHandler<ClipboardEvent<T>>;
|
|
1077
|
-
interface CompositionEvent<T = Element> extends SyntheticEvent<T, globalThis.CompositionEvent> {
|
|
1078
|
+
export type ClipboardEventHandler<T = Element> = EventHandler<ClipboardEvent<T>>;
|
|
1079
|
+
export interface CompositionEvent<T = Element> extends SyntheticEvent<T, globalThis.CompositionEvent> {
|
|
1078
1080
|
data: string;
|
|
1079
1081
|
}
|
|
1080
|
-
type CompositionEventHandler<T = Element> = EventHandler<CompositionEvent<T>>;
|
|
1081
|
-
interface DragEvent<T = Element> extends MouseEvent<T, globalThis.DragEvent> {
|
|
1082
|
+
export type CompositionEventHandler<T = Element> = EventHandler<CompositionEvent<T>>;
|
|
1083
|
+
export interface DragEvent<T = Element> extends MouseEvent<T, globalThis.DragEvent> {
|
|
1082
1084
|
dataTransfer: DataTransfer;
|
|
1083
1085
|
}
|
|
1084
|
-
type DragEventHandler<T = Element> = EventHandler<DragEvent<T>>;
|
|
1085
|
-
interface FocusEvent<Target = Element, RelatedTarget = Element> extends SyntheticEvent<Target, globalThis.FocusEvent> {
|
|
1086
|
+
export type DragEventHandler<T = Element> = EventHandler<DragEvent<T>>;
|
|
1087
|
+
export interface FocusEvent<Target = Element, RelatedTarget = Element> extends SyntheticEvent<Target, globalThis.FocusEvent> {
|
|
1086
1088
|
relatedTarget: (EventTarget & RelatedTarget) | null;
|
|
1087
1089
|
target: EventTarget & Target;
|
|
1088
1090
|
}
|
|
1089
|
-
type FocusEventHandler<T = Element> = EventHandler<FocusEvent<T>>;
|
|
1090
|
-
interface FormEvent<T = Element> extends SyntheticEvent<T> {}
|
|
1091
|
-
type FormEventHandler<T = Element> = EventHandler<FormEvent<T>>;
|
|
1092
|
-
interface ChangeEvent<T = Element> extends SyntheticEvent<T> {
|
|
1091
|
+
export type FocusEventHandler<T = Element> = EventHandler<FocusEvent<T>>;
|
|
1092
|
+
export interface FormEvent<T = Element> extends SyntheticEvent<T> {}
|
|
1093
|
+
export type FormEventHandler<T = Element> = EventHandler<FormEvent<T>>;
|
|
1094
|
+
export interface ChangeEvent<T = Element> extends SyntheticEvent<T> {
|
|
1093
1095
|
target: EventTarget & T;
|
|
1094
1096
|
}
|
|
1095
|
-
type ChangeEventHandler<T = Element> = EventHandler<ChangeEvent<T>>;
|
|
1096
|
-
interface KeyboardEvent<T = Element> extends UIEvent<T, globalThis.KeyboardEvent> {
|
|
1097
|
+
export type ChangeEventHandler<T = Element> = EventHandler<ChangeEvent<T>>;
|
|
1098
|
+
export interface KeyboardEvent<T = Element> extends UIEvent<T, globalThis.KeyboardEvent> {
|
|
1097
1099
|
altKey: boolean;
|
|
1098
1100
|
/** @deprecated */
|
|
1099
1101
|
charCode: number;
|
|
@@ -1117,9 +1119,9 @@ interface KeyboardEvent<T = Element> extends UIEvent<T, globalThis.KeyboardEvent
|
|
|
1117
1119
|
/** @deprecated */
|
|
1118
1120
|
which: number;
|
|
1119
1121
|
}
|
|
1120
|
-
type KeyboardEventHandler<T = Element> = EventHandler<KeyboardEvent<T>>;
|
|
1121
|
-
type ModifierKey = 'Alt' | 'AltGraph' | 'CapsLock' | 'Control' | 'Fn' | 'FnLock' | 'Hyper' | 'Meta' | 'NumLock' | 'ScrollLock' | 'Shift' | 'Super' | 'Symbol' | 'SymbolLock';
|
|
1122
|
-
interface MouseEvent<T = Element, E = globalThis.MouseEvent> extends UIEvent<T, E> {
|
|
1122
|
+
export type KeyboardEventHandler<T = Element> = EventHandler<KeyboardEvent<T>>;
|
|
1123
|
+
export type ModifierKey = 'Alt' | 'AltGraph' | 'CapsLock' | 'Control' | 'Fn' | 'FnLock' | 'Hyper' | 'Meta' | 'NumLock' | 'ScrollLock' | 'Shift' | 'Super' | 'Symbol' | 'SymbolLock';
|
|
1124
|
+
export interface MouseEvent<T = Element, E = globalThis.MouseEvent> extends UIEvent<T, E> {
|
|
1123
1125
|
altKey: boolean;
|
|
1124
1126
|
button: number;
|
|
1125
1127
|
buttons: number;
|
|
@@ -1140,34 +1142,33 @@ interface MouseEvent<T = Element, E = globalThis.MouseEvent> extends UIEvent<T,
|
|
|
1140
1142
|
screenY: number;
|
|
1141
1143
|
shiftKey: boolean;
|
|
1142
1144
|
}
|
|
1143
|
-
type MouseEventHandler<T = Element> = EventHandler<MouseEvent<T>>;
|
|
1144
|
-
interface AbstractView {
|
|
1145
|
+
export type MouseEventHandler<T = Element> = EventHandler<MouseEvent<T>>;
|
|
1146
|
+
export interface AbstractView {
|
|
1145
1147
|
styleMedia: StyleMedia;
|
|
1146
1148
|
document: Document;
|
|
1147
1149
|
}
|
|
1148
|
-
interface UIEvent<T = Element, E = globalThis.UIEvent> extends SyntheticEvent<T, E> {
|
|
1150
|
+
export interface UIEvent<T = Element, E = globalThis.UIEvent> extends SyntheticEvent<T, E> {
|
|
1149
1151
|
detail: number;
|
|
1150
1152
|
view: AbstractView;
|
|
1151
1153
|
}
|
|
1152
|
-
type UIEventHandler<T = Element> = EventHandler<UIEvent<T>>;
|
|
1153
|
-
interface WheelEvent<T = Element> extends MouseEvent<T, globalThis.WheelEvent> {
|
|
1154
|
+
export type UIEventHandler<T = Element> = EventHandler<UIEvent<T>>;
|
|
1155
|
+
export interface WheelEvent<T = Element> extends MouseEvent<T, globalThis.WheelEvent> {
|
|
1154
1156
|
deltaMode: number;
|
|
1155
1157
|
deltaX: number;
|
|
1156
1158
|
deltaY: number;
|
|
1157
1159
|
deltaZ: number;
|
|
1158
1160
|
}
|
|
1159
|
-
type WheelEventHandler<T = Element> = EventHandler<WheelEvent<T>>;
|
|
1160
|
-
interface AnimationEvent<T = Element> extends SyntheticEvent<T, globalThis.AnimationEvent> {
|
|
1161
|
+
export type WheelEventHandler<T = Element> = EventHandler<WheelEvent<T>>;
|
|
1162
|
+
export interface AnimationEvent<T = Element> extends SyntheticEvent<T, globalThis.AnimationEvent> {
|
|
1161
1163
|
animationName: string;
|
|
1162
1164
|
elapsedTime: number;
|
|
1163
1165
|
pseudoElement: string;
|
|
1164
1166
|
}
|
|
1165
|
-
type AnimationEventHandler<T = Element> = EventHandler<AnimationEvent<T>>;
|
|
1166
|
-
interface TransitionEvent<T = Element> extends SyntheticEvent<T, globalThis.TransitionEvent> {
|
|
1167
|
+
export type AnimationEventHandler<T = Element> = EventHandler<AnimationEvent<T>>;
|
|
1168
|
+
export interface TransitionEvent<T = Element> extends SyntheticEvent<T, globalThis.TransitionEvent> {
|
|
1167
1169
|
elapsedTime: number;
|
|
1168
1170
|
propertyName: string;
|
|
1169
1171
|
pseudoElement: string;
|
|
1170
1172
|
}
|
|
1171
|
-
type TransitionEventHandler<T = Element> = EventHandler<TransitionEvent<T>>;
|
|
1172
|
-
//#endregion
|
|
1173
|
-
export { 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 };
|
|
1173
|
+
export type TransitionEventHandler<T = Element> = EventHandler<TransitionEvent<T>>;
|
|
1174
|
+
//#endregion
|
package/dist/props.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import * as _$vue from "vue";
|
|
2
|
-
|
|
3
1
|
//#region src/props.d.ts
|
|
4
|
-
declare function getCurrentInstance():
|
|
2
|
+
export declare function getCurrentInstance(): import('vue').GenericComponentInstance | null;
|
|
5
3
|
/**
|
|
6
4
|
* Returns the props of the current component instance.
|
|
7
5
|
*
|
|
@@ -14,7 +12,7 @@ declare function getCurrentInstance(): _$vue.GenericComponentInstance | null;
|
|
|
14
12
|
* })
|
|
15
13
|
* ```
|
|
16
14
|
*/
|
|
17
|
-
declare function useProps(): {
|
|
15
|
+
export declare function useProps(): {
|
|
18
16
|
[x: string]: unknown;
|
|
19
17
|
};
|
|
20
18
|
/**
|
|
@@ -29,6 +27,5 @@ declare function useProps(): {
|
|
|
29
27
|
* const fullProps = useFullProps() // = useAttrs() + useProps()
|
|
30
28
|
* })
|
|
31
29
|
*/
|
|
32
|
-
declare function useFullProps(): {};
|
|
33
|
-
//#endregion
|
|
34
|
-
export { getCurrentInstance, useFullProps, useProps };
|
|
30
|
+
export declare function useFullProps(): {};
|
|
31
|
+
//#endregion
|
package/dist/props.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Vue from "vue";
|
|
2
2
|
import { computed, useAttrs } from "vue";
|
|
3
3
|
//#region src/props.ts
|
|
4
|
-
|
|
4
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
5
5
|
function getCurrentInstance() {
|
|
6
6
|
return Vue.currentInstance || Vue.getCurrentInstance();
|
|
7
7
|
}
|
|
@@ -17,7 +17,7 @@ function getCurrentInstance() {
|
|
|
17
17
|
* })
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
21
21
|
function useProps() {
|
|
22
22
|
return (/* @__PURE__ */ getCurrentInstance()).props;
|
|
23
23
|
}
|
|
@@ -33,7 +33,7 @@ function useProps() {
|
|
|
33
33
|
* const fullProps = useFullProps() // = useAttrs() + useProps()
|
|
34
34
|
* })
|
|
35
35
|
*/
|
|
36
|
-
|
|
36
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
37
37
|
function useFullProps() {
|
|
38
38
|
const attrs = useAttrs();
|
|
39
39
|
if (!(/* @__PURE__ */ getCurrentInstance()).type.props) return attrs;
|
package/dist/raw.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
//#region src/raw.d.ts
|
|
2
|
-
declare const propsHelperCode: string;
|
|
3
|
-
declare const vdomHelperCode: string;
|
|
4
|
-
declare const vaporHelperCode: string;
|
|
5
|
-
declare const ssrHelperCode: string;
|
|
6
|
-
declare const propsHelperId = "/vue-jsx
|
|
7
|
-
declare const vdomHelperId = "/vue-jsx
|
|
8
|
-
declare const vaporHelperId = "/vue-jsx
|
|
9
|
-
declare const ssrHelperId = "/vue-jsx
|
|
10
|
-
//#endregion
|
|
11
|
-
export { propsHelperCode, propsHelperId, ssrHelperCode, ssrHelperId, vaporHelperCode, vaporHelperId, vdomHelperCode, vdomHelperId };
|
|
2
|
+
export declare const propsHelperCode: string;
|
|
3
|
+
export declare const vdomHelperCode: string;
|
|
4
|
+
export declare const vaporHelperCode: string;
|
|
5
|
+
export declare const ssrHelperCode: string;
|
|
6
|
+
export declare const propsHelperId = "/vue-jsx/props";
|
|
7
|
+
export declare const vdomHelperId = "/vue-jsx/vdom";
|
|
8
|
+
export declare const vaporHelperId = "/vue-jsx/vapor";
|
|
9
|
+
export declare const ssrHelperId = "/vue-jsx/ssr";
|
|
10
|
+
//#endregion
|
package/dist/raw.js
CHANGED
|
@@ -5,7 +5,7 @@ var props_default = "import { computed, useAttrs } from \"vue\";\nimport * as Vu
|
|
|
5
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";
|
|
6
6
|
//#endregion
|
|
7
7
|
//#region src/vapor.ts?raw
|
|
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 === \"function\" ? 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
|
|
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 === \"function\" ? 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 const result = Reflect.get(target, p, receiver);\n if (p === \"__vapor\" && result === void 0 && i && i.appContext.vapor) {\n return true;\n }\n return result;\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}\nexport function normalizeVaporSlots(slots) {\n if (typeof slots === \"function\") {\n return { name: \"default\", fn: slots };\n } else if (Object.prototype.toString.call(slots) === \"[object Object]\" && !isBlock(slots)) {\n return Object.entries(slots).map(([name, fn]) => ({ name, fn }));\n } else {\n return {\n name: \"default\",\n fn: () => createNodes(slots)\n };\n }\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 = (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};\nVaporFor.__vapor = true;\n";
|
|
9
9
|
//#endregion
|
|
10
10
|
//#region src/vdom.ts?raw
|
|
11
11
|
var vdom_default = "import {\n defineComponent as __defineComponent,\n normalizeClass as _normalizeClass,\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 normalizeSlots = (slots) => {\n return typeof slots === \"function\" || Object.prototype.toString.call(slots) === \"[object Object]\" && !isVNode(slots) ? slots : {\n default: withCtx(() => [normalizeVNode(() => slots)])\n };\n};\nexport const normalizeClass = (value) => _normalizeClass(value) || null;\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";
|
|
@@ -15,9 +15,9 @@ const propsHelperCode = props_default;
|
|
|
15
15
|
const vdomHelperCode = vdom_default;
|
|
16
16
|
const vaporHelperCode = vapor_default;
|
|
17
17
|
const ssrHelperCode = ssr_default;
|
|
18
|
-
const propsHelperId = "/vue-jsx
|
|
19
|
-
const vdomHelperId = "/vue-jsx
|
|
20
|
-
const vaporHelperId = "/vue-jsx
|
|
21
|
-
const ssrHelperId = "/vue-jsx
|
|
18
|
+
const propsHelperId = "/vue-jsx/props";
|
|
19
|
+
const vdomHelperId = "/vue-jsx/vdom";
|
|
20
|
+
const vaporHelperId = "/vue-jsx/vapor";
|
|
21
|
+
const ssrHelperId = "/vue-jsx/ssr";
|
|
22
22
|
//#endregion
|
|
23
23
|
export { propsHelperCode, propsHelperId, ssrHelperCode, ssrHelperId, vaporHelperCode, vaporHelperId, vdomHelperCode, vdomHelperId };
|
package/dist/ssr.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { ComponentOptions } from "vue";
|
|
2
|
-
|
|
3
2
|
//#region src/ssr.d.ts
|
|
4
|
-
declare function ssrRegisterHelper(comp: ComponentOptions, filename: string): void;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { ssrRegisterHelper };
|
|
3
|
+
export declare function ssrRegisterHelper(comp: ComponentOptions, filename: string): void;
|
|
4
|
+
//#endregion
|
package/dist/types.d.ts
CHANGED
|
@@ -1,34 +1,31 @@
|
|
|
1
1
|
import { Directive, EmitsOptions, EmitsToProps, Ref, SetupContext, SlotsType, VNode, VaporComponentInstance } from "vue";
|
|
2
|
-
|
|
3
2
|
//#region src/types.d.ts
|
|
3
|
+
type VaporBlock = VaporComponentInstance extends {
|
|
4
|
+
block: infer B;
|
|
5
|
+
} ? B : never;
|
|
4
6
|
declare module 'vue' {
|
|
5
|
-
interface VaporComponentInstance {
|
|
6
|
-
block: never;
|
|
7
|
-
}
|
|
7
|
+
interface VaporComponentInstance {}
|
|
8
8
|
interface RenderResultExtensions {
|
|
9
9
|
render: RenderResult;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
type RenderResult<T =
|
|
13
|
-
type
|
|
14
|
-
type IfAny<T, Y, N> = 0 extends 1 & T ? Y : N;
|
|
15
|
-
type IsKeyValues<T, K = string> = IfAny<T, false, T extends object ? (keyof T extends K ? true : false) : false>;
|
|
16
|
-
type DirectiveArgs<T extends Directive> = T extends Directive<any, infer Value, infer Modifiers, infer Argument> ? Value | [Value] | [Value, Argument] | [Value, Array<Modifiers>] | [Value, Argument, Array<Modifiers>] : unknown;
|
|
12
|
+
export type RenderResult<T = VaporBlock> = T | VNode | RenderResult[];
|
|
13
|
+
export type DirectiveArgs<T extends Directive> = T extends Directive<any, infer Value, infer Modifiers, infer Argument> ? Value | [Value] | [Value, Argument] | [Value, Array<Modifiers>] | [Value, Argument, Array<Modifiers>] : unknown;
|
|
17
14
|
type NodeChildAtom<T> = T | VNode | string | number | boolean | null | undefined | void;
|
|
18
|
-
type NodeArrayChildren<T> = Array<NodeArrayChildren<T> | NodeChildAtom<T>>;
|
|
19
|
-
type NodeChild<T =
|
|
20
|
-
type NodeRef<T> = ((ref: T | null, refs: Record<string, any>) => void) | Ref | string;
|
|
21
|
-
type ResolveSlots<Slots> = { readonly [Key in keyof Slots]?: Slots[Key] extends ((...args: infer Args) => VNode | VNode[]) ? (...args: Args) => NodeChild : Slots[Key] };
|
|
22
|
-
type SlotsToProps<RawSlots extends SlotsType | Record<string, any> = Record<string, any>, Slots = ResolveSlots<RawSlots extends SlotsType ? SetupContext<EmitsOptions, RawSlots>['slots'] : RawSlots>> = string extends keyof Slots ? {} : [keyof Slots] extends [never] ? {} : {
|
|
15
|
+
export type NodeArrayChildren<T> = Array<NodeArrayChildren<T> | NodeChildAtom<T>>;
|
|
16
|
+
export type NodeChild<T = VaporBlock> = NodeChildAtom<T> | NodeArrayChildren<T>;
|
|
17
|
+
export type NodeRef<T> = ((ref: T | null, refs: Record<string, any>) => void) | Ref | string;
|
|
18
|
+
type ResolveSlots<Slots> = { readonly [Key in keyof Slots]?: Slots[Key] extends ((...args: infer Args) => VNode | VNode[]) ? (...args: Args) => NodeChild : Slots[Key]; };
|
|
19
|
+
export type SlotsToProps<RawSlots extends SlotsType | Record<string, any> = Record<string, any>, Slots = ResolveSlots<RawSlots extends SlotsType ? SetupContext<EmitsOptions, RawSlots>['slots'] : RawSlots>> = string extends keyof Slots ? {} : [keyof Slots] extends [never] ? {} : {
|
|
23
20
|
readonly 'v-slots'?: ('default' extends keyof Slots ? Slots['default'] | Slots : Slots) | NoInfer<NodeChild>;
|
|
24
21
|
};
|
|
25
22
|
declare const exposedType: unique symbol;
|
|
26
|
-
type ExtractExposed<Props, Default = never> = typeof exposedType extends keyof Props ? Exclude<Props[typeof exposedType], undefined> : Default;
|
|
27
|
-
type ExposedToProps<T extends Record<string, any>> = string extends keyof T ? {} : [keyof T] extends [never] ? {} : {
|
|
23
|
+
export type ExtractExposed<Props, Default = never> = typeof exposedType extends keyof Props ? Exclude<Props[typeof exposedType], undefined> : Default;
|
|
24
|
+
export type ExposedToProps<T extends Record<string, any>> = string extends keyof T ? {} : [keyof T] extends [never] ? {} : {
|
|
28
25
|
readonly [exposedType]?: T;
|
|
29
26
|
readonly ref?: NodeRef<T>;
|
|
30
27
|
};
|
|
31
|
-
type EmitFnToProps<T, ExcludeKeys extends PropertyKey = ''> = T extends ((event: infer Event extends string, ...args: infer Args) => any) ? string extends Event ? {} : { readonly [K in Event as `on${Capitalize<K>}` extends ExcludeKeys ? never : `on${Capitalize<K>}`]?: (...args: Args) => any } : {};
|
|
32
|
-
type
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
export type EmitFnToProps<T, ExcludeKeys extends PropertyKey = ''> = T extends ((event: infer Event extends string, ...args: infer Args) => any) ? string extends Event ? {} : { readonly [K in Event as `on${Capitalize<K>}` extends ExcludeKeys ? never : `on${Capitalize<K>}`]?: (...args: Args) => any; } : {};
|
|
29
|
+
export type EmitFnToEmits<Emit> = Emit extends ((event: infer Event extends string, ...args: infer Args) => any) ? string extends Event ? {} : { [K in Event]: (...args: Args) => any; } : {};
|
|
30
|
+
export type SetupContextToProps<Emits extends EmitsOptions = {}, Slots extends SlotsType | Record<string, any> = {}, Exposed extends Record<string, any> = {}> = EmitsToProps<Emits> & SlotsToProps<Slots> & ExposedToProps<Exposed>;
|
|
31
|
+
//#endregion
|
package/dist/vapor.d.ts
CHANGED
|
@@ -1,96 +1,47 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EmitFnToEmits, ExposedToProps, NodeChild, SlotsToProps } from "./types.js";
|
|
2
2
|
import * as Vue from "vue";
|
|
3
|
-
import { Block, ComponentObjectPropsOptions, ComponentTypeEmits,
|
|
4
|
-
|
|
3
|
+
import { Block, ComponentObjectPropsOptions, ComponentTypeEmits, DefineVaporComponent, DefineVaporSetupFnComponent, EffectScope, EmitFn, EmitsOptions, ExtractPropTypes, Fragment, ShallowRef, VaporComponent, VaporComponentOptions, VaporRenderResult, VaporSlot } from "vue";
|
|
5
4
|
//#region src/vapor.d.ts
|
|
6
|
-
declare function defineVaporSSRComponent(comp: VaporComponent, extraOptions: VaporComponent): VaporComponent;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
fn: Vue.VaporSlot;
|
|
16
|
-
key?: unknown;
|
|
17
|
-
}[]) | {
|
|
18
|
-
[x: string]: Vue.VaporSlot;
|
|
19
|
-
})[] | Vue.VaporSlot> & {
|
|
20
|
-
$?: ((() => {
|
|
21
|
-
name: string;
|
|
22
|
-
fn: Vue.VaporSlot;
|
|
23
|
-
key?: unknown;
|
|
24
|
-
} | {
|
|
25
|
-
name: string;
|
|
26
|
-
fn: Vue.VaporSlot;
|
|
27
|
-
key?: unknown;
|
|
28
|
-
}[]) | {
|
|
29
|
-
[x: string]: Vue.VaporSlot;
|
|
30
|
-
})[];
|
|
31
|
-
})) | null | undefined, isSingleRoot?: boolean | undefined, once?: boolean | undefined, appContext?: Vue.GenericAppContext | undefined) => Block;
|
|
32
|
-
declare function createProxyComponent(type: VaporComponent, normalizeNode?: (node: any) => Block): any;
|
|
33
|
-
declare function normalizeNode(node: NodeChild): Block;
|
|
34
|
-
declare function isBlock(val: NonNullable<unknown>): val is Block;
|
|
35
|
-
declare function setNodes(anchor: Node, ...values: any[]): void;
|
|
36
|
-
declare function createNodes(...values: any[]): Block[];
|
|
37
|
-
declare function normalizeVaporSlots(slots: any): {
|
|
5
|
+
export declare function defineVaporSSRComponent(comp: VaporComponent, extraOptions: VaporComponent): VaporComponent;
|
|
6
|
+
type Tail<T extends any[]> = T extends [any, ...infer R] ? R : never;
|
|
7
|
+
export declare const createComponent: (type: VaporComponent | typeof Fragment | string, ...args: Tail<Parameters<typeof Vue.createComponentWithFallback>>) => Block;
|
|
8
|
+
export declare function createProxyComponent(type: VaporComponent, normalizeNode?: (node: any) => Block): any;
|
|
9
|
+
export declare function normalizeNode(node: NodeChild): Block;
|
|
10
|
+
export declare function isBlock(val: NonNullable<unknown>): val is Block;
|
|
11
|
+
export declare function setNodes(anchor: Node, ...values: any[]): void;
|
|
12
|
+
export declare function createNodes(...values: any[]): Block[];
|
|
13
|
+
export declare function normalizeVaporSlots(slots: any): {
|
|
38
14
|
name: string;
|
|
39
15
|
fn: unknown;
|
|
40
16
|
}[] | {
|
|
41
17
|
name: string;
|
|
42
18
|
fn: any;
|
|
43
19
|
};
|
|
44
|
-
type
|
|
45
|
-
|
|
46
|
-
__isTeleport?: never;
|
|
47
|
-
__isSuspense?: never;
|
|
48
|
-
new (...args: any[]): T;
|
|
49
|
-
};
|
|
50
|
-
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 Record<string, any> = Record<string, any>, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block, TypeRefs extends Record<string, unknown> = {}, MakeDefaultsOptional extends boolean = true, PublicProps = VaporPublicProps, ResolvedProps = Readonly<InferredProps> & EmitsToProps<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, Emits, Slots, Exposed, TypeBlock, TypeRefs>> & VaporComponentOptions<RuntimePropsOptions | RuntimePropsKeys[], Emits, RuntimeEmitsKeys, Slots, Exposed>;
|
|
51
|
-
type DefineVaporSetupFnComponent<Props extends Record<string, any> = {}, Emits extends EmitsOptions = {}, Slots extends Record<string, any> = Record<string, any>, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block, ResolvedProps extends Record<string, any> = Readonly<Props & VaporPublicProps> & SetupContextToProps<Emits, Slots, Exposed>> = new () => VaporComponentInstance<ResolvedProps, Emits, Slots, Exposed, TypeBlock>;
|
|
52
|
-
declare function defineVaporComponent<Props extends Record<string, any>, Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends Record<string, any> = Record<string, any>, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block, Emit = EmitFn<Emits>>(setup: (this: void, props: Props, ctx: {
|
|
20
|
+
type SlotsType$1 = Record<string, VaporSlot>;
|
|
21
|
+
export declare function defineVaporComponent<Props extends Record<string, any>, Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends SlotsType$1 = SlotsType$1, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block, Emit = EmitFn<Emits>>(setup: (this: void, props: Props, ctx: {
|
|
53
22
|
emit: Emit;
|
|
54
23
|
slots: Slots;
|
|
55
24
|
attrs: Record<string, any>;
|
|
56
25
|
expose: (exposed?: Exposed) => void;
|
|
57
|
-
}) => VaporRenderResult<TypeBlock> | void, extraOptions?: VaporComponentOptions<(keyof NoInfer<Props>)[], Emits, RuntimeEmitsKeys, Slots, Exposed> & ThisType<void>): DefineVaporSetupFnComponent<Props &
|
|
58
|
-
declare function defineVaporComponent<Props extends Record<string, any>, Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends
|
|
26
|
+
}) => VaporRenderResult<TypeBlock> | void, extraOptions?: VaporComponentOptions<(keyof NoInfer<Props>)[], Emits, RuntimeEmitsKeys, Slots, Exposed> & ThisType<void>): DefineVaporSetupFnComponent<Props & ExposedToProps<Exposed> & SlotsToProps<Slots>, [keyof Emits] extends [never] ? EmitFnToEmits<Emit> : Emits, Slots, Exposed, TypeBlock>;
|
|
27
|
+
export declare function defineVaporComponent<Props extends Record<string, any>, Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends SlotsType$1 = SlotsType$1, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block, Emit = EmitFn<Emits>>(this: void, setup: (props: Props, ctx: {
|
|
59
28
|
emit: Emit;
|
|
60
29
|
slots: Slots;
|
|
61
30
|
attrs: Record<string, any>;
|
|
62
31
|
expose: (exposed?: Exposed) => void;
|
|
63
|
-
}) => VaporRenderResult<TypeBlock> | void, extraOptions?: VaporComponentOptions<ComponentObjectPropsOptions<Props>, Emits, RuntimeEmitsKeys, Slots, Exposed> & ThisType<void>): DefineVaporSetupFnComponent<Props &
|
|
64
|
-
declare function defineVaporComponent<TypeProps, RuntimePropsOptions extends ComponentObjectPropsOptions = ComponentObjectPropsOptions, RuntimePropsKeys extends string = string, TypeEmits extends ComponentTypeEmits = {}, RuntimeEmitsOptions extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends
|
|
32
|
+
}) => VaporRenderResult<TypeBlock> | void, extraOptions?: VaporComponentOptions<ComponentObjectPropsOptions<Props>, Emits, RuntimeEmitsKeys, Slots, Exposed> & ThisType<void>): DefineVaporSetupFnComponent<Props & SlotsToProps<Slots> & ExposedToProps<Exposed>, [keyof Emits] extends [never] ? EmitFnToEmits<Emit> : Emits, Slots, Exposed, TypeBlock>;
|
|
33
|
+
export declare function defineVaporComponent<TypeProps, RuntimePropsOptions extends ComponentObjectPropsOptions = ComponentObjectPropsOptions, RuntimePropsKeys extends string = string, TypeEmits extends ComponentTypeEmits = {}, RuntimeEmitsOptions extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends SlotsType$1 = SlotsType$1, Exposed extends Record<string, any> = Record<string, any>, ResolvedEmits extends EmitsOptions = {} extends RuntimeEmitsOptions ? EmitFnToEmits<EmitFn<TypeEmits>> : RuntimeEmitsOptions, InferredProps = unknown extends TypeProps ? string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : { [key in RuntimePropsKeys]?: any; } : TypeProps, TypeRefs extends Record<string, unknown> = {}, TypeBlock extends Block = Block>(options: VaporComponentOptions<RuntimePropsOptions | RuntimePropsKeys[], ResolvedEmits, RuntimeEmitsKeys, Slots, Exposed, TypeBlock, InferredProps> & {
|
|
65
34
|
[key: string]: any;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
* @private
|
|
72
|
-
*/
|
|
73
|
-
__typeEmits?: TypeEmits;
|
|
74
|
-
/**
|
|
75
|
-
* @private
|
|
76
|
-
*/
|
|
77
|
-
__typeRefs?: TypeRefs;
|
|
78
|
-
/**
|
|
79
|
-
* @private
|
|
80
|
-
*/
|
|
81
|
-
__typeEl?: TypeBlock;
|
|
82
|
-
} & ThisType<void>): DefineVaporComponent<RuntimePropsOptions, RuntimePropsKeys, InferredProps, ResolvedEmits, RuntimeEmitsKeys, Slots, Block extends Exposed ? Record<string, any> : Exposed, TypeBlock, TypeRefs, unknown extends TypeProps ? true : false>;
|
|
83
|
-
type ResolveItem<Item, GetKey> = GetKey extends undefined ? Item : ShallowRef<Item>;
|
|
84
|
-
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>), GetKeyDefault = (...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => any, GetKey extends GetKeyDefault | null | undefined = undefined>() => VaporComponentInstance<Readonly<{
|
|
35
|
+
} & ThisType<void>): DefineVaporComponent<RuntimePropsOptions, RuntimePropsKeys, InferredProps, ResolvedEmits, RuntimeEmitsKeys, Slots, Exposed extends VaporRenderResult ? Record<string, any> : Exposed, TypeBlock, TypeRefs, unknown extends TypeProps ? true : false>;
|
|
36
|
+
type VaporForSlots<T, Item, GetKey> = {
|
|
37
|
+
default: (...args: string extends keyof Item ? [item: GetKey extends undefined ? T[keyof T] : ShallowRef<T[keyof T]>, key: ShallowRef<keyof T>, index: ShallowRef<number>] : [item: GetKey extends undefined ? Item : ShallowRef<Item>, index: ShallowRef<number>]) => any;
|
|
38
|
+
};
|
|
39
|
+
export declare function VaporFor<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>, GetKeyDefault = (...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => any, GetKey extends GetKeyDefault | null | undefined = undefined>(props: {
|
|
85
40
|
in: T;
|
|
86
41
|
getKey?: GetKey extends undefined ? GetKeyDefault : GetKey;
|
|
87
|
-
} &
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
} | ((...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>]) => NodeChild) | NoInfer<NodeChild<Block>> | undefined;
|
|
91
|
-
}, {}, {
|
|
92
|
-
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;
|
|
93
|
-
}, Record<string, any>, {
|
|
42
|
+
} & SlotsToProps<VaporForSlots<T, Item, GetKey>>, { slots }: {
|
|
43
|
+
slots: VaporForSlots<T, Item, GetKey>;
|
|
44
|
+
}): {
|
|
94
45
|
resetListeners?: (() => void)[];
|
|
95
46
|
onReset(fn: () => void): void;
|
|
96
47
|
$key?: any;
|
|
@@ -99,13 +50,18 @@ declare const VaporFor: new <T extends any[] | Record<any, any> | number | strin
|
|
|
99
50
|
vnode?: Vue.VNode | null;
|
|
100
51
|
anchor?: Node;
|
|
101
52
|
isBlockValid?: (componentAsValid?: boolean) => boolean;
|
|
102
|
-
insert
|
|
103
|
-
|
|
53
|
+
insert?(parent: ParentNode, anchor: Node | null, parentSuspense?: Vue.SuspenseBoundary | null, transitionHooks?: Vue.TransitionHooks): void;
|
|
54
|
+
move?(parent: ParentNode, anchor: Node | null, moveType: Vue.MoveType, parentComponent?: Vue.VaporComponentInstance, parentSuspense?: Vue.SuspenseBoundary | null, transitionHooks?: Vue.TransitionHooks): void;
|
|
55
|
+
remove?(parent?: ParentNode, transitionHooks?: Vue.TransitionHooks): void;
|
|
104
56
|
hydrate?(...args: any[]): void;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
57
|
+
scope?: EffectScope;
|
|
58
|
+
setRef?: (instance: Vue.VaporComponentInstance, ref: string | Vue.Ref<any, any> | ((ref: Element | Vue.VaporComponentInstance, refs: Record<string, any>) => void), refFor: boolean, refKey: string | undefined) => void;
|
|
59
|
+
bm?: ((nodes: Block) => void)[];
|
|
60
|
+
bum?: (() => void)[];
|
|
61
|
+
bu?: (() => void)[];
|
|
62
|
+
u?: ((nodes?: Block) => void)[];
|
|
63
|
+
};
|
|
64
|
+
export declare namespace VaporFor {
|
|
65
|
+
var __vapor: boolean;
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
package/dist/vapor.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Vue from "vue";
|
|
2
2
|
import { EffectScope, Fragment, getCurrentInstance } from "vue";
|
|
3
3
|
//#region src/vapor.ts
|
|
4
|
-
|
|
4
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
5
5
|
function defineVaporSSRComponent(comp, extraOptions) {
|
|
6
6
|
if (typeof comp === "function") return Object.assign({ name: comp.name }, extraOptions, {
|
|
7
7
|
setup(props, ctx) {
|
|
@@ -38,8 +38,9 @@ function createProxyComponent(type, normalizeNode) {
|
|
|
38
38
|
return normalizeNode ? normalizeNode(node) : node;
|
|
39
39
|
},
|
|
40
40
|
get(target, p, receiver) {
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
const result = Reflect.get(target, p, receiver);
|
|
42
|
+
if (p === "__vapor" && result === void 0 && i && i.appContext.vapor) return true;
|
|
43
|
+
return result;
|
|
43
44
|
}
|
|
44
45
|
});
|
|
45
46
|
proxyCache.set(type, proxy);
|
|
@@ -136,7 +137,7 @@ function normalizeVaporSlots(slots) {
|
|
|
136
137
|
fn: () => createNodes(slots)
|
|
137
138
|
};
|
|
138
139
|
}
|
|
139
|
-
|
|
140
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
140
141
|
function defineVaporComponent(comp, extraOptions) {
|
|
141
142
|
if (typeof comp === "function") return Object.assign({ name: comp.name }, extraOptions, {
|
|
142
143
|
setup: comp,
|
|
@@ -145,10 +146,11 @@ function defineVaporComponent(comp, extraOptions) {
|
|
|
145
146
|
comp.__vapor = true;
|
|
146
147
|
return comp;
|
|
147
148
|
}
|
|
148
|
-
const VaporFor =
|
|
149
|
+
const VaporFor = (props, { slots }) => {
|
|
149
150
|
return Vue.createFor(() => props.in, (item, key, index) => {
|
|
150
151
|
return slots.default ? slots.default(props.getKey === void 0 ? item.value : item, key, index) : [];
|
|
151
152
|
}, props.getKey === void 0 ? (item) => item : props.getKey);
|
|
152
|
-
}
|
|
153
|
+
};
|
|
154
|
+
VaporFor.__vapor = true;
|
|
153
155
|
//#endregion
|
|
154
156
|
export { VaporFor, createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, normalizeVaporSlots, setNodes };
|
package/dist/vdom.d.ts
CHANGED
|
@@ -1,22 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
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";
|
|
4
|
-
|
|
1
|
+
import { EmitFnToEmits, NodeChild, SetupContextToProps } from "./types.js";
|
|
2
|
+
import { Component, ComponentInjectOptions, ComponentObjectPropsOptions, ComponentOptions, ComponentOptionsBase, ComponentOptionsMixin, ComponentProvideOptions, ComponentTypeEmits, ComputedOptions, CreateComponentPublicInstanceWithMixins, DefineComponent, Directive, EmitFn, EmitsOptions, EmitsToProps, ExtractDefaultPropTypes, ExtractPropTypes, MethodOptions, PublicProps, Slot, SlotsType, VNode, VNodeChild } from "vue";
|
|
5
3
|
//#region src/vdom.d.ts
|
|
6
|
-
declare function createVNodeCache(key: string): any;
|
|
7
|
-
declare function normalizeVNode(value: VNodeChild | (() => VNodeChild), flag?: number): VNode;
|
|
8
|
-
declare const normalizeSlot: (rawSlot: Function) => Slot;
|
|
9
|
-
declare const normalizeSlots: (slots: any) => Record<string, any> | Function;
|
|
10
|
-
declare const normalizeClass: (value: unknown) => string | null;
|
|
11
|
-
type RenderFunction = () =>
|
|
12
|
-
type
|
|
13
|
-
__isFragment?: never;
|
|
14
|
-
__isTeleport?: never;
|
|
15
|
-
__isSuspense?: never;
|
|
16
|
-
new (...args: any[]): T;
|
|
17
|
-
};
|
|
18
|
-
type DefineComponent<PropsOrPropOptions = {}, RawBindings = {}, D = {}, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, PP = PublicProps, Props = Readonly<PropsOrPropOptions extends ComponentPropsOptions ? ExtractPropTypes<PropsOrPropOptions> : PropsOrPropOptions> & EmitsToProps<E>, Defaults = ExtractDefaultPropTypes<PropsOrPropOptions>, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, MakeDefaultsOptional extends boolean = true, TypeRefs extends Record<string, unknown> = {}, TypeEl extends Element = any> = ComponentPublicInstanceConstructor<CreateComponentPublicInstanceWithMixins<Props, RawBindings, D, C, M, Mixin, Extends, E, PP, Defaults, MakeDefaultsOptional, {}, S, LC & GlobalComponents, Directives & GlobalDirectives, Exposed, TypeRefs, TypeEl>> & ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, {}, string, S, LC & GlobalComponents, Directives & GlobalDirectives, Exposed, Provide> & PP;
|
|
19
|
-
type DefineSetupFnComponent<P extends Record<string, any>, E extends EmitsOptions = {}, S extends SlotsType = SlotsType, Exposed extends Record<string, any> = {}, Props = Readonly<P> & SetupContextToProps<E, S, Exposed>, PP = PublicProps> = new (props: Props & PP) => CreateComponentPublicInstanceWithMixins<Props, Exposed, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, E, PP, {}, false, {}, S, {}, {}, keyof Exposed & string>;
|
|
4
|
+
export declare function createVNodeCache(key: string): any;
|
|
5
|
+
export declare function normalizeVNode(value: VNodeChild | (() => VNodeChild), flag?: number): VNode;
|
|
6
|
+
export declare const normalizeSlot: (rawSlot: Function) => Slot;
|
|
7
|
+
export declare const normalizeSlots: (slots: any) => Record<string, any> | Function;
|
|
8
|
+
export declare const normalizeClass: (value: unknown) => string | null;
|
|
9
|
+
type RenderFunction = () => NodeChild;
|
|
10
|
+
export type DefineSetupFnComponent<P extends Record<string, any>, E extends EmitsOptions = {}, S extends SlotsType = SlotsType, Exposed extends Record<string, any> = {}, Props = Readonly<P> & SetupContextToProps<E, S, Exposed>, PP = PublicProps> = new (props: Props & PP) => CreateComponentPublicInstanceWithMixins<Props, Exposed, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, E, PP, {}, false, {}, S, {}, {}, keyof Exposed & string>;
|
|
20
11
|
declare function _defineComponent<Props extends Record<string, any>, Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends SlotsType | Record<string, any> = {}, Exposed extends Record<string, any> = {}, Emit = EmitFn<Emits>>(setup: (this: void, props: Props, ctx: {
|
|
21
12
|
emit: Emit;
|
|
22
13
|
slots: Slots;
|
|
@@ -26,7 +17,7 @@ declare function _defineComponent<Props extends Record<string, any>, Emits exten
|
|
|
26
17
|
props?: (keyof NoInfer<Props>)[];
|
|
27
18
|
emits?: Emits | RuntimeEmitsKeys[];
|
|
28
19
|
slots?: Slots;
|
|
29
|
-
}): DefineSetupFnComponent<Props
|
|
20
|
+
}): DefineSetupFnComponent<Props, [keyof Emits] extends [never] ? EmitFnToEmits<Emit> : Emits, Slots extends SlotsType ? Slots : SlotsType<Slots>, Exposed>;
|
|
30
21
|
declare function _defineComponent<Props extends Record<string, any>, Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends SlotsType | Record<string, any> = {}, Exposed extends Record<string, any> = {}, Emit = EmitFn<Emits>>(setup: (this: void, props: Props, ctx: {
|
|
31
22
|
emit: Emit;
|
|
32
23
|
slots: Slots;
|
|
@@ -36,42 +27,25 @@ declare function _defineComponent<Props extends Record<string, any>, Emits exten
|
|
|
36
27
|
props?: ComponentObjectPropsOptions<Props>;
|
|
37
28
|
emits?: Emits | RuntimeEmitsKeys[];
|
|
38
29
|
slots?: Slots;
|
|
39
|
-
}): DefineSetupFnComponent<Props
|
|
40
|
-
declare function _defineComponent<TypeProps, RuntimePropsOptions extends ComponentObjectPropsOptions = ComponentObjectPropsOptions, RuntimePropsKeys extends string = string, TypeEmits extends ComponentTypeEmits = {}, RuntimeEmitsOptions extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Data = {}, SetupBindings = {}, Computed extends ComputedOptions = {}, Methods extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, InjectOptions extends ComponentInjectOptions = {}, InjectKeys extends string = string, Slots extends SlotsType = {}, LocalComponents extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, ResolvedEmits extends EmitsOptions =
|
|
30
|
+
}): DefineSetupFnComponent<Props, [keyof Emits] extends [never] ? EmitFnToEmits<Emit> : Emits, Slots extends SlotsType ? Slots : SlotsType<Slots>, Exposed>;
|
|
31
|
+
declare function _defineComponent<TypeProps, RuntimePropsOptions extends ComponentObjectPropsOptions = ComponentObjectPropsOptions, RuntimePropsKeys extends string = string, TypeEmits extends ComponentTypeEmits = {}, RuntimeEmitsOptions extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Data = {}, SetupBindings = {}, Computed extends ComputedOptions = {}, Methods extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, InjectOptions extends ComponentInjectOptions = {}, InjectKeys extends string = string, Slots extends SlotsType = {}, LocalComponents extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, ResolvedEmits extends EmitsOptions = {} extends RuntimeEmitsOptions ? EmitFnToEmits<EmitFn<TypeEmits>> : RuntimeEmitsOptions, InferredProps = Readonly<unknown extends TypeProps ? string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : { [key in RuntimePropsKeys]?: any; } : TypeProps> & EmitsToProps<ResolvedEmits>>(options: {
|
|
41
32
|
props?: (RuntimePropsOptions & ThisType<void>) | RuntimePropsKeys[];
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* @private
|
|
48
|
-
*/
|
|
49
|
-
__typeEmits?: TypeEmits;
|
|
50
|
-
/**
|
|
51
|
-
* @private
|
|
52
|
-
*/
|
|
53
|
-
__typeRefs?: TypeRefs;
|
|
54
|
-
/**
|
|
55
|
-
* @private
|
|
56
|
-
*/
|
|
57
|
-
__typeEl?: TypeEl;
|
|
58
|
-
} & ComponentOptionsBase<Readonly<InferredProps> & EmitsToProps<ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, RuntimeEmitsOptions, RuntimeEmitsKeys, {}, // Defaults
|
|
59
|
-
InjectOptions, InjectKeys, Slots, LocalComponents, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstanceWithMixins<Readonly<InferredProps> & EmitsToProps<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, Readonly<InferredProps> & EmitsToProps<ResolvedEmits>, ExtractDefaultPropTypes<RuntimePropsOptions>, Slots, LocalComponents, Directives, Exposed, Provide, unknown extends TypeProps ? true : false, TypeRefs, TypeEl>;
|
|
60
|
-
declare const defineComponent: typeof _defineComponent;
|
|
61
|
-
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: Readonly<{
|
|
33
|
+
} & ComponentOptionsBase<InferredProps, SetupBindings, Data, Computed, Methods, Mixin, Extends, RuntimeEmitsOptions, RuntimeEmitsKeys, {} // Defaults
|
|
34
|
+
, InjectOptions, InjectKeys, Slots, LocalComponents, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstanceWithMixins<InferredProps, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, {}, {}, false, InjectOptions, Slots, LocalComponents, Directives, string>>): DefineComponent<InferredProps, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, RuntimeEmitsKeys, PublicProps, InferredProps & EmitsToProps<ResolvedEmits>, ExtractDefaultPropTypes<RuntimePropsOptions>, Slots, LocalComponents, Directives, Exposed, Provide, unknown extends TypeProps ? true : false>;
|
|
35
|
+
export declare const defineComponent: typeof _defineComponent;
|
|
36
|
+
export 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: Readonly<{
|
|
62
37
|
in: T;
|
|
63
38
|
}> & {} & {
|
|
64
39
|
readonly 'v-slots'?: {
|
|
65
40
|
readonly default?: ((...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => NodeChild) | undefined;
|
|
66
|
-
} | ((...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => NodeChild) | NoInfer<NodeChild<
|
|
67
|
-
} &
|
|
41
|
+
} | ((...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => NodeChild) | NoInfer<NodeChild<import("vue").Block>> | undefined;
|
|
42
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps) => CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
68
43
|
in: T;
|
|
69
44
|
}> & {} & {
|
|
70
45
|
readonly 'v-slots'?: {
|
|
71
46
|
readonly default?: ((...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => NodeChild) | undefined;
|
|
72
|
-
} | ((...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => NodeChild) | NoInfer<NodeChild<
|
|
47
|
+
} | ((...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => NodeChild) | NoInfer<NodeChild<import("vue").Block>> | undefined;
|
|
73
48
|
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {}, false, {}, SlotsType<{
|
|
74
49
|
default: (...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => any;
|
|
75
50
|
}>, {}, {}, never>;
|
|
76
|
-
//#endregion
|
|
77
|
-
export { DefineComponent, DefineSetupFnComponent, For, createVNodeCache, defineComponent, normalizeClass, normalizeSlot, normalizeSlots, normalizeVNode };
|
|
51
|
+
//#endregion
|
package/package.json
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue-jsx/runtime",
|
|
3
|
-
"
|
|
4
|
-
"version": "3.3.0-beta.1",
|
|
3
|
+
"version": "3.3.0-rc.1",
|
|
5
4
|
"description": "Vue JSX Runtime",
|
|
6
|
-
"
|
|
5
|
+
"keywords": [
|
|
6
|
+
"jsx",
|
|
7
|
+
"runtime",
|
|
8
|
+
"vapor",
|
|
9
|
+
"vue"
|
|
10
|
+
],
|
|
7
11
|
"homepage": "https://github.com/vuejs/vue-jsx-vapor#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/vuejs/vue-jsx-vapor/issues"
|
|
14
|
+
},
|
|
15
|
+
"license": "MIT",
|
|
8
16
|
"repository": {
|
|
9
17
|
"type": "git",
|
|
10
18
|
"url": "git+https://github.com/vuejs/vue-jsx-vapor.git"
|
|
11
19
|
},
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
},
|
|
15
|
-
"keywords": [
|
|
16
|
-
"vue",
|
|
17
|
-
"jsx",
|
|
18
|
-
"vapor",
|
|
19
|
-
"runtime"
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
20
22
|
],
|
|
23
|
+
"type": "module",
|
|
24
|
+
"main": "dist/index.js",
|
|
25
|
+
"types": "dist/index.d.ts",
|
|
21
26
|
"exports": {
|
|
22
27
|
".": "./dist/index.js",
|
|
23
28
|
"./raw": "./dist/raw.js",
|
|
24
29
|
"./*": "./*"
|
|
25
30
|
},
|
|
26
|
-
"main": "dist/index.js",
|
|
27
|
-
"types": "dist/index.d.ts",
|
|
28
|
-
"files": [
|
|
29
|
-
"dist"
|
|
30
|
-
],
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"vue": "3.6.0-rc.
|
|
32
|
+
"vue": "3.6.0-rc.8"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
|
-
"build": "
|
|
36
|
-
"dev": "DEV=true
|
|
35
|
+
"build": "vp pack",
|
|
36
|
+
"dev": "DEV=true vp pack",
|
|
37
37
|
"release": "bumpp && npm publish",
|
|
38
|
-
"test": "
|
|
38
|
+
"test": "vp test"
|
|
39
39
|
}
|
|
40
40
|
}
|