@orbitconnect/react 0.1.4 → 0.2.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.
@@ -39,6 +39,23 @@ export interface MessageReadPayload {
39
39
  export interface ConversationUpdatedPayload {
40
40
  conversation_id: string;
41
41
  }
42
+ export interface ConversationContextUpdatedPayload {
43
+ conversation_id: string;
44
+ context: {
45
+ type: string;
46
+ referenceId?: string;
47
+ title?: string;
48
+ subtitle?: string;
49
+ status?: string;
50
+ actor?: {
51
+ id: string;
52
+ type: string;
53
+ name: string;
54
+ avatar?: string;
55
+ };
56
+ metadata?: Record<string, unknown>;
57
+ };
58
+ }
42
59
  export interface MessageReactionPayload {
43
60
  message_id: string;
44
61
  app_user_id: string;
@@ -248,6 +265,7 @@ export interface OrbitSocketEvents {
248
265
  'message:pinned': MessagePinnedPayload;
249
266
  'message:unpinned': MessageUnpinnedPayload;
250
267
  'conversation:updated': ConversationUpdatedPayload;
268
+ 'conversation:context_updated': ConversationContextUpdatedPayload;
251
269
  'chat:typing': ChatTypingPayload;
252
270
  'chat:stopped_typing': ChatStoppedTypingPayload;
253
271
  'presence:changed': PresenceChangedPayload;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Conversation Context Types — OrbitConnect React SDK
3
+ *
4
+ * Defines the structured context that can be attached to conversations
5
+ * for business-aware messaging (bookings, services, purchases, support).
6
+ */
7
+ export type ConversationContextType = "chat" | "booking" | "service" | "purchase" | "support";
8
+ export type ConversationContextStatus = "pending" | "confirmed" | "active" | "completed" | "cancelled";
9
+ export type ContextActorType = "provider" | "vendor" | "business" | "staff" | "agent";
10
+ export interface ContextActor {
11
+ id: string;
12
+ type: ContextActorType;
13
+ name: string;
14
+ avatar?: string;
15
+ }
16
+ export interface ConversationContext {
17
+ type: ConversationContextType;
18
+ referenceId?: string;
19
+ title?: string;
20
+ subtitle?: string;
21
+ status?: ConversationContextStatus;
22
+ actor?: ContextActor;
23
+ metadata?: Record<string, unknown>;
24
+ }
@@ -0,0 +1 @@
1
+ export type { ConversationContext, ContextActor, ConversationContextType, ConversationContextStatus, ContextActorType, } from './context';
@@ -9,5 +9,15 @@ export interface ChatProps {
9
9
  chatBanner?: React.ReactNode;
10
10
  /** Default quick messages seeded into the picker if the user has none saved */
11
11
  defaultQuickMessages?: import('../components/chat/QuickMessages').QuickMessage[];
12
+ /**
13
+ * Called when a conversation is opened (user taps a conversation row, creates a new chat, etc.)
14
+ * Receives the full Conversation object for the opened chat.
15
+ */
16
+ onOpenChatBox?: (conversation: import('../components/chat/ConversationList').Conversation) => void;
17
+ /**
18
+ * Called when the active conversation is closed (user navigates back to the conversation list).
19
+ * Receives the Conversation object of the chat that was closed.
20
+ */
21
+ onChatBoxClosed?: (conversation: import('../components/chat/ConversationList').Conversation) => void;
12
22
  }
13
- export declare function Chat({ conversationId: initialConvId, onCallRequest, renderHeader, chatBanner, defaultQuickMessages }: ChatProps): import("react/jsx-runtime").JSX.Element;
23
+ export declare function Chat({ conversationId: initialConvId, onCallRequest, renderHeader, chatBanner, defaultQuickMessages, onOpenChatBox, onChatBoxClosed }: ChatProps): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbitconnect/react",
3
- "version": "0.1.4",
3
+ "version": "0.2.0",
4
4
  "description": "OrbitConnect React SDK — drop-in real-time chat, voice/video calls, and meetings",
5
5
  "author": "OrbitConnect <sdk@orbitconnect.cloud>",
6
6
  "license": "MIT",