@baishuyun/chat-sdk 0.1.5 → 0.1.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baishuyun/chat-sdk",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "",
5
5
  "main": "src/index.jsx",
6
6
  "module": "dist/chat-sdk.js",
@@ -51,8 +51,8 @@
51
51
  "tailwindcss": "^4.1.17",
52
52
  "vite": "^5.1.4",
53
53
  "vite-plugin-dts": "^4.5.4",
54
- "@baishuyun/typescript-config": "0.1.0",
55
- "@baishuyun/types": "1.1.0"
54
+ "@baishuyun/types": "1.1.0",
55
+ "@baishuyun/typescript-config": "0.1.0"
56
56
  },
57
57
  "exports": {
58
58
  ".": {
package/src/sdk.impl.tsx CHANGED
@@ -125,7 +125,13 @@ export class ChatSDK implements IChatSDK {
125
125
  const { attachmentsUrl, ...restOptions } = options;
126
126
 
127
127
  const uploadEndpoint = `${ensureEndSlash(this.options.backendApiEndpoint!)}form/attachment/upload`;
128
+
129
+ if (attachmentsUrl && attachmentsUrl.length > 0) {
130
+ this.Store.getState().setGlobalFakeLoadingMessage("正在处理附件...");
131
+ }
132
+
128
133
  let fileParts: ChatMessage['parts'] = await urls2fileParts(attachmentsUrl || [], uploadEndpoint);
134
+ this.Store.getState().clearGlobalFakeLoadingMessage();
129
135
 
130
136
  const msg = fileParts.length > 0
131
137
  ? {