@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.
Files changed (143) hide show
  1. package/dist/generated/global-types.d.ts +5 -0
  2. package/dist/generated/global-types.d.ts.map +1 -1
  3. package/dist/generated/wspace-operations.d.ts +1814 -401
  4. package/dist/generated/wspace-operations.d.ts.map +1 -1
  5. package/dist/generated/wspace-types.d.ts +5167 -54
  6. package/dist/generated/wspace-types.d.ts.map +1 -1
  7. package/dist/index.js +8 -8
  8. package/dist/planmagnet/PlanMagnetRoot.d.ts.map +1 -1
  9. package/dist/planmagnet/PlanMagnetRoot.js +172 -160
  10. package/dist/planmagnet/PlanMagnetRoot.js.map +1 -1
  11. package/dist/planmagnet/PlanMagnetRoutes.d.ts.map +1 -1
  12. package/dist/planmagnet/PlanMagnetRoutes.js +95 -83
  13. package/dist/planmagnet/PlanMagnetRoutes.js.map +1 -1
  14. package/dist/planmagnet/comments/CommentAttachmentUpload.d.ts +16 -0
  15. package/dist/planmagnet/comments/CommentAttachmentUpload.d.ts.map +1 -0
  16. package/dist/planmagnet/comments/CommentAttachmentUpload.js +218 -0
  17. package/dist/planmagnet/comments/CommentAttachmentUpload.js.map +1 -0
  18. package/dist/planmagnet/comments/CommentAttachments.d.ts +15 -0
  19. package/dist/planmagnet/comments/CommentAttachments.d.ts.map +1 -0
  20. package/dist/planmagnet/comments/CommentAttachments.js +74 -0
  21. package/dist/planmagnet/comments/CommentAttachments.js.map +1 -0
  22. package/dist/planmagnet/comments/CommentBody.d.ts +11 -0
  23. package/dist/planmagnet/comments/CommentBody.d.ts.map +1 -0
  24. package/dist/planmagnet/comments/CommentBody.js +130 -0
  25. package/dist/planmagnet/comments/CommentBody.js.map +1 -0
  26. package/dist/planmagnet/comments/CommentThread.d.ts +7 -2
  27. package/dist/planmagnet/comments/CommentThread.d.ts.map +1 -1
  28. package/dist/planmagnet/comments/CommentThread.js +288 -233
  29. package/dist/planmagnet/comments/CommentThread.js.map +1 -1
  30. package/dist/planmagnet/comments/MentionComposer.d.ts +0 -7
  31. package/dist/planmagnet/comments/MentionComposer.d.ts.map +1 -1
  32. package/dist/planmagnet/comments/MentionComposer.js +225 -86
  33. package/dist/planmagnet/comments/MentionComposer.js.map +1 -1
  34. package/dist/planmagnet/comments/TargetComments.d.ts.map +1 -1
  35. package/dist/planmagnet/comments/TargetComments.js +44 -6
  36. package/dist/planmagnet/comments/TargetComments.js.map +1 -1
  37. package/dist/planmagnet/comments/WorkItemComments.d.ts.map +1 -1
  38. package/dist/planmagnet/comments/WorkItemComments.js +22 -3
  39. package/dist/planmagnet/comments/WorkItemComments.js.map +1 -1
  40. package/dist/planmagnet/comments/commentAttachmentUploadClient.d.ts +102 -0
  41. package/dist/planmagnet/comments/commentAttachmentUploadClient.d.ts.map +1 -0
  42. package/dist/planmagnet/comments/commentAttachmentUploadClient.js +298 -0
  43. package/dist/planmagnet/comments/commentAttachmentUploadClient.js.map +1 -0
  44. package/dist/planmagnet/comments/commentImageTokens.d.ts +5 -0
  45. package/dist/planmagnet/comments/commentImageTokens.d.ts.map +1 -0
  46. package/dist/planmagnet/comments/commentImageTokens.js +14 -0
  47. package/dist/planmagnet/comments/commentImageTokens.js.map +1 -0
  48. package/dist/planmagnet/comments/commentTokens.d.ts +31 -0
  49. package/dist/planmagnet/comments/commentTokens.d.ts.map +1 -0
  50. package/dist/planmagnet/comments/commentTokens.js +142 -0
  51. package/dist/planmagnet/comments/commentTokens.js.map +1 -0
  52. package/dist/planmagnet/comments/fileDisplay.d.ts +22 -0
  53. package/dist/planmagnet/comments/fileDisplay.d.ts.map +1 -0
  54. package/dist/planmagnet/comments/fileDisplay.js +48 -0
  55. package/dist/planmagnet/comments/fileDisplay.js.map +1 -0
  56. package/dist/planmagnet/comments/useCommentFileUrl.d.ts +22 -0
  57. package/dist/planmagnet/comments/useCommentFileUrl.d.ts.map +1 -0
  58. package/dist/planmagnet/comments/useCommentFileUrl.js +54 -0
  59. package/dist/planmagnet/comments/useCommentFileUrl.js.map +1 -0
  60. package/dist/planmagnet/controls/Pickers.d.ts +7 -2
  61. package/dist/planmagnet/controls/Pickers.d.ts.map +1 -1
  62. package/dist/planmagnet/controls/Pickers.js +10 -9
  63. package/dist/planmagnet/controls/Pickers.js.map +1 -1
  64. package/dist/planmagnet/index.d.ts +1 -1
  65. package/dist/planmagnet/index.d.ts.map +1 -1
  66. package/dist/planmagnet/pages/ProductsFeatureAnalyticsPagePage.js +4 -4
  67. package/dist/planmagnet/pages/ProductsFeatureAnalyticsPagePage.js.map +1 -1
  68. package/dist/planmagnet/pages/ProductsFeatureDetailPagePage.d.ts.map +1 -1
  69. package/dist/planmagnet/pages/ProductsFeatureDetailPagePage.js +133 -131
  70. package/dist/planmagnet/pages/ProductsFeatureDetailPagePage.js.map +1 -1
  71. package/dist/planmagnet/pages/ProductsFeaturesPagePage.d.ts.map +1 -1
  72. package/dist/planmagnet/pages/ProductsFeaturesPagePage.js +5 -5
  73. package/dist/planmagnet/pages/ProductsFeaturesPagePage.js.map +1 -1
  74. package/dist/planmagnet/pages/ProductsNewFeaturePagePage.js +6 -6
  75. package/dist/planmagnet/pages/ProductsNewFeaturePagePage.js.map +1 -1
  76. package/dist/planmagnet/pages/ProductsProductDetailPagePage.d.ts.map +1 -1
  77. package/dist/planmagnet/pages/ProductsProductDetailPagePage.js +105 -82
  78. package/dist/planmagnet/pages/ProductsProductDetailPagePage.js.map +1 -1
  79. package/dist/planmagnet/pages/ProductsProductFeatureDetailPagePage.d.ts +2 -0
  80. package/dist/planmagnet/pages/ProductsProductFeatureDetailPagePage.d.ts.map +1 -0
  81. package/dist/planmagnet/pages/ProductsProductFeatureDetailPagePage.js +174 -0
  82. package/dist/planmagnet/pages/ProductsProductFeatureDetailPagePage.js.map +1 -0
  83. package/dist/planmagnet/pages/ProductsProductHierarchyPagePage.d.ts +2 -0
  84. package/dist/planmagnet/pages/ProductsProductHierarchyPagePage.d.ts.map +1 -0
  85. package/dist/planmagnet/pages/ProductsProductHierarchyPagePage.js +350 -0
  86. package/dist/planmagnet/pages/ProductsProductHierarchyPagePage.js.map +1 -0
  87. package/dist/planmagnet/pages/ProductsProductLinesPagePage.d.ts +2 -0
  88. package/dist/planmagnet/pages/ProductsProductLinesPagePage.d.ts.map +1 -0
  89. package/dist/planmagnet/pages/ProductsProductLinesPagePage.js +168 -0
  90. package/dist/planmagnet/pages/ProductsProductLinesPagePage.js.map +1 -0
  91. package/dist/planmagnet/pages/ProductsProductsPagePage.d.ts.map +1 -1
  92. package/dist/planmagnet/pages/ProductsProductsPagePage.js +1 -1
  93. package/dist/planmagnet/pages/ProductsProductsPagePage.js.map +1 -1
  94. package/dist/planmagnet/pages/TasksTaskDetailPagePage.d.ts.map +1 -1
  95. package/dist/planmagnet/pages/TasksTaskDetailPagePage.js +156 -154
  96. package/dist/planmagnet/pages/TasksTaskDetailPagePage.js.map +1 -1
  97. package/dist/planmagnet/product/FeatureLinkPanels.d.ts +29 -0
  98. package/dist/planmagnet/product/FeatureLinkPanels.d.ts.map +1 -0
  99. package/dist/planmagnet/product/FeatureLinkPanels.js +373 -0
  100. package/dist/planmagnet/product/FeatureLinkPanels.js.map +1 -0
  101. package/dist/planmagnet/product/ProductControls.js +1 -1
  102. package/dist/planmagnet/product/ProductControls.js.map +1 -1
  103. package/dist/planmagnet/product/ProductFeatureControls.d.ts +39 -0
  104. package/dist/planmagnet/product/ProductFeatureControls.d.ts.map +1 -0
  105. package/dist/planmagnet/product/ProductFeatureControls.js +315 -0
  106. package/dist/planmagnet/product/ProductFeatureControls.js.map +1 -0
  107. package/dist/planmagnet/product/ProductFeatureLinkCard.d.ts +4 -0
  108. package/dist/planmagnet/product/ProductFeatureLinkCard.d.ts.map +1 -0
  109. package/dist/planmagnet/product/ProductFeatureLinkCard.js +192 -0
  110. package/dist/planmagnet/product/ProductFeatureLinkCard.js.map +1 -0
  111. package/dist/planmagnet/product/ProductLineControls.d.ts +52 -0
  112. package/dist/planmagnet/product/ProductLineControls.d.ts.map +1 -0
  113. package/dist/planmagnet/product/ProductLineControls.js +417 -0
  114. package/dist/planmagnet/product/ProductLineControls.js.map +1 -0
  115. package/dist/planmagnet/product/ProductTeamsPanel.d.ts +4 -0
  116. package/dist/planmagnet/product/ProductTeamsPanel.d.ts.map +1 -0
  117. package/dist/planmagnet/product/ProductTeamsPanel.js +129 -0
  118. package/dist/planmagnet/product/ProductTeamsPanel.js.map +1 -0
  119. package/dist/planmagnet/product/WorkItemProductFeatureChip.d.ts +4 -0
  120. package/dist/planmagnet/product/WorkItemProductFeatureChip.d.ts.map +1 -0
  121. package/dist/planmagnet/product/WorkItemProductFeatureChip.js +41 -0
  122. package/dist/planmagnet/product/WorkItemProductFeatureChip.js.map +1 -0
  123. package/dist/planmagnet/product/hierarchy.d.ts +127 -0
  124. package/dist/planmagnet/product/hierarchy.d.ts.map +1 -0
  125. package/dist/planmagnet/product/hierarchy.js +173 -0
  126. package/dist/planmagnet/product/hierarchy.js.map +1 -0
  127. package/dist/planmagnet/product/hierarchyOperations.d.ts +35 -0
  128. package/dist/planmagnet/product/hierarchyOperations.d.ts.map +1 -0
  129. package/dist/planmagnet/product/hierarchyOperations.js +440 -0
  130. package/dist/planmagnet/product/hierarchyOperations.js.map +1 -0
  131. package/dist/planmagnet/product/refusal.d.ts +14 -0
  132. package/dist/planmagnet/product/refusal.d.ts.map +1 -0
  133. package/dist/planmagnet/product/refusal.js +10 -0
  134. package/dist/planmagnet/product/refusal.js.map +1 -0
  135. package/dist/planmagnet/product/routes.d.ts +4 -0
  136. package/dist/planmagnet/product/routes.d.ts.map +1 -1
  137. package/dist/planmagnet/product/routes.js +2 -2
  138. package/dist/planmagnet/product/routes.js.map +1 -1
  139. package/dist/shared/utils/i18n.d.ts +3 -0
  140. package/dist/shared/utils/i18n.d.ts.map +1 -1
  141. package/dist/shared/utils/i18n.js +1 -1
  142. package/dist/shared/utils/i18n.js.map +1 -1
  143. 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, MentionText as l } from "./MentionComposer.js";
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";
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 T = 30, E = 1e4, D = (e) => new Date(e).toLocaleString();
15
- function O({ targetNoun: t, idPrefix: n, query: o, 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,
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: B, loading: V, error: H, fetchMore: U } = b(o.document, {
26
+ }, { data: se, loading: V, error: ce, fetchMore: H } = v(l.document, {
20
27
  variables: {
21
- ...o.variables,
22
- pagination: { first: T }
28
+ ...l.variables,
29
+ pagination: { first: C }
23
30
  },
24
- skip: o.skip
25
- }), [ee, W] = y(l.document, z), G = B?.[o.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);
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(ee({ variables: l.buildVariables(e, t) })), !0;
39
+ return await a(U({ variables: u.buildVariables(e, t, n) })), !0;
33
40
  } catch (e) {
34
- return P(r(e) ? "Your role can read but not comment." : i(e, "The comment could not be posted.")), !1;
41
+ return j(r(e) ? "Your role can read but not comment." : i(e, "The comment could not be posted.")), !1;
35
42
  }
36
- }, ne = async () => {
37
- await te(X, null) && M("");
38
- }, re = async () => {
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
- I(!0);
51
+ N(!0);
42
52
  try {
43
- await U({
53
+ await H({
44
54
  variables: {
45
- ...o.variables,
55
+ ...l.variables,
46
56
  pagination: {
47
- first: T,
57
+ first: C,
48
58
  after: e
49
59
  }
50
60
  },
51
- updateQuery: (e, { fetchMoreResult: t }) => ({ [o.dataKey]: {
52
- ...t[o.dataKey],
53
- items: [...e[o.dataKey].items, ...t[o.dataKey].items]
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
- I(!1);
67
+ N(!1);
58
68
  }
59
69
  }
60
70
  };
61
- return /* @__PURE__ */ C("div", {
71
+ return /* @__PURE__ */ x("div", {
62
72
  className: "space-y-4",
63
73
  "data-testid": "comment-thread",
64
74
  children: [
65
- N && /* @__PURE__ */ S(s, { message: N }),
66
- V && !B && /* @__PURE__ */ S("p", {
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
- H && /* @__PURE__ */ S(s, { message: `Comments could not be loaded: ${H.message}` }),
71
- G && K.length > 0 && /* @__PURE__ */ S("div", {
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 (${Y})`],
88
+ ["RESOLVED", `Resolved (${le})`],
79
89
  ["ALL", `All (${K.length})`]
80
- ].map(([e, t]) => /* @__PURE__ */ S(w, {
90
+ ].map(([e, t]) => /* @__PURE__ */ b(S, {
81
91
  type: "button",
82
92
  size: "sm",
83
- variant: L === e ? "default" : "outline",
84
- "aria-pressed": L === e,
93
+ variant: P === e ? "default" : "outline",
94
+ "aria-pressed": P === e,
85
95
  className: "h-7 px-2.5 text-xs",
86
- onClick: () => R(e),
96
+ onClick: () => F(e),
87
97
  children: t
88
98
  }, e))
89
99
  }),
90
- G && q.length === 0 && /* @__PURE__ */ S("p", {
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__ */ S("ol", {
104
+ /* @__PURE__ */ b("ol", {
95
105
  className: "space-y-3",
96
- children: q.map((e) => /* @__PURE__ */ S(k, {
106
+ children: q.map((e) => /* @__PURE__ */ b(D, {
97
107
  comment: e,
98
- currentUserId: x?.id,
99
- editMutation: p,
108
+ target: t,
109
+ currentUserId: oe?.id,
110
+ editMutation: re,
100
111
  removeMutation: m,
101
- resolveMutation: h,
102
- addMutation: l.document,
103
- buildReplyVariables: (t) => l.buildVariables(t, e.id),
104
- mutationRefetch: z,
105
- onError: P,
106
- idPrefix: n,
107
- workspaceId: D,
108
- authToken: O,
109
- apiGatewayUrl: A,
110
- onTyping: v?.notifyTyping
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(w, {
124
+ G?.pageInfo.hasNextPage && /* @__PURE__ */ b(S, {
114
125
  size: "sm",
115
126
  variant: "outline",
116
- onClick: () => void re(),
117
- disabled: F,
118
- children: F ? "Loading…" : `Show more (${K.length} of ${G.totalCount})`
127
+ onClick: () => void fe(),
128
+ disabled: M,
129
+ children: M ? "Loading…" : `Show more (${K.length} of ${G.totalCount})`
119
130
  }),
120
- v && /* @__PURE__ */ S(u, { typingActorIds: v.typingActorIds }),
121
- /* @__PURE__ */ C("div", {
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__ */ S("label", {
125
- htmlFor: `${n}-add`,
135
+ /* @__PURE__ */ b("label", {
136
+ htmlFor: `${o}-add`,
126
137
  className: "sr-only",
127
138
  children: "Add a comment"
128
139
  }),
129
- /* @__PURE__ */ S(c, {
130
- id: `${n}-add`,
131
- ariaLabel: `Add a comment on this ${t}`,
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: j,
145
+ value: O,
146
+ disabled: W.loading,
135
147
  onChange: (e) => {
136
- M(e), v?.notifyTyping();
148
+ k(e), g?.notifyTyping();
137
149
  },
138
- workspaceId: D,
139
- authToken: O,
140
- apiGatewayUrl: A
150
+ workspaceId: y,
151
+ authToken: T,
152
+ apiGatewayUrl: E
141
153
  }),
142
- Z && /* @__PURE__ */ S(s, { message: `A comment can be at most ${E} characters.` }),
143
- /* @__PURE__ */ S("div", {
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(w, {
164
+ children: /* @__PURE__ */ b(S, {
146
165
  size: "sm",
147
- onClick: () => void ne(),
148
- disabled: !X || Z || W.loading,
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 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 () => {
160
- M(null);
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(X({ variables: {
189
+ await a(fe({ variables: {
163
190
  id: e.id,
164
- body: B.trim()
165
- } })), z(!1);
191
+ body: z.trim()
192
+ } })), R(!1);
166
193
  } catch (e) {
167
- M(i(e, "The comment could not be saved."));
194
+ j(i(e, "The comment could not be saved."));
168
195
  }
169
- }, de = async () => {
170
- M(null);
196
+ }, Ce = async () => {
197
+ j(null);
171
198
  try {
172
- await a(te({ variables: { id: e.id } }));
199
+ await a(me({ variables: { id: e.id } }));
173
200
  } catch (e) {
174
- M(i(e, "The comment could not be deleted."));
201
+ j(i(e, "The comment could not be deleted."));
175
202
  }
176
- }, fe = async () => {
177
- M(null);
203
+ }, we = async () => {
204
+ j(null);
178
205
  try {
179
- await a(re({ variables: {
206
+ await a(ge({ variables: {
180
207
  id: e.id,
181
208
  resolved: !Q
182
209
  } }));
183
210
  } catch (e) {
184
- M(r(e) ? "Your role can read but not resolve comments." : i(e, "The resolution could not be changed."));
211
+ j(r(e) ? "Your role can read but not resolve comments." : i(e, "The resolution could not be changed."));
185
212
  }
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();
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
- M(null);
218
+ j(null);
192
219
  try {
193
- await a(ae({ variables: k(e) })), K(""), W(!1), J(null);
220
+ await a(ve({ variables: k(e, q.fileIds) })), W(""), H(!1), K(null), ue();
194
221
  } catch (e) {
195
- M(r(e) ? "Your role can read but not comment." : i(e, "The reply could not be posted."));
222
+ j(r(e) ? "Your role can read but not comment." : i(e, "The reply could not be posted."));
196
223
  }
197
224
  }
198
- }, $ = `${N}-comment-${e.id}`;
199
- return /* @__PURE__ */ S("li", {
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 && !H ? /* @__PURE__ */ C("div", {
229
+ children: Q && !se ? /* @__PURE__ */ x("div", {
203
230
  className: "flex items-center justify-between gap-2",
204
- children: [/* @__PURE__ */ C("p", {
231
+ children: [/* @__PURE__ */ x("p", {
205
232
  className: "min-w-0 truncate text-sm text-muted-foreground",
206
233
  children: [
207
- /* @__PURE__ */ S(p, {
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__ */ S(t, { id: e.resolvedBy }),
213
- e.resolvedAt ? ` · ${D(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__ */ C(w, {
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: () => U(!0),
223
- children: [/* @__PURE__ */ S(h, {
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__ */ C("div", {
255
+ }) : /* @__PURE__ */ x("div", {
229
256
  id: $,
230
257
  className: "space-y-2",
231
258
  children: [
232
- /* @__PURE__ */ C("div", {
259
+ /* @__PURE__ */ x("div", {
233
260
  className: "flex items-start justify-between gap-2 text-xs text-muted-foreground",
234
- children: [/* @__PURE__ */ C("span", { children: [
235
- /* @__PURE__ */ S("span", {
261
+ children: [/* @__PURE__ */ x("span", { children: [
262
+ /* @__PURE__ */ b("span", {
236
263
  className: "font-medium text-foreground",
237
- children: /* @__PURE__ */ S(t, { id: e.authorId })
264
+ children: /* @__PURE__ */ b(t, { id: e.authorId })
238
265
  }),
239
266
  " ",
240
267
  "· ",
241
- D(e.createdAt),
242
- e.editedAt && /* @__PURE__ */ S("span", {
243
- title: `Edited ${D(e.editedAt)}`,
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__ */ C("span", {
273
+ Q && /* @__PURE__ */ x("span", {
247
274
  className: "ml-1 inline-flex items-center gap-1 text-status-success-text",
248
- children: [/* @__PURE__ */ S(p, {
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__ */ C("span", {
280
+ ] }), /* @__PURE__ */ x("span", {
254
281
  className: "flex shrink-0 items-center gap-1",
255
282
  children: [
256
- se && !R && /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(w, {
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: () => z(!0),
287
+ onClick: () => R(!0),
261
288
  children: "Edit"
262
- }), /* @__PURE__ */ S(o, {
289
+ }), /* @__PURE__ */ b(o, {
263
290
  label: "",
264
291
  ariaLabel: "Delete comment",
265
292
  variant: "outline",
266
- icon: /* @__PURE__ */ S(v, {
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: ne.loading,
275
- onConfirm: () => void de()
301
+ disabled: he.loading,
302
+ onConfirm: () => void Ce()
276
303
  })] }),
277
- /* @__PURE__ */ S(w, {
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: ie.loading,
283
- onClick: () => void fe(),
284
- children: Q ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(_, {
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__ */ C(x, { children: [/* @__PURE__ */ S(p, {
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__ */ C(w, {
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: () => U(!1),
299
- children: [/* @__PURE__ */ S(m, {
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
- R ? /* @__PURE__ */ C("div", {
334
+ L ? /* @__PURE__ */ x("div", {
308
335
  className: "space-y-2",
309
336
  children: [
310
- /* @__PURE__ */ S(c, {
337
+ /* @__PURE__ */ b(c, {
311
338
  id: `${$}-edit`,
312
339
  ariaLabel: "Edit comment",
313
340
  className: "min-h-[60px]",
314
- value: B,
315
- onChange: V,
316
- workspaceId: P,
317
- authToken: F,
318
- apiGatewayUrl: I
341
+ value: z,
342
+ onChange: B,
343
+ workspaceId: N,
344
+ authToken: P,
345
+ apiGatewayUrl: F
319
346
  }),
320
- ce && /* @__PURE__ */ S(s, { message: `A comment can be at most ${E} characters.` }),
321
- /* @__PURE__ */ C("div", {
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(w, {
350
+ children: [/* @__PURE__ */ b(S, {
324
351
  size: "sm",
325
352
  variant: "outline",
326
353
  onClick: () => {
327
- z(!1), V(e.body), M(null);
354
+ R(!1), B(e.body), j(null);
328
355
  },
329
356
  children: "Cancel"
330
- }), /* @__PURE__ */ S(w, {
357
+ }), /* @__PURE__ */ b(S, {
331
358
  size: "sm",
332
- onClick: () => void ue(),
333
- disabled: !B.trim() || ce || Z.loading,
334
- children: Z.loading ? "Saving…" : "Save"
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__ */ S(l, { text: e.body }),
339
- !R && /* @__PURE__ */ C(w, {
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: () => pe(Y?.displayName ?? "this comment", e.authorId, Y?.displayName),
345
- children: [/* @__PURE__ */ S(g, {
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__ */ S("ol", {
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__ */ S(A, {
387
+ children: e.replies.map((e) => /* @__PURE__ */ b(O, {
353
388
  reply: e,
354
- currentUserId: u,
355
- editMutation: d,
356
- removeMutation: b,
357
- mutationRefetch: j,
358
- onError: M,
359
- idPrefix: N,
360
- workspaceId: P,
361
- authToken: F,
362
- apiGatewayUrl: I,
363
- onReply: pe
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
- ee && /* @__PURE__ */ C("div", {
402
+ ce && /* @__PURE__ */ x("div", {
367
403
  className: "ml-5 space-y-2 border-l border-border-default pl-3",
368
404
  children: [
369
- q && /* @__PURE__ */ C("p", {
405
+ G && /* @__PURE__ */ x("p", {
370
406
  className: "text-xs text-muted-foreground",
371
- children: ["Replying to ", q]
407
+ children: ["Replying to ", G]
372
408
  }),
373
- /* @__PURE__ */ S(c, {
409
+ /* @__PURE__ */ b(c, {
374
410
  id: `${$}-reply`,
375
411
  ariaLabel: "Write a reply",
376
412
  className: "min-h-[60px]",
377
- value: G,
413
+ value: U,
414
+ disabled: Z.loading,
378
415
  onChange: (e) => {
379
- K(e), L?.();
416
+ W(e), I?.();
380
417
  },
381
418
  autoFocus: !0,
382
- workspaceId: P,
383
- authToken: F,
384
- apiGatewayUrl: I
419
+ workspaceId: N,
420
+ authToken: P,
421
+ apiGatewayUrl: F
385
422
  }),
386
- le && /* @__PURE__ */ S(s, { message: `A comment can be at most ${E} characters.` }),
387
- /* @__PURE__ */ C("div", {
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(w, {
435
+ children: [/* @__PURE__ */ b(S, {
390
436
  size: "sm",
391
437
  variant: "outline",
438
+ disabled: Z.loading,
392
439
  onClick: () => {
393
- W(!1), K(""), J(null);
440
+ H(!1), W(""), K(null), ue();
394
441
  },
395
442
  children: "Cancel"
396
- }), /* @__PURE__ */ S(w, {
443
+ }), /* @__PURE__ */ b(S, {
397
444
  size: "sm",
398
- onClick: () => void me(),
399
- disabled: !G.trim() || le || oe.loading,
400
- children: oe.loading ? "Posting…" : "Reply"
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 A({ reply: e, currentUserId: r, 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 === r, R = A.trim().length > E, z = async () => {
411
- m(null);
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(N({ variables: {
460
+ await a(O({ variables: {
414
461
  id: e.id,
415
- body: A.trim()
416
- } })), k(!1);
462
+ body: C.trim()
463
+ } })), y(!1);
417
464
  } catch (e) {
418
- m(i(e, "The reply could not be saved."));
465
+ f(i(e, "The reply could not be saved."));
419
466
  }
420
- }, B = async () => {
421
- m(null);
467
+ }, F = async () => {
468
+ f(null);
422
469
  try {
423
- await a(F({ variables: { id: e.id } }));
470
+ await a(A({ variables: { id: e.id } }));
424
471
  } catch (e) {
425
- m(i(e, "The reply could not be deleted."));
472
+ f(i(e, "The reply could not be deleted."));
426
473
  }
427
474
  };
428
- return /* @__PURE__ */ C("li", {
475
+ return /* @__PURE__ */ x("li", {
429
476
  className: "space-y-1",
430
477
  "data-testid": "comment-reply-item",
431
478
  children: [
432
- /* @__PURE__ */ C("div", {
479
+ /* @__PURE__ */ x("div", {
433
480
  className: "flex items-start justify-between gap-2 text-xs text-muted-foreground",
434
- children: [/* @__PURE__ */ C("span", { children: [
435
- /* @__PURE__ */ S("span", {
481
+ children: [/* @__PURE__ */ x("span", { children: [
482
+ /* @__PURE__ */ b("span", {
436
483
  className: "font-medium text-foreground",
437
- children: /* @__PURE__ */ S(t, { id: e.authorId })
484
+ children: /* @__PURE__ */ b(t, { id: e.authorId })
438
485
  }),
439
486
  " ",
440
487
  "· ",
441
- D(e.createdAt),
442
- e.editedAt && /* @__PURE__ */ S("span", {
443
- title: `Edited ${D(e.editedAt)}`,
488
+ T(e.createdAt),
489
+ e.editedAt && /* @__PURE__ */ b("span", {
490
+ title: `Edited ${T(e.editedAt)}`,
444
491
  children: " · edited"
445
492
  })
446
- ] }), L && !O && /* @__PURE__ */ C("span", {
493
+ ] }), M && !v && /* @__PURE__ */ x("span", {
447
494
  className: "flex shrink-0 items-center gap-1",
448
- children: [/* @__PURE__ */ S(w, {
495
+ children: [/* @__PURE__ */ b(S, {
449
496
  size: "sm",
450
497
  variant: "ghost",
451
498
  className: "h-6 px-2 text-xs",
452
- onClick: () => k(!0),
499
+ onClick: () => y(!0),
453
500
  children: "Edit"
454
- }), /* @__PURE__ */ S(o, {
501
+ }), /* @__PURE__ */ b(o, {
455
502
  label: "",
456
503
  ariaLabel: "Delete reply",
457
504
  variant: "outline",
458
- icon: /* @__PURE__ */ S(v, {
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: I.loading,
467
- onConfirm: () => void B()
513
+ disabled: j.loading,
514
+ onConfirm: () => void F()
468
515
  })]
469
516
  })]
470
517
  }),
471
- O ? /* @__PURE__ */ C("div", {
518
+ v ? /* @__PURE__ */ x("div", {
472
519
  className: "space-y-2",
473
520
  children: [
474
- /* @__PURE__ */ S(c, {
475
- id: `${h}-reply-${e.id}-edit`,
521
+ /* @__PURE__ */ b(c, {
522
+ id: `${re}-reply-${e.id}-edit`,
476
523
  ariaLabel: "Edit reply",
477
524
  className: "min-h-[56px]",
478
- value: A,
479
- onChange: j,
480
- workspaceId: _,
481
- authToken: b,
482
- apiGatewayUrl: x
525
+ value: C,
526
+ onChange: E,
527
+ workspaceId: m,
528
+ authToken: ie,
529
+ apiGatewayUrl: ae
483
530
  }),
484
- R && /* @__PURE__ */ S(s, { message: `A comment can be at most ${E} characters.` }),
485
- /* @__PURE__ */ C("div", {
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(w, {
534
+ children: [/* @__PURE__ */ b(S, {
488
535
  size: "sm",
489
536
  variant: "outline",
490
537
  onClick: () => {
491
- k(!1), j(e.body), m(null);
538
+ y(!1), E(e.body), f(null);
492
539
  },
493
540
  children: "Cancel"
494
- }), /* @__PURE__ */ S(w, {
541
+ }), /* @__PURE__ */ b(S, {
495
542
  size: "sm",
496
- onClick: () => void z(),
497
- disabled: !A.trim() || R || P.loading,
498
- children: P.loading ? "Saving…" : "Save"
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__ */ S(l, { text: e.body }),
503
- !O && /* @__PURE__ */ C(w, {
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: () => T(M?.displayName ?? "this reply", e.authorId, M?.displayName),
509
- children: [/* @__PURE__ */ S(g, {
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 { O as CommentThread };
573
+ export { E as CommentThread };
519
574
 
520
575
  //# sourceMappingURL=CommentThread.js.map