@lincyaw/aegis-ui 0.13.0 → 0.14.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,139 +1,144 @@
1
- import { jsx as r, jsxs as $, Fragment as T } from "react/jsx-runtime";
2
- import { useMemo as A, useId as O, useState as H } from "react";
3
- import { Tooltip as G } from "antd";
4
- import { useMediaQuery as P } from "../../hooks/useMediaQuery.js";
1
+ import { jsx as r, jsxs as w, Fragment as I } from "react/jsx-runtime";
2
+ import { useMemo as H, useId as O, useState as P, Fragment as G } from "react";
3
+ import { Tooltip as F } from "antd";
4
+ import { useMediaQuery as U } from "../../hooks/useMediaQuery.js";
5
5
  import { Checkbox as W } from "./Checkbox.js";
6
6
  import { Chip as Q } from "./Chip.js";
7
7
  /* empty css */
8
- import { useStrings as B } from "../../locale/useStrings.js";
9
- const k = 36, L = 16, U = 104, X = 56, Y = 4, F = "(max-width: 640px)";
10
- function K(a, e, s) {
11
- const i = [], t = /* @__PURE__ */ new Map(), o = [], f = () => {
12
- const n = i.indexOf(null);
13
- return n === -1 ? i.length : n;
8
+ import { useStrings as y } from "../../locale/useStrings.js";
9
+ const L = 36, k = 16, X = 104, Y = 56, q = 4, K = "(max-width: 640px)", A = "aegis-commit-graph__part--cut";
10
+ function z(e, a, s) {
11
+ const i = [], t = /* @__PURE__ */ new Map(), o = [], g = () => {
12
+ const c = i.indexOf(null);
13
+ return c === -1 ? i.length : c;
14
14
  };
15
- let l = 0;
16
- for (const { commit: n, row: g } of a) {
17
- const p = i.flatMap(
18
- (d, _) => d === n.id ? [_] : []
15
+ let n = 0;
16
+ for (const { commit: c, row: m } of e) {
17
+ const _ = i.flatMap(
18
+ (h, f) => h === c.id ? [f] : []
19
19
  );
20
- p.forEach((d) => {
21
- i[d] = null;
20
+ _.forEach((h) => {
21
+ i[h] = null;
22
22
  });
23
- const m = p.length > 0 ? p[0] : f();
24
- i[m] = null, t.set(g, m), n.parents.filter((d) => !e.has(d) || s(d)).forEach((d, _) => {
25
- const N = i.indexOf(d), c = _ === 0 ? m : N === -1 ? f() : N;
26
- i[c] = d, o.push({ from: g, to: e.get(d) ?? -1, via: c, parent: d });
27
- }), l = Math.max(l, i.length, m + 1);
23
+ const p = _.length > 0 ? _[0] : g();
24
+ i[p] = null, t.set(m, p), c.parents.filter((h) => !a.has(h) || s(h)).forEach((h, f) => {
25
+ const $ = i.indexOf(h), l = f === 0 ? p : $ === -1 ? g() : $;
26
+ i[l] = h, o.push({ from: m, to: a.get(h) ?? -1, via: l, parent: h });
27
+ }), n = Math.max(n, i.length, p + 1);
28
28
  }
29
- return { trackOf: t, edges: o, tracks: l };
29
+ return { trackOf: t, edges: o, tracks: n };
30
30
  }
31
- function q(a, e, s) {
32
- const i = new Map(a.map((c, u) => [c.id, u])), t = e?.map((c) => c.id) ?? [void 0], o = new Set(t), f = (c) => o.has(c.lane) ? c.lane : t[0], l = a.map(() => 0), n = a.map(() => {
33
- }), g = [], p = [];
34
- let m = 0;
35
- for (const [c, u] of t.entries()) {
36
- const w = a.flatMap(
37
- (h, b) => f(h) === u ? [{ commit: h, row: b }] : []
31
+ function J(e, a, s) {
32
+ const i = new Map(e.map((l, S) => [l.id, S])), t = a?.map((l) => l.id) ?? [void 0], o = new Set(t), g = (l) => o.has(l.lane) ? l.lane : t[0], n = e.map(() => 0), c = e.map(() => {
33
+ }), m = [], _ = [];
34
+ let p = 0;
35
+ for (const [l, S] of t.entries()) {
36
+ const v = e.flatMap(
37
+ (d, b) => g(d) === S ? [{ commit: d, row: b }] : []
38
38
  );
39
- w.forEach(({ row: h }) => {
40
- n[h] = e?.[c].label;
39
+ v.forEach(({ row: d }) => {
40
+ c[d] = a?.[l].label;
41
41
  });
42
- const x = new Set(w.map(({ commit: h }) => h.id)), v = K(w, i, (h) => x.has(h)), E = Math.max(v.tracks, 1) * L, I = e === void 0 ? E : Math.max(E, s), M = (h) => m + (I - E) / 2 + (h + 0.5) * L;
43
- v.trackOf.forEach((h, b) => {
44
- l[b] = M(h);
45
- }), v.edges.forEach((h) => {
46
- const b = h.to === -1 ? a.length : h.to;
47
- g.push({
48
- from: h.from,
42
+ const N = new Set(v.map(({ commit: d }) => d.id)), x = z(v, i, (d) => N.has(d)), T = Math.max(x.tracks, 1) * k, E = a === void 0 ? T : Math.max(T, s), C = (d) => p + (E - T) / 2 + (d + 0.5) * k;
43
+ x.trackOf.forEach((d, b) => {
44
+ n[b] = C(d);
45
+ }), x.edges.forEach((d) => {
46
+ const b = d.to === -1 ? e.length : d.to;
47
+ m.push({
48
+ from: d.from,
49
49
  to: b,
50
- fromX: l[h.from],
51
- toX: h.to === -1 ? M(h.via) : M(v.trackOf.get(b) ?? 0),
52
- viaX: M(h.via)
50
+ fromX: n[d.from],
51
+ toX: d.to === -1 ? C(d.via) : C(x.trackOf.get(b) ?? 0),
52
+ viaX: C(d.via)
53
53
  });
54
- }), p.push({ x: m, width: I }), m += I;
54
+ }), _.push({ x: p, width: E }), p += E;
55
55
  }
56
- const d = a.flatMap(
57
- (c, u) => (c.links ?? []).flatMap((w) => {
58
- const x = i.get(w);
59
- return x === void 0 ? [] : [{ from: u, to: x, fromX: l[u], toX: l[x] }];
56
+ const h = e.flatMap(
57
+ (l, S) => (l.links ?? []).flatMap((v) => {
58
+ const N = i.get(v);
59
+ return N === void 0 ? [] : [{ from: S, to: N, fromX: n[S], toX: n[N] }];
60
60
  })
61
- ), _ = /* @__PURE__ */ new Map();
62
- g.forEach((c) => {
63
- _.set(c.from, (_.get(c.from) ?? 0) + 1);
61
+ ), f = /* @__PURE__ */ new Map();
62
+ m.forEach((l) => {
63
+ f.set(l.from, (f.get(l.from) ?? 0) + 1);
64
64
  });
65
- const N = a.map((c, u) => (_.get(u) ?? 0) > 1);
66
- return { dotX: l, merge: N, laneLabel: n, edges: g, links: d, lanes: p, width: m };
65
+ const $ = e.map((l, S) => (f.get(S) ?? 0) > 1);
66
+ return { dotX: n, merge: $, laneLabel: c, edges: m, links: h, lanes: _, width: p };
67
67
  }
68
- const S = (a) => (a + 0.5) * k;
69
- function C(a, e, s, i) {
70
- const t = (e + i) / 2;
71
- return `C ${String(a)} ${String(t)} ${String(s)} ${String(t)} ${String(s)} ${String(i)}`;
68
+ const u = (e) => (e + 0.5) * L;
69
+ function M(e, a, s, i) {
70
+ const t = (a + i) / 2;
71
+ return `C ${String(e)} ${String(t)} ${String(s)} ${String(t)} ${String(s)} ${String(i)}`;
72
72
  }
73
- function z({ from: a, to: e, fromX: s, toX: i, viaX: t }) {
74
- const o = `M ${String(s)} ${String(S(a))}`;
75
- if (e - a <= 1)
76
- return `${o} ${C(s, S(a), i, S(e))}`;
77
- const f = t === s ? "" : C(s, S(a), t, S(a + 1)), l = `L ${String(t)} ${String(S(e - 1))}`, n = t === i ? `L ${String(i)} ${String(S(e))}` : C(t, S(e - 1), i, S(e));
78
- return [o, f, l, n].filter(Boolean).join(" ");
73
+ function V({ from: e, to: a, fromX: s, toX: i, viaX: t }) {
74
+ const o = `M ${String(s)} ${String(u(e))}`;
75
+ if (a - e <= 1)
76
+ return `${o} ${M(s, u(e), i, u(a))}`;
77
+ const g = t === s ? "" : M(s, u(e), t, u(e + 1)), n = `L ${String(t)} ${String(u(a - 1))}`, c = t === i ? `L ${String(i)} ${String(u(a))}` : M(t, u(a - 1), i, u(a));
78
+ return [o, g, n, c].filter(Boolean).join(" ");
79
79
  }
80
- function y({
81
- id: a,
82
- className: e,
83
- children: s
80
+ function B({
81
+ id: e,
82
+ className: a,
83
+ whole: s,
84
+ children: i
84
85
  }) {
85
- const [i, t] = H(!1);
86
+ const [t, o] = P(!1);
86
87
  return /* @__PURE__ */ r(
87
- G,
88
+ F,
88
89
  {
89
90
  placement: "topLeft",
90
91
  mouseEnterDelay: 0.3,
91
92
  styles: { root: { maxWidth: "var(--tooltip-max-width)" } },
92
- title: i ? s : void 0,
93
+ title: t ? s ?? i : void 0,
93
94
  children: /* @__PURE__ */ r(
94
95
  "span",
95
96
  {
96
- id: a,
97
- className: e,
98
- onMouseEnter: (o) => {
99
- t(
100
- o.currentTarget.scrollWidth > o.currentTarget.clientWidth
97
+ id: e,
98
+ className: a,
99
+ onMouseEnter: (g) => {
100
+ const n = g.currentTarget;
101
+ o(
102
+ [
103
+ n,
104
+ ...n.querySelectorAll(`.${A}`)
105
+ ].some((c) => c.scrollWidth > c.clientWidth)
101
106
  );
102
107
  },
103
- children: s
108
+ children: i
104
109
  }
105
110
  )
106
111
  }
107
112
  );
108
113
  }
109
- function D(a, e, s, i) {
110
- const t = s.laneLabel[e], o = s.merge[e], f = `${a}-lane-${String(e)}`, l = `${a}-merge-${String(e)}`, n = [t === void 0 ? "" : f, o ? l : ""].filter(
114
+ function R(e, a, s, i) {
115
+ const t = s.laneLabel[a], o = s.merge[a], g = `${e}-lane-${String(a)}`, n = `${e}-merge-${String(a)}`, c = [t === void 0 ? "" : g, o ? n : ""].filter(
111
116
  Boolean
112
117
  );
113
118
  return {
114
- describedBy: n.length === 0 ? void 0 : n.join(" "),
115
- spans: /* @__PURE__ */ $(T, { children: [
116
- t !== void 0 && /* @__PURE__ */ r("span", { id: f, hidden: !0, children: t }),
117
- o && /* @__PURE__ */ r("span", { id: l, hidden: !0, children: i })
119
+ describedBy: c.length === 0 ? void 0 : c.join(" "),
120
+ spans: /* @__PURE__ */ w(I, { children: [
121
+ t !== void 0 && /* @__PURE__ */ r("span", { id: g, hidden: !0, children: t }),
122
+ o && /* @__PURE__ */ r("span", { id: n, hidden: !0, children: i })
118
123
  ] })
119
124
  };
120
125
  }
121
- function R({
122
- commits: a,
123
- layout: e,
126
+ function D({
127
+ commits: e,
128
+ layout: a,
124
129
  selected: s
125
130
  }) {
126
- const i = a.length * k;
127
- return /* @__PURE__ */ $(
131
+ const i = e.length * L;
132
+ return /* @__PURE__ */ w(
128
133
  "svg",
129
134
  {
130
135
  className: "aegis-commit-graph__svg",
131
- width: e.width,
136
+ width: a.width,
132
137
  height: i,
133
- viewBox: `0 0 ${String(e.width)} ${String(i)}`,
138
+ viewBox: `0 0 ${String(a.width)} ${String(i)}`,
134
139
  "aria-hidden": "true",
135
140
  children: [
136
- e.lanes.slice(1).map((t) => /* @__PURE__ */ r(
141
+ a.lanes.slice(1).map((t) => /* @__PURE__ */ r(
137
142
  "line",
138
143
  {
139
144
  className: "aegis-commit-graph__lane-rule",
@@ -144,33 +149,33 @@ function R({
144
149
  },
145
150
  t.x
146
151
  )),
147
- e.links.map((t) => /* @__PURE__ */ r(
152
+ a.links.map((t) => /* @__PURE__ */ r(
148
153
  "path",
149
154
  {
150
155
  className: "aegis-commit-graph__link",
151
- d: `M ${String(t.fromX)} ${String(S(t.from))} ${C(t.fromX, S(t.from), t.toX, S(t.to))}`
156
+ d: `M ${String(t.fromX)} ${String(u(t.from))} ${M(t.fromX, u(t.from), t.toX, u(t.to))}`
152
157
  },
153
158
  `${String(t.from)}-${String(t.to)}`
154
159
  )),
155
- e.edges.map((t) => /* @__PURE__ */ r(
160
+ a.edges.map((t) => /* @__PURE__ */ r(
156
161
  "path",
157
162
  {
158
163
  className: "aegis-commit-graph__edge",
159
- d: z(t)
164
+ d: V(t)
160
165
  },
161
166
  `${String(t.from)}-${String(t.to)}-${String(t.viaX)}`
162
167
  )),
163
- a.map((t, o) => /* @__PURE__ */ r(
168
+ e.map((t, o) => /* @__PURE__ */ r(
164
169
  "circle",
165
170
  {
166
171
  className: [
167
172
  "aegis-commit-graph__dot",
168
- e.merge[o] ? "aegis-commit-graph__dot--merge" : "",
173
+ a.merge[o] ? "aegis-commit-graph__dot--merge" : "",
169
174
  s.has(t.id) ? "aegis-commit-graph__dot--selected" : ""
170
175
  ].filter(Boolean).join(" "),
171
- cx: e.dotX[o],
172
- cy: S(o),
173
- r: Y
176
+ cx: a.dotX[o],
177
+ cy: u(o),
178
+ r: q
174
179
  },
175
180
  t.id
176
181
  ))
@@ -179,128 +184,163 @@ function R({
179
184
  );
180
185
  }
181
186
  function j({
182
- lanes: a,
183
- layout: e
187
+ lanes: e,
188
+ layout: a
184
189
  }) {
185
- return /* @__PURE__ */ r("span", { className: "aegis-commit-graph__lane-labels", children: a.map((s, i) => /* @__PURE__ */ r(
190
+ return /* @__PURE__ */ r("span", { className: "aegis-commit-graph__lane-labels", children: e.map((s, i) => /* @__PURE__ */ r(
186
191
  "span",
187
192
  {
188
193
  className: "aegis-commit-graph__lane-label",
189
- style: { width: `${String(e.lanes[i].width)}px` },
194
+ style: { width: `${String(a.lanes[i].width)}px` },
190
195
  children: s.label
191
196
  },
192
197
  s.id
193
198
  )) });
194
199
  }
195
- function J({
196
- commits: a,
197
- lanes: e,
200
+ function Z({
201
+ commits: e,
202
+ lanes: a,
198
203
  layout: s,
199
204
  selected: i,
200
205
  toggle: t,
201
206
  ariaLabel: o
202
207
  }) {
203
- const f = B(), l = O();
204
- return /* @__PURE__ */ $(T, { children: [
205
- e !== void 0 && /* @__PURE__ */ $("div", { className: "aegis-commit-graph__lanes", "aria-hidden": "true", children: [
208
+ const g = y(), n = O();
209
+ return /* @__PURE__ */ w(I, { children: [
210
+ a !== void 0 && /* @__PURE__ */ w("div", { className: "aegis-commit-graph__lanes", "aria-hidden": "true", children: [
206
211
  /* @__PURE__ */ r("span", { className: "aegis-commit-graph__lane-spacer" }),
207
- /* @__PURE__ */ r(j, { lanes: e, layout: s })
212
+ /* @__PURE__ */ r(j, { lanes: a, layout: s })
208
213
  ] }),
209
- /* @__PURE__ */ $("div", { className: "aegis-commit-graph__body", children: [
210
- /* @__PURE__ */ r(R, { commits: a, layout: s, selected: i }),
211
- /* @__PURE__ */ r("ol", { className: "aegis-commit-graph__rows", "aria-label": o, children: a.map((n, g) => {
212
- const p = i.has(n.id), m = `${l}-title-${String(g)}`, d = D(
213
- l,
214
- g,
214
+ /* @__PURE__ */ w("div", { className: "aegis-commit-graph__body", children: [
215
+ /* @__PURE__ */ r(D, { commits: e, layout: s, selected: i }),
216
+ /* @__PURE__ */ r("ol", { className: "aegis-commit-graph__rows", "aria-label": o, children: e.map((c, m) => {
217
+ const _ = i.has(c.id), p = `${n}-title-${String(m)}`, h = R(
218
+ n,
219
+ m,
215
220
  s,
216
- f.mergeCommit
221
+ g.mergeCommit
217
222
  );
218
- return /* @__PURE__ */ $(
223
+ return /* @__PURE__ */ w(
219
224
  "li",
220
225
  {
221
- className: p ? "aegis-commit-graph__row aegis-commit-graph__row--selected" : "aegis-commit-graph__row",
222
- "aria-describedby": d.describedBy,
226
+ className: _ ? "aegis-commit-graph__row aegis-commit-graph__row--selected" : "aegis-commit-graph__row",
227
+ "aria-describedby": h.describedBy,
223
228
  children: [
224
229
  /* @__PURE__ */ r("span", { className: "aegis-commit-graph__select", children: t !== void 0 && /* @__PURE__ */ r(
225
230
  W,
226
231
  {
227
- checked: p,
228
- onChange: (_) => {
229
- t(n.id, _);
232
+ checked: _,
233
+ onChange: (f) => {
234
+ t(c.id, f);
230
235
  },
231
- "aria-labelledby": m
236
+ "aria-labelledby": p
232
237
  }
233
238
  ) }),
234
- /* @__PURE__ */ $("span", { className: "aegis-commit-graph__text", children: [
235
- d.spans,
236
- n.refs?.map((_) => /* @__PURE__ */ r(Q, { className: "aegis-commit-graph__ref", children: _ }, _)),
237
- /* @__PURE__ */ r(y, { id: m, className: "aegis-commit-graph__title", children: n.title })
239
+ /* @__PURE__ */ w("span", { className: "aegis-commit-graph__text", children: [
240
+ h.spans,
241
+ c.refs?.map((f) => /* @__PURE__ */ r(Q, { className: "aegis-commit-graph__ref", children: f }, f)),
242
+ /* @__PURE__ */ r(B, { id: p, className: "aegis-commit-graph__title", children: c.title })
238
243
  ] }),
239
- n.meta !== void 0 && /* @__PURE__ */ r("span", { className: "aegis-commit-graph__meta", children: n.meta })
244
+ c.meta !== void 0 && /* @__PURE__ */ r("span", { className: "aegis-commit-graph__meta", children: c.meta })
240
245
  ]
241
246
  },
242
- n.id
247
+ c.id
243
248
  );
244
249
  }) })
245
250
  ] })
246
251
  ] });
247
252
  }
248
- function V({
249
- commits: a,
250
- lanes: e,
253
+ function tt(e) {
254
+ return typeof e == "object" && e !== null && "parts" in e;
255
+ }
256
+ function et({
257
+ cell: e,
258
+ grow: a,
259
+ id: s,
260
+ select: i
261
+ }) {
262
+ const t = tt(e) ? {
263
+ value: /* @__PURE__ */ r("span", { id: s, className: "aegis-commit-graph__parts", children: e.parts.map((g, n) => /* @__PURE__ */ r(
264
+ "span",
265
+ {
266
+ className: g.cut === !0 ? `aegis-commit-graph__part ${A}` : "aegis-commit-graph__part",
267
+ children: g.content
268
+ },
269
+ n
270
+ )) }),
271
+ whole: e.parts.map((g, n) => /* @__PURE__ */ w(G, { children: [
272
+ n > 0 && " ",
273
+ g.content
274
+ ] }, n)),
275
+ cellClass: "aegis-commit-graph__cell aegis-commit-graph__cell--parts",
276
+ growClass: "aegis-commit-graph__td aegis-commit-graph__td--grow aegis-commit-graph__td--parts"
277
+ } : {
278
+ value: s === void 0 ? e : /* @__PURE__ */ r("span", { id: s, children: e }),
279
+ whole: void 0,
280
+ cellClass: "aegis-commit-graph__cell",
281
+ growClass: "aegis-commit-graph__td aegis-commit-graph__td--grow"
282
+ }, o = /* @__PURE__ */ w(I, { children: [
283
+ i,
284
+ t.value
285
+ ] });
286
+ return a ? /* @__PURE__ */ r("td", { className: t.growClass, children: /* @__PURE__ */ r(B, { className: t.cellClass, whole: t.whole, children: o }) }) : /* @__PURE__ */ r("td", { className: "aegis-commit-graph__td", children: /* @__PURE__ */ r("span", { className: t.cellClass, children: o }) });
287
+ }
288
+ function at({
289
+ commits: e,
290
+ lanes: a,
251
291
  layout: s,
252
292
  selected: i,
253
293
  toggle: t,
254
294
  ariaLabel: o,
255
- columns: f
295
+ columns: g
256
296
  }) {
257
- const l = B(), n = O();
258
- return /* @__PURE__ */ r("div", { className: "aegis-commit-graph__scroll", children: /* @__PURE__ */ $("table", { className: "aegis-commit-graph__table", "aria-label": o, children: [
259
- /* @__PURE__ */ r("thead", { children: /* @__PURE__ */ $("tr", { children: [
297
+ const n = y(), c = O();
298
+ return /* @__PURE__ */ r("div", { className: "aegis-commit-graph__scroll", children: /* @__PURE__ */ w("table", { className: "aegis-commit-graph__table", "aria-label": o, children: [
299
+ /* @__PURE__ */ r("thead", { children: /* @__PURE__ */ w("tr", { children: [
260
300
  /* @__PURE__ */ r(
261
301
  "th",
262
302
  {
263
303
  scope: "col",
264
304
  className: "aegis-commit-graph__th aegis-commit-graph__th--graph",
265
305
  "aria-hidden": "true",
266
- children: e !== void 0 && /* @__PURE__ */ r(j, { lanes: e, layout: s })
306
+ children: a !== void 0 && /* @__PURE__ */ r(j, { lanes: a, layout: s })
267
307
  }
268
308
  ),
269
- f.map((g) => /* @__PURE__ */ r(
309
+ g.map((m) => /* @__PURE__ */ r(
270
310
  "th",
271
311
  {
272
312
  scope: "col",
273
313
  className: "aegis-commit-graph__th",
274
- children: g.label
314
+ children: m.label
275
315
  },
276
- g.id
316
+ m.id
277
317
  ))
278
318
  ] }) }),
279
- /* @__PURE__ */ r("tbody", { children: a.map((g, p) => {
280
- const m = i.has(g.id), d = `${n}-first-${String(p)}`, _ = D(
281
- n,
282
- p,
319
+ /* @__PURE__ */ r("tbody", { children: e.map((m, _) => {
320
+ const p = i.has(m.id), h = `${c}-first-${String(_)}`, f = R(
321
+ c,
322
+ _,
283
323
  s,
284
- l.mergeCommit
324
+ n.mergeCommit
285
325
  );
286
- return /* @__PURE__ */ $(
326
+ return /* @__PURE__ */ w(
287
327
  "tr",
288
328
  {
289
- className: m ? "aegis-commit-graph__tr aegis-commit-graph__tr--selected" : "aegis-commit-graph__tr",
290
- "aria-selected": t === void 0 ? void 0 : m,
291
- "aria-describedby": _.describedBy,
329
+ className: p ? "aegis-commit-graph__tr aegis-commit-graph__tr--selected" : "aegis-commit-graph__tr",
330
+ "aria-selected": t === void 0 ? void 0 : p,
331
+ "aria-describedby": f.describedBy,
292
332
  children: [
293
- /* @__PURE__ */ $(
333
+ /* @__PURE__ */ w(
294
334
  "td",
295
335
  {
296
- className: p === 0 ? "aegis-commit-graph__td aegis-commit-graph__td--graph aegis-commit-graph__td--drawing" : "aegis-commit-graph__td aegis-commit-graph__td--graph",
336
+ className: _ === 0 ? "aegis-commit-graph__td aegis-commit-graph__td--graph aegis-commit-graph__td--drawing" : "aegis-commit-graph__td aegis-commit-graph__td--graph",
297
337
  "aria-hidden": "true",
298
338
  children: [
299
- _.spans,
300
- p === 0 && /* @__PURE__ */ r(
301
- R,
339
+ f.spans,
340
+ _ === 0 && /* @__PURE__ */ r(
341
+ D,
302
342
  {
303
- commits: a,
343
+ commits: e,
304
344
  layout: s,
305
345
  selected: i
306
346
  }
@@ -308,76 +348,72 @@ function V({
308
348
  ]
309
349
  }
310
350
  ),
311
- f.map((N, c) => {
312
- const u = c === 0 ? /* @__PURE__ */ $(T, { children: [
313
- t !== void 0 && /* @__PURE__ */ r("span", { className: "aegis-commit-graph__cell-select", children: /* @__PURE__ */ r(
351
+ g.map(($, l) => /* @__PURE__ */ r(
352
+ et,
353
+ {
354
+ cell: m.cells?.[$.id],
355
+ grow: $.grow === !0,
356
+ id: l === 0 ? h : void 0,
357
+ select: l === 0 && t !== void 0 && /* @__PURE__ */ r("span", { className: "aegis-commit-graph__cell-select", children: /* @__PURE__ */ r(
314
358
  W,
315
359
  {
316
- checked: m,
317
- onChange: (w) => {
318
- t(g.id, w);
360
+ checked: p,
361
+ onChange: (S) => {
362
+ t(m.id, S);
319
363
  },
320
- "aria-labelledby": d
364
+ "aria-labelledby": h
321
365
  }
322
- ) }),
323
- /* @__PURE__ */ r("span", { id: d, children: g.cells?.[N.id] })
324
- ] }) : g.cells?.[N.id];
325
- return N.grow === !0 ? /* @__PURE__ */ r(
326
- "td",
327
- {
328
- className: "aegis-commit-graph__td aegis-commit-graph__td--grow",
329
- children: /* @__PURE__ */ r(y, { className: "aegis-commit-graph__cell", children: u })
330
- },
331
- N.id
332
- ) : /* @__PURE__ */ r("td", { className: "aegis-commit-graph__td", children: /* @__PURE__ */ r("span", { className: "aegis-commit-graph__cell", children: u }) }, N.id);
333
- })
366
+ ) })
367
+ },
368
+ $.id
369
+ ))
334
370
  ]
335
371
  },
336
- g.id
372
+ m.id
337
373
  );
338
374
  }) })
339
375
  ] }) });
340
376
  }
341
- function ct({
342
- commits: a,
343
- lanes: e,
377
+ function ht({
378
+ commits: e,
379
+ lanes: a,
344
380
  columns: s,
345
381
  selectedIds: i = [],
346
382
  onSelectedIdsChange: t,
347
383
  maxSelected: o,
348
- ariaLabel: f,
349
- className: l
384
+ ariaLabel: g,
385
+ className: n
350
386
  }) {
351
- const g = P(F) ? X : U, p = A(
352
- () => q(a, e, g),
353
- [a, e, g]
354
- ), m = t === void 0 ? void 0 : (c, u) => {
355
- const w = u ? [...i.filter((x) => x !== c), c] : i.filter((x) => x !== c);
387
+ const m = U(K) ? Y : X, _ = H(
388
+ () => J(e, a, m),
389
+ [e, a, m]
390
+ ), p = t === void 0 ? void 0 : (l, S) => {
391
+ const v = S ? [...i.filter((N) => N !== l), l] : i.filter((N) => N !== l);
356
392
  t(
357
- o === void 0 ? w : w.slice(-o)
393
+ o === void 0 ? v : v.slice(-o)
358
394
  );
359
- }, d = {
360
- commits: a,
361
- lanes: e,
362
- layout: p,
395
+ }, h = {
396
+ commits: e,
397
+ lanes: a,
398
+ layout: _,
363
399
  selected: new Set(i),
364
- toggle: m,
365
- ariaLabel: f
366
- }, _ = [
400
+ toggle: p,
401
+ ariaLabel: g
402
+ }, f = [
367
403
  "aegis-commit-graph",
368
404
  // The list's checkboxes take a column of their own; the table's sit in its first column.
369
- m !== void 0 && s === void 0 ? "aegis-commit-graph--selectable" : "",
370
- l ?? ""
371
- ].filter(Boolean).join(" "), N = {
372
- "--aegis-commit-graph-row-h": `${String(k)}px`,
373
- "--aegis-commit-graph-graph-w": `${String(p.width)}px`,
405
+ p !== void 0 && s === void 0 ? "aegis-commit-graph--selectable" : "",
406
+ n ?? ""
407
+ ].filter(Boolean).join(" "), $ = {
408
+ "--aegis-commit-graph-row-h": `${String(L)}px`,
409
+ "--aegis-commit-graph-graph-w": `${String(_.width)}px`,
374
410
  "--aegis-commit-graph-grow-count": String(
375
- s?.filter((c) => c.grow === !0).length ?? 0
411
+ s?.filter((l) => l.grow === !0).length ?? 0
376
412
  )
377
413
  };
378
- return /* @__PURE__ */ r("div", { className: _, style: N, children: s === void 0 ? /* @__PURE__ */ r(J, { ...d }) : /* @__PURE__ */ r(V, { ...d, columns: s }) });
414
+ return /* @__PURE__ */ r("div", { className: f, style: $, children: s === void 0 ? /* @__PURE__ */ r(Z, { ...h }) : /* @__PURE__ */ r(at, { ...h, columns: s }) });
379
415
  }
380
416
  export {
381
- ct as CommitGraph
417
+ ht as CommitGraph
382
418
  };
383
419
  //# sourceMappingURL=CommitGraph.js.map