@k2b/ui 0.9.0 → 0.10.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/browser/actions/Button.js +15 -7
- package/dist/browser/actions/Button.js.map +1 -1
- package/dist/browser/actions/ContextMenu.js +55 -15
- package/dist/browser/actions/ContextMenu.js.map +1 -1
- package/dist/browser/actions/Dropdown.js +39 -15
- package/dist/browser/actions/Dropdown.js.map +1 -1
- package/dist/browser/actions/FilterChip.js +1 -7
- package/dist/browser/actions/FilterChip.js.map +1 -1
- package/dist/browser/actions/SplitButton.js +0 -3
- package/dist/browser/actions/SplitButton.js.map +1 -1
- package/dist/browser/chat/ChatComposer.js +78 -91
- package/dist/browser/chat/ChatComposer.js.map +1 -1
- package/dist/browser/chat/ChatContextPopup.js +47 -21
- package/dist/browser/chat/ChatContextPopup.js.map +1 -1
- package/dist/browser/chat/ChatPrimitives.js +221 -232
- package/dist/browser/chat/ChatPrimitives.js.map +1 -1
- package/dist/browser/chat/index.js +3 -2
- package/dist/browser/chat/index.js.map +1 -1
- package/dist/browser/content/Chart.js +99 -106
- package/dist/browser/content/Chart.js.map +1 -1
- package/dist/browser/content/ChartExplorer.js +3 -6
- package/dist/browser/content/ChartExplorer.js.map +1 -1
- package/dist/browser/content/FileBrowser.js +1 -1
- package/dist/browser/content/FileBrowser.js.map +1 -1
- package/dist/browser/content/FileTree.js +1 -1
- package/dist/browser/content/FileTree.js.map +1 -1
- package/dist/browser/content/FileView.js +304 -287
- package/dist/browser/content/FileView.js.map +1 -1
- package/dist/browser/content/Lightbox.js +18 -0
- package/dist/browser/content/Lightbox.js.map +1 -1
- package/dist/browser/content/MarkdownView.js +8 -1
- package/dist/browser/content/MarkdownView.js.map +1 -1
- package/dist/browser/content/PdfPreview.js +68 -43
- package/dist/browser/content/PdfPreview.js.map +1 -1
- package/dist/browser/content/ZoomPanViewport.js +51 -52
- package/dist/browser/content/ZoomPanViewport.js.map +1 -1
- package/dist/browser/feedback/HoverPreview.js +391 -0
- package/dist/browser/feedback/HoverPreview.js.map +1 -0
- package/dist/browser/feedback/Tooltip.js +50 -8
- package/dist/browser/feedback/Tooltip.js.map +1 -1
- package/dist/browser/feedback/dialog-core.js +21 -3
- package/dist/browser/feedback/dialog-core.js.map +1 -1
- package/dist/browser/feedback/index.js +1 -0
- package/dist/browser/feedback/index.js.map +1 -1
- package/dist/browser/inputs/AutocompleteEditor.js +5 -4
- package/dist/browser/inputs/AutocompleteEditor.js.map +1 -1
- package/dist/browser/inputs/DatePicker.js +10 -0
- package/dist/browser/inputs/DatePicker.js.map +1 -1
- package/dist/browser/inputs/FileInputs.js +46 -36
- package/dist/browser/inputs/FileInputs.js.map +1 -1
- package/dist/browser/inputs/SelectChip.js +2 -1
- package/dist/browser/inputs/SelectChip.js.map +1 -1
- package/dist/browser/inputs/choice.js +5 -1
- package/dist/browser/inputs/choice.js.map +1 -1
- package/dist/browser/inputs/markdown/MarkdownEditor.js +173 -173
- package/dist/browser/inputs/markdown/MarkdownEditor.js.map +1 -1
- package/dist/browser/inputs/markdown/Toolbar.js +31 -34
- package/dist/browser/inputs/markdown/Toolbar.js.map +1 -1
- package/dist/browser/internal/focus-return.js +61 -0
- package/dist/browser/internal/focus-return.js.map +1 -0
- package/dist/browser/layout/AppOverview.js +1 -1
- package/dist/browser/layout/AppOverview.js.map +1 -1
- package/dist/browser/layout/DetailPanel.js +16 -15
- package/dist/browser/layout/DetailPanel.js.map +1 -1
- package/dist/browser/layout/FloatingWindow.js +3 -1
- package/dist/browser/layout/FloatingWindow.js.map +1 -1
- package/dist/browser/layout/PanelDialog.js +10 -9
- package/dist/browser/layout/PanelDialog.js.map +1 -1
- package/dist/browser/layout/Panes.js +82 -81
- package/dist/browser/layout/Panes.js.map +1 -1
- package/dist/browser/layout/SidebarItemPreview.js +48 -136
- package/dist/browser/layout/SidebarItemPreview.js.map +1 -1
- package/dist/browser/layout/app-workspace-controller.js +5 -2
- package/dist/browser/layout/app-workspace-controller.js.map +1 -1
- package/dist/browser/surfaces/ProgressBar.js.map +1 -1
- package/dist/browser/surfaces/ProgressRing.js +72 -0
- package/dist/browser/surfaces/ProgressRing.js.map +1 -0
- package/dist/browser/surfaces/index.js +1 -0
- package/dist/browser/surfaces/index.js.map +1 -1
- package/dist/ssr/actions/Button.js +15 -7
- package/dist/ssr/actions/Button.js.map +1 -1
- package/dist/ssr/actions/ContextMenu.js +55 -15
- package/dist/ssr/actions/ContextMenu.js.map +1 -1
- package/dist/ssr/actions/Dropdown.js +31 -12
- package/dist/ssr/actions/Dropdown.js.map +1 -1
- package/dist/ssr/actions/FilterChip.js +1 -7
- package/dist/ssr/actions/FilterChip.js.map +1 -1
- package/dist/ssr/actions/SplitButton.js +0 -3
- package/dist/ssr/actions/SplitButton.js.map +1 -1
- package/dist/ssr/chat/ChatComposer.js +61 -10
- package/dist/ssr/chat/ChatComposer.js.map +1 -1
- package/dist/ssr/chat/ChatContextPopup.js +19 -5
- package/dist/ssr/chat/ChatContextPopup.js.map +1 -1
- package/dist/ssr/chat/ChatPrimitives.js +104 -74
- package/dist/ssr/chat/ChatPrimitives.js.map +1 -1
- package/dist/ssr/chat/index.js +3 -2
- package/dist/ssr/chat/index.js.map +1 -1
- package/dist/ssr/content/Chart.js +22 -11
- package/dist/ssr/content/Chart.js.map +1 -1
- package/dist/ssr/content/ChartExplorer.js +3 -6
- package/dist/ssr/content/ChartExplorer.js.map +1 -1
- package/dist/ssr/content/FileBrowser.js +1 -1
- package/dist/ssr/content/FileBrowser.js.map +1 -1
- package/dist/ssr/content/FileTree.js +1 -1
- package/dist/ssr/content/FileTree.js.map +1 -1
- package/dist/ssr/content/FileView.js +105 -33
- package/dist/ssr/content/FileView.js.map +1 -1
- package/dist/ssr/content/Lightbox.js +17 -0
- package/dist/ssr/content/Lightbox.js.map +1 -1
- package/dist/ssr/content/MarkdownView.js +8 -1
- package/dist/ssr/content/MarkdownView.js.map +1 -1
- package/dist/ssr/content/PdfPreview.js +44 -14
- package/dist/ssr/content/PdfPreview.js.map +1 -1
- package/dist/ssr/content/ZoomPanViewport.js +11 -3
- package/dist/ssr/content/ZoomPanViewport.js.map +1 -1
- package/dist/ssr/feedback/HoverPreview.js +360 -0
- package/dist/ssr/feedback/HoverPreview.js.map +1 -0
- package/dist/ssr/feedback/Tooltip.js +50 -8
- package/dist/ssr/feedback/Tooltip.js.map +1 -1
- package/dist/ssr/feedback/dialog-core.js +21 -3
- package/dist/ssr/feedback/dialog-core.js.map +1 -1
- package/dist/ssr/feedback/index.js +1 -0
- package/dist/ssr/feedback/index.js.map +1 -1
- package/dist/ssr/inputs/AutocompleteEditor.js +5 -4
- package/dist/ssr/inputs/AutocompleteEditor.js.map +1 -1
- package/dist/ssr/inputs/DatePicker.js +5 -0
- package/dist/ssr/inputs/DatePicker.js.map +1 -1
- package/dist/ssr/inputs/FileInputs.js +29 -11
- package/dist/ssr/inputs/FileInputs.js.map +1 -1
- package/dist/ssr/inputs/SelectChip.js +2 -1
- package/dist/ssr/inputs/SelectChip.js.map +1 -1
- package/dist/ssr/inputs/choice.js +5 -1
- package/dist/ssr/inputs/choice.js.map +1 -1
- package/dist/ssr/inputs/markdown/MarkdownEditor.js +46 -10
- package/dist/ssr/inputs/markdown/MarkdownEditor.js.map +1 -1
- package/dist/ssr/inputs/markdown/Toolbar.js +30 -2
- package/dist/ssr/inputs/markdown/Toolbar.js.map +1 -1
- package/dist/ssr/internal/focus-return.js +61 -0
- package/dist/ssr/internal/focus-return.js.map +1 -0
- package/dist/ssr/layout/AppOverview.js +1 -1
- package/dist/ssr/layout/AppOverview.js.map +1 -1
- package/dist/ssr/layout/DetailPanel.js +16 -15
- package/dist/ssr/layout/DetailPanel.js.map +1 -1
- package/dist/ssr/layout/FloatingWindow.js +3 -1
- package/dist/ssr/layout/FloatingWindow.js.map +1 -1
- package/dist/ssr/layout/PanelDialog.js +10 -9
- package/dist/ssr/layout/PanelDialog.js.map +1 -1
- package/dist/ssr/layout/Panes.js +39 -8
- package/dist/ssr/layout/Panes.js.map +1 -1
- package/dist/ssr/layout/SidebarItemPreview.js +36 -108
- package/dist/ssr/layout/SidebarItemPreview.js.map +1 -1
- package/dist/ssr/layout/app-workspace-controller.js +5 -2
- package/dist/ssr/layout/app-workspace-controller.js.map +1 -1
- package/dist/ssr/surfaces/ProgressBar.js.map +1 -1
- package/dist/ssr/surfaces/ProgressRing.js +31 -0
- package/dist/ssr/surfaces/ProgressRing.js.map +1 -0
- package/dist/ssr/surfaces/index.js +1 -0
- package/dist/ssr/surfaces/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/tabler-icons-15sezdfp.woff2 +0 -0
- package/dist/tabler.css +2 -2
- package/dist/types/actions/Button.d.ts +5 -0
- package/dist/types/actions/Dropdown.d.ts +5 -1
- package/dist/types/actions/SplitButton.d.ts +1 -0
- package/dist/types/chat/ChatContextPopup.d.ts +8 -0
- package/dist/types/chat/index.d.ts +3 -2
- package/dist/types/feedback/HoverPreview.d.ts +83 -0
- package/dist/types/feedback/Tooltip.d.ts +6 -0
- package/dist/types/feedback/index.d.ts +2 -0
- package/dist/types/feedback/prompts.d.ts +9 -6
- package/dist/types/inputs/SelectChip.d.ts +1 -0
- package/dist/types/inputs/completion/overlay.d.ts +3 -1
- package/dist/types/internal/focus-return.d.ts +20 -0
- package/dist/types/intl/Format.d.ts +16 -8
- package/dist/types/layout/BottomSheet.d.ts +6 -1
- package/dist/types/layout/SidebarItemPreview.d.ts +1 -1
- package/dist/types/surfaces/ProgressBar.d.ts +1 -1
- package/dist/types/surfaces/ProgressRing.d.ts +13 -0
- package/dist/types/surfaces/index.d.ts +2 -0
- package/package.json +9 -8
- package/dist/tabler-icons-q30jt7jk.woff2 +0 -0
|
@@ -20,24 +20,24 @@ var _tmpl$ = "<span class=\"k2b-chat-progress-dots\" aria-hidden=\"true\"><span>
|
|
|
20
20
|
_tmpl$11 = ["<a class=\"k2b-chat-message__attachment\"", " role=\"listitem\"", " target=\"_blank\" rel=\"noopener noreferrer\"", ">", "</a>"],
|
|
21
21
|
_tmpl$12 = ["<span class=\"k2b-chat-message__status\"", "><i", " aria-hidden=\"true\"></i>", "</span>"],
|
|
22
22
|
_tmpl$13 = ["<time", ">", "</time>"],
|
|
23
|
-
_tmpl$14 = ["<
|
|
24
|
-
_tmpl$15 = ["<span class=\"k2b-chat-
|
|
25
|
-
_tmpl$16 = ["<span class=\"k2b-chat-
|
|
26
|
-
_tmpl$17 =
|
|
27
|
-
_tmpl$18 = "<i
|
|
28
|
-
_tmpl$19 = ["<
|
|
29
|
-
_tmpl$20 = ["<
|
|
30
|
-
_tmpl$21 = ["<
|
|
31
|
-
_tmpl$22 =
|
|
32
|
-
_tmpl$23 = "<
|
|
33
|
-
_tmpl$24 = ["<div><dt>", "</dt><dd>", "</dd></div>"]
|
|
34
|
-
_tmpl$25 = ["<div class=\"k2b-chat-context__tooltip\"><strong>", "</strong>", "<dl>", "<div><dt>", "</dt><dd>", "</dd></div><div><dt>", "</dt><dd>", "</dd></div>", "<div><dt>", "</dt><dd>", "</dd></div>", "</dl>", "</div>"];
|
|
23
|
+
_tmpl$14 = ["<span class=\"k2b-chat-activity__leading\" aria-hidden=\"true\">", "</span>"],
|
|
24
|
+
_tmpl$15 = ["<span class=\"k2b-chat-activity__copy\"><strong>", "</strong>", "</span>"],
|
|
25
|
+
_tmpl$16 = ["<span class=\"k2b-chat-activity__trailing\">", "</span>"],
|
|
26
|
+
_tmpl$17 = "<i class=\"ti ti-chevron-right k2b-chat-activity__chevron\" aria-hidden=\"true\"></i>",
|
|
27
|
+
_tmpl$18 = ["<i", "></i>"],
|
|
28
|
+
_tmpl$19 = ["<small>", "</small>"],
|
|
29
|
+
_tmpl$20 = ["<details class=\"", "\"", " style=\"", "\"", "><summary class=\"k2b-chat-activity__row\">", "</summary><div class=\"k2b-chat-activity__body\">", "</div></details>"],
|
|
30
|
+
_tmpl$21 = ["<div class=\"", "\"", " style=\"", "\"", "><div class=\"k2b-chat-activity__row\">", "</div></div>"],
|
|
31
|
+
_tmpl$22 = "<i class=\"ti ti-brain\" aria-hidden=\"true\"></i>",
|
|
32
|
+
_tmpl$23 = ["<div><dt>", "</dt><dd>", "</dd></div>"],
|
|
33
|
+
_tmpl$24 = ["<dl>", "<div><dt>", "</dt><dd>", "</dd></div><div><dt>", "</dt><dd>", "</dd></div>", "<div><dt>", "</dt><dd>", "</dd></div>", "</dl>"];
|
|
35
34
|
import { createSignal, For, onCleanup, Show } from "solid-js";
|
|
36
35
|
import { Button } from "../actions/Button";
|
|
37
36
|
import { Dropdown } from "../actions/Dropdown";
|
|
37
|
+
import { Tooltip } from "../feedback/Tooltip";
|
|
38
38
|
import { useUiMessages } from "../intl/messages";
|
|
39
39
|
import { ProgressBar } from "../surfaces/ProgressBar";
|
|
40
|
-
import { ChatContextPopup } from "./ChatContextPopup";
|
|
40
|
+
import { ChatContextPanel, ChatContextPopup } from "./ChatContextPopup";
|
|
41
41
|
import { executeChatAction } from "./chat-behavior";
|
|
42
42
|
const roleLabel = (role, messages) => {
|
|
43
43
|
if (role === "assistant") return messages.assistant;
|
|
@@ -210,7 +210,31 @@ export function ChatMessage(props) {
|
|
|
210
210
|
get each() {
|
|
211
211
|
return actions();
|
|
212
212
|
},
|
|
213
|
-
children: action => _$
|
|
213
|
+
children: action => _$createComponent(Tooltip.Trigger, {
|
|
214
|
+
type: "button",
|
|
215
|
+
get ["aria-label"]() {
|
|
216
|
+
return action.label;
|
|
217
|
+
},
|
|
218
|
+
get ["aria-pressed"]() {
|
|
219
|
+
return action.pressed;
|
|
220
|
+
},
|
|
221
|
+
get ["data-pressed-tone"]() {
|
|
222
|
+
return action.pressedTone;
|
|
223
|
+
},
|
|
224
|
+
get content() {
|
|
225
|
+
return action.label;
|
|
226
|
+
},
|
|
227
|
+
get ["data-danger"]() {
|
|
228
|
+
return action.variant === "danger" ? "true" : undefined;
|
|
229
|
+
},
|
|
230
|
+
get disabled() {
|
|
231
|
+
return action.disabled || Boolean(busyActionId());
|
|
232
|
+
},
|
|
233
|
+
onClick: () => void runAction(action),
|
|
234
|
+
get children() {
|
|
235
|
+
return _$ssr(_tmpl$1, _$ssrAttribute("class", _$escape(actionIcon(action), true), false));
|
|
236
|
+
}
|
|
237
|
+
})
|
|
214
238
|
})));
|
|
215
239
|
}
|
|
216
240
|
})), _$escape(_$createComponent(Show, {
|
|
@@ -220,7 +244,6 @@ export function ChatMessage(props) {
|
|
|
220
244
|
get children() {
|
|
221
245
|
return _$createComponent(Dropdown.Root, {
|
|
222
246
|
position: "bottom-left",
|
|
223
|
-
width: "12rem",
|
|
224
247
|
get label() {
|
|
225
248
|
return messages().messageActions;
|
|
226
249
|
},
|
|
@@ -248,34 +271,34 @@ export function ChatMessage(props) {
|
|
|
248
271
|
}
|
|
249
272
|
})));
|
|
250
273
|
}
|
|
251
|
-
const ActivityContent = props => [_$ssr(_tmpl$
|
|
274
|
+
const ActivityContent = props => [_$ssr(_tmpl$14, _$escape(_$createComponent(Show, {
|
|
252
275
|
get when() {
|
|
253
276
|
return props.leading;
|
|
254
277
|
},
|
|
255
278
|
get fallback() {
|
|
256
|
-
return _$ssr(_tmpl$
|
|
279
|
+
return _$ssr(_tmpl$18, _$ssrAttribute("class", _$escape(props.icon ?? "ti ti-sparkles", true), false));
|
|
257
280
|
},
|
|
258
281
|
get children() {
|
|
259
282
|
return props.leading;
|
|
260
283
|
}
|
|
261
|
-
}))), _$ssr(_tmpl$
|
|
284
|
+
}))), _$ssr(_tmpl$15, _$escape(props.label), _$escape(_$createComponent(Show, {
|
|
262
285
|
get when() {
|
|
263
286
|
return props.description;
|
|
264
287
|
},
|
|
265
|
-
children: description => _$ssr(_tmpl$
|
|
288
|
+
children: description => _$ssr(_tmpl$19, _$escape(description()))
|
|
266
289
|
}))), _$createComponent(Show, {
|
|
267
290
|
get when() {
|
|
268
291
|
return props.trailing;
|
|
269
292
|
},
|
|
270
293
|
get children() {
|
|
271
|
-
return _$ssr(_tmpl$
|
|
294
|
+
return _$ssr(_tmpl$16, _$escape(props.trailing));
|
|
272
295
|
}
|
|
273
296
|
}), _$createComponent(Show, {
|
|
274
297
|
get when() {
|
|
275
298
|
return props.disclosure;
|
|
276
299
|
},
|
|
277
300
|
get children() {
|
|
278
|
-
return _$ssr(_tmpl$
|
|
301
|
+
return _$ssr(_tmpl$17);
|
|
279
302
|
}
|
|
280
303
|
})];
|
|
281
304
|
export function ChatActivity(props) {
|
|
@@ -290,10 +313,10 @@ export function ChatActivity(props) {
|
|
|
290
313
|
return props.renderBody || props.children;
|
|
291
314
|
},
|
|
292
315
|
get fallback() {
|
|
293
|
-
return _$ssr(_tmpl$
|
|
316
|
+
return _$ssr(_tmpl$21, `k2b-chat-activity ${_$escape(props.class ?? "", true)}`, _$ssrAttribute("data-tone", _$escape(tone(), true), false) + _$ssrAttribute("data-accent", props.accent ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("data-busy", props.busy ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("data-chat-anchor", props.anchorId !== undefined ? _$escape(String(props.anchorId), true) : _$escape(undefined, true), false), _$ssrStyle(style()), _$ssrAttribute("aria-busy", props.busy ? "true" : _$escape(undefined, true), false), _$escape(_$createComponent(ActivityContent, props)));
|
|
294
317
|
},
|
|
295
318
|
get children() {
|
|
296
|
-
return _$ssr(_tmpl$
|
|
319
|
+
return _$ssr(_tmpl$20, `k2b-chat-activity ${_$escape(props.class ?? "", true)}`, _$ssrAttribute("data-tone", _$escape(tone(), true), false) + _$ssrAttribute("data-accent", props.accent ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("data-busy", props.busy ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("data-body-inset", props.bodyInset === false ? "false" : _$escape(undefined, true), false) + _$ssrAttribute("data-chat-anchor", props.anchorId !== undefined ? _$escape(String(props.anchorId), true) : _$escape(undefined, true), false), _$ssrStyle(style()), _$ssrAttribute("open", open(), true) + _$ssrAttribute("aria-busy", props.busy ? "true" : _$escape(undefined, true), false), _$escape(_$createComponent(ActivityContent, _$mergeProps(props, {
|
|
297
320
|
disclosure: true
|
|
298
321
|
}))), props.renderBody ? _$escape(_$createComponent(Show, {
|
|
299
322
|
get when() {
|
|
@@ -343,62 +366,69 @@ export function ChatContextUsage(props) {
|
|
|
343
366
|
};
|
|
344
367
|
return _$createComponent(ChatContextPopup, {
|
|
345
368
|
get content() {
|
|
346
|
-
return _$
|
|
347
|
-
get
|
|
348
|
-
return
|
|
369
|
+
return _$createComponent(ChatContextPanel, {
|
|
370
|
+
get title() {
|
|
371
|
+
return messages().lastRequestContext;
|
|
349
372
|
},
|
|
350
373
|
get children() {
|
|
351
|
-
return _$createComponent(
|
|
352
|
-
get
|
|
353
|
-
return percent()
|
|
374
|
+
return [_$createComponent(Show, {
|
|
375
|
+
get when() {
|
|
376
|
+
return percent() !== null;
|
|
354
377
|
},
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
378
|
+
get children() {
|
|
379
|
+
return _$createComponent(ProgressBar, {
|
|
380
|
+
get value() {
|
|
381
|
+
return percent() ?? 0;
|
|
382
|
+
},
|
|
383
|
+
size: "xs",
|
|
384
|
+
get tone() {
|
|
385
|
+
return (percent() ?? 0) >= 85 ? "danger" : "info";
|
|
386
|
+
},
|
|
387
|
+
get label() {
|
|
388
|
+
return messages().contextWindowUsed;
|
|
389
|
+
}
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
}), _$ssr(_tmpl$24, _$escape(_$createComponent(Show, {
|
|
393
|
+
get when() {
|
|
394
|
+
return props.modelLabel;
|
|
358
395
|
},
|
|
359
|
-
|
|
360
|
-
|
|
396
|
+
children: model => _$ssr(_tmpl$23, _$escape(messages().model), _$escape(model()))
|
|
397
|
+
})), _$escape(messages().input), _$escape(formattedUsageValue(usage().input)), _$escape(messages().output), _$escape(formattedUsageValue(usage().output)), _$escape(_$createComponent(Show, {
|
|
398
|
+
get when() {
|
|
399
|
+
return loopUsage().reported;
|
|
400
|
+
},
|
|
401
|
+
get children() {
|
|
402
|
+
return _$ssr(_tmpl$23, _$escape(messages().loopTotal), _$escape(formattedUsageValue(loopUsage().total)));
|
|
361
403
|
}
|
|
362
|
-
})
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
404
|
+
})), _$escape(messages().window), windowSize() > 0 ? _$escape(formatNumber(windowSize())) : _$escape(messages().notConfigured), _$escape(_$createComponent(Show, {
|
|
405
|
+
get when() {
|
|
406
|
+
return remaining() !== null;
|
|
407
|
+
},
|
|
408
|
+
get children() {
|
|
409
|
+
return _$ssr(_tmpl$23, _$escape(messages().remaining), remaining() === null ? _$escape(messages().unknown) : _$escape(formatNumber(remaining())));
|
|
410
|
+
}
|
|
411
|
+
}))), _$createComponent(Show, {
|
|
412
|
+
get when() {
|
|
413
|
+
return props.action;
|
|
414
|
+
},
|
|
415
|
+
children: action => _$createComponent(Button, {
|
|
416
|
+
size: "xs",
|
|
417
|
+
variant: "subtle",
|
|
418
|
+
get disabled() {
|
|
419
|
+
return action().disabled || busy();
|
|
420
|
+
},
|
|
421
|
+
onClick: () => void run(),
|
|
422
|
+
get ["aria-busy"]() {
|
|
423
|
+
return busy();
|
|
424
|
+
},
|
|
425
|
+
get children() {
|
|
426
|
+
return [_$ssr(_tmpl$1, _$ssrAttribute("class", busy() ? "ti ti-loader-2 k2b-spin" : _$escape(action().icon, true), false)), action().label];
|
|
427
|
+
}
|
|
428
|
+
})
|
|
429
|
+
})];
|
|
382
430
|
}
|
|
383
|
-
})
|
|
384
|
-
get when() {
|
|
385
|
-
return props.action;
|
|
386
|
-
},
|
|
387
|
-
children: action => _$createComponent(Button, {
|
|
388
|
-
size: "xs",
|
|
389
|
-
variant: "subtle",
|
|
390
|
-
get disabled() {
|
|
391
|
-
return action().disabled || busy();
|
|
392
|
-
},
|
|
393
|
-
onClick: () => void run(),
|
|
394
|
-
get ["aria-busy"]() {
|
|
395
|
-
return busy();
|
|
396
|
-
},
|
|
397
|
-
get children() {
|
|
398
|
-
return [_$ssr(_tmpl$1, _$ssrAttribute("class", busy() ? "ti ti-loader-2 k2b-spin" : _$escape(action().icon, true), false)), action().label];
|
|
399
|
-
}
|
|
400
|
-
})
|
|
401
|
-
})));
|
|
431
|
+
});
|
|
402
432
|
},
|
|
403
433
|
type: "button",
|
|
404
434
|
get ["class"]() {
|
|
@@ -411,7 +441,7 @@ export function ChatContextUsage(props) {
|
|
|
411
441
|
return accessibleLabel();
|
|
412
442
|
},
|
|
413
443
|
get children() {
|
|
414
|
-
return [_$ssr(_tmpl$
|
|
444
|
+
return [_$ssr(_tmpl$22), _$ssr(_tmpl$0, percent() === null ? "–" : `${_$escape(percent())}%`)];
|
|
415
445
|
}
|
|
416
446
|
});
|
|
417
447
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["chat/ChatPrimitives.tsx"],"sourcesContent":["import { createSignal, For, type JSX, onCleanup, Show } from \"solid-js\";\nimport { Button } from \"../actions/Button\";\nimport { Dropdown, type DropdownItem } from \"../actions/Dropdown\";\nimport { type UiMessages, useUiMessages } from \"../intl/messages\";\nimport { ProgressBar } from \"../surfaces/ProgressBar\";\nimport { ChatContextPopup } from \"./ChatContextPopup\";\nimport { executeChatAction } from \"./chat-behavior\";\nimport type { ChatAction, ChatActivityTone, ChatAttachment, ChatContextUsageData, ChatMessageStatus, ChatRole } from \"./types\";\n\nexport type ChatMessageProps = {\n role: ChatRole;\n children?: JSX.Element;\n label?: string;\n createdAt?: string | Date;\n timeLabel?: string;\n status?: ChatMessageStatus;\n attachments?: readonly ChatAttachment[];\n actions?: readonly ChatAction[];\n actionDisplay?: \"auto\" | \"inline\" | \"menu\";\n anchorId?: string | number;\n onActionError?: (error: unknown) => void;\n class?: string;\n};\n\nexport type ChatActivityProps = {\n label: string;\n description?: string;\n icon?: string;\n /** Optional host-owned leading visual rendered instead of the icon. */\n leading?: JSX.Element;\n /** Optional identity accent for the leading visual. Semantic tones still take precedence. */\n accent?: string;\n tone?: ChatActivityTone;\n /** Marks the activity as running with the shared accent sweep. */\n busy?: boolean;\n trailing?: JSX.Element;\n /** Controlled disclosure state. Omit to keep native details behavior. */\n open?: boolean;\n /** Reports disclosure changes when `open` is controlled by the host. */\n onOpenChange?: (open: boolean) => void;\n defaultOpen?: boolean;\n /** Set to false when the body is a peer list that should align with the activity row. */\n bodyInset?: boolean;\n anchorId?: string | number;\n children?: JSX.Element;\n /** Mount expensive details only while expanded. */\n renderBody?: () => JSX.Element;\n class?: string;\n};\n\nexport type ChatContextUsageProps = ChatContextUsageData & {\n action?: ChatAction;\n onActionError?: (error: unknown) => void;\n /** Host-owned number formatting. The default is locale-independent and SSR-stable. */\n formatNumber?: (value: number) => string;\n class?: string;\n};\n\nconst roleLabel = (role: ChatRole, messages: UiMessages): string => {\n if (role === \"assistant\") return messages.assistant;\n if (role === \"user\") return messages.user;\n if (role === \"tool\") return messages.tool;\n return messages.system;\n};\n\nconst statusLabel = (status: ChatMessageStatus | undefined, messages: UiMessages): string | null => {\n if (status === \"pending\") return messages.waiting;\n if (status === \"streaming\") return messages.generating;\n if (status === \"error\") return messages.failed;\n return null;\n};\n\nconst statusIcon = (status: ChatMessageStatus | undefined): string => {\n if (status === \"pending\") return \"ti ti-clock\";\n return \"ti ti-alert-circle\";\n};\n\nconst ChatProgressDots = () => (\n <span class=\"k2b-chat-progress-dots\" aria-hidden=\"true\">\n <span />\n <span />\n <span />\n </span>\n);\n\nconst attachmentIcon = (attachment: ChatAttachment): string =>\n attachment.icon ?? (attachment.kind === \"image\" ? \"ti ti-photo\" : attachment.kind === \"resource\" ? \"ti ti-link\" : \"ti ti-file\");\n\nconst finiteNonNegative = (value: number | undefined): number =>\n typeof value === \"number\" && Number.isFinite(value) ? Math.max(0, value) : 0;\n\nconst finiteUsageValue = (value: number | undefined): number | null =>\n typeof value === \"number\" && Number.isFinite(value) && value >= 0 ? value : null;\n\nconst normalizedUsage = (usage: ChatContextUsageData[\"usage\"]) => {\n const input = finiteUsageValue(usage?.input);\n const output = finiteUsageValue(usage?.output);\n const explicitTotal = finiteUsageValue(usage?.total);\n const total = explicitTotal ?? (input !== null || output !== null ? (input ?? 0) + (output ?? 0) : null);\n return { input, output, total, reported: total !== null };\n};\n\nconst formatStableInteger = (value: number): string => {\n const digits = String(Math.round(finiteNonNegative(value)));\n return digits.replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n};\n\nexport const formatChatTokens = (tokens: number): string => {\n const value = finiteNonNegative(tokens);\n if (value >= 1_000_000) return `${(value / 1_000_000).toFixed(1)}M`;\n if (value >= 1_000) return `${(value / 1_000).toFixed(1)}k`;\n return String(Math.round(value));\n};\n\nconst dateTime = (value: string | Date | undefined): string | null => {\n if (!value) return null;\n const date = value instanceof Date ? value : new Date(value);\n return Number.isFinite(date.getTime()) ? date.toISOString() : null;\n};\n\nexport function ChatMessage(props: ChatMessageProps): JSX.Element {\n const messages = useUiMessages();\n const [busyActionId, setBusyActionId] = createSignal<string | null>(null);\n const [completedActionId, setCompletedActionId] = createSignal<string | null>(null);\n let completedTimer: ReturnType<typeof setTimeout> | undefined;\n const status = () => statusLabel(props.status, messages());\n const timestamp = () => dateTime(props.createdAt);\n // Locale and timezone are application policy. Requiring an explicit visible\n // label keeps SSR and hydration byte-stable while `createdAt` still supplies\n // the semantic machine-readable timestamp.\n const time = () => props.timeLabel ?? null;\n const actions = () => props.actions ?? [];\n const actionDisplay = () =>\n props.actionDisplay === \"auto\" || !props.actionDisplay ? (props.role === \"user\" ? \"menu\" : \"inline\") : props.actionDisplay;\n const hasMeta = () => props.status === \"streaming\" || status() !== null || Boolean(time()) || actions().length > 0;\n\n const runAction = async (action: ChatAction) => {\n if (action.disabled || busyActionId()) return;\n setBusyActionId(action.id);\n try {\n await executeChatAction(action);\n setCompletedActionId(action.id);\n if (completedTimer) clearTimeout(completedTimer);\n completedTimer = setTimeout(() => setCompletedActionId(null), 1400);\n } catch (error) {\n props.onActionError?.(error);\n } finally {\n setBusyActionId(null);\n }\n };\n\n const actionIcon = (action: ChatAction) =>\n busyActionId() === action.id\n ? \"ti ti-loader-2 k2b-spin\"\n : completedActionId() === action.id\n ? \"ti ti-check\"\n : (action.icon ?? \"ti ti-dots\");\n\n onCleanup(() => {\n if (completedTimer) clearTimeout(completedTimer);\n });\n\n const menuItems = (): readonly DropdownItem[] =>\n actions().map((action) => ({\n icon: actionIcon(action),\n label: action.label,\n variant: action.variant,\n disabled: action.disabled || Boolean(busyActionId()),\n action: () => void runAction(action),\n }));\n\n return (\n <article\n class={`k2b-chat-message ${props.class ?? \"\"}`}\n data-role={props.role}\n data-status={props.status ?? \"complete\"}\n data-chat-anchor={props.anchorId !== undefined ? String(props.anchorId) : undefined}\n aria-busy={props.status === \"pending\" || props.status === \"streaming\" ? \"true\" : undefined}\n >\n <span class=\"k2b-sr-only\">{props.label ?? roleLabel(props.role, messages())}: </span>\n <Show when={(props.attachments?.length ?? 0) > 0}>\n <div class=\"k2b-chat-message__attachments\" role=\"list\" aria-label={messages().attachments}>\n <For each={props.attachments}>\n {(attachment) => {\n // A preview that no longer loads, such as a deleted file, falls back to the attachment icon; a new URL tries again.\n const [failedPreviewUrl, setFailedPreviewUrl] = createSignal<string>();\n const content = () => (\n <>\n <Show\n when={attachment.kind === \"image\" && attachment.previewUrl && attachment.previewUrl !== failedPreviewUrl()}\n fallback={<i class={attachmentIcon(attachment)} aria-hidden=\"true\" />}\n >\n <img\n src={attachment.previewUrl}\n alt={attachment.alt ?? attachment.name}\n onError={() => setFailedPreviewUrl(attachment.previewUrl)}\n />\n </Show>\n <Show when={attachment.kind !== \"image\"}>\n <span>{attachment.name}</span>\n </Show>\n </>\n );\n return (\n <Show\n when={attachment.href}\n fallback={\n <div class=\"k2b-chat-message__attachment\" data-kind={attachment.kind} role=\"listitem\" title={attachment.name}>\n {content()}\n </div>\n }\n >\n {(href) => (\n <a\n class=\"k2b-chat-message__attachment\"\n data-kind={attachment.kind}\n role=\"listitem\"\n title={attachment.name}\n href={href()}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n aria-label={messages().openInNewTab({ name: attachment.name })}\n >\n {content()}\n </a>\n )}\n </Show>\n );\n }}\n </For>\n </div>\n </Show>\n\n <Show when={props.children !== undefined && props.children !== null && props.children !== \"\"}>\n <div class=\"k2b-chat-message__bubble\">\n <div class=\"k2b-chat-message__content\">{props.children}</div>\n </div>\n </Show>\n\n <Show when={hasMeta()}>\n <footer class=\"k2b-chat-message__meta\">\n <Show\n when={props.status === \"streaming\"}\n fallback={\n <Show when={status()}>\n {(label) => (\n <span class=\"k2b-chat-message__status\" role={props.status === \"error\" ? \"alert\" : \"status\"}>\n <i class={statusIcon(props.status)} aria-hidden=\"true\" />\n {label()}\n </span>\n )}\n </Show>\n }\n >\n <span class=\"k2b-chat-message__status k2b-chat-message__status--streaming\" role=\"status\" aria-label={messages().generating}>\n <ChatProgressDots />\n </span>\n </Show>\n <Show when={time()}>{(label) => <time dateTime={timestamp() ?? undefined}>{label()}</time>}</Show>\n <Show when={actions().length > 0 && actionDisplay() === \"inline\"}>\n <span class=\"k2b-chat-message__actions\" role=\"group\" aria-label={messages().messageActions}>\n <For each={actions()}>\n {(action) => (\n <button\n type=\"button\"\n aria-label={action.label}\n aria-pressed={action.pressed}\n data-pressed-tone={action.pressedTone}\n title={action.label}\n data-danger={action.variant === \"danger\" ? \"true\" : undefined}\n disabled={action.disabled || Boolean(busyActionId())}\n onClick={() => void runAction(action)}\n >\n <i class={actionIcon(action)} aria-hidden=\"true\" />\n </button>\n )}\n </For>\n </span>\n </Show>\n <Show when={actions().length > 0 && actionDisplay() === \"menu\"}>\n <Dropdown.Root position=\"bottom-left\" width=\"12rem\" label={messages().messageActions} items={menuItems()}>\n <Dropdown.Trigger\n appearance=\"plain\"\n class=\"k2b-chat-message__menu\"\n label={messages().messageActions}\n title={messages().messageActions}\n >\n <i class=\"ti ti-dots\" aria-hidden=\"true\" />\n </Dropdown.Trigger>\n </Dropdown.Root>\n </Show>\n </footer>\n </Show>\n </article>\n );\n}\n\nconst ActivityContent = (props: ChatActivityProps & { disclosure?: boolean }) => (\n <>\n <span class=\"k2b-chat-activity__leading\" aria-hidden=\"true\">\n <Show when={props.leading} fallback={<i class={props.icon ?? \"ti ti-sparkles\"} />}>\n {props.leading}\n </Show>\n </span>\n <span class=\"k2b-chat-activity__copy\">\n <strong>{props.label}</strong>\n <Show when={props.description}>{(description) => <small>{description()}</small>}</Show>\n </span>\n <Show when={props.trailing}>\n <span class=\"k2b-chat-activity__trailing\">{props.trailing}</span>\n </Show>\n <Show when={props.disclosure}>\n <i class=\"ti ti-chevron-right k2b-chat-activity__chevron\" aria-hidden=\"true\" />\n </Show>\n </>\n);\n\nexport function ChatActivity(props: ChatActivityProps): JSX.Element {\n const [expanded, setExpanded] = createSignal(props.defaultOpen ?? false);\n const open = () => props.open ?? expanded();\n const tone = () => props.tone ?? \"neutral\";\n const style = () => (props.accent ? { \"--k2b-chat-activity-accent\": props.accent } : undefined);\n return (\n <Show\n when={props.renderBody || props.children}\n fallback={\n <div\n class={`k2b-chat-activity ${props.class ?? \"\"}`}\n data-tone={tone()}\n data-accent={props.accent ? \"true\" : undefined}\n data-busy={props.busy ? \"true\" : undefined}\n data-chat-anchor={props.anchorId !== undefined ? String(props.anchorId) : undefined}\n style={style()}\n aria-busy={props.busy ? \"true\" : undefined}\n >\n <div class=\"k2b-chat-activity__row\">\n <ActivityContent {...props} />\n </div>\n </div>\n }\n >\n <details\n class={`k2b-chat-activity ${props.class ?? \"\"}`}\n data-tone={tone()}\n data-accent={props.accent ? \"true\" : undefined}\n data-busy={props.busy ? \"true\" : undefined}\n data-body-inset={props.bodyInset === false ? \"false\" : undefined}\n data-chat-anchor={props.anchorId !== undefined ? String(props.anchorId) : undefined}\n style={style()}\n open={open()}\n onToggle={(event) => {\n setExpanded(event.currentTarget.open);\n props.onOpenChange?.(event.currentTarget.open);\n }}\n aria-busy={props.busy ? \"true\" : undefined}\n >\n <summary class=\"k2b-chat-activity__row\">\n <ActivityContent {...props} disclosure />\n </summary>\n <div class=\"k2b-chat-activity__body\">\n {props.renderBody ? <Show when={open() ? props.renderBody : undefined}>{(render) => render()()}</Show> : props.children}\n </div>\n </details>\n </Show>\n );\n}\n\nexport function ChatContextUsage(props: ChatContextUsageProps): JSX.Element {\n const [busy, setBusy] = createSignal(false);\n const run = async () => {\n const action = props.action;\n if (!action || action.disabled || busy()) return;\n setBusy(true);\n try {\n await executeChatAction(action);\n } catch (error) {\n props.onActionError?.(error);\n } finally {\n setBusy(false);\n }\n };\n const messages = useUiMessages();\n const formatNumber = (value: number) => (props.formatNumber ?? formatStableInteger)(value);\n const formattedUsageValue = (value: number | null): string => (value === null ? messages().unknown : formatNumber(value));\n const usage = () => normalizedUsage(props.usage);\n const loopUsage = () => normalizedUsage(props.loopUsage);\n const total = () => usage().total ?? 0;\n const windowSize = () => finiteNonNegative(props.contextWindow);\n const reported = () => usage().reported;\n const percent = () => (reported() && windowSize() > 0 ? Math.min(100, Math.round((total() / windowSize()) * 100)) : null);\n const remaining = () => (reported() && windowSize() > 0 ? Math.max(0, windowSize() - total()) : null);\n const accessibleLabel = () => {\n if (!reported()) {\n return windowSize() > 0\n ? messages().contextUsageUnavailableWithWindow({ window: formatNumber(windowSize()) })\n : messages().contextUsageUnavailable;\n }\n return percent() === null\n ? messages().tokensUsed({ total: formatNumber(total()) })\n : messages().tokensUsedPercent({ total: formatNumber(total()), percent: percent()! });\n };\n\n return (\n <ChatContextPopup\n content={\n <div class=\"k2b-chat-context__tooltip\">\n <strong>{messages().lastRequestContext}</strong>\n <Show when={percent() !== null}>\n <ProgressBar\n value={percent() ?? 0}\n size=\"xs\"\n tone={(percent() ?? 0) >= 85 ? \"danger\" : \"info\"}\n label={messages().contextWindowUsed}\n />\n </Show>\n <dl>\n <Show when={props.modelLabel}>\n {(model) => (\n <div>\n <dt>{messages().model}</dt>\n <dd>{model()}</dd>\n </div>\n )}\n </Show>\n <div>\n <dt>{messages().input}</dt>\n <dd>{formattedUsageValue(usage().input)}</dd>\n </div>\n <div>\n <dt>{messages().output}</dt>\n <dd>{formattedUsageValue(usage().output)}</dd>\n </div>\n <Show when={loopUsage().reported}>\n <div>\n <dt>{messages().loopTotal}</dt>\n <dd>{formattedUsageValue(loopUsage().total)}</dd>\n </div>\n </Show>\n <div>\n <dt>{messages().window}</dt>\n <dd>{windowSize() > 0 ? formatNumber(windowSize()) : messages().notConfigured}</dd>\n </div>\n <Show when={remaining() !== null}>\n <div>\n <dt>{messages().remaining}</dt>\n <dd>{remaining() === null ? messages().unknown : formatNumber(remaining()!)}</dd>\n </div>\n </Show>\n </dl>\n <Show when={props.action}>\n {(action) => (\n <Button size=\"xs\" variant=\"subtle\" disabled={action().disabled || busy()} onClick={() => void run()} aria-busy={busy()}>\n <i class={busy() ? \"ti ti-loader-2 k2b-spin\" : action().icon} aria-hidden=\"true\" />\n {action().label}\n </Button>\n )}\n </Show>\n </div>\n }\n type=\"button\"\n class={`k2b-chat-context ${props.class ?? \"\"}`}\n data-warning={reported() && (percent() ?? 0) >= 85 ? \"true\" : undefined}\n aria-label={accessibleLabel()}\n >\n <i class=\"ti ti-brain\" aria-hidden=\"true\" />\n <span>{percent() === null ? \"–\" : `${percent()}%`}</span>\n </ChatContextPopup>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY,EAAE,GAAG,EAAY,SAAS,EAAE,IAAI,QAAQ,UAAU;AACvE,SAAS,MAAM,QAAQ,mBAAmB;AAC1C,SAAS,QAAQ,QAA2B,qBAAqB;AACjE,SAA0B,aAAa,QAAQ,kBAAkB;AACjE,SAAS,WAAW,QAAQ,yBAAyB;AACrD,SAAS,gBAAgB,QAAQ,oBAAoB;AACrD,SAAS,iBAAiB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AAG,YAAG,OAAO,CAAC,CAAC,IAAG;IAAA;EAAA;AAGvD","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["chat/ChatPrimitives.tsx"],"sourcesContent":["import { createSignal, For, type JSX, onCleanup, Show } from \"solid-js\";\nimport { Button } from \"../actions/Button\";\nimport { Dropdown, type DropdownItem } from \"../actions/Dropdown\";\nimport { Tooltip } from \"../feedback/Tooltip\";\nimport { type UiMessages, useUiMessages } from \"../intl/messages\";\nimport { ProgressBar } from \"../surfaces/ProgressBar\";\nimport { ChatContextPanel, ChatContextPopup } from \"./ChatContextPopup\";\nimport { executeChatAction } from \"./chat-behavior\";\nimport type { ChatAction, ChatActivityTone, ChatAttachment, ChatContextUsageData, ChatMessageStatus, ChatRole } from \"./types\";\n\nexport type ChatMessageProps = {\n role: ChatRole;\n children?: JSX.Element;\n label?: string;\n createdAt?: string | Date;\n timeLabel?: string;\n status?: ChatMessageStatus;\n attachments?: readonly ChatAttachment[];\n actions?: readonly ChatAction[];\n actionDisplay?: \"auto\" | \"inline\" | \"menu\";\n anchorId?: string | number;\n onActionError?: (error: unknown) => void;\n class?: string;\n};\n\nexport type ChatActivityProps = {\n label: string;\n description?: string;\n icon?: string;\n /** Optional host-owned leading visual rendered instead of the icon. */\n leading?: JSX.Element;\n /** Optional identity accent for the leading visual. Semantic tones still take precedence. */\n accent?: string;\n tone?: ChatActivityTone;\n /** Marks the activity as running with the shared accent sweep. */\n busy?: boolean;\n trailing?: JSX.Element;\n /** Controlled disclosure state. Omit to keep native details behavior. */\n open?: boolean;\n /** Reports disclosure changes when `open` is controlled by the host. */\n onOpenChange?: (open: boolean) => void;\n defaultOpen?: boolean;\n /** Set to false when the body is a peer list that should align with the activity row. */\n bodyInset?: boolean;\n anchorId?: string | number;\n children?: JSX.Element;\n /** Mount expensive details only while expanded. */\n renderBody?: () => JSX.Element;\n class?: string;\n};\n\nexport type ChatContextUsageProps = ChatContextUsageData & {\n action?: ChatAction;\n onActionError?: (error: unknown) => void;\n /** Host-owned number formatting. The default is locale-independent and SSR-stable. */\n formatNumber?: (value: number) => string;\n class?: string;\n};\n\nconst roleLabel = (role: ChatRole, messages: UiMessages): string => {\n if (role === \"assistant\") return messages.assistant;\n if (role === \"user\") return messages.user;\n if (role === \"tool\") return messages.tool;\n return messages.system;\n};\n\nconst statusLabel = (status: ChatMessageStatus | undefined, messages: UiMessages): string | null => {\n if (status === \"pending\") return messages.waiting;\n if (status === \"streaming\") return messages.generating;\n if (status === \"error\") return messages.failed;\n return null;\n};\n\nconst statusIcon = (status: ChatMessageStatus | undefined): string => {\n if (status === \"pending\") return \"ti ti-clock\";\n return \"ti ti-alert-circle\";\n};\n\nconst ChatProgressDots = () => (\n <span class=\"k2b-chat-progress-dots\" aria-hidden=\"true\">\n <span />\n <span />\n <span />\n </span>\n);\n\nconst attachmentIcon = (attachment: ChatAttachment): string =>\n attachment.icon ?? (attachment.kind === \"image\" ? \"ti ti-photo\" : attachment.kind === \"resource\" ? \"ti ti-link\" : \"ti ti-file\");\n\nconst finiteNonNegative = (value: number | undefined): number =>\n typeof value === \"number\" && Number.isFinite(value) ? Math.max(0, value) : 0;\n\nconst finiteUsageValue = (value: number | undefined): number | null =>\n typeof value === \"number\" && Number.isFinite(value) && value >= 0 ? value : null;\n\nconst normalizedUsage = (usage: ChatContextUsageData[\"usage\"]) => {\n const input = finiteUsageValue(usage?.input);\n const output = finiteUsageValue(usage?.output);\n const explicitTotal = finiteUsageValue(usage?.total);\n const total = explicitTotal ?? (input !== null || output !== null ? (input ?? 0) + (output ?? 0) : null);\n return { input, output, total, reported: total !== null };\n};\n\nconst formatStableInteger = (value: number): string => {\n const digits = String(Math.round(finiteNonNegative(value)));\n return digits.replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n};\n\nexport const formatChatTokens = (tokens: number): string => {\n const value = finiteNonNegative(tokens);\n if (value >= 1_000_000) return `${(value / 1_000_000).toFixed(1)}M`;\n if (value >= 1_000) return `${(value / 1_000).toFixed(1)}k`;\n return String(Math.round(value));\n};\n\nconst dateTime = (value: string | Date | undefined): string | null => {\n if (!value) return null;\n const date = value instanceof Date ? value : new Date(value);\n return Number.isFinite(date.getTime()) ? date.toISOString() : null;\n};\n\nexport function ChatMessage(props: ChatMessageProps): JSX.Element {\n const messages = useUiMessages();\n const [busyActionId, setBusyActionId] = createSignal<string | null>(null);\n const [completedActionId, setCompletedActionId] = createSignal<string | null>(null);\n let completedTimer: ReturnType<typeof setTimeout> | undefined;\n const status = () => statusLabel(props.status, messages());\n const timestamp = () => dateTime(props.createdAt);\n // Locale and timezone are application policy. Requiring an explicit visible\n // label keeps SSR and hydration byte-stable while `createdAt` still supplies\n // the semantic machine-readable timestamp.\n const time = () => props.timeLabel ?? null;\n const actions = () => props.actions ?? [];\n const actionDisplay = () =>\n props.actionDisplay === \"auto\" || !props.actionDisplay ? (props.role === \"user\" ? \"menu\" : \"inline\") : props.actionDisplay;\n const hasMeta = () => props.status === \"streaming\" || status() !== null || Boolean(time()) || actions().length > 0;\n\n const runAction = async (action: ChatAction) => {\n if (action.disabled || busyActionId()) return;\n setBusyActionId(action.id);\n try {\n await executeChatAction(action);\n setCompletedActionId(action.id);\n if (completedTimer) clearTimeout(completedTimer);\n completedTimer = setTimeout(() => setCompletedActionId(null), 1400);\n } catch (error) {\n props.onActionError?.(error);\n } finally {\n setBusyActionId(null);\n }\n };\n\n const actionIcon = (action: ChatAction) =>\n busyActionId() === action.id\n ? \"ti ti-loader-2 k2b-spin\"\n : completedActionId() === action.id\n ? \"ti ti-check\"\n : (action.icon ?? \"ti ti-dots\");\n\n onCleanup(() => {\n if (completedTimer) clearTimeout(completedTimer);\n });\n\n const menuItems = (): readonly DropdownItem[] =>\n actions().map((action) => ({\n icon: actionIcon(action),\n label: action.label,\n variant: action.variant,\n disabled: action.disabled || Boolean(busyActionId()),\n action: () => void runAction(action),\n }));\n\n return (\n <article\n class={`k2b-chat-message ${props.class ?? \"\"}`}\n data-role={props.role}\n data-status={props.status ?? \"complete\"}\n data-chat-anchor={props.anchorId !== undefined ? String(props.anchorId) : undefined}\n aria-busy={props.status === \"pending\" || props.status === \"streaming\" ? \"true\" : undefined}\n >\n <span class=\"k2b-sr-only\">{props.label ?? roleLabel(props.role, messages())}: </span>\n <Show when={(props.attachments?.length ?? 0) > 0}>\n <div class=\"k2b-chat-message__attachments\" role=\"list\" aria-label={messages().attachments}>\n <For each={props.attachments}>\n {(attachment) => {\n // A preview that no longer loads, such as a deleted file, falls back to the attachment icon; a new URL tries again.\n const [failedPreviewUrl, setFailedPreviewUrl] = createSignal<string>();\n const content = () => (\n <>\n <Show\n when={attachment.kind === \"image\" && attachment.previewUrl && attachment.previewUrl !== failedPreviewUrl()}\n fallback={<i class={attachmentIcon(attachment)} aria-hidden=\"true\" />}\n >\n <img\n src={attachment.previewUrl}\n alt={attachment.alt ?? attachment.name}\n onError={() => setFailedPreviewUrl(attachment.previewUrl)}\n />\n </Show>\n <Show when={attachment.kind !== \"image\"}>\n <span>{attachment.name}</span>\n </Show>\n </>\n );\n return (\n <Show\n when={attachment.href}\n fallback={\n <div class=\"k2b-chat-message__attachment\" data-kind={attachment.kind} role=\"listitem\" title={attachment.name}>\n {content()}\n </div>\n }\n >\n {(href) => (\n <a\n class=\"k2b-chat-message__attachment\"\n data-kind={attachment.kind}\n role=\"listitem\"\n title={attachment.name}\n href={href()}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n aria-label={messages().openInNewTab({ name: attachment.name })}\n >\n {content()}\n </a>\n )}\n </Show>\n );\n }}\n </For>\n </div>\n </Show>\n\n <Show when={props.children !== undefined && props.children !== null && props.children !== \"\"}>\n <div class=\"k2b-chat-message__bubble\">\n <div class=\"k2b-chat-message__content\">{props.children}</div>\n </div>\n </Show>\n\n <Show when={hasMeta()}>\n <footer class=\"k2b-chat-message__meta\">\n <Show\n when={props.status === \"streaming\"}\n fallback={\n <Show when={status()}>\n {(label) => (\n <span class=\"k2b-chat-message__status\" role={props.status === \"error\" ? \"alert\" : \"status\"}>\n <i class={statusIcon(props.status)} aria-hidden=\"true\" />\n {label()}\n </span>\n )}\n </Show>\n }\n >\n <span class=\"k2b-chat-message__status k2b-chat-message__status--streaming\" role=\"status\" aria-label={messages().generating}>\n <ChatProgressDots />\n </span>\n </Show>\n <Show when={time()}>{(label) => <time dateTime={timestamp() ?? undefined}>{label()}</time>}</Show>\n <Show when={actions().length > 0 && actionDisplay() === \"inline\"}>\n <span class=\"k2b-chat-message__actions\" role=\"group\" aria-label={messages().messageActions}>\n <For each={actions()}>\n {(action) => (\n <Tooltip.Trigger\n type=\"button\"\n aria-label={action.label}\n aria-pressed={action.pressed}\n data-pressed-tone={action.pressedTone}\n content={action.label}\n data-danger={action.variant === \"danger\" ? \"true\" : undefined}\n disabled={action.disabled || Boolean(busyActionId())}\n onClick={() => void runAction(action)}\n >\n <i class={actionIcon(action)} aria-hidden=\"true\" />\n </Tooltip.Trigger>\n )}\n </For>\n </span>\n </Show>\n <Show when={actions().length > 0 && actionDisplay() === \"menu\"}>\n <Dropdown.Root position=\"bottom-left\" label={messages().messageActions} items={menuItems()}>\n <Dropdown.Trigger\n appearance=\"plain\"\n class=\"k2b-chat-message__menu\"\n label={messages().messageActions}\n title={messages().messageActions}\n >\n <i class=\"ti ti-dots\" aria-hidden=\"true\" />\n </Dropdown.Trigger>\n </Dropdown.Root>\n </Show>\n </footer>\n </Show>\n </article>\n );\n}\n\nconst ActivityContent = (props: ChatActivityProps & { disclosure?: boolean }) => (\n <>\n <span class=\"k2b-chat-activity__leading\" aria-hidden=\"true\">\n <Show when={props.leading} fallback={<i class={props.icon ?? \"ti ti-sparkles\"} />}>\n {props.leading}\n </Show>\n </span>\n <span class=\"k2b-chat-activity__copy\">\n <strong>{props.label}</strong>\n <Show when={props.description}>{(description) => <small>{description()}</small>}</Show>\n </span>\n <Show when={props.trailing}>\n <span class=\"k2b-chat-activity__trailing\">{props.trailing}</span>\n </Show>\n <Show when={props.disclosure}>\n <i class=\"ti ti-chevron-right k2b-chat-activity__chevron\" aria-hidden=\"true\" />\n </Show>\n </>\n);\n\nexport function ChatActivity(props: ChatActivityProps): JSX.Element {\n const [expanded, setExpanded] = createSignal(props.defaultOpen ?? false);\n const open = () => props.open ?? expanded();\n const tone = () => props.tone ?? \"neutral\";\n const style = () => (props.accent ? { \"--k2b-chat-activity-accent\": props.accent } : undefined);\n return (\n <Show\n when={props.renderBody || props.children}\n fallback={\n <div\n class={`k2b-chat-activity ${props.class ?? \"\"}`}\n data-tone={tone()}\n data-accent={props.accent ? \"true\" : undefined}\n data-busy={props.busy ? \"true\" : undefined}\n data-chat-anchor={props.anchorId !== undefined ? String(props.anchorId) : undefined}\n style={style()}\n aria-busy={props.busy ? \"true\" : undefined}\n >\n <div class=\"k2b-chat-activity__row\">\n <ActivityContent {...props} />\n </div>\n </div>\n }\n >\n <details\n class={`k2b-chat-activity ${props.class ?? \"\"}`}\n data-tone={tone()}\n data-accent={props.accent ? \"true\" : undefined}\n data-busy={props.busy ? \"true\" : undefined}\n data-body-inset={props.bodyInset === false ? \"false\" : undefined}\n data-chat-anchor={props.anchorId !== undefined ? String(props.anchorId) : undefined}\n style={style()}\n open={open()}\n onToggle={(event) => {\n setExpanded(event.currentTarget.open);\n props.onOpenChange?.(event.currentTarget.open);\n }}\n aria-busy={props.busy ? \"true\" : undefined}\n >\n <summary class=\"k2b-chat-activity__row\">\n <ActivityContent {...props} disclosure />\n </summary>\n <div class=\"k2b-chat-activity__body\">\n {props.renderBody ? <Show when={open() ? props.renderBody : undefined}>{(render) => render()()}</Show> : props.children}\n </div>\n </details>\n </Show>\n );\n}\n\nexport function ChatContextUsage(props: ChatContextUsageProps): JSX.Element {\n const [busy, setBusy] = createSignal(false);\n const run = async () => {\n const action = props.action;\n if (!action || action.disabled || busy()) return;\n setBusy(true);\n try {\n await executeChatAction(action);\n } catch (error) {\n props.onActionError?.(error);\n } finally {\n setBusy(false);\n }\n };\n const messages = useUiMessages();\n const formatNumber = (value: number) => (props.formatNumber ?? formatStableInteger)(value);\n const formattedUsageValue = (value: number | null): string => (value === null ? messages().unknown : formatNumber(value));\n const usage = () => normalizedUsage(props.usage);\n const loopUsage = () => normalizedUsage(props.loopUsage);\n const total = () => usage().total ?? 0;\n const windowSize = () => finiteNonNegative(props.contextWindow);\n const reported = () => usage().reported;\n const percent = () => (reported() && windowSize() > 0 ? Math.min(100, Math.round((total() / windowSize()) * 100)) : null);\n const remaining = () => (reported() && windowSize() > 0 ? Math.max(0, windowSize() - total()) : null);\n const accessibleLabel = () => {\n if (!reported()) {\n return windowSize() > 0\n ? messages().contextUsageUnavailableWithWindow({ window: formatNumber(windowSize()) })\n : messages().contextUsageUnavailable;\n }\n return percent() === null\n ? messages().tokensUsed({ total: formatNumber(total()) })\n : messages().tokensUsedPercent({ total: formatNumber(total()), percent: percent()! });\n };\n\n return (\n <ChatContextPopup\n content={\n <ChatContextPanel title={messages().lastRequestContext}>\n <Show when={percent() !== null}>\n <ProgressBar\n value={percent() ?? 0}\n size=\"xs\"\n tone={(percent() ?? 0) >= 85 ? \"danger\" : \"info\"}\n label={messages().contextWindowUsed}\n />\n </Show>\n <dl>\n <Show when={props.modelLabel}>\n {(model) => (\n <div>\n <dt>{messages().model}</dt>\n <dd>{model()}</dd>\n </div>\n )}\n </Show>\n <div>\n <dt>{messages().input}</dt>\n <dd>{formattedUsageValue(usage().input)}</dd>\n </div>\n <div>\n <dt>{messages().output}</dt>\n <dd>{formattedUsageValue(usage().output)}</dd>\n </div>\n <Show when={loopUsage().reported}>\n <div>\n <dt>{messages().loopTotal}</dt>\n <dd>{formattedUsageValue(loopUsage().total)}</dd>\n </div>\n </Show>\n <div>\n <dt>{messages().window}</dt>\n <dd>{windowSize() > 0 ? formatNumber(windowSize()) : messages().notConfigured}</dd>\n </div>\n <Show when={remaining() !== null}>\n <div>\n <dt>{messages().remaining}</dt>\n <dd>{remaining() === null ? messages().unknown : formatNumber(remaining()!)}</dd>\n </div>\n </Show>\n </dl>\n <Show when={props.action}>\n {(action) => (\n <Button size=\"xs\" variant=\"subtle\" disabled={action().disabled || busy()} onClick={() => void run()} aria-busy={busy()}>\n <i class={busy() ? \"ti ti-loader-2 k2b-spin\" : action().icon} aria-hidden=\"true\" />\n {action().label}\n </Button>\n )}\n </Show>\n </ChatContextPanel>\n }\n type=\"button\"\n class={`k2b-chat-context ${props.class ?? \"\"}`}\n data-warning={reported() && (percent() ?? 0) >= 85 ? \"true\" : undefined}\n aria-label={accessibleLabel()}\n >\n <i class=\"ti ti-brain\" aria-hidden=\"true\" />\n <span>{percent() === null ? \"–\" : `${percent()}%`}</span>\n </ChatContextPopup>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY,EAAE,GAAG,EAAY,SAAS,EAAE,IAAI,QAAQ,UAAU;AACvE,SAAS,MAAM,QAAQ,mBAAmB;AAC1C,SAAS,QAAQ,QAA2B,qBAAqB;AACjE,SAAS,OAAO,QAAQ,qBAAqB;AAC7C,SAA0B,aAAa,QAAQ,kBAAkB;AACjE,SAAS,WAAW,QAAQ,yBAAyB;AACrD,SAAS,gBAAgB,EAAE,gBAAgB,QAAQ,oBAAoB;AACvE,SAAS,iBAAiB,QAAQ,iBAAiB;AAoDnD,MAAM,SAAS,GAAG,CAAC,IAAc,EAAE,QAAoB,KAAa;EAClE,IAAI,IAAI,KAAK,WAAW,EAAE,OAAO,QAAQ,CAAC,SAAS;EACnD,IAAI,IAAI,KAAK,MAAM,EAAE,OAAO,QAAQ,CAAC,IAAI;EACzC,IAAI,IAAI,KAAK,MAAM,EAAE,OAAO,QAAQ,CAAC,IAAI;EACzC,OAAO,QAAQ,CAAC,MAAM;AACxB,CAAC;AAED,MAAM,WAAW,GAAG,CAAC,MAAqC,EAAE,QAAoB,KAAoB;EAClG,IAAI,MAAM,KAAK,SAAS,EAAE,OAAO,QAAQ,CAAC,OAAO;EACjD,IAAI,MAAM,KAAK,WAAW,EAAE,OAAO,QAAQ,CAAC,UAAU;EAC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1
|
+
import { ChatContextPanel, ChatContextPopup } from "./ChatContextPopup";
|
|
2
2
|
import { ChatTasks } from "./ChatTasks";
|
|
3
3
|
import { ChatComposer } from "./ChatComposer";
|
|
4
4
|
import { ChatActivity, ChatContextUsage, ChatMessage } from "./ChatPrimitives";
|
|
@@ -16,7 +16,8 @@ export const Chat = Object.assign(ChatRoot, {
|
|
|
16
16
|
Activity: ChatActivity,
|
|
17
17
|
Composer: ChatComposer,
|
|
18
18
|
ContextUsage: ChatContextUsage,
|
|
19
|
-
ContextPopup: ChatContextPopup
|
|
19
|
+
ContextPopup: ChatContextPopup,
|
|
20
|
+
ContextPanel: ChatContextPanel
|
|
20
21
|
});
|
|
21
22
|
export { reconcileChatMentions } from "./composer-document";
|
|
22
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["chat/index.ts"],"sourcesContent":["export type { ChatContextPopupProps } from \"./ChatContextPopup\";\n\nimport { ChatContextPopup } from \"./ChatContextPopup\";\nimport { ChatTasks } from \"./ChatTasks\";\n\nexport type { ChatTask, ChatTasksProps } from \"./ChatTasks\";\n\nimport { ChatComposer } from \"./ChatComposer\";\nimport { ChatActivity, ChatContextUsage, ChatMessage } from \"./ChatPrimitives\";\nimport { ChatRoot } from \"./ChatRoot\";\nimport { ChatTimeline } from \"./ChatTimeline\";\n\nexport type { ChatCommand, ChatCommandContext, ChatComposerProps, ChatFileSelection, ChatPasteHandler } from \"./ChatComposer\";\nexport type { ChatActivityProps, ChatContextUsageProps, ChatMessageProps } from \"./ChatPrimitives\";\nexport { formatChatTokens } from \"./ChatPrimitives\";\nexport type { ChatRootProps } from \"./ChatRoot\";\nexport type { ChatActivityItem, ChatMessageItem, ChatTimelineItem, ChatTimelineProps } from \"./ChatTimeline\";\nexport type {\n ChatAction,\n ChatActivityTone,\n ChatAttachment,\n ChatComposerState,\n ChatContextUsageData,\n ChatMention,\n ChatMessageStatus,\n ChatModelOption,\n ChatRole,\n ChatSubmitInput,\n ChatSubmitIntent,\n ChatUsage,\n} from \"./types\";\n\n/**\n * Portable, controlled chat surface. Applications own storage, streaming,\n * authorization, rich message rendering, and domain actions.\n */\nexport const Chat = Object.assign(ChatRoot, {\n Tasks: ChatTasks,\n Timeline: ChatTimeline,\n Message: ChatMessage,\n Activity: ChatActivity,\n Composer: ChatComposer,\n ContextUsage: ChatContextUsage,\n ContextPopup: ChatContextPopup,\n});\n\nexport { reconcileChatMentions } from \"./composer-document\";\n"],"mappings":"AAEA,SAAS,gBAAgB,QAAQ,oBAAoB;
|
|
1
|
+
{"version":3,"names":[],"sources":["chat/index.ts"],"sourcesContent":["export type { ChatContextPanelProps, ChatContextPopupProps } from \"./ChatContextPopup\";\n\nimport { ChatContextPanel, ChatContextPopup } from \"./ChatContextPopup\";\nimport { ChatTasks } from \"./ChatTasks\";\n\nexport type { ChatTask, ChatTasksProps } from \"./ChatTasks\";\n\nimport { ChatComposer } from \"./ChatComposer\";\nimport { ChatActivity, ChatContextUsage, ChatMessage } from \"./ChatPrimitives\";\nimport { ChatRoot } from \"./ChatRoot\";\nimport { ChatTimeline } from \"./ChatTimeline\";\n\nexport type { ChatCommand, ChatCommandContext, ChatComposerProps, ChatFileSelection, ChatPasteHandler } from \"./ChatComposer\";\nexport type { ChatActivityProps, ChatContextUsageProps, ChatMessageProps } from \"./ChatPrimitives\";\nexport { formatChatTokens } from \"./ChatPrimitives\";\nexport type { ChatRootProps } from \"./ChatRoot\";\nexport type { ChatActivityItem, ChatMessageItem, ChatTimelineItem, ChatTimelineProps } from \"./ChatTimeline\";\nexport type {\n ChatAction,\n ChatActivityTone,\n ChatAttachment,\n ChatComposerState,\n ChatContextUsageData,\n ChatMention,\n ChatMessageStatus,\n ChatModelOption,\n ChatRole,\n ChatSubmitInput,\n ChatSubmitIntent,\n ChatUsage,\n} from \"./types\";\n\n/**\n * Portable, controlled chat surface. Applications own storage, streaming,\n * authorization, rich message rendering, and domain actions.\n */\nexport const Chat = Object.assign(ChatRoot, {\n Tasks: ChatTasks,\n Timeline: ChatTimeline,\n Message: ChatMessage,\n Activity: ChatActivity,\n Composer: ChatComposer,\n ContextUsage: ChatContextUsage,\n ContextPopup: ChatContextPopup,\n ContextPanel: ChatContextPanel,\n});\n\nexport { reconcileChatMentions } from \"./composer-document\";\n"],"mappings":"AAEA,SAAS,gBAAgB,EAAE,gBAAgB,QAAQ,oBAAoB;AACvE,SAAS,SAAS,QAAQ,aAAa;AAIvC,SAAS,YAAY,QAAQ,gBAAgB;AAC7C,SAAS,YAAY,EAAE,gBAAgB,EAAE,WAAW,QAAQ,kBAAkB;AAC9E,SAAS,QAAQ,QAAQ,YAAY;AACrC,SAAS,YAAY,QAAQ,gBAAgB;AAI7C,SAAS,gBAAgB,QAAQ,kBAAkB;AAkBnD;AACA;AACA;AACA;AACA,OAAO,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE;EAC1C,KAAK,EAAE,SAAS;EAChB,QAAQ,EAAE,YAAY;EACtB,OAAO,EAAE,WAAW;EACpB,QAAQ,EAAE,YAAY;EACtB,QAAQ,EAAE,YAAY;EACtB,YAAY,EAAE,gBAAgB;EAC9B,YAAY,EAAE,gBAAgB;EAC9B,YAAY,EAAE;AAChB,CAAC,CAAC;AAEF,SAAS,qBAAqB,QAAQ,qBAAqB","ignoreList":[]}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { createComponent as _$createComponent } from "solid-js/web";
|
|
2
|
-
import { ssr as _$ssr } from "solid-js/web";
|
|
3
1
|
import { ssrStyleProperty as _$ssrStyleProperty } from "solid-js/web";
|
|
4
2
|
import { ssrStyle as _$ssrStyle } from "solid-js/web";
|
|
5
3
|
import { ssrAttribute as _$ssrAttribute } from "solid-js/web";
|
|
4
|
+
import { createComponent as _$createComponent } from "solid-js/web";
|
|
5
|
+
import { ssr as _$ssr } from "solid-js/web";
|
|
6
6
|
import { escape as _$escape } from "solid-js/web";
|
|
7
|
-
var _tmpl$ = "<
|
|
8
|
-
_tmpl$2 =
|
|
9
|
-
_tmpl$3 = ["<
|
|
10
|
-
_tmpl$4 = ["<div class=\"
|
|
11
|
-
_tmpl$5 = ["<div class=\"", "\" style=\"", "\">", "</div>"]
|
|
7
|
+
var _tmpl$ = ["<i class=\"", "\" aria-hidden=\"true\"></i>"],
|
|
8
|
+
_tmpl$2 = "<span class=\"k2b-chart__anchor\" aria-hidden=\"true\"></span>",
|
|
9
|
+
_tmpl$3 = ["<span", " role=\"tooltip\" popover=\"manual\" data-instant=\"true\" class=\"k2b-tooltip k2b-chart__tooltip\"></span>"],
|
|
10
|
+
_tmpl$4 = ["<div class=\"k2b-chart__controls\">", "", "", "</div>"],
|
|
11
|
+
_tmpl$5 = ["<div class=\"", "\"", " style=\"", "\" role=\"group\"", "><div class=\"k2b-chart__svg\"", " style=\"", "\">", "</div>", "", "</div>"],
|
|
12
|
+
_tmpl$6 = ["<div class=\"", "\" style=\"", "\">", "</div>"];
|
|
12
13
|
import { charts } from "@k2b/stdlib";
|
|
13
14
|
import { createEffect, createMemo, createSignal, createUniqueId, onCleanup, onMount, Show, splitProps, untrack } from "solid-js";
|
|
14
15
|
import { isServer } from "solid-js/web";
|
|
16
|
+
import { IconButton } from "../actions/Button";
|
|
15
17
|
import { useLocale } from "../intl/locale";
|
|
16
18
|
import { useUiMessages } from "../intl/messages";
|
|
17
19
|
import { createChartInspection } from "./chart-inspection";
|
|
@@ -424,27 +426,36 @@ const Chart = props => {
|
|
|
424
426
|
const chartStyle = () => props.style ?? (props.kind === "stateTimeline" ? {
|
|
425
427
|
height: `${stateTimelineHeight(props.rows.length, props.legend !== false)}px`
|
|
426
428
|
} : undefined);
|
|
429
|
+
const control = (label, shortcut, icon, action) => _$createComponent(IconButton, {
|
|
430
|
+
variant: "secondary",
|
|
431
|
+
label: label,
|
|
432
|
+
tooltip: `${label} (${shortcut})`,
|
|
433
|
+
onClick: action,
|
|
434
|
+
get children() {
|
|
435
|
+
return _$ssr(_tmpl$, `ti ${_$escape(icon, true)}`);
|
|
436
|
+
}
|
|
437
|
+
});
|
|
427
438
|
return _$createComponent(Show, {
|
|
428
439
|
get when() {
|
|
429
440
|
return !isEmpty(props);
|
|
430
441
|
},
|
|
431
442
|
get fallback() {
|
|
432
|
-
return _$ssr(_tmpl$
|
|
443
|
+
return _$ssr(_tmpl$6, `k2b-chart k2b-chart__empty ${_$escape(props.class ?? "", true)}`, _$ssrStyle(chartStyle()), _$escape(labels().empty ?? messages().noData));
|
|
433
444
|
},
|
|
434
445
|
get children() {
|
|
435
|
-
return _$ssr(_tmpl$
|
|
446
|
+
return _$ssr(_tmpl$5, `k2b-chart ${_$escape(props.class ?? "", true)}`, _$ssrAttribute("data-chart-kind", _$escape(props.kind, true), false) + _$ssrAttribute("data-drag", draggable() ? dragging() ? "active" : "idle" : _$escape(undefined, true), false) + _$ssrAttribute("data-crosshair", !draggable() && interactiveLine() ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("data-interactive", interactive() ? "true" : _$escape(undefined, true), false), _$ssrStyle(chartStyle()), _$ssrAttribute("aria-label", interactiveMap() ? _$escape(labels().interactiveMap ?? messages().interactiveMap, true) : interactiveTimeline() ? _$escape(labels().interactiveTimeline ?? messages().interactiveTimeline, true) : interactiveLine() ? _$escape(labels().interactiveLine ?? messages().interactiveLineChart, true) : interactive() ? _$escape(labels().interactiveChart ?? messages().interactiveChart, true) : _$escape(undefined, true), false) + _$ssrAttribute("aria-description", interactive() ? _$escape(messages().interactiveChart, true) : _$escape(undefined, true), false) + _$ssrAttribute("tabindex", interactive() ? 0 : _$escape(undefined, true), false), _$ssrAttribute("data-stretch", !preservesAspectRatio(props.kind) ? "true" : _$escape(undefined, true), false), _$ssrStyleProperty("--k2b-chart-width:", `${_$escape(size().width, true)}px`) + _$ssrStyleProperty(";--k2b-chart-height:", `${_$escape(size().height, true)}px`) + _$ssrStyleProperty(";aspect-ratio:", `${_$escape(size().width, true)} / ${_$escape(size().height, true)}`), isServer ? selectedChartSvg(svgMarkup(), props.selected) : svgMarkup(), _$escape(_$createComponent(Show, {
|
|
436
447
|
get when() {
|
|
437
448
|
return interactive();
|
|
438
449
|
},
|
|
439
450
|
get children() {
|
|
440
|
-
return [_$ssr(_tmpl$), _$ssr(_tmpl$
|
|
451
|
+
return [_$ssr(_tmpl$2), _$ssr(_tmpl$3, _$ssrAttribute("id", _$escape(chartTooltipId, true), false))];
|
|
441
452
|
}
|
|
442
453
|
})), _$escape(_$createComponent(Show, {
|
|
443
454
|
get when() {
|
|
444
455
|
return draggable();
|
|
445
456
|
},
|
|
446
457
|
get children() {
|
|
447
|
-
return _$ssr(_tmpl$
|
|
458
|
+
return _$ssr(_tmpl$4, _$escape(control(labels().zoomIn ?? messages().zoomIn, "+", "ti-plus", () => zoom(1))), _$escape(control(labels().zoomOut ?? messages().zoomOut, "-", "ti-minus", () => zoom(-1))), _$escape(control(interactiveMap() ? labels().resetMap ?? messages().resetMapView : labels().resetTimeline ?? messages().resetTimelineView, "0", "ti-focus-centered", reset)));
|
|
448
459
|
}
|
|
449
460
|
})));
|
|
450
461
|
}
|