@sutton-signwriting/sgnw-components
Version:
a javascript package of web components for use with the SignWriting script.
41 lines (36 loc) • 1.25 kB
JavaScript
/*!
* The Sutton SignWriting Web Components
*/
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
import { d as draggabilly } from './draggabilly.js';
const fswSpatialCss = ".sc-fsw-spatial-h{width:140px;height:140px;background:#F90;border-radius:10px;cursor:move;display:block}.is-pointer-down.sc-fsw-spatial-h{background:#09F}.is-dragging.sc-fsw-spatial-h{opacity:0.7}";
const FswSymbol = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
constructor() {
super();
this.__registerHost();
}
componentDidLoad() {
this.draggie = new draggabilly(this.el);
}
render() {
return (h(Host, null, h("slot", null)));
}
get el() { return this; }
static get style() { return fswSpatialCss; }
}, [6, "fsw-spatial"]);
function defineCustomElement$1() {
if (typeof customElements === "undefined") {
return;
}
const components = ["fsw-spatial"];
components.forEach(tagName => { switch (tagName) {
case "fsw-spatial":
if (!customElements.get(tagName)) {
customElements.define(tagName, FswSymbol);
}
break;
} });
}
const FswSpatial = FswSymbol;
const defineCustomElement = defineCustomElement$1;
export { FswSpatial, defineCustomElement };