@file-viewer/docx 0.3.22 → 0.3.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -4
- package/dist/docx-preview.js +1 -1
- package/dist/docx-preview.min.js +1 -1
- package/dist/docx-preview.min.mjs +1 -1
- package/dist/docx-preview.mjs +1 -1
- package/dist/docx-preview.worker.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Pure HTML DOCX renderer for browser-based Word previews. This package preserves the final non-canvas `docx-viewer` line as a stable maintenance track, converting WordprocessingML into HTML while keeping semantic structure, page layout, headers/footers, numbering, fields, tables, images and common DrawingML content as closely as browser layout allows.
|
|
6
6
|
|
|
7
|
-
This fork includes production hardening for large Word documents: Worker-
|
|
7
|
+
This fork includes production hardening for large Word documents: optional Worker parsing with a main-thread fallback, asynchronous rendering yields, Word-saved pagination support, dynamic overflow pagination and layout telemetry.
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
@@ -156,7 +156,7 @@ The production path is intentionally split into stages:
|
|
|
156
156
|
4. `awaitRenderedLayout` waits for images and fonts, runs dynamic overflow pagination and returns a `LayoutSnapshot`.
|
|
157
157
|
5. `collectLayoutSnapshot` can be used in CI or telemetry to detect overflow pages, unresolved media, page count, aggregate text length, fields and floating objects.
|
|
158
158
|
|
|
159
|
-
|
|
159
|
+
Batch rendering and browser yields avoid the former demo-page freeze caused by inserting very large DOM trees in one task. When Worker parsing is enabled, keep `workerFallback: true` unless the target Worker runtime provides every required XML API.
|
|
160
160
|
|
|
161
161
|
## Pagination, headers/footers and TOC
|
|
162
162
|
|
|
@@ -201,13 +201,29 @@ It renders `tests/regression/database-design.docx` and asserts that TOC entries
|
|
|
201
201
|
|
|
202
202
|
## Build
|
|
203
203
|
|
|
204
|
-
This repository includes a lightweight build script that emits CommonJS, ESM and Worker bundles
|
|
204
|
+
This repository includes a lightweight build script that emits synchronized, minified CommonJS, ESM and Worker bundles:
|
|
205
205
|
|
|
206
206
|
```bash
|
|
207
207
|
npm run build
|
|
208
208
|
```
|
|
209
209
|
|
|
210
|
-
|
|
210
|
+
Run the complete build and semantic regression suite with:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
npm run verify
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Browser-focused checks remain available through `npm run e2e`, `npm run e2e:chart` and `npm run e2e:header-guard`.
|
|
217
|
+
|
|
218
|
+
## Local demo
|
|
219
|
+
|
|
220
|
+
Serve the repository over HTTP and open the root page:
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
python3 -m http.server 8000
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
The demo is self-contained for normal DOCX files, includes sample documents, page navigation, light/dark rendering and an options panel. TIFF support is loaded only when a document actually contains TIFF media.
|
|
211
227
|
|
|
212
228
|
## Notes on fidelity
|
|
213
229
|
|