cognikit 1.0.0 → 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.
@@ -5,6 +5,7 @@ export declare class InteractionsBaseShell extends HTMLElement {
5
5
  private soundManager;
6
6
  private animationsManager;
7
7
  private $titleEl;
8
+ private $closeBtn;
8
9
  private $promptBtn;
9
10
  private $timerEl;
10
11
  private $headerEl;
@@ -36,6 +37,7 @@ export declare class InteractionsBaseShell extends HTMLElement {
36
37
  attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
37
38
  setInteraction<T extends InteractionData>(interaction: BaseInteraction<T>): void;
38
39
  removeInteraction(): void;
40
+ setCloseBtnVisible(visible: boolean, handler?: () => void): void;
39
41
  private setupShellListeners;
40
42
  private setupInteractionListeners;
41
43
  private removeInteractionListeners;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cognikit",
3
- "version": "1.0.0",
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
@@ -13318,6 +13318,12 @@ registerBuiltInInteractions();
13318
13318
  // src/shell/simple-shell/index.html
13319
13319
  var simple_shell_default = `<header part='header'>
13320
13320
  <div class="prompt-container">
13321
+ <button class="close-btn btn" title="Close Fullscreen" part="close-part" style="display: none;">
13322
+ <svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
13323
+ <path d="M18 6 6 18" />
13324
+ <path d="m6 6 12 12" />
13325
+ </svg>
13326
+ </button>
13321
13327
  <button class="prompt-btn btn" title="See Prompt Data" part="see-prompt">
13322
13328
  <svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
13323
13329
  <path d="M12 3c4.97 0 9 1.79 9 4s-4.03 4-9 4-9-1.79-9-4 4.03-4 9-4Z"/>
@@ -13426,6 +13432,7 @@ var InteractionsBaseShell = class extends HTMLElement {
13426
13432
  this.$headerEl = wrap.querySelector("header");
13427
13433
  this.$footerEl = wrap.querySelector("footer");
13428
13434
  this.$titleEl = wrap.querySelector(".title");
13435
+ this.$closeBtn = wrap.querySelector(".close-btn");
13429
13436
  this.$promptBtn = wrap.querySelector(".prompt-btn");
13430
13437
  this.$timerEl = wrap.querySelector(".timer");
13431
13438
  this.$checkBtn = wrap.querySelector(".check-btn");
@@ -13454,7 +13461,6 @@ var InteractionsBaseShell = class extends HTMLElement {
13454
13461
  if (!this.hasAttribute("show-footer")) this.setAttribute("show-footer", "true");
13455
13462
  this.updateVisibility();
13456
13463
  this.animationsManager.animate(this.$progressIcon, "heartbeat");
13457
- this.animationsManager.animate(this.$promptBtn, "wobble");
13458
13464
  }
13459
13465
  disconnectedCallback() {
13460
13466
  this.stopTimer();
@@ -13528,6 +13534,15 @@ var InteractionsBaseShell = class extends HTMLElement {
13528
13534
  this.interactionComplete = false;
13529
13535
  }
13530
13536
  }
13537
+ setCloseBtnVisible(visible, handler) {
13538
+ if (!visible) {
13539
+ this.$closeBtn.style.display = "none";
13540
+ this.$closeBtn.onclick = null;
13541
+ return;
13542
+ }
13543
+ this.$closeBtn.style.display = "block";
13544
+ this.$closeBtn.onclick = handler;
13545
+ }
13531
13546
  // ==================== EVENT LISTENERS ====================
13532
13547
  setupShellListeners() {
13533
13548
  this.$checkBtn.addEventListener("click", () => {