cognikit 1.0.1 → 1.0.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.
@@ -37,7 +37,7 @@ export declare class InteractionsBaseShell extends HTMLElement {
37
37
  attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
38
38
  setInteraction<T extends InteractionData>(interaction: BaseInteraction<T>): void;
39
39
  removeInteraction(): void;
40
- toggleCloseBtn(handler: () => void): void;
40
+ setCloseBtnVisible(visible: boolean, handler?: () => void): void;
41
41
  private setupShellListeners;
42
42
  private setupInteractionListeners;
43
43
  private removeInteractionListeners;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cognikit",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "author": "Yahir Adolfo de los Santos Beras",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/YerCodeWorld/cognikit.git",
package/public/app.js CHANGED
@@ -13534,14 +13534,14 @@ var InteractionsBaseShell = class extends HTMLElement {
13534
13534
  this.interactionComplete = false;
13535
13535
  }
13536
13536
  }
13537
- toggleCloseBtn(handler) {
13538
- if (this.$closeBtn.style.display === "none") {
13539
- this.$closeBtn.style.display = "block";
13540
- this.$closeBtn.addEventListener("click", handler);
13537
+ setCloseBtnVisible(visible, handler) {
13538
+ if (!visible) {
13539
+ this.$closeBtn.style.display = "none";
13540
+ this.$closeBtn.onclick = null;
13541
13541
  return;
13542
13542
  }
13543
- this.$closeBtn.removeEventListener("click", handler);
13544
- this.$closeBtn.style.display = "none";
13543
+ this.$closeBtn.style.display = "block";
13544
+ this.$closeBtn.onclick = handler;
13545
13545
  }
13546
13546
  // ==================== EVENT LISTENERS ====================
13547
13547
  setupShellListeners() {