mr-chat-bird 1.0.9 → 1.0.10
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.js +72 -72
- package/dist/index.mjs +77 -77
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -331,7 +331,7 @@ function ReduxProvider({ children }) {
|
|
|
331
331
|
}
|
|
332
332
|
|
|
333
333
|
// src/store/socket/index.tsx
|
|
334
|
-
var import_react2 = require("react");
|
|
334
|
+
var import_react2 = __toESM(require("react"));
|
|
335
335
|
|
|
336
336
|
// src/lib/socket.ts
|
|
337
337
|
var import_socket = require("socket.io-client");
|
|
@@ -374,7 +374,7 @@ function SocketProvider({ children, userId }) {
|
|
|
374
374
|
}
|
|
375
375
|
};
|
|
376
376
|
}, [userId]);
|
|
377
|
-
return /* @__PURE__ */
|
|
377
|
+
return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, children);
|
|
378
378
|
}
|
|
379
379
|
|
|
380
380
|
// src/components/ChatUserList/ChatUserList.tsx
|
|
@@ -387,7 +387,7 @@ var import_core7 = require("@mantine/core");
|
|
|
387
387
|
var import_icons_react3 = require("@tabler/icons-react");
|
|
388
388
|
|
|
389
389
|
// src/components/RichTextEditor/RichTextEditor.tsx
|
|
390
|
-
var import_react4 = require("react");
|
|
390
|
+
var import_react4 = __toESM(require("react"));
|
|
391
391
|
var import_icons_react = require("@tabler/icons-react");
|
|
392
392
|
var import_extension_highlight = __toESM(require("@tiptap/extension-highlight"));
|
|
393
393
|
var import_extension_subscript = __toESM(require("@tiptap/extension-subscript"));
|
|
@@ -4752,7 +4752,7 @@ var import_tiptap = require("@mantine/tiptap");
|
|
|
4752
4752
|
var import_core5 = require("@mantine/core");
|
|
4753
4753
|
|
|
4754
4754
|
// src/components/EmojiPickerPopover/EmojiPickerPopover.tsx
|
|
4755
|
-
var import_react3 = require("react");
|
|
4755
|
+
var import_react3 = __toESM(require("react"));
|
|
4756
4756
|
var import_core3 = require("@mantine/core");
|
|
4757
4757
|
var import_data = __toESM(require("@emoji-mart/data"));
|
|
4758
4758
|
var EmojiPicker = (0, import_react3.lazy)(() => import("@emoji-mart/react"));
|
|
@@ -4764,7 +4764,7 @@ function EmojiPickerPopover({
|
|
|
4764
4764
|
position = "bottom-start"
|
|
4765
4765
|
}) {
|
|
4766
4766
|
const [opened, setOpened] = (0, import_react3.useState)(false);
|
|
4767
|
-
return /* @__PURE__ */
|
|
4767
|
+
return /* @__PURE__ */ import_react3.default.createElement(
|
|
4768
4768
|
import_core3.Popover,
|
|
4769
4769
|
{
|
|
4770
4770
|
opened,
|
|
@@ -4777,18 +4777,18 @@ function EmojiPickerPopover({
|
|
|
4777
4777
|
trapFocus: false,
|
|
4778
4778
|
closeOnEscape: true
|
|
4779
4779
|
},
|
|
4780
|
-
/* @__PURE__ */
|
|
4780
|
+
/* @__PURE__ */ import_react3.default.createElement(import_core3.Popover.Target, null, (0, import_react3.cloneElement)(action, {
|
|
4781
4781
|
onClick: (e) => {
|
|
4782
4782
|
action.props?.onClick?.(e);
|
|
4783
4783
|
setOpened((prev) => !prev);
|
|
4784
4784
|
}
|
|
4785
4785
|
})),
|
|
4786
|
-
/* @__PURE__ */
|
|
4786
|
+
/* @__PURE__ */ import_react3.default.createElement(import_core3.Popover.Dropdown, { p: 0 }, /* @__PURE__ */ import_react3.default.createElement(
|
|
4787
4787
|
import_react3.Suspense,
|
|
4788
4788
|
{
|
|
4789
|
-
fallback: /* @__PURE__ */
|
|
4789
|
+
fallback: /* @__PURE__ */ import_react3.default.createElement("div", { style: { padding: 12, width: 320 } }, /* @__PURE__ */ import_react3.default.createElement(import_core3.Skeleton, { height: 280, radius: "md" }))
|
|
4790
4790
|
},
|
|
4791
|
-
/* @__PURE__ */
|
|
4791
|
+
/* @__PURE__ */ import_react3.default.createElement(
|
|
4792
4792
|
EmojiPicker,
|
|
4793
4793
|
{
|
|
4794
4794
|
previewPosition: "none",
|
|
@@ -4886,15 +4886,15 @@ function CustomRichTextEditor({
|
|
|
4886
4886
|
editor.commands.focus();
|
|
4887
4887
|
setCharCount(0);
|
|
4888
4888
|
};
|
|
4889
|
-
return /* @__PURE__ */
|
|
4889
|
+
return /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, /* @__PURE__ */ import_react4.default.createElement(
|
|
4890
4890
|
import_tiptap.RichTextEditor,
|
|
4891
4891
|
{
|
|
4892
4892
|
editor,
|
|
4893
4893
|
w: "100%",
|
|
4894
4894
|
className: "mrchat-richTextEditorContainer"
|
|
4895
4895
|
},
|
|
4896
|
-
/* @__PURE__ */
|
|
4897
|
-
/* @__PURE__ */
|
|
4896
|
+
/* @__PURE__ */ import_react4.default.createElement(import_tiptap.RichTextEditor.Content, null),
|
|
4897
|
+
/* @__PURE__ */ import_react4.default.createElement(import_tiptap.RichTextEditor.Toolbar, { sticky: true, stickyOffset: "var(--docs-header-height)" }, /* @__PURE__ */ import_react4.default.createElement("div", { className: "mrchat-mainActionContainer" }, /* @__PURE__ */ import_react4.default.createElement(
|
|
4898
4898
|
EmojiPickerPopover,
|
|
4899
4899
|
{
|
|
4900
4900
|
onSelect: (emoji) => {
|
|
@@ -4905,7 +4905,7 @@ function CustomRichTextEditor({
|
|
|
4905
4905
|
}
|
|
4906
4906
|
}).run();
|
|
4907
4907
|
},
|
|
4908
|
-
action: /* @__PURE__ */
|
|
4908
|
+
action: /* @__PURE__ */ import_react4.default.createElement(
|
|
4909
4909
|
import_core5.ActionIcon,
|
|
4910
4910
|
{
|
|
4911
4911
|
radius: "lg",
|
|
@@ -4914,10 +4914,10 @@ function CustomRichTextEditor({
|
|
|
4914
4914
|
color: "#333",
|
|
4915
4915
|
className: "mrchat-mainActionEmojiIcon"
|
|
4916
4916
|
},
|
|
4917
|
-
/* @__PURE__ */
|
|
4917
|
+
/* @__PURE__ */ import_react4.default.createElement(AddReaction_default, null)
|
|
4918
4918
|
)
|
|
4919
4919
|
}
|
|
4920
|
-
), /* @__PURE__ */
|
|
4920
|
+
), /* @__PURE__ */ import_react4.default.createElement(
|
|
4921
4921
|
import_core5.ActionIcon,
|
|
4922
4922
|
{
|
|
4923
4923
|
radius: "lg",
|
|
@@ -4927,8 +4927,8 @@ function CustomRichTextEditor({
|
|
|
4927
4927
|
className: "mrchat-mainTextFormatIcon",
|
|
4928
4928
|
onClick: () => setShowToolbar((prev) => !prev)
|
|
4929
4929
|
},
|
|
4930
|
-
/* @__PURE__ */
|
|
4931
|
-
), /* @__PURE__ */
|
|
4930
|
+
/* @__PURE__ */ import_react4.default.createElement(TextFormat_default, null)
|
|
4931
|
+
), /* @__PURE__ */ import_react4.default.createElement(
|
|
4932
4932
|
import_core5.ActionIcon,
|
|
4933
4933
|
{
|
|
4934
4934
|
radius: "lg",
|
|
@@ -4937,15 +4937,15 @@ function CustomRichTextEditor({
|
|
|
4937
4937
|
className: "mrchat-mainSendMsgIcon",
|
|
4938
4938
|
onClick: () => handleSubmitMsg()
|
|
4939
4939
|
},
|
|
4940
|
-
/* @__PURE__ */
|
|
4941
|
-
)), showToolbar && /* @__PURE__ */
|
|
4940
|
+
/* @__PURE__ */ import_react4.default.createElement(import_icons_react.IconSend, { size: 18 })
|
|
4941
|
+
)), showToolbar && /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, /* @__PURE__ */ import_react4.default.createElement(import_tiptap.RichTextEditor.ControlsGroup, null, /* @__PURE__ */ import_react4.default.createElement(import_tiptap.RichTextEditor.Bold, null), /* @__PURE__ */ import_react4.default.createElement(import_tiptap.RichTextEditor.Italic, null), /* @__PURE__ */ import_react4.default.createElement(import_tiptap.RichTextEditor.Underline, null), /* @__PURE__ */ import_react4.default.createElement(import_tiptap.RichTextEditor.Strikethrough, null), /* @__PURE__ */ import_react4.default.createElement(import_tiptap.RichTextEditor.Code, null), /* @__PURE__ */ import_react4.default.createElement(import_tiptap.RichTextEditor.Highlight, null)), /* @__PURE__ */ import_react4.default.createElement(
|
|
4942
4942
|
import_tiptap.RichTextEditor.ControlsGroup,
|
|
4943
4943
|
{
|
|
4944
4944
|
className: "mrchat-secondRichTextEditorToolBar"
|
|
4945
4945
|
},
|
|
4946
|
-
/* @__PURE__ */
|
|
4947
|
-
/* @__PURE__ */
|
|
4948
|
-
/* @__PURE__ */
|
|
4946
|
+
/* @__PURE__ */ import_react4.default.createElement(import_tiptap.RichTextEditor.BulletList, null),
|
|
4947
|
+
/* @__PURE__ */ import_react4.default.createElement(import_tiptap.RichTextEditor.OrderedList, null),
|
|
4948
|
+
/* @__PURE__ */ import_react4.default.createElement(import_core5.Menu, { trigger: "hover", openDelay: 200 }, /* @__PURE__ */ import_react4.default.createElement(import_core5.Menu.Target, null, /* @__PURE__ */ import_react4.default.createElement(
|
|
4949
4949
|
import_core5.ActionIcon,
|
|
4950
4950
|
{
|
|
4951
4951
|
variant: "outline",
|
|
@@ -4953,35 +4953,35 @@ function CustomRichTextEditor({
|
|
|
4953
4953
|
color: "#495057",
|
|
4954
4954
|
className: "mrchat-customToolActionItem"
|
|
4955
4955
|
},
|
|
4956
|
-
/* @__PURE__ */
|
|
4957
|
-
)), /* @__PURE__ */
|
|
4956
|
+
/* @__PURE__ */ import_react4.default.createElement(import_icons_react.IconAlignLeft, { size: 16, stroke: 1.5 })
|
|
4957
|
+
)), /* @__PURE__ */ import_react4.default.createElement(import_core5.Menu.Dropdown, null, /* @__PURE__ */ import_react4.default.createElement(
|
|
4958
4958
|
import_core5.Menu.Item,
|
|
4959
4959
|
{
|
|
4960
4960
|
onClick: () => editor?.chain().focus().setTextAlign("left").run()
|
|
4961
4961
|
},
|
|
4962
|
-
/* @__PURE__ */
|
|
4963
|
-
), /* @__PURE__ */
|
|
4962
|
+
/* @__PURE__ */ import_react4.default.createElement(import_icons_react.IconAlignLeft, { size: 14 })
|
|
4963
|
+
), /* @__PURE__ */ import_react4.default.createElement(
|
|
4964
4964
|
import_core5.Menu.Item,
|
|
4965
4965
|
{
|
|
4966
4966
|
onClick: () => editor?.chain().focus().setTextAlign("center").run()
|
|
4967
4967
|
},
|
|
4968
|
-
/* @__PURE__ */
|
|
4969
|
-
), /* @__PURE__ */
|
|
4968
|
+
/* @__PURE__ */ import_react4.default.createElement(import_icons_react.IconAlignCenter, { size: 14 })
|
|
4969
|
+
), /* @__PURE__ */ import_react4.default.createElement(
|
|
4970
4970
|
import_core5.Menu.Item,
|
|
4971
4971
|
{
|
|
4972
4972
|
onClick: () => editor?.chain().focus().setTextAlign("right").run()
|
|
4973
4973
|
},
|
|
4974
|
-
/* @__PURE__ */
|
|
4974
|
+
/* @__PURE__ */ import_react4.default.createElement(import_icons_react.IconAlignRight, { size: 14 })
|
|
4975
4975
|
))),
|
|
4976
|
-
/* @__PURE__ */
|
|
4977
|
-
), /* @__PURE__ */
|
|
4976
|
+
/* @__PURE__ */ import_react4.default.createElement(import_tiptap.RichTextEditor.Link, null)
|
|
4977
|
+
), /* @__PURE__ */ import_react4.default.createElement(
|
|
4978
4978
|
import_tiptap.RichTextEditor.ControlsGroup,
|
|
4979
4979
|
{
|
|
4980
4980
|
className: "mrchat-secondRichTextEditorToolBar"
|
|
4981
4981
|
},
|
|
4982
|
-
/* @__PURE__ */
|
|
4982
|
+
/* @__PURE__ */ import_react4.default.createElement(import_tiptap.RichTextEditor.ClearFormatting, null)
|
|
4983
4983
|
))),
|
|
4984
|
-
showWarning && /* @__PURE__ */
|
|
4984
|
+
showWarning && /* @__PURE__ */ import_react4.default.createElement(
|
|
4985
4985
|
"div",
|
|
4986
4986
|
{
|
|
4987
4987
|
style: {
|
|
@@ -5002,7 +5002,7 @@ function CustomRichTextEditor({
|
|
|
5002
5002
|
|
|
5003
5003
|
// src/components/ChatUserList/ChatUserMessage.tsx
|
|
5004
5004
|
var import_react_redux2 = require("react-redux");
|
|
5005
|
-
var import_react8 = require("react");
|
|
5005
|
+
var import_react8 = __toESM(require("react"));
|
|
5006
5006
|
var import_dompurify = __toESM(require("dompurify"));
|
|
5007
5007
|
|
|
5008
5008
|
// src/components/VirtualizedList/ChatScrollContainer.tsx
|
|
@@ -5072,7 +5072,7 @@ function ChatScrollContainer({
|
|
|
5072
5072
|
}
|
|
5073
5073
|
|
|
5074
5074
|
// src/components/UserProfile/UserProfileDrawer.tsx
|
|
5075
|
-
var import_react7 = require("react");
|
|
5075
|
+
var import_react7 = __toESM(require("react"));
|
|
5076
5076
|
var import_core6 = require("@mantine/core");
|
|
5077
5077
|
var import_icons_react2 = require("@tabler/icons-react");
|
|
5078
5078
|
function UserProfileDrawer({
|
|
@@ -5092,14 +5092,14 @@ function UserProfileDrawer({
|
|
|
5092
5092
|
setTimeout(onClose, 250);
|
|
5093
5093
|
};
|
|
5094
5094
|
if (!opened && !visible) return null;
|
|
5095
|
-
return /* @__PURE__ */
|
|
5095
|
+
return /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, /* @__PURE__ */ import_react7.default.createElement("div", { className: "mrchat-overlay", onClick: handleClose }, /* @__PURE__ */ import_react7.default.createElement(
|
|
5096
5096
|
"div",
|
|
5097
5097
|
{
|
|
5098
5098
|
className: `${"mrchat-drawer"} ${visible ? "mrchat-open" : "mrchat-close"}`,
|
|
5099
5099
|
onClick: (e) => e.stopPropagation()
|
|
5100
5100
|
},
|
|
5101
|
-
/* @__PURE__ */
|
|
5102
|
-
/* @__PURE__ */
|
|
5101
|
+
/* @__PURE__ */ import_react7.default.createElement("div", { className: "mrchat-header" }, /* @__PURE__ */ import_react7.default.createElement("div", { className: "mrchat-backBtn", onClick: handleClose }, /* @__PURE__ */ import_react7.default.createElement(import_icons_react2.IconArrowLeft, { size: 20 })), /* @__PURE__ */ import_react7.default.createElement(import_core6.Text, { fw: 600 }, "Contact info")),
|
|
5102
|
+
/* @__PURE__ */ import_react7.default.createElement("div", { className: "mrchat-profileSection" }, /* @__PURE__ */ import_react7.default.createElement(
|
|
5103
5103
|
import_core6.Avatar,
|
|
5104
5104
|
{
|
|
5105
5105
|
src: user?.avatar,
|
|
@@ -5108,31 +5108,31 @@ function UserProfileDrawer({
|
|
|
5108
5108
|
style: { cursor: "pointer" },
|
|
5109
5109
|
onClick: () => user?.avatar ? setShowImagePreview(true) : {}
|
|
5110
5110
|
}
|
|
5111
|
-
), /* @__PURE__ */
|
|
5112
|
-
/* @__PURE__ */
|
|
5111
|
+
), /* @__PURE__ */ import_react7.default.createElement(import_core6.Text, { fw: 700, size: "lg", mt: "sm" }, user?.displayName), /* @__PURE__ */ import_react7.default.createElement(import_core6.Text, { size: "sm", c: "dimmed" }, "@", user?.username)),
|
|
5112
|
+
/* @__PURE__ */ import_react7.default.createElement("div", { className: "mrchat-actions" }, /* @__PURE__ */ import_react7.default.createElement(
|
|
5113
5113
|
"div",
|
|
5114
5114
|
{
|
|
5115
5115
|
className: `${"mrchat-item"} ${"mrchat-itemDanger"}`,
|
|
5116
5116
|
onClick: onDeleteMessages
|
|
5117
5117
|
},
|
|
5118
|
-
/* @__PURE__ */
|
|
5119
|
-
/* @__PURE__ */
|
|
5120
|
-
), /* @__PURE__ */
|
|
5118
|
+
/* @__PURE__ */ import_react7.default.createElement(import_icons_react2.IconTrash, { size: 18 }),
|
|
5119
|
+
/* @__PURE__ */ import_react7.default.createElement("span", null, "Delete all messages")
|
|
5120
|
+
), /* @__PURE__ */ import_react7.default.createElement(
|
|
5121
5121
|
"div",
|
|
5122
5122
|
{
|
|
5123
5123
|
className: `${"mrchat-item"} ${"mrchat-itemDanger"}`,
|
|
5124
5124
|
onClick: onBlock
|
|
5125
5125
|
},
|
|
5126
|
-
/* @__PURE__ */
|
|
5127
|
-
/* @__PURE__ */
|
|
5126
|
+
/* @__PURE__ */ import_react7.default.createElement(import_icons_react2.IconBan, { size: 18 }),
|
|
5127
|
+
/* @__PURE__ */ import_react7.default.createElement("span", null, "Block")
|
|
5128
5128
|
))
|
|
5129
|
-
)), showImagePreview && /* @__PURE__ */
|
|
5129
|
+
)), showImagePreview && /* @__PURE__ */ import_react7.default.createElement(
|
|
5130
5130
|
"div",
|
|
5131
5131
|
{
|
|
5132
5132
|
className: "mrchat-imagePreview",
|
|
5133
5133
|
onClick: () => setShowImagePreview(false)
|
|
5134
5134
|
},
|
|
5135
|
-
/* @__PURE__ */
|
|
5135
|
+
/* @__PURE__ */ import_react7.default.createElement("img", { src: user?.avatar, alt: "profile" })
|
|
5136
5136
|
));
|
|
5137
5137
|
}
|
|
5138
5138
|
|
|
@@ -5283,13 +5283,13 @@ function ChatUserMessage({
|
|
|
5283
5283
|
deleteMessagesByChatId({ chatId, userId: senderDetails?.userId })
|
|
5284
5284
|
);
|
|
5285
5285
|
};
|
|
5286
|
-
return /* @__PURE__ */
|
|
5286
|
+
return /* @__PURE__ */ import_react8.default.createElement("div", { className: "mrchat-mainArea" }, /* @__PURE__ */ import_react8.default.createElement("div", { className: "mrchat-chatHeader" }, receiverDetails && /* @__PURE__ */ import_react8.default.createElement(import_react8.default.Fragment, null, /* @__PURE__ */ import_react8.default.createElement(
|
|
5287
5287
|
"div",
|
|
5288
5288
|
{
|
|
5289
5289
|
className: "mrchat-receiverInfo",
|
|
5290
5290
|
onClick: () => setShowUserInfo(true)
|
|
5291
5291
|
},
|
|
5292
|
-
receiverDetails?.avatar ? /* @__PURE__ */
|
|
5292
|
+
receiverDetails?.avatar ? /* @__PURE__ */ import_react8.default.createElement(import_core7.Avatar, { src: receiverDetails.avatar, size: 36, radius: "xl" }) : /* @__PURE__ */ import_react8.default.createElement(
|
|
5293
5293
|
import_core7.Avatar,
|
|
5294
5294
|
{
|
|
5295
5295
|
key: receiverDetails?.displayName || receiverDetails?.username,
|
|
@@ -5297,16 +5297,16 @@ function ChatUserMessage({
|
|
|
5297
5297
|
color: "initials"
|
|
5298
5298
|
}
|
|
5299
5299
|
),
|
|
5300
|
-
/* @__PURE__ */
|
|
5301
|
-
), /* @__PURE__ */
|
|
5300
|
+
/* @__PURE__ */ import_react8.default.createElement(import_core7.Text, { fw: 600, size: "md" }, receiverDetails?.displayName || receiverDetails?.username)
|
|
5301
|
+
), /* @__PURE__ */ import_react8.default.createElement(import_core7.Menu, { shadow: "md", width: 200, position: "bottom-end" }, /* @__PURE__ */ import_react8.default.createElement(import_core7.Menu.Target, null, /* @__PURE__ */ import_react8.default.createElement(import_icons_react3.IconDotsVertical, { size: 20, style: { cursor: "pointer" } })), /* @__PURE__ */ import_react8.default.createElement(import_core7.Menu.Dropdown, null, /* @__PURE__ */ import_react8.default.createElement(
|
|
5302
5302
|
import_core7.Menu.Item,
|
|
5303
5303
|
{
|
|
5304
5304
|
color: "red",
|
|
5305
|
-
leftSection: /* @__PURE__ */
|
|
5305
|
+
leftSection: /* @__PURE__ */ import_react8.default.createElement(import_icons_react3.IconTrash, { size: 16 }),
|
|
5306
5306
|
onClick: handleDeleteMessages
|
|
5307
5307
|
},
|
|
5308
5308
|
"Delete all messages"
|
|
5309
|
-
), /* @__PURE__ */
|
|
5309
|
+
), /* @__PURE__ */ import_react8.default.createElement(import_core7.Menu.Item, { color: "red", leftSection: /* @__PURE__ */ import_react8.default.createElement(import_icons_react3.IconBan, { size: 16 }) }, "Block"))))), /* @__PURE__ */ import_react8.default.createElement("div", { className: "mrchat-messageArea" }, isEmpty ? /* @__PURE__ */ import_react8.default.createElement("div", { className: "mrchat-emptyState" }, /* @__PURE__ */ import_react8.default.createElement("div", { className: "mrchat-encryptionMinimal" }, /* @__PURE__ */ import_react8.default.createElement(import_icons_react3.IconLock, { size: 20, stroke: 1.8 }), /* @__PURE__ */ import_react8.default.createElement(import_core7.Text, { className: "mrchat-encryptionText", size: "md" }, "End-to-end encrypted"))) : /* @__PURE__ */ import_react8.default.createElement(
|
|
5310
5310
|
ChatScrollContainer,
|
|
5311
5311
|
{
|
|
5312
5312
|
data: messages,
|
|
@@ -5340,7 +5340,7 @@ function ChatUserMessage({
|
|
|
5340
5340
|
minute: "2-digit",
|
|
5341
5341
|
hour12: false
|
|
5342
5342
|
});
|
|
5343
|
-
return /* @__PURE__ */
|
|
5343
|
+
return /* @__PURE__ */ import_react8.default.createElement("div", { key: item?.id + "_" + index }, showDate && /* @__PURE__ */ import_react8.default.createElement("div", { className: "mrchat-dateSeparator" }, formattedDate), /* @__PURE__ */ import_react8.default.createElement(
|
|
5344
5344
|
"div",
|
|
5345
5345
|
{
|
|
5346
5346
|
style: {
|
|
@@ -5348,7 +5348,7 @@ function ChatUserMessage({
|
|
|
5348
5348
|
},
|
|
5349
5349
|
className: `${"mrchat-messageBubble"} ${isOutgoing ? "mrchat-outgoing" : "mrchat-incoming"}`
|
|
5350
5350
|
},
|
|
5351
|
-
/* @__PURE__ */
|
|
5351
|
+
/* @__PURE__ */ import_react8.default.createElement(
|
|
5352
5352
|
"div",
|
|
5353
5353
|
{
|
|
5354
5354
|
className: "mrchat-messageContent",
|
|
@@ -5357,11 +5357,11 @@ function ChatUserMessage({
|
|
|
5357
5357
|
}
|
|
5358
5358
|
}
|
|
5359
5359
|
),
|
|
5360
|
-
/* @__PURE__ */
|
|
5360
|
+
/* @__PURE__ */ import_react8.default.createElement("div", { className: "mrchat-messageTime" }, time)
|
|
5361
5361
|
));
|
|
5362
5362
|
}
|
|
5363
5363
|
}
|
|
5364
|
-
)), (chatId || enableChat) && /* @__PURE__ */
|
|
5364
|
+
)), (chatId || enableChat) && /* @__PURE__ */ import_react8.default.createElement("div", { className: "mrchat-inputBar" }, /* @__PURE__ */ import_react8.default.createElement(CustomRichTextEditor, { onSubmit: handleSendMessage })), /* @__PURE__ */ import_react8.default.createElement(
|
|
5365
5365
|
UserProfileDrawer,
|
|
5366
5366
|
{
|
|
5367
5367
|
opened: showUserInfo,
|
|
@@ -5383,7 +5383,7 @@ function ChatUserMessage({
|
|
|
5383
5383
|
|
|
5384
5384
|
// src/components/ChatUserList/ChatUserList.tsx
|
|
5385
5385
|
var import_react_redux3 = require("react-redux");
|
|
5386
|
-
var import_react9 = require("react");
|
|
5386
|
+
var import_react9 = __toESM(require("react"));
|
|
5387
5387
|
|
|
5388
5388
|
// src/components/ChatUserList/users_list.json
|
|
5389
5389
|
var users_list_default = [
|
|
@@ -6259,7 +6259,7 @@ function ChatUserList() {
|
|
|
6259
6259
|
label: user.displayName || user.username,
|
|
6260
6260
|
user
|
|
6261
6261
|
}));
|
|
6262
|
-
return /* @__PURE__ */
|
|
6262
|
+
return /* @__PURE__ */ import_react9.default.createElement("div", { className: "mrchat-chatWrapper" }, /* @__PURE__ */ import_react9.default.createElement(
|
|
6263
6263
|
import_core8.Modal,
|
|
6264
6264
|
{
|
|
6265
6265
|
opened,
|
|
@@ -6271,7 +6271,7 @@ function ChatUserList() {
|
|
|
6271
6271
|
centered: true,
|
|
6272
6272
|
withCloseButton: true
|
|
6273
6273
|
},
|
|
6274
|
-
/* @__PURE__ */
|
|
6274
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
6275
6275
|
import_core8.Autocomplete,
|
|
6276
6276
|
{
|
|
6277
6277
|
mb: 12,
|
|
@@ -6290,11 +6290,11 @@ function ChatUserList() {
|
|
|
6290
6290
|
},
|
|
6291
6291
|
renderOption: ({ option }) => {
|
|
6292
6292
|
const user = option.user;
|
|
6293
|
-
return /* @__PURE__ */
|
|
6293
|
+
return /* @__PURE__ */ import_react9.default.createElement(import_core8.Group, { gap: "sm" }, /* @__PURE__ */ import_react9.default.createElement(import_core8.Avatar, { src: user.avatar, size: 36, radius: "xl" }), /* @__PURE__ */ import_react9.default.createElement("div", null, /* @__PURE__ */ import_react9.default.createElement(import_core8.Text, { size: "sm" }, user.displayName || user.username), user.displayName && /* @__PURE__ */ import_react9.default.createElement(import_core8.Text, { size: "xs", opacity: 0.5 }, "@", user.username)));
|
|
6294
6294
|
}
|
|
6295
6295
|
}
|
|
6296
6296
|
),
|
|
6297
|
-
/* @__PURE__ */
|
|
6297
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
6298
6298
|
import_core8.Autocomplete,
|
|
6299
6299
|
{
|
|
6300
6300
|
mb: 12,
|
|
@@ -6313,11 +6313,11 @@ function ChatUserList() {
|
|
|
6313
6313
|
},
|
|
6314
6314
|
renderOption: ({ option }) => {
|
|
6315
6315
|
const user = option.user;
|
|
6316
|
-
return /* @__PURE__ */
|
|
6316
|
+
return /* @__PURE__ */ import_react9.default.createElement(import_core8.Group, { gap: "sm" }, /* @__PURE__ */ import_react9.default.createElement(import_core8.Avatar, { src: user.avatar, size: 36, radius: "xl" }), /* @__PURE__ */ import_react9.default.createElement("div", null, /* @__PURE__ */ import_react9.default.createElement(import_core8.Text, { size: "sm" }, user.displayName || user.username), user.displayName && /* @__PURE__ */ import_react9.default.createElement(import_core8.Text, { size: "xs", opacity: 0.5 }, "@", user.username)));
|
|
6317
6317
|
}
|
|
6318
6318
|
}
|
|
6319
6319
|
),
|
|
6320
|
-
/* @__PURE__ */
|
|
6320
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
6321
6321
|
import_core8.Button,
|
|
6322
6322
|
{
|
|
6323
6323
|
fullWidth: true,
|
|
@@ -6326,7 +6326,7 @@ function ChatUserList() {
|
|
|
6326
6326
|
},
|
|
6327
6327
|
"Start Chat"
|
|
6328
6328
|
)
|
|
6329
|
-
), /* @__PURE__ */
|
|
6329
|
+
), /* @__PURE__ */ import_react9.default.createElement("div", { className: "mrchat-chatContainer" }, /* @__PURE__ */ import_react9.default.createElement("div", { className: "mrchat-sidebar" }, /* @__PURE__ */ import_react9.default.createElement("div", { className: "mrchat-sidebarTop" }, /* @__PURE__ */ import_react9.default.createElement("div", { className: "mrchat-topBar" }, /* @__PURE__ */ import_react9.default.createElement(import_core8.Text, { size: "lg", fw: 600 }, "MrChat"), /* @__PURE__ */ import_react9.default.createElement("div", { className: "mrchat-topActions" }, /* @__PURE__ */ import_react9.default.createElement(
|
|
6330
6330
|
import_core8.ActionIcon,
|
|
6331
6331
|
{
|
|
6332
6332
|
variant: "subtle",
|
|
@@ -6336,15 +6336,15 @@ function ChatUserList() {
|
|
|
6336
6336
|
},
|
|
6337
6337
|
radius: "lg"
|
|
6338
6338
|
},
|
|
6339
|
-
/* @__PURE__ */
|
|
6340
|
-
)))), /* @__PURE__ */
|
|
6339
|
+
/* @__PURE__ */ import_react9.default.createElement(import_icons_react4.IconPlus, { size: 20, stroke: 3 })
|
|
6340
|
+
)))), /* @__PURE__ */ import_react9.default.createElement(import_core8.Text, { size: "xs", c: "dimmed", mt: "sm", mb: "xs", ml: 12 }, "All Messages"), /* @__PURE__ */ import_react9.default.createElement("div", { className: "mrchat-scrollWrapper" }, /* @__PURE__ */ import_react9.default.createElement(
|
|
6341
6341
|
VirtualizedList,
|
|
6342
6342
|
{
|
|
6343
6343
|
data: chatList?.rows?.data || [],
|
|
6344
6344
|
endReached: loadMoreChats,
|
|
6345
6345
|
itemContent: (_, item) => {
|
|
6346
6346
|
const isActive = item.chatId === chatId;
|
|
6347
|
-
return /* @__PURE__ */
|
|
6347
|
+
return /* @__PURE__ */ import_react9.default.createElement(
|
|
6348
6348
|
"div",
|
|
6349
6349
|
{
|
|
6350
6350
|
className: `${"mrchat-chatItem"} ${isActive ? "mrchat-activeChatItem" : ""}`,
|
|
@@ -6353,7 +6353,7 @@ function ChatUserList() {
|
|
|
6353
6353
|
handleJoinChat(item);
|
|
6354
6354
|
}
|
|
6355
6355
|
},
|
|
6356
|
-
item.avatar ? /* @__PURE__ */
|
|
6356
|
+
item.avatar ? /* @__PURE__ */ import_react9.default.createElement(import_core8.Avatar, { src: item.avatar, size: 36, radius: "xl" }) : /* @__PURE__ */ import_react9.default.createElement(
|
|
6357
6357
|
import_core8.Avatar,
|
|
6358
6358
|
{
|
|
6359
6359
|
key: item.displayName || item.username,
|
|
@@ -6361,7 +6361,7 @@ function ChatUserList() {
|
|
|
6361
6361
|
color: "initials"
|
|
6362
6362
|
}
|
|
6363
6363
|
),
|
|
6364
|
-
/* @__PURE__ */
|
|
6364
|
+
/* @__PURE__ */ import_react9.default.createElement("div", { className: "mrchat-chatInfo" }, /* @__PURE__ */ import_react9.default.createElement(import_core8.Text, { className: "mrchat-chatLabelItem", truncate: true }, item.displayName || item.username), item.unreadCount > 0 && /* @__PURE__ */ import_react9.default.createElement("div", { className: "mrchat-unreadBadge" }, item.unreadCount || 10), /* @__PURE__ */ import_react9.default.createElement("div", { className: "mrchat-messagePreview" }, /* @__PURE__ */ import_react9.default.createElement(
|
|
6365
6365
|
import_core8.Text,
|
|
6366
6366
|
{
|
|
6367
6367
|
truncate: true,
|
|
@@ -6371,7 +6371,7 @@ function ChatUserList() {
|
|
|
6371
6371
|
className: "mrchat-messagePreviewContent"
|
|
6372
6372
|
},
|
|
6373
6373
|
stripHtml(import_dompurify2.default.sanitize(item.message))
|
|
6374
|
-
), /* @__PURE__ */
|
|
6374
|
+
), /* @__PURE__ */ import_react9.default.createElement(
|
|
6375
6375
|
import_core8.Text,
|
|
6376
6376
|
{
|
|
6377
6377
|
size: "xs",
|
|
@@ -6383,7 +6383,7 @@ function ChatUserList() {
|
|
|
6383
6383
|
);
|
|
6384
6384
|
}
|
|
6385
6385
|
}
|
|
6386
|
-
))), /* @__PURE__ */
|
|
6386
|
+
))), /* @__PURE__ */ import_react9.default.createElement(
|
|
6387
6387
|
ChatUserMessage,
|
|
6388
6388
|
{
|
|
6389
6389
|
chatId,
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import "@mantine/core/styles.css";
|
|
3
3
|
import "@mantine/tiptap/styles.css";
|
|
4
4
|
import "@mantine/notifications/styles.css";
|
|
5
|
-
import
|
|
5
|
+
import React10, { useState as useState6 } from "react";
|
|
6
6
|
import { MantineProvider } from "@mantine/core";
|
|
7
7
|
import { Notifications } from "@mantine/notifications";
|
|
8
8
|
|
|
@@ -295,7 +295,7 @@ function ReduxProvider({ children }) {
|
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
// src/store/socket/index.tsx
|
|
298
|
-
import { useEffect } from "react";
|
|
298
|
+
import React3, { useEffect } from "react";
|
|
299
299
|
|
|
300
300
|
// src/lib/socket.ts
|
|
301
301
|
import { io } from "socket.io-client";
|
|
@@ -338,7 +338,7 @@ function SocketProvider({ children, userId }) {
|
|
|
338
338
|
}
|
|
339
339
|
};
|
|
340
340
|
}, [userId]);
|
|
341
|
-
return /* @__PURE__ */
|
|
341
|
+
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, children);
|
|
342
342
|
}
|
|
343
343
|
|
|
344
344
|
// src/components/ChatUserList/ChatUserList.tsx
|
|
@@ -364,7 +364,7 @@ import {
|
|
|
364
364
|
} from "@tabler/icons-react";
|
|
365
365
|
|
|
366
366
|
// src/components/RichTextEditor/RichTextEditor.tsx
|
|
367
|
-
import { useState as useState2 } from "react";
|
|
367
|
+
import React5, { useState as useState2 } from "react";
|
|
368
368
|
import {
|
|
369
369
|
IconSend,
|
|
370
370
|
IconAlignLeft,
|
|
@@ -4739,7 +4739,7 @@ import { Link, RichTextEditor } from "@mantine/tiptap";
|
|
|
4739
4739
|
import { ActionIcon, Menu } from "@mantine/core";
|
|
4740
4740
|
|
|
4741
4741
|
// src/components/EmojiPickerPopover/EmojiPickerPopover.tsx
|
|
4742
|
-
import {
|
|
4742
|
+
import React4, {
|
|
4743
4743
|
useState,
|
|
4744
4744
|
lazy,
|
|
4745
4745
|
Suspense,
|
|
@@ -4756,7 +4756,7 @@ function EmojiPickerPopover({
|
|
|
4756
4756
|
position = "bottom-start"
|
|
4757
4757
|
}) {
|
|
4758
4758
|
const [opened, setOpened] = useState(false);
|
|
4759
|
-
return /* @__PURE__ */
|
|
4759
|
+
return /* @__PURE__ */ React4.createElement(
|
|
4760
4760
|
Popover,
|
|
4761
4761
|
{
|
|
4762
4762
|
opened,
|
|
@@ -4769,18 +4769,18 @@ function EmojiPickerPopover({
|
|
|
4769
4769
|
trapFocus: false,
|
|
4770
4770
|
closeOnEscape: true
|
|
4771
4771
|
},
|
|
4772
|
-
/* @__PURE__ */
|
|
4772
|
+
/* @__PURE__ */ React4.createElement(Popover.Target, null, cloneElement(action, {
|
|
4773
4773
|
onClick: (e) => {
|
|
4774
4774
|
action.props?.onClick?.(e);
|
|
4775
4775
|
setOpened((prev) => !prev);
|
|
4776
4776
|
}
|
|
4777
4777
|
})),
|
|
4778
|
-
/* @__PURE__ */
|
|
4778
|
+
/* @__PURE__ */ React4.createElement(Popover.Dropdown, { p: 0 }, /* @__PURE__ */ React4.createElement(
|
|
4779
4779
|
Suspense,
|
|
4780
4780
|
{
|
|
4781
|
-
fallback: /* @__PURE__ */
|
|
4781
|
+
fallback: /* @__PURE__ */ React4.createElement("div", { style: { padding: 12, width: 320 } }, /* @__PURE__ */ React4.createElement(Skeleton, { height: 280, radius: "md" }))
|
|
4782
4782
|
},
|
|
4783
|
-
/* @__PURE__ */
|
|
4783
|
+
/* @__PURE__ */ React4.createElement(
|
|
4784
4784
|
EmojiPicker,
|
|
4785
4785
|
{
|
|
4786
4786
|
previewPosition: "none",
|
|
@@ -4878,15 +4878,15 @@ function CustomRichTextEditor({
|
|
|
4878
4878
|
editor.commands.focus();
|
|
4879
4879
|
setCharCount(0);
|
|
4880
4880
|
};
|
|
4881
|
-
return /* @__PURE__ */
|
|
4881
|
+
return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(
|
|
4882
4882
|
RichTextEditor,
|
|
4883
4883
|
{
|
|
4884
4884
|
editor,
|
|
4885
4885
|
w: "100%",
|
|
4886
4886
|
className: "mrchat-richTextEditorContainer"
|
|
4887
4887
|
},
|
|
4888
|
-
/* @__PURE__ */
|
|
4889
|
-
/* @__PURE__ */
|
|
4888
|
+
/* @__PURE__ */ React5.createElement(RichTextEditor.Content, null),
|
|
4889
|
+
/* @__PURE__ */ React5.createElement(RichTextEditor.Toolbar, { sticky: true, stickyOffset: "var(--docs-header-height)" }, /* @__PURE__ */ React5.createElement("div", { className: "mrchat-mainActionContainer" }, /* @__PURE__ */ React5.createElement(
|
|
4890
4890
|
EmojiPickerPopover,
|
|
4891
4891
|
{
|
|
4892
4892
|
onSelect: (emoji) => {
|
|
@@ -4897,7 +4897,7 @@ function CustomRichTextEditor({
|
|
|
4897
4897
|
}
|
|
4898
4898
|
}).run();
|
|
4899
4899
|
},
|
|
4900
|
-
action: /* @__PURE__ */
|
|
4900
|
+
action: /* @__PURE__ */ React5.createElement(
|
|
4901
4901
|
ActionIcon,
|
|
4902
4902
|
{
|
|
4903
4903
|
radius: "lg",
|
|
@@ -4906,10 +4906,10 @@ function CustomRichTextEditor({
|
|
|
4906
4906
|
color: "#333",
|
|
4907
4907
|
className: "mrchat-mainActionEmojiIcon"
|
|
4908
4908
|
},
|
|
4909
|
-
/* @__PURE__ */
|
|
4909
|
+
/* @__PURE__ */ React5.createElement(AddReaction_default, null)
|
|
4910
4910
|
)
|
|
4911
4911
|
}
|
|
4912
|
-
), /* @__PURE__ */
|
|
4912
|
+
), /* @__PURE__ */ React5.createElement(
|
|
4913
4913
|
ActionIcon,
|
|
4914
4914
|
{
|
|
4915
4915
|
radius: "lg",
|
|
@@ -4919,8 +4919,8 @@ function CustomRichTextEditor({
|
|
|
4919
4919
|
className: "mrchat-mainTextFormatIcon",
|
|
4920
4920
|
onClick: () => setShowToolbar((prev) => !prev)
|
|
4921
4921
|
},
|
|
4922
|
-
/* @__PURE__ */
|
|
4923
|
-
), /* @__PURE__ */
|
|
4922
|
+
/* @__PURE__ */ React5.createElement(TextFormat_default, null)
|
|
4923
|
+
), /* @__PURE__ */ React5.createElement(
|
|
4924
4924
|
ActionIcon,
|
|
4925
4925
|
{
|
|
4926
4926
|
radius: "lg",
|
|
@@ -4929,15 +4929,15 @@ function CustomRichTextEditor({
|
|
|
4929
4929
|
className: "mrchat-mainSendMsgIcon",
|
|
4930
4930
|
onClick: () => handleSubmitMsg()
|
|
4931
4931
|
},
|
|
4932
|
-
/* @__PURE__ */
|
|
4933
|
-
)), showToolbar && /* @__PURE__ */
|
|
4932
|
+
/* @__PURE__ */ React5.createElement(IconSend, { size: 18 })
|
|
4933
|
+
)), showToolbar && /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(RichTextEditor.ControlsGroup, null, /* @__PURE__ */ React5.createElement(RichTextEditor.Bold, null), /* @__PURE__ */ React5.createElement(RichTextEditor.Italic, null), /* @__PURE__ */ React5.createElement(RichTextEditor.Underline, null), /* @__PURE__ */ React5.createElement(RichTextEditor.Strikethrough, null), /* @__PURE__ */ React5.createElement(RichTextEditor.Code, null), /* @__PURE__ */ React5.createElement(RichTextEditor.Highlight, null)), /* @__PURE__ */ React5.createElement(
|
|
4934
4934
|
RichTextEditor.ControlsGroup,
|
|
4935
4935
|
{
|
|
4936
4936
|
className: "mrchat-secondRichTextEditorToolBar"
|
|
4937
4937
|
},
|
|
4938
|
-
/* @__PURE__ */
|
|
4939
|
-
/* @__PURE__ */
|
|
4940
|
-
/* @__PURE__ */
|
|
4938
|
+
/* @__PURE__ */ React5.createElement(RichTextEditor.BulletList, null),
|
|
4939
|
+
/* @__PURE__ */ React5.createElement(RichTextEditor.OrderedList, null),
|
|
4940
|
+
/* @__PURE__ */ React5.createElement(Menu, { trigger: "hover", openDelay: 200 }, /* @__PURE__ */ React5.createElement(Menu.Target, null, /* @__PURE__ */ React5.createElement(
|
|
4941
4941
|
ActionIcon,
|
|
4942
4942
|
{
|
|
4943
4943
|
variant: "outline",
|
|
@@ -4945,35 +4945,35 @@ function CustomRichTextEditor({
|
|
|
4945
4945
|
color: "#495057",
|
|
4946
4946
|
className: "mrchat-customToolActionItem"
|
|
4947
4947
|
},
|
|
4948
|
-
/* @__PURE__ */
|
|
4949
|
-
)), /* @__PURE__ */
|
|
4948
|
+
/* @__PURE__ */ React5.createElement(IconAlignLeft, { size: 16, stroke: 1.5 })
|
|
4949
|
+
)), /* @__PURE__ */ React5.createElement(Menu.Dropdown, null, /* @__PURE__ */ React5.createElement(
|
|
4950
4950
|
Menu.Item,
|
|
4951
4951
|
{
|
|
4952
4952
|
onClick: () => editor?.chain().focus().setTextAlign("left").run()
|
|
4953
4953
|
},
|
|
4954
|
-
/* @__PURE__ */
|
|
4955
|
-
), /* @__PURE__ */
|
|
4954
|
+
/* @__PURE__ */ React5.createElement(IconAlignLeft, { size: 14 })
|
|
4955
|
+
), /* @__PURE__ */ React5.createElement(
|
|
4956
4956
|
Menu.Item,
|
|
4957
4957
|
{
|
|
4958
4958
|
onClick: () => editor?.chain().focus().setTextAlign("center").run()
|
|
4959
4959
|
},
|
|
4960
|
-
/* @__PURE__ */
|
|
4961
|
-
), /* @__PURE__ */
|
|
4960
|
+
/* @__PURE__ */ React5.createElement(IconAlignCenter, { size: 14 })
|
|
4961
|
+
), /* @__PURE__ */ React5.createElement(
|
|
4962
4962
|
Menu.Item,
|
|
4963
4963
|
{
|
|
4964
4964
|
onClick: () => editor?.chain().focus().setTextAlign("right").run()
|
|
4965
4965
|
},
|
|
4966
|
-
/* @__PURE__ */
|
|
4966
|
+
/* @__PURE__ */ React5.createElement(IconAlignRight, { size: 14 })
|
|
4967
4967
|
))),
|
|
4968
|
-
/* @__PURE__ */
|
|
4969
|
-
), /* @__PURE__ */
|
|
4968
|
+
/* @__PURE__ */ React5.createElement(RichTextEditor.Link, null)
|
|
4969
|
+
), /* @__PURE__ */ React5.createElement(
|
|
4970
4970
|
RichTextEditor.ControlsGroup,
|
|
4971
4971
|
{
|
|
4972
4972
|
className: "mrchat-secondRichTextEditorToolBar"
|
|
4973
4973
|
},
|
|
4974
|
-
/* @__PURE__ */
|
|
4974
|
+
/* @__PURE__ */ React5.createElement(RichTextEditor.ClearFormatting, null)
|
|
4975
4975
|
))),
|
|
4976
|
-
showWarning && /* @__PURE__ */
|
|
4976
|
+
showWarning && /* @__PURE__ */ React5.createElement(
|
|
4977
4977
|
"div",
|
|
4978
4978
|
{
|
|
4979
4979
|
style: {
|
|
@@ -4994,11 +4994,11 @@ function CustomRichTextEditor({
|
|
|
4994
4994
|
|
|
4995
4995
|
// src/components/ChatUserList/ChatUserMessage.tsx
|
|
4996
4996
|
import { useDispatch, useSelector } from "react-redux";
|
|
4997
|
-
import { useEffect as useEffect4, useState as useState4 } from "react";
|
|
4997
|
+
import React8, { useEffect as useEffect4, useState as useState4 } from "react";
|
|
4998
4998
|
import DOMPurify from "dompurify";
|
|
4999
4999
|
|
|
5000
5000
|
// src/components/VirtualizedList/ChatScrollContainer.tsx
|
|
5001
|
-
import
|
|
5001
|
+
import React6, { useRef, useEffect as useEffect2 } from "react";
|
|
5002
5002
|
function ChatScrollContainer({
|
|
5003
5003
|
data: data2,
|
|
5004
5004
|
renderItem,
|
|
@@ -5047,7 +5047,7 @@ function ChatScrollContainer({
|
|
|
5047
5047
|
isFetchingRef.current = false;
|
|
5048
5048
|
}, 0);
|
|
5049
5049
|
};
|
|
5050
|
-
return /* @__PURE__ */
|
|
5050
|
+
return /* @__PURE__ */ React6.createElement(
|
|
5051
5051
|
"div",
|
|
5052
5052
|
{
|
|
5053
5053
|
ref: containerRef,
|
|
@@ -5059,12 +5059,12 @@ function ChatScrollContainer({
|
|
|
5059
5059
|
flexDirection: "column"
|
|
5060
5060
|
}
|
|
5061
5061
|
},
|
|
5062
|
-
data2.map((item, index) => /* @__PURE__ */
|
|
5062
|
+
data2.map((item, index) => /* @__PURE__ */ React6.createElement("div", { key: item?.id || index }, renderItem(item, index)))
|
|
5063
5063
|
);
|
|
5064
5064
|
}
|
|
5065
5065
|
|
|
5066
5066
|
// src/components/UserProfile/UserProfileDrawer.tsx
|
|
5067
|
-
import { useEffect as useEffect3, useState as useState3 } from "react";
|
|
5067
|
+
import React7, { useEffect as useEffect3, useState as useState3 } from "react";
|
|
5068
5068
|
import { Avatar, Text } from "@mantine/core";
|
|
5069
5069
|
import {
|
|
5070
5070
|
IconArrowLeft,
|
|
@@ -5088,14 +5088,14 @@ function UserProfileDrawer({
|
|
|
5088
5088
|
setTimeout(onClose, 250);
|
|
5089
5089
|
};
|
|
5090
5090
|
if (!opened && !visible) return null;
|
|
5091
|
-
return /* @__PURE__ */
|
|
5091
|
+
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("div", { className: "mrchat-overlay", onClick: handleClose }, /* @__PURE__ */ React7.createElement(
|
|
5092
5092
|
"div",
|
|
5093
5093
|
{
|
|
5094
5094
|
className: `${"mrchat-drawer"} ${visible ? "mrchat-open" : "mrchat-close"}`,
|
|
5095
5095
|
onClick: (e) => e.stopPropagation()
|
|
5096
5096
|
},
|
|
5097
|
-
/* @__PURE__ */
|
|
5098
|
-
/* @__PURE__ */
|
|
5097
|
+
/* @__PURE__ */ React7.createElement("div", { className: "mrchat-header" }, /* @__PURE__ */ React7.createElement("div", { className: "mrchat-backBtn", onClick: handleClose }, /* @__PURE__ */ React7.createElement(IconArrowLeft, { size: 20 })), /* @__PURE__ */ React7.createElement(Text, { fw: 600 }, "Contact info")),
|
|
5098
|
+
/* @__PURE__ */ React7.createElement("div", { className: "mrchat-profileSection" }, /* @__PURE__ */ React7.createElement(
|
|
5099
5099
|
Avatar,
|
|
5100
5100
|
{
|
|
5101
5101
|
src: user?.avatar,
|
|
@@ -5104,31 +5104,31 @@ function UserProfileDrawer({
|
|
|
5104
5104
|
style: { cursor: "pointer" },
|
|
5105
5105
|
onClick: () => user?.avatar ? setShowImagePreview(true) : {}
|
|
5106
5106
|
}
|
|
5107
|
-
), /* @__PURE__ */
|
|
5108
|
-
/* @__PURE__ */
|
|
5107
|
+
), /* @__PURE__ */ React7.createElement(Text, { fw: 700, size: "lg", mt: "sm" }, user?.displayName), /* @__PURE__ */ React7.createElement(Text, { size: "sm", c: "dimmed" }, "@", user?.username)),
|
|
5108
|
+
/* @__PURE__ */ React7.createElement("div", { className: "mrchat-actions" }, /* @__PURE__ */ React7.createElement(
|
|
5109
5109
|
"div",
|
|
5110
5110
|
{
|
|
5111
5111
|
className: `${"mrchat-item"} ${"mrchat-itemDanger"}`,
|
|
5112
5112
|
onClick: onDeleteMessages
|
|
5113
5113
|
},
|
|
5114
|
-
/* @__PURE__ */
|
|
5115
|
-
/* @__PURE__ */
|
|
5116
|
-
), /* @__PURE__ */
|
|
5114
|
+
/* @__PURE__ */ React7.createElement(IconTrash, { size: 18 }),
|
|
5115
|
+
/* @__PURE__ */ React7.createElement("span", null, "Delete all messages")
|
|
5116
|
+
), /* @__PURE__ */ React7.createElement(
|
|
5117
5117
|
"div",
|
|
5118
5118
|
{
|
|
5119
5119
|
className: `${"mrchat-item"} ${"mrchat-itemDanger"}`,
|
|
5120
5120
|
onClick: onBlock
|
|
5121
5121
|
},
|
|
5122
|
-
/* @__PURE__ */
|
|
5123
|
-
/* @__PURE__ */
|
|
5122
|
+
/* @__PURE__ */ React7.createElement(IconBan, { size: 18 }),
|
|
5123
|
+
/* @__PURE__ */ React7.createElement("span", null, "Block")
|
|
5124
5124
|
))
|
|
5125
|
-
)), showImagePreview && /* @__PURE__ */
|
|
5125
|
+
)), showImagePreview && /* @__PURE__ */ React7.createElement(
|
|
5126
5126
|
"div",
|
|
5127
5127
|
{
|
|
5128
5128
|
className: "mrchat-imagePreview",
|
|
5129
5129
|
onClick: () => setShowImagePreview(false)
|
|
5130
5130
|
},
|
|
5131
|
-
/* @__PURE__ */
|
|
5131
|
+
/* @__PURE__ */ React7.createElement("img", { src: user?.avatar, alt: "profile" })
|
|
5132
5132
|
));
|
|
5133
5133
|
}
|
|
5134
5134
|
|
|
@@ -5279,13 +5279,13 @@ function ChatUserMessage({
|
|
|
5279
5279
|
deleteMessagesByChatId({ chatId, userId: senderDetails?.userId })
|
|
5280
5280
|
);
|
|
5281
5281
|
};
|
|
5282
|
-
return /* @__PURE__ */
|
|
5282
|
+
return /* @__PURE__ */ React8.createElement("div", { className: "mrchat-mainArea" }, /* @__PURE__ */ React8.createElement("div", { className: "mrchat-chatHeader" }, receiverDetails && /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(
|
|
5283
5283
|
"div",
|
|
5284
5284
|
{
|
|
5285
5285
|
className: "mrchat-receiverInfo",
|
|
5286
5286
|
onClick: () => setShowUserInfo(true)
|
|
5287
5287
|
},
|
|
5288
|
-
receiverDetails?.avatar ? /* @__PURE__ */
|
|
5288
|
+
receiverDetails?.avatar ? /* @__PURE__ */ React8.createElement(Avatar2, { src: receiverDetails.avatar, size: 36, radius: "xl" }) : /* @__PURE__ */ React8.createElement(
|
|
5289
5289
|
Avatar2,
|
|
5290
5290
|
{
|
|
5291
5291
|
key: receiverDetails?.displayName || receiverDetails?.username,
|
|
@@ -5293,16 +5293,16 @@ function ChatUserMessage({
|
|
|
5293
5293
|
color: "initials"
|
|
5294
5294
|
}
|
|
5295
5295
|
),
|
|
5296
|
-
/* @__PURE__ */
|
|
5297
|
-
), /* @__PURE__ */
|
|
5296
|
+
/* @__PURE__ */ React8.createElement(Text2, { fw: 600, size: "md" }, receiverDetails?.displayName || receiverDetails?.username)
|
|
5297
|
+
), /* @__PURE__ */ React8.createElement(Menu2, { shadow: "md", width: 200, position: "bottom-end" }, /* @__PURE__ */ React8.createElement(Menu2.Target, null, /* @__PURE__ */ React8.createElement(IconDotsVertical, { size: 20, style: { cursor: "pointer" } })), /* @__PURE__ */ React8.createElement(Menu2.Dropdown, null, /* @__PURE__ */ React8.createElement(
|
|
5298
5298
|
Menu2.Item,
|
|
5299
5299
|
{
|
|
5300
5300
|
color: "red",
|
|
5301
|
-
leftSection: /* @__PURE__ */
|
|
5301
|
+
leftSection: /* @__PURE__ */ React8.createElement(IconTrash2, { size: 16 }),
|
|
5302
5302
|
onClick: handleDeleteMessages
|
|
5303
5303
|
},
|
|
5304
5304
|
"Delete all messages"
|
|
5305
|
-
), /* @__PURE__ */
|
|
5305
|
+
), /* @__PURE__ */ React8.createElement(Menu2.Item, { color: "red", leftSection: /* @__PURE__ */ React8.createElement(IconBan2, { size: 16 }) }, "Block"))))), /* @__PURE__ */ React8.createElement("div", { className: "mrchat-messageArea" }, isEmpty ? /* @__PURE__ */ React8.createElement("div", { className: "mrchat-emptyState" }, /* @__PURE__ */ React8.createElement("div", { className: "mrchat-encryptionMinimal" }, /* @__PURE__ */ React8.createElement(IconLock, { size: 20, stroke: 1.8 }), /* @__PURE__ */ React8.createElement(Text2, { className: "mrchat-encryptionText", size: "md" }, "End-to-end encrypted"))) : /* @__PURE__ */ React8.createElement(
|
|
5306
5306
|
ChatScrollContainer,
|
|
5307
5307
|
{
|
|
5308
5308
|
data: messages,
|
|
@@ -5336,7 +5336,7 @@ function ChatUserMessage({
|
|
|
5336
5336
|
minute: "2-digit",
|
|
5337
5337
|
hour12: false
|
|
5338
5338
|
});
|
|
5339
|
-
return /* @__PURE__ */
|
|
5339
|
+
return /* @__PURE__ */ React8.createElement("div", { key: item?.id + "_" + index }, showDate && /* @__PURE__ */ React8.createElement("div", { className: "mrchat-dateSeparator" }, formattedDate), /* @__PURE__ */ React8.createElement(
|
|
5340
5340
|
"div",
|
|
5341
5341
|
{
|
|
5342
5342
|
style: {
|
|
@@ -5344,7 +5344,7 @@ function ChatUserMessage({
|
|
|
5344
5344
|
},
|
|
5345
5345
|
className: `${"mrchat-messageBubble"} ${isOutgoing ? "mrchat-outgoing" : "mrchat-incoming"}`
|
|
5346
5346
|
},
|
|
5347
|
-
/* @__PURE__ */
|
|
5347
|
+
/* @__PURE__ */ React8.createElement(
|
|
5348
5348
|
"div",
|
|
5349
5349
|
{
|
|
5350
5350
|
className: "mrchat-messageContent",
|
|
@@ -5353,11 +5353,11 @@ function ChatUserMessage({
|
|
|
5353
5353
|
}
|
|
5354
5354
|
}
|
|
5355
5355
|
),
|
|
5356
|
-
/* @__PURE__ */
|
|
5356
|
+
/* @__PURE__ */ React8.createElement("div", { className: "mrchat-messageTime" }, time)
|
|
5357
5357
|
));
|
|
5358
5358
|
}
|
|
5359
5359
|
}
|
|
5360
|
-
)), (chatId || enableChat) && /* @__PURE__ */
|
|
5360
|
+
)), (chatId || enableChat) && /* @__PURE__ */ React8.createElement("div", { className: "mrchat-inputBar" }, /* @__PURE__ */ React8.createElement(CustomRichTextEditor, { onSubmit: handleSendMessage })), /* @__PURE__ */ React8.createElement(
|
|
5361
5361
|
UserProfileDrawer,
|
|
5362
5362
|
{
|
|
5363
5363
|
opened: showUserInfo,
|
|
@@ -5379,7 +5379,7 @@ function ChatUserMessage({
|
|
|
5379
5379
|
|
|
5380
5380
|
// src/components/ChatUserList/ChatUserList.tsx
|
|
5381
5381
|
import { useDispatch as useDispatch2, useSelector as useSelector2 } from "react-redux";
|
|
5382
|
-
import { useEffect as useEffect5, useState as useState5 } from "react";
|
|
5382
|
+
import React9, { useEffect as useEffect5, useState as useState5 } from "react";
|
|
5383
5383
|
|
|
5384
5384
|
// src/components/ChatUserList/users_list.json
|
|
5385
5385
|
var users_list_default = [
|
|
@@ -6255,7 +6255,7 @@ function ChatUserList() {
|
|
|
6255
6255
|
label: user.displayName || user.username,
|
|
6256
6256
|
user
|
|
6257
6257
|
}));
|
|
6258
|
-
return /* @__PURE__ */
|
|
6258
|
+
return /* @__PURE__ */ React9.createElement("div", { className: "mrchat-chatWrapper" }, /* @__PURE__ */ React9.createElement(
|
|
6259
6259
|
Modal,
|
|
6260
6260
|
{
|
|
6261
6261
|
opened,
|
|
@@ -6267,7 +6267,7 @@ function ChatUserList() {
|
|
|
6267
6267
|
centered: true,
|
|
6268
6268
|
withCloseButton: true
|
|
6269
6269
|
},
|
|
6270
|
-
/* @__PURE__ */
|
|
6270
|
+
/* @__PURE__ */ React9.createElement(
|
|
6271
6271
|
Autocomplete,
|
|
6272
6272
|
{
|
|
6273
6273
|
mb: 12,
|
|
@@ -6286,11 +6286,11 @@ function ChatUserList() {
|
|
|
6286
6286
|
},
|
|
6287
6287
|
renderOption: ({ option }) => {
|
|
6288
6288
|
const user = option.user;
|
|
6289
|
-
return /* @__PURE__ */
|
|
6289
|
+
return /* @__PURE__ */ React9.createElement(Group, { gap: "sm" }, /* @__PURE__ */ React9.createElement(Avatar3, { src: user.avatar, size: 36, radius: "xl" }), /* @__PURE__ */ React9.createElement("div", null, /* @__PURE__ */ React9.createElement(Text3, { size: "sm" }, user.displayName || user.username), user.displayName && /* @__PURE__ */ React9.createElement(Text3, { size: "xs", opacity: 0.5 }, "@", user.username)));
|
|
6290
6290
|
}
|
|
6291
6291
|
}
|
|
6292
6292
|
),
|
|
6293
|
-
/* @__PURE__ */
|
|
6293
|
+
/* @__PURE__ */ React9.createElement(
|
|
6294
6294
|
Autocomplete,
|
|
6295
6295
|
{
|
|
6296
6296
|
mb: 12,
|
|
@@ -6309,11 +6309,11 @@ function ChatUserList() {
|
|
|
6309
6309
|
},
|
|
6310
6310
|
renderOption: ({ option }) => {
|
|
6311
6311
|
const user = option.user;
|
|
6312
|
-
return /* @__PURE__ */
|
|
6312
|
+
return /* @__PURE__ */ React9.createElement(Group, { gap: "sm" }, /* @__PURE__ */ React9.createElement(Avatar3, { src: user.avatar, size: 36, radius: "xl" }), /* @__PURE__ */ React9.createElement("div", null, /* @__PURE__ */ React9.createElement(Text3, { size: "sm" }, user.displayName || user.username), user.displayName && /* @__PURE__ */ React9.createElement(Text3, { size: "xs", opacity: 0.5 }, "@", user.username)));
|
|
6313
6313
|
}
|
|
6314
6314
|
}
|
|
6315
6315
|
),
|
|
6316
|
-
/* @__PURE__ */
|
|
6316
|
+
/* @__PURE__ */ React9.createElement(
|
|
6317
6317
|
Button,
|
|
6318
6318
|
{
|
|
6319
6319
|
fullWidth: true,
|
|
@@ -6322,7 +6322,7 @@ function ChatUserList() {
|
|
|
6322
6322
|
},
|
|
6323
6323
|
"Start Chat"
|
|
6324
6324
|
)
|
|
6325
|
-
), /* @__PURE__ */
|
|
6325
|
+
), /* @__PURE__ */ React9.createElement("div", { className: "mrchat-chatContainer" }, /* @__PURE__ */ React9.createElement("div", { className: "mrchat-sidebar" }, /* @__PURE__ */ React9.createElement("div", { className: "mrchat-sidebarTop" }, /* @__PURE__ */ React9.createElement("div", { className: "mrchat-topBar" }, /* @__PURE__ */ React9.createElement(Text3, { size: "lg", fw: 600 }, "MrChat"), /* @__PURE__ */ React9.createElement("div", { className: "mrchat-topActions" }, /* @__PURE__ */ React9.createElement(
|
|
6326
6326
|
ActionIcon2,
|
|
6327
6327
|
{
|
|
6328
6328
|
variant: "subtle",
|
|
@@ -6332,15 +6332,15 @@ function ChatUserList() {
|
|
|
6332
6332
|
},
|
|
6333
6333
|
radius: "lg"
|
|
6334
6334
|
},
|
|
6335
|
-
/* @__PURE__ */
|
|
6336
|
-
)))), /* @__PURE__ */
|
|
6335
|
+
/* @__PURE__ */ React9.createElement(IconPlus, { size: 20, stroke: 3 })
|
|
6336
|
+
)))), /* @__PURE__ */ React9.createElement(Text3, { size: "xs", c: "dimmed", mt: "sm", mb: "xs", ml: 12 }, "All Messages"), /* @__PURE__ */ React9.createElement("div", { className: "mrchat-scrollWrapper" }, /* @__PURE__ */ React9.createElement(
|
|
6337
6337
|
VirtualizedList,
|
|
6338
6338
|
{
|
|
6339
6339
|
data: chatList?.rows?.data || [],
|
|
6340
6340
|
endReached: loadMoreChats,
|
|
6341
6341
|
itemContent: (_, item) => {
|
|
6342
6342
|
const isActive = item.chatId === chatId;
|
|
6343
|
-
return /* @__PURE__ */
|
|
6343
|
+
return /* @__PURE__ */ React9.createElement(
|
|
6344
6344
|
"div",
|
|
6345
6345
|
{
|
|
6346
6346
|
className: `${"mrchat-chatItem"} ${isActive ? "mrchat-activeChatItem" : ""}`,
|
|
@@ -6349,7 +6349,7 @@ function ChatUserList() {
|
|
|
6349
6349
|
handleJoinChat(item);
|
|
6350
6350
|
}
|
|
6351
6351
|
},
|
|
6352
|
-
item.avatar ? /* @__PURE__ */
|
|
6352
|
+
item.avatar ? /* @__PURE__ */ React9.createElement(Avatar3, { src: item.avatar, size: 36, radius: "xl" }) : /* @__PURE__ */ React9.createElement(
|
|
6353
6353
|
Avatar3,
|
|
6354
6354
|
{
|
|
6355
6355
|
key: item.displayName || item.username,
|
|
@@ -6357,7 +6357,7 @@ function ChatUserList() {
|
|
|
6357
6357
|
color: "initials"
|
|
6358
6358
|
}
|
|
6359
6359
|
),
|
|
6360
|
-
/* @__PURE__ */
|
|
6360
|
+
/* @__PURE__ */ React9.createElement("div", { className: "mrchat-chatInfo" }, /* @__PURE__ */ React9.createElement(Text3, { className: "mrchat-chatLabelItem", truncate: true }, item.displayName || item.username), item.unreadCount > 0 && /* @__PURE__ */ React9.createElement("div", { className: "mrchat-unreadBadge" }, item.unreadCount || 10), /* @__PURE__ */ React9.createElement("div", { className: "mrchat-messagePreview" }, /* @__PURE__ */ React9.createElement(
|
|
6361
6361
|
Text3,
|
|
6362
6362
|
{
|
|
6363
6363
|
truncate: true,
|
|
@@ -6367,7 +6367,7 @@ function ChatUserList() {
|
|
|
6367
6367
|
className: "mrchat-messagePreviewContent"
|
|
6368
6368
|
},
|
|
6369
6369
|
stripHtml(DOMPurify2.sanitize(item.message))
|
|
6370
|
-
), /* @__PURE__ */
|
|
6370
|
+
), /* @__PURE__ */ React9.createElement(
|
|
6371
6371
|
Text3,
|
|
6372
6372
|
{
|
|
6373
6373
|
size: "xs",
|
|
@@ -6379,7 +6379,7 @@ function ChatUserList() {
|
|
|
6379
6379
|
);
|
|
6380
6380
|
}
|
|
6381
6381
|
}
|
|
6382
|
-
))), /* @__PURE__ */
|
|
6382
|
+
))), /* @__PURE__ */ React9.createElement(
|
|
6383
6383
|
ChatUserMessage,
|
|
6384
6384
|
{
|
|
6385
6385
|
chatId,
|
|
@@ -6403,7 +6403,7 @@ function ChatUserList() {
|
|
|
6403
6403
|
function MrChat(props) {
|
|
6404
6404
|
const [primaryColor] = useState6("customBrand");
|
|
6405
6405
|
const theme = createAppTheme(primaryColor);
|
|
6406
|
-
return /* @__PURE__ */
|
|
6406
|
+
return /* @__PURE__ */ React10.createElement(ReduxProvider, null, /* @__PURE__ */ React10.createElement(SocketProvider, null, /* @__PURE__ */ React10.createElement(MantineProvider, { defaultColorScheme: "light", theme }, /* @__PURE__ */ React10.createElement(Notifications, null), /* @__PURE__ */ React10.createElement(ChatUserList, { ...props }))));
|
|
6407
6407
|
}
|
|
6408
6408
|
export {
|
|
6409
6409
|
MrChat
|