UNPKG

@sutton-signwriting/sgnw-components

Version:

a javascript package of web components for use with the SignWriting script.

4 lines 1.95 kB
/*! * The Sutton SignWriting Web Components */ import{r as s,f as t,d as i,H as n,e as o}from"./p-BAJUTSOF.js";import{f as e}from"./p-CsiwdcpL.js";import{C as h,s as c}from"./p-BgrNWcmU.js";import{f as r}from"./p-CexNLLwH.js";const a=class{constructor(t){s(this,t),this.sgnw=window.sgnw}connectedCallback(){if(this.colorWatch=new h(this.el,this),!this.sign){let s=e.parse.sign(this.el.innerHTML);s.style&&(this.styling=c.compose(c.merge(c.parse(s.style),c.parse(this.styling)))),s.style="",this.sign=e.compose.sign(s)}if(!this.sgnw){let t=this;function i(){t.sgnw=window.sgnw,window.removeEventListener("sgnw",i,!1)}window.addEventListener("sgnw",i,!1)}}disconnectedCallback(){this.colorWatch.dispose()}render(){const s=c.compose(c.merge(t(this.el),c.parse(this.styling)));return i(n,{key:"569666a6b261005ca3f9219e6320b6729824c420",sign:this.sign,styling:this.styling,innerHTML:this.sgnw?r.signSvg(this.sign+s):""},i("slot",{key:"b53feac3a744d011833be0e65e3927c92ca6f63f"}))}get el(){return o(this)}};a.style=":host{direction:ltr}:host{transition:color 1ms, background-color 1ms}";const l=class{constructor(t){s(this,t),this.sgnw=window.sgnw}connectedCallback(){if(this.colorWatch=new h(this.el,this),!this.symbol){let s=e.parse.symbol(this.el.innerHTML);s.style&&(this.styling=c.compose(c.merge(c.parse(s.style),c.parse(this.styling)))),this.symbol=s.symbol}if(!this.sgnw){let t=this;function i(){t.sgnw=window.sgnw,window.removeEventListener("sgnw",i,!1)}window.addEventListener("sgnw",i,!1)}}disconnectedCallback(){this.colorWatch.dispose()}render(){const s=c.compose(c.merge(t(this.el),c.parse(this.styling)));return i(n,{key:"86f20d62b1a9c98b90474a9ec054a76ee3a2d1b9",symbol:this.symbol,styling:this.styling,innerHTML:this.sgnw?r.symbolSvg(this.symbol+s):""},i("slot",{key:"526c8016004ba63407640a123475c6a9e3b48041"}))}get el(){return o(this)}};l.style=":host{transition:color 1ms, background-color 1ms}";export{a as fsw_sign,l as fsw_symbol}