@box/threaded-annotations 1.85.2 → 1.89.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/message-footer.js +58 -38
- package/dist/chunks/messages-view.js +48 -42
- package/dist/chunks/threaded-annotations2.js +39 -30
- package/dist/esm/lib/components/v2/message-editor/message-editor.js +2 -2
- package/dist/esm/lib/components/v2/message-header/message-header.js +4 -3
- package/dist/esm/lib/components/v2/text-message/messages.js +4 -0
- package/dist/esm/lib/components/v2/text-message/text-message.js +64 -54
- package/dist/esm/lib/v2/test-utils/mocks/mock-messages.js +2 -2
- package/dist/esm/lib/v2/threaded-annotations-context.js +31 -19
- package/dist/esm/lib/v2/threaded-annotations.js +0 -1
- package/dist/i18n/bn-IN.js +1 -0
- package/dist/i18n/bn-IN.properties +2 -0
- package/dist/i18n/da-DK.js +1 -0
- package/dist/i18n/da-DK.properties +2 -0
- package/dist/i18n/de-DE.js +1 -0
- package/dist/i18n/de-DE.properties +2 -0
- package/dist/i18n/en-AU.js +1 -0
- package/dist/i18n/en-AU.properties +2 -0
- package/dist/i18n/en-CA.js +1 -0
- package/dist/i18n/en-CA.properties +2 -0
- package/dist/i18n/en-GB.js +1 -0
- package/dist/i18n/en-GB.properties +2 -0
- package/dist/i18n/en-US.js +1 -0
- package/dist/i18n/en-US.properties +2 -0
- package/dist/i18n/en-x-pseudo.js +44 -43
- package/dist/i18n/en-x-pseudo.properties +45 -43
- package/dist/i18n/es-419.js +1 -0
- package/dist/i18n/es-419.properties +2 -0
- package/dist/i18n/es-ES.js +1 -0
- package/dist/i18n/es-ES.properties +2 -0
- package/dist/i18n/fi-FI.js +1 -0
- package/dist/i18n/fi-FI.properties +2 -0
- package/dist/i18n/fr-CA.js +1 -0
- package/dist/i18n/fr-CA.properties +2 -0
- package/dist/i18n/fr-FR.js +1 -0
- package/dist/i18n/fr-FR.properties +2 -0
- package/dist/i18n/hi-IN.js +1 -0
- package/dist/i18n/hi-IN.properties +2 -0
- package/dist/i18n/it-IT.js +1 -0
- package/dist/i18n/it-IT.properties +2 -0
- package/dist/i18n/ja-JP.js +1 -0
- package/dist/i18n/ja-JP.properties +2 -0
- package/dist/i18n/json/src/lib/components/v2/text-message/messages.json +1 -1
- package/dist/i18n/ko-KR.js +1 -0
- package/dist/i18n/ko-KR.properties +2 -0
- package/dist/i18n/nb-NO.js +1 -0
- package/dist/i18n/nb-NO.properties +2 -0
- package/dist/i18n/nl-NL.js +1 -0
- package/dist/i18n/nl-NL.properties +2 -0
- package/dist/i18n/pl-PL.js +1 -0
- package/dist/i18n/pl-PL.properties +2 -0
- package/dist/i18n/pt-BR.js +1 -0
- package/dist/i18n/pt-BR.properties +2 -0
- package/dist/i18n/ru-RU.js +1 -0
- package/dist/i18n/ru-RU.properties +2 -0
- package/dist/i18n/sv-SE.js +1 -0
- package/dist/i18n/sv-SE.properties +2 -0
- package/dist/i18n/tr-TR.js +1 -0
- package/dist/i18n/tr-TR.properties +2 -0
- package/dist/i18n/zh-CN.js +1 -0
- package/dist/i18n/zh-CN.properties +2 -0
- package/dist/i18n/zh-TW.js +1 -0
- package/dist/i18n/zh-TW.properties +2 -0
- package/dist/styles/message-footer.css +1 -1
- package/dist/styles/messages-view.css +1 -1
- package/dist/types/lib/components/v2/messages-view/messages-view.d.ts +6 -2
- package/dist/types/lib/components/v2/text-message/messages.d.ts +5 -0
- package/dist/types/lib/components/v2/text-message/subcomponents/message-footer.d.ts +3 -1
- package/dist/types/lib/components/v2/text-message/text-message.d.ts +6 -2
- package/dist/types/lib/v2/stories/shared.d.ts +1 -0
- package/dist/types/lib/v2/threaded-annotations-context.d.ts +19 -3
- package/dist/types/lib/v2/threaded-annotations.d.ts +14 -2
- package/dist/types/lib/v2/types/message-types.d.ts +2 -0
- package/package.json +12 -12
|
@@ -1,42 +1,62 @@
|
|
|
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
|
|
4
|
-
import { ReadableTime as
|
|
5
|
-
import { jsx as
|
|
6
|
-
import '../styles/message-footer.css';var
|
|
7
|
-
textMessage: "
|
|
8
|
-
contentWrapper: "
|
|
9
|
-
threadedIndicator: "
|
|
10
|
-
threadedIndicatorHidden: "
|
|
11
|
-
messageContent: "
|
|
12
|
-
annotationBadgeWrapper: "
|
|
13
|
-
messageFooter: "
|
|
14
|
-
readableTimeWrapper: "
|
|
15
|
-
replyButton: "
|
|
16
|
-
},
|
|
17
|
-
let
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
className:
|
|
20
|
-
children: [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
+
textMessage: "_textMessage_4bt0e_4",
|
|
8
|
+
contentWrapper: "_contentWrapper_4bt0e_13",
|
|
9
|
+
threadedIndicator: "_threadedIndicator_4bt0e_18",
|
|
10
|
+
threadedIndicatorHidden: "_threadedIndicatorHidden_4bt0e_34",
|
|
11
|
+
messageContent: "_messageContent_4bt0e_37",
|
|
12
|
+
annotationBadgeWrapper: "_annotationBadgeWrapper_4bt0e_44",
|
|
13
|
+
messageFooter: "_messageFooter_4bt0e_53",
|
|
14
|
+
readableTimeWrapper: "_readableTimeWrapper_4bt0e_60",
|
|
15
|
+
replyButton: "_replyButton_4bt0e_64"
|
|
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
|
-
|
|
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 {
|
|
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: "
|
|
11
|
-
overflowing: "
|
|
12
|
-
scrollable: "
|
|
13
|
-
withEditorBelow: "
|
|
14
|
-
messagesView: "
|
|
15
|
-
repliesContainer: "
|
|
16
|
-
messagesFade: "
|
|
17
|
-
}, d = ({ messages: d, isResolved: f = !1, resolvedBy: p, resolvedAt: m, onDelete: h, onThreadDelete: g, onAvatarClick: _, onCopyLink: v, onEdit: y,
|
|
18
|
-
let { viewState:
|
|
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:
|
|
21
|
-
enabled:
|
|
22
|
-
isExpanded:
|
|
23
|
-
suppressAutoScroll:
|
|
24
|
-
}),
|
|
25
|
-
if (!
|
|
26
|
-
let
|
|
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,
|
|
28
|
+
className: o(u.messagesViewWrapper, I && u.overflowing, I && M && u.withEditorBelow),
|
|
29
29
|
children: [/* @__PURE__ */ l("div", {
|
|
30
|
-
ref:
|
|
31
|
-
className: o(u.messagesView,
|
|
32
|
-
onScroll:
|
|
30
|
+
ref: A,
|
|
31
|
+
className: o(u.messagesView, k && u.scrollable),
|
|
32
|
+
onScroll: F,
|
|
33
33
|
children: [
|
|
34
34
|
/* @__PURE__ */ c(i, {
|
|
35
|
-
...
|
|
36
|
-
hasReplies:
|
|
37
|
-
showThreadedIndicator:
|
|
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
|
-
|
|
45
|
-
|
|
44
|
+
onEditError: b,
|
|
45
|
+
onResolve: x,
|
|
46
|
+
onUnresolve: S,
|
|
46
47
|
isFirstMessage: !0,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
userSelectorProps: C,
|
|
49
|
+
annotationTarget: w,
|
|
50
|
+
onAnnotationBadgeClick: T,
|
|
51
|
+
originalContentDeleted: E
|
|
50
52
|
}),
|
|
51
|
-
|
|
52
|
-
lastUser:
|
|
53
|
-
repliesCount:
|
|
54
|
-
secondLastUser:
|
|
55
|
-
onShowReplies:
|
|
53
|
+
H && U && /* @__PURE__ */ c(r, {
|
|
54
|
+
lastUser: U,
|
|
55
|
+
repliesCount: V.length,
|
|
56
|
+
secondLastUser: W,
|
|
57
|
+
onShowReplies: G
|
|
56
58
|
}),
|
|
57
|
-
|
|
59
|
+
j && V.length > 0 && /* @__PURE__ */ c("div", {
|
|
58
60
|
className: u.repliesContainer,
|
|
59
|
-
children:
|
|
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
|
-
|
|
68
|
-
|
|
69
|
+
onEditError: b,
|
|
70
|
+
onResolve: x,
|
|
71
|
+
onUnresolve: S,
|
|
72
|
+
userSelectorProps: C
|
|
69
73
|
}, e.id))
|
|
70
74
|
}),
|
|
71
|
-
|
|
72
|
-
...
|
|
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
|
-
|
|
80
|
-
|
|
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
|
-
}),
|
|
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,
|
|
14
|
-
let { viewState:
|
|
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
|
-
|
|
17
|
-
}, [
|
|
18
|
-
|
|
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
|
-
|
|
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
|
-
}, [
|
|
25
|
-
let
|
|
26
|
-
if (!
|
|
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]") ||
|
|
29
|
-
}, [
|
|
30
|
-
return
|
|
31
|
-
onPost:
|
|
32
|
-
onPostError:
|
|
33
|
-
onPostSuccess:
|
|
34
|
-
userSelectorProps:
|
|
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:
|
|
38
|
-
className: s(m.threadedAnnotations,
|
|
39
|
-
onClick:
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
|
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
|
-
})
|
|
160
|
+
});
|
|
161
161
|
}, O = (e) => /* @__PURE__ */ S(c, { children: /* @__PURE__ */ S(D, { ...e }) });
|
|
162
162
|
export { O as MessageEditor, g as MessageEditorVariant };
|
|
@@ -7,7 +7,8 @@ import { IconButton as o, Text as s, Tooltip as c } from "@box/blueprint-web";
|
|
|
7
7
|
import { useState as l } from "react";
|
|
8
8
|
import { useIntl as u } from "react-intl";
|
|
9
9
|
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
10
|
-
import {
|
|
10
|
+
import { CheckmarkCircle as p } from "@box/blueprint-web-assets/icons/Medium";
|
|
11
|
+
import { CheckmarkCircle as m } from "@box/blueprint-web-assets/icons/MediumFilled";
|
|
11
12
|
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
13
|
let k = u(), { isAnnotations: A } = e(), [j, M] = l(!1), [N, P] = l(!1);
|
|
13
14
|
return /* @__PURE__ */ f("div", {
|
|
@@ -38,7 +39,7 @@ var h = ({ author: h, canResolve: g = !1, isResolved: _ = !1, canEdit: v = !0, c
|
|
|
38
39
|
"aria-label": k.formatMessage(i.resolveButtonAriaLabel),
|
|
39
40
|
"data-no-expand": !0,
|
|
40
41
|
disabled: N,
|
|
41
|
-
icon:
|
|
42
|
+
icon: p,
|
|
42
43
|
onClick: () => E?.(),
|
|
43
44
|
size: "small"
|
|
44
45
|
})
|
|
@@ -49,7 +50,7 @@ var h = ({ author: h, canResolve: g = !1, isResolved: _ = !1, canEdit: v = !0, c
|
|
|
49
50
|
"aria-label": k.formatMessage(i.unresolveButtonAriaLabel),
|
|
50
51
|
"data-no-expand": !0,
|
|
51
52
|
disabled: N,
|
|
52
|
-
icon:
|
|
53
|
+
icon: m,
|
|
53
54
|
onClick: () => O?.(),
|
|
54
55
|
size: "small"
|
|
55
56
|
})
|
|
@@ -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 {
|
|
2
|
-
import { t } from "
|
|
3
|
-
import {
|
|
4
|
-
import r from "
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import s from "
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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__ */
|
|
17
|
-
author:
|
|
18
|
-
canResolve:
|
|
19
|
-
isResolved:
|
|
20
|
-
canDelete:
|
|
21
|
-
canEdit:
|
|
22
|
-
hasReplies:
|
|
23
|
-
isFirstMessage:
|
|
24
|
-
onAvatarClick:
|
|
25
|
-
onCopyLink:
|
|
26
|
-
onDelete: () =>
|
|
27
|
-
onThreadDelete:
|
|
28
|
-
onEdit:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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 {
|
|
70
|
+
export { m as TextMessage };
|
|
@@ -174,12 +174,12 @@ var t = [
|
|
|
174
174
|
}]
|
|
175
175
|
}, r = {
|
|
176
176
|
canResolve: !1,
|
|
177
|
-
canEdit: !
|
|
177
|
+
canEdit: !0,
|
|
178
178
|
canDelete: !0,
|
|
179
179
|
canReply: !0
|
|
180
180
|
}, i = {
|
|
181
181
|
canResolve: !0,
|
|
182
|
-
canEdit: !
|
|
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,
|
|
6
|
-
let [
|
|
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 ? (
|
|
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 && (
|
|
11
|
-
}, [u])
|
|
12
|
-
|
|
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
|
-
|
|
17
|
+
m((e) => e === s.Collapsed ? l ? s.RepliesOnly : s.Composing : e);
|
|
16
18
|
break;
|
|
17
19
|
case "REPLY":
|
|
18
|
-
l || (
|
|
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
|
-
|
|
29
|
+
m(s.Collapsed), g(null), v(null);
|
|
22
30
|
break;
|
|
23
31
|
case "CLEAR_MENTION":
|
|
24
|
-
|
|
32
|
+
g(null);
|
|
25
33
|
break;
|
|
26
34
|
}
|
|
27
|
-
}, [l]),
|
|
28
|
-
viewState:
|
|
29
|
-
replyMention:
|
|
30
|
-
|
|
35
|
+
}, [l, u]), b = i(() => ({
|
|
36
|
+
viewState: p,
|
|
37
|
+
replyMention: h,
|
|
38
|
+
editingMessageId: _,
|
|
39
|
+
isAnnotations: f,
|
|
31
40
|
isReplyDisabled: l,
|
|
32
|
-
|
|
41
|
+
isEditDisabled: u,
|
|
42
|
+
dispatch: y
|
|
33
43
|
}), [
|
|
44
|
+
p,
|
|
45
|
+
h,
|
|
46
|
+
_,
|
|
34
47
|
f,
|
|
35
|
-
m,
|
|
36
|
-
d,
|
|
37
48
|
l,
|
|
38
|
-
|
|
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 = () => {
|
package/dist/i18n/bn-IN.js
CHANGED
|
@@ -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": "বাতিল করুন",
|
|
@@ -22,6 +22,8 @@ groupSharedFeatures.threadedAnnotations.deleteConfirmation = নিশ্চি
|
|
|
22
22
|
groupSharedFeatures.threadedAnnotations.deleteQuestion = Delete this {type, select, annotation {annotation} other {comment}}{hasReplies, select, true { and replies} other {}}? This action can't be undone.
|
|
23
23
|
# Edit option in message context menu
|
|
24
24
|
groupSharedFeatures.threadedAnnotations.edit = সম্পাদনা করুন
|
|
25
|
+
# Indicator shown next to the timestamp when a message has been edited
|
|
26
|
+
groupSharedFeatures.threadedAnnotations.edited = (Edited)
|
|
25
27
|
# Button text to hide replies in threaded annotations
|
|
26
28
|
groupSharedFeatures.threadedAnnotations.hideReplies = উত্তর লুকান
|
|
27
29
|
# Text shown after the author name when a comment thread is marked as resolved
|
package/dist/i18n/da-DK.js
CHANGED
|
@@ -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",
|