@zohoim/chat-components 1.0.10-temp → 1.0.11-beta.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/README.md +5 -0
- package/es/Message/Message.js +11 -2
- package/es/MessageActions/MessageActions.js +2 -0
- package/es/MessageActions/props/propTypes.js +2 -1
- package/es/MessageActionsMore/MessageActionsMore.js +3 -1
- package/es/MessageActionsMore/props/propTypes.js +1 -0
- package/es/MessageActionsWrapper/MessageActionsWrapper.js +6 -3
- package/es/MessageActionsWrapper/props/propTypes.js +2 -1
- package/es/MessageBubble/css/MessageBubble.module.css +0 -7
- package/es/MessageBubble/props/defaultProps.js +2 -1
- package/es/MessageBubble/props/propTypes.js +2 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -10,6 +10,11 @@ In this Library, We Provide Some Basic Message Components to Build Your Chat App
|
|
|
10
10
|
|
|
11
11
|
> import MessageBubble from '@zohoim/chat-components/es/MessageBubble/MessageBubble’;
|
|
12
12
|
|
|
13
|
+
# 1.0.11
|
|
14
|
+
|
|
15
|
+
- changes for retaining hover actions
|
|
16
|
+
- @zohodesk/components version update
|
|
17
|
+
|
|
13
18
|
# 1.0.9
|
|
14
19
|
|
|
15
20
|
- chat bubble ui issues fixes
|
package/es/Message/Message.js
CHANGED
|
@@ -12,6 +12,9 @@ import MessageBox from "../MessageBox/MessageBox";
|
|
|
12
12
|
import MessageAvatar from "../MessageAvatar/MessageAvatar";
|
|
13
13
|
import MessageActions from "../MessageActions/MessageActions";
|
|
14
14
|
import MessageStatus from "../MessageStatus/MessageStatus";
|
|
15
|
+
/** ** Hooks *** */
|
|
16
|
+
|
|
17
|
+
import useMessage from '@zohoim/chat-components-hooks/es/Message/useMessage';
|
|
15
18
|
/** ** Methods *** */
|
|
16
19
|
|
|
17
20
|
import getMessageStatus from '@zohoim/chat-components-utils/es/getMessageStatus';
|
|
@@ -35,6 +38,10 @@ export default function Message(props) {
|
|
|
35
38
|
renderContent,
|
|
36
39
|
customProps
|
|
37
40
|
} = props;
|
|
41
|
+
const {
|
|
42
|
+
retainMessageActions,
|
|
43
|
+
setRetainMessageActions
|
|
44
|
+
} = useMessage();
|
|
38
45
|
const {
|
|
39
46
|
messageBubbleProps = dummyObject,
|
|
40
47
|
messageOwnerProps = dummyObject,
|
|
@@ -111,12 +118,13 @@ export default function Message(props) {
|
|
|
111
118
|
actions,
|
|
112
119
|
onSelect: onSelectAction,
|
|
113
120
|
renderSecondaryActions,
|
|
114
|
-
onMouseEnter: onMouseEnterAction
|
|
121
|
+
onMouseEnter: onMouseEnterAction,
|
|
122
|
+
setRetainMessageActions
|
|
115
123
|
};
|
|
116
124
|
return /*#__PURE__*/React.createElement(MessageActions, { ...props,
|
|
117
125
|
...messageActionsProps
|
|
118
126
|
});
|
|
119
|
-
}, [actions, onSelectAction, onMouseEnterAction, renderSecondaryActions, messageActionsProps]);
|
|
127
|
+
}, [actions, onSelectAction, onMouseEnterAction, renderSecondaryActions, messageActionsProps, setRetainMessageActions]);
|
|
120
128
|
return /*#__PURE__*/React.createElement(MessageBubble, {
|
|
121
129
|
direction: direction,
|
|
122
130
|
isActive: isActive,
|
|
@@ -125,6 +133,7 @@ export default function Message(props) {
|
|
|
125
133
|
renderMessageActions: handleRenderMessageActions,
|
|
126
134
|
renderMessageBox: handleRenderMessageBox,
|
|
127
135
|
renderMessageOwner: handleRenderMessageOwner,
|
|
136
|
+
retainMessageActions: retainMessageActions,
|
|
128
137
|
...messageBubbleProps
|
|
129
138
|
});
|
|
130
139
|
}
|
|
@@ -26,6 +26,7 @@ export default function MessageActions(props) {
|
|
|
26
26
|
defaultShowCount,
|
|
27
27
|
onSelect,
|
|
28
28
|
onMouseEnter,
|
|
29
|
+
setRetainMessageActions,
|
|
29
30
|
renderSecondaryActions,
|
|
30
31
|
customStyle,
|
|
31
32
|
customProps
|
|
@@ -112,6 +113,7 @@ export default function MessageActions(props) {
|
|
|
112
113
|
actions: allActions,
|
|
113
114
|
defaultShowCount: defaultShowCount,
|
|
114
115
|
renderMoreIcon: renderMore,
|
|
116
|
+
setRetainMessageActions: setRetainMessageActions,
|
|
115
117
|
...messageActionsWrapperProps
|
|
116
118
|
}), secondaryActions ? /*#__PURE__*/React.createElement("div", {
|
|
117
119
|
className: newStyle.secondaryActions
|
|
@@ -20,6 +20,7 @@ const messageActionsPropTypes = {
|
|
|
20
20
|
}),
|
|
21
21
|
customStyle: PropTypes.object,
|
|
22
22
|
defaultShowCount: PropTypes.number,
|
|
23
|
-
renderSecondaryActions: PropTypes.func
|
|
23
|
+
renderSecondaryActions: PropTypes.func,
|
|
24
|
+
setRetainMessageActions: PropTypes.func
|
|
24
25
|
};
|
|
25
26
|
export default messageActionsPropTypes;
|
|
@@ -25,6 +25,7 @@ function MessageActionsMoreComp(props) {
|
|
|
25
25
|
actions,
|
|
26
26
|
renderMoreIcon,
|
|
27
27
|
customStyle,
|
|
28
|
+
setRetainMessageActions,
|
|
28
29
|
popupSize,
|
|
29
30
|
defaultPopupPosition,
|
|
30
31
|
|
|
@@ -66,9 +67,10 @@ function MessageActionsMoreComp(props) {
|
|
|
66
67
|
id,
|
|
67
68
|
isShowInMore: true,
|
|
68
69
|
action,
|
|
70
|
+
setRetainMessageActions,
|
|
69
71
|
closePopup: closePopupOnly
|
|
70
72
|
}); // id, isRenderInMorePopup
|
|
71
|
-
}), [actions, closePopupOnly]);
|
|
73
|
+
}), [actions, closePopupOnly, setRetainMessageActions]);
|
|
72
74
|
const isRenderPopup = !!(moreIcon && isPopupOpen);
|
|
73
75
|
return /*#__PURE__*/React.createElement("span", {
|
|
74
76
|
className: newStyle.morePopupContainer
|
|
@@ -6,6 +6,7 @@ const messageActionsMorePropTypes = {
|
|
|
6
6
|
renderFunction: PropTypes.func
|
|
7
7
|
})).isRequired,
|
|
8
8
|
renderMoreIcon: PropTypes.func.isRequired,
|
|
9
|
+
setRetainMessageActions: PropTypes.func,
|
|
9
10
|
customStyle: PropTypes.object,
|
|
10
11
|
popupSize: PropTypes.oneOf(['mini', 'xmini', 'xsmall', 'small', 'medium', 'large', 'mlarge', 'xlarge', 'xxlarge', 'default']),
|
|
11
12
|
defaultPopupPosition: PropTypes.oneOf([['bottomCenter', 'bottomLeftToRight', 'bottomCenterToRight', 'bottomRightToLeft', 'bottomCenterToLeft', 'topCenter', 'topLeftToRight', 'topCenterToRight', 'topRightToLeft', 'topCenterToLeft', 'rightTopToBottom', 'rightCenterToBottom', 'rightCenter', 'rightBottomToTop', 'rightCenterToTop', 'leftTopToBottom', 'leftCenterToBottom', 'leftCenter', 'leftBottomToTop', 'leftCenterToTop', 'bottomRight', 'bottomLeft', 'topRight', 'topLeft', 'rightBottom', 'rightTop', 'leftBottom', 'leftTop']])
|
|
@@ -25,7 +25,8 @@ export default function MessageActionsWrapper(props) {
|
|
|
25
25
|
renderMoreIcon,
|
|
26
26
|
defaultShowCount,
|
|
27
27
|
customStyle,
|
|
28
|
-
customProps
|
|
28
|
+
customProps,
|
|
29
|
+
setRetainMessageActions
|
|
29
30
|
} = props;
|
|
30
31
|
const {
|
|
31
32
|
messageActionsMoreProps = dummyObject
|
|
@@ -46,14 +47,16 @@ export default function MessageActionsWrapper(props) {
|
|
|
46
47
|
return renderHandler(renderFunction)({
|
|
47
48
|
id,
|
|
48
49
|
isShowInMore: false,
|
|
50
|
+
setRetainMessageActions,
|
|
49
51
|
action
|
|
50
52
|
}); // id, isRenderInMorePopup
|
|
51
|
-
}), [defaultActions]);
|
|
53
|
+
}), [defaultActions, setRetainMessageActions]);
|
|
52
54
|
const renderMoreActions = useCallback(() => /*#__PURE__*/React.createElement(MessageActionsMore, {
|
|
53
55
|
actions: moreActions,
|
|
54
56
|
renderMoreIcon: renderMoreIcon,
|
|
57
|
+
setRetainMessageActions: setRetainMessageActions,
|
|
55
58
|
...messageActionsMoreProps
|
|
56
|
-
}), [moreActions, renderMoreIcon, messageActionsMoreProps]);
|
|
59
|
+
}), [moreActions, renderMoreIcon, messageActionsMoreProps, setRetainMessageActions]);
|
|
57
60
|
const renderRow = useCallback(() => /*#__PURE__*/React.createElement(Container, {
|
|
58
61
|
alignBox: "row",
|
|
59
62
|
className: newStyle.row,
|
|
@@ -10,6 +10,7 @@ const messageActionsWrapperPropTypes = {
|
|
|
10
10
|
}),
|
|
11
11
|
customStyle: PropTypes.object,
|
|
12
12
|
defaultShowCount: PropTypes.number,
|
|
13
|
-
renderMoreIcon: PropTypes.func
|
|
13
|
+
renderMoreIcon: PropTypes.func,
|
|
14
|
+
setRetainMessageActions: PropTypes.func
|
|
14
15
|
};
|
|
15
16
|
export default messageActionsWrapperPropTypes;
|
|
@@ -12,6 +12,7 @@ const messageBubblePropTypes = {
|
|
|
12
12
|
needSender: PropTypes.bool,
|
|
13
13
|
renderMessageActions: PropTypes.func,
|
|
14
14
|
renderMessageBoxFooter: PropTypes.func,
|
|
15
|
-
renderMessageOwner: PropTypes.func
|
|
15
|
+
renderMessageOwner: PropTypes.func,
|
|
16
|
+
retainMessageActions: PropTypes.bool
|
|
16
17
|
};
|
|
17
18
|
export default messageBubblePropTypes;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohoim/chat-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11-beta.1",
|
|
4
4
|
"description": "Chat Components",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -35,15 +35,15 @@
|
|
|
35
35
|
"!**/__tests__"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@zohodesk/components": "1.2.
|
|
38
|
+
"@zohodesk/components": "1.2.56",
|
|
39
39
|
"@zohodesk/hooks": "2.0.2",
|
|
40
40
|
"@zohodesk/icon": "1.3.15",
|
|
41
41
|
"@zohodesk/icons": "1.0.20",
|
|
42
42
|
"@zohodesk/utils": "1.3.13",
|
|
43
43
|
"@zohodesk/variables": "1.0.0",
|
|
44
44
|
"@zohodesk/virtualizer": "1.0.13",
|
|
45
|
-
"@zohoim/chat-components-hooks": "
|
|
46
|
-
"@zohoim/chat-components-utils": "
|
|
45
|
+
"@zohoim/chat-components-hooks": "1.0.5-beta.1",
|
|
46
|
+
"@zohoim/chat-components-utils": "1.0.4"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@zohodesk-private/color-variable-preprocessor": "1.2.1",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"jsdom": "23.0.0",
|
|
53
53
|
"react-to-jsx": "1.3.2"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "7873aeee4583e0177179ed66b92b65f497589d96"
|
|
56
56
|
}
|