@everymatrix/lottery-button 1.88.5 → 1.88.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/{lottery-button-cd5365f9.js → lottery-button-d3385aa1.js} +1 -1
- package/dist/cjs/lottery-button.cjs.entry.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/{lottery-button-4ca314fb.js → lottery-button-10b847f7.js} +1 -1
- package/dist/esm/lottery-button.entry.js +1 -1
- package/dist/lottery-button/index.esm.js +1 -1
- package/dist/lottery-button/lottery-button-10b847f7.js +1 -0
- package/dist/lottery-button/lottery-button.entry.js +1 -1
- package/package.json +1 -1
- package/dist/lottery-button/lottery-button-4ca314fb.js +0 -1
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -100,7 +100,7 @@ function getAdoptStyleSubscription(stylingContainer, domain) {
|
|
|
100
100
|
|
|
101
101
|
const shadowRoot = stylingContainer.getRootNode();
|
|
102
102
|
const cacheStyleObject = window[StyleCacheKey];
|
|
103
|
-
let cachedStyle = cacheStyleObject[domain]
|
|
103
|
+
let cachedStyle = cacheStyleObject[domain] && cacheStyleObject[domain].sheet;
|
|
104
104
|
|
|
105
105
|
if (!cachedStyle) {
|
|
106
106
|
cachedStyle = new CSSStyleSheet();
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { L as LotteryButton } from './lottery-button-
|
|
1
|
+
export { L as LotteryButton } from './lottery-button-10b847f7.js';
|
|
2
2
|
import './index-66798fac.js';
|
|
@@ -98,7 +98,7 @@ function getAdoptStyleSubscription(stylingContainer, domain) {
|
|
|
98
98
|
|
|
99
99
|
const shadowRoot = stylingContainer.getRootNode();
|
|
100
100
|
const cacheStyleObject = window[StyleCacheKey];
|
|
101
|
-
let cachedStyle = cacheStyleObject[domain]
|
|
101
|
+
let cachedStyle = cacheStyleObject[domain] && cacheStyleObject[domain].sheet;
|
|
102
102
|
|
|
103
103
|
if (!cachedStyle) {
|
|
104
104
|
cachedStyle = new CSSStyleSheet();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { L as lottery_button } from './lottery-button-
|
|
1
|
+
export { L as lottery_button } from './lottery-button-10b847f7.js';
|
|
2
2
|
import './index-66798fac.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{L as LotteryButton}from"./lottery-button-
|
|
1
|
+
export{L as LotteryButton}from"./lottery-button-10b847f7.js";import"./index-66798fac.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as o,g as e}from"./index-66798fac.js";const r="__WIDGET_GLOBAL_STYLE_CACHE__";function n(t,o){if(t){const e=document.createElement("style");e.innerHTML=o,t.appendChild(e)}}function i(t,o){if(!t||!o)return;const e=new URL(o);fetch(e.href).then((t=>t.text())).then((o=>{const e=document.createElement("style");e.innerHTML=o,t&&t.appendChild(e)})).catch((t=>{console.error("There was an error while trying to load client styling from URL",t)}))}function a(t,o,e,n=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!n)return e=function(t,o){const e=document.createElement("style");return window.emMessageBus.subscribe(o,(o=>{t&&(e.innerHTML=o,t.appendChild(e))}))}(t,o),e;window[r]||(window[r]={}),e=function(t,o){return window.emMessageBus.subscribe(o,(e=>{if(!t)return;const n=t.getRootNode(),i=window[r];let a=i[o]&&i[o].sheet;a?i[o].refCount=i[o].refCount+1:(a=new CSSStyleSheet,a.replaceSync(e),i[o]={sheet:a,refCount:1});const l=n.adoptedStyleSheets||[];l.includes(a)||(n.adoptedStyleSheets=[...l,a])}))}(t,o);const i=e.unsubscribe.bind(e);return e.unsubscribe=()=>{if(window[r][o]){const t=window[r][o];t.refCount>1?t.refCount=t.refCount-1:delete window[r][o]}i()},e}const l=["ro","en","fr","ar","hr","zh"],s={en:{loading:"Loading"},ro:{},fr:{},ar:{},hr:{}},d=class{constructor(o){t(this,o),this.handleClick=t=>{if(this.disabled)return;const o=this.host.shadowRoot.querySelector(".btn");if(!o)return;const e=o.getBoundingClientRect(),r=Math.max(e.width,e.height),n={top:t.clientY-e.top-r/2,left:t.clientX-e.left-r/2,size:r};this.ripples=[...this.ripples,n],setTimeout((()=>{this.ripples=this.ripples.filter((t=>t!==n))}),600)},this.variant="primary",this.size="medium",this.color=void 0,this.disabled=!1,this.loading=!1,this.text=void 0,this.mbSource=void 0,this.language="en",this.clientStyling=void 0,this.clientStylingUrl=void 0,this.translationUrl="",this.ripples=[]}handleClientStylingChange(t,o){t!=o&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,o){t!=o&&i(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,o){t!=o&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&i(this.stylingContainer,this.clientStylingUrl))}componentWillLoad(){this.translationUrl&&(async t=>{if(t)try{const e=await fetch(t);if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);const r=await e.json();o=r,Object.keys(o).forEach((t=>{for(let e in o[t])s[t][e]=o[t][e]}))}catch(t){console.error("Failed to fetch or parse translations from URL:",t)}var o})(this.translationUrl)}render(){const{variant:t,disabled:e,size:r,color:n}=this,i=e||this.loading,a={};if(n)switch(t){case"primary":default:Object.assign(a,{backgroundColor:n,borderColor:n});break;case"outline":case"dashed":Object.assign(a,{color:n,borderColor:n});break;case"text":Object.assign(a,{color:n})}return o("button",{key:"aa74ad98c90e7548228557bf8a8d26b125d4a83a",class:{btn:!0,[`btn--${t}`]:!0,[`btn--${r}`]:!0,"btn--loading":this.loading},style:n?a:void 0,disabled:i,onClick:this.handleClick,ref:t=>this.stylingContainer=t},this.loading?o("div",{class:"loading-container"},o("span",{class:"content"},this.text||(()=>{const t=this.language;let o=s[void 0!==t&&l.includes(t)?t:"en"].loading;return o})()),o("span",{class:"spinner"})):o("span",{class:"content"},o("slot",{name:"icon-left"}),this.text||o("slot",null),o("slot",{name:"icon-right"})),o("div",{key:"302ea02be395bb24989d4abc040a513e23fa029a",class:"ripple-container"},this.ripples.map(((t,e)=>o("span",{key:e,class:"ripple",style:{top:`${t.top}px`,left:`${t.left}px`,width:`${t.size}px`,height:`${t.size}px`}})))))}get host(){return e(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};d.style=":host{display:inline-block}.btn{font:inherit;position:relative;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:var(--lottery-button-border-radius, 6px);font-weight:var(--lottery-button-font-weight, 500);cursor:pointer;outline:none;overflow:hidden;transition:var(--lottery-button-transition, background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s);user-select:none;-webkit-tap-highlight-color:transparent;box-shadow:var(--lottery-button-box-shadow, 0 2px 4px 0 rgba(0, 0, 0, 0.5))}.btn .content{position:relative;display:inline-flex;align-items:center;gap:var(--lottery-button-content-gap, 0.5em)}.btn .content ::slotted(span){display:inline-flex;align-items:center}.btn:hover:not(:disabled){box-shadow:var(--lottery-button-hover-box-shadow, 0 4px 8px 0 rgba(0, 0, 0, 0.5))}.btn:disabled{cursor:not-allowed;opacity:var(--lottery-button-disabled-opacity, 0.5)}.btn .loading-container{display:flex;align-items:center}.btn--loading{position:relative}.btn .spinner{display:inline-block;width:1em;height:1em;border:var(--lottery-button-spinner-border, 2px solid rgba(255, 255, 255, 0.3));border-radius:50%;border-top-color:var(--lottery-button-spinner-color, white);animation:spin 1s ease-in-out infinite;margin-left:0.5em;vertical-align:middle}.btn--small .spinner{width:0.8em;height:0.8em}.btn--large .spinner{width:1.2em;height:1.2em}@keyframes spin{to{transform:rotate(360deg)}}.btn--primary{background-color:var(--emw--color-primary, #0d196e);color:var(--emw--color-typography-inverse, #fff)}.btn--primary:hover:not(:disabled){background-color:var(--emw--color-primary-variant, #1367e7)}.btn--primary:active:not(:disabled){background-color:var(--lottery-button-primary-active-bg, #08104a)}.btn--outline .spinner,.btn--dashed .spinner,.btn--text .spinner{border-top-color:currentColor;border-color:var(--lottery-button-spinner-inverse-border-color, rgba(0, 0, 0, 0.2))}.btn--outline{background-color:var(--emw--color-background, #fff);border-color:var(--lottery-button-outline-border-color, #dcdcdc);color:var(--emw--color-typography, #000)}.btn--outline:hover:not(:disabled){background-color:var(--emw--color-background-tertiary, #ccc);border-color:var(--lottery-button-outline-hover-border-color, #a6a6a6)}.btn--outline:active:not(:disabled){background-color:var(--lottery-button-outline-active-bg, #e6e6e6)}.btn--dashed{background-color:transparent;border-style:dashed;border-color:var(--lottery-button-dashed-border-color, #dcdcdc);color:var(--lottery-button-dashed-color, #333)}.btn--dashed:hover:not(:disabled){border-color:var(--lottery-button-dashed-hover-border-color, #a6a6a6);color:var(--lottery-button-dashed-hover-color, #0052d9)}.btn--text{background-color:transparent;color:var(--lottery-button-text-color, #0052d9);border-color:transparent}.btn--text:hover:not(:disabled){background-color:var(--lottery-button-text-hover-bg, #f2f2f2)}.btn--text:active:not(:disabled){background-color:var(--lottery-button-text-active-bg, #e6e6e6)}.btn--custom-color:hover:not(:disabled){opacity:var(--lottery-button-custom-hover-opacity, 0.9)}.btn--custom-color:active:not(:disabled){opacity:var(--lottery-button-custom-active-opacity, 0.8)}.btn--small{height:var(--lottery-button-small-height, 28px);font-size:var(--lottery-button-small-font-size, 12px);padding:var(--lottery-button-small-padding, 0 12px)}.btn--medium{height:var(--lottery-button-medium-height, 34px);font-size:var(--lottery-button-medium-font-size, 14px);padding:var(--lottery-button-medium-padding, 0 18px)}.btn--large{height:var(--lottery-button-large-height, 40px);font-size:var(--lottery-button-large-font-size, 16px);padding:var(--lottery-button-large-padding, 0 24px)}.ripple-container{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;border-radius:inherit}.ripple{position:absolute;border-radius:50%;background-color:var(--lottery-button-ripple-light, rgba(255, 255, 255, 0.3));transform:scale(0);animation:ripple-animation 600ms linear}.btn--outline .ripple,.btn--dashed .ripple,.btn--text .ripple{background-color:var(--lottery-button-ripple-dark, rgba(0, 0, 0, 0.03))}@keyframes ripple-animation{to{transform:scale(4);opacity:0}}";export{d as L}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{L as lottery_button}from"./lottery-button-
|
|
1
|
+
export{L as lottery_button}from"./lottery-button-10b847f7.js";import"./index-66798fac.js";
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as o,g as e}from"./index-66798fac.js";const r="__WIDGET_GLOBAL_STYLE_CACHE__";function n(t,o){if(t){const e=document.createElement("style");e.innerHTML=o,t.appendChild(e)}}function i(t,o){if(!t||!o)return;const e=new URL(o);fetch(e.href).then((t=>t.text())).then((o=>{const e=document.createElement("style");e.innerHTML=o,t&&t.appendChild(e)})).catch((t=>{console.error("There was an error while trying to load client styling from URL",t)}))}function a(t,o,e,n=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!n)return e=function(t,o){const e=document.createElement("style");return window.emMessageBus.subscribe(o,(o=>{t&&(e.innerHTML=o,t.appendChild(e))}))}(t,o),e;window[r]||(window[r]={}),e=function(t,o){return window.emMessageBus.subscribe(o,(e=>{if(!t)return;const n=t.getRootNode(),i=window[r];let a=i[o]?.sheet;a?i[o].refCount=i[o].refCount+1:(a=new CSSStyleSheet,a.replaceSync(e),i[o]={sheet:a,refCount:1});const l=n.adoptedStyleSheets||[];l.includes(a)||(n.adoptedStyleSheets=[...l,a])}))}(t,o);const i=e.unsubscribe.bind(e);return e.unsubscribe=()=>{if(window[r][o]){const t=window[r][o];t.refCount>1?t.refCount=t.refCount-1:delete window[r][o]}i()},e}const l=["ro","en","fr","ar","hr","zh"],s={en:{loading:"Loading"},ro:{},fr:{},ar:{},hr:{}},d=class{constructor(o){t(this,o),this.handleClick=t=>{if(this.disabled)return;const o=this.host.shadowRoot.querySelector(".btn");if(!o)return;const e=o.getBoundingClientRect(),r=Math.max(e.width,e.height),n={top:t.clientY-e.top-r/2,left:t.clientX-e.left-r/2,size:r};this.ripples=[...this.ripples,n],setTimeout((()=>{this.ripples=this.ripples.filter((t=>t!==n))}),600)},this.variant="primary",this.size="medium",this.color=void 0,this.disabled=!1,this.loading=!1,this.text=void 0,this.mbSource=void 0,this.language="en",this.clientStyling=void 0,this.clientStylingUrl=void 0,this.translationUrl="",this.ripples=[]}handleClientStylingChange(t,o){t!=o&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,o){t!=o&&i(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,o){t!=o&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&i(this.stylingContainer,this.clientStylingUrl))}componentWillLoad(){this.translationUrl&&(async t=>{if(t)try{const e=await fetch(t);if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);const r=await e.json();o=r,Object.keys(o).forEach((t=>{for(let e in o[t])s[t][e]=o[t][e]}))}catch(t){console.error("Failed to fetch or parse translations from URL:",t)}var o})(this.translationUrl)}render(){const{variant:t,disabled:e,size:r,color:n}=this,i=e||this.loading,a={};if(n)switch(t){case"primary":default:Object.assign(a,{backgroundColor:n,borderColor:n});break;case"outline":case"dashed":Object.assign(a,{color:n,borderColor:n});break;case"text":Object.assign(a,{color:n})}return o("button",{key:"aa74ad98c90e7548228557bf8a8d26b125d4a83a",class:{btn:!0,[`btn--${t}`]:!0,[`btn--${r}`]:!0,"btn--loading":this.loading},style:n?a:void 0,disabled:i,onClick:this.handleClick,ref:t=>this.stylingContainer=t},this.loading?o("div",{class:"loading-container"},o("span",{class:"content"},this.text||(()=>{const t=this.language;let o=s[void 0!==t&&l.includes(t)?t:"en"].loading;return o})()),o("span",{class:"spinner"})):o("span",{class:"content"},o("slot",{name:"icon-left"}),this.text||o("slot",null),o("slot",{name:"icon-right"})),o("div",{key:"302ea02be395bb24989d4abc040a513e23fa029a",class:"ripple-container"},this.ripples.map(((t,e)=>o("span",{key:e,class:"ripple",style:{top:`${t.top}px`,left:`${t.left}px`,width:`${t.size}px`,height:`${t.size}px`}})))))}get host(){return e(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};d.style=":host{display:inline-block}.btn{font:inherit;position:relative;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:var(--lottery-button-border-radius, 6px);font-weight:var(--lottery-button-font-weight, 500);cursor:pointer;outline:none;overflow:hidden;transition:var(--lottery-button-transition, background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s);user-select:none;-webkit-tap-highlight-color:transparent;box-shadow:var(--lottery-button-box-shadow, 0 2px 4px 0 rgba(0, 0, 0, 0.5))}.btn .content{position:relative;display:inline-flex;align-items:center;gap:var(--lottery-button-content-gap, 0.5em)}.btn .content ::slotted(span){display:inline-flex;align-items:center}.btn:hover:not(:disabled){box-shadow:var(--lottery-button-hover-box-shadow, 0 4px 8px 0 rgba(0, 0, 0, 0.5))}.btn:disabled{cursor:not-allowed;opacity:var(--lottery-button-disabled-opacity, 0.5)}.btn .loading-container{display:flex;align-items:center}.btn--loading{position:relative}.btn .spinner{display:inline-block;width:1em;height:1em;border:var(--lottery-button-spinner-border, 2px solid rgba(255, 255, 255, 0.3));border-radius:50%;border-top-color:var(--lottery-button-spinner-color, white);animation:spin 1s ease-in-out infinite;margin-left:0.5em;vertical-align:middle}.btn--small .spinner{width:0.8em;height:0.8em}.btn--large .spinner{width:1.2em;height:1.2em}@keyframes spin{to{transform:rotate(360deg)}}.btn--primary{background-color:var(--emw--color-primary, #0d196e);color:var(--emw--color-typography-inverse, #fff)}.btn--primary:hover:not(:disabled){background-color:var(--emw--color-primary-variant, #1367e7)}.btn--primary:active:not(:disabled){background-color:var(--lottery-button-primary-active-bg, #08104a)}.btn--outline .spinner,.btn--dashed .spinner,.btn--text .spinner{border-top-color:currentColor;border-color:var(--lottery-button-spinner-inverse-border-color, rgba(0, 0, 0, 0.2))}.btn--outline{background-color:var(--emw--color-background, #fff);border-color:var(--lottery-button-outline-border-color, #dcdcdc);color:var(--emw--color-typography, #000)}.btn--outline:hover:not(:disabled){background-color:var(--emw--color-background-tertiary, #ccc);border-color:var(--lottery-button-outline-hover-border-color, #a6a6a6)}.btn--outline:active:not(:disabled){background-color:var(--lottery-button-outline-active-bg, #e6e6e6)}.btn--dashed{background-color:transparent;border-style:dashed;border-color:var(--lottery-button-dashed-border-color, #dcdcdc);color:var(--lottery-button-dashed-color, #333)}.btn--dashed:hover:not(:disabled){border-color:var(--lottery-button-dashed-hover-border-color, #a6a6a6);color:var(--lottery-button-dashed-hover-color, #0052d9)}.btn--text{background-color:transparent;color:var(--lottery-button-text-color, #0052d9);border-color:transparent}.btn--text:hover:not(:disabled){background-color:var(--lottery-button-text-hover-bg, #f2f2f2)}.btn--text:active:not(:disabled){background-color:var(--lottery-button-text-active-bg, #e6e6e6)}.btn--custom-color:hover:not(:disabled){opacity:var(--lottery-button-custom-hover-opacity, 0.9)}.btn--custom-color:active:not(:disabled){opacity:var(--lottery-button-custom-active-opacity, 0.8)}.btn--small{height:var(--lottery-button-small-height, 28px);font-size:var(--lottery-button-small-font-size, 12px);padding:var(--lottery-button-small-padding, 0 12px)}.btn--medium{height:var(--lottery-button-medium-height, 34px);font-size:var(--lottery-button-medium-font-size, 14px);padding:var(--lottery-button-medium-padding, 0 18px)}.btn--large{height:var(--lottery-button-large-height, 40px);font-size:var(--lottery-button-large-font-size, 16px);padding:var(--lottery-button-large-padding, 0 24px)}.ripple-container{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;border-radius:inherit}.ripple{position:absolute;border-radius:50%;background-color:var(--lottery-button-ripple-light, rgba(255, 255, 255, 0.3));transform:scale(0);animation:ripple-animation 600ms linear}.btn--outline .ripple,.btn--dashed .ripple,.btn--text .ripple{background-color:var(--lottery-button-ripple-dark, rgba(0, 0, 0, 0.03))}@keyframes ripple-animation{to{transform:scale(4);opacity:0}}";export{d as L}
|