mirror of
https://github.com/core-hn/pseudobsidian-ization.git
synced 2026-07-22 06:57:06 +00:00
fix: address Obsidian community portal warnings — v0.0.5
- Replace builtin-modules with Node.js native builtinModules - Add @codemirror/view and @codemirror/state to devDependencies - Remove unused imports (MappingFile, MappingStatus, MappingRule, PseudonymizationEngine) - Remove unused variable decision in OccurrencesModal - Use window.setTimeout for popout window compatibility - Use FileManager.trashFile() instead of Vault.delete() - Use activeDocument instead of document for popout window compatibility - Update LICENSE to CC BY 4.0 (recognized by GitHub)
This commit is contained in:
parent
4a4f1a00e4
commit
31a93b00f5
10 changed files with 32 additions and 37 deletions
26
LICENSE
26
LICENSE
|
|
@ -1,18 +1,16 @@
|
|||
-----------------------------------------------------------------------------
|
||||
Code source — The Beerware License (Revision 42)
|
||||
-----------------------------------------------------------------------------
|
||||
Creative Commons Attribution 4.0 International (CC BY 4.0)
|
||||
|
||||
Axelle Abbadie <https://cv.hal.science/axelle-abbadie/> a écrit ce logiciel.
|
||||
Vous pouvez faire ce que vous voulez avec, tant que vous conservez cette notice.
|
||||
Si on se croise un jour et que vous pensez que ça valait le coup,
|
||||
vous pouvez m'offrir une bière.
|
||||
Copyright (c) 2026 Axelle Abbadie
|
||||
https://cv.hal.science/axelle-abbadie/
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
Documentation (SPECS.md, ROADMAP.md, README.md) — CC BY 4.0
|
||||
-----------------------------------------------------------------------------
|
||||
This work is licensed under the Creative Commons Attribution 4.0 International License.
|
||||
|
||||
Creative Commons Attribution 4.0 International
|
||||
https://creativecommons.org/licenses/by/4.0/
|
||||
You are free to:
|
||||
Share — copy and redistribute the material in any medium or format
|
||||
Adapt — remix, transform, and build upon the material for any purpose, even commercially
|
||||
|
||||
Vous êtes libres de partager et d'adapter ces documents, y compris à des fins
|
||||
commerciales, à condition de créditer la source (Axelle Abbadie, PseudObsidian-ization).
|
||||
Under the following terms:
|
||||
Attribution — You must give appropriate credit, provide a link to the license,
|
||||
and indicate if changes were made.
|
||||
|
||||
Full license: https://creativecommons.org/licenses/by/4.0/legalcode
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import esbuild from "esbuild";
|
||||
import process from "process";
|
||||
import builtins from "builtin-modules";
|
||||
import { builtinModules as builtins } from "module";
|
||||
|
||||
const prod = process.argv[2] === "production";
|
||||
|
||||
|
|
|
|||
12
main.js
12
main.js
|
|
@ -446,7 +446,7 @@ var QuickPseudonymizeModal = class extends import_obsidian3.Modal {
|
|||
new import_obsidian3.Setting(contentEl).addButton(
|
||||
(btn) => btn.setButtonText("Pseudonymiser").setCta().onClick(() => this.apply())
|
||||
);
|
||||
setTimeout(() => replacementInput == null ? void 0 : replacementInput.focus(), 50);
|
||||
window.setTimeout(() => replacementInput == null ? void 0 : replacementInput.focus(), 50);
|
||||
}
|
||||
async apply() {
|
||||
const replacement = this.replacement.trim();
|
||||
|
|
@ -763,8 +763,6 @@ var OccurrencesModal = class extends import_obsidian5.Modal {
|
|||
}
|
||||
}
|
||||
buildCard(container, occ, rule) {
|
||||
var _a;
|
||||
const decision = (_a = this.decisions.get(occ.id)) != null ? _a : "validated";
|
||||
const card = container.createDiv();
|
||||
card.addClass("pseudobs-occ-card");
|
||||
const srcLine = card.createDiv();
|
||||
|
|
@ -1197,7 +1195,7 @@ var PseudObsPlugin = class extends import_obsidian7.Plugin {
|
|||
return;
|
||||
if (!CONVERTIBLE_EXTS.includes(file.extension.toLowerCase()))
|
||||
return;
|
||||
setTimeout(() => {
|
||||
window.setTimeout(() => {
|
||||
void this.autoConvert(file);
|
||||
}, 300);
|
||||
})
|
||||
|
|
@ -1347,7 +1345,7 @@ var PseudObsPlugin = class extends import_obsidian7.Plugin {
|
|||
const store = new MappingStore({ type: "file", path: mdPath });
|
||||
await this.app.vault.create(mappingPath, JSON.stringify(store.toJSON(), null, 2));
|
||||
}
|
||||
await this.app.vault.delete(file);
|
||||
await this.app.fileManager.trashFile(file);
|
||||
const mdFile = this.app.vault.getAbstractFileByPath(mdPath);
|
||||
if (mdFile instanceof import_obsidian7.TFile) {
|
||||
await this.app.workspace.getLeaf().openFile(mdFile);
|
||||
|
|
@ -1359,12 +1357,12 @@ var PseudObsPlugin = class extends import_obsidian7.Plugin {
|
|||
}
|
||||
// --- Commande "Ajouter une transcription" ---
|
||||
openFilePicker() {
|
||||
const input = document.createElement("input");
|
||||
const input = activeDocument.createElement("input");
|
||||
input.type = "file";
|
||||
input.accept = ".srt,.cha,.chat,.txt,.md";
|
||||
input.multiple = true;
|
||||
input.classList.add("pseudobs-hidden-input");
|
||||
document.body.appendChild(input);
|
||||
activeDocument.body.appendChild(input);
|
||||
input.addEventListener("change", () => {
|
||||
void this.processFilePicker(input);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "pseudonymizer-tool",
|
||||
"name": "Pseudonymizer Tool",
|
||||
"version": "0.0.4",
|
||||
"version": "0.0.5",
|
||||
"minAppVersion": "1.4.0",
|
||||
"description": "Pseudonymize and correct interactional transcripts (Jefferson, ICOR, SRT, CHAT/CHA). Designed for qualitative researchers in linguistics and conversation analysis.",
|
||||
"author": "Axelle Abbadie",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "pseudonymizer-tool",
|
||||
"version": "0.0.4",
|
||||
"version": "0.0.5",
|
||||
"description": "Plugin Obsidian de pseudonymisation de transcriptions",
|
||||
"author": "Axelle Abbadie",
|
||||
"homepage": "https://cv.hal.science/axelle-abbadie/",
|
||||
|
|
@ -17,7 +17,8 @@
|
|||
"@types/node": "^18.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
||||
"@typescript-eslint/parser": "^5.62.0",
|
||||
"builtin-modules": "^3.3.0",
|
||||
"@codemirror/state": "^6.0.0",
|
||||
"@codemirror/view": "^6.0.0",
|
||||
"esbuild": "^0.20.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-plugin-obsidianmd": "^0.2.9",
|
||||
|
|
|
|||
10
src/main.ts
10
src/main.ts
|
|
@ -15,7 +15,7 @@ import { ScopeResolver } from './mappings/ScopeResolver';
|
|||
import { PseudonymizationEngine } from './pseudonymizer/PseudonymizationEngine';
|
||||
import { findSpansForRule } from './pseudonymizer/ReplacementPlanner';
|
||||
import { applySpans } from './pseudonymizer/SpanProtector';
|
||||
import type { MappingFile, MappingRule, MappingStatus, Occurrence } from './types';
|
||||
import type { MappingRule, MappingStatus, Occurrence } from './types';
|
||||
|
||||
const CONVERTIBLE_EXTS = ['srt', 'cha', 'chat'];
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ export default class PseudObsPlugin extends Plugin {
|
|||
if (!(file instanceof TFile)) return;
|
||||
if (!CONVERTIBLE_EXTS.includes(file.extension.toLowerCase())) return;
|
||||
// Délai court pour laisser Obsidian finir l'écriture du fichier
|
||||
setTimeout(() => { void this.autoConvert(file); }, 300);
|
||||
window.setTimeout(() => { void this.autoConvert(file); }, 300);
|
||||
})
|
||||
);
|
||||
|
||||
|
|
@ -239,7 +239,7 @@ export default class PseudObsPlugin extends Plugin {
|
|||
}
|
||||
|
||||
// Supprimer le fichier source non-Markdown maintenant remplacé par le .md
|
||||
await this.app.vault.delete(file);
|
||||
await this.app.fileManager.trashFile(file);
|
||||
|
||||
// Ouvrir le .md
|
||||
const mdFile = this.app.vault.getAbstractFileByPath(mdPath);
|
||||
|
|
@ -256,13 +256,13 @@ export default class PseudObsPlugin extends Plugin {
|
|||
// --- Commande "Ajouter une transcription" ---
|
||||
|
||||
private openFilePicker(): void {
|
||||
const input = document.createElement('input');
|
||||
const input = activeDocument.createElement('input');
|
||||
input.type = 'file';
|
||||
input.accept = '.srt,.cha,.chat,.txt,.md';
|
||||
input.multiple = true;
|
||||
// Pas de display:none — bloque le change event dans certaines versions d'Electron
|
||||
input.classList.add('pseudobs-hidden-input');
|
||||
document.body.appendChild(input);
|
||||
activeDocument.body.appendChild(input);
|
||||
|
||||
input.addEventListener('change', () => { void this.processFilePicker(input); });
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { App, Modal, Notice, Setting } from 'obsidian';
|
||||
import type PseudObsPlugin from '../main';
|
||||
import type { EntityCategory, MappingRule, ScopeType } from '../types';
|
||||
import type { EntityCategory, ScopeType } from '../types';
|
||||
import type { RuleLocation } from '../mappings/ScopeResolver';
|
||||
|
||||
export class EditRuleModal extends Modal {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { App, Modal, Notice, Setting, TFile } from 'obsidian';
|
||||
import type PseudObsPlugin from '../main';
|
||||
import type { MappingRule, Occurrence, MappingStatus } from '../types';
|
||||
import type { MappingRule, Occurrence } from '../types';
|
||||
import { resolveSpans, applySpans } from '../pseudonymizer/SpanProtector';
|
||||
import type { ReplacementSpan } from '../types';
|
||||
|
||||
|
|
@ -120,8 +120,6 @@ export class OccurrencesModal extends Modal {
|
|||
}
|
||||
|
||||
private buildCard(container: HTMLElement, occ: Occurrence, rule: MappingRule): void {
|
||||
const decision = this.decisions.get(occ.id) ?? 'validated';
|
||||
|
||||
const card = container.createDiv();
|
||||
card.addClass('pseudobs-occ-card');
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import { App, Editor, EditorPosition, Modal, Notice, Setting, TFile } from 'obsidian';
|
||||
import type PseudObsPlugin from '../main';
|
||||
import { MappingStore } from '../mappings/MappingStore';
|
||||
import { PseudonymizationEngine } from '../pseudonymizer/PseudonymizationEngine';
|
||||
import type { EntityCategory, MappingFile } from '../types';
|
||||
|
||||
type ApplyScope = 'occurrence' | 'file';
|
||||
|
|
@ -124,7 +123,7 @@ export class QuickPseudonymizeModal extends Modal {
|
|||
);
|
||||
|
||||
// Focus sur le champ de remplacement à l'ouverture
|
||||
setTimeout(() => replacementInput?.focus(), 50);
|
||||
window.setTimeout(() => replacementInput?.focus(), 50);
|
||||
}
|
||||
|
||||
private async apply(): Promise<void> {
|
||||
|
|
|
|||
|
|
@ -2,5 +2,6 @@
|
|||
"0.0.1": "1.4.0",
|
||||
"0.0.2": "1.4.0",
|
||||
"0.0.3": "1.4.0",
|
||||
"0.0.4": "1.4.0"
|
||||
"0.0.4": "1.4.0",
|
||||
"0.0.5": "1.4.0"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue