perf(ui): remove dead runtime controllers and unused stylesheet families
Two orphaned controllers in the reactive runtime targeted markup nothing emits any more: hydrateSidebarControllers looked for .wire-sidebar-shell and friends, which the Sidebar rewrite replaced with BEM classes earlier today, and hydrateDropdownControllers looked for [data-wrn-dropdown], which no component or compiler output has ever produced. ui.css loses the matching legacy sidebar rules, the wire-mega-menu family left behind when the MegaMenu scaffold was replaced, and a set of self-contained application-pattern families that nothing references. Utility layers are deliberately kept even where an individual member is not name-checked anywhere. wire-bg-primary is documented and tested while wire-bg-secondary is not, but they are one public family and splitting them would be incoherent. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -110,6 +110,6 @@
|
||||
"packages/ui/components/progress.wrn": "ba6f4dfcc00f04f34e9533be675bb4a6200c3cdcd7d03fc597377e48520fdec7",
|
||||
"packages/ui/components/skeleton.wrn": "ceec8af147b8be08155500e378393ac7c72d819da61b62191c076c80e943d5a9",
|
||||
"packages/ui/components/spinner.wrn": "abc4ee3ede2e019289257e9009eee012c880a85839cc220fac6dbe1b780caf52",
|
||||
"packages/ui/ui.css": "f71641efb0c98b673af70c10dbcea8e693de258ce8620b4f84c64553ea70204e"
|
||||
"packages/ui/ui.css": "3138b86f269b6f7e67922ef2c56918444d562b11f4ae6f1fab98b63805cd78dc"
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3277,93 +3277,12 @@ export const REACTIVE_RUNTIME = String.raw`
|
||||
ensureBehaviorObserver();
|
||||
hydrateNavbarControllers(host);
|
||||
hydratePreferenceControllers(host);
|
||||
hydrateSidebarControllers(host);
|
||||
hydrateDropdownControllers(host);
|
||||
hydrateSelectControllers(host);
|
||||
hydratePinInputControllers(host);
|
||||
}
|
||||
|
||||
var navbarOutsideClickBound = false;
|
||||
var preferenceOutsideClickBound = false;
|
||||
var dropdownOutsideClickBound = false;
|
||||
|
||||
function hydrateSidebarControllers(root) {
|
||||
var host = root || document;
|
||||
var sidebars = [];
|
||||
if (host.nodeType === 1 && host.matches && host.matches(".wire-sidebar-shell")) {
|
||||
sidebars.push(host);
|
||||
}
|
||||
if (host.querySelectorAll) {
|
||||
Array.prototype.push.apply(sidebars, host.querySelectorAll(".wire-sidebar-shell"));
|
||||
}
|
||||
sidebars.forEach(function (sidebar) {
|
||||
var current = window.location.pathname.replace(/\/+$/, "") || "/";
|
||||
var best = null;
|
||||
var bestLength = -1;
|
||||
sidebar.querySelectorAll(".wire-sidebar-items a[href]").forEach(function (link) {
|
||||
var url;
|
||||
try { url = new URL(link.getAttribute("href"), window.location.origin); } catch (_) { return; }
|
||||
var path = url.pathname.replace(/\/+$/, "") || "/";
|
||||
var matches = path === current || (path !== "/" && current.indexOf(path + "/") === 0);
|
||||
link.classList.remove("is-active");
|
||||
if (!matches || path.length <= bestLength) return;
|
||||
best = link;
|
||||
bestLength = path.length;
|
||||
});
|
||||
sidebar.querySelectorAll(".wire-sidebar-items a[aria-current='page']").forEach(function (link) {
|
||||
if (link !== best) link.removeAttribute("aria-current");
|
||||
});
|
||||
sidebar.querySelectorAll(".wire-sidebar-group.has-active").forEach(function (group) {
|
||||
group.classList.remove("has-active");
|
||||
});
|
||||
if (best) {
|
||||
best.classList.add("is-active");
|
||||
best.setAttribute("aria-current", "page");
|
||||
var group = best.closest(".wire-sidebar-group");
|
||||
if (group) {
|
||||
group.setAttribute("open", "");
|
||||
group.classList.add("has-active");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function hydrateDropdownControllers(root) {
|
||||
var host = root || document;
|
||||
var dropdowns = [];
|
||||
if (host.nodeType === 1 && host.matches && host.matches("[data-wrn-dropdown]")) {
|
||||
dropdowns.push(host);
|
||||
}
|
||||
if (host.querySelectorAll) {
|
||||
Array.prototype.push.apply(dropdowns, host.querySelectorAll("[data-wrn-dropdown]"));
|
||||
}
|
||||
dropdowns.forEach(function (dropdown) {
|
||||
if (dropdown.dataset.wrnDropdownBound === "true") return;
|
||||
dropdown.dataset.wrnDropdownBound = "true";
|
||||
dropdown.addEventListener("toggle", function () {
|
||||
if (!dropdown.open) return;
|
||||
document.querySelectorAll("[data-wrn-dropdown][open]").forEach(function (candidate) {
|
||||
if (candidate !== dropdown) candidate.removeAttribute("open");
|
||||
});
|
||||
});
|
||||
});
|
||||
if (!dropdownOutsideClickBound) {
|
||||
dropdownOutsideClickBound = true;
|
||||
document.addEventListener("pointerdown", function (event) {
|
||||
document.querySelectorAll("[data-wrn-dropdown][open]").forEach(function (dropdown) {
|
||||
if (!dropdown.contains(event.target)) dropdown.removeAttribute("open");
|
||||
});
|
||||
});
|
||||
document.addEventListener("keydown", function (event) {
|
||||
if (event.key !== "Escape") return;
|
||||
document.querySelectorAll("[data-wrn-dropdown][open]").forEach(function (dropdown) {
|
||||
dropdown.removeAttribute("open");
|
||||
var summary = dropdown.querySelector(":scope > summary");
|
||||
if (summary) summary.focus();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function hydratePreferenceControllers(root) {
|
||||
var host = root || document;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"sourceDocuments": ["Screenshot-directed WRNexus UI catalog reset"],
|
||||
"sourceDocuments": [
|
||||
"Screenshot-directed WRNexus UI catalog reset"
|
||||
],
|
||||
"components": [
|
||||
{
|
||||
"name": "Accordion",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user