@droppii-org/chat-sdk 0.1.91 → 0.1.92

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":"ReplyQuoteContent.d.ts","sourceRoot":"","sources":["../../../../src/components/message/reply/ReplyQuoteContent.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AASxE,eAAO,MAAM,oBAAoB,GAAI,aAAa,WAAW,YACb,CAAC;AAEjD,UAAU,sBAAsB;IAC9B,OAAO,EAAE,WAAW,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,iBAAiB,GAAI,qBAG/B,sBAAsB,4CA2BxB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"ReplyQuoteContent.d.ts","sourceRoot":"","sources":["../../../../src/components/message/reply/ReplyQuoteContent.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AASxE,eAAO,MAAM,oBAAoB,GAAI,aAAa,WAAW,YACb,CAAC;AAEjD,UAAU,sBAAsB;IAC9B,OAAO,EAAE,WAAW,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,iBAAiB,GAAI,qBAG/B,sBAAsB,4CA+BxB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -9,12 +9,15 @@ const TEXT_LIKE_MESSAGE_TYPES = [
9
9
  ];
10
10
  export const hasReplyMediaPreview = (contentType) => !TEXT_LIKE_MESSAGE_TYPES.includes(contentType);
11
11
  export const ReplyQuoteContent = ({ message, title = "", }) => {
12
- var _a, _b, _c, _d;
12
+ var _a, _b, _c, _d, _e;
13
13
  const { t } = useTranslation();
14
14
  const hasMedia = hasReplyMediaPreview(message.contentType);
15
- return (_jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-0.5 pr-2 self-stretch", children: [_jsx("div", { className: "w-[3px] shrink-0 self-stretch rounded bg-gray-cool-200" }), hasMedia && _jsx(ReplyPreviewMedia, { message: message }), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col justify-center py-1 pl-2", children: [_jsx("p", { className: "truncate text-[14px] font-medium leading-[160%] text-gray-900", children: title }), _jsx("p", { className: "truncate text-[13px] leading-[160%] text-gray-400", children: generateContentBasedOnMessageType(message.contentType, ((_a = message.textElem) === null || _a === void 0 ? void 0 : _a.content) || ((_b = message.quoteElem) === null || _b === void 0 ? void 0 : _b.text), t, {
16
- duration: (_c = message.videoElem) === null || _c === void 0 ? void 0 : _c.duration,
17
- fileName: (_d = message.fileElem) === null || _d === void 0 ? void 0 : _d.fileName,
15
+ const plainText = ((_a = message.textElem) === null || _a === void 0 ? void 0 : _a.content) ||
16
+ ((_b = message.quoteElem) === null || _b === void 0 ? void 0 : _b.text) ||
17
+ ((_c = message.urlTextElem) === null || _c === void 0 ? void 0 : _c.content);
18
+ return (_jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-0.5 pr-2 self-stretch", children: [_jsx("div", { className: "w-[3px] shrink-0 self-stretch rounded bg-gray-cool-200" }), hasMedia && _jsx(ReplyPreviewMedia, { message: message }), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col justify-center py-1 pl-2", children: [_jsx("p", { className: "truncate text-[14px] font-medium leading-[160%] text-gray-900", children: title }), _jsx("p", { className: "truncate text-[13px] leading-[160%] text-gray-400", children: generateContentBasedOnMessageType(message.contentType, plainText, t, {
19
+ duration: (_d = message.videoElem) === null || _d === void 0 ? void 0 : _d.duration,
20
+ fileName: (_e = message.fileElem) === null || _e === void 0 ? void 0 : _e.fileName,
18
21
  }, message.customElem) })] })] }));
19
22
  };
20
23
  export default ReplyQuoteContent;
@@ -1 +1 @@
1
- {"version":3,"file":"useSendMessage.d.ts","sourceRoot":"","sources":["../../../src/hooks/message/useSendMessage.ts"],"names":[],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AC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;QACrB,cAAc,CAAC,EAAE,gBAAgB,CAAC;QAClC,UAAU,EAAE,OAAO,CAAC;QACpB,WAAW,CAAC,EAAE,eAAe,CAAC;QAC9B,IAAI,CAAC,EAAE,WAAW,CAAC;QACnB,aAAa,CAAC,EAAE,oBAAoB,CAAC;KACtC,KAAG,OAAO,CAAC,OAAO,CAAC;iCA3CT,oBAAoB,gBACf;QAAE,cAAc,CAAC,EAAE,gBAAgB,CAAA;KAAE,KAClD,OAAO,CAAC,OAAO,CAAC;mCAnHG,WAAW;CAyVpC,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,kDAKvC;IACD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAClC,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB,sBA8BA,CAAC"}
@@ -160,12 +160,16 @@ export const useSendMessage = (options) => {
160
160
  }
161
161
  }, [queryClient]);
162
162
  const dispatchMessage = useCallback(async (message, currentSession) => {
163
- var _a, _b, _c, _d, _e, _f;
164
- const desc = generateContentBasedOnMessageType(message.contentType, ((_a = message === null || message === void 0 ? void 0 : message.textElem) === null || _a === void 0 ? void 0 : _a.content) || "", t, {
165
- duration: (_b = message.videoElem) === null || _b === void 0 ? void 0 : _b.duration,
166
- fileName: (_c = message.fileElem) === null || _c === void 0 ? void 0 : _c.fileName,
163
+ var _a, _b, _c, _d, _e, _f, _g, _h;
164
+ const plainText = ((_a = message === null || message === void 0 ? void 0 : message.textElem) === null || _a === void 0 ? void 0 : _a.content) ||
165
+ ((_b = message === null || message === void 0 ? void 0 : message.quoteElem) === null || _b === void 0 ? void 0 : _b.text) ||
166
+ ((_c = message === null || message === void 0 ? void 0 : message.urlTextElem) === null || _c === void 0 ? void 0 : _c.content) ||
167
+ "";
168
+ const desc = generateContentBasedOnMessageType(message.contentType, plainText, t, {
169
+ duration: (_d = message.videoElem) === null || _d === void 0 ? void 0 : _d.duration,
170
+ fileName: (_e = message.fileElem) === null || _e === void 0 ? void 0 : _e.fileName,
167
171
  }, message === null || message === void 0 ? void 0 : message.customElem) || t("new_message");
168
- const pushMeta = (_e = (_d = options === null || options === void 0 ? void 0 : options.resolveOfflinePushMeta) === null || _d === void 0 ? void 0 : _d.call(options, { desc })) !== null && _e !== void 0 ? _e : {
172
+ const pushMeta = (_g = (_f = options === null || options === void 0 ? void 0 : options.resolveOfflinePushMeta) === null || _f === void 0 ? void 0 : _f.call(options, { desc })) !== null && _g !== void 0 ? _g : {
169
173
  title: (conversationData === null || conversationData === void 0 ? void 0 : conversationData.showName) || "Droppii Chat",
170
174
  icon: (conversationData === null || conversationData === void 0 ? void 0 : conversationData.faceURL) || "",
171
175
  conversationId: (conversationData === null || conversationData === void 0 ? void 0 : conversationData.conversationID) || "",
@@ -190,7 +194,7 @@ export const useSendMessage = (options) => {
190
194
  iOSBadgeCount: true,
191
195
  },
192
196
  });
193
- updateOneMessage(Object.assign(Object.assign({}, successMessage), { ex: successMessage.ex || message.ex || "{}", isInternal: (_f = successMessage.isInternal) !== null && _f !== void 0 ? _f : message.isInternal }));
197
+ updateOneMessage(Object.assign(Object.assign({}, successMessage), { ex: successMessage.ex || message.ex || "{}", isInternal: (_h = successMessage.isInternal) !== null && _h !== void 0 ? _h : message.isInternal }));
194
198
  if (!message.isInternal) {
195
199
  await syncSessionAfterPublicMessage(currentSession);
196
200
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@droppii-org/chat-sdk",
3
- "version": "0.1.91",
3
+ "version": "0.1.92",
4
4
  "description": "Droppii React Chat SDK",
5
5
  "repository": {
6
6
  "type": "git",