@aparte/svelte 0.9.0 → 0.11.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 CHANGED
@@ -42,7 +42,10 @@ npm install @aparte/svelte @aparte/core svelte
42
42
  The user's message is appended automatically on send — don't add it yourself. `on:messageSent` is
43
43
  optional and only for side-effects (scroll, analytics).
44
44
 
45
- `@aparte/core` and `svelte` are **peer dependencies**. For any `<aparte-*>` element without a
46
- dedicated component, the generic `<AparteUi name="aparte-…" />` escape hatch mounts it.
45
+ `@aparte/core` and `svelte` are **peer dependencies**.
46
+
47
+ Every `<aparte-*>` tag is declared through `SvelteHTMLElements`, so `svelte-check` covers its
48
+ attributes and its `on:` handlers. `<AparteUi name="my-widget" />` remains for an element aparté does
49
+ not define.
47
50
 
48
51
  > ESM-only. See the docs for the full API. Part of the aparté monorepo.
package/dist/index.d.ts CHANGED
@@ -13,5 +13,26 @@ export { createAparteClient } from './stores/aparteClient.js';
13
13
  export { createConversationManager } from './stores/conversationManager.js';
14
14
  export { default as AparteUi } from './AparteUi.svelte';
15
15
  export type { AparteUiProps, AparteUiHandle } from './types.js';
16
- export type { AparteMessage, AparteSendEventDetail, AparteActionEventDetail, AparteSegment, AparteTextSegment, AparteCodeSegment, AparteThinkingSegment, AparteTerminalSegment } from './types.js';
16
+ export type { AparteMessage, AparteSendEventDetail, AparteActionEventDetail, AparteSegment, AparteTextSegment, AparteCodeSegment, AparteThinkingSegment } from './types.js';
17
+ import type { HTMLAttributes } from 'svelte/elements';
18
+ import type { AparteElementAttributes, AparteElementTagName, AparteTemplateAttrs } from '@aparte/core';
19
+ /**
20
+ * Svelte's `on:` handlers, for every event aparté dispatches.
21
+ *
22
+ * Derived from `HTMLElementEventMap`, which `@aparte/core` augments — so this needs no
23
+ * list of its own and cannot fall behind. Declaring the elements without it made the
24
+ * wrapper's OWN component stop type-checking (`on:aparte-send` on `<aparte-composer>`),
25
+ * which is how the gap surfaced.
26
+ */
27
+ type AparteEventName = Extract<keyof HTMLElementEventMap, `aparte-${string}`>;
28
+ type AparteSvelteHandlers = {
29
+ [K in AparteEventName as `on:${K}`]?: (event: HTMLElementEventMap[K]) => void;
30
+ };
31
+ type AparteSvelteElements = {
32
+ [K in AparteElementTagName]: HTMLAttributes<HTMLElement> & AparteTemplateAttrs<AparteElementAttributes[K]> & AparteSvelteHandlers;
33
+ };
34
+ declare module 'svelte/elements' {
35
+ interface SvelteHTMLElements extends AparteSvelteElements {
36
+ }
37
+ }
17
38
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAG5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAK9D,YAAY,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAG5D,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"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAG5D,OAAO,EAAE,gBAAgB,E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instance scoping);
5
5
  * re-export the canonical one so the field isn't silently dropped from the type.
6
6
  */
7
- export type { AparteMessage, AparteSegment, AparteTextSegment, AparteCodeSegment, AparteThinkingSegment, AparteTerminalSegment, AparteSendEventDetail, AparteActionEventDetail, } from '@aparte/core';
7
+ export type { AparteMessage, AparteSegment, AparteTextSegment, AparteCodeSegment, AparteThinkingSegment, AparteSendEventDetail, AparteActionEventDetail, } from '@aparte/core';
8
8
  /** Props of the `<AparteUi>` universal pass-through proxy. */
9
9
  export interface AparteUiProps {
10
10
  /** The custom element tag name (e.g. 'aparte-model-selector'). */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/lib/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,YAAY,EACR,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,GAC1B,MAAM,cAAc,CAAC;AAEtB,8DAA8D;AAC9D,MAAM,WAAW,aAAa;IAC1B,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC3B,UAAU,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,KAAK,CAAC,GAAG,IAAI,CAAC;IAC5D,UAAU,CAAC,CAAC,GAAG,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC;CAClF"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/lib/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,YAAY,EACR,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,GAC1B,MAAM,cAAc,CAAC;AAEtB,8DAA8D;AAC9D,MAAM,WAAW,aAAa;IAC1B,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC3B,UAAU,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,KAAK,CAAC,GAAG,IAAI,CAAC;IAC5D,UAAU,CAAC,CAAC,GAAG,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC;CAClF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aparte/svelte",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "description": "Svelte wrapper for aparté — an ergonomic <AparteChat> component plus stores over the framework-agnostic web components. Works on Svelte 4 and 5.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -51,7 +51,7 @@
51
51
  "svelte2tsx": "^0.7.61",
52
52
  "typescript": "^5.4.0",
53
53
  "vite": "^6.0.0",
54
- "@aparte/core": "0.9.0"
54
+ "@aparte/core": "0.11.0"
55
55
  },
56
56
  "keywords": [
57
57
  "svelte",