Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@ircam/simple-components

Package Overview
Dependencies
Maintainers
3
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ircam/simple-components

set of web components for audio interfaces and rapid prototyping

latest
Source
npmnpm
Version
2.5.0
Version published
Maintainers
3
Created
Source

@ircam/simple-components

set of web components for audio interfaces and rapid prototyping, created using the lit library.

Documentation

http://ircam-ismm.github.io/simple-components/

Installation

npm install lit @ircam/simple-components --save

Note: this library has never been tested with other framework than lit, any feedback is welcome.

Since v2, this package has moved to lit@2, which might cause issues if your application is using lit-html@1.x.x and/or lit-element@1.x.x

to update your app, see: https://lit.dev/docs/releases/upgrade/

if you don't want to update your app now, please fall back to version 1.x.x `npm install --save @ircam/simple-components@1.3.0`

Usage

Each components lives in its own file and should be imported separately, e.g.

import '@babel/polyfill';
import { html, render } from 'lit/html.js';
import '@ircam/simple-components/sc-toggle.js'

render(html`
  <sc-toggle
    @change="${e => console.log(e)}"
  ></sc-toggle>
`, document.body);

Documentation - List of existing components

see. documentation (http://ircam-ismm.github.io/simple-components/)

Support older browsers

To support older browser, you should import webcomponentsjs/webcomponents-bundle.js and ./vendors/lit/polyfill-support.js

A possible solution is to copy the file from your node_modules folder into a directory exposed by your server using postinstall scripts

In package.json

"scripts": {
  "postinstall": "mkdir -p ./vendors && cp -R node_modules/@webcomponents/webcomponentsjs ./vendors/ && cp -R node_modules/lit ./vendors/",
}
<script defer src="./vendors/webcomponentsjs/webcomponents-bundle.js"></script>
<script defer src="./vendors/lit/polyfill-support.js"></script> 

Such strategy as been implemented in the docs directory.

Design Considerations

These design aspects aim at simplifying future wrapping of the components in an editing tool.

Attributes

All components must expose a width and height attribute, for squared components (e.g. <sc-bang> and <sc-toggle>) the last attribute set wins

Events

  • all components should at least expose an @input or a @change event.
  • they can expose additional events, e.g. button @press and @release
  • payload should always have e.details.value

@todos

new elements

  • <sc-range>
  • <sc-multislider>
  • <sc-volume> (slider and number w/ db and lin output)
  • <sc-pan>
  • <sc-select>
  • <sc-radio>
  • <sc-dial> (maybe we just have to accept some people like that sort of thing...)

theming

License

BSD-3-Clause

Keywords

web components

FAQs

Package last updated on 31 May 2023

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