@aparte/core 0.16.11 → 0.17.1
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 +11 -4
- package/dist/client/aparte-client.d.ts +42 -3
- package/dist/client/aparte-client.d.ts.map +1 -1
- package/dist/components/bubble/aparte-chat-bubble.d.ts +22 -0
- package/dist/components/bubble/aparte-chat-bubble.d.ts.map +1 -1
- package/dist/components/chat/aparte-chat.d.ts +55 -14
- package/dist/components/chat/aparte-chat.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer-action.d.ts +5 -3
- package/dist/components/composer/aparte-composer-action.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer-toolbar.d.ts +5 -2
- package/dist/components/composer/aparte-composer-toolbar.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer.d.ts +27 -0
- package/dist/components/composer/aparte-composer.d.ts.map +1 -1
- package/dist/components/context/aparte-context.d.ts +8 -0
- package/dist/components/context/aparte-context.d.ts.map +1 -1
- package/dist/components/conversation-list/aparte-conversation-list.d.ts +82 -17
- package/dist/components/conversation-list/aparte-conversation-list.d.ts.map +1 -1
- package/dist/components/scroll-rail/aparte-scroll-rail.d.ts.map +1 -1
- package/dist/components/sidebar/aparte-sidebar.d.ts.map +1 -1
- package/dist/components/split/aparte-split.d.ts.map +1 -1
- package/dist/components/suggestions/aparte-suggestions.d.ts +37 -3
- package/dist/components/suggestions/aparte-suggestions.d.ts.map +1 -1
- package/dist/components/viewport/aparte-chat-viewport.d.ts +55 -1
- package/dist/components/viewport/aparte-chat-viewport.d.ts.map +1 -1
- package/dist/config/action-provider.d.ts +14 -14
- package/dist/config/action-provider.d.ts.map +1 -1
- package/dist/config/aparte-config.d.ts +109 -14
- package/dist/config/aparte-config.d.ts.map +1 -1
- package/dist/config/bubble-shell-renderer.d.ts +50 -12
- package/dist/config/bubble-shell-renderer.d.ts.map +1 -1
- package/dist/config/locale.d.ts +33 -1
- package/dist/config/locale.d.ts.map +1 -1
- package/dist/config/sanitize.d.ts.map +1 -1
- package/dist/conversations/conversation-controller.d.ts +14 -0
- package/dist/conversations/conversation-controller.d.ts.map +1 -1
- package/dist/conversations/conversation-manager.d.ts +57 -19
- package/dist/conversations/conversation-manager.d.ts.map +1 -1
- package/dist/conversations/types.d.ts +18 -11
- package/dist/conversations/types.d.ts.map +1 -1
- package/dist/custom-elements.json +12007 -11027
- package/dist/{dialog-triggers-cYGTlfZf.js → dialog-triggers-CJWw0P3l.js} +652 -161
- package/dist/dialog-triggers-CJWw0P3l.js.map +1 -0
- package/dist/generated/element-attributes.d.ts +15 -9
- package/dist/generated/element-attributes.d.ts.map +1 -1
- package/dist/host/aparte-chat-host.d.ts +30 -0
- package/dist/host/aparte-chat-host.d.ts.map +1 -1
- package/dist/index.css +1 -8393
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +644 -111
- package/dist/index.js.map +1 -1
- package/dist/index.node.d.ts +1 -1
- package/dist/index.node.d.ts.map +1 -1
- package/dist/index.node.js +1 -1
- package/dist/index.node.js.map +1 -1
- package/dist/interop/element-props.d.ts +1 -1
- package/dist/primitives/select/aparte-optgroup.d.ts +1 -0
- package/dist/primitives/select/aparte-optgroup.d.ts.map +1 -1
- package/dist/primitives/select/aparte-select.d.ts +12 -1
- package/dist/primitives/select/aparte-select.d.ts.map +1 -1
- package/dist/renderers/markdown-stream.d.ts.map +1 -1
- package/dist/renderers/segments/tool-call.d.ts.map +1 -1
- package/dist/runtime/message-repository.d.ts +16 -3
- package/dist/runtime/message-repository.d.ts.map +1 -1
- package/dist/types/chat.d.ts +41 -46
- package/dist/types/chat.d.ts.map +1 -1
- package/dist/types/event-map.d.ts +7 -7
- package/dist/types/event-map.d.ts.map +1 -1
- package/dist/types/events.d.ts +7 -6
- package/dist/types/events.d.ts.map +1 -1
- package/dist/types/imperative-api.d.ts +16 -0
- package/dist/types/imperative-api.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/models.d.ts +9 -0
- package/dist/types/models.d.ts.map +1 -1
- package/dist/types/segments.d.ts +56 -13
- package/dist/types/segments.d.ts.map +1 -1
- package/dist/types/tools.d.ts +14 -0
- package/dist/types/tools.d.ts.map +1 -1
- package/dist/utils/event-target.d.ts +31 -0
- package/dist/utils/event-target.d.ts.map +1 -0
- package/dist/utils/transcript.d.ts +13 -0
- package/dist/utils/transcript.d.ts.map +1 -0
- package/package.json +2 -2
- package/dist/dialog-triggers-cYGTlfZf.js.map +0 -1
package/README.md
CHANGED
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
Framework-agnostic AI chat UI as **vanilla Web Components, with the agent loop inside** —
|
|
6
6
|
zero third-party dependencies, ESM-only, usable in any framework or none.
|
|
7
7
|
|
|
8
|
-
> **
|
|
9
|
-
> version number is a plain `0.x
|
|
10
|
-
>
|
|
11
|
-
>
|
|
8
|
+
> **Beta.** On npm, released in lockstep with every other `@aparte/*` package — the
|
|
9
|
+
> version number is a plain `0.x`, and the declared surface is
|
|
10
|
+
> [frozen as of 0.17.0](https://apartejs.dev/reference/stability/): it leaves only
|
|
11
|
+
> through a notice release. Part of the [aparté](https://github.com/apartejs/aparte)
|
|
12
|
+
> monorepo; what changed when is at [apartejs.dev/changelog](https://apartejs.dev/changelog/).
|
|
12
13
|
|
|
13
14
|
## Install
|
|
14
15
|
|
|
@@ -36,6 +37,12 @@ new AparteClient().start();
|
|
|
36
37
|
aparteGlobalConfig.setBubbleActions({ retry: true, edit: true });
|
|
37
38
|
```
|
|
38
39
|
|
|
40
|
+
**No key yet?** `npm i @aparte/provider-scenario` and register
|
|
41
|
+
`createScenarioProvider({ scenarios: showcase })` as the provider above: a real streaming
|
|
42
|
+
reply — markdown, reasoning, a tool round-trip — with no backend and no network. It is
|
|
43
|
+
what this repository's own examples run on, and the docs' live frames that answer.
|
|
44
|
+
[Scenario provider](https://apartejs.dev/providers/ai/scenario/).
|
|
45
|
+
|
|
39
46
|
The built-in segment renderers install themselves the first time a segment needs one, so
|
|
40
47
|
there is nothing to call for text, code or thinking blocks to appear. Calling
|
|
41
48
|
`registerDefaultRenderers()` yourself still works and makes the moment explicit.
|
|
@@ -21,7 +21,7 @@ export type AparteToolApprovalResolver = (call: {
|
|
|
21
21
|
/**
|
|
22
22
|
* What the user said to do instead, on a refusal.
|
|
23
23
|
*
|
|
24
|
-
* It becomes the
|
|
24
|
+
* It becomes the `tool` message the model reads, which is possible at all only
|
|
25
25
|
* because a refusal now hands the model a turn. Optional and additive: a resolver
|
|
26
26
|
* that returns a bare `{ approved }` behaves exactly as before.
|
|
27
27
|
*/
|
|
@@ -208,6 +208,7 @@ export declare class AparteClient {
|
|
|
208
208
|
private _boundAbortHandler;
|
|
209
209
|
private _boundRetryHandler;
|
|
210
210
|
private _boundEditHandler;
|
|
211
|
+
private _releaseKeyResolver;
|
|
211
212
|
private _isAborted;
|
|
212
213
|
/**
|
|
213
214
|
* Does this window event belong to this client?
|
|
@@ -245,6 +246,17 @@ export declare class AparteClient {
|
|
|
245
246
|
* empty set, plus a paragraph describing a cancellation the method did not perform.
|
|
246
247
|
*/
|
|
247
248
|
private _beginUserTurn;
|
|
249
|
+
/**
|
|
250
|
+
* Put this client's `keyResolver` on its config, and hold the teardown so
|
|
251
|
+
* `stop()` can take it back off.
|
|
252
|
+
*
|
|
253
|
+
* The registration used to be fire-and-forget, so it outlived the client that
|
|
254
|
+
* made it: a stopped client kept signing model-list requests, and a remount —
|
|
255
|
+
* the way the wrappers document swapping options — added a source behind the
|
|
256
|
+
* one it meant to replace instead of replacing it. Idempotent, so the usual
|
|
257
|
+
* `new AparteClient({…}).start()` registers once.
|
|
258
|
+
*/
|
|
259
|
+
private _registerKeyResolver;
|
|
248
260
|
/**
|
|
249
261
|
* Sets up the event listeners.
|
|
250
262
|
* This is called once in the constructor.
|
|
@@ -358,6 +370,31 @@ export declare class AparteClient {
|
|
|
358
370
|
* messages, then re-stream a fresh assistant response.
|
|
359
371
|
*/
|
|
360
372
|
private _handleEdit;
|
|
373
|
+
/**
|
|
374
|
+
* The chain the gesture really came up, nearest node first.
|
|
375
|
+
*
|
|
376
|
+
* Read from a `window` listener, `event.target` is the shadow HOST when the event
|
|
377
|
+
* left a tree of the consumer's own, and `parentElement` stops at that tree's root —
|
|
378
|
+
* so a walk from either starts, or ends, outside the chat the person typed into.
|
|
379
|
+
* `composedPath()` is the one chain that crosses. The fallback is for an event
|
|
380
|
+
* dispatched by hand, which has no path.
|
|
381
|
+
*/
|
|
382
|
+
private _originChain;
|
|
383
|
+
/**
|
|
384
|
+
* The trees a lookup must search, the one the gesture came from FIRST.
|
|
385
|
+
*
|
|
386
|
+
* `document.getElementById` and `document.querySelectorAll` cannot see into a shadow
|
|
387
|
+
* root, so a chat mounted in one — the arrangement the theming guide endorses — was
|
|
388
|
+
* invisible to both: alone, the send was dropped with a warning; on a page that also
|
|
389
|
+
* holds a chat in the light DOM, the scan answered with the WRONG chat, so the
|
|
390
|
+
* person's message AND the model's reply landed in a transcript they never typed
|
|
391
|
+
* into. Nearest tree first is what keeps it from swapping the other way round.
|
|
392
|
+
*/
|
|
393
|
+
private _rootsFor;
|
|
394
|
+
/** The element an id names, looked up in the gesture's own tree before the document. */
|
|
395
|
+
private _byId;
|
|
396
|
+
/** The first chat that can render, own tree first — the path when nothing names one. */
|
|
397
|
+
private _scanForTarget;
|
|
361
398
|
/**
|
|
362
399
|
* Resolve a target element by id (from event detail.targetId) or via targetResolver / DOM scan.
|
|
363
400
|
*/
|
|
@@ -479,7 +516,8 @@ export declare class AparteClient {
|
|
|
479
516
|
*
|
|
480
517
|
* `thinking` and `tool_call` stay out on purpose — the first is the model's own
|
|
481
518
|
* scratchpad, and most APIs neither want it back nor bill for it kindly; the
|
|
482
|
-
* second
|
|
519
|
+
* second was already carried, within the turn, as the assistant's calls and the
|
|
520
|
+
* `tool` messages answering them.
|
|
483
521
|
*/
|
|
484
522
|
private _segmentsToText;
|
|
485
523
|
/**
|
|
@@ -496,7 +534,8 @@ export declare class AparteClient {
|
|
|
496
534
|
* - Images → AparteImagePart (base64 data URL)
|
|
497
535
|
* - Text files (txt, md, json, csv, xml, html, css, js, ts, …) → AparteTextPart
|
|
498
536
|
* injected as a fenced block so all models (including local) can read them.
|
|
499
|
-
* - Other binary files →
|
|
537
|
+
* - Other binary files → no content part, and a one-time `console.warn` naming the
|
|
538
|
+
* file (see the branch below for why it is not silent).
|
|
500
539
|
*/
|
|
501
540
|
private _filesToContentParts;
|
|
502
541
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aparte-client.d.ts","sourceRoot":"","sources":["../../src/client/aparte-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAO9E,OAAO,KAAK,EAAE,kBAAkB,EAA+C,MAAM,qBAAqB,CAAC;AAC3G,OAAO,KAAK,EAAoC,aAAa,EAAsB,MAAM,mBAAmB,CAAC;AAG7G,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAkC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"aparte-client.d.ts","sourceRoot":"","sources":["../../src/client/aparte-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAO9E,OAAO,KAAK,EAAE,kBAAkB,EAA+C,MAAM,qBAAqB,CAAC;AAC3G,OAAO,KAAK,EAAoC,aAAa,EAAsB,MAAM,mBAAmB,CAAC;AAG7G,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAkC,MAAM,kBAAkB,CAAC;AAuCxG;;;;;;;;GAQG;AACH,MAAM,MAAM,0BAA0B,GAAG,CACrC,IAAI,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,EAClE,MAAM,EAAE,WAAW,KAClB,OA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OAGG;YACW,WAAW;IAiEzB;;;;;;;;OAQG;IACH,OAAO,CAAC,YAAY;IASpB;;;;;;;;;OASG;IACH,OAAO,CAAC,SAAS;IAWjB,wFAAwF;IACxF,OAAO,CAAC,KAAK;IAQb,wFAAwF;IACxF,OAAO,CAAC,cAAc;IAUtB;;OAEG;IACH,OAAO,CAAC,cAAc;IAuBtB;;;;;;OAMG;IACH,OAAO,CAAC,eAAe;IAUvB;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,WAAW;IAWnB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,uBAAuB;IAI/B;;;;;;;;;OASG;IACH,OAAO,CAAC,YAAY;IAapB,0FAA0F;IAC1F,OAAO,CAAC,cAAc,CAAS;YAEjB,WAAW;IA2LzB;;OAEG;IACH,OAAO,CAAC,cAAc;IAoBtB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,MAAM,CAAC,SAAS;IAIxB,OAAO,CAAC,kBAAkB;IAmB1B;;;;;OAKG;IACH,OAAO,CAAC,SAAS;IAKjB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,OAAO,CAAC,YAAY;IAOpB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,OAAO,CAAC,eAAe;IAuBvB;;;;;;;OAOG;IACH,OAAO,CAAC,oBAAoB;IAS5B;;;;;;;OAOG;YACW,oBAAoB;IAiDlC;;;;;;;;;;OAUG;IACH;;;OAGG;YACW,WAAW;IA+CzB;;;;;;;;OAQG;YACW,mBAAmB;IAoHjC;;OAEG;IACH,OAAO,CAAC,cAAc;IAMtB;;OAEG;IACH,OAAO,CAAC,qBAAqB;CA+DhC"}
|
|
@@ -42,6 +42,13 @@ import type { AparteSegment, AparteAttachment, AparteUsage, AparteMessage } from
|
|
|
42
42
|
* so the one event belonging to the branch picker was the one missing from the
|
|
43
43
|
* manifest, and from the generated reference, for as long as both existed.
|
|
44
44
|
*
|
|
45
|
+
* The bubble element is `content-visibility: auto` for its streaming/scroll performance
|
|
46
|
+
* (measured, not assumed — see `bubble.css`), and that containment makes the bubble
|
|
47
|
+
* the containing block for `position: fixed` descendants: a popover mounted inside it
|
|
48
|
+
* (an `<aparte-select>` from a `registerToolRenderer` renderer, say) is clipped to the
|
|
49
|
+
* bubble's own box, not the window. Mount it outside instead — [Custom tool
|
|
50
|
+
* renderer](https://apartejs.dev/guides/tools/#custom-tool-renderer) shows the pattern.
|
|
51
|
+
*
|
|
45
52
|
* @element aparte-chat-bubble
|
|
46
53
|
*
|
|
47
54
|
* @attr {string} data-role - The message role, `user` or `assistant` — the one channel for it, and what the CSS keys off. (`role` is ARIA's attribute; this element sets it to `article` itself and no longer reads a message role from it.)
|
|
@@ -325,6 +332,21 @@ export declare class AparteChatBubble extends HTMLElement {
|
|
|
325
332
|
private _getAriaLabel;
|
|
326
333
|
private _updateAttachments;
|
|
327
334
|
/** Uppercased file extension (≤4 chars), or 'FILE' when there is none. */
|
|
335
|
+
/**
|
|
336
|
+
* The same answer `copyAttributes` gives before it writes an `src`, plus `blob:`.
|
|
337
|
+
*
|
|
338
|
+
* An attachment's `url` is documented as "URL or data URI" and a storage adapter
|
|
339
|
+
* re-mints it when a conversation is restored, so it is the app's value, not the
|
|
340
|
+
* composer's — it was escaped and written, where every other URL core emits is
|
|
341
|
+
* asked whether its SCHEME is allowed at all. A picture whose URL is refused is
|
|
342
|
+
* not half-rendered: it falls back to the file chip, which still names the file.
|
|
343
|
+
*
|
|
344
|
+
* `blob:` is added because it is the shape core itself mints — `filesToAttachments`
|
|
345
|
+
* calls `URL.createObjectURL`, and `AparteMessage.attachments` documents the same
|
|
346
|
+
* on hydration. `isSafeUrl` refuses it, and rightly: that list governs MODEL
|
|
347
|
+
* markup, which has no way to make a blob URL resolve.
|
|
348
|
+
*/
|
|
349
|
+
private _isShowableUrl;
|
|
328
350
|
private _fileExt;
|
|
329
351
|
/**
|
|
330
352
|
* The branch arrows are handled by DELEGATION, on this element, bound once.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aparte-chat-bubble.d.ts","sourceRoot":"","sources":["../../../src/components/bubble/aparte-chat-bubble.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,aAAa,EACb,gBAAgB,EAQhB,WAAW,EACX,aAAa,EACd,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"aparte-chat-bubble.d.ts","sourceRoot":"","sources":["../../../src/components/bubble/aparte-chat-bubble.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,aAAa,EACb,gBAAgB,EAQhB,WAAW,EACX,aAAa,EACd,MAAM,sBAAsB,CAAC;AAmG9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2JG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,OAAO,CAAC,UAAU,CAA+B;IACjD,OAAO,CAAC,WAAW,CAA+B;IAClD,OAAO,CAAC,cAAc,CAA+B;IACrD,OAAO,CAAC,YAAY,CAA+B;IACnD,OAAO,CAAC,eAAe,CAA+B;IACtD,OAAO,CAAC,SAAS,CAA+B;IAChD,OAAO,CAAC,QAAQ,CAAM;IACtB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,SAAS,CAAuB;IACxC,OAAO,CAAC,KAAK,CAAiC;IAC9C,OAAO,CAAC,YAAY,CAA0B;IAC9C,OAAO,CAAC,MAAM,CAA4B;IAC1C,gFAAgF;IAChF,OAAO,CAAC,cAAc,CAA6B;IACnD,4EAA4E;IAC5E,OAAO,CAAC,aAAa,CAAK;IAC1B,4EAA4E;IAC5E,OAAO,CAAC,aAAa,CAAK;IAC1B,yDAAyD;IACzD,OAAO,CAAC,QAAQ,CAAS;IACzB,wGAAwG;IACxG,OAAO,CAAC,UAAU,CAAoC;IACtD;;;;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;;;;;;;;OAoBG;IACH,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,eAAe;IASvB;;;;;;;OAOG;IACH,OAAO,CAAC,mBAAmB,CAmBzB;IAEF;;;;;;OAMG;IACH,OAAO,CAAC,qBAAqB;IAc7B,0EAA0E;IAC1E,OAAO,CAAC,oBAAoB;IAqB5B,iGAAiG;IACjG,OAAO,CAAC,iBAAiB;IAsCzB,wEAAwE;IACxE,OAAO,CAAC,kBAAkB;IAiB1B,OAAO,CAAC,kBAAkB;IAgG1B;;;;;;;;;OASG;IACH,OAAO,CAAC,cAAc;IAsCtB;;;;OAIG;IACH,OAAO,CAAC,aAAa;IAuDrB,OAAO,CAAC,gBAAgB;IAuBxB,OAAO,CAAC,gBAAgB;CAwCzB"}
|
|
@@ -24,14 +24,14 @@ import '../elicitation/aparte-elicitation.js';
|
|
|
24
24
|
* Svelte never create this element at all, so the question does not arise for them.
|
|
25
25
|
*
|
|
26
26
|
* Being a component (not a bare `<div>`), it also owns behaviour a wrapper div
|
|
27
|
-
* can't:
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* `framework-managed
|
|
34
|
-
* centers through
|
|
27
|
+
* can't: it watches its own viewport and says whether the conversation is empty —
|
|
28
|
+
* `data-empty`, in the attribute list below, is that watcher's output — and with
|
|
29
|
+
* `center-empty` the stylesheet keeps the composer centered as a welcome state until
|
|
30
|
+
* the first `<aparte-chat-bubble>` lands, then slides to the normal layout, with no
|
|
31
|
+
* external JavaScript. The watcher needs a viewport somewhere inside: hand-written
|
|
32
|
+
* markup always has one, because composing the default injects it, and Angular's
|
|
33
|
+
* `framework-managed` host gets its watcher once the template has rendered the
|
|
34
|
+
* viewport. The stylesheet centers through
|
|
35
35
|
* `aparte-chat[center-empty][data-empty]` and its DIRECT viewport child, so a
|
|
36
36
|
* framework-managed host that nests the viewport inside a container of its own gets
|
|
37
37
|
* nothing from the attribute — the wrappers ship their own centered layout.
|
|
@@ -73,11 +73,11 @@ import '../elicitation/aparte-elicitation.js';
|
|
|
73
73
|
* makes Enter break the line and Shift+Enter send (the bare attribute, or none, keeps the
|
|
74
74
|
* default — Enter sends). The four wrappers expose the same switch as `submitOnEnter`.
|
|
75
75
|
* @attr {boolean} center-empty - Center the composer as a welcome state until the first message, then slide to the normal layout
|
|
76
|
-
* @attr {boolean} data-empty - Reflected BY the element while
|
|
77
|
-
* `<aparte-chat-bubble>`
|
|
78
|
-
* `
|
|
79
|
-
*
|
|
80
|
-
* Read-only.
|
|
76
|
+
* @attr {boolean} data-empty - Reflected BY the element while its viewport holds no
|
|
77
|
+
* `<aparte-chat-bubble>` and is not `loading` — set again when the conversation is cleared.
|
|
78
|
+
* With or without `center-empty`: the stylesheet centers the composer through
|
|
79
|
+
* `aparte-chat[center-empty][data-empty]`, and an app styles or scripts its own empty state
|
|
80
|
+
* against `aparte-chat[data-empty]`. Read-only.
|
|
81
81
|
* @attr {boolean} overlay-composer - The ChatGPT anatomy, opt-in: the transcript's scroll
|
|
82
82
|
* surface spans the whole column and the composer (with the rest of the bottom stack)
|
|
83
83
|
* floats over it, so the scrollbar runs edge to edge instead of stopping at the
|
|
@@ -117,6 +117,13 @@ import '../elicitation/aparte-elicitation.js';
|
|
|
117
117
|
export declare class AparteChat extends HTMLElement {
|
|
118
118
|
static get observedAttributes(): string[];
|
|
119
119
|
private _observer;
|
|
120
|
+
private _loadingObserver;
|
|
121
|
+
/** Waits for a `<aparte-chat-viewport>` child to appear — see `_watchForViewport`. */
|
|
122
|
+
private _childObserver;
|
|
123
|
+
/** The viewport is loading and the gate is on — see `_applyLoadingGate`. */
|
|
124
|
+
private _gated;
|
|
125
|
+
/** The composer's `disabled` is the gate's to remove, not one the consumer set. */
|
|
126
|
+
private _gateOwns;
|
|
120
127
|
/**
|
|
121
128
|
* True only for the composition THIS element injected. An author-provided
|
|
122
129
|
* composer (or a `framework-managed` host) is never edited by the attachments
|
|
@@ -139,8 +146,42 @@ export declare class AparteChat extends HTMLElement {
|
|
|
139
146
|
private _syncAttachments;
|
|
140
147
|
/** Set an attribute on the inner composer only when the shell carries it. */
|
|
141
148
|
private _forwardAttr;
|
|
142
|
-
/**
|
|
149
|
+
/**
|
|
150
|
+
* Watch the viewport so `data-empty` follows the conversation.
|
|
151
|
+
*
|
|
152
|
+
* It used to run only under `center-empty`, which made the chat's one statement of
|
|
153
|
+
* "this conversation is empty" a by-product of a layout option: an app that wanted
|
|
154
|
+
* starters on an empty thread, or a welcome of its own, had to count messages itself.
|
|
155
|
+
* Every selector core writes against it still requires `[center-empty]`, so reflecting
|
|
156
|
+
* it everywhere moves no layout.
|
|
157
|
+
*/
|
|
143
158
|
private _syncEmptyWatch;
|
|
159
|
+
/**
|
|
160
|
+
* A transcript on its way cannot take a message: while the viewport says `loading`
|
|
161
|
+
* the composer is disabled, whatever else the chat is set to. A send in that window
|
|
162
|
+
* raced the fetch — the controller appended to a history that `setMessages`
|
|
163
|
+
* overwrote a moment later. Independent of `center-empty`: every chat gates.
|
|
164
|
+
*/
|
|
165
|
+
private _syncLoadingWatch;
|
|
166
|
+
/**
|
|
167
|
+
* Both watches above need a viewport to observe, and they were installed once, at
|
|
168
|
+
* connect, when there might not be one yet: `<aparte-chat framework-managed>` IS
|
|
169
|
+
* Angular's host element — upgraded on insert, filled by the template afterwards — and
|
|
170
|
+
* hand-written markup upgrades before its children are parsed. Neither ever got its
|
|
171
|
+
* observer, so the documented "every chat gates" was inert on exactly the chats whose
|
|
172
|
+
* transcript is fetched. This waits for the child to arrive, installs them, and stops.
|
|
173
|
+
*/
|
|
174
|
+
private _watchForViewport;
|
|
175
|
+
/**
|
|
176
|
+
* The gate only ever ADDS `disabled` and only ever removes what it added: a `disabled`
|
|
177
|
+
* the consumer set — on this element, or on a composer of their own — stays.
|
|
178
|
+
*/
|
|
179
|
+
private _applyLoadingGate;
|
|
180
|
+
/**
|
|
181
|
+
* Empty means no message AND none on its way. A viewport that says `loading` holds
|
|
182
|
+
* no bubble yet, and it used to count as empty: the welcome and the centred composer
|
|
183
|
+
* showed while a conversation was being fetched.
|
|
184
|
+
*/
|
|
144
185
|
private _updateEmpty;
|
|
145
186
|
}
|
|
146
187
|
//# sourceMappingURL=aparte-chat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aparte-chat.d.ts","sourceRoot":"","sources":["../../../src/components/chat/aparte-chat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAIrE,OAAO,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"aparte-chat.d.ts","sourceRoot":"","sources":["../../../src/components/chat/aparte-chat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAIrE,OAAO,sCAAsC,CAAC;AAI9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgHG;AACH,qBAAa,UAAW,SAAQ,WAAW;IACzC,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,OAAO,CAAC,SAAS,CAAiC;IAClD,OAAO,CAAC,gBAAgB,CAAiC;IACzD,sFAAsF;IACtF,OAAO,CAAC,cAAc,CAAiC;IACvD,4EAA4E;IAC5E,OAAO,CAAC,MAAM,CAAS;IACvB,mFAAmF;IACnF,OAAO,CAAC,SAAS,CAAS;IAE1B;;;;OAIG;IACH,OAAO,CAAC,UAAU,CAAS;IAE3B,iBAAiB,IAAI,IAAI;IAUzB,oBAAoB,IAAI,IAAI;IAS5B,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAoB9F,6EAA6E;IAC7E,IAAI,QAAQ,IAAI,kBAAkB,GAAG,IAAI,CAExC;IAED,qEAAqE;IACrE,IAAI,QAAQ,IAAI,cAAc,GAAG,IAAI,CAEpC;IAED,OAAO,CAAC,OAAO;IAsDf;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAuBxB,6EAA6E;IAC7E,OAAO,CAAC,YAAY;IAKpB;;;;;;;;OAQG;IACH,OAAO,CAAC,eAAe;IAcvB;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;IAUzB;;;;;;;OAOG;IACH,OAAO,CAAC,iBAAiB;IAczB;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAiBzB;;;;OAIG;IACH,OAAO,CAAC,YAAY;CAKrB"}
|
|
@@ -27,7 +27,9 @@ import type { AparteComposer } from './aparte-composer.js';
|
|
|
27
27
|
*
|
|
28
28
|
* @element aparte-composer-action
|
|
29
29
|
*
|
|
30
|
-
* @attr {string} icon - Icon key for aparteGlobalConfig.getIcon(), or raw SVG/HTML starting with
|
|
30
|
+
* @attr {string} icon - Icon key for aparteGlobalConfig.getIcon(), or raw SVG/HTML starting with `<`.
|
|
31
|
+
* A key core's glyph set does not hold renders AS TEXT (`icon="star"` draws the word
|
|
32
|
+
* *star*), so bring your own set through `setIconProvider` or pass the SVG.
|
|
31
33
|
* @attr {string} label - Accessible label (also used as tooltip)
|
|
32
34
|
* @attr {boolean} disabled - Disables the button
|
|
33
35
|
* @attr {string} action-id - Identifies WHICH button fired; carried as
|
|
@@ -56,7 +58,7 @@ import type { AparteComposer } from './aparte-composer.js';
|
|
|
56
58
|
* <div class="aparte-composer-shell">
|
|
57
59
|
* <div class="aparte-composer-row">
|
|
58
60
|
* <aparte-composer-input></aparte-composer-input>
|
|
59
|
-
* <aparte-composer-action icon="
|
|
61
|
+
* <aparte-composer-action icon="pin" label="Pin" action-id="pin"></aparte-composer-action>
|
|
60
62
|
* <aparte-composer-send></aparte-composer-send>
|
|
61
63
|
* </div>
|
|
62
64
|
* </div>
|
|
@@ -65,7 +67,7 @@ import type { AparteComposer } from './aparte-composer.js';
|
|
|
65
67
|
* <script>
|
|
66
68
|
* // The event bubbles, so one listener above the composer serves every action.
|
|
67
69
|
* document.addEventListener('aparte-action-click', (event) => {
|
|
68
|
-
* if (event.detail.actionId === '
|
|
70
|
+
* if (event.detail.actionId === 'pin') console.log('pinned');
|
|
69
71
|
* });
|
|
70
72
|
* </script>
|
|
71
73
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aparte-composer-action.d.ts","sourceRoot":"","sources":["../../../src/components/composer/aparte-composer-action.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAI3D
|
|
1
|
+
{"version":3,"file":"aparte-composer-action.d.ts","sourceRoot":"","sources":["../../../src/components/composer/aparte-composer-action.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAI3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AACH,qBAAa,oBAAqB,SAAQ,WAAW;IACjD,OAAO,CAAC,OAAO,CAAkC;IACjD,OAAO,CAAC,aAAa,CAAsB;IAG3C,OAAO,CAAC,QAAQ,CAAgC;IAEhD,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,iBAAiB,IAAI,IAAI;IAiBzB,oBAAoB,IAAI,IAAI;IAM5B,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAgBvF,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,OAAO;IAoBf,OAAO,CAAC,cAAc;IAgBtB,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,YAAY;CAKvB;AAMD;;;;;;;;;GASG;AACH,MAAM,WAAW,4BAA4B;IACzC,yEAAyE;IACzE,QAAQ,EAAE,MAAM,CAAC;IACjB,0EAA0E;IAC1E,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;CACnC"}
|
|
@@ -23,8 +23,11 @@
|
|
|
23
23
|
*
|
|
24
24
|
* @element aparte-composer-toolbar
|
|
25
25
|
*
|
|
26
|
-
* @attr {boolean} data-empty - Reflected BY the element while it holds neither
|
|
27
|
-
* child nor non-whitespace text; the stylesheet hides it then.
|
|
26
|
+
* @attr {boolean} data-empty - Reflected BY the element while it holds neither a visible
|
|
27
|
+
* element child nor non-whitespace text; the stylesheet hides it then.
|
|
28
|
+
* A child that hides itself — `hidden`, or its own `data-empty` the
|
|
29
|
+
* way `<aparte-context>` does before its first usage — does not count:
|
|
30
|
+
* a row whose only child shows nothing is an empty band with a border.
|
|
28
31
|
* Read-only, do not set it yourself.
|
|
29
32
|
*
|
|
30
33
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aparte-composer-toolbar.d.ts","sourceRoot":"","sources":["../../../src/components/composer/aparte-composer-toolbar.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"aparte-composer-toolbar.d.ts","sourceRoot":"","sources":["../../../src/components/composer/aparte-composer-toolbar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,qBAAa,qBAAsB,SAAQ,WAAW;IAClD,OAAO,CAAC,SAAS,CAAiC;IAElD,iBAAiB,IAAI,IAAI;IAezB,oBAAoB,IAAI,IAAI;IAK5B;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,UAAU;CAcrB"}
|
|
@@ -261,6 +261,14 @@ export declare class AparteComposer extends HTMLElement {
|
|
|
261
261
|
get value(): string;
|
|
262
262
|
get streaming(): boolean;
|
|
263
263
|
get disabled(): boolean;
|
|
264
|
+
/**
|
|
265
|
+
* The attribute is the state, so the property writes it. It has to exist: React 19
|
|
266
|
+
* and Svelte assign the PROPERTY whenever the element has one of that name, and a
|
|
267
|
+
* getter alone made `<aparte-composer disabled="">` — a spelling the wrappers type
|
|
268
|
+
* as valid — throw and take the render down. `presenceOn` because `''` is what
|
|
269
|
+
* those templates hand a presence property (#62).
|
|
270
|
+
*/
|
|
271
|
+
set disabled(value: boolean);
|
|
264
272
|
/**
|
|
265
273
|
* When false, Shift+Enter submits and a bare Enter inserts a newline —
|
|
266
274
|
* the inverse of the default. Driven by the `submit-on-enter` attribute.
|
|
@@ -268,6 +276,8 @@ export declare class AparteComposer extends HTMLElement {
|
|
|
268
276
|
get submitOnEnter(): boolean;
|
|
269
277
|
get attachments(): File[];
|
|
270
278
|
get placeholder(): string;
|
|
279
|
+
/** Writes the attribute the inputs read (see `disabled` for why the setter exists). */
|
|
280
|
+
set placeholder(value: string);
|
|
271
281
|
get targetId(): string | null;
|
|
272
282
|
/**
|
|
273
283
|
* Snapshot of the composer's observable state. Pair with the
|
|
@@ -451,6 +461,23 @@ export declare class AparteComposer extends HTMLElement {
|
|
|
451
461
|
*/
|
|
452
462
|
private _warnIfUnattached;
|
|
453
463
|
private _ownTargetId;
|
|
464
|
+
/**
|
|
465
|
+
* The message this composer's turn is writing, when the event that started it said.
|
|
466
|
+
* Kept so the END of a DIFFERENT turn cannot be read as the end of this one — see
|
|
467
|
+
* `_isForThisTurn`.
|
|
468
|
+
*/
|
|
469
|
+
private _streamingMessageId;
|
|
470
|
+
/**
|
|
471
|
+
* Whether a terminal event ends the turn this composer is following.
|
|
472
|
+
*
|
|
473
|
+
* `_isForThisComposer` answers "is this chat's?", and both turns of a retry belong
|
|
474
|
+
* to the same chat: the client aborts the superseded reply, the engine emits
|
|
475
|
+
* `run-aborted` for it, and that unwind turned Stop back into Send while the new
|
|
476
|
+
* reply was still streaming — and evicted the open panel, i.e. the approval question
|
|
477
|
+
* a tool was still waiting on. An event with no `messageId` still ends the turn: a
|
|
478
|
+
* loop of one's own saying "done" has always meant this one.
|
|
479
|
+
*/
|
|
480
|
+
private _isForThisTurn;
|
|
454
481
|
private _handleMessageStart;
|
|
455
482
|
private _handleMessageDone;
|
|
456
483
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aparte-composer.d.ts","sourceRoot":"","sources":["../../../src/components/composer/aparte-composer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"aparte-composer.d.ts","sourceRoot":"","sources":["../../../src/components/composer/aparte-composer.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG,MAAM,CAAC;AAKxD,MAAM,WAAW,sBAAsB;IACnC,cAAc,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAClC,kBAAkB,EAAE;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE,CAAC;IAC3C,iBAAiB,EAAE;QAAE,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC;IACzC,oBAAoB,EAAE;QAAE,WAAW,EAAE,IAAI,EAAE,CAAA;KAAE,CAAC;IAC9C,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,IAAI,EAAE,CAAA;KAAE,CAAC;IACjD,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAChC,cAAc,EAAE;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,aAAa,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,uBAAuB,CAAA;KAAE,CAAC;CAC9F;AAED,MAAM,MAAM,uBAAuB,GAAG,MAAM,sBAAsB,CAAC;AAEnE;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,O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null;
|
|
90
90
|
/** The window in force — the attribute, else the current model's. */
|
|
91
91
|
get window(): number | null;
|
|
92
|
+
/**
|
|
93
|
+
* Writes the `window` attribute; `null` gives the model's own window back.
|
|
94
|
+
*
|
|
95
|
+
* The setter has to exist: React 19 and Svelte assign the PROPERTY whenever the
|
|
96
|
+
* element has one of that name, so `<aparte-context window={8000}>` — a spelling
|
|
97
|
+
* both wrappers type as valid — hit a getter alone and threw.
|
|
98
|
+
*/
|
|
99
|
+
set window(value: number | null);
|
|
92
100
|
/** The current level, or `null` while nothing is shown. */
|
|
93
101
|
get level(): AparteContextLevel | null;
|
|
94
102
|
connectedCallback(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aparte-context.d.ts","sourceRoot":"","sources":["../../../src/components/context/aparte-context.ts"],"names":[],"mappings":"AAGA,0DAA0D;AAC1D,MAAM,MAAM,kBAAkB,GAAG,IAAI,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE1D,+FAA+F;AAC/F,MAAM,WAAW,iCAAiC;IAC9C,KAAK,EAAE,kBAAkB,CAAC;IAC1B,8EAA8E;IAC9E,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAoCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC1C,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,OAAO,CAAC,KAAK,CAAuB;IACpC,OAAO,CAAC,MAAM,CAAmC;IACjD,OAAO,CAAC,iBAAiB,CAAS;IAElC,OAAO,CAAC,OAAO,CAMb;IAEF;;;;;;OAMG;IACH,OAAO,CAAC,YAAY,CAWlB;IAEF,gFAAgF;IAChF,OAAO,CAA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;IAChF,OAAO,CAAC,eAAe,CAIrB;IAEF,OAAO,CAAC,WAAW,CAA8B;IAEjD,sEAAsE;IACtE,IAAI,IAAI,IAAI,MAAM,GAAG,IAAI,CAExB;IAED,qEAAqE;IACrE,IAAI,MAAM,IAAI,MAAM,GAAG,IAAI,CAE1B;IAED;;;;;;OAMG;IACH,IAAI,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAG9B;IAED,2DAA2D;IAC3D,IAAI,KAAK,IAAI,kBAAkB,GAAG,IAAI,CAErC;IAED,iBAAiB,IAAI,IAAI;IAUzB,oBAAoB,IAAI,IAAI;IAO5B,wBAAwB,IAAI,IAAI;IAIhC,OAAO,CAAC,OAAO;IAOf,gGAAgG;IAChG,OAAO,CAAC,YAAY;IAYpB,OAAO,CAAC,OAAO;IAKf,OAAO,CAAC,OAAO;CA2FlB"}
|
|
@@ -28,7 +28,8 @@ export interface AparteConversationRenameDetail {
|
|
|
28
28
|
/**
|
|
29
29
|
* Conversation-history sidebar — a framework-agnostic web component. The host sets
|
|
30
30
|
* the `conversations` JS property and the `active-id` attribute; this renders the
|
|
31
|
-
* rows and fires the user's intent
|
|
31
|
+
* rows and fires the user's intent. Acting on it is the host's, unless `manage` hands
|
|
32
|
+
* the row menu's writes to the registered conversation manager.
|
|
32
33
|
*
|
|
33
34
|
* A row is two real buttons: the title, which selects, and a `⋯` that opens the row's
|
|
34
35
|
* menu — rename, pin or unpin, archive or unarchive, delete. Every item fires an event
|
|
@@ -37,7 +38,7 @@ export interface AparteConversationRenameDetail {
|
|
|
37
38
|
* input: Enter or leaving the field commits, Escape cancels, and an unchanged or
|
|
38
39
|
* emptied title fires nothing. The rows are grouped by date — Pinned, Today,
|
|
39
40
|
* Yesterday, Previous 7 days, Previous 30 days, then one heading per month — as soon
|
|
40
|
-
* as any item carries `updatedAt`; set `
|
|
41
|
+
* as any item carries `updatedAt`; set `flat` to render them flat.
|
|
41
42
|
*
|
|
42
43
|
* Children are not a composition point: `_render()` assigns `innerHTML` from the
|
|
43
44
|
* `conversations` array, so any light-DOM child a host writes inside the element is
|
|
@@ -47,7 +48,11 @@ export interface AparteConversationRenameDetail {
|
|
|
47
48
|
*
|
|
48
49
|
* What it is not: a store. Selecting, renaming, pinning, archiving and deleting all
|
|
49
50
|
* leave the array untouched — the events carry an id (and, for rename, the title) and
|
|
50
|
-
* stop.
|
|
51
|
+
* stop. Set `manage` and the menu's write gestures are carried out on the conversation
|
|
52
|
+
* manager you registered, so those six listeners are no longer yours to write; the
|
|
53
|
+
* event still goes out first and `preventDefault()` takes the gesture back. The array
|
|
54
|
+
* is still not this element's: the manager's own change is what re-renders it.
|
|
55
|
+
* A row's text comes from the array, so it changes when the host assigns
|
|
51
56
|
* `conversations` again; the exception is an empty title, which falls back to the
|
|
52
57
|
* locale's new-chat label and therefore follows a locale switch. An archived item is
|
|
53
58
|
* still rendered (it gains `aparte-conv-item--archived`); filtering archived
|
|
@@ -59,22 +64,31 @@ export interface AparteConversationRenameDetail {
|
|
|
59
64
|
*
|
|
60
65
|
* @element aparte-conversation-list
|
|
61
66
|
* @attr {string} active-id - The id of the conversation to render as selected.
|
|
62
|
-
* @attr {boolean}
|
|
67
|
+
* @attr {boolean} flat - Render the rows flat, in host order, with no date headings.
|
|
68
|
+
* @attr {boolean} loading - The list is on its way: six skeleton rows stand where the rows will be, the
|
|
69
|
+
* element is `aria-busy` and a visually hidden line names the wait. A list that is
|
|
70
|
+
* not there yet is not an empty list. Set it while your store answers, clear it when
|
|
71
|
+
* you assign `conversations`.
|
|
72
|
+
* @attr {boolean} manage - Let the list finish the gesture: rename, pin, unpin, archive, unarchive and
|
|
73
|
+
* delete are performed on the conversation manager registered with
|
|
74
|
+
* `setConversationManager()`, instead of leaving you six listeners to write. The
|
|
75
|
+
* event still fires first, and `preventDefault()` on it takes the gesture back.
|
|
76
|
+
* Off by default, and selecting stays yours either way.
|
|
63
77
|
*
|
|
64
|
-
* @fires {CustomEvent<AparteConversationSelectDetail>} aparte-select
|
|
65
|
-
* @fires {CustomEvent<AparteConversationRenameDetail>} aparte-rename
|
|
66
|
-
* @fires {CustomEvent<AparteConversationPinDetail>} aparte-pin
|
|
67
|
-
* @fires {CustomEvent<AparteConversationPinDetail>} aparte-unpin
|
|
68
|
-
* @fires {CustomEvent<AparteConversationArchiveDetail>} aparte-archive
|
|
69
|
-
* @fires {CustomEvent<AparteConversationArchiveDetail>} aparte-unarchive
|
|
70
|
-
* @fires {CustomEvent<AparteConversationDeleteDetail>} aparte-delete
|
|
78
|
+
* @fires {CustomEvent<AparteConversationSelectDetail>} aparte-conversation-select - A row's title was activated; the host loads that conversation.
|
|
79
|
+
* @fires {CustomEvent<AparteConversationRenameDetail>} aparte-conversation-rename - A rename was committed with a new, non-empty title. Cancelable: `preventDefault()` takes the gesture back from `manage`.
|
|
80
|
+
* @fires {CustomEvent<AparteConversationPinDetail>} aparte-conversation-pin - The pin item was chosen on an unpinned row. Cancelable: `preventDefault()` takes the gesture back from `manage`.
|
|
81
|
+
* @fires {CustomEvent<AparteConversationPinDetail>} aparte-conversation-unpin - The same item on a pinned row; same detail shape, opposite intent. Cancelable, like the rest.
|
|
82
|
+
* @fires {CustomEvent<AparteConversationArchiveDetail>} aparte-conversation-archive - The archive item was chosen on a live conversation. Cancelable: `preventDefault()` takes the gesture back from `manage`.
|
|
83
|
+
* @fires {CustomEvent<AparteConversationArchiveDetail>} aparte-conversation-unarchive - The same item on an already-archived one; same detail shape, opposite intent. Cancelable, like the rest.
|
|
84
|
+
* @fires {CustomEvent<AparteConversationDeleteDetail>} aparte-conversation-delete - The delete was confirmed. Cancelable: `preventDefault()` takes the gesture back from `manage`.
|
|
71
85
|
*
|
|
72
86
|
* @cssprop [--aparte-conv-list-gap=var(--aparte-space-1)] - Vertical gap between rows, and between a group's heading and its rows.
|
|
73
87
|
* @cssprop [--aparte-conv-item-padding=var(--aparte-space-4) var(--aparte-space-5)] - Padding of a row's title button.
|
|
74
88
|
* @cssprop [--aparte-conv-item-gap=var(--aparte-space-3)] - Gap between a row's title and its `⋯` button.
|
|
75
89
|
* @cssprop [--aparte-conv-item-radius=var(--aparte-radius-md)] - Corner radius of a row.
|
|
76
90
|
* @cssprop [--aparte-conv-item-font-size=var(--aparte-font-size-md)] - Font size of a row's title.
|
|
77
|
-
* @cssprop [--aparte-conv-item-color=var(--aparte-text
|
|
91
|
+
* @cssprop [--aparte-conv-item-color=var(--aparte-text)] - Title colour of an inactive row.
|
|
78
92
|
* @cssprop [--aparte-conv-item-bg-hover=var(--aparte-surface-3)] - Row background on hover.
|
|
79
93
|
* @cssprop [--aparte-conv-item-bg-active=var(--aparte-surface-3)] - Background of the row matching `active-id`.
|
|
80
94
|
* @cssprop [--aparte-conv-item-color-active=var(--aparte-text)] - Title colour of the active row.
|
|
@@ -105,17 +119,44 @@ export interface AparteConversationRenameDetail {
|
|
|
105
119
|
* ];
|
|
106
120
|
* list.setAttribute('active-id', 'c1');
|
|
107
121
|
*
|
|
108
|
-
* list.addEventListener('aparte-select
|
|
109
|
-
* list.addEventListener('aparte-rename
|
|
110
|
-
* list.addEventListener('aparte-pin
|
|
111
|
-
* list.addEventListener('aparte-delete
|
|
122
|
+
* list.addEventListener('aparte-conversation-select', (e) => load(e.detail.id));
|
|
123
|
+
* list.addEventListener('aparte-conversation-rename', (e) => manager.updateTitle(e.detail.id, e.detail.title));
|
|
124
|
+
* list.addEventListener('aparte-conversation-pin', (e) => manager.pin(e.detail.id));
|
|
125
|
+
* list.addEventListener('aparte-conversation-delete', (e) => manager.delete(e.detail.id));
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* // Or let the list finish the gesture: register the manager once, add `manage`, and
|
|
129
|
+
* // rename / pin / archive / delete are carried out for you. The events still fire.
|
|
130
|
+
* aparteGlobalConfig.setConversationManager(manager);
|
|
131
|
+
* list.setAttribute('manage', '');
|
|
112
132
|
*/
|
|
113
133
|
export declare class AparteConversationList extends HTMLElement {
|
|
114
134
|
private _conversations;
|
|
115
135
|
private _activeId;
|
|
116
136
|
private _open;
|
|
117
137
|
private _renaming;
|
|
138
|
+
private _warnedNoManager;
|
|
118
139
|
static get observedAttributes(): string[];
|
|
140
|
+
/**
|
|
141
|
+
* The list is on its way: rows of the kit's skeleton stand where the rows will be,
|
|
142
|
+
* the element is `aria-busy`, and a visually hidden line names the wait. Reflected
|
|
143
|
+
* as the `loading` attribute, so a site sets it while its store answers and clears
|
|
144
|
+
* it when `conversations` is set. A list that is not there yet is not an empty list.
|
|
145
|
+
*/
|
|
146
|
+
get loading(): boolean;
|
|
147
|
+
set loading(value: boolean);
|
|
148
|
+
/**
|
|
149
|
+
* Let the list finish the gesture through the registered conversation manager.
|
|
150
|
+
* Reflected as the `manage` attribute.
|
|
151
|
+
*
|
|
152
|
+
* The property is not a nicety here: this is the attribute that authorises a WRITE,
|
|
153
|
+
* and Vue and both Sveltes stringify a bound `false` onto an element that has no
|
|
154
|
+
* property of that name — `manage="false"`, which `hasAttribute` reads as on. So
|
|
155
|
+
* turning management off turned it on, and a delete the host meant to handle itself
|
|
156
|
+
* was also done by the list. `presenceOn`, like `loading` above it.
|
|
157
|
+
*/
|
|
158
|
+
get manage(): boolean;
|
|
159
|
+
set manage(value: boolean);
|
|
119
160
|
connectedCallback(): void;
|
|
120
161
|
disconnectedCallback(): void;
|
|
121
162
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
@@ -134,13 +175,15 @@ export declare class AparteConversationList extends HTMLElement {
|
|
|
134
175
|
/**
|
|
135
176
|
* Pinned first, then the calendar buckets every chat product uses, then a heading
|
|
136
177
|
* per month (newest first), then whatever carries no date. Flat when nothing is
|
|
137
|
-
* dated or the host asked for `
|
|
178
|
+
* dated or the host asked for `flat`: a heading over the only group would say
|
|
138
179
|
* nothing.
|
|
139
180
|
*/
|
|
140
181
|
private _groups;
|
|
141
182
|
private _renderGroup;
|
|
142
183
|
private _renderItem;
|
|
143
184
|
private _menuMarkup;
|
|
185
|
+
/** The question the confirm step asks — the popover's accessible name while it asks it. */
|
|
186
|
+
private _confirmQuestion;
|
|
144
187
|
private _confirmMarkup;
|
|
145
188
|
private _openMenu;
|
|
146
189
|
/**
|
|
@@ -152,9 +195,31 @@ export declare class AparteConversationList extends HTMLElement {
|
|
|
152
195
|
*/
|
|
153
196
|
private _placeMenu;
|
|
154
197
|
private _closeMenu;
|
|
198
|
+
/**
|
|
199
|
+
* A pointer is down inside the open menu. WebKit does not move the focus to a
|
|
200
|
+
* button on mousedown: the element that held it is blurred instead — `focusout`
|
|
201
|
+
* with no `relatedTarget` — before the click reaches the item. `_onFocusOut` used
|
|
202
|
+
* to read that as the focus leaving the menu and close it on the press, so with a
|
|
203
|
+
* mouse no item could be chosen at all. Held from the press to its release.
|
|
204
|
+
*/
|
|
205
|
+
private _pressInMenu;
|
|
206
|
+
private _onDocumentPointerUp;
|
|
155
207
|
private _onDocumentPointerDown;
|
|
156
208
|
private _onWindowScroll;
|
|
157
209
|
private _onFocusOut;
|
|
210
|
+
/**
|
|
211
|
+
* The gesture, finished. The event has already gone out — cancelable, so a host
|
|
212
|
+
* that wants the write for itself calls `preventDefault()` and this stands down —
|
|
213
|
+
* and what is left is the registered conversation manager doing it. Without
|
|
214
|
+
* `manage` the element behaves exactly as it did before the attribute existed.
|
|
215
|
+
*
|
|
216
|
+
* A `manage` with no manager registered is a menu that does nothing, so the first
|
|
217
|
+
* gesture says so and names the call that fixes it. Said here rather than at
|
|
218
|
+
* `connectedCallback` because a list in the page's HTML connects before the script
|
|
219
|
+
* that registers the manager runs: a warning at connect would fire on a setup that
|
|
220
|
+
* is perfectly correct one tick later.
|
|
221
|
+
*/
|
|
222
|
+
private _manage;
|
|
158
223
|
private _onMenuAction;
|
|
159
224
|
private _menuFocusables;
|
|
160
225
|
private _onMenuKeydown;
|