@myun/gimi-chat 0.9.22 → 0.9.24

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 (41) hide show
  1. package/dist/apis/useApi.js +1 -1
  2. package/dist/components/ai-chat-dialogue/index copy.d.ts +16 -0
  3. package/dist/components/ai-chat-dialogue/index copy.js +1062 -0
  4. package/dist/components/ai-chat-dialogue/index.js +54 -49
  5. package/dist/components/ai-chat-dialogue/index.module copy.css +230 -0
  6. package/dist/components/ai-chat-dialogue/index.module.css +78 -136
  7. package/dist/components/chat-input/index.d.ts +5 -0
  8. package/dist/components/chat-input/index.js +181 -68
  9. package/dist/components/chat-input/index.module.css +70 -2
  10. package/dist/components/file-upload/index.js +120 -34
  11. package/dist/components/iconfont-com/index.js +1 -1
  12. package/dist/components/message-list/index.js +3 -2
  13. package/dist/components/templates/CommonChat.js +27 -5
  14. package/dist/components/templates/GimiChatComponent.js +4 -0
  15. package/dist/components/upload-list/CustomFile.d.ts +15 -0
  16. package/dist/components/upload-list/CustomFile.js +105 -0
  17. package/dist/components/upload-list/ImageFile.d.ts +18 -0
  18. package/dist/components/upload-list/ImageFile.js +68 -0
  19. package/dist/components/upload-list/customFile.module.css +122 -0
  20. package/dist/components/upload-list/imageFile.module.css +95 -0
  21. package/dist/components/upload-list/index.d.ts +4 -3
  22. package/dist/components/upload-list/index.js +101 -84
  23. package/dist/components/upload-list/index.module.css +68 -99
  24. package/dist/components/voice-bars/index.js +10 -9
  25. package/dist/components/voice-check-dialog/index.js +2 -1
  26. package/dist/components/voice-recording/index.d.ts +1 -1
  27. package/dist/components/voice-recording/index.js +2 -28
  28. package/dist/hooks/useChatMessage.d.ts +1 -1
  29. package/dist/hooks/useChatMessage.js +1 -1
  30. package/dist/hooks/useCommonChatAPI.js +13 -9
  31. package/dist/hooks/useFile.js +99 -7
  32. package/dist/i18n/locales/en-US.d.ts +9 -0
  33. package/dist/i18n/locales/en-US.js +11 -2
  34. package/dist/i18n/locales/zh-CN.d.ts +9 -0
  35. package/dist/i18n/locales/zh-CN.js +11 -2
  36. package/dist/types/chat.d.ts +3 -0
  37. package/dist/types/file.d.ts +9 -0
  38. package/dist/umd/index.min.js +1 -1
  39. package/dist/utils/tools.d.ts +1 -0
  40. package/dist/utils/tools.js +25 -1
  41. package/package.json +1 -1
@@ -49,3 +49,4 @@ export declare function getSelectValue(content: string, moduleInfo: any, isLastI
49
49
  export declare function getDisableUploadFile(content: string, moduleInfo: any, isLastItem: boolean): boolean;
50
50
  export declare function formatFields(dataList: IChatMessageItem[], chatList: IChatMessageItem[]): IChatMessageItem[];
51
51
  export declare const getTimeZone: () => string;
52
+ export declare function handleFileList(fileList: any[]): FileItem[];
@@ -485,4 +485,28 @@ export var getTimeZone = function getTimeZone() {
485
485
  } catch (error) {
486
486
  return 'Asia/Shanghai';
487
487
  }
488
- };
488
+ };
489
+ var IMAGE_EXTS = new Set(['png', 'jpg', 'jpeg', 'gif', 'webp', 'bmp', 'svg']);
490
+
491
+ // 处理消息中文件列表
492
+ export function handleFileList(fileList) {
493
+ return fileList.map(function (f) {
494
+ var _split$0$split$pop;
495
+ if ('uid' in f) return f;
496
+ var hist = f;
497
+ var ext = ((_split$0$split$pop = (hist.fileAddr || '').split('?')[0].split('.').pop()) === null || _split$0$split$pop === void 0 ? void 0 : _split$0$split$pop.toLowerCase()) || '';
498
+ return {
499
+ uid: String(Math.random()),
500
+ name: hist.fileName || '',
501
+ size: hist.fileSizeStr || '',
502
+ status: FileStatus.ANALYSE_SUCCESS,
503
+ fileUrl: hist.fileAddr,
504
+ fileName: hist.fileName,
505
+ fileSize: hist.fileSize,
506
+ fileType: ext,
507
+ fileToken: '',
508
+ content: '',
509
+ isImage: IMAGE_EXTS.has(ext)
510
+ };
511
+ });
512
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myun/gimi-chat",
3
- "version": "0.9.22",
3
+ "version": "0.9.24",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "",
6
6
  "license": "ISC",