New:Socket for Asana Is Now Available.Learn more
Get Started

@file-viewer/docx

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@file-viewer/docx - npm Package Compare versions

Comparing version
0.3.26
to
0.3.27
+1
-0
dist/docx-preview.d.ts

@@ -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",

@@ -40,2 +40,3 @@ [![npm version](https://badge.fury.io/js/%40file-viewer%2Fdocx.svg)](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