Skip to content
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

Use action for tour items #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

erlenddahl
Copy link

@erlenddahl erlenddahl commented Sep 7, 2021

Since using a <TourItem> block around an element adds a <div> that couldn't easily be styled to not break my layout, I had to add the option for using an action to add tour items.

This pull request adds a "tour" action, so that you can do this:

import { Tour, TourTip, tour, run } from 'svelte-tour';

<main>
    <span use:tour={{message: "A tour item"}}>Blah, blah</span>
</main>

Instead of:

<TourItem message={"A tour item"}>
    <span>Blah, blah</span>
</TourItem>

(Or in addition to, actually -- I didn't remove the TourItem component.)

Also, I added a sequence to the tour parameters so that I can control the sequence of the messages in the tour:
<span use:tour={{message: "A tour item", sequence: 3}}>Blah, blah</span>

This change makes the "data-tour" attribute unneccessary, so I removed it. Items in the store are now saved together with their parameters instead.

Use some of it, all of it or ignore it, no hard feelings any way. :)

@acidlake
Copy link

Thanks a lot for this feature, my style was breaking too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants