@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
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
1
|
+
import { jsx as l, jsxs as u, Fragment as ne } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as st, useRef as L, useState as b, useCallback as q, useEffect as ct, useMemo as xe, useLayoutEffect as dt } from "react";
|
|
3
|
+
import f from "clsx";
|
|
4
4
|
import r from "./Timeline.module.scss.js";
|
|
5
|
-
import
|
|
6
|
-
import { TIMELINE_PALETTE_VARS as
|
|
5
|
+
import i from "./HistoryTimeline.module.scss.js";
|
|
6
|
+
import { TIMELINE_PALETTE_VARS as m, fmtDateTime as R, eventMatches as ut, fmtDur as D, tint as mt, fmtDate as ht, fmtClock as ke, ticks as pt, DAY as E } from "./timelineCore.js";
|
|
7
7
|
import { computeHistoryLayout as ft } from "./historyLayout.js";
|
|
8
8
|
import { TimelineSummary as gt, TimelineSegmented as He, TimelineZoomControls as vt, TimelineLegend as wt, HighlightText as Me, TimelineTooltip as yt } from "./TimelineShared.js";
|
|
9
9
|
import { useNowTicker as Nt, useContainerWidth as St, useTimelinePan as bt, useWheelZoom as Tt, animateScrollTo as xt } from "./useTimeline.js";
|
|
10
10
|
const kt = {
|
|
11
|
-
created:
|
|
12
|
-
done:
|
|
13
|
-
live:
|
|
14
|
-
payment:
|
|
15
|
-
people:
|
|
16
|
-
review:
|
|
17
|
-
action:
|
|
18
|
-
offer:
|
|
19
|
-
fulfilment:
|
|
20
|
-
analysis:
|
|
21
|
-
shipping:
|
|
22
|
-
interview:
|
|
11
|
+
created: m[0],
|
|
12
|
+
done: m[0],
|
|
13
|
+
live: m[0],
|
|
14
|
+
payment: m[1],
|
|
15
|
+
people: m[1],
|
|
16
|
+
review: m[2],
|
|
17
|
+
action: m[2],
|
|
18
|
+
offer: m[2],
|
|
19
|
+
fulfilment: m[3],
|
|
20
|
+
analysis: m[3],
|
|
21
|
+
shipping: m[4],
|
|
22
|
+
interview: m[4],
|
|
23
23
|
exception: "var(--crk-timeline-danger, #b3372f)",
|
|
24
24
|
alert: "var(--crk-timeline-danger, #b3372f)"
|
|
25
|
-
}, Ft =
|
|
25
|
+
}, Ft = st(
|
|
26
26
|
function(Ce, Le) {
|
|
27
27
|
const {
|
|
28
28
|
events: le,
|
|
@@ -33,67 +33,67 @@ const kt = {
|
|
|
33
33
|
spacing: ae,
|
|
34
34
|
defaultSpacing: Pe = "equal",
|
|
35
35
|
onSpacingChange: Oe,
|
|
36
|
-
highlight:
|
|
37
|
-
defaultHighlight:
|
|
38
|
-
onHighlightChange:
|
|
36
|
+
highlight: X,
|
|
37
|
+
defaultHighlight: We,
|
|
38
|
+
onHighlightChange: Re,
|
|
39
39
|
showSearch: Fe = !0,
|
|
40
40
|
renderSearch: re,
|
|
41
41
|
tagColors: se,
|
|
42
42
|
showControls: ce = !0,
|
|
43
43
|
showLegend: Ae = !0,
|
|
44
|
-
showSummary:
|
|
44
|
+
showSummary: F = !1,
|
|
45
45
|
summaryPlacement: H = "left",
|
|
46
46
|
summaryDefaultPosition: Ve,
|
|
47
47
|
maxHeight: de,
|
|
48
|
-
selectedEventId:
|
|
48
|
+
selectedEventId: Z,
|
|
49
49
|
defaultSelectedEventId: ze = null,
|
|
50
50
|
onEventSelect: Ie,
|
|
51
51
|
renderCard: ue,
|
|
52
|
-
renderTooltip:
|
|
53
|
-
renderDetails:
|
|
54
|
-
classes:
|
|
52
|
+
renderTooltip: A,
|
|
53
|
+
renderDetails: K,
|
|
54
|
+
classes: h,
|
|
55
55
|
className: Ye,
|
|
56
56
|
style: je
|
|
57
|
-
} = Ce,
|
|
57
|
+
} = Ce, w = L(null), [qe, Xe] = b(
|
|
58
58
|
() => De ?? (typeof window < "u" && window.innerWidth < 700 ? "vertical" : "horizontal")
|
|
59
|
-
),
|
|
60
|
-
fe.current =
|
|
61
|
-
const
|
|
62
|
-
const e =
|
|
59
|
+
), V = ie ?? qe, y = V === "horizontal", [Ze, Ke] = b(Pe), U = ae ?? Ze, [Ue, me] = b(1), [he, pe] = b(!0), [S, _] = b(null), [_e, Ge] = b(ze), P = Z !== void 0 ? Z : _e, [N, Be] = b({ l: 0, t: 0, w: 0, h: 0 }), fe = L(F);
|
|
60
|
+
fe.current = F;
|
|
61
|
+
const G = L(null), B = q(() => {
|
|
62
|
+
const e = w.current;
|
|
63
63
|
e && Be(
|
|
64
64
|
(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 }
|
|
65
65
|
);
|
|
66
|
-
}, []), Je =
|
|
67
|
-
!fe.current ||
|
|
68
|
-
|
|
66
|
+
}, []), Je = q(() => {
|
|
67
|
+
!fe.current || G.current != null || (G.current = requestAnimationFrame(() => {
|
|
68
|
+
G.current = null, B();
|
|
69
69
|
}));
|
|
70
|
-
}, [
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
}, [B]);
|
|
71
|
+
ct(() => {
|
|
72
|
+
F && B();
|
|
73
73
|
});
|
|
74
|
-
const [$e, Qe] =
|
|
75
|
-
|
|
76
|
-
}, ve = re ? re({ value:
|
|
74
|
+
const [$e, Qe] = b(We ?? ""), J = X !== void 0 ? X : $e, T = J.trim(), ge = (e) => {
|
|
75
|
+
X === void 0 && Qe(e), Re?.(e);
|
|
76
|
+
}, ve = re ? re({ value: J, setValue: ge }) : Fe ? /* @__PURE__ */ l(
|
|
77
77
|
"input",
|
|
78
78
|
{
|
|
79
|
-
className:
|
|
79
|
+
className: f(r.searchInput, h?.search),
|
|
80
80
|
placeholder: "Highlight keyword in events…",
|
|
81
81
|
"aria-label": "Highlight keyword",
|
|
82
|
-
value:
|
|
82
|
+
value: J,
|
|
83
83
|
onChange: (e) => ge(e.target.value)
|
|
84
84
|
}
|
|
85
|
-
) : null, c =
|
|
85
|
+
) : null, c = xe(
|
|
86
86
|
() => le.map((e) => ({
|
|
87
87
|
...e,
|
|
88
88
|
end: e.end !== void 0 ? e.end : e.ongoing ? null : e.start
|
|
89
89
|
})).sort((e, n) => e.start - n.start),
|
|
90
90
|
[le]
|
|
91
|
-
), et = c.some((e) => e.end == null),
|
|
91
|
+
), et = c.some((e) => e.end == null), x = Nt(et, 500), tt = St(w), O = bt(w), M = q(
|
|
92
92
|
(e) => {
|
|
93
93
|
const n = e || "event", t = { ...kt, ...se };
|
|
94
94
|
if (t[n]) return t[n];
|
|
95
|
-
const
|
|
96
|
-
return
|
|
95
|
+
const o = String(n).charCodeAt(0) || 0;
|
|
96
|
+
return m[(String(n).length + o) % m.length];
|
|
97
97
|
},
|
|
98
98
|
[se]
|
|
99
99
|
), s = ft(
|
|
@@ -105,112 +105,112 @@ const kt = {
|
|
|
105
105
|
end: e.end ?? null
|
|
106
106
|
})),
|
|
107
107
|
{
|
|
108
|
-
orientation:
|
|
109
|
-
spacing:
|
|
108
|
+
orientation: V,
|
|
109
|
+
spacing: U,
|
|
110
110
|
containerWidth: tt,
|
|
111
111
|
viewportHeight: typeof window < "u" && window.innerHeight || 800,
|
|
112
|
-
now:
|
|
112
|
+
now: x,
|
|
113
113
|
k: he ? "fit" : Ue
|
|
114
114
|
}
|
|
115
|
-
),
|
|
115
|
+
), z = new Map(s.items.map((e) => [e.id, e])), we = L(s.kFit), ye = L(s.kEff);
|
|
116
116
|
we.current = s.kFit, ye.current = s.kEff;
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
const e =
|
|
120
|
-
|
|
117
|
+
const k = L(null);
|
|
118
|
+
dt(() => {
|
|
119
|
+
const e = w.current;
|
|
120
|
+
k.current && e && (k.current.left != null && (e.scrollLeft = k.current.left), k.current.top != null && (e.scrollTop = k.current.top), k.current = null);
|
|
121
121
|
});
|
|
122
|
-
const
|
|
122
|
+
const $ = q(
|
|
123
123
|
(e, n) => {
|
|
124
|
-
const t =
|
|
124
|
+
const t = w.current;
|
|
125
125
|
if (!t) return;
|
|
126
|
-
const
|
|
127
|
-
|
|
126
|
+
const o = we.current || 1, p = ye.current || 1, d = Math.max(o * 0.3, Math.min(Math.max(o, 1) * 40, p * e)), g = y ? t.scrollLeft : t.scrollTop, v = d / p;
|
|
127
|
+
k.current = y ? { left: (g + n) * v - n } : { top: (g + n) * v - n }, pe(!1), me(d);
|
|
128
128
|
},
|
|
129
|
-
[
|
|
129
|
+
[y]
|
|
130
130
|
);
|
|
131
131
|
Tt(
|
|
132
|
-
|
|
132
|
+
w,
|
|
133
133
|
(e) => {
|
|
134
134
|
e.preventDefault();
|
|
135
|
-
const n =
|
|
135
|
+
const n = w.current;
|
|
136
136
|
if (!n) return;
|
|
137
|
-
const t = n.getBoundingClientRect(),
|
|
138
|
-
|
|
137
|
+
const t = n.getBoundingClientRect(), o = y ? e.clientX - t.left : e.clientY - t.top;
|
|
138
|
+
$(Math.exp(-(e.deltaY || e.deltaX) * 22e-4), o);
|
|
139
139
|
},
|
|
140
|
-
|
|
140
|
+
V
|
|
141
141
|
);
|
|
142
142
|
const Ne = () => {
|
|
143
|
-
const e =
|
|
144
|
-
return e ?
|
|
145
|
-
},
|
|
146
|
-
|
|
143
|
+
const e = w.current;
|
|
144
|
+
return e ? y ? e.clientWidth / 2 : e.clientHeight / 2 : 300;
|
|
145
|
+
}, Q = (e) => {
|
|
146
|
+
Z === void 0 && Ge(e ? e.id : null), Ie?.(e);
|
|
147
147
|
}, nt = (e) => {
|
|
148
148
|
ie === void 0 && Xe(e), Ee?.(e);
|
|
149
149
|
}, lt = (e) => {
|
|
150
150
|
ae === void 0 && Ke(e), Oe?.(e);
|
|
151
151
|
}, ot = (e) => {
|
|
152
|
-
const n = window.innerWidth || 1200, t = window.innerHeight || 800,
|
|
153
|
-
return { x:
|
|
154
|
-
},
|
|
152
|
+
const n = window.innerWidth || 1200, t = window.innerHeight || 800, o = e.clientX < n * 0.55 ? Math.max(12, n - 340) : 16, p = Math.max(130, Math.min(e.clientY, t - 130));
|
|
153
|
+
return { x: o, y: p };
|
|
154
|
+
}, W = c.length ? c[0].start : x, it = c.length ? Math.max(W + 1, ...c.map((e) => e.end == null ? x : Math.max(e.end, e.start))) : x + 1, I = Math.max(1, it - W), Se = (e, n) => {
|
|
155
155
|
const t = new Date(e);
|
|
156
|
-
return n === "y" ? String(t.getFullYear()) : n === "my" ? t.toLocaleString("en", { month: "short" }) + " " + t.getFullYear() : n === "d" ?
|
|
156
|
+
return n === "y" ? String(t.getFullYear()) : n === "my" ? t.toLocaleString("en", { month: "short" }) + " " + t.getFullYear() : n === "d" ? ht(e) : n === "cms" ? ke(e, !0) : ke(e);
|
|
157
157
|
};
|
|
158
158
|
let ee = [];
|
|
159
|
-
if (
|
|
160
|
-
const e =
|
|
161
|
-
ee =
|
|
162
|
-
pos: Math.round(
|
|
163
|
-
label:
|
|
159
|
+
if (U === "proportional" && s.mapT) {
|
|
160
|
+
const e = s.mapT, n = e(W), t = y ? s.innerW : s.innerH, o = W + (t - n) / Math.max(1, s.innerSpan) * I, p = pt(W, o, Math.max(200, t - n), 90), d = p.step >= 360 * E ? "y" : p.step >= 28 * E ? "my" : p.step >= E ? "d" : p.step < 1e3 ? "cms" : "c";
|
|
161
|
+
ee = p.list.map((g) => ({
|
|
162
|
+
pos: Math.round(e(g.t)),
|
|
163
|
+
label: Se(g.t, d)
|
|
164
164
|
}));
|
|
165
165
|
} else {
|
|
166
|
-
const e =
|
|
167
|
-
let t = null,
|
|
168
|
-
c.forEach((
|
|
169
|
-
const
|
|
170
|
-
|
|
166
|
+
const e = I > 550 * E ? "y" : I > 60 * E ? "my" : I > 2 * E ? "d" : "c", n = y ? 72 : 18;
|
|
167
|
+
let t = null, o = -1e9;
|
|
168
|
+
c.forEach((p, d) => {
|
|
169
|
+
const g = Se(p.start, e), v = Math.round(s.posArr[d]);
|
|
170
|
+
g !== t && v - o >= n && (ee.push({ pos: v, label: g }), t = g, o = v);
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
|
-
const
|
|
173
|
+
const at = xe(() => {
|
|
174
174
|
const e = [];
|
|
175
175
|
return c.forEach((n) => {
|
|
176
176
|
const t = n.tag || "event";
|
|
177
177
|
e.includes(t) || e.push(t);
|
|
178
178
|
}), e;
|
|
179
|
-
}, [c]), a = P != null && c.find((e) => e.id === P) || null,
|
|
179
|
+
}, [c]), a = P != null && c.find((e) => e.id === P) || null, be = a ? a.end == null : !1, Y = F ? /* @__PURE__ */ l(
|
|
180
180
|
gt,
|
|
181
181
|
{
|
|
182
|
-
className:
|
|
182
|
+
className: h?.summary,
|
|
183
183
|
placement: H,
|
|
184
184
|
floatingDefaultPosition: Ve,
|
|
185
185
|
items: c.map((e, n) => {
|
|
186
|
-
const t =
|
|
186
|
+
const t = z.get(e.id), o = !t || !N.w && !N.h ? !0 : (!N.w || t.cardLeft < N.l + N.w && t.cardLeft + t.cardW > N.l) && (!N.h || t.cardTop < N.t + N.h && t.cardTop + t.cardH > N.t);
|
|
187
187
|
return {
|
|
188
188
|
id: e.id,
|
|
189
189
|
number: String(n + 1).padStart(2, "0"),
|
|
190
190
|
label: e.title,
|
|
191
191
|
color: M(e.tag),
|
|
192
192
|
time: R(e.start),
|
|
193
|
-
inView:
|
|
193
|
+
inView: o,
|
|
194
194
|
selected: P === e.id
|
|
195
195
|
};
|
|
196
196
|
}),
|
|
197
197
|
onPick: (e) => {
|
|
198
|
-
const n =
|
|
198
|
+
const n = z.get(e), t = w.current;
|
|
199
199
|
if (!n || !t) return;
|
|
200
|
-
const
|
|
201
|
-
(t.clientWidth || !t.clientHeight) && (
|
|
200
|
+
const o = {};
|
|
201
|
+
(t.clientWidth || !t.clientHeight) && (o.left = Math.max(0, n.dotX - t.clientWidth / 2)), t.clientHeight && (o.top = Math.max(0, n.dotY - t.clientHeight / 2)), xt(t, o);
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
) : null;
|
|
205
|
-
return /* @__PURE__ */
|
|
206
|
-
(ce || ve) && /* @__PURE__ */
|
|
205
|
+
return /* @__PURE__ */ u("div", { ref: Le, className: f(r.root, h?.root, Ye), style: je, children: [
|
|
206
|
+
(ce || ve) && /* @__PURE__ */ u("div", { className: f(r.toolbar, h?.toolbar), children: [
|
|
207
207
|
/* @__PURE__ */ l("div", { className: r.toolbarText }),
|
|
208
208
|
ve,
|
|
209
|
-
ce && /* @__PURE__ */
|
|
209
|
+
ce && /* @__PURE__ */ u(ne, { children: [
|
|
210
210
|
/* @__PURE__ */ l(
|
|
211
211
|
He,
|
|
212
212
|
{
|
|
213
|
-
value:
|
|
213
|
+
value: V,
|
|
214
214
|
options: [
|
|
215
215
|
{ value: "horizontal", label: "Horizontal" },
|
|
216
216
|
{ value: "vertical", label: "Vertical" }
|
|
@@ -221,7 +221,7 @@ const kt = {
|
|
|
221
221
|
/* @__PURE__ */ l(
|
|
222
222
|
He,
|
|
223
223
|
{
|
|
224
|
-
value:
|
|
224
|
+
value: U,
|
|
225
225
|
options: [
|
|
226
226
|
{ value: "equal", label: "Equal" },
|
|
227
227
|
{
|
|
@@ -239,8 +239,8 @@ const kt = {
|
|
|
239
239
|
{
|
|
240
240
|
zoomPct: `${Math.round(s.kEff / s.kFit * 100)}%`,
|
|
241
241
|
fitActive: he,
|
|
242
|
-
onZoomIn: () =>
|
|
243
|
-
onZoomOut: () =>
|
|
242
|
+
onZoomIn: () => $(1.5, Ne()),
|
|
243
|
+
onZoomOut: () => $(1 / 1.5, Ne()),
|
|
244
244
|
onFit: () => {
|
|
245
245
|
pe(!0), me(1);
|
|
246
246
|
}
|
|
@@ -251,22 +251,22 @@ const kt = {
|
|
|
251
251
|
Ae && /* @__PURE__ */ l(
|
|
252
252
|
wt,
|
|
253
253
|
{
|
|
254
|
-
className:
|
|
255
|
-
items:
|
|
254
|
+
className: h?.legend,
|
|
255
|
+
items: at.map((e) => ({ name: e, color: M(e) }))
|
|
256
256
|
}
|
|
257
257
|
),
|
|
258
|
-
H === "top" &&
|
|
259
|
-
/* @__PURE__ */
|
|
260
|
-
H === "left" &&
|
|
261
|
-
/* @__PURE__ */
|
|
262
|
-
/* @__PURE__ */ l("div", { className:
|
|
258
|
+
H === "top" && Y,
|
|
259
|
+
/* @__PURE__ */ u("div", { className: r.layout, children: [
|
|
260
|
+
H === "left" && Y,
|
|
261
|
+
/* @__PURE__ */ u("div", { className: r.main, children: [
|
|
262
|
+
/* @__PURE__ */ l("div", { className: f(r.card, h?.card), children: /* @__PURE__ */ l(
|
|
263
263
|
"div",
|
|
264
264
|
{
|
|
265
|
-
ref:
|
|
266
|
-
className:
|
|
265
|
+
ref: w,
|
|
266
|
+
className: f(
|
|
267
267
|
r.scroller,
|
|
268
|
-
|
|
269
|
-
|
|
268
|
+
y ? i.scrollerH : i.scrollerV,
|
|
269
|
+
h?.scroller
|
|
270
270
|
),
|
|
271
271
|
style: de != null ? { maxHeight: de } : void 0,
|
|
272
272
|
onPointerDown: O.onPointerDown,
|
|
@@ -274,44 +274,44 @@ const kt = {
|
|
|
274
274
|
onPointerUp: O.onPointerUp,
|
|
275
275
|
onPointerLeave: O.onPointerUp,
|
|
276
276
|
onScroll: Je,
|
|
277
|
-
children: /* @__PURE__ */
|
|
277
|
+
children: /* @__PURE__ */ u(
|
|
278
278
|
"div",
|
|
279
279
|
{
|
|
280
|
-
className:
|
|
280
|
+
className: i.inner,
|
|
281
281
|
style: { width: s.innerW, height: s.innerH },
|
|
282
282
|
children: [
|
|
283
283
|
ee.map(
|
|
284
|
-
(e, n) =>
|
|
285
|
-
/* @__PURE__ */ l("span", { className:
|
|
286
|
-
/* @__PURE__ */ l("span", { className:
|
|
287
|
-
] }, n) : /* @__PURE__ */
|
|
288
|
-
/* @__PURE__ */ l("span", { className:
|
|
289
|
-
/* @__PURE__ */ l("span", { className:
|
|
284
|
+
(e, n) => y ? /* @__PURE__ */ u("span", { children: [
|
|
285
|
+
/* @__PURE__ */ l("span", { className: i.gridlineH, style: { left: e.pos } }),
|
|
286
|
+
/* @__PURE__ */ l("span", { className: i.tickLabelH, style: { left: e.pos }, children: e.label })
|
|
287
|
+
] }, n) : /* @__PURE__ */ u("span", { children: [
|
|
288
|
+
/* @__PURE__ */ l("span", { className: i.gridlineV, style: { top: e.pos } }),
|
|
289
|
+
/* @__PURE__ */ l("span", { className: i.tickLabelV, style: { top: e.pos }, children: e.label })
|
|
290
290
|
] }, n)
|
|
291
291
|
),
|
|
292
|
-
|
|
292
|
+
y ? /* @__PURE__ */ l("div", { className: i.axisH, style: { top: s.axisY } }) : /* @__PURE__ */ l("div", { className: i.axisV, style: { left: s.axisX } }),
|
|
293
293
|
c.map((e, n) => {
|
|
294
|
-
const t =
|
|
294
|
+
const t = z.get(e.id);
|
|
295
295
|
if (!t) return null;
|
|
296
|
-
const
|
|
296
|
+
const o = e.end == null, d = (o ? x : e.end) - e.start, g = o || d > 0, v = ut(e, T), j = M(e.tag), Te = {
|
|
297
297
|
index: n,
|
|
298
298
|
number: String(n + 1).padStart(2, "0"),
|
|
299
|
-
color:
|
|
300
|
-
ongoing:
|
|
299
|
+
color: j,
|
|
300
|
+
ongoing: o,
|
|
301
301
|
condensed: t.condensed,
|
|
302
|
-
durationMs:
|
|
302
|
+
durationMs: d
|
|
303
303
|
};
|
|
304
|
-
return /* @__PURE__ */
|
|
304
|
+
return /* @__PURE__ */ u("span", { children: [
|
|
305
305
|
t.segs.map((C, te) => /* @__PURE__ */ l(
|
|
306
306
|
"span",
|
|
307
307
|
{
|
|
308
|
-
className:
|
|
308
|
+
className: i.seg,
|
|
309
309
|
style: {
|
|
310
310
|
left: C.l,
|
|
311
311
|
top: C.t,
|
|
312
312
|
width: C.w,
|
|
313
313
|
height: C.h,
|
|
314
|
-
background:
|
|
314
|
+
background: j
|
|
315
315
|
}
|
|
316
316
|
},
|
|
317
317
|
te
|
|
@@ -319,53 +319,53 @@ const kt = {
|
|
|
319
319
|
/* @__PURE__ */ l(
|
|
320
320
|
"span",
|
|
321
321
|
{
|
|
322
|
-
className:
|
|
323
|
-
style: { left: t.dotX, top: t.dotY, borderColor:
|
|
322
|
+
className: f(i.dot, h?.dot),
|
|
323
|
+
style: { left: t.dotX, top: t.dotY, borderColor: j }
|
|
324
324
|
}
|
|
325
325
|
),
|
|
326
326
|
/* @__PURE__ */ l(
|
|
327
327
|
"div",
|
|
328
328
|
{
|
|
329
|
-
className:
|
|
329
|
+
className: f(i.eventCard, h?.eventCard),
|
|
330
330
|
style: {
|
|
331
331
|
left: t.cardLeft,
|
|
332
332
|
top: t.cardTop,
|
|
333
333
|
width: t.cardW,
|
|
334
334
|
height: t.cardH,
|
|
335
|
-
opacity:
|
|
336
|
-
background:
|
|
337
|
-
borderColor:
|
|
338
|
-
boxShadow:
|
|
335
|
+
opacity: T && !v ? 0.3 : 1,
|
|
336
|
+
background: T && v ? "var(--crk-timeline-hl-wash-soft, #fff9e8)" : void 0,
|
|
337
|
+
borderColor: T && v ? "var(--crk-timeline-hl-border, #e8b931)" : void 0,
|
|
338
|
+
boxShadow: T && v ? "0 0 0 3px #f9e9b8" : "0 1px 3px rgba(35,32,28,.06)"
|
|
339
339
|
},
|
|
340
340
|
onClick: () => {
|
|
341
|
-
O.wasDragSuppressed() || (
|
|
341
|
+
O.wasDragSuppressed() || (_(null), Q(P === e.id ? null : e));
|
|
342
342
|
},
|
|
343
343
|
onMouseEnter: (C) => {
|
|
344
344
|
if (P === e.id) return;
|
|
345
345
|
const te = (e.detail || "").length > 80;
|
|
346
|
-
if (!
|
|
347
|
-
const
|
|
348
|
-
|
|
349
|
-
...
|
|
346
|
+
if (!A && !te && !o) return;
|
|
347
|
+
const rt = ot(C);
|
|
348
|
+
_({
|
|
349
|
+
...rt,
|
|
350
350
|
id: e.id,
|
|
351
351
|
title: e.title,
|
|
352
352
|
time: R(e.start),
|
|
353
|
-
durLine:
|
|
353
|
+
durLine: o ? "ongoing · " + D(d) + " so far" : d > 0 ? "duration " + D(d) : "instant event",
|
|
354
354
|
detail: e.detail || ""
|
|
355
355
|
});
|
|
356
356
|
},
|
|
357
|
-
onMouseLeave: () =>
|
|
358
|
-
children: ue ? ue(e,
|
|
359
|
-
/* @__PURE__ */
|
|
360
|
-
/* @__PURE__ */ l("span", { className:
|
|
357
|
+
onMouseLeave: () => _(null),
|
|
358
|
+
children: ue ? ue(e, Te) : /* @__PURE__ */ u(ne, { children: [
|
|
359
|
+
/* @__PURE__ */ u("div", { className: i.cardTitle, children: [
|
|
360
|
+
/* @__PURE__ */ l("span", { className: i.cardNum, children: Te.number }),
|
|
361
361
|
" ",
|
|
362
|
-
/* @__PURE__ */ l("span", { className:
|
|
363
|
-
/* @__PURE__ */ l(Me, { text: e.title, query:
|
|
364
|
-
|
|
362
|
+
/* @__PURE__ */ l("span", { className: i.cardTagDot, style: { background: j } }),
|
|
363
|
+
/* @__PURE__ */ l(Me, { text: e.title, query: T }),
|
|
364
|
+
o && /* @__PURE__ */ l("span", { className: f(r.pulseDot, i.cardOngoingDot) })
|
|
365
365
|
] }),
|
|
366
|
-
/* @__PURE__ */ l("div", { className:
|
|
367
|
-
!t.condensed && !!e.detail && /* @__PURE__ */ l("div", { className:
|
|
368
|
-
|
|
366
|
+
/* @__PURE__ */ l("div", { className: i.cardTime, children: R(e.start) }),
|
|
367
|
+
!t.condensed && !!e.detail && /* @__PURE__ */ l("div", { className: i.cardDetail, children: /* @__PURE__ */ l(Me, { text: e.detail, query: T }) }),
|
|
368
|
+
g && /* @__PURE__ */ l("div", { className: i.cardDur, children: o ? "ongoing · " + D(d) : "took " + D(d) })
|
|
369
369
|
] })
|
|
370
370
|
}
|
|
371
371
|
)
|
|
@@ -376,65 +376,65 @@ const kt = {
|
|
|
376
376
|
)
|
|
377
377
|
}
|
|
378
378
|
) }),
|
|
379
|
-
/* @__PURE__ */ l("div", { className:
|
|
379
|
+
/* @__PURE__ */ l("div", { className: f(r.footnote, h?.footnote), children: "Click a card to open details in the side panel · scroll zooms · drag pans · overlapping events stack around the axis with Z-shaped leads" })
|
|
380
380
|
] }),
|
|
381
|
-
a &&
|
|
382
|
-
a && !
|
|
383
|
-
/* @__PURE__ */
|
|
381
|
+
a && K && /* @__PURE__ */ l("aside", { className: f(r.aside, i.drawer, h?.drawer), children: K(a, { close: () => Q(null), ongoing: be }) }),
|
|
382
|
+
a && !K && /* @__PURE__ */ u("aside", { className: f(r.aside, i.drawer, h?.drawer), children: [
|
|
383
|
+
/* @__PURE__ */ u("div", { className: i.drawerHead, children: [
|
|
384
384
|
/* @__PURE__ */ l(
|
|
385
385
|
"span",
|
|
386
386
|
{
|
|
387
|
-
className:
|
|
387
|
+
className: i.drawerTag,
|
|
388
388
|
style: {
|
|
389
|
-
background:
|
|
389
|
+
background: mt(M(a.tag), 12),
|
|
390
390
|
color: M(a.tag)
|
|
391
391
|
},
|
|
392
392
|
children: a.tag || "event"
|
|
393
393
|
}
|
|
394
394
|
),
|
|
395
|
-
(oe ?? a.subject) != null && /* @__PURE__ */ l("span", { className:
|
|
396
|
-
/* @__PURE__ */ l("div", { className:
|
|
395
|
+
(oe ?? a.subject) != null && /* @__PURE__ */ l("span", { className: i.drawerSubject, children: oe ?? a.subject }),
|
|
396
|
+
/* @__PURE__ */ l("div", { className: i.drawerSpacer }),
|
|
397
397
|
/* @__PURE__ */ l(
|
|
398
398
|
"button",
|
|
399
399
|
{
|
|
400
400
|
type: "button",
|
|
401
401
|
className: r.asideClose,
|
|
402
402
|
"aria-label": "Close details",
|
|
403
|
-
onClick: () =>
|
|
403
|
+
onClick: () => Q(null),
|
|
404
404
|
children: "✕"
|
|
405
405
|
}
|
|
406
406
|
)
|
|
407
407
|
] }),
|
|
408
|
-
/* @__PURE__ */ l("div", { className:
|
|
409
|
-
/* @__PURE__ */ l("div", { className:
|
|
410
|
-
/* @__PURE__ */ l("div", { className:
|
|
408
|
+
/* @__PURE__ */ l("div", { className: i.drawerTitle, children: a.title }),
|
|
409
|
+
/* @__PURE__ */ l("div", { className: i.drawerTiming, children: R(a.start) + (be ? " · ongoing, " + D(x - a.start) + " so far" : a.end > a.start ? " → " + R(a.end) + " · " + D(a.end - a.start) : "") }),
|
|
410
|
+
/* @__PURE__ */ l("div", { className: i.drawerDetail, children: a.detail || "—" }),
|
|
411
411
|
/* @__PURE__ */ l("div", { className: r.asideSection, children: "Raw event" }),
|
|
412
412
|
/* @__PURE__ */ l("pre", { className: r.asideRaw, children: JSON.stringify(a, null, 2) })
|
|
413
413
|
] }),
|
|
414
|
-
(H === "right" || H === "floating") &&
|
|
414
|
+
(H === "right" || H === "floating") && Y
|
|
415
415
|
] }),
|
|
416
|
-
H === "bottom" &&
|
|
417
|
-
|
|
418
|
-
const e = c.find((
|
|
416
|
+
H === "bottom" && Y,
|
|
417
|
+
S && (() => {
|
|
418
|
+
const e = c.find((o) => o.id === S.id), n = e ? c.indexOf(e) : -1, t = e && A ? A(e, {
|
|
419
419
|
index: n,
|
|
420
420
|
number: String(n + 1).padStart(2, "0"),
|
|
421
421
|
color: M(e.tag),
|
|
422
422
|
ongoing: e.end == null,
|
|
423
|
-
condensed:
|
|
424
|
-
durationMs: (e.end == null ?
|
|
423
|
+
condensed: z.get(e.id)?.condensed ?? !1,
|
|
424
|
+
durationMs: (e.end == null ? x : e.end) - e.start
|
|
425
425
|
}) : void 0;
|
|
426
|
-
return
|
|
427
|
-
/* @__PURE__ */ l("div", { className: r.tooltipTitle, children:
|
|
426
|
+
return A && t == null ? null : /* @__PURE__ */ l(yt, { x: S.x, y: S.y, className: h?.tooltip, children: t !== void 0 ? t : /* @__PURE__ */ u(ne, { children: [
|
|
427
|
+
/* @__PURE__ */ l("div", { className: r.tooltipTitle, children: S.title }),
|
|
428
428
|
/* @__PURE__ */ l(
|
|
429
429
|
"div",
|
|
430
430
|
{
|
|
431
|
-
className:
|
|
431
|
+
className: f(r.tooltipLine, r.tooltipMono),
|
|
432
432
|
style: { marginTop: 4 },
|
|
433
|
-
children:
|
|
433
|
+
children: S.time
|
|
434
434
|
}
|
|
435
435
|
),
|
|
436
|
-
/* @__PURE__ */ l("div", { className: r.tooltipLine, children:
|
|
437
|
-
|
|
436
|
+
/* @__PURE__ */ l("div", { className: r.tooltipLine, children: S.durLine }),
|
|
437
|
+
S.detail && /* @__PURE__ */ l("div", { className: r.tooltipDim, style: { marginTop: 5 }, children: S.detail })
|
|
438
438
|
] }) });
|
|
439
439
|
})()
|
|
440
440
|
] });
|