@modochats/widget 0.1.3 → 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 (179) hide show
  1. package/.github/workflows/build-and-publish.yml +116 -174
  2. package/.releaserc +60 -0
  3. package/CHANGELOG.md +8 -0
  4. package/README.md +191 -163
  5. package/package.json +79 -76
  6. package/src/app.ts +117 -117
  7. package/src/constants/index.ts +21 -21
  8. package/src/constants/regex.ts +2 -2
  9. package/src/constants/version.ts +2 -0
  10. package/src/index.ts +16 -16
  11. package/src/services/chat/conversation.ts +135 -135
  12. package/src/services/chat/message-utils.ts +221 -221
  13. package/src/services/chat/model.ts +139 -139
  14. package/src/services/chatbot/chatbot.ts +66 -66
  15. package/src/services/checker.ts +10 -10
  16. package/src/services/listeners/fn.ts +77 -77
  17. package/src/services/socket/utils.ts +9 -9
  18. package/src/services/user/customer-data.ts +78 -78
  19. package/src/services/voice-chat/model.ts +79 -79
  20. package/src/services/voice-chat/utils.ts +137 -137
  21. package/src/tools/fetch.ts +7 -7
  22. package/src/types/app.ts +17 -17
  23. package/src/types/conversation.ts +14 -14
  24. package/src/types/socket.ts +7 -7
  25. package/src/types/window.ts +12 -12
  26. package/src/utils/audio.ts +67 -67
  27. package/src/utils/browser.ts +4 -4
  28. package/src/utils/fetch.ts +98 -98
  29. package/src/utils/uuid.ts +13 -13
  30. package/dist/src/app.d.ts +0 -29
  31. package/dist/src/app.js +0 -1
  32. package/dist/src/app.js.map +0 -1
  33. package/dist/src/constants/index.d.ts +0 -9
  34. package/dist/src/constants/index.js +0 -1
  35. package/dist/src/constants/index.js.map +0 -1
  36. package/dist/src/constants/regex.d.ts +0 -2
  37. package/dist/src/constants/regex.js +0 -1
  38. package/dist/src/constants/regex.js.map +0 -1
  39. package/dist/src/index.d.ts +0 -9
  40. package/dist/src/index.js +0 -1
  41. package/dist/src/index.js.map +0 -1
  42. package/dist/src/models/chatbot.d.ts +0 -23
  43. package/dist/src/models/chatbot.js +0 -1
  44. package/dist/src/models/chatbot.js.map +0 -1
  45. package/dist/src/models/conversation.d.ts +0 -22
  46. package/dist/src/models/conversation.js +0 -1
  47. package/dist/src/models/conversation.js.map +0 -1
  48. package/dist/src/models/customer-data.d.ts +0 -31
  49. package/dist/src/models/customer-data.js +0 -1
  50. package/dist/src/models/customer-data.js.map +0 -1
  51. package/dist/src/models/message-utils.d.ts +0 -12
  52. package/dist/src/models/message-utils.js +0 -1
  53. package/dist/src/models/message-utils.js.map +0 -1
  54. package/dist/src/services/chat/conversation.d.ts +0 -22
  55. package/dist/src/services/chat/conversation.js +0 -1
  56. package/dist/src/services/chat/conversation.js.map +0 -1
  57. package/dist/src/services/chat/message-utils.d.ts +0 -12
  58. package/dist/src/services/chat/message-utils.js +0 -1
  59. package/dist/src/services/chat/message-utils.js.map +0 -1
  60. package/dist/src/services/chat/model.d.ts +0 -27
  61. package/dist/src/services/chat/model.js +0 -1
  62. package/dist/src/services/chat/model.js.map +0 -1
  63. package/dist/src/services/chatbot/chatbot.d.ts +0 -23
  64. package/dist/src/services/chatbot/chatbot.js +0 -1
  65. package/dist/src/services/chatbot/chatbot.js.map +0 -1
  66. package/dist/src/services/checker.d.ts +0 -3
  67. package/dist/src/services/checker.js +0 -1
  68. package/dist/src/services/checker.js.map +0 -1
  69. package/dist/src/services/listeners/adders.d.ts +0 -3
  70. package/dist/src/services/listeners/adders.js +0 -1
  71. package/dist/src/services/listeners/adders.js.map +0 -1
  72. package/dist/src/services/listeners/fn.d.ts +0 -3
  73. package/dist/src/services/listeners/fn.js +0 -1
  74. package/dist/src/services/listeners/fn.js.map +0 -1
  75. package/dist/src/services/socket/utils.d.ts +0 -2
  76. package/dist/src/services/socket/utils.js +0 -1
  77. package/dist/src/services/socket/utils.js.map +0 -1
  78. package/dist/src/services/ui/fn.d.ts +0 -13
  79. package/dist/src/services/ui/fn.js +0 -1
  80. package/dist/src/services/ui/fn.js.map +0 -1
  81. package/dist/src/services/ui/html.d.ts +0 -3
  82. package/dist/src/services/ui/html.js +0 -1
  83. package/dist/src/services/ui/html.js.map +0 -1
  84. package/dist/src/services/user/customer-data.d.ts +0 -31
  85. package/dist/src/services/user/customer-data.js +0 -1
  86. package/dist/src/services/user/customer-data.js.map +0 -1
  87. package/dist/src/services/voice-chat/model.d.ts +0 -12
  88. package/dist/src/services/voice-chat/model.js +0 -1
  89. package/dist/src/services/voice-chat/model.js.map +0 -1
  90. package/dist/src/services/voice-chat/utils.d.ts +0 -9
  91. package/dist/src/services/voice-chat/utils.js +0 -1
  92. package/dist/src/services/voice-chat/utils.js.map +0 -1
  93. package/dist/src/tools/fetch.d.ts +0 -2
  94. package/dist/src/tools/fetch.js +0 -1
  95. package/dist/src/tools/fetch.js.map +0 -1
  96. package/dist/src/types/app.d.ts +0 -17
  97. package/dist/src/types/app.js +0 -1
  98. package/dist/src/types/app.js.map +0 -1
  99. package/dist/src/types/conversation.d.ts +0 -14
  100. package/dist/src/types/conversation.js +0 -1
  101. package/dist/src/types/conversation.js.map +0 -1
  102. package/dist/src/types/socket.d.ts +0 -6
  103. package/dist/src/types/socket.js +0 -1
  104. package/dist/src/types/socket.js.map +0 -1
  105. package/dist/src/types/window.d.ts +0 -9
  106. package/dist/src/types/window.js +0 -1
  107. package/dist/src/types/window.js.map +0 -1
  108. package/dist/src/utils/audio.d.ts +0 -3
  109. package/dist/src/utils/audio.js +0 -1
  110. package/dist/src/utils/audio.js.map +0 -1
  111. package/dist/src/utils/browser.d.ts +0 -2
  112. package/dist/src/utils/browser.js +0 -1
  113. package/dist/src/utils/browser.js.map +0 -1
  114. package/dist/src/utils/fetch.d.ts +0 -18
  115. package/dist/src/utils/fetch.js +0 -1
  116. package/dist/src/utils/fetch.js.map +0 -1
  117. package/dist/src/utils/uuid.d.ts +0 -6
  118. package/dist/src/utils/uuid.js +0 -1
  119. package/dist/src/utils/uuid.js.map +0 -1
  120. package/dist/types/src/app.d.ts +0 -30
  121. package/dist/types/src/app.d.ts.map +0 -1
  122. package/dist/types/src/constants/index.d.ts +0 -10
  123. package/dist/types/src/constants/index.d.ts.map +0 -1
  124. package/dist/types/src/constants/regex.d.ts +0 -3
  125. package/dist/types/src/constants/regex.d.ts.map +0 -1
  126. package/dist/types/src/index.d.ts +0 -10
  127. package/dist/types/src/index.d.ts.map +0 -1
  128. package/dist/types/src/models/chatbot.d.ts +0 -24
  129. package/dist/types/src/models/chatbot.d.ts.map +0 -1
  130. package/dist/types/src/models/conversation.d.ts +0 -23
  131. package/dist/types/src/models/conversation.d.ts.map +0 -1
  132. package/dist/types/src/models/customer-data.d.ts +0 -32
  133. package/dist/types/src/models/customer-data.d.ts.map +0 -1
  134. package/dist/types/src/models/message-utils.d.ts +0 -13
  135. package/dist/types/src/models/message-utils.d.ts.map +0 -1
  136. package/dist/types/src/services/chat/conversation.d.ts +0 -23
  137. package/dist/types/src/services/chat/conversation.d.ts.map +0 -1
  138. package/dist/types/src/services/chat/message-utils.d.ts +0 -13
  139. package/dist/types/src/services/chat/message-utils.d.ts.map +0 -1
  140. package/dist/types/src/services/chat/model.d.ts +0 -28
  141. package/dist/types/src/services/chat/model.d.ts.map +0 -1
  142. package/dist/types/src/services/chatbot/chatbot.d.ts +0 -24
  143. package/dist/types/src/services/chatbot/chatbot.d.ts.map +0 -1
  144. package/dist/types/src/services/checker.d.ts +0 -4
  145. package/dist/types/src/services/checker.d.ts.map +0 -1
  146. package/dist/types/src/services/listeners/adders.d.ts +0 -4
  147. package/dist/types/src/services/listeners/adders.d.ts.map +0 -1
  148. package/dist/types/src/services/listeners/fn.d.ts +0 -4
  149. package/dist/types/src/services/listeners/fn.d.ts.map +0 -1
  150. package/dist/types/src/services/socket/utils.d.ts +0 -3
  151. package/dist/types/src/services/socket/utils.d.ts.map +0 -1
  152. package/dist/types/src/services/ui/fn.d.ts +0 -14
  153. package/dist/types/src/services/ui/fn.d.ts.map +0 -1
  154. package/dist/types/src/services/ui/html.d.ts +0 -4
  155. package/dist/types/src/services/ui/html.d.ts.map +0 -1
  156. package/dist/types/src/services/user/customer-data.d.ts +0 -32
  157. package/dist/types/src/services/user/customer-data.d.ts.map +0 -1
  158. package/dist/types/src/services/voice-chat/model.d.ts +0 -13
  159. package/dist/types/src/services/voice-chat/model.d.ts.map +0 -1
  160. package/dist/types/src/services/voice-chat/utils.d.ts +0 -10
  161. package/dist/types/src/services/voice-chat/utils.d.ts.map +0 -1
  162. package/dist/types/src/tools/fetch.d.ts +0 -3
  163. package/dist/types/src/tools/fetch.d.ts.map +0 -1
  164. package/dist/types/src/types/app.d.ts +0 -18
  165. package/dist/types/src/types/app.d.ts.map +0 -1
  166. package/dist/types/src/types/conversation.d.ts +0 -15
  167. package/dist/types/src/types/conversation.d.ts.map +0 -1
  168. package/dist/types/src/types/socket.d.ts +0 -7
  169. package/dist/types/src/types/socket.d.ts.map +0 -1
  170. package/dist/types/src/types/window.d.ts +0 -10
  171. package/dist/types/src/types/window.d.ts.map +0 -1
  172. package/dist/types/src/utils/audio.d.ts +0 -4
  173. package/dist/types/src/utils/audio.d.ts.map +0 -1
  174. package/dist/types/src/utils/browser.d.ts +0 -3
  175. package/dist/types/src/utils/browser.d.ts.map +0 -1
  176. package/dist/types/src/utils/fetch.d.ts +0 -19
  177. package/dist/types/src/utils/fetch.d.ts.map +0 -1
  178. package/dist/types/src/utils/uuid.d.ts +0 -7
  179. package/dist/types/src/utils/uuid.d.ts.map +0 -1
package/README.md CHANGED
@@ -1,163 +1,191 @@
1
- # Modo Widget
2
-
3
- A responsive web chat widget for customer support.
4
-
5
- ## Features
6
-
7
- - 🌙 Dark/Light theme support with customizable colors
8
- - 🌐 RTL (Persian/Farsi) language support
9
- - 📱 Mobile responsive design
10
- - 💬 Real-time chat functionality with WebSocket connections
11
- - 🔗 WebSocket connection status indicator
12
- - 📝 Markdown message support
13
- - 🎤 Voice chat capabilities
14
- - 🖥️ Fullscreen mode option
15
- - 🎨 Customizable position (left/right), primary and foreground colors
16
- - 👤 User data management and updates
17
- - ⚡ TypeScript + Modern JavaScript
18
- - 🔄 Auto-initialization support
19
-
20
- ## Configuration Options
21
-
22
- The widget can be customized with the following options:
23
-
24
- | Option | Type | Default | Description |
25
- | ----------------- | --------------------- | ----------- | ---------------------------------------------- |
26
- | `position` | `"left" \| "right"` | `"right"` | Position of the chat widget on the screen |
27
- | `theme` | `"dark" \| "light"` | `"dark"` | Theme mode (dark or light) |
28
- | `primaryColor` | `string` | `"#667eea"` | Primary color for the widget |
29
- | `title` | `string` | `""` | Title displayed in the chat header |
30
- | `foregroundColor` | `string` | `"#fff"` | Foreground text color |
31
- | `userData` | `Record<string, any>` | `undefined` | Custom user data object |
32
- | `autoInit` | `boolean` | `false` | Whether to automatically initialize the widget |
33
- | `fullScreen` | `boolean` | `false` | Enable fullscreen mode |
34
-
35
- ## Quick Start
36
-
37
- ### Development
38
-
39
- 1. **Install dependencies**
40
-
41
- ```bash
42
- yarn install
43
- ```
44
-
45
- 2. **Start development server**
46
-
47
- ```bash
48
- yarn dev:full
49
- ```
50
-
51
- This runs TypeScript compiler, Rollup bundler, and live server concurrently.
52
-
53
- 3. **Open browser** Navigate to `http://localhost:3000`
54
-
55
- ### Production Build
56
-
57
- ```bash
58
- yarn build
59
- ```
60
-
61
- This will:
62
-
63
- - Compile TypeScript to JavaScript
64
- - Minify the code
65
- - Bundle with Rollup
66
- - Output to `bundle.js`
67
-
68
- ## Project Structure
69
-
70
- ```
71
- ├── src/ # Source code
72
- │ ├── app.ts # Main application entry
73
- │ ├── models/ # Data models
74
- │ ├── services/ # UI and business logic
75
- ├── utils/ # Helper utilities
76
- └── types/ # TypeScript types
77
- ├── temp/ # Development files
78
- │ ├── css/ # Compiled styles
79
- └── dev.html # Development HTML
80
- ├── scripts/ # Build scripts
81
- └── bundle.js # Production bundle
82
- ```
83
-
84
- ## Available Scripts
85
-
86
- | Script | Description |
87
- | ----------------- | ------------------------------ |
88
- | `yarn dev:full` | Full development environment |
89
- | `yarn dev:ts` | TypeScript compiler watch mode |
90
- | `yarn dev:rollup` | Rollup bundler watch mode |
91
- | `yarn dev:server` | Live development server |
92
- | `yarn build` | Production build |
93
- | `yarn compile` | Compile TypeScript |
94
- | `yarn minify` | Minify JavaScript |
95
-
96
- ## Usage
97
-
98
- Include the widget in your HTML:
99
-
100
- ```html
101
- <!DOCTYPE html>
102
- <html lang="en">
103
- <head>
104
- <meta charset="UTF-8" />
105
- <title>Your Website</title>
106
- </head>
107
- <body>
108
- <!-- Your website content -->
109
-
110
- <script src="https://cdn.jsdelivr.net/gh/modochats/webcomponent@main/cdn-dist/modo-web-component.min.js"></script>
111
- <script>
112
- // Initialize the chat widget
113
- const widget = new ModoWidget("your-public-key", {
114
- position: "right",
115
- theme: "dark",
116
- primaryColor: "#667eea",
117
- title: "Chat with Us",
118
- foregroundColor: "#ffffff",
119
- userData: {name: "John Doe", email: "john@example.com"},
120
- autoInit: true,
121
- fullScreen: false
122
- });
123
- </script>
124
- </body>
125
- </html>
126
- ```
127
-
128
- ### Initialization Options
129
-
130
- Pass configuration options as the second parameter to the `ModoWidget` constructor. All options are optional except the public key.
131
-
132
- Example with minimal options:
133
-
134
- ```javascript
135
- const widget = new ModoWidget("your-public-key");
136
- widget.init(); // Manual initialization if autoInit is false
137
- ```
138
-
139
- ## API Methods
140
-
141
- Once initialized, you can interact with the widget instance:
142
-
143
- ### Update User Data
144
-
145
- Update or add custom user data dynamically:
146
-
147
- ```javascript
148
- await widget.updateUserData({
149
- name: "Jane Doe",
150
- email: "jane@example.com"
151
- });
152
- ```
153
-
154
- This method merges the new data with existing user data and updates it on the server.
155
-
156
- ## Requirements
157
-
158
- - Node.js 16+
159
- - Yarn package manager
160
-
161
- ## License
162
-
163
- ISC
1
+ # Modo Widget
2
+
3
+ A responsive web chat widget for customer support.
4
+
5
+ ## Installation
6
+
7
+ ### NPM
8
+
9
+ Install the package via npm:
10
+
11
+ ```bash
12
+ npm install @modochats/widget
13
+ ```
14
+
15
+ Then, import and use in your JavaScript/TypeScript code:
16
+
17
+ ```javascript
18
+ import {Widget} from "@modochats/widget";
19
+
20
+ const widget = new Widget("your-public-key", {
21
+ // options
22
+ });
23
+ ```
24
+
25
+ ### CDN
26
+
27
+ Alternatively, include the script directly from CDN:
28
+
29
+ ```html
30
+ <script src="https://cdn.jsdelivr.net/gh/modochats/webcomponent@main/cdn-dist/modo-web-component.min.js"></script>
31
+ ```
32
+
33
+ ## Features
34
+
35
+ - 🌙 Dark/Light theme support with customizable colors
36
+ - 🌐 RTL (Persian/Farsi) language support
37
+ - 📱 Mobile responsive design
38
+ - 💬 Real-time chat functionality with WebSocket connections
39
+ - 🔗 WebSocket connection status indicator
40
+ - 📝 Markdown message support
41
+ - 🎤 Voice chat capabilities
42
+ - 🖥️ Fullscreen mode option
43
+ - 🎨 Customizable position (left/right), primary and foreground colors
44
+ - 👤 User data management and updates
45
+ - TypeScript + Modern JavaScript
46
+ - 🔄 Auto-initialization support
47
+
48
+ ## Configuration Options
49
+
50
+ The widget can be customized with the following options:
51
+
52
+ | Option | Type | Default | Description |
53
+ | ----------------- | --------------------- | ----------- | ---------------------------------------------- |
54
+ | `position` | `"left" \| "right"` | `"right"` | Position of the chat widget on the screen |
55
+ | `theme` | `"dark" \| "light"` | `"dark"` | Theme mode (dark or light) |
56
+ | `primaryColor` | `string` | `"#667eea"` | Primary color for the widget |
57
+ | `title` | `string` | `""` | Title displayed in the chat header |
58
+ | `foregroundColor` | `string` | `"#fff"` | Foreground text color |
59
+ | `userData` | `Record<string, any>` | `undefined` | Custom user data object |
60
+ | `autoInit` | `boolean` | `false` | Whether to automatically initialize the widget |
61
+ | `fullScreen` | `boolean` | `false` | Enable fullscreen mode |
62
+
63
+ ## Quick Start
64
+
65
+ ### Development
66
+
67
+ 1. **Install dependencies**
68
+
69
+ ```bash
70
+ yarn install
71
+ ```
72
+
73
+ 2. **Start development server**
74
+
75
+ ```bash
76
+ yarn dev:full
77
+ ```
78
+
79
+ This runs TypeScript compiler, Rollup bundler, and live server concurrently.
80
+
81
+ 3. **Open browser** Navigate to `http://localhost:3000`
82
+
83
+ ### Production Build
84
+
85
+ ```bash
86
+ yarn build
87
+ ```
88
+
89
+ This will:
90
+
91
+ - Compile TypeScript to JavaScript
92
+ - Minify the code
93
+ - Bundle with Rollup
94
+ - Output to `bundle.js`
95
+
96
+ ## Project Structure
97
+
98
+ ```
99
+ ├── src/ # Source code
100
+ │ ├── app.ts # Main application entry
101
+ │ ├── models/ # Data models
102
+ │ ├── services/ # UI and business logic
103
+ │ ├── utils/ # Helper utilities
104
+ │ └── types/ # TypeScript types
105
+ ├── temp/ # Development files
106
+ │ ├── css/ # Compiled styles
107
+ │ └── dev.html # Development HTML
108
+ ├── scripts/ # Build scripts
109
+ └── bundle.js # Production bundle
110
+ ```
111
+
112
+ ## Available Scripts
113
+
114
+ | Script | Description |
115
+ | ----------------- | ------------------------------ |
116
+ | `yarn dev:full` | Full development environment |
117
+ | `yarn dev:ts` | TypeScript compiler watch mode |
118
+ | `yarn dev:rollup` | Rollup bundler watch mode |
119
+ | `yarn dev:server` | Live development server |
120
+ | `yarn build` | Production build |
121
+ | `yarn compile` | Compile TypeScript |
122
+ | `yarn minify` | Minify JavaScript |
123
+
124
+ ## Usage
125
+
126
+ Include the widget in your HTML:
127
+
128
+ ```html
129
+ <!DOCTYPE html>
130
+ <html lang="en">
131
+ <head>
132
+ <meta charset="UTF-8" />
133
+ <title>Your Website</title>
134
+ </head>
135
+ <body>
136
+ <!-- Your website content -->
137
+
138
+ <script src="https://cdn.jsdelivr.net/gh/modochats/webcomponent@main/cdn-dist/modo-web-component.min.js"></script>
139
+ <script>
140
+ // Initialize the chat widget
141
+ const widget = new ModoWidget("your-public-key", {
142
+ position: "right",
143
+ theme: "dark",
144
+ primaryColor: "#667eea",
145
+ title: "Chat with Us",
146
+ foregroundColor: "#ffffff",
147
+ userData: {name: "John Doe", email: "john@example.com"},
148
+ autoInit: true,
149
+ fullScreen: false
150
+ });
151
+ </script>
152
+ </body>
153
+ </html>
154
+ ```
155
+
156
+ ### Initialization Options
157
+
158
+ Pass configuration options as the second parameter to the `ModoWidget` constructor. All options are optional except the public key.
159
+
160
+ Example with minimal options:
161
+
162
+ ```javascript
163
+ const widget = new ModoWidget("your-public-key");
164
+ widget.init(); // Manual initialization if autoInit is false
165
+ ```
166
+
167
+ ## API Methods
168
+
169
+ Once initialized, you can interact with the widget instance:
170
+
171
+ ### Update User Data
172
+
173
+ Update or add custom user data dynamically:
174
+
175
+ ```javascript
176
+ await widget.updateUserData({
177
+ name: "Jane Doe",
178
+ email: "jane@example.com"
179
+ });
180
+ ```
181
+
182
+ This method merges the new data with existing user data and updates it on the server.
183
+
184
+ ## Requirements
185
+
186
+ - Node.js 16+
187
+ - Yarn package manager
188
+
189
+ ## License
190
+
191
+ ISC
package/package.json CHANGED
@@ -1,76 +1,79 @@
1
- {
2
- "name": "@modochats/widget",
3
- "version": "0.1.3",
4
- "description": "",
5
- "main": "dist/src/app.js",
6
- "type": "module",
7
- "scripts": {
8
- "dev": "tsx watch src/app.ts",
9
- "dev:ts": "tsc --watch --noCheck",
10
- "dev:rollup": "rollup --config rollup.dev.config.js --watch",
11
- "dev:server": "live-server temp --port=3000 --host=localhost --open=/dev.html",
12
- "dev:full": "concurrently \"yarn dev:ts\" \"yarn dev:rollup\" \"yarn dev:server\" --names \"tsc,rollup,server\" --prefix name ",
13
- "build:types": "tsc --emitDeclarationOnly --declaration --declarationMap --outDir dist/types",
14
- "static": "tsx src/app.ts",
15
- "compile": "npx tsc --noCheck",
16
- "minify": "node scripts/terser-minify.js",
17
- "rollup": "rollup --config rollup.config.js",
18
- "build": "npm run compile && npm run minify && npm run rollup",
19
- "build:cdn": "npm run build && node scripts/create-umd-bundle.js",
20
- "render": "npm install && npm run build"
21
- },
22
- "dependencies": {
23
- "@modochats/chat-client": "^0.3.0",
24
- "@modochats/voice-client": "^0.2.2",
25
- "marked": "^16.3.0",
26
- "ofetch": "^1.5.1",
27
- "tldts": "^7.0.17"
28
- },
29
- "devDependencies": {
30
- "@rollup/plugin-commonjs": "^29.0.0",
31
- "@rollup/plugin-node-resolve": "^16.0.3",
32
- "@rollup/plugin-typescript": "^12.3.0",
33
- "@types/node": "^24.10.1",
34
- "concurrently": "^9.2.1",
35
- "live-server": "^1.2.2",
36
- "rollup": "^4.53.2",
37
- "terser": "^5.44.1",
38
- "tsx": "^4.20.6",
39
- "typescript": "^5.9.3"
40
- },
41
- "imports": {
42
- "#src/*": "./dist/src/*",
43
- "#root/*": "./dist/*"
44
- },
45
- "engines": {
46
- "node": ">=16.0.0"
47
- },
48
- "publishConfig": {
49
- "access": "public"
50
- },
51
- "homepage": "https://github.com/modochats/webcomponent#readme",
52
- "keywords": [
53
- "modo",
54
- "chat",
55
- "ai",
56
- "chatbot",
57
- "websocket",
58
- "real-time"
59
- ],
60
- "author": "Modo Team",
61
- "license": "MIT",
62
- "repository": {
63
- "type": "git",
64
- "url": "https://github.com/modochats/chat-client"
65
- },
66
- "bugs": {
67
- "url": "https://github.com/modochats/chat-client/issues"
68
- },
69
- "exports": {
70
- ".": {
71
- "types": "./dist/types/src/index.d.ts",
72
- "import": "./dist/src/index.js"
73
- }
74
- },
75
- "types": "dist/types/src/index.d.ts"
76
- }
1
+ {
2
+ "name": "@modochats/widget",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "dist/src/app.js",
6
+ "type": "module",
7
+ "scripts": {
8
+ "dev:ts": "tsc --watch --noCheck",
9
+ "dev:rollup": "rollup --config rollup.dev.config.js --watch",
10
+ "dev:server": "live-server temp --port=3000 --host=localhost --open=/dev.html",
11
+ "dev": "concurrently \"yarn dev:ts\" \"yarn dev:rollup\" \"yarn dev:server\" --names \"tsc,rollup,server\" --prefix name ",
12
+ "compile": "npx tsc --noCheck",
13
+ "minify": "node scripts/terser-minify.js",
14
+ "rollup": "rollup --config rollup.config.js",
15
+ "build": "npm run compile && npm run minify && npm run rollup",
16
+ "build:cdn": "npm run build && node scripts/create-umd-bundle.js",
17
+ "build:types": "tsc --emitDeclarationOnly --declaration --declarationMap --outDir dist/types"
18
+ },
19
+ "dependencies": {
20
+ "@modochats/chat-client": "^0.3.0",
21
+ "@modochats/voice-client": "^0.2.2",
22
+ "marked": "^16.3.0",
23
+ "ofetch": "^1.5.1",
24
+ "tldts": "^7.0.17"
25
+ },
26
+ "devDependencies": {
27
+ "@rollup/plugin-commonjs": "^29.0.0",
28
+ "@rollup/plugin-node-resolve": "^16.0.3",
29
+ "@rollup/plugin-typescript": "^12.3.0",
30
+ "@types/node": "^24.10.1",
31
+ "concurrently": "^9.2.1",
32
+ "live-server": "^1.2.2",
33
+ "rollup": "^4.53.2",
34
+ "terser": "^5.44.1",
35
+ "tsx": "^4.20.6",
36
+ "typescript": "^5.9.3",
37
+ "@semantic-release/changelog": "^6.0.3",
38
+ "@semantic-release/exec": "^6.0.3",
39
+ "@semantic-release/git": "^10.0.1",
40
+ "@semantic-release/github": "^9.2.6",
41
+ "@semantic-release/npm": "^12.0.0",
42
+ "semantic-release": "^23.0.0"
43
+ },
44
+ "imports": {
45
+ "#src/*": "./dist/src/*",
46
+ "#root/*": "./dist/*"
47
+ },
48
+ "engines": {
49
+ "node": ">=16.0.0"
50
+ },
51
+ "publishConfig": {
52
+ "access": "public"
53
+ },
54
+ "homepage": "https://github.com/modochats/webcomponent#readme",
55
+ "keywords": [
56
+ "modo",
57
+ "chat",
58
+ "ai",
59
+ "chatbot",
60
+ "websocket",
61
+ "real-time"
62
+ ],
63
+ "author": "Modo Team",
64
+ "license": "MIT",
65
+ "repository": {
66
+ "type": "git",
67
+ "url": "https://github.com/modochats/chat-client"
68
+ },
69
+ "bugs": {
70
+ "url": "https://github.com/modochats/chat-client/issues"
71
+ },
72
+ "exports": {
73
+ ".": {
74
+ "types": "./dist/types/src/index.d.ts",
75
+ "import": "./dist/src/index.js"
76
+ }
77
+ },
78
+ "types": "dist/types/src/index.d.ts"
79
+ }