@useknest/widget-svelte 0.0.1-alpha.2
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 +40 -0
- package/dist/index.js +5 -0
- package/package.json +34 -0
- package/src/index.ts +4 -0
package/README.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# @useknest/widget-svelte
|
|
2
|
+
|
|
3
|
+
Svelte 5 wrapper for the Knest chat widget.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @useknest/widget-core @useknest/widget-svelte
|
|
9
|
+
# or
|
|
10
|
+
pnpm add @useknest/widget-core @useknest/widget-svelte
|
|
11
|
+
# or
|
|
12
|
+
yarn add @useknest/widget-core @useknest/widget-svelte
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```svelte
|
|
18
|
+
<script>
|
|
19
|
+
import { ChatWidget } from '@useknest/widget-svelte';
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<ChatWidget publishableApiKey="your-publishable-api-key" />
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
- `publishableApiKey` (required): Your Knest project's publishable API key
|
|
28
|
+
|
|
29
|
+
## Features
|
|
30
|
+
|
|
31
|
+
- Native Svelte 5 component (zero overhead)
|
|
32
|
+
- Full TypeScript support
|
|
33
|
+
- Streaming responses
|
|
34
|
+
- Automatic theming based on your project configuration
|
|
35
|
+
- Source citations
|
|
36
|
+
- Example questions
|
|
37
|
+
|
|
38
|
+
## License
|
|
39
|
+
|
|
40
|
+
MIT
|
package/dist/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@useknest/widget-svelte",
|
|
3
|
+
"version": "0.0.1-alpha.2",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"svelte": "./src/index.ts",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"svelte": "./src/index.ts"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist",
|
|
15
|
+
"src"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "vite build",
|
|
19
|
+
"dev": "vite build --watch",
|
|
20
|
+
"publish": "node scripts/publish.js",
|
|
21
|
+
"release": "pnpm build && pnpm run publish"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"@useknest/widget-core": "^0.0.1-alpha.1",
|
|
25
|
+
"svelte": "^5.0.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@sveltejs/package": "^2.3.7",
|
|
29
|
+
"@sveltejs/vite-plugin-svelte": "^6.2.0",
|
|
30
|
+
"svelte": "^5.39.5",
|
|
31
|
+
"typescript": "^5.9.2",
|
|
32
|
+
"vite": "^7.1.7"
|
|
33
|
+
}
|
|
34
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// Re-export the internal Svelte components from widget-core for zero-overhead usage
|
|
2
|
+
export { default as ChatWidget } from '@useknest/widget-core/internal';
|
|
3
|
+
export { default as ChatMessage } from '@useknest/widget-core/internal';
|
|
4
|
+
export type { Message, Source, MessageRole, ChatWidgetProps } from '@useknest/widget-core/internal';
|