These are chat archives for ractivejs/ractive

20th
May 2017
Chris Reeves
@evs-chris
May 20 2017 09:31 UTC
anyone interested in a generic ractive modal plugin?
it uses a parser transform to limit the boilerplate, a component for a bit of encapsulation, and a decorator to do the dirty work
the content of the modal tag gets swizzled around and yielded from the component
there is a hook to stop closing if you so desire
the only really odd part is that if you want to trigger closing from the content of the modal, you have to @context.raise('close') because the yielded content is scoped outside of the component - it can't see the event
Chris Reeves
@evs-chris
May 20 2017 09:40 UTC
ends up being about 170 sloc including styles
would be interested to hear any feedback on functionality and utility
I also have toy parser transform based grid and material cards, which play pretty well with the modal - drop a card in the middle use a grid inside if needed
those are truly giant though because the grid supports all of reasonable fractions up to 24ths
which brings me around to the ractive bin component builder
Chris Reeves
@evs-chris
May 20 2017 09:45 UTC
I was thinking about using the textOnlyMode of the parser to do style interpolations using the config file to set custom data with defaults in a json script tag in the component
that would allow for some customization of a component library style-wise without having to do custom stylesheets
for instance, you could include only the material colors or grid units that you needed
like maybe go all the way to 36ths in the grid if you wanted to support 4k
Martin Kolárik
@MartinKolarik
May 20 2017 14:57 UTC
@evs-chris :+1:
so many new features, I have some catching up to do :smile:
here's a modal I wrote a year ago: https://goo.gl/2hMPtK
Chris Reeves
@evs-chris
May 20 2017 15:07 UTC
Nice! Definitely better on complexity.
Chris Reeves
@evs-chris
May 20 2017 15:12 UTC
I was hoping to come up with a way to include pure API modals as well
I think I'll steal some of your approach 😃
Martin Kolárik
@MartinKolarik
May 20 2017 15:17 UTC
haha, stealing welcome :smile:
Chris Reeves
@evs-chris
May 20 2017 15:22 UTC
I think parser transforms probably need access to their list of parents and the parser logging methods
Chris Reeves
@evs-chris
May 20 2017 18:30 UTC
I said I was going to simplify, but I ended up adding a bit more link to link - take 2
it will now forward transitions through and doesn't have a superfluous decorator