@file-viewer/docx
Advanced tools
@@ -23,2 +23,3 @@ export interface Options { | ||
| hideWebHiddenContent: boolean; | ||
| externalLinkPolicy: "allow" | "block"; | ||
| darkMode: boolean; | ||
@@ -25,0 +26,0 @@ debug: boolean; |
+1
-1
| { | ||
| "name": "@file-viewer/docx", | ||
| "version": "0.3.26", | ||
| "version": "0.3.27", | ||
| "description": "Pure HTML DOCX renderer fork for browser-based Word previews.", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
+3
-0
@@ -40,2 +40,3 @@ [](https://www.npmjs.com/package/@file-viewer/docx) | ||
| hideWebHiddenContent: false, | ||
| externalLinkPolicy: "allow", | ||
| progress: ev => console.log(ev.phase, ev.current, ev.total, ev.message) | ||
@@ -179,2 +180,4 @@ }; | ||
| External hyperlinks remain active by default. Set `externalLinkPolicy: "block"` to omit their `href` while preserving their text and target metadata. Document-internal bookmark links remain active in either mode. | ||
| Set `darkMode: true` to reproduce Word Online's "Switch Modes" dark appearance. Every color the renderer emits — text, backgrounds/highlights, borders, underlines, theme colors and DrawingML/VML shape fills and strokes — is converted with the same lightness-inversion algorithm Microsoft uses for this exact purpose (see `roosterjs`'s `getDarkColor`): the color is converted to CIE Lab, only the lightness (`L`) channel is inverted around a fixed base value (the `L` of `#333333`), and hue/chroma (`a`/`b`) are left untouched. That guarantees every color stays legible on a dark page — pure black becomes pure white, pure white becomes `#333333`, and an arbitrary color such as `rgb(99, 36, 35)` keeps its reddish hue while becoming light enough to read — without the hue-flipping side effects of a naive per-channel RGB invert. The toggle is purely a rendering-time CSS transform — it does not change the parsed document model — and every transformed color is wrapped in a CSS variable so that `@media print` can restore the exact original light-mode value; print output always renders with Word's normal light appearance regardless of `darkMode`. | ||
@@ -181,0 +184,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 2 instances
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
1384886
1.23%4942
1.33%246
1.23%2
-33.33%