docxodus 8.0.0 → 9.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.
- package/README.md +156 -31
- package/dist/editor-headerfooter.d.ts +39 -3
- package/dist/editor-headerfooter.d.ts.map +1 -1
- package/dist/editor-headerfooter.js +118 -2
- package/dist/editor-headerfooter.js.map +1 -1
- package/dist/editor-reconcile.d.ts +75 -0
- package/dist/editor-reconcile.d.ts.map +1 -0
- package/dist/editor-reconcile.js +125 -0
- package/dist/editor-reconcile.js.map +1 -0
- package/dist/editor.bundle.js +799 -42
- package/dist/editor.d.ts +121 -5
- package/dist/editor.d.ts.map +1 -1
- package/dist/editor.js +572 -31
- package/dist/editor.js.map +1 -1
- package/dist/embed.bundle.js +6569 -0
- package/dist/embed.d.ts +77 -0
- package/dist/embed.d.ts.map +1 -0
- package/dist/embed.iife.js +6596 -0
- package/dist/embed.js +350 -0
- package/dist/embed.js.map +1 -0
- package/dist/index.d.ts +11 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/dist/page-number-format.d.ts +22 -0
- package/dist/page-number-format.d.ts.map +1 -0
- package/dist/page-number-format.js +60 -0
- package/dist/page-number-format.js.map +1 -0
- package/dist/pagination.bundle.js +158 -21
- package/dist/pagination.d.ts +38 -0
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +181 -29
- package/dist/pagination.js.map +1 -1
- package/dist/session.bundle.js +241 -4
- package/dist/session.d.ts +154 -6
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +193 -4
- package/dist/session.js.map +1 -1
- package/dist/types.d.ts +192 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/wasm/_framework/DocumentFormat.OpenXml.Framework.wasm +0 -0
- package/dist/wasm/_framework/DocumentFormat.OpenXml.Framework.wasm.br +0 -0
- package/dist/wasm/_framework/DocumentFormat.OpenXml.wasm +0 -0
- package/dist/wasm/_framework/DocumentFormat.OpenXml.wasm.br +0 -0
- package/dist/wasm/_framework/Docxodus.wasm +0 -0
- package/dist/wasm/_framework/Docxodus.wasm.br +0 -0
- package/dist/wasm/_framework/DocxodusWasm.wasm +0 -0
- package/dist/wasm/_framework/DocxodusWasm.wasm.br +0 -0
- package/dist/wasm/_framework/System.Collections.Concurrent.wasm +0 -0
- package/dist/wasm/_framework/System.Collections.Concurrent.wasm.br +0 -0
- package/dist/wasm/_framework/System.Collections.Immutable.wasm.br +0 -0
- package/dist/wasm/_framework/System.Collections.NonGeneric.wasm.br +0 -0
- package/dist/wasm/_framework/System.Collections.Specialized.wasm.br +0 -0
- package/dist/wasm/_framework/System.Collections.wasm +0 -0
- package/dist/wasm/_framework/System.Collections.wasm.br +0 -0
- package/dist/wasm/_framework/System.ComponentModel.Primitives.wasm.br +0 -0
- package/dist/wasm/_framework/System.ComponentModel.TypeConverter.wasm.br +0 -0
- package/dist/wasm/_framework/System.ComponentModel.wasm.br +0 -0
- package/dist/wasm/_framework/System.Console.wasm +0 -0
- package/dist/wasm/_framework/System.Console.wasm.br +0 -0
- package/dist/wasm/_framework/System.Diagnostics.Process.wasm +0 -0
- package/dist/wasm/_framework/System.Diagnostics.Process.wasm.br +0 -0
- package/dist/wasm/_framework/System.IO.Compression.wasm +0 -0
- package/dist/wasm/_framework/System.IO.Compression.wasm.br +0 -0
- package/dist/wasm/_framework/System.IO.Packaging.wasm +0 -0
- package/dist/wasm/_framework/System.IO.Packaging.wasm.br +0 -0
- package/dist/wasm/_framework/System.IO.Pipelines.wasm.br +0 -0
- package/dist/wasm/_framework/System.Linq.Expressions.wasm.br +0 -0
- package/dist/wasm/_framework/System.Linq.wasm +0 -0
- package/dist/wasm/_framework/System.Linq.wasm.br +0 -0
- package/dist/wasm/_framework/System.Memory.wasm +0 -0
- package/dist/wasm/_framework/System.Memory.wasm.br +0 -0
- package/dist/wasm/_framework/System.Net.Http.wasm.br +0 -0
- package/dist/wasm/_framework/System.Net.Primitives.wasm.br +0 -0
- package/dist/wasm/_framework/System.ObjectModel.wasm.br +0 -0
- package/dist/wasm/_framework/System.Private.CoreLib.wasm +0 -0
- package/dist/wasm/_framework/System.Private.CoreLib.wasm.br +0 -0
- package/dist/wasm/_framework/System.Private.Uri.wasm.br +0 -0
- package/dist/wasm/_framework/System.Private.Xml.Linq.wasm +0 -0
- package/dist/wasm/_framework/System.Private.Xml.Linq.wasm.br +0 -0
- package/dist/wasm/_framework/System.Private.Xml.wasm +0 -0
- package/dist/wasm/_framework/System.Private.Xml.wasm.br +0 -0
- package/dist/wasm/_framework/System.Runtime.InteropServices.JavaScript.wasm.br +0 -0
- package/dist/wasm/_framework/System.Runtime.wasm +0 -0
- package/dist/wasm/_framework/System.Runtime.wasm.br +0 -0
- package/dist/wasm/_framework/System.Security.Cryptography.wasm.br +0 -0
- package/dist/wasm/_framework/System.Text.Encodings.Web.wasm.br +0 -0
- package/dist/wasm/_framework/System.Text.Json.wasm +0 -0
- package/dist/wasm/_framework/System.Text.Json.wasm.br +0 -0
- package/dist/wasm/_framework/System.Text.RegularExpressions.wasm +0 -0
- package/dist/wasm/_framework/System.Text.RegularExpressions.wasm.br +0 -0
- package/dist/wasm/_framework/System.Xml.Linq.wasm.br +0 -0
- package/dist/wasm/_framework/System.Xml.XDocument.wasm +0 -0
- package/dist/wasm/_framework/System.Xml.XDocument.wasm.br +0 -0
- package/dist/wasm/_framework/System.wasm.br +0 -0
- package/dist/wasm/_framework/dotnet.boot.js +22 -57
- package/dist/wasm/_framework/dotnet.boot.js.br +0 -0
- package/dist/wasm/_framework/dotnet.js.br +0 -0
- package/dist/wasm/_framework/dotnet.native.js +0 -171
- package/dist/wasm/_framework/dotnet.native.js.br +0 -0
- package/dist/wasm/_framework/dotnet.native.wasm +0 -0
- package/dist/wasm/_framework/dotnet.native.wasm.br +0 -0
- package/dist/wasm/_framework/dotnet.runtime.js.br +0 -0
- package/package.json +26 -5
- package/dist/wasm/_framework/System.Text.Encoding.Extensions.wasm +0 -0
- package/dist/wasm/_framework/System.Threading.Thread.wasm +0 -0
- package/dist/wasm/_framework/System.Threading.wasm +0 -0
- package/dist/wasm/_framework/System.Xml.ReaderWriter.wasm +0 -0
- package/dist/wasm/_framework/System.Xml.XPath.XDocument.wasm +0 -0
- package/dist/wasm/_framework/System.Xml.XPath.wasm +0 -0
- package/dist/wasm/_framework/dotnet.js.map +0 -1
- package/dist/wasm/_framework/dotnet.native.js.symbols +0 -5532
- package/dist/wasm/_framework/dotnet.runtime.js.map +0 -1
package/dist/embed.d.ts
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Embeddable viewer/editor entry point — the CDN story.
|
|
3
|
+
*
|
|
4
|
+
* This module packages the whole stack behind two one-call factories so a page
|
|
5
|
+
* can embed a DOCX viewer or editor with a single script tag and no build step:
|
|
6
|
+
*
|
|
7
|
+
* ```html
|
|
8
|
+
* <div id="doc"></div>
|
|
9
|
+
* <script type="module">
|
|
10
|
+
* import { createViewer } from "https://cdn.jsdelivr.net/npm/docxodus@9.1.0/dist/embed.bundle.js";
|
|
11
|
+
* await createViewer("#doc", "./contract.docx");
|
|
12
|
+
* </script>
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* It ships in three shapes (see package.json build scripts):
|
|
16
|
+
* - `dist/embed.js` — plain ESM with relative imports, for bundler users
|
|
17
|
+
* (`import { createEditor } from "docxodus/embed"`).
|
|
18
|
+
* Shares module state with the main `docxodus` entry.
|
|
19
|
+
* - `dist/embed.bundle.js` — self-contained ESM bundle for CDN `<script type="module">`.
|
|
20
|
+
* - `dist/embed.iife.js` — classic-script bundle exposing `window.Docxodus`.
|
|
21
|
+
*
|
|
22
|
+
* WASM asset resolution: the .NET runtime files live in `wasm/` next to this
|
|
23
|
+
* file (`dist/wasm/` in the published package), which auto-resolves through
|
|
24
|
+
* `import.meta.url` in the ESM shapes. The IIFE shape has no `import.meta`, so
|
|
25
|
+
* it falls back to `document.currentScript.src` captured at load time. An
|
|
26
|
+
* explicit `wasmBasePath` option always wins.
|
|
27
|
+
*/
|
|
28
|
+
import { DocxEditor } from "./editor.js";
|
|
29
|
+
import type { DocxEditorOptions } from "./editor.js";
|
|
30
|
+
import type { ConversionOptions } from "./types.js";
|
|
31
|
+
export * from "./index.js";
|
|
32
|
+
export { DocxEditor } from "./editor.js";
|
|
33
|
+
export type { DocxEditorExports, DocxEditorOptions } from "./editor.js";
|
|
34
|
+
/**
|
|
35
|
+
* A document to load: raw bytes, a Blob/File (e.g. from an <input type="file">),
|
|
36
|
+
* or a URL string to fetch (must be same-origin or CORS-readable).
|
|
37
|
+
*/
|
|
38
|
+
export type DocumentSource = Uint8Array | ArrayBuffer | Blob | string;
|
|
39
|
+
/** Normalize any DocumentSource to bytes. */
|
|
40
|
+
export declare function toDocumentBytes(source: DocumentSource): Promise<Uint8Array>;
|
|
41
|
+
export interface DocxViewerOptions extends ConversionOptions {
|
|
42
|
+
/** Explicit URL of the wasm assets directory; omit to auto-detect. */
|
|
43
|
+
wasmBasePath?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface DocxViewer {
|
|
46
|
+
/** The container the document was rendered into. */
|
|
47
|
+
readonly element: HTMLElement;
|
|
48
|
+
/** The full HTML document string the converter produced. */
|
|
49
|
+
readonly html: string;
|
|
50
|
+
/** Re-render a (new) document into the same container. */
|
|
51
|
+
reload(source: DocumentSource, options?: ConversionOptions): Promise<void>;
|
|
52
|
+
/** Empty the container. */
|
|
53
|
+
destroy(): void;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Render a read-only DOCX viewer into `container`.
|
|
57
|
+
*
|
|
58
|
+
* Injects the converter's stylesheet plus the document body into the container
|
|
59
|
+
* (the same mounting the editor uses), so the page's own styles are untouched.
|
|
60
|
+
* Footnotes/endnotes render by default — they are document content; override
|
|
61
|
+
* any conversion option via `options`.
|
|
62
|
+
*/
|
|
63
|
+
export declare function createViewer(container: string | HTMLElement, source: DocumentSource, options?: DocxViewerOptions): Promise<DocxViewer>;
|
|
64
|
+
export interface CreateEditorOptions extends DocxEditorOptions {
|
|
65
|
+
/** Explicit URL of the wasm assets directory; omit to auto-detect. */
|
|
66
|
+
wasmBasePath?: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Open an editable DOCX editor in `container`.
|
|
70
|
+
*
|
|
71
|
+
* With a `source`, opens that document; without one, opens a blank "New
|
|
72
|
+
* document". Returns the `DocxEditor` instance — `save()` for the edited
|
|
73
|
+
* bytes, `close()` to release the WASM session, plus the full command surface
|
|
74
|
+
* (formatting, tables, notes, headers/footers, undo/redo).
|
|
75
|
+
*/
|
|
76
|
+
export declare function createEditor(container: string | HTMLElement, source?: DocumentSource | null, options?: CreateEditorOptions): Promise<DocxEditor>;
|
|
77
|
+
//# sourceMappingURL=embed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embed.d.ts","sourceRoot":"","sources":["../src/embed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAOH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAqB,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAIpD,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAExE;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,WAAW,GAAG,IAAI,GAAG,MAAM,CAAC;AA+OtE,6CAA6C;AAC7C,wBAAsB,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,CAgBjF;AAED,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB;IAC1D,sEAAsE;IACtE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,UAAU;IACzB,oDAAoD;IACpD,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,MAAM,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3E,2BAA2B;IAC3B,OAAO,IAAI,IAAI,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAChC,SAAS,EAAE,MAAM,GAAG,WAAW,EAC/B,MAAM,EAAE,cAAc,EACtB,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,UAAU,CAAC,CAsCrB;AAED,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC5D,sEAAsE;IACtE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAChC,SAAS,EAAE,MAAM,GAAG,WAAW,EAC/B,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,EAC9B,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,UAAU,CAAC,CAmBrB"}
|