@antzsoft/chat-core 1.3.8 → 1.3.9
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 +79 -1
- package/dist/index.cjs +87 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +63 -3
- package/dist/index.d.ts +63 -3
- package/dist/index.js +81 -1
- package/dist/index.js.map +1 -1
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/{storage-BJvQhWxC.d.cts → storage-C_b-SFFH.d.cts} +21 -1
- package/dist/{storage-BJvQhWxC.d.ts → storage-C_b-SFFH.d.ts} +21 -1
- package/docs/integration-guide.html +37 -3
- package/package.json +1 -1
|
@@ -94,6 +94,18 @@ interface MessageContent {
|
|
|
94
94
|
type: 'text' | 'attachment' | 'system';
|
|
95
95
|
attachments?: Attachment[];
|
|
96
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* A @mention of a user in a group message.
|
|
99
|
+
*
|
|
100
|
+
* The mention is stored inline in `content.text` as a self-describing token
|
|
101
|
+
* `@[DisplayName](userId)` (and, for @all, `@[all](all)`). This flat array is a
|
|
102
|
+
* denormalized copy of the mentioned userIds, used for notification fan-out and
|
|
103
|
+
* "who was mentioned" lookups — it is NOT a positional/offset map.
|
|
104
|
+
*
|
|
105
|
+
* The reserved id `"all"` represents an @all mention (server resolves it to every
|
|
106
|
+
* active participant at send time).
|
|
107
|
+
*/
|
|
108
|
+
declare const MENTION_ALL_ID = "all";
|
|
97
109
|
interface ReplyAttachmentSnapshot {
|
|
98
110
|
type: FileType;
|
|
99
111
|
filename: string;
|
|
@@ -139,6 +151,12 @@ interface Message {
|
|
|
139
151
|
senderId: string;
|
|
140
152
|
content: MessageContent;
|
|
141
153
|
replyTo?: MessageReplyReference;
|
|
154
|
+
/**
|
|
155
|
+
* Flat list of mentioned userIds (denormalized from the `@[name](id)` tokens in
|
|
156
|
+
* `content.text`). Contains `"all"` for an @all mention. Used for fan-out and
|
|
157
|
+
* "mentions me" lookups; not a positional map.
|
|
158
|
+
*/
|
|
159
|
+
mentions?: string[];
|
|
142
160
|
reactions: MessageReaction[];
|
|
143
161
|
lastReaction?: LastReaction | null;
|
|
144
162
|
status: MessageStatus;
|
|
@@ -558,6 +576,8 @@ interface SendMessagePayload {
|
|
|
558
576
|
attachments?: SendMessageAttachment[];
|
|
559
577
|
replyTo?: string;
|
|
560
578
|
tempId: string;
|
|
579
|
+
/** Mentioned userIds (use `"all"` / MENTION_ALL_ID for @all). Derived from the tokens in `text`. */
|
|
580
|
+
mentions?: string[];
|
|
561
581
|
}
|
|
562
582
|
interface QuietHours {
|
|
563
583
|
enabled: boolean;
|
|
@@ -825,4 +845,4 @@ declare function uploadBatchWithSlots(files: UploadableFile[], platformUploadFn:
|
|
|
825
845
|
slotToFile: Map<string, FileResponse>;
|
|
826
846
|
}>;
|
|
827
847
|
|
|
828
|
-
export { type
|
|
848
|
+
export { type MultipartUploadInfo as $, type AuthResponse as A, type BatchUploadResult as B, type CrossConversationSyncResponse as C, type ConversationUpdatedEvent as D, type FileSizeLimits as E, type FileResponse as F, type LastReaction as G, MENTION_ALL_ID as H, type MessageAckEvent as I, type MessageContent as J, type MessageDeletedEvent as K, type LoginCredentials as L, type Message as M, type MessageDeletedForMeEvent as N, type MessageDeliveredEvent as O, type PaginatedResponse as P, type MessageMetadata as Q, type ResolvedCompressionConfig as R, type SendMessagePayload as S, type MessageReaction as T, type User as U, type MessageReceiptEntry as V, type MessageReplyReference as W, type MessageStarUpdatedEvent as X, type MessageUpdatedEvent as Y, type MessagesDeliveredEvent as Z, type MultipartPartUrl as _, type RegisterData as a, type NewMessageEvent as a0, type OptimisticAttachment as a1, type PlatformCompressFn as a2, type PlatformUploadFn as a3, type PlatformUploadPartFn as a4, type QuietHours as a5, type ReactionGroup as a6, type ReactionUpdatedEvent as a7, type ReactionUser as a8, type ReadReceiptEvent as a9, type ReplyAttachmentSnapshot as aa, type ResolvedFileSizeLimits as ab, type SendMessageAttachment as ac, type SyncDeletedForMe as ad, type SyncDeliveredReceipt as ae, type SyncParticipantChange as af, type SyncReactionEntry as ag, type SyncReactions as ah, type SyncReadReceipt as ai, type SyncStarEntry as aj, type SystemMessageMetadata as ak, type TypingIndicatorEvent as al, type UploadConfig as am, type UploadProgress as an, type UserStatusEvent as ao, resolveConfig as ap, storageApi as aq, uploadBatch as ar, uploadBatchWithSlots as as, type AuthTokens as b, type ConversationSyncResponse as c, type AppConfig as d, type CursorPaginatedResponse as e, type MessageReactionsResponse as f, type MessageReceiptsResponse as g, type ConversationListParams as h, type Conversation as i, type Participant as j, type ConversationUnreadCount as k, type UnreadSummary as l, type UserPreferences as m, type ResolvedConfig as n, type PersistStorage as o, type PresignedUrlRequest as p, type PresignedUrlResponse as q, type CompletedPart as r, type FileType as s, type AntzChatConfig as t, type UploadableFile as u, type Attachment as v, type CompressedFile as w, type CompressionAlgorithm as x, type CompressionConfig as y, type ConversationType as z };
|
|
@@ -94,6 +94,18 @@ interface MessageContent {
|
|
|
94
94
|
type: 'text' | 'attachment' | 'system';
|
|
95
95
|
attachments?: Attachment[];
|
|
96
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* A @mention of a user in a group message.
|
|
99
|
+
*
|
|
100
|
+
* The mention is stored inline in `content.text` as a self-describing token
|
|
101
|
+
* `@[DisplayName](userId)` (and, for @all, `@[all](all)`). This flat array is a
|
|
102
|
+
* denormalized copy of the mentioned userIds, used for notification fan-out and
|
|
103
|
+
* "who was mentioned" lookups — it is NOT a positional/offset map.
|
|
104
|
+
*
|
|
105
|
+
* The reserved id `"all"` represents an @all mention (server resolves it to every
|
|
106
|
+
* active participant at send time).
|
|
107
|
+
*/
|
|
108
|
+
declare const MENTION_ALL_ID = "all";
|
|
97
109
|
interface ReplyAttachmentSnapshot {
|
|
98
110
|
type: FileType;
|
|
99
111
|
filename: string;
|
|
@@ -139,6 +151,12 @@ interface Message {
|
|
|
139
151
|
senderId: string;
|
|
140
152
|
content: MessageContent;
|
|
141
153
|
replyTo?: MessageReplyReference;
|
|
154
|
+
/**
|
|
155
|
+
* Flat list of mentioned userIds (denormalized from the `@[name](id)` tokens in
|
|
156
|
+
* `content.text`). Contains `"all"` for an @all mention. Used for fan-out and
|
|
157
|
+
* "mentions me" lookups; not a positional map.
|
|
158
|
+
*/
|
|
159
|
+
mentions?: string[];
|
|
142
160
|
reactions: MessageReaction[];
|
|
143
161
|
lastReaction?: LastReaction | null;
|
|
144
162
|
status: MessageStatus;
|
|
@@ -558,6 +576,8 @@ interface SendMessagePayload {
|
|
|
558
576
|
attachments?: SendMessageAttachment[];
|
|
559
577
|
replyTo?: string;
|
|
560
578
|
tempId: string;
|
|
579
|
+
/** Mentioned userIds (use `"all"` / MENTION_ALL_ID for @all). Derived from the tokens in `text`. */
|
|
580
|
+
mentions?: string[];
|
|
561
581
|
}
|
|
562
582
|
interface QuietHours {
|
|
563
583
|
enabled: boolean;
|
|
@@ -825,4 +845,4 @@ declare function uploadBatchWithSlots(files: UploadableFile[], platformUploadFn:
|
|
|
825
845
|
slotToFile: Map<string, FileResponse>;
|
|
826
846
|
}>;
|
|
827
847
|
|
|
828
|
-
export { type
|
|
848
|
+
export { type MultipartUploadInfo as $, type AuthResponse as A, type BatchUploadResult as B, type CrossConversationSyncResponse as C, type ConversationUpdatedEvent as D, type FileSizeLimits as E, type FileResponse as F, type LastReaction as G, MENTION_ALL_ID as H, type MessageAckEvent as I, type MessageContent as J, type MessageDeletedEvent as K, type LoginCredentials as L, type Message as M, type MessageDeletedForMeEvent as N, type MessageDeliveredEvent as O, type PaginatedResponse as P, type MessageMetadata as Q, type ResolvedCompressionConfig as R, type SendMessagePayload as S, type MessageReaction as T, type User as U, type MessageReceiptEntry as V, type MessageReplyReference as W, type MessageStarUpdatedEvent as X, type MessageUpdatedEvent as Y, type MessagesDeliveredEvent as Z, type MultipartPartUrl as _, type RegisterData as a, type NewMessageEvent as a0, type OptimisticAttachment as a1, type PlatformCompressFn as a2, type PlatformUploadFn as a3, type PlatformUploadPartFn as a4, type QuietHours as a5, type ReactionGroup as a6, type ReactionUpdatedEvent as a7, type ReactionUser as a8, type ReadReceiptEvent as a9, type ReplyAttachmentSnapshot as aa, type ResolvedFileSizeLimits as ab, type SendMessageAttachment as ac, type SyncDeletedForMe as ad, type SyncDeliveredReceipt as ae, type SyncParticipantChange as af, type SyncReactionEntry as ag, type SyncReactions as ah, type SyncReadReceipt as ai, type SyncStarEntry as aj, type SystemMessageMetadata as ak, type TypingIndicatorEvent as al, type UploadConfig as am, type UploadProgress as an, type UserStatusEvent as ao, resolveConfig as ap, storageApi as aq, uploadBatch as ar, uploadBatchWithSlots as as, type AuthTokens as b, type ConversationSyncResponse as c, type AppConfig as d, type CursorPaginatedResponse as e, type MessageReactionsResponse as f, type MessageReceiptsResponse as g, type ConversationListParams as h, type Conversation as i, type Participant as j, type ConversationUnreadCount as k, type UnreadSummary as l, type UserPreferences as m, type ResolvedConfig as n, type PersistStorage as o, type PresignedUrlRequest as p, type PresignedUrlResponse as q, type CompletedPart as r, type FileType as s, type AntzChatConfig as t, type UploadableFile as u, type Attachment as v, type CompressedFile as w, type CompressionAlgorithm as x, type CompressionConfig as y, type ConversationType as z };
|
|
@@ -155,7 +155,7 @@ section.sec>h2:hover{color:#fff}
|
|
|
155
155
|
|
|
156
156
|
<div class="section-label">What's New</div>
|
|
157
157
|
<ul>
|
|
158
|
-
<li><a href="#whats-new">v1.3.
|
|
158
|
+
<li><a href="#whats-new">v1.3.9 Release Notes</a></li>
|
|
159
159
|
</ul>
|
|
160
160
|
|
|
161
161
|
<div class="section-label">Getting Started</div>
|
|
@@ -250,12 +250,46 @@ section.sec>h2:hover{color:#fff}
|
|
|
250
250
|
<h2>What's New</h2>
|
|
251
251
|
<p style="color:var(--muted);font-size:13px;margin-bottom:20px">Version history and release notes. Click a version to expand.</p>
|
|
252
252
|
|
|
253
|
-
<!-- ── v1.3.
|
|
253
|
+
<!-- ── v1.3.9 (current) ── -->
|
|
254
|
+
<div class="wn-version open" id="wn-139">
|
|
255
|
+
<div class="wn-header" onclick="toggleVersion('wn-139')">
|
|
256
|
+
<div class="wn-title">
|
|
257
|
+
<span class="wn-ver">v1.3.9</span>
|
|
258
|
+
<span class="wn-badge current">Current</span>
|
|
259
|
+
<span class="wn-date">July 2026</span>
|
|
260
|
+
</div>
|
|
261
|
+
<span class="wn-chevron">▲</span>
|
|
262
|
+
</div>
|
|
263
|
+
<div class="wn-body">
|
|
264
|
+
<div class="wn-item" id="wn-139-mentions">
|
|
265
|
+
<div class="wn-item-header" onclick="toggleItem('wn-139-mentions')">
|
|
266
|
+
<span class="wn-tag new">New</span>
|
|
267
|
+
<span class="wn-item-title">Group @mentions — tag members, @all (admin-gated), pierces mute</span>
|
|
268
|
+
<span class="wn-chevron-sm">▾</span>
|
|
269
|
+
</div>
|
|
270
|
+
<div class="wn-item-body">
|
|
271
|
+
<p>Tag specific members in a group message, or everyone via <code>@all</code> (server-gated to group admins). A mentioned user is notified <strong>even if they muted the group</strong> — the mention pierces mute — while everyone else follows normal mute rules.</p>
|
|
272
|
+
<p><strong>Storage model.</strong> A mention is stored inline in the message text as a self-describing token <code>@[DisplayName](userId)</code> (and <code>@[all](all)</code> for @all), plus a flat <code>mentions: string[]</code> array on the message (denormalized userIds, <code>'all'</code> for @all). No character offsets are stored — the token is self-locating and survives edits; the embedded name is a render fallback while the current name is resolved live.</p>
|
|
273
|
+
<p><strong>New helpers</strong> (exported from the package root):</p>
|
|
274
|
+
<ul>
|
|
275
|
+
<li><code>buildMentionText(segments)</code> → <code>{ text, mentions }</code> — composer: turn picked members into token text + the id array.</li>
|
|
276
|
+
<li><code>parseMentions(text)</code> → <code>ParsedMention[]</code> — locate tokens.</li>
|
|
277
|
+
<li><code>renderMentionParts(text, resolveName?)</code> → <code>MentionPart[]</code> — split into ordered text/mention parts; <code>resolveName(id, fallbackName)</code> supplies the current display name (handles renames), falling back to the token name for departed users.</li>
|
|
278
|
+
<li><code>extractMentionIds(text)</code> — re-derive the id array after an edit.</li>
|
|
279
|
+
<li><code>isMentionAll(mentions)</code> and <code>MENTION_ALL_ID</code> (<code>'all'</code>).</li>
|
|
280
|
+
</ul>
|
|
281
|
+
<p><strong>Type changes:</strong> <code>Message.mentions?: string[]</code> and <code>SendMessagePayload.mentions?: string[]</code> (both optional). <code>conversationsApi.getMembers()</code> now normalizes participants so <code>user.displayName</code>/<code>avatarUrl</code> arrive consistently — a drop-in name source for a mention picker.</p>
|
|
282
|
+
<p><strong>Backward compatible, additive-only.</strong> An older client viewing a mention shows the readable token text (e.g. <code>@[Alice](…)</code>) rather than crashing; a new client renders a styled <code>@Alice</code>. Requires server support to persist/notify mentions; safe to upgrade regardless. <strong>No integration changes required</strong> unless you build a mention composer/renderer.</p>
|
|
283
|
+
</div>
|
|
284
|
+
</div>
|
|
285
|
+
</div>
|
|
286
|
+
</div><!-- /.wn-version -->
|
|
287
|
+
|
|
288
|
+
<!-- ── v1.3.8 ── -->
|
|
254
289
|
<div class="wn-version open" id="wn-138">
|
|
255
290
|
<div class="wn-header" onclick="toggleVersion('wn-138')">
|
|
256
291
|
<div class="wn-title">
|
|
257
292
|
<span class="wn-ver">v1.3.8</span>
|
|
258
|
-
<span class="wn-badge current">Current</span>
|
|
259
293
|
<span class="wn-date">July 2026</span>
|
|
260
294
|
</div>
|
|
261
295
|
<span class="wn-chevron">▲</span>
|
package/package.json
CHANGED