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