@natoe/colab 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/dist/index.d.mts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +24 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -370,7 +370,9 @@ function CollabProvider({ config, apiBaseUrl, children }) {
|
|
|
370
370
|
const data = snakeToCamel(await response.json());
|
|
371
371
|
orderIds.forEach((orderId) => {
|
|
372
372
|
const preview = data.previews[orderId] ?? null;
|
|
373
|
-
|
|
373
|
+
if (preview !== null) {
|
|
374
|
+
previewCache.current.set(orderId, preview);
|
|
375
|
+
}
|
|
374
376
|
resolvers.get(orderId)?.forEach((resolve) => resolve(preview));
|
|
375
377
|
});
|
|
376
378
|
} catch (error) {
|
|
@@ -417,7 +419,8 @@ function CollabProvider({ config, apiBaseUrl, children }) {
|
|
|
417
419
|
if (!response.ok) {
|
|
418
420
|
throw { code: "FETCH_ERROR", message: "Failed to fetch messages", status: response.status };
|
|
419
421
|
}
|
|
420
|
-
|
|
422
|
+
const msgs = snakeToCamel(await response.json());
|
|
423
|
+
return msgs.sort((a, b) => a.insertedAt.localeCompare(b.insertedAt));
|
|
421
424
|
},
|
|
422
425
|
[apiBaseUrl, authHeaders]
|
|
423
426
|
);
|
|
@@ -891,8 +894,8 @@ function useConversation({
|
|
|
891
894
|
const payload = {
|
|
892
895
|
body: "Voice message",
|
|
893
896
|
type: "audio",
|
|
894
|
-
|
|
895
|
-
|
|
897
|
+
media_url: url,
|
|
898
|
+
media_duration: duration
|
|
896
899
|
};
|
|
897
900
|
const { conv, persistedByCreate } = await ensureConversation(payload);
|
|
898
901
|
if (persistedByCreate) return;
|
|
@@ -908,8 +911,8 @@ function useConversation({
|
|
|
908
911
|
const payload = {
|
|
909
912
|
body: file.name,
|
|
910
913
|
type: isImage ? "image" : "file",
|
|
911
|
-
|
|
912
|
-
|
|
914
|
+
media_url: url,
|
|
915
|
+
file_name: file.name
|
|
913
916
|
};
|
|
914
917
|
const { conv, persistedByCreate } = await ensureConversation(payload);
|
|
915
918
|
if (persistedByCreate) return;
|
|
@@ -3649,6 +3652,7 @@ function CollabPopup({
|
|
|
3649
3652
|
participantIds,
|
|
3650
3653
|
isOpen,
|
|
3651
3654
|
onClose,
|
|
3655
|
+
onBack,
|
|
3652
3656
|
initialPosition,
|
|
3653
3657
|
width = 380,
|
|
3654
3658
|
height = 520,
|
|
@@ -3758,7 +3762,18 @@ function CollabPopup({
|
|
|
3758
3762
|
onMouseDown: handleMouseDown,
|
|
3759
3763
|
children: [
|
|
3760
3764
|
/* @__PURE__ */ jsxs("div", { "data-drag-handle": true, style: styles13.titleBar, children: [
|
|
3761
|
-
/* @__PURE__ */ jsx(
|
|
3765
|
+
onBack && /* @__PURE__ */ jsx(
|
|
3766
|
+
"button",
|
|
3767
|
+
{
|
|
3768
|
+
onClick: onBack,
|
|
3769
|
+
style: styles13.titleButton,
|
|
3770
|
+
"aria-label": "Go back",
|
|
3771
|
+
title: "Back",
|
|
3772
|
+
type: "button",
|
|
3773
|
+
children: "\u2190"
|
|
3774
|
+
}
|
|
3775
|
+
),
|
|
3776
|
+
/* @__PURE__ */ jsx("span", { id: titleId, style: { ...styles13.titleText, flex: 1 }, children: buildChannelName(patientData) }),
|
|
3762
3777
|
/* @__PURE__ */ jsxs("div", { style: styles13.titleActions, children: [
|
|
3763
3778
|
/* @__PURE__ */ jsx(
|
|
3764
3779
|
"button",
|
|
@@ -4045,8 +4060,8 @@ function useInlineCollab({
|
|
|
4045
4060
|
await dispatchSend({
|
|
4046
4061
|
body: "Voice message",
|
|
4047
4062
|
type: "audio",
|
|
4048
|
-
|
|
4049
|
-
|
|
4063
|
+
media_url: url,
|
|
4064
|
+
media_duration: duration
|
|
4050
4065
|
});
|
|
4051
4066
|
} catch (err) {
|
|
4052
4067
|
setError(err instanceof Error ? err.message : "Failed to send voice message");
|