docxodus 9.7.0 → 9.9.0

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.
Files changed (101) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +0 -1
  3. package/dist/editor.bundle.js +454 -99
  4. package/dist/editor.d.ts +4 -4
  5. package/dist/editor.d.ts.map +1 -1
  6. package/dist/editor.js +55 -8
  7. package/dist/editor.js.map +1 -1
  8. package/dist/embed.bundle.js +454 -99
  9. package/dist/embed.iife.js +454 -99
  10. package/dist/page-geometry.d.ts +50 -3
  11. package/dist/page-geometry.d.ts.map +1 -1
  12. package/dist/page-geometry.js +63 -6
  13. package/dist/page-geometry.js.map +1 -1
  14. package/dist/pagination.bundle.js +416 -91
  15. package/dist/pagination.d.ts +61 -8
  16. package/dist/pagination.d.ts.map +1 -1
  17. package/dist/pagination.js +353 -105
  18. package/dist/pagination.js.map +1 -1
  19. package/dist/ribbon-chrome.d.ts +1 -1
  20. package/dist/ribbon-chrome.d.ts.map +1 -1
  21. package/dist/ribbon-chrome.js +1 -0
  22. package/dist/ribbon-chrome.js.map +1 -1
  23. package/dist/wasm/_framework/Docxodus.wasm +0 -0
  24. package/dist/wasm/_framework/Docxodus.wasm.br +0 -0
  25. package/dist/wasm/_framework/DocxodusWasm.wasm +0 -0
  26. package/dist/wasm/_framework/DocxodusWasm.wasm.br +0 -0
  27. package/dist/wasm/_framework/System.Collections.Concurrent.wasm +0 -0
  28. package/dist/wasm/_framework/System.Collections.Concurrent.wasm.br +0 -0
  29. package/dist/wasm/_framework/System.Collections.Immutable.wasm +0 -0
  30. package/dist/wasm/_framework/System.Collections.Immutable.wasm.br +0 -0
  31. package/dist/wasm/_framework/System.Collections.NonGeneric.wasm +0 -0
  32. package/dist/wasm/_framework/System.Collections.NonGeneric.wasm.br +0 -0
  33. package/dist/wasm/_framework/System.Collections.Specialized.wasm +0 -0
  34. package/dist/wasm/_framework/System.Collections.Specialized.wasm.br +0 -0
  35. package/dist/wasm/_framework/System.Collections.wasm +0 -0
  36. package/dist/wasm/_framework/System.Collections.wasm.br +0 -0
  37. package/dist/wasm/_framework/System.ComponentModel.Primitives.wasm +0 -0
  38. package/dist/wasm/_framework/System.ComponentModel.Primitives.wasm.br +0 -0
  39. package/dist/wasm/_framework/System.ComponentModel.TypeConverter.wasm +0 -0
  40. package/dist/wasm/_framework/System.ComponentModel.TypeConverter.wasm.br +0 -0
  41. package/dist/wasm/_framework/System.ComponentModel.wasm +0 -0
  42. package/dist/wasm/_framework/System.ComponentModel.wasm.br +0 -0
  43. package/dist/wasm/_framework/System.Console.wasm +0 -0
  44. package/dist/wasm/_framework/System.Console.wasm.br +0 -0
  45. package/dist/wasm/_framework/System.Diagnostics.Process.wasm +0 -0
  46. package/dist/wasm/_framework/System.Diagnostics.Process.wasm.br +0 -0
  47. package/dist/wasm/_framework/System.IO.Compression.wasm +0 -0
  48. package/dist/wasm/_framework/System.IO.Compression.wasm.br +0 -0
  49. package/dist/wasm/_framework/System.IO.Pipelines.wasm +0 -0
  50. package/dist/wasm/_framework/System.IO.Pipelines.wasm.br +0 -0
  51. package/dist/wasm/_framework/System.Linq.Expressions.wasm +0 -0
  52. package/dist/wasm/_framework/System.Linq.Expressions.wasm.br +0 -0
  53. package/dist/wasm/_framework/System.Linq.wasm +0 -0
  54. package/dist/wasm/_framework/System.Linq.wasm.br +0 -0
  55. package/dist/wasm/_framework/System.Memory.wasm +0 -0
  56. package/dist/wasm/_framework/System.Memory.wasm.br +0 -0
  57. package/dist/wasm/_framework/System.Net.Http.wasm +0 -0
  58. package/dist/wasm/_framework/System.Net.Http.wasm.br +0 -0
  59. package/dist/wasm/_framework/System.Net.Primitives.wasm +0 -0
  60. package/dist/wasm/_framework/System.Net.Primitives.wasm.br +0 -0
  61. package/dist/wasm/_framework/System.ObjectModel.wasm +0 -0
  62. package/dist/wasm/_framework/System.ObjectModel.wasm.br +0 -0
  63. package/dist/wasm/_framework/System.Private.CoreLib.wasm +0 -0
  64. package/dist/wasm/_framework/System.Private.CoreLib.wasm.br +0 -0
  65. package/dist/wasm/_framework/System.Private.Uri.wasm +0 -0
  66. package/dist/wasm/_framework/System.Private.Uri.wasm.br +0 -0
  67. package/dist/wasm/_framework/System.Private.Xml.Linq.wasm +0 -0
  68. package/dist/wasm/_framework/System.Private.Xml.Linq.wasm.br +0 -0
  69. package/dist/wasm/_framework/System.Private.Xml.wasm +0 -0
  70. package/dist/wasm/_framework/System.Private.Xml.wasm.br +0 -0
  71. package/dist/wasm/_framework/System.Runtime.InteropServices.JavaScript.wasm +0 -0
  72. package/dist/wasm/_framework/System.Runtime.InteropServices.JavaScript.wasm.br +0 -0
  73. package/dist/wasm/_framework/System.Runtime.wasm +0 -0
  74. package/dist/wasm/_framework/System.Runtime.wasm.br +0 -0
  75. package/dist/wasm/_framework/System.Security.Cryptography.wasm +0 -0
  76. package/dist/wasm/_framework/System.Security.Cryptography.wasm.br +0 -0
  77. package/dist/wasm/_framework/System.Text.Encodings.Web.wasm +0 -0
  78. package/dist/wasm/_framework/System.Text.Encodings.Web.wasm.br +0 -0
  79. package/dist/wasm/_framework/System.Text.Json.wasm +0 -0
  80. package/dist/wasm/_framework/System.Text.Json.wasm.br +0 -0
  81. package/dist/wasm/_framework/System.Text.RegularExpressions.wasm +0 -0
  82. package/dist/wasm/_framework/System.Text.RegularExpressions.wasm.br +0 -0
  83. package/dist/wasm/_framework/System.Xml.Linq.wasm +0 -0
  84. package/dist/wasm/_framework/System.Xml.Linq.wasm.br +0 -0
  85. package/dist/wasm/_framework/System.Xml.XDocument.wasm +0 -0
  86. package/dist/wasm/_framework/System.Xml.XDocument.wasm.br +0 -0
  87. package/dist/wasm/_framework/System.wasm +0 -0
  88. package/dist/wasm/_framework/System.wasm.br +0 -0
  89. package/dist/wasm/_framework/dotnet.boot.js +35 -35
  90. package/dist/wasm/_framework/dotnet.boot.js.br +0 -0
  91. package/dist/wasm/_framework/dotnet.js +1 -1
  92. package/dist/wasm/_framework/dotnet.js.br +0 -0
  93. package/dist/wasm/_framework/dotnet.native.js +3 -3
  94. package/dist/wasm/_framework/dotnet.native.js.br +0 -0
  95. package/dist/wasm/_framework/dotnet.native.wasm +0 -0
  96. package/dist/wasm/_framework/dotnet.native.wasm.br +0 -0
  97. package/dist/wasm/_framework/dotnet.runtime.js +1 -1
  98. package/dist/wasm/_framework/dotnet.runtime.js.br +0 -0
  99. package/package.json +14 -5
  100. package/dist/wasm/index.html +0 -238
  101. package/dist/wasm/main.js +0 -26
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docxodus",
3
- "version": "9.7.0",
3
+ "version": "9.9.0",
4
4
  "description": "Render, edit, diff and project Word .docx files in the browser — DOCX to HTML, a block editor, Word-grade redlines with tracked changes, and anchor-addressed markdown for LLM agents. WebAssembly, no server.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -38,7 +38,11 @@
38
38
  }
39
39
  },
40
40
  "files": [
41
- "dist"
41
+ "dist/*.js",
42
+ "dist/*.js.map",
43
+ "dist/*.d.ts",
44
+ "dist/*.d.ts.map",
45
+ "dist/wasm/_framework"
42
46
  ],
43
47
  "scripts": {
44
48
  "build:wasm": "../scripts/build-wasm.sh",
@@ -50,12 +54,17 @@
50
54
  "build:embed-bundle": "esbuild src/embed.ts --bundle --format=esm --outfile=dist/embed.bundle.js && esbuild src/embed.ts --bundle --format=iife --global-name=Docxodus --outfile=dist/embed.iife.js",
51
55
  "build:worker-bundle": "esbuild src/docxodus.worker.ts --bundle --format=esm --outfile=dist/docxodus.worker.js && esbuild src/worker-proxy.ts --bundle --format=esm --outfile=dist/worker-proxy.bundle.js",
52
56
  "build": "npm run build:wasm && npm run build:ts && npm run build:pagination-bundle && npm run build:session-bundle && npm run build:editor-bundle && npm run build:embed-bundle && npm run build:worker-bundle",
53
- "pretest": "npm run typecheck && cp tests/test-harness.html dist/wasm/ && cp tests/worker-test-harness.html dist/wasm/ && cp tests/profiling-harness.html dist/wasm/ && cp examples/editor.html dist/wasm/ && cp examples/embed.html dist/wasm/ && cp examples/ascii-animation.html dist/wasm/ && cp examples/ascii-animation-editor.html dist/wasm/ && cp ../docs/demo/ascii-scenes.js dist/wasm/ && cp ../docs/demo/player.html dist/wasm/player.html && cp ../docs/demo/index.html dist/wasm/demo-index.html && cp ../docs/demo/app.html dist/wasm/demo-app.html && cp ../docs/demo/observatory.html dist/wasm/demo-observatory.html && cp ../docs/demo/docxodus-demo-guide.docx dist/wasm/docxodus-demo-guide.docx && cp dist/pagination.bundle.js dist/wasm/ && cp dist/session.bundle.js dist/wasm/ && cp dist/editor.bundle.js dist/wasm/ && cp dist/embed.bundle.js dist/wasm/ && cp dist/docxodus.worker.js dist/wasm/ && cp dist/worker-proxy.bundle.js dist/wasm/worker-proxy.js",
57
+ "pretest": "npm run test:demo-logic && npm run typecheck && cp tests/test-harness.html dist/wasm/ && cp tests/worker-test-harness.html dist/wasm/ && cp tests/profiling-harness.html dist/wasm/ && cp examples/editor.html dist/wasm/ && cp examples/embed.html dist/wasm/ && cp examples/ascii-animation.html dist/wasm/ && cp examples/ascii-animation-editor.html dist/wasm/ && cp ../docs/demo/ascii-scenes.js dist/wasm/ && mkdir -p dist/wasm/fonts && cp ../docs/demo/fonts/docxodus-canvas-mono.woff2 dist/wasm/fonts/ &&cp ../docs/demo/player.html dist/wasm/player.html && cp ../docs/demo/index.html dist/wasm/demo-index.html && cp ../docs/demo/app.html dist/wasm/demo-app.html && cp ../docs/demo/observatory.html dist/wasm/demo-observatory.html && cp ../docs/demo/arcade.html dist/wasm/demo-arcade.html && cp ../docs/demo/ascii-arcade.js dist/wasm/ && cp ../docs/demo/freedoom-e1m1.js dist/wasm/ && cp ../docs/demo/docxodus-demo-guide.docx dist/wasm/docxodus-demo-guide.docx && cp dist/pagination.bundle.js dist/wasm/ && cp dist/session.bundle.js dist/wasm/ && cp dist/editor.bundle.js dist/wasm/ && cp dist/embed.bundle.js dist/wasm/ && cp dist/docxodus.worker.js dist/wasm/ && cp dist/worker-proxy.bundle.js dist/wasm/worker-proxy.js && npm run test:package-boundary",
58
+ "test:demo-logic": "node ../docs/demo/tools/ascii-arcade.test.mjs && node ../docs/demo/tools/wad2cart.test.mjs && node ../docs/demo/tools/canvas-font.test.mjs",
59
+ "test:package-boundary": "node scripts/check-package-boundary.mjs",
54
60
  "test": "playwright test",
61
+ "test:arcade:libreoffice": "npm run pretest && DOCXODUS_LO_PARITY=1 playwright test demo-arcade-libreoffice.spec.ts --project=chromium",
62
+ "test:visual-parity": "npm run pretest && DOCXODUS_VISUAL_PARITY=1 playwright test visual-parity.spec.ts visual-parity-reductions.spec.ts --project=chromium --reporter=line",
63
+ "capture:word-reference": "mkdir -p dist/wasm && playwright test word-reference-capture.spec.ts --project=chromium --reporter=line",
55
64
  "test:ui": "playwright test --ui",
56
65
  "demo": "npm run build && npm run demo:serve",
57
66
  "demo:serve": "cp dist/editor.bundle.js examples/editor.html dist/wasm/ && cp ../TestFiles/HC031-Complicated-Document.docx dist/wasm/sample.docx && echo '\\n>>> Open http://localhost:8088/editor.html\\n' && python3 -m http.server 8088 --directory dist/wasm",
58
- "prepublishOnly": "npm run build"
67
+ "prepublishOnly": "npm run build && npm run test:package-boundary"
59
68
  },
60
69
  "repository": {
61
70
  "type": "git",
@@ -85,7 +94,7 @@
85
94
  "agent",
86
95
  "react"
87
96
  ],
88
- "author": "JSv4",
97
+ "author": "John Scrudato IV",
89
98
  "license": "MIT",
90
99
  "bugs": {
91
100
  "url": "https://github.com/JSv4/Docxodus/issues"
@@ -1,238 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <title>Docxodus WASM Test</title>
6
- <style>
7
- body {
8
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
9
- max-width: 1200px;
10
- margin: 0 auto;
11
- padding: 20px;
12
- background: #f5f5f5;
13
- }
14
- h1 { color: #333; }
15
- .card {
16
- background: white;
17
- border-radius: 8px;
18
- padding: 20px;
19
- margin: 20px 0;
20
- box-shadow: 0 2px 4px rgba(0,0,0,0.1);
21
- }
22
- .card h2 {
23
- margin-top: 0;
24
- color: #555;
25
- border-bottom: 1px solid #eee;
26
- padding-bottom: 10px;
27
- }
28
- input[type="file"] {
29
- margin: 10px 0;
30
- }
31
- button {
32
- background: #007bff;
33
- color: white;
34
- border: none;
35
- padding: 10px 20px;
36
- border-radius: 4px;
37
- cursor: pointer;
38
- margin: 5px;
39
- }
40
- button:hover { background: #0056b3; }
41
- button:disabled {
42
- background: #ccc;
43
- cursor: not-allowed;
44
- }
45
- #output {
46
- background: #f8f9fa;
47
- border: 1px solid #dee2e6;
48
- border-radius: 4px;
49
- padding: 15px;
50
- margin-top: 15px;
51
- max-height: 500px;
52
- overflow: auto;
53
- }
54
- #status {
55
- padding: 10px;
56
- border-radius: 4px;
57
- margin-bottom: 20px;
58
- }
59
- .loading { background: #fff3cd; color: #856404; }
60
- .ready { background: #d4edda; color: #155724; }
61
- .error { background: #f8d7da; color: #721c24; }
62
- .file-inputs {
63
- display: flex;
64
- gap: 20px;
65
- flex-wrap: wrap;
66
- }
67
- .file-input-group {
68
- flex: 1;
69
- min-width: 250px;
70
- }
71
- .file-input-group label {
72
- display: block;
73
- margin-bottom: 5px;
74
- font-weight: 500;
75
- }
76
- </style>
77
- </head>
78
- <body>
79
- <h1>Docxodus WASM Test</h1>
80
-
81
- <div id="status" class="loading">Loading WASM runtime...</div>
82
-
83
- <div class="card">
84
- <h2>Convert DOCX to HTML</h2>
85
- <input type="file" id="convertFile" accept=".docx" disabled />
86
- <button id="convertBtn" onclick="convertToHtml()" disabled>Convert to HTML</button>
87
- </div>
88
-
89
- <div class="card">
90
- <h2>Compare Documents (Redline)</h2>
91
- <div class="file-inputs">
92
- <div class="file-input-group">
93
- <label>Original Document:</label>
94
- <input type="file" id="originalFile" accept=".docx" disabled />
95
- </div>
96
- <div class="file-input-group">
97
- <label>Modified Document:</label>
98
- <input type="file" id="modifiedFile" accept=".docx" disabled />
99
- </div>
100
- </div>
101
- <div style="margin-top: 15px;">
102
- <button id="compareHtmlBtn" onclick="compareToHtml()" disabled>Compare → HTML</button>
103
- <button id="compareDocxBtn" onclick="compareToDocx()" disabled>Compare → Download DOCX</button>
104
- </div>
105
- </div>
106
-
107
- <div class="card">
108
- <h2>Output</h2>
109
- <div id="output">Results will appear here...</div>
110
- </div>
111
-
112
- <script type="module" src="./main.js"></script>
113
- <script>
114
- // Wait for Docxodus to be ready
115
- window.onDocxodusReady = function() {
116
- document.getElementById('status').className = 'ready';
117
- document.getElementById('status').textContent = 'Docxodus WASM Ready!';
118
-
119
- // Enable all controls
120
- document.querySelectorAll('input, button').forEach(el => el.disabled = false);
121
- };
122
-
123
- // Check if already ready
124
- if (window.DocxodusReady) {
125
- window.onDocxodusReady();
126
- }
127
-
128
- async function readFileAsBytes(file) {
129
- const buffer = await file.arrayBuffer();
130
- return new Uint8Array(buffer);
131
- }
132
-
133
- async function convertToHtml() {
134
- const fileInput = document.getElementById('convertFile');
135
- const output = document.getElementById('output');
136
-
137
- if (!fileInput.files[0]) {
138
- output.innerHTML = '<p style="color: red;">Please select a DOCX file</p>';
139
- return;
140
- }
141
-
142
- output.innerHTML = '<p>Converting...</p>';
143
-
144
- try {
145
- const bytes = await readFileAsBytes(fileInput.files[0]);
146
- const html = window.Docxodus.DocumentConverter.ConvertDocxToHtml(bytes);
147
-
148
- if (html.startsWith('{') && html.includes('error')) {
149
- const error = JSON.parse(html);
150
- output.innerHTML = `<p style="color: red;">Error: ${error.error}</p>`;
151
- } else {
152
- output.innerHTML = html;
153
- }
154
- } catch (err) {
155
- output.innerHTML = `<p style="color: red;">Error: ${err.message}</p>`;
156
- }
157
- }
158
-
159
- async function compareToHtml() {
160
- const originalInput = document.getElementById('originalFile');
161
- const modifiedInput = document.getElementById('modifiedFile');
162
- const output = document.getElementById('output');
163
-
164
- if (!originalInput.files[0] || !modifiedInput.files[0]) {
165
- output.innerHTML = '<p style="color: red;">Please select both original and modified DOCX files</p>';
166
- return;
167
- }
168
-
169
- output.innerHTML = '<p>Comparing documents...</p>';
170
-
171
- try {
172
- const originalBytes = await readFileAsBytes(originalInput.files[0]);
173
- const modifiedBytes = await readFileAsBytes(modifiedInput.files[0]);
174
-
175
- const html = window.Docxodus.DocumentComparer.CompareDocumentsToHtml(
176
- originalBytes,
177
- modifiedBytes,
178
- 'Docxodus WASM'
179
- );
180
-
181
- if (html.startsWith('{') && html.includes('error')) {
182
- const error = JSON.parse(html);
183
- output.innerHTML = `<p style="color: red;">Error: ${error.error}</p>`;
184
- } else {
185
- output.innerHTML = html;
186
- }
187
- } catch (err) {
188
- output.innerHTML = `<p style="color: red;">Error: ${err.message}</p>`;
189
- }
190
- }
191
-
192
- async function compareToDocx() {
193
- const originalInput = document.getElementById('originalFile');
194
- const modifiedInput = document.getElementById('modifiedFile');
195
- const output = document.getElementById('output');
196
-
197
- if (!originalInput.files[0] || !modifiedInput.files[0]) {
198
- output.innerHTML = '<p style="color: red;">Please select both original and modified DOCX files</p>';
199
- return;
200
- }
201
-
202
- output.innerHTML = '<p>Comparing documents...</p>';
203
-
204
- try {
205
- const originalBytes = await readFileAsBytes(originalInput.files[0]);
206
- const modifiedBytes = await readFileAsBytes(modifiedInput.files[0]);
207
-
208
- const resultBytes = window.Docxodus.DocumentComparer.CompareDocuments(
209
- originalBytes,
210
- modifiedBytes,
211
- 'Docxodus WASM',
212
- 1 // ComparisonEngine.DocxDiff
213
- );
214
-
215
- if (resultBytes.length === 0) {
216
- output.innerHTML = '<p style="color: red;">Comparison failed - check console for details</p>';
217
- return;
218
- }
219
-
220
- // Download the result
221
- const blob = new Blob([resultBytes], {
222
- type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
223
- });
224
- const url = URL.createObjectURL(blob);
225
- const a = document.createElement('a');
226
- a.href = url;
227
- a.download = 'comparison-result.docx';
228
- a.click();
229
- URL.revokeObjectURL(url);
230
-
231
- output.innerHTML = '<p style="color: green;">Comparison complete! Download started.</p>';
232
- } catch (err) {
233
- output.innerHTML = `<p style="color: red;">Error: ${err.message}</p>`;
234
- }
235
- }
236
- </script>
237
- </body>
238
- </html>
package/dist/wasm/main.js DELETED
@@ -1,26 +0,0 @@
1
- // Docxodus WASM Bootstrap
2
- // This file initializes the .NET WASM runtime and exposes exports to JavaScript
3
-
4
- import { dotnet } from './_framework/dotnet.js';
5
-
6
- const { getAssemblyExports, getConfig } = await dotnet
7
- .withDiagnosticTracing(false)
8
- .create();
9
-
10
- const config = getConfig();
11
- const exports = await getAssemblyExports(config.mainAssemblyName);
12
-
13
- // Expose Docxodus APIs to window for testing
14
- window.Docxodus = {
15
- DocumentConverter: exports.DocxodusWasm.DocumentConverter,
16
- DocumentComparer: exports.DocxodusWasm.DocumentComparer
17
- };
18
-
19
- console.log("Docxodus WASM loaded successfully");
20
- console.log("Version:", window.Docxodus.DocumentConverter.GetVersion());
21
-
22
- // Signal that Docxodus is ready
23
- window.DocxodusReady = true;
24
- if (window.onDocxodusReady) {
25
- window.onDocxodusReady();
26
- }