@parallelworks/tandem-web 0.150.2 → 0.151.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_virtual/_virtual_i18n/en/common.js +32 -3
- package/_virtual/_virtual_i18n/es/common.js +32 -3
- package/_virtual/_virtual_i18n/ja/common.js +32 -3
- package/_virtual/_virtual_i18n/ko/common.js +32 -3
- package/_virtual/_virtual_i18n/zh/common.js +32 -3
- package/api/queries.js +88 -77
- package/components/AccessGrants.js +6 -6
- package/components/ActivityTimeline.js +4 -4
- package/components/AgentWork.js +111 -111
- package/components/AreaLink.js +32 -0
- package/components/AreaTiles.js +10 -13
- package/components/AreaWork.js +25 -1
- package/components/BugRotation.js +3 -3
- package/components/CodeHostSettings.js +30 -30
- package/components/CommandPalette.js +53 -53
- package/components/CustomFields.js +116 -116
- package/components/DateChip.js +11 -11
- package/components/DocButton.js +6 -6
- package/components/DocHistory.js +4 -4
- package/components/DocLinkPicker.js +8 -8
- package/components/DocProperties.js +15 -15
- package/components/DocTable.js +15 -15
- package/components/DocsTree.js +80 -80
- package/components/Editor.js +35 -35
- package/components/FavoritesNav.js +53 -53
- package/components/GitHub.js +18 -18
- package/components/Graph.js +15 -15
- package/components/HostActions.js +21 -21
- package/components/HostPanel.js +6 -6
- package/components/HoverCards.js +38 -38
- package/components/IssueBoard.js +4 -4
- package/components/IssueCode.js +14 -14
- package/components/IssueEvent.js +3 -3
- package/components/IssueFilters.js +71 -71
- package/components/IssueListBlock.js +32 -32
- package/components/IssueRow.js +21 -21
- package/components/IssueTemplates.js +118 -118
- package/components/IssueTypes.js +40 -40
- package/components/NewIssueDialog.js +76 -76
- package/components/NewProjectDialog.js +145 -145
- package/components/PersonActivity.js +4 -4
- package/components/SharedViewer.js +5 -5
- package/components/SlashMenu.js +29 -29
- package/components/TeamRepositories.js +51 -51
- package/components/TeamWorkflow.js +6 -6
- package/components/UnlinkedMentions.js +20 -20
- package/components/Updates.js +3 -3
- package/components/Widgets.js +20 -20
- package/components/columns.js +17 -17
- package/components/editorPlugins.js +80 -80
- package/components/mathDiagrams.js +17 -17
- package/lib/boardMove.js +5 -5
- package/lib/issueList.js +58 -58
- package/lib/issueMenu.js +27 -27
- package/lib/knowledge.js +106 -106
- package/lib/views.js +9 -9
- package/package.json +2 -2
- package/pages/area.js +291 -0
- package/pages/areas.js +258 -287
- package/pages/decisions.js +21 -21
- package/pages/issues.js +52 -52
- package/pages/projects.js +125 -125
- package/pages/triage.js +12 -12
- package/routeTree.gen.js +186 -180
- package/routes/_workspace/agents/_slug2.js +11 -11
- package/routes/_workspace/agents/index2.js +10 -10
- package/routes/_workspace/areas/_area.js +7 -8
- package/routes/_workspace/areas/_area2.js +3 -290
- package/routes/_workspace/areas/_area3.js +7 -8
- package/routes/_workspace/docs/_doc2.js +230 -230
- package/routes/_workspace/docs/space2._space.js +27 -27
- package/routes/_workspace/issues/_identifier2.js +222 -224
- package/routes/_workspace/knowledge/_term2.js +43 -43
- package/routes/_workspace/knowledge/index.js +6 -6
- package/routes/_workspace/knowledge/index2.js +15 -15
- package/routes/_workspace/measures3.js +70 -72
- package/routes/_workspace/notifications2.js +150 -150
- package/routes/_workspace/people/_username2.js +10 -10
- package/routes/_workspace/projects/_projectId3.js +276 -276
- package/routes/_workspace/settings/audit-log3.js +136 -138
- package/routes/_workspace/settings/fields2.js +11 -11
- package/routes/_workspace/settings/github2.js +6 -6
- package/routes/_workspace/settings/groups2.js +26 -26
- package/routes/_workspace/settings/import2.js +398 -147
- package/routes/_workspace/settings/import3.js +7 -3
- package/routes/_workspace/settings/index2.js +6 -6
- package/routes/_workspace/settings/labels2.js +21 -21
- package/routes/_workspace/settings/members2.js +27 -27
- package/routes/_workspace/settings/notifications2.js +8 -8
- package/routes/_workspace/settings/parallelworks2.js +32 -32
- package/routes/_workspace/settings/roles2.js +24 -24
- package/routes/_workspace/settings/runners2.js +15 -15
- package/routes/_workspace/settings/sessions2.js +17 -17
- package/routes/_workspace/settings/slack2.js +7 -7
- package/routes/_workspace/settings/sso2.js +31 -31
- package/routes/_workspace/settings/teams2.js +25 -25
- package/routes/_workspace/settings/tokens2.js +12 -12
- package/routes/_workspace/settings/webhooks2.js +13 -13
- package/routes/_workspace/teams/_key/areas/_area.js +8 -0
- package/routes/_workspace/teams/_key/areas/_area2.js +4 -0
- package/routes/_workspace/teams/_key/areas/_area3.js +9 -0
- package/routes/_workspace/teams/_key/areas/index.js +6 -0
- package/routes/_workspace/teams/_key/areas/index2.js +4 -0
- package/routes/_workspace/teams/_key/{areas3.js → areas/index3.js} +2 -2
- package/routes/_workspace/teams/_key/cycles/_number2.js +27 -27
- package/routes/_workspace/teams/_key/cycles/index2.js +24 -24
- package/routes/_workspace/teams/_key/settings2.js +29 -29
- package/routes/_workspace2.js +368 -368
- package/routes/_workspace/teams/_key/areas.js +0 -6
- package/routes/_workspace/teams/_key/areas2.js +0 -4
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { issueQuery as e } from "../api/queries.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
2
|
+
import { invalidateIssueViews as t } from "../api/mutations.js";
|
|
3
|
+
import { AddIcon as n } from "./icons.js";
|
|
4
|
+
import { PropertyField as r, usePropertyText as i } from "./DocProperties.js";
|
|
5
|
+
import { customFieldsQuery as a, fieldKinds as o, fieldsFor as s, hasValue as c, setIssueFields as l, setProjectFields as u, useCustomFieldActions as d } from "../lib/customFields.js";
|
|
6
|
+
import { useConfirm as f } from "../lib/confirm.js";
|
|
7
|
+
import { issueTypesQuery as p, typeShows as m } from "../lib/issueTypes.js";
|
|
8
8
|
import { Button as h, Checkbox as g, ErrorText as _, IconButton as v, Input as y, Select as b, SettingsCard as x, Textarea as S, menuDivider as C, useOpenMenu as w } from "@parallelworks/ui";
|
|
9
9
|
import { useId as T, useState as E } from "react";
|
|
10
10
|
import { useErrorMessage as D } from "@parallelworks/problem/react";
|
|
@@ -13,16 +13,16 @@ import { Fragment as k, jsx as A, jsxs as j } from "react/jsx-runtime";
|
|
|
13
13
|
import { useMutation as M, useQuery as N, useQueryClient as P } from "@tanstack/react-query";
|
|
14
14
|
// src/components/CustomFields.tsx
|
|
15
15
|
function F(e) {
|
|
16
|
-
let t =
|
|
16
|
+
let t = i(e);
|
|
17
17
|
return (e, n) => t(e, n);
|
|
18
18
|
}
|
|
19
|
-
function I({ workspace:
|
|
20
|
-
let
|
|
21
|
-
mutationFn: (e) =>
|
|
19
|
+
function I({ workspace: n, issue: i, label: o }) {
|
|
20
|
+
let c = D(), u = P(), { data: d } = N(a(n)), { data: f } = N(p(n)), h = f?.find((e) => e.id === i.type?.id), g = s(d, "issue", i.teamId).filter((e) => m(h, e.id)), v = e(n, i.identifier).queryKey, y = M({
|
|
21
|
+
mutationFn: (e) => l(n, i.identifier, e),
|
|
22
22
|
onMutate: async (e) => {
|
|
23
|
-
await
|
|
24
|
-
let t =
|
|
25
|
-
return t &&
|
|
23
|
+
await u.cancelQueries({ queryKey: v });
|
|
24
|
+
let t = u.getQueryData(v);
|
|
25
|
+
return t && u.setQueryData(v, {
|
|
26
26
|
...t,
|
|
27
27
|
fields: {
|
|
28
28
|
...t.fields,
|
|
@@ -31,61 +31,61 @@ function I({ workspace: t, issue: r, label: a }) {
|
|
|
31
31
|
}), { previous: t };
|
|
32
32
|
},
|
|
33
33
|
onError: (e, t, n) => {
|
|
34
|
-
n?.previous &&
|
|
34
|
+
n?.previous && u.setQueryData(v, n.previous);
|
|
35
35
|
},
|
|
36
|
-
onSuccess: (e) =>
|
|
37
|
-
onSettled: () =>
|
|
36
|
+
onSuccess: (e) => u.setQueryData(v, e),
|
|
37
|
+
onSettled: () => t(u, n, i.identifier)
|
|
38
38
|
});
|
|
39
|
-
return g.length === 0 ? null : /* @__PURE__ */ j(k, { children: [g.map((e) =>
|
|
39
|
+
return g.length === 0 ? null : /* @__PURE__ */ j(k, { children: [g.map((e) => o(e.name, /* @__PURE__ */ A("div", {
|
|
40
40
|
className: "px-2",
|
|
41
|
-
children: /* @__PURE__ */ A(
|
|
42
|
-
workspace:
|
|
41
|
+
children: /* @__PURE__ */ A(r, {
|
|
42
|
+
workspace: n,
|
|
43
43
|
property: e,
|
|
44
|
-
value:
|
|
44
|
+
value: i.fields[e.id],
|
|
45
45
|
editable: !0,
|
|
46
46
|
onChange: (t) => y.mutate({ [e.id]: t })
|
|
47
47
|
})
|
|
48
48
|
}), e.id)), y.error && /* @__PURE__ */ A(_, {
|
|
49
49
|
className: "px-2",
|
|
50
|
-
children:
|
|
50
|
+
children: c(y.error)
|
|
51
51
|
})] });
|
|
52
52
|
}
|
|
53
|
-
function L({ workspace: e, project: t, editable:
|
|
54
|
-
let o = O("customFields"), c = D(), { data: l } = N(
|
|
55
|
-
mutationFn: (n) =>
|
|
56
|
-
onSuccess:
|
|
53
|
+
function L({ workspace: e, project: t, editable: n, onChange: i }) {
|
|
54
|
+
let o = O("customFields"), c = D(), { data: l } = N(a(e)), d = s(l, "project"), f = M({
|
|
55
|
+
mutationFn: (n) => u(e, t.id, n),
|
|
56
|
+
onSuccess: i
|
|
57
57
|
});
|
|
58
|
-
return
|
|
58
|
+
return d.length === 0 ? null : /* @__PURE__ */ j("section", {
|
|
59
59
|
"aria-label": o("title"),
|
|
60
60
|
className: "max-w-xl space-y-0.5 text-sm",
|
|
61
|
-
children: [
|
|
61
|
+
children: [d.map((i) => /* @__PURE__ */ j("div", {
|
|
62
62
|
className: "flex min-h-8 items-center gap-2",
|
|
63
63
|
children: [/* @__PURE__ */ A("span", {
|
|
64
64
|
className: "w-36 shrink-0 truncate text-muted-foreground",
|
|
65
|
-
children:
|
|
65
|
+
children: i.name
|
|
66
66
|
}), /* @__PURE__ */ A("div", {
|
|
67
67
|
className: "min-w-0 flex-1",
|
|
68
|
-
children: /* @__PURE__ */ A(
|
|
68
|
+
children: /* @__PURE__ */ A(r, {
|
|
69
69
|
workspace: e,
|
|
70
|
-
property:
|
|
71
|
-
value: t.fields[
|
|
72
|
-
editable:
|
|
73
|
-
onChange: (e) =>
|
|
70
|
+
property: i,
|
|
71
|
+
value: t.fields[i.id],
|
|
72
|
+
editable: n,
|
|
73
|
+
onChange: (e) => f.mutate({ [i.id]: e })
|
|
74
74
|
})
|
|
75
75
|
})]
|
|
76
|
-
},
|
|
76
|
+
}, i.id)), f.error && /* @__PURE__ */ A(_, { children: c(f.error) })]
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
|
-
function R({ workspace: e, teamId: t, typeId:
|
|
80
|
-
let
|
|
79
|
+
function R({ workspace: e, teamId: t, typeId: n, values: i, onChange: o }) {
|
|
80
|
+
let l = O("customFields"), { data: u } = N(a(e)), { data: d } = N(p(e)), f = d?.find((e) => e.id === n), h = s(u, "issue", t).filter((e) => m(f, e.id)).map((e) => f?.requiredFieldIds.includes(e.id) ? {
|
|
81
81
|
...e,
|
|
82
82
|
required: !0
|
|
83
|
-
} : e).filter((e) => e.required ||
|
|
83
|
+
} : e).filter((e) => e.required || c(i[e.id]));
|
|
84
84
|
return h.length === 0 ? null : /* @__PURE__ */ j("fieldset", {
|
|
85
85
|
className: "space-y-0.5 text-sm",
|
|
86
86
|
children: [/* @__PURE__ */ A("legend", {
|
|
87
87
|
className: "sr-only",
|
|
88
|
-
children:
|
|
88
|
+
children: l("title")
|
|
89
89
|
}), h.map((t) => /* @__PURE__ */ j("div", {
|
|
90
90
|
className: "flex min-h-8 items-center gap-2",
|
|
91
91
|
children: [/* @__PURE__ */ j("span", {
|
|
@@ -96,17 +96,17 @@ function R({ workspace: e, teamId: t, typeId: r, values: o, onChange: s }) {
|
|
|
96
96
|
children: [" ", "*"]
|
|
97
97
|
}), /* @__PURE__ */ A("span", {
|
|
98
98
|
className: "sr-only",
|
|
99
|
-
children:
|
|
99
|
+
children: l("required")
|
|
100
100
|
})] })]
|
|
101
101
|
}), /* @__PURE__ */ A("div", {
|
|
102
102
|
className: "min-w-0 flex-1",
|
|
103
|
-
children: /* @__PURE__ */ A(
|
|
103
|
+
children: /* @__PURE__ */ A(r, {
|
|
104
104
|
workspace: e,
|
|
105
105
|
property: t,
|
|
106
|
-
value:
|
|
106
|
+
value: i[t.id],
|
|
107
107
|
editable: !0,
|
|
108
|
-
onChange: (e) =>
|
|
109
|
-
...
|
|
108
|
+
onChange: (e) => o({
|
|
109
|
+
...i,
|
|
110
110
|
[t.id]: e
|
|
111
111
|
})
|
|
112
112
|
})
|
|
@@ -115,148 +115,148 @@ function R({ workspace: e, teamId: t, typeId: r, values: o, onChange: s }) {
|
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
117
|
function z({ workspace: e, target: t, team: r }) {
|
|
118
|
-
let i = O("customFields"), { data:
|
|
118
|
+
let i = O("customFields"), { data: o } = N(a(e)), s = (o ?? []).filter((e) => e.target === t && (r ? e.teamId === r.id : !e.teamId)).sort((e, t) => e.position - t.position), [c, l] = E(!1);
|
|
119
119
|
return /* @__PURE__ */ j(x, {
|
|
120
120
|
title: i(t === "issue" ? "issueFields" : "projectFields"),
|
|
121
121
|
description: i(r ? "teamFieldsHelp" : t === "issue" ? "issueFieldsHelp" : "projectFieldsHelp"),
|
|
122
122
|
action: /* @__PURE__ */ A(h, {
|
|
123
123
|
size: "sm",
|
|
124
|
-
icon: /* @__PURE__ */ A(
|
|
125
|
-
onClick: () =>
|
|
124
|
+
icon: /* @__PURE__ */ A(n, {}),
|
|
125
|
+
onClick: () => l(!0),
|
|
126
126
|
children: i("add")
|
|
127
127
|
}),
|
|
128
|
-
children: [
|
|
128
|
+
children: [c && /* @__PURE__ */ A(V, {
|
|
129
129
|
workspace: e,
|
|
130
130
|
target: t,
|
|
131
131
|
team: r?.key,
|
|
132
|
-
onDone: () =>
|
|
133
|
-
}),
|
|
132
|
+
onDone: () => l(!1)
|
|
133
|
+
}), s.length === 0 && !c ? /* @__PURE__ */ A("p", {
|
|
134
134
|
className: "px-3 py-3 text-sm text-muted-foreground",
|
|
135
135
|
children: i("none")
|
|
136
136
|
}) : /* @__PURE__ */ A("ul", {
|
|
137
137
|
className: "divide-y divide-border",
|
|
138
|
-
children:
|
|
138
|
+
children: s.map((t, n) => /* @__PURE__ */ A(B, {
|
|
139
139
|
workspace: e,
|
|
140
140
|
field: t,
|
|
141
|
-
before:
|
|
142
|
-
after:
|
|
141
|
+
before: s[n - 1],
|
|
142
|
+
after: s[n + 1]
|
|
143
143
|
}, t.id))
|
|
144
144
|
})]
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
|
-
function B({ workspace: e, field:
|
|
148
|
-
let
|
|
149
|
-
id:
|
|
150
|
-
position:
|
|
151
|
-
}), m = () =>
|
|
152
|
-
title:
|
|
153
|
-
description:
|
|
154
|
-
confirmLabel:
|
|
147
|
+
function B({ workspace: e, field: t, before: n, after: r }) {
|
|
148
|
+
let i = O("customFields"), a = d(e), o = w(), { confirm: s, dialog: c } = f(), [l, u] = E(!1), p = (e, n) => e && a.update.mutate({
|
|
149
|
+
id: t.id,
|
|
150
|
+
position: n ? (e.position + n.position) / 2 : e.position + (e === r ? 1 : -1)
|
|
151
|
+
}), m = () => s({
|
|
152
|
+
title: i("deleteTitle", { name: t.name }),
|
|
153
|
+
description: i("deleteDescription", { count: t.values }),
|
|
154
|
+
confirmLabel: i("delete"),
|
|
155
155
|
destructive: !0,
|
|
156
|
-
onConfirm: () =>
|
|
156
|
+
onConfirm: () => a.remove.mutateAsync(t.id)
|
|
157
157
|
}), h = () => [
|
|
158
158
|
{
|
|
159
|
-
label:
|
|
160
|
-
onClick: () =>
|
|
159
|
+
label: i("edit"),
|
|
160
|
+
onClick: () => u(!0)
|
|
161
161
|
},
|
|
162
|
+
...n ? [{
|
|
163
|
+
label: i("moveUp"),
|
|
164
|
+
onClick: () => p(n, void 0)
|
|
165
|
+
}] : [],
|
|
162
166
|
...r ? [{
|
|
163
|
-
label:
|
|
167
|
+
label: i("moveDown"),
|
|
164
168
|
onClick: () => p(r, void 0)
|
|
165
169
|
}] : [],
|
|
166
|
-
...i ? [{
|
|
167
|
-
label: a("moveDown"),
|
|
168
|
-
onClick: () => p(i, void 0)
|
|
169
|
-
}] : [],
|
|
170
170
|
{
|
|
171
|
-
label:
|
|
172
|
-
onClick: () =>
|
|
173
|
-
id:
|
|
174
|
-
archived: !
|
|
171
|
+
label: t.archivedAt ? i("restore") : i("archive"),
|
|
172
|
+
onClick: () => a.update.mutate({
|
|
173
|
+
id: t.id,
|
|
174
|
+
archived: !t.archivedAt
|
|
175
175
|
})
|
|
176
176
|
},
|
|
177
177
|
C,
|
|
178
178
|
{
|
|
179
|
-
label:
|
|
179
|
+
label: i("delete"),
|
|
180
180
|
destructive: !0,
|
|
181
181
|
onClick: m
|
|
182
182
|
}
|
|
183
183
|
];
|
|
184
|
-
return
|
|
184
|
+
return l ? /* @__PURE__ */ A("li", {
|
|
185
185
|
className: "p-2",
|
|
186
186
|
children: /* @__PURE__ */ A(V, {
|
|
187
187
|
workspace: e,
|
|
188
|
-
target:
|
|
189
|
-
field:
|
|
190
|
-
onDone: () =>
|
|
188
|
+
target: t.target,
|
|
189
|
+
field: t,
|
|
190
|
+
onDone: () => u(!1)
|
|
191
191
|
})
|
|
192
192
|
}) : /* @__PURE__ */ j("li", {
|
|
193
193
|
className: "flex min-h-10 items-center gap-3 px-3 py-1.5",
|
|
194
|
-
onContextMenu: (e) =>
|
|
194
|
+
onContextMenu: (e) => o(e, h()),
|
|
195
195
|
children: [
|
|
196
196
|
/* @__PURE__ */ j("div", {
|
|
197
197
|
className: "min-w-0 flex-1",
|
|
198
198
|
children: [/* @__PURE__ */ j("p", {
|
|
199
|
-
className: `truncate text-sm ${
|
|
200
|
-
children: [
|
|
199
|
+
className: `truncate text-sm ${t.archivedAt ? "text-muted-foreground" : ""}`,
|
|
200
|
+
children: [t.name, t.required && /* @__PURE__ */ A("span", {
|
|
201
201
|
className: "ml-2 text-xs text-muted-foreground",
|
|
202
|
-
children:
|
|
202
|
+
children: i("required")
|
|
203
203
|
})]
|
|
204
|
-
}),
|
|
204
|
+
}), t.description && /* @__PURE__ */ A("p", {
|
|
205
205
|
className: "truncate text-xs text-muted-foreground",
|
|
206
|
-
children:
|
|
206
|
+
children: t.description
|
|
207
207
|
})]
|
|
208
208
|
}),
|
|
209
|
-
|
|
209
|
+
t.archivedAt && /* @__PURE__ */ A("span", {
|
|
210
210
|
className: "shrink-0 text-xs text-muted-foreground",
|
|
211
|
-
children:
|
|
211
|
+
children: i("archived")
|
|
212
212
|
}),
|
|
213
213
|
/* @__PURE__ */ A("span", {
|
|
214
214
|
className: "shrink-0 text-xs text-muted-foreground",
|
|
215
|
-
children:
|
|
215
|
+
children: i(`kinds.${t.kind}`)
|
|
216
216
|
}),
|
|
217
217
|
/* @__PURE__ */ A("span", {
|
|
218
218
|
className: "w-20 shrink-0 text-right text-xs tabular-nums text-muted-foreground",
|
|
219
|
-
children:
|
|
219
|
+
children: i("values", { count: t.values })
|
|
220
220
|
}),
|
|
221
221
|
/* @__PURE__ */ A(v, {
|
|
222
222
|
variant: "ghost",
|
|
223
223
|
size: "sm",
|
|
224
|
-
label:
|
|
224
|
+
label: i("actions", { name: t.name }),
|
|
225
225
|
icon: /* @__PURE__ */ A("span", {
|
|
226
226
|
"aria-hidden": !0,
|
|
227
227
|
children: "⋯"
|
|
228
228
|
}),
|
|
229
|
-
onClick: (e) =>
|
|
229
|
+
onClick: (e) => o(e, h())
|
|
230
230
|
}),
|
|
231
|
-
|
|
231
|
+
c
|
|
232
232
|
]
|
|
233
233
|
});
|
|
234
234
|
}
|
|
235
|
-
function V({ workspace: e, target: t, team: n, field:
|
|
236
|
-
let
|
|
237
|
-
let t =
|
|
235
|
+
function V({ workspace: e, target: t, team: n, field: r, onDone: i }) {
|
|
236
|
+
let a = O("customFields"), s = D(), c = d(e), [l, u] = E(r?.name ?? ""), [f, p] = E(r?.description ?? ""), [m, v] = E(r?.kind ?? "text"), [x, C] = E(r?.required ?? !1), w = T(), [k, M] = E((r?.options ?? []).map((e) => e.name).join("\n")), N = m === "select" || m === "multi_select", P = () => k.split("\n").map((e) => e.trim()).filter(Boolean).map((e) => {
|
|
237
|
+
let t = r?.options.find((t) => t.name === e)?.id;
|
|
238
238
|
return {
|
|
239
239
|
name: e,
|
|
240
240
|
...t && { id: t }
|
|
241
241
|
};
|
|
242
|
-
}), F =
|
|
242
|
+
}), F = r ? c.update : c.create;
|
|
243
243
|
return /* @__PURE__ */ j("form", {
|
|
244
244
|
onSubmit: (e) => {
|
|
245
|
-
e.preventDefault(),
|
|
246
|
-
id:
|
|
247
|
-
name:
|
|
245
|
+
e.preventDefault(), r ? c.update.mutate({
|
|
246
|
+
id: r.id,
|
|
247
|
+
name: l,
|
|
248
248
|
description: f,
|
|
249
249
|
...t === "issue" && { required: x },
|
|
250
250
|
...N && { options: P() }
|
|
251
|
-
}, { onSuccess:
|
|
251
|
+
}, { onSuccess: i }) : c.create.mutate({
|
|
252
252
|
target: t,
|
|
253
253
|
...n && { team: n },
|
|
254
|
-
name:
|
|
254
|
+
name: l,
|
|
255
255
|
description: f,
|
|
256
256
|
kind: m,
|
|
257
257
|
...t === "issue" && { required: x },
|
|
258
258
|
...N && { options: P() }
|
|
259
|
-
}, { onSuccess:
|
|
259
|
+
}, { onSuccess: i });
|
|
260
260
|
},
|
|
261
261
|
className: "space-y-3 rounded-md border border-border p-3 text-sm",
|
|
262
262
|
children: [
|
|
@@ -264,9 +264,9 @@ function V({ workspace: e, target: t, team: n, field: i, onDone: a }) {
|
|
|
264
264
|
className: "grid gap-3 sm:grid-cols-2",
|
|
265
265
|
children: [/* @__PURE__ */ j("label", {
|
|
266
266
|
className: "block text-xs font-medium text-muted-foreground",
|
|
267
|
-
children: [
|
|
268
|
-
value:
|
|
269
|
-
onChange: (e) =>
|
|
267
|
+
children: [a("name"), /* @__PURE__ */ A(y, {
|
|
268
|
+
value: l,
|
|
269
|
+
onChange: (e) => u(e.target.value),
|
|
270
270
|
required: !0,
|
|
271
271
|
maxLength: 60,
|
|
272
272
|
className: "mt-1",
|
|
@@ -274,25 +274,25 @@ function V({ workspace: e, target: t, team: n, field: i, onDone: a }) {
|
|
|
274
274
|
})]
|
|
275
275
|
}), /* @__PURE__ */ j("div", {
|
|
276
276
|
className: "text-xs font-medium text-muted-foreground",
|
|
277
|
-
children: [
|
|
277
|
+
children: [a("kind"), /* @__PURE__ */ A("div", {
|
|
278
278
|
className: "mt-1",
|
|
279
279
|
children: /* @__PURE__ */ A(b, {
|
|
280
280
|
value: m,
|
|
281
|
-
items:
|
|
281
|
+
items: o.map((e) => ({
|
|
282
282
|
value: e,
|
|
283
|
-
label:
|
|
283
|
+
label: a(`kinds.${e}`)
|
|
284
284
|
})),
|
|
285
285
|
onValueChange: v,
|
|
286
|
-
"aria-label":
|
|
286
|
+
"aria-label": a("kind"),
|
|
287
287
|
width: "fill",
|
|
288
|
-
disabled: !!
|
|
288
|
+
disabled: !!r
|
|
289
289
|
})
|
|
290
290
|
})]
|
|
291
291
|
})]
|
|
292
292
|
}),
|
|
293
293
|
/* @__PURE__ */ j("label", {
|
|
294
294
|
className: "block text-xs font-medium text-muted-foreground",
|
|
295
|
-
children: [
|
|
295
|
+
children: [a("description"), /* @__PURE__ */ A(y, {
|
|
296
296
|
value: f,
|
|
297
297
|
onChange: (e) => p(e.target.value),
|
|
298
298
|
maxLength: 500,
|
|
@@ -302,7 +302,7 @@ function V({ workspace: e, target: t, team: n, field: i, onDone: a }) {
|
|
|
302
302
|
N && /* @__PURE__ */ j("label", {
|
|
303
303
|
className: "block text-xs font-medium text-muted-foreground",
|
|
304
304
|
children: [
|
|
305
|
-
|
|
305
|
+
a("options"),
|
|
306
306
|
/* @__PURE__ */ A(S, {
|
|
307
307
|
value: k,
|
|
308
308
|
onChange: (e) => M(e.target.value),
|
|
@@ -311,7 +311,7 @@ function V({ workspace: e, target: t, team: n, field: i, onDone: a }) {
|
|
|
311
311
|
}),
|
|
312
312
|
/* @__PURE__ */ A("span", {
|
|
313
313
|
className: "mt-1 block font-normal",
|
|
314
|
-
children:
|
|
314
|
+
children: a("optionsHint")
|
|
315
315
|
})
|
|
316
316
|
]
|
|
317
317
|
}),
|
|
@@ -323,7 +323,7 @@ function V({ workspace: e, target: t, team: n, field: i, onDone: a }) {
|
|
|
323
323
|
onCheckedChange: (e) => C(e === !0)
|
|
324
324
|
}), /* @__PURE__ */ A("label", {
|
|
325
325
|
htmlFor: w,
|
|
326
|
-
children:
|
|
326
|
+
children: a("requiredLabel")
|
|
327
327
|
})]
|
|
328
328
|
}),
|
|
329
329
|
F.error && /* @__PURE__ */ A(_, { children: s(F.error) }),
|
|
@@ -332,15 +332,15 @@ function V({ workspace: e, target: t, team: n, field: i, onDone: a }) {
|
|
|
332
332
|
children: [/* @__PURE__ */ A(h, {
|
|
333
333
|
size: "sm",
|
|
334
334
|
variant: "ghost",
|
|
335
|
-
onClick:
|
|
336
|
-
children:
|
|
335
|
+
onClick: i,
|
|
336
|
+
children: a("cancel")
|
|
337
337
|
}), /* @__PURE__ */ A(h, {
|
|
338
338
|
type: "submit",
|
|
339
339
|
size: "sm",
|
|
340
340
|
variant: "primary",
|
|
341
341
|
loading: F.isPending,
|
|
342
|
-
disabled: !
|
|
343
|
-
children:
|
|
342
|
+
disabled: !l.trim(),
|
|
343
|
+
children: a(r ? "save" : "add")
|
|
344
344
|
})]
|
|
345
345
|
})
|
|
346
346
|
]
|
package/components/DateChip.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { api as e, unwrap as t } from "../api/client.js";
|
|
2
2
|
import { meQuery as n } from "../api/queries.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { docKey as r } from "../lib/docs.js";
|
|
4
|
+
import { CalendarIcon as i, NotificationIcon as a } from "./icons.js";
|
|
5
5
|
import { usePeople as o } from "../lib/people.js";
|
|
6
6
|
import { fromIsoDate as s, isoDate as c } from "../lib/datePhrases.js";
|
|
7
7
|
import { Button as l, ErrorText as u, Input as d, Popover as f, Select as p } from "@parallelworks/ui";
|
|
@@ -53,7 +53,7 @@ var O = w.create({
|
|
|
53
53
|
renderMarkdown: (e) => `@${String(e.attrs?.date ?? "")}`
|
|
54
54
|
});
|
|
55
55
|
function k({ node: e, editor: t, updateAttributes: n }) {
|
|
56
|
-
let
|
|
56
|
+
let r = _(), o = v("dateChip"), c = s(String(e.attrs.date ?? "")), l = e.attrs.remindAt, u = /* @__PURE__ */ new Date(), d = c ? r.dateTime(c, {
|
|
57
57
|
weekday: "short",
|
|
58
58
|
month: "short",
|
|
59
59
|
day: "numeric",
|
|
@@ -62,9 +62,9 @@ function k({ node: e, editor: t, updateAttributes: n }) {
|
|
|
62
62
|
className: "date-chip",
|
|
63
63
|
"data-reminder": l ? "" : void 0,
|
|
64
64
|
children: [
|
|
65
|
-
/* @__PURE__ */ b(
|
|
65
|
+
/* @__PURE__ */ b(i, { className: "size-3.5" }),
|
|
66
66
|
d,
|
|
67
|
-
l && /* @__PURE__ */ b(
|
|
67
|
+
l && /* @__PURE__ */ b(a, {
|
|
68
68
|
className: "size-3",
|
|
69
69
|
"aria-label": o("reminderSet")
|
|
70
70
|
})
|
|
@@ -91,10 +91,10 @@ function k({ node: e, editor: t, updateAttributes: n }) {
|
|
|
91
91
|
}) : p
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
|
-
function A({ node:
|
|
95
|
-
let f = v("dateChip"), w = _(), T = g(), { workspace: E = "", doc: D } = m({ strict: !1 }), { members: O } = o(E), { data: k } = C(n), A = String(
|
|
94
|
+
function A({ node: i, updateAttributes: a }) {
|
|
95
|
+
let f = v("dateChip"), w = _(), T = g(), { workspace: E = "", doc: D } = m({ strict: !1 }), { members: O } = o(E), { data: k } = C(n), A = String(i.attrs.date ?? ""), j = i.attrs.reminderId, M = i.attrs.remindAt, N = i.attrs.remindFor ?? "", [P, F] = h(""), [I, L] = h("09:00"), R = {
|
|
96
96
|
workspace: E,
|
|
97
|
-
doc: D ?
|
|
97
|
+
doc: D ? r(D) : ""
|
|
98
98
|
}, z = S({
|
|
99
99
|
mutationFn: async () => {
|
|
100
100
|
let n = s(A);
|
|
@@ -109,7 +109,7 @@ function A({ node: r, updateAttributes: i }) {
|
|
|
109
109
|
}
|
|
110
110
|
}));
|
|
111
111
|
},
|
|
112
|
-
onSuccess: (e) =>
|
|
112
|
+
onSuccess: (e) => a({
|
|
113
113
|
reminderId: e.id,
|
|
114
114
|
remindAt: e.remindAt,
|
|
115
115
|
remindFor: P || null
|
|
@@ -121,7 +121,7 @@ function A({ node: r, updateAttributes: i }) {
|
|
|
121
121
|
reminderId: j
|
|
122
122
|
} } });
|
|
123
123
|
},
|
|
124
|
-
onSuccess: () =>
|
|
124
|
+
onSuccess: () => a({
|
|
125
125
|
reminderId: null,
|
|
126
126
|
remindAt: null,
|
|
127
127
|
remindFor: null
|
|
@@ -136,7 +136,7 @@ function A({ node: r, updateAttributes: i }) {
|
|
|
136
136
|
value: A,
|
|
137
137
|
onChange: (e) => {
|
|
138
138
|
let t = s(e.target.value);
|
|
139
|
-
t &&
|
|
139
|
+
t && a({ date: c(t) });
|
|
140
140
|
},
|
|
141
141
|
className: "mt-1"
|
|
142
142
|
})]
|
package/components/DocButton.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { api as e, unwrap as t } from "../api/client.js";
|
|
2
2
|
import { docQuery as n, docTemplatesQuery as r, docsQuery as i } from "../api/queries.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { docKey as a, docRef as o, useTemplateValues as s } from "../lib/docs.js";
|
|
4
|
+
import { EditIcon as c } from "./icons.js";
|
|
5
5
|
import { closingFence as l } from "./toggle.js";
|
|
6
6
|
import { Button as u, Combobox as d, IconButton as f, Input as p, Popover as m, SegmentedControl as h, Select as g, Textarea as _ } from "@parallelworks/ui";
|
|
7
7
|
import { useNavigate as v, useParams as y } from "@tanstack/react-router";
|
|
@@ -68,7 +68,7 @@ var k = /^:::button[ \t]*([^\n]*)\n/, A = /\s+(template|parent)=([\w-]+)/g, j =
|
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
70
|
function M({ node: r, editor: i, getPos: l, updateAttributes: d }) {
|
|
71
|
-
let p = x("docButton"), h = v(), g =
|
|
71
|
+
let p = x("docButton"), h = v(), g = s(), { workspace: _ = "", doc: T = "" } = y({ strict: !1 }), { data: D } = w({
|
|
72
72
|
...n(_, T),
|
|
73
73
|
enabled: !!_ && !!T
|
|
74
74
|
}), [O, k] = b(!1), A = String(r.attrs.label ?? "") || p("untitled"), j = r.attrs.action, M = j === "doc" ? !!r.attrs.template : !!String(r.attrs.blocks ?? "").trim(), P = async () => {
|
|
@@ -91,7 +91,7 @@ function M({ node: r, editor: i, getPos: l, updateAttributes: d }) {
|
|
|
91
91
|
to: "/$workspace/docs/$doc",
|
|
92
92
|
params: {
|
|
93
93
|
workspace: _,
|
|
94
|
-
doc:
|
|
94
|
+
doc: o(i)
|
|
95
95
|
}
|
|
96
96
|
});
|
|
97
97
|
} finally {
|
|
@@ -115,7 +115,7 @@ function M({ node: r, editor: i, getPos: l, updateAttributes: d }) {
|
|
|
115
115
|
trigger: /* @__PURE__ */ S(f, {
|
|
116
116
|
variant: "ghost",
|
|
117
117
|
size: "xs",
|
|
118
|
-
icon: /* @__PURE__ */ S(
|
|
118
|
+
icon: /* @__PURE__ */ S(c, {}),
|
|
119
119
|
label: p("edit")
|
|
120
120
|
}),
|
|
121
121
|
align: "start",
|
|
@@ -125,7 +125,7 @@ function M({ node: r, editor: i, getPos: l, updateAttributes: d }) {
|
|
|
125
125
|
children: /* @__PURE__ */ S(N, {
|
|
126
126
|
workspace: _,
|
|
127
127
|
attrs: r.attrs,
|
|
128
|
-
thisDoc: D?.key ?? (T ?
|
|
128
|
+
thisDoc: D?.key ?? (T ? a(T) : ""),
|
|
129
129
|
onChange: d
|
|
130
130
|
})
|
|
131
131
|
})]
|
package/components/DocHistory.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { api as e, unwrap as t } from "../api/client.js";
|
|
2
2
|
import { docVersionQuery as n, docVersionsQuery as r } from "../api/queries.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { usePeople as i } from "../lib/people.js";
|
|
4
|
+
import { useTime as a } from "../lib/time.js";
|
|
5
5
|
import { Editor as o } from "./Editor.js";
|
|
6
6
|
import { lineDiff as s } from "../lib/diff.js";
|
|
7
7
|
import { Avatar as c, Button as l, ErrorText as u, Loader as d, Tooltip as f } from "@parallelworks/ui";
|
|
@@ -12,7 +12,7 @@ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
|
12
12
|
import { useMutation as v, useQuery as y, useQueryClient as b } from "@tanstack/react-query";
|
|
13
13
|
// src/components/DocHistory.tsx
|
|
14
14
|
function x({ workspace: e, doc: t, selected: n, onSelect: o }) {
|
|
15
|
-
let s = h("docs"), l =
|
|
15
|
+
let s = h("docs"), l = a(), { actorName: u, avatarOf: p } = i(e), { data: m = [], isPending: v } = y(r(e, t.key));
|
|
16
16
|
return /* @__PURE__ */ _("aside", {
|
|
17
17
|
"aria-label": s("history"),
|
|
18
18
|
className: "w-72 shrink-0 overflow-y-auto border-l border-border px-3 py-4 max-md:hidden",
|
|
@@ -62,7 +62,7 @@ function x({ workspace: e, doc: t, selected: n, onSelect: o }) {
|
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
64
|
function S({ workspace: r, doc: s, versionId: c, onDone: d }) {
|
|
65
|
-
let f = h("docs"), x =
|
|
65
|
+
let f = h("docs"), x = a(), S = m(), w = b(), { actorName: T } = i(r), [E, D] = p(!1), { data: O } = y(n(r, s.key, c)), k = v({
|
|
66
66
|
mutationFn: async () => t(await e.POST("/api/v1/workspaces/{workspace}/docs/{doc}/versions/{versionId}/restore", { params: { path: {
|
|
67
67
|
workspace: r,
|
|
68
68
|
doc: s.key,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { appURL as e } from "../lib/base.js";
|
|
2
2
|
import { docQuery as t, docsQuery as n, issueSearchQuery as r, projectsQuery as i } from "../api/queries.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { docURL as a } from "../lib/docs.js";
|
|
4
|
+
import { ProjectIcon as o, StatusIcon as s } from "./icons.js";
|
|
5
5
|
import { headingAnchor as c, headings as l } from "../lib/glossary.js";
|
|
6
6
|
import { issueURL as u } from "../lib/issueMenu.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { projectRef as d } from "../lib/projects.js";
|
|
8
|
+
import { DocIcon as f } from "./DocIcon.js";
|
|
9
9
|
import { useEditorListbox as p } from "./editorListbox.js";
|
|
10
10
|
import { ListboxOption as m, ListboxPanel as h, useListboxNavigation as g } from "@parallelworks/ui";
|
|
11
11
|
import { useParams as _ } from "@tanstack/react-router";
|
|
@@ -98,7 +98,7 @@ function O({ editor: O }) {
|
|
|
98
98
|
}, [O]);
|
|
99
99
|
let U = (t) => {
|
|
100
100
|
if (!O || !j || !t || !k) return;
|
|
101
|
-
let [n, r] = t.kind === "doc" ? [t.heading ? `${t.doc.title} › ${t.heading}` : t.doc.title,
|
|
101
|
+
let [n, r] = t.kind === "doc" ? [t.heading ? `${t.doc.title} › ${t.heading}` : t.doc.title, a(k, t.doc) + (t.heading ? `#${c(t.heading)}` : "")] : t.kind === "issue" ? [t.issue.identifier, u(k, t.issue.identifier)] : [t.project.name, e(`/${k}/projects/${d(t.project)}`)];
|
|
102
102
|
O.chain().focus().insertContentAt({
|
|
103
103
|
from: j.from,
|
|
104
104
|
to: j.to
|
|
@@ -133,7 +133,7 @@ function O({ editor: O }) {
|
|
|
133
133
|
children: H.map((e, t) => {
|
|
134
134
|
let n = e.kind === "doc" ? {
|
|
135
135
|
key: `doc:${e.doc.id}:${e.heading ?? ""}`,
|
|
136
|
-
icon: /* @__PURE__ */ C(
|
|
136
|
+
icon: /* @__PURE__ */ C(f, {
|
|
137
137
|
icon: e.doc.icon,
|
|
138
138
|
className: "size-3.5"
|
|
139
139
|
}),
|
|
@@ -141,12 +141,12 @@ function O({ editor: O }) {
|
|
|
141
141
|
hint: e.heading ? e.doc.title : void 0
|
|
142
142
|
} : e.kind === "issue" ? {
|
|
143
143
|
key: `issue:${e.issue.id}`,
|
|
144
|
-
icon: /* @__PURE__ */ C(
|
|
144
|
+
icon: /* @__PURE__ */ C(s, { category: e.issue.status.category }),
|
|
145
145
|
label: e.issue.title,
|
|
146
146
|
hint: e.issue.identifier
|
|
147
147
|
} : {
|
|
148
148
|
key: `project:${e.project.id}`,
|
|
149
|
-
icon: /* @__PURE__ */ C(
|
|
149
|
+
icon: /* @__PURE__ */ C(o, {}),
|
|
150
150
|
label: e.project.name,
|
|
151
151
|
hint: A("project")
|
|
152
152
|
};
|