@marketrix.ai/widget 3.8.472 → 3.8.473

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/loader.js CHANGED
@@ -1,27 +1,15 @@
1
1
  // Must sit in <head> before any <script type="module"> — it defines the importmap they resolve against.
2
2
  (function () {
3
- var existing = {};
4
- var oldMap = document.querySelector('script[type="importmap"]');
5
- if (oldMap) {
6
- try {
7
- existing = JSON.parse(oldMap.textContent).imports || {};
8
- } catch (e) {}
9
- oldMap.remove();
10
- }
11
-
12
- // Host mappings win — `existing` is spread last so a host already on React 19 keeps its own build.
13
- var defaults = {
14
- react: 'https://esm.sh/react@19',
15
- 'react-dom': 'https://esm.sh/react-dom@19',
16
- 'react-dom/client': 'https://esm.sh/react-dom@19/client',
17
- 'react/jsx-runtime': 'https://esm.sh/react@19/jsx-runtime',
18
- };
19
-
20
- var merged = Object.assign({}, defaults, existing);
21
-
22
3
  var map = document.createElement('script');
23
4
  map.type = 'importmap';
24
- map.textContent = JSON.stringify({ imports: merged });
5
+ map.textContent = JSON.stringify({
6
+ imports: {
7
+ react: 'https://esm.sh/react@19',
8
+ 'react-dom': 'https://esm.sh/react-dom@19',
9
+ 'react-dom/client': 'https://esm.sh/react-dom@19/client',
10
+ 'react/jsx-runtime': 'https://esm.sh/react@19/jsx-runtime',
11
+ },
12
+ });
25
13
  document.head.appendChild(map);
26
14
 
27
15
  var self = document.currentScript;
@@ -4,7 +4,6 @@ export interface UIState {
4
4
  isOpen: boolean;
5
5
  activeView: WidgetView;
6
6
  currentMode: InstructionType;
7
- isLoading: boolean;
8
7
  error?: string;
9
8
  }
10
9
  export interface UIStateActions {
@@ -12,7 +11,6 @@ export interface UIStateActions {
12
11
  toggleWidget: () => void;
13
12
  closeWidget: () => void;
14
13
  setMode: (mode: InstructionType) => void;
15
- setLoading: (loading: boolean) => void;
16
14
  setError: (error: string | undefined) => void;
17
15
  applyState: (payload: Partial<UIState>) => void;
18
16
  }
@@ -7,17 +7,14 @@ export interface SseState {
7
7
  messages: ChatMessage[];
8
8
  task: TaskState;
9
9
  }
10
- export type SseEffect = {
10
+ export interface SseEffect {
11
11
  type: 'executeTool';
12
12
  toolCallId: string;
13
13
  tool: string;
14
14
  args: Record<string, unknown>;
15
15
  mode: InstructionType;
16
16
  explanation: string;
17
- } | {
18
- type: 'setLoading';
19
- value: boolean;
20
- };
17
+ }
21
18
  export interface ReduceResult {
22
19
  state: SseState;
23
20
  effects: SseEffect[];
@@ -19,7 +19,6 @@ export declare const useWidget: () => {
19
19
  toggleWidget: () => void;
20
20
  closeWidget: () => void;
21
21
  setMode: (mode: import("..").InstructionType) => void;
22
- setLoading: (loading: boolean) => void;
23
22
  setError: (error: string | undefined) => void;
24
23
  applyState: (payload: Partial<import("../context/UIStateContext").UIState>) => void;
25
24
  };
@@ -20,7 +20,7 @@ export interface ToolExecutionResult<T = TextData> {
20
20
  success: boolean;
21
21
  data: T;
22
22
  error?: string;
23
- afterResponseSent?: () => void;
23
+ afterResponseAttempt?: () => void;
24
24
  }
25
25
  export declare class BrowserToolService {
26
26
  executeTool(browserToolName: string, args: Record<string, unknown>, mode?: string, explanation?: string): Promise<ToolExecutionResult<unknown>>;
@@ -9,7 +9,7 @@ export declare class DomService {
9
9
  private staleReason;
10
10
  private indexInteractableElements;
11
11
  /** `data-id` is the whole contract: the agent parses the snapshot for `[data-id]` and reads nothing else off it. */
12
- getSnapshotHtml(): string;
12
+ reindexAndSnapshot(): string;
13
13
  getSequenceForElement(element: Element): number | undefined;
14
14
  private clearIndex;
15
15
  checkElementInteractable(element: HTMLElement, index: number): string | null;
@@ -39,7 +39,7 @@ export interface MessagePart {
39
39
  export type WidgetView = 'home' | 'chat';
40
40
  export interface WidgetState {
41
41
  isOpen: boolean;
42
- isLoading: boolean;
42
+ isAwaitingReply: boolean;
43
43
  messages: ChatMessage[];
44
44
  currentMode: InstructionType;
45
45
  error?: string;