@burdenoff/microfe-planmagnet 2026.930.23 → 2026.930.25
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/dist/index.js +6 -5
- package/dist/planmagnet/PlanMagnetRoot.d.ts.map +1 -1
- package/dist/planmagnet/PlanMagnetRoot.js +154 -147
- package/dist/planmagnet/PlanMagnetRoot.js.map +1 -1
- package/dist/planmagnet/PlanMagnetRoutes.d.ts.map +1 -1
- package/dist/planmagnet/PlanMagnetRoutes.js +66 -62
- package/dist/planmagnet/PlanMagnetRoutes.js.map +1 -1
- package/dist/planmagnet/comments/CommentThread.d.ts +8 -1
- package/dist/planmagnet/comments/CommentThread.d.ts.map +1 -1
- package/dist/planmagnet/comments/CommentThread.js +188 -181
- package/dist/planmagnet/comments/CommentThread.js.map +1 -1
- package/dist/planmagnet/comments/TargetComments.d.ts +10 -2
- package/dist/planmagnet/comments/TargetComments.d.ts.map +1 -1
- package/dist/planmagnet/comments/TargetComments.js +10 -8
- package/dist/planmagnet/comments/TargetComments.js.map +1 -1
- package/dist/planmagnet/comments/WorkItemComments.d.ts +7 -1
- package/dist/planmagnet/comments/WorkItemComments.d.ts.map +1 -1
- package/dist/planmagnet/comments/WorkItemComments.js +5 -4
- package/dist/planmagnet/comments/WorkItemComments.js.map +1 -1
- package/dist/planmagnet/controls/FeatureControls.d.ts +11 -0
- package/dist/planmagnet/controls/FeatureControls.d.ts.map +1 -1
- package/dist/planmagnet/controls/FeatureControls.js +305 -135
- package/dist/planmagnet/controls/FeatureControls.js.map +1 -1
- package/dist/planmagnet/controls/Pickers.d.ts +18 -0
- package/dist/planmagnet/controls/Pickers.d.ts.map +1 -1
- package/dist/planmagnet/controls/Pickers.js +78 -1
- package/dist/planmagnet/controls/Pickers.js.map +1 -1
- package/dist/planmagnet/controls/PrioritizationControls.d.ts +72 -0
- package/dist/planmagnet/controls/PrioritizationControls.d.ts.map +1 -0
- package/dist/planmagnet/controls/PrioritizationControls.js +246 -0
- package/dist/planmagnet/controls/PrioritizationControls.js.map +1 -0
- package/dist/planmagnet/discussion/WorkItemDiscussionPanel.d.ts +8 -0
- package/dist/planmagnet/discussion/WorkItemDiscussionPanel.d.ts.map +1 -0
- package/dist/planmagnet/discussion/WorkItemDiscussionPanel.js +217 -0
- package/dist/planmagnet/discussion/WorkItemDiscussionPanel.js.map +1 -0
- package/dist/planmagnet/docs/DocDiffView.d.ts +26 -0
- package/dist/planmagnet/docs/DocDiffView.d.ts.map +1 -0
- package/dist/planmagnet/docs/DocDiffView.js +52 -0
- package/dist/planmagnet/docs/DocDiffView.js.map +1 -0
- package/dist/planmagnet/docs/DocSuggestionsPanel.d.ts +13 -0
- package/dist/planmagnet/docs/DocSuggestionsPanel.d.ts.map +1 -0
- package/dist/planmagnet/docs/DocSuggestionsPanel.js +308 -0
- package/dist/planmagnet/docs/DocSuggestionsPanel.js.map +1 -0
- package/dist/planmagnet/docs/DocVersionCompare.d.ts +7 -0
- package/dist/planmagnet/docs/DocVersionCompare.d.ts.map +1 -0
- package/dist/planmagnet/docs/DocVersionCompare.js +105 -0
- package/dist/planmagnet/docs/DocVersionCompare.js.map +1 -0
- package/dist/planmagnet/hooks/usePresence.d.ts +39 -0
- package/dist/planmagnet/hooks/usePresence.d.ts.map +1 -0
- package/dist/planmagnet/hooks/usePresence.js +146 -0
- package/dist/planmagnet/hooks/usePresence.js.map +1 -0
- package/dist/planmagnet/index.d.ts +1 -0
- package/dist/planmagnet/index.d.ts.map +1 -1
- package/dist/planmagnet/index.js +1 -0
- package/dist/planmagnet/links/CodeLinksPanel.d.ts +22 -0
- package/dist/planmagnet/links/CodeLinksPanel.d.ts.map +1 -0
- package/dist/planmagnet/links/CodeLinksPanel.js +94 -0
- package/dist/planmagnet/links/CodeLinksPanel.js.map +1 -0
- package/dist/planmagnet/pages/DocsDocDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/DocsDocDetailPagePage.js +488 -217
- package/dist/planmagnet/pages/DocsDocDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsFeatureDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsFeatureDetailPagePage.js +131 -125
- package/dist/planmagnet/pages/ProductsFeatureDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsFeaturesPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsFeaturesPagePage.js +183 -99
- package/dist/planmagnet/pages/ProductsFeaturesPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsNewFeaturePagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsNewFeaturePagePage.js +113 -97
- package/dist/planmagnet/pages/ProductsNewFeaturePagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsPrioritizationPagePage.d.ts +2 -0
- package/dist/planmagnet/pages/ProductsPrioritizationPagePage.d.ts.map +1 -0
- package/dist/planmagnet/pages/ProductsPrioritizationPagePage.js +363 -0
- package/dist/planmagnet/pages/ProductsPrioritizationPagePage.js.map +1 -0
- package/dist/planmagnet/pages/ProductsProductDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsProductDetailPagePage.js +96 -79
- package/dist/planmagnet/pages/ProductsProductDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.js +144 -128
- package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.js +205 -196
- package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/TasksTaskDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/TasksTaskDetailPagePage.js +194 -160
- package/dist/planmagnet/pages/TasksTaskDetailPagePage.js.map +1 -1
- package/dist/planmagnet/presence/PresenceAvatars.d.ts +16 -0
- package/dist/planmagnet/presence/PresenceAvatars.d.ts.map +1 -0
- package/dist/planmagnet/presence/PresenceAvatars.js +56 -0
- package/dist/planmagnet/presence/PresenceAvatars.js.map +1 -0
- package/dist/planmagnet/product/ProductControls.d.ts +33 -0
- package/dist/planmagnet/product/ProductControls.d.ts.map +1 -1
- package/dist/planmagnet/product/ProductControls.js +593 -268
- package/dist/planmagnet/product/ProductControls.js.map +1 -1
- package/dist/planmagnet/product/routes.d.ts +10 -0
- package/dist/planmagnet/product/routes.d.ts.map +1 -0
- package/dist/planmagnet/product/routes.js +6 -0
- package/dist/planmagnet/product/routes.js.map +1 -0
- package/dist/planmagnet/roadmaps/RoadmapControls.d.ts +10 -0
- package/dist/planmagnet/roadmaps/RoadmapControls.d.ts.map +1 -1
- package/dist/planmagnet/roadmaps/RoadmapControls.js +235 -184
- package/dist/planmagnet/roadmaps/RoadmapControls.js.map +1 -1
- package/dist/planmagnet/utils/graphqlErrors.d.ts +6 -0
- package/dist/planmagnet/utils/graphqlErrors.d.ts.map +1 -1
- package/dist/planmagnet/utils/graphqlErrors.js +5 -2
- package/dist/planmagnet/utils/graphqlErrors.js.map +1 -1
- package/dist/planmagnet/utils/lineDiff.d.ts +21 -0
- package/dist/planmagnet/utils/lineDiff.d.ts.map +1 -0
- package/dist/planmagnet/utils/lineDiff.js +36 -0
- package/dist/planmagnet/utils/lineDiff.js.map +1 -0
- package/package.json +1 -1
|
@@ -4,46 +4,47 @@ import { throwOnError as r } from "../utils/mutationResult.js";
|
|
|
4
4
|
import { ConfirmButton as i, ErrorLine as a } from "../controls/ConfirmButton.js";
|
|
5
5
|
import { isForbidden as o, mutationErrorMessage as s } from "../utils/graphqlErrors.js";
|
|
6
6
|
import { MentionComposer as c, MentionText as l } from "./MentionComposer.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
7
|
+
import { TypingLine as u } from "../presence/PresenceAvatars.js";
|
|
8
|
+
import { useEffect as d, useState as f } from "react";
|
|
9
|
+
import { CheckCircle2 as p, ChevronDown as m, ChevronRight as h, Reply as g, RotateCcw as _, Trash2 as v } from "lucide-react";
|
|
10
|
+
import { useMutation as y, useQuery as b } from "@apollo/client/react";
|
|
11
|
+
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
12
|
+
import { Button as w } from "@burdenoff/fe-libs/ui";
|
|
12
13
|
//#region src/planmagnet/comments/CommentThread.tsx
|
|
13
|
-
var
|
|
14
|
-
function
|
|
15
|
-
let { currentUser:
|
|
16
|
-
refetchQueries:
|
|
14
|
+
var T = 30, E = 1e4, D = (e) => new Date(e).toLocaleString();
|
|
15
|
+
function O({ targetNoun: t, idPrefix: n, query: i, add: l, edit: p, remove: m, resolve: h, refetchQueries: g, onTotalCount: _, presence: v }) {
|
|
16
|
+
let { currentUser: x, workspaceId: D, authToken: O, apiGatewayUrl: A } = e(), [j, M] = f(""), [N, P] = f(null), [F, I] = f(!1), [L, R] = f("ALL"), z = {
|
|
17
|
+
refetchQueries: g,
|
|
17
18
|
awaitRefetchQueries: !0
|
|
18
|
-
}, { data:
|
|
19
|
+
}, { data: B, loading: V, error: H, fetchMore: U } = b(i.document, {
|
|
19
20
|
variables: {
|
|
20
21
|
...i.variables,
|
|
21
|
-
pagination: { first:
|
|
22
|
+
pagination: { first: T }
|
|
22
23
|
},
|
|
23
24
|
skip: i.skip
|
|
24
|
-
}), [
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}, [
|
|
28
|
-
let
|
|
29
|
-
|
|
25
|
+
}), [ee, W] = y(l.document, z), G = B?.[i.dataKey], K = G?.items ?? [], q = L === "ALL" ? K : K.filter((e) => e.status === L), J = K.filter((e) => e.status === "OPEN").length, Y = K.length - J, X = j.trim(), Z = X.length > E;
|
|
26
|
+
d(() => {
|
|
27
|
+
G && _?.(G.totalCount);
|
|
28
|
+
}, [G, _]);
|
|
29
|
+
let te = async (e, t) => {
|
|
30
|
+
P(null);
|
|
30
31
|
try {
|
|
31
|
-
return await r(
|
|
32
|
+
return await r(ee({ variables: l.buildVariables(e, t) })), !0;
|
|
32
33
|
} catch (e) {
|
|
33
|
-
return
|
|
34
|
+
return P(o(e) ? "Your role can read but not comment." : s(e, "The comment could not be posted.")), !1;
|
|
34
35
|
}
|
|
35
|
-
},
|
|
36
|
-
await X
|
|
37
|
-
},
|
|
38
|
-
let e =
|
|
36
|
+
}, ne = async () => {
|
|
37
|
+
await te(X, null) && M("");
|
|
38
|
+
}, re = async () => {
|
|
39
|
+
let e = G?.pageInfo.endCursor;
|
|
39
40
|
if (e) {
|
|
40
|
-
|
|
41
|
+
I(!0);
|
|
41
42
|
try {
|
|
42
|
-
await
|
|
43
|
+
await U({
|
|
43
44
|
variables: {
|
|
44
45
|
...i.variables,
|
|
45
46
|
pagination: {
|
|
46
|
-
first:
|
|
47
|
+
first: T,
|
|
47
48
|
after: e
|
|
48
49
|
}
|
|
49
50
|
},
|
|
@@ -53,96 +54,100 @@ function D({ targetNoun: t, idPrefix: n, query: i, add: l, edit: f, remove: p, r
|
|
|
53
54
|
} })
|
|
54
55
|
});
|
|
55
56
|
} finally {
|
|
56
|
-
|
|
57
|
+
I(!1);
|
|
57
58
|
}
|
|
58
59
|
}
|
|
59
60
|
};
|
|
60
|
-
return /* @__PURE__ */
|
|
61
|
+
return /* @__PURE__ */ C("div", {
|
|
61
62
|
className: "space-y-4",
|
|
62
63
|
"data-testid": "comment-thread",
|
|
63
64
|
children: [
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
N && /* @__PURE__ */ S(a, { message: N }),
|
|
66
|
+
V && !B && /* @__PURE__ */ S("p", {
|
|
66
67
|
className: "text-sm text-muted-foreground",
|
|
67
68
|
children: "Loading comments…"
|
|
68
69
|
}),
|
|
69
|
-
|
|
70
|
-
|
|
70
|
+
H && /* @__PURE__ */ S(a, { message: `Comments could not be loaded: ${H.message}` }),
|
|
71
|
+
G && K.length > 0 && /* @__PURE__ */ S("div", {
|
|
71
72
|
role: "group",
|
|
72
73
|
"aria-label": "Filter comments by resolution",
|
|
73
74
|
"data-testid": "comment-filter",
|
|
74
75
|
className: "flex flex-wrap gap-1",
|
|
75
76
|
children: [
|
|
76
|
-
["OPEN", `Open (${
|
|
77
|
-
["RESOLVED", `Resolved (${
|
|
78
|
-
["ALL", `All (${
|
|
79
|
-
].map(([e, t]) => /* @__PURE__ */
|
|
77
|
+
["OPEN", `Open (${J})`],
|
|
78
|
+
["RESOLVED", `Resolved (${Y})`],
|
|
79
|
+
["ALL", `All (${K.length})`]
|
|
80
|
+
].map(([e, t]) => /* @__PURE__ */ S(w, {
|
|
80
81
|
type: "button",
|
|
81
82
|
size: "sm",
|
|
82
|
-
variant:
|
|
83
|
-
"aria-pressed":
|
|
83
|
+
variant: L === e ? "default" : "outline",
|
|
84
|
+
"aria-pressed": L === e,
|
|
84
85
|
className: "h-7 px-2.5 text-xs",
|
|
85
|
-
onClick: () =>
|
|
86
|
+
onClick: () => R(e),
|
|
86
87
|
children: t
|
|
87
88
|
}, e))
|
|
88
89
|
}),
|
|
89
|
-
|
|
90
|
+
G && q.length === 0 && /* @__PURE__ */ S("p", {
|
|
90
91
|
className: "text-sm text-muted-foreground",
|
|
91
|
-
children:
|
|
92
|
+
children: K.length === 0 ? "No comments yet." : "No comments match this filter."
|
|
92
93
|
}),
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ S("ol", {
|
|
94
95
|
className: "space-y-3",
|
|
95
|
-
children:
|
|
96
|
+
children: q.map((e) => /* @__PURE__ */ S(k, {
|
|
96
97
|
comment: e,
|
|
97
|
-
currentUserId:
|
|
98
|
-
editMutation:
|
|
99
|
-
removeMutation:
|
|
100
|
-
resolveMutation:
|
|
98
|
+
currentUserId: x?.id,
|
|
99
|
+
editMutation: p,
|
|
100
|
+
removeMutation: m,
|
|
101
|
+
resolveMutation: h,
|
|
101
102
|
addMutation: l.document,
|
|
102
103
|
buildReplyVariables: (t) => l.buildVariables(t, e.id),
|
|
103
|
-
mutationRefetch:
|
|
104
|
-
onError:
|
|
104
|
+
mutationRefetch: z,
|
|
105
|
+
onError: P,
|
|
105
106
|
idPrefix: n,
|
|
106
|
-
workspaceId:
|
|
107
|
-
authToken:
|
|
108
|
-
apiGatewayUrl:
|
|
107
|
+
workspaceId: D,
|
|
108
|
+
authToken: O,
|
|
109
|
+
apiGatewayUrl: A,
|
|
110
|
+
onTyping: v?.notifyTyping
|
|
109
111
|
}, e.id))
|
|
110
112
|
}),
|
|
111
|
-
|
|
113
|
+
G?.pageInfo.hasNextPage && /* @__PURE__ */ S(w, {
|
|
112
114
|
size: "sm",
|
|
113
115
|
variant: "outline",
|
|
114
|
-
onClick: () => void
|
|
115
|
-
disabled:
|
|
116
|
-
children:
|
|
116
|
+
onClick: () => void re(),
|
|
117
|
+
disabled: F,
|
|
118
|
+
children: F ? "Loading…" : `Show more (${K.length} of ${G.totalCount})`
|
|
117
119
|
}),
|
|
118
|
-
/* @__PURE__ */ S(
|
|
120
|
+
v && /* @__PURE__ */ S(u, { typingActorIds: v.typingActorIds }),
|
|
121
|
+
/* @__PURE__ */ C("div", {
|
|
119
122
|
className: "space-y-2 border-t border-border-default pt-4",
|
|
120
123
|
children: [
|
|
121
|
-
/* @__PURE__ */
|
|
124
|
+
/* @__PURE__ */ S("label", {
|
|
122
125
|
htmlFor: `${n}-add`,
|
|
123
126
|
className: "sr-only",
|
|
124
127
|
children: "Add a comment"
|
|
125
128
|
}),
|
|
126
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ S(c, {
|
|
127
130
|
id: `${n}-add`,
|
|
128
131
|
ariaLabel: `Add a comment on this ${t}`,
|
|
129
132
|
placeholder: "Add a comment…",
|
|
130
133
|
className: "min-h-[72px]",
|
|
131
|
-
value:
|
|
132
|
-
onChange:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
value: j,
|
|
135
|
+
onChange: (e) => {
|
|
136
|
+
M(e), v?.notifyTyping();
|
|
137
|
+
},
|
|
138
|
+
workspaceId: D,
|
|
139
|
+
authToken: O,
|
|
140
|
+
apiGatewayUrl: A
|
|
136
141
|
}),
|
|
137
|
-
|
|
138
|
-
/* @__PURE__ */
|
|
142
|
+
Z && /* @__PURE__ */ S(a, { message: `A comment can be at most ${E} characters.` }),
|
|
143
|
+
/* @__PURE__ */ S("div", {
|
|
139
144
|
className: "flex justify-end",
|
|
140
|
-
children: /* @__PURE__ */
|
|
145
|
+
children: /* @__PURE__ */ S(w, {
|
|
141
146
|
size: "sm",
|
|
142
|
-
onClick: () => void
|
|
143
|
-
disabled: !
|
|
147
|
+
onClick: () => void ne(),
|
|
148
|
+
disabled: !X || Z || W.loading,
|
|
144
149
|
"data-testid": "comment-post",
|
|
145
|
-
children:
|
|
150
|
+
children: W.loading ? "Posting…" : "Comment"
|
|
146
151
|
})
|
|
147
152
|
})
|
|
148
153
|
]
|
|
@@ -150,115 +155,115 @@ function D({ targetNoun: t, idPrefix: n, query: i, add: l, edit: f, remove: p, r
|
|
|
150
155
|
]
|
|
151
156
|
});
|
|
152
157
|
}
|
|
153
|
-
function
|
|
154
|
-
let [
|
|
158
|
+
function k({ comment: e, currentUserId: u, editMutation: d, removeMutation: b, resolveMutation: T, addMutation: O, buildReplyVariables: k, mutationRefetch: j, onError: M, idPrefix: N, workspaceId: P, authToken: F, apiGatewayUrl: I, onTyping: L }) {
|
|
159
|
+
let [R, z] = f(!1), [B, V] = f(e.body), [H, U] = f(e.status !== "RESOLVED"), [ee, W] = f(!1), [G, K] = f(""), [q, J] = f(null), Y = n(e.authorId), [X, Z] = y(d, j), [te, ne] = y(b, j), [re, ie] = y(T, j), [ae, oe] = y(O, j), se = e.authorId === u, Q = e.status === "RESOLVED", ce = B.trim().length > E, le = G.trim().length > E, ue = async () => {
|
|
155
160
|
M(null);
|
|
156
161
|
try {
|
|
157
|
-
await r(
|
|
162
|
+
await r(X({ variables: {
|
|
158
163
|
id: e.id,
|
|
159
|
-
body:
|
|
160
|
-
} })),
|
|
164
|
+
body: B.trim()
|
|
165
|
+
} })), z(!1);
|
|
161
166
|
} catch (e) {
|
|
162
167
|
M(s(e, "The comment could not be saved."));
|
|
163
168
|
}
|
|
164
|
-
},
|
|
169
|
+
}, de = async () => {
|
|
165
170
|
M(null);
|
|
166
171
|
try {
|
|
167
|
-
await r(
|
|
172
|
+
await r(te({ variables: { id: e.id } }));
|
|
168
173
|
} catch (e) {
|
|
169
174
|
M(s(e, "The comment could not be deleted."));
|
|
170
175
|
}
|
|
171
|
-
},
|
|
176
|
+
}, fe = async () => {
|
|
172
177
|
M(null);
|
|
173
178
|
try {
|
|
174
|
-
await r(
|
|
179
|
+
await r(re({ variables: {
|
|
175
180
|
id: e.id,
|
|
176
181
|
resolved: !Q
|
|
177
182
|
} }));
|
|
178
183
|
} catch (e) {
|
|
179
184
|
M(o(e) ? "Your role can read but not resolve comments." : s(e, "The resolution could not be changed."));
|
|
180
185
|
}
|
|
181
|
-
},
|
|
182
|
-
|
|
183
|
-
},
|
|
184
|
-
let e =
|
|
186
|
+
}, pe = (e, t, n) => {
|
|
187
|
+
J(e), K(t && n ? `@[${n}](${t}) ` : ""), W(!0), U(!0);
|
|
188
|
+
}, me = async () => {
|
|
189
|
+
let e = G.trim();
|
|
185
190
|
if (e) {
|
|
186
191
|
M(null);
|
|
187
192
|
try {
|
|
188
|
-
await r(
|
|
193
|
+
await r(ae({ variables: k(e) })), K(""), W(!1), J(null);
|
|
189
194
|
} catch (e) {
|
|
190
195
|
M(o(e) ? "Your role can read but not comment." : s(e, "The reply could not be posted."));
|
|
191
196
|
}
|
|
192
197
|
}
|
|
193
198
|
}, $ = `${N}-comment-${e.id}`;
|
|
194
|
-
return /* @__PURE__ */
|
|
199
|
+
return /* @__PURE__ */ S("li", {
|
|
195
200
|
className: "rounded-md border border-border-default p-3 space-y-2",
|
|
196
201
|
"data-testid": "comment-thread-item",
|
|
197
|
-
children: Q && !
|
|
202
|
+
children: Q && !H ? /* @__PURE__ */ C("div", {
|
|
198
203
|
className: "flex items-center justify-between gap-2",
|
|
199
|
-
children: [/* @__PURE__ */
|
|
204
|
+
children: [/* @__PURE__ */ C("p", {
|
|
200
205
|
className: "min-w-0 truncate text-sm text-muted-foreground",
|
|
201
206
|
children: [
|
|
202
|
-
/* @__PURE__ */
|
|
207
|
+
/* @__PURE__ */ S(p, {
|
|
203
208
|
className: "mr-1 inline h-3.5 w-3.5 text-status-success-text",
|
|
204
209
|
"aria-hidden": "true"
|
|
205
210
|
}),
|
|
206
211
|
"Resolved by ",
|
|
207
|
-
/* @__PURE__ */
|
|
208
|
-
e.resolvedAt ? ` · ${
|
|
212
|
+
/* @__PURE__ */ S(t, { id: e.resolvedBy }),
|
|
213
|
+
e.resolvedAt ? ` · ${D(e.resolvedAt)}` : "",
|
|
209
214
|
e.replies.length > 0 ? ` · ${e.replies.length} repl${e.replies.length === 1 ? "y" : "ies"}` : ""
|
|
210
215
|
]
|
|
211
|
-
}), /* @__PURE__ */
|
|
216
|
+
}), /* @__PURE__ */ C(w, {
|
|
212
217
|
size: "sm",
|
|
213
218
|
variant: "ghost",
|
|
214
219
|
className: "h-6 shrink-0 px-2 text-xs",
|
|
215
220
|
"aria-expanded": !1,
|
|
216
221
|
"aria-controls": $,
|
|
217
|
-
onClick: () =>
|
|
218
|
-
children: [/* @__PURE__ */
|
|
222
|
+
onClick: () => U(!0),
|
|
223
|
+
children: [/* @__PURE__ */ S(h, {
|
|
219
224
|
className: "mr-1 h-3.5 w-3.5",
|
|
220
225
|
"aria-hidden": "true"
|
|
221
226
|
}), "Expand"]
|
|
222
227
|
})]
|
|
223
|
-
}) : /* @__PURE__ */
|
|
228
|
+
}) : /* @__PURE__ */ C("div", {
|
|
224
229
|
id: $,
|
|
225
230
|
className: "space-y-2",
|
|
226
231
|
children: [
|
|
227
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ C("div", {
|
|
228
233
|
className: "flex items-start justify-between gap-2 text-xs text-muted-foreground",
|
|
229
|
-
children: [/* @__PURE__ */
|
|
230
|
-
/* @__PURE__ */
|
|
234
|
+
children: [/* @__PURE__ */ C("span", { children: [
|
|
235
|
+
/* @__PURE__ */ S("span", {
|
|
231
236
|
className: "font-medium text-foreground",
|
|
232
|
-
children: /* @__PURE__ */
|
|
237
|
+
children: /* @__PURE__ */ S(t, { id: e.authorId })
|
|
233
238
|
}),
|
|
234
239
|
" ",
|
|
235
240
|
"· ",
|
|
236
|
-
|
|
237
|
-
e.editedAt && /* @__PURE__ */
|
|
238
|
-
title: `Edited ${
|
|
241
|
+
D(e.createdAt),
|
|
242
|
+
e.editedAt && /* @__PURE__ */ S("span", {
|
|
243
|
+
title: `Edited ${D(e.editedAt)}`,
|
|
239
244
|
children: " · edited"
|
|
240
245
|
}),
|
|
241
|
-
Q && /* @__PURE__ */
|
|
246
|
+
Q && /* @__PURE__ */ C("span", {
|
|
242
247
|
className: "ml-1 inline-flex items-center gap-1 text-status-success-text",
|
|
243
|
-
children: [/* @__PURE__ */
|
|
248
|
+
children: [/* @__PURE__ */ S(p, {
|
|
244
249
|
className: "h-3.5 w-3.5",
|
|
245
250
|
"aria-hidden": "true"
|
|
246
251
|
}), "Resolved"]
|
|
247
252
|
})
|
|
248
|
-
] }), /* @__PURE__ */
|
|
253
|
+
] }), /* @__PURE__ */ C("span", {
|
|
249
254
|
className: "flex shrink-0 items-center gap-1",
|
|
250
255
|
children: [
|
|
251
|
-
|
|
256
|
+
se && !R && /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(w, {
|
|
252
257
|
size: "sm",
|
|
253
258
|
variant: "ghost",
|
|
254
259
|
className: "h-6 px-2 text-xs",
|
|
255
|
-
onClick: () =>
|
|
260
|
+
onClick: () => z(!0),
|
|
256
261
|
children: "Edit"
|
|
257
|
-
}), /* @__PURE__ */
|
|
262
|
+
}), /* @__PURE__ */ S(i, {
|
|
258
263
|
label: "",
|
|
259
264
|
ariaLabel: "Delete comment",
|
|
260
265
|
variant: "outline",
|
|
261
|
-
icon: /* @__PURE__ */
|
|
266
|
+
icon: /* @__PURE__ */ S(v, {
|
|
262
267
|
className: "h-3.5 w-3.5",
|
|
263
268
|
"aria-hidden": "true"
|
|
264
269
|
}),
|
|
@@ -266,32 +271,32 @@ function O({ comment: e, currentUserId: u, editMutation: y, removeMutation: w, r
|
|
|
266
271
|
description: "It is removed from the discussion for everyone, replies included. This cannot be undone here.",
|
|
267
272
|
confirmLabel: "Delete",
|
|
268
273
|
destructive: !0,
|
|
269
|
-
disabled:
|
|
270
|
-
onConfirm: () => void
|
|
274
|
+
disabled: ne.loading,
|
|
275
|
+
onConfirm: () => void de()
|
|
271
276
|
})] }),
|
|
272
|
-
/* @__PURE__ */
|
|
277
|
+
/* @__PURE__ */ S(w, {
|
|
273
278
|
size: "sm",
|
|
274
279
|
variant: Q ? "outline" : "ghost",
|
|
275
280
|
className: "h-6 px-2 text-xs",
|
|
276
281
|
"data-testid": "comment-resolve",
|
|
277
|
-
disabled:
|
|
278
|
-
onClick: () => void
|
|
279
|
-
children: Q ? /* @__PURE__ */
|
|
282
|
+
disabled: ie.loading,
|
|
283
|
+
onClick: () => void fe(),
|
|
284
|
+
children: Q ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(_, {
|
|
280
285
|
className: "mr-1 h-3.5 w-3.5",
|
|
281
286
|
"aria-hidden": "true"
|
|
282
|
-
}), "Reopen"] }) : /* @__PURE__ */
|
|
287
|
+
}), "Reopen"] }) : /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(p, {
|
|
283
288
|
className: "mr-1 h-3.5 w-3.5",
|
|
284
289
|
"aria-hidden": "true"
|
|
285
290
|
}), "Resolve"] })
|
|
286
291
|
}),
|
|
287
|
-
Q && /* @__PURE__ */
|
|
292
|
+
Q && /* @__PURE__ */ C(w, {
|
|
288
293
|
size: "sm",
|
|
289
294
|
variant: "ghost",
|
|
290
295
|
className: "h-6 px-2 text-xs",
|
|
291
296
|
"aria-expanded": !0,
|
|
292
297
|
"aria-controls": $,
|
|
293
|
-
onClick: () =>
|
|
294
|
-
children: [/* @__PURE__ */
|
|
298
|
+
onClick: () => U(!1),
|
|
299
|
+
children: [/* @__PURE__ */ S(m, {
|
|
295
300
|
className: "mr-1 h-3.5 w-3.5",
|
|
296
301
|
"aria-hidden": "true"
|
|
297
302
|
}), "Collapse"]
|
|
@@ -299,98 +304,100 @@ function O({ comment: e, currentUserId: u, editMutation: y, removeMutation: w, r
|
|
|
299
304
|
]
|
|
300
305
|
})]
|
|
301
306
|
}),
|
|
302
|
-
|
|
307
|
+
R ? /* @__PURE__ */ C("div", {
|
|
303
308
|
className: "space-y-2",
|
|
304
309
|
children: [
|
|
305
|
-
/* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ S(c, {
|
|
306
311
|
id: `${$}-edit`,
|
|
307
312
|
ariaLabel: "Edit comment",
|
|
308
313
|
className: "min-h-[60px]",
|
|
309
|
-
value:
|
|
310
|
-
onChange:
|
|
314
|
+
value: B,
|
|
315
|
+
onChange: V,
|
|
311
316
|
workspaceId: P,
|
|
312
317
|
authToken: F,
|
|
313
318
|
apiGatewayUrl: I
|
|
314
319
|
}),
|
|
315
|
-
|
|
316
|
-
/* @__PURE__ */
|
|
320
|
+
ce && /* @__PURE__ */ S(a, { message: `A comment can be at most ${E} characters.` }),
|
|
321
|
+
/* @__PURE__ */ C("div", {
|
|
317
322
|
className: "flex justify-end gap-2",
|
|
318
|
-
children: [/* @__PURE__ */
|
|
323
|
+
children: [/* @__PURE__ */ S(w, {
|
|
319
324
|
size: "sm",
|
|
320
325
|
variant: "outline",
|
|
321
326
|
onClick: () => {
|
|
322
|
-
|
|
327
|
+
z(!1), V(e.body), M(null);
|
|
323
328
|
},
|
|
324
329
|
children: "Cancel"
|
|
325
|
-
}), /* @__PURE__ */
|
|
330
|
+
}), /* @__PURE__ */ S(w, {
|
|
326
331
|
size: "sm",
|
|
327
|
-
onClick: () => void
|
|
328
|
-
disabled: !
|
|
329
|
-
children:
|
|
332
|
+
onClick: () => void ue(),
|
|
333
|
+
disabled: !B.trim() || ce || Z.loading,
|
|
334
|
+
children: Z.loading ? "Saving…" : "Save"
|
|
330
335
|
})]
|
|
331
336
|
})
|
|
332
337
|
]
|
|
333
|
-
}) : /* @__PURE__ */
|
|
334
|
-
!
|
|
338
|
+
}) : /* @__PURE__ */ S(l, { text: e.body }),
|
|
339
|
+
!R && /* @__PURE__ */ C(w, {
|
|
335
340
|
size: "sm",
|
|
336
341
|
variant: "ghost",
|
|
337
342
|
className: "h-6 px-2 text-xs",
|
|
338
343
|
"data-testid": "comment-reply",
|
|
339
|
-
onClick: () =>
|
|
340
|
-
children: [/* @__PURE__ */
|
|
344
|
+
onClick: () => pe(Y?.displayName ?? "this comment", e.authorId, Y?.displayName),
|
|
345
|
+
children: [/* @__PURE__ */ S(g, {
|
|
341
346
|
className: "mr-1 h-3.5 w-3.5",
|
|
342
347
|
"aria-hidden": "true"
|
|
343
348
|
}), "Reply"]
|
|
344
349
|
}),
|
|
345
|
-
e.replies.length > 0 && /* @__PURE__ */
|
|
350
|
+
e.replies.length > 0 && /* @__PURE__ */ S("ol", {
|
|
346
351
|
className: "ml-5 space-y-2 border-l border-border-default pl-3",
|
|
347
|
-
children: e.replies.map((e) => /* @__PURE__ */
|
|
352
|
+
children: e.replies.map((e) => /* @__PURE__ */ S(A, {
|
|
348
353
|
reply: e,
|
|
349
354
|
currentUserId: u,
|
|
350
|
-
editMutation:
|
|
351
|
-
removeMutation:
|
|
355
|
+
editMutation: d,
|
|
356
|
+
removeMutation: b,
|
|
352
357
|
mutationRefetch: j,
|
|
353
358
|
onError: M,
|
|
354
359
|
idPrefix: N,
|
|
355
360
|
workspaceId: P,
|
|
356
361
|
authToken: F,
|
|
357
362
|
apiGatewayUrl: I,
|
|
358
|
-
onReply:
|
|
363
|
+
onReply: pe
|
|
359
364
|
}, e.id))
|
|
360
365
|
}),
|
|
361
|
-
|
|
366
|
+
ee && /* @__PURE__ */ C("div", {
|
|
362
367
|
className: "ml-5 space-y-2 border-l border-border-default pl-3",
|
|
363
368
|
children: [
|
|
364
|
-
|
|
369
|
+
q && /* @__PURE__ */ C("p", {
|
|
365
370
|
className: "text-xs text-muted-foreground",
|
|
366
|
-
children: ["Replying to ",
|
|
371
|
+
children: ["Replying to ", q]
|
|
367
372
|
}),
|
|
368
|
-
/* @__PURE__ */
|
|
373
|
+
/* @__PURE__ */ S(c, {
|
|
369
374
|
id: `${$}-reply`,
|
|
370
375
|
ariaLabel: "Write a reply",
|
|
371
376
|
className: "min-h-[60px]",
|
|
372
|
-
value:
|
|
373
|
-
onChange:
|
|
377
|
+
value: G,
|
|
378
|
+
onChange: (e) => {
|
|
379
|
+
K(e), L?.();
|
|
380
|
+
},
|
|
374
381
|
autoFocus: !0,
|
|
375
382
|
workspaceId: P,
|
|
376
383
|
authToken: F,
|
|
377
384
|
apiGatewayUrl: I
|
|
378
385
|
}),
|
|
379
|
-
|
|
380
|
-
/* @__PURE__ */
|
|
386
|
+
le && /* @__PURE__ */ S(a, { message: `A comment can be at most ${E} characters.` }),
|
|
387
|
+
/* @__PURE__ */ C("div", {
|
|
381
388
|
className: "flex justify-end gap-2",
|
|
382
|
-
children: [/* @__PURE__ */
|
|
389
|
+
children: [/* @__PURE__ */ S(w, {
|
|
383
390
|
size: "sm",
|
|
384
391
|
variant: "outline",
|
|
385
392
|
onClick: () => {
|
|
386
|
-
|
|
393
|
+
W(!1), K(""), J(null);
|
|
387
394
|
},
|
|
388
395
|
children: "Cancel"
|
|
389
|
-
}), /* @__PURE__ */
|
|
396
|
+
}), /* @__PURE__ */ S(w, {
|
|
390
397
|
size: "sm",
|
|
391
|
-
onClick: () => void
|
|
392
|
-
disabled: !
|
|
393
|
-
children:
|
|
398
|
+
onClick: () => void me(),
|
|
399
|
+
disabled: !G.trim() || le || oe.loading,
|
|
400
|
+
children: oe.loading ? "Posting…" : "Reply"
|
|
394
401
|
})]
|
|
395
402
|
})
|
|
396
403
|
]
|
|
@@ -399,8 +406,8 @@ function O({ comment: e, currentUserId: u, editMutation: y, removeMutation: w, r
|
|
|
399
406
|
})
|
|
400
407
|
});
|
|
401
408
|
}
|
|
402
|
-
function
|
|
403
|
-
let [O, k] =
|
|
409
|
+
function A({ reply: e, currentUserId: o, editMutation: u, removeMutation: d, mutationRefetch: p, onError: m, idPrefix: h, workspaceId: _, authToken: b, apiGatewayUrl: x, onReply: T }) {
|
|
410
|
+
let [O, k] = f(!1), [A, j] = f(e.body), M = n(e.authorId), [N, P] = y(u, p), [F, I] = y(d, p), L = e.authorId === o, R = A.trim().length > E, z = async () => {
|
|
404
411
|
m(null);
|
|
405
412
|
try {
|
|
406
413
|
await r(N({ variables: {
|
|
@@ -418,37 +425,37 @@ function k({ reply: e, currentUserId: o, editMutation: u, removeMutation: f, mut
|
|
|
418
425
|
m(s(e, "The reply could not be deleted."));
|
|
419
426
|
}
|
|
420
427
|
};
|
|
421
|
-
return /* @__PURE__ */
|
|
428
|
+
return /* @__PURE__ */ C("li", {
|
|
422
429
|
className: "space-y-1",
|
|
423
430
|
"data-testid": "comment-reply-item",
|
|
424
431
|
children: [
|
|
425
|
-
/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ C("div", {
|
|
426
433
|
className: "flex items-start justify-between gap-2 text-xs text-muted-foreground",
|
|
427
|
-
children: [/* @__PURE__ */
|
|
428
|
-
/* @__PURE__ */
|
|
434
|
+
children: [/* @__PURE__ */ C("span", { children: [
|
|
435
|
+
/* @__PURE__ */ S("span", {
|
|
429
436
|
className: "font-medium text-foreground",
|
|
430
|
-
children: /* @__PURE__ */
|
|
437
|
+
children: /* @__PURE__ */ S(t, { id: e.authorId })
|
|
431
438
|
}),
|
|
432
439
|
" ",
|
|
433
440
|
"· ",
|
|
434
|
-
|
|
435
|
-
e.editedAt && /* @__PURE__ */
|
|
436
|
-
title: `Edited ${
|
|
441
|
+
D(e.createdAt),
|
|
442
|
+
e.editedAt && /* @__PURE__ */ S("span", {
|
|
443
|
+
title: `Edited ${D(e.editedAt)}`,
|
|
437
444
|
children: " · edited"
|
|
438
445
|
})
|
|
439
|
-
] }), L && !O && /* @__PURE__ */
|
|
446
|
+
] }), L && !O && /* @__PURE__ */ C("span", {
|
|
440
447
|
className: "flex shrink-0 items-center gap-1",
|
|
441
|
-
children: [/* @__PURE__ */
|
|
448
|
+
children: [/* @__PURE__ */ S(w, {
|
|
442
449
|
size: "sm",
|
|
443
450
|
variant: "ghost",
|
|
444
451
|
className: "h-6 px-2 text-xs",
|
|
445
452
|
onClick: () => k(!0),
|
|
446
453
|
children: "Edit"
|
|
447
|
-
}), /* @__PURE__ */
|
|
454
|
+
}), /* @__PURE__ */ S(i, {
|
|
448
455
|
label: "",
|
|
449
456
|
ariaLabel: "Delete reply",
|
|
450
457
|
variant: "outline",
|
|
451
|
-
icon: /* @__PURE__ */
|
|
458
|
+
icon: /* @__PURE__ */ S(v, {
|
|
452
459
|
className: "h-3.5 w-3.5",
|
|
453
460
|
"aria-hidden": "true"
|
|
454
461
|
}),
|
|
@@ -461,30 +468,30 @@ function k({ reply: e, currentUserId: o, editMutation: u, removeMutation: f, mut
|
|
|
461
468
|
})]
|
|
462
469
|
})]
|
|
463
470
|
}),
|
|
464
|
-
O ? /* @__PURE__ */
|
|
471
|
+
O ? /* @__PURE__ */ C("div", {
|
|
465
472
|
className: "space-y-2",
|
|
466
473
|
children: [
|
|
467
|
-
/* @__PURE__ */
|
|
468
|
-
id: `${
|
|
474
|
+
/* @__PURE__ */ S(c, {
|
|
475
|
+
id: `${h}-reply-${e.id}-edit`,
|
|
469
476
|
ariaLabel: "Edit reply",
|
|
470
477
|
className: "min-h-[56px]",
|
|
471
478
|
value: A,
|
|
472
479
|
onChange: j,
|
|
473
|
-
workspaceId:
|
|
480
|
+
workspaceId: _,
|
|
474
481
|
authToken: b,
|
|
475
|
-
apiGatewayUrl:
|
|
482
|
+
apiGatewayUrl: x
|
|
476
483
|
}),
|
|
477
|
-
R && /* @__PURE__ */
|
|
478
|
-
/* @__PURE__ */
|
|
484
|
+
R && /* @__PURE__ */ S(a, { message: `A comment can be at most ${E} characters.` }),
|
|
485
|
+
/* @__PURE__ */ C("div", {
|
|
479
486
|
className: "flex justify-end gap-2",
|
|
480
|
-
children: [/* @__PURE__ */
|
|
487
|
+
children: [/* @__PURE__ */ S(w, {
|
|
481
488
|
size: "sm",
|
|
482
489
|
variant: "outline",
|
|
483
490
|
onClick: () => {
|
|
484
491
|
k(!1), j(e.body), m(null);
|
|
485
492
|
},
|
|
486
493
|
children: "Cancel"
|
|
487
|
-
}), /* @__PURE__ */
|
|
494
|
+
}), /* @__PURE__ */ S(w, {
|
|
488
495
|
size: "sm",
|
|
489
496
|
onClick: () => void z(),
|
|
490
497
|
disabled: !A.trim() || R || P.loading,
|
|
@@ -492,14 +499,14 @@ function k({ reply: e, currentUserId: o, editMutation: u, removeMutation: f, mut
|
|
|
492
499
|
})]
|
|
493
500
|
})
|
|
494
501
|
]
|
|
495
|
-
}) : /* @__PURE__ */
|
|
496
|
-
!O && /* @__PURE__ */
|
|
502
|
+
}) : /* @__PURE__ */ S(l, { text: e.body }),
|
|
503
|
+
!O && /* @__PURE__ */ C(w, {
|
|
497
504
|
size: "sm",
|
|
498
505
|
variant: "ghost",
|
|
499
506
|
className: "h-6 px-2 text-xs",
|
|
500
507
|
"data-testid": "comment-reply",
|
|
501
|
-
onClick: () =>
|
|
502
|
-
children: [/* @__PURE__ */
|
|
508
|
+
onClick: () => T(M?.displayName ?? "this reply", e.authorId, M?.displayName),
|
|
509
|
+
children: [/* @__PURE__ */ S(g, {
|
|
503
510
|
className: "mr-1 h-3.5 w-3.5",
|
|
504
511
|
"aria-hidden": "true"
|
|
505
512
|
}), "Reply"]
|
|
@@ -508,6 +515,6 @@ function k({ reply: e, currentUserId: o, editMutation: u, removeMutation: f, mut
|
|
|
508
515
|
});
|
|
509
516
|
}
|
|
510
517
|
//#endregion
|
|
511
|
-
export {
|
|
518
|
+
export { O as CommentThread };
|
|
512
519
|
|
|
513
520
|
//# sourceMappingURL=CommentThread.js.map
|