@antdv-next/x 0.1.0 → 0.3.0
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/LICENSE +21 -0
- package/dist/_utils/vue.d.ts +2 -0
- package/dist/_utils/vue.js +16 -0
- package/dist/actions/Actions.js +3 -2
- package/dist/actions/ActionsCopy.js +4 -4
- package/dist/attachments/PlaceholderUploader.d.ts +16 -0
- package/dist/attachments/PlaceholderUploader.js +31 -5
- package/dist/attachments/index.d.ts +8 -5
- package/dist/attachments/index.js +7 -6
- package/dist/bubble/Bubble.js +5 -8
- package/dist/bubble/BubbleList.js +4 -4
- package/dist/bubble/Divider.js +1 -1
- package/dist/code-highlighter/shiki.js +2 -1
- package/dist/conversations/GroupTitle.d.ts +22 -2
- package/dist/conversations/GroupTitle.js +25 -3
- package/dist/conversations/Item.d.ts +1 -1
- package/dist/conversations/Item.js +1 -4
- package/dist/conversations/index.d.ts +10 -1
- package/dist/conversations/index.js +12 -0
- package/dist/conversations/interface.d.ts +7 -0
- package/dist/file-card/FileCard.js +1 -1
- package/dist/file-card/List.js +1 -1
- package/dist/file-card/components/File.d.ts +6 -6
- package/dist/file-card/components/File.js +2 -2
- package/dist/index.esm.js +151 -116
- package/dist/index.umd.js +150 -115
- package/dist/mermaid/Mermaid.d.ts +5 -0
- package/dist/mermaid/Mermaid.js +22 -1
- package/dist/mermaid/index.d.ts +1 -1
- package/dist/package.js +1 -1
- package/dist/prompts/Prompts.d.ts +1 -10
- package/dist/prompts/Prompts.js +2 -11
- package/dist/prompts/interface.d.ts +0 -1
- package/dist/sources/Sources.d.ts +0 -9
- package/dist/sources/Sources.js +1 -9
- package/dist/sources/components/CarouselCard.js +1 -4
- package/dist/sources/interface.d.ts +0 -1
- package/dist/suggestion/Suggestion.d.ts +0 -18
- package/dist/suggestion/Suggestion.js +2 -18
- package/dist/suggestion/interface.d.ts +0 -2
- package/dist/thought-chain/Item.js +3 -6
- package/dist/thought-chain/Node.js +1 -4
- package/package.json +2 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fragment, Teleport, Transition, TransitionGroup, computed, createTextVNode, createVNode, defineComponent, inject, isVNode, mergeProps, nextTick, onBeforeUnmount, onMounted, provide, ref, render, shallowRef, toRefs, unref, useAttrs, useSlots, vShow, watch, withDirectives } from "vue";
|
|
1
|
+
import { Comment, Fragment, Teleport, Transition, TransitionGroup, computed, createTextVNode, createVNode, defineComponent, inject, isVNode, mergeProps, nextTick, onBeforeUnmount, onMounted, provide, ref, render, shallowRef, toRefs, unref, useAttrs, useSlots, vShow, watch, withDirectives } from "vue";
|
|
2
2
|
import { useConfig } from "antdv-next/dist/config-provider/context";
|
|
3
3
|
import { Button, Carousel, Cascader, ConfigProvider, Divider, Dropdown, Flex, Image as Image$1, Input, Popover, Progress, Segmented, Skeleton, Spin, TextArea, Tooltip, Typography, Upload, theme } from "antdv-next";
|
|
4
4
|
import Icon, { ArrowUpOutlined, AudioMutedOutlined, AudioOutlined, CheckCircleOutlined, CheckOutlined, ClearOutlined, CloseCircleFilled, CloseCircleOutlined, CloseOutlined, CopyOutlined, DislikeFilled, DislikeOutlined, DownloadOutlined, EllipsisOutlined, FileExcelFilled, FileImageFilled, FileMarkdownFilled, FilePdfFilled, FilePptFilled, FileTextFilled, FileWordFilled, FileZipFilled, JavaOutlined, JavaScriptOutlined, LeftOutlined, LikeFilled, LikeOutlined, LoadingOutlined, MinusCircleOutlined, MoonOutlined, MutedOutlined, PlusOutlined, PythonOutlined, RightOutlined, SoundOutlined, SunOutlined, ZoomInOutlined, ZoomOutOutlined } from "@antdv-next/icons";
|
|
@@ -13,7 +13,7 @@ import lightTheme from "shiki/dist/themes/vitesse-light.mjs";
|
|
|
13
13
|
import { createJavaScriptRegexEngine } from "shiki/engine/javascript";
|
|
14
14
|
import { KeyCode, classNames } from "@v-c/util";
|
|
15
15
|
//#region package.json
|
|
16
|
-
var version = "0.
|
|
16
|
+
var version = "0.3.0";
|
|
17
17
|
//#endregion
|
|
18
18
|
//#region components/x-provider/context.ts
|
|
19
19
|
var XProviderContextKey = Symbol("antdv-next-x-provider-context");
|
|
@@ -39,6 +39,20 @@ function useXComponentConfig(component) {
|
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
//#endregion
|
|
42
|
+
//#region components/_utils/vue.ts
|
|
43
|
+
function isEmptyNode(node) {
|
|
44
|
+
if (node === null || node === void 0 || typeof node === "boolean") return true;
|
|
45
|
+
if (Array.isArray(node)) return node.every(isEmptyNode);
|
|
46
|
+
if (isVNode(node)) {
|
|
47
|
+
if (node.type === Comment) return true;
|
|
48
|
+
if (node.type === Fragment && Array.isArray(node.children)) return node.children.every((child) => isEmptyNode(child));
|
|
49
|
+
}
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
function hasRenderableNode(node) {
|
|
53
|
+
return !isEmptyNode(node);
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
42
56
|
//#region components/actions/ActionsMenu.tsx
|
|
43
57
|
var keySeed$1 = 0;
|
|
44
58
|
function findItem(keyPath, items) {
|
|
@@ -618,8 +632,8 @@ var XActions = /* @__PURE__ */ defineComponent({
|
|
|
618
632
|
});
|
|
619
633
|
const mergedItem = {
|
|
620
634
|
...item,
|
|
621
|
-
icon: slottedIcon
|
|
622
|
-
actionRender: slotActionNode !== void 0 ? slotActionNode : item.actionRender
|
|
635
|
+
icon: slottedIcon !== void 0 && !isEmptyNode(slottedIcon) ? slottedIcon : item.icon,
|
|
636
|
+
actionRender: slotActionNode !== void 0 && !isEmptyNode(slotActionNode) ? slotActionNode : item.actionRender
|
|
623
637
|
};
|
|
624
638
|
return createVNode(Item, {
|
|
625
639
|
"key": item.key ?? idx,
|
|
@@ -909,14 +923,14 @@ var XActionsCopy = /* @__PURE__ */ defineComponent({
|
|
|
909
923
|
const { class: _class, style: _style, ...rest } = attrs;
|
|
910
924
|
return rest;
|
|
911
925
|
});
|
|
912
|
-
const
|
|
926
|
+
const iconSlot = computed(() => slots.icon);
|
|
913
927
|
const mergedCopyIcons = computed(() => {
|
|
914
928
|
const [defaultOriginNode, copiedOriginNode] = normalizeCopyIcons(props.icon);
|
|
915
|
-
if (!
|
|
916
|
-
return [
|
|
929
|
+
if (!iconSlot.value) return props.icon;
|
|
930
|
+
return [iconSlot.value({
|
|
917
931
|
originNode: defaultOriginNode,
|
|
918
932
|
status: "default"
|
|
919
|
-
}),
|
|
933
|
+
}), iconSlot.value({
|
|
920
934
|
originNode: copiedOriginNode,
|
|
921
935
|
status: "copied"
|
|
922
936
|
})];
|
|
@@ -1271,7 +1285,7 @@ var File = /* @__PURE__ */ defineComponent({
|
|
|
1271
1285
|
type: Function,
|
|
1272
1286
|
default: void 0
|
|
1273
1287
|
},
|
|
1274
|
-
|
|
1288
|
+
iconSlot: {
|
|
1275
1289
|
type: Function,
|
|
1276
1290
|
default: void 0
|
|
1277
1291
|
}
|
|
@@ -1332,7 +1346,7 @@ var File = /* @__PURE__ */ defineComponent({
|
|
|
1332
1346
|
color: props.iconColor,
|
|
1333
1347
|
...props.styles.icon
|
|
1334
1348
|
}
|
|
1335
|
-
}, [renderWithSlot(props.
|
|
1349
|
+
}, [renderWithSlot(props.iconSlot, iconNode.value)]),
|
|
1336
1350
|
createVNode("div", { "class": `${compCls.value}-content` }, [createVNode("div", {
|
|
1337
1351
|
"class": [`${compCls.value}-name`, props.classes.name],
|
|
1338
1352
|
"style": props.styles.name
|
|
@@ -2139,7 +2153,7 @@ var XFileCard = /* @__PURE__ */ defineComponent({
|
|
|
2139
2153
|
"mask": props.mask,
|
|
2140
2154
|
"descriptionRenderSlot": slots.description,
|
|
2141
2155
|
"maskRenderSlot": slots.mask,
|
|
2142
|
-
"
|
|
2156
|
+
"iconSlot": slots.icon,
|
|
2143
2157
|
"classes": mergedClasses.value,
|
|
2144
2158
|
"styles": mergedStyles.value
|
|
2145
2159
|
}, null);
|
|
@@ -2349,7 +2363,7 @@ var XFileCardList = /* @__PURE__ */ defineComponent({
|
|
|
2349
2363
|
item: fileItem,
|
|
2350
2364
|
index: itemIndex
|
|
2351
2365
|
}) : void 0,
|
|
2352
|
-
|
|
2366
|
+
icon: slots.iconRender ? (slotInfo) => slots.iconRender?.({
|
|
2353
2367
|
...slotInfo,
|
|
2354
2368
|
item: fileItem,
|
|
2355
2369
|
index: itemIndex
|
|
@@ -2674,6 +2688,10 @@ var PlaceholderUploader = /* @__PURE__ */ defineComponent({
|
|
|
2674
2688
|
type: String,
|
|
2675
2689
|
required: true
|
|
2676
2690
|
},
|
|
2691
|
+
type: {
|
|
2692
|
+
type: String,
|
|
2693
|
+
required: true
|
|
2694
|
+
},
|
|
2677
2695
|
placeholder: {
|
|
2678
2696
|
type: [
|
|
2679
2697
|
String,
|
|
@@ -2721,6 +2739,28 @@ var PlaceholderUploader = /* @__PURE__ */ defineComponent({
|
|
|
2721
2739
|
if (!isConfig.value) return {};
|
|
2722
2740
|
return props.placeholder;
|
|
2723
2741
|
});
|
|
2742
|
+
const renderConfigNode = () => {
|
|
2743
|
+
const iconOriginNode = placeholderConfig.value.icon;
|
|
2744
|
+
const titleOriginNode = placeholderConfig.value.title;
|
|
2745
|
+
const descriptionOriginNode = placeholderConfig.value.description;
|
|
2746
|
+
const iconNode = slots.placeholderIcon?.({
|
|
2747
|
+
type: props.type,
|
|
2748
|
+
originNode: iconOriginNode
|
|
2749
|
+
}) ?? iconOriginNode;
|
|
2750
|
+
const titleNode = slots.placeholderTitle?.({
|
|
2751
|
+
type: props.type,
|
|
2752
|
+
originNode: titleOriginNode
|
|
2753
|
+
}) ?? titleOriginNode;
|
|
2754
|
+
const descriptionNode = slots.placeholderDescription?.({
|
|
2755
|
+
type: props.type,
|
|
2756
|
+
originNode: descriptionOriginNode
|
|
2757
|
+
}) ?? descriptionOriginNode;
|
|
2758
|
+
return createVNode("div", { "class": `${placeholderCls.value}-inner` }, [
|
|
2759
|
+
createVNode("span", { "class": `${placeholderCls.value}-icon` }, [iconNode]),
|
|
2760
|
+
createVNode("span", { "class": `${placeholderCls.value}-title` }, [titleNode]),
|
|
2761
|
+
createVNode("span", { "class": `${placeholderCls.value}-description` }, [descriptionNode])
|
|
2762
|
+
]);
|
|
2763
|
+
};
|
|
2724
2764
|
const onDragEnter = () => {
|
|
2725
2765
|
dragIn.value = true;
|
|
2726
2766
|
};
|
|
@@ -2731,11 +2771,11 @@ var PlaceholderUploader = /* @__PURE__ */ defineComponent({
|
|
|
2731
2771
|
dragIn.value = false;
|
|
2732
2772
|
};
|
|
2733
2773
|
return () => {
|
|
2734
|
-
const
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2774
|
+
const originNode = isConfig.value ? renderConfigNode() : slots.default?.() || props.placeholder;
|
|
2775
|
+
const node = slots.placeholder?.({
|
|
2776
|
+
type: props.type,
|
|
2777
|
+
originNode
|
|
2778
|
+
}) ?? originNode;
|
|
2739
2779
|
return createVNode("div", {
|
|
2740
2780
|
"class": [
|
|
2741
2781
|
placeholderCls.value,
|
|
@@ -2968,10 +3008,6 @@ var XAttachments = /* @__PURE__ */ defineComponent({
|
|
|
2968
3008
|
type: Function,
|
|
2969
3009
|
default: void 0
|
|
2970
3010
|
},
|
|
2971
|
-
onChange: {
|
|
2972
|
-
type: Function,
|
|
2973
|
-
default: void 0
|
|
2974
|
-
},
|
|
2975
3011
|
onRemove: {
|
|
2976
3012
|
type: Function,
|
|
2977
3013
|
default: void 0
|
|
@@ -3013,7 +3049,6 @@ var XAttachments = /* @__PURE__ */ defineComponent({
|
|
|
3013
3049
|
});
|
|
3014
3050
|
const triggerChange = (info) => {
|
|
3015
3051
|
fileList.value = info.fileList;
|
|
3016
|
-
props.onChange?.(info);
|
|
3017
3052
|
emit("change", info);
|
|
3018
3053
|
};
|
|
3019
3054
|
const onUploadChange = (info) => {
|
|
@@ -3078,12 +3113,18 @@ var XAttachments = /* @__PURE__ */ defineComponent({
|
|
|
3078
3113
|
const getPlaceholderNode = (type, options) => {
|
|
3079
3114
|
const placeholderContent = typeof props.placeholder === "function" ? props.placeholder(type) : props.placeholder;
|
|
3080
3115
|
return createVNode(PlaceholderUploader, {
|
|
3116
|
+
"type": type,
|
|
3081
3117
|
"placeholder": placeholderContent,
|
|
3082
3118
|
"upload": uploadProps.value,
|
|
3083
3119
|
"prefixCls": props.prefixCls,
|
|
3084
3120
|
"class": mergedClasses.value.placeholder,
|
|
3085
3121
|
"style": [mergedStyles.value.placeholder, options?.style]
|
|
3086
|
-
},
|
|
3122
|
+
}, {
|
|
3123
|
+
placeholder: slots.placeholder,
|
|
3124
|
+
placeholderIcon: slots.placeholderIcon,
|
|
3125
|
+
placeholderTitle: slots.placeholderTitle,
|
|
3126
|
+
placeholderDescription: slots.placeholderDescription
|
|
3127
|
+
});
|
|
3087
3128
|
};
|
|
3088
3129
|
const renderWithChildren = () => {
|
|
3089
3130
|
let _slot;
|
|
@@ -3818,10 +3859,6 @@ function renderBubbleSlot(slot, content, info) {
|
|
|
3818
3859
|
if (!slot) return null;
|
|
3819
3860
|
return typeof slot === "function" ? slot(content, info) : slot;
|
|
3820
3861
|
}
|
|
3821
|
-
function hasRenderableNode$7(node) {
|
|
3822
|
-
if (Array.isArray(node)) return node.some((item) => item !== null && item !== void 0 && item !== false);
|
|
3823
|
-
return node !== null && node !== void 0 && node !== false;
|
|
3824
|
-
}
|
|
3825
3862
|
var XBubble = /* @__PURE__ */ defineComponent({
|
|
3826
3863
|
name: "AxBubble",
|
|
3827
3864
|
inheritAttrs: false,
|
|
@@ -3985,12 +4022,12 @@ var XBubble = /* @__PURE__ */ defineComponent({
|
|
|
3985
4022
|
return rest;
|
|
3986
4023
|
});
|
|
3987
4024
|
const memoedContent = computed(() => {
|
|
3988
|
-
if (slots.
|
|
3989
|
-
const slotNode = slots.
|
|
4025
|
+
if (slots.content) {
|
|
4026
|
+
const slotNode = slots.content({
|
|
3990
4027
|
content: props.content,
|
|
3991
4028
|
info: props.info
|
|
3992
4029
|
});
|
|
3993
|
-
if (hasRenderableNode
|
|
4030
|
+
if (hasRenderableNode(slotNode)) return slotNode;
|
|
3994
4031
|
}
|
|
3995
4032
|
return props.contentRender ? props.contentRender(props.content, props.info) : props.content;
|
|
3996
4033
|
});
|
|
@@ -4081,12 +4118,12 @@ var XBubble = /* @__PURE__ */ defineComponent({
|
|
|
4081
4118
|
};
|
|
4082
4119
|
const renderContent = () => {
|
|
4083
4120
|
if (props.loading) {
|
|
4084
|
-
if (slots.
|
|
4085
|
-
const slotNode = slots.
|
|
4121
|
+
if (slots.loading) {
|
|
4122
|
+
const slotNode = slots.loading({
|
|
4086
4123
|
content: props.content,
|
|
4087
4124
|
info: props.info
|
|
4088
4125
|
});
|
|
4089
|
-
if (hasRenderableNode
|
|
4126
|
+
if (hasRenderableNode(slotNode)) return slotNode;
|
|
4090
4127
|
}
|
|
4091
4128
|
if (props.loadingRender) return props.loadingRender(props.content, props.info);
|
|
4092
4129
|
return createVNode(loading_default, { "prefixCls": props.prefixCls }, null);
|
|
@@ -4226,7 +4263,7 @@ var XBubbleDivider = /* @__PURE__ */ defineComponent({
|
|
|
4226
4263
|
"class": [`${props.prefixCls}-divider`, props.class],
|
|
4227
4264
|
"styles": props.styles,
|
|
4228
4265
|
"classes": props.classes
|
|
4229
|
-
}), {
|
|
4266
|
+
}), { content: ({ content }) => createVNode(Divider, props.dividerProps, _isSlot$3(content) ? content : { default: () => [content] }) });
|
|
4230
4267
|
}
|
|
4231
4268
|
});
|
|
4232
4269
|
//#endregion
|
|
@@ -4661,10 +4698,10 @@ var XBubbleList = /* @__PURE__ */ defineComponent({
|
|
|
4661
4698
|
role
|
|
4662
4699
|
});
|
|
4663
4700
|
};
|
|
4664
|
-
if (slots.contentRender) bubbleSlots.
|
|
4665
|
-
else if (contentRender) bubbleSlots.
|
|
4666
|
-
if (slots.loadingRender) bubbleSlots.
|
|
4667
|
-
else if (loadingRender) bubbleSlots.
|
|
4701
|
+
if (slots.contentRender) bubbleSlots.content = bindListSlot("contentRender");
|
|
4702
|
+
else if (contentRender) bubbleSlots.content = ({ content, info: bubbleInfo }) => contentRender(content, bubbleInfo);
|
|
4703
|
+
if (slots.loadingRender) bubbleSlots.loading = bindListSlot("loadingRender");
|
|
4704
|
+
else if (loadingRender) bubbleSlots.loading = ({ content, info: bubbleInfo }) => loadingRender(content, bubbleInfo);
|
|
4668
4705
|
for (const name of bubbleSlotNames) {
|
|
4669
4706
|
if (name === "contentRender" || name === "loadingRender") continue;
|
|
4670
4707
|
const slot = bindListSlot(name);
|
|
@@ -4732,7 +4769,8 @@ async function getHighlighter() {
|
|
|
4732
4769
|
}
|
|
4733
4770
|
async function loadLang(lang) {
|
|
4734
4771
|
const loader = LANG_LOADERS[lang];
|
|
4735
|
-
if (!loader
|
|
4772
|
+
if (!loader) return false;
|
|
4773
|
+
if (loadedLangs.has(lang)) return true;
|
|
4736
4774
|
const instance = await getHighlighter();
|
|
4737
4775
|
const mod = await loader();
|
|
4738
4776
|
await instance.loadLanguage(mod.default);
|
|
@@ -5479,6 +5517,20 @@ var GroupTitle = /* @__PURE__ */ defineComponent({
|
|
|
5479
5517
|
type: Object,
|
|
5480
5518
|
required: true
|
|
5481
5519
|
},
|
|
5520
|
+
groupLabelRender: {
|
|
5521
|
+
type: [
|
|
5522
|
+
String,
|
|
5523
|
+
Number,
|
|
5524
|
+
Object,
|
|
5525
|
+
Array,
|
|
5526
|
+
Function
|
|
5527
|
+
],
|
|
5528
|
+
default: void 0
|
|
5529
|
+
},
|
|
5530
|
+
groupLabelRenderSlot: {
|
|
5531
|
+
type: Function,
|
|
5532
|
+
default: void 0
|
|
5533
|
+
},
|
|
5482
5534
|
classes: {
|
|
5483
5535
|
type: [
|
|
5484
5536
|
String,
|
|
@@ -5514,15 +5566,22 @@ var GroupTitle = /* @__PURE__ */ defineComponent({
|
|
|
5514
5566
|
});
|
|
5515
5567
|
const labelNode = computed(() => {
|
|
5516
5568
|
const { label, name } = props.groupInfo;
|
|
5517
|
-
|
|
5518
|
-
|
|
5569
|
+
const originNode = typeof label === "function" ? label(name, { groupInfo: props.groupInfo }) : label || name;
|
|
5570
|
+
const renderInfo = {
|
|
5571
|
+
group: name,
|
|
5572
|
+
groupInfo: props.groupInfo,
|
|
5573
|
+
originNode
|
|
5574
|
+
};
|
|
5575
|
+
if (props.groupLabelRenderSlot) return props.groupLabelRenderSlot(renderInfo);
|
|
5576
|
+
if (props.groupLabelRender !== void 0) return typeof props.groupLabelRender === "function" ? props.groupLabelRender(name, renderInfo) : props.groupLabelRender;
|
|
5577
|
+
return originNode;
|
|
5519
5578
|
});
|
|
5520
5579
|
return () => createVNode("li", { "class": props.classes }, [createVNode("div", {
|
|
5521
5580
|
"class": [`${props.prefixCls}-group-title`, { [`${props.prefixCls}-group-title-collapsible`]: mergeCollapsible.value }],
|
|
5522
5581
|
"onClick": () => {
|
|
5523
5582
|
if (mergeCollapsible.value) props.onItemExpand?.(props.groupInfo.name);
|
|
5524
5583
|
}
|
|
5525
|
-
}, [labelNode.value && createVNode("div", { "class": `${props.prefixCls}-group-label` }, [labelNode.value]), mergeCollapsible.value && createVNode("div", { "class": [`${props.prefixCls}-group-collapse-trigger`, `${props.prefixCls}-group-collapse-trigger-${groupOpen.value ? "open" : "close"}`] }, [createVNode(RightOutlined, null, null)])]), createVNode(Transition, props.collapseTransition ?? {}, { default: () => [mergeCollapsible.value ? groupOpen.value ? createVNode("div", null, [slots.default?.()]) : null : createVNode("div", null, [slots.default?.()])] })]);
|
|
5584
|
+
}, [hasRenderableNode(labelNode.value) && createVNode("div", { "class": `${props.prefixCls}-group-label` }, [labelNode.value]), mergeCollapsible.value && createVNode("div", { "class": [`${props.prefixCls}-group-collapse-trigger`, `${props.prefixCls}-group-collapse-trigger-${groupOpen.value ? "open" : "close"}`] }, [createVNode(RightOutlined, null, null)])]), createVNode(Transition, props.collapseTransition ?? {}, { default: () => [mergeCollapsible.value ? groupOpen.value ? createVNode("div", null, [slots.default?.()]) : null : createVNode("div", null, [slots.default?.()])] })]);
|
|
5526
5585
|
}
|
|
5527
5586
|
});
|
|
5528
5587
|
//#endregion
|
|
@@ -5607,10 +5666,6 @@ function _isSlot$2(s) {
|
|
|
5607
5666
|
var stopPropagation = (event) => {
|
|
5608
5667
|
event.stopPropagation();
|
|
5609
5668
|
};
|
|
5610
|
-
var hasRenderableNode$6 = (node) => {
|
|
5611
|
-
if (Array.isArray(node)) return node.some((item) => item !== null && item !== void 0 && item !== false);
|
|
5612
|
-
return node !== null && node !== void 0 && node !== false;
|
|
5613
|
-
};
|
|
5614
5669
|
var renderWithPriority = (render, slotRender, info) => {
|
|
5615
5670
|
if (slotRender) return slotRender(info);
|
|
5616
5671
|
if (render !== void 0) return typeof render === "function" ? render(info.item, info) : render;
|
|
@@ -5741,7 +5796,7 @@ var ConversationsItem = /* @__PURE__ */ defineComponent({
|
|
|
5741
5796
|
if (!disabled) props.onClick?.(props.info.key, props.info);
|
|
5742
5797
|
}
|
|
5743
5798
|
}, [
|
|
5744
|
-
hasRenderableNode
|
|
5799
|
+
hasRenderableNode(iconNode) && createVNode("div", { "class": `${props.prefixCls}-icon` }, [iconNode]),
|
|
5745
5800
|
createVNode(Typography.Text, { "class": `${props.prefixCls}-label` }, _isSlot$2(labelNode) ? labelNode : { default: () => [labelNode] }),
|
|
5746
5801
|
!disabled && props.menu && createVNode("div", { "onClick": stopPropagation }, [createVNode(Dropdown, {
|
|
5747
5802
|
"menu": menuProps.value,
|
|
@@ -5962,6 +6017,16 @@ var ConversationsWithSub = /* @__PURE__ */ defineComponent({
|
|
|
5962
6017
|
],
|
|
5963
6018
|
default: void 0
|
|
5964
6019
|
},
|
|
6020
|
+
groupLabelRender: {
|
|
6021
|
+
type: [
|
|
6022
|
+
String,
|
|
6023
|
+
Number,
|
|
6024
|
+
Object,
|
|
6025
|
+
Array,
|
|
6026
|
+
Function
|
|
6027
|
+
],
|
|
6028
|
+
default: void 0
|
|
6029
|
+
},
|
|
5965
6030
|
menu: {
|
|
5966
6031
|
type: [Object, Function],
|
|
5967
6032
|
default: void 0
|
|
@@ -6133,6 +6198,8 @@ var ConversationsWithSub = /* @__PURE__ */ defineComponent({
|
|
|
6133
6198
|
"key": groupInfo.name || `key-${groupIndex}`,
|
|
6134
6199
|
"prefixCls": props.prefixCls,
|
|
6135
6200
|
"groupInfo": groupInfo,
|
|
6201
|
+
"groupLabelRender": props.groupLabelRender,
|
|
6202
|
+
"groupLabelRenderSlot": slots.groupLabelRender,
|
|
6136
6203
|
"classes": [contextConfig.value.classes?.group, props.classes?.group],
|
|
6137
6204
|
"enableCollapse": enableCollapse.value,
|
|
6138
6205
|
"expandedKeys": mergedExpandedKeys.value,
|
|
@@ -6411,6 +6478,26 @@ var mermaid_default = /* @__PURE__ */ defineComponent({
|
|
|
6411
6478
|
const { class: _class, style: _style, ...rest } = attrs;
|
|
6412
6479
|
return rest;
|
|
6413
6480
|
});
|
|
6481
|
+
const getNamedSlot = (name) => slots[name] ?? slots[name.replace(/[A-Z]/g, (s) => `-${s.toLowerCase()}`)];
|
|
6482
|
+
const resolvedCustomActions = computed(() => mergedActions.value.customActions.map((item, index) => {
|
|
6483
|
+
const iconSlotInfo = {
|
|
6484
|
+
item,
|
|
6485
|
+
index,
|
|
6486
|
+
originNode: item.icon
|
|
6487
|
+
};
|
|
6488
|
+
const iconFromSlot = getNamedSlot("customActionIconRender")?.(iconSlotInfo);
|
|
6489
|
+
const actionSlotInfo = {
|
|
6490
|
+
item,
|
|
6491
|
+
index,
|
|
6492
|
+
originNode: item.actionRender !== void 0 ? typeof item.actionRender === "function" ? item.actionRender(item) : item.actionRender : void 0
|
|
6493
|
+
};
|
|
6494
|
+
const actionFromSlot = getNamedSlot("customActionRender")?.(actionSlotInfo);
|
|
6495
|
+
return {
|
|
6496
|
+
...item,
|
|
6497
|
+
icon: iconFromSlot !== void 0 && !isEmptyNode(iconFromSlot) ? iconFromSlot : item.icon,
|
|
6498
|
+
actionRender: actionFromSlot !== void 0 && !isEmptyNode(actionFromSlot) ? actionFromSlot : item.actionRender
|
|
6499
|
+
};
|
|
6500
|
+
}));
|
|
6414
6501
|
function applySvgTransform() {
|
|
6415
6502
|
if (mergedRenderType.value !== RenderType.Image) return;
|
|
6416
6503
|
const svgEl = graphRef.value?.querySelector("svg");
|
|
@@ -6538,7 +6625,7 @@ var mermaid_default = /* @__PURE__ */ defineComponent({
|
|
|
6538
6625
|
key: "copy",
|
|
6539
6626
|
actionRender: () => createVNode(ActionsWithSub.Copy, { "text": props.content }, null)
|
|
6540
6627
|
});
|
|
6541
|
-
return [...items, ...
|
|
6628
|
+
return [...items, ...resolvedCustomActions.value];
|
|
6542
6629
|
});
|
|
6543
6630
|
function renderHeader() {
|
|
6544
6631
|
if (props.header === null) return null;
|
|
@@ -6878,10 +6965,6 @@ function getItemDomAttrs(item) {
|
|
|
6878
6965
|
delete domAttrs.children;
|
|
6879
6966
|
return domAttrs;
|
|
6880
6967
|
}
|
|
6881
|
-
function hasRenderableNode$5(node) {
|
|
6882
|
-
if (Array.isArray(node)) return node.some((item) => item !== null && item !== void 0 && item !== false);
|
|
6883
|
-
return node !== null && node !== void 0 && node !== false;
|
|
6884
|
-
}
|
|
6885
6968
|
//#endregion
|
|
6886
6969
|
//#region components/prompts/index.tsx
|
|
6887
6970
|
var prompts_default = /* @__PURE__ */ defineComponent({
|
|
@@ -6901,10 +6984,6 @@ var prompts_default = /* @__PURE__ */ defineComponent({
|
|
|
6901
6984
|
],
|
|
6902
6985
|
default: void 0
|
|
6903
6986
|
},
|
|
6904
|
-
onItemClick: {
|
|
6905
|
-
type: Function,
|
|
6906
|
-
default: void 0
|
|
6907
|
-
},
|
|
6908
6987
|
vertical: {
|
|
6909
6988
|
type: Boolean,
|
|
6910
6989
|
default: false
|
|
@@ -7006,9 +7085,7 @@ var prompts_default = /* @__PURE__ */ defineComponent({
|
|
|
7006
7085
|
});
|
|
7007
7086
|
const triggerItemClick = (item, nested) => {
|
|
7008
7087
|
if (item.disabled || !nested && hasChildren(item)) return;
|
|
7009
|
-
|
|
7010
|
-
props.onItemClick?.(info);
|
|
7011
|
-
emit("itemClick", info);
|
|
7088
|
+
emit("itemClick", { data: item });
|
|
7012
7089
|
};
|
|
7013
7090
|
const renderTitle = () => {
|
|
7014
7091
|
if (slots.title) return slots.title({ originNode: props.title });
|
|
@@ -7054,12 +7131,12 @@ var prompts_default = /* @__PURE__ */ defineComponent({
|
|
|
7054
7131
|
],
|
|
7055
7132
|
"style": [nested ? mergedStyles.value.subItem : mergedStyles.value.item, item.style],
|
|
7056
7133
|
"onClick": () => triggerItemClick(item, nested)
|
|
7057
|
-
}), [hasRenderableNode
|
|
7134
|
+
}), [hasRenderableNode(iconNode) && createVNode("div", { "class": `${props.prefixCls}-icon` }, [iconNode]), createVNode("div", {
|
|
7058
7135
|
"class": [`${props.prefixCls}-content`, mergedClasses.value.itemContent],
|
|
7059
7136
|
"style": mergedStyles.value.itemContent
|
|
7060
7137
|
}, [
|
|
7061
|
-
hasRenderableNode
|
|
7062
|
-
hasRenderableNode
|
|
7138
|
+
hasRenderableNode(labelNode) && createVNode("div", { "class": `${props.prefixCls}-label` }, [labelNode]),
|
|
7139
|
+
hasRenderableNode(descriptionNode) && createVNode("div", { "class": `${props.prefixCls}-desc` }, [descriptionNode]),
|
|
7063
7140
|
itemHasChildren && createVNode("div", { "class": `${props.prefixCls}-nested` }, [renderItems(item.children, true)])
|
|
7064
7141
|
])]);
|
|
7065
7142
|
})]);
|
|
@@ -7084,7 +7161,7 @@ var prompts_default = /* @__PURE__ */ defineComponent({
|
|
|
7084
7161
|
attrs.style,
|
|
7085
7162
|
props.style
|
|
7086
7163
|
]
|
|
7087
|
-
}), [hasRenderableNode
|
|
7164
|
+
}), [hasRenderableNode(renderTitle()) && createVNode("div", {
|
|
7088
7165
|
"class": [`${props.prefixCls}-title`, mergedClasses.value.title],
|
|
7089
7166
|
"style": mergedStyles.value.title
|
|
7090
7167
|
}, [renderTitle()]), renderItems(props.items)]);
|
|
@@ -9282,10 +9359,6 @@ Sender.Header = SenderHeader_default;
|
|
|
9282
9359
|
Sender.Switch = SenderSwitch_default;
|
|
9283
9360
|
//#endregion
|
|
9284
9361
|
//#region components/sources/components/CarouselCard.tsx
|
|
9285
|
-
var hasRenderableNode$4 = (node) => {
|
|
9286
|
-
if (Array.isArray(node)) return node.some((item) => item !== null && item !== void 0 && item !== false);
|
|
9287
|
-
return node !== null && node !== void 0 && node !== false;
|
|
9288
|
-
};
|
|
9289
9362
|
var CarouselCard = /* @__PURE__ */ defineComponent({
|
|
9290
9363
|
name: "XSourcesCarouselCard",
|
|
9291
9364
|
props: {
|
|
@@ -9396,7 +9469,7 @@ var CarouselCard = /* @__PURE__ */ defineComponent({
|
|
|
9396
9469
|
"key": item.key ?? index,
|
|
9397
9470
|
"class": `${compCls}-item`,
|
|
9398
9471
|
"onClick": () => handleClick(item)
|
|
9399
|
-
}, [createVNode("div", { "class": `${compCls}-item-title-wrapper` }, [hasRenderableNode
|
|
9472
|
+
}, [createVNode("div", { "class": `${compCls}-item-title-wrapper` }, [hasRenderableNode(iconNode) && createVNode("span", { "class": `${compCls}-item-icon` }, [iconNode]), createVNode("span", { "class": `${compCls}-item-title` }, [titleNode])]), hasRenderableNode(descriptionNode) && createVNode("div", { "class": `${compCls}-item-description` }, [descriptionNode])]);
|
|
9400
9473
|
})())] })]);
|
|
9401
9474
|
}
|
|
9402
9475
|
});
|
|
@@ -9501,12 +9574,6 @@ var style_default$4 = genStyleHooks("Sources", (token) => {
|
|
|
9501
9574
|
return [genSourcesStyle(compToken), genCollapseMotion(compToken)];
|
|
9502
9575
|
}, prepareComponentToken$4);
|
|
9503
9576
|
//#endregion
|
|
9504
|
-
//#region components/sources/Sources.tsx
|
|
9505
|
-
var hasRenderableNode$3 = (node) => {
|
|
9506
|
-
if (Array.isArray(node)) return node.some((item) => item !== null && item !== void 0 && item !== false);
|
|
9507
|
-
return node !== null && node !== void 0 && node !== false;
|
|
9508
|
-
};
|
|
9509
|
-
//#endregion
|
|
9510
9577
|
//#region components/sources/index.tsx
|
|
9511
9578
|
var sources_default = /* @__PURE__ */ defineComponent({
|
|
9512
9579
|
name: "AxSources",
|
|
@@ -9583,10 +9650,6 @@ var sources_default = /* @__PURE__ */ defineComponent({
|
|
|
9583
9650
|
defaultExpanded: {
|
|
9584
9651
|
type: Boolean,
|
|
9585
9652
|
default: void 0
|
|
9586
|
-
},
|
|
9587
|
-
onExpand: {
|
|
9588
|
-
type: Function,
|
|
9589
|
-
default: void 0
|
|
9590
9653
|
}
|
|
9591
9654
|
},
|
|
9592
9655
|
emits: ["expand"],
|
|
@@ -9609,7 +9672,6 @@ var sources_default = /* @__PURE__ */ defineComponent({
|
|
|
9609
9672
|
const toggleExpand = () => {
|
|
9610
9673
|
const newExpand = !isExpand.value;
|
|
9611
9674
|
if (props.expanded === void 0) innerExpanded.value = newExpand;
|
|
9612
|
-
props.onExpand?.(newExpand);
|
|
9613
9675
|
emit("expand", newExpand);
|
|
9614
9676
|
};
|
|
9615
9677
|
const domAttrs = computed(() => {
|
|
@@ -9659,9 +9721,9 @@ var sources_default = /* @__PURE__ */ defineComponent({
|
|
|
9659
9721
|
"target": "_blank",
|
|
9660
9722
|
"rel": "noopener noreferrer"
|
|
9661
9723
|
}, [
|
|
9662
|
-
hasRenderableNode
|
|
9724
|
+
hasRenderableNode(iconNode) && createVNode("span", { "class": `${props.prefixCls}-link-icon` }, [iconNode]),
|
|
9663
9725
|
createVNode("span", { "class": `${props.prefixCls}-link-title` }, [titleNode]),
|
|
9664
|
-
hasRenderableNode
|
|
9726
|
+
hasRenderableNode(descriptionNode) && createVNode("span", { "class": `${props.prefixCls}-link-description` }, [descriptionNode])
|
|
9665
9727
|
])]);
|
|
9666
9728
|
})]) : slots.default?.();
|
|
9667
9729
|
return createVNode("div", mergeProps({ "ref": rootRef }, domAttrs.value, {
|
|
@@ -9809,12 +9871,6 @@ function useActive(items, open, rtl, onCancel) {
|
|
|
9809
9871
|
return [activePaths, onKeyDown];
|
|
9810
9872
|
}
|
|
9811
9873
|
//#endregion
|
|
9812
|
-
//#region components/suggestion/Suggestion.tsx
|
|
9813
|
-
var hasRenderableNode$2 = (node) => {
|
|
9814
|
-
if (Array.isArray(node)) return node.some((item) => item !== null && item !== void 0 && item !== false);
|
|
9815
|
-
return node !== null && node !== void 0 && node !== false;
|
|
9816
|
-
};
|
|
9817
|
-
//#endregion
|
|
9818
9874
|
//#region components/suggestion/index.tsx
|
|
9819
9875
|
var suggestion_default = /* @__PURE__ */ defineComponent({
|
|
9820
9876
|
name: "AxSuggestion",
|
|
@@ -9856,14 +9912,6 @@ var suggestion_default = /* @__PURE__ */ defineComponent({
|
|
|
9856
9912
|
type: Boolean,
|
|
9857
9913
|
default: void 0
|
|
9858
9914
|
},
|
|
9859
|
-
onOpenChange: {
|
|
9860
|
-
type: Function,
|
|
9861
|
-
default: void 0
|
|
9862
|
-
},
|
|
9863
|
-
onSelect: {
|
|
9864
|
-
type: Function,
|
|
9865
|
-
default: void 0
|
|
9866
|
-
},
|
|
9867
9915
|
items: {
|
|
9868
9916
|
type: [Array, Function],
|
|
9869
9917
|
default: () => []
|
|
@@ -9906,7 +9954,6 @@ var suggestion_default = /* @__PURE__ */ defineComponent({
|
|
|
9906
9954
|
}, { immediate: true });
|
|
9907
9955
|
const triggerOpen = (nextOpen) => {
|
|
9908
9956
|
if (props.open === void 0) innerOpen.value = nextOpen;
|
|
9909
|
-
props.onOpenChange?.(nextOpen);
|
|
9910
9957
|
emit("openChange", nextOpen);
|
|
9911
9958
|
};
|
|
9912
9959
|
const onClose = () => {
|
|
@@ -9924,11 +9971,7 @@ var suggestion_default = /* @__PURE__ */ defineComponent({
|
|
|
9924
9971
|
const path = Array.isArray(valuePath) ? valuePath : [];
|
|
9925
9972
|
const lastValue = path[path.length - 1];
|
|
9926
9973
|
const selected = selectedOptions ?? [];
|
|
9927
|
-
if (lastValue !== void 0)
|
|
9928
|
-
const selectedValue = String(lastValue);
|
|
9929
|
-
props.onSelect?.(selectedValue, selected);
|
|
9930
|
-
emit("select", selectedValue, selected);
|
|
9931
|
-
}
|
|
9974
|
+
if (lastValue !== void 0) emit("select", String(lastValue), selected);
|
|
9932
9975
|
triggerOpen(false);
|
|
9933
9976
|
};
|
|
9934
9977
|
const [activePath, onKeyDown] = useActive(itemList, mergedOpen, isRtl, onClose);
|
|
@@ -9971,9 +10014,9 @@ var suggestion_default = /* @__PURE__ */ defineComponent({
|
|
|
9971
10014
|
originNode: item.extra
|
|
9972
10015
|
});
|
|
9973
10016
|
return createVNode(Flex, { "class": `${prefixCls.value}-item` }, { default: () => [
|
|
9974
|
-
hasRenderableNode
|
|
10017
|
+
hasRenderableNode(iconNode) && createVNode("div", { "class": `${prefixCls.value}-item-icon` }, [iconNode]),
|
|
9975
10018
|
labelNode,
|
|
9976
|
-
hasRenderableNode
|
|
10019
|
+
hasRenderableNode(extraNode) && createVNode("div", { "class": `${prefixCls.value}-item-extra` }, [extraNode])
|
|
9977
10020
|
] });
|
|
9978
10021
|
},
|
|
9979
10022
|
"classes": { popup: { root: popupRootClass.value } },
|
|
@@ -10500,10 +10543,6 @@ var style_default$1 = genStyleHooks("ThoughtChain", (token) => {
|
|
|
10500
10543
|
}, prepareComponentToken$1);
|
|
10501
10544
|
//#endregion
|
|
10502
10545
|
//#region components/thought-chain/Item.tsx
|
|
10503
|
-
function hasRenderableNode$1(node) {
|
|
10504
|
-
if (Array.isArray(node)) return node.some((item) => item !== null && item !== void 0 && item !== false);
|
|
10505
|
-
return node !== null && node !== void 0 && node !== false;
|
|
10506
|
-
}
|
|
10507
10546
|
var XThoughtChainItem = /* @__PURE__ */ defineComponent({
|
|
10508
10547
|
name: "AxThoughtChainItem",
|
|
10509
10548
|
props: {
|
|
@@ -10583,16 +10622,16 @@ var XThoughtChainItem = /* @__PURE__ */ defineComponent({
|
|
|
10583
10622
|
return () => {
|
|
10584
10623
|
const cls = itemPrefixCls.value;
|
|
10585
10624
|
const statusCls = `${props.prefixCls}-status`;
|
|
10586
|
-
const
|
|
10625
|
+
const iconSlot = slots.icon;
|
|
10587
10626
|
const originIconNode = props.status ? STATUS_ICON_MAP[props.status] : props.icon;
|
|
10588
|
-
const iconNode =
|
|
10627
|
+
const iconNode = iconSlot ? iconSlot({
|
|
10589
10628
|
originNode: originIconNode,
|
|
10590
10629
|
status: props.status
|
|
10591
10630
|
}) : originIconNode;
|
|
10592
10631
|
const titleNode = slots.title ? slots.title({ originNode: props.title }) : props.title;
|
|
10593
10632
|
const descriptionNode = slots.description ? slots.description({ originNode: props.description }) : props.description;
|
|
10594
|
-
const hasTitle = hasRenderableNode
|
|
10595
|
-
const hasDescription = hasRenderableNode
|
|
10633
|
+
const hasTitle = hasRenderableNode(titleNode);
|
|
10634
|
+
const hasDescription = hasRenderableNode(descriptionNode);
|
|
10596
10635
|
return createVNode("div", {
|
|
10597
10636
|
"ref": rootRef,
|
|
10598
10637
|
"class": [
|
|
@@ -10612,7 +10651,7 @@ var XThoughtChainItem = /* @__PURE__ */ defineComponent({
|
|
|
10612
10651
|
],
|
|
10613
10652
|
"style": props.styles?.root,
|
|
10614
10653
|
"onClick": handleClick
|
|
10615
|
-
}, [hasRenderableNode
|
|
10654
|
+
}, [hasRenderableNode(iconNode) && createVNode("div", {
|
|
10616
10655
|
"style": props.styles?.icon,
|
|
10617
10656
|
"class": [
|
|
10618
10657
|
statusCls,
|
|
@@ -10635,10 +10674,6 @@ var XThoughtChainItem = /* @__PURE__ */ defineComponent({
|
|
|
10635
10674
|
});
|
|
10636
10675
|
//#endregion
|
|
10637
10676
|
//#region components/thought-chain/Node.tsx
|
|
10638
|
-
function hasRenderableNode(node) {
|
|
10639
|
-
if (Array.isArray(node)) return node.some((item) => item !== null && item !== void 0 && item !== false);
|
|
10640
|
-
return node !== null && node !== void 0 && node !== false;
|
|
10641
|
-
}
|
|
10642
10677
|
var Node_default = /* @__PURE__ */ defineComponent({
|
|
10643
10678
|
name: "ThoughtChainNode",
|
|
10644
10679
|
props: {
|