@artooi/ag-ui-web-component 0.22.0 → 0.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +134 -36
- package/README.md +7 -7
- package/dist/ag-ui-web-component.bundle.js +145 -118
- package/dist/ag-ui-web-component.bundle.js.map +3 -3
- package/dist/constants.d.ts +65 -78
- package/dist/constants.d.ts.map +1 -1
- package/dist/core/ag_ui_chat.d.ts +93 -126
- package/dist/core/ag_ui_chat.d.ts.map +1 -1
- package/dist/core/agui_client.d.ts +24 -30
- package/dist/core/agui_client.d.ts.map +1 -1
- package/dist/core/attachment.d.ts +9 -14
- package/dist/core/attachment.d.ts.map +1 -1
- package/dist/core/conversation_store.d.ts +20 -27
- package/dist/core/conversation_store.d.ts.map +1 -1
- package/dist/core/create_http_agent.d.ts +13 -15
- package/dist/core/create_http_agent.d.ts.map +1 -1
- package/dist/core/remote_conversation_store.d.ts +8 -9
- package/dist/core/remote_conversation_store.d.ts.map +1 -1
- package/dist/core/run_index.d.ts +11 -20
- package/dist/core/run_index.d.ts.map +1 -1
- package/dist/core/transcribe_audio.d.ts +8 -8
- package/dist/core/transcribe_audio.d.ts.map +1 -1
- package/dist/core/upload_attachment.d.ts +15 -18
- package/dist/core/upload_attachment.d.ts.map +1 -1
- package/dist/core/utils.d.ts +4 -6
- package/dist/core/utils.d.ts.map +1 -1
- package/dist/dom/animations.d.ts +22 -30
- package/dist/dom/animations.d.ts.map +1 -1
- package/dist/dom/dom_driver.d.ts +7 -7
- package/dist/dom/native_setter.d.ts +2 -2
- package/dist/dom/native_setter.d.ts.map +1 -1
- package/dist/index.js +347 -401
- package/dist/index.js.map +2 -2
- package/dist/skills/fill_template.d.ts +4 -5
- package/dist/skills/fill_template.d.ts.map +1 -1
- package/dist/skills/parse_skills.d.ts.map +1 -1
- package/dist/skills/skill.d.ts +7 -8
- package/dist/skills/skill.d.ts.map +1 -1
- package/dist/tools/client_tool_registry.d.ts +2 -2
- package/dist/tools/page_action_tools.d.ts +7 -10
- package/dist/tools/page_action_tools.d.ts.map +1 -1
- package/dist/tools/page_state.d.ts +5 -8
- package/dist/tools/page_state.d.ts.map +1 -1
- package/dist/tools/route_map.d.ts +7 -10
- package/dist/tools/route_map.d.ts.map +1 -1
- package/dist/ui/approval_card.d.ts +15 -20
- package/dist/ui/approval_card.d.ts.map +1 -1
- package/dist/ui/attach_copy_buttons.d.ts +4 -10
- package/dist/ui/attach_copy_buttons.d.ts.map +1 -1
- package/dist/ui/attachment_chips.d.ts +13 -5
- package/dist/ui/attachment_chips.d.ts.map +1 -1
- package/dist/ui/attachment_tray.d.ts +6 -6
- package/dist/ui/attachment_tray.d.ts.map +1 -1
- package/dist/ui/checkpoint_menu.d.ts +7 -8
- package/dist/ui/checkpoint_menu.d.ts.map +1 -1
- package/dist/ui/confirmation_card.d.ts +10 -15
- package/dist/ui/confirmation_card.d.ts.map +1 -1
- package/dist/ui/question_card.d.ts +12 -15
- package/dist/ui/question_card.d.ts.map +1 -1
- package/dist/ui/relative_time.d.ts +5 -7
- package/dist/ui/relative_time.d.ts.map +1 -1
- package/dist/ui/render_markdown.d.ts +8 -8
- package/dist/ui/render_markdown.d.ts.map +1 -1
- package/dist/ui/resize_handle.d.ts +21 -34
- package/dist/ui/resize_handle.d.ts.map +1 -1
- package/dist/ui/run_notice.d.ts +5 -7
- package/dist/ui/run_notice.d.ts.map +1 -1
- package/dist/ui/skills_menu.d.ts +4 -5
- package/dist/ui/skills_menu.d.ts.map +1 -1
- package/dist/ui/styles.d.ts +1 -1
- package/dist/ui/styles.d.ts.map +1 -1
- package/dist/ui/thoughts_block.d.ts +9 -11
- package/dist/ui/thoughts_block.d.ts.map +1 -1
- package/dist/ui/thread_drawer.d.ts +6 -5
- package/dist/ui/thread_drawer.d.ts.map +1 -1
- package/dist/ui/tool_call_card.d.ts +17 -25
- package/dist/ui/tool_call_card.d.ts.map +1 -1
- package/dist/ui/ui_strings.d.ts +6 -12
- package/dist/ui/ui_strings.d.ts.map +1 -1
- package/dist/ui/voice_input.d.ts +10 -11
- package/dist/ui/voice_input.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/constants.ts +71 -80
- package/src/core/ag_ui_chat.ts +242 -292
- package/src/core/agui_client.ts +60 -71
- package/src/core/attachment.ts +9 -14
- package/src/core/conversation_store.ts +25 -33
- package/src/core/create_http_agent.ts +18 -22
- package/src/core/remote_conversation_store.ts +14 -15
- package/src/core/run_index.ts +14 -23
- package/src/core/transcribe_audio.ts +9 -10
- package/src/core/upload_attachment.ts +18 -21
- package/src/core/utils.ts +4 -6
- package/src/dom/animations.ts +33 -43
- package/src/dom/dom_driver.ts +7 -7
- package/src/dom/native_setter.ts +11 -12
- package/src/skills/fill_template.ts +4 -5
- package/src/skills/parse_skills.ts +3 -4
- package/src/skills/skill.ts +7 -8
- package/src/tools/client_tool_registry.ts +2 -2
- package/src/tools/page_action_tools.ts +12 -15
- package/src/tools/page_state.ts +5 -8
- package/src/tools/route_map.ts +15 -19
- package/src/ui/approval_card.ts +15 -20
- package/src/ui/attach_copy_buttons.ts +9 -18
- package/src/ui/attachment_chips.ts +19 -10
- package/src/ui/attachment_tray.ts +8 -7
- package/src/ui/checkpoint_menu.ts +7 -8
- package/src/ui/confirmation_card.ts +10 -15
- package/src/ui/question_card.ts +12 -15
- package/src/ui/relative_time.ts +5 -7
- package/src/ui/render_markdown.ts +25 -51
- package/src/ui/resize_handle.ts +25 -38
- package/src/ui/run_notice.ts +9 -12
- package/src/ui/skills_menu.ts +4 -5
- package/src/ui/styles.ts +122 -93
- package/src/ui/thoughts_block.ts +11 -13
- package/src/ui/thread_drawer.ts +6 -5
- package/src/ui/tool_call_card.ts +22 -32
- package/src/ui/ui_strings.ts +6 -12
- package/src/ui/voice_input.ts +10 -11
- package/src/version.ts +1 -1
package/dist/ui/ui_strings.d.ts
CHANGED
|
@@ -5,14 +5,9 @@
|
|
|
5
5
|
* or its `data-strings` JSON attribute) and the rest fall back to the English
|
|
6
6
|
* defaults.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* This module is one cohesive unit — the `UiStrings` shape, its `DEFAULT_UI_STRINGS`
|
|
13
|
-
* constant-like backing, and the {@link mergeUiStrings} merge over those defaults —
|
|
14
|
-
* so it bends the one-symbol-per-file rule the way `tool_call_card.ts` (class +
|
|
15
|
-
* its types) and `route_map.ts` (factory + its types) already do.
|
|
8
|
+
* Some values are templates carrying `{token}` placeholders the call site fills
|
|
9
|
+
* in; the token names are noted on each key, and a translation must keep them
|
|
10
|
+
* verbatim.
|
|
16
11
|
*/
|
|
17
12
|
export interface UiStrings {
|
|
18
13
|
/** Default header title (the `title-text` attribute overrides per element). */
|
|
@@ -26,10 +21,9 @@ export interface UiStrings {
|
|
|
26
21
|
/** Expand affordance (the launcher, and the sidebar rail). */
|
|
27
22
|
expand: string;
|
|
28
23
|
/**
|
|
29
|
-
* The launcher's label while unread answers
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* needs.
|
|
24
|
+
* The launcher's label while unread answers wait behind it. Token: `{count}`.
|
|
25
|
+
* Replaces {@link expand} rather than appending to it, so a translation can
|
|
26
|
+
* order the two parts as its language needs.
|
|
33
27
|
*/
|
|
34
28
|
expandUnread: string;
|
|
35
29
|
/** Built-in header theme toggle (light ⇄ dark). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui_strings.d.ts","sourceRoot":"","sources":["../../src/ui/ui_strings.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ui_strings.d.ts","sourceRoot":"","sources":["../../src/ui/ui_strings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,WAAW,SAAS;IAExB,+EAA+E;IAC/E,KAAK,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,OAAO,EAA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AAC,GAAG,SAAS,CASvE"}
|
package/dist/ui/voice_input.d.ts
CHANGED
|
@@ -14,13 +14,13 @@ export interface VoiceInputOptions {
|
|
|
14
14
|
* `MediaRecorder`, then POSTs the clip through a {@link TranscribeHandler} and
|
|
15
15
|
* hands the transcript back via `onText`.
|
|
16
16
|
*
|
|
17
|
-
* Click to start recording
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
17
|
+
* Click to start recording, which prompts for mic permission, and again to stop
|
|
18
|
+
* and transcribe. The button reflects its `idle` / `recording` / `transcribing`
|
|
19
|
+
* state on `data-state` for theming and is exposed as `part="voice-button"`; a
|
|
20
|
+
* capture or transcription failure returns it to idle and surfaces the message
|
|
21
|
+
* on its tooltip.
|
|
22
22
|
*
|
|
23
|
-
* Pure DOM
|
|
23
|
+
* Pure DOM. The host mounts {@link element} in the input row.
|
|
24
24
|
*/
|
|
25
25
|
export declare class VoiceInput {
|
|
26
26
|
#private;
|
|
@@ -30,11 +30,10 @@ export declare class VoiceInput {
|
|
|
30
30
|
/** Start recording when idle, stop (and transcribe) when recording. */
|
|
31
31
|
toggle(): Promise<void>;
|
|
32
32
|
/**
|
|
33
|
-
* Tear the control down
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* detached element.
|
|
33
|
+
* Tear the control down, for a host element removed mid-recording. Stops any
|
|
34
|
+
* live `MediaRecorder`, releases the mic tracks so the browser's recording
|
|
35
|
+
* indicator clears, and suppresses the pending transcription — a
|
|
36
|
+
* disconnected control must not fire `onText` into a detached element.
|
|
38
37
|
*/
|
|
39
38
|
dispose(): void;
|
|
40
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voice_input.d.ts","sourceRoot":"","sources":["../../src/ui/voice_input.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAsB,KAAK,SAAS,EA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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artooi/ag-ui-web-component",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.1",
|
|
4
4
|
"description": "Framework-free <ag-ui-chat> Web Component over the AG-UI protocol. Drop-in chat sidebar with a pluggable client-side tool registry, DOM driver primitives, animations, and destructive-action confirmation modal.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
package/src/constants.ts
CHANGED
|
@@ -1,55 +1,40 @@
|
|
|
1
|
-
// The package's single home for enums and constant-like values
|
|
2
|
-
// CLAUDE.md
|
|
1
|
+
// The package's single home for enums and constant-like values, and per
|
|
2
|
+
// CLAUDE.md the only file allowed to export multiple symbols.
|
|
3
3
|
|
|
4
4
|
/** The Custom Element tag name registered by {@link defineAgUiChat}. */
|
|
5
5
|
export const ELEMENT_TAG = "ag-ui-chat";
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
* Event dispatched by `<ag-ui-chat>` when the user submits a message.
|
|
9
|
-
* `detail` carries `{ content: string }`. Later phases wire this to the
|
|
10
|
-
* AG-UI client; for now it is the public seam for host integration.
|
|
11
|
-
*/
|
|
7
|
+
/** User submitted a message. `detail` is {@link SubmitDetail}. */
|
|
12
8
|
export const SUBMIT_EVENT = "ag-ui-submit";
|
|
13
9
|
|
|
14
10
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* `{ collapsed: boolean }`. A host can listen to drive its own chrome, or hide
|
|
18
|
-
* the built-in toggle and drive the `collapsed` attribute itself.
|
|
11
|
+
* Collapsed state changed, via the built-in toggle or `setCollapsed`.
|
|
12
|
+
* `detail` is {@link ToggleDetail}.
|
|
19
13
|
*/
|
|
20
14
|
export const TOGGLE_EVENT = "ag-ui-toggle";
|
|
21
15
|
|
|
22
16
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* The built-in badge on the launcher renders exactly this. A host driving its
|
|
28
|
-
* own chrome can turn the badge off with `data-unread-badge="false"` and listen
|
|
29
|
-
* here instead.
|
|
17
|
+
* The count of answers that arrived while collapsed changed. `detail` is
|
|
18
|
+
* {@link UnreadDetail}. The built-in launcher badge renders exactly this; a
|
|
19
|
+
* host driving its own chrome sets `data-unread-badge="false"` and listens.
|
|
30
20
|
*/
|
|
31
21
|
export const UNREAD_EVENT = "ag-ui-unread";
|
|
32
22
|
|
|
33
23
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* {@link AgUiChat.sharedState}. `detail` carries `{ state }`.
|
|
24
|
+
* AG-UI shared state changed — a streamed `STATE_SNAPSHOT` / `STATE_DELTA`, or
|
|
25
|
+
* a host assignment to `sharedState`. `detail` is {@link StateDetail}.
|
|
37
26
|
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
27
|
+
* The protocol's own state channel, distinct from `registerPageState`, which
|
|
28
|
+
* exposes host state to the agent as ordinary tools.
|
|
40
29
|
*/
|
|
41
30
|
export const STATE_EVENT = "ag-ui-state";
|
|
42
31
|
|
|
43
32
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* This is the seam for a host that drives its own composer: without it the tray
|
|
51
|
-
* only ever spoke to the built-in Send button, so a custom send had no way to
|
|
52
|
-
* know whether a file was ready or still uploading.
|
|
33
|
+
* The attachment tray changed — a file queued, an upload finishing or failing,
|
|
34
|
+
* a chip removed, the tray cleared after a send. `detail` is
|
|
35
|
+
* {@link AttachmentsDetail}, carrying the refs that finished uploading and how
|
|
36
|
+
* many are still in flight. A host driving its own composer uses this to know
|
|
37
|
+
* whether a send would leave files behind.
|
|
53
38
|
*/
|
|
54
39
|
export const ATTACHMENT_EVENT = "ag-ui-attachments";
|
|
55
40
|
|
|
@@ -60,43 +45,35 @@ export const MESSAGE_ROLE = {
|
|
|
60
45
|
} as const;
|
|
61
46
|
|
|
62
47
|
/**
|
|
63
|
-
*
|
|
64
|
-
* `
|
|
65
|
-
*
|
|
66
|
-
* confirmation modal (unless `autoConfirm` is set).
|
|
48
|
+
* Schema-root key marking a tool destructive: the element gates its execution
|
|
49
|
+
* behind the confirmation card unless `autoConfirm` is set. All four `x-*` keys
|
|
50
|
+
* below mirror the `django-ag-ui` server side.
|
|
67
51
|
*/
|
|
68
52
|
export const X_DESTRUCTIVE_KEY = "x-destructive";
|
|
69
53
|
|
|
70
54
|
/**
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* server side. When present, the inline confirmation card shows this instead of
|
|
74
|
-
* the generic `Run "<tool>"?`.
|
|
55
|
+
* Schema-root key holding a confirmation prompt (e.g. `"Activate this
|
|
56
|
+
* project?"`), shown instead of the generic `Run "<tool>"?`.
|
|
75
57
|
*/
|
|
76
58
|
export const X_CONFIRM_KEY = "x-confirm";
|
|
77
59
|
|
|
78
60
|
/**
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
* side; the tool-call card shows it instead of the raw tool name when present.
|
|
61
|
+
* Schema-root key holding a short label for a tool (e.g. `"Query orders"` for
|
|
62
|
+
* `query_model`), shown on the card instead of the raw tool name.
|
|
82
63
|
*/
|
|
83
64
|
export const X_SUMMARY_KEY = "x-summary";
|
|
84
65
|
|
|
85
66
|
/**
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
* and resumes the run loop once the next page mounts. Mirrors `x-destructive`.
|
|
67
|
+
* Schema-root key marking a tool as navigating — its handler triggers a full
|
|
68
|
+
* page reload. The element checkpoints the call before the reload and resumes
|
|
69
|
+
* the run loop once the next page mounts.
|
|
90
70
|
*/
|
|
91
71
|
export const X_NAVIGATES_KEY = "x-navigates";
|
|
92
72
|
|
|
93
73
|
/**
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
* also the documented recovery from a stale page, so the stale-page guard has
|
|
98
|
-
* to exempt it — refusing the very call that would refresh the agent's view
|
|
99
|
-
* would be a deadlock.
|
|
74
|
+
* The built-in tool that re-reads the current page, registered only when a
|
|
75
|
+
* page-map provider is set. Named here because the stale-page guard must exempt
|
|
76
|
+
* it: refusing the one call that would refresh the agent's view deadlocks.
|
|
100
77
|
*/
|
|
101
78
|
export const READ_PAGE_TOOL = "read_page";
|
|
102
79
|
|
|
@@ -127,23 +104,20 @@ export const ATTACHMENT_STATUS = {
|
|
|
127
104
|
|
|
128
105
|
/**
|
|
129
106
|
* Default client-side upload size cap (10 MiB), matching django-ag-ui's
|
|
130
|
-
* `ATTACHMENT_MAX_BYTES
|
|
131
|
-
*
|
|
107
|
+
* `ATTACHMENT_MAX_BYTES`. Overridable via `data-attachment-max-bytes`; the
|
|
108
|
+
* server stays authoritative.
|
|
132
109
|
*/
|
|
133
110
|
export const DEFAULT_ATTACHMENT_MAX_BYTES = 10 * 1024 * 1024;
|
|
134
111
|
|
|
135
112
|
/**
|
|
136
|
-
* How much detail a tool-call card shows. Set via
|
|
137
|
-
*
|
|
113
|
+
* How much detail a tool-call card shows. Set via `data-tool-display`; the
|
|
114
|
+
* default is `full`.
|
|
138
115
|
*
|
|
139
|
-
* - `inline` —
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
* - `
|
|
144
|
-
* - `compact` — name + status, with args *and* result tucked behind a single
|
|
145
|
-
* collapsed "Details" toggle. The light default for dense UIs.
|
|
146
|
-
* - `full` — args shown inline, result behind its own toggle (the original).
|
|
116
|
+
* - `inline` — one status row (icon + summary), no card chrome, result behind
|
|
117
|
+
* its own toggle. Reads as a line of the answer rather than a boxed card.
|
|
118
|
+
* - `minimal` — tool name + status pill only. No args, no result body.
|
|
119
|
+
* - `compact` — name + status, args and result behind one "Details" toggle.
|
|
120
|
+
* - `full` — args inline, result behind its own toggle.
|
|
147
121
|
*/
|
|
148
122
|
export const TOOL_DISPLAY = {
|
|
149
123
|
INLINE: "inline",
|
|
@@ -153,32 +127,32 @@ export const TOOL_DISPLAY = {
|
|
|
153
127
|
} as const;
|
|
154
128
|
|
|
155
129
|
/**
|
|
156
|
-
* `activityType` of the
|
|
157
|
-
*
|
|
158
|
-
*
|
|
130
|
+
* `activityType` of the `ACTIVITY_SNAPSHOT` event django-ag-ui emits when a
|
|
131
|
+
* compaction capability trimmed the history. `content` carries
|
|
132
|
+
* `{ removed, before, after }`.
|
|
159
133
|
*/
|
|
160
134
|
export const COMPACTION_ACTIVITY_TYPE = "compaction";
|
|
161
135
|
|
|
162
136
|
/**
|
|
163
|
-
* Pydantic-AI's built-in tool
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
* reaches the client — there is no separate event for it.
|
|
137
|
+
* Pydantic-AI's built-in tool for loading a deferred capability, with `{ id }`
|
|
138
|
+
* naming it. Agent skills are deferred capabilities keyed by skill name, so a
|
|
139
|
+
* call to this tool is the only signal that the agent picked a skill.
|
|
167
140
|
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
141
|
+
* Distinct from the host-provided {@link Skill} catalog, which is a human
|
|
142
|
+
* affordance launched from the slash palette.
|
|
170
143
|
*/
|
|
171
144
|
export const LOAD_CAPABILITY_TOOL = "load_capability";
|
|
172
145
|
|
|
173
146
|
/**
|
|
174
147
|
* The chrome's glyphs, as inline SVG markup.
|
|
175
148
|
*
|
|
176
|
-
* Static
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
* of stroking. A host
|
|
181
|
-
* `slot="icon-…"` child
|
|
149
|
+
* Static author-written markup assigned as a `<slot>`'s fallback content, so it
|
|
150
|
+
* never passes through the sanitiser — nothing here is user or server data, and
|
|
151
|
+
* nothing user-supplied may be interpolated into it. Each icon is a 24x24
|
|
152
|
+
* viewBox carrying the shared `glyph` class, which `STYLES` sizes and paints
|
|
153
|
+
* from `currentColor`; `glyph--solid` fills instead of stroking. A host wanting
|
|
154
|
+
* its own mark projects a matching `slot="icon-…"` child instead of editing
|
|
155
|
+
* these.
|
|
182
156
|
*/
|
|
183
157
|
export const ICON_SEND = `<svg class="glyph" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 19.5V5m-6.5 6.5L12 5l6.5 6.5"/></svg>`;
|
|
184
158
|
|
|
@@ -193,3 +167,20 @@ export const ICON_VOICE = `<svg class="glyph" viewBox="0 0 24 24" aria-hidden="t
|
|
|
193
167
|
|
|
194
168
|
/** The default launcher mark (a speech bubble), shown when the host slots none. */
|
|
195
169
|
export const ICON_LAUNCHER = `<svg class="glyph" viewBox="0 0 24 24" aria-hidden="true"><path d="M4 5.5A2.5 2.5 0 0 1 6.5 3h11A2.5 2.5 0 0 1 20 5.5v8a2.5 2.5 0 0 1-2.5 2.5H9l-5 4z"/></svg>`;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* The generic attachment-chip mark, for a file family with nothing more
|
|
173
|
+
* specific to say. The chip marks share the contract of the chrome glyphs
|
|
174
|
+
* above; `iconFor` selects one by MIME family, never interpolating the MIME
|
|
175
|
+
* string into the markup.
|
|
176
|
+
*/
|
|
177
|
+
export const ICON_FILE = `<svg class="glyph" viewBox="0 0 24 24" aria-hidden="true"><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/></svg>`;
|
|
178
|
+
|
|
179
|
+
/** An image attachment: a framed picture with a horizon and a sun. */
|
|
180
|
+
export const ICON_FILE_IMAGE = `<svg class="glyph" viewBox="0 0 24 24" aria-hidden="true"><rect x="3.5" y="4.5" width="17" height="15" rx="2.5"/><circle cx="9" cy="10" r="1.5"/><path d="M4.5 17.5 9 13.5l3.5 3 3-2.5 4.5 4"/></svg>`;
|
|
181
|
+
|
|
182
|
+
/** A PDF: the generic page, banded to read as a labelled document. */
|
|
183
|
+
export const ICON_FILE_PDF = `<svg class="glyph" viewBox="0 0 24 24" aria-hidden="true"><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/><rect class="glyph--solid" x="7.5" y="13.5" width="9" height="4.5" rx="1"/></svg>`;
|
|
184
|
+
|
|
185
|
+
/** A text document: the generic page, ruled. */
|
|
186
|
+
export const ICON_FILE_TEXT = `<svg class="glyph" viewBox="0 0 24 24" aria-hidden="true"><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/><path d="M8.5 13.5h7M8.5 17h4.5"/></svg>`;
|