@overdoser/react-toolkit 0.20.0 → 0.21.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/AGENTS.md +1 -1
- package/CHANGELOG.md +14 -0
- package/components/Accordion/Accordion.js +160 -177
- package/components/Accordion/Accordion.module.js +20 -0
- package/components/ActionButton/ActionButton.js +155 -209
- package/components/ActionButton/ActionButton.module.js +25 -0
- package/components/ActionButton/CopyButton.js +52 -64
- package/components/Alert/Alert.js +92 -95
- package/components/Alert/Alert.module.js +18 -0
- package/components/Avatar/Avatar.js +44 -55
- package/components/Avatar/Avatar.module.js +23 -0
- package/components/Badge/Badge.js +16 -38
- package/components/Badge/Badge.module.js +17 -0
- package/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/components/Breadcrumbs/Breadcrumbs.js +52 -48
- package/components/Breadcrumbs/Breadcrumbs.module.js +10 -0
- package/components/Button/Button.js +35 -57
- package/components/Button/Button.module.js +25 -0
- package/components/Card/Card.js +94 -131
- package/components/Card/Card.module.js +35 -0
- package/components/Chart/AreaChart.d.ts +1 -1
- package/components/Chart/AreaChart.js +248 -249
- package/components/Chart/Axis.d.ts +2 -2
- package/components/Chart/Axis.js +34 -43
- package/components/Chart/BarChart.d.ts +1 -1
- package/components/Chart/BarChart.js +307 -348
- package/components/Chart/Chart.module.js +32 -0
- package/components/Chart/ChartContainer.js +33 -41
- package/components/Chart/ChartLegend.d.ts +1 -1
- package/components/Chart/ChartLegend.js +31 -30
- package/components/Chart/ChartTooltip.d.ts +1 -1
- package/components/Chart/ChartTooltip.js +46 -41
- package/components/Chart/LineChart.d.ts +1 -1
- package/components/Chart/LineChart.js +220 -232
- package/components/Chart/PieChart.d.ts +1 -1
- package/components/Chart/PieChart.js +224 -240
- package/components/Chart/RadarChart.d.ts +1 -1
- package/components/Chart/RadarChart.js +166 -215
- package/components/Chart/Sparkline.js +73 -68
- package/components/Chart/TradingChart.d.ts +1 -1
- package/components/Chart/TradingChart.js +804 -701
- package/components/Chart/scales.js +28 -35
- package/components/Chart/trading/indicators.js +61 -62
- package/components/Chart/trading/period.js +46 -68
- package/components/Chart/useChartDimensions.js +30 -22
- package/components/Chip/Chip.js +98 -141
- package/components/Chip/Chip.module.js +32 -0
- package/components/CodeBlock/CodeBlock.js +111 -119
- package/components/CodeBlock/CodeBlock.module.js +23 -0
- package/components/CommandPalette/CommandPalette.js +387 -392
- package/components/CommandPalette/CommandPalette.module.js +28 -0
- package/components/ConfirmDialog/ConfirmDialog.d.ts +1 -1
- package/components/ConfirmDialog/ConfirmDialog.js +184 -199
- package/components/ConfirmDialog/ConfirmDialog.module.js +12 -0
- package/components/Divider/Divider.js +25 -36
- package/components/Divider/Divider.module.js +17 -0
- package/components/Draggable/Draggable.d.ts +1 -1
- package/components/Draggable/Draggable.js +157 -164
- package/components/Draggable/Draggable.module.js +10 -0
- package/components/Drawer/Drawer.js +104 -126
- package/components/Drawer/Drawer.module.js +66 -0
- package/components/Dropdown/Dropdown.js +175 -234
- package/components/Dropdown/Dropdown.module.js +29 -0
- package/components/Dropdown/DropdownItem.js +55 -58
- package/components/Dropdown/DropdownLabel.js +14 -11
- package/components/Dropdown/DropdownSeparator.js +12 -10
- package/components/Dropdown/dropdownContext.js +4 -5
- package/components/Dropdown/useContextMenu.js +27 -17
- package/components/Dropzone/Dropzone.js +99 -105
- package/components/Dropzone/Dropzone.module.js +12 -0
- package/components/EmptyState/EmptyState.js +58 -55
- package/components/EmptyState/EmptyState.module.js +14 -0
- package/components/Form/Form.d.ts +1 -1
- package/components/Form/Form.js +32 -35
- package/components/Form/Form.module.js +16 -0
- package/components/Form/FormField.d.ts +1 -1
- package/components/Form/FormField.js +71 -75
- package/components/Form/FormRow.d.ts +1 -1
- package/components/Form/FormRow.js +11 -8
- package/components/Form/formFieldDefaults.js +4 -5
- package/components/ImageViewer/ImageViewer.js +312 -201
- package/components/ImageViewer/ImageViewer.module.js +26 -0
- package/components/ImageViewer/useZoomPan.js +206 -137
- package/components/Kbd/Kbd.js +25 -22
- package/components/Kbd/Kbd.module.js +10 -0
- package/components/KeyValueList/KeyValueList.js +119 -123
- package/components/KeyValueList/KeyValueList.module.js +23 -0
- package/components/Link/Link.js +45 -59
- package/components/Link/Link.module.js +10 -0
- package/components/List/List.js +22 -46
- package/components/List/List.module.js +12 -0
- package/components/Loader/Loader.js +152 -182
- package/components/Loader/Loader.module.js +40 -0
- package/components/Modal/Modal.js +93 -105
- package/components/Modal/Modal.module.js +18 -0
- package/components/PageHeader/PageHeader.js +78 -72
- package/components/PageHeader/PageHeader.module.js +23 -0
- package/components/Pagination/Pagination.js +63 -84
- package/components/Pagination/Pagination.module.js +13 -0
- package/components/Pagination/paginationRange.js +15 -22
- package/components/Popover/Popover.js +110 -134
- package/components/Popover/Popover.module.js +12 -0
- package/components/ProgressBar/ProgressBar.d.ts +15 -1
- package/components/ProgressBar/ProgressBar.js +57 -90
- package/components/ProgressBar/ProgressBar.module.js +29 -0
- package/components/RelativeTime/RelativeTime.js +36 -43
- package/components/RelativeTime/RelativeTime.module.js +3 -0
- package/components/SegmentedControl/SegmentedControl.js +94 -130
- package/components/SegmentedControl/SegmentedControl.module.js +21 -0
- package/components/Skeleton/Skeleton.js +36 -50
- package/components/Skeleton/Skeleton.module.js +15 -0
- package/components/Spinner/Spinner.js +25 -25
- package/components/Spinner/Spinner.module.js +12 -0
- package/components/SplitButton/SplitButton.js +149 -196
- package/components/SplitButton/SplitButton.module.js +31 -0
- package/components/SplitPane/SplitPane.js +134 -170
- package/components/SplitPane/SplitPane.module.js +14 -0
- package/components/StatCard/StatCard.js +132 -125
- package/components/StatCard/StatCard.module.js +42 -0
- package/components/StatusDot/StatusDot.js +28 -39
- package/components/StatusDot/StatusDot.module.js +18 -0
- package/components/Table/Table.d.ts +1 -1
- package/components/Table/Table.js +381 -451
- package/components/Table/Table.module.js +42 -0
- package/components/Table/useTableSort.js +51 -42
- package/components/Tabs/Tabs.js +109 -161
- package/components/Tabs/Tabs.module.js +28 -0
- package/components/ThemeToggle/ThemeToggle.js +122 -98
- package/components/ThemeToggle/ThemeToggle.module.js +13 -0
- package/components/Timeline/GanttTimeline.js +357 -318
- package/components/Timeline/GanttTimeline.module.js +29 -0
- package/components/Timeline/HistoryTimeline.js +486 -450
- package/components/Timeline/HistoryTimeline.module.js +31 -0
- package/components/Timeline/Timeline.module.js +76 -0
- package/components/Timeline/TimelineShared.d.ts +7 -7
- package/components/Timeline/TimelineShared.js +288 -279
- package/components/Timeline/TraceEventDetails.d.ts +3 -3
- package/components/Timeline/TraceEventDetails.js +245 -178
- package/components/Timeline/TraceTimeline.js +823 -783
- package/components/Timeline/TraceTimeline.module.js +98 -0
- package/components/Timeline/historyLayout.js +336 -263
- package/components/Timeline/timelineCore.js +208 -183
- package/components/Timeline/traceEvent.js +59 -61
- package/components/Timeline/traceLayout.js +101 -90
- package/components/Timeline/useTimeline.js +76 -79
- package/components/Timer/Timer.js +190 -156
- package/components/Timer/Timer.module.js +29 -0
- package/components/Toast/Toast.d.ts +1 -1
- package/components/Toast/Toast.js +128 -128
- package/components/Toast/Toast.module.js +37 -0
- package/components/Toast/toastStore.js +58 -62
- package/components/ToggleIconButton/ToggleIconButton.js +35 -57
- package/components/ToggleIconButton/ToggleIconButton.module.js +15 -0
- package/components/Tooltip/Tooltip.d.ts +1 -1
- package/components/Tooltip/Tooltip.js +76 -85
- package/components/Tooltip/Tooltip.module.js +17 -0
- package/components/Typography/Typography.js +11 -36
- package/components/Typography/Typography.module.js +30 -0
- package/components/inputs/Checkbox/Checkbox.js +27 -51
- package/components/inputs/Checkbox/Checkbox.module.js +10 -0
- package/components/inputs/Checkbox/CheckboxGroup.js +53 -111
- package/components/inputs/Checkbox/CheckboxGroup.module.js +17 -0
- package/components/inputs/DatePicker/CalendarPanel.d.ts +1 -1
- package/components/inputs/DatePicker/CalendarPanel.js +263 -286
- package/components/inputs/DatePicker/CalendarPanel.module.js +23 -0
- package/components/inputs/DatePicker/DatePicker.js +115 -142
- package/components/inputs/DatePicker/DatePicker.module.js +14 -0
- package/components/inputs/DatePicker/dateUtils.js +32 -41
- package/components/inputs/DateTimePicker/DateTimePicker.js +226 -232
- package/components/inputs/DateTimePicker/DateTimePicker.module.js +20 -0
- package/components/inputs/DateTimePicker/DateTimeSegments.js +273 -252
- package/components/inputs/DateTimePicker/TimeField.d.ts +1 -1
- package/components/inputs/DateTimePicker/TimeField.js +131 -132
- package/components/inputs/DateTimePicker/timeZoneUtils.js +95 -92
- package/components/inputs/Input/Input.js +98 -109
- package/components/inputs/Input/Input.module.js +15 -0
- package/components/inputs/NumberInput/NumberInput.js +112 -132
- package/components/inputs/NumberInput/NumberInput.module.js +14 -0
- package/components/inputs/Radio/Radio.js +50 -73
- package/components/inputs/Radio/Radio.module.js +9 -0
- package/components/inputs/SearchInput/SearchInput.js +98 -115
- package/components/inputs/SearchInput/SearchInput.module.js +8 -0
- package/components/inputs/Select/Select.js +555 -682
- package/components/inputs/Select/Select.module.js +38 -0
- package/components/inputs/Slider/Slider.js +97 -128
- package/components/inputs/Slider/Slider.module.js +9 -0
- package/components/inputs/Switch/Switch.js +11 -8
- package/components/inputs/Textarea/Textarea.js +42 -58
- package/components/inputs/Textarea/Textarea.module.js +14 -0
- package/hooks/useClickOutside.js +17 -14
- package/hooks/useDebouncedValue.js +13 -14
- package/hooks/useElementSize.js +27 -22
- package/hooks/useEscapeLayer.js +28 -29
- package/hooks/useFocusTrap.js +27 -38
- package/hooks/useKeyboard.js +76 -64
- package/hooks/useMediaQuery.js +10 -15
- package/hooks/useNow.js +28 -33
- package/hooks/usePersistedState.js +98 -94
- package/hooks/usePortalPosition.js +25 -19
- package/hooks/useResizable.js +106 -104
- package/hooks/useTheme.js +28 -23
- package/index.css +2 -1
- package/index.js +97 -215
- package/index.layered.css +2 -3
- package/llms.txt +3 -0
- package/manifest.json +8 -0
- package/package.json +1 -1
- package/utils/formatBytes.js +29 -13
- package/utils/themeScript.js +6 -8
- package/utils/timeAgo.js +59 -32
- package/components/Accordion/Accordion.module.scss.js +0 -36
- package/components/ActionButton/ActionButton.module.scss.js +0 -47
- package/components/Alert/Alert.module.scss.js +0 -33
- package/components/Avatar/Avatar.module.scss.js +0 -43
- package/components/Badge/Badge.module.scss.js +0 -31
- package/components/Breadcrumbs/Breadcrumbs.module.scss.js +0 -17
- package/components/Button/Button.module.scss.js +0 -47
- package/components/Card/Card.module.scss.js +0 -60
- package/components/Chart/Chart.module.scss.js +0 -61
- package/components/Chip/Chip.module.scss.js +0 -59
- package/components/CodeBlock/CodeBlock.module.scss.js +0 -43
- package/components/CommandPalette/CommandPalette.module.scss.js +0 -49
- package/components/ConfirmDialog/ConfirmDialog.module.scss.js +0 -21
- package/components/Divider/Divider.module.scss.js +0 -31
- package/components/Draggable/Draggable.module.scss.js +0 -17
- package/components/Drawer/Drawer.module.scss.js +0 -119
- package/components/Dropdown/Dropdown.module.scss.js +0 -53
- package/components/Dropzone/Dropzone.module.scss.js +0 -21
- package/components/EmptyState/EmptyState.module.scss.js +0 -25
- package/components/Form/Form.module.scss.js +0 -29
- package/components/ImageViewer/ImageViewer.module.scss.js +0 -47
- package/components/Kbd/Kbd.module.scss.js +0 -17
- package/components/KeyValueList/KeyValueList.module.scss.js +0 -43
- package/components/Link/Link.module.scss.js +0 -16
- package/components/List/List.module.scss.js +0 -21
- package/components/Loader/Loader.module.scss.js +0 -70
- package/components/Modal/Modal.module.scss.js +0 -33
- package/components/PageHeader/PageHeader.module.scss.js +0 -43
- package/components/Pagination/Pagination.module.scss.js +0 -23
- package/components/Popover/Popover.module.scss.js +0 -21
- package/components/ProgressBar/ProgressBar.module.scss.js +0 -51
- package/components/RelativeTime/RelativeTime.module.scss.js +0 -7
- package/components/SegmentedControl/SegmentedControl.module.scss.js +0 -39
- package/components/Skeleton/Skeleton.module.scss.js +0 -25
- package/components/Spinner/Spinner.module.scss.js +0 -20
- package/components/SplitButton/SplitButton.module.scss.js +0 -57
- package/components/SplitPane/SplitPane.module.scss.js +0 -25
- package/components/StatCard/StatCard.module.scss.js +0 -72
- package/components/StatusDot/StatusDot.module.scss.js +0 -32
- package/components/Table/Table.module.scss.js +0 -81
- package/components/Tabs/Tabs.module.scss.js +0 -53
- package/components/ThemeToggle/ThemeToggle.module.scss.js +0 -23
- package/components/Timeline/GanttTimeline.module.scss.js +0 -55
- package/components/Timeline/HistoryTimeline.module.scss.js +0 -59
- package/components/Timeline/Timeline.module.scss.js +0 -141
- package/components/Timeline/TraceTimeline.module.scss.js +0 -189
- package/components/Timer/Timer.module.scss.js +0 -55
- package/components/Toast/Toast.module.scss.js +0 -62
- package/components/ToggleIconButton/ToggleIconButton.module.scss.js +0 -27
- package/components/Tooltip/Tooltip.module.scss.js +0 -30
- package/components/Typography/Typography.module.scss.js +0 -53
- package/components/inputs/Checkbox/Checkbox.module.scss.js +0 -17
- package/components/inputs/Checkbox/CheckboxGroup.module.scss.js +0 -31
- package/components/inputs/DatePicker/CalendarPanel.module.scss.js +0 -41
- package/components/inputs/DatePicker/DatePicker.module.scss.js +0 -25
- package/components/inputs/DateTimePicker/DateTimePicker.module.scss.js +0 -37
- package/components/inputs/Input/Input.module.scss.js +0 -27
- package/components/inputs/NumberInput/NumberInput.module.scss.js +0 -25
- package/components/inputs/Radio/Radio.module.scss.js +0 -15
- package/components/inputs/SearchInput/SearchInput.module.scss.js +0 -13
- package/components/inputs/Select/Select.module.scss.js +0 -73
- package/components/inputs/Slider/Slider.module.scss.js +0 -15
- package/components/inputs/Textarea/Textarea.module.scss.js +0 -25
|
@@ -1,181 +1,248 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import n from "
|
|
4
|
-
import
|
|
5
|
-
import a from "
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"span",
|
|
18
|
-
{
|
|
19
|
-
className: n(
|
|
20
|
-
a.statusBadge,
|
|
21
|
-
c && a.badgeSm,
|
|
22
|
-
e.tone === "pending" && a.statusPending,
|
|
23
|
-
e.tone === "warn" && a.statusWarn,
|
|
24
|
-
e.tone === "error" && a.statusError
|
|
25
|
-
),
|
|
26
|
-
children: e.text
|
|
27
|
-
}
|
|
28
|
-
) : null;
|
|
1
|
+
import e from "./Timeline.module.js";
|
|
2
|
+
import t from "./TraceTimeline.module.js";
|
|
3
|
+
import { fmtDur as n, fmtISO as r } from "./timelineCore.js";
|
|
4
|
+
import { HighlightText as i } from "./TimelineShared.js";
|
|
5
|
+
import { CopyButton as a } from "../ActionButton/CopyButton.js";
|
|
6
|
+
import { badgeOf as o, extraFieldsOf as s, isInline as c, isRequestEvent as l, routeOf as u, toText as d } from "./traceEvent.js";
|
|
7
|
+
import { forwardRef as f, isValidElement as p } from "react";
|
|
8
|
+
import m from "clsx";
|
|
9
|
+
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
10
|
+
// src/components/Timeline/TraceEventDetails.tsx
|
|
11
|
+
function v({ event: e, pending: n, small: r }) {
|
|
12
|
+
let i = o(e, n);
|
|
13
|
+
return i ? /* @__PURE__ */ g("span", {
|
|
14
|
+
className: m(t.statusBadge, r && t.badgeSm, i.tone === "pending" && t.statusPending, i.tone === "warn" && t.statusWarn, i.tone === "error" && t.statusError),
|
|
15
|
+
children: i.text
|
|
16
|
+
}) : null;
|
|
29
17
|
}
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
18
|
+
function y({ field: n, query: r, className: o }) {
|
|
19
|
+
let { label: s, value: l, mono: u = !0, copy: f } = n, h = c(l) || l == null || p(l), v = /* @__PURE__ */ g(a, {
|
|
20
|
+
size: "sm",
|
|
21
|
+
className: t.payloadCopy,
|
|
22
|
+
value: () => d(l),
|
|
23
|
+
"aria-label": `Copy ${s}`
|
|
24
|
+
});
|
|
25
|
+
return /* @__PURE__ */ _("div", {
|
|
26
|
+
className: m(t.field, !h && t.fieldBlock, o),
|
|
27
|
+
children: [f || !h ? /* @__PURE__ */ _("div", {
|
|
28
|
+
className: t.bodyHead,
|
|
29
|
+
children: [/* @__PURE__ */ g("span", {
|
|
30
|
+
className: t.fieldLabel,
|
|
31
|
+
children: s
|
|
32
|
+
}), v]
|
|
33
|
+
}) : /* @__PURE__ */ g("span", {
|
|
34
|
+
className: t.fieldLabel,
|
|
35
|
+
children: s
|
|
36
|
+
}), h ? /* @__PURE__ */ g("div", {
|
|
37
|
+
className: m(t.fieldValue, u && t.fieldMono),
|
|
38
|
+
children: p(l) ? l : l == null || l === "" ? "—" : /* @__PURE__ */ g(i, {
|
|
39
|
+
text: String(l),
|
|
40
|
+
query: r
|
|
41
|
+
})
|
|
42
|
+
}) : /* @__PURE__ */ g("pre", {
|
|
43
|
+
className: m(e.asideRaw, t.fieldPre),
|
|
44
|
+
children: d(l)
|
|
45
|
+
})]
|
|
46
|
+
});
|
|
51
47
|
}
|
|
52
|
-
function
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
E,
|
|
69
|
-
{
|
|
70
|
-
size: "sm",
|
|
71
|
-
className: a.payloadCopy,
|
|
72
|
-
value: () => b(d),
|
|
73
|
-
"aria-label": c
|
|
74
|
-
}
|
|
75
|
-
)
|
|
76
|
-
] }),
|
|
77
|
-
/* @__PURE__ */ l("pre", { className: h.asideRaw, children: d != null ? b(d) : "(empty)" })
|
|
78
|
-
] });
|
|
48
|
+
function b({ label: n, value: r, copyLabel: i, section: o }) {
|
|
49
|
+
return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _("div", {
|
|
50
|
+
className: t.bodyHead,
|
|
51
|
+
children: [/* @__PURE__ */ g("span", {
|
|
52
|
+
className: m(o ? t.drawerSection : e.asideSection, t.bodyLabel),
|
|
53
|
+
children: n
|
|
54
|
+
}), r != null && /* @__PURE__ */ g(a, {
|
|
55
|
+
size: "sm",
|
|
56
|
+
className: t.payloadCopy,
|
|
57
|
+
value: () => d(r),
|
|
58
|
+
"aria-label": i
|
|
59
|
+
})]
|
|
60
|
+
}), /* @__PURE__ */ g("pre", {
|
|
61
|
+
className: e.asideRaw,
|
|
62
|
+
children: r == null ? "(empty)" : d(r)
|
|
63
|
+
})] });
|
|
79
64
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}
|
|
65
|
+
var x = (e) => Object.entries(e || {}).map(([e, t]) => ({
|
|
66
|
+
k: e,
|
|
67
|
+
v: String(t)
|
|
68
|
+
})), S = f(function(i, a) {
|
|
69
|
+
let { event: o, now: c = Date.now(), highlight: d, showExtraFields: f = !0, hiddenFields: p, onClose: S, classes: C, className: w, style: T } = i, E = (d || "").trim(), D = o.end == null, O = l(o), k = f ? s(o, p) : [], A = !!Object.keys(o.query || {}).length, j = !!Object.keys(o.reqHeaders || {}).length, M = !!Object.keys(o.resHeaders || {}).length, N = [], P = o.reqHeaders && o.reqHeaders["x-request-id"] || o.requestId;
|
|
70
|
+
o.op && N.push({
|
|
71
|
+
label: "Operation",
|
|
72
|
+
value: o.op
|
|
73
|
+
}), o.url ? N.push({
|
|
74
|
+
label: "URL",
|
|
75
|
+
value: o.url
|
|
76
|
+
}) : o.label && N.push({
|
|
77
|
+
label: "Label",
|
|
78
|
+
value: o.label
|
|
79
|
+
}), N.push({
|
|
80
|
+
label: "Event id",
|
|
81
|
+
value: o.id
|
|
82
|
+
}), P && N.push({
|
|
83
|
+
label: "Request id",
|
|
84
|
+
value: P
|
|
85
|
+
}), N.push({
|
|
86
|
+
label: "Started",
|
|
87
|
+
value: r(o.start, !0)
|
|
88
|
+
}), D ? N.push({
|
|
89
|
+
label: "Duration",
|
|
90
|
+
value: n(c - o.start) + " so far"
|
|
91
|
+
}) : o.end === o.start ? N.push({
|
|
92
|
+
label: "Duration",
|
|
93
|
+
value: "instant"
|
|
94
|
+
}) : (N.push({
|
|
95
|
+
label: "Ended",
|
|
96
|
+
value: r(o.end, !0)
|
|
97
|
+
}), N.push({
|
|
98
|
+
label: "Duration",
|
|
99
|
+
value: n(o.end - o.start)
|
|
100
|
+
}));
|
|
101
|
+
let F = !O && !o.message && !o.details?.length && o.payload == null && !k.length, I = (e) => /* @__PURE__ */ g("div", {
|
|
102
|
+
className: m(t.drawerSection, C?.section),
|
|
103
|
+
children: e
|
|
104
|
+
});
|
|
105
|
+
return /* @__PURE__ */ _("div", {
|
|
106
|
+
ref: a,
|
|
107
|
+
className: m(C?.root, w),
|
|
108
|
+
style: T,
|
|
109
|
+
children: [/* @__PURE__ */ g("div", {
|
|
110
|
+
className: m(t.drawerHead, C?.head),
|
|
111
|
+
children: /* @__PURE__ */ _("div", {
|
|
112
|
+
className: t.drawerHeadRow,
|
|
113
|
+
children: [
|
|
114
|
+
o.method && /* @__PURE__ */ g("span", {
|
|
115
|
+
className: t.methodBadge,
|
|
116
|
+
children: o.method
|
|
117
|
+
}),
|
|
118
|
+
/* @__PURE__ */ g(v, {
|
|
119
|
+
event: o,
|
|
120
|
+
pending: D
|
|
121
|
+
}),
|
|
122
|
+
/* @__PURE__ */ g("span", {
|
|
123
|
+
className: t.drawerRoute,
|
|
124
|
+
children: u(o)
|
|
125
|
+
}),
|
|
126
|
+
/* @__PURE__ */ g("div", { className: t.drawerSpacer }),
|
|
127
|
+
S && /* @__PURE__ */ g("button", {
|
|
128
|
+
type: "button",
|
|
129
|
+
className: e.asideClose,
|
|
130
|
+
"aria-label": "Close details",
|
|
131
|
+
onClick: S,
|
|
132
|
+
children: "✕"
|
|
133
|
+
})
|
|
134
|
+
]
|
|
135
|
+
})
|
|
136
|
+
}), /* @__PURE__ */ _("div", {
|
|
137
|
+
className: m(t.drawerBody, C?.body),
|
|
138
|
+
children: [
|
|
139
|
+
/* @__PURE__ */ g("div", {
|
|
140
|
+
className: m(t.fieldList, t.headFields),
|
|
141
|
+
children: N.map((e) => /* @__PURE__ */ g(y, {
|
|
142
|
+
field: e,
|
|
143
|
+
query: E,
|
|
144
|
+
className: C?.field
|
|
145
|
+
}, e.label))
|
|
146
|
+
}),
|
|
147
|
+
o.message && /* @__PURE__ */ g("div", {
|
|
148
|
+
className: t.fieldList,
|
|
149
|
+
children: /* @__PURE__ */ g(y, {
|
|
150
|
+
field: {
|
|
151
|
+
label: "Message",
|
|
152
|
+
value: o.message,
|
|
153
|
+
mono: !1
|
|
154
|
+
},
|
|
155
|
+
query: E,
|
|
156
|
+
className: C?.field
|
|
157
|
+
})
|
|
158
|
+
}),
|
|
159
|
+
!!o.details?.length && /* @__PURE__ */ _(h, { children: [I("Details"), /* @__PURE__ */ g("div", {
|
|
160
|
+
className: t.fieldList,
|
|
161
|
+
children: o.details.map((e, t) => /* @__PURE__ */ g(y, {
|
|
162
|
+
field: e,
|
|
163
|
+
query: E,
|
|
164
|
+
className: C?.field
|
|
165
|
+
}, e.label + t))
|
|
166
|
+
})] }),
|
|
167
|
+
o.payload != null && /* @__PURE__ */ g(b, {
|
|
168
|
+
section: !0,
|
|
169
|
+
label: "Payload",
|
|
170
|
+
value: o.payload,
|
|
171
|
+
copyLabel: "Copy payload"
|
|
172
|
+
}),
|
|
173
|
+
O && /* @__PURE__ */ _(h, { children: [
|
|
174
|
+
I("Request"),
|
|
175
|
+
A && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
|
|
176
|
+
className: e.asideSection,
|
|
177
|
+
children: "Query parameters"
|
|
178
|
+
}), x(o.query).map((e) => /* @__PURE__ */ _("div", {
|
|
179
|
+
className: t.kvRow,
|
|
180
|
+
children: [/* @__PURE__ */ g("span", {
|
|
181
|
+
className: m(t.kvKey, t.kvKeyQuery),
|
|
182
|
+
children: e.k
|
|
183
|
+
}), /* @__PURE__ */ g("span", {
|
|
184
|
+
className: t.kvVal,
|
|
185
|
+
children: e.v
|
|
186
|
+
})]
|
|
187
|
+
}, e.k))] }),
|
|
188
|
+
j && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
|
|
189
|
+
className: e.asideSection,
|
|
190
|
+
children: "Headers"
|
|
191
|
+
}), x(o.reqHeaders).map((e) => /* @__PURE__ */ _("div", {
|
|
192
|
+
className: t.kvRow,
|
|
193
|
+
children: [/* @__PURE__ */ g("span", {
|
|
194
|
+
className: t.kvKey,
|
|
195
|
+
children: e.k
|
|
196
|
+
}), /* @__PURE__ */ g("span", {
|
|
197
|
+
className: t.kvVal,
|
|
198
|
+
children: e.v
|
|
199
|
+
})]
|
|
200
|
+
}, e.k))] }),
|
|
201
|
+
o.reqBody != null && /* @__PURE__ */ g(b, {
|
|
202
|
+
label: "Body",
|
|
203
|
+
value: o.reqBody,
|
|
204
|
+
copyLabel: "Copy request payload"
|
|
205
|
+
}),
|
|
206
|
+
!A && !j && o.reqBody == null && /* @__PURE__ */ g("div", {
|
|
207
|
+
className: t.emptyNote,
|
|
208
|
+
children: "No request data captured."
|
|
209
|
+
}),
|
|
210
|
+
I("Response"),
|
|
211
|
+
D ? /* @__PURE__ */ _("div", {
|
|
212
|
+
className: t.awaiting,
|
|
213
|
+
children: [/* @__PURE__ */ g("span", { className: m(e.pulseDot, t.awaitingDot) }), "Awaiting response…"]
|
|
214
|
+
}) : /* @__PURE__ */ _(h, { children: [M && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
|
|
215
|
+
className: e.asideSection,
|
|
216
|
+
children: "Headers"
|
|
217
|
+
}), x(o.resHeaders).map((e) => /* @__PURE__ */ _("div", {
|
|
218
|
+
className: t.kvRow,
|
|
219
|
+
children: [/* @__PURE__ */ g("span", {
|
|
220
|
+
className: t.kvKey,
|
|
221
|
+
children: e.k
|
|
222
|
+
}), /* @__PURE__ */ g("span", {
|
|
223
|
+
className: t.kvVal,
|
|
224
|
+
children: e.v
|
|
225
|
+
})]
|
|
226
|
+
}, e.k))] }), /* @__PURE__ */ g(b, {
|
|
227
|
+
label: "Body",
|
|
228
|
+
value: o.resBody,
|
|
229
|
+
copyLabel: "Copy response payload"
|
|
230
|
+
})] })
|
|
231
|
+
] }),
|
|
232
|
+
!!k.length && /* @__PURE__ */ _(h, { children: [I("Other fields"), /* @__PURE__ */ g("div", {
|
|
233
|
+
className: t.fieldList,
|
|
234
|
+
children: k.map((e) => /* @__PURE__ */ g(y, {
|
|
235
|
+
field: e,
|
|
236
|
+
query: E,
|
|
237
|
+
className: C?.field
|
|
238
|
+
}, e.label))
|
|
239
|
+
})] }),
|
|
240
|
+
F && /* @__PURE__ */ g("div", {
|
|
241
|
+
className: t.emptyNote,
|
|
242
|
+
children: "No further details for this event."
|
|
243
|
+
})
|
|
244
|
+
]
|
|
245
|
+
})]
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
export { v as EventBadge, y as FieldRow, b as PayloadBlock, S as TraceEventDetails };
|