@vue/runtime-vapor 3.6.0-beta.12 → 3.6.0-beta.14
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 +52 -79
- package/dist/runtime-vapor.esm-bundler.js +1353 -922
- package/package.json +4 -4
package/dist/runtime-vapor.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ type NodeRef = string | Ref | ((ref: Element | VaporComponentInstance, refs: Rec
|
|
|
7
7
|
type RefEl = Element | VaporComponentInstance | DynamicFragment | VaporFragment;
|
|
8
8
|
type setRefFn = (el: RefEl, ref: NodeRef, refFor?: boolean, refKey?: string) => NodeRef | undefined;
|
|
9
9
|
export declare function createTemplateRefSetter(): setRefFn;
|
|
10
|
+
export declare function setStaticTemplateRef(el: RefEl, ref: NodeRef, refFor?: boolean, refKey?: string): NodeRef | undefined;
|
|
11
|
+
export declare function setTemplateRefBinding(el: RefEl, getter: () => any, setter?: setRefFn, refFor?: boolean, refKey?: string): void;
|
|
10
12
|
//#endregion
|
|
11
13
|
//#region temp/packages/runtime-vapor/src/keepAlive.d.ts
|
|
12
14
|
export interface VaporKeepAliveContext {
|
|
@@ -25,10 +27,14 @@ export declare class VaporFragment<T extends Block = Block> implements Transitio
|
|
|
25
27
|
anchor?: Node;
|
|
26
28
|
parentComponent?: GenericComponentInstance | null;
|
|
27
29
|
validityPending?: boolean;
|
|
30
|
+
isBlockValid?: () => boolean;
|
|
28
31
|
insert?: (parent: ParentNode, anchor: Node | null, transitionHooks?: TransitionHooks) => void;
|
|
29
32
|
remove?: (parent?: ParentNode, transitionHooks?: TransitionHooks) => void;
|
|
30
|
-
hydrate
|
|
33
|
+
hydrate?(...args: any[]): void;
|
|
31
34
|
setRef?: (instance: VaporComponentInstance, ref: NodeRef, refFor: boolean, refKey: string | undefined) => void;
|
|
35
|
+
onBeforeInsert?: ((nodes: Block) => void)[];
|
|
36
|
+
onBeforeRemove?: ((scope: EffectScope$1) => boolean)[];
|
|
37
|
+
onBeforeUpdate?: (() => void)[];
|
|
32
38
|
onUpdated?: ((nodes?: Block) => void)[];
|
|
33
39
|
readonly renderInstance: GenericComponentInstance | null;
|
|
34
40
|
readonly slotOwner: VaporComponentInstance | null;
|
|
@@ -39,7 +45,7 @@ export declare class VaporFragment<T extends Block = Block> implements Transitio
|
|
|
39
45
|
}
|
|
40
46
|
declare class ForFragment extends VaporFragment<Block[]> {
|
|
41
47
|
resetListeners?: (() => void)[];
|
|
42
|
-
constructor(nodes: Block[]);
|
|
48
|
+
constructor(nodes: Block[], trackSlotBoundary: boolean);
|
|
43
49
|
onReset(fn: () => void): void;
|
|
44
50
|
}
|
|
45
51
|
export declare class DynamicFragment extends VaporFragment {
|
|
@@ -49,16 +55,17 @@ export declare class DynamicFragment extends VaporFragment {
|
|
|
49
55
|
pending?: {
|
|
50
56
|
render?: BlockFn;
|
|
51
57
|
key: any;
|
|
58
|
+
noScope: boolean;
|
|
52
59
|
};
|
|
53
60
|
anchorLabel?: string;
|
|
54
61
|
keyed?: boolean;
|
|
62
|
+
isSlot?: boolean;
|
|
55
63
|
inTransition?: boolean;
|
|
56
|
-
|
|
57
|
-
constructor(anchorLabel?: string, keyed?: boolean, locate?: boolean);
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
hydrate: (isEmpty?: boolean, isSlot?: boolean) => void;
|
|
64
|
+
hasFallthroughAttrs?: true;
|
|
65
|
+
constructor(anchorLabel?: string, keyed?: boolean, locate?: boolean, trackSlotBoundary?: boolean);
|
|
66
|
+
update(render?: BlockFn, key?: any, noScope?: boolean, shouldInsert?: boolean): void;
|
|
67
|
+
renderBranch(render: BlockFn | undefined, transition: VaporTransitionHooks | undefined, parent: ParentNode | null, key: any, noScope?: boolean, notifyUpdated?: boolean): void;
|
|
68
|
+
hydrate(isEmpty?: boolean): void;
|
|
62
69
|
}
|
|
63
70
|
interface SlotBoundaryContext {
|
|
64
71
|
parent: SlotBoundaryContext | null;
|
|
@@ -93,20 +100,20 @@ export declare function remove(block: Block, parent?: ParentNode): void;
|
|
|
93
100
|
declare const interopKey: unique symbol;
|
|
94
101
|
//#endregion
|
|
95
102
|
//#region temp/packages/runtime-vapor/src/componentProps.d.ts
|
|
96
|
-
type RawProps = Record<string,
|
|
103
|
+
type RawProps = Record<string, unknown> & {
|
|
97
104
|
$?: DynamicPropsSource[] & {
|
|
98
105
|
[interopKey]?: boolean;
|
|
99
106
|
};
|
|
100
107
|
};
|
|
101
|
-
type DynamicPropsSource = (() => Record<string, unknown>) | Record<string,
|
|
108
|
+
type DynamicPropsSource = (() => Record<string, unknown>) | Record<string, unknown>;
|
|
102
109
|
//#endregion
|
|
103
110
|
//#region temp/packages/runtime-vapor/src/renderEffect.d.ts
|
|
104
111
|
declare class RenderEffect extends ReactiveEffect {
|
|
105
|
-
render: () => void;
|
|
106
112
|
i: VaporComponentInstance | null;
|
|
107
113
|
job: SchedulerJob;
|
|
108
|
-
updateJob
|
|
109
|
-
|
|
114
|
+
updateJob?: SchedulerJob;
|
|
115
|
+
render: () => void;
|
|
116
|
+
constructor(render: () => void, noLifecycle?: boolean);
|
|
110
117
|
fn(): void;
|
|
111
118
|
notify(): void;
|
|
112
119
|
}
|
|
@@ -116,6 +123,9 @@ export declare function renderEffect(fn: () => void, noLifecycle?: boolean): voi
|
|
|
116
123
|
type RawSlots = Record<string, VaporSlot> & {
|
|
117
124
|
$?: DynamicSlotSource[];
|
|
118
125
|
};
|
|
126
|
+
type LooseRawSlots = VaporSlot | (Record<string, VaporSlot | DynamicSlotSource[]> & {
|
|
127
|
+
$?: DynamicSlotSource[];
|
|
128
|
+
});
|
|
119
129
|
type StaticSlots = Record<string, VaporSlot>;
|
|
120
130
|
export type VaporSlot = BlockFn;
|
|
121
131
|
type DynamicSlot = {
|
|
@@ -124,15 +134,7 @@ type DynamicSlot = {
|
|
|
124
134
|
};
|
|
125
135
|
type DynamicSlotFn = () => DynamicSlot | DynamicSlot[];
|
|
126
136
|
type DynamicSlotSource = StaticSlots | DynamicSlotFn;
|
|
127
|
-
|
|
128
|
-
* Wrap a slot function to track the slot owner.
|
|
129
|
-
*
|
|
130
|
-
* This ensures:
|
|
131
|
-
* 1. createSlot gets rawSlots from the correct instance (slot owner)
|
|
132
|
-
* 2. elements inherit the slot owner's scopeId
|
|
133
|
-
*/
|
|
134
|
-
export declare function withVaporCtx(fn: Function): BlockFn;
|
|
135
|
-
export declare function createSlot(name: string | (() => string), rawProps?: LooseRawProps | null, fallback?: VaporSlot, noSlotted?: boolean, once?: boolean): Block;
|
|
137
|
+
export declare function createSlot(name?: string | (() => string), rawProps?: LooseRawProps | null, fallback?: VaporSlot, flags?: number): Block;
|
|
136
138
|
//#endregion
|
|
137
139
|
//#region temp/packages/runtime-vapor/src/apiDefineComponent.d.ts
|
|
138
140
|
export type VaporPublicProps = ReservedProps & AllowedComponentProps & ComponentCustomProps;
|
|
@@ -177,45 +179,6 @@ export declare function defineVaporComponent<TypeProps, RuntimePropsOptions exte
|
|
|
177
179
|
__typeEl?: TypeBlock;
|
|
178
180
|
} & ThisType<void>): DefineVaporComponent<RuntimePropsOptions, RuntimePropsKeys, InferredProps, ResolvedEmits, RuntimeEmitsKeys, Slots, Exposed extends Block ? Record<string, any> : Exposed, TypeBlock, TypeRefs, unknown extends TypeProps ? true : false>;
|
|
179
181
|
//#endregion
|
|
180
|
-
//#region temp/packages/runtime-vapor/src/components/Teleport.d.ts
|
|
181
|
-
declare class TeleportFragment extends VaporFragment {
|
|
182
|
-
anchor?: Node;
|
|
183
|
-
private rawProps?;
|
|
184
|
-
private resolvedProps?;
|
|
185
|
-
private rawSlots?;
|
|
186
|
-
isDisabled?: boolean;
|
|
187
|
-
private isMounted;
|
|
188
|
-
private childrenInitialized;
|
|
189
|
-
private readonly ownerInstance;
|
|
190
|
-
private readonly childrenScope;
|
|
191
|
-
target?: ParentNode | null;
|
|
192
|
-
targetAnchor?: Node | null;
|
|
193
|
-
targetStart?: Node | null;
|
|
194
|
-
placeholder?: Node;
|
|
195
|
-
mountContainer?: ParentNode | null;
|
|
196
|
-
mountAnchor?: Node | null;
|
|
197
|
-
private mountToTargetJob?;
|
|
198
|
-
constructor(props: LooseRawProps, slots?: LooseRawSlots | null);
|
|
199
|
-
get parent(): ParentNode | null;
|
|
200
|
-
private initChildren;
|
|
201
|
-
private ensureChildrenInitialized;
|
|
202
|
-
private registerUpdateCssVars;
|
|
203
|
-
private bindChildren;
|
|
204
|
-
private handleChildrenUpdate;
|
|
205
|
-
private mount;
|
|
206
|
-
private mountToTarget;
|
|
207
|
-
private clearMainViewChildren;
|
|
208
|
-
private handlePropsUpdate;
|
|
209
|
-
insert: (container: ParentNode, anchor: Node | null) => void;
|
|
210
|
-
dispose: () => void;
|
|
211
|
-
remove: (_parent?: ParentNode) => void;
|
|
212
|
-
private hydrateTargetAnchors;
|
|
213
|
-
private hydrateDisabledTeleport;
|
|
214
|
-
private mountChildren;
|
|
215
|
-
hydrate: () => void;
|
|
216
|
-
}
|
|
217
|
-
export declare const VaporTeleport: DefineVaporSetupFnComponent<TeleportProps>;
|
|
218
|
-
//#endregion
|
|
219
182
|
//#region temp/packages/runtime-vapor/src/component.d.ts
|
|
220
183
|
export type VaporComponent = FunctionalVaporComponent<any> | VaporComponentOptions | DefineVaporComponent;
|
|
221
184
|
export type FunctionalVaporComponent<Props = {}, Emits extends EmitsOptions = {}, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>> = ((props: Props & EmitsToProps<Emits>, ctx: {
|
|
@@ -258,13 +221,10 @@ interface SharedInternalOptions {
|
|
|
258
221
|
*/
|
|
259
222
|
__emitsOptions?: ObjectEmitsOptions;
|
|
260
223
|
}
|
|
261
|
-
type LooseRawProps = Record<string,
|
|
224
|
+
type LooseRawProps = Record<string, unknown> & {
|
|
262
225
|
$?: DynamicPropsSource[];
|
|
263
226
|
};
|
|
264
|
-
|
|
265
|
-
$?: DynamicSlotSource[];
|
|
266
|
-
};
|
|
267
|
-
export declare function createComponent(component: VaporComponent, rawProps?: LooseRawProps | null, rawSlots?: LooseRawSlots | null, isSingleRoot?: boolean, once?: boolean, appContext?: GenericAppContext, managedMount?: boolean): VaporComponentInstance;
|
|
227
|
+
export declare function createComponent(component: VaporComponent, rawProps?: LooseRawProps | null, rawSlots?: LooseRawSlots | null, isSingleRoot?: boolean, once?: boolean, appContext?: GenericAppContext, managedMount?: boolean, ce?: (instance: VaporComponentInstance) => void): VaporComponentInstance;
|
|
268
228
|
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 {
|
|
269
229
|
vapor: true;
|
|
270
230
|
uid: number;
|
|
@@ -297,11 +257,11 @@ export declare class VaporComponentInstance<Props extends Record<string, any> =
|
|
|
297
257
|
asyncResolved: boolean;
|
|
298
258
|
restoreAsyncContext?: () => void | (() => void);
|
|
299
259
|
deferredHydrationBoundary?: () => void;
|
|
300
|
-
renderEffects?: RenderEffect[];
|
|
301
260
|
hasFallthrough: boolean;
|
|
302
261
|
shapeFlag?: number;
|
|
303
262
|
$key?: any;
|
|
304
263
|
oncePropsCache?: Record<string | symbol, any>;
|
|
264
|
+
isOnce: boolean;
|
|
305
265
|
isMounted: boolean;
|
|
306
266
|
isUnmounted: boolean;
|
|
307
267
|
isDeactivated: boolean;
|
|
@@ -324,10 +284,10 @@ export declare class VaporComponentInstance<Props extends Record<string, any> =
|
|
|
324
284
|
devtoolsRawSetupState?: any;
|
|
325
285
|
hmrRerender?: () => void;
|
|
326
286
|
hmrReload?: (newComp: VaporComponent) => void;
|
|
327
|
-
parentTeleport?: TeleportFragment | null;
|
|
328
287
|
propsOptions?: NormalizedPropsOptions;
|
|
329
288
|
emitsOptions?: ObjectEmitsOptions | null;
|
|
330
289
|
isSingleRoot?: boolean;
|
|
290
|
+
renderEffects?: RenderEffect[];
|
|
331
291
|
/**
|
|
332
292
|
* dev only flag to track whether $attrs was used during render.
|
|
333
293
|
* If $attrs was used during render then the warning for failed attrs
|
|
@@ -338,7 +298,7 @@ export declare class VaporComponentInstance<Props extends Record<string, any> =
|
|
|
338
298
|
* @deprecated only used for JSX to detect props types.
|
|
339
299
|
*/
|
|
340
300
|
$props: Props;
|
|
341
|
-
constructor(comp: VaporComponent, rawProps?: RawProps | null, rawSlots?:
|
|
301
|
+
constructor(comp: VaporComponent, rawProps?: RawProps | null, rawSlots?: LooseRawSlots | null, appContext?: GenericAppContext, once?: boolean, ce?: (instance: VaporComponentInstance) => void);
|
|
342
302
|
/**
|
|
343
303
|
* Expose `getKeysFromRawProps` on the instance so it can be used in code
|
|
344
304
|
* paths where it's needed, e.g. `useModel`
|
|
@@ -347,6 +307,12 @@ export declare class VaporComponentInstance<Props extends Record<string, any> =
|
|
|
347
307
|
}
|
|
348
308
|
export declare function isVaporComponent(value: unknown): value is VaporComponentInstance;
|
|
349
309
|
/**
|
|
310
|
+
* Resolve an asset component by name before passing it to the fallback helper;
|
|
311
|
+
* a string passed directly to `createComponentWithFallback` is plain element
|
|
312
|
+
* fallback, not a component name.
|
|
313
|
+
*/
|
|
314
|
+
export declare function createAssetComponent(name: string, rawProps?: LooseRawProps | null, rawSlots?: LooseRawSlots | null, isSingleRoot?: boolean, once?: boolean, maybeSelfReference?: boolean, appContext?: GenericAppContext): HTMLElement | VaporComponentInstance;
|
|
315
|
+
/**
|
|
350
316
|
* Used when a component cannot be resolved at compile time
|
|
351
317
|
* and needs rely on runtime resolution - where it might fallback to a plain
|
|
352
318
|
* element if the resolution fails.
|
|
@@ -369,6 +335,9 @@ export type VaporDirective = (node: Element | VaporComponentInstance, value?: ()
|
|
|
369
335
|
type VaporDirectiveArguments = Array<[VaporDirective | undefined] | [VaporDirective | undefined, () => any] | [VaporDirective | undefined, (() => any) | undefined, argument: string] | [VaporDirective | undefined, value: (() => any) | undefined, argument: string | undefined, modifiers: DirectiveModifiers]>;
|
|
370
336
|
export declare function withVaporDirectives(node: Element | VaporComponentInstance, dirs: VaporDirectiveArguments): void;
|
|
371
337
|
//#endregion
|
|
338
|
+
//#region temp/packages/runtime-vapor/src/components/Teleport.d.ts
|
|
339
|
+
export declare const VaporTeleport: DefineVaporSetupFnComponent<TeleportProps>;
|
|
340
|
+
//#endregion
|
|
372
341
|
//#region temp/packages/runtime-vapor/src/components/KeepAlive.d.ts
|
|
373
342
|
export declare const VaporKeepAlive: DefineVaporComponent<{}, string, KeepAliveProps>;
|
|
374
343
|
//#endregion
|
|
@@ -437,7 +406,7 @@ export declare function setInsertionState(parent: ParentNode & {
|
|
|
437
406
|
}, anchor?: Node | 0 | null, logicalIndex?: number): void;
|
|
438
407
|
//#endregion
|
|
439
408
|
//#region temp/packages/runtime-vapor/src/dom/template.d.ts
|
|
440
|
-
export declare function template(html: string,
|
|
409
|
+
export declare function template(html: string, flags?: number, ns?: Namespace): () => Node & {
|
|
441
410
|
$root?: true;
|
|
442
411
|
};
|
|
443
412
|
//#endregion
|
|
@@ -489,16 +458,20 @@ export declare function setBlockHtml(block: Block & {
|
|
|
489
458
|
export declare function setDynamicProps(el: any, args: any[], isSVG?: boolean): void;
|
|
490
459
|
//#endregion
|
|
491
460
|
//#region temp/packages/runtime-vapor/src/dom/event.d.ts
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
export declare function
|
|
461
|
+
type EventHandler = (...args: any[]) => any;
|
|
462
|
+
type EventHandlerValue = EventHandler | EventHandler[];
|
|
463
|
+
type MaybeEventHandlerValue = EventHandlerValue | null | undefined;
|
|
464
|
+
export declare function on(el: Element, event: string, handler: EventHandlerValue, options?: AddEventListenerOptions): void;
|
|
465
|
+
export declare function onBinding(el: Element, event: string, handler: EventHandlerValue, options?: AddEventListenerOptions): void;
|
|
466
|
+
export declare function delegate(el: any, event: string, handler: EventHandler): void;
|
|
496
467
|
export declare const delegateEvents: (...names: string[]) => void;
|
|
497
|
-
export declare function setDynamicEvents(el: HTMLElement, events: Record<string,
|
|
498
|
-
export declare function
|
|
468
|
+
export declare function setDynamicEvents(el: HTMLElement, events: Record<string, EventHandlerValue>): void;
|
|
469
|
+
export declare function withVaporModifiers<T extends (event: Event, ...args: unknown[]) => any>(fn: T | null | undefined, modifiers: string[]): T;
|
|
470
|
+
export declare function withVaporKeys<T extends (event: KeyboardEvent) => any>(fn: T | null | undefined, modifiers: string[]): T;
|
|
471
|
+
export declare function createInvoker(handler: MaybeEventHandlerValue): EventHandler;
|
|
499
472
|
//#endregion
|
|
500
473
|
//#region temp/packages/runtime-vapor/src/apiCreateIf.d.ts
|
|
501
|
-
export declare function createIf(condition: () => any, b1: BlockFn, b2?: BlockFn,
|
|
474
|
+
export declare function createIf(condition: () => any, b1: BlockFn, b2?: BlockFn, flags?: number): Block;
|
|
502
475
|
//#endregion
|
|
503
476
|
//#region temp/packages/runtime-vapor/src/apiCreateFragment.d.ts
|
|
504
477
|
/**
|
|
@@ -540,7 +513,7 @@ interface ForSelector {
|
|
|
540
513
|
export declare function createSelector(source: () => any): ForSelector;
|
|
541
514
|
export declare function createForSlots(rawSource: Source, getSlot: (item: any, key: any, index?: number) => DynamicSlot): DynamicSlot[];
|
|
542
515
|
export declare function getRestElement(val: any, keys: string[]): any;
|
|
543
|
-
export declare function getDefaultValue(val: any,
|
|
516
|
+
export declare function getDefaultValue(val: any, getDefaultVal: () => any): any;
|
|
544
517
|
//#endregion
|
|
545
518
|
//#region temp/packages/runtime-vapor/src/helpers/useCssVars.d.ts
|
|
546
519
|
export declare function useVaporCssVars(getter: () => Record<string, string>): void;
|
|
@@ -551,7 +524,7 @@ export declare function setBlockKey(block: (Block & {
|
|
|
551
524
|
}) | null | undefined, key: any): void;
|
|
552
525
|
//#endregion
|
|
553
526
|
//#region temp/packages/runtime-vapor/src/apiCreateDynamicComponent.d.ts
|
|
554
|
-
export declare function createDynamicComponent(getter: () => any, rawProps?: RawProps | null, rawSlots?:
|
|
527
|
+
export declare function createDynamicComponent(getter: () => any, rawProps?: RawProps | null, rawSlots?: LooseRawSlots | null, flags?: number): VaporFragment;
|
|
555
528
|
//#endregion
|
|
556
529
|
//#region temp/packages/runtime-vapor/src/apiSetupHelpers.d.ts
|
|
557
530
|
export declare function withAsyncContext(getAwaitable: () => any): [any, () => void];
|