[deploy] Emit frontend bundle as ESM for browser
All checks were successful
Deploy Discord Bot / deploy (push) Successful in 38s

This commit is contained in:
Pascal Prießnitz
2025-12-04 17:06:27 +01:00
parent 18a47c0426
commit 7a296f7b4a
28 changed files with 185 additions and 273 deletions

View File

@@ -1,8 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.renderSidebar = renderSidebar;
exports.initNavigation = initNavigation;
const store_js_1 = require("../state/store.js");
import { setState } from '../state/store.js';
const defaultNav = [
{ id: 'overview', label: 'Uebersicht', icon: '[*]' },
{ id: 'tickets', label: 'Ticketsystem', icon: '[*]' },
@@ -11,7 +7,7 @@ const defaultNav = [
{ id: 'events', label: 'Events', icon: '[*]' },
{ id: 'admin', label: 'Admin', icon: '[*]', requiresAdmin: true }
];
function renderSidebar(container, isAdmin) {
export function renderSidebar(container, isAdmin) {
container.innerHTML = '';
const brand = document.createElement('div');
brand.className = 'brand';
@@ -30,14 +26,14 @@ function renderSidebar(container, isAdmin) {
container.appendChild(brand);
container.appendChild(nav);
}
function initNavigation(onChange) {
export function initNavigation(onChange) {
const navLinks = Array.from(document.querySelectorAll('.nav a'));
const activate = (section) => {
navLinks.forEach((link) => link.classList.toggle('active', link.dataset.target === section));
document.querySelectorAll('.section').forEach((sec) => {
sec.classList.toggle('active', sec.id === `section-${section}`);
});
(0, store_js_1.setState)({}); // trigger listeners for potential observers
setState({}); // trigger listeners for potential observers
onChange(section);
};
navLinks.forEach((link) => {