@box/threaded-annotations 4.15.32 → 4.15.34
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{THREADED_ANNOTATIONS_RESIN_TARGETS}from"../../../v2/resin-targets.js";import{useThreadedAnnotationsContext}from"../../../v2/threaded-annotations-context.js";import{UserAvatarButton}from"../user-avatar/user-avatar.js";import{n as message_header_module_default,t as DeleteConfirmationPopover}from"../../../../../chunks/delete-confirmation-popover.js";import messages from"./messages.js";import{MessageOptionsMenu}from"./message-options-menu.js";import{IconButton,Text,Tooltip}from"@box/blueprint-web";import{useState}from"react";import{useIntl}from"react-intl";import{jsx,jsxs}from"react/jsx-runtime";import{CheckmarkCircle}from"@box/blueprint-web-assets/icons/Medium";import{CheckmarkCircle as CheckmarkCircle$1}from"@box/blueprint-web-assets/icons/MediumFilled";var MessageHeader=({author,canResolve=!1,isResolved=!1,canEdit=!0,canDelete=!0,hasReplies=!1,isFirstMessage=!1,onAvatarClick,onCopyLink,onDelete,onEdit,onResolve,onThreadDelete,onUnresolve})=>{let intl=useIntl(),{isAnnotations}=useThreadedAnnotationsContext(),[isMenuOpen,setIsMenuOpen]=useState(!1),[isDeletePopoverOpen,setIsDeletePopoverOpen]=useState(!1);return jsxs(`div`,{className:message_header_module_default.headerContainer,children:[jsxs(`div`,{className:message_header_module_default.information,children:[jsx(UserAvatarButton,{onClick:onAvatarClick,user:author}),jsx(`div`,{className:message_header_module_default.textContainer,"data-message-author":!0,children:jsx(Text,{as:`p`,className:message_header_module_default.author,color:`textOnLightDefault`,variant:`bodyDefaultBold`,children:author.name})})]}),jsxs(`div`,{className:message_header_module_default.optionsMenu,"data-state":isMenuOpen||isDeletePopoverOpen?`open`:`closed`,children:[canResolve&&!isResolved&&jsx(Tooltip,{content:intl.formatMessage(messages.resolveButtonAriaLabel),children:jsx(IconButton,{"aria-label":intl.formatMessage(messages.resolveButtonAriaLabel),"data-no-expand":!0,"data-resin-target":isAnnotations?THREADED_ANNOTATIONS_RESIN_TARGETS.ANNOTATION_RESOLVE:THREADED_ANNOTATIONS_RESIN_TARGETS.COMMENT_RESOLVE,disabled:isDeletePopoverOpen,icon:CheckmarkCircle,onClick:()=>onResolve?.(),size:`small`})}),canResolve&&isResolved&&jsx(Tooltip,{content:intl.formatMessage(messages.unresolveButtonAriaLabel),children:jsx(IconButton,{"aria-label":intl.formatMessage(messages.unresolveButtonAriaLabel),"data-no-expand":!0,"data-resin-target":isAnnotations?THREADED_ANNOTATIONS_RESIN_TARGETS.ANNOTATION_UNRESOLVE:THREADED_ANNOTATIONS_RESIN_TARGETS.COMMENT_UNRESOLVE,disabled:isDeletePopoverOpen,icon:CheckmarkCircle$1,onClick:()=>onUnresolve?.(),size:`small
|
|
1
|
+
import{THREADED_ANNOTATIONS_RESIN_TARGETS}from"../../../v2/resin-targets.js";import{useThreadedAnnotationsContext}from"../../../v2/threaded-annotations-context.js";import{UserAvatarButton}from"../user-avatar/user-avatar.js";import{n as message_header_module_default,t as DeleteConfirmationPopover}from"../../../../../chunks/delete-confirmation-popover.js";import messages from"./messages.js";import{MessageOptionsMenu}from"./message-options-menu.js";import{IconButton,Text,Tooltip}from"@box/blueprint-web";import{useState}from"react";import{useIntl}from"react-intl";import{jsx,jsxs}from"react/jsx-runtime";import{CheckmarkCircle}from"@box/blueprint-web-assets/icons/Medium";import{CheckmarkCircle as CheckmarkCircle$1}from"@box/blueprint-web-assets/icons/MediumFilled";var MessageHeader=({author,canResolve=!1,isResolved=!1,canEdit=!0,canDelete=!0,hasReplies=!1,isFirstMessage=!1,onAvatarClick,onCopyLink,onDelete,onEdit,onResolve,onThreadDelete,onUnresolve})=>{let intl=useIntl(),{isAnnotations}=useThreadedAnnotationsContext(),[isMenuOpen,setIsMenuOpen]=useState(!1),[isDeletePopoverOpen,setIsDeletePopoverOpen]=useState(!1);return jsxs(`div`,{className:message_header_module_default.headerContainer,children:[jsxs(`div`,{className:message_header_module_default.information,children:[jsx(UserAvatarButton,{onClick:onAvatarClick,user:author}),jsx(`div`,{className:message_header_module_default.textContainer,"data-message-author":!0,children:jsx(Text,{as:`p`,className:message_header_module_default.author,color:`textOnLightDefault`,variant:`bodyDefaultBold`,children:author.name})})]}),jsxs(`div`,{className:message_header_module_default.optionsMenu,"data-state":isMenuOpen||isDeletePopoverOpen?`open`:`closed`,children:[canResolve&&!isResolved&&jsx(Tooltip,{content:intl.formatMessage(messages.resolveButtonAriaLabel),children:jsx(IconButton,{"aria-label":intl.formatMessage(messages.resolveButtonAriaLabel),"data-no-expand":!0,"data-resin-target":isAnnotations?THREADED_ANNOTATIONS_RESIN_TARGETS.ANNOTATION_RESOLVE:THREADED_ANNOTATIONS_RESIN_TARGETS.COMMENT_RESOLVE,disabled:isDeletePopoverOpen,icon:CheckmarkCircle,onClick:()=>onResolve?.(),size:`small`})}),canResolve&&isResolved&&jsx(Tooltip,{content:intl.formatMessage(messages.unresolveButtonAriaLabel),children:jsx(IconButton,{"aria-label":intl.formatMessage(messages.unresolveButtonAriaLabel),"data-no-expand":!0,"data-resin-target":isAnnotations?THREADED_ANNOTATIONS_RESIN_TARGETS.ANNOTATION_UNRESOLVE:THREADED_ANNOTATIONS_RESIN_TARGETS.COMMENT_UNRESOLVE,disabled:isDeletePopoverOpen,icon:CheckmarkCircle$1,onClick:()=>onUnresolve?.(),size:`small`})}),jsx(MessageOptionsMenu,{canDelete,canEdit,disabled:isDeletePopoverOpen,isAnnotations,onCopyLink,onDelete:()=>{isFirstMessage?(setIsMenuOpen(!1),setIsDeletePopoverOpen(!0)):(setIsMenuOpen(!1),onDelete?.())},onEdit,onOpenChange:setIsMenuOpen}),jsx(DeleteConfirmationPopover,{hasReplies,isAnnotation:isAnnotations,onCancel:()=>{setIsDeletePopoverOpen(!1),setIsMenuOpen(!1)},onConfirm:()=>{onThreadDelete?.(),setIsDeletePopoverOpen(!1),setIsMenuOpen(!1)},onOpenChange:setIsDeletePopoverOpen,open:isDeletePopoverOpen})]})]})};export{MessageHeader};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/threaded-annotations",
|
|
3
|
-
"version": "4.15.
|
|
3
|
+
"version": "4.15.34",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@floating-ui/dom": "^1.6.0",
|
|
@@ -22,23 +22,23 @@
|
|
|
22
22
|
"uuid": "^9.0.1"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@box/blueprint-web": "^18.
|
|
26
|
-
"@box/blueprint-web-assets": "^5.13.
|
|
27
|
-
"@box/collaboration-popover": "^2.3.
|
|
28
|
-
"@box/readable-time": "^2.3.
|
|
29
|
-
"@box/user-selector": "^3.1.
|
|
25
|
+
"@box/blueprint-web": "^18.9.0",
|
|
26
|
+
"@box/blueprint-web-assets": "^5.13.8",
|
|
27
|
+
"@box/collaboration-popover": "^2.3.33",
|
|
28
|
+
"@box/readable-time": "^2.3.33",
|
|
29
|
+
"@box/user-selector": "^3.1.32",
|
|
30
30
|
"clsx": "^1.2.1",
|
|
31
31
|
"react": "^18.0.0",
|
|
32
32
|
"react-dom": "^18.0.0",
|
|
33
33
|
"react-intl": "^6.4.2"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@box/blueprint-web": "^18.
|
|
37
|
-
"@box/blueprint-web-assets": "^5.13.
|
|
36
|
+
"@box/blueprint-web": "^18.9.0",
|
|
37
|
+
"@box/blueprint-web-assets": "^5.13.8",
|
|
38
38
|
"@box/eslint-plugin-blueprint": "2.3.1",
|
|
39
|
-
"@box/readable-time": "^2.3.
|
|
40
|
-
"@box/storybook-utils": "^1.4.
|
|
41
|
-
"@box/user-selector": "^3.1.
|
|
39
|
+
"@box/readable-time": "^2.3.33",
|
|
40
|
+
"@box/storybook-utils": "^1.4.27",
|
|
41
|
+
"@box/user-selector": "^3.1.32",
|
|
42
42
|
"@types/markdown-it": "^14.1.2",
|
|
43
43
|
"react": "^18.0.0",
|
|
44
44
|
"react-dom": "^18.0.0"
|