feat(export): themable PDF/Word exports; Windows CI green (v4.7.1)

Export themes:
- Six presets in the export dialog (basic + advanced modes) for PDF/DOCX:
  Default, Modern, Classic, Sepia, Minimal, Elegant
- PDF: LaTeX header (xcolor/titlesec) recolors headings, adds section
  rules and colored links — core-TeX packages only, hex-literal only
  (no injection surface)
- DOCX: styles.xml surgery recolors Heading1-6/Title/Subtitle/Hyperlink
  and swaps heading/body fonts; verified end-to-end against a real
  pandoc-produced docx
- Themes ride along in export presets (unknown ids fall back to Default)

Windows CI fixes:
- pdfjs standardFontDataUrl now a file:// URL (backslash paths failed
  pdfjs's trailing-slash validation, breaking extractText/extractImages)
- sharp temp cleanup EPERM retries; path-separator assertions; pdfjs
  test timeouts raised; batch suite testTimeout 30s

648/648 tests green; 4.7.1 linux+win artifacts rebuilt.
This commit is contained in:
2026-09-05 23:59:53 +05:30
parent 1b2ab7b55c
commit a2455c3f8a
12 changed files with 590 additions and 35 deletions
+9 -1
View File
@@ -15,7 +15,15 @@ describe('ImageOperations', () => {
.png()
.toFile(inputPath);
});
afterEach(() => fs.rmSync(tmpDir, { recursive: true, force: true }));
// Windows: sharp can hold the file handle briefly after await returns,
// so plain rmSync throws EPERM — retry and tolerate stale temp dirs.
afterEach(() => {
try {
fs.rmSync(tmpDir, { recursive: true, force: true, maxRetries: 5, retryDelay: 100 });
} catch {
/* leftover temp dir is cosmetic on locked-file platforms */
}
});
test('imageConvert converts PNG to JPEG', async () => {
const outputPath = path.join(tmpDir, 'out.jpg');