@parallelworks/tandem-web 0.160.1 → 0.161.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.
Files changed (36) hide show
  1. package/_virtual/_virtual_i18n/en/common.js +4 -0
  2. package/_virtual/_virtual_i18n/es/common.js +4 -0
  3. package/_virtual/_virtual_i18n/ja/common.js +4 -0
  4. package/_virtual/_virtual_i18n/ko/common.js +4 -0
  5. package/_virtual/_virtual_i18n/zh/common.js +4 -0
  6. package/api/mutations.js +16 -9
  7. package/api/queries.js +194 -140
  8. package/components/CommandPalette.js +5 -2
  9. package/components/CustomerRequests.js +81 -85
  10. package/components/DocLinkPicker.js +4 -1
  11. package/components/FavoritesNav.js +4 -1
  12. package/components/IssueFilters.js +90 -87
  13. package/components/IssueGroupList.js +72 -0
  14. package/components/IssueInsights.js +4 -1
  15. package/components/IssueRelations.js +8 -2
  16. package/components/IssueRow.js +73 -66
  17. package/components/IssueSection.js +30 -20
  18. package/components/NewIssueDialog.js +181 -175
  19. package/components/NewProjectDialog.js +64 -64
  20. package/components/Reports.js +4 -1
  21. package/components/TeamWorkflow.js +4 -1
  22. package/components/icons.js +61 -33
  23. package/lib/boardMove.js +13 -3
  24. package/lib/groupList.js +14 -0
  25. package/lib/issueMenu.js +8 -2
  26. package/lib/issuePicker.js +4 -1
  27. package/package.json +2 -1
  28. package/pages/issues.js +393 -340
  29. package/pages/triage.js +4 -1
  30. package/routes/_workspace/docs/_doc2.js +8 -2
  31. package/routes/_workspace/issues/_identifier2.js +8 -2
  32. package/routes/_workspace/issues/index.js +1 -1
  33. package/routes/_workspace/notifications2.js +4 -1
  34. package/routes/_workspace/teams/_key/settings2.js +180 -164
  35. package/routes/_workspace2.js +3 -3
  36. package/routes/_workspace3.js +11 -10
@@ -1,61 +1,61 @@
1
1
  import { api as e, unwrap as t } from "../api/client.js";
2
2
  import { useNavigate as n } from "../lib/router.js";
3
- import { cyclesQuery as r, issueTemplatesQuery as i, labelsQuery as a, statusesQuery as ee, teamsQuery as te } from "../api/queries.js";
4
- import { invalidateIssueViews as ne } from "../api/mutations.js";
5
- import { CalendarIcon as re, CycleIcon as ie, EstimateIcon as ae, FileTextIcon as oe, FolderIcon as se, PriorityIcon as ce, StatusIcon as le, TagIcon as ue, UserIcon as de, usePriorityNames as fe } from "./icons.js";
6
- import { useTime as pe } from "../lib/time.js";
7
- import { scalePoints as me, useEstimateLabel as he } from "./Planning.js";
8
- import { PickManyBox as ge, usePickMany as _e } from "../lib/pickMany.js";
9
- import { parseAssigneeKey as ve, useAssigneeOptions as ye } from "../lib/assignees.js";
10
- import { attachmentPrefix as be, insertPreviews as xe, readDataURL as Se, uploadAttachment as Ce } from "../lib/attachments.js";
11
- import { useCan as we } from "../lib/roles.js";
3
+ import { cyclesQuery as r, issueTemplatesQuery as i, labelsQuery as a, myTeamsQuery as ee, statusesQuery as te, teamsQuery as ne } from "../api/queries.js";
4
+ import { invalidateIssueViews as re } from "../api/mutations.js";
5
+ import { CalendarIcon as ie, CycleIcon as ae, EstimateIcon as oe, FileTextIcon as se, FolderIcon as ce, PriorityIcon as le, StatusIcon as ue, TagIcon as de, UserIcon as fe, usePriorityNames as pe } from "./icons.js";
6
+ import { useTime as me } from "../lib/time.js";
7
+ import { scalePoints as he, useEstimateLabel as ge } from "./Planning.js";
8
+ import { PickManyBox as _e, usePickMany as ve } from "../lib/pickMany.js";
9
+ import { parseAssigneeKey as ye, useAssigneeOptions as be } from "../lib/assignees.js";
10
+ import { attachmentPrefix as xe, insertPreviews as Se, readDataURL as Ce, uploadAttachment as we } from "../lib/attachments.js";
11
+ import { useCan as Te } from "../lib/roles.js";
12
12
  import { hasValue as o } from "../lib/customFields.js";
13
- import { useConfirm as Te } from "../lib/confirm.js";
14
- import { issueTypesQuery as Ee, typesFor as De } from "../lib/issueTypes.js";
15
- import { TypeIcon as Oe } from "./IssueTypes.js";
16
- import { NewIssueFields as ke } from "./CustomFields.js";
17
- import { AttachButton as Ae, useAttachmentsOn as je } from "./Attachments.js";
18
- import { Editor as Me } from "./Editor.js";
19
- import { withoutLink as Ne } from "../lib/markdownLinks.js";
20
- import { TeamForm as Pe } from "./TeamForm.js";
21
- import { Button as Fe, Combobox as s, CreateModal as Ie, DatePicker as Le, Modal as Re, buttonClasses as ze, toast as Be } from "@parallelworks/ui";
22
- import { useEffect as Ve, useRef as c, useState as l } from "react";
23
- import { useErrorMessage as He } from "@parallelworks/problem/react";
13
+ import { useConfirm as Ee } from "../lib/confirm.js";
14
+ import { issueTypesQuery as De, typesFor as Oe } from "../lib/issueTypes.js";
15
+ import { TypeIcon as ke } from "./IssueTypes.js";
16
+ import { NewIssueFields as Ae } from "./CustomFields.js";
17
+ import { AttachButton as je, useAttachmentsOn as Me } from "./Attachments.js";
18
+ import { Editor as Ne } from "./Editor.js";
19
+ import { withoutLink as Pe } from "../lib/markdownLinks.js";
20
+ import { TeamForm as Fe } from "./TeamForm.js";
21
+ import { Button as Ie, Combobox as s, CreateModal as Le, DatePicker as Re, Modal as ze, buttonClasses as Be, toast as Ve } from "@parallelworks/ui";
22
+ import { useEffect as He, useRef as c, useState as l } from "react";
23
+ import { useErrorMessage as Ue } from "@parallelworks/problem/react";
24
24
  import { useTranslations as u } from "use-intl";
25
- import { Fragment as Ue, jsx as d, jsxs as f } from "react/jsx-runtime";
26
- import { useQuery as p, useQueryClient as We, useSuspenseQuery as Ge } from "@tanstack/react-query";
25
+ import { Fragment as We, jsx as d, jsxs as f } from "react/jsx-runtime";
26
+ import { useQuery as p, useQueryClient as Ge, useSuspenseQuery as Ke } from "@tanstack/react-query";
27
27
  // src/components/NewIssueDialog.tsx
28
- function m({ workspace: m, defaultTeam: h, defaultTitle: Je = "", defaultBody: g = "", defaultArea: _, origin: v, defaults: y = {}, onCreated: Ye, onClose: b }) {
29
- let { data: Xe } = Ge(te(m)), x = Xe.filter((e) => !e.archivedAt), S = !Je && !g && !_ && !v && Object.keys(y).length === 0, [C] = l(() => S ? Ke(m) : void 0), [w, Ze] = l(h ?? x.find((e) => e.key === C?.team)?.key ?? x[0]?.key ?? ""), { data: Qe = [] } = p({
30
- ...ee(m, w),
28
+ function m({ workspace: m, defaultTeam: h, defaultTitle: Ye = "", defaultBody: g = "", defaultArea: _, origin: v, defaults: y = {}, onCreated: Xe, onClose: b }) {
29
+ let { data: Ze } = Ke(ee(m)), { data: Qe = [] } = p(ne(m)), $e = h && !Ze.some((e) => e.key === h) ? Qe.find((e) => e.key === h) : void 0, x = [...Ze, ...$e ? [$e] : []].filter((e) => !e.archivedAt), S = !Ye && !g && !_ && !v && Object.keys(y).length === 0, [C] = l(() => S ? qe(m) : void 0), [w, et] = l(h ?? x.find((e) => e.key === C?.team)?.key ?? x[0]?.key ?? ""), { data: T = [] } = p({
30
+ ...te(m, w),
31
31
  enabled: !!w
32
- }), { data: $e = [] } = p(a(m)), { data: T = [] } = p({
32
+ }), { data: tt = [] } = p(a(m)), { data: E = [] } = p({
33
33
  ...i(m, w),
34
34
  enabled: !!w
35
- }), [E, et] = l(null), tt = T.find((e) => e.id === E), [D, nt] = l(Je || C?.title || ""), O = c(D), rt = u("issueTemplates"), it = ye(m, !0), at = fe(), k = u("newIssue"), ot = He(), A = u("common"), j = we(m, "manage_teams"), [M, N] = l(g || C?.body || ""), st = c(M), [ct, lt] = l(y.statusId ?? null), [P, ut] = l(y.priority ?? 0), [F, dt] = l(0), [I, ft] = l(""), [L, pt] = l(y.cycleId ?? ""), R = u("planning"), mt = he(), ht = pe(), { data: gt = [] } = p({
35
+ }), [D, nt] = l(null), rt = E.find((e) => e.id === D), [O, it] = l(Ye || C?.title || ""), k = c(O), at = u("issueTemplates"), ot = be(m, !0), st = pe(), A = u("newIssue"), ct = Ue(), j = u("common"), M = Te(m, "manage_teams"), [N, P] = l(g || C?.body || ""), lt = c(N), [ut, dt] = l(y.statusId ?? null), [F, ft] = l(y.priority ?? 0), [I, pt] = l(0), [L, mt] = l(""), [R, ht] = l(y.cycleId ?? ""), z = u("planning"), gt = ge(), _t = me(), { data: vt = [] } = p({
36
36
  ...r(m, w),
37
37
  enabled: !!x.find((e) => e.key === w)?.cyclesEnabled
38
- }), _t = gt.find((e) => e.id === L), vt = (e) => e.name ? R("cycleNamed", {
38
+ }), yt = vt.find((e) => e.id === R), bt = (e) => e.name ? z("cycleNamed", {
39
39
  number: e.number,
40
40
  name: e.name
41
- }) : R("cycle", { number: e.number }), z = x.find((e) => e.key === w)?.estimateScale ?? "none", [B, yt] = l(y.assignees ?? []), [V, bt] = l(y.labelIds ?? []), [H, U] = l({}), [W, G] = l(null), { data: xt } = p(Ee(m)), K = De(xt, x.find((e) => e.key === w)?.id), q = K.find((e) => e.id === W), St = u("issueTypes"), [J, Y] = l(null), Ct = _e(J === "assignees", () => Y(null)), wt = _e(J === "labels", () => Y(null)), [Tt, Et] = l(null), Dt = We(), Ot = n(), { confirm: kt, dialog: At } = Te(), X = c(!1);
42
- Ve(() => {
41
+ }) : z("cycle", { number: e.number }), B = x.find((e) => e.key === w)?.estimateScale ?? "none", [V, xt] = l(y.assignees ?? []), [H, St] = l(y.labelIds ?? []), [U, W] = l({}), [G, Ct] = l(null), { data: wt } = p(De(m)), K = Oe(wt, x.find((e) => e.key === w)?.id), q = K.find((e) => e.id === G), Tt = u("issueTypes"), [J, Y] = l(null), Et = ve(J === "assignees", () => Y(null)), Dt = ve(J === "labels", () => Y(null)), [Ot, kt] = l(null), At = Ge(), jt = n(), { confirm: Mt, dialog: Nt } = Ee(), Pt = c(!1);
42
+ He(() => {
43
43
  let e = () => {
44
- S && qe(m, {
44
+ S && Je(m, {
45
45
  team: w,
46
- title: O.current,
47
- body: M
46
+ title: k.current,
47
+ body: N
48
48
  }), b();
49
49
  }, t = (t) => {
50
- if (!(t.key !== "Escape" || J !== null || X.current) && !document.querySelector("[role=\"menu\"], [role=\"listbox\"]")) {
51
- if (O.current === D && M === st.current) return e();
52
- X.current = !0, kt({
53
- title: k("closeTitle"),
54
- description: k(S ? "closeKeepsDraft" : "closeLoses"),
55
- confirmLabel: A("close"),
50
+ if (!(t.key !== "Escape" || J !== null || Pt.current) && !document.querySelector("[role=\"menu\"], [role=\"listbox\"]")) {
51
+ if (k.current === O && N === lt.current) return e();
52
+ Pt.current = !0, Mt({
53
+ title: A("closeTitle"),
54
+ description: A(S ? "closeKeepsDraft" : "closeLoses"),
55
+ confirmLabel: j("close"),
56
56
  onConfirm: async () => e()
57
57
  }).finally(() => {
58
- X.current = !1;
58
+ Pt.current = !1;
59
59
  });
60
60
  }
61
61
  };
@@ -65,13 +65,13 @@ function m({ workspace: m, defaultTeam: h, defaultTitle: Je = "", defaultBody: g
65
65
  S,
66
66
  m,
67
67
  w,
68
- M,
69
- D,
68
+ N,
69
+ O,
70
70
  b,
71
- kt,
72
- k,
73
- A
74
- ]), Ve(() => {
71
+ Mt,
72
+ A,
73
+ j
74
+ ]), He(() => {
75
75
  let e = (e) => {
76
76
  if (e.metaKey || e.ctrlKey || e.altKey || e.key.length !== 1 || document.activeElement && document.activeElement !== document.body) return;
77
77
  let t = document.querySelector("[role=\"dialog\"]");
@@ -81,32 +81,32 @@ function m({ workspace: m, defaultTeam: h, defaultTitle: Je = "", defaultBody: g
81
81
  };
82
82
  return window.addEventListener("keydown", e, !0), () => window.removeEventListener("keydown", e, !0);
83
83
  }, []);
84
- let jt = () => {
85
- S && qe(m, {
84
+ let Ft = () => {
85
+ S && Je(m, {
86
86
  team: w,
87
87
  title: "",
88
88
  body: ""
89
89
  }), b();
90
- }, Z = Qe.find((e) => e.id === ct) ?? Qe.find((e) => e.category === "unstarted"), Q = c(null), Mt = c(/* @__PURE__ */ new Map()), Nt = je(), Pt = u("issue.attachments"), Ft = async (e, t) => {
91
- if (!Nt) {
92
- Be.error(Pt("off", { name: e[0]?.name ?? "" }));
90
+ }, X = T.find((e) => e.id === ut) ?? T.find((e) => e.category === "unstarted"), Z = c(null), Q = c(/* @__PURE__ */ new Map()), It = Me(), Lt = u("issue.attachments"), Rt = async (e, t) => {
91
+ if (!It) {
92
+ Ve.error(Lt("off", { name: e[0]?.name ?? "" }));
93
93
  return;
94
94
  }
95
95
  let n = await Promise.all(e.map(async (e) => ({
96
96
  file: e,
97
- src: await Se(e)
97
+ src: await Ce(e)
98
98
  })));
99
- for (let { file: e, src: t } of n) Mt.current.set(t, e);
100
- Q.current && !Q.current.isDestroyed && xe(Q.current, n, t);
101
- }, It = async (t) => {
102
- let n = M;
103
- for (let [e, r] of Mt.current) if (M.includes(e)) try {
104
- let i = await Ce(m, t, r);
105
- n = n.replaceAll(`(${e})`, `(${be}${i.id})`);
99
+ for (let { file: e, src: t } of n) Q.current.set(t, e);
100
+ Z.current && !Z.current.isDestroyed && Se(Z.current, n, t);
101
+ }, zt = async (t) => {
102
+ let n = N;
103
+ for (let [e, r] of Q.current) if (N.includes(e)) try {
104
+ let i = await we(m, t, r);
105
+ n = n.replaceAll(`(${e})`, `(${xe}${i.id})`);
106
106
  } catch (t) {
107
- n = Ne(n, e), Be.error(k("attachFailed", {
107
+ n = Pe(n, e), Ve.error(A("attachFailed", {
108
108
  name: r.name,
109
- reason: ot(t)
109
+ reason: ct(t)
110
110
  }));
111
111
  }
112
112
  await e.PATCH("/api/v1/workspaces/{workspace}/issues/{identifier}", {
@@ -116,10 +116,10 @@ function m({ workspace: m, defaultTeam: h, defaultTitle: Je = "", defaultBody: g
116
116
  } },
117
117
  body: { body: n }
118
118
  });
119
- }, Lt = async (n, r) => {
119
+ }, Bt = async (n, r) => {
120
120
  if (!w) return !1;
121
- Et(null);
122
- let i = [...Mt.current.keys()].filter((e) => M.includes(e));
121
+ kt(null);
122
+ let i = [...Q.current.keys()].filter((e) => N.includes(e));
123
123
  try {
124
124
  let a = t(await e.POST("/api/v1/workspaces/{workspace}/teams/{key}/issues", {
125
125
  params: { path: {
@@ -128,22 +128,22 @@ function m({ workspace: m, defaultTeam: h, defaultTitle: Je = "", defaultBody: g
128
128
  } },
129
129
  body: {
130
130
  title: n,
131
- body: i.reduce(Ne, M),
132
- priority: P,
133
- ...Z && { statusId: Z.id },
134
- assignees: B.map(ve),
135
- labelIds: V,
131
+ body: i.reduce(Pe, N),
132
+ priority: F,
133
+ ...X && { statusId: X.id },
134
+ assignees: V.map(ye),
135
+ labelIds: H,
136
136
  ...q && { typeId: q.id },
137
- ...Object.values(H).some(o) && { fields: Object.fromEntries(Object.entries(H).filter(([, e]) => o(e))) },
138
- ...F && me(z).includes(F) && { estimate: F },
139
- ...I && { dueDate: I },
140
- ...L && { cycleId: L },
137
+ ...Object.values(U).some(o) && { fields: Object.fromEntries(Object.entries(U).filter(([, e]) => o(e))) },
138
+ ...I && he(B).includes(I) && { estimate: I },
139
+ ...L && { dueDate: L },
140
+ ...R && { cycleId: R },
141
141
  ...(!h || w === h) && _ && { area: _ },
142
142
  ...(!h || w === h) && v && { origin: v },
143
143
  ...(!h || w === h) && y.projectId && { projectId: y.projectId }
144
144
  }
145
145
  }));
146
- return i.length > 0 && await It(a.identifier), ne(Dt, m, a.identifier), Ye?.(a), r && Ot({
146
+ return i.length > 0 && await zt(a.identifier), re(At, m, a.identifier), Xe?.(a), r && jt({
147
147
  to: "/$workspace/issues/$identifier",
148
148
  params: {
149
149
  workspace: m,
@@ -151,95 +151,95 @@ function m({ workspace: m, defaultTeam: h, defaultTitle: Je = "", defaultBody: g
151
151
  }
152
152
  }), !0;
153
153
  } catch (e) {
154
- return Et(ot(e)), !1;
154
+ return kt(ct(e)), !1;
155
155
  }
156
- }, $ = ze({ size: "sm" });
157
- if (x.length === 0) return /* @__PURE__ */ d(Re, {
156
+ }, $ = Be({ size: "sm" });
157
+ if (x.length === 0) return /* @__PURE__ */ d(ze, {
158
158
  open: !0,
159
159
  onClose: b,
160
160
  size: "lg",
161
- title: k("noTeamTitle"),
162
- description: k(j ? "noTeamDescription" : "noTeamAskAdmin"),
163
- ...!j && { footer: /* @__PURE__ */ d(Fe, {
161
+ title: A("noTeamTitle"),
162
+ description: A(M ? "noTeamDescription" : "noTeamAskAdmin"),
163
+ ...!M && { footer: /* @__PURE__ */ d(Ie, {
164
164
  type: "button",
165
165
  onClick: b,
166
- children: A("close")
166
+ children: j("close")
167
167
  }) },
168
- children: j && /* @__PURE__ */ d(Pe, {
168
+ children: M && /* @__PURE__ */ d(Fe, {
169
169
  workspace: m,
170
170
  autoFocus: !0,
171
- onCreated: (e) => Ze(e.key)
171
+ onCreated: (e) => et(e.key)
172
172
  })
173
173
  });
174
- let Rt = x.find((e) => e.key === w);
175
- return /* @__PURE__ */ f(Ue, { children: [/* @__PURE__ */ d(Ie, {
174
+ let Vt = x.find((e) => e.key === w);
175
+ return /* @__PURE__ */ f(We, { children: [/* @__PURE__ */ d(Le, {
176
176
  open: !0,
177
- onClose: jt,
177
+ onClose: Ft,
178
178
  size: "xl",
179
- typeIcon: /* @__PURE__ */ d(se, { className: "size-3.5" }),
180
- typeLabel: Rt?.name ?? "",
179
+ typeIcon: /* @__PURE__ */ d(ce, { className: "size-3.5" }),
180
+ typeLabel: Vt?.name ?? "",
181
181
  typeMenu: x.map((e) => ({
182
182
  label: e.name,
183
183
  hint: e.key,
184
184
  checked: e.key === w,
185
185
  onClick: () => {
186
- Ze(e.key), lt(null), et(null), U({}), G(null), pt("");
186
+ et(e.key), dt(null), nt(null), W({}), Ct(null), ht("");
187
187
  }
188
188
  })),
189
189
  typeMenuSearch: {
190
- placeholder: k("moveToTeam"),
191
- empty: k("noTeamMatches")
190
+ placeholder: A("moveToTeam"),
191
+ empty: A("noTeamMatches")
192
192
  },
193
- namePlaceholder: k("issueTitle"),
194
- initialName: D,
193
+ namePlaceholder: A("issueTitle"),
194
+ initialName: O,
195
195
  onNameChange: (e) => {
196
- O.current = e;
196
+ k.current = e;
197
197
  },
198
- submitLabel: k("create"),
198
+ submitLabel: A("create"),
199
199
  descriptionField: /* @__PURE__ */ f("div", {
200
200
  className: "min-h-24 pb-2",
201
- children: [/* @__PURE__ */ d(Me, {
202
- value: M,
203
- onChange: N,
204
- onFiles: (e, t) => void Ft(e, t),
201
+ children: [/* @__PURE__ */ d(Ne, {
202
+ value: N,
203
+ onChange: P,
204
+ onFiles: (e, t) => void Rt(e, t),
205
205
  onEditor: (e) => {
206
- Q.current = e;
206
+ Z.current = e;
207
207
  },
208
208
  onSubmit: () => {},
209
- placeholder: k("descriptionPlaceholder"),
210
- label: A("description"),
209
+ placeholder: A("descriptionPlaceholder"),
210
+ label: j("description"),
211
211
  className: "min-h-24"
212
- }), /* @__PURE__ */ d(ke, {
212
+ }), /* @__PURE__ */ d(Ae, {
213
213
  workspace: m,
214
214
  teamId: x.find((e) => e.key === w)?.id,
215
- typeId: W,
216
- values: H,
217
- onChange: U
215
+ typeId: G,
216
+ values: U,
217
+ onChange: W
218
218
  })]
219
219
  }),
220
- dirty: M !== g || E !== null || ct !== null || P !== 0 || F !== 0 || I !== "" || L !== "" || B.length > 0 || V.length > 0 || W !== null || Object.values(H).some(o),
221
- footerHint: k("hint"),
222
- error: Tt,
223
- onSubmit: (e, t, n, { modifier: r }) => Lt(e, r),
224
- properties: /* @__PURE__ */ f(Ue, { children: [
225
- T.length > 0 && /* @__PURE__ */ d(s, {
220
+ dirty: N !== g || D !== null || ut !== null || F !== 0 || I !== 0 || L !== "" || R !== "" || V.length > 0 || H.length > 0 || G !== null || Object.values(U).some(o),
221
+ footerHint: A("hint"),
222
+ error: Ot,
223
+ onSubmit: (e, t, n, { modifier: r }) => Bt(e, r),
224
+ properties: /* @__PURE__ */ f(We, { children: [
225
+ E.length > 0 && /* @__PURE__ */ d(s, {
226
226
  open: J === "template",
227
227
  onOpenChange: (e) => Y(e ? "template" : null),
228
- items: T.map((e) => ({
228
+ items: E.map((e) => ({
229
229
  value: e.id,
230
230
  label: e.name,
231
- icon: /* @__PURE__ */ d(oe, { className: "size-3.5 text-muted-foreground" })
231
+ icon: /* @__PURE__ */ d(se, { className: "size-3.5 text-muted-foreground" })
232
232
  })),
233
- value: E,
233
+ value: D,
234
234
  onValueChange: (e) => {
235
- let t = T.find((t) => t.id === e);
236
- t && (et(t.id), t.title && (nt(t.title), O.current = t.title), N(t.body), ut(t.priority), bt(t.labelIds), U(t.fields), G(t.typeId ?? null));
235
+ let t = E.find((t) => t.id === e);
236
+ t && (nt(t.id), t.title && (it(t.title), k.current = t.title), P(t.body), ft(t.priority), St(t.labelIds), W(t.fields), Ct(t.typeId ?? null));
237
237
  },
238
- placeholder: rt("choose"),
238
+ placeholder: at("choose"),
239
239
  trigger: /* @__PURE__ */ f("button", {
240
240
  type: "button",
241
241
  className: $,
242
- children: [/* @__PURE__ */ d(oe, { className: "size-3.5" }), tt?.name ?? rt("choose")]
242
+ children: [/* @__PURE__ */ d(se, { className: "size-3.5" }), rt?.name ?? at("choose")]
243
243
  })
244
244
  }),
245
245
  K.length > 0 && /* @__PURE__ */ d(s, {
@@ -248,41 +248,47 @@ function m({ workspace: m, defaultTeam: h, defaultTitle: Je = "", defaultBody: g
248
248
  items: K.map((e) => ({
249
249
  value: e.id,
250
250
  label: e.name,
251
- icon: /* @__PURE__ */ d(Oe, {
251
+ icon: /* @__PURE__ */ d(ke, {
252
252
  type: e,
253
253
  className: "size-3.5"
254
254
  })
255
255
  })),
256
- value: W,
256
+ value: G,
257
257
  onValueChange: (e) => {
258
258
  let t = K.find((t) => t.id === e);
259
- G(t?.id ?? null), t?.template && !M.trim() && N(t.template);
259
+ Ct(t?.id ?? null), t?.template && !N.trim() && P(t.template);
260
260
  },
261
- placeholder: St("type"),
261
+ placeholder: Tt("type"),
262
262
  trigger: /* @__PURE__ */ f("button", {
263
263
  type: "button",
264
264
  className: $,
265
- children: [q && /* @__PURE__ */ d(Oe, {
265
+ children: [q && /* @__PURE__ */ d(ke, {
266
266
  type: q,
267
267
  className: "size-3.5"
268
- }), q?.name ?? St("type")]
268
+ }), q?.name ?? Tt("type")]
269
269
  })
270
270
  }),
271
271
  /* @__PURE__ */ d(s, {
272
272
  open: J === "status",
273
273
  onOpenChange: (e) => Y(e ? "status" : null),
274
- items: Qe.map((e) => ({
274
+ items: T.map((e) => ({
275
275
  value: e.id,
276
276
  label: e.name,
277
- icon: /* @__PURE__ */ d(le, { category: e.category })
277
+ icon: /* @__PURE__ */ d(ue, {
278
+ category: e.category,
279
+ step: e.step
280
+ })
278
281
  })),
279
- value: Z?.id ?? null,
280
- onValueChange: (e) => e !== null && lt(e),
281
- placeholder: k("changeStatus"),
282
+ value: X?.id ?? null,
283
+ onValueChange: (e) => e !== null && dt(e),
284
+ placeholder: A("changeStatus"),
282
285
  trigger: /* @__PURE__ */ f("button", {
283
286
  type: "button",
284
287
  className: $,
285
- children: [Z && /* @__PURE__ */ d(le, { category: Z.category }), Z?.name ?? A("status")]
288
+ children: [X && /* @__PURE__ */ d(ue, {
289
+ category: X.category,
290
+ step: X.step
291
+ }), X?.name ?? j("status")]
286
292
  })
287
293
  }),
288
294
  /* @__PURE__ */ d(s, {
@@ -296,115 +302,115 @@ function m({ workspace: m, defaultTeam: h, defaultTitle: Je = "", defaultBody: g
296
302
  0
297
303
  ].map((e) => ({
298
304
  value: String(e),
299
- label: at[e] ?? "",
300
- icon: /* @__PURE__ */ d(ce, { priority: e })
305
+ label: st[e] ?? "",
306
+ icon: /* @__PURE__ */ d(le, { priority: e })
301
307
  })),
302
- value: String(P),
303
- onValueChange: (e) => e !== null && ut(Number(e)),
304
- placeholder: k("setPriority"),
308
+ value: String(F),
309
+ onValueChange: (e) => e !== null && ft(Number(e)),
310
+ placeholder: A("setPriority"),
305
311
  trigger: /* @__PURE__ */ f("button", {
306
312
  type: "button",
307
313
  className: $,
308
- children: [/* @__PURE__ */ d(ce, { priority: P }), P ? at[P] : A("priority")]
314
+ children: [/* @__PURE__ */ d(le, { priority: F }), F ? st[F] : j("priority")]
309
315
  })
310
316
  }),
311
317
  /* @__PURE__ */ d(s, {
312
318
  multiple: !0,
313
319
  open: J === "assignees",
314
320
  onOpenChange: (e) => Y(e ? "assignees" : null),
315
- items: it,
316
- value: B,
321
+ items: ot,
322
+ value: V,
317
323
  onValueChange: (e) => {
318
- yt(e), Ct();
324
+ xt(e), Et();
319
325
  },
320
- placeholder: k("assignTo"),
326
+ placeholder: A("assignTo"),
321
327
  trigger: /* @__PURE__ */ f("button", {
322
328
  type: "button",
323
329
  className: $,
324
- children: [/* @__PURE__ */ d(de, { className: "size-3.5" }), B.length ? k("assignedCount", { count: B.length }) : A("assignee")]
330
+ children: [/* @__PURE__ */ d(fe, { className: "size-3.5" }), V.length ? A("assignedCount", { count: V.length }) : j("assignee")]
325
331
  })
326
332
  }),
327
333
  /* @__PURE__ */ d(s, {
328
334
  multiple: !0,
329
335
  open: J === "labels",
330
336
  onOpenChange: (e) => Y(e ? "labels" : null),
331
- items: $e.map((e) => ({
337
+ items: tt.map((e) => ({
332
338
  value: e.id,
333
339
  label: e.name,
334
340
  icon: /* @__PURE__ */ f("span", {
335
341
  className: "flex items-center gap-2",
336
- children: [/* @__PURE__ */ d(ge, {}), /* @__PURE__ */ d("span", {
342
+ children: [/* @__PURE__ */ d(_e, {}), /* @__PURE__ */ d("span", {
337
343
  className: "size-2.5 rounded-full",
338
344
  style: { background: e.color }
339
345
  })]
340
346
  })
341
347
  })),
342
- value: V,
348
+ value: H,
343
349
  onValueChange: (e) => {
344
- bt(e), wt();
350
+ St(e), Dt();
345
351
  },
346
- placeholder: k("addLabels"),
352
+ placeholder: A("addLabels"),
347
353
  trigger: /* @__PURE__ */ f("button", {
348
354
  type: "button",
349
355
  className: $,
350
- children: [/* @__PURE__ */ d(ue, { className: "size-3.5" }), V.length ? k("labelCount", { count: V.length }) : A("labels")]
356
+ children: [/* @__PURE__ */ d(de, { className: "size-3.5" }), H.length ? A("labelCount", { count: H.length }) : j("labels")]
351
357
  })
352
358
  }),
353
- z !== "none" && /* @__PURE__ */ d(s, {
359
+ B !== "none" && /* @__PURE__ */ d(s, {
354
360
  open: J === "estimate",
355
361
  onOpenChange: (e) => Y(e ? "estimate" : null),
356
- items: [0, ...me(z)].map((e) => ({
362
+ items: [0, ...he(B)].map((e) => ({
357
363
  value: String(e),
358
- label: e ? mt(e, z) : R("noEstimate")
364
+ label: e ? gt(e, B) : z("noEstimate")
359
365
  })),
360
- value: String(F),
361
- onValueChange: (e) => e !== null && dt(Number(e)),
362
- placeholder: R("setEstimate"),
366
+ value: String(I),
367
+ onValueChange: (e) => e !== null && pt(Number(e)),
368
+ placeholder: z("setEstimate"),
363
369
  trigger: /* @__PURE__ */ f("button", {
364
370
  type: "button",
365
371
  className: $,
366
- children: [/* @__PURE__ */ d(ae, { className: "size-3.5" }), F ? mt(F, z) : R("estimate")]
372
+ children: [/* @__PURE__ */ d(oe, { className: "size-3.5" }), I ? gt(I, B) : z("estimate")]
367
373
  })
368
374
  }),
369
- Rt?.cyclesEnabled && /* @__PURE__ */ d(s, {
375
+ Vt?.cyclesEnabled && /* @__PURE__ */ d(s, {
370
376
  open: J === "cycle",
371
377
  onOpenChange: (e) => Y(e ? "cycle" : null),
372
378
  items: [{
373
379
  value: "",
374
- label: R("noCycle")
375
- }, ...gt.filter((e) => e.state !== "past").map((e) => ({
380
+ label: z("noCycle")
381
+ }, ...vt.filter((e) => e.state !== "past").map((e) => ({
376
382
  value: e.id,
377
- label: vt(e),
378
- description: R("stateAndDates", {
379
- state: R(`states.${e.state}`),
380
- dates: ht.dayRange(e.startsOn, e.endsOn)
383
+ label: bt(e),
384
+ description: z("stateAndDates", {
385
+ state: z(`states.${e.state}`),
386
+ dates: _t.dayRange(e.startsOn, e.endsOn)
381
387
  })
382
388
  }))],
383
- value: L,
384
- onValueChange: (e) => e !== null && pt(e),
385
- placeholder: R("cycleLabel"),
389
+ value: R,
390
+ onValueChange: (e) => e !== null && ht(e),
391
+ placeholder: z("cycleLabel"),
386
392
  trigger: /* @__PURE__ */ f("button", {
387
393
  type: "button",
388
394
  className: $,
389
- children: [/* @__PURE__ */ d(ie, { className: "size-3.5" }), _t ? vt(_t) : R("cycleLabel")]
395
+ children: [/* @__PURE__ */ d(ae, { className: "size-3.5" }), yt ? bt(yt) : z("cycleLabel")]
390
396
  })
391
397
  }),
392
- /* @__PURE__ */ d(Le, {
393
- value: I,
394
- onValueChange: ft,
395
- "aria-label": R("dueDate"),
398
+ /* @__PURE__ */ d(Re, {
399
+ value: L,
400
+ onValueChange: mt,
401
+ "aria-label": z("dueDate"),
396
402
  trigger: /* @__PURE__ */ f("button", {
397
403
  type: "button",
398
404
  className: $,
399
- children: [/* @__PURE__ */ d(re, { className: "size-3.5" }), I ? R("dueOn", { date: ht.day(I) }) : R("dueDate")]
405
+ children: [/* @__PURE__ */ d(ie, { className: "size-3.5" }), L ? z("dueOn", { date: _t.day(L) }) : z("dueDate")]
400
406
  })
401
407
  }),
402
- /* @__PURE__ */ d(Ae, { onFiles: (e) => void Ft(e) })
408
+ /* @__PURE__ */ d(je, { onFiles: (e) => void Rt(e) })
403
409
  ] })
404
- }), At] });
410
+ }), Nt] });
405
411
  }
406
412
  var h = (e) => `tandem:new-issue-draft:${e}`;
407
- function Ke(e) {
413
+ function qe(e) {
408
414
  try {
409
415
  let t = JSON.parse(localStorage.getItem(h(e)) ?? "null");
410
416
  return t && typeof t.title == "string" && typeof t.body == "string" ? t : void 0;
@@ -412,7 +418,7 @@ function Ke(e) {
412
418
  return;
413
419
  }
414
420
  }
415
- function qe(e, t) {
421
+ function Je(e, t) {
416
422
  try {
417
423
  t.title.trim() || t.body.trim() ? localStorage.setItem(h(e), JSON.stringify(t)) : localStorage.removeItem(h(e));
418
424
  } catch {}