@aparte/core 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/dist/client/aparte-client.d.ts +54 -33
- package/dist/client/aparte-client.d.ts.map +1 -1
- package/dist/client/stream-adapter.d.ts +6 -1
- package/dist/client/stream-adapter.d.ts.map +1 -1
- package/dist/components/bubble/aparte-chat-bubble.d.ts +49 -7
- package/dist/components/bubble/aparte-chat-bubble.d.ts.map +1 -1
- package/dist/components/chat/aparte-chat.d.ts +8 -4
- package/dist/components/chat/aparte-chat.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer-action.d.ts +5 -5
- package/dist/components/composer/aparte-composer-action.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer-add-attachment.d.ts +16 -4
- package/dist/components/composer/aparte-composer-add-attachment.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer-attachments.d.ts +5 -3
- package/dist/components/composer/aparte-composer-attachments.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer-cancel.d.ts +10 -2
- package/dist/components/composer/aparte-composer-cancel.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer-input.d.ts +8 -5
- package/dist/components/composer/aparte-composer-input.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer-send.d.ts +34 -2
- package/dist/components/composer/aparte-composer-send.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer-toolbar.d.ts +3 -3
- package/dist/components/composer/aparte-composer.d.ts +54 -10
- package/dist/components/composer/aparte-composer.d.ts.map +1 -1
- package/dist/components/conversation-list/aparte-conversation-list.d.ts +19 -12
- package/dist/components/conversation-list/aparte-conversation-list.d.ts.map +1 -1
- package/dist/components/elicitation/aparte-elicitation.d.ts +22 -0
- package/dist/components/elicitation/aparte-elicitation.d.ts.map +1 -1
- package/dist/components/status/aparte-chat-status.d.ts +9 -0
- package/dist/components/status/aparte-chat-status.d.ts.map +1 -1
- package/dist/components/viewport/aparte-chat-viewport.d.ts +18 -5
- package/dist/components/viewport/aparte-chat-viewport.d.ts.map +1 -1
- package/dist/config/aparte-config.d.ts +54 -2
- package/dist/config/aparte-config.d.ts.map +1 -1
- package/dist/config/config-subscribe.d.ts +4 -0
- package/dist/config/config-subscribe.d.ts.map +1 -0
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/locale.d.ts +141 -0
- package/dist/config/locale.d.ts.map +1 -1
- package/dist/config/sanitize.d.ts.map +1 -1
- package/dist/custom-elements.json +5905 -4694
- package/dist/elicitation/approval-panel.d.ts +42 -0
- package/dist/elicitation/approval-panel.d.ts.map +1 -0
- package/dist/elicitation/index.d.ts +4 -1
- package/dist/elicitation/index.d.ts.map +1 -1
- package/dist/elicitation/panel.d.ts +14 -1
- package/dist/elicitation/panel.d.ts.map +1 -1
- package/dist/elicitation/types.d.ts +116 -9
- package/dist/elicitation/types.d.ts.map +1 -1
- package/dist/generated/element-attributes.d.ts +173 -0
- package/dist/generated/element-attributes.d.ts.map +1 -0
- package/dist/host/aparte-chat-host.d.ts +3 -1
- package/dist/host/aparte-chat-host.d.ts.map +1 -1
- package/dist/index.css +752 -392
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +538 -290
- package/dist/index.js.map +1 -1
- package/dist/index.node.d.ts +5 -4
- package/dist/index.node.d.ts.map +1 -1
- package/dist/index.node.js +62 -57
- package/dist/index.node.js.map +1 -1
- package/dist/interop/element-props.d.ts +26 -1
- package/dist/interop/element-props.d.ts.map +1 -1
- package/dist/{index-hQQljwfX.js → is-awaiting-reply-Cb7H3YfN.js} +1159 -972
- package/dist/is-awaiting-reply-Cb7H3YfN.js.map +1 -0
- package/dist/parsers/aparte-stream-parser.d.ts.map +1 -1
- package/dist/primitives/select/aparte-optgroup.d.ts +3 -0
- package/dist/primitives/select/aparte-optgroup.d.ts.map +1 -1
- package/dist/primitives/select/aparte-option.d.ts +1 -0
- package/dist/primitives/select/aparte-option.d.ts.map +1 -1
- package/dist/primitives/select/aparte-select.d.ts +22 -18
- package/dist/primitives/select/aparte-select.d.ts.map +1 -1
- package/dist/renderers/highlight-stream.d.ts +17 -0
- package/dist/renderers/highlight-stream.d.ts.map +1 -0
- package/dist/renderers/segment-renderers.d.ts.map +1 -1
- package/dist/renderers/segments/artifact/binary-file.d.ts.map +1 -1
- package/dist/renderers/segments/artifact/card.d.ts.map +1 -1
- package/dist/renderers/segments/artifact/shared.d.ts +19 -2
- package/dist/renderers/segments/artifact/shared.d.ts.map +1 -1
- package/dist/renderers/segments/code.d.ts.map +1 -1
- package/dist/renderers/segments/error.d.ts.map +1 -1
- package/dist/renderers/segments/pipeline-waiting.d.ts.map +1 -1
- package/dist/renderers/segments/thinking.d.ts.map +1 -1
- package/dist/renderers/segments/tool-call.d.ts.map +1 -1
- package/dist/types/element-attributes.d.ts +42 -0
- package/dist/types/element-attributes.d.ts.map +1 -0
- package/dist/types/event-map.d.ts +2 -4
- package/dist/types/event-map.d.ts.map +1 -1
- package/dist/types/events.d.ts +0 -22
- package/dist/types/events.d.ts.map +1 -1
- package/dist/types/index.d.ts +4 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/models.d.ts +1 -6
- package/dist/types/models.d.ts.map +1 -1
- package/dist/types/segments.d.ts +87 -74
- package/dist/types/segments.d.ts.map +1 -1
- package/dist/types/tools.d.ts +15 -21
- package/dist/types/tools.d.ts.map +1 -1
- package/dist/utils/segments.d.ts +83 -5
- package/dist/utils/segments.d.ts.map +1 -1
- package/package.json +3 -2
- package/dist/index-hQQljwfX.js.map +0 -1
- package/dist/renderers/segments/file-tree.d.ts +0 -3
- package/dist/renderers/segments/file-tree.d.ts.map +0 -1
- package/dist/renderers/segments/progress.d.ts +0 -3
- package/dist/renderers/segments/progress.d.ts.map +0 -1
- package/dist/renderers/segments/terminal.d.ts +0 -3
- package/dist/renderers/segments/terminal.d.ts.map +0 -1
|
@@ -5,10 +5,27 @@ import { AparteChatRequest, AparteChatMessage } from '../types/chat.js';
|
|
|
5
5
|
/**
|
|
6
6
|
* Resolves a human-in-the-loop tool approval for a `needsApproval` tool call.
|
|
7
7
|
* Resolves `{ approved, payload? }`; the `signal` aborts a pending decision.
|
|
8
|
+
*
|
|
9
|
+
* It receives the CALL, not just its id. You cannot ask a person "run this?" without
|
|
10
|
+
* naming what — the built-in channel needs the tool's name for its question, and an
|
|
11
|
+
* id alone forced a lookup table filled by one event and read by another, which is the
|
|
12
|
+
* shape that breaks in silence.
|
|
8
13
|
*/
|
|
9
|
-
export type AparteToolApprovalResolver = (
|
|
14
|
+
export type AparteToolApprovalResolver = (call: {
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
input: Record<string, unknown>;
|
|
18
|
+
}, signal: AbortSignal) => Promise<{
|
|
10
19
|
approved: boolean;
|
|
11
20
|
payload?: unknown;
|
|
21
|
+
/**
|
|
22
|
+
* What the user said to do instead, on a refusal.
|
|
23
|
+
*
|
|
24
|
+
* It becomes the tool_result the model reads, which is possible at all only
|
|
25
|
+
* because a refusal now hands the model a turn. Optional and additive: a resolver
|
|
26
|
+
* that returns a bare `{ approved }` behaves exactly as before.
|
|
27
|
+
*/
|
|
28
|
+
instruction?: string;
|
|
12
29
|
}>;
|
|
13
30
|
/**
|
|
14
31
|
* Decides how a conversation is compacted: which messages are summarized away
|
|
@@ -35,10 +52,12 @@ export interface AparteClientOptions {
|
|
|
35
52
|
keyResolver?: (providerId: string) => string | Record<string, string> | Promise<string | Record<string, string> | undefined | null> | undefined | null;
|
|
36
53
|
/**
|
|
37
54
|
* Custom human-in-the-loop approval resolver for tools marked
|
|
38
|
-
* `needsApproval`.
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* (CLI / webhook) with no DOM.
|
|
55
|
+
* `needsApproval`. Without one, the gate asks at the composer through
|
|
56
|
+
* `requestUserInput`, like every other request for the user. Inject this to
|
|
57
|
+
* decide from the call itself — it receives `(call, signal)` — or to drive
|
|
58
|
+
* approval from a headless source (CLI / webhook) with no DOM.
|
|
59
|
+
*
|
|
60
|
+
* It may return an `instruction`, which the model reads as part of the refusal.
|
|
42
61
|
*/
|
|
43
62
|
approvalResolver?: AparteToolApprovalResolver;
|
|
44
63
|
/**
|
|
@@ -201,37 +220,28 @@ export declare class AparteClient {
|
|
|
201
220
|
*/
|
|
202
221
|
abort(): void;
|
|
203
222
|
/**
|
|
204
|
-
*
|
|
205
|
-
* tool call (dispatched by the built-in Approve/Reject UI or an app-level
|
|
206
|
-
* approval surface). Resolves `{ approved, payload }` — `approved` is `true`
|
|
207
|
-
* only on an explicit approve, and `payload` carries any arbitrary data a
|
|
208
|
-
* custom approval UI attached to the decision (the built-in gate sends
|
|
209
|
-
* none). The `signal` (an AbortController registered in
|
|
210
|
-
* `_activeToolControllers`) lets `abort()` cleanly resolve a pending
|
|
211
|
-
* approval to `{ approved: false }` — there is no timeout, since a human may
|
|
212
|
-
* take any amount of time to decide.
|
|
213
|
-
*/
|
|
214
|
-
/**
|
|
215
|
-
* Await the human's Approve/Reject for one tool call.
|
|
223
|
+
* Ask the human at the COMPOSER, and report what they decided.
|
|
216
224
|
*
|
|
217
|
-
*
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
* executed action came apart, which is the entire failure mode an approval gate
|
|
224
|
-
* exists to prevent — and the handler behind it is arbitrary consumer code.
|
|
225
|
+
* The default channel, replacing a `document` listener for `aparte-tool-decision`
|
|
226
|
+
* that existed only because the buttons lived in a segment renderer with no
|
|
227
|
+
* reference to this client. Routing through `requestUserInput` puts the decision
|
|
228
|
+
* where every other request for the user already goes, which is the whole point:
|
|
229
|
+
* one queue, one panel slot, one teardown, and the same behaviour whether the
|
|
230
|
+
* request came from a tool handler or from this gate.
|
|
225
231
|
*
|
|
226
|
-
* The
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
* button keeps working as long as it fires from inside its own chat.
|
|
232
|
+
* The tool NAME is the question; the arguments stay in the transcript, on the pill
|
|
233
|
+
* this request is anchored to. A panel capped at 50vh cannot hold a diff or a plan,
|
|
234
|
+
* and the transcript is already scrollable, copyable and persisted.
|
|
230
235
|
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
236
|
+
* `aparte-tool-decision` is GONE with the buttons that dispatched it, and so is the
|
|
237
|
+
* `document` listener that answered it. It existed only because a segment renderer
|
|
238
|
+
* has no reference to this client; two seams that can disagree about who answers a
|
|
239
|
+
* decision are one seam too many, and the ratified elicitation rule already said so
|
|
240
|
+
* — "a typed presenter registered per config instance, never window events". A host
|
|
241
|
+
* that wants to answer programmatically registers an `approvalResolver` (headless,
|
|
242
|
+
* no DOM) or its own presenter, both strictly more capable than an id on an event.
|
|
233
243
|
*/
|
|
234
|
-
private
|
|
244
|
+
private _askForApproval;
|
|
235
245
|
/**
|
|
236
246
|
* Resolve the auth for a provider: `options.keyResolver` takes precedence,
|
|
237
247
|
* then the aparteGlobalConfig key channel (`setKeyProvider`) so a key registered
|
|
@@ -381,12 +391,23 @@ export declare class AparteClient {
|
|
|
381
391
|
* or aborted). Extracted from `_streamLoop`. `messages` is mutated in place.
|
|
382
392
|
*/
|
|
383
393
|
private _maybeRunSyntheticTool;
|
|
394
|
+
/**
|
|
395
|
+
* What the loop does after one tool call. THREE outcomes, because a boolean
|
|
396
|
+
* conflated two questions that a refusal answers differently.
|
|
397
|
+
*
|
|
398
|
+
* - `'continue'` — run the next tool call of this turn.
|
|
399
|
+
* - `'respond'` — skip this turn's remaining calls, then take another turn so the
|
|
400
|
+
* model reads what happened. A human refusal: the model asked for
|
|
401
|
+
* several calls and refusing one cannot license the others, but a
|
|
402
|
+
* refusal it never reads is one the user has to retype as a message.
|
|
403
|
+
* - `'halt'` — the run is over: an abort, a turn limit, a missing handler.
|
|
404
|
+
*/
|
|
384
405
|
/**
|
|
385
406
|
* Handle one `tool_use` stream event from {@link _streamLoop}: the built-in
|
|
386
407
|
* `create_artifact`, per-tool renderer selection, the human-in-the-loop
|
|
387
408
|
* approval gate, and running the registered handler (timeout / abort).
|
|
388
409
|
* Mutates the shared `messages` / `toolCallsThisTurn` history in place and
|
|
389
|
-
* returns
|
|
410
|
+
* returns what the loop should do next.
|
|
390
411
|
*/
|
|
391
412
|
private _handleToolUseEvent;
|
|
392
413
|
/**
|
|
@@ -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;AAS9E,OAAO,KAAK,EAAE,kBAAkB,EAAuB,MAAM,qBAAqB,CAAC;AACnF,OAAO,KAAK,EAAoC,aAAa,EAAsB,MAAM,mBAAmB,CAAC;AAK7G,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAoE,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;AAS9E,OAAO,KAAK,EAAE,kBAAkB,EAAuB,MAAM,qBAAqB,CAAC;AACnF,OAAO,KAAK,EAAoC,aAAa,EAAsB,MAAM,mBAAmB,CAAC;AAK7G,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAoE,MAAM,kBAAkB,CAAC;AAqC1I;;;;;;;;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,OAAO,CAAC;IACT,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;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MG;IACH,OAAO,CAAC,eAAe;IAUvB;;OAEG;IACH,OAAO,CAAC,uBAAuB;YAYjB,WAAW;IA0JzB;;OAEG;IACH,OAAO,CAAC,cAAc;IAyBtB,OAAO,CAAC,kBAAkB;IA2B1B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,OAAO,CAAC,YAAY;IAOpB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,eAAe;IAoBvB;;;;;;;OAOG;IACH,OAAO,CAAC,oBAAoB;IAS5B;;;;;;OAMG;YACW,oBAAoB;IAsClC;;;;;;;OAOG;YACW,sBAAsB;IAiEpC;;;;;;;;;;OAUG;IACH;;;;;;OAMG;YACW,mBAAmB;IAuQjC;;;OAGG;YACW,WAAW;IAmezB;;;;;;;;OAQG;YACW,mBAAmB;IA6EjC;;OAEG;IACH,OAAO,CAAC,cAAc;IAMtB;;OAEG;IACH,OAAO,CAAC,qBAAqB;IA8C7B,4EAA4E;IAC5E,OAAO,CAAC,oBAAoB,CAAqB;IACjD,OAAO,CAAC,uBAAuB;CAUlC"}
|
|
@@ -126,9 +126,14 @@ export interface AparteStreamRunOptions {
|
|
|
126
126
|
needsApproval?: boolean;
|
|
127
127
|
} | undefined;
|
|
128
128
|
/** HITL approval resolver for `needsApproval` tools. */
|
|
129
|
-
approvalResolver?: (
|
|
129
|
+
approvalResolver?: (call: {
|
|
130
|
+
id: string;
|
|
131
|
+
name: string;
|
|
132
|
+
input: Record<string, unknown>;
|
|
133
|
+
}, signal: AbortSignal) => Promise<{
|
|
130
134
|
approved: boolean;
|
|
131
135
|
payload?: unknown;
|
|
136
|
+
instruction?: string;
|
|
132
137
|
}>;
|
|
133
138
|
/** The DOM adapter (from {@link createStreamAdapter}). */
|
|
134
139
|
emitter: AparteStreamRunEmitter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream-adapter.d.ts","sourceRoot":"","sources":["../../src/client/stream-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;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I,CAAC;IAChD,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC;CACxC;AAED,MAAM,WAAW,0BAA0B;IACvC,4DAA4D;IAC5D,MAAM,EAAE,mBAAmB,CAAC;IAC5B,kEAAkE;IAClE,MAAM,EAAE,YAAY,CAAC;IACrB,0EAA0E;IAC1E,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,YAAY,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CACrD;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,0BAA0B,GAAG,sBAAsB,CA6S5F;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACnC,MAAM,EAAE,cAAc,CAAC,iBAAiB,CAAC,EACzC,MAAM,EAAE,WAAW,GACpB,aAAa,CAAC,iBAAiB,CAAC,CA4BlC"}
|
|
@@ -1,10 +1,31 @@
|
|
|
1
1
|
import type { AparteSegment, AparteAttachment, AparteUsage, AparteMessage } from '../../types/index.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* One message: plain content or a list of rich segments, in light DOM.
|
|
4
|
+
*
|
|
5
|
+
* All seven events are declared by hand rather than left to the analyser, which
|
|
6
|
+
* found six. `aparte-branch-navigate` is dispatched from the `_onBranchPickerClick`
|
|
7
|
+
* arrow class field, and the auto-detection visits `ts.isMethodDeclaration` only —
|
|
8
|
+
* so the one event belonging to the branch picker was the one missing from the
|
|
9
|
+
* manifest, and from the generated reference, for as long as both existed.
|
|
10
|
+
*
|
|
11
|
+
* @element aparte-chat-bubble
|
|
12
|
+
*
|
|
13
|
+
* @attr {string} role - The message role. `data-role` is the styled mirror of it.
|
|
14
|
+
* @attr {string} data-role - `user` / `assistant` / `system`; what the CSS keys off.
|
|
15
|
+
* @attr {string} content - Plain text content, for a bubble with no segments.
|
|
16
|
+
* @attr {number | string} timestamp - Epoch milliseconds OR a date string: `_updateTimestamp` accepts either and only coerces when the value is numeric.
|
|
17
|
+
* @attr {string} message-id - How streaming and the action bar address this bubble.
|
|
18
|
+
* @attr {boolean} streaming - Hides the action bar and shows the caret while a reply is in flight.
|
|
19
|
+
* @attr {string} name - The display name in the header.
|
|
20
|
+
*
|
|
21
|
+
* @fires {CustomEvent<AparteActionEventDetail>} aparte-action - A custom action-bar button was pressed.
|
|
22
|
+
* @fires {CustomEvent<AparteRetryEventDetail>} aparte-retry - Retry was pressed; the host forks the turn.
|
|
23
|
+
* @fires {CustomEvent<AparteEditEventDetail>} aparte-edit - An edit was saved.
|
|
24
|
+
* @fires {CustomEvent<AparteFeedbackEventDetail>} aparte-feedback - Thumbs up or down.
|
|
25
|
+
* @fires {CustomEvent<AparteMessageInfoEventDetail>} aparte-message-info - The info affordance was pressed.
|
|
26
|
+
* @fires {CustomEvent<AparteBranchNavigateEventDetail>} aparte-branch-navigate - The `‹1/2›` picker moved between sibling versions.
|
|
27
|
+
* @fires {CustomEvent<AparteAttachmentPreviewEventDetail>} aparte-attachment-preview - An attached image was clicked, asking the app to open it full-size.
|
|
4
28
|
*
|
|
5
|
-
* Message component supporting both simple content and rich segments.
|
|
6
|
-
* Uses Light DOM for global CSS styling.
|
|
7
|
-
*
|
|
8
29
|
* @example
|
|
9
30
|
* <!-- Rendered for you by the viewport. Written by hand only when you drive the DOM
|
|
10
31
|
* yourself: `message-id` is what streaming and the action bar address it by. -->
|
|
@@ -44,6 +65,23 @@ export declare class AparteChatBubble extends HTMLElement {
|
|
|
44
65
|
static get observedAttributes(): string[];
|
|
45
66
|
constructor();
|
|
46
67
|
private _onConfigChange;
|
|
68
|
+
/**
|
|
69
|
+
* Ask every rendered segment to re-read its config-derived text.
|
|
70
|
+
*
|
|
71
|
+
* Not `_renderSegments()`, which wipes the container and rebuilds: that destroys a
|
|
72
|
+
* mounted artifact preview, reverts a reasoning block the reader expanded by
|
|
73
|
+
* clicking `<summary>` (the DOM's real state is never written back to `collapsed`),
|
|
74
|
+
* resets scroll inside long terminal panes, drops focus from an Approve/Reject
|
|
75
|
+
* gate, and throws away the incremental Markdown parser's buffered lookahead
|
|
76
|
+
* mid-stream — for a change that added no content. It also fires container-wide
|
|
77
|
+
* childList mutations, which is what the viewport's observer reads as "scroll to
|
|
78
|
+
* the bottom".
|
|
79
|
+
*
|
|
80
|
+
* `relabel` is the narrow alternative, bound by the same no-child-node rule as
|
|
81
|
+
* `update()`. A renderer that has no config-derived text does not implement it,
|
|
82
|
+
* and this loop simply skips it.
|
|
83
|
+
*/
|
|
84
|
+
private _relabelSegments;
|
|
47
85
|
/**
|
|
48
86
|
* Re-apply the locale strings written straight into the markup by `_render()` —
|
|
49
87
|
* the accessible names a screen reader reads, which nothing else refreshes.
|
|
@@ -132,9 +170,13 @@ export declare class AparteChatBubble extends HTMLElement {
|
|
|
132
170
|
*/
|
|
133
171
|
private _updateWaiting;
|
|
134
172
|
/**
|
|
135
|
-
* Hand the avatar host element off to the registered AvatarProvider, if
|
|
136
|
-
*
|
|
137
|
-
*
|
|
173
|
+
* Hand the avatar host element off to the registered AvatarProvider, if any.
|
|
174
|
+
*
|
|
175
|
+
* With no provider the slot is left exactly as the shell rendered it — which for
|
|
176
|
+
* the default shell means EMPTY, and hidden by `.aparte-avatar:empty`. This used
|
|
177
|
+
* to claim it "falls back to the default initial rendered by `_render()`"; there
|
|
178
|
+
* is no such initial, and believing there was is what made `_updateRole` write
|
|
179
|
+
* one.
|
|
138
180
|
*/
|
|
139
181
|
private _renderAvatar;
|
|
140
182
|
private _updateRole;
|
|
@@ -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,EAOhB,WAAW,EACX,aAAa,EACd,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"aparte-chat-bubble.d.ts","sourceR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rB,OAAO,CAAC,WAAW;IA0BnB,OAAO,CAAC,WAAW;IA6BnB,OAAO,CAAC,cAAc;IAqBtB;;;;;;OAMG;IACH,OAAO,CAAC,qBAAqB;IAoB7B,OAAO,CAAC,eAAe;IA+BvB;;;;;;OAMG;IACH,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,gBAAgB;IAoBxB,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,kBAAkB;IA6D1B,0EAA0E;IAC1E,OAAO,CAAC,QAAQ;IAShB;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,CAAC,oBAAoB,CAc1B;IAEF,OAAO,CAAC,mBAAmB;IAiC3B,OAAO,CAAC,gBAAgB;IAuDxB;;;;;;OAMG;IACH,OAAO,CAAC,qBAAqB;IAQ7B,0EAA0E;IAC1E,OAAO,CAAC,oBAAoB;IAoB5B,iGAAiG;IACjG,OAAO,CAAC,iBAAiB;IAsCzB,wEAAwE;IACxE,OAAO,CAAC,kBAAkB;IAiB1B,OAAO,CAAC,kBAAkB;IAgG1B;;;;;;;;;OASG;IACH,OAAO,CAAC,cAAc;IA8BtB;;;;OAIG;IACH,OAAO,CAAC,aAAa;IA4BrB,OAAO,CAAC,gBAAgB;IAuBxB,OAAO,CAAC,gBAAgB;CAsBzB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AparteChatViewport } from '../viewport/aparte-chat-viewport.js';
|
|
2
2
|
import type { AparteComposer } from '../composer/aparte-composer.js';
|
|
3
|
+
import '../elicitation/aparte-elicitation.js';
|
|
3
4
|
/**
|
|
4
5
|
* AparteChat - The Shell
|
|
5
6
|
*
|
|
@@ -19,10 +20,13 @@ import type { AparteComposer } from '../composer/aparte-composer.js';
|
|
|
19
20
|
* Size the element via CSS (a height, or let it fill a sized parent).
|
|
20
21
|
*
|
|
21
22
|
* @element aparte-chat
|
|
22
|
-
* @attr placeholder
|
|
23
|
-
* @attr disabled
|
|
24
|
-
* @attr center-empty - Center the composer as a welcome state until the first message, then slide to the normal layout
|
|
25
|
-
* @attr
|
|
23
|
+
* @attr {string} placeholder - Placeholder for the composer input (default composition)
|
|
24
|
+
* @attr {boolean} disabled - Disables the composer
|
|
25
|
+
* @attr {boolean} center-empty - Center the composer as a welcome state until the first message, then slide to the normal layout
|
|
26
|
+
* @attr {boolean} framework-managed - The wrapper's explicit hands-off signal: set it and this
|
|
27
|
+
* element composes none of its own children, because the framework owns them. All four
|
|
28
|
+
* wrappers set it; it was read by this element and declared by nothing until now.
|
|
29
|
+
* @attr {boolean} attachments - Add the file picker + chips strip to the default composition (opt-in: the host must consume the files — an `AparteClient` does, a hand-rolled loop must read `event.detail.files`)
|
|
26
30
|
*
|
|
27
31
|
* @example
|
|
28
32
|
* <!-- Left empty it fills in a viewport, an input and a send button. -->
|
|
@@ -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;
|
|
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;AAG9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,qBAAa,UAAW,SAAQ,WAAW;IACzC,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,OAAO,CAAC,SAAS,CAAiC;IAElD;;;;OAIG;IACH,OAAO,CAAC,UAAU,CAAS;IAE3B,iBAAiB,IAAI,IAAI;IAOzB,oBAAoB,IAAI,IAAI;IAK5B,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAmB9F,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,yEAAyE;IACzE,OAAO,CAAC,eAAe;IAkBvB,OAAO,CAAC,YAAY;CAMrB"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { AparteComposer } from './aparte-composer.js';
|
|
2
2
|
/**
|
|
3
|
-
* @element aparte-composer-action
|
|
4
|
-
*
|
|
5
3
|
* Generic action button primitive for <aparte-composer>.
|
|
4
|
+
*
|
|
5
|
+
* @element aparte-composer-action
|
|
6
6
|
* The consumer declares it directly in markup — no global registration needed.
|
|
7
7
|
*
|
|
8
|
-
* @attr icon
|
|
9
|
-
* @attr label
|
|
10
|
-
* @attr disabled
|
|
8
|
+
* @attr {string} icon - Icon key for aparteGlobalConfig.getIcon(), or raw SVG/HTML starting with `<`
|
|
9
|
+
* @attr {string} label - Accessible label (also used as tooltip)
|
|
10
|
+
* @attr {boolean} disabled - Disables the button
|
|
11
11
|
*
|
|
12
12
|
* @fires aparte-action-click - Bubbles up when the button is clicked
|
|
13
13
|
* detail: { actionId: string, composer: AparteComposer | null }
|
|
@@ -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;
|
|
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;;;;;;;;;;;;;;;;;;;GAmBG;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;IAazB,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;IAsBf,OAAO,CAAC,cAAc;IAgBtB,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,YAAY;CAOvB;AAMD;;;;;;;;;GASG;AACH,MAAM,WAAW,4BAA4B;IACzC,yEAAyE;IACzE,QAAQ,EAAE,MAAM,CAAC;IACjB,0EAA0E;IAC1E,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;CACnC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @element aparte-composer-add-attachment
|
|
3
|
-
*
|
|
4
2
|
* File picker button for <aparte-composer>.
|
|
3
|
+
*
|
|
4
|
+
* @element aparte-composer-add-attachment
|
|
5
5
|
* Opens a native file picker on click, then pushes picked files to root.addAttachments().
|
|
6
6
|
* Also sets up drag & drop on the nearest <aparte-composer> root.
|
|
7
7
|
*
|
|
8
|
-
* @attr accept
|
|
9
|
-
* @attr multiple
|
|
8
|
+
* @attr {string} accept - MIME types / extensions passed to the file input (e.g. "image/*,.pdf")
|
|
9
|
+
* @attr {boolean} multiple - Allow multiple file selection (default: true)
|
|
10
|
+
* @attr {boolean} disabled - Greys out the picker and ignores drops.
|
|
10
11
|
*
|
|
11
12
|
* @example
|
|
12
13
|
* <!-- Opt-in: nothing consumes the files unless your host does (an AparteClient, or
|
|
@@ -29,6 +30,17 @@ export declare class AparteComposerAddAttachment extends HTMLElement {
|
|
|
29
30
|
disconnectedCallback(): void;
|
|
30
31
|
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
|
31
32
|
private _getRoot;
|
|
33
|
+
/**
|
|
34
|
+
* Re-read the label and the icon on the button that already exists.
|
|
35
|
+
*
|
|
36
|
+
* Deliberately not a re-render: `_render()` returns early once the button is
|
|
37
|
+
* there, and its `disabled` computation ignores `root.streaming` while the
|
|
38
|
+
* streaming listener sets `disabled` directly — so rebuilding would silently
|
|
39
|
+
* re-enable the attach button mid-turn, and drop focus if the user were on it.
|
|
40
|
+
* The native file input and the drag listeners live outside this element
|
|
41
|
+
* (on `document.body` and on the composer root), so they are untouched either way.
|
|
42
|
+
*/
|
|
43
|
+
private _refreshChrome;
|
|
32
44
|
private _render;
|
|
33
45
|
private _connectToRoot;
|
|
34
46
|
private _handleClick;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aparte-composer-add-attachment.d.ts","sourceRoot":"","sources":["../../../src/components/composer/aparte-composer-add-attachment.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"aparte-composer-add-attachment.d.ts","sourceRoot":"","sources":["../../../src/components/composer/aparte-composer-add-attachment.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,2BAA4B,SAAQ,WAAW;IACxD,OAAO,CAAC,OAAO,CAAkC;IACjD,OAAO,CAAC,YAAY,CAA6B;IACjD,OAAO,CAAC,aAAa,CAAsB;IAG3C,OAAO,CAAC,QAAQ,CAAgC;IAEhD,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,iBAAiB,IAAI,IAAI;IAOzB,oBAAoB,IAAI,IAAI;IAO5B,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAQvF,OAAO,CAAC,QAAQ;IAIhB;;;;;;;;;OASG;IACH,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,OAAO;IAmBf,OAAO,CAAC,cAAc;IAgBtB,OAAO,CAAC,YAAY;IAgBpB,OAAO,CAAC,cAAc;IA8BtB,OAAO,CAAC,YAAY;CAGvB"}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @element aparte-composer-attachments
|
|
3
|
-
*
|
|
4
2
|
* Renders a square thumbnail tile for each file attached to the root composer.
|
|
3
|
+
*
|
|
4
|
+
* @element aparte-composer-attachments
|
|
5
5
|
* Image files show the actual picture; other files show an extension badge.
|
|
6
6
|
* The filename and a remove (✗) button surface on hover. Clicking an image asks
|
|
7
7
|
* the app to open it full-size (`aparte-attachment-preview`) — only when the app
|
|
8
8
|
* declared `attachmentPreview` via `aparteGlobalConfig.setHostHandlers()`.
|
|
9
9
|
* Automatically hidden when there are no attachments.
|
|
10
10
|
* Must be a descendant of <aparte-composer>.
|
|
11
|
-
|
|
11
|
+
*
|
|
12
|
+
* @fires {CustomEvent<AparteAttachmentPreviewEventDetail>} aparte-attachment-preview - An attached image was clicked; the app opens it full-size, and only if it declared `attachmentPreview`.
|
|
13
|
+
*
|
|
12
14
|
* @example
|
|
13
15
|
* <!-- The strip hides itself while nothing is attached. Pair it with the picker, and
|
|
14
16
|
* only if your loop actually reads the files from the send event. -->
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aparte-composer-attachments.d.ts","sourceRoot":"","sources":["../../../src/components/composer/aparte-composer-attachments.ts"],"names":[],"mappings":"AAUA
|
|
1
|
+
{"version":3,"file":"aparte-composer-attachments.d.ts","sourceRoot":"","sources":["../../../src/components/composer/aparte-composer-attachments.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,yBAA0B,SAAQ,WAAW;IACtD,OAAO,CAAC,aAAa,CAAsB;IAC3C,+EAA+E;IAC/E,OAAO,CAAC,WAAW,CAAgB;IAEnC,iBAAiB,IAAI,IAAI;IAKzB,oBAAoB,IAAI,IAAI;IAQ5B,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,cAAc;IAYtB,kEAAkE;IAClE,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,OAAO;IA0Df,0EAA0E;IAC1E,OAAO,CAAC,IAAI;IAKZ,OAAO,CAAC,OAAO;CAGlB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @element aparte-composer-cancel
|
|
3
|
-
*
|
|
4
2
|
* Cancel/stop streaming button primitive for <aparte-composer>.
|
|
3
|
+
*
|
|
4
|
+
* @element aparte-composer-cancel
|
|
5
5
|
* Must be a descendant of <aparte-composer>.
|
|
6
6
|
*
|
|
7
7
|
* Hidden when not streaming. Visible only during active streaming.
|
|
@@ -27,6 +27,14 @@ export declare class AparteComposerCancel extends HTMLElement {
|
|
|
27
27
|
private _render;
|
|
28
28
|
private _connectToRoot;
|
|
29
29
|
private _handleClick;
|
|
30
|
+
/**
|
|
31
|
+
* Re-read the accessible name and the icon in place.
|
|
32
|
+
*
|
|
33
|
+
* `hidden` is NOT touched: `_render()` always renders this button hidden and only
|
|
34
|
+
* the root's `streaming-change` listener ever un-hides it, so a rebuild would make
|
|
35
|
+
* the stop button vanish in the middle of a turn.
|
|
36
|
+
*/
|
|
37
|
+
private _refreshChrome;
|
|
30
38
|
private _getStopIcon;
|
|
31
39
|
}
|
|
32
40
|
//# sourceMappingURL=aparte-composer-cancel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aparte-composer-cancel.d.ts","sourceRoot":"","sources":["../../../src/components/composer/aparte-composer-cancel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"aparte-composer-cancel.d.ts","sourceRoot":"","sources":["../../../src/components/composer/aparte-composer-cancel.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,oBAAqB,SAAQ,WAAW;IACjD,OAAO,CAAC,OAAO,CAAkC;IACjD,OAAO,CAAC,aAAa,CAAsB;IAG3C,OAAO,CAAC,QAAQ,CAAgC;IAEhD,iBAAiB,IAAI,IAAI;IAMzB,oBAAoB,IAAI,IAAI;IAQ5B,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,OAAO;IAiBf,OAAO,CAAC,cAAc;IActB,OAAO,CAAC,YAAY;IAKpB;;;;;;OAMG;IACH,OAAO,CAAC,cAAc;IAQtB,OAAO,CAAC,YAAY;CAGvB"}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @element aparte-composer-input
|
|
3
|
-
*
|
|
4
2
|
* Contenteditable text input primitive.
|
|
3
|
+
*
|
|
4
|
+
* @element aparte-composer-input
|
|
5
5
|
* Must be a descendant of <aparte-composer>.
|
|
6
6
|
*
|
|
7
|
+
* @fires aparte-composer-submit - Enter was pressed with content. No detail; the composer reads its own value.
|
|
8
|
+
*
|
|
7
9
|
* Behaviour: Enter submits (calls root.submit()), Shift+Enter inserts newline.
|
|
8
10
|
* Auto-expands up to max-height. Paste strips HTML, handles image paste.
|
|
9
11
|
*
|
|
10
|
-
* @attr
|
|
11
|
-
* @attr
|
|
12
|
-
* @attr
|
|
12
|
+
* @attr {boolean} disabled - Makes the field non-editable; the composer's own `disabled` also reaches it.
|
|
13
|
+
* @attr {string} placeholder - Placeholder text (fallback: reads from aparte-composer)
|
|
14
|
+
* @attr {number} max-height - Max height in px before scroll (default: 200)
|
|
15
|
+
* @attr {number} min-height - Min height in px. When omitted, the stylesheet's
|
|
13
16
|
* min-height governs (44px in aparte.css) — so themes can
|
|
14
17
|
* resize the editor in pure CSS without being fought by
|
|
15
18
|
* an inline height.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aparte-composer-input.d.ts","sourceRoot":"","sources":["../../../src/components/composer/aparte-composer-input.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"aparte-composer-input.d.ts","sourceRoot":"","sources":["../../../src/components/composer/aparte-composer-input.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBAAa,mBAAoB,SAAQ,WAAW;IAChD,OAAO,CAAC,OAAO,CAA+B;IAC9C,OAAO,CAAC,UAAU,CAAO;IACzB,OAAO,CAAC,UAAU,CAAM;IACxB,OAAO,CAAC,aAAa,CAAsB;IAG3C,OAAO,CAAC,QAAQ,CAAgC;IAChD,OAAO,CAAC,UAAU,CAAkC;IACpD,OAAO,CAAC,QAAQ,CAAgC;IAChD,OAAO,CAAC,OAAO,CAA+B;IAC9C,OAAO,CAAC,QAAQ,CAAgC;IAEhD,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,iBAAiB,IAAI,IAAI;IAWzB,oBAAoB,IAAI,IAAI;IAU5B,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IASvF,QAAQ,IAAI,MAAM;IAkBlB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAQ7B,KAAK,IAAI,IAAI;IAQJ,KAAK,IAAI,IAAI;IACb,IAAI,IAAI,IAAI;IAErB,2EAA2E;IAC3E,QAAQ,IAAI,IAAI;IAchB,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,OAAO;IA8Bf,OAAO,CAAC,cAAc;IAwBtB,OAAO,CAAC,YAAY;IAcpB,OAAO,CAAC,cAAc;IAoCtB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,YAAY;IAmBpB,OAAO,CAAC,aAAa;IAmBrB;;;;;;;OAOG;IACH,OAAO,CAAC,sBAAsB;IAQ9B,OAAO,CAAC,kBAAkB;IAQ1B,OAAO,CAAC,4BAA4B;IAIpC,OAAO,CAAC,eAAe;CAO1B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @element aparte-composer-send
|
|
3
|
-
*
|
|
4
2
|
* Submit button primitive for <aparte-composer>.
|
|
3
|
+
*
|
|
4
|
+
* @element aparte-composer-send
|
|
5
5
|
* Must be a descendant of <aparte-composer>.
|
|
6
6
|
*
|
|
7
7
|
* - Disabled when composer value is empty, composer is disabled, or streaming
|
|
@@ -20,12 +20,44 @@
|
|
|
20
20
|
export declare class AparteComposerSend extends HTMLElement {
|
|
21
21
|
private _button;
|
|
22
22
|
private _unsubscribes;
|
|
23
|
+
/**
|
|
24
|
+
* The last `panel-change` payload.
|
|
25
|
+
*
|
|
26
|
+
* This button has four meanings — send, stop, submit an answer, advance to the
|
|
27
|
+
* next question — and three of them are decided by state it does not own: the
|
|
28
|
+
* root's `streaming`, and this payload. It was read straight out of the event's
|
|
29
|
+
* arguments and thrown away, so nothing could recompute the button's chrome
|
|
30
|
+
* afterwards; a config change had no way to know which of the four to write.
|
|
31
|
+
*/
|
|
32
|
+
private _panel;
|
|
23
33
|
private _onClick;
|
|
24
34
|
connectedCallback(): void;
|
|
25
35
|
disconnectedCallback(): void;
|
|
26
36
|
private _getRoot;
|
|
27
37
|
private _render;
|
|
28
38
|
private _connectToRoot;
|
|
39
|
+
/**
|
|
40
|
+
* Write the chrome for the mode the button is IN, deciding before writing.
|
|
41
|
+
*
|
|
42
|
+
* Never `_render()`: it returns early once the button exists, and its own
|
|
43
|
+
* disabled/icon computation consults neither `root.streaming` nor the panel — so
|
|
44
|
+
* rebuilding mid-turn would put a paper plane back while a reply was still
|
|
45
|
+
* streaming, and rebuilding with the question panel open would silently drop out
|
|
46
|
+
* of answer mode. It would also take the focus off the one control in this
|
|
47
|
+
* composer most likely to be holding it.
|
|
48
|
+
*/
|
|
49
|
+
private _refreshChrome;
|
|
50
|
+
/**
|
|
51
|
+
* Panel open: this one button now means "answer", and WHICH answer depends on
|
|
52
|
+
* where you are in the form.
|
|
53
|
+
*
|
|
54
|
+
* The icon has to move with the meaning: it drew a paper plane while the label
|
|
55
|
+
* already said "Submit", so it read as "send a message" while it meant "answer
|
|
56
|
+
* this question". And a check on a form with three questions left was just as
|
|
57
|
+
* wrong — hence a chevron while there is more ahead. The visual is what a user
|
|
58
|
+
* reads.
|
|
59
|
+
*/
|
|
60
|
+
private _syncPanelState;
|
|
29
61
|
private _handleClick;
|
|
30
62
|
private _syncState;
|
|
31
63
|
private _syncStreamingState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aparte-composer-send.d.ts","sourceRoot":"","sources":["../../../src/components/composer/aparte-composer-send.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"aparte-composer-send.d.ts","sourceRoot":"","sources":["../../../src/components/composer/aparte-composer-send.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,kBAAmB,SAAQ,WAAW;IAC/C,OAAO,CAAC,OAAO,CAAkC;IACjD,OAAO,CAAC,aAAa,CAAsB;IAC3C;;;;;;;;OAQG;IACH,OAAO,CAAC,MAAM,CAAwF;IAGtG,OAAO,CAAC,QAAQ,CAAgC;IAEhD,iBAAiB,IAAI,IAAI;IAKzB,oBAAoB,IAAI,IAAI;IAQ5B,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,OAAO;IAmBf,OAAO,CAAC,cAAc;IAgCtB;;;;;;;;;OASG;IACH,OAAO,CAAC,cAAc;IAOtB;;;;;;;;;OASG;IACH,OAAO,CAAC,eAAe;IAevB,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,UAAU;IAclB,OAAO,CAAC,mBAAmB;IAiB3B;;;OAGG;IACH,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,YAAY;CAGvB"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @element aparte-composer-toolbar
|
|
3
|
-
*
|
|
4
2
|
* The composer's bottom row — the strip a mode picker, a model selector or a token
|
|
5
3
|
* counter belongs in, rather than a bar of your own floating below the chat. Purely
|
|
6
4
|
* structural: it lays its children out in a row and gets out of the way.
|
|
7
5
|
*
|
|
6
|
+
* @element aparte-composer-toolbar
|
|
7
|
+
*
|
|
8
8
|
* **Position is the DOM order.** `margin-inline-start: auto` on a child pushes it (and
|
|
9
9
|
* everything after it) to the end of the row. That is the whole placement API on
|
|
10
10
|
* purpose: there is no `left`/`right` to be wrong about, so the row reads correctly in a
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* The row is not part of the default `<aparte-chat>` shell — nothing is drawn until you
|
|
14
14
|
* put something in it.
|
|
15
15
|
*
|
|
16
|
-
* @attr data-empty - Reflected BY the element while it holds no element child; the
|
|
16
|
+
* @attr {boolean} data-empty - Reflected BY the element while it holds no element child; the
|
|
17
17
|
* stylesheet hides it then. Read-only, do not set it yourself.
|
|
18
18
|
*
|
|
19
19
|
* @example
|