@zohoim/chat-components 1.0.10 → 1.0.11

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 CHANGED
@@ -10,7 +10,7 @@ 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.10
13
+ # 1.0.11
14
14
 
15
15
  - changes for retaining hover actions
16
16
  - @zohodesk/components version update
@@ -1,5 +1,5 @@
1
1
  /** ** Libraries *** */
2
- import React, { useCallback, useState } from 'react';
2
+ import React, { useCallback } from 'react';
3
3
  /** ** Constants *** */
4
4
 
5
5
  import messageDefaultProps from "./props/defaultProps";
@@ -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,10 +38,10 @@ export default function Message(props) {
35
38
  renderContent,
36
39
  customProps
37
40
  } = props;
38
- const [retainMessageActions, _setRetainMessageActions] = useState(false);
39
- const setRetainMessageActions = useCallback(retain => {
40
- _setRetainMessageActions(retain);
41
- }, []);
41
+ const {
42
+ retainMessageActions,
43
+ setRetainMessageActions
44
+ } = useMessage();
42
45
  const {
43
46
  messageBubbleProps = dummyObject,
44
47
  messageOwnerProps = dummyObject,
@@ -121,7 +124,7 @@ export default function Message(props) {
121
124
  return /*#__PURE__*/React.createElement(MessageActions, { ...props,
122
125
  ...messageActionsProps
123
126
  });
124
- }, [actions, onSelectAction, onMouseEnterAction, renderSecondaryActions, messageActionsProps]);
127
+ }, [actions, onSelectAction, onMouseEnterAction, renderSecondaryActions, messageActionsProps, setRetainMessageActions]);
125
128
  return /*#__PURE__*/React.createElement(MessageBubble, {
126
129
  direction: direction,
127
130
  isActive: isActive,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohoim/chat-components",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "Chat Components",
5
5
  "main": "es/index.js",
6
6
  "module": "es/index.js",
@@ -36,7 +36,7 @@
36
36
  "@zohodesk/utils": "1.3.13",
37
37
  "@zohodesk/variables": "1.0.0",
38
38
  "@zohodesk/virtualizer": "1.0.13",
39
- "@zohoim/chat-components-hooks": "1.0.4-beta.8",
39
+ "@zohoim/chat-components-hooks": "1.0.5",
40
40
  "@zohoim/chat-components-utils": "1.0.4"
41
41
  },
42
42
  "devDependencies": {
@@ -45,5 +45,5 @@
45
45
  "jsdom": "23.0.0",
46
46
  "react-to-jsx": "1.3.2"
47
47
  },
48
- "gitHead": "f3bead5ed7cfdbb215ec470df77ef0f3cff6f7a3"
48
+ "gitHead": "37181d28308ee50db9e7076d05b45934cf6b0d19"
49
49
  }