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

next-myft-ui

v6.21.4

Published

Client module to store and display user favourites

Downloads

81

Readme

DEPRECATED - now in n-ui

next-myft-ui Circle CI

Client-side module to handle display of generic myft ui e.g. add to myft buttons

Consuming

  • Include JS and SCSS
  • Templates are provided for the following:

Following

{{>next-myft-ui/templates/follow}}
{{>next-myft-ui/templates/unfollow}}

The templates require a conceptId variable. You can also override the button text by providing a buttonText property.

You can require different versions of the button as below: {{>next-myft-ui/templates/follow version='3'}}

You can require different variants of the button as below: {{>next-myft-ui/templates/follow variant='standout'}} {{>next-myft-ui/templates/follow variant='inverse'}}

You can require different sizes of the button as below: {{>next-myft-ui/templates/follow size="big" variant='standout'}}

Save for later

{{>next-myft-ui/templates/save-for-later contentId=id}}
{{>next-myft-ui/templates/unsave-for-later contentId=id}}

The templates require an contentId variable. You can also override the button text by providing a buttonText property.

Prefer

{{>next-myft-ui/templates/prefer preferenceName="email-digest" buttonText="Subscribe"}}
{{>next-myft-ui/templates/unprefer preferenceName="email-digest" buttonText="Subscribe"}}

The templates require a preferenceName variable and a buttonText property. IN addition you may define a label, either as text, using label, or by specifying the name of a partial to render, using lableTemplate

JS API

  • init() Sets up listeners to update all myft buttons (follow, save, preference) to match the user's preferences
  • 'updateUi(el)' Update the ui within a given element to match the user's preferences. If el is undefined applies to the whole page

To detect changes to myft buttons states listen for the nButtons.stateChange event

  • TopicSearch(opts) Constructor for a widget that searches for topics. Available options :=

    • searchEl - the text input used to search for topics
    • destinationEl - element in which to output results. Can contain default content to display when searhc in put is empty
    • resultsMessage - message to show confirming that a search is being conducted (default 'Results:')
    • resultsMessageEl element in which to output results message. Can contain default content to display when searhc in put is empty
    • resultTpl - template for rendering a single result. Will carry out the following substitutions
      • '%7BconceptId%7D' -> uriEncoded concept id
      • '{conceptId}' -> concept id
      • '{name}' -> topic name
      • '{url}' -> topic stream url
      • '{taxonomy}' -> topic taxonomy
      • '{searchTerm}' -> current value of the search input
    • noResultsTpl - template for rendering a message to say no results were found
      • '{searchTerm}' -> current value of the search input
    • minSearchTermLength - min length of search term before search is triggered (default 2)
    • maxResults - maximum number of results to return (default 5)
    • excludeSpecial - exclude 'special' topics from the results (default true)
    • include - comma separated list of topic taxonomies to include (will exclude all others)
    • exclude - comma separated list of topic taxonomies to exclude (will include all others. If set excludeSpecial is ignored)

    When results have been fetched and rendered the 'myft.ui.topicSearch.updated' event is fired on destinationEl

Releasing

This is a bower module, to release update the git tag.

Communicates with next-user-preferences-api to store preferences Details are stored against users' eRightsID.

Also contains client side polling of User Notifications.

Testing

Run make test to run Karma/Mocha tests.