@box/threaded-annotations 1.85.1 → 1.86.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/chunks/message-footer.js +49 -29
  2. package/dist/chunks/messages-view.js +48 -42
  3. package/dist/chunks/threaded-annotations2.js +39 -30
  4. package/dist/esm/lib/components/v2/message-editor/message-editor.js +2 -2
  5. package/dist/esm/lib/components/v2/text-message/messages.js +4 -0
  6. package/dist/esm/lib/components/v2/text-message/text-message.js +64 -54
  7. package/dist/esm/lib/v2/test-utils/mocks/mock-messages.js +2 -2
  8. package/dist/esm/lib/v2/threaded-annotations-context.js +31 -19
  9. package/dist/esm/lib/v2/threaded-annotations.js +0 -1
  10. package/dist/i18n/bn-IN.js +1 -0
  11. package/dist/i18n/da-DK.js +1 -0
  12. package/dist/i18n/de-DE.js +1 -0
  13. package/dist/i18n/en-AU.js +1 -0
  14. package/dist/i18n/en-CA.js +1 -0
  15. package/dist/i18n/en-GB.js +1 -0
  16. package/dist/i18n/en-US.js +1 -0
  17. package/dist/i18n/en-US.properties +2 -0
  18. package/dist/i18n/en-x-pseudo.js +44 -43
  19. package/dist/i18n/en-x-pseudo.properties +43 -43
  20. package/dist/i18n/es-419.js +1 -0
  21. package/dist/i18n/es-ES.js +1 -0
  22. package/dist/i18n/fi-FI.js +1 -0
  23. package/dist/i18n/fr-CA.js +1 -0
  24. package/dist/i18n/fr-FR.js +1 -0
  25. package/dist/i18n/hi-IN.js +1 -0
  26. package/dist/i18n/it-IT.js +1 -0
  27. package/dist/i18n/ja-JP.js +1 -0
  28. package/dist/i18n/json/src/lib/components/v2/text-message/messages.json +1 -1
  29. package/dist/i18n/ko-KR.js +1 -0
  30. package/dist/i18n/nb-NO.js +1 -0
  31. package/dist/i18n/nl-NL.js +1 -0
  32. package/dist/i18n/pl-PL.js +1 -0
  33. package/dist/i18n/pt-BR.js +1 -0
  34. package/dist/i18n/ru-RU.js +1 -0
  35. package/dist/i18n/sv-SE.js +1 -0
  36. package/dist/i18n/tr-TR.js +1 -0
  37. package/dist/i18n/zh-CN.js +1 -0
  38. package/dist/i18n/zh-TW.js +1 -0
  39. package/dist/styles/messages-view.css +1 -1
  40. package/dist/types/lib/components/v2/messages-view/messages-view.d.ts +6 -2
  41. package/dist/types/lib/components/v2/text-message/messages.d.ts +5 -0
  42. package/dist/types/lib/components/v2/text-message/subcomponents/message-footer.d.ts +3 -1
  43. package/dist/types/lib/components/v2/text-message/text-message.d.ts +6 -2
  44. package/dist/types/lib/v2/stories/shared.d.ts +1 -0
  45. package/dist/types/lib/v2/threaded-annotations-context.d.ts +19 -3
  46. package/dist/types/lib/v2/threaded-annotations.d.ts +14 -2
  47. package/dist/types/lib/v2/types/message-types.d.ts +2 -0
  48. package/package.json +11 -11
@@ -1,9 +1,9 @@
1
1
  import e from "../esm/lib/components/v2/text-message/messages.js";
2
- import { Button as t } from "@box/blueprint-web";
3
- import { useIntl as n } from "react-intl";
4
- import { ReadableTime as r } from "@box/readable-time";
5
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
- import '../styles/message-footer.css';var o = {
2
+ import { Button as t, Focusable as n, Text as r, Tooltip as i } from "@box/blueprint-web";
3
+ import { useIntl as a } from "react-intl";
4
+ import { ReadableTime as o, getReadableTime as s } from "@box/readable-time";
5
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
6
+ import '../styles/message-footer.css';var u = {
7
7
  textMessage: "_textMessage_z15h4_1",
8
8
  contentWrapper: "_contentWrapper_z15h4_10",
9
9
  threadedIndicator: "_threadedIndicator_z15h4_15",
@@ -13,30 +13,50 @@ import '../styles/message-footer.css';var o = {
13
13
  messageFooter: "_messageFooter_z15h4_50",
14
14
  readableTimeWrapper: "_readableTimeWrapper_z15h4_57",
15
15
  replyButton: "_replyButton_z15h4_60"
16
- }, s = ({ createdAt: s, onReply: c }) => {
17
- let l = n();
18
- return /* @__PURE__ */ a("div", {
19
- className: o.messageFooter,
20
- children: [/* @__PURE__ */ i("div", {
21
- className: o.readableTimeWrapper,
22
- "data-no-expand": !0,
23
- children: /* @__PURE__ */ i(r, {
24
- textProps: {
25
- as: "span",
26
- variant: "bodySmall",
27
- color: "textOnLightSecondary"
28
- },
29
- timestamp: s
16
+ }, d = ({ createdAt: d, onReply: f, updatedAt: p }) => {
17
+ let m = a();
18
+ return /* @__PURE__ */ l("div", {
19
+ className: u.messageFooter,
20
+ children: [
21
+ /* @__PURE__ */ c("div", {
22
+ className: u.readableTimeWrapper,
23
+ "data-no-expand": !0,
24
+ children: /* @__PURE__ */ c(o, {
25
+ textProps: {
26
+ as: "span",
27
+ variant: "bodySmall",
28
+ color: "textOnLightSecondary"
29
+ },
30
+ timestamp: d
31
+ })
32
+ }),
33
+ p !== void 0 && /* @__PURE__ */ c(i, {
34
+ content: s({
35
+ alwaysShowTime: !0,
36
+ intl: m,
37
+ relativeThreshold: 0,
38
+ timestamp: p
39
+ }),
40
+ children: /* @__PURE__ */ c(n, {
41
+ "data-no-expand": !0,
42
+ children: /* @__PURE__ */ c(r, {
43
+ as: "span",
44
+ color: "textOnLightSecondary",
45
+ variant: "bodySmall",
46
+ children: m.formatMessage(e.edited)
47
+ })
48
+ })
49
+ }),
50
+ f && /* @__PURE__ */ c(t, {
51
+ "aria-label": m.formatMessage(e.replyButtonAriaLabel),
52
+ className: u.replyButton,
53
+ "data-no-expand": !0,
54
+ size: "small",
55
+ variant: "quaternary",
56
+ onClick: f,
57
+ children: m.formatMessage(e.reply)
30
58
  })
31
- }), c && /* @__PURE__ */ i(t, {
32
- "aria-label": l.formatMessage(e.replyButtonAriaLabel),
33
- className: o.replyButton,
34
- "data-no-expand": !0,
35
- size: "small",
36
- variant: "quaternary",
37
- onClick: c,
38
- children: l.formatMessage(e.reply)
39
- })]
59
+ ]
40
60
  });
41
61
  };
42
- export { o as n, s as t };
62
+ export { u as n, d as t };
@@ -7,56 +7,58 @@ import o from "clsx";
7
7
  import { useRef as s } from "react";
8
8
  import { jsx as c, jsxs as l } from "react/jsx-runtime";
9
9
  import '../styles/messages-view.css';var u = {
10
- messagesViewWrapper: "_messagesViewWrapper_1yvpu_4",
11
- overflowing: "_overflowing_1yvpu_9",
12
- scrollable: "_scrollable_1yvpu_9",
13
- withEditorBelow: "_withEditorBelow_1yvpu_12",
14
- messagesView: "_messagesView_1yvpu_4",
15
- repliesContainer: "_repliesContainer_1yvpu_52",
16
- messagesFade: "_messagesFade_1yvpu_58"
17
- }, d = ({ messages: d, isResolved: f = !1, resolvedBy: p, resolvedAt: m, onDelete: h, onThreadDelete: g, onAvatarClick: _, onCopyLink: v, onEdit: y, onResolve: b, onUnresolve: x, annotationTarget: S, onAnnotationBadgeClick: C, originalContentDeleted: w }) => {
18
- let { viewState: T, dispatch: E, isAnnotations: D } = t(), O = s(null), k = T !== e.Collapsed, A = T === e.Composing, j = d.length > 2, M = j && !k, { handleScroll: N, isOverflowing: P } = a({
10
+ messagesViewWrapper: "_messagesViewWrapper_ms46c_4",
11
+ overflowing: "_overflowing_ms46c_9",
12
+ scrollable: "_scrollable_ms46c_9",
13
+ withEditorBelow: "_withEditorBelow_ms46c_12",
14
+ messagesView: "_messagesView_ms46c_4",
15
+ repliesContainer: "_repliesContainer_ms46c_53",
16
+ messagesFade: "_messagesFade_ms46c_59"
17
+ }, d = ({ messages: d, isResolved: f = !1, resolvedBy: p, resolvedAt: m, onDelete: h, onThreadDelete: g, onAvatarClick: _, onCopyLink: v, onEdit: y, onEditError: b, onResolve: x, onUnresolve: S, userSelectorProps: C, annotationTarget: w, onAnnotationBadgeClick: T, originalContentDeleted: E }) => {
18
+ let { viewState: D, dispatch: O, isAnnotations: k } = t(), A = s(null), j = D !== e.Collapsed, M = D === e.Composing, N = d.length > 2, P = N && !j, { handleScroll: F, isOverflowing: I } = a({
19
19
  messageCount: d.length,
20
- containerRef: O,
21
- enabled: D,
22
- isExpanded: k,
23
- suppressAutoScroll: M
24
- }), F = d[0], I = d.slice(1), L = I.length >= 1, R = I[I.length - 1], z = I.slice(0, -1), B = j && !k;
25
- if (!F) return null;
26
- let V = z[z.length - 1]?.author, H = z.length >= 2 ? z[z.length - 2].author : void 0, U = () => E({ type: "EXPAND" });
20
+ containerRef: A,
21
+ enabled: k,
22
+ isExpanded: j,
23
+ suppressAutoScroll: P
24
+ }), L = d[0], R = d.slice(1), z = R.length >= 1, B = R[R.length - 1], V = R.slice(0, -1), H = N && !j;
25
+ if (!L) return null;
26
+ let U = V[V.length - 1]?.author, W = V.length >= 2 ? V[V.length - 2].author : void 0, G = () => O({ type: "EXPAND" });
27
27
  return /* @__PURE__ */ l("div", {
28
- className: o(u.messagesViewWrapper, P && u.overflowing, P && A && u.withEditorBelow),
28
+ className: o(u.messagesViewWrapper, I && u.overflowing, I && M && u.withEditorBelow),
29
29
  children: [/* @__PURE__ */ l("div", {
30
- ref: O,
31
- className: o(u.messagesView, D && u.scrollable),
32
- onScroll: N,
30
+ ref: A,
31
+ className: o(u.messagesView, k && u.scrollable),
32
+ onScroll: F,
33
33
  children: [
34
34
  /* @__PURE__ */ c(i, {
35
- ...F,
36
- hasReplies: L,
37
- showThreadedIndicator: L || f,
35
+ ...L,
36
+ hasReplies: z,
37
+ showThreadedIndicator: z || f,
38
38
  isResolved: f,
39
39
  onDelete: h,
40
40
  onThreadDelete: g,
41
41
  onAvatarClick: _,
42
42
  onCopyLink: v,
43
43
  onEdit: y,
44
- onResolve: b,
45
- onUnresolve: x,
44
+ onEditError: b,
45
+ onResolve: x,
46
+ onUnresolve: S,
46
47
  isFirstMessage: !0,
47
- annotationTarget: S,
48
- onAnnotationBadgeClick: C,
49
- originalContentDeleted: w
48
+ userSelectorProps: C,
49
+ annotationTarget: w,
50
+ onAnnotationBadgeClick: T,
51
+ originalContentDeleted: E
50
52
  }),
51
- B && V && /* @__PURE__ */ c(r, {
52
- lastUser: V,
53
- repliesCount: z.length,
54
- secondLastUser: H,
55
- onShowReplies: U
53
+ H && U && /* @__PURE__ */ c(r, {
54
+ lastUser: U,
55
+ repliesCount: V.length,
56
+ secondLastUser: W,
57
+ onShowReplies: G
56
58
  }),
57
- k && z.length > 0 && /* @__PURE__ */ c("div", {
59
+ j && V.length > 0 && /* @__PURE__ */ c("div", {
58
60
  className: u.repliesContainer,
59
- children: z.map((e) => /* @__PURE__ */ c(i, {
61
+ children: V.map((e) => /* @__PURE__ */ c(i, {
60
62
  ...e,
61
63
  showThreadedIndicator: !0,
62
64
  isResolved: f,
@@ -64,27 +66,31 @@ import '../styles/messages-view.css';var u = {
64
66
  onAvatarClick: _,
65
67
  onCopyLink: v,
66
68
  onEdit: y,
67
- onResolve: b,
68
- onUnresolve: x
69
+ onEditError: b,
70
+ onResolve: x,
71
+ onUnresolve: S,
72
+ userSelectorProps: C
69
73
  }, e.id))
70
74
  }),
71
- R && /* @__PURE__ */ c(i, {
72
- ...R,
75
+ B && /* @__PURE__ */ c(i, {
76
+ ...B,
73
77
  showThreadedIndicator: f,
74
78
  isResolved: f,
75
79
  onDelete: h,
76
80
  onAvatarClick: _,
77
81
  onCopyLink: v,
78
82
  onEdit: y,
79
- onResolve: b,
80
- onUnresolve: x
83
+ onEditError: b,
84
+ onResolve: x,
85
+ onUnresolve: S,
86
+ userSelectorProps: C
81
87
  }),
82
88
  f && p && m && /* @__PURE__ */ c(n, {
83
89
  authorName: p,
84
90
  createdAt: m
85
91
  })
86
92
  ]
87
- }), P && /* @__PURE__ */ c("div", { className: u.messagesFade })]
93
+ }), I && /* @__PURE__ */ c("div", { className: u.messagesFade })]
88
94
  });
89
95
  };
90
96
  export { d as t };
@@ -10,33 +10,39 @@ import '../styles/threaded-annotations2.css';var m = {
10
10
  threadedAnnotations: "_threadedAnnotations_1dfb0_1",
11
11
  expandable: "_expandable_1dfb0_10",
12
12
  annotations: "_annotations_1dfb0_13"
13
- }, h = ({ messages: r, isResolved: h = !1, resolvedBy: g, resolvedAt: _, onDelete: v, onThreadDelete: y, onAvatarClick: b, onCopyLink: x, onEdit: S, onResolve: C, onUnresolve: w, onPost: T, onPostError: E, userSelectorProps: D, onEditorOpenChange: O, annotationTarget: k, onAnnotationBadgeClick: A, originalContentDeleted: j }) => {
14
- let { viewState: M, dispatch: N, replyMention: P, isReplyDisabled: F, isAnnotations: I } = i(), L = d(null), R = M !== n.Collapsed, z = r.length > 2, B = M === n.Collapsed && (z || !F && !h);
13
+ }, h = ({ messages: r, isResolved: h = !1, resolvedBy: g, resolvedAt: _, onDelete: v, onThreadDelete: y, onAvatarClick: b, onCopyLink: x, onEdit: S, onEditError: C, onResolve: w, onUnresolve: T, onPost: E, onPostError: D, userSelectorProps: O, onEditorOpenChange: k, annotationTarget: A, onAnnotationBadgeClick: j, originalContentDeleted: M }) => {
14
+ let { viewState: N, dispatch: P, editingMessageId: F, replyMention: I, isReplyDisabled: L, isAnnotations: R } = i(), z = d(null), B = N !== n.Collapsed, V = r.length > 2, H = N === n.Collapsed && (V || !L && !h);
15
15
  l(() => {
16
- O?.(R);
17
- }, [R, O]), l(() => {
18
- if (!R) return;
16
+ F && !r.some((e) => e.id === F) && P({ type: "CLEAR_EDIT" });
17
+ }, [
18
+ F,
19
+ r,
20
+ P
21
+ ]), l(() => {
22
+ k?.(B);
23
+ }, [B, k]), l(() => {
24
+ if (!B) return;
19
25
  let t = `[${Object.keys(e)[0]}]`, n = (e) => {
20
26
  let n = e.target;
21
- L.current?.contains(n) || document.querySelector(t)?.contains(n) || N({ type: "COLLAPSE" });
27
+ z.current?.contains(n) || document.querySelector(t)?.contains(n) || P({ type: "COLLAPSE" });
22
28
  };
23
29
  return document.addEventListener("mousedown", n), () => document.removeEventListener("mousedown", n);
24
- }, [R, N]);
25
- let V = r.length === 0, H = c(() => N({ type: "CLEAR_MENTION" }), [N]), U = u(() => P ? o(P) : null, [P]), W = c((e) => {
26
- if (!B) return;
30
+ }, [B, P]);
31
+ let U = r.length === 0, W = c(() => P({ type: "CLEAR_MENTION" }), [P]), G = u(() => I ? o(I) : null, [I]), K = c((e) => {
32
+ if (!H) return;
27
33
  let t = e.target;
28
- !e.currentTarget.contains(t) || t.closest("[data-no-expand]") || N({ type: "EXPAND" });
29
- }, [B, N]);
30
- return I && V ? /* @__PURE__ */ f(t, {
31
- onPost: T,
32
- onPostError: E,
33
- onPostSuccess: H,
34
- userSelectorProps: D,
34
+ !e.currentTarget.contains(t) || t.closest("[data-no-expand]") || P({ type: "EXPAND" });
35
+ }, [H, P]);
36
+ return R && U ? /* @__PURE__ */ f(t, {
37
+ onPost: E,
38
+ onPostError: D,
39
+ onPostSuccess: W,
40
+ userSelectorProps: O,
35
41
  isFirstAnnotation: !0
36
42
  }) : /* @__PURE__ */ p("div", {
37
- ref: L,
38
- className: s(m.threadedAnnotations, B && m.expandable, I && m.annotations),
39
- onClick: B ? W : void 0,
43
+ ref: z,
44
+ className: s(m.threadedAnnotations, H && m.expandable, R && m.annotations),
45
+ onClick: H ? K : void 0,
40
46
  children: [/* @__PURE__ */ f(a, {
41
47
  messages: r,
42
48
  isResolved: h,
@@ -47,22 +53,25 @@ import '../styles/threaded-annotations2.css';var m = {
47
53
  onAvatarClick: b,
48
54
  onCopyLink: x,
49
55
  onEdit: S,
50
- onResolve: C,
51
- onUnresolve: w,
52
- annotationTarget: k,
53
- onAnnotationBadgeClick: A,
54
- originalContentDeleted: j
55
- }), M === n.Composing && /* @__PURE__ */ f(t, {
56
- onPost: T,
57
- onPostError: E,
58
- onPostSuccess: H,
59
- initialContent: U,
60
- userSelectorProps: D
56
+ onEditError: C,
57
+ onResolve: w,
58
+ onUnresolve: T,
59
+ userSelectorProps: O,
60
+ annotationTarget: A,
61
+ onAnnotationBadgeClick: j,
62
+ originalContentDeleted: M
63
+ }), N === n.Composing && /* @__PURE__ */ f(t, {
64
+ onPost: E,
65
+ onPostError: D,
66
+ onPostSuccess: W,
67
+ initialContent: G,
68
+ userSelectorProps: O
61
69
  })]
62
70
  });
63
71
  }, g = (e) => /* @__PURE__ */ f(r, {
64
72
  defaultExpanded: e.messages.length === 0,
65
73
  isReplyDisabled: e.isReplyDisabled || e.isResolved,
74
+ isEditDisabled: e.isEditDisabled || e.isResolved,
66
75
  isAnnotations: e.isAnnotations,
67
76
  collapsed: e.collapsed,
68
77
  children: /* @__PURE__ */ f(h, { ...e })
@@ -73,7 +73,7 @@ var D = (c) => {
73
73
  });
74
74
  }, [O]);
75
75
  let fe = /* @__PURE__ */ S("div", { className: d.anchorElement });
76
- return G ? /* @__PURE__ */ S("div", {
76
+ return /* @__PURE__ */ S("div", {
77
77
  "data-no-expand": !0,
78
78
  className: d.messageEditorWrapper,
79
79
  children: /* @__PURE__ */ C("div", {
@@ -157,6 +157,6 @@ var D = (c) => {
157
157
  })
158
158
  })]
159
159
  })
160
- }) : null;
160
+ });
161
161
  }, O = (e) => /* @__PURE__ */ S(c, { children: /* @__PURE__ */ S(D, { ...e }) });
162
162
  export { O as MessageEditor, g as MessageEditorVariant };
@@ -4,6 +4,10 @@ var t = e({
4
4
  id: "groupSharedFeatures.threadedAnnotations.annotationMessageAriaLabel",
5
5
  defaultMessage: "Annotation message"
6
6
  },
7
+ edited: {
8
+ id: "groupSharedFeatures.threadedAnnotations.edited",
9
+ defaultMessage: "(Edited)"
10
+ },
7
11
  reply: {
8
12
  id: "groupSharedFeatures.threadedAnnotations.reply",
9
13
  defaultMessage: "Reply"
@@ -1,60 +1,70 @@
1
- import { useThreadedAnnotationsContext as e } from "../../../v2/threaded-annotations-context.js";
2
- import { t } from "../../../../../chunks/annotation-badge.js";
3
- import { MessageHeader as n } from "../message-header/message-header.js";
4
- import r from "./messages.js";
5
- import { n as i, t as a } from "../../../../../chunks/message-footer.js";
6
- import { MessageRenderer as o } from "./subcomponents/message-renderer.js";
7
- import s from "clsx";
8
- import { useIntl as c } from "react-intl";
9
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
10
- var d = ({ id: d, author: f, message: p, createdAt: m, permissions: h, showThreadedIndicator: g = !0, isResolved: _ = !1, isFirstMessage: v = !1, hasReplies: y = !1, onAvatarClick: b, onCopyLink: x, onDelete: S, onThreadDelete: C, onEdit: w, onResolve: T, onUnresolve: E, annotationTarget: D, onAnnotationBadgeClick: O, originalContentDeleted: k }) => {
11
- let { canResolve: A, canEdit: j, canDelete: M } = h, N = c(), { dispatch: P, isReplyDisabled: F, isAnnotations: I } = e();
12
- return /* @__PURE__ */ u("div", {
13
- "aria-label": N.formatMessage(r.annotationMessageAriaLabel),
14
- className: i.textMessage,
1
+ import { MessageEditorVariant as e } from "../message-editor/message-editor.types.js";
2
+ import { MessageEditor as t } from "../message-editor/message-editor.js";
3
+ import { useThreadedAnnotationsContext as n } from "../../../v2/threaded-annotations-context.js";
4
+ import { t as r } from "../../../../../chunks/annotation-badge.js";
5
+ import { MessageHeader as i } from "../message-header/message-header.js";
6
+ import a from "./messages.js";
7
+ import { n as o, t as s } from "../../../../../chunks/message-footer.js";
8
+ import { MessageRenderer as c } from "./subcomponents/message-renderer.js";
9
+ import l from "clsx";
10
+ import { useIntl as u } from "react-intl";
11
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
12
+ var m = ({ id: m, author: h, message: g, createdAt: _, updatedAt: v, permissions: y, showThreadedIndicator: b = !0, isResolved: x = !1, isFirstMessage: S = !1, hasReplies: C = !1, onAvatarClick: w, onCopyLink: T, onDelete: E, onThreadDelete: D, onEdit: O, onEditError: k, onResolve: A, onUnresolve: j, userSelectorProps: M, annotationTarget: N, onAnnotationBadgeClick: P, originalContentDeleted: F }) => {
13
+ let { canResolve: I, canEdit: L, canDelete: R } = y, z = u(), { dispatch: B, isReplyDisabled: V, isEditDisabled: H, isAnnotations: U, editingMessageId: W } = n(), G = W === m, K = !!O && !H && L;
14
+ return /* @__PURE__ */ p("div", {
15
+ "aria-label": z.formatMessage(a.annotationMessageAriaLabel),
16
+ className: o.textMessage,
15
17
  "data-message-wrapper": !0,
16
- children: [/* @__PURE__ */ l(n, {
17
- author: f,
18
- canResolve: A,
19
- isResolved: _,
20
- canDelete: M,
21
- canEdit: j,
22
- hasReplies: y,
23
- isFirstMessage: v,
24
- onAvatarClick: b,
25
- onCopyLink: x ? () => x(d) : void 0,
26
- onDelete: () => S(d),
27
- onThreadDelete: C,
28
- onEdit: w ? () => w(d) : void 0,
29
- onResolve: T ? () => T(d) : void 0,
30
- onUnresolve: E ? () => E(d) : void 0
31
- }), /* @__PURE__ */ u("div", {
32
- className: i.contentWrapper,
33
- children: [/* @__PURE__ */ l("div", { className: s(i.threadedIndicator, !g && i.threadedIndicatorHidden) }), /* @__PURE__ */ u("div", {
34
- className: i.messageContent,
35
- children: [
36
- D && !I && /* @__PURE__ */ l("div", {
37
- className: i.annotationBadgeWrapper,
38
- children: /* @__PURE__ */ l(t, {
39
- annotationTarget: D,
40
- onClick: () => O?.(d),
41
- originalContentDeleted: k
42
- })
43
- }),
44
- /* @__PURE__ */ l("div", {
45
- className: i.rendererWrapper,
46
- children: /* @__PURE__ */ l(o, { messageObject: p })
47
- }),
48
- /* @__PURE__ */ l(a, {
49
- createdAt: m,
50
- onReply: F ? void 0 : () => P({
51
- type: "REPLY",
52
- author: f
53
- })
18
+ children: [/* @__PURE__ */ f(i, {
19
+ author: h,
20
+ canResolve: I,
21
+ isResolved: x,
22
+ canDelete: R,
23
+ canEdit: K,
24
+ hasReplies: C,
25
+ isFirstMessage: S,
26
+ onAvatarClick: w,
27
+ onCopyLink: T ? () => T(m) : void 0,
28
+ onDelete: () => E(m),
29
+ onThreadDelete: D,
30
+ onEdit: K ? () => B({
31
+ type: "EDIT",
32
+ id: m
33
+ }) : void 0,
34
+ onResolve: A ? () => A(m) : void 0,
35
+ onUnresolve: j ? () => j(m) : void 0
36
+ }), /* @__PURE__ */ p("div", {
37
+ className: o.contentWrapper,
38
+ children: [/* @__PURE__ */ f("div", { className: l(o.threadedIndicator, !b && o.threadedIndicatorHidden) }), /* @__PURE__ */ p("div", {
39
+ className: o.messageContent,
40
+ children: [N && !U && /* @__PURE__ */ f("div", {
41
+ className: o.annotationBadgeWrapper,
42
+ children: /* @__PURE__ */ f(r, {
43
+ annotationTarget: N,
44
+ onClick: () => P?.(m),
45
+ originalContentDeleted: F
54
46
  })
55
- ]
47
+ }), G && O ? /* @__PURE__ */ f(t, {
48
+ initialContent: g,
49
+ onEditCancel: () => B({ type: "CLEAR_EDIT" }),
50
+ onEditSuccess: () => B({ type: "CLEAR_EDIT" }),
51
+ onSave: (e) => O(m, e),
52
+ onSaveError: k,
53
+ userSelectorProps: M,
54
+ variant: e.EDIT_MESSAGE
55
+ }) : /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("div", {
56
+ className: o.rendererWrapper,
57
+ children: /* @__PURE__ */ f(c, { messageObject: g })
58
+ }), /* @__PURE__ */ f(s, {
59
+ createdAt: _,
60
+ onReply: V ? void 0 : () => B({
61
+ type: "REPLY",
62
+ author: h
63
+ }),
64
+ updatedAt: v
65
+ })] })]
56
66
  })]
57
67
  })]
58
68
  });
59
69
  };
60
- export { d as TextMessage };
70
+ export { m as TextMessage };
@@ -174,12 +174,12 @@ var t = [
174
174
  }]
175
175
  }, r = {
176
176
  canResolve: !1,
177
- canEdit: !1,
177
+ canEdit: !0,
178
178
  canDelete: !0,
179
179
  canReply: !0
180
180
  }, i = {
181
181
  canResolve: !0,
182
- canEdit: !1,
182
+ canEdit: !0,
183
183
  canDelete: !0,
184
184
  canReply: !0
185
185
  }, a = (e, t, n, i = r) => ({
@@ -2,43 +2,55 @@ import { createContext as e, useCallback as t, useContext as n, useEffect as r,
2
2
  import { jsx as o } from "react/jsx-runtime";
3
3
  var s = /* @__PURE__ */ function(e) {
4
4
  return e.Collapsed = "collapsed", e.RepliesOnly = "repliesOnly", e.Composing = "composing", e;
5
- }({}), c = /* @__PURE__ */ e(void 0), l = ({ children: e, defaultExpanded: n = !1, isReplyDisabled: l = !1, collapsed: u = !1, isAnnotations: d = !1 }) => {
6
- let [f, p] = a(() => n ? l ? s.RepliesOnly : s.Composing : s.Collapsed), [m, h] = a(null);
5
+ }({}), c = /* @__PURE__ */ e(void 0), l = ({ children: e, defaultExpanded: n = !1, isReplyDisabled: l = !1, isEditDisabled: u = !1, collapsed: d = !1, isAnnotations: f = !1 }) => {
6
+ let [p, m] = a(() => n ? l ? s.RepliesOnly : s.Composing : s.Collapsed), [h, g] = a(null), [_, v] = a(null);
7
7
  r(() => {
8
- l ? (p((e) => e === s.Composing ? s.Collapsed : e), h(null)) : p((e) => e === s.RepliesOnly ? s.Composing : e);
8
+ l ? (m((e) => e === s.Composing ? s.Collapsed : e), g(null)) : m((e) => e === s.RepliesOnly ? s.Composing : e);
9
9
  }, [l]), r(() => {
10
- u && (p(s.Collapsed), h(null));
11
- }, [u]);
12
- let g = t((e) => {
10
+ u && v(null);
11
+ }, [u]), r(() => {
12
+ d && (m(s.Collapsed), g(null), v(null));
13
+ }, [d]);
14
+ let y = t((e) => {
13
15
  switch (e.type) {
14
16
  case "EXPAND":
15
- p((e) => e === s.Collapsed ? l ? s.RepliesOnly : s.Composing : e);
17
+ m((e) => e === s.Collapsed ? l ? s.RepliesOnly : s.Composing : e);
16
18
  break;
17
19
  case "REPLY":
18
- l || (h(e.author), p(s.Composing));
20
+ l || (g(e.author), m(s.Composing));
21
+ break;
22
+ case "EDIT":
23
+ u || v(e.id);
24
+ break;
25
+ case "CLEAR_EDIT":
26
+ v(null);
19
27
  break;
20
28
  case "COLLAPSE":
21
- p(s.Collapsed), h(null);
29
+ m(s.Collapsed), g(null), v(null);
22
30
  break;
23
31
  case "CLEAR_MENTION":
24
- h(null);
32
+ g(null);
25
33
  break;
26
34
  }
27
- }, [l]), _ = i(() => ({
28
- viewState: f,
29
- replyMention: m,
30
- isAnnotations: d,
35
+ }, [l, u]), b = i(() => ({
36
+ viewState: p,
37
+ replyMention: h,
38
+ editingMessageId: _,
39
+ isAnnotations: f,
31
40
  isReplyDisabled: l,
32
- dispatch: g
41
+ isEditDisabled: u,
42
+ dispatch: y
33
43
  }), [
44
+ p,
45
+ h,
46
+ _,
34
47
  f,
35
- m,
36
- d,
37
48
  l,
38
- g
49
+ u,
50
+ y
39
51
  ]);
40
52
  return /* @__PURE__ */ o(c.Provider, {
41
- value: _,
53
+ value: b,
42
54
  children: e
43
55
  });
44
56
  }, u = () => {
@@ -1,3 +1,2 @@
1
- import "../components/v2/message-editor/message-editor.js";
2
1
  import { t as e } from "../../../chunks/threaded-annotations2.js";
3
2
  export { e as ThreadedAnnotations };
@@ -11,6 +11,7 @@ export default {
11
11
  "groupSharedFeatures.threadedAnnotations.deleteConfirmation": "নিশ্চিতকরণ মুছুন",
12
12
  "groupSharedFeatures.threadedAnnotations.deleteQuestion": "Delete this {type, select, annotation {annotation} other {comment}}{hasReplies, select, true { and replies} other {}}? This action can't be undone.",
13
13
  "groupSharedFeatures.threadedAnnotations.edit": "সম্পাদনা করুন",
14
+ "groupSharedFeatures.threadedAnnotations.edited": "(Edited)",
14
15
  "groupSharedFeatures.threadedAnnotations.hideReplies": "উত্তর লুকান",
15
16
  "groupSharedFeatures.threadedAnnotations.markedAsResolved": "সমাধান করা হয়েছে হিসাবে চিহ্নিত করা হয়েছে",
16
17
  "groupSharedFeatures.threadedAnnotations.messageEditor.cancel": "বাতিল করুন",
@@ -11,6 +11,7 @@ export default {
11
11
  "groupSharedFeatures.threadedAnnotations.deleteConfirmation": "Bekræft sletning",
12
12
  "groupSharedFeatures.threadedAnnotations.deleteQuestion": "Delete this {type, select, annotation {annotation} other {comment}}{hasReplies, select, true { and replies} other {}}? This action can't be undone.",
13
13
  "groupSharedFeatures.threadedAnnotations.edit": "Rediger",
14
+ "groupSharedFeatures.threadedAnnotations.edited": "(Edited)",
14
15
  "groupSharedFeatures.threadedAnnotations.hideReplies": "Skjul svar",
15
16
  "groupSharedFeatures.threadedAnnotations.markedAsResolved": "markeret som løst",
16
17
  "groupSharedFeatures.threadedAnnotations.messageEditor.cancel": "Annuller",
@@ -11,6 +11,7 @@ export default {
11
11
  "groupSharedFeatures.threadedAnnotations.deleteConfirmation": "Löschbestätigung",
12
12
  "groupSharedFeatures.threadedAnnotations.deleteQuestion": "Delete this {type, select, annotation {annotation} other {comment}}{hasReplies, select, true { and replies} other {}}? This action can't be undone.",
13
13
  "groupSharedFeatures.threadedAnnotations.edit": "Bearbeiten",
14
+ "groupSharedFeatures.threadedAnnotations.edited": "(Edited)",
14
15
  "groupSharedFeatures.threadedAnnotations.hideReplies": "Antworten ausblenden",
15
16
  "groupSharedFeatures.threadedAnnotations.markedAsResolved": "Als gelöst markiert",
16
17
  "groupSharedFeatures.threadedAnnotations.messageEditor.cancel": "Abbrechen",
@@ -11,6 +11,7 @@ export default {
11
11
  "groupSharedFeatures.threadedAnnotations.deleteConfirmation": "Delete confirmation",
12
12
  "groupSharedFeatures.threadedAnnotations.deleteQuestion": "Delete this {type, select, annotation {annotation} other {comment}}{hasReplies, select, true { and replies} other {}}? This action can't be undone.",
13
13
  "groupSharedFeatures.threadedAnnotations.edit": "Edit",
14
+ "groupSharedFeatures.threadedAnnotations.edited": "(Edited)",
14
15
  "groupSharedFeatures.threadedAnnotations.hideReplies": "Hide replies",
15
16
  "groupSharedFeatures.threadedAnnotations.markedAsResolved": "marked as resolved",
16
17
  "groupSharedFeatures.threadedAnnotations.messageEditor.cancel": "Cancel",
@@ -11,6 +11,7 @@ export default {
11
11
  "groupSharedFeatures.threadedAnnotations.deleteConfirmation": "Delete confirmation",
12
12
  "groupSharedFeatures.threadedAnnotations.deleteQuestion": "Delete this {type, select, annotation {annotation} other {comment}}{hasReplies, select, true { and replies} other {}}? This action can't be undone.",
13
13
  "groupSharedFeatures.threadedAnnotations.edit": "Edit",
14
+ "groupSharedFeatures.threadedAnnotations.edited": "(Edited)",
14
15
  "groupSharedFeatures.threadedAnnotations.hideReplies": "Hide replies",
15
16
  "groupSharedFeatures.threadedAnnotations.markedAsResolved": "marked as resolved",
16
17
  "groupSharedFeatures.threadedAnnotations.messageEditor.cancel": "Cancel",
@@ -11,6 +11,7 @@ export default {
11
11
  "groupSharedFeatures.threadedAnnotations.deleteConfirmation": "Delete confirmation",
12
12
  "groupSharedFeatures.threadedAnnotations.deleteQuestion": "Delete this {type, select, annotation {annotation} other {comment}}{hasReplies, select, true { and replies} other {}}? This action can't be undone.",
13
13
  "groupSharedFeatures.threadedAnnotations.edit": "Edit",
14
+ "groupSharedFeatures.threadedAnnotations.edited": "(Edited)",
14
15
  "groupSharedFeatures.threadedAnnotations.hideReplies": "Hide replies",
15
16
  "groupSharedFeatures.threadedAnnotations.markedAsResolved": "marked as resolved",
16
17
  "groupSharedFeatures.threadedAnnotations.messageEditor.cancel": "Cancel",
@@ -11,6 +11,7 @@ export default {
11
11
  "groupSharedFeatures.threadedAnnotations.deleteConfirmation": "Delete confirmation",
12
12
  "groupSharedFeatures.threadedAnnotations.deleteQuestion": "Delete this {type, select, annotation {annotation} other {comment}}{hasReplies, select, true { and replies} other {}}? This action can't be undone.",
13
13
  "groupSharedFeatures.threadedAnnotations.edit": "Edit",
14
+ "groupSharedFeatures.threadedAnnotations.edited": "(Edited)",
14
15
  "groupSharedFeatures.threadedAnnotations.hideReplies": "Hide replies",
15
16
  "groupSharedFeatures.threadedAnnotations.markedAsResolved": "marked as resolved",
16
17
  "groupSharedFeatures.threadedAnnotations.messageEditor.cancel": "Cancel",