kempo 1.2.3 → 1.2.5

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.
@@ -1 +1 @@
1
- import Component from"./Component.js";import{isInView}from"../utils/element.js";export default class LazyComponent extends Component{constructor(e){super(e),new IntersectionObserver((([e])=>{e.intersectionRatio>0&&!this.rendered?this.inViewCallback():this.outOfViewCallback()})).observe(this),this.registerAttribute("unrender",!1)}async connectedCallback(){await this.renderSkelton(),await isInView(this)&&await this.inViewCallback()}async inViewCallback(){await this.render()}async outOfViewCallback(){this.unrender&&await this.renderSkelton()}async renderSkelton(){this.shadowRoot.innerHTML=`<link rel="stylesheet" href="../kempo/kempo-vars.css" /><link rel="stylesheet" href="../kempo/kempo-styles.css" />${this.skeletonTemplate}<style>${this.shadowStyles}</style>`,this.rendered=!1}get skeletonTemplate(){return'<div style="height: var(--skeleton_height, 1rem)"></div>'}}
1
+ import Component from"./Component.js";import{isInView}from"../utils/element.js";export default class LazyComponent extends Component{constructor(e){super(e),new IntersectionObserver((([e])=>{e.intersectionRatio>0&&!this.rendered?this.inViewCallback():this.outOfViewCallback()})).observe(this),this.registerAttribute("unrender",!1)}async connectedCallback(){await this.renderSkelton(),await isInView(this)&&await this.inViewCallback()}async inViewCallback(){await this.render()}async outOfViewCallback(){this.unrender&&await this.renderSkelton()}async renderSkelton(){this.shadowRoot.innerHTML=`<link rel="stylesheet" href="${Component.pathToKempo}/kempo-styles.css" />${this.skeletonTemplate}<style>${this.shadowStyles}</style>`,this.rendered=!1}get skeletonTemplate(){return'<div style="height: var(--skeleton_height, 1rem)"></div>'}}
@@ -1 +1 @@
1
- import Component from"./Component.js";import{isInView}from"../utils/element.js";export default class LazyComponent extends Component{constructor(e){super(e),new IntersectionObserver((([e])=>{e.intersectionRatio>0&&!this.rendered?this.inViewCallback():this.outOfViewCallback()})).observe(this),this.registerAttribute("unrender",!1)}async connectedCallback(){await this.renderSkelton(),await isInView(this)&&await this.inViewCallback()}async inViewCallback(){await this.render()}async outOfViewCallback(){this.unrender&&await this.renderSkelton()}async renderSkelton(){this.shadowRoot.innerHTML=`<link rel="stylesheet" href="../kempo/kempo-vars.css" /><link rel="stylesheet" href="../kempo/kempo-styles.css" />${this.skeletonTemplate}<style>${this.shadowStyles}</style>`,this.rendered=!1}get skeletonTemplate(){return'<div style="height: var(--skeleton_height, 1rem)"></div>'}}
1
+ import Component from"./Component.js";import{isInView}from"../utils/element.js";export default class LazyComponent extends Component{constructor(e){super(e),new IntersectionObserver((([e])=>{e.intersectionRatio>0&&!this.rendered?this.inViewCallback():this.outOfViewCallback()})).observe(this),this.registerAttribute("unrender",!1)}async connectedCallback(){await this.renderSkelton(),await isInView(this)&&await this.inViewCallback()}async inViewCallback(){await this.render()}async outOfViewCallback(){this.unrender&&await this.renderSkelton()}async renderSkelton(){this.shadowRoot.innerHTML=`<link rel="stylesheet" href="${Component.pathToKempo}/kempo-styles.css" />${this.skeletonTemplate}<style>${this.shadowStyles}</style>`,this.rendered=!1}get skeletonTemplate(){return'<div style="height: var(--skeleton_height, 1rem)"></div>'}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kempo",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
4
4
  "type": "module",
5
5
  "description": "A web component library",
6
6
  "main": "dist/index.js",
@@ -31,7 +31,7 @@ export default class LazyComponent extends Component {
31
31
  }
32
32
  }
33
33
  async renderSkelton(){
34
- this.shadowRoot.innerHTML = `<link rel="stylesheet" href="../kempo/kempo-vars.css" /><link rel="stylesheet" href="../kempo/kempo-styles.css" />${this.skeletonTemplate}<style>${this.shadowStyles}</style>`;
34
+ this.shadowRoot.innerHTML = `<link rel="stylesheet" href="${Component.pathToKempo}/kempo-styles.css" />${this.skeletonTemplate}<style>${this.shadowStyles}</style>`;
35
35
  this.rendered = false;
36
36
  }
37
37
  get skeletonTemplate(){