diff --git a/biome.json b/biome.json index fbfbdeb0..853acb90 100644 --- a/biome.json +++ b/biome.json @@ -22,7 +22,9 @@ "starters/**", "test/**", "modules/**/package.json", - "**/assets/jsconfig.json" + "**/assets/jsconfig.json", + "docs-local", + "backups/**" ] }, "formatter": { @@ -52,6 +54,9 @@ "complexity": { "all": false }, "suspicious": { "noEmptyBlock": "off" + }, + "security": { + "noDangerouslySetInnerHtml": "off" } } }, diff --git a/modules/blox-plugin-reveal/assets/js/hugoblox-slides.js b/modules/blox-plugin-reveal/assets/js/hugoblox-slides.js index 5fd30179..e7bd9eee 100644 --- a/modules/blox-plugin-reveal/assets/js/hugoblox-slides.js +++ b/modules/blox-plugin-reveal/assets/js/hugoblox-slides.js @@ -12,13 +12,7 @@ import * as params from "@params"; // Enable core slide features. -var enabledPlugins = [ - RevealMarkdown, - RevealSearch, - RevealNotes, - RevealMath.KaTeX, - RevealZoom, -]; +var enabledPlugins = [RevealMarkdown, RevealSearch, RevealNotes, RevealMath.KaTeX, RevealZoom]; const isObject = function (o) { return o === Object(o) && !isArray(o) && typeof o !== "function"; @@ -97,9 +91,7 @@ if (params.slides.diagram) { // Lazily render Mermaid diagrams within Reveal.JS slides // See: https://github.com/hakimel/reveal.js/issues/2863#issuecomment-1107444425 let renderMermaidDiagrams = function renderMermaidDiagrams(event) { - let mermaidDivs = event.currentSlide.querySelectorAll( - ".mermaid:not(.done)", - ); + let mermaidDivs = event.currentSlide.querySelectorAll(".mermaid:not(.done)"); let indices = Reveal.getIndices(); let pageno = `${indices.h}-${indices.v}`; @@ -109,11 +101,7 @@ if (params.slides.diagram) { mermaidDiv.classList.add("done"); }; let graphDefinition = mermaidDiv.textContent; - mermaid.mermaidAPI.render( - `mermaid${pageno}-${i}`, - graphDefinition, - insertSvg, - ); + mermaid.mermaidAPI.render(`mermaid${pageno}-${i}`, graphDefinition, insertSvg); }); Reveal.layout(); }; diff --git a/modules/blox-tailwind/assets/css/blox/biography.css b/modules/blox-tailwind/assets/css/blox/biography.css index d403a2a5..8fbaef10 100644 --- a/modules/blox-tailwind/assets/css/blox/biography.css +++ b/modules/blox-tailwind/assets/css/blox/biography.css @@ -152,14 +152,12 @@ font-size: 20px; background-color: #fff; color: #000; /* override parent alpha */ - box-shadow: 0 10px 20px rgb(0 0 0 / 4%), 0 2px 6px rgb(0 0 0 / 4%), 0 0 1px - rgb(0 0 0 / 4%); + box-shadow: 0 10px 20px rgb(0 0 0 / 4%), 0 2px 6px rgb(0 0 0 / 4%), 0 0 1px rgb(0 0 0 / 4%); } .dark .avatar-emoji { background-color: #000; - box-shadow: 0 10px 20px rgb(0 0 0 / 4%), 0 2px 6px rgb(0 0 0 / 4%), 0 0 1px - rgb(255 255 255 / 96%); + box-shadow: 0 10px 20px rgb(0 0 0 / 4%), 0 2px 6px rgb(0 0 0 / 4%), 0 0 1px rgb(255 255 255 / 96%); } /* Biography Block */ @@ -184,22 +182,14 @@ /* Light Mode Gradient */ .hbx-bg-gradient::before { - background-image: radial-gradient( - at 20% 25%, - hsla(212, 80%, 95%, 1) 0px, - transparent 50% - ), radial-gradient(at 75% 30%, hsla(160, 80%, 95%, 1) 0px, transparent 50%), - radial-gradient(at 25% 80%, hsla(280, 80%, 95%, 1) 0px, transparent 50%), + background-image: radial-gradient(at 20% 25%, hsla(212, 80%, 95%, 1) 0px, transparent 50%), + radial-gradient(at 75% 30%, hsla(160, 80%, 95%, 1) 0px, transparent 50%), radial-gradient(at 25% 80%, hsla(280, 80%, 95%, 1) 0px, transparent 50%), radial-gradient(at 75% 85%, hsla(30, 80%, 95%, 1) 0px, transparent 50%); } /* Dark Mode Gradient */ .dark .hbx-bg-gradient::before { - background-image: radial-gradient( - at 20% 25%, - hsla(212, 35%, 15%, 1) 0px, - transparent 50% - ), radial-gradient(at 75% 30%, hsla(160, 35%, 15%, 1) 0px, transparent 50%), - radial-gradient(at 25% 80%, hsla(280, 35%, 15%, 1) 0px, transparent 50%), + background-image: radial-gradient(at 20% 25%, hsla(212, 35%, 15%, 1) 0px, transparent 50%), + radial-gradient(at 75% 30%, hsla(160, 35%, 15%, 1) 0px, transparent 50%), radial-gradient(at 25% 80%, hsla(280, 35%, 15%, 1) 0px, transparent 50%), radial-gradient(at 75% 85%, hsla(30, 35%, 15%, 1) 0px, transparent 50%); } diff --git a/modules/blox-tailwind/assets/css/components/cards.css b/modules/blox-tailwind/assets/css/components/cards.css index a5c2abd2..d6d5497e 100644 --- a/modules/blox-tailwind/assets/css/components/cards.css +++ b/modules/blox-tailwind/assets/css/components/cards.css @@ -3,10 +3,7 @@ } .hb-cards { - grid-template-columns: repeat( - auto-fill, - minmax(max(250px, calc((100% - 1rem * 2) / var(--hb-cols))), 1fr) - ); + grid-template-columns: repeat(auto-fill, minmax(max(250px, calc((100% - 1rem * 2) / var(--hb-cols))), 1fr)); } .hb-card { diff --git a/modules/blox-tailwind/assets/css/components/glassmorphism.css b/modules/blox-tailwind/assets/css/components/glassmorphism.css index 9f5adb62..ecfe356a 100644 --- a/modules/blox-tailwind/assets/css/components/glassmorphism.css +++ b/modules/blox-tailwind/assets/css/components/glassmorphism.css @@ -10,12 +10,7 @@ .glassmorphism-primary { @apply relative overflow-hidden; - background: linear-gradient( - 135deg, - rgb(var(--color-primary-500) / 0.9), - rgb(var(--color-primary-600) / 0.95), - rgb(var(--color-primary-700) / 0.9) - ); + background: linear-gradient(135deg, rgb(var(--color-primary-500) / 0.9), rgb(var(--color-primary-600) / 0.95), rgb(var(--color-primary-700) / 0.9)); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); } @@ -23,12 +18,7 @@ .glassmorphism-primary::before { content: ""; @apply absolute inset-0 pointer-events-none; - background: linear-gradient( - 45deg, - rgb(0 0 0 / 0.1), - transparent, - rgb(255 255 255 / 0.1) - ); + background: linear-gradient(45deg, rgb(0 0 0 / 0.1), transparent, rgb(255 255 255 / 0.1)); mix-blend-mode: overlay; } @@ -47,23 +37,13 @@ .glassmorphism-secondary::before { content: ""; @apply absolute inset-0 pointer-events-none; - background: linear-gradient( - 45deg, - rgb(0 0 0 / 0.1), - transparent, - rgb(255 255 255 / 0.1) - ); + background: linear-gradient(45deg, rgb(0 0 0 / 0.1), transparent, rgb(255 255 255 / 0.1)); mix-blend-mode: overlay; } .glassmorphism-dark { @apply relative overflow-hidden; - background: linear-gradient( - 135deg, - rgb(0 0 0 / 0.7), - rgb(31 41 55 / 0.8), - rgb(0 0 0 / 0.9) - ); + background: linear-gradient(135deg, rgb(0 0 0 / 0.7), rgb(31 41 55 / 0.8), rgb(0 0 0 / 0.9)); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); } @@ -71,23 +51,13 @@ .glassmorphism-dark::before { content: ""; @apply absolute inset-0 pointer-events-none; - background: linear-gradient( - 45deg, - rgb(255 255 255 / 0.05), - transparent, - rgb(255 255 255 / 0.1) - ); + background: linear-gradient(45deg, rgb(255 255 255 / 0.05), transparent, rgb(255 255 255 / 0.1)); mix-blend-mode: overlay; } .glassmorphism-light { @apply relative overflow-hidden; - background: linear-gradient( - 135deg, - rgb(255 255 255 / 0.9), - rgb(248 250 252 / 0.95), - rgb(241 245 249 / 0.9) - ); + background: linear-gradient(135deg, rgb(255 255 255 / 0.9), rgb(248 250 252 / 0.95), rgb(241 245 249 / 0.9)); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); } @@ -95,12 +65,7 @@ .glassmorphism-light::before { content: ""; @apply absolute inset-0 pointer-events-none; - background: linear-gradient( - 45deg, - rgb(0 0 0 / 0.02), - transparent, - rgb(255 255 255 / 0.05) - ); + background: linear-gradient(45deg, rgb(0 0 0 / 0.02), transparent, rgb(255 255 255 / 0.05)); mix-blend-mode: overlay; } @@ -136,13 +101,11 @@ } .glass-shadow { - box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25), 0 0 0 1px - rgb(255 255 255 / 0.1), inset 0 1px 0 rgb(255 255 255 / 0.1); + box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25), 0 0 0 1px rgb(255 255 255 / 0.1), inset 0 1px 0 rgb(255 255 255 / 0.1); } .dark .glass-shadow { - box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.5), 0 0 0 1px - rgb(255 255 255 / 0.05), inset 0 1px 0 rgb(255 255 255 / 0.05); + box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.5), 0 0 0 1px rgb(255 255 255 / 0.05), inset 0 1px 0 rgb(255 255 255 / 0.05); } /* ========================================================================== @@ -169,8 +132,7 @@ /* Modern border and shadow for light mode */ border: 1px solid rgb(255 255 255 / calc(var(--glassmorphism-opacity) + 0.1)); - box-shadow: 0 32px 64px -12px rgb(0 0 0 / 0.25), inset 0 1px 0 - rgb(255 255 255 / calc(var(--glassmorphism-opacity) + 0.05)); + box-shadow: 0 32px 64px -12px rgb(0 0 0 / 0.25), inset 0 1px 0 rgb(255 255 255 / calc(var(--glassmorphism-opacity) + 0.05)); } .cta-glassmorphism:hover { @@ -183,8 +145,7 @@ ); border: 1px solid rgb(255 255 255 / calc(var(--glassmorphism-opacity) + 0.2)); - box-shadow: 0 40px 80px -16px rgb(0 0 0 / 0.3), inset 0 1px 0 - rgb(255 255 255 / calc(var(--glassmorphism-opacity) + 0.1)); + box-shadow: 0 40px 80px -16px rgb(0 0 0 / 0.3), inset 0 1px 0 rgb(255 255 255 / calc(var(--glassmorphism-opacity) + 0.1)); } /* Dark mode adjustments for CTA glassmorphism */ @@ -197,8 +158,7 @@ ); border: 1px solid rgb(255 255 255 / var(--glassmorphism-opacity)); - box-shadow: 0 32px 64px -12px rgb(0 0 0 / 0.4), inset 0 1px 0 - rgb(255 255 255 / calc(var(--glassmorphism-opacity) * 0.5)); + box-shadow: 0 32px 64px -12px rgb(0 0 0 / 0.4), inset 0 1px 0 rgb(255 255 255 / calc(var(--glassmorphism-opacity) * 0.5)); } .dark .cta-glassmorphism:hover { @@ -231,23 +191,20 @@ /* Light mode button background */ background: rgb(255 255 255 / 0.9); border: 1px solid rgb(0 0 0 / 0.1); - box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.1), - inset 0 1px 0 rgb(255 255 255 / 0.3); + box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.1), inset 0 1px 0 rgb(255 255 255 / 0.3); } .dark .cta-glassmorphism .group > div:first-child { /* Dark mode button background */ background: rgb(0 0 0 / 0.4); border: 1px solid rgb(255 255 255 / 0.2); - box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.3), 0 4px 6px -2px rgb(0 0 0 / 0.2), - inset 0 1px 0 rgb(255 255 255 / 0.1); + box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.3), 0 4px 6px -2px rgb(0 0 0 / 0.2), inset 0 1px 0 rgb(255 255 255 / 0.1); } .cta-glassmorphism .group:hover > div:first-child { background: rgb(255 255 255); border: 1px solid rgb(0 0 0 / 0.15); - box-shadow: 0 20px 40px -8px rgb(0 0 0 / 0.15), 0 8px 12px -4px - rgb(0 0 0 / 0.1), inset 0 1px 0 rgb(255 255 255 / 0.4); + box-shadow: 0 20px 40px -8px rgb(0 0 0 / 0.15), 0 8px 12px -4px rgb(0 0 0 / 0.1), inset 0 1px 0 rgb(255 255 255 / 0.4); } .dark .cta-glassmorphism .group:hover > div:first-child { diff --git a/modules/blox-tailwind/assets/css/config/theme.css b/modules/blox-tailwind/assets/css/config/theme.css index 14053559..930aa77e 100644 --- a/modules/blox-tailwind/assets/css/config/theme.css +++ b/modules/blox-tailwind/assets/css/config/theme.css @@ -320,9 +320,7 @@ /* Note: Providing these palettes in @theme ensures theme-pack mappings like var(--color-rose-600) always resolve */ /* Font family */ - --font-family-sans: - inter var, ui-sans-serif, system-ui, sans-serif, apple color emoji, segoe ui emoji, - segoe ui symbol, noto color emoji; + --font-family-sans: inter var, ui-sans-serif, system-ui, sans-serif, apple color emoji, segoe ui emoji, segoe ui symbol, noto color emoji; /* Font sizes */ --font-size-xs: 0.75rem; diff --git a/modules/blox-tailwind/assets/js/hb-citation.js b/modules/blox-tailwind/assets/js/hb-citation.js index e254de02..05066732 100644 --- a/modules/blox-tailwind/assets/js/hb-citation.js +++ b/modules/blox-tailwind/assets/js/hb-citation.js @@ -3,9 +3,9 @@ * Copies BibTeX citation to clipboard when cite button is clicked */ -import { hugoEnvironment, i18n } from "@params"; -import { ClipboardCache, copyToClipboardSync } from "./hb-clipboard.js"; -import { showNotification } from "./hb-notifier.js"; +import {hugoEnvironment, i18n} from "@params"; +import {ClipboardCache, copyToClipboardSync} from "./hb-clipboard.js"; +import {showNotification} from "./hb-notifier.js"; // Debug mode based on environment const isDebugMode = hugoEnvironment === "development"; @@ -36,9 +36,7 @@ function initializeCitation() { * Prefetch all citations on page load */ function prefetchAllCitations() { - const citeButtons = document.querySelectorAll( - ".js-cite-clipboard[data-filename]", - ); + const citeButtons = document.querySelectorAll(".js-cite-clipboard[data-filename]"); citeButtons.forEach((button) => { const filename = button.getAttribute("data-filename"); if (filename && !citationCache.has(filename)) { @@ -151,10 +149,7 @@ async function fetchAndCopyWithFallback(filename, button) { } // If it's a NotAllowedError, suggest hovering first if (error.name === "NotAllowedError") { - showNotification( - "Please hover over the button first, then click", - "info", - ); + showNotification("Please hover over the button first, then click", "info"); } else { showNotification("Failed to copy citation", "error"); } @@ -191,4 +186,4 @@ function updateButtonText(button) { } // Export functions for potential reuse -export { handleCiteClick, prefetchAllCitations }; +export {handleCiteClick, prefetchAllCitations}; diff --git a/modules/blox-tailwind/assets/js/hb-clipboard.js b/modules/blox-tailwind/assets/js/hb-clipboard.js index 58bf65c9..283ec2fc 100644 --- a/modules/blox-tailwind/assets/js/hb-clipboard.js +++ b/modules/blox-tailwind/assets/js/hb-clipboard.js @@ -3,7 +3,7 @@ * Provides cross-browser clipboard functionality */ -import { hugoEnvironment } from "@params"; +import {hugoEnvironment} from "@params"; // Debug mode based on environment const isDebugMode = hugoEnvironment === "development"; diff --git a/modules/blox-tailwind/assets/js/hb-code-copy.js b/modules/blox-tailwind/assets/js/hb-code-copy.js index 809cd94f..9631c2ca 100644 --- a/modules/blox-tailwind/assets/js/hb-code-copy.js +++ b/modules/blox-tailwind/assets/js/hb-code-copy.js @@ -1,4 +1,4 @@ -import { hugoEnvironment, i18n } from "@params"; +import {hugoEnvironment, i18n} from "@params"; // Constants const NOTIFICATION_DURATION = 2000; // milliseconds @@ -93,10 +93,7 @@ function createCopyButton() { const copyBtn = document.createElement("button"); copyBtn.classList.add("copy-button"); copyBtn.innerHTML = i18n["copy"]; - copyBtn.setAttribute( - "aria-label", - i18n["copyLabel"] || "Copy code to clipboard", - ); + copyBtn.setAttribute("aria-label", i18n["copyLabel"] || "Copy code to clipboard"); copyBtn.setAttribute("type", "button"); // Explicit button type return copyBtn; } @@ -144,18 +141,12 @@ function initializeCodeCopyButtons() { const copyBtn = createCopyButton(); // Use debounced version of copy function - const debouncedCopy = debounce( - () => copyCodeToClipboard(copyBtn, wrapper), - DEBOUNCE_DELAY, - ); + const debouncedCopy = debounce(() => copyCodeToClipboard(copyBtn, wrapper), DEBOUNCE_DELAY); copyBtn.addEventListener("click", debouncedCopy); wrapper.appendChild(copyBtn); } catch (err) { - console.error( - `Failed to initialize copy button for code block ${index}:`, - err, - ); + console.error(`Failed to initialize copy button for code block ${index}:`, err); } }); } catch (err) { diff --git a/modules/blox-tailwind/assets/js/hb-head.js b/modules/blox-tailwind/assets/js/hb-head.js index 155b8c7d..7d39783a 100644 --- a/modules/blox-tailwind/assets/js/hb-head.js +++ b/modules/blox-tailwind/assets/js/hb-head.js @@ -1,4 +1,4 @@ -import { applyHugoStyleFixes, initTheme } from "./hb-init.js"; +import {applyHugoStyleFixes, initTheme} from "./hb-init.js"; // Initialize Hugo Blox Builder global object const root = document.documentElement; diff --git a/modules/blox-tailwind/assets/js/hb-i18n.js b/modules/blox-tailwind/assets/js/hb-i18n.js index 017bc3c9..79d0fad1 100644 --- a/modules/blox-tailwind/assets/js/hb-i18n.js +++ b/modules/blox-tailwind/assets/js/hb-i18n.js @@ -1,13 +1,10 @@ window.addEventListener("DOMContentLoaded", () => { // Toggle language chooser sub-menu - const languageChoosers = document.querySelectorAll( - "[data-hb-language-chooser]", - ); + const languageChoosers = document.querySelectorAll("[data-hb-language-chooser]"); languageChoosers.forEach((languageChooser) => { languageChooser.addEventListener("click", (e) => { e.preventDefault(); - languageChooser.dataset.state = - languageChooser.dataset.state === "open" ? "closed" : "open"; + languageChooser.dataset.state = languageChooser.dataset.state === "open" ? "closed" : "open"; const languageOptions = languageChooser.nextElementSibling; languageOptions.classList.toggle("hidden"); const languageChooserRect = languageChooser.getBoundingClientRect(); diff --git a/modules/blox-tailwind/assets/js/hb-init.js b/modules/blox-tailwind/assets/js/hb-init.js index 420e2258..75eab3f9 100644 --- a/modules/blox-tailwind/assets/js/hb-init.js +++ b/modules/blox-tailwind/assets/js/hb-init.js @@ -17,18 +17,14 @@ export function initTheme() { if (defaultTheme === "dark") setDark(); else if (defaultTheme === "light") setLight(); else if (defaultTheme === "system") { - window.matchMedia("(prefers-color-scheme: dark)").matches - ? setDark() - : setLight(); + window.matchMedia("(prefers-color-scheme: dark)").matches ? setDark() : setLight(); } } } export function applyHugoStyleFixes() { document.addEventListener("DOMContentLoaded", function () { - const checkboxes = document.querySelectorAll( - "li input[type='checkbox'][disabled]", - ); + const checkboxes = document.querySelectorAll("li input[type='checkbox'][disabled]"); checkboxes.forEach((e) => { const parent = e.parentElement?.parentElement; if (parent) parent.classList.add("task-list"); @@ -36,12 +32,7 @@ export function applyHugoStyleFixes() { const liNodes = document.querySelectorAll(".task-list li"); liNodes.forEach((nodes) => { - const textNodes = Array.from(nodes.childNodes).filter( - (node) => - node.nodeType === 3 && - node.textContent && - node.textContent.trim().length > 1, - ); + const textNodes = Array.from(nodes.childNodes).filter((node) => node.nodeType === 3 && node.textContent && node.textContent.trim().length > 1); if (textNodes.length > 0) { const span = document.createElement("label"); textNodes[0].after(span); diff --git a/modules/blox-tailwind/assets/js/hb-mermaid-config.js b/modules/blox-tailwind/assets/js/hb-mermaid-config.js index 5446fd50..09b6f887 100644 --- a/modules/blox-tailwind/assets/js/hb-mermaid-config.js +++ b/modules/blox-tailwind/assets/js/hb-mermaid-config.js @@ -1,7 +1,5 @@ function getCssVar(name) { - const value = getComputedStyle(document.documentElement) - .getPropertyValue(name) - .trim(); + const value = getComputedStyle(document.documentElement).getPropertyValue(name).trim(); return value ? "rgb(" + value + ")" : null; } @@ -16,9 +14,7 @@ window.mermaid.initialize({ secondaryBorderColor: getCssVar("--color-secondary-400") || "#22d3ee", tertiaryBorderColor: getCssVar("--color-neutral-400") || "#a3a3a3", lineColor: getCssVar("--color-neutral-600") || "#525252", - fontFamily: getComputedStyle(document.documentElement).getPropertyValue( - "font-family", - ), + fontFamily: getComputedStyle(document.documentElement).getPropertyValue("font-family"), fontSize: "16px", }, }); diff --git a/modules/blox-tailwind/assets/js/hb-nav.js b/modules/blox-tailwind/assets/js/hb-nav.js index 9b594804..8ef12dc9 100644 --- a/modules/blox-tailwind/assets/js/hb-nav.js +++ b/modules/blox-tailwind/assets/js/hb-nav.js @@ -3,16 +3,13 @@ const applyScrollPadding = () => { const header = document.querySelector(".page-header"); let position = header.getBoundingClientRect(); - document.documentElement.style.scrollPaddingTop = - position.height.toString() + "px"; + document.documentElement.style.scrollPaddingTop = position.height.toString() + "px"; const r = document.querySelector(":root"); r.style.setProperty("--navbar-height", position.height.toString() + "px"); }; window.addEventListener("DOMContentLoaded", () => { - const dropdownMenus = document.querySelectorAll( - ".nav-dropdown > .nav-link[role='button']", - ); + const dropdownMenus = document.querySelectorAll(".nav-dropdown > .nav-link[role='button']"); dropdownMenus.forEach((toggler) => { const toggle = (el) => { diff --git a/modules/blox-tailwind/assets/js/hb-notifier.js b/modules/blox-tailwind/assets/js/hb-notifier.js index 8ba2088f..49d33655 100644 --- a/modules/blox-tailwind/assets/js/hb-notifier.js +++ b/modules/blox-tailwind/assets/js/hb-notifier.js @@ -3,7 +3,7 @@ * Provides reusable notification functionality */ -import { hugoEnvironment } from "@params"; +import {hugoEnvironment} from "@params"; // Debug mode based on environment const isDebugMode = hugoEnvironment === "development"; @@ -21,10 +21,7 @@ export function showNotification(message, type = "success", duration = 3000) { // Remove any existing notifications with same message const existingNotification = container.querySelector(".hb-notification"); - if ( - existingNotification && - existingNotification.textContent.includes(message) - ) { + if (existingNotification && existingNotification.textContent.includes(message)) { existingNotification.remove(); } @@ -86,10 +83,10 @@ function createNotificationElement(message, type) { // Define colors for different types const colors = { - success: { bg: "#10b981", bgClass: "bg-green-500" }, - error: { bg: "#ef4444", bgClass: "bg-red-500" }, - info: { bg: "#3b82f6", bgClass: "bg-blue-500" }, - warning: { bg: "#f59e0b", bgClass: "bg-amber-500" }, + success: {bg: "#10b981", bgClass: "bg-green-500"}, + error: {bg: "#ef4444", bgClass: "bg-red-500"}, + info: {bg: "#3b82f6", bgClass: "bg-blue-500"}, + warning: {bg: "#f59e0b", bgClass: "bg-amber-500"}, }; const color = colors[type] || colors.info; diff --git a/modules/blox-tailwind/assets/js/hb-search.js b/modules/blox-tailwind/assets/js/hb-search.js index 4359bb48..199f5982 100644 --- a/modules/blox-tailwind/assets/js/hb-search.js +++ b/modules/blox-tailwind/assets/js/hb-search.js @@ -11,10 +11,7 @@ window.addEventListener("DOMContentLoaded", () => { const searchConfig = JSON.parse(configScript.textContent); if (!searchConfig || typeof searchConfig.baseUrl === "undefined") { - console.error( - "Pagefind search config is missing or invalid.", - searchConfig, - ); + console.error("Pagefind search config is missing or invalid.", searchConfig); return; } @@ -35,9 +32,7 @@ window.addEventListener("DOMContentLoaded", () => { // Add click handlers to triggers let triggers = document.querySelectorAll("[data-search-toggle]"); - triggers.forEach((trigger) => - trigger.addEventListener("click", handleSearchToggle), - ); + triggers.forEach((trigger) => trigger.addEventListener("click", handleSearchToggle)); }); function handleSearchToggle() { @@ -68,11 +63,7 @@ function handleSearchToggle() { // Add keyboard shortcut to close search modal with Escape key document.addEventListener("keydown", (event) => { - if ( - event.key === "Escape" && - searchWrapper && - !searchWrapper.classList.contains("hidden") - ) { + if (event.key === "Escape" && searchWrapper && !searchWrapper.classList.contains("hidden")) { searchWrapper.classList.add("hidden"); } }); diff --git a/modules/blox-tailwind/assets/js/hb-sidebar.js b/modules/blox-tailwind/assets/js/hb-sidebar.js index f60edf65..769690b2 100644 --- a/modules/blox-tailwind/assets/js/hb-sidebar.js +++ b/modules/blox-tailwind/assets/js/hb-sidebar.js @@ -22,13 +22,7 @@ document.addEventListener("DOMContentLoaded", function () { } // Initialize the overlay - const overlayClasses = [ - "fixed", - "z-10", - "inset-0", - "bg-white", - "dark:bg-black/80", - ]; + const overlayClasses = ["fixed", "z-10", "inset-0", "bg-white", "dark:bg-black/80"]; overlay.classList.add("bg-transparent"); overlay.classList.remove("hidden", ...overlayClasses); @@ -37,9 +31,7 @@ document.addEventListener("DOMContentLoaded", function () { // See `hb-nav.js` - it handles the default behavior (irrespective of if sidebar is shown). // When menu is open, show the navigation sidebar - sidebarContainer.classList.toggle( - "max-lg:[transform:translate3d(0,-100%,0)]", - ); + sidebarContainer.classList.toggle("max-lg:[transform:translate3d(0,-100%,0)]"); sidebarContainer.classList.toggle("max-lg:[transform:translate3d(0,0,0)]"); // When menu is open, prevent body from scrolling diff --git a/modules/blox-tailwind/assets/js/hb-theme.js b/modules/blox-tailwind/assets/js/hb-theme.js index 1304c5b8..6c99259c 100644 --- a/modules/blox-tailwind/assets/js/hb-theme.js +++ b/modules/blox-tailwind/assets/js/hb-theme.js @@ -11,9 +11,7 @@ function addThemeToggleListener() { if ( localStorage.getItem("wc-color-theme") === "dark" || (!("wc-color-theme" in localStorage) && - ((window.matchMedia("(prefers-color-scheme: dark)").matches && - defaultTheme === "system") || - defaultTheme === "dark")) + ((window.matchMedia("(prefers-color-scheme: dark)").matches && defaultTheme === "system") || defaultTheme === "dark")) ) { themeToggleButtons.forEach((el) => { el.dataset.theme = "dark"; @@ -45,15 +43,12 @@ function addThemeToggleListener() { localStorage.setItem("wc-color-theme", "dark"); } } - el.dataset.theme = document.documentElement.classList.contains("dark") - ? "dark" - : "light"; + el.dataset.theme = document.documentElement.classList.contains("dark") ? "dark" : "light"; // Dispatch `hbThemeChange` event to support themeable user plugins. const themeChangeEvent = new CustomEvent("hbThemeChange", { detail: { - isDarkTheme: () => - document.documentElement.classList.contains("dark"), + isDarkTheme: () => document.documentElement.classList.contains("dark"), }, }); document.dispatchEvent(themeChangeEvent); @@ -61,15 +56,13 @@ function addThemeToggleListener() { }); // Listen for dark mode toggling in OS - window - .matchMedia("(prefers-color-scheme: dark)") - .addEventListener("change", (event) => { - if (defaultTheme === "system" && !("wc-color-theme" in localStorage)) { - event.matches ? window.hbb.setDarkTheme() : window.hbb.setLightTheme(); - themeToggleButtons.forEach((el) => { - const isDark = document.documentElement.classList.contains("dark"); - el.dataset.theme = isDark ? "dark" : "light"; - }); - } - }); + window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", (event) => { + if (defaultTheme === "system" && !("wc-color-theme" in localStorage)) { + event.matches ? window.hbb.setDarkTheme() : window.hbb.setLightTheme(); + themeToggleButtons.forEach((el) => { + const isDark = document.documentElement.classList.contains("dark"); + el.dataset.theme = isDark ? "dark" : "light"; + }); + } + }); } diff --git a/modules/blox-tailwind/assets/js/katex-config.js b/modules/blox-tailwind/assets/js/katex-config.js index 386c6c7f..4837998b 100644 --- a/modules/blox-tailwind/assets/js/katex-config.js +++ b/modules/blox-tailwind/assets/js/katex-config.js @@ -1,10 +1,10 @@ document.addEventListener("DOMContentLoaded", function () { window.renderMathInElement(document.body, { delimiters: [ - { left: "$$", right: "$$", display: true }, - { left: "$", right: "$", display: false }, - { left: "\\(", right: "\\)", display: false }, - { left: "\\[", right: "\\]", display: true }, + {left: "$$", right: "$$", display: true}, + {left: "$", right: "$", display: false}, + {left: "\\(", right: "\\)", display: false}, + {left: "\\[", right: "\\]", display: true}, ], throwOnError: false, }); diff --git a/modules/blox-tailwind/blox/collection/manifest.json b/modules/blox-tailwind/blox/collection/manifest.json index 6bc356fe..fcf4d79b 100644 --- a/modules/blox-tailwind/blox/collection/manifest.json +++ b/modules/blox-tailwind/blox/collection/manifest.json @@ -4,25 +4,10 @@ "version": "1.0.0", "license": "MIT", "category": "content", - "tags": [ - "collection", - "blog", - "publications", - "filter", - "sort", - "content-display", - "archive" - ], + "tags": ["collection", "blog", "publications", "filter", "sort", "content-display", "archive"], "description": "Display filtered and sorted collections of pages with customizable views and pagination", "author": "Hugo Blox", "homepage": "https://hugoblox.com/blocks/", "repository": "https://github.com/HugoBlox/hugo-blox-builder", - "keywords": [ - "hugo", - "static-site", - "content", - "blog", - "publications", - "filtering" - ] + "keywords": ["hugo", "static-site", "content", "blog", "publications", "filtering"] } diff --git a/modules/blox-tailwind/blox/cta-button-list/manifest.json b/modules/blox-tailwind/blox/cta-button-list/manifest.json index 40536a2c..b77093bd 100644 --- a/modules/blox-tailwind/blox/cta-button-list/manifest.json +++ b/modules/blox-tailwind/blox/cta-button-list/manifest.json @@ -4,25 +4,10 @@ "version": "1.0.0", "license": "MIT", "category": "marketing", - "tags": [ - "cta", - "buttons", - "links", - "social", - "marketing", - "conversion", - "list" - ], + "tags": ["cta", "buttons", "links", "social", "marketing", "conversion", "list"], "description": "Create compelling vertical lists of call-to-action buttons with icons and hover effects", "author": "Hugo Blox", "homepage": "https://hugoblox.com/blocks/", "repository": "https://github.com/HugoBlox/hugo-blox-builder", - "keywords": [ - "hugo", - "cta", - "buttons", - "conversion", - "marketing", - "social-links" - ] + "keywords": ["hugo", "cta", "buttons", "conversion", "marketing", "social-links"] } diff --git a/modules/blox-tailwind/blox/cta-card/manifest.json b/modules/blox-tailwind/blox/cta-card/manifest.json index 47d7aab8..bab2f1fd 100644 --- a/modules/blox-tailwind/blox/cta-card/manifest.json +++ b/modules/blox-tailwind/blox/cta-card/manifest.json @@ -4,15 +4,7 @@ "version": "1.0.0", "license": "MIT", "category": "marketing", - "tags": [ - "cta", - "card", - "conversion", - "marketing", - "hero", - "call-to-action", - "banner" - ], + "tags": ["cta", "card", "conversion", "marketing", "hero", "call-to-action", "banner"], "description": "Create high-impact call-to-action cards with bold typography and compelling buttons", "author": "Hugo Blox", "homepage": "https://hugoblox.com/blocks/", diff --git a/modules/blox-tailwind/blox/cta-card/schema.json b/modules/blox-tailwind/blox/cta-card/schema.json index ff603728..c7f68fef 100644 --- a/modules/blox-tailwind/blox/cta-card/schema.json +++ b/modules/blox-tailwind/blox/cta-card/schema.json @@ -120,18 +120,7 @@ }, "position": { "type": "string", - "enum": [ - "center", - "top", - "bottom", - "left", - "right", - "repeat", - "top left", - "top right", - "bottom left", - "bottom right" - ], + "enum": ["center", "top", "bottom", "left", "right", "repeat", "top left", "top right", "bottom left", "bottom right"], "description": "Background position (use 'repeat' for tiling textures)", "default": "center" }, diff --git a/modules/blox-tailwind/blox/cta-image-paragraph/manifest.json b/modules/blox-tailwind/blox/cta-image-paragraph/manifest.json index 989c1313..f3b1de99 100644 --- a/modules/blox-tailwind/blox/cta-image-paragraph/manifest.json +++ b/modules/blox-tailwind/blox/cta-image-paragraph/manifest.json @@ -4,25 +4,10 @@ "version": "1.0.0", "license": "MIT", "category": "marketing", - "tags": [ - "cta", - "image", - "features", - "alternating", - "marketing", - "storytelling", - "visual" - ], + "tags": ["cta", "image", "features", "alternating", "marketing", "storytelling", "visual"], "description": "Engaging alternating image and text sections with feature lists and call-to-action buttons", "author": "Hugo Blox", "homepage": "https://hugoblox.com/blocks/", "repository": "https://github.com/HugoBlox/hugo-blox-builder", - "keywords": [ - "hugo", - "marketing", - "images", - "features", - "storytelling", - "conversion" - ] + "keywords": ["hugo", "marketing", "images", "features", "storytelling", "conversion"] } diff --git a/modules/blox-tailwind/blox/features/manifest.json b/modules/blox-tailwind/blox/features/manifest.json index affaed46..058debf8 100644 --- a/modules/blox-tailwind/blox/features/manifest.json +++ b/modules/blox-tailwind/blox/features/manifest.json @@ -4,15 +4,7 @@ "version": "1.0.0", "license": "MIT", "category": "content", - "tags": [ - "features", - "grid", - "icons", - "benefits", - "product", - "services", - "highlights" - ], + "tags": ["features", "grid", "icons", "benefits", "product", "services", "highlights"], "description": "Showcase features, benefits, or services in an organized grid with icons and descriptions", "author": "Hugo Blox", "homepage": "https://hugoblox.com/blocks/", diff --git a/modules/blox-tailwind/blox/hero/client.jsx b/modules/blox-tailwind/blox/hero/client.jsx index 73364b34..3e2c0bb6 100644 --- a/modules/blox-tailwind/blox/hero/client.jsx +++ b/modules/blox-tailwind/blox/hero/client.jsx @@ -3,15 +3,13 @@ * Uses the shared component for consistency */ -import { render } from "preact"; -import { HeroBlock } from "./component.jsx"; +import {render} from "preact"; +import {HeroBlock} from "./component.jsx"; // Render function - immediately renders Hero components function renderHeroBlocks() { // Find all hero block containers (using both old and new selectors for compatibility) - const heroBlocks = document.querySelectorAll( - '[data-block-type="hero"], [data-hero-render="immediate"]', - ); + const heroBlocks = document.querySelectorAll('[data-block-type="hero"], [data-hero-render="immediate"]'); heroBlocks.forEach((block) => { const propsData = block.dataset.props; diff --git a/modules/blox-tailwind/blox/hero/component.jsx b/modules/blox-tailwind/blox/hero/component.jsx index e537c36c..8f39eca8 100644 --- a/modules/blox-tailwind/blox/hero/component.jsx +++ b/modules/blox-tailwind/blox/hero/component.jsx @@ -3,7 +3,7 @@ * Used for both SSR and client-side hydration */ -import { Icon } from "../../shared/components/Icon.jsx"; +import {Icon} from "../../shared/components/Icon.jsx"; // Simple markdown renderer export function renderText(text) { @@ -16,7 +16,7 @@ export function renderText(text) { // Process URLs export function processUrl(url) { - if (!url) return { href: "#" }; + if (!url) return {href: "#"}; if (url.startsWith("http://") || url.startsWith("https://")) { return { @@ -27,14 +27,14 @@ export function processUrl(url) { } if (url.startsWith("#")) { - return { href: url }; + return {href: url}; } - return { href: url }; + return {href: url}; } // Hero Block Component - Single implementation -export const HeroBlock = ({ content, design, id, icon_svg }) => { +export const HeroBlock = ({content, design, id, icon_svg}) => { const paddingClasses = design?.no_padding ? "" : "py-32 sm:py-48 lg:py-56"; return ( @@ -44,6 +44,7 @@ export const HeroBlock = ({ content, design, id, icon_svg }) => { {content.announcement?.text && (