docxodus 12.3.0 → 12.4.1

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 (120) hide show
  1. package/README.md +31 -6
  2. package/dist/core.d.ts +924 -0
  3. package/dist/core.d.ts.map +1 -0
  4. package/dist/core.js +2094 -0
  5. package/dist/core.js.map +1 -0
  6. package/dist/editor.bundle.js +1206 -27
  7. package/dist/editor.d.ts +10 -1
  8. package/dist/editor.d.ts.map +1 -1
  9. package/dist/editor.js +48 -16
  10. package/dist/editor.js.map +1 -1
  11. package/dist/embed.bundle.js +12371 -11779
  12. package/dist/embed.d.ts +5 -2
  13. package/dist/embed.d.ts.map +1 -1
  14. package/dist/embed.iife.js +12282 -11690
  15. package/dist/embed.js +10 -3
  16. package/dist/embed.js.map +1 -1
  17. package/dist/export-assets.json +39 -39
  18. package/dist/history-checkpoints.d.ts +2 -0
  19. package/dist/history-checkpoints.d.ts.map +1 -1
  20. package/dist/history-checkpoints.js +2 -0
  21. package/dist/history-checkpoints.js.map +1 -1
  22. package/dist/history-controls.d.ts +6 -3
  23. package/dist/history-controls.d.ts.map +1 -1
  24. package/dist/history-controls.js +71 -29
  25. package/dist/history-controls.js.map +1 -1
  26. package/dist/index.d.ts +3 -923
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +2 -2093
  29. package/dist/index.js.map +1 -1
  30. package/dist/ribbon-chrome.d.ts +1 -1
  31. package/dist/ribbon-chrome.d.ts.map +1 -1
  32. package/dist/ribbon-chrome.js +6 -3
  33. package/dist/ribbon-chrome.js.map +1 -1
  34. package/dist/ribbon-history.d.ts +85 -0
  35. package/dist/ribbon-history.d.ts.map +1 -0
  36. package/dist/ribbon-history.js +508 -0
  37. package/dist/ribbon-history.js.map +1 -0
  38. package/dist/ribbon.d.ts +6 -0
  39. package/dist/ribbon.d.ts.map +1 -1
  40. package/dist/ribbon.js +47 -18
  41. package/dist/ribbon.js.map +1 -1
  42. package/dist/viewport.d.ts +3 -1
  43. package/dist/viewport.d.ts.map +1 -1
  44. package/dist/viewport.js +14 -0
  45. package/dist/viewport.js.map +1 -1
  46. package/dist/wasm/_framework/Docxodus.wasm +0 -0
  47. package/dist/wasm/_framework/Docxodus.wasm.br +0 -0
  48. package/dist/wasm/_framework/DocxodusWasm.wasm +0 -0
  49. package/dist/wasm/_framework/DocxodusWasm.wasm.br +0 -0
  50. package/dist/wasm/_framework/System.Collections.Concurrent.wasm +0 -0
  51. package/dist/wasm/_framework/System.Collections.Concurrent.wasm.br +0 -0
  52. package/dist/wasm/_framework/System.Collections.Immutable.wasm +0 -0
  53. package/dist/wasm/_framework/System.Collections.Immutable.wasm.br +0 -0
  54. package/dist/wasm/_framework/System.Collections.NonGeneric.wasm +0 -0
  55. package/dist/wasm/_framework/System.Collections.NonGeneric.wasm.br +0 -0
  56. package/dist/wasm/_framework/System.Collections.Specialized.wasm +0 -0
  57. package/dist/wasm/_framework/System.Collections.Specialized.wasm.br +0 -0
  58. package/dist/wasm/_framework/System.Collections.wasm +0 -0
  59. package/dist/wasm/_framework/System.Collections.wasm.br +0 -0
  60. package/dist/wasm/_framework/System.ComponentModel.Primitives.wasm +0 -0
  61. package/dist/wasm/_framework/System.ComponentModel.Primitives.wasm.br +0 -0
  62. package/dist/wasm/_framework/System.ComponentModel.TypeConverter.wasm +0 -0
  63. package/dist/wasm/_framework/System.ComponentModel.TypeConverter.wasm.br +0 -0
  64. package/dist/wasm/_framework/System.ComponentModel.wasm +0 -0
  65. package/dist/wasm/_framework/System.ComponentModel.wasm.br +0 -0
  66. package/dist/wasm/_framework/System.Console.wasm +0 -0
  67. package/dist/wasm/_framework/System.Console.wasm.br +0 -0
  68. package/dist/wasm/_framework/System.IO.Compression.wasm +0 -0
  69. package/dist/wasm/_framework/System.IO.Compression.wasm.br +0 -0
  70. package/dist/wasm/_framework/System.IO.Pipelines.wasm +0 -0
  71. package/dist/wasm/_framework/System.IO.Pipelines.wasm.br +0 -0
  72. package/dist/wasm/_framework/System.Linq.Expressions.wasm +0 -0
  73. package/dist/wasm/_framework/System.Linq.Expressions.wasm.br +0 -0
  74. package/dist/wasm/_framework/System.Linq.wasm +0 -0
  75. package/dist/wasm/_framework/System.Linq.wasm.br +0 -0
  76. package/dist/wasm/_framework/System.Memory.wasm +0 -0
  77. package/dist/wasm/_framework/System.Memory.wasm.br +0 -0
  78. package/dist/wasm/_framework/System.Net.Http.wasm +0 -0
  79. package/dist/wasm/_framework/System.Net.Http.wasm.br +0 -0
  80. package/dist/wasm/_framework/System.Net.Primitives.wasm +0 -0
  81. package/dist/wasm/_framework/System.Net.Primitives.wasm.br +0 -0
  82. package/dist/wasm/_framework/System.ObjectModel.wasm +0 -0
  83. package/dist/wasm/_framework/System.ObjectModel.wasm.br +0 -0
  84. package/dist/wasm/_framework/System.Private.CoreLib.wasm +0 -0
  85. package/dist/wasm/_framework/System.Private.CoreLib.wasm.br +0 -0
  86. package/dist/wasm/_framework/System.Private.Uri.wasm +0 -0
  87. package/dist/wasm/_framework/System.Private.Uri.wasm.br +0 -0
  88. package/dist/wasm/_framework/System.Private.Xml.Linq.wasm +0 -0
  89. package/dist/wasm/_framework/System.Private.Xml.Linq.wasm.br +0 -0
  90. package/dist/wasm/_framework/System.Private.Xml.wasm +0 -0
  91. package/dist/wasm/_framework/System.Private.Xml.wasm.br +0 -0
  92. package/dist/wasm/_framework/System.Runtime.InteropServices.JavaScript.wasm +0 -0
  93. package/dist/wasm/_framework/System.Runtime.InteropServices.JavaScript.wasm.br +0 -0
  94. package/dist/wasm/_framework/System.Runtime.wasm +0 -0
  95. package/dist/wasm/_framework/System.Runtime.wasm.br +0 -0
  96. package/dist/wasm/_framework/System.Security.Cryptography.wasm +0 -0
  97. package/dist/wasm/_framework/System.Security.Cryptography.wasm.br +0 -0
  98. package/dist/wasm/_framework/System.Text.Encodings.Web.wasm +0 -0
  99. package/dist/wasm/_framework/System.Text.Encodings.Web.wasm.br +0 -0
  100. package/dist/wasm/_framework/System.Text.Json.wasm +0 -0
  101. package/dist/wasm/_framework/System.Text.Json.wasm.br +0 -0
  102. package/dist/wasm/_framework/System.Text.RegularExpressions.wasm +0 -0
  103. package/dist/wasm/_framework/System.Text.RegularExpressions.wasm.br +0 -0
  104. package/dist/wasm/_framework/System.Xml.Linq.wasm +0 -0
  105. package/dist/wasm/_framework/System.Xml.Linq.wasm.br +0 -0
  106. package/dist/wasm/_framework/System.Xml.XDocument.wasm +0 -0
  107. package/dist/wasm/_framework/System.Xml.XDocument.wasm.br +0 -0
  108. package/dist/wasm/_framework/System.wasm +0 -0
  109. package/dist/wasm/_framework/System.wasm.br +0 -0
  110. package/dist/wasm/_framework/dotnet.boot.js +34 -34
  111. package/dist/wasm/_framework/dotnet.boot.js.br +0 -0
  112. package/dist/wasm/_framework/dotnet.js +1 -1
  113. package/dist/wasm/_framework/dotnet.js.br +0 -0
  114. package/dist/wasm/_framework/dotnet.native.js +3 -3
  115. package/dist/wasm/_framework/dotnet.native.js.br +0 -0
  116. package/dist/wasm/_framework/dotnet.native.wasm +0 -0
  117. package/dist/wasm/_framework/dotnet.native.wasm.br +0 -0
  118. package/dist/wasm/_framework/dotnet.runtime.js +1 -1
  119. package/dist/wasm/_framework/dotnet.runtime.js.br +0 -0
  120. package/package.json +14 -8
package/README.md CHANGED
@@ -92,7 +92,7 @@ runtime location auto-detected — no build step, no configuration:
92
92
  ```html
93
93
  <div id="doc" style="height: 100dvh"></div>
94
94
  <script type="module">
95
- import { createRibbonEditor } from 'https://cdn.jsdelivr.net/npm/docxodus@12.2.0/dist/embed.bundle.js';
95
+ import { createRibbonEditor } from 'https://cdn.jsdelivr.net/npm/docxodus@12.3.0/dist/embed.bundle.js';
96
96
  const ribbon = await createRibbonEditor('#doc', './contract.docx'); // or bytes / Blob / File
97
97
  // ...later: const editedBytes = ribbon.save();
98
98
  </script>
@@ -275,6 +275,29 @@ function DocumentComparer() {
275
275
  }
276
276
  ```
277
277
 
278
+ ## Node.js (ES modules)
279
+
280
+ Import the engine from `docxodus/core` for server-side conversion, comparison, annotations,
281
+ and document sessions. It loads without a bundler or a custom Node loader:
282
+
283
+ ```js
284
+ import { readFile, writeFile } from 'node:fs/promises';
285
+ import { initialize, convertDocxToHtml, compareDocuments } from 'docxodus/core';
286
+
287
+ await initialize(); // Finds the WASM runtime included in the installed package.
288
+ const original = await readFile('original.docx');
289
+ const revised = await readFile('revised.docx');
290
+ await writeFile('original.html', await convertDocxToHtml(original));
291
+ await writeFile('redline.docx', await compareDocuments(original, revised));
292
+ ```
293
+
294
+ `docxodus/core` exposes the engine functions, types, enums, annotation helpers, and history
295
+ APIs from `docxodus`, excluding `DocxEditor`, `CommentGutter`, `mountRibbon`, and their editor
296
+ types. The existing `docxodus` entry includes those browser editor APIs and requires a browser
297
+ bundler; use `docxodus/core` in plain Node ESM. Both entries share the same engine state.
298
+ Browser helpers retained in `core`, such as pagination, the document viewport, IndexedDB
299
+ storage, and history controls, still require their browser APIs when called.
300
+
278
301
  ## API Reference
279
302
 
280
303
  ### Package verification
@@ -580,7 +603,7 @@ so a page can embed a full viewer or editor without hosting anything itself.
580
603
  <div id="app" style="height: 100dvh"></div>
581
604
  <script type="module">
582
605
  import { createViewer, createEditor, createRibbonEditor }
583
- from 'https://cdn.jsdelivr.net/npm/docxodus@12.2.0/dist/embed.bundle.js';
606
+ from 'https://cdn.jsdelivr.net/npm/docxodus@12.3.0/dist/embed.bundle.js';
584
607
 
585
608
  // Choose a factory, or render several into separate containers as shown.
586
609
  // Source may be a URL, Uint8Array, ArrayBuffer, Blob, or File.
@@ -610,7 +633,7 @@ For pages that can't use modules, `dist/embed.iife.js` exposes the same surface
610
633
 
611
634
  ```html
612
635
  <div id="doc"></div>
613
- <script src="https://cdn.jsdelivr.net/npm/docxodus@12.2.0/dist/embed.iife.js"></script>
636
+ <script src="https://cdn.jsdelivr.net/npm/docxodus@12.3.0/dist/embed.iife.js"></script>
614
637
  <script>
615
638
  Docxodus.createRibbonEditor('#doc').then((ribbon) => { /* ... */ });
616
639
  </script>
@@ -626,7 +649,7 @@ first `<bundle dir>/wasm/`, then `<bundle dir>/` as a fallback. On a CDN that re
626
649
 
627
650
  ### CDN caveats
628
651
 
629
- - **Pin an exact version in production** (`docxodus@12.2.0`, not `@latest`) — CDN responses are
652
+ - **Pin an exact version in production** (`docxodus@12.3.0`, not `@latest`) — CDN responses are
630
653
  cached as immutable, and the wire shapes between the JS wrappers and the WASM assemblies must
631
654
  come from the same release.
632
655
  - The build patches the .NET loader to fetch with `credentials: "omit"` — required because the
@@ -726,8 +749,10 @@ loading, comparison, checkpoint/restore and `.docxhistory` import/export over ho
726
749
  `mountHistoryControls` adds an accessible panel with separate previews, exact checkpoint retries
727
750
  and explicit history sharing. `openIndexedDbHistoryStore` provides optional browser persistence.
728
751
  These controls require `structuredClone` and `crypto.randomUUID`; the optional store also requires IndexedDB.
729
- The [TypeScript editor example](examples/history.ts) runs with `npm run build:history-example`
730
- and a local server serving `dist/wasm/history.html` after the WASM build.
752
+ The [shared editor example](examples/editor.html) includes an optional **Version history** drawer.
753
+ One `npm run build` produces the library, local editors and deployable site; run `npm run demo:serve`
754
+ and open `http://localhost:8088/editor.html`. In an embed, pass `history: true` to
755
+ `createRibbonEditor`, or `{ history: { workspaceId: "my-document" } }` to resume saved work across reloads.
731
756
 
732
757
  ## License
733
758