@convokitapp/vue-ui 0.7.0 → 0.9.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/CHANGELOG.md +225 -0
- package/PARITY.md +46 -0
- package/README.md +244 -5
- package/dist/index.cjs +1235 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +167 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +723 -7
- package/dist/index.d.ts +723 -7
- package/dist/index.js +1243 -40
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Conversation as Conversation$1, InboxPage, MessageListOptions, Message, SendMessageInput, MarkConversationReadOptions, ConversationPrivateState, ClearConversationUnreadOptions, ClearUnreadResult, RealtimeConnectionHandlers, RealtimeSubscription, MessageEvent, MessageDeletedEvent, ReadEvent, TypingEvent, ReadPosition, InboxSummary, MessageMedia, ConvoKitClient, InboxEntry } from '@convokitapp/sdk';
|
|
1
|
+
import { Conversation as Conversation$1, InboxPage, MessageListOptions, Message, SendMessageInput, EditMessageInput, ReplyPreview, MessageContextOptions, MessageContextPage, MarkConversationReadOptions, ConversationPrivateState, ClearConversationUnreadOptions, ClearUnreadResult, RealtimeConnectionHandlers, RealtimeSubscription, MessageEvent, MessageDeletedEvent, ReadEvent, TypingEvent, ReadPosition, InboxSummary, MessageMedia, ConvoKitClient, InboxEntry } from '@convokitapp/sdk';
|
|
2
2
|
import * as vue from 'vue';
|
|
3
3
|
import { CSSProperties, HTMLAttributes, Ref, VNodeChild, PropType, MaybeRefOrGetter, TextareaHTMLAttributes } from 'vue';
|
|
4
4
|
|
|
@@ -29,6 +29,33 @@ interface ConvoKitUiClient {
|
|
|
29
29
|
/** Complete authorized message, including related media absent from raw row events. */
|
|
30
30
|
getMessage(id: string): Promise<Message>;
|
|
31
31
|
sendMessage(input: SendMessageInput): Promise<Message>;
|
|
32
|
+
/** Replace the text of one of the caller's own messages, or clear the caption of a message with attachments with
|
|
33
|
+
* `text: null` (0.8.0). `revision` is the row's `Message.revision` as the user saw it; a stale value must reject
|
|
34
|
+
* with `code: 'REVISION_CONFLICT'` (status 409) and a deleted or inaccessible message with `code: 'MESSAGE_NOT_FOUND'`
|
|
35
|
+
* (status 404). Attachments are never changed. Optional: without it the room store hides the edit affordance and
|
|
36
|
+
* `saveEdit` rejects.
|
|
37
|
+
*/
|
|
38
|
+
editMessage?(messageId: string, input: EditMessageInput): Promise<Message>;
|
|
39
|
+
/** Delete one of the caller's own messages for every member (0.8.0); a message that is already gone must reject
|
|
40
|
+
* with `code: 'MESSAGE_NOT_FOUND'`. Optional: without it the room store hides the delete affordance and
|
|
41
|
+
* `deleteMessage` rejects.
|
|
42
|
+
*/
|
|
43
|
+
deleteMessage?(messageId: string): Promise<void>;
|
|
44
|
+
/** Resolve the quoted parents of the rendered replies in one round trip (0.9.0). The room store calls this once
|
|
45
|
+
* per page load, reconcile and live-insert burst with the distinct `Message.replyToMessageId` values it cannot
|
|
46
|
+
* derive from the loaded window; the core SDK de-duplicates and chunks at 50 per request. An ID missing from a
|
|
47
|
+
* RESOLVED result is the only deletion signal (the store caches it as the terminal `'unavailable'`); a rejection
|
|
48
|
+
* says nothing about which IDs exist, so the store writes no entry for any of them. Optional: without it the
|
|
49
|
+
* store renders reply references with no quoted text.
|
|
50
|
+
*/
|
|
51
|
+
getReplyPreviews?(conversationId: string, messageIds: string[]): Promise<ReplyPreview[]>;
|
|
52
|
+
/** One window of the room's history centred on `options.messageId`, or continued from a previous window's
|
|
53
|
+
* `olderCursor` / `newerCursor` (0.9.0); exactly one of the three, `limit` 1..100. Rows come back newest-first
|
|
54
|
+
* like `getMessages`, and both cursors are always present (null at that end of the history). An unknown or
|
|
55
|
+
* deleted `messageId` must reject with `code: 'MESSAGE_NOT_FOUND'`. Optional: without it the room store hides
|
|
56
|
+
* the jump affordance and `jumpToMessage` resolves false for rows outside the loaded window.
|
|
57
|
+
*/
|
|
58
|
+
getMessageContext?(conversationId: string, options: MessageContextOptions): Promise<MessageContextPage>;
|
|
32
59
|
/** Acknowledge through `options.throughMessageId` (the newest rendered row). Custom adapters must forward the
|
|
33
60
|
* options unchanged (0.7 adds `privateStateVersion`, the version captured when the room opened; an adapter that
|
|
34
61
|
* drops it acknowledges the position but never clears the caller's unread marker) and reject a missing target
|
|
@@ -62,6 +89,13 @@ interface ConvoKitUiClient {
|
|
|
62
89
|
onTyping(conversationId: string, handler: (event: TypingEvent) => void, onError?: (error: Error) => void): RealtimeSubscription;
|
|
63
90
|
}
|
|
64
91
|
|
|
92
|
+
/** A quoted parent as the room store holds it (0.9.0): the resolved preview, or the terminal `'unavailable'`
|
|
93
|
+
* once a call that resolved did not return it (deleted, or never in this room). A missing map entry is the
|
|
94
|
+
* distinct third state, "not resolved yet".
|
|
95
|
+
*/
|
|
96
|
+
type ReplyPreviewEntry = ReplyPreview | 'unavailable';
|
|
97
|
+
/** Whether the room renders the live tail (`live`) or a historical window a jump loaded (`jumped`, 0.9.0). */
|
|
98
|
+
type ConvoKitWindowMode = 'live' | 'jumped';
|
|
65
99
|
interface ConversationFilter {
|
|
66
100
|
query?: string;
|
|
67
101
|
archived?: boolean;
|
|
@@ -107,6 +141,35 @@ interface ConversationState {
|
|
|
107
141
|
hasLoaded: Readonly<Ref<boolean>>;
|
|
108
142
|
error: Readonly<Ref<unknown>>;
|
|
109
143
|
currentUserId: Readonly<Ref<string>>;
|
|
144
|
+
/** The row being edited as the user saw it when editing started (0.8.0); its `revision` is what `saveEdit`
|
|
145
|
+
* sends. Replaced by the current row on a conflict; null when not editing.
|
|
146
|
+
*/
|
|
147
|
+
editingMessage: Readonly<Ref<Message | null>>;
|
|
148
|
+
/** Whether the adapter implements `editMessage` / `deleteMessage` (0.8.0). Without it the default rows render no
|
|
149
|
+
* actions and `startEditing` is a no-op.
|
|
150
|
+
*/
|
|
151
|
+
canEditMessages: Readonly<Ref<boolean>>;
|
|
152
|
+
canDeleteMessages: Readonly<Ref<boolean>>;
|
|
153
|
+
/** The message the composer is quoting (0.9.0), or null. Replying and editing are mutually exclusive. */
|
|
154
|
+
replyTarget: Readonly<Ref<Message | null>>;
|
|
155
|
+
/** Quoted parents by `Message.replyToMessageId` (0.9.0); a missing key means "not resolved yet". */
|
|
156
|
+
replyPreviews: Readonly<Ref<ReadonlyMap<string, ReplyPreviewEntry>>>;
|
|
157
|
+
/** The row the last jump landed on (0.9.0); cleared about two seconds later. */
|
|
158
|
+
highlightedMessageId: Readonly<Ref<string | null>>;
|
|
159
|
+
/** Set while a jump replaces the window and scrolls (0.9.0); the views suspend stick-to-bottom, the highlight
|
|
160
|
+
* clear and pagination while it is set.
|
|
161
|
+
*/
|
|
162
|
+
jumpInFlight: Readonly<Ref<boolean>>;
|
|
163
|
+
/** `live` (the tail) or `jumped` (a window a jump loaded, 0.9.0). */
|
|
164
|
+
windowMode: Readonly<Ref<ConvoKitWindowMode>>;
|
|
165
|
+
/** Whether a jumped window has newer messages beyond it; always false in `live` mode (0.9.0). */
|
|
166
|
+
hasNewerMessages: Readonly<Ref<boolean>>;
|
|
167
|
+
isLoadingNewer: Readonly<Ref<boolean>>;
|
|
168
|
+
/** Whether the adapter implements `getMessageContext` / `getReplyPreviews` (0.9.0); either turns false for the
|
|
169
|
+
* store's life after the uncoded 404 a 0.8 backend answers, so the affordance disappears instead of failing.
|
|
170
|
+
*/
|
|
171
|
+
canJumpToMessage: Readonly<Ref<boolean>>;
|
|
172
|
+
canResolveReplyPreviews: Readonly<Ref<boolean>>;
|
|
110
173
|
readerIdsFor(message: Message): ReadonlySet<string>;
|
|
111
174
|
}
|
|
112
175
|
type ConvoKitUiDensity = 'comfortable' | 'compact';
|
|
@@ -135,6 +198,36 @@ interface MessageSlotProps {
|
|
|
135
198
|
isCurrentUser: boolean;
|
|
136
199
|
sender: Conversation$1['participants'][number] | undefined;
|
|
137
200
|
readerIds: ReadonlySet<string>;
|
|
201
|
+
/** `message.revision > 0` (0.8.0): the content changed after the send; never derived from `updatedAt`. */
|
|
202
|
+
isEdited: boolean;
|
|
203
|
+
/** Whether the default row would offer the action (0.8.0): the view has the callback and the row is the viewer's
|
|
204
|
+
* own, confirmed and not read-only (or `canEditMessage` says so).
|
|
205
|
+
*/
|
|
206
|
+
canEdit: boolean;
|
|
207
|
+
canDelete: boolean;
|
|
208
|
+
/** Ask the view to start editing this message (`onEditMessage`); present while `canEdit`. */
|
|
209
|
+
edit?: () => void;
|
|
210
|
+
/** Ask the view to delete this message (`onDeleteMessage`) after `confirmDelete` when the view has one, otherwise
|
|
211
|
+
* at once (a custom row owns its own confirmation); resolves to whether the deletion was accepted. Present while
|
|
212
|
+
* `canDelete`.
|
|
213
|
+
*/
|
|
214
|
+
remove?: () => Promise<boolean>;
|
|
215
|
+
/** Whether the default row would offer the reply action (0.9.0): the view has `onReplyToMessage`, the row is
|
|
216
|
+
* confirmed and the viewer's role (when known) is not `READ` — or `canReplyToMessage` says so. Unlike `canEdit`
|
|
217
|
+
* it does not require the row to be the viewer's own: any member may quote any row.
|
|
218
|
+
*/
|
|
219
|
+
canReply: boolean;
|
|
220
|
+
/** Ask the view to quote this message (`onReplyToMessage`); present exactly while `canReply`. */
|
|
221
|
+
reply?: () => void;
|
|
222
|
+
/** The quoted parent of this row (0.9.0); present only while `message.replyToMessageId` is set. `'unavailable'`
|
|
223
|
+
* means the quoted message is gone; the key being absent from `replyPreviewByMessageId` leaves this undefined,
|
|
224
|
+
* which is "not resolved yet" — render the reference without quoted text, never the unavailable copy.
|
|
225
|
+
*/
|
|
226
|
+
replyPreview?: ReplyPreviewEntry;
|
|
227
|
+
/** Bring the quoted parent into view (`onJumpToMessage`); present only while `message.replyToMessageId` is set
|
|
228
|
+
* and the view can jump.
|
|
229
|
+
*/
|
|
230
|
+
jumpToReplyTarget?: () => void;
|
|
138
231
|
}
|
|
139
232
|
interface MediaSlotProps {
|
|
140
233
|
media: MessageMedia;
|
|
@@ -146,8 +239,26 @@ interface ComposerSlotProps {
|
|
|
146
239
|
value: string;
|
|
147
240
|
setValue: (value: string) => void;
|
|
148
241
|
isSending: boolean;
|
|
242
|
+
/** Sends the draft, or saves the edit in progress while `editing` is present (0.8.0). */
|
|
149
243
|
send: () => void;
|
|
150
244
|
addAttachment?: () => void;
|
|
245
|
+
/** The message being edited (0.8.0); present while the view is in edit mode. The field already holds its text. */
|
|
246
|
+
editing?: Message;
|
|
247
|
+
/** Leave edit mode and restore the unsent draft (0.8.0); present while `editing` is. */
|
|
248
|
+
cancelEdit?: () => void;
|
|
249
|
+
/** The message being quoted (0.9.0); present while the view is replying and not editing. The field keeps the
|
|
250
|
+
* draft — replying never replaces it, unlike edit mode.
|
|
251
|
+
*/
|
|
252
|
+
replying?: Message;
|
|
253
|
+
/** Drop the reply target (0.9.0); present while `replying` is. */
|
|
254
|
+
cancelReply?: () => void;
|
|
255
|
+
}
|
|
256
|
+
/** The payload of the `#jump-to-latest` slot (0.9.0): the control renders only while the view is jumped, so
|
|
257
|
+
* the slot is only ever called with a live return in hand.
|
|
258
|
+
*/
|
|
259
|
+
interface JumpToLatestSlotProps {
|
|
260
|
+
/** Drop the historical window and render the live tail again (the view's `onReturnToLatest`). */
|
|
261
|
+
returnToLatest: () => void | Promise<void>;
|
|
151
262
|
}
|
|
152
263
|
interface TypingSlotProps {
|
|
153
264
|
userIds: ReadonlySet<string>;
|
|
@@ -217,7 +328,40 @@ interface ConversationController extends ConversationState {
|
|
|
217
328
|
text?: string;
|
|
218
329
|
media?: MessageMedia[];
|
|
219
330
|
}): Promise<Message | null>;
|
|
220
|
-
/**
|
|
331
|
+
/** Enter edit mode on one of the caller's own confirmed messages (0.8.0); a no-op for other rows, for a `READ`
|
|
332
|
+
* role and for adapters without `editMessage`. Sends nothing (no typing update either).
|
|
333
|
+
*/
|
|
334
|
+
startEditing(messageId: string): void;
|
|
335
|
+
/** Leave edit mode without a request. */
|
|
336
|
+
cancelEditing(): void;
|
|
337
|
+
/** Save the edit in progress with the snapshot's revision; resolves true when the server accepted it. A stale
|
|
338
|
+
* revision reloads the row, refreshes `editingMessage` and reports `REVISION_CONFLICT` through `error` (edit mode
|
|
339
|
+
* and draft kept); see the README for the other outcomes. Rejects when the adapter lacks `editMessage`.
|
|
340
|
+
*/
|
|
341
|
+
saveEdit(text: string): Promise<boolean>;
|
|
342
|
+
/** Delete one of the caller's own confirmed messages; resolves true once the row is gone (accepted, or already
|
|
343
|
+
* unknown to the server). No optimistic removal. Rejects when the adapter lacks `deleteMessage`.
|
|
344
|
+
*/
|
|
345
|
+
deleteMessage(messageId: string): Promise<boolean>;
|
|
346
|
+
/** Quote a rendered, confirmed message in the composer (0.9.0); a no-op for pending, tombstoned and unknown
|
|
347
|
+
* rows and for a `READ` role. Any member may quote any row, own or not. Leaves edit mode. Sends nothing.
|
|
348
|
+
*/
|
|
349
|
+
startReply(messageId: string): void;
|
|
350
|
+
/** Drop the reply target without a request; the draft is untouched. */
|
|
351
|
+
cancelReply(): void;
|
|
352
|
+
/** Bring a message into view (0.9.0): a rendered row is only highlighted, otherwise the window is replaced by
|
|
353
|
+
* a context window centred on it (`windowMode` becomes `jumped`). Resolves true once the target is
|
|
354
|
+
* highlighted; false when the quoted message is gone (its preview becomes `'unavailable'`), when a send is in
|
|
355
|
+
* flight, or when the adapter cannot fetch a context window.
|
|
356
|
+
*/
|
|
357
|
+
jumpToMessage(messageId: string): Promise<boolean>;
|
|
358
|
+
/** Page a jumped window towards the newest messages; a no-op while `live` or already at the end. */
|
|
359
|
+
loadNewerMessages(): Promise<void>;
|
|
360
|
+
/** Leave a jumped window and render the live tail again; resolves true once it is rendered. */
|
|
361
|
+
returnToLatest(): Promise<boolean>;
|
|
362
|
+
/** Acknowledge through the newest rendered message now; no request is sent while nothing is rendered, and a
|
|
363
|
+
* jumped window acknowledges nothing at all (0.9.0).
|
|
364
|
+
*/
|
|
221
365
|
markRead(): Promise<void>;
|
|
222
366
|
/** Automatic acknowledgements pause while hidden and resume when the view becomes visible again. */
|
|
223
367
|
setVisible(visible: boolean): void;
|
|
@@ -242,6 +386,56 @@ interface ConversationViewProps extends ConvoKitAppearanceProps {
|
|
|
242
386
|
onTypingChange?: (isTyping: boolean) => void | Promise<void>;
|
|
243
387
|
onAddAttachment?: () => void;
|
|
244
388
|
onAttachmentClick?: (media: MessageMedia, message: Message) => void;
|
|
389
|
+
/** The message being edited (0.8.0), or null. Entering edit mode stashes the unsent draft and prefills the field
|
|
390
|
+
* with the message text without a typing update; the composer then saves instead of sending.
|
|
391
|
+
*/
|
|
392
|
+
editingMessage?: Message | null;
|
|
393
|
+
/** Start editing a message (0.8.0): set `editingMessage` in response. Without it rows offer no edit action. */
|
|
394
|
+
onEditMessage?: (message: Message) => void;
|
|
395
|
+
/** Save the edit in progress (0.8.0); the composer's submit calls it instead of `onSendMessage` while
|
|
396
|
+
* `editingMessage` is set. `false` keeps edit mode and the draft (like `onSendMessage`); any other result
|
|
397
|
+
* restores the stashed unsent draft. Clear `editingMessage` when the edit is done.
|
|
398
|
+
*/
|
|
399
|
+
onSaveEdit?: (message: Message, text: string) => boolean | void | Promise<boolean | void>;
|
|
400
|
+
/** Leave edit mode (0.8.0): clear `editingMessage` in response; the view restores the unsent draft. */
|
|
401
|
+
onCancelEdit?: () => void;
|
|
402
|
+
/** Delete a message after confirmation (0.8.0); `false` means it was not accepted. Without it rows offer no
|
|
403
|
+
* delete action.
|
|
404
|
+
*/
|
|
405
|
+
onDeleteMessage?: (message: Message) => boolean | void | Promise<boolean | void>;
|
|
406
|
+
/** Replaces the default row eligibility (own confirmed rows while the viewer's role is not `READ`). */
|
|
407
|
+
canEditMessage?: (message: Message) => boolean;
|
|
408
|
+
/** Replaces the inline "Delete this message?" prompt (and confirms `remove()` from custom rows). */
|
|
409
|
+
confirmDelete?: (message: Message) => boolean | Promise<boolean>;
|
|
410
|
+
/** The message being quoted (0.9.0), or null. The composer shows a cancellable strip and keeps the draft —
|
|
411
|
+
* replying never replaces it, unlike edit mode. Editing wins while both are set.
|
|
412
|
+
*/
|
|
413
|
+
replyTarget?: Message | null;
|
|
414
|
+
/** Quote a message (0.9.0): set `replyTarget` in response. Without it rows offer no reply action. */
|
|
415
|
+
onReplyToMessage?: (message: Message) => void;
|
|
416
|
+
/** Drop the reply target (0.9.0): clear `replyTarget` in response. */
|
|
417
|
+
onCancelReply?: () => void;
|
|
418
|
+
/** Replaces the default reply eligibility (any confirmed row while the viewer's role is not `READ`, 0.9.0). */
|
|
419
|
+
canReplyToMessage?: (message: Message) => boolean;
|
|
420
|
+
/** Quoted parents by `Message.replyToMessageId` (0.9.0); a missing key renders the reference with no quoted
|
|
421
|
+
* text, `'unavailable'` the deleted-parent copy.
|
|
422
|
+
*/
|
|
423
|
+
replyPreviewByMessageId?: ReadonlyMap<string, ReplyPreviewEntry>;
|
|
424
|
+
/** Bring a message into view (0.9.0). Without it quoted blocks are inert and no row is focusable. */
|
|
425
|
+
onJumpToMessage?: (messageId: string) => void;
|
|
426
|
+
/** The row a jump landed on (0.9.0); it is centred, focused and highlighted. */
|
|
427
|
+
highlightedMessageId?: string | null;
|
|
428
|
+
/** Set while a jump lands (0.9.0): the list is `aria-busy` and suspends stick-to-bottom and pagination. */
|
|
429
|
+
jumpInFlight?: boolean;
|
|
430
|
+
/** Whether newer messages exist past the window (0.9.0); only ever true in a jumped window. */
|
|
431
|
+
hasNewerMessages?: boolean;
|
|
432
|
+
isLoadingNewer?: boolean;
|
|
433
|
+
/** Load the page immediately newer than a jumped window (0.9.0); the newer-edge scroll trigger. */
|
|
434
|
+
onLoadNewer?: () => void | Promise<void>;
|
|
435
|
+
/** Leave a jumped window for the live tail (0.9.0). Present only while the window IS jumped: it is what
|
|
436
|
+
* renders the "Jump to latest" control.
|
|
437
|
+
*/
|
|
438
|
+
onReturnToLatest?: () => void | Promise<void>;
|
|
245
439
|
isInitialLoading?: boolean;
|
|
246
440
|
isLoadingOlder?: boolean;
|
|
247
441
|
isSending?: boolean;
|
|
@@ -321,6 +515,82 @@ declare const ConversationView: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
321
515
|
readonly type: PropType<(media: MessageMedia, message: Message) => void>;
|
|
322
516
|
readonly default: undefined;
|
|
323
517
|
};
|
|
518
|
+
readonly editingMessage: {
|
|
519
|
+
readonly type: PropType<Message | null>;
|
|
520
|
+
readonly default: null;
|
|
521
|
+
};
|
|
522
|
+
readonly onEditMessage: {
|
|
523
|
+
readonly type: PropType<(message: Message) => void>;
|
|
524
|
+
readonly default: undefined;
|
|
525
|
+
};
|
|
526
|
+
readonly onSaveEdit: {
|
|
527
|
+
readonly type: PropType<(message: Message, text: string) => boolean | void | Promise<boolean | void>>;
|
|
528
|
+
readonly default: undefined;
|
|
529
|
+
};
|
|
530
|
+
readonly onCancelEdit: {
|
|
531
|
+
readonly type: PropType<() => void>;
|
|
532
|
+
readonly default: undefined;
|
|
533
|
+
};
|
|
534
|
+
readonly onDeleteMessage: {
|
|
535
|
+
readonly type: PropType<(message: Message) => boolean | void | Promise<boolean | void>>;
|
|
536
|
+
readonly default: undefined;
|
|
537
|
+
};
|
|
538
|
+
readonly canEditMessage: {
|
|
539
|
+
readonly type: PropType<(message: Message) => boolean>;
|
|
540
|
+
readonly default: undefined;
|
|
541
|
+
};
|
|
542
|
+
readonly confirmDelete: {
|
|
543
|
+
readonly type: PropType<(message: Message) => boolean | Promise<boolean>>;
|
|
544
|
+
readonly default: undefined;
|
|
545
|
+
};
|
|
546
|
+
readonly replyTarget: {
|
|
547
|
+
readonly type: PropType<Message | null>;
|
|
548
|
+
readonly default: null;
|
|
549
|
+
};
|
|
550
|
+
readonly onReplyToMessage: {
|
|
551
|
+
readonly type: PropType<(message: Message) => void>;
|
|
552
|
+
readonly default: undefined;
|
|
553
|
+
};
|
|
554
|
+
readonly onCancelReply: {
|
|
555
|
+
readonly type: PropType<() => void>;
|
|
556
|
+
readonly default: undefined;
|
|
557
|
+
};
|
|
558
|
+
readonly canReplyToMessage: {
|
|
559
|
+
readonly type: PropType<(message: Message) => boolean>;
|
|
560
|
+
readonly default: undefined;
|
|
561
|
+
};
|
|
562
|
+
readonly replyPreviewByMessageId: {
|
|
563
|
+
readonly type: PropType<ReadonlyMap<string, ReplyPreviewEntry>>;
|
|
564
|
+
readonly default: undefined;
|
|
565
|
+
};
|
|
566
|
+
readonly onJumpToMessage: {
|
|
567
|
+
readonly type: PropType<(messageId: string) => void>;
|
|
568
|
+
readonly default: undefined;
|
|
569
|
+
};
|
|
570
|
+
readonly highlightedMessageId: {
|
|
571
|
+
readonly type: PropType<string | null>;
|
|
572
|
+
readonly default: null;
|
|
573
|
+
};
|
|
574
|
+
readonly jumpInFlight: {
|
|
575
|
+
readonly type: BooleanConstructor;
|
|
576
|
+
readonly default: false;
|
|
577
|
+
};
|
|
578
|
+
readonly hasNewerMessages: {
|
|
579
|
+
readonly type: BooleanConstructor;
|
|
580
|
+
readonly default: false;
|
|
581
|
+
};
|
|
582
|
+
readonly isLoadingNewer: {
|
|
583
|
+
readonly type: BooleanConstructor;
|
|
584
|
+
readonly default: false;
|
|
585
|
+
};
|
|
586
|
+
readonly onLoadNewer: {
|
|
587
|
+
readonly type: PropType<() => void | Promise<void>>;
|
|
588
|
+
readonly default: undefined;
|
|
589
|
+
};
|
|
590
|
+
readonly onReturnToLatest: {
|
|
591
|
+
readonly type: PropType<() => void | Promise<void>>;
|
|
592
|
+
readonly default: undefined;
|
|
593
|
+
};
|
|
324
594
|
readonly isInitialLoading: {
|
|
325
595
|
readonly type: BooleanConstructor;
|
|
326
596
|
readonly default: false;
|
|
@@ -411,7 +681,7 @@ declare const ConversationView: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
411
681
|
};
|
|
412
682
|
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
413
683
|
[key: string]: any;
|
|
414
|
-
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("load-older" | "attachment-click" | "send-message" | "typing-change" | "back" | "refresh" | "add-attachment" | "update:modelValue")[], "load-older" | "attachment-click" | "send-message" | "typing-change" | "back" | "refresh" | "add-attachment" | "update:modelValue", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
684
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("load-older" | "load-newer" | "attachment-click" | "edit-message" | "delete-message" | "reply-to-message" | "jump-to-message" | "send-message" | "typing-change" | "back" | "refresh" | "add-attachment" | "update:modelValue" | "save-edit" | "cancel-edit" | "cancel-reply" | "return-to-latest")[], "load-older" | "load-newer" | "attachment-click" | "edit-message" | "delete-message" | "reply-to-message" | "jump-to-message" | "send-message" | "typing-change" | "back" | "refresh" | "add-attachment" | "update:modelValue" | "save-edit" | "cancel-edit" | "cancel-reply" | "return-to-latest", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
415
685
|
readonly conversation: {
|
|
416
686
|
readonly type: PropType<Conversation$1>;
|
|
417
687
|
readonly required: true;
|
|
@@ -468,6 +738,82 @@ declare const ConversationView: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
468
738
|
readonly type: PropType<(media: MessageMedia, message: Message) => void>;
|
|
469
739
|
readonly default: undefined;
|
|
470
740
|
};
|
|
741
|
+
readonly editingMessage: {
|
|
742
|
+
readonly type: PropType<Message | null>;
|
|
743
|
+
readonly default: null;
|
|
744
|
+
};
|
|
745
|
+
readonly onEditMessage: {
|
|
746
|
+
readonly type: PropType<(message: Message) => void>;
|
|
747
|
+
readonly default: undefined;
|
|
748
|
+
};
|
|
749
|
+
readonly onSaveEdit: {
|
|
750
|
+
readonly type: PropType<(message: Message, text: string) => boolean | void | Promise<boolean | void>>;
|
|
751
|
+
readonly default: undefined;
|
|
752
|
+
};
|
|
753
|
+
readonly onCancelEdit: {
|
|
754
|
+
readonly type: PropType<() => void>;
|
|
755
|
+
readonly default: undefined;
|
|
756
|
+
};
|
|
757
|
+
readonly onDeleteMessage: {
|
|
758
|
+
readonly type: PropType<(message: Message) => boolean | void | Promise<boolean | void>>;
|
|
759
|
+
readonly default: undefined;
|
|
760
|
+
};
|
|
761
|
+
readonly canEditMessage: {
|
|
762
|
+
readonly type: PropType<(message: Message) => boolean>;
|
|
763
|
+
readonly default: undefined;
|
|
764
|
+
};
|
|
765
|
+
readonly confirmDelete: {
|
|
766
|
+
readonly type: PropType<(message: Message) => boolean | Promise<boolean>>;
|
|
767
|
+
readonly default: undefined;
|
|
768
|
+
};
|
|
769
|
+
readonly replyTarget: {
|
|
770
|
+
readonly type: PropType<Message | null>;
|
|
771
|
+
readonly default: null;
|
|
772
|
+
};
|
|
773
|
+
readonly onReplyToMessage: {
|
|
774
|
+
readonly type: PropType<(message: Message) => void>;
|
|
775
|
+
readonly default: undefined;
|
|
776
|
+
};
|
|
777
|
+
readonly onCancelReply: {
|
|
778
|
+
readonly type: PropType<() => void>;
|
|
779
|
+
readonly default: undefined;
|
|
780
|
+
};
|
|
781
|
+
readonly canReplyToMessage: {
|
|
782
|
+
readonly type: PropType<(message: Message) => boolean>;
|
|
783
|
+
readonly default: undefined;
|
|
784
|
+
};
|
|
785
|
+
readonly replyPreviewByMessageId: {
|
|
786
|
+
readonly type: PropType<ReadonlyMap<string, ReplyPreviewEntry>>;
|
|
787
|
+
readonly default: undefined;
|
|
788
|
+
};
|
|
789
|
+
readonly onJumpToMessage: {
|
|
790
|
+
readonly type: PropType<(messageId: string) => void>;
|
|
791
|
+
readonly default: undefined;
|
|
792
|
+
};
|
|
793
|
+
readonly highlightedMessageId: {
|
|
794
|
+
readonly type: PropType<string | null>;
|
|
795
|
+
readonly default: null;
|
|
796
|
+
};
|
|
797
|
+
readonly jumpInFlight: {
|
|
798
|
+
readonly type: BooleanConstructor;
|
|
799
|
+
readonly default: false;
|
|
800
|
+
};
|
|
801
|
+
readonly hasNewerMessages: {
|
|
802
|
+
readonly type: BooleanConstructor;
|
|
803
|
+
readonly default: false;
|
|
804
|
+
};
|
|
805
|
+
readonly isLoadingNewer: {
|
|
806
|
+
readonly type: BooleanConstructor;
|
|
807
|
+
readonly default: false;
|
|
808
|
+
};
|
|
809
|
+
readonly onLoadNewer: {
|
|
810
|
+
readonly type: PropType<() => void | Promise<void>>;
|
|
811
|
+
readonly default: undefined;
|
|
812
|
+
};
|
|
813
|
+
readonly onReturnToLatest: {
|
|
814
|
+
readonly type: PropType<() => void | Promise<void>>;
|
|
815
|
+
readonly default: undefined;
|
|
816
|
+
};
|
|
471
817
|
readonly isInitialLoading: {
|
|
472
818
|
readonly type: BooleanConstructor;
|
|
473
819
|
readonly default: false;
|
|
@@ -558,13 +904,22 @@ declare const ConversationView: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
558
904
|
};
|
|
559
905
|
}>> & Readonly<{
|
|
560
906
|
"onLoad-older"?: (...args: any[]) => any;
|
|
907
|
+
"onLoad-newer"?: (...args: any[]) => any;
|
|
561
908
|
"onAttachment-click"?: (...args: any[]) => any;
|
|
909
|
+
"onEdit-message"?: (...args: any[]) => any;
|
|
910
|
+
"onDelete-message"?: (...args: any[]) => any;
|
|
911
|
+
"onReply-to-message"?: (...args: any[]) => any;
|
|
912
|
+
"onJump-to-message"?: (...args: any[]) => any;
|
|
562
913
|
onBack?: (...args: any[]) => any;
|
|
563
914
|
onRefresh?: (...args: any[]) => any;
|
|
564
915
|
"onSend-message"?: (...args: any[]) => any;
|
|
565
916
|
"onTyping-change"?: (...args: any[]) => any;
|
|
566
917
|
"onAdd-attachment"?: (...args: any[]) => any;
|
|
567
918
|
"onUpdate:modelValue"?: (...args: any[]) => any;
|
|
919
|
+
"onSave-edit"?: (...args: any[]) => any;
|
|
920
|
+
"onCancel-edit"?: (...args: any[]) => any;
|
|
921
|
+
"onCancel-reply"?: (...args: any[]) => any;
|
|
922
|
+
"onReturn-to-latest"?: (...args: any[]) => any;
|
|
568
923
|
}>, {
|
|
569
924
|
readonly typingUserIds: ReadonlySet<string>;
|
|
570
925
|
readonly readAtByUserId: ReadonlyMap<string, Date>;
|
|
@@ -573,9 +928,24 @@ declare const ConversationView: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
573
928
|
readonly isLoadingOlder: boolean;
|
|
574
929
|
readonly isSending: boolean;
|
|
575
930
|
readonly hasOlderMessages: boolean;
|
|
931
|
+
readonly editingMessage: Message | null;
|
|
932
|
+
readonly replyTarget: Message | null;
|
|
933
|
+
readonly highlightedMessageId: string | null;
|
|
934
|
+
readonly jumpInFlight: boolean;
|
|
935
|
+
readonly hasNewerMessages: boolean;
|
|
936
|
+
readonly isLoadingNewer: boolean;
|
|
576
937
|
readonly readersResolver: (message: Message) => ReadonlySet<string>;
|
|
577
938
|
readonly onLoadOlder: () => void | Promise<void>;
|
|
578
939
|
readonly onAttachmentClick: (media: MessageMedia, message: Message) => void;
|
|
940
|
+
readonly onEditMessage: (message: Message) => void;
|
|
941
|
+
readonly onDeleteMessage: (message: Message) => boolean | void | Promise<boolean | void>;
|
|
942
|
+
readonly canEditMessage: (message: Message) => boolean;
|
|
943
|
+
readonly confirmDelete: (message: Message) => boolean | Promise<boolean>;
|
|
944
|
+
readonly onReplyToMessage: (message: Message) => void;
|
|
945
|
+
readonly canReplyToMessage: (message: Message) => boolean;
|
|
946
|
+
readonly replyPreviewByMessageId: ReadonlyMap<string, ReplyPreviewEntry>;
|
|
947
|
+
readonly onJumpToMessage: (messageId: string) => void;
|
|
948
|
+
readonly onLoadNewer: () => void | Promise<void>;
|
|
579
949
|
readonly paginationThreshold: number;
|
|
580
950
|
readonly stickToBottom: boolean;
|
|
581
951
|
readonly formatTime: (date: Date) => string;
|
|
@@ -588,6 +958,10 @@ declare const ConversationView: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
588
958
|
readonly onRefresh: () => void | Promise<void>;
|
|
589
959
|
readonly onTypingChange: (isTyping: boolean) => void | Promise<void>;
|
|
590
960
|
readonly onAddAttachment: () => void;
|
|
961
|
+
readonly onSaveEdit: (message: Message, text: string) => boolean | void | Promise<boolean | void>;
|
|
962
|
+
readonly onCancelEdit: () => void;
|
|
963
|
+
readonly onCancelReply: () => void;
|
|
964
|
+
readonly onReturnToLatest: () => void | Promise<void>;
|
|
591
965
|
readonly displayNameForUser: (userId: string) => string | null | undefined;
|
|
592
966
|
readonly reverseMessages: boolean;
|
|
593
967
|
readonly composerPlaceholder: string;
|
|
@@ -597,7 +971,7 @@ declare const ConversationView: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
597
971
|
readonly defaultDraft: string;
|
|
598
972
|
readonly onDraftChange: (value: string) => void;
|
|
599
973
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
600
|
-
interface ConversationProps extends Omit<ConversationViewProps, 'conversation' | 'messages' | 'currentUserId' | 'onSendMessage' | 'typingUserIds' | 'readAtByUserId' | 'readPositionByUserId' | 'onRefresh' | 'onLoadOlder' | 'onTypingChange' | 'isInitialLoading' | 'isLoadingOlder' | 'isSending' | 'hasOlderMessages' | 'error'>, Omit<UseConversationOptions, 'client' | 'conversationId'> {
|
|
974
|
+
interface ConversationProps extends Omit<ConversationViewProps, 'conversation' | 'messages' | 'currentUserId' | 'onSendMessage' | 'typingUserIds' | 'readAtByUserId' | 'readPositionByUserId' | 'onRefresh' | 'onLoadOlder' | 'onTypingChange' | 'isInitialLoading' | 'isLoadingOlder' | 'isSending' | 'hasOlderMessages' | 'error' | 'editingMessage' | 'onEditMessage' | 'onSaveEdit' | 'onCancelEdit' | 'onDeleteMessage' | 'replyTarget' | 'onReplyToMessage' | 'onCancelReply' | 'replyPreviewByMessageId' | 'onJumpToMessage' | 'highlightedMessageId' | 'jumpInFlight' | 'hasNewerMessages' | 'isLoadingNewer' | 'onLoadNewer' | 'onReturnToLatest'>, Omit<UseConversationOptions, 'client' | 'conversationId'> {
|
|
601
975
|
client: ConvoKitUiClient;
|
|
602
976
|
conversationId: string;
|
|
603
977
|
onControllerChange?: (controller: ConversationController) => void;
|
|
@@ -620,6 +994,42 @@ declare const Conversation: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
620
994
|
type: PropType<(text: string) => boolean | void | Promise<boolean | void>>;
|
|
621
995
|
default: undefined;
|
|
622
996
|
};
|
|
997
|
+
editingMessage: {
|
|
998
|
+
type: PropType<Message | null>;
|
|
999
|
+
default: undefined;
|
|
1000
|
+
};
|
|
1001
|
+
onEditMessage: {
|
|
1002
|
+
type: PropType<(message: Message) => void>;
|
|
1003
|
+
default: undefined;
|
|
1004
|
+
};
|
|
1005
|
+
onSaveEdit: {
|
|
1006
|
+
type: PropType<(message: Message, text: string) => boolean | void | Promise<boolean | void>>;
|
|
1007
|
+
default: undefined;
|
|
1008
|
+
};
|
|
1009
|
+
onCancelEdit: {
|
|
1010
|
+
type: PropType<() => void>;
|
|
1011
|
+
default: undefined;
|
|
1012
|
+
};
|
|
1013
|
+
onDeleteMessage: {
|
|
1014
|
+
type: PropType<(message: Message) => boolean | void | Promise<boolean | void>>;
|
|
1015
|
+
default: undefined;
|
|
1016
|
+
};
|
|
1017
|
+
replyTarget: {
|
|
1018
|
+
type: PropType<Message | null>;
|
|
1019
|
+
default: undefined;
|
|
1020
|
+
};
|
|
1021
|
+
onReplyToMessage: {
|
|
1022
|
+
type: PropType<(message: Message) => void>;
|
|
1023
|
+
default: undefined;
|
|
1024
|
+
};
|
|
1025
|
+
onCancelReply: {
|
|
1026
|
+
type: PropType<() => void>;
|
|
1027
|
+
default: undefined;
|
|
1028
|
+
};
|
|
1029
|
+
onJumpToMessage: {
|
|
1030
|
+
type: PropType<(messageId: string) => void>;
|
|
1031
|
+
default: undefined;
|
|
1032
|
+
};
|
|
623
1033
|
client: {
|
|
624
1034
|
type: PropType<ConvoKitUiClient>;
|
|
625
1035
|
required: true;
|
|
@@ -692,6 +1102,46 @@ declare const Conversation: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
692
1102
|
readonly type: PropType<(media: MessageMedia, message: Message) => void>;
|
|
693
1103
|
readonly default: undefined;
|
|
694
1104
|
};
|
|
1105
|
+
canEditMessage: {
|
|
1106
|
+
readonly type: PropType<(message: Message) => boolean>;
|
|
1107
|
+
readonly default: undefined;
|
|
1108
|
+
};
|
|
1109
|
+
confirmDelete: {
|
|
1110
|
+
readonly type: PropType<(message: Message) => boolean | Promise<boolean>>;
|
|
1111
|
+
readonly default: undefined;
|
|
1112
|
+
};
|
|
1113
|
+
canReplyToMessage: {
|
|
1114
|
+
readonly type: PropType<(message: Message) => boolean>;
|
|
1115
|
+
readonly default: undefined;
|
|
1116
|
+
};
|
|
1117
|
+
replyPreviewByMessageId: {
|
|
1118
|
+
readonly type: PropType<ReadonlyMap<string, ReplyPreviewEntry>>;
|
|
1119
|
+
readonly default: undefined;
|
|
1120
|
+
};
|
|
1121
|
+
highlightedMessageId: {
|
|
1122
|
+
readonly type: PropType<string | null>;
|
|
1123
|
+
readonly default: null;
|
|
1124
|
+
};
|
|
1125
|
+
jumpInFlight: {
|
|
1126
|
+
readonly type: BooleanConstructor;
|
|
1127
|
+
readonly default: false;
|
|
1128
|
+
};
|
|
1129
|
+
hasNewerMessages: {
|
|
1130
|
+
readonly type: BooleanConstructor;
|
|
1131
|
+
readonly default: false;
|
|
1132
|
+
};
|
|
1133
|
+
isLoadingNewer: {
|
|
1134
|
+
readonly type: BooleanConstructor;
|
|
1135
|
+
readonly default: false;
|
|
1136
|
+
};
|
|
1137
|
+
onLoadNewer: {
|
|
1138
|
+
readonly type: PropType<() => void | Promise<void>>;
|
|
1139
|
+
readonly default: undefined;
|
|
1140
|
+
};
|
|
1141
|
+
onReturnToLatest: {
|
|
1142
|
+
readonly type: PropType<() => void | Promise<void>>;
|
|
1143
|
+
readonly default: undefined;
|
|
1144
|
+
};
|
|
695
1145
|
isInitialLoading: {
|
|
696
1146
|
readonly type: BooleanConstructor;
|
|
697
1147
|
readonly default: false;
|
|
@@ -782,7 +1232,7 @@ declare const Conversation: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
782
1232
|
};
|
|
783
1233
|
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
784
1234
|
[key: string]: any;
|
|
785
|
-
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("load-older" | "attachment-click" | "send-message" | "typing-change" | "back" | "refresh" | "add-attachment" | "update:modelValue" | "controller-change")[], "load-older" | "attachment-click" | "send-message" | "typing-change" | "back" | "refresh" | "add-attachment" | "update:modelValue" | "controller-change", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
1235
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("load-older" | "load-newer" | "attachment-click" | "edit-message" | "delete-message" | "reply-to-message" | "jump-to-message" | "send-message" | "typing-change" | "back" | "refresh" | "add-attachment" | "update:modelValue" | "save-edit" | "cancel-edit" | "cancel-reply" | "return-to-latest" | "controller-change")[], "load-older" | "load-newer" | "attachment-click" | "edit-message" | "delete-message" | "reply-to-message" | "jump-to-message" | "send-message" | "typing-change" | "back" | "refresh" | "add-attachment" | "update:modelValue" | "save-edit" | "cancel-edit" | "cancel-reply" | "return-to-latest" | "controller-change", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
786
1236
|
conversation: {
|
|
787
1237
|
type: PropType<Conversation$1>;
|
|
788
1238
|
default: undefined;
|
|
@@ -799,6 +1249,42 @@ declare const Conversation: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
799
1249
|
type: PropType<(text: string) => boolean | void | Promise<boolean | void>>;
|
|
800
1250
|
default: undefined;
|
|
801
1251
|
};
|
|
1252
|
+
editingMessage: {
|
|
1253
|
+
type: PropType<Message | null>;
|
|
1254
|
+
default: undefined;
|
|
1255
|
+
};
|
|
1256
|
+
onEditMessage: {
|
|
1257
|
+
type: PropType<(message: Message) => void>;
|
|
1258
|
+
default: undefined;
|
|
1259
|
+
};
|
|
1260
|
+
onSaveEdit: {
|
|
1261
|
+
type: PropType<(message: Message, text: string) => boolean | void | Promise<boolean | void>>;
|
|
1262
|
+
default: undefined;
|
|
1263
|
+
};
|
|
1264
|
+
onCancelEdit: {
|
|
1265
|
+
type: PropType<() => void>;
|
|
1266
|
+
default: undefined;
|
|
1267
|
+
};
|
|
1268
|
+
onDeleteMessage: {
|
|
1269
|
+
type: PropType<(message: Message) => boolean | void | Promise<boolean | void>>;
|
|
1270
|
+
default: undefined;
|
|
1271
|
+
};
|
|
1272
|
+
replyTarget: {
|
|
1273
|
+
type: PropType<Message | null>;
|
|
1274
|
+
default: undefined;
|
|
1275
|
+
};
|
|
1276
|
+
onReplyToMessage: {
|
|
1277
|
+
type: PropType<(message: Message) => void>;
|
|
1278
|
+
default: undefined;
|
|
1279
|
+
};
|
|
1280
|
+
onCancelReply: {
|
|
1281
|
+
type: PropType<() => void>;
|
|
1282
|
+
default: undefined;
|
|
1283
|
+
};
|
|
1284
|
+
onJumpToMessage: {
|
|
1285
|
+
type: PropType<(messageId: string) => void>;
|
|
1286
|
+
default: undefined;
|
|
1287
|
+
};
|
|
802
1288
|
client: {
|
|
803
1289
|
type: PropType<ConvoKitUiClient>;
|
|
804
1290
|
required: true;
|
|
@@ -871,6 +1357,46 @@ declare const Conversation: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
871
1357
|
readonly type: PropType<(media: MessageMedia, message: Message) => void>;
|
|
872
1358
|
readonly default: undefined;
|
|
873
1359
|
};
|
|
1360
|
+
canEditMessage: {
|
|
1361
|
+
readonly type: PropType<(message: Message) => boolean>;
|
|
1362
|
+
readonly default: undefined;
|
|
1363
|
+
};
|
|
1364
|
+
confirmDelete: {
|
|
1365
|
+
readonly type: PropType<(message: Message) => boolean | Promise<boolean>>;
|
|
1366
|
+
readonly default: undefined;
|
|
1367
|
+
};
|
|
1368
|
+
canReplyToMessage: {
|
|
1369
|
+
readonly type: PropType<(message: Message) => boolean>;
|
|
1370
|
+
readonly default: undefined;
|
|
1371
|
+
};
|
|
1372
|
+
replyPreviewByMessageId: {
|
|
1373
|
+
readonly type: PropType<ReadonlyMap<string, ReplyPreviewEntry>>;
|
|
1374
|
+
readonly default: undefined;
|
|
1375
|
+
};
|
|
1376
|
+
highlightedMessageId: {
|
|
1377
|
+
readonly type: PropType<string | null>;
|
|
1378
|
+
readonly default: null;
|
|
1379
|
+
};
|
|
1380
|
+
jumpInFlight: {
|
|
1381
|
+
readonly type: BooleanConstructor;
|
|
1382
|
+
readonly default: false;
|
|
1383
|
+
};
|
|
1384
|
+
hasNewerMessages: {
|
|
1385
|
+
readonly type: BooleanConstructor;
|
|
1386
|
+
readonly default: false;
|
|
1387
|
+
};
|
|
1388
|
+
isLoadingNewer: {
|
|
1389
|
+
readonly type: BooleanConstructor;
|
|
1390
|
+
readonly default: false;
|
|
1391
|
+
};
|
|
1392
|
+
onLoadNewer: {
|
|
1393
|
+
readonly type: PropType<() => void | Promise<void>>;
|
|
1394
|
+
readonly default: undefined;
|
|
1395
|
+
};
|
|
1396
|
+
onReturnToLatest: {
|
|
1397
|
+
readonly type: PropType<() => void | Promise<void>>;
|
|
1398
|
+
readonly default: undefined;
|
|
1399
|
+
};
|
|
874
1400
|
isInitialLoading: {
|
|
875
1401
|
readonly type: BooleanConstructor;
|
|
876
1402
|
readonly default: false;
|
|
@@ -961,13 +1487,22 @@ declare const Conversation: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
961
1487
|
};
|
|
962
1488
|
}>> & Readonly<{
|
|
963
1489
|
"onLoad-older"?: (...args: any[]) => any;
|
|
1490
|
+
"onLoad-newer"?: (...args: any[]) => any;
|
|
964
1491
|
"onAttachment-click"?: (...args: any[]) => any;
|
|
1492
|
+
"onEdit-message"?: (...args: any[]) => any;
|
|
1493
|
+
"onDelete-message"?: (...args: any[]) => any;
|
|
1494
|
+
"onReply-to-message"?: (...args: any[]) => any;
|
|
1495
|
+
"onJump-to-message"?: (...args: any[]) => any;
|
|
965
1496
|
onBack?: (...args: any[]) => any;
|
|
966
1497
|
onRefresh?: (...args: any[]) => any;
|
|
967
1498
|
"onSend-message"?: (...args: any[]) => any;
|
|
968
1499
|
"onTyping-change"?: (...args: any[]) => any;
|
|
969
1500
|
"onAdd-attachment"?: (...args: any[]) => any;
|
|
970
1501
|
"onUpdate:modelValue"?: (...args: any[]) => any;
|
|
1502
|
+
"onSave-edit"?: (...args: any[]) => any;
|
|
1503
|
+
"onCancel-edit"?: (...args: any[]) => any;
|
|
1504
|
+
"onCancel-reply"?: (...args: any[]) => any;
|
|
1505
|
+
"onReturn-to-latest"?: (...args: any[]) => any;
|
|
971
1506
|
"onController-change"?: (...args: any[]) => any;
|
|
972
1507
|
}>, {
|
|
973
1508
|
messages: readonly Message[];
|
|
@@ -980,9 +1515,24 @@ declare const Conversation: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
980
1515
|
isSending: boolean;
|
|
981
1516
|
hasOlderMessages: boolean;
|
|
982
1517
|
currentUserId: string;
|
|
1518
|
+
editingMessage: Message | null;
|
|
1519
|
+
replyTarget: Message | null;
|
|
1520
|
+
highlightedMessageId: string | null;
|
|
1521
|
+
jumpInFlight: boolean;
|
|
1522
|
+
hasNewerMessages: boolean;
|
|
1523
|
+
isLoadingNewer: boolean;
|
|
983
1524
|
readersResolver: (message: Message) => ReadonlySet<string>;
|
|
984
1525
|
onLoadOlder: () => void | Promise<void>;
|
|
985
1526
|
onAttachmentClick: (media: MessageMedia, message: Message) => void;
|
|
1527
|
+
onEditMessage: (message: Message) => void;
|
|
1528
|
+
onDeleteMessage: (message: Message) => boolean | void | Promise<boolean | void>;
|
|
1529
|
+
canEditMessage: (message: Message) => boolean;
|
|
1530
|
+
confirmDelete: (message: Message) => boolean | Promise<boolean>;
|
|
1531
|
+
onReplyToMessage: (message: Message) => void;
|
|
1532
|
+
canReplyToMessage: (message: Message) => boolean;
|
|
1533
|
+
replyPreviewByMessageId: ReadonlyMap<string, ReplyPreviewEntry>;
|
|
1534
|
+
onJumpToMessage: (messageId: string) => void;
|
|
1535
|
+
onLoadNewer: () => void | Promise<void>;
|
|
986
1536
|
paginationThreshold: number;
|
|
987
1537
|
stickToBottom: boolean;
|
|
988
1538
|
formatTime: (date: Date) => string;
|
|
@@ -996,6 +1546,10 @@ declare const Conversation: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
996
1546
|
onRefresh: () => void | Promise<void>;
|
|
997
1547
|
onTypingChange: (isTyping: boolean) => void | Promise<void>;
|
|
998
1548
|
onAddAttachment: () => void;
|
|
1549
|
+
onSaveEdit: (message: Message, text: string) => boolean | void | Promise<boolean | void>;
|
|
1550
|
+
onCancelEdit: () => void;
|
|
1551
|
+
onCancelReply: () => void;
|
|
1552
|
+
onReturnToLatest: () => void | Promise<void>;
|
|
999
1553
|
displayNameForUser: (userId: string) => string | null | undefined;
|
|
1000
1554
|
reverseMessages: boolean;
|
|
1001
1555
|
composerPlaceholder: string;
|
|
@@ -1508,6 +2062,44 @@ interface MessageListViewProps extends ConvoKitAppearanceProps {
|
|
|
1508
2062
|
isLoadingOlder?: boolean;
|
|
1509
2063
|
error?: unknown;
|
|
1510
2064
|
onAttachmentClick?: (media: MessageMedia, message: Message) => void;
|
|
2065
|
+
/** Start editing a message (0.8.0). Without it no row offers an edit action and the markup is unchanged. */
|
|
2066
|
+
onEditMessage?: (message: Message) => void;
|
|
2067
|
+
/** Delete a message after confirmation (0.8.0); `false` means the deletion was not accepted. Without it no row
|
|
2068
|
+
* offers a delete action.
|
|
2069
|
+
*/
|
|
2070
|
+
onDeleteMessage?: (message: Message) => boolean | void | Promise<boolean | void>;
|
|
2071
|
+
/** Replaces the default eligibility (the viewer's own confirmed rows while the viewer's role is not `READ`) for
|
|
2072
|
+
* both actions; pending rows are never eligible.
|
|
2073
|
+
*/
|
|
2074
|
+
canEditMessage?: (message: Message) => boolean;
|
|
2075
|
+
/** Replaces the row's inline "Delete this message?" prompt (and confirms `remove()` from custom rows). */
|
|
2076
|
+
confirmDelete?: (message: Message) => boolean | Promise<boolean>;
|
|
2077
|
+
/** Quote a message (0.9.0). Without it no row offers a reply action and the markup is unchanged. */
|
|
2078
|
+
onReplyToMessage?: (message: Message) => void;
|
|
2079
|
+
/** Replaces the default reply eligibility (any confirmed row while the viewer's role is not `READ`, 0.9.0).
|
|
2080
|
+
* Deliberately separate from `canEditMessage`: an edit-eligibility override must not suppress Reply on rows
|
|
2081
|
+
* the viewer does not own.
|
|
2082
|
+
*/
|
|
2083
|
+
canReplyToMessage?: (message: Message) => boolean;
|
|
2084
|
+
/** Quoted parents by `Message.replyToMessageId` (0.9.0). A row whose id is missing from the map renders its
|
|
2085
|
+
* reference with no quoted text ("not resolved yet"); `'unavailable'` renders the deleted-parent copy.
|
|
2086
|
+
*/
|
|
2087
|
+
replyPreviewByMessageId?: ReadonlyMap<string, ReplyPreviewEntry>;
|
|
2088
|
+
/** Bring a message into view (0.9.0). Without it quoted blocks are inert and no row is focusable. */
|
|
2089
|
+
onJumpToMessage?: (messageId: string) => void;
|
|
2090
|
+
/** The row a jump landed on (0.9.0): it is scrolled to the centre, focused and highlighted until the host
|
|
2091
|
+
* clears the prop or the viewer scrolls.
|
|
2092
|
+
*/
|
|
2093
|
+
highlightedMessageId?: string | null;
|
|
2094
|
+
/** Set by the store while a jump lands (0.9.0): the list is `aria-busy`, stick-to-bottom, pagination and the
|
|
2095
|
+
* highlight clear are suspended, and the attribute is omitted entirely while it is false.
|
|
2096
|
+
*/
|
|
2097
|
+
jumpInFlight?: boolean;
|
|
2098
|
+
/** Whether newer messages exist past the top of the window (0.9.0); only ever true in a jumped window. */
|
|
2099
|
+
hasNewerMessages?: boolean;
|
|
2100
|
+
isLoadingNewer?: boolean;
|
|
2101
|
+
/** Load the page of messages immediately newer than the window (0.9.0); the newer-edge scroll trigger. */
|
|
2102
|
+
onLoadNewer?: () => void | Promise<void>;
|
|
1511
2103
|
scrollElement?: Ref<HTMLElement | null>;
|
|
1512
2104
|
paginationThreshold?: number;
|
|
1513
2105
|
reverse?: boolean;
|
|
@@ -1563,6 +2155,58 @@ declare const MessageListView: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
1563
2155
|
type: PropType<(media: MessageMedia, message: Message) => void>;
|
|
1564
2156
|
default: undefined;
|
|
1565
2157
|
};
|
|
2158
|
+
onEditMessage: {
|
|
2159
|
+
type: PropType<(message: Message) => void>;
|
|
2160
|
+
default: undefined;
|
|
2161
|
+
};
|
|
2162
|
+
onDeleteMessage: {
|
|
2163
|
+
type: PropType<(message: Message) => boolean | void | Promise<boolean | void>>;
|
|
2164
|
+
default: undefined;
|
|
2165
|
+
};
|
|
2166
|
+
canEditMessage: {
|
|
2167
|
+
type: PropType<(message: Message) => boolean>;
|
|
2168
|
+
default: undefined;
|
|
2169
|
+
};
|
|
2170
|
+
confirmDelete: {
|
|
2171
|
+
type: PropType<(message: Message) => boolean | Promise<boolean>>;
|
|
2172
|
+
default: undefined;
|
|
2173
|
+
};
|
|
2174
|
+
onReplyToMessage: {
|
|
2175
|
+
type: PropType<(message: Message) => void>;
|
|
2176
|
+
default: undefined;
|
|
2177
|
+
};
|
|
2178
|
+
canReplyToMessage: {
|
|
2179
|
+
type: PropType<(message: Message) => boolean>;
|
|
2180
|
+
default: undefined;
|
|
2181
|
+
};
|
|
2182
|
+
replyPreviewByMessageId: {
|
|
2183
|
+
type: PropType<ReadonlyMap<string, ReplyPreviewEntry>>;
|
|
2184
|
+
default: undefined;
|
|
2185
|
+
};
|
|
2186
|
+
onJumpToMessage: {
|
|
2187
|
+
type: PropType<(messageId: string) => void>;
|
|
2188
|
+
default: undefined;
|
|
2189
|
+
};
|
|
2190
|
+
highlightedMessageId: {
|
|
2191
|
+
type: PropType<string | null>;
|
|
2192
|
+
default: null;
|
|
2193
|
+
};
|
|
2194
|
+
jumpInFlight: {
|
|
2195
|
+
type: BooleanConstructor;
|
|
2196
|
+
default: boolean;
|
|
2197
|
+
};
|
|
2198
|
+
hasNewerMessages: {
|
|
2199
|
+
type: BooleanConstructor;
|
|
2200
|
+
default: boolean;
|
|
2201
|
+
};
|
|
2202
|
+
isLoadingNewer: {
|
|
2203
|
+
type: BooleanConstructor;
|
|
2204
|
+
default: boolean;
|
|
2205
|
+
};
|
|
2206
|
+
onLoadNewer: {
|
|
2207
|
+
type: PropType<() => void | Promise<void>>;
|
|
2208
|
+
default: undefined;
|
|
2209
|
+
};
|
|
1566
2210
|
scrollElement: {
|
|
1567
2211
|
type: PropType<Ref<HTMLElement | null>>;
|
|
1568
2212
|
default: undefined;
|
|
@@ -1605,7 +2249,7 @@ declare const MessageListView: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
1605
2249
|
};
|
|
1606
2250
|
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
1607
2251
|
[key: string]: any;
|
|
1608
|
-
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("load-older" | "attachment-click")[], "load-older" | "attachment-click", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
2252
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("load-older" | "load-newer" | "attachment-click" | "edit-message" | "delete-message" | "reply-to-message" | "jump-to-message")[], "load-older" | "load-newer" | "attachment-click" | "edit-message" | "delete-message" | "reply-to-message" | "jump-to-message", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
1609
2253
|
conversation: {
|
|
1610
2254
|
type: PropType<Conversation$1>;
|
|
1611
2255
|
required: true;
|
|
@@ -1650,6 +2294,58 @@ declare const MessageListView: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
1650
2294
|
type: PropType<(media: MessageMedia, message: Message) => void>;
|
|
1651
2295
|
default: undefined;
|
|
1652
2296
|
};
|
|
2297
|
+
onEditMessage: {
|
|
2298
|
+
type: PropType<(message: Message) => void>;
|
|
2299
|
+
default: undefined;
|
|
2300
|
+
};
|
|
2301
|
+
onDeleteMessage: {
|
|
2302
|
+
type: PropType<(message: Message) => boolean | void | Promise<boolean | void>>;
|
|
2303
|
+
default: undefined;
|
|
2304
|
+
};
|
|
2305
|
+
canEditMessage: {
|
|
2306
|
+
type: PropType<(message: Message) => boolean>;
|
|
2307
|
+
default: undefined;
|
|
2308
|
+
};
|
|
2309
|
+
confirmDelete: {
|
|
2310
|
+
type: PropType<(message: Message) => boolean | Promise<boolean>>;
|
|
2311
|
+
default: undefined;
|
|
2312
|
+
};
|
|
2313
|
+
onReplyToMessage: {
|
|
2314
|
+
type: PropType<(message: Message) => void>;
|
|
2315
|
+
default: undefined;
|
|
2316
|
+
};
|
|
2317
|
+
canReplyToMessage: {
|
|
2318
|
+
type: PropType<(message: Message) => boolean>;
|
|
2319
|
+
default: undefined;
|
|
2320
|
+
};
|
|
2321
|
+
replyPreviewByMessageId: {
|
|
2322
|
+
type: PropType<ReadonlyMap<string, ReplyPreviewEntry>>;
|
|
2323
|
+
default: undefined;
|
|
2324
|
+
};
|
|
2325
|
+
onJumpToMessage: {
|
|
2326
|
+
type: PropType<(messageId: string) => void>;
|
|
2327
|
+
default: undefined;
|
|
2328
|
+
};
|
|
2329
|
+
highlightedMessageId: {
|
|
2330
|
+
type: PropType<string | null>;
|
|
2331
|
+
default: null;
|
|
2332
|
+
};
|
|
2333
|
+
jumpInFlight: {
|
|
2334
|
+
type: BooleanConstructor;
|
|
2335
|
+
default: boolean;
|
|
2336
|
+
};
|
|
2337
|
+
hasNewerMessages: {
|
|
2338
|
+
type: BooleanConstructor;
|
|
2339
|
+
default: boolean;
|
|
2340
|
+
};
|
|
2341
|
+
isLoadingNewer: {
|
|
2342
|
+
type: BooleanConstructor;
|
|
2343
|
+
default: boolean;
|
|
2344
|
+
};
|
|
2345
|
+
onLoadNewer: {
|
|
2346
|
+
type: PropType<() => void | Promise<void>>;
|
|
2347
|
+
default: undefined;
|
|
2348
|
+
};
|
|
1653
2349
|
scrollElement: {
|
|
1654
2350
|
type: PropType<Ref<HTMLElement | null>>;
|
|
1655
2351
|
default: undefined;
|
|
@@ -1692,16 +2388,34 @@ declare const MessageListView: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
1692
2388
|
};
|
|
1693
2389
|
}>> & Readonly<{
|
|
1694
2390
|
"onLoad-older"?: (...args: any[]) => any;
|
|
2391
|
+
"onLoad-newer"?: (...args: any[]) => any;
|
|
1695
2392
|
"onAttachment-click"?: (...args: any[]) => any;
|
|
2393
|
+
"onEdit-message"?: (...args: any[]) => any;
|
|
2394
|
+
"onDelete-message"?: (...args: any[]) => any;
|
|
2395
|
+
"onReply-to-message"?: (...args: any[]) => any;
|
|
2396
|
+
"onJump-to-message"?: (...args: any[]) => any;
|
|
1696
2397
|
}>, {
|
|
1697
2398
|
reverse: boolean;
|
|
1698
2399
|
readAtByUserId: ReadonlyMap<string, Date>;
|
|
1699
2400
|
readPositionByUserId: ReadonlyMap<string, ReadPosition>;
|
|
1700
2401
|
isLoadingOlder: boolean;
|
|
1701
2402
|
hasOlderMessages: boolean;
|
|
2403
|
+
highlightedMessageId: string | null;
|
|
2404
|
+
jumpInFlight: boolean;
|
|
2405
|
+
hasNewerMessages: boolean;
|
|
2406
|
+
isLoadingNewer: boolean;
|
|
1702
2407
|
readersResolver: (message: Message) => ReadonlySet<string>;
|
|
1703
2408
|
onLoadOlder: () => void | Promise<void>;
|
|
1704
2409
|
onAttachmentClick: (media: MessageMedia, message: Message) => void;
|
|
2410
|
+
onEditMessage: (message: Message) => void;
|
|
2411
|
+
onDeleteMessage: (message: Message) => boolean | void | Promise<boolean | void>;
|
|
2412
|
+
canEditMessage: (message: Message) => boolean;
|
|
2413
|
+
confirmDelete: (message: Message) => boolean | Promise<boolean>;
|
|
2414
|
+
onReplyToMessage: (message: Message) => void;
|
|
2415
|
+
canReplyToMessage: (message: Message) => boolean;
|
|
2416
|
+
replyPreviewByMessageId: ReadonlyMap<string, ReplyPreviewEntry>;
|
|
2417
|
+
onJumpToMessage: (messageId: string) => void;
|
|
2418
|
+
onLoadNewer: () => void | Promise<void>;
|
|
1705
2419
|
scrollElement: Ref<HTMLElement | null, HTMLElement | null>;
|
|
1706
2420
|
paginationThreshold: number;
|
|
1707
2421
|
stickToBottom: boolean;
|
|
@@ -1727,6 +2441,8 @@ interface ConvoKitTheme {
|
|
|
1727
2441
|
outgoingText: string;
|
|
1728
2442
|
/** Unread badge and dot background (0.6.0); the badge label uses `outgoingText`. Defaults to the primary color. */
|
|
1729
2443
|
badge: string;
|
|
2444
|
+
/** The fading tint on the row a jump landed on (0.9.0). Defaults to the primary color at low opacity. */
|
|
2445
|
+
highlight: string;
|
|
1730
2446
|
radius: string;
|
|
1731
2447
|
avatarSize: string;
|
|
1732
2448
|
fontFamily: string;
|
|
@@ -1767,4 +2483,4 @@ declare const ConvoKitThemeProvider: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
1767
2483
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
1768
2484
|
declare function useConvoKitTheme(): Readonly<Ref<ConvoKitTheme>>;
|
|
1769
2485
|
|
|
1770
|
-
export { type BaseViewProps, type ComposerSlotProps, Conversation, type ConversationController, type ConversationFilter, type ConversationItemSlotProps, ConversationList, type ConversationListController, type ConversationListProps, type ConversationListState, ConversationListView, type ConversationListViewProps, type ConversationPageLoader, type ConversationPageRequest, type ConversationProps, type ConversationState, ConversationView, type ConversationViewProps, type ConvoKitAppearanceProps, ConvoKitAvatar, type ConvoKitTheme, ConvoKitThemeProvider, type ConvoKitUiClient, type ConvoKitUiDensity, type ConvoKitUiPart, type ErrorSlot, type ErrorSlotProps, type MediaSlotProps, MessageListView, type MessageListViewProps, type MessageSlotProps, type ReadReceiptSlotProps, type ScrollOptions, type StateSlot, type TypingSlotProps, type UseConversationListOptions, type UseConversationOptions, applyConversationFilter, createConvoKitUiClient, defaultConvoKitTheme, defaultReadersResolver, formatFileSize, isConvoKitPendingMessage, matchesConversation, mergeConversations, mergeInboxEntries, mergeMessages, readerIdsFor, useConversation, useConversationList, useConvoKitTheme };
|
|
2486
|
+
export { type BaseViewProps, type ComposerSlotProps, Conversation, type ConversationController, type ConversationFilter, type ConversationItemSlotProps, ConversationList, type ConversationListController, type ConversationListProps, type ConversationListState, ConversationListView, type ConversationListViewProps, type ConversationPageLoader, type ConversationPageRequest, type ConversationProps, type ConversationState, ConversationView, type ConversationViewProps, type ConvoKitAppearanceProps, ConvoKitAvatar, type ConvoKitTheme, ConvoKitThemeProvider, type ConvoKitUiClient, type ConvoKitUiDensity, type ConvoKitUiPart, type ConvoKitWindowMode, type ErrorSlot, type ErrorSlotProps, type JumpToLatestSlotProps, type MediaSlotProps, MessageListView, type MessageListViewProps, type MessageSlotProps, type ReadReceiptSlotProps, type ReplyPreviewEntry, type ScrollOptions, type StateSlot, type TypingSlotProps, type UseConversationListOptions, type UseConversationOptions, applyConversationFilter, createConvoKitUiClient, defaultConvoKitTheme, defaultReadersResolver, formatFileSize, isConvoKitPendingMessage, matchesConversation, mergeConversations, mergeInboxEntries, mergeMessages, readerIdsFor, useConversation, useConversationList, useConvoKitTheme };
|