@pusher/chatkit-client-react
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -7,2 +7,7 @@ # Changelog | ||
## [Unreleased](https://github.com/pusher/chatkit-client-react/compare/0.1.0...HEAD) | ||
## [Unreleased](https://github.com/pusher/chatkit-client-react/compare/0.1.3...HEAD) | ||
## [0.1.3](https://github.com/pusher/chatkit-client-react/compare/0.1.2...0.1.3) | ||
### Additions | ||
- Add `messageLimit` property to the withChatkitOneToOne HOC |
@@ -50,18 +50,2 @@ "use strict"; | ||
/** | ||
* Wrapper component used to take Chatkit connection configuration | ||
* (instance ID, token provider, user ID, etc.) and injects a configured | ||
* Chatkit SDK instance via a React Context. | ||
* @example | ||
* <ChatkitProvider | ||
* instanceLocator={<YOUR_INSTANCE_ID_HERE>} | ||
* tokenProvider={<YOUR_TOKEN_PROVIDER_HERE>} | ||
* userId={<CURRENT_USER_ID_HERE>} | ||
* > | ||
* <App> | ||
* Your application | ||
* </App> | ||
* </ChatkitProvider> | ||
* @extends React.Component | ||
*/ | ||
var ChatkitProvider = | ||
@@ -68,0 +52,0 @@ /*#__PURE__*/ |
@@ -52,27 +52,2 @@ "use strict"; | ||
/** | ||
* Wraps the given component and injects everything needed to create | ||
* one-to-one chat experinces under props.chatkit: | ||
* | ||
* @param {React.Component} WrappedComponent - Custom React component you would | ||
* like to inject the Chatkit data into | ||
* @return {React.Component} A wrapped version of your component with the Chatkit | ||
* SDK injected under props.chatkit | ||
* | ||
* @example | ||
* const MyChatComponent = props => { | ||
* // Base Chatkit SDK | ||
* props.chatkit.currentUser // Reference to the CurrentUser object | ||
* props.chatkit.chatManager // Reference to the ChatManager object | ||
* | ||
* // One-to-one chat data | ||
* props.chatkit.otherUser // Reference to a Chatkit.User object for the other user in the chat | ||
* props.chatkit.messages // An array of all the messages in the room | ||
* props.chatkit.isLoading // True when the room is fully loaded, false otherwise | ||
* props.chatkit.sendSimpleMessage // Method which sends a text-only message to the room | ||
* props.chatkit.sendMultipartMessage // Method which sends a multi-part Chatkit message to the room | ||
* props.chatkit.sendTypingEvent // Method which triggers a typing event for the current user in the current room | ||
* props.chatkit.setReadCursor // Method which sets the current user's read cursor to the latest message | ||
* } | ||
*/ | ||
function withChatkitOneToOne(WrappedComponent) { | ||
@@ -104,2 +79,3 @@ var WithChatkitOneToOne = | ||
_this._otherUserId = props.otherUserId; | ||
_this._messageLimitOnLoad = props.messageLimit; | ||
_this._roomId = null; | ||
@@ -176,2 +152,3 @@ _this._currentUserLastReadMessageId = null; | ||
roomId: _this2._roomId, | ||
messageLimit: _this2._messageLimitOnLoad, | ||
hooks: { | ||
@@ -279,5 +256,6 @@ onMessage: function onMessage(message) { | ||
WithChatkitOneToOne.propTypes = { | ||
otherUserId: _propTypes["default"].string.isRequired | ||
otherUserId: _propTypes["default"].string.isRequired, | ||
messageLimit: _propTypes["default"].number | ||
}; | ||
return WithChatkitOneToOne; | ||
} |
@@ -36,19 +36,2 @@ "use strict"; | ||
/** | ||
* Wraps the given component and injects a Chatkit JavaScript SDK instance under | ||
* props.chatkit: | ||
* | ||
* @param {React.Component} WrappedComponent - Custom React component you would | ||
* like to inject the Chatkit SDK into | ||
* @return {React.Component} A wrapped version of your component with the Chatkit | ||
* SDK injected under props.chatkit | ||
* | ||
* | ||
* @example | ||
* const MyChatComponent = props => { | ||
* // Base Chatkit SDK | ||
* props.chatkit.currentUser // Reference to the CurrentUser object | ||
* props.chatkit.chatManager // Reference to the ChatManager object | ||
* } | ||
*/ | ||
function withChatkit(WrappedComponent) { | ||
@@ -55,0 +38,0 @@ var WithChatkit = |
{ | ||
"name": "@pusher/chatkit-client-react", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "React SDK for Pusher Chatkit", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -49,2 +49,4 @@ import PropTypes from "prop-types" | ||
this._messageLimitOnLoad = props.messageLimit | ||
this._roomId = null | ||
@@ -116,2 +118,3 @@ this._currentUserLastReadMessageId = null | ||
roomId: this._roomId, | ||
messageLimit: this._messageLimitOnLoad, | ||
hooks: { | ||
@@ -208,2 +211,3 @@ onMessage: message => | ||
otherUserId: PropTypes.string.isRequired, | ||
messageLimit: PropTypes.number, | ||
} | ||
@@ -210,0 +214,0 @@ |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
65545
1617
1