@overdoser/react-toolkit 0.9.0 → 0.11.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.
@@ -1,222 +1,230 @@
1
- import { jsx as n, jsxs as h, Fragment as le } from "react/jsx-runtime";
2
- import { forwardRef as Xe, useRef as k, useState as L, useCallback as ae, useEffect as Ye, useMemo as _e, useLayoutEffect as je } from "react";
3
- import c from "clsx";
1
+ import { jsx as t, jsxs as f, Fragment as oe } from "react/jsx-runtime";
2
+ import { forwardRef as nn, useRef as S, useState as k, 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 l from "./GanttTimeline.module.scss.js";
6
- import { ticks as qe, TIMELINE_PALETTE_VARS as b, fmtDate as re, fmtDur as V, eventMatches as Je, fmtDateTime as F, tint as Qe } from "./timelineCore.js";
7
- import { TimelineSummary as en, TimelineZoomControls as nn, HighlightText as tn, TimelineTooltip as ln } from "./TimelineShared.js";
8
- import { useNowTicker as an, useContainerWidth as rn, useTimelinePan as sn, useWheelZoom as on, animateScrollTo as cn } from "./useTimeline.js";
9
- const v = 230, be = 24, dn = 26, Mn = Xe(
10
- function(ye, Te) {
5
+ import a from "./GanttTimeline.module.scss.js";
6
+ import { ticks as rn, TIMELINE_PALETTE_VARS as x, 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, Ce) {
11
11
  const {
12
- tasks: Z,
13
- title: z,
14
- meta: B,
15
- highlight: $,
16
- defaultHighlight: Se,
17
- onHighlightChange: ke,
18
- showSearch: Le = !0,
19
- renderSearch: se,
20
- compactRows: Re = !1,
21
- showGridlines: Pe = !0,
22
- showControls: ie = !0,
23
- showSummary: H = !1,
12
+ tasks: z,
13
+ title: B,
14
+ meta: G,
15
+ highlight: K,
16
+ defaultHighlight: De,
17
+ onHighlightChange: He,
18
+ showSearch: Ie = !0,
19
+ renderSearch: de,
20
+ compactRows: Ee = !1,
21
+ showGridlines: Ae = !0,
22
+ showControls: ue = !0,
23
+ showSummary: I = !1,
24
24
  summaryPlacement: T = "left",
25
- summaryDefaultPosition: De,
26
- maxHeight: He = "74vh",
27
- selectedTaskId: G,
28
- defaultSelectedTaskId: Ce = null,
29
- onTaskSelect: We,
30
- renderRowLabel: oe,
31
- renderBar: K,
32
- renderTooltip: U,
25
+ summaryDefaultPosition: Oe,
26
+ maxHeight: Ve = "74vh",
27
+ selectedTaskId: U,
28
+ defaultSelectedTaskId: Fe = null,
29
+ onTaskSelect: Ze,
30
+ renderRowLabel: me,
31
+ renderBar: _,
32
+ renderTooltip: $,
33
33
  renderDetails: X,
34
- classes: d,
35
- className: Ie,
36
- style: Ee
37
- } = ye, f = k(null), [ce, de] = L(null), [ue, me] = L(!0), [w, Y] = L(null), [Ae, Oe] = L(Ce), R = G !== void 0 ? G : Ae, [x, Ve] = L({ l: 0, t: 0, w: 0, h: 0 }), he = k(H);
38
- he.current = H;
39
- const _ = k(null), j = ae(() => {
40
- const e = f.current;
41
- e && Ve(
42
- (t) => t.l === e.scrollLeft && t.t === e.scrollTop && t.w === e.clientWidth && t.h === e.clientHeight ? t : { l: e.scrollLeft, t: e.scrollTop, w: e.clientWidth, h: e.clientHeight }
34
+ classes: u,
35
+ className: ze,
36
+ style: Be
37
+ } = We, p = S(null), [he, fe] = k(null), [we, pe] = k(!0), [g, Y] = k(null), [Ge, Ke] = k(Fe), P = U !== void 0 ? U : Ge, [M, Ue] = k({ l: 0, t: 0, w: 0, h: 0 }), ge = S(I);
38
+ ge.current = I;
39
+ const j = S(null), q = V(() => {
40
+ const e = p.current;
41
+ e && Ue(
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
- }, []), Fe = ae(() => {
45
- !he.current || _.current != null || (_.current = requestAnimationFrame(() => {
46
- _.current = null, j();
44
+ }, []), [W, _e] = k({ l: 0, w: 2e3 }), J = S(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
+ }, []), $e = V(() => {
52
+ j.current == null && (j.current = requestAnimationFrame(() => {
53
+ j.current = null, Q(), ge.current && q();
47
54
  }));
48
- }, [j]);
49
- Ye(() => {
50
- H && j();
55
+ }, [q, Q]);
56
+ tn(() => {
57
+ I && q();
51
58
  });
52
- const fe = Z.some((e) => e.end == null), g = an(fe, 400), q = rn(f), P = sn(f), [Ze, ze] = L(Se ?? ""), J = $ !== void 0 ? $ : Ze, C = J.trim(), pe = (e) => {
53
- $ === void 0 && ze(e), ke?.(e);
54
- }, we = se ? se({ value: J, setValue: pe }) : Le ? /* @__PURE__ */ n(
59
+ const Ne = z.some((e) => e.end == null), N = hn(Ne, 400), ee = fn(p), C = wn(p), [Xe, Ye] = k(De ?? ""), ne = K !== void 0 ? K : Xe, E = ne.trim(), ve = (e) => {
60
+ K === void 0 && Ye(e), He?.(e);
61
+ }, xe = de ? de({ value: ne, setValue: ve }) : Ie ? /* @__PURE__ */ t(
55
62
  "input",
56
63
  {
57
- className: c(r.searchInput, d?.search),
64
+ className: d(r.searchInput, u?.search),
58
65
  placeholder: "Highlight keyword in tasks…",
59
66
  "aria-label": "Highlight keyword",
60
- value: J,
61
- onChange: (e) => pe(e.target.value)
67
+ value: ne,
68
+ onChange: (e) => ve(e.target.value)
62
69
  }
63
- ) : null, i = _e(() => Z.slice().sort((e, t) => e.start - t.start), [Z]);
64
- let p = i.length ? Math.min(...i.map((e) => e.start)) : g - 1, W = i.length ? Math.max(p + 1, ...i.map((e) => e.end == null ? g : e.end)) : g;
65
- const Q = (W - p) * 0.03;
66
- p -= Q, W += Q;
67
- const I = W - p, E = Math.max(240, q - v - be) / I, u = ue || !ce ? E : ce, ee = k(E), ge = k(u);
68
- ee.current = E, ge.current = u;
69
- const A = k(null);
70
- je(() => {
71
- A.current != null && f.current && (f.current.scrollLeft = A.current, 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, A = Math.max(240, ee - w - Pe) / ae, o = we || !he ? A : he, re = S(A), Me = S(o);
75
+ re.current = A, Me.current = o;
76
+ const O = S(null);
77
+ an(() => {
78
+ O.current != null && p.current && (p.current.scrollLeft = O.current, O.current = null), Q();
72
79
  });
73
- const ne = ae((e, t) => {
74
- const a = f.current;
75
- if (!a) return;
76
- const o = ge.current || 1e-4, m = Math.max(ee.current ? ee.current * 0.2 : 1e-9, Math.min(1, o * e)), N = (a.scrollLeft + t - v) / o;
77
- A.current = N * m + v - t, me(!1), de(m);
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
+ O.current = v * h + w - n, pe(!1), fe(h);
78
85
  }, []);
79
- on(f, (e) => {
86
+ pn(p, (e) => {
80
87
  e.preventDefault();
81
- const t = f.current;
82
- t && ne(Math.exp(-e.deltaY * 18e-4), e.clientX - t.getBoundingClientRect().left);
88
+ const n = p.current;
89
+ n && se(Math.exp(-e.deltaY * 18e-4), e.clientX - n.getBoundingClientRect().left);
83
90
  });
84
- const te = (e) => {
85
- G === void 0 && Oe(e ? e.id : null), We?.(e);
86
- }, Be = (e) => {
87
- const t = window.innerWidth || 1200, a = window.innerHeight || 800, o = e.clientX < t * 0.55 ? Math.max(12, t - 340) : 16, m = Math.max(130, Math.min(e.clientY, a - 130));
88
- return { x: o, y: m };
89
- }, S = Re ? 42 : 54, s = R != null && i.find((e) => e.id === R) || null, Ne = qe(p, W, I * u).list.map((e) => ({
90
- left: Math.round(v + (e.t - p) * u),
91
+ const ie = (e) => {
92
+ U === void 0 && Ke(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
- })), $e = Math.ceil(v + I * u + be + 90), Ge = i.filter((e) => e.end == null).length, O = H ? /* @__PURE__ */ n(
93
- en,
99
+ })), Je = i.filter((e) => e.end == null).length, D = I ? /* @__PURE__ */ t(
100
+ cn,
94
101
  {
95
102
  heading: "Tasks",
96
- className: d?.summary,
103
+ className: u?.summary,
97
104
  placement: T,
98
- floatingDefaultPosition: De,
99
- items: i.map((e, t) => {
100
- const a = e.end == null ? g : e.end, o = Math.round(v + (e.start - p) * u), m = Math.max(14, Math.round(Math.max(0, a - e.start) * u)), N = 34 + t * S, M = !x.w || o < x.l + x.w && o + m > x.l, y = !x.h || N < x.t + x.h && N + S > x.t;
105
+ floatingDefaultPosition: Oe,
106
+ bubbleGlyphColors: x.slice(0, 3),
107
+ items: i.map((e, n) => {
108
+ 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, b = !M.w || c < M.l + M.w && c + h > M.l, y = !M.h || v < M.t + M.h && v + L > M.t;
101
109
  return {
102
110
  id: e.id,
103
- number: String(t + 1).padStart(2, "0"),
111
+ number: String(n + 1).padStart(2, "0"),
104
112
  label: e.name,
105
- color: b[t % b.length],
106
- time: re(e.start),
107
- inView: M && y,
108
- selected: R === e.id
113
+ color: x[n % x.length],
114
+ time: ce(e.start),
115
+ inView: b && y,
116
+ selected: P === e.id
109
117
  };
110
118
  }),
111
119
  onPick: (e) => {
112
- const t = i.findIndex((D) => D.id === e), a = f.current;
113
- if (t < 0 || !a) return;
114
- const o = i[t], m = o.end == null ? g : o.end, N = Math.round(v + (o.start - p) * u), M = Math.max(14, Math.round(Math.max(0, m - o.start) * u)), y = {
115
- left: Math.max(0, N + M / 2 - a.clientWidth / 2)
120
+ const n = i.findIndex((H) => H.id === e), l = p.current;
121
+ if (n < 0 || !l) return;
122
+ const c = i[n], h = c.end == null ? N : c.end, v = Math.round(w + (c.start - m) * o), b = Math.max(14, Math.round(Math.max(0, h - c.start) * o)), y = {
123
+ left: Math.max(0, v + b / 2 - l.clientWidth / 2)
116
124
  };
117
- a.clientHeight && (y.top = Math.max(0, 34 + t * S + S / 2 - a.clientHeight / 2)), cn(a, y);
125
+ l.clientHeight && (y.top = Math.max(0, 34 + n * L + L / 2 - l.clientHeight / 2)), gn(l, y);
118
126
  }
119
127
  }
120
128
  ) : null;
121
- return /* @__PURE__ */ h(
129
+ return /* @__PURE__ */ f(
122
130
  "div",
123
131
  {
124
- ref: Te,
125
- className: c(r.root, d?.root, Ie),
126
- style: Ee,
132
+ ref: Ce,
133
+ className: d(r.root, u?.root, ze),
134
+ style: Be,
127
135
  children: [
128
- (ie || we || z != null || B != null) && /* @__PURE__ */ h("div", { className: c(r.toolbar, d?.toolbar), children: [
129
- /* @__PURE__ */ h("div", { className: r.toolbarText, children: [
130
- z != null && /* @__PURE__ */ n("span", { className: r.toolbarTitle, children: z }),
131
- /* @__PURE__ */ n("span", { className: r.toolbarMeta, children: B ?? (i.length ? `${i.length} tasks · ${V(I - 2 * Q)} · ${Ge} running` : "No tasks") })
136
+ (ue || xe || B != null || G != null) && /* @__PURE__ */ f("div", { className: d(r.toolbar, u?.toolbar), children: [
137
+ /* @__PURE__ */ f("div", { className: r.toolbarText, children: [
138
+ B != null && /* @__PURE__ */ t("span", { className: r.toolbarTitle, children: B }),
139
+ /* @__PURE__ */ t("span", { className: r.toolbarMeta, children: G ?? (i.length ? `${i.length} tasks · ${F(ae - 2 * le)} · ${Je} running` : "No tasks") })
132
140
  ] }),
133
- we,
134
- ie && /* @__PURE__ */ n(
135
- nn,
141
+ xe,
142
+ ue && /* @__PURE__ */ t(
143
+ dn,
136
144
  {
137
- zoomPct: `${Math.round(u / E * 100)}%`,
138
- fitActive: ue,
139
- onZoomIn: () => ne(1.5, q / 2),
140
- onZoomOut: () => ne(1 / 1.5, q / 2),
145
+ zoomPct: `${Math.round(o / A * 100)}%`,
146
+ fitActive: we,
147
+ onZoomIn: () => se(1.5, ee / 2),
148
+ onZoomOut: () => se(1 / 1.5, ee / 2),
141
149
  onFit: () => {
142
- me(!0), de(null);
150
+ pe(!0), fe(null);
143
151
  },
144
152
  hint: "scroll zooms · drag pans"
145
153
  }
146
154
  )
147
155
  ] }),
148
- T === "top" && O,
149
- /* @__PURE__ */ h("div", { className: r.layout, children: [
150
- T === "left" && O,
151
- /* @__PURE__ */ h("div", { className: r.main, children: [
152
- /* @__PURE__ */ n("div", { className: c(r.card, d?.card), children: /* @__PURE__ */ n(
156
+ T === "top" && D,
157
+ /* @__PURE__ */ f("div", { className: r.layout, children: [
158
+ T === "left" && D,
159
+ /* @__PURE__ */ f("div", { className: r.main, children: [
160
+ /* @__PURE__ */ t("div", { className: d(r.card, u?.card), children: /* @__PURE__ */ t(
153
161
  "div",
154
162
  {
155
- ref: f,
156
- className: c(r.scroller, l.scroller, d?.scroller),
157
- style: { maxHeight: He },
158
- onPointerDown: P.onPointerDown,
159
- onPointerMove: P.onPointerMove,
160
- onPointerUp: P.onPointerUp,
161
- onPointerLeave: P.onPointerUp,
162
- onScroll: Fe,
163
- children: /* @__PURE__ */ h("div", { className: l.inner, style: { width: $e }, children: [
164
- Pe && Ne.map((e, t) => /* @__PURE__ */ n("div", { className: l.gridline, style: { left: e.left } }, t)),
165
- fe && /* @__PURE__ */ n(
163
+ ref: p,
164
+ className: d(r.scroller, a.scroller, u?.scroller),
165
+ style: { maxHeight: Ve },
166
+ onPointerDown: C.onPointerDown,
167
+ onPointerMove: C.onPointerMove,
168
+ onPointerUp: C.onPointerUp,
169
+ onPointerLeave: C.onPointerUp,
170
+ onScroll: $e,
171
+ children: /* @__PURE__ */ f("div", { className: a.inner, style: { width: be }, children: [
172
+ Ae && Se.map((e, n) => /* @__PURE__ */ t("div", { className: a.gridline, style: { left: e.left } }, n)),
173
+ Ne && /* @__PURE__ */ t(
166
174
  "div",
167
175
  {
168
- className: l.nowLine,
169
- style: { left: Math.round(v + (g - p) * u) }
176
+ className: a.nowLine,
177
+ style: { left: Math.round(w + (N - m) * o) }
170
178
  }
171
179
  ),
172
- /* @__PURE__ */ n("div", { className: c(l.axis, d?.axis), children: Ne.map((e, t) => /* @__PURE__ */ n("div", { className: l.axisLabel, style: { left: e.left }, children: e.label }, t)) }),
173
- i.map((e, t) => {
174
- const a = e.end == null, o = a ? g : e.end, m = Math.max(0, o - e.start), N = Je(e, C), M = b[t % b.length], y = Math.round(v + (e.start - p) * u), D = Math.max(14, Math.round(m * u)), ve = V(m) + (a ? " · running" : ""), xe = D > 130, Me = { index: t, color: M, running: a, durationMs: m };
175
- return /* @__PURE__ */ h(
180
+ /* @__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)) }),
181
+ i.map((e, n) => {
182
+ const l = e.end == null, c = l ? N : e.end, h = Math.max(0, c - e.start), v = sn(e, E), b = x[n % x.length], y = 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: b, running: l, durationMs: h };
183
+ return /* @__PURE__ */ f(
176
184
  "div",
177
185
  {
178
- className: c(l.row, d?.row),
179
- style: { height: S, opacity: C && !N ? 0.3 : 1 },
186
+ className: d(a.row, u?.row),
187
+ style: { height: L, opacity: E && !v ? 0.3 : 1 },
180
188
  children: [
181
- /* @__PURE__ */ n("div", { className: c(l.rowLabel, d?.rowLabel), children: oe ? oe(e, Me) : /* @__PURE__ */ h(le, { children: [
182
- /* @__PURE__ */ n("span", { className: l.rowName, children: /* @__PURE__ */ n(tn, { text: e.name, query: C }) }),
183
- /* @__PURE__ */ n("span", { className: l.rowDates, children: re(e.start) + (a ? " → now" : " → " + re(o)) })
189
+ /* @__PURE__ */ t("div", { className: d(a.rowLabel, u?.rowLabel), children: me ? me(e, Re) : /* @__PURE__ */ f(oe, { children: [
190
+ /* @__PURE__ */ t("span", { className: a.rowName, children: /* @__PURE__ */ t(un, { text: e.name, query: E }) }),
191
+ /* @__PURE__ */ t("span", { className: a.rowDates, children: ce(e.start) + (l ? " → now" : " → " + ce(c)) })
184
192
  ] }) }),
185
- /* @__PURE__ */ n(
193
+ /* @__PURE__ */ t(
186
194
  "div",
187
195
  {
188
- className: c(l.bar, a && l.barRunning, d?.bar),
196
+ className: d(a.bar, l && a.barRunning, u?.bar),
189
197
  style: {
190
198
  left: y,
191
- top: Math.round((S - dn) / 2),
192
- width: D,
193
- borderColor: M,
194
- background: a ? Qe(M, 72) : M,
195
- boxShadow: C && N ? "0 0 0 3px var(--crk-timeline-hl-ring, #f3d98b)" : "none"
199
+ top: Math.round((L - Nn) / 2),
200
+ width: H,
201
+ borderColor: b,
202
+ background: l ? on(b, 72) : b,
203
+ boxShadow: E && v ? "0 0 0 3px var(--crk-timeline-hl-ring, #f3d98b)" : "none"
196
204
  },
197
205
  onClick: () => {
198
- P.wasDragSuppressed() || (Y(null), te(R === e.id ? null : e));
206
+ C.wasDragSuppressed() || (Y(null), ie(P === e.id ? null : e));
199
207
  },
200
- onMouseEnter: (Ke) => {
201
- if (R === e.id) return;
202
- const Ue = Be(Ke);
208
+ onMouseEnter: (Qe) => {
209
+ if (P === e.id) return;
210
+ const en = je(Qe);
203
211
  Y({
204
- ...Ue,
212
+ ...en,
205
213
  id: e.id,
206
214
  title: e.name,
207
- time: F(e.start) + (a ? "" : " → " + F(o)),
208
- durLine: (a ? "running · " : "took ") + V(m) + (e.owner ? " · " + e.owner : ""),
215
+ time: Z(e.start) + (l ? "" : " → " + Z(c)),
216
+ durLine: (l ? "running · " : "took ") + F(h) + (e.owner ? " · " + e.owner : ""),
209
217
  detail: e.detail || ""
210
218
  });
211
219
  },
212
220
  onMouseLeave: () => Y(null),
213
- children: K ? K(e, Me) : /* @__PURE__ */ h(le, { children: [
214
- a && /* @__PURE__ */ n("span", { className: c(r.pulseDot, l.barDot) }),
215
- xe && /* @__PURE__ */ n("span", { className: l.barTextInside, children: ve })
221
+ children: _ ? _(e, Re) : /* @__PURE__ */ f(oe, { children: [
222
+ l && /* @__PURE__ */ t("span", { className: d(r.pulseDot, a.barDot) }),
223
+ Le && /* @__PURE__ */ t("span", { className: a.barTextInside, children: ke })
216
224
  ] })
217
225
  }
218
226
  ),
219
- !K && !xe && /* @__PURE__ */ n("div", { className: l.barTextOutside, style: { left: y + D + 10 }, children: ve })
227
+ !_ && !Le && /* @__PURE__ */ t("div", { className: a.barTextOutside, style: { left: y + H + 10 }, children: ke })
220
228
  ]
221
229
  },
222
230
  e.id
@@ -225,74 +233,75 @@ const v = 230, be = 24, dn = 26, Mn = Xe(
225
233
  ] })
226
234
  }
227
235
  ) }),
228
- /* @__PURE__ */ n("div", { className: c(r.footnote, d?.footnote), children: "Click a bar to open details in the side panel · dashed bars are still running and keep growing" })
236
+ /* @__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" }),
237
+ T === "bubble" && D
229
238
  ] }),
230
- s && X && /* @__PURE__ */ n("aside", { className: c(r.aside, l.drawer, d?.drawer), children: X(s, {
231
- close: () => te(null),
239
+ s && X && /* @__PURE__ */ t("aside", { className: d(r.aside, a.drawer, u?.drawer), children: X(s, {
240
+ close: () => ie(null),
232
241
  running: s.end == null
233
242
  }) }),
234
- s && !X && /* @__PURE__ */ h("aside", { className: c(r.aside, l.drawer, d?.drawer), children: [
235
- /* @__PURE__ */ h("div", { className: l.drawerHead, children: [
236
- /* @__PURE__ */ n(
243
+ s && !X && /* @__PURE__ */ f("aside", { className: d(r.aside, a.drawer, u?.drawer), children: [
244
+ /* @__PURE__ */ f("div", { className: a.drawerHead, children: [
245
+ /* @__PURE__ */ t(
237
246
  "span",
238
247
  {
239
- className: l.drawerSwatch,
248
+ className: a.drawerSwatch,
240
249
  style: {
241
- background: b[i.indexOf(s) % b.length]
250
+ background: x[i.indexOf(s) % x.length]
242
251
  }
243
252
  }
244
253
  ),
245
- /* @__PURE__ */ n("span", { className: l.drawerOwner, children: s.owner || "—" }),
246
- /* @__PURE__ */ n(
254
+ /* @__PURE__ */ t("span", { className: a.drawerOwner, children: s.owner || "—" }),
255
+ /* @__PURE__ */ t(
247
256
  "span",
248
257
  {
249
- className: c(
250
- l.drawerState,
251
- s.end == null && l.drawerStateRunning
258
+ className: d(
259
+ a.drawerState,
260
+ s.end == null && a.drawerStateRunning
252
261
  ),
253
262
  children: s.end == null ? "running" : "done"
254
263
  }
255
264
  ),
256
- /* @__PURE__ */ n("div", { className: l.drawerSpacer }),
257
- /* @__PURE__ */ n(
265
+ /* @__PURE__ */ t("div", { className: a.drawerSpacer }),
266
+ /* @__PURE__ */ t(
258
267
  "button",
259
268
  {
260
269
  type: "button",
261
270
  className: r.asideClose,
262
271
  "aria-label": "Close details",
263
- onClick: () => te(null),
272
+ onClick: () => ie(null),
264
273
  children: "✕"
265
274
  }
266
275
  )
267
276
  ] }),
268
- /* @__PURE__ */ n("div", { className: l.drawerName, children: s.name }),
269
- /* @__PURE__ */ n("div", { className: l.drawerTiming, children: F(s.start) + " → " + (s.end == null ? "now" : F(s.end)) + " · " + V((s.end == null ? g : s.end) - s.start) }),
270
- /* @__PURE__ */ n("div", { className: l.drawerDetail, children: s.detail || "—" }),
271
- /* @__PURE__ */ n("div", { className: r.asideSection, children: "Raw event" }),
272
- /* @__PURE__ */ n("pre", { className: r.asideRaw, children: JSON.stringify(s, null, 2) })
277
+ /* @__PURE__ */ t("div", { className: a.drawerName, children: s.name }),
278
+ /* @__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) }),
279
+ /* @__PURE__ */ t("div", { className: a.drawerDetail, children: s.detail || "—" }),
280
+ /* @__PURE__ */ t("div", { className: r.asideSection, children: "Raw event" }),
281
+ /* @__PURE__ */ t("pre", { className: r.asideRaw, children: JSON.stringify(s, null, 2) })
273
282
  ] }),
274
- (T === "right" || T === "floating") && O
283
+ (T === "right" || T === "floating") && D
275
284
  ] }),
276
- T === "bottom" && O,
277
- w && (() => {
278
- const e = i.find((a) => a.id === w.id), t = e && U ? U(e, {
285
+ T === "bottom" && D,
286
+ g && (() => {
287
+ const e = i.find((l) => l.id === g.id), n = e && $ ? $(e, {
279
288
  index: i.indexOf(e),
280
- color: b[i.indexOf(e) % b.length],
289
+ color: x[i.indexOf(e) % x.length],
281
290
  running: e.end == null,
282
- durationMs: (e.end == null ? g : e.end) - e.start
291
+ durationMs: (e.end == null ? N : e.end) - e.start
283
292
  }) : void 0;
284
- return U && t == null ? null : /* @__PURE__ */ n(ln, { x: w.x, y: w.y, className: d?.tooltip, children: t !== void 0 ? t : /* @__PURE__ */ h(le, { children: [
285
- /* @__PURE__ */ n("div", { className: r.tooltipTitle, children: w.title }),
286
- /* @__PURE__ */ n(
293
+ return $ && n == null ? null : /* @__PURE__ */ t(mn, { x: g.x, y: g.y, className: u?.tooltip, children: n !== void 0 ? n : /* @__PURE__ */ f(oe, { children: [
294
+ /* @__PURE__ */ t("div", { className: r.tooltipTitle, children: g.title }),
295
+ /* @__PURE__ */ t(
287
296
  "div",
288
297
  {
289
- className: c(r.tooltipLine, r.tooltipMono),
298
+ className: d(r.tooltipLine, r.tooltipMono),
290
299
  style: { marginTop: 4 },
291
- children: w.time
300
+ children: g.time
292
301
  }
293
302
  ),
294
- /* @__PURE__ */ n("div", { className: r.tooltipLine, children: w.durLine }),
295
- w.detail && /* @__PURE__ */ n("div", { className: r.tooltipDim, style: { marginTop: 5 }, children: w.detail })
303
+ /* @__PURE__ */ t("div", { className: r.tooltipLine, children: g.durLine }),
304
+ g.detail && /* @__PURE__ */ t("div", { className: r.tooltipDim, style: { marginTop: 5 }, children: g.detail })
296
305
  ] }) });
297
306
  })()
298
307
  ]
@@ -301,5 +310,5 @@ const v = 230, be = 24, dn = 26, Mn = Xe(
301
310
  }
302
311
  );
303
312
  export {
304
- Mn as GanttTimeline
313
+ Pn as GanttTimeline
305
314
  };