mr-chat-bird 1.0.12 → 1.0.13
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.css +52 -36
- package/dist/index.d.mts +13 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +84 -740
- package/dist/index.mjs +92 -750
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4804,12 +4804,6 @@ function EmojiPickerPopover({
|
|
|
4804
4804
|
);
|
|
4805
4805
|
}
|
|
4806
4806
|
|
|
4807
|
-
// src/utils/icons/richText/TextFormat.svg
|
|
4808
|
-
var TextFormat_default = "./TextFormat-R4ZVDKE2.svg";
|
|
4809
|
-
|
|
4810
|
-
// src/utils/icons/richText/AddReaction.svg
|
|
4811
|
-
var AddReaction_default = "./AddReaction-DCDVOMZB.svg";
|
|
4812
|
-
|
|
4813
4807
|
// src/components/RichTextEditor/EmojiNode.tsx
|
|
4814
4808
|
var EmojiNode = Node3.create({
|
|
4815
4809
|
name: "emoji",
|
|
@@ -4911,10 +4905,9 @@ function CustomRichTextEditor({
|
|
|
4911
4905
|
radius: "lg",
|
|
4912
4906
|
variant: "subtle",
|
|
4913
4907
|
"aria-label": "add",
|
|
4914
|
-
color: "#333",
|
|
4915
4908
|
className: "mrchat-mainActionEmojiIcon"
|
|
4916
4909
|
},
|
|
4917
|
-
/* @__PURE__ */ import_react4.default.createElement(
|
|
4910
|
+
/* @__PURE__ */ import_react4.default.createElement(import_icons_react.IconMoodPlus, null)
|
|
4918
4911
|
)
|
|
4919
4912
|
}
|
|
4920
4913
|
), /* @__PURE__ */ import_react4.default.createElement(
|
|
@@ -4923,11 +4916,10 @@ function CustomRichTextEditor({
|
|
|
4923
4916
|
radius: "lg",
|
|
4924
4917
|
variant: "subtle",
|
|
4925
4918
|
"aria-label": "text_format",
|
|
4926
|
-
color: "#333",
|
|
4927
4919
|
className: "mrchat-mainTextFormatIcon",
|
|
4928
4920
|
onClick: () => setShowToolbar((prev) => !prev)
|
|
4929
4921
|
},
|
|
4930
|
-
/* @__PURE__ */ import_react4.default.createElement(
|
|
4922
|
+
/* @__PURE__ */ import_react4.default.createElement(import_icons_react.IconTextColor, { stroke: 1.7 })
|
|
4931
4923
|
), /* @__PURE__ */ import_react4.default.createElement(
|
|
4932
4924
|
import_core5.ActionIcon,
|
|
4933
4925
|
{
|
|
@@ -4950,7 +4942,6 @@ function CustomRichTextEditor({
|
|
|
4950
4942
|
{
|
|
4951
4943
|
variant: "outline",
|
|
4952
4944
|
size: "md",
|
|
4953
|
-
color: "#495057",
|
|
4954
4945
|
className: "mrchat-customToolActionItem"
|
|
4955
4946
|
},
|
|
4956
4947
|
/* @__PURE__ */ import_react4.default.createElement(import_icons_react.IconAlignLeft, { size: 16, stroke: 1.5 })
|
|
@@ -5108,24 +5099,7 @@ function UserProfileDrawer({
|
|
|
5108
5099
|
style: { cursor: "pointer" },
|
|
5109
5100
|
onClick: () => user?.avatar ? setShowImagePreview(true) : {}
|
|
5110
5101
|
}
|
|
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
|
-
"div",
|
|
5114
|
-
{
|
|
5115
|
-
className: `${"mrchat-item"} ${"mrchat-itemDanger"}`,
|
|
5116
|
-
onClick: onDeleteMessages
|
|
5117
|
-
},
|
|
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
|
-
"div",
|
|
5122
|
-
{
|
|
5123
|
-
className: `${"mrchat-item"} ${"mrchat-itemDanger"}`,
|
|
5124
|
-
onClick: onBlock
|
|
5125
|
-
},
|
|
5126
|
-
/* @__PURE__ */ import_react7.default.createElement(import_icons_react2.IconBan, { size: 18 }),
|
|
5127
|
-
/* @__PURE__ */ import_react7.default.createElement("span", null, "Block")
|
|
5128
|
-
))
|
|
5102
|
+
), /* @__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))
|
|
5129
5103
|
)), showImagePreview && /* @__PURE__ */ import_react7.default.createElement(
|
|
5130
5104
|
"div",
|
|
5131
5105
|
{
|
|
@@ -5298,15 +5272,7 @@ function ChatUserMessage({
|
|
|
5298
5272
|
}
|
|
5299
5273
|
),
|
|
5300
5274
|
/* @__PURE__ */ import_react8.default.createElement(import_core7.Text, { fw: 600, size: "md" }, receiverDetails?.displayName || receiverDetails?.username)
|
|
5301
|
-
), /* @__PURE__ */ import_react8.default.createElement(
|
|
5302
|
-
import_core7.Menu.Item,
|
|
5303
|
-
{
|
|
5304
|
-
color: "red",
|
|
5305
|
-
leftSection: /* @__PURE__ */ import_react8.default.createElement(import_icons_react3.IconTrash, { size: 16 }),
|
|
5306
|
-
onClick: handleDeleteMessages
|
|
5307
|
-
},
|
|
5308
|
-
"Delete all messages"
|
|
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(
|
|
5275
|
+
))), /* @__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
5276
|
ChatScrollContainer,
|
|
5311
5277
|
{
|
|
5312
5278
|
data: messages,
|
|
@@ -5385,656 +5351,6 @@ function ChatUserMessage({
|
|
|
5385
5351
|
var import_react_redux3 = require("react-redux");
|
|
5386
5352
|
var import_react10 = __toESM(require("react"));
|
|
5387
5353
|
|
|
5388
|
-
// src/components/ChatUserList/users_list.json
|
|
5389
|
-
var users_list_default = [
|
|
5390
|
-
{
|
|
5391
|
-
userId: "7036421",
|
|
5392
|
-
username: "paul53",
|
|
5393
|
-
displayName: "Scott Lamb",
|
|
5394
|
-
avatar: "https://i.pravatar.cc/150?img=1"
|
|
5395
|
-
},
|
|
5396
|
-
{
|
|
5397
|
-
userId: "7751072",
|
|
5398
|
-
username: "ysuarez",
|
|
5399
|
-
displayName: "Joseph Jenkins",
|
|
5400
|
-
email: "bethanyrivas@gordon-lopez.org"
|
|
5401
|
-
},
|
|
5402
|
-
{
|
|
5403
|
-
userId: "4741636",
|
|
5404
|
-
username: "trevoracevedo",
|
|
5405
|
-
displayName: "Kristen Lynch",
|
|
5406
|
-
avatar: "https://i.pravatar.cc/150?img=3"
|
|
5407
|
-
},
|
|
5408
|
-
{
|
|
5409
|
-
userId: "8760149",
|
|
5410
|
-
username: "denisereeves",
|
|
5411
|
-
displayName: "Douglas Hernandez",
|
|
5412
|
-
email: "cwalker@hotmail.com",
|
|
5413
|
-
avatar: "https://i.pravatar.cc/150?img=4"
|
|
5414
|
-
},
|
|
5415
|
-
{
|
|
5416
|
-
userId: "7860290",
|
|
5417
|
-
username: "tiffany20",
|
|
5418
|
-
displayName: "Lisa Rodriguez",
|
|
5419
|
-
avatar: "https://i.pravatar.cc/150?img=5"
|
|
5420
|
-
},
|
|
5421
|
-
{
|
|
5422
|
-
userId: "5779060",
|
|
5423
|
-
username: "kathleenaustin",
|
|
5424
|
-
avatar: "https://i.pravatar.cc/150?img=6"
|
|
5425
|
-
},
|
|
5426
|
-
{
|
|
5427
|
-
userId: "3703452",
|
|
5428
|
-
username: "kimberlyvelazquez",
|
|
5429
|
-
displayName: "Stephen Bates",
|
|
5430
|
-
avatar: "https://i.pravatar.cc/150?img=7"
|
|
5431
|
-
},
|
|
5432
|
-
{
|
|
5433
|
-
userId: "6411379",
|
|
5434
|
-
username: "gmueller"
|
|
5435
|
-
},
|
|
5436
|
-
{
|
|
5437
|
-
userId: "2237280",
|
|
5438
|
-
username: "pscott",
|
|
5439
|
-
displayName: "Amanda Fry",
|
|
5440
|
-
avatar: "https://i.pravatar.cc/150?img=9"
|
|
5441
|
-
},
|
|
5442
|
-
{
|
|
5443
|
-
userId: "4656816",
|
|
5444
|
-
username: "moranjonathan",
|
|
5445
|
-
displayName: "John White",
|
|
5446
|
-
avatar: "https://i.pravatar.cc/150?img=10"
|
|
5447
|
-
},
|
|
5448
|
-
{
|
|
5449
|
-
userId: "3190200",
|
|
5450
|
-
username: "rnelson",
|
|
5451
|
-
displayName: "Kristi Cardenas",
|
|
5452
|
-
email: "corey03@bray.biz",
|
|
5453
|
-
avatar: "https://i.pravatar.cc/150?img=11"
|
|
5454
|
-
},
|
|
5455
|
-
{
|
|
5456
|
-
userId: "5440578",
|
|
5457
|
-
username: "harringtonkimberly",
|
|
5458
|
-
displayName: "John Crosby",
|
|
5459
|
-
avatar: "https://i.pravatar.cc/150?img=12"
|
|
5460
|
-
},
|
|
5461
|
-
{
|
|
5462
|
-
userId: "4885496",
|
|
5463
|
-
username: "dylan10",
|
|
5464
|
-
displayName: "Christine Carson",
|
|
5465
|
-
email: "joshua84@harrison-booth.com",
|
|
5466
|
-
avatar: "https://i.pravatar.cc/150?img=13"
|
|
5467
|
-
},
|
|
5468
|
-
{
|
|
5469
|
-
userId: "4634667",
|
|
5470
|
-
username: "angelaramirez",
|
|
5471
|
-
displayName: "Michael Harris",
|
|
5472
|
-
email: "josephlopez@white.com",
|
|
5473
|
-
avatar: "https://i.pravatar.cc/150?img=14"
|
|
5474
|
-
},
|
|
5475
|
-
{
|
|
5476
|
-
userId: "5702972",
|
|
5477
|
-
username: "itran",
|
|
5478
|
-
displayName: "Jennifer Johnson",
|
|
5479
|
-
email: "milesryan@hotmail.com",
|
|
5480
|
-
avatar: "https://i.pravatar.cc/150?img=15"
|
|
5481
|
-
},
|
|
5482
|
-
{
|
|
5483
|
-
userId: "2785214",
|
|
5484
|
-
username: "conniebarr",
|
|
5485
|
-
displayName: "Haley Duffy",
|
|
5486
|
-
email: "watkinsstephanie@yahoo.com",
|
|
5487
|
-
avatar: "https://i.pravatar.cc/150?img=16"
|
|
5488
|
-
},
|
|
5489
|
-
{
|
|
5490
|
-
userId: "6435046",
|
|
5491
|
-
username: "brandon29",
|
|
5492
|
-
displayName: "Max Stein",
|
|
5493
|
-
avatar: "https://i.pravatar.cc/150?img=17"
|
|
5494
|
-
},
|
|
5495
|
-
{
|
|
5496
|
-
userId: "1446780",
|
|
5497
|
-
username: "imontgomery",
|
|
5498
|
-
displayName: "Megan Ross",
|
|
5499
|
-
avatar: "https://i.pravatar.cc/150?img=18"
|
|
5500
|
-
},
|
|
5501
|
-
{
|
|
5502
|
-
userId: "8563828",
|
|
5503
|
-
username: "martinmcdaniel",
|
|
5504
|
-
displayName: "Cynthia Allen",
|
|
5505
|
-
avatar: "https://i.pravatar.cc/150?img=19"
|
|
5506
|
-
},
|
|
5507
|
-
{
|
|
5508
|
-
userId: "6408653",
|
|
5509
|
-
username: "jasonbooth",
|
|
5510
|
-
displayName: "Jesse Hobbs",
|
|
5511
|
-
avatar: "https://i.pravatar.cc/150?img=20"
|
|
5512
|
-
},
|
|
5513
|
-
{
|
|
5514
|
-
userId: "1882055",
|
|
5515
|
-
username: "qparker",
|
|
5516
|
-
displayName: "Teresa Romero",
|
|
5517
|
-
email: "gillespieheather@yahoo.com",
|
|
5518
|
-
avatar: "https://i.pravatar.cc/150?img=21"
|
|
5519
|
-
},
|
|
5520
|
-
{
|
|
5521
|
-
userId: "9073447",
|
|
5522
|
-
username: "williamsanchez",
|
|
5523
|
-
displayName: "Michael Yang",
|
|
5524
|
-
avatar: "https://i.pravatar.cc/150?img=22"
|
|
5525
|
-
},
|
|
5526
|
-
{
|
|
5527
|
-
userId: "2740582",
|
|
5528
|
-
username: "caroladams",
|
|
5529
|
-
displayName: "Sara Burgess",
|
|
5530
|
-
email: "tdawson@davis-cruz.biz",
|
|
5531
|
-
avatar: "https://i.pravatar.cc/150?img=23"
|
|
5532
|
-
},
|
|
5533
|
-
{
|
|
5534
|
-
userId: "8800791",
|
|
5535
|
-
username: "daniellewillis",
|
|
5536
|
-
displayName: "Kristin Huerta",
|
|
5537
|
-
email: "johnsonpeter@yahoo.com",
|
|
5538
|
-
avatar: "https://i.pravatar.cc/150?img=24"
|
|
5539
|
-
},
|
|
5540
|
-
{
|
|
5541
|
-
userId: "6312408",
|
|
5542
|
-
username: "kochveronica",
|
|
5543
|
-
displayName: "Shelia Ellison",
|
|
5544
|
-
avatar: "https://i.pravatar.cc/150?img=25"
|
|
5545
|
-
},
|
|
5546
|
-
{
|
|
5547
|
-
userId: "3930592",
|
|
5548
|
-
username: "josephcox",
|
|
5549
|
-
displayName: "David Warren",
|
|
5550
|
-
email: "smithjenny@yahoo.com",
|
|
5551
|
-
avatar: "https://i.pravatar.cc/150?img=26"
|
|
5552
|
-
},
|
|
5553
|
-
{
|
|
5554
|
-
userId: "5745377",
|
|
5555
|
-
username: "westjennifer",
|
|
5556
|
-
displayName: "Michelle Simmons",
|
|
5557
|
-
email: "christina76@taylor.biz",
|
|
5558
|
-
avatar: "https://i.pravatar.cc/150?img=27"
|
|
5559
|
-
},
|
|
5560
|
-
{
|
|
5561
|
-
userId: "1233544",
|
|
5562
|
-
username: "christian34",
|
|
5563
|
-
displayName: "Jessica Reynolds MD",
|
|
5564
|
-
avatar: "https://i.pravatar.cc/150?img=28"
|
|
5565
|
-
},
|
|
5566
|
-
{
|
|
5567
|
-
userId: "3076089",
|
|
5568
|
-
username: "wrightsabrina",
|
|
5569
|
-
displayName: "Barbara Patterson",
|
|
5570
|
-
email: "danieldunn@keller-perez.org",
|
|
5571
|
-
avatar: "https://i.pravatar.cc/150?img=29"
|
|
5572
|
-
},
|
|
5573
|
-
{
|
|
5574
|
-
userId: "4076079",
|
|
5575
|
-
username: "reidlinda",
|
|
5576
|
-
displayName: "Emily Wheeler",
|
|
5577
|
-
avatar: "https://i.pravatar.cc/150?img=30"
|
|
5578
|
-
},
|
|
5579
|
-
{
|
|
5580
|
-
userId: "1910143",
|
|
5581
|
-
username: "gking",
|
|
5582
|
-
displayName: "Linda White",
|
|
5583
|
-
email: "nichole74@yahoo.com",
|
|
5584
|
-
avatar: "https://i.pravatar.cc/150?img=31"
|
|
5585
|
-
},
|
|
5586
|
-
{
|
|
5587
|
-
userId: "6768563",
|
|
5588
|
-
username: "sextonnicholas",
|
|
5589
|
-
displayName: "Jessica Lucas",
|
|
5590
|
-
email: "zdiaz@thomas.net",
|
|
5591
|
-
avatar: "https://i.pravatar.cc/150?img=32"
|
|
5592
|
-
},
|
|
5593
|
-
{
|
|
5594
|
-
userId: "2581511",
|
|
5595
|
-
username: "donnahorton",
|
|
5596
|
-
displayName: "Jesus Aguirre",
|
|
5597
|
-
email: "osbornepriscilla@gmail.com",
|
|
5598
|
-
avatar: "https://i.pravatar.cc/150?img=33"
|
|
5599
|
-
},
|
|
5600
|
-
{
|
|
5601
|
-
userId: "9815769",
|
|
5602
|
-
username: "hernandezjoseph",
|
|
5603
|
-
displayName: "Anne Holden MD",
|
|
5604
|
-
avatar: "https://i.pravatar.cc/150?img=34"
|
|
5605
|
-
},
|
|
5606
|
-
{
|
|
5607
|
-
userId: "8020976",
|
|
5608
|
-
username: "michellestuart",
|
|
5609
|
-
displayName: "Traci Cunningham",
|
|
5610
|
-
email: "lgonzalez@gmail.com",
|
|
5611
|
-
avatar: "https://i.pravatar.cc/150?img=35"
|
|
5612
|
-
},
|
|
5613
|
-
{
|
|
5614
|
-
userId: "3915464",
|
|
5615
|
-
username: "vdixon",
|
|
5616
|
-
displayName: "Mr. Steven Davis",
|
|
5617
|
-
avatar: "https://i.pravatar.cc/150?img=36"
|
|
5618
|
-
},
|
|
5619
|
-
{
|
|
5620
|
-
userId: "1859539",
|
|
5621
|
-
username: "rodriguezjoshua",
|
|
5622
|
-
displayName: "James Anderson",
|
|
5623
|
-
avatar: "https://i.pravatar.cc/150?img=37"
|
|
5624
|
-
},
|
|
5625
|
-
{
|
|
5626
|
-
userId: "1905847",
|
|
5627
|
-
username: "randallvincent",
|
|
5628
|
-
displayName: "Matthew Roberts",
|
|
5629
|
-
email: "sharon26@cooper.com",
|
|
5630
|
-
avatar: "https://i.pravatar.cc/150?img=38"
|
|
5631
|
-
},
|
|
5632
|
-
{
|
|
5633
|
-
userId: "4977720",
|
|
5634
|
-
username: "kentgarcia",
|
|
5635
|
-
displayName: "Francis Love",
|
|
5636
|
-
avatar: "https://i.pravatar.cc/150?img=39"
|
|
5637
|
-
},
|
|
5638
|
-
{
|
|
5639
|
-
userId: "6947604",
|
|
5640
|
-
username: "rbeard",
|
|
5641
|
-
displayName: "Sheila Harper",
|
|
5642
|
-
email: "kristin42@benson.info",
|
|
5643
|
-
avatar: "https://i.pravatar.cc/150?img=40"
|
|
5644
|
-
},
|
|
5645
|
-
{
|
|
5646
|
-
userId: "8208627",
|
|
5647
|
-
username: "kramerbenjamin",
|
|
5648
|
-
displayName: "Gregory Boyd",
|
|
5649
|
-
avatar: "https://i.pravatar.cc/150?img=41"
|
|
5650
|
-
},
|
|
5651
|
-
{
|
|
5652
|
-
userId: "4501323",
|
|
5653
|
-
username: "dianamartinez",
|
|
5654
|
-
displayName: "John Johnson",
|
|
5655
|
-
avatar: "https://i.pravatar.cc/150?img=42"
|
|
5656
|
-
},
|
|
5657
|
-
{
|
|
5658
|
-
userId: "4342767",
|
|
5659
|
-
username: "kimjoe",
|
|
5660
|
-
displayName: "Charles Conner",
|
|
5661
|
-
avatar: "https://i.pravatar.cc/150?img=43"
|
|
5662
|
-
},
|
|
5663
|
-
{
|
|
5664
|
-
userId: "2573585",
|
|
5665
|
-
username: "deniseward",
|
|
5666
|
-
displayName: "Gabrielle Garcia",
|
|
5667
|
-
avatar: "https://i.pravatar.cc/150?img=44"
|
|
5668
|
-
},
|
|
5669
|
-
{
|
|
5670
|
-
userId: "9792211",
|
|
5671
|
-
username: "williamsmichael",
|
|
5672
|
-
displayName: "Diana Jones",
|
|
5673
|
-
email: "lpena@wilson.com",
|
|
5674
|
-
avatar: "https://i.pravatar.cc/150?img=45"
|
|
5675
|
-
},
|
|
5676
|
-
{
|
|
5677
|
-
userId: "6368087",
|
|
5678
|
-
username: "nathaniel88",
|
|
5679
|
-
displayName: "Travis Allen",
|
|
5680
|
-
email: "jon72@hotmail.com",
|
|
5681
|
-
avatar: "https://i.pravatar.cc/150?img=46"
|
|
5682
|
-
},
|
|
5683
|
-
{
|
|
5684
|
-
userId: "7706511",
|
|
5685
|
-
username: "ireed",
|
|
5686
|
-
displayName: "Tracy Sanchez",
|
|
5687
|
-
avatar: "https://i.pravatar.cc/150?img=47"
|
|
5688
|
-
},
|
|
5689
|
-
{
|
|
5690
|
-
userId: "6860644",
|
|
5691
|
-
username: "fyoder",
|
|
5692
|
-
displayName: "Linda Kemp",
|
|
5693
|
-
email: "amandacarr@yahoo.com",
|
|
5694
|
-
avatar: "https://i.pravatar.cc/150?img=48"
|
|
5695
|
-
},
|
|
5696
|
-
{
|
|
5697
|
-
userId: "5134565",
|
|
5698
|
-
username: "bernardpaul",
|
|
5699
|
-
displayName: "Jessica Perry",
|
|
5700
|
-
email: "pearsonann@hogan-miller.net",
|
|
5701
|
-
avatar: "https://i.pravatar.cc/150?img=49"
|
|
5702
|
-
},
|
|
5703
|
-
{
|
|
5704
|
-
userId: "9375192",
|
|
5705
|
-
username: "hernandezarthur",
|
|
5706
|
-
displayName: "Collin Lynn",
|
|
5707
|
-
email: "normanholland@morales.com",
|
|
5708
|
-
avatar: "https://i.pravatar.cc/150?img=50"
|
|
5709
|
-
},
|
|
5710
|
-
{
|
|
5711
|
-
userId: "4419504",
|
|
5712
|
-
username: "kennethortega",
|
|
5713
|
-
displayName: "David Sims",
|
|
5714
|
-
avatar: "https://i.pravatar.cc/150?img=51"
|
|
5715
|
-
},
|
|
5716
|
-
{
|
|
5717
|
-
userId: "8710391",
|
|
5718
|
-
username: "fmccarthy",
|
|
5719
|
-
displayName: "Victoria Fletcher",
|
|
5720
|
-
email: "jillianberry@thompson-simpson.com",
|
|
5721
|
-
avatar: "https://i.pravatar.cc/150?img=52"
|
|
5722
|
-
},
|
|
5723
|
-
{
|
|
5724
|
-
userId: "4125262",
|
|
5725
|
-
username: "youngjulie",
|
|
5726
|
-
displayName: "James Bentley",
|
|
5727
|
-
avatar: "https://i.pravatar.cc/150?img=53"
|
|
5728
|
-
},
|
|
5729
|
-
{
|
|
5730
|
-
userId: "5874590",
|
|
5731
|
-
username: "harrisonalexandria",
|
|
5732
|
-
displayName: "Michelle Reyes",
|
|
5733
|
-
email: "pcole@yahoo.com",
|
|
5734
|
-
avatar: "https://i.pravatar.cc/150?img=54"
|
|
5735
|
-
},
|
|
5736
|
-
{
|
|
5737
|
-
userId: "1171541",
|
|
5738
|
-
username: "katherine38",
|
|
5739
|
-
displayName: "Mary Thomas",
|
|
5740
|
-
avatar: "https://i.pravatar.cc/150?img=55"
|
|
5741
|
-
},
|
|
5742
|
-
{
|
|
5743
|
-
userId: "6212527",
|
|
5744
|
-
username: "molson",
|
|
5745
|
-
displayName: "Emily Horne",
|
|
5746
|
-
email: "tmiddleton@yahoo.com",
|
|
5747
|
-
avatar: "https://i.pravatar.cc/150?img=56"
|
|
5748
|
-
},
|
|
5749
|
-
{
|
|
5750
|
-
userId: "1520546",
|
|
5751
|
-
username: "raymondheidi",
|
|
5752
|
-
displayName: "Dr. Timothy Henry",
|
|
5753
|
-
email: "charlesporter@alexander-douglas.com",
|
|
5754
|
-
avatar: "https://i.pravatar.cc/150?img=57"
|
|
5755
|
-
},
|
|
5756
|
-
{
|
|
5757
|
-
userId: "8695422",
|
|
5758
|
-
username: "yperez",
|
|
5759
|
-
displayName: "Matthew Gould",
|
|
5760
|
-
email: "alexanderwilliams@gmail.com",
|
|
5761
|
-
avatar: "https://i.pravatar.cc/150?img=58"
|
|
5762
|
-
},
|
|
5763
|
-
{
|
|
5764
|
-
userId: "1576474",
|
|
5765
|
-
username: "levinebrandon",
|
|
5766
|
-
displayName: "Steven Jones",
|
|
5767
|
-
email: "james05@stephenson-long.com",
|
|
5768
|
-
avatar: "https://i.pravatar.cc/150?img=59"
|
|
5769
|
-
},
|
|
5770
|
-
{
|
|
5771
|
-
userId: "3764960",
|
|
5772
|
-
username: "jeremyhuynh",
|
|
5773
|
-
displayName: "Veronica Martinez",
|
|
5774
|
-
avatar: "https://i.pravatar.cc/150?img=60"
|
|
5775
|
-
},
|
|
5776
|
-
{
|
|
5777
|
-
userId: "7813766",
|
|
5778
|
-
username: "marshallricky",
|
|
5779
|
-
displayName: "Thomas Martin",
|
|
5780
|
-
email: "todd46@yahoo.com",
|
|
5781
|
-
avatar: "https://i.pravatar.cc/150?img=61"
|
|
5782
|
-
},
|
|
5783
|
-
{
|
|
5784
|
-
userId: "3265121",
|
|
5785
|
-
username: "jessicaoconnell",
|
|
5786
|
-
displayName: "David Hoover",
|
|
5787
|
-
email: "jennifer58@hotmail.com",
|
|
5788
|
-
avatar: "https://i.pravatar.cc/150?img=62"
|
|
5789
|
-
},
|
|
5790
|
-
{
|
|
5791
|
-
userId: "8177761",
|
|
5792
|
-
username: "michaelsparks",
|
|
5793
|
-
displayName: "Jeffrey Hoffman",
|
|
5794
|
-
avatar: "https://i.pravatar.cc/150?img=63"
|
|
5795
|
-
},
|
|
5796
|
-
{
|
|
5797
|
-
userId: "5212768",
|
|
5798
|
-
username: "gomezjames",
|
|
5799
|
-
displayName: "Jennifer Shaw",
|
|
5800
|
-
avatar: "https://i.pravatar.cc/150?img=64"
|
|
5801
|
-
},
|
|
5802
|
-
{
|
|
5803
|
-
userId: "2316645",
|
|
5804
|
-
username: "timothylopez",
|
|
5805
|
-
displayName: "Alexander Hicks",
|
|
5806
|
-
email: "sandrasmith@yahoo.com",
|
|
5807
|
-
avatar: "https://i.pravatar.cc/150?img=65"
|
|
5808
|
-
},
|
|
5809
|
-
{
|
|
5810
|
-
userId: "2582937",
|
|
5811
|
-
username: "reynoldsbrad",
|
|
5812
|
-
displayName: "Theresa Willis",
|
|
5813
|
-
avatar: "https://i.pravatar.cc/150?img=66"
|
|
5814
|
-
},
|
|
5815
|
-
{
|
|
5816
|
-
userId: "1463707",
|
|
5817
|
-
username: "othompson",
|
|
5818
|
-
displayName: "Lauren Holmes",
|
|
5819
|
-
email: "charles40@hamilton-johnson.com",
|
|
5820
|
-
avatar: "https://i.pravatar.cc/150?img=67"
|
|
5821
|
-
},
|
|
5822
|
-
{
|
|
5823
|
-
userId: "2368693",
|
|
5824
|
-
username: "dholland",
|
|
5825
|
-
displayName: "Alexandra Hansen",
|
|
5826
|
-
email: "annlivingston@davis-spencer.com",
|
|
5827
|
-
avatar: "https://i.pravatar.cc/150?img=68"
|
|
5828
|
-
},
|
|
5829
|
-
{
|
|
5830
|
-
userId: "6792547",
|
|
5831
|
-
username: "nataliehenry",
|
|
5832
|
-
displayName: "Brian Henson",
|
|
5833
|
-
avatar: "https://i.pravatar.cc/150?img=69"
|
|
5834
|
-
},
|
|
5835
|
-
{
|
|
5836
|
-
userId: "6279552",
|
|
5837
|
-
username: "ewingmichael",
|
|
5838
|
-
displayName: "Eric Blackwell",
|
|
5839
|
-
avatar: "https://i.pravatar.cc/150?img=70"
|
|
5840
|
-
},
|
|
5841
|
-
{
|
|
5842
|
-
userId: "5284305",
|
|
5843
|
-
username: "jcox",
|
|
5844
|
-
displayName: "Eric Anderson",
|
|
5845
|
-
email: "hleonard@mitchell.com",
|
|
5846
|
-
avatar: "https://i.pravatar.cc/150?img=1"
|
|
5847
|
-
},
|
|
5848
|
-
{
|
|
5849
|
-
userId: "7124467",
|
|
5850
|
-
username: "christine01",
|
|
5851
|
-
displayName: "Jeffrey Adams",
|
|
5852
|
-
avatar: "https://i.pravatar.cc/150?img=2"
|
|
5853
|
-
},
|
|
5854
|
-
{
|
|
5855
|
-
userId: "9947233",
|
|
5856
|
-
username: "holly09",
|
|
5857
|
-
displayName: "Beth Cooper",
|
|
5858
|
-
avatar: "https://i.pravatar.cc/150?img=3"
|
|
5859
|
-
},
|
|
5860
|
-
{
|
|
5861
|
-
userId: "4481447",
|
|
5862
|
-
username: "hstephens",
|
|
5863
|
-
displayName: "James Montes",
|
|
5864
|
-
email: "oandersen@yahoo.com",
|
|
5865
|
-
avatar: "https://i.pravatar.cc/150?img=4"
|
|
5866
|
-
},
|
|
5867
|
-
{
|
|
5868
|
-
userId: "2136050",
|
|
5869
|
-
username: "lewispaul",
|
|
5870
|
-
displayName: "Alexander Green",
|
|
5871
|
-
avatar: "https://i.pravatar.cc/150?img=5"
|
|
5872
|
-
},
|
|
5873
|
-
{
|
|
5874
|
-
userId: "7517470",
|
|
5875
|
-
username: "haroldroy",
|
|
5876
|
-
displayName: "Karen Arroyo",
|
|
5877
|
-
avatar: "https://i.pravatar.cc/150?img=6"
|
|
5878
|
-
},
|
|
5879
|
-
{
|
|
5880
|
-
userId: "6153183",
|
|
5881
|
-
username: "nbrown",
|
|
5882
|
-
displayName: "Eileen White",
|
|
5883
|
-
avatar: "https://i.pravatar.cc/150?img=7"
|
|
5884
|
-
},
|
|
5885
|
-
{
|
|
5886
|
-
userId: "6159881",
|
|
5887
|
-
username: "mayopatrick",
|
|
5888
|
-
displayName: "Joanne Clark",
|
|
5889
|
-
avatar: "https://i.pravatar.cc/150?img=8"
|
|
5890
|
-
},
|
|
5891
|
-
{
|
|
5892
|
-
userId: "4545032",
|
|
5893
|
-
username: "jonesbriana",
|
|
5894
|
-
displayName: "Joshua Hogan",
|
|
5895
|
-
avatar: "https://i.pravatar.cc/150?img=9"
|
|
5896
|
-
},
|
|
5897
|
-
{
|
|
5898
|
-
userId: "1877889",
|
|
5899
|
-
username: "david27",
|
|
5900
|
-
displayName: "Amanda Smith",
|
|
5901
|
-
avatar: "https://i.pravatar.cc/150?img=10"
|
|
5902
|
-
},
|
|
5903
|
-
{
|
|
5904
|
-
userId: "8011103",
|
|
5905
|
-
username: "samanthamontgomery",
|
|
5906
|
-
displayName: "Michelle James",
|
|
5907
|
-
avatar: "https://i.pravatar.cc/150?img=11"
|
|
5908
|
-
},
|
|
5909
|
-
{
|
|
5910
|
-
userId: "1770816",
|
|
5911
|
-
username: "jasonhawkins",
|
|
5912
|
-
displayName: "Krystal Montoya",
|
|
5913
|
-
email: "carol49@hawkins.com",
|
|
5914
|
-
avatar: "https://i.pravatar.cc/150?img=12"
|
|
5915
|
-
},
|
|
5916
|
-
{
|
|
5917
|
-
userId: "7398757",
|
|
5918
|
-
username: "fstrickland",
|
|
5919
|
-
displayName: "Jesse Foster",
|
|
5920
|
-
avatar: "https://i.pravatar.cc/150?img=13"
|
|
5921
|
-
},
|
|
5922
|
-
{
|
|
5923
|
-
userId: "6174493",
|
|
5924
|
-
username: "vanessa41",
|
|
5925
|
-
displayName: "Travis Werner",
|
|
5926
|
-
avatar: "https://i.pravatar.cc/150?img=14"
|
|
5927
|
-
},
|
|
5928
|
-
{
|
|
5929
|
-
userId: "5698330",
|
|
5930
|
-
username: "leah20",
|
|
5931
|
-
displayName: "Lisa Davis",
|
|
5932
|
-
email: "mannwilliam@singh.com",
|
|
5933
|
-
avatar: "https://i.pravatar.cc/150?img=15"
|
|
5934
|
-
},
|
|
5935
|
-
{
|
|
5936
|
-
userId: "5919037",
|
|
5937
|
-
username: "garciashane",
|
|
5938
|
-
displayName: "Sean Murphy",
|
|
5939
|
-
email: "hgonzalez@avila.info",
|
|
5940
|
-
avatar: "https://i.pravatar.cc/150?img=16"
|
|
5941
|
-
},
|
|
5942
|
-
{
|
|
5943
|
-
userId: "4577301",
|
|
5944
|
-
username: "margaret94",
|
|
5945
|
-
displayName: "Blake Mcfarland",
|
|
5946
|
-
avatar: "https://i.pravatar.cc/150?img=17"
|
|
5947
|
-
},
|
|
5948
|
-
{
|
|
5949
|
-
userId: "2155330",
|
|
5950
|
-
username: "amberarellano",
|
|
5951
|
-
displayName: "Jonathan Hawkins",
|
|
5952
|
-
email: "rebecca14@reynolds-carlson.com",
|
|
5953
|
-
avatar: "https://i.pravatar.cc/150?img=18"
|
|
5954
|
-
},
|
|
5955
|
-
{
|
|
5956
|
-
userId: "4843253",
|
|
5957
|
-
username: "villarrealannette",
|
|
5958
|
-
displayName: "Angel Gonzales",
|
|
5959
|
-
avatar: "https://i.pravatar.cc/150?img=19"
|
|
5960
|
-
},
|
|
5961
|
-
{
|
|
5962
|
-
userId: "1906659",
|
|
5963
|
-
username: "andrea21",
|
|
5964
|
-
displayName: "Sarah Fitzgerald",
|
|
5965
|
-
email: "smithrachel@shaw.com",
|
|
5966
|
-
avatar: "https://i.pravatar.cc/150?img=20"
|
|
5967
|
-
},
|
|
5968
|
-
{
|
|
5969
|
-
userId: "2119584",
|
|
5970
|
-
username: "gsmith",
|
|
5971
|
-
displayName: "Rachel Hamilton",
|
|
5972
|
-
email: "angelajones@nixon.com",
|
|
5973
|
-
avatar: "https://i.pravatar.cc/150?img=21"
|
|
5974
|
-
},
|
|
5975
|
-
{
|
|
5976
|
-
userId: "4752319",
|
|
5977
|
-
username: "gflores",
|
|
5978
|
-
displayName: "Larry Larson",
|
|
5979
|
-
email: "deborah84@hotmail.com",
|
|
5980
|
-
avatar: "https://i.pravatar.cc/150?img=22"
|
|
5981
|
-
},
|
|
5982
|
-
{
|
|
5983
|
-
userId: "5512539",
|
|
5984
|
-
username: "terrihart",
|
|
5985
|
-
displayName: "Melissa James",
|
|
5986
|
-
email: "scottgregory@murphy.org",
|
|
5987
|
-
avatar: "https://i.pravatar.cc/150?img=23"
|
|
5988
|
-
},
|
|
5989
|
-
{
|
|
5990
|
-
userId: "7735585",
|
|
5991
|
-
username: "randallmartinez",
|
|
5992
|
-
displayName: "Heather Morris",
|
|
5993
|
-
email: "raymond84@hunter-benjamin.com",
|
|
5994
|
-
avatar: "https://i.pravatar.cc/150?img=24"
|
|
5995
|
-
},
|
|
5996
|
-
{
|
|
5997
|
-
userId: "5081733",
|
|
5998
|
-
username: "zgibson",
|
|
5999
|
-
displayName: "Steven Burch",
|
|
6000
|
-
email: "victoria55@hotmail.com",
|
|
6001
|
-
avatar: "https://i.pravatar.cc/150?img=25"
|
|
6002
|
-
},
|
|
6003
|
-
{
|
|
6004
|
-
userId: "9801446",
|
|
6005
|
-
username: "msmith",
|
|
6006
|
-
displayName: "Richard Saunders",
|
|
6007
|
-
email: "sharoncoffey@hunter.com",
|
|
6008
|
-
avatar: "https://i.pravatar.cc/150?img=26"
|
|
6009
|
-
},
|
|
6010
|
-
{
|
|
6011
|
-
userId: "5315126",
|
|
6012
|
-
username: "nguyenkimberly",
|
|
6013
|
-
displayName: "David Odonnell",
|
|
6014
|
-
avatar: "https://i.pravatar.cc/150?img=27"
|
|
6015
|
-
},
|
|
6016
|
-
{
|
|
6017
|
-
userId: "1464038",
|
|
6018
|
-
username: "travis55",
|
|
6019
|
-
displayName: "Kevin Krause",
|
|
6020
|
-
email: "barnesmichael@cross-riley.info",
|
|
6021
|
-
avatar: "https://i.pravatar.cc/150?img=28"
|
|
6022
|
-
},
|
|
6023
|
-
{
|
|
6024
|
-
userId: "2764284",
|
|
6025
|
-
username: "twilson",
|
|
6026
|
-
displayName: "Kelly Phillips",
|
|
6027
|
-
email: "cbarnes@gmail.com",
|
|
6028
|
-
avatar: "https://i.pravatar.cc/150?img=29"
|
|
6029
|
-
},
|
|
6030
|
-
{
|
|
6031
|
-
userId: "8360841",
|
|
6032
|
-
username: "hardingthomas",
|
|
6033
|
-
displayName: "Roger Bowen",
|
|
6034
|
-
avatar: "https://i.pravatar.cc/150?img=30"
|
|
6035
|
-
}
|
|
6036
|
-
];
|
|
6037
|
-
|
|
6038
5354
|
// src/components/VirtualizedList/index.tsx
|
|
6039
5355
|
var import_react9 = __toESM(require("react"));
|
|
6040
5356
|
var import_react_virtuoso = require("react-virtuoso");
|
|
@@ -6089,7 +5405,10 @@ var getChatDisplayTime = (timestamp) => {
|
|
|
6089
5405
|
};
|
|
6090
5406
|
|
|
6091
5407
|
// src/components/ChatUserList/ChatUserList.tsx
|
|
6092
|
-
function ChatUserList(
|
|
5408
|
+
function ChatUserList({
|
|
5409
|
+
currentUser,
|
|
5410
|
+
onSearchUsers
|
|
5411
|
+
}) {
|
|
6093
5412
|
const [opened, { open, close }] = (0, import_hooks.useDisclosure)(false);
|
|
6094
5413
|
const dispatch = (0, import_react_redux3.useDispatch)();
|
|
6095
5414
|
const chatList = (0, import_react_redux3.useSelector)(
|
|
@@ -6101,20 +5420,17 @@ function ChatUserList() {
|
|
|
6101
5420
|
const [receiverSearchValue, setReceiverSearchValue] = (0, import_react10.useState)("");
|
|
6102
5421
|
const [receiverDetails, setReceiverDetails] = (0, import_react10.useState)();
|
|
6103
5422
|
const [receiverUserDetails, setReceiverUserDetails] = (0, import_react10.useState)();
|
|
6104
|
-
const [
|
|
6105
|
-
const [
|
|
6106
|
-
const [
|
|
5423
|
+
const [searchResults, setSearchResults] = (0, import_react10.useState)([]);
|
|
5424
|
+
const [isSearching, setIsSearching] = (0, import_react10.useState)(false);
|
|
5425
|
+
const [senderDetails, setSenderDetails] = (0, import_react10.useState)(currentUser);
|
|
6107
5426
|
(0, import_react10.useEffect)(() => {
|
|
6108
|
-
if (
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
}, [senderUserDetails]);
|
|
5427
|
+
if (!currentUser?.userId) return;
|
|
5428
|
+
setSenderDetails(currentUser);
|
|
5429
|
+
}, [currentUser?.userId]);
|
|
6112
5430
|
(0, import_react10.useEffect)(() => {
|
|
6113
|
-
if (!
|
|
6114
|
-
dispatch(
|
|
6115
|
-
|
|
6116
|
-
);
|
|
6117
|
-
}, [senderUserDetails]);
|
|
5431
|
+
if (!currentUser?.userId) return;
|
|
5432
|
+
dispatch(fetchMessageListByUserId({ userId: currentUser.userId, page: 0 }));
|
|
5433
|
+
}, [currentUser?.userId, dispatch]);
|
|
6118
5434
|
const handleStartChat = () => {
|
|
6119
5435
|
if (!receiverUserDetails?.userId) return;
|
|
6120
5436
|
const existingChat = chatList?.rows?.data?.find(
|
|
@@ -6150,11 +5466,11 @@ function ChatUserList() {
|
|
|
6150
5466
|
}
|
|
6151
5467
|
}, [senderDetails?.userId]);
|
|
6152
5468
|
(0, import_react10.useEffect)(() => {
|
|
6153
|
-
if (!
|
|
5469
|
+
if (!senderDetails?.userId) return;
|
|
6154
5470
|
const socket2 = getSocket(senderDetails.userId);
|
|
6155
5471
|
if (!socket2) return;
|
|
6156
5472
|
const handleNewChat = (data2) => {
|
|
6157
|
-
if (data2.sender ===
|
|
5473
|
+
if (data2.sender === senderDetails.userId) return;
|
|
6158
5474
|
dispatch(
|
|
6159
5475
|
addUserToChatList({
|
|
6160
5476
|
message: data2.message,
|
|
@@ -6170,7 +5486,7 @@ function ChatUserList() {
|
|
|
6170
5486
|
return () => {
|
|
6171
5487
|
socket2.off("newChat", handleNewChat);
|
|
6172
5488
|
};
|
|
6173
|
-
}, [senderDetails
|
|
5489
|
+
}, [dispatch, senderDetails?.userId]);
|
|
6174
5490
|
(0, import_react10.useEffect)(() => {
|
|
6175
5491
|
if (!senderDetails?.userId) return;
|
|
6176
5492
|
const socket2 = getSocket(senderDetails?.userId || "");
|
|
@@ -6213,17 +5529,18 @@ function ChatUserList() {
|
|
|
6213
5529
|
};
|
|
6214
5530
|
}, [chatList, senderDetails?.userId]);
|
|
6215
5531
|
const loadMoreChats = () => {
|
|
6216
|
-
if (!chatList?.hasMore) return;
|
|
5532
|
+
if (!chatList?.hasMore || !currentUser?.userId) return;
|
|
6217
5533
|
const nextPage = page + 1;
|
|
6218
5534
|
setPage(nextPage);
|
|
6219
5535
|
dispatch(
|
|
6220
5536
|
fetchMessageListByUserId({
|
|
6221
|
-
userId:
|
|
5537
|
+
userId: currentUser.userId,
|
|
6222
5538
|
page: nextPage
|
|
6223
5539
|
})
|
|
6224
5540
|
);
|
|
6225
5541
|
};
|
|
6226
5542
|
const handleJoinChat = (item) => {
|
|
5543
|
+
if (!senderDetails?.userId) return;
|
|
6227
5544
|
const socket2 = getSocket(senderDetails.userId);
|
|
6228
5545
|
if (!socket2) return;
|
|
6229
5546
|
setReceiverDetails({
|
|
@@ -6250,12 +5567,45 @@ function ChatUserList() {
|
|
|
6250
5567
|
})
|
|
6251
5568
|
);
|
|
6252
5569
|
};
|
|
5570
|
+
const handleSearchUsers = (value) => {
|
|
5571
|
+
setReceiverSearchValue(value);
|
|
5572
|
+
};
|
|
5573
|
+
(0, import_react10.useEffect)(() => {
|
|
5574
|
+
if (!receiverSearchValue.trim()) {
|
|
5575
|
+
setSearchResults([]);
|
|
5576
|
+
setIsSearching(false);
|
|
5577
|
+
return;
|
|
5578
|
+
}
|
|
5579
|
+
if (!onSearchUsers) {
|
|
5580
|
+
setSearchResults([]);
|
|
5581
|
+
setIsSearching(false);
|
|
5582
|
+
return;
|
|
5583
|
+
}
|
|
5584
|
+
let isCancelled = false;
|
|
5585
|
+
const timeoutId = setTimeout(async () => {
|
|
5586
|
+
try {
|
|
5587
|
+
setIsSearching(true);
|
|
5588
|
+
setSearchResults([]);
|
|
5589
|
+
const filteredUsers = await Promise.resolve(onSearchUsers(receiverSearchValue));
|
|
5590
|
+
if (isCancelled) return;
|
|
5591
|
+
setSearchResults(filteredUsers);
|
|
5592
|
+
} finally {
|
|
5593
|
+
if (!isCancelled) {
|
|
5594
|
+
setIsSearching(false);
|
|
5595
|
+
}
|
|
5596
|
+
}
|
|
5597
|
+
}, 400);
|
|
5598
|
+
return () => {
|
|
5599
|
+
isCancelled = true;
|
|
5600
|
+
clearTimeout(timeoutId);
|
|
5601
|
+
};
|
|
5602
|
+
}, [receiverSearchValue, onSearchUsers]);
|
|
6253
5603
|
const stripHtml = (html) => {
|
|
6254
5604
|
const div = document.createElement("div");
|
|
6255
5605
|
div.innerHTML = html;
|
|
6256
5606
|
return div.textContent || "";
|
|
6257
5607
|
};
|
|
6258
|
-
const userOptions =
|
|
5608
|
+
const userOptions = searchResults.map((user) => ({
|
|
6259
5609
|
value: user.username,
|
|
6260
5610
|
label: user.displayName || user.username,
|
|
6261
5611
|
user
|
|
@@ -6267,8 +5617,10 @@ function ChatUserList() {
|
|
|
6267
5617
|
onClose: () => {
|
|
6268
5618
|
close();
|
|
6269
5619
|
setReceiverSearchValue("");
|
|
5620
|
+
setSearchResults([]);
|
|
5621
|
+
setIsSearching(false);
|
|
6270
5622
|
},
|
|
6271
|
-
title: "
|
|
5623
|
+
title: "Search User",
|
|
6272
5624
|
centered: true,
|
|
6273
5625
|
withCloseButton: true
|
|
6274
5626
|
},
|
|
@@ -6276,40 +5628,21 @@ function ChatUserList() {
|
|
|
6276
5628
|
import_core8.Autocomplete,
|
|
6277
5629
|
{
|
|
6278
5630
|
mb: 12,
|
|
6279
|
-
label: "
|
|
6280
|
-
placeholder: "Type username...",
|
|
6281
|
-
limit: 20,
|
|
6282
|
-
data: userOptions,
|
|
6283
|
-
value: senderSearchValue,
|
|
6284
|
-
onChange: setSenderSearchValue,
|
|
6285
|
-
onOptionSubmit: (val) => {
|
|
6286
|
-
const selected = users_list_default.find((u) => u.username === val);
|
|
6287
|
-
if (selected) {
|
|
6288
|
-
setSenderSearchValue("");
|
|
6289
|
-
setSenderUserDetails(selected);
|
|
6290
|
-
}
|
|
6291
|
-
},
|
|
6292
|
-
renderOption: ({ option }) => {
|
|
6293
|
-
const user = option.user;
|
|
6294
|
-
return /* @__PURE__ */ import_react10.default.createElement(import_core8.Group, { gap: "sm" }, /* @__PURE__ */ import_react10.default.createElement(import_core8.Avatar, { src: user.avatar, size: 36, radius: "xl" }), /* @__PURE__ */ import_react10.default.createElement("div", null, /* @__PURE__ */ import_react10.default.createElement(import_core8.Text, { size: "sm" }, user.displayName || user.username), user.displayName && /* @__PURE__ */ import_react10.default.createElement(import_core8.Text, { size: "xs", opacity: 0.5 }, "@", user.username)));
|
|
6295
|
-
}
|
|
6296
|
-
}
|
|
6297
|
-
),
|
|
6298
|
-
/* @__PURE__ */ import_react10.default.createElement(
|
|
6299
|
-
import_core8.Autocomplete,
|
|
6300
|
-
{
|
|
6301
|
-
mb: 12,
|
|
6302
|
-
label: "Receiver",
|
|
6303
|
-
placeholder: "Type username...",
|
|
5631
|
+
label: "Search User to Chat",
|
|
5632
|
+
placeholder: "Type username to search...",
|
|
6304
5633
|
limit: 20,
|
|
6305
5634
|
data: userOptions,
|
|
6306
5635
|
value: receiverSearchValue,
|
|
6307
|
-
onChange:
|
|
5636
|
+
onChange: handleSearchUsers,
|
|
5637
|
+
rightSection: isSearching ? /* @__PURE__ */ import_react10.default.createElement(import_core8.Loader, { size: "xs" }) : void 0,
|
|
5638
|
+
rightSectionWidth: 28,
|
|
6308
5639
|
onOptionSubmit: (val) => {
|
|
6309
|
-
const selected =
|
|
5640
|
+
const selected = searchResults.find((u) => u.username === val);
|
|
6310
5641
|
if (selected) {
|
|
6311
5642
|
setReceiverSearchValue("");
|
|
6312
5643
|
setReceiverUserDetails(selected);
|
|
5644
|
+
setSearchResults([]);
|
|
5645
|
+
setIsSearching(false);
|
|
6313
5646
|
}
|
|
6314
5647
|
},
|
|
6315
5648
|
renderOption: ({ option }) => {
|
|
@@ -6327,18 +5660,20 @@ function ChatUserList() {
|
|
|
6327
5660
|
},
|
|
6328
5661
|
"Start Chat"
|
|
6329
5662
|
)
|
|
6330
|
-
), /* @__PURE__ */ import_react10.default.createElement("div", { className: "mrchat-chatContainer" }, /* @__PURE__ */ import_react10.default.createElement("div", { className: "mrchat-sidebar" }, /* @__PURE__ */ import_react10.default.createElement("div", { className: "mrchat-sidebarTop" }, /* @__PURE__ */ import_react10.default.createElement("div", { className: "mrchat-topBar" }, /* @__PURE__ */ import_react10.default.createElement(import_core8.Text, { size: "
|
|
5663
|
+
), /* @__PURE__ */ import_react10.default.createElement("div", { className: "mrchat-chatContainer" }, /* @__PURE__ */ import_react10.default.createElement("div", { className: "mrchat-sidebar" }, /* @__PURE__ */ import_react10.default.createElement("div", { className: "mrchat-sidebarTop" }, /* @__PURE__ */ import_react10.default.createElement("div", { className: "mrchat-topBar" }, /* @__PURE__ */ import_react10.default.createElement(import_core8.Text, { size: "xs", c: "dimmed", mt: "sm", mb: "xs", ml: 12 }, "All Messages"), /* @__PURE__ */ import_react10.default.createElement("div", { className: "mrchat-topActions" }, /* @__PURE__ */ import_react10.default.createElement(
|
|
6331
5664
|
import_core8.ActionIcon,
|
|
6332
5665
|
{
|
|
6333
5666
|
variant: "subtle",
|
|
6334
5667
|
onClick: () => {
|
|
6335
5668
|
setReceiverUserDetails(null);
|
|
5669
|
+
setReceiverSearchValue("");
|
|
5670
|
+
setSearchResults([]);
|
|
6336
5671
|
open();
|
|
6337
5672
|
},
|
|
6338
5673
|
radius: "lg"
|
|
6339
5674
|
},
|
|
6340
5675
|
/* @__PURE__ */ import_react10.default.createElement(import_icons_react4.IconPlus, { size: 20, stroke: 3 })
|
|
6341
|
-
)))), /* @__PURE__ */ import_react10.default.createElement(
|
|
5676
|
+
)))), /* @__PURE__ */ import_react10.default.createElement("div", { className: "mrchat-scrollWrapper" }, /* @__PURE__ */ import_react10.default.createElement(
|
|
6342
5677
|
VirtualizedList,
|
|
6343
5678
|
{
|
|
6344
5679
|
data: chatList?.rows?.data || [],
|
|
@@ -6405,10 +5740,19 @@ function ChatUserList() {
|
|
|
6405
5740
|
}
|
|
6406
5741
|
|
|
6407
5742
|
// src/components/MrChat/index.tsx
|
|
6408
|
-
function MrChat(props) {
|
|
6409
|
-
const [primaryColor] = (0, import_react11.useState)("customBrand");
|
|
5743
|
+
function MrChat({ colorScheme, ...props }) {
|
|
5744
|
+
const [primaryColor, setPrimaryColor] = (0, import_react11.useState)("customBrand");
|
|
6410
5745
|
const theme = createAppTheme(primaryColor);
|
|
6411
|
-
return /* @__PURE__ */ import_react11.default.createElement(ReduxProvider, null, /* @__PURE__ */ import_react11.default.createElement(SocketProvider, null, /* @__PURE__ */ import_react11.default.createElement(
|
|
5746
|
+
return /* @__PURE__ */ import_react11.default.createElement(ReduxProvider, null, /* @__PURE__ */ import_react11.default.createElement(SocketProvider, null, /* @__PURE__ */ import_react11.default.createElement(
|
|
5747
|
+
import_core9.MantineProvider,
|
|
5748
|
+
{
|
|
5749
|
+
defaultColorScheme: colorScheme ?? "light",
|
|
5750
|
+
forceColorScheme: colorScheme,
|
|
5751
|
+
theme
|
|
5752
|
+
},
|
|
5753
|
+
/* @__PURE__ */ import_react11.default.createElement(import_notifications2.Notifications, null),
|
|
5754
|
+
/* @__PURE__ */ import_react11.default.createElement(ChatUserList, { ...props })
|
|
5755
|
+
)));
|
|
6412
5756
|
}
|
|
6413
5757
|
// Annotate the CommonJS export names for ESM import in node:
|
|
6414
5758
|
0 && (module.exports = {
|