Compare commits

...
10 Commits
Author SHA1 Message Date
amitwh 88e9a5290d fix(renderer): add ensureEditor fallback and fix pandoc export path
1. Source editor blank: Added ensureEditor() method with try-catch that
   lazily creates the CodeMirror editor when setEditorContent is called
   if the initial DOMContentLoaded creation failed or was skipped.
   Replaced inline createEditor calls in createTabElements and
   DOMContentLoaded with ensureEditor().

2. Export via pandoc failing: runPandocCmd parsed the full path
   /bin/linux/pandoc as the command, then prepended it to args because
   parsed.command !== 'pandoc'. This caused pandoc to receive its own
   binary path as the first input file. Fix: use path.basename() to
   check if the command ends with 'pandoc' (or 'pandoc.exe').

Amit Haridas
2026-06-03 20:44:00 +05:30
amitwh fff15d8d3e fix(renderer): add window.electronAPI shim and update CSP for KaTeX
The main window uses nodeIntegration without preload, so window.electronAPI
was undefined. This caused the DOMContentLoaded handler to crash at:
  await window.electronAPI.getAppVersion()
which prevented the CodeMirror editor from being created (blank source
window) and stopped renderer-ready from being sent (broken menu/options).

Fixes:
1. Add window.electronAPI shim at top of renderer.js wrapping ipcRenderer.
2. Update CSP meta tag to allow KaTeX CDN (style-src, script-src, font-src).

Amit Haridas
2026-06-03 15:37:20 +05:30
amitwh c574d77c20 fix(renderer): remove let ModalManager to prevent SyntaxError on load
ModalManager.js is loaded via <script> tag in index.html, which
declares class ModalManager in the global script scope. renderer.js
was then doing 'let ModalManager;' which caused:
  SyntaxError: Identifier 'ModalManager' has already been declared

This prevented renderer.js from executing at all, breaking tabs,
editor, file open, and preview rendering.

Fix: conditionally require ModalManager only if undefined, without
re-declaring. In sloppy mode this safely assigns to the existing global.

Amit Haridas
2026-06-03 15:25:22 +05:30
amitwh 272215f9af fix(renderer): prevent welcome screen from overwriting opened markdown files
The welcome tab setup awaited getAppVersion() inside DOMContentLoaded.
While yielding, the renderer-ready timeout fired, file-opened was processed,
and openFile rendered the markdown. When the welcome setup resumed, it
overwrote tab.content and preview.innerHTML with the welcome screen,
leaving the preview blank.

Fix: only show the welcome screen if the tab is still empty (no filePath
and no content) when the async setup resumes.

Amit Haridas
2026-06-03 15:14:41 +05:30
amitwh 0192590567 fix(renderer): add missing closing brace for redo IPC handler
The ipcRenderer.on('redo') callback was missing its closing });
introduced in a9e05d2, causing SyntaxError: Unexpected end of input.

Amit Haridas
2026-06-03 14:36:59 +05:30
amitwh 96df5652d6 fix: resolve list-directory IPC handler closing brace syntax error 2026-05-26 11:39:57 +05:30
amitwh a9e05d2c0f feat: implement Custom Preview CSS, Reveal.js options, Large File Mode, and Interactive PDF Thumbnail Sidebar 2026-05-25 23:11:47 +05:30
amitwh c982b3e90f chore(diagnostics): add logging to _renderPreview to trace markdown rendering
This will help identify whether the issue is:
1. marked.parse returning a Promise instead of string
2. DOMPurify.sanitize failing
3. The preview element not existing
4. Libraries not being loaded

Amit Haridas
2026-05-25 00:32:27 +05:30
amitwh cfaafc07b2 chore(deps): update vulnerable packages to patched versions
Updated packages:
- simple-git 3.32.3 → 3.36.0 (RCE vulnerability)
- fast-uri 3.1.0 → 3.1.2 (host confusion, path traversal)
- dompurify 3.3.1 → 3.4.5 (XSS bypasses)
- mermaid 11.13.0 → 11.15.0 (CSS injection, DoS)
- uuid 11.1.0 → 11.1.1 (buffer bounds check)
- ws 8.20.0 → 8.20.0 (uninitialized memory)
- ip-address 10.1.0 → 10.2.0 (XSS)
- @xmldom/xmldom 0.8.11 → 0.9.10 (XML injection, DoS)
- docx4js 3.3.0 → 2.0.1 (breaks xml2js dep chain)
- brace-expansion (transitive update)

Also applied lint:fix autofix (const correctness).

Amit Haridas
2026-05-25 00:00:28 +05:30
amitwh 94ad99dc4d fix(renderer): ensure tab content visibility after file open
- Add missing updateUI() call at end of openFile() to set .active class
  on tab content. Without this, the CSS rule .tab-content:not(.active)
  { display: none } kept newly opened files invisible.
- Add diagnostic logging to file-opened IPC handler and openFile()
  to trace future file loading issues.
- Add diagnostic logging to openFileFromPath() in main process.

Amit Haridas
2026-05-24 23:54:31 +05:30
12 changed files with 1181 additions and 578 deletions
+153 -501
View File
@@ -1,12 +1,12 @@
{ {
"name": "markdown-converter", "name": "markdown-converter",
"version": "4.2.0", "version": "4.4.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "markdown-converter", "name": "markdown-converter",
"version": "4.2.0", "version": "4.4.1",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@codemirror/autocomplete": "^6.20.1", "@codemirror/autocomplete": "^6.20.1",
@@ -26,7 +26,7 @@
"codemirror": "^6.0.2", "codemirror": "^6.0.2",
"core-util-is": "^1.0.3", "core-util-is": "^1.0.3",
"docx": "^9.6.0", "docx": "^9.6.0",
"docx4js": "^3.3.0", "docx4js": "^2.0.1",
"dompurify": "^3.3.1", "dompurify": "^3.3.1",
"electron-store": "^10.1.0", "electron-store": "^10.1.0",
"ffmpeg-static": "^5.3.0", "ffmpeg-static": "^5.3.0",
@@ -619,45 +619,12 @@
"integrity": "sha512-jigsZK+sMF/cuiB7sERuo9V7N9jx+dhmHHnQyDSVdpZwVutaBu7WvNYqMDLSgFgfB30n452TP3vjDAvFC973mA==", "integrity": "sha512-jigsZK+sMF/cuiB7sERuo9V7N9jx+dhmHHnQyDSVdpZwVutaBu7WvNYqMDLSgFgfB30n452TP3vjDAvFC973mA==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/@chevrotain/cst-dts-gen": {
"version": "11.1.2",
"resolved": "https://registry.npmjs.org/@chevrotain/cst-dts-gen/-/cst-dts-gen-11.1.2.tgz",
"integrity": "sha512-XTsjvDVB5nDZBQB8o0o/0ozNelQtn2KrUVteIHSlPd2VAV2utEb6JzyCJaJ8tGxACR4RiBNWy5uYUHX2eji88Q==",
"license": "Apache-2.0",
"dependencies": {
"@chevrotain/gast": "11.1.2",
"@chevrotain/types": "11.1.2",
"lodash-es": "4.17.23"
}
},
"node_modules/@chevrotain/gast": {
"version": "11.1.2",
"resolved": "https://registry.npmjs.org/@chevrotain/gast/-/gast-11.1.2.tgz",
"integrity": "sha512-Z9zfXR5jNZb1Hlsd/p+4XWeUFugrHirq36bKzPWDSIacV+GPSVXdk+ahVWZTwjhNwofAWg/sZg58fyucKSQx5g==",
"license": "Apache-2.0",
"dependencies": {
"@chevrotain/types": "11.1.2",
"lodash-es": "4.17.23"
}
},
"node_modules/@chevrotain/regexp-to-ast": {
"version": "11.1.2",
"resolved": "https://registry.npmjs.org/@chevrotain/regexp-to-ast/-/regexp-to-ast-11.1.2.tgz",
"integrity": "sha512-nMU3Uj8naWer7xpZTYJdxbAs6RIv/dxYzkYU8GSwgUtcAAlzjcPfX1w+RKRcYG8POlzMeayOQ/znfwxEGo5ulw==",
"license": "Apache-2.0"
},
"node_modules/@chevrotain/types": { "node_modules/@chevrotain/types": {
"version": "11.1.2", "version": "11.1.2",
"resolved": "https://registry.npmjs.org/@chevrotain/types/-/types-11.1.2.tgz", "resolved": "https://registry.npmjs.org/@chevrotain/types/-/types-11.1.2.tgz",
"integrity": "sha512-U+HFai5+zmJCkK86QsaJtoITlboZHBqrVketcO2ROv865xfCMSFpELQoz1GkX5GzME8pTa+3kbKrZHQtI0gdbw==", "integrity": "sha512-U+HFai5+zmJCkK86QsaJtoITlboZHBqrVketcO2ROv865xfCMSFpELQoz1GkX5GzME8pTa+3kbKrZHQtI0gdbw==",
"license": "Apache-2.0" "license": "Apache-2.0"
}, },
"node_modules/@chevrotain/utils": {
"version": "11.1.2",
"resolved": "https://registry.npmjs.org/@chevrotain/utils/-/utils-11.1.2.tgz",
"integrity": "sha512-4mudFAQ6H+MqBTfqLmU7G1ZwRzCLfJEooL/fsF6rCX5eePMbGhoy5n4g+G4vlh2muDcsCTJtL+uKbOzWxs5LHA==",
"license": "Apache-2.0"
},
"node_modules/@codemirror/autocomplete": { "node_modules/@codemirror/autocomplete": {
"version": "6.20.1", "version": "6.20.1",
"resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.20.1.tgz", "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.20.1.tgz",
@@ -1008,9 +975,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/@electron/asar/node_modules/brace-expansion": { "node_modules/@electron/asar/node_modules/brace-expansion": {
"version": "1.1.12", "version": "1.1.14",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.14.tgz",
"integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "integrity": "sha512-MWPGfDxnyzKU7rNOW9SP/c50vi3xrmrua/+6hfPbCS2ABNWfx24vPidzvC7krjU/RTo235sV776ymlsMtGKj8g==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -1312,9 +1279,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/@electron/universal/node_modules/brace-expansion": { "node_modules/@electron/universal/node_modules/brace-expansion": {
"version": "2.0.2", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.0.tgz",
"integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "integrity": "sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -1398,9 +1365,9 @@
} }
}, },
"node_modules/@electron/windows-sign/node_modules/fs-extra": { "node_modules/@electron/windows-sign/node_modules/fs-extra": {
"version": "11.3.4", "version": "11.3.5",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.4.tgz", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.5.tgz",
"integrity": "sha512-CTXd6rk/M3/ULNQj8FBqBWHYBVYybQ3VPBw0xGKFe3tuH7ytT6ACnvzpIQ3UZtB8yvUKC2cXn1a+x+5EVQLovA==", "integrity": "sha512-eKpRKAovdpZtR1WopLHxlBWvAgPny3c4gX1G5Jhwmmw4XJj0ifSD5qB5TOo8hmA0wlRKDAOAhEE1yVPgs6Fgcg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
@@ -1415,9 +1382,9 @@
} }
}, },
"node_modules/@electron/windows-sign/node_modules/jsonfile": { "node_modules/@electron/windows-sign/node_modules/jsonfile": {
"version": "6.2.0", "version": "6.2.1",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz",
"integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", "integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
@@ -1547,9 +1514,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/@eslint/config-array/node_modules/brace-expansion": { "node_modules/@eslint/config-array/node_modules/brace-expansion": {
"version": "1.1.12", "version": "1.1.14",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.14.tgz",
"integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "integrity": "sha512-MWPGfDxnyzKU7rNOW9SP/c50vi3xrmrua/+6hfPbCS2ABNWfx24vPidzvC7krjU/RTo235sV776ymlsMtGKj8g==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -1628,9 +1595,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/@eslint/eslintrc/node_modules/brace-expansion": { "node_modules/@eslint/eslintrc/node_modules/brace-expansion": {
"version": "1.1.12", "version": "1.1.14",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.14.tgz",
"integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "integrity": "sha512-MWPGfDxnyzKU7rNOW9SP/c50vi3xrmrua/+6hfPbCS2ABNWfx24vPidzvC7krjU/RTo235sV776ymlsMtGKj8g==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -2777,9 +2744,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/@jest/reporters/node_modules/brace-expansion": { "node_modules/@jest/reporters/node_modules/brace-expansion": {
"version": "2.0.2", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.0.tgz",
"integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "integrity": "sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -3184,12 +3151,12 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/@mermaid-js/parser": { "node_modules/@mermaid-js/parser": {
"version": "1.0.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/@mermaid-js/parser/-/parser-1.0.1.tgz", "resolved": "https://registry.npmjs.org/@mermaid-js/parser/-/parser-1.1.1.tgz",
"integrity": "sha512-opmV19kN1JsK0T6HhhokHpcVkqKpF+x2pPDKKM2ThHtZAB5F4PROopk0amuVYK5qMrIA4erzpNm8gmPNJgMDxQ==", "integrity": "sha512-VuHdsYMK1bT6X2JbcAaWAhugTRvRBRyuZgd+c22swUeI9g/ntaxF7CY7dYarhZovofCbUNO0G7JesfmNtjYOCw==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"langium": "^4.0.0" "@chevrotain/types": "~11.1.1"
} }
}, },
"node_modules/@napi-rs/canvas": { "node_modules/@napi-rs/canvas": {
@@ -3559,6 +3526,21 @@
"url": "https://opencollective.com/pkgr" "url": "https://opencollective.com/pkgr"
} }
}, },
"node_modules/@simple-git/args-pathspec": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/@simple-git/args-pathspec/-/args-pathspec-1.0.3.tgz",
"integrity": "sha512-ngJMaHlsWDTfjyq9F3VIQ8b7NXbBLq5j9i5bJ6XLYtD6qlDXT7fdKY2KscWWUF8t18xx052Y/PUO1K1TRc9yKA==",
"license": "MIT"
},
"node_modules/@simple-git/argv-parser": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@simple-git/argv-parser/-/argv-parser-1.1.1.tgz",
"integrity": "sha512-Q9lBcfQ+VQCpQqGJFHe5yooOS5hGdLFFbJ5R+R5aDsnkPCahtn1hSkMcORX65J2Z5lxSkD0lQorMsncuBQxYUw==",
"license": "MIT",
"dependencies": {
"@simple-git/args-pathspec": "^1.0.3"
}
},
"node_modules/@sinclair/typebox": { "node_modules/@sinclair/typebox": {
"version": "0.34.48", "version": "0.34.48",
"resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.48.tgz", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.48.tgz",
@@ -4461,9 +4443,9 @@
} }
}, },
"node_modules/@xmldom/xmldom": { "node_modules/@xmldom/xmldom": {
"version": "0.8.11", "version": "0.8.13",
"resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.11.tgz", "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.13.tgz",
"integrity": "sha512-cQzWCtO6C8TQiYl1ruKNn2U6Ao4o4WBBcbL61yJl84x+j5sOWWFU9X7DpND8XZG3daDppSsigMdfAIl2upQBRw==", "integrity": "sha512-KRYzxepc14G/CEpEGc3Yn+JKaAeT63smlDr+vjB8jRfgTBBI9wRj/nkQEO+ucV8p8I9bfKLWp37uHgFrbntPvw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {
@@ -5132,12 +5114,6 @@
"readable-stream": "^3.4.0" "readable-stream": "^3.4.0"
} }
}, },
"node_modules/boolbase": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
"integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==",
"license": "ISC"
},
"node_modules/boolean": { "node_modules/boolean": {
"version": "3.2.0", "version": "3.2.0",
"resolved": "https://registry.npmjs.org/boolean/-/boolean-3.2.0.tgz", "resolved": "https://registry.npmjs.org/boolean/-/boolean-3.2.0.tgz",
@@ -5148,9 +5124,9 @@
"optional": true "optional": true
}, },
"node_modules/brace-expansion": { "node_modules/brace-expansion": {
"version": "5.0.5", "version": "5.0.6",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.5.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz",
"integrity": "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==", "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -5363,9 +5339,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/cacache/node_modules/brace-expansion": { "node_modules/cacache/node_modules/brace-expansion": {
"version": "2.0.2", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.0.tgz",
"integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "integrity": "sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -5527,22 +5503,6 @@
"integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==",
"license": "Apache-2.0" "license": "Apache-2.0"
}, },
"node_modules/cfb": {
"version": "0.12.1",
"resolved": "https://registry.npmjs.org/cfb/-/cfb-0.12.1.tgz",
"integrity": "sha512-cP+4A0tTqtyza5gJwNwDetZ8FPjl0gPLE7mIxGKyUzOS6HkM23WaAWW/l3t7jIQSMqVXroa09Ey0lo7gV8LNxw==",
"license": "Apache-2.0",
"dependencies": {
"commander": "~2.11.0",
"printj": "~1.1.0"
},
"bin": {
"cfb": "bin/cfb.njs"
},
"engines": {
"node": ">=0.8"
}
},
"node_modules/chalk": { "node_modules/chalk": {
"version": "4.1.2", "version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
@@ -5570,59 +5530,6 @@
"node": ">=10" "node": ">=10"
} }
}, },
"node_modules/cheerio": {
"version": "0.22.0",
"resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.22.0.tgz",
"integrity": "sha512-8/MzidM6G/TgRelkzDG13y3Y9LxBjCb+8yOEZ9+wwq5gVF2w2pV0wmHvjfT0RvuxGyR7UEuK36r+yYMbT4uKgA==",
"license": "MIT",
"dependencies": {
"css-select": "~1.2.0",
"dom-serializer": "~0.1.0",
"entities": "~1.1.1",
"htmlparser2": "^3.9.1",
"lodash.assignin": "^4.0.9",
"lodash.bind": "^4.1.4",
"lodash.defaults": "^4.0.1",
"lodash.filter": "^4.4.0",
"lodash.flatten": "^4.2.0",
"lodash.foreach": "^4.3.0",
"lodash.map": "^4.4.0",
"lodash.merge": "^4.4.0",
"lodash.pick": "^4.2.1",
"lodash.reduce": "^4.4.0",
"lodash.reject": "^4.4.0",
"lodash.some": "^4.4.0"
},
"engines": {
"node": ">= 0.6"
}
},
"node_modules/chevrotain": {
"version": "11.1.2",
"resolved": "https://registry.npmjs.org/chevrotain/-/chevrotain-11.1.2.tgz",
"integrity": "sha512-opLQzEVriiH1uUQ4Kctsd49bRoFDXGGSC4GUqj7pGyxM3RehRhvTlZJc1FL/Flew2p5uwxa1tUDWKzI4wNM8pg==",
"license": "Apache-2.0",
"dependencies": {
"@chevrotain/cst-dts-gen": "11.1.2",
"@chevrotain/gast": "11.1.2",
"@chevrotain/regexp-to-ast": "11.1.2",
"@chevrotain/types": "11.1.2",
"@chevrotain/utils": "11.1.2",
"lodash-es": "4.17.23"
}
},
"node_modules/chevrotain-allstar": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/chevrotain-allstar/-/chevrotain-allstar-0.3.1.tgz",
"integrity": "sha512-b7g+y9A0v4mxCW1qUhf3BSVPg+/NvGErk/dOkrDaHA0nQIQGAtrOjlX//9OQtRlSCy+x9rfB5N8yC71lH1nvMw==",
"license": "MIT",
"dependencies": {
"lodash-es": "^4.17.21"
},
"peerDependencies": {
"chevrotain": "^11.0.0"
}
},
"node_modules/chownr": { "node_modules/chownr": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz", "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz",
@@ -5777,41 +5684,6 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/color": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz",
"integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==",
"license": "MIT",
"dependencies": {
"color-convert": "^1.9.3",
"color-string": "^1.6.0"
}
},
"node_modules/color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"license": "MIT",
"dependencies": {
"color-name": "1.1.3"
}
},
"node_modules/color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
"license": "MIT"
},
"node_modules/color-string": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz",
"integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==",
"license": "MIT",
"dependencies": {
"color-name": "^1.0.0",
"simple-swizzle": "^0.2.2"
}
},
"node_modules/combined-stream": { "node_modules/combined-stream": {
"version": "1.0.8", "version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
@@ -5826,10 +5698,16 @@
} }
}, },
"node_modules/commander": { "node_modules/commander": {
"version": "2.11.0", "version": "9.5.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz",
"integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==",
"license": "MIT" "dev": true,
"license": "MIT",
"optional": true,
"peer": true,
"engines": {
"node": "^12.20.0 || >=14"
}
}, },
"node_modules/compare-version": { "node_modules/compare-version": {
"version": "0.1.2", "version": "0.1.2",
@@ -6046,27 +5924,6 @@
"utrie": "^1.0.2" "utrie": "^1.0.2"
} }
}, },
"node_modules/css-select": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz",
"integrity": "sha512-dUQOBoqdR7QwV90WysXPLXG5LO7nhYBgiWVfxF80DKPF8zx1t/pUd2FYy73emg3zrjtM6dzmYgbHKfV2rxiHQA==",
"license": "BSD-like",
"dependencies": {
"boolbase": "~1.0.0",
"css-what": "2.1",
"domutils": "1.5.1",
"nth-check": "~1.0.1"
}
},
"node_modules/css-what": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.3.tgz",
"integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==",
"license": "BSD-2-Clause",
"engines": {
"node": "*"
}
},
"node_modules/cssstyle": { "node_modules/cssstyle": {
"version": "4.6.0", "version": "4.6.0",
"resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.6.0.tgz", "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.6.0.tgz",
@@ -6862,9 +6719,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/dir-compare/node_modules/brace-expansion": { "node_modules/dir-compare/node_modules/brace-expansion": {
"version": "1.1.12", "version": "1.1.14",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.14.tgz",
"integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "integrity": "sha512-MWPGfDxnyzKU7rNOW9SP/c50vi3xrmrua/+6hfPbCS2ABNWfx24vPidzvC7krjU/RTo235sV776ymlsMtGKj8g==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -6985,16 +6842,14 @@
} }
}, },
"node_modules/docx4js": { "node_modules/docx4js": {
"version": "3.3.0", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/docx4js/-/docx4js-3.3.0.tgz", "resolved": "https://registry.npmjs.org/docx4js/-/docx4js-2.0.1.tgz",
"integrity": "sha512-n+EGNivVW1IqUjkHDCLb7/w2mW47/23PqTbQN0V++WaCyYYMwjAKsDdhUt1TMB67/v5KQS4abkxab1uu4zCtIQ==", "integrity": "sha512-wmo3wCPkz4bTebRLYRBolU2SOmZHK1sZKiz/L96aHaqRhPD79zF8RzUxOveml4k0Hgm2kbPoulWklta6OMeKTQ==",
"license": "MIT", "license": "GPL",
"dependencies": { "dependencies": {
"cfb": "^0.12.1", "jszip": "^2.6.0",
"cheerio": "^0.22.0", "sax": "^1.2.1",
"color": "^3.1.0", "xml2js": "^0.4.17"
"htmlparser2": "^3.9.2",
"jszip": "^2.6.0"
} }
}, },
"node_modules/dom-accessibility-api": { "node_modules/dom-accessibility-api": {
@@ -7004,49 +6859,15 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/dom-serializer": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz",
"integrity": "sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==",
"license": "MIT",
"dependencies": {
"domelementtype": "^1.3.0",
"entities": "^1.1.1"
}
},
"node_modules/domelementtype": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz",
"integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==",
"license": "BSD-2-Clause"
},
"node_modules/domhandler": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz",
"integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==",
"license": "BSD-2-Clause",
"dependencies": {
"domelementtype": "1"
}
},
"node_modules/dompurify": { "node_modules/dompurify": {
"version": "3.3.3", "version": "3.4.5",
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.3.3.tgz", "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.5.tgz",
"integrity": "sha512-Oj6pzI2+RqBfFG+qOaOLbFXLQ90ARpcGG6UePL82bJLtdsa6CYJD7nmiU8MW9nQNOtCHV3lZ/Bzq1X0QYbBZCA==", "integrity": "sha512-OrwIBKsdNSVEeubdJ1HBv/wNENRM9ytAVCv7YXt//A3vPdVMNuACRqK9mXCGCBW2ln7BT/A4X0jXHo2Gu89miA==",
"license": "(MPL-2.0 OR Apache-2.0)", "license": "(MPL-2.0 OR Apache-2.0)",
"optionalDependencies": { "optionalDependencies": {
"@types/trusted-types": "^2.0.7" "@types/trusted-types": "^2.0.7"
} }
}, },
"node_modules/domutils": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz",
"integrity": "sha512-gSu5Oi/I+3wDENBsOWBiRK1eoGxcywYSqg3rR960/+EfY0CF4EX1VPkgHOZ3WiS/Jg2DtliF6BhWcHlfpYUcGw==",
"dependencies": {
"dom-serializer": "0",
"domelementtype": "1"
}
},
"node_modules/dot-prop": { "node_modules/dot-prop": {
"version": "9.0.0", "version": "9.0.0",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-9.0.0.tgz", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-9.0.0.tgz",
@@ -7399,12 +7220,6 @@
"once": "^1.4.0" "once": "^1.4.0"
} }
}, },
"node_modules/entities": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz",
"integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==",
"license": "BSD-2-Clause"
},
"node_modules/env-paths": { "node_modules/env-paths": {
"version": "2.2.1", "version": "2.2.1",
"resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz",
@@ -7480,6 +7295,16 @@
"node": ">= 0.4" "node": ">= 0.4"
} }
}, },
"node_modules/es-toolkit": {
"version": "1.46.1",
"resolved": "https://registry.npmjs.org/es-toolkit/-/es-toolkit-1.46.1.tgz",
"integrity": "sha512-5eNtXOs3tbfxXOj04tjjseeWkRWaoCjdEI+96DgwzZoe6c9juL49pXlzAFTI72aWC9Y8p7168g6XIKjh7k6pyQ==",
"license": "MIT",
"workspaces": [
"docs",
"benchmarks"
]
},
"node_modules/es6-error": { "node_modules/es6-error": {
"version": "4.1.1", "version": "4.1.1",
"resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz",
@@ -7656,9 +7481,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/eslint/node_modules/brace-expansion": { "node_modules/eslint/node_modules/brace-expansion": {
"version": "1.1.12", "version": "1.1.14",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.14.tgz",
"integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "integrity": "sha512-MWPGfDxnyzKU7rNOW9SP/c50vi3xrmrua/+6hfPbCS2ABNWfx24vPidzvC7krjU/RTo235sV776ymlsMtGKj8g==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -7900,9 +7725,9 @@
} }
}, },
"node_modules/fast-uri": { "node_modules/fast-uri": {
"version": "3.1.0", "version": "3.1.2",
"resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz", "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.2.tgz",
"integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==", "integrity": "sha512-rVjf7ArG3LTk+FS6Yw81V1DLuZl1bRbNrev6Tmd/9RaroeeRRJhAt7jg/6YFxbvAQXUCavSoZhPPj6oOx+5KjQ==",
"funding": [ "funding": [
{ {
"type": "github", "type": "github",
@@ -8031,9 +7856,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/filelist/node_modules/brace-expansion": { "node_modules/filelist/node_modules/brace-expansion": {
"version": "2.0.2", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.0.tgz",
"integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "integrity": "sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -8343,9 +8168,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/glob/node_modules/brace-expansion": { "node_modules/glob/node_modules/brace-expansion": {
"version": "1.1.12", "version": "1.1.14",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.14.tgz",
"integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "integrity": "sha512-MWPGfDxnyzKU7rNOW9SP/c50vi3xrmrua/+6hfPbCS2ABNWfx24vPidzvC7krjU/RTo235sV776ymlsMtGKj8g==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -8624,20 +8449,6 @@
"jspdf": "^4.0.0" "jspdf": "^4.0.0"
} }
}, },
"node_modules/htmlparser2": {
"version": "3.10.1",
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz",
"integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==",
"license": "MIT",
"dependencies": {
"domelementtype": "^1.3.1",
"domhandler": "^2.3.0",
"domutils": "^1.5.1",
"entities": "^1.1.1",
"inherits": "^2.0.1",
"readable-stream": "^3.1.1"
}
},
"node_modules/http-cache-semantics": { "node_modules/http-cache-semantics": {
"version": "4.2.0", "version": "4.2.0",
"resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.2.0.tgz", "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.2.0.tgz",
@@ -8860,9 +8671,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/ip-address": { "node_modules/ip-address": {
"version": "10.1.0", "version": "10.2.0",
"resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.1.0.tgz", "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.2.0.tgz",
"integrity": "sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q==", "integrity": "sha512-/+S6j4E9AHvW9SWMSEY9Xfy66O5PWvVEJ08O0y5JGyEKQpojb0K0GKpz/v5HJ/G0vi3D2sjGK78119oXZeE0qA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {
@@ -9320,9 +9131,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/jest-config/node_modules/brace-expansion": { "node_modules/jest-config/node_modules/brace-expansion": {
"version": "2.0.2", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.0.tgz",
"integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "integrity": "sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -9892,9 +9703,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/jest-runtime/node_modules/brace-expansion": { "node_modules/jest-runtime/node_modules/brace-expansion": {
"version": "2.0.2", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.0.tgz",
"integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "integrity": "sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -10417,23 +10228,6 @@
"resolved": "https://registry.npmjs.org/khroma/-/khroma-2.1.0.tgz", "resolved": "https://registry.npmjs.org/khroma/-/khroma-2.1.0.tgz",
"integrity": "sha512-Ls993zuzfayK269Svk9hzpeGUKob/sIgZzyHYdjQoAdQetRKpOLj+k/QQQ/6Qi0Yz65mlROrfd+Ev+1+7dz9Kw==" "integrity": "sha512-Ls993zuzfayK269Svk9hzpeGUKob/sIgZzyHYdjQoAdQetRKpOLj+k/QQQ/6Qi0Yz65mlROrfd+Ev+1+7dz9Kw=="
}, },
"node_modules/langium": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/langium/-/langium-4.2.1.tgz",
"integrity": "sha512-zu9QWmjpzJcomzdJQAHgDVhLGq5bLosVak1KVa40NzQHXfqr4eAHupvnPOVXEoLkg6Ocefvf/93d//SB7du4YQ==",
"license": "MIT",
"dependencies": {
"chevrotain": "~11.1.1",
"chevrotain-allstar": "~0.3.1",
"vscode-languageserver": "~9.0.1",
"vscode-languageserver-textdocument": "~1.0.11",
"vscode-uri": "~3.1.0"
},
"engines": {
"node": ">=20.10.0",
"npm": ">=10.2.3"
}
},
"node_modules/layout-base": { "node_modules/layout-base": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/layout-base/-/layout-base-1.0.2.tgz", "resolved": "https://registry.npmjs.org/layout-base/-/layout-base-1.0.2.tgz",
@@ -10523,9 +10317,9 @@
} }
}, },
"node_modules/lodash": { "node_modules/lodash": {
"version": "4.17.23", "version": "4.18.1",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz",
"integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==", "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==",
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
@@ -10535,77 +10329,11 @@
"integrity": "sha512-J8xewKD/Gk22OZbhpOVSwcs60zhd95ESDwezOFuA3/099925PdHJ7OFHNTGtajL3AlZkykD32HykiMo+BIBI8A==", "integrity": "sha512-J8xewKD/Gk22OZbhpOVSwcs60zhd95ESDwezOFuA3/099925PdHJ7OFHNTGtajL3AlZkykD32HykiMo+BIBI8A==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/lodash.assignin": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/lodash.assignin/-/lodash.assignin-4.2.0.tgz",
"integrity": "sha512-yX/rx6d/UTVh7sSVWVSIMjfnz95evAgDFdb1ZozC35I9mSFCkmzptOzevxjgbQUsc78NR44LVHWjsoMQXy9FDg==",
"license": "MIT"
},
"node_modules/lodash.bind": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/lodash.bind/-/lodash.bind-4.2.1.tgz",
"integrity": "sha512-lxdsn7xxlCymgLYo1gGvVrfHmkjDiyqVv62FAeF2i5ta72BipE1SLxw8hPEPLhD4/247Ijw07UQH7Hq/chT5LA==",
"license": "MIT"
},
"node_modules/lodash.defaults": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz",
"integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==",
"license": "MIT"
},
"node_modules/lodash.filter": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/lodash.filter/-/lodash.filter-4.6.0.tgz",
"integrity": "sha512-pXYUy7PR8BCLwX5mgJ/aNtyOvuJTdZAo9EQFUvMIYugqmJxnrYaANvTbgndOzHSCSR0wnlBBfRXJL5SbWxo3FQ==",
"license": "MIT"
},
"node_modules/lodash.flatten": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz",
"integrity": "sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g==",
"license": "MIT"
},
"node_modules/lodash.foreach": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.foreach/-/lodash.foreach-4.5.0.tgz",
"integrity": "sha512-aEXTF4d+m05rVOAUG3z4vZZ4xVexLKZGF0lIxuHZ1Hplpk/3B6Z1+/ICICYRLm7c41Z2xiejbkCkJoTlypoXhQ==",
"license": "MIT"
},
"node_modules/lodash.map": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz",
"integrity": "sha512-worNHGKLDetmcEYDvh2stPCrrQRkP20E4l0iIS7F8EvzMqBBi7ltvFN5m1HvTf1P7Jk1txKhvFcmYsCr8O2F1Q==",
"license": "MIT"
},
"node_modules/lodash.merge": { "node_modules/lodash.merge": {
"version": "4.6.2", "version": "4.6.2",
"resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
"integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
"license": "MIT" "dev": true,
},
"node_modules/lodash.pick": {
"name": "lodash",
"version": "4.17.23",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz",
"integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==",
"license": "MIT"
},
"node_modules/lodash.reduce": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/lodash.reduce/-/lodash.reduce-4.6.0.tgz",
"integrity": "sha512-6raRe2vxCYBhpBu+B+TtNGUzah+hQjVdu3E17wfusjyrXBka2nBS8OH/gjVZ5PvHOhWmIZTYri09Z6n/QfnNMw==",
"license": "MIT"
},
"node_modules/lodash.reject": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/lodash.reject/-/lodash.reject-4.6.0.tgz",
"integrity": "sha512-qkTuvgEzYdyhiJBx42YPzPo71R1aEr0z79kAv7Ixg8wPFEjgRgJdUsGMG3Hf3OYSF/kHI79XhNlt+5Ar6OzwxQ==",
"license": "MIT"
},
"node_modules/lodash.some": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/lodash.some/-/lodash.some-4.6.0.tgz",
"integrity": "sha512-j7MJE+TuT51q9ggt4fSgVqro163BEFjAt3u97IqU+JA2DkWl80nFTrowzLpZ/BnpN7rrl0JA/593NAdd8p/scQ==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/log-symbols": { "node_modules/log-symbols": {
@@ -10782,14 +10510,14 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/mermaid": { "node_modules/mermaid": {
"version": "11.13.0", "version": "11.15.0",
"resolved": "https://registry.npmjs.org/mermaid/-/mermaid-11.13.0.tgz", "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-11.15.0.tgz",
"integrity": "sha512-fEnci+Immw6lKMFI8sqzjlATTyjLkRa6axrEgLV2yHTfv8r+h1wjFbV6xeRtd4rUV1cS4EpR9rwp3Rci7TRWDw==", "integrity": "sha512-pTMbcf3rWdtLiYGpmoTjHEpeY8seiy6sR+9nD7LOs8KfUbHE4lOUAprTRqRAcWSQ6MQpdX+YEsxShtGsINtPtw==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@braintree/sanitize-url": "^7.1.1", "@braintree/sanitize-url": "^7.1.1",
"@iconify/utils": "^3.0.2", "@iconify/utils": "^3.0.2",
"@mermaid-js/parser": "^1.0.1", "@mermaid-js/parser": "^1.1.1",
"@types/d3": "^7.4.3", "@types/d3": "^7.4.3",
"@upsetjs/venn.js": "^2.0.0", "@upsetjs/venn.js": "^2.0.0",
"cytoscape": "^3.33.1", "cytoscape": "^3.33.1",
@@ -10800,14 +10528,14 @@
"dagre-d3-es": "7.0.14", "dagre-d3-es": "7.0.14",
"dayjs": "^1.11.19", "dayjs": "^1.11.19",
"dompurify": "^3.3.1", "dompurify": "^3.3.1",
"es-toolkit": "^1.45.1",
"katex": "^0.16.25", "katex": "^0.16.25",
"khroma": "^2.1.0", "khroma": "^2.1.0",
"lodash-es": "^4.17.23",
"marked": "^16.3.0", "marked": "^16.3.0",
"roughjs": "^4.6.6", "roughjs": "^4.6.6",
"stylis": "^4.3.6", "stylis": "^4.3.6",
"ts-dedent": "^2.2.0", "ts-dedent": "^2.2.0",
"uuid": "^11.1.0" "uuid": "^11.1.0 || ^12 || ^13 || ^14.0.0"
} }
}, },
"node_modules/mermaid/node_modules/marked": { "node_modules/mermaid/node_modules/marked": {
@@ -11331,18 +11059,6 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/nth-check": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz",
"integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==",
"license": "BSD-2-Clause",
"dependencies": {
"boolbase": "^1.0.0"
},
"funding": {
"url": "https://github.com/fb55/nth-check?sponsor=1"
}
},
"node_modules/nwsapi": { "node_modules/nwsapi": {
"version": "2.2.23", "version": "2.2.23",
"resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.23.tgz", "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.23.tgz",
@@ -11894,18 +11610,6 @@
"node": ">=14.0.0" "node": ">=14.0.0"
} }
}, },
"node_modules/postject/node_modules/commander": {
"version": "9.5.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz",
"integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==",
"dev": true,
"license": "MIT",
"optional": true,
"peer": true,
"engines": {
"node": "^12.20.0 || >=14"
}
},
"node_modules/prelude-ls": { "node_modules/prelude-ls": {
"version": "1.2.1", "version": "1.2.1",
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
@@ -11973,18 +11677,6 @@
"url": "https://github.com/chalk/ansi-styles?sponsor=1" "url": "https://github.com/chalk/ansi-styles?sponsor=1"
} }
}, },
"node_modules/printj": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/printj/-/printj-1.1.2.tgz",
"integrity": "sha512-zA2SmoLaxZyArQTOPj5LXecR+RagfPSU5Kw1qP+jkWeNlrq+eJZyY2oS68SU1Z/7/myXM4lo9716laOFAVStCQ==",
"license": "Apache-2.0",
"bin": {
"printj": "bin/printj.njs"
},
"engines": {
"node": ">=0.8"
}
},
"node_modules/proc-log": { "node_modules/proc-log": {
"version": "5.0.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/proc-log/-/proc-log-5.0.0.tgz", "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-5.0.0.tgz",
@@ -12535,13 +12227,15 @@
"license": "ISC" "license": "ISC"
}, },
"node_modules/simple-git": { "node_modules/simple-git": {
"version": "3.33.0", "version": "3.36.0",
"resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.33.0.tgz", "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.36.0.tgz",
"integrity": "sha512-D4V/tGC2sjsoNhoMybKyGoE+v8A60hRawKQ1iFRA1zwuDgGZCBJ4ByOzZ5J8joBbi4Oam0qiPH+GhzmSBwbJng==", "integrity": "sha512-cGQjLjK8bxJw4QuYT7gxHw3/IouVESbhahSsHrX97MzCL1gu2u7oy38W6L2ZIGECEfIBG4BabsWDPjBxJENv9Q==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@kwsites/file-exists": "^1.1.1", "@kwsites/file-exists": "^1.1.1",
"@kwsites/promise-deferred": "^1.1.1", "@kwsites/promise-deferred": "^1.1.1",
"@simple-git/args-pathspec": "^1.0.3",
"@simple-git/argv-parser": "^1.1.0",
"debug": "^4.4.0" "debug": "^4.4.0"
}, },
"funding": { "funding": {
@@ -12549,21 +12243,6 @@
"url": "https://github.com/steveukx/git-js?sponsor=1" "url": "https://github.com/steveukx/git-js?sponsor=1"
} }
}, },
"node_modules/simple-swizzle": {
"version": "0.2.4",
"resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.4.tgz",
"integrity": "sha512-nAu1WFPQSMNr2Zn9PGSZK9AGn4t/y97lEm+MXTtUDwfP0ksAIX4nO+6ruD9Jwut4C49SB1Ws+fbXsm/yScWOHw==",
"license": "MIT",
"dependencies": {
"is-arrayish": "^0.3.1"
}
},
"node_modules/simple-swizzle/node_modules/is-arrayish": {
"version": "0.3.4",
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.4.tgz",
"integrity": "sha512-m6UrgzFVUYawGBh1dUsWR5M2Clqic9RVXC/9f8ceNlv2IcO9j9J/z8UoCLPqtsPBFNzEpfR3xftohbfqDx8EQA==",
"license": "MIT"
},
"node_modules/simple-update-notifier": { "node_modules/simple-update-notifier": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz",
@@ -13056,9 +12735,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/test-exclude/node_modules/brace-expansion": { "node_modules/test-exclude/node_modules/brace-expansion": {
"version": "1.1.12", "version": "1.1.14",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.14.tgz",
"integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "integrity": "sha512-MWPGfDxnyzKU7rNOW9SP/c50vi3xrmrua/+6hfPbCS2ABNWfx24vPidzvC7krjU/RTo235sV776ymlsMtGKj8g==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -13464,16 +13143,16 @@
} }
}, },
"node_modules/uuid": { "node_modules/uuid": {
"version": "11.1.0", "version": "14.0.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz", "resolved": "https://registry.npmjs.org/uuid/-/uuid-14.0.0.tgz",
"integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==", "integrity": "sha512-Qo+uWgilfSmAhXCMav1uYFynlQO7fMFiMVZsQqZRMIXp0O7rR7qjkj+cPvBHLgBqi960QCoo/PH2/6ZtVqKvrg==",
"funding": [ "funding": [
"https://github.com/sponsors/broofa", "https://github.com/sponsors/broofa",
"https://github.com/sponsors/ctavan" "https://github.com/sponsors/ctavan"
], ],
"license": "MIT", "license": "MIT",
"bin": { "bin": {
"uuid": "dist/esm/bin/uuid" "uuid": "dist-node/bin/uuid"
} }
}, },
"node_modules/v8-to-istanbul": { "node_modules/v8-to-istanbul": {
@@ -13515,55 +13194,6 @@
"license": "MIT", "license": "MIT",
"optional": true "optional": true
}, },
"node_modules/vscode-jsonrpc": {
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz",
"integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==",
"license": "MIT",
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/vscode-languageserver": {
"version": "9.0.1",
"resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-9.0.1.tgz",
"integrity": "sha512-woByF3PDpkHFUreUa7Hos7+pUWdeWMXRd26+ZX2A8cFx6v/JPTtd4/uN0/jB6XQHYaOlHbio03NTHCqrgG5n7g==",
"license": "MIT",
"dependencies": {
"vscode-languageserver-protocol": "3.17.5"
},
"bin": {
"installServerIntoExtension": "bin/installServerIntoExtension"
}
},
"node_modules/vscode-languageserver-protocol": {
"version": "3.17.5",
"resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz",
"integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==",
"license": "MIT",
"dependencies": {
"vscode-jsonrpc": "8.2.0",
"vscode-languageserver-types": "3.17.5"
}
},
"node_modules/vscode-languageserver-textdocument": {
"version": "1.0.12",
"resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.12.tgz",
"integrity": "sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==",
"license": "MIT"
},
"node_modules/vscode-languageserver-types": {
"version": "3.17.5",
"resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz",
"integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==",
"license": "MIT"
},
"node_modules/vscode-uri": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.1.0.tgz",
"integrity": "sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==",
"license": "MIT"
},
"node_modules/w3c-keyname": { "node_modules/w3c-keyname": {
"version": "2.2.8", "version": "2.2.8",
"resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz",
@@ -13755,9 +13385,9 @@
} }
}, },
"node_modules/ws": { "node_modules/ws": {
"version": "8.20.0", "version": "8.21.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.20.0.tgz", "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz",
"integrity": "sha512-sAt8BhgNbzCtgGbt2OxmpuryO63ZoDk/sqaB/znQm94T4fCEsy/yV+7CdC1kJhOU9lboAEU7R3kquuycDoibVA==", "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {
@@ -13804,6 +13434,28 @@
"node": ">=18" "node": ">=18"
} }
}, },
"node_modules/xml2js": {
"version": "0.4.23",
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz",
"integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==",
"license": "MIT",
"dependencies": {
"sax": ">=0.6.0",
"xmlbuilder": "~11.0.0"
},
"engines": {
"node": ">=4.0.0"
}
},
"node_modules/xml2js/node_modules/xmlbuilder": {
"version": "11.0.1",
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz",
"integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==",
"license": "MIT",
"engines": {
"node": ">=4.0"
}
},
"node_modules/xmlbuilder": { "node_modules/xmlbuilder": {
"version": "15.1.1", "version": "15.1.1",
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-15.1.1.tgz", "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-15.1.1.tgz",
+10 -4
View File
@@ -1,6 +1,6 @@
{ {
"name": "markdown-converter", "name": "markdown-converter",
"version": "4.4.1", "version": "4.4.2",
"description": "Professional Markdown editor and universal file converter with PDF editing, batch processing, and syntax highlighting", "description": "Professional Markdown editor and universal file converter with PDF editing, batch processing, and syntax highlighting",
"main": "src/main.js", "main": "src/main.js",
"scripts": { "scripts": {
@@ -73,7 +73,7 @@
"codemirror": "^6.0.2", "codemirror": "^6.0.2",
"core-util-is": "^1.0.3", "core-util-is": "^1.0.3",
"docx": "^9.6.0", "docx": "^9.6.0",
"docx4js": "^3.3.0", "docx4js": "^2.0.1",
"dompurify": "^3.3.1", "dompurify": "^3.3.1",
"electron-store": "^10.1.0", "electron-store": "^10.1.0",
"ffmpeg-static": "^5.3.0", "ffmpeg-static": "^5.3.0",
@@ -170,7 +170,10 @@
"verifyUpdateCodeSignature": false, "verifyUpdateCodeSignature": false,
"signAndEditExecutable": false, "signAndEditExecutable": false,
"extraFiles": [ "extraFiles": [
{ "from": "bin/win32/pandoc.exe", "to": "bin/pandoc.exe" } {
"from": "bin/win32/pandoc.exe",
"to": "bin/pandoc.exe"
}
] ]
}, },
"nsis": { "nsis": {
@@ -198,7 +201,10 @@
"category": "Utility", "category": "Utility",
"maintainer": "ConcreteInfo <amit.wh@gmail.com>", "maintainer": "ConcreteInfo <amit.wh@gmail.com>",
"extraFiles": [ "extraFiles": [
{ "from": "bin/linux/pandoc", "to": "bin/pandoc" } {
"from": "bin/linux/pandoc",
"to": "bin/pandoc"
}
] ]
}, },
"deb": { "deb": {
+58 -1
View File
@@ -4,7 +4,7 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<!-- CSP: unsafe-inline/unsafe-eval required for marked.js extensions and Mermaid --> <!-- CSP: unsafe-inline/unsafe-eval required for marked.js extensions and Mermaid -->
<!-- TODO: Migrate to nonce-based CSP for better security --> <!-- TODO: Migrate to nonce-based CSP for better security -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; font-src 'self' data:; connect-src 'self' https://www.plantuml.com;"> <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdn.jsdelivr.net; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net; img-src 'self' data: blob:; font-src 'self' data: https://cdn.jsdelivr.net; connect-src 'self' https://www.plantuml.com;">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MarkdownConverter</title> <title>MarkdownConverter</title>
<!-- Design tokens - loaded first for CSS variable availability --> <!-- Design tokens - loaded first for CSS variable availability -->
@@ -288,6 +288,52 @@
</div> </div>
</div> </div>
<div class="export-section revealjs-only" style="display: none;">
<label>Reveal.js Options:</label>
<div class="form-row">
<label for="reveal-theme">Slide Theme:</label>
<select id="reveal-theme">
<option value="black">Black</option>
<option value="white">White</option>
<option value="league">League</option>
<option value="beige">Beige</option>
<option value="sky">Sky</option>
<option value="night">Night</option>
<option value="serif">Serif</option>
<option value="simple">Simple</option>
<option value="solarized">Solarized</option>
<option value="blood">Blood</option>
<option value="moon">Moon</option>
</select>
</div>
<div class="form-row">
<label for="reveal-transition">Transition:</label>
<select id="reveal-transition">
<option value="slide">Slide</option>
<option value="none">None</option>
<option value="fade">Fade</option>
<option value="convex">Convex</option>
<option value="concave">Concave</option>
<option value="zoom">Zoom</option>
</select>
</div>
<div class="form-row">
<label for="reveal-speed">Transition Speed:</label>
<select id="reveal-speed">
<option value="default">Default</option>
<option value="fast">Fast</option>
<option value="slow">Slow</option>
</select>
</div>
<div class="checkbox-group">
<label><input type="checkbox" id="reveal-slide-number"> Slide Numbers</label>
<label><input type="checkbox" id="reveal-controls" checked> Controls</label>
<label><input type="checkbox" id="reveal-progress" checked> Progress Bar</label>
<label><input type="checkbox" id="reveal-history" checked> Slide History</label>
<label><input type="checkbox" id="reveal-center" checked> Center Content</label>
</div>
</div>
<div class="export-section"> <div class="export-section">
<label>Bibliography:</label> <label>Bibliography:</label>
<div class="form-row"> <div class="form-row">
@@ -905,6 +951,7 @@
<button class="modal-close" id="pdf-editor-dialog-close" aria-label="Close">&times;</button> <button class="modal-close" id="pdf-editor-dialog-close" aria-label="Close">&times;</button>
</div> </div>
<div class="modal-body pdf-editor-body"> <div class="modal-body pdf-editor-body">
<div class="pdf-editor-left-panel">
<!-- Merge PDFs Section --> <!-- Merge PDFs Section -->
<div id="pdf-merge-section" class="pdf-operation-section hidden"> <div id="pdf-merge-section" class="pdf-operation-section hidden">
<div class="export-section"> <div class="export-section">
@@ -1287,6 +1334,16 @@
</div> </div>
</div> </div>
</div> </div>
<!-- Right Panel: Scrollable Visual Page Sidebar -->
<div id="pdf-thumbnail-sidebar" class="pdf-editor-right-panel hidden">
<h4>Page Preview &amp; Editor</h4>
<p class="sidebar-help">Select a PDF to view pages, check to delete, click ↻ to rotate, and use ◀ / ▶ to reorder.</p>
<div id="pdf-thumbnail-grid" class="pdf-thumbnail-grid">
<!-- Page thumbnail cards will be rendered here dynamically -->
</div>
</div>
</div>
<div class="modal-footer"> <div class="modal-footer">
<button id="pdf-editor-cancel" class="btn btn-secondary" data-close>Cancel</button> <button id="pdf-editor-cancel" class="btn btn-secondary" data-close>Cancel</button>
<button id="pdf-editor-process" class="btn btn-primary">Process</button> <button id="pdf-editor-process" class="btn btn-primary">Process</button>
+64 -4
View File
@@ -242,7 +242,9 @@ function runPandoc(args, callback) {
function runPandocCmd(cmdString, callback) { function runPandocCmd(cmdString, callback) {
const parsed = parseCommand(cmdString); const parsed = parseCommand(cmdString);
// Skip 'pandoc' if it's the first element (command itself) // Skip 'pandoc' if it's the first element (command itself)
const args = parsed.command === 'pandoc' ? parsed.args : [parsed.command, ...parsed.args]; // Use path.basename to handle full paths like bin/linux/pandoc
const cmdBase = path.basename(parsed.command).replace(/\.exe$/i, '');
const args = cmdBase === 'pandoc' ? parsed.args : [parsed.command, ...parsed.args];
const pandocPath = getPandocPath(); const pandocPath = getPandocPath();
execFile(pandocPath, args, { maxBuffer: 10 * 1024 * 1024 }, callback); execFile(pandocPath, args, { maxBuffer: 10 * 1024 * 1024 }, callback);
} }
@@ -849,6 +851,20 @@ function createMenu() {
} }
}, },
{ type: 'separator' }, { type: 'separator' },
{
label: 'Custom Preview CSS',
submenu: [
{
label: 'Load Custom Preview CSS...',
click: () => mainWindow.webContents.send('load-custom-css')
},
{
label: 'Clear Custom Preview CSS',
click: () => mainWindow.webContents.send('clear-custom-css')
}
]
},
{ type: 'separator' },
{ label: 'Reload', accelerator: 'CmdOrCtrl+R', role: 'reload' }, { label: 'Reload', accelerator: 'CmdOrCtrl+R', role: 'reload' },
{ label: 'Toggle DevTools', accelerator: 'F12', role: 'toggleDevTools' }, { label: 'Toggle DevTools', accelerator: 'F12', role: 'toggleDevTools' },
{ type: 'separator' }, { type: 'separator' },
@@ -2297,8 +2313,32 @@ function performExportWithOptions(format, options) {
dialog.showErrorBox('Export Error', sanitizeErrorMessage(`Failed to export: ${err.message}`)); dialog.showErrorBox('Export Error', sanitizeErrorMessage(`Failed to export: ${err.message}`));
} }
} else if (format === 'revealjs') { } else if (format === 'revealjs') {
pandocCmd = `${getPandocPath()} "${currentFile}" -t revealjs -s -o "${outputFile}" --slide-level=2`; let revealCmd = `${getPandocPath()} "${currentFile}" -t revealjs -s -o "${outputFile}" --slide-level=2`;
exportWithPandoc(pandocCmd, outputFile, format); if (options) {
if (options.revealTheme) revealCmd += ` -V theme="${options.revealTheme}"`;
if (options.revealTransition) revealCmd += ` -V transition="${options.revealTransition}"`;
if (options.revealTransitionSpeed) revealCmd += ` -V transitionSpeed="${options.revealTransitionSpeed}"`;
if (options.revealControls !== undefined) revealCmd += ` -V controls="${options.revealControls}"`;
if (options.revealSlideNumber !== undefined) revealCmd += ` -V slideNumber="${options.revealSlideNumber}"`;
if (options.revealProgress !== undefined) revealCmd += ` -V progress="${options.revealProgress}"`;
if (options.revealHistory !== undefined) revealCmd += ` -V history="${options.revealHistory}"`;
if (options.revealCenter !== undefined) revealCmd += ` -V center="${options.revealCenter}"`;
// Support for templates, metadata, bibliography
if (options.template && options.template !== 'default') {
revealCmd += ` --template="${options.template}"`;
}
if (options.metadata) {
for (const [key, value] of Object.entries(options.metadata)) {
if (value.trim()) {
revealCmd += ` -M ${key}="${value.replace(/"/g, '\\"')}"`;
}
}
}
if (options.bibliography) revealCmd += ` --bibliography="${options.bibliography}"`;
if (options.csl) revealCmd += ` --csl="${options.csl}"`;
}
exportWithPandoc(revealCmd, outputFile, format);
} else if (format === 'beamer') { } else if (format === 'beamer') {
pandocCmd = `${getPandocPath()} "${currentFile}" -t beamer -o "${outputFile}"`; pandocCmd = `${getPandocPath()} "${currentFile}" -t beamer -o "${outputFile}"`;
exportWithPandoc(pandocCmd, outputFile, format); exportWithPandoc(pandocCmd, outputFile, format);
@@ -3759,7 +3799,7 @@ app.on('open-file', (event, filePath) => {
// Handle file opening from command line or file association // Handle file opening from command line or file association
function openFileFromPath(filePath) { function openFileFromPath(filePath) {
console.log('[MAIN] openFileFromPath called with:', filePath); console.log('[MAIN] openFileFromPath called with:', filePath);
console.log('[MAIN] rendererReady:', rendererReady, 'mainWindow exists:', !!mainWindow); console.log('[MAIN] rendererReady:', rendererReady, 'mainWindow exists:', !!mainWindow, 'webContents exists:', !!(mainWindow?.webContents));
if (fs.existsSync(filePath)) { if (fs.existsSync(filePath)) {
const stats = fs.statSync(filePath); const stats = fs.statSync(filePath);
if (stats.size > MAX_FILE_SIZE) { if (stats.size > MAX_FILE_SIZE) {
@@ -3769,6 +3809,7 @@ function openFileFromPath(filePath) {
currentFile = filePath; currentFile = filePath;
const content = fs.readFileSync(filePath, 'utf-8'); const content = fs.readFileSync(filePath, 'utf-8');
console.log('[MAIN] File read successfully, content length:', content.length); console.log('[MAIN] File read successfully, content length:', content.length);
console.log('[MAIN] About to send file-opened. mainWindow:', !!mainWindow, 'webContents:', !!(mainWindow?.webContents), 'rendererReady:', rendererReady);
if (mainWindow && mainWindow.webContents && rendererReady) { if (mainWindow && mainWindow.webContents && rendererReady) {
// Send file immediately - renderer-ready means UI is initialized // Send file immediately - renderer-ready means UI is initialized
console.log('[MAIN] Sending file-opened to renderer'); console.log('[MAIN] Sending file-opened to renderer');
@@ -3990,6 +4031,25 @@ ipcMain.handle('list-directory', async (event, dirPath) => {
} }
}); });
ipcMain.handle('select-custom-css', async (event) => {
const result = dialog.showOpenDialogSync(mainWindow, {
title: 'Select Custom Preview CSS',
properties: ['openFile'],
filters: [
{ name: 'CSS Stylesheets', extensions: ['css'] }
]
});
if (result && result[0]) {
const filePath = result[0];
const content = fs.readFileSync(filePath, 'utf-8');
return { path: filePath, content };
}
return null;
});
ipcMain.handle('read-file', async (event, filePath) => { ipcMain.handle('read-file', async (event, filePath) => {
const validation = validatePath(filePath); const validation = validatePath(filePath);
if (!validation.valid || !isPathAccessible(validation.resolved)) { if (!validation.valid || !isPathAccessible(validation.resolved)) {
+2 -2
View File
@@ -60,13 +60,13 @@ async function pdfSplit(data) {
const pdf = await PDFDocument.load(pdfBytes); const pdf = await PDFDocument.load(pdfBytes);
const totalPages = pdf.getPageCount(); const totalPages = pdf.getPageCount();
let splits = []; const splits = [];
if (data.splitMode === 'pages') { if (data.splitMode === 'pages') {
const ranges = data.pageRanges.split(',').map(r => r.trim()); const ranges = data.pageRanges.split(',').map(r => r.trim());
for (let i = 0; i < ranges.length; i++) { for (let i = 0; i < ranges.length; i++) {
const range = ranges[i]; const range = ranges[i];
let pages = []; const pages = [];
if (range.includes('-')) { if (range.includes('-')) {
const [start, end] = range.split('-').map(n => parseInt(n.trim())); const [start, end] = range.split('-').map(n => parseInt(n.trim()));
+3
View File
@@ -23,6 +23,7 @@ const ALLOWED_SEND_CHANNELS = [
'save-recent-files', 'save-recent-files',
'clear-recent-files', 'clear-recent-files',
'renderer-ready', 'renderer-ready',
'select-custom-css',
// Theme // Theme
'get-theme', 'get-theme',
@@ -150,6 +151,8 @@ const ALLOWED_RECEIVE_CHANNELS = [
'get-content-for-save', 'get-content-for-save',
'get-content-for-spreadsheet', 'get-content-for-spreadsheet',
'recent-files-cleared', 'recent-files-cleared',
'load-custom-css',
'clear-custom-css',
// UI toggles // UI toggles
'toggle-preview', 'toggle-preview',
+519 -63
View File
@@ -1,9 +1,20 @@
/** /**
* MarkdownConverter Renderer Process * MarkdownConverter Renderer Process
* @version 4.4.1 * @version 4.4.2
*/ */
const { ipcRenderer } = require('electron'); const { ipcRenderer } = require('electron');
// Shim window.electronAPI for main window which uses nodeIntegration
// without preload script (window.electronAPI is normally set by preload.js).
if (typeof window !== 'undefined' && !window.electronAPI) {
window.electronAPI = {
getAppVersion: () => ipcRenderer.invoke('get-app-version'),
invoke: (channel, data) => ipcRenderer.invoke(channel, data),
on: (channel, callback) => ipcRenderer.on(channel, (event, ...args) => callback(...args))
};
}
const marked = require('marked'); const marked = require('marked');
const { markedHighlight } = require('marked-highlight'); const { markedHighlight } = require('marked-highlight');
const createDOMPurify = require('dompurify'); const createDOMPurify = require('dompurify');
@@ -11,7 +22,13 @@ const DOMPurify = createDOMPurify(window);
const hljs = require('highlight.js'); const hljs = require('highlight.js');
const { createEditor } = require('./editor/codemirror-setup'); const { createEditor } = require('./editor/codemirror-setup');
const { undo, redo } = require('@codemirror/commands'); const { undo, redo } = require('@codemirror/commands');
const { ModalManager } = require('./utils/ModalManager'); // ModalManager is loaded via <script src="utils/ModalManager.js"> in index.html.
// It already exists in the global scope — re-declaring with let/const causes
// SyntaxError: "Identifier 'ModalManager' has already been declared".
if (typeof ModalManager === 'undefined') {
const result = require('./utils/ModalManager');
ModalManager = result.ModalManager || result;
}
// Lazy-loaded modules — defer heavy imports until first use // Lazy-loaded modules — defer heavy imports until first use
let _SidebarManager, _renderTemplatesPanel, _renderExplorerPanel, _renderGitPanel, _renderSnippetsPanel; let _SidebarManager, _renderTemplatesPanel, _renderExplorerPanel, _renderGitPanel, _renderSnippetsPanel;
let _ReplPanel, _CommandPalette, _PrintPreview, _createWelcomeContent; let _ReplPanel, _CommandPalette, _PrintPreview, _createWelcomeContent;
@@ -102,19 +119,24 @@ marked.use({
start(src) { return src.match(/^:::(note|warning|tip|danger|info)/m)?.index; }, start(src) { return src.match(/^:::(note|warning|tip|danger|info)/m)?.index; },
tokenizer(src) { tokenizer(src) {
const match = src.match(/^:::(note|warning|tip|danger|info)\s*\n([\s\S]*?)^:::\s*$/m); const match = src.match(/^:::(note|warning|tip|danger|info)\s*\n([\s\S]*?)^:::\s*$/m);
if (match) { if (match && match.index === 0) {
const admonitionType = match[1];
const text = match[2].trim();
const tokens = [];
this.lexer.blockTokens(text, tokens);
return { return {
type: 'admonition', type: 'admonition',
raw: match[0], raw: match[0],
admonitionType: match[1], admonitionType,
text: match[2].trim() text,
tokens
}; };
} }
}, },
renderer(token) { renderer(token) {
const icons = { note: '\u2139', warning: '\u26A0', tip: '\uD83D\uDCA1', danger: '\uD83D\uDD34', info: '\u2139' }; const icons = { note: '\u2139', warning: '\u26A0', tip: '\uD83D\uDCA1', danger: '\uD83D\uDD34', info: '\u2139' };
const icon = icons[token.admonitionType] || '\u2139'; const icon = icons[token.admonitionType] || '\u2139';
const inner = this.parser.parse(token.text); const inner = this.parser.parse(token.tokens || []);
return `<div class="admonition admonition-${token.admonitionType}"> return `<div class="admonition admonition-${token.admonitionType}">
<div class="admonition-title">${icon} ${token.admonitionType.charAt(0).toUpperCase() + token.admonitionType.slice(1)}</div> <div class="admonition-title">${icon} ${token.admonitionType.charAt(0).toUpperCase() + token.admonitionType.slice(1)}</div>
<div class="admonition-content">${inner}</div> <div class="admonition-content">${inner}</div>
@@ -131,8 +153,20 @@ function plantumlEncode(text) {
return '~h' + hex; return '~h' + hex;
} }
// Scopes user custom CSS by prefixing all selectors to protect application UI
function scopeCSS(cssText, scopeSelector) {
if (!cssText) return '';
return cssText.replace(/([^\r\n,{}]+)(,(?=[^}]*{)|(?=[^{]*{))/g, (match, selector, separator) => {
const trimmed = selector.trim();
if (!trimmed || trimmed.startsWith('@') || trimmed.startsWith(':root') || trimmed.startsWith('from') || trimmed.startsWith('to') || /^\d+%$/.test(trimmed)) {
return match;
}
return scopeSelector + ' ' + trimmed + (separator || '');
});
}
// Module-level reference set by DOMContentLoaded after sidebar registration // Module-level reference set by DOMContentLoaded after sidebar registration
let outlinePanelContainer = null; const outlinePanelContainer = null;
// Tab Management // Tab Management
class TabManager { class TabManager {
@@ -147,6 +181,7 @@ class TabManager {
this.recentFiles = JSON.parse(localStorage.getItem('recentFiles') || '[]'); this.recentFiles = JSON.parse(localStorage.getItem('recentFiles') || '[]');
this.previewDebounceTimers = new Map(); // Debounce timers per tab this.previewDebounceTimers = new Map(); // Debounce timers per tab
this.previewDebounceDelay = 300; // 300ms debounce this.previewDebounceDelay = 300; // 300ms debounce
this.previewCache = new Map(); // Performance optimization render cache
// Initialize first tab // Initialize first tab
this.tabs.set(1, { this.tabs.set(1, {
@@ -230,7 +265,7 @@ class TabManager {
editorView: null, editorView: null,
findMatches: [], findMatches: [],
currentMatchIndex: -1, currentMatchIndex: -1,
type: type, type: type, // 'markdown' or 'pdf'
// PDF-specific state // PDF-specific state
pdfDoc: null, pdfDoc: null,
pdfCurrentPage: 1, pdfCurrentPage: 1,
@@ -243,6 +278,7 @@ class TabManager {
this.switchToTab(newTabId); this.switchToTab(newTabId);
this.startAutoSave(); this.startAutoSave();
this.updateTabBar(); this.updateTabBar();
console.log('createNewTab: tab created with type:', type);
} }
createPdfTab(filePath) { createPdfTab(filePath) {
@@ -454,27 +490,7 @@ class TabManager {
document.querySelector('.editor-container').appendChild(tabContent); document.querySelector('.editor-container').appendChild(tabContent);
// Initialize CodeMirror editor // Initialize CodeMirror editor
const editorContainer = document.getElementById(`editor-cm-${tab.id}`); this.ensureEditor(tab);
if (editorContainer) {
const isDark = document.body.className.includes('dark');
tab.editorView = createEditor(editorContainer, {
content: tab.content,
onChange: (newContent) => {
tab.content = newContent;
tab.isDirty = true;
this.updatePreview(tab.id);
this.updateWordCount();
this.updateTabBar();
if (outlinePanelContainer?._refreshOutline) outlinePanelContainer._refreshOutline();
},
onUpdate: (view) => {
this.updateCursorPosition(view);
if (outlinePanelContainer?._setActiveHeading) outlinePanelContainer._setActiveHeading(view.state.doc.lineAt(view.state.selection.main.head).number);
},
isDark,
showLineNumbers: this.showLineNumbers,
});
}
} }
switchToTab(tabId) { switchToTab(tabId) {
@@ -660,6 +676,11 @@ class TabManager {
const tab = this.tabs.get(tabId); const tab = this.tabs.get(tabId);
if (!tab || tab.type === 'pdf') return; if (!tab || tab.type === 'pdf') return;
// Guard against auto-renders in large file mode
if (tab.largeFileMode && !immediate) {
return;
}
// Clear existing debounce timer for this tab // Clear existing debounce timer for this tab
if (this.previewDebounceTimers.has(tabId)) { if (this.previewDebounceTimers.has(tabId)) {
clearTimeout(this.previewDebounceTimers.get(tabId)); clearTimeout(this.previewDebounceTimers.get(tabId));
@@ -678,20 +699,55 @@ class TabManager {
}, this.previewDebounceDelay)); }, this.previewDebounceDelay));
} }
_hash(str) {
if (!str) return 0;
let hash = 0;
for (let i = 0; i < str.length; i++) {
hash = ((hash << 5) - hash) + str.charCodeAt(i);
hash |= 0; // Convert to 32bit integer
}
return hash;
}
_renderPreview(tabId) { _renderPreview(tabId) {
const tab = this.tabs.get(tabId); const tab = this.tabs.get(tabId);
const preview = document.getElementById(`preview-${tabId}`); const preview = document.getElementById(`preview-${tabId}`);
console.log('[_renderPreview] tabId:', tabId, 'tab exists:', !!tab, 'preview exists:', !!preview, 'content length:', tab?.content?.length);
if (!tab || !preview) return; if (!tab || !preview) return;
try { try {
// Check if libraries are available // Check if libraries are available
if (!marked || !DOMPurify) { if (!marked || !DOMPurify) {
console.error('[_renderPreview] Libraries not available:', { marked: !!marked, DOMPurify: !!DOMPurify });
preview.innerHTML = '<div class="preview-error"><div class="preview-error-icon">⚠️</div><div class="preview-error-title">Libraries Not Loaded</div><div class="preview-error-message">Required libraries (marked/DOMPurify) could not be loaded. Please check your installation.</div></div>'; preview.innerHTML = '<div class="preview-error"><div class="preview-error-icon">⚠️</div><div class="preview-error-title">Libraries Not Loaded</div><div class="preview-error-message">Required libraries (marked/DOMPurify) could not be loaded. Please check your installation.</div></div>';
return; return;
} }
const html = marked.parse(tab.content);
let sanitizedHtml = DOMPurify.sanitize(html); // Cache lookup
const contentHash = this._hash(tab.content);
let sanitizedHtml;
if (this.previewCache.has(contentHash)) {
console.log('[_renderPreview] Cache hit for hash:', contentHash);
sanitizedHtml = this.previewCache.get(contentHash);
} else {
console.log('[_renderPreview] Cache miss. About to call marked.parse, content length:', tab.content.length);
const html = marked.parse(tab.content);
console.log('[_renderPreview] marked.parse returned type:', typeof html, 'isPromise:', html instanceof Promise);
if (html instanceof Promise) {
console.error('[_renderPreview] marked.parse returned a Promise! Need to await it.');
return;
}
sanitizedHtml = DOMPurify.sanitize(html);
console.log('[_renderPreview] DOMPurify.sanitize returned, length:', sanitizedHtml.length);
// Add to cache and maintain cache size limit (100 entries)
this.previewCache.set(contentHash, sanitizedHtml);
if (this.previewCache.size > 100) {
const oldestKey = this.previewCache.keys().next().value;
this.previewCache.delete(oldestKey);
}
}
// TOC generation // TOC generation
if (sanitizedHtml.includes('[[toc]]') || sanitizedHtml.includes('[TOC]')) { if (sanitizedHtml.includes('[[toc]]') || sanitizedHtml.includes('[TOC]')) {
@@ -1327,10 +1383,22 @@ class TabManager {
} }
} }
checkForLargeFile(tab, content) {
if (content && content.length > 1024 * 1024) { // >1MB
tab.largeFileMode = true;
this.isPreviewVisible = false;
this.updatePreviewVisibility();
notifyUser('Large file detected (>1MB). Large File Mode enabled to maintain peak responsiveness. Live preview auto-render is disabled.', 'warning');
} else {
tab.largeFileMode = false;
}
}
// File operations // File operations
openFile(filePath, content) { openFile(filePath, content) {
console.log('openFile called with:', filePath, 'content length:', content.length); console.log('openFile called with:', filePath, 'content length:', content.length);
let tab = this.tabs.get(this.activeTabId); let tab = this.tabs.get(this.activeTabId);
console.log('openFile tab state before:', { id: tab?.id, hasEditorView: !!tab?.editorView, contentLength: tab?.content?.length, filePath: tab?.filePath, isDirty: tab?.isDirty });
// Handle both forward and back slashes for cross-platform compatibility // Handle both forward and back slashes for cross-platform compatibility
const fileName = filePath.split(/[\\/]/).pop(); const fileName = filePath.split(/[\\/]/).pop();
@@ -1344,24 +1412,31 @@ class TabManager {
tab.originalContent = content; tab.originalContent = content;
tab.isDirty = false; tab.isDirty = false;
this.checkForLargeFile(tab, content);
// Update the editor and preview // Update the editor and preview
this.setEditorContent(this.activeTabId, content); this.setEditorContent(this.activeTabId, content);
this.updatePreview(this.activeTabId); console.log('openFile after setEditorContent, tab state:', { id: tab.id, hasEditorView: !!tab.editorView, contentLength: tab.content.length });
this.updatePreview(this.activeTabId, true); // immediate=true for initial load
this.updateWordCount(); this.updateWordCount();
} else { } else {
// Create new tab for the file // Create new tab for the file
console.log('Creating new tab for file'); console.log('Creating new tab for file');
this.createNewTab(); this.createNewTab();
tab = this.tabs.get(this.activeTabId); tab = this.tabs.get(this.activeTabId);
console.log('openFile after createNewTab, tab:', { id: tab.id, hasEditorView: !!tab.editorView });
tab.filePath = filePath; tab.filePath = filePath;
tab.title = fileName; tab.title = fileName;
tab.content = content; tab.content = content;
tab.originalContent = content; tab.originalContent = content;
tab.isDirty = false; tab.isDirty = false;
this.checkForLargeFile(tab, content);
// Set content in the CodeMirror editor // Set content in the CodeMirror editor
this.setEditorContent(this.activeTabId, content); this.setEditorContent(this.activeTabId, content);
this.updatePreview(this.activeTabId); console.log('openFile after setEditorContent, tab state:', { id: tab.id, hasEditorView: !!tab.editorView, contentLength: tab.content.length });
this.updatePreview(this.activeTabId, true); // immediate=true for initial load
this.updateWordCount(); this.updateWordCount();
} }
this.startAutoSave(); this.startAutoSave();
@@ -1369,6 +1444,7 @@ class TabManager {
this.updateTabBar(); this.updateTabBar();
this.updateFilePath(); this.updateFilePath();
this.updateBreadcrumb(); this.updateBreadcrumb();
this.updateUI(); // Ensure tab content is visible
// Notify main process about current file for exports // Notify main process about current file for exports
ipcRenderer.send('set-current-file', filePath); ipcRenderer.send('set-current-file', filePath);
@@ -1385,9 +1461,47 @@ class TabManager {
return tab?.content || ''; return tab?.content || '';
} }
// Ensure a tab has a CodeMirror editor (lazy creation fallback)
ensureEditor(tab) {
if (tab.editorView) return true;
const editorContainer = document.getElementById(`editor-cm-${tab.id}`);
if (!editorContainer) {
console.error(`[ensureEditor] editor-cm-${tab.id} not found in DOM`);
return false;
}
try {
const isDark = document.body.className.includes('dark');
tab.editorView = createEditor(editorContainer, {
content: tab.content,
onChange: (newContent) => {
tab.content = newContent;
tab.isDirty = true;
this.updatePreview(tab.id);
this.updateWordCount();
this.updateTabBar();
if (outlinePanelContainer?._refreshOutline) outlinePanelContainer._refreshOutline();
},
onUpdate: (view) => {
this.updateCursorPosition(view);
if (outlinePanelContainer?._setActiveHeading) outlinePanelContainer._setActiveHeading(view.state.doc.lineAt(view.state.selection.main.head).number);
},
isDark,
showLineNumbers: this.showLineNumbers,
});
console.log(`[ensureEditor] Created editor for tab ${tab.id}`);
return true;
} catch (err) {
console.error(`[ensureEditor] Failed to create editor for tab ${tab.id}:`, err);
return false;
}
}
// Set content in editor // Set content in editor
setEditorContent(tabId, content) { setEditorContent(tabId, content) {
const tab = this.tabs.get(tabId); const tab = this.tabs.get(tabId);
if (!tab?.editorView) {
this.ensureEditor(tab);
}
if (tab?.editorView) { if (tab?.editorView) {
tab.editorView.dispatch({ tab.editorView.dispatch({
changes: { from: 0, to: tab.editorView.state.doc.length, insert: content } changes: { from: 0, to: tab.editorView.state.doc.length, insert: content }
@@ -1445,6 +1559,13 @@ let replPanel;
document.addEventListener('DOMContentLoaded', async () => { document.addEventListener('DOMContentLoaded', async () => {
tabManager = new TabManager(); tabManager = new TabManager();
// Load saved Custom Preview CSS if present
const savedCSSContent = localStorage.getItem('customPreviewCSSContent');
if (savedCSSContent) {
applyCustomPreviewCSS(savedCSSContent);
}
const ReplPanel = getReplPanel(); const ReplPanel = getReplPanel();
replPanel = new ReplPanel(); replPanel = new ReplPanel();
@@ -1483,7 +1604,7 @@ document.addEventListener('DOMContentLoaded', async () => {
// Initialize sidebar // Initialize sidebar
const SidebarManager = getSidebarManager(); const SidebarManager = getSidebarManager();
const sidebarManager = new SidebarManager(); const sidebarManager = new SidebarManager();
let explorerCurrentDir = null; const explorerCurrentDir = null;
sidebarManager.registerPanel('explorer', { sidebarManager.registerPanel('explorer', {
title: 'Explorer', title: 'Explorer',
@@ -1624,7 +1745,8 @@ document.addEventListener('DOMContentLoaded', async () => {
const welcomeHtml = getCreateWelcomeContent()(recentFiles, appVersion); const welcomeHtml = getCreateWelcomeContent()(recentFiles, appVersion);
const tab = tabManager.tabs.get(tabManager.activeTabId); const tab = tabManager.tabs.get(tabManager.activeTabId);
if (tab) { // Only show welcome if no file was opened while we were awaiting
if (tab && !tab.filePath && tab.content === '') {
tab.title = 'Welcome'; tab.title = 'Welcome';
tab.content = ''; tab.content = '';
const preview = document.getElementById(`preview-${tab.id}`); const preview = document.getElementById(`preview-${tab.id}`);
@@ -1766,6 +1888,8 @@ document.addEventListener('DOMContentLoaded', async () => {
commandPalette.register('Insert Image', '', () => tabManager.wrapSelection('![', '](image.jpg)')); commandPalette.register('Insert Image', '', () => tabManager.wrapSelection('![', '](image.jpg)'));
commandPalette.register('Toggle Zen Mode', 'F11', () => zenMode.toggle()); commandPalette.register('Toggle Zen Mode', 'F11', () => zenMode.toggle());
commandPalette.register('Writing Analytics', 'Ctrl+Shift+A', () => getShowAnalyticsModal()(tabManager)); commandPalette.register('Writing Analytics', 'Ctrl+Shift+A', () => getShowAnalyticsModal()(tabManager));
commandPalette.register('Load Custom Preview CSS', '', triggerLoadCustomCSS);
commandPalette.register('Clear Custom Preview CSS', '', triggerClearCustomCSS);
// Keyboard shortcuts // Keyboard shortcuts
document.addEventListener('keydown', (e) => { document.addEventListener('keydown', (e) => {
@@ -1791,27 +1915,9 @@ document.addEventListener('DOMContentLoaded', async () => {
}); });
// Initialize CodeMirror for the initial tab (tab 1) // Initialize CodeMirror for the initial tab (tab 1)
const initialEditorContainer = document.getElementById('editor-cm-1'); const initialTab = tabManager.tabs.get(1);
if (initialEditorContainer) { if (initialTab) {
const tab = tabManager.tabs.get(1); tabManager.ensureEditor(initialTab);
const isDark = document.body.className.includes('dark');
tab.editorView = createEditor(initialEditorContainer, {
content: tab.content,
onChange: (newContent) => {
tab.content = newContent;
tab.isDirty = true;
tabManager.updatePreview(tab.id);
tabManager.updateWordCount();
tabManager.updateTabBar();
if (outlinePanelContainer?._refreshOutline) outlinePanelContainer._refreshOutline();
},
onUpdate: (view) => {
tabManager.updateCursorPosition(view);
if (outlinePanelContainer?._setActiveHeading) outlinePanelContainer._setActiveHeading(view.state.doc.lineAt(view.state.selection.main.head).number);
},
isDark,
showLineNumbers: tabManager.showLineNumbers,
});
} }
// Request current theme // Request current theme
@@ -1835,6 +1941,7 @@ document.addEventListener('DOMContentLoaded', async () => {
}, 30000); }, 30000);
}); });
// IPC event listeners
// IPC event listeners // IPC event listeners
ipcRenderer.on('file-new', () => { ipcRenderer.on('file-new', () => {
tabManager.createNewTab(); tabManager.createNewTab();
@@ -1842,8 +1949,20 @@ ipcRenderer.on('file-new', () => {
ipcRenderer.on('file-opened', (event, data) => { ipcRenderer.on('file-opened', (event, data) => {
console.log('[RENDERER] file-opened received:', data.path, 'content length:', data.content.length); console.log('[RENDERER] file-opened received:', data.path, 'content length:', data.content.length);
console.log('[RENDERER] activeTabId before openFile:', tabManager.activeTabId);
// Diagnostic: check library state
console.log('[RENDERER] Library state:', {
marked: typeof marked,
DOMPurify: typeof DOMPurify,
markedParse: typeof marked?.parse,
dompurifySanitize: typeof DOMPurify?.sanitize,
tabManagerExists: !!tabManager
});
if (tabManager) { if (tabManager) {
tabManager.openFile(data.path, data.content); tabManager.openFile(data.path, data.content);
console.log('[RENDERER] activeTabId after openFile:', tabManager.activeTabId);
const tab = tabManager.tabs.get(tabManager.activeTabId);
console.log('[RENDERER] tab state:', { id: tab?.id, hasEditorView: !!tab?.editorView, contentLength: tab?.content?.length });
} else { } else {
console.error('[RENDERER] tabManager not initialized!'); console.error('[RENDERER] tabManager not initialized!');
} }
@@ -1922,6 +2041,49 @@ ipcRenderer.on('redo', () => {
} }
}); });
// Custom Preview CSS event handlers and trigger helpers
function applyCustomPreviewCSS(cssContent) {
let styleTag = document.getElementById('custom-preview-style');
if (!styleTag) {
styleTag = document.createElement('style');
styleTag.id = 'custom-preview-style';
document.head.appendChild(styleTag);
}
const scopedCSS = scopeCSS(cssContent, '.preview-content');
styleTag.textContent = scopedCSS;
}
async function triggerLoadCustomCSS() {
try {
const result = await window.electronAPI.invoke('select-custom-css');
if (result) {
console.log('[RENDERER] Custom CSS loaded from:', result.path);
localStorage.setItem('customPreviewCSSPath', result.path);
localStorage.setItem('customPreviewCSSContent', result.content);
applyCustomPreviewCSS(result.content);
notifyUser('Custom preview stylesheet applied successfully.', 'success');
}
} catch (err) {
console.error('[RENDERER] Error loading custom CSS:', err);
notifyUser('Failed to load custom CSS stylesheet.', 'error');
}
}
function triggerClearCustomCSS() {
localStorage.removeItem('customPreviewCSSPath');
localStorage.removeItem('customPreviewCSSContent');
const styleTag = document.getElementById('custom-preview-style');
if (styleTag) {
styleTag.remove();
}
notifyUser('Custom preview stylesheet cleared.', 'info');
}
ipcRenderer.on('load-custom-css', triggerLoadCustomCSS);
ipcRenderer.on('clear-custom-css', triggerClearCustomCSS);
// Font size adjustment // Font size adjustment
let currentFontSize = parseInt(localStorage.getItem('fontSize')) || 15; let currentFontSize = parseInt(localStorage.getItem('fontSize')) || 15;
@@ -2041,13 +2203,39 @@ function initializeExportForm(format) {
document.getElementById('export-citeproc').checked = false; document.getElementById('export-citeproc').checked = false;
document.getElementById('export-toc-depth').value = 3; document.getElementById('export-toc-depth').value = 3;
// PDF-specific fields // Toggle and reset PDF-specific fields
const pdfOnly = document.querySelector('.pdf-only');
if (pdfOnly) {
pdfOnly.style.display = (format === 'pdf') ? 'block' : 'none';
}
if (format === 'pdf') { if (format === 'pdf') {
document.getElementById('pdf-engine').value = 'xelatex'; document.getElementById('pdf-engine').value = 'xelatex';
document.getElementById('pdf-geometry').value = 'margin=1in'; document.getElementById('pdf-geometry').value = 'margin=1in';
document.getElementById('custom-geometry').style.display = 'none'; document.getElementById('custom-geometry').style.display = 'none';
} }
// Toggle and reset Reveal.js-specific fields
const revealjsOnly = document.querySelector('.revealjs-only');
if (revealjsOnly) {
revealjsOnly.style.display = (format === 'revealjs') ? 'block' : 'none';
}
const revealTheme = document.getElementById('reveal-theme');
if (revealTheme) revealTheme.value = 'black';
const revealTransition = document.getElementById('reveal-transition');
if (revealTransition) revealTransition.value = 'slide';
const revealSpeed = document.getElementById('reveal-speed');
if (revealSpeed) revealSpeed.value = 'default';
const revealSlideNumber = document.getElementById('reveal-slide-number');
if (revealSlideNumber) revealSlideNumber.checked = false;
const revealControls = document.getElementById('reveal-controls');
if (revealControls) revealControls.checked = true;
const revealProgress = document.getElementById('reveal-progress');
if (revealProgress) revealProgress.checked = true;
const revealHistory = document.getElementById('reveal-history');
if (revealHistory) revealHistory.checked = true;
const revealCenter = document.getElementById('reveal-center');
if (revealCenter) revealCenter.checked = true;
// Clear bibliography fields // Clear bibliography fields
document.getElementById('bibliography-file').value = ''; document.getElementById('bibliography-file').value = '';
document.getElementById('csl-file').value = ''; document.getElementById('csl-file').value = '';
@@ -2107,6 +2295,18 @@ function collectExportOptions() {
} }
} }
// Reveal.js-specific options
if (currentExportFormat === 'revealjs') {
options.revealTheme = document.getElementById('reveal-theme').value;
options.revealTransition = document.getElementById('reveal-transition').value;
options.revealTransitionSpeed = document.getElementById('reveal-speed').value;
options.revealSlideNumber = document.getElementById('reveal-slide-number').checked;
options.revealControls = document.getElementById('reveal-controls').checked;
options.revealProgress = document.getElementById('reveal-progress').checked;
options.revealHistory = document.getElementById('reveal-history').checked;
options.revealCenter = document.getElementById('reveal-center').checked;
}
// Bibliography // Bibliography
const bibFile = document.getElementById('bibliography-file').value.trim(); const bibFile = document.getElementById('bibliography-file').value.trim();
const cslFile = document.getElementById('csl-file').value.trim(); const cslFile = document.getElementById('csl-file').value.trim();
@@ -2117,6 +2317,15 @@ function collectExportOptions() {
if (currentExportFormat === 'pdf') { if (currentExportFormat === 'pdf') {
options.pdfEngine = 'xelatex'; options.pdfEngine = 'xelatex';
options.geometry = 'margin=1in'; options.geometry = 'margin=1in';
} else if (currentExportFormat === 'revealjs') {
options.revealTheme = 'black';
options.revealTransition = 'slide';
options.revealTransitionSpeed = 'default';
options.revealSlideNumber = false;
options.revealControls = true;
options.revealProgress = true;
options.revealHistory = true;
options.revealCenter = true;
} }
} }
@@ -3034,6 +3243,18 @@ function showPDFEditorDialog(operation, openedFilePath = null) {
section.classList.add('hidden'); section.classList.add('hidden');
}); });
// Hide visual thumbnail sidebar by default
const sidebar = document.getElementById('pdf-thumbnail-sidebar');
if (sidebar) {
sidebar.classList.add('hidden');
}
const body = document.querySelector('.pdf-editor-body');
if (body) {
body.classList.remove('side-by-side');
}
pdfDocInstance = null;
pdfPreviewState = { pages: [], filePath: '' };
// Show the appropriate section and set title // Show the appropriate section and set title
let sectionId, titleText; let sectionId, titleText;
switch (operation) { switch (operation) {
@@ -3067,7 +3288,11 @@ function showPDFEditorDialog(operation, openedFilePath = null) {
titleText = 'Rotate Pages'; titleText = 'Rotate Pages';
if (openedFilePath) { if (openedFilePath) {
const rotateInput = document.getElementById('rotate-input-path'); const rotateInput = document.getElementById('rotate-input-path');
if (rotateInput) rotateInput.value = openedFilePath; if (rotateInput) {
rotateInput.value = openedFilePath;
// Trigger thumbnail generation
setTimeout(() => onPDFFileSelected('rotate-input-path', openedFilePath), 50);
}
} }
break; break;
case 'delete': case 'delete':
@@ -3075,7 +3300,11 @@ function showPDFEditorDialog(operation, openedFilePath = null) {
titleText = 'Delete Pages'; titleText = 'Delete Pages';
if (openedFilePath) { if (openedFilePath) {
const deleteInput = document.getElementById('delete-input-path'); const deleteInput = document.getElementById('delete-input-path');
if (deleteInput) deleteInput.value = openedFilePath; if (deleteInput) {
deleteInput.value = openedFilePath;
// Trigger thumbnail generation
setTimeout(() => onPDFFileSelected('delete-input-path', openedFilePath), 50);
}
} }
break; break;
case 'reorder': case 'reorder':
@@ -3083,7 +3312,11 @@ function showPDFEditorDialog(operation, openedFilePath = null) {
titleText = 'Reorder Pages'; titleText = 'Reorder Pages';
if (openedFilePath) { if (openedFilePath) {
const reorderInput = document.getElementById('reorder-input-path'); const reorderInput = document.getElementById('reorder-input-path');
if (reorderInput) reorderInput.value = openedFilePath; if (reorderInput) {
reorderInput.value = openedFilePath;
// Trigger thumbnail generation
setTimeout(() => onPDFFileSelected('reorder-input-path', openedFilePath), 50);
}
} }
break; break;
case 'watermark': case 'watermark':
@@ -3244,6 +3477,7 @@ document.addEventListener('DOMContentLoaded', () => {
const file = e.target.files[0]; const file = e.target.files[0];
if (file) { if (file) {
document.getElementById(button.inputId).value = file.path; document.getElementById(button.inputId).value = file.path;
onPDFFileSelected(button.inputId, file.path);
} }
}; };
input.click(); input.click();
@@ -3253,6 +3487,7 @@ document.addEventListener('DOMContentLoaded', () => {
const file = e.target.files[0]; const file = e.target.files[0];
if (file) { if (file) {
document.getElementById(button.inputId).value = file.path; document.getElementById(button.inputId).value = file.path;
onPDFFileSelected(button.inputId, file.path);
} }
}; };
input.click(); input.click();
@@ -3397,7 +3632,7 @@ function showPDFValidationMessage(message, focusSelector = null) {
// Process PDF Operation // Process PDF Operation
function processPDFOperation() { function processPDFOperation() {
const operation = currentPDFOperation; const operation = currentPDFOperation;
let operationData = { operation }; const operationData = { operation };
try { try {
switch (operation) { switch (operation) {
@@ -4187,7 +4422,7 @@ function textToASCII(text, style) {
lines[i] = ''; lines[i] = '';
} }
for (let char of upperText) { for (const char of upperText) {
const charLines = font.chars[char] || font.chars[' ']; const charLines = font.chars[char] || font.chars[' '];
if (charLines) { if (charLines) {
for (let i = 0; i < font.height; i++) { for (let i = 0; i < font.height; i++) {
@@ -4225,7 +4460,7 @@ function createASCIIBox(text, style, padding) {
} }
// Content lines // Content lines
for (let line of lines) { for (const line of lines) {
const paddedLine = line.padEnd(maxLength, ' '); const paddedLine = line.padEnd(maxLength, ' ');
result += chars.v + ' '.repeat(padding) + paddedLine + ' '.repeat(padding) + chars.v + '\n'; result += chars.v + ' '.repeat(padding) + paddedLine + ' '.repeat(padding) + chars.v + '\n';
} }
@@ -4861,3 +5096,224 @@ ipcRenderer.on('show-video-tool', (event, tool) => {
{ duration: 5000 } { duration: 5000 }
); );
}); });
// ============================================
// PDF EDITOR VISUAL PAGE SIDEBAR HANDLERS
// ============================================
let pdfDocInstance = null;
let pdfPreviewState = { pages: [], filePath: '' };
function onPDFFileSelected(inputId, filePath) {
const eligibleInputs = ['rotate-input-path', 'delete-input-path', 'reorder-input-path'];
if (!eligibleInputs.includes(inputId)) {
return;
}
const sidebar = document.getElementById('pdf-thumbnail-sidebar');
if (sidebar) {
sidebar.classList.remove('hidden');
}
const body = document.querySelector('.pdf-editor-body');
if (body) {
body.classList.add('side-by-side');
}
loadPDFThumbnails(filePath);
}
async function loadPDFThumbnails(filePath) {
const grid = document.getElementById('pdf-thumbnail-grid');
if (!grid) return;
// Reset previous inputs
const rotateInput = document.getElementById('rotate-pages');
if (rotateInput) rotateInput.value = '';
const deleteInput = document.getElementById('delete-pages');
if (deleteInput) deleteInput.value = '';
const reorderInput = document.getElementById('reorder-pages');
if (reorderInput) reorderInput.value = '';
grid.innerHTML = '<div class="loading-thumbnails">Loading page thumbnails...</div>';
try {
const pdfjs = getPdfjsLib();
const loadingTask = pdfjs.getDocument(filePath);
pdfDocInstance = await loadingTask.promise;
pdfPreviewState.filePath = filePath;
pdfPreviewState.pages = [];
for (let i = 1; i <= pdfDocInstance.numPages; i++) {
pdfPreviewState.pages.push({
originalPageNum: i,
rotation: 0,
isDeleted: false
});
}
renderThumbnailGrid();
} catch (err) {
console.error('Error loading PDF thumbnails:', err);
grid.innerHTML = '<div class="thumbnail-error">Failed to load PDF thumbnails.</div>';
}
}
function renderThumbnailGrid() {
const grid = document.getElementById('pdf-thumbnail-grid');
if (!grid || !pdfDocInstance) return;
grid.innerHTML = '';
pdfPreviewState.pages.forEach((pageInfo, index) => {
const card = document.createElement('div');
card.className = 'pdf-thumbnail-card';
if (pageInfo.isDeleted) {
card.classList.add('marked-delete');
}
const heading = document.createElement('div');
heading.className = 'pdf-thumbnail-header';
heading.innerHTML = `<span class="badge">Page ${pageInfo.originalPageNum}</span>`;
const canvasContainer = document.createElement('div');
canvasContainer.className = 'canvas-container';
const canvas = document.createElement('canvas');
canvas.className = 'pdf-thumbnail-canvas';
if (pageInfo.rotation > 0) {
canvas.classList.add('rot' + pageInfo.rotation);
}
canvasContainer.appendChild(canvas);
// Render thumbnail canvas
renderThumbnail(pdfDocInstance, pageInfo.originalPageNum, canvas, pageInfo.rotation);
const controlsRow = document.createElement('div');
controlsRow.className = 'pdf-thumbnail-controls';
// Rotate Button
const rotateBtn = document.createElement('button');
rotateBtn.type = 'button';
rotateBtn.className = 'btn-rotate-thumbnail';
rotateBtn.innerHTML = '↻ Rotate 90°';
rotateBtn.addEventListener('click', () => {
pageInfo.rotation = (pageInfo.rotation + 90) % 360;
canvas.className = 'pdf-thumbnail-canvas';
if (pageInfo.rotation > 0) {
canvas.classList.add('rot' + pageInfo.rotation);
}
renderThumbnail(pdfDocInstance, pageInfo.originalPageNum, canvas, pageInfo.rotation);
syncRotateInput();
});
// Delete Checkbox
const deleteLabel = document.createElement('label');
deleteLabel.className = 'delete-thumbnail-checkbox';
const deleteChk = document.createElement('input');
deleteChk.type = 'checkbox';
deleteChk.checked = pageInfo.isDeleted;
deleteChk.addEventListener('change', (e) => {
pageInfo.isDeleted = e.target.checked;
card.classList.toggle('marked-delete', pageInfo.isDeleted);
syncDeleteInput();
});
deleteLabel.appendChild(deleteChk);
deleteLabel.appendChild(document.createTextNode(' Delete'));
// Reorder buttons
const reorderDiv = document.createElement('div');
reorderDiv.className = 'pdf-thumbnail-reorder';
const leftBtn = document.createElement('button');
leftBtn.type = 'button';
leftBtn.className = 'btn-reorder-left';
leftBtn.innerHTML = '◀';
leftBtn.disabled = (index === 0);
leftBtn.addEventListener('click', () => {
const temp = pdfPreviewState.pages[index];
pdfPreviewState.pages[index] = pdfPreviewState.pages[index - 1];
pdfPreviewState.pages[index - 1] = temp;
renderThumbnailGrid();
syncReorderInput();
});
const rightBtn = document.createElement('button');
rightBtn.type = 'button';
rightBtn.className = 'btn-reorder-right';
rightBtn.innerHTML = '▶';
rightBtn.disabled = (index === pdfPreviewState.pages.length - 1);
rightBtn.addEventListener('click', () => {
const temp = pdfPreviewState.pages[index];
pdfPreviewState.pages[index] = pdfPreviewState.pages[index + 1];
pdfPreviewState.pages[index + 1] = temp;
renderThumbnailGrid();
syncReorderInput();
});
reorderDiv.appendChild(leftBtn);
reorderDiv.appendChild(rightBtn);
controlsRow.appendChild(rotateBtn);
controlsRow.appendChild(deleteLabel);
controlsRow.appendChild(reorderDiv);
card.appendChild(heading);
card.appendChild(canvasContainer);
card.appendChild(controlsRow);
grid.appendChild(card);
});
}
async function renderThumbnail(pdfDoc, originalPageNum, canvasElement, rotation) {
try {
const page = await pdfDoc.getPage(originalPageNum);
const ctx = canvasElement.getContext('2d');
// Render at a fixed width of 100px
const unscaledViewport = page.getViewport({ scale: 1, rotation: 0 });
const scale = 100 / unscaledViewport.width;
const viewport = page.getViewport({ scale: scale, rotation: 0 });
canvasElement.width = viewport.width;
canvasElement.height = viewport.height;
await page.render({
canvasContext: ctx,
viewport: viewport
}).promise;
} catch (err) {
console.error('Error rendering page canvas:', err);
}
}
function syncRotateInput() {
const rotatedPages = pdfPreviewState.pages
.filter(p => p.rotation > 0)
.map(p => p.originalPageNum);
const rotateInput = document.getElementById('rotate-pages');
if (rotateInput) {
rotateInput.value = rotatedPages.join(', ');
}
}
function syncDeleteInput() {
const deletedPages = pdfPreviewState.pages
.filter(p => p.isDeleted)
.map(p => p.originalPageNum);
const deleteInput = document.getElementById('delete-pages');
if (deleteInput) {
deleteInput.value = deletedPages.join(', ');
}
}
function syncReorderInput() {
const order = pdfPreviewState.pages.map(p => p.originalPageNum);
const reorderInput = document.getElementById('reorder-pages');
if (reorderInput) {
reorderInput.value = order.join(', ');
}
}
+251
View File
@@ -2372,3 +2372,254 @@ body[class*="dark"] .breadcrumb-bar {
@keyframes analyticsSlideUp { from{transform:translateY(16px);opacity:0} to{transform:translateY(0);opacity:1} } @keyframes analyticsSlideUp { from{transform:translateY(16px);opacity:0} to{transform:translateY(0);opacity:1} }
body[class*="dark"] .analytics-modal { background:var(--gray-800,#1f2937); } body[class*="dark"] .analytics-modal { background:var(--gray-800,#1f2937); }
body[class*="dark"] .word-tag { background:var(--gray-700,#374151); } body[class*="dark"] .word-tag { background:var(--gray-700,#374151); }
/* ========================================
Interactive PDF Thumbnail Sidebar Styles
======================================== */
.pdf-editor-body.side-by-side {
display: flex;
flex-direction: row;
gap: 16px;
height: 550px;
overflow: hidden;
}
.pdf-editor-left-panel {
flex: 1.2;
overflow-y: auto;
padding-right: 8px;
height: 100%;
}
.pdf-editor-right-panel {
flex: 0.8;
display: flex;
flex-direction: column;
border-left: 1px solid var(--border-color, #e5e7eb);
padding-left: 16px;
height: 100%;
overflow: hidden;
}
.pdf-editor-right-panel h4 {
margin: 0 0 4px 0;
font-size: 15px;
font-weight: 600;
color: var(--text-primary);
}
.pdf-editor-right-panel .sidebar-help {
margin: 0 0 12px 0;
font-size: 11px;
color: var(--text-secondary, #6b7280);
line-height: 1.4;
}
.pdf-thumbnail-grid {
flex: 1;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
gap: 12px;
overflow-y: auto;
padding: 4px;
}
.pdf-thumbnail-card {
display: flex;
flex-direction: column;
border: 1px solid var(--border-color, #e5e7eb);
border-radius: 8px;
background: var(--bg-primary, #ffffff);
box-shadow: var(--shadow-sm);
padding: 8px;
transition: all var(--transition-speed, 0.3s) var(--transition-ease);
position: relative;
overflow: hidden;
}
.pdf-thumbnail-card:hover {
transform: translateY(-2px);
box-shadow: var(--shadow-md);
border-color: var(--primary-light, #8b9aff);
}
.pdf-thumbnail-card.marked-delete {
border-color: var(--error, #ef4444);
background: rgba(239, 68, 68, 0.05);
}
.pdf-thumbnail-card.marked-delete::after {
content: "DELETE";
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) rotate(-15deg);
background: rgba(239, 68, 68, 0.95);
color: #fff;
font-size: 10px;
font-weight: 700;
padding: 4px 8px;
border-radius: 4px;
pointer-events: none;
box-shadow: var(--shadow-sm);
letter-spacing: 0.5px;
white-space: nowrap;
}
.pdf-thumbnail-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 6px;
}
.pdf-thumbnail-header .badge {
font-size: 11px;
font-weight: 600;
background: var(--bg-tertiary, #f3f4f6);
color: var(--text-primary);
padding: 2px 6px;
border-radius: 4px;
font-family: var(--font-mono, monospace);
}
.canvas-container {
display: flex;
justify-content: center;
align-items: center;
background: var(--bg-secondary, #f9fafb);
border: 1px solid var(--border-color, #e5e7eb);
border-radius: 6px;
padding: 6px;
height: 120px;
overflow: hidden;
}
.pdf-thumbnail-canvas {
max-width: 100%;
max-height: 100%;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
transition: transform 0.3s ease;
}
/* CSS Rotations */
.rot90 {
transform: rotate(90deg);
}
.rot180 {
transform: rotate(180deg);
}
.rot270 {
transform: rotate(270deg);
}
.pdf-thumbnail-controls {
display: flex;
flex-direction: column;
gap: 6px;
margin-top: 8px;
}
.pdf-thumbnail-controls button,
.pdf-thumbnail-controls label {
font-size: 11px;
}
.btn-rotate-thumbnail {
background: var(--bg-tertiary, #f3f4f6);
border: 1px solid var(--border-color, #e5e7eb);
color: var(--text-primary);
border-radius: 4px;
padding: 3px 6px;
cursor: pointer;
width: 100%;
text-align: center;
transition: all 0.2s;
font-weight: 500;
}
.btn-rotate-thumbnail:hover {
background: var(--primary-light, #8b9aff);
color: #fff;
border-color: var(--primary-dark);
}
.delete-thumbnail-checkbox {
display: flex;
align-items: center;
justify-content: center;
gap: 4px;
cursor: pointer;
user-select: none;
font-weight: 500;
color: var(--text-secondary);
}
.delete-thumbnail-checkbox input {
margin: 0;
cursor: pointer;
}
.pdf-thumbnail-reorder {
display: flex;
justify-content: space-between;
gap: 4px;
}
.btn-reorder-left,
.btn-reorder-right {
flex: 1;
background: var(--bg-tertiary, #f3f4f6);
border: 1px solid var(--border-color, #e5e7eb);
color: var(--text-primary);
border-radius: 4px;
padding: 2px;
cursor: pointer;
transition: all 0.2s;
}
.btn-reorder-left:hover:not(:disabled),
.btn-reorder-right:hover:not(:disabled) {
background: var(--bg-secondary);
border-color: var(--text-muted);
}
.btn-reorder-left:disabled,
.btn-reorder-right:disabled {
opacity: 0.3;
cursor: not-allowed;
}
.loading-thumbnails,
.thumbnail-error {
grid-column: 1 / -1;
text-align: center;
padding: 40px 20px;
font-size: 13px;
color: var(--text-muted);
}
.thumbnail-error {
color: var(--error, #ef4444);
}
/* Dark mode adjustments */
body[class*="dark"] .pdf-thumbnail-card {
background: var(--gray-800, #1f2937);
border-color: var(--gray-700, #374151);
}
body[class*="dark"] .pdf-thumbnail-header .badge {
background: var(--gray-700, #374151);
color: var(--gray-200);
}
body[class*="dark"] .canvas-container {
background: var(--gray-900, #111827);
border-color: var(--gray-700);
}
body[class*="dark"] .btn-rotate-thumbnail,
body[class*="dark"] .btn-reorder-left,
body[class*="dark"] .btn-reorder-right {
background: var(--gray-700, #374151);
border-color: var(--gray-600);
color: var(--gray-200);
}
+1 -1
View File
@@ -1,6 +1,6 @@
/** /**
* ModalManager - Unified modal system with accessibility support * ModalManager - Unified modal system with accessibility support
* @version 4.4.1 * @version 4.4.2
*/ */
class ModalManager { class ModalManager {
#modal; #modal;
+1 -1
View File
@@ -655,7 +655,7 @@ class WordTemplateExporter {
*/ */
parseInlineFormatting(text) { parseInlineFormatting(text) {
let xml = ''; let xml = '';
let pos = 0; const pos = 0;
// Patterns for inline formatting // Patterns for inline formatting
const patterns = [ const patterns = [
+1 -1
View File
@@ -117,7 +117,7 @@ class ZenMode {
_applyTypewriterBehavior(view) { _applyTypewriterBehavior(view) {
// We use a custom update listener that scrolls the cursor to center. // We use a custom update listener that scrolls the cursor to center.
// This is stored on the instance so we can clean it up. // This is stored on the instance so we can clean it up.
let scrollTimeout = null; const scrollTimeout = null;
const scrollFn = () => { const scrollFn = () => {
if (!this.active) return; if (!this.active) return;
+118
View File
@@ -76,6 +76,75 @@ describe('Markdown Extensions', () => {
}); });
}); });
describe('Admonitions full parsing integration (mocked environment)', () => {
const extension = {
name: 'admonition',
level: 'block',
start(src) { return src.match(/^:::(note|warning|tip|danger|info)/m)?.index; },
tokenizer(src) {
const match = src.match(/^:::(note|warning|tip|danger|info)\s*\n([\s\S]*?)^:::\s*$/m);
if (match && match.index === 0) {
const admonitionType = match[1];
const text = match[2].trim();
const tokens = [];
this.lexer.blockTokens(text, tokens);
return {
type: 'admonition',
raw: match[0],
admonitionType,
text,
tokens
};
}
},
renderer(token) {
const icons = { note: '', warning: '⚠', tip: '💡', danger: '🔴', info: '' };
const icon = icons[token.admonitionType] || '';
const inner = this.parser.parse(token.tokens || []);
return `<div class="admonition admonition-${token.admonitionType}">
<div class="admonition-title">${icon} ${token.admonitionType.charAt(0).toUpperCase() + token.admonitionType.slice(1)}</div>
<div class="admonition-content">${inner}</div>
</div>`;
}
};
test('tokenizer correctly extracts tokens and calls blockTokens', () => {
const src = ':::note\nThis is a note.\n:::';
const mockLexer = {
blockTokens: jest.fn((text, tokens) => {
tokens.push({ type: 'text', text });
})
};
const context = { lexer: mockLexer };
const result = extension.tokenizer.call(context, src);
expect(result).toBeDefined();
expect(result.type).toBe('admonition');
expect(result.admonitionType).toBe('note');
expect(result.text).toBe('This is a note.');
expect(mockLexer.blockTokens).toHaveBeenCalledWith('This is a note.', expect.any(Array));
expect(result.tokens).toEqual([{ type: 'text', text: 'This is a note.' }]);
});
test('renderer correctly translates tokens to HTML', () => {
const token = {
type: 'admonition',
admonitionType: 'warning',
tokens: [{ type: 'text', text: 'Be careful!' }]
};
const mockParser = {
parse: jest.fn((tokens) => '<p>Be careful!</p>')
};
const context = { parser: mockParser };
const html = extension.renderer.call(context, token);
expect(html).toContain('admonition admonition-warning');
expect(html).toContain('⚠ Warning');
expect(html).toContain('<p>Be careful!</p>');
expect(mockParser.parse).toHaveBeenCalledWith(token.tokens);
});
});
describe('PlantUML hex encoding', () => { describe('PlantUML hex encoding', () => {
const plantumlEncode = (text) => { const plantumlEncode = (text) => {
const hex = Array.from(Buffer.from(text, 'utf-8')) const hex = Array.from(Buffer.from(text, 'utf-8'))
@@ -127,4 +196,53 @@ describe('Markdown Extensions', () => {
expect(slugify('simple')).toBe('simple'); expect(slugify('simple')).toBe('simple');
}); });
}); });
describe('scopeCSS utility', () => {
const scopeCSS = (cssText, scopeSelector) => {
if (!cssText) return '';
return cssText.replace(/([^\r\n,{}]+)(,(?=[^}]*{)|(?=[^{]*{))/g, (match, selector, separator) => {
const trimmed = selector.trim();
if (!trimmed || trimmed.startsWith('@') || trimmed.startsWith(':root') || trimmed.startsWith('from') || trimmed.startsWith('to') || /^\d+%$/.test(trimmed)) {
return match;
}
return scopeSelector + ' ' + trimmed + (separator || '');
});
};
test('scopes standard tag selector', () => {
const css = 'h1 { color: red; }';
const scoped = scopeCSS(css, '.preview-content');
expect(scoped).toBe('.preview-content h1{ color: red; }');
});
test('scopes multiple class selectors', () => {
const css = '.title, .content { font-family: sans-serif; }';
const scoped = scopeCSS(css, '.preview-content');
expect(scoped).toBe('.preview-content .title,.preview-content .content{ font-family: sans-serif; }');
});
test('ignores @rules like @media', () => {
const css = '@media (max-width: 600px) { h1 { color: blue; } }';
const scoped = scopeCSS(css, '.preview-content');
expect(scoped).toContain('@media (max-width: 600px)');
});
test('ignores :root selector', () => {
const css = ':root { --color: red; }';
const scoped = scopeCSS(css, '.preview-content');
expect(scoped).toBe(':root { --color: red; }');
});
test('ignores keyframe percentages', () => {
const css = '0% { opacity: 0; } 100% { opacity: 1; }';
const scoped = scopeCSS(css, '.preview-content');
expect(scoped).toContain('0%');
expect(scoped).toContain('100%');
});
test('handles empty input', () => {
expect(scopeCSS('', '.preview-content')).toBe('');
expect(scopeCSS(null, '.preview-content')).toBe('');
});
});
}); });