@box/threaded-annotations 1.84.13 → 1.85.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 (46) hide show
  1. package/dist/chunks/delete-confirmation-popover.js +16 -13
  2. package/dist/chunks/messages-view.js +41 -37
  3. package/dist/chunks/threaded-annotations2.js +32 -31
  4. package/dist/esm/lib/components/v2/message-header/message-header.js +63 -53
  5. package/dist/esm/lib/components/v2/message-header/message-options-menu.js +29 -26
  6. package/dist/esm/lib/components/v2/message-header/messages.js +7 -3
  7. package/dist/esm/lib/components/v2/text-message/text-message.js +19 -17
  8. package/dist/i18n/bn-IN.js +4 -2
  9. package/dist/i18n/da-DK.js +4 -2
  10. package/dist/i18n/de-DE.js +4 -2
  11. package/dist/i18n/en-AU.js +4 -2
  12. package/dist/i18n/en-CA.js +4 -2
  13. package/dist/i18n/en-GB.js +4 -2
  14. package/dist/i18n/en-US.js +2 -1
  15. package/dist/i18n/en-US.properties +6 -4
  16. package/dist/i18n/en-x-pseudo.js +44 -42
  17. package/dist/i18n/en-x-pseudo.properties +42 -42
  18. package/dist/i18n/es-419.js +4 -2
  19. package/dist/i18n/es-ES.js +4 -2
  20. package/dist/i18n/fi-FI.js +4 -2
  21. package/dist/i18n/fr-CA.js +4 -2
  22. package/dist/i18n/fr-FR.js +4 -2
  23. package/dist/i18n/hi-IN.js +4 -2
  24. package/dist/i18n/it-IT.js +4 -2
  25. package/dist/i18n/ja-JP.js +4 -2
  26. package/dist/i18n/json/src/lib/components/v2/message-header/messages.json +1 -1
  27. package/dist/i18n/ko-KR.js +4 -2
  28. package/dist/i18n/nb-NO.js +4 -2
  29. package/dist/i18n/nl-NL.js +4 -2
  30. package/dist/i18n/pl-PL.js +4 -2
  31. package/dist/i18n/pt-BR.js +4 -2
  32. package/dist/i18n/ru-RU.js +4 -2
  33. package/dist/i18n/sv-SE.js +4 -2
  34. package/dist/i18n/tr-TR.js +4 -2
  35. package/dist/i18n/zh-CN.js +4 -2
  36. package/dist/i18n/zh-TW.js +4 -2
  37. package/dist/types/lib/components/v2/message-header/delete-confirmation-popover.d.ts +5 -1
  38. package/dist/types/lib/components/v2/message-header/message-header.d.ts +9 -5
  39. package/dist/types/lib/components/v2/message-header/message-options-menu.d.ts +5 -3
  40. package/dist/types/lib/components/v2/message-header/messages.d.ts +6 -1
  41. package/dist/types/lib/components/v2/messages-view/messages-view.d.ts +2 -1
  42. package/dist/types/lib/components/v2/text-message/text-message.d.ts +4 -1
  43. package/dist/types/lib/v2/stories/shared.d.ts +1 -0
  44. package/dist/types/lib/v2/test-utils/test-selectors.d.ts +1 -0
  45. package/dist/types/lib/v2/threaded-annotations.d.ts +5 -0
  46. package/package.json +12 -12
@@ -14,42 +14,45 @@ import '../styles/delete-confirmation-popover.css';var c = {
14
14
  optionsMenu: "_optionsMenu_1u78f_35",
15
15
  deletePopoverAnchorWrapper: "_deletePopoverAnchorWrapper_1u78f_54",
16
16
  deletePopoverAnchor: "_deletePopoverAnchor_1u78f_54"
17
- }, u = ({ open: u, onOpenChange: d, onConfirm: f, onCancel: p }) => {
18
- let m = a();
17
+ }, u = ({ hasReplies: u = !1, isAnnotation: d = !1, open: f, onOpenChange: p, onConfirm: m, onCancel: h }) => {
18
+ let g = a();
19
19
  return /* @__PURE__ */ o("div", {
20
20
  className: l.deletePopoverAnchorWrapper,
21
21
  children: /* @__PURE__ */ s(r.Root, {
22
22
  modal: !1,
23
- onOpenChange: d,
24
- open: u,
23
+ onOpenChange: p,
24
+ open: f,
25
25
  children: [/* @__PURE__ */ o(r.Anchor, { children: /* @__PURE__ */ o(i, {
26
26
  as: "span",
27
27
  className: l.deletePopoverAnchor
28
28
  }) }), /* @__PURE__ */ s(r.ContentContainer, {
29
29
  ...e,
30
30
  align: "end",
31
- "aria-label": m.formatMessage(t.deleteConfirmation),
31
+ "aria-label": g.formatMessage(t.deleteConfirmation),
32
32
  className: c.deletePopover,
33
33
  side: "bottom",
34
34
  children: [/* @__PURE__ */ o(r.MainContent, { children: /* @__PURE__ */ o(i, {
35
35
  as: "p",
36
36
  color: "textOnLightDefault",
37
37
  variant: "bodyDefault",
38
- children: m.formatMessage(t.deleteCommentQuestion)
38
+ children: g.formatMessage(t.deleteQuestion, {
39
+ hasReplies: u ? "true" : "false",
40
+ type: d ? "annotation" : "comment"
41
+ })
39
42
  }) }), /* @__PURE__ */ s(r.Footer, {
40
43
  className: c.footer,
41
44
  children: [/* @__PURE__ */ o(n, {
42
- "aria-label": m.formatMessage(t.cancelDeleteButtonAriaLabel),
43
- onClick: p,
45
+ "aria-label": g.formatMessage(t.cancelDeleteButtonAriaLabel),
46
+ onClick: h,
44
47
  size: "small",
45
48
  variant: "secondary",
46
- children: m.formatMessage(t.deleteCancel)
49
+ children: g.formatMessage(t.deleteCancel)
47
50
  }), /* @__PURE__ */ o(n, {
48
- "aria-label": m.formatMessage(t.deleteButtonAriaLabel),
49
- onClick: f,
51
+ "aria-label": g.formatMessage(t.deleteButtonAriaLabel),
52
+ onClick: m,
50
53
  size: "small",
51
- variant: "primary",
52
- children: m.formatMessage(t.delete)
54
+ variant: "destructive",
55
+ children: g.formatMessage(t.delete)
53
56
  })]
54
57
  })]
55
58
  })]
@@ -14,73 +14,77 @@ import '../styles/messages-view.css';var u = {
14
14
  messagesView: "_messagesView_1yvpu_4",
15
15
  repliesContainer: "_repliesContainer_1yvpu_52",
16
16
  messagesFade: "_messagesFade_1yvpu_58"
17
- }, d = ({ messages: d, isResolved: f = !1, resolvedBy: p, resolvedAt: m, onDelete: h, onThreadDelete: g, onAvatarClick: _, onEdit: v, onResolve: y, onUnresolve: b, annotationTarget: x, onAnnotationBadgeClick: S, originalContentDeleted: C }) => {
18
- let { viewState: w, dispatch: T, isAnnotations: E } = t(), D = s(null), O = w !== e.Collapsed, k = w === e.Composing, A = d.length > 2, j = A && !O, { handleScroll: M, isOverflowing: N } = a({
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({
19
19
  messageCount: d.length,
20
- containerRef: D,
21
- enabled: E,
22
- isExpanded: O,
23
- suppressAutoScroll: j
24
- }), P = d[0], F = d.slice(1), I = F.length >= 1, L = F[F.length - 1], R = F.slice(0, -1), z = A && !O;
25
- if (!P) return null;
26
- let B = R[R.length - 1]?.author, V = R.length >= 2 ? R[R.length - 2].author : void 0, H = () => T({ type: "EXPAND" });
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" });
27
27
  return /* @__PURE__ */ l("div", {
28
- className: o(u.messagesViewWrapper, N && u.overflowing, N && k && u.withEditorBelow),
28
+ className: o(u.messagesViewWrapper, P && u.overflowing, P && A && u.withEditorBelow),
29
29
  children: [/* @__PURE__ */ l("div", {
30
- ref: D,
31
- className: o(u.messagesView, E && u.scrollable),
32
- onScroll: M,
30
+ ref: O,
31
+ className: o(u.messagesView, D && u.scrollable),
32
+ onScroll: N,
33
33
  children: [
34
34
  /* @__PURE__ */ c(i, {
35
- ...P,
36
- showThreadedIndicator: I || f,
35
+ ...F,
36
+ hasReplies: L,
37
+ showThreadedIndicator: L || f,
37
38
  isResolved: f,
38
39
  onDelete: h,
39
40
  onThreadDelete: g,
40
41
  onAvatarClick: _,
41
- onEdit: v,
42
- onResolve: y,
43
- onUnresolve: b,
42
+ onCopyLink: v,
43
+ onEdit: y,
44
+ onResolve: b,
45
+ onUnresolve: x,
44
46
  isFirstMessage: !0,
45
- annotationTarget: x,
46
- onAnnotationBadgeClick: S,
47
- originalContentDeleted: C
47
+ annotationTarget: S,
48
+ onAnnotationBadgeClick: C,
49
+ originalContentDeleted: w
48
50
  }),
49
- z && B && /* @__PURE__ */ c(r, {
50
- lastUser: B,
51
- repliesCount: R.length,
52
- secondLastUser: V,
53
- onShowReplies: H
51
+ B && V && /* @__PURE__ */ c(r, {
52
+ lastUser: V,
53
+ repliesCount: z.length,
54
+ secondLastUser: H,
55
+ onShowReplies: U
54
56
  }),
55
- O && R.length > 0 && /* @__PURE__ */ c("div", {
57
+ k && z.length > 0 && /* @__PURE__ */ c("div", {
56
58
  className: u.repliesContainer,
57
- children: R.map((e) => /* @__PURE__ */ c(i, {
59
+ children: z.map((e) => /* @__PURE__ */ c(i, {
58
60
  ...e,
59
61
  showThreadedIndicator: !0,
60
62
  isResolved: f,
61
63
  onDelete: h,
62
64
  onAvatarClick: _,
63
- onEdit: v,
64
- onResolve: y,
65
- onUnresolve: b
65
+ onCopyLink: v,
66
+ onEdit: y,
67
+ onResolve: b,
68
+ onUnresolve: x
66
69
  }, e.id))
67
70
  }),
68
- L && /* @__PURE__ */ c(i, {
69
- ...L,
71
+ R && /* @__PURE__ */ c(i, {
72
+ ...R,
70
73
  showThreadedIndicator: f,
71
74
  isResolved: f,
72
75
  onDelete: h,
73
76
  onAvatarClick: _,
74
- onEdit: v,
75
- onResolve: y,
76
- onUnresolve: b
77
+ onCopyLink: v,
78
+ onEdit: y,
79
+ onResolve: b,
80
+ onUnresolve: x
77
81
  }),
78
82
  f && p && m && /* @__PURE__ */ c(n, {
79
83
  authorName: p,
80
84
  createdAt: m
81
85
  })
82
86
  ]
83
- }), N && /* @__PURE__ */ c("div", { className: u.messagesFade })]
87
+ }), P && /* @__PURE__ */ c("div", { className: u.messagesFade })]
84
88
  });
85
89
  };
86
90
  export { d as t };
@@ -10,33 +10,33 @@ 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, onEdit: x, onResolve: S, onUnresolve: C, onPost: w, onPostError: T, userSelectorProps: E, onEditorOpenChange: D, annotationTarget: O, onAnnotationBadgeClick: k, originalContentDeleted: A }) => {
14
- let { viewState: j, dispatch: M, replyMention: N, isReplyDisabled: P, isAnnotations: F } = i(), I = d(null), L = j !== n.Collapsed, R = r.length > 2, z = j === n.Collapsed && (R || !P && !h);
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);
15
15
  l(() => {
16
- D?.(L);
17
- }, [L, D]), l(() => {
18
- if (!L) return;
16
+ O?.(R);
17
+ }, [R, O]), l(() => {
18
+ if (!R) return;
19
19
  let t = `[${Object.keys(e)[0]}]`, n = (e) => {
20
20
  let n = e.target;
21
- I.current?.contains(n) || document.querySelector(t)?.contains(n) || M({ type: "COLLAPSE" });
21
+ L.current?.contains(n) || document.querySelector(t)?.contains(n) || N({ type: "COLLAPSE" });
22
22
  };
23
23
  return document.addEventListener("mousedown", n), () => document.removeEventListener("mousedown", n);
24
- }, [L, M]);
25
- let B = r.length === 0, V = c(() => M({ type: "CLEAR_MENTION" }), [M]), H = u(() => N ? o(N) : null, [N]), U = c((e) => {
26
- if (!z) return;
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;
27
27
  let t = e.target;
28
- !e.currentTarget.contains(t) || t.closest("[data-no-expand]") || M({ type: "EXPAND" });
29
- }, [z, M]);
30
- return F && B ? /* @__PURE__ */ f(t, {
31
- onPost: w,
32
- onPostError: T,
33
- onPostSuccess: V,
34
- userSelectorProps: E,
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,
35
35
  isFirstAnnotation: !0
36
36
  }) : /* @__PURE__ */ p("div", {
37
- ref: I,
38
- className: s(m.threadedAnnotations, z && m.expandable, F && m.annotations),
39
- onClick: z ? U : void 0,
37
+ ref: L,
38
+ className: s(m.threadedAnnotations, B && m.expandable, I && m.annotations),
39
+ onClick: B ? W : void 0,
40
40
  children: [/* @__PURE__ */ f(a, {
41
41
  messages: r,
42
42
  isResolved: h,
@@ -45,18 +45,19 @@ import '../styles/threaded-annotations2.css';var m = {
45
45
  onDelete: v,
46
46
  onThreadDelete: y,
47
47
  onAvatarClick: b,
48
- onEdit: x,
49
- onResolve: S,
50
- onUnresolve: C,
51
- annotationTarget: O,
52
- onAnnotationBadgeClick: k,
53
- originalContentDeleted: A
54
- }), j === n.Composing && /* @__PURE__ */ f(t, {
55
- onPost: w,
56
- onPostError: T,
57
- onPostSuccess: V,
58
- initialContent: H,
59
- userSelectorProps: E
48
+ onCopyLink: x,
49
+ 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
60
61
  })]
61
62
  });
62
63
  }, g = (e) => /* @__PURE__ */ f(r, {
@@ -1,74 +1,84 @@
1
- import { UserAvatarButton as e } from "../user-avatar/user-avatar.js";
2
- import { n as t, t as n } from "../../../../../chunks/delete-confirmation-popover.js";
3
- import r from "./messages.js";
4
- import { MessageOptionsMenu as i } from "./message-options-menu.js";
5
- import { IconButton as a, Text as o } from "@box/blueprint-web";
6
- import { useState as s } from "react";
7
- import { useIntl as c } from "react-intl";
8
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
9
- import { ArrowBack as d, CheckmarkCircle as f } from "@box/blueprint-web-assets/icons/Medium";
10
- var p = ({ author: p, canResolve: m = !1, isResolved: h = !1, canEdit: g = !0, canDelete: _ = !0, isFirstMessage: v = !1, onAvatarClick: y, onEdit: b, onResolve: x, onUnresolve: S, onDelete: C, onThreadDelete: w }) => {
11
- let T = c(), [E, D] = s(!1), [O, k] = s(!1);
12
- return /* @__PURE__ */ u("div", {
13
- className: t.headerContainer,
14
- children: [/* @__PURE__ */ u("div", {
15
- className: t.information,
16
- children: [/* @__PURE__ */ l(e, {
17
- onClick: y,
18
- user: p
19
- }), /* @__PURE__ */ l("div", {
1
+ import { useThreadedAnnotationsContext as e } from "../../../v2/threaded-annotations-context.js";
2
+ import { UserAvatarButton as t } from "../user-avatar/user-avatar.js";
3
+ import { n, t as r } from "../../../../../chunks/delete-confirmation-popover.js";
4
+ import i from "./messages.js";
5
+ import { MessageOptionsMenu as a } from "./message-options-menu.js";
6
+ import { IconButton as o, Text as s, Tooltip as c } from "@box/blueprint-web";
7
+ import { useState as l } from "react";
8
+ import { useIntl as u } from "react-intl";
9
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
10
+ import { ArrowBack as p, CheckmarkCircle as m } from "@box/blueprint-web-assets/icons/Medium";
11
+ var h = ({ author: h, canResolve: g = !1, isResolved: _ = !1, canEdit: v = !0, canDelete: y = !0, hasReplies: b = !1, isFirstMessage: x = !1, onAvatarClick: S, onCopyLink: C, onDelete: w, onEdit: T, onResolve: E, onThreadDelete: D, onUnresolve: O }) => {
12
+ let k = u(), { isAnnotations: A } = e(), [j, M] = l(!1), [N, P] = l(!1);
13
+ return /* @__PURE__ */ f("div", {
14
+ className: n.headerContainer,
15
+ children: [/* @__PURE__ */ f("div", {
16
+ className: n.information,
17
+ children: [/* @__PURE__ */ d(t, {
18
+ onClick: S,
19
+ user: h
20
+ }), /* @__PURE__ */ d("div", {
20
21
  "data-no-expand": !0,
21
- className: t.textContainer,
22
- children: /* @__PURE__ */ l(o, {
22
+ className: n.textContainer,
23
+ children: /* @__PURE__ */ d(s, {
23
24
  as: "p",
24
- className: t.author,
25
+ className: n.author,
25
26
  color: "textOnLightDefault",
26
27
  variant: "bodyDefaultBold",
27
- children: p.name
28
+ children: h.name
28
29
  })
29
30
  })]
30
- }), /* @__PURE__ */ u("div", {
31
- className: t.optionsMenu,
32
- "data-state": E || O ? "open" : "closed",
31
+ }), /* @__PURE__ */ f("div", {
32
+ className: n.optionsMenu,
33
+ "data-state": j || N ? "open" : "closed",
33
34
  children: [
34
- m && !h && /* @__PURE__ */ l(a, {
35
- "aria-label": T.formatMessage(r.resolveButtonAriaLabel),
36
- "data-no-expand": !0,
37
- disabled: O,
38
- icon: f,
39
- onClick: () => x?.(),
40
- size: "small"
35
+ g && !_ && /* @__PURE__ */ d(c, {
36
+ content: k.formatMessage(i.resolveButtonAriaLabel),
37
+ children: /* @__PURE__ */ d(o, {
38
+ "aria-label": k.formatMessage(i.resolveButtonAriaLabel),
39
+ "data-no-expand": !0,
40
+ disabled: N,
41
+ icon: m,
42
+ onClick: () => E?.(),
43
+ size: "small"
44
+ })
41
45
  }),
42
- m && h && /* @__PURE__ */ l(a, {
43
- "aria-label": T.formatMessage(r.unresolveButtonAriaLabel),
44
- "data-no-expand": !0,
45
- disabled: O,
46
- icon: d,
47
- onClick: () => S?.(),
48
- size: "small"
46
+ g && _ && /* @__PURE__ */ d(c, {
47
+ content: k.formatMessage(i.unresolveButtonAriaLabel),
48
+ children: /* @__PURE__ */ d(o, {
49
+ "aria-label": k.formatMessage(i.unresolveButtonAriaLabel),
50
+ "data-no-expand": !0,
51
+ disabled: N,
52
+ icon: p,
53
+ onClick: () => O?.(),
54
+ size: "small"
55
+ })
49
56
  }),
50
- (g || _) && /* @__PURE__ */ l(i, {
51
- canDelete: _,
52
- canEdit: g,
53
- disabled: O,
57
+ /* @__PURE__ */ d(a, {
58
+ canDelete: y,
59
+ canEdit: v,
60
+ disabled: N,
61
+ onCopyLink: C,
54
62
  onDelete: () => {
55
- v ? (D(!1), k(!0)) : (D(!1), C?.());
63
+ x ? (M(!1), P(!0)) : (M(!1), w?.());
56
64
  },
57
- onEdit: b,
58
- onOpenChange: D
65
+ onEdit: T,
66
+ onOpenChange: M
59
67
  }),
60
- /* @__PURE__ */ l(n, {
68
+ /* @__PURE__ */ d(r, {
69
+ hasReplies: b,
70
+ isAnnotation: A,
61
71
  onCancel: () => {
62
- k(!1), D(!1);
72
+ P(!1), M(!1);
63
73
  },
64
74
  onConfirm: () => {
65
- w?.(), k(!1), D(!1);
75
+ D?.(), P(!1), M(!1);
66
76
  },
67
- onOpenChange: k,
68
- open: O
77
+ onOpenChange: P,
78
+ open: N
69
79
  })
70
80
  ]
71
81
  })]
72
82
  });
73
83
  };
74
- export { p as MessageHeader };
84
+ export { h as MessageHeader };
@@ -1,36 +1,39 @@
1
1
  import { THREADED_ANNOTATIONS_PORTAL as e } from "../../../v2/constants.js";
2
2
  import t from "./messages.js";
3
- import { DropdownMenu as n, IconButton as r, Text as i } from "@box/blueprint-web";
4
- import { useIntl as a } from "react-intl";
5
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
6
- import { Ellipsis as c, Pencil as l, Trash as u } from "@box/blueprint-web-assets/icons/Medium";
7
- import { bpTextTextDestructiveOnLight as d } from "@box/blueprint-web-assets/tokens/tokens";
8
- var f = ({ canDelete: f = !0, canEdit: p = !0, disabled: m, onEdit: h, onDelete: g, onOpenChange: _ }) => {
9
- let { formatMessage: v } = a();
10
- return /* @__PURE__ */ s(n.Root, {
3
+ import { DropdownMenu as n, IconButton as r } from "@box/blueprint-web";
4
+ import { useIntl as i } from "react-intl";
5
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
+ import { Ellipsis as s, Link as c, Pencil as l, Trash as u } from "@box/blueprint-web-assets/icons/Medium";
7
+ var d = ({ canDelete: d = !0, canEdit: f = !0, disabled: p, onCopyLink: m, onDelete: h, onEdit: g, onOpenChange: _ }) => {
8
+ let { formatMessage: v } = i(), y = f || !!m;
9
+ return y || d ? /* @__PURE__ */ o(n.Root, {
11
10
  onOpenChange: _,
12
- children: [/* @__PURE__ */ o(n.Trigger, { children: /* @__PURE__ */ o(r, {
11
+ children: [/* @__PURE__ */ a(n.Trigger, { children: /* @__PURE__ */ a(r, {
13
12
  "aria-label": v(t.moreOptionsAriaLabel),
14
13
  "data-no-expand": !0,
15
- disabled: m,
16
- icon: c,
14
+ disabled: p,
15
+ icon: s,
17
16
  size: "small"
18
- }) }), /* @__PURE__ */ s(n.Content, {
17
+ }) }), /* @__PURE__ */ o(n.Content, {
19
18
  ...e,
20
19
  align: "end",
21
- children: [p && /* @__PURE__ */ s(n.Item, {
22
- onSelect: () => h?.(),
23
- children: [/* @__PURE__ */ o(n.Item.StartElement, { icon: l }), /* @__PURE__ */ o(n.Item.MainContent, { label: v(t.edit) })]
24
- }), f && /* @__PURE__ */ s(n.Item, {
25
- onSelect: () => g?.(),
26
- children: [/* @__PURE__ */ o(n.Item.StartElement, { children: /* @__PURE__ */ o(u, { color: d }) }), /* @__PURE__ */ o(n.Item.MainContent, { children: /* @__PURE__ */ o(i, {
27
- as: "span",
28
- color: "textOnLightError",
29
- variant: "bodyDefault",
30
- children: v(t.delete)
31
- }) })]
32
- })]
20
+ children: [
21
+ f && /* @__PURE__ */ o(n.Item, {
22
+ onSelect: () => g?.(),
23
+ children: [/* @__PURE__ */ a(n.Item.StartElement, { icon: l }), /* @__PURE__ */ a(n.Item.MainContent, { label: v(t.edit) })]
24
+ }),
25
+ m && /* @__PURE__ */ o(n.Item, {
26
+ onSelect: () => m(),
27
+ children: [/* @__PURE__ */ a(n.Item.StartElement, { icon: c }), /* @__PURE__ */ a(n.Item.MainContent, { label: v(t.copyLink) })]
28
+ }),
29
+ d && y && /* @__PURE__ */ a(n.Separator, {}),
30
+ d && /* @__PURE__ */ o(n.Item, {
31
+ onSelect: () => h?.(),
32
+ variant: "destructive",
33
+ children: [/* @__PURE__ */ a(n.Item.StartElement, { icon: u }), /* @__PURE__ */ a(n.Item.MainContent, { label: v(t.delete) })]
34
+ })
35
+ ]
33
36
  })]
34
- });
37
+ }) : null;
35
38
  };
36
- export { f as MessageOptionsMenu };
39
+ export { d as MessageOptionsMenu };
@@ -4,9 +4,9 @@ var t = e({
4
4
  id: "groupSharedFeatures.threadedAnnotations.deleteConfirmation",
5
5
  defaultMessage: "Delete confirmation"
6
6
  },
7
- deleteCommentQuestion: {
8
- id: "groupSharedFeatures.threadedAnnotations.deleteCommentWithRepliesQuestion",
9
- defaultMessage: "Delete this comment and replies?\nThis action can't be undone."
7
+ deleteQuestion: {
8
+ id: "groupSharedFeatures.threadedAnnotations.deleteQuestion",
9
+ defaultMessage: "Delete this {type, select, annotation {annotation} other {comment}}{hasReplies, select, true { and replies} other {}}?\nThis action can't be undone."
10
10
  },
11
11
  deleteCancel: {
12
12
  id: "groupSharedFeatures.threadedAnnotations.deleteCancel",
@@ -24,6 +24,10 @@ var t = e({
24
24
  id: "groupSharedFeatures.threadedAnnotations.cancelDeleteButtonAriaLabel",
25
25
  defaultMessage: "Cancel delete button"
26
26
  },
27
+ copyLink: {
28
+ id: "groupSharedFeatures.threadedAnnotations.copyLink",
29
+ defaultMessage: "Copy link"
30
+ },
27
31
  deleteButtonAriaLabel: {
28
32
  id: "groupSharedFeatures.threadedAnnotations.deleteButtonAriaLabel",
29
33
  defaultMessage: "Delete button"
@@ -7,36 +7,38 @@ import { MessageRenderer as o } from "./subcomponents/message-renderer.js";
7
7
  import s from "clsx";
8
8
  import { useIntl as c } from "react-intl";
9
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, onAvatarClick: y, onDelete: b, onThreadDelete: x, onEdit: S, onResolve: C, onUnresolve: w, annotationTarget: T, onAnnotationBadgeClick: E, originalContentDeleted: D }) => {
11
- let { canResolve: O, canEdit: k, canDelete: A } = h, j = c(), { dispatch: M, isReplyDisabled: N, isAnnotations: P } = e();
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
12
  return /* @__PURE__ */ u("div", {
13
- "aria-label": j.formatMessage(r.annotationMessageAriaLabel),
13
+ "aria-label": N.formatMessage(r.annotationMessageAriaLabel),
14
14
  className: i.textMessage,
15
15
  "data-message-wrapper": !0,
16
16
  children: [/* @__PURE__ */ l(n, {
17
17
  author: f,
18
- canResolve: O,
18
+ canResolve: A,
19
19
  isResolved: _,
20
- canDelete: A,
21
- canEdit: k,
20
+ canDelete: M,
21
+ canEdit: j,
22
+ hasReplies: y,
22
23
  isFirstMessage: v,
23
- onAvatarClick: y,
24
- onDelete: () => b(d),
25
- onThreadDelete: x,
26
- onEdit: S ? () => S(d) : void 0,
27
- onResolve: C ? () => C(d) : void 0,
28
- onUnresolve: w ? () => w(d) : void 0
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
29
31
  }), /* @__PURE__ */ u("div", {
30
32
  className: i.contentWrapper,
31
33
  children: [/* @__PURE__ */ l("div", { className: s(i.threadedIndicator, !g && i.threadedIndicatorHidden) }), /* @__PURE__ */ u("div", {
32
34
  className: i.messageContent,
33
35
  children: [
34
- T && !P && /* @__PURE__ */ l("div", {
36
+ D && !I && /* @__PURE__ */ l("div", {
35
37
  className: i.annotationBadgeWrapper,
36
38
  children: /* @__PURE__ */ l(t, {
37
- annotationTarget: T,
38
- onClick: () => E?.(d),
39
- originalContentDeleted: D
39
+ annotationTarget: D,
40
+ onClick: () => O?.(d),
41
+ originalContentDeleted: k
40
42
  })
41
43
  }),
42
44
  /* @__PURE__ */ l("div", {
@@ -45,7 +47,7 @@ var d = ({ id: d, author: f, message: p, createdAt: m, permissions: h, showThrea
45
47
  }),
46
48
  /* @__PURE__ */ l(a, {
47
49
  createdAt: m,
48
- onReply: N ? void 0 : () => M({
50
+ onReply: F ? void 0 : () => P({
49
51
  type: "REPLY",
50
52
  author: f
51
53
  })
@@ -3,12 +3,13 @@ export default {
3
3
  "groupSharedFeatures.threadedAnnotations.annotationMessageAriaLabel": "অ্যানোটেশন বার্তা",
4
4
  "groupSharedFeatures.threadedAnnotations.annotationPage": "পৃষ্ঠা {number}",
5
5
  "groupSharedFeatures.threadedAnnotations.cancelDeleteButtonAriaLabel": "বাতিল করুন বোতাম",
6
+ "groupSharedFeatures.threadedAnnotations.copyLink": "Copy link",
6
7
  "groupSharedFeatures.threadedAnnotations.delete": "মুছুন",
7
8
  "groupSharedFeatures.threadedAnnotations.deleteButtonAriaLabel": "মুছুন বোতাম",
8
9
  "groupSharedFeatures.threadedAnnotations.deleteCancel": "বাতিল করুন",
9
10
  "groupSharedFeatures.threadedAnnotations.deleteCommentQuestion": "আপনি কি এই মন্তব্যটি মুছতে চান?",
10
- "groupSharedFeatures.threadedAnnotations.deleteCommentWithRepliesQuestion": "এই মন্তব্য ও জবাবগুলো মুছবেন? এই পদক্ষেপটি আগের অবস্থায় ফেরানো যাবে না।",
11
11
  "groupSharedFeatures.threadedAnnotations.deleteConfirmation": "নিশ্চিতকরণ মুছুন",
12
+ "groupSharedFeatures.threadedAnnotations.deleteQuestion": "Delete this {type, select, annotation {annotation} other {comment}}{hasReplies, select, true { and replies} other {}}? This action can't be undone.",
12
13
  "groupSharedFeatures.threadedAnnotations.edit": "সম্পাদনা করুন",
13
14
  "groupSharedFeatures.threadedAnnotations.hideReplies": "উত্তর লুকান",
14
15
  "groupSharedFeatures.threadedAnnotations.markedAsResolved": "সমাধান করা হয়েছে হিসাবে চিহ্নিত করা হয়েছে",
@@ -41,5 +42,6 @@ export default {
41
42
  "groupSharedFeatures.threadedAnnotations.textMessageAriaLabel": "বার্তার টেক্সট",
42
43
  "groupSharedFeatures.threadedAnnotations.unresolveButtonAriaLabel": "অমীমাংসিত",
43
44
  "groupSharedFeatures.threadedAnnotations.userAvatar": "ব্যবহারকারীর অবতার",
44
- "groupSharedFeatures.threadedAnnotations.userAvatarButtonAriaLabel": "ব্যবহারকারীর প্রোফাইল বোতাম দেখুন"
45
+ "groupSharedFeatures.threadedAnnotations.userAvatarButtonAriaLabel": "ব্যবহারকারীর প্রোফাইল বোতাম দেখুন",
46
+ "groupSharedFeatures.threadedAnnotations.deleteCommentWithRepliesQuestion": "এই মন্তব্য ও জবাবগুলো মুছবেন? এই পদক্ষেপটি আগের অবস্থায় ফেরানো যাবে না।"
45
47
  }
@@ -3,12 +3,13 @@ export default {
3
3
  "groupSharedFeatures.threadedAnnotations.annotationMessageAriaLabel": "Anmærkningsmeddelelse",
4
4
  "groupSharedFeatures.threadedAnnotations.annotationPage": "Side {number}",
5
5
  "groupSharedFeatures.threadedAnnotations.cancelDeleteButtonAriaLabel": "'Annuller sletning'-knap",
6
+ "groupSharedFeatures.threadedAnnotations.copyLink": "Copy link",
6
7
  "groupSharedFeatures.threadedAnnotations.delete": "Slet",
7
8
  "groupSharedFeatures.threadedAnnotations.deleteButtonAriaLabel": "Slet-knap",
8
9
  "groupSharedFeatures.threadedAnnotations.deleteCancel": "Annuller",
9
10
  "groupSharedFeatures.threadedAnnotations.deleteCommentQuestion": "Vil du slette denne kommentar?",
10
- "groupSharedFeatures.threadedAnnotations.deleteCommentWithRepliesQuestion": "Slet denne kommentar og svarene? Denne handling kan ikke fortrydes.",
11
11
  "groupSharedFeatures.threadedAnnotations.deleteConfirmation": "Bekræft sletning",
12
+ "groupSharedFeatures.threadedAnnotations.deleteQuestion": "Delete this {type, select, annotation {annotation} other {comment}}{hasReplies, select, true { and replies} other {}}? This action can't be undone.",
12
13
  "groupSharedFeatures.threadedAnnotations.edit": "Rediger",
13
14
  "groupSharedFeatures.threadedAnnotations.hideReplies": "Skjul svar",
14
15
  "groupSharedFeatures.threadedAnnotations.markedAsResolved": "markeret som løst",
@@ -41,5 +42,6 @@ export default {
41
42
  "groupSharedFeatures.threadedAnnotations.textMessageAriaLabel": "Meddelelsestekst",
42
43
  "groupSharedFeatures.threadedAnnotations.unresolveButtonAriaLabel": "Fortryd løsning",
43
44
  "groupSharedFeatures.threadedAnnotations.userAvatar": "Brugeravatar",
44
- "groupSharedFeatures.threadedAnnotations.userAvatarButtonAriaLabel": "'Vis brugerprofil'-knap"
45
+ "groupSharedFeatures.threadedAnnotations.userAvatarButtonAriaLabel": "'Vis brugerprofil'-knap",
46
+ "groupSharedFeatures.threadedAnnotations.deleteCommentWithRepliesQuestion": "Slet denne kommentar og svarene? Denne handling kan ikke fortrydes."
45
47
  }
@@ -3,12 +3,13 @@ export default {
3
3
  "groupSharedFeatures.threadedAnnotations.annotationMessageAriaLabel": "Text der Anmerkung",
4
4
  "groupSharedFeatures.threadedAnnotations.annotationPage": "Seite {number}",
5
5
  "groupSharedFeatures.threadedAnnotations.cancelDeleteButtonAriaLabel": "Schaltfläche für den Abbruch des Löschvorgangs",
6
+ "groupSharedFeatures.threadedAnnotations.copyLink": "Copy link",
6
7
  "groupSharedFeatures.threadedAnnotations.delete": "Löschen",
7
8
  "groupSharedFeatures.threadedAnnotations.deleteButtonAriaLabel": "Schaltfläche „Löschen“",
8
9
  "groupSharedFeatures.threadedAnnotations.deleteCancel": "Abbrechen",
9
10
  "groupSharedFeatures.threadedAnnotations.deleteCommentQuestion": "Möchten Sie diesen Kommentar löschen?",
10
- "groupSharedFeatures.threadedAnnotations.deleteCommentWithRepliesQuestion": "Diesen Kommentar und Antworten löschen? Diese Aktion kann nicht rückgängig gemacht werden.",
11
11
  "groupSharedFeatures.threadedAnnotations.deleteConfirmation": "Löschbestätigung",
12
+ "groupSharedFeatures.threadedAnnotations.deleteQuestion": "Delete this {type, select, annotation {annotation} other {comment}}{hasReplies, select, true { and replies} other {}}? This action can't be undone.",
12
13
  "groupSharedFeatures.threadedAnnotations.edit": "Bearbeiten",
13
14
  "groupSharedFeatures.threadedAnnotations.hideReplies": "Antworten ausblenden",
14
15
  "groupSharedFeatures.threadedAnnotations.markedAsResolved": "Als gelöst markiert",
@@ -41,5 +42,6 @@ export default {
41
42
  "groupSharedFeatures.threadedAnnotations.textMessageAriaLabel": "Nachrichtentext",
42
43
  "groupSharedFeatures.threadedAnnotations.unresolveButtonAriaLabel": "Ungelöst",
43
44
  "groupSharedFeatures.threadedAnnotations.userAvatar": "Benutzer-Avatar",
44
- "groupSharedFeatures.threadedAnnotations.userAvatarButtonAriaLabel": "Schaltfläche „Benutzerprofil anzeigen“"
45
+ "groupSharedFeatures.threadedAnnotations.userAvatarButtonAriaLabel": "Schaltfläche „Benutzerprofil anzeigen“",
46
+ "groupSharedFeatures.threadedAnnotations.deleteCommentWithRepliesQuestion": "Diesen Kommentar und Antworten löschen? Diese Aktion kann nicht rückgängig gemacht werden."
45
47
  }