@vue-jsx-vapor/runtime 3.2.5 → 3.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/raw.cjs +1 -1
- package/dist/raw.js +1 -1
- package/dist/vdom.cjs +15 -4
- package/dist/vdom.d.cts +4 -3
- package/dist/vdom.d.ts +4 -3
- package/dist/vdom.js +16 -6
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -16,6 +16,7 @@ exports.getCurrentInstance = require_props.getCurrentInstance;
|
|
|
16
16
|
exports.h = require_h.h;
|
|
17
17
|
exports.isBlock = require_vapor.isBlock;
|
|
18
18
|
exports.normalizeNode = require_vapor.normalizeNode;
|
|
19
|
+
exports.normalizeSlot = require_vdom.normalizeSlot;
|
|
19
20
|
exports.normalizeVNode = require_vdom.normalizeVNode;
|
|
20
21
|
exports.setNodes = require_vapor.setNodes;
|
|
21
22
|
exports.ssrRegisterHelper = require_ssr.ssrRegisterHelper;
|
package/dist/index.d.cts
CHANGED
|
@@ -3,6 +3,6 @@ import { h } from "./h.cjs";
|
|
|
3
3
|
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
4
|
import { getCurrentInstance, useFullProps, useProps } from "./props.cjs";
|
|
5
5
|
import { ssrRegisterHelper } from "./ssr.cjs";
|
|
6
|
-
import { createVNodeCache, normalizeVNode } from "./vdom.cjs";
|
|
6
|
+
import { createVNodeCache, normalizeSlot, normalizeVNode } from "./vdom.cjs";
|
|
7
7
|
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, normalizeVNode, setNodes, ssrRegisterHelper, useFullProps, useProps, useRef };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,6 @@ import { h } from "./h.js";
|
|
|
3
3
|
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
4
|
import { getCurrentInstance, useFullProps, useProps } from "./props.js";
|
|
5
5
|
import { ssrRegisterHelper } from "./ssr.js";
|
|
6
|
-
import { createVNodeCache, normalizeVNode } from "./vdom.js";
|
|
6
|
+
import { createVNodeCache, normalizeSlot, normalizeVNode } from "./vdom.js";
|
|
7
7
|
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, normalizeVNode, setNodes, ssrRegisterHelper, useFullProps, useProps, useRef };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ 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, normalizeVNode } from "./vdom.js";
|
|
6
|
+
import { createVNodeCache, 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, normalizeVNode, setNodes, ssrRegisterHelper, useFullProps, useProps, useRef };
|
|
9
|
+
export { createComponent, createNodes, createProxyComponent, createVNodeCache, defineVaporSSRComponent, getCurrentInstance, h, isBlock, normalizeNode, normalizeSlot, normalizeVNode, setNodes, ssrRegisterHelper, useFullProps, useProps, useRef };
|
package/dist/raw.cjs
CHANGED
|
@@ -12,7 +12,7 @@ var vapor_default = "import {\n EffectScope,\n Fragment,\n getCurrentInstance
|
|
|
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} 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
|
|
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 const normalized = withCtx((...args) => {\n return normalizeSlotValue(rawSlot(...args));\n });\n normalized._c = false;\n return normalized;\n};\n";
|
|
16
16
|
|
|
17
17
|
//#endregion
|
|
18
18
|
//#region src/raw.ts
|
package/dist/raw.js
CHANGED
|
@@ -11,7 +11,7 @@ var vapor_default = "import {\n EffectScope,\n Fragment,\n getCurrentInstance
|
|
|
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} 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
|
|
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 const normalized = withCtx((...args) => {\n return normalizeSlotValue(rawSlot(...args));\n });\n normalized._c = false;\n return normalized;\n};\n";
|
|
15
15
|
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region src/raw.ts
|
package/dist/vdom.cjs
CHANGED
|
@@ -11,20 +11,31 @@ function createVNodeCache(key) {
|
|
|
11
11
|
return caches[key] || (caches[key] = []);
|
|
12
12
|
} else return [];
|
|
13
13
|
}
|
|
14
|
-
function normalizeVNode(value
|
|
14
|
+
function normalizeVNode(value, flag = 1) {
|
|
15
15
|
let create = vue.createVNode;
|
|
16
|
-
|
|
17
|
-
if (
|
|
16
|
+
let isBlock = false;
|
|
17
|
+
if (typeof value === "function") {
|
|
18
|
+
isBlock = true;
|
|
18
19
|
(0, vue.openBlock)();
|
|
19
20
|
create = vue.createBlock;
|
|
20
21
|
value = value();
|
|
21
22
|
}
|
|
22
|
-
return (0, vue.isVNode)(value) ? isBlock ? (0, vue.createBlock)(cloneIfMounted(value)) : cloneIfMounted(value) : Array.isArray(value) ?
|
|
23
|
+
return (0, vue.isVNode)(value) ? isBlock ? (0, vue.createBlock)(cloneIfMounted(value)) : cloneIfMounted(value) : Array.isArray(value) ? isBlock ? (0, vue.createElementBlock)(vue.Fragment, null, value.map((n) => normalizeVNode(() => n)), -2) : (0, vue.createElementVNode)(vue.Fragment, null, value.slice()) : value == null || typeof value === "boolean" ? create(vue.Comment) : create(vue.Text, null, String(value), flag);
|
|
23
24
|
}
|
|
24
25
|
function cloneIfMounted(child) {
|
|
25
26
|
return child.el === null && child.patchFlag !== -1 || child.memo ? child : (0, vue.cloneVNode)(child);
|
|
26
27
|
}
|
|
28
|
+
const normalizeSlotValue = (value) => Array.isArray(value) ? value.map((n) => normalizeVNode(n)) : [normalizeVNode(value)];
|
|
29
|
+
const normalizeSlot = (rawSlot) => {
|
|
30
|
+
if (rawSlot._n) return rawSlot;
|
|
31
|
+
const normalized = (0, vue.withCtx)((...args) => {
|
|
32
|
+
return normalizeSlotValue(rawSlot(...args));
|
|
33
|
+
});
|
|
34
|
+
normalized._c = false;
|
|
35
|
+
return normalized;
|
|
36
|
+
};
|
|
27
37
|
|
|
28
38
|
//#endregion
|
|
29
39
|
exports.createVNodeCache = createVNodeCache;
|
|
40
|
+
exports.normalizeSlot = normalizeSlot;
|
|
30
41
|
exports.normalizeVNode = normalizeVNode;
|
package/dist/vdom.d.cts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { VNode } from "vue";
|
|
1
|
+
import { Slot, VNode, VNodeChild } from "vue";
|
|
2
2
|
|
|
3
3
|
//#region src/vdom.d.ts
|
|
4
4
|
declare function createVNodeCache(key: string): any;
|
|
5
|
-
declare function normalizeVNode(value
|
|
5
|
+
declare function normalizeVNode(value: VNodeChild | (() => VNodeChild), flag?: number): VNode;
|
|
6
|
+
declare const normalizeSlot: (rawSlot: Function) => Slot;
|
|
6
7
|
//#endregion
|
|
7
|
-
export { createVNodeCache, normalizeVNode };
|
|
8
|
+
export { createVNodeCache, normalizeSlot, normalizeVNode };
|
package/dist/vdom.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { VNode } from "vue";
|
|
1
|
+
import { Slot, VNode, VNodeChild } from "vue";
|
|
2
2
|
|
|
3
3
|
//#region src/vdom.d.ts
|
|
4
4
|
declare function createVNodeCache(key: string): any;
|
|
5
|
-
declare function normalizeVNode(value
|
|
5
|
+
declare function normalizeVNode(value: VNodeChild | (() => VNodeChild), flag?: number): VNode;
|
|
6
|
+
declare const normalizeSlot: (rawSlot: Function) => Slot;
|
|
6
7
|
//#endregion
|
|
7
|
-
export { createVNodeCache, normalizeVNode };
|
|
8
|
+
export { createVNodeCache, normalizeSlot, normalizeVNode };
|
package/dist/vdom.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Comment, Fragment, Text, cloneVNode, createBlock, createElementBlock, createElementVNode, createVNode, getCurrentInstance, isVNode, openBlock } from "vue";
|
|
1
|
+
import { Comment, Fragment, Text, cloneVNode, createBlock, createElementBlock, createElementVNode, createVNode, getCurrentInstance, isVNode, openBlock, withCtx } from "vue";
|
|
2
2
|
|
|
3
3
|
//#region src/vdom.ts
|
|
4
4
|
const cacheMap = /* @__PURE__ */ new WeakMap();
|
|
@@ -10,19 +10,29 @@ function createVNodeCache(key) {
|
|
|
10
10
|
return caches[key] || (caches[key] = []);
|
|
11
11
|
} else return [];
|
|
12
12
|
}
|
|
13
|
-
function normalizeVNode(value
|
|
13
|
+
function normalizeVNode(value, flag = 1) {
|
|
14
14
|
let create = createVNode;
|
|
15
|
-
|
|
16
|
-
if (
|
|
15
|
+
let isBlock = false;
|
|
16
|
+
if (typeof value === "function") {
|
|
17
|
+
isBlock = true;
|
|
17
18
|
openBlock();
|
|
18
19
|
create = createBlock;
|
|
19
20
|
value = value();
|
|
20
21
|
}
|
|
21
|
-
return isVNode(value) ? isBlock ? createBlock(cloneIfMounted(value)) : cloneIfMounted(value) : Array.isArray(value) ?
|
|
22
|
+
return isVNode(value) ? isBlock ? createBlock(cloneIfMounted(value)) : cloneIfMounted(value) : Array.isArray(value) ? isBlock ? createElementBlock(Fragment, null, value.map((n) => normalizeVNode(() => n)), -2) : createElementVNode(Fragment, null, value.slice()) : value == null || typeof value === "boolean" ? create(Comment) : create(Text, null, String(value), flag);
|
|
22
23
|
}
|
|
23
24
|
function cloneIfMounted(child) {
|
|
24
25
|
return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
|
|
25
26
|
}
|
|
27
|
+
const normalizeSlotValue = (value) => Array.isArray(value) ? value.map((n) => normalizeVNode(n)) : [normalizeVNode(value)];
|
|
28
|
+
const normalizeSlot = (rawSlot) => {
|
|
29
|
+
if (rawSlot._n) return rawSlot;
|
|
30
|
+
const normalized = withCtx((...args) => {
|
|
31
|
+
return normalizeSlotValue(rawSlot(...args));
|
|
32
|
+
});
|
|
33
|
+
normalized._c = false;
|
|
34
|
+
return normalized;
|
|
35
|
+
};
|
|
26
36
|
|
|
27
37
|
//#endregion
|
|
28
|
-
export { createVNodeCache, normalizeVNode };
|
|
38
|
+
export { createVNodeCache, normalizeSlot, normalizeVNode };
|