@vue-jsx-vapor/runtime 3.2.7 → 3.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/h.d.cts +3 -2
- package/dist/h.d.ts +3 -2
- package/dist/index.cjs +2 -0
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +3 -3
- package/dist/raw.cjs +2 -2
- package/dist/raw.js +2 -2
- package/dist/types-GE1trhvO.d.cts +12 -0
- package/dist/types-miAxCbY6.d.ts +12 -0
- package/dist/types.cjs +0 -0
- package/dist/types.d.cts +2 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.js +1 -0
- package/dist/vapor.cjs +10 -0
- package/dist/vapor.d.cts +39 -5
- package/dist/vapor.d.ts +39 -5
- package/dist/vapor.js +10 -1
- package/dist/vdom.cjs +6 -3
- package/dist/vdom.d.cts +53 -2
- package/dist/vdom.d.ts +53 -2
- package/dist/vdom.js +6 -4
- package/package.json +1 -1
package/dist/h.d.cts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "./types-GE1trhvO.cjs";
|
|
1
2
|
import { NodeChild } from "./vapor.cjs";
|
|
2
3
|
import { Block, Component, EmitsOptions, Fragment, FunctionalVaporComponent, NodeRef, Suspense, SuspenseProps, TeleportProps, VaporComponent, VaporTeleport } from "vue";
|
|
3
4
|
|
|
@@ -8,8 +9,8 @@ type ReservedProps = {
|
|
|
8
9
|
ref?: NodeRef;
|
|
9
10
|
};
|
|
10
11
|
type RawProps = Record<string, any> & ReservedProps;
|
|
11
|
-
type RawSlot = (...args: any[]) => NodeChild
|
|
12
|
-
type RawChildren = NodeChild | RawSlot;
|
|
12
|
+
type RawSlot = (...args: any[]) => NodeChild<() => NodeChild>;
|
|
13
|
+
type RawChildren = NodeChild<() => NodeChild> | RawSlot;
|
|
13
14
|
type RawSlots = Record<string, RawSlot>;
|
|
14
15
|
declare function h<K extends string>(type: K, props?: (RawProps & (K extends keyof HTMLElementTagNameMap ? HTMLElementEventHandler : {})) | null, children?: K extends keyof HTMLElementTagNameMap ? RawChildren : RawChildren | RawSlots): Block;
|
|
15
16
|
declare function h(type: typeof Fragment, props?: ReservedProps | null, children?: RawChildren): Block;
|
package/dist/h.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "./types-miAxCbY6.js";
|
|
1
2
|
import { NodeChild } from "./vapor.js";
|
|
2
3
|
import { Block, Component, EmitsOptions, Fragment, FunctionalVaporComponent, NodeRef, Suspense, SuspenseProps, TeleportProps, VaporComponent, VaporTeleport } from "vue";
|
|
3
4
|
|
|
@@ -8,8 +9,8 @@ type ReservedProps = {
|
|
|
8
9
|
ref?: NodeRef;
|
|
9
10
|
};
|
|
10
11
|
type RawProps = Record<string, any> & ReservedProps;
|
|
11
|
-
type RawSlot = (...args: any[]) => NodeChild
|
|
12
|
-
type RawChildren = NodeChild | RawSlot;
|
|
12
|
+
type RawSlot = (...args: any[]) => NodeChild<() => NodeChild>;
|
|
13
|
+
type RawChildren = NodeChild<() => NodeChild> | RawSlot;
|
|
13
14
|
type RawSlots = Record<string, RawSlot>;
|
|
14
15
|
declare function h<K extends string>(type: K, props?: (RawProps & (K extends keyof HTMLElementTagNameMap ? HTMLElementEventHandler : {})) | null, children?: K extends keyof HTMLElementTagNameMap ? RawChildren : RawChildren | RawSlots): Block;
|
|
15
16
|
declare function h(type: typeof Fragment, props?: ReservedProps | null, children?: RawChildren): Block;
|
package/dist/index.cjs
CHANGED
|
@@ -11,6 +11,8 @@ exports.createComponent = require_vapor.createComponent;
|
|
|
11
11
|
exports.createNodes = require_vapor.createNodes;
|
|
12
12
|
exports.createProxyComponent = require_vapor.createProxyComponent;
|
|
13
13
|
exports.createVNodeCache = require_vdom.createVNodeCache;
|
|
14
|
+
exports.defineComponent = require_vdom.defineComponent;
|
|
15
|
+
exports.defineVaporComponent = require_vapor.defineVaporComponent;
|
|
14
16
|
exports.defineVaporSSRComponent = require_vapor.defineVaporSSRComponent;
|
|
15
17
|
exports.getCurrentInstance = require_props.getCurrentInstance;
|
|
16
18
|
exports.h = require_h.h;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./types-GE1trhvO.cjs";
|
|
2
|
+
import { DefineVaporComponent, DefineVaporSetupFnComponent, NodeArrayChildren, NodeChild, createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes } from "./vapor.cjs";
|
|
2
3
|
import { h } from "./h.cjs";
|
|
3
4
|
import { AbstractView, AnchorHTMLAttributes, AnimationEvent, AnimationEventHandler, AreaHTMLAttributes, AriaAttributes, AudioHTMLAttributes, BaseEventHandler, BaseHTMLAttributes, BaseSyntheticEvent, BlockquoteHTMLAttributes, ButtonHTMLAttributes, CSSProperties, CanvasHTMLAttributes, ChangeEvent, ChangeEventHandler, ClipboardEvent, ClipboardEventHandler, ColHTMLAttributes, ColgroupHTMLAttributes, CompositionEvent, CompositionEventHandler, DataHTMLAttributes, DelHTMLAttributes, DetailsHTMLAttributes, DialogHTMLAttributes, DragEvent, DragEventHandler, EmbedHTMLAttributes, EventHandler, EventHandlers, Events, FieldsetHTMLAttributes, FocusEvent, FocusEventHandler, FormEvent, FormEventHandler, FormHTMLAttributes, HTMLAttributes, HtmlHTMLAttributes, IframeHTMLAttributes, ImgHTMLAttributes, InputHTMLAttributes, InputTypeHTMLAttribute, InsHTMLAttributes, IntrinsicElementAttributes, KeyboardEvent, KeyboardEventHandler, KeygenHTMLAttributes, LabelHTMLAttributes, LiHTMLAttributes, LinkHTMLAttributes, MapHTMLAttributes, MediaHTMLAttributes, MenuHTMLAttributes, MetaHTMLAttributes, MeterHTMLAttributes, ModifierKey, MouseEvent, MouseEventHandler, NativeElements, ObjectHTMLAttributes, OlHTMLAttributes, OptgroupHTMLAttributes, OptionHTMLAttributes, OutputHTMLAttributes, ParamHTMLAttributes, ProgressHTMLAttributes, QuoteHTMLAttributes, SVGAttributes, ScriptHTMLAttributes, SelectHTMLAttributes, SourceHTMLAttributes, StyleHTMLAttributes, StyleValue, SyntheticEvent, TableHTMLAttributes, TdHTMLAttributes, TextareaHTMLAttributes, ThHTMLAttributes, TimeHTMLAttributes, TrackHTMLAttributes, TransitionEvent, TransitionEventHandler, UIEvent, UIEventHandler, VideoHTMLAttributes, WebViewHTMLAttributes, WheelEvent, WheelEventHandler } from "./jsx.cjs";
|
|
4
5
|
import { getCurrentInstance, useFullProps, useProps } from "./props.cjs";
|
|
5
6
|
import { ssrRegisterHelper } from "./ssr.cjs";
|
|
6
|
-
import { createVNodeCache, normalizeSlot, normalizeVNode } from "./vdom.cjs";
|
|
7
|
+
import { DefineComponent, DefineSetupFnComponent, createVNodeCache, defineComponent, normalizeSlot, normalizeVNode } from "./vdom.cjs";
|
|
7
8
|
import { shallowRef as useRef } from "vue";
|
|
8
|
-
export { AbstractView, AnchorHTMLAttributes, AnimationEvent, AnimationEventHandler, AreaHTMLAttributes, AriaAttributes, AudioHTMLAttributes, BaseEventHandler, BaseHTMLAttributes, BaseSyntheticEvent, BlockquoteHTMLAttributes, ButtonHTMLAttributes, CSSProperties, CanvasHTMLAttributes, ChangeEvent, ChangeEventHandler, ClipboardEvent, ClipboardEventHandler, ColHTMLAttributes, ColgroupHTMLAttributes, CompositionEvent, CompositionEventHandler, DataHTMLAttributes, DelHTMLAttributes, DetailsHTMLAttributes, DialogHTMLAttributes, DragEvent, DragEventHandler, EmbedHTMLAttributes, EventHandler, EventHandlers, Events, FieldsetHTMLAttributes, FocusEvent, FocusEventHandler, FormEvent, FormEventHandler, FormHTMLAttributes, HTMLAttributes, HtmlHTMLAttributes, IframeHTMLAttributes, ImgHTMLAttributes, InputHTMLAttributes, InputTypeHTMLAttribute, InsHTMLAttributes, IntrinsicElementAttributes, KeyboardEvent, KeyboardEventHandler, KeygenHTMLAttributes, LabelHTMLAttributes, LiHTMLAttributes, LinkHTMLAttributes, MapHTMLAttributes, MediaHTMLAttributes, MenuHTMLAttributes, MetaHTMLAttributes, MeterHTMLAttributes, ModifierKey, MouseEvent, MouseEventHandler, NativeElements, NodeArrayChildren, NodeChild, ObjectHTMLAttributes, OlHTMLAttributes, OptgroupHTMLAttributes, OptionHTMLAttributes, OutputHTMLAttributes, ParamHTMLAttributes, ProgressHTMLAttributes, QuoteHTMLAttributes, SVGAttributes, ScriptHTMLAttributes, SelectHTMLAttributes, SourceHTMLAttributes, StyleHTMLAttributes, StyleValue, SyntheticEvent, TableHTMLAttributes, TdHTMLAttributes, TextareaHTMLAttributes, ThHTMLAttributes, TimeHTMLAttributes, TrackHTMLAttributes, TransitionEvent, TransitionEventHandler, UIEvent, UIEventHandler, VideoHTMLAttributes, WebViewHTMLAttributes, WheelEvent, WheelEventHandler, createComponent, createNodes, createProxyComponent, createVNodeCache, defineVaporSSRComponent, getCurrentInstance, h, isBlock, normalizeNode, normalizeSlot, normalizeVNode, setNodes, ssrRegisterHelper, useFullProps, useProps, useRef };
|
|
9
|
+
export { AbstractView, AnchorHTMLAttributes, AnimationEvent, AnimationEventHandler, AreaHTMLAttributes, AriaAttributes, AudioHTMLAttributes, BaseEventHandler, BaseHTMLAttributes, BaseSyntheticEvent, BlockquoteHTMLAttributes, ButtonHTMLAttributes, CSSProperties, CanvasHTMLAttributes, ChangeEvent, ChangeEventHandler, ClipboardEvent, ClipboardEventHandler, ColHTMLAttributes, ColgroupHTMLAttributes, CompositionEvent, CompositionEventHandler, DataHTMLAttributes, DefineComponent, DefineSetupFnComponent, DefineVaporComponent, DefineVaporSetupFnComponent, DelHTMLAttributes, DetailsHTMLAttributes, DialogHTMLAttributes, DragEvent, DragEventHandler, EmbedHTMLAttributes, EventHandler, EventHandlers, Events, FieldsetHTMLAttributes, FocusEvent, FocusEventHandler, FormEvent, FormEventHandler, FormHTMLAttributes, HTMLAttributes, HtmlHTMLAttributes, IframeHTMLAttributes, ImgHTMLAttributes, InputHTMLAttributes, InputTypeHTMLAttribute, InsHTMLAttributes, IntrinsicElementAttributes, KeyboardEvent, KeyboardEventHandler, KeygenHTMLAttributes, LabelHTMLAttributes, LiHTMLAttributes, LinkHTMLAttributes, MapHTMLAttributes, MediaHTMLAttributes, MenuHTMLAttributes, MetaHTMLAttributes, MeterHTMLAttributes, ModifierKey, MouseEvent, MouseEventHandler, NativeElements, NodeArrayChildren, NodeChild, ObjectHTMLAttributes, OlHTMLAttributes, OptgroupHTMLAttributes, OptionHTMLAttributes, OutputHTMLAttributes, ParamHTMLAttributes, ProgressHTMLAttributes, QuoteHTMLAttributes, SVGAttributes, ScriptHTMLAttributes, SelectHTMLAttributes, SourceHTMLAttributes, StyleHTMLAttributes, StyleValue, SyntheticEvent, TableHTMLAttributes, TdHTMLAttributes, TextareaHTMLAttributes, ThHTMLAttributes, TimeHTMLAttributes, TrackHTMLAttributes, TransitionEvent, TransitionEventHandler, UIEvent, UIEventHandler, VideoHTMLAttributes, WebViewHTMLAttributes, WheelEvent, WheelEventHandler, createComponent, createNodes, createProxyComponent, createVNodeCache, defineComponent, defineVaporComponent, defineVaporSSRComponent, getCurrentInstance, h, isBlock, normalizeNode, normalizeSlot, normalizeVNode, setNodes, ssrRegisterHelper, useFullProps, useProps, useRef };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./types-miAxCbY6.js";
|
|
2
|
+
import { DefineVaporComponent, DefineVaporSetupFnComponent, NodeArrayChildren, NodeChild, createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes } from "./vapor.js";
|
|
2
3
|
import { h } from "./h.js";
|
|
3
4
|
import { AbstractView, AnchorHTMLAttributes, AnimationEvent, AnimationEventHandler, AreaHTMLAttributes, AriaAttributes, AudioHTMLAttributes, BaseEventHandler, BaseHTMLAttributes, BaseSyntheticEvent, BlockquoteHTMLAttributes, ButtonHTMLAttributes, CSSProperties, CanvasHTMLAttributes, ChangeEvent, ChangeEventHandler, ClipboardEvent, ClipboardEventHandler, ColHTMLAttributes, ColgroupHTMLAttributes, CompositionEvent, CompositionEventHandler, DataHTMLAttributes, DelHTMLAttributes, DetailsHTMLAttributes, DialogHTMLAttributes, DragEvent, DragEventHandler, EmbedHTMLAttributes, EventHandler, EventHandlers, Events, FieldsetHTMLAttributes, FocusEvent, FocusEventHandler, FormEvent, FormEventHandler, FormHTMLAttributes, HTMLAttributes, HtmlHTMLAttributes, IframeHTMLAttributes, ImgHTMLAttributes, InputHTMLAttributes, InputTypeHTMLAttribute, InsHTMLAttributes, IntrinsicElementAttributes, KeyboardEvent, KeyboardEventHandler, KeygenHTMLAttributes, LabelHTMLAttributes, LiHTMLAttributes, LinkHTMLAttributes, MapHTMLAttributes, MediaHTMLAttributes, MenuHTMLAttributes, MetaHTMLAttributes, MeterHTMLAttributes, ModifierKey, MouseEvent, MouseEventHandler, NativeElements, ObjectHTMLAttributes, OlHTMLAttributes, OptgroupHTMLAttributes, OptionHTMLAttributes, OutputHTMLAttributes, ParamHTMLAttributes, ProgressHTMLAttributes, QuoteHTMLAttributes, SVGAttributes, ScriptHTMLAttributes, SelectHTMLAttributes, SourceHTMLAttributes, StyleHTMLAttributes, StyleValue, SyntheticEvent, TableHTMLAttributes, TdHTMLAttributes, TextareaHTMLAttributes, ThHTMLAttributes, TimeHTMLAttributes, TrackHTMLAttributes, TransitionEvent, TransitionEventHandler, UIEvent, UIEventHandler, VideoHTMLAttributes, WebViewHTMLAttributes, WheelEvent, WheelEventHandler } from "./jsx.js";
|
|
4
5
|
import { getCurrentInstance, useFullProps, useProps } from "./props.js";
|
|
5
6
|
import { ssrRegisterHelper } from "./ssr.js";
|
|
6
|
-
import { createVNodeCache, normalizeSlot, normalizeVNode } from "./vdom.js";
|
|
7
|
+
import { DefineComponent, DefineSetupFnComponent, createVNodeCache, defineComponent, normalizeSlot, normalizeVNode } from "./vdom.js";
|
|
7
8
|
import { shallowRef as useRef } from "vue";
|
|
8
|
-
export { AbstractView, AnchorHTMLAttributes, AnimationEvent, AnimationEventHandler, AreaHTMLAttributes, AriaAttributes, AudioHTMLAttributes, BaseEventHandler, BaseHTMLAttributes, BaseSyntheticEvent, BlockquoteHTMLAttributes, ButtonHTMLAttributes, CSSProperties, CanvasHTMLAttributes, ChangeEvent, ChangeEventHandler, ClipboardEvent, ClipboardEventHandler, ColHTMLAttributes, ColgroupHTMLAttributes, CompositionEvent, CompositionEventHandler, DataHTMLAttributes, DelHTMLAttributes, DetailsHTMLAttributes, DialogHTMLAttributes, DragEvent, DragEventHandler, EmbedHTMLAttributes, EventHandler, EventHandlers, Events, FieldsetHTMLAttributes, FocusEvent, FocusEventHandler, FormEvent, FormEventHandler, FormHTMLAttributes, HTMLAttributes, HtmlHTMLAttributes, IframeHTMLAttributes, ImgHTMLAttributes, InputHTMLAttributes, InputTypeHTMLAttribute, InsHTMLAttributes, IntrinsicElementAttributes, KeyboardEvent, KeyboardEventHandler, KeygenHTMLAttributes, LabelHTMLAttributes, LiHTMLAttributes, LinkHTMLAttributes, MapHTMLAttributes, MediaHTMLAttributes, MenuHTMLAttributes, MetaHTMLAttributes, MeterHTMLAttributes, ModifierKey, MouseEvent, MouseEventHandler, NativeElements, NodeArrayChildren, NodeChild, ObjectHTMLAttributes, OlHTMLAttributes, OptgroupHTMLAttributes, OptionHTMLAttributes, OutputHTMLAttributes, ParamHTMLAttributes, ProgressHTMLAttributes, QuoteHTMLAttributes, SVGAttributes, ScriptHTMLAttributes, SelectHTMLAttributes, SourceHTMLAttributes, StyleHTMLAttributes, StyleValue, SyntheticEvent, TableHTMLAttributes, TdHTMLAttributes, TextareaHTMLAttributes, ThHTMLAttributes, TimeHTMLAttributes, TrackHTMLAttributes, TransitionEvent, TransitionEventHandler, UIEvent, UIEventHandler, VideoHTMLAttributes, WebViewHTMLAttributes, WheelEvent, WheelEventHandler, createComponent, createNodes, createProxyComponent, createVNodeCache, defineVaporSSRComponent, getCurrentInstance, h, isBlock, normalizeNode, normalizeSlot, normalizeVNode, setNodes, ssrRegisterHelper, useFullProps, useProps, useRef };
|
|
9
|
+
export { AbstractView, AnchorHTMLAttributes, AnimationEvent, AnimationEventHandler, AreaHTMLAttributes, AriaAttributes, AudioHTMLAttributes, BaseEventHandler, BaseHTMLAttributes, BaseSyntheticEvent, BlockquoteHTMLAttributes, ButtonHTMLAttributes, CSSProperties, CanvasHTMLAttributes, ChangeEvent, ChangeEventHandler, ClipboardEvent, ClipboardEventHandler, ColHTMLAttributes, ColgroupHTMLAttributes, CompositionEvent, CompositionEventHandler, DataHTMLAttributes, DefineComponent, DefineSetupFnComponent, DefineVaporComponent, DefineVaporSetupFnComponent, DelHTMLAttributes, DetailsHTMLAttributes, DialogHTMLAttributes, DragEvent, DragEventHandler, EmbedHTMLAttributes, EventHandler, EventHandlers, Events, FieldsetHTMLAttributes, FocusEvent, FocusEventHandler, FormEvent, FormEventHandler, FormHTMLAttributes, HTMLAttributes, HtmlHTMLAttributes, IframeHTMLAttributes, ImgHTMLAttributes, InputHTMLAttributes, InputTypeHTMLAttribute, InsHTMLAttributes, IntrinsicElementAttributes, KeyboardEvent, KeyboardEventHandler, KeygenHTMLAttributes, LabelHTMLAttributes, LiHTMLAttributes, LinkHTMLAttributes, MapHTMLAttributes, MediaHTMLAttributes, MenuHTMLAttributes, MetaHTMLAttributes, MeterHTMLAttributes, ModifierKey, MouseEvent, MouseEventHandler, NativeElements, NodeArrayChildren, NodeChild, ObjectHTMLAttributes, OlHTMLAttributes, OptgroupHTMLAttributes, OptionHTMLAttributes, OutputHTMLAttributes, ParamHTMLAttributes, ProgressHTMLAttributes, QuoteHTMLAttributes, SVGAttributes, ScriptHTMLAttributes, SelectHTMLAttributes, SourceHTMLAttributes, StyleHTMLAttributes, StyleValue, SyntheticEvent, TableHTMLAttributes, TdHTMLAttributes, TextareaHTMLAttributes, ThHTMLAttributes, TimeHTMLAttributes, TrackHTMLAttributes, TransitionEvent, TransitionEventHandler, UIEvent, UIEventHandler, VideoHTMLAttributes, WebViewHTMLAttributes, WheelEvent, WheelEventHandler, createComponent, createNodes, createProxyComponent, createVNodeCache, defineComponent, defineVaporComponent, defineVaporSSRComponent, getCurrentInstance, h, isBlock, normalizeNode, normalizeSlot, normalizeVNode, setNodes, ssrRegisterHelper, useFullProps, useProps, useRef };
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { createComponent, createNodes, createProxyComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes } from "./vapor.js";
|
|
1
|
+
import { createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes } from "./vapor.js";
|
|
2
2
|
import { h } from "./h.js";
|
|
3
3
|
import "./jsx.js";
|
|
4
4
|
import { getCurrentInstance, useFullProps, useProps } from "./props.js";
|
|
5
5
|
import { ssrRegisterHelper } from "./ssr.js";
|
|
6
|
-
import { createVNodeCache, normalizeSlot, normalizeVNode } from "./vdom.js";
|
|
6
|
+
import { createVNodeCache, defineComponent, normalizeSlot, normalizeVNode } from "./vdom.js";
|
|
7
7
|
import { shallowRef as useRef } from "vue";
|
|
8
8
|
|
|
9
|
-
export { createComponent, createNodes, createProxyComponent, createVNodeCache, defineVaporSSRComponent, getCurrentInstance, h, isBlock, normalizeNode, normalizeSlot, normalizeVNode, setNodes, ssrRegisterHelper, useFullProps, useProps, useRef };
|
|
9
|
+
export { createComponent, createNodes, createProxyComponent, createVNodeCache, defineComponent, defineVaporComponent, defineVaporSSRComponent, getCurrentInstance, h, isBlock, normalizeNode, normalizeSlot, normalizeVNode, setNodes, ssrRegisterHelper, useFullProps, useProps, useRef };
|
package/dist/raw.cjs
CHANGED
|
@@ -8,11 +8,11 @@ var ssr_default = "import { useSSRContext } from \"vue\";\nexport function ssrRe
|
|
|
8
8
|
|
|
9
9
|
//#endregion
|
|
10
10
|
//#region src/vapor.ts?raw
|
|
11
|
-
var vapor_default = "import {\n EffectScope,\n Fragment,\n getCurrentInstance\n} from \"vue\";\nimport * as Vue from \"vue\";\n// @__NO_SIDE_EFFECTS__\nexport function defineVaporSSRComponent(comp, extraOptions) {\n if (typeof comp === \"function\") {\n return Object.assign({ name: comp.name }, extraOptions, {\n setup(props, ctx) {\n const result = comp(props, ctx);\n return () => result;\n },\n __vapor: true\n });\n }\n const setup = comp.setup;\n if (setup) {\n comp.setup = (props, ctx) => {\n const result = setup(props, ctx);\n return () => result;\n };\n }\n comp.__vapor = true;\n return comp;\n}\nexport const createComponent = (type, ...args) => {\n if (type === Fragment) {\n const slots = args[1];\n return slots && typeof slots.default === \"function\" ? slots.default() : [];\n }\n return Vue.createComponentWithFallback(\n createProxyComponent(Vue.resolveDynamicComponent(type)),\n ...args\n );\n};\nconst proxyCache = /* @__PURE__ */ new WeakMap();\nexport function createProxyComponent(type, normalizeNode2) {\n if (typeof type === \"function\") {\n const existing = proxyCache.get(type);\n if (existing) return existing;\n const i = Vue.currentInstance || getCurrentInstance();\n const proxy = new Proxy(type, {\n apply(target, ctx, args) {\n if (typeof target.__setup === \"function\") {\n target.__setup.apply(ctx, args);\n }\n const node = Reflect.apply(target, ctx, args);\n return normalizeNode2 ? normalizeNode2(node) : node;\n },\n get(target, p, receiver) {\n if (i && i.appContext.vapor && p === \"__vapor\") {\n return true;\n }\n return Reflect.get(target, p, receiver);\n }\n });\n proxyCache.set(type, proxy);\n return proxy;\n }\n return type;\n}\nexport function normalizeNode(node) {\n if (node == null || typeof node === \"boolean\") {\n return document.createComment(\"\");\n } else if (Array.isArray(node) && node.length) {\n return node.map(normalizeNode);\n } else if (isBlock(node)) {\n return node;\n } else if (typeof node === \"function\") {\n return resolveValues([node], void 0, true)[0];\n } else {\n return document.createTextNode(String(node));\n }\n}\nexport function isBlock(val) {\n return val instanceof Node || Array.isArray(val) || Vue.isVaporComponent(val) || Vue.isFragment(val);\n}\nfunction createFragment(nodes, anchor = document.createTextNode(\"\")) {\n const frag = new Vue.VaporFragment(nodes);\n frag.anchor = anchor;\n return frag;\n}\nfunction normalizeBlock(node, anchor, processFunction = false) {\n if (node instanceof Node || Vue.isFragment(node)) {\n return node;\n } else if (Vue.isVaporComponent(node)) {\n return createFragment(node, anchor);\n } else if (Array.isArray(node)) {\n return createFragment(\n node.map((i) => normalizeBlock(i, void 0, processFunction)),\n anchor\n );\n } else if (processFunction && typeof node === \"function\") {\n return resolveValues([node], anchor, true)[0];\n } else {\n const result = node == null || typeof node === \"boolean\" ? \"\" : String(node);\n if (anchor) {\n anchor.textContent = result;\n return anchor;\n } else {\n return document.createTextNode(result);\n }\n }\n}\nfunction resolveValue(current, value, anchor, processFunction = false) {\n anchor = anchor || (current instanceof Node && current.nodeType === 3 ? current : void 0);\n const node = normalizeBlock(value, anchor, processFunction);\n if (current) {\n if (Vue.isFragment(current)) {\n if (current.anchor && current.anchor.parentNode) {\n Vue.remove(current.nodes, current.anchor.parentNode);\n Vue.insert(node, current.anchor.parentNode, current.anchor);\n if (!anchor) current.anchor.parentNode.removeChild(current.anchor);\n if (current.scope) current.scope.stop();\n }\n } else if (current instanceof Node) {\n if (current.nodeType === 3 && (!(node instanceof Node) || node.nodeType !== 3)) {\n current.textContent = \"\";\n }\n if (Vue.isFragment(node) && current.parentNode) {\n Vue.insert(node, current.parentNode, current);\n if (!anchor || current.nodeType !== 3) {\n current.parentNode.removeChild(current);\n }\n } else if (node instanceof Node) {\n if (current.nodeType === 3 && node.nodeType === 3) {\n current.textContent = node.textContent;\n return current;\n } else if (current.parentNode) {\n current.parentNode.replaceChild(node, current);\n }\n }\n }\n }\n return node;\n}\nfunction resolveValues(values = [], _anchor, processFunction = false) {\n const nodes = [];\n const scopes = [];\n for (const [index, value] of values.entries()) {\n const anchor = index === values.length - 1 ? _anchor : void 0;\n if (typeof value === \"function\") {\n Vue.renderEffect(() => {\n if (scopes[index]) scopes[index].stop();\n scopes[index] = new EffectScope();\n nodes[index] = scopes[index].run(\n () => resolveValue(nodes[index], value(), anchor, processFunction)\n );\n });\n } else {\n nodes[index] = resolveValue(nodes[index], value, anchor, processFunction);\n }\n }\n return nodes;\n}\nexport function setNodes(anchor, ...values) {\n const resolvedValues = resolveValues(values, anchor);\n if (anchor.parentNode) Vue.insert(resolvedValues, anchor.parentNode, anchor);\n}\nexport function createNodes(...values) {\n return resolveValues(values);\n}\n";
|
|
11
|
+
var vapor_default = "import {\n EffectScope,\n Fragment,\n getCurrentInstance\n} from \"vue\";\nimport * as Vue from \"vue\";\n// @__NO_SIDE_EFFECTS__\nexport function defineVaporSSRComponent(comp, extraOptions) {\n if (typeof comp === \"function\") {\n return Object.assign({ name: comp.name }, extraOptions, {\n setup(props, ctx) {\n const result = comp(props, ctx);\n return () => result;\n },\n __vapor: true\n });\n }\n const setup = comp.setup;\n if (setup) {\n comp.setup = (props, ctx) => {\n const result = setup(props, ctx);\n return () => result;\n };\n }\n comp.__vapor = true;\n return comp;\n}\nexport const createComponent = (type, ...args) => {\n if (type === Fragment) {\n const slots = args[1];\n return slots && typeof slots.default === \"function\" ? slots.default() : [];\n }\n return Vue.createComponentWithFallback(\n createProxyComponent(Vue.resolveDynamicComponent(type)),\n ...args\n );\n};\nconst proxyCache = /* @__PURE__ */ new WeakMap();\nexport function createProxyComponent(type, normalizeNode2) {\n if (typeof type === \"function\") {\n const existing = proxyCache.get(type);\n if (existing) return existing;\n const i = Vue.currentInstance || getCurrentInstance();\n const proxy = new Proxy(type, {\n apply(target, ctx, args) {\n if (typeof target.__setup === \"function\") {\n target.__setup.apply(ctx, args);\n }\n const node = Reflect.apply(target, ctx, args);\n return normalizeNode2 ? normalizeNode2(node) : node;\n },\n get(target, p, receiver) {\n if (i && i.appContext.vapor && p === \"__vapor\") {\n return true;\n }\n return Reflect.get(target, p, receiver);\n }\n });\n proxyCache.set(type, proxy);\n return proxy;\n }\n return type;\n}\nexport function normalizeNode(node) {\n if (node == null || typeof node === \"boolean\") {\n return document.createComment(\"\");\n } else if (Array.isArray(node) && node.length) {\n return node.map(normalizeNode);\n } else if (isBlock(node)) {\n return node;\n } else if (typeof node === \"function\") {\n return resolveValues([node], void 0, true)[0];\n } else {\n return document.createTextNode(String(node));\n }\n}\nexport function isBlock(val) {\n return val instanceof Node || Array.isArray(val) || Vue.isVaporComponent(val) || Vue.isFragment(val);\n}\nfunction createFragment(nodes, anchor = document.createTextNode(\"\")) {\n const frag = new Vue.VaporFragment(nodes);\n frag.anchor = anchor;\n return frag;\n}\nfunction normalizeBlock(node, anchor, processFunction = false) {\n if (node instanceof Node || Vue.isFragment(node)) {\n return node;\n } else if (Vue.isVaporComponent(node)) {\n return createFragment(node, anchor);\n } else if (Array.isArray(node)) {\n return createFragment(\n node.map((i) => normalizeBlock(i, void 0, processFunction)),\n anchor\n );\n } else if (processFunction && typeof node === \"function\") {\n return resolveValues([node], anchor, true)[0];\n } else {\n const result = node == null || typeof node === \"boolean\" ? \"\" : String(node);\n if (anchor) {\n anchor.textContent = result;\n return anchor;\n } else {\n return document.createTextNode(result);\n }\n }\n}\nfunction resolveValue(current, value, anchor, processFunction = false) {\n anchor = anchor || (current instanceof Node && current.nodeType === 3 ? current : void 0);\n const node = normalizeBlock(value, anchor, processFunction);\n if (current) {\n if (Vue.isFragment(current)) {\n if (current.anchor && current.anchor.parentNode) {\n Vue.remove(current.nodes, current.anchor.parentNode);\n Vue.insert(node, current.anchor.parentNode, current.anchor);\n if (!anchor) current.anchor.parentNode.removeChild(current.anchor);\n if (current.scope) current.scope.stop();\n }\n } else if (current instanceof Node) {\n if (current.nodeType === 3 && (!(node instanceof Node) || node.nodeType !== 3)) {\n current.textContent = \"\";\n }\n if (Vue.isFragment(node) && current.parentNode) {\n Vue.insert(node, current.parentNode, current);\n if (!anchor || current.nodeType !== 3) {\n current.parentNode.removeChild(current);\n }\n } else if (node instanceof Node) {\n if (current.nodeType === 3 && node.nodeType === 3) {\n current.textContent = node.textContent;\n return current;\n } else if (current.parentNode) {\n current.parentNode.replaceChild(node, current);\n }\n }\n }\n }\n return node;\n}\nfunction resolveValues(values = [], _anchor, processFunction = false) {\n const nodes = [];\n const scopes = [];\n for (const [index, value] of values.entries()) {\n const anchor = index === values.length - 1 ? _anchor : void 0;\n if (typeof value === \"function\") {\n Vue.renderEffect(() => {\n if (scopes[index]) scopes[index].stop();\n scopes[index] = new EffectScope();\n nodes[index] = scopes[index].run(\n () => resolveValue(nodes[index], value(), anchor, processFunction)\n );\n });\n } else {\n nodes[index] = resolveValue(nodes[index], value, anchor, processFunction);\n }\n }\n return nodes;\n}\nexport function setNodes(anchor, ...values) {\n const resolvedValues = resolveValues(values, anchor);\n if (anchor.parentNode) Vue.insert(resolvedValues, anchor.parentNode, anchor);\n}\nexport function createNodes(...values) {\n return resolveValues(values);\n}\n// @__NO_SIDE_EFFECTS__\nexport function defineVaporComponent(comp, extraOptions) {\n if (typeof comp === \"function\") {\n return Object.assign({ name: comp.name }, extraOptions, {\n setup: comp,\n __vapor: true\n });\n }\n comp.__vapor = true;\n return comp;\n}\n";
|
|
12
12
|
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region src/vdom.ts?raw
|
|
15
|
-
var vdom_default = "import {\n cloneVNode,\n Comment,\n createBlock,\n createElementBlock,\n createElementVNode,\n createVNode,\n Fragment,\n getCurrentInstance,\n isVNode,\n openBlock,\n Text,\n withCtx\n} from \"vue\";\nconst cacheMap = /* @__PURE__ */ new WeakMap();\nexport function createVNodeCache(key) {\n const i = getCurrentInstance();\n if (i) {\n if (!cacheMap.has(i)) cacheMap.set(i, {});\n const caches = cacheMap.get(i);\n return caches[key] || (caches[key] = []);\n } else {\n return [];\n }\n}\nexport function normalizeVNode(value, flag = 1) {\n let create = createVNode;\n let isBlock = false;\n if (typeof value === \"function\") {\n isBlock = true;\n openBlock();\n create = createBlock;\n value = value();\n }\n return isVNode(value) ? isBlock ? createBlock(cloneIfMounted(value)) : cloneIfMounted(value) : Array.isArray(value) ? isBlock ? createElementBlock(\n Fragment,\n null,\n value.map((n) => normalizeVNode(() => n)),\n -2\n ) : createElementVNode(Fragment, null, value.slice()) : value == null || typeof value === \"boolean\" ? create(Comment) : create(Text, null, String(value), flag);\n}\nfunction cloneIfMounted(child) {\n return child.el === null && child.patchFlag !== -1 || // @ts-ignore\n child.memo ? child : cloneVNode(child);\n}\nconst normalizeSlotValue = (value) => Array.isArray(value) ? value.map((n) => normalizeVNode(n)) : [normalizeVNode(value)];\nexport const normalizeSlot = (rawSlot) => {\n if (rawSlot._n) {\n return rawSlot;\n }\n
|
|
15
|
+
var vdom_default = "import {\n cloneVNode,\n Comment,\n createBlock,\n createElementBlock,\n createElementVNode,\n createVNode,\n Fragment,\n getCurrentInstance,\n isVNode,\n openBlock,\n Text,\n withCtx\n} from \"vue\";\nconst cacheMap = /* @__PURE__ */ new WeakMap();\nexport function createVNodeCache(key) {\n const i = getCurrentInstance();\n if (i) {\n if (!cacheMap.has(i)) cacheMap.set(i, {});\n const caches = cacheMap.get(i);\n return caches[key] || (caches[key] = []);\n } else {\n return [];\n }\n}\nexport function normalizeVNode(value, flag = 1) {\n let create = createVNode;\n let isBlock = false;\n if (typeof value === \"function\") {\n isBlock = true;\n openBlock();\n create = createBlock;\n value = value();\n }\n return isVNode(value) ? isBlock ? createBlock(cloneIfMounted(value)) : cloneIfMounted(value) : Array.isArray(value) ? isBlock ? createElementBlock(\n Fragment,\n null,\n value.map((n) => normalizeVNode(() => n)),\n -2\n ) : createElementVNode(Fragment, null, value.slice()) : value == null || typeof value === \"boolean\" ? create(Comment) : create(Text, null, String(value), flag);\n}\nfunction cloneIfMounted(child) {\n return child.el === null && child.patchFlag !== -1 || // @ts-ignore\n child.memo ? child : cloneVNode(child);\n}\nconst normalizeSlotValue = (value) => Array.isArray(value) ? value.map((n) => normalizeVNode(n)) : [normalizeVNode(value)];\nexport const normalizeSlot = (rawSlot) => {\n if (rawSlot._n) {\n return rawSlot;\n }\n return withCtx((...args) => {\n return normalizeSlotValue(rawSlot(...args));\n });\n};\n// @__NO_SIDE_EFFECTS__\nexport function defineComponent(options, extraOptions) {\n return typeof options === \"function\" ? Object.assign({ name: options.name }, extraOptions, { setup: options }) : options;\n}\n";
|
|
16
16
|
|
|
17
17
|
//#endregion
|
|
18
18
|
//#region src/raw.ts
|
package/dist/raw.js
CHANGED
|
@@ -7,11 +7,11 @@ var ssr_default = "import { useSSRContext } from \"vue\";\nexport function ssrRe
|
|
|
7
7
|
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/vapor.ts?raw
|
|
10
|
-
var vapor_default = "import {\n EffectScope,\n Fragment,\n getCurrentInstance\n} from \"vue\";\nimport * as Vue from \"vue\";\n// @__NO_SIDE_EFFECTS__\nexport function defineVaporSSRComponent(comp, extraOptions) {\n if (typeof comp === \"function\") {\n return Object.assign({ name: comp.name }, extraOptions, {\n setup(props, ctx) {\n const result = comp(props, ctx);\n return () => result;\n },\n __vapor: true\n });\n }\n const setup = comp.setup;\n if (setup) {\n comp.setup = (props, ctx) => {\n const result = setup(props, ctx);\n return () => result;\n };\n }\n comp.__vapor = true;\n return comp;\n}\nexport const createComponent = (type, ...args) => {\n if (type === Fragment) {\n const slots = args[1];\n return slots && typeof slots.default === \"function\" ? slots.default() : [];\n }\n return Vue.createComponentWithFallback(\n createProxyComponent(Vue.resolveDynamicComponent(type)),\n ...args\n );\n};\nconst proxyCache = /* @__PURE__ */ new WeakMap();\nexport function createProxyComponent(type, normalizeNode2) {\n if (typeof type === \"function\") {\n const existing = proxyCache.get(type);\n if (existing) return existing;\n const i = Vue.currentInstance || getCurrentInstance();\n const proxy = new Proxy(type, {\n apply(target, ctx, args) {\n if (typeof target.__setup === \"function\") {\n target.__setup.apply(ctx, args);\n }\n const node = Reflect.apply(target, ctx, args);\n return normalizeNode2 ? normalizeNode2(node) : node;\n },\n get(target, p, receiver) {\n if (i && i.appContext.vapor && p === \"__vapor\") {\n return true;\n }\n return Reflect.get(target, p, receiver);\n }\n });\n proxyCache.set(type, proxy);\n return proxy;\n }\n return type;\n}\nexport function normalizeNode(node) {\n if (node == null || typeof node === \"boolean\") {\n return document.createComment(\"\");\n } else if (Array.isArray(node) && node.length) {\n return node.map(normalizeNode);\n } else if (isBlock(node)) {\n return node;\n } else if (typeof node === \"function\") {\n return resolveValues([node], void 0, true)[0];\n } else {\n return document.createTextNode(String(node));\n }\n}\nexport function isBlock(val) {\n return val instanceof Node || Array.isArray(val) || Vue.isVaporComponent(val) || Vue.isFragment(val);\n}\nfunction createFragment(nodes, anchor = document.createTextNode(\"\")) {\n const frag = new Vue.VaporFragment(nodes);\n frag.anchor = anchor;\n return frag;\n}\nfunction normalizeBlock(node, anchor, processFunction = false) {\n if (node instanceof Node || Vue.isFragment(node)) {\n return node;\n } else if (Vue.isVaporComponent(node)) {\n return createFragment(node, anchor);\n } else if (Array.isArray(node)) {\n return createFragment(\n node.map((i) => normalizeBlock(i, void 0, processFunction)),\n anchor\n );\n } else if (processFunction && typeof node === \"function\") {\n return resolveValues([node], anchor, true)[0];\n } else {\n const result = node == null || typeof node === \"boolean\" ? \"\" : String(node);\n if (anchor) {\n anchor.textContent = result;\n return anchor;\n } else {\n return document.createTextNode(result);\n }\n }\n}\nfunction resolveValue(current, value, anchor, processFunction = false) {\n anchor = anchor || (current instanceof Node && current.nodeType === 3 ? current : void 0);\n const node = normalizeBlock(value, anchor, processFunction);\n if (current) {\n if (Vue.isFragment(current)) {\n if (current.anchor && current.anchor.parentNode) {\n Vue.remove(current.nodes, current.anchor.parentNode);\n Vue.insert(node, current.anchor.parentNode, current.anchor);\n if (!anchor) current.anchor.parentNode.removeChild(current.anchor);\n if (current.scope) current.scope.stop();\n }\n } else if (current instanceof Node) {\n if (current.nodeType === 3 && (!(node instanceof Node) || node.nodeType !== 3)) {\n current.textContent = \"\";\n }\n if (Vue.isFragment(node) && current.parentNode) {\n Vue.insert(node, current.parentNode, current);\n if (!anchor || current.nodeType !== 3) {\n current.parentNode.removeChild(current);\n }\n } else if (node instanceof Node) {\n if (current.nodeType === 3 && node.nodeType === 3) {\n current.textContent = node.textContent;\n return current;\n } else if (current.parentNode) {\n current.parentNode.replaceChild(node, current);\n }\n }\n }\n }\n return node;\n}\nfunction resolveValues(values = [], _anchor, processFunction = false) {\n const nodes = [];\n const scopes = [];\n for (const [index, value] of values.entries()) {\n const anchor = index === values.length - 1 ? _anchor : void 0;\n if (typeof value === \"function\") {\n Vue.renderEffect(() => {\n if (scopes[index]) scopes[index].stop();\n scopes[index] = new EffectScope();\n nodes[index] = scopes[index].run(\n () => resolveValue(nodes[index], value(), anchor, processFunction)\n );\n });\n } else {\n nodes[index] = resolveValue(nodes[index], value, anchor, processFunction);\n }\n }\n return nodes;\n}\nexport function setNodes(anchor, ...values) {\n const resolvedValues = resolveValues(values, anchor);\n if (anchor.parentNode) Vue.insert(resolvedValues, anchor.parentNode, anchor);\n}\nexport function createNodes(...values) {\n return resolveValues(values);\n}\n";
|
|
10
|
+
var vapor_default = "import {\n EffectScope,\n Fragment,\n getCurrentInstance\n} from \"vue\";\nimport * as Vue from \"vue\";\n// @__NO_SIDE_EFFECTS__\nexport function defineVaporSSRComponent(comp, extraOptions) {\n if (typeof comp === \"function\") {\n return Object.assign({ name: comp.name }, extraOptions, {\n setup(props, ctx) {\n const result = comp(props, ctx);\n return () => result;\n },\n __vapor: true\n });\n }\n const setup = comp.setup;\n if (setup) {\n comp.setup = (props, ctx) => {\n const result = setup(props, ctx);\n return () => result;\n };\n }\n comp.__vapor = true;\n return comp;\n}\nexport const createComponent = (type, ...args) => {\n if (type === Fragment) {\n const slots = args[1];\n return slots && typeof slots.default === \"function\" ? slots.default() : [];\n }\n return Vue.createComponentWithFallback(\n createProxyComponent(Vue.resolveDynamicComponent(type)),\n ...args\n );\n};\nconst proxyCache = /* @__PURE__ */ new WeakMap();\nexport function createProxyComponent(type, normalizeNode2) {\n if (typeof type === \"function\") {\n const existing = proxyCache.get(type);\n if (existing) return existing;\n const i = Vue.currentInstance || getCurrentInstance();\n const proxy = new Proxy(type, {\n apply(target, ctx, args) {\n if (typeof target.__setup === \"function\") {\n target.__setup.apply(ctx, args);\n }\n const node = Reflect.apply(target, ctx, args);\n return normalizeNode2 ? normalizeNode2(node) : node;\n },\n get(target, p, receiver) {\n if (i && i.appContext.vapor && p === \"__vapor\") {\n return true;\n }\n return Reflect.get(target, p, receiver);\n }\n });\n proxyCache.set(type, proxy);\n return proxy;\n }\n return type;\n}\nexport function normalizeNode(node) {\n if (node == null || typeof node === \"boolean\") {\n return document.createComment(\"\");\n } else if (Array.isArray(node) && node.length) {\n return node.map(normalizeNode);\n } else if (isBlock(node)) {\n return node;\n } else if (typeof node === \"function\") {\n return resolveValues([node], void 0, true)[0];\n } else {\n return document.createTextNode(String(node));\n }\n}\nexport function isBlock(val) {\n return val instanceof Node || Array.isArray(val) || Vue.isVaporComponent(val) || Vue.isFragment(val);\n}\nfunction createFragment(nodes, anchor = document.createTextNode(\"\")) {\n const frag = new Vue.VaporFragment(nodes);\n frag.anchor = anchor;\n return frag;\n}\nfunction normalizeBlock(node, anchor, processFunction = false) {\n if (node instanceof Node || Vue.isFragment(node)) {\n return node;\n } else if (Vue.isVaporComponent(node)) {\n return createFragment(node, anchor);\n } else if (Array.isArray(node)) {\n return createFragment(\n node.map((i) => normalizeBlock(i, void 0, processFunction)),\n anchor\n );\n } else if (processFunction && typeof node === \"function\") {\n return resolveValues([node], anchor, true)[0];\n } else {\n const result = node == null || typeof node === \"boolean\" ? \"\" : String(node);\n if (anchor) {\n anchor.textContent = result;\n return anchor;\n } else {\n return document.createTextNode(result);\n }\n }\n}\nfunction resolveValue(current, value, anchor, processFunction = false) {\n anchor = anchor || (current instanceof Node && current.nodeType === 3 ? current : void 0);\n const node = normalizeBlock(value, anchor, processFunction);\n if (current) {\n if (Vue.isFragment(current)) {\n if (current.anchor && current.anchor.parentNode) {\n Vue.remove(current.nodes, current.anchor.parentNode);\n Vue.insert(node, current.anchor.parentNode, current.anchor);\n if (!anchor) current.anchor.parentNode.removeChild(current.anchor);\n if (current.scope) current.scope.stop();\n }\n } else if (current instanceof Node) {\n if (current.nodeType === 3 && (!(node instanceof Node) || node.nodeType !== 3)) {\n current.textContent = \"\";\n }\n if (Vue.isFragment(node) && current.parentNode) {\n Vue.insert(node, current.parentNode, current);\n if (!anchor || current.nodeType !== 3) {\n current.parentNode.removeChild(current);\n }\n } else if (node instanceof Node) {\n if (current.nodeType === 3 && node.nodeType === 3) {\n current.textContent = node.textContent;\n return current;\n } else if (current.parentNode) {\n current.parentNode.replaceChild(node, current);\n }\n }\n }\n }\n return node;\n}\nfunction resolveValues(values = [], _anchor, processFunction = false) {\n const nodes = [];\n const scopes = [];\n for (const [index, value] of values.entries()) {\n const anchor = index === values.length - 1 ? _anchor : void 0;\n if (typeof value === \"function\") {\n Vue.renderEffect(() => {\n if (scopes[index]) scopes[index].stop();\n scopes[index] = new EffectScope();\n nodes[index] = scopes[index].run(\n () => resolveValue(nodes[index], value(), anchor, processFunction)\n );\n });\n } else {\n nodes[index] = resolveValue(nodes[index], value, anchor, processFunction);\n }\n }\n return nodes;\n}\nexport function setNodes(anchor, ...values) {\n const resolvedValues = resolveValues(values, anchor);\n if (anchor.parentNode) Vue.insert(resolvedValues, anchor.parentNode, anchor);\n}\nexport function createNodes(...values) {\n return resolveValues(values);\n}\n// @__NO_SIDE_EFFECTS__\nexport function defineVaporComponent(comp, extraOptions) {\n if (typeof comp === \"function\") {\n return Object.assign({ name: comp.name }, extraOptions, {\n setup: comp,\n __vapor: true\n });\n }\n comp.__vapor = true;\n return comp;\n}\n";
|
|
11
11
|
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/vdom.ts?raw
|
|
14
|
-
var vdom_default = "import {\n cloneVNode,\n Comment,\n createBlock,\n createElementBlock,\n createElementVNode,\n createVNode,\n Fragment,\n getCurrentInstance,\n isVNode,\n openBlock,\n Text,\n withCtx\n} from \"vue\";\nconst cacheMap = /* @__PURE__ */ new WeakMap();\nexport function createVNodeCache(key) {\n const i = getCurrentInstance();\n if (i) {\n if (!cacheMap.has(i)) cacheMap.set(i, {});\n const caches = cacheMap.get(i);\n return caches[key] || (caches[key] = []);\n } else {\n return [];\n }\n}\nexport function normalizeVNode(value, flag = 1) {\n let create = createVNode;\n let isBlock = false;\n if (typeof value === \"function\") {\n isBlock = true;\n openBlock();\n create = createBlock;\n value = value();\n }\n return isVNode(value) ? isBlock ? createBlock(cloneIfMounted(value)) : cloneIfMounted(value) : Array.isArray(value) ? isBlock ? createElementBlock(\n Fragment,\n null,\n value.map((n) => normalizeVNode(() => n)),\n -2\n ) : createElementVNode(Fragment, null, value.slice()) : value == null || typeof value === \"boolean\" ? create(Comment) : create(Text, null, String(value), flag);\n}\nfunction cloneIfMounted(child) {\n return child.el === null && child.patchFlag !== -1 || // @ts-ignore\n child.memo ? child : cloneVNode(child);\n}\nconst normalizeSlotValue = (value) => Array.isArray(value) ? value.map((n) => normalizeVNode(n)) : [normalizeVNode(value)];\nexport const normalizeSlot = (rawSlot) => {\n if (rawSlot._n) {\n return rawSlot;\n }\n
|
|
14
|
+
var vdom_default = "import {\n cloneVNode,\n Comment,\n createBlock,\n createElementBlock,\n createElementVNode,\n createVNode,\n Fragment,\n getCurrentInstance,\n isVNode,\n openBlock,\n Text,\n withCtx\n} from \"vue\";\nconst cacheMap = /* @__PURE__ */ new WeakMap();\nexport function createVNodeCache(key) {\n const i = getCurrentInstance();\n if (i) {\n if (!cacheMap.has(i)) cacheMap.set(i, {});\n const caches = cacheMap.get(i);\n return caches[key] || (caches[key] = []);\n } else {\n return [];\n }\n}\nexport function normalizeVNode(value, flag = 1) {\n let create = createVNode;\n let isBlock = false;\n if (typeof value === \"function\") {\n isBlock = true;\n openBlock();\n create = createBlock;\n value = value();\n }\n return isVNode(value) ? isBlock ? createBlock(cloneIfMounted(value)) : cloneIfMounted(value) : Array.isArray(value) ? isBlock ? createElementBlock(\n Fragment,\n null,\n value.map((n) => normalizeVNode(() => n)),\n -2\n ) : createElementVNode(Fragment, null, value.slice()) : value == null || typeof value === \"boolean\" ? create(Comment) : create(Text, null, String(value), flag);\n}\nfunction cloneIfMounted(child) {\n return child.el === null && child.patchFlag !== -1 || // @ts-ignore\n child.memo ? child : cloneVNode(child);\n}\nconst normalizeSlotValue = (value) => Array.isArray(value) ? value.map((n) => normalizeVNode(n)) : [normalizeVNode(value)];\nexport const normalizeSlot = (rawSlot) => {\n if (rawSlot._n) {\n return rawSlot;\n }\n return withCtx((...args) => {\n return normalizeSlotValue(rawSlot(...args));\n });\n};\n// @__NO_SIDE_EFFECTS__\nexport function defineComponent(options, extraOptions) {\n return typeof options === \"function\" ? Object.assign({ name: options.name }, extraOptions, { setup: options }) : options;\n}\n";
|
|
15
15
|
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region src/raw.ts
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EmitsOptions, EmitsToProps, VNodeChild } from "vue";
|
|
2
|
+
|
|
3
|
+
//#region src/types.d.ts
|
|
4
|
+
type Prettify<T> = { [K in keyof T]: T[K] } & {};
|
|
5
|
+
type IfAny<T, Y, N> = 0 extends 1 & T ? Y : N;
|
|
6
|
+
type IsKeyValues<T, K = string> = IfAny<T, false, T extends object ? (keyof T extends K ? true : false) : false>;
|
|
7
|
+
type ToResolvedProps<Props, Emits extends EmitsOptions> = Readonly<Props> & Readonly<EmitsToProps<Emits>>;
|
|
8
|
+
type ResolvePropsWithSlots<Props, Slots = Record<string, any>, Element = VNodeChild> = string extends keyof Slots ? Props : Props & {
|
|
9
|
+
'v-slots'?: ('default' extends keyof Slots ? Slots['default'] | Slots : Slots) | Element;
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { ToResolvedProps as a, ResolvePropsWithSlots as i, IsKeyValues as n, Prettify as r, IfAny as t };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EmitsOptions, EmitsToProps, VNodeChild } from "vue";
|
|
2
|
+
|
|
3
|
+
//#region src/types.d.ts
|
|
4
|
+
type Prettify<T> = { [K in keyof T]: T[K] } & {};
|
|
5
|
+
type IfAny<T, Y, N> = 0 extends 1 & T ? Y : N;
|
|
6
|
+
type IsKeyValues<T, K = string> = IfAny<T, false, T extends object ? (keyof T extends K ? true : false) : false>;
|
|
7
|
+
type ToResolvedProps<Props, Emits extends EmitsOptions> = Readonly<Props> & Readonly<EmitsToProps<Emits>>;
|
|
8
|
+
type ResolvePropsWithSlots<Props, Slots = Record<string, any>, Element = VNodeChild> = string extends keyof Slots ? Props : Props & {
|
|
9
|
+
'v-slots'?: ('default' extends keyof Slots ? Slots['default'] | Slots : Slots) | Element;
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { ToResolvedProps as a, ResolvePropsWithSlots as i, IsKeyValues as n, Prettify as r, IfAny as t };
|
package/dist/types.cjs
ADDED
|
File without changes
|
package/dist/types.d.cts
ADDED
package/dist/types.d.ts
ADDED
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/vapor.cjs
CHANGED
|
@@ -124,11 +124,21 @@ function setNodes(anchor, ...values) {
|
|
|
124
124
|
function createNodes(...values) {
|
|
125
125
|
return resolveValues(values);
|
|
126
126
|
}
|
|
127
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
128
|
+
function defineVaporComponent(comp, extraOptions) {
|
|
129
|
+
if (typeof comp === "function") return Object.assign({ name: comp.name }, extraOptions, {
|
|
130
|
+
setup: comp,
|
|
131
|
+
__vapor: true
|
|
132
|
+
});
|
|
133
|
+
comp.__vapor = true;
|
|
134
|
+
return comp;
|
|
135
|
+
}
|
|
127
136
|
|
|
128
137
|
//#endregion
|
|
129
138
|
exports.createComponent = createComponent;
|
|
130
139
|
exports.createNodes = createNodes;
|
|
131
140
|
exports.createProxyComponent = createProxyComponent;
|
|
141
|
+
exports.defineVaporComponent = defineVaporComponent;
|
|
132
142
|
exports.defineVaporSSRComponent = defineVaporSSRComponent;
|
|
133
143
|
exports.isBlock = isBlock;
|
|
134
144
|
exports.normalizeNode = normalizeNode;
|
package/dist/vapor.d.cts
CHANGED
|
@@ -1,17 +1,51 @@
|
|
|
1
|
+
import { a as ToResolvedProps, i as ResolvePropsWithSlots, n as IsKeyValues, r as Prettify } from "./types-GE1trhvO.cjs";
|
|
1
2
|
import * as Vue from "vue";
|
|
2
|
-
import { Block, Fragment, VNode, VaporComponent } from "vue";
|
|
3
|
+
import { Block, ComponentObjectPropsOptions, ComponentTypeEmits, EmitFn, EmitsOptions, ExtractDefaultPropTypes, ExtractPropTypes, Fragment, StaticSlots, TypeEmitsToOptions, VNode, VaporComponent, VaporComponentInstance, VaporComponentInstanceConstructor, VaporComponentOptions, VaporPublicProps, VaporRenderResult } from "vue";
|
|
3
4
|
|
|
4
5
|
//#region src/vapor.d.ts
|
|
5
6
|
declare function defineVaporSSRComponent(comp: VaporComponent, extraOptions: VaporComponent): VaporComponent;
|
|
6
7
|
type Tail<T extends any[]> = T extends [any, ...infer R] ? R : never;
|
|
7
8
|
declare const createComponent: (type: VaporComponent | typeof Fragment | string, ...args: Tail<Parameters<typeof Vue.createComponent>>) => Block;
|
|
8
9
|
declare function createProxyComponent(type: VaporComponent, normalizeNode?: (node: any) => Block): any;
|
|
9
|
-
type NodeChildAtom = VNode | Block | string | number | boolean | null | undefined | void |
|
|
10
|
-
type NodeArrayChildren = Array<NodeArrayChildren | NodeChildAtom
|
|
11
|
-
type NodeChild = NodeChildAtom | NodeArrayChildren
|
|
10
|
+
type NodeChildAtom<T> = VNode | Block | string | number | boolean | null | undefined | void | T;
|
|
11
|
+
type NodeArrayChildren<T> = Array<NodeArrayChildren<T> | NodeChildAtom<T>>;
|
|
12
|
+
type NodeChild<T = undefined> = NodeChildAtom<T> | NodeArrayChildren<T>;
|
|
12
13
|
declare function normalizeNode(node: NodeChild): Block;
|
|
13
14
|
declare function isBlock(val: NonNullable<unknown>): val is Block;
|
|
14
15
|
declare function setNodes(anchor: Node, ...values: any[]): void;
|
|
15
16
|
declare function createNodes(...values: any[]): Block[];
|
|
17
|
+
type DefineVaporComponent<RuntimePropsOptions = {}, RuntimePropsKeys extends string = string, InferredProps = (string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : { [key in RuntimePropsKeys]?: any }), Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block, TypeRefs extends Record<string, unknown> = {}, MakeDefaultsOptional extends boolean = true, PublicProps = VaporPublicProps, ResolvedProps = ToResolvedProps<InferredProps, Emits>, Defaults = ExtractDefaultPropTypes<RuntimePropsOptions>> = VaporComponentInstanceConstructor<VaporComponentInstance<ResolvePropsWithSlots<MakeDefaultsOptional extends true ? keyof Defaults extends never ? Prettify<ResolvedProps> & PublicProps : Partial<Defaults> & Omit<Prettify<ResolvedProps> & PublicProps, keyof Defaults> : Prettify<ResolvedProps> & PublicProps, Slots, NodeChild>, Emits, Slots, Exposed, TypeBlock, TypeRefs>> & VaporComponentOptions<RuntimePropsOptions | RuntimePropsKeys[], Emits, RuntimeEmitsKeys, Slots, Exposed>;
|
|
18
|
+
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> = ToResolvedProps<Props & VaporPublicProps, Emits>> = new () => VaporComponentInstance<ResolvePropsWithSlots<ResolvedProps, Slots, NodeChild>, Emits, Slots, Exposed, TypeBlock>;
|
|
19
|
+
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: (this: void, props: Props, ctx: {
|
|
20
|
+
emit: EmitFn<Emits>;
|
|
21
|
+
slots: Slots;
|
|
22
|
+
attrs: Record<string, any>;
|
|
23
|
+
expose: (exposed: Exposed) => void;
|
|
24
|
+
}) => VaporRenderResult<TypeBlock> | void, extraOptions?: VaporComponentOptions<(keyof Props)[], Emits, RuntimeEmitsKeys, Slots, Exposed> & ThisType<void>): DefineVaporSetupFnComponent<Props, Emits, Slots, Exposed, TypeBlock>;
|
|
25
|
+
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>(this: void, setup: (props: Props, ctx: {
|
|
26
|
+
emit: EmitFn<Emits>;
|
|
27
|
+
slots: Slots;
|
|
28
|
+
attrs: Record<string, any>;
|
|
29
|
+
expose: (exposed: Exposed) => void;
|
|
30
|
+
}) => VaporRenderResult<TypeBlock> | void, extraOptions?: VaporComponentOptions<ComponentObjectPropsOptions<Props>, Emits, RuntimeEmitsKeys, Slots, Exposed> & ThisType<void>): DefineVaporSetupFnComponent<Props, Emits, Slots, Exposed, TypeBlock>;
|
|
31
|
+
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> : { [key in RuntimePropsKeys]?: any }), TypeRefs extends Record<string, unknown> = {}, TypeBlock extends Block = Block>(options: VaporComponentOptions<RuntimePropsOptions | RuntimePropsKeys[], ResolvedEmits, RuntimeEmitsKeys, Slots, Exposed, TypeBlock, InferredProps> & {
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
/**
|
|
34
|
+
* @private
|
|
35
|
+
*/
|
|
36
|
+
__typeProps?: TypeProps;
|
|
37
|
+
/**
|
|
38
|
+
* @private
|
|
39
|
+
*/
|
|
40
|
+
__typeEmits?: TypeEmits;
|
|
41
|
+
/**
|
|
42
|
+
* @private
|
|
43
|
+
*/
|
|
44
|
+
__typeRefs?: TypeRefs;
|
|
45
|
+
/**
|
|
46
|
+
* @private
|
|
47
|
+
*/
|
|
48
|
+
__typeEl?: TypeBlock;
|
|
49
|
+
} & ThisType<void>): DefineVaporComponent<RuntimePropsOptions, RuntimePropsKeys, InferredProps, ResolvedEmits, RuntimeEmitsKeys, Slots, Exposed extends Block ? Record<string, any> : Exposed, TypeBlock, TypeRefs, unknown extends TypeProps ? true : false>;
|
|
16
50
|
//#endregion
|
|
17
|
-
export { NodeArrayChildren, NodeChild, createComponent, createNodes, createProxyComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes };
|
|
51
|
+
export { DefineVaporComponent, DefineVaporSetupFnComponent, NodeArrayChildren, NodeChild, createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes };
|
package/dist/vapor.d.ts
CHANGED
|
@@ -1,17 +1,51 @@
|
|
|
1
|
+
import { a as ToResolvedProps, i as ResolvePropsWithSlots, n as IsKeyValues, r as Prettify } from "./types-miAxCbY6.js";
|
|
1
2
|
import * as Vue from "vue";
|
|
2
|
-
import { Block, Fragment, VNode, VaporComponent } from "vue";
|
|
3
|
+
import { Block, ComponentObjectPropsOptions, ComponentTypeEmits, EmitFn, EmitsOptions, ExtractDefaultPropTypes, ExtractPropTypes, Fragment, StaticSlots, TypeEmitsToOptions, VNode, VaporComponent, VaporComponentInstance, VaporComponentInstanceConstructor, VaporComponentOptions, VaporPublicProps, VaporRenderResult } from "vue";
|
|
3
4
|
|
|
4
5
|
//#region src/vapor.d.ts
|
|
5
6
|
declare function defineVaporSSRComponent(comp: VaporComponent, extraOptions: VaporComponent): VaporComponent;
|
|
6
7
|
type Tail<T extends any[]> = T extends [any, ...infer R] ? R : never;
|
|
7
8
|
declare const createComponent: (type: VaporComponent | typeof Fragment | string, ...args: Tail<Parameters<typeof Vue.createComponent>>) => Block;
|
|
8
9
|
declare function createProxyComponent(type: VaporComponent, normalizeNode?: (node: any) => Block): any;
|
|
9
|
-
type NodeChildAtom = VNode | Block | string | number | boolean | null | undefined | void |
|
|
10
|
-
type NodeArrayChildren = Array<NodeArrayChildren | NodeChildAtom
|
|
11
|
-
type NodeChild = NodeChildAtom | NodeArrayChildren
|
|
10
|
+
type NodeChildAtom<T> = VNode | Block | string | number | boolean | null | undefined | void | T;
|
|
11
|
+
type NodeArrayChildren<T> = Array<NodeArrayChildren<T> | NodeChildAtom<T>>;
|
|
12
|
+
type NodeChild<T = undefined> = NodeChildAtom<T> | NodeArrayChildren<T>;
|
|
12
13
|
declare function normalizeNode(node: NodeChild): Block;
|
|
13
14
|
declare function isBlock(val: NonNullable<unknown>): val is Block;
|
|
14
15
|
declare function setNodes(anchor: Node, ...values: any[]): void;
|
|
15
16
|
declare function createNodes(...values: any[]): Block[];
|
|
17
|
+
type DefineVaporComponent<RuntimePropsOptions = {}, RuntimePropsKeys extends string = string, InferredProps = (string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : { [key in RuntimePropsKeys]?: any }), Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block, TypeRefs extends Record<string, unknown> = {}, MakeDefaultsOptional extends boolean = true, PublicProps = VaporPublicProps, ResolvedProps = ToResolvedProps<InferredProps, Emits>, Defaults = ExtractDefaultPropTypes<RuntimePropsOptions>> = VaporComponentInstanceConstructor<VaporComponentInstance<ResolvePropsWithSlots<MakeDefaultsOptional extends true ? keyof Defaults extends never ? Prettify<ResolvedProps> & PublicProps : Partial<Defaults> & Omit<Prettify<ResolvedProps> & PublicProps, keyof Defaults> : Prettify<ResolvedProps> & PublicProps, Slots, NodeChild>, Emits, Slots, Exposed, TypeBlock, TypeRefs>> & VaporComponentOptions<RuntimePropsOptions | RuntimePropsKeys[], Emits, RuntimeEmitsKeys, Slots, Exposed>;
|
|
18
|
+
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> = ToResolvedProps<Props & VaporPublicProps, Emits>> = new () => VaporComponentInstance<ResolvePropsWithSlots<ResolvedProps, Slots, NodeChild>, Emits, Slots, Exposed, TypeBlock>;
|
|
19
|
+
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: (this: void, props: Props, ctx: {
|
|
20
|
+
emit: EmitFn<Emits>;
|
|
21
|
+
slots: Slots;
|
|
22
|
+
attrs: Record<string, any>;
|
|
23
|
+
expose: (exposed: Exposed) => void;
|
|
24
|
+
}) => VaporRenderResult<TypeBlock> | void, extraOptions?: VaporComponentOptions<(keyof Props)[], Emits, RuntimeEmitsKeys, Slots, Exposed> & ThisType<void>): DefineVaporSetupFnComponent<Props, Emits, Slots, Exposed, TypeBlock>;
|
|
25
|
+
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>(this: void, setup: (props: Props, ctx: {
|
|
26
|
+
emit: EmitFn<Emits>;
|
|
27
|
+
slots: Slots;
|
|
28
|
+
attrs: Record<string, any>;
|
|
29
|
+
expose: (exposed: Exposed) => void;
|
|
30
|
+
}) => VaporRenderResult<TypeBlock> | void, extraOptions?: VaporComponentOptions<ComponentObjectPropsOptions<Props>, Emits, RuntimeEmitsKeys, Slots, Exposed> & ThisType<void>): DefineVaporSetupFnComponent<Props, Emits, Slots, Exposed, TypeBlock>;
|
|
31
|
+
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> : { [key in RuntimePropsKeys]?: any }), TypeRefs extends Record<string, unknown> = {}, TypeBlock extends Block = Block>(options: VaporComponentOptions<RuntimePropsOptions | RuntimePropsKeys[], ResolvedEmits, RuntimeEmitsKeys, Slots, Exposed, TypeBlock, InferredProps> & {
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
/**
|
|
34
|
+
* @private
|
|
35
|
+
*/
|
|
36
|
+
__typeProps?: TypeProps;
|
|
37
|
+
/**
|
|
38
|
+
* @private
|
|
39
|
+
*/
|
|
40
|
+
__typeEmits?: TypeEmits;
|
|
41
|
+
/**
|
|
42
|
+
* @private
|
|
43
|
+
*/
|
|
44
|
+
__typeRefs?: TypeRefs;
|
|
45
|
+
/**
|
|
46
|
+
* @private
|
|
47
|
+
*/
|
|
48
|
+
__typeEl?: TypeBlock;
|
|
49
|
+
} & ThisType<void>): DefineVaporComponent<RuntimePropsOptions, RuntimePropsKeys, InferredProps, ResolvedEmits, RuntimeEmitsKeys, Slots, Exposed extends Block ? Record<string, any> : Exposed, TypeBlock, TypeRefs, unknown extends TypeProps ? true : false>;
|
|
16
50
|
//#endregion
|
|
17
|
-
export { NodeArrayChildren, NodeChild, createComponent, createNodes, createProxyComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes };
|
|
51
|
+
export { DefineVaporComponent, DefineVaporSetupFnComponent, NodeArrayChildren, NodeChild, createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes };
|
package/dist/vapor.js
CHANGED
|
@@ -123,6 +123,15 @@ function setNodes(anchor, ...values) {
|
|
|
123
123
|
function createNodes(...values) {
|
|
124
124
|
return resolveValues(values);
|
|
125
125
|
}
|
|
126
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
127
|
+
function defineVaporComponent(comp, extraOptions) {
|
|
128
|
+
if (typeof comp === "function") return Object.assign({ name: comp.name }, extraOptions, {
|
|
129
|
+
setup: comp,
|
|
130
|
+
__vapor: true
|
|
131
|
+
});
|
|
132
|
+
comp.__vapor = true;
|
|
133
|
+
return comp;
|
|
134
|
+
}
|
|
126
135
|
|
|
127
136
|
//#endregion
|
|
128
|
-
export { createComponent, createNodes, createProxyComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes };
|
|
137
|
+
export { createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes };
|
package/dist/vdom.cjs
CHANGED
|
@@ -28,14 +28,17 @@ function cloneIfMounted(child) {
|
|
|
28
28
|
const normalizeSlotValue = (value) => Array.isArray(value) ? value.map((n) => normalizeVNode(n)) : [normalizeVNode(value)];
|
|
29
29
|
const normalizeSlot = (rawSlot) => {
|
|
30
30
|
if (rawSlot._n) return rawSlot;
|
|
31
|
-
|
|
31
|
+
return (0, vue.withCtx)((...args) => {
|
|
32
32
|
return normalizeSlotValue(rawSlot(...args));
|
|
33
33
|
});
|
|
34
|
-
normalized._c = false;
|
|
35
|
-
return normalized;
|
|
36
34
|
};
|
|
35
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
36
|
+
function defineComponent(options, extraOptions) {
|
|
37
|
+
return typeof options === "function" ? Object.assign({ name: options.name }, extraOptions, { setup: options }) : options;
|
|
38
|
+
}
|
|
37
39
|
|
|
38
40
|
//#endregion
|
|
39
41
|
exports.createVNodeCache = createVNodeCache;
|
|
42
|
+
exports.defineComponent = defineComponent;
|
|
40
43
|
exports.normalizeSlot = normalizeSlot;
|
|
41
44
|
exports.normalizeVNode = normalizeVNode;
|
package/dist/vdom.d.cts
CHANGED
|
@@ -1,8 +1,59 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as ToResolvedProps, i as ResolvePropsWithSlots, n as IsKeyValues } from "./types-GE1trhvO.cjs";
|
|
2
|
+
import { Component, ComponentInjectOptions, ComponentObjectPropsOptions, ComponentOptions, ComponentOptionsBase, ComponentOptionsMixin, ComponentPropsOptions, ComponentProvideOptions, ComponentPublicInstance, ComponentTypeEmits, ComputedOptions, CreateComponentPublicInstanceWithMixins, Directive, EmitFn, EmitsOptions, EmitsToProps, ExtractDefaultPropTypes, ExtractPropTypes, GlobalComponents, GlobalDirectives, MethodOptions, PublicProps, SetupContext, Slot, SlotsType, TypeEmitsToOptions, VNode, VNodeChild } from "vue";
|
|
2
3
|
|
|
3
4
|
//#region src/vdom.d.ts
|
|
4
5
|
declare function createVNodeCache(key: string): any;
|
|
5
6
|
declare function normalizeVNode(value: VNodeChild | (() => VNodeChild), flag?: number): VNode;
|
|
6
7
|
declare const normalizeSlot: (rawSlot: Function) => Slot;
|
|
8
|
+
type RenderFunction = () => VNodeChild | {};
|
|
9
|
+
type ComponentPublicInstanceConstructor<T extends ComponentPublicInstance<Props, RawBindings, D, C, M> = ComponentPublicInstance<any>, Props = any, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions> = {
|
|
10
|
+
__isFragment?: never;
|
|
11
|
+
__isTeleport?: never;
|
|
12
|
+
__isSuspense?: never;
|
|
13
|
+
new (...args: any[]): T;
|
|
14
|
+
};
|
|
15
|
+
type ResolveProps<PropsOrPropOptions, E extends EmitsOptions> = Readonly<PropsOrPropOptions extends ComponentPropsOptions ? ExtractPropTypes<PropsOrPropOptions> : PropsOrPropOptions> & ({} extends E ? {} : EmitsToProps<E>);
|
|
16
|
+
type DefineComponent<PropsOrPropOptions = {}, RawBindings = {}, D = {}, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, PP = PublicProps, Props = ResolveProps<PropsOrPropOptions, E>, Defaults = ExtractDefaultPropTypes<PropsOrPropOptions>, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, MakeDefaultsOptional extends boolean = true, TypeRefs extends Record<string, unknown> = {}, TypeEl extends Element = any> = ComponentPublicInstanceConstructor<CreateComponentPublicInstanceWithMixins<ResolvePropsWithSlots<Props, SetupContext<EmitsOptions, S>['slots']>, RawBindings, D, C, M, Mixin, Extends, E, PP, Defaults, MakeDefaultsOptional, {}, S, LC & GlobalComponents, Directives & GlobalDirectives, Exposed, TypeRefs, TypeEl>> & ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, {}, string, S, LC & GlobalComponents, Directives & GlobalDirectives, Exposed, Provide> & PP;
|
|
17
|
+
type DefineSetupFnComponent<P extends Record<string, any>, E extends EmitsOptions = {}, S extends SlotsType = SlotsType, Props = P & EmitsToProps<E>, PP = PublicProps> = new (props: Props & PP) => CreateComponentPublicInstanceWithMixins<ResolvePropsWithSlots<Props, SetupContext<EmitsOptions, S>['slots']>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, E, PP, {}, false, {}, S>;
|
|
18
|
+
declare function defineComponent<Props extends Record<string, any>, Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends Record<string, any> = {}, Exposed extends Record<string, any> = Record<string, any>>(setup: (this: void, props: Props, ctx: {
|
|
19
|
+
emit: EmitFn<Emits>;
|
|
20
|
+
slots: Slots;
|
|
21
|
+
attrs: Record<string, any>;
|
|
22
|
+
expose: (exposed: Exposed) => void;
|
|
23
|
+
}) => RenderFunction | Promise<RenderFunction>, options?: Omit<ComponentOptions, 'props' | 'emits' | 'slots'> & {
|
|
24
|
+
props?: (keyof NoInfer<Props>)[];
|
|
25
|
+
emits?: Emits | RuntimeEmitsKeys[];
|
|
26
|
+
slots?: Slots;
|
|
27
|
+
}): DefineSetupFnComponent<Props, Emits, SlotsType<Slots>>;
|
|
28
|
+
declare function defineComponent<Props extends Record<string, any>, Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends Record<string, any> = {}, Exposed extends Record<string, any> = Record<string, any>>(setup: (this: void, props: Props, ctx: {
|
|
29
|
+
emit: EmitFn<Emits>;
|
|
30
|
+
slots: Slots;
|
|
31
|
+
attrs: Record<string, any>;
|
|
32
|
+
expose: (exposed: Exposed) => void;
|
|
33
|
+
}) => RenderFunction | Promise<RenderFunction>, options?: Omit<ComponentOptions, 'props' | 'emits' | 'slots'> & {
|
|
34
|
+
props?: ComponentObjectPropsOptions<Props>;
|
|
35
|
+
emits?: Emits | RuntimeEmitsKeys[];
|
|
36
|
+
slots?: Slots;
|
|
37
|
+
}): DefineSetupFnComponent<Props, Emits, SlotsType<Slots>>;
|
|
38
|
+
declare function defineComponent<TypeProps, RuntimePropsOptions extends ComponentObjectPropsOptions = ComponentObjectPropsOptions, RuntimePropsKeys extends string = string, TypeEmits extends ComponentTypeEmits = {}, RuntimeEmitsOptions extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Data = {}, SetupBindings = {}, Computed extends ComputedOptions = {}, Methods extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, InjectOptions extends ComponentInjectOptions = {}, InjectKeys extends string = string, Slots extends SlotsType = {}, LocalComponents extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, ResolvedEmits extends EmitsOptions = ({} extends RuntimeEmitsOptions ? TypeEmitsToOptions<TypeEmits> : RuntimeEmitsOptions), InferredProps = (IsKeyValues<TypeProps> extends true ? TypeProps : string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : { [key in RuntimePropsKeys]?: any }), TypeRefs extends Record<string, unknown> = {}, TypeEl extends Element = any>(options: {
|
|
39
|
+
props?: (RuntimePropsOptions & ThisType<void>) | RuntimePropsKeys[];
|
|
40
|
+
/**
|
|
41
|
+
* @private
|
|
42
|
+
*/
|
|
43
|
+
__typeProps?: TypeProps;
|
|
44
|
+
/**
|
|
45
|
+
* @private
|
|
46
|
+
*/
|
|
47
|
+
__typeEmits?: TypeEmits;
|
|
48
|
+
/**
|
|
49
|
+
* @private
|
|
50
|
+
*/
|
|
51
|
+
__typeRefs?: TypeRefs;
|
|
52
|
+
/**
|
|
53
|
+
* @private
|
|
54
|
+
*/
|
|
55
|
+
__typeEl?: TypeEl;
|
|
56
|
+
} & ComponentOptionsBase<ToResolvedProps<InferredProps, ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, RuntimeEmitsOptions, RuntimeEmitsKeys, {}, // Defaults
|
|
57
|
+
InjectOptions, InjectKeys, Slots, LocalComponents, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstanceWithMixins<ToResolvedProps<InferredProps, ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, {}, {}, false, InjectOptions, Slots, LocalComponents, Directives, string>>): DefineComponent<InferredProps, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, RuntimeEmitsKeys, PublicProps, ToResolvedProps<InferredProps, ResolvedEmits>, ExtractDefaultPropTypes<RuntimePropsOptions>, Slots, LocalComponents, Directives, Exposed, Provide, unknown extends TypeProps ? true : false, TypeRefs, TypeEl>;
|
|
7
58
|
//#endregion
|
|
8
|
-
export { createVNodeCache, normalizeSlot, normalizeVNode };
|
|
59
|
+
export { DefineComponent, DefineSetupFnComponent, createVNodeCache, defineComponent, normalizeSlot, normalizeVNode };
|
package/dist/vdom.d.ts
CHANGED
|
@@ -1,8 +1,59 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as ToResolvedProps, i as ResolvePropsWithSlots, n as IsKeyValues } from "./types-miAxCbY6.js";
|
|
2
|
+
import { Component, ComponentInjectOptions, ComponentObjectPropsOptions, ComponentOptions, ComponentOptionsBase, ComponentOptionsMixin, ComponentPropsOptions, ComponentProvideOptions, ComponentPublicInstance, ComponentTypeEmits, ComputedOptions, CreateComponentPublicInstanceWithMixins, Directive, EmitFn, EmitsOptions, EmitsToProps, ExtractDefaultPropTypes, ExtractPropTypes, GlobalComponents, GlobalDirectives, MethodOptions, PublicProps, SetupContext, Slot, SlotsType, TypeEmitsToOptions, VNode, VNodeChild } from "vue";
|
|
2
3
|
|
|
3
4
|
//#region src/vdom.d.ts
|
|
4
5
|
declare function createVNodeCache(key: string): any;
|
|
5
6
|
declare function normalizeVNode(value: VNodeChild | (() => VNodeChild), flag?: number): VNode;
|
|
6
7
|
declare const normalizeSlot: (rawSlot: Function) => Slot;
|
|
8
|
+
type RenderFunction = () => VNodeChild | {};
|
|
9
|
+
type ComponentPublicInstanceConstructor<T extends ComponentPublicInstance<Props, RawBindings, D, C, M> = ComponentPublicInstance<any>, Props = any, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions> = {
|
|
10
|
+
__isFragment?: never;
|
|
11
|
+
__isTeleport?: never;
|
|
12
|
+
__isSuspense?: never;
|
|
13
|
+
new (...args: any[]): T;
|
|
14
|
+
};
|
|
15
|
+
type ResolveProps<PropsOrPropOptions, E extends EmitsOptions> = Readonly<PropsOrPropOptions extends ComponentPropsOptions ? ExtractPropTypes<PropsOrPropOptions> : PropsOrPropOptions> & ({} extends E ? {} : EmitsToProps<E>);
|
|
16
|
+
type DefineComponent<PropsOrPropOptions = {}, RawBindings = {}, D = {}, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, PP = PublicProps, Props = ResolveProps<PropsOrPropOptions, E>, Defaults = ExtractDefaultPropTypes<PropsOrPropOptions>, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, MakeDefaultsOptional extends boolean = true, TypeRefs extends Record<string, unknown> = {}, TypeEl extends Element = any> = ComponentPublicInstanceConstructor<CreateComponentPublicInstanceWithMixins<ResolvePropsWithSlots<Props, SetupContext<EmitsOptions, S>['slots']>, RawBindings, D, C, M, Mixin, Extends, E, PP, Defaults, MakeDefaultsOptional, {}, S, LC & GlobalComponents, Directives & GlobalDirectives, Exposed, TypeRefs, TypeEl>> & ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, {}, string, S, LC & GlobalComponents, Directives & GlobalDirectives, Exposed, Provide> & PP;
|
|
17
|
+
type DefineSetupFnComponent<P extends Record<string, any>, E extends EmitsOptions = {}, S extends SlotsType = SlotsType, Props = P & EmitsToProps<E>, PP = PublicProps> = new (props: Props & PP) => CreateComponentPublicInstanceWithMixins<ResolvePropsWithSlots<Props, SetupContext<EmitsOptions, S>['slots']>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, E, PP, {}, false, {}, S>;
|
|
18
|
+
declare function defineComponent<Props extends Record<string, any>, Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends Record<string, any> = {}, Exposed extends Record<string, any> = Record<string, any>>(setup: (this: void, props: Props, ctx: {
|
|
19
|
+
emit: EmitFn<Emits>;
|
|
20
|
+
slots: Slots;
|
|
21
|
+
attrs: Record<string, any>;
|
|
22
|
+
expose: (exposed: Exposed) => void;
|
|
23
|
+
}) => RenderFunction | Promise<RenderFunction>, options?: Omit<ComponentOptions, 'props' | 'emits' | 'slots'> & {
|
|
24
|
+
props?: (keyof NoInfer<Props>)[];
|
|
25
|
+
emits?: Emits | RuntimeEmitsKeys[];
|
|
26
|
+
slots?: Slots;
|
|
27
|
+
}): DefineSetupFnComponent<Props, Emits, SlotsType<Slots>>;
|
|
28
|
+
declare function defineComponent<Props extends Record<string, any>, Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends Record<string, any> = {}, Exposed extends Record<string, any> = Record<string, any>>(setup: (this: void, props: Props, ctx: {
|
|
29
|
+
emit: EmitFn<Emits>;
|
|
30
|
+
slots: Slots;
|
|
31
|
+
attrs: Record<string, any>;
|
|
32
|
+
expose: (exposed: Exposed) => void;
|
|
33
|
+
}) => RenderFunction | Promise<RenderFunction>, options?: Omit<ComponentOptions, 'props' | 'emits' | 'slots'> & {
|
|
34
|
+
props?: ComponentObjectPropsOptions<Props>;
|
|
35
|
+
emits?: Emits | RuntimeEmitsKeys[];
|
|
36
|
+
slots?: Slots;
|
|
37
|
+
}): DefineSetupFnComponent<Props, Emits, SlotsType<Slots>>;
|
|
38
|
+
declare function defineComponent<TypeProps, RuntimePropsOptions extends ComponentObjectPropsOptions = ComponentObjectPropsOptions, RuntimePropsKeys extends string = string, TypeEmits extends ComponentTypeEmits = {}, RuntimeEmitsOptions extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Data = {}, SetupBindings = {}, Computed extends ComputedOptions = {}, Methods extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, InjectOptions extends ComponentInjectOptions = {}, InjectKeys extends string = string, Slots extends SlotsType = {}, LocalComponents extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, ResolvedEmits extends EmitsOptions = ({} extends RuntimeEmitsOptions ? TypeEmitsToOptions<TypeEmits> : RuntimeEmitsOptions), InferredProps = (IsKeyValues<TypeProps> extends true ? TypeProps : string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : { [key in RuntimePropsKeys]?: any }), TypeRefs extends Record<string, unknown> = {}, TypeEl extends Element = any>(options: {
|
|
39
|
+
props?: (RuntimePropsOptions & ThisType<void>) | RuntimePropsKeys[];
|
|
40
|
+
/**
|
|
41
|
+
* @private
|
|
42
|
+
*/
|
|
43
|
+
__typeProps?: TypeProps;
|
|
44
|
+
/**
|
|
45
|
+
* @private
|
|
46
|
+
*/
|
|
47
|
+
__typeEmits?: TypeEmits;
|
|
48
|
+
/**
|
|
49
|
+
* @private
|
|
50
|
+
*/
|
|
51
|
+
__typeRefs?: TypeRefs;
|
|
52
|
+
/**
|
|
53
|
+
* @private
|
|
54
|
+
*/
|
|
55
|
+
__typeEl?: TypeEl;
|
|
56
|
+
} & ComponentOptionsBase<ToResolvedProps<InferredProps, ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, RuntimeEmitsOptions, RuntimeEmitsKeys, {}, // Defaults
|
|
57
|
+
InjectOptions, InjectKeys, Slots, LocalComponents, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstanceWithMixins<ToResolvedProps<InferredProps, ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, {}, {}, false, InjectOptions, Slots, LocalComponents, Directives, string>>): DefineComponent<InferredProps, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, RuntimeEmitsKeys, PublicProps, ToResolvedProps<InferredProps, ResolvedEmits>, ExtractDefaultPropTypes<RuntimePropsOptions>, Slots, LocalComponents, Directives, Exposed, Provide, unknown extends TypeProps ? true : false, TypeRefs, TypeEl>;
|
|
7
58
|
//#endregion
|
|
8
|
-
export { createVNodeCache, normalizeSlot, normalizeVNode };
|
|
59
|
+
export { DefineComponent, DefineSetupFnComponent, createVNodeCache, defineComponent, normalizeSlot, normalizeVNode };
|
package/dist/vdom.js
CHANGED
|
@@ -27,12 +27,14 @@ function cloneIfMounted(child) {
|
|
|
27
27
|
const normalizeSlotValue = (value) => Array.isArray(value) ? value.map((n) => normalizeVNode(n)) : [normalizeVNode(value)];
|
|
28
28
|
const normalizeSlot = (rawSlot) => {
|
|
29
29
|
if (rawSlot._n) return rawSlot;
|
|
30
|
-
|
|
30
|
+
return withCtx((...args) => {
|
|
31
31
|
return normalizeSlotValue(rawSlot(...args));
|
|
32
32
|
});
|
|
33
|
-
normalized._c = false;
|
|
34
|
-
return normalized;
|
|
35
33
|
};
|
|
34
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
35
|
+
function defineComponent(options, extraOptions) {
|
|
36
|
+
return typeof options === "function" ? Object.assign({ name: options.name }, extraOptions, { setup: options }) : options;
|
|
37
|
+
}
|
|
36
38
|
|
|
37
39
|
//#endregion
|
|
38
|
-
export { createVNodeCache, normalizeSlot, normalizeVNode };
|
|
40
|
+
export { createVNodeCache, defineComponent, normalizeSlot, normalizeVNode };
|