improv-wifi-sdk
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -9,5 +9,5 @@ export class LaunchButton extends HTMLElement { | ||
this.toggleAttribute("not-supported", true); | ||
this.renderRoot.innerHTML = !LaunchButton.isSupported | ||
? "<slot name='unsupported'>Your browser does not support bluetooth provisioning. Use Google Chrome or Microsoft Edge.</slot>" | ||
: "<slot name='not-allowed'>You can only use Improv on HTTPS sites or localhost.</slot>"; | ||
this.renderRoot.innerHTML = !LaunchButton.isAllowed | ||
? "<slot name='not-allowed'>You can only use Improv on HTTPS sites or localhost.</slot>" | ||
: "<slot name='unsupported'>Your browser does not support bluetooth provisioning. Use Google Chrome or Microsoft Edge.</slot>"; | ||
return; | ||
@@ -14,0 +14,0 @@ } |
@@ -1,1 +0,1 @@ | ||
class o extends HTMLElement{connectedCallback(){if(this.renderRoot)return;if(this.renderRoot=this.attachShadow({mode:"open"}),!o.isSupported||!o.isAllowed)return this.toggleAttribute("not-supported",!0),void(this.renderRoot.innerHTML=o.isSupported?"<slot name='not-allowed'>You can only use Improv on HTTPS sites or localhost.</slot>":"<slot name='unsupported'>Your browser does not support bluetooth provisioning. Use Google Chrome or Microsoft Edge.</slot>");this.toggleAttribute("supported",!0),this.addEventListener("mouseover",(()=>{import("./provision-c8dc161f.js")}));const e=document.createElement("slot");e.name="activate";const t=document.createElement("button");if(t.innerText="Connect device to Wi-Fi",e.append(t),e.addEventListener("click",(async o=>{o.preventDefault();(await import("./provision-c8dc161f.js")).startProvisioning(this)})),"adoptedStyleSheets"in Document.prototype&&"replaceSync"in CSSStyleSheet.prototype){const e=new CSSStyleSheet;e.replaceSync(o.style),this.renderRoot.adoptedStyleSheets=[e]}else{const e=document.createElement("style");e.innerText=o.style,this.renderRoot.append(e)}this.renderRoot.append(e)}}o.isSupported="bluetooth"in navigator,o.isAllowed=window.isSecureContext,o.style='\n button {\n position: relative;\n cursor: pointer;\n font-size: 14px;\n padding: 8px 28px;\n color: var(--improv-on-primary-color, #fff);\n background-color: var(--improv-primary-color, #03a9f4);\n border: none;\n border-radius: 4px;\n box-shadow: 0 2px 2px 0 rgba(0,0,0,.14), 0 3px 1px -2px rgba(0,0,0,.12), 0 1px 5px 0 rgba(0,0,0,.2);\n }\n button::before {\n content: " ";\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n opacity: 0.2;\n border-radius: 4px;\n }\n button:hover {\n box-shadow: 0 4px 8px 0 rgba(0,0,0,.14), 0 1px 7px 0 rgba(0,0,0,.12), 0 3px 1px -1px rgba(0,0,0,.2);\n }\n button:hover::before {\n background-color: rgba(255,255,255,.8);\n }\n button:focus {\n outline: none;\n }\n button:focus::before {\n background-color: white;\n }\n button:active::before {\n background-color: grey;\n }\n',customElements.define("improv-wifi-launch-button",o); | ||
class o extends HTMLElement{connectedCallback(){if(this.renderRoot)return;if(this.renderRoot=this.attachShadow({mode:"open"}),!o.isSupported||!o.isAllowed)return this.toggleAttribute("not-supported",!0),void(this.renderRoot.innerHTML=o.isAllowed?"<slot name='unsupported'>Your browser does not support bluetooth provisioning. Use Google Chrome or Microsoft Edge.</slot>":"<slot name='not-allowed'>You can only use Improv on HTTPS sites or localhost.</slot>");this.toggleAttribute("supported",!0),this.addEventListener("mouseover",(()=>{import("./provision-c8dc161f.js")}));const e=document.createElement("slot");e.name="activate";const t=document.createElement("button");if(t.innerText="Connect device to Wi-Fi",e.append(t),e.addEventListener("click",(async o=>{o.preventDefault();(await import("./provision-c8dc161f.js")).startProvisioning(this)})),"adoptedStyleSheets"in Document.prototype&&"replaceSync"in CSSStyleSheet.prototype){const e=new CSSStyleSheet;e.replaceSync(o.style),this.renderRoot.adoptedStyleSheets=[e]}else{const e=document.createElement("style");e.innerText=o.style,this.renderRoot.append(e)}this.renderRoot.append(e)}}o.isSupported="bluetooth"in navigator,o.isAllowed=window.isSecureContext,o.style='\n button {\n position: relative;\n cursor: pointer;\n font-size: 14px;\n padding: 8px 28px;\n color: var(--improv-on-primary-color, #fff);\n background-color: var(--improv-primary-color, #03a9f4);\n border: none;\n border-radius: 4px;\n box-shadow: 0 2px 2px 0 rgba(0,0,0,.14), 0 3px 1px -2px rgba(0,0,0,.12), 0 1px 5px 0 rgba(0,0,0,.2);\n }\n button::before {\n content: " ";\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n opacity: 0.2;\n border-radius: 4px;\n }\n button:hover {\n box-shadow: 0 4px 8px 0 rgba(0,0,0,.14), 0 1px 7px 0 rgba(0,0,0,.12), 0 3px 1px -1px rgba(0,0,0,.2);\n }\n button:hover::before {\n background-color: rgba(255,255,255,.8);\n }\n button:focus {\n outline: none;\n }\n button:focus::before {\n background-color: white;\n }\n button:active::before {\n background-color: grey;\n }\n',customElements.define("improv-wifi-launch-button",o); |
{ | ||
"name": "improv-wifi-sdk", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Improv Wi-Fi SDK for the browser", | ||
@@ -5,0 +5,0 @@ "main": "dist/launch-button.js", |
@@ -56,5 +56,5 @@ export class LaunchButton extends HTMLElement { | ||
this.toggleAttribute("not-supported", true); | ||
this.renderRoot.innerHTML = !LaunchButton.isSupported | ||
? "<slot name='unsupported'>Your browser does not support bluetooth provisioning. Use Google Chrome or Microsoft Edge.</slot>" | ||
: "<slot name='not-allowed'>You can only use Improv on HTTPS sites or localhost.</slot>"; | ||
this.renderRoot.innerHTML = !LaunchButton.isAllowed | ||
? "<slot name='not-allowed'>You can only use Improv on HTTPS sites or localhost.</slot>" | ||
: "<slot name='unsupported'>Your browser does not support bluetooth provisioning. Use Google Chrome or Microsoft Edge.</slot>"; | ||
return; | ||
@@ -61,0 +61,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
280418