basalt-ui 2.27.1 → 2.28.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/CHANGELOG.md +111 -0
- package/MIGRATING.md +172 -12
- package/agent/rules/basalt-batteries.md +1 -1
- package/agent/rules/basalt-mantine.md +1 -1
- package/agent/rules/basalt-tokens.md +2 -2
- package/agent/skills/basalt-design/SKILL.md +1 -1
- package/agent/skills/basalt-design/references/catalogue.md +40 -36
- package/agent/skills/basalt-design/references/recipes.md +47 -0
- package/configs/oxlint-basalt.json +2 -1
- package/configs/oxlint-plugin.js +110 -2
- package/configs/oxlint-plugin.test.ts +99 -4
- package/dist/agent/chat/thread-message.d.ts +1 -160
- package/dist/agent/chat/thread-message.d.ts.map +1 -1
- package/dist/agent/chat/thread-message.js +7 -162
- package/dist/agent/chat/virtualize.d.ts +5 -5
- package/dist/charts/ChartCard.d.ts +5 -2
- package/dist/charts/ChartCard.d.ts.map +1 -1
- package/dist/charts/ChartCard.js +46 -13
- package/dist/charts/Lines.d.ts.map +1 -1
- package/dist/charts/Lines.js +11 -4
- package/dist/charts/Sparkline.d.ts +9 -2
- package/dist/charts/Sparkline.d.ts.map +1 -1
- package/dist/charts/Sparkline.js +104 -41
- package/dist/charts/chart-box.module.css +69 -3
- package/dist/charts/chart-box.module.css.d.ts +5 -0
- package/dist/charts/chart-card.module.css +12 -4
- package/dist/charts/chart-card.module.css.d.ts +1 -0
- package/dist/charts/compile.d.ts.map +1 -1
- package/dist/charts/compile.js +21 -19
- package/dist/charts/labels.d.ts +13 -3
- package/dist/charts/labels.d.ts.map +1 -1
- package/dist/charts/labels.js +131 -20
- package/dist/charts/legend.d.ts.map +1 -1
- package/dist/charts/legend.js +1 -1
- package/dist/charts/ref-label.d.ts +31 -8
- package/dist/charts/ref-label.d.ts.map +1 -1
- package/dist/charts/ref-label.js +40 -9
- package/dist/charts/sparkline.module.css +6 -0
- package/dist/charts/state.d.ts +3 -3
- package/dist/charts/state.d.ts.map +1 -1
- package/dist/charts/state.js +20 -2
- package/dist/cli/shot/capture.d.ts +6 -1
- package/dist/cli/shot/capture.d.ts.map +1 -1
- package/dist/cli/shot/capture.js +18 -5
- package/dist/common/empty-copy.d.ts +16 -0
- package/dist/common/empty-copy.d.ts.map +1 -0
- package/dist/common/empty-copy.js +9 -0
- package/dist/common/virtual-rows.d.ts +196 -0
- package/dist/common/virtual-rows.d.ts.map +1 -0
- package/dist/common/virtual-rows.js +290 -0
- package/dist/controls/controls.module.css +33 -1
- package/dist/controls/controls.module.css.d.ts +2 -0
- package/dist/controls/enum-filter.d.ts.map +1 -1
- package/dist/controls/enum-filter.js +8 -2
- package/dist/controls/filter-pill.d.ts +27 -3
- package/dist/controls/filter-pill.d.ts.map +1 -1
- package/dist/controls/filter-pill.js +15 -4
- package/dist/controls/form-layout.d.ts +9 -3
- package/dist/controls/form-layout.d.ts.map +1 -1
- package/dist/controls/form-layout.js +74 -12
- package/dist/controls/form-layout.module.css +112 -7
- package/dist/controls/form-layout.module.css.d.ts +1 -0
- package/dist/controls/multi-select-filter.d.ts +2 -2
- package/dist/controls/multi-select-filter.d.ts.map +1 -1
- package/dist/controls/multi-select-filter.js +12 -6
- package/dist/controls/range-filter.d.ts +1 -1
- package/dist/controls/range-filter.d.ts.map +1 -1
- package/dist/controls/range-filter.js +8 -2
- package/dist/dashboard/bar-list.d.ts +1 -1
- package/dist/dashboard/bar-list.d.ts.map +1 -1
- package/dist/dashboard/bar-list.js +6 -2
- package/dist/dashboard/bar-list.module.css +0 -2
- package/dist/dashboard/board-nav.d.ts +22 -0
- package/dist/dashboard/board-nav.d.ts.map +1 -0
- package/dist/dashboard/board-nav.js +49 -0
- package/dist/dashboard/board.d.ts +52 -0
- package/dist/dashboard/board.d.ts.map +1 -0
- package/dist/dashboard/board.js +228 -0
- package/dist/dashboard/board.module.css +160 -0
- package/dist/dashboard/board.module.css.d.ts +26 -0
- package/dist/dashboard/empty-state.d.ts +3 -3
- package/dist/dashboard/empty-state.d.ts.map +1 -1
- package/dist/dashboard/empty-state.js +13 -6
- package/dist/dashboard/event-list-model.d.ts +51 -0
- package/dist/dashboard/event-list-model.d.ts.map +1 -0
- package/dist/dashboard/event-list-model.js +72 -0
- package/dist/dashboard/event-list-rows.d.ts +23 -0
- package/dist/dashboard/event-list-rows.d.ts.map +1 -0
- package/dist/dashboard/event-list-rows.js +93 -0
- package/dist/dashboard/event-list-scroll.d.ts +27 -0
- package/dist/dashboard/event-list-scroll.d.ts.map +1 -0
- package/dist/dashboard/event-list-scroll.js +103 -0
- package/dist/dashboard/event-list-skeleton.d.ts +10 -0
- package/dist/dashboard/event-list-skeleton.d.ts.map +1 -0
- package/dist/dashboard/event-list-skeleton.js +36 -0
- package/dist/dashboard/event-list.d.ts +65 -0
- package/dist/dashboard/event-list.d.ts.map +1 -0
- package/dist/dashboard/event-list.js +178 -0
- package/dist/dashboard/event-list.module.css +283 -0
- package/dist/dashboard/event-list.module.css.d.ts +33 -0
- package/dist/dashboard/index.d.ts +2 -0
- package/dist/dashboard/index.d.ts.map +1 -1
- package/dist/dashboard/index.js +4 -0
- package/dist/dashboard/meter-parts.d.ts.map +1 -1
- package/dist/dashboard/meter-parts.js +5 -3
- package/dist/dashboard/meter.module.css +2 -1
- package/dist/dashboard/query-state.js +1 -1
- package/dist/dashboard/settings-section.d.ts +4 -1
- package/dist/dashboard/settings-section.d.ts.map +1 -1
- package/dist/dashboard/settings-section.js +1 -1
- package/dist/dashboard/settings-section.module.css +19 -4
- package/dist/dashboard/stat-card-parts.d.ts +5 -1
- package/dist/dashboard/stat-card-parts.d.ts.map +1 -1
- package/dist/dashboard/stat-card-parts.js +8 -3
- package/dist/dashboard/stat-card.d.ts.map +1 -1
- package/dist/dashboard/stat-card.js +26 -7
- package/dist/dashboard/stat-card.module.css +31 -7
- package/dist/dashboard/stat-card.module.css.d.ts +3 -0
- package/dist/dashboard/stat-strip.js +1 -1
- package/dist/dashboard/stat-strip.module.css +4 -1
- package/dist/dashboard/widget-header.d.ts.map +1 -1
- package/dist/dashboard/widget-header.js +15 -2
- package/dist/dashboard/widget-header.module.css +17 -1
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/shell/app-main.module.css +18 -0
- package/dist/styles.css +46 -8
- package/dist/surfaces.d.ts +2 -2
- package/dist/surfaces.d.ts.map +1 -1
- package/dist/surfaces.js +8 -2
- package/dist/table/cell-kinds.d.ts +44 -0
- package/dist/table/cell-kinds.d.ts.map +1 -0
- package/dist/table/cell-kinds.js +169 -0
- package/dist/table/cell-kinds.module.css +55 -0
- package/dist/table/cell-kinds.module.css.d.ts +15 -0
- package/dist/table/data-table-fold.d.ts +147 -0
- package/dist/table/data-table-fold.d.ts.map +1 -0
- package/dist/table/data-table-fold.js +288 -0
- package/dist/table/data-table-state.d.ts +10 -3
- package/dist/table/data-table-state.d.ts.map +1 -1
- package/dist/table/data-table-state.js +11 -6
- package/dist/table/data-table.d.ts +11 -26
- package/dist/table/data-table.d.ts.map +1 -1
- package/dist/table/data-table.js +354 -254
- package/dist/table/data-table.module.css +210 -3
- package/dist/table/data-table.module.css.d.ts +12 -0
- package/dist/table/table-features.d.ts +34 -4
- package/dist/table/table-features.d.ts.map +1 -1
- package/dist/table/table-features.js +10 -0
- package/dist/theme/card-inset.module.css +35 -0
- package/dist/theme/controls.module.css +32 -0
- package/dist/theme/ctl-theme.d.ts.map +1 -1
- package/dist/theme/ctl-theme.js +5 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +14 -10
- package/dist/tokens/core.d.ts +1 -0
- package/dist/tokens/core.d.ts.map +1 -1
- package/dist/tokens/core.js +1 -0
- package/dist/tokens/derive.js +1 -1
- package/dist/tokens/palette.d.ts +2 -1
- package/dist/tokens/palette.d.ts.map +1 -1
- package/llms.txt +34 -5
- package/package.json +1 -1
- package/src/agent/chat/thread-message.tsx +10 -403
- package/src/agent/chat/virtualize.ts +5 -5
- package/src/charts/ChartCard.tsx +79 -17
- package/src/charts/Lines.tsx +13 -4
- package/src/charts/Sparkline.tsx +131 -45
- package/src/charts/chart-box.module.css +69 -3
- package/src/charts/chart-box.module.css.d.ts +5 -0
- package/src/charts/chart-card.module.css +12 -4
- package/src/charts/chart-card.module.css.d.ts +1 -0
- package/src/charts/compile.ts +24 -20
- package/src/charts/labels.ts +175 -24
- package/src/charts/legend.tsx +3 -2
- package/src/charts/ref-label.ts +86 -17
- package/src/charts/sparkline.module.css +6 -0
- package/src/charts/state.tsx +36 -7
- package/src/cli/shot/capture.ts +29 -6
- package/src/common/empty-copy.ts +17 -0
- package/src/common/virtual-rows.tsx +682 -0
- package/src/controls/controls.module.css +33 -1
- package/src/controls/controls.module.css.d.ts +2 -0
- package/src/controls/enum-filter.tsx +8 -2
- package/src/controls/filter-pill.tsx +80 -27
- package/src/controls/form-layout.module.css +112 -7
- package/src/controls/form-layout.module.css.d.ts +1 -0
- package/src/controls/form-layout.tsx +115 -22
- package/src/controls/multi-select-filter.tsx +22 -11
- package/src/controls/range-filter.tsx +9 -3
- package/src/dashboard/bar-list.module.css +0 -2
- package/src/dashboard/bar-list.tsx +8 -5
- package/src/dashboard/board-nav.ts +67 -0
- package/src/dashboard/board.module.css +160 -0
- package/src/dashboard/board.module.css.d.ts +26 -0
- package/src/dashboard/board.tsx +394 -0
- package/src/dashboard/empty-state.tsx +16 -9
- package/src/dashboard/event-list-model.ts +113 -0
- package/src/dashboard/event-list-rows.tsx +120 -0
- package/src/dashboard/event-list-scroll.ts +145 -0
- package/src/dashboard/event-list-skeleton.tsx +58 -0
- package/src/dashboard/event-list.module.css +283 -0
- package/src/dashboard/event-list.module.css.d.ts +33 -0
- package/src/dashboard/event-list.tsx +309 -0
- package/src/dashboard/index.ts +2 -0
- package/src/dashboard/meter-parts.tsx +9 -2
- package/src/dashboard/meter.module.css +2 -1
- package/src/dashboard/query-state.tsx +1 -1
- package/src/dashboard/settings-section.module.css +19 -4
- package/src/dashboard/settings-section.tsx +7 -2
- package/src/dashboard/stat-card-parts.tsx +20 -3
- package/src/dashboard/stat-card.module.css +31 -7
- package/src/dashboard/stat-card.module.css.d.ts +3 -0
- package/src/dashboard/stat-card.tsx +25 -6
- package/src/dashboard/stat-strip.module.css +4 -1
- package/src/dashboard/stat-strip.tsx +1 -1
- package/src/dashboard/widget-header.module.css +17 -1
- package/src/dashboard/widget-header.tsx +29 -5
- package/src/guard/index.ts +2 -0
- package/src/index.ts +4 -0
- package/src/shell/app-main.module.css +18 -0
- package/src/styles.css +46 -8
- package/src/surfaces.ts +7 -1
- package/src/table/cell-kinds.module.css +55 -0
- package/src/table/cell-kinds.module.css.d.ts +15 -0
- package/src/table/cell-kinds.tsx +234 -0
- package/src/table/data-table-fold.tsx +514 -0
- package/src/table/data-table-state.ts +24 -13
- package/src/table/data-table.module.css +210 -3
- package/src/table/data-table.module.css.d.ts +12 -0
- package/src/table/data-table.tsx +406 -359
- package/src/table/table-features.ts +44 -4
- package/src/theme/__snapshots__/plain-theme.test.ts.snap +2 -66
- package/src/theme/card-inset.module.css +35 -0
- package/src/theme/controls.module.css +32 -0
- package/src/theme/ctl-theme.tsx +8 -0
- package/src/theme/index.ts +12 -8
- package/src/tokens/core.ts +1 -0
- package/src/tokens/derive.ts +1 -1
- package/src/tokens/palette.ts +4 -1
|
@@ -11,12 +11,13 @@ import {
|
|
|
11
11
|
UnstyledButton
|
|
12
12
|
} from "@mantine/core";
|
|
13
13
|
import { useDisclosure, useFocusWithin, useHover, useMergedRef } from "@mantine/hooks";
|
|
14
|
-
import { Fragment,
|
|
14
|
+
import { Fragment, memo, useLayoutEffect, useMemo, useRef } from "react";
|
|
15
15
|
import { isLiveStatus } from "../thread.js";
|
|
16
16
|
import { coalesceParts } from "../coalesce.js";
|
|
17
17
|
import { narrowAgentPart } from "../foreign.js";
|
|
18
18
|
import { PartList } from "../part-list.js";
|
|
19
19
|
import { cx } from "../../common/props.js";
|
|
20
|
+
import { VirtualRows } from "../../common/virtual-rows.js";
|
|
20
21
|
import { assertRequiredProps } from "../../common/validate.js";
|
|
21
22
|
import { Markdown } from "../../content/markdown.js";
|
|
22
23
|
import { CopyAction } from "../../content/copy-action.js";
|
|
@@ -243,162 +244,7 @@ const MessageBlock = memo(MessageBlockImpl, areMessageBlockPropsEqual);
|
|
|
243
244
|
MessageBlock.displayName = "MessageBlock";
|
|
244
245
|
const DEFAULT_VIRTUALIZE_OVERSCAN = 6;
|
|
245
246
|
const DEFAULT_VIRTUALIZE_ESTIMATE_SIZE = 160;
|
|
246
|
-
const DEFAULT_VIRTUALIZE_SCROLL_END_THRESHOLD = 64;
|
|
247
247
|
const DEFAULT_VIRTUALIZE_INITIAL_SCROLL = "end";
|
|
248
|
-
const MAX_INITIAL_SCROLL_ATTEMPTS = 5;
|
|
249
|
-
function NonVirtualizedRows({
|
|
250
|
-
rows,
|
|
251
|
-
height,
|
|
252
|
-
className,
|
|
253
|
-
style
|
|
254
|
-
}) {
|
|
255
|
-
return (
|
|
256
|
-
// theme-allow raw-scroll-container — degrade target owns its own scroll node, same as the real virtualizer below.
|
|
257
|
-
/* @__PURE__ */ jsx(Box, { className: cx(className), style: { height, overflow: "auto", ...style }, children: /* @__PURE__ */ jsx(Stack, { gap: "sm", children: rows.map((row) => /* @__PURE__ */ jsx(Fragment, { children: row.node }, row.key)) }) })
|
|
258
|
-
);
|
|
259
|
-
}
|
|
260
|
-
const nonVirtualizedRowsFallback = NonVirtualizedRows;
|
|
261
|
-
function resolveGuardedMeasurement(host, element, size) {
|
|
262
|
-
if (size > 0) return size;
|
|
263
|
-
const index = host.indexFromElement(element);
|
|
264
|
-
const key = host.options.getItemKey(index);
|
|
265
|
-
return host.itemSizeCache.get(key) ?? host.options.estimateSize(index);
|
|
266
|
-
}
|
|
267
|
-
function resolveInitialScrollAction(initialScroll, rowCount, containerHeight) {
|
|
268
|
-
if (initialScroll === "start") return "skip-done";
|
|
269
|
-
if (rowCount === 0) return "skip-done";
|
|
270
|
-
if (containerHeight <= 0) return "skip-retry";
|
|
271
|
-
return "scroll";
|
|
272
|
-
}
|
|
273
|
-
function applyInitialScroll(state, initialScroll, rowCount, getContainerHeight, scrollToEnd, isAtEnd) {
|
|
274
|
-
if (state.hasApplied) return;
|
|
275
|
-
if (state.attempts > 0) {
|
|
276
|
-
if (isAtEnd() || state.attempts >= MAX_INITIAL_SCROLL_ATTEMPTS) {
|
|
277
|
-
state.hasApplied = true;
|
|
278
|
-
return;
|
|
279
|
-
}
|
|
280
|
-
scrollToEnd();
|
|
281
|
-
state.attempts += 1;
|
|
282
|
-
return;
|
|
283
|
-
}
|
|
284
|
-
const action = resolveInitialScrollAction(initialScroll, rowCount, getContainerHeight());
|
|
285
|
-
if (action === "skip-retry") return;
|
|
286
|
-
if (action === "skip-done") {
|
|
287
|
-
state.hasApplied = true;
|
|
288
|
-
return;
|
|
289
|
-
}
|
|
290
|
-
scrollToEnd();
|
|
291
|
-
state.attempts += 1;
|
|
292
|
-
}
|
|
293
|
-
function isContainerAtEnd(container, threshold) {
|
|
294
|
-
if (container === null) return false;
|
|
295
|
-
const distanceFromEnd = container.scrollHeight - container.clientHeight - container.scrollTop;
|
|
296
|
-
return distanceFromEnd <= threshold;
|
|
297
|
-
}
|
|
298
|
-
const LazyVirtualizedRows = lazy(
|
|
299
|
-
() => import("@tanstack/react-virtual").then(({ useVirtualizer, measureElement: defaultMeasureElement }) => {
|
|
300
|
-
function VirtualizedRowsInner({
|
|
301
|
-
rows,
|
|
302
|
-
height,
|
|
303
|
-
overscan,
|
|
304
|
-
estimateSize,
|
|
305
|
-
initialScroll,
|
|
306
|
-
className,
|
|
307
|
-
style
|
|
308
|
-
}) {
|
|
309
|
-
const parentRef = useRef(null);
|
|
310
|
-
const initialScrollStateRef = useRef({
|
|
311
|
-
hasApplied: false,
|
|
312
|
-
attempts: 0
|
|
313
|
-
});
|
|
314
|
-
const virtualizer = useVirtualizer({
|
|
315
|
-
count: rows.length,
|
|
316
|
-
getScrollElement: () => parentRef.current,
|
|
317
|
-
estimateSize: () => estimateSize,
|
|
318
|
-
overscan,
|
|
319
|
-
getItemKey: (index) => rows[index]?.key ?? index,
|
|
320
|
-
anchorTo: "end",
|
|
321
|
-
followOnAppend: true,
|
|
322
|
-
scrollEndThreshold: DEFAULT_VIRTUALIZE_SCROLL_END_THRESHOLD,
|
|
323
|
-
useFlushSync: false,
|
|
324
|
-
// Guards against the hidden-ancestor cache-poisoning mechanism
|
|
325
|
-
// `resolveGuardedMeasurement`'s doc and `virtualize.ts`'s composition rules describe —
|
|
326
|
-
// NOT `enabled: false`, which virtual-core 3.17.1 wires to WIPE
|
|
327
|
-
// `itemSizeCache`/`measurementsCache` entirely (`getMeasurements`'s `!enabled` branch)
|
|
328
|
-
// rather than pause measurement, so toggling it off/on around a collapse would be
|
|
329
|
-
// strictly worse than the bug it was meant to fix.
|
|
330
|
-
measureElement: (element, entry, instance) => resolveGuardedMeasurement(
|
|
331
|
-
instance,
|
|
332
|
-
element,
|
|
333
|
-
defaultMeasureElement(element, entry, instance)
|
|
334
|
-
)
|
|
335
|
-
});
|
|
336
|
-
useLayoutEffect(() => {
|
|
337
|
-
applyInitialScroll(
|
|
338
|
-
initialScrollStateRef.current,
|
|
339
|
-
initialScroll,
|
|
340
|
-
rows.length,
|
|
341
|
-
() => parentRef.current?.offsetHeight ?? 0,
|
|
342
|
-
() => virtualizer.scrollToEnd({ behavior: "auto" }),
|
|
343
|
-
() => isContainerAtEnd(parentRef.current, DEFAULT_VIRTUALIZE_SCROLL_END_THRESHOLD)
|
|
344
|
-
);
|
|
345
|
-
});
|
|
346
|
-
return /* @__PURE__ */ jsx(
|
|
347
|
-
Box,
|
|
348
|
-
{
|
|
349
|
-
ref: parentRef,
|
|
350
|
-
className: cx(className),
|
|
351
|
-
style: { height, overflow: "auto", ...style },
|
|
352
|
-
children: /* @__PURE__ */ jsx(Box, { style: { height: virtualizer.getTotalSize(), position: "relative" }, children: virtualizer.getVirtualItems().map((virtualItem) => {
|
|
353
|
-
const row = rows[virtualItem.index];
|
|
354
|
-
if (row === void 0) return null;
|
|
355
|
-
return /* @__PURE__ */ jsx(
|
|
356
|
-
Box,
|
|
357
|
-
{
|
|
358
|
-
ref: virtualizer.measureElement,
|
|
359
|
-
"data-index": virtualItem.index,
|
|
360
|
-
style: {
|
|
361
|
-
position: "absolute",
|
|
362
|
-
top: 0,
|
|
363
|
-
left: 0,
|
|
364
|
-
width: "100%",
|
|
365
|
-
transform: `translateY(${virtualItem.start}px)`
|
|
366
|
-
},
|
|
367
|
-
children: row.node
|
|
368
|
-
},
|
|
369
|
-
row.key
|
|
370
|
-
);
|
|
371
|
-
}) })
|
|
372
|
-
}
|
|
373
|
-
);
|
|
374
|
-
}
|
|
375
|
-
return { default: VirtualizedRowsInner };
|
|
376
|
-
}).catch(() => ({ default: NonVirtualizedRows }))
|
|
377
|
-
);
|
|
378
|
-
Object.assign(LazyVirtualizedRows, { displayName: "LazyVirtualizedRows" });
|
|
379
|
-
function VirtualizeSuspenseFallback({
|
|
380
|
-
height,
|
|
381
|
-
className,
|
|
382
|
-
style
|
|
383
|
-
}) {
|
|
384
|
-
return /* @__PURE__ */ jsx(Box, { className: cx(className), style: { height, overflow: "auto", ...style } });
|
|
385
|
-
}
|
|
386
|
-
function VirtualizedTranscript(props) {
|
|
387
|
-
return /* @__PURE__ */ jsx(
|
|
388
|
-
Suspense,
|
|
389
|
-
{
|
|
390
|
-
fallback: /* @__PURE__ */ jsx(
|
|
391
|
-
VirtualizeSuspenseFallback,
|
|
392
|
-
{
|
|
393
|
-
height: props.height,
|
|
394
|
-
...props.className !== void 0 && { className: props.className },
|
|
395
|
-
...props.style !== void 0 && { style: props.style }
|
|
396
|
-
}
|
|
397
|
-
),
|
|
398
|
-
children: /* @__PURE__ */ jsx(LazyVirtualizedRows, { ...props })
|
|
399
|
-
}
|
|
400
|
-
);
|
|
401
|
-
}
|
|
402
248
|
const EMPTY_RENDERERS = {};
|
|
403
249
|
function useStableCallback(callback) {
|
|
404
250
|
const callbackRef = useRef(callback);
|
|
@@ -496,10 +342,14 @@ function ThreadTranscript(props) {
|
|
|
496
342
|
);
|
|
497
343
|
if (virtualized !== null) {
|
|
498
344
|
return /* @__PURE__ */ jsx(
|
|
499
|
-
|
|
345
|
+
VirtualRows,
|
|
500
346
|
{
|
|
501
347
|
rows,
|
|
502
348
|
height: virtualized.height,
|
|
349
|
+
gap: 0,
|
|
350
|
+
fallbackGap: "var(--mantine-spacing-sm)",
|
|
351
|
+
anchorTo: "end",
|
|
352
|
+
followOnAppend: true,
|
|
503
353
|
overscan: virtualized.options.overscan ?? DEFAULT_VIRTUALIZE_OVERSCAN,
|
|
504
354
|
estimateSize: virtualized.options.estimateSize ?? DEFAULT_VIRTUALIZE_ESTIMATE_SIZE,
|
|
505
355
|
initialScroll: virtualized.options.initialScroll ?? DEFAULT_VIRTUALIZE_INITIAL_SCROLL,
|
|
@@ -511,12 +361,7 @@ function ThreadTranscript(props) {
|
|
|
511
361
|
return /* @__PURE__ */ jsx(Stack, { gap: "sm", className: cx(className), ...style !== void 0 && { style }, children: rows.map((row) => /* @__PURE__ */ jsx(Fragment, { children: row.node }, row.key)) });
|
|
512
362
|
}
|
|
513
363
|
export {
|
|
514
|
-
MAX_INITIAL_SCROLL_ATTEMPTS,
|
|
515
364
|
ThreadTranscript,
|
|
516
|
-
applyInitialScroll,
|
|
517
365
|
messageBlockRenderCounter,
|
|
518
|
-
nonVirtualizedRowsFallback,
|
|
519
|
-
resolveGuardedMeasurement,
|
|
520
|
-
resolveInitialScrollAction,
|
|
521
366
|
threadPartRenderers
|
|
522
367
|
};
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
* `ThreadFeedRow`) — collapsing does not corrupt its measurement cache, and re-expanding restores
|
|
25
25
|
* the same scroll position (same top-visible row) it had before the collapse. This is NOT free of
|
|
26
26
|
* virtual-core: hiding an ancestor makes every mounted row's ResizeObserver box report `0` (a
|
|
27
|
-
* `display: none` ancestor un-lays-out its descendants), and virtual-core 3.
|
|
27
|
+
* `display: none` ancestor un-lays-out its descendants), and virtual-core 3.18.0's default
|
|
28
28
|
* `measureElement`/`resizeItem` write that `0` into `itemSizeCache` with no floor — unguarded, a
|
|
29
29
|
* few collapse/expand cycles permanently shrink `getTotalSize()` and silently scroll the visible
|
|
30
30
|
* window to a DIFFERENT part of the transcript (`scrollTop` stays put; the content under it moves).
|
|
31
|
-
* `
|
|
31
|
+
* `common/virtual-rows.tsx` closes this with a `measureElement` override (`resolveGuardedMeasurement`)
|
|
32
32
|
* that treats a `0` reading as unreliable and keeps the last-known size instead of committing it —
|
|
33
33
|
* see that function's doc for the full mechanism, including why `useVirtualizer`'s `enabled` option
|
|
34
34
|
* is NOT the fix (it wipes the measurement cache outright, worse than the bug). A consumer combining a
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
* `useVirtualizer` call has no stale cache to poison).
|
|
38
38
|
*
|
|
39
39
|
* A fourth composition rule: a virtualized transcript SCROLLS ITSELF on mount. `initialScroll`
|
|
40
|
-
* defaults to `'end'` — `anchorTo: 'end'` and `followOnAppend` (both wired in `
|
|
40
|
+
* defaults to `'end'` — `anchorTo: 'end'` and `followOnAppend` (both wired in `common/virtual-rows.tsx`)
|
|
41
41
|
* only keep an ALREADY-at-the-end transcript pinned as content changes; neither performs the initial
|
|
42
42
|
* jump, so left alone a freshly mounted virtualized transcript renders at message #0, not the
|
|
43
43
|
* newest. The fix fires exactly once, on first mount, via `scrollToEnd()` — never again, so a user
|
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
* if the transcript's own scroll container measures 0px on mount (e.g. mounted behind a hidden
|
|
51
51
|
* ancestor) — it then lands on the first commit where the container is genuinely measurable, which
|
|
52
52
|
* is what makes "opens at the newest message" hold for a transcript whose lazy virtualizer settled
|
|
53
|
-
* while its `ThreadFeedRow` was collapsed. See `
|
|
53
|
+
* while its `ThreadFeedRow` was collapsed. See `common/virtual-rows.tsx`'s `applyInitialScroll` for the
|
|
54
54
|
* guard, and `VirtualizedRowsInner` for why its effect is deliberately dependency-free.
|
|
55
55
|
*
|
|
56
56
|
* Firing `scrollToEnd()` once is not sufficient on its own to land there, because virtual-core
|
|
57
|
-
* 3.
|
|
57
|
+
* 3.18.0's own `_willUpdate` writes to the SAME scroll container on the very next commit it runs
|
|
58
58
|
* on, from state that lags behind the DOM: `_scrollToOffset` only ever records the write's
|
|
59
59
|
* intent (`_intendedScrollOffset`) — `this.scrollOffset` itself updates ASYNCHRONOUSLY, from the
|
|
60
60
|
* native `scroll` event, not from the call that requested it. So a commit that runs `_willUpdate`
|
|
@@ -50,8 +50,11 @@ type ChartCardBaseProps = BasaltProps & SlotStylesProps<ChartCardSlot> & {
|
|
|
50
50
|
* fallback>` should pass a numeric height instead. */
|
|
51
51
|
placeholderHeight?: number | ResponsiveChartHeight | 'content' | undefined;
|
|
52
52
|
/** The pending plot's ghost: `'bars'` (default), `'line'` for a line or area chart, or the bar
|
|
53
|
-
* count when the loaded chart's data length is known
|
|
54
|
-
|
|
53
|
+
* count when the loaded chart's data length is known, `'band'` for a `BandStrip`. Omitted, a
|
|
54
|
+
* `Lines` or `StackedArea` body (bare, or inside plain elements) loads as a line, a `BandStrip`
|
|
55
|
+
* as one band row at its own `height`; a body wrapped in your own component hides
|
|
56
|
+
* its kind from the card, so pass `ghost="line"` there. */
|
|
57
|
+
ghost?: 'bars' | 'line' | 'band' | number | undefined;
|
|
55
58
|
/** Placeholder data is showing: the facts row dims with the plot (a strip cell's `stale`). */
|
|
56
59
|
stale?: boolean | undefined;
|
|
57
60
|
/** What an errored `state` names: "Could not load {stateNoun}". Default: no noun. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartCard.d.ts","sourceRoot":"","sources":["../../src/charts/ChartCard.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAiB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGnE,OAAO,KAAK,EA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E,SAAS,CAAA;CAAE,CACxB,CAAA;AAuHH,wBAAgB,SAAS,CAAC,EACxB,OAAO,EACP,KAAK,EACL,iBAAiB,EACjB,WAAW,EACX,KAAK,EACL,SAAS,EACT,KAAK,EACL,OAAO,EACP,QAAQ,EACR,SAAS,EACT,UAAU,EACV,KAAK,EACL,QAAQ,EACR,KAAK,EACL,GAAG,MAAM,EACV,EAAE,cAAc,GAAG,YAAY,CAgE/B"}
|
package/dist/charts/ChartCard.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useRef, useState } from "react";
|
|
2
|
+
import { Children, isValidElement, useRef, useState } from "react";
|
|
3
3
|
import { useIsomorphicLayoutEffect } from "../common/isomorphic-layout-effect.js";
|
|
4
4
|
import { cx } from "../common/props.js";
|
|
5
5
|
import { WidgetHeader } from "../dashboard/widget-header.js";
|
|
6
6
|
import { VX } from "../tokens/index.js";
|
|
7
7
|
import { ChartCardContext } from "./card-context.js";
|
|
8
|
+
import { BandStrip } from "./BandStrip.js";
|
|
9
|
+
import { Lines } from "./Lines.js";
|
|
10
|
+
import { StackedArea } from "./StackedArea.js";
|
|
8
11
|
import classes from "./chart-card.module.css";
|
|
9
12
|
import { ChartPlaceholder, resolveChartState } from "./state.js";
|
|
10
13
|
const cardStyle = {
|
|
@@ -106,6 +109,30 @@ function FactsSkeleton({ basis }) {
|
|
|
106
109
|
basis && /* @__PURE__ */ jsx("p", { className: cx(classes.factsBasis, classes.skeletonBasis) })
|
|
107
110
|
] });
|
|
108
111
|
}
|
|
112
|
+
function isChartHeight(value) {
|
|
113
|
+
return typeof value === "number" || typeof value === "object" && value !== null && typeof value.base === "number";
|
|
114
|
+
}
|
|
115
|
+
function bodyKindOf(node) {
|
|
116
|
+
for (const child of Children.toArray(node)) {
|
|
117
|
+
if (!isValidElement(child)) continue;
|
|
118
|
+
if (child.type === Lines || child.type === StackedArea) return { ghost: "line" };
|
|
119
|
+
if (child.type === BandStrip) {
|
|
120
|
+
const { height, states, legend } = child.props;
|
|
121
|
+
return {
|
|
122
|
+
ghost: "band",
|
|
123
|
+
...isChartHeight(height) && { height },
|
|
124
|
+
// The loaded strip's legend row sits under the box: the ghost keeps its room.
|
|
125
|
+
...legend !== false && (states?.length ?? 0) > 1 && { legend: true }
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
const inner = bodyKindOf(child.props.children);
|
|
129
|
+
if (inner !== void 0) return inner;
|
|
130
|
+
}
|
|
131
|
+
return void 0;
|
|
132
|
+
}
|
|
133
|
+
function reserveLegend(reserve, placeholder) {
|
|
134
|
+
return reserve ? /* @__PURE__ */ jsx("div", { className: classes.legendReserve, "data-basalt-legend-reserve": "", children: placeholder }) : placeholder;
|
|
135
|
+
}
|
|
109
136
|
function ChartCard({
|
|
110
137
|
actions,
|
|
111
138
|
state,
|
|
@@ -125,6 +152,9 @@ function ChartCard({
|
|
|
125
152
|
}) {
|
|
126
153
|
const { ref, short } = useShortCard();
|
|
127
154
|
const resolved = resolveChartState(state);
|
|
155
|
+
const kind = resolved === "pending" ? bodyKindOf(children) : void 0;
|
|
156
|
+
const plotGhost = ghost ?? kind?.ghost;
|
|
157
|
+
const pendingHeight = placeholderHeight ?? kind?.height;
|
|
128
158
|
const showFacts = facts !== void 0 && resolved === null;
|
|
129
159
|
const skeletonFacts = facts !== void 0 && resolved === "pending";
|
|
130
160
|
const hasHeader = actions !== void 0 || showFacts || skeletonFacts || HEADER_TRIGGERS.some((k) => header[k] !== void 0);
|
|
@@ -140,7 +170,7 @@ function ChartCard({
|
|
|
140
170
|
...resolved === "pending" && { "aria-busy": "true" },
|
|
141
171
|
...short && { "data-basalt-card-short": "" },
|
|
142
172
|
children: [
|
|
143
|
-
hasHeader && /* @__PURE__ */ jsxs("div", { className: cx(classes.header, classNames?.header), children: [
|
|
173
|
+
hasHeader && /* @__PURE__ */ jsxs("div", { "data-basalt-chart-header": "", className: cx(classes.header, classNames?.header), children: [
|
|
144
174
|
/* @__PURE__ */ jsx(
|
|
145
175
|
WidgetHeader,
|
|
146
176
|
{
|
|
@@ -160,17 +190,20 @@ function ChartCard({
|
|
|
160
190
|
{
|
|
161
191
|
...classNames?.body !== void 0 && { className: classNames.body },
|
|
162
192
|
style: bodyClipStyle,
|
|
163
|
-
children: resolved === null || resolved === "pending" && placeholderHeight === "content" ? children :
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
193
|
+
children: resolved === null || resolved === "pending" && placeholderHeight === "content" ? children : reserveLegend(
|
|
194
|
+
kind?.legend === true,
|
|
195
|
+
/* @__PURE__ */ jsx(
|
|
196
|
+
ChartPlaceholder,
|
|
197
|
+
{
|
|
198
|
+
state,
|
|
199
|
+
...pendingHeight !== void 0 && { height: pendingHeight },
|
|
200
|
+
...stateNoun !== void 0 && { noun: stateNoun },
|
|
201
|
+
...plotGhost !== void 0 && { ghost: plotGhost },
|
|
202
|
+
...onRetry !== void 0 && { onRetry },
|
|
203
|
+
...retrying !== void 0 && { retrying },
|
|
204
|
+
action: stateAction
|
|
205
|
+
}
|
|
206
|
+
)
|
|
174
207
|
)
|
|
175
208
|
}
|
|
176
209
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Lines.d.ts","sourceRoot":"","sources":["../../src/charts/Lines.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAQzC,OAAO,KAAK,EACV,mBAAmB,EAGnB,MAAM,EAGN,SAAS,EACV,MAAM,SAAS,CAAA;AAEhB,MAAM,MAAM,UAAU,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI,IAAI,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG;IAChG;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,KAAK,GAAG,SAAS,SAAS,EAAE,CAAA;IAChE;sCACkC;IAClC,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,CAAA;CACrD,CAAA;AAoBD,wBAAgB,KAAK,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"Lines.d.ts","sourceRoot":"","sources":["../../src/charts/Lines.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAQzC,OAAO,KAAK,EACV,mBAAmB,EAGnB,MAAM,EAGN,SAAS,EACV,MAAM,SAAS,CAAA;AAEhB,MAAM,MAAM,UAAU,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI,IAAI,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG;IAChG;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,KAAK,GAAG,SAAS,SAAS,EAAE,CAAA;IAChE;sCACkC;IAClC,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,CAAA;CACrD,CAAA;AAoBD,wBAAgB,KAAK,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,YAAY,CA6FzF"}
|
package/dist/charts/Lines.js
CHANGED
|
@@ -6,7 +6,7 @@ import { useCallback } from "react";
|
|
|
6
6
|
import { CartesianRung } from "./CartesianChart.js";
|
|
7
7
|
import { areaGradientId } from "./compile.js";
|
|
8
8
|
import { chartCurve } from "./curves.js";
|
|
9
|
-
import { endLabelMarks, endLabelPlan } from "./labels.js";
|
|
9
|
+
import { claimLabelBoxes, endLabelMarks, endLabelPlan } from "./labels.js";
|
|
10
10
|
import { drawnRows, lineMark, loneDots, markersOf, yScaleOf } from "./marks.js";
|
|
11
11
|
import { rowX } from "./types.js";
|
|
12
12
|
const hasValue = (r) => r.y !== null;
|
|
@@ -20,7 +20,7 @@ function lastIsPlaceable(props, s) {
|
|
|
20
20
|
}
|
|
21
21
|
const AUTO_END_LABELS = 3;
|
|
22
22
|
function Lines(props) {
|
|
23
|
-
const { thresholds, naming = "auto", ...rest } = props;
|
|
23
|
+
const { thresholds, naming = "auto", refLines, ...rest } = props;
|
|
24
24
|
const { series } = props;
|
|
25
25
|
const labelled = series.filter((s) => s.role !== "reference");
|
|
26
26
|
const namedByLabels = props.y2 === void 0 && series.every((s) => s.legend === false || s.role !== "reference") && !(props.refLines ?? []).some((r) => r.legend !== void 0);
|
|
@@ -79,15 +79,22 @@ function Lines(props) {
|
|
|
79
79
|
out.push(...markersOf(s, plot.rows(s.key), yScale));
|
|
80
80
|
}
|
|
81
81
|
const labelled2 = plotted.filter((s) => s.role !== "reference");
|
|
82
|
-
|
|
82
|
+
const rules = (refLines ?? []).flatMap((r) => r.axis === "right" ? [] : [r.value]);
|
|
83
|
+
const plan = endLabelPlan(plot, labelled2, effective, rules);
|
|
84
|
+
claimLabelBoxes(
|
|
85
|
+
plot,
|
|
86
|
+
plan.map((p) => p.box)
|
|
87
|
+
);
|
|
88
|
+
out.push(...endLabelMarks(plan));
|
|
83
89
|
return out;
|
|
84
90
|
},
|
|
85
|
-
[series, thresholds, effective]
|
|
91
|
+
[series, thresholds, effective, refLines]
|
|
86
92
|
);
|
|
87
93
|
return /* @__PURE__ */ jsx(
|
|
88
94
|
CartesianRung,
|
|
89
95
|
{
|
|
90
96
|
...rest,
|
|
97
|
+
...refLines !== void 0 && { refLines },
|
|
91
98
|
marks,
|
|
92
99
|
...labelsOnly && { legend: false },
|
|
93
100
|
...hideAtWide && { hideLegendAtWide: true }
|
|
@@ -32,9 +32,16 @@ export type SparklineProps = BasaltProps & {
|
|
|
32
32
|
/** A quiet dashed hairline at a value, or at the mean of the plotted values (`'mean'`). The y
|
|
33
33
|
* domain widens to include it. Not a legend item, never a status colour. */
|
|
34
34
|
reference?: number | 'mean' | undefined;
|
|
35
|
-
/** A short caption for the `reference` line (`PR`, `30 d mean`), drawn at the plot
|
|
36
|
-
* above the
|
|
35
|
+
/** A short caption for the `reference` line (`PR`, `30 d mean`), drawn at the plot end the line
|
|
36
|
+
* is not near, just above the reference (below when there is no room above). */
|
|
37
37
|
referenceLabel?: string | undefined;
|
|
38
|
+
/** A productive range (`{ from: 0.6, to: 1 }`) drawn as a quiet band behind the line. The y
|
|
39
|
+
* domain widens to include it. Not a series: no legend item, no tooltip row. A non-finite bound or
|
|
40
|
+
* an empty range (`from === to`) draws nothing and leaves the domain alone. */
|
|
41
|
+
band?: {
|
|
42
|
+
from: number;
|
|
43
|
+
to: number;
|
|
44
|
+
} | undefined;
|
|
38
45
|
/** Formats the readout's value. Default: the compact number format. */
|
|
39
46
|
format?: ((value: number) => string) | undefined;
|
|
40
47
|
/** The readout's x label per point, index-aligned with `data`: pass the point's day ("12 Oct"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sparkline.d.ts","sourceRoot":"","sources":["../../src/charts/Sparkline.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Sparkline.d.ts","sourceRoot":"","sources":["../../src/charts/Sparkline.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAA0D,YAAY,EAAE,MAAM,OAAO,CAAA;AAEjG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAclD,OAAO,KAAK,EAAc,UAAU,EAAE,MAAM,SAAS,CAAA;AAErD,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG;IACzC,gFAAgF;IAChF,SAAS,EAAE,MA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