1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
//! A library for creating interactive tours in Yew applications.
//!
//! `yew-tou-rs` provides an easy way to implement guided tours in web applications
//! built with the Yew framework. It allows developers to create step-by-step
//! tutorials that highlight different elements of their user interface.
//!
//! # Features
//!
//! - Easy integration with Yew components
//! - Customizable tour steps
//! - Optional storage feature for persisting tour state
//! - Optional Markdown support for tour content
//!
//! # Usage
//!
//! To use this library, add the following to your `Cargo.toml`:
//!
//! ```toml
//! [dependencies]
//! yew-tou-rs = { git = "https://github.com/chriamue/yew-tou-rs" }
//! ```
//!
//! For optional features, add:
//!
//! ```toml
//! [dependencies]
//! yew-tou-rs = { git = "https://github.com/chriamue/yew-tou-rs", features = ["storage", "markdown"] }
//! ```
//!
//! Then, in your Rust code, import the prelude to access the main components:
//!
//! ```rust
//! use yew_tou_rs::prelude::*;
//! ```
//!
//! # Example
//!
//! Here's a basic example of how to use the `Tour` component in a Yew application:
//!
//! ```rust
//! use yew::prelude::*;
//! use yew_tou_rs::prelude::*;
//!
//! #[function_component(App)]
//! fn app() -> Html {
//!     let tour_config = TourConfig {
//!         id: Some("main-tour".to_string()),
//!         steps: vec![
//!             TourStep {
//!                 selector: ".intro-element".to_string(),
//!                 content: "Welcome to our app! This is the first step of the tour.".to_string(),
//!             },
//!             TourStep {
//!                 selector: "#feature-button".to_string(),
//!                 content: "Click here to see our main feature.".to_string(),
//!             },
//!             TourStep {
//!                 selector: ".help-section".to_string(),
//!                 content: "If you need help, you can always find it here.".to_string(),
//!             },
//!         ],
//!     };
//!
//!     html! {
//!         <div>
//!             <h1 class="intro-element">{"Welcome to Our App"}</h1>
//!             <button id="feature-button">{"Main Feature"}</button>
//!             <div class="help-section">{"Help & Support"}</div>
//!
//!             <Tour steps={tour_config.steps} />
//!         </div>
//!     }
//! }
//! ```
//!
//! # Modules
//!
//! - `config`: Defines the `TourConfig` struct for configuring tours.
//! - `step`: Contains the `TourStep` struct for individual tour steps.
//! - `tour`: Implements the main `Tour` component.
//! - Other modules provide supporting functionality and components.
//!
//! # License
//!
//! This project is licensed under the MIT License. See the [LICENSE](https://github.com/chriamue/yew-tou-rs/blob/main/LICENSE) file for details.

mod components;
mod models;
mod tour;
mod utils;

/// Prelude module for convenient imports of commonly used items.
///
/// This module re-exports the main components and structures needed to use the tour functionality.
/// By importing this prelude, users can easily access the necessary items without multiple imports.
///
/// # Usage
///
/// To use the prelude, add the following to your Rust file:
///
/// ```rust
/// use yew_tou_rs::prelude::*;
/// ```
///
/// For a complete usage example, see the crate-level documentation.
pub mod prelude {
    pub use crate::models::TourConfig;
    pub use crate::models::TourStep;
    pub use crate::tour::Tour;
}