@parallelworks/tandem-web 0.164.1 → 0.165.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/pages/issues.js CHANGED
@@ -30,12 +30,12 @@ import { IssueGroupList as Ze } from "../components/IssueGroupList.js";
30
30
  import { IssueImport as Qe, pickCsv as $e } from "../components/IssueImport.js";
31
31
  import { IssueInsights as et } from "../components/IssueInsights.js";
32
32
  import { insightsKey as tt, listTabs as nt, panelKey as rt, shownFields as it, storeDisplay as at, storeShownFields as ot, storedDisplay as st, withParam as c } from "../lib/issueDisplay.js";
33
- import { ActionMenu as ct, Button as l, Field as lt, IconButton as u, SearchInput as ut, Select as dt, Tabs as ft, useOpenMenu as pt } from "@parallelworks/ui";
34
- import { useParams as mt, useSearch as ht } from "@tanstack/react-router";
35
- import { memo as d, useCallback as gt, useEffect as _t, useMemo as f, useRef as p, useState as m } from "react";
36
- import { useTranslations as h } from "use-intl";
37
- import { Fragment as vt, jsx as g, jsxs as _ } from "react/jsx-runtime";
38
- import { keepPreviousData as yt, useInfiniteQuery as bt, useQuery as v, useSuspenseQuery as xt } from "@tanstack/react-query";
33
+ import { ActionMenu as ct, Button as l, ConfirmModal as lt, Field as ut, IconButton as u, SearchInput as dt, Select as ft, Tabs as pt, useOpenMenu as mt } from "@parallelworks/ui";
34
+ import { useParams as ht, useSearch as gt } from "@tanstack/react-router";
35
+ import { memo as d, useCallback as _t, useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
36
+ import { useTranslations as g } from "use-intl";
37
+ import { Fragment as vt, jsx as _, jsxs as v } from "react/jsx-runtime";
38
+ import { keepPreviousData as yt, useInfiniteQuery as bt, useQuery as y, useSuspenseQuery as xt } from "@tanstack/react-query";
39
39
  import { ListFilterBar as St, ListFilterMenu as Ct, ListSkeleton as wt } from "@parallelworks/ui/list";
40
40
  // src/pages/issues.tsx
41
41
  var Tt = {
@@ -51,22 +51,22 @@ function Dt(e) {
51
51
  creator: n
52
52
  } : r;
53
53
  }
54
- function y({ person: e } = {}) {
55
- let s = h("issues"), d = h("planning"), { workspace: y, key: jt } = mt({ strict: !1 }), b = ht({ strict: !1 }), x = jt ? {
56
- ...b,
54
+ function b({ person: e } = {}) {
55
+ let s = g("issues"), d = g("planning"), { workspace: b, key: jt } = ht({ strict: !1 }), x = gt({ strict: !1 }), S = jt ? {
56
+ ...x,
57
57
  team: jt
58
- } : e ? b.creator ? {
59
- ...Dt(b),
58
+ } : e ? x.creator ? {
59
+ ...Dt(x),
60
60
  creator: e
61
61
  } : {
62
- ...b,
62
+ ...x,
63
63
  assignee: e
64
- } : b, Mt = r(), Nt = (t) => e ? Fe(y, { ...Dt(t) }).replace(`/${y}/issues`, `/${y}/people/${encodeURIComponent(e)}`) : Fe(y, { ...t }), S = (t, n) => {
64
+ } : x, Mt = r(), Nt = (t) => e ? Fe(b, { ...Dt(t) }).replace(`/${b}/issues`, `/${b}/people/${encodeURIComponent(e)}`) : Fe(b, { ...t }), C = (t, n) => {
65
65
  let { team: r, ...i } = t;
66
66
  return Mt(e ? {
67
67
  to: "/$workspace/people/$username",
68
68
  params: {
69
- workspace: y,
69
+ workspace: b,
70
70
  username: e
71
71
  },
72
72
  search: Dt(i),
@@ -74,75 +74,75 @@ function y({ person: e } = {}) {
74
74
  } : r ? {
75
75
  to: "/$workspace/teams/$key/issues",
76
76
  params: {
77
- workspace: y,
77
+ workspace: b,
78
78
  key: r
79
79
  },
80
80
  search: i,
81
81
  ...n && { replace: n }
82
82
  } : {
83
83
  to: "/$workspace/issues",
84
- params: { workspace: y },
84
+ params: { workspace: b },
85
85
  search: i,
86
86
  ...n && { replace: n }
87
87
  });
88
- }, Pt = p((e) => S(e, !0));
89
- Pt.current = (e) => S(e, !0);
90
- let Ft = p((e) => S(c(x, "q", e), !0));
91
- Ft.current = (e) => S(c(x, "q", e), !0);
92
- let { data: It } = xt(ne), { data: C } = xt(ie(y)), Lt = pe(), w = x.view ?? "active", [T, Rt] = m(x.q ?? ""), E = p(null);
93
- _t(() => {
88
+ }, Pt = m((e) => C(e, !0));
89
+ Pt.current = (e) => C(e, !0);
90
+ let Ft = m((e) => C(c(S, "q", e), !0));
91
+ Ft.current = (e) => C(c(S, "q", e), !0);
92
+ let { data: It } = xt(ne), { data: w } = xt(ie(b)), Lt = pe(), T = S.view ?? "active", [E, Rt] = h(S.q ?? ""), zt = m(null);
93
+ f(() => {
94
94
  let e = setTimeout(() => {
95
- (x.q ?? "") !== T && Ft.current(T);
95
+ (S.q ?? "") !== E && Ft.current(E);
96
96
  }, 250);
97
97
  return () => clearTimeout(e);
98
- }, [T, x.q]);
99
- let { data: zt } = v({
100
- ...re(y, x.team ?? ""),
101
- enabled: !!x.status && !!x.team
102
- }), Bt = je(x, zt), { data: D, error: O, isFetching: Vt, hasNextPage: Ht, isFetchingNextPage: Ut, fetchNextPage: Wt } = bt({
103
- ...ee(y, Bt),
98
+ }, [E, S.q]);
99
+ let { data: Bt } = y({
100
+ ...re(b, S.team ?? ""),
101
+ enabled: !!S.status && !!S.team
102
+ }), Vt = je(S, Bt), { data: D, error: O, isFetching: Ht, hasNextPage: Ut, isFetchingNextPage: Wt, fetchNextPage: Gt } = bt({
103
+ ...ee(b, Vt),
104
104
  placeholderData: yt,
105
- enabled: !x.status || !x.team || !!zt
105
+ enabled: !S.status || !S.team || !!Bt
106
106
  });
107
- _t(() => {
108
- Ht && !Ut && !O && Wt();
107
+ f(() => {
108
+ Ut && !Wt && !O && Gt();
109
109
  }, [
110
- Ht,
111
110
  Ut,
111
+ Wt,
112
112
  O,
113
- Wt
113
+ Gt
114
114
  ]);
115
- let k = !!Ht, A = f(() => D?.pages.flatMap((e) => e.issues) ?? [], [D]), Gt = fe(), { nameOf: Kt, avatarOf: qt } = me(y), j = x.saved ? {} : st(), { data: Jt } = v(ve(y)), M = C.find((e) => e.key === x.team), N = f(() => be(Jt, M ? [M.id] : C.map((e) => e.id)), [
116
- Jt,
115
+ let k = !!Ut, A = p(() => D?.pages.flatMap((e) => e.issues) ?? [], [D]), Kt = fe(), { nameOf: qt, avatarOf: Jt } = me(b), j = S.saved ? {} : st(), { data: Yt } = y(ve(b)), M = w.find((e) => e.key === S.team), N = p(() => be(Yt, M ? [M.id] : w.map((e) => e.id)), [
116
+ Yt,
117
117
  M,
118
- C
119
- ]), P = h("customFields"), Yt = h("issueTypes"), { data: Xt } = v(we(y)), Zt = f(() => (Xt ?? []).filter((e) => !e.archivedAt && (!M || e.teamIds.length === 0 || e.teamIds.includes(M.id))), [Xt, M]), F = Ae(x.order, N) ? x.order : Ae(j.order, N) ? j.order : "updated", I = ke(x.group, N) ? x.group : ke(j.group, N) ? j.group : "status", Qt = N.find((e) => e.id === ye(I)), [$t, en] = m(() => it(y)), tn = f(() => N.filter((e) => $t.includes(e.id)), [N, $t]), L = x.layout === "board" || !x.layout && j.layout === "board", [nn, rn] = m(() => {
118
+ w
119
+ ]), P = g("customFields"), Xt = g("issueTypes"), { data: Zt } = y(we(b)), Qt = p(() => (Zt ?? []).filter((e) => !e.archivedAt && (!M || e.teamIds.length === 0 || e.teamIds.includes(M.id))), [Zt, M]), F = Ae(S.order, N) ? S.order : Ae(j.order, N) ? j.order : "updated", I = ke(S.group, N) ? S.group : ke(j.group, N) ? j.group : "status", $t = N.find((e) => e.id === ye(I)), [en, tn] = h(() => it(b)), nn = p(() => N.filter((e) => en.includes(e.id)), [N, en]), L = S.layout === "board" || !S.layout && j.layout === "board", [rn, an] = h(() => {
120
120
  try {
121
121
  return localStorage.getItem(rt) !== "hidden";
122
122
  } catch {
123
123
  return !0;
124
124
  }
125
- }), an = () => rn((e) => {
125
+ }), on = () => an((e) => {
126
126
  try {
127
127
  localStorage.setItem(rt, e ? "hidden" : "shown");
128
128
  } catch {}
129
129
  return !e;
130
- }), [on, sn] = m(() => {
130
+ }), [sn, cn] = h(() => {
131
131
  try {
132
132
  return localStorage.getItem(tt) === "shown";
133
133
  } catch {
134
134
  return !1;
135
135
  }
136
- }), cn = () => sn((e) => {
136
+ }), ln = () => cn((e) => {
137
137
  try {
138
138
  localStorage.setItem(tt, e ? "hidden" : "shown");
139
139
  } catch {}
140
140
  return !e;
141
- }), [ln, un] = m("assignees"), [R, dn] = m(null), z = R ? A.filter((e) => Xe(e, R.tab).includes(R.key)) : A, B = f(() => De(Ne(z, F, N), I, {
141
+ }), [un, dn] = h("assignees"), [R, fn] = h(null), z = R ? A.filter((e) => Xe(e, R.tab).includes(R.key)) : A, B = p(() => De(Ne(z, F, N), I, {
142
142
  status: (e) => s(`groups.${e}`),
143
- priority: (e) => Gt[e] ?? "",
144
- person: Kt,
145
- avatar: qt,
143
+ priority: (e) => Kt[e] ?? "",
144
+ person: qt,
145
+ avatar: Jt,
146
146
  none: {
147
147
  assignee: s("noAssignee"),
148
148
  project: s("noProject"),
@@ -151,150 +151,190 @@ function y({ person: e } = {}) {
151
151
  },
152
152
  noField: (e) => P("noField", { name: e }),
153
153
  yes: P("yes"),
154
- noType: Yt("noType")
155
- }, L, N, Zt), [
154
+ noType: Xt("noType")
155
+ }, L, N, Qt), [
156
156
  z,
157
157
  F,
158
158
  I,
159
159
  s,
160
160
  P,
161
- Yt,
162
- Gt,
161
+ Xt,
163
162
  Kt,
164
163
  qt,
164
+ Jt,
165
165
  L,
166
166
  N,
167
- Zt
168
- ]), V = f(() => B.flatMap((e) => e.issues), [B]), fn = f(() => new Map(V.map((e, t) => [e.id, t])), [V]), pn = !R && !x.status ? Tt[I] : void 0, { data: H } = v({
169
- ...a(y, Le(x), pn ?? "status"),
170
- enabled: k && !!pn
171
- }), mn = gt((e) => k && H?.byKey.get(e.key) || e.issues.length, [k, H]), hn = f(() => new Map(C.map((e) => [e.id, e])), [C]), [gn, _n] = m(0), U = V[Math.min(gn, V.length - 1)], [W, G] = m(/* @__PURE__ */ new Set()), K = p(null), vn = he(y), yn = Ce(y, C), { people: bn } = Ke(), xn = f(() => {
167
+ Qt
168
+ ]), V = p(() => B.flatMap((e) => e.issues), [B]), pn = p(() => new Map(V.map((e, t) => [e.id, t])), [V]), mn = !R && !S.status ? Tt[I] : void 0, { data: hn } = y({
169
+ ...a(b, Le(S), mn ?? "status"),
170
+ enabled: k && !!mn
171
+ }), gn = _t((e) => k && hn?.byKey.get(e.key) || e.issues.length, [k, hn]), _n = p(() => new Map(w.map((e) => [e.id, e])), [w]), [vn, yn] = h(0), H = V[Math.min(vn, V.length - 1)], [U, W] = h(/* @__PURE__ */ new Set()), bn = m(null), xn = he(b), Sn = Ce(b, w), { people: Cn } = Ke(), wn = p(() => {
172
172
  let e = /* @__PURE__ */ new Map();
173
- for (let t of bn) {
173
+ for (let t of Cn) {
174
174
  if (!t.identifier || t.username === It?.user.username) continue;
175
175
  let n = e.get(t.identifier) ?? /* @__PURE__ */ new Set();
176
176
  n.add(t.username), e.set(t.identifier, n);
177
177
  }
178
178
  return new Map([...e].map(([e, t]) => [e, [...t]]));
179
- }, [bn, It?.user.username]), Sn = pt(), Cn = f(() => V.filter((e) => W.has(e.id)), [V, W]);
180
- Ge(Cn);
181
- let wn = (e) => G((t) => {
179
+ }, [Cn, It?.user.username]), Tn = mt(), En = p(() => V.filter((e) => U.has(e.id)), [V, U]);
180
+ Ge(En);
181
+ let Dn = (e) => W((t) => {
182
182
  let n = new Set(t);
183
183
  return n.has(e) ? n.delete(e) : n.add(e), n;
184
- }), Tn = (e) => {
185
- (K.current === null || W.size === 0) && (K.current = Math.max(gn, 0));
186
- let t = K.current, [n, r] = t < e ? [t, e] : [e, t];
187
- G(new Set(V.slice(n, r + 1).map((e) => e.id)));
188
- }, q = (e, t) => {
184
+ }), On = (e) => {
185
+ (bn.current === null || U.size === 0) && (bn.current = Math.max(vn, 0));
186
+ let t = bn.current, [n, r] = t < e ? [t, e] : [e, t];
187
+ W(new Set(V.slice(n, r + 1).map((e) => e.id)));
188
+ }, G = (e, t) => {
189
189
  let n = V[e];
190
190
  if (n) {
191
- if (t) return Tn(e);
192
- wn(n.id), K.current = e;
191
+ if (t) return On(e);
192
+ Dn(n.id), bn.current = e;
193
193
  }
194
- }, En = (e, t) => {
195
- (e.metaKey || e.ctrlKey || e.shiftKey) && (e.preventDefault(), q(t, e.shiftKey));
196
- }, J = (e, t) => {
197
- let n = Math.min(Math.max(gn + e, 0), V.length - 1);
198
- t && Tn(n), _n(n);
199
- }, Dn = (e, t) => {
200
- let n = W.has(t.id) ? V.filter((e) => W.has(e.id)) : [t];
201
- W.has(t.id) || G(/* @__PURE__ */ new Set()), Sn(e, vn(n));
202
- }, On = p({
203
- pick: q,
204
- select: _n,
205
- click: En,
206
- menu: Dn
194
+ }, kn = (e, t) => {
195
+ (e.metaKey || e.ctrlKey || e.shiftKey) && (e.preventDefault(), G(t, e.shiftKey));
196
+ }, K = (e, t) => {
197
+ let n = Math.min(Math.max(vn + e, 0), V.length - 1);
198
+ t && On(n), yn(n);
199
+ }, An = (e, t) => {
200
+ let n = U.has(t.id) ? V.filter((e) => U.has(e.id)) : [t];
201
+ U.has(t.id) || W(/* @__PURE__ */ new Set()), Tn(e, xn(n));
202
+ }, jn = m({
203
+ pick: G,
204
+ select: yn,
205
+ click: kn,
206
+ menu: An
207
207
  });
208
- On.current = {
209
- pick: q,
210
- select: _n,
211
- click: En,
212
- menu: Dn
213
- }, We({
208
+ jn.current = {
209
+ pick: G,
210
+ select: yn,
211
+ click: kn,
212
+ menu: An
213
+ };
214
+ let [q, Mn] = h(!1);
215
+ f(() => {
216
+ q && !k && (W(new Set(V.map((e) => e.id))), Mn(!1));
217
+ }, [
218
+ q,
219
+ k,
220
+ V
221
+ ]);
222
+ let { data: Nn } = y({
223
+ ...a(b, Le(S), "status"),
224
+ enabled: q
225
+ }), Pn = () => {
226
+ W(new Set(V.map((e) => e.id))), Mn(k);
227
+ }, Fn = () => {
228
+ W(/* @__PURE__ */ new Set()), Mn(!1);
229
+ }, In = m(null), Ln = (e) => {
230
+ if (q) return;
231
+ let t = U.size > 0 ? En : H ? [H] : [];
232
+ if (t.length === 0) return;
233
+ let n = xn(t).find((t) => "shortcut" in t && t.shortcut === e);
234
+ return n && "label" in n && !n.disabled ? n : void 0;
235
+ }, J = (e) => () => {
236
+ let t = Ln(e), n = U.size > 0 && In.current || H && document.getElementById(`row-${H.id}`);
237
+ t && "items" in t && t.items && n && Tn(n, t.items);
238
+ }, [Rn, zn] = h(null), Bn = () => {
239
+ let e = Ln("⌫");
240
+ e && "onClick" in e && zn(() => e.onClick);
241
+ };
242
+ We({
214
243
  ...!L && {
215
- j: () => J(1, !1),
216
- k: () => J(-1, !1),
217
- J: () => J(1, !0),
218
- K: () => J(-1, !0),
219
- ArrowDown: (e) => J(1, e.shiftKey),
220
- ArrowUp: (e) => J(-1, e.shiftKey),
221
- x: () => U && q(V.indexOf(U), !1),
222
- Enter: () => U && Mt({
244
+ j: () => K(1, !1),
245
+ k: () => K(-1, !1),
246
+ J: () => K(1, !0),
247
+ K: () => K(-1, !0),
248
+ ArrowDown: (e) => K(1, e.shiftKey),
249
+ ArrowUp: (e) => K(-1, e.shiftKey),
250
+ x: () => H && G(V.indexOf(H), !1),
251
+ X: () => H && G(V.indexOf(H), !0),
252
+ "Mod+a": Pn,
253
+ "Shift+Mod+a": Fn,
254
+ s: J("S"),
255
+ p: J("P"),
256
+ a: J("A"),
257
+ l: J("L"),
258
+ m: J("M"),
259
+ d: J("D"),
260
+ Backspace: Bn,
261
+ Delete: Bn,
262
+ Enter: () => H && Mt({
223
263
  to: "/$workspace/issues/$identifier",
224
264
  params: {
225
- workspace: y,
226
- identifier: U.identifier
265
+ workspace: b,
266
+ identifier: H.identifier
227
267
  }
228
268
  })
229
269
  },
230
- Escape: () => G(/* @__PURE__ */ new Set()),
231
- "/": () => E.current?.focus()
232
- }), _t(() => {
270
+ Escape: Fn,
271
+ "/": () => zt.current?.focus()
272
+ }), f(() => {
233
273
  let e = (e) => {
234
- (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && e.key.toLowerCase() === "f" && (e.preventDefault(), E.current?.focus(), E.current?.select());
274
+ (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && e.key.toLowerCase() === "f" && (e.preventDefault(), zt.current?.focus(), zt.current?.select());
235
275
  };
236
276
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
237
277
  }, []);
238
- let kn = p(null), Y = C.find((e) => e.key === x.team), X = He(y, x, (e) => S(Ue(x, e), !0), !!jt && !x.assignee && !x.creator && !x.saved && !x.scope), An = Fe(y, { ...c(x, "q", void 0) }), { views: jn, create: Mn, update: Nn } = ze(y), Z = jn.find((e) => Te(e, x.saved)), { data: Pn } = v(te(y)), { data: Fn } = v(o(y)), { data: In } = v({
239
- ...i(y, Y?.key ?? ""),
278
+ let Vn = m(null), Y = w.find((e) => e.key === S.team), X = He(b, S, (e) => C(Ue(S, e), !0), !!jt && !S.assignee && !S.creator && !S.saved && !S.scope), Hn = Fe(b, { ...c(S, "q", void 0) }), { views: Un, create: Wn, update: Gn } = ze(b), Z = Un.find((e) => Te(e, S.saved)), { data: Kn } = y(te(b)), { data: qn } = y(o(b)), { data: Jn } = y({
279
+ ...i(b, Y?.key ?? ""),
240
280
  enabled: !!Y
241
281
  });
242
- _t(() => {
243
- let e = /^[0-9a-f]{8}-[0-9a-f]{4}-/i, t = { ...x }, n = Pn?.find((e) => e.id === x.label);
244
- x.label && e.test(x.label) && n && (t.label = n.name);
245
- let r = Fn?.find((e) => e.id === x.project);
246
- x.project && e.test(x.project) && r && (t.project = ge(r));
247
- let i = In?.find((e) => e.id === x.cycle);
248
- x.cycle && e.test(x.cycle) && i && (t.cycle = String(i.number)), x.saved && e.test(x.saved) && Z && (t.saved = Ee(Z)), JSON.stringify(t) !== JSON.stringify(x) && Pt.current(t);
282
+ f(() => {
283
+ let e = /^[0-9a-f]{8}-[0-9a-f]{4}-/i, t = { ...S }, n = Kn?.find((e) => e.id === S.label);
284
+ S.label && e.test(S.label) && n && (t.label = n.name);
285
+ let r = qn?.find((e) => e.id === S.project);
286
+ S.project && e.test(S.project) && r && (t.project = ge(r));
287
+ let i = Jn?.find((e) => e.id === S.cycle);
288
+ S.cycle && e.test(S.cycle) && i && (t.cycle = String(i.number)), S.saved && e.test(S.saved) && Z && (t.saved = Ee(Z)), JSON.stringify(t) !== JSON.stringify(S) && Pt.current(t);
249
289
  }, [
250
- x,
251
- Pn,
252
- Fn,
253
- In,
290
+ S,
291
+ Kn,
292
+ qn,
293
+ Jn,
254
294
  Z
255
295
  ]);
256
- let Q = Le({
257
- ...x,
296
+ let Yn = Le({
297
+ ...S,
258
298
  ...F !== "updated" && { order: F },
259
299
  ...I !== "status" && { group: I },
260
300
  ...L && { layout: "board" }
261
- }), Ln = Z ? !Re(Z.filters, Q) : Object.keys(Q).length > 0, Rn = _e(y, "create_issues", x.team ? { team: x.team } : void 0), zn = _e(y, "save_views"), [Bn, Vn] = m(!1), [Hn, Un] = m(null), Wn = h("savedViews"), $ = It?.user.username, Gn = !Z && !Y && (!x.assigneeKind && x.assignee === $ && !x.creator || x.creator === $ && !x.assignee), Kn = e ?? (Gn ? $ : void 0), qn = Z?.name ?? Y?.name ?? (e && e !== $ ? s("personIssues", { name: Kt("user", e) }) : !x.assigneeKind && x.assignee === $ || x.creator === $ ? s("mine") : s("all")), Jn = h("workspace");
262
- n(...Y && !Z ? [Jn("issues"), Y.name] : [qn]);
263
- let Yn = Ln && /* @__PURE__ */ _(vt, { children: [Z?.canEdit && /* @__PURE__ */ g(l, {
301
+ }), Xn = Z ? !Re(Z.filters, Yn) : Object.keys(Yn).length > 0, Zn = _e(b, "create_issues", S.team ? { team: S.team } : void 0), Qn = _e(b, "save_views"), [$n, er] = h(!1), [tr, nr] = h(null), rr = g("savedViews"), Q = It?.user.username, ir = !Z && !Y && (!S.assigneeKind && S.assignee === Q && !S.creator || S.creator === Q && !S.assignee), ar = e ?? (ir ? Q : void 0), $ = Z?.name ?? Y?.name ?? (e && e !== Q ? s("personIssues", { name: qt("user", e) }) : !S.assigneeKind && S.assignee === Q || S.creator === Q ? s("mine") : s("all")), or = g("workspace");
302
+ n(...Y && !Z ? [or("issues"), Y.name] : [$]);
303
+ let sr = Xn && /* @__PURE__ */ v(vt, { children: [Z?.canEdit && /* @__PURE__ */ _(l, {
264
304
  type: "button",
265
305
  size: "sm",
266
- loading: Nn.isPending,
267
- onClick: () => Nn.mutate({
306
+ loading: Gn.isPending,
307
+ onClick: () => Gn.mutate({
268
308
  id: Z.id,
269
- filters: Q
309
+ filters: Yn
270
310
  }),
271
- children: Wn("update")
272
- }), /* @__PURE__ */ g(l, {
311
+ children: rr("update")
312
+ }), /* @__PURE__ */ _(l, {
273
313
  type: "button",
274
314
  size: "sm",
275
- onClick: () => Vn(!0),
276
- children: Wn(Z ? "saveAsNew" : "save")
315
+ onClick: () => er(!0),
316
+ children: rr(Z ? "saveAsNew" : "save")
277
317
  })] });
278
- return /* @__PURE__ */ _("div", {
318
+ return /* @__PURE__ */ v("div", {
279
319
  className: "flex h-full flex-col",
280
320
  children: [
281
- /* @__PURE__ */ _("header", {
321
+ /* @__PURE__ */ v("header", {
282
322
  className: "flex min-h-12 shrink-0 flex-wrap items-center gap-x-3 gap-y-2 border-b border-border px-4 py-2 md:px-5",
283
323
  children: [
284
- /* @__PURE__ */ g("h1", {
324
+ /* @__PURE__ */ _("h1", {
285
325
  className: "text-sm font-semibold whitespace-nowrap",
286
- children: qn
326
+ children: $
287
327
  }),
288
- /* @__PURE__ */ g(qe, {
289
- workspace: y,
328
+ /* @__PURE__ */ _(qe, {
329
+ workspace: b,
290
330
  kind: "view",
291
- target: An,
292
- label: w === "active" ? qn : s("favoriteLabel", {
293
- title: qn,
294
- view: s(`views.${w}`)
331
+ target: Hn,
332
+ label: T === "active" ? $ : s("favoriteLabel", {
333
+ title: $,
334
+ view: s(`views.${T}`)
295
335
  })
296
336
  }),
297
- Kn && /* @__PURE__ */ g(ft, {
337
+ ar && /* @__PURE__ */ _(pt, {
298
338
  variant: "segmented",
299
339
  size: "sm",
300
340
  label: s("mineScope"),
@@ -302,58 +342,58 @@ function y({ person: e } = {}) {
302
342
  value: e,
303
343
  label: s(`mineScopes.${e}`),
304
344
  href: Nt({
305
- ...x.view && { view: x.view },
306
- ...e === "assigned" ? { assignee: Kn } : { creator: Kn }
345
+ ...S.view && { view: S.view },
346
+ ...e === "assigned" ? { assignee: ar } : { creator: ar }
307
347
  })
308
348
  })),
309
- value: x.creator ? "created" : "assigned"
349
+ value: S.creator ? "created" : "assigned"
310
350
  }),
311
- /* @__PURE__ */ g(ft, {
351
+ /* @__PURE__ */ _(pt, {
312
352
  variant: "segmented",
313
353
  size: "sm",
314
354
  label: s("view"),
315
355
  items: Object.keys(Pe).map((e) => ({
316
356
  value: e,
317
357
  label: s(`views.${e}`),
318
- href: Nt(c(x, "view", e === "active" ? void 0 : e))
358
+ href: Nt(c(S, "view", e === "active" ? void 0 : e))
319
359
  })),
320
- value: w
360
+ value: T
321
361
  }),
322
- /* @__PURE__ */ _("div", {
362
+ /* @__PURE__ */ v("div", {
323
363
  className: "flex w-full min-w-0 flex-wrap items-center gap-2 md:ml-auto md:w-auto md:flex-nowrap",
324
364
  children: [
325
- X.count === 0 && Yn,
326
- /* @__PURE__ */ g(ut, {
327
- ref: E,
328
- value: T,
365
+ X.count === 0 && sr,
366
+ /* @__PURE__ */ _(dt, {
367
+ ref: zt,
368
+ value: E,
329
369
  onValueChange: Rt,
330
- onKeyDown: (e) => e.key === "Escape" && !T && e.currentTarget.blur(),
370
+ onKeyDown: (e) => e.key === "Escape" && !E && e.currentTarget.blur(),
331
371
  placeholder: s("search"),
332
372
  label: s("search"),
333
373
  "aria-keyshortcuts": "/ Meta+F Control+F",
334
374
  size: "sm",
335
375
  className: "min-w-0 flex-1 max-md:order-first max-md:basis-full md:w-56 md:flex-initial"
336
376
  }),
337
- /* @__PURE__ */ g(Ct, { filters: X }),
338
- /* @__PURE__ */ _(Je, {
377
+ /* @__PURE__ */ _(Ct, { filters: X }),
378
+ /* @__PURE__ */ v(Je, {
339
379
  layouts: [{
340
380
  value: "list",
341
381
  label: s("layouts.list"),
342
- icon: /* @__PURE__ */ g(le, {})
382
+ icon: /* @__PURE__ */ _(le, {})
343
383
  }, {
344
384
  value: "board",
345
385
  label: s("layouts.board"),
346
- icon: /* @__PURE__ */ g(ae, {})
386
+ icon: /* @__PURE__ */ _(ae, {})
347
387
  }],
348
388
  layout: L ? "board" : "list",
349
389
  onLayoutChange: (e) => {
350
- at({ layout: e }), S(c(x, "layout", e === "board" ? "board" : void 0));
390
+ at({ layout: e }), C(c(S, "layout", e === "board" ? "board" : void 0));
351
391
  },
352
392
  changed: F !== "updated" || I !== "status" || L,
353
393
  children: [
354
- /* @__PURE__ */ g(lt, {
394
+ /* @__PURE__ */ _(ut, {
355
395
  label: s("orderBy"),
356
- children: /* @__PURE__ */ g(dt, {
396
+ children: /* @__PURE__ */ _(ft, {
357
397
  value: F,
358
398
  items: [...Me.map((e) => ({
359
399
  value: e,
@@ -363,15 +403,15 @@ function y({ person: e } = {}) {
363
403
  label: e.name
364
404
  }))],
365
405
  onValueChange: (e) => {
366
- at({ order: e }), S(c(x, "order", e === "updated" ? void 0 : e));
406
+ at({ order: e }), C(c(S, "order", e === "updated" ? void 0 : e));
367
407
  },
368
408
  "aria-label": s("orderBy"),
369
409
  size: "sm"
370
410
  })
371
411
  }),
372
- /* @__PURE__ */ g(lt, {
412
+ /* @__PURE__ */ _(ut, {
373
413
  label: s("groupBy"),
374
- children: /* @__PURE__ */ g(dt, {
414
+ children: /* @__PURE__ */ _(ft, {
375
415
  value: I,
376
416
  items: [...Oe.map((e) => ({
377
417
  value: e,
@@ -381,23 +421,23 @@ function y({ person: e } = {}) {
381
421
  label: e.name
382
422
  }))],
383
423
  onValueChange: (e) => {
384
- at({ group: e }), S(c(x, "group", e === "status" ? void 0 : e));
424
+ at({ group: e }), C(c(S, "group", e === "status" ? void 0 : e));
385
425
  },
386
426
  "aria-label": s("groupBy"),
387
427
  size: "sm"
388
428
  })
389
429
  }),
390
- N.length > 0 && /* @__PURE__ */ g(lt, {
430
+ N.length > 0 && /* @__PURE__ */ _(ut, {
391
431
  label: P("onRows"),
392
- children: /* @__PURE__ */ g(dt, {
432
+ children: /* @__PURE__ */ _(ft, {
393
433
  multiple: !0,
394
- value: $t.filter((e) => N.some((t) => t.id === e)),
434
+ value: en.filter((e) => N.some((t) => t.id === e)),
395
435
  items: N.map((e) => ({
396
436
  value: e.id,
397
437
  label: e.name
398
438
  })),
399
439
  onValueChange: (e) => {
400
- ot(y, e), en(e);
440
+ ot(b, e), tn(e);
401
441
  },
402
442
  placeholder: P("noneOnRows"),
403
443
  "aria-label": P("onRows"),
@@ -406,36 +446,36 @@ function y({ person: e } = {}) {
406
446
  })
407
447
  ]
408
448
  }),
409
- /* @__PURE__ */ g(u, {
449
+ /* @__PURE__ */ _(u, {
410
450
  variant: "secondary",
411
451
  size: "sm",
412
- icon: /* @__PURE__ */ g(ue, { className: "size-3.5" }),
413
- label: s(nn ? "hidePanel" : "showPanel"),
414
- "aria-pressed": nn,
415
- onClick: an,
452
+ icon: /* @__PURE__ */ _(ue, { className: "size-3.5" }),
453
+ label: s(rn ? "hidePanel" : "showPanel"),
454
+ "aria-pressed": rn,
455
+ onClick: on,
416
456
  className: "max-xl:hidden"
417
457
  }),
418
- /* @__PURE__ */ g(u, {
458
+ /* @__PURE__ */ _(u, {
419
459
  variant: "secondary",
420
460
  size: "sm",
421
- icon: /* @__PURE__ */ g(oe, { className: "size-3.5" }),
422
- label: s(on ? "hideInsights" : "showInsights"),
423
- "aria-pressed": on,
424
- onClick: cn
461
+ icon: /* @__PURE__ */ _(oe, { className: "size-3.5" }),
462
+ label: s(sn ? "hideInsights" : "showInsights"),
463
+ "aria-pressed": sn,
464
+ onClick: ln
425
465
  }),
426
- /* @__PURE__ */ g(u, {
466
+ /* @__PURE__ */ _(u, {
427
467
  variant: "secondary",
428
468
  size: "sm",
429
- icon: /* @__PURE__ */ g(ce, { className: "size-3.5" }),
469
+ icon: /* @__PURE__ */ _(ce, { className: "size-3.5" }),
430
470
  label: s("exportCsv"),
431
- onClick: () => At(y, Bt)
471
+ onClick: () => At(b, Vt)
432
472
  }),
433
- x.team && Rn && /* @__PURE__ */ g(u, {
473
+ S.team && Zn && /* @__PURE__ */ _(u, {
434
474
  variant: "secondary",
435
475
  size: "sm",
436
- icon: /* @__PURE__ */ g(de, { className: "size-3.5" }),
476
+ icon: /* @__PURE__ */ _(de, { className: "size-3.5" }),
437
477
  label: s("importCsv"),
438
- onClick: () => $e((e, t) => Un({
478
+ onClick: () => $e((e, t) => nr({
439
479
  name: e,
440
480
  text: t
441
481
  }))
@@ -444,139 +484,151 @@ function y({ person: e } = {}) {
444
484
  })
445
485
  ]
446
486
  }),
447
- /* @__PURE__ */ g(St, {
487
+ /* @__PURE__ */ _(St, {
448
488
  filters: X,
449
- trailing: Yn,
489
+ trailing: sr,
450
490
  className: "shrink-0 border-b border-border px-4 py-2 md:px-5"
451
491
  }),
452
- on && /* @__PURE__ */ g(et, {
453
- workspace: y,
492
+ sn && /* @__PURE__ */ _(et, {
493
+ workspace: b,
454
494
  issues: z
455
495
  }),
456
- Hn && x.team && /* @__PURE__ */ g(Qe, {
457
- workspace: y,
458
- team: x.team,
459
- file: Hn,
460
- onClose: () => Un(null)
496
+ tr && S.team && /* @__PURE__ */ _(Qe, {
497
+ workspace: b,
498
+ team: S.team,
499
+ file: tr,
500
+ onClose: () => nr(null)
461
501
  }),
462
- Bn && /* @__PURE__ */ g(Ie, {
463
- title: Wn("saveTitle"),
464
- submitLabel: Wn("save"),
465
- share: { allowed: zn },
466
- onClose: () => Vn(!1),
502
+ $n && /* @__PURE__ */ _(Ie, {
503
+ title: rr("saveTitle"),
504
+ submitLabel: rr("save"),
505
+ share: { allowed: Qn },
506
+ onClose: () => er(!1),
467
507
  onSubmit: async ({ name: e, shared: t }) => {
468
- let n = await Mn.mutateAsync({
508
+ let n = await Wn.mutateAsync({
469
509
  name: e,
470
510
  shared: t,
471
- filters: Q
511
+ filters: Yn
472
512
  });
473
- S(Be(n), !0);
513
+ C(Be(n), !0);
474
514
  }
475
515
  }),
476
- /* @__PURE__ */ _("div", {
516
+ /* @__PURE__ */ _(lt, {
517
+ open: !!Rn,
518
+ onClose: () => zn(null),
519
+ onConfirm: () => {
520
+ Rn?.(), zn(null), Fn();
521
+ },
522
+ title: s("archiveTitle", { count: U.size || 1 }),
523
+ description: s("archiveDescription"),
524
+ confirmLabel: s("archiveConfirm"),
525
+ destructive: !0
526
+ }),
527
+ /* @__PURE__ */ v("div", {
477
528
  className: "relative flex min-h-0 flex-1",
478
529
  children: [
479
- W.size > 0 && /* @__PURE__ */ _("div", {
530
+ U.size > 0 && /* @__PURE__ */ v("div", {
531
+ ref: In,
480
532
  role: "toolbar",
481
- "aria-label": s("selected", { count: W.size }),
533
+ "aria-label": s("selected", { count: U.size }),
482
534
  className: "absolute bottom-4 left-1/2 z-10 flex max-w-[calc(100%-2rem)] -translate-x-1/2 items-center gap-1 rounded-xl border border-border bg-popover py-1 pr-1 pl-3 text-sm shadow-md",
483
535
  children: [
484
- /* @__PURE__ */ g("span", {
536
+ /* @__PURE__ */ _("span", {
485
537
  className: "whitespace-nowrap tabular-nums",
486
- children: s("selected", { count: W.size })
538
+ children: q ? s("selectingAll", { count: Nn?.total ?? U.size }) : s("selected", { count: U.size })
487
539
  }),
488
- W.size < V.length && !k && /* @__PURE__ */ g(l, {
540
+ !q && (U.size < V.length || k) && /* @__PURE__ */ _(l, {
489
541
  size: "sm",
490
542
  variant: "ghost",
491
543
  className: "shrink-0",
492
- onClick: () => G(new Set(V.map((e) => e.id))),
493
- children: s("selectAll", { count: V.length })
544
+ onClick: Pn,
545
+ children: k ? s("selectAllMatching") : s("selectAll", { count: V.length })
494
546
  }),
495
- /* @__PURE__ */ g(ct, {
547
+ /* @__PURE__ */ _(ct, {
496
548
  label: s("actions"),
497
- items: vn(Cn),
549
+ items: xn(En),
498
550
  side: "top",
499
- trigger: /* @__PURE__ */ g(l, {
551
+ trigger: /* @__PURE__ */ _(l, {
500
552
  size: "sm",
501
553
  variant: "outline",
502
554
  className: "shrink-0",
503
555
  children: s("actions")
504
556
  })
505
557
  }),
506
- /* @__PURE__ */ g(u, {
558
+ /* @__PURE__ */ _(u, {
507
559
  size: "sm",
508
560
  variant: "ghost",
509
- icon: /* @__PURE__ */ g(se, {}),
561
+ icon: /* @__PURE__ */ _(se, {}),
510
562
  label: s("clear"),
511
- onClick: () => G(/* @__PURE__ */ new Set())
563
+ onClick: Fn
512
564
  })
513
565
  ]
514
566
  }),
515
- /* @__PURE__ */ _("div", {
516
- ref: kn,
517
- className: `min-h-0 min-w-0 flex-1 ${L ? "overflow-hidden" : "overflow-y-auto"} ${W.size > 0 ? "pb-16" : ""} transition-opacity ${Vt && !D ? "opacity-50" : ""}`,
567
+ /* @__PURE__ */ v("div", {
568
+ ref: Vn,
569
+ className: `min-h-0 min-w-0 flex-1 ${L ? "overflow-hidden" : "overflow-y-auto"} ${U.size > 0 ? "pb-16" : ""} transition-opacity ${Ht && !D ? "opacity-50" : ""}`,
518
570
  children: [
519
- R && /* @__PURE__ */ _("div", {
571
+ R && /* @__PURE__ */ v("div", {
520
572
  className: "flex h-8 items-center gap-2 border-b border-border px-5 text-xs text-muted-foreground",
521
573
  role: "status",
522
- children: [d("issueBreakdown.showing", { count: z.length }), /* @__PURE__ */ g("button", {
574
+ children: [d("issueBreakdown.showing", { count: z.length }), /* @__PURE__ */ _("button", {
523
575
  type: "button",
524
- onClick: () => dn(null),
576
+ onClick: () => fn(null),
525
577
  className: "text-primary hover:underline",
526
578
  children: d("issueBreakdown.showAll")
527
579
  })]
528
580
  }),
529
- L && D && /* @__PURE__ */ g(Ve, {
530
- workspace: y,
531
- columns: I === "status" && Pe[w].categories.length > 0 ? B.filter((e) => e.issues.length > 0 || e.key === "completed" || Pe[w].categories.includes(e.key)) : B,
532
- onMove: I === "none" ? void 0 : (e, t, n) => yn(e, I, t, n, B.find((e) => e.key === n)?.issues[0], Qt),
533
- onContextMenu: Dn
581
+ L && D && /* @__PURE__ */ _(Ve, {
582
+ workspace: b,
583
+ columns: I === "status" && Pe[T].categories.length > 0 ? B.filter((e) => e.issues.length > 0 || e.key === "completed" || Pe[T].categories.includes(e.key)) : B,
584
+ onMove: I === "none" ? void 0 : (e, t, n) => Sn(e, I, t, n, B.find((e) => e.key === n)?.issues[0], $t),
585
+ onContextMenu: An
534
586
  }),
535
- !L && /* @__PURE__ */ g(Ze, {
587
+ !L && /* @__PURE__ */ _(Ze, {
536
588
  groups: B,
537
- count: mn,
538
- scrollRef: kn,
539
- keepInView: U?.id,
540
- renderRow: (e, t) => /* @__PURE__ */ g(Ot, {
589
+ count: gn,
590
+ scrollRef: Vn,
591
+ keepInView: H?.id,
592
+ renderRow: (e, t) => /* @__PURE__ */ _(Ot, {
541
593
  issue: e,
542
- index: fn.get(e.id) ?? -1,
594
+ index: pn.get(e.id) ?? -1,
543
595
  place: t,
544
- team: hn.get(e.teamId),
545
- workspace: y,
546
- selected: e.id === U?.id,
547
- picked: W.has(e.id),
548
- viewers: xn.get(e.identifier) ?? Et,
549
- fields: tn,
550
- actions: On
596
+ team: _n.get(e.teamId),
597
+ workspace: b,
598
+ selected: e.id === H?.id,
599
+ picked: U.has(e.id),
600
+ viewers: wn.get(e.identifier) ?? Et,
601
+ fields: nn,
602
+ actions: jn
551
603
  }, e.id)
552
604
  }),
553
- D && k && /* @__PURE__ */ g("p", {
605
+ D && k && /* @__PURE__ */ _("p", {
554
606
  className: "flex h-10 items-center gap-2 px-5 text-xs text-muted-foreground",
555
607
  role: "status",
556
- children: H ? s("loadingCount", {
608
+ children: hn ? s("loadingCount", {
557
609
  loaded: A.length,
558
- total: H.total
610
+ total: hn.total
559
611
  }) : s("loadingMore", { loaded: A.length })
560
612
  }),
561
- !D && (O ? /* @__PURE__ */ g(t, { error: O }) : /* @__PURE__ */ g(wt, { rows: 8 })),
562
- D && !k && A.length === 0 && /* @__PURE__ */ g(kt, {
563
- workspace: y,
564
- filtered: !!x.q || w !== "active" || X.count > +!!jt,
565
- onCreate: () => Lt(x.team ? { team: x.team } : void 0)
613
+ !D && (O ? /* @__PURE__ */ _(t, { error: O }) : /* @__PURE__ */ _(wt, { rows: 8 })),
614
+ D && !k && A.length === 0 && /* @__PURE__ */ _(kt, {
615
+ workspace: b,
616
+ filtered: !!S.q || T !== "active" || X.count > +!!jt,
617
+ onCreate: () => Lt(S.team ? { team: S.team } : void 0)
566
618
  })
567
619
  ]
568
620
  }),
569
- nn && D && /* @__PURE__ */ g("aside", {
621
+ rn && D && /* @__PURE__ */ _("aside", {
570
622
  "aria-label": d("issueBreakdown.label"),
571
623
  className: "hidden w-80 shrink-0 overflow-y-auto border-l border-border px-4 py-4 xl:block",
572
- children: /* @__PURE__ */ g(Ye, {
573
- workspace: y,
624
+ children: /* @__PURE__ */ _(Ye, {
625
+ workspace: b,
574
626
  issues: A,
575
627
  tabs: nt,
576
- tab: ln,
577
- onTabChange: un,
628
+ tab: un,
629
+ onTabChange: dn,
578
630
  focus: R,
579
- onFocus: dn
631
+ onFocus: fn
580
632
  })
581
633
  })
582
634
  ]
@@ -585,7 +637,7 @@ function y({ person: e } = {}) {
585
637
  });
586
638
  }
587
639
  var Ot = d(function({ issue: e, index: t, place: n, team: r, workspace: i, selected: a, picked: ee, viewers: te, fields: ne, actions: o }) {
588
- return /* @__PURE__ */ g(s, {
640
+ return /* @__PURE__ */ _(s, {
589
641
  ref: n.ref,
590
642
  style: n.style,
591
643
  index: n.index,
@@ -603,19 +655,19 @@ var Ot = d(function({ issue: e, index: t, place: n, team: r, workspace: i, selec
603
655
  });
604
656
  });
605
657
  function kt({ workspace: e, filtered: t, onCreate: n }) {
606
- let r = h("issues.empty"), { data: i = [] } = v(ie(e)), a = _e(e, "manage_teams");
607
- return i.some((e) => !e.archivedAt) ? /* @__PURE__ */ _("div", {
658
+ let r = g("issues.empty"), { data: i = [] } = y(ie(e)), a = _e(e, "manage_teams");
659
+ return i.some((e) => !e.archivedAt) ? /* @__PURE__ */ v("div", {
608
660
  className: "mx-auto max-w-sm px-4 py-24 text-center",
609
661
  children: [
610
- /* @__PURE__ */ g("p", {
662
+ /* @__PURE__ */ _("p", {
611
663
  className: "text-sm font-medium",
612
664
  children: r(t ? "noMatch" : "nothingInProgress")
613
665
  }),
614
- /* @__PURE__ */ g("p", {
666
+ /* @__PURE__ */ _("p", {
615
667
  className: "mt-1 text-sm text-muted-foreground",
616
668
  children: r(t ? "tryAnother" : "pressC")
617
669
  }),
618
- !t && /* @__PURE__ */ g(l, {
670
+ !t && /* @__PURE__ */ _(l, {
619
671
  type: "button",
620
672
  variant: "primary",
621
673
  onClick: n,
@@ -623,18 +675,18 @@ function kt({ workspace: e, filtered: t, onCreate: n }) {
623
675
  children: r("create")
624
676
  })
625
677
  ]
626
- }) : /* @__PURE__ */ _("div", {
678
+ }) : /* @__PURE__ */ v("div", {
627
679
  className: "mx-auto max-w-sm px-4 py-24 text-center",
628
680
  children: [
629
- /* @__PURE__ */ g("p", {
681
+ /* @__PURE__ */ _("p", {
630
682
  className: "text-sm font-medium",
631
683
  children: r("noTeamsTitle")
632
684
  }),
633
- /* @__PURE__ */ g("p", {
685
+ /* @__PURE__ */ _("p", {
634
686
  className: "mt-1 text-sm text-muted-foreground",
635
687
  children: r(a ? "noTeamsDescription" : "noTeamsAskAdmin")
636
688
  }),
637
- a && /* @__PURE__ */ g(l, {
689
+ a && /* @__PURE__ */ _(l, {
638
690
  type: "button",
639
691
  variant: "primary",
640
692
  onClick: n,
@@ -653,4 +705,4 @@ function At(t, n) {
653
705
  let i = document.createElement("a");
654
706
  i.href = `${e}/api/v1/workspaces/${encodeURIComponent(t)}/exports/issues.csv?${r}`, i.download = "", i.click();
655
707
  }
656
- export { y as IssueList };
708
+ export { b as IssueList };