@parallelworks/tandem-web 0.171.1 → 0.171.3
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 +5 -2
- package/_virtual/_virtual_i18n/es/common.js +5 -2
- package/_virtual/_virtual_i18n/ja/common.js +5 -2
- package/_virtual/_virtual_i18n/ko/common.js +5 -2
- package/_virtual/_virtual_i18n/zh/common.js +5 -2
- package/components/AccessGrants.js +6 -6
- package/components/ActivityTimeline.js +60 -60
- package/components/ActorAvatar.js +4 -4
- package/components/ActorLink.js +34 -0
- package/components/AgentWork.js +494 -494
- package/components/AppLauncher.js +7 -7
- package/components/AreaLink.js +13 -13
- package/components/AreaTiles.js +13 -13
- package/components/AreaWork.js +22 -22
- package/components/Attachments.js +73 -69
- package/components/BlockHandle.js +3 -3
- package/components/BugRotation.js +8 -8
- package/components/CodeHostSettings.js +121 -87
- package/components/CollabEditor.js +13 -13
- package/components/CommandPalette.js +206 -206
- package/components/CustomFields.js +95 -95
- package/components/CustomerRequests.js +11 -11
- package/components/DashboardPanel.js +201 -164
- package/components/DateChip.js +21 -21
- package/components/DocHistory.js +14 -14
- package/components/DocIcon.js +4 -4
- package/components/DocIconPicker.js +4 -4
- package/components/DocLinkPicker.js +22 -22
- package/components/DocLook.js +16 -16
- package/components/DocProperties.js +81 -81
- package/components/DocTable.js +53 -53
- package/components/DocsTree.js +179 -179
- package/components/Editor.js +69 -69
- package/components/FavoritesNav.js +78 -78
- package/components/GitHub.js +87 -87
- package/components/Graph.js +14 -14
- package/components/HostActions.js +21 -21
- package/components/HostPanel.js +6 -6
- package/components/HoverCards.js +74 -74
- package/components/IssueBoard.js +13 -10
- package/components/IssueBreakdown.js +31 -31
- package/components/IssueCode.js +19 -19
- package/components/IssueEvent.js +97 -92
- package/components/IssueFilters.js +39 -39
- package/components/IssueGroup.js +16 -16
- package/components/IssueImport.js +13 -13
- package/components/IssueInsights.js +20 -20
- package/components/IssueListBlock.js +81 -81
- package/components/IssueRelations.js +34 -34
- package/components/IssueRow.js +31 -31
- package/components/IssueSentry.js +36 -34
- package/components/IssueTemplates.js +23 -23
- package/components/IssueTypes.js +40 -40
- package/components/MarkdownTransfer.js +10 -10
- package/components/MentionPicker.js +19 -19
- package/components/NewIssueDialog.js +53 -53
- package/components/NewProjectDialog.js +82 -82
- package/components/PersonActivity.js +13 -13
- package/components/PersonHoverCard.js +44 -44
- package/components/Planning.js +16 -16
- package/components/Reports.js +8 -8
- package/components/SettingsNav.js +15 -15
- package/components/ShareDialog.js +8 -8
- package/components/SharedViewer.js +23 -23
- package/components/SlashMenu.js +26 -26
- package/components/SubPages.js +10 -10
- package/components/TeamForm.js +9 -9
- package/components/TeamRepositories.js +21 -21
- package/components/TeamWorkflow.js +6 -6
- package/components/UnlinkedMentions.js +29 -29
- package/components/Updates.js +8 -8
- package/components/Widgets.js +99 -97
- package/components/WorkCounts.js +12 -12
- package/components/cycleCrumb.js +8 -8
- package/components/editorPlugins.js +101 -101
- package/components/settings.js +6 -6
- package/components/video.js +7 -7
- package/hostedApp.js +24 -24
- package/index.js +18 -18
- package/lib/assignees.js +3 -3
- package/lib/attachments.js +12 -12
- package/lib/boardMove.js +27 -27
- package/lib/collab.js +1 -1
- package/lib/docs.js +115 -115
- package/lib/githubLink.js +7 -7
- package/lib/issueList.js +51 -51
- package/lib/issueMenu.js +117 -117
- package/lib/knowledge.js +134 -134
- package/lib/live.js +38 -38
- package/lib/notifications.js +47 -47
- package/lib/triageSeen.js +2 -2
- package/lib/views.js +31 -31
- package/package.json +24 -24
- package/pages/area.js +64 -64
- package/pages/areas.js +199 -199
- package/pages/decisions.js +51 -51
- package/pages/issues.js +120 -120
- package/pages/projects.js +238 -238
- package/pages/triage.js +202 -212
- package/routes/_workspace/agents/_slug2.js +127 -127
- package/routes/_workspace/agents/index2.js +22 -22
- package/routes/_workspace/dashboards/_dashboardId2.js +84 -84
- package/routes/_workspace/dashboards/index2.js +34 -34
- package/routes/_workspace/docs/_doc2.js +267 -267
- package/routes/_workspace/docs/space2._space.js +31 -31
- package/routes/_workspace/docs2.js +4 -4
- package/routes/_workspace/graph2.js +11 -11
- package/routes/_workspace/graph3.js +11 -11
- package/routes/_workspace/issues/_identifier2.js +519 -522
- package/routes/_workspace/issues/index.js +13 -13
- package/routes/_workspace/knowledge/_term2.js +148 -146
- package/routes/_workspace/knowledge/_term3.js +4 -4
- package/routes/_workspace/knowledge/index.js +12 -12
- package/routes/_workspace/knowledge/index2.js +117 -115
- package/routes/_workspace/measures2.js +8 -8
- package/routes/_workspace/measures3.js +29 -29
- package/routes/_workspace/notifications2.js +263 -263
- package/routes/_workspace/people/_username.js +10 -10
- package/routes/_workspace/people/_username2.js +41 -41
- package/routes/_workspace/projects/_projectId3.js +303 -303
- package/routes/_workspace/projects/_projectId4.js +4 -4
- package/routes/_workspace/projects/_projectId_3.milestones._milestoneId.js +28 -28
- package/routes/_workspace/projects/_projectId_4.milestones._milestoneId.js +4 -4
- package/routes/_workspace/projects/index.js +8 -8
- package/routes/_workspace/settings/account2.js +8 -8
- package/routes/_workspace/settings/audit-log2.js +8 -8
- package/routes/_workspace/settings/audit-log3.js +155 -155
- package/routes/_workspace/settings/connections2.js +4 -4
- package/routes/_workspace/settings/fields2.js +5 -5
- package/routes/_workspace/settings/github2.js +11 -11
- package/routes/_workspace/settings/gitlab2.js +5 -5
- package/routes/_workspace/settings/groups2.js +52 -52
- package/routes/_workspace/settings/import2.js +39 -39
- package/routes/_workspace/settings/index2.js +5 -5
- package/routes/_workspace/settings/intercom2.js +11 -11
- package/routes/_workspace/settings/labels2.js +33 -33
- package/routes/_workspace/settings/members2.js +81 -81
- package/routes/_workspace/settings/notifications2.js +46 -46
- package/routes/_workspace/settings/parallelworks2.js +20 -20
- package/routes/_workspace/settings/roles2.js +41 -41
- package/routes/_workspace/settings/runners2.js +15 -15
- package/routes/_workspace/settings/sentry2.js +15 -15
- package/routes/_workspace/settings/sessions2.js +9 -9
- package/routes/_workspace/settings/sessions3.js +4 -4
- package/routes/_workspace/settings/slack2.js +12 -12
- package/routes/_workspace/settings/sso2.js +37 -37
- package/routes/_workspace/settings/sso3.js +7 -7
- package/routes/_workspace/settings/teams2.js +29 -29
- package/routes/_workspace/settings/tokens2.js +32 -32
- package/routes/_workspace/settings/tokens3.js +4 -4
- package/routes/_workspace/settings/webhooks2.js +41 -41
- package/routes/_workspace/settings/zendesk2.js +11 -11
- package/routes/_workspace/teams/_key/cycles/_number2.js +33 -33
- package/routes/_workspace/teams/_key/cycles/_number3.js +7 -7
- package/routes/_workspace/teams/_key/cycles/index2.js +37 -37
- package/routes/_workspace/teams/_key/issues.js +10 -10
- package/routes/_workspace/teams/_key/projects.js +6 -6
- package/routes/_workspace/teams/_key/settings2.js +396 -396
- package/routes/_workspace2.js +308 -308
- package/routes/_workspace3.js +8 -8
- package/routes/device2.js +4 -4
- package/routes/device3.js +4 -4
- package/routes/docs/_tag/_endpoint2.js +3 -3
- package/routes/docs/_tag/index2.js +3 -3
- package/routes/docs/route2.js +7 -7
- package/routes/index2.js +5 -5
- package/routes/login2.js +10 -10
- package/routes/new2.js +12 -12
- package/routes/new3.js +5 -5
- package/routes/request2._token.js +6 -6
- package/routes/share2._secret.js +4 -4
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { appLink as e } from "../lib/appLink.js";
|
|
2
|
+
import { GridIcon as t } from "./icons.js";
|
|
3
3
|
import { IconButton as n, Popover as r, useClosePopover as i } from "@parallelworks/ui";
|
|
4
4
|
import { useTranslations as a } from "use-intl";
|
|
5
5
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
6
|
// src/components/AppLauncher.tsx
|
|
7
7
|
function c({ apps: i, className: s = "" }) {
|
|
8
|
-
let c = a("workspace"), u = i.flatMap((
|
|
9
|
-
let n = t
|
|
8
|
+
let c = a("workspace"), u = i.flatMap((t) => {
|
|
9
|
+
let n = e(t.url);
|
|
10
10
|
return n ? [{
|
|
11
|
-
...
|
|
11
|
+
...t,
|
|
12
12
|
href: n,
|
|
13
|
-
icon:
|
|
13
|
+
icon: t.iconUrl ? e(t.iconUrl) : void 0
|
|
14
14
|
}] : [];
|
|
15
15
|
});
|
|
16
16
|
return u.length === 0 ? null : /* @__PURE__ */ o("div", {
|
|
17
17
|
className: s,
|
|
18
18
|
children: /* @__PURE__ */ o(r, {
|
|
19
19
|
trigger: /* @__PURE__ */ o(n, {
|
|
20
|
-
icon: /* @__PURE__ */ o(
|
|
20
|
+
icon: /* @__PURE__ */ o(t, { className: "size-4" }),
|
|
21
21
|
label: c("apps"),
|
|
22
22
|
size: "md"
|
|
23
23
|
}),
|
package/components/AreaLink.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { areasQuery as e, teamsQuery as t } from "../api/queries.js";
|
|
2
|
+
import { Link as n } from "../lib/router.js";
|
|
3
3
|
import { jsx as r } from "react/jsx-runtime";
|
|
4
4
|
import { useQuery as i } from "@tanstack/react-query";
|
|
5
5
|
// src/components/AreaLink.tsx
|
|
6
|
-
function a(
|
|
7
|
-
let { data: a = [] } = i(n
|
|
8
|
-
...
|
|
6
|
+
function a(n, r) {
|
|
7
|
+
let { data: a = [] } = i(t(n)), { data: o = [] } = i({
|
|
8
|
+
...e(n),
|
|
9
9
|
enabled: r.teamId === void 0
|
|
10
10
|
}), s = r.teamId === void 0 ? o.find((e) => e.key === r.key)?.teamId : r.teamId;
|
|
11
11
|
return s ? a.find((e) => e.id === s)?.key : void 0;
|
|
12
12
|
}
|
|
13
|
-
function o({ workspace:
|
|
14
|
-
let o = a(
|
|
15
|
-
return o ? /* @__PURE__ */ r(
|
|
13
|
+
function o({ workspace: e, area: t, ...i }) {
|
|
14
|
+
let o = a(e, t);
|
|
15
|
+
return o ? /* @__PURE__ */ r(n, {
|
|
16
16
|
to: "/$workspace/teams/$key/areas/$area",
|
|
17
17
|
params: {
|
|
18
|
-
workspace:
|
|
18
|
+
workspace: e,
|
|
19
19
|
key: o,
|
|
20
|
-
area:
|
|
20
|
+
area: t.key
|
|
21
21
|
},
|
|
22
22
|
...i
|
|
23
|
-
}) : /* @__PURE__ */ r(
|
|
23
|
+
}) : /* @__PURE__ */ r(n, {
|
|
24
24
|
to: "/$workspace/areas/$area",
|
|
25
25
|
params: {
|
|
26
|
-
workspace:
|
|
27
|
-
area:
|
|
26
|
+
workspace: e,
|
|
27
|
+
area: t.key
|
|
28
28
|
},
|
|
29
29
|
...i
|
|
30
30
|
});
|
package/components/AreaTiles.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useAreaActions as e } from "../lib/areas.js";
|
|
2
|
+
import { AreaLink as t } from "./AreaLink.js";
|
|
2
3
|
import { DocIcon as n } from "./DocIcon.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { useIconUpload as s } from "./DocLook.js";
|
|
4
|
+
import { DocIconPicker as r } from "./DocIconPicker.js";
|
|
5
|
+
import { useIconUpload as i } from "./DocLook.js";
|
|
6
|
+
import { CropDialog as a } from "./ImageUpload.js";
|
|
7
|
+
import { AreaIcon as o, EditIcon as s } from "./icons.js";
|
|
8
8
|
import { IconButton as c, Tooltip as l, cx as u, useOpenMenu as d } from "@parallelworks/ui";
|
|
9
9
|
import { useTranslations as f } from "use-intl";
|
|
10
10
|
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
@@ -46,17 +46,17 @@ function y({ children: e, hint: t }) {
|
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
function b({ workspace: l, area: u, inside: g, decisions: b, menu: x, onOpen: S }) {
|
|
49
|
-
let C = f("areas"), w = d(), T =
|
|
49
|
+
let C = f("areas"), w = d(), T = e(l), E = u.icon ?? "", D = (e) => T.update.mutate({
|
|
50
50
|
area: u.key,
|
|
51
51
|
body: { icon: e }
|
|
52
|
-
}), O =
|
|
52
|
+
}), O = i(l, D), k = /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(v, {
|
|
53
53
|
decisions: b,
|
|
54
54
|
dashed: u.status === "proposed",
|
|
55
55
|
children: E ? /* @__PURE__ */ m(n, {
|
|
56
56
|
icon: E,
|
|
57
57
|
className: "size-8",
|
|
58
58
|
emojiClassName: "text-3xl"
|
|
59
|
-
}) : /* @__PURE__ */ m(
|
|
59
|
+
}) : /* @__PURE__ */ m(o, { className: "size-7" })
|
|
60
60
|
}), /* @__PURE__ */ m(y, {
|
|
61
61
|
hint: g > 0 ? C("count", { count: g }) : void 0,
|
|
62
62
|
children: u.title
|
|
@@ -70,25 +70,25 @@ function b({ workspace: l, area: u, inside: g, decisions: b, menu: x, onOpen: S
|
|
|
70
70
|
className: _,
|
|
71
71
|
onClick: () => S(u),
|
|
72
72
|
children: k
|
|
73
|
-
}) : /* @__PURE__ */ m(
|
|
73
|
+
}) : /* @__PURE__ */ m(t, {
|
|
74
74
|
workspace: l,
|
|
75
75
|
area: u,
|
|
76
76
|
className: _,
|
|
77
77
|
children: k
|
|
78
78
|
}),
|
|
79
|
-
/* @__PURE__ */ m(
|
|
79
|
+
/* @__PURE__ */ m(r, {
|
|
80
80
|
icon: E,
|
|
81
81
|
onPick: D,
|
|
82
82
|
onUploadFile: O.pick,
|
|
83
83
|
trigger: /* @__PURE__ */ m(c, {
|
|
84
84
|
variant: "ghost",
|
|
85
85
|
size: "xs",
|
|
86
|
-
icon: /* @__PURE__ */ m(
|
|
86
|
+
icon: /* @__PURE__ */ m(s, {}),
|
|
87
87
|
label: C(E ? "changeIcon" : "addIcon", { area: u.title }),
|
|
88
88
|
className: "absolute top-1 right-1 opacity-0 group-hover/tile:opacity-100 focus-visible:opacity-100 aria-expanded:opacity-100 max-md:hidden"
|
|
89
89
|
})
|
|
90
90
|
}),
|
|
91
|
-
O.picked && /* @__PURE__ */ m(
|
|
91
|
+
O.picked && /* @__PURE__ */ m(a, {
|
|
92
92
|
image: O.picked,
|
|
93
93
|
name: u.title,
|
|
94
94
|
onSave: O.save,
|
package/components/AreaWork.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { termRef as e } from "../lib/knowledgeKinds.js";
|
|
2
|
+
import { Link as t } from "../lib/router.js";
|
|
3
|
+
import { AnsweredDecision as n } from "./AgentWork.js";
|
|
4
|
+
import { KnowledgeStatus as r } from "./HoverCards.js";
|
|
5
|
+
import { ChevronRightIcon as i } from "./icons.js";
|
|
6
6
|
import { useState as a } from "react";
|
|
7
7
|
import { useTranslations as o } from "use-intl";
|
|
8
8
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
9
9
|
// src/components/AreaWork.tsx
|
|
10
10
|
var l = (...e) => e.filter(Boolean).join(" ");
|
|
11
|
-
function u({ workspace:
|
|
11
|
+
function u({ workspace: n, entry: i, isNew: a }) {
|
|
12
12
|
let l = o("knowledge"), u = o("areaPage");
|
|
13
|
-
return /* @__PURE__ */ s("li", { children: /* @__PURE__ */ c(
|
|
13
|
+
return /* @__PURE__ */ s("li", { children: /* @__PURE__ */ c(t, {
|
|
14
14
|
to: "/$workspace/knowledge/$term",
|
|
15
15
|
params: {
|
|
16
|
-
workspace:
|
|
17
|
-
term:
|
|
16
|
+
workspace: n,
|
|
17
|
+
term: e(i)
|
|
18
18
|
},
|
|
19
19
|
className: "flex min-w-0 items-baseline gap-2 px-3 py-2 text-sm hover:bg-muted",
|
|
20
20
|
children: [
|
|
21
21
|
/* @__PURE__ */ s("span", {
|
|
22
22
|
className: "shrink-0 font-medium",
|
|
23
|
-
children:
|
|
23
|
+
children: i.name
|
|
24
24
|
}),
|
|
25
25
|
/* @__PURE__ */ s("span", {
|
|
26
26
|
className: "shrink-0 text-xs text-muted-foreground",
|
|
27
|
-
children: l(`kind.${
|
|
27
|
+
children: l(`kind.${i.kind}`)
|
|
28
28
|
}),
|
|
29
|
-
|
|
29
|
+
i.definition !== i.name && /* @__PURE__ */ s("span", {
|
|
30
30
|
className: "min-w-0 truncate text-muted-foreground",
|
|
31
|
-
children:
|
|
31
|
+
children: i.definition
|
|
32
32
|
}),
|
|
33
|
-
|
|
33
|
+
i.status === "added" && /* @__PURE__ */ s("span", {
|
|
34
34
|
className: "ml-auto shrink-0",
|
|
35
|
-
children: /* @__PURE__ */ s(
|
|
35
|
+
children: /* @__PURE__ */ s(r, { status: i.status })
|
|
36
36
|
}),
|
|
37
37
|
a && /* @__PURE__ */ s("span", {
|
|
38
38
|
className: "ml-auto shrink-0 text-[11px] font-medium text-primary",
|
|
@@ -42,18 +42,18 @@ function u({ workspace: t, entry: r, isNew: a }) {
|
|
|
42
42
|
}) });
|
|
43
43
|
}
|
|
44
44
|
var d = (e) => e.replace(/[*_`#>[\]]/g, "").replace(/\s+/g, " ").trim();
|
|
45
|
-
function f({ workspace: e, decision:
|
|
46
|
-
let f = o("areaPage"), [p, m] = a(!1), h = [
|
|
45
|
+
function f({ workspace: e, decision: t, isNew: r, notInDocs: u }) {
|
|
46
|
+
let f = o("areaPage"), [p, m] = a(!1), h = [t.options.find((e) => e.id === t.answer?.optionId)?.label, t.answer?.text && d(t.answer.text)].filter(Boolean).join(". ");
|
|
47
47
|
return /* @__PURE__ */ c("li", { children: [/* @__PURE__ */ c("button", {
|
|
48
48
|
type: "button",
|
|
49
49
|
"aria-expanded": p,
|
|
50
50
|
onClick: () => m((e) => !e),
|
|
51
51
|
className: "flex w-full min-w-0 items-baseline gap-2 px-3 py-2 text-left text-sm hover:bg-muted",
|
|
52
52
|
children: [
|
|
53
|
-
/* @__PURE__ */ s(
|
|
53
|
+
/* @__PURE__ */ s(i, { className: l("size-3 shrink-0 self-center text-muted-foreground", p && "rotate-90") }),
|
|
54
54
|
/* @__PURE__ */ s("span", {
|
|
55
55
|
className: "min-w-0 truncate text-muted-foreground",
|
|
56
|
-
children: d(
|
|
56
|
+
children: d(t.prompt)
|
|
57
57
|
}),
|
|
58
58
|
/* @__PURE__ */ s("span", {
|
|
59
59
|
className: "min-w-0 shrink-0 truncate font-medium max-sm:hidden",
|
|
@@ -64,7 +64,7 @@ function f({ workspace: e, decision: n, isNew: i, notInDocs: u }) {
|
|
|
64
64
|
children: [u && /* @__PURE__ */ s("span", {
|
|
65
65
|
className: "rounded border border-border px-1.5 text-[11px] text-muted-foreground",
|
|
66
66
|
children: f("notInDocs")
|
|
67
|
-
}),
|
|
67
|
+
}), r && /* @__PURE__ */ s("span", {
|
|
68
68
|
className: "text-[11px] font-medium text-primary",
|
|
69
69
|
children: f("new")
|
|
70
70
|
})]
|
|
@@ -72,9 +72,9 @@ function f({ workspace: e, decision: n, isNew: i, notInDocs: u }) {
|
|
|
72
72
|
]
|
|
73
73
|
}), p && /* @__PURE__ */ s("div", {
|
|
74
74
|
className: "px-3 pb-3",
|
|
75
|
-
children: /* @__PURE__ */ s(
|
|
75
|
+
children: /* @__PURE__ */ s(n, {
|
|
76
76
|
workspace: e,
|
|
77
|
-
decision:
|
|
77
|
+
decision: t,
|
|
78
78
|
showIssue: !0
|
|
79
79
|
})
|
|
80
80
|
})] });
|
|
@@ -1,61 +1,65 @@
|
|
|
1
|
-
import { attachmentsQuery as e, meQuery as t } from "../api/queries.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { ErrorText as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
1
|
+
import { attachmentsQuery as e, meQuery as t, workspaceQuery as n } from "../api/queries.js";
|
|
2
|
+
import { attachmentSizes as r, attachmentURL as i, insertAttachments as a, uploadAttachment as o } from "../lib/attachments.js";
|
|
3
|
+
import { openImageEvent as s } from "./editorPlugins.js";
|
|
4
|
+
import { AttachmentIcon as c, CloseIcon as l, DownloadIcon as u } from "./icons.js";
|
|
5
|
+
import { ErrorText as d, IconButton as f, Modal as p, ModalTitle as m, buttonClasses as h } from "@parallelworks/ui";
|
|
6
|
+
import { useParams as g } from "@tanstack/react-router";
|
|
7
|
+
import { useEffect as _, useRef as v, useState as y } from "react";
|
|
8
|
+
import { useErrorMessage as b } from "@parallelworks/problem/react";
|
|
9
|
+
import { useFormatter as x, useTranslations as S } from "use-intl";
|
|
10
|
+
import { ApiError as C } from "@parallelworks/problem";
|
|
11
|
+
import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
12
|
+
import { useQuery as D, useQueryClient as O } from "@tanstack/react-query";
|
|
12
13
|
// src/components/Attachments.tsx
|
|
13
|
-
function
|
|
14
|
-
let {
|
|
15
|
-
|
|
14
|
+
function k() {
|
|
15
|
+
let { workspace: e = "" } = g({ strict: !1 }), { data: r } = D(t), { data: i } = D({
|
|
16
|
+
...n(e),
|
|
17
|
+
enabled: e !== ""
|
|
18
|
+
});
|
|
19
|
+
return r?.attachments !== !1 && i?.attachments !== !1;
|
|
16
20
|
}
|
|
17
|
-
function
|
|
18
|
-
let r =
|
|
19
|
-
return
|
|
21
|
+
function A(t, n) {
|
|
22
|
+
let r = O();
|
|
23
|
+
return j((e) => o(t, n, e), () => r.invalidateQueries({ queryKey: e(t, n).queryKey }));
|
|
20
24
|
}
|
|
21
|
-
function
|
|
22
|
-
let n =
|
|
25
|
+
function j(e, t) {
|
|
26
|
+
let n = S("issue.attachments"), r = b(), [i, o] = y(0), [s, c] = y(null), l = k();
|
|
23
27
|
return {
|
|
24
|
-
upload: async (i,
|
|
25
|
-
if (!i ||
|
|
28
|
+
upload: async (i, s, u) => {
|
|
29
|
+
if (!i || s.length === 0) return;
|
|
26
30
|
if (!l) {
|
|
27
|
-
c(n("off", { name:
|
|
31
|
+
c(n("off", { name: s[0]?.name ?? "" }));
|
|
28
32
|
return;
|
|
29
33
|
}
|
|
30
|
-
c(null),
|
|
34
|
+
c(null), o((e) => e + s.length);
|
|
31
35
|
let d = [];
|
|
32
|
-
for (let t of
|
|
36
|
+
for (let t of s) try {
|
|
33
37
|
d.push(await e(t));
|
|
34
38
|
} catch (e) {
|
|
35
|
-
let i = e instanceof
|
|
39
|
+
let i = e instanceof C ? e.status : 0;
|
|
36
40
|
c(i === 413 ? n("tooLarge", { name: t.name }) : n("failed", {
|
|
37
41
|
name: t.name,
|
|
38
42
|
reason: r(e)
|
|
39
43
|
}));
|
|
40
44
|
} finally {
|
|
41
|
-
|
|
45
|
+
o((e) => e - 1);
|
|
42
46
|
}
|
|
43
|
-
d.length > 0 && !i.isDestroyed &&
|
|
47
|
+
d.length > 0 && !i.isDestroyed && a(i, d, u), t?.();
|
|
44
48
|
},
|
|
45
49
|
pending: i,
|
|
46
|
-
error:
|
|
50
|
+
error: s
|
|
47
51
|
};
|
|
48
52
|
}
|
|
49
|
-
function
|
|
50
|
-
let t =
|
|
51
|
-
return
|
|
52
|
-
icon: /* @__PURE__ */
|
|
53
|
+
function M({ onFiles: e }) {
|
|
54
|
+
let t = S("issue.attachments"), n = v(null);
|
|
55
|
+
return k() ? /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(f, {
|
|
56
|
+
icon: /* @__PURE__ */ T(c, {}),
|
|
53
57
|
label: t("attach"),
|
|
54
58
|
variant: "ghost",
|
|
55
59
|
size: "sm",
|
|
56
|
-
onClick: () =>
|
|
57
|
-
}), /* @__PURE__ */
|
|
58
|
-
ref:
|
|
60
|
+
onClick: () => n.current?.click()
|
|
61
|
+
}), /* @__PURE__ */ T("input", {
|
|
62
|
+
ref: n,
|
|
59
63
|
type: "file",
|
|
60
64
|
multiple: !0,
|
|
61
65
|
hidden: !0,
|
|
@@ -64,19 +68,19 @@ function A({ onFiles: e }) {
|
|
|
64
68
|
}
|
|
65
69
|
})] }) : null;
|
|
66
70
|
}
|
|
67
|
-
function
|
|
68
|
-
let n =
|
|
69
|
-
return e > 0 ? /* @__PURE__ */
|
|
71
|
+
function N({ pending: e, error: t }) {
|
|
72
|
+
let n = S("issue.attachments");
|
|
73
|
+
return e > 0 ? /* @__PURE__ */ T("span", {
|
|
70
74
|
className: "text-xs text-muted-foreground",
|
|
71
75
|
role: "status",
|
|
72
76
|
children: n("uploading", { count: e })
|
|
73
|
-
}) : /* @__PURE__ */
|
|
77
|
+
}) : /* @__PURE__ */ T(d, {
|
|
74
78
|
inline: !0,
|
|
75
79
|
children: t
|
|
76
80
|
});
|
|
77
81
|
}
|
|
78
|
-
function
|
|
79
|
-
let e =
|
|
82
|
+
function P() {
|
|
83
|
+
let e = x();
|
|
80
84
|
return (t) => t < 1 << 20 ? e.number(Math.max(1, Math.round(t / 1024)), {
|
|
81
85
|
style: "unit",
|
|
82
86
|
unit: "kilobyte",
|
|
@@ -88,49 +92,49 @@ function M() {
|
|
|
88
92
|
maximumFractionDigits: 1
|
|
89
93
|
});
|
|
90
94
|
}
|
|
91
|
-
function
|
|
92
|
-
let
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}, [
|
|
96
|
-
let e = (e) =>
|
|
97
|
-
return document.addEventListener(
|
|
95
|
+
function F({ workspace: t, identifier: n }) {
|
|
96
|
+
let a = S("issue.attachments"), o = S("common"), c = P(), { data: d } = D(e(t, n)), [g, v] = y(null);
|
|
97
|
+
_(() => {
|
|
98
|
+
r.set(new Map((d ?? []).map((e) => [e.id, c(e.size)])), new Set((d ?? []).filter((e) => e.video).map((e) => e.id)));
|
|
99
|
+
}, [d]), _(() => () => r.set(/* @__PURE__ */ new Map()), []), _(() => {
|
|
100
|
+
let e = (e) => v(e.detail);
|
|
101
|
+
return document.addEventListener(s, e), () => document.removeEventListener(s, e);
|
|
98
102
|
}, []);
|
|
99
|
-
let
|
|
100
|
-
return /* @__PURE__ */
|
|
101
|
-
open:
|
|
102
|
-
onClose: () =>
|
|
103
|
+
let b = g ? i(g.src) : "";
|
|
104
|
+
return /* @__PURE__ */ E(p, {
|
|
105
|
+
open: g !== null,
|
|
106
|
+
onClose: () => v(null),
|
|
103
107
|
align: "center",
|
|
104
108
|
className: "flex max-h-[90vh] w-[min(92vw,1200px)] flex-col overflow-hidden",
|
|
105
|
-
children: [/* @__PURE__ */
|
|
109
|
+
children: [/* @__PURE__ */ E("div", {
|
|
106
110
|
className: "flex h-12 shrink-0 items-center gap-2 border-b border-border px-4",
|
|
107
111
|
children: [
|
|
108
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ T(m, {
|
|
109
113
|
className: "min-w-0 flex-1 truncate text-sm font-medium",
|
|
110
|
-
children:
|
|
114
|
+
children: g?.name || a("image")
|
|
111
115
|
}),
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
href:
|
|
114
|
-
download:
|
|
115
|
-
className:
|
|
116
|
-
children: [/* @__PURE__ */
|
|
116
|
+
/* @__PURE__ */ E("a", {
|
|
117
|
+
href: b,
|
|
118
|
+
download: g?.name ?? "",
|
|
119
|
+
className: h({ size: "sm" }),
|
|
120
|
+
children: [/* @__PURE__ */ T(u, { className: "size-3.5" }), a("download")]
|
|
117
121
|
}),
|
|
118
|
-
/* @__PURE__ */
|
|
119
|
-
icon: /* @__PURE__ */
|
|
120
|
-
label:
|
|
122
|
+
/* @__PURE__ */ T(f, {
|
|
123
|
+
icon: /* @__PURE__ */ T(l, {}),
|
|
124
|
+
label: o("close"),
|
|
121
125
|
variant: "ghost",
|
|
122
126
|
size: "sm",
|
|
123
|
-
onClick: () =>
|
|
127
|
+
onClick: () => v(null)
|
|
124
128
|
})
|
|
125
129
|
]
|
|
126
|
-
}), /* @__PURE__ */
|
|
130
|
+
}), /* @__PURE__ */ T("div", {
|
|
127
131
|
className: "flex min-h-0 flex-1 items-center justify-center overflow-auto bg-muted p-4",
|
|
128
|
-
children:
|
|
129
|
-
src:
|
|
130
|
-
alt:
|
|
132
|
+
children: g && /* @__PURE__ */ T("img", {
|
|
133
|
+
src: b,
|
|
134
|
+
alt: g.name || a("image"),
|
|
131
135
|
className: "max-h-[calc(90vh-5rem)] max-w-full object-contain"
|
|
132
136
|
})
|
|
133
137
|
})]
|
|
134
138
|
});
|
|
135
139
|
}
|
|
136
|
-
export {
|
|
140
|
+
export { M as AttachButton, F as IssueAttachments, N as UploadStatus, A as useAttachmentUpload, k as useAttachmentsOn, j as useFileUpload };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { headingAnchor as e } from "../lib/glossary.js";
|
|
2
|
+
import { copyItem as t } from "../lib/menus.js";
|
|
3
3
|
import { commands as n } from "./SlashMenu.js";
|
|
4
4
|
import { menuDivider as r, useOpenMenu as i } from "@parallelworks/ui";
|
|
5
5
|
import { useState as a } from "react";
|
|
@@ -76,7 +76,7 @@ function m({ editor: m }) {
|
|
|
76
76
|
label: h("duplicate"),
|
|
77
77
|
onClick: () => m.chain().focus().insertContentAt(_.pos + _.node.nodeSize, _.node.toJSON()).run()
|
|
78
78
|
},
|
|
79
|
-
..._.node.type.name === "heading" ? [
|
|
79
|
+
..._.node.type.name === "heading" ? [t(h("copyLink"), `${window.location.href.split("#")[0]}#${e(_.node.textContent)}`)] : [],
|
|
80
80
|
r,
|
|
81
81
|
{
|
|
82
82
|
label: h("delete"),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { api as e, unwrap as t } from "../api/client.js";
|
|
2
2
|
import { labelsQuery as n, teamMembersQuery as r, teamRotationQuery as i } from "../api/queries.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { usePeople as a } from "../lib/people.js";
|
|
4
|
+
import { useTime as o } from "../lib/time.js";
|
|
5
|
+
import { AddIcon as s, ChevronDownIcon as c, CloseIcon as l } from "./icons.js";
|
|
6
6
|
import { PersonHoverCard as u } from "./PersonHoverCard.js";
|
|
7
7
|
import { Avatar as d, Button as f, Card as p, Combobox as m, IconButton as h, Select as g, SettingRow as _, SettingsCard as v, StatusBadge as y, Switch as b } from "@parallelworks/ui";
|
|
8
8
|
import { useErrorMessage as x } from "@parallelworks/problem/react";
|
|
@@ -11,7 +11,7 @@ import { jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
|
11
11
|
import { useMutation as T, useQueryClient as E, useSuspenseQuery as D } from "@tanstack/react-query";
|
|
12
12
|
// src/components/BugRotation.tsx
|
|
13
13
|
function O({ workspace: O, teamKey: k, isAdmin: A }) {
|
|
14
|
-
let j = S("rotation"), M = x(), N =
|
|
14
|
+
let j = S("rotation"), M = x(), N = o(), P = E(), F = i(O, k), { data: I } = D(F), { data: L } = D(n(O)), { data: R } = D(r(O, k)), { person: z } = a(O), B = { params: { path: {
|
|
15
15
|
workspace: O,
|
|
16
16
|
key: k
|
|
17
17
|
} } }, V = T({
|
|
@@ -139,7 +139,7 @@ function O({ workspace: O, teamKey: k, isAdmin: A }) {
|
|
|
139
139
|
size: "sm",
|
|
140
140
|
disabled: V.isPending,
|
|
141
141
|
children: [
|
|
142
|
-
/* @__PURE__ */ C(
|
|
142
|
+
/* @__PURE__ */ C(s, { className: "size-3.5" }),
|
|
143
143
|
" ",
|
|
144
144
|
j("add")
|
|
145
145
|
]
|
|
@@ -186,7 +186,7 @@ function O({ workspace: O, teamKey: k, isAdmin: A }) {
|
|
|
186
186
|
variant: "ghost",
|
|
187
187
|
size: "xs",
|
|
188
188
|
label: j("moveUp", { name: z(e).name }),
|
|
189
|
-
icon: /* @__PURE__ */ C(
|
|
189
|
+
icon: /* @__PURE__ */ C(c, { className: "rotate-180" }),
|
|
190
190
|
disabled: V.isPending || t === 0,
|
|
191
191
|
onClick: () => q(t, -1)
|
|
192
192
|
}),
|
|
@@ -194,7 +194,7 @@ function O({ workspace: O, teamKey: k, isAdmin: A }) {
|
|
|
194
194
|
variant: "ghost",
|
|
195
195
|
size: "xs",
|
|
196
196
|
label: j("moveDown", { name: z(e).name }),
|
|
197
|
-
icon: /* @__PURE__ */ C(
|
|
197
|
+
icon: /* @__PURE__ */ C(c, {}),
|
|
198
198
|
disabled: V.isPending || t === G.length - 1,
|
|
199
199
|
onClick: () => q(t, 1)
|
|
200
200
|
}),
|
|
@@ -202,7 +202,7 @@ function O({ workspace: O, teamKey: k, isAdmin: A }) {
|
|
|
202
202
|
variant: "ghost",
|
|
203
203
|
size: "xs",
|
|
204
204
|
label: j("remove", { name: z(e).name }),
|
|
205
|
-
icon: /* @__PURE__ */ C(
|
|
205
|
+
icon: /* @__PURE__ */ C(l, {}),
|
|
206
206
|
disabled: V.isPending,
|
|
207
207
|
onClick: () => V.mutate({ members: G.filter((t) => t !== e) })
|
|
208
208
|
})
|