@medipha/chat 1.0.66 → 1.0.68

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.
@@ -1,4 +1,4 @@
1
- import { AutoDeleteAfterHours, ReactionSummaryPayload, ReactionType } from '@medipha/chat-core';
1
+ import { AutoDeleteAfterHours, ConversationType, MediaKind as CoreMediaKind, ReactionSummaryPayload, ReactionType } from '@medipha/chat-core';
2
2
  export type MessageMark = 'bold' | 'italic' | 'underline' | 'strike';
3
3
  export declare const TEXT_COLORS: readonly ["#1f2937", "#dc2626", "#f97316", "#ca8a04", "#16a34a", "#0284c7", "#7c3aed", "#db2777"];
4
4
  export declare const FONT_SIZES: readonly ["13px", "18px"];
@@ -111,7 +111,7 @@ export interface MessageReplyPreview {
111
111
  removedAt?: string | null;
112
112
  removedById?: string | null;
113
113
  }
114
- export type MediaKind = import('@medipha/chat-core').MediaKind;
114
+ export type MediaKind = CoreMediaKind;
115
115
  export interface ChatMessageAttachment {
116
116
  id: string;
117
117
  url: string;
@@ -240,7 +240,7 @@ export interface ConversationLastMessage {
240
240
  }
241
241
  export interface Conversation {
242
242
  id?: string;
243
- type?: string;
243
+ type?: ConversationType;
244
244
  title?: string | null;
245
245
  name?: string | null;
246
246
  avatarUrl?: string | null;
@@ -315,6 +315,10 @@ export interface MessageContentPart {
315
315
  userId?: string;
316
316
  marks?: MessageMark[];
317
317
  }
318
+ /** Narrows an unknown value to a plain object for safe property reads. */
319
+ export declare const asRecord: (value: unknown) => Record<string, unknown>;
320
+ /** Coerces a value to a trimmed string identifier, or undefined when absent. */
321
+ export declare const asString: (value: unknown) => string | undefined;
318
322
  export declare const getEntityId: (entity: unknown) => string | null;
319
323
  export declare const readUserName: (user: unknown) => string;
320
324
  export declare const getInitials: (name: unknown) => string;
@@ -322,6 +326,8 @@ export declare const readUsers: (response: unknown) => unknown[];
322
326
  export declare const readConversations: (response: unknown) => unknown[];
323
327
  export declare const isSameId: (left: unknown, right: unknown) => boolean;
324
328
  export declare const isGroupConversation: (conversation: unknown) => boolean;
329
+ export declare const SAVED_CONVERSATION_TITLE = "L\u01B0u tr\u1EEF";
330
+ export declare const isSavedConversation: (conversation: unknown) => boolean;
325
331
  export declare const getConversationKindLabel: (isGroup: boolean) => string;
326
332
  export declare const formatUserWorkLine: (user: unknown, codeById: Record<string, string>) => string;
327
333
  export declare const getConversationTitle: (conversation: unknown, currentUserId?: string | null) => string;
@@ -368,6 +374,7 @@ export declare const normalizeReactionSummary: (value: unknown) => ReactionSumma
368
374
  export declare const normalizeIncomingMessage: (message: unknown, fallbackConversationId?: string) => ChatMessage;
369
375
  /** Formats a byte count as a short human-readable size label (e.g. "2.4 MB"). */
370
376
  export declare const formatFileSize: (sizeBytes: number | null | undefined) => string;
377
+ export declare const parseSequence: (sequence: unknown) => bigint | null;
371
378
  export declare const sortMessagesBySequence: (messages: ChatMessage[]) => ChatMessage[];
372
379
  export declare const mergeMessage: (messages: ChatMessage[], nextMessage: ChatMessage) => ChatMessage[];
373
380
  export declare const mergeMessages: (currentMessages: ChatMessage[], nextMessages: ChatMessage[]) => ChatMessage[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medipha/chat",
3
- "version": "1.0.66",
3
+ "version": "1.0.68",
4
4
  "description": "Embeddable Medic-ERP chat module for React applications.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -60,7 +60,7 @@
60
60
  "uuid": "^11.0.5",
61
61
  "yet-another-react-lightbox": "^3.32.2",
62
62
  "zustand": "^5.0.8",
63
- "@medipha/chat-core": "1.0.36"
63
+ "@medipha/chat-core": "1.0.37"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@eslint/js": "^10.0.1",
@@ -98,6 +98,7 @@
98
98
  "lint:fix": "eslint . --fix",
99
99
  "format:check": "prettier . --check",
100
100
  "format": "prettier . --write",
101
+ "login:npm": "npm login --registry=https://registry.npmjs.org/ --scope=@meditech",
101
102
  "publish_ui:npm": "pnpm typecheck && pnpm build && pnpm publish --dry-run && pnpm publish",
102
103
  "publish_core:npm": "pnpm typecheck && pnpm build && pnpm --filter @medipha/chat-core publish --dry-run && pnpm --filter @medipha/chat-core publish",
103
104
  "publish_all:npm": "pnpm typecheck && pnpm build && pnpm --filter @medipha/chat-core publish --dry-run && pnpm --filter @medipha/chat-core publish && pnpm publish --dry-run && pnpm publish"