vue-parley 4.1.1 → 4.3.0

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.
Files changed (58) hide show
  1. package/README.md +20 -0
  2. package/dist/chat.css +106 -35
  3. package/dist/chunks/{Call-BeGdr-d7.cjs → Call-CDT92h1x.cjs} +62 -57
  4. package/dist/chunks/Call-CDT92h1x.cjs.map +1 -0
  5. package/dist/chunks/{Call-DTGrutam.mjs → Call-jiZGoCtR.mjs} +62 -57
  6. package/dist/chunks/Call-jiZGoCtR.mjs.map +1 -0
  7. package/dist/chunks/{index-K_JanVHh.mjs → index-CHFzAdVI.mjs} +371 -210
  8. package/dist/chunks/index-CHFzAdVI.mjs.map +1 -0
  9. package/dist/chunks/{index-B17prQrp.cjs → index-efTNVoBF.cjs} +350 -189
  10. package/dist/chunks/index-efTNVoBF.cjs.map +1 -0
  11. package/dist/chunks/{session-DmF2mWKu.mjs → session-CN61aKfb.mjs} +3 -2
  12. package/dist/chunks/{session-CxbG89V2.cjs.map → session-CN61aKfb.mjs.map} +1 -1
  13. package/dist/chunks/{session-CxbG89V2.cjs → session-DLxWccUj.cjs} +3 -2
  14. package/dist/chunks/{session-DmF2mWKu.mjs.map → session-DLxWccUj.cjs.map} +1 -1
  15. package/dist/fakes.cjs +14 -3
  16. package/dist/fakes.cjs.map +1 -1
  17. package/dist/fakes.mjs +14 -3
  18. package/dist/fakes.mjs.map +1 -1
  19. package/dist/index.cjs +1 -1
  20. package/dist/index.mjs +19 -19
  21. package/dist/types/app/components/ChatPage.vue.d.ts.map +1 -1
  22. package/dist/types/app/components/call/Call.vue.d.ts.map +1 -1
  23. package/dist/types/app/components/chat/ChatBubble.vue.d.ts.map +1 -1
  24. package/dist/types/app/components/chat/ChatInput.vue.d.ts.map +1 -1
  25. package/dist/types/app/components/chat/ChatMessages.vue.d.ts.map +1 -1
  26. package/dist/types/app/components/chat/ChatPageBar.vue.d.ts.map +1 -1
  27. package/dist/types/app/components/chat/ChatProfileOverview.vue.d.ts +5 -1
  28. package/dist/types/app/components/chat/ChatProfileOverview.vue.d.ts.map +1 -1
  29. package/dist/types/app/components/chat/ChatView.vue.d.ts.map +1 -1
  30. package/dist/types/app/components/chat/chat-bubbles/BubbleOptions.vue.d.ts.map +1 -1
  31. package/dist/types/app/components/chat/chat-bubbles/MediaViewer.vue.d.ts.map +1 -1
  32. package/dist/types/app/components/chat/chat-input/InputAttachement.vue.d.ts.map +1 -1
  33. package/dist/types/app/components/chat/contact/ChatList.vue.d.ts.map +1 -1
  34. package/dist/types/app/components/chat/contact/ContactAvatar.vue.d.ts +1 -1
  35. package/dist/types/app/components/chat/contact/ContactAvatar.vue.d.ts.map +1 -1
  36. package/dist/types/app/components/chat/messages/FloatingDateHeader.vue.d.ts +0 -1
  37. package/dist/types/app/components/chat/messages/FloatingDateHeader.vue.d.ts.map +1 -1
  38. package/dist/types/app/components/general/ResponsiveDialog.vue.d.ts.map +1 -1
  39. package/dist/types/app/components/global/BIcon.vue.d.ts.map +1 -1
  40. package/dist/types/app/composables/call/session.d.ts +2 -0
  41. package/dist/types/app/composables/call/session.d.ts.map +1 -1
  42. package/dist/types/app/composables/useFlippedVirtualScroll.d.ts +0 -1
  43. package/dist/types/app/composables/useFlippedVirtualScroll.d.ts.map +1 -1
  44. package/dist/types/app/stores/callStore.d.ts +9 -3
  45. package/dist/types/app/stores/callStore.d.ts.map +1 -1
  46. package/dist/types/app/stores/messageStores.d.ts +11 -2
  47. package/dist/types/app/stores/messageStores.d.ts.map +1 -1
  48. package/dist/types/app/types/index.d.ts +24 -2
  49. package/dist/types/app/types/index.d.ts.map +1 -1
  50. package/dist/types/fakes/backend.d.ts +6 -1
  51. package/dist/types/fakes/backend.d.ts.map +1 -1
  52. package/dist/types/i18n/locales/index.d.ts +16 -0
  53. package/dist/types/i18n/locales/index.d.ts.map +1 -1
  54. package/package.json +1 -1
  55. package/dist/chunks/Call-BeGdr-d7.cjs.map +0 -1
  56. package/dist/chunks/Call-DTGrutam.mjs.map +0 -1
  57. package/dist/chunks/index-B17prQrp.cjs.map +0 -1
  58. package/dist/chunks/index-K_JanVHh.mjs.map +0 -1
package/README.md CHANGED
@@ -19,6 +19,7 @@ Formerly `@yonus_amire01/chat`. To switch, replace that name with `vue-parley` i
19
19
  - [Nuxt 3 / 4](#nuxt-3--4)
20
20
  - [Customising the page](#customising-the-page)
21
21
  - [Photos and videos](#photos-and-videos)
22
+ - [Read receipts](#read-receipts)
22
23
  - [Calls outside the chat page](#calls-outside-the-chat-page)
23
24
  - [Fake backend](#fake-backend)
24
25
  - [What `createChat()` does](#what-createchat-does)
@@ -135,6 +136,25 @@ To build a different layout, use the exported building blocks instead: `ChatList
135
136
 
136
137
  A round video note recorded in the chat is different: it is `type: "video"` with `videoUrl`, and plays in its bubble.
137
138
 
139
+ ### Read receipts
140
+
141
+ Your own messages show one tick when sent and two once someone has read them (`isRead`). With a `fetchReaders` handler, the message menu also says **who** read one of your messages: the reader and when in a one-to-one chat, or "Seen by N" opening the list of readers in a group.
142
+
143
+ ```ts
144
+ const messages: MessagesHandlers = {
145
+ // …
146
+ // The conversation is open and read up to lastMessageId (when a message is loaded). Called when
147
+ // it opens, and again as messages from others arrive while it is on screen.
148
+ async markRead(conversationId, lastMessageId) {},
149
+ // The other participants who have read one of the viewer's own messages.
150
+ async fetchReaders(message): Promise<MessageReader[]> {
151
+ return [{ id: "u2", name: "Sara", lastName: "Ahmadi", imageUrl: "", readAt: new Date() }];
152
+ },
153
+ };
154
+ ```
155
+
156
+ `readAt` is when the reader last caught up on the conversation, which a host tracking a per-member "read up to" pointer may only know for the newest message they reached. When a read receipt arrives in real time, call `useMessagesStore().markSeenUpTo(conversationId, messageId)` with the newest loaded message the reader has reached: your messages up to it turn read.
157
+
138
158
  ### Calls outside the chat page
139
159
 
140
160
  A call belongs to the call store, not to a component, so it keeps running when the chat page unmounts. To keep it **on screen** while the user navigates, render the call view once near the app root and turn off the chat page's own:
package/dist/chat.css CHANGED
@@ -505,10 +505,6 @@
505
505
  top: calc(var(--spacing) * 4);
506
506
  }
507
507
 
508
- :where(.vue-chat, .vue-chat *).top-12 {
509
- top: calc(var(--spacing) * 12);
510
- }
511
-
512
508
  :where(.vue-chat, .vue-chat *).right-0 {
513
509
  right: 0;
514
510
  }
@@ -951,6 +947,10 @@
951
947
  max-height: calc(var(--spacing) * 60);
952
948
  }
953
949
 
950
+ :where(.vue-chat, .vue-chat *).max-h-72\! {
951
+ max-height: calc(var(--spacing) * 72) !important;
952
+ }
953
+
954
954
  :where(.vue-chat, .vue-chat *).max-h-109 {
955
955
  max-height: calc(var(--spacing) * 109);
956
956
  }
@@ -1163,6 +1163,10 @@
1163
1163
  min-width: calc(var(--spacing) * 20);
1164
1164
  }
1165
1165
 
1166
+ :where(.vue-chat, .vue-chat *).min-w-64\! {
1167
+ min-width: calc(var(--spacing) * 64) !important;
1168
+ }
1169
+
1166
1170
  :where(.vue-chat, .vue-chat *).flex-1 {
1167
1171
  flex: 1;
1168
1172
  }
@@ -1354,6 +1358,10 @@
1354
1358
  flex-direction: row !important;
1355
1359
  }
1356
1360
 
1361
+ :where(.vue-chat, .vue-chat *).flex-row-reverse {
1362
+ flex-direction: row-reverse;
1363
+ }
1364
+
1357
1365
  :where(.vue-chat, .vue-chat *).flex-wrap {
1358
1366
  flex-wrap: wrap;
1359
1367
  }
@@ -1430,6 +1438,10 @@
1430
1438
  column-gap: calc(var(--spacing) * 2.5);
1431
1439
  }
1432
1440
 
1441
+ :where(.vue-chat, .vue-chat *).gap-x-2\.5\! {
1442
+ column-gap: calc(var(--spacing) * 2.5) !important;
1443
+ }
1444
+
1433
1445
  :where(.vue-chat, .vue-chat *).gap-x-3 {
1434
1446
  column-gap: calc(var(--spacing) * 3);
1435
1447
  }
@@ -1456,6 +1468,12 @@
1456
1468
  margin-inline-end: calc(calc(var(--spacing) * -1) * calc(1 - var(--tw-space-x-reverse)));
1457
1469
  }
1458
1470
 
1471
+ :where(.vue-chat, .vue-chat *):where(.-space-x-2 > :not(:last-child)) {
1472
+ --tw-space-x-reverse: 0;
1473
+ margin-inline-start: calc(calc(var(--spacing) * -2) * var(--tw-space-x-reverse));
1474
+ margin-inline-end: calc(calc(var(--spacing) * -2) * calc(1 - var(--tw-space-x-reverse)));
1475
+ }
1476
+
1459
1477
  :where(.vue-chat, .vue-chat *).gap-y-0\.5 {
1460
1478
  row-gap: calc(var(--spacing) * .5);
1461
1479
  }
@@ -1518,6 +1536,10 @@
1518
1536
  overflow-y: auto;
1519
1537
  }
1520
1538
 
1539
+ :where(.vue-chat, .vue-chat *).overflow-y-auto\! {
1540
+ overflow-y: auto !important;
1541
+ }
1542
+
1521
1543
  :where(.vue-chat, .vue-chat *).\!rounded {
1522
1544
  border-radius: .25rem !important;
1523
1545
  }
@@ -1566,33 +1588,33 @@
1566
1588
  border-radius: var(--radius-xl) !important;
1567
1589
  }
1568
1590
 
1569
- :where(.vue-chat, .vue-chat *).rounded-ss-md {
1570
- border-start-start-radius: var(--radius-md);
1591
+ :where(.vue-chat, .vue-chat *).rounded-tl-md {
1592
+ border-top-left-radius: var(--radius-md);
1571
1593
  }
1572
1594
 
1573
- :where(.vue-chat, .vue-chat *).rounded-se-md {
1574
- border-start-end-radius: var(--radius-md);
1595
+ :where(.vue-chat, .vue-chat *).rounded-tr-md {
1596
+ border-top-right-radius: var(--radius-md);
1575
1597
  }
1576
1598
 
1577
- :where(.vue-chat, .vue-chat *).rounded-ee-md {
1578
- border-end-end-radius: var(--radius-md);
1599
+ :where(.vue-chat, .vue-chat *).rounded-b-none\! {
1600
+ border-bottom-right-radius: 0 !important;
1601
+ border-bottom-left-radius: 0 !important;
1579
1602
  }
1580
1603
 
1581
- :where(.vue-chat, .vue-chat *).rounded-ee-xs {
1582
- border-end-end-radius: var(--radius-xs);
1604
+ :where(.vue-chat, .vue-chat *).rounded-br-md {
1605
+ border-bottom-right-radius: var(--radius-md);
1583
1606
  }
1584
1607
 
1585
- :where(.vue-chat, .vue-chat *).rounded-es-md {
1586
- border-end-start-radius: var(--radius-md);
1608
+ :where(.vue-chat, .vue-chat *).rounded-br-xs {
1609
+ border-bottom-right-radius: var(--radius-xs);
1587
1610
  }
1588
1611
 
1589
- :where(.vue-chat, .vue-chat *).rounded-es-xs {
1590
- border-end-start-radius: var(--radius-xs);
1612
+ :where(.vue-chat, .vue-chat *).rounded-bl-md {
1613
+ border-bottom-left-radius: var(--radius-md);
1591
1614
  }
1592
1615
 
1593
- :where(.vue-chat, .vue-chat *).rounded-b-none\! {
1594
- border-bottom-right-radius: 0 !important;
1595
- border-bottom-left-radius: 0 !important;
1616
+ :where(.vue-chat, .vue-chat *).rounded-bl-xs {
1617
+ border-bottom-left-radius: var(--radius-xs);
1596
1618
  }
1597
1619
 
1598
1620
  :where(.vue-chat, .vue-chat *).border {
@@ -1600,6 +1622,11 @@
1600
1622
  border-width: 1px;
1601
1623
  }
1602
1624
 
1625
+ :where(.vue-chat, .vue-chat *).border\! {
1626
+ border-style: var(--tw-border-style) !important;
1627
+ border-width: 1px !important;
1628
+ }
1629
+
1603
1630
  :where(.vue-chat, .vue-chat *).border-0\! {
1604
1631
  border-style: var(--tw-border-style) !important;
1605
1632
  border-width: 0 !important;
@@ -1791,6 +1818,16 @@
1791
1818
  }
1792
1819
  }
1793
1820
 
1821
+ :where(.vue-chat, .vue-chat *).bg-chat-background\/95\! {
1822
+ background-color: #fffffff2 !important;
1823
+ }
1824
+
1825
+ @supports (color: color-mix(in lab, red, red)) {
1826
+ :where(.vue-chat, .vue-chat *).bg-chat-background\/95\! {
1827
+ background-color: color-mix(in oklab, var(--color-chat-background) 95%, transparent) !important;
1828
+ }
1829
+ }
1830
+
1794
1831
  :where(.vue-chat, .vue-chat *).bg-chat-bubble {
1795
1832
  background-color: var(--color-chat-bubble);
1796
1833
  }
@@ -1977,6 +2014,16 @@
1977
2014
  }
1978
2015
  }
1979
2016
 
2017
+ :where(.vue-chat, .vue-chat *).bg-white\/15 {
2018
+ background-color: #ffffff26;
2019
+ }
2020
+
2021
+ @supports (color: color-mix(in lab, red, red)) {
2022
+ :where(.vue-chat, .vue-chat *).bg-white\/15 {
2023
+ background-color: color-mix(in oklab, var(--color-white) 15%, transparent);
2024
+ }
2025
+ }
2026
+
1980
2027
  :where(.vue-chat, .vue-chat *).bg-linear-to-b {
1981
2028
  --tw-gradient-position: to bottom;
1982
2029
  }
@@ -2009,10 +2056,6 @@
2009
2056
  background-image: var(--background-image-diamond-error);
2010
2057
  }
2011
2058
 
2012
- :where(.vue-chat, .vue-chat *).bg-diamond-primary-secondary {
2013
- background-image: var(--background-image-diamond-primary-secondary);
2014
- }
2015
-
2016
2059
  :where(.vue-chat, .vue-chat *).bg-gradient-primary-secondary {
2017
2060
  background-image: var(--background-image-gradient-primary-secondary);
2018
2061
  }
@@ -2728,6 +2771,10 @@
2728
2771
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
2729
2772
  }
2730
2773
 
2774
+ :where(.vue-chat, .vue-chat *).ring-chat-background {
2775
+ --tw-ring-color: var(--color-chat-background);
2776
+ }
2777
+
2731
2778
  :where(.vue-chat, .vue-chat *).ring-white {
2732
2779
  --tw-ring-color: var(--color-white);
2733
2780
  }
@@ -2908,6 +2955,10 @@
2908
2955
  user-select: text;
2909
2956
  }
2910
2957
 
2958
+ :where(.vue-chat, .vue-chat *).\[unicode-bidi\:plaintext\] {
2959
+ unicode-bidi: plaintext;
2960
+ }
2961
+
2911
2962
  :where(.vue-chat, .vue-chat *).\[vue-chat\:call\] {
2912
2963
  vue-chat: call;
2913
2964
  }
@@ -3229,10 +3280,30 @@
3229
3280
  rotate: 0deg;
3230
3281
  }
3231
3282
 
3283
+ :where(.vue-chat, .vue-chat *).rtl\:rotate-180:where(:dir(rtl), [dir="rtl"], [dir="rtl"] *) {
3284
+ rotate: 180deg;
3285
+ }
3286
+
3287
+ :where(.vue-chat, .vue-chat *).rtl\:flex-row:where(:dir(rtl), [dir="rtl"], [dir="rtl"] *) {
3288
+ flex-direction: row;
3289
+ }
3290
+
3232
3291
  :where(.vue-chat, .vue-chat *).rtl\:flex-row\!:where(:dir(rtl), [dir="rtl"], [dir="rtl"] *) {
3233
3292
  flex-direction: row !important;
3234
3293
  }
3235
3294
 
3295
+ :where(.vue-chat, .vue-chat *).rtl\:justify-end:where(:dir(rtl), [dir="rtl"], [dir="rtl"] *) {
3296
+ justify-content: flex-end;
3297
+ }
3298
+
3299
+ :where(.vue-chat, .vue-chat *).rtl\:justify-start:where(:dir(rtl), [dir="rtl"], [dir="rtl"] *) {
3300
+ justify-content: flex-start;
3301
+ }
3302
+
3303
+ :where(.vue-chat, .vue-chat *):where(.rtl\:space-x-reverse:where(:dir(rtl), [dir="rtl"], [dir="rtl"] *) > :not(:last-child)) {
3304
+ --tw-space-x-reverse: 1;
3305
+ }
3306
+
3236
3307
  :where(.vue-chat, .vue-chat *).rtl\:border-l:where(:dir(rtl), [dir="rtl"], [dir="rtl"] *) {
3237
3308
  border-left-style: var(--tw-border-style);
3238
3309
  border-left-width: 1px;
@@ -3760,15 +3831,15 @@
3760
3831
  }
3761
3832
 
3762
3833
  /* Styles remain exactly the same */
3763
- :where(.vue-chat, .vue-chat *).flip-vertical[data-v-9b959d0c] {
3834
+ :where(.vue-chat, .vue-chat *).flip-vertical[data-v-cb7cc93f] {
3764
3835
  transform: scaleY(-1);
3765
3836
  will-change: transform;
3766
3837
  }
3767
- :where(.vue-chat, .vue-chat *)[data-index][data-v-9b959d0c] {
3838
+ :where(.vue-chat, .vue-chat *)[data-index][data-v-cb7cc93f] {
3768
3839
  will-change: transform;
3769
3840
  backface-visibility: hidden;
3770
3841
  }
3771
- @keyframes slide-in-right-9b959d0c {
3842
+ @keyframes slide-in-right-cb7cc93f {
3772
3843
  0% {
3773
3844
  opacity: 0;
3774
3845
  transform: scaleY(-1) translateX(30px);
@@ -3778,7 +3849,7 @@
3778
3849
  transform: scaleY(-1) translateX(0);
3779
3850
  }
3780
3851
  }
3781
- @keyframes slide-in-left-9b959d0c {
3852
+ @keyframes slide-in-left-cb7cc93f {
3782
3853
  0% {
3783
3854
  opacity: 0;
3784
3855
  transform: scaleY(-1) translateX(-30px);
@@ -3788,23 +3859,23 @@
3788
3859
  transform: scaleY(-1) translateX(0);
3789
3860
  }
3790
3861
  }
3791
- :where(.vue-chat, .vue-chat *).animate-slide-right[data-v-9b959d0c] {
3792
- animation: slide-in-right-9b959d0c 300ms ease-out forwards;
3862
+ :where(.vue-chat, .vue-chat *).animate-slide-right[data-v-cb7cc93f] {
3863
+ animation: slide-in-right-cb7cc93f 300ms ease-out forwards;
3793
3864
  will-change: transform, opacity;
3794
3865
  }
3795
- :where(.vue-chat, .vue-chat *).animate-slide-left[data-v-9b959d0c] {
3796
- animation: slide-in-left-9b959d0c 300ms ease-out forwards;
3866
+ :where(.vue-chat, .vue-chat *).animate-slide-left[data-v-cb7cc93f] {
3867
+ animation: slide-in-left-cb7cc93f 300ms ease-out forwards;
3797
3868
  will-change: transform, opacity;
3798
3869
  }
3799
- :where(.vue-chat, .vue-chat *)#list[data-v-9b959d0c] {
3870
+ :where(.vue-chat, .vue-chat *)#list[data-v-cb7cc93f] {
3800
3871
  will-change: padding-top;
3801
3872
  }
3802
- :where(.vue-chat, .vue-chat *).animate-request-in[data-v-9b959d0c] {
3803
- animation: request-in-9b959d0c 0.4s ease-out forwards;
3873
+ :where(.vue-chat, .vue-chat *).animate-request-in[data-v-cb7cc93f] {
3874
+ animation: request-in-cb7cc93f 0.4s ease-out forwards;
3804
3875
  overflow: hidden;
3805
3876
  transform: scaleY(-1);
3806
3877
  }
3807
- @keyframes request-in-9b959d0c {
3878
+ @keyframes request-in-cb7cc93f {
3808
3879
  0% {
3809
3880
  opacity: 0;
3810
3881
  max-height: 0;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("./index-B17prQrp.cjs");
3
+ const index = require("./index-efTNVoBF.cjs");
4
4
  const vue = require("vue");
5
5
  const core = require("@vueuse/core");
6
6
  const Button = require("primevue/button");
@@ -175,35 +175,35 @@ function useCall() {
175
175
  remoteParents: ui.remoteParents
176
176
  };
177
177
  }
178
- const _hoisted_1 = { class: "relative h-full w-full" };
179
- const _hoisted_2 = { class: "absolute top-3 right-3 left-3 z-10 flex items-center justify-between" };
180
- const _hoisted_3 = { class: "flex items-center gap-x-2 rounded-full bg-black/40 px-3 py-1.5 backdrop-blur-sm" };
181
- const _hoisted_4 = { class: "text-label-sm text-white/90 select-none" };
182
- const _hoisted_5 = { class: "absolute right-3 bottom-3 left-3 z-10 flex items-center justify-between" };
183
- const _hoisted_6 = { class: "flex items-center gap-2" };
184
- const _hoisted_7 = {
178
+ const _hoisted_1 = ["dir"];
179
+ const _hoisted_2 = { class: "relative h-full w-full" };
180
+ const _hoisted_3 = { class: "absolute top-3 right-3 left-3 z-10 flex items-center justify-between" };
181
+ const _hoisted_4 = { class: "flex items-center gap-x-2 rounded-full bg-black/40 px-3 py-1.5 backdrop-blur-sm" };
182
+ const _hoisted_5 = { class: "text-label-sm text-white/90 select-none" };
183
+ const _hoisted_6 = { class: "absolute right-3 bottom-3 left-3 z-10 flex items-center justify-between" };
184
+ const _hoisted_7 = { class: "flex items-center gap-2" };
185
+ const _hoisted_8 = {
185
186
  key: 0,
186
187
  class: "flex gap-1"
187
188
  };
188
- const _hoisted_8 = {
189
+ const _hoisted_9 = {
189
190
  key: 0,
190
191
  class: "flex h-7 w-7 items-center justify-center rounded-full bg-diamond-error"
191
192
  };
192
- const _hoisted_9 = {
193
+ const _hoisted_10 = {
193
194
  key: 1,
194
195
  class: "flex h-7 w-7 items-center justify-center rounded-full bg-diamond-error"
195
196
  };
196
- const _hoisted_10 = {
197
- "data-testid": "call-view",
198
- class: "vue-chat fixed inset-0 z-[60] flex h-full w-full flex-col bg-diamond-black"
197
+ const _hoisted_11 = ["dir"];
198
+ const _hoisted_12 = { class: "flex items-center gap-x-4" };
199
+ const _hoisted_13 = { class: "hidden select-none text-label-lg text-white md:block" };
200
+ const _hoisted_14 = { class: "flex items-center gap-x-2 text-white text-body-sm" };
201
+ const _hoisted_15 = { "data-testid": "call-participants" };
202
+ const _hoisted_16 = { class: "flex items-center gap-x-4.5" };
203
+ const _hoisted_17 = {
204
+ dir: "ltr",
205
+ class: "flex h-6 items-center justify-center rounded-full bg-white/15 px-2.5 text-body-sm text-white tabular-nums select-none"
199
206
  };
200
- const _hoisted_11 = { class: "flex items-center gap-x-4" };
201
- const _hoisted_12 = { class: "hidden select-none text-label-lg text-white md:block" };
202
- const _hoisted_13 = { class: "flex items-center gap-x-2 text-white text-body-sm" };
203
- const _hoisted_14 = { "data-testid": "call-participants" };
204
- const _hoisted_15 = { class: "flex items-center gap-x-4.5" };
205
- const _hoisted_16 = { class: "flex h-6 items-center justify-center rounded-full bg-diamond-error px-2 text-white select-none" };
206
- const _hoisted_17 = { class: "text-body-sm" };
207
207
  const _hoisted_18 = { class: "grid h-full min-h-0 w-full min-w-0 grid-cols-1 gap-4 md:grid-cols-[repeat(auto-fit,minmax(300px,1fr))]" };
208
208
  const _hoisted_19 = { class: "absolute bottom-3 left-3 z-20 flex items-center gap-x-2" };
209
209
  const _hoisted_20 = { class: "rounded bg-black-500 px-2 py-1 text-label-sm text-white select-none" };
@@ -230,6 +230,7 @@ const _hoisted_34 = { class: "text-label-md" };
230
230
  const PIP_WIDTH = 280;
231
231
  const PIP_HEIGHT = 160;
232
232
  const PADDING = 16;
233
+ const PIP_INSET_Y = 96;
233
234
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
234
235
  __name: "Call",
235
236
  setup(__props) {
@@ -237,8 +238,14 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
237
238
  const minimizedRef = vue.ref(null);
238
239
  const bodyRef = vue.ref(null);
239
240
  const cameraPickerOpen = vue.ref(false);
240
- const { t, locale } = index.useLocalI18n(index.chat);
241
+ const { t } = index.useLocalI18n(index.chat);
241
242
  const { dir } = index.useDirection();
243
+ const chatStore = index.useChatStore();
244
+ const callTitle = vue.computed(() => {
245
+ const contact = callStore.channelId ? chatStore.getContactById(callStore.channelId) : null;
246
+ const name = contact ? `${contact.name} ${contact.lastName ?? ""}`.trim() : "";
247
+ return name || t("chat.call.title");
248
+ });
242
249
  const {
243
250
  toggleVideoPause,
244
251
  toggleRemote,
@@ -350,7 +357,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
350
357
  const { x, y, isDragging } = core.useDraggable(minimizedRef, {
351
358
  initialValue: {
352
359
  x: typeof window !== "undefined" ? window.innerWidth - PIP_WIDTH - PADDING : PADDING,
353
- y: typeof window !== "undefined" ? window.innerHeight - PIP_HEIGHT - PADDING : PADDING
360
+ y: PIP_INSET_Y
354
361
  },
355
362
  // غیرفعال کردن درگ در صورتی که کامپوننت مینیمایز نباشد
356
363
  disabled: vue.computed(() => !callStore.isMinimized)
@@ -358,10 +365,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
358
365
  vue.watch(isDragging, (dragging) => {
359
366
  if (!dragging && callStore.isMinimized) {
360
367
  const maxX = windowWidth.value - PIP_WIDTH - PADDING;
361
- const maxY = windowHeight.value - PIP_HEIGHT - PADDING;
362
- dir.value === "rtl";
368
+ const maxY = windowHeight.value - PIP_HEIGHT - PIP_INSET_Y;
363
369
  const targetX = x.value < windowWidth.value / 2 ? PADDING : maxX;
364
- const targetY = y.value < windowHeight.value / 2 ? PADDING : maxY;
370
+ const targetY = y.value < windowHeight.value / 2 ? PIP_INSET_Y : maxY;
365
371
  x.value = targetX;
366
372
  y.value = targetY;
367
373
  }
@@ -373,7 +379,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
373
379
  vue.nextTick(() => {
374
380
  const isRtl = dir.value === "rtl";
375
381
  x.value = isRtl ? PADDING : windowWidth.value - PIP_WIDTH - PADDING;
376
- y.value = windowHeight.value - PIP_HEIGHT - PADDING;
382
+ y.value = PIP_INSET_Y;
377
383
  });
378
384
  }
379
385
  },
@@ -399,7 +405,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
399
405
  ref: minimizedRef,
400
406
  "data-testid": "call-pip",
401
407
  style: vue.normalizeStyle(clampedStyle.value),
402
- class: vue.normalizeClass(["vue-chat fixed w-70 h-40 bg-black-600 rounded-2xl shadow-floating z-9999 overflow-hidden border border-white/10 flex flex-col items-center justify-center cursor-move touch-none", [!vue.unref(isDragging) ? "transition-all duration-300 ease-out" : ""]])
408
+ dir: vue.unref(dir),
409
+ class: vue.normalizeClass(["vue-chat font-chat-family fixed w-70 h-40 bg-black-600 rounded-2xl shadow-floating z-9999 overflow-hidden border border-white/10 flex flex-col items-center justify-center cursor-move touch-none", [!vue.unref(isDragging) ? "transition-all duration-300 ease-out" : ""]])
403
410
  }, [
404
411
  vue.createElementVNode("video", {
405
412
  ref_key: "pipVideoRef",
@@ -411,14 +418,14 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
411
418
  }, null, 512),
412
419
  _cache[18] || (_cache[18] = vue.createElementVNode("div", { class: "pointer-events-none absolute inset-0 bg-gradient-to-br from-blue-500/5 via-purple-500/5 to-pink-500/5 opacity-0 transition-opacity duration-500 group-hover:opacity-100" }, null, -1)),
413
420
  _cache[19] || (_cache[19] = vue.createElementVNode("div", { class: "pointer-events-none absolute inset-0 bg-gradient-to-t from-black/50 via-transparent to-black/20" }, null, -1)),
414
- vue.createElementVNode("div", _hoisted_1, [
415
- vue.createElementVNode("div", _hoisted_2, [
416
- vue.createElementVNode("div", _hoisted_3, [
421
+ vue.createElementVNode("div", _hoisted_2, [
422
+ vue.createElementVNode("div", _hoisted_3, [
423
+ vue.createElementVNode("div", _hoisted_4, [
417
424
  _cache[16] || (_cache[16] = vue.createElementVNode("div", { class: "relative" }, [
418
425
  vue.createElementVNode("div", { class: "h-2.5 w-2.5 animate-pulse rounded-full bg-diamond-error" }),
419
426
  vue.createElementVNode("div", { class: "absolute inset-0 h-2.5 w-2.5 animate-ping rounded-full bg-diamond-error/30" })
420
427
  ], -1)),
421
- vue.createElementVNode("span", _hoisted_4, vue.toDisplayString(vue.unref(t)("Call active")), 1),
428
+ vue.createElementVNode("span", _hoisted_5, vue.toDisplayString(vue.unref(t)("chat.call.active")), 1),
422
429
  _cache[17] || (_cache[17] = vue.createElementVNode("div", { class: "flex -space-x-1" }, [
423
430
  vue.createElementVNode("div", {
424
431
  class: "h-1.5 w-1.5 animate-pulse rounded-full bg-green-400",
@@ -446,8 +453,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
446
453
  onClick: vue.withModifiers(vue.unref(endCall), ["stop"])
447
454
  }, null, 8, ["label", "onClick"])
448
455
  ]),
449
- vue.createElementVNode("div", _hoisted_5, [
450
- vue.createElementVNode("div", _hoisted_6, [
456
+ vue.createElementVNode("div", _hoisted_6, [
457
+ vue.createElementVNode("div", _hoisted_7, [
451
458
  vue.createVNode(vue.unref(Button), {
452
459
  label: String(vue.unref(participantCount)),
453
460
  "aria-label": vue.unref(t)("chat.call.controls.nextParticipant"),
@@ -468,14 +475,14 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
468
475
  ]),
469
476
  _: 1
470
477
  }, 8, ["label", "aria-label", "disabled"]),
471
- !vue.unref(isAudioOn) || !vue.unref(isVideoOn) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, [
472
- !vue.unref(isAudioOn) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, [
478
+ !vue.unref(isAudioOn) || !vue.unref(isVideoOn) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, [
479
+ !vue.unref(isAudioOn) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9, [
473
480
  vue.createVNode(_component_BIcon, {
474
481
  icon: "PhMicrophoneSlash",
475
482
  class: "h-3 w-3 fill-white"
476
483
  })
477
484
  ])) : vue.createCommentVNode("", true),
478
- !vue.unref(isVideoOn) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9, [
485
+ !vue.unref(isVideoOn) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10, [
479
486
  vue.createVNode(_component_BIcon, {
480
487
  icon: "PhVideoCameraSlash",
481
488
  class: "h-3 w-3 fill-white"
@@ -496,8 +503,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
496
503
  }, null, 8, ["label"])
497
504
  ])
498
505
  ])
499
- ], 6)) : vue.createCommentVNode("", true),
500
- vue.withDirectives(vue.createElementVNode("div", _hoisted_10, [
506
+ ], 14, _hoisted_1)) : vue.createCommentVNode("", true),
507
+ vue.withDirectives(vue.createElementVNode("div", {
508
+ "data-testid": "call-view",
509
+ dir: vue.unref(dir),
510
+ class: "vue-chat font-chat-family fixed inset-0 z-[60] flex h-full w-full flex-col bg-diamond-black"
511
+ }, [
501
512
  !vue.unref(callStore).isMinimized ? (vue.openBlock(), vue.createElementBlock("div", {
502
513
  key: 0,
503
514
  class: vue.normalizeClass(["flex h-16 items-center justify-between px-4 transition-all duration-300 sm:h-20", vue.unref(showControls) ? "opacity-100" : "opacity-0"]),
@@ -506,24 +517,18 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
506
517
  onMousemove: _cache[5] || (_cache[5] = //@ts-ignore
507
518
  (...args) => vue.unref(resetControlsTimeout) && vue.unref(resetControlsTimeout)(...args))
508
519
  }, [
509
- vue.createElementVNode("div", _hoisted_11, [
510
- vue.createElementVNode("div", _hoisted_12, vue.toDisplayString(vue.unref(t)("Behayand Meeting")), 1),
511
- vue.createElementVNode("div", _hoisted_13, [
520
+ vue.createElementVNode("div", _hoisted_12, [
521
+ vue.createElementVNode("div", _hoisted_13, vue.toDisplayString(callTitle.value), 1),
522
+ vue.createElementVNode("div", _hoisted_14, [
512
523
  vue.createVNode(_component_BIcon, {
513
524
  icon: "PhUsers",
514
525
  class: "h-4 w-4 fill-white"
515
526
  }),
516
- vue.createElementVNode("span", _hoisted_14, vue.toDisplayString(vue.unref(participantCount)) + " " + vue.toDisplayString(vue.unref(participantCount) > 1 ? vue.unref(t)("participants") : vue.unref(t)("participant")), 1)
527
+ vue.createElementVNode("span", _hoisted_15, vue.toDisplayString(vue.unref(t)("chat.call.participants", vue.unref(participantCount))), 1)
517
528
  ])
518
529
  ]),
519
- vue.createElementVNode("div", _hoisted_15, [
520
- vue.createElementVNode("div", _hoisted_16, [
521
- vue.createElementVNode("div", _hoisted_17, vue.toDisplayString((/* @__PURE__ */ new Date()).toLocaleTimeString(vue.unref(locale), {
522
- hour: "2-digit",
523
- minute: "2-digit",
524
- hour12: true
525
- })), 1)
526
- ]),
530
+ vue.createElementVNode("div", _hoisted_16, [
531
+ vue.createElementVNode("div", _hoisted_17, vue.toDisplayString(vue.unref(index.formatDuration)(vue.unref(callStore).elapsedTime)), 1),
527
532
  vue.createVNode(index._sfc_main, vue.mergeProps({
528
533
  icon: "PhCaretDown",
529
534
  label: vue.unref(t)("chat.call.controls.minimize")
@@ -552,7 +557,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
552
557
  class: "absolute inset-0 z-0 h-full w-full object-cover"
553
558
  }, null, 512),
554
559
  vue.createElementVNode("div", _hoisted_19, [
555
- vue.createElementVNode("div", _hoisted_20, vue.toDisplayString(vue.unref(t)("Your Presentation")), 1),
560
+ vue.createElementVNode("div", _hoisted_20, vue.toDisplayString(vue.unref(t)("chat.call.yourPresentation")), 1),
556
561
  vue.createElementVNode("div", _hoisted_21, [
557
562
  vue.createVNode(_component_BIcon, {
558
563
  icon: "PhMonitor",
@@ -639,7 +644,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
639
644
  class: "absolute inset-0 z-0 h-full w-full object-cover"
640
645
  }, null, 512),
641
646
  vue.createElementVNode("div", _hoisted_24, [
642
- vue.createElementVNode("div", _hoisted_25, vue.toDisplayString(vue.unref(t)("Presentation of")) + " " + vue.toDisplayString(stream.name.slice(0, 15)), 1),
647
+ vue.createElementVNode("div", _hoisted_25, vue.toDisplayString(vue.unref(t)("chat.call.presentationOf", { name: stream.name.slice(0, 15) })), 1),
643
648
  vue.createElementVNode("div", _hoisted_26, [
644
649
  vue.createVNode(_component_BIcon, {
645
650
  icon: "PhMonitor",
@@ -691,7 +696,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
691
696
  }, null, 512),
692
697
  _cache[20] || (_cache[20] = vue.createElementVNode("div", { class: "pointer-events-none absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent" }, null, -1)),
693
698
  vue.createElementVNode("div", _hoisted_27, [
694
- vue.createElementVNode("div", _hoisted_28, vue.toDisplayString(vue.unref(t)("You")), 1),
699
+ vue.createElementVNode("div", _hoisted_28, vue.toDisplayString(vue.unref(t)("chat.call.you")), 1),
695
700
  !vue.unref(isAudioOn) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_29, [
696
701
  vue.createVNode(_component_BIcon, {
697
702
  icon: "PhMicrophoneSlash",
@@ -718,9 +723,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
718
723
  !vue.unref(isVideoOn) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_30, [
719
724
  vue.createElementVNode("div", _hoisted_31, [
720
725
  vue.createElementVNode("div", _hoisted_32, [
721
- vue.createElementVNode("span", _hoisted_33, vue.toDisplayString(vue.unref(t)("You")), 1)
726
+ vue.createElementVNode("span", _hoisted_33, vue.toDisplayString(vue.unref(t)("chat.call.you")), 1)
722
727
  ]),
723
- vue.createElementVNode("p", _hoisted_34, vue.toDisplayString(vue.unref(t)("Camera is off")), 1)
728
+ vue.createElementVNode("p", _hoisted_34, vue.toDisplayString(vue.unref(t)("chat.call.cameraIsOff")), 1)
724
729
  ])
725
730
  ])) : vue.createCommentVNode("", true)
726
731
  ], 2)) : vue.createCommentVNode("", true)
@@ -807,7 +812,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
807
812
  onClick: vue.unref(endCall)
808
813
  }, null, 8, ["label", "onClick"])
809
814
  ], 34)) : vue.createCommentVNode("", true)
810
- ], 512), [
815
+ ], 8, _hoisted_11), [
811
816
  [vue.vShow, vue.unref(callStore).isActive && !vue.unref(callStore).isMinimized]
812
817
  ])
813
818
  ], 64);
@@ -815,4 +820,4 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
815
820
  }
816
821
  });
817
822
  exports.default = _sfc_main;
818
- //# sourceMappingURL=Call-BeGdr-d7.cjs.map
823
+ //# sourceMappingURL=Call-CDT92h1x.cjs.map