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

@lovepop/note-editor

v2.7.0

Published

A [Svelte](https://svelte.technology/guide) component for editing the contents of a Lovepop insert

Downloads

46

Readme

@lovepop/note-editor

A Svelte component for editing the contents of a Lovepop insert

Local development

If you're only working on note-editor, you can run lerna run build to build all sub-packages and then yarn dev in the note-editor directory to start the dev server. This will launch the storybook instance to preview your changes in.

If you cannot connect to the localhost files for colors and fonts, you can replace them in stores.js with the equivalent test fixtures, i.e. ../tests/fixtures/colors.

If you're working on typesetter or svg-writer at the same time, you should open each of those in a terminal and run yarn dev. This is order dependent so do typesetter -> svg-writer -> note-editor

yarn run info for a description of available npm scripts

TDD

For a tdd style workflow, you can run yarn watch:test to have your tests automaticaly update file changes. Run yarn testem to run all the tests in the browser. Note: You may have to run yarn watch:test before each new instance of yarn testem after any changes for the tests to run properly.

Useful links

  • Svelte - disapearing framework for generating shareable js components
  • Testem - our test runner for this package
  • QUnit - our test framework for this package
  • Storybook - WIP component playground/dev/doc site

Docs - WIP

yarn run dev will launch a Storybookjs instance with examples of how to consume note-editor

Using Notifications component externally (shopify, admin app, etc...)

  <div id="notifications"></div>
  import { Notifications } from '@lovepop/note-editor';

  const notifications = new Notifications({ target: document.getElementById('notifications') });

  /*
   * adds a notification with type `error`.
   * can be styled with `.ne-error` class
   */
  notifications.error('Some error message', /* optional timeout in ms */);

  /*
   * adds a notification with type `warn`.
   * can be styled with `.ne-warn` class
   */
  notifications.warn('Some warning with optional timeout of 3 seconds', 3000);

  /*
   * adds a notification with type `success`.
   * can be styled with `.ne-success` class
   */
  notifications.success('Some success', /* optional timeout in ms */);


  /*
   * removes all notifications
   */
  notifications.clearAll();

  /* Removes the component from the DOM and removes any
   * event listeners that were created. This will also
   * fire a destroy event e.g. `notifications.on('destory', () => console.log('bye'))`
   */
  notifications.destroy();