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

@cloudblueconnect/connect-ui-toolkit

v34.4.0

Published

<a href="https://npmjs.com/package/@cloudblueconnect/connect-ui-toolkit"><img src="https://img.shields.io/npm/v/%40cloudblueconnect%2Fconnect-ui-toolkit?logo=npm" alt="NPM package"></a> <a href="https://github.com/cloudblue/connect-ui-toolkit/actions/work

Downloads

208

Readme

Connect UI Toolkit


Build your Connect Extension UI easily with our UI Toolkit. Feel free to use any frontend library or framework you prefer!

Installation

Minimalistic via CDN

Just plug a module via script tag, import default exported function and call it. You're good.

N.B.: For development mode - by default <path> will be http://localhost:3003

<script type="module">
  import createApp from '<path>';

  createApp();
</script>

This will implement minimalistic interaction with parent Connect Application.

Usage

Use widgets

  1. Import required widget from named exports
  2. Pass a configuration Object to createApp function as an argument
  3. Configuration object should contain desired tag name as a key and widget descriptor object as a value. N.B.: widget name should contain at least one "-"
<script type="module">
  import createApp, { Card } from '<path>';

  createApp({
    'my-card': Card,
  });
</script>

...

<my-card title="Lorem Ipsum">
  <p>My content here...</p>
</my-card>

Control widgets using attributes (see widgets documentation)

Interaction with parent app

We implemented two ways to interact with parent application - one is data-based, another events-based. You will find supported data properties and handled events list in slot's documentation. Let's see how you can use it to build your app:

Data-based interface with watch/commit

If some data-based interface is documented for particular slot you may subscribe on it using watch method or publish changes using commit

<script type="module">
  import createApp from '<path>';

  const app = createApp();

  app.watch('observed', (value) => {
    /* handle "observed" property change here */
  });

  app.commit({
    observed: /* Desired "observed" value here */,
  });
</script>

Use watch('observed', (value) => { ... }) to watch observed property

Use watch('*', (all) => { ... }) or just watch((all) => { ... }) to watch all provided properties at once

Use commit({ observed: 'ABC' }) to commit values that you want to be sent to parent app.

N.B.: Only expected properties will be processed. Anything unexpected will be omitted

N.B.2: Due to security reasons this tool supports only simple values - like Strings, Numbers and Booleans (in depth too). Functions, Dates etc. will not work.

Events-based interface with listen/emit;

<script type="module">
  import createApp from '<path>';

  const app = createApp();

  app.emit('openDialog', {
    title: 'Lorem Ipsum',
    description: 'Dolor sit amet',
  });

  app.listen('dialog:confirmed', () => {
    /* handle parent app dialog confirmation */
  });
</script>