-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Storybook for HTML snippets #3475
Conversation
e.preventDefault(); | ||
linkTo(kind, story)(); | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could incorporate something like this into links addon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't see how it will work with a real-world example, because probably your components won't be coupled to the "story"/"kind"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use some namespace, like data-sb-story
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is, if you want a link to other story, you just add corresponding data-attribute to the element that you want to be the link
.add('button', () => { | ||
const button = document.createElement('button'); | ||
button.innerText = 'Hello Button'; | ||
button.addEventListener('click', action('Click')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some thoughts on adding a decorator with backbone-style event listeners hash:
.addDecorator(withActions({
dblclick : 'Double click',
'click .icon.doc': 'Doc icon click',
'contextmenu .icon.doc': 'Doc icon right click'
}))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did that: 100985b
# Conflicts: # .teamcity/OpenSourceProjects_Storybook/buildTypes/OpenSourceProjects_Storybook_Examples.kt # .teamcity/OpenSourceProjects_Storybook/buildTypes/StotybookApp.kt
This reverts commit 9243827
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥
Do you need any help with addons support?
e.preventDefault(); | ||
linkTo(kind, story)(); | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't see how it will work with a real-world example, because probably your components won't be coupled to the "story"/"kind"
I'd appreciate any. I'll create a slack channel to coordinate |
Ok I think it's ready for final review |
.add('button', () => { | ||
const button = document.createElement('button'); | ||
button.innerText = 'Hello Button'; | ||
// eslint-disable-next-line no-console |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we remove eslint stuff from docs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks awesome!
Issue: #3157
Live example
Todo: