From fff95809f536e5248d08728508f13a3e41e0e5f9 Mon Sep 17 00:00:00 2001 From: rordaz Date: Tue, 16 Jun 2026 22:27:11 -0500 Subject: [PATCH] release: prepare v1.0.4 --- main.ts | 104 +--------------------------------------------- manifest.json | 4 +- package-lock.json | 4 +- package.json | 2 +- 4 files changed, 6 insertions(+), 108 deletions(-) diff --git a/main.ts b/main.ts index f0a53cc..1c7349a 100644 --- a/main.ts +++ b/main.ts @@ -376,107 +376,5 @@ class ColorTabSettingTab extends PluginSettingTab { ]; } - // Fallback for Obsidian < 1.13.0 (not called when getSettingDefinitions - // returns a non-empty array on 1.13.0+). - display(): void { - const { containerEl } = this; - containerEl.empty(); - - this.plugin.settings.colors.forEach((entry, index) => { - let hexInputEl: HTMLInputElement; - let colorPickerEl: HTMLInputElement; - let swatchEl: HTMLSpanElement; - - const setting = new Setting(containerEl) - .setName(`Color ${index + 1}`) - // ── Meaning / name field ────────────────────────────────── - .addText((text) => { - text.setPlaceholder("Meaning") - .setValue(entry.name) - .onChange(async (value) => { - this.plugin.settings.colors[index].name = value; - await this.plugin.saveSettings(); - }); - text.inputEl.setCssStyles({ width: "120px" }); - text.inputEl.setAttribute("aria-label", "Color meaning / name"); - }) - // ── Hex code text input ─────────────────────────────────── - .addText((hex) => { - hex.setPlaceholder("#rrggbb") - .setValue(entry.color) - .onChange(async (value) => { - const normalized = value.trim(); - if (!/^#[0-9a-fA-F]{6}$/.test(normalized)) return; - this.plugin.settings.colors[index].color = normalized; - await this.plugin.saveSettings(); - this.plugin.applyAllColors(); - if (colorPickerEl) colorPickerEl.value = normalized; - if (swatchEl) swatchEl.style.backgroundColor = normalized; - }); - hex.inputEl.setCssStyles({ width: "88px", fontFamily: "monospace" }); - hex.inputEl.setAttribute("aria-label", "Hex color code"); - hexInputEl = hex.inputEl; - }) - // ── Color picker ────────────────────────────────────────── - .addColorPicker((picker) => { - picker - .setValue(entry.color) - .onChange(async (value) => { - this.plugin.settings.colors[index].color = value; - await this.plugin.saveSettings(); - this.plugin.applyAllColors(); - if (hexInputEl) hexInputEl.value = value; - if (swatchEl) swatchEl.style.backgroundColor = value; - }); - }); - - // Live swatch preview - swatchEl = setting.controlEl.createEl("span", { - cls: "color-tab-settings-swatch", - }); - swatchEl.style.backgroundColor = entry.color; - - // Grab the native for cross-sync - colorPickerEl = setting.controlEl.querySelector( - "input[type=color]" - ) as HTMLInputElement; - - colorPickerEl?.addEventListener("input", () => { - if (hexInputEl) hexInputEl.value = colorPickerEl.value; - if (swatchEl) swatchEl.style.backgroundColor = colorPickerEl.value; - }); - }); - - new Setting(containerEl) - .setName("Auto-pin colored tabs") - .setDesc( - "When enabled, applying a tab color pins the tab and removing color unpins it." - ) - .addToggle((toggle) => { - toggle - .setValue(this.plugin.settings.autoPinColoredTabs) - .onChange(async (value) => { - this.plugin.settings.autoPinColoredTabs = value; - await this.plugin.saveSettings(); - this.plugin.applyAllColors(); - }); - }); - - new Setting(containerEl) - .setName("Reset to defaults") - .setDesc("Restore the original pastel color palette.") - .addButton((btn) => { - btn.setButtonText("Reset") - .onClick(async () => { - this.plugin.settings.colors = DEFAULT_COLORS.map( - (c) => ({ ...c }) - ); - this.plugin.settings.autoPinColoredTabs = - DEFAULT_SETTINGS.autoPinColoredTabs; - await this.plugin.saveSettings(); - this.plugin.applyAllColors(); - this.display(); - }); - }); - } } + diff --git a/manifest.json b/manifest.json index 4b75e43..777c1a9 100644 --- a/manifest.json +++ b/manifest.json @@ -1,8 +1,8 @@ { "id": "color-tab", "name": "Color Tab", - "version": "1.0.3", - "minAppVersion": "1.0.0", + "version": "1.0.4", + "minAppVersion": "1.13.0", "description": "Colorize open tabs to visually distinguish notes at a glance, using a right-click context menu.", "author": "Rafael Ordaz", "authorUrl": "https://github.com/rordaz", diff --git a/package-lock.json b/package-lock.json index bc08a0e..c45cec5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "color-tab", - "version": "1.0.0", + "version": "1.0.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "color-tab", - "version": "1.0.0", + "version": "1.0.4", "license": "MIT", "devDependencies": { "@types/node": "^16.11.6", diff --git a/package.json b/package.json index d34fadc..e2a65d3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "color-tab", - "version": "1.0.3", + "version": "1.0.4", "description": "Obsidian plugin to colorize open tabs", "main": "main.js", "scripts": {