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

flowmaker

v1.1.6

Published

A react component for creating a flow

Downloads

35

Readme

flowmaker - A react component for creating a flow

This component makes it easy to create flows.

Screenshot

Example project

See ./example

How to use

npm i mjarkk/react-flow-maker
import FlowMaker from "flowmaker";
import "flowmaker/dist/flowmaker.umd.min.css";
// ...
<FlowMaker
  logic={{
    introComponents: [],
    components: [],
  }}
  onChange={(data) =>
    localStorage.setItem("flowMakerExample", JSON.stringify(data))
  }
  flow={JSON.parse(localStorage.getItem("flowMakerExample"))}
/>;

Example

To run the example:

# Clone the repo
npm i
npm run example:watch

logic Required

Logic discribes the blocks and the inputs they have It expects a object with the following properties.

let logic = {

  // These are the components that can be created from the 'Start Here' button
  // The names need to match the names of the components
  introComponents: [
    'hello-world'
  ]

  // The blocks that can be made by a user
  // The first component (hello-world) shows the minimal inputs
  // The second component (wow) shows all the extra inputs that can be added
  components: [
    {
      name: 'hello-world'
      title: 'Hello World'
      inputs: [
        {
          name: 'exampleInput',
          title: 'Example input',
          type: 'text',
        }
      ],
      next: 'wow' // This can also be an array like: ['componentA', 'componentB', ...]
    },{
      name: 'wow'
      title: 'Wow'
      tooltip: 'wow blocks can also have tooltips',
      inputs: [
        {
          name: 'specialNumber',
          title: 'Special number',
          type: 'number', // This can also be: 'text', 'switch', 'dropdown'
          default: 1234,
          tooltip: 'Pssst the special number is 4321',
          validation: (_, input) => {
            return Number(input) == 4321
              ? true
              : 'That\'s not the special number'
          },
        }, {
          name: 'options',
          title: 'Options',
          type: 'dropdown',
          default: 'c',
          options: [
            {title: 'A', value: 'a', tooltip: 'Wow options can also have tooltips'},
            {title: 'B', value: 'b'},
            {title: 'C', value: 'c'},
            {title: 'D', value: 'd'},
            {title: 'E', value: 'e'},
          ]
        }
      ]
    },
  ]
}

onChange

This returns a the flow data from when a user changes something

flow

Here you can add a flow to show when the drawing gets mounted, handy if you remove the component from the screen or when the drawing needs to be presistant.