From 1fad04603bc9b820c64392fb009e90090f2b8c68 Mon Sep 17 00:00:00 2001 From: Nymbo <129332110+Nymbo@users.noreply.github.com> Date: Tue, 12 May 2026 16:55:24 -0400 Subject: [PATCH] Rename plugin to Copy Highlighter --- README.md | 10 +++++----- manifest.json | 6 +++--- package-lock.json | 9 ++++----- package.json | 4 ++-- src/main.ts | 30 +++++++++++++++--------------- styles.css | 10 +++++----- versions.json | 3 ++- 7 files changed, 36 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 6eb0f31..0c07b83 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Copy Flasher +# Copy Highlighter -Copy Flasher highlights text when you copy it in Obsidian, giving a clear visual confirmation that the copy action worked. +Copy Highlighter highlights text when you copy it in Obsidian, giving a clear visual confirmation that the copy action worked. ## Features @@ -14,11 +14,11 @@ Copy Flasher highlights text when you copy it in Obsidian, giving a clear visual Select text in Obsidian and copy it. The selected text is highlighted while the copy shortcut is held, then returns to normal when the keys are released. -For mouse or menu-based copy actions, Copy Flasher uses a short configurable fallback duration because there is no keyboard release event to observe. +For mouse or menu-based copy actions, Copy Highlighter uses a short configurable fallback duration because there is no keyboard release event to observe. ## Settings -Open **Settings -> Community plugins -> Copy Flasher** to customize: +Open **Settings -> Community plugins -> Copy Highlighter** to customize: - Highlight color - Editor opacity @@ -30,7 +30,7 @@ Open **Settings -> Community plugins -> Copy Flasher** to customize: ## Privacy and permissions -Copy Flasher runs entirely inside Obsidian. It does not collect data, send network requests, read your clipboard contents, or access files directly. +Copy Highlighter runs entirely inside Obsidian. It does not collect data, send network requests, read your clipboard contents, or access files directly. ## Development diff --git a/manifest.json b/manifest.json index 5eb631e..15ab225 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { - "id": "copy-flasher", - "name": "Copy Flasher", - "version": "0.1.3", + "id": "copy-highlighter", + "name": "Copy Highlighter", + "version": "0.2.0", "minAppVersion": "0.16.0", "description": "Highlights copied text in Obsidian.", "author": "Nymbo", diff --git a/package-lock.json b/package-lock.json index 562db78..e00233a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,12 @@ { - "name": "copy-flasher", - "version": "0.1.3", + "name": "copy-highlighter", + "version": "0.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "copy-flasher", - "version": "0.1.3", - "description": "Highlights copied text in Obsidian.", + "name": "copy-highlighter", + "version": "0.2.0", "license": "MIT", "dependencies": { "@codemirror/state": "^6.6.0", diff --git a/package.json b/package.json index dbd963a..9a20aec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "copy-flasher", - "version": "0.1.3", + "name": "copy-highlighter", + "version": "0.2.0", "description": "Highlights copied text in Obsidian.", "main": "main.js", "type": "module", diff --git a/src/main.ts b/src/main.ts index 37b7bdd..f66216b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -6,7 +6,7 @@ const LOST_KEYUP_FALLBACK_MS = 5000; const NON_KEYBOARD_COPY_FALLBACK_MS = 650; const MAX_DOM_FLASH_RECTS = 80; -interface CopyFlasherSettings { +interface CopyHighlighterSettings { highlightColor: string; editorOpacity: number; renderedOpacity: number; @@ -23,7 +23,7 @@ type FlashRange = { type ClearHighlight = () => void; -const DEFAULT_SETTINGS: CopyFlasherSettings = { +const DEFAULT_SETTINGS: CopyHighlighterSettings = { highlightColor: "#ffd54f", editorOpacity: 0.5, renderedOpacity: 0.46, @@ -37,7 +37,7 @@ const addFlash = StateEffect.define(); const clearFlash = StateEffect.define(); const flashMark = Decoration.mark({ - class: "copy-flasher-editor-highlight", + class: "copy-highlighter-editor-highlight", }); const flashField = StateField.define({ @@ -76,7 +76,7 @@ class HighlightSession { private cDown = false; private fallbackTimer: number | null = null; - constructor(private getSettings: () => CopyFlasherSettings) {} + constructor(private getSettings: () => CopyHighlighterSettings) {} register(clearHighlight: ClearHighlight) { this.clearers.add(clearHighlight); @@ -208,15 +208,15 @@ function copyFlashExtension(highlightSession: HighlightSession) { ]; } -export default class CopyFlasherPlugin extends Plugin { - settings: CopyFlasherSettings = DEFAULT_SETTINGS; +export default class CopyHighlighterPlugin extends Plugin { + settings: CopyHighlighterSettings = DEFAULT_SETTINGS; private highlightSession = new HighlightSession(() => this.settings); private domHighlights = new Set(); async onload() { await this.loadSettings(); this.applyCssVariables(); - this.addSettingTab(new CopyFlasherSettingTab(this.app, this)); + this.addSettingTab(new CopyHighlighterSettingTab(this.app, this)); this.highlightSession.register(() => { this.clearDomHighlights(); @@ -251,8 +251,8 @@ export default class CopyFlasherPlugin extends Plugin { onunload() { this.clearDomHighlights(); - document.body.style.removeProperty("--copy-flasher-editor-background"); - document.body.style.removeProperty("--copy-flasher-border-radius"); + document.body.style.removeProperty("--copy-highlighter-editor-background"); + document.body.style.removeProperty("--copy-highlighter-border-radius"); } private flashDomSelection(event: ClipboardEvent) { @@ -301,7 +301,7 @@ export default class CopyFlasherPlugin extends Plugin { for (const rect of rects) { const overlay = document.createElement("div"); - overlay.className = "copy-flasher-dom-highlight"; + overlay.className = "copy-highlighter-dom-highlight"; overlay.style.left = `${rect.left + window.scrollX}px`; overlay.style.top = `${rect.top + window.scrollY}px`; overlay.style.width = `${rect.width}px`; @@ -326,7 +326,7 @@ export default class CopyFlasherPlugin extends Plugin { } async loadSettings() { - this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData() as Partial); + this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData() as Partial); } async saveSettings() { @@ -341,18 +341,18 @@ export default class CopyFlasherPlugin extends Plugin { private applyCssVariables() { document.body.style.setProperty( - "--copy-flasher-editor-background", + "--copy-highlighter-editor-background", hexToRgba(this.settings.highlightColor, this.settings.editorOpacity) ); document.body.style.setProperty( - "--copy-flasher-border-radius", + "--copy-highlighter-border-radius", `${this.settings.borderRadius}px` ); } } -class CopyFlasherSettingTab extends PluginSettingTab { - constructor(app: App, private plugin: CopyFlasherPlugin) { +class CopyHighlighterSettingTab extends PluginSettingTab { + constructor(app: App, private plugin: CopyHighlighterPlugin) { super(app, plugin); } diff --git a/styles.css b/styles.css index 532cba2..a873b07 100644 --- a/styles.css +++ b/styles.css @@ -1,12 +1,12 @@ -.copy-flasher-editor-highlight { - background-color: var(--copy-flasher-editor-background, rgba(255, 213, 79, 0.5)); - border-radius: var(--copy-flasher-border-radius, 3px); +.copy-highlighter-editor-highlight { + background-color: var(--copy-highlighter-editor-background, rgba(255, 213, 79, 0.5)); + border-radius: var(--copy-highlighter-border-radius, 3px); } -.copy-flasher-dom-highlight { +.copy-highlighter-dom-highlight { position: absolute; z-index: 9999; pointer-events: none; background-color: rgba(255, 213, 79, 0.46); - border-radius: var(--copy-flasher-border-radius, 3px); + border-radius: var(--copy-highlighter-border-radius, 3px); } diff --git a/versions.json b/versions.json index ea07375..1348715 100644 --- a/versions.json +++ b/versions.json @@ -2,5 +2,6 @@ "0.1.0": "0.15.0", "0.1.1": "0.15.0", "0.1.2": "0.16.0", - "0.1.3": "0.16.0" + "0.1.3": "0.16.0", + "0.2.0": "0.16.0" }