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