superdoc 2.4.0-next.26 → 2.4.0-next.28
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
CHANGED
|
@@ -5,15 +5,14 @@
|
|
|
5
5
|
[](https://docs.superdoc.dev/)
|
|
6
6
|
[](https://www.gnu.org/licenses/agpl-3.0)
|
|
7
7
|
[](https://www.npmjs.com/package/superdoc)
|
|
8
|
-
[](https://codecov.io/gh/superdoc/docx-editor)
|
|
9
8
|
[](https://discord.com/invite/b9UuaZRyaB)
|
|
10
9
|
|
|
11
|
-
SuperDoc renders and edits DOCX files in the browser. Built on OOXML
|
|
10
|
+
SuperDoc renders and edits DOCX files in the browser. Built on OOXML, not bolted onto HTML. As you type, you write directly to the XML, so edits do not pass through an HTML conversion step.
|
|
12
11
|
|
|
13
12
|
## Features
|
|
14
13
|
|
|
15
|
-
- **Real DOCX, not rich text** — Built on OOXML.
|
|
16
|
-
- **Self-hosted** —
|
|
14
|
+
- **Real DOCX, not rich text** — Built on OOXML. Pagination, section breaks, headers/footers, and complex tables are modeled as themselves, not flattened into HTML. Not a contenteditable wrapper with export bolted on.
|
|
15
|
+
- **Self-hosted** — The editor needs no server of its own. Documents go where your application sends them, and nowhere else by default.
|
|
17
16
|
- **Any framework** — React, Vue, Angular, Svelte, vanilla JS. One component, zero lock-in.
|
|
18
17
|
- **Real-time collaboration** — Yjs-based CRDT. Multiplayer editing with comments, tracked changes, and automatic conflict resolution.
|
|
19
18
|
- **Built for agents** — [SDK](https://www.npmjs.com/package/@superdoc/sdk), [CLI](https://www.npmjs.com/package/@superdoc/cli), and [MCP server](https://www.npmjs.com/package/@superdoc/mcp) let LLMs read, edit, and save .docx files programmatically.
|
|
@@ -25,6 +24,13 @@ SuperDoc renders and edits DOCX files in the browser. Built on OOXML — not bol
|
|
|
25
24
|
npm install superdoc
|
|
26
25
|
```
|
|
27
26
|
|
|
27
|
+
SuperDoc mounts into an element you provide, so the page needs it before this
|
|
28
|
+
runs:
|
|
29
|
+
|
|
30
|
+
```html
|
|
31
|
+
<div id="superdoc"></div>
|
|
32
|
+
```
|
|
33
|
+
|
|
28
34
|
```javascript
|
|
29
35
|
import 'superdoc/style.css';
|
|
30
36
|
import { SuperDoc } from 'superdoc';
|
|
@@ -32,16 +38,13 @@ import { SuperDoc } from 'superdoc';
|
|
|
32
38
|
const superdoc = new SuperDoc({
|
|
33
39
|
selector: '#superdoc',
|
|
34
40
|
documentMode: 'editing',
|
|
35
|
-
|
|
36
|
-
{
|
|
37
|
-
id: 'my-doc-id',
|
|
38
|
-
type: 'docx',
|
|
39
|
-
data: fileObject,
|
|
40
|
-
},
|
|
41
|
-
],
|
|
41
|
+
document: fileObject,
|
|
42
42
|
});
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
+
`document` accepts a URL, a `File`, or a `Blob`. Omit it to start from a blank
|
|
46
|
+
DOCX. The constructor throws if `selector` matches no element.
|
|
47
|
+
|
|
45
48
|
Supported document modes are `editing`, `viewing`, and `suggesting`. Do not use `edit`, `view`, or `suggest`.
|
|
46
49
|
|
|
47
50
|
### Browser Document API contract
|
|
@@ -64,13 +67,7 @@ export function embedSuperDoc({ file }) {
|
|
|
64
67
|
return new SuperDoc({
|
|
65
68
|
selector: '#editor',
|
|
66
69
|
documentMode: 'editing',
|
|
67
|
-
|
|
68
|
-
{
|
|
69
|
-
id: 'contract',
|
|
70
|
-
type: 'docx',
|
|
71
|
-
data: file,
|
|
72
|
-
},
|
|
73
|
-
],
|
|
70
|
+
document: file,
|
|
74
71
|
});
|
|
75
72
|
}
|
|
76
73
|
```
|
|
@@ -19,7 +19,7 @@ var COLLABORATION_UPGRADE_ENGINE_MINIMUM_NODE_MAJOR = 20;
|
|
|
19
19
|
var PRIVATE_ENGINE_INFO = (0, _superdoc_docx_engine_collaboration_upgrade_engine.getCollaborationUpgradeEngineInfo)();
|
|
20
20
|
var ENGINE_INFO = Object.freeze({
|
|
21
21
|
...PRIVATE_ENGINE_INFO,
|
|
22
|
-
superdocVersion: "2.4.0-next.
|
|
22
|
+
superdocVersion: "2.4.0-next.28",
|
|
23
23
|
roomSchemaVersion: Object.freeze({ ...PRIVATE_ENGINE_INFO.roomSchemaVersion }),
|
|
24
24
|
supportedBundleVersions: SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS,
|
|
25
25
|
supportedV1ReaderContractVersions: SUPPORTED_V1_READER_CONTRACT_VERSIONS
|
|
@@ -18,7 +18,7 @@ var COLLABORATION_UPGRADE_ENGINE_MINIMUM_NODE_MAJOR = 20;
|
|
|
18
18
|
var PRIVATE_ENGINE_INFO = getCollaborationUpgradeEngineInfo$1();
|
|
19
19
|
var ENGINE_INFO = Object.freeze({
|
|
20
20
|
...PRIVATE_ENGINE_INFO,
|
|
21
|
-
superdocVersion: "2.4.0-next.
|
|
21
|
+
superdocVersion: "2.4.0-next.28",
|
|
22
22
|
roomSchemaVersion: Object.freeze({ ...PRIVATE_ENGINE_INFO.roomSchemaVersion }),
|
|
23
23
|
supportedBundleVersions: SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS,
|
|
24
24
|
supportedV1ReaderContractVersions: SUPPORTED_V1_READER_CONTRACT_VERSIONS
|
package/dist/superdoc.cjs
CHANGED
|
@@ -43268,7 +43268,7 @@ var SuperDoc = class extends require_eventemitter3.import_eventemitter3.default
|
|
|
43268
43268
|
this.config.colors = shuffleArray(this.config.colors);
|
|
43269
43269
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
43270
43270
|
this.colorIndex = 0;
|
|
43271
|
-
this.version = "2.4.0-next.
|
|
43271
|
+
this.version = "2.4.0-next.28";
|
|
43272
43272
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
43273
43273
|
this.superdocId = config.superdocId || require_uuid.v4();
|
|
43274
43274
|
this.colors = this.config.colors ?? [];
|
package/dist/superdoc.es.js
CHANGED
|
@@ -43201,7 +43201,7 @@ var SuperDoc = class extends import_eventemitter3.default {
|
|
|
43201
43201
|
this.config.colors = shuffleArray(this.config.colors);
|
|
43202
43202
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
43203
43203
|
this.colorIndex = 0;
|
|
43204
|
-
this.version = "2.4.0-next.
|
|
43204
|
+
this.version = "2.4.0-next.28";
|
|
43205
43205
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
43206
43206
|
this.superdocId = config.superdocId || v4();
|
|
43207
43207
|
this.colors = this.config.colors ?? [];
|