vue-parley 4.0.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.
- package/LICENSE +21 -0
- package/README.md +276 -0
- package/dist/chat.css +3223 -0
- package/dist/chunks/Call-CTIujxDi.cjs +818 -0
- package/dist/chunks/Call-CTIujxDi.cjs.map +1 -0
- package/dist/chunks/Call-Dwuyd-Ut.mjs +818 -0
- package/dist/chunks/Call-Dwuyd-Ut.mjs.map +1 -0
- package/dist/chunks/index-D50Yn7q4.cjs +7031 -0
- package/dist/chunks/index-D50Yn7q4.cjs.map +1 -0
- package/dist/chunks/index-JU_JZkSC.mjs +7010 -0
- package/dist/chunks/index-JU_JZkSC.mjs.map +1 -0
- package/dist/chunks/session-B3KIrj3_.mjs +711 -0
- package/dist/chunks/session-B3KIrj3_.mjs.map +1 -0
- package/dist/chunks/session-BOfkV8PJ.cjs +711 -0
- package/dist/chunks/session-BOfkV8PJ.cjs.map +1 -0
- package/dist/fakes.cjs +335 -0
- package/dist/fakes.cjs.map +1 -0
- package/dist/fakes.mjs +335 -0
- package/dist/fakes.mjs.map +1 -0
- package/dist/index.cjs +24 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.mjs +24 -0
- package/dist/index.mjs.map +1 -0
- package/dist/types/app/components/ChatPage.vue.d.ts +60 -0
- package/dist/types/app/components/ChatPage.vue.d.ts.map +1 -0
- package/dist/types/app/components/call/Call.vue.d.ts +8 -0
- package/dist/types/app/components/call/Call.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/ChatBubble.vue.d.ts +64 -0
- package/dist/types/app/components/chat/ChatBubble.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/ChatInput.vue.d.ts +60 -0
- package/dist/types/app/components/chat/ChatInput.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/ChatMessages.vue.d.ts +45 -0
- package/dist/types/app/components/chat/ChatMessages.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/ChatPageBar.vue.d.ts +50 -0
- package/dist/types/app/components/chat/ChatPageBar.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/ChatProfileOverview.vue.d.ts +11 -0
- package/dist/types/app/components/chat/ChatProfileOverview.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/ChatView.vue.d.ts +244 -0
- package/dist/types/app/components/chat/ChatView.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleDivider.vue.d.ts +7 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleDivider.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleImages.vue.d.ts +13 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleImages.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleMeta.vue.d.ts +11 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleMeta.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleOptions.vue.d.ts +16 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleOptions.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleRequest.vue.d.ts +8 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleRequest.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleSelectionMark.vue.d.ts +7 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleSelectionMark.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleStatus.vue.d.ts +7 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleStatus.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleVideo.vue.d.ts +25 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleVideo.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/FileDisplay.vue.d.ts +13 -0
- package/dist/types/app/components/chat/chat-bubbles/FileDisplay.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/ImageGroupDisplay.vue.d.ts +14 -0
- package/dist/types/app/components/chat/chat-bubbles/ImageGroupDisplay.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/ReplyPreview.vue.d.ts +10 -0
- package/dist/types/app/components/chat/chat-bubbles/ReplyPreview.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/UploadProgressOverlay.vue.d.ts +10 -0
- package/dist/types/app/components/chat/chat-bubbles/UploadProgressOverlay.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/VoiceDisplay.vue.d.ts +12 -0
- package/dist/types/app/components/chat/chat-bubbles/VoiceDisplay.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-input/AttachementFileDisplay.vue.d.ts +12 -0
- package/dist/types/app/components/chat/chat-input/AttachementFileDisplay.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-input/InputActionBar.vue.d.ts +13 -0
- package/dist/types/app/components/chat/chat-input/InputActionBar.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-input/InputAttachement.vue.d.ts +18 -0
- package/dist/types/app/components/chat/chat-input/InputAttachement.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-input/PermissionPopup.vue.d.ts +8 -0
- package/dist/types/app/components/chat/chat-input/PermissionPopup.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-input/RecordButton.vue.d.ts +27 -0
- package/dist/types/app/components/chat/chat-input/RecordButton.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-input/RecordingStatus.vue.d.ts +12 -0
- package/dist/types/app/components/chat/chat-input/RecordingStatus.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-input/VideoRecordDisplay.vue.d.ts +26 -0
- package/dist/types/app/components/chat/chat-input/VideoRecordDisplay.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/contact/ChatContactDisplay.vue.d.ts +8 -0
- package/dist/types/app/components/chat/contact/ChatContactDisplay.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/contact/ChatList.vue.d.ts +5 -0
- package/dist/types/app/components/chat/contact/ChatList.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/contact/ChatListSearch.vue.d.ts +16 -0
- package/dist/types/app/components/chat/contact/ChatListSearch.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/contact/ContactAvatar.vue.d.ts +10 -0
- package/dist/types/app/components/chat/contact/ContactAvatar.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/contact/ContactSkeleton.vue.d.ts +3 -0
- package/dist/types/app/components/chat/contact/ContactSkeleton.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/messages/FloatingDateHeader.vue.d.ts +9 -0
- package/dist/types/app/components/chat/messages/FloatingDateHeader.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/messages/MessagesSkeleton.vue.d.ts +8 -0
- package/dist/types/app/components/chat/messages/MessagesSkeleton.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/messages/ScrollToBottomButton.vue.d.ts +11 -0
- package/dist/types/app/components/chat/messages/ScrollToBottomButton.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/profile/FileDisplay.vue.d.ts +9 -0
- package/dist/types/app/components/chat/profile/FileDisplay.vue.d.ts.map +1 -0
- package/dist/types/app/components/general/ConfirmModal.vue.d.ts +21 -0
- package/dist/types/app/components/general/ConfirmModal.vue.d.ts.map +1 -0
- package/dist/types/app/components/general/FileFormatDisplay.vue.d.ts +16 -0
- package/dist/types/app/components/general/FileFormatDisplay.vue.d.ts.map +1 -0
- package/dist/types/app/components/general/IconButton.vue.d.ts +13 -0
- package/dist/types/app/components/general/IconButton.vue.d.ts.map +1 -0
- package/dist/types/app/components/general/LoadingStatus.vue.d.ts +16 -0
- package/dist/types/app/components/general/LoadingStatus.vue.d.ts.map +1 -0
- package/dist/types/app/components/general/MediaImage.vue.d.ts +30 -0
- package/dist/types/app/components/general/MediaImage.vue.d.ts.map +1 -0
- package/dist/types/app/components/general/NoDataDisplay.vue.d.ts +7 -0
- package/dist/types/app/components/general/NoDataDisplay.vue.d.ts.map +1 -0
- package/dist/types/app/components/general/ResponsiveDialog.vue.d.ts +28 -0
- package/dist/types/app/components/general/ResponsiveDialog.vue.d.ts.map +1 -0
- package/dist/types/app/components/general/SafeEmojiText.vue.d.ts +10 -0
- package/dist/types/app/components/general/SafeEmojiText.vue.d.ts.map +1 -0
- package/dist/types/app/components/global/BEmojiPicker.vue.d.ts +8 -0
- package/dist/types/app/components/global/BEmojiPicker.vue.d.ts.map +1 -0
- package/dist/types/app/components/global/BIcon.vue.d.ts +11 -0
- package/dist/types/app/components/global/BIcon.vue.d.ts.map +1 -0
- package/dist/types/app/components/global/BVirtualVerticalList.vue.d.ts +30 -0
- package/dist/types/app/components/global/BVirtualVerticalList.vue.d.ts.map +1 -0
- package/dist/types/app/composables/call/media.d.ts +204 -0
- package/dist/types/app/composables/call/media.d.ts.map +1 -0
- package/dist/types/app/composables/call/peer.d.ts +39 -0
- package/dist/types/app/composables/call/peer.d.ts.map +1 -0
- package/dist/types/app/composables/call/peers.d.ts +54 -0
- package/dist/types/app/composables/call/peers.d.ts.map +1 -0
- package/dist/types/app/composables/call/session.d.ts +284 -0
- package/dist/types/app/composables/call/session.d.ts.map +1 -0
- package/dist/types/app/composables/call/signaling.d.ts +36 -0
- package/dist/types/app/composables/call/signaling.d.ts.map +1 -0
- package/dist/types/app/composables/call/useCallUi.d.ts +27 -0
- package/dist/types/app/composables/call/useCallUi.d.ts.map +1 -0
- package/dist/types/app/composables/chat/useChatRecording.d.ts +75 -0
- package/dist/types/app/composables/chat/useChatRecording.d.ts.map +1 -0
- package/dist/types/app/composables/chat/useInputDraft.d.ts +14 -0
- package/dist/types/app/composables/chat/useInputDraft.d.ts.map +1 -0
- package/dist/types/app/composables/useAppPermissions.d.ts +25 -0
- package/dist/types/app/composables/useAppPermissions.d.ts.map +1 -0
- package/dist/types/app/composables/useAppToast.d.ts +13 -0
- package/dist/types/app/composables/useAppToast.d.ts.map +1 -0
- package/dist/types/app/composables/useAttachmentPicker.d.ts +18 -0
- package/dist/types/app/composables/useAttachmentPicker.d.ts.map +1 -0
- package/dist/types/app/composables/useCall.d.ts +91 -0
- package/dist/types/app/composables/useCall.d.ts.map +1 -0
- package/dist/types/app/composables/useChatMessageList.d.ts +18 -0
- package/dist/types/app/composables/useChatMessageList.d.ts.map +1 -0
- package/dist/types/app/composables/useDate.d.ts +7 -0
- package/dist/types/app/composables/useDate.d.ts.map +1 -0
- package/dist/types/app/composables/useDevice.d.ts +32 -0
- package/dist/types/app/composables/useDevice.d.ts.map +1 -0
- package/dist/types/app/composables/useFlippedVirtualScroll.d.ts +22 -0
- package/dist/types/app/composables/useFlippedVirtualScroll.d.ts.map +1 -0
- package/dist/types/app/composables/useHostI18n.d.ts +15 -0
- package/dist/types/app/composables/useHostI18n.d.ts.map +1 -0
- package/dist/types/app/composables/useLocalI18n.d.ts +5 -0
- package/dist/types/app/composables/useLocalI18n.d.ts.map +1 -0
- package/dist/types/app/composables/useLongPress.d.ts +6 -0
- package/dist/types/app/composables/useLongPress.d.ts.map +1 -0
- package/dist/types/app/composables/useRichTextEditor.d.ts +12 -0
- package/dist/types/app/composables/useRichTextEditor.d.ts.map +1 -0
- package/dist/types/app/directives/loading.d.ts +6 -0
- package/dist/types/app/directives/loading.d.ts.map +1 -0
- package/dist/types/app/index.d.ts +31 -0
- package/dist/types/app/index.d.ts.map +1 -0
- package/dist/types/app/plugin.d.ts +28 -0
- package/dist/types/app/plugin.d.ts.map +1 -0
- package/dist/types/app/provider/callProvider.d.ts +7 -0
- package/dist/types/app/provider/callProvider.d.ts.map +1 -0
- package/dist/types/app/stores/callStore.d.ts +1626 -0
- package/dist/types/app/stores/callStore.d.ts.map +1 -0
- package/dist/types/app/stores/chatStore.d.ts +126 -0
- package/dist/types/app/stores/chatStore.d.ts.map +1 -0
- package/dist/types/app/stores/mediaStore.d.ts +18 -0
- package/dist/types/app/stores/mediaStore.d.ts.map +1 -0
- package/dist/types/app/stores/messageStores.d.ts +2460 -0
- package/dist/types/app/stores/messageStores.d.ts.map +1 -0
- package/dist/types/app/stores/profileStore.d.ts +102 -0
- package/dist/types/app/stores/profileStore.d.ts.map +1 -0
- package/dist/types/app/types/components/chat-input.d.ts +4 -0
- package/dist/types/app/types/components/chat-input.d.ts.map +1 -0
- package/dist/types/app/types/components/menu-options.d.ts +7 -0
- package/dist/types/app/types/components/menu-options.d.ts.map +1 -0
- package/dist/types/app/types/components/modal.d.ts +17 -0
- package/dist/types/app/types/components/modal.d.ts.map +1 -0
- package/dist/types/app/types/index.d.ts +257 -0
- package/dist/types/app/types/index.d.ts.map +1 -0
- package/dist/types/app/utils/emojiParser.d.ts +5 -0
- package/dist/types/app/utils/emojiParser.d.ts.map +1 -0
- package/dist/types/app/utils/format.d.ts +4 -0
- package/dist/types/app/utils/format.d.ts.map +1 -0
- package/dist/types/fakes/backend.d.ts +25 -0
- package/dist/types/fakes/backend.d.ts.map +1 -0
- package/dist/types/fakes/call.d.ts +7 -0
- package/dist/types/fakes/call.d.ts.map +1 -0
- package/dist/types/fakes/data.d.ts +13 -0
- package/dist/types/fakes/data.d.ts.map +1 -0
- package/dist/types/fakes/index.d.ts +7 -0
- package/dist/types/fakes/index.d.ts.map +1 -0
- package/dist/types/fakes.d.ts +2 -0
- package/dist/types/i18n/locales/index.d.ts +3557 -0
- package/dist/types/i18n/locales/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/package.json +98 -0
package/dist/fakes.mjs
ADDED
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
const toJson = (value) => JSON.parse(
|
|
2
|
+
JSON.stringify(
|
|
3
|
+
value,
|
|
4
|
+
(key, val) => ["prevMessage", "nextMessage", "contact"].includes(key) ? void 0 : val
|
|
5
|
+
)
|
|
6
|
+
);
|
|
7
|
+
const clone = (value) => structuredClone(value);
|
|
8
|
+
function createFakeBackend(data, { latency = 50 } = {}) {
|
|
9
|
+
const { contacts, messages: db } = data;
|
|
10
|
+
const state = {
|
|
11
|
+
failNextSend: false,
|
|
12
|
+
failNextDelete: false,
|
|
13
|
+
failNextEdit: false,
|
|
14
|
+
calls: []
|
|
15
|
+
};
|
|
16
|
+
const log = (fn, ...args) => state.calls.push({ fn, args: toJson(args) });
|
|
17
|
+
const delay = (ms = latency) => new Promise((r) => setTimeout(r, ms));
|
|
18
|
+
const consume = (flag) => {
|
|
19
|
+
const armed = state[flag];
|
|
20
|
+
state[flag] = false;
|
|
21
|
+
return armed;
|
|
22
|
+
};
|
|
23
|
+
let serverId = 0;
|
|
24
|
+
const chat = {
|
|
25
|
+
async fetchConversations(params) {
|
|
26
|
+
log("fetchConversations", params);
|
|
27
|
+
await delay();
|
|
28
|
+
const q = (params.search ?? "").trim().toLowerCase();
|
|
29
|
+
const filtered = contacts.filter((c) => {
|
|
30
|
+
if (q && !`${c.name} ${c.lastName}`.toLowerCase().includes(q)) return false;
|
|
31
|
+
if (params.state === "online") return c.isOnline;
|
|
32
|
+
if (params.state === "active") return c.isActive;
|
|
33
|
+
if (params.state === "ended") return !c.isActive;
|
|
34
|
+
return true;
|
|
35
|
+
});
|
|
36
|
+
const start = (params.page - 1) * params.pageSize;
|
|
37
|
+
return {
|
|
38
|
+
data: clone(filtered.slice(start, start + params.pageSize)),
|
|
39
|
+
hasNextPage: start + params.pageSize < filtered.length
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
async deleteConversation(id) {
|
|
43
|
+
log("deleteConversation", id);
|
|
44
|
+
await delay();
|
|
45
|
+
const i = contacts.findIndex((c) => c.id === id);
|
|
46
|
+
if (i !== -1) contacts.splice(i, 1);
|
|
47
|
+
},
|
|
48
|
+
async endConversation(id) {
|
|
49
|
+
log("endConversation", id);
|
|
50
|
+
await delay();
|
|
51
|
+
const c = contacts.find((c2) => c2.id === id);
|
|
52
|
+
if (c) c.isActive = false;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const messages = {
|
|
56
|
+
async sendMessage(message, opts) {
|
|
57
|
+
var _a;
|
|
58
|
+
log("sendMessage", { ...message, date: void 0 });
|
|
59
|
+
if (opts == null ? void 0 : opts.onProgress) {
|
|
60
|
+
for (const progress of [25, 50, 100]) {
|
|
61
|
+
await delay(latency / 2);
|
|
62
|
+
opts.onProgress({ uploaded: progress, total: 100, progress });
|
|
63
|
+
}
|
|
64
|
+
} else {
|
|
65
|
+
await delay();
|
|
66
|
+
}
|
|
67
|
+
if (consume("failNextSend")) throw new Error("send failed (fake backend)");
|
|
68
|
+
const saved = {
|
|
69
|
+
...toJson(message),
|
|
70
|
+
date: new Date(message.date),
|
|
71
|
+
id: `srv-${++serverId}`,
|
|
72
|
+
isSent: true
|
|
73
|
+
};
|
|
74
|
+
(_a = db.get(message.conversationId)) == null ? void 0 : _a.push(saved);
|
|
75
|
+
const c = contacts.find((c2) => c2.id === message.conversationId);
|
|
76
|
+
if (c) c.lastMessage = saved;
|
|
77
|
+
return clone(saved);
|
|
78
|
+
},
|
|
79
|
+
async editMessage(id, text2) {
|
|
80
|
+
log("editMessage", id, text2);
|
|
81
|
+
await delay();
|
|
82
|
+
if (consume("failNextEdit")) throw new Error("edit failed (fake backend)");
|
|
83
|
+
for (const list of db.values()) {
|
|
84
|
+
const m = list.find((m2) => m2.id === id);
|
|
85
|
+
if (m) {
|
|
86
|
+
m.text = text2;
|
|
87
|
+
m.isEdited = true;
|
|
88
|
+
return clone(m);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
throw new Error(`no message ${id}`);
|
|
92
|
+
},
|
|
93
|
+
async deleteMessages(ids) {
|
|
94
|
+
log("deleteMessages", ids);
|
|
95
|
+
await delay();
|
|
96
|
+
if (consume("failNextDelete")) throw new Error("delete failed (fake backend)");
|
|
97
|
+
for (const [key, list] of db) {
|
|
98
|
+
db.set(
|
|
99
|
+
key,
|
|
100
|
+
list.filter((m) => !ids.includes(m.id))
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
async fetchMessages({ conversationId, page, pageSize }) {
|
|
105
|
+
log("fetchMessages", { conversationId, page, pageSize });
|
|
106
|
+
await delay();
|
|
107
|
+
const list = db.get(conversationId) ?? [];
|
|
108
|
+
const end = list.length - (page - 1) * pageSize;
|
|
109
|
+
return clone(list.slice(Math.max(0, end - pageSize), Math.max(0, end)));
|
|
110
|
+
},
|
|
111
|
+
async markRead(conversationId) {
|
|
112
|
+
log("markRead", conversationId);
|
|
113
|
+
const c = contacts.find((c2) => c2.id === conversationId);
|
|
114
|
+
if (c) c.unreadCount = 0;
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
const media = {
|
|
118
|
+
async download(url, opts) {
|
|
119
|
+
var _a;
|
|
120
|
+
log("download", url);
|
|
121
|
+
let blob;
|
|
122
|
+
try {
|
|
123
|
+
const res = await fetch(url, { signal: opts == null ? void 0 : opts.signal });
|
|
124
|
+
if (!res.ok) throw new Error(String(res.status));
|
|
125
|
+
blob = await res.blob();
|
|
126
|
+
} catch {
|
|
127
|
+
blob = new Blob(["fake file"], { type: "text/plain" });
|
|
128
|
+
}
|
|
129
|
+
(_a = opts == null ? void 0 : opts.onProgress) == null ? void 0 : _a.call(opts, 100);
|
|
130
|
+
return blob;
|
|
131
|
+
},
|
|
132
|
+
async getFileSize() {
|
|
133
|
+
return 1024;
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
const attachments = (conversationId, pick) => (db.get(conversationId) ?? []).flatMap(pick);
|
|
137
|
+
const profile = {
|
|
138
|
+
async fetchMedia({ conversationId, page, pageSize }) {
|
|
139
|
+
const all = attachments(conversationId, (m) => m.imageUrl ?? []);
|
|
140
|
+
const start = (page - 1) * pageSize;
|
|
141
|
+
return {
|
|
142
|
+
data: all.slice(start, start + pageSize),
|
|
143
|
+
hasNextPage: start + pageSize < all.length
|
|
144
|
+
};
|
|
145
|
+
},
|
|
146
|
+
async fetchFiles({ conversationId, page, pageSize }) {
|
|
147
|
+
const all = attachments(conversationId, (m) => m.fileUrl ? [m.fileUrl] : []);
|
|
148
|
+
const start = (page - 1) * pageSize;
|
|
149
|
+
return {
|
|
150
|
+
data: all.slice(start, start + pageSize),
|
|
151
|
+
hasNextPage: start + pageSize < all.length
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
return { chat, messages, media, profile, state };
|
|
156
|
+
}
|
|
157
|
+
function createBroadcastCallHandlers(channelName = "vue-chat-fake-call") {
|
|
158
|
+
const channel = new BroadcastChannel(channelName);
|
|
159
|
+
const listeners = /* @__PURE__ */ new Map();
|
|
160
|
+
const published = [];
|
|
161
|
+
let nextId = 0;
|
|
162
|
+
channel.onmessage = (e) => {
|
|
163
|
+
const message = JSON.parse(e.data);
|
|
164
|
+
listeners.forEach((cb) => void cb(message));
|
|
165
|
+
};
|
|
166
|
+
return {
|
|
167
|
+
published,
|
|
168
|
+
// No TURN server: peers on the same machine connect directly.
|
|
169
|
+
credential: { ttl: 3600, user: "", pass: "", urls: [] },
|
|
170
|
+
iceTransportPolicy: "all",
|
|
171
|
+
async handleGenerateCred() {
|
|
172
|
+
},
|
|
173
|
+
async publisher(json) {
|
|
174
|
+
published.push(JSON.parse(json));
|
|
175
|
+
channel.postMessage(json);
|
|
176
|
+
},
|
|
177
|
+
async subscriber(cb) {
|
|
178
|
+
const id = ++nextId;
|
|
179
|
+
listeners.set(id, cb);
|
|
180
|
+
return id;
|
|
181
|
+
},
|
|
182
|
+
async unSubscriber(id) {
|
|
183
|
+
listeners.delete(id);
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
const now = Date.now();
|
|
188
|
+
const minutesAgo = (m) => new Date(now - m * 6e4);
|
|
189
|
+
function contact(id, name, lastName, extra = {}) {
|
|
190
|
+
return {
|
|
191
|
+
id,
|
|
192
|
+
name,
|
|
193
|
+
lastName,
|
|
194
|
+
isOnline: false,
|
|
195
|
+
lastSeen: minutesAgo(90),
|
|
196
|
+
imageUrl: "",
|
|
197
|
+
isActive: true,
|
|
198
|
+
birthDate: /* @__PURE__ */ new Date("1995-01-01"),
|
|
199
|
+
serviceType: "video-call",
|
|
200
|
+
userType: ["user"],
|
|
201
|
+
...extra
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
function text(conversationId, n, senderId, body, minutes) {
|
|
205
|
+
return {
|
|
206
|
+
id: `${conversationId}-m${n}`,
|
|
207
|
+
conversationId,
|
|
208
|
+
date: minutesAgo(minutes),
|
|
209
|
+
type: "text",
|
|
210
|
+
text: body,
|
|
211
|
+
isEdited: false,
|
|
212
|
+
senderId,
|
|
213
|
+
isSent: true,
|
|
214
|
+
isRead: true
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
function withLastMessages(data) {
|
|
218
|
+
for (const c of data.contacts) {
|
|
219
|
+
const list = data.messages.get(c.id) ?? [];
|
|
220
|
+
c.lastMessage = list[list.length - 1];
|
|
221
|
+
}
|
|
222
|
+
return data;
|
|
223
|
+
}
|
|
224
|
+
function e2eData(userId) {
|
|
225
|
+
return withLastMessages({
|
|
226
|
+
contacts: [
|
|
227
|
+
contact("c1", "Sara", "Ahmadi", { isOnline: true }),
|
|
228
|
+
contact("c2", "Nima", "Karimi", { serviceType: "chat" }),
|
|
229
|
+
contact("c3", "Leila", "Moradi", { isActive: false })
|
|
230
|
+
],
|
|
231
|
+
messages: /* @__PURE__ */ new Map([
|
|
232
|
+
[
|
|
233
|
+
"c1",
|
|
234
|
+
[
|
|
235
|
+
text("c1", 1, "c1", "Hello from Sara", 30),
|
|
236
|
+
text("c1", 2, userId, "Hi Sara, how are you?", 20),
|
|
237
|
+
text("c1", 3, "c1", "Ready for the video call?", 10)
|
|
238
|
+
]
|
|
239
|
+
],
|
|
240
|
+
[
|
|
241
|
+
"c2",
|
|
242
|
+
[
|
|
243
|
+
{
|
|
244
|
+
...text("c2", 0, "c2", "", 70),
|
|
245
|
+
type: "image",
|
|
246
|
+
imageUrl: ["https://example.com/photo.png"]
|
|
247
|
+
},
|
|
248
|
+
text("c2", 1, "c2", "Nima says hi", 60)
|
|
249
|
+
]
|
|
250
|
+
],
|
|
251
|
+
["c3", [text("c3", 1, "c3", "This conversation is over", 600)]]
|
|
252
|
+
])
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
function seeded(seed) {
|
|
256
|
+
const next = () => (seed = seed * 16807 % 2147483647) / 2147483647;
|
|
257
|
+
return {
|
|
258
|
+
next,
|
|
259
|
+
int: (min, max) => Math.floor(next() * (max - min + 1)) + min,
|
|
260
|
+
pick: (items) => items[Math.floor(next() * items.length)]
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
const FIRST_NAMES = ["علی", "محمد", "حسین", "رضا", "امیر", "سعید", "مهدی", "فاطمه", "زهرا", "مریم", "سارا", "نازنین", "لیلا", "مهسا", "پویا", "آرش", "نیما", "الهام", "پریسا", "مینا"];
|
|
264
|
+
const LAST_NAMES = ["محمدی", "حسینی", "رضایی", "احمدی", "کریمی", "موسوی", "هاشمی", "جعفری", "صادقی", "نوری", "عباسی", "امیری", "فرهادی", "قاسمی", "طاهری", "مرادی"];
|
|
265
|
+
const TEXTS = [
|
|
266
|
+
"سلام، وقت بخیر",
|
|
267
|
+
"ممنون بابت پیگیری",
|
|
268
|
+
"بله، مشکلی نیست",
|
|
269
|
+
"فایل رو فرستادم، چک کنید",
|
|
270
|
+
"جلسه فردا سر ساعت ۱۰ برگزار میشه",
|
|
271
|
+
"آیا امکان تغییر زمان وجود داره؟",
|
|
272
|
+
"پروژه آماده است و میتونید بررسی کنید",
|
|
273
|
+
"با تشکر از همکاری خوبتون",
|
|
274
|
+
"من منتظر پاسخ شما هستم",
|
|
275
|
+
"مورد تایید شد",
|
|
276
|
+
"خسته نباشید",
|
|
277
|
+
"فردا تماس میگیرم"
|
|
278
|
+
];
|
|
279
|
+
const FILES = ["report.pdf", "invoice.xlsx", "contract.docx", "data.csv"];
|
|
280
|
+
function demoData(userId, count = 40) {
|
|
281
|
+
const rng = seeded(42);
|
|
282
|
+
const contacts = [];
|
|
283
|
+
const messages = /* @__PURE__ */ new Map();
|
|
284
|
+
for (let i = 1; i <= count; i++) {
|
|
285
|
+
const id = `contact-${i}`;
|
|
286
|
+
const isOnline = rng.next() < 0.4;
|
|
287
|
+
contacts.push(
|
|
288
|
+
contact(id, rng.pick(FIRST_NAMES), rng.pick(LAST_NAMES), {
|
|
289
|
+
isOnline,
|
|
290
|
+
lastSeen: minutesAgo(isOnline ? rng.int(1, 30) : rng.int(60, 10080)),
|
|
291
|
+
imageUrl: `https://i.pravatar.cc/150?img=${i % 70 + 1}`,
|
|
292
|
+
isActive: rng.next() < 0.8,
|
|
293
|
+
serviceType: rng.pick(["chat", "video-call", "voice-call"]),
|
|
294
|
+
unreadCount: rng.next() < 0.3 ? rng.int(1, 12) : 0
|
|
295
|
+
})
|
|
296
|
+
);
|
|
297
|
+
const history = [];
|
|
298
|
+
let minutes = rng.int(60, 4e3);
|
|
299
|
+
const length = rng.int(5, 60);
|
|
300
|
+
for (let n = 1; n <= length; n++) {
|
|
301
|
+
minutes -= rng.int(1, 60);
|
|
302
|
+
const senderId = rng.next() < 0.5 ? userId : id;
|
|
303
|
+
const base = text(id, n, senderId, rng.pick(TEXTS), Math.max(minutes, 1));
|
|
304
|
+
const roll = rng.next();
|
|
305
|
+
if (roll < 0.1) {
|
|
306
|
+
history.push({
|
|
307
|
+
...base,
|
|
308
|
+
type: "image",
|
|
309
|
+
text: "",
|
|
310
|
+
imageUrl: [`https://picsum.photos/seed/${id}-${n}/400/300`]
|
|
311
|
+
});
|
|
312
|
+
} else if (roll < 0.18) {
|
|
313
|
+
const fileName = rng.pick(FILES);
|
|
314
|
+
history.push({
|
|
315
|
+
...base,
|
|
316
|
+
type: "file",
|
|
317
|
+
text: "",
|
|
318
|
+
fileName,
|
|
319
|
+
fileUrl: `https://example.com/files/${fileName}`
|
|
320
|
+
});
|
|
321
|
+
} else {
|
|
322
|
+
history.push(base);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
messages.set(id, history);
|
|
326
|
+
}
|
|
327
|
+
return withLastMessages({ contacts, messages });
|
|
328
|
+
}
|
|
329
|
+
export {
|
|
330
|
+
createBroadcastCallHandlers,
|
|
331
|
+
createFakeBackend,
|
|
332
|
+
demoData,
|
|
333
|
+
e2eData
|
|
334
|
+
};
|
|
335
|
+
//# sourceMappingURL=fakes.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fakes.mjs","sources":["../fakes/backend.ts","../fakes/call.ts","../fakes/data.ts"],"sourcesContent":["// In-memory implementations of every handler interface the chat needs, shared by the demo and\n// the e2e harness. `state` lets tests make the next call fail and see which handlers ran.\nimport type {\n ChatHandlers,\n MediaHandlers,\n Message,\n MessagesHandlers,\n ProfileHandlers,\n} from \"../app/types\";\nimport type { FakeData } from \"./data\";\n\nexport interface FakeBackendState {\n failNextSend: boolean;\n failNextDelete: boolean;\n failNextEdit: boolean;\n /** Every handler call, with its arguments as JSON. */\n calls: { fn: string; args: unknown[] }[];\n}\n\nexport interface FakeBackend {\n chat: ChatHandlers;\n messages: MessagesHandlers;\n media: MediaHandlers;\n profile: ProfileHandlers;\n state: FakeBackendState;\n}\n\nexport interface FakeBackendOptions {\n /** Simulated network latency in ms. */\n latency?: number;\n}\n\n/**\n * JSON round-trip, as a network hop would do. Drops the view-only links the UI adds to messages\n * (neighbours, contact), which are circular and never meant for a server.\n */\nconst toJson = (value: unknown) =>\n JSON.parse(\n JSON.stringify(value, (key, val) =>\n [\"prevMessage\", \"nextMessage\", \"contact\"].includes(key) ? undefined : val,\n ),\n );\n\n// Handlers hand out copies, like a real server, so stores never share objects with the \"database\".\nconst clone = <T>(value: T): T => structuredClone(value);\n\nexport function createFakeBackend(\n data: FakeData,\n { latency = 50 }: FakeBackendOptions = {},\n): FakeBackend {\n const { contacts, messages: db } = data;\n const state: FakeBackendState = {\n failNextSend: false,\n failNextDelete: false,\n failNextEdit: false,\n calls: [],\n };\n const log = (fn: string, ...args: unknown[]) =>\n state.calls.push({ fn, args: toJson(args) });\n const delay = (ms = latency) => new Promise((r) => setTimeout(r, ms));\n /** Returns whether `flag` was armed, disarming it. */\n const consume = (flag: \"failNextSend\" | \"failNextDelete\" | \"failNextEdit\") => {\n const armed = state[flag];\n state[flag] = false;\n return armed;\n };\n let serverId = 0;\n\n const chat: ChatHandlers = {\n async fetchConversations(params) {\n log(\"fetchConversations\", params);\n await delay();\n const q = (params.search ?? \"\").trim().toLowerCase();\n const filtered = contacts.filter((c) => {\n if (q && !`${c.name} ${c.lastName}`.toLowerCase().includes(q)) return false;\n if (params.state === \"online\") return c.isOnline;\n if (params.state === \"active\") return c.isActive;\n if (params.state === \"ended\") return !c.isActive;\n return true;\n });\n const start = (params.page - 1) * params.pageSize;\n return {\n data: clone(filtered.slice(start, start + params.pageSize)),\n hasNextPage: start + params.pageSize < filtered.length,\n };\n },\n async deleteConversation(id) {\n log(\"deleteConversation\", id);\n await delay();\n const i = contacts.findIndex((c) => c.id === id);\n if (i !== -1) contacts.splice(i, 1);\n },\n async endConversation(id) {\n log(\"endConversation\", id);\n await delay();\n const c = contacts.find((c) => c.id === id);\n if (c) c.isActive = false;\n },\n };\n\n const messages: MessagesHandlers = {\n async sendMessage(message, opts) {\n log(\"sendMessage\", { ...message, date: undefined });\n if (opts?.onProgress) {\n for (const progress of [25, 50, 100]) {\n await delay(latency / 2);\n opts.onProgress({ uploaded: progress, total: 100, progress });\n }\n } else {\n await delay();\n }\n if (consume(\"failNextSend\")) throw new Error(\"send failed (fake backend)\");\n\n const saved: Message = {\n ...toJson(message),\n date: new Date(message.date),\n id: `srv-${++serverId}`,\n isSent: true,\n };\n db.get(message.conversationId)?.push(saved);\n const c = contacts.find((c) => c.id === message.conversationId);\n if (c) c.lastMessage = saved;\n return clone(saved);\n },\n async editMessage(id, text) {\n log(\"editMessage\", id, text);\n await delay();\n if (consume(\"failNextEdit\")) throw new Error(\"edit failed (fake backend)\");\n for (const list of db.values()) {\n const m = list.find((m) => m.id === id);\n if (m) {\n m.text = text;\n m.isEdited = true;\n return clone(m);\n }\n }\n throw new Error(`no message ${id}`);\n },\n async deleteMessages(ids) {\n log(\"deleteMessages\", ids);\n await delay();\n if (consume(\"failNextDelete\")) throw new Error(\"delete failed (fake backend)\");\n for (const [key, list] of db) {\n db.set(\n key,\n list.filter((m) => !ids.includes(m.id)),\n );\n }\n },\n async fetchMessages({ conversationId, page, pageSize }) {\n log(\"fetchMessages\", { conversationId, page, pageSize });\n await delay();\n const list = db.get(conversationId) ?? [];\n // Newest page first, oldest-to-newest within the page.\n const end = list.length - (page - 1) * pageSize;\n return clone(list.slice(Math.max(0, end - pageSize), Math.max(0, end)));\n },\n async markRead(conversationId) {\n log(\"markRead\", conversationId);\n const c = contacts.find((c) => c.id === conversationId);\n if (c) c.unreadCount = 0;\n },\n };\n\n const media: MediaHandlers = {\n async download(url, opts) {\n log(\"download\", url);\n // Real URLs (the demo's pictures) are fetched; made-up ones get a placeholder file.\n let blob: Blob;\n try {\n const res = await fetch(url, { signal: opts?.signal });\n if (!res.ok) throw new Error(String(res.status));\n blob = await res.blob();\n } catch {\n blob = new Blob([\"fake file\"], { type: \"text/plain\" });\n }\n opts?.onProgress?.(100);\n return blob;\n },\n async getFileSize() {\n return 1024;\n },\n };\n\n const attachments = (conversationId: string, pick: (m: Message) => string[]) =>\n (db.get(conversationId) ?? []).flatMap(pick);\n\n const profile: ProfileHandlers = {\n async fetchMedia({ conversationId, page, pageSize }) {\n const all = attachments(conversationId, (m) => m.imageUrl ?? []);\n const start = (page - 1) * pageSize;\n return {\n data: all.slice(start, start + pageSize),\n hasNextPage: start + pageSize < all.length,\n };\n },\n async fetchFiles({ conversationId, page, pageSize }) {\n const all = attachments(conversationId, (m) => (m.fileUrl ? [m.fileUrl] : []));\n const start = (page - 1) * pageSize;\n return {\n data: all.slice(start, start + pageSize),\n hasNextPage: start + pageSize < all.length,\n };\n },\n };\n\n return { chat, messages, media, profile, state };\n}\n","// Call signalling over BroadcastChannel, so two tabs of the same browser can call each other just\n// as two clients behind a real pub/sub would. No server needed.\nimport type { CallHandlers, CallMessageSchema } from \"../app/types\";\n\nexport interface FakeCallHandlers extends CallHandlers {\n /** Everything this tab published, oldest first. */\n published: CallMessageSchema[];\n}\n\nexport function createBroadcastCallHandlers(\n channelName = \"vue-chat-fake-call\",\n): FakeCallHandlers {\n const channel = new BroadcastChannel(channelName);\n const listeners = new Map<number, (m: CallMessageSchema) => Promise<void>>();\n const published: CallMessageSchema[] = [];\n let nextId = 0;\n\n channel.onmessage = (e) => {\n const message = JSON.parse(e.data) as CallMessageSchema;\n listeners.forEach((cb) => void cb(message));\n };\n\n return {\n published,\n // No TURN server: peers on the same machine connect directly.\n credential: { ttl: 3600, user: \"\", pass: \"\", urls: [] },\n iceTransportPolicy: \"all\",\n async handleGenerateCred() {},\n async publisher(json) {\n published.push(JSON.parse(json));\n channel.postMessage(json);\n },\n async subscriber(cb) {\n const id = ++nextId;\n listeners.set(id, cb);\n return id;\n },\n async unSubscriber(id) {\n listeners.delete(id);\n },\n };\n}\n\n","// Seed data for the fake backend: a small fixed set the e2e specs assert against, and a larger\n// generated one for the demo. Both are deterministic.\nimport type { Contact, Message } from \"../app/types\";\n\nexport interface FakeData {\n contacts: Contact[];\n messages: Map<string, Message[]>;\n}\n\nconst now = Date.now();\nconst minutesAgo = (m: number) => new Date(now - m * 60_000);\n\nfunction contact(\n id: string,\n name: string,\n lastName: string,\n extra: Partial<Contact> = {},\n): Contact {\n return {\n id,\n name,\n lastName,\n isOnline: false,\n lastSeen: minutesAgo(90),\n imageUrl: \"\",\n isActive: true,\n birthDate: new Date(\"1995-01-01\"),\n serviceType: \"video-call\",\n userType: [\"user\"],\n ...extra,\n };\n}\n\nfunction text(\n conversationId: string,\n n: number,\n senderId: string,\n body: string,\n minutes: number,\n): Message {\n return {\n id: `${conversationId}-m${n}`,\n conversationId,\n date: minutesAgo(minutes),\n type: \"text\",\n text: body,\n isEdited: false,\n senderId,\n isSent: true,\n isRead: true,\n };\n}\n\nfunction withLastMessages(data: FakeData): FakeData {\n for (const c of data.contacts) {\n const list = data.messages.get(c.id) ?? [];\n c.lastMessage = list[list.length - 1];\n }\n return data;\n}\n\n/**\n * Three conversations the e2e specs rely on: c1 active, online, with calls; c2 chat-only;\n * c3 ended.\n */\nexport function e2eData(userId: string): FakeData {\n return withLastMessages({\n contacts: [\n contact(\"c1\", \"Sara\", \"Ahmadi\", { isOnline: true }),\n contact(\"c2\", \"Nima\", \"Karimi\", { serviceType: \"chat\" }),\n contact(\"c3\", \"Leila\", \"Moradi\", { isActive: false }),\n ],\n messages: new Map([\n [\n \"c1\",\n [\n text(\"c1\", 1, \"c1\", \"Hello from Sara\", 30),\n text(\"c1\", 2, userId, \"Hi Sara, how are you?\", 20),\n text(\"c1\", 3, \"c1\", \"Ready for the video call?\", 10),\n ],\n ],\n [\n \"c2\",\n [\n {\n ...text(\"c2\", 0, \"c2\", \"\", 70),\n type: \"image\",\n imageUrl: [\"https://example.com/photo.png\"],\n },\n text(\"c2\", 1, \"c2\", \"Nima says hi\", 60),\n ],\n ],\n [\"c3\", [text(\"c3\", 1, \"c3\", \"This conversation is over\", 600)]],\n ]),\n });\n}\n\n/** Park–Miller PRNG, so the demo looks the same on every load. */\nfunction seeded(seed: number) {\n const next = () => (seed = (seed * 16807) % 2147483647) / 2147483647;\n return {\n next,\n int: (min: number, max: number) => Math.floor(next() * (max - min + 1)) + min,\n pick: <T>(items: readonly T[]) => items[Math.floor(next() * items.length)]!,\n };\n}\n\nconst FIRST_NAMES = [\"علی\", \"محمد\", \"حسین\", \"رضا\", \"امیر\", \"سعید\", \"مهدی\", \"فاطمه\", \"زهرا\", \"مریم\", \"سارا\", \"نازنین\", \"لیلا\", \"مهسا\", \"پویا\", \"آرش\", \"نیما\", \"الهام\", \"پریسا\", \"مینا\"] as const;\nconst LAST_NAMES = [\"محمدی\", \"حسینی\", \"رضایی\", \"احمدی\", \"کریمی\", \"موسوی\", \"هاشمی\", \"جعفری\", \"صادقی\", \"نوری\", \"عباسی\", \"امیری\", \"فرهادی\", \"قاسمی\", \"طاهری\", \"مرادی\"] as const;\nconst TEXTS = [\n \"سلام، وقت بخیر\",\n \"ممنون بابت پیگیری\",\n \"بله، مشکلی نیست\",\n \"فایل رو فرستادم، چک کنید\",\n \"جلسه فردا سر ساعت ۱۰ برگزار میشه\",\n \"آیا امکان تغییر زمان وجود داره؟\",\n \"پروژه آماده است و میتونید بررسی کنید\",\n \"با تشکر از همکاری خوبتون\",\n \"من منتظر پاسخ شما هستم\",\n \"مورد تایید شد\",\n \"خسته نباشید\",\n \"فردا تماس میگیرم\",\n] as const;\nconst FILES = [\"report.pdf\", \"invoice.xlsx\", \"contract.docx\", \"data.csv\"] as const;\n\n/** A realistic-looking Persian dataset for the demo: `count` conversations with history. */\nexport function demoData(userId: string, count = 40): FakeData {\n const rng = seeded(42);\n const contacts: Contact[] = [];\n const messages = new Map<string, Message[]>();\n\n for (let i = 1; i <= count; i++) {\n const id = `contact-${i}`;\n const isOnline = rng.next() < 0.4;\n contacts.push(\n contact(id, rng.pick(FIRST_NAMES), rng.pick(LAST_NAMES), {\n isOnline,\n lastSeen: minutesAgo(isOnline ? rng.int(1, 30) : rng.int(60, 10_080)),\n imageUrl: `https://i.pravatar.cc/150?img=${(i % 70) + 1}`,\n isActive: rng.next() < 0.8,\n serviceType: rng.pick([\"chat\", \"video-call\", \"voice-call\"] as const),\n unreadCount: rng.next() < 0.3 ? rng.int(1, 12) : 0,\n }),\n );\n\n const history: Message[] = [];\n let minutes = rng.int(60, 4_000);\n const length = rng.int(5, 60);\n for (let n = 1; n <= length; n++) {\n minutes -= rng.int(1, 60);\n const senderId = rng.next() < 0.5 ? userId : id;\n const base = text(id, n, senderId, rng.pick(TEXTS), Math.max(minutes, 1));\n const roll = rng.next();\n if (roll < 0.1) {\n history.push({\n ...base,\n type: \"image\",\n text: \"\",\n imageUrl: [`https://picsum.photos/seed/${id}-${n}/400/300`],\n });\n } else if (roll < 0.18) {\n const fileName = rng.pick(FILES);\n history.push({\n ...base,\n type: \"file\",\n text: \"\",\n fileName,\n fileUrl: `https://example.com/files/${fileName}`,\n });\n } else {\n history.push(base);\n }\n }\n messages.set(id, history);\n }\n\n return withLastMessages({ contacts, messages });\n}\n"],"names":["c","text","m"],"mappings":"AAoCA,MAAM,SAAS,CAAC,UACd,KAAK;AAAA,EACH,KAAK;AAAA,IAAU;AAAA,IAAO,CAAC,KAAK,QAC1B,CAAC,eAAe,eAAe,SAAS,EAAE,SAAS,GAAG,IAAI,SAAY;AAAA,EAAA;AAE1E;AAGF,MAAM,QAAQ,CAAI,UAAgB,gBAAgB,KAAK;AAEhD,SAAS,kBACd,MACA,EAAE,UAAU,GAAA,IAA2B,CAAA,GAC1B;AACb,QAAM,EAAE,UAAU,UAAU,GAAA,IAAO;AACnC,QAAM,QAA0B;AAAA,IAC9B,cAAc;AAAA,IACd,gBAAgB;AAAA,IAChB,cAAc;AAAA,IACd,OAAO,CAAA;AAAA,EAAC;AAEV,QAAM,MAAM,CAAC,OAAe,SAC1B,MAAM,MAAM,KAAK,EAAE,IAAI,MAAM,OAAO,IAAI,GAAG;AAC7C,QAAM,QAAQ,CAAC,KAAK,YAAY,IAAI,QAAQ,CAAC,MAAM,WAAW,GAAG,EAAE,CAAC;AAEpE,QAAM,UAAU,CAAC,SAA6D;AAC5E,UAAM,QAAQ,MAAM,IAAI;AACxB,UAAM,IAAI,IAAI;AACd,WAAO;AAAA,EACT;AACA,MAAI,WAAW;AAEf,QAAM,OAAqB;AAAA,IACzB,MAAM,mBAAmB,QAAQ;AAC/B,UAAI,sBAAsB,MAAM;AAChC,YAAM,MAAA;AACN,YAAM,KAAK,OAAO,UAAU,IAAI,KAAA,EAAO,YAAA;AACvC,YAAM,WAAW,SAAS,OAAO,CAAC,MAAM;AACtC,YAAI,KAAK,CAAC,GAAG,EAAE,IAAI,IAAI,EAAE,QAAQ,GAAG,YAAA,EAAc,SAAS,CAAC,EAAG,QAAO;AACtE,YAAI,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,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const index = require("./chunks/index-D50Yn7q4.cjs");
|
|
4
|
+
require("vue");
|
|
5
|
+
exports.BEmojiPicker = index._sfc_main$3;
|
|
6
|
+
exports.BIcon = index._sfc_main$1;
|
|
7
|
+
exports.BVirtualVerticalList = index._sfc_main$4;
|
|
8
|
+
exports.Call = index.Call;
|
|
9
|
+
exports.CallMessageType = index.CallMessageType;
|
|
10
|
+
exports.ChatBubble = index._sfc_main$5;
|
|
11
|
+
exports.ChatConversation = index._sfc_main$6;
|
|
12
|
+
exports.ChatHeader = index._sfc_main$7;
|
|
13
|
+
exports.ChatInput = index._sfc_main$8;
|
|
14
|
+
exports.ChatList = index._sfc_main$9;
|
|
15
|
+
exports.ChatMessages = index.ChatMessages;
|
|
16
|
+
exports.ChatPage = index._sfc_main$10;
|
|
17
|
+
exports.createChat = index.createChat;
|
|
18
|
+
exports.provideCallHandlers = index.provideCallHandlers;
|
|
19
|
+
exports.useCallStore = index.useCallStore;
|
|
20
|
+
exports.useChatStore = index.useChatStore;
|
|
21
|
+
exports.useMediaStore = index.useMediaStore;
|
|
22
|
+
exports.useMessagesStore = index.useMessagesStore;
|
|
23
|
+
exports.useProfileStore = index.useProfileStore;
|
|
24
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { f, d, g, h, C, i, j, k, l, m, n, o, p, q, u, r, s, t, v } from "./chunks/index-JU_JZkSC.mjs";
|
|
2
|
+
import "vue";
|
|
3
|
+
export {
|
|
4
|
+
f as BEmojiPicker,
|
|
5
|
+
d as BIcon,
|
|
6
|
+
g as BVirtualVerticalList,
|
|
7
|
+
h as Call,
|
|
8
|
+
C as CallMessageType,
|
|
9
|
+
i as ChatBubble,
|
|
10
|
+
j as ChatConversation,
|
|
11
|
+
k as ChatHeader,
|
|
12
|
+
l as ChatInput,
|
|
13
|
+
m as ChatList,
|
|
14
|
+
n as ChatMessages,
|
|
15
|
+
o as ChatPage,
|
|
16
|
+
p as createChat,
|
|
17
|
+
q as provideCallHandlers,
|
|
18
|
+
u as useCallStore,
|
|
19
|
+
r as useChatStore,
|
|
20
|
+
s as useMediaStore,
|
|
21
|
+
t as useMessagesStore,
|
|
22
|
+
v as useProfileStore
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Contact } from '../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/**
|
|
4
|
+
* Render the call view here. Set to false and mount `<Call />` once near the app root to
|
|
5
|
+
* keep the call on screen while the user navigates away from the chat.
|
|
6
|
+
*/
|
|
7
|
+
renderCall?: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare function __VLS_template(): {
|
|
10
|
+
attrs: Partial<{}>;
|
|
11
|
+
slots: Readonly<{
|
|
12
|
+
/** Replaces the "no conversation selected" placeholder. */
|
|
13
|
+
empty?: () => unknown;
|
|
14
|
+
/** Extra actions in the conversation header, beside the call button. */
|
|
15
|
+
"header-actions"?: (props: {
|
|
16
|
+
contact: Contact | null;
|
|
17
|
+
}) => unknown;
|
|
18
|
+
/** Between the header and the messages. */
|
|
19
|
+
"conversation-top"?: (props: {
|
|
20
|
+
conversationId: string | null;
|
|
21
|
+
contact: Contact | null;
|
|
22
|
+
}) => unknown;
|
|
23
|
+
/** Above the input, only while the conversation is active. */
|
|
24
|
+
"above-input"?: (props: {
|
|
25
|
+
conversationId: string | null;
|
|
26
|
+
contact: Contact | null;
|
|
27
|
+
}) => unknown;
|
|
28
|
+
}> & {
|
|
29
|
+
/** Replaces the "no conversation selected" placeholder. */
|
|
30
|
+
empty?: () => unknown;
|
|
31
|
+
/** Extra actions in the conversation header, beside the call button. */
|
|
32
|
+
"header-actions"?: (props: {
|
|
33
|
+
contact: Contact | null;
|
|
34
|
+
}) => unknown;
|
|
35
|
+
/** Between the header and the messages. */
|
|
36
|
+
"conversation-top"?: (props: {
|
|
37
|
+
conversationId: string | null;
|
|
38
|
+
contact: Contact | null;
|
|
39
|
+
}) => unknown;
|
|
40
|
+
/** Above the input, only while the conversation is active. */
|
|
41
|
+
"above-input"?: (props: {
|
|
42
|
+
conversationId: string | null;
|
|
43
|
+
contact: Contact | null;
|
|
44
|
+
}) => unknown;
|
|
45
|
+
};
|
|
46
|
+
refs: {};
|
|
47
|
+
rootEl: any;
|
|
48
|
+
};
|
|
49
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
50
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
51
|
+
renderCall: boolean;
|
|
52
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
53
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
54
|
+
export default _default;
|
|
55
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
56
|
+
new (): {
|
|
57
|
+
$slots: S;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=ChatPage.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatPage.vue.d.ts","sourceRoot":"","sources":["../../../../app/components/ChatPage.vue"],"names":[],"mappings":"AAyGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS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C,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
2
|
+
minimizedRef: HTMLDivElement;
|
|
3
|
+
pipVideoRef: HTMLVideoElement;
|
|
4
|
+
localScreen: HTMLVideoElement;
|
|
5
|
+
localVideo: HTMLVideoElement;
|
|
6
|
+
}, any>;
|
|
7
|
+
export default _default;
|
|
8
|
+
//# sourceMappingURL=Call.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Call.vue.d.ts","sourceRoot":"","sources":["../../../../../app/components/call/Call.vue"],"names":[],"mappings":";;;;;;AAiiEA,wBAMG"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Contact, ExtendedMessage } from '../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
message: ExtendedMessage;
|
|
4
|
+
contact: Contact;
|
|
5
|
+
isFirstUnread?: boolean;
|
|
6
|
+
isDeleting?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
9
|
+
isFirstUnread: boolean;
|
|
10
|
+
isDeleting: boolean;
|
|
11
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
12
|
+
imageDisplay: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
13
|
+
images?: string[];
|
|
14
|
+
}> & Readonly<{}>, {
|
|
15
|
+
open: (index: number) => void;
|
|
16
|
+
close: () => void;
|
|
17
|
+
download: () => Promise<void>;
|
|
18
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
|
|
19
|
+
images: string[];
|
|
20
|
+
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
21
|
+
stage: HTMLDivElement;
|
|
22
|
+
}, any, import('vue').ComponentProvideOptions, {
|
|
23
|
+
P: {};
|
|
24
|
+
B: {};
|
|
25
|
+
D: {};
|
|
26
|
+
C: {};
|
|
27
|
+
M: {};
|
|
28
|
+
Defaults: {};
|
|
29
|
+
}, Readonly<{
|
|
30
|
+
images?: string[];
|
|
31
|
+
}> & Readonly<{}>, {
|
|
32
|
+
open: (index: number) => void;
|
|
33
|
+
close: () => void;
|
|
34
|
+
download: () => Promise<void>;
|
|
35
|
+
}, {}, {}, {}, {
|
|
36
|
+
images: string[];
|
|
37
|
+
}> | null;
|
|
38
|
+
bubbleOptions: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
39
|
+
message: ExtendedMessage;
|
|
40
|
+
}> & Readonly<{}>, {
|
|
41
|
+
openMenu: (event: MouseEvent | PointerEvent) => void;
|
|
42
|
+
closeMenu: () => void;
|
|
43
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
44
|
+
menu: ({
|
|
45
|
+
$props: import('primevue/contextmenu').ContextMenuProps & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
46
|
+
$slots: import('primevue/contextmenu').ContextMenuSlots;
|
|
47
|
+
$emit: ((e: "focus", event: Event) => void) & ((e: "blur", event: Event) => void) & ((e: "hide") => void) & ((e: "show") => void) & ((e: "before-show") => void) & ((e: "before-hide") => void);
|
|
48
|
+
} & import('primevue/contextmenu').ContextMenuMethods) | null;
|
|
49
|
+
}, any, import('vue').ComponentProvideOptions, {
|
|
50
|
+
P: {};
|
|
51
|
+
B: {};
|
|
52
|
+
D: {};
|
|
53
|
+
C: {};
|
|
54
|
+
M: {};
|
|
55
|
+
Defaults: {};
|
|
56
|
+
}, Readonly<{
|
|
57
|
+
message: ExtendedMessage;
|
|
58
|
+
}> & Readonly<{}>, {
|
|
59
|
+
openMenu: (event: MouseEvent | PointerEvent) => void;
|
|
60
|
+
closeMenu: () => void;
|
|
61
|
+
}, {}, {}, {}, {}> | null;
|
|
62
|
+
}, HTMLDivElement>;
|
|
63
|
+
export default _default;
|
|
64
|
+
//# sourceMappingURL=ChatBubble.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatBubble.vue.d.ts","sourceRoot":"","sources":["../../../../../app/components/chat/ChatBubble.vue"],"names":[],"mappings":"AA8SA,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAW,MAAM,SAAS,CAAC;AAuBjE,KAAK,WAAW,GAAG;IACf,OAAO,EAAE,eAAe,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;;mBAFgB,OAAO;gBACV,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgfxB,wBASG"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
isActive?: boolean;
|
|
3
|
+
};
|
|
4
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
|
5
|
+
focus: () => void | undefined;
|
|
6
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
send: () => any;
|
|
8
|
+
edit: () => any;
|
|
9
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
|
+
onSend?: (() => any) | undefined;
|
|
11
|
+
onEdit?: (() => any) | undefined;
|
|
12
|
+
}>, {
|
|
13
|
+
isActive: boolean;
|
|
14
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
15
|
+
videoDisplay: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
16
|
+
stream?: MediaStream | null;
|
|
17
|
+
isPaused?: boolean;
|
|
18
|
+
recordingTime?: number;
|
|
19
|
+
}> & Readonly<{
|
|
20
|
+
"onFlip-camera"?: (() => any) | undefined;
|
|
21
|
+
}>, {
|
|
22
|
+
open: () => void;
|
|
23
|
+
close: () => void;
|
|
24
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
25
|
+
"flip-camera": () => any;
|
|
26
|
+
}, import('vue').PublicProps, {
|
|
27
|
+
stream: MediaStream | null;
|
|
28
|
+
isPaused: boolean;
|
|
29
|
+
recordingTime: number;
|
|
30
|
+
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
31
|
+
P: {};
|
|
32
|
+
B: {};
|
|
33
|
+
D: {};
|
|
34
|
+
C: {};
|
|
35
|
+
M: {};
|
|
36
|
+
Defaults: {};
|
|
37
|
+
}, Readonly<{
|
|
38
|
+
stream?: MediaStream | null;
|
|
39
|
+
isPaused?: boolean;
|
|
40
|
+
recordingTime?: number;
|
|
41
|
+
}> & Readonly<{
|
|
42
|
+
"onFlip-camera"?: (() => any) | undefined;
|
|
43
|
+
}>, {
|
|
44
|
+
open: () => void;
|
|
45
|
+
close: () => void;
|
|
46
|
+
}, {}, {}, {}, {
|
|
47
|
+
stream: MediaStream | null;
|
|
48
|
+
isPaused: boolean;
|
|
49
|
+
recordingTime: number;
|
|
50
|
+
}> | null;
|
|
51
|
+
rootElements: HTMLDivElement;
|
|
52
|
+
input: HTMLDivElement;
|
|
53
|
+
emojiPopover: ({
|
|
54
|
+
$props: import('primevue/popover').PopoverProps & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
55
|
+
$slots: import('primevue/popover').PopoverSlots;
|
|
56
|
+
$emit: ((e: "hide") => void) & ((e: "show") => void);
|
|
57
|
+
} & import('primevue/popover').PopoverMethods) | null;
|
|
58
|
+
}, HTMLDivElement>;
|
|
59
|
+
export default _default;
|
|
60
|
+
//# sourceMappingURL=ChatInput.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatInput.vue.d.ts","sourceRoot":"","sources":["../../../../../app/components/chat/ChatInput.vue"],"names":[],"mappings":"AAqGA;AA4fA,KAAK,WAAW,GAAG;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;;;;;;;;;;cADW,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAksBtB,wBAWG"}
|