@k2b/ui 0.60.0 → 0.62.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.
Files changed (109) hide show
  1. package/dist/browser/actions/FilterChip.js +3 -0
  2. package/dist/browser/actions/FilterChip.js.map +1 -1
  3. package/dist/browser/chat/ChatPrimitives.js +435 -420
  4. package/dist/browser/chat/ChatPrimitives.js.map +1 -1
  5. package/dist/browser/chat/ChatTasks.js +78 -73
  6. package/dist/browser/chat/ChatTasks.js.map +1 -1
  7. package/dist/browser/chat/ChatTimeline.js +3 -0
  8. package/dist/browser/chat/ChatTimeline.js.map +1 -1
  9. package/dist/browser/content/ActivityList.js +379 -290
  10. package/dist/browser/content/ActivityList.js.map +1 -1
  11. package/dist/browser/content/FileView.js +0 -12
  12. package/dist/browser/content/FileView.js.map +1 -1
  13. package/dist/browser/content/Lightbox.js +31 -11
  14. package/dist/browser/content/Lightbox.js.map +1 -1
  15. package/dist/browser/content/PdfPages.js +26 -1
  16. package/dist/browser/content/PdfPages.js.map +1 -1
  17. package/dist/browser/content/RunLog.js +719 -0
  18. package/dist/browser/content/RunLog.js.map +1 -0
  19. package/dist/browser/content/activity-messages.js +2 -2
  20. package/dist/browser/content/activity-messages.js.map +1 -1
  21. package/dist/browser/content/file-view-preview.js +13 -0
  22. package/dist/browser/content/file-view-preview.js.map +1 -1
  23. package/dist/browser/content/index.js +5 -4
  24. package/dist/browser/content/index.js.map +1 -1
  25. package/dist/browser/content/run-log-messages.js +134 -0
  26. package/dist/browser/content/run-log-messages.js.map +1 -0
  27. package/dist/browser/feedback/dialog-core.js +24 -27
  28. package/dist/browser/feedback/dialog-core.js.map +1 -1
  29. package/dist/browser/feedback/dialog-frame-motion.js +506 -15
  30. package/dist/browser/feedback/dialog-frame-motion.js.map +1 -1
  31. package/dist/browser/feedback/prompt-sheet.js +1 -0
  32. package/dist/browser/feedback/prompt-sheet.js.map +1 -1
  33. package/dist/browser/feedback/prompts.js +5 -1
  34. package/dist/browser/feedback/prompts.js.map +1 -1
  35. package/dist/browser/feedback/toast.js +11 -1
  36. package/dist/browser/feedback/toast.js.map +1 -1
  37. package/dist/browser/internal/step-row.js +78 -0
  38. package/dist/browser/internal/step-row.js.map +1 -0
  39. package/dist/browser/layout/PullToRefresh.js +76 -23
  40. package/dist/browser/layout/PullToRefresh.js.map +1 -1
  41. package/dist/browser/layout/refresh-messages.js +4 -2
  42. package/dist/browser/layout/refresh-messages.js.map +1 -1
  43. package/dist/browser/layout/sheet-motion.js +3 -3
  44. package/dist/browser/layout/sheet-motion.js.map +1 -1
  45. package/dist/ssr/actions/FilterChip.js +3 -0
  46. package/dist/ssr/actions/FilterChip.js.map +1 -1
  47. package/dist/ssr/chat/ChatPrimitives.js +109 -71
  48. package/dist/ssr/chat/ChatPrimitives.js.map +1 -1
  49. package/dist/ssr/chat/ChatTasks.js +31 -16
  50. package/dist/ssr/chat/ChatTasks.js.map +1 -1
  51. package/dist/ssr/chat/ChatTimeline.js +3 -0
  52. package/dist/ssr/chat/ChatTimeline.js.map +1 -1
  53. package/dist/ssr/content/ActivityList.js +199 -114
  54. package/dist/ssr/content/ActivityList.js.map +1 -1
  55. package/dist/ssr/content/FileView.js +0 -12
  56. package/dist/ssr/content/FileView.js.map +1 -1
  57. package/dist/ssr/content/Lightbox.js +31 -11
  58. package/dist/ssr/content/Lightbox.js.map +1 -1
  59. package/dist/ssr/content/PdfPages.js +26 -1
  60. package/dist/ssr/content/PdfPages.js.map +1 -1
  61. package/dist/ssr/content/RunLog.js +471 -0
  62. package/dist/ssr/content/RunLog.js.map +1 -0
  63. package/dist/ssr/content/activity-messages.js +2 -2
  64. package/dist/ssr/content/activity-messages.js.map +1 -1
  65. package/dist/ssr/content/file-view-preview.js +13 -0
  66. package/dist/ssr/content/file-view-preview.js.map +1 -1
  67. package/dist/ssr/content/index.js +5 -4
  68. package/dist/ssr/content/index.js.map +1 -1
  69. package/dist/ssr/content/run-log-messages.js +134 -0
  70. package/dist/ssr/content/run-log-messages.js.map +1 -0
  71. package/dist/ssr/feedback/dialog-core.js +24 -27
  72. package/dist/ssr/feedback/dialog-core.js.map +1 -1
  73. package/dist/ssr/feedback/dialog-frame-motion.js +506 -15
  74. package/dist/ssr/feedback/dialog-frame-motion.js.map +1 -1
  75. package/dist/ssr/feedback/prompt-sheet.js +1 -0
  76. package/dist/ssr/feedback/prompt-sheet.js.map +1 -1
  77. package/dist/ssr/feedback/prompts.js +5 -1
  78. package/dist/ssr/feedback/prompts.js.map +1 -1
  79. package/dist/ssr/feedback/toast.js +11 -1
  80. package/dist/ssr/feedback/toast.js.map +1 -1
  81. package/dist/ssr/internal/step-row.js +35 -0
  82. package/dist/ssr/internal/step-row.js.map +1 -0
  83. package/dist/ssr/layout/PullToRefresh.js +67 -16
  84. package/dist/ssr/layout/PullToRefresh.js.map +1 -1
  85. package/dist/ssr/layout/refresh-messages.js +4 -2
  86. package/dist/ssr/layout/refresh-messages.js.map +1 -1
  87. package/dist/ssr/layout/sheet-motion.js +3 -3
  88. package/dist/ssr/layout/sheet-motion.js.map +1 -1
  89. package/dist/styles.css +1 -1
  90. package/dist/types/actions/FilterChip.d.ts +9 -0
  91. package/dist/types/chat/ChatPrimitives.d.ts +6 -0
  92. package/dist/types/chat/ChatTimeline.d.ts +2 -0
  93. package/dist/types/content/ActivityList.d.ts +24 -6
  94. package/dist/types/content/FileView.d.ts +0 -5
  95. package/dist/types/content/Lightbox.d.ts +7 -5
  96. package/dist/types/content/RunLog.d.ts +53 -0
  97. package/dist/types/content/file-view-preview.d.ts +5 -0
  98. package/dist/types/content/index.d.ts +4 -3
  99. package/dist/types/content/run-log-messages.d.ts +61 -0
  100. package/dist/types/feedback/dialog-core.d.ts +3 -1
  101. package/dist/types/feedback/dialog-frame-motion.d.ts +26 -1
  102. package/dist/types/feedback/prompt-sheet.d.ts +1 -0
  103. package/dist/types/feedback/prompts.d.ts +4 -0
  104. package/dist/types/feedback/toast.d.ts +9 -1
  105. package/dist/types/internal/step-row.d.ts +19 -0
  106. package/dist/types/layout/PullToRefresh.d.ts +2 -2
  107. package/dist/types/layout/refresh-messages.d.ts +1 -0
  108. package/dist/types/layout/sheet-motion.d.ts +2 -2
  109. package/package.json +9 -7
@@ -0,0 +1,471 @@
1
+ import { createComponent as _$createComponent } from "solid-js/web";
2
+ import { ssr as _$ssr } from "solid-js/web";
3
+ import { memo as _$memo } from "solid-js/web";
4
+ import { ssrAttribute as _$ssrAttribute } from "solid-js/web";
5
+ import { escape as _$escape } from "solid-js/web";
6
+ var _tmpl$ = ["<i", "></i>"],
7
+ _tmpl$2 = ["<span class=\"k2b-run-log__mark\"", " aria-hidden=\"true\">", "</span>"],
8
+ _tmpl$3 = "<span class=\"k2b-run-log__pip\"></span>",
9
+ _tmpl$4 = ["<li class=\"k2b-run-log__step\"", ">", "</li>"],
10
+ _tmpl$5 = ["<span class=\"k2b-run-log__name\"", ">", "</span>"],
11
+ _tmpl$6 = "<i class=\"ti ti-info-circle\" aria-hidden=\"true\"></i>",
12
+ _tmpl$7 = ["<span>", "</span>"],
13
+ _tmpl$8 = "<i class=\"ti ti-dots\" aria-hidden=\"true\"></i>",
14
+ _tmpl$9 = ["<div class=\"k2b-run-log__more-actions\">", "</div>"],
15
+ _tmpl$0 = ["<div class=\"k2b-run-log__actions\"", "><div class=\"k2b-run-log__inline-actions\">", "</div>", "</div>"],
16
+ _tmpl$1 = ["<i", " aria-hidden=\"true\"></i>"],
17
+ _tmpl$10 = "<i class=\"ti ti-chevron-down k2b-run-log__chevron\" aria-hidden=\"true\"></i>",
18
+ _tmpl$11 = ["<button type=\"button\" class=\"k2b-run-log__toggle\"", "></button>"],
19
+ _tmpl$12 = ["<li class=\"k2b-run-log__earlier\"><button type=\"button\">", "<span>", "</span></button></li>"],
20
+ _tmpl$13 = ["<ol class=\"k2b-run-log__steps\">", "", "</ol>"],
21
+ _tmpl$14 = ["<button type=\"button\" class=\"k2b-run-log__output-toggle\"", "><i class=\"ti ti-chevron-right\" aria-hidden=\"true\"></i><span>", "</span><span class=\"k2b-run-log__counts\">", "</span></button>"],
22
+ _tmpl$15 = ["<button type=\"button\" class=\"k2b-run-log__older\"", ">", "</button>"],
23
+ _tmpl$16 = ["<div class=\"k2b-run-log__fold\"", "", "><div class=\"k2b-run-log__clip\"><div class=\"k2b-run-log__output\" role=\"log\" aria-live=\"off\"", " tabindex=\"0\">", "", "</div></div></div>"],
24
+ _tmpl$17 = ["<section class=\"", "\"", "><header class=\"k2b-run-log__head\"><span class=\"k2b-run-log__head-icon\" aria-hidden=\"true\">", "</span><span class=\"k2b-sr-only\" role=\"status\">", "</span><span class=\"k2b-run-log__main\"", ">", "</span><span class=\"k2b-run-log__meta\">", "</span>", "", "</header><div class=\"k2b-run-log__fold\"", "", "><div class=\"k2b-run-log__clip\">", "</div></div></section>"],
25
+ _tmpl$18 = "<span aria-hidden=\"true\">▸ </span>",
26
+ _tmpl$19 = ["<i", " role=\"img\"", "></i>"],
27
+ _tmpl$20 = ["<div class=\"k2b-run-log__line\"", "><time", ">", "</time><span>", "", "", "</span></div>"];
28
+ import { text } from "@k2b/stdlib";
29
+ import { createEffect, createMemo, createSignal, createUniqueId, Show } from "solid-js";
30
+ import { Button, ButtonLink } from "../actions/Button";
31
+ import { Dropdown } from "../actions/Dropdown";
32
+ import { HoverCard } from "../feedback/HoverCard";
33
+ import { KeyedFor } from "../internal/keyed-for";
34
+ import { StepRowContent } from "../internal/step-row";
35
+ import { useLocale } from "../intl/locale";
36
+ import { useRunLogMessages } from "./run-log-messages";
37
+ const isStep = entry => entry.kind === "step" && "label" in entry;
38
+ const isLog = entry => entry.kind === "log" && "text" in entry;
39
+ const clock = ms => {
40
+ const seconds = Math.floor(Math.max(0, Number.isFinite(ms) ? ms : 0) / 1000);
41
+ return `${Math.floor(seconds / 60)}:${String(seconds % 60).padStart(2, "0")}`;
42
+ };
43
+ const stepDuration = (step, locale) => {
44
+ if (!step.startedAt || !step.endedAt) return undefined;
45
+ const duration = Date.parse(step.endedAt) - Date.parse(step.startedAt);
46
+ return Number.isFinite(duration) && duration >= 0 ? text.pprintDurationMs(duration, {
47
+ locale
48
+ }) : undefined;
49
+ };
50
+ const atTime = (at, formatter) => {
51
+ const date = new Date(at);
52
+ return Number.isFinite(date.getTime()) ? formatter.format(date) : at;
53
+ };
54
+ const headIcons = {
55
+ idle: "ti ti-circle-dashed",
56
+ starting: "ti ti-loader-2 k2b-spin",
57
+ running: "ti ti-player-play",
58
+ succeeded: "ti ti-circle-check",
59
+ failed: "ti ti-alert-circle"
60
+ };
61
+ const markIcons = {
62
+ pending: "",
63
+ running: "",
64
+ succeeded: "ti ti-check",
65
+ failed: "ti ti-x",
66
+ skipped: "ti ti-minus"
67
+ };
68
+ // The approved many-step example keeps five rows and a navigation row in a fixed window.
69
+ const VISIBLE_STEPS = 5;
70
+ function StepMark(props) {
71
+ return _$ssr(_tmpl$2, _$ssrAttribute("data-status", _$escape(props.status, true), false), _$escape(_$createComponent(Show, {
72
+ get when() {
73
+ return markIcons[props.status] || props.icon;
74
+ },
75
+ get fallback() {
76
+ return _$ssr(_tmpl$3);
77
+ },
78
+ get children() {
79
+ return _$ssr(_tmpl$, _$ssrAttribute("class", _$escape(markIcons[props.status] || props.icon, true), false));
80
+ }
81
+ })));
82
+ }
83
+ function RunStep(props) {
84
+ const t = useRunLogMessages();
85
+ const locale = useLocale();
86
+ const status = () => props.state === "succeeded" && props.step.status === "pending" ? "skipped" : props.step.status;
87
+ const statusLabel = () => ({
88
+ pending: t().pending,
89
+ running: t().active,
90
+ succeeded: t().completed,
91
+ failed: t().stepFailed,
92
+ skipped: t().skipped
93
+ })[status()];
94
+ return _$ssr(_tmpl$4, _$ssrAttribute("data-status", _$escape(status(), true), false), _$escape(_$createComponent(StepRowContent, {
95
+ classes: {
96
+ leading: "k2b-run-log__leading",
97
+ label: "k2b-run-log__label",
98
+ meta: "k2b-run-log__reason",
99
+ duration: "k2b-run-log__duration"
100
+ },
101
+ get leading() {
102
+ return _$createComponent(StepMark, {
103
+ get status() {
104
+ return status();
105
+ },
106
+ get icon() {
107
+ return props.step.icon;
108
+ }
109
+ });
110
+ },
111
+ get label() {
112
+ return [_$ssr(_tmpl$5, _$ssrAttribute("title", _$escape(props.step.label, true), false), _$escape(props.step.label)), _$createComponent(Show, {
113
+ get when() {
114
+ return props.step.description;
115
+ },
116
+ children: description => _$createComponent(HoverCard.Trigger, {
117
+ type: "button",
118
+ triggerClass: "k2b-run-log__info",
119
+ get content() {
120
+ return description();
121
+ },
122
+ get ["aria-label"]() {
123
+ return t().details({
124
+ label: props.step.label
125
+ });
126
+ },
127
+ get children() {
128
+ return _$ssr(_tmpl$6);
129
+ }
130
+ })
131
+ })];
132
+ },
133
+ get meta() {
134
+ return _$createComponent(Show, {
135
+ get when() {
136
+ return props.step.message;
137
+ },
138
+ children: message => _$createComponent(HoverCard.Trigger, {
139
+ type: "button",
140
+ triggerClass: "k2b-run-log__reason-button",
141
+ get content() {
142
+ return message();
143
+ },
144
+ get children() {
145
+ return _$ssr(_tmpl$7, _$escape(message()));
146
+ }
147
+ })
148
+ });
149
+ },
150
+ get duration() {
151
+ return _$memo(() => status() === "skipped")() ? t().skipped : stepDuration(props.step, locale());
152
+ },
153
+ get statusLabel() {
154
+ return statusLabel();
155
+ }
156
+ })));
157
+ }
158
+ function RunActions(props) {
159
+ const t = useRunLogMessages();
160
+ const items = () => props.actions.map(action => {
161
+ const base = {
162
+ label: action.label,
163
+ icon: action.icon,
164
+ description: action.disabledReason,
165
+ variant: action.primary ? "accent" : undefined
166
+ };
167
+ if (action.disabled || !action.href && !action.onClick) return {
168
+ ...base,
169
+ disabled: true
170
+ };
171
+ if (action.href) return {
172
+ ...base,
173
+ href: action.href,
174
+ action: action.onClick
175
+ };
176
+ return {
177
+ ...base,
178
+ action: action.onClick
179
+ };
180
+ });
181
+ return _$ssr(_tmpl$0, _$ssrAttribute("data-multiple", props.actions.length > 1 ? "true" : _$escape(undefined, true), false), _$escape(_$createComponent(KeyedFor, {
182
+ get each() {
183
+ return props.actions;
184
+ },
185
+ by: action => action.label,
186
+ children: action => _$createComponent(Show, {
187
+ get when() {
188
+ return _$memo(() => !!action().href)() && !action().disabled;
189
+ },
190
+ get fallback() {
191
+ return _$createComponent(Button, {
192
+ size: "xs",
193
+ variant: "ghost",
194
+ "class": "k2b-run-log__action",
195
+ get ["data-primary"]() {
196
+ return action().primary ? "true" : undefined;
197
+ },
198
+ get disabled() {
199
+ return action().disabled || !action().onClick && !action().href;
200
+ },
201
+ get tooltip() {
202
+ return action().disabledReason;
203
+ },
204
+ onClick: () => action().onClick?.(),
205
+ get children() {
206
+ return [_$ssr(_tmpl$1, _$ssrAttribute("class", _$escape(action().icon, true), false)), _$ssr(_tmpl$7, _$escape(action().label))];
207
+ }
208
+ });
209
+ },
210
+ get children() {
211
+ return _$createComponent(ButtonLink, {
212
+ size: "xs",
213
+ variant: "ghost",
214
+ "class": "k2b-run-log__action",
215
+ get ["data-primary"]() {
216
+ return action().primary ? "true" : undefined;
217
+ },
218
+ get href() {
219
+ return action().href;
220
+ },
221
+ onClick: () => action().onClick?.(),
222
+ get children() {
223
+ return [_$ssr(_tmpl$1, _$ssrAttribute("class", _$escape(action().icon, true), false)), _$ssr(_tmpl$7, _$escape(action().label))];
224
+ }
225
+ });
226
+ }
227
+ })
228
+ })), _$escape(_$createComponent(Show, {
229
+ get when() {
230
+ return props.actions.length > 1;
231
+ },
232
+ get children() {
233
+ return _$ssr(_tmpl$9, _$escape(_$createComponent(Dropdown.Root, {
234
+ get items() {
235
+ return items();
236
+ },
237
+ position: "bottom-right",
238
+ get children() {
239
+ return _$createComponent(Dropdown.Trigger, {
240
+ iconOnly: true,
241
+ size: "xs",
242
+ variant: "ghost",
243
+ "class": "k2b-run-log__action",
244
+ get label() {
245
+ return t().actions;
246
+ },
247
+ get title() {
248
+ return t().actions;
249
+ },
250
+ get children() {
251
+ return _$ssr(_tmpl$8);
252
+ }
253
+ });
254
+ }
255
+ })));
256
+ }
257
+ })));
258
+ }
259
+
260
+ /** A run's steps and output. Presentation and disclosures only; the host owns execution, time, connection, and history. */
261
+ export function RunLog(props) {
262
+ const t = useRunLogMessages();
263
+ const locale = useLocale();
264
+ const time = createMemo(() => new Intl.DateTimeFormat(locale(), {
265
+ timeStyle: "medium"
266
+ }));
267
+ const bodyId = createUniqueId();
268
+ const outputId = createUniqueId();
269
+ const [expanded, setExpanded] = createSignal(false);
270
+ const [outputOpen, setOutputOpen] = createSignal(props.output === "open");
271
+ createEffect(() => setOutputOpen(props.output === "open"));
272
+ const [windowStart, setWindowStart] = createSignal();
273
+ const steps = createMemo(() => {
274
+ const rows = new Map();
275
+ for (const entry of props.entries) if (isStep(entry)) rows.set(entry.id, entry);
276
+ return [...rows.values()];
277
+ });
278
+ const logs = createMemo(() => props.entries.filter(isLog));
279
+ const outputLines = createMemo(() => {
280
+ const lines = [];
281
+ for (const step of steps()) {
282
+ if (step.startedAt) lines.push({
283
+ id: `step:${step.id}`,
284
+ at: step.startedAt,
285
+ level: "step",
286
+ text: step.label
287
+ });
288
+ }
289
+ for (const line of logs()) lines.push({
290
+ ...line,
291
+ id: `log:${line.id}`
292
+ });
293
+ return lines.sort((a, b) => {
294
+ const delta = Date.parse(a.at) - Date.parse(b.at);
295
+ return Number.isFinite(delta) ? delta : 0;
296
+ });
297
+ });
298
+ // A known plan reserves its rows before execution; an empty open output reserves its band too.
299
+ const hasBody = () => steps().length > 0 || outputOpen() || props.state !== "idle" && props.state !== "starting";
300
+ const compact = () => props.size === "compact";
301
+ const visible = () => !compact() || expanded();
302
+ const current = () => steps().find(step => step.status === "running") ?? steps().find(step => step.status === "failed");
303
+ const lastStart = () => Math.max(0, steps().length - VISIBLE_STEPS);
304
+ const currentStart = () => current() ? Math.min(steps().indexOf(current()), lastStart()) : lastStart();
305
+ const start = () => Math.min(windowStart() ?? currentStart(), lastStart());
306
+ const browseSteps = () => {
307
+ if (start() > 0) setWindowStart(Math.max(0, start() - VISIBLE_STEPS));else setWindowStart(windowStart() === undefined ? lastStart() : undefined);
308
+ };
309
+ const stateLabel = () => ({
310
+ idle: t().idle,
311
+ starting: t().starting,
312
+ running: t().running,
313
+ succeeded: t().succeeded,
314
+ failed: t().failed
315
+ })[props.state];
316
+ const main = () => {
317
+ if (props.state === "running") return props.duration === undefined ? t().running : t().since({
318
+ duration: clock(props.duration)
319
+ });
320
+ if (props.state === "succeeded") return props.duration === undefined ? t().succeeded : t().doneAfter({
321
+ duration: clock(props.duration)
322
+ });
323
+ if (props.state === "failed") return props.duration === undefined ? t().failed : t().failedAfter({
324
+ duration: clock(props.duration)
325
+ });
326
+ return props.state === "idle" ? t().idle : t().starting;
327
+ };
328
+ const compactMain = () => props.state === "running" || props.state === "failed" ? current()?.label ?? main() : props.state === "succeeded" ? t().succeeded : main();
329
+ const compactMeta = () => {
330
+ if (props.state === "running" && current()) return [t().progress({
331
+ current: steps().indexOf(current()) + 1,
332
+ count: steps().length
333
+ }), props.duration === undefined ? "" : clock(props.duration)].filter(Boolean).join(" · ");
334
+ if (props.state === "succeeded") return [steps().length === 1 ? t().step : t().steps({
335
+ count: steps().length
336
+ }), props.duration === undefined ? "" : clock(props.duration)].filter(Boolean).join(" · ");
337
+ if (props.state === "failed") return [t().stepFailed, props.duration === undefined ? "" : clock(props.duration)].filter(Boolean).join(" · ");
338
+ return props.meta;
339
+ };
340
+ const count = () => outputLines().length + (props.olderCount ?? 0);
341
+ const counts = () => {
342
+ if (!count()) return t().noLines;
343
+ const warnings = logs().filter(line => line.level === "warn").length;
344
+ const errors = logs().filter(line => line.level === "error").length;
345
+ return [count() === 1 ? t().line : t().lines({
346
+ count: count()
347
+ }), warnings ? warnings === 1 ? t().warning : t().warnings({
348
+ count: warnings
349
+ }) : "", errors ? errors === 1 ? t().error : t().errors({
350
+ count: errors
351
+ }) : ""].filter(Boolean).join(" · ");
352
+ };
353
+ let output;
354
+ let followOutput = true;
355
+ createEffect(() => {
356
+ outputLines();
357
+ if (props.state === "idle" || props.state === "starting") followOutput = true;
358
+ // Reading away from the end pauses following. New batches never scroll the page.
359
+ if (output && followOutput) output.scrollTop = output.scrollHeight;
360
+ });
361
+ return _$ssr(_tmpl$17, `k2b-run-log k2b-focus-inset ${_$escape(props.class ?? "", true)}`, _$ssrAttribute("data-state", _$escape(props.state, true), false) + _$ssrAttribute("data-size", _$escape(props.size ?? "full", true), false) + _$ssrAttribute("data-expanded", visible() ? "true" : "false", false) + _$ssrAttribute("data-body", hasBody() ? "true" : "false", false) + _$ssrAttribute("aria-label", _$escape(props.label ?? t().run, true), false), _$escape(_$createComponent(Show, {
362
+ get when() {
363
+ return compact();
364
+ },
365
+ get fallback() {
366
+ return _$ssr(_tmpl$, _$ssrAttribute("class", _$escape(headIcons[props.state], true), false));
367
+ },
368
+ get children() {
369
+ return _$createComponent(StepMark, {
370
+ get status() {
371
+ return _$memo(() => props.state === "idle")() ? "pending" : _$memo(() => props.state === "starting")() ? "running" : props.state;
372
+ }
373
+ });
374
+ }
375
+ })), _$escape(stateLabel()), _$ssrAttribute("title", compact() && !expanded() ? _$escape(compactMain(), true) : _$escape(main(), true), false), compact() && !expanded() ? _$escape(compactMain()) : _$escape(main()), compact() && !expanded() ? _$escape(compactMeta()) : _$escape(props.meta), _$escape(_$createComponent(Show, {
376
+ get when() {
377
+ return props.actions?.length;
378
+ },
379
+ get children() {
380
+ return _$createComponent(RunActions, {
381
+ get actions() {
382
+ return props.actions;
383
+ }
384
+ });
385
+ }
386
+ })), _$escape(_$createComponent(Show, {
387
+ get when() {
388
+ return compact();
389
+ },
390
+ get children() {
391
+ return [_$ssr(_tmpl$10), _$ssr(_tmpl$11, _$ssrAttribute("aria-label", _$escape(t().toggle, true), false) + _$ssrAttribute("aria-expanded", _$escape(expanded(), true), false) + _$ssrAttribute("aria-controls", _$escape(bodyId, true), false))];
392
+ }
393
+ })), _$ssrAttribute("id", _$escape(bodyId, true), false) + _$ssrAttribute("data-open", visible() ? "true" : "false", false), _$ssrAttribute("inert", !visible(), true) + _$ssrAttribute("aria-hidden", !visible(), false), _$escape(_$createComponent(Show, {
394
+ get when() {
395
+ return hasBody();
396
+ },
397
+ get children() {
398
+ return [_$createComponent(Show, {
399
+ get when() {
400
+ return steps().length;
401
+ },
402
+ get children() {
403
+ return _$ssr(_tmpl$13, _$escape(_$createComponent(Show, {
404
+ get when() {
405
+ return steps().length > VISIBLE_STEPS;
406
+ },
407
+ get children() {
408
+ return _$ssr(_tmpl$12, _$escape(_$createComponent(StepMark, {
409
+ status: "succeeded"
410
+ })), start() ? _$escape(t().earlier({
411
+ count: start()
412
+ })) : windowStart() === undefined ? _$escape(t().later({
413
+ count: lastStart()
414
+ })) : _$escape(t().current));
415
+ }
416
+ })), _$escape(_$createComponent(KeyedFor, {
417
+ get each() {
418
+ return steps().slice(start(), start() + VISIBLE_STEPS);
419
+ },
420
+ by: step => step.id,
421
+ children: step => _$createComponent(RunStep, {
422
+ get step() {
423
+ return step();
424
+ },
425
+ get state() {
426
+ return props.state;
427
+ }
428
+ })
429
+ })));
430
+ }
431
+ }), _$createComponent(Show, {
432
+ get when() {
433
+ return props.output !== "hidden";
434
+ },
435
+ get children() {
436
+ return [_$ssr(_tmpl$14, _$ssrAttribute("aria-expanded", _$escape(outputOpen(), true), false) + _$ssrAttribute("aria-controls", _$escape(outputId, true), false), _$escape(t().output), _$escape(counts())), _$ssr(_tmpl$16, _$ssrAttribute("id", _$escape(outputId, true), false) + _$ssrAttribute("data-open", outputOpen() ? "true" : "false", false), _$ssrAttribute("inert", !outputOpen(), true) + _$ssrAttribute("aria-hidden", !outputOpen(), false), _$ssrAttribute("aria-label", _$escape(t().output, true), false), _$escape(_$createComponent(Show, {
437
+ get when() {
438
+ return props.olderCount;
439
+ },
440
+ get children() {
441
+ return _$ssr(_tmpl$15, _$ssrAttribute("disabled", !props.onLoadOlder, true), _$escape(t().older({
442
+ count: props.olderCount
443
+ })));
444
+ }
445
+ })), _$escape(_$createComponent(KeyedFor, {
446
+ get each() {
447
+ return outputLines();
448
+ },
449
+ by: line => line.id,
450
+ children: line => _$ssr(_tmpl$20, _$ssrAttribute("data-level", _$escape(line().level, true), false), _$ssrAttribute("datetime", _$escape(line().at, true), false), _$escape(atTime(line().at, time())), _$escape(_$createComponent(Show, {
451
+ get when() {
452
+ return line().level === "step";
453
+ },
454
+ get children() {
455
+ return _$ssr(_tmpl$18);
456
+ }
457
+ })), _$escape(_$createComponent(Show, {
458
+ get when() {
459
+ return line().level === "warn" || line().level === "error";
460
+ },
461
+ get children() {
462
+ return [_$ssr(_tmpl$19, _$ssrAttribute("class", line().level === "warn" ? "ti ti-alert-triangle" : "ti ti-x", false), _$ssrAttribute("aria-label", line().level === "warn" ? _$escape(t().warningLevel, true) : _$escape(t().errorLevel, true), false)), " "];
463
+ }
464
+ })), _$escape(line().text))
465
+ })))];
466
+ }
467
+ })];
468
+ }
469
+ })));
470
+ }
471
+ //# sourceMappingURL=RunLog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["content/RunLog.tsx"],"sourcesContent":["import { text } from \"@k2b/stdlib\";\nimport { createEffect, createMemo, createSignal, createUniqueId, type JSX, Show } from \"solid-js\";\nimport { Button, ButtonLink } from \"../actions/Button\";\nimport { Dropdown, type DropdownItem } from \"../actions/Dropdown\";\nimport { HoverCard } from \"../feedback/HoverCard\";\nimport { KeyedFor } from \"../internal/keyed-for\";\nimport { StepRowContent } from \"../internal/step-row\";\nimport { useLocale } from \"../intl/locale\";\nimport { useRunLogMessages } from \"./run-log-messages\";\n\nexport type RunLogState = \"idle\" | \"starting\" | \"running\" | \"succeeded\" | \"failed\";\nexport type RunLevel = \"info\" | \"warn\" | \"error\";\nexport type RunStepEntry = {\n kind: \"step\";\n id: string;\n at: string;\n label: string;\n /** Complete Tabler class, e.g. `ti ti-file-text`. */\n icon?: string;\n description?: string;\n status: \"pending\" | \"running\" | \"succeeded\" | \"failed\" | \"skipped\";\n startedAt?: string;\n endedAt?: string;\n message?: string;\n};\nexport type RunLogEntry = { kind: \"log\"; id: string; at: string; level: RunLevel; text: string };\nexport type RunEntry = RunStepEntry | RunLogEntry;\nexport type RunLogAction = {\n icon: string;\n label: string;\n onClick?: () => void;\n href?: string;\n primary?: boolean;\n disabled?: boolean;\n disabledReason?: string;\n};\nexport type RunLogProps = {\n state: RunLogState;\n /** Unknown kinds are ignored. Later step records with the same id replace the row in its original position. */\n entries: readonly (RunEntry | { kind: string })[];\n /** Milliseconds supplied by the host. No clock runs inside RunLog. */\n duration?: number;\n meta?: JSX.Element;\n size?: \"full\" | \"compact\";\n /** Initial disclosure state; a changed value also updates the disclosure. */\n output?: \"open\" | \"closed\" | \"hidden\";\n olderCount?: number;\n onLoadOlder?: () => void;\n actions?: readonly RunLogAction[];\n label?: string;\n class?: string;\n};\n\nconst isStep = (entry: RunLogProps[\"entries\"][number]): entry is RunStepEntry => entry.kind === \"step\" && \"label\" in entry;\nconst isLog = (entry: RunLogProps[\"entries\"][number]): entry is RunLogEntry => entry.kind === \"log\" && \"text\" in entry;\nconst clock = (ms: number) => {\n const seconds = Math.floor(Math.max(0, Number.isFinite(ms) ? ms : 0) / 1000);\n return `${Math.floor(seconds / 60)}:${String(seconds % 60).padStart(2, \"0\")}`;\n};\nconst stepDuration = (step: RunStepEntry, locale: string) => {\n if (!step.startedAt || !step.endedAt) return undefined;\n const duration = Date.parse(step.endedAt) - Date.parse(step.startedAt);\n return Number.isFinite(duration) && duration >= 0 ? text.pprintDurationMs(duration, { locale }) : undefined;\n};\nconst atTime = (at: string, formatter: Intl.DateTimeFormat) => {\n const date = new Date(at);\n return Number.isFinite(date.getTime()) ? formatter.format(date) : at;\n};\nconst headIcons: Record<RunLogState, string> = {\n idle: \"ti ti-circle-dashed\",\n starting: \"ti ti-loader-2 k2b-spin\",\n running: \"ti ti-player-play\",\n succeeded: \"ti ti-circle-check\",\n failed: \"ti ti-alert-circle\",\n};\nconst markIcons = { pending: \"\", running: \"\", succeeded: \"ti ti-check\", failed: \"ti ti-x\", skipped: \"ti ti-minus\" };\n// The approved many-step example keeps five rows and a navigation row in a fixed window.\nconst VISIBLE_STEPS = 5;\n\nfunction StepMark(props: { status: RunStepEntry[\"status\"]; icon?: string }) {\n return (\n <span class=\"k2b-run-log__mark\" data-status={props.status} aria-hidden=\"true\">\n <Show when={markIcons[props.status] || props.icon} fallback={<span class=\"k2b-run-log__pip\" />}>\n <i class={markIcons[props.status] || props.icon} />\n </Show>\n </span>\n );\n}\n\nfunction RunStep(props: { step: RunStepEntry; state: RunLogState }) {\n const t = useRunLogMessages();\n const locale = useLocale();\n const status = () => (props.state === \"succeeded\" && props.step.status === \"pending\" ? \"skipped\" : props.step.status);\n const statusLabel = () =>\n ({ pending: t().pending, running: t().active, succeeded: t().completed, failed: t().stepFailed, skipped: t().skipped })[status()];\n return (\n <li class=\"k2b-run-log__step\" data-status={status()}>\n <StepRowContent\n classes={{\n leading: \"k2b-run-log__leading\",\n label: \"k2b-run-log__label\",\n meta: \"k2b-run-log__reason\",\n duration: \"k2b-run-log__duration\",\n }}\n leading={<StepMark status={status()} icon={props.step.icon} />}\n label={\n <>\n <span class=\"k2b-run-log__name\" title={props.step.label}>\n {props.step.label}\n </span>\n <Show when={props.step.description}>\n {(description) => (\n <HoverCard.Trigger\n type=\"button\"\n triggerClass=\"k2b-run-log__info\"\n content={description()}\n aria-label={t().details({ label: props.step.label })}\n >\n <i class=\"ti ti-info-circle\" aria-hidden=\"true\" />\n </HoverCard.Trigger>\n )}\n </Show>\n </>\n }\n meta={\n <Show when={props.step.message}>\n {(message) => (\n <HoverCard.Trigger type=\"button\" triggerClass=\"k2b-run-log__reason-button\" content={message()}>\n <span>{message()}</span>\n </HoverCard.Trigger>\n )}\n </Show>\n }\n duration={status() === \"skipped\" ? t().skipped : stepDuration(props.step, locale())}\n statusLabel={statusLabel()}\n />\n </li>\n );\n}\n\nfunction RunActions(props: { actions: readonly RunLogAction[] }) {\n const t = useRunLogMessages();\n const items = (): DropdownItem[] =>\n props.actions.map((action) => {\n const base = {\n label: action.label,\n icon: action.icon,\n description: action.disabledReason,\n variant: action.primary ? (\"accent\" as const) : undefined,\n };\n if (action.disabled || (!action.href && !action.onClick)) return { ...base, disabled: true };\n if (action.href) return { ...base, href: action.href, action: action.onClick };\n return { ...base, action: action.onClick! };\n });\n return (\n <div class=\"k2b-run-log__actions\" data-multiple={props.actions.length > 1 ? \"true\" : undefined}>\n <div class=\"k2b-run-log__inline-actions\">\n <KeyedFor each={props.actions} by={(action) => action.label}>\n {(action) => (\n <Show\n when={action().href && !action().disabled}\n fallback={\n <Button\n size=\"xs\"\n variant=\"ghost\"\n class=\"k2b-run-log__action\"\n data-primary={action().primary ? \"true\" : undefined}\n disabled={action().disabled || (!action().onClick && !action().href)}\n tooltip={action().disabledReason}\n onClick={() => action().onClick?.()}\n >\n <i class={action().icon} aria-hidden=\"true\" />\n <span>{action().label}</span>\n </Button>\n }\n >\n <ButtonLink\n size=\"xs\"\n variant=\"ghost\"\n class=\"k2b-run-log__action\"\n data-primary={action().primary ? \"true\" : undefined}\n href={action().href}\n onClick={() => action().onClick?.()}\n >\n <i class={action().icon} aria-hidden=\"true\" />\n <span>{action().label}</span>\n </ButtonLink>\n </Show>\n )}\n </KeyedFor>\n </div>\n <Show when={props.actions.length > 1}>\n <div class=\"k2b-run-log__more-actions\">\n <Dropdown.Root items={items()} position=\"bottom-right\">\n <Dropdown.Trigger iconOnly size=\"xs\" variant=\"ghost\" class=\"k2b-run-log__action\" label={t().actions} title={t().actions}>\n <i class=\"ti ti-dots\" aria-hidden=\"true\" />\n </Dropdown.Trigger>\n </Dropdown.Root>\n </div>\n </Show>\n </div>\n );\n}\n\n/** A run's steps and output. Presentation and disclosures only; the host owns execution, time, connection, and history. */\nexport function RunLog(props: RunLogProps): JSX.Element {\n const t = useRunLogMessages();\n const locale = useLocale();\n const time = createMemo(() => new Intl.DateTimeFormat(locale(), { timeStyle: \"medium\" }));\n const bodyId = createUniqueId();\n const outputId = createUniqueId();\n const [expanded, setExpanded] = createSignal(false);\n const [outputOpen, setOutputOpen] = createSignal(props.output === \"open\");\n createEffect(() => setOutputOpen(props.output === \"open\"));\n const [windowStart, setWindowStart] = createSignal<number>();\n const steps = createMemo(() => {\n const rows = new Map<string, RunStepEntry>();\n for (const entry of props.entries) if (isStep(entry)) rows.set(entry.id, entry);\n return [...rows.values()];\n });\n const logs = createMemo(() => props.entries.filter(isLog));\n const outputLines = createMemo(() => {\n const lines: { id: string; at: string; level: RunLevel | \"step\"; text: string }[] = [];\n for (const step of steps()) {\n if (step.startedAt) lines.push({ id: `step:${step.id}`, at: step.startedAt, level: \"step\", text: step.label });\n }\n for (const line of logs()) lines.push({ ...line, id: `log:${line.id}` });\n return lines.sort((a, b) => {\n const delta = Date.parse(a.at) - Date.parse(b.at);\n return Number.isFinite(delta) ? delta : 0;\n });\n });\n // A known plan reserves its rows before execution; an empty open output reserves its band too.\n const hasBody = () => steps().length > 0 || outputOpen() || (props.state !== \"idle\" && props.state !== \"starting\");\n const compact = () => props.size === \"compact\";\n const visible = () => !compact() || expanded();\n const current = () => steps().find((step) => step.status === \"running\") ?? steps().find((step) => step.status === \"failed\");\n const lastStart = () => Math.max(0, steps().length - VISIBLE_STEPS);\n const currentStart = () => (current() ? Math.min(steps().indexOf(current()!), lastStart()) : lastStart());\n const start = () => Math.min(windowStart() ?? currentStart(), lastStart());\n const browseSteps = () => {\n if (start() > 0) setWindowStart(Math.max(0, start() - VISIBLE_STEPS));\n else setWindowStart(windowStart() === undefined ? lastStart() : undefined);\n };\n const stateLabel = () =>\n ({ idle: t().idle, starting: t().starting, running: t().running, succeeded: t().succeeded, failed: t().failed })[props.state];\n const main = () => {\n if (props.state === \"running\") return props.duration === undefined ? t().running : t().since({ duration: clock(props.duration) });\n if (props.state === \"succeeded\")\n return props.duration === undefined ? t().succeeded : t().doneAfter({ duration: clock(props.duration) });\n if (props.state === \"failed\") return props.duration === undefined ? t().failed : t().failedAfter({ duration: clock(props.duration) });\n return props.state === \"idle\" ? t().idle : t().starting;\n };\n const compactMain = () =>\n props.state === \"running\" || props.state === \"failed\"\n ? (current()?.label ?? main())\n : props.state === \"succeeded\"\n ? t().succeeded\n : main();\n const compactMeta = () => {\n if (props.state === \"running\" && current())\n return [\n t().progress({ current: steps().indexOf(current()!) + 1, count: steps().length }),\n props.duration === undefined ? \"\" : clock(props.duration),\n ]\n .filter(Boolean)\n .join(\" · \");\n if (props.state === \"succeeded\")\n return [\n steps().length === 1 ? t().step : t().steps({ count: steps().length }),\n props.duration === undefined ? \"\" : clock(props.duration),\n ]\n .filter(Boolean)\n .join(\" · \");\n if (props.state === \"failed\")\n return [t().stepFailed, props.duration === undefined ? \"\" : clock(props.duration)].filter(Boolean).join(\" · \");\n return props.meta;\n };\n const count = () => outputLines().length + (props.olderCount ?? 0);\n const counts = () => {\n if (!count()) return t().noLines;\n const warnings = logs().filter((line) => line.level === \"warn\").length;\n const errors = logs().filter((line) => line.level === \"error\").length;\n return [\n count() === 1 ? t().line : t().lines({ count: count() }),\n warnings ? (warnings === 1 ? t().warning : t().warnings({ count: warnings })) : \"\",\n errors ? (errors === 1 ? t().error : t().errors({ count: errors })) : \"\",\n ]\n .filter(Boolean)\n .join(\" · \");\n };\n let output: HTMLDivElement | undefined;\n let followOutput = true;\n createEffect(() => {\n outputLines();\n if (props.state === \"idle\" || props.state === \"starting\") followOutput = true;\n // Reading away from the end pauses following. New batches never scroll the page.\n if (output && followOutput) output.scrollTop = output.scrollHeight;\n });\n return (\n <section\n class={`k2b-run-log k2b-focus-inset ${props.class ?? \"\"}`}\n data-state={props.state}\n data-size={props.size ?? \"full\"}\n data-expanded={visible() ? \"true\" : \"false\"}\n data-body={hasBody() ? \"true\" : \"false\"}\n aria-label={props.label ?? t().run}\n >\n <header class=\"k2b-run-log__head\">\n <span class=\"k2b-run-log__head-icon\" aria-hidden=\"true\">\n <Show when={compact()} fallback={<i class={headIcons[props.state]} />}>\n <StepMark status={props.state === \"idle\" ? \"pending\" : props.state === \"starting\" ? \"running\" : props.state} />\n </Show>\n </span>\n <span class=\"k2b-sr-only\" role=\"status\">\n {stateLabel()}\n </span>\n <span class=\"k2b-run-log__main\" title={compact() && !expanded() ? compactMain() : main()}>\n {compact() && !expanded() ? compactMain() : main()}\n </span>\n <span class=\"k2b-run-log__meta\">{compact() && !expanded() ? compactMeta() : props.meta}</span>\n <Show when={props.actions?.length}>\n <RunActions actions={props.actions!} />\n </Show>\n <Show when={compact()}>\n <i class=\"ti ti-chevron-down k2b-run-log__chevron\" aria-hidden=\"true\" />\n <button\n type=\"button\"\n class=\"k2b-run-log__toggle\"\n aria-label={t().toggle}\n aria-expanded={expanded()}\n aria-controls={bodyId}\n onClick={() => setExpanded(!expanded())}\n />\n </Show>\n </header>\n <div class=\"k2b-run-log__fold\" id={bodyId} data-open={visible() ? \"true\" : \"false\"} inert={!visible()} aria-hidden={!visible()}>\n <div class=\"k2b-run-log__clip\">\n <Show when={hasBody()}>\n <Show when={steps().length}>\n <ol class=\"k2b-run-log__steps\">\n <Show when={steps().length > VISIBLE_STEPS}>\n <li class=\"k2b-run-log__earlier\">\n <button type=\"button\" onClick={browseSteps}>\n <StepMark status=\"succeeded\" />\n <span>\n {start()\n ? t().earlier({ count: start() })\n : windowStart() === undefined\n ? t().later({ count: lastStart() })\n : t().current}\n </span>\n </button>\n </li>\n </Show>\n <KeyedFor each={steps().slice(start(), start() + VISIBLE_STEPS)} by={(step) => step.id}>\n {(step) => <RunStep step={step()} state={props.state} />}\n </KeyedFor>\n </ol>\n </Show>\n <Show when={props.output !== \"hidden\"}>\n <button\n type=\"button\"\n class=\"k2b-run-log__output-toggle\"\n aria-expanded={outputOpen()}\n aria-controls={outputId}\n onClick={() => setOutputOpen(!outputOpen())}\n >\n <i class=\"ti ti-chevron-right\" aria-hidden=\"true\" />\n <span>{t().output}</span>\n <span class=\"k2b-run-log__counts\">{counts()}</span>\n </button>\n <div\n class=\"k2b-run-log__fold\"\n id={outputId}\n data-open={outputOpen() ? \"true\" : \"false\"}\n inert={!outputOpen()}\n aria-hidden={!outputOpen()}\n >\n <div class=\"k2b-run-log__clip\">\n <div\n ref={output}\n class=\"k2b-run-log__output\"\n role=\"log\"\n aria-live=\"off\"\n aria-label={t().output}\n tabIndex={0}\n onScroll={(event) => {\n const node = event.currentTarget;\n followOutput = Math.ceil(node.scrollTop + node.clientHeight) >= node.scrollHeight;\n }}\n >\n <Show when={props.olderCount}>\n <button\n type=\"button\"\n class=\"k2b-run-log__older\"\n disabled={!props.onLoadOlder}\n onClick={() => {\n followOutput = false;\n props.onLoadOlder?.();\n }}\n >\n {t().older({ count: props.olderCount! })}\n </button>\n </Show>\n <KeyedFor each={outputLines()} by={(line) => line.id}>\n {(line) => (\n <div class=\"k2b-run-log__line\" data-level={line().level}>\n <time dateTime={line().at}>{atTime(line().at, time())}</time>\n <span>\n <Show when={line().level === \"step\"}>\n <span aria-hidden=\"true\">▸ </span>\n </Show>\n <Show when={line().level === \"warn\" || line().level === \"error\"}>\n <i\n class={line().level === \"warn\" ? \"ti ti-alert-triangle\" : \"ti ti-x\"}\n role=\"img\"\n aria-label={line().level === \"warn\" ? t().warningLevel : t().errorLevel}\n />{\" \"}\n </Show>\n {line().text}\n </span>\n </div>\n )}\n </KeyedFor>\n </div>\n </div>\n </div>\n </Show>\n </Show>\n </div>\n </div>\n </section>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,IAAI,QAAQ,aAAa;AAClC,SAAS,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,cAAc,EAAY,IAAI,QAAQ,UAAU;AACjG,SAAS,MAAM,EAAE,UAAU,QAAQ,mBAAmB;AACtD,SAAS,QAAQ,QAA2B,qBAAqB;AACjE,SAAS,SAAS,QAAQ,uBAAuB;AACjD,SAAS,QAAQ,QAAQ,uBAAuB;AAChD,SAAS,cAAc,QAAQ,sBAAsB;AACrD,SAAS,SAAS,QAAQ,gBAAgB;AAC1C,SAAS,iBAAiB,QAAQ,oBAAoB;AA6CtD,MAAM,MAAM,GAAI,KAAqC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
  activityYesterday: "Yesterday",
12
12
  activityOlder: "More than a week ago",
13
- activityAutomatic: "automatic",
13
+ activityAutomatic: "Automatic",
14
14
  activityAll: ({
15
15
  count
16
16
  }) => `All ${count}`,
@@ -24,7 +24,7 @@ const activityMessages = i18n.define({
24
24
  activityToday: "Heute",
25
25
  activityYesterday: "Gestern",
26
26
  activityOlder: "Vor über einer Woche",
27
- activityAutomatic: "automatisch",
27
+ activityAutomatic: "Automatisch",
28
28
  activityAll: ({
29
29
  count
30
30
  }) => `Alle ${count}`,
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["content/activity-messages.ts"],"sourcesContent":["import { i18n } from \"@k2b/stdlib\";\nimport { useLocale } from \"../intl/locale\";\n\n/** Words of `ActivityList` and `ActivityCard`; the sentences of the entries come from the application. */\nconst activityMessages = i18n.define({\n baseLocale: \"en\",\n messages: {\n en: {\n activityTitle: \"History\",\n activityToday: \"Today\",\n activityYesterday: \"Yesterday\",\n activityOlder: \"More than a week ago\",\n activityAutomatic: \"automatic\",\n activityAll: ({ count }: { count: number }) => `All ${count}`,\n activityEmpty: \"Nothing has happened yet.\",\n activityError: \"The history did not load.\",\n activityReload: \"Reload\",\n activityFilter: \"Filter by kind\",\n },\n de: {\n activityTitle: \"Verlauf\",\n activityToday: \"Heute\",\n activityYesterday: \"Gestern\",\n activityOlder: \"Vor über einer Woche\",\n activityAutomatic: \"automatisch\",\n activityAll: ({ count }) => `Alle ${count}`,\n activityEmpty: \"Noch nichts passiert.\",\n activityError: \"Der Verlauf ließ sich nicht laden.\",\n activityReload: \"Neu laden\",\n activityFilter: \"Filter nach Art\",\n },\n },\n});\n\nexport type ActivityMessages = ReturnType<(typeof activityMessages)[\"resolve\"]>[\"t\"];\n\n/** Resolved from the inherited render locale. */\nexport const useActivityMessages = (): (() => ActivityMessages) => {\n const locale = useLocale();\n return () => activityMessages.resolve([locale()]).t;\n};\n\n/** Outside a component, such as when a dialog opens: the given locale, else the document's language. */\nexport const resolveActivityMessages = (locale?: string): ActivityMessages =>\n activityMessages.resolve([locale ?? (typeof document === \"undefined\" ? activityMessages.baseLocale : document.documentElement.lang)]).t;\n\nexport const checkActivityMessages = () => activityMessages.check();\n"],"mappings":"AAAA,SAAS,IAAI,QAAQ,aAAa;AAClC,SAAS,SAAS,QAAQ,gBAAgB;;AAE1C;AACA,MAAM,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC;EACnC,UAAU,EAAE,IAAI;EAChB,QAAQ,EAAE;IACR,EAAE,EAAE;MACF,aAAa,EAAE,SAAS;MACxB,aAAa,EAAE,OAAO;MACtB,iBAAiB,EAAE,WAAW;MAC9B,aAAa,EAAE,sBAAsB;MACrC,iBAAiB,EAAE,WAAW;MAC9B,WAAW,EAAE,CAAC;QAAE;MAAyB,CAAC,KAAK,OAAO,KAAK,EAAE;MAC7D,aAAa,EAAE,2BAA2B;MAC1C,aAAa,EAAE,2BAA2B;MAC1C,cAAc,EAAE,QAAQ;MACxB,cAAc,EAAE;IAClB,CAAC;IACD,EAAE,EAAE;MACF,aAAa,EAAE,SAAS;MACxB,aAAa,EAAE,OAAO;MACtB,iBAAiB,EAAE,SAAS;MAC5B,aAAa,EAAE,sBAAsB;MACrC,iBAAiB,EAAE,aAAa;MAChC,WAAW,EAAE,CAAC;QAAE;MAAM,CAAC,KAAK,QAAQ,KAAK,EAAE;MAC3C,aAAa,EAAE,uBAAuB;MACtC,aAAa,EAAE,oCAAoC;MACnD,cAAc,EAAE,WAAW;MAC3B,cAAc,EAAE;IAClB;EACF;AACF,CAAC,CAAC;AAIF;AACA,OAAO,MAAM,mBAAmB,GAAG,MAAgC;EACjE,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC;EAC1B,OAAO,MAAM,gBAAgB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC;;AAED;AACA,OAAO,MAAM,uBAAuB,GAAI,MAAe,IACrD,gBAAgB,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,OAAO,QAAQ,KAAK,WAAW,GAAG,gBAAgB,CAAC,UAAU,GAAG,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAEzI,OAAO,MAAM,qBAAqB,GAAG,MAAM,gBAAgB,CAAC,KAAK,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["content/activity-messages.ts"],"sourcesContent":["import { i18n } from \"@k2b/stdlib\";\nimport { useLocale } from \"../intl/locale\";\n\n/** Words of `ActivityList` and `ActivityCard`; the sentences of the entries come from the application. */\nconst activityMessages = i18n.define({\n baseLocale: \"en\",\n messages: {\n en: {\n activityTitle: \"History\",\n activityToday: \"Today\",\n activityYesterday: \"Yesterday\",\n activityOlder: \"More than a week ago\",\n activityAutomatic: \"Automatic\",\n activityAll: ({ count }: { count: number }) => `All ${count}`,\n activityEmpty: \"Nothing has happened yet.\",\n activityError: \"The history did not load.\",\n activityReload: \"Reload\",\n activityFilter: \"Filter by kind\",\n },\n de: {\n activityTitle: \"Verlauf\",\n activityToday: \"Heute\",\n activityYesterday: \"Gestern\",\n activityOlder: \"Vor über einer Woche\",\n activityAutomatic: \"Automatisch\",\n activityAll: ({ count }) => `Alle ${count}`,\n activityEmpty: \"Noch nichts passiert.\",\n activityError: \"Der Verlauf ließ sich nicht laden.\",\n activityReload: \"Neu laden\",\n activityFilter: \"Filter nach Art\",\n },\n },\n});\n\nexport type ActivityMessages = ReturnType<(typeof activityMessages)[\"resolve\"]>[\"t\"];\n\n/** Resolved from the inherited render locale. */\nexport const useActivityMessages = (): (() => ActivityMessages) => {\n const locale = useLocale();\n return () => activityMessages.resolve([locale()]).t;\n};\n\n/** Outside a component, such as when a dialog opens: the given locale, else the document's language. */\nexport const resolveActivityMessages = (locale?: string): ActivityMessages =>\n activityMessages.resolve([locale ?? (typeof document === \"undefined\" ? activityMessages.baseLocale : document.documentElement.lang)]).t;\n\nexport const checkActivityMessages = () => activityMessages.check();\n"],"mappings":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C;AAEzI,OAAO,MAAM,qBAAqB,GAAG,MAAM,gBAAgB,CAAC,KAAK,CAAC,CAAC","ignoreList":[]}
@@ -57,6 +57,19 @@ export const getFileViewPreviewKind = file => {
57
57
  return kind;
58
58
  };
59
59
 
60
+ /**
61
+ * A file size such as "4.2 MB". With `locale`, the number follows that language ("4,2 MB") and drops a trailing
62
+ * zero ("64 KB"); without it, the output stays as before.
63
+ */
64
+ export const formatFileViewSize = (bytes, locale) => {
65
+ const [value, unit] = bytes < 1024 ? [bytes, "B"] : bytes < 1024 * 1024 ? [bytes / 1024, "KB"] : [bytes / (1024 * 1024), "MB"];
66
+ if (unit === "B") return `${bytes} B`;
67
+ if (!locale) return `${value.toFixed(1)} ${unit}`;
68
+ return `${new Intl.NumberFormat(locale, {
69
+ maximumFractionDigits: 1
70
+ }).format(value)} ${unit}`;
71
+ };
72
+
60
73
  /** Use this to expose preview actions only for files FileView can render. */
61
74
  export const canPreviewFile = file => getFileViewPreviewKind(file) !== null;
62
75
  export const parseDelimitedText = (input, delimiter, limits = {}) => {