From 8839b948290a3a72d2cfa30781a9a380d5709610 Mon Sep 17 00:00:00 2001 From: ccmdi Date: Tue, 12 May 2026 13:49:45 -0400 Subject: [PATCH] chore: plugin lint --- esbuild.config.mjs | 4 +-- package-lock.json | 14 ---------- package.json | 1 - src/main.ts | 2 +- src/map-renderer.ts | 2 +- src/settings/map-settings.ts | 14 +++++----- src/views/map-bases-view.ts | 5 ++-- src/views/map-timeline-bases-view.ts | 2 ++ styles.css | 41 ++++++++++++---------------- 9 files changed, 33 insertions(+), 52 deletions(-) diff --git a/esbuild.config.mjs b/esbuild.config.mjs index 14dce49..cfad538 100644 --- a/esbuild.config.mjs +++ b/esbuild.config.mjs @@ -1,6 +1,6 @@ import esbuild from "esbuild"; import process from "process"; -import builtins from "builtin-modules"; +import { builtinModules } from "node:module"; const banner = `/* @@ -31,7 +31,7 @@ const context = await esbuild.context({ "@lezer/common", "@lezer/highlight", "@lezer/lr", - ...builtins], + ...builtinModules], format: "cjs", target: "es2020", logLevel: "info", diff --git a/package-lock.json b/package-lock.json index 2c8bfa2..5f221fb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,6 @@ }, "devDependencies": { "@types/node": "^16.11.6", - "builtin-modules": "3.3.0", "esbuild": "0.17.3", "eslint": "^9.39.1", "eslint-plugin-obsidianmd": "^0.1.7", @@ -2049,19 +2048,6 @@ "node": ">=0.10.0" } }, - "node_modules/builtin-modules": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", - "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/call-bind": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", diff --git a/package.json b/package.json index f0c925a..512c02b 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,6 @@ "license": "MIT", "devDependencies": { "@types/node": "^16.11.6", - "builtin-modules": "3.3.0", "esbuild": "0.17.3", "eslint": "^9.39.1", "eslint-plugin-obsidianmd": "^0.1.7", diff --git a/src/main.ts b/src/main.ts index e0b0041..37aa061 100644 --- a/src/main.ts +++ b/src/main.ts @@ -21,7 +21,7 @@ export default class MapPlugin extends Plugin { if (this.settings.enableThumbnailCache) { await this.thumbnailCache.loadCache(); - activeWindow.setTimeout(() => { + window.setTimeout(() => { void this.thumbnailCache.generatePendingThumbnails(); }, 2000); } diff --git a/src/map-renderer.ts b/src/map-renderer.ts index 01dea8d..a76dac7 100644 --- a/src/map-renderer.ts +++ b/src/map-renderer.ts @@ -659,7 +659,7 @@ export function createMapRenderer(config: MapRendererOptions): Deck { if (options.onTilesLoaded && !tilesLoadedCalled) { tilesLoadedCalled = true; - activeWindow.setTimeout(() => { + window.setTimeout(() => { options.onTilesLoaded?.(); }, 200); } diff --git a/src/settings/map-settings.ts b/src/settings/map-settings.ts index 1d12dc4..64501cf 100644 --- a/src/settings/map-settings.ts +++ b/src/settings/map-settings.ts @@ -56,7 +56,7 @@ export class MapSettingTab extends PluginSettingTab { .onChange(async (value) => { this.plugin.settings.latKey = value; await this.plugin.saveSettings(); - activeWindow.setTimeout(() => { + window.setTimeout(() => { this.plugin.refreshAllMapViews(); }, 1000); })); @@ -70,7 +70,7 @@ export class MapSettingTab extends PluginSettingTab { .onChange(async (value) => { this.plugin.settings.lngKey = value; await this.plugin.saveSettings(); - activeWindow.setTimeout(() => { + window.setTimeout(() => { this.plugin.refreshAllMapViews(); }, 1000); })); @@ -84,7 +84,7 @@ export class MapSettingTab extends PluginSettingTab { .onChange(async (value) => { this.plugin.settings.strokeWidth = value; await this.plugin.saveSettings(); - activeWindow.setTimeout(() => { + window.setTimeout(() => { this.plugin.refreshAllMapViews(); }, 250); })); @@ -146,7 +146,7 @@ export class MapSettingTab extends PluginSettingTab { if (value) { await this.plugin.thumbnailCache.loadCache(); - activeWindow.setTimeout(() => { + window.setTimeout(() => { void this.plugin.thumbnailCache.generatePendingThumbnails(); }, 500); } @@ -191,7 +191,7 @@ export class MapSettingTab extends PluginSettingTab { const refreshInterval = window.setInterval(() => { updateStatus(); if (this.plugin.thumbnailCache.getCacheStats().pending === 0 && !this.plugin.thumbnailCache.isGenerating()) { - activeWindow.clearInterval(refreshInterval); + window.clearInterval(refreshInterval); this.display(); } }, 500); @@ -208,13 +208,13 @@ export class MapSettingTab extends PluginSettingTab { // force refresh markers for cover context this.plugin.refreshAllMapViews(); - await new Promise(resolve => activeWindow.setTimeout(resolve, 1000)); + await new Promise(resolve => window.setTimeout(resolve, 1000)); await this.plugin.thumbnailCache.rebuildCache((current, total) => { button.setButtonText(`Rebuilding ${current}/${total}...`); }); - activeWindow.clearInterval(progressInterval); + window.clearInterval(progressInterval); button.setButtonText('Rebuild cache'); button.setDisabled(false); this.display(); diff --git a/src/views/map-bases-view.ts b/src/views/map-bases-view.ts index c455d39..7f7a27e 100644 --- a/src/views/map-bases-view.ts +++ b/src/views/map-bases-view.ts @@ -41,6 +41,7 @@ export class MapBasesView extends BasesView { constructor(controller: QueryController, scrollEl: HTMLElement, plugin: MapPlugin) { super(controller); this.scrollEl = scrollEl; + scrollEl.closest('.bases-view')?.addClass('bases-view-map'); this.containerEl = scrollEl.createDiv({ cls: 'bases-map-container is-loading' }); this.mapEl = this.containerEl.createDiv('bases-map'); this.plugin = plugin; @@ -253,7 +254,7 @@ export class MapBasesView extends BasesView { if (overlayHidden) return; overlayHidden = true; loadingOverlay.addClass('fade-out'); - activeWindow.setTimeout(() => { + window.setTimeout(() => { loadingOverlay.remove(); }, 300); }; @@ -310,7 +311,7 @@ export class MapBasesView extends BasesView { this.createSearchBox(); } - activeWindow.setTimeout(() => { + window.setTimeout(() => { if (!tilesLoaded) { hideOverlay(); } diff --git a/src/views/map-timeline-bases-view.ts b/src/views/map-timeline-bases-view.ts index 8f2ff07..25189ce 100644 --- a/src/views/map-timeline-bases-view.ts +++ b/src/views/map-timeline-bases-view.ts @@ -176,9 +176,11 @@ export class MapTimelineBasesView extends MapBasesView { if (this.controlsExpanded) { playbackContainer.addClass('expanded'); toggleButton.addClass('expanded'); + sliderContainer.addClass('has-expanded-controls'); } else { playbackContainer.removeClass('expanded'); toggleButton.removeClass('expanded'); + sliderContainer.removeClass('has-expanded-controls'); } }); diff --git a/styles.css b/styles.css index ab25bd9..2067a16 100644 --- a/styles.css +++ b/styles.css @@ -1,5 +1,5 @@ -.bases-view:has(.bases-map-container) { - padding: 0px; +.bases-view.bases-view-map { + padding: 0px; } .bases-map-container { @@ -365,7 +365,7 @@ top: 6px; right: 6px; width: 320px; - padding: 12px 16px 8px 16px; + padding: 12px 16px 8px; background: var(--background-primary); border: 1px solid var(--background-modifier-border); border-radius: 8px; @@ -377,7 +377,7 @@ transition: padding-bottom 0.3s ease; } -.bases-timeline-slider:has(.timeline-playback-controls.expanded) { +.bases-timeline-slider.has-expanded-controls { padding-bottom: 12px; } @@ -415,11 +415,11 @@ text-align: center; } -.timeline-slider { - width: 100% !important; +.bases-timeline-slider .timeline-slider { + width: 100%; height: 6px; - margin: 0 0 8px 0 !important; - padding: 0 !important; + margin: 0 0 8px; + padding: 0; border-radius: 3px; background: var(--background-modifier-border); outline: none; @@ -461,13 +461,13 @@ justify-content: center; } -.timeline-toggle-button { +.bases-timeline-slider .timeline-toggle-button { width: 100%; height: 14px; padding: 0; margin: 0; border: none; - background: transparent !important; + background: transparent; color: var(--text-faint); cursor: pointer; display: flex; @@ -475,18 +475,18 @@ justify-content: center; transition: color 0.15s ease; outline: none; - box-shadow: none !important; + box-shadow: none; } -.timeline-toggle-button:hover { +.bases-timeline-slider .timeline-toggle-button:hover { color: var(--text-muted); - background: transparent !important; - box-shadow: none !important; + background: transparent; + box-shadow: none; } -.timeline-toggle-button:active { - background: transparent !important; - box-shadow: none !important; +.bases-timeline-slider .timeline-toggle-button:active { + background: transparent; + box-shadow: none; } .timeline-toggle-button svg { @@ -560,13 +560,6 @@ } } -/* should be specific enough */ -.input-row:has(input[placeholder="[[minLat, minLng], [maxLat, maxLng]]"]) .input-row-label::after { - content: " (local images only)"; - color: var(--text-muted); - font-style: italic; - font-size: 0.9em; -} /* Map search box */ .bases-map-search-container {