@arbidocs/coedit 0.5.135 → 0.5.136
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/dist/commands.cjs +18 -1
- package/dist/commands.cjs.map +1 -1
- package/dist/commands.d.cts +2 -2
- package/dist/commands.d.ts +2 -2
- package/dist/commands.js +18 -1
- package/dist/commands.js.map +1 -1
- package/dist/{port-BbN5OZHx.d.cts → port-DXBNxZYw.d.cts} +2 -0
- package/dist/{port-BbN5OZHx.d.ts → port-DXBNxZYw.d.ts} +2 -0
- package/dist/server.cjs +16 -0
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +16 -0
- package/dist/server.js.map +1 -1
- package/package.json +2 -2
package/dist/server.d.cts
CHANGED
|
@@ -3,7 +3,7 @@ import { createServerAutomationHost, ServerAutomationHostOptions } from '@docx-e
|
|
|
3
3
|
import * as Y from 'yjs';
|
|
4
4
|
import { CollaborationIdentity } from '@docx-editor.dev/core/collaboration';
|
|
5
5
|
import { TreePackageStore, PackageTransactResult, HeadlessDocumentView, ImageDecodePort } from '@docx-editor.dev/core/store';
|
|
6
|
-
import { R as ReferencesPort } from './port-
|
|
6
|
+
import { R as ReferencesPort } from './port-DXBNxZYw.cjs';
|
|
7
7
|
import { R as Revision } from './track-eYC94jTp.cjs';
|
|
8
8
|
import { D as DocxCollaborationSession } from './session-WGvWs6yO.cjs';
|
|
9
9
|
export { C as COLLAB_PROTOCOL, D as DOCUMENT_COLLABORATION_VERSIONS, F as FORMAT_REFUSAL } from './versions-ClPpc7Sg.cjs';
|
package/dist/server.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { createServerAutomationHost, ServerAutomationHostOptions } from '@docx-e
|
|
|
3
3
|
import * as Y from 'yjs';
|
|
4
4
|
import { CollaborationIdentity } from '@docx-editor.dev/core/collaboration';
|
|
5
5
|
import { TreePackageStore, PackageTransactResult, HeadlessDocumentView, ImageDecodePort } from '@docx-editor.dev/core/store';
|
|
6
|
-
import { R as ReferencesPort } from './port-
|
|
6
|
+
import { R as ReferencesPort } from './port-DXBNxZYw.js';
|
|
7
7
|
import { R as Revision } from './track-eYC94jTp.js';
|
|
8
8
|
import { D as DocxCollaborationSession } from './session-WGvWs6yO.js';
|
|
9
9
|
export { C as COLLAB_PROTOCOL, D as DOCUMENT_COLLABORATION_VERSIONS, F as FORMAT_REFUSAL } from './versions-ClPpc7Sg.js';
|
package/dist/server.js
CHANGED
|
@@ -13,6 +13,14 @@ import { createCollaborationStatusTracker, safeParticipantColor } from '@docx-ed
|
|
|
13
13
|
var DEFINED_TERM_STYLE = "DefinedTerm";
|
|
14
14
|
var CROSS_REFERENCE_STYLE = "CrossReference";
|
|
15
15
|
var BROKEN_CROSS_REFERENCE_STYLE = "CrossReferenceBroken";
|
|
16
|
+
function engineOffset(paragraph, offset, pastDeletions = false) {
|
|
17
|
+
let out = offset;
|
|
18
|
+
for (const r of paragraph.revisions ?? [])
|
|
19
|
+
if (r.kind === "delete" && (r.offset < offset || pastDeletions && r.offset === offset))
|
|
20
|
+
out += r.length;
|
|
21
|
+
return out;
|
|
22
|
+
}
|
|
23
|
+
var engineLength = (paragraph) => engineOffset(paragraph, paragraph.text.length, true);
|
|
16
24
|
var WATCHED_STYLES = /* @__PURE__ */ new Set([BROKEN_CROSS_REFERENCE_STYLE]);
|
|
17
25
|
var attr = (node, name) => node.attributes?.find((a) => a.localName === name)?.value;
|
|
18
26
|
var FIELD_ATOM = "\uFFFC";
|
|
@@ -2703,6 +2711,14 @@ function roomCommandsPort(room, { revision, actorId } = {}) {
|
|
|
2703
2711
|
const next = paragraphs[paragraphs.findIndex((p) => p.id === point.paragraphId) + 1];
|
|
2704
2712
|
caret = next ? { paragraphId: next.id, offset: 0 } : point;
|
|
2705
2713
|
},
|
|
2714
|
+
joinEmptyParagraph: (firstId, emptyId) => {
|
|
2715
|
+
const paragraphs = readParagraphs(root());
|
|
2716
|
+
const index = paragraphs.findIndex((p) => p.id === firstId);
|
|
2717
|
+
const empty = paragraphs[index + 1];
|
|
2718
|
+
if (index < 0 || empty?.id !== emptyId || engineLength(empty) !== 0 || empty.bookmarks.length || empty.links.length)
|
|
2719
|
+
throw new Error("Only an adjacent temporary empty paragraph can be joined.");
|
|
2720
|
+
apply({ op: "joinParagraphs", firstId, secondId: emptyId });
|
|
2721
|
+
},
|
|
2706
2722
|
typeText: (text) => {
|
|
2707
2723
|
const point = at();
|
|
2708
2724
|
apply({
|