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

xd-dialog-helper

v1.1.0

Published

An abstraction layer making it easier to display simple dialogs in plugins for Adobe XD CC

Downloads

26

Readme

xd-dialog-helper

Build Status npm version David GitHub Release Date GitHub

NPM


A small library that serves as an abstraction layer for creating medium complex dialogs (containing options a user can choose, not only things like error messages...) in plugins for Adobe XD CC.

Usage

Installing the library

There are two main ways you can install the library.

  1. With a package manager: If you're using a package manager for your plugin (npm or yarn), you can easily install the helper by running npm install xd-dialog-helper --save or yarn add xd-dialog-helper in your console inside your plugin's folder.
  2. If you don't use a package manager, you can simply copy the dialog-helper.js-file from this repo into your project (e.g. into a lib-folder) and reference it that way.

Using the library

Depending on which option you chose when installing the library, you can get a reference to the helper class in different ways:

Option 1 (with a package manager):

If you installed it via a package manager and use some module bundler (like e.g., webpack), you can get a reference to the helper by using

const dialogHelper = require('xd-dialog-helper');

Option 2 (without a package manager):

If you copied the dialog-helper.js file from the repo, you can reference it by using the relative path. Assuming, that your plugin's .js file is at the root level and you have a lib folder containing the helper (i.e. lib/dialog-helper.js), you can reference the helper by using

const dialogHelper = require('./lib/dialog-helper');

Documentation for the library

You can find a detailed guide on how to use the library in the repository wiki.

Migrating to v1.0.0

Mostly, there should be no breaking changes (but many additional options and improvements) in v1.0, since it mostly consists of an internal restructuring.

However, with the release of the new version, the types have moved to a types namespace inside the xd-dialog-helper module.

This means that instead of writing

dialogHelper.showDialog('dialog', 'My dialog', [{
    id: 123,
    type: dialogHelper.TEXT_INPUT,
    label: 'Good morning'
}]);

we have to write:

dialogHelper.showDialog('dialog', 'My dialog', [{
    id: 123,
    type: dialogHelper.types.TEXT_INPUT,
    label: 'Good morning'
}]);

Please note: The old way is still available (but marked as deprecated) in the alpha- and beta versions of v1.0. It will, however, get removed with the full release of the new version.

Also, the type constant previously were aliases for numeric constants representing the type. This is no longer the case (to support custom types), which is why numeric values are no longer possible for the type field.