Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@storybook/addon-comments

Package Overview
Dependencies
Maintainers
8
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storybook/addon-comments - npm Package Compare versions

Comparing version 3.2.8 to 3.3.0-alpha.0

8

package.json
{
"name": "@storybook/addon-comments",
"version": "3.2.8",
"version": "3.3.0-alpha.0",
"description": "Comments addon for Storybook",

@@ -26,3 +26,3 @@ "keywords": [

"dependencies": {
"@storybook/addons": "^3.2.6",
"@storybook/addons": "^3.3.0-alpha.0",
"babel-runtime": "^6.23.0",

@@ -42,4 +42,4 @@ "deep-equal": "^1.0.1",

"@kadira/storybook-deployer": "*",
"@storybook/addon-actions": "^3.2.0",
"@storybook/react": "^3.2.8",
"@storybook/addon-actions": "^3.3.0-alpha.0",
"@storybook/react": "^3.3.0-alpha.0",
"git-url-parse": "^6.2.2",

@@ -46,0 +46,0 @@ "react": "^15.6.1",

@@ -13,6 +13,7 @@ import PropTypes from 'prop-types';

const Button = ({ children, onClick, style = {} }) =>
const Button = ({ children, onClick, style = {} }) => (
<button style={{ ...buttonStyles, ...style }} onClick={onClick}>
{children}
</button>;
</button>
);

@@ -19,0 +20,0 @@ Button.defaultProps = {

@@ -62,12 +62,6 @@ import PropTypes from 'prop-types';

<div style={style.commentHead}>
<span style={style.commentUser}>
{comment.user.name}
</span>
<span style={style.commentTime}>
{time}
</span>
<span style={style.commentUser}>{comment.user.name}</span>
<span style={style.commentTime}>{time}</span>
</div>
<span style={style.commentText}>
{body}
</span>
<span style={style.commentText}>{body}</span>
{showDelete ? this.renderDelete() : null}

@@ -74,0 +68,0 @@ </div>

@@ -40,3 +40,3 @@ import PropTypes from 'prop-types';

>
{comments.map(comment =>
{comments.map(comment => (
<CommentItem

@@ -48,3 +48,3 @@ key={comment.id}

/>
)}
))}
</div>

@@ -51,0 +51,0 @@ );

@@ -82,6 +82,8 @@ import deepEquals from 'deep-equal';

this.fireComments([]);
this.loadUsers().then(() => this.loadComments()).then(() => {
this.eventStore.emit('loading', false);
return Promise.resolve(null);
});
this.loadUsers()
.then(() => this.loadComments())
.then(() => {
this.eventStore.emit('loading', false);
return Promise.resolve(null);
});

@@ -102,11 +104,14 @@ return this.currentStory;

}
return this.db.getCollection('users').get(query, options).then(users => {
this.users = users.reduce((newUsers, user) => {
const usersObj = {
...newUsers,
};
usersObj[user.id] = user;
return usersObj;
}, {});
});
return this.db
.getCollection('users')
.get(query, options)
.then(users => {
this.users = users.reduce((newUsers, user) => {
const usersObj = {
...newUsers,
};
usersObj[user.id] = user;
return usersObj;
}, {});
});
});

@@ -123,11 +128,14 @@ }

}
return this.db.getCollection('comments').get(query, options).then(comments => {
// add to cache
this.addToCache(currentStory, comments);
return this.db
.getCollection('comments')
.get(query, options)
.then(comments => {
// add to cache
this.addToCache(currentStory, comments);
// set comments only if we are on the relavant story
if (deepEquals(currentStory, this.currentStory)) {
this.fireComments(comments);
}
});
// set comments only if we are on the relavant story
if (deepEquals(currentStory, this.currentStory)) {
this.fireComments(comments);
}
});
});

@@ -134,0 +142,0 @@ }

@@ -61,10 +61,10 @@ import React from 'react';

.add('CommentList - No Comments', () => <CommentList comments={[]} />)
.add('CommentList - with comments', () =>
.add('CommentList - with comments', () => (
<CommentList user={userObj} comments={commentsList} deleteComment={action('deleteComment')} />
)
))
.add('CommentPanel - not loggedIn', () => <CommentsPanel />)
.add('CommentPanel - app not available', () =>
.add('CommentPanel - app not available', () => (
<CommentsPanel user={userObj} appNotAvailable={{}} />
)
.add('CommentPanel - loggedIn with no comments', () =>
))
.add('CommentPanel - loggedIn with no comments', () => (
<CommentsPanel

@@ -77,4 +77,4 @@ user={userObj}

/>
)
.add('CommentPanel - loggedIn with has comments', () =>
))
.add('CommentPanel - loggedIn with has comments', () => (
<CommentsPanel

@@ -87,2 +87,2 @@ user={userObj}

/>
);
));
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc