@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
|
@@ -22,6 +22,8 @@ groupSharedFeatures.threadedAnnotations.deleteConfirmation = Bevestiging verwijd
|
|
|
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 = Bewerken
|
|
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 = Reacties verbergen
|
|
27
29
|
# Text shown after the author name when a comment thread is marked as resolved
|
package/dist/i18n/pl-PL.js
CHANGED
|
@@ -11,6 +11,7 @@ export default {
|
|
|
11
11
|
"groupSharedFeatures.threadedAnnotations.deleteConfirmation": "Potwierdzenie usunięcia",
|
|
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": "Edytuj",
|
|
14
|
+
"groupSharedFeatures.threadedAnnotations.edited": "(Edited)",
|
|
14
15
|
"groupSharedFeatures.threadedAnnotations.hideReplies": "Ukryj odpowiedzi",
|
|
15
16
|
"groupSharedFeatures.threadedAnnotations.markedAsResolved": "oznaczono jako rozwiązane",
|
|
16
17
|
"groupSharedFeatures.threadedAnnotations.messageEditor.cancel": "Anuluj",
|
|
@@ -22,6 +22,8 @@ groupSharedFeatures.threadedAnnotations.deleteConfirmation = Potwierdzenie usuni
|
|
|
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 = Edytuj
|
|
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 = Ukryj odpowiedzi
|
|
27
29
|
# Text shown after the author name when a comment thread is marked as resolved
|
package/dist/i18n/pt-BR.js
CHANGED
|
@@ -11,6 +11,7 @@ export default {
|
|
|
11
11
|
"groupSharedFeatures.threadedAnnotations.deleteConfirmation": "Confirmação de exclusão",
|
|
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": "Editar",
|
|
14
|
+
"groupSharedFeatures.threadedAnnotations.edited": "(Edited)",
|
|
14
15
|
"groupSharedFeatures.threadedAnnotations.hideReplies": "Ocultar respostas",
|
|
15
16
|
"groupSharedFeatures.threadedAnnotations.markedAsResolved": "marcado como resolvido",
|
|
16
17
|
"groupSharedFeatures.threadedAnnotations.messageEditor.cancel": "Cancelar",
|
|
@@ -22,6 +22,8 @@ groupSharedFeatures.threadedAnnotations.deleteConfirmation = Confirmação de ex
|
|
|
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 = Editar
|
|
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 = Ocultar respostas
|
|
27
29
|
# Text shown after the author name when a comment thread is marked as resolved
|
package/dist/i18n/ru-RU.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/sv-SE.js
CHANGED
|
@@ -11,6 +11,7 @@ export default {
|
|
|
11
11
|
"groupSharedFeatures.threadedAnnotations.deleteConfirmation": "Bekräftelse av radering",
|
|
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": "Redigera",
|
|
14
|
+
"groupSharedFeatures.threadedAnnotations.edited": "(Edited)",
|
|
14
15
|
"groupSharedFeatures.threadedAnnotations.hideReplies": "Dölj svar",
|
|
15
16
|
"groupSharedFeatures.threadedAnnotations.markedAsResolved": "markerat som löst",
|
|
16
17
|
"groupSharedFeatures.threadedAnnotations.messageEditor.cancel": "Avbryt",
|
|
@@ -22,6 +22,8 @@ groupSharedFeatures.threadedAnnotations.deleteConfirmation = Bekräftelse av rad
|
|
|
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 = Redigera
|
|
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 = Dölj svar
|
|
27
29
|
# Text shown after the author name when a comment thread is marked as resolved
|
package/dist/i18n/tr-TR.js
CHANGED
|
@@ -11,6 +11,7 @@ export default {
|
|
|
11
11
|
"groupSharedFeatures.threadedAnnotations.deleteConfirmation": "Onayı sil",
|
|
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": "Düzenle",
|
|
14
|
+
"groupSharedFeatures.threadedAnnotations.edited": "(Edited)",
|
|
14
15
|
"groupSharedFeatures.threadedAnnotations.hideReplies": "Yanıtları gizle",
|
|
15
16
|
"groupSharedFeatures.threadedAnnotations.markedAsResolved": "çözülmüş olarak işaretlendi",
|
|
16
17
|
"groupSharedFeatures.threadedAnnotations.messageEditor.cancel": "İptal Et",
|
|
@@ -22,6 +22,8 @@ groupSharedFeatures.threadedAnnotations.deleteConfirmation = Onayı sil
|
|
|
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 = Düzenle
|
|
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 = Yanıtları gizle
|
|
27
29
|
# Text shown after the author name when a comment thread is marked as resolved
|
package/dist/i18n/zh-CN.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/zh-TW.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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._textMessage_4bt0e_4{flex-direction:column;flex:1;width:100%;height:100%;display:flex;position:relative;overflow:visible}._textMessage_4bt0e_4 ._contentWrapper_4bt0e_13{gap:var(--space-2);margin-top:.125rem;display:flex}._textMessage_4bt0e_4 ._contentWrapper_4bt0e_13 ._threadedIndicator_4bt0e_18{width:var(--space-7);flex-shrink:0;position:relative}._textMessage_4bt0e_4 ._contentWrapper_4bt0e_13 ._threadedIndicator_4bt0e_18:after{content:"";left:50%;top:var(--space-05);bottom:var(--space-05);width:var(--border-2);background-color:var(--border-divider-border);border-radius:var(--radius-1);position:absolute;transform:translate(-50%)}._textMessage_4bt0e_4 ._contentWrapper_4bt0e_13 ._threadedIndicatorHidden_4bt0e_34:after{visibility:hidden}._textMessage_4bt0e_4 ._contentWrapper_4bt0e_13 ._messageContent_4bt0e_37{overflow-wrap:break-word;flex-direction:column;flex:1;min-width:0;display:flex}._textMessage_4bt0e_4 ._contentWrapper_4bt0e_13 ._messageContent_4bt0e_37 ._annotationBadgeWrapper_4bt0e_44{min-width:0;max-width:100%;padding-bottom:var(--space-1);flex-direction:column;align-items:flex-start;display:flex;overflow:hidden}._textMessage_4bt0e_4 ._contentWrapper_4bt0e_13 ._messageFooter_4bt0e_53{align-items:center;gap:var(--space-1);padding-bottom:var(--space-2);flex-direction:row;display:flex}._textMessage_4bt0e_4 ._contentWrapper_4bt0e_13 ._messageFooter_4bt0e_53 ._readableTimeWrapper_4bt0e_60{cursor:auto}._replyButton_4bt0e_64{padding-top:var(--space-05);padding-bottom:var(--space-05);opacity:0;transition:opacity .1s}[data-message-wrapper]:hover ._replyButton_4bt0e_64,[data-message-wrapper]:focus-within ._replyButton_4bt0e_64{opacity:1}@media (pointer:coarse),(hover:none){._replyButton_4bt0e_64{opacity:1}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._messagesViewWrapper_ms46c_4{z-index:0;width:100%;position:relative}._messagesViewWrapper_ms46c_4._overflowing_ms46c_9 ._scrollable_ms46c_9{padding-bottom:var(--space-4)}._messagesViewWrapper_ms46c_4._withEditorBelow_ms46c_12{margin-bottom:-1.125rem}._messagesView_ms46c_4{width:100%;height:100%;padding-top:var(--space-1);padding-bottom:var(--bp-border-02);padding-left:var(--space-1);flex-direction:column;display:flex}._messagesView_ms46c_4._scrollable_ms46c_9{max-height:27rem;margin-right:calc(-1 * var(--space-3) + .125rem);padding-right:calc(var(--space-3) - .125rem);scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:var(--black-opacity-50) transparent;overflow:hidden auto}@supports not (scrollbar-color:gray transparent){._messagesView_ms46c_4._scrollable_ms46c_9{scrollbar-width:initial}._messagesView_ms46c_4._scrollable_ms46c_9::-webkit-scrollbar{width:var(--size-2);background-color:#0000}._messagesView_ms46c_4._scrollable_ms46c_9::-webkit-scrollbar-thumb{background:var(--black-opacity-50);border-radius:var(--radius-2)}._messagesView_ms46c_4._scrollable_ms46c_9::-webkit-scrollbar-thumb:hover{background:var(--black-opacity-50)}}._messagesView_ms46c_4 ._repliesContainer_ms46c_53{flex-direction:column;width:100%;display:flex}._messagesFade_ms46c_59{z-index:1;height:var(--size-8);background:linear-gradient(to bottom, transparent, var(--fade-bg,var(--surface-surface)));pointer-events:none;position:absolute;bottom:0;left:0;right:0}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { JSONContent } from '@tiptap/react';
|
|
1
2
|
import { AnnotationBadgeTargetType } from '../../../v2/types/annotation-badge-types';
|
|
2
3
|
import { TextMessageType } from '../../../v2/types/message-types';
|
|
4
|
+
import { MessageEditorProps } from '../message-editor/message-editor';
|
|
3
5
|
export interface MessagesViewProps {
|
|
4
6
|
messages: TextMessageType[];
|
|
5
7
|
isResolved?: boolean;
|
|
@@ -9,11 +11,13 @@ export interface MessagesViewProps {
|
|
|
9
11
|
onThreadDelete?: () => void;
|
|
10
12
|
onAvatarClick: (id: number) => void;
|
|
11
13
|
onCopyLink?: (id: string) => void;
|
|
12
|
-
onEdit?: (id: string) => void;
|
|
14
|
+
onEdit?: (id: string, content: JSONContent | null) => Promise<void> | void;
|
|
15
|
+
onEditError?: (error: unknown) => string | undefined;
|
|
13
16
|
onResolve?: (id: string) => void;
|
|
14
17
|
onUnresolve?: (id: string) => void;
|
|
18
|
+
userSelectorProps: MessageEditorProps['userSelectorProps'];
|
|
15
19
|
annotationTarget?: AnnotationBadgeTargetType;
|
|
16
20
|
onAnnotationBadgeClick?: (id: string) => void;
|
|
17
21
|
originalContentDeleted?: boolean;
|
|
18
22
|
}
|
|
19
|
-
export declare const MessagesView: ({ messages, isResolved, resolvedBy, resolvedAt, onDelete, onThreadDelete, onAvatarClick, onCopyLink, onEdit, onResolve, onUnresolve, annotationTarget, onAnnotationBadgeClick, originalContentDeleted, }: MessagesViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const MessagesView: ({ messages, isResolved, resolvedBy, resolvedAt, onDelete, onThreadDelete, onAvatarClick, onCopyLink, onEdit, onEditError, onResolve, onUnresolve, userSelectorProps, annotationTarget, onAnnotationBadgeClick, originalContentDeleted, }: MessagesViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,8 +3,10 @@ export interface MessageFooterProps {
|
|
|
3
3
|
createdAt: number;
|
|
4
4
|
/** Callback invoked when the user clicks the reply button. */
|
|
5
5
|
onReply?: () => void;
|
|
6
|
+
/** Unix timestamp (ms) of the last edit. When set, renders an `(Edited)` indicator with a tooltip showing this time. */
|
|
7
|
+
updatedAt?: number;
|
|
6
8
|
}
|
|
7
9
|
/**
|
|
8
10
|
* Renders the footer of a message with readable time and reply button.
|
|
9
11
|
*/
|
|
10
|
-
export declare const MessageFooter: ({ createdAt, onReply }: MessageFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const MessageFooter: ({ createdAt, onReply, updatedAt }: MessageFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { JSONContent } from '@tiptap/react';
|
|
1
2
|
import { AnnotationBadgeTargetType } from '../../../v2/types/annotation-badge-types';
|
|
2
3
|
import { TextMessageType } from '../../../v2/types/message-types';
|
|
4
|
+
import { MessageEditorProps } from '../message-editor/message-editor';
|
|
3
5
|
/**
|
|
4
6
|
* Defines the props for the TextMessage component, combining message data with actionable callbacks.
|
|
5
7
|
*/
|
|
@@ -13,9 +15,11 @@ export interface TextMessageProps extends TextMessageType {
|
|
|
13
15
|
onThreadDelete?: () => void;
|
|
14
16
|
onAvatarClick: (id: number) => void;
|
|
15
17
|
onCopyLink?: (id: string) => void;
|
|
16
|
-
onEdit?: (id: string) => void;
|
|
18
|
+
onEdit?: (id: string, content: JSONContent | null) => Promise<void> | void;
|
|
19
|
+
onEditError?: (error: unknown) => string | undefined;
|
|
17
20
|
onResolve?: (id: string) => void;
|
|
18
21
|
onUnresolve?: (id: string) => void;
|
|
22
|
+
userSelectorProps: MessageEditorProps['userSelectorProps'];
|
|
19
23
|
annotationTarget?: AnnotationBadgeTargetType;
|
|
20
24
|
onAnnotationBadgeClick?: (id: string) => void;
|
|
21
25
|
originalContentDeleted?: boolean;
|
|
@@ -27,4 +31,4 @@ export interface TextMessageProps extends TextMessageType {
|
|
|
27
31
|
* the message content itself, a relative timestamp, and providing a mechanism
|
|
28
32
|
* for deleting the message.
|
|
29
33
|
*/
|
|
30
|
-
export declare const TextMessage: ({ id, author, message, createdAt, permissions, showThreadedIndicator, isResolved, isFirstMessage, hasReplies, onAvatarClick, onCopyLink, onDelete, onThreadDelete, onEdit, onResolve, onUnresolve, annotationTarget, onAnnotationBadgeClick, originalContentDeleted, }: TextMessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export declare const TextMessage: ({ id, author, message, createdAt, updatedAt, permissions, showThreadedIndicator, isResolved, isFirstMessage, hasReplies, onAvatarClick, onCopyLink, onDelete, onThreadDelete, onEdit, onEditError, onResolve, onUnresolve, userSelectorProps, annotationTarget, onAnnotationBadgeClick, originalContentDeleted, }: TextMessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,6 +8,7 @@ export declare const DefaultThreadedAnnotations: (props: ThreadedAnnotationsProp
|
|
|
8
8
|
interface InteractiveModuleBaseProps {
|
|
9
9
|
initialMessages?: TextMessageType[];
|
|
10
10
|
isReplyDisabled?: boolean;
|
|
11
|
+
isEditDisabled?: boolean;
|
|
11
12
|
onCopyLink?: (id: string) => void;
|
|
12
13
|
}
|
|
13
14
|
type InteractiveModuleProps = (InteractiveModuleBaseProps & {
|
|
@@ -19,6 +19,13 @@ export type ThreadEvent = {
|
|
|
19
19
|
} | {
|
|
20
20
|
type: 'REPLY';
|
|
21
21
|
author: TextMessageAuthorType;
|
|
22
|
+
}
|
|
23
|
+
/** No-op when `isEditDisabled` is true. */
|
|
24
|
+
| {
|
|
25
|
+
type: 'EDIT';
|
|
26
|
+
id: string;
|
|
27
|
+
} | {
|
|
28
|
+
type: 'CLEAR_EDIT';
|
|
22
29
|
} | {
|
|
23
30
|
type: 'COLLAPSE';
|
|
24
31
|
} | {
|
|
@@ -27,21 +34,30 @@ export type ThreadEvent = {
|
|
|
27
34
|
export interface ThreadedAnnotationsContextValue {
|
|
28
35
|
viewState: ThreadViewState;
|
|
29
36
|
replyMention: TextMessageAuthorType | null;
|
|
37
|
+
/**
|
|
38
|
+
* Id of the message currently being edited, or null. Cleared on CLEAR_EDIT/COLLAPSE, when
|
|
39
|
+
* `isEditDisabled` or `collapsed` flip true, or when the id disappears from the messages list.
|
|
40
|
+
*/
|
|
41
|
+
editingMessageId: string | null;
|
|
30
42
|
/** Whether the component is rendered in annotation mode (scrollable, fixed-height) vs comments mode. */
|
|
31
43
|
isAnnotations: boolean;
|
|
32
|
-
/** When true, globally disables replies
|
|
44
|
+
/** When true, globally disables replies (hides reply buttons and blocks editor opening on click). */
|
|
33
45
|
isReplyDisabled: boolean;
|
|
46
|
+
/** When true, globally disables edits (hides the Edit menu item and blocks EDIT dispatch). */
|
|
47
|
+
isEditDisabled: boolean;
|
|
34
48
|
dispatch: (event: ThreadEvent) => void;
|
|
35
49
|
}
|
|
36
50
|
export interface ThreadedAnnotationsProviderProps {
|
|
37
51
|
children: ReactNode;
|
|
38
52
|
defaultExpanded?: boolean;
|
|
39
|
-
/** When true, globally disables replies
|
|
53
|
+
/** When true, globally disables replies (hides reply buttons and blocks editor opening on click). */
|
|
40
54
|
isReplyDisabled?: boolean;
|
|
55
|
+
/** When true, globally disables edits (hides the Edit menu item and blocks EDIT dispatch). */
|
|
56
|
+
isEditDisabled?: boolean;
|
|
41
57
|
/** When true, forces the panel to the Collapsed state. */
|
|
42
58
|
collapsed?: boolean;
|
|
43
59
|
/** Whether the component is rendered in annotation mode (scrollable, fixed-height) vs comments mode. */
|
|
44
60
|
isAnnotations?: boolean;
|
|
45
61
|
}
|
|
46
|
-
export declare const ThreadedAnnotationsProvider: ({ children, defaultExpanded, isReplyDisabled, collapsed, isAnnotations, }: ThreadedAnnotationsProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
62
|
+
export declare const ThreadedAnnotationsProvider: ({ children, defaultExpanded, isReplyDisabled, isEditDisabled, collapsed, isAnnotations, }: ThreadedAnnotationsProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
47
63
|
export declare const useThreadedAnnotationsContext: () => ThreadedAnnotationsContextValue;
|
|
@@ -3,6 +3,7 @@ import { MessageEditorProps } from '../components/v2/message-editor/message-edit
|
|
|
3
3
|
import { AnnotationBadgeTargetType } from './types/annotation-badge-types';
|
|
4
4
|
import { TextMessageType } from './types/message-types';
|
|
5
5
|
type MessageActionCallback = (content: JSONContent | null) => Promise<TextMessageType | void> | TextMessageType | void;
|
|
6
|
+
type MessageEditActionCallback = (id: string, content: JSONContent | null) => Promise<void> | void;
|
|
6
7
|
interface ThreadedAnnotationsBaseProps {
|
|
7
8
|
messages: TextMessageType[];
|
|
8
9
|
isResolved?: boolean;
|
|
@@ -18,14 +19,25 @@ interface ThreadedAnnotationsBaseProps {
|
|
|
18
19
|
* item is hidden. The consumer owns URL construction and clipboard writes.
|
|
19
20
|
*/
|
|
20
21
|
onCopyLink?: (id: string) => void;
|
|
21
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Called when the user saves an edited message. `content` is `null` when the editor was emptied.
|
|
24
|
+
* Required to enable the Edit action, together with `permissions.canEdit` and `!isEditDisabled`.
|
|
25
|
+
*/
|
|
26
|
+
onEdit?: MessageEditActionCallback;
|
|
27
|
+
/**
|
|
28
|
+
* Maps an `onEdit` error to an inline editor message; return `undefined` for the default message.
|
|
29
|
+
* Always invoked, even if the editor unmounts mid-save, so use it to log or toast on failure.
|
|
30
|
+
*/
|
|
31
|
+
onEditError?: (error: unknown) => string | undefined;
|
|
22
32
|
onResolve?: (id: string) => void;
|
|
23
33
|
onUnresolve?: (id: string) => void;
|
|
24
34
|
onPost: MessageActionCallback;
|
|
25
35
|
onPostError?: (error: unknown) => string | undefined;
|
|
26
36
|
userSelectorProps: MessageEditorProps['userSelectorProps'];
|
|
27
|
-
/** When true, globally disables replies
|
|
37
|
+
/** When true, globally disables replies (hides reply buttons and blocks editor opening on click). */
|
|
28
38
|
isReplyDisabled?: boolean;
|
|
39
|
+
/** When true, or when the thread is resolved, hides the Edit menu item and blocks EDIT dispatch. */
|
|
40
|
+
isEditDisabled?: boolean;
|
|
29
41
|
/** Called when the editor is opened or closed. Receives `true` when opened, `false` when closed. */
|
|
30
42
|
onEditorOpenChange?: (isOpen: boolean) => void;
|
|
31
43
|
/** When true, collapses the editor and replies panel. */
|
|
@@ -7,6 +7,8 @@ export type TextMessageType = {
|
|
|
7
7
|
/** The message content, structured as a TipTap document node. */
|
|
8
8
|
message: DocumentNode;
|
|
9
9
|
createdAt: number;
|
|
10
|
+
/** Unix timestamp (ms) of the last edit. Undefined if the message has not been edited. */
|
|
11
|
+
updatedAt?: number;
|
|
10
12
|
/** The author of the message. */
|
|
11
13
|
author: TextMessageAuthorType;
|
|
12
14
|
permissions: Permissions;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/threaded-annotations",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.89.1",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@tanstack/react-virtual": "^3.10.8",
|
|
@@ -16,23 +16,23 @@
|
|
|
16
16
|
"uuid": "^9.0.1"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"@box/blueprint-web": "^14.
|
|
20
|
-
"@box/blueprint-web-assets": "^4.
|
|
21
|
-
"@box/collaboration-popover": "^1.
|
|
22
|
-
"@box/readable-time": "^1.
|
|
23
|
-
"@box/user-selector": "^1.
|
|
19
|
+
"@box/blueprint-web": "^14.30.0",
|
|
20
|
+
"@box/blueprint-web-assets": "^4.117.2",
|
|
21
|
+
"@box/collaboration-popover": "^1.62.3",
|
|
22
|
+
"@box/readable-time": "^1.41.3",
|
|
23
|
+
"@box/user-selector": "^1.76.3",
|
|
24
24
|
"clsx": "^1.2.1",
|
|
25
25
|
"react": "^18.0.0",
|
|
26
26
|
"react-dom": "^18.0.0",
|
|
27
27
|
"react-intl": "^6.4.2"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@box/blueprint-web": "^14.
|
|
31
|
-
"@box/blueprint-web-assets": "^4.
|
|
32
|
-
"@box/eslint-plugin-blueprint": "1.
|
|
33
|
-
"@box/readable-time": "^1.
|
|
34
|
-
"@box/storybook-utils": "^0.
|
|
35
|
-
"@box/user-selector": "^1.
|
|
30
|
+
"@box/blueprint-web": "^14.30.0",
|
|
31
|
+
"@box/blueprint-web-assets": "^4.117.2",
|
|
32
|
+
"@box/eslint-plugin-blueprint": "1.2.0",
|
|
33
|
+
"@box/readable-time": "^1.41.3",
|
|
34
|
+
"@box/storybook-utils": "^0.19.2",
|
|
35
|
+
"@box/user-selector": "^1.76.3",
|
|
36
36
|
"react": "^18.0.0",
|
|
37
37
|
"react-dom": "^18.0.0"
|
|
38
38
|
},
|