@vue/runtime-vapor 3.6.0-alpha.4 → 3.6.0-alpha.6

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.
@@ -1,10 +1,10 @@
1
- import { VNode, TransitionHooks, TransitionState, TransitionProps, Plugin, SchedulerJob, GenericComponentInstance, GenericAppContext, EffectScope as EffectScope$1, EmitFn, SuspenseBoundary, LifecycleHook, NormalizedPropsOptions, ObjectEmitsOptions, ComponentInternalOptions, AsyncComponentInternalOptions, ComponentPropsOptions, EmitsOptions, CreateAppFunction, AsyncComponentLoader, AsyncComponentOptions, DirectiveModifiers, VueElementBase, CustomElementOptions } from '@vue/runtime-dom';
1
+ import { VNode, GenericComponentInstance, TransitionHooks, TransitionState, TransitionProps, Plugin, SchedulerJob, GenericAppContext, EffectScope as EffectScope$1, EmitFn, SuspenseBoundary, LifecycleHook, NormalizedPropsOptions, ObjectEmitsOptions, ComponentInternalOptions, AsyncComponentInternalOptions, ComponentPropsOptions, EmitsOptions, CreateAppFunction, AsyncComponentLoader, AsyncComponentOptions, DirectiveModifiers, VueElementBase, CustomElementOptions } from '@vue/runtime-dom';
2
2
  import { Ref, EffectScope, ReactiveEffect, ShallowRef } from '@vue/reactivity';
3
3
  import { 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;
7
- type setRefFn = (el: RefEl, ref: NodeRef, oldRef?: NodeRef, refFor?: boolean) => NodeRef | undefined;
7
+ type setRefFn = (el: RefEl, ref: NodeRef, oldRef?: NodeRef, refFor?: boolean, refKey?: string) => NodeRef | undefined;
8
8
  export declare function createTemplateRefSetter(): setRefFn;
9
9
 
10
10
  export declare class VaporFragment<T extends Block = Block> implements TransitionOptions {
@@ -13,11 +13,13 @@ export declare class VaporFragment<T extends Block = Block> implements Transitio
13
13
  nodes: T;
14
14
  vnode?: VNode | null;
15
15
  anchor?: Node;
16
+ parentComponent?: GenericComponentInstance | null;
16
17
  fallback?: BlockFn;
17
18
  insert?: (parent: ParentNode, anchor: Node | null, transitionHooks?: TransitionHooks) => void;
18
19
  remove?: (parent?: ParentNode, transitionHooks?: TransitionHooks) => void;
19
20
  hydrate?: (...args: any[]) => void;
20
21
  setRef?: (instance: VaporComponentInstance, ref: NodeRef, refFor: boolean, refKey: string | undefined) => void;
22
+ updated?: ((nodes?: Block) => void)[];
21
23
  constructor(nodes: T);
22
24
  }
23
25
  declare class ForFragment extends VaporFragment<Block[]> {
@@ -29,8 +31,11 @@ declare class DynamicFragment extends VaporFragment {
29
31
  current?: BlockFn;
30
32
  fallback?: BlockFn;
31
33
  anchorLabel?: string;
32
- inKeepAlive?: boolean;
33
- keptAliveScopes?: Map<any, EffectScope>;
34
+ attrs?: Record<string, any>;
35
+ setAsyncRef?: (instance: VaporComponentInstance) => void;
36
+ getScope?: (key: any) => EffectScope | undefined;
37
+ beforeTeardown?: ((oldKey: any, nodes: Block, scope: EffectScope) => boolean)[];
38
+ beforeMount?: ((newKey: any, nodes: Block, scope: EffectScope) => void)[];
34
39
  constructor(anchorLabel?: string);
35
40
  update(render?: BlockFn, key?: any): void;
36
41
  private render;
@@ -43,7 +48,6 @@ interface VaporTransitionHooks extends TransitionHooks {
43
48
  props: TransitionProps;
44
49
  instance: VaporComponentInstance;
45
50
  disabled?: boolean;
46
- group?: boolean;
47
51
  }
48
52
  interface TransitionOptions {
49
53
  $key?: any;
@@ -91,12 +95,14 @@ type DynamicSlot = {
91
95
  type DynamicSlotFn = () => DynamicSlot | DynamicSlot[];
92
96
  type DynamicSlotSource = StaticSlots | DynamicSlotFn;
93
97
  /**
94
- * Wrap a slot function to memoize currentInstance
95
- * 1. ensure correct currentInstance in forwarded slots
96
- * 2. elements created in the slot inherit the slot owner's scopeId
98
+ * Wrap a slot function to track the slot owner.
99
+ *
100
+ * This ensures:
101
+ * 1. createSlot gets rawSlots from the correct component (slot owner)
102
+ * 2. Elements inherit the slot owner's scopeId
97
103
  */
98
104
  export declare function withVaporCtx(fn: Function): BlockFn;
99
- export declare function createSlot(name: string | (() => string), rawProps?: LooseRawProps | null, fallback?: VaporSlot, noSlotted?: boolean): Block;
105
+ export declare function createSlot(name: string | (() => string), rawProps?: LooseRawProps | null, fallback?: VaporSlot, noSlotted?: boolean, once?: boolean): Block;
100
106
 
101
107
  export declare const VaporTeleportImpl: {
102
108
  name: string;
@@ -109,22 +115,24 @@ declare class TeleportFragment extends VaporFragment {
109
115
  private rawProps?;
110
116
  private resolvedProps?;
111
117
  private rawSlots?;
118
+ isDisabled?: boolean;
112
119
  target?: ParentNode | null;
113
120
  targetAnchor?: Node | null;
114
121
  targetStart?: Node | null;
115
122
  placeholder?: Node;
116
123
  mountContainer?: ParentNode | null;
117
124
  mountAnchor?: Node | null;
118
- parentComponent: GenericComponentInstance;
119
125
  constructor(props: LooseRawProps, slots: LooseRawSlots);
120
126
  get parent(): ParentNode | null;
121
127
  private initChildren;
122
128
  private handleChildrenUpdate;
129
+ private mount;
130
+ private mountToTarget;
123
131
  private handlePropsUpdate;
124
132
  insert: (container: ParentNode, anchor: Node | null) => void;
125
133
  remove: (parent?: ParentNode | undefined) => void;
126
134
  private hydrateDisabledTeleport;
127
- private mount;
135
+ private mountChildren;
128
136
  hydrate: () => void;
129
137
  }
130
138
 
@@ -192,6 +200,9 @@ declare class VaporComponentInstance implements GenericComponentInstance {
192
200
  provides: Record<string, any>;
193
201
  ids: [string, number, number];
194
202
  suspense: SuspenseBoundary | null;
203
+ suspenseId: number;
204
+ asyncDep: Promise<any> | null;
205
+ asyncResolved: boolean;
195
206
  renderEffects?: RenderEffect[];
196
207
  hasFallthrough: boolean;
197
208
  shapeFlag?: number;
@@ -221,7 +232,13 @@ declare class VaporComponentInstance implements GenericComponentInstance {
221
232
  propsOptions?: NormalizedPropsOptions;
222
233
  emitsOptions?: ObjectEmitsOptions | null;
223
234
  isSingleRoot?: boolean;
224
- constructor(comp: VaporComponent, rawProps?: RawProps | null, rawSlots?: RawSlots | null, appContext?: GenericAppContext, once?: boolean, parent?: GenericComponentInstance | null);
235
+ /**
236
+ * dev only flag to track whether $attrs was used during render.
237
+ * If $attrs was used during render then the warning for failed attrs
238
+ * fallthrough can be suppressed.
239
+ */
240
+ accessedAttrs: boolean;
241
+ constructor(comp: VaporComponent, rawProps?: RawProps | null, rawSlots?: RawSlots | null, appContext?: GenericAppContext, once?: boolean);
225
242
  /**
226
243
  * Expose `getKeysFromRawProps` on the instance so it can be used in code
227
244
  * paths where it's needed, e.g. `useModel`
@@ -348,9 +365,9 @@ export declare function setHtml(el: TargetElement, value: any): void;
348
365
  export declare function setBlockHtml(block: Block & {
349
366
  $html?: string;
350
367
  }, value: any): void;
351
- export declare function setDynamicProps(el: any, args: any[], root?: boolean, isSVG?: boolean): void;
368
+ export declare function setDynamicProps(el: any, args: any[], isSVG?: boolean): void;
352
369
 
353
- export declare function on(el: Element, event: string, handler: (e: Event) => any, options?: AddEventListenerOptions & {
370
+ export declare function on(el: Element, event: string, handler: (e: Event) => any | ((e: Event) => any)[], options?: AddEventListenerOptions & {
354
371
  effect?: boolean;
355
372
  }): void;
356
373
  export declare function delegate(el: any, event: string, handler: (e: Event) => any): void;
@@ -370,6 +387,8 @@ export declare function createForSlots(rawSource: Source, getSlot: (item: any, k
370
387
  export declare function getRestElement(val: any, keys: string[]): any;
371
388
  export declare function getDefaultValue(val: any, defaultVal: any): any;
372
389
 
390
+ export declare function useVaporCssVars(getter: () => Record<string, string>): void;
391
+
373
392
  export declare function createDynamicComponent(getter: () => any, rawProps?: RawProps | null, rawSlots?: RawSlots | null, isSingleRoot?: boolean, once?: boolean): VaporFragment;
374
393
 
375
394
  export declare function applyVShow(target: Block, source: () => any): void;