npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rex-setup-wizard-manager

v1.0.5

Published

Setup wizard for any plugins

Downloads

77

Readme

Rex Setup Wizard Manager

Rex Setup Wizard Manager is a dynamic, easy-to-integrate wizard setup for any application. It's designed to work seamlessly across different frameworks like Vanilla JavaScript, Vue, and React.

Description

Rex Setup Wizard Manager is a dynamic, customizable, easy-to-integrate wizard setup for any application. That can be used from the JS application for wizard facilities and can also be used for different functionality that can be sent through a template.

Features

  • Dynamic Step Progression
  • Skip step
  • Current step
  • Customisable Styles
  • Logo Integration

Installation

Install Rex Setup Wizard Manager:

npm install rex-setup-wizard-manager

or

yarn add rex-setup-wizard-manager

Import

import rexWizard from "rex-setup-wizard-manager";

Usage in Vue

<template>
	<div class="wpfnl wpfnl-setup-wizard__container">
		<div class="wpfnl-setup-wizard__wrapper">
			<!-- <ul class="wpfnl-setup-wizard__nav"> -->
			<div id="wizardContainer">
				<!-- Wizard content will be dynamically inserted here -->
			</div>

			<!-- <WizardNav /> -->

			<button @click="prev" class="install">prev</button>
			<button @click="next" class="install">next</button>
		</div>
	</div>
</template>

<script>
//Import
import WizardNav from './WizardNav'
import rexWizard from 'rex-setup-wizard-manager'
const j = jQuery.noConflict()

export default {
	name: 'SetupWizard',

	components: {
		WizardNav,
	},
	data() {
		return {
			steps: [
				{
					stepText: 'Welcome',
					html: '<p>Welcome to Step 1 description of content</p>',
					isNextStep: true,
					isPreviousStep: false,
					isSkip: false,
				},
				{
					stepText: 'Type',
					html: '<p>Welcome to Step 2 description of content </p>',
					isNextStep: true,
					isPreviousStep: true,
					isSkip: true,
				},
				{
					stepText: 'Page Builder',
					html: '<p>Welcome to Step 3 description of content</p>',
					isNextStep: false,
					isPreviousStep: true,
					isSkip: false,
				},
				{
					stepText: 'Essential plugings',
					html: '<p>Welcome to Step 4 description of content</p>',
					isNextStep: false,
					isPreviousStep: true,
					isSkip: false,
				},
				{
					stepText: 'Subscribe',
					html: '<p>Welcome to Step 5 description of content</p>',
					isNextStep: false,
					isPreviousStep: true,
					isSkip: false,
				},
				{
					stepText: 'Done',
					html: '<p>Welcome to Step 6 description of content</p>',
					isNextStep: false,
					isPreviousStep: true,
					isSkip: false,
				},
			],
			currentStep: 0,
			logoUrl: 'http://techsite.local/wp-content/uploads/2024/04/logo-wpfnl.png',
			logoClass: 'wpfnl-setup-wizard__logo',
		}
	},

	mounted() {
		this.initializeWizard()
		window.handleClick = this.handleClick
	},

	methods: {
		handleClick() {
			console.dir('here.....')
		},

		initializeWizard() {
			this.wizard = rexWizard({
				general: {
					title: 'Welcome to the Wizard',
					currentStep: this.currentStep,
					logo: this.logoUrl, // Pass the logo URL to the wizard
					targetElement: 'wizardContainer',
					logoStyles: this?.logoClass,
					buttonStyles: this?.buttonClass,
				},
				steps: this.steps,
			})
		},

		prev() {
			this.wizard?.previousStep()
		},
		next() {
			this.wizard?.nextStep()
		},
	},

	watch: {
		currentStep(newVal, oldVal) {
			if (newVal !== oldVal) {
				this.initializeWizard()
			}
		},
	},
}
</script>

Usage in ReactJs

import rexWizard from "rex-setup-wizard-manager";

export const SetupWizard = () => {
  const [wizard, setWizard] = useState(null);

  const data = {
    steps: [
      {
        stepText: "Welcome",
        html: "<p>Welcome to Step 1 description of content</p>",
        isNextStep: true,
        isPreviousStep: false,
        isSkip: false,
      },
      {
        stepText: "Type",
        html: "<p>Welcome to Step 2 description of content </p>",
        isNextStep: true,
        isPreviousStep: true,
        isSkip: true,
      },
      {
        stepText: "Page Builder",
        html: "<p>Welcome to Step 3 description of content</p>",
        isNextStep: false,
        isPreviousStep: true,
        isSkip: false,
      },
      {
        stepText: "Essential plugings",
        html: "<p>Welcome to Step 4 description of content</p>",
        isNextStep: false,
        isPreviousStep: true,
        isSkip: false,
      },
      {
        stepText: "Done",
        html: "<p>Welcome to Step 6 description of content</p>",
        isNextStep: false,
        isPreviousStep: true,
        isSkip: false,
      },
    ],
    currentStep: 0, 
    logoUrl: "http://techsite.local/wp-content/uploads/2024/04/logo-wpfnl.png",
    logoClass: 'class-name',
  };

  const initializeWizard = () => {
    setWizard(
      rexWizard({
        general: {
          title: "Welcome to the Wizard",
          currentStep: data?.currentStep,
          logo: data?.logoUrl, // Pass the logo URL to the wizard
          targetElement: "wizardContainer",
          logoStyles: data?.logoClass,
        },
        steps: data?.steps,
      })
    );
  };

  useEffect(() => {
    initializeWizard();
  }, []);

  const prev = () => {
    wizard.previousStep();
  };
  const next = () => {
    wizard.nextStep();
  };

  return (
    <>
      <div id="wizardContainer">
        {/* <!-- Wizard content will be dynamically inserted here --> */}
      </div>

      <button onClick={prev} className="install">
        prev
      </button>
      <button onClick={next} className="install">
        next
      </button>
    </>
  );
};

Options

| Parameter | Type | Example | | ---------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | | general | object | This parameter used to get data for attributes eg : title,currentStep, logo,targetElement logoStyles,buttonStyles | | steps | array of objects | This parameter used to get array of steps that array contains steps markup and many more eg : title,html,isNextStep,isPreviousStep,isSkip, |

Functions

| Methods | Description | | ------------------ | -------------------------------------------- | | rexWizard() | Base configuration of setup wizard | | previousStep() | Previous step of wizard | | nextStep() | Next step of wizard | | skipStep() | Next step of wizard and skip the current one | | getCurrentStep() | Current step index number starting from 0 |

Events

  • No events available

License

MIT