feat(word-templates): placeholder auto-detection from .docx via JSZip

This commit is contained in:
AI Assistant
2026-02-19 07:02:12 +02:00
parent 67fd88813a
commit 713a66bcd9
4 changed files with 529 additions and 101 deletions

View File

@@ -184,7 +184,7 @@
**Status:** ✅ Done. Created `vcard-export.ts` generating vCard 3.0 (.vcf) with name, org, title, phones, emails, address, website, notes, contact persons. Added Download icon button on card hover. Added detail dialog (FileText icon) showing full contact info + scrollable table of all Registratura entries where this contact appears as sender or recipient (uses `allEntries` to bypass filters). Build ok, pushed.
### 1.10 `[STANDARD]` Word Templates — Placeholder Auto-Detection
### 1.10 `[STANDARD]` Word Templates — Placeholder Auto-Detection
**What:** When a template file URL points to a `.docx`, parse it client-side to extract `{{placeholder}}` patterns and auto-populate the `placeholders[]` field. Use JSZip (already installed) to read the docx XML.
**Files to modify:**
@@ -193,7 +193,7 @@
**Files to create:**
- `src/modules/word-templates/services/placeholder-parser.ts`
---
**Status:** ✅ Done. `placeholder-parser.ts` uses JSZip to read all `word/*.xml` files from the .docx ZIP, searches for `{{...}}` patterns in both raw XML and stripped text (handles Words split-run encoding). Form now has: “Alege fișier .docx” button (local file picker, most reliable — no CORS) and a Wand icon on the URL field for URL-based detection (may fail on CORS). Parsing spinner shown during detection. Detected placeholders auto-populate the field. Build ok, pushed.
### 1.11 `[STANDARD]` Dashboard — Activity Feed + KPI Panels