@marketrix.ai/widget 3.8.40 → 3.8.53
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/base/Dialog.d.ts +4 -6
- package/dist/src/components/base/icons.d.ts +0 -255
- package/dist/src/components/blocks/WidgetDialog.d.ts +0 -12
- package/dist/src/components/navigation/MessengerShell.d.ts +1 -2
- package/dist/src/components/views/ChatView.d.ts +1 -2
- package/dist/src/context/ConversationContext.d.ts +56 -0
- package/dist/src/context/WidgetProviders.d.ts +8 -6
- package/dist/src/context/sseReducer.d.ts +3 -3
- package/dist/src/hooks/useWidget.d.ts +2 -5
- package/dist/src/services/ChatService.d.ts +1 -2
- package/dist/src/services/DomService.d.ts +0 -29
- package/dist/src/services/StorageService.d.ts +3 -4
- package/dist/src/types/browserTools.d.ts +2 -2
- package/dist/src/types/index.d.ts +0 -9
- package/dist/src/utils/bootstrap.d.ts +0 -10
- package/dist/src/utils/dom.d.ts +0 -7
- package/dist/src/utils/validation.d.ts +0 -4
- package/dist/widget.mjs +62 -65
- package/dist/widget.mjs.map +1 -1
- package/package.json +10 -10
- package/dist/src/components/blocks/TabBar.d.ts +0 -12
- package/dist/src/constants/config.d.ts +0 -7
- package/dist/src/context/ChatContext.d.ts +0 -33
- package/dist/src/context/TaskContext.d.ts +0 -38
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marketrix.ai/widget",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.53",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/widget.mjs",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@base-ui/react": "^1.5.0",
|
|
42
|
-
"@orpc/client": "^1.14.
|
|
43
|
-
"@orpc/contract": "^1.14.
|
|
42
|
+
"@orpc/client": "^1.14.6",
|
|
43
|
+
"@orpc/contract": "^1.14.6",
|
|
44
44
|
"@rrweb/record": "^2.0.1",
|
|
45
45
|
"tailwind-merge": "^3.6.0",
|
|
46
46
|
"zod": "^4.4.3"
|
|
@@ -52,25 +52,25 @@
|
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@eslint/js": "^10.0.1",
|
|
54
54
|
"@rrweb/types": "^2.0.0-alpha.20",
|
|
55
|
-
"@tailwindcss/vite": "^4.3.
|
|
55
|
+
"@tailwindcss/vite": "^4.3.1",
|
|
56
56
|
"@testing-library/jest-dom": "^6.9.1",
|
|
57
57
|
"@testing-library/react": "^16.3.2",
|
|
58
|
-
"@types/node": "^25.9.
|
|
58
|
+
"@types/node": "^25.9.3",
|
|
59
59
|
"@types/react": "^19.2.17",
|
|
60
60
|
"@types/react-dom": "^19.2.3",
|
|
61
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
61
|
+
"@typescript-eslint/eslint-plugin": "^8.61.1",
|
|
62
62
|
"@typescript-eslint/parser": "^8.59.0",
|
|
63
63
|
"@vitejs/plugin-react": "^6.0.2",
|
|
64
|
-
"@vitest/coverage-v8": "^4.1.
|
|
65
|
-
"axe-core": "^4.12.
|
|
66
|
-
"eslint": "^10.
|
|
64
|
+
"@vitest/coverage-v8": "^4.1.9",
|
|
65
|
+
"axe-core": "^4.12.1",
|
|
66
|
+
"eslint": "^10.5.0",
|
|
67
67
|
"eslint-config-prettier": "^10.1.8",
|
|
68
68
|
"eslint-plugin-import-x": "^4.16.2",
|
|
69
69
|
"eslint-plugin-prettier": "^5.5.6",
|
|
70
70
|
"eslint-plugin-simple-import-sort": "^13.0.0",
|
|
71
71
|
"eslint-plugin-unused-imports": "^4.4.1",
|
|
72
72
|
"jsdom": "^29.1.1",
|
|
73
|
-
"prettier": "^3.8.
|
|
73
|
+
"prettier": "^3.8.4",
|
|
74
74
|
"react": "^19.2.7",
|
|
75
75
|
"react-dom": "^19.2.7",
|
|
76
76
|
"tailwindcss": "^4.2.4",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { IconName } from '../base/icons';
|
|
3
|
-
export interface TabBarProps {
|
|
4
|
-
tabs: {
|
|
5
|
-
id: string;
|
|
6
|
-
icon: IconName;
|
|
7
|
-
label: string;
|
|
8
|
-
}[];
|
|
9
|
-
active: string;
|
|
10
|
-
onChange: (id: string) => void;
|
|
11
|
-
}
|
|
12
|
-
export declare const TabBar: React.FC<TabBarProps>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { MarketrixConfig } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Get the API URL from config.
|
|
4
|
-
* @param config - MarketrixConfig to extract API URL from
|
|
5
|
-
* @returns API URL string or empty string if not configured
|
|
6
|
-
*/
|
|
7
|
-
export declare const getApiUrl: (config?: Partial<MarketrixConfig>) => string;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ChatMessage, InstructionType } from '../types';
|
|
3
|
-
import type { UIStateActions } from './UIStateContext';
|
|
4
|
-
export interface ChatState {
|
|
5
|
-
messages: ChatMessage[];
|
|
6
|
-
}
|
|
7
|
-
export interface ChatActions {
|
|
8
|
-
addMessage: (message: ChatMessage) => void;
|
|
9
|
-
updateMessage: (messageId: string, updates: Partial<ChatMessage>) => void;
|
|
10
|
-
removeMessage: (messageId: string) => void;
|
|
11
|
-
setMessages: (messages: ChatMessage[]) => void;
|
|
12
|
-
clearMessages: () => void;
|
|
13
|
-
sendMessage: (content: string, mode?: InstructionType, applicationId?: number, question?: string, skipUserMessage?: boolean) => Promise<void>;
|
|
14
|
-
}
|
|
15
|
-
interface ChatContextType {
|
|
16
|
-
chatState: ChatState;
|
|
17
|
-
chatActions: ChatActions;
|
|
18
|
-
/** Expose the raw setState so TaskContext can mutate messages from SSE events. */
|
|
19
|
-
_setMessages: React.Dispatch<React.SetStateAction<ChatState>>;
|
|
20
|
-
}
|
|
21
|
-
interface ChatProviderProps {
|
|
22
|
-
children: React.ReactNode;
|
|
23
|
-
previewMode?: boolean;
|
|
24
|
-
/** Injected from WidgetProviders so ChatProvider can call setLoading without nesting contexts. */
|
|
25
|
-
uiActions: Pick<UIStateActions, 'setLoading'>;
|
|
26
|
-
/** The current mode from UIState, used as fallback when no explicit mode is passed. */
|
|
27
|
-
currentMode: InstructionType;
|
|
28
|
-
}
|
|
29
|
-
export declare const ChatProvider: React.FC<ChatProviderProps>;
|
|
30
|
-
export declare const useChatContext: () => Omit<ChatContextType, "_setMessages">;
|
|
31
|
-
/** Internal hook — only WidgetProviders should use this. */
|
|
32
|
-
export declare const useChatContextInternal: () => ChatContextType;
|
|
33
|
-
export {};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ChatMessage, InstructionType, TaskProgress } from '../types';
|
|
3
|
-
import type { ChatState } from './ChatContext';
|
|
4
|
-
import type { UIStateActions } from './UIStateContext';
|
|
5
|
-
export interface TaskState {
|
|
6
|
-
activeTaskId: string | null;
|
|
7
|
-
isTaskRunning: boolean;
|
|
8
|
-
taskProgress: TaskProgress[];
|
|
9
|
-
}
|
|
10
|
-
export interface TaskActions {
|
|
11
|
-
setTaskState: (payload: {
|
|
12
|
-
activeTaskId: string | null;
|
|
13
|
-
isTaskRunning: boolean;
|
|
14
|
-
taskProgress?: TaskProgress[];
|
|
15
|
-
}) => void;
|
|
16
|
-
stopTask: () => Promise<void>;
|
|
17
|
-
}
|
|
18
|
-
interface TaskContextType {
|
|
19
|
-
taskState: TaskState;
|
|
20
|
-
taskActions: TaskActions;
|
|
21
|
-
}
|
|
22
|
-
interface TaskProviderProps {
|
|
23
|
-
children: React.ReactNode;
|
|
24
|
-
previewMode?: boolean;
|
|
25
|
-
/** Current mode from UIState — needed for progress-line logic in SSE handler. */
|
|
26
|
-
currentMode: InstructionType;
|
|
27
|
-
/** Injected from WidgetProviders to let SSE mutate messages. */
|
|
28
|
-
setMessages: React.Dispatch<React.SetStateAction<ChatState>>;
|
|
29
|
-
/** Live snapshot of the current messages, so SSE wiring reads without stale closures. */
|
|
30
|
-
messagesRef: React.MutableRefObject<ChatMessage[]>;
|
|
31
|
-
/** Injected UI actions needed for agentAvailable, setLoading. */
|
|
32
|
-
uiActions: Pick<UIStateActions, 'setAgentAvailable' | 'setError' | 'setLoading'>;
|
|
33
|
-
/** Injected so stopTask can read the current activeTaskId without a stale closure. */
|
|
34
|
-
activeTaskIdRef: React.MutableRefObject<string | null>;
|
|
35
|
-
}
|
|
36
|
-
export declare const TaskProvider: React.FC<TaskProviderProps>;
|
|
37
|
-
export declare const useTaskContext: () => TaskContextType;
|
|
38
|
-
export {};
|