@marketrix.ai/widget 3.8.486 → 3.8.488
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/dist/src/components/views/ChatView.d.ts +1 -2
- package/dist/src/hooks/useScreenShare.d.ts +4 -11
- package/dist/src/services/ApiService.d.ts +1 -1
- package/dist/src/services/ChatService.d.ts +1 -1
- package/dist/src/services/DomService.d.ts +1 -1
- package/dist/src/services/ShowModeService.d.ts +1 -1
- package/dist/src/types/index.d.ts +2 -0
- package/dist/src/utils/chat.d.ts +1 -0
- package/dist/widget.mjs +64 -64
- package/package.json +4 -5
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface ChatViewProps {
|
|
3
3
|
onScreenSharingChange: (isSharing: boolean) => void;
|
|
4
|
-
|
|
5
|
-
stopScreenShareRef: React.MutableRefObject<(() => void) | null>;
|
|
4
|
+
toggleScreenShareRef: React.MutableRefObject<(() => void) | null>;
|
|
6
5
|
messageInputRef: React.RefObject<HTMLTextAreaElement | null>;
|
|
7
6
|
}
|
|
8
7
|
export declare const ChatView: React.FC<ChatViewProps>;
|
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
import type { InstructionType } from '../sdk';
|
|
2
2
|
import type { ChatMessage } from '../types';
|
|
3
|
-
export interface PendingMessage {
|
|
4
|
-
content: string;
|
|
5
|
-
mode?: InstructionType;
|
|
6
|
-
alreadyAdded?: boolean;
|
|
7
|
-
}
|
|
8
3
|
export interface UseScreenShareOptions {
|
|
9
4
|
onScreenSharingChange?: (isSharing: boolean) => void;
|
|
10
|
-
|
|
11
|
-
stopScreenShareRef?: React.MutableRefObject<(() => void) | null>;
|
|
5
|
+
toggleScreenShareRef?: React.MutableRefObject<(() => void) | null>;
|
|
12
6
|
onAddMessage: (message: ChatMessage) => void;
|
|
13
7
|
onUpdateMessage: (messageId: string, updates: Partial<ChatMessage>) => void;
|
|
14
8
|
onRemoveMessage?: (messageId: string) => void;
|
|
15
9
|
onSendMessage: (message: string, mode?: InstructionType, skipUserMessage?: boolean) => void;
|
|
16
|
-
|
|
17
|
-
setPendingMessage: (message: PendingMessage | null) => void;
|
|
10
|
+
messages: ChatMessage[];
|
|
18
11
|
}
|
|
19
12
|
export interface UseScreenShareReturn {
|
|
20
13
|
isScreenSharing: boolean;
|
|
@@ -24,6 +17,6 @@ export interface UseScreenShareReturn {
|
|
|
24
17
|
handleScreenAccessDialogDismiss: () => void;
|
|
25
18
|
handleScreenAccessRequestAllow: () => Promise<void>;
|
|
26
19
|
handleScreenAccessRequestDeny: () => void;
|
|
27
|
-
requestScreenAccess: (mode: InstructionType) => void;
|
|
20
|
+
requestScreenAccess: (mode: InstructionType, content: string) => void;
|
|
28
21
|
}
|
|
29
|
-
export declare function useScreenShare({ onScreenSharingChange,
|
|
22
|
+
export declare function useScreenShare({ onScreenSharingChange, toggleScreenShareRef, onAddMessage, onUpdateMessage, onRemoveMessage, onSendMessage, messages, }: UseScreenShareOptions): UseScreenShareReturn;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type InstructionType } from '../sdk';
|
|
2
2
|
import { type CredentialedConfig } from './StorageService';
|
|
3
3
|
/** The reply does not come back from here — it arrives asynchronously as a chat/response event on the stream. */
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function chatPost(config: CredentialedConfig, message: string, mode: InstructionType, requestId: string): Promise<void>;
|
|
@@ -8,5 +8,5 @@ export declare const chatService: ChatService;
|
|
|
8
8
|
export declare const createUserMessage: (content: string, mode?: InstructionType, idPrefix?: string) => ChatMessage;
|
|
9
9
|
export declare const createAgentMessage: (content: string) => ChatMessage;
|
|
10
10
|
export declare const createSystemMessage: (content: string, mode: InstructionType, sender: "user" | "agent", idPrefix: string) => ChatMessage;
|
|
11
|
-
export declare const createScreenAccessRequestMessage: (mode?:
|
|
11
|
+
export declare const createScreenAccessRequestMessage: (mode: InstructionType | undefined, pendingContent?: string) => ChatMessage;
|
|
12
12
|
export declare const createScreenshareMessage: (stream: MediaStream, mode?: InstructionType) => ChatMessage;
|
|
@@ -12,7 +12,7 @@ export declare class DomService {
|
|
|
12
12
|
reindexAndSnapshot(): string;
|
|
13
13
|
getSequenceForElement(element: Element): number | undefined;
|
|
14
14
|
private clearIndex;
|
|
15
|
-
|
|
15
|
+
notInteractableReason(element: HTMLElement, index: number): string | null;
|
|
16
16
|
getValidatedElement(index: number): ValidatedElementResult;
|
|
17
17
|
}
|
|
18
18
|
export declare const domService: DomService;
|
|
@@ -26,7 +26,7 @@ export declare class ShowModeService {
|
|
|
26
26
|
private updatePopupPosition;
|
|
27
27
|
private setupClickHandler;
|
|
28
28
|
private setupContinueButton;
|
|
29
|
-
/**
|
|
29
|
+
/** notInteractableReason's first test is `document.body.contains`, so this one watchdog also covers removal. */
|
|
30
30
|
private setupVisibilityMonitoring;
|
|
31
31
|
private failShowAction;
|
|
32
32
|
private escapeHtml;
|
|
@@ -24,6 +24,8 @@ export interface ChatMessage {
|
|
|
24
24
|
videoStream?: MediaStream;
|
|
25
25
|
isScreenAccessRequest?: boolean;
|
|
26
26
|
screenShareStatus?: 'allowed' | 'denied';
|
|
27
|
+
/** The message queued behind an open screen-access request, sent once it resolves. */
|
|
28
|
+
pendingContent?: string;
|
|
27
29
|
isSystemMessage?: boolean;
|
|
28
30
|
isPlaceholder?: boolean;
|
|
29
31
|
placeholderState?: 'thinking' | 'waiting-for-user';
|
package/dist/src/utils/chat.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export interface FindMessageOptions {
|
|
|
6
6
|
isTaskRunning: boolean;
|
|
7
7
|
currentMode: InstructionType;
|
|
8
8
|
}
|
|
9
|
+
export declare function lastIndexWhere<T>(items: T[], matches: (item: T) => boolean): number;
|
|
9
10
|
/** Ranked predicates: the first rank matching anything wins, and within it the newest message. */
|
|
10
11
|
export declare function findMessageForProgress({ messages, isTaskRunning, currentMode, }: FindMessageOptions): {
|
|
11
12
|
index: number;
|