@marketrix.ai/widget 1.0.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.
Files changed (125) hide show
  1. package/README.md +600 -0
  2. package/dist/components/BrowserTools.d.ts +11 -0
  3. package/dist/components/BrowserTools.d.ts.map +1 -0
  4. package/dist/components/MarketrixWidget.d.ts +8 -0
  5. package/dist/components/MarketrixWidget.d.ts.map +1 -0
  6. package/dist/components/chat/ChatWindow.d.ts +26 -0
  7. package/dist/components/chat/ChatWindow.d.ts.map +1 -0
  8. package/dist/components/chat/MessageContent.d.ts +12 -0
  9. package/dist/components/chat/MessageContent.d.ts.map +1 -0
  10. package/dist/components/chat/MessageItem.d.ts +21 -0
  11. package/dist/components/chat/MessageItem.d.ts.map +1 -0
  12. package/dist/components/chat/MessageList.d.ts +16 -0
  13. package/dist/components/chat/MessageList.d.ts.map +1 -0
  14. package/dist/components/chat/ProgressLine.d.ts +13 -0
  15. package/dist/components/chat/ProgressLine.d.ts.map +1 -0
  16. package/dist/components/chat/SuggestedActions.d.ts +20 -0
  17. package/dist/components/chat/SuggestedActions.d.ts.map +1 -0
  18. package/dist/components/chat/TaskStatusIcon.d.ts +8 -0
  19. package/dist/components/chat/TaskStatusIcon.d.ts.map +1 -0
  20. package/dist/components/chat/ThinkingIndicator.d.ts +10 -0
  21. package/dist/components/chat/ThinkingIndicator.d.ts.map +1 -0
  22. package/dist/components/chat/VideoStreamDisplay.d.ts +8 -0
  23. package/dist/components/chat/VideoStreamDisplay.d.ts.map +1 -0
  24. package/dist/components/chat/WelcomeMessage.d.ts +30 -0
  25. package/dist/components/chat/WelcomeMessage.d.ts.map +1 -0
  26. package/dist/components/debug/DebugPanel.d.ts +17 -0
  27. package/dist/components/debug/DebugPanel.d.ts.map +1 -0
  28. package/dist/components/dev/DomTestPanel.d.ts +8 -0
  29. package/dist/components/dev/DomTestPanel.d.ts.map +1 -0
  30. package/dist/components/input/MessageInput.d.ts +15 -0
  31. package/dist/components/input/MessageInput.d.ts.map +1 -0
  32. package/dist/components/input/ModeSelector.d.ts +13 -0
  33. package/dist/components/input/ModeSelector.d.ts.map +1 -0
  34. package/dist/components/layout/WidgetButton.d.ts +12 -0
  35. package/dist/components/layout/WidgetButton.d.ts.map +1 -0
  36. package/dist/components/ui/DiagnosticModal.d.ts +16 -0
  37. package/dist/components/ui/DiagnosticModal.d.ts.map +1 -0
  38. package/dist/components/ui/ErrorDisplay.d.ts +9 -0
  39. package/dist/components/ui/ErrorDisplay.d.ts.map +1 -0
  40. package/dist/components/ui/ScreenAccessModal.d.ts +10 -0
  41. package/dist/components/ui/ScreenAccessModal.d.ts.map +1 -0
  42. package/dist/components/ui/WidgetSettingsLoader.d.ts +13 -0
  43. package/dist/components/ui/WidgetSettingsLoader.d.ts.map +1 -0
  44. package/dist/constants/config.d.ts +26 -0
  45. package/dist/constants/config.d.ts.map +1 -0
  46. package/dist/context/WidgetContext.d.ts +34 -0
  47. package/dist/context/WidgetContext.d.ts.map +1 -0
  48. package/dist/debug.d.ts +23 -0
  49. package/dist/debug.d.ts.map +1 -0
  50. package/dist/debug.js +22790 -0
  51. package/dist/debug.js.map +1 -0
  52. package/dist/hooks/usePageLifecycle.d.ts +12 -0
  53. package/dist/hooks/usePageLifecycle.d.ts.map +1 -0
  54. package/dist/hooks/useTaskState.d.ts +6 -0
  55. package/dist/hooks/useTaskState.d.ts.map +1 -0
  56. package/dist/hooks/useWidget.d.ts +67 -0
  57. package/dist/hooks/useWidget.d.ts.map +1 -0
  58. package/dist/index.d.ts +29 -0
  59. package/dist/index.d.ts.map +1 -0
  60. package/dist/index.html +1464 -0
  61. package/dist/index.mjs +14660 -0
  62. package/dist/index.mjs.map +1 -0
  63. package/dist/sdk/index.d.ts +6330 -0
  64. package/dist/sdk/index.d.ts.map +1 -0
  65. package/dist/sdk/routes.d.ts +17972 -0
  66. package/dist/sdk/routes.d.ts.map +1 -0
  67. package/dist/sdk/schema.d.ts +9345 -0
  68. package/dist/sdk/schema.d.ts.map +1 -0
  69. package/dist/services/ApiService.d.ts +53 -0
  70. package/dist/services/ApiService.d.ts.map +1 -0
  71. package/dist/services/ChatService.d.ts +46 -0
  72. package/dist/services/ChatService.d.ts.map +1 -0
  73. package/dist/services/ConfigManager.d.ts +21 -0
  74. package/dist/services/ConfigManager.d.ts.map +1 -0
  75. package/dist/services/DevTestService.d.ts +172 -0
  76. package/dist/services/DevTestService.d.ts.map +1 -0
  77. package/dist/services/DomService.d.ts +145 -0
  78. package/dist/services/DomService.d.ts.map +1 -0
  79. package/dist/services/IntegrationService.d.ts +18 -0
  80. package/dist/services/IntegrationService.d.ts.map +1 -0
  81. package/dist/services/ScreenShareService.d.ts +25 -0
  82. package/dist/services/ScreenShareService.d.ts.map +1 -0
  83. package/dist/services/SessionManager.d.ts +68 -0
  84. package/dist/services/SessionManager.d.ts.map +1 -0
  85. package/dist/services/ShowModeService.d.ts +33 -0
  86. package/dist/services/ShowModeService.d.ts.map +1 -0
  87. package/dist/services/ToolService.d.ts +89 -0
  88. package/dist/services/ToolService.d.ts.map +1 -0
  89. package/dist/services/ValidationService.d.ts +34 -0
  90. package/dist/services/ValidationService.d.ts.map +1 -0
  91. package/dist/services/WebSocketClient.d.ts +53 -0
  92. package/dist/services/WebSocketClient.d.ts.map +1 -0
  93. package/dist/types/browserTools.d.ts +98 -0
  94. package/dist/types/browserTools.d.ts.map +1 -0
  95. package/dist/types/index.d.ts +128 -0
  96. package/dist/types/index.d.ts.map +1 -0
  97. package/dist/types/toolMessages.d.ts +78 -0
  98. package/dist/types/toolMessages.d.ts.map +1 -0
  99. package/dist/utils/apiUtils.d.ts +55 -0
  100. package/dist/utils/apiUtils.d.ts.map +1 -0
  101. package/dist/utils/bootstrap.d.ts +74 -0
  102. package/dist/utils/bootstrap.d.ts.map +1 -0
  103. package/dist/utils/chat.d.ts +97 -0
  104. package/dist/utils/chat.d.ts.map +1 -0
  105. package/dist/utils/cleanupUtils.d.ts +24 -0
  106. package/dist/utils/cleanupUtils.d.ts.map +1 -0
  107. package/dist/utils/common.d.ts +55 -0
  108. package/dist/utils/common.d.ts.map +1 -0
  109. package/dist/utils/config.d.ts +58 -0
  110. package/dist/utils/config.d.ts.map +1 -0
  111. package/dist/utils/devTools.d.ts +71 -0
  112. package/dist/utils/devTools.d.ts.map +1 -0
  113. package/dist/utils/dom.d.ts +66 -0
  114. package/dist/utils/dom.d.ts.map +1 -0
  115. package/dist/utils/format.d.ts +36 -0
  116. package/dist/utils/format.d.ts.map +1 -0
  117. package/dist/utils/persistence.d.ts +15 -0
  118. package/dist/utils/persistence.d.ts.map +1 -0
  119. package/dist/utils/stateUtils.d.ts +20 -0
  120. package/dist/utils/stateUtils.d.ts.map +1 -0
  121. package/dist/utils/validation.d.ts +130 -0
  122. package/dist/utils/validation.d.ts.map +1 -0
  123. package/dist/utils/widgetPositioning.d.ts +3 -0
  124. package/dist/utils/widgetPositioning.d.ts.map +1 -0
  125. package/package.json +87 -0
package/README.md ADDED
@@ -0,0 +1,600 @@
1
+ # Marketrix In-App Support Widget
2
+
3
+ A modern, React-based in-app support widget for Marketrix that provides Show,
4
+ Tell, and Do modes with advanced features like screen sharing, tour
5
+ functionality, and API-driven configuration. Designed for easy integration into
6
+ any website using a simple script tag.
7
+
8
+ ## Features
9
+
10
+ - 🎯 **Three Interaction Modes**: Show, Tell, and Do
11
+ - 🎨 **Modern UI**: Built with React 18 and Tailwind CSS
12
+ - 🌙 **Theme Support**: Light and dark themes with custom theming
13
+ - 📱 **Responsive Design**: Works on desktop, tablet, and mobile
14
+ - ⚙️ **API-Driven Configuration**: Dynamic settings from integration service
15
+ - 🔌 **Easy Integration**: Simple script tag integration
16
+ - 🚀 **TypeScript**: Full TypeScript support with comprehensive type definitions
17
+ - 📦 **Standalone**: Single file bundle with no external dependencies
18
+ - 🎥 **Screen Sharing**: Built-in screen sharing and recording capabilities
19
+ - 🗺️ **Tour System**: Interactive tour functionality with step-by-step guidance
20
+ - 🎛️ **Atmosphere Config**: Advanced widget atmosphere and behavior control
21
+ - 🏷️ **Widget Chips**: Quick action chips for common tasks
22
+ - 🔄 **Auto-Refresh**: Dynamic configuration updates
23
+ - 🎭 **Demo Mode**: Built-in demo mode for testing
24
+
25
+ ## Quick Start
26
+
27
+ ### Script Tag Integration (Recommended)
28
+
29
+ Add the widget to your HTML page using a script tag:
30
+
31
+ ```html
32
+ <script
33
+ src="path/to/meet.js"
34
+ marketrix-id="your-marketrix-id"
35
+ marketrix-key="your-marketrix-key"
36
+ ></script>
37
+ ```
38
+
39
+ ### Configuration Options
40
+
41
+ You can customize the widget using data attributes:
42
+
43
+ ```html
44
+ <script
45
+ src="path/to/meet.js"
46
+ marketrix-id="your-marketrix-id"
47
+ marketrix-key="your-marketrix-key"
48
+ data-position="bottom_right"
49
+ data-theme="light"
50
+ data-agent-name="Support Agent"
51
+ data-api-base-url="https://api.marketrix.com"
52
+ ></script>
53
+ ```
54
+
55
+ ## Configuration Options
56
+
57
+ ### Basic Configuration
58
+
59
+ | Option | Type | Required | Default | Description |
60
+ | -------------- | ------ | -------- | ------------------------ | -------------------------------------------------------------------------------- |
61
+ | `marketrixId` | string | ✅ | - | Your Marketrix account ID |
62
+ | `marketrixKey` | string | ✅ | - | Your Marketrix API key |
63
+ | `apiBaseUrl` | string | ❌ | `http://localhost:8080` | API base URL override |
64
+ | `position` | string | ❌ | `'bottom_right'` | Widget position (`'bottom_right'`, `'bottom_left'`, `'top-right'`, `'top-left'`) |
65
+ | `theme` | string | ❌ | `'light'` | Theme (`'light'` or `'dark'`) |
66
+ | `avatarUrl` | string | ❌ | - | URL to the agent's avatar image |
67
+ | `agentName` | string | ❌ | `'Support Agent'` | Display name for the support agent |
68
+ | `enabledModes` | array | ❌ | `['show', 'tell', 'do']` | Array of enabled modes |
69
+
70
+ ### Advanced Configuration
71
+
72
+ The widget supports extensive configuration through the atmosphere system and
73
+ integration service:
74
+
75
+ #### Widget Customization
76
+
77
+ - **Colors**: Primary, secondary, background, text, border colors
78
+ - **Sizes**: Width, height, border radius, font size
79
+ - **Animations**: Slide duration, fade duration, bounce effects
80
+ - **Shadows**: Custom shadow configurations
81
+ - **Z-index**: Layering control
82
+
83
+ #### Device Visibility
84
+
85
+ - **Desktop**: Show/hide on desktop
86
+ - **Tablet**: Show/hide on tablet
87
+ - **Mobile**: Show/hide on mobile
88
+
89
+ #### Advanced Settings
90
+
91
+ - **Auto-open delay**: Delay before auto-opening
92
+ - **Session timeout**: Session timeout duration
93
+ - **Max messages**: Maximum message history
94
+ - **Typing indicator**: Show typing indicators
95
+ - **Read receipts**: Enable read receipts
96
+ - **Sound notifications**: Audio notifications
97
+ - **Vibration**: Haptic feedback
98
+
99
+ #### Widget Chips
100
+
101
+ Quick action chips for common tasks:
102
+
103
+ ```typescript
104
+ interface WidgetChipConfig {
105
+ chip_mode: 'show' | 'tell' | 'do';
106
+ chip_text: string;
107
+ type?: string;
108
+ question?: string;
109
+ }
110
+ ```
111
+
112
+ ## Interaction Modes
113
+
114
+ ### Show Mode
115
+
116
+ The agent will demonstrate how to perform a task or show you the steps to
117
+ accomplish something. Includes interactive tour functionality with step-by-step
118
+ guidance.
119
+
120
+ ### Tell Mode
121
+
122
+ The agent will explain concepts, provide information, or answer questions with
123
+ detailed explanations.
124
+
125
+ ### Do Mode
126
+
127
+ The agent will perform actions on your behalf or execute tasks for you,
128
+ including screen sharing capabilities for remote assistance.
129
+
130
+ ## API Integration
131
+
132
+ The widget communicates with the Marketrix API using the following endpoints:
133
+
134
+ ### Core Endpoints
135
+
136
+ - `GET /integration` - Fetch integration settings and widget configuration
137
+ - `GET /tour` - Fetch tour data for specific connections
138
+ - `GET /agent/status` - Check agent availability
139
+ - `GET /agent/info` - Get agent information
140
+
141
+ ### Integration Service
142
+
143
+ The widget includes a comprehensive integration service that:
144
+
145
+ - Fetches widget configuration from the API
146
+ - Converts integration settings to atmosphere configuration
147
+ - Manages tour data for connections
148
+ - Auto-configures widget based on API settings
149
+ - Supports dynamic configuration updates
150
+
151
+ ### Authentication
152
+
153
+ The widget supports multiple authentication methods:
154
+
155
+ - URL parameters: `marketrix_id` and `marketrix_key`
156
+ - Headers: `X-Marketrix-ID` and `X-Marketrix-Key`
157
+ - Authorization: `Bearer` token
158
+
159
+ ## Development
160
+
161
+ ### Prerequisites
162
+
163
+ - Node.js 16+
164
+ - npm or yarn
165
+
166
+ ### Setup
167
+
168
+ 1. Clone the repository:
169
+
170
+ ```bash
171
+ git clone <repository-url>
172
+ cd widget
173
+ ```
174
+
175
+ 2. Install dependencies:
176
+
177
+ ```bash
178
+ npm install
179
+ ```
180
+
181
+ 3. Start development server:
182
+
183
+ ```bash
184
+ npm run dev
185
+ ```
186
+
187
+ 4. Build for production:
188
+
189
+ ```bash
190
+ npm run build
191
+ ```
192
+
193
+ 5. Build and run debug tool:
194
+
195
+ ```bash
196
+ npm run build:debug
197
+ npx serve dist -l 5174 --cors
198
+ ```
199
+
200
+ Then use this bookmarklet on any website:
201
+
202
+ ```javascript
203
+ javascript: (function () {
204
+ var s = document.createElement('script');
205
+ s.src = 'http://localhost:5174/debug.js';
206
+ document.body.appendChild(s);
207
+ })();
208
+ ```
209
+
210
+ See [docs/DEBUG_PANEL_USAGE.md](docs/DEBUG_PANEL_USAGE.md) for detailed debug
211
+ panel documentation.
212
+
213
+ ### Testing Widget on Any Website
214
+
215
+ You can inject the widget into any website for testing using bookmarklets or
216
+ Tampermonkey.
217
+
218
+ #### Option 1: Bookmarklet (Quick Testing)
219
+
220
+ Create a bookmark with the following URL:
221
+
222
+ **Local Development (using built version):**
223
+
224
+ ```bash
225
+ npm run build:dev
226
+ npx serve dist -l 5174 --cors
227
+ ```
228
+
229
+ ```javascript
230
+ javascript: (function () {
231
+ var s = document.createElement('script');
232
+ s.src = 'http://localhost:5174/meet.js';
233
+ s.setAttribute('marketrix-agent', 'YOUR_AGENT_ID');
234
+ s.setAttribute('marketrix-connection-id', 'YOUR_CONNECTION_ID');
235
+ document.head.appendChild(s);
236
+ })();
237
+ ```
238
+
239
+ **Local Development (using dev server with HTTPS):**
240
+
241
+ ```bash
242
+ npm start
243
+ ```
244
+
245
+ First visit `https://localhost:5174` and accept the certificate, then use:
246
+
247
+ ```javascript
248
+ javascript: (function () {
249
+ var s = document.createElement('script');
250
+ s.src = 'https://localhost:5174/meet.js';
251
+ s.setAttribute('marketrix-agent', 'YOUR_AGENT_ID');
252
+ s.setAttribute('marketrix-connection-id', 'YOUR_CONNECTION_ID');
253
+ document.head.appendChild(s);
254
+ })();
255
+ ```
256
+
257
+ **Production CDN:**
258
+
259
+ ```javascript
260
+ javascript: (function () {
261
+ var s = document.createElement('script');
262
+ s.src = 'https://cdn.marketrix.io/widget/dev/meet.js';
263
+ s.setAttribute('marketrix-agent', 'YOUR_AGENT_ID');
264
+ s.setAttribute('marketrix-connection-id', 'YOUR_CONNECTION_ID');
265
+ document.head.appendChild(s);
266
+ })();
267
+ ```
268
+
269
+ #### Option 2: Tampermonkey (Auto-Inject on Specific Sites)
270
+
271
+ Install [Tampermonkey](https://www.tampermonkey.net/) browser extension, then
272
+ create a new script:
273
+
274
+ ```javascript
275
+ // ==UserScript==
276
+ // @name Marketrix Widget Loader
277
+ // @namespace http://tampermonkey.net/
278
+ // @version 1.0
279
+ // @description Load Marketrix widget on specific websites
280
+ // @author Marketrix
281
+ // @match https://www.example.com/*
282
+ // @grant none
283
+ // @run-at document-end
284
+ // ==/UserScript==
285
+ (function () {
286
+ 'use strict';
287
+ var script = document.createElement('script');
288
+ // Use one of the following sources:
289
+ // Local dev server (HTTPS): script.src = "https://localhost:5174/meet.js";
290
+ // Local built version: script.src = "http://localhost:5174/meet.js";
291
+ // Production CDN:
292
+ script.src = 'https://cdn.marketrix.io/widget/dev/meet.js';
293
+ script.setAttribute('marketrix-agent', 'YOUR_AGENT_ID');
294
+ script.setAttribute('marketrix-connection-id', 'YOUR_CONNECTION_ID');
295
+ document.head.appendChild(script);
296
+ })();
297
+ ```
298
+
299
+ **Notes:**
300
+
301
+ - Replace `YOUR_AGENT_ID` and `YOUR_CONNECTION_ID` with your actual values
302
+ - Change the `@match` pattern to target specific websites (e.g.,
303
+ `https://www.google.com/*`)
304
+ - For HTTPS sites with local dev server, you must first visit
305
+ `https://localhost:5174` and accept the SSL certificate
306
+
307
+ ### Project Structure
308
+
309
+ ```
310
+ widget/
311
+ ├── src/
312
+ │ ├── components/ # React components
313
+ │ │ ├── ChatWindow.tsx # Main chat interface
314
+ │ │ ├── WidgetButton.tsx # Widget toggle button
315
+ │ │ ├── MessageList.tsx # Message display
316
+ │ │ ├── MessageInput.tsx # Message input
317
+ │ │ ├── ModeSelector.tsx # Mode selection
318
+ │ │ ├── ScreenAccessModal.tsx # Screen sharing modal
319
+ │ │ ├── ScreenSharePreview.tsx # Screen share preview
320
+ │ │ └── DemoWidgetWrapper.tsx # Demo wrapper
321
+ │ ├── hooks/ # Custom React hooks
322
+ │ │ ├── useMarketrixWidget.ts # Main widget logic
323
+ │ │ ├── useWidgetAtmosphere.ts # Atmosphere configuration
324
+ │ │ └── useIntegrationSettings.ts # Integration settings
325
+ │ ├── services/ # API services
326
+ │ │ ├── api.ts # Main API service
327
+ │ │ ├── demo-api.ts # Demo API service
328
+ │ │ ├── integration-settings.ts # Integration settings service
329
+ │ │ ├── integrationService.ts # Integration service
330
+ │ │ └── tourService.ts # Tour service
331
+ │ ├── sdk/ # SDK components
332
+ │ │ ├── integrationService.ts # Integration service
333
+ │ │ ├── routes.ts # API routes
334
+ │ │ └── schema.ts # Schema definitions
335
+ │ ├── types/ # TypeScript type definitions
336
+ │ │ ├── index.ts # Main types
337
+ │ │ └── assets.d.ts # Asset types
338
+ │ ├── utils/ # Utility functions
339
+ │ │ ├── ConfigManager.ts # Configuration management
340
+ │ │ ├── formatting.ts # Text formatting
341
+ │ │ ├── highlighting.ts # Syntax highlighting
342
+ │ │ └── positioning.ts # Widget positioning
343
+ │ ├── config/ # Configuration files
344
+ │ │ └── widget-atmosphere.ts # Atmosphere configuration
345
+ │ ├── assets/ # Static assets
346
+ │ │ ├── marketrix-icon.png
347
+ │ │ ├── marketrix-logo.png
348
+ │ │ ├── marktrix-footer.png
349
+ │ │ └── send.png
350
+ │ ├── index.css # Global styles
351
+ │ └── index.tsx # Main entry point
352
+ ├── vite.config.ts # Vite configuration
353
+ ├── tailwind.config.js # Tailwind configuration
354
+ └── dist/ # Build output
355
+ ├── meet.js # Main widget bundle (IIFE)
356
+ └── index.html # Demo page
357
+ ```
358
+
359
+ ## Build System
360
+
361
+ The widget uses Vite with a custom CSS injection plugin that:
362
+
363
+ - Bundles all dependencies (React, etc.) into a single file
364
+ - Injects CSS directly into the JavaScript bundle
365
+ - Outputs an IIFE (Immediately Invoked Function Expression) format
366
+ - Creates a standalone `meet.js` file with no external dependencies
367
+
368
+ ## API Reference
369
+
370
+ ### Functions
371
+
372
+ #### `initMarketrixWidget(config: MarketrixConfig)`
373
+
374
+ Initializes the widget with the provided configuration.
375
+
376
+ #### `destroyMarketrixWidget()`
377
+
378
+ Destroys the widget and removes it from the DOM.
379
+
380
+ #### `updateMarketrixConfig(newConfig: Partial<MarketrixConfig>)`
381
+
382
+ Updates the widget configuration dynamically.
383
+
384
+ #### `getCurrentConfig(): MarketrixConfig`
385
+
386
+ Returns the current widget configuration.
387
+
388
+ ### Types
389
+
390
+ #### `MarketrixConfig`
391
+
392
+ ```typescript
393
+ interface MarketrixConfig {
394
+ marketrixId: string;
395
+ marketrixKey: string;
396
+ apiBaseUrl?: string;
397
+ position?: 'bottom_right' | 'bottom_left' | 'top-right' | 'top-left';
398
+ theme?: 'light' | 'dark';
399
+ avatarUrl?: string;
400
+ agentName?: string;
401
+ enabledModes?: ('show' | 'tell' | 'do')[];
402
+
403
+ // Extended atmosphere controls
404
+ session_time?: number;
405
+ sessionActive?: boolean;
406
+ recorded_time?: number;
407
+ recordActive?: boolean;
408
+ widget_text?: WidgetTextConfig;
409
+ widget_type?: 'ai' | 'live' | 'hybrid';
410
+ widget_visible?: boolean;
411
+ widget_customize?: WidgetCustomizeConfig;
412
+ active_avatar?: AvatarConfig;
413
+ avatar_trigger_time?: number;
414
+ enable_widget_popup?: boolean;
415
+ avatar_status?: 'online' | 'offline' | 'busy' | 'away';
416
+ widget_mode?: 'ai' | 'live' | 'hybrid';
417
+ mLive_form?: LiveFormConfig;
418
+ hybrid_agents_on?: boolean;
419
+ hybrid_agents_off?: boolean;
420
+ widget_visible_device?: DeviceVisibilityConfig;
421
+ streaming_avatar_status?: 'idle' | 'typing' | 'speaking' | 'listening';
422
+ widget_position?: WidgetPositionConfig;
423
+ enable_ai_tour?: boolean;
424
+ widget_header_ai?: string;
425
+ widget_body_ai?: string;
426
+ widget_header_live?: string;
427
+ widget_body_live?: string;
428
+ widget_chat_greeting?: string;
429
+ widget_tour_greeting?: string;
430
+ inapp_login_url?: string;
431
+ inapp_login_id?: string;
432
+ inapp_login_password?: string;
433
+ advanced_settings?: AdvancedSettingsConfig;
434
+ themes?: ThemeConfig;
435
+ responsive_breakpoints?: ResponsiveBreakpointsConfig;
436
+ }
437
+ ```
438
+
439
+ #### `WidgetAtmosphereConfig`
440
+
441
+ ```typescript
442
+ interface WidgetAtmosphereConfig {
443
+ session_time: number;
444
+ sessionActive: boolean;
445
+ recorded_time: number;
446
+ recordActive: boolean;
447
+ widget_text: WidgetTextConfig;
448
+ widget_settings: WidgetSettingsConfig;
449
+ widget_type: 'ai' | 'live' | 'hybrid';
450
+ widget_visible: boolean;
451
+ widget_customize: WidgetCustomizeConfig;
452
+ active_avatar: AvatarConfig;
453
+ avatar_trigger_time: number;
454
+ enable_widget_popup: boolean;
455
+ avatar_status: 'online' | 'offline' | 'busy' | 'away';
456
+ widget_mode: 'ai' | 'live' | 'hybrid';
457
+ mLive_form: LiveFormConfig;
458
+ hybrid_agents_on: boolean;
459
+ hybrid_agents_off: boolean;
460
+ widget_visible_device: DeviceVisibilityConfig;
461
+ streaming_avatar_status: 'idle' | 'typing' | 'speaking' | 'listening';
462
+ widget_position: WidgetPositionConfig;
463
+ enable_ai_tour: boolean;
464
+ widget_header_ai: string;
465
+ widget_body_ai: string;
466
+ widget_header_live: string;
467
+ widget_body_live: string;
468
+ widget_chat_greeting: string;
469
+ widget_tour_greeting: string;
470
+ inapp_login_url: string;
471
+ inapp_login_id: string;
472
+ inapp_login_password: string;
473
+ advanced_settings: AdvancedSettingsConfig;
474
+ themes: ThemeConfig;
475
+ responsive_breakpoints: ResponsiveBreakpointsConfig;
476
+ }
477
+ ```
478
+
479
+ #### `IntegrationSettings`
480
+
481
+ ```typescript
482
+ interface IntegrationSettings {
483
+ widget_enabled?: boolean;
484
+ widget_appearance?: string;
485
+ widget_position?: string;
486
+ widget_device?: string;
487
+ widget_header?: string;
488
+ widget_body?: string;
489
+ widget_greeting?: string;
490
+ widget_feature_tell?: boolean;
491
+ widget_feature_show?: boolean;
492
+ widget_feature_do?: boolean;
493
+ widget_feature_request_human?: boolean;
494
+ widget_background_color?: string;
495
+ widget_text_color?: string;
496
+ widget_border_color?: string;
497
+ widget_accent_color?: string;
498
+ widget_secondary_color?: string;
499
+ widget_border_radius?: string;
500
+ widget_font_size?: string;
501
+ widget_width?: string;
502
+ widget_height?: string;
503
+ widget_shadow?: string;
504
+ widget_animation_duration?: string;
505
+ widget_fade_duration?: string;
506
+ widget_bounce_effect?: boolean;
507
+ widget_chips?: Array<{
508
+ chip_mode?: string;
509
+ chip_text?: string;
510
+ type?: string;
511
+ question?: string;
512
+ }>;
513
+ }
514
+ ```
515
+
516
+ #### `ChatMessage`
517
+
518
+ ```typescript
519
+ interface ChatMessage {
520
+ id: string;
521
+ content: string;
522
+ sender: 'user' | 'agent';
523
+ timestamp: Date;
524
+ mode?: 'show' | 'tell' | 'do';
525
+ }
526
+ ```
527
+
528
+ ## Advanced Features
529
+
530
+ ### Screen Sharing
531
+
532
+ The widget includes built-in screen sharing capabilities:
533
+
534
+ - Screen access modal for permissions
535
+ - Screen share preview component
536
+ - Recording functionality
537
+ - Integration with tour system
538
+
539
+ ### Tour System
540
+
541
+ Interactive tour functionality with:
542
+
543
+ - Step-by-step guidance
544
+ - Element targeting with selectors
545
+ - Action execution
546
+ - Tour data management
547
+ - Connection-based tours
548
+
549
+ ### Demo Mode
550
+
551
+ Built-in demo mode for testing:
552
+
553
+ - Use `demo-marketrix-id` and `demo-marketrix-key`
554
+ - Simulated API responses
555
+ - Context-aware demo messages
556
+ - No real API calls required
557
+
558
+ ### Atmosphere Configuration
559
+
560
+ Advanced widget atmosphere control:
561
+
562
+ - Dynamic configuration updates
563
+ - Auto-refresh capability
564
+ - Session and recording management
565
+ - Avatar status control
566
+ - Widget visibility management
567
+
568
+ ## Styling
569
+
570
+ The widget uses Tailwind CSS with custom animations and theming:
571
+
572
+ - Custom color palette with Marketrix branding
573
+ - Smooth animations (fade, slide, genie effects)
574
+ - Responsive design with breakpoints
575
+ - CSS custom properties for dynamic theming
576
+ - Custom keyframes for advanced animations
577
+
578
+ ## Browser Support
579
+
580
+ - Chrome 90+
581
+ - Firefox 88+
582
+ - Safari 14+
583
+ - Edge 90+
584
+
585
+ ## Contributing
586
+
587
+ 1. Fork the repository
588
+ 2. Create a feature branch
589
+ 3. Make your changes
590
+ 4. Add tests if applicable
591
+ 5. Submit a pull request
592
+
593
+ ## License
594
+
595
+ MIT License - see LICENSE file for details.
596
+
597
+ ## Support
598
+
599
+ For support and questions, please contact the Marketrix team or create an issue
600
+ in the repository.
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import type { MarketrixConfig } from '../types';
3
+ import { type BrowserAction, type BrowserToolMetadata } from '../types/browserTools';
4
+ interface BrowserToolsProps {
5
+ config?: MarketrixConfig;
6
+ onToolSelect?: (tool: BrowserToolMetadata, action: BrowserAction) => void;
7
+ width?: string;
8
+ }
9
+ export declare const BrowserTools: React.FC<BrowserToolsProps>;
10
+ export {};
11
+ //# sourceMappingURL=BrowserTools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrowserTools.d.ts","sourceRoot":"","sources":["../../src/components/BrowserTools.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAaxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACzB,MAAM,uBAAuB,CAAC;AAG/B,UAAU,iBAAiB;IACzB,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,mBAAmB,EAAE,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAmOpD,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { MarketrixConfig } from '../types';
3
+ interface MarketrixWidgetProps {
4
+ config: MarketrixConfig;
5
+ }
6
+ export declare const MarketrixWidget: React.FC<MarketrixWidgetProps>;
7
+ export {};
8
+ //# sourceMappingURL=MarketrixWidget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MarketrixWidget.d.ts","sourceRoot":"","sources":["../../src/components/MarketrixWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8C,MAAM,OAAO,CAAC;AAGnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAQhD,UAAU,oBAAoB;IAC5B,MAAM,EAAE,eAAe,CAAC;CACzB;AA6BD,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAmH1D,CAAC"}
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import type { InstructionType } from '../../sdk';
3
+ import type { ChatMessage, MarketrixConfig, TaskProgress } from '../../types';
4
+ interface ChatWindowProps {
5
+ config: MarketrixConfig;
6
+ isOpen: boolean;
7
+ isMinimized: boolean;
8
+ isLoading: boolean;
9
+ messages: ChatMessage[];
10
+ currentMode: InstructionType;
11
+ agentAvailable: boolean;
12
+ isTaskRunning?: boolean;
13
+ taskProgress?: TaskProgress[];
14
+ onClose: () => void;
15
+ onSendMessage: (message: string, mode?: InstructionType, connectionId?: number, question?: string, skipUserMessage?: boolean) => void;
16
+ onSetMode: (mode: InstructionType) => void;
17
+ onAddMessage: (message: ChatMessage) => void;
18
+ onUpdateMessage: (messageId: string, updates: Partial<ChatMessage>) => void;
19
+ onRemoveMessage?: (messageId: string) => void;
20
+ onStopTask?: () => void;
21
+ onClearChat?: () => void | Promise<void>;
22
+ onScreenSharingChange?: (isSharing: boolean) => void;
23
+ }
24
+ export declare const ChatWindow: React.FC<ChatWindowProps>;
25
+ export {};
26
+ //# sourceMappingURL=ChatWindow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatWindow.d.ts","sourceRoot":"","sources":["../../../src/components/chat/ChatWindow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAG3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAcjD,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAQ9E,UAAU,eAAe;IACvB,MAAM,EAAE,eAAe,CAAC;IACxB,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,WAAW,EAAE,eAAe,CAAC;IAC7B,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,YAAY,EAAE,CAAC;IAC9B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,EAAE,CACb,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,eAAe,EACtB,YAAY,CAAC,EAAE,MAAM,EACrB,QAAQ,CAAC,EAAE,MAAM,EACjB,eAAe,CAAC,EAAE,OAAO,KACtB,IAAI,CAAC;IACV,SAAS,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;IAC3C,YAAY,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAC7C,eAAe,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAC5E,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,qBAAqB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CACtD;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAwsBhD,CAAC"}
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import type { ChatMessage, WidgetState } from '../../types';
3
+ interface MessageContentProps {
4
+ message: ChatMessage;
5
+ isLastMessage: boolean;
6
+ widgetState: WidgetState;
7
+ accentColor: string;
8
+ textColor: string;
9
+ }
10
+ export declare const MessageContent: React.FC<MessageContentProps>;
11
+ export {};
12
+ //# sourceMappingURL=MessageContent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MessageContent.d.ts","sourceRoot":"","sources":["../../../src/components/chat/MessageContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK5D,UAAU,mBAAmB;IAC3B,OAAO,EAAE,WAAW,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAiGxD,CAAC"}
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import type { ChatMessage, WidgetState } from '../../types';
3
+ interface MessageItemProps {
4
+ message: ChatMessage;
5
+ index: number;
6
+ isLastMessage: boolean;
7
+ widgetState: WidgetState;
8
+ settings: {
9
+ widget_accent_color: string;
10
+ widget_text_color: string;
11
+ widget_border_color: string;
12
+ widget_shadow: string;
13
+ widget_border_radius: string;
14
+ };
15
+ marketrixIcon: string;
16
+ onScreenAccessAllow?: () => void;
17
+ onScreenAccessDeny?: () => void;
18
+ }
19
+ export declare const MessageItem: React.FC<MessageItemProps>;
20
+ export {};
21
+ //# sourceMappingURL=MessageItem.d.ts.map