docxodus 0.1.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 (202) hide show
  1. package/README.md +209 -0
  2. package/dist/index.d.ts +63 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +188 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/react.d.ts +134 -0
  7. package/dist/react.d.ts.map +1 -0
  8. package/dist/react.js +262 -0
  9. package/dist/react.js.map +1 -0
  10. package/dist/types.d.ts +79 -0
  11. package/dist/types.d.ts.map +1 -0
  12. package/dist/types.js +2 -0
  13. package/dist/types.js.map +1 -0
  14. package/dist/wasm/_framework/DocumentFormat.OpenXml.Framework.wasm +0 -0
  15. package/dist/wasm/_framework/DocumentFormat.OpenXml.wasm +0 -0
  16. package/dist/wasm/_framework/Docxodus.pdb +0 -0
  17. package/dist/wasm/_framework/Docxodus.wasm +0 -0
  18. package/dist/wasm/_framework/DocxodusWasm.pdb +0 -0
  19. package/dist/wasm/_framework/DocxodusWasm.wasm +0 -0
  20. package/dist/wasm/_framework/Microsoft.CSharp.wasm +0 -0
  21. package/dist/wasm/_framework/Microsoft.VisualBasic.Core.wasm +0 -0
  22. package/dist/wasm/_framework/Microsoft.VisualBasic.wasm +0 -0
  23. package/dist/wasm/_framework/Microsoft.Win32.Primitives.wasm +0 -0
  24. package/dist/wasm/_framework/Microsoft.Win32.Registry.wasm +0 -0
  25. package/dist/wasm/_framework/SkiaSharp.pdb +0 -0
  26. package/dist/wasm/_framework/SkiaSharp.wasm +0 -0
  27. package/dist/wasm/_framework/System.AppContext.wasm +0 -0
  28. package/dist/wasm/_framework/System.Buffers.wasm +0 -0
  29. package/dist/wasm/_framework/System.Collections.Concurrent.wasm +0 -0
  30. package/dist/wasm/_framework/System.Collections.Immutable.wasm +0 -0
  31. package/dist/wasm/_framework/System.Collections.NonGeneric.wasm +0 -0
  32. package/dist/wasm/_framework/System.Collections.Specialized.wasm +0 -0
  33. package/dist/wasm/_framework/System.Collections.wasm +0 -0
  34. package/dist/wasm/_framework/System.ComponentModel.Annotations.wasm +0 -0
  35. package/dist/wasm/_framework/System.ComponentModel.DataAnnotations.wasm +0 -0
  36. package/dist/wasm/_framework/System.ComponentModel.EventBasedAsync.wasm +0 -0
  37. package/dist/wasm/_framework/System.ComponentModel.Primitives.wasm +0 -0
  38. package/dist/wasm/_framework/System.ComponentModel.TypeConverter.wasm +0 -0
  39. package/dist/wasm/_framework/System.ComponentModel.wasm +0 -0
  40. package/dist/wasm/_framework/System.Configuration.wasm +0 -0
  41. package/dist/wasm/_framework/System.Console.wasm +0 -0
  42. package/dist/wasm/_framework/System.Core.wasm +0 -0
  43. package/dist/wasm/_framework/System.Data.Common.wasm +0 -0
  44. package/dist/wasm/_framework/System.Data.DataSetExtensions.wasm +0 -0
  45. package/dist/wasm/_framework/System.Data.wasm +0 -0
  46. package/dist/wasm/_framework/System.Diagnostics.Contracts.wasm +0 -0
  47. package/dist/wasm/_framework/System.Diagnostics.Debug.wasm +0 -0
  48. package/dist/wasm/_framework/System.Diagnostics.DiagnosticSource.wasm +0 -0
  49. package/dist/wasm/_framework/System.Diagnostics.FileVersionInfo.wasm +0 -0
  50. package/dist/wasm/_framework/System.Diagnostics.Process.wasm +0 -0
  51. package/dist/wasm/_framework/System.Diagnostics.StackTrace.wasm +0 -0
  52. package/dist/wasm/_framework/System.Diagnostics.TextWriterTraceListener.wasm +0 -0
  53. package/dist/wasm/_framework/System.Diagnostics.Tools.wasm +0 -0
  54. package/dist/wasm/_framework/System.Diagnostics.TraceSource.wasm +0 -0
  55. package/dist/wasm/_framework/System.Diagnostics.Tracing.wasm +0 -0
  56. package/dist/wasm/_framework/System.Drawing.Primitives.wasm +0 -0
  57. package/dist/wasm/_framework/System.Drawing.wasm +0 -0
  58. package/dist/wasm/_framework/System.Dynamic.Runtime.wasm +0 -0
  59. package/dist/wasm/_framework/System.Formats.Asn1.wasm +0 -0
  60. package/dist/wasm/_framework/System.Formats.Tar.wasm +0 -0
  61. package/dist/wasm/_framework/System.Globalization.Calendars.wasm +0 -0
  62. package/dist/wasm/_framework/System.Globalization.Extensions.wasm +0 -0
  63. package/dist/wasm/_framework/System.Globalization.wasm +0 -0
  64. package/dist/wasm/_framework/System.IO.Compression.Brotli.wasm +0 -0
  65. package/dist/wasm/_framework/System.IO.Compression.FileSystem.wasm +0 -0
  66. package/dist/wasm/_framework/System.IO.Compression.ZipFile.wasm +0 -0
  67. package/dist/wasm/_framework/System.IO.Compression.wasm +0 -0
  68. package/dist/wasm/_framework/System.IO.FileSystem.AccessControl.wasm +0 -0
  69. package/dist/wasm/_framework/System.IO.FileSystem.DriveInfo.wasm +0 -0
  70. package/dist/wasm/_framework/System.IO.FileSystem.Primitives.wasm +0 -0
  71. package/dist/wasm/_framework/System.IO.FileSystem.Watcher.wasm +0 -0
  72. package/dist/wasm/_framework/System.IO.FileSystem.wasm +0 -0
  73. package/dist/wasm/_framework/System.IO.IsolatedStorage.wasm +0 -0
  74. package/dist/wasm/_framework/System.IO.MemoryMappedFiles.wasm +0 -0
  75. package/dist/wasm/_framework/System.IO.Packaging.wasm +0 -0
  76. package/dist/wasm/_framework/System.IO.Pipes.AccessControl.wasm +0 -0
  77. package/dist/wasm/_framework/System.IO.Pipes.wasm +0 -0
  78. package/dist/wasm/_framework/System.IO.UnmanagedMemoryStream.wasm +0 -0
  79. package/dist/wasm/_framework/System.IO.wasm +0 -0
  80. package/dist/wasm/_framework/System.Linq.Expressions.wasm +0 -0
  81. package/dist/wasm/_framework/System.Linq.Parallel.wasm +0 -0
  82. package/dist/wasm/_framework/System.Linq.Queryable.wasm +0 -0
  83. package/dist/wasm/_framework/System.Linq.wasm +0 -0
  84. package/dist/wasm/_framework/System.Memory.wasm +0 -0
  85. package/dist/wasm/_framework/System.Net.Http.Json.wasm +0 -0
  86. package/dist/wasm/_framework/System.Net.Http.wasm +0 -0
  87. package/dist/wasm/_framework/System.Net.HttpListener.wasm +0 -0
  88. package/dist/wasm/_framework/System.Net.Mail.wasm +0 -0
  89. package/dist/wasm/_framework/System.Net.NameResolution.wasm +0 -0
  90. package/dist/wasm/_framework/System.Net.NetworkInformation.wasm +0 -0
  91. package/dist/wasm/_framework/System.Net.Ping.wasm +0 -0
  92. package/dist/wasm/_framework/System.Net.Primitives.wasm +0 -0
  93. package/dist/wasm/_framework/System.Net.Quic.wasm +0 -0
  94. package/dist/wasm/_framework/System.Net.Requests.wasm +0 -0
  95. package/dist/wasm/_framework/System.Net.Security.wasm +0 -0
  96. package/dist/wasm/_framework/System.Net.ServicePoint.wasm +0 -0
  97. package/dist/wasm/_framework/System.Net.Sockets.wasm +0 -0
  98. package/dist/wasm/_framework/System.Net.WebClient.wasm +0 -0
  99. package/dist/wasm/_framework/System.Net.WebHeaderCollection.wasm +0 -0
  100. package/dist/wasm/_framework/System.Net.WebProxy.wasm +0 -0
  101. package/dist/wasm/_framework/System.Net.WebSockets.Client.wasm +0 -0
  102. package/dist/wasm/_framework/System.Net.WebSockets.wasm +0 -0
  103. package/dist/wasm/_framework/System.Net.wasm +0 -0
  104. package/dist/wasm/_framework/System.Numerics.Vectors.wasm +0 -0
  105. package/dist/wasm/_framework/System.Numerics.wasm +0 -0
  106. package/dist/wasm/_framework/System.ObjectModel.wasm +0 -0
  107. package/dist/wasm/_framework/System.Private.CoreLib.wasm +0 -0
  108. package/dist/wasm/_framework/System.Private.DataContractSerialization.wasm +0 -0
  109. package/dist/wasm/_framework/System.Private.Uri.wasm +0 -0
  110. package/dist/wasm/_framework/System.Private.Xml.Linq.wasm +0 -0
  111. package/dist/wasm/_framework/System.Private.Xml.wasm +0 -0
  112. package/dist/wasm/_framework/System.Reflection.DispatchProxy.wasm +0 -0
  113. package/dist/wasm/_framework/System.Reflection.Emit.ILGeneration.wasm +0 -0
  114. package/dist/wasm/_framework/System.Reflection.Emit.Lightweight.wasm +0 -0
  115. package/dist/wasm/_framework/System.Reflection.Emit.wasm +0 -0
  116. package/dist/wasm/_framework/System.Reflection.Extensions.wasm +0 -0
  117. package/dist/wasm/_framework/System.Reflection.Metadata.wasm +0 -0
  118. package/dist/wasm/_framework/System.Reflection.Primitives.wasm +0 -0
  119. package/dist/wasm/_framework/System.Reflection.TypeExtensions.wasm +0 -0
  120. package/dist/wasm/_framework/System.Reflection.wasm +0 -0
  121. package/dist/wasm/_framework/System.Resources.Reader.wasm +0 -0
  122. package/dist/wasm/_framework/System.Resources.ResourceManager.wasm +0 -0
  123. package/dist/wasm/_framework/System.Resources.Writer.wasm +0 -0
  124. package/dist/wasm/_framework/System.Runtime.CompilerServices.Unsafe.wasm +0 -0
  125. package/dist/wasm/_framework/System.Runtime.CompilerServices.VisualC.wasm +0 -0
  126. package/dist/wasm/_framework/System.Runtime.Extensions.wasm +0 -0
  127. package/dist/wasm/_framework/System.Runtime.Handles.wasm +0 -0
  128. package/dist/wasm/_framework/System.Runtime.InteropServices.JavaScript.wasm +0 -0
  129. package/dist/wasm/_framework/System.Runtime.InteropServices.RuntimeInformation.wasm +0 -0
  130. package/dist/wasm/_framework/System.Runtime.InteropServices.wasm +0 -0
  131. package/dist/wasm/_framework/System.Runtime.Intrinsics.wasm +0 -0
  132. package/dist/wasm/_framework/System.Runtime.Loader.wasm +0 -0
  133. package/dist/wasm/_framework/System.Runtime.Numerics.wasm +0 -0
  134. package/dist/wasm/_framework/System.Runtime.Serialization.Formatters.wasm +0 -0
  135. package/dist/wasm/_framework/System.Runtime.Serialization.Json.wasm +0 -0
  136. package/dist/wasm/_framework/System.Runtime.Serialization.Primitives.wasm +0 -0
  137. package/dist/wasm/_framework/System.Runtime.Serialization.Xml.wasm +0 -0
  138. package/dist/wasm/_framework/System.Runtime.Serialization.wasm +0 -0
  139. package/dist/wasm/_framework/System.Runtime.wasm +0 -0
  140. package/dist/wasm/_framework/System.Security.AccessControl.wasm +0 -0
  141. package/dist/wasm/_framework/System.Security.Claims.wasm +0 -0
  142. package/dist/wasm/_framework/System.Security.Cryptography.Algorithms.wasm +0 -0
  143. package/dist/wasm/_framework/System.Security.Cryptography.Cng.wasm +0 -0
  144. package/dist/wasm/_framework/System.Security.Cryptography.Csp.wasm +0 -0
  145. package/dist/wasm/_framework/System.Security.Cryptography.Encoding.wasm +0 -0
  146. package/dist/wasm/_framework/System.Security.Cryptography.OpenSsl.wasm +0 -0
  147. package/dist/wasm/_framework/System.Security.Cryptography.Primitives.wasm +0 -0
  148. package/dist/wasm/_framework/System.Security.Cryptography.X509Certificates.wasm +0 -0
  149. package/dist/wasm/_framework/System.Security.Cryptography.wasm +0 -0
  150. package/dist/wasm/_framework/System.Security.Principal.Windows.wasm +0 -0
  151. package/dist/wasm/_framework/System.Security.Principal.wasm +0 -0
  152. package/dist/wasm/_framework/System.Security.SecureString.wasm +0 -0
  153. package/dist/wasm/_framework/System.Security.wasm +0 -0
  154. package/dist/wasm/_framework/System.ServiceModel.Web.wasm +0 -0
  155. package/dist/wasm/_framework/System.ServiceProcess.wasm +0 -0
  156. package/dist/wasm/_framework/System.Text.Encoding.CodePages.wasm +0 -0
  157. package/dist/wasm/_framework/System.Text.Encoding.Extensions.wasm +0 -0
  158. package/dist/wasm/_framework/System.Text.Encoding.wasm +0 -0
  159. package/dist/wasm/_framework/System.Text.Encodings.Web.wasm +0 -0
  160. package/dist/wasm/_framework/System.Text.Json.wasm +0 -0
  161. package/dist/wasm/_framework/System.Text.RegularExpressions.wasm +0 -0
  162. package/dist/wasm/_framework/System.Threading.Channels.wasm +0 -0
  163. package/dist/wasm/_framework/System.Threading.Overlapped.wasm +0 -0
  164. package/dist/wasm/_framework/System.Threading.Tasks.Dataflow.wasm +0 -0
  165. package/dist/wasm/_framework/System.Threading.Tasks.Extensions.wasm +0 -0
  166. package/dist/wasm/_framework/System.Threading.Tasks.Parallel.wasm +0 -0
  167. package/dist/wasm/_framework/System.Threading.Tasks.wasm +0 -0
  168. package/dist/wasm/_framework/System.Threading.Thread.wasm +0 -0
  169. package/dist/wasm/_framework/System.Threading.ThreadPool.wasm +0 -0
  170. package/dist/wasm/_framework/System.Threading.Timer.wasm +0 -0
  171. package/dist/wasm/_framework/System.Threading.wasm +0 -0
  172. package/dist/wasm/_framework/System.Transactions.Local.wasm +0 -0
  173. package/dist/wasm/_framework/System.Transactions.wasm +0 -0
  174. package/dist/wasm/_framework/System.ValueTuple.wasm +0 -0
  175. package/dist/wasm/_framework/System.Web.HttpUtility.wasm +0 -0
  176. package/dist/wasm/_framework/System.Web.wasm +0 -0
  177. package/dist/wasm/_framework/System.Windows.wasm +0 -0
  178. package/dist/wasm/_framework/System.Xml.Linq.wasm +0 -0
  179. package/dist/wasm/_framework/System.Xml.ReaderWriter.wasm +0 -0
  180. package/dist/wasm/_framework/System.Xml.Serialization.wasm +0 -0
  181. package/dist/wasm/_framework/System.Xml.XDocument.wasm +0 -0
  182. package/dist/wasm/_framework/System.Xml.XPath.XDocument.wasm +0 -0
  183. package/dist/wasm/_framework/System.Xml.XPath.wasm +0 -0
  184. package/dist/wasm/_framework/System.Xml.XmlDocument.wasm +0 -0
  185. package/dist/wasm/_framework/System.Xml.XmlSerializer.wasm +0 -0
  186. package/dist/wasm/_framework/System.Xml.wasm +0 -0
  187. package/dist/wasm/_framework/System.wasm +0 -0
  188. package/dist/wasm/_framework/WindowsBase.wasm +0 -0
  189. package/dist/wasm/_framework/blazor.boot.json +206 -0
  190. package/dist/wasm/_framework/dotnet.js +4 -0
  191. package/dist/wasm/_framework/dotnet.js.map +1 -0
  192. package/dist/wasm/_framework/dotnet.native.js +17 -0
  193. package/dist/wasm/_framework/dotnet.native.js.symbols +18688 -0
  194. package/dist/wasm/_framework/dotnet.native.wasm +0 -0
  195. package/dist/wasm/_framework/dotnet.runtime.js +4 -0
  196. package/dist/wasm/_framework/dotnet.runtime.js.map +1 -0
  197. package/dist/wasm/_framework/mscorlib.wasm +0 -0
  198. package/dist/wasm/_framework/netstandard.wasm +0 -0
  199. package/dist/wasm/_framework/supportFiles/0_runtimeconfig.bin +1 -0
  200. package/dist/wasm/index.html +237 -0
  201. package/dist/wasm/main.js +26 -0
  202. package/package.json +67 -0
@@ -0,0 +1 @@
1
+ MMicrosoft.Extensions.DependencyInjection.VerifyOpenGenericServiceTrimmabilitytruefSystem.ComponentModel.TypeConverter.EnableUnsafeBinaryFormatterInDesigntimeLicenseContextSerializationfalse'System.Diagnostics.Debugger.IsSupportedfalse2System.Diagnostics.Tracing.EventSource.IsSupportedfalseSystem.Globalization.Invarianttrue+System.Globalization.PredefinedCulturesOnlytrue6System.Reflection.Metadata.MetadataUpdater.IsSupportedfalse9System.Resources.ResourceManager.AllowCustomResourceTypesfalse<System.Runtime.InteropServices.BuiltInComInterop.IsSupportedfalseJSystem.Runtime.InteropServices.EnableConsumingManagedCodeFromNativeHostingfalse9System.Runtime.InteropServices.EnableCppCLIHostActivationfalseVSystem.Runtime.InteropServices.Marshalling.EnableGeneratedComInterfaceComImportInteropfalseESystem.Runtime.Serialization.EnableUnsafeBinaryFormatterSerializationfalse&System.StartupHookProvider.IsSupportedfalse-System.Text.Encoding.EnableUnsafeUTF7Encodingfalse<System.Text.Json.JsonSerializer.IsReflectionEnabledByDefaultfalse-System.Threading.Thread.EnableAutoreleasePoolfalse
@@ -0,0 +1,237 @@
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
+ );
213
+
214
+ if (resultBytes.length === 0) {
215
+ output.innerHTML = '<p style="color: red;">Comparison failed - check console for details</p>';
216
+ return;
217
+ }
218
+
219
+ // Download the result
220
+ const blob = new Blob([resultBytes], {
221
+ type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
222
+ });
223
+ const url = URL.createObjectURL(blob);
224
+ const a = document.createElement('a');
225
+ a.href = url;
226
+ a.download = 'comparison-result.docx';
227
+ a.click();
228
+ URL.revokeObjectURL(url);
229
+
230
+ output.innerHTML = '<p style="color: green;">Comparison complete! Download started.</p>';
231
+ } catch (err) {
232
+ output.innerHTML = `<p style="color: red;">Error: ${err.message}</p>`;
233
+ }
234
+ }
235
+ </script>
236
+ </body>
237
+ </html>
@@ -0,0 +1,26 @@
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
+ }
package/package.json ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "docxodus",
3
+ "version": "0.1.0",
4
+ "description": "DOCX document comparison and HTML conversion in the browser using WebAssembly",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ },
14
+ "./react": {
15
+ "import": "./dist/react.js",
16
+ "types": "./dist/react.d.ts"
17
+ }
18
+ },
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "scripts": {
23
+ "build:wasm": "../scripts/build-wasm.sh",
24
+ "build:ts": "tsc",
25
+ "build": "npm run build:wasm && npm run build:ts",
26
+ "pretest": "cp tests/test-harness.html dist/wasm/",
27
+ "test": "playwright test",
28
+ "test:ui": "playwright test --ui",
29
+ "prepublishOnly": "npm run build"
30
+ },
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+https://github.com/JSv4/Redlines.git"
34
+ },
35
+ "keywords": [
36
+ "docx",
37
+ "word",
38
+ "document",
39
+ "comparison",
40
+ "redline",
41
+ "track-changes",
42
+ "wasm",
43
+ "webassembly",
44
+ "html",
45
+ "converter"
46
+ ],
47
+ "author": "JSv4",
48
+ "license": "MIT",
49
+ "bugs": {
50
+ "url": "https://github.com/JSv4/Redlines/issues"
51
+ },
52
+ "homepage": "https://github.com/JSv4/Redlines#readme",
53
+ "peerDependencies": {
54
+ "react": ">=16.8.0"
55
+ },
56
+ "peerDependenciesMeta": {
57
+ "react": {
58
+ "optional": true
59
+ }
60
+ },
61
+ "devDependencies": {
62
+ "@playwright/test": "^1.57.0",
63
+ "@types/node": "^20.10.0",
64
+ "@types/react": "^19.2.7",
65
+ "typescript": "^5.3.0"
66
+ }
67
+ }