@vue/runtime-vapor 3.6.0-alpha.6 → 3.6.0-alpha.7
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/runtime-vapor.d.ts +121 -40
- package/dist/runtime-vapor.esm-bundler.js +114 -102
- package/package.json +4 -4
package/dist/runtime-vapor.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { VNode, GenericComponentInstance, TransitionHooks, TransitionState, TransitionProps, Plugin, SchedulerJob, GenericAppContext, EffectScope as EffectScope$1,
|
|
2
|
-
import { Ref, EffectScope, ReactiveEffect, ShallowRef } from '@vue/reactivity';
|
|
3
|
-
import { Namespace, NormalizedStyle } from '@vue/shared';
|
|
1
|
+
import { VNode, GenericComponentInstance, TransitionHooks, TransitionState, TransitionProps, Plugin, SchedulerJob, EmitsOptions, ComponentObjectPropsOptions, ExtractPropTypes, ReservedProps, AllowedComponentProps, ComponentCustomProps, EmitsToProps, ExtractDefaultPropTypes, EmitFn, ComponentTypeEmits, TypeEmitsToOptions, GenericAppContext, EffectScope as EffectScope$1, ShallowUnwrapRef, SuspenseBoundary, LifecycleHook, NormalizedPropsOptions, ObjectEmitsOptions, ComponentInternalOptions, AsyncComponentInternalOptions, ComponentPropsOptions, CreateAppFunction, AsyncComponentLoader, AsyncComponentOptions, DirectiveModifiers, CustomElementOptions, VueElementBase } from '@vue/runtime-dom';
|
|
2
|
+
import { Ref, EffectScope, ReactiveEffect, ComputedRef, ShallowRef } from '@vue/reactivity';
|
|
3
|
+
import { Prettify, IsKeyValues, Namespace, NormalizedStyle } from '@vue/shared';
|
|
4
4
|
|
|
5
5
|
type NodeRef = string | Ref | ((ref: Element | VaporComponentInstance, refs: Record<string, any>) => void);
|
|
6
6
|
type RefEl = Element | VaporComponentInstance;
|
|
@@ -19,7 +19,7 @@ export declare class VaporFragment<T extends Block = Block> implements Transitio
|
|
|
19
19
|
remove?: (parent?: ParentNode, transitionHooks?: TransitionHooks) => void;
|
|
20
20
|
hydrate?: (...args: any[]) => void;
|
|
21
21
|
setRef?: (instance: VaporComponentInstance, ref: NodeRef, refFor: boolean, refKey: string | undefined) => void;
|
|
22
|
-
|
|
22
|
+
onUpdated?: ((nodes?: Block) => void)[];
|
|
23
23
|
constructor(nodes: T);
|
|
24
24
|
}
|
|
25
25
|
declare class ForFragment extends VaporFragment<Block[]> {
|
|
@@ -34,16 +34,17 @@ declare class DynamicFragment extends VaporFragment {
|
|
|
34
34
|
attrs?: Record<string, any>;
|
|
35
35
|
setAsyncRef?: (instance: VaporComponentInstance) => void;
|
|
36
36
|
getScope?: (key: any) => EffectScope | undefined;
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
onBeforeTeardown?: ((oldKey: any, nodes: Block, scope: EffectScope) => boolean)[];
|
|
38
|
+
onBeforeMount?: ((newKey: any, nodes: Block, scope: EffectScope) => void)[];
|
|
39
|
+
slotOwner: VaporComponentInstance | null;
|
|
39
40
|
constructor(anchorLabel?: string);
|
|
40
41
|
update(render?: BlockFn, key?: any): void;
|
|
41
|
-
|
|
42
|
+
renderBranch(render: BlockFn | undefined, transition: VaporTransitionHooks | undefined, parent: ParentNode | null, instance: GenericComponentInstance | null): void;
|
|
42
43
|
hydrate: (isEmpty?: boolean) => void;
|
|
43
44
|
}
|
|
44
45
|
export declare function isFragment(val: NonNullable<unknown>): val is VaporFragment;
|
|
45
46
|
|
|
46
|
-
interface VaporTransitionHooks extends TransitionHooks {
|
|
47
|
+
export interface VaporTransitionHooks extends TransitionHooks {
|
|
47
48
|
state: TransitionState;
|
|
48
49
|
props: TransitionProps;
|
|
49
50
|
instance: VaporComponentInstance;
|
|
@@ -53,7 +54,7 @@ interface TransitionOptions {
|
|
|
53
54
|
$key?: any;
|
|
54
55
|
$transition?: VaporTransitionHooks;
|
|
55
56
|
}
|
|
56
|
-
type Block = Node | VaporFragment | DynamicFragment | VaporComponentInstance | Block[];
|
|
57
|
+
export type Block = Node | VaporFragment | DynamicFragment | VaporComponentInstance | Block[];
|
|
57
58
|
type BlockFn = (...args: any[]) => Block;
|
|
58
59
|
export declare function insert(block: Block, parent: ParentNode & {
|
|
59
60
|
$fc?: Node | null;
|
|
@@ -87,12 +88,14 @@ type RawSlots = Record<string, VaporSlot> & {
|
|
|
87
88
|
$?: DynamicSlotSource[];
|
|
88
89
|
};
|
|
89
90
|
type StaticSlots = Record<string, VaporSlot>;
|
|
90
|
-
type VaporSlot = BlockFn;
|
|
91
|
+
export type VaporSlot = BlockFn;
|
|
91
92
|
type DynamicSlot = {
|
|
92
93
|
name: string;
|
|
93
94
|
fn: VaporSlot;
|
|
94
95
|
};
|
|
95
|
-
type DynamicSlotFn = () => DynamicSlot | DynamicSlot[]
|
|
96
|
+
type DynamicSlotFn = (() => DynamicSlot | DynamicSlot[]) & {
|
|
97
|
+
_cache?: ComputedRef<DynamicSlot | DynamicSlot[]>;
|
|
98
|
+
};
|
|
96
99
|
type DynamicSlotSource = StaticSlots | DynamicSlotFn;
|
|
97
100
|
/**
|
|
98
101
|
* Wrap a slot function to track the slot owner.
|
|
@@ -136,19 +139,75 @@ declare class TeleportFragment extends VaporFragment {
|
|
|
136
139
|
hydrate: () => void;
|
|
137
140
|
}
|
|
138
141
|
|
|
139
|
-
type
|
|
140
|
-
type
|
|
141
|
-
type
|
|
142
|
+
export type VaporPublicProps = ReservedProps & AllowedComponentProps & ComponentCustomProps;
|
|
143
|
+
export type VaporRenderResult<T = Block> = VNode | T | VaporRenderResult<T>[];
|
|
144
|
+
type VaporComponentInstanceConstructor<T extends VaporComponentInstance> = {
|
|
145
|
+
__isFragment?: never;
|
|
146
|
+
__isTeleport?: never;
|
|
147
|
+
__isSuspense?: never;
|
|
148
|
+
new (props?: T['props']): T;
|
|
149
|
+
};
|
|
150
|
+
export type DefineVaporComponent<RuntimePropsOptions = {}, RuntimePropsKeys extends string = string, Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block, TypeRefs extends Record<string, unknown> = {}, MakeDefaultsOptional extends boolean = true, InferredProps = string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : {
|
|
151
|
+
[key in RuntimePropsKeys]?: any;
|
|
152
|
+
}, PublicProps = VaporPublicProps, ResolvedProps = 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>> & ObjectVaporComponent<RuntimePropsOptions | RuntimePropsKeys[], Emits, RuntimeEmitsKeys, Slots, Exposed>;
|
|
153
|
+
type DefineVaporSetupFnComponent<Props extends Record<string, any> = {}, Emits extends EmitsOptions = {}, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block, ResolvedProps extends Record<string, any> = Props & EmitsToProps<Emits> & VaporPublicProps> = new (props?: ResolvedProps) => VaporComponentInstance<ResolvedProps, Emits, Slots, Exposed, TypeBlock>;
|
|
154
|
+
export declare function defineVaporComponent<Props extends Record<string, any>, Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block>(setup: (props: Props, ctx: {
|
|
155
|
+
emit: EmitFn<Emits>;
|
|
156
|
+
slots: Slots;
|
|
157
|
+
attrs: Record<string, any>;
|
|
158
|
+
expose: (exposed: Exposed) => void;
|
|
159
|
+
}) => VaporRenderResult<TypeBlock> | void, extraOptions?: ObjectVaporComponent<(keyof Props)[], Emits, RuntimeEmitsKeys, Slots, Exposed> & ThisType<void>): DefineVaporSetupFnComponent<Props, Emits, Slots, Exposed, TypeBlock>;
|
|
160
|
+
export declare function defineVaporComponent<Props extends Record<string, any>, Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block>(setup: (props: Props, ctx: {
|
|
161
|
+
emit: EmitFn<Emits>;
|
|
162
|
+
slots: Slots;
|
|
163
|
+
attrs: Record<string, any>;
|
|
164
|
+
expose: (exposed: Exposed) => void;
|
|
165
|
+
}) => VaporRenderResult<TypeBlock> | void, extraOptions?: ObjectVaporComponent<ComponentObjectPropsOptions<Props>, Emits, RuntimeEmitsKeys, Slots, Exposed> & ThisType<void>): DefineVaporSetupFnComponent<Props, Emits, Slots, Exposed, TypeBlock>;
|
|
166
|
+
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 StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, ResolvedEmits extends EmitsOptions = {} extends RuntimeEmitsOptions ? TypeEmitsToOptions<TypeEmits> : RuntimeEmitsOptions, InferredProps = IsKeyValues<TypeProps> extends true ? TypeProps : string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : {
|
|
167
|
+
[key in RuntimePropsKeys]?: any;
|
|
168
|
+
}, TypeRefs extends Record<string, unknown> = {}, TypeBlock extends Block = Block>(options: ObjectVaporComponent<RuntimePropsOptions | RuntimePropsKeys[], ResolvedEmits, RuntimeEmitsKeys, Slots, Exposed, TypeBlock, InferredProps> & {
|
|
169
|
+
/**
|
|
170
|
+
* @private for language-tools use only
|
|
171
|
+
*/
|
|
172
|
+
__typeProps?: TypeProps;
|
|
173
|
+
/**
|
|
174
|
+
* @private for language-tools use only
|
|
175
|
+
*/
|
|
176
|
+
__typeEmits?: TypeEmits;
|
|
177
|
+
/**
|
|
178
|
+
* @private for language-tools use only
|
|
179
|
+
*/
|
|
180
|
+
__typeRefs?: TypeRefs;
|
|
181
|
+
/**
|
|
182
|
+
* @private for language-tools use only
|
|
183
|
+
*/
|
|
184
|
+
__typeEl?: TypeBlock;
|
|
185
|
+
} & ThisType<void>): DefineVaporComponent<RuntimePropsOptions, RuntimePropsKeys, ResolvedEmits, RuntimeEmitsKeys, Slots, Exposed extends Block ? Record<string, any> : Exposed, TypeBlock, TypeRefs, unknown extends TypeProps ? true : false, InferredProps>;
|
|
186
|
+
|
|
187
|
+
export type VaporComponent = FunctionalVaporComponent | ObjectVaporComponent | DefineVaporComponent;
|
|
188
|
+
export type FunctionalVaporComponent<Props = {}, Emits extends EmitsOptions = {}, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>> = ((props: Readonly<Props & EmitsToProps<Emits>>, ctx: {
|
|
189
|
+
emit: EmitFn<Emits>;
|
|
190
|
+
slots: Slots;
|
|
191
|
+
attrs: Record<string, any>;
|
|
192
|
+
expose: <T extends Record<string, any> = Exposed>(exposed: T) => void;
|
|
193
|
+
}) => VaporRenderResult) & Omit<ObjectVaporComponent<ComponentPropsOptions<Props>, Emits, string, Slots>, 'setup'> & {
|
|
142
194
|
displayName?: string;
|
|
143
195
|
} & SharedInternalOptions;
|
|
144
|
-
interface ObjectVaporComponent extends ComponentInternalOptions, AsyncComponentInternalOptions<ObjectVaporComponent, VaporComponentInstance>, SharedInternalOptions {
|
|
145
|
-
setup?: VaporSetupFn;
|
|
196
|
+
interface ObjectVaporComponent<Props = {}, Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block, InferredProps = ComponentObjectPropsOptions extends Props ? {} : ExtractPropTypes<Props>> extends ComponentInternalOptions, AsyncComponentInternalOptions<ObjectVaporComponent, VaporComponentInstance>, SharedInternalOptions {
|
|
146
197
|
inheritAttrs?: boolean;
|
|
147
|
-
props?:
|
|
148
|
-
emits?:
|
|
149
|
-
|
|
198
|
+
props?: Props;
|
|
199
|
+
emits?: Emits | RuntimeEmitsKeys[];
|
|
200
|
+
slots?: Slots;
|
|
201
|
+
setup?: (props: Readonly<InferredProps>, ctx: {
|
|
202
|
+
emit: EmitFn<Emits>;
|
|
203
|
+
slots: Slots;
|
|
204
|
+
attrs: Record<string, any>;
|
|
205
|
+
expose: <T extends Record<string, any> = Exposed>(exposed: T) => void;
|
|
206
|
+
}) => TypeBlock | Exposed | Promise<Exposed> | void;
|
|
207
|
+
render?(ctx: Exposed extends Block ? undefined : ShallowUnwrapRef<Exposed>, props: Readonly<InferredProps>, emit: EmitFn<Emits>, attrs: any, slots: Slots): VaporRenderResult<TypeBlock> | void;
|
|
150
208
|
name?: string;
|
|
151
209
|
vapor?: boolean;
|
|
210
|
+
components?: Record<string, VaporComponent>;
|
|
152
211
|
}
|
|
153
212
|
interface SharedInternalOptions {
|
|
154
213
|
/**
|
|
@@ -173,30 +232,30 @@ type LooseRawSlots = Record<string, VaporSlot | DynamicSlotSource[]> & {
|
|
|
173
232
|
$?: DynamicSlotSource[];
|
|
174
233
|
};
|
|
175
234
|
export declare function createComponent(component: VaporComponent, rawProps?: LooseRawProps | null, rawSlots?: LooseRawSlots | null, isSingleRoot?: boolean, once?: boolean, appContext?: GenericAppContext): VaporComponentInstance;
|
|
176
|
-
declare class VaporComponentInstance implements GenericComponentInstance {
|
|
235
|
+
export declare class VaporComponentInstance<Props extends Record<string, any> = {}, Emits extends EmitsOptions = {}, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block, TypeRefs extends Record<string, any> = Record<string, any>> implements GenericComponentInstance {
|
|
177
236
|
vapor: true;
|
|
178
237
|
uid: number;
|
|
179
238
|
type: VaporComponent;
|
|
180
239
|
root: GenericComponentInstance | null;
|
|
181
240
|
parent: GenericComponentInstance | null;
|
|
182
241
|
appContext: GenericAppContext;
|
|
183
|
-
block:
|
|
242
|
+
block: TypeBlock;
|
|
184
243
|
scope: EffectScope$1;
|
|
185
244
|
rawProps: RawProps;
|
|
186
245
|
rawSlots: RawSlots;
|
|
187
|
-
props:
|
|
246
|
+
props: Readonly<Props>;
|
|
188
247
|
attrs: Record<string, any>;
|
|
189
248
|
propsDefaults: Record<string, any> | null;
|
|
190
|
-
slots:
|
|
249
|
+
slots: Slots;
|
|
191
250
|
scopeId?: string | null;
|
|
192
251
|
rawPropsRef?: ShallowRef<any>;
|
|
193
252
|
rawSlotsRef?: ShallowRef<any>;
|
|
194
|
-
emit: EmitFn
|
|
253
|
+
emit: EmitFn<Emits>;
|
|
195
254
|
emitted: Record<string, boolean> | null;
|
|
196
|
-
expose: (
|
|
197
|
-
exposed:
|
|
198
|
-
exposeProxy:
|
|
199
|
-
refs:
|
|
255
|
+
expose: (<T extends Record<string, any> = Exposed>(exposed: T) => void) & string[];
|
|
256
|
+
exposed: Exposed | null;
|
|
257
|
+
exposeProxy: Prettify<ShallowUnwrapRef<Exposed>> | null;
|
|
258
|
+
refs: TypeRefs;
|
|
200
259
|
provides: Record<string, any>;
|
|
201
260
|
ids: [string, number, number];
|
|
202
261
|
suspense: SuspenseBoundary | null;
|
|
@@ -224,7 +283,7 @@ declare class VaporComponentInstance implements GenericComponentInstance {
|
|
|
224
283
|
rtc?: LifecycleHook;
|
|
225
284
|
ec?: LifecycleHook;
|
|
226
285
|
sp?: LifecycleHook<() => Promise<unknown>>;
|
|
227
|
-
setupState?:
|
|
286
|
+
setupState?: Exposed extends Block ? undefined : ShallowUnwrapRef<Exposed>;
|
|
228
287
|
devtoolsRawSetupState?: any;
|
|
229
288
|
hmrRerender?: () => void;
|
|
230
289
|
hmrReload?: (newComp: VaporComponent) => void;
|
|
@@ -257,9 +316,6 @@ export declare function createPlainElement(comp: string, rawProps?: LooseRawProp
|
|
|
257
316
|
export declare const createVaporApp: CreateAppFunction<ParentNode, VaporComponent>;
|
|
258
317
|
export declare const createVaporSSRApp: CreateAppFunction<ParentNode, VaporComponent>;
|
|
259
318
|
|
|
260
|
-
/*! #__NO_SIDE_EFFECTS__ */
|
|
261
|
-
export declare function defineVaporComponent(comp: VaporComponent, extraOptions?: Omit<ObjectVaporComponent, 'setup'>): VaporComponent;
|
|
262
|
-
|
|
263
319
|
export declare function defineVaporAsyncComponent<T extends VaporComponent>(source: AsyncComponentLoader<T> | AsyncComponentOptions<T>): T;
|
|
264
320
|
|
|
265
321
|
export type VaporDirective = (node: Element | VaporComponentInstance, value?: () => any, argument?: string, modifiers?: DirectiveModifiers) => (() => void) | void;
|
|
@@ -273,17 +329,42 @@ export declare function withVaporDirectives(node: Element | VaporComponentInstan
|
|
|
273
329
|
|
|
274
330
|
export declare const VaporKeepAliveImpl: ObjectVaporComponent;
|
|
275
331
|
|
|
276
|
-
type VaporElementConstructor<P = {}> = {
|
|
332
|
+
export type VaporElementConstructor<P = {}> = {
|
|
277
333
|
new (initialProps?: Record<string, any>): VaporElement & P;
|
|
278
334
|
};
|
|
279
|
-
export declare function defineVaporCustomElement(
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
335
|
+
export declare function defineVaporCustomElement<Props, RawBindings = object>(setup: (props: Props, ctx: {
|
|
336
|
+
attrs: Record<string, any>;
|
|
337
|
+
slots: StaticSlots;
|
|
338
|
+
emit: EmitFn;
|
|
339
|
+
expose: (exposed: Record<string, any>) => void;
|
|
340
|
+
}) => RawBindings | VaporRenderResult, options?: Pick<ObjectVaporComponent, 'name' | 'inheritAttrs' | 'emits'> & CustomElementOptions & {
|
|
341
|
+
props?: (keyof Props)[];
|
|
342
|
+
}): VaporElementConstructor<Props>;
|
|
343
|
+
export declare function defineVaporCustomElement<Props, RawBindings = object>(setup: (props: Props, ctx: {
|
|
344
|
+
attrs: Record<string, any>;
|
|
345
|
+
slots: StaticSlots;
|
|
346
|
+
emit: EmitFn;
|
|
347
|
+
expose: (exposed: Record<string, any>) => void;
|
|
348
|
+
}) => RawBindings | VaporRenderResult, options?: Pick<ObjectVaporComponent, 'name' | 'inheritAttrs' | 'emits'> & CustomElementOptions & {
|
|
349
|
+
props?: ComponentObjectPropsOptions<Props>;
|
|
350
|
+
}): VaporElementConstructor<Props>;
|
|
351
|
+
export declare function defineVaporCustomElement<RuntimePropsOptions extends ComponentObjectPropsOptions = ComponentObjectPropsOptions, RuntimePropsKeys extends string = string, RuntimeEmitsOptions extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, InferredProps = string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : {
|
|
352
|
+
[key in RuntimePropsKeys]?: any;
|
|
353
|
+
}, ResolvedProps = InferredProps & EmitsToProps<RuntimeEmitsOptions>>(options: CustomElementOptions & {
|
|
354
|
+
props?: (RuntimePropsOptions & ThisType<void>) | RuntimePropsKeys[];
|
|
355
|
+
emits?: RuntimeEmitsOptions | RuntimeEmitsKeys[];
|
|
356
|
+
slots?: Slots;
|
|
357
|
+
setup?: (props: Readonly<InferredProps>, ctx: {
|
|
358
|
+
attrs: Record<string, any>;
|
|
359
|
+
slots: Slots;
|
|
360
|
+
emit: EmitFn<RuntimeEmitsOptions>;
|
|
361
|
+
expose: (exposed: Record<string, any>) => void;
|
|
362
|
+
}) => any;
|
|
363
|
+
} & ThisType<void>, extraOptions?: CustomElementOptions): VaporElementConstructor<ResolvedProps>;
|
|
364
|
+
export declare function defineVaporCustomElement<T extends DefineVaporComponent<any, any, any, any, any, any, any, any, any, any> | DefineVaporSetupFnComponent<any, any, any, any, any>>(options: T, extraOptions?: CustomElementOptions): VaporElementConstructor<T extends DefineVaporComponent<infer RuntimePropsOptions, any, any, any, any, any, any, any, any, any> ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : T extends DefineVaporSetupFnComponent<infer P extends Record<string, any>, any, any, any, any> ? P : unknown>;
|
|
284
365
|
export declare const defineVaporSSRCustomElement: typeof defineVaporCustomElement;
|
|
285
366
|
type VaporInnerComponentDef = VaporComponent & CustomElementOptions;
|
|
286
|
-
declare class VaporElement extends VueElementBase<ParentNode, VaporComponent, VaporInnerComponentDef> {
|
|
367
|
+
export declare class VaporElement extends VueElementBase<ParentNode, VaporComponent, VaporInnerComponentDef> {
|
|
287
368
|
constructor(def: VaporInnerComponentDef, props?: Record<string, any> | undefined, createAppFn?: CreateAppFunction<ParentNode, VaporComponent>);
|
|
288
369
|
protected _needsHydration(): boolean;
|
|
289
370
|
protected _mount(def: VaporInnerComponentDef): void;
|
|
@@ -402,7 +483,7 @@ export declare const applyRadioModel: VaporModelDirective<HTMLInputElement>;
|
|
|
402
483
|
export declare const applySelectModel: VaporModelDirective<HTMLSelectElement, 'number'>;
|
|
403
484
|
export declare const applyDynamicModel: VaporModelDirective;
|
|
404
485
|
|
|
405
|
-
export declare const VaporTransition: FunctionalVaporComponent
|
|
486
|
+
export declare const VaporTransition: FunctionalVaporComponent<TransitionProps>;
|
|
406
487
|
|
|
407
488
|
export declare const VaporTransitionGroup: ObjectVaporComponent;
|
|
408
489
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-vapor v3.6.0-alpha.
|
|
2
|
+
* @vue/runtime-vapor v3.6.0-alpha.7
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
6
|
import { isMismatchAllowed, warn, callWithAsyncErrorHandling, currentInstance, unsafeToTrustedHTML, patchStyle, xlinkNS, mergeProps, shouldSetAsProp, queuePostFlushCb, toClassSet, isSetEqual, warnPropMismatch, toStyleMap, vShowHidden, isMapEqual, isValidHtmlOrSvgAttribute, getAttributeMismatch, watch, onMounted, onUpdated, onBeforeUnmount, isAsyncWrapper, getComponentName, matches, devtoolsComponentAdded, resetShapeFlag, isKeepAlive, ensureRenderer, shallowRef, simpleSetCurrentInstance, renderSlot, ensureVaporSlotFallback, createVNode, shallowReactive, createInternalObject, isEmitListener, onScopeDispose, activate as activate$1, setTransitionHooks as setTransitionHooks$1, normalizeRef, isVNode, Fragment, isRef, ensureHydrationRenderer, setRef as setRef$1, deactivate as deactivate$1, baseEmit, baseNormalizePropsOptions, pushWarningContext, validateProps, popWarningContext, resolvePropValue, setCurrentInstance, startMeasure, queueJob, TransitionPropsValidators, leaveCbKey, baseResolveTransitionHooks, isTemplateNode, checkTransitionMode, resolveTransitionProps, useTransitionState, warnExtraneousAttributes, resolveTeleportTarget, isTeleportDisabled, isTeleportDeferred, performTransitionEnter, performTransitionLeave, getInheritedScopeIds, registerHMR, endMeasure, unregisterHMR, nextUid, EffectScope as EffectScope$1, expose, callWithErrorHandling, markAsyncBoundary, getFunctionalFallthrough, createAppAPI, initFeatureFlags, setDevtoolsHook, flushOnAppMount, normalizeContainer, createAsyncComponentContext, useAsyncComponentState, performAsyncHydrate, handleError, VueElementBase, createCanSetSetupRefChecker, baseUseCssVars, setVarsOnNode, resolveDynamicComponent, vShowOriginalDisplay, vModelTextInit, vModelCheckboxInit, vModelSelectInit, vModelTextUpdate, vModelCheckboxUpdate, vModelGetValue, vModelSetSelected, onBeforeUpdate, hasCSSTransform, callPendingCbs, forceReflow, handleMovedChildren, baseApplyTranslation } from '@vue/runtime-dom';
|
|
7
7
|
import { isArray, normalizeClass, normalizeStyle, includeBooleanAttr, toDisplayString, isString, parseStringStyle, isOn, canSetValueDirectly, camelize, stringifyStyle, normalizeCssVarValue, getEscapedCssVarName, isFunction, extend, invokeArrayFns, isReservedProp, EMPTY_OBJ, hasOwn, EMPTY_ARR, NO, YES, isPromise, getGlobalThis, isPlainObject, isObject, remove as remove$1, NOOP, looseEqual } from '@vue/shared';
|
|
8
|
-
import { onEffectCleanup, pauseTracking, resetTracking, ReactiveEffect, setActiveSub, EffectScope, onScopeDispose as onScopeDispose$1, markRaw, unref, proxyRefs, toRaw, watch as watch$1, isReactive, isShallow, shallowReadArray, isReadonly, toReadonly, toReactive, shallowRef as shallowRef$1, isRef as isRef$1, traverse } from '@vue/reactivity';
|
|
8
|
+
import { onEffectCleanup, pauseTracking, resetTracking, computed, ReactiveEffect, setActiveSub, EffectScope, onScopeDispose as onScopeDispose$1, markRaw, unref, proxyRefs, toRaw, watch as watch$1, isReactive, isShallow, shallowReadArray, isReadonly, toReadonly, toReactive, shallowRef as shallowRef$1, isRef as isRef$1, traverse } from '@vue/reactivity';
|
|
9
9
|
|
|
10
10
|
let insertionParent;
|
|
11
11
|
let insertionAnchor;
|
|
@@ -1006,14 +1006,14 @@ const VaporKeepAliveImpl = defineVaporComponent({
|
|
|
1006
1006
|
}
|
|
1007
1007
|
}
|
|
1008
1008
|
const injectKeepAliveHooks = (frag) => {
|
|
1009
|
-
(frag.
|
|
1009
|
+
(frag.onBeforeTeardown || (frag.onBeforeTeardown = [])).push(
|
|
1010
1010
|
(oldKey, nodes, scope) => {
|
|
1011
1011
|
processFragment(frag);
|
|
1012
1012
|
keptAliveScopes.set(oldKey, scope);
|
|
1013
1013
|
return true;
|
|
1014
1014
|
}
|
|
1015
1015
|
);
|
|
1016
|
-
(frag.
|
|
1016
|
+
(frag.onBeforeMount || (frag.onBeforeMount = [])).push(
|
|
1017
1017
|
() => cacheFragment(frag)
|
|
1018
1018
|
);
|
|
1019
1019
|
frag.getScope = (key) => {
|
|
@@ -1197,8 +1197,10 @@ const vaporInteropImpl = {
|
|
|
1197
1197
|
/**
|
|
1198
1198
|
* vapor slot in vdom
|
|
1199
1199
|
*/
|
|
1200
|
-
slot(n1, n2, container, anchor) {
|
|
1200
|
+
slot(n1, n2, container, anchor, parentComponent) {
|
|
1201
1201
|
if (!n1) {
|
|
1202
|
+
const prev = currentInstance;
|
|
1203
|
+
simpleSetCurrentInstance(parentComponent);
|
|
1202
1204
|
let selfAnchor;
|
|
1203
1205
|
const { slot, fallback } = n2.vs;
|
|
1204
1206
|
const propsRef = n2.vs.ref = shallowRef(n2.props);
|
|
@@ -1207,6 +1209,7 @@ const vaporInteropImpl = {
|
|
|
1207
1209
|
setFragmentFallback(slotBlock, createFallback(fallback));
|
|
1208
1210
|
selfAnchor = slotBlock.anchor;
|
|
1209
1211
|
}
|
|
1212
|
+
simpleSetCurrentInstance(prev);
|
|
1210
1213
|
if (!selfAnchor) selfAnchor = createTextNode();
|
|
1211
1214
|
insert(n2.el = n2.anchor = selfAnchor, container, anchor);
|
|
1212
1215
|
insert(n2.vb = slotBlock, container, selfAnchor);
|
|
@@ -1370,7 +1373,7 @@ function createVDOMComponent(internals, component, parentComponent, rawProps, ra
|
|
|
1370
1373
|
simpleSetCurrentInstance(prev);
|
|
1371
1374
|
}
|
|
1372
1375
|
frag.nodes = vnode.el;
|
|
1373
|
-
if (isMounted && frag.
|
|
1376
|
+
if (isMounted && frag.onUpdated) frag.onUpdated.forEach((m) => m());
|
|
1374
1377
|
};
|
|
1375
1378
|
frag.remove = unmount;
|
|
1376
1379
|
frag.setRef = (instance, ref, refFor, refKey) => {
|
|
@@ -1412,7 +1415,7 @@ function renderVDOMSlot(internals, slotsRef, name, props, parentComponent, fallb
|
|
|
1412
1415
|
internals.um(oldVNode, parentComponent, null);
|
|
1413
1416
|
}
|
|
1414
1417
|
};
|
|
1415
|
-
if (isMounted && frag.
|
|
1418
|
+
if (isMounted && frag.onUpdated) frag.onUpdated.forEach((m) => m());
|
|
1416
1419
|
};
|
|
1417
1420
|
const render = (parentNode, anchor) => {
|
|
1418
1421
|
renderEffect(() => {
|
|
@@ -1871,6 +1874,12 @@ function setCurrentSlotScopeIds(scopeIds) {
|
|
|
1871
1874
|
currentSlotScopeIds = scopeIds;
|
|
1872
1875
|
}
|
|
1873
1876
|
}
|
|
1877
|
+
function resolveDynamicSlot(source) {
|
|
1878
|
+
if (!source._cache) {
|
|
1879
|
+
source._cache = computed(source);
|
|
1880
|
+
}
|
|
1881
|
+
return source._cache.value;
|
|
1882
|
+
}
|
|
1874
1883
|
const dynamicSlotsProxyHandlers = {
|
|
1875
1884
|
get: getSlot,
|
|
1876
1885
|
has: (target, key) => !!getSlot(target, key),
|
|
@@ -1891,7 +1900,7 @@ const dynamicSlotsProxyHandlers = {
|
|
|
1891
1900
|
keys = keys.filter((k) => k !== "$");
|
|
1892
1901
|
for (const source of dynamicSources) {
|
|
1893
1902
|
if (isFunction(source)) {
|
|
1894
|
-
const slot = source
|
|
1903
|
+
const slot = resolveDynamicSlot(source);
|
|
1895
1904
|
if (isArray(slot)) {
|
|
1896
1905
|
for (const s of slot) keys.push(String(s.name));
|
|
1897
1906
|
} else {
|
|
@@ -1916,7 +1925,7 @@ function getSlot(target, key) {
|
|
|
1916
1925
|
while (i--) {
|
|
1917
1926
|
source = dynamicSources[i];
|
|
1918
1927
|
if (isFunction(source)) {
|
|
1919
|
-
const slot = source
|
|
1928
|
+
const slot = resolveDynamicSlot(source);
|
|
1920
1929
|
if (slot) {
|
|
1921
1930
|
if (isArray(slot)) {
|
|
1922
1931
|
for (const s of slot) {
|
|
@@ -2068,7 +2077,7 @@ class RenderEffect extends ReactiveEffect {
|
|
|
2068
2077
|
this.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
|
|
2069
2078
|
this.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
|
|
2070
2079
|
}
|
|
2071
|
-
if (
|
|
2080
|
+
if (instance.type.ce) {
|
|
2072
2081
|
(instance.renderEffects || (instance.renderEffects = [])).push(this);
|
|
2073
2082
|
}
|
|
2074
2083
|
job.i = instance;
|
|
@@ -2120,61 +2129,59 @@ const decorate$1 = (t) => {
|
|
|
2120
2129
|
t.__vapor = true;
|
|
2121
2130
|
return t;
|
|
2122
2131
|
};
|
|
2123
|
-
const VaporTransition = /* @__PURE__ */ decorate$1(
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
if (firstChild) {
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
resetDisplay = () => firstChild.style.display = originalDisplay;
|
|
2136
|
-
}
|
|
2137
|
-
parentNode.replaceChild(firstChild, currentHydrationNode);
|
|
2138
|
-
setCurrentHydrationNode(firstChild);
|
|
2132
|
+
const VaporTransition = /* @__PURE__ */ decorate$1((props, { slots }) => {
|
|
2133
|
+
let resetDisplay;
|
|
2134
|
+
if (isHydrating && currentHydrationNode && isTemplateNode(currentHydrationNode)) {
|
|
2135
|
+
const {
|
|
2136
|
+
content: { firstChild },
|
|
2137
|
+
parentNode
|
|
2138
|
+
} = currentHydrationNode;
|
|
2139
|
+
if (firstChild) {
|
|
2140
|
+
if (firstChild instanceof HTMLElement || firstChild instanceof SVGElement) {
|
|
2141
|
+
const originalDisplay = firstChild.style.display;
|
|
2142
|
+
firstChild.style.display = "none";
|
|
2143
|
+
resetDisplay = () => firstChild.style.display = originalDisplay;
|
|
2139
2144
|
}
|
|
2145
|
+
parentNode.replaceChild(firstChild, currentHydrationNode);
|
|
2146
|
+
setCurrentHydrationNode(firstChild);
|
|
2140
2147
|
}
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
const child = findTransitionBlock(children);
|
|
2155
|
-
if (child) {
|
|
2156
|
-
child.$transition.props = resolvedProps;
|
|
2157
|
-
applyTransitionHooks(child, child.$transition, true);
|
|
2158
|
-
}
|
|
2159
|
-
}
|
|
2148
|
+
}
|
|
2149
|
+
const children = slots.default && slots.default();
|
|
2150
|
+
if (!children) return [];
|
|
2151
|
+
const instance = currentInstance;
|
|
2152
|
+
const { mode } = props;
|
|
2153
|
+
checkTransitionMode(mode);
|
|
2154
|
+
let resolvedProps;
|
|
2155
|
+
let isMounted = false;
|
|
2156
|
+
renderEffect(() => {
|
|
2157
|
+
resolvedProps = resolveTransitionProps(props);
|
|
2158
|
+
if (isMounted) {
|
|
2159
|
+
if (isFragment(children)) {
|
|
2160
|
+
children.$transition.props = resolvedProps;
|
|
2160
2161
|
} else {
|
|
2161
|
-
|
|
2162
|
+
const child = findTransitionBlock(children);
|
|
2163
|
+
if (child) {
|
|
2164
|
+
child.$transition.props = resolvedProps;
|
|
2165
|
+
applyTransitionHooks(child, child.$transition, true);
|
|
2166
|
+
}
|
|
2162
2167
|
}
|
|
2163
|
-
}
|
|
2164
|
-
|
|
2165
|
-
state: useTransitionState(),
|
|
2166
|
-
props: resolvedProps,
|
|
2167
|
-
instance
|
|
2168
|
-
});
|
|
2169
|
-
if (resetDisplay && resolvedProps.appear) {
|
|
2170
|
-
const child = findTransitionBlock(children);
|
|
2171
|
-
hooks.beforeEnter(child);
|
|
2172
|
-
resetDisplay();
|
|
2173
|
-
queuePostFlushCb(() => hooks.enter(child));
|
|
2168
|
+
} else {
|
|
2169
|
+
isMounted = true;
|
|
2174
2170
|
}
|
|
2175
|
-
|
|
2171
|
+
});
|
|
2172
|
+
const hooks = applyTransitionHooks(children, {
|
|
2173
|
+
state: useTransitionState(),
|
|
2174
|
+
props: resolvedProps,
|
|
2175
|
+
instance
|
|
2176
|
+
});
|
|
2177
|
+
if (resetDisplay && resolvedProps.appear) {
|
|
2178
|
+
const child = findTransitionBlock(children);
|
|
2179
|
+
hooks.beforeEnter(child);
|
|
2180
|
+
resetDisplay();
|
|
2181
|
+
queuePostFlushCb(() => hooks.enter(child));
|
|
2176
2182
|
}
|
|
2177
|
-
|
|
2183
|
+
return children;
|
|
2184
|
+
});
|
|
2178
2185
|
const getTransitionHooksContext = (key, props, state, instance, postClone) => {
|
|
2179
2186
|
const { leavingNodes } = state;
|
|
2180
2187
|
const context = {
|
|
@@ -2407,6 +2414,7 @@ class DynamicFragment extends VaporFragment {
|
|
|
2407
2414
|
);
|
|
2408
2415
|
});
|
|
2409
2416
|
};
|
|
2417
|
+
this.slotOwner = currentSlotOwner;
|
|
2410
2418
|
if (isHydrating) {
|
|
2411
2419
|
this.anchorLabel = anchorLabel;
|
|
2412
2420
|
locateHydrationNode();
|
|
@@ -2427,8 +2435,8 @@ class DynamicFragment extends VaporFragment {
|
|
|
2427
2435
|
const transition = this.$transition;
|
|
2428
2436
|
if (this.scope) {
|
|
2429
2437
|
let preserveScope = false;
|
|
2430
|
-
if (this.
|
|
2431
|
-
preserveScope = this.
|
|
2438
|
+
if (this.onBeforeTeardown) {
|
|
2439
|
+
preserveScope = this.onBeforeTeardown.some(
|
|
2432
2440
|
(hook) => hook(this.current, this.nodes, this.scope)
|
|
2433
2441
|
);
|
|
2434
2442
|
}
|
|
@@ -2440,7 +2448,7 @@ class DynamicFragment extends VaporFragment {
|
|
|
2440
2448
|
applyTransitionLeaveHooks(
|
|
2441
2449
|
this.nodes,
|
|
2442
2450
|
transition,
|
|
2443
|
-
() => this.
|
|
2451
|
+
() => this.renderBranch(render, transition, parent, instance)
|
|
2444
2452
|
);
|
|
2445
2453
|
parent && remove(this.nodes, parent);
|
|
2446
2454
|
if (mode === "out-in") {
|
|
@@ -2451,18 +2459,28 @@ class DynamicFragment extends VaporFragment {
|
|
|
2451
2459
|
parent && remove(this.nodes, parent);
|
|
2452
2460
|
}
|
|
2453
2461
|
}
|
|
2454
|
-
this.
|
|
2462
|
+
this.renderBranch(render, transition, parent, instance);
|
|
2455
2463
|
if (this.fallback) {
|
|
2456
|
-
|
|
2457
|
-
if (
|
|
2458
|
-
setFragmentFallback(
|
|
2464
|
+
let invalidFragment = null;
|
|
2465
|
+
if (isFragment(this.nodes)) {
|
|
2466
|
+
setFragmentFallback(
|
|
2467
|
+
this.nodes,
|
|
2468
|
+
this.fallback,
|
|
2469
|
+
(frag) => {
|
|
2470
|
+
if (!isValidBlock(frag.nodes)) {
|
|
2471
|
+
invalidFragment = frag;
|
|
2472
|
+
}
|
|
2473
|
+
}
|
|
2474
|
+
);
|
|
2475
|
+
}
|
|
2476
|
+
if (!invalidFragment && !isValidBlock(this.nodes)) {
|
|
2477
|
+
invalidFragment = this;
|
|
2459
2478
|
}
|
|
2460
|
-
const invalidFragment = findInvalidFragment(this);
|
|
2461
2479
|
if (invalidFragment) {
|
|
2462
2480
|
parent && remove(this.nodes, parent);
|
|
2463
2481
|
const scope = this.scope || (this.scope = new EffectScope());
|
|
2464
2482
|
scope.run(() => {
|
|
2465
|
-
if (
|
|
2483
|
+
if (invalidFragment !== this) {
|
|
2466
2484
|
renderFragmentFallback(invalidFragment);
|
|
2467
2485
|
} else {
|
|
2468
2486
|
this.nodes = this.fallback() || [];
|
|
@@ -2474,7 +2492,7 @@ class DynamicFragment extends VaporFragment {
|
|
|
2474
2492
|
setActiveSub(prevSub);
|
|
2475
2493
|
if (isHydrating) this.hydrate();
|
|
2476
2494
|
}
|
|
2477
|
-
|
|
2495
|
+
renderBranch(render, transition, parent, instance) {
|
|
2478
2496
|
if (render) {
|
|
2479
2497
|
const scope = this.getScope && this.getScope(this.current);
|
|
2480
2498
|
if (scope) {
|
|
@@ -2482,24 +2500,27 @@ class DynamicFragment extends VaporFragment {
|
|
|
2482
2500
|
} else {
|
|
2483
2501
|
this.scope = new EffectScope();
|
|
2484
2502
|
}
|
|
2485
|
-
|
|
2486
|
-
|
|
2503
|
+
const prevOwner = setCurrentSlotOwner(this.slotOwner);
|
|
2504
|
+
const prev = parent && instance ? setCurrentInstance(instance) : void 0;
|
|
2487
2505
|
this.nodes = this.scope.run(render) || [];
|
|
2488
|
-
if (
|
|
2506
|
+
if (prev !== void 0) setCurrentInstance(...prev);
|
|
2507
|
+
setCurrentSlotOwner(prevOwner);
|
|
2489
2508
|
if (transition) {
|
|
2490
2509
|
this.$transition = applyTransitionHooks(this.nodes, transition);
|
|
2491
2510
|
}
|
|
2492
|
-
if (this.
|
|
2493
|
-
this.
|
|
2511
|
+
if (this.onBeforeMount) {
|
|
2512
|
+
this.onBeforeMount.forEach(
|
|
2494
2513
|
(hook) => hook(this.current, this.nodes, this.scope)
|
|
2495
2514
|
);
|
|
2496
2515
|
}
|
|
2497
2516
|
if (parent) {
|
|
2498
2517
|
if (this.attrs) {
|
|
2499
2518
|
if (this.nodes instanceof Element) {
|
|
2500
|
-
|
|
2501
|
-
(
|
|
2502
|
-
|
|
2519
|
+
this.scope.run(() => {
|
|
2520
|
+
renderEffect(
|
|
2521
|
+
() => applyFallthroughProps(this.nodes, this.attrs)
|
|
2522
|
+
);
|
|
2523
|
+
});
|
|
2503
2524
|
} else if (!!(process.env.NODE_ENV !== "production") && // preventing attrs fallthrough on slots
|
|
2504
2525
|
// consistent with VDOM slots behavior
|
|
2505
2526
|
(this.anchorLabel === "slot" || isArray(this.nodes) && this.nodes.length)) {
|
|
@@ -2507,8 +2528,8 @@ class DynamicFragment extends VaporFragment {
|
|
|
2507
2528
|
}
|
|
2508
2529
|
}
|
|
2509
2530
|
insert(this.nodes, parent, this.anchor);
|
|
2510
|
-
if (this.
|
|
2511
|
-
this.
|
|
2531
|
+
if (this.onUpdated) {
|
|
2532
|
+
this.onUpdated.forEach((hook) => hook(this.nodes));
|
|
2512
2533
|
}
|
|
2513
2534
|
}
|
|
2514
2535
|
} else {
|
|
@@ -2517,7 +2538,7 @@ class DynamicFragment extends VaporFragment {
|
|
|
2517
2538
|
}
|
|
2518
2539
|
}
|
|
2519
2540
|
}
|
|
2520
|
-
function setFragmentFallback(fragment, fallback) {
|
|
2541
|
+
function setFragmentFallback(fragment, fallback, onFragment) {
|
|
2521
2542
|
if (fragment.fallback) {
|
|
2522
2543
|
const originalFallback = fragment.fallback;
|
|
2523
2544
|
fragment.fallback = () => {
|
|
@@ -2530,8 +2551,9 @@ function setFragmentFallback(fragment, fallback) {
|
|
|
2530
2551
|
} else {
|
|
2531
2552
|
fragment.fallback = fallback;
|
|
2532
2553
|
}
|
|
2554
|
+
if (onFragment) onFragment(fragment);
|
|
2533
2555
|
if (isFragment(fragment.nodes)) {
|
|
2534
|
-
setFragmentFallback(fragment.nodes, fragment.fallback);
|
|
2556
|
+
setFragmentFallback(fragment.nodes, fragment.fallback, onFragment);
|
|
2535
2557
|
}
|
|
2536
2558
|
}
|
|
2537
2559
|
function renderFragmentFallback(fragment) {
|
|
@@ -2541,10 +2563,6 @@ function renderFragmentFallback(fragment) {
|
|
|
2541
2563
|
fragment.update(fragment.fallback);
|
|
2542
2564
|
} else ;
|
|
2543
2565
|
}
|
|
2544
|
-
function findInvalidFragment(fragment) {
|
|
2545
|
-
if (isValidBlock(fragment.nodes)) return null;
|
|
2546
|
-
return isFragment(fragment.nodes) ? findInvalidFragment(fragment.nodes) || fragment : fragment;
|
|
2547
|
-
}
|
|
2548
2566
|
function isFragment(val) {
|
|
2549
2567
|
return val instanceof VaporFragment;
|
|
2550
2568
|
}
|
|
@@ -2664,11 +2682,13 @@ class TeleportFragment extends VaporFragment {
|
|
|
2664
2682
|
const nodes = this.nodes;
|
|
2665
2683
|
if (this.parentComponent && this.parentComponent.ut) {
|
|
2666
2684
|
if (isFragment(nodes)) {
|
|
2667
|
-
(nodes.
|
|
2685
|
+
(nodes.onUpdated || (nodes.onUpdated = [])).push(
|
|
2686
|
+
() => updateCssVars(this)
|
|
2687
|
+
);
|
|
2668
2688
|
} else if (isArray(nodes)) {
|
|
2669
2689
|
nodes.forEach((node) => {
|
|
2670
2690
|
if (isFragment(node)) {
|
|
2671
|
-
(node.
|
|
2691
|
+
(node.onUpdated || (node.onUpdated = [])).push(
|
|
2672
2692
|
() => updateCssVars(this)
|
|
2673
2693
|
);
|
|
2674
2694
|
}
|
|
@@ -2984,12 +3004,9 @@ function hmrRerender(instance) {
|
|
|
2984
3004
|
const normalized = normalizeBlock(instance.block);
|
|
2985
3005
|
const parent = normalized[0].parentNode;
|
|
2986
3006
|
const anchor = normalized[normalized.length - 1].nextSibling;
|
|
3007
|
+
instance.scope.reset();
|
|
2987
3008
|
remove(instance.block, parent);
|
|
2988
3009
|
const prev = setCurrentInstance(instance);
|
|
2989
|
-
if (instance.renderEffects) {
|
|
2990
|
-
instance.renderEffects.forEach((e) => e.stop());
|
|
2991
|
-
instance.renderEffects = [];
|
|
2992
|
-
}
|
|
2993
3010
|
pushWarningContext(instance);
|
|
2994
3011
|
devRender(instance);
|
|
2995
3012
|
popWarningContext();
|
|
@@ -3199,7 +3216,7 @@ function setupComponent(instance, component) {
|
|
|
3199
3216
|
}
|
|
3200
3217
|
}
|
|
3201
3218
|
} else {
|
|
3202
|
-
handleSetupResult(setupResult, component, instance
|
|
3219
|
+
handleSetupResult(setupResult, component, instance);
|
|
3203
3220
|
}
|
|
3204
3221
|
setActiveSub(prevSub);
|
|
3205
3222
|
setCurrentInstance(...prevInstance);
|
|
@@ -3396,12 +3413,7 @@ function mountComponent(instance, parent, anchor) {
|
|
|
3396
3413
|
if (instance.suspense && instance.asyncDep && !instance.asyncResolved) {
|
|
3397
3414
|
const component = instance.type;
|
|
3398
3415
|
instance.suspense.registerDep(instance, (setupResult) => {
|
|
3399
|
-
handleSetupResult(
|
|
3400
|
-
setupResult,
|
|
3401
|
-
component,
|
|
3402
|
-
instance,
|
|
3403
|
-
isFunction(component) ? component : component.setup
|
|
3404
|
-
);
|
|
3416
|
+
handleSetupResult(setupResult, component, instance);
|
|
3405
3417
|
mountComponent(instance, parent, anchor);
|
|
3406
3418
|
});
|
|
3407
3419
|
return;
|
|
@@ -3498,7 +3510,7 @@ function getRootElement(block, onDynamicFragment, recurse = true) {
|
|
|
3498
3510
|
function isVaporTransition(component) {
|
|
3499
3511
|
return getComponentName(component) === "VaporTransition";
|
|
3500
3512
|
}
|
|
3501
|
-
function handleSetupResult(setupResult, component, instance
|
|
3513
|
+
function handleSetupResult(setupResult, component, instance) {
|
|
3502
3514
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
3503
3515
|
pushWarningContext(instance);
|
|
3504
3516
|
}
|
|
@@ -3522,7 +3534,7 @@ function handleSetupResult(setupResult, component, instance, setupFn) {
|
|
|
3522
3534
|
devRender(instance);
|
|
3523
3535
|
}
|
|
3524
3536
|
} else {
|
|
3525
|
-
if (
|
|
3537
|
+
if (setupResult === EMPTY_OBJ && component.render) {
|
|
3526
3538
|
instance.block = callWithErrorHandling(
|
|
3527
3539
|
component.render,
|
|
3528
3540
|
instance,
|
|
@@ -4211,7 +4223,7 @@ const createFor = (src, renderItem, getKey, flags = 0, setup) => {
|
|
|
4211
4223
|
} else {
|
|
4212
4224
|
oldBlocks = [];
|
|
4213
4225
|
}
|
|
4214
|
-
if (isMounted && frag.
|
|
4226
|
+
if (isMounted && frag.onUpdated) frag.onUpdated.forEach((m) => m());
|
|
4215
4227
|
setActiveSub(prevSub);
|
|
4216
4228
|
};
|
|
4217
4229
|
const needKey = renderItem.length > 1;
|
|
@@ -4916,4 +4928,4 @@ function getFirstConnectedChild(children) {
|
|
|
4916
4928
|
}
|
|
4917
4929
|
}
|
|
4918
4930
|
|
|
4919
|
-
export { VaporFragment, VaporKeepAliveImpl as VaporKeepAlive, VaporTeleportImpl as VaporTeleport, VaporTransition, VaporTransitionGroup, applyCheckboxModel, applyDynamicModel, applyRadioModel, applySelectModel, applyTextModel, applyVShow, child, createComponent, createComponentWithFallback, createDynamicComponent, createFor, createForSlots, createIf, createInvoker, createKeyedFragment, createPlainElement, createSlot, createTemplateRefSetter, createTextNode, createVaporApp, createVaporSSRApp, defineVaporAsyncComponent, defineVaporComponent, defineVaporCustomElement, defineVaporSSRCustomElement, delegate, delegateEvents, getDefaultValue, getRestElement, insert, isFragment, isVaporComponent, next, nthChild, on, prepend, remove, renderEffect, setAttr, setBlockHtml, setBlockText, setClass, setDOMProp, setDynamicEvents, setDynamicProps, setElementText, setHtml, setInsertionState, setProp, setStyle, setText, setValue, template, txt, useVaporCssVars, vaporInteropPlugin, withVaporCtx, withVaporDirectives };
|
|
4931
|
+
export { VaporElement, VaporFragment, VaporKeepAliveImpl as VaporKeepAlive, VaporTeleportImpl as VaporTeleport, VaporTransition, VaporTransitionGroup, applyCheckboxModel, applyDynamicModel, applyRadioModel, applySelectModel, applyTextModel, applyVShow, child, createComponent, createComponentWithFallback, createDynamicComponent, createFor, createForSlots, createIf, createInvoker, createKeyedFragment, createPlainElement, createSlot, createTemplateRefSetter, createTextNode, createVaporApp, createVaporSSRApp, defineVaporAsyncComponent, defineVaporComponent, defineVaporCustomElement, defineVaporSSRCustomElement, delegate, delegateEvents, getDefaultValue, getRestElement, insert, isFragment, isVaporComponent, next, nthChild, on, prepend, remove, renderEffect, setAttr, setBlockHtml, setBlockText, setClass, setDOMProp, setDynamicEvents, setDynamicProps, setElementText, setHtml, setInsertionState, setProp, setStyle, setText, setValue, template, txt, useVaporCssVars, vaporInteropPlugin, withVaporCtx, withVaporDirectives };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/runtime-vapor",
|
|
3
|
-
"version": "3.6.0-alpha.
|
|
3
|
+
"version": "3.6.0-alpha.7",
|
|
4
4
|
"description": "@vue/runtime-vapor",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/runtime-vapor.esm-bundler.js",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://github.com/vuejs/core/tree/dev/packages/runtime-vapor#readme",
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@vue/shared": "3.6.0-alpha.
|
|
42
|
-
"@vue/reactivity": "3.6.0-alpha.
|
|
41
|
+
"@vue/shared": "3.6.0-alpha.7",
|
|
42
|
+
"@vue/reactivity": "3.6.0-alpha.7"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@vue/runtime-dom": "3.6.0-alpha.
|
|
45
|
+
"@vue/runtime-dom": "3.6.0-alpha.7"
|
|
46
46
|
}
|
|
47
47
|
}
|