@droppii-org/chat-sdk 0.1.88 → 0.1.89

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.
@@ -1 +1 @@
1
- {"version":3,"file":"FileResourceList.d.ts","sourceRoot":"","sources":["../../../src/components/media-resources/FileResourceList.tsx"],"names":[],"mappings":"AAUA,QAAA,MAAM,gBAAgB,+CAsCrB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"FileResourceList.d.ts","sourceRoot":"","sources":["../../../src/components/media-resources/FileResourceList.tsx"],"names":[],"mappings":"AAcA,QAAA,MAAM,gBAAgB,+CAsCrB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { documentIcon } from "../../assets/svg";
4
- import { parseMessageContent, renderFileSize } from "../../utils/common";
4
+ import { parseMessageContent, renderFileSize, shortenFileName, } from "../../utils/common";
5
5
  import { downloadFileFromUrl } from "../../utils/download";
6
6
  import { MediaResourceTabKey } from "./constants";
7
7
  import ResourceScrollContainer from "./ResourceScrollContainer";
@@ -11,7 +11,7 @@ const FileResourceList = () => {
11
11
  return (_jsx(ResourceScrollContainer, Object.assign({}, containerProps, { itemCount: items.length, children: _jsx("div", { className: "flex flex-col gap-2 p-3", children: items.map((item) => {
12
12
  var _a, _b;
13
13
  const fileContent = parseMessageContent((_a = item === null || item === void 0 ? void 0 : item.chatLog) === null || _a === void 0 ? void 0 : _a.content);
14
- return (_jsxs("div", { className: "flex w-full cursor-pointer items-center gap-2 rounded-[12px] bg-gray-50/20 p-3", onClick: () => downloadFileFromUrl((fileContent === null || fileContent === void 0 ? void 0 : fileContent.sourceUrl) || "", (fileContent === null || fileContent === void 0 ? void 0 : fileContent.fileName) || ""), children: [_jsx("div", { className: "flex h-10 w-10 shrink-0 items-center justify-center [&>svg]:h-full [&>svg]:w-auto", children: documentIcon }), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [_jsx("span", { className: "truncate text-[16px] font-medium leading-[1.6] text-gray-900", children: (fileContent === null || fileContent === void 0 ? void 0 : fileContent.fileName) || "" }), _jsx("span", { className: "text-[13px] font-normal leading-[1.6] text-gray-400", children: renderFileSize((fileContent === null || fileContent === void 0 ? void 0 : fileContent.fileSize) || 0) })] })] }, (_b = item.chatLog) === null || _b === void 0 ? void 0 : _b.clientMsgID));
14
+ return (_jsxs("div", { className: "flex w-full cursor-pointer items-center gap-2 rounded-[12px] bg-gray-50/20 p-3", onClick: () => downloadFileFromUrl((fileContent === null || fileContent === void 0 ? void 0 : fileContent.sourceUrl) || "", (fileContent === null || fileContent === void 0 ? void 0 : fileContent.fileName) || ""), children: [_jsx("div", { className: "flex h-10 w-10 shrink-0 items-center justify-center [&>svg]:h-full [&>svg]:w-auto", children: documentIcon }), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [_jsx("span", { className: "truncate text-[16px] font-medium leading-[1.6] text-gray-900", children: shortenFileName(fileContent === null || fileContent === void 0 ? void 0 : fileContent.fileName) }), _jsx("span", { className: "text-[13px] font-normal leading-[1.6] text-gray-400", children: renderFileSize((fileContent === null || fileContent === void 0 ? void 0 : fileContent.fileSize) || 0) })] })] }, (_b = item.chatLog) === null || _b === void 0 ? void 0 : _b.clientMsgID));
15
15
  }) }) })));
16
16
  };
17
17
  export default FileResourceList;
@@ -25,8 +25,8 @@ export const RESOURCE_TAB_LABEL_KEY = {
25
25
  [MediaResourceTabKey.Link]: "link",
26
26
  };
27
27
  export const RESOURCE_EMPTY_TEXT_KEY = {
28
- [MediaResourceTabKey.Image]: "no_resource_images",
29
- [MediaResourceTabKey.Video]: "no_resource_videos",
28
+ [MediaResourceTabKey.Image]: "no_resource_files",
29
+ [MediaResourceTabKey.Video]: "no_resource_files",
30
30
  [MediaResourceTabKey.File]: "no_resource_files",
31
31
  [MediaResourceTabKey.Link]: "no_resource_links",
32
32
  };
@@ -7,8 +7,6 @@
7
7
  "no_conversation_data": "Vui lòng chọn một cuộc trò chuyện",
8
8
  "no_media_files": "Không có tập tin phương tiện",
9
9
  "media_resources_title": "Tập tin phương tiện",
10
- "no_resource_images": "Không tìm thấy hình ảnh nào",
11
- "no_resource_videos": "Không tìm thấy video nào",
12
10
  "no_resource_files": "Không tìm thấy tập tin nào",
13
11
  "no_resource_links": "Không tìm thấy liên kết nào",
14
12
  "previous_video": "Video trước",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@droppii-org/chat-sdk",
3
- "version": "0.1.88",
3
+ "version": "0.1.89",
4
4
  "description": "Droppii React Chat SDK",
5
5
  "repository": {
6
6
  "type": "git",