UNPKG

@nent/core

Version:

Functional elements to add routing, data-binding, dynamic HTML, declarative actions, audio, video, and so much more. Supercharge static HTML files into web apps without script or builds.

4 lines 683 B
/*! * NENT 2022 */ import{r as t,h as i,H as n,a as o}from"./index-916ca544.js";const a=class{constructor(i){t(this,i)}componentWillLoad(){if(!this.url){let t=document.location.href;const i=document.querySelector("link[rel=canonical]");i&&(t=i.href),this.url=t}}async share(t){(null===navigator||void 0===navigator?void 0:navigator.share)&&await navigator.share({title:(null==t?void 0:t.title)||this.headline||document.title,text:(null==t?void 0:t.text)||this.text,url:(null==t?void 0:t.url)||this.url})}render(){return i(n,{onClick:async()=>await this.share()},i("slot",null))}get el(){return o(this)}};a.style=":host{display:inline-block;cursor:pointer}";export{a as n_app_share}