superdoc 2.4.0-next.56 → 2.4.0-next.58

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
@@ -1,103 +1,28 @@
1
- # SuperDoc
1
+ # superdoc
2
2
 
3
- > The document engine for DOCX files.
3
+ Browser editor for opening, editing, and rendering DOCX files.
4
4
 
5
- [![Documentation](https://img.shields.io/badge/docs-available-1355ff.svg)](https://docs.superdoc.dev/)
6
- [![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-1355ff.svg)](https://www.gnu.org/licenses/agpl-3.0)
7
- [![npm version](https://img.shields.io/npm/v/superdoc.svg?color=1355ff)](https://www.npmjs.com/package/superdoc)
8
- [![Discord](https://img.shields.io/badge/discord-join-1355ff)](https://discord.com/invite/b9UuaZRyaB)
9
-
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.
11
-
12
- ## Features
13
-
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.
16
- - **Any framework** — React, Vue, Angular, Svelte, vanilla JS. One component, zero lock-in.
17
- - **Real-time collaboration** — Yjs-based CRDT. Multiplayer editing with comments, tracked changes, and automatic conflict resolution.
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.
19
- - **Dual licensed** — AGPLv3 for community use. [Commercial license](https://www.superdocportal.dev/get-in-touch) for proprietary deployments.
20
-
21
- ## Quick start
5
+ ## Install
22
6
 
23
7
  ```bash
24
8
  npm install superdoc
25
9
  ```
26
10
 
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
-
34
- ```javascript
35
- import 'superdoc/style.css';
36
- import { SuperDoc } from 'superdoc';
37
-
38
- const superdoc = new SuperDoc({
39
- selector: '#superdoc',
40
- documentMode: 'editing',
41
- document: fileObject,
42
- });
43
- ```
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
-
48
- Supported document modes are `editing`, `viewing`, and `suggesting`. Do not use `edit`, `view`, or `suggest`.
49
-
50
- ### Browser Document API contract
51
-
52
- `superdoc.activeEditor.doc` is the browser-facing v2 Document API facade. In the
53
- browser it is intentionally async-capable, so custom UI code must tolerate
54
- promise-returning reads and writes, including the default worker-backed runtime.
55
- SDK/headless document-automation surfaces remain synchronous; this async
56
- contract is specific to the browser `superdoc` package.
57
-
58
- ### Vanilla wrapper for a DOCX file
59
-
60
- When an agent needs to create a small vanilla JS wrapper around a DOCX `File`, use this shape:
11
+ ## Quick start
61
12
 
62
- ```javascript
13
+ ```js
63
14
  import { SuperDoc } from 'superdoc';
64
15
  import 'superdoc/style.css';
65
16
 
66
- export function embedSuperDoc({ file }) {
67
- return new SuperDoc({
68
- selector: '#editor',
69
- documentMode: 'editing',
70
- document: file,
71
- });
72
- }
73
- ```
74
-
75
- For React, Vue, and other frameworks, see the [documentation](https://docs.superdoc.dev).
76
-
77
- ### Using an AI coding agent?
78
-
79
- ```bash
80
- claude mcp add superdoc -- npx @superdoc/mcp # connect agent to DOCX files
17
+ const editor = new SuperDoc({
18
+ selector: '#editor',
19
+ document: '/document.docx',
20
+ });
81
21
  ```
82
22
 
83
- ## Documentation
84
-
85
- [docs.superdoc.dev](https://docs.superdoc.dev) — installation, integration guides, collaboration setup, API reference, and more.
86
-
87
- ## Contributing
88
-
89
- Check the [issue tracker](https://github.com/superdoc/docx-editor/issues) for open issues, or read the [Contributing Guide](https://github.com/superdoc/docx-editor/blob/main/CONTRIBUTING.md) to get started. Bug reports with reproduction .docx files are especially valuable.
90
-
91
- ## Community
92
-
93
- - [Discord](https://discord.com/invite/b9UuaZRyaB) — Chat with the team and other contributors
94
- - [Email](mailto:q@superdoc.dev) — Reach the team directly
23
+ See the [editor quick start](https://docs.superdoc.dev/editor/quickstart) for a complete example and the
24
+ [SuperDoc documentation](https://docs.superdoc.dev) for configuration and APIs.
95
25
 
96
26
  ## License
97
27
 
98
- - Open source: [GNU Affero General Public License v3.0](https://www.gnu.org/licenses/agpl-3.0.html)
99
- - Commercial: [Enterprise License](https://www.superdocportal.dev/get-in-touch)
100
-
101
- ---
102
-
103
- Created and maintained by [SuperDoc](https://www.superdoc.dev).
28
+ AGPL-3.0. Commercial licenses are available from [SuperDoc](https://www.superdoc.dev).
@@ -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.56",
22
+ superdocVersion: "2.4.0-next.58",
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.56",
21
+ superdocVersion: "2.4.0-next.58",
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
@@ -195,6 +195,8 @@ export type IncrementalLayoutTailAdoption = {
195
195
  pageIndexDelta: number;
196
196
  sectionPageNumberTransform: IncrementalSectionPageNumberTransform | null;
197
197
  displayPageNumberTransform?: IncrementalDisplayPageNumberTransform | null;
198
+ /** Exact proof that PAGEREF page/numbering locations are unchanged in the adopted tail. */
199
+ pageReferenceLocationsStable: boolean;
198
200
  sourceLayoutEpoch: number | null;
199
201
  positionTransforms: readonly LayoutPositionTransform[];
200
202
  /** Lazy old->current block-id rekeys for an ordinal-changing structural splice. */
package/dist/superdoc.cjs CHANGED
@@ -43261,7 +43261,7 @@ var SuperDoc = class extends require_eventemitter3.import_eventemitter3.default
43261
43261
  this.config.colors = shuffleArray(this.config.colors);
43262
43262
  this.userColorMap = /* @__PURE__ */ new Map();
43263
43263
  this.colorIndex = 0;
43264
- this.version = "2.4.0-next.56";
43264
+ this.version = "2.4.0-next.58";
43265
43265
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
43266
43266
  this.superdocId = config.superdocId || require_uuid.v4();
43267
43267
  this.colors = this.config.colors ?? [];
@@ -43194,7 +43194,7 @@ var SuperDoc = class extends import_eventemitter3.default {
43194
43194
  this.config.colors = shuffleArray(this.config.colors);
43195
43195
  this.userColorMap = /* @__PURE__ */ new Map();
43196
43196
  this.colorIndex = 0;
43197
- this.version = "2.4.0-next.56";
43197
+ this.version = "2.4.0-next.58";
43198
43198
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
43199
43199
  this.superdocId = config.superdocId || v4();
43200
43200
  this.colors = this.config.colors ?? [];