@matechat/core 1.11.0 → 1.12.0-alpha
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/Attachment/Attachment.vue.d.ts +8 -8
- package/Attachment/attachment-types.d.ts +3 -35
- package/Attachment/index.css +1 -1
- package/Attachment/index.js +43 -45
- package/Bubble/index.css +1 -1
- package/Bubble/index.js +322 -186
- package/Bubble/useBubbleFoundation.d.ts +9 -0
- package/FileList/index.js +1 -1
- package/Header/index.css +1 -1
- package/Header/index.js +12 -11
- package/Input/components/EditableBlock.vue.d.ts +2 -2
- package/Input/index.css +1 -1
- package/Input/index.js +699 -108
- package/Introduction/index.css +1 -1
- package/Introduction/index.js +138 -38
- package/Layout/index.js +7 -6
- package/List/index.css +1 -1
- package/List/index.js +54 -51
- package/Locale/index.js +85 -35
- package/MarkdownCard/MDCardParser.d.ts +0 -10
- package/MarkdownCard/MermaidService-yeLQUW_e.js +142 -0
- package/MarkdownCard/index.css +1 -1
- package/MarkdownCard/index.js +735 -200
- package/MarkdownCard/mdCard.types.d.ts +2 -29
- package/MarkdownCard/mdCard.vue.d.ts +2 -2
- package/MarkdownCard/useMarkdownCardFoundation.d.ts +8 -0
- package/Mention/Mention.vue.d.ts +12 -3
- package/Mention/index.css +1 -1
- package/Mention/index.js +365 -110
- package/Mention/mention-types.d.ts +6 -4
- package/Mention/use-mention.d.ts +7 -0
- package/Prompt/index.js +1 -1
- package/README.md +8 -12
- package/Toolbar/index.css +1 -1
- package/Toolbar/index.d.ts +2 -1
- package/Toolbar/index.js +189 -198
- package/Toolbar/toolbar.types.d.ts +2 -26
- package/index.d.ts +18 -6
- package/mate-chat.js +17 -2
- package/package.json +1 -4
- package/Attachment/uploader.d.ts +0 -11
- package/MarkdownCard/MDCardService.d.ts +0 -14
- package/MarkdownCard/MermaidService-B6BcjbW_.js +0 -127
- package/MarkdownCard/MermaidService.d.ts +0 -22
- package/Mention/const.d.ts +0 -4
package/Mention/use-mention.d.ts
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
|
+
import { MentionFoundation } from '@matechat/common/Mention/foundation';
|
|
1
2
|
import type { MentionProps } from './mention-types';
|
|
2
3
|
export declare function useMention(props: MentionProps, emits: (event: string, ...args: any[]) => void): {
|
|
3
4
|
popperTriggerEl: import("vue").Ref<any, any>;
|
|
5
|
+
originEl: import("vue").Ref<any, any>;
|
|
4
6
|
overlayEl: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
5
7
|
overlayStyle: {
|
|
6
8
|
top: string;
|
|
7
9
|
left: string;
|
|
8
10
|
width: string;
|
|
9
11
|
};
|
|
12
|
+
initEvent: () => void;
|
|
13
|
+
mentionFoundation: MentionFoundation;
|
|
14
|
+
resetMention: () => void;
|
|
15
|
+
updateOptions: (options: Partial<MentionProps>) => void;
|
|
16
|
+
updatePosition: () => void;
|
|
10
17
|
};
|
package/Prompt/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./index.css";
|
|
2
|
-
import { defineComponent as a, computed as v, resolveDynamicComponent as b,
|
|
2
|
+
import { defineComponent as a, computed as v, resolveDynamicComponent as b, openBlock as n, createElementBlock as s, createBlock as C, unref as z, normalizeStyle as y, normalizeClass as P, createElementVNode as S, normalizeProps as I, mergeProps as $, createCommentVNode as l, toDisplayString as h, createVNode as k, withCtx as V } from "vue";
|
|
3
3
|
import { ListVariant as N, ListDirection as B, McList as D } from "@matechat/core/List";
|
|
4
4
|
const L = {
|
|
5
5
|
name: {
|
package/README.md
CHANGED
|
@@ -95,7 +95,7 @@ createApp(App).use(MateChat).mount('#app');
|
|
|
95
95
|
:avatarConfig="{ imgSrc: 'https://matechat.gitcode.com/png/demo/userAvatar.svg' }"
|
|
96
96
|
>
|
|
97
97
|
</McBubble>
|
|
98
|
-
<McBubble v-else :content="msg.content" :avatarConfig="{ imgSrc: 'https://matechat.gitcode.com/logo.svg' }"> </McBubble>
|
|
98
|
+
<McBubble v-else :content="msg.content" :avatarConfig="{ imgSrc: 'https://matechat.gitcode.com/logo.svg' }" :loading="msg.loading"> </McBubble>
|
|
99
99
|
</template>
|
|
100
100
|
</McLayoutContent>
|
|
101
101
|
<div class="shortcut" style="display: flex; align-items: center; gap: 8px">
|
|
@@ -302,16 +302,14 @@ $ npm install openai
|
|
|
302
302
|
```js
|
|
303
303
|
import OpenAI from 'openai';
|
|
304
304
|
|
|
305
|
-
const client =
|
|
306
|
-
|
|
307
|
-
client.value = new OpenAI({
|
|
305
|
+
const client = new OpenAI({
|
|
308
306
|
apiKey: '', // 模型APIKey
|
|
309
307
|
baseURL: '', // 模型API地址
|
|
310
308
|
dangerouslyAllowBrowser: true,
|
|
311
309
|
});
|
|
312
310
|
|
|
313
311
|
const fetchData = (ques) => {
|
|
314
|
-
const completion = await client.
|
|
312
|
+
const completion = await client.chat.completions.create({
|
|
315
313
|
model: 'my-model', // 替换为自己的model名称
|
|
316
314
|
messages: [
|
|
317
315
|
{ role: 'user', content: ques },
|
|
@@ -354,9 +352,7 @@ const onSubmit = (evt) => {
|
|
|
354
352
|
```ts
|
|
355
353
|
import OpenAI from 'openai';
|
|
356
354
|
|
|
357
|
-
const client =
|
|
358
|
-
|
|
359
|
-
client.value = new OpenAI({
|
|
355
|
+
const client = new OpenAI({
|
|
360
356
|
apiKey: '', // 模型APIKey
|
|
361
357
|
baseURL: '', // 模型API地址
|
|
362
358
|
dangerouslyAllowBrowser: true,
|
|
@@ -383,7 +379,7 @@ const fetchData = async (ques) => {
|
|
|
383
379
|
id: '',
|
|
384
380
|
loading: true,
|
|
385
381
|
});
|
|
386
|
-
const completion = await client.
|
|
382
|
+
const completion = await client.chat.completions.create({
|
|
387
383
|
model: 'my-model', // 替换为自己的model名称
|
|
388
384
|
messages: [{ role: 'user', content: ques }],
|
|
389
385
|
stream: true, // 为 true 则开启接口的流式返回
|
|
@@ -409,8 +405,8 @@ const fetchData = async (ques) => {
|
|
|
409
405
|
```bash
|
|
410
406
|
git clone git@gitcode.com:DevCloudFE/MateChat.git
|
|
411
407
|
cd matechat
|
|
412
|
-
|
|
413
|
-
|
|
408
|
+
pnpm i
|
|
409
|
+
pnpm run docs:dev
|
|
414
410
|
```
|
|
415
411
|
|
|
416
412
|
## 📅 特性规划
|
|
@@ -423,7 +419,7 @@ MateChat 在不断的演进中,你可在这里了解我们的计划:[MateCha
|
|
|
423
419
|
|
|
424
420
|
## 谁在使用
|
|
425
421
|
|
|
426
|
-
[CodeArts
|
|
422
|
+
[华为云CodeArts智能助手](https://www.huaweicloud.com/product/codeartside/snap.html)
|
|
427
423
|
|
|
428
424
|
[InsCode AI IDE](https://inscode.csdn.net/)
|
|
429
425
|
|
package/Toolbar/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.mc-actions[data-v-
|
|
1
|
+
.mc-actions[data-v-de82714b]{display:inline-flex;align-items:center}.mc-action-item[data-v-de82714b]{cursor:pointer;padding:4px;border-radius:4px;display:inline-flex;color:var(--devui-text, #252b3a)}.mc-action-item[data-v-de82714b]:hover{background-color:var(--devui-list-item-hover-bg, #f2f2f3)}.mc-actions[data-v-85a0d662]{display:inline-flex;align-items:center}.mc-action-item[data-v-85a0d662]{cursor:pointer;padding:4px;border-radius:4px;display:inline-flex;color:var(--devui-text, #252b3a)}.mc-action-item[data-v-85a0d662]:hover{background-color:var(--devui-list-item-hover-bg, #f2f2f3)}.mc-actions[data-v-d4542e71]{display:inline-flex;align-items:center}.mc-action-item[data-v-d4542e71]{cursor:pointer;padding:4px;border-radius:4px;display:inline-flex;color:var(--devui-text, #252b3a)}.mc-action-item[data-v-d4542e71]:hover{background-color:var(--devui-list-item-hover-bg, #f2f2f3)}.mc-actions[data-v-804650d8]{display:inline-flex;align-items:center}.mc-action-item[data-v-804650d8]{cursor:pointer;padding:4px;border-radius:4px;display:inline-flex;color:var(--devui-text, #252b3a)}.mc-action-item[data-v-804650d8]:hover{background-color:var(--devui-list-item-hover-bg, #f2f2f3)}.mc-actions[data-v-4a2ea0ec]{display:inline-flex;align-items:center}.mc-action-item[data-v-4a2ea0ec]{cursor:pointer;padding:4px;border-radius:4px;display:inline-flex;color:var(--devui-text, #252b3a)}.mc-action-item[data-v-4a2ea0ec]:hover{background-color:var(--devui-list-item-hover-bg, #f2f2f3)}.mc-actions[data-v-558a7278]{display:inline-flex;align-items:center}.mc-action-item[data-v-558a7278]{cursor:pointer;padding:4px;border-radius:4px;display:inline-flex;color:var(--devui-text, #252b3a)}.mc-action-item[data-v-558a7278]:hover{background-color:var(--devui-list-item-hover-bg, #f2f2f3)}.mc-actions[data-v-ad8c9e9b]{display:inline-flex;align-items:center}.mc-action-item[data-v-ad8c9e9b]{cursor:pointer;padding:4px;border-radius:4px;display:inline-flex;color:var(--devui-text, #252b3a)}.mc-action-item[data-v-ad8c9e9b]:hover{background-color:var(--devui-list-item-hover-bg, #f2f2f3)}
|
package/Toolbar/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import McToolbar from './Toolbar.vue.ts';
|
|
2
2
|
import McCopyIcon from './icon/CopyIcon.vue.ts';
|
|
3
3
|
import McDeleteIcon from './icon/DeleteIcon.vue.ts';
|
|
4
|
+
import McDislikeIcon from './icon/DislikeIcon.vue.ts';
|
|
4
5
|
import McLikeIcon from './icon/LikeIcon.vue.ts';
|
|
5
6
|
import McRefreshIcon from './icon/RefreshIcon.vue.ts';
|
|
6
7
|
import McShareIcon from './icon/ShareIcon.vue.ts';
|
|
7
8
|
export * from './toolbar.types';
|
|
8
|
-
export { McToolbar, McCopyIcon, McDeleteIcon, McLikeIcon, McRefreshIcon, McShareIcon, };
|
|
9
|
+
export { McToolbar, McCopyIcon, McDeleteIcon, McLikeIcon, McDislikeIcon, McRefreshIcon, McShareIcon, };
|