@convokit/widget 0.0.1 → 0.0.4
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/README.md +226 -42
- package/dist/DemoErrorBoundary.d.ts +17 -0
- package/dist/DemoErrorBoundary.d.ts.map +1 -0
- package/dist/FullScreenBackendWidget.d.ts +36 -0
- package/dist/FullScreenBackendWidget.d.ts.map +1 -0
- package/dist/FullScreenWidget.d.ts +34 -0
- package/dist/FullScreenWidget.d.ts.map +1 -0
- package/dist/PopupBackendWidget.d.ts +35 -0
- package/dist/PopupBackendWidget.d.ts.map +1 -0
- package/dist/PopupWidget-CGZOe6ZA.js +5815 -0
- package/dist/PopupWidget.d.ts +33 -0
- package/dist/PopupWidget.d.ts.map +1 -0
- package/dist/components/ChatPopup.d.ts +10 -0
- package/dist/components/ChatPopup.d.ts.map +1 -0
- package/dist/components/ChatPopupConnect.d.ts +10 -0
- package/dist/components/ChatPopupConnect.d.ts.map +1 -0
- package/dist/components/ChatPopupEmbed.d.ts +10 -0
- package/dist/components/ChatPopupEmbed.d.ts.map +1 -0
- package/dist/components/ChatWidget.d.ts +1 -5
- package/dist/components/ChatWidget.d.ts.map +1 -1
- package/dist/components/FullScreenChat.d.ts +12 -0
- package/dist/components/FullScreenChat.d.ts.map +1 -0
- package/dist/components/FullScreenChatConnect.d.ts +12 -0
- package/dist/components/FullScreenChatConnect.d.ts.map +1 -0
- package/dist/components/FullScreenChatEmbed.d.ts +12 -0
- package/dist/components/FullScreenChatEmbed.d.ts.map +1 -0
- package/dist/demo.d.ts +1 -1
- package/dist/demo.d.ts.map +1 -1
- package/dist/index.d.ts +12 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +588 -695
- package/dist/next.d.ts +24 -0
- package/dist/next.d.ts.map +1 -0
- package/dist/next.esm.js +17 -0
- package/dist/types/index.d.ts +125 -7
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/api.d.ts +29 -0
- package/dist/utils/api.d.ts.map +1 -0
- package/dist/utils/markdown.d.ts +3 -0
- package/dist/utils/markdown.d.ts.map +1 -0
- package/package.json +34 -7
- package/dist/index.umd.js +0 -30
- package/dist/style.css +0 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { KeyConfig } from './types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Minimal props for the drop-in popup widget. Pass your public API key; everything else is optional.
|
|
6
|
+
*/
|
|
7
|
+
export interface PopupWidgetProps {
|
|
8
|
+
/** ConvoKit public API key (pk_live_... or pk_test_...). From ConvoKit dashboard. Required. */
|
|
9
|
+
apiKey: string;
|
|
10
|
+
/** Unique id for this instance. Default: 'convokit-widget'. */
|
|
11
|
+
widgetId?: string;
|
|
12
|
+
/** Header title. Default: 'Support'. */
|
|
13
|
+
title?: string;
|
|
14
|
+
/** First message shown when chat opens. Default: 'Hi! How can we help?'. */
|
|
15
|
+
welcomeMessage?: string;
|
|
16
|
+
/** Position of the bubble. Default: 'bottom-right'. */
|
|
17
|
+
position?: KeyConfig['position'];
|
|
18
|
+
/** Restore messages on reload. Default: false. */
|
|
19
|
+
persistMessages?: boolean;
|
|
20
|
+
/** Primary color (e.g. '#7c3aed'). */
|
|
21
|
+
primaryColor?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Drop-in popup chat widget. One component, minimal props.
|
|
25
|
+
* Use in a client component (e.g. add 'use client' in Next.js).
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* import { PopupWidget } from '@convokit/widget';
|
|
29
|
+
*
|
|
30
|
+
* <PopupWidget apiKey={process.env.NEXT_PUBLIC_CONVOKIT_KEY} />
|
|
31
|
+
*/
|
|
32
|
+
export declare const PopupWidget: React.FC<PopupWidgetProps>;
|
|
33
|
+
//# sourceMappingURL=PopupWidget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PopupWidget.d.ts","sourceRoot":"","sources":["../src/PopupWidget.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,+FAA+F;IAC/F,MAAM,EAAE,MAAM,CAAC;IACf,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IACjC,kDAAkD;IAClD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,sCAAsC;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAQD;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAgBlD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { KeyConfig } from '../types';
|
|
3
|
+
|
|
4
|
+
export interface PopupKeyProps {
|
|
5
|
+
config: KeyConfig;
|
|
6
|
+
}
|
|
7
|
+
export declare const PopupKey: React.FC<PopupKeyProps>;
|
|
8
|
+
/** @deprecated Use PopupKey */
|
|
9
|
+
export declare const ChatPopup: React.FC<PopupKeyProps>;
|
|
10
|
+
//# sourceMappingURL=ChatPopup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatPopup.d.ts","sourceRoot":"","sources":["../../src/components/ChatPopup.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAmD,MAAM,UAAU,CAAC;AAGtF,OAAO,eAAe,CAAC;AAEvB,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,SAAS,CAAC;CACnB;AAID,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAmR5C,CAAC;AAEF,+BAA+B;AAC/B,eAAO,MAAM,SAAS,yBAAW,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BackendConfig } from '../types';
|
|
3
|
+
|
|
4
|
+
export interface PopupBackendProps {
|
|
5
|
+
config: BackendConfig;
|
|
6
|
+
}
|
|
7
|
+
export declare const PopupBackend: React.FC<PopupBackendProps>;
|
|
8
|
+
/** @deprecated Use PopupBackend */
|
|
9
|
+
export declare const ChatPopupConnect: React.FC<PopupBackendProps>;
|
|
10
|
+
//# sourceMappingURL=ChatPopupConnect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatPopupConnect.d.ts","sourceRoot":"","sources":["../../src/components/ChatPopupConnect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAgC,MAAM,UAAU,CAAC;AAGvE,OAAO,eAAe,CAAC;AAEvB,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,aAAa,CAAC;CACvB;AAID,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAqPpD,CAAC;AAEF,mCAAmC;AACnC,eAAO,MAAM,gBAAgB,6BAAe,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ControlledConfig } from '../types';
|
|
3
|
+
|
|
4
|
+
export interface PopupControlledProps {
|
|
5
|
+
config: ControlledConfig;
|
|
6
|
+
}
|
|
7
|
+
export declare const PopupControlled: React.FC<PopupControlledProps>;
|
|
8
|
+
/** @deprecated Use PopupControlled */
|
|
9
|
+
export declare const ChatPopupEmbed: React.FC<PopupControlledProps>;
|
|
10
|
+
//# sourceMappingURL=ChatPopupEmbed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatPopupEmbed.d.ts","sourceRoot":"","sources":["../../src/components/ChatPopupEmbed.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,gBAAgB,EAAe,MAAM,UAAU,CAAC;AAEzD,OAAO,eAAe,CAAC;AAEvB,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAmN1D,CAAC;AAEF,sCAAsC;AACtC,eAAO,MAAM,cAAc,gCAAkB,CAAC"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { ConvoKitConfig } from '../types';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
config: ConvoKitConfig;
|
|
6
|
-
}
|
|
7
|
-
export declare const ChatWidget: React.FC<ChatWidgetProps>;
|
|
8
|
-
export {};
|
|
4
|
+
export declare const ChatWidget: React.FC<ConvoKitConfig>;
|
|
9
5
|
//# sourceMappingURL=ChatWidget.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatWidget.d.ts","sourceRoot":"","sources":["../../src/components/ChatWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ChatWidget.d.ts","sourceRoot":"","sources":["../../src/components/ChatWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAgC,MAAM,UAAU,CAAC;AAExE,OAAO,eAAe,CAAC;AAEvB,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAuT/C,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { KeyConfig } from '../types';
|
|
3
|
+
|
|
4
|
+
export interface FullScreenKeyProps {
|
|
5
|
+
config: KeyConfig;
|
|
6
|
+
onBack?: () => void;
|
|
7
|
+
backLabel?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const FullScreenKey: React.FC<FullScreenKeyProps>;
|
|
10
|
+
/** @deprecated Use FullScreenKey */
|
|
11
|
+
export declare const FullScreenChat: React.FC<FullScreenKeyProps>;
|
|
12
|
+
//# sourceMappingURL=FullScreenChat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FullScreenChat.d.ts","sourceRoot":"","sources":["../../src/components/FullScreenChat.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAmD,MAAM,UAAU,CAAC;AAGtF,OAAO,eAAe,CAAC;AAEvB,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA+PtD,CAAC;AAEF,oCAAoC;AACpC,eAAO,MAAM,cAAc,8BAAgB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BackendConfig } from '../types';
|
|
3
|
+
|
|
4
|
+
export interface FullScreenBackendProps {
|
|
5
|
+
config: BackendConfig;
|
|
6
|
+
onBack?: () => void;
|
|
7
|
+
backLabel?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const FullScreenBackend: React.FC<FullScreenBackendProps>;
|
|
10
|
+
/** @deprecated Use FullScreenBackend */
|
|
11
|
+
export declare const FullScreenChatConnect: React.FC<FullScreenBackendProps>;
|
|
12
|
+
//# sourceMappingURL=FullScreenChatConnect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FullScreenChatConnect.d.ts","sourceRoot":"","sources":["../../src/components/FullScreenChatConnect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAgC,MAAM,UAAU,CAAC;AAGvE,OAAO,eAAe,CAAC;AAEvB,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,aAAa,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAmO9D,CAAC;AAEF,wCAAwC;AACxC,eAAO,MAAM,qBAAqB,kCAAoB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ControlledConfig } from '../types';
|
|
3
|
+
|
|
4
|
+
export interface FullScreenControlledProps {
|
|
5
|
+
config: ControlledConfig;
|
|
6
|
+
onBack?: () => void;
|
|
7
|
+
backLabel?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const FullScreenControlled: React.FC<FullScreenControlledProps>;
|
|
10
|
+
/** @deprecated Use FullScreenControlled */
|
|
11
|
+
export declare const FullScreenChatEmbed: React.FC<FullScreenControlledProps>;
|
|
12
|
+
//# sourceMappingURL=FullScreenChatEmbed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FullScreenChatEmbed.d.ts","sourceRoot":"","sources":["../../src/components/FullScreenChatEmbed.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,gBAAgB,EAAe,MAAM,UAAU,CAAC;AAEzD,OAAO,eAAe,CAAC;AAEvB,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAkMpE,CAAC;AAEF,2CAA2C;AAC3C,eAAO,MAAM,mBAAmB,qCAAuB,CAAC"}
|
package/dist/demo.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type ComponentMode = 'PopupKey' | 'FullScreenKey' | 'PopupBackend' | 'FullScreenBackend' | 'PopupControlled' | 'FullScreenControlled' | 'BackendExample';
|
|
2
2
|
//# sourceMappingURL=demo.d.ts.map
|
package/dist/demo.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"demo.d.ts","sourceRoot":"","sources":["../src/demo.tsx"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"demo.d.ts","sourceRoot":"","sources":["../src/demo.tsx"],"names":[],"mappings":"AAeA,MAAM,MAAM,aAAa,GACrB,UAAU,GACV,eAAe,GACf,cAAc,GACd,mBAAmB,GACnB,iBAAiB,GACjB,sBAAsB,GACtB,gBAAgB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @convokit/widget — public API: only the 4 drop-in widgets.
|
|
3
|
+
* PopupWidget, FullScreenWidget (API key). PopupBackendWidget, FullScreenBackendWidget (your backend).
|
|
4
|
+
*/
|
|
5
|
+
export { PopupWidget } from './PopupWidget';
|
|
6
|
+
export type { PopupWidgetProps } from './PopupWidget';
|
|
7
|
+
export { FullScreenWidget } from './FullScreenWidget';
|
|
8
|
+
export type { FullScreenWidgetProps } from './FullScreenWidget';
|
|
9
|
+
export { PopupBackendWidget } from './PopupBackendWidget';
|
|
10
|
+
export type { PopupBackendWidgetProps } from './PopupBackendWidget';
|
|
11
|
+
export { FullScreenBackendWidget } from './FullScreenBackendWidget';
|
|
12
|
+
export type { FullScreenBackendWidgetProps } from './FullScreenBackendWidget';
|
|
3
13
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,YAAY,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC"}
|