@antzsoft/chat-core 1.4.1 → 1.4.2
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 +52 -0
- package/dist/chat.store-UVTDBPEC.js +7 -0
- package/dist/{chunk-EOL5B7GS.js → chunk-UIYJAOGL.js} +4 -2
- package/dist/chunk-UIYJAOGL.js.map +1 -0
- package/dist/index.cjs +19 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -3
- package/dist/index.d.ts +24 -3
- package/dist/index.js +19 -4
- package/dist/index.js.map +1 -1
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/{storage-Pz2Taipp.d.cts → storage-BqygfDAK.d.cts} +20 -1
- package/dist/{storage-Pz2Taipp.d.ts → storage-BqygfDAK.d.ts} +20 -1
- package/package.json +1 -1
- package/dist/chat.store-DLNRJ5ZT.js +0 -7
- package/dist/chunk-EOL5B7GS.js.map +0 -1
- /package/dist/{chat.store-DLNRJ5ZT.js.map → chat.store-UVTDBPEC.js.map} +0 -0
package/dist/internal.d.cts
CHANGED
package/dist/internal.d.ts
CHANGED
|
@@ -127,6 +127,23 @@ interface MessageReplyReference {
|
|
|
127
127
|
content?: MessageContent;
|
|
128
128
|
sender?: Pick<User, 'displayName' | 'avatarUrl'>;
|
|
129
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* Present on a message that was created via forwarding. Unlike `MessageReplyReference`,
|
|
132
|
+
* this does NOT carry a content preview — the forwarded message's own `content` already
|
|
133
|
+
* holds the text/attachments, so the UI only needs this to render a "Forwarded" label.
|
|
134
|
+
*
|
|
135
|
+
* `originalMessageId`/`originalConversationId`/`originalSenderId` always point one hop
|
|
136
|
+
* back (the message actually forwarded), never the root of a longer forward chain — the
|
|
137
|
+
* true original author/conversation is intentionally not reconstructable after more than
|
|
138
|
+
* one hop, matching WhatsApp's forwarding privacy model. `forwardDepth` still accumulates
|
|
139
|
+
* across the whole chain, so "Forwarded many times" (depth >= 4) keeps working.
|
|
140
|
+
*/
|
|
141
|
+
interface MessageForwardReference {
|
|
142
|
+
originalMessageId: string;
|
|
143
|
+
originalConversationId: string;
|
|
144
|
+
originalSenderId: string;
|
|
145
|
+
forwardDepth: number;
|
|
146
|
+
}
|
|
130
147
|
/** Metadata attached to system messages by the server. */
|
|
131
148
|
interface SystemMessageMetadata {
|
|
132
149
|
type?: 'system';
|
|
@@ -151,6 +168,8 @@ interface Message {
|
|
|
151
168
|
senderId: string;
|
|
152
169
|
content: MessageContent;
|
|
153
170
|
replyTo?: MessageReplyReference;
|
|
171
|
+
/** Present when this message was created via forwarding rather than composed directly. */
|
|
172
|
+
forwardedFrom?: MessageForwardReference;
|
|
154
173
|
/**
|
|
155
174
|
* Flat list of mentioned userIds (denormalized from the `@[name](id)` tokens in
|
|
156
175
|
* `content.text`). Contains `"all"` for an @all mention. Used for fan-out and
|
|
@@ -847,4 +866,4 @@ declare function uploadBatchWithSlots(files: UploadableFile[], platformUploadFn:
|
|
|
847
866
|
slotToFile: Map<string, FileResponse>;
|
|
848
867
|
}>;
|
|
849
868
|
|
|
850
|
-
export { type
|
|
869
|
+
export { type MultipartPartUrl 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 MessageForwardReference as Q, type ResolvedCompressionConfig as R, type SendMessagePayload as S, type MessageMetadata as T, type User as U, type MessageReaction as V, type MessageReceiptEntry as W, type MessageReplyReference as X, type MessageStarUpdatedEvent as Y, type MessageUpdatedEvent as Z, type MessagesDeliveredEvent as _, type RegisterData as a, type MultipartUploadInfo as a0, type NewMessageEvent as a1, type OptimisticAttachment as a2, type PlatformCompressFn as a3, type PlatformUploadFn as a4, type PlatformUploadPartFn as a5, type QuietHours as a6, type ReactionGroup as a7, type ReactionUpdatedEvent as a8, type ReactionUser as a9, type ReadReceiptEvent as aa, type ReplyAttachmentSnapshot as ab, type ResolvedFileSizeLimits as ac, type SendMessageAttachment as ad, type SyncDeletedForMe as ae, type SyncDeliveredReceipt as af, type SyncParticipantChange as ag, type SyncReactionEntry as ah, type SyncReactions as ai, type SyncReadReceipt as aj, type SyncStarEntry as ak, type SystemMessageMetadata as al, type TypingIndicatorEvent as am, type UploadConfig as an, type UploadProgress as ao, type UserStatusEvent as ap, resolveConfig as aq, storageApi as ar, uploadBatch as as, uploadBatchWithSlots as at, 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 };
|
|
@@ -127,6 +127,23 @@ interface MessageReplyReference {
|
|
|
127
127
|
content?: MessageContent;
|
|
128
128
|
sender?: Pick<User, 'displayName' | 'avatarUrl'>;
|
|
129
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* Present on a message that was created via forwarding. Unlike `MessageReplyReference`,
|
|
132
|
+
* this does NOT carry a content preview — the forwarded message's own `content` already
|
|
133
|
+
* holds the text/attachments, so the UI only needs this to render a "Forwarded" label.
|
|
134
|
+
*
|
|
135
|
+
* `originalMessageId`/`originalConversationId`/`originalSenderId` always point one hop
|
|
136
|
+
* back (the message actually forwarded), never the root of a longer forward chain — the
|
|
137
|
+
* true original author/conversation is intentionally not reconstructable after more than
|
|
138
|
+
* one hop, matching WhatsApp's forwarding privacy model. `forwardDepth` still accumulates
|
|
139
|
+
* across the whole chain, so "Forwarded many times" (depth >= 4) keeps working.
|
|
140
|
+
*/
|
|
141
|
+
interface MessageForwardReference {
|
|
142
|
+
originalMessageId: string;
|
|
143
|
+
originalConversationId: string;
|
|
144
|
+
originalSenderId: string;
|
|
145
|
+
forwardDepth: number;
|
|
146
|
+
}
|
|
130
147
|
/** Metadata attached to system messages by the server. */
|
|
131
148
|
interface SystemMessageMetadata {
|
|
132
149
|
type?: 'system';
|
|
@@ -151,6 +168,8 @@ interface Message {
|
|
|
151
168
|
senderId: string;
|
|
152
169
|
content: MessageContent;
|
|
153
170
|
replyTo?: MessageReplyReference;
|
|
171
|
+
/** Present when this message was created via forwarding rather than composed directly. */
|
|
172
|
+
forwardedFrom?: MessageForwardReference;
|
|
154
173
|
/**
|
|
155
174
|
* Flat list of mentioned userIds (denormalized from the `@[name](id)` tokens in
|
|
156
175
|
* `content.text`). Contains `"all"` for an @all mention. Used for fan-out and
|
|
@@ -847,4 +866,4 @@ declare function uploadBatchWithSlots(files: UploadableFile[], platformUploadFn:
|
|
|
847
866
|
slotToFile: Map<string, FileResponse>;
|
|
848
867
|
}>;
|
|
849
868
|
|
|
850
|
-
export { type
|
|
869
|
+
export { type MultipartPartUrl 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 MessageForwardReference as Q, type ResolvedCompressionConfig as R, type SendMessagePayload as S, type MessageMetadata as T, type User as U, type MessageReaction as V, type MessageReceiptEntry as W, type MessageReplyReference as X, type MessageStarUpdatedEvent as Y, type MessageUpdatedEvent as Z, type MessagesDeliveredEvent as _, type RegisterData as a, type MultipartUploadInfo as a0, type NewMessageEvent as a1, type OptimisticAttachment as a2, type PlatformCompressFn as a3, type PlatformUploadFn as a4, type PlatformUploadPartFn as a5, type QuietHours as a6, type ReactionGroup as a7, type ReactionUpdatedEvent as a8, type ReactionUser as a9, type ReadReceiptEvent as aa, type ReplyAttachmentSnapshot as ab, type ResolvedFileSizeLimits as ac, type SendMessageAttachment as ad, type SyncDeletedForMe as ae, type SyncDeliveredReceipt as af, type SyncParticipantChange as ag, type SyncReactionEntry as ah, type SyncReactions as ai, type SyncReadReceipt as aj, type SyncStarEntry as ak, type SystemMessageMetadata as al, type TypingIndicatorEvent as am, type UploadConfig as an, type UploadProgress as ao, type UserStatusEvent as ap, resolveConfig as aq, storageApi as ar, uploadBatch as as, uploadBatchWithSlots as at, 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 };
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/stores/chat.store.ts"],"sourcesContent":["import { create } from 'zustand';\nimport type { Message } from '../types/index.js';\n\ninterface TypingUser {\n userId: string;\n displayName: string;\n avatarUrl?: string;\n}\n\nexport interface LastReadEntry {\n messageId: string;\n readAt: string;\n}\n\ninterface ChatState {\n activeConversationId: string | null;\n pendingTarget: { conversationId: string; messageId: string } | null;\n typingUsers: Record<string, TypingUser[]>;\n onlineUsers: string[];\n /** keyed by conversationId — current user's last read pointer per conversation */\n lastRead: Record<string, LastReadEntry>;\n /** keyed by userId — last seen timestamp for each user */\n lastSeen: Record<string, string>;\n replyingTo: Message | null;\n editingMessage: Message | null;\n isSidebarOpen: boolean;\n isGroupInfoOpen: boolean;\n isStarredPanelOpen: boolean;\n /** messageId currently shown in the Message Info panel, null = closed */\n messageInfoId: string | null;\n\n setActiveConversation: (id: string | null) => void;\n setPendingTarget: (target: { conversationId: string; messageId: string } | null) => void;\n addTypingUser: (conversationId: string, user: TypingUser) => void;\n removeTypingUser: (conversationId: string, userId: string) => void;\n setUserOnline: (userId: string) => void;\n setUserOffline: (userId: string) => void;\n setOnlineUsers: (userIds: string[]) => void;\n setLastRead: (conversationId: string, messageId: string, readAt: string) => void;\n setLastSeen: (userId: string, lastSeenAt: string | null) => void;\n setReplyingTo: (message: Message | null) => void;\n setEditingMessage: (message: Message | null) => void;\n toggleSidebar: () => void;\n setSidebarOpen: (open: boolean) => void;\n toggleGroupInfo: () => void;\n setGroupInfoOpen: (open: boolean) => void;\n toggleStarredPanel: () => void;\n setStarredPanelOpen: (open: boolean) => void;\n setMessageInfoId: (id: string | null) => void;\n}\n\nexport const useChatStore = create<ChatState>((set) => ({\n activeConversationId: null,\n pendingTarget: null,\n typingUsers: {},\n onlineUsers: [],\n lastRead: {},\n lastSeen: {},\n replyingTo: null,\n editingMessage: null,\n isSidebarOpen: true,\n isGroupInfoOpen: false,\n isStarredPanelOpen: false,\n messageInfoId: null,\n\n setActiveConversation: (id) =>\n set({ activeConversationId: id, replyingTo: null, editingMessage: null }),\n\n setPendingTarget: (target) => set({ pendingTarget: target }),\n\n addTypingUser: (conversationId, user) =>\n set((state) => {\n const existing = state.typingUsers[conversationId] ?? [];\n const deduped = existing.filter((u) => u.userId !== user.userId);\n return { typingUsers: { ...state.typingUsers, [conversationId]: [...deduped, user] } };\n }),\n\n removeTypingUser: (conversationId, userId) =>\n set((state) => ({\n typingUsers: {\n ...state.typingUsers,\n [conversationId]: (state.typingUsers[conversationId] ?? []).filter(\n (u) => u.userId !== userId,\n ),\n },\n })),\n\n setUserOnline: (userId) =>\n set((state) => ({\n onlineUsers: state.onlineUsers.includes(userId)\n ? state.onlineUsers\n : [...state.onlineUsers, userId],\n })),\n\n setUserOffline: (userId) =>\n set((state) => ({ onlineUsers: state.onlineUsers.filter((id) => id !== userId) })),\n\n setOnlineUsers: (userIds) => set({ onlineUsers: userIds }),\n\n setLastRead: (conversationId, messageId, readAt) =>\n set((state) => ({\n lastRead: { ...state.lastRead, [conversationId]: { messageId, readAt } },\n })),\n\n setLastSeen: (userId, lastSeenAt) =>\n set((state) => {\n if (lastSeenAt === null) {\n const { [userId]: _, ...rest } = state.lastSeen;\n return { lastSeen: rest };\n }\n return { lastSeen: { ...state.lastSeen, [userId]: lastSeenAt } };\n }),\n\n setReplyingTo: (message) => set({ replyingTo: message, editingMessage: null }),\n\n setEditingMessage: (message) => set({ editingMessage: message, replyingTo: null }),\n\n toggleSidebar: () => set((state) => ({ isSidebarOpen: !state.isSidebarOpen })),\n setSidebarOpen: (open) => set({ isSidebarOpen: open }),\n\n toggleGroupInfo: () => set((state) => ({ isGroupInfoOpen: !state.isGroupInfoOpen })),\n setGroupInfoOpen: (open) => set({ isGroupInfoOpen: open }),\n\n toggleStarredPanel: () => set((state) => ({ isStarredPanelOpen: !state.isStarredPanelOpen })),\n setStarredPanelOpen: (open) => set({ isStarredPanelOpen: open }),\n\n setMessageInfoId: (id: string | null) => set({ messageInfoId: id }),\n}));\n"],"mappings":";AAAA,SAAS,cAAc;AAmDhB,IAAM,eAAe,OAAkB,CAAC,SAAS;AAAA,EACtD,sBAAsB;AAAA,EACtB,eAAe;AAAA,EACf,aAAa,CAAC;AAAA,EACd,aAAa,CAAC;AAAA,EACd,UAAU,CAAC;AAAA,EACX,UAAU,CAAC;AAAA,EACX,YAAY;AAAA,EACZ,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,oBAAoB;AAAA,EACpB,eAAe;AAAA,EAEf,uBAAuB,CAAC,OACtB,IAAI,EAAE,sBAAsB,IAAI,YAAY,MAAM,gBAAgB,KAAK,CAAC;AAAA,EAE1E,kBAAkB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