-
-
Notifications
You must be signed in to change notification settings - Fork 87
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
uses image component to add graphics to annotation #730
Conversation
Thanks @jasenlo123! I have been thinking about this, and wanted to get your thoughts on possible API to make it slightly more flexible. What if we do something like:
or with an image:
I think this would be nice because it matches the existing APIs of the Scrollers and Steppers of using |
To see how to implement this, the stepper component is a good example, e.g. to place the graphic in the render tree |
helu @mathisonian! Oh this implementation makes so much more sense. I was bothered by how inflexible my implementation was. I'll look into your suggestion and update my PR soon. |
Great! Sounds good @jasenlo123 |
Hi @mathisonian, Did as you suggested by matching the
Note that now the NOW:
EXISTING
I'll spend some time testing the component with different elements in the |
These updates look great @jasenlo123! I think this approach will give a much more powerful + flexible component. Sorry I haven't had a chance to do a deep dive and give feedback yet but will do it soon. |
@jasenlo123 this looks great! I'd be happy to merge as-is, but want to get your thoughts on one potential alternative API: Since currently in the PR:
becomes:
|
Hi @mathisonian! I implemented your second suggestion:
I do agree that it is easier to work with. I'm having some trouble with tests though, despite it working okay. I use Another thing that is bothering me is that there seems to be a space that is part of the inline annotation text that is highlighted when I use the annotation. This is some example markdown for the suggested implementation, and image to draw attention to the problem: |
Thanks for the patches @jasenlo123! I'll take a look and push some fixes for the two issues that you mentioned, then I think we should be good to merge 👍 |
@jasenlo123 I pushed a few edits to address the issues you mentioned above (not erring out on slice) and updated the markup so that there will always be a space between the annotation text and other text that precedes or follows it. The padding inside the gray box that you mentioned is coming from a CSS rule: |
facepalm on the Thanks for fixing up the my |
Sounds good to me! Thanks again @jasenlo123. This will be available in the next release (probably next week by the time I have a chance to update all the docs) |
Uses the
Image
component to for displaying images inside of the annotation div.Current
Annotation
component does not allow for images.New
Annotation
component places images at the start of the annotation, can have text and image in the same annotation div.None