@arbidocs/coedit 0.5.30 → 0.5.32
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.cjs
CHANGED
|
@@ -539,10 +539,6 @@ function serializeLive(el, scope) {
|
|
|
539
539
|
|
|
540
540
|
// src/encoding.ts
|
|
541
541
|
var COLLAB_FORMAT = "arbi-docx/2";
|
|
542
|
-
var READABLE_FORMATS = /* @__PURE__ */ new Set(["arbi-docx/1", COLLAB_FORMAT]);
|
|
543
|
-
function isReadableFormat(format) {
|
|
544
|
-
return format !== void 0 && READABLE_FORMATS.has(format);
|
|
545
|
-
}
|
|
546
542
|
function isBootstrapped(doc) {
|
|
547
543
|
return doc.getMap("meta").get("format") !== void 0;
|
|
548
544
|
}
|
|
@@ -1583,7 +1579,7 @@ var DocxCollaborationSession = class {
|
|
|
1583
1579
|
this.setStatus("error", "not-initialized");
|
|
1584
1580
|
return;
|
|
1585
1581
|
}
|
|
1586
|
-
if (
|
|
1582
|
+
if (readFormat(this.doc) !== COLLAB_FORMAT) {
|
|
1587
1583
|
this.setStatus("error", "collaboration-format-mismatch", readFormat(this.doc));
|
|
1588
1584
|
return;
|
|
1589
1585
|
}
|
|
@@ -1871,6 +1867,13 @@ var DOCUMENT_COLLABORATION_VERSIONS = {
|
|
|
1871
1867
|
format: COLLAB_FORMAT,
|
|
1872
1868
|
protocol: COLLAB_PROTOCOL
|
|
1873
1869
|
};
|
|
1870
|
+
var FORMAT_REFUSAL = "collaboration-format:";
|
|
1871
|
+
var formatNumber = (format) => Number(format.split("/").pop());
|
|
1872
|
+
function formatRefusal(reason) {
|
|
1873
|
+
if (!reason?.startsWith(FORMAT_REFUSAL)) return null;
|
|
1874
|
+
const server = reason.slice(FORMAT_REFUSAL.length);
|
|
1875
|
+
return { serverNewer: formatNumber(server) > formatNumber(COLLAB_FORMAT) };
|
|
1876
|
+
}
|
|
1874
1877
|
|
|
1875
1878
|
// src/module.ts
|
|
1876
1879
|
function collaborationModule(options) {
|
|
@@ -1882,7 +1885,9 @@ exports.COLLAB_PROTOCOL = COLLAB_PROTOCOL;
|
|
|
1882
1885
|
exports.CollaborationSessionError = CollaborationSessionError;
|
|
1883
1886
|
exports.DOCUMENT_COLLABORATION_VERSIONS = DOCUMENT_COLLABORATION_VERSIONS;
|
|
1884
1887
|
exports.DocxCollaborationSession = DocxCollaborationSession;
|
|
1888
|
+
exports.FORMAT_REFUSAL = FORMAT_REFUSAL;
|
|
1885
1889
|
exports.MaterializeError = MaterializeError;
|
|
1886
1890
|
exports.collaborationModule = collaborationModule;
|
|
1891
|
+
exports.formatRefusal = formatRefusal;
|
|
1887
1892
|
//# sourceMappingURL=index.cjs.map
|
|
1888
1893
|
//# sourceMappingURL=index.cjs.map
|