ant-design-x-vue 1.2.6 → 1.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +38731 -0
- package/dist/index.umd.js +244 -13
- package/es/_util/motion.mjs +11 -13
- package/es/attachments/Attachments2.mjs +14 -14
- package/es/attachments/FileList/FileList2.mjs +10 -12
- package/es/attachments/FileList/FileListCard.mjs +21 -21
- package/es/attachments/index.mjs +7 -4
- package/es/bubble/Bubble.mjs +11 -11
- package/es/bubble/BubbleList.mjs +28 -29
- package/es/bubble/index.mjs +10 -7
- package/es/components.mjs +31 -0
- package/es/components.ts2.mjs +35 -0
- package/es/conversations/Conversations.mjs +14 -15
- package/es/conversations/index.mjs +6 -3
- package/es/hooks.mjs +13 -0
- package/es/index.mjs +47 -36
- package/es/prompts/Prompts.mjs +16 -13
- package/es/prompts/index.mjs +6 -3
- package/es/sender/Sender.mjs +125 -109
- package/es/sender/index.mjs +9 -6
- package/es/suggestion/Suggestion.mjs +10 -10
- package/es/suggestion/index.mjs +6 -3
- package/es/theme/genStyleUtils.mjs +7 -8
- package/es/thought-chain/ThoughtChain.mjs +17 -18
- package/es/thought-chain/index.mjs +6 -3
- package/es/welcome/Welcome.mjs +5 -5
- package/es/welcome/index.mjs +6 -3
- package/es/x-provider/index.mjs +9 -6
- package/es/x-provider/index2.mjs +5 -5
- package/lib/_util/motion.js +1 -1
- package/lib/attachments/Attachments2.js +2 -2
- package/lib/attachments/FileList/FileList2.js +1 -1
- package/lib/attachments/FileList/FileListCard.js +1 -1
- package/lib/attachments/index.js +1 -1
- package/lib/bubble/Bubble.js +1 -1
- package/lib/bubble/BubbleList.js +1 -1
- package/lib/bubble/index.js +1 -1
- package/lib/components.js +1 -0
- package/lib/components.ts2.js +1 -0
- package/lib/conversations/Conversations.js +1 -1
- package/lib/conversations/index.js +1 -1
- package/lib/hooks.js +1 -0
- package/lib/index.js +1 -1
- package/lib/prompts/Prompts.js +1 -1
- package/lib/prompts/index.js +1 -1
- package/lib/sender/Sender.js +1 -1
- package/lib/sender/index.js +1 -1
- package/lib/suggestion/Suggestion.js +1 -1
- package/lib/suggestion/index.js +1 -1
- package/lib/theme/genStyleUtils.js +1 -1
- package/lib/thought-chain/ThoughtChain.js +1 -1
- package/lib/thought-chain/index.js +1 -1
- package/lib/welcome/Welcome.js +1 -1
- package/lib/welcome/index.js +1 -1
- package/lib/x-provider/index.js +1 -1
- package/lib/x-provider/index2.js +1 -1
- package/package.json +5 -4
- package/typings/attachments/index.d.ts +1 -1
- package/typings/bubble/Bubble.vue.d.ts +6 -6
- package/typings/bubble/index.d.ts +12 -12
- package/typings/components.d.ts +9 -0
- package/typings/hooks.d.ts +4 -0
- package/typings/index.d.ts +8 -13
- package/typings/prompts/interface.d.ts +1 -1
- package/typings/sender/Sender.vue.d.ts +4 -4
- package/typings/sender/SenderHeader.vue.d.ts +12 -10
- package/typings/sender/index.d.ts +19 -32
- package/typings/sender/interface.d.ts +13 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),h=require("../attachments/Attachments2.js")
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),h=require("../attachments/Attachments2.js");require("../x-provider/index.js");const O=require("../_util/hooks/use-x-component-config.js"),D=require("./style/index.js"),y=require("../_util/hooks/use-state.js"),F=require("ant-design-vue"),P=require("./useActive.js"),A=require("../x-provider/hooks/use-x-provider-context.js"),L=n.defineComponent({name:"AXSuggestion",__name:"Suggestion",props:n.mergeDefaults({prefixCls:null,className:null,rootClassName:null,style:null,children:{type:Function},open:{type:Boolean},onOpenChange:{type:Function},items:{type:Function},onSelect:{type:Function},block:{type:Boolean},styles:null,classNames:null},{open:!1}),setup(e){n.toRef(e,"prefixCls");const o=n.useSlots(),{direction:S,getPrefixCls:N}=A.default(),s=n.computed(()=>N("suggestion",e.prefixCls));`${s.value}`;const a=n.computed(()=>S.value==="rtl"),u=O.default("suggestion"),[q,c,i]=D.default(s),[r,b]=y.default(e.open),[k,x]=y.default(),l=t=>{var C;b(t),(C=e.onOpenChange)==null||C.call(e,t)},d=t=>{t===!1?l(!1):(x(t),l(!0))},f=()=>{l(!1)},g=n.computed(()=>typeof e.items=="function"?e.items(k.value):e.items),m=t=>{e.onSelect&&e.onSelect(t[t.length-1]),l(!1)},[V,v]=P.default(g,r,a,m,f),w=n.computed(()=>{var t;return o.default?o.default({onTrigger:d,onKeyDown:v}):(t=e.children)==null?void 0:t.call(e,{onTrigger:d,onKeyDown:v})});return()=>q(n.createVNode(F.Cascader,{options:g.value,open:r.value,value:V.value,placement:a.value?"topRight":"topLeft",onDropdownVisibleChange:t=>{t||f()},class:h.classnames(e.rootClassName,s.value,c,i,{[`${s.value}-block`]:e.block}),onChange:m,dropdownMatchSelectWidth:e.block},{default:()=>n.createVNode("div",{class:h.classnames(s.value,u.value.className,e.rootClassName,e.className,`${s.value}-wrapper`,c.value,i),style:{...u.value.style,...e.style}},[w.value])}))}});exports.default=L;
|
package/lib/suggestion/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Suggestion.js");exports.Suggestion=e.default;exports.default=e.default;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Suggestion.js");e.default.install=function(t){return t.component(e.default.name,e.default),t};exports.Suggestion=e.default;exports.default=e.default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../_util/cssinjs-utils/util/genStyleUtils.js")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../_util/cssinjs-utils/util/genStyleUtils.js");require("../x-provider/index.js");const l=require("./useToken.js"),i=require("vue"),n=require("../x-provider/hooks/use-x-provider-context.js"),{genStyleHooks:a,genComponentStyleHook:c,genSubStyleComponent:d}=u.default({usePrefix:()=>{const{getPrefixCls:e,iconPrefixCls:t}=n.default();return{iconPrefixCls:i.unref(t),rootPrefixCls:e()}},useToken:()=>{const[e,t,o,r,s]=l.useInternalToken();return{theme:e,realToken:t,hashId:o,token:r,cssVar:s}},useCSP:()=>{const{csp:e}=n.default();return(e==null?void 0:e.value)??{}},layer:{name:"antdx",dependencies:["antd"]}});exports.genComponentStyleHook=c;exports.genStyleHooks=a;exports.genSubStyleComponent=d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),l=require("../attachments/Attachments2.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),l=require("../attachments/Attachments2.js"),P=require("../_util/pick-attrs.js");require("../x-provider/index.js");const b=require("../_util/hooks/use-x-component-config.js"),q=require("./hooks/useCollapsible.js"),k=require("./style/index.js"),F=require("./context.js"),H=require("./item.js"),S=require("../x-provider/hooks/use-x-provider-context.js"),V=t.defineComponent({name:"AXThoughtChain",__name:"ThoughtChain",props:t.mergeDefaults({items:null,collapsible:{type:Boolean},size:null,styles:null,classNames:null,prefixCls:null,rootClassName:null},{styles:()=>({}),classNames:()=>({}),size:"middle"}),setup(e){const m=l.createPropsRestProxy(e,["prefixCls","rootClassName","class","items","collapsible","styles","style","classNames","size"]);t.toRef(e,"class"),t.toRef(e,"prefixCls");const d=t.computed(()=>P.default(m,{attr:!0,aria:!0,data:!0})),{getPrefixCls:u,direction:i}=S.default(),C=t.computed(()=>u()),a=t.computed(()=>u("thought-chain",e.prefixCls)),s=b.default("thoughtChain"),[h,v,y]=q.default(()=>e.collapsible,a.value,C.value),[f,N,g]=k.default(a),x=t.computed(()=>l.classnames(e.class,e.rootClassName,a.value,s.value.className,N.value,g,{[`${a.value}-rtl`]:i.value==="rtl"},`${a.value}-${e.size}`));return()=>f(t.createVNode("div",t.mergeProps(d.value,{class:x.value,style:{...typeof s.value.style=="object"?s.value.style:{},...typeof e.style=="object"?e.style:{}}}),[t.createVNode(F.ThoughtChainNodeContextProvider,{value:{prefixCls:a.value,enableCollapse:h.value,expandedKeys:v.value,direction:i.value,classNames:{itemHeader:l.classnames(s.value.classNames.itemHeader,e.classNames.itemHeader),itemContent:l.classnames(s.value.classNames.itemContent,e.classNames.itemContent),itemFooter:l.classnames(s.value.classNames.itemFooter,e.classNames.itemFooter)},styles:{itemHeader:{...s.value.styles.itemHeader,...e.styles.itemHeader},itemContent:{...s.value.styles.itemContent,...e.styles.itemContent},itemFooter:{...s.value.styles.itemFooter,...e.styles.itemFooter}}}},{default:()=>{var c;return[(c=e.items)==null?void 0:c.map((o,n)=>{var r;return t.createVNode(H.default,{key:o.key||`key_${n}`,class:l.classnames(s.value.classNames.item,e.classNames.item),style:{...s.value.styles.item,...e.styles.item},info:{...o,icon:o.icon||n+1},onClick:y,nextStatus:((r=e.items[n+1])==null?void 0:r.status)||o.status},null)})]}})]))}});exports.default=V;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./ThoughtChain.js");exports.ThoughtChain=e.default;exports.default=e.default;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./ThoughtChain.js");e.default.install=function(t){return t.component(e.default.name,e.default),t};exports.ThoughtChain=e.default;exports.default=e.default;
|
package/lib/welcome/Welcome.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),c=require("../attachments/Attachments2.js")
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),c=require("../attachments/Attachments2.js");require("../x-provider/index.js");const C=require("../_util/hooks/use-x-component-config.js"),g=require("./style/index.js"),i=require("ant-design-vue"),V=require("../x-provider/hooks/use-x-provider-context.js");function h(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const $=t.defineComponent({name:"AXWelcome",__name:"Welcome",props:t.mergeDefaults({prefixCls:null,rootClassName:null,className:null,style:null,variant:null,classNames:null,styles:null,icon:null,title:null,description:null,extra:null},{variant:"filled",classNames:()=>({}),styles:()=>({})}),setup(e){t.toRef(e,"prefixCls");const a=t.useSlots(),{direction:d,getPrefixCls:m}=V.default(),s=m("welcome",e.prefixCls),n=C.default("welcome"),[f,N,x]=g.default(s),v=t.computed(()=>{const l=a.icon?a.icon():e.icon;if(!l)return null;let u=l;return typeof l=="string"&&l.startsWith("http")&&(u=t.createVNode("img",{src:l,alt:"icon"},null)),t.createVNode("div",{class:c.classnames(`${s}-icon`,n.value.classNames.icon,e.classNames.icon),style:e.styles.icon},[u])}),r=t.computed(()=>{const l=a.title?a.title():e.title;return l?t.createVNode(i.Typography.Title,{level:4,class:c.classnames(`${s}-title`,n.value.classNames.title,e.classNames.title),style:e.styles.title},h(l)?l:{default:()=>[l]}):null}),o=t.computed(()=>a.description?a.description():e.description),y=t.computed(()=>{const l=a.extra?a.extra():e.extra;return l?t.createVNode("div",{class:c.classnames(`${s}-extra`,n.value.classNames.extra,e.classNames.extra),style:e.styles.extra},[l]):null});return()=>f(t.createVNode(i.Flex,{class:c.classnames(s,n.value.className,e.className,e.rootClassName,N.value,x,`${s}-${e.variant}`,{[`${s}-rtl`]:d.value==="rtl"}),style:e.style},{default:()=>[v.value,t.createVNode(i.Flex,{vertical:!0,class:`${s}-content-wrapper`},{default:()=>[a.extra||e.extra?t.createVNode(i.Flex,{align:"flex-start",class:`${s}-title-wrapper`},{default:()=>[r.value,y.value]}):r.value,o.value&&t.createVNode(i.Typography.Text,{class:c.classnames(`${s}-description`,n.value.classNames.description,e.classNames.description),style:e.styles.description},{default:()=>[o.value]})]})]}))}});exports.default=$;
|
package/lib/welcome/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Welcome.js");exports.Welcome=e.default;exports.default=e.default;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Welcome.js");e.default.install=function(t){return t.component(e.default.name,e.default),t};exports.Welcome=e.default;exports.default=e.default;
|
package/lib/x-provider/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("./hooks/use-x-provider-context.js"),e=require("./index2.js");e._sfc_main.install=function(r){return r.component(e._sfc_main.name,e._sfc_main),r.component("AXConfigProvider",e._sfc_main),r};exports.defaultPrefixCls=i.defaultPrefixCls;exports.useXProviderContext=i.default;exports.XProvider=e._sfc_main;exports.default=e._sfc_main;
|
package/lib/x-provider/index2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("vue"),u=require("../attachments/Attachments2.js"),d=require("./context.js"),l=require("./hooks/use-x-provider-context.js"),m=require("ant-design-vue"),h=t.defineComponent({name:"
|
|
1
|
+
"use strict";const t=require("vue"),u=require("../attachments/Attachments2.js"),d=require("./context.js"),l=require("./hooks/use-x-provider-context.js"),m=require("ant-design-vue"),h=t.defineComponent({name:"AXProvider",inheritAttrs:!1,__name:"index",props:{bubble:{},conversations:{},prompts:{},sender:{},suggestion:{},thoughtChain:{},attachments:{},welcome:{},iconPrefixCls:{},getTargetContainer:{},getPopupContainer:{},prefixCls:{},getPrefixCls:{},renderEmpty:{},transformCellText:{},csp:{},input:{},autoInsertSpaceInButton:{type:Boolean},locale:{},pageHeader:{},componentSize:{},componentDisabled:{type:Boolean},direction:{},space:{},virtual:{type:Boolean},dropdownMatchSelectWidth:{},form:{},pagination:{},theme:{},select:{},wave:{}},setup(e){const r=u.createPropsRestProxy(e,["attachments","bubble","conversations","prompts","sender","suggestion","thoughtChain","welcome"]),o=t.useSlots(),a=t.computed(()=>({attachments:e.attachments,bubble:e.bubble,conversations:e.conversations,prompts:e.prompts,sender:e.sender,suggestion:e.suggestion,thoughtChain:e.thoughtChain,welcome:e.welcome})),{theme:n}=l.default(),i=t.computed(()=>({...(n==null?void 0:n.value)||{},...r.theme})),c=t.computed(()=>{var s;return(s=o.default)==null?void 0:s.call(o)});return()=>t.createVNode(d.XProviderContextProvider,{value:a.value},{default:()=>[t.createVNode(m.ConfigProvider,t.mergeProps(r,{theme:i.value}),{default:()=>[c.value]})]})}});exports._sfc_main=h;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ant-design-x-vue",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.7",
|
|
4
4
|
"description": "Craft AI-driven interfaces effortlessly",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"AI",
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
"vue"
|
|
14
14
|
],
|
|
15
15
|
"scripts": {
|
|
16
|
-
"build": "run-p build:es build:
|
|
16
|
+
"build": "run-p build:es build:dist build:resolver",
|
|
17
17
|
"build:es": "vite build && vue-tsc --project ./tsconfig.build.json",
|
|
18
|
-
"build:
|
|
18
|
+
"build:dist": "vite build --config ./vite.config.dist.mts && vue-tsc --project ./tsconfig.build.json",
|
|
19
19
|
"build:resolver": "tsc resolver/index.ts --outDir resolver-dist --declaration",
|
|
20
20
|
"build:watch": "vite build --watch",
|
|
21
21
|
"docs:dev": "vitepress dev docs",
|
|
@@ -48,7 +48,8 @@
|
|
|
48
48
|
"./dist/style.css": "./dist/style.css",
|
|
49
49
|
"./resolver": {
|
|
50
50
|
"types": "./resolver-dist/index.d.ts",
|
|
51
|
-
"import": "./resolver-dist/index.js"
|
|
51
|
+
"import": "./resolver-dist/index.js",
|
|
52
|
+
"require": "./resolver-dist/index.js"
|
|
52
53
|
}
|
|
53
54
|
},
|
|
54
55
|
"main": "./lib/index.js",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type { Attachment, AttachmentsProps } from './interface';
|
|
1
2
|
declare const Attachments: {
|
|
2
3
|
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("./interface").AttachmentsProps> & Readonly<{}>, {
|
|
3
4
|
nativeElement: HTMLDivElement | null;
|
|
@@ -34,6 +35,5 @@ declare const Attachments: {
|
|
|
34
35
|
nativeElement: Readonly<import("vue").ShallowRef<HTMLDivElement>>;
|
|
35
36
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("./interface").FileListCardProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
36
37
|
};
|
|
37
|
-
export type { Attachment, AttachmentsProps } from './interface';
|
|
38
38
|
export default Attachments;
|
|
39
39
|
export { Attachments, };
|
|
@@ -8,26 +8,26 @@ declare const _default: <T extends BubbleContentType = string>(__VLS_props: NonN
|
|
|
8
8
|
attrs: any;
|
|
9
9
|
slots: Readonly<{
|
|
10
10
|
avatar?(): VNode;
|
|
11
|
-
header?(props
|
|
11
|
+
header?(props: {
|
|
12
12
|
content: BubbleContentType;
|
|
13
13
|
}): VNode | string;
|
|
14
|
-
footer?(props
|
|
14
|
+
footer?(props: {
|
|
15
15
|
content: BubbleContentType;
|
|
16
16
|
}): VNode | string;
|
|
17
17
|
loading?(): VNode;
|
|
18
|
-
message?(props
|
|
18
|
+
message?(props: {
|
|
19
19
|
content: BubbleContentType;
|
|
20
20
|
}): VNode | string;
|
|
21
21
|
}> & {
|
|
22
22
|
avatar?(): VNode;
|
|
23
|
-
header?(props
|
|
23
|
+
header?(props: {
|
|
24
24
|
content: BubbleContentType;
|
|
25
25
|
}): VNode | string;
|
|
26
|
-
footer?(props
|
|
26
|
+
footer?(props: {
|
|
27
27
|
content: BubbleContentType;
|
|
28
28
|
}): VNode | string;
|
|
29
29
|
loading?(): VNode;
|
|
30
|
-
message?(props
|
|
30
|
+
message?(props: {
|
|
31
31
|
content: BubbleContentType;
|
|
32
32
|
}): VNode | string;
|
|
33
33
|
};
|
|
@@ -3,26 +3,26 @@ export type { BubbleProps, BubbleListProps } from './interface';
|
|
|
3
3
|
declare const Bubble: (<T extends import("./interface").BubbleContentType = string>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: {
|
|
4
4
|
slots: Readonly<{
|
|
5
5
|
avatar?(): import("vue").VNode;
|
|
6
|
-
header?(props
|
|
6
|
+
header?(props: {
|
|
7
7
|
content: import("./interface").BubbleContentType;
|
|
8
8
|
}): import("vue").VNode | string;
|
|
9
|
-
footer?(props
|
|
9
|
+
footer?(props: {
|
|
10
10
|
content: import("./interface").BubbleContentType;
|
|
11
11
|
}): import("vue").VNode | string;
|
|
12
12
|
loading?(): import("vue").VNode;
|
|
13
|
-
message?(props
|
|
13
|
+
message?(props: {
|
|
14
14
|
content: import("./interface").BubbleContentType;
|
|
15
15
|
}): import("vue").VNode | string;
|
|
16
16
|
}> & {
|
|
17
17
|
avatar?(): import("vue").VNode;
|
|
18
|
-
header?(props
|
|
18
|
+
header?(props: {
|
|
19
19
|
content: import("./interface").BubbleContentType;
|
|
20
20
|
}): import("vue").VNode | string;
|
|
21
|
-
footer?(props
|
|
21
|
+
footer?(props: {
|
|
22
22
|
content: import("./interface").BubbleContentType;
|
|
23
23
|
}): import("vue").VNode | string;
|
|
24
24
|
loading?(): import("vue").VNode;
|
|
25
|
-
message?(props
|
|
25
|
+
message?(props: {
|
|
26
26
|
content: import("./interface").BubbleContentType;
|
|
27
27
|
}): import("vue").VNode | string;
|
|
28
28
|
};
|
|
@@ -225,26 +225,26 @@ declare const Bubble: (<T extends import("./interface").BubbleContentType = stri
|
|
|
225
225
|
attrs: any;
|
|
226
226
|
slots: Readonly<{
|
|
227
227
|
avatar?(): import("vue").VNode;
|
|
228
|
-
header?(props
|
|
228
|
+
header?(props: {
|
|
229
229
|
content: import("./interface").BubbleContentType;
|
|
230
230
|
}): import("vue").VNode | string;
|
|
231
|
-
footer?(props
|
|
231
|
+
footer?(props: {
|
|
232
232
|
content: import("./interface").BubbleContentType;
|
|
233
233
|
}): import("vue").VNode | string;
|
|
234
234
|
loading?(): import("vue").VNode;
|
|
235
|
-
message?(props
|
|
235
|
+
message?(props: {
|
|
236
236
|
content: import("./interface").BubbleContentType;
|
|
237
237
|
}): import("vue").VNode | string;
|
|
238
238
|
}> & {
|
|
239
239
|
avatar?(): import("vue").VNode;
|
|
240
|
-
header?(props
|
|
240
|
+
header?(props: {
|
|
241
241
|
content: import("./interface").BubbleContentType;
|
|
242
242
|
}): import("vue").VNode | string;
|
|
243
|
-
footer?(props
|
|
243
|
+
footer?(props: {
|
|
244
244
|
content: import("./interface").BubbleContentType;
|
|
245
245
|
}): import("vue").VNode | string;
|
|
246
246
|
loading?(): import("vue").VNode;
|
|
247
|
-
message?(props
|
|
247
|
+
message?(props: {
|
|
248
248
|
content: import("./interface").BubbleContentType;
|
|
249
249
|
}): import("vue").VNode | string;
|
|
250
250
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './x-provider';
|
|
2
|
+
export * from './bubble';
|
|
3
|
+
export * from './conversations';
|
|
4
|
+
export * from './welcome';
|
|
5
|
+
export * from './prompts';
|
|
6
|
+
export * from './suggestion';
|
|
7
|
+
export * from './sender';
|
|
8
|
+
export * from './attachments';
|
|
9
|
+
export * from './thought-chain';
|
package/typings/index.d.ts
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './welcome';
|
|
5
|
-
export * from './prompts';
|
|
6
|
-
export * from './suggestion';
|
|
7
|
-
export * from './sender';
|
|
8
|
-
export * from './attachments';
|
|
9
|
-
export * from './thought-chain';
|
|
10
|
-
export * from './x-stream';
|
|
11
|
-
export * from './x-request';
|
|
12
|
-
export * from './use-x-agent';
|
|
13
|
-
export * from './use-x-chat';
|
|
1
|
+
import type { App } from 'vue';
|
|
2
|
+
export * from './components';
|
|
3
|
+
export * from './hooks';
|
|
14
4
|
export * from './theme';
|
|
5
|
+
export declare const install: (app: App) => App<any>;
|
|
6
|
+
declare const _default: {
|
|
7
|
+
install: (app: App) => App<any>;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -40,7 +40,7 @@ export interface PromptsProps extends Omit<HTMLAttributes, 'onClick' | 'title'>
|
|
|
40
40
|
* @desc 显示在提示列表顶部的标题。
|
|
41
41
|
* @descEN Title displayed at the top of the prompt list.
|
|
42
42
|
*/
|
|
43
|
-
title?: VNode | string;
|
|
43
|
+
title?: VNode | string | (() => VNode | string);
|
|
44
44
|
/**
|
|
45
45
|
* @desc Item 提示项被点击时的回调函数。
|
|
46
46
|
* @descEN Callback function when a prompt item is clicked.
|
|
@@ -9,7 +9,7 @@ declare function __VLS_template(): {
|
|
|
9
9
|
slots: Readonly<{
|
|
10
10
|
header?(): VNode;
|
|
11
11
|
prefix?(): VNode;
|
|
12
|
-
actions?(props
|
|
12
|
+
actions?(props: {
|
|
13
13
|
ori: VNode;
|
|
14
14
|
info: {
|
|
15
15
|
components: {
|
|
@@ -20,7 +20,7 @@ declare function __VLS_template(): {
|
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
}): VNode;
|
|
23
|
-
footer?(props
|
|
23
|
+
footer?(props: {
|
|
24
24
|
info: {
|
|
25
25
|
components: {
|
|
26
26
|
SendButton: typeof SendButton;
|
|
@@ -33,7 +33,7 @@ declare function __VLS_template(): {
|
|
|
33
33
|
}> & {
|
|
34
34
|
header?(): VNode;
|
|
35
35
|
prefix?(): VNode;
|
|
36
|
-
actions?(props
|
|
36
|
+
actions?(props: {
|
|
37
37
|
ori: VNode;
|
|
38
38
|
info: {
|
|
39
39
|
components: {
|
|
@@ -44,7 +44,7 @@ declare function __VLS_template(): {
|
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
46
|
}): VNode;
|
|
47
|
-
footer?(props
|
|
47
|
+
footer?(props: {
|
|
48
48
|
info: {
|
|
49
49
|
components: {
|
|
50
50
|
SendButton: typeof SendButton;
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import type { SenderHeaderProps } from './interface';
|
|
2
|
-
declare
|
|
3
|
-
|
|
4
|
-
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
5
|
-
attrs: any;
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
6
4
|
slots: Readonly<{
|
|
7
5
|
default(props?: any): any;
|
|
8
6
|
}> & {
|
|
9
7
|
default(props?: any): any;
|
|
10
8
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
__ctx?: Awaited<typeof __VLS_setup>;
|
|
9
|
+
refs: {};
|
|
10
|
+
rootEl: any;
|
|
14
11
|
};
|
|
12
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
13
|
+
declare const __VLS_component: import("vue").DefineComponent<SenderHeaderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SenderHeaderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
14
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
15
15
|
export default _default;
|
|
16
|
-
type
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -37,7 +37,7 @@ declare const Sender: {
|
|
|
37
37
|
$slots: Readonly<{
|
|
38
38
|
header?(): import("vue").VNode;
|
|
39
39
|
prefix?(): import("vue").VNode;
|
|
40
|
-
actions?(props
|
|
40
|
+
actions?(props: {
|
|
41
41
|
ori: import("vue").VNode;
|
|
42
42
|
info: {
|
|
43
43
|
components: {
|
|
@@ -48,7 +48,7 @@ declare const Sender: {
|
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
50
|
}): import("vue").VNode;
|
|
51
|
-
footer?(props
|
|
51
|
+
footer?(props: {
|
|
52
52
|
info: {
|
|
53
53
|
components: {
|
|
54
54
|
SendButton: typeof import("./components/SendButton.vue").default;
|
|
@@ -61,7 +61,7 @@ declare const Sender: {
|
|
|
61
61
|
}> & {
|
|
62
62
|
header?(): import("vue").VNode;
|
|
63
63
|
prefix?(): import("vue").VNode;
|
|
64
|
-
actions?(props
|
|
64
|
+
actions?(props: {
|
|
65
65
|
ori: import("vue").VNode;
|
|
66
66
|
info: {
|
|
67
67
|
components: {
|
|
@@ -72,7 +72,7 @@ declare const Sender: {
|
|
|
72
72
|
};
|
|
73
73
|
};
|
|
74
74
|
}): import("vue").VNode;
|
|
75
|
-
footer?(props
|
|
75
|
+
footer?(props: {
|
|
76
76
|
info: {
|
|
77
77
|
components: {
|
|
78
78
|
SendButton: typeof import("./components/SendButton.vue").default;
|
|
@@ -84,38 +84,25 @@ declare const Sender: {
|
|
|
84
84
|
}): import("vue").VNode;
|
|
85
85
|
};
|
|
86
86
|
}) & {
|
|
87
|
-
Header:
|
|
88
|
-
|
|
87
|
+
Header: {
|
|
88
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("./interface").SenderHeaderProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
89
|
+
P: {};
|
|
90
|
+
B: {};
|
|
91
|
+
D: {};
|
|
92
|
+
C: {};
|
|
93
|
+
M: {};
|
|
94
|
+
Defaults: {};
|
|
95
|
+
}, Readonly<import("./interface").SenderHeaderProps> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
96
|
+
__isFragment?: never;
|
|
97
|
+
__isTeleport?: never;
|
|
98
|
+
__isSuspense?: never;
|
|
99
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("./interface").SenderHeaderProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
100
|
+
$slots: Readonly<{
|
|
89
101
|
default(props?: any): any;
|
|
90
102
|
}> & {
|
|
91
103
|
default(props?: any): any;
|
|
92
104
|
};
|
|
93
|
-
|
|
94
|
-
emit: {};
|
|
95
|
-
}, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
96
|
-
props: {
|
|
97
|
-
forceRender?: boolean;
|
|
98
|
-
open?: boolean;
|
|
99
|
-
onOpenChange?: (open: boolean) => void;
|
|
100
|
-
title?: import("vue").VNode | string;
|
|
101
|
-
children?: import("vue").VNode;
|
|
102
|
-
className?: string;
|
|
103
|
-
style?: import("vue").CSSProperties;
|
|
104
|
-
classNames?: Partial<Record<import("./interface").SemanticType, string>>;
|
|
105
|
-
styles?: Partial<Record<import("./interface").SemanticType, import("vue").CSSProperties>>;
|
|
106
|
-
closable?: boolean;
|
|
107
|
-
} & import("vue").PublicProps;
|
|
108
|
-
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
109
|
-
attrs: any;
|
|
110
|
-
slots: Readonly<{
|
|
111
|
-
default(props?: any): any;
|
|
112
|
-
}> & {
|
|
113
|
-
default(props?: any): any;
|
|
114
|
-
};
|
|
115
|
-
emit: {};
|
|
116
|
-
}>) => import("vue").VNode & {
|
|
117
|
-
__ctx?: Awaited<typeof __VLS_setup>;
|
|
118
|
-
};
|
|
105
|
+
});
|
|
119
106
|
};
|
|
120
107
|
export default Sender;
|
|
121
108
|
export { Sender, };
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import type { ButtonProps, TextAreaProps } from "ant-design-vue";
|
|
2
2
|
import { Input } from "ant-design-vue";
|
|
3
|
-
import type { ChangeEvent, ClipboardEventHandler, KeyboardEventHandler } from "ant-design-vue/es/_util/EventInterface";
|
|
4
3
|
import type { ConfigProviderProps } from "ant-design-vue";
|
|
5
4
|
import type { CSSProperties, VNode } from "vue";
|
|
6
5
|
import type { AllowSpeech } from "./useSpeech";
|
|
7
|
-
import type { InputRef } from "ant-design-vue/es/vc-input/inputProps";
|
|
8
6
|
import type { AvoidValidation } from '../type-utility';
|
|
9
7
|
import SendButton from "./components/SendButton.vue";
|
|
10
8
|
import ClearButton from "./components/ClearButton.vue";
|
|
11
9
|
import LoadingButton from "./components/LoadingButton.vue";
|
|
12
10
|
import SpeechButton from "./components/SpeechButton/index.vue";
|
|
13
11
|
export type SubmitType = 'enter' | 'shiftEnter' | false;
|
|
12
|
+
export type KeyboardEventHandler = (e: KeyboardEvent) => void;
|
|
13
|
+
export type ClipboardEventHandler = (e: ClipboardEvent) => void;
|
|
14
|
+
export type ChangeEvent = Event & {
|
|
15
|
+
target: {
|
|
16
|
+
value?: string | undefined;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
14
19
|
export interface SenderComponents {
|
|
15
20
|
input?: typeof Input.TextArea;
|
|
16
21
|
}
|
|
@@ -70,9 +75,14 @@ export interface SenderProps {
|
|
|
70
75
|
maxRows?: number;
|
|
71
76
|
}>;
|
|
72
77
|
}
|
|
78
|
+
export interface InputFocusOptions extends FocusOptions {
|
|
79
|
+
cursor?: 'start' | 'end' | 'all';
|
|
80
|
+
}
|
|
73
81
|
export type SenderRef = {
|
|
74
82
|
nativeElement: HTMLDivElement;
|
|
75
|
-
|
|
83
|
+
focus: (options?: InputFocusOptions) => void;
|
|
84
|
+
blur: () => void;
|
|
85
|
+
};
|
|
76
86
|
export interface SenderHeaderContextProps {
|
|
77
87
|
prefixCls?: ConfigProviderProps['prefixCls'];
|
|
78
88
|
}
|