@parallelworks/tandem-web 0.138.2 → 0.139.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.
Files changed (71) hide show
  1. package/components/AgentWork.js +35 -35
  2. package/components/AppRoot.js +4 -4
  3. package/components/AreaWork.js +1 -1
  4. package/components/BlockHandle.js +3 -3
  5. package/components/CommandPalette.js +27 -27
  6. package/components/DateChip.js +27 -27
  7. package/components/DocLinkPicker.js +17 -17
  8. package/components/Graph.js +6 -6
  9. package/components/HoverCards.js +30 -29
  10. package/components/IssueListBlock.js +83 -83
  11. package/components/LinkCard.js +20 -20
  12. package/components/MentionPicker.js +12 -12
  13. package/components/NewIssueDialog.js +116 -116
  14. package/components/NewProjectDialog.js +5 -4
  15. package/components/Planning.js +31 -43
  16. package/components/RouterLink.js +4 -4
  17. package/components/ShareDialog.js +12 -12
  18. package/components/SharedUI.js +19 -19
  19. package/components/SlashMenu.js +11 -11
  20. package/components/SubPages.js +10 -10
  21. package/components/UnlinkedMentions.js +10 -10
  22. package/components/WorkCounts.js +8 -8
  23. package/components/settings.js +26 -26
  24. package/hostedApp.js +36 -36
  25. package/hosting.d.ts +24 -11
  26. package/index.js +58 -27
  27. package/lib/base.js +1 -14
  28. package/lib/docs.js +6 -6
  29. package/lib/issueMenu.js +33 -33
  30. package/lib/knowledge.js +90 -101
  31. package/lib/knowledgeKinds.js +14 -0
  32. package/lib/projectList.js +1 -1
  33. package/lib/projectStates.js +15 -0
  34. package/lib/router.js +20 -34
  35. package/package.json +2 -2
  36. package/pages/areas.js +147 -147
  37. package/pages/decisions.js +40 -40
  38. package/pages/issues.js +4 -4
  39. package/pages/projects.js +232 -231
  40. package/pages/triage.js +86 -86
  41. package/pages.js +21 -0
  42. package/routes/__root.js +6 -6
  43. package/routes/_workspace/docs/_doc2.js +12 -12
  44. package/routes/_workspace/docs2.js +8 -8
  45. package/routes/_workspace/graph2.js +9 -9
  46. package/routes/_workspace/issues/_identifier2.js +327 -327
  47. package/routes/_workspace/issues/index.js +6 -6
  48. package/routes/_workspace/knowledge/_term2.js +125 -124
  49. package/routes/_workspace/knowledge/index.js +8 -8
  50. package/routes/_workspace/knowledge/index2.js +22 -21
  51. package/routes/_workspace/measures2.js +4 -4
  52. package/routes/_workspace/people/_username.js +4 -4
  53. package/routes/_workspace/projects/_projectId3.js +264 -263
  54. package/routes/_workspace/projects/index.js +7 -7
  55. package/routes/_workspace/settings/account2.js +3 -3
  56. package/routes/_workspace/settings/audit-log2.js +4 -4
  57. package/routes/_workspace/settings/audit-log3.js +51 -51
  58. package/routes/_workspace/settings/labels2.js +14 -14
  59. package/routes/_workspace/settings/members2.js +9 -9
  60. package/routes/_workspace/settings/runners2.js +11 -11
  61. package/routes/_workspace/settings/teams2.js +15 -15
  62. package/routes/_workspace/settings/tokens2.js +5 -5
  63. package/routes/_workspace/settings/webhooks2.js +7 -7
  64. package/routes/_workspace/settings2.js +3 -3
  65. package/routes/_workspace/teams/_key/cycles/_number2.js +8 -8
  66. package/routes/_workspace/teams/_key/cycles/index2.js +20 -20
  67. package/routes/_workspace/teams/_key/issues.js +4 -4
  68. package/routes/_workspace/teams/_key/projects.js +4 -4
  69. package/routes/_workspace/teams/_key/settings2.js +8 -8
  70. package/routes/_workspace2.js +319 -319
  71. package/routes/docs/route2.js +15 -15
@@ -1,11 +1,11 @@
1
1
  import { api as e, unwrap as t } from "../api/client.js";
2
2
  import { externalUrl as n } from "../lib/externalUrl.js";
3
3
  import { Button as r, ErrorText as i, Input as a } from "@parallelworks/ui";
4
- import { useEffect as o, useState as s } from "react";
5
- import { useErrorMessage as c } from "@parallelworks/problem/react";
6
- import { useTranslations as l } from "use-intl";
7
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
8
- import { useParams as f } from "@tanstack/react-router";
4
+ import { useParams as o } from "@tanstack/react-router";
5
+ import { useEffect as s, useState as c } from "react";
6
+ import { useErrorMessage as l } from "@parallelworks/problem/react";
7
+ import { useTranslations as u } from "use-intl";
8
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
9
9
  import { useMutation as p } from "@tanstack/react-query";
10
10
  import { GlobeIcon as m } from "@parallelworks/ui/icons";
11
11
  import { Node as h, NodeViewWrapper as g, ReactNodeViewRenderer as _, mergeAttributes as v } from "@tiptap/react";
@@ -70,7 +70,7 @@ function x(e) {
70
70
  } else e.chain().focus().insertContent(i).run();
71
71
  }
72
72
  function S({ node: h, updateAttributes: _, editor: v }) {
73
- let y = l("linkCard"), b = c(), { workspace: x = "" } = f({ strict: !1 }), S = String(h.attrs.url ?? ""), C = String(h.attrs.title ?? ""), [w, T] = s(""), E = p({
73
+ let y = u("linkCard"), b = l(), { workspace: x = "" } = o({ strict: !1 }), S = String(h.attrs.url ?? ""), C = String(h.attrs.title ?? ""), [w, T] = c(""), E = p({
74
74
  mutationFn: async (n) => t(await e.POST("/api/v1/workspaces/{workspace}/link-previews", {
75
75
  params: { path: { workspace: x } },
76
76
  body: { url: n }
@@ -83,24 +83,24 @@ function S({ node: h, updateAttributes: _, editor: v }) {
83
83
  icon: e.icon ?? ""
84
84
  })
85
85
  }), D = !!S && !C && v.isEditable && !!x, { mutate: O, isIdle: k } = E;
86
- if (o(() => {
86
+ if (s(() => {
87
87
  D && k && O(S);
88
88
  }, [
89
89
  D,
90
90
  k,
91
91
  O,
92
92
  S
93
- ]), !S) return /* @__PURE__ */ u(g, {
93
+ ]), !S) return /* @__PURE__ */ d(g, {
94
94
  className: "link-card link-card-empty",
95
95
  contentEditable: !1,
96
- children: /* @__PURE__ */ d("form", {
96
+ children: /* @__PURE__ */ f("form", {
97
97
  "data-card-ui": !0,
98
98
  className: "flex flex-wrap items-center gap-2",
99
99
  onSubmit: (e) => {
100
100
  e.preventDefault(), w.trim() && E.mutate(w.trim());
101
101
  },
102
102
  children: [
103
- /* @__PURE__ */ u(a, {
103
+ /* @__PURE__ */ d(a, {
104
104
  value: w,
105
105
  onChange: (e) => T(e.target.value),
106
106
  placeholder: "https://",
@@ -108,14 +108,14 @@ function S({ node: h, updateAttributes: _, editor: v }) {
108
108
  className: "min-w-0 flex-1",
109
109
  disabled: !v.isEditable
110
110
  }),
111
- /* @__PURE__ */ u(r, {
111
+ /* @__PURE__ */ d(r, {
112
112
  type: "submit",
113
113
  size: "sm",
114
114
  variant: "primary",
115
115
  loading: E.isPending,
116
116
  children: y("make")
117
117
  }),
118
- E.error && /* @__PURE__ */ u(i, {
118
+ E.error && /* @__PURE__ */ d(i, {
119
119
  className: "w-full",
120
120
  children: b(E.error)
121
121
  })
@@ -129,34 +129,34 @@ function S({ node: h, updateAttributes: _, editor: v }) {
129
129
  return S;
130
130
  }
131
131
  })(), M = String(h.attrs.icon ?? "");
132
- return /* @__PURE__ */ u(g, {
132
+ return /* @__PURE__ */ d(g, {
133
133
  className: "link-card",
134
134
  contentEditable: !1,
135
135
  "data-drag-handle": !0,
136
- children: /* @__PURE__ */ u("a", {
136
+ children: /* @__PURE__ */ d("a", {
137
137
  href: A,
138
138
  target: "_blank",
139
139
  rel: "noreferrer noopener",
140
140
  className: "link-card-link",
141
141
  "data-card-ui": !0,
142
- children: /* @__PURE__ */ d("span", {
142
+ children: /* @__PURE__ */ f("span", {
143
143
  className: "min-w-0 flex-1",
144
144
  children: [
145
- /* @__PURE__ */ u("span", {
145
+ /* @__PURE__ */ d("span", {
146
146
  className: "link-card-title",
147
147
  children: C || (E.isPending ? y("reading") : j)
148
148
  }),
149
- h.attrs.description && /* @__PURE__ */ u("span", {
149
+ h.attrs.description && /* @__PURE__ */ d("span", {
150
150
  className: "link-card-description",
151
151
  children: String(h.attrs.description)
152
152
  }),
153
- /* @__PURE__ */ d("span", {
153
+ /* @__PURE__ */ f("span", {
154
154
  className: "link-card-site",
155
- children: [M.startsWith("data:image/") ? /* @__PURE__ */ u("img", {
155
+ children: [M.startsWith("data:image/") ? /* @__PURE__ */ d("img", {
156
156
  src: M,
157
157
  alt: "",
158
158
  className: "size-4 shrink-0 rounded-sm"
159
- }) : /* @__PURE__ */ u(m, { className: "size-4 shrink-0" }), /* @__PURE__ */ u("span", {
159
+ }) : /* @__PURE__ */ d(m, { className: "size-4 shrink-0" }), /* @__PURE__ */ d("span", {
160
160
  className: "truncate",
161
161
  children: h.attrs.siteName || j
162
162
  })]
@@ -3,10 +3,10 @@ import { usePeople as t } from "../lib/people.js";
3
3
  import { datesFor as n, isoDate as r } from "../lib/datePhrases.js";
4
4
  import { useEditorListbox as i } from "./editorListbox.js";
5
5
  import { Avatar as a, ListboxOption as o, ListboxPanel as s, useListboxNavigation as c } from "@parallelworks/ui";
6
- import { useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
7
- import { useFormatter as p, useTranslations as m } from "use-intl";
8
- import { jsx as h } from "react/jsx-runtime";
9
- import { useParams as g } from "@tanstack/react-router";
6
+ import { useParams as l } from "@tanstack/react-router";
7
+ import { useEffect as u, useMemo as d, useRef as f, useState as p } from "react";
8
+ import { useFormatter as m, useTranslations as h } from "use-intl";
9
+ import { jsx as g } from "react/jsx-runtime";
10
10
  // src/components/MentionPicker.tsx
11
11
  function _(e) {
12
12
  let { selection: t } = e.state;
@@ -25,7 +25,7 @@ function _(e) {
25
25
  };
26
26
  }
27
27
  function v({ editor: v }) {
28
- let { workspace: y } = g({ strict: !1 }), b = m("mentions"), x = m("dateChip"), { members: S } = t(y ?? ""), [C, w] = f(null), T = p(), E = u(() => {
28
+ let { workspace: y } = l({ strict: !1 }), b = h("mentions"), x = h("dateChip"), { members: S } = t(y ?? ""), [C, w] = p(null), T = m(), E = d(() => {
29
29
  let e = (C?.query ?? "").toLowerCase(), t = n(e).map((e) => ({
30
30
  kind: "date",
31
31
  date: e
@@ -39,7 +39,7 @@ function v({ editor: v }) {
39
39
  }));
40
40
  return [...t, ...r];
41
41
  }, [S, C?.query]);
42
- l(() => {
42
+ u(() => {
43
43
  if (!v) return;
44
44
  let e = () => {
45
45
  w(v.isEditable && v.isFocused ? _(v) : null), A.current(0);
@@ -64,8 +64,8 @@ function v({ editor: v }) {
64
64
  onChoose: (e) => D(e),
65
65
  onDismiss: () => w(null),
66
66
  open: O
67
- }), A = d(k.setActive);
68
- return A.current = k.setActive, i(v, k, O), !C || !O ? null : /* @__PURE__ */ h(s, {
67
+ }), A = f(k.setActive);
68
+ return A.current = k.setActive, i(v, k, O), !C || !O ? null : /* @__PURE__ */ g(s, {
69
69
  at: {
70
70
  clientX: C.x,
71
71
  clientY: C.y
@@ -75,18 +75,18 @@ function v({ editor: v }) {
75
75
  "aria-label": b("label"),
76
76
  footer: b("hint"),
77
77
  className: "w-64 text-sm",
78
- children: E.map((t, n) => t.kind === "date" ? /* @__PURE__ */ h(o, {
78
+ children: E.map((t, n) => t.kind === "date" ? /* @__PURE__ */ g(o, {
79
79
  option: k.optionProps(n),
80
- icon: /* @__PURE__ */ h(e, { className: "size-4" }),
80
+ icon: /* @__PURE__ */ g(e, { className: "size-4" }),
81
81
  label: T.dateTime(t.date, {
82
82
  weekday: "long",
83
83
  month: "long",
84
84
  day: "numeric"
85
85
  }),
86
86
  hint: x("suggest")
87
- }, `date:${r(t.date)}`) : /* @__PURE__ */ h(o, {
87
+ }, `date:${r(t.date)}`) : /* @__PURE__ */ g(o, {
88
88
  option: k.optionProps(n),
89
- icon: /* @__PURE__ */ h(a, {
89
+ icon: /* @__PURE__ */ g(a, {
90
90
  name: t.name,
91
91
  src: t.avatarUrl,
92
92
  size: "xs",
@@ -2,52 +2,52 @@ import { api as e, unwrap as t } from "../api/client.js";
2
2
  import { useNavigate as n } from "../lib/router.js";
3
3
  import { cyclesQuery as r, issueTemplatesQuery as i, labelsQuery as a, statusesQuery as ee, teamsQuery as te } from "../api/queries.js";
4
4
  import { CalendarIcon as ne, CycleIcon as re, EstimateIcon as ie, FileTextIcon as o, FolderIcon as ae, PriorityIcon as s, StatusIcon as oe, TagIcon as se, UserIcon as ce, usePriorityNames as le } from "./icons.js";
5
- import { useTime as ue } from "../lib/time.js";
6
- import { scalePoints as c, useEstimateLabel as de } from "./Planning.js";
7
- import { invalidateIssueViews as fe } from "../api/mutations.js";
8
- import { PickManyBox as pe, usePickMany as me } from "../lib/pickMany.js";
9
- import { parseAssigneeKey as he, useAssigneeOptions as ge } from "../lib/assignees.js";
10
- import { useCan as _e } from "../lib/roles.js";
11
- import { useConfirm as ve } from "../lib/confirm.js";
12
- import { attachmentPrefix as ye, insertPreviews as be, readDataURL as xe, uploadAttachment as Se } from "../lib/attachments.js";
13
- import { withoutLink as Ce } from "../lib/markdownLinks.js";
14
- import { AttachButton as we, useAttachmentsOn as Te } from "./Attachments.js";
15
- import { Editor as Ee } from "./Editor.js";
16
- import { TeamForm as De } from "./TeamForm.js";
17
- import { Button as Oe, Combobox as l, CreateModal as ke, DatePicker as Ae, Modal as je, buttonClasses as Me, toast as u } from "@parallelworks/ui";
18
- import { useEffect as Ne, useRef as d, useState as f } from "react";
19
- import { useErrorMessage as Pe } from "@parallelworks/problem/react";
20
- import { useTranslations as p } from "use-intl";
21
- import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
22
- import { useQuery as _, useQueryClient as Fe, useSuspenseQuery as Ie } from "@tanstack/react-query";
5
+ import { invalidateIssueViews as ue } from "../api/mutations.js";
6
+ import { useTime as de } from "../lib/time.js";
7
+ import { scalePoints as fe, useEstimateLabel as pe } from "./Planning.js";
8
+ import { PickManyBox as me, usePickMany as he } from "../lib/pickMany.js";
9
+ import { parseAssigneeKey as ge, useAssigneeOptions as _e } from "../lib/assignees.js";
10
+ import { useCan as ve } from "../lib/roles.js";
11
+ import { useConfirm as ye } from "../lib/confirm.js";
12
+ import { attachmentPrefix as be, insertPreviews as xe, readDataURL as Se, uploadAttachment as Ce } from "../lib/attachments.js";
13
+ import { withoutLink as we } from "../lib/markdownLinks.js";
14
+ import { AttachButton as Te, useAttachmentsOn as Ee } from "./Attachments.js";
15
+ import { Editor as De } from "./Editor.js";
16
+ import { TeamForm as Oe } from "./TeamForm.js";
17
+ import { Button as ke, Combobox as c, CreateModal as Ae, DatePicker as je, Modal as Me, buttonClasses as Ne, toast as l } from "@parallelworks/ui";
18
+ import { useEffect as Pe, useRef as u, useState as d } from "react";
19
+ import { useErrorMessage as Fe } from "@parallelworks/problem/react";
20
+ import { useTranslations as f } from "use-intl";
21
+ import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
22
+ import { useQuery as g, useQueryClient as Ie, useSuspenseQuery as Le } from "@tanstack/react-query";
23
23
  // src/components/NewIssueDialog.tsx
24
- function v({ workspace: v, defaultTeam: y, defaultTitle: ze = "", defaultBody: b = "", defaultArea: x, origin: S, defaults: C = {}, onCreated: Be, onClose: w }) {
25
- let { data: Ve } = Ie(te(v)), T = Ve.filter((e) => !e.archivedAt), E = !ze && !b && !x && !S && Object.keys(C).length === 0, [D] = f(() => E ? Le(v) : void 0), [O, He] = f(y ?? T.find((e) => e.key === D?.team)?.key ?? T[0]?.key ?? ""), { data: k = [] } = _({
26
- ...ee(v, O),
27
- enabled: !!O
28
- }), { data: Ue = [] } = _(a(v)), { data: A = [] } = _({
29
- ...i(v, O),
30
- enabled: !!O
31
- }), [j, M] = f(null), We = A.find((e) => e.id === j), [N, Ge] = f(ze || D?.title || ""), P = d(N), Ke = p("issueTemplates"), qe = ge(v, !0), Je = le(), F = p("newIssue"), Ye = Pe(), I = p("common"), L = _e(v, "manage_teams"), [R, Xe] = f(b || D?.body || ""), Ze = d(R), [Qe, $e] = f(C.statusId ?? null), [z, et] = f(C.priority ?? 0), [B, tt] = f(0), [V, nt] = f(""), [H, rt] = f(C.cycleId ?? ""), U = p("planning"), it = de(), at = ue(), { data: ot = [] } = _({
32
- ...r(v, O),
33
- enabled: !!T.find((e) => e.key === O)?.cyclesEnabled
24
+ function _({ workspace: _, defaultTeam: v, defaultTitle: Be = "", defaultBody: y = "", defaultArea: b, origin: x, defaults: S = {}, onCreated: Ve, onClose: C }) {
25
+ let { data: He } = Le(te(_)), w = He.filter((e) => !e.archivedAt), T = !Be && !y && !b && !x && Object.keys(S).length === 0, [E] = d(() => T ? Re(_) : void 0), [D, O] = d(v ?? w.find((e) => e.key === E?.team)?.key ?? w[0]?.key ?? ""), { data: k = [] } = g({
26
+ ...ee(_, D),
27
+ enabled: !!D
28
+ }), { data: Ue = [] } = g(a(_)), { data: A = [] } = g({
29
+ ...i(_, D),
30
+ enabled: !!D
31
+ }), [j, M] = d(null), We = A.find((e) => e.id === j), [N, Ge] = d(Be || E?.title || ""), P = u(N), Ke = f("issueTemplates"), qe = _e(_, !0), Je = le(), F = f("newIssue"), Ye = Fe(), I = f("common"), L = ve(_, "manage_teams"), [R, Xe] = d(y || E?.body || ""), Ze = u(R), [Qe, $e] = d(S.statusId ?? null), [z, et] = d(S.priority ?? 0), [B, tt] = d(0), [V, nt] = d(""), [H, rt] = d(S.cycleId ?? ""), U = f("planning"), it = pe(), at = de(), { data: ot = [] } = g({
32
+ ...r(_, D),
33
+ enabled: !!w.find((e) => e.key === D)?.cyclesEnabled
34
34
  }), st = ot.find((e) => e.id === H), ct = (e) => e.name ? U("cycleNamed", {
35
35
  number: e.number,
36
36
  name: e.name
37
- }) : U("cycle", { number: e.number }), W = T.find((e) => e.key === O)?.estimateScale ?? "none", [G, lt] = f(C.assignees ?? []), [K, ut] = f(C.labelIds ?? []), [q, J] = f(null), dt = me(q === "assignees", () => J(null)), ft = me(q === "labels", () => J(null)), [pt, mt] = f(null), ht = Fe(), gt = n(), { confirm: _t, dialog: vt } = ve(), Y = d(!1);
38
- Ne(() => {
37
+ }) : U("cycle", { number: e.number }), W = w.find((e) => e.key === D)?.estimateScale ?? "none", [G, lt] = d(S.assignees ?? []), [K, ut] = d(S.labelIds ?? []), [q, J] = d(null), dt = he(q === "assignees", () => J(null)), ft = he(q === "labels", () => J(null)), [pt, mt] = d(null), ht = Ie(), gt = n(), { confirm: _t, dialog: vt } = ye(), Y = u(!1);
38
+ Pe(() => {
39
39
  let e = () => {
40
- E && Re(v, {
41
- team: O,
40
+ T && ze(_, {
41
+ team: D,
42
42
  title: P.current,
43
43
  body: R
44
- }), w();
44
+ }), C();
45
45
  }, t = (t) => {
46
46
  if (!(t.key !== "Escape" || q !== null || Y.current) && !document.querySelector("[role=\"menu\"], [role=\"listbox\"]")) {
47
47
  if (P.current === N && R === Ze.current) return e();
48
48
  Y.current = !0, _t({
49
49
  title: F("closeTitle"),
50
- description: F(E ? "closeKeepsDraft" : "closeLoses"),
50
+ description: F(T ? "closeKeepsDraft" : "closeLoses"),
51
51
  confirmLabel: I("close"),
52
52
  onConfirm: async () => e()
53
53
  }).finally(() => {
@@ -58,16 +58,16 @@ function v({ workspace: v, defaultTeam: y, defaultTitle: ze = "", defaultBody: b
58
58
  return window.addEventListener("keydown", t, !0), () => window.removeEventListener("keydown", t, !0);
59
59
  }, [
60
60
  q,
61
- E,
62
- v,
63
- O,
61
+ T,
62
+ _,
63
+ D,
64
64
  R,
65
65
  N,
66
- w,
66
+ C,
67
67
  _t,
68
68
  F,
69
69
  I
70
- ]), Ne(() => {
70
+ ]), Pe(() => {
71
71
  let e = (e) => {
72
72
  if (e.metaKey || e.ctrlKey || e.altKey || e.key.length !== 1 || document.activeElement && document.activeElement !== document.body) return;
73
73
  let t = document.querySelector("[role=\"dialog\"]");
@@ -78,106 +78,106 @@ function v({ workspace: v, defaultTeam: y, defaultTitle: ze = "", defaultBody: b
78
78
  return window.addEventListener("keydown", e, !0), () => window.removeEventListener("keydown", e, !0);
79
79
  }, []);
80
80
  let yt = () => {
81
- E && Re(v, {
82
- team: O,
81
+ T && ze(_, {
82
+ team: D,
83
83
  title: "",
84
84
  body: ""
85
- }), w();
86
- }, X = k.find((e) => e.id === Qe) ?? k.find((e) => e.category === "unstarted"), Z = d(null), Q = d(/* @__PURE__ */ new Map()), bt = Te(), xt = p("issue.attachments"), St = async (e, t) => {
85
+ }), C();
86
+ }, X = k.find((e) => e.id === Qe) ?? k.find((e) => e.category === "unstarted"), Z = u(null), Q = u(/* @__PURE__ */ new Map()), bt = Ee(), xt = f("issue.attachments"), St = async (e, t) => {
87
87
  if (!bt) {
88
- u.error(xt("off", { name: e[0]?.name ?? "" }));
88
+ l.error(xt("off", { name: e[0]?.name ?? "" }));
89
89
  return;
90
90
  }
91
91
  let n = await Promise.all(e.map(async (e) => ({
92
92
  file: e,
93
- src: await xe(e)
93
+ src: await Se(e)
94
94
  })));
95
95
  for (let { file: e, src: t } of n) Q.current.set(t, e);
96
- Z.current && !Z.current.isDestroyed && be(Z.current, n, t);
96
+ Z.current && !Z.current.isDestroyed && xe(Z.current, n, t);
97
97
  }, Ct = async (t) => {
98
98
  let n = R;
99
99
  for (let [e, r] of Q.current) if (R.includes(e)) try {
100
- let i = await Se(v, t, r);
101
- n = n.replaceAll(`(${e})`, `(${ye}${i.id})`);
100
+ let i = await Ce(_, t, r);
101
+ n = n.replaceAll(`(${e})`, `(${be}${i.id})`);
102
102
  } catch (t) {
103
- n = Ce(n, e), u.error(F("attachFailed", {
103
+ n = we(n, e), l.error(F("attachFailed", {
104
104
  name: r.name,
105
105
  reason: Ye(t)
106
106
  }));
107
107
  }
108
108
  await e.PATCH("/api/v1/workspaces/{workspace}/issues/{identifier}", {
109
109
  params: { path: {
110
- workspace: v,
110
+ workspace: _,
111
111
  identifier: t
112
112
  } },
113
113
  body: { body: n }
114
114
  });
115
115
  }, wt = async (n, r) => {
116
- if (!O) return !1;
116
+ if (!D) return !1;
117
117
  mt(null);
118
118
  let i = [...Q.current.keys()].filter((e) => R.includes(e));
119
119
  try {
120
120
  let a = t(await e.POST("/api/v1/workspaces/{workspace}/teams/{key}/issues", {
121
121
  params: { path: {
122
- workspace: v,
123
- key: O
122
+ workspace: _,
123
+ key: D
124
124
  } },
125
125
  body: {
126
126
  title: n,
127
- body: i.reduce(Ce, R),
127
+ body: i.reduce(we, R),
128
128
  priority: z,
129
129
  ...X && { statusId: X.id },
130
- assignees: G.map(he),
130
+ assignees: G.map(ge),
131
131
  labelIds: K,
132
- ...B && c(W).includes(B) && { estimate: B },
132
+ ...B && fe(W).includes(B) && { estimate: B },
133
133
  ...V && { dueDate: V },
134
134
  ...H && { cycleId: H },
135
- ...(!y || O === y) && x && { area: x },
136
- ...(!y || O === y) && S && { origin: S },
137
- ...(!y || O === y) && C.projectId && { projectId: C.projectId }
135
+ ...(!v || D === v) && b && { area: b },
136
+ ...(!v || D === v) && x && { origin: x },
137
+ ...(!v || D === v) && S.projectId && { projectId: S.projectId }
138
138
  }
139
139
  }));
140
- return i.length > 0 && await Ct(a.identifier), fe(ht, v, a.identifier), Be?.(a), r && gt({
140
+ return i.length > 0 && await Ct(a.identifier), ue(ht, _, a.identifier), Ve?.(a), r && gt({
141
141
  to: "/$workspace/issues/$identifier",
142
142
  params: {
143
- workspace: v,
143
+ workspace: _,
144
144
  identifier: a.identifier
145
145
  }
146
146
  }), !0;
147
147
  } catch (e) {
148
148
  return mt(Ye(e)), !1;
149
149
  }
150
- }, $ = Me({ size: "sm" });
151
- if (T.length === 0) return /* @__PURE__ */ h(je, {
150
+ }, $ = Ne({ size: "sm" });
151
+ if (w.length === 0) return /* @__PURE__ */ m(Me, {
152
152
  open: !0,
153
- onClose: w,
153
+ onClose: C,
154
154
  size: "lg",
155
155
  title: F("noTeamTitle"),
156
156
  description: F(L ? "noTeamDescription" : "noTeamAskAdmin"),
157
- ...!L && { footer: /* @__PURE__ */ h(Oe, {
157
+ ...!L && { footer: /* @__PURE__ */ m(ke, {
158
158
  type: "button",
159
- onClick: w,
159
+ onClick: C,
160
160
  children: I("close")
161
161
  }) },
162
- children: L && /* @__PURE__ */ h(De, {
163
- workspace: v,
162
+ children: L && /* @__PURE__ */ m(Oe, {
163
+ workspace: _,
164
164
  autoFocus: !0,
165
- onCreated: (e) => He(e.key)
165
+ onCreated: (e) => O(e.key)
166
166
  })
167
167
  });
168
- let Tt = T.find((e) => e.key === O);
169
- return /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(ke, {
168
+ let Tt = w.find((e) => e.key === D);
169
+ return /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(Ae, {
170
170
  open: !0,
171
171
  onClose: yt,
172
172
  size: "xl",
173
- typeIcon: /* @__PURE__ */ h(ae, { className: "size-3.5" }),
173
+ typeIcon: /* @__PURE__ */ m(ae, { className: "size-3.5" }),
174
174
  typeLabel: Tt?.name ?? "",
175
- typeMenu: T.map((e) => ({
175
+ typeMenu: w.map((e) => ({
176
176
  label: e.name,
177
177
  hint: e.key,
178
- checked: e.key === O,
178
+ checked: e.key === D,
179
179
  onClick: () => {
180
- He(e.key), $e(null), M(null), rt("");
180
+ O(e.key), $e(null), M(null), rt("");
181
181
  }
182
182
  })),
183
183
  typeMenuSearch: {
@@ -190,9 +190,9 @@ function v({ workspace: v, defaultTeam: y, defaultTitle: ze = "", defaultBody: b
190
190
  P.current = e;
191
191
  },
192
192
  submitLabel: F("create"),
193
- descriptionField: /* @__PURE__ */ h("div", {
193
+ descriptionField: /* @__PURE__ */ m("div", {
194
194
  className: "min-h-24 pb-2",
195
- children: /* @__PURE__ */ h(Ee, {
195
+ children: /* @__PURE__ */ m(De, {
196
196
  value: R,
197
197
  onChange: Xe,
198
198
  onFiles: (e, t) => void St(e, t),
@@ -205,18 +205,18 @@ function v({ workspace: v, defaultTeam: y, defaultTitle: ze = "", defaultBody: b
205
205
  className: "min-h-24"
206
206
  })
207
207
  }),
208
- dirty: R !== b || j !== null || Qe !== null || z !== 0 || B !== 0 || V !== "" || H !== "" || G.length > 0 || K.length > 0,
208
+ dirty: R !== y || j !== null || Qe !== null || z !== 0 || B !== 0 || V !== "" || H !== "" || G.length > 0 || K.length > 0,
209
209
  footerHint: F("hint"),
210
210
  error: pt,
211
211
  onSubmit: (e, t, n, { modifier: r }) => wt(e, r),
212
- properties: /* @__PURE__ */ g(m, { children: [
213
- A.length > 0 && /* @__PURE__ */ h(l, {
212
+ properties: /* @__PURE__ */ h(p, { children: [
213
+ A.length > 0 && /* @__PURE__ */ m(c, {
214
214
  open: q === "template",
215
215
  onOpenChange: (e) => J(e ? "template" : null),
216
216
  items: A.map((e) => ({
217
217
  value: e.id,
218
218
  label: e.name,
219
- icon: /* @__PURE__ */ h(o, { className: "size-3.5 text-muted-foreground" })
219
+ icon: /* @__PURE__ */ m(o, { className: "size-3.5 text-muted-foreground" })
220
220
  })),
221
221
  value: j,
222
222
  onValueChange: (e) => {
@@ -224,30 +224,30 @@ function v({ workspace: v, defaultTeam: y, defaultTitle: ze = "", defaultBody: b
224
224
  t && (M(t.id), t.title && (Ge(t.title), P.current = t.title), Xe(t.body), et(t.priority), ut(t.labelIds));
225
225
  },
226
226
  placeholder: Ke("choose"),
227
- trigger: /* @__PURE__ */ g("button", {
227
+ trigger: /* @__PURE__ */ h("button", {
228
228
  type: "button",
229
229
  className: $,
230
- children: [/* @__PURE__ */ h(o, { className: "size-3.5" }), We?.name ?? Ke("choose")]
230
+ children: [/* @__PURE__ */ m(o, { className: "size-3.5" }), We?.name ?? Ke("choose")]
231
231
  })
232
232
  }),
233
- /* @__PURE__ */ h(l, {
233
+ /* @__PURE__ */ m(c, {
234
234
  open: q === "status",
235
235
  onOpenChange: (e) => J(e ? "status" : null),
236
236
  items: k.map((e) => ({
237
237
  value: e.id,
238
238
  label: e.name,
239
- icon: /* @__PURE__ */ h(oe, { category: e.category })
239
+ icon: /* @__PURE__ */ m(oe, { category: e.category })
240
240
  })),
241
241
  value: X?.id ?? null,
242
242
  onValueChange: (e) => e !== null && $e(e),
243
243
  placeholder: F("changeStatus"),
244
- trigger: /* @__PURE__ */ g("button", {
244
+ trigger: /* @__PURE__ */ h("button", {
245
245
  type: "button",
246
246
  className: $,
247
- children: [X && /* @__PURE__ */ h(oe, { category: X.category }), X?.name ?? I("status")]
247
+ children: [X && /* @__PURE__ */ m(oe, { category: X.category }), X?.name ?? I("status")]
248
248
  })
249
249
  }),
250
- /* @__PURE__ */ h(l, {
250
+ /* @__PURE__ */ m(c, {
251
251
  open: q === "priority",
252
252
  onOpenChange: (e) => J(e ? "priority" : null),
253
253
  items: [
@@ -259,18 +259,18 @@ function v({ workspace: v, defaultTeam: y, defaultTitle: ze = "", defaultBody: b
259
259
  ].map((e) => ({
260
260
  value: String(e),
261
261
  label: Je[e] ?? "",
262
- icon: /* @__PURE__ */ h(s, { priority: e })
262
+ icon: /* @__PURE__ */ m(s, { priority: e })
263
263
  })),
264
264
  value: String(z),
265
265
  onValueChange: (e) => e !== null && et(Number(e)),
266
266
  placeholder: F("setPriority"),
267
- trigger: /* @__PURE__ */ g("button", {
267
+ trigger: /* @__PURE__ */ h("button", {
268
268
  type: "button",
269
269
  className: $,
270
- children: [/* @__PURE__ */ h(s, { priority: z }), z ? Je[z] : I("priority")]
270
+ children: [/* @__PURE__ */ m(s, { priority: z }), z ? Je[z] : I("priority")]
271
271
  })
272
272
  }),
273
- /* @__PURE__ */ h(l, {
273
+ /* @__PURE__ */ m(c, {
274
274
  multiple: !0,
275
275
  open: q === "assignees",
276
276
  onOpenChange: (e) => J(e ? "assignees" : null),
@@ -280,22 +280,22 @@ function v({ workspace: v, defaultTeam: y, defaultTitle: ze = "", defaultBody: b
280
280
  lt(e), dt();
281
281
  },
282
282
  placeholder: F("assignTo"),
283
- trigger: /* @__PURE__ */ g("button", {
283
+ trigger: /* @__PURE__ */ h("button", {
284
284
  type: "button",
285
285
  className: $,
286
- children: [/* @__PURE__ */ h(ce, { className: "size-3.5" }), G.length ? F("assignedCount", { count: G.length }) : I("assignee")]
286
+ children: [/* @__PURE__ */ m(ce, { className: "size-3.5" }), G.length ? F("assignedCount", { count: G.length }) : I("assignee")]
287
287
  })
288
288
  }),
289
- /* @__PURE__ */ h(l, {
289
+ /* @__PURE__ */ m(c, {
290
290
  multiple: !0,
291
291
  open: q === "labels",
292
292
  onOpenChange: (e) => J(e ? "labels" : null),
293
293
  items: Ue.map((e) => ({
294
294
  value: e.id,
295
295
  label: e.name,
296
- icon: /* @__PURE__ */ g("span", {
296
+ icon: /* @__PURE__ */ h("span", {
297
297
  className: "flex items-center gap-2",
298
- children: [/* @__PURE__ */ h(pe, {}), /* @__PURE__ */ h("span", {
298
+ children: [/* @__PURE__ */ m(me, {}), /* @__PURE__ */ m("span", {
299
299
  className: "size-2.5 rounded-full",
300
300
  style: { background: e.color }
301
301
  })]
@@ -306,29 +306,29 @@ function v({ workspace: v, defaultTeam: y, defaultTitle: ze = "", defaultBody: b
306
306
  ut(e), ft();
307
307
  },
308
308
  placeholder: F("addLabels"),
309
- trigger: /* @__PURE__ */ g("button", {
309
+ trigger: /* @__PURE__ */ h("button", {
310
310
  type: "button",
311
311
  className: $,
312
- children: [/* @__PURE__ */ h(se, { className: "size-3.5" }), K.length ? F("labelCount", { count: K.length }) : I("labels")]
312
+ children: [/* @__PURE__ */ m(se, { className: "size-3.5" }), K.length ? F("labelCount", { count: K.length }) : I("labels")]
313
313
  })
314
314
  }),
315
- W !== "none" && /* @__PURE__ */ h(l, {
315
+ W !== "none" && /* @__PURE__ */ m(c, {
316
316
  open: q === "estimate",
317
317
  onOpenChange: (e) => J(e ? "estimate" : null),
318
- items: [0, ...c(W)].map((e) => ({
318
+ items: [0, ...fe(W)].map((e) => ({
319
319
  value: String(e),
320
320
  label: e ? it(e, W) : U("noEstimate")
321
321
  })),
322
322
  value: String(B),
323
323
  onValueChange: (e) => e !== null && tt(Number(e)),
324
324
  placeholder: U("setEstimate"),
325
- trigger: /* @__PURE__ */ g("button", {
325
+ trigger: /* @__PURE__ */ h("button", {
326
326
  type: "button",
327
327
  className: $,
328
- children: [/* @__PURE__ */ h(ie, { className: "size-3.5" }), B ? it(B, W) : U("estimate")]
328
+ children: [/* @__PURE__ */ m(ie, { className: "size-3.5" }), B ? it(B, W) : U("estimate")]
329
329
  })
330
330
  }),
331
- Tt?.cyclesEnabled && /* @__PURE__ */ h(l, {
331
+ Tt?.cyclesEnabled && /* @__PURE__ */ m(c, {
332
332
  open: q === "cycle",
333
333
  onOpenChange: (e) => J(e ? "cycle" : null),
334
334
  items: [{
@@ -345,38 +345,38 @@ function v({ workspace: v, defaultTeam: y, defaultTitle: ze = "", defaultBody: b
345
345
  value: H,
346
346
  onValueChange: (e) => e !== null && rt(e),
347
347
  placeholder: U("cycleLabel"),
348
- trigger: /* @__PURE__ */ g("button", {
348
+ trigger: /* @__PURE__ */ h("button", {
349
349
  type: "button",
350
350
  className: $,
351
- children: [/* @__PURE__ */ h(re, { className: "size-3.5" }), st ? ct(st) : U("cycleLabel")]
351
+ children: [/* @__PURE__ */ m(re, { className: "size-3.5" }), st ? ct(st) : U("cycleLabel")]
352
352
  })
353
353
  }),
354
- /* @__PURE__ */ h(Ae, {
354
+ /* @__PURE__ */ m(je, {
355
355
  value: V,
356
356
  onValueChange: nt,
357
357
  "aria-label": U("dueDate"),
358
- trigger: /* @__PURE__ */ g("button", {
358
+ trigger: /* @__PURE__ */ h("button", {
359
359
  type: "button",
360
360
  className: $,
361
- children: [/* @__PURE__ */ h(ne, { className: "size-3.5" }), V ? U("dueOn", { date: at.day(V) }) : U("dueDate")]
361
+ children: [/* @__PURE__ */ m(ne, { className: "size-3.5" }), V ? U("dueOn", { date: at.day(V) }) : U("dueDate")]
362
362
  })
363
363
  }),
364
- /* @__PURE__ */ h(we, { onFiles: (e) => void St(e) })
364
+ /* @__PURE__ */ m(Te, { onFiles: (e) => void St(e) })
365
365
  ] })
366
366
  }), vt] });
367
367
  }
368
- var y = (e) => `tandem:new-issue-draft:${e}`;
369
- function Le(e) {
368
+ var v = (e) => `tandem:new-issue-draft:${e}`;
369
+ function Re(e) {
370
370
  try {
371
- let t = JSON.parse(localStorage.getItem(y(e)) ?? "null");
371
+ let t = JSON.parse(localStorage.getItem(v(e)) ?? "null");
372
372
  return t && typeof t.title == "string" && typeof t.body == "string" ? t : void 0;
373
373
  } catch {
374
374
  return;
375
375
  }
376
376
  }
377
- function Re(e, t) {
377
+ function ze(e, t) {
378
378
  try {
379
- t.title.trim() || t.body.trim() ? localStorage.setItem(y(e), JSON.stringify(t)) : localStorage.removeItem(y(e));
379
+ t.title.trim() || t.body.trim() ? localStorage.setItem(v(e), JSON.stringify(t)) : localStorage.removeItem(v(e));
380
380
  } catch {}
381
381
  }
382
- export { v as NewIssueDialog };
382
+ export { _ as NewIssueDialog };