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

@abtasty/progress-bar

v1.3.22

Published

Allow you to add a progress bar on you website

Downloads

815

Readme

AB-tasty progress-bar

The ABTasty Progress Bar Widget will display a progress bar.

Code organisation

Progress Bar Architecture

Inserting the widget on the page

This is completely handled by the Widget-Utils. It takes care of deciding when and how to insert the widget on the page. It also handles recurrence management. Finally, it also handles the widget's form generation by importing the necessary components to be displayed in the editor.

Widget internal updates

The widget has to react to changes coming either form updates to a specified DOM element (DATA.variableElement) or from a javascript callback from the client (DATA.variableType is javascript).

The widget internally uses an observer pattern, via an Event Hub. The observable events are:

  • valueElementUpdated: the source DOM value has changed
  • externalUpdate: the source value was updated from javascript callback (client code)
  • sourceElementPresence: the source DOM element was either removed or added to the DOM
  • valueUpdated: the value to display was updated either from the DOM or a javascript callback.
  • refreshContent: triggered by the widget-utils, when the widget is removed and has to display again

Tests

The test setup and spec files are located in test directory. To actually run the tests you need to clone and install the Widgets Testrunner repo in your Widgets directory. Please check the testrunner documentation for an up to date guide on running the Widget tests.

This widget was generated using AB Tasty Widget CLI. You can find more infomation and documentation about widgets at https://abtasty.gitbooks.io/widget/.

Preview your widget

Launch your widget in a new window and watch for changes.

npm start

Main files

  • main.js Main source code of your widget
  • form.js Configuration form for your widget

You can specify each file location in the package.json like this:

  "main": "dist/main.js",
  "form": "dist/form.js",

Included

We heard your widget have an UI, so we allowed ourselves to include some extra:

  • Pug (aka Jade) to transforms html files into JS template.
  • PostCSS to automatically append your CSS to head just using import 'yourstyle.css' and also use CSS plugins including:

Add your widget to AB Tasty

  1. First, you'll need to have your widget on NPM:
    • Create a minified bundle with npm run build
    • Bump the version of your widget (using semver) with npm version [patch|minor|major]
    • Publish it to NPM: npm publish
  2. Once your widget is on NPM, you can now add it on AB Tasty at https://marketplace.abtasty.com/publish.