@kite-copilot/chat-panel 0.1.2 → 0.2.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.
- package/README.md +186 -9
- package/dist/auto.cjs +3535 -0
- package/dist/auto.d.cts +60 -0
- package/dist/auto.d.ts +60 -0
- package/dist/auto.js +23 -0
- package/dist/chunk-DN7P5ZFR.js +3547 -0
- package/dist/createKiteChat-C67AkIPX.d.cts +168 -0
- package/dist/createKiteChat-C67AkIPX.d.ts +168 -0
- package/dist/embed.global.js +20 -22
- package/dist/index.cjs +3597 -0
- package/dist/index.d.cts +179 -0
- package/dist/index.d.ts +90 -287
- package/dist/index.js +61 -2737
- package/dist/styles.css +1 -1
- package/package.json +34 -23
- package/dist/index.d.mts +0 -376
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -2692
- package/dist/index.mjs.map +0 -1
package/dist/auto.d.cts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { K as KiteChatConfig, a as KiteChatInstance } from './createKiteChat-C67AkIPX.cjs';
|
|
2
|
+
import 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @kite-copilot/chat-panel/auto - Auto-mount helper
|
|
6
|
+
*
|
|
7
|
+
* Simple "easy mode" API that creates and mounts the chat widget in one call.
|
|
8
|
+
* Still bundled by the customer's build tool (Vite/Webpack), no CDN required.
|
|
9
|
+
*
|
|
10
|
+
* Usage:
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { mountKiteChat } from '@kite-copilot/chat-panel/auto';
|
|
13
|
+
* import '@kite-copilot/chat-panel/style.css';
|
|
14
|
+
*
|
|
15
|
+
* const chat = mountKiteChat({
|
|
16
|
+
* container: '#chat-container',
|
|
17
|
+
* userId: 'user-123',
|
|
18
|
+
* orgId: 'org-456',
|
|
19
|
+
* });
|
|
20
|
+
*
|
|
21
|
+
* // Later, if needed:
|
|
22
|
+
* chat.unmount();
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Configuration for auto-mount, extends KiteChatConfig with container option.
|
|
28
|
+
*/
|
|
29
|
+
interface MountKiteChatConfig extends KiteChatConfig {
|
|
30
|
+
/** Container element or selector to mount into (defaults to creating a new div) */
|
|
31
|
+
container?: string | HTMLElement;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Create and immediately mount the Kite chat widget.
|
|
35
|
+
*
|
|
36
|
+
* This is a convenience wrapper around `createKiteChat` for simple use cases.
|
|
37
|
+
* For more control, use `createKiteChat` directly.
|
|
38
|
+
*
|
|
39
|
+
* @param config - Configuration options including container
|
|
40
|
+
* @returns KiteChatInstance with lifecycle control methods
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* // Mount into existing element
|
|
45
|
+
* const chat = mountKiteChat({
|
|
46
|
+
* container: '#my-chat',
|
|
47
|
+
* userId: 'user-123',
|
|
48
|
+
* orgId: 'org-456',
|
|
49
|
+
* });
|
|
50
|
+
*
|
|
51
|
+
* // Or let it create a container automatically
|
|
52
|
+
* const chat = mountKiteChat({
|
|
53
|
+
* userId: 'user-123',
|
|
54
|
+
* orgId: 'org-456',
|
|
55
|
+
* });
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
declare function mountKiteChat(config: MountKiteChatConfig): KiteChatInstance;
|
|
59
|
+
|
|
60
|
+
export { KiteChatConfig, KiteChatInstance, type MountKiteChatConfig, mountKiteChat };
|
package/dist/auto.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { K as KiteChatConfig, a as KiteChatInstance } from './createKiteChat-C67AkIPX.js';
|
|
2
|
+
import 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @kite-copilot/chat-panel/auto - Auto-mount helper
|
|
6
|
+
*
|
|
7
|
+
* Simple "easy mode" API that creates and mounts the chat widget in one call.
|
|
8
|
+
* Still bundled by the customer's build tool (Vite/Webpack), no CDN required.
|
|
9
|
+
*
|
|
10
|
+
* Usage:
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { mountKiteChat } from '@kite-copilot/chat-panel/auto';
|
|
13
|
+
* import '@kite-copilot/chat-panel/style.css';
|
|
14
|
+
*
|
|
15
|
+
* const chat = mountKiteChat({
|
|
16
|
+
* container: '#chat-container',
|
|
17
|
+
* userId: 'user-123',
|
|
18
|
+
* orgId: 'org-456',
|
|
19
|
+
* });
|
|
20
|
+
*
|
|
21
|
+
* // Later, if needed:
|
|
22
|
+
* chat.unmount();
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Configuration for auto-mount, extends KiteChatConfig with container option.
|
|
28
|
+
*/
|
|
29
|
+
interface MountKiteChatConfig extends KiteChatConfig {
|
|
30
|
+
/** Container element or selector to mount into (defaults to creating a new div) */
|
|
31
|
+
container?: string | HTMLElement;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Create and immediately mount the Kite chat widget.
|
|
35
|
+
*
|
|
36
|
+
* This is a convenience wrapper around `createKiteChat` for simple use cases.
|
|
37
|
+
* For more control, use `createKiteChat` directly.
|
|
38
|
+
*
|
|
39
|
+
* @param config - Configuration options including container
|
|
40
|
+
* @returns KiteChatInstance with lifecycle control methods
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* // Mount into existing element
|
|
45
|
+
* const chat = mountKiteChat({
|
|
46
|
+
* container: '#my-chat',
|
|
47
|
+
* userId: 'user-123',
|
|
48
|
+
* orgId: 'org-456',
|
|
49
|
+
* });
|
|
50
|
+
*
|
|
51
|
+
* // Or let it create a container automatically
|
|
52
|
+
* const chat = mountKiteChat({
|
|
53
|
+
* userId: 'user-123',
|
|
54
|
+
* orgId: 'org-456',
|
|
55
|
+
* });
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
declare function mountKiteChat(config: MountKiteChatConfig): KiteChatInstance;
|
|
59
|
+
|
|
60
|
+
export { KiteChatConfig, KiteChatInstance, type MountKiteChatConfig, mountKiteChat };
|
package/dist/auto.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createKiteChat
|
|
3
|
+
} from "./chunk-DN7P5ZFR.js";
|
|
4
|
+
|
|
5
|
+
// src/auto.ts
|
|
6
|
+
function mountKiteChat(config) {
|
|
7
|
+
const { container, ...chatConfig } = config;
|
|
8
|
+
const instance = createKiteChat(chatConfig);
|
|
9
|
+
let targetContainer;
|
|
10
|
+
if (container) {
|
|
11
|
+
targetContainer = container;
|
|
12
|
+
} else {
|
|
13
|
+
const defaultContainer = document.createElement("div");
|
|
14
|
+
defaultContainer.id = "kite-chat-root";
|
|
15
|
+
document.body.appendChild(defaultContainer);
|
|
16
|
+
targetContainer = defaultContainer;
|
|
17
|
+
}
|
|
18
|
+
instance.mount(targetContainer);
|
|
19
|
+
return instance;
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
mountKiteChat
|
|
23
|
+
};
|