@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.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";
|
|
@@ -7,10 +7,13 @@ import { genStyleUtils, mergeToken } from "@antdv-next/cssinjs/cssinjs-utils";
|
|
|
7
7
|
import { FastColor } from "@ant-design/fast-color";
|
|
8
8
|
import useAntdToken from "antdv-next/dist/theme/useToken";
|
|
9
9
|
import { useResizeObserver } from "@vueuse/core";
|
|
10
|
+
import { createHighlighterCore } from "shiki/core";
|
|
11
|
+
import darkTheme from "shiki/dist/themes/vitesse-dark.mjs";
|
|
12
|
+
import lightTheme from "shiki/dist/themes/vitesse-light.mjs";
|
|
13
|
+
import { createJavaScriptRegexEngine } from "shiki/engine/javascript";
|
|
10
14
|
import { KeyCode, classNames } from "@v-c/util";
|
|
11
|
-
import mermaid from "mermaid";
|
|
12
15
|
//#region package.json
|
|
13
|
-
var version = "0.0
|
|
16
|
+
var version = "0.2.0";
|
|
14
17
|
//#endregion
|
|
15
18
|
//#region components/x-provider/context.ts
|
|
16
19
|
var XProviderContextKey = Symbol("antdv-next-x-provider-context");
|
|
@@ -36,6 +39,20 @@ function useXComponentConfig(component) {
|
|
|
36
39
|
});
|
|
37
40
|
}
|
|
38
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
|
|
39
56
|
//#region components/actions/ActionsMenu.tsx
|
|
40
57
|
var keySeed$1 = 0;
|
|
41
58
|
function findItem(keyPath, items) {
|
|
@@ -505,7 +522,7 @@ function getMotionTransitionProps(motionName) {
|
|
|
505
522
|
};
|
|
506
523
|
}
|
|
507
524
|
var XActions = /* @__PURE__ */ defineComponent({
|
|
508
|
-
name: "
|
|
525
|
+
name: "AxActions",
|
|
509
526
|
inheritAttrs: false,
|
|
510
527
|
props: {
|
|
511
528
|
items: {
|
|
@@ -615,8 +632,8 @@ var XActions = /* @__PURE__ */ defineComponent({
|
|
|
615
632
|
});
|
|
616
633
|
const mergedItem = {
|
|
617
634
|
...item,
|
|
618
|
-
icon: slottedIcon
|
|
619
|
-
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
|
|
620
637
|
};
|
|
621
638
|
return createVNode(Item, {
|
|
622
639
|
"key": item.key ?? idx,
|
|
@@ -663,7 +680,7 @@ var ACTIONS_ITEM_STATUS = /* @__PURE__ */ function(ACTIONS_ITEM_STATUS) {
|
|
|
663
680
|
return ACTIONS_ITEM_STATUS;
|
|
664
681
|
}({});
|
|
665
682
|
var XActionsItem = /* @__PURE__ */ defineComponent({
|
|
666
|
-
name: "
|
|
683
|
+
name: "AxActionsItem",
|
|
667
684
|
inheritAttrs: false,
|
|
668
685
|
props: {
|
|
669
686
|
status: {
|
|
@@ -773,7 +790,7 @@ var XActionsItem = /* @__PURE__ */ defineComponent({
|
|
|
773
790
|
//#endregion
|
|
774
791
|
//#region components/actions/ActionsAudio.tsx
|
|
775
792
|
var XActionsAudio = /* @__PURE__ */ defineComponent({
|
|
776
|
-
name: "
|
|
793
|
+
name: "AxActionsAudio",
|
|
777
794
|
props: {
|
|
778
795
|
status: {
|
|
779
796
|
type: String,
|
|
@@ -847,7 +864,7 @@ var normalizeCopyIcons = (icon) => {
|
|
|
847
864
|
return [icon, icon];
|
|
848
865
|
};
|
|
849
866
|
var XActionsCopy = /* @__PURE__ */ defineComponent({
|
|
850
|
-
name: "
|
|
867
|
+
name: "AxActionsCopy",
|
|
851
868
|
inheritAttrs: false,
|
|
852
869
|
props: {
|
|
853
870
|
text: {
|
|
@@ -906,14 +923,14 @@ var XActionsCopy = /* @__PURE__ */ defineComponent({
|
|
|
906
923
|
const { class: _class, style: _style, ...rest } = attrs;
|
|
907
924
|
return rest;
|
|
908
925
|
});
|
|
909
|
-
const
|
|
926
|
+
const iconSlot = computed(() => slots.icon);
|
|
910
927
|
const mergedCopyIcons = computed(() => {
|
|
911
928
|
const [defaultOriginNode, copiedOriginNode] = normalizeCopyIcons(props.icon);
|
|
912
|
-
if (!
|
|
913
|
-
return [
|
|
929
|
+
if (!iconSlot.value) return props.icon;
|
|
930
|
+
return [iconSlot.value({
|
|
914
931
|
originNode: defaultOriginNode,
|
|
915
932
|
status: "default"
|
|
916
|
-
}),
|
|
933
|
+
}), iconSlot.value({
|
|
917
934
|
originNode: copiedOriginNode,
|
|
918
935
|
status: "copied"
|
|
919
936
|
})];
|
|
@@ -952,7 +969,7 @@ var FEEDBACK_VALUE = /* @__PURE__ */ function(FEEDBACK_VALUE) {
|
|
|
952
969
|
return FEEDBACK_VALUE;
|
|
953
970
|
}(FEEDBACK_VALUE || {});
|
|
954
971
|
var XActionsFeedback = /* @__PURE__ */ defineComponent({
|
|
955
|
-
name: "
|
|
972
|
+
name: "AxActionsFeedback",
|
|
956
973
|
inheritAttrs: false,
|
|
957
974
|
props: {
|
|
958
975
|
value: {
|
|
@@ -1268,7 +1285,7 @@ var File = /* @__PURE__ */ defineComponent({
|
|
|
1268
1285
|
type: Function,
|
|
1269
1286
|
default: void 0
|
|
1270
1287
|
},
|
|
1271
|
-
|
|
1288
|
+
iconSlot: {
|
|
1272
1289
|
type: Function,
|
|
1273
1290
|
default: void 0
|
|
1274
1291
|
}
|
|
@@ -1329,7 +1346,7 @@ var File = /* @__PURE__ */ defineComponent({
|
|
|
1329
1346
|
color: props.iconColor,
|
|
1330
1347
|
...props.styles.icon
|
|
1331
1348
|
}
|
|
1332
|
-
}, [renderWithSlot(props.
|
|
1349
|
+
}, [renderWithSlot(props.iconSlot, iconNode.value)]),
|
|
1333
1350
|
createVNode("div", { "class": `${compCls.value}-content` }, [createVNode("div", {
|
|
1334
1351
|
"class": [`${compCls.value}-name`, props.classes.name],
|
|
1335
1352
|
"style": props.styles.name
|
|
@@ -1930,7 +1947,7 @@ var DEFAULT_ICON = {
|
|
|
1930
1947
|
key: "default"
|
|
1931
1948
|
};
|
|
1932
1949
|
var XFileCard = /* @__PURE__ */ defineComponent({
|
|
1933
|
-
name: "
|
|
1950
|
+
name: "AxFileCard",
|
|
1934
1951
|
inheritAttrs: false,
|
|
1935
1952
|
props: {
|
|
1936
1953
|
prefixCls: {
|
|
@@ -2136,7 +2153,7 @@ var XFileCard = /* @__PURE__ */ defineComponent({
|
|
|
2136
2153
|
"mask": props.mask,
|
|
2137
2154
|
"descriptionRenderSlot": slots.description,
|
|
2138
2155
|
"maskRenderSlot": slots.mask,
|
|
2139
|
-
"
|
|
2156
|
+
"iconSlot": slots.icon,
|
|
2140
2157
|
"classes": mergedClasses.value,
|
|
2141
2158
|
"styles": mergedStyles.value
|
|
2142
2159
|
}, null);
|
|
@@ -2169,7 +2186,7 @@ function _isSlot$6(s) {
|
|
|
2169
2186
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
2170
2187
|
}
|
|
2171
2188
|
var XFileCardList = /* @__PURE__ */ defineComponent({
|
|
2172
|
-
name: "
|
|
2189
|
+
name: "AxFileCardList",
|
|
2173
2190
|
props: {
|
|
2174
2191
|
prefixCls: {
|
|
2175
2192
|
type: String,
|
|
@@ -2346,7 +2363,7 @@ var XFileCardList = /* @__PURE__ */ defineComponent({
|
|
|
2346
2363
|
item: fileItem,
|
|
2347
2364
|
index: itemIndex
|
|
2348
2365
|
}) : void 0,
|
|
2349
|
-
|
|
2366
|
+
icon: slots.iconRender ? (slotInfo) => slots.iconRender?.({
|
|
2350
2367
|
...slotInfo,
|
|
2351
2368
|
item: fileItem,
|
|
2352
2369
|
index: itemIndex
|
|
@@ -2671,6 +2688,10 @@ var PlaceholderUploader = /* @__PURE__ */ defineComponent({
|
|
|
2671
2688
|
type: String,
|
|
2672
2689
|
required: true
|
|
2673
2690
|
},
|
|
2691
|
+
type: {
|
|
2692
|
+
type: String,
|
|
2693
|
+
required: true
|
|
2694
|
+
},
|
|
2674
2695
|
placeholder: {
|
|
2675
2696
|
type: [
|
|
2676
2697
|
String,
|
|
@@ -2718,6 +2739,28 @@ var PlaceholderUploader = /* @__PURE__ */ defineComponent({
|
|
|
2718
2739
|
if (!isConfig.value) return {};
|
|
2719
2740
|
return props.placeholder;
|
|
2720
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
|
+
};
|
|
2721
2764
|
const onDragEnter = () => {
|
|
2722
2765
|
dragIn.value = true;
|
|
2723
2766
|
};
|
|
@@ -2728,11 +2771,11 @@ var PlaceholderUploader = /* @__PURE__ */ defineComponent({
|
|
|
2728
2771
|
dragIn.value = false;
|
|
2729
2772
|
};
|
|
2730
2773
|
return () => {
|
|
2731
|
-
const
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2774
|
+
const originNode = isConfig.value ? renderConfigNode() : slots.default?.() || props.placeholder;
|
|
2775
|
+
const node = slots.placeholder?.({
|
|
2776
|
+
type: props.type,
|
|
2777
|
+
originNode
|
|
2778
|
+
}) ?? originNode;
|
|
2736
2779
|
return createVNode("div", {
|
|
2737
2780
|
"class": [
|
|
2738
2781
|
placeholderCls.value,
|
|
@@ -2876,7 +2919,7 @@ function _isSlot$4(s) {
|
|
|
2876
2919
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
2877
2920
|
}
|
|
2878
2921
|
var XAttachments = /* @__PURE__ */ defineComponent({
|
|
2879
|
-
name: "
|
|
2922
|
+
name: "AxAttachments",
|
|
2880
2923
|
inheritAttrs: false,
|
|
2881
2924
|
props: {
|
|
2882
2925
|
prefixCls: {
|
|
@@ -3075,12 +3118,18 @@ var XAttachments = /* @__PURE__ */ defineComponent({
|
|
|
3075
3118
|
const getPlaceholderNode = (type, options) => {
|
|
3076
3119
|
const placeholderContent = typeof props.placeholder === "function" ? props.placeholder(type) : props.placeholder;
|
|
3077
3120
|
return createVNode(PlaceholderUploader, {
|
|
3121
|
+
"type": type,
|
|
3078
3122
|
"placeholder": placeholderContent,
|
|
3079
3123
|
"upload": uploadProps.value,
|
|
3080
3124
|
"prefixCls": props.prefixCls,
|
|
3081
3125
|
"class": mergedClasses.value.placeholder,
|
|
3082
3126
|
"style": [mergedStyles.value.placeholder, options?.style]
|
|
3083
|
-
},
|
|
3127
|
+
}, {
|
|
3128
|
+
placeholder: slots.placeholder,
|
|
3129
|
+
placeholderIcon: slots.placeholderIcon,
|
|
3130
|
+
placeholderTitle: slots.placeholderTitle,
|
|
3131
|
+
placeholderDescription: slots.placeholderDescription
|
|
3132
|
+
});
|
|
3084
3133
|
};
|
|
3085
3134
|
const renderWithChildren = () => {
|
|
3086
3135
|
let _slot;
|
|
@@ -3815,12 +3864,8 @@ function renderBubbleSlot(slot, content, info) {
|
|
|
3815
3864
|
if (!slot) return null;
|
|
3816
3865
|
return typeof slot === "function" ? slot(content, info) : slot;
|
|
3817
3866
|
}
|
|
3818
|
-
function hasRenderableNode$7(node) {
|
|
3819
|
-
if (Array.isArray(node)) return node.some((item) => item !== null && item !== void 0 && item !== false);
|
|
3820
|
-
return node !== null && node !== void 0 && node !== false;
|
|
3821
|
-
}
|
|
3822
3867
|
var XBubble = /* @__PURE__ */ defineComponent({
|
|
3823
|
-
name: "
|
|
3868
|
+
name: "AxBubble",
|
|
3824
3869
|
inheritAttrs: false,
|
|
3825
3870
|
props: {
|
|
3826
3871
|
prefixCls: {
|
|
@@ -3982,12 +4027,12 @@ var XBubble = /* @__PURE__ */ defineComponent({
|
|
|
3982
4027
|
return rest;
|
|
3983
4028
|
});
|
|
3984
4029
|
const memoedContent = computed(() => {
|
|
3985
|
-
if (slots.
|
|
3986
|
-
const slotNode = slots.
|
|
4030
|
+
if (slots.content) {
|
|
4031
|
+
const slotNode = slots.content({
|
|
3987
4032
|
content: props.content,
|
|
3988
4033
|
info: props.info
|
|
3989
4034
|
});
|
|
3990
|
-
if (hasRenderableNode
|
|
4035
|
+
if (hasRenderableNode(slotNode)) return slotNode;
|
|
3991
4036
|
}
|
|
3992
4037
|
return props.contentRender ? props.contentRender(props.content, props.info) : props.content;
|
|
3993
4038
|
});
|
|
@@ -4078,12 +4123,12 @@ var XBubble = /* @__PURE__ */ defineComponent({
|
|
|
4078
4123
|
};
|
|
4079
4124
|
const renderContent = () => {
|
|
4080
4125
|
if (props.loading) {
|
|
4081
|
-
if (slots.
|
|
4082
|
-
const slotNode = slots.
|
|
4126
|
+
if (slots.loading) {
|
|
4127
|
+
const slotNode = slots.loading({
|
|
4083
4128
|
content: props.content,
|
|
4084
4129
|
info: props.info
|
|
4085
4130
|
});
|
|
4086
|
-
if (hasRenderableNode
|
|
4131
|
+
if (hasRenderableNode(slotNode)) return slotNode;
|
|
4087
4132
|
}
|
|
4088
4133
|
if (props.loadingRender) return props.loadingRender(props.content, props.info);
|
|
4089
4134
|
return createVNode(loading_default, { "prefixCls": props.prefixCls }, null);
|
|
@@ -4161,7 +4206,7 @@ function _isSlot$3(s) {
|
|
|
4161
4206
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
4162
4207
|
}
|
|
4163
4208
|
var XBubbleDivider = /* @__PURE__ */ defineComponent({
|
|
4164
|
-
name: "
|
|
4209
|
+
name: "AxBubbleDivider",
|
|
4165
4210
|
props: {
|
|
4166
4211
|
prefixCls: {
|
|
4167
4212
|
type: String,
|
|
@@ -4223,7 +4268,7 @@ var XBubbleDivider = /* @__PURE__ */ defineComponent({
|
|
|
4223
4268
|
"class": [`${props.prefixCls}-divider`, props.class],
|
|
4224
4269
|
"styles": props.styles,
|
|
4225
4270
|
"classes": props.classes
|
|
4226
|
-
}), {
|
|
4271
|
+
}), { content: ({ content }) => createVNode(Divider, props.dividerProps, _isSlot$3(content) ? content : { default: () => [content] }) });
|
|
4227
4272
|
}
|
|
4228
4273
|
});
|
|
4229
4274
|
//#endregion
|
|
@@ -4351,7 +4396,7 @@ function useCompatibleScroll(scrollDomRef, contentDomRef) {
|
|
|
4351
4396
|
//#endregion
|
|
4352
4397
|
//#region components/bubble/System.tsx
|
|
4353
4398
|
var XBubbleSystem = /* @__PURE__ */ defineComponent({
|
|
4354
|
-
name: "
|
|
4399
|
+
name: "AxBubbleSystem",
|
|
4355
4400
|
props: {
|
|
4356
4401
|
prefixCls: {
|
|
4357
4402
|
type: String,
|
|
@@ -4440,7 +4485,7 @@ var bubbleSlotNames = [
|
|
|
4440
4485
|
"extra"
|
|
4441
4486
|
];
|
|
4442
4487
|
var XBubbleList = /* @__PURE__ */ defineComponent({
|
|
4443
|
-
name: "
|
|
4488
|
+
name: "AxBubbleList",
|
|
4444
4489
|
inheritAttrs: false,
|
|
4445
4490
|
props: {
|
|
4446
4491
|
prefixCls: {
|
|
@@ -4658,10 +4703,10 @@ var XBubbleList = /* @__PURE__ */ defineComponent({
|
|
|
4658
4703
|
role
|
|
4659
4704
|
});
|
|
4660
4705
|
};
|
|
4661
|
-
if (slots.contentRender) bubbleSlots.
|
|
4662
|
-
else if (contentRender) bubbleSlots.
|
|
4663
|
-
if (slots.loadingRender) bubbleSlots.
|
|
4664
|
-
else if (loadingRender) bubbleSlots.
|
|
4706
|
+
if (slots.contentRender) bubbleSlots.content = bindListSlot("contentRender");
|
|
4707
|
+
else if (contentRender) bubbleSlots.content = ({ content, info: bubbleInfo }) => contentRender(content, bubbleInfo);
|
|
4708
|
+
if (slots.loadingRender) bubbleSlots.loading = bindListSlot("loadingRender");
|
|
4709
|
+
else if (loadingRender) bubbleSlots.loading = ({ content, info: bubbleInfo }) => loadingRender(content, bubbleInfo);
|
|
4665
4710
|
for (const name of bubbleSlotNames) {
|
|
4666
4711
|
if (name === "contentRender" || name === "loadingRender") continue;
|
|
4667
4712
|
const slot = bindListSlot(name);
|
|
@@ -4678,6 +4723,74 @@ BubbleWithSub.List = XBubbleList;
|
|
|
4678
4723
|
BubbleWithSub.System = XBubbleSystem;
|
|
4679
4724
|
BubbleWithSub.Divider = XBubbleDivider;
|
|
4680
4725
|
//#endregion
|
|
4726
|
+
//#region components/code-highlighter/shiki.ts
|
|
4727
|
+
var SUPPORTED_LANG_ALIASES = {
|
|
4728
|
+
ts: "typescript",
|
|
4729
|
+
js: "javascript",
|
|
4730
|
+
py: "python",
|
|
4731
|
+
md: "markdown",
|
|
4732
|
+
yml: "yaml",
|
|
4733
|
+
shell: "bash",
|
|
4734
|
+
zsh: "bash",
|
|
4735
|
+
sh: "bash",
|
|
4736
|
+
vue: "vue"
|
|
4737
|
+
};
|
|
4738
|
+
var LANG_LOADERS = {
|
|
4739
|
+
javascript: () => import("shiki/dist/langs/javascript.mjs"),
|
|
4740
|
+
typescript: () => import("shiki/dist/langs/typescript.mjs"),
|
|
4741
|
+
jsx: () => import("shiki/dist/langs/jsx.mjs"),
|
|
4742
|
+
tsx: () => import("shiki/dist/langs/tsx.mjs"),
|
|
4743
|
+
json: () => import("shiki/dist/langs/json.mjs"),
|
|
4744
|
+
bash: () => import("shiki/dist/langs/bash.mjs"),
|
|
4745
|
+
markdown: () => import("shiki/dist/langs/markdown.mjs"),
|
|
4746
|
+
html: () => import("shiki/dist/langs/html.mjs"),
|
|
4747
|
+
css: () => import("shiki/dist/langs/css.mjs"),
|
|
4748
|
+
vue: () => import("shiki/dist/langs/vue.mjs"),
|
|
4749
|
+
"vue-html": () => import("shiki/dist/langs/vue-html.mjs"),
|
|
4750
|
+
python: () => import("shiki/dist/langs/python.mjs"),
|
|
4751
|
+
mermaid: () => import("shiki/dist/langs/mermaid.mjs"),
|
|
4752
|
+
yaml: () => import("shiki/dist/langs/yaml.mjs"),
|
|
4753
|
+
diff: () => import("shiki/dist/langs/diff.mjs")
|
|
4754
|
+
};
|
|
4755
|
+
var highlighter = null;
|
|
4756
|
+
var highlighterPromise = null;
|
|
4757
|
+
var loadedLangs = /* @__PURE__ */ new Set();
|
|
4758
|
+
function normalizeLanguage(language) {
|
|
4759
|
+
const input = (language || "text").toLowerCase();
|
|
4760
|
+
return SUPPORTED_LANG_ALIASES[input] || input;
|
|
4761
|
+
}
|
|
4762
|
+
function escapeHtml(str) {
|
|
4763
|
+
return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
4764
|
+
}
|
|
4765
|
+
async function getHighlighter() {
|
|
4766
|
+
if (highlighter) return highlighter;
|
|
4767
|
+
if (!highlighterPromise) highlighterPromise = createHighlighterCore({
|
|
4768
|
+
themes: [lightTheme, darkTheme],
|
|
4769
|
+
langs: [],
|
|
4770
|
+
engine: createJavaScriptRegexEngine()
|
|
4771
|
+
});
|
|
4772
|
+
highlighter = await highlighterPromise;
|
|
4773
|
+
return highlighter;
|
|
4774
|
+
}
|
|
4775
|
+
async function loadLang(lang) {
|
|
4776
|
+
const loader = LANG_LOADERS[lang];
|
|
4777
|
+
if (!loader) return false;
|
|
4778
|
+
if (loadedLangs.has(lang)) return true;
|
|
4779
|
+
const instance = await getHighlighter();
|
|
4780
|
+
const mod = await loader();
|
|
4781
|
+
await instance.loadLanguage(mod.default);
|
|
4782
|
+
loadedLangs.add(lang);
|
|
4783
|
+
return true;
|
|
4784
|
+
}
|
|
4785
|
+
async function codeToHtml(code, options = {}) {
|
|
4786
|
+
const lang = normalizeLanguage(options.lang);
|
|
4787
|
+
if (!await loadLang(lang)) return `<pre><code>${escapeHtml(code)}</code></pre>`;
|
|
4788
|
+
return (await getHighlighter()).codeToHtml(code, {
|
|
4789
|
+
lang,
|
|
4790
|
+
theme: options.theme || "vitesse-light"
|
|
4791
|
+
});
|
|
4792
|
+
}
|
|
4793
|
+
//#endregion
|
|
4681
4794
|
//#region components/code-highlighter/style/index.ts
|
|
4682
4795
|
var genCodeHighlighterStyle = (token) => {
|
|
4683
4796
|
const { componentCls } = token;
|
|
@@ -4788,21 +4901,9 @@ var style_default$9 = genStyleHooks("CodeHighlighter", (token) => {
|
|
|
4788
4901
|
return [genCodeHighlighterStyle(mergeToken(token, {}))];
|
|
4789
4902
|
}, prepareComponentToken$9);
|
|
4790
4903
|
//#endregion
|
|
4791
|
-
//#region components/code-highlighter/CodeHighlighter.tsx
|
|
4792
|
-
var shikiHighlighter = null;
|
|
4793
|
-
var shikiPromise = null;
|
|
4794
|
-
async function initShiki() {
|
|
4795
|
-
if (shikiHighlighter) return;
|
|
4796
|
-
if (shikiPromise) return shikiPromise;
|
|
4797
|
-
shikiPromise = (async () => {
|
|
4798
|
-
shikiHighlighter = (await import("shiki")).codeToHtml;
|
|
4799
|
-
})();
|
|
4800
|
-
return shikiPromise;
|
|
4801
|
-
}
|
|
4802
|
-
//#endregion
|
|
4803
4904
|
//#region components/code-highlighter/index.tsx
|
|
4804
4905
|
var code_highlighter_default = /* @__PURE__ */ defineComponent({
|
|
4805
|
-
name: "
|
|
4906
|
+
name: "AxCodeHighlighter",
|
|
4806
4907
|
inheritAttrs: false,
|
|
4807
4908
|
props: {
|
|
4808
4909
|
prefixCls: {
|
|
@@ -4883,9 +4984,7 @@ var code_highlighter_default = /* @__PURE__ */ defineComponent({
|
|
|
4883
4984
|
const highlightedHtml = shallowRef("");
|
|
4884
4985
|
const highlightCode = async () => {
|
|
4885
4986
|
try {
|
|
4886
|
-
await
|
|
4887
|
-
if (!shikiHighlighter) return;
|
|
4888
|
-
highlightedHtml.value = await shikiHighlighter(props.content, {
|
|
4987
|
+
highlightedHtml.value = await codeToHtml(props.content, {
|
|
4889
4988
|
lang: props.language,
|
|
4890
4989
|
theme: props.theme === "dark" ? "vitesse-dark" : "vitesse-light"
|
|
4891
4990
|
});
|
|
@@ -5328,7 +5427,7 @@ function useCreation({ icon, label, align, shortcutKeyInfo, prefixCls }) {
|
|
|
5328
5427
|
//#endregion
|
|
5329
5428
|
//#region components/conversations/Creation.tsx
|
|
5330
5429
|
var Creation = /* @__PURE__ */ defineComponent({
|
|
5331
|
-
name: "
|
|
5430
|
+
name: "AxConversationsCreation",
|
|
5332
5431
|
props: {
|
|
5333
5432
|
label: {
|
|
5334
5433
|
type: [
|
|
@@ -5423,6 +5522,20 @@ var GroupTitle = /* @__PURE__ */ defineComponent({
|
|
|
5423
5522
|
type: Object,
|
|
5424
5523
|
required: true
|
|
5425
5524
|
},
|
|
5525
|
+
groupLabelRender: {
|
|
5526
|
+
type: [
|
|
5527
|
+
String,
|
|
5528
|
+
Number,
|
|
5529
|
+
Object,
|
|
5530
|
+
Array,
|
|
5531
|
+
Function
|
|
5532
|
+
],
|
|
5533
|
+
default: void 0
|
|
5534
|
+
},
|
|
5535
|
+
groupLabelRenderSlot: {
|
|
5536
|
+
type: Function,
|
|
5537
|
+
default: void 0
|
|
5538
|
+
},
|
|
5426
5539
|
classes: {
|
|
5427
5540
|
type: [
|
|
5428
5541
|
String,
|
|
@@ -5458,15 +5571,22 @@ var GroupTitle = /* @__PURE__ */ defineComponent({
|
|
|
5458
5571
|
});
|
|
5459
5572
|
const labelNode = computed(() => {
|
|
5460
5573
|
const { label, name } = props.groupInfo;
|
|
5461
|
-
|
|
5462
|
-
|
|
5574
|
+
const originNode = typeof label === "function" ? label(name, { groupInfo: props.groupInfo }) : label || name;
|
|
5575
|
+
const renderInfo = {
|
|
5576
|
+
group: name,
|
|
5577
|
+
groupInfo: props.groupInfo,
|
|
5578
|
+
originNode
|
|
5579
|
+
};
|
|
5580
|
+
if (props.groupLabelRenderSlot) return props.groupLabelRenderSlot(renderInfo);
|
|
5581
|
+
if (props.groupLabelRender !== void 0) return typeof props.groupLabelRender === "function" ? props.groupLabelRender(name, renderInfo) : props.groupLabelRender;
|
|
5582
|
+
return originNode;
|
|
5463
5583
|
});
|
|
5464
5584
|
return () => createVNode("li", { "class": props.classes }, [createVNode("div", {
|
|
5465
5585
|
"class": [`${props.prefixCls}-group-title`, { [`${props.prefixCls}-group-title-collapsible`]: mergeCollapsible.value }],
|
|
5466
5586
|
"onClick": () => {
|
|
5467
5587
|
if (mergeCollapsible.value) props.onItemExpand?.(props.groupInfo.name);
|
|
5468
5588
|
}
|
|
5469
|
-
}, [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?.()])] })]);
|
|
5589
|
+
}, [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?.()])] })]);
|
|
5470
5590
|
}
|
|
5471
5591
|
});
|
|
5472
5592
|
//#endregion
|
|
@@ -5551,10 +5671,6 @@ function _isSlot$2(s) {
|
|
|
5551
5671
|
var stopPropagation = (event) => {
|
|
5552
5672
|
event.stopPropagation();
|
|
5553
5673
|
};
|
|
5554
|
-
var hasRenderableNode$6 = (node) => {
|
|
5555
|
-
if (Array.isArray(node)) return node.some((item) => item !== null && item !== void 0 && item !== false);
|
|
5556
|
-
return node !== null && node !== void 0 && node !== false;
|
|
5557
|
-
};
|
|
5558
5674
|
var renderWithPriority = (render, slotRender, info) => {
|
|
5559
5675
|
if (slotRender) return slotRender(info);
|
|
5560
5676
|
if (render !== void 0) return typeof render === "function" ? render(info.item, info) : render;
|
|
@@ -5685,7 +5801,7 @@ var ConversationsItem = /* @__PURE__ */ defineComponent({
|
|
|
5685
5801
|
if (!disabled) props.onClick?.(props.info.key, props.info);
|
|
5686
5802
|
}
|
|
5687
5803
|
}, [
|
|
5688
|
-
hasRenderableNode
|
|
5804
|
+
hasRenderableNode(iconNode) && createVNode("div", { "class": `${props.prefixCls}-icon` }, [iconNode]),
|
|
5689
5805
|
createVNode(Typography.Text, { "class": `${props.prefixCls}-label` }, _isSlot$2(labelNode) ? labelNode : { default: () => [labelNode] }),
|
|
5690
5806
|
!disabled && props.menu && createVNode("div", { "onClick": stopPropagation }, [createVNode(Dropdown, {
|
|
5691
5807
|
"menu": menuProps.value,
|
|
@@ -5867,7 +5983,7 @@ function isTypingTarget(target) {
|
|
|
5867
5983
|
return tagName === "input" || tagName === "textarea" || tagName === "select";
|
|
5868
5984
|
}
|
|
5869
5985
|
var ConversationsWithSub = /* @__PURE__ */ defineComponent({
|
|
5870
|
-
name: "
|
|
5986
|
+
name: "AxConversations",
|
|
5871
5987
|
inheritAttrs: false,
|
|
5872
5988
|
props: {
|
|
5873
5989
|
items: {
|
|
@@ -5906,6 +6022,16 @@ var ConversationsWithSub = /* @__PURE__ */ defineComponent({
|
|
|
5906
6022
|
],
|
|
5907
6023
|
default: void 0
|
|
5908
6024
|
},
|
|
6025
|
+
groupLabelRender: {
|
|
6026
|
+
type: [
|
|
6027
|
+
String,
|
|
6028
|
+
Number,
|
|
6029
|
+
Object,
|
|
6030
|
+
Array,
|
|
6031
|
+
Function
|
|
6032
|
+
],
|
|
6033
|
+
default: void 0
|
|
6034
|
+
},
|
|
5909
6035
|
menu: {
|
|
5910
6036
|
type: [Object, Function],
|
|
5911
6037
|
default: void 0
|
|
@@ -6077,6 +6203,8 @@ var ConversationsWithSub = /* @__PURE__ */ defineComponent({
|
|
|
6077
6203
|
"key": groupInfo.name || `key-${groupIndex}`,
|
|
6078
6204
|
"prefixCls": props.prefixCls,
|
|
6079
6205
|
"groupInfo": groupInfo,
|
|
6206
|
+
"groupLabelRender": props.groupLabelRender,
|
|
6207
|
+
"groupLabelRenderSlot": slots.groupLabelRender,
|
|
6080
6208
|
"classes": [contextConfig.value.classes?.group, props.classes?.group],
|
|
6081
6209
|
"enableCollapse": enableCollapse.value,
|
|
6082
6210
|
"expandedKeys": mergedExpandedKeys.value,
|
|
@@ -6104,6 +6232,38 @@ var warning = (valid, component, message) => {
|
|
|
6104
6232
|
}
|
|
6105
6233
|
};
|
|
6106
6234
|
//#endregion
|
|
6235
|
+
//#region components/mermaid/loader.ts
|
|
6236
|
+
var mermaidInstance = null;
|
|
6237
|
+
var mermaidPromise = null;
|
|
6238
|
+
var pendingInitializeConfig = null;
|
|
6239
|
+
async function loadMermaid() {
|
|
6240
|
+
if (mermaidInstance) return mermaidInstance;
|
|
6241
|
+
if (!mermaidPromise) mermaidPromise = import("mermaid/dist/mermaid.core.mjs").then((mod) => mod.default).then((instance) => {
|
|
6242
|
+
mermaidInstance = instance;
|
|
6243
|
+
if (pendingInitializeConfig) {
|
|
6244
|
+
instance.initialize(pendingInitializeConfig);
|
|
6245
|
+
pendingInitializeConfig = null;
|
|
6246
|
+
}
|
|
6247
|
+
return instance;
|
|
6248
|
+
});
|
|
6249
|
+
return mermaidPromise;
|
|
6250
|
+
}
|
|
6251
|
+
function initializeMermaid(config) {
|
|
6252
|
+
pendingInitializeConfig = config;
|
|
6253
|
+
if (mermaidInstance) {
|
|
6254
|
+
mermaidInstance.initialize(config);
|
|
6255
|
+
pendingInitializeConfig = null;
|
|
6256
|
+
return;
|
|
6257
|
+
}
|
|
6258
|
+
loadMermaid();
|
|
6259
|
+
}
|
|
6260
|
+
async function parseMermaid(content, options) {
|
|
6261
|
+
return (await loadMermaid()).parse(content, options);
|
|
6262
|
+
}
|
|
6263
|
+
async function renderMermaid(id, content, container) {
|
|
6264
|
+
return (await loadMermaid()).render(id, content, container);
|
|
6265
|
+
}
|
|
6266
|
+
//#endregion
|
|
6107
6267
|
//#region components/mermaid/style/index.ts
|
|
6108
6268
|
var genMermaidStyle = (token) => {
|
|
6109
6269
|
const { componentCls } = token;
|
|
@@ -6210,7 +6370,7 @@ function throttle(fn, wait) {
|
|
|
6210
6370
|
//#endregion
|
|
6211
6371
|
//#region components/mermaid/index.tsx
|
|
6212
6372
|
var mermaid_default = /* @__PURE__ */ defineComponent({
|
|
6213
|
-
name: "
|
|
6373
|
+
name: "AxMermaid",
|
|
6214
6374
|
inheritAttrs: false,
|
|
6215
6375
|
props: {
|
|
6216
6376
|
content: {
|
|
@@ -6323,6 +6483,26 @@ var mermaid_default = /* @__PURE__ */ defineComponent({
|
|
|
6323
6483
|
const { class: _class, style: _style, ...rest } = attrs;
|
|
6324
6484
|
return rest;
|
|
6325
6485
|
});
|
|
6486
|
+
const getNamedSlot = (name) => slots[name] ?? slots[name.replace(/[A-Z]/g, (s) => `-${s.toLowerCase()}`)];
|
|
6487
|
+
const resolvedCustomActions = computed(() => mergedActions.value.customActions.map((item, index) => {
|
|
6488
|
+
const iconSlotInfo = {
|
|
6489
|
+
item,
|
|
6490
|
+
index,
|
|
6491
|
+
originNode: item.icon
|
|
6492
|
+
};
|
|
6493
|
+
const iconFromSlot = getNamedSlot("customActionIconRender")?.(iconSlotInfo);
|
|
6494
|
+
const actionSlotInfo = {
|
|
6495
|
+
item,
|
|
6496
|
+
index,
|
|
6497
|
+
originNode: item.actionRender !== void 0 ? typeof item.actionRender === "function" ? item.actionRender(item) : item.actionRender : void 0
|
|
6498
|
+
};
|
|
6499
|
+
const actionFromSlot = getNamedSlot("customActionRender")?.(actionSlotInfo);
|
|
6500
|
+
return {
|
|
6501
|
+
...item,
|
|
6502
|
+
icon: iconFromSlot !== void 0 && !isEmptyNode(iconFromSlot) ? iconFromSlot : item.icon,
|
|
6503
|
+
actionRender: actionFromSlot !== void 0 && !isEmptyNode(actionFromSlot) ? actionFromSlot : item.actionRender
|
|
6504
|
+
};
|
|
6505
|
+
}));
|
|
6326
6506
|
function applySvgTransform() {
|
|
6327
6507
|
if (mergedRenderType.value !== RenderType.Image) return;
|
|
6328
6508
|
const svgEl = graphRef.value?.querySelector("svg");
|
|
@@ -6341,8 +6521,8 @@ var mermaid_default = /* @__PURE__ */ defineComponent({
|
|
|
6341
6521
|
const graphEl = graphRef.value;
|
|
6342
6522
|
if (!graphEl) return;
|
|
6343
6523
|
try {
|
|
6344
|
-
if (await
|
|
6345
|
-
const { svg } = await
|
|
6524
|
+
if (await parseMermaid(props.content, { suppressErrors: true }) === false) throw new Error("Invalid Mermaid syntax");
|
|
6525
|
+
const { svg } = await renderMermaid(`${renderBaseId}-${idSeed++}-${props.content.length || 0}`, props.content);
|
|
6346
6526
|
graphEl.innerHTML = svg;
|
|
6347
6527
|
applySvgTransform();
|
|
6348
6528
|
} catch (error) {
|
|
@@ -6450,7 +6630,7 @@ var mermaid_default = /* @__PURE__ */ defineComponent({
|
|
|
6450
6630
|
key: "copy",
|
|
6451
6631
|
actionRender: () => createVNode(ActionsWithSub.Copy, { "text": props.content }, null)
|
|
6452
6632
|
});
|
|
6453
|
-
return [...items, ...
|
|
6633
|
+
return [...items, ...resolvedCustomActions.value];
|
|
6454
6634
|
});
|
|
6455
6635
|
function renderHeader() {
|
|
6456
6636
|
if (props.header === null) return null;
|
|
@@ -6475,7 +6655,7 @@ var mermaid_default = /* @__PURE__ */ defineComponent({
|
|
|
6475
6655
|
if (next !== void 0) internalRenderType.value = next;
|
|
6476
6656
|
});
|
|
6477
6657
|
watch(() => props.config, (nextConfig) => {
|
|
6478
|
-
|
|
6658
|
+
initializeMermaid({
|
|
6479
6659
|
startOnLoad: false,
|
|
6480
6660
|
securityLevel: "strict",
|
|
6481
6661
|
theme: "default",
|
|
@@ -6790,14 +6970,10 @@ function getItemDomAttrs(item) {
|
|
|
6790
6970
|
delete domAttrs.children;
|
|
6791
6971
|
return domAttrs;
|
|
6792
6972
|
}
|
|
6793
|
-
function hasRenderableNode$5(node) {
|
|
6794
|
-
if (Array.isArray(node)) return node.some((item) => item !== null && item !== void 0 && item !== false);
|
|
6795
|
-
return node !== null && node !== void 0 && node !== false;
|
|
6796
|
-
}
|
|
6797
6973
|
//#endregion
|
|
6798
6974
|
//#region components/prompts/index.tsx
|
|
6799
6975
|
var prompts_default = /* @__PURE__ */ defineComponent({
|
|
6800
|
-
name: "
|
|
6976
|
+
name: "AxPrompts",
|
|
6801
6977
|
inheritAttrs: false,
|
|
6802
6978
|
props: {
|
|
6803
6979
|
items: {
|
|
@@ -6917,8 +7093,10 @@ var prompts_default = /* @__PURE__ */ defineComponent({
|
|
|
6917
7093
|
};
|
|
6918
7094
|
});
|
|
6919
7095
|
const triggerItemClick = (item, nested) => {
|
|
6920
|
-
if (
|
|
6921
|
-
|
|
7096
|
+
if (item.disabled || !nested && hasChildren(item)) return;
|
|
7097
|
+
const info = { data: item };
|
|
7098
|
+
props.onItemClick?.(info);
|
|
7099
|
+
emit("itemClick", info);
|
|
6922
7100
|
};
|
|
6923
7101
|
const renderTitle = () => {
|
|
6924
7102
|
if (slots.title) return slots.title({ originNode: props.title });
|
|
@@ -6963,13 +7141,13 @@ var prompts_default = /* @__PURE__ */ defineComponent({
|
|
|
6963
7141
|
}
|
|
6964
7142
|
],
|
|
6965
7143
|
"style": [nested ? mergedStyles.value.subItem : mergedStyles.value.item, item.style],
|
|
6966
|
-
"onClick": () => triggerItemClick(item,
|
|
6967
|
-
}), [hasRenderableNode
|
|
7144
|
+
"onClick": () => triggerItemClick(item, nested)
|
|
7145
|
+
}), [hasRenderableNode(iconNode) && createVNode("div", { "class": `${props.prefixCls}-icon` }, [iconNode]), createVNode("div", {
|
|
6968
7146
|
"class": [`${props.prefixCls}-content`, mergedClasses.value.itemContent],
|
|
6969
7147
|
"style": mergedStyles.value.itemContent
|
|
6970
7148
|
}, [
|
|
6971
|
-
hasRenderableNode
|
|
6972
|
-
hasRenderableNode
|
|
7149
|
+
hasRenderableNode(labelNode) && createVNode("div", { "class": `${props.prefixCls}-label` }, [labelNode]),
|
|
7150
|
+
hasRenderableNode(descriptionNode) && createVNode("div", { "class": `${props.prefixCls}-desc` }, [descriptionNode]),
|
|
6973
7151
|
itemHasChildren && createVNode("div", { "class": `${props.prefixCls}-nested` }, [renderItems(item.children, true)])
|
|
6974
7152
|
])]);
|
|
6975
7153
|
})]);
|
|
@@ -6994,7 +7172,7 @@ var prompts_default = /* @__PURE__ */ defineComponent({
|
|
|
6994
7172
|
attrs.style,
|
|
6995
7173
|
props.style
|
|
6996
7174
|
]
|
|
6997
|
-
}), [hasRenderableNode
|
|
7175
|
+
}), [hasRenderableNode(renderTitle()) && createVNode("div", {
|
|
6998
7176
|
"class": [`${props.prefixCls}-title`, mergedClasses.value.title],
|
|
6999
7177
|
"style": mergedStyles.value.title
|
|
7000
7178
|
}, [renderTitle()]), renderItems(props.items)]);
|
|
@@ -8603,7 +8781,7 @@ var sharedRenderComponents = {
|
|
|
8603
8781
|
SpeechButton: SpeechButton_default
|
|
8604
8782
|
};
|
|
8605
8783
|
var Sender_default = /* @__PURE__ */ defineComponent({
|
|
8606
|
-
name: "
|
|
8784
|
+
name: "AxSender",
|
|
8607
8785
|
inheritAttrs: false,
|
|
8608
8786
|
props: {
|
|
8609
8787
|
prefixCls: {
|
|
@@ -8944,7 +9122,7 @@ var Sender_default = /* @__PURE__ */ defineComponent({
|
|
|
8944
9122
|
//#endregion
|
|
8945
9123
|
//#region components/sender/SenderHeader.tsx
|
|
8946
9124
|
var SenderHeader_default = /* @__PURE__ */ defineComponent({
|
|
8947
|
-
name: "
|
|
9125
|
+
name: "AxSenderHeader",
|
|
8948
9126
|
props: {
|
|
8949
9127
|
open: {
|
|
8950
9128
|
type: Boolean,
|
|
@@ -9048,7 +9226,7 @@ var SenderHeader_default = /* @__PURE__ */ defineComponent({
|
|
|
9048
9226
|
//#endregion
|
|
9049
9227
|
//#region components/sender/SenderSwitch.tsx
|
|
9050
9228
|
var SenderSwitch_default = /* @__PURE__ */ defineComponent({
|
|
9051
|
-
name: "
|
|
9229
|
+
name: "AxSenderSwitch",
|
|
9052
9230
|
inheritAttrs: false,
|
|
9053
9231
|
props: {
|
|
9054
9232
|
prefixCls: {
|
|
@@ -9192,10 +9370,6 @@ Sender.Header = SenderHeader_default;
|
|
|
9192
9370
|
Sender.Switch = SenderSwitch_default;
|
|
9193
9371
|
//#endregion
|
|
9194
9372
|
//#region components/sources/components/CarouselCard.tsx
|
|
9195
|
-
var hasRenderableNode$4 = (node) => {
|
|
9196
|
-
if (Array.isArray(node)) return node.some((item) => item !== null && item !== void 0 && item !== false);
|
|
9197
|
-
return node !== null && node !== void 0 && node !== false;
|
|
9198
|
-
};
|
|
9199
9373
|
var CarouselCard = /* @__PURE__ */ defineComponent({
|
|
9200
9374
|
name: "XSourcesCarouselCard",
|
|
9201
9375
|
props: {
|
|
@@ -9306,7 +9480,7 @@ var CarouselCard = /* @__PURE__ */ defineComponent({
|
|
|
9306
9480
|
"key": item.key ?? index,
|
|
9307
9481
|
"class": `${compCls}-item`,
|
|
9308
9482
|
"onClick": () => handleClick(item)
|
|
9309
|
-
}, [createVNode("div", { "class": `${compCls}-item-title-wrapper` }, [hasRenderableNode
|
|
9483
|
+
}, [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])]);
|
|
9310
9484
|
})())] })]);
|
|
9311
9485
|
}
|
|
9312
9486
|
});
|
|
@@ -9411,15 +9585,9 @@ var style_default$4 = genStyleHooks("Sources", (token) => {
|
|
|
9411
9585
|
return [genSourcesStyle(compToken), genCollapseMotion(compToken)];
|
|
9412
9586
|
}, prepareComponentToken$4);
|
|
9413
9587
|
//#endregion
|
|
9414
|
-
//#region components/sources/Sources.tsx
|
|
9415
|
-
var hasRenderableNode$3 = (node) => {
|
|
9416
|
-
if (Array.isArray(node)) return node.some((item) => item !== null && item !== void 0 && item !== false);
|
|
9417
|
-
return node !== null && node !== void 0 && node !== false;
|
|
9418
|
-
};
|
|
9419
|
-
//#endregion
|
|
9420
9588
|
//#region components/sources/index.tsx
|
|
9421
9589
|
var sources_default = /* @__PURE__ */ defineComponent({
|
|
9422
|
-
name: "
|
|
9590
|
+
name: "AxSources",
|
|
9423
9591
|
inheritAttrs: false,
|
|
9424
9592
|
props: {
|
|
9425
9593
|
prefixCls: {
|
|
@@ -9569,9 +9737,9 @@ var sources_default = /* @__PURE__ */ defineComponent({
|
|
|
9569
9737
|
"target": "_blank",
|
|
9570
9738
|
"rel": "noopener noreferrer"
|
|
9571
9739
|
}, [
|
|
9572
|
-
hasRenderableNode
|
|
9740
|
+
hasRenderableNode(iconNode) && createVNode("span", { "class": `${props.prefixCls}-link-icon` }, [iconNode]),
|
|
9573
9741
|
createVNode("span", { "class": `${props.prefixCls}-link-title` }, [titleNode]),
|
|
9574
|
-
hasRenderableNode
|
|
9742
|
+
hasRenderableNode(descriptionNode) && createVNode("span", { "class": `${props.prefixCls}-link-description` }, [descriptionNode])
|
|
9575
9743
|
])]);
|
|
9576
9744
|
})]) : slots.default?.();
|
|
9577
9745
|
return createVNode("div", mergeProps({ "ref": rootRef }, domAttrs.value, {
|
|
@@ -9719,15 +9887,9 @@ function useActive(items, open, rtl, onCancel) {
|
|
|
9719
9887
|
return [activePaths, onKeyDown];
|
|
9720
9888
|
}
|
|
9721
9889
|
//#endregion
|
|
9722
|
-
//#region components/suggestion/Suggestion.tsx
|
|
9723
|
-
var hasRenderableNode$2 = (node) => {
|
|
9724
|
-
if (Array.isArray(node)) return node.some((item) => item !== null && item !== void 0 && item !== false);
|
|
9725
|
-
return node !== null && node !== void 0 && node !== false;
|
|
9726
|
-
};
|
|
9727
|
-
//#endregion
|
|
9728
9890
|
//#region components/suggestion/index.tsx
|
|
9729
9891
|
var suggestion_default = /* @__PURE__ */ defineComponent({
|
|
9730
|
-
name: "
|
|
9892
|
+
name: "AxSuggestion",
|
|
9731
9893
|
inheritAttrs: false,
|
|
9732
9894
|
props: {
|
|
9733
9895
|
prefixCls: {
|
|
@@ -9881,9 +10043,9 @@ var suggestion_default = /* @__PURE__ */ defineComponent({
|
|
|
9881
10043
|
originNode: item.extra
|
|
9882
10044
|
});
|
|
9883
10045
|
return createVNode(Flex, { "class": `${prefixCls.value}-item` }, { default: () => [
|
|
9884
|
-
hasRenderableNode
|
|
10046
|
+
hasRenderableNode(iconNode) && createVNode("div", { "class": `${prefixCls.value}-item-icon` }, [iconNode]),
|
|
9885
10047
|
labelNode,
|
|
9886
|
-
hasRenderableNode
|
|
10048
|
+
hasRenderableNode(extraNode) && createVNode("div", { "class": `${prefixCls.value}-item-extra` }, [extraNode])
|
|
9887
10049
|
] });
|
|
9888
10050
|
},
|
|
9889
10051
|
"classes": { popup: { root: popupRootClass.value } },
|
|
@@ -10005,7 +10167,7 @@ var style_default$2 = genStyleHooks("Think", (token) => {
|
|
|
10005
10167
|
//#endregion
|
|
10006
10168
|
//#region components/think/index.tsx
|
|
10007
10169
|
var think_default = /* @__PURE__ */ defineComponent({
|
|
10008
|
-
name: "
|
|
10170
|
+
name: "AxThink",
|
|
10009
10171
|
inheritAttrs: false,
|
|
10010
10172
|
props: {
|
|
10011
10173
|
prefixCls: {
|
|
@@ -10410,12 +10572,8 @@ var style_default$1 = genStyleHooks("ThoughtChain", (token) => {
|
|
|
10410
10572
|
}, prepareComponentToken$1);
|
|
10411
10573
|
//#endregion
|
|
10412
10574
|
//#region components/thought-chain/Item.tsx
|
|
10413
|
-
function hasRenderableNode$1(node) {
|
|
10414
|
-
if (Array.isArray(node)) return node.some((item) => item !== null && item !== void 0 && item !== false);
|
|
10415
|
-
return node !== null && node !== void 0 && node !== false;
|
|
10416
|
-
}
|
|
10417
10575
|
var XThoughtChainItem = /* @__PURE__ */ defineComponent({
|
|
10418
|
-
name: "
|
|
10576
|
+
name: "AxThoughtChainItem",
|
|
10419
10577
|
props: {
|
|
10420
10578
|
prefixCls: {
|
|
10421
10579
|
type: String,
|
|
@@ -10493,16 +10651,16 @@ var XThoughtChainItem = /* @__PURE__ */ defineComponent({
|
|
|
10493
10651
|
return () => {
|
|
10494
10652
|
const cls = itemPrefixCls.value;
|
|
10495
10653
|
const statusCls = `${props.prefixCls}-status`;
|
|
10496
|
-
const
|
|
10654
|
+
const iconSlot = slots.icon;
|
|
10497
10655
|
const originIconNode = props.status ? STATUS_ICON_MAP[props.status] : props.icon;
|
|
10498
|
-
const iconNode =
|
|
10656
|
+
const iconNode = iconSlot ? iconSlot({
|
|
10499
10657
|
originNode: originIconNode,
|
|
10500
10658
|
status: props.status
|
|
10501
10659
|
}) : originIconNode;
|
|
10502
10660
|
const titleNode = slots.title ? slots.title({ originNode: props.title }) : props.title;
|
|
10503
10661
|
const descriptionNode = slots.description ? slots.description({ originNode: props.description }) : props.description;
|
|
10504
|
-
const hasTitle = hasRenderableNode
|
|
10505
|
-
const hasDescription = hasRenderableNode
|
|
10662
|
+
const hasTitle = hasRenderableNode(titleNode);
|
|
10663
|
+
const hasDescription = hasRenderableNode(descriptionNode);
|
|
10506
10664
|
return createVNode("div", {
|
|
10507
10665
|
"ref": rootRef,
|
|
10508
10666
|
"class": [
|
|
@@ -10522,7 +10680,7 @@ var XThoughtChainItem = /* @__PURE__ */ defineComponent({
|
|
|
10522
10680
|
],
|
|
10523
10681
|
"style": props.styles?.root,
|
|
10524
10682
|
"onClick": handleClick
|
|
10525
|
-
}, [hasRenderableNode
|
|
10683
|
+
}, [hasRenderableNode(iconNode) && createVNode("div", {
|
|
10526
10684
|
"style": props.styles?.icon,
|
|
10527
10685
|
"class": [
|
|
10528
10686
|
statusCls,
|
|
@@ -10545,10 +10703,6 @@ var XThoughtChainItem = /* @__PURE__ */ defineComponent({
|
|
|
10545
10703
|
});
|
|
10546
10704
|
//#endregion
|
|
10547
10705
|
//#region components/thought-chain/Node.tsx
|
|
10548
|
-
function hasRenderableNode(node) {
|
|
10549
|
-
if (Array.isArray(node)) return node.some((item) => item !== null && item !== void 0 && item !== false);
|
|
10550
|
-
return node !== null && node !== void 0 && node !== false;
|
|
10551
|
-
}
|
|
10552
10706
|
var Node_default = /* @__PURE__ */ defineComponent({
|
|
10553
10707
|
name: "ThoughtChainNode",
|
|
10554
10708
|
props: {
|
|
@@ -10745,7 +10899,7 @@ var Node_default = /* @__PURE__ */ defineComponent({
|
|
|
10745
10899
|
//#endregion
|
|
10746
10900
|
//#region components/thought-chain/index.tsx
|
|
10747
10901
|
var ThoughtChainWithSub = /* @__PURE__ */ defineComponent({
|
|
10748
|
-
name: "
|
|
10902
|
+
name: "AxThoughtChain",
|
|
10749
10903
|
inheritAttrs: false,
|
|
10750
10904
|
props: {
|
|
10751
10905
|
prefixCls: {
|
|
@@ -10963,7 +11117,7 @@ function hasContent(value) {
|
|
|
10963
11117
|
return Array.isArray(value) ? value.length > 0 : value !== null && value !== void 0;
|
|
10964
11118
|
}
|
|
10965
11119
|
var XWelcome = /* @__PURE__ */ defineComponent({
|
|
10966
|
-
name: "
|
|
11120
|
+
name: "AxWelcome",
|
|
10967
11121
|
inheritAttrs: false,
|
|
10968
11122
|
props: {
|
|
10969
11123
|
prefixCls: {
|
|
@@ -11128,7 +11282,7 @@ var XWelcome = /* @__PURE__ */ defineComponent({
|
|
|
11128
11282
|
//#endregion
|
|
11129
11283
|
//#region components/x-provider/index.tsx
|
|
11130
11284
|
var XProvider = /* @__PURE__ */ defineComponent({
|
|
11131
|
-
name: "
|
|
11285
|
+
name: "AxProvider",
|
|
11132
11286
|
inheritAttrs: false,
|
|
11133
11287
|
props: {
|
|
11134
11288
|
attachments: {
|
|
@@ -11233,36 +11387,11 @@ var components = [
|
|
|
11233
11387
|
ThoughtChainWithSub,
|
|
11234
11388
|
XThoughtChainItem
|
|
11235
11389
|
];
|
|
11236
|
-
var componentAliases = new Map([
|
|
11237
|
-
["XBubble", ["ABubble"]],
|
|
11238
|
-
["XBubbleList", ["ABubbleList"]],
|
|
11239
|
-
["XBubbleSystem", ["ABubbleSystem"]],
|
|
11240
|
-
["XBubbleDivider", ["ABubbleDivider"]],
|
|
11241
|
-
["XActions", ["AActions"]],
|
|
11242
|
-
["XActionsAudio", ["AActionsAudio"]],
|
|
11243
|
-
["XActionsCopy", ["AActionsCopy"]],
|
|
11244
|
-
["XActionsFeedback", ["AActionsFeedback"]],
|
|
11245
|
-
["XActionsItem", ["AActionsItem"]],
|
|
11246
|
-
["XFileCard", ["AFileCard"]],
|
|
11247
|
-
["XFileCardList", ["AFileCardList"]],
|
|
11248
|
-
["XMermaid", ["AMermaid"]],
|
|
11249
|
-
["XAttachments", ["AAttachments"]],
|
|
11250
|
-
["XSender", ["ASender"]],
|
|
11251
|
-
["XSenderHeader", ["ASenderHeader"]],
|
|
11252
|
-
["XSenderSwitch", ["ASenderSwitch"]],
|
|
11253
|
-
["XSuggestion", ["ASuggestion"]],
|
|
11254
|
-
["XThink", ["AThink"]],
|
|
11255
|
-
["XThoughtChain", ["AThoughtChain"]],
|
|
11256
|
-
["XThoughtChainItem", ["AThoughtChainItem"]]
|
|
11257
|
-
]);
|
|
11258
11390
|
var components_default = {
|
|
11259
11391
|
install(app) {
|
|
11260
11392
|
components.forEach((component) => {
|
|
11261
11393
|
if (!component.name) return;
|
|
11262
11394
|
app.component(component.name, component);
|
|
11263
|
-
componentAliases.get(component.name)?.forEach((alias) => {
|
|
11264
|
-
app.component(alias, component);
|
|
11265
|
-
});
|
|
11266
11395
|
});
|
|
11267
11396
|
},
|
|
11268
11397
|
version
|