@overdoser/react-toolkit 0.9.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -0
- package/README.md +2 -0
- package/components/Timeline/GanttTimeline.js +193 -186
- package/components/Timeline/HistoryTimeline.js +172 -172
- package/components/Timeline/TraceTimeline.js +322 -297
- package/components/Timeline/TraceTimeline.module.scss.js +78 -72
- package/components/Timeline/timelineCore.d.ts +12 -2
- package/components/Timeline/timelineCore.js +103 -45
- package/index.css +1 -1
- package/index.layered.css +1 -1
- package/llms.txt +2 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,59 @@ All notable changes to `@overdoser/react-toolkit` are documented here.
|
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/), and this
|
|
5
5
|
project adheres to [Semantic Versioning](https://semver.org/).
|
|
6
6
|
|
|
7
|
+
## [0.10.1]
|
|
8
|
+
|
|
9
|
+
Metadata-only release. No code changes.
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- `homepage` in package.json and a live-demo link in the readme — the
|
|
14
|
+
Storybook demo at <https://react-toolkit.overdoser.org> now appears on
|
|
15
|
+
the npm package page.
|
|
16
|
+
|
|
17
|
+
## [0.10.0]
|
|
18
|
+
|
|
19
|
+
Timeline axis overhaul (sub-second zoom, tiered rails, deep-zoom
|
|
20
|
+
performance) plus a Modal focus-ring fix. No breaking API changes.
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
- **Sub-second axis ticks.** The tick table now reaches down to 1ms (was
|
|
25
|
+
1s), so a short event — e.g. a single 1.1s trace — gets a real axis with
|
|
26
|
+
millisecond labels instead of one gridline. Applies to all three Timeline
|
|
27
|
+
views.
|
|
28
|
+
- **Tiered axis rails in `TraceTimeline`**, coarse to fine: UTC badge,
|
|
29
|
+
date, time, and a milliseconds rail that appears at sub-second zooms.
|
|
30
|
+
Date and second labels render only at true day/second boundaries; sticky
|
|
31
|
+
date and (at sub-second zoom) sticky time boxes at the left edge always
|
|
32
|
+
name the current position, even when no boundary is in view.
|
|
33
|
+
- **Ruler-pattern minor ticks.** Minors sit on the step's natural units via
|
|
34
|
+
a per-step subdivision table: 5-unit steps read big/4-small/big, 10-unit
|
|
35
|
+
steps get a medium mark at the halfway unit, and clock/calendar steps
|
|
36
|
+
subdivide on their own units (quarter-hours, days into weeks, quarters
|
|
37
|
+
into years…).
|
|
38
|
+
- `--crk-modal-ring-guard` token (default `4px`) — see the Modal fix below.
|
|
39
|
+
|
|
40
|
+
### Changed
|
|
41
|
+
|
|
42
|
+
- **Axis ticks span the whole scrollable canvas**, not just the interval
|
|
43
|
+
covered by events/tasks (TraceTimeline, GanttTimeline, and
|
|
44
|
+
HistoryTimeline's proportional mode).
|
|
45
|
+
|
|
46
|
+
### Fixed
|
|
47
|
+
|
|
48
|
+
- **Deep zoom no longer freezes the page.** TraceTimeline and
|
|
49
|
+
GanttTimeline virtualize the axis: only ticks inside the scroll window
|
|
50
|
+
are materialized. Extreme zoom used to build tens of thousands of tick
|
|
51
|
+
nodes and re-render them on every mousemove, pegging the CPU.
|
|
52
|
+
- **`Modal.Body` no longer clips the top of focus rings.** The body scrolls
|
|
53
|
+
and had zero top padding, so the outward 3px focus ring of a form field
|
|
54
|
+
flush at the top lost its upper edge. The body now reserves
|
|
55
|
+
`--crk-modal-ring-guard` of top padding, and `Modal.Header` cedes the
|
|
56
|
+
same amount from its bottom padding — the header→body gap is
|
|
57
|
+
pixel-identical for existing consumers. Raise the token if you theme
|
|
58
|
+
`--crk-shadow-ring` thicker than 3px.
|
|
59
|
+
|
|
7
60
|
## [0.9.0]
|
|
8
61
|
|
|
9
62
|
Introduces the Timeline family: three timeline views built from the
|
package/README.md
CHANGED
|
@@ -1,222 +1,229 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
1
|
+
import { jsx as t, jsxs as f, Fragment as oe } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as nn, useRef as y, useState as S, useCallback as V, useEffect as tn, useMemo as ln, useLayoutEffect as an } from "react";
|
|
3
|
+
import d from "clsx";
|
|
4
4
|
import r from "./Timeline.module.scss.js";
|
|
5
|
-
import
|
|
6
|
-
import { ticks as
|
|
7
|
-
import { TimelineSummary as
|
|
8
|
-
import { useNowTicker as
|
|
9
|
-
const
|
|
10
|
-
function(
|
|
5
|
+
import a from "./GanttTimeline.module.scss.js";
|
|
6
|
+
import { ticks as rn, TIMELINE_PALETTE_VARS as b, fmtDate as ce, fmtDur as F, eventMatches as sn, fmtDateTime as Z, tint as on } from "./timelineCore.js";
|
|
7
|
+
import { TimelineSummary as cn, TimelineZoomControls as dn, HighlightText as un, TimelineTooltip as mn } from "./TimelineShared.js";
|
|
8
|
+
import { useNowTicker as hn, useContainerWidth as fn, useTimelinePan as wn, useWheelZoom as pn, animateScrollTo as gn } from "./useTimeline.js";
|
|
9
|
+
const w = 230, Pe = 24, R = 400, Nn = 26, Pn = nn(
|
|
10
|
+
function(We, De) {
|
|
11
11
|
const {
|
|
12
|
-
tasks:
|
|
13
|
-
title:
|
|
14
|
-
meta:
|
|
15
|
-
highlight:
|
|
16
|
-
defaultHighlight:
|
|
17
|
-
onHighlightChange:
|
|
18
|
-
showSearch:
|
|
19
|
-
renderSearch:
|
|
20
|
-
compactRows:
|
|
21
|
-
showGridlines:
|
|
22
|
-
showControls:
|
|
23
|
-
showSummary:
|
|
24
|
-
summaryPlacement:
|
|
25
|
-
summaryDefaultPosition:
|
|
26
|
-
maxHeight:
|
|
27
|
-
selectedTaskId:
|
|
28
|
-
defaultSelectedTaskId:
|
|
29
|
-
onTaskSelect:
|
|
30
|
-
renderRowLabel:
|
|
31
|
-
renderBar:
|
|
32
|
-
renderTooltip:
|
|
12
|
+
tasks: z,
|
|
13
|
+
title: B,
|
|
14
|
+
meta: K,
|
|
15
|
+
highlight: U,
|
|
16
|
+
defaultHighlight: He,
|
|
17
|
+
onHighlightChange: Ce,
|
|
18
|
+
showSearch: Ie = !0,
|
|
19
|
+
renderSearch: de,
|
|
20
|
+
compactRows: Ee = !1,
|
|
21
|
+
showGridlines: Ae = !0,
|
|
22
|
+
showControls: ue = !0,
|
|
23
|
+
showSummary: C = !1,
|
|
24
|
+
summaryPlacement: k = "left",
|
|
25
|
+
summaryDefaultPosition: Oe,
|
|
26
|
+
maxHeight: Ve = "74vh",
|
|
27
|
+
selectedTaskId: _,
|
|
28
|
+
defaultSelectedTaskId: Fe = null,
|
|
29
|
+
onTaskSelect: Ze,
|
|
30
|
+
renderRowLabel: me,
|
|
31
|
+
renderBar: $,
|
|
32
|
+
renderTooltip: G,
|
|
33
33
|
renderDetails: X,
|
|
34
|
-
classes:
|
|
35
|
-
className:
|
|
36
|
-
style:
|
|
37
|
-
} =
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
const e =
|
|
41
|
-
e &&
|
|
42
|
-
(
|
|
34
|
+
classes: u,
|
|
35
|
+
className: ze,
|
|
36
|
+
style: Be
|
|
37
|
+
} = We, p = y(null), [he, fe] = S(null), [we, pe] = S(!0), [g, Y] = S(null), [Ke, Ue] = S(Fe), P = _ !== void 0 ? _ : Ke, [x, _e] = S({ l: 0, t: 0, w: 0, h: 0 }), ge = y(C);
|
|
38
|
+
ge.current = C;
|
|
39
|
+
const j = y(null), q = V(() => {
|
|
40
|
+
const e = p.current;
|
|
41
|
+
e && _e(
|
|
42
|
+
(n) => n.l === e.scrollLeft && n.t === e.scrollTop && n.w === e.clientWidth && n.h === e.clientHeight ? n : { l: e.scrollLeft, t: e.scrollTop, w: e.clientWidth, h: e.clientHeight }
|
|
43
43
|
);
|
|
44
|
-
}, []),
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
}, []), [W, $e] = S({ l: 0, w: 2e3 }), J = y(W);
|
|
45
|
+
J.current = W;
|
|
46
|
+
const Q = V(() => {
|
|
47
|
+
const e = p.current;
|
|
48
|
+
if (!e) return;
|
|
49
|
+
const n = Math.floor(e.scrollLeft / R) * R, l = (Math.ceil((e.clientWidth || 1600) / R) + 1) * R;
|
|
50
|
+
(n !== J.current.l || l !== J.current.w) && $e({ l: n, w: l });
|
|
51
|
+
}, []), Ge = V(() => {
|
|
52
|
+
j.current == null && (j.current = requestAnimationFrame(() => {
|
|
53
|
+
j.current = null, Q(), ge.current && q();
|
|
47
54
|
}));
|
|
48
|
-
}, [
|
|
49
|
-
|
|
50
|
-
|
|
55
|
+
}, [q, Q]);
|
|
56
|
+
tn(() => {
|
|
57
|
+
C && q();
|
|
51
58
|
});
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
},
|
|
59
|
+
const Ne = z.some((e) => e.end == null), N = hn(Ne, 400), ee = fn(p), D = wn(p), [Xe, Ye] = S(He ?? ""), ne = U !== void 0 ? U : Xe, I = ne.trim(), ve = (e) => {
|
|
60
|
+
U === void 0 && Ye(e), Ce?.(e);
|
|
61
|
+
}, xe = de ? de({ value: ne, setValue: ve }) : Ie ? /* @__PURE__ */ t(
|
|
55
62
|
"input",
|
|
56
63
|
{
|
|
57
|
-
className:
|
|
64
|
+
className: d(r.searchInput, u?.search),
|
|
58
65
|
placeholder: "Highlight keyword in tasks…",
|
|
59
66
|
"aria-label": "Highlight keyword",
|
|
60
|
-
value:
|
|
61
|
-
onChange: (e) =>
|
|
67
|
+
value: ne,
|
|
68
|
+
onChange: (e) => ve(e.target.value)
|
|
62
69
|
}
|
|
63
|
-
) : null, i =
|
|
64
|
-
let
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
const A =
|
|
70
|
-
|
|
71
|
-
A.current != null &&
|
|
70
|
+
) : null, i = ln(() => z.slice().sort((e, n) => e.start - n.start), [z]);
|
|
71
|
+
let m = i.length ? Math.min(...i.map((e) => e.start)) : N - 1, te = i.length ? Math.max(m + 1, ...i.map((e) => e.end == null ? N : e.end)) : N;
|
|
72
|
+
const le = (te - m) * 0.03;
|
|
73
|
+
m -= le, te += le;
|
|
74
|
+
const ae = te - m, E = Math.max(240, ee - w - Pe) / ae, o = we || !he ? E : he, re = y(E), Me = y(o);
|
|
75
|
+
re.current = E, Me.current = o;
|
|
76
|
+
const A = y(null);
|
|
77
|
+
an(() => {
|
|
78
|
+
A.current != null && p.current && (p.current.scrollLeft = A.current, A.current = null), Q();
|
|
72
79
|
});
|
|
73
|
-
const
|
|
74
|
-
const
|
|
75
|
-
if (!
|
|
76
|
-
const
|
|
77
|
-
A.current =
|
|
80
|
+
const se = V((e, n) => {
|
|
81
|
+
const l = p.current;
|
|
82
|
+
if (!l) return;
|
|
83
|
+
const c = Me.current || 1e-4, h = Math.max(re.current ? re.current * 0.2 : 1e-9, Math.min(1, c * e)), v = (l.scrollLeft + n - w) / c;
|
|
84
|
+
A.current = v * h + w - n, pe(!1), fe(h);
|
|
78
85
|
}, []);
|
|
79
|
-
|
|
86
|
+
pn(p, (e) => {
|
|
80
87
|
e.preventDefault();
|
|
81
|
-
const
|
|
82
|
-
|
|
88
|
+
const n = p.current;
|
|
89
|
+
n && se(Math.exp(-e.deltaY * 18e-4), e.clientX - n.getBoundingClientRect().left);
|
|
83
90
|
});
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
},
|
|
87
|
-
const
|
|
88
|
-
return { x:
|
|
89
|
-
},
|
|
90
|
-
left: Math.round(
|
|
91
|
+
const ie = (e) => {
|
|
92
|
+
_ === void 0 && Ue(e ? e.id : null), Ze?.(e);
|
|
93
|
+
}, je = (e) => {
|
|
94
|
+
const n = window.innerWidth || 1200, l = window.innerHeight || 800, c = e.clientX < n * 0.55 ? Math.max(12, n - 340) : 16, h = Math.max(130, Math.min(e.clientY, l - 130));
|
|
95
|
+
return { x: c, y: h };
|
|
96
|
+
}, L = Ee ? 42 : 54, s = P != null && i.find((e) => e.id === P) || null, be = Math.ceil(w + ae * o + Pe + 90), qe = m + (be - w) / o, Te = Math.max(m, m + (W.l - R - w) / o), ye = Math.min(qe, m + (W.l + W.w + R - w) / o), Se = rn(Te, ye, Math.max(1, (ye - Te) * o)).list.map((e) => ({
|
|
97
|
+
left: Math.round(w + (e.t - m) * o),
|
|
91
98
|
label: e.label
|
|
92
|
-
})),
|
|
93
|
-
|
|
99
|
+
})), Je = i.filter((e) => e.end == null).length, O = C ? /* @__PURE__ */ t(
|
|
100
|
+
cn,
|
|
94
101
|
{
|
|
95
102
|
heading: "Tasks",
|
|
96
|
-
className:
|
|
97
|
-
placement:
|
|
98
|
-
floatingDefaultPosition:
|
|
99
|
-
items: i.map((e,
|
|
100
|
-
const
|
|
103
|
+
className: u?.summary,
|
|
104
|
+
placement: k,
|
|
105
|
+
floatingDefaultPosition: Oe,
|
|
106
|
+
items: i.map((e, n) => {
|
|
107
|
+
const l = e.end == null ? N : e.end, c = Math.round(w + (e.start - m) * o), h = Math.max(14, Math.round(Math.max(0, l - e.start) * o)), v = 34 + n * L, M = !x.w || c < x.l + x.w && c + h > x.l, T = !x.h || v < x.t + x.h && v + L > x.t;
|
|
101
108
|
return {
|
|
102
109
|
id: e.id,
|
|
103
|
-
number: String(
|
|
110
|
+
number: String(n + 1).padStart(2, "0"),
|
|
104
111
|
label: e.name,
|
|
105
|
-
color: b[
|
|
106
|
-
time:
|
|
107
|
-
inView: M &&
|
|
108
|
-
selected:
|
|
112
|
+
color: b[n % b.length],
|
|
113
|
+
time: ce(e.start),
|
|
114
|
+
inView: M && T,
|
|
115
|
+
selected: P === e.id
|
|
109
116
|
};
|
|
110
117
|
}),
|
|
111
118
|
onPick: (e) => {
|
|
112
|
-
const
|
|
113
|
-
if (
|
|
114
|
-
const
|
|
115
|
-
left: Math.max(0,
|
|
119
|
+
const n = i.findIndex((H) => H.id === e), l = p.current;
|
|
120
|
+
if (n < 0 || !l) return;
|
|
121
|
+
const c = i[n], h = c.end == null ? N : c.end, v = Math.round(w + (c.start - m) * o), M = Math.max(14, Math.round(Math.max(0, h - c.start) * o)), T = {
|
|
122
|
+
left: Math.max(0, v + M / 2 - l.clientWidth / 2)
|
|
116
123
|
};
|
|
117
|
-
|
|
124
|
+
l.clientHeight && (T.top = Math.max(0, 34 + n * L + L / 2 - l.clientHeight / 2)), gn(l, T);
|
|
118
125
|
}
|
|
119
126
|
}
|
|
120
127
|
) : null;
|
|
121
|
-
return /* @__PURE__ */
|
|
128
|
+
return /* @__PURE__ */ f(
|
|
122
129
|
"div",
|
|
123
130
|
{
|
|
124
|
-
ref:
|
|
125
|
-
className:
|
|
126
|
-
style:
|
|
131
|
+
ref: De,
|
|
132
|
+
className: d(r.root, u?.root, ze),
|
|
133
|
+
style: Be,
|
|
127
134
|
children: [
|
|
128
|
-
(
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
|
|
131
|
-
/* @__PURE__ */
|
|
135
|
+
(ue || xe || B != null || K != null) && /* @__PURE__ */ f("div", { className: d(r.toolbar, u?.toolbar), children: [
|
|
136
|
+
/* @__PURE__ */ f("div", { className: r.toolbarText, children: [
|
|
137
|
+
B != null && /* @__PURE__ */ t("span", { className: r.toolbarTitle, children: B }),
|
|
138
|
+
/* @__PURE__ */ t("span", { className: r.toolbarMeta, children: K ?? (i.length ? `${i.length} tasks · ${F(ae - 2 * le)} · ${Je} running` : "No tasks") })
|
|
132
139
|
] }),
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
140
|
+
xe,
|
|
141
|
+
ue && /* @__PURE__ */ t(
|
|
142
|
+
dn,
|
|
136
143
|
{
|
|
137
|
-
zoomPct: `${Math.round(
|
|
138
|
-
fitActive:
|
|
139
|
-
onZoomIn: () =>
|
|
140
|
-
onZoomOut: () =>
|
|
144
|
+
zoomPct: `${Math.round(o / E * 100)}%`,
|
|
145
|
+
fitActive: we,
|
|
146
|
+
onZoomIn: () => se(1.5, ee / 2),
|
|
147
|
+
onZoomOut: () => se(1 / 1.5, ee / 2),
|
|
141
148
|
onFit: () => {
|
|
142
|
-
|
|
149
|
+
pe(!0), fe(null);
|
|
143
150
|
},
|
|
144
151
|
hint: "scroll zooms · drag pans"
|
|
145
152
|
}
|
|
146
153
|
)
|
|
147
154
|
] }),
|
|
148
|
-
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
-
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
-
/* @__PURE__ */
|
|
155
|
+
k === "top" && O,
|
|
156
|
+
/* @__PURE__ */ f("div", { className: r.layout, children: [
|
|
157
|
+
k === "left" && O,
|
|
158
|
+
/* @__PURE__ */ f("div", { className: r.main, children: [
|
|
159
|
+
/* @__PURE__ */ t("div", { className: d(r.card, u?.card), children: /* @__PURE__ */ t(
|
|
153
160
|
"div",
|
|
154
161
|
{
|
|
155
|
-
ref:
|
|
156
|
-
className:
|
|
157
|
-
style: { maxHeight:
|
|
158
|
-
onPointerDown:
|
|
159
|
-
onPointerMove:
|
|
160
|
-
onPointerUp:
|
|
161
|
-
onPointerLeave:
|
|
162
|
-
onScroll:
|
|
163
|
-
children: /* @__PURE__ */
|
|
164
|
-
|
|
165
|
-
|
|
162
|
+
ref: p,
|
|
163
|
+
className: d(r.scroller, a.scroller, u?.scroller),
|
|
164
|
+
style: { maxHeight: Ve },
|
|
165
|
+
onPointerDown: D.onPointerDown,
|
|
166
|
+
onPointerMove: D.onPointerMove,
|
|
167
|
+
onPointerUp: D.onPointerUp,
|
|
168
|
+
onPointerLeave: D.onPointerUp,
|
|
169
|
+
onScroll: Ge,
|
|
170
|
+
children: /* @__PURE__ */ f("div", { className: a.inner, style: { width: be }, children: [
|
|
171
|
+
Ae && Se.map((e, n) => /* @__PURE__ */ t("div", { className: a.gridline, style: { left: e.left } }, n)),
|
|
172
|
+
Ne && /* @__PURE__ */ t(
|
|
166
173
|
"div",
|
|
167
174
|
{
|
|
168
|
-
className:
|
|
169
|
-
style: { left: Math.round(
|
|
175
|
+
className: a.nowLine,
|
|
176
|
+
style: { left: Math.round(w + (N - m) * o) }
|
|
170
177
|
}
|
|
171
178
|
),
|
|
172
|
-
/* @__PURE__ */
|
|
173
|
-
i.map((e,
|
|
174
|
-
const
|
|
175
|
-
return /* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ t("div", { className: d(a.axis, u?.axis), children: Se.map((e, n) => /* @__PURE__ */ t("div", { className: a.axisLabel, style: { left: e.left }, children: e.label }, n)) }),
|
|
180
|
+
i.map((e, n) => {
|
|
181
|
+
const l = e.end == null, c = l ? N : e.end, h = Math.max(0, c - e.start), v = sn(e, I), M = b[n % b.length], T = Math.round(w + (e.start - m) * o), H = Math.max(14, Math.round(h * o)), ke = F(h) + (l ? " · running" : ""), Le = H > 130, Re = { index: n, color: M, running: l, durationMs: h };
|
|
182
|
+
return /* @__PURE__ */ f(
|
|
176
183
|
"div",
|
|
177
184
|
{
|
|
178
|
-
className:
|
|
179
|
-
style: { height:
|
|
185
|
+
className: d(a.row, u?.row),
|
|
186
|
+
style: { height: L, opacity: I && !v ? 0.3 : 1 },
|
|
180
187
|
children: [
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
/* @__PURE__ */
|
|
188
|
+
/* @__PURE__ */ t("div", { className: d(a.rowLabel, u?.rowLabel), children: me ? me(e, Re) : /* @__PURE__ */ f(oe, { children: [
|
|
189
|
+
/* @__PURE__ */ t("span", { className: a.rowName, children: /* @__PURE__ */ t(un, { text: e.name, query: I }) }),
|
|
190
|
+
/* @__PURE__ */ t("span", { className: a.rowDates, children: ce(e.start) + (l ? " → now" : " → " + ce(c)) })
|
|
184
191
|
] }) }),
|
|
185
|
-
/* @__PURE__ */
|
|
192
|
+
/* @__PURE__ */ t(
|
|
186
193
|
"div",
|
|
187
194
|
{
|
|
188
|
-
className:
|
|
195
|
+
className: d(a.bar, l && a.barRunning, u?.bar),
|
|
189
196
|
style: {
|
|
190
|
-
left:
|
|
191
|
-
top: Math.round((
|
|
192
|
-
width:
|
|
197
|
+
left: T,
|
|
198
|
+
top: Math.round((L - Nn) / 2),
|
|
199
|
+
width: H,
|
|
193
200
|
borderColor: M,
|
|
194
|
-
background:
|
|
195
|
-
boxShadow:
|
|
201
|
+
background: l ? on(M, 72) : M,
|
|
202
|
+
boxShadow: I && v ? "0 0 0 3px var(--crk-timeline-hl-ring, #f3d98b)" : "none"
|
|
196
203
|
},
|
|
197
204
|
onClick: () => {
|
|
198
|
-
|
|
205
|
+
D.wasDragSuppressed() || (Y(null), ie(P === e.id ? null : e));
|
|
199
206
|
},
|
|
200
|
-
onMouseEnter: (
|
|
201
|
-
if (
|
|
202
|
-
const
|
|
207
|
+
onMouseEnter: (Qe) => {
|
|
208
|
+
if (P === e.id) return;
|
|
209
|
+
const en = je(Qe);
|
|
203
210
|
Y({
|
|
204
|
-
...
|
|
211
|
+
...en,
|
|
205
212
|
id: e.id,
|
|
206
213
|
title: e.name,
|
|
207
|
-
time:
|
|
208
|
-
durLine: (
|
|
214
|
+
time: Z(e.start) + (l ? "" : " → " + Z(c)),
|
|
215
|
+
durLine: (l ? "running · " : "took ") + F(h) + (e.owner ? " · " + e.owner : ""),
|
|
209
216
|
detail: e.detail || ""
|
|
210
217
|
});
|
|
211
218
|
},
|
|
212
219
|
onMouseLeave: () => Y(null),
|
|
213
|
-
children:
|
|
214
|
-
|
|
215
|
-
|
|
220
|
+
children: $ ? $(e, Re) : /* @__PURE__ */ f(oe, { children: [
|
|
221
|
+
l && /* @__PURE__ */ t("span", { className: d(r.pulseDot, a.barDot) }),
|
|
222
|
+
Le && /* @__PURE__ */ t("span", { className: a.barTextInside, children: ke })
|
|
216
223
|
] })
|
|
217
224
|
}
|
|
218
225
|
),
|
|
219
|
-
|
|
226
|
+
!$ && !Le && /* @__PURE__ */ t("div", { className: a.barTextOutside, style: { left: T + H + 10 }, children: ke })
|
|
220
227
|
]
|
|
221
228
|
},
|
|
222
229
|
e.id
|
|
@@ -225,74 +232,74 @@ const v = 230, be = 24, dn = 26, Mn = Xe(
|
|
|
225
232
|
] })
|
|
226
233
|
}
|
|
227
234
|
) }),
|
|
228
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ t("div", { className: d(r.footnote, u?.footnote), children: "Click a bar to open details in the side panel · dashed bars are still running and keep growing" })
|
|
229
236
|
] }),
|
|
230
|
-
s && X && /* @__PURE__ */
|
|
231
|
-
close: () =>
|
|
237
|
+
s && X && /* @__PURE__ */ t("aside", { className: d(r.aside, a.drawer, u?.drawer), children: X(s, {
|
|
238
|
+
close: () => ie(null),
|
|
232
239
|
running: s.end == null
|
|
233
240
|
}) }),
|
|
234
|
-
s && !X && /* @__PURE__ */
|
|
235
|
-
/* @__PURE__ */
|
|
236
|
-
/* @__PURE__ */
|
|
241
|
+
s && !X && /* @__PURE__ */ f("aside", { className: d(r.aside, a.drawer, u?.drawer), children: [
|
|
242
|
+
/* @__PURE__ */ f("div", { className: a.drawerHead, children: [
|
|
243
|
+
/* @__PURE__ */ t(
|
|
237
244
|
"span",
|
|
238
245
|
{
|
|
239
|
-
className:
|
|
246
|
+
className: a.drawerSwatch,
|
|
240
247
|
style: {
|
|
241
248
|
background: b[i.indexOf(s) % b.length]
|
|
242
249
|
}
|
|
243
250
|
}
|
|
244
251
|
),
|
|
245
|
-
/* @__PURE__ */
|
|
246
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ t("span", { className: a.drawerOwner, children: s.owner || "—" }),
|
|
253
|
+
/* @__PURE__ */ t(
|
|
247
254
|
"span",
|
|
248
255
|
{
|
|
249
|
-
className:
|
|
250
|
-
|
|
251
|
-
s.end == null &&
|
|
256
|
+
className: d(
|
|
257
|
+
a.drawerState,
|
|
258
|
+
s.end == null && a.drawerStateRunning
|
|
252
259
|
),
|
|
253
260
|
children: s.end == null ? "running" : "done"
|
|
254
261
|
}
|
|
255
262
|
),
|
|
256
|
-
/* @__PURE__ */
|
|
257
|
-
/* @__PURE__ */
|
|
263
|
+
/* @__PURE__ */ t("div", { className: a.drawerSpacer }),
|
|
264
|
+
/* @__PURE__ */ t(
|
|
258
265
|
"button",
|
|
259
266
|
{
|
|
260
267
|
type: "button",
|
|
261
268
|
className: r.asideClose,
|
|
262
269
|
"aria-label": "Close details",
|
|
263
|
-
onClick: () =>
|
|
270
|
+
onClick: () => ie(null),
|
|
264
271
|
children: "✕"
|
|
265
272
|
}
|
|
266
273
|
)
|
|
267
274
|
] }),
|
|
268
|
-
/* @__PURE__ */
|
|
269
|
-
/* @__PURE__ */
|
|
270
|
-
/* @__PURE__ */
|
|
271
|
-
/* @__PURE__ */
|
|
272
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ t("div", { className: a.drawerName, children: s.name }),
|
|
276
|
+
/* @__PURE__ */ t("div", { className: a.drawerTiming, children: Z(s.start) + " → " + (s.end == null ? "now" : Z(s.end)) + " · " + F((s.end == null ? N : s.end) - s.start) }),
|
|
277
|
+
/* @__PURE__ */ t("div", { className: a.drawerDetail, children: s.detail || "—" }),
|
|
278
|
+
/* @__PURE__ */ t("div", { className: r.asideSection, children: "Raw event" }),
|
|
279
|
+
/* @__PURE__ */ t("pre", { className: r.asideRaw, children: JSON.stringify(s, null, 2) })
|
|
273
280
|
] }),
|
|
274
|
-
(
|
|
281
|
+
(k === "right" || k === "floating") && O
|
|
275
282
|
] }),
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
const e = i.find((
|
|
283
|
+
k === "bottom" && O,
|
|
284
|
+
g && (() => {
|
|
285
|
+
const e = i.find((l) => l.id === g.id), n = e && G ? G(e, {
|
|
279
286
|
index: i.indexOf(e),
|
|
280
287
|
color: b[i.indexOf(e) % b.length],
|
|
281
288
|
running: e.end == null,
|
|
282
|
-
durationMs: (e.end == null ?
|
|
289
|
+
durationMs: (e.end == null ? N : e.end) - e.start
|
|
283
290
|
}) : void 0;
|
|
284
|
-
return
|
|
285
|
-
/* @__PURE__ */
|
|
286
|
-
/* @__PURE__ */
|
|
291
|
+
return G && n == null ? null : /* @__PURE__ */ t(mn, { x: g.x, y: g.y, className: u?.tooltip, children: n !== void 0 ? n : /* @__PURE__ */ f(oe, { children: [
|
|
292
|
+
/* @__PURE__ */ t("div", { className: r.tooltipTitle, children: g.title }),
|
|
293
|
+
/* @__PURE__ */ t(
|
|
287
294
|
"div",
|
|
288
295
|
{
|
|
289
|
-
className:
|
|
296
|
+
className: d(r.tooltipLine, r.tooltipMono),
|
|
290
297
|
style: { marginTop: 4 },
|
|
291
|
-
children:
|
|
298
|
+
children: g.time
|
|
292
299
|
}
|
|
293
300
|
),
|
|
294
|
-
/* @__PURE__ */
|
|
295
|
-
|
|
301
|
+
/* @__PURE__ */ t("div", { className: r.tooltipLine, children: g.durLine }),
|
|
302
|
+
g.detail && /* @__PURE__ */ t("div", { className: r.tooltipDim, style: { marginTop: 5 }, children: g.detail })
|
|
296
303
|
] }) });
|
|
297
304
|
})()
|
|
298
305
|
]
|
|
@@ -301,5 +308,5 @@ const v = 230, be = 24, dn = 26, Mn = Xe(
|
|
|
301
308
|
}
|
|
302
309
|
);
|
|
303
310
|
export {
|
|
304
|
-
|
|
311
|
+
Pn as GanttTimeline
|
|
305
312
|
};
|