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

@pie-api/pie-element-extensions

v1.47.4

Published

Extended capabilites for pie-elements

Downloads

7,510

Readme

pie-element-extensions

This is a set of Custom Elements and ES Modules that extend the capabilties of @pie-framework/elements in the context of pie-api service. They are intended to be deployed for use in a browser with ES imports.

Initially, the Elements will include:

Cell - an element to render a user response in a small form factor that can be displayed in a table/spreadsheet cell

Response - an element to rendder more complete user response, in a larger form factor than Cell but without necessarily rendering the actual question

Future Elements:

Aggregate - display a PIE with aggreate information about a set of responses

Modules:

This lib may also export modules & functions that are not Custom Elements. e.g.: aggregateResponses([session]) - do a map reduce to get aggregate data about user responses.

Under R&D:

pie-api will support extending the capabilities of 'installed' pies with these extensions through a definition that defines the module urls for the extension's modules. See src/multiple-choice/pie.config.js

Installation

yarn add @pie-api/pie-element-extensions/
npm i @pie-api/pie-element-extensions/

Usage

<script type="module">
  import '@pie-api/pie-element-extensions/pie-element-extensions.js';
</script>
<!-- use one of the elements exported by the above import-->
<multiple-choice-cell></multiple-choice-cell>

Development

Quick Start

yarn  
yarn test

Adding new Elements

  • Add element source in src/pie-name directory.
  • Export a class that extends LitElement from the element module file. Also export this as default.
  • Add jsdoc @element tag-name in comments for the element class
  • Add jsdoc @prop {Type} name - description in coments for the element class
  • Add tests in src/pie-name/test
  • Add stories in stories/element-name/[pie-name].stories.js

Testing

To run the suite of karma tests, run

yarn test

To run the tests in watch mode (for TDD, for example), run

yarn test:watch

And open the URL that will be logged to consoleon test-server-start

Demoing with Storybook

To run a local instance of Storybook for the components, run

yarn storybook

To build a production version of Storybook, run

yarn storybook:build

Linting with ESLint, Prettier

To scan the project for linting errors, run

yarn lint

You can lint with ESLint and Prettier individually as well

yarn lint:eslint
yarn lint:prettier

To automatically fix many linting errors, run

yarn format

You can format using ESLint and Prettier individually as well

yarn format:eslint
yarn format:prettier

Local Demo with es-dev-server

yarn start

To run a local development server that serves the basic demo located in demo/index.html