@arbidocs/coedit 0.5.29 → 0.5.31
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/encoding.cjs +0 -5
- package/dist/encoding.cjs.map +1 -1
- package/dist/encoding.d.cts +5 -5
- package/dist/encoding.d.ts +5 -5
- package/dist/encoding.js +1 -5
- package/dist/encoding.js.map +1 -1
- package/dist/hocuspocus.cjs +1 -5
- package/dist/hocuspocus.cjs.map +1 -1
- package/dist/hocuspocus.js +1 -5
- package/dist/hocuspocus.js.map +1 -1
- package/dist/index.cjs +10 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -6
- package/dist/index.js.map +1 -1
- package/dist/server.cjs +23 -9
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +17 -4
- package/dist/server.d.ts +17 -4
- package/dist/server.js +22 -10
- package/dist/server.js.map +1 -1
- package/dist/versions-ClPpc7Sg.d.cts +21 -0
- package/dist/versions-ClPpc7Sg.d.ts +21 -0
- package/package.json +1 -1
- package/dist/versions-XSYTVmOU.d.cts +0 -8
- package/dist/versions-XSYTVmOU.d.ts +0 -8
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { COLLAB_FORMAT, MaterializeError } from './encoding.cjs';
|
|
2
2
|
export { C as CollaborationSessionError, D as DocxCollaborationSession, a as DocxCollaborationSessionOptions } from './session-WGvWs6yO.cjs';
|
|
3
|
-
export { C as COLLAB_PROTOCOL, D as DOCUMENT_COLLABORATION_VERSIONS } from './versions-
|
|
3
|
+
export { C as COLLAB_PROTOCOL, D as DOCUMENT_COLLABORATION_VERSIONS, F as FORMAT_REFUSAL, f as formatRefusal } from './versions-ClPpc7Sg.cjs';
|
|
4
4
|
import { EditorModule } from '@docx-editor.dev/core';
|
|
5
5
|
import { EditorCollaborationSession } from '@docx-editor.dev/core/collaboration';
|
|
6
6
|
import '@docx-editor.dev/core/store';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { COLLAB_FORMAT, MaterializeError } from './encoding.js';
|
|
2
2
|
export { C as CollaborationSessionError, D as DocxCollaborationSession, a as DocxCollaborationSessionOptions } from './session-WGvWs6yO.js';
|
|
3
|
-
export { C as COLLAB_PROTOCOL, D as DOCUMENT_COLLABORATION_VERSIONS } from './versions-
|
|
3
|
+
export { C as COLLAB_PROTOCOL, D as DOCUMENT_COLLABORATION_VERSIONS, F as FORMAT_REFUSAL, f as formatRefusal } from './versions-ClPpc7Sg.js';
|
|
4
4
|
import { EditorModule } from '@docx-editor.dev/core';
|
|
5
5
|
import { EditorCollaborationSession } from '@docx-editor.dev/core/collaboration';
|
|
6
6
|
import '@docx-editor.dev/core/store';
|
package/dist/index.js
CHANGED
|
@@ -517,10 +517,6 @@ function serializeLive(el, scope) {
|
|
|
517
517
|
|
|
518
518
|
// src/encoding.ts
|
|
519
519
|
var COLLAB_FORMAT = "arbi-docx/2";
|
|
520
|
-
var READABLE_FORMATS = /* @__PURE__ */ new Set(["arbi-docx/1", COLLAB_FORMAT]);
|
|
521
|
-
function isReadableFormat(format) {
|
|
522
|
-
return format !== void 0 && READABLE_FORMATS.has(format);
|
|
523
|
-
}
|
|
524
520
|
function isBootstrapped(doc) {
|
|
525
521
|
return doc.getMap("meta").get("format") !== void 0;
|
|
526
522
|
}
|
|
@@ -1561,7 +1557,7 @@ var DocxCollaborationSession = class {
|
|
|
1561
1557
|
this.setStatus("error", "not-initialized");
|
|
1562
1558
|
return;
|
|
1563
1559
|
}
|
|
1564
|
-
if (
|
|
1560
|
+
if (readFormat(this.doc) !== COLLAB_FORMAT) {
|
|
1565
1561
|
this.setStatus("error", "collaboration-format-mismatch", readFormat(this.doc));
|
|
1566
1562
|
return;
|
|
1567
1563
|
}
|
|
@@ -1849,12 +1845,19 @@ var DOCUMENT_COLLABORATION_VERSIONS = {
|
|
|
1849
1845
|
format: COLLAB_FORMAT,
|
|
1850
1846
|
protocol: COLLAB_PROTOCOL
|
|
1851
1847
|
};
|
|
1848
|
+
var FORMAT_REFUSAL = "collaboration-format:";
|
|
1849
|
+
var formatNumber = (format) => Number(format.split("/").pop());
|
|
1850
|
+
function formatRefusal(reason) {
|
|
1851
|
+
if (!reason?.startsWith(FORMAT_REFUSAL)) return null;
|
|
1852
|
+
const server = reason.slice(FORMAT_REFUSAL.length);
|
|
1853
|
+
return { serverNewer: formatNumber(server) > formatNumber(COLLAB_FORMAT) };
|
|
1854
|
+
}
|
|
1852
1855
|
|
|
1853
1856
|
// src/module.ts
|
|
1854
1857
|
function collaborationModule(options) {
|
|
1855
1858
|
return { id: "collaboration", collaboration: { session: options.session } };
|
|
1856
1859
|
}
|
|
1857
1860
|
|
|
1858
|
-
export { COLLAB_FORMAT, COLLAB_PROTOCOL, CollaborationSessionError, DOCUMENT_COLLABORATION_VERSIONS, DocxCollaborationSession, MaterializeError, collaborationModule };
|
|
1861
|
+
export { COLLAB_FORMAT, COLLAB_PROTOCOL, CollaborationSessionError, DOCUMENT_COLLABORATION_VERSIONS, DocxCollaborationSession, FORMAT_REFUSAL, MaterializeError, collaborationModule, formatRefusal };
|
|
1859
1862
|
//# sourceMappingURL=index.js.map
|
|
1860
1863
|
//# sourceMappingURL=index.js.map
|