maverick-wave 3.7.0 → 3.10.0

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
- !function(){"use strict";function e(){document.querySelectorAll(".color-swatch").forEach(e=>{const t=function(e){if(!e||"transparent"===e)return"#000000";const t=e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,"0"),c=e.match(/color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+))?\)/);if(c){const e="#"+t(255*c[1])+t(255*c[2])+t(255*c[3]),o=void 0===c[4]?1:parseFloat(c[4]);return(o<1?`${e} / ${o}`:e).toUpperCase()}const o=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);if(!o)return e;const n="#"+t(o[1])+t(o[2])+t(o[3]),s=void 0===o[4]?1:parseFloat(o[4]);return(s<1?`${n} / ${s}`:n).toUpperCase()}(window.getComputedStyle(e).backgroundColor),c=e.parentElement.querySelector(".mw-text-muted");c&&(c.textContent=t)})}document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(".mw-gallery").forEach(e=>{const t=e.closest(".mw-gallery-container")||e.parentElement;t&&function(e,t){const c=t.querySelector(".mw-gallery-track");if(!c||!c.children.length)return;const o=c.children,n=e.querySelector(".mw-gallery-dots"),s=e.querySelector(".mw-gallery-desc"),l=t.querySelector(".mw-gallery-navi-prev"),r=t.querySelector(".mw-gallery-navi-next");let a=0;function i(e){const t=o.length;a=(e+t)%t,c.style.transform=`translateX(-${100*a}%)`,n&&n.querySelectorAll(".mw-gallery-dot").forEach((e,t)=>{e.classList.toggle("mw-active",t===a)}),s&&(s.textContent=o[a].dataset.desc||"")}if(n)for(let e=0;e<o.length;e++){const t=document.createElement("span");t.className="mw-gallery-dot"+(0===e?" mw-active":""),t.addEventListener("click",()=>i(e)),n.appendChild(t)}l&&l.addEventListener("click",()=>i(a-1)),r&&r.addEventListener("click",()=>i(a+1));let d=0;c.addEventListener("touchstart",e=>d=e.touches[0].clientX),c.addEventListener("touchend",e=>{const t=e.changedTouches[0].clientX-d;t>50&&i(a-1),t<-50&&i(a+1)}),i(0)}(t,e)}),function(){const t=document.querySelector(".mw-theme-toggle");if(!t)return;const c=document.body,o=t.querySelector(".mw-theme-toggle-slider i"),n=getComputedStyle(document.documentElement).getPropertyValue("--mw-internal-theme-mode").trim()||"switchable";if("switchable"!==n)return console.log(`Theme mode fixed to: ${n}. Disabling toggle.`),o&&(o.className="light"===n?"fas fa-sun":"fas fa-moon"),"light"===n?t.classList.add("active"):t.classList.remove("active"),t.style.opacity="0.4",t.style.pointerEvents="none",t.style.cursor="default",t.setAttribute("aria-disabled","true"),localStorage.removeItem("mw-theme"),void("dark"===n&&c.classList.remove("mw-theme-light"));let s="light"===localStorage.getItem("mw-theme");const l=e=>{c.classList.toggle("mw-theme-light",e),t.classList.toggle("active",e),o&&(o.className=e?"fas fa-sun":"fas fa-moon")};l(s),t.addEventListener("click",()=>{s=!s,l(s),localStorage.setItem("mw-theme",s?"light":"dark"),setTimeout(e,400)})}(),e(),document.querySelectorAll(".mw-accordion-header").forEach(e=>{e.addEventListener("click",function(){this.classList.toggle("active");const e=this.nextElementSibling;e&&e.classList.toggle("active")})}),function(){const e=document.querySelector(".mw-menu-btn"),t=document.querySelector(".mw-navbar");if(!e||!t)return;function c(){e.classList.remove("open"),t.classList.remove("open")}function o(c){c.preventDefault(),c.stopPropagation(),e.classList.toggle("open"),t.classList.toggle("open")}e.addEventListener("click",o),e.addEventListener("touchstart",o,{passive:!1}),document.addEventListener("click",function(o){t.classList.contains("open")&&(t.contains(o.target)||e.contains(o.target)||c())}),document.addEventListener("keydown",function(e){"Escape"===e.key&&c()})}(),function(){const e=document.querySelectorAll(".mw-progress-fill");if(!e.length)return;const t=new IntersectionObserver((e,t)=>{e.forEach(e=>{if(!e.isIntersecting)return;const c=e.target,o=c.dataset.value||0;c.style.width=o+"%",t.unobserve(c)})},{root:null,threshold:.2});e.forEach(e=>t.observe(e))}(),document.querySelectorAll('a[href^="#"]').forEach(e=>{e.addEventListener("click",function(e){const t=this.getAttribute("href");if("#"===t)return;if(!document.querySelector(t))return;const c=document.querySelector(".mw-menu-btn"),o=document.querySelector(".mw-navbar");c&&o&&(c.classList.remove("open"),o.classList.remove("open"))})}),function(){const e=document.querySelectorAll("section[id]"),t=document.querySelectorAll(".mw-navbar-link");if(0===e.length||0===t.length)return;window.addEventListener("scroll",function(e,t){let c;return function(){const o=this,n=arguments;clearTimeout(c),c=setTimeout(()=>e.apply(o,n),t)}}(function(){let c="";e.forEach(e=>{const t=e.offsetTop-100,o=e.clientHeight;scrollY>=t&&scrollY<t+o&&(c=e.getAttribute("id"))}),t.forEach(e=>{e.classList.remove("active");const t=e.getAttribute("href");if(t){const o=t.indexOf("#");if(-1!==o){t.substring(o+1)===c&&e.classList.add("active")}}})},100))}(),document.querySelectorAll(".mw-tabs-nav-item").forEach(e=>{e.addEventListener("click",function(){const e=this.closest(".mw-tabs");if(!e)return;e.querySelectorAll(".mw-tabs-nav-item").forEach(e=>{e.classList.remove("active")}),this.classList.add("active");const t=this.getAttribute("data-tab");if(!t)return;e.querySelectorAll(".mw-tabs-panel").forEach(e=>{e.classList.remove("active")});const c=document.getElementById(t);c&&c.classList.add("active")})}),document.querySelectorAll(".mw-alert-close").forEach(e=>{e.addEventListener("click",function(){const e=this.closest(".mw-alert");e&&(e.classList.add("mw-alert-closing"),setTimeout(()=>{e.classList.add("mw-alert-closed")},300))})}),function(){const e=document.querySelector(".mw-localhost-indicator-activated"),t=document.querySelector(".mw-header");if(e){if("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname||window.location.hostname.includes("192.168.")){const e=document.createElement("div");e.className="mw-localhost-indicator-pulse",t.prepend(e)}}}(),document.querySelectorAll(".mw-slider-container").forEach(e=>{const t=e.querySelector(".mw-slider"),c=e.querySelector(".mw-slider-value");if(!t||!c)return;const o=()=>{const e=Number(t.value),o=Number(t.max)||100,n=Math.round(e/o*100);t.style.setProperty("--value",n+"%"),c.classList.contains("mw-slider-numeric")?c.setAttribute("data-value",e):c.setAttribute("data-value",n)};t.addEventListener("input",o),o()}),document.querySelectorAll(".mw-modal-close").forEach(e=>{e.addEventListener("click",function(){const e=this.closest(".mw-modal-overlay");e&&e.classList.remove("mw-modal-open")})}),function(){const e=document.getElementById("login-button");e&&e.addEventListener("click",function(){const e=this.querySelector("i");e.classList.contains("fa-lock")?(e.classList.remove("fa-lock"),e.classList.add("fa-lock-open")):(e.classList.remove("fa-lock-open"),e.classList.add("fa-lock"))})}(),document.querySelectorAll(".mw-image-slider").forEach(e=>{const t=e.querySelectorAll(".mw-image-slider-overlay-image"),c=e.querySelectorAll("button[data-index]");if(!t.length||!c.length)return;let o=0;function n(){t.forEach(e=>{const t=parseInt(e.dataset.index);e.classList.toggle("active",t===o)}),c.forEach(e=>{const t=parseInt(e.dataset.index);e.classList.toggle("active",t===o)})}function s(e){o=e,n()}c.forEach(e=>{e.addEventListener("click",()=>{s(parseInt(e.dataset.index))})}),n()}),document.querySelectorAll(".mw-item-list-checkbox, .mw-item-list-checkbox-scroll").forEach(e=>{e.querySelectorAll("li").forEach(e=>{const t=e.querySelector('input[type="checkbox"]'),c=e.querySelector(".mw-checkbox");t&&c&&(t.checked&&e.classList.add("mw-selected"),e.addEventListener("click",function(e){e.target!==t&&e.target.closest(".mw-checkbox")!==c&&toggleCheckbox(this)}),t.addEventListener("change",function(){const e=this.closest("li");this.checked?e.classList.add("mw-selected"):e.classList.remove("mw-selected"),e.dispatchEvent(new CustomEvent("checkboxToggle",{detail:{checked:this.checked,item:e}}))}),c.addEventListener("click",function(e){setTimeout(()=>{const e=this.closest("li");this.querySelector('input[type="checkbox"]').checked?e.classList.add("mw-selected"):e.classList.remove("mw-selected")},0)}))})}),document.addEventListener("checkboxToggle",function(e){console.log("Checkbox toggled:",e.detail.checked,e.detail.item)})}),window.toggleCheckbox=function(e){const t=e.querySelector('input[type="checkbox"]');if(!t)return;const c=t.checked;t.checked=!c,t.checked?e.classList.add("mw-selected"):e.classList.remove("mw-selected"),e.dispatchEvent(new CustomEvent("checkboxToggle",{detail:{checked:t.checked,item:e}}))}}();
1
+ !function(){"use strict";function e(){document.querySelectorAll(".color-swatch").forEach(e=>{const t=function(e){if(!e||"transparent"===e)return"#000000";const t=e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,"0"),n=e.match(/color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+))?\)/);if(n){const e="#"+t(255*n[1])+t(255*n[2])+t(255*n[3]),c=void 0===n[4]?1:parseFloat(n[4]);return(c<1?`${e} / ${c}`:e).toUpperCase()}const c=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);if(!c)return e;const o="#"+t(c[1])+t(c[2])+t(c[3]),a=void 0===c[4]?1:parseFloat(c[4]);return(a<1?`${o} / ${a}`:o).toUpperCase()}(window.getComputedStyle(e).backgroundColor),n=e.parentElement.querySelector(".mw-text-muted");n&&(n.textContent=t)})}function t(e){const t=Array.from(e.querySelectorAll(".mw-kanban-column")),n=e.querySelector(".mw-kanban-composer"),c=e.querySelector(".mw-kanban-card-template"),o=e.dataset.kanbanPrefix||"MW",a=n.querySelector(".mw-kanban-composer-title"),r=n.querySelector(".mw-kanban-composer-text"),s=n.querySelector(".mw-kanban-composer-priority"),l=n.querySelector(".mw-kanban-composer-assignee");let i=null;function d(){t.forEach(function(e,n){const c=e.querySelectorAll(".mw-kanban-card"),o=e.querySelector(".mw-kanban-count");o&&(o.textContent=c.length),e.querySelectorAll("[data-kanban-move]").forEach(function(e){const c=n+parseInt(e.dataset.kanbanMove,10);e.disabled=c<0||c>=t.length})})}function u(e,t){const n=e.querySelector(t);return n?n.textContent.replace(/\s+/g," ").trim():""}function m(e,t){f(),i=t||null,a.value=t?u(t,".mw-kanban-card-title"):"",r.value=t?u(t,".mw-kanban-card-text"):"",s.value=t?function(e){const t=e.querySelector(".mw-card-ribbon");if(!t)return"";const n=Array.from(t.classList).find(function(e){return 0===e.indexOf("mw-card-addon-")});return n?n.replace("mw-card-addon-",""):""}(t):"",l.value=t?function(e){const t=e.querySelector(".mw-avatar-initials");return t?t.textContent.trim():""}(t):"",t?(t.classList.add("mw-kanban-editing"),t.before(n)):e.querySelector(".mw-kanban-column-body").prepend(n),n.classList.add("mw-active"),a.focus()}function f(){n.classList.remove("mw-active"),i&&i.classList.remove("mw-kanban-editing"),i=null}function h(){const t=a.value.trim();if(!t)return void a.focus();const u=i||c.content.firstElementChild.cloneNode(!0);if(u.querySelector(".mw-kanban-card-title").textContent=t,u.querySelector(".mw-kanban-card-text").textContent=r.value.trim(),function(e,t){const n=e.querySelector(".mw-card-ribbon");if(n&&n.remove(),!t||!t.value)return;const c=document.createElement("div");c.className="mw-card-ribbon mw-card-addon-"+t.value,c.textContent=t.textContent,e.prepend(c)}(u,s.selectedOptions[0]),function(e,t){const n=e.querySelector(".mw-kanban-card-actions"),c=n.querySelector(".mw-avatar");if(!t)return void(c&&c.remove());const o=c||document.createElement("div");o.className="mw-avatar mw-avatar-xs mw-avatar-initials",o.textContent=t,c||n.prepend(o)}(u,l.value),!i){const t=function(){const t=Array.from(e.querySelectorAll(".mw-kanban-card-id")).map(function(e){return parseInt(e.textContent.split("-").pop(),10)||0});return o+"-"+(Math.max(0,...t)+1)}();u.classList.add("mw-kanban-card-in"),u.querySelector(".mw-kanban-card-id").textContent=t,u.querySelectorAll("[aria-label]").forEach(function(e){e.setAttribute("aria-label",e.getAttribute("aria-label").replace(/[A-Z]+-\d+/,t))}),n.before(u)}f(),d()}e.addEventListener("click",function(e){const n=e.target.closest("[data-kanban-move]");if(n){if(function(e,n){const c=e.closest(".mw-kanban-column"),o=t[t.indexOf(c)+n];o&&(o.querySelector(".mw-kanban-column-body").appendChild(e),d())}(n.closest(".mw-kanban-card"),parseInt(n.dataset.kanbanMove,10)),n.disabled){const e=n.parentElement.querySelector("[data-kanban-move]:not(:disabled)");e&&e.focus()}return}const c=e.target.closest(".mw-kanban-edit");if(c){const e=c.closest(".mw-kanban-card");return void m(e.closest(".mw-kanban-column"),e)}const o=e.target.closest(".mw-kanban-delete");if(o){const e=o.closest(".mw-kanban-card");return e===i&&f(),e.remove(),void d()}const a=e.target.closest(".mw-kanban-add");a?m(a.closest(".mw-kanban-column"),null):e.target.closest(".mw-kanban-composer-cancel")&&f()}),n.addEventListener("submit",function(e){e.preventDefault(),h()}),n.addEventListener("keydown",function(e){"Escape"===e.key&&f()}),d()}document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(".mw-gallery").forEach(e=>{const t=e.closest(".mw-gallery-container")||e.parentElement;t&&function(e,t){const n=t.querySelector(".mw-gallery-track");if(!n||!n.children.length)return;const c=n.children,o=e.querySelector(".mw-gallery-dots"),a=e.querySelector(".mw-gallery-desc"),r=t.querySelector(".mw-gallery-navi-prev"),s=t.querySelector(".mw-gallery-navi-next");let l=0;function i(e){const t=c.length;l=(e+t)%t,n.style.transform=`translateX(-${100*l}%)`,o&&o.querySelectorAll(".mw-gallery-dot").forEach((e,t)=>{e.classList.toggle("mw-active",t===l)}),a&&(a.textContent=c[l].dataset.desc||"")}if(o)for(let e=0;e<c.length;e++){const t=document.createElement("span");t.className="mw-gallery-dot"+(0===e?" mw-active":""),t.addEventListener("click",()=>i(e)),o.appendChild(t)}r&&r.addEventListener("click",()=>i(l-1)),s&&s.addEventListener("click",()=>i(l+1));let d=0;n.addEventListener("touchstart",e=>d=e.touches[0].clientX),n.addEventListener("touchend",e=>{const t=e.changedTouches[0].clientX-d;t>50&&i(l-1),t<-50&&i(l+1)}),i(0)}(t,e)}),function(){const t=document.querySelector(".mw-theme-toggle");if(!t)return;const n=document.body,c=t.querySelector(".mw-theme-toggle-slider i"),o=getComputedStyle(document.documentElement).getPropertyValue("--mw-internal-theme-mode").trim()||"switchable";if("switchable"!==o)return console.log(`Theme mode fixed to: ${o}. Disabling toggle.`),c&&(c.className="light"===o?"fas fa-sun":"fas fa-moon"),"light"===o?t.classList.add("active"):t.classList.remove("active"),t.style.opacity="0.4",t.style.pointerEvents="none",t.style.cursor="default",t.setAttribute("aria-disabled","true"),localStorage.removeItem("mw-theme"),void("dark"===o&&n.classList.remove("mw-theme-light"));let a="light"===localStorage.getItem("mw-theme");const r=e=>{n.classList.toggle("mw-theme-light",e),t.classList.toggle("active",e),c&&(c.className=e?"fas fa-sun":"fas fa-moon")};r(a),t.addEventListener("click",()=>{a=!a,r(a),localStorage.setItem("mw-theme",a?"light":"dark"),setTimeout(e,400)})}(),e(),document.querySelectorAll(".mw-accordion-header").forEach(e=>{e.addEventListener("click",function(){this.classList.toggle("active");const e=this.nextElementSibling;e&&e.classList.toggle("active")})}),function(){const e=document.querySelector(".mw-menu-btn"),t=document.querySelector(".mw-navbar");if(!e||!t)return;function n(){e.classList.remove("open"),t.classList.remove("open")}function c(n){n.preventDefault(),n.stopPropagation(),e.classList.toggle("open"),t.classList.toggle("open")}e.addEventListener("click",c),e.addEventListener("touchstart",c,{passive:!1}),document.addEventListener("click",function(c){t.classList.contains("open")&&(t.contains(c.target)||e.contains(c.target)||n())}),document.addEventListener("keydown",function(e){"Escape"===e.key&&n()})}(),function(){const e=document.querySelectorAll(".mw-progress-fill");if(!e.length)return;const t=new IntersectionObserver((e,t)=>{e.forEach(e=>{if(!e.isIntersecting)return;const n=e.target,c=n.dataset.value||0;n.style.width=c+"%",t.unobserve(n)})},{root:null,threshold:.2});e.forEach(e=>t.observe(e))}(),document.querySelectorAll('a[href^="#"]').forEach(e=>{e.addEventListener("click",function(e){const t=this.getAttribute("href");if("#"===t)return;if(!document.querySelector(t))return;const n=document.querySelector(".mw-menu-btn"),c=document.querySelector(".mw-navbar");n&&c&&(n.classList.remove("open"),c.classList.remove("open"))})}),function(){const e=document.querySelectorAll("section[id]"),t=document.querySelectorAll(".mw-navbar-link");if(0===e.length||0===t.length)return;window.addEventListener("scroll",function(e,t){let n;return function(){const c=this,o=arguments;clearTimeout(n),n=setTimeout(()=>e.apply(c,o),t)}}(function(){let n="";e.forEach(e=>{const t=e.offsetTop-100,c=e.clientHeight;scrollY>=t&&scrollY<t+c&&(n=e.getAttribute("id"))}),t.forEach(e=>{e.classList.remove("active");const t=e.getAttribute("href");if(t){const c=t.indexOf("#");if(-1!==c){t.substring(c+1)===n&&e.classList.add("active")}}})},100))}(),document.querySelectorAll(".mw-tabs-nav-item").forEach(e=>{e.addEventListener("click",function(){const e=this.closest(".mw-tabs");if(!e)return;e.querySelectorAll(".mw-tabs-nav-item").forEach(e=>{e.classList.remove("active")}),this.classList.add("active");const t=this.getAttribute("data-tab");if(!t)return;e.querySelectorAll(".mw-tabs-panel").forEach(e=>{e.classList.remove("active")});const n=document.getElementById(t);n&&n.classList.add("active")})}),document.querySelectorAll(".mw-alert-close").forEach(e=>{e.addEventListener("click",function(){const e=this.closest(".mw-alert");e&&(e.classList.add("mw-alert-closing"),setTimeout(()=>{e.classList.add("mw-alert-closed")},300))})}),function(){const e=document.querySelector(".mw-localhost-indicator-activated"),t=document.querySelector(".mw-header");if(e){if("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname||window.location.hostname.includes("192.168.")){const e=document.createElement("div");e.className="mw-localhost-indicator-pulse",t.prepend(e)}}}(),document.querySelectorAll(".mw-slider-container").forEach(e=>{const t=e.querySelector(".mw-slider"),n=e.querySelector(".mw-slider-value");if(!t||!n)return;const c=()=>{const e=Number(t.value),c=Number(t.max)||100,o=Math.round(e/c*100);t.style.setProperty("--value",o+"%"),n.classList.contains("mw-slider-numeric")?n.setAttribute("data-value",e):n.setAttribute("data-value",o)};t.addEventListener("input",c),c()}),document.querySelectorAll(".mw-modal-close").forEach(e=>{e.addEventListener("click",function(){const e=this.closest(".mw-modal-overlay");e&&e.classList.remove("mw-modal-open")})}),function(){const e=document.getElementById("login-button");e&&e.addEventListener("click",function(){const e=this.querySelector("i");e.classList.contains("fa-lock")?(e.classList.remove("fa-lock"),e.classList.add("fa-lock-open")):(e.classList.remove("fa-lock-open"),e.classList.add("fa-lock"))})}(),document.querySelectorAll(".mw-image-slider").forEach(e=>{const t=e.querySelectorAll(".mw-image-slider-overlay-image"),n=e.querySelectorAll("button[data-index]");if(!t.length||!n.length)return;let c=0;function o(){t.forEach(e=>{const t=parseInt(e.dataset.index);e.classList.toggle("active",t===c)}),n.forEach(e=>{const t=parseInt(e.dataset.index);e.classList.toggle("active",t===c)})}function a(e){c=e,o()}n.forEach(e=>{e.addEventListener("click",()=>{a(parseInt(e.dataset.index))})}),o()}),document.querySelectorAll(".mw-item-list-checkbox, .mw-item-list-checkbox-scroll").forEach(e=>{e.querySelectorAll("li").forEach(e=>{const t=e.querySelector('input[type="checkbox"]'),n=e.querySelector(".mw-checkbox");t&&n&&(t.checked&&e.classList.add("mw-selected"),e.addEventListener("click",function(e){e.target!==t&&e.target.closest(".mw-checkbox")!==n&&toggleCheckbox(this)}),t.addEventListener("change",function(){const e=this.closest("li");this.checked?e.classList.add("mw-selected"):e.classList.remove("mw-selected"),e.dispatchEvent(new CustomEvent("checkboxToggle",{detail:{checked:this.checked,item:e}}))}),n.addEventListener("click",function(e){setTimeout(()=>{const e=this.closest("li");this.querySelector('input[type="checkbox"]').checked?e.classList.add("mw-selected"):e.classList.remove("mw-selected")},0)}))})}),document.addEventListener("checkboxToggle",function(e){console.log("Checkbox toggled:",e.detail.checked,e.detail.item)}),document.querySelectorAll(".mw-kanban").forEach(t)}),window.toggleCheckbox=function(e){const t=e.querySelector('input[type="checkbox"]');if(!t)return;const n=t.checked;t.checked=!n,t.checked?e.classList.add("mw-selected"):e.classList.remove("mw-selected"),e.dispatchEvent(new CustomEvent("checkboxToggle",{detail:{checked:t.checked,item:e}}))}}();
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "maverick-wave",
3
- "version": "3.7.0",
3
+ "version": "3.10.0",
4
4
  "config": {
5
- "version_short": "3.7"
5
+ "version_short": "3.10"
6
6
  },
7
7
  "description": "A lightweight, modern CSS framework for building responsive websites with elegance and speed.",
8
8
  "main": "src/js/main.js",
package/src/js/main.js CHANGED
@@ -20,6 +20,7 @@
20
20
  initHeaderLoginButton();
21
21
  initImageSliders();
22
22
  initCheckboxLists();
23
+ initKanbanBoards();
23
24
  });
24
25
 
25
26
  // ===== Checkbox Lists =====
@@ -625,4 +626,219 @@
625
626
  updateSliderView();
626
627
  });
627
628
  }
629
+
630
+ // ===== Kanban Boards =====
631
+ function initKanbanBoards() {
632
+ document.querySelectorAll('.mw-kanban').forEach(initKanbanBoard);
633
+ }
634
+
635
+ function initKanbanBoard(board) {
636
+ const columns = Array.from(board.querySelectorAll('.mw-kanban-column'));
637
+ const composer = board.querySelector('.mw-kanban-composer');
638
+ const template = board.querySelector('.mw-kanban-card-template');
639
+ const ticketPrefix = board.dataset.kanbanPrefix || 'MW';
640
+ const titleField = composer.querySelector('.mw-kanban-composer-title');
641
+ const textField = composer.querySelector('.mw-kanban-composer-text');
642
+ const priorityField = composer.querySelector(
643
+ '.mw-kanban-composer-priority'
644
+ );
645
+ const assigneeField = composer.querySelector(
646
+ '.mw-kanban-composer-assignee'
647
+ );
648
+
649
+ let editing = null;
650
+
651
+ function refresh() {
652
+ columns.forEach(function (column, index) {
653
+ const cards = column.querySelectorAll('.mw-kanban-card');
654
+ const counter = column.querySelector('.mw-kanban-count');
655
+ if (counter) counter.textContent = cards.length;
656
+
657
+ column
658
+ .querySelectorAll('[data-kanban-move]')
659
+ .forEach(function (button) {
660
+ const target = index + parseInt(button.dataset.kanbanMove, 10);
661
+ button.disabled = target < 0 || target >= columns.length;
662
+ });
663
+ });
664
+ }
665
+
666
+ function nextTicketId() {
667
+ const numbers = Array.from(
668
+ board.querySelectorAll('.mw-kanban-card-id')
669
+ ).map(function (element) {
670
+ return parseInt(element.textContent.split('-').pop(), 10) || 0;
671
+ });
672
+
673
+ return ticketPrefix + '-' + (Math.max(0, ...numbers) + 1);
674
+ }
675
+
676
+ function cardRibbonTone(card) {
677
+ const ribbon = card.querySelector('.mw-card-ribbon');
678
+ if (!ribbon) return '';
679
+
680
+ const tone = Array.from(ribbon.classList).find(function (name) {
681
+ return name.indexOf('mw-card-addon-') === 0;
682
+ });
683
+
684
+ return tone ? tone.replace('mw-card-addon-', '') : '';
685
+ }
686
+
687
+ function setPriority(card, option) {
688
+ const current = card.querySelector('.mw-card-ribbon');
689
+ if (current) current.remove();
690
+ if (!option || !option.value) return;
691
+
692
+ const ribbon = document.createElement('div');
693
+ ribbon.className = 'mw-card-ribbon mw-card-addon-' + option.value;
694
+ ribbon.textContent = option.textContent;
695
+ card.prepend(ribbon);
696
+ }
697
+
698
+ function cardAssignee(card) {
699
+ const avatar = card.querySelector('.mw-avatar-initials');
700
+ return avatar ? avatar.textContent.trim() : '';
701
+ }
702
+
703
+ function cardText(card, selector) {
704
+ const element = card.querySelector(selector);
705
+ return element ? element.textContent.replace(/\s+/g, ' ').trim() : '';
706
+ }
707
+
708
+ function setAssignee(card, initials) {
709
+ const actions = card.querySelector('.mw-kanban-card-actions');
710
+ const current = actions.querySelector('.mw-avatar');
711
+
712
+ if (!initials) {
713
+ if (current) current.remove();
714
+ return;
715
+ }
716
+
717
+ const avatar = current || document.createElement('div');
718
+ avatar.className = 'mw-avatar mw-avatar-xs mw-avatar-initials';
719
+ avatar.textContent = initials;
720
+ if (!current) actions.prepend(avatar);
721
+ }
722
+
723
+ function openComposer(column, card) {
724
+ closeComposer();
725
+ editing = card || null;
726
+
727
+ titleField.value = card ? cardText(card, '.mw-kanban-card-title') : '';
728
+ textField.value = card ? cardText(card, '.mw-kanban-card-text') : '';
729
+ priorityField.value = card ? cardRibbonTone(card) : '';
730
+ assigneeField.value = card ? cardAssignee(card) : '';
731
+
732
+ if (card) {
733
+ card.classList.add('mw-kanban-editing');
734
+ card.before(composer);
735
+ } else {
736
+ column.querySelector('.mw-kanban-column-body').prepend(composer);
737
+ }
738
+
739
+ composer.classList.add('mw-active');
740
+ titleField.focus();
741
+ }
742
+
743
+ function closeComposer() {
744
+ composer.classList.remove('mw-active');
745
+ if (editing) editing.classList.remove('mw-kanban-editing');
746
+ editing = null;
747
+ }
748
+
749
+ function saveComposer() {
750
+ const title = titleField.value.trim();
751
+ if (!title) {
752
+ titleField.focus();
753
+ return;
754
+ }
755
+
756
+ const card =
757
+ editing || template.content.firstElementChild.cloneNode(true);
758
+ card.querySelector('.mw-kanban-card-title').textContent = title;
759
+ card.querySelector('.mw-kanban-card-text').textContent =
760
+ textField.value.trim();
761
+ setPriority(card, priorityField.selectedOptions[0]);
762
+ setAssignee(card, assigneeField.value);
763
+
764
+ if (!editing) {
765
+ const ticketId = nextTicketId();
766
+ card.classList.add('mw-kanban-card-in');
767
+ card.querySelector('.mw-kanban-card-id').textContent = ticketId;
768
+ // The template labels carry a placeholder key - swap in the real one
769
+ card.querySelectorAll('[aria-label]').forEach(function (button) {
770
+ button.setAttribute(
771
+ 'aria-label',
772
+ button.getAttribute('aria-label').replace(/[A-Z]+-\d+/, ticketId)
773
+ );
774
+ });
775
+ composer.before(card);
776
+ }
777
+
778
+ closeComposer();
779
+ refresh();
780
+ }
781
+
782
+ function moveCard(card, offset) {
783
+ const current = card.closest('.mw-kanban-column');
784
+ const target = columns[columns.indexOf(current) + offset];
785
+ if (!target) return;
786
+
787
+ target.querySelector('.mw-kanban-column-body').appendChild(card);
788
+ refresh();
789
+ }
790
+
791
+ board.addEventListener('click', function (event) {
792
+ const moveButton = event.target.closest('[data-kanban-move]');
793
+ if (moveButton) {
794
+ moveCard(
795
+ moveButton.closest('.mw-kanban-card'),
796
+ parseInt(moveButton.dataset.kanbanMove, 10)
797
+ );
798
+
799
+ if (moveButton.disabled) {
800
+ const sibling = moveButton.parentElement.querySelector(
801
+ '[data-kanban-move]:not(:disabled)'
802
+ );
803
+ if (sibling) sibling.focus();
804
+ }
805
+ return;
806
+ }
807
+
808
+ const editButton = event.target.closest('.mw-kanban-edit');
809
+ if (editButton) {
810
+ const card = editButton.closest('.mw-kanban-card');
811
+ openComposer(card.closest('.mw-kanban-column'), card);
812
+ return;
813
+ }
814
+
815
+ const deleteButton = event.target.closest('.mw-kanban-delete');
816
+ if (deleteButton) {
817
+ const card = deleteButton.closest('.mw-kanban-card');
818
+ if (card === editing) closeComposer();
819
+ card.remove();
820
+ refresh();
821
+ return;
822
+ }
823
+
824
+ const addButton = event.target.closest('.mw-kanban-add');
825
+ if (addButton) {
826
+ openComposer(addButton.closest('.mw-kanban-column'), null);
827
+ return;
828
+ }
829
+
830
+ if (event.target.closest('.mw-kanban-composer-cancel')) closeComposer();
831
+ });
832
+
833
+ composer.addEventListener('submit', function (event) {
834
+ event.preventDefault();
835
+ saveComposer();
836
+ });
837
+
838
+ composer.addEventListener('keydown', function (event) {
839
+ if (event.key === 'Escape') closeComposer();
840
+ });
841
+
842
+ refresh();
843
+ }
628
844
  })();
@@ -141,6 +141,9 @@
141
141
  <li>
142
142
  <a href="#tables">Tables</a>
143
143
  </li>
144
+ <li>
145
+ <a href="#kanban">Kanban</a>
146
+ </li>
144
147
  <li>
145
148
  <a href="#pagination">Pagination</a>
146
149
  </li>