@convokit/widget 0.0.1
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/LICENSE +22 -0
- package/README.md +92 -0
- package/dist/components/ChatWidget.d.ts +9 -0
- package/dist/components/ChatWidget.d.ts.map +1 -0
- package/dist/demo.d.ts +2 -0
- package/dist/demo.d.ts.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +721 -0
- package/dist/index.umd.js +30 -0
- package/dist/style.css +1 -0
- package/dist/types/index.d.ts +15 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +45 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 ConvoKit
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# @convokit/widget
|
|
2
|
+
|
|
3
|
+
Beautiful AI chat widget for your website.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @convokit/widget
|
|
9
|
+
# or
|
|
10
|
+
yarn add @convokit/widget
|
|
11
|
+
# or
|
|
12
|
+
pnpm add @convokit/widget
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
### React
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
import { ChatWidget } from '@convokit/widget';
|
|
21
|
+
|
|
22
|
+
function App() {
|
|
23
|
+
return (
|
|
24
|
+
<ChatWidget
|
|
25
|
+
config={{
|
|
26
|
+
widgetId: 'your-widget-id',
|
|
27
|
+
apiUrl: 'https://api.convokit.dev',
|
|
28
|
+
primaryColor: '#000000',
|
|
29
|
+
title: 'Chat with us',
|
|
30
|
+
welcomeMessage: 'Hello! How can I help you?',
|
|
31
|
+
placeholder: 'Type a message...',
|
|
32
|
+
}}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Vanilla JavaScript
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<script src="https://unpkg.com/@convokit/widget"></script>
|
|
42
|
+
<script>
|
|
43
|
+
ConvoKit.init({
|
|
44
|
+
widgetId: 'your-widget-id',
|
|
45
|
+
apiUrl: 'https://api.convokit.dev',
|
|
46
|
+
});
|
|
47
|
+
</script>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Configuration
|
|
51
|
+
|
|
52
|
+
| Option | Type | Required | Default | Description |
|
|
53
|
+
|--------|------|----------|---------|-------------|
|
|
54
|
+
| `widgetId` | string | Yes | - | Your widget ID from ConvoKit dashboard |
|
|
55
|
+
| `apiUrl` | string | Yes | - | API endpoint URL |
|
|
56
|
+
| `primaryColor` | string | No | `#000000` | Primary theme color |
|
|
57
|
+
| `title` | string | No | `Chat` | Widget header title |
|
|
58
|
+
| `welcomeMessage` | string | No | `Hello! How can I help you?` | Initial greeting message |
|
|
59
|
+
| `placeholder` | string | No | `Type a message...` | Input placeholder text |
|
|
60
|
+
| `position` | string | No | `bottom-right` | Widget position on screen |
|
|
61
|
+
|
|
62
|
+
## Development
|
|
63
|
+
|
|
64
|
+
Run the demo:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npm run dev
|
|
68
|
+
# or
|
|
69
|
+
pnpm dev
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Build the package:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npm run build
|
|
76
|
+
# or
|
|
77
|
+
pnpm build
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Features
|
|
81
|
+
|
|
82
|
+
- 🎨 Customizable colors and branding
|
|
83
|
+
- 📱 Mobile responsive
|
|
84
|
+
- âš¡ Lightweight and fast
|
|
85
|
+
- 🎯 TypeScript support
|
|
86
|
+
- 🔌 Easy integration
|
|
87
|
+
- 💬 Real-time chat
|
|
88
|
+
- 🤖 AI-powered responses
|
|
89
|
+
|
|
90
|
+
## License
|
|
91
|
+
|
|
92
|
+
MIT
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ConvoKitConfig } from '../types';
|
|
3
|
+
|
|
4
|
+
interface ChatWidgetProps {
|
|
5
|
+
config: ConvoKitConfig;
|
|
6
|
+
}
|
|
7
|
+
export declare const ChatWidget: React.FC<ChatWidgetProps>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=ChatWidget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatWidget.d.ts","sourceRoot":"","sources":["../../src/components/ChatWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,eAAe,CAAC;AAEvB,UAAU,eAAe;IACvB,MAAM,EAAE,cAAc,CAAC;CACxB;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAyHhD,CAAC"}
|
package/dist/demo.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"demo.d.ts","sourceRoot":"","sources":["../src/demo.tsx"],"names":[],"mappings":""}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,721 @@
|
|
|
1
|
+
import Oe, { useState as B } from "react";
|
|
2
|
+
var ee = { exports: {} }, W = {};
|
|
3
|
+
/**
|
|
4
|
+
* @license React
|
|
5
|
+
* react-jsx-runtime.production.min.js
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the MIT license found in the
|
|
10
|
+
* LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/
|
|
12
|
+
var Te;
|
|
13
|
+
function fr() {
|
|
14
|
+
if (Te) return W;
|
|
15
|
+
Te = 1;
|
|
16
|
+
var m = Oe, _ = Symbol.for("react.element"), I = Symbol.for("react.fragment"), R = Object.prototype.hasOwnProperty, T = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, j = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
17
|
+
function x(y, f, C) {
|
|
18
|
+
var v, d = {}, b = null, w = null;
|
|
19
|
+
C !== void 0 && (b = "" + C), f.key !== void 0 && (b = "" + f.key), f.ref !== void 0 && (w = f.ref);
|
|
20
|
+
for (v in f) R.call(f, v) && !j.hasOwnProperty(v) && (d[v] = f[v]);
|
|
21
|
+
if (y && y.defaultProps) for (v in f = y.defaultProps, f) d[v] === void 0 && (d[v] = f[v]);
|
|
22
|
+
return { $$typeof: _, type: y, key: b, ref: w, props: d, _owner: T.current };
|
|
23
|
+
}
|
|
24
|
+
return W.Fragment = I, W.jsx = x, W.jsxs = x, W;
|
|
25
|
+
}
|
|
26
|
+
var Y = {};
|
|
27
|
+
/**
|
|
28
|
+
* @license React
|
|
29
|
+
* react-jsx-runtime.development.js
|
|
30
|
+
*
|
|
31
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
32
|
+
*
|
|
33
|
+
* This source code is licensed under the MIT license found in the
|
|
34
|
+
* LICENSE file in the root directory of this source tree.
|
|
35
|
+
*/
|
|
36
|
+
var xe;
|
|
37
|
+
function dr() {
|
|
38
|
+
return xe || (xe = 1, process.env.NODE_ENV !== "production" && function() {
|
|
39
|
+
var m = Oe, _ = Symbol.for("react.element"), I = Symbol.for("react.portal"), R = Symbol.for("react.fragment"), T = Symbol.for("react.strict_mode"), j = Symbol.for("react.profiler"), x = Symbol.for("react.provider"), y = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), d = Symbol.for("react.memo"), b = Symbol.for("react.lazy"), w = Symbol.for("react.offscreen"), P = Symbol.iterator, J = "@@iterator";
|
|
40
|
+
function ke(e) {
|
|
41
|
+
if (e === null || typeof e != "object")
|
|
42
|
+
return null;
|
|
43
|
+
var r = P && e[P] || e[J];
|
|
44
|
+
return typeof r == "function" ? r : null;
|
|
45
|
+
}
|
|
46
|
+
var D = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
47
|
+
function p(e) {
|
|
48
|
+
{
|
|
49
|
+
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
|
50
|
+
t[n - 1] = arguments[n];
|
|
51
|
+
Se("error", e, t);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function Se(e, r, t) {
|
|
55
|
+
{
|
|
56
|
+
var n = D.ReactDebugCurrentFrame, i = n.getStackAddendum();
|
|
57
|
+
i !== "" && (r += "%s", t = t.concat([i]));
|
|
58
|
+
var s = t.map(function(o) {
|
|
59
|
+
return String(o);
|
|
60
|
+
});
|
|
61
|
+
s.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, s);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
var Pe = !1, De = !1, Fe = !1, Ae = !1, Ie = !1, re;
|
|
65
|
+
re = Symbol.for("react.module.reference");
|
|
66
|
+
function $e(e) {
|
|
67
|
+
return !!(typeof e == "string" || typeof e == "function" || e === R || e === j || Ie || e === T || e === C || e === v || Ae || e === w || Pe || De || Fe || typeof e == "object" && e !== null && (e.$$typeof === b || e.$$typeof === d || e.$$typeof === x || e.$$typeof === y || e.$$typeof === f || // This needs to include all possible module reference object
|
|
68
|
+
// types supported by any Flight configuration anywhere since
|
|
69
|
+
// we don't know which Flight build this will end up being used
|
|
70
|
+
// with.
|
|
71
|
+
e.$$typeof === re || e.getModuleId !== void 0));
|
|
72
|
+
}
|
|
73
|
+
function Ne(e, r, t) {
|
|
74
|
+
var n = e.displayName;
|
|
75
|
+
if (n)
|
|
76
|
+
return n;
|
|
77
|
+
var i = r.displayName || r.name || "";
|
|
78
|
+
return i !== "" ? t + "(" + i + ")" : t;
|
|
79
|
+
}
|
|
80
|
+
function te(e) {
|
|
81
|
+
return e.displayName || "Context";
|
|
82
|
+
}
|
|
83
|
+
function O(e) {
|
|
84
|
+
if (e == null)
|
|
85
|
+
return null;
|
|
86
|
+
if (typeof e.tag == "number" && p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
87
|
+
return e.displayName || e.name || null;
|
|
88
|
+
if (typeof e == "string")
|
|
89
|
+
return e;
|
|
90
|
+
switch (e) {
|
|
91
|
+
case R:
|
|
92
|
+
return "Fragment";
|
|
93
|
+
case I:
|
|
94
|
+
return "Portal";
|
|
95
|
+
case j:
|
|
96
|
+
return "Profiler";
|
|
97
|
+
case T:
|
|
98
|
+
return "StrictMode";
|
|
99
|
+
case C:
|
|
100
|
+
return "Suspense";
|
|
101
|
+
case v:
|
|
102
|
+
return "SuspenseList";
|
|
103
|
+
}
|
|
104
|
+
if (typeof e == "object")
|
|
105
|
+
switch (e.$$typeof) {
|
|
106
|
+
case y:
|
|
107
|
+
var r = e;
|
|
108
|
+
return te(r) + ".Consumer";
|
|
109
|
+
case x:
|
|
110
|
+
var t = e;
|
|
111
|
+
return te(t._context) + ".Provider";
|
|
112
|
+
case f:
|
|
113
|
+
return Ne(e, e.render, "ForwardRef");
|
|
114
|
+
case d:
|
|
115
|
+
var n = e.displayName || null;
|
|
116
|
+
return n !== null ? n : O(e.type) || "Memo";
|
|
117
|
+
case b: {
|
|
118
|
+
var i = e, s = i._payload, o = i._init;
|
|
119
|
+
try {
|
|
120
|
+
return O(o(s));
|
|
121
|
+
} catch {
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
var k = Object.assign, $ = 0, ne, ae, oe, ie, se, ue, le;
|
|
129
|
+
function ce() {
|
|
130
|
+
}
|
|
131
|
+
ce.__reactDisabledLog = !0;
|
|
132
|
+
function We() {
|
|
133
|
+
{
|
|
134
|
+
if ($ === 0) {
|
|
135
|
+
ne = console.log, ae = console.info, oe = console.warn, ie = console.error, se = console.group, ue = console.groupCollapsed, le = console.groupEnd;
|
|
136
|
+
var e = {
|
|
137
|
+
configurable: !0,
|
|
138
|
+
enumerable: !0,
|
|
139
|
+
value: ce,
|
|
140
|
+
writable: !0
|
|
141
|
+
};
|
|
142
|
+
Object.defineProperties(console, {
|
|
143
|
+
info: e,
|
|
144
|
+
log: e,
|
|
145
|
+
warn: e,
|
|
146
|
+
error: e,
|
|
147
|
+
group: e,
|
|
148
|
+
groupCollapsed: e,
|
|
149
|
+
groupEnd: e
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
$++;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
function Ye() {
|
|
156
|
+
{
|
|
157
|
+
if ($--, $ === 0) {
|
|
158
|
+
var e = {
|
|
159
|
+
configurable: !0,
|
|
160
|
+
enumerable: !0,
|
|
161
|
+
writable: !0
|
|
162
|
+
};
|
|
163
|
+
Object.defineProperties(console, {
|
|
164
|
+
log: k({}, e, {
|
|
165
|
+
value: ne
|
|
166
|
+
}),
|
|
167
|
+
info: k({}, e, {
|
|
168
|
+
value: ae
|
|
169
|
+
}),
|
|
170
|
+
warn: k({}, e, {
|
|
171
|
+
value: oe
|
|
172
|
+
}),
|
|
173
|
+
error: k({}, e, {
|
|
174
|
+
value: ie
|
|
175
|
+
}),
|
|
176
|
+
group: k({}, e, {
|
|
177
|
+
value: se
|
|
178
|
+
}),
|
|
179
|
+
groupCollapsed: k({}, e, {
|
|
180
|
+
value: ue
|
|
181
|
+
}),
|
|
182
|
+
groupEnd: k({}, e, {
|
|
183
|
+
value: le
|
|
184
|
+
})
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
$ < 0 && p("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
var q = D.ReactCurrentDispatcher, K;
|
|
191
|
+
function L(e, r, t) {
|
|
192
|
+
{
|
|
193
|
+
if (K === void 0)
|
|
194
|
+
try {
|
|
195
|
+
throw Error();
|
|
196
|
+
} catch (i) {
|
|
197
|
+
var n = i.stack.trim().match(/\n( *(at )?)/);
|
|
198
|
+
K = n && n[1] || "";
|
|
199
|
+
}
|
|
200
|
+
return `
|
|
201
|
+
` + K + e;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
var z = !1, M;
|
|
205
|
+
{
|
|
206
|
+
var Le = typeof WeakMap == "function" ? WeakMap : Map;
|
|
207
|
+
M = new Le();
|
|
208
|
+
}
|
|
209
|
+
function fe(e, r) {
|
|
210
|
+
if (!e || z)
|
|
211
|
+
return "";
|
|
212
|
+
{
|
|
213
|
+
var t = M.get(e);
|
|
214
|
+
if (t !== void 0)
|
|
215
|
+
return t;
|
|
216
|
+
}
|
|
217
|
+
var n;
|
|
218
|
+
z = !0;
|
|
219
|
+
var i = Error.prepareStackTrace;
|
|
220
|
+
Error.prepareStackTrace = void 0;
|
|
221
|
+
var s;
|
|
222
|
+
s = q.current, q.current = null, We();
|
|
223
|
+
try {
|
|
224
|
+
if (r) {
|
|
225
|
+
var o = function() {
|
|
226
|
+
throw Error();
|
|
227
|
+
};
|
|
228
|
+
if (Object.defineProperty(o.prototype, "props", {
|
|
229
|
+
set: function() {
|
|
230
|
+
throw Error();
|
|
231
|
+
}
|
|
232
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
233
|
+
try {
|
|
234
|
+
Reflect.construct(o, []);
|
|
235
|
+
} catch (g) {
|
|
236
|
+
n = g;
|
|
237
|
+
}
|
|
238
|
+
Reflect.construct(e, [], o);
|
|
239
|
+
} else {
|
|
240
|
+
try {
|
|
241
|
+
o.call();
|
|
242
|
+
} catch (g) {
|
|
243
|
+
n = g;
|
|
244
|
+
}
|
|
245
|
+
e.call(o.prototype);
|
|
246
|
+
}
|
|
247
|
+
} else {
|
|
248
|
+
try {
|
|
249
|
+
throw Error();
|
|
250
|
+
} catch (g) {
|
|
251
|
+
n = g;
|
|
252
|
+
}
|
|
253
|
+
e();
|
|
254
|
+
}
|
|
255
|
+
} catch (g) {
|
|
256
|
+
if (g && n && typeof g.stack == "string") {
|
|
257
|
+
for (var a = g.stack.split(`
|
|
258
|
+
`), h = n.stack.split(`
|
|
259
|
+
`), u = a.length - 1, c = h.length - 1; u >= 1 && c >= 0 && a[u] !== h[c]; )
|
|
260
|
+
c--;
|
|
261
|
+
for (; u >= 1 && c >= 0; u--, c--)
|
|
262
|
+
if (a[u] !== h[c]) {
|
|
263
|
+
if (u !== 1 || c !== 1)
|
|
264
|
+
do
|
|
265
|
+
if (u--, c--, c < 0 || a[u] !== h[c]) {
|
|
266
|
+
var E = `
|
|
267
|
+
` + a[u].replace(" at new ", " at ");
|
|
268
|
+
return e.displayName && E.includes("<anonymous>") && (E = E.replace("<anonymous>", e.displayName)), typeof e == "function" && M.set(e, E), E;
|
|
269
|
+
}
|
|
270
|
+
while (u >= 1 && c >= 0);
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
} finally {
|
|
275
|
+
z = !1, q.current = s, Ye(), Error.prepareStackTrace = i;
|
|
276
|
+
}
|
|
277
|
+
var A = e ? e.displayName || e.name : "", S = A ? L(A) : "";
|
|
278
|
+
return typeof e == "function" && M.set(e, S), S;
|
|
279
|
+
}
|
|
280
|
+
function Me(e, r, t) {
|
|
281
|
+
return fe(e, !1);
|
|
282
|
+
}
|
|
283
|
+
function Ve(e) {
|
|
284
|
+
var r = e.prototype;
|
|
285
|
+
return !!(r && r.isReactComponent);
|
|
286
|
+
}
|
|
287
|
+
function V(e, r, t) {
|
|
288
|
+
if (e == null)
|
|
289
|
+
return "";
|
|
290
|
+
if (typeof e == "function")
|
|
291
|
+
return fe(e, Ve(e));
|
|
292
|
+
if (typeof e == "string")
|
|
293
|
+
return L(e);
|
|
294
|
+
switch (e) {
|
|
295
|
+
case C:
|
|
296
|
+
return L("Suspense");
|
|
297
|
+
case v:
|
|
298
|
+
return L("SuspenseList");
|
|
299
|
+
}
|
|
300
|
+
if (typeof e == "object")
|
|
301
|
+
switch (e.$$typeof) {
|
|
302
|
+
case f:
|
|
303
|
+
return Me(e.render);
|
|
304
|
+
case d:
|
|
305
|
+
return V(e.type, r, t);
|
|
306
|
+
case b: {
|
|
307
|
+
var n = e, i = n._payload, s = n._init;
|
|
308
|
+
try {
|
|
309
|
+
return V(s(i), r, t);
|
|
310
|
+
} catch {
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
return "";
|
|
315
|
+
}
|
|
316
|
+
var N = Object.prototype.hasOwnProperty, de = {}, ve = D.ReactDebugCurrentFrame;
|
|
317
|
+
function U(e) {
|
|
318
|
+
if (e) {
|
|
319
|
+
var r = e._owner, t = V(e.type, e._source, r ? r.type : null);
|
|
320
|
+
ve.setExtraStackFrame(t);
|
|
321
|
+
} else
|
|
322
|
+
ve.setExtraStackFrame(null);
|
|
323
|
+
}
|
|
324
|
+
function Ue(e, r, t, n, i) {
|
|
325
|
+
{
|
|
326
|
+
var s = Function.call.bind(N);
|
|
327
|
+
for (var o in e)
|
|
328
|
+
if (s(e, o)) {
|
|
329
|
+
var a = void 0;
|
|
330
|
+
try {
|
|
331
|
+
if (typeof e[o] != "function") {
|
|
332
|
+
var h = Error((n || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
333
|
+
throw h.name = "Invariant Violation", h;
|
|
334
|
+
}
|
|
335
|
+
a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
336
|
+
} catch (u) {
|
|
337
|
+
a = u;
|
|
338
|
+
}
|
|
339
|
+
a && !(a instanceof Error) && (U(i), p("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, o, typeof a), U(null)), a instanceof Error && !(a.message in de) && (de[a.message] = !0, U(i), p("Failed %s type: %s", t, a.message), U(null));
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
var Be = Array.isArray;
|
|
344
|
+
function G(e) {
|
|
345
|
+
return Be(e);
|
|
346
|
+
}
|
|
347
|
+
function Je(e) {
|
|
348
|
+
{
|
|
349
|
+
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
350
|
+
return t;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
function qe(e) {
|
|
354
|
+
try {
|
|
355
|
+
return pe(e), !1;
|
|
356
|
+
} catch {
|
|
357
|
+
return !0;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
function pe(e) {
|
|
361
|
+
return "" + e;
|
|
362
|
+
}
|
|
363
|
+
function he(e) {
|
|
364
|
+
if (qe(e))
|
|
365
|
+
return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Je(e)), pe(e);
|
|
366
|
+
}
|
|
367
|
+
var ge = D.ReactCurrentOwner, Ke = {
|
|
368
|
+
key: !0,
|
|
369
|
+
ref: !0,
|
|
370
|
+
__self: !0,
|
|
371
|
+
__source: !0
|
|
372
|
+
}, me, ye;
|
|
373
|
+
function ze(e) {
|
|
374
|
+
if (N.call(e, "ref")) {
|
|
375
|
+
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
376
|
+
if (r && r.isReactWarning)
|
|
377
|
+
return !1;
|
|
378
|
+
}
|
|
379
|
+
return e.ref !== void 0;
|
|
380
|
+
}
|
|
381
|
+
function Ge(e) {
|
|
382
|
+
if (N.call(e, "key")) {
|
|
383
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
384
|
+
if (r && r.isReactWarning)
|
|
385
|
+
return !1;
|
|
386
|
+
}
|
|
387
|
+
return e.key !== void 0;
|
|
388
|
+
}
|
|
389
|
+
function He(e, r) {
|
|
390
|
+
typeof e.ref == "string" && ge.current;
|
|
391
|
+
}
|
|
392
|
+
function Xe(e, r) {
|
|
393
|
+
{
|
|
394
|
+
var t = function() {
|
|
395
|
+
me || (me = !0, p("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
396
|
+
};
|
|
397
|
+
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
398
|
+
get: t,
|
|
399
|
+
configurable: !0
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
function Ze(e, r) {
|
|
404
|
+
{
|
|
405
|
+
var t = function() {
|
|
406
|
+
ye || (ye = !0, p("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
407
|
+
};
|
|
408
|
+
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
409
|
+
get: t,
|
|
410
|
+
configurable: !0
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
var Qe = function(e, r, t, n, i, s, o) {
|
|
415
|
+
var a = {
|
|
416
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
417
|
+
$$typeof: _,
|
|
418
|
+
// Built-in properties that belong on the element
|
|
419
|
+
type: e,
|
|
420
|
+
key: r,
|
|
421
|
+
ref: t,
|
|
422
|
+
props: o,
|
|
423
|
+
// Record the component responsible for creating this element.
|
|
424
|
+
_owner: s
|
|
425
|
+
};
|
|
426
|
+
return a._store = {}, Object.defineProperty(a._store, "validated", {
|
|
427
|
+
configurable: !1,
|
|
428
|
+
enumerable: !1,
|
|
429
|
+
writable: !0,
|
|
430
|
+
value: !1
|
|
431
|
+
}), Object.defineProperty(a, "_self", {
|
|
432
|
+
configurable: !1,
|
|
433
|
+
enumerable: !1,
|
|
434
|
+
writable: !1,
|
|
435
|
+
value: n
|
|
436
|
+
}), Object.defineProperty(a, "_source", {
|
|
437
|
+
configurable: !1,
|
|
438
|
+
enumerable: !1,
|
|
439
|
+
writable: !1,
|
|
440
|
+
value: i
|
|
441
|
+
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
442
|
+
};
|
|
443
|
+
function er(e, r, t, n, i) {
|
|
444
|
+
{
|
|
445
|
+
var s, o = {}, a = null, h = null;
|
|
446
|
+
t !== void 0 && (he(t), a = "" + t), Ge(r) && (he(r.key), a = "" + r.key), ze(r) && (h = r.ref, He(r, i));
|
|
447
|
+
for (s in r)
|
|
448
|
+
N.call(r, s) && !Ke.hasOwnProperty(s) && (o[s] = r[s]);
|
|
449
|
+
if (e && e.defaultProps) {
|
|
450
|
+
var u = e.defaultProps;
|
|
451
|
+
for (s in u)
|
|
452
|
+
o[s] === void 0 && (o[s] = u[s]);
|
|
453
|
+
}
|
|
454
|
+
if (a || h) {
|
|
455
|
+
var c = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
456
|
+
a && Xe(o, c), h && Ze(o, c);
|
|
457
|
+
}
|
|
458
|
+
return Qe(e, a, h, i, n, ge.current, o);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
var H = D.ReactCurrentOwner, be = D.ReactDebugCurrentFrame;
|
|
462
|
+
function F(e) {
|
|
463
|
+
if (e) {
|
|
464
|
+
var r = e._owner, t = V(e.type, e._source, r ? r.type : null);
|
|
465
|
+
be.setExtraStackFrame(t);
|
|
466
|
+
} else
|
|
467
|
+
be.setExtraStackFrame(null);
|
|
468
|
+
}
|
|
469
|
+
var X;
|
|
470
|
+
X = !1;
|
|
471
|
+
function Z(e) {
|
|
472
|
+
return typeof e == "object" && e !== null && e.$$typeof === _;
|
|
473
|
+
}
|
|
474
|
+
function Ee() {
|
|
475
|
+
{
|
|
476
|
+
if (H.current) {
|
|
477
|
+
var e = O(H.current.type);
|
|
478
|
+
if (e)
|
|
479
|
+
return `
|
|
480
|
+
|
|
481
|
+
Check the render method of \`` + e + "`.";
|
|
482
|
+
}
|
|
483
|
+
return "";
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
function rr(e) {
|
|
487
|
+
return "";
|
|
488
|
+
}
|
|
489
|
+
var _e = {};
|
|
490
|
+
function tr(e) {
|
|
491
|
+
{
|
|
492
|
+
var r = Ee();
|
|
493
|
+
if (!r) {
|
|
494
|
+
var t = typeof e == "string" ? e : e.displayName || e.name;
|
|
495
|
+
t && (r = `
|
|
496
|
+
|
|
497
|
+
Check the top-level render call using <` + t + ">.");
|
|
498
|
+
}
|
|
499
|
+
return r;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
function Re(e, r) {
|
|
503
|
+
{
|
|
504
|
+
if (!e._store || e._store.validated || e.key != null)
|
|
505
|
+
return;
|
|
506
|
+
e._store.validated = !0;
|
|
507
|
+
var t = tr(r);
|
|
508
|
+
if (_e[t])
|
|
509
|
+
return;
|
|
510
|
+
_e[t] = !0;
|
|
511
|
+
var n = "";
|
|
512
|
+
e && e._owner && e._owner !== H.current && (n = " It was passed a child from " + O(e._owner.type) + "."), F(e), p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), F(null);
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
function je(e, r) {
|
|
516
|
+
{
|
|
517
|
+
if (typeof e != "object")
|
|
518
|
+
return;
|
|
519
|
+
if (G(e))
|
|
520
|
+
for (var t = 0; t < e.length; t++) {
|
|
521
|
+
var n = e[t];
|
|
522
|
+
Z(n) && Re(n, r);
|
|
523
|
+
}
|
|
524
|
+
else if (Z(e))
|
|
525
|
+
e._store && (e._store.validated = !0);
|
|
526
|
+
else if (e) {
|
|
527
|
+
var i = ke(e);
|
|
528
|
+
if (typeof i == "function" && i !== e.entries)
|
|
529
|
+
for (var s = i.call(e), o; !(o = s.next()).done; )
|
|
530
|
+
Z(o.value) && Re(o.value, r);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
function nr(e) {
|
|
535
|
+
{
|
|
536
|
+
var r = e.type;
|
|
537
|
+
if (r == null || typeof r == "string")
|
|
538
|
+
return;
|
|
539
|
+
var t;
|
|
540
|
+
if (typeof r == "function")
|
|
541
|
+
t = r.propTypes;
|
|
542
|
+
else if (typeof r == "object" && (r.$$typeof === f || // Note: Memo only checks outer props here.
|
|
543
|
+
// Inner props are checked in the reconciler.
|
|
544
|
+
r.$$typeof === d))
|
|
545
|
+
t = r.propTypes;
|
|
546
|
+
else
|
|
547
|
+
return;
|
|
548
|
+
if (t) {
|
|
549
|
+
var n = O(r);
|
|
550
|
+
Ue(t, e.props, "prop", n, e);
|
|
551
|
+
} else if (r.PropTypes !== void 0 && !X) {
|
|
552
|
+
X = !0;
|
|
553
|
+
var i = O(r);
|
|
554
|
+
p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", i || "Unknown");
|
|
555
|
+
}
|
|
556
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
function ar(e) {
|
|
560
|
+
{
|
|
561
|
+
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
562
|
+
var n = r[t];
|
|
563
|
+
if (n !== "children" && n !== "key") {
|
|
564
|
+
F(e), p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), F(null);
|
|
565
|
+
break;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
e.ref !== null && (F(e), p("Invalid attribute `ref` supplied to `React.Fragment`."), F(null));
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
var Ce = {};
|
|
572
|
+
function we(e, r, t, n, i, s) {
|
|
573
|
+
{
|
|
574
|
+
var o = $e(e);
|
|
575
|
+
if (!o) {
|
|
576
|
+
var a = "";
|
|
577
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
578
|
+
var h = rr();
|
|
579
|
+
h ? a += h : a += Ee();
|
|
580
|
+
var u;
|
|
581
|
+
e === null ? u = "null" : G(e) ? u = "array" : e !== void 0 && e.$$typeof === _ ? (u = "<" + (O(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : u = typeof e, p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", u, a);
|
|
582
|
+
}
|
|
583
|
+
var c = er(e, r, t, i, s);
|
|
584
|
+
if (c == null)
|
|
585
|
+
return c;
|
|
586
|
+
if (o) {
|
|
587
|
+
var E = r.children;
|
|
588
|
+
if (E !== void 0)
|
|
589
|
+
if (n)
|
|
590
|
+
if (G(E)) {
|
|
591
|
+
for (var A = 0; A < E.length; A++)
|
|
592
|
+
je(E[A], e);
|
|
593
|
+
Object.freeze && Object.freeze(E);
|
|
594
|
+
} else
|
|
595
|
+
p("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
596
|
+
else
|
|
597
|
+
je(E, e);
|
|
598
|
+
}
|
|
599
|
+
if (N.call(r, "key")) {
|
|
600
|
+
var S = O(e), g = Object.keys(r).filter(function(cr) {
|
|
601
|
+
return cr !== "key";
|
|
602
|
+
}), Q = g.length > 0 ? "{key: someKey, " + g.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
603
|
+
if (!Ce[S + Q]) {
|
|
604
|
+
var lr = g.length > 0 ? "{" + g.join(": ..., ") + ": ...}" : "{}";
|
|
605
|
+
p(`A props object containing a "key" prop is being spread into JSX:
|
|
606
|
+
let props = %s;
|
|
607
|
+
<%s {...props} />
|
|
608
|
+
React keys must be passed directly to JSX without using spread:
|
|
609
|
+
let props = %s;
|
|
610
|
+
<%s key={someKey} {...props} />`, Q, S, lr, S), Ce[S + Q] = !0;
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
return e === R ? ar(c) : nr(c), c;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
function or(e, r, t) {
|
|
617
|
+
return we(e, r, t, !0);
|
|
618
|
+
}
|
|
619
|
+
function ir(e, r, t) {
|
|
620
|
+
return we(e, r, t, !1);
|
|
621
|
+
}
|
|
622
|
+
var sr = ir, ur = or;
|
|
623
|
+
Y.Fragment = R, Y.jsx = sr, Y.jsxs = ur;
|
|
624
|
+
}()), Y;
|
|
625
|
+
}
|
|
626
|
+
process.env.NODE_ENV === "production" ? ee.exports = fr() : ee.exports = dr();
|
|
627
|
+
var l = ee.exports;
|
|
628
|
+
const pr = ({ config: m }) => {
|
|
629
|
+
const [_, I] = B(!1), [R, T] = B([]), [j, x] = B(""), [y, f] = B(!1), C = () => I(!_), v = async (d) => {
|
|
630
|
+
if (d.preventDefault(), !j.trim() || y) return;
|
|
631
|
+
const b = j.trim();
|
|
632
|
+
x(""), T((w) => [...w, { role: "user", content: b }]), f(!0);
|
|
633
|
+
try {
|
|
634
|
+
const P = await (await fetch(`${m.apiUrl}/api/widget/${m.widgetId}/chat`, {
|
|
635
|
+
method: "POST",
|
|
636
|
+
headers: { "Content-Type": "application/json" },
|
|
637
|
+
body: JSON.stringify({ message: b })
|
|
638
|
+
})).json();
|
|
639
|
+
T((J) => [...J, { role: "assistant", content: P.message || "Coming soon..." }]);
|
|
640
|
+
} catch (w) {
|
|
641
|
+
console.error("Chat error:", w), T((P) => [...P, { role: "assistant", content: "Sorry, something went wrong." }]);
|
|
642
|
+
} finally {
|
|
643
|
+
f(!1);
|
|
644
|
+
}
|
|
645
|
+
};
|
|
646
|
+
return /* @__PURE__ */ l.jsxs("div", { className: "convokit-widget", children: [
|
|
647
|
+
!_ && /* @__PURE__ */ l.jsx(
|
|
648
|
+
"button",
|
|
649
|
+
{
|
|
650
|
+
onClick: C,
|
|
651
|
+
className: "convokit-button",
|
|
652
|
+
style: { backgroundColor: m.primaryColor || "#000" },
|
|
653
|
+
children: /* @__PURE__ */ l.jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ l.jsx(
|
|
654
|
+
"path",
|
|
655
|
+
{
|
|
656
|
+
d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",
|
|
657
|
+
stroke: "currentColor",
|
|
658
|
+
strokeWidth: "2",
|
|
659
|
+
strokeLinecap: "round",
|
|
660
|
+
strokeLinejoin: "round"
|
|
661
|
+
}
|
|
662
|
+
) })
|
|
663
|
+
}
|
|
664
|
+
),
|
|
665
|
+
_ && /* @__PURE__ */ l.jsxs("div", { className: "convokit-chat-window", children: [
|
|
666
|
+
/* @__PURE__ */ l.jsxs(
|
|
667
|
+
"div",
|
|
668
|
+
{
|
|
669
|
+
className: "convokit-header",
|
|
670
|
+
style: { backgroundColor: m.primaryColor || "#000" },
|
|
671
|
+
children: [
|
|
672
|
+
/* @__PURE__ */ l.jsx("h3", { children: m.title || "Chat" }),
|
|
673
|
+
/* @__PURE__ */ l.jsx("button", { onClick: C, className: "convokit-close", children: "×" })
|
|
674
|
+
]
|
|
675
|
+
}
|
|
676
|
+
),
|
|
677
|
+
/* @__PURE__ */ l.jsxs("div", { className: "convokit-messages", children: [
|
|
678
|
+
R.length === 0 && /* @__PURE__ */ l.jsx("div", { className: "convokit-welcome", children: m.welcomeMessage || "Hello! How can I help you?" }),
|
|
679
|
+
R.map((d, b) => /* @__PURE__ */ l.jsx(
|
|
680
|
+
"div",
|
|
681
|
+
{
|
|
682
|
+
className: `convokit-message convokit-message-${d.role}`,
|
|
683
|
+
children: d.content
|
|
684
|
+
},
|
|
685
|
+
b
|
|
686
|
+
)),
|
|
687
|
+
y && /* @__PURE__ */ l.jsx("div", { className: "convokit-message convokit-message-assistant", children: /* @__PURE__ */ l.jsxs("div", { className: "convokit-typing", children: [
|
|
688
|
+
/* @__PURE__ */ l.jsx("span", {}),
|
|
689
|
+
/* @__PURE__ */ l.jsx("span", {}),
|
|
690
|
+
/* @__PURE__ */ l.jsx("span", {})
|
|
691
|
+
] }) })
|
|
692
|
+
] }),
|
|
693
|
+
/* @__PURE__ */ l.jsxs("form", { onSubmit: v, className: "convokit-input-form", children: [
|
|
694
|
+
/* @__PURE__ */ l.jsx(
|
|
695
|
+
"input",
|
|
696
|
+
{
|
|
697
|
+
type: "text",
|
|
698
|
+
value: j,
|
|
699
|
+
onChange: (d) => x(d.target.value),
|
|
700
|
+
placeholder: m.placeholder || "Type a message...",
|
|
701
|
+
disabled: y,
|
|
702
|
+
className: "convokit-input"
|
|
703
|
+
}
|
|
704
|
+
),
|
|
705
|
+
/* @__PURE__ */ l.jsx(
|
|
706
|
+
"button",
|
|
707
|
+
{
|
|
708
|
+
type: "submit",
|
|
709
|
+
disabled: y || !j.trim(),
|
|
710
|
+
className: "convokit-send",
|
|
711
|
+
style: { color: m.primaryColor || "#000" },
|
|
712
|
+
children: /* @__PURE__ */ l.jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ l.jsx("path", { d: "M2.01 21L23 12 2.01 3 2 10l15 2-15 2z" }) })
|
|
713
|
+
}
|
|
714
|
+
)
|
|
715
|
+
] })
|
|
716
|
+
] })
|
|
717
|
+
] });
|
|
718
|
+
};
|
|
719
|
+
export {
|
|
720
|
+
pr as ChatWidget
|
|
721
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
(function(k,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],_):(k=typeof globalThis<"u"?globalThis:k||self,_(k.ConvoKit={},k.React))})(this,function(k,_){"use strict";var K={exports:{}},W={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var te;function Oe(){if(te)return W;te=1;var m=_,R=Symbol.for("react.element"),Y=Symbol.for("react.fragment"),j=Object.prototype.hasOwnProperty,x=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,C={key:!0,ref:!0,__self:!0,__source:!0};function S(y,f,T){var v,d={},b=null,w=null;T!==void 0&&(b=""+T),f.key!==void 0&&(b=""+f.key),f.ref!==void 0&&(w=f.ref);for(v in f)j.call(f,v)&&!C.hasOwnProperty(v)&&(d[v]=f[v]);if(y&&y.defaultProps)for(v in f=y.defaultProps,f)d[v]===void 0&&(d[v]=f[v]);return{$$typeof:R,type:y,key:b,ref:w,props:d,_owner:x.current}}return W.Fragment=Y,W.jsx=S,W.jsxs=S,W}var M={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var ne;function ke(){return ne||(ne=1,process.env.NODE_ENV!=="production"&&function(){var m=_,R=Symbol.for("react.element"),Y=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),y=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),w=Symbol.for("react.offscreen"),F=Symbol.iterator,z="@@iterator";function De(e){if(e===null||typeof e!="object")return null;var r=F&&e[F]||e[z];return typeof r=="function"?r:null}var A=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function p(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Fe("error",e,t)}}function Fe(e,r,t){{var n=A.ReactDebugCurrentFrame,i=n.getStackAddendum();i!==""&&(r+="%s",t=t.concat([i]));var s=t.map(function(o){return String(o)});s.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,s)}}var Ae=!1,Ie=!1,Ne=!1,We=!1,Me=!1,ae;ae=Symbol.for("react.module.reference");function Ye(e){return!!(typeof e=="string"||typeof e=="function"||e===j||e===C||Me||e===x||e===T||e===v||We||e===w||Ae||Ie||Ne||typeof e=="object"&&e!==null&&(e.$$typeof===b||e.$$typeof===d||e.$$typeof===S||e.$$typeof===y||e.$$typeof===f||e.$$typeof===ae||e.getModuleId!==void 0))}function Le(e,r,t){var n=e.displayName;if(n)return n;var i=r.displayName||r.name||"";return i!==""?t+"("+i+")":t}function oe(e){return e.displayName||"Context"}function O(e){if(e==null)return null;if(typeof e.tag=="number"&&p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case j:return"Fragment";case Y:return"Portal";case C:return"Profiler";case x:return"StrictMode";case T:return"Suspense";case v:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case y:var r=e;return oe(r)+".Consumer";case S:var t=e;return oe(t._context)+".Provider";case f:return Le(e,e.render,"ForwardRef");case d:var n=e.displayName||null;return n!==null?n:O(e.type)||"Memo";case b:{var i=e,s=i._payload,o=i._init;try{return O(o(s))}catch{return null}}}return null}var P=Object.assign,L=0,ie,se,ue,le,ce,fe,de;function ve(){}ve.__reactDisabledLog=!0;function Ve(){{if(L===0){ie=console.log,se=console.info,ue=console.warn,le=console.error,ce=console.group,fe=console.groupCollapsed,de=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ve,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}L++}}function Ue(){{if(L--,L===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:P({},e,{value:ie}),info:P({},e,{value:se}),warn:P({},e,{value:ue}),error:P({},e,{value:le}),group:P({},e,{value:ce}),groupCollapsed:P({},e,{value:fe}),groupEnd:P({},e,{value:de})})}L<0&&p("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var G=A.ReactCurrentDispatcher,H;function U(e,r,t){{if(H===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);H=n&&n[1]||""}return`
|
|
18
|
+
`+H+e}}var X=!1,$;{var $e=typeof WeakMap=="function"?WeakMap:Map;$=new $e}function pe(e,r){if(!e||X)return"";{var t=$.get(e);if(t!==void 0)return t}var n;X=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var s;s=G.current,G.current=null,Ve();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(g){n=g}Reflect.construct(e,[],o)}else{try{o.call()}catch(g){n=g}e.call(o.prototype)}}else{try{throw Error()}catch(g){n=g}e()}}catch(g){if(g&&n&&typeof g.stack=="string"){for(var a=g.stack.split(`
|
|
19
|
+
`),h=n.stack.split(`
|
|
20
|
+
`),l=a.length-1,c=h.length-1;l>=1&&c>=0&&a[l]!==h[c];)c--;for(;l>=1&&c>=0;l--,c--)if(a[l]!==h[c]){if(l!==1||c!==1)do if(l--,c--,c<0||a[l]!==h[c]){var E=`
|
|
21
|
+
`+a[l].replace(" at new "," at ");return e.displayName&&E.includes("<anonymous>")&&(E=E.replace("<anonymous>",e.displayName)),typeof e=="function"&&$.set(e,E),E}while(l>=1&&c>=0);break}}}finally{X=!1,G.current=s,Ue(),Error.prepareStackTrace=i}var N=e?e.displayName||e.name:"",D=N?U(N):"";return typeof e=="function"&&$.set(e,D),D}function Be(e,r,t){return pe(e,!1)}function Je(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function B(e,r,t){if(e==null)return"";if(typeof e=="function")return pe(e,Je(e));if(typeof e=="string")return U(e);switch(e){case T:return U("Suspense");case v:return U("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return Be(e.render);case d:return B(e.type,r,t);case b:{var n=e,i=n._payload,s=n._init;try{return B(s(i),r,t)}catch{}}}return""}var V=Object.prototype.hasOwnProperty,he={},ge=A.ReactDebugCurrentFrame;function J(e){if(e){var r=e._owner,t=B(e.type,e._source,r?r.type:null);ge.setExtraStackFrame(t)}else ge.setExtraStackFrame(null)}function Ke(e,r,t,n,i){{var s=Function.call.bind(V);for(var o in e)if(s(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var h=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(l){a=l}a&&!(a instanceof Error)&&(J(i),p("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,o,typeof a),J(null)),a instanceof Error&&!(a.message in he)&&(he[a.message]=!0,J(i),p("Failed %s type: %s",t,a.message),J(null))}}}var ze=Array.isArray;function q(e){return ze(e)}function Ge(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function He(e){try{return me(e),!1}catch{return!0}}function me(e){return""+e}function ye(e){if(He(e))return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ge(e)),me(e)}var be=A.ReactCurrentOwner,Xe={key:!0,ref:!0,__self:!0,__source:!0},Ee,_e;function qe(e){if(V.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Ze(e){if(V.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Qe(e,r){typeof e.ref=="string"&&be.current}function er(e,r){{var t=function(){Ee||(Ee=!0,p("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function rr(e,r){{var t=function(){_e||(_e=!0,p("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var tr=function(e,r,t,n,i,s,o){var a={$$typeof:R,type:e,key:r,ref:t,props:o,_owner:s};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function nr(e,r,t,n,i){{var s,o={},a=null,h=null;t!==void 0&&(ye(t),a=""+t),Ze(r)&&(ye(r.key),a=""+r.key),qe(r)&&(h=r.ref,Qe(r,i));for(s in r)V.call(r,s)&&!Xe.hasOwnProperty(s)&&(o[s]=r[s]);if(e&&e.defaultProps){var l=e.defaultProps;for(s in l)o[s]===void 0&&(o[s]=l[s])}if(a||h){var c=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&er(o,c),h&&rr(o,c)}return tr(e,a,h,i,n,be.current,o)}}var Z=A.ReactCurrentOwner,Re=A.ReactDebugCurrentFrame;function I(e){if(e){var r=e._owner,t=B(e.type,e._source,r?r.type:null);Re.setExtraStackFrame(t)}else Re.setExtraStackFrame(null)}var Q;Q=!1;function ee(e){return typeof e=="object"&&e!==null&&e.$$typeof===R}function je(){{if(Z.current){var e=O(Z.current.type);if(e)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function ar(e){return""}var Ce={};function or(e){{var r=je();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
24
|
+
|
|
25
|
+
Check the top-level render call using <`+t+">.")}return r}}function Te(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=or(r);if(Ce[t])return;Ce[t]=!0;var n="";e&&e._owner&&e._owner!==Z.current&&(n=" It was passed a child from "+O(e._owner.type)+"."),I(e),p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),I(null)}}function we(e,r){{if(typeof e!="object")return;if(q(e))for(var t=0;t<e.length;t++){var n=e[t];ee(n)&&Te(n,r)}else if(ee(e))e._store&&(e._store.validated=!0);else if(e){var i=De(e);if(typeof i=="function"&&i!==e.entries)for(var s=i.call(e),o;!(o=s.next()).done;)ee(o.value)&&Te(o.value,r)}}}function ir(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===f||r.$$typeof===d))t=r.propTypes;else return;if(t){var n=O(r);Ke(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!Q){Q=!0;var i=O(r);p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",i||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function sr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){I(e),p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),I(null);break}}e.ref!==null&&(I(e),p("Invalid attribute `ref` supplied to `React.Fragment`."),I(null))}}var xe={};function Se(e,r,t,n,i,s){{var o=Ye(e);if(!o){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var h=ar();h?a+=h:a+=je();var l;e===null?l="null":q(e)?l="array":e!==void 0&&e.$$typeof===R?(l="<"+(O(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):l=typeof e,p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",l,a)}var c=nr(e,r,t,i,s);if(c==null)return c;if(o){var E=r.children;if(E!==void 0)if(n)if(q(E)){for(var N=0;N<E.length;N++)we(E[N],e);Object.freeze&&Object.freeze(E)}else p("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else we(E,e)}if(V.call(r,"key")){var D=O(e),g=Object.keys(r).filter(function(vr){return vr!=="key"}),re=g.length>0?"{key: someKey, "+g.join(": ..., ")+": ...}":"{key: someKey}";if(!xe[D+re]){var dr=g.length>0?"{"+g.join(": ..., ")+": ...}":"{}";p(`A props object containing a "key" prop is being spread into JSX:
|
|
26
|
+
let props = %s;
|
|
27
|
+
<%s {...props} />
|
|
28
|
+
React keys must be passed directly to JSX without using spread:
|
|
29
|
+
let props = %s;
|
|
30
|
+
<%s key={someKey} {...props} />`,re,D,dr,D),xe[D+re]=!0}}return e===j?sr(c):ir(c),c}}function ur(e,r,t){return Se(e,r,t,!0)}function lr(e,r,t){return Se(e,r,t,!1)}var cr=lr,fr=ur;M.Fragment=j,M.jsx=cr,M.jsxs=fr}()),M}process.env.NODE_ENV==="production"?K.exports=Oe():K.exports=ke();var u=K.exports;const Pe=({config:m})=>{const[R,Y]=_.useState(!1),[j,x]=_.useState([]),[C,S]=_.useState(""),[y,f]=_.useState(!1),T=()=>Y(!R),v=async d=>{if(d.preventDefault(),!C.trim()||y)return;const b=C.trim();S(""),x(w=>[...w,{role:"user",content:b}]),f(!0);try{const F=await(await fetch(`${m.apiUrl}/api/widget/${m.widgetId}/chat`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:b})})).json();x(z=>[...z,{role:"assistant",content:F.message||"Coming soon..."}])}catch(w){console.error("Chat error:",w),x(F=>[...F,{role:"assistant",content:"Sorry, something went wrong."}])}finally{f(!1)}};return u.jsxs("div",{className:"convokit-widget",children:[!R&&u.jsx("button",{onClick:T,className:"convokit-button",style:{backgroundColor:m.primaryColor||"#000"},children:u.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:u.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),R&&u.jsxs("div",{className:"convokit-chat-window",children:[u.jsxs("div",{className:"convokit-header",style:{backgroundColor:m.primaryColor||"#000"},children:[u.jsx("h3",{children:m.title||"Chat"}),u.jsx("button",{onClick:T,className:"convokit-close",children:"×"})]}),u.jsxs("div",{className:"convokit-messages",children:[j.length===0&&u.jsx("div",{className:"convokit-welcome",children:m.welcomeMessage||"Hello! How can I help you?"}),j.map((d,b)=>u.jsx("div",{className:`convokit-message convokit-message-${d.role}`,children:d.content},b)),y&&u.jsx("div",{className:"convokit-message convokit-message-assistant",children:u.jsxs("div",{className:"convokit-typing",children:[u.jsx("span",{}),u.jsx("span",{}),u.jsx("span",{})]})})]}),u.jsxs("form",{onSubmit:v,className:"convokit-input-form",children:[u.jsx("input",{type:"text",value:C,onChange:d=>S(d.target.value),placeholder:m.placeholder||"Type a message...",disabled:y,className:"convokit-input"}),u.jsx("button",{type:"submit",disabled:y||!C.trim(),className:"convokit-send",style:{color:m.primaryColor||"#000"},children:u.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor",children:u.jsx("path",{d:"M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"})})})]})]})]})};k.ChatWidget=Pe,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.convokit-widget{position:fixed;bottom:20px;right:20px;z-index:9999;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}.convokit-button{width:60px;height:60px;border-radius:50%;border:none;color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 12px #00000026;transition:transform .2s}.convokit-button:hover{transform:scale(1.05)}.convokit-chat-window{width:380px;height:600px;background:#fff;border-radius:12px;box-shadow:0 8px 24px #00000026;display:flex;flex-direction:column;overflow:hidden}.convokit-header{padding:16px;color:#fff;display:flex;justify-content:space-between;align-items:center}.convokit-header h3{margin:0;font-size:18px;font-weight:600}.convokit-close{background:none;border:none;color:#fff;font-size:28px;cursor:pointer;padding:0;width:28px;height:28px;display:flex;align-items:center;justify-content:center;line-height:1}.convokit-messages{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:12px}.convokit-welcome{text-align:center;color:#666;padding:20px;font-size:14px}.convokit-message{padding:10px 14px;border-radius:12px;max-width:80%;word-wrap:break-word;font-size:14px;line-height:1.4}.convokit-message-user{background:#000;color:#fff;align-self:flex-end;border-bottom-right-radius:4px}.convokit-message-assistant{background:#f0f0f0;color:#000;align-self:flex-start;border-bottom-left-radius:4px}.convokit-typing{display:flex;gap:4px;padding:4px 0}.convokit-typing span{width:8px;height:8px;border-radius:50%;background:#999;animation:typing 1.4s infinite}.convokit-typing span:nth-child(2){animation-delay:.2s}.convokit-typing span:nth-child(3){animation-delay:.4s}@keyframes typing{0%,60%,to{opacity:.3;transform:translateY(0)}30%{opacity:1;transform:translateY(-4px)}}.convokit-input-form{display:flex;padding:16px;border-top:1px solid #e0e0e0;gap:8px}.convokit-input{flex:1;padding:10px 14px;border:1px solid #e0e0e0;border-radius:20px;font-size:14px;outline:none}.convokit-input:focus{border-color:#999}.convokit-send{background:none;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;transition:opacity .2s}.convokit-send:disabled{opacity:.3;cursor:not-allowed}.convokit-send:hover:not(:disabled){opacity:.7}@media (max-width: 480px){.convokit-widget{bottom:10px;right:10px}.convokit-chat-window{width:calc(100vw - 20px);height:calc(100vh - 100px)}}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface ConvoKitConfig {
|
|
2
|
+
widgetId: string;
|
|
3
|
+
apiUrl: string;
|
|
4
|
+
primaryColor?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
welcomeMessage?: string;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
9
|
+
}
|
|
10
|
+
export interface ChatMessage {
|
|
11
|
+
role: 'user' | 'assistant';
|
|
12
|
+
content: string;
|
|
13
|
+
timestamp?: Date;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,cAAc,GAAG,aAAa,GAAG,WAAW,GAAG,UAAU,CAAC;CACtE;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB"}
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@convokit/widget",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "AI chat widget for your website",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.esm.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"README.md",
|
|
11
|
+
"LICENSE"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"dev": "vite",
|
|
15
|
+
"build": "tsc && vite build",
|
|
16
|
+
"preview": "vite preview",
|
|
17
|
+
"lint": "eslint . --ext .ts,.tsx",
|
|
18
|
+
"prepublishOnly": "npm run build"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"convokit",
|
|
22
|
+
"chat",
|
|
23
|
+
"widget",
|
|
24
|
+
"ai",
|
|
25
|
+
"react",
|
|
26
|
+
"component"
|
|
27
|
+
],
|
|
28
|
+
"author": "",
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"react": "^18.0.0",
|
|
32
|
+
"react-dom": "^18.0.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@types/react": "^18.2.45",
|
|
36
|
+
"@types/react-dom": "^18.2.18",
|
|
37
|
+
"@vitejs/plugin-react": "^4.2.1",
|
|
38
|
+
"react": "^18.2.0",
|
|
39
|
+
"react-dom": "^18.2.0",
|
|
40
|
+
"typescript": "^5.3.3",
|
|
41
|
+
"vite": "^5.0.8",
|
|
42
|
+
"vite-plugin-dts": "^3.7.0"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {}
|
|
45
|
+
}
|