New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@lovepop/note-editor

Package Overview
Dependencies
Maintainers
1
Versions
383
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lovepop/note-editor

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

latest
Source
npmnpm
Version
2.7.0
Version published
Maintainers
1
Created
Source

@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.

  • 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();

FAQs

Package last updated on 27 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts