23652365 const showDeadValue = Object.hasOwn(rawConfig, "showDeadTargets") ? rawConfig.showDeadTargets : rawConfig.showDeadObjectives;
23662366 const normalizedDimStyle = normalizeStringChoice(rawConfig.irrelevantBoardDimStyle, "smoke", CRICKET_HIGHLIGHT_IRRELEVANT_DIM_STYLES);
23672367 const hasLegacyDimSetting = Object.hasOwn(rawConfig, "dimIrrelevantBoardTargets");
2368- const irrelevantBoardDimStyle = hasLegacyDimSetting && normalizedDimStyle === "smoke" ? normalizeBoolean(rawConfig.dimIrrelevantBoardTargets, true) ? "smoke" : "off" : normalizedDimStyle;
2368+ let irrelevantBoardDimStyle = normalizedDimStyle;
2369+ if (hasLegacyDimSetting && normalizedDimStyle === "smoke") {
2370+ irrelevantBoardDimStyle = normalizeBoolean(rawConfig.dimIrrelevantBoardTargets, true) ? "smoke" : "off";
2371+ }
23692372 return { enabled: normalizeBoolean(rawConfig.enabled, false), showOpenObjectives: normalizeBoolean(showOpenValue, false), showDeadObjectives: normalizeBoolean(showDeadValue, true), irrelevantBoardDimStyle, dimIrrelevantBoardTargets: irrelevantBoardDimStyle !== "off", colorTheme: normalizeStringChoice(rawConfig.colorTheme, "standard", CRICKET_HIGHLIGHT_THEMES), intensity: normalizeStringChoice(rawConfig.intensity, "normal", CRICKET_HIGHLIGHT_INTENSITIES), debug: normalizeBoolean(rawConfig.debug, false) };
23702373 },
23712374 cricketGridFx(rawConfig = {}) {
23902393 },
23912394 turnPointsCount(rawConfig = {}) {
23922395 const hasLegacyFlashPermanent = Object.hasOwn(rawConfig, "flashPermanent");
2393- const legacyFlashMode = hasLegacyFlashPermanent ? normalizeBoolean(rawConfig.flashPermanent, false) ? "permanent" : "on-change" : "on-change";
2396+ let legacyFlashMode = "on-change";
2397+ if (hasLegacyFlashPermanent) {
2398+ legacyFlashMode = normalizeBoolean(rawConfig.flashPermanent, false) ? "permanent" : "on-change";
2399+ }
23942400 const normalizedFlashMode = normalizeMappedStringChoice(rawConfig.flashMode, legacyFlashMode, { "": "on-change", "on-change": "on-change", onchange: "on-change", appear: "on-change", burst: "on-change", "nur-bei-änderung": "on-change", "nur-bei-aenderung": "on-change", permanent: "permanent", always: "permanent", persistent: "permanent", dauerhaft: "permanent" });
23952401 return { enabled: normalizeBoolean(rawConfig.enabled, false), durationMs: normalizeNumberChoice(rawConfig.durationMs, 416, TURN_POINTS_COUNT_DURATIONS), flashOnChange: normalizeBoolean(rawConfig.flashOnChange, true), flashMode: hasLegacyFlashPermanent ? legacyFlashMode : normalizedFlashMode, debug: normalizeBoolean(rawConfig.debug, false) };
23962402 },
31863192 return;
31873193 }
31883194 const importedFeature = importer(legacyFeatureState);
3189- if (!importedFeature || !importedFeature .configKey) {
3195+ if (!importedFeature? .configKey) {
31903196 return;
31913197 }
31923198 importedFeatureCount += 1;
77587764 return [
77597765 role,
77607766 String(node.tagName || ""),
7761- String(node.getAttribute("data-target-ring") || ""),
7762- String(node.getAttribute("data-target-value") || ""),
7767+ String(node.dataset?.targetRing || ""),
7768+ String(node.dataset?.targetValue || ""),
77637769 String(node.getAttribute("d") || ""),
77647770 String(node.getAttribute("r") || ""),
77657771 String(node.getAttribute("fill-rule") || "")
79577963 return;
79587964 }
79597965 shapeNode.setAttribute(TARGET_FAMILY_ATTRIBUTE, String(styleProfile.family || "single"));
7960- shapeNode.setAttribute("data-target-ring", String(target?.ring || ""));
7966+ if (shapeNode.dataset) {
7967+ shapeNode.dataset.targetRing = String(target?.ring || "");
7968+ }
79617969 if (Number.isFinite(target?.value)) {
7962- shapeNode.setAttribute("data-target-value", String(target.value));
7970+ if (shapeNode.dataset) {
7971+ shapeNode.dataset.targetValue = String(target.value);
7972+ }
7973+ } else if (shapeNode.dataset) {
7974+ delete shapeNode.dataset.targetValue;
79637975 }
79647976 }
79657977 function applyShapeStyle(shapeNode, visualConfig, styleProfile) {
82478259 if (referenceNode === node) {
82488260 return;
82498261 }
8250- overlay.insertBefore(node, referenceNode);
8262+ if (referenceNode) {
8263+ referenceNode.before(node);
8264+ return;
8265+ }
8266+ overlay.appendChild(node);
82518267 });
82528268 }
82538269
1018410200 }
1018510201 return 2.75;
1018610202 }
10187- function toElementNode(node) {
10188- let current = node || null ;
10203+ function toElementNode(node = null ) {
10204+ let current = node;
1018910205 while (current && current.nodeType !== 1) {
1019010206 current = current.parentNode || null;
1019110207 }
1191711933 if (nodeToRemove && typeof nodeToRemove.remove === "function") {
1191811934 nodeToRemove.remove();
1191911935 } else if (nodeToRemove && nodeToRemove.parentNode && typeof nodeToRemove.parentNode.removeChild === "function") {
11920- nodeToRemove.remove( );
11936+ nodeToRemove.parentNode.removeChild(nodeToRemove );
1192111937 }
1192211938 setReadyClass(documentRef, false);
1192311939 REF_COUNT_BY_DOCUMENT.delete(documentRef);
@@ -39648,7 +39664,7 @@ span.css-3fr5p8{
3964839664 return;
3964939665 }
3965039666 if (isConfigRoute()) {
39651- button.setAttribute("data- active", "true") ;
39667+ button.dataset. active = "true";
3965239668 } else {
3965339669 button.removeAttribute("data-active");
3965439670 }
@@ -39662,11 +39678,11 @@ span.css-3fr5p8{
3966239678 const remoteVersion = String(state.updateStatus?.remoteVersion || "").trim();
3966339679 const title = hasUpdate && remoteVersion ? `${menuLabel} - Update verfügbar (${installedVersion} -> ${remoteVersion})` : menuLabel;
3966439680 if (hasUpdate) {
39665- button.setAttribute("data-update-available", "true") ;
39681+ button.dataset.updateAvailable = "true";
3966639682 } else {
3966739683 button.removeAttribute("data-update-available");
3966839684 }
39669- button.setAttribute("data-update-state", String(state.updateStatus?.status || "") );
39685+ button.dataset.updateState = String(state.updateStatus?.status || "");
3967039686 button.setAttribute("title", title);
3967139687 button.setAttribute("aria-label", title);
3967239688 }
@@ -39697,12 +39713,13 @@ span.css-3fr5p8{
3969739713 const sidebarLinks = Array.from(sidebar.querySelectorAll("a[href]"));
3969839714 const boardsAnchor = sidebarLinks.find((link) => toRoutePathname2(windowRef, link.getAttribute("href")) === "/boards") || sidebarLinks.find((link) => String(link.textContent || "").trim().toLowerCase() === "meine boards") || null;
3969939715 const insertionAnchor = boardsAnchor || sidebarLinks.find((link) => sidebarRouteHints.has(toRoutePathname2(windowRef, link.getAttribute("href")))) || null;
39700- const templateCandidates = [
39716+ const template = [
3970139717 insertionAnchor,
3970239718 ...Array.from(sidebar.querySelectorAll?.("a[href], button, [role='button']") || []),
3970339719 sidebar.lastElementChild
39704- ].filter(Boolean).filter((node) => node.id !== menuItemId).filter((node) => !node.closest?.(`#${panelHostId}`)).filter((node) => String(node.getAttribute?.("data-adxconfig-tab") || "").trim() === "");
39705- const template = templateCandidates[0] || null;
39720+ ].find((node) => {
39721+ return Boolean(node) && node.id !== menuItemId && !node.closest?.(`#${panelHostId}`) && String(node.dataset?.adxconfigTab || "").trim() === "";
39722+ }) || null;
3970639723 let item = documentRef.getElementById?.(menuItemId);
3970739724 const shouldRebuildExistingItem = Boolean(item) && (Boolean(item.closest?.(`#${panelHostId}`)) || item.getAttribute?.("data-adxconfig-tab") !== null || String(item.getAttribute?.("data-adxconfig-action") || "").trim() !== "open" || !item.querySelector?.(".ad-xconfig-menu-label"));
3970839725 if (shouldRebuildExistingItem) {
@@ -39725,7 +39742,7 @@ span.css-3fr5p8{
3972539742 item.setAttribute("tabindex", "0");
3972639743 item.setAttribute("aria-label", menuLabel);
3972739744 item.setAttribute("title", menuLabel);
39728- item.setAttribute("data-adxconfig-action", "open") ;
39745+ item.dataset.adxconfigAction = "open";
3972939746 item.style.cursor = "pointer";
3973039747 if (String(item.tagName || "").toLowerCase() === "a") {
3973139748 item.removeAttribute("href");
@@ -39749,7 +39766,7 @@ span.css-3fr5p8{
3974939766 }
3975039767 if (insertionAnchor) {
3975139768 if (insertionAnchor.nextElementSibling !== item) {
39752- insertionAnchor.insertAdjacentElement("afterend", item);
39769+ insertionAnchor.after( item);
3975339770 }
3975439771 } else if (item.parentNode !== sidebar) {
3975539772 sidebar.appendChild(item);
@@ -41841,9 +41858,9 @@ span.css-3fr5p8{
4184141858 const codeNode = fieldNode.querySelector?.("[data-adxconfig-setting='true'][data-color-input-role='hex']") || null;
4184241859 const resetNode = fieldNode.querySelector?.("[data-adxconfig-action='clear-setting-color']") || null;
4184341860 const statusNode = fieldNode.querySelector?.("[data-adxconfig-color-status='true']") || null;
41844- fieldNode.setAttribute("data- invalid", invalid ? "true" : "false") ;
41845- fieldNode.setAttribute("data-has-custom-value", normalizedValue ? "true" : "false") ;
41846- fieldNode.setAttribute("data-color-value", normalizedValue) ;
41861+ fieldNode.dataset. invalid = invalid ? "true" : "false";
41862+ fieldNode.dataset.hasCustomValue = normalizedValue ? "true" : "false";
41863+ fieldNode.dataset.colorValue = normalizedValue;
4184741864 if (swatchNode) {
4184841865 swatchNode.style.background = normalizedValue || "";
4184941866 }
@@ -41877,7 +41894,7 @@ span.css-3fr5p8{
4187741894 const previewFontFamily = String(preset?.previewFontFamily || "").trim();
4187841895 if (previewFontFamily && preset?.remote) {
4187941896 labelNode.style.fontFamily = previewFontFamily;
41880- labelNode.setAttribute("data-adxconfig-preview-font", preset.value) ;
41897+ labelNode.dataset.adxconfigPreviewFont = preset.value;
4188141898 }
4188241899 return labelNode;
4188341900 }
@@ -42191,7 +42208,7 @@ span.css-3fr5p8{
4219142208 if (!optionNode || typeof optionNode.setAttribute !== "function") {
4219242209 return;
4219342210 }
42194- optionNode.setAttribute("data- active", isActive ? "true" : "false") ;
42211+ optionNode.dataset. active = isActive ? "true" : "false";
4219542212 optionNode.setAttribute("aria-pressed", isActive ? "true" : "false");
4219642213 const activeContainer = optionNode.querySelector?.("[data-option-active-slot='true']") || optionNode.querySelector?.(".ad-xconfig-option-head") || null;
4219742214 if (!activeContainer) {
@@ -42207,10 +42224,10 @@ span.css-3fr5p8{
4220742224 activeBadge?.remove?.();
4220842225 }
4220942226 function syncSelectOptionButtons(documentRef, actionNode, selectedValue) {
42210- if (!actionNode || typeof actionNode.getAttribute !== "function" ) {
42227+ if (!actionNode) {
4221142228 return;
4221242229 }
42213- const settingKey = String(actionNode.getAttribute("data-setting-key") || "").trim();
42230+ const settingKey = String(actionNode.dataset?.settingKey || "").trim();
4221442231 if (!settingKey) {
4221542232 return;
4221642233 }
@@ -42225,14 +42242,14 @@ span.css-3fr5p8{
4222542242 );
4222642243 const selectedValues = Array.isArray(selectedValue) ? selectedValue.map((value) => String(value ?? "")) : [String(selectedValue ?? "")];
4222742244 optionButtons.forEach((optionNode) => {
42228- const optionValue = String(optionNode.getAttribute("data-setting-value") ?? "");
42245+ const optionValue = String(optionNode.dataset?.settingValue ?? "");
4222942246 setSelectOptionActiveState(documentRef, optionNode, selectedValues.includes(optionValue));
4223042247 });
4223142248 const optionList = inputWrap.querySelector?.(
4223242249 `[data-adxconfig-setting='true'][data-setting-control='select'][data-setting-key='${settingKey}']`
4223342250 );
4223442251 if (optionList) {
42235- optionList.setAttribute("data-selected-value", selectedValues.join(",") );
42252+ optionList.dataset.selectedValue = selectedValues.join(",");
4223642253 }
4223742254 }
4223842255 function buildFeatureCard(documentRef, feature) {
@@ -43036,7 +43053,7 @@ span.css-3fr5p8{
4303643053 }
4303743054 const tabNode = target.closest("[data-adxconfig-tab]");
4303843055 if (tabNode) {
43039- const tabId = tabNode.getAttribute("data-adxconfig-tab") || "themes";
43056+ const tabId = tabNode.dataset?.adxconfigTab || "themes";
4304043057 if (TAB_DEFINITIONS2.some((tab) => tab.id === tabId)) {
4304143058 state.activeTab = tabId;
4304243059 state.activeSettingsFeatureKey = "";
@@ -43053,15 +43070,15 @@ span.css-3fr5p8{
4305343070 if (!insideMenuButton && !insidePanelHost) {
4305443071 return;
4305543072 }
43056- const action = actionNode.getAttribute("data-adxconfig-action") ;
43073+ const action = actionNode.dataset?.adxconfigAction || "" ;
4305743074 if (action === "close-settings-backdrop") {
4305843075 const insideModal = target.closest("[data-adxconfig-modal='true']");
4305943076 if (insideModal) {
4306043077 return;
4306143078 }
4306243079 }
4306343080 event.preventDefault?.();
43064- const featureKey = actionNode.getAttribute("data-feature-key") ;
43081+ const featureKey = actionNode.dataset?.featureKey || "" ;
4306543082 const feature = getFeatures().find((entry) => entry.featureKey === featureKey) || null;
4306643083 handleAction(action, actionNode, feature);
4306743084 }
@@ -43070,8 +43087,8 @@ span.css-3fr5p8{
4307043087 if (!target || typeof target.getAttribute !== "function") {
4307143088 return;
4307243089 }
43073- if (target.getAttribute("data-adxconfig-feature-toggle") === "true") {
43074- const featureKey2 = target.getAttribute("data-feature-key") ;
43090+ if (target.dataset?.adxconfigFeatureToggle === "true") {
43091+ const featureKey2 = target.dataset?.featureKey || "" ;
4307543092 if (featureKey2 && typeof runtimeApi.setFeatureEnabled === "function") {
4307643093 withRuntimeCall(
4307743094 runtimeApi.setFeatureEnabled(featureKey2, Boolean(target.checked)),
@@ -43081,12 +43098,12 @@ span.css-3fr5p8{
4308143098 }
4308243099 return;
4308343100 }
43084- if (target.getAttribute("data-adxconfig-setting") !== "true") {
43101+ if (target.dataset?.adxconfigSetting !== "true") {
4308543102 return;
4308643103 }
43087- const featureKey = target.getAttribute("data-feature-key") ;
43088- const configKey = target.getAttribute("data-config-key") ;
43089- const settingKey = target.getAttribute("data-setting-key") ;
43104+ const featureKey = target.dataset?.featureKey || "" ;
43105+ const configKey = target.dataset?.configKey || "" ;
43106+ const settingKey = target.dataset?.settingKey || "" ;
4309043107 if (!featureKey || !configKey || !settingKey || typeof runtimeApi.saveConfig !== "function") {
4309143108 return;
4309243109 }
0 commit comments