@antdv-next/x 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/_utils/vue.d.ts +2 -0
- package/dist/_utils/vue.js +16 -0
- package/dist/actions/Actions.js +3 -2
- package/dist/actions/ActionsCopy.js +4 -4
- package/dist/attachments/PlaceholderUploader.d.ts +16 -0
- package/dist/attachments/PlaceholderUploader.js +31 -5
- package/dist/attachments/index.d.ts +8 -5
- package/dist/attachments/index.js +7 -6
- package/dist/bubble/Bubble.js +5 -8
- package/dist/bubble/BubbleList.js +4 -4
- package/dist/bubble/Divider.js +1 -1
- package/dist/code-highlighter/shiki.js +2 -1
- package/dist/conversations/GroupTitle.d.ts +22 -2
- package/dist/conversations/GroupTitle.js +25 -3
- package/dist/conversations/Item.d.ts +1 -1
- package/dist/conversations/Item.js +1 -4
- package/dist/conversations/index.d.ts +10 -1
- package/dist/conversations/index.js +12 -0
- package/dist/conversations/interface.d.ts +7 -0
- package/dist/file-card/FileCard.js +1 -1
- package/dist/file-card/List.js +1 -1
- package/dist/file-card/components/File.d.ts +6 -6
- package/dist/file-card/components/File.js +2 -2
- package/dist/index.esm.js +151 -116
- package/dist/index.umd.js +150 -115
- package/dist/mermaid/Mermaid.d.ts +5 -0
- package/dist/mermaid/Mermaid.js +22 -1
- package/dist/mermaid/index.d.ts +1 -1
- package/dist/package.js +1 -1
- package/dist/prompts/Prompts.d.ts +1 -10
- package/dist/prompts/Prompts.js +2 -11
- package/dist/prompts/interface.d.ts +0 -1
- package/dist/sources/Sources.d.ts +0 -9
- package/dist/sources/Sources.js +1 -9
- package/dist/sources/components/CarouselCard.js +1 -4
- package/dist/sources/interface.d.ts +0 -1
- package/dist/suggestion/Suggestion.d.ts +0 -18
- package/dist/suggestion/Suggestion.js +2 -18
- package/dist/suggestion/interface.d.ts +0 -2
- package/dist/thought-chain/Item.js +3 -6
- package/dist/thought-chain/Node.js +1 -4
- package/package.json +2 -1
package/dist/package.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CSSProperties, PropType, StyleValue } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import { PromptsItemType, PromptsProps, SemanticType } from './interface';
|
|
3
3
|
export declare const XPrompts: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
4
4
|
items: {
|
|
5
5
|
type: PropType<PromptsItemType[]>;
|
|
@@ -9,10 +9,6 @@ export declare const XPrompts: import('vue').DefineComponent<import('vue').Extra
|
|
|
9
9
|
type: PropType<PromptsProps["title"]>;
|
|
10
10
|
default: undefined;
|
|
11
11
|
};
|
|
12
|
-
onItemClick: {
|
|
13
|
-
type: PropType<PromptsProps["onItemClick"]>;
|
|
14
|
-
default: undefined;
|
|
15
|
-
};
|
|
16
12
|
vertical: {
|
|
17
13
|
type: BooleanConstructor;
|
|
18
14
|
default: boolean;
|
|
@@ -62,10 +58,6 @@ export declare const XPrompts: import('vue').DefineComponent<import('vue').Extra
|
|
|
62
58
|
type: PropType<PromptsProps["title"]>;
|
|
63
59
|
default: undefined;
|
|
64
60
|
};
|
|
65
|
-
onItemClick: {
|
|
66
|
-
type: PropType<PromptsProps["onItemClick"]>;
|
|
67
|
-
default: undefined;
|
|
68
|
-
};
|
|
69
61
|
vertical: {
|
|
70
62
|
type: BooleanConstructor;
|
|
71
63
|
default: boolean;
|
|
@@ -119,7 +111,6 @@ export declare const XPrompts: import('vue').DefineComponent<import('vue').Extra
|
|
|
119
111
|
classes: Partial<Record<SemanticType, string>> | undefined;
|
|
120
112
|
styles: Partial<Record<SemanticType, CSSProperties>> | undefined;
|
|
121
113
|
title: import('vue').VNodeChild;
|
|
122
|
-
onItemClick: ((info: PromptsClickInfo) => void) | undefined;
|
|
123
114
|
items: PromptsItemType[];
|
|
124
115
|
fadeInLeft: boolean;
|
|
125
116
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
package/dist/prompts/Prompts.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import useXComponentConfig from "../_utils/hooks/use-x-component-config.js";
|
|
2
|
+
import { hasRenderableNode } from "../_utils/vue.js";
|
|
2
3
|
import style_default from "./style/index.js";
|
|
3
4
|
import { computed, createVNode, defineComponent, mergeProps, nextTick, onMounted, ref, useAttrs } from "vue";
|
|
4
5
|
import { useConfig } from "antdv-next/dist/config-provider/context";
|
|
@@ -19,10 +20,6 @@ function getItemDomAttrs(item) {
|
|
|
19
20
|
delete domAttrs.children;
|
|
20
21
|
return domAttrs;
|
|
21
22
|
}
|
|
22
|
-
function hasRenderableNode(node) {
|
|
23
|
-
if (Array.isArray(node)) return node.some((item) => item !== null && item !== void 0 && item !== false);
|
|
24
|
-
return node !== null && node !== void 0 && node !== false;
|
|
25
|
-
}
|
|
26
23
|
var XPrompts = /* @__PURE__ */ defineComponent({
|
|
27
24
|
name: "AxPrompts",
|
|
28
25
|
inheritAttrs: false,
|
|
@@ -40,10 +37,6 @@ var XPrompts = /* @__PURE__ */ defineComponent({
|
|
|
40
37
|
],
|
|
41
38
|
default: void 0
|
|
42
39
|
},
|
|
43
|
-
onItemClick: {
|
|
44
|
-
type: Function,
|
|
45
|
-
default: void 0
|
|
46
|
-
},
|
|
47
40
|
vertical: {
|
|
48
41
|
type: Boolean,
|
|
49
42
|
default: false
|
|
@@ -145,9 +138,7 @@ var XPrompts = /* @__PURE__ */ defineComponent({
|
|
|
145
138
|
});
|
|
146
139
|
const triggerItemClick = (item, nested) => {
|
|
147
140
|
if (item.disabled || !nested && hasChildren(item)) return;
|
|
148
|
-
|
|
149
|
-
props.onItemClick?.(info);
|
|
150
|
-
emit("itemClick", info);
|
|
141
|
+
emit("itemClick", { data: item });
|
|
151
142
|
};
|
|
152
143
|
const renderTitle = () => {
|
|
153
144
|
if (slots.title) return slots.title({ originNode: props.title });
|
|
@@ -31,7 +31,6 @@ export interface PromptsRef {
|
|
|
31
31
|
export interface PromptsProps extends Omit<HTMLAttributes, "title" | "class" | "style"> {
|
|
32
32
|
items?: PromptsItemType[];
|
|
33
33
|
title?: VNodeChild;
|
|
34
|
-
onItemClick?: (info: PromptsClickInfo) => void;
|
|
35
34
|
vertical?: boolean;
|
|
36
35
|
wrap?: boolean;
|
|
37
36
|
styles?: Partial<Record<SemanticType, CSSProperties>>;
|
|
@@ -61,10 +61,6 @@ export declare const XSources: import('vue').DefineComponent<import('vue').Extra
|
|
|
61
61
|
type: BooleanConstructor;
|
|
62
62
|
default: undefined;
|
|
63
63
|
};
|
|
64
|
-
onExpand: {
|
|
65
|
-
type: PropType<SourcesProps["onExpand"]>;
|
|
66
|
-
default: undefined;
|
|
67
|
-
};
|
|
68
64
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "expand"[], "expand", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
69
65
|
prefixCls: {
|
|
70
66
|
type: StringConstructor;
|
|
@@ -126,10 +122,6 @@ export declare const XSources: import('vue').DefineComponent<import('vue').Extra
|
|
|
126
122
|
type: BooleanConstructor;
|
|
127
123
|
default: undefined;
|
|
128
124
|
};
|
|
129
|
-
onExpand: {
|
|
130
|
-
type: PropType<SourcesProps["onExpand"]>;
|
|
131
|
-
default: undefined;
|
|
132
|
-
};
|
|
133
125
|
}>> & Readonly<{
|
|
134
126
|
onExpand?: ((...args: any[]) => any) | undefined;
|
|
135
127
|
}>, {
|
|
@@ -145,7 +137,6 @@ export declare const XSources: import('vue').DefineComponent<import('vue').Extra
|
|
|
145
137
|
onClick: ((item: SourcesItem) => void) | undefined;
|
|
146
138
|
items: SourcesItem[];
|
|
147
139
|
activeKey: string | number | undefined;
|
|
148
|
-
onExpand: ((expand: boolean) => void) | undefined;
|
|
149
140
|
expandIconPosition: "end" | "start" | undefined;
|
|
150
141
|
popoverOverlayWidth: string | number | undefined;
|
|
151
142
|
defaultExpanded: boolean;
|
package/dist/sources/Sources.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import useXComponentConfig from "../_utils/hooks/use-x-component-config.js";
|
|
2
2
|
import initCollapseTransition from "../_utils/transition.js";
|
|
3
|
+
import { hasRenderableNode } from "../_utils/vue.js";
|
|
3
4
|
import CarouselCard from "./components/CarouselCard.js";
|
|
4
5
|
import style_default from "./style/index.js";
|
|
5
6
|
import { Fragment, Transition, computed, createVNode, defineComponent, mergeProps, ref, useAttrs } from "vue";
|
|
@@ -7,10 +8,6 @@ import { useConfig } from "antdv-next/dist/config-provider/context";
|
|
|
7
8
|
import { Popover } from "antdv-next";
|
|
8
9
|
import { RightOutlined } from "@antdv-next/icons";
|
|
9
10
|
//#region components/sources/Sources.tsx
|
|
10
|
-
var hasRenderableNode = (node) => {
|
|
11
|
-
if (Array.isArray(node)) return node.some((item) => item !== null && item !== void 0 && item !== false);
|
|
12
|
-
return node !== null && node !== void 0 && node !== false;
|
|
13
|
-
};
|
|
14
11
|
var XSources = /* @__PURE__ */ defineComponent({
|
|
15
12
|
name: "AxSources",
|
|
16
13
|
inheritAttrs: false,
|
|
@@ -86,10 +83,6 @@ var XSources = /* @__PURE__ */ defineComponent({
|
|
|
86
83
|
defaultExpanded: {
|
|
87
84
|
type: Boolean,
|
|
88
85
|
default: void 0
|
|
89
|
-
},
|
|
90
|
-
onExpand: {
|
|
91
|
-
type: Function,
|
|
92
|
-
default: void 0
|
|
93
86
|
}
|
|
94
87
|
},
|
|
95
88
|
emits: ["expand"],
|
|
@@ -112,7 +105,6 @@ var XSources = /* @__PURE__ */ defineComponent({
|
|
|
112
105
|
const toggleExpand = () => {
|
|
113
106
|
const newExpand = !isExpand.value;
|
|
114
107
|
if (props.expanded === void 0) innerExpanded.value = newExpand;
|
|
115
|
-
props.onExpand?.(newExpand);
|
|
116
108
|
emit("expand", newExpand);
|
|
117
109
|
};
|
|
118
110
|
const domAttrs = computed(() => {
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
+
import { hasRenderableNode } from "../../_utils/vue.js";
|
|
1
2
|
import { createVNode, defineComponent, nextTick, ref, watch } from "vue";
|
|
2
3
|
import { Carousel } from "antdv-next";
|
|
3
4
|
import { LeftOutlined, RightOutlined } from "@antdv-next/icons";
|
|
4
5
|
//#region components/sources/components/CarouselCard.tsx
|
|
5
|
-
var hasRenderableNode = (node) => {
|
|
6
|
-
if (Array.isArray(node)) return node.some((item) => item !== null && item !== void 0 && item !== false);
|
|
7
|
-
return node !== null && node !== void 0 && node !== false;
|
|
8
|
-
};
|
|
9
6
|
var CarouselCard = /* @__PURE__ */ defineComponent({
|
|
10
7
|
name: "XSourcesCarouselCard",
|
|
11
8
|
props: {
|
|
@@ -29,14 +29,6 @@ declare const XSuggestion: import('vue').DefineComponent<import('vue').ExtractPr
|
|
|
29
29
|
type: BooleanConstructor;
|
|
30
30
|
default: undefined;
|
|
31
31
|
};
|
|
32
|
-
onOpenChange: {
|
|
33
|
-
type: PropType<SuggestionProps["onOpenChange"]>;
|
|
34
|
-
default: undefined;
|
|
35
|
-
};
|
|
36
|
-
onSelect: {
|
|
37
|
-
type: PropType<SuggestionProps["onSelect"]>;
|
|
38
|
-
default: undefined;
|
|
39
|
-
};
|
|
40
32
|
items: {
|
|
41
33
|
type: PropType<SuggestionProps["items"]>;
|
|
42
34
|
default: () => never[];
|
|
@@ -74,14 +66,6 @@ declare const XSuggestion: import('vue').DefineComponent<import('vue').ExtractPr
|
|
|
74
66
|
type: BooleanConstructor;
|
|
75
67
|
default: undefined;
|
|
76
68
|
};
|
|
77
|
-
onOpenChange: {
|
|
78
|
-
type: PropType<SuggestionProps["onOpenChange"]>;
|
|
79
|
-
default: undefined;
|
|
80
|
-
};
|
|
81
|
-
onSelect: {
|
|
82
|
-
type: PropType<SuggestionProps["onSelect"]>;
|
|
83
|
-
default: undefined;
|
|
84
|
-
};
|
|
85
69
|
items: {
|
|
86
70
|
type: PropType<SuggestionProps["items"]>;
|
|
87
71
|
default: () => never[];
|
|
@@ -102,8 +86,6 @@ declare const XSuggestion: import('vue').DefineComponent<import('vue').ExtractPr
|
|
|
102
86
|
class: import('vue').ClassValue;
|
|
103
87
|
classes: Partial<Record<import('./interface').SemanticType, string>> | undefined;
|
|
104
88
|
styles: Partial<Record<import('./interface').SemanticType, import('vue').CSSProperties>> | undefined;
|
|
105
|
-
onOpenChange: ((open: boolean) => void) | undefined;
|
|
106
|
-
onSelect: ((value: string, selectedOptions: SuggestionItem[]) => void) | undefined;
|
|
107
89
|
items: SuggestionItem[] | ((info?: any) => SuggestionItem[]);
|
|
108
90
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
109
91
|
export default XSuggestion;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import useXComponentConfig from "../_utils/hooks/use-x-component-config.js";
|
|
2
|
+
import { hasRenderableNode } from "../_utils/vue.js";
|
|
2
3
|
import style_default from "./style/index.js";
|
|
3
4
|
import useActive from "./useActive.js";
|
|
4
5
|
import { computed, createVNode, defineComponent, mergeProps, ref, useAttrs, watch } from "vue";
|
|
5
6
|
import { useConfig } from "antdv-next/dist/config-provider/context";
|
|
6
7
|
import { Cascader, Flex } from "antdv-next";
|
|
7
8
|
//#region components/suggestion/Suggestion.tsx
|
|
8
|
-
var hasRenderableNode = (node) => {
|
|
9
|
-
if (Array.isArray(node)) return node.some((item) => item !== null && item !== void 0 && item !== false);
|
|
10
|
-
return node !== null && node !== void 0 && node !== false;
|
|
11
|
-
};
|
|
12
9
|
var XSuggestion = /* @__PURE__ */ defineComponent({
|
|
13
10
|
name: "AxSuggestion",
|
|
14
11
|
inheritAttrs: false,
|
|
@@ -49,14 +46,6 @@ var XSuggestion = /* @__PURE__ */ defineComponent({
|
|
|
49
46
|
type: Boolean,
|
|
50
47
|
default: void 0
|
|
51
48
|
},
|
|
52
|
-
onOpenChange: {
|
|
53
|
-
type: Function,
|
|
54
|
-
default: void 0
|
|
55
|
-
},
|
|
56
|
-
onSelect: {
|
|
57
|
-
type: Function,
|
|
58
|
-
default: void 0
|
|
59
|
-
},
|
|
60
49
|
items: {
|
|
61
50
|
type: [Array, Function],
|
|
62
51
|
default: () => []
|
|
@@ -99,7 +88,6 @@ var XSuggestion = /* @__PURE__ */ defineComponent({
|
|
|
99
88
|
}, { immediate: true });
|
|
100
89
|
const triggerOpen = (nextOpen) => {
|
|
101
90
|
if (props.open === void 0) innerOpen.value = nextOpen;
|
|
102
|
-
props.onOpenChange?.(nextOpen);
|
|
103
91
|
emit("openChange", nextOpen);
|
|
104
92
|
};
|
|
105
93
|
const onClose = () => {
|
|
@@ -117,11 +105,7 @@ var XSuggestion = /* @__PURE__ */ defineComponent({
|
|
|
117
105
|
const path = Array.isArray(valuePath) ? valuePath : [];
|
|
118
106
|
const lastValue = path[path.length - 1];
|
|
119
107
|
const selected = selectedOptions ?? [];
|
|
120
|
-
if (lastValue !== void 0)
|
|
121
|
-
const selectedValue = String(lastValue);
|
|
122
|
-
props.onSelect?.(selectedValue, selected);
|
|
123
|
-
emit("select", selectedValue, selected);
|
|
124
|
-
}
|
|
108
|
+
if (lastValue !== void 0) emit("select", String(lastValue), selected);
|
|
125
109
|
triggerOpen(false);
|
|
126
110
|
};
|
|
127
111
|
const [activePath, onKeyDown] = useActive(itemList, mergedOpen, isRtl, onClose);
|
|
@@ -23,9 +23,7 @@ export interface SuggestionProps<T = any> extends Omit<CascaderProps<SuggestionI
|
|
|
23
23
|
class?: ClassValue;
|
|
24
24
|
style?: StyleValue;
|
|
25
25
|
open?: boolean;
|
|
26
|
-
onOpenChange?: (open: boolean) => void;
|
|
27
26
|
items: SuggestionItem[] | ((info?: T) => SuggestionItem[]);
|
|
28
|
-
onSelect?: (value: string, selectedOptions: SuggestionItem[]) => void;
|
|
29
27
|
block?: boolean;
|
|
30
28
|
styles?: Partial<Record<SemanticType, CSSProperties>>;
|
|
31
29
|
classes?: Partial<Record<SemanticType, string>>;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
+
import { hasRenderableNode } from "../_utils/vue.js";
|
|
1
2
|
import { STATUS_ICON_MAP } from "./Status.js";
|
|
2
3
|
import style_default from "./style/index.js";
|
|
3
4
|
import { computed, createVNode, defineComponent, ref } from "vue";
|
|
4
5
|
import { useConfig } from "antdv-next/dist/config-provider/context";
|
|
5
6
|
//#region components/thought-chain/Item.tsx
|
|
6
|
-
function hasRenderableNode(node) {
|
|
7
|
-
if (Array.isArray(node)) return node.some((item) => item !== null && item !== void 0 && item !== false);
|
|
8
|
-
return node !== null && node !== void 0 && node !== false;
|
|
9
|
-
}
|
|
10
7
|
var XThoughtChainItem = /* @__PURE__ */ defineComponent({
|
|
11
8
|
name: "AxThoughtChainItem",
|
|
12
9
|
props: {
|
|
@@ -86,9 +83,9 @@ var XThoughtChainItem = /* @__PURE__ */ defineComponent({
|
|
|
86
83
|
return () => {
|
|
87
84
|
const cls = itemPrefixCls.value;
|
|
88
85
|
const statusCls = `${props.prefixCls}-status`;
|
|
89
|
-
const
|
|
86
|
+
const iconSlot = slots.icon;
|
|
90
87
|
const originIconNode = props.status ? STATUS_ICON_MAP[props.status] : props.icon;
|
|
91
|
-
const iconNode =
|
|
88
|
+
const iconNode = iconSlot ? iconSlot({
|
|
92
89
|
originNode: originIconNode,
|
|
93
90
|
status: props.status
|
|
94
91
|
}) : originIconNode;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
+
import { hasRenderableNode } from "../_utils/vue.js";
|
|
1
2
|
import { STATUS_ICON_MAP } from "./Status.js";
|
|
2
3
|
import { Transition, computed, createVNode, defineComponent } from "vue";
|
|
3
4
|
import { useConfig } from "antdv-next/dist/config-provider/context";
|
|
4
5
|
import { LeftOutlined, RightOutlined } from "@antdv-next/icons";
|
|
5
6
|
//#region components/thought-chain/Node.tsx
|
|
6
|
-
function hasRenderableNode(node) {
|
|
7
|
-
if (Array.isArray(node)) return node.some((item) => item !== null && item !== void 0 && item !== false);
|
|
8
|
-
return node !== null && node !== void 0 && node !== false;
|
|
9
|
-
}
|
|
10
7
|
var Node_default = /* @__PURE__ */ defineComponent({
|
|
11
8
|
name: "ThoughtChainNode",
|
|
12
9
|
props: {
|