@parallelworks/tandem-web 0.138.2 → 0.139.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.
- package/components/AgentWork.js +35 -35
- package/components/AppRoot.js +8 -7
- package/components/AreaWork.js +1 -1
- package/components/BlockHandle.js +3 -3
- package/components/CommandPalette.js +27 -27
- package/components/DateChip.js +27 -27
- package/components/DocLinkPicker.js +17 -17
- package/components/Graph.js +6 -6
- package/components/HoverCards.js +30 -29
- package/components/IssueListBlock.js +83 -83
- package/components/LinkCard.js +20 -20
- package/components/MentionPicker.js +12 -12
- package/components/NewIssueDialog.js +116 -116
- package/components/NewProjectDialog.js +5 -4
- package/components/Planning.js +31 -43
- package/components/RouterLink.js +4 -4
- package/components/ShareDialog.js +12 -12
- package/components/SharedUI.js +19 -19
- package/components/SlashMenu.js +11 -11
- package/components/SubPages.js +10 -10
- package/components/UnlinkedMentions.js +10 -10
- package/components/WorkCounts.js +8 -8
- package/components/settings.js +31 -31
- package/hostedApp.js +41 -39
- package/hosting.d.ts +24 -11
- package/index.js +58 -27
- package/lib/base.js +1 -14
- package/lib/docs.js +6 -6
- package/lib/issueMenu.js +33 -33
- package/lib/knowledge.js +90 -101
- package/lib/knowledgeKinds.js +14 -0
- package/lib/pageTitle.js +22 -10
- package/lib/projectList.js +1 -1
- package/lib/projectStates.js +15 -0
- package/lib/router.js +20 -34
- package/package.json +2 -2
- package/pages/areas.js +223 -223
- package/pages/decisions.js +69 -69
- package/pages/issues.js +38 -38
- package/pages/projects.js +268 -267
- package/pages/triage.js +133 -133
- package/pages.js +21 -0
- package/routes/__root.js +6 -6
- package/routes/_workspace/agents/_slug2.js +21 -21
- package/routes/_workspace/agents/index2.js +16 -16
- package/routes/_workspace/areas/_area2.js +105 -105
- package/routes/_workspace/docs/_doc2.js +189 -189
- package/routes/_workspace/docs2.js +8 -8
- package/routes/_workspace/graph2.js +9 -9
- package/routes/_workspace/graph3.js +8 -8
- package/routes/_workspace/issues/_identifier2.js +249 -249
- package/routes/_workspace/issues/index.js +6 -6
- package/routes/_workspace/knowledge/_term2.js +119 -118
- package/routes/_workspace/knowledge/index.js +8 -8
- package/routes/_workspace/knowledge/index2.js +41 -40
- package/routes/_workspace/measures2.js +4 -4
- package/routes/_workspace/measures3.js +18 -18
- package/routes/_workspace/notifications2.js +112 -112
- package/routes/_workspace/people/_username.js +4 -4
- package/routes/_workspace/people/_username2.js +36 -36
- package/routes/_workspace/projects/_projectId3.js +369 -368
- package/routes/_workspace/projects/index.js +7 -7
- package/routes/_workspace/settings/account2.js +3 -3
- package/routes/_workspace/settings/audit-log2.js +4 -4
- package/routes/_workspace/settings/audit-log3.js +51 -51
- package/routes/_workspace/settings/labels2.js +14 -14
- package/routes/_workspace/settings/members2.js +9 -9
- package/routes/_workspace/settings/runners2.js +11 -11
- package/routes/_workspace/settings/teams2.js +15 -15
- package/routes/_workspace/settings/tokens2.js +5 -5
- package/routes/_workspace/settings/webhooks2.js +7 -7
- package/routes/_workspace/settings2.js +3 -3
- package/routes/_workspace/teams/_key/cycles/_number2.js +16 -16
- package/routes/_workspace/teams/_key/cycles/index2.js +40 -40
- package/routes/_workspace/teams/_key/issues.js +4 -4
- package/routes/_workspace/teams/_key/projects.js +4 -4
- package/routes/_workspace/teams/_key/settings2.js +133 -133
- package/routes/_workspace2.js +319 -319
- package/routes/docs/route2.js +19 -19
- package/routes/new2.js +8 -8
- package/routes/request2._token.js +4 -4
package/components/LinkCard.js
CHANGED
|
@@ -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 {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
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 =
|
|
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 (
|
|
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__ */
|
|
93
|
+
]), !S) return /* @__PURE__ */ d(g, {
|
|
94
94
|
className: "link-card link-card-empty",
|
|
95
95
|
contentEditable: !1,
|
|
96
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
132
|
+
return /* @__PURE__ */ d(g, {
|
|
133
133
|
className: "link-card",
|
|
134
134
|
contentEditable: !1,
|
|
135
135
|
"data-drag-handle": !0,
|
|
136
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
142
|
+
children: /* @__PURE__ */ f("span", {
|
|
143
143
|
className: "min-w-0 flex-1",
|
|
144
144
|
children: [
|
|
145
|
-
/* @__PURE__ */
|
|
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__ */
|
|
149
|
+
h.attrs.description && /* @__PURE__ */ d("span", {
|
|
150
150
|
className: "link-card-description",
|
|
151
151
|
children: String(h.attrs.description)
|
|
152
152
|
}),
|
|
153
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ f("span", {
|
|
154
154
|
className: "link-card-site",
|
|
155
|
-
children: [M.startsWith("data:image/") ? /* @__PURE__ */
|
|
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__ */
|
|
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 {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
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 } =
|
|
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
|
-
|
|
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 =
|
|
68
|
-
return A.current = k.setActive, i(v, k, O), !C || !O ? null : /* @__PURE__ */
|
|
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__ */
|
|
78
|
+
children: E.map((t, n) => t.kind === "date" ? /* @__PURE__ */ g(o, {
|
|
79
79
|
option: k.optionProps(n),
|
|
80
|
-
icon: /* @__PURE__ */
|
|
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__ */
|
|
87
|
+
}, `date:${r(t.date)}`) : /* @__PURE__ */ g(o, {
|
|
88
88
|
option: k.optionProps(n),
|
|
89
|
-
icon: /* @__PURE__ */
|
|
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 {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { PickManyBox as
|
|
9
|
-
import { parseAssigneeKey as
|
|
10
|
-
import { useCan as
|
|
11
|
-
import { useConfirm as
|
|
12
|
-
import { attachmentPrefix as
|
|
13
|
-
import { withoutLink as
|
|
14
|
-
import { AttachButton as
|
|
15
|
-
import { Editor as
|
|
16
|
-
import { TeamForm as
|
|
17
|
-
import { Button as
|
|
18
|
-
import { useEffect as
|
|
19
|
-
import { useErrorMessage as
|
|
20
|
-
import { useTranslations as
|
|
21
|
-
import { Fragment as
|
|
22
|
-
import { useQuery as
|
|
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
|
|
25
|
-
let { data:
|
|
26
|
-
...ee(
|
|
27
|
-
enabled: !!
|
|
28
|
-
}), { data: Ue = [] } =
|
|
29
|
-
...i(
|
|
30
|
-
enabled: !!
|
|
31
|
-
}), [j, M] =
|
|
32
|
-
...r(
|
|
33
|
-
enabled: !!
|
|
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 =
|
|
38
|
-
|
|
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
|
-
|
|
41
|
-
team:
|
|
40
|
+
T && ze(_, {
|
|
41
|
+
team: D,
|
|
42
42
|
title: P.current,
|
|
43
43
|
body: R
|
|
44
|
-
}),
|
|
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(
|
|
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
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
T,
|
|
62
|
+
_,
|
|
63
|
+
D,
|
|
64
64
|
R,
|
|
65
65
|
N,
|
|
66
|
-
|
|
66
|
+
C,
|
|
67
67
|
_t,
|
|
68
68
|
F,
|
|
69
69
|
I
|
|
70
|
-
]),
|
|
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
|
-
|
|
82
|
-
team:
|
|
81
|
+
T && ze(_, {
|
|
82
|
+
team: D,
|
|
83
83
|
title: "",
|
|
84
84
|
body: ""
|
|
85
|
-
}),
|
|
86
|
-
}, X = k.find((e) => e.id === Qe) ?? k.find((e) => e.category === "unstarted"), Z =
|
|
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
|
-
|
|
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
|
|
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 &&
|
|
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
|
|
101
|
-
n = n.replaceAll(`(${e})`, `(${
|
|
100
|
+
let i = await Ce(_, t, r);
|
|
101
|
+
n = n.replaceAll(`(${e})`, `(${be}${i.id})`);
|
|
102
102
|
} catch (t) {
|
|
103
|
-
n =
|
|
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:
|
|
110
|
+
workspace: _,
|
|
111
111
|
identifier: t
|
|
112
112
|
} },
|
|
113
113
|
body: { body: n }
|
|
114
114
|
});
|
|
115
115
|
}, wt = async (n, r) => {
|
|
116
|
-
if (!
|
|
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:
|
|
123
|
-
key:
|
|
122
|
+
workspace: _,
|
|
123
|
+
key: D
|
|
124
124
|
} },
|
|
125
125
|
body: {
|
|
126
126
|
title: n,
|
|
127
|
-
body: i.reduce(
|
|
127
|
+
body: i.reduce(we, R),
|
|
128
128
|
priority: z,
|
|
129
129
|
...X && { statusId: X.id },
|
|
130
|
-
assignees: G.map(
|
|
130
|
+
assignees: G.map(ge),
|
|
131
131
|
labelIds: K,
|
|
132
|
-
...B &&
|
|
132
|
+
...B && fe(W).includes(B) && { estimate: B },
|
|
133
133
|
...V && { dueDate: V },
|
|
134
134
|
...H && { cycleId: H },
|
|
135
|
-
...(!
|
|
136
|
-
...(!
|
|
137
|
-
...(!
|
|
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),
|
|
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:
|
|
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
|
-
}, $ =
|
|
151
|
-
if (
|
|
150
|
+
}, $ = Ne({ size: "sm" });
|
|
151
|
+
if (w.length === 0) return /* @__PURE__ */ m(Me, {
|
|
152
152
|
open: !0,
|
|
153
|
-
onClose:
|
|
153
|
+
onClose: C,
|
|
154
154
|
size: "lg",
|
|
155
155
|
title: F("noTeamTitle"),
|
|
156
156
|
description: F(L ? "noTeamDescription" : "noTeamAskAdmin"),
|
|
157
|
-
...!L && { footer: /* @__PURE__ */
|
|
157
|
+
...!L && { footer: /* @__PURE__ */ m(ke, {
|
|
158
158
|
type: "button",
|
|
159
|
-
onClick:
|
|
159
|
+
onClick: C,
|
|
160
160
|
children: I("close")
|
|
161
161
|
}) },
|
|
162
|
-
children: L && /* @__PURE__ */
|
|
163
|
-
workspace:
|
|
162
|
+
children: L && /* @__PURE__ */ m(Oe, {
|
|
163
|
+
workspace: _,
|
|
164
164
|
autoFocus: !0,
|
|
165
|
-
onCreated: (e) =>
|
|
165
|
+
onCreated: (e) => O(e.key)
|
|
166
166
|
})
|
|
167
167
|
});
|
|
168
|
-
let Tt =
|
|
169
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
173
|
+
typeIcon: /* @__PURE__ */ m(ae, { className: "size-3.5" }),
|
|
174
174
|
typeLabel: Tt?.name ?? "",
|
|
175
|
-
typeMenu:
|
|
175
|
+
typeMenu: w.map((e) => ({
|
|
176
176
|
label: e.name,
|
|
177
177
|
hint: e.key,
|
|
178
|
-
checked: e.key ===
|
|
178
|
+
checked: e.key === D,
|
|
179
179
|
onClick: () => {
|
|
180
|
-
|
|
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__ */
|
|
193
|
+
descriptionField: /* @__PURE__ */ m("div", {
|
|
194
194
|
className: "min-h-24 pb-2",
|
|
195
|
-
children: /* @__PURE__ */
|
|
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 !==
|
|
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__ */
|
|
213
|
-
A.length > 0 && /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
227
|
+
trigger: /* @__PURE__ */ h("button", {
|
|
228
228
|
type: "button",
|
|
229
229
|
className: $,
|
|
230
|
-
children: [/* @__PURE__ */
|
|
230
|
+
children: [/* @__PURE__ */ m(o, { className: "size-3.5" }), We?.name ?? Ke("choose")]
|
|
231
231
|
})
|
|
232
232
|
}),
|
|
233
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
244
|
+
trigger: /* @__PURE__ */ h("button", {
|
|
245
245
|
type: "button",
|
|
246
246
|
className: $,
|
|
247
|
-
children: [X && /* @__PURE__ */
|
|
247
|
+
children: [X && /* @__PURE__ */ m(oe, { category: X.category }), X?.name ?? I("status")]
|
|
248
248
|
})
|
|
249
249
|
}),
|
|
250
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
267
|
+
trigger: /* @__PURE__ */ h("button", {
|
|
268
268
|
type: "button",
|
|
269
269
|
className: $,
|
|
270
|
-
children: [/* @__PURE__ */
|
|
270
|
+
children: [/* @__PURE__ */ m(s, { priority: z }), z ? Je[z] : I("priority")]
|
|
271
271
|
})
|
|
272
272
|
}),
|
|
273
|
-
/* @__PURE__ */
|
|
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__ */
|
|
283
|
+
trigger: /* @__PURE__ */ h("button", {
|
|
284
284
|
type: "button",
|
|
285
285
|
className: $,
|
|
286
|
-
children: [/* @__PURE__ */
|
|
286
|
+
children: [/* @__PURE__ */ m(ce, { className: "size-3.5" }), G.length ? F("assignedCount", { count: G.length }) : I("assignee")]
|
|
287
287
|
})
|
|
288
288
|
}),
|
|
289
|
-
/* @__PURE__ */
|
|
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__ */
|
|
296
|
+
icon: /* @__PURE__ */ h("span", {
|
|
297
297
|
className: "flex items-center gap-2",
|
|
298
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
309
|
+
trigger: /* @__PURE__ */ h("button", {
|
|
310
310
|
type: "button",
|
|
311
311
|
className: $,
|
|
312
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
315
|
+
W !== "none" && /* @__PURE__ */ m(c, {
|
|
316
316
|
open: q === "estimate",
|
|
317
317
|
onOpenChange: (e) => J(e ? "estimate" : null),
|
|
318
|
-
items: [0, ...
|
|
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__ */
|
|
325
|
+
trigger: /* @__PURE__ */ h("button", {
|
|
326
326
|
type: "button",
|
|
327
327
|
className: $,
|
|
328
|
-
children: [/* @__PURE__ */
|
|
328
|
+
children: [/* @__PURE__ */ m(ie, { className: "size-3.5" }), B ? it(B, W) : U("estimate")]
|
|
329
329
|
})
|
|
330
330
|
}),
|
|
331
|
-
Tt?.cyclesEnabled && /* @__PURE__ */
|
|
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__ */
|
|
348
|
+
trigger: /* @__PURE__ */ h("button", {
|
|
349
349
|
type: "button",
|
|
350
350
|
className: $,
|
|
351
|
-
children: [/* @__PURE__ */
|
|
351
|
+
children: [/* @__PURE__ */ m(re, { className: "size-3.5" }), st ? ct(st) : U("cycleLabel")]
|
|
352
352
|
})
|
|
353
353
|
}),
|
|
354
|
-
/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ m(je, {
|
|
355
355
|
value: V,
|
|
356
356
|
onValueChange: nt,
|
|
357
357
|
"aria-label": U("dueDate"),
|
|
358
|
-
trigger: /* @__PURE__ */
|
|
358
|
+
trigger: /* @__PURE__ */ h("button", {
|
|
359
359
|
type: "button",
|
|
360
360
|
className: $,
|
|
361
|
-
children: [/* @__PURE__ */
|
|
361
|
+
children: [/* @__PURE__ */ m(ne, { className: "size-3.5" }), V ? U("dueOn", { date: at.day(V) }) : U("dueDate")]
|
|
362
362
|
})
|
|
363
363
|
}),
|
|
364
|
-
/* @__PURE__ */
|
|
364
|
+
/* @__PURE__ */ m(Te, { onFiles: (e) => void St(e) })
|
|
365
365
|
] })
|
|
366
366
|
}), vt] });
|
|
367
367
|
}
|
|
368
|
-
var
|
|
369
|
-
function
|
|
368
|
+
var v = (e) => `tandem:new-issue-draft:${e}`;
|
|
369
|
+
function Re(e) {
|
|
370
370
|
try {
|
|
371
|
-
let t = JSON.parse(localStorage.getItem(
|
|
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
|
|
377
|
+
function ze(e, t) {
|
|
378
378
|
try {
|
|
379
|
-
t.title.trim() || t.body.trim() ? localStorage.setItem(
|
|
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 {
|
|
382
|
+
export { _ as NewIssueDialog };
|