@box/threaded-annotations 1.80.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.
- package/LICENSE +379 -0
- package/README.md +57 -0
- package/dist/chunks/annotation-badge.js +49 -0
- package/dist/chunks/custom-placeholder.js +72 -0
- package/dist/chunks/delete-annotations-message-popover.js +46 -0
- package/dist/chunks/delete-confirmation-popover.js +59 -0
- package/dist/chunks/dist.js +1749 -0
- package/dist/chunks/mention-component.js +96 -0
- package/dist/chunks/message-editor.module.js +12 -0
- package/dist/chunks/message-editor2.module.js +27 -0
- package/dist/chunks/message-footer.js +42 -0
- package/dist/chunks/message-header.js +49 -0
- package/dist/chunks/messages-view.js +83 -0
- package/dist/chunks/mock-collaboration-props.js +19379 -0
- package/dist/chunks/resolved-state.js +55 -0
- package/dist/chunks/show-replies-button.js +60 -0
- package/dist/chunks/text-message.js +21 -0
- package/dist/chunks/threaded-annotations.js +71 -0
- package/dist/chunks/threaded-annotations2.js +68 -0
- package/dist/chunks/virtualized-messages.js +30 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/lib/components/mention-component/mention-component.js +2 -0
- package/dist/esm/lib/components/mention-component/mention-context.js +26 -0
- package/dist/esm/lib/components/message-editor/editor-extensions/custom-mention/custom-mention-suggestions.js +23 -0
- package/dist/esm/lib/components/message-editor/editor-extensions/custom-mention/custom-mention.js +59 -0
- package/dist/esm/lib/components/message-editor/editor-extensions/custom-mention/useMentionState.js +24 -0
- package/dist/esm/lib/components/message-editor/editor-extensions/custom-paragraph.js +13 -0
- package/dist/esm/lib/components/message-editor/editor-extensions/custom-placeholder/custom-placeholder-utils.js +26 -0
- package/dist/esm/lib/components/message-editor/editor-extensions/custom-placeholder/custom-placeholder.js +2 -0
- package/dist/esm/lib/components/message-editor/error-message.js +17 -0
- package/dist/esm/lib/components/message-editor/hooks/useMessageEditor.js +68 -0
- package/dist/esm/lib/components/message-editor/hooks/useMessagePost.js +35 -0
- package/dist/esm/lib/components/message-editor/message-editor-actions.js +29 -0
- package/dist/esm/lib/components/message-editor/message-editor-context.js +7 -0
- package/dist/esm/lib/components/message-editor/message-editor.js +74 -0
- package/dist/esm/lib/components/message-editor/messages.js +44 -0
- package/dist/esm/lib/components/message-editor/utils/getMessageEditorState.js +9 -0
- package/dist/esm/lib/components/message-header/delete-annotations-message-popover.js +2 -0
- package/dist/esm/lib/components/message-header/message-header.js +2 -0
- package/dist/esm/lib/components/message-header/messages.js +32 -0
- package/dist/esm/lib/components/messages-view/consts.js +2 -0
- package/dist/esm/lib/components/messages-view/hooks/useAutoScroll.js +43 -0
- package/dist/esm/lib/components/messages-view/hooks/useShowMoreReplies.js +26 -0
- package/dist/esm/lib/components/messages-view/hooks/useVirtualizedMessages.js +17 -0
- package/dist/esm/lib/components/messages-view/messages-view.js +61 -0
- package/dist/esm/lib/components/messages-view/messages.js +12 -0
- package/dist/esm/lib/components/messages-view/virtualized-messages.js +2 -0
- package/dist/esm/lib/components/text-message/message-renderer.js +58 -0
- package/dist/esm/lib/components/text-message/text-message.js +2 -0
- package/dist/esm/lib/components/user-avatar/getInitials.js +5 -0
- package/dist/esm/lib/components/user-avatar/messages.js +12 -0
- package/dist/esm/lib/components/user-avatar/user-avatar.js +31 -0
- package/dist/esm/lib/components/v2/annotation-badge/annotation-badge.js +2 -0
- package/dist/esm/lib/components/v2/annotation-badge/index.js +2 -0
- package/dist/esm/lib/components/v2/annotation-badge/messages.js +6 -0
- package/dist/esm/lib/components/v2/message-editor/editor-extensions/custom-mention/custom-mention-suggestions.js +23 -0
- package/dist/esm/lib/components/v2/message-editor/editor-extensions/custom-mention/custom-mention.js +59 -0
- package/dist/esm/lib/components/v2/message-editor/editor-extensions/custom-mention/mention-trigger-normalization.js +2 -0
- package/dist/esm/lib/components/v2/message-editor/editor-extensions/custom-mention/useMentionState.js +24 -0
- package/dist/esm/lib/components/v2/message-editor/editor-extensions/custom-paragraph.js +13 -0
- package/dist/esm/lib/components/v2/message-editor/hooks/useCharacterLimit.js +24 -0
- package/dist/esm/lib/components/v2/message-editor/hooks/useEditorContainerState.js +21 -0
- package/dist/esm/lib/components/v2/message-editor/hooks/useMentionUserSelection.js +22 -0
- package/dist/esm/lib/components/v2/message-editor/hooks/useMessageSubmit.js +24 -0
- package/dist/esm/lib/components/v2/message-editor/message-editor-context.js +19 -0
- package/dist/esm/lib/components/v2/message-editor/message-editor.js +159 -0
- package/dist/esm/lib/components/v2/message-editor/message-editor.types.js +4 -0
- package/dist/esm/lib/components/v2/message-editor/messages.js +44 -0
- package/dist/esm/lib/components/v2/message-editor/subcomponents/character-limit-counter.js +26 -0
- package/dist/esm/lib/components/v2/message-editor/subcomponents/edit-buttons.js +32 -0
- package/dist/esm/lib/components/v2/message-editor/subcomponents/error-message.js +22 -0
- package/dist/esm/lib/components/v2/message-editor/subcomponents/post-button.js +27 -0
- package/dist/esm/lib/components/v2/message-header/delete-confirmation-popover.js +2 -0
- package/dist/esm/lib/components/v2/message-header/message-header.js +74 -0
- package/dist/esm/lib/components/v2/message-header/message-options-menu.js +36 -0
- package/dist/esm/lib/components/v2/message-header/messages.js +44 -0
- package/dist/esm/lib/components/v2/messages-view/hooks/useAutoScroll.js +64 -0
- package/dist/esm/lib/components/v2/messages-view/messages-view.js +2 -0
- package/dist/esm/lib/components/v2/resolved-state/messages.js +12 -0
- package/dist/esm/lib/components/v2/resolved-state/resolved-state.js +2 -0
- package/dist/esm/lib/components/v2/show-replies-button/messages.js +12 -0
- package/dist/esm/lib/components/v2/show-replies-button/show-replies-button.js +2 -0
- package/dist/esm/lib/components/v2/text-message/messages.js +20 -0
- package/dist/esm/lib/components/v2/text-message/subcomponents/message-footer.js +2 -0
- package/dist/esm/lib/components/v2/text-message/subcomponents/message-renderer.js +60 -0
- package/dist/esm/lib/components/v2/text-message/text-message.js +57 -0
- package/dist/esm/lib/components/v2/user-avatar/getInitials.js +5 -0
- package/dist/esm/lib/components/v2/user-avatar/messages.js +12 -0
- package/dist/esm/lib/components/v2/user-avatar/user-avatar.js +35 -0
- package/dist/esm/lib/document-node-types.js +0 -0
- package/dist/esm/lib/messages.js +24 -0
- package/dist/esm/lib/threaded-annotations.js +2 -0
- package/dist/esm/lib/utils/getErrorMessage.js +2 -0
- package/dist/esm/lib/v2/constants.js +2 -0
- package/dist/esm/lib/v2/messages.js +6 -0
- package/dist/esm/lib/v2/test-utils/mocks/index.js +7 -0
- package/dist/esm/lib/v2/test-utils/mocks/mock-callbacks.js +15 -0
- package/dist/esm/lib/v2/test-utils/mocks/mock-collaboration-props.js +2 -0
- package/dist/esm/lib/v2/test-utils/mocks/mock-messages-long-strings.js +27 -0
- package/dist/esm/lib/v2/test-utils/mocks/mock-messages.js +198 -0
- package/dist/esm/lib/v2/test-utils/mocks/mock-users.js +86 -0
- package/dist/esm/lib/v2/test-utils/mocks/mock-utilities.js +9 -0
- package/dist/esm/lib/v2/threaded-annotations-context.js +49 -0
- package/dist/esm/lib/v2/threaded-annotations.js +3 -0
- package/dist/esm/lib/v2/types/annotation-badge-types.js +4 -0
- package/dist/esm/lib/v2/types/document-node-types.js +0 -0
- package/dist/esm/lib/v2/types/index.js +2 -0
- package/dist/esm/lib/v2/types/message-types.js +0 -0
- package/dist/esm/lib/v2/utils/build-mention-content.js +20 -0
- package/dist/esm/lib/v2/utils/serialize-mention-markup.js +12 -0
- package/dist/i18n/bn-IN.js +44 -0
- package/dist/i18n/bn-IN.properties +84 -0
- package/dist/i18n/da-DK.js +44 -0
- package/dist/i18n/da-DK.properties +84 -0
- package/dist/i18n/de-DE.js +44 -0
- package/dist/i18n/de-DE.properties +84 -0
- package/dist/i18n/en-AU.js +44 -0
- package/dist/i18n/en-AU.properties +84 -0
- package/dist/i18n/en-CA.js +44 -0
- package/dist/i18n/en-CA.properties +84 -0
- package/dist/i18n/en-GB.js +44 -0
- package/dist/i18n/en-GB.properties +84 -0
- package/dist/i18n/en-US.js +44 -0
- package/dist/i18n/en-US.properties +84 -0
- package/dist/i18n/en-x-pseudo.js +44 -0
- package/dist/i18n/en-x-pseudo.properties +84 -0
- package/dist/i18n/es-419.js +44 -0
- package/dist/i18n/es-419.properties +84 -0
- package/dist/i18n/es-ES.js +44 -0
- package/dist/i18n/es-ES.properties +84 -0
- package/dist/i18n/fi-FI.js +44 -0
- package/dist/i18n/fi-FI.properties +84 -0
- package/dist/i18n/fr-CA.js +44 -0
- package/dist/i18n/fr-CA.properties +84 -0
- package/dist/i18n/fr-FR.js +44 -0
- package/dist/i18n/fr-FR.properties +84 -0
- package/dist/i18n/hi-IN.js +44 -0
- package/dist/i18n/hi-IN.properties +84 -0
- package/dist/i18n/it-IT.js +44 -0
- package/dist/i18n/it-IT.properties +84 -0
- package/dist/i18n/ja-JP.js +44 -0
- package/dist/i18n/ja-JP.properties +84 -0
- package/dist/i18n/json/src/lib/components/message-editor/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/message-header/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/messages-view/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/user-avatar/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/v2/annotation-badge/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/v2/message-editor/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/v2/message-header/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/v2/resolved-state/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/v2/show-replies-button/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/v2/text-message/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/v2/user-avatar/messages.json +1 -0
- package/dist/i18n/json/src/lib/messages.json +1 -0
- package/dist/i18n/json/src/lib/v2/messages.json +1 -0
- package/dist/i18n/ko-KR.js +44 -0
- package/dist/i18n/ko-KR.properties +84 -0
- package/dist/i18n/nb-NO.js +44 -0
- package/dist/i18n/nb-NO.properties +84 -0
- package/dist/i18n/nl-NL.js +44 -0
- package/dist/i18n/nl-NL.properties +84 -0
- package/dist/i18n/pl-PL.js +44 -0
- package/dist/i18n/pl-PL.properties +84 -0
- package/dist/i18n/pt-BR.js +44 -0
- package/dist/i18n/pt-BR.properties +84 -0
- package/dist/i18n/ru-RU.js +44 -0
- package/dist/i18n/ru-RU.properties +84 -0
- package/dist/i18n/sv-SE.js +44 -0
- package/dist/i18n/sv-SE.properties +84 -0
- package/dist/i18n/tr-TR.js +44 -0
- package/dist/i18n/tr-TR.properties +84 -0
- package/dist/i18n/zh-CN.js +44 -0
- package/dist/i18n/zh-CN.properties +84 -0
- package/dist/i18n/zh-TW.js +44 -0
- package/dist/i18n/zh-TW.properties +84 -0
- package/dist/styles/annotation-badge.css +1 -0
- package/dist/styles/custom-placeholder.css +1 -0
- package/dist/styles/delete-annotations-message-popover.css +1 -0
- package/dist/styles/delete-confirmation-popover.css +1 -0
- package/dist/styles/mention-component.css +1 -0
- package/dist/styles/message-editor.css +1 -0
- package/dist/styles/message-editor2.css +1 -0
- package/dist/styles/message-footer.css +1 -0
- package/dist/styles/message-header.css +1 -0
- package/dist/styles/messages-view.css +1 -0
- package/dist/styles/resolved-state.css +1 -0
- package/dist/styles/show-replies-button.css +1 -0
- package/dist/styles/text-message.css +1 -0
- package/dist/styles/threaded-annotations.css +1 -0
- package/dist/styles/threaded-annotations2.css +1 -0
- package/dist/styles/virtualized-messages.css +1 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/lib/components/mention-component/mention-component.d.ts +12 -0
- package/dist/types/lib/components/mention-component/mention-context.d.ts +31 -0
- package/dist/types/lib/components/message-editor/editor-extensions/custom-mention/custom-mention-suggestions.d.ts +15 -0
- package/dist/types/lib/components/message-editor/editor-extensions/custom-mention/custom-mention.d.ts +1 -0
- package/dist/types/lib/components/message-editor/editor-extensions/custom-mention/useMentionState.d.ts +15 -0
- package/dist/types/lib/components/message-editor/editor-extensions/custom-paragraph.d.ts +1 -0
- package/dist/types/lib/components/message-editor/editor-extensions/custom-placeholder/custom-placeholder-utils.d.ts +38 -0
- package/dist/types/lib/components/message-editor/editor-extensions/custom-placeholder/custom-placeholder.d.ts +2 -0
- package/dist/types/lib/components/message-editor/error-message.d.ts +3 -0
- package/dist/types/lib/components/message-editor/hooks/useMessageEditor.d.ts +12 -0
- package/dist/types/lib/components/message-editor/hooks/useMessagePost.d.ts +18 -0
- package/dist/types/lib/components/message-editor/message-editor-actions.d.ts +9 -0
- package/dist/types/lib/components/message-editor/message-editor-context.d.ts +13 -0
- package/dist/types/lib/components/message-editor/message-editor.d.ts +36 -0
- package/dist/types/lib/components/message-editor/messages.d.ts +53 -0
- package/dist/types/lib/components/message-editor/stories/shared.d.ts +4 -0
- package/dist/types/lib/components/message-editor/stories/utils/mock-props.d.ts +4 -0
- package/dist/types/lib/components/message-editor/stories/utils/test-utils.d.ts +2 -0
- package/dist/types/lib/components/message-editor/utils/getMessageEditorState.d.ts +13 -0
- package/dist/types/lib/components/message-header/delete-annotations-message-popover.d.ts +11 -0
- package/dist/types/lib/components/message-header/message-header.d.ts +18 -0
- package/dist/types/lib/components/message-header/messages.d.ts +38 -0
- package/dist/types/lib/components/messages-view/consts.d.ts +4 -0
- package/dist/types/lib/components/messages-view/hooks/useAutoScroll.d.ts +9 -0
- package/dist/types/lib/components/messages-view/hooks/useShowMoreReplies.d.ts +10 -0
- package/dist/types/lib/components/messages-view/hooks/useVirtualizedMessages.d.ts +13 -0
- package/dist/types/lib/components/messages-view/messages-view.d.ts +20 -0
- package/dist/types/lib/components/messages-view/messages.d.ts +13 -0
- package/dist/types/lib/components/messages-view/virtualized-messages.d.ts +22 -0
- package/dist/types/lib/components/text-message/message-renderer.d.ts +6 -0
- package/dist/types/lib/components/text-message/stories/shared.d.ts +2 -0
- package/dist/types/lib/components/text-message/stories/utils/test-utils.d.ts +2 -0
- package/dist/types/lib/components/text-message/text-message.d.ts +17 -0
- package/dist/types/lib/components/text-message/types.d.ts +35 -0
- package/dist/types/lib/components/user-avatar/getInitials.d.ts +1 -0
- package/dist/types/lib/components/user-avatar/messages.d.ts +13 -0
- package/dist/types/lib/components/user-avatar/user-avatar.d.ts +10 -0
- package/dist/types/lib/components/v2/annotation-badge/annotation-badge.d.ts +7 -0
- package/dist/types/lib/components/v2/annotation-badge/index.d.ts +1 -0
- package/dist/types/lib/components/v2/annotation-badge/messages.d.ts +8 -0
- package/dist/types/lib/components/v2/message-editor/editor-extensions/custom-mention/custom-mention-suggestions.d.ts +15 -0
- package/dist/types/lib/components/v2/message-editor/editor-extensions/custom-mention/custom-mention.d.ts +1 -0
- package/dist/types/lib/components/v2/message-editor/editor-extensions/custom-mention/mention-trigger-normalization.d.ts +5 -0
- package/dist/types/lib/components/v2/message-editor/editor-extensions/custom-mention/useMentionState.d.ts +15 -0
- package/dist/types/lib/components/v2/message-editor/editor-extensions/custom-paragraph.d.ts +1 -0
- package/dist/types/lib/components/v2/message-editor/hooks/useCharacterLimit.d.ts +15 -0
- package/dist/types/lib/components/v2/message-editor/hooks/useEditorContainerState.d.ts +27 -0
- package/dist/types/lib/components/v2/message-editor/hooks/useMentionUserSelection.d.ts +5 -0
- package/dist/types/lib/components/v2/message-editor/hooks/useMessageSubmit.d.ts +13 -0
- package/dist/types/lib/components/v2/message-editor/message-editor-context.d.ts +12 -0
- package/dist/types/lib/components/v2/message-editor/message-editor.d.ts +3 -0
- package/dist/types/lib/components/v2/message-editor/message-editor.types.d.ts +69 -0
- package/dist/types/lib/components/v2/message-editor/messages.d.ts +53 -0
- package/dist/types/lib/components/v2/message-editor/stories/shared.d.ts +3 -0
- package/dist/types/lib/components/v2/message-editor/stories/utils/mock-props.d.ts +6 -0
- package/dist/types/lib/components/v2/message-editor/stories/utils/test-utils.d.ts +10 -0
- package/dist/types/lib/components/v2/message-editor/subcomponents/character-limit-counter.d.ts +7 -0
- package/dist/types/lib/components/v2/message-editor/subcomponents/edit-buttons.d.ts +11 -0
- package/dist/types/lib/components/v2/message-editor/subcomponents/error-message.d.ts +3 -0
- package/dist/types/lib/components/v2/message-editor/subcomponents/post-button.d.ts +11 -0
- package/dist/types/lib/components/v2/message-header/delete-confirmation-popover.d.ts +11 -0
- package/dist/types/lib/components/v2/message-header/message-header.d.ts +32 -0
- package/dist/types/lib/components/v2/message-header/message-options-menu.d.ts +12 -0
- package/dist/types/lib/components/v2/message-header/messages.d.ts +53 -0
- package/dist/types/lib/components/v2/message-header/stories/shared.d.ts +2 -0
- package/dist/types/lib/components/v2/message-header/stories/utils/test-utils.d.ts +1 -0
- package/dist/types/lib/components/v2/messages-view/hooks/useAutoScroll.d.ts +12 -0
- package/dist/types/lib/components/v2/messages-view/messages-view.d.ts +17 -0
- package/dist/types/lib/components/v2/messages-view/stories/shared.d.ts +7 -0
- package/dist/types/lib/components/v2/resolved-state/messages.d.ts +13 -0
- package/dist/types/lib/components/v2/resolved-state/resolved-state.d.ts +11 -0
- package/dist/types/lib/components/v2/resolved-state/stories/shared.d.ts +2 -0
- package/dist/types/lib/components/v2/show-replies-button/messages.d.ts +13 -0
- package/dist/types/lib/components/v2/show-replies-button/show-replies-button.d.ts +8 -0
- package/dist/types/lib/components/v2/text-message/messages.d.ts +23 -0
- package/dist/types/lib/components/v2/text-message/stories/shared.d.ts +2 -0
- package/dist/types/lib/components/v2/text-message/stories/utils/test-utils.d.ts +2 -0
- package/dist/types/lib/components/v2/text-message/subcomponents/message-footer.d.ts +10 -0
- package/dist/types/lib/components/v2/text-message/subcomponents/message-renderer.d.ts +6 -0
- package/dist/types/lib/components/v2/text-message/text-message.d.ts +26 -0
- package/dist/types/lib/components/v2/user-avatar/getInitials.d.ts +1 -0
- package/dist/types/lib/components/v2/user-avatar/messages.d.ts +13 -0
- package/dist/types/lib/components/v2/user-avatar/user-avatar.d.ts +12 -0
- package/dist/types/lib/document-node-types.d.ts +32 -0
- package/dist/types/lib/messages.d.ts +28 -0
- package/dist/types/lib/stories/mock/index.d.ts +5 -0
- package/dist/types/lib/stories/mock/mock-callbacks.d.ts +6 -0
- package/dist/types/lib/stories/mock/mock-messages-long-strings.d.ts +11 -0
- package/dist/types/lib/stories/mock/mock-messages.d.ts +8 -0
- package/dist/types/lib/stories/mock/mock-users.d.ts +56 -0
- package/dist/types/lib/stories/mock/mock-utilities.d.ts +6 -0
- package/dist/types/lib/stories/shared.d.ts +9 -0
- package/dist/types/lib/stories/utils/mock-collaboration-props.d.ts +13 -0
- package/dist/types/lib/stories/utils/mock-props.d.ts +20 -0
- package/dist/types/lib/stories/utils/mock-state.d.ts +8 -0
- package/dist/types/lib/stories/utils/shared/button-utils.d.ts +6 -0
- package/dist/types/lib/stories/utils/shared/index.d.ts +4 -0
- package/dist/types/lib/stories/utils/shared/interaction-utils.d.ts +4 -0
- package/dist/types/lib/stories/utils/shared/test-selectors.d.ts +7 -0
- package/dist/types/lib/stories/utils/shared/text-utils.d.ts +4 -0
- package/dist/types/lib/stories/utils/shared/verify-mention-elements.d.ts +2 -0
- package/dist/types/lib/stories/utils/test-utils.d.ts +3 -0
- package/dist/types/lib/threaded-annotations.d.ts +51 -0
- package/dist/types/lib/utils/getErrorMessage.d.ts +1 -0
- package/dist/types/lib/v2/constants.d.ts +8 -0
- package/dist/types/lib/v2/messages.d.ts +8 -0
- package/dist/types/lib/v2/stories/shared.d.ts +18 -0
- package/dist/types/lib/v2/test-utils/button-utils.d.ts +15 -0
- package/dist/types/lib/v2/test-utils/default-user-selector-props.d.ts +2 -0
- package/dist/types/lib/v2/test-utils/index.d.ts +7 -0
- package/dist/types/lib/v2/test-utils/interaction-utils.d.ts +9 -0
- package/dist/types/lib/v2/test-utils/mocks/index.d.ts +6 -0
- package/dist/types/lib/v2/test-utils/mocks/mock-callbacks.d.ts +8 -0
- package/dist/types/lib/v2/test-utils/mocks/mock-collaboration-props.d.ts +13 -0
- package/dist/types/lib/v2/test-utils/mocks/mock-messages-long-strings.d.ts +5 -0
- package/dist/types/lib/v2/test-utils/mocks/mock-messages.d.ts +10 -0
- package/dist/types/lib/v2/test-utils/mocks/mock-users.d.ts +55 -0
- package/dist/types/lib/v2/test-utils/mocks/mock-utilities.d.ts +6 -0
- package/dist/types/lib/v2/test-utils/test-selectors.d.ts +12 -0
- package/dist/types/lib/v2/test-utils/text-utils.d.ts +3 -0
- package/dist/types/lib/v2/test-utils/verify-mention-elements.d.ts +2 -0
- package/dist/types/lib/v2/threaded-annotations-context.d.ts +47 -0
- package/dist/types/lib/v2/threaded-annotations.d.ts +42 -0
- package/dist/types/lib/v2/types/annotation-badge-types.d.ts +23 -0
- package/dist/types/lib/v2/types/document-node-types.d.ts +32 -0
- package/dist/types/lib/v2/types/index.d.ts +3 -0
- package/dist/types/lib/v2/types/message-types.d.ts +33 -0
- package/dist/types/lib/v2/utils/build-mention-content.d.ts +3 -0
- package/dist/types/lib/v2/utils/serialize-mention-markup.d.ts +16 -0
- package/package.json +66 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { EditorView } from '@tiptap/pm/view';
|
|
2
|
+
export declare const MENTION_PLUGIN_KEY = "mentionAt";
|
|
3
|
+
export declare const MENTION_CHAR = "@";
|
|
4
|
+
export declare const normalizeMentionTextInput: (view: EditorView, from: number, to: number, text: string) => boolean;
|
|
5
|
+
export declare const normalizeMentionPastedText: (text: string) => string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { HeadlessUserSelectorHandle } from '@box/user-selector';
|
|
2
|
+
import { MutableRefObject } from 'react';
|
|
3
|
+
import { EditorMentionAttributes } from '../../../../../v2/types';
|
|
4
|
+
import { SuggestionCallbacks } from './custom-mention-suggestions';
|
|
5
|
+
export declare enum KeyEvents {
|
|
6
|
+
ARROW_DOWN = "ArrowDown",
|
|
7
|
+
ARROW_UP = "ArrowUp",
|
|
8
|
+
ENTER = "Enter"
|
|
9
|
+
}
|
|
10
|
+
export declare const useMentionState: (userSelectorRef: MutableRefObject<HeadlessUserSelectorHandle | null>) => {
|
|
11
|
+
isActive: boolean;
|
|
12
|
+
query: string;
|
|
13
|
+
command: (props: EditorMentionAttributes) => void;
|
|
14
|
+
suggestionCallbacks: SuggestionCallbacks;
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CustomParagraph: import('@tiptap/core').Node<import('@tiptap/extension-paragraph').ParagraphOptions, any>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/core';
|
|
2
|
+
import { JSONContent } from '@tiptap/react';
|
|
3
|
+
export interface CharacterLimitState {
|
|
4
|
+
/** Current character count */
|
|
5
|
+
count: number;
|
|
6
|
+
/** Number of characters over the limit (0 if not exceeded) */
|
|
7
|
+
excess: number;
|
|
8
|
+
/** The configured maximum character count */
|
|
9
|
+
maxCount: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Tracks the editor's character count relative to the configured limit.
|
|
13
|
+
* Returns null when disabled (no editor).
|
|
14
|
+
*/
|
|
15
|
+
export declare const useCharacterLimit: (editor: Editor | null, initialContent?: JSONContent | string | null, maxCount?: number) => CharacterLimitState | null;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/core';
|
|
2
|
+
export interface EditorContainerState {
|
|
3
|
+
/** True when content height exceeds one line (e.g. user pressed Enter). */
|
|
4
|
+
exceedsSingleLine: boolean;
|
|
5
|
+
/** True when the container has vertical or horizontal scroll (content overflows). */
|
|
6
|
+
hasScroll: boolean;
|
|
7
|
+
/** True when the user has scrolled to the bottom (within threshold). */
|
|
8
|
+
isAtBottom: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Observes the editor container's content and returns layout state.
|
|
12
|
+
*
|
|
13
|
+
* Uses a ResizeObserver on the content element (first child or container) because the
|
|
14
|
+
* container's box size stays fixed due to max-height/overflow, so observing the
|
|
15
|
+
* container itself would not fire on content changes.
|
|
16
|
+
*
|
|
17
|
+
* State updates are triggered by: ResizeObserver, scroll events, and editor.on('update').
|
|
18
|
+
*
|
|
19
|
+
* - exceedsSingleLine: True when doc has 2+ paragraphs (if editor provided), or when
|
|
20
|
+
* content height exceeds SINGLE_LINE_HEIGHT ± HYSTERESIS for single-paragraph wrapping.
|
|
21
|
+
* - hasScroll: True when container.scrollHeight - clientHeight > SCROLL_THRESHOLD.
|
|
22
|
+
* - isAtBottom: True when scrollTop + clientHeight >= scrollHeight - SCROLL_BOTTOM_THRESHOLD.
|
|
23
|
+
*
|
|
24
|
+
* @param containerRef - Ref to the scrollable container (overflow-y: auto)
|
|
25
|
+
* @param editor - Optional Tiptap editor; when provided, doc.childCount and on('update') are used
|
|
26
|
+
*/
|
|
27
|
+
export declare const useEditorContainerState: (containerRef: React.RefObject<HTMLElement | null>, editor?: Editor | null) => EditorContainerState;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { UserContactType } from '@box/user-selector';
|
|
2
|
+
import { EditorMentionAttributes } from '../../../../v2/types';
|
|
3
|
+
export declare const useMentionUserSelection: (command: ((props: EditorMentionAttributes) => void) | null) => {
|
|
4
|
+
onUserSelected: (user: UserContactType) => Promise<void>;
|
|
5
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { JSONContent } from '@tiptap/react';
|
|
2
|
+
import { TextMessageType } from '../../../../v2/types';
|
|
3
|
+
interface UseMessageSubmitProps {
|
|
4
|
+
onSubmit: (content: JSONContent | null) => Promise<TextMessageType | void> | TextMessageType | void;
|
|
5
|
+
onSubmitError?: (error: unknown) => string | undefined;
|
|
6
|
+
onSuccess?: () => void;
|
|
7
|
+
cleanEditor?: () => void;
|
|
8
|
+
getEditorJsonContent: () => JSONContent | null;
|
|
9
|
+
}
|
|
10
|
+
export declare const useMessageSubmit: ({ onSubmit, onSubmitError, onSuccess, cleanEditor, getEditorJsonContent, }: UseMessageSubmitProps) => {
|
|
11
|
+
handleSubmit: () => Promise<void>;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface MessageEditorContextValue {
|
|
3
|
+
errorMessage: string | null;
|
|
4
|
+
setErrorMessage: (message: string | null) => void;
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
setIsLoading: (value: boolean) => void;
|
|
7
|
+
}
|
|
8
|
+
export interface MessageEditorProviderProps {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare const MessageEditorProvider: ({ children }: MessageEditorProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const useMessageEditorContext: () => MessageEditorContextValue;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { HeadlessUserSelectorProps } from '@box/user-selector';
|
|
2
|
+
import { JSONContent } from '@tiptap/react';
|
|
3
|
+
import { TextMessageType } from '../../../v2/types';
|
|
4
|
+
export declare enum MessageEditorVariant {
|
|
5
|
+
CREATE_MESSAGE = "CREATE_MESSAGE",
|
|
6
|
+
EDIT_MESSAGE = "EDIT_MESSAGE"
|
|
7
|
+
}
|
|
8
|
+
type MessageActionCallback = (content: JSONContent | null) => Promise<TextMessageType | void> | TextMessageType | void;
|
|
9
|
+
interface BaseMessageEditorProps {
|
|
10
|
+
disableComponent?: boolean;
|
|
11
|
+
/** When true (create mode only), editor does not expand to full width. Defaults to false. */
|
|
12
|
+
isFirstAnnotation?: boolean;
|
|
13
|
+
/** Optional initial editor content used to prefill the editor (both edit and post modes). */
|
|
14
|
+
initialContent?: JSONContent | string | null;
|
|
15
|
+
/** Maximum character count. Defaults to 5000. */
|
|
16
|
+
maxCharacterCount?: number;
|
|
17
|
+
/** Properties for the user selector component from blueprint-web. */
|
|
18
|
+
userSelectorProps: Omit<HeadlessUserSelectorProps, 'inputElementRef' | 'onSelectedUserChange' | 'open' | 'rootElement' | 'value'>;
|
|
19
|
+
}
|
|
20
|
+
interface CreateMessageEditorProps extends BaseMessageEditorProps {
|
|
21
|
+
/**
|
|
22
|
+
* A callback function to be executed when the user posts a message.
|
|
23
|
+
* @param content The content of the message in JSON format or null.
|
|
24
|
+
* @returns A promise or synchronous function that adds new message to the thread.
|
|
25
|
+
*/
|
|
26
|
+
onPost: MessageActionCallback;
|
|
27
|
+
/**
|
|
28
|
+
* An optional callback function to handle errors during the post operation.
|
|
29
|
+
* @param error The error object.
|
|
30
|
+
* @returns An optional error message string to be displayed.
|
|
31
|
+
*/
|
|
32
|
+
onPostError?: (error: unknown) => string | undefined;
|
|
33
|
+
/** Optional callback fired after a message is successfully posted. */
|
|
34
|
+
onPostSuccess?: () => void;
|
|
35
|
+
variant?: MessageEditorVariant.CREATE_MESSAGE;
|
|
36
|
+
onSave?: never;
|
|
37
|
+
onSaveError?: never;
|
|
38
|
+
onEditSuccess?: never;
|
|
39
|
+
onEditCancel?: never;
|
|
40
|
+
}
|
|
41
|
+
interface EditMessageEditorProps extends BaseMessageEditorProps {
|
|
42
|
+
/**
|
|
43
|
+
* A callback function to be executed when the user saves an edited message.
|
|
44
|
+
* @param content The content of the message in JSON format or null.
|
|
45
|
+
* @returns A promise or synchronous function that updates the message.
|
|
46
|
+
*/
|
|
47
|
+
onSave: MessageActionCallback;
|
|
48
|
+
/**
|
|
49
|
+
* An optional callback function to handle errors during the save operation.
|
|
50
|
+
* @param error The error object.
|
|
51
|
+
* @returns An optional error message string to be displayed.
|
|
52
|
+
*/
|
|
53
|
+
onSaveError?: (error: unknown) => string | undefined;
|
|
54
|
+
/** Optional callback fired after a message is successfully saved. */
|
|
55
|
+
onEditSuccess?: () => void;
|
|
56
|
+
/** Optional callback fired when edit cancel is clicked. */
|
|
57
|
+
onEditCancel?: () => void;
|
|
58
|
+
variant: MessageEditorVariant.EDIT_MESSAGE;
|
|
59
|
+
onPost?: never;
|
|
60
|
+
onPostError?: never;
|
|
61
|
+
onPostSuccess?: never;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Message editor props modeled as a discriminated union by `variant`:
|
|
65
|
+
* - `EDIT_MESSAGE` requires `onSave`
|
|
66
|
+
* - omitted/default variant is create mode and requires `onPost`
|
|
67
|
+
*/
|
|
68
|
+
export type MessageEditorProps = CreateMessageEditorProps | EditMessageEditorProps;
|
|
69
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
declare const messages: {
|
|
2
|
+
cancel: {
|
|
3
|
+
defaultMessage: string;
|
|
4
|
+
description: string;
|
|
5
|
+
id: string;
|
|
6
|
+
};
|
|
7
|
+
characterCount: {
|
|
8
|
+
defaultMessage: string;
|
|
9
|
+
description: string;
|
|
10
|
+
id: string;
|
|
11
|
+
};
|
|
12
|
+
characterLimitExceeded: {
|
|
13
|
+
defaultMessage: string;
|
|
14
|
+
description: string;
|
|
15
|
+
id: string;
|
|
16
|
+
};
|
|
17
|
+
editorContentAriaLabel: {
|
|
18
|
+
defaultMessage: string;
|
|
19
|
+
description: string;
|
|
20
|
+
id: string;
|
|
21
|
+
};
|
|
22
|
+
placeholder: {
|
|
23
|
+
defaultMessage: string;
|
|
24
|
+
description: string;
|
|
25
|
+
id: string;
|
|
26
|
+
};
|
|
27
|
+
post: {
|
|
28
|
+
defaultMessage: string;
|
|
29
|
+
description: string;
|
|
30
|
+
id: string;
|
|
31
|
+
};
|
|
32
|
+
postLoading: {
|
|
33
|
+
defaultMessage: string;
|
|
34
|
+
description: string;
|
|
35
|
+
id: string;
|
|
36
|
+
};
|
|
37
|
+
save: {
|
|
38
|
+
defaultMessage: string;
|
|
39
|
+
description: string;
|
|
40
|
+
id: string;
|
|
41
|
+
};
|
|
42
|
+
saveLoading: {
|
|
43
|
+
defaultMessage: string;
|
|
44
|
+
description: string;
|
|
45
|
+
id: string;
|
|
46
|
+
};
|
|
47
|
+
scrollContainerAriaLabel: {
|
|
48
|
+
defaultMessage: string;
|
|
49
|
+
description: string;
|
|
50
|
+
id: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export default messages;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { MessageEditorProps } from '../message-editor';
|
|
2
|
+
export declare const defaultUserSelectorProps: Omit<import('@box/user-selector').HeadlessUserSelectorProps, "value" | "open" | "rootElement" | "onSelectedUserChange" | "inputElementRef">;
|
|
3
|
+
export declare const DefaultMessageEditor: (props: MessageEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createMockFetchAvatarUrls, createMockFetchUsers } from '../../../../../v2/test-utils/mocks';
|
|
2
|
+
export declare const mockOnPost: (content: import('@tiptap/core').JSONContent | null) => Promise<import('../../../../../..').TextMessageTypeV2>;
|
|
3
|
+
export declare const mockOnPostWithError: () => Promise<never>;
|
|
4
|
+
export declare const mockOnSave: (content: import('@tiptap/core').JSONContent | null) => Promise<import('../../../../../..').TextMessageTypeV2>;
|
|
5
|
+
export declare const mockOnSaveWithError: () => Promise<never>;
|
|
6
|
+
export { createMockFetchAvatarUrls, createMockFetchUsers };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const waitForPlaceholderToAppear: (canvasElement: HTMLElement) => Promise<void>;
|
|
2
|
+
/**
|
|
3
|
+
* Waits for the v2 message editor placeholder to disappear (e.g. after typing).
|
|
4
|
+
*/
|
|
5
|
+
export declare const waitForPlaceholderToDisappear: (canvasElement: HTMLElement) => Promise<void>;
|
|
6
|
+
/**
|
|
7
|
+
* Scrolls the message editor container to top or bottom.
|
|
8
|
+
* Targets the scroll container via aria-label; uses editor.closest when multiple scroll containers exist.
|
|
9
|
+
*/
|
|
10
|
+
export declare const scrollEditorTo: (canvasElement: HTMLElement, position: "top" | "bottom", delay?: number) => Promise<void>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { JSONContent } from '@tiptap/react';
|
|
2
|
+
import { TextMessageType } from '../../../../v2/types';
|
|
3
|
+
export interface EditButtonsProps {
|
|
4
|
+
onSave: (content: JSONContent | null) => Promise<TextMessageType | void> | TextMessageType | void;
|
|
5
|
+
onSaveError?: (error: unknown) => string | undefined;
|
|
6
|
+
onEditSuccess?: () => void;
|
|
7
|
+
onCancel?: () => void;
|
|
8
|
+
getEditorJsonContent: () => JSONContent | null;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const EditButtons: ({ onSave, onSaveError, onEditSuccess, onCancel, getEditorJsonContent, disabled, }: EditButtonsProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { JSONContent } from '@tiptap/react';
|
|
2
|
+
import { TextMessageType } from '../../../../v2/types';
|
|
3
|
+
export interface PostButtonProps {
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
onPost: (content: JSONContent | null) => Promise<TextMessageType | void> | TextMessageType | void;
|
|
6
|
+
onPostError?: (error: unknown) => string | undefined;
|
|
7
|
+
onPostSuccess?: () => void;
|
|
8
|
+
cleanEditor: () => void;
|
|
9
|
+
getEditorJsonContent: () => JSONContent | null;
|
|
10
|
+
}
|
|
11
|
+
export declare const PostButton: ({ disabled, onPost, onPostError, onPostSuccess, cleanEditor, getEditorJsonContent, }: PostButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface DeleteConfirmationPopoverProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
onOpenChange: (open: boolean) => void;
|
|
4
|
+
onConfirm: () => void;
|
|
5
|
+
onCancel: () => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Renders a delete confirmation popover anchored to the bottom-right.
|
|
9
|
+
* Used when the user selects Delete from the message options menu.
|
|
10
|
+
*/
|
|
11
|
+
export declare const DeleteConfirmationPopover: ({ open, onOpenChange, onConfirm, onCancel, }: DeleteConfirmationPopoverProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { TextMessageAuthorType } from '../../../v2/types/message-types';
|
|
2
|
+
export interface MessageHeaderProps {
|
|
3
|
+
/** The author whose avatar and name are displayed in the header. */
|
|
4
|
+
author: TextMessageAuthorType;
|
|
5
|
+
/** Whether the Resolve/Unresolve option is available in the options menu. */
|
|
6
|
+
canResolve?: boolean;
|
|
7
|
+
/** Whether the message is currently resolved. When true and canResolve is true, shows Unresolve; when false and canResolve is true, shows Resolve. */
|
|
8
|
+
isResolved?: boolean;
|
|
9
|
+
/** Whether the Edit option is available in the options menu. */
|
|
10
|
+
canEdit?: boolean;
|
|
11
|
+
/** Whether the Delete option is available in the options menu. */
|
|
12
|
+
canDelete?: boolean;
|
|
13
|
+
/** Whether the message is the first message in the thread. */
|
|
14
|
+
isFirstMessage?: boolean;
|
|
15
|
+
/** Callback invoked when the user clicks the author avatar. */
|
|
16
|
+
onAvatarClick: (id: number) => void;
|
|
17
|
+
/** Callback invoked when the user selects Edit from the options menu. */
|
|
18
|
+
onEdit?: () => void;
|
|
19
|
+
/** Callback invoked when the user selects Resolve from the options menu. */
|
|
20
|
+
onResolve?: () => void;
|
|
21
|
+
/** Callback invoked when the user selects Unresolve from the options menu. */
|
|
22
|
+
onUnresolve?: () => void;
|
|
23
|
+
/** Callback invoked when the user selects Delete from the options menu. */
|
|
24
|
+
onDelete?: () => void;
|
|
25
|
+
/** Callback invoked when the user confirms deletion of the entire thread (only used when isFirstMessage is true). */
|
|
26
|
+
onThreadDelete?: () => void;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Renders the header section of a threaded message, including
|
|
30
|
+
* the author avatar, name, and an optional delete action.
|
|
31
|
+
*/
|
|
32
|
+
export declare const MessageHeader: ({ author, canResolve, isResolved, canEdit, canDelete, isFirstMessage, onAvatarClick, onEdit, onResolve, onUnresolve, onDelete, onThreadDelete, }: MessageHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface MessageOptionsMenuProps {
|
|
2
|
+
canDelete?: boolean;
|
|
3
|
+
canEdit?: boolean;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
onEdit?: () => void;
|
|
6
|
+
onDelete?: () => void;
|
|
7
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Renders a context menu for an annotation message with Edit and Delete options.
|
|
11
|
+
*/
|
|
12
|
+
export declare const MessageOptionsMenu: ({ canDelete, canEdit, disabled, onEdit, onDelete, onOpenChange, }: MessageOptionsMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
declare const messages: {
|
|
2
|
+
deleteConfirmation: {
|
|
3
|
+
defaultMessage: string;
|
|
4
|
+
description: string;
|
|
5
|
+
id: string;
|
|
6
|
+
};
|
|
7
|
+
deleteCommentQuestion: {
|
|
8
|
+
defaultMessage: string;
|
|
9
|
+
description: string;
|
|
10
|
+
id: string;
|
|
11
|
+
};
|
|
12
|
+
deleteCancel: {
|
|
13
|
+
defaultMessage: string;
|
|
14
|
+
description: string;
|
|
15
|
+
id: string;
|
|
16
|
+
};
|
|
17
|
+
delete: {
|
|
18
|
+
defaultMessage: string;
|
|
19
|
+
description: string;
|
|
20
|
+
id: string;
|
|
21
|
+
};
|
|
22
|
+
moreOptionsAriaLabel: {
|
|
23
|
+
defaultMessage: string;
|
|
24
|
+
description: string;
|
|
25
|
+
id: string;
|
|
26
|
+
};
|
|
27
|
+
cancelDeleteButtonAriaLabel: {
|
|
28
|
+
defaultMessage: string;
|
|
29
|
+
description: string;
|
|
30
|
+
id: string;
|
|
31
|
+
};
|
|
32
|
+
deleteButtonAriaLabel: {
|
|
33
|
+
defaultMessage: string;
|
|
34
|
+
description: string;
|
|
35
|
+
id: string;
|
|
36
|
+
};
|
|
37
|
+
edit: {
|
|
38
|
+
defaultMessage: string;
|
|
39
|
+
description: string;
|
|
40
|
+
id: string;
|
|
41
|
+
};
|
|
42
|
+
resolveButtonAriaLabel: {
|
|
43
|
+
defaultMessage: string;
|
|
44
|
+
description: string;
|
|
45
|
+
id: string;
|
|
46
|
+
};
|
|
47
|
+
unresolveButtonAriaLabel: {
|
|
48
|
+
defaultMessage: string;
|
|
49
|
+
description: string;
|
|
50
|
+
id: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export default messages;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const focusHeader: (canvasElement: HTMLElement) => Promise<void>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface UseAutoScrollProps {
|
|
2
|
+
messageCount: number;
|
|
3
|
+
containerRef: React.RefObject<HTMLDivElement>;
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
isExpanded?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const useAutoScroll: ({ messageCount, containerRef, enabled, isExpanded }: UseAutoScrollProps) => {
|
|
8
|
+
handleScroll: () => void;
|
|
9
|
+
handleScrollToBottom: () => void;
|
|
10
|
+
isOverflowing: boolean;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AnnotationBadgeTargetType } from '../../../v2/types/annotation-badge-types';
|
|
2
|
+
import { TextMessageType } from '../../../v2/types/message-types';
|
|
3
|
+
export interface MessagesViewProps {
|
|
4
|
+
messages: TextMessageType[];
|
|
5
|
+
isResolved?: boolean;
|
|
6
|
+
resolvedBy?: string;
|
|
7
|
+
resolvedAt?: number;
|
|
8
|
+
onDelete: (id: string) => void;
|
|
9
|
+
onThreadDelete?: () => void;
|
|
10
|
+
onAvatarClick: (id: number) => void;
|
|
11
|
+
onEdit?: (id: string) => void;
|
|
12
|
+
onResolve?: (id: string) => void;
|
|
13
|
+
onUnresolve?: (id: string) => void;
|
|
14
|
+
annotationTarget?: AnnotationBadgeTargetType;
|
|
15
|
+
onAnnotationBadgeClick?: (id: string) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const MessagesView: ({ messages, isResolved, resolvedBy, resolvedAt, onDelete, onThreadDelete, onAvatarClick, onEdit, onResolve, onUnresolve, annotationTarget, onAnnotationBadgeClick, }: MessagesViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MessagesViewProps } from '../messages-view';
|
|
2
|
+
export interface DefaultMessagesViewProps extends MessagesViewProps {
|
|
3
|
+
isReplyDisabled?: boolean;
|
|
4
|
+
isAnnotations?: boolean;
|
|
5
|
+
isResolvedContext?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const DefaultMessagesView: ({ isReplyDisabled, isAnnotations, isResolvedContext, ...props }: DefaultMessagesViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ResolvedStateProps {
|
|
2
|
+
/** The display name of the user who resolved the thread. */
|
|
3
|
+
authorName: string;
|
|
4
|
+
/** Unix timestamp (in ms) for when the thread was resolved. */
|
|
5
|
+
createdAt: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Renders a status message indicating that a user has marked
|
|
9
|
+
* a comment thread as resolved.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ResolvedState: ({ authorName, createdAt }: ResolvedStateProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TextMessageAuthorType } from '../../../v2/types/message-types';
|
|
2
|
+
export interface ShowRepliesButtonProps {
|
|
3
|
+
onShowReplies: () => void;
|
|
4
|
+
repliesCount: number;
|
|
5
|
+
lastUser: TextMessageAuthorType;
|
|
6
|
+
secondLastUser?: TextMessageAuthorType;
|
|
7
|
+
}
|
|
8
|
+
export declare const ShowRepliesButton: ({ onShowReplies, repliesCount, lastUser, secondLastUser, }: ShowRepliesButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const messages: {
|
|
2
|
+
annotationMessageAriaLabel: {
|
|
3
|
+
defaultMessage: string;
|
|
4
|
+
description: string;
|
|
5
|
+
id: string;
|
|
6
|
+
};
|
|
7
|
+
reply: {
|
|
8
|
+
defaultMessage: string;
|
|
9
|
+
description: string;
|
|
10
|
+
id: string;
|
|
11
|
+
};
|
|
12
|
+
replyButtonAriaLabel: {
|
|
13
|
+
defaultMessage: string;
|
|
14
|
+
description: string;
|
|
15
|
+
id: string;
|
|
16
|
+
};
|
|
17
|
+
textMessageAriaLabel: {
|
|
18
|
+
defaultMessage: string;
|
|
19
|
+
description: string;
|
|
20
|
+
id: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export default messages;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface MessageFooterProps {
|
|
2
|
+
/** Unix timestamp (in ms) for when the message was created. */
|
|
3
|
+
createdAt: number;
|
|
4
|
+
/** Callback invoked when the user clicks the reply button. */
|
|
5
|
+
onReply?: () => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Renders the footer of a message with readable time and reply button.
|
|
9
|
+
*/
|
|
10
|
+
export declare const MessageFooter: ({ createdAt, onReply }: MessageFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AnnotationBadgeTargetType } from '../../../v2/types/annotation-badge-types';
|
|
2
|
+
import { TextMessageType } from '../../../v2/types/message-types';
|
|
3
|
+
/**
|
|
4
|
+
* Defines the props for the TextMessage component, combining message data with actionable callbacks.
|
|
5
|
+
*/
|
|
6
|
+
export interface TextMessageProps extends TextMessageType {
|
|
7
|
+
showThreadedIndicator?: boolean;
|
|
8
|
+
isResolved?: boolean;
|
|
9
|
+
isFirstMessage?: boolean;
|
|
10
|
+
onDelete: (id: string) => void;
|
|
11
|
+
onThreadDelete?: () => void;
|
|
12
|
+
onAvatarClick: (id: number) => void;
|
|
13
|
+
onEdit?: (id: string) => void;
|
|
14
|
+
onResolve?: (id: string) => void;
|
|
15
|
+
onUnresolve?: (id: string) => void;
|
|
16
|
+
annotationTarget?: AnnotationBadgeTargetType;
|
|
17
|
+
onAnnotationBadgeClick?: (id: string) => void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Renders a single message within a text thread.
|
|
21
|
+
*
|
|
22
|
+
* This component is responsible for displaying the author's avatar and name,
|
|
23
|
+
* the message content itself, a relative timestamp, and providing a mechanism
|
|
24
|
+
* for deleting the message.
|
|
25
|
+
*/
|
|
26
|
+
export declare const TextMessage: ({ id, author, message, createdAt, permissions, showThreadedIndicator, isResolved, isFirstMessage, onAvatarClick, onDelete, onThreadDelete, onEdit, onResolve, onUnresolve, annotationTarget, onAnnotationBadgeClick, }: TextMessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getInitials: (name: string) => string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TextMessageAuthorType } from '../../../v2/types';
|
|
2
|
+
export type UserAvatarSize = 'small' | 'medium';
|
|
3
|
+
interface UserAvatarProps {
|
|
4
|
+
user: TextMessageAuthorType;
|
|
5
|
+
size?: UserAvatarSize;
|
|
6
|
+
}
|
|
7
|
+
export declare const UserAvatar: ({ user, size }: UserAvatarProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
interface UserAvatarButtonProps extends UserAvatarProps {
|
|
9
|
+
onClick: (id: number) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const UserAvatarButton: ({ user, size, onClick }: UserAvatarButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|