@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.
Files changed (45) hide show
  1. package/Attachment/Attachment.vue.d.ts +8 -8
  2. package/Attachment/attachment-types.d.ts +3 -35
  3. package/Attachment/index.css +1 -1
  4. package/Attachment/index.js +43 -45
  5. package/Bubble/index.css +1 -1
  6. package/Bubble/index.js +322 -186
  7. package/Bubble/useBubbleFoundation.d.ts +9 -0
  8. package/FileList/index.js +1 -1
  9. package/Header/index.css +1 -1
  10. package/Header/index.js +12 -11
  11. package/Input/components/EditableBlock.vue.d.ts +2 -2
  12. package/Input/index.css +1 -1
  13. package/Input/index.js +699 -108
  14. package/Introduction/index.css +1 -1
  15. package/Introduction/index.js +138 -38
  16. package/Layout/index.js +7 -6
  17. package/List/index.css +1 -1
  18. package/List/index.js +54 -51
  19. package/Locale/index.js +85 -35
  20. package/MarkdownCard/MDCardParser.d.ts +0 -10
  21. package/MarkdownCard/MermaidService-yeLQUW_e.js +142 -0
  22. package/MarkdownCard/index.css +1 -1
  23. package/MarkdownCard/index.js +735 -200
  24. package/MarkdownCard/mdCard.types.d.ts +2 -29
  25. package/MarkdownCard/mdCard.vue.d.ts +2 -2
  26. package/MarkdownCard/useMarkdownCardFoundation.d.ts +8 -0
  27. package/Mention/Mention.vue.d.ts +12 -3
  28. package/Mention/index.css +1 -1
  29. package/Mention/index.js +365 -110
  30. package/Mention/mention-types.d.ts +6 -4
  31. package/Mention/use-mention.d.ts +7 -0
  32. package/Prompt/index.js +1 -1
  33. package/README.md +8 -12
  34. package/Toolbar/index.css +1 -1
  35. package/Toolbar/index.d.ts +2 -1
  36. package/Toolbar/index.js +189 -198
  37. package/Toolbar/toolbar.types.d.ts +2 -26
  38. package/index.d.ts +18 -6
  39. package/mate-chat.js +17 -2
  40. package/package.json +1 -4
  41. package/Attachment/uploader.d.ts +0 -11
  42. package/MarkdownCard/MDCardService.d.ts +0 -14
  43. package/MarkdownCard/MermaidService-B6BcjbW_.js +0 -127
  44. package/MarkdownCard/MermaidService.d.ts +0 -22
  45. package/Mention/const.d.ts +0 -4
@@ -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, createElementBlock as s, openBlock as n, createBlock as C, unref as z, normalizeStyle as y, normalizeClass as P, createElementVNode as S, createCommentVNode as l, normalizeProps as I, mergeProps as $, toDisplayString as h, createVNode as k, withCtx as V } from "vue";
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 = ref<OpenAI>();
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.value!.chat.completions.create({
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 = ref<OpenAI>();
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.value!.chat.completions.create({
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
- npm i
413
- npm run docs:dev
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盘古助手](https://www.huaweicloud.com/product/codeartside/snap.html)
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-ba532642]{display:inline-flex;align-items:center}.mc-action-item[data-v-ba532642]{cursor:pointer;padding:4px;border-radius:4px;display:inline-flex;color:var(--devui-text, #252b3a)}.mc-action-item[data-v-ba532642]:hover{background-color:var(--devui-list-item-hover-bg, #f2f2f3)}.mc-actions[data-v-bbbbce5a]{display:inline-flex;align-items:center}.mc-action-item[data-v-bbbbce5a]{cursor:pointer;padding:4px;border-radius:4px;display:inline-flex;color:var(--devui-text, #252b3a)}.mc-action-item[data-v-bbbbce5a]:hover{background-color:var(--devui-list-item-hover-bg, #f2f2f3)}.mc-actions[data-v-08c9b641]{display:inline-flex;align-items:center}.mc-action-item[data-v-08c9b641]{cursor:pointer;padding:4px;border-radius:4px;display:inline-flex;color:var(--devui-text, #252b3a)}.mc-action-item[data-v-08c9b641]:hover{background-color:var(--devui-list-item-hover-bg, #f2f2f3)}.mc-actions[data-v-5bfb7d70]{display:inline-flex;align-items:center}.mc-action-item[data-v-5bfb7d70]{cursor:pointer;padding:4px;border-radius:4px;display:inline-flex;color:var(--devui-text, #252b3a)}.mc-action-item[data-v-5bfb7d70]:hover{background-color:var(--devui-list-item-hover-bg, #f2f2f3)}.mc-actions[data-v-9870e7a6]{display:inline-flex;align-items:center}.mc-action-item[data-v-9870e7a6]{cursor:pointer;padding:4px;border-radius:4px;display:inline-flex;color:var(--devui-text, #252b3a)}.mc-action-item[data-v-9870e7a6]:hover{background-color:var(--devui-list-item-hover-bg, #f2f2f3)}.mc-actions[data-v-2a9dee06]{display:inline-flex;align-items:center}.mc-action-item[data-v-2a9dee06]{cursor:pointer;padding:4px;border-radius:4px;display:inline-flex;color:var(--devui-text, #252b3a)}.mc-action-item[data-v-2a9dee06]:hover{background-color:var(--devui-list-item-hover-bg, #f2f2f3)}.mc-actions[data-v-b407530e]{display:inline-flex;align-items:center}.mc-action-item[data-v-b407530e]{cursor:pointer;padding:4px;border-radius:4px;display:inline-flex;color:var(--devui-text, #252b3a)}.mc-action-item[data-v-b407530e]:hover{background-color:var(--devui-list-item-hover-bg, #f2f2f3)}
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)}
@@ -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, };