@medipha/chat 1.0.28 → 1.0.29

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.
@@ -78,7 +78,7 @@ export type MessageStatus = 'pending' | 'sending' | 'sent' | 'delivered' | 'read
78
78
  export type MessageType = 'TEXT' | 'IMAGE' | 'DOCUMENT' | 'SYSTEM';
79
79
  /** Only ever set when type is SYSTEM — which category of SYSTEM message this is, so the
80
80
  * bubble can pick an icon without inspecting the message text. */
81
- export type MessageSystemCategory = 'MESSAGE_PIN' | 'GROUP_INFO_UPDATE' | 'MEMBER_CHANGE';
81
+ export type MessageSystemCategory = 'MESSAGE_PIN' | 'GROUP_INFO_UPDATE' | 'MEMBER_CHANGE' | 'GROUP_SETTING_UPDATE';
82
82
  export type MessageFailureStage = 'upload' | 'send';
83
83
  export type MessageRemovalType = 'SENDER_RECALL' | 'OWNER_MODERATION';
84
84
  export interface MentionedUser {
@@ -220,8 +220,18 @@ export interface Conversation {
220
220
  unreadCount?: number;
221
221
  /** Verified ("tích xanh") group — destructive actions are locked while true. */
222
222
  isVerified?: boolean;
223
+ /** GROUP only; null for DIRECT. The server always fills the defaults in, so an absent
224
+ * value here means the conversation payload predates group settings, not "unset". */
225
+ settings?: GroupSettings | null;
223
226
  [key: string]: unknown;
224
227
  }
228
+ export type GroupMessagePermission = 'ALL_MEMBERS' | 'OWNER_ONLY';
229
+ export interface GroupSettings {
230
+ messagePermission: GroupMessagePermission;
231
+ }
232
+ /** Only an explicit OWNER_ONLY locks the composer — a conversation loaded before this
233
+ * feature existed, or one still in flight, must not silently mute its members. */
234
+ export declare function isMessagingLockedFor(conversation: Conversation | null | undefined, role: string): boolean;
225
235
  export interface MessagesWindow {
226
236
  messages: unknown[];
227
237
  oldestSequence: string | null;
@@ -242,6 +252,8 @@ export declare const readUserName: (user: unknown) => string;
242
252
  export declare const getInitials: (name: unknown) => string;
243
253
  export declare const readUsers: (response: unknown) => unknown[];
244
254
  export declare const readConversations: (response: unknown) => unknown[];
255
+ export declare const isSameId: (left: unknown, right: unknown) => boolean;
256
+ export declare const isGroupConversation: (conversation: unknown) => boolean;
245
257
  export declare const getConversationTitle: (conversation: unknown, currentUserId?: string | null) => string;
246
258
  /** Avatar photo for a conversation row: the conversation's own photo, or for direct chats
247
259
  * the other participant's photo, or null to fall back to initials. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medipha/chat",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "description": "Embeddable Medic-ERP chat module for React applications.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -57,7 +57,7 @@
57
57
  "uuid": "^11.0.5",
58
58
  "yet-another-react-lightbox": "^3.32.2",
59
59
  "zustand": "^5.0.8",
60
- "@medipha/chat-core": "1.0.13"
60
+ "@medipha/chat-core": "1.0.14"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@eslint/js": "^10.0.1",