@aparte/core 0.12.1 → 0.13.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 +25 -0
- package/dist/client/aparte-client.d.ts.map +1 -1
- package/dist/components/bubble/aparte-chat-bubble.d.ts +117 -0
- package/dist/components/bubble/aparte-chat-bubble.d.ts.map +1 -1
- package/dist/components/chat/aparte-chat.d.ts +70 -15
- package/dist/components/chat/aparte-chat.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer-action.d.ts +48 -7
- package/dist/components/composer/aparte-composer-action.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer-add-attachment.d.ts +37 -4
- package/dist/components/composer/aparte-composer-add-attachment.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer-attachments.d.ts +35 -3
- package/dist/components/composer/aparte-composer-attachments.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer-cancel.d.ts +25 -2
- package/dist/components/composer/aparte-composer-cancel.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer-input.d.ts +54 -5
- package/dist/components/composer/aparte-composer-input.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer-send.d.ts +47 -4
- package/dist/components/composer/aparte-composer-send.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer-toolbar.d.ts +15 -4
- package/dist/components/composer/aparte-composer-toolbar.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer.d.ts +139 -7
- package/dist/components/composer/aparte-composer.d.ts.map +1 -1
- package/dist/components/composer/index.d.ts +1 -1
- package/dist/components/composer/index.d.ts.map +1 -1
- package/dist/components/conversation-list/aparte-conversation-list.d.ts +50 -8
- package/dist/components/conversation-list/aparte-conversation-list.d.ts.map +1 -1
- package/dist/components/elicitation/aparte-elicitation.d.ts +45 -0
- package/dist/components/elicitation/aparte-elicitation.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/status/aparte-chat-status.d.ts +47 -5
- package/dist/components/status/aparte-chat-status.d.ts.map +1 -1
- package/dist/components/viewport/aparte-chat-viewport.d.ts +78 -8
- package/dist/components/viewport/aparte-chat-viewport.d.ts.map +1 -1
- package/dist/config/aparte-config.d.ts +22 -0
- package/dist/config/aparte-config.d.ts.map +1 -1
- package/dist/config/icon-provider.d.ts +17 -15
- package/dist/config/icon-provider.d.ts.map +1 -1
- package/dist/custom-elements.json +6249 -4138
- package/dist/elicitation/approval-panel.d.ts.map +1 -1
- package/dist/elicitation/panel.d.ts +23 -2
- package/dist/elicitation/panel.d.ts.map +1 -1
- package/dist/generated/element-attributes.d.ts +21 -15
- package/dist/generated/element-attributes.d.ts.map +1 -1
- package/dist/glyphs-QXfbL3n_.js +81 -0
- package/dist/glyphs-QXfbL3n_.js.map +1 -0
- package/dist/icons/extended.d.ts +153 -0
- package/dist/icons/extended.d.ts.map +1 -0
- package/dist/icons/glyphs.d.ts +98 -0
- package/dist/icons/glyphs.d.ts.map +1 -0
- package/dist/icons/index.d.ts +24 -0
- package/dist/icons/index.d.ts.map +1 -0
- package/dist/icons.d.ts +14 -0
- package/dist/icons.d.ts.map +1 -0
- package/dist/icons.js +157 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.css +5082 -2119
- package/dist/index.d.ts +37 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +167 -67
- package/dist/index.js.map +1 -1
- package/dist/index.node.d.ts +2 -2
- 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/{is-awaiting-reply-BWTDvQ__.js → is-awaiting-reply-DrO_oR32.js} +333 -147
- package/dist/is-awaiting-reply-DrO_oR32.js.map +1 -0
- package/dist/primitives/icon/aparte-icon.d.ts +49 -0
- package/dist/primitives/icon/aparte-icon.d.ts.map +1 -0
- package/dist/primitives/icon/index.d.ts +2 -0
- package/dist/primitives/icon/index.d.ts.map +1 -0
- package/dist/primitives/index.d.ts +1 -0
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/progress-spinner/aparte-progress-spinner.d.ts +20 -5
- package/dist/primitives/progress-spinner/aparte-progress-spinner.d.ts.map +1 -1
- package/dist/primitives/select/aparte-optgroup.d.ts +30 -7
- package/dist/primitives/select/aparte-optgroup.d.ts.map +1 -1
- package/dist/primitives/select/aparte-option.d.ts +29 -3
- package/dist/primitives/select/aparte-option.d.ts.map +1 -1
- package/dist/primitives/select/aparte-select.d.ts +36 -11
- package/dist/primitives/select/aparte-select.d.ts.map +1 -1
- package/dist/renderers/segments/artifact/card.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-map.d.ts +2 -0
- package/dist/types/element-map.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/segments.d.ts +92 -7
- package/dist/types/segments.d.ts.map +1 -1
- package/dist/types/tools.d.ts +2 -0
- package/dist/types/tools.d.ts.map +1 -1
- package/package.json +7 -1
- package/dist/is-awaiting-reply-BWTDvQ__.js.map +0 -1
|
@@ -1,13 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Contenteditable text input primitive.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* The element owns its subtree: on connect it writes one `.aparte-ci-editor`
|
|
5
|
+
* contenteditable and binds its listeners to that node, so children you place inside are
|
|
6
|
+
* replaced. There is nothing to project here — style the generated editor through the CSS
|
|
7
|
+
* variables below, or replace the whole primitive.
|
|
8
|
+
*
|
|
9
|
+
* Enter submits and Shift+Enter inserts a newline; `submit-on-enter="false"` on the
|
|
10
|
+
* composer inverts that mapping, and Enter never submits mid-IME-composition — the key
|
|
11
|
+
* that confirms a CJK candidate must not send the message. The editor auto-expands with
|
|
12
|
+
* its content up to `max-height`, then scrolls. Paste is intercepted: text lands as plain
|
|
13
|
+
* text with its markup stripped, and a pasted image goes to the composer's attachments.
|
|
14
|
+
*
|
|
15
|
+
* Without an `<aparte-composer>` ancestor it still works, and that is deliberate: a
|
|
16
|
+
* submitting Enter then dispatches `aparte-composer-submit` instead of calling
|
|
17
|
+
* `root.submit()`, which is how the bubble's inline editor reuses this primitive.
|
|
18
|
+
* Everything the root owns goes with it though — the mirrored value, the placeholder
|
|
19
|
+
* fallback, the disabled/streaming sync and image paste all need the composer.
|
|
20
|
+
*
|
|
21
|
+
* Not a `<textarea>` and not a stand-in for one: being a contenteditable it has no form
|
|
22
|
+
* value, no `name` and no native validation, and `getValue()` returns trimmed text with
|
|
23
|
+
* `<br>` serialized back to newlines. Use it for the chat draft, not as a form control.
|
|
6
24
|
*
|
|
7
|
-
* @
|
|
25
|
+
* @element aparte-composer-input
|
|
8
26
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
27
|
+
* @fires aparte-composer-submit - A submitting Enter was pressed with no
|
|
28
|
+
* `<aparte-composer>` ancestor to submit to; with one it calls `root.submit()` and
|
|
29
|
+
* dispatches nothing. No detail — the host that placed this primitive reads
|
|
30
|
+
* `getValue()`.
|
|
11
31
|
*
|
|
12
32
|
* @attr {boolean} disabled - Makes the field non-editable; the composer's own `disabled` also reaches it.
|
|
13
33
|
* @attr {string} placeholder - Placeholder text (fallback: reads from aparte-composer)
|
|
@@ -16,6 +36,27 @@
|
|
|
16
36
|
* min-height governs (44px in aparte.css) — so themes can
|
|
17
37
|
* resize the editor in pure CSS without being fought by
|
|
18
38
|
* an inline height.
|
|
39
|
+
*
|
|
40
|
+
* @cssprop [--aparte-composer-control-size=44px] - Single-line min-height of the editor.
|
|
41
|
+
* Inside the `.aparte-composer-row` layout helper the composer's buttons read
|
|
42
|
+
* the same token, so one value resizes that whole control set and the row stays
|
|
43
|
+
* aligned.
|
|
44
|
+
* @cssprop [--aparte-input-padding-y=10px] - Vertical padding inside the editor.
|
|
45
|
+
* @cssprop [--aparte-input-padding-x=12px] - Horizontal padding inside the editor.
|
|
46
|
+
* @cssprop [--aparte-input-font-size=14px] - Editor font size.
|
|
47
|
+
* @cssprop [--aparte-input-line-height=1.5] - Editor line height — also what the
|
|
48
|
+
* auto-expand measures, so changing it changes the height the editor settles at
|
|
49
|
+
* (until `max-height` clamps it).
|
|
50
|
+
* @cssprop --aparte-text - Text and caret colour of the editor.
|
|
51
|
+
* @cssprop --aparte-input-placeholder - Colour of the placeholder drawn by
|
|
52
|
+
* `:empty::before` (falls back to `--aparte-text-muted`).
|
|
53
|
+
* @cssprop --aparte-input-bg - Field background, applied only when this input is the
|
|
54
|
+
* bubble's inline editor (`.aparte-message[data-editing]`) — inside a composer
|
|
55
|
+
* the shell paints the surface instead.
|
|
56
|
+
* @cssprop --aparte-input-border - Border colour of that same edit-mode box.
|
|
57
|
+
* @cssprop [--aparte-radius-input=8px] - Corner radius of the edit-mode box.
|
|
58
|
+
* @cssprop --aparte-input-focus-border - Border colour of the edit-mode box while it
|
|
59
|
+
* holds focus (`:focus-within`).
|
|
19
60
|
*
|
|
20
61
|
* @example
|
|
21
62
|
* <aparte-composer>
|
|
@@ -41,10 +82,18 @@ export declare class AparteComposerInput extends HTMLElement {
|
|
|
41
82
|
connectedCallback(): void;
|
|
42
83
|
disconnectedCallback(): void;
|
|
43
84
|
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
|
85
|
+
/**
|
|
86
|
+
* The editor's text, with `<br>` serialized back to newlines — `textContent`
|
|
87
|
+
* alone would collapse a multi-line draft onto a single line.
|
|
88
|
+
*/
|
|
44
89
|
getValue(): string;
|
|
90
|
+
/** Replace the editor's content and mirror the value onto the parent composer. */
|
|
45
91
|
setValue(value: string): void;
|
|
92
|
+
/** Empty the editor and mirror the empty value onto the parent composer. */
|
|
46
93
|
clear(): void;
|
|
94
|
+
/** Focus the inner contenteditable rather than the host element. */
|
|
47
95
|
focus(): void;
|
|
96
|
+
/** Blur the inner contenteditable rather than the host element. */
|
|
48
97
|
blur(): void;
|
|
49
98
|
/** Focus the editor and place the caret at the very end of its content. */
|
|
50
99
|
focusEnd(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aparte-composer-input.d.ts","sourceRoot":"","sources":["../../../src/components/composer/aparte-composer-input.ts"],"names":[],"mappings":"AAKA
|
|
1
|
+
{"version":3,"file":"aparte-composer-input.d.ts","sourceRoot":"","sources":["../../../src/components/composer/aparte-composer-input.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;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;;;OAGG;IACH,QAAQ,IAAI,MAAM;IAkBlB,kFAAkF;IAClF,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAQ7B,4EAA4E;IAC5E,KAAK,IAAI,IAAI;IAQb,oEAAoE;IAC3D,KAAK,IAAI,IAAI;IACtB,mEAAmE;IAC1D,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;IAqCtB,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,15 +1,58 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Submit button primitive for <aparte-composer>.
|
|
3
3
|
*
|
|
4
|
+
* One control, four meanings: **send**, **stop** while the root is streaming, and — when
|
|
5
|
+
* an elicitation panel is open — **submit** this answer or **advance** to the next
|
|
6
|
+
* question. The panel outranks streaming: while one is open the button stays the answer
|
|
7
|
+
* control and a streaming change is ignored. The icon moves with the meaning (paper
|
|
8
|
+
* plane, square, check, chevron), because a check on a form with three questions left is
|
|
9
|
+
* as wrong as a paper plane that means "answer". All four are decided by the root's state
|
|
10
|
+
* — its `value`, `attachments`, `disabled`, `streaming` and the panel payload it
|
|
11
|
+
* broadcasts — not by anything this element owns, which is why it recomputes its chrome
|
|
12
|
+
* rather than re-rendering: a rebuild would put a paper plane back mid-stream, drop out
|
|
13
|
+
* of answer mode, and take the focus off the control most likely to be holding it.
|
|
14
|
+
*
|
|
15
|
+
* "Empty" counts attachments: a pending attachment with no text still enables the
|
|
16
|
+
* button, because that is a message the composer can send.
|
|
17
|
+
*
|
|
18
|
+
* It owns its subtree — the button is generated on connect and children placed inside
|
|
19
|
+
* are replaced, so there is nothing to project. The host element itself is
|
|
20
|
+
* `display: contents`, so it adds no box: the layout comes from whatever flex row you put
|
|
21
|
+
* it in, and the CSS variables below style the inner button.
|
|
22
|
+
*
|
|
23
|
+
* It needs an `<aparte-composer>` ancestor: without one the button renders disabled, no
|
|
24
|
+
* root event ever reaches it, and a click has nothing to submit to.
|
|
25
|
+
*
|
|
26
|
+
* It is not the place to gate on model selection: the opt-in
|
|
27
|
+
* `aparteGlobalConfig.setRequireModelSelection()` gate already blocks this element's
|
|
28
|
+
* pointer events through `aparte-composer[data-model-gated]`.
|
|
29
|
+
*
|
|
4
30
|
* @element aparte-composer-send
|
|
5
|
-
* Must be a descendant of <aparte-composer>.
|
|
6
31
|
*
|
|
7
|
-
* -
|
|
8
|
-
*
|
|
32
|
+
* @cssprop [--aparte-composer-control-size=44px] - Width/height of the button inside the
|
|
33
|
+
* `.aparte-composer-row` layout helper, shared with the input's single-line
|
|
34
|
+
* height so the row stays aligned. It wins over `--aparte-send-btn-size` there.
|
|
35
|
+
* @cssprop [--aparte-send-btn-size=36px] - Width/height of the button outside that row
|
|
36
|
+
* helper. On coarse pointers it is raised to `--aparte-touch-target-size`.
|
|
37
|
+
* @cssprop [--aparte-touch-target-size=44px] - Hit-area floor applied to the button
|
|
38
|
+
* under `@media (pointer: coarse)`.
|
|
39
|
+
* @cssprop [--aparte-radius-send-btn=6px] - Corner radius of the button.
|
|
40
|
+
* @cssprop --aparte-primary - Button background.
|
|
41
|
+
* @cssprop --aparte-primary-hover - Button background on hover, while enabled.
|
|
42
|
+
* @cssprop --aparte-on-primary - The glyph's colour. Undeclared by default, which means
|
|
43
|
+
* the recipe derives it from `--aparte-primary` itself, so a theme that changes
|
|
44
|
+
* the fill gets a readable glyph with no second edit. Declare it to choose one
|
|
45
|
+
* — it then applies to every primary control, which is the honest scope.
|
|
46
|
+
* @cssprop [--aparte-ink-flip=0.57] - Fill lightness at which the derived ink flips from
|
|
47
|
+
* dark to light, for every solid control.
|
|
48
|
+
* @cssprop [--aparte-ink-dark=0.176] - How dark that derived ink goes. Not 0: at zero
|
|
49
|
+
* lightness OKLCH drops the chroma, and the ink loses the fill's own hue.
|
|
50
|
+
* @cssprop --aparte-send-disabled-bg - Background while disabled (falls back to
|
|
51
|
+
* `--aparte-primary`, which is then dimmed by opacity).
|
|
9
52
|
*
|
|
10
53
|
* @example
|
|
11
54
|
* <!-- One button for both halves of the turn: it submits, and while a reply streams it
|
|
12
|
-
* becomes the stop button.
|
|
55
|
+
* becomes the stop button. -->
|
|
13
56
|
* <aparte-composer>
|
|
14
57
|
* <div class="aparte-composer-row">
|
|
15
58
|
* <aparte-composer-input style="flex: 1"></aparte-composer-input>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aparte-composer-send.d.ts","sourceRoot":"","sources":["../../../src/components/composer/aparte-composer-send.ts"],"names":[],"mappings":"AAKA
|
|
1
|
+
{"version":3,"file":"aparte-composer-send.d.ts","sourceRoot":"","sources":["../../../src/components/composer/aparte-composer-send.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AACH,qBAAa,kBAAmB,SAAQ,WAAW;IAC/C,OAAO,CAAC,OAAO,CAAkC;IACjD,OAAO,CAAC,aAAa,CAAsB;IAC3C;;;;;;;;OAQG;IACH,OAAO,CAAC,MAAM,CAA2F;IAGzG,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;IAyBvB,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"}
|
|
@@ -3,18 +3,29 @@
|
|
|
3
3
|
* counter belongs in, rather than a bar of your own floating below the chat. Purely
|
|
4
4
|
* structural: it lays its children out in a row and gets out of the way.
|
|
5
5
|
*
|
|
6
|
-
* @element aparte-composer-toolbar
|
|
7
|
-
*
|
|
8
6
|
* **Position is the DOM order.** `margin-inline-start: auto` on a child pushes it (and
|
|
9
7
|
* everything after it) to the end of the row. That is the whole placement API on
|
|
10
8
|
* purpose: there is no `left`/`right` to be wrong about, so the row reads correctly in a
|
|
11
9
|
* right-to-left locale without the author thinking about it.
|
|
12
10
|
*
|
|
11
|
+
* The controls the row is made of can be any element, or plain text. Nothing is wrapped or
|
|
12
|
+
* reordered — the children ARE the row, laid out by flex in DOM order, and they may arrive
|
|
13
|
+
* after connection (a framework commits children in its own order). Non-whitespace TEXT
|
|
14
|
+
* counts as content too, so a hand-written row holding a bare token count stays visible
|
|
15
|
+
* instead of tripping the `data-empty` hide.
|
|
16
|
+
*
|
|
13
17
|
* The row is not part of the default `<aparte-chat>` shell — nothing is drawn until you
|
|
14
18
|
* put something in it.
|
|
15
19
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
20
|
+
* It declares no custom property of its own: the gap, the padding and the top separator
|
|
21
|
+
* come from the global `--aparte-space-*` and `--aparte-border*` tokens, so it inherits a
|
|
22
|
+
* theme rather than exposing knobs to re-set.
|
|
23
|
+
*
|
|
24
|
+
* @element aparte-composer-toolbar
|
|
25
|
+
*
|
|
26
|
+
* @attr {boolean} data-empty - Reflected BY the element while it holds neither an element
|
|
27
|
+
* child nor non-whitespace text; the stylesheet hides it then.
|
|
28
|
+
* Read-only, do not set it yourself.
|
|
18
29
|
*
|
|
19
30
|
* @example
|
|
20
31
|
* <aparte-composer>
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,qBAAa,qBAAsB,SAAQ,WAAW;IAClD,OAAO,CAAC,SAAS,CAAiC;IAElD,iBAAiB,IAAI,IAAI;IAQzB,oBAAoB,IAAI,IAAI;IAK5B;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,UAAU;CAKrB"}
|
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the composer's one button means while a panel is up — and whether it is
|
|
3
|
+
* there at all.
|
|
4
|
+
*
|
|
5
|
+
* `'submit'` answers, `'advance'` moves to the next question of a form, and
|
|
6
|
+
* `'none'` says this panel has NO act left for that button, so it is not drawn.
|
|
7
|
+
*
|
|
8
|
+
* `'none'` exists because a panel could not previously say it. The composer's panel
|
|
9
|
+
* mode was one fixed policy — hide the input and the attachment picker, keep the
|
|
10
|
+
* strip and the toolbar, and ALWAYS keep the send button — and the approval panel
|
|
11
|
+
* showed what that costs: its options settle on the first click by design, so the
|
|
12
|
+
* button beside them sat permanently disabled, meaning nothing, until the optional
|
|
13
|
+
* instruction field was opened. A control that is never the way forward is not
|
|
14
|
+
* disabled, it is absent (ratified decision #8).
|
|
15
|
+
*
|
|
16
|
+
* Named rather than inlined at each of its six readers: this union is exactly the
|
|
17
|
+
* kind of list this repo has watched drift when every reader kept its own copy.
|
|
18
|
+
*/
|
|
19
|
+
export type AparteComposerPanelMode = 'advance' | 'submit' | 'none';
|
|
1
20
|
export interface AparteComposerEventMap {
|
|
2
21
|
'value-change': {
|
|
3
22
|
value: string;
|
|
@@ -19,7 +38,7 @@ export interface AparteComposerEventMap {
|
|
|
19
38
|
'panel-change': {
|
|
20
39
|
active: boolean;
|
|
21
40
|
submitEnabled: boolean;
|
|
22
|
-
mode:
|
|
41
|
+
mode: AparteComposerPanelMode;
|
|
23
42
|
};
|
|
24
43
|
}
|
|
25
44
|
export type AparteComposerEventType = keyof AparteComposerEventMap;
|
|
@@ -48,7 +67,46 @@ export interface AparteComposerChangeEventDetail {
|
|
|
48
67
|
/**
|
|
49
68
|
* The root context for every `aparte-composer-*` primitive. It imposes no visual
|
|
50
69
|
* layout — the consumer owns the structure — and holds the shared state the parts
|
|
51
|
-
* read: the value, the streaming flag, pending attachments,
|
|
70
|
+
* read: the value, the streaming flag, pending attachments, whether a panel is up.
|
|
71
|
+
*
|
|
72
|
+
* It renders nothing of its own — no shadow root, no markup, no default children — so
|
|
73
|
+
* an `<aparte-composer>` with nothing inside is an empty block. The parts that need
|
|
74
|
+
* that state locate it with `closest('aparte-composer')`, which is why they may sit at
|
|
75
|
+
* any depth and why the opt-in `.aparte-composer-shell` / `.aparte-composer-row`
|
|
76
|
+
* wrappers can exist without this element knowing about them.
|
|
77
|
+
* Not every part looks it up, though: `<aparte-composer-toolbar>` is purely structural
|
|
78
|
+
* — it lays its children out and never resolves this element at all.
|
|
79
|
+
*
|
|
80
|
+
* WHAT GOES INSIDE — ordinary light-DOM children. Core has no shadow root and no
|
|
81
|
+
* `<slot>`, so there is no slot name to write: drop in `<aparte-composer-input>`,
|
|
82
|
+
* `<aparte-composer-send>`, `<aparte-composer-cancel>`,
|
|
83
|
+
* `<aparte-composer-attachments>`, `<aparte-composer-add-attachment>`,
|
|
84
|
+
* `<aparte-composer-action>`, `<aparte-composer-toolbar>`, plus whatever markup you
|
|
85
|
+
* wrap them in. Order and nesting are yours. Two behaviours read the tree rather than a
|
|
86
|
+
* flag, so they depend on what you put in: `focus()` forwards to the first
|
|
87
|
+
* `<aparte-composer-input>` descendant, and `showPanel()` inserts the panel right after
|
|
88
|
+
* it (appending to the host when there is none).
|
|
89
|
+
*
|
|
90
|
+
* A PANEL is neither markup you write nor a named slot: `showPanel()` takes the element,
|
|
91
|
+
* stamps it `data-aparte-panel` and inserts it, `hidePanel()` removes it. One at a time
|
|
92
|
+
* — a second `showPanel()` evicts the first and calls its `onEvict`. While one is up the
|
|
93
|
+
* host carries `[data-panel-active]`, which hides `<aparte-composer-input>` and
|
|
94
|
+
* `<aparte-composer-add-attachment>` and leaves the attachments strip and the toolbar in
|
|
95
|
+
* place.
|
|
96
|
+
*
|
|
97
|
+
* It is not a transport either. `submit()` trims, checks the gates (disabled, empty,
|
|
98
|
+
* no model selected), dispatches `aparte-send` and clears — nothing here talks to a
|
|
99
|
+
* model, so without `AparteClient` or a listener of your own a send is a dispatched
|
|
100
|
+
* event and no answer. With no panel up it doubles as the stop button: while `streaming`
|
|
101
|
+
* it routes to `cancel()`, which is why the `getState` example below keeps a custom send
|
|
102
|
+
* button clickable rather than disabling it mid-stream. With a panel up it means "answer
|
|
103
|
+
* the question" instead — it calls the panel's `onSubmit` and returns, so neither the
|
|
104
|
+
* stop branch nor a send is reached.
|
|
105
|
+
*
|
|
106
|
+
* The streaming flag comes from WINDOW lifecycle events, filtered by target. On a page
|
|
107
|
+
* with two chats, give the composer a `target` — or put it under a chat host that has
|
|
108
|
+
* an `id` — otherwise it answers to every chat's events, and one chat's Stop resets the
|
|
109
|
+
* other's composer and evicts its open panel.
|
|
52
110
|
*
|
|
53
111
|
* Prose first, on purpose: when `@element` opens a docblock there is no free text
|
|
54
112
|
* left for the analyser to use, and this component's description came out empty in
|
|
@@ -60,8 +118,12 @@ export interface AparteComposerChangeEventDetail {
|
|
|
60
118
|
*
|
|
61
119
|
* @element aparte-composer
|
|
62
120
|
*
|
|
63
|
-
* @attr {string} placeholder -
|
|
64
|
-
*
|
|
121
|
+
* @attr {string} placeholder - Fallback placeholder for `<aparte-composer-input>`, which
|
|
122
|
+
* reads it off this element when it carries none of its own. Read when that input
|
|
123
|
+
* renders, not pushed: changing it here leaves an input already on the page as it was.
|
|
124
|
+
* @attr {boolean} disabled - Disables the composer's own controls — the input, send,
|
|
125
|
+
* add-attachment and `<aparte-composer-action>` buttons each read it. What you put in
|
|
126
|
+
* the toolbar is yours to disable.
|
|
65
127
|
* @attr {string} target - The id of the `<aparte-chat>` this composer drives.
|
|
66
128
|
* @attr {boolean} submit-on-enter - Enter sends and Shift+Enter breaks the line (the
|
|
67
129
|
* default); set it to the string `"false"` to swap them. Read lazily by the
|
|
@@ -71,8 +133,42 @@ export interface AparteComposerChangeEventDetail {
|
|
|
71
133
|
* @fires {CustomEvent<AparteSendEventDetail>} aparte-send - A message was submitted: the text, its attachments and the target.
|
|
72
134
|
* @fires aparte-cancel - The stop button was pressed. No detail; the two window events below carry the target.
|
|
73
135
|
* @fires {CustomEvent<AparteAbortEventDetail>} aparte-abort - Dispatched on `window`: stop the run for this target.
|
|
74
|
-
* @fires {CustomEvent<AparteMessageAbortedEventDetail>} aparte-message-aborted -
|
|
136
|
+
* @fires {CustomEvent<AparteMessageAbortedEventDetail>} aparte-message-aborted - The run for this target ended early — the user pressed Stop, or `abort()` was called. This element dispatches it on `window`; `AparteClient` also dispatches it on the chat host, so it is listenable on either.
|
|
75
137
|
* @fires {CustomEvent<AparteComposerChangeEventDetail>} aparte-composer-change - Any of value / streaming / disabled / attachments / panel changed, folded into one event.
|
|
138
|
+
*
|
|
139
|
+
* @cssprop [--aparte-composer-control-size=44px] - Width and height of the composer's
|
|
140
|
+
* own control buttons (each is an `.aparte-btn--icon`, so it needs the opt-in
|
|
141
|
+
* `.aparte-composer-row` wrapper, which is what carries the size down) and the
|
|
142
|
+
* minimum height of the input's editor, which needs no wrapper. One knob for the
|
|
143
|
+
* whole control set, so buttons stay aligned with a single line of text and anchored
|
|
144
|
+
* to the bottom once the input grows. It reaches the buttons by declaration, not by
|
|
145
|
+
* out-specifying them, so a panel mounted in the row keeps its own content's sizing.
|
|
146
|
+
* @cssprop [--aparte-input-bg=var(--aparte-surface-1)] - Background of the opt-in
|
|
147
|
+
* `.aparte-composer-shell` wrapper.
|
|
148
|
+
* @cssprop [--aparte-input-border=var(--aparte-border)] - Border colour of that shell.
|
|
149
|
+
* Its `:focus-within` colour is `--aparte-primary`, a global token rather than a
|
|
150
|
+
* composer one.
|
|
151
|
+
* @cssprop [--aparte-radius-input=var(--aparte-radius-lg)] - Corner radius of the shell,
|
|
152
|
+
* and of the dashed outline drawn while files are dragged over the composer.
|
|
153
|
+
* @cssprop [--aparte-message-max-width=800px] - Max width of the shell, which is
|
|
154
|
+
* `margin: 0 auto` at this width — the same width `.aparte-message` uses, so the
|
|
155
|
+
* composer keeps the transcript's column. Set on THIS element it moves the shell only:
|
|
156
|
+
* custom properties inherit downward and the transcript is a sibling subtree, so set
|
|
157
|
+
* it on a shared ancestor (the chat host, `:root`) to move both.
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* <!-- It renders nothing of its own — no shadow root, no default children — so this
|
|
161
|
+
* markup IS the component. The shell draws the border; the row keeps the controls
|
|
162
|
+
* on the bottom edge of the text as it grows. Both are opt-in classes: drop them
|
|
163
|
+
* and the parts still work, they just sit wherever your own layout puts them. -->
|
|
164
|
+
* <aparte-composer placeholder="Ask anything…">
|
|
165
|
+
* <div class="aparte-composer-shell">
|
|
166
|
+
* <div class="aparte-composer-row">
|
|
167
|
+
* <aparte-composer-input style="flex: 1"></aparte-composer-input>
|
|
168
|
+
* <aparte-composer-send></aparte-composer-send>
|
|
169
|
+
* </div>
|
|
170
|
+
* </div>
|
|
171
|
+
* </aparte-composer>
|
|
76
172
|
*/
|
|
77
173
|
export declare class AparteComposer extends HTMLElement {
|
|
78
174
|
private _value;
|
|
@@ -163,9 +259,22 @@ export declare class AparteComposer extends HTMLElement {
|
|
|
163
259
|
* myButton.addEventListener('click', () => composer.submit()); // send or stop
|
|
164
260
|
*/
|
|
165
261
|
getState(): AparteComposerState;
|
|
262
|
+
/**
|
|
263
|
+
* Set the composer's value — both what a send will submit and what the editor
|
|
264
|
+
* shows. `<aparte-composer-input>` writes through any value it does not already
|
|
265
|
+
* hold, so this prefills the visible field (a template button, a restored draft)
|
|
266
|
+
* as readily as it stages text for an immediate `submit()`.
|
|
267
|
+
*/
|
|
166
268
|
setValue(value: string): void;
|
|
269
|
+
/** Append files to the pending attachments and notify. Does not de-duplicate. */
|
|
167
270
|
addAttachments(files: FileList | File[]): void;
|
|
271
|
+
/**
|
|
272
|
+
* Drop one pending attachment and notify. Matched by IDENTITY — pass the same
|
|
273
|
+
* `File` object the composer handed you, not an equal one; two picks of the same
|
|
274
|
+
* file on disk are two distinct objects.
|
|
275
|
+
*/
|
|
168
276
|
removeAttachment(file: File): void;
|
|
277
|
+
/** Drop every pending attachment and notify. */
|
|
169
278
|
clearAttachments(): void;
|
|
170
279
|
/**
|
|
171
280
|
* Inject a panel into the composer. The send button calls `onSubmit` when clicked.
|
|
@@ -181,6 +290,15 @@ export declare class AparteComposer extends HTMLElement {
|
|
|
181
290
|
* are the user's state and not an action to offer — hiding them would look like
|
|
182
291
|
* losing them; and the toolbar, because switching model still does something.
|
|
183
292
|
*
|
|
293
|
+
* The send button is the part the PANEL decides, through `mode`. `'submit'` and
|
|
294
|
+
* `'advance'` keep it; `'none'` says this panel has no act for it and it is not
|
|
295
|
+
* drawn. That third value is what a panel whose options settle on the first click
|
|
296
|
+
* needs — a single-choice question, an approval — and until it existed such a
|
|
297
|
+
* panel left a permanently disabled button beside options that never routed
|
|
298
|
+
* through it. Flip between them at any time with {@link setPanelSubmitEnabled},
|
|
299
|
+
* which is how a panel that grows an act (an "Other…" field, a written
|
|
300
|
+
* instruction) turns the button back on.
|
|
301
|
+
*
|
|
184
302
|
* Declared with an attribute + CSS rather than the inline `style.display` this
|
|
185
303
|
* used to set on a child: an attribute is themeable, is visible to a consumer's
|
|
186
304
|
* own rules, and does not clobber a `display` the consumer had set (the restore
|
|
@@ -194,7 +312,12 @@ export declare class AparteComposer extends HTMLElement {
|
|
|
194
312
|
showPanel(panel: HTMLElement, options?: {
|
|
195
313
|
submitEnabled?: boolean;
|
|
196
314
|
onSubmit?: () => void;
|
|
197
|
-
|
|
315
|
+
/**
|
|
316
|
+
* What the send button means for this panel — `'none'` if it has no act
|
|
317
|
+
* for it, in which case the button is not drawn. See
|
|
318
|
+
* {@link AparteComposerPanelMode}.
|
|
319
|
+
*/
|
|
320
|
+
mode?: AparteComposerPanelMode;
|
|
198
321
|
/** Called when something other than this owner closes the panel. */
|
|
199
322
|
onEvict?: () => void;
|
|
200
323
|
}): symbol;
|
|
@@ -241,7 +364,16 @@ export declare class AparteComposer extends HTMLElement {
|
|
|
241
364
|
* "submit" (when it was the last one), and two separate calls would flash a
|
|
242
365
|
* wrong icon between them.
|
|
243
366
|
*/
|
|
244
|
-
setPanelSubmitEnabled(enabled: boolean, mode?:
|
|
367
|
+
setPanelSubmitEnabled(enabled: boolean, mode?: AparteComposerPanelMode): void;
|
|
368
|
+
/**
|
|
369
|
+
* Publish the panel mode as an attribute, so CSS can act on it.
|
|
370
|
+
*
|
|
371
|
+
* The same reasoning `data-panel-active` is set for and the same one that took
|
|
372
|
+
* the old `style.display` off a child: an attribute is themeable, is visible to
|
|
373
|
+
* a consumer's own rules, and does not clobber what the consumer set. It is what
|
|
374
|
+
* lets `'none'` remove the send button without this component reaching into it.
|
|
375
|
+
*/
|
|
376
|
+
private _reflectPanelMode;
|
|
245
377
|
get panelActive(): boolean;
|
|
246
378
|
/**
|
|
247
379
|
* Recompute the model gate from the resolved config. When
|
|
@@ -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":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,uBAAuB,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;AAKpE,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,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;OAgBG;IACH,OAAO,CAAC,YAAY;IAapB,OAAO,CAAC,mBAAmB;IAM3B,OAAO,CAAC,kBAAkB;CAO7B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { AparteComposer } from './aparte-composer.js';
|
|
2
|
-
export type { AparteComposerEventMap, AparteComposerEventType, AparteComposerState, AparteComposerChangeEventDetail, } from './aparte-composer.js';
|
|
2
|
+
export type { AparteComposerEventMap, AparteComposerEventType, AparteComposerState, AparteComposerChangeEventDetail, AparteComposerPanelMode, } from './aparte-composer.js';
|
|
3
3
|
export { AparteComposerInput } from './aparte-composer-input.js';
|
|
4
4
|
export { AparteComposerSend } from './aparte-composer-send.js';
|
|
5
5
|
export { AparteComposerCancel } from './aparte-composer-cancel.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/composer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,YAAY,EACR,sBAAsB,EACtB,uBAAuB,EACvB,mBAAmB,EACnB,+BAA+B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/composer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,YAAY,EACR,sBAAsB,EACtB,uBAAuB,EACvB,mBAAmB,EACnB,+BAA+B,EAC/B,uBAAuB,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,KAAK,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AACtG,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -2,8 +2,7 @@ export interface AparteConversationListItem {
|
|
|
2
2
|
id: string;
|
|
3
3
|
title: string;
|
|
4
4
|
updatedAt?: number;
|
|
5
|
-
/** When set, the item renders the unarchive action instead of archive.
|
|
6
|
-
*/
|
|
5
|
+
/** When set, the item renders the unarchive action instead of archive. */
|
|
7
6
|
archivedAt?: number;
|
|
8
7
|
}
|
|
9
8
|
export interface AparteConversationSelectDetail {
|
|
@@ -20,12 +19,23 @@ export interface AparteConversationArchiveDetail {
|
|
|
20
19
|
* the `conversations` JS property and the `active-id` attribute; this renders the
|
|
21
20
|
* list and fires the user's intent, never acting on it itself.
|
|
22
21
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
22
|
+
* Children are not a composition point: `_render()` assigns `innerHTML` from the
|
|
23
|
+
* `conversations` array, so any light-DOM child a host writes inside the element is
|
|
24
|
+
* discarded the next time the list renders — and switching this element's locale is
|
|
25
|
+
* enough to trigger one. Compose around the element, not inside it: it renders rows
|
|
26
|
+
* and nothing else, with no header, no new-conversation button and no search field.
|
|
27
|
+
*
|
|
28
|
+
* What it is not: a store. Clicking a row selects nothing, and the two row actions
|
|
29
|
+
* delete and archive nothing — the four events carry an id and stop. A row's text
|
|
30
|
+
* comes from the array, so it changes when the host assigns `conversations` again;
|
|
31
|
+
* the exception is an empty title, which falls back to the locale's new-chat label
|
|
32
|
+
* and therefore follows a locale switch. An archived item is still rendered (it gains
|
|
33
|
+
* `aparte-conv-item--archived` and swaps its action's icon and event name); filtering
|
|
34
|
+
* archived conversations out of the list is the host's decision, not this element's.
|
|
35
|
+
* The asymmetry between the two inputs is deliberate: `active-id` is an attribute
|
|
36
|
+
* because moving the selection patches the rendered rows in place, while
|
|
37
|
+
* `conversations` is a JS property because it is structured data an attribute cannot
|
|
38
|
+
* carry, and setting it re-renders the whole list.
|
|
29
39
|
*
|
|
30
40
|
* @element aparte-conversation-list
|
|
31
41
|
* @attr {string} active-id - The id of the conversation to render as selected.
|
|
@@ -35,6 +45,38 @@ export interface AparteConversationArchiveDetail {
|
|
|
35
45
|
* @fires {CustomEvent<AparteConversationArchiveDetail>} aparte-archive-conversation - The archive action was pressed on a live conversation.
|
|
36
46
|
* @fires {CustomEvent<AparteConversationArchiveDetail>} aparte-unarchive-conversation - The same action on an already-archived one; same detail shape, opposite intent.
|
|
37
47
|
*
|
|
48
|
+
* @cssprop [--aparte-conv-list-gap=2px] - Vertical gap between rows. The element itself is the flex column, so this is its `gap`.
|
|
49
|
+
* @cssprop [--aparte-conv-item-padding=7px 10px] - Padding of a row.
|
|
50
|
+
* @cssprop [--aparte-conv-item-gap=6px] - Gap between a row's title and its two action buttons.
|
|
51
|
+
* @cssprop [--aparte-conv-item-radius=var(--aparte-radius-md)] - Corner radius of a row.
|
|
52
|
+
* @cssprop [--aparte-conv-item-font-size=0.8125rem] - Font size of a row's title.
|
|
53
|
+
* @cssprop [--aparte-conv-item-color=var(--aparte-text-muted)] - Title colour of an inactive row.
|
|
54
|
+
* @cssprop [--aparte-conv-item-bg-hover=var(--aparte-surface-3)] - Row background on hover.
|
|
55
|
+
* @cssprop [--aparte-conv-item-bg-active=var(--aparte-surface-3)] - Background of the row matching `active-id`.
|
|
56
|
+
* @cssprop [--aparte-conv-item-color-active=var(--aparte-text)] - Title colour of the active row.
|
|
57
|
+
* @cssprop [--aparte-conv-item-font-weight-active=var(--aparte-font-weight-medium, 500)] - Title weight of the active row.
|
|
58
|
+
* @cssprop [--aparte-conv-action-btn-size=20px] - Square size of both action buttons. Under `(pointer: coarse)` the stylesheet redeclares it as 28px on the buttons themselves, so a value set on the element does not reach them there; the buttons also stay visible instead of appearing on hover.
|
|
59
|
+
* @cssprop [--aparte-conv-delete-color=var(--aparte-text-muted)] - Icon colour of the delete button.
|
|
60
|
+
* @cssprop [--aparte-conv-delete-bg-hover=var(--aparte-error)] - Delete button background on hover.
|
|
61
|
+
* @cssprop [--aparte-conv-delete-color-hover=var(--aparte-text-inverse)] - Delete button icon colour on hover.
|
|
62
|
+
* @cssprop [--aparte-conv-delete-radius=var(--aparte-radius-sm)] - Corner radius of the delete button.
|
|
63
|
+
* @cssprop [--aparte-conv-archive-color=var(--aparte-text-muted)] - Icon colour of the archive/unarchive button.
|
|
64
|
+
* @cssprop [--aparte-conv-archive-bg-hover=var(--aparte-surface-4, var(--aparte-surface-3))] - Archive button background on hover. Core declares no `--aparte-surface-4`, so unset it resolves to `--aparte-surface-3`.
|
|
65
|
+
* @cssprop [--aparte-conv-archive-color-hover=var(--aparte-text)] - Archive button icon colour on hover.
|
|
66
|
+
* @cssprop [--aparte-conv-archive-radius=var(--aparte-radius-sm)] - Corner radius of the archive button.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* <!-- It stores nothing and fetches nothing: an empty tag renders the empty state, and
|
|
70
|
+
* the list appears when the host assigns `conversations`. -->
|
|
71
|
+
* <aparte-conversation-list active-id="c1" style="max-width: 20rem"></aparte-conversation-list>
|
|
72
|
+
*
|
|
73
|
+
* <script>
|
|
74
|
+
* document.querySelector('aparte-conversation-list').conversations = [
|
|
75
|
+
* { id: 'c1', title: 'Deploy checklist', updatedAt: Date.now() },
|
|
76
|
+
* { id: 'c2', title: 'Rename the segment types', updatedAt: Date.now() - 864e5 },
|
|
77
|
+
* ];
|
|
78
|
+
* </script>
|
|
79
|
+
*
|
|
38
80
|
* @example
|
|
39
81
|
* // The host owns the data: set the `conversations` property, listen for the intent.
|
|
40
82
|
* const list = document.querySelector('aparte-conversation-list')!;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aparte-conversation-list.d.ts","sourceRoot":"","sources":["../../../src/components/conversation-list/aparte-conversation-list.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,0BAA0B;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;
|
|
1
|
+
{"version":3,"file":"aparte-conversation-list.d.ts","sourceRoot":"","sources":["../../../src/components/conversation-list/aparte-conversation-list.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,0BAA0B;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0EAA0E;IAC1E,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,8BAA8B;IAC3C,EAAE,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,8BAA8B;IAC3C,EAAE,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,+BAA+B;IAC5C,EAAE,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EG;AACH,qBAAa,sBAAuB,SAAQ,WAAW;IACnD,OAAO,CAAC,cAAc,CAAoC;IAC1D,OAAO,CAAC,SAAS,CAAuB;IAExC,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAID,iBAAiB,IAAI,IAAI;IAWzB,oBAAoB,IAAI,IAAI;IAI5B,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAQ9F;;;;OAIG;IACH,OAAO,CAAC,eAAe,CAIrB;IAIF,sEAAsE;IACtE,IAAI,aAAa,CAAC,KAAK,EAAE,0BAA0B,EAAE,EAGpD;IAED,IAAI,aAAa,IAAI,0BAA0B,EAAE,CAEhD;IAID,OAAO,CAAC,OAAO;IAOf,OAAO,CAAC,WAAW;IA8CnB,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,QAAQ,CAkCd;IAEF,OAAO,CAAC,UAAU,CAoBhB;IAEF,sEAAsE;IACtE,OAAO,CAAC,kBAAkB;IAW1B,OAAO,CAAC,IAAI;CAQf"}
|
|
@@ -33,8 +33,53 @@ import type { AparteConfig } from '../../config/aparte-config.js';
|
|
|
33
33
|
* existed only because the buttons used to live in a segment renderer with no reference
|
|
34
34
|
* to the client.
|
|
35
35
|
*
|
|
36
|
+
* It has no children to project: `connectedCallback` sets
|
|
37
|
+
* `display: none`, and the composer it presents in is found by walking UP from
|
|
38
|
+
* `this.parentElement` — anything placed inside this element is only hidden with it.
|
|
39
|
+
* So its position matters but its content does not: mount it anywhere inside the
|
|
40
|
+
* `<aparte-chat>` whose questions it should answer.
|
|
41
|
+
*
|
|
42
|
+
* Not the element to reach for when you want a question UI of your own shape. It is
|
|
43
|
+
* one caller of `setElicitationPresenter`, and among presenters registered for the
|
|
44
|
+
* same chat the most recent one wins — so an app with a framework-native presenter
|
|
45
|
+
* registers that and does not mount this, and a second `<aparte-elicitation>` in one
|
|
46
|
+
* chat is redundant rather than additive. It is also not usable outside a chat that
|
|
47
|
+
* has an `<aparte-composer>`: with nowhere to mount a panel the request is REJECTED,
|
|
48
|
+
* on purpose, rather than borrowed into another chat's composer.
|
|
49
|
+
*
|
|
50
|
+
* The panel it mounts is styled by `@aparte/core/styles.css` — the `--aparte-elic-*`
|
|
51
|
+
* and `--aparte-approval-*` knobs below theme it. They are declared here rather than
|
|
52
|
+
* on the composer because this presenter is what builds the panel; the composer only
|
|
53
|
+
* lends it the slot.
|
|
54
|
+
*
|
|
36
55
|
* @element aparte-elicitation
|
|
37
56
|
*
|
|
57
|
+
* @cssprop [--aparte-elic-gap=6px] - Vertical gap between the panel's rows (message, body, tabs).
|
|
58
|
+
* @cssprop [--aparte-elic-padding=6px 4px] - Padding inside the panel.
|
|
59
|
+
* @cssprop [--aparte-elic-max-height=50vh] - Cap on the panel's height; its body scrolls, the panel does not.
|
|
60
|
+
* @cssprop [--aparte-elic-field-gap=8px] - Space and separator padding between two fields of an object schema.
|
|
61
|
+
* @cssprop [--aparte-elic-message-size=0.82rem] - Font size of the question text at the top of the panel.
|
|
62
|
+
* @cssprop [--aparte-elic-title-size=0.8rem] - Font size of a field's title.
|
|
63
|
+
* @cssprop [--aparte-elic-desc-size=0.76rem] - Font size of a field's description.
|
|
64
|
+
* @cssprop [--aparte-elic-option-padding=7px 10px] - Padding of one enum/boolean option row.
|
|
65
|
+
* @cssprop [--aparte-elic-option-radius=8px] - Corner radius of an option row.
|
|
66
|
+
* @cssprop [--aparte-elic-option-title-size=0.875rem] - Font size of an option's label, and of the text inputs.
|
|
67
|
+
* @cssprop [--aparte-elic-option-desc-size=0.78rem] - Font size of an option's secondary line.
|
|
68
|
+
* @cssprop [--aparte-elic-control-size=15px] - Size of the radio/checkbox control in an option row.
|
|
69
|
+
* @cssprop [--aparte-elic-input-radius=6px] - Corner radius of the text inputs and of the Skip button.
|
|
70
|
+
* @cssprop [--aparte-elic-textarea-min-height=64px] - Minimum height of a multi-line string field.
|
|
71
|
+
* @cssprop [--aparte-elic-input-size=0.85rem] - Font size of the approval panel's instruction field (the free-text note the user writes).
|
|
72
|
+
* @cssprop [--aparte-elic-skip-size=0.8rem] - Font size of the corner "Skip" affordance (the decline).
|
|
73
|
+
* @cssprop [--aparte-elic-step-size=0.78rem] - Font size of a step tab, when the schema is asked one field at a time.
|
|
74
|
+
* @cssprop [--aparte-elic-step-padding=4px 2px] - Padding of a step tab.
|
|
75
|
+
* @cssprop [--aparte-elic-step-gap=14px] - Gap between step tabs.
|
|
76
|
+
* @cssprop [--aparte-elic-step-underline=2px] - Thickness of the current step's underline (a tab, not a pill).
|
|
77
|
+
* @cssprop [--aparte-elic-dismiss-room=72px] - Space kept clear at the end of the tab rail for the corner escape.
|
|
78
|
+
* @cssprop [--aparte-approval-gap=4px] - Gap between the stacked options of an approval request.
|
|
79
|
+
* @cssprop [--aparte-approval-option-size=0.85rem] - Font size of an approval option button.
|
|
80
|
+
* @cssprop [--aparte-approval-option-padding=8px 10px] - Padding of an approval option button.
|
|
81
|
+
* @cssprop [--aparte-approval-option-radius=8px] - Corner radius of an approval option button.
|
|
82
|
+
*
|
|
38
83
|
* @example
|
|
39
84
|
* <!-- Renders nothing by itself: it registers as the presenter for its subtree, so a
|
|
40
85
|
* tool handler calling requestUserInput() gets its panel mounted in the composer. -->
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aparte-elicitation.d.ts","sourceRoot":"","sources":["../../../src/components/elicitation/aparte-elicitation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAgC,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEtG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAiClE
|
|
1
|
+
{"version":3,"file":"aparte-elicitation.d.ts","sourceRoot":"","sources":["../../../src/components/elicitation/aparte-elicitation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAgC,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEtG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAiClE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AACH,qBAAa,iBAAkB,SAAQ,WAAY,YAAW,iBAAiB;IAC3E,OAAO,CAAC,QAAQ,CAAwB;IACxC;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,UAAU,CAKhB;IAEF,OAAO,CAAC,kBAAkB,CAA6B;IAEvD,iBAAiB,IAAI,IAAI;IAiBzB;;;;;;;;;;;OAWG;IACH,mBAAmB,CAAC,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,GAAG,IAAI;IAQrE,oBAAoB,IAAI,IAAI;IAY5B;;;;;;;OAOG;IACH,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,QAAQ,CAmKd;IAEF,OAAO,CAAC,cAAc;IAItB;;;;;;;;;OASG;IACH,OAAO,CAAC,gBAAgB;IAWxB;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,YAAY;CAwBvB"}
|
|
@@ -4,7 +4,7 @@ export type { SyncableBubble } from './bubble/index.js';
|
|
|
4
4
|
export { AparteChatStatus } from './status/index.js';
|
|
5
5
|
export { AparteChatViewport } from './viewport/index.js';
|
|
6
6
|
export { AparteComposer, AparteComposerInput, AparteComposerSend, AparteComposerCancel, AparteComposerAttachments, AparteComposerAddAttachment, AparteComposerAction, AparteComposerToolbar } from './composer/index.js';
|
|
7
|
-
export type { AparteComposerEventMap, AparteComposerEventType, AparteComposerState, AparteComposerChangeEventDetail, AparteActionClickEventDetail } from './composer/index.js';
|
|
7
|
+
export type { AparteComposerEventMap, AparteComposerEventType, AparteComposerState, AparteComposerChangeEventDetail, AparteComposerPanelMode, AparteActionClickEventDetail } from './composer/index.js';
|
|
8
8
|
export { AparteConversationList } from './conversation-list/index.js';
|
|
9
9
|
export type { AparteConversationListItem, AparteConversationSelectDetail, AparteConversationDeleteDetail, AparteConversationArchiveDetail } from './conversation-list/index.js';
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAChF,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAGzD,OAAO,EAAE,cAAc,EAAE,mBAAm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