vue-parley 4.4.0 → 4.6.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/README.md +14 -0
- package/dist/chat.css +374 -235
- package/dist/chunks/Call-DR7geRXf.cjs +1155 -0
- package/dist/chunks/Call-DR7geRXf.cjs.map +1 -0
- package/dist/chunks/Call-Dw6Sj4xm.mjs +1155 -0
- package/dist/chunks/Call-Dw6Sj4xm.mjs.map +1 -0
- package/dist/chunks/{index-CYf89e1X.mjs → index-BZyi4oPy.mjs} +567 -234
- package/dist/chunks/index-BZyi4oPy.mjs.map +1 -0
- package/dist/chunks/{index-COLy7Tct.cjs → index-Dg8cFrSc.cjs} +559 -226
- package/dist/chunks/index-Dg8cFrSc.cjs.map +1 -0
- package/dist/chunks/{session-MlxrAuPv.cjs → session-CIPsDkm7.cjs} +14 -2
- package/dist/chunks/session-CIPsDkm7.cjs.map +1 -0
- package/dist/chunks/{session-B_68wiei.mjs → session-YNmwwo3T.mjs} +14 -2
- package/dist/chunks/session-YNmwwo3T.mjs.map +1 -0
- package/dist/index.cjs +10 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +18 -17
- package/dist/types/app/components/call/Call.vue.d.ts +10 -0
- package/dist/types/app/components/call/Call.vue.d.ts.map +1 -1
- package/dist/types/app/components/call/CallButton.vue.d.ts +12 -0
- package/dist/types/app/components/call/CallButton.vue.d.ts.map +1 -0
- package/dist/types/app/components/call/CallIcon.vue.d.ts +38 -0
- package/dist/types/app/components/call/CallIcon.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/ChatPageBar.vue.d.ts.map +1 -1
- package/dist/types/app/components/chat/chat-input/AttachementFileDisplay.vue.d.ts +7 -1
- package/dist/types/app/components/chat/chat-input/AttachementFileDisplay.vue.d.ts.map +1 -1
- package/dist/types/app/components/chat/chat-input/InputAttachement.vue.d.ts.map +1 -1
- package/dist/types/app/composables/call/session.d.ts +3 -0
- package/dist/types/app/composables/call/session.d.ts.map +1 -1
- package/dist/types/app/composables/call/signaling.d.ts +2 -0
- package/dist/types/app/composables/call/signaling.d.ts.map +1 -1
- package/dist/types/app/composables/call/useSpeaking.d.ts +6 -0
- package/dist/types/app/composables/call/useSpeaking.d.ts.map +1 -0
- package/dist/types/app/composables/useAttachmentPicker.d.ts +5 -1
- package/dist/types/app/composables/useAttachmentPicker.d.ts.map +1 -1
- package/dist/types/app/index.d.ts +19 -0
- package/dist/types/app/index.d.ts.map +1 -1
- package/dist/types/app/stores/callStore.d.ts +23 -2
- package/dist/types/app/stores/callStore.d.ts.map +1 -1
- package/dist/types/app/stores/chatStore.d.ts +4 -1
- package/dist/types/app/stores/chatStore.d.ts.map +1 -1
- package/dist/types/app/stores/mediaStore.d.ts +4 -1
- package/dist/types/app/stores/mediaStore.d.ts.map +1 -1
- package/dist/types/app/stores/messageStores.d.ts +4 -1
- package/dist/types/app/stores/messageStores.d.ts.map +1 -1
- package/dist/types/app/stores/profileStore.d.ts +4 -1
- package/dist/types/app/stores/profileStore.d.ts.map +1 -1
- package/dist/types/app/types/index.d.ts +13 -0
- package/dist/types/app/types/index.d.ts.map +1 -1
- package/dist/types/i18n/locales/index.d.ts +24 -0
- package/dist/types/i18n/locales/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/Call-BLgejeix.mjs +0 -865
- package/dist/chunks/Call-BLgejeix.mjs.map +0 -1
- package/dist/chunks/Call-D08ubO0r.cjs +0 -865
- package/dist/chunks/Call-D08ubO0r.cjs.map +0 -1
- package/dist/chunks/index-COLy7Tct.cjs.map +0 -1
- package/dist/chunks/index-CYf89e1X.mjs.map +0 -1
- package/dist/chunks/session-B_68wiei.mjs.map +0 -1
- package/dist/chunks/session-MlxrAuPv.cjs.map +0 -1
package/README.md
CHANGED
|
@@ -21,6 +21,7 @@ Formerly `@yonus_amire01/chat`. To switch, replace that name with `vue-parley` i
|
|
|
21
21
|
- [Photos and videos](#photos-and-videos)
|
|
22
22
|
- [Read receipts](#read-receipts)
|
|
23
23
|
- [Calls outside the chat page](#calls-outside-the-chat-page)
|
|
24
|
+
- [Joining a call in progress](#joining-a-call-in-progress)
|
|
24
25
|
- [Fake backend](#fake-backend)
|
|
25
26
|
- [What `createChat()` does](#what-createchat-does)
|
|
26
27
|
- [Exports](#exports)
|
|
@@ -174,6 +175,18 @@ Calls use the browser's WebRTC API directly (no `simple-peer`, no Node polyfills
|
|
|
174
175
|
|
|
175
176
|
Call handlers also accept `iceTransportPolicy` (default `"relay"`; `"all"` allows direct connections without TURN) and `debug` (logs signalling to the console).
|
|
176
177
|
|
|
178
|
+
### Joining a call in progress
|
|
179
|
+
|
|
180
|
+
When others are in a call on a conversation, its header shows **Join** in place of the call buttons. It joins with the camera on only if the call was started as a video call. Everyone in a call publishes a `presence` message when they join and every 15 seconds after. A call counts as running until its last participant hangs up or goes 45 seconds without being heard from. A closed tab sends no hangup, so that timeout is what ends its call.
|
|
181
|
+
|
|
182
|
+
The call's own subscriber only hears the conversation it is on, so the host has to pass along what it hears on all of them. Hand every call message (`signal`, `join`, `track_type`, `call`, `hangup`, `presence`) from every conversation's channel to the store:
|
|
183
|
+
|
|
184
|
+
```ts
|
|
185
|
+
callStore.observeCall(message, conversationId);
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
`conversationId` can be left out for messages that carry `payload.channel`. Messages from the signed-in user are ignored. A host that never calls `observeCall` keeps the start-call buttons.
|
|
189
|
+
|
|
177
190
|
### Fake backend
|
|
178
191
|
|
|
179
192
|
`vue-parley/fakes` is an in-memory implementation of every handler, for demos, playgrounds and tests. It is a separate entry, so apps that don't import it don't ship it.
|
|
@@ -222,6 +235,7 @@ Every component and directive the chat uses is imported by the component itself,
|
|
|
222
235
|
| `BIcon`, `BEmojiPicker`, `BVirtualVerticalList` | A Phosphor icon by name, the emoji picker and the virtualised list the chat uses. Every other control is a PrimeVue component. |
|
|
223
236
|
| `useChatStore`, `useMessagesStore`, `useMediaStore`, `useProfileStore`, `useCallStore` | The Pinia stores. |
|
|
224
237
|
| `messageMedia(message)` | A message's photo and video album: its `media`, or its `imageUrl` as photos. |
|
|
238
|
+
| `resetChat()` | Forgets everything the chat loaded for the signed-in user (conversations, threads, drafts, shared media, the downloaded-file cache) and ends a running call. Call it on sign-out or an account switch, before the next user's chat mounts; the handlers stay. Each store also has its own `reset()` (`clearCache()` on the media store). |
|
|
225
239
|
| Types | Handler interfaces, `Contact`, `Message`, `MediaItem`, `SignalData`, `ChatOptions`, `ChatUser` and the rest of `app/types`. |
|
|
226
240
|
| `vue-parley/fakes` | `createFakeBackend`, `createBroadcastCallHandlers`, `demoData`, `e2eData`: see [Fake backend](#fake-backend). |
|
|
227
241
|
|