@antdv-next/x 0.0.4 → 0.2.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 +4 -3
- package/dist/actions/ActionsAudio.js +1 -1
- package/dist/actions/ActionsCopy.js +5 -5
- package/dist/actions/ActionsFeedback.js +1 -1
- package/dist/actions/ActionsItem.js +1 -1
- package/dist/attachments/PlaceholderUploader.d.ts +16 -0
- package/dist/attachments/PlaceholderUploader.js +31 -5
- package/dist/attachments/index.d.ts +8 -1
- package/dist/attachments/index.js +8 -2
- package/dist/bubble/Bubble.js +6 -9
- package/dist/bubble/BubbleList.js +5 -5
- package/dist/bubble/Divider.js +2 -2
- package/dist/bubble/System.js +1 -1
- package/dist/code-highlighter/CodeHighlighter.js +3 -14
- package/dist/code-highlighter/shiki.d.ts +4 -0
- package/dist/code-highlighter/shiki.js +73 -0
- package/dist/conversations/Creation.js +1 -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 +13 -1
- package/dist/conversations/interface.d.ts +7 -0
- package/dist/file-card/FileCard.js +2 -2
- package/dist/file-card/List.js +2 -2
- package/dist/file-card/components/File.d.ts +6 -6
- package/dist/file-card/components/File.js +2 -2
- package/dist/index.esm.js +287 -158
- package/dist/index.js +0 -25
- package/dist/index.umd.js +292 -162
- package/dist/mermaid/Mermaid.d.ts +6 -1
- package/dist/mermaid/Mermaid.js +27 -6
- package/dist/mermaid/index.d.ts +1 -1
- package/dist/mermaid/loader.d.ts +6 -0
- package/dist/mermaid/loader.js +33 -0
- package/dist/mermaid/mermaid-core.d.js +0 -0
- package/dist/package.js +1 -1
- package/dist/prompts/Prompts.js +7 -8
- package/dist/sender/Sender.js +1 -1
- package/dist/sender/SenderHeader.js +1 -1
- package/dist/sender/SenderSwitch.js +1 -1
- package/dist/sources/Sources.js +2 -5
- package/dist/sources/components/CarouselCard.js +1 -4
- package/dist/suggestion/Suggestion.js +2 -5
- package/dist/think/Think.js +1 -1
- package/dist/thought-chain/Item.js +4 -7
- package/dist/thought-chain/Node.js +1 -4
- package/dist/thought-chain/ThoughtChain.js +1 -1
- package/dist/welcome/index.js +1 -1
- package/dist/x-provider/index.js +1 -1
- package/global.d.ts +61 -18
- package/package.json +3 -2
package/dist/index.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(global, factory) {
|
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("vue"), require("antdv-next/dist/config-provider/context"), require("antdv-next"), require("@antdv-next/icons"), require("@antdv-next/cssinjs"), require("@antdv-next/cssinjs/cssinjs-utils"), require("@ant-design/fast-color"), require("antdv-next/dist/theme/useToken"), require("@vueuse/core"), require("
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("vue"), require("antdv-next/dist/config-provider/context"), require("antdv-next"), require("@antdv-next/icons"), require("@antdv-next/cssinjs"), require("@antdv-next/cssinjs/cssinjs-utils"), require("@ant-design/fast-color"), require("antdv-next/dist/theme/useToken"), require("@vueuse/core"), require("shiki/core"), require("shiki/dist/themes/vitesse-dark.mjs"), require("shiki/dist/themes/vitesse-light.mjs"), require("shiki/engine/javascript"), require("@v-c/util")) : typeof define === "function" && define.amd ? define([
|
|
3
3
|
"exports",
|
|
4
4
|
"vue",
|
|
5
5
|
"antdv-next/dist/config-provider/context",
|
|
@@ -10,10 +10,13 @@
|
|
|
10
10
|
"@ant-design/fast-color",
|
|
11
11
|
"antdv-next/dist/theme/useToken",
|
|
12
12
|
"@vueuse/core",
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
"shiki/core",
|
|
14
|
+
"shiki/dist/themes/vitesse-dark.mjs",
|
|
15
|
+
"shiki/dist/themes/vitesse-light.mjs",
|
|
16
|
+
"shiki/engine/javascript",
|
|
17
|
+
"@v-c/util"
|
|
18
|
+
], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.AntdComponents = {}, global.Vue, global.antdv_next_dist_config_provider_context, global.antd, global.AntdIcons, global._antdv_next_cssinjs, global._antdv_next_cssinjs_cssinjs_utils, global._ant_design_fast_color, global.antdv_next_dist_theme_useToken, global._vueuse_core, global.shiki_core, global.shiki_dist_themes_vitesse_dark_mjs, global.shiki_dist_themes_vitesse_light_mjs, global.shiki_engine_javascript, global._v_c_util));
|
|
19
|
+
})(this, function(exports, vue, antdv_next_dist_config_provider_context, antdv_next, _antdv_next_icons, _antdv_next_cssinjs, _antdv_next_cssinjs_cssinjs_utils, _ant_design_fast_color, antdv_next_dist_theme_useToken, _vueuse_core, shiki_core, shiki_dist_themes_vitesse_dark_mjs, shiki_dist_themes_vitesse_light_mjs, shiki_engine_javascript, _v_c_util) {
|
|
17
20
|
Object.defineProperties(exports, {
|
|
18
21
|
__esModule: { value: true },
|
|
19
22
|
[Symbol.toStringTag]: { value: "Module" }
|
|
@@ -42,9 +45,10 @@
|
|
|
42
45
|
//#endregion
|
|
43
46
|
_antdv_next_icons = __toESM(_antdv_next_icons);
|
|
44
47
|
antdv_next_dist_theme_useToken = __toESM(antdv_next_dist_theme_useToken);
|
|
45
|
-
|
|
48
|
+
shiki_dist_themes_vitesse_dark_mjs = __toESM(shiki_dist_themes_vitesse_dark_mjs);
|
|
49
|
+
shiki_dist_themes_vitesse_light_mjs = __toESM(shiki_dist_themes_vitesse_light_mjs);
|
|
46
50
|
//#region package.json
|
|
47
|
-
var version = "0.0
|
|
51
|
+
var version = "0.2.0";
|
|
48
52
|
//#endregion
|
|
49
53
|
//#region components/x-provider/context.ts
|
|
50
54
|
var XProviderContextKey = Symbol("antdv-next-x-provider-context");
|
|
@@ -70,6 +74,20 @@
|
|
|
70
74
|
});
|
|
71
75
|
}
|
|
72
76
|
//#endregion
|
|
77
|
+
//#region components/_utils/vue.ts
|
|
78
|
+
function isEmptyNode(node) {
|
|
79
|
+
if (node === null || node === void 0 || typeof node === "boolean") return true;
|
|
80
|
+
if (Array.isArray(node)) return node.every(isEmptyNode);
|
|
81
|
+
if ((0, vue.isVNode)(node)) {
|
|
82
|
+
if (node.type === vue.Comment) return true;
|
|
83
|
+
if (node.type === vue.Fragment && Array.isArray(node.children)) return node.children.every((child) => isEmptyNode(child));
|
|
84
|
+
}
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
function hasRenderableNode(node) {
|
|
88
|
+
return !isEmptyNode(node);
|
|
89
|
+
}
|
|
90
|
+
//#endregion
|
|
73
91
|
//#region components/actions/ActionsMenu.tsx
|
|
74
92
|
var keySeed$1 = 0;
|
|
75
93
|
function findItem(keyPath, items) {
|
|
@@ -539,7 +557,7 @@
|
|
|
539
557
|
};
|
|
540
558
|
}
|
|
541
559
|
var XActions = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
542
|
-
name: "
|
|
560
|
+
name: "AxActions",
|
|
543
561
|
inheritAttrs: false,
|
|
544
562
|
props: {
|
|
545
563
|
items: {
|
|
@@ -649,8 +667,8 @@
|
|
|
649
667
|
});
|
|
650
668
|
const mergedItem = {
|
|
651
669
|
...item,
|
|
652
|
-
icon: slottedIcon
|
|
653
|
-
actionRender: slotActionNode !== void 0 ? slotActionNode : item.actionRender
|
|
670
|
+
icon: slottedIcon !== void 0 && !isEmptyNode(slottedIcon) ? slottedIcon : item.icon,
|
|
671
|
+
actionRender: slotActionNode !== void 0 && !isEmptyNode(slotActionNode) ? slotActionNode : item.actionRender
|
|
654
672
|
};
|
|
655
673
|
return (0, vue.createVNode)(Item, {
|
|
656
674
|
"key": item.key ?? idx,
|
|
@@ -697,7 +715,7 @@
|
|
|
697
715
|
return ACTIONS_ITEM_STATUS;
|
|
698
716
|
}({});
|
|
699
717
|
var XActionsItem = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
700
|
-
name: "
|
|
718
|
+
name: "AxActionsItem",
|
|
701
719
|
inheritAttrs: false,
|
|
702
720
|
props: {
|
|
703
721
|
status: {
|
|
@@ -807,7 +825,7 @@
|
|
|
807
825
|
//#endregion
|
|
808
826
|
//#region components/actions/ActionsAudio.tsx
|
|
809
827
|
var XActionsAudio = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
810
|
-
name: "
|
|
828
|
+
name: "AxActionsAudio",
|
|
811
829
|
props: {
|
|
812
830
|
status: {
|
|
813
831
|
type: String,
|
|
@@ -881,7 +899,7 @@
|
|
|
881
899
|
return [icon, icon];
|
|
882
900
|
};
|
|
883
901
|
var XActionsCopy = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
884
|
-
name: "
|
|
902
|
+
name: "AxActionsCopy",
|
|
885
903
|
inheritAttrs: false,
|
|
886
904
|
props: {
|
|
887
905
|
text: {
|
|
@@ -940,14 +958,14 @@
|
|
|
940
958
|
const { class: _class, style: _style, ...rest } = attrs;
|
|
941
959
|
return rest;
|
|
942
960
|
});
|
|
943
|
-
const
|
|
961
|
+
const iconSlot = (0, vue.computed)(() => slots.icon);
|
|
944
962
|
const mergedCopyIcons = (0, vue.computed)(() => {
|
|
945
963
|
const [defaultOriginNode, copiedOriginNode] = normalizeCopyIcons(props.icon);
|
|
946
|
-
if (!
|
|
947
|
-
return [
|
|
964
|
+
if (!iconSlot.value) return props.icon;
|
|
965
|
+
return [iconSlot.value({
|
|
948
966
|
originNode: defaultOriginNode,
|
|
949
967
|
status: "default"
|
|
950
|
-
}),
|
|
968
|
+
}), iconSlot.value({
|
|
951
969
|
originNode: copiedOriginNode,
|
|
952
970
|
status: "copied"
|
|
953
971
|
})];
|
|
@@ -986,7 +1004,7 @@
|
|
|
986
1004
|
return FEEDBACK_VALUE;
|
|
987
1005
|
}(FEEDBACK_VALUE || {});
|
|
988
1006
|
var XActionsFeedback = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
989
|
-
name: "
|
|
1007
|
+
name: "AxActionsFeedback",
|
|
990
1008
|
inheritAttrs: false,
|
|
991
1009
|
props: {
|
|
992
1010
|
value: {
|
|
@@ -1302,7 +1320,7 @@
|
|
|
1302
1320
|
type: Function,
|
|
1303
1321
|
default: void 0
|
|
1304
1322
|
},
|
|
1305
|
-
|
|
1323
|
+
iconSlot: {
|
|
1306
1324
|
type: Function,
|
|
1307
1325
|
default: void 0
|
|
1308
1326
|
}
|
|
@@ -1363,7 +1381,7 @@
|
|
|
1363
1381
|
color: props.iconColor,
|
|
1364
1382
|
...props.styles.icon
|
|
1365
1383
|
}
|
|
1366
|
-
}, [renderWithSlot(props.
|
|
1384
|
+
}, [renderWithSlot(props.iconSlot, iconNode.value)]),
|
|
1367
1385
|
(0, vue.createVNode)("div", { "class": `${compCls.value}-content` }, [(0, vue.createVNode)("div", {
|
|
1368
1386
|
"class": [`${compCls.value}-name`, props.classes.name],
|
|
1369
1387
|
"style": props.styles.name
|
|
@@ -1964,7 +1982,7 @@
|
|
|
1964
1982
|
key: "default"
|
|
1965
1983
|
};
|
|
1966
1984
|
var XFileCard = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
1967
|
-
name: "
|
|
1985
|
+
name: "AxFileCard",
|
|
1968
1986
|
inheritAttrs: false,
|
|
1969
1987
|
props: {
|
|
1970
1988
|
prefixCls: {
|
|
@@ -2170,7 +2188,7 @@
|
|
|
2170
2188
|
"mask": props.mask,
|
|
2171
2189
|
"descriptionRenderSlot": slots.description,
|
|
2172
2190
|
"maskRenderSlot": slots.mask,
|
|
2173
|
-
"
|
|
2191
|
+
"iconSlot": slots.icon,
|
|
2174
2192
|
"classes": mergedClasses.value,
|
|
2175
2193
|
"styles": mergedStyles.value
|
|
2176
2194
|
}, null);
|
|
@@ -2203,7 +2221,7 @@
|
|
|
2203
2221
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !(0, vue.isVNode)(s);
|
|
2204
2222
|
}
|
|
2205
2223
|
var XFileCardList = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
2206
|
-
name: "
|
|
2224
|
+
name: "AxFileCardList",
|
|
2207
2225
|
props: {
|
|
2208
2226
|
prefixCls: {
|
|
2209
2227
|
type: String,
|
|
@@ -2380,7 +2398,7 @@
|
|
|
2380
2398
|
item: fileItem,
|
|
2381
2399
|
index: itemIndex
|
|
2382
2400
|
}) : void 0,
|
|
2383
|
-
|
|
2401
|
+
icon: slots.iconRender ? (slotInfo) => slots.iconRender?.({
|
|
2384
2402
|
...slotInfo,
|
|
2385
2403
|
item: fileItem,
|
|
2386
2404
|
index: itemIndex
|
|
@@ -2705,6 +2723,10 @@
|
|
|
2705
2723
|
type: String,
|
|
2706
2724
|
required: true
|
|
2707
2725
|
},
|
|
2726
|
+
type: {
|
|
2727
|
+
type: String,
|
|
2728
|
+
required: true
|
|
2729
|
+
},
|
|
2708
2730
|
placeholder: {
|
|
2709
2731
|
type: [
|
|
2710
2732
|
String,
|
|
@@ -2752,6 +2774,28 @@
|
|
|
2752
2774
|
if (!isConfig.value) return {};
|
|
2753
2775
|
return props.placeholder;
|
|
2754
2776
|
});
|
|
2777
|
+
const renderConfigNode = () => {
|
|
2778
|
+
const iconOriginNode = placeholderConfig.value.icon;
|
|
2779
|
+
const titleOriginNode = placeholderConfig.value.title;
|
|
2780
|
+
const descriptionOriginNode = placeholderConfig.value.description;
|
|
2781
|
+
const iconNode = slots.placeholderIcon?.({
|
|
2782
|
+
type: props.type,
|
|
2783
|
+
originNode: iconOriginNode
|
|
2784
|
+
}) ?? iconOriginNode;
|
|
2785
|
+
const titleNode = slots.placeholderTitle?.({
|
|
2786
|
+
type: props.type,
|
|
2787
|
+
originNode: titleOriginNode
|
|
2788
|
+
}) ?? titleOriginNode;
|
|
2789
|
+
const descriptionNode = slots.placeholderDescription?.({
|
|
2790
|
+
type: props.type,
|
|
2791
|
+
originNode: descriptionOriginNode
|
|
2792
|
+
}) ?? descriptionOriginNode;
|
|
2793
|
+
return (0, vue.createVNode)("div", { "class": `${placeholderCls.value}-inner` }, [
|
|
2794
|
+
(0, vue.createVNode)("span", { "class": `${placeholderCls.value}-icon` }, [iconNode]),
|
|
2795
|
+
(0, vue.createVNode)("span", { "class": `${placeholderCls.value}-title` }, [titleNode]),
|
|
2796
|
+
(0, vue.createVNode)("span", { "class": `${placeholderCls.value}-description` }, [descriptionNode])
|
|
2797
|
+
]);
|
|
2798
|
+
};
|
|
2755
2799
|
const onDragEnter = () => {
|
|
2756
2800
|
dragIn.value = true;
|
|
2757
2801
|
};
|
|
@@ -2762,11 +2806,11 @@
|
|
|
2762
2806
|
dragIn.value = false;
|
|
2763
2807
|
};
|
|
2764
2808
|
return () => {
|
|
2765
|
-
const
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2809
|
+
const originNode = isConfig.value ? renderConfigNode() : slots.default?.() || props.placeholder;
|
|
2810
|
+
const node = slots.placeholder?.({
|
|
2811
|
+
type: props.type,
|
|
2812
|
+
originNode
|
|
2813
|
+
}) ?? originNode;
|
|
2770
2814
|
return (0, vue.createVNode)("div", {
|
|
2771
2815
|
"class": [
|
|
2772
2816
|
placeholderCls.value,
|
|
@@ -2910,7 +2954,7 @@
|
|
|
2910
2954
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !(0, vue.isVNode)(s);
|
|
2911
2955
|
}
|
|
2912
2956
|
var XAttachments = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
2913
|
-
name: "
|
|
2957
|
+
name: "AxAttachments",
|
|
2914
2958
|
inheritAttrs: false,
|
|
2915
2959
|
props: {
|
|
2916
2960
|
prefixCls: {
|
|
@@ -3109,12 +3153,18 @@
|
|
|
3109
3153
|
const getPlaceholderNode = (type, options) => {
|
|
3110
3154
|
const placeholderContent = typeof props.placeholder === "function" ? props.placeholder(type) : props.placeholder;
|
|
3111
3155
|
return (0, vue.createVNode)(PlaceholderUploader, {
|
|
3156
|
+
"type": type,
|
|
3112
3157
|
"placeholder": placeholderContent,
|
|
3113
3158
|
"upload": uploadProps.value,
|
|
3114
3159
|
"prefixCls": props.prefixCls,
|
|
3115
3160
|
"class": mergedClasses.value.placeholder,
|
|
3116
3161
|
"style": [mergedStyles.value.placeholder, options?.style]
|
|
3117
|
-
},
|
|
3162
|
+
}, {
|
|
3163
|
+
placeholder: slots.placeholder,
|
|
3164
|
+
placeholderIcon: slots.placeholderIcon,
|
|
3165
|
+
placeholderTitle: slots.placeholderTitle,
|
|
3166
|
+
placeholderDescription: slots.placeholderDescription
|
|
3167
|
+
});
|
|
3118
3168
|
};
|
|
3119
3169
|
const renderWithChildren = () => {
|
|
3120
3170
|
let _slot;
|
|
@@ -3849,12 +3899,8 @@
|
|
|
3849
3899
|
if (!slot) return null;
|
|
3850
3900
|
return typeof slot === "function" ? slot(content, info) : slot;
|
|
3851
3901
|
}
|
|
3852
|
-
function hasRenderableNode$7(node) {
|
|
3853
|
-
if (Array.isArray(node)) return node.some((item) => item !== null && item !== void 0 && item !== false);
|
|
3854
|
-
return node !== null && node !== void 0 && node !== false;
|
|
3855
|
-
}
|
|
3856
3902
|
var XBubble = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
3857
|
-
name: "
|
|
3903
|
+
name: "AxBubble",
|
|
3858
3904
|
inheritAttrs: false,
|
|
3859
3905
|
props: {
|
|
3860
3906
|
prefixCls: {
|
|
@@ -4016,12 +4062,12 @@
|
|
|
4016
4062
|
return rest;
|
|
4017
4063
|
});
|
|
4018
4064
|
const memoedContent = (0, vue.computed)(() => {
|
|
4019
|
-
if (slots.
|
|
4020
|
-
const slotNode = slots.
|
|
4065
|
+
if (slots.content) {
|
|
4066
|
+
const slotNode = slots.content({
|
|
4021
4067
|
content: props.content,
|
|
4022
4068
|
info: props.info
|
|
4023
4069
|
});
|
|
4024
|
-
if (hasRenderableNode
|
|
4070
|
+
if (hasRenderableNode(slotNode)) return slotNode;
|
|
4025
4071
|
}
|
|
4026
4072
|
return props.contentRender ? props.contentRender(props.content, props.info) : props.content;
|
|
4027
4073
|
});
|
|
@@ -4112,12 +4158,12 @@
|
|
|
4112
4158
|
};
|
|
4113
4159
|
const renderContent = () => {
|
|
4114
4160
|
if (props.loading) {
|
|
4115
|
-
if (slots.
|
|
4116
|
-
const slotNode = slots.
|
|
4161
|
+
if (slots.loading) {
|
|
4162
|
+
const slotNode = slots.loading({
|
|
4117
4163
|
content: props.content,
|
|
4118
4164
|
info: props.info
|
|
4119
4165
|
});
|
|
4120
|
-
if (hasRenderableNode
|
|
4166
|
+
if (hasRenderableNode(slotNode)) return slotNode;
|
|
4121
4167
|
}
|
|
4122
4168
|
if (props.loadingRender) return props.loadingRender(props.content, props.info);
|
|
4123
4169
|
return (0, vue.createVNode)(loading_default, { "prefixCls": props.prefixCls }, null);
|
|
@@ -4195,7 +4241,7 @@
|
|
|
4195
4241
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !(0, vue.isVNode)(s);
|
|
4196
4242
|
}
|
|
4197
4243
|
var XBubbleDivider = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
4198
|
-
name: "
|
|
4244
|
+
name: "AxBubbleDivider",
|
|
4199
4245
|
props: {
|
|
4200
4246
|
prefixCls: {
|
|
4201
4247
|
type: String,
|
|
@@ -4257,7 +4303,7 @@
|
|
|
4257
4303
|
"class": [`${props.prefixCls}-divider`, props.class],
|
|
4258
4304
|
"styles": props.styles,
|
|
4259
4305
|
"classes": props.classes
|
|
4260
|
-
}), {
|
|
4306
|
+
}), { content: ({ content }) => (0, vue.createVNode)(antdv_next.Divider, props.dividerProps, _isSlot$3(content) ? content : { default: () => [content] }) });
|
|
4261
4307
|
}
|
|
4262
4308
|
});
|
|
4263
4309
|
//#endregion
|
|
@@ -4385,7 +4431,7 @@
|
|
|
4385
4431
|
//#endregion
|
|
4386
4432
|
//#region components/bubble/System.tsx
|
|
4387
4433
|
var XBubbleSystem = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
4388
|
-
name: "
|
|
4434
|
+
name: "AxBubbleSystem",
|
|
4389
4435
|
props: {
|
|
4390
4436
|
prefixCls: {
|
|
4391
4437
|
type: String,
|
|
@@ -4474,7 +4520,7 @@
|
|
|
4474
4520
|
"extra"
|
|
4475
4521
|
];
|
|
4476
4522
|
var XBubbleList = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
4477
|
-
name: "
|
|
4523
|
+
name: "AxBubbleList",
|
|
4478
4524
|
inheritAttrs: false,
|
|
4479
4525
|
props: {
|
|
4480
4526
|
prefixCls: {
|
|
@@ -4692,10 +4738,10 @@
|
|
|
4692
4738
|
role
|
|
4693
4739
|
});
|
|
4694
4740
|
};
|
|
4695
|
-
if (slots.contentRender) bubbleSlots.
|
|
4696
|
-
else if (contentRender) bubbleSlots.
|
|
4697
|
-
if (slots.loadingRender) bubbleSlots.
|
|
4698
|
-
else if (loadingRender) bubbleSlots.
|
|
4741
|
+
if (slots.contentRender) bubbleSlots.content = bindListSlot("contentRender");
|
|
4742
|
+
else if (contentRender) bubbleSlots.content = ({ content, info: bubbleInfo }) => contentRender(content, bubbleInfo);
|
|
4743
|
+
if (slots.loadingRender) bubbleSlots.loading = bindListSlot("loadingRender");
|
|
4744
|
+
else if (loadingRender) bubbleSlots.loading = ({ content, info: bubbleInfo }) => loadingRender(content, bubbleInfo);
|
|
4699
4745
|
for (const name of bubbleSlotNames) {
|
|
4700
4746
|
if (name === "contentRender" || name === "loadingRender") continue;
|
|
4701
4747
|
const slot = bindListSlot(name);
|
|
@@ -4712,6 +4758,74 @@
|
|
|
4712
4758
|
BubbleWithSub.System = XBubbleSystem;
|
|
4713
4759
|
BubbleWithSub.Divider = XBubbleDivider;
|
|
4714
4760
|
//#endregion
|
|
4761
|
+
//#region components/code-highlighter/shiki.ts
|
|
4762
|
+
var SUPPORTED_LANG_ALIASES = {
|
|
4763
|
+
ts: "typescript",
|
|
4764
|
+
js: "javascript",
|
|
4765
|
+
py: "python",
|
|
4766
|
+
md: "markdown",
|
|
4767
|
+
yml: "yaml",
|
|
4768
|
+
shell: "bash",
|
|
4769
|
+
zsh: "bash",
|
|
4770
|
+
sh: "bash",
|
|
4771
|
+
vue: "vue"
|
|
4772
|
+
};
|
|
4773
|
+
var LANG_LOADERS = {
|
|
4774
|
+
javascript: () => import("shiki/dist/langs/javascript.mjs"),
|
|
4775
|
+
typescript: () => import("shiki/dist/langs/typescript.mjs"),
|
|
4776
|
+
jsx: () => import("shiki/dist/langs/jsx.mjs"),
|
|
4777
|
+
tsx: () => import("shiki/dist/langs/tsx.mjs"),
|
|
4778
|
+
json: () => import("shiki/dist/langs/json.mjs"),
|
|
4779
|
+
bash: () => import("shiki/dist/langs/bash.mjs"),
|
|
4780
|
+
markdown: () => import("shiki/dist/langs/markdown.mjs"),
|
|
4781
|
+
html: () => import("shiki/dist/langs/html.mjs"),
|
|
4782
|
+
css: () => import("shiki/dist/langs/css.mjs"),
|
|
4783
|
+
vue: () => import("shiki/dist/langs/vue.mjs"),
|
|
4784
|
+
"vue-html": () => import("shiki/dist/langs/vue-html.mjs"),
|
|
4785
|
+
python: () => import("shiki/dist/langs/python.mjs"),
|
|
4786
|
+
mermaid: () => import("shiki/dist/langs/mermaid.mjs"),
|
|
4787
|
+
yaml: () => import("shiki/dist/langs/yaml.mjs"),
|
|
4788
|
+
diff: () => import("shiki/dist/langs/diff.mjs")
|
|
4789
|
+
};
|
|
4790
|
+
var highlighter = null;
|
|
4791
|
+
var highlighterPromise = null;
|
|
4792
|
+
var loadedLangs = /* @__PURE__ */ new Set();
|
|
4793
|
+
function normalizeLanguage(language) {
|
|
4794
|
+
const input = (language || "text").toLowerCase();
|
|
4795
|
+
return SUPPORTED_LANG_ALIASES[input] || input;
|
|
4796
|
+
}
|
|
4797
|
+
function escapeHtml(str) {
|
|
4798
|
+
return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
4799
|
+
}
|
|
4800
|
+
async function getHighlighter() {
|
|
4801
|
+
if (highlighter) return highlighter;
|
|
4802
|
+
if (!highlighterPromise) highlighterPromise = (0, shiki_core.createHighlighterCore)({
|
|
4803
|
+
themes: [shiki_dist_themes_vitesse_light_mjs.default, shiki_dist_themes_vitesse_dark_mjs.default],
|
|
4804
|
+
langs: [],
|
|
4805
|
+
engine: (0, shiki_engine_javascript.createJavaScriptRegexEngine)()
|
|
4806
|
+
});
|
|
4807
|
+
highlighter = await highlighterPromise;
|
|
4808
|
+
return highlighter;
|
|
4809
|
+
}
|
|
4810
|
+
async function loadLang(lang) {
|
|
4811
|
+
const loader = LANG_LOADERS[lang];
|
|
4812
|
+
if (!loader) return false;
|
|
4813
|
+
if (loadedLangs.has(lang)) return true;
|
|
4814
|
+
const instance = await getHighlighter();
|
|
4815
|
+
const mod = await loader();
|
|
4816
|
+
await instance.loadLanguage(mod.default);
|
|
4817
|
+
loadedLangs.add(lang);
|
|
4818
|
+
return true;
|
|
4819
|
+
}
|
|
4820
|
+
async function codeToHtml(code, options = {}) {
|
|
4821
|
+
const lang = normalizeLanguage(options.lang);
|
|
4822
|
+
if (!await loadLang(lang)) return `<pre><code>${escapeHtml(code)}</code></pre>`;
|
|
4823
|
+
return (await getHighlighter()).codeToHtml(code, {
|
|
4824
|
+
lang,
|
|
4825
|
+
theme: options.theme || "vitesse-light"
|
|
4826
|
+
});
|
|
4827
|
+
}
|
|
4828
|
+
//#endregion
|
|
4715
4829
|
//#region components/code-highlighter/style/index.ts
|
|
4716
4830
|
var genCodeHighlighterStyle = (token) => {
|
|
4717
4831
|
const { componentCls } = token;
|
|
@@ -4822,21 +4936,9 @@
|
|
|
4822
4936
|
return [genCodeHighlighterStyle((0, _antdv_next_cssinjs_cssinjs_utils.mergeToken)(token, {}))];
|
|
4823
4937
|
}, prepareComponentToken$9);
|
|
4824
4938
|
//#endregion
|
|
4825
|
-
//#region components/code-highlighter/CodeHighlighter.tsx
|
|
4826
|
-
var shikiHighlighter = null;
|
|
4827
|
-
var shikiPromise = null;
|
|
4828
|
-
async function initShiki() {
|
|
4829
|
-
if (shikiHighlighter) return;
|
|
4830
|
-
if (shikiPromise) return shikiPromise;
|
|
4831
|
-
shikiPromise = (async () => {
|
|
4832
|
-
shikiHighlighter = (await import("shiki")).codeToHtml;
|
|
4833
|
-
})();
|
|
4834
|
-
return shikiPromise;
|
|
4835
|
-
}
|
|
4836
|
-
//#endregion
|
|
4837
4939
|
//#region components/code-highlighter/index.tsx
|
|
4838
4940
|
var code_highlighter_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
4839
|
-
name: "
|
|
4941
|
+
name: "AxCodeHighlighter",
|
|
4840
4942
|
inheritAttrs: false,
|
|
4841
4943
|
props: {
|
|
4842
4944
|
prefixCls: {
|
|
@@ -4917,9 +5019,7 @@
|
|
|
4917
5019
|
const highlightedHtml = (0, vue.shallowRef)("");
|
|
4918
5020
|
const highlightCode = async () => {
|
|
4919
5021
|
try {
|
|
4920
|
-
await
|
|
4921
|
-
if (!shikiHighlighter) return;
|
|
4922
|
-
highlightedHtml.value = await shikiHighlighter(props.content, {
|
|
5022
|
+
highlightedHtml.value = await codeToHtml(props.content, {
|
|
4923
5023
|
lang: props.language,
|
|
4924
5024
|
theme: props.theme === "dark" ? "vitesse-dark" : "vitesse-light"
|
|
4925
5025
|
});
|
|
@@ -5362,7 +5462,7 @@
|
|
|
5362
5462
|
//#endregion
|
|
5363
5463
|
//#region components/conversations/Creation.tsx
|
|
5364
5464
|
var Creation = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
5365
|
-
name: "
|
|
5465
|
+
name: "AxConversationsCreation",
|
|
5366
5466
|
props: {
|
|
5367
5467
|
label: {
|
|
5368
5468
|
type: [
|
|
@@ -5457,6 +5557,20 @@
|
|
|
5457
5557
|
type: Object,
|
|
5458
5558
|
required: true
|
|
5459
5559
|
},
|
|
5560
|
+
groupLabelRender: {
|
|
5561
|
+
type: [
|
|
5562
|
+
String,
|
|
5563
|
+
Number,
|
|
5564
|
+
Object,
|
|
5565
|
+
Array,
|
|
5566
|
+
Function
|
|
5567
|
+
],
|
|
5568
|
+
default: void 0
|
|
5569
|
+
},
|
|
5570
|
+
groupLabelRenderSlot: {
|
|
5571
|
+
type: Function,
|
|
5572
|
+
default: void 0
|
|
5573
|
+
},
|
|
5460
5574
|
classes: {
|
|
5461
5575
|
type: [
|
|
5462
5576
|
String,
|
|
@@ -5492,15 +5606,22 @@
|
|
|
5492
5606
|
});
|
|
5493
5607
|
const labelNode = (0, vue.computed)(() => {
|
|
5494
5608
|
const { label, name } = props.groupInfo;
|
|
5495
|
-
|
|
5496
|
-
|
|
5609
|
+
const originNode = typeof label === "function" ? label(name, { groupInfo: props.groupInfo }) : label || name;
|
|
5610
|
+
const renderInfo = {
|
|
5611
|
+
group: name,
|
|
5612
|
+
groupInfo: props.groupInfo,
|
|
5613
|
+
originNode
|
|
5614
|
+
};
|
|
5615
|
+
if (props.groupLabelRenderSlot) return props.groupLabelRenderSlot(renderInfo);
|
|
5616
|
+
if (props.groupLabelRender !== void 0) return typeof props.groupLabelRender === "function" ? props.groupLabelRender(name, renderInfo) : props.groupLabelRender;
|
|
5617
|
+
return originNode;
|
|
5497
5618
|
});
|
|
5498
5619
|
return () => (0, vue.createVNode)("li", { "class": props.classes }, [(0, vue.createVNode)("div", {
|
|
5499
5620
|
"class": [`${props.prefixCls}-group-title`, { [`${props.prefixCls}-group-title-collapsible`]: mergeCollapsible.value }],
|
|
5500
5621
|
"onClick": () => {
|
|
5501
5622
|
if (mergeCollapsible.value) props.onItemExpand?.(props.groupInfo.name);
|
|
5502
5623
|
}
|
|
5503
|
-
}, [labelNode.value && (0, vue.createVNode)("div", { "class": `${props.prefixCls}-group-label` }, [labelNode.value]), mergeCollapsible.value && (0, vue.createVNode)("div", { "class": [`${props.prefixCls}-group-collapse-trigger`, `${props.prefixCls}-group-collapse-trigger-${groupOpen.value ? "open" : "close"}`] }, [(0, vue.createVNode)(_antdv_next_icons.RightOutlined, null, null)])]), (0, vue.createVNode)(vue.Transition, props.collapseTransition ?? {}, { default: () => [mergeCollapsible.value ? groupOpen.value ? (0, vue.createVNode)("div", null, [slots.default?.()]) : null : (0, vue.createVNode)("div", null, [slots.default?.()])] })]);
|
|
5624
|
+
}, [hasRenderableNode(labelNode.value) && (0, vue.createVNode)("div", { "class": `${props.prefixCls}-group-label` }, [labelNode.value]), mergeCollapsible.value && (0, vue.createVNode)("div", { "class": [`${props.prefixCls}-group-collapse-trigger`, `${props.prefixCls}-group-collapse-trigger-${groupOpen.value ? "open" : "close"}`] }, [(0, vue.createVNode)(_antdv_next_icons.RightOutlined, null, null)])]), (0, vue.createVNode)(vue.Transition, props.collapseTransition ?? {}, { default: () => [mergeCollapsible.value ? groupOpen.value ? (0, vue.createVNode)("div", null, [slots.default?.()]) : null : (0, vue.createVNode)("div", null, [slots.default?.()])] })]);
|
|
5504
5625
|
}
|
|
5505
5626
|
});
|
|
5506
5627
|
//#endregion
|
|
@@ -5585,10 +5706,6 @@
|
|
|
5585
5706
|
var stopPropagation = (event) => {
|
|
5586
5707
|
event.stopPropagation();
|
|
5587
5708
|
};
|
|
5588
|
-
var hasRenderableNode$6 = (node) => {
|
|
5589
|
-
if (Array.isArray(node)) return node.some((item) => item !== null && item !== void 0 && item !== false);
|
|
5590
|
-
return node !== null && node !== void 0 && node !== false;
|
|
5591
|
-
};
|
|
5592
5709
|
var renderWithPriority = (render, slotRender, info) => {
|
|
5593
5710
|
if (slotRender) return slotRender(info);
|
|
5594
5711
|
if (render !== void 0) return typeof render === "function" ? render(info.item, info) : render;
|
|
@@ -5719,7 +5836,7 @@
|
|
|
5719
5836
|
if (!disabled) props.onClick?.(props.info.key, props.info);
|
|
5720
5837
|
}
|
|
5721
5838
|
}, [
|
|
5722
|
-
hasRenderableNode
|
|
5839
|
+
hasRenderableNode(iconNode) && (0, vue.createVNode)("div", { "class": `${props.prefixCls}-icon` }, [iconNode]),
|
|
5723
5840
|
(0, vue.createVNode)(antdv_next.Typography.Text, { "class": `${props.prefixCls}-label` }, _isSlot$2(labelNode) ? labelNode : { default: () => [labelNode] }),
|
|
5724
5841
|
!disabled && props.menu && (0, vue.createVNode)("div", { "onClick": stopPropagation }, [(0, vue.createVNode)(antdv_next.Dropdown, {
|
|
5725
5842
|
"menu": menuProps.value,
|
|
@@ -5901,7 +6018,7 @@
|
|
|
5901
6018
|
return tagName === "input" || tagName === "textarea" || tagName === "select";
|
|
5902
6019
|
}
|
|
5903
6020
|
var ConversationsWithSub = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
5904
|
-
name: "
|
|
6021
|
+
name: "AxConversations",
|
|
5905
6022
|
inheritAttrs: false,
|
|
5906
6023
|
props: {
|
|
5907
6024
|
items: {
|
|
@@ -5940,6 +6057,16 @@
|
|
|
5940
6057
|
],
|
|
5941
6058
|
default: void 0
|
|
5942
6059
|
},
|
|
6060
|
+
groupLabelRender: {
|
|
6061
|
+
type: [
|
|
6062
|
+
String,
|
|
6063
|
+
Number,
|
|
6064
|
+
Object,
|
|
6065
|
+
Array,
|
|
6066
|
+
Function
|
|
6067
|
+
],
|
|
6068
|
+
default: void 0
|
|
6069
|
+
},
|
|
5943
6070
|
menu: {
|
|
5944
6071
|
type: [Object, Function],
|
|
5945
6072
|
default: void 0
|
|
@@ -6111,6 +6238,8 @@
|
|
|
6111
6238
|
"key": groupInfo.name || `key-${groupIndex}`,
|
|
6112
6239
|
"prefixCls": props.prefixCls,
|
|
6113
6240
|
"groupInfo": groupInfo,
|
|
6241
|
+
"groupLabelRender": props.groupLabelRender,
|
|
6242
|
+
"groupLabelRenderSlot": slots.groupLabelRender,
|
|
6114
6243
|
"classes": [contextConfig.value.classes?.group, props.classes?.group],
|
|
6115
6244
|
"enableCollapse": enableCollapse.value,
|
|
6116
6245
|
"expandedKeys": mergedExpandedKeys.value,
|
|
@@ -6138,6 +6267,38 @@
|
|
|
6138
6267
|
}
|
|
6139
6268
|
};
|
|
6140
6269
|
//#endregion
|
|
6270
|
+
//#region components/mermaid/loader.ts
|
|
6271
|
+
var mermaidInstance = null;
|
|
6272
|
+
var mermaidPromise = null;
|
|
6273
|
+
var pendingInitializeConfig = null;
|
|
6274
|
+
async function loadMermaid() {
|
|
6275
|
+
if (mermaidInstance) return mermaidInstance;
|
|
6276
|
+
if (!mermaidPromise) mermaidPromise = import("mermaid/dist/mermaid.core.mjs").then((mod) => mod.default).then((instance) => {
|
|
6277
|
+
mermaidInstance = instance;
|
|
6278
|
+
if (pendingInitializeConfig) {
|
|
6279
|
+
instance.initialize(pendingInitializeConfig);
|
|
6280
|
+
pendingInitializeConfig = null;
|
|
6281
|
+
}
|
|
6282
|
+
return instance;
|
|
6283
|
+
});
|
|
6284
|
+
return mermaidPromise;
|
|
6285
|
+
}
|
|
6286
|
+
function initializeMermaid(config) {
|
|
6287
|
+
pendingInitializeConfig = config;
|
|
6288
|
+
if (mermaidInstance) {
|
|
6289
|
+
mermaidInstance.initialize(config);
|
|
6290
|
+
pendingInitializeConfig = null;
|
|
6291
|
+
return;
|
|
6292
|
+
}
|
|
6293
|
+
loadMermaid();
|
|
6294
|
+
}
|
|
6295
|
+
async function parseMermaid(content, options) {
|
|
6296
|
+
return (await loadMermaid()).parse(content, options);
|
|
6297
|
+
}
|
|
6298
|
+
async function renderMermaid(id, content, container) {
|
|
6299
|
+
return (await loadMermaid()).render(id, content, container);
|
|
6300
|
+
}
|
|
6301
|
+
//#endregion
|
|
6141
6302
|
//#region components/mermaid/style/index.ts
|
|
6142
6303
|
var genMermaidStyle = (token) => {
|
|
6143
6304
|
const { componentCls } = token;
|
|
@@ -6244,7 +6405,7 @@
|
|
|
6244
6405
|
//#endregion
|
|
6245
6406
|
//#region components/mermaid/index.tsx
|
|
6246
6407
|
var mermaid_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
6247
|
-
name: "
|
|
6408
|
+
name: "AxMermaid",
|
|
6248
6409
|
inheritAttrs: false,
|
|
6249
6410
|
props: {
|
|
6250
6411
|
content: {
|
|
@@ -6357,6 +6518,26 @@
|
|
|
6357
6518
|
const { class: _class, style: _style, ...rest } = attrs;
|
|
6358
6519
|
return rest;
|
|
6359
6520
|
});
|
|
6521
|
+
const getNamedSlot = (name) => slots[name] ?? slots[name.replace(/[A-Z]/g, (s) => `-${s.toLowerCase()}`)];
|
|
6522
|
+
const resolvedCustomActions = (0, vue.computed)(() => mergedActions.value.customActions.map((item, index) => {
|
|
6523
|
+
const iconSlotInfo = {
|
|
6524
|
+
item,
|
|
6525
|
+
index,
|
|
6526
|
+
originNode: item.icon
|
|
6527
|
+
};
|
|
6528
|
+
const iconFromSlot = getNamedSlot("customActionIconRender")?.(iconSlotInfo);
|
|
6529
|
+
const actionSlotInfo = {
|
|
6530
|
+
item,
|
|
6531
|
+
index,
|
|
6532
|
+
originNode: item.actionRender !== void 0 ? typeof item.actionRender === "function" ? item.actionRender(item) : item.actionRender : void 0
|
|
6533
|
+
};
|
|
6534
|
+
const actionFromSlot = getNamedSlot("customActionRender")?.(actionSlotInfo);
|
|
6535
|
+
return {
|
|
6536
|
+
...item,
|
|
6537
|
+
icon: iconFromSlot !== void 0 && !isEmptyNode(iconFromSlot) ? iconFromSlot : item.icon,
|
|
6538
|
+
actionRender: actionFromSlot !== void 0 && !isEmptyNode(actionFromSlot) ? actionFromSlot : item.actionRender
|
|
6539
|
+
};
|
|
6540
|
+
}));
|
|
6360
6541
|
function applySvgTransform() {
|
|
6361
6542
|
if (mergedRenderType.value !== RenderType.Image) return;
|
|
6362
6543
|
const svgEl = graphRef.value?.querySelector("svg");
|
|
@@ -6375,8 +6556,8 @@
|
|
|
6375
6556
|
const graphEl = graphRef.value;
|
|
6376
6557
|
if (!graphEl) return;
|
|
6377
6558
|
try {
|
|
6378
|
-
if (await
|
|
6379
|
-
const { svg } = await
|
|
6559
|
+
if (await parseMermaid(props.content, { suppressErrors: true }) === false) throw new Error("Invalid Mermaid syntax");
|
|
6560
|
+
const { svg } = await renderMermaid(`${renderBaseId}-${idSeed++}-${props.content.length || 0}`, props.content);
|
|
6380
6561
|
graphEl.innerHTML = svg;
|
|
6381
6562
|
applySvgTransform();
|
|
6382
6563
|
} catch (error) {
|
|
@@ -6484,7 +6665,7 @@
|
|
|
6484
6665
|
key: "copy",
|
|
6485
6666
|
actionRender: () => (0, vue.createVNode)(ActionsWithSub.Copy, { "text": props.content }, null)
|
|
6486
6667
|
});
|
|
6487
|
-
return [...items, ...
|
|
6668
|
+
return [...items, ...resolvedCustomActions.value];
|
|
6488
6669
|
});
|
|
6489
6670
|
function renderHeader() {
|
|
6490
6671
|
if (props.header === null) return null;
|
|
@@ -6509,7 +6690,7 @@
|
|
|
6509
6690
|
if (next !== void 0) internalRenderType.value = next;
|
|
6510
6691
|
});
|
|
6511
6692
|
(0, vue.watch)(() => props.config, (nextConfig) => {
|
|
6512
|
-
|
|
6693
|
+
initializeMermaid({
|
|
6513
6694
|
startOnLoad: false,
|
|
6514
6695
|
securityLevel: "strict",
|
|
6515
6696
|
theme: "default",
|
|
@@ -6824,14 +7005,10 @@
|
|
|
6824
7005
|
delete domAttrs.children;
|
|
6825
7006
|
return domAttrs;
|
|
6826
7007
|
}
|
|
6827
|
-
function hasRenderableNode$5(node) {
|
|
6828
|
-
if (Array.isArray(node)) return node.some((item) => item !== null && item !== void 0 && item !== false);
|
|
6829
|
-
return node !== null && node !== void 0 && node !== false;
|
|
6830
|
-
}
|
|
6831
7008
|
//#endregion
|
|
6832
7009
|
//#region components/prompts/index.tsx
|
|
6833
7010
|
var prompts_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
6834
|
-
name: "
|
|
7011
|
+
name: "AxPrompts",
|
|
6835
7012
|
inheritAttrs: false,
|
|
6836
7013
|
props: {
|
|
6837
7014
|
items: {
|
|
@@ -6951,8 +7128,10 @@
|
|
|
6951
7128
|
};
|
|
6952
7129
|
});
|
|
6953
7130
|
const triggerItemClick = (item, nested) => {
|
|
6954
|
-
if (
|
|
6955
|
-
|
|
7131
|
+
if (item.disabled || !nested && hasChildren(item)) return;
|
|
7132
|
+
const info = { data: item };
|
|
7133
|
+
props.onItemClick?.(info);
|
|
7134
|
+
emit("itemClick", info);
|
|
6956
7135
|
};
|
|
6957
7136
|
const renderTitle = () => {
|
|
6958
7137
|
if (slots.title) return slots.title({ originNode: props.title });
|
|
@@ -6997,13 +7176,13 @@
|
|
|
6997
7176
|
}
|
|
6998
7177
|
],
|
|
6999
7178
|
"style": [nested ? mergedStyles.value.subItem : mergedStyles.value.item, item.style],
|
|
7000
|
-
"onClick": () => triggerItemClick(item,
|
|
7001
|
-
}), [hasRenderableNode
|
|
7179
|
+
"onClick": () => triggerItemClick(item, nested)
|
|
7180
|
+
}), [hasRenderableNode(iconNode) && (0, vue.createVNode)("div", { "class": `${props.prefixCls}-icon` }, [iconNode]), (0, vue.createVNode)("div", {
|
|
7002
7181
|
"class": [`${props.prefixCls}-content`, mergedClasses.value.itemContent],
|
|
7003
7182
|
"style": mergedStyles.value.itemContent
|
|
7004
7183
|
}, [
|
|
7005
|
-
hasRenderableNode
|
|
7006
|
-
hasRenderableNode
|
|
7184
|
+
hasRenderableNode(labelNode) && (0, vue.createVNode)("div", { "class": `${props.prefixCls}-label` }, [labelNode]),
|
|
7185
|
+
hasRenderableNode(descriptionNode) && (0, vue.createVNode)("div", { "class": `${props.prefixCls}-desc` }, [descriptionNode]),
|
|
7007
7186
|
itemHasChildren && (0, vue.createVNode)("div", { "class": `${props.prefixCls}-nested` }, [renderItems(item.children, true)])
|
|
7008
7187
|
])]);
|
|
7009
7188
|
})]);
|
|
@@ -7028,7 +7207,7 @@
|
|
|
7028
7207
|
attrs.style,
|
|
7029
7208
|
props.style
|
|
7030
7209
|
]
|
|
7031
|
-
}), [hasRenderableNode
|
|
7210
|
+
}), [hasRenderableNode(renderTitle()) && (0, vue.createVNode)("div", {
|
|
7032
7211
|
"class": [`${props.prefixCls}-title`, mergedClasses.value.title],
|
|
7033
7212
|
"style": mergedStyles.value.title
|
|
7034
7213
|
}, [renderTitle()]), renderItems(props.items)]);
|
|
@@ -8637,7 +8816,7 @@
|
|
|
8637
8816
|
SpeechButton: SpeechButton_default
|
|
8638
8817
|
};
|
|
8639
8818
|
var Sender_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
8640
|
-
name: "
|
|
8819
|
+
name: "AxSender",
|
|
8641
8820
|
inheritAttrs: false,
|
|
8642
8821
|
props: {
|
|
8643
8822
|
prefixCls: {
|
|
@@ -8978,7 +9157,7 @@
|
|
|
8978
9157
|
//#endregion
|
|
8979
9158
|
//#region components/sender/SenderHeader.tsx
|
|
8980
9159
|
var SenderHeader_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
8981
|
-
name: "
|
|
9160
|
+
name: "AxSenderHeader",
|
|
8982
9161
|
props: {
|
|
8983
9162
|
open: {
|
|
8984
9163
|
type: Boolean,
|
|
@@ -9082,7 +9261,7 @@
|
|
|
9082
9261
|
//#endregion
|
|
9083
9262
|
//#region components/sender/SenderSwitch.tsx
|
|
9084
9263
|
var SenderSwitch_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
9085
|
-
name: "
|
|
9264
|
+
name: "AxSenderSwitch",
|
|
9086
9265
|
inheritAttrs: false,
|
|
9087
9266
|
props: {
|
|
9088
9267
|
prefixCls: {
|
|
@@ -9226,10 +9405,6 @@
|
|
|
9226
9405
|
Sender.Switch = SenderSwitch_default;
|
|
9227
9406
|
//#endregion
|
|
9228
9407
|
//#region components/sources/components/CarouselCard.tsx
|
|
9229
|
-
var hasRenderableNode$4 = (node) => {
|
|
9230
|
-
if (Array.isArray(node)) return node.some((item) => item !== null && item !== void 0 && item !== false);
|
|
9231
|
-
return node !== null && node !== void 0 && node !== false;
|
|
9232
|
-
};
|
|
9233
9408
|
var CarouselCard = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
9234
9409
|
name: "XSourcesCarouselCard",
|
|
9235
9410
|
props: {
|
|
@@ -9340,7 +9515,7 @@
|
|
|
9340
9515
|
"key": item.key ?? index,
|
|
9341
9516
|
"class": `${compCls}-item`,
|
|
9342
9517
|
"onClick": () => handleClick(item)
|
|
9343
|
-
}, [(0, vue.createVNode)("div", { "class": `${compCls}-item-title-wrapper` }, [hasRenderableNode
|
|
9518
|
+
}, [(0, vue.createVNode)("div", { "class": `${compCls}-item-title-wrapper` }, [hasRenderableNode(iconNode) && (0, vue.createVNode)("span", { "class": `${compCls}-item-icon` }, [iconNode]), (0, vue.createVNode)("span", { "class": `${compCls}-item-title` }, [titleNode])]), hasRenderableNode(descriptionNode) && (0, vue.createVNode)("div", { "class": `${compCls}-item-description` }, [descriptionNode])]);
|
|
9344
9519
|
})())] })]);
|
|
9345
9520
|
}
|
|
9346
9521
|
});
|
|
@@ -9445,15 +9620,9 @@
|
|
|
9445
9620
|
return [genSourcesStyle(compToken), genCollapseMotion(compToken)];
|
|
9446
9621
|
}, prepareComponentToken$4);
|
|
9447
9622
|
//#endregion
|
|
9448
|
-
//#region components/sources/Sources.tsx
|
|
9449
|
-
var hasRenderableNode$3 = (node) => {
|
|
9450
|
-
if (Array.isArray(node)) return node.some((item) => item !== null && item !== void 0 && item !== false);
|
|
9451
|
-
return node !== null && node !== void 0 && node !== false;
|
|
9452
|
-
};
|
|
9453
|
-
//#endregion
|
|
9454
9623
|
//#region components/sources/index.tsx
|
|
9455
9624
|
var sources_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
9456
|
-
name: "
|
|
9625
|
+
name: "AxSources",
|
|
9457
9626
|
inheritAttrs: false,
|
|
9458
9627
|
props: {
|
|
9459
9628
|
prefixCls: {
|
|
@@ -9603,9 +9772,9 @@
|
|
|
9603
9772
|
"target": "_blank",
|
|
9604
9773
|
"rel": "noopener noreferrer"
|
|
9605
9774
|
}, [
|
|
9606
|
-
hasRenderableNode
|
|
9775
|
+
hasRenderableNode(iconNode) && (0, vue.createVNode)("span", { "class": `${props.prefixCls}-link-icon` }, [iconNode]),
|
|
9607
9776
|
(0, vue.createVNode)("span", { "class": `${props.prefixCls}-link-title` }, [titleNode]),
|
|
9608
|
-
hasRenderableNode
|
|
9777
|
+
hasRenderableNode(descriptionNode) && (0, vue.createVNode)("span", { "class": `${props.prefixCls}-link-description` }, [descriptionNode])
|
|
9609
9778
|
])]);
|
|
9610
9779
|
})]) : slots.default?.();
|
|
9611
9780
|
return (0, vue.createVNode)("div", (0, vue.mergeProps)({ "ref": rootRef }, domAttrs.value, {
|
|
@@ -9753,15 +9922,9 @@
|
|
|
9753
9922
|
return [activePaths, onKeyDown];
|
|
9754
9923
|
}
|
|
9755
9924
|
//#endregion
|
|
9756
|
-
//#region components/suggestion/Suggestion.tsx
|
|
9757
|
-
var hasRenderableNode$2 = (node) => {
|
|
9758
|
-
if (Array.isArray(node)) return node.some((item) => item !== null && item !== void 0 && item !== false);
|
|
9759
|
-
return node !== null && node !== void 0 && node !== false;
|
|
9760
|
-
};
|
|
9761
|
-
//#endregion
|
|
9762
9925
|
//#region components/suggestion/index.tsx
|
|
9763
9926
|
var suggestion_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
9764
|
-
name: "
|
|
9927
|
+
name: "AxSuggestion",
|
|
9765
9928
|
inheritAttrs: false,
|
|
9766
9929
|
props: {
|
|
9767
9930
|
prefixCls: {
|
|
@@ -9915,9 +10078,9 @@
|
|
|
9915
10078
|
originNode: item.extra
|
|
9916
10079
|
});
|
|
9917
10080
|
return (0, vue.createVNode)(antdv_next.Flex, { "class": `${prefixCls.value}-item` }, { default: () => [
|
|
9918
|
-
hasRenderableNode
|
|
10081
|
+
hasRenderableNode(iconNode) && (0, vue.createVNode)("div", { "class": `${prefixCls.value}-item-icon` }, [iconNode]),
|
|
9919
10082
|
labelNode,
|
|
9920
|
-
hasRenderableNode
|
|
10083
|
+
hasRenderableNode(extraNode) && (0, vue.createVNode)("div", { "class": `${prefixCls.value}-item-extra` }, [extraNode])
|
|
9921
10084
|
] });
|
|
9922
10085
|
},
|
|
9923
10086
|
"classes": { popup: { root: popupRootClass.value } },
|
|
@@ -10039,7 +10202,7 @@
|
|
|
10039
10202
|
//#endregion
|
|
10040
10203
|
//#region components/think/index.tsx
|
|
10041
10204
|
var think_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
10042
|
-
name: "
|
|
10205
|
+
name: "AxThink",
|
|
10043
10206
|
inheritAttrs: false,
|
|
10044
10207
|
props: {
|
|
10045
10208
|
prefixCls: {
|
|
@@ -10444,12 +10607,8 @@
|
|
|
10444
10607
|
}, prepareComponentToken$1);
|
|
10445
10608
|
//#endregion
|
|
10446
10609
|
//#region components/thought-chain/Item.tsx
|
|
10447
|
-
function hasRenderableNode$1(node) {
|
|
10448
|
-
if (Array.isArray(node)) return node.some((item) => item !== null && item !== void 0 && item !== false);
|
|
10449
|
-
return node !== null && node !== void 0 && node !== false;
|
|
10450
|
-
}
|
|
10451
10610
|
var XThoughtChainItem = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
10452
|
-
name: "
|
|
10611
|
+
name: "AxThoughtChainItem",
|
|
10453
10612
|
props: {
|
|
10454
10613
|
prefixCls: {
|
|
10455
10614
|
type: String,
|
|
@@ -10527,16 +10686,16 @@
|
|
|
10527
10686
|
return () => {
|
|
10528
10687
|
const cls = itemPrefixCls.value;
|
|
10529
10688
|
const statusCls = `${props.prefixCls}-status`;
|
|
10530
|
-
const
|
|
10689
|
+
const iconSlot = slots.icon;
|
|
10531
10690
|
const originIconNode = props.status ? STATUS_ICON_MAP[props.status] : props.icon;
|
|
10532
|
-
const iconNode =
|
|
10691
|
+
const iconNode = iconSlot ? iconSlot({
|
|
10533
10692
|
originNode: originIconNode,
|
|
10534
10693
|
status: props.status
|
|
10535
10694
|
}) : originIconNode;
|
|
10536
10695
|
const titleNode = slots.title ? slots.title({ originNode: props.title }) : props.title;
|
|
10537
10696
|
const descriptionNode = slots.description ? slots.description({ originNode: props.description }) : props.description;
|
|
10538
|
-
const hasTitle = hasRenderableNode
|
|
10539
|
-
const hasDescription = hasRenderableNode
|
|
10697
|
+
const hasTitle = hasRenderableNode(titleNode);
|
|
10698
|
+
const hasDescription = hasRenderableNode(descriptionNode);
|
|
10540
10699
|
return (0, vue.createVNode)("div", {
|
|
10541
10700
|
"ref": rootRef,
|
|
10542
10701
|
"class": [
|
|
@@ -10556,7 +10715,7 @@
|
|
|
10556
10715
|
],
|
|
10557
10716
|
"style": props.styles?.root,
|
|
10558
10717
|
"onClick": handleClick
|
|
10559
|
-
}, [hasRenderableNode
|
|
10718
|
+
}, [hasRenderableNode(iconNode) && (0, vue.createVNode)("div", {
|
|
10560
10719
|
"style": props.styles?.icon,
|
|
10561
10720
|
"class": [
|
|
10562
10721
|
statusCls,
|
|
@@ -10579,10 +10738,6 @@
|
|
|
10579
10738
|
});
|
|
10580
10739
|
//#endregion
|
|
10581
10740
|
//#region components/thought-chain/Node.tsx
|
|
10582
|
-
function hasRenderableNode(node) {
|
|
10583
|
-
if (Array.isArray(node)) return node.some((item) => item !== null && item !== void 0 && item !== false);
|
|
10584
|
-
return node !== null && node !== void 0 && node !== false;
|
|
10585
|
-
}
|
|
10586
10741
|
var Node_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
10587
10742
|
name: "ThoughtChainNode",
|
|
10588
10743
|
props: {
|
|
@@ -10779,7 +10934,7 @@
|
|
|
10779
10934
|
//#endregion
|
|
10780
10935
|
//#region components/thought-chain/index.tsx
|
|
10781
10936
|
var ThoughtChainWithSub = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
10782
|
-
name: "
|
|
10937
|
+
name: "AxThoughtChain",
|
|
10783
10938
|
inheritAttrs: false,
|
|
10784
10939
|
props: {
|
|
10785
10940
|
prefixCls: {
|
|
@@ -10997,7 +11152,7 @@
|
|
|
10997
11152
|
return Array.isArray(value) ? value.length > 0 : value !== null && value !== void 0;
|
|
10998
11153
|
}
|
|
10999
11154
|
var XWelcome = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
11000
|
-
name: "
|
|
11155
|
+
name: "AxWelcome",
|
|
11001
11156
|
inheritAttrs: false,
|
|
11002
11157
|
props: {
|
|
11003
11158
|
prefixCls: {
|
|
@@ -11162,7 +11317,7 @@
|
|
|
11162
11317
|
//#endregion
|
|
11163
11318
|
//#region components/x-provider/index.tsx
|
|
11164
11319
|
var XProvider = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
11165
|
-
name: "
|
|
11320
|
+
name: "AxProvider",
|
|
11166
11321
|
inheritAttrs: false,
|
|
11167
11322
|
props: {
|
|
11168
11323
|
attachments: {
|
|
@@ -11267,36 +11422,11 @@
|
|
|
11267
11422
|
ThoughtChainWithSub,
|
|
11268
11423
|
XThoughtChainItem
|
|
11269
11424
|
];
|
|
11270
|
-
var componentAliases = new Map([
|
|
11271
|
-
["XBubble", ["ABubble"]],
|
|
11272
|
-
["XBubbleList", ["ABubbleList"]],
|
|
11273
|
-
["XBubbleSystem", ["ABubbleSystem"]],
|
|
11274
|
-
["XBubbleDivider", ["ABubbleDivider"]],
|
|
11275
|
-
["XActions", ["AActions"]],
|
|
11276
|
-
["XActionsAudio", ["AActionsAudio"]],
|
|
11277
|
-
["XActionsCopy", ["AActionsCopy"]],
|
|
11278
|
-
["XActionsFeedback", ["AActionsFeedback"]],
|
|
11279
|
-
["XActionsItem", ["AActionsItem"]],
|
|
11280
|
-
["XFileCard", ["AFileCard"]],
|
|
11281
|
-
["XFileCardList", ["AFileCardList"]],
|
|
11282
|
-
["XMermaid", ["AMermaid"]],
|
|
11283
|
-
["XAttachments", ["AAttachments"]],
|
|
11284
|
-
["XSender", ["ASender"]],
|
|
11285
|
-
["XSenderHeader", ["ASenderHeader"]],
|
|
11286
|
-
["XSenderSwitch", ["ASenderSwitch"]],
|
|
11287
|
-
["XSuggestion", ["ASuggestion"]],
|
|
11288
|
-
["XThink", ["AThink"]],
|
|
11289
|
-
["XThoughtChain", ["AThoughtChain"]],
|
|
11290
|
-
["XThoughtChainItem", ["AThoughtChainItem"]]
|
|
11291
|
-
]);
|
|
11292
11425
|
var components_default = {
|
|
11293
11426
|
install(app) {
|
|
11294
11427
|
components.forEach((component) => {
|
|
11295
11428
|
if (!component.name) return;
|
|
11296
11429
|
app.component(component.name, component);
|
|
11297
|
-
componentAliases.get(component.name)?.forEach((alias) => {
|
|
11298
|
-
app.component(alias, component);
|
|
11299
|
-
});
|
|
11300
11430
|
});
|
|
11301
11431
|
},
|
|
11302
11432
|
version
|