@aparte/svelte 0.2.0-alpha.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/LICENSE +21 -0
- package/README.md +35 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1344 -0
- package/dist/index.js.map +1 -0
- package/dist/stores/aparteChat.d.ts +48 -0
- package/dist/stores/aparteChat.d.ts.map +1 -0
- package/dist/stores/aparteClient.d.ts +11 -0
- package/dist/stores/aparteClient.d.ts.map +1 -0
- package/dist/stores/conversationManager.d.ts +23 -0
- package/dist/stores/conversationManager.d.ts.map +1 -0
- package/dist/types.d.ts +28 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +63 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 aparté
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# @aparte/svelte
|
|
2
|
+
|
|
3
|
+
Svelte 4 wrapper for [aparté](https://github.com/apartejs/aparte) — an ergonomic `<AparteChat>`
|
|
4
|
+
component plus stores (`createAparteChat`, `createAparteClient`, `createConversationManager`) over the
|
|
5
|
+
framework-agnostic web components in `@aparte/core`.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @aparte/svelte @aparte/core svelte
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```svelte
|
|
12
|
+
<script lang="ts">
|
|
13
|
+
import { AparteChat, createAparteChat, type AparteChatInstance } from '@aparte/svelte';
|
|
14
|
+
import '@aparte/core/styles.css';
|
|
15
|
+
|
|
16
|
+
const chat = createAparteChat();
|
|
17
|
+
const { messages } = chat;
|
|
18
|
+
let comp: AparteChatInstance | null = null;
|
|
19
|
+
$: chat.connect(comp);
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<AparteChat
|
|
23
|
+
bind:this={comp}
|
|
24
|
+
messages={$messages}
|
|
25
|
+
on:messagesChange={(e) => chat.onMessagesChange(e.detail)}
|
|
26
|
+
/>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The user's message is appended automatically on send — don't add it yourself. `on:messageSent` is
|
|
30
|
+
optional and only for side-effects (scroll, analytics).
|
|
31
|
+
|
|
32
|
+
`@aparte/core` and `svelte` are **peer dependencies**. For any `<aparte-*>` element without a
|
|
33
|
+
dedicated component, the generic `<AparteUi name="aparte-…" />` escape hatch mounts it.
|
|
34
|
+
|
|
35
|
+
> ESM-only. See the docs for the full API. Part of the aparté monorepo.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* aparté Svelte wrapper
|
|
3
|
+
* Svelte 4 integration with stores and segment support
|
|
4
|
+
*/
|
|
5
|
+
export { default as AparteChat } from './AparteChat.svelte';
|
|
6
|
+
export { createAparteChat } from './stores/aparteChat.js';
|
|
7
|
+
export type { AparteChatStore, AparteChatInstance } from './stores/aparteChat.js';
|
|
8
|
+
export { createAparteClient } from './stores/aparteClient.js';
|
|
9
|
+
export { createConversationManager } from './stores/conversationManager.js';
|
|
10
|
+
export { default as AparteUi } from './AparteUi.svelte';
|
|
11
|
+
export type { AparteUiProps, AparteUiHandle } from './types.js';
|
|
12
|
+
export type { AparteMessage, AparteSendEventDetail, AparteActionEventDetail, AparteSegment, AparteTextSegment, AparteCodeSegment, AparteThinkingSegment, AparteTerminalSegment } from './types.js';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAG5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAGlF,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxD,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEhE,YAAY,EACR,aAAa,EACb,qBAAqB,EACrB,uBAAuB,EACvB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACxB,MAAM,YAAY,CAAC"}
|