@vue/runtime-vapor 3.6.0-alpha.6 → 3.6.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/runtime-vapor.d.ts +132 -38
- package/dist/runtime-vapor.esm-bundler.js +294 -177
- 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,
|
|
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
2
|
import { Ref, EffectScope, ReactiveEffect, ShallowRef } from '@vue/reactivity';
|
|
3
|
-
import { Namespace, NormalizedStyle } from '@vue/shared';
|
|
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[]> {
|
|
@@ -29,21 +29,26 @@ declare class DynamicFragment extends VaporFragment {
|
|
|
29
29
|
anchor: Node;
|
|
30
30
|
scope: EffectScope | undefined;
|
|
31
31
|
current?: BlockFn;
|
|
32
|
+
pending?: {
|
|
33
|
+
render?: BlockFn;
|
|
34
|
+
key: any;
|
|
35
|
+
};
|
|
32
36
|
fallback?: BlockFn;
|
|
33
37
|
anchorLabel?: string;
|
|
34
38
|
attrs?: Record<string, any>;
|
|
35
39
|
setAsyncRef?: (instance: VaporComponentInstance) => void;
|
|
36
40
|
getScope?: (key: any) => EffectScope | undefined;
|
|
37
|
-
|
|
38
|
-
|
|
41
|
+
onBeforeTeardown?: ((oldKey: any, nodes: Block, scope: EffectScope) => boolean)[];
|
|
42
|
+
onBeforeMount?: ((newKey: any, nodes: Block, scope: EffectScope) => void)[];
|
|
43
|
+
slotOwner: VaporComponentInstance | null;
|
|
39
44
|
constructor(anchorLabel?: string);
|
|
40
45
|
update(render?: BlockFn, key?: any): void;
|
|
41
|
-
|
|
46
|
+
renderBranch(render: BlockFn | undefined, transition: VaporTransitionHooks | undefined, parent: ParentNode | null, instance: GenericComponentInstance | null): void;
|
|
42
47
|
hydrate: (isEmpty?: boolean) => void;
|
|
43
48
|
}
|
|
44
49
|
export declare function isFragment(val: NonNullable<unknown>): val is VaporFragment;
|
|
45
50
|
|
|
46
|
-
interface VaporTransitionHooks extends TransitionHooks {
|
|
51
|
+
export interface VaporTransitionHooks extends TransitionHooks {
|
|
47
52
|
state: TransitionState;
|
|
48
53
|
props: TransitionProps;
|
|
49
54
|
instance: VaporComponentInstance;
|
|
@@ -53,7 +58,7 @@ interface TransitionOptions {
|
|
|
53
58
|
$key?: any;
|
|
54
59
|
$transition?: VaporTransitionHooks;
|
|
55
60
|
}
|
|
56
|
-
type Block = Node | VaporFragment | DynamicFragment | VaporComponentInstance | Block[];
|
|
61
|
+
export type Block = Node | VaporFragment | DynamicFragment | VaporComponentInstance | Block[];
|
|
57
62
|
type BlockFn = (...args: any[]) => Block;
|
|
58
63
|
export declare function insert(block: Block, parent: ParentNode & {
|
|
59
64
|
$fc?: Node | null;
|
|
@@ -87,7 +92,7 @@ type RawSlots = Record<string, VaporSlot> & {
|
|
|
87
92
|
$?: DynamicSlotSource[];
|
|
88
93
|
};
|
|
89
94
|
type StaticSlots = Record<string, VaporSlot>;
|
|
90
|
-
type VaporSlot = BlockFn;
|
|
95
|
+
export type VaporSlot = BlockFn;
|
|
91
96
|
type DynamicSlot = {
|
|
92
97
|
name: string;
|
|
93
98
|
fn: VaporSlot;
|
|
@@ -136,19 +141,75 @@ declare class TeleportFragment extends VaporFragment {
|
|
|
136
141
|
hydrate: () => void;
|
|
137
142
|
}
|
|
138
143
|
|
|
139
|
-
type
|
|
140
|
-
type
|
|
141
|
-
type
|
|
144
|
+
export type VaporPublicProps = ReservedProps & AllowedComponentProps & ComponentCustomProps;
|
|
145
|
+
export type VaporRenderResult<T = Block> = VNode | T | VaporRenderResult<T>[];
|
|
146
|
+
type VaporComponentInstanceConstructor<T extends VaporComponentInstance> = {
|
|
147
|
+
__isFragment?: never;
|
|
148
|
+
__isTeleport?: never;
|
|
149
|
+
__isSuspense?: never;
|
|
150
|
+
new (...args: any[]): T;
|
|
151
|
+
};
|
|
152
|
+
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> : {
|
|
153
|
+
[key in RuntimePropsKeys]?: any;
|
|
154
|
+
}, 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>;
|
|
155
|
+
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>;
|
|
156
|
+
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: {
|
|
157
|
+
emit: EmitFn<Emits>;
|
|
158
|
+
slots: Slots;
|
|
159
|
+
attrs: Record<string, any>;
|
|
160
|
+
expose: (exposed: Exposed) => void;
|
|
161
|
+
}) => VaporRenderResult<TypeBlock> | void, extraOptions?: ObjectVaporComponent<(keyof Props)[], Emits, RuntimeEmitsKeys, Slots, Exposed> & ThisType<void>): DefineVaporSetupFnComponent<Props, Emits, Slots, Exposed, TypeBlock>;
|
|
162
|
+
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: {
|
|
163
|
+
emit: EmitFn<Emits>;
|
|
164
|
+
slots: Slots;
|
|
165
|
+
attrs: Record<string, any>;
|
|
166
|
+
expose: (exposed: Exposed) => void;
|
|
167
|
+
}) => VaporRenderResult<TypeBlock> | void, extraOptions?: ObjectVaporComponent<ComponentObjectPropsOptions<Props>, Emits, RuntimeEmitsKeys, Slots, Exposed> & ThisType<void>): DefineVaporSetupFnComponent<Props, Emits, Slots, Exposed, TypeBlock>;
|
|
168
|
+
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> : {
|
|
169
|
+
[key in RuntimePropsKeys]?: any;
|
|
170
|
+
}, TypeRefs extends Record<string, unknown> = {}, TypeBlock extends Block = Block>(options: ObjectVaporComponent<RuntimePropsOptions | RuntimePropsKeys[], ResolvedEmits, RuntimeEmitsKeys, Slots, Exposed, TypeBlock, InferredProps> & {
|
|
171
|
+
/**
|
|
172
|
+
* @private for language-tools use only
|
|
173
|
+
*/
|
|
174
|
+
__typeProps?: TypeProps;
|
|
175
|
+
/**
|
|
176
|
+
* @private for language-tools use only
|
|
177
|
+
*/
|
|
178
|
+
__typeEmits?: TypeEmits;
|
|
179
|
+
/**
|
|
180
|
+
* @private for language-tools use only
|
|
181
|
+
*/
|
|
182
|
+
__typeRefs?: TypeRefs;
|
|
183
|
+
/**
|
|
184
|
+
* @private for language-tools use only
|
|
185
|
+
*/
|
|
186
|
+
__typeEl?: TypeBlock;
|
|
187
|
+
} & ThisType<void>): DefineVaporComponent<RuntimePropsOptions, RuntimePropsKeys, ResolvedEmits, RuntimeEmitsKeys, Slots, Exposed extends Block ? Record<string, any> : Exposed, TypeBlock, TypeRefs, unknown extends TypeProps ? true : false, InferredProps>;
|
|
188
|
+
|
|
189
|
+
export type VaporComponent = FunctionalVaporComponent | ObjectVaporComponent | DefineVaporComponent;
|
|
190
|
+
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: {
|
|
191
|
+
emit: EmitFn<Emits>;
|
|
192
|
+
slots: Slots;
|
|
193
|
+
attrs: Record<string, any>;
|
|
194
|
+
expose: <T extends Record<string, any> = Exposed>(exposed: T) => void;
|
|
195
|
+
}) => VaporRenderResult) & Omit<ObjectVaporComponent<ComponentPropsOptions<Props>, Emits, string, Slots>, 'setup'> & {
|
|
142
196
|
displayName?: string;
|
|
143
197
|
} & SharedInternalOptions;
|
|
144
|
-
interface ObjectVaporComponent extends ComponentInternalOptions, AsyncComponentInternalOptions<ObjectVaporComponent, VaporComponentInstance>, SharedInternalOptions {
|
|
145
|
-
setup?: VaporSetupFn;
|
|
198
|
+
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
199
|
inheritAttrs?: boolean;
|
|
147
|
-
props?:
|
|
148
|
-
emits?:
|
|
149
|
-
|
|
200
|
+
props?: Props;
|
|
201
|
+
emits?: Emits | RuntimeEmitsKeys[];
|
|
202
|
+
slots?: Slots;
|
|
203
|
+
setup?: (props: Readonly<InferredProps>, ctx: {
|
|
204
|
+
emit: EmitFn<Emits>;
|
|
205
|
+
slots: Slots;
|
|
206
|
+
attrs: Record<string, any>;
|
|
207
|
+
expose: <T extends Record<string, any> = Exposed>(exposed: T) => void;
|
|
208
|
+
}) => TypeBlock | Exposed | Promise<Exposed> | void;
|
|
209
|
+
render?(ctx: Exposed extends Block ? undefined : ShallowUnwrapRef<Exposed>, props: Readonly<InferredProps>, emit: EmitFn<Emits>, attrs: any, slots: Slots): VaporRenderResult<TypeBlock> | void;
|
|
150
210
|
name?: string;
|
|
151
211
|
vapor?: boolean;
|
|
212
|
+
components?: Record<string, VaporComponent>;
|
|
152
213
|
}
|
|
153
214
|
interface SharedInternalOptions {
|
|
154
215
|
/**
|
|
@@ -173,30 +234,30 @@ type LooseRawSlots = Record<string, VaporSlot | DynamicSlotSource[]> & {
|
|
|
173
234
|
$?: DynamicSlotSource[];
|
|
174
235
|
};
|
|
175
236
|
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 {
|
|
237
|
+
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
238
|
vapor: true;
|
|
178
239
|
uid: number;
|
|
179
240
|
type: VaporComponent;
|
|
180
241
|
root: GenericComponentInstance | null;
|
|
181
242
|
parent: GenericComponentInstance | null;
|
|
182
243
|
appContext: GenericAppContext;
|
|
183
|
-
block:
|
|
244
|
+
block: TypeBlock;
|
|
184
245
|
scope: EffectScope$1;
|
|
185
246
|
rawProps: RawProps;
|
|
186
247
|
rawSlots: RawSlots;
|
|
187
|
-
props:
|
|
248
|
+
props: Readonly<Props>;
|
|
188
249
|
attrs: Record<string, any>;
|
|
189
250
|
propsDefaults: Record<string, any> | null;
|
|
190
|
-
slots:
|
|
251
|
+
slots: Slots;
|
|
191
252
|
scopeId?: string | null;
|
|
192
253
|
rawPropsRef?: ShallowRef<any>;
|
|
193
254
|
rawSlotsRef?: ShallowRef<any>;
|
|
194
|
-
emit: EmitFn
|
|
255
|
+
emit: EmitFn<Emits>;
|
|
195
256
|
emitted: Record<string, boolean> | null;
|
|
196
|
-
expose: (
|
|
197
|
-
exposed:
|
|
198
|
-
exposeProxy:
|
|
199
|
-
refs:
|
|
257
|
+
expose: (<T extends Record<string, any> = Exposed>(exposed: T) => void) & string[];
|
|
258
|
+
exposed: Exposed | null;
|
|
259
|
+
exposeProxy: Prettify<ShallowUnwrapRef<Exposed>> | null;
|
|
260
|
+
refs: TypeRefs;
|
|
200
261
|
provides: Record<string, any>;
|
|
201
262
|
ids: [string, number, number];
|
|
202
263
|
suspense: SuspenseBoundary | null;
|
|
@@ -206,6 +267,7 @@ declare class VaporComponentInstance implements GenericComponentInstance {
|
|
|
206
267
|
renderEffects?: RenderEffect[];
|
|
207
268
|
hasFallthrough: boolean;
|
|
208
269
|
shapeFlag?: number;
|
|
270
|
+
oncePropsCache?: Record<string | symbol, any>;
|
|
209
271
|
isMounted: boolean;
|
|
210
272
|
isUnmounted: boolean;
|
|
211
273
|
isDeactivated: boolean;
|
|
@@ -224,7 +286,7 @@ declare class VaporComponentInstance implements GenericComponentInstance {
|
|
|
224
286
|
rtc?: LifecycleHook;
|
|
225
287
|
ec?: LifecycleHook;
|
|
226
288
|
sp?: LifecycleHook<() => Promise<unknown>>;
|
|
227
|
-
setupState?:
|
|
289
|
+
setupState?: Exposed extends Block ? undefined : ShallowUnwrapRef<Exposed>;
|
|
228
290
|
devtoolsRawSetupState?: any;
|
|
229
291
|
hmrRerender?: () => void;
|
|
230
292
|
hmrReload?: (newComp: VaporComponent) => void;
|
|
@@ -257,9 +319,6 @@ export declare function createPlainElement(comp: string, rawProps?: LooseRawProp
|
|
|
257
319
|
export declare const createVaporApp: CreateAppFunction<ParentNode, VaporComponent>;
|
|
258
320
|
export declare const createVaporSSRApp: CreateAppFunction<ParentNode, VaporComponent>;
|
|
259
321
|
|
|
260
|
-
/*! #__NO_SIDE_EFFECTS__ */
|
|
261
|
-
export declare function defineVaporComponent(comp: VaporComponent, extraOptions?: Omit<ObjectVaporComponent, 'setup'>): VaporComponent;
|
|
262
|
-
|
|
263
322
|
export declare function defineVaporAsyncComponent<T extends VaporComponent>(source: AsyncComponentLoader<T> | AsyncComponentOptions<T>): T;
|
|
264
323
|
|
|
265
324
|
export type VaporDirective = (node: Element | VaporComponentInstance, value?: () => any, argument?: string, modifiers?: DirectiveModifiers) => (() => void) | void;
|
|
@@ -273,17 +332,42 @@ export declare function withVaporDirectives(node: Element | VaporComponentInstan
|
|
|
273
332
|
|
|
274
333
|
export declare const VaporKeepAliveImpl: ObjectVaporComponent;
|
|
275
334
|
|
|
276
|
-
type VaporElementConstructor<P = {}> = {
|
|
335
|
+
export type VaporElementConstructor<P = {}> = {
|
|
277
336
|
new (initialProps?: Record<string, any>): VaporElement & P;
|
|
278
337
|
};
|
|
279
|
-
export declare function defineVaporCustomElement(
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
338
|
+
export declare function defineVaporCustomElement<Props, RawBindings = object>(setup: (props: Props, ctx: {
|
|
339
|
+
attrs: Record<string, any>;
|
|
340
|
+
slots: StaticSlots;
|
|
341
|
+
emit: EmitFn;
|
|
342
|
+
expose: (exposed: Record<string, any>) => void;
|
|
343
|
+
}) => RawBindings | VaporRenderResult, options?: Pick<ObjectVaporComponent, 'name' | 'inheritAttrs' | 'emits'> & CustomElementOptions & {
|
|
344
|
+
props?: (keyof Props)[];
|
|
345
|
+
}): VaporElementConstructor<Props>;
|
|
346
|
+
export declare function defineVaporCustomElement<Props, RawBindings = object>(setup: (props: Props, ctx: {
|
|
347
|
+
attrs: Record<string, any>;
|
|
348
|
+
slots: StaticSlots;
|
|
349
|
+
emit: EmitFn;
|
|
350
|
+
expose: (exposed: Record<string, any>) => void;
|
|
351
|
+
}) => RawBindings | VaporRenderResult, options?: Pick<ObjectVaporComponent, 'name' | 'inheritAttrs' | 'emits'> & CustomElementOptions & {
|
|
352
|
+
props?: ComponentObjectPropsOptions<Props>;
|
|
353
|
+
}): VaporElementConstructor<Props>;
|
|
354
|
+
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> : {
|
|
355
|
+
[key in RuntimePropsKeys]?: any;
|
|
356
|
+
}, ResolvedProps = InferredProps & EmitsToProps<RuntimeEmitsOptions>>(options: CustomElementOptions & {
|
|
357
|
+
props?: (RuntimePropsOptions & ThisType<void>) | RuntimePropsKeys[];
|
|
358
|
+
emits?: RuntimeEmitsOptions | RuntimeEmitsKeys[];
|
|
359
|
+
slots?: Slots;
|
|
360
|
+
setup?: (props: Readonly<InferredProps>, ctx: {
|
|
361
|
+
attrs: Record<string, any>;
|
|
362
|
+
slots: Slots;
|
|
363
|
+
emit: EmitFn<RuntimeEmitsOptions>;
|
|
364
|
+
expose: (exposed: Record<string, any>) => void;
|
|
365
|
+
}) => any;
|
|
366
|
+
} & ThisType<void>, extraOptions?: CustomElementOptions): VaporElementConstructor<ResolvedProps>;
|
|
367
|
+
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
368
|
export declare const defineVaporSSRCustomElement: typeof defineVaporCustomElement;
|
|
285
369
|
type VaporInnerComponentDef = VaporComponent & CustomElementOptions;
|
|
286
|
-
declare class VaporElement extends VueElementBase<ParentNode, VaporComponent, VaporInnerComponentDef> {
|
|
370
|
+
export declare class VaporElement extends VueElementBase<ParentNode, VaporComponent, VaporInnerComponentDef> {
|
|
287
371
|
constructor(def: VaporInnerComponentDef, props?: Record<string, any> | undefined, createAppFn?: CreateAppFunction<ParentNode, VaporComponent>);
|
|
288
372
|
protected _needsHydration(): boolean;
|
|
289
373
|
protected _mount(def: VaporInnerComponentDef): void;
|
|
@@ -377,6 +461,16 @@ export declare function createInvoker(handler: (...args: any[]) => any): (...arg
|
|
|
377
461
|
|
|
378
462
|
export declare function createIf(condition: () => any, b1: BlockFn, b2?: BlockFn, once?: boolean): Block;
|
|
379
463
|
|
|
464
|
+
/**
|
|
465
|
+
* Create a dynamic fragment keyed by a reactive value for Vapor transitions.
|
|
466
|
+
* The fragment is re-rendered when the key changes to trigger enter/leave
|
|
467
|
+
* animations.
|
|
468
|
+
*
|
|
469
|
+
* Example:
|
|
470
|
+
* <VaporTransition>
|
|
471
|
+
* <h1 :key="count">{{ count }}</h1>
|
|
472
|
+
* </VaporTransition>
|
|
473
|
+
*/
|
|
380
474
|
export declare function createKeyedFragment(key: () => any, render: BlockFn): Block;
|
|
381
475
|
|
|
382
476
|
type Source = any[] | Record<any, any> | number | Set<any> | Map<any, any>;
|
|
@@ -402,7 +496,7 @@ export declare const applyRadioModel: VaporModelDirective<HTMLInputElement>;
|
|
|
402
496
|
export declare const applySelectModel: VaporModelDirective<HTMLSelectElement, 'number'>;
|
|
403
497
|
export declare const applyDynamicModel: VaporModelDirective;
|
|
404
498
|
|
|
405
|
-
export declare const VaporTransition: FunctionalVaporComponent
|
|
499
|
+
export declare const VaporTransition: FunctionalVaporComponent<TransitionProps>;
|
|
406
500
|
|
|
407
501
|
export declare const VaporTransitionGroup: ObjectVaporComponent;
|
|
408
502
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-vapor v3.6.0-
|
|
2
|
+
* @vue/runtime-vapor v3.6.0-beta.1
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
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,
|
|
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, setCurrentInstance, resolvePropValue, 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,
|
|
8
|
+
import { onEffectCleanup, computed, onScopeDispose as onScopeDispose$1, pauseTracking, resetTracking, ReactiveEffect, setActiveSub, EffectScope, 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;
|
|
@@ -916,22 +916,19 @@ const VaporKeepAliveImpl = defineVaporComponent({
|
|
|
916
916
|
};
|
|
917
917
|
const processFragment = (frag) => {
|
|
918
918
|
const [innerBlock, interop] = getInnerBlock(frag.nodes);
|
|
919
|
-
if (!innerBlock || !shouldCache(innerBlock, props, interop)) return;
|
|
919
|
+
if (!innerBlock || !shouldCache(innerBlock, props, interop)) return false;
|
|
920
920
|
if (interop) {
|
|
921
921
|
if (cache.has(innerBlock.vnode.type)) {
|
|
922
922
|
innerBlock.vnode.shapeFlag |= 512;
|
|
923
923
|
}
|
|
924
|
-
|
|
925
|
-
innerBlock.vnode.shapeFlag |= 256;
|
|
926
|
-
}
|
|
924
|
+
innerBlock.vnode.shapeFlag |= 256;
|
|
927
925
|
} else {
|
|
928
926
|
if (cache.has(innerBlock.type)) {
|
|
929
927
|
innerBlock.shapeFlag |= 512;
|
|
930
928
|
}
|
|
931
|
-
|
|
932
|
-
innerBlock.shapeFlag |= 256;
|
|
933
|
-
}
|
|
929
|
+
innerBlock.shapeFlag |= 256;
|
|
934
930
|
}
|
|
931
|
+
return true;
|
|
935
932
|
};
|
|
936
933
|
const cacheFragment = (fragment) => {
|
|
937
934
|
const [innerBlock, interop] = getInnerBlock(fragment.nodes);
|
|
@@ -1006,14 +1003,16 @@ const VaporKeepAliveImpl = defineVaporComponent({
|
|
|
1006
1003
|
}
|
|
1007
1004
|
}
|
|
1008
1005
|
const injectKeepAliveHooks = (frag) => {
|
|
1009
|
-
(frag.
|
|
1006
|
+
(frag.onBeforeTeardown || (frag.onBeforeTeardown = [])).push(
|
|
1010
1007
|
(oldKey, nodes, scope) => {
|
|
1011
|
-
processFragment(frag)
|
|
1012
|
-
|
|
1013
|
-
|
|
1008
|
+
if (processFragment(frag)) {
|
|
1009
|
+
keptAliveScopes.set(oldKey, scope);
|
|
1010
|
+
return true;
|
|
1011
|
+
}
|
|
1012
|
+
return false;
|
|
1014
1013
|
}
|
|
1015
1014
|
);
|
|
1016
|
-
(frag.
|
|
1015
|
+
(frag.onBeforeMount || (frag.onBeforeMount = [])).push(
|
|
1017
1016
|
() => cacheFragment(frag)
|
|
1018
1017
|
);
|
|
1019
1018
|
frag.getScope = (key) => {
|
|
@@ -1078,7 +1077,7 @@ function getInstanceFromCache(cached) {
|
|
|
1078
1077
|
return cached.vnode.component;
|
|
1079
1078
|
}
|
|
1080
1079
|
function activate(instance, parentNode, anchor) {
|
|
1081
|
-
|
|
1080
|
+
move(instance.block, parentNode, anchor, 0, instance);
|
|
1082
1081
|
queuePostFlushCb(() => {
|
|
1083
1082
|
instance.isDeactivated = false;
|
|
1084
1083
|
if (instance.a) invokeArrayFns(instance.a);
|
|
@@ -1088,7 +1087,7 @@ function activate(instance, parentNode, anchor) {
|
|
|
1088
1087
|
}
|
|
1089
1088
|
}
|
|
1090
1089
|
function deactivate(instance, container) {
|
|
1091
|
-
|
|
1090
|
+
move(instance.block, container, null, 1, instance);
|
|
1092
1091
|
queuePostFlushCb(() => {
|
|
1093
1092
|
if (instance.da) invokeArrayFns(instance.da);
|
|
1094
1093
|
instance.isDeactivated = true;
|
|
@@ -1117,7 +1116,7 @@ function setParentSuspense(suspense) {
|
|
|
1117
1116
|
}
|
|
1118
1117
|
}
|
|
1119
1118
|
|
|
1120
|
-
const interopKey = Symbol(`interop`);
|
|
1119
|
+
const interopKey = /* @__PURE__ */ Symbol(`interop`);
|
|
1121
1120
|
const vaporInteropImpl = {
|
|
1122
1121
|
mount(vnode, container, anchor, parentComponent, parentSuspense) {
|
|
1123
1122
|
let selfAnchor = vnode.el = vnode.anchor = createTextNode();
|
|
@@ -1197,8 +1196,10 @@ const vaporInteropImpl = {
|
|
|
1197
1196
|
/**
|
|
1198
1197
|
* vapor slot in vdom
|
|
1199
1198
|
*/
|
|
1200
|
-
slot(n1, n2, container, anchor) {
|
|
1199
|
+
slot(n1, n2, container, anchor, parentComponent) {
|
|
1201
1200
|
if (!n1) {
|
|
1201
|
+
const prev = currentInstance;
|
|
1202
|
+
simpleSetCurrentInstance(parentComponent);
|
|
1202
1203
|
let selfAnchor;
|
|
1203
1204
|
const { slot, fallback } = n2.vs;
|
|
1204
1205
|
const propsRef = n2.vs.ref = shallowRef(n2.props);
|
|
@@ -1207,6 +1208,7 @@ const vaporInteropImpl = {
|
|
|
1207
1208
|
setFragmentFallback(slotBlock, createFallback(fallback));
|
|
1208
1209
|
selfAnchor = slotBlock.anchor;
|
|
1209
1210
|
}
|
|
1211
|
+
simpleSetCurrentInstance(prev);
|
|
1210
1212
|
if (!selfAnchor) selfAnchor = createTextNode();
|
|
1211
1213
|
insert(n2.el = n2.anchor = selfAnchor, container, anchor);
|
|
1212
1214
|
insert(n2.vb = slotBlock, container, selfAnchor);
|
|
@@ -1370,7 +1372,7 @@ function createVDOMComponent(internals, component, parentComponent, rawProps, ra
|
|
|
1370
1372
|
simpleSetCurrentInstance(prev);
|
|
1371
1373
|
}
|
|
1372
1374
|
frag.nodes = vnode.el;
|
|
1373
|
-
if (isMounted && frag.
|
|
1375
|
+
if (isMounted && frag.onUpdated) frag.onUpdated.forEach((m) => m());
|
|
1374
1376
|
};
|
|
1375
1377
|
frag.remove = unmount;
|
|
1376
1378
|
frag.setRef = (instance, ref, refFor, refKey) => {
|
|
@@ -1412,7 +1414,7 @@ function renderVDOMSlot(internals, slotsRef, name, props, parentComponent, fallb
|
|
|
1412
1414
|
internals.um(oldVNode, parentComponent, null);
|
|
1413
1415
|
}
|
|
1414
1416
|
};
|
|
1415
|
-
if (isMounted && frag.
|
|
1417
|
+
if (isMounted && frag.onUpdated) frag.onUpdated.forEach((m) => m());
|
|
1416
1418
|
};
|
|
1417
1419
|
const render = (parentNode, anchor) => {
|
|
1418
1420
|
renderEffect(() => {
|
|
@@ -1573,7 +1575,26 @@ function propGetter(rawProps, key) {
|
|
|
1573
1575
|
}
|
|
1574
1576
|
|
|
1575
1577
|
function resolveSource(source) {
|
|
1576
|
-
return isFunction(source) ? source
|
|
1578
|
+
return isFunction(source) ? resolveFunctionSource(source) : source;
|
|
1579
|
+
}
|
|
1580
|
+
function resolveFunctionSource(source) {
|
|
1581
|
+
if (source._cache) {
|
|
1582
|
+
return source._cache.value;
|
|
1583
|
+
}
|
|
1584
|
+
const parent = currentInstance && currentInstance.parent;
|
|
1585
|
+
if (parent) {
|
|
1586
|
+
source._cache = computed(() => {
|
|
1587
|
+
const prev = setCurrentInstance(parent);
|
|
1588
|
+
try {
|
|
1589
|
+
return source();
|
|
1590
|
+
} finally {
|
|
1591
|
+
setCurrentInstance(...prev);
|
|
1592
|
+
}
|
|
1593
|
+
});
|
|
1594
|
+
onScopeDispose$1(() => source._cache = void 0);
|
|
1595
|
+
return source._cache.value;
|
|
1596
|
+
}
|
|
1597
|
+
return source();
|
|
1577
1598
|
}
|
|
1578
1599
|
function getPropsProxyHandlers(comp, once) {
|
|
1579
1600
|
if (comp.__propsHandlers) {
|
|
@@ -1594,13 +1615,15 @@ function getPropsProxyHandlers(comp, once) {
|
|
|
1594
1615
|
while (i--) {
|
|
1595
1616
|
source = dynamicSources[i];
|
|
1596
1617
|
isDynamic = isFunction(source);
|
|
1597
|
-
source = isDynamic ?
|
|
1618
|
+
source = isDynamic ? resolveFunctionSource(
|
|
1619
|
+
source
|
|
1620
|
+
) : source;
|
|
1598
1621
|
for (rawKey in source) {
|
|
1599
1622
|
if (camelize(rawKey) === key) {
|
|
1600
1623
|
return resolvePropValue(
|
|
1601
1624
|
propsOptions,
|
|
1602
1625
|
key,
|
|
1603
|
-
isDynamic ? source[rawKey] : source[rawKey]
|
|
1626
|
+
isDynamic ? source[rawKey] : resolveFunctionSource(source[rawKey]),
|
|
1604
1627
|
instance,
|
|
1605
1628
|
resolveDefault
|
|
1606
1629
|
);
|
|
@@ -1628,14 +1651,23 @@ function getPropsProxyHandlers(comp, once) {
|
|
|
1628
1651
|
true
|
|
1629
1652
|
);
|
|
1630
1653
|
};
|
|
1631
|
-
const
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1654
|
+
const withOnceCache = (getter) => {
|
|
1655
|
+
return ((instance, key) => {
|
|
1656
|
+
const cache = instance.oncePropsCache || (instance.oncePropsCache = {});
|
|
1657
|
+
if (!(key in cache)) {
|
|
1658
|
+
pauseTracking();
|
|
1659
|
+
try {
|
|
1660
|
+
cache[key] = getter(instance, key);
|
|
1661
|
+
} finally {
|
|
1662
|
+
resetTracking();
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
return cache[key];
|
|
1666
|
+
});
|
|
1667
|
+
};
|
|
1668
|
+
const getOnceProp = withOnceCache(getProp);
|
|
1637
1669
|
const propsHandlers = propsOptions ? {
|
|
1638
|
-
get: (target, key) =>
|
|
1670
|
+
get: (target, key) => (once ? getOnceProp : getProp)(target, key),
|
|
1639
1671
|
has: (_, key) => isProp(key),
|
|
1640
1672
|
ownKeys: () => Object.keys(propsOptions),
|
|
1641
1673
|
getOwnPropertyDescriptor(target, key) {
|
|
@@ -1643,7 +1675,7 @@ function getPropsProxyHandlers(comp, once) {
|
|
|
1643
1675
|
return {
|
|
1644
1676
|
configurable: true,
|
|
1645
1677
|
enumerable: true,
|
|
1646
|
-
get: () =>
|
|
1678
|
+
get: () => (once ? getOnceProp : getProp)(target, key)
|
|
1647
1679
|
};
|
|
1648
1680
|
}
|
|
1649
1681
|
}
|
|
@@ -1666,14 +1698,11 @@ function getPropsProxyHandlers(comp, once) {
|
|
|
1666
1698
|
return false;
|
|
1667
1699
|
}
|
|
1668
1700
|
};
|
|
1669
|
-
const
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
resetTracking();
|
|
1673
|
-
return value;
|
|
1674
|
-
} : getAttr;
|
|
1701
|
+
const getOnceAttr = withOnceCache(
|
|
1702
|
+
(instance, key) => getAttr(instance.rawProps, key)
|
|
1703
|
+
);
|
|
1675
1704
|
const attrsHandlers = {
|
|
1676
|
-
get: (target, key) =>
|
|
1705
|
+
get: (target, key) => once ? getOnceAttr(target, key) : getAttr(target.rawProps, key),
|
|
1677
1706
|
has: (target, key) => hasAttr(target.rawProps, key),
|
|
1678
1707
|
ownKeys: (target) => getKeysFromRawProps(target.rawProps).filter(isAttr),
|
|
1679
1708
|
getOwnPropertyDescriptor(target, key) {
|
|
@@ -1681,7 +1710,7 @@ function getPropsProxyHandlers(comp, once) {
|
|
|
1681
1710
|
return {
|
|
1682
1711
|
configurable: true,
|
|
1683
1712
|
enumerable: true,
|
|
1684
|
-
get: () =>
|
|
1713
|
+
get: () => once ? getOnceAttr(target, key) : getAttr(target.rawProps, key)
|
|
1685
1714
|
};
|
|
1686
1715
|
}
|
|
1687
1716
|
}
|
|
@@ -1704,9 +1733,9 @@ function getAttrFromRawProps(rawProps, key) {
|
|
|
1704
1733
|
while (i--) {
|
|
1705
1734
|
source = dynamicSources[i];
|
|
1706
1735
|
isDynamic = isFunction(source);
|
|
1707
|
-
source = isDynamic ? source
|
|
1736
|
+
source = isDynamic ? resolveFunctionSource(source) : source;
|
|
1708
1737
|
if (source && hasOwn(source, key)) {
|
|
1709
|
-
const value = isDynamic ? source[key] : source[key]
|
|
1738
|
+
const value = isDynamic ? source[key] : resolveFunctionSource(source[key]);
|
|
1710
1739
|
if (merged) {
|
|
1711
1740
|
merged.push(value);
|
|
1712
1741
|
} else {
|
|
@@ -1751,7 +1780,9 @@ function getKeysFromRawProps(rawProps) {
|
|
|
1751
1780
|
let i = dynamicSources.length;
|
|
1752
1781
|
let source;
|
|
1753
1782
|
while (i--) {
|
|
1754
|
-
source =
|
|
1783
|
+
source = isFunction(dynamicSources[i]) ? resolveFunctionSource(
|
|
1784
|
+
dynamicSources[i]
|
|
1785
|
+
) : dynamicSources[i];
|
|
1755
1786
|
for (const key in source) {
|
|
1756
1787
|
keys.push(key);
|
|
1757
1788
|
}
|
|
@@ -1817,9 +1848,9 @@ function resolveDynamicProps(props) {
|
|
|
1817
1848
|
if (props.$) {
|
|
1818
1849
|
for (const source of props.$) {
|
|
1819
1850
|
const isDynamic = isFunction(source);
|
|
1820
|
-
const resolved = isDynamic ? source
|
|
1851
|
+
const resolved = isDynamic ? resolveFunctionSource(source) : source;
|
|
1821
1852
|
for (const key in resolved) {
|
|
1822
|
-
const value = isDynamic ? resolved[key] :
|
|
1853
|
+
const value = isDynamic ? resolved[key] : resolveFunctionSource(source[key]);
|
|
1823
1854
|
if (key === "class" || key === "style") {
|
|
1824
1855
|
const existing = mergedRawProps[key];
|
|
1825
1856
|
if (isArray(existing)) {
|
|
@@ -1891,7 +1922,7 @@ const dynamicSlotsProxyHandlers = {
|
|
|
1891
1922
|
keys = keys.filter((k) => k !== "$");
|
|
1892
1923
|
for (const source of dynamicSources) {
|
|
1893
1924
|
if (isFunction(source)) {
|
|
1894
|
-
const slot = source
|
|
1925
|
+
const slot = resolveFunctionSource(source);
|
|
1895
1926
|
if (isArray(slot)) {
|
|
1896
1927
|
for (const s of slot) keys.push(String(s.name));
|
|
1897
1928
|
} else {
|
|
@@ -1916,7 +1947,7 @@ function getSlot(target, key) {
|
|
|
1916
1947
|
while (i--) {
|
|
1917
1948
|
source = dynamicSources[i];
|
|
1918
1949
|
if (isFunction(source)) {
|
|
1919
|
-
const slot = source
|
|
1950
|
+
const slot = resolveFunctionSource(source);
|
|
1920
1951
|
if (slot) {
|
|
1921
1952
|
if (isArray(slot)) {
|
|
1922
1953
|
for (const s of slot) {
|
|
@@ -2068,7 +2099,7 @@ class RenderEffect extends ReactiveEffect {
|
|
|
2068
2099
|
this.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
|
|
2069
2100
|
this.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
|
|
2070
2101
|
}
|
|
2071
|
-
if (
|
|
2102
|
+
if (instance.type.ce) {
|
|
2072
2103
|
(instance.renderEffects || (instance.renderEffects = [])).push(this);
|
|
2073
2104
|
}
|
|
2074
2105
|
job.i = instance;
|
|
@@ -2120,61 +2151,48 @@ const decorate$1 = (t) => {
|
|
|
2120
2151
|
t.__vapor = true;
|
|
2121
2152
|
return t;
|
|
2122
2153
|
};
|
|
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);
|
|
2154
|
+
const VaporTransition = /* @__PURE__ */ decorate$1((props, { slots }) => {
|
|
2155
|
+
let resetDisplay;
|
|
2156
|
+
if (isHydrating && currentHydrationNode && isTemplateNode(currentHydrationNode)) {
|
|
2157
|
+
const {
|
|
2158
|
+
content: { firstChild },
|
|
2159
|
+
parentNode
|
|
2160
|
+
} = currentHydrationNode;
|
|
2161
|
+
if (firstChild) {
|
|
2162
|
+
if (firstChild instanceof HTMLElement || firstChild instanceof SVGElement) {
|
|
2163
|
+
const originalDisplay = firstChild.style.display;
|
|
2164
|
+
firstChild.style.display = "none";
|
|
2165
|
+
resetDisplay = () => firstChild.style.display = originalDisplay;
|
|
2139
2166
|
}
|
|
2167
|
+
parentNode.replaceChild(firstChild, currentHydrationNode);
|
|
2168
|
+
setCurrentHydrationNode(firstChild);
|
|
2140
2169
|
}
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
if (child) {
|
|
2156
|
-
child.$transition.props = resolvedProps;
|
|
2157
|
-
applyTransitionHooks(child, child.$transition, true);
|
|
2158
|
-
}
|
|
2159
|
-
}
|
|
2160
|
-
} else {
|
|
2161
|
-
isMounted = true;
|
|
2170
|
+
}
|
|
2171
|
+
const children = slots.default && slots.default();
|
|
2172
|
+
if (!children) return [];
|
|
2173
|
+
const instance = currentInstance;
|
|
2174
|
+
const { mode } = props;
|
|
2175
|
+
checkTransitionMode(mode);
|
|
2176
|
+
let resolvedProps;
|
|
2177
|
+
renderEffect(() => resolvedProps = resolveTransitionProps(props));
|
|
2178
|
+
const hooks = applyTransitionHooks(children, {
|
|
2179
|
+
state: useTransitionState(),
|
|
2180
|
+
// use proxy to keep props reference stable
|
|
2181
|
+
props: new Proxy({}, {
|
|
2182
|
+
get(_, key) {
|
|
2183
|
+
return resolvedProps[key];
|
|
2162
2184
|
}
|
|
2163
|
-
})
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
hooks.beforeEnter(child);
|
|
2172
|
-
resetDisplay();
|
|
2173
|
-
queuePostFlushCb(() => hooks.enter(child));
|
|
2174
|
-
}
|
|
2175
|
-
return children;
|
|
2185
|
+
}),
|
|
2186
|
+
instance
|
|
2187
|
+
});
|
|
2188
|
+
if (resetDisplay && resolvedProps.appear) {
|
|
2189
|
+
const child = findTransitionBlock(children);
|
|
2190
|
+
hooks.beforeEnter(child);
|
|
2191
|
+
resetDisplay();
|
|
2192
|
+
queuePostFlushCb(() => hooks.enter(child));
|
|
2176
2193
|
}
|
|
2177
|
-
|
|
2194
|
+
return children;
|
|
2195
|
+
});
|
|
2178
2196
|
const getTransitionHooksContext = (key, props, state, instance, postClone) => {
|
|
2179
2197
|
const { leavingNodes } = state;
|
|
2180
2198
|
const context = {
|
|
@@ -2226,7 +2244,7 @@ function resolveTransitionHooks(block, props, state, instance, postClone) {
|
|
|
2226
2244
|
hooks.instance = instance;
|
|
2227
2245
|
return hooks;
|
|
2228
2246
|
}
|
|
2229
|
-
function applyTransitionHooks(block, hooks
|
|
2247
|
+
function applyTransitionHooks(block, hooks) {
|
|
2230
2248
|
if (isArray(block)) {
|
|
2231
2249
|
block = block.filter((b) => !(b instanceof Comment));
|
|
2232
2250
|
if (block.length === 1) {
|
|
@@ -2235,10 +2253,13 @@ function applyTransitionHooks(block, hooks, isResolved = false) {
|
|
|
2235
2253
|
return hooks;
|
|
2236
2254
|
}
|
|
2237
2255
|
}
|
|
2238
|
-
const
|
|
2239
|
-
const child =
|
|
2256
|
+
const fragments = [];
|
|
2257
|
+
const child = findTransitionBlock(block, (frag) => fragments.push(frag));
|
|
2240
2258
|
if (!child) {
|
|
2241
|
-
|
|
2259
|
+
fragments.forEach((f) => f.$transition = hooks);
|
|
2260
|
+
if (!!(process.env.NODE_ENV !== "production") && fragments.length === 0) {
|
|
2261
|
+
warn("Transition component has no valid child element");
|
|
2262
|
+
}
|
|
2242
2263
|
return hooks;
|
|
2243
2264
|
}
|
|
2244
2265
|
const { props, instance, state, delayedLeave } = hooks;
|
|
@@ -2251,7 +2272,7 @@ function applyTransitionHooks(block, hooks, isResolved = false) {
|
|
|
2251
2272
|
);
|
|
2252
2273
|
resolvedHooks.delayedLeave = delayedLeave;
|
|
2253
2274
|
child.$transition = resolvedHooks;
|
|
2254
|
-
|
|
2275
|
+
fragments.forEach((f) => f.$transition = resolvedHooks);
|
|
2255
2276
|
return resolvedHooks;
|
|
2256
2277
|
}
|
|
2257
2278
|
function applyTransitionLeaveHooks(block, enterHooks, afterLeaveCb) {
|
|
@@ -2291,7 +2312,7 @@ function applyTransitionLeaveHooks(block, enterHooks, afterLeaveCb) {
|
|
|
2291
2312
|
};
|
|
2292
2313
|
}
|
|
2293
2314
|
}
|
|
2294
|
-
function findTransitionBlock(block,
|
|
2315
|
+
function findTransitionBlock(block, onFragment) {
|
|
2295
2316
|
let child;
|
|
2296
2317
|
if (block instanceof Node) {
|
|
2297
2318
|
if (block instanceof Element) child = block;
|
|
@@ -2300,15 +2321,14 @@ function findTransitionBlock(block, inFragment = false) {
|
|
|
2300
2321
|
child = block;
|
|
2301
2322
|
} else {
|
|
2302
2323
|
if (getComponentName(block.type) === displayName) return void 0;
|
|
2303
|
-
child = findTransitionBlock(block.block,
|
|
2324
|
+
child = findTransitionBlock(block.block, onFragment);
|
|
2304
2325
|
if (child && child.$key === void 0) child.$key = block.uid;
|
|
2305
2326
|
}
|
|
2306
2327
|
} else if (isArray(block)) {
|
|
2307
2328
|
let hasFound = false;
|
|
2308
2329
|
for (const c of block) {
|
|
2309
2330
|
if (c instanceof Comment) continue;
|
|
2310
|
-
|
|
2311
|
-
const item = findTransitionBlock(c, inFragment);
|
|
2331
|
+
const item = findTransitionBlock(c, onFragment);
|
|
2312
2332
|
if (!!(process.env.NODE_ENV !== "production") && hasFound) {
|
|
2313
2333
|
warn(
|
|
2314
2334
|
"<transition> can only be used on a single element or component. Use <transition-group> for lists."
|
|
@@ -2320,16 +2340,13 @@ function findTransitionBlock(block, inFragment = false) {
|
|
|
2320
2340
|
if (!!!(process.env.NODE_ENV !== "production")) break;
|
|
2321
2341
|
}
|
|
2322
2342
|
} else if (isFragment(block)) {
|
|
2323
|
-
inFragment = true;
|
|
2324
2343
|
if (block.insert) {
|
|
2325
2344
|
child = block;
|
|
2326
2345
|
} else {
|
|
2327
|
-
|
|
2346
|
+
if (onFragment) onFragment(block);
|
|
2347
|
+
child = findTransitionBlock(block.nodes, onFragment);
|
|
2328
2348
|
}
|
|
2329
2349
|
}
|
|
2330
|
-
if (!!(process.env.NODE_ENV !== "production") && !child && !inFragment) {
|
|
2331
|
-
warn("Transition component has no valid child element");
|
|
2332
|
-
}
|
|
2333
2350
|
return child;
|
|
2334
2351
|
}
|
|
2335
2352
|
function setTransitionHooksOnFragment(block, hooks) {
|
|
@@ -2407,6 +2424,7 @@ class DynamicFragment extends VaporFragment {
|
|
|
2407
2424
|
);
|
|
2408
2425
|
});
|
|
2409
2426
|
};
|
|
2427
|
+
this.slotOwner = currentSlotOwner;
|
|
2410
2428
|
if (isHydrating) {
|
|
2411
2429
|
this.anchorLabel = anchorLabel;
|
|
2412
2430
|
locateHydrationNode();
|
|
@@ -2420,28 +2438,41 @@ class DynamicFragment extends VaporFragment {
|
|
|
2420
2438
|
if (isHydrating) this.hydrate(true);
|
|
2421
2439
|
return;
|
|
2422
2440
|
}
|
|
2441
|
+
const transition = this.$transition;
|
|
2442
|
+
if (transition && transition.state.isLeaving) {
|
|
2443
|
+
this.current = key;
|
|
2444
|
+
this.pending = { render, key };
|
|
2445
|
+
return;
|
|
2446
|
+
}
|
|
2447
|
+
const prevKey = this.current;
|
|
2423
2448
|
this.current = key;
|
|
2424
2449
|
const instance = currentInstance;
|
|
2425
2450
|
const prevSub = setActiveSub();
|
|
2426
2451
|
const parent = isHydrating ? null : this.anchor.parentNode;
|
|
2427
|
-
const transition = this.$transition;
|
|
2428
2452
|
if (this.scope) {
|
|
2429
2453
|
let preserveScope = false;
|
|
2430
|
-
if (this.
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2454
|
+
if (this.onBeforeTeardown) {
|
|
2455
|
+
for (const teardown of this.onBeforeTeardown) {
|
|
2456
|
+
if (teardown(prevKey, this.nodes, this.scope)) {
|
|
2457
|
+
preserveScope = true;
|
|
2458
|
+
}
|
|
2459
|
+
}
|
|
2434
2460
|
}
|
|
2435
2461
|
if (!preserveScope) {
|
|
2436
2462
|
this.scope.stop();
|
|
2437
2463
|
}
|
|
2438
2464
|
const mode = transition && transition.mode;
|
|
2439
2465
|
if (mode) {
|
|
2440
|
-
applyTransitionLeaveHooks(
|
|
2441
|
-
this.
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2466
|
+
applyTransitionLeaveHooks(this.nodes, transition, () => {
|
|
2467
|
+
const pending = this.pending;
|
|
2468
|
+
if (pending) {
|
|
2469
|
+
this.pending = void 0;
|
|
2470
|
+
this.current = pending.key;
|
|
2471
|
+
this.renderBranch(pending.render, transition, parent, instance);
|
|
2472
|
+
} else {
|
|
2473
|
+
this.renderBranch(render, transition, parent, instance);
|
|
2474
|
+
}
|
|
2475
|
+
});
|
|
2445
2476
|
parent && remove(this.nodes, parent);
|
|
2446
2477
|
if (mode === "out-in") {
|
|
2447
2478
|
setActiveSub(prevSub);
|
|
@@ -2451,18 +2482,28 @@ class DynamicFragment extends VaporFragment {
|
|
|
2451
2482
|
parent && remove(this.nodes, parent);
|
|
2452
2483
|
}
|
|
2453
2484
|
}
|
|
2454
|
-
this.
|
|
2485
|
+
this.renderBranch(render, transition, parent, instance);
|
|
2455
2486
|
if (this.fallback) {
|
|
2456
|
-
|
|
2457
|
-
if (
|
|
2458
|
-
setFragmentFallback(
|
|
2487
|
+
let invalidFragment = null;
|
|
2488
|
+
if (isFragment(this.nodes)) {
|
|
2489
|
+
setFragmentFallback(
|
|
2490
|
+
this.nodes,
|
|
2491
|
+
this.fallback,
|
|
2492
|
+
(frag) => {
|
|
2493
|
+
if (!isValidBlock(frag.nodes)) {
|
|
2494
|
+
invalidFragment = frag;
|
|
2495
|
+
}
|
|
2496
|
+
}
|
|
2497
|
+
);
|
|
2498
|
+
}
|
|
2499
|
+
if (!invalidFragment && !isValidBlock(this.nodes)) {
|
|
2500
|
+
invalidFragment = this;
|
|
2459
2501
|
}
|
|
2460
|
-
const invalidFragment = findInvalidFragment(this);
|
|
2461
2502
|
if (invalidFragment) {
|
|
2462
2503
|
parent && remove(this.nodes, parent);
|
|
2463
2504
|
const scope = this.scope || (this.scope = new EffectScope());
|
|
2464
2505
|
scope.run(() => {
|
|
2465
|
-
if (
|
|
2506
|
+
if (invalidFragment !== this) {
|
|
2466
2507
|
renderFragmentFallback(invalidFragment);
|
|
2467
2508
|
} else {
|
|
2468
2509
|
this.nodes = this.fallback() || [];
|
|
@@ -2474,7 +2515,7 @@ class DynamicFragment extends VaporFragment {
|
|
|
2474
2515
|
setActiveSub(prevSub);
|
|
2475
2516
|
if (isHydrating) this.hydrate();
|
|
2476
2517
|
}
|
|
2477
|
-
|
|
2518
|
+
renderBranch(render, transition, parent, instance) {
|
|
2478
2519
|
if (render) {
|
|
2479
2520
|
const scope = this.getScope && this.getScope(this.current);
|
|
2480
2521
|
if (scope) {
|
|
@@ -2482,24 +2523,27 @@ class DynamicFragment extends VaporFragment {
|
|
|
2482
2523
|
} else {
|
|
2483
2524
|
this.scope = new EffectScope();
|
|
2484
2525
|
}
|
|
2485
|
-
|
|
2486
|
-
|
|
2526
|
+
const prevOwner = setCurrentSlotOwner(this.slotOwner);
|
|
2527
|
+
const prev = parent && instance ? setCurrentInstance(instance) : void 0;
|
|
2487
2528
|
this.nodes = this.scope.run(render) || [];
|
|
2488
|
-
if (
|
|
2529
|
+
if (prev !== void 0) setCurrentInstance(...prev);
|
|
2530
|
+
setCurrentSlotOwner(prevOwner);
|
|
2489
2531
|
if (transition) {
|
|
2490
2532
|
this.$transition = applyTransitionHooks(this.nodes, transition);
|
|
2491
2533
|
}
|
|
2492
|
-
if (this.
|
|
2493
|
-
this.
|
|
2534
|
+
if (this.onBeforeMount) {
|
|
2535
|
+
this.onBeforeMount.forEach(
|
|
2494
2536
|
(hook) => hook(this.current, this.nodes, this.scope)
|
|
2495
2537
|
);
|
|
2496
2538
|
}
|
|
2497
2539
|
if (parent) {
|
|
2498
2540
|
if (this.attrs) {
|
|
2499
2541
|
if (this.nodes instanceof Element) {
|
|
2500
|
-
|
|
2501
|
-
(
|
|
2502
|
-
|
|
2542
|
+
this.scope.run(() => {
|
|
2543
|
+
renderEffect(
|
|
2544
|
+
() => applyFallthroughProps(this.nodes, this.attrs)
|
|
2545
|
+
);
|
|
2546
|
+
});
|
|
2503
2547
|
} else if (!!(process.env.NODE_ENV !== "production") && // preventing attrs fallthrough on slots
|
|
2504
2548
|
// consistent with VDOM slots behavior
|
|
2505
2549
|
(this.anchorLabel === "slot" || isArray(this.nodes) && this.nodes.length)) {
|
|
@@ -2507,8 +2551,8 @@ class DynamicFragment extends VaporFragment {
|
|
|
2507
2551
|
}
|
|
2508
2552
|
}
|
|
2509
2553
|
insert(this.nodes, parent, this.anchor);
|
|
2510
|
-
if (this.
|
|
2511
|
-
this.
|
|
2554
|
+
if (this.onUpdated) {
|
|
2555
|
+
this.onUpdated.forEach((hook) => hook(this.nodes));
|
|
2512
2556
|
}
|
|
2513
2557
|
}
|
|
2514
2558
|
} else {
|
|
@@ -2517,7 +2561,7 @@ class DynamicFragment extends VaporFragment {
|
|
|
2517
2561
|
}
|
|
2518
2562
|
}
|
|
2519
2563
|
}
|
|
2520
|
-
function setFragmentFallback(fragment, fallback) {
|
|
2564
|
+
function setFragmentFallback(fragment, fallback, onFragment) {
|
|
2521
2565
|
if (fragment.fallback) {
|
|
2522
2566
|
const originalFallback = fragment.fallback;
|
|
2523
2567
|
fragment.fallback = () => {
|
|
@@ -2530,8 +2574,9 @@ function setFragmentFallback(fragment, fallback) {
|
|
|
2530
2574
|
} else {
|
|
2531
2575
|
fragment.fallback = fallback;
|
|
2532
2576
|
}
|
|
2577
|
+
if (onFragment) onFragment(fragment);
|
|
2533
2578
|
if (isFragment(fragment.nodes)) {
|
|
2534
|
-
setFragmentFallback(fragment.nodes, fragment.fallback);
|
|
2579
|
+
setFragmentFallback(fragment.nodes, fragment.fallback, onFragment);
|
|
2535
2580
|
}
|
|
2536
2581
|
}
|
|
2537
2582
|
function renderFragmentFallback(fragment) {
|
|
@@ -2541,10 +2586,6 @@ function renderFragmentFallback(fragment) {
|
|
|
2541
2586
|
fragment.update(fragment.fallback);
|
|
2542
2587
|
} else ;
|
|
2543
2588
|
}
|
|
2544
|
-
function findInvalidFragment(fragment) {
|
|
2545
|
-
if (isValidBlock(fragment.nodes)) return null;
|
|
2546
|
-
return isFragment(fragment.nodes) ? findInvalidFragment(fragment.nodes) || fragment : fragment;
|
|
2547
|
-
}
|
|
2548
2589
|
function isFragment(val) {
|
|
2549
2590
|
return val instanceof VaporFragment;
|
|
2550
2591
|
}
|
|
@@ -2664,11 +2705,13 @@ class TeleportFragment extends VaporFragment {
|
|
|
2664
2705
|
const nodes = this.nodes;
|
|
2665
2706
|
if (this.parentComponent && this.parentComponent.ut) {
|
|
2666
2707
|
if (isFragment(nodes)) {
|
|
2667
|
-
(nodes.
|
|
2708
|
+
(nodes.onUpdated || (nodes.onUpdated = [])).push(
|
|
2709
|
+
() => updateCssVars(this)
|
|
2710
|
+
);
|
|
2668
2711
|
} else if (isArray(nodes)) {
|
|
2669
2712
|
nodes.forEach((node) => {
|
|
2670
2713
|
if (isFragment(node)) {
|
|
2671
|
-
(node.
|
|
2714
|
+
(node.onUpdated || (node.onUpdated = [])).push(
|
|
2672
2715
|
() => updateCssVars(this)
|
|
2673
2716
|
);
|
|
2674
2717
|
}
|
|
@@ -2856,6 +2899,79 @@ function insert(block, parent, anchor = null, parentSuspense) {
|
|
|
2856
2899
|
}
|
|
2857
2900
|
}
|
|
2858
2901
|
}
|
|
2902
|
+
function move(block, parent, anchor = null, moveType = 1, parentComponent, parentSuspense) {
|
|
2903
|
+
anchor = anchor === 0 ? parent.$fc || _child(parent) : anchor;
|
|
2904
|
+
if (block instanceof Node) {
|
|
2905
|
+
if (block instanceof Element && block.$transition && !block.$transition.disabled && moveType !== 2) {
|
|
2906
|
+
if (moveType === 0) {
|
|
2907
|
+
performTransitionEnter(
|
|
2908
|
+
block,
|
|
2909
|
+
block.$transition,
|
|
2910
|
+
() => parent.insertBefore(block, anchor),
|
|
2911
|
+
parentSuspense,
|
|
2912
|
+
true
|
|
2913
|
+
);
|
|
2914
|
+
} else {
|
|
2915
|
+
performTransitionLeave(
|
|
2916
|
+
block,
|
|
2917
|
+
block.$transition,
|
|
2918
|
+
() => {
|
|
2919
|
+
if (moveType === 1 && parentComponent && parentComponent.isUnmounted) {
|
|
2920
|
+
block.remove();
|
|
2921
|
+
} else {
|
|
2922
|
+
parent.insertBefore(block, anchor);
|
|
2923
|
+
}
|
|
2924
|
+
},
|
|
2925
|
+
parentSuspense,
|
|
2926
|
+
true
|
|
2927
|
+
);
|
|
2928
|
+
}
|
|
2929
|
+
} else {
|
|
2930
|
+
parent.insertBefore(block, anchor);
|
|
2931
|
+
}
|
|
2932
|
+
} else if (isVaporComponent(block)) {
|
|
2933
|
+
if (block.isMounted) {
|
|
2934
|
+
move(
|
|
2935
|
+
block.block,
|
|
2936
|
+
parent,
|
|
2937
|
+
anchor,
|
|
2938
|
+
moveType,
|
|
2939
|
+
parentComponent,
|
|
2940
|
+
parentSuspense
|
|
2941
|
+
);
|
|
2942
|
+
} else {
|
|
2943
|
+
mountComponent(block, parent, anchor);
|
|
2944
|
+
}
|
|
2945
|
+
} else if (isArray(block)) {
|
|
2946
|
+
for (const b of block) {
|
|
2947
|
+
move(b, parent, anchor, moveType, parentComponent, parentSuspense);
|
|
2948
|
+
}
|
|
2949
|
+
} else {
|
|
2950
|
+
if (block.anchor) {
|
|
2951
|
+
move(
|
|
2952
|
+
block.anchor,
|
|
2953
|
+
parent,
|
|
2954
|
+
anchor,
|
|
2955
|
+
moveType,
|
|
2956
|
+
parentComponent,
|
|
2957
|
+
parentSuspense
|
|
2958
|
+
);
|
|
2959
|
+
anchor = block.anchor;
|
|
2960
|
+
}
|
|
2961
|
+
if (block.insert) {
|
|
2962
|
+
block.insert(parent, anchor, block.$transition);
|
|
2963
|
+
} else {
|
|
2964
|
+
move(
|
|
2965
|
+
block.nodes,
|
|
2966
|
+
parent,
|
|
2967
|
+
anchor,
|
|
2968
|
+
moveType,
|
|
2969
|
+
parentComponent,
|
|
2970
|
+
parentSuspense
|
|
2971
|
+
);
|
|
2972
|
+
}
|
|
2973
|
+
}
|
|
2974
|
+
}
|
|
2859
2975
|
function prepend(parent, ...blocks) {
|
|
2860
2976
|
let i = blocks.length;
|
|
2861
2977
|
while (i--) insert(blocks[i], parent, 0);
|
|
@@ -2984,12 +3100,9 @@ function hmrRerender(instance) {
|
|
|
2984
3100
|
const normalized = normalizeBlock(instance.block);
|
|
2985
3101
|
const parent = normalized[0].parentNode;
|
|
2986
3102
|
const anchor = normalized[normalized.length - 1].nextSibling;
|
|
3103
|
+
instance.scope.reset();
|
|
2987
3104
|
remove(instance.block, parent);
|
|
2988
3105
|
const prev = setCurrentInstance(instance);
|
|
2989
|
-
if (instance.renderEffects) {
|
|
2990
|
-
instance.renderEffects.forEach((e) => e.stop());
|
|
2991
|
-
instance.renderEffects = [];
|
|
2992
|
-
}
|
|
2993
3106
|
pushWarningContext(instance);
|
|
2994
3107
|
devRender(instance);
|
|
2995
3108
|
popWarningContext();
|
|
@@ -3199,7 +3312,7 @@ function setupComponent(instance, component) {
|
|
|
3199
3312
|
}
|
|
3200
3313
|
}
|
|
3201
3314
|
} else {
|
|
3202
|
-
handleSetupResult(setupResult, component, instance
|
|
3315
|
+
handleSetupResult(setupResult, component, instance);
|
|
3203
3316
|
}
|
|
3204
3317
|
setActiveSub(prevSub);
|
|
3205
3318
|
setCurrentInstance(...prevInstance);
|
|
@@ -3396,12 +3509,7 @@ function mountComponent(instance, parent, anchor) {
|
|
|
3396
3509
|
if (instance.suspense && instance.asyncDep && !instance.asyncResolved) {
|
|
3397
3510
|
const component = instance.type;
|
|
3398
3511
|
instance.suspense.registerDep(instance, (setupResult) => {
|
|
3399
|
-
handleSetupResult(
|
|
3400
|
-
setupResult,
|
|
3401
|
-
component,
|
|
3402
|
-
instance,
|
|
3403
|
-
isFunction(component) ? component : component.setup
|
|
3404
|
-
);
|
|
3512
|
+
handleSetupResult(setupResult, component, instance);
|
|
3405
3513
|
mountComponent(instance, parent, anchor);
|
|
3406
3514
|
});
|
|
3407
3515
|
return;
|
|
@@ -3438,7 +3546,7 @@ function unmountComponent(instance, parentNode) {
|
|
|
3438
3546
|
return;
|
|
3439
3547
|
}
|
|
3440
3548
|
if (instance.isMounted && !instance.isUnmounted) {
|
|
3441
|
-
if (!!(process.env.NODE_ENV !== "production")
|
|
3549
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
3442
3550
|
unregisterHMR(instance);
|
|
3443
3551
|
}
|
|
3444
3552
|
if (instance.bum) {
|
|
@@ -3498,7 +3606,7 @@ function getRootElement(block, onDynamicFragment, recurse = true) {
|
|
|
3498
3606
|
function isVaporTransition(component) {
|
|
3499
3607
|
return getComponentName(component) === "VaporTransition";
|
|
3500
3608
|
}
|
|
3501
|
-
function handleSetupResult(setupResult, component, instance
|
|
3609
|
+
function handleSetupResult(setupResult, component, instance) {
|
|
3502
3610
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
3503
3611
|
pushWarningContext(instance);
|
|
3504
3612
|
}
|
|
@@ -3522,7 +3630,7 @@ function handleSetupResult(setupResult, component, instance, setupFn) {
|
|
|
3522
3630
|
devRender(instance);
|
|
3523
3631
|
}
|
|
3524
3632
|
} else {
|
|
3525
|
-
if (
|
|
3633
|
+
if (setupResult === EMPTY_OBJ && component.render) {
|
|
3526
3634
|
instance.block = callWithErrorHandling(
|
|
3527
3635
|
component.render,
|
|
3528
3636
|
instance,
|
|
@@ -3941,9 +4049,7 @@ function createKeyedFragment(key, render) {
|
|
|
3941
4049
|
const _isLastInsertion = isLastInsertion;
|
|
3942
4050
|
if (!isHydrating) resetInsertionState();
|
|
3943
4051
|
const frag = !!(process.env.NODE_ENV !== "production") ? new DynamicFragment("keyed") : new DynamicFragment();
|
|
3944
|
-
renderEffect(() =>
|
|
3945
|
-
frag.update(render, key());
|
|
3946
|
-
});
|
|
4052
|
+
renderEffect(() => frag.update(render, key()));
|
|
3947
4053
|
if (!isHydrating) {
|
|
3948
4054
|
if (_insertionParent) insert(frag, _insertionParent, _insertionAnchor);
|
|
3949
4055
|
} else {
|
|
@@ -4211,7 +4317,7 @@ const createFor = (src, renderItem, getKey, flags = 0, setup) => {
|
|
|
4211
4317
|
} else {
|
|
4212
4318
|
oldBlocks = [];
|
|
4213
4319
|
}
|
|
4214
|
-
if (isMounted && frag.
|
|
4320
|
+
if (isMounted && frag.onUpdated) frag.onUpdated.forEach((m) => m());
|
|
4215
4321
|
setActiveSub(prevSub);
|
|
4216
4322
|
};
|
|
4217
4323
|
const needKey = renderItem.length > 1;
|
|
@@ -4589,13 +4695,16 @@ function createDynamicComponent(getter, rawProps, rawSlots, isSingleRoot, once)
|
|
|
4589
4695
|
const value = getter();
|
|
4590
4696
|
const appContext = currentInstance && currentInstance.appContext || emptyContext;
|
|
4591
4697
|
frag.update(
|
|
4592
|
-
() =>
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4698
|
+
() => (
|
|
4699
|
+
// Support integration with VaporRouterView/VaporRouterLink by accepting blocks
|
|
4700
|
+
isBlock(value) ? value : createComponentWithFallback(
|
|
4701
|
+
resolveDynamicComponent(value),
|
|
4702
|
+
rawProps,
|
|
4703
|
+
rawSlots,
|
|
4704
|
+
isSingleRoot,
|
|
4705
|
+
once,
|
|
4706
|
+
appContext
|
|
4707
|
+
)
|
|
4599
4708
|
),
|
|
4600
4709
|
value
|
|
4601
4710
|
);
|
|
@@ -4786,7 +4895,15 @@ const VaporTransitionGroup = decorate({
|
|
|
4786
4895
|
setup(props, { slots }) {
|
|
4787
4896
|
const instance = currentInstance;
|
|
4788
4897
|
const state = useTransitionState();
|
|
4789
|
-
|
|
4898
|
+
let cssTransitionProps = resolveTransitionProps(props);
|
|
4899
|
+
const propsProxy = new Proxy({}, {
|
|
4900
|
+
get(_, key) {
|
|
4901
|
+
return cssTransitionProps[key];
|
|
4902
|
+
}
|
|
4903
|
+
});
|
|
4904
|
+
renderEffect(() => {
|
|
4905
|
+
cssTransitionProps = resolveTransitionProps(props);
|
|
4906
|
+
});
|
|
4790
4907
|
let prevChildren;
|
|
4791
4908
|
let children;
|
|
4792
4909
|
const slottedBlock = slots.default && slots.default();
|
|
@@ -4837,7 +4954,7 @@ const VaporTransitionGroup = decorate({
|
|
|
4837
4954
|
prevChildren = [];
|
|
4838
4955
|
});
|
|
4839
4956
|
setTransitionHooksOnFragment(slottedBlock, {
|
|
4840
|
-
props:
|
|
4957
|
+
props: propsProxy,
|
|
4841
4958
|
state,
|
|
4842
4959
|
instance
|
|
4843
4960
|
});
|
|
@@ -4848,7 +4965,7 @@ const VaporTransitionGroup = decorate({
|
|
|
4848
4965
|
if (child.$key != null) {
|
|
4849
4966
|
const hooks = resolveTransitionHooks(
|
|
4850
4967
|
child,
|
|
4851
|
-
|
|
4968
|
+
propsProxy,
|
|
4852
4969
|
state,
|
|
4853
4970
|
instance
|
|
4854
4971
|
);
|
|
@@ -4916,4 +5033,4 @@ function getFirstConnectedChild(children) {
|
|
|
4916
5033
|
}
|
|
4917
5034
|
}
|
|
4918
5035
|
|
|
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 };
|
|
5036
|
+
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-
|
|
3
|
+
"version": "3.6.0-beta.1",
|
|
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-
|
|
42
|
-
"@vue/reactivity": "3.6.0-
|
|
41
|
+
"@vue/shared": "3.6.0-beta.1",
|
|
42
|
+
"@vue/reactivity": "3.6.0-beta.1"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@vue/runtime-dom": "3.6.0-
|
|
45
|
+
"@vue/runtime-dom": "3.6.0-beta.1"
|
|
46
46
|
}
|
|
47
47
|
}
|