@aejkatappaja/phantom-ui 0.5.1 → 0.5.2
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/phantom-ui.cdn.js +6 -2
- package/dist/phantom-ui.js +6 -2
- package/package.json +1 -1
package/dist/phantom-ui.cdn.js
CHANGED
|
@@ -19,7 +19,9 @@
|
|
|
19
19
|
:host([loading]) ::slotted(img),
|
|
20
20
|
:host([loading]) ::slotted(svg),
|
|
21
21
|
:host([loading]) ::slotted(video),
|
|
22
|
-
:host([loading]) ::slotted(canvas)
|
|
22
|
+
:host([loading]) ::slotted(canvas),
|
|
23
|
+
:host([loading]) ::slotted(button),
|
|
24
|
+
:host([loading]) ::slotted([role="button"]) {
|
|
23
25
|
opacity: 0 !important;
|
|
24
26
|
}
|
|
25
27
|
|
|
@@ -117,7 +119,9 @@
|
|
|
117
119
|
phantom-ui[loading] img,
|
|
118
120
|
phantom-ui[loading] svg,
|
|
119
121
|
phantom-ui[loading] video,
|
|
120
|
-
phantom-ui[loading] canvas
|
|
122
|
+
phantom-ui[loading] canvas,
|
|
123
|
+
phantom-ui[loading] button,
|
|
124
|
+
phantom-ui[loading] [role="button"] {
|
|
121
125
|
opacity: 0 !important;
|
|
122
126
|
}
|
|
123
127
|
`,document.head.appendChild(r)}var p=class extends b{constructor(){super(...arguments);this.loading=!1;this.shimmerColor="rgba(128, 128, 128, 0.3)";this.backgroundColor="rgba(128, 128, 128, 0.2)";this.duration=1.5;this.fallbackRadius=4;this.animation="shimmer";this.stagger=0;this.reveal=0;this.count=1;this.countGap=0;this._blocks=[];this._revealing=!1;this._resizeObserver=null;this._mutationObserver=null;this._loadHandler=null;this._measureScheduled=!1;this._revealTimeout=null}connectedCallback(){super.connectedCallback(),Zt()}disconnectedCallback(){super.disconnectedCallback(),this._teardownObservers(),this._clearRevealTimeout()}willUpdate(e){e.has("loading")&&!this.loading&&this.reveal>0&&this._blocks.length>0&&(this._revealing=!0)}updated(e){(e.has("count")||e.has("countGap"))&&this.loading&&this._scheduleMeasure(),e.has("loading")&&(this.setAttribute("aria-busy",String(this.loading)),this.loading?(this._revealing=!1,this._clearRevealTimeout(),this._scheduleMeasure(),this._setupObservers()):this._revealing?(this._teardownObservers(),this._revealTimeout=setTimeout(()=>{this._revealing=!1,this._blocks=[],this._revealTimeout=null,this.style.minHeight=""},this.reveal*1e3)):(this._blocks=[],this._teardownObservers(),this.style.minHeight=""))}render(){let e=xt({"--shimmer-color":this.shimmerColor,"--shimmer-duration":`${this.duration}s`,"--shimmer-bg":this.backgroundColor,"--reveal-duration":`${this.reveal}s`}),s=this.loading||this._revealing;return j`
|
package/dist/phantom-ui.js
CHANGED
|
@@ -17,7 +17,9 @@ var _=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var a=(n,r,e,s
|
|
|
17
17
|
:host([loading]) ::slotted(img),
|
|
18
18
|
:host([loading]) ::slotted(svg),
|
|
19
19
|
:host([loading]) ::slotted(video),
|
|
20
|
-
:host([loading]) ::slotted(canvas)
|
|
20
|
+
:host([loading]) ::slotted(canvas),
|
|
21
|
+
:host([loading]) ::slotted(button),
|
|
22
|
+
:host([loading]) ::slotted([role="button"]) {
|
|
21
23
|
opacity: 0 !important;
|
|
22
24
|
}
|
|
23
25
|
|
|
@@ -115,7 +117,9 @@ var _=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var a=(n,r,e,s
|
|
|
115
117
|
phantom-ui[loading] img,
|
|
116
118
|
phantom-ui[loading] svg,
|
|
117
119
|
phantom-ui[loading] video,
|
|
118
|
-
phantom-ui[loading] canvas
|
|
120
|
+
phantom-ui[loading] canvas,
|
|
121
|
+
phantom-ui[loading] button,
|
|
122
|
+
phantom-ui[loading] [role="button"] {
|
|
119
123
|
opacity: 0 !important;
|
|
120
124
|
}
|
|
121
125
|
`,document.head.appendChild(n)}var o=class extends T{constructor(){super(...arguments);this.loading=!1;this.shimmerColor="rgba(128, 128, 128, 0.3)";this.backgroundColor="rgba(128, 128, 128, 0.2)";this.duration=1.5;this.fallbackRadius=4;this.animation="shimmer";this.stagger=0;this.reveal=0;this.count=1;this.countGap=0;this._blocks=[];this._revealing=!1;this._resizeObserver=null;this._mutationObserver=null;this._loadHandler=null;this._measureScheduled=!1;this._revealTimeout=null}connectedCallback(){super.connectedCallback(),A()}disconnectedCallback(){super.disconnectedCallback(),this._teardownObservers(),this._clearRevealTimeout()}willUpdate(e){e.has("loading")&&!this.loading&&this.reveal>0&&this._blocks.length>0&&(this._revealing=!0)}updated(e){(e.has("count")||e.has("countGap"))&&this.loading&&this._scheduleMeasure(),e.has("loading")&&(this.setAttribute("aria-busy",String(this.loading)),this.loading?(this._revealing=!1,this._clearRevealTimeout(),this._scheduleMeasure(),this._setupObservers()):this._revealing?(this._teardownObservers(),this._revealTimeout=setTimeout(()=>{this._revealing=!1,this._blocks=[],this._revealTimeout=null,this.style.minHeight=""},this.reveal*1e3)):(this._blocks=[],this._teardownObservers(),this.style.minHeight=""))}render(){let e=S({"--shimmer-color":this.shimmerColor,"--shimmer-duration":`${this.duration}s`,"--shimmer-bg":this.backgroundColor,"--reveal-duration":`${this.reveal}s`}),s=this.loading||this._revealing;return p`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aejkatappaja/phantom-ui",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "Structure-aware shimmer skeleton loader as a universal Web Component built with Lit. Works with React, Vue, Svelte, Angular, Solid, or vanilla JS.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|