@harbour-enterprises/superdoc 0.12.21 → 0.12.23
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/chunks/{index-BrSjd1Id.es.js → index-Bt9T0ivx.es.js} +1 -1
- package/dist/chunks/{index-CMBtuT02.cjs → index-C9VoBmK2.cjs} +1 -1
- package/dist/chunks/{index-B1MhwjTC.cjs → index-CZ7uYk9v.cjs} +2 -2
- package/dist/chunks/{index-SKpROzLW.es.js → index-WlcT4qSb.es.js} +2 -2
- package/dist/chunks/{super-editor.es-BJxfxsJk.es.js → super-editor.es-CeaOVXzk.es.js} +52 -24
- package/dist/chunks/{super-editor.es-D0Qwa5EH.cjs → super-editor.es-D6tnqbpx.cjs} +52 -24
- package/dist/chunks/{url-CAZQTNP3.es.js → url-B8943xnh.es.js} +1 -1
- package/dist/chunks/{url-DuggQ5JR.cjs → url-ITkRdlXj.cjs} +1 -1
- package/dist/chunks/{xml-js-B7Vccv2s.cjs → xml-js-DUY8aVjn.cjs} +21 -7
- package/dist/chunks/{xml-js-BV-kCPOA.es.js → xml-js-O0pGoXNk.es.js} +21 -7
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-DDQtkQJ4.js → converter-BJyi9NPn.js} +2 -2
- package/dist/super-editor/chunks/{docx-zipper-DWylD21B.js → docx-zipper-BF7wqOoq.js} +1 -1
- package/dist/super-editor/chunks/{editor-R2kFXHLZ.js → editor-Fuc_VS-V.js} +52 -24
- package/dist/super-editor/chunks/{toolbar-lgjx3_DS.js → toolbar-C_Pux7KK.js} +2 -2
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/extensions/collaboration/collaboration-helpers.d.ts +2 -0
- package/dist/super-editor/extensions/collaboration/collaboration-helpers.d.ts.map +1 -0
- package/dist/super-editor/extensions/collaboration/collaboration.d.ts.map +1 -1
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/super-editor.es.js +6 -6
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +1 -1
- package/dist/superdoc.cjs +5 -5
- package/dist/superdoc.es.js +6 -6
- package/dist/superdoc.umd.js +53 -25
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/super-editor.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const superEditor_es = require("./chunks/super-editor.es-
|
|
3
|
+
const superEditor_es = require("./chunks/super-editor.es-D6tnqbpx.cjs");
|
|
4
4
|
require("./chunks/vue-DPZkajuO.cjs");
|
|
5
5
|
exports.AIWriter = superEditor_es.AIWriter;
|
|
6
6
|
exports.BasicUpload = superEditor_es._sfc_main$1;
|
package/dist/super-editor.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A, _, C, D, E, a, S, b, c, d, T, e, f, i, g, h, j, k, l, m, n } from "./chunks/super-editor.es-
|
|
1
|
+
import { A, _, C, D, E, a, S, b, c, d, T, e, f, i, g, h, j, k, l, m, n } from "./chunks/super-editor.es-CeaOVXzk.es.js";
|
|
2
2
|
import "./chunks/vue-IIIZMHTg.es.js";
|
|
3
3
|
export {
|
|
4
4
|
A as AIWriter,
|
package/dist/superdoc.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const superEditor_es = require("./chunks/super-editor.es-
|
|
3
|
+
const superEditor_es = require("./chunks/super-editor.es-D6tnqbpx.cjs");
|
|
4
4
|
const vue = require("./chunks/vue-DPZkajuO.cjs");
|
|
5
5
|
const jszip = require("./chunks/jszip-Bwu_om3F.cjs");
|
|
6
6
|
const blankDocx = require("./chunks/blank-docx-CPqX9RF5.cjs");
|
|
@@ -23174,13 +23174,13 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
23174
23174
|
"./chunks/empty-lth7LH78.cjs"
|
|
23175
23175
|
)), http = await Promise.resolve().then(() => require(
|
|
23176
23176
|
/*webpackIgnore: true*/
|
|
23177
|
-
"./chunks/index-
|
|
23177
|
+
"./chunks/index-CZ7uYk9v.cjs"
|
|
23178
23178
|
)).then((n) => n.index), https = await Promise.resolve().then(() => require(
|
|
23179
23179
|
/*webpackIgnore: true*/
|
|
23180
|
-
"./chunks/index-
|
|
23180
|
+
"./chunks/index-C9VoBmK2.cjs"
|
|
23181
23181
|
)).then((n) => n.index), url = await Promise.resolve().then(() => require(
|
|
23182
23182
|
/*webpackIgnore: true*/
|
|
23183
|
-
"./chunks/url-
|
|
23183
|
+
"./chunks/url-ITkRdlXj.cjs"
|
|
23184
23184
|
)).then((n) => n.url);
|
|
23185
23185
|
let canvas, path2d;
|
|
23186
23186
|
try {
|
|
@@ -46560,7 +46560,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
|
|
|
46560
46560
|
this.config.colors = shuffleArray(this.config.colors);
|
|
46561
46561
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
46562
46562
|
this.colorIndex = 0;
|
|
46563
|
-
this.version = "0.12.
|
|
46563
|
+
this.version = "0.12.23";
|
|
46564
46564
|
console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
46565
46565
|
this.superdocId = config.superdocId || uuid.v4();
|
|
46566
46566
|
this.colors = this.config.colors;
|
package/dist/superdoc.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as index$1, C as CommentsPluginKey, e as TrackChangesBasePluginKey, E as Editor, k as getRichTextExtensions, c as SuperInput, A as AIWriter, b as SuperEditor, d as SuperToolbar, f as createZip } from "./chunks/super-editor.es-
|
|
2
|
-
import { S, i, m } from "./chunks/super-editor.es-
|
|
1
|
+
import { n as index$1, C as CommentsPluginKey, e as TrackChangesBasePluginKey, E as Editor, k as getRichTextExtensions, c as SuperInput, A as AIWriter, b as SuperEditor, d as SuperToolbar, f as createZip } from "./chunks/super-editor.es-CeaOVXzk.es.js";
|
|
2
|
+
import { S, i, m } from "./chunks/super-editor.es-CeaOVXzk.es.js";
|
|
3
3
|
import { Y as effectScope, r as ref, Z as markRaw, p as process$1, _ as toRaw, a as computed, $ as isRef, a0 as isReactive, D as toRef, i as inject, q as getCurrentInstance, l as watch, y as unref, a1 as hasInjectionContext, N as reactive, u as nextTick, a2 as getCurrentScope, a3 as onScopeDispose, a4 as toRefs, g as global$1, K as shallowRef, O as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, U as onActivated, s as onDeactivated, A as createTextVNode, F as Fragment, R as Comment, m as defineComponent, E as provide, I as withDirectives, C as h, V as Teleport, S as renderSlot, W as isVNode, J as watchEffect, P as Transition, G as mergeProps, Q as vShow, H as cloneVNode, T as Text, b as createElementBlock, o as openBlock, t as toDisplayString, x as createVNode, z as withCtx, f as createBaseVNode, B as normalizeStyle, e as createCommentVNode, v as createBlock, w as withModifiers, n as normalizeClass, a5 as resolveDirective, d as renderList, c as createApp, X as onUnmounted, a6 as resolveDynamicComponent } from "./chunks/vue-IIIZMHTg.es.js";
|
|
4
4
|
import { B as Buffer$2 } from "./chunks/jszip-BmWWPxfF.es.js";
|
|
5
5
|
import { B as BlankDOCX } from "./chunks/blank-docx-iwdyG9RH.es.js";
|
|
@@ -23173,13 +23173,13 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
23173
23173
|
"./chunks/empty-smM22Y5N.es.js"
|
|
23174
23174
|
), http = await import(
|
|
23175
23175
|
/*webpackIgnore: true*/
|
|
23176
|
-
"./chunks/index-
|
|
23176
|
+
"./chunks/index-WlcT4qSb.es.js"
|
|
23177
23177
|
).then((n) => n.i), https = await import(
|
|
23178
23178
|
/*webpackIgnore: true*/
|
|
23179
|
-
"./chunks/index-
|
|
23179
|
+
"./chunks/index-Bt9T0ivx.es.js"
|
|
23180
23180
|
).then((n) => n.i), url = await import(
|
|
23181
23181
|
/*webpackIgnore: true*/
|
|
23182
|
-
"./chunks/url-
|
|
23182
|
+
"./chunks/url-B8943xnh.es.js"
|
|
23183
23183
|
).then((n) => n.u);
|
|
23184
23184
|
let canvas, path2d;
|
|
23185
23185
|
try {
|
|
@@ -46559,7 +46559,7 @@ class SuperDoc extends EventEmitter {
|
|
|
46559
46559
|
this.config.colors = shuffleArray(this.config.colors);
|
|
46560
46560
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
46561
46561
|
this.colorIndex = 0;
|
|
46562
|
-
this.version = "0.12.
|
|
46562
|
+
this.version = "0.12.23";
|
|
46563
46563
|
console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
46564
46564
|
this.superdocId = config.superdocId || v4();
|
|
46565
46565
|
this.colors = this.config.colors;
|
package/dist/superdoc.umd.js
CHANGED
|
@@ -30664,7 +30664,7 @@
|
|
|
30664
30664
|
return;
|
|
30665
30665
|
}
|
|
30666
30666
|
}
|
|
30667
|
-
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.12.
|
|
30667
|
+
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.12.23") {
|
|
30668
30668
|
const customLocation = "docProps/custom.xml";
|
|
30669
30669
|
if (!docx[customLocation]) {
|
|
30670
30670
|
docx[customLocation] = generateCustomXml();
|
|
@@ -31130,7 +31130,7 @@
|
|
|
31130
31130
|
function generateCustomXml() {
|
|
31131
31131
|
return DEFAULT_CUSTOM_XML;
|
|
31132
31132
|
}
|
|
31133
|
-
function generateSuperdocVersion(pid = 2, version2 = "0.12.
|
|
31133
|
+
function generateSuperdocVersion(pid = 2, version2 = "0.12.23") {
|
|
31134
31134
|
return {
|
|
31135
31135
|
type: "element",
|
|
31136
31136
|
name: "property",
|
|
@@ -46334,6 +46334,27 @@
|
|
|
46334
46334
|
const alpha = activeThreadId == threadId ? "44" : "22";
|
|
46335
46335
|
return `${color}${alpha}`;
|
|
46336
46336
|
};
|
|
46337
|
+
const updateYdocDocxData = async (editor) => {
|
|
46338
|
+
if (!editor.options.ydoc) return;
|
|
46339
|
+
const metaMap = editor.options.ydoc.getMap("meta");
|
|
46340
|
+
const docx = [...metaMap.get("docx")];
|
|
46341
|
+
const newXml = await editor.exportDocx({ getUpdatedDocs: true });
|
|
46342
|
+
Object.keys(newXml).forEach((key) => {
|
|
46343
|
+
if (key.includes("header") || key.includes("footer")) {
|
|
46344
|
+
const fileIndex = docx.findIndex((item) => item.name === key);
|
|
46345
|
+
if (fileIndex > -1) {
|
|
46346
|
+
docx.splice(fileIndex, 1);
|
|
46347
|
+
}
|
|
46348
|
+
docx.push({
|
|
46349
|
+
name: key,
|
|
46350
|
+
content: newXml[key]
|
|
46351
|
+
});
|
|
46352
|
+
}
|
|
46353
|
+
});
|
|
46354
|
+
editor.options.ydoc.transact(() => {
|
|
46355
|
+
metaMap.set("docx", docx);
|
|
46356
|
+
}, { event: "docx-update", user: editor.options.user });
|
|
46357
|
+
};
|
|
46337
46358
|
const PaginationPluginKey = new PluginKey("paginationPlugin");
|
|
46338
46359
|
const initPaginationData = async (editor) => {
|
|
46339
46360
|
if (!editor.converter) return;
|
|
@@ -46492,27 +46513,6 @@
|
|
|
46492
46513
|
const setEditorToolbar = ({ editor }, mainEditor) => {
|
|
46493
46514
|
editor.setToolbar(mainEditor.toolbar);
|
|
46494
46515
|
};
|
|
46495
|
-
const updateYdocDocxData = async (editor) => {
|
|
46496
|
-
if (!editor.options.ydoc) return;
|
|
46497
|
-
const metaMap = editor.options.ydoc.getMap("meta");
|
|
46498
|
-
const docx = [...metaMap.get("docx")];
|
|
46499
|
-
const newXml = await editor.exportDocx({ getUpdatedDocs: true });
|
|
46500
|
-
Object.keys(newXml).forEach((key) => {
|
|
46501
|
-
if (key.includes("header") || key.includes("footer")) {
|
|
46502
|
-
const fileIndex = docx.findIndex((item) => item.name === key);
|
|
46503
|
-
if (fileIndex > -1) {
|
|
46504
|
-
docx.splice(fileIndex, 1);
|
|
46505
|
-
}
|
|
46506
|
-
docx.push({
|
|
46507
|
-
name: key,
|
|
46508
|
-
content: newXml[key]
|
|
46509
|
-
});
|
|
46510
|
-
}
|
|
46511
|
-
});
|
|
46512
|
-
editor.options.ydoc.transact(() => {
|
|
46513
|
-
metaMap.set("docx", docx);
|
|
46514
|
-
});
|
|
46515
|
-
};
|
|
46516
46516
|
const TRACK_CHANGE_MARKS = [TrackInsertMarkName, TrackDeleteMarkName, TrackFormatMarkName];
|
|
46517
46517
|
const CommentsPluginKey = new PluginKey("comments");
|
|
46518
46518
|
const CommentsPlugin = Extension.create({
|
|
@@ -47544,6 +47544,7 @@
|
|
|
47544
47544
|
const undoPlugin = createUndoPlugin();
|
|
47545
47545
|
initDocumentLockHandler(this.options.ydoc, this.editor);
|
|
47546
47546
|
initSyncListener(this.options.ydoc, this.editor, this);
|
|
47547
|
+
initDocumentListener({ ydoc: this.options.ydoc, editor: this.editor });
|
|
47547
47548
|
const [syncPlugin, fragment] = createSyncPlugin(this.options.ydoc, this.editor);
|
|
47548
47549
|
this.options.fragment = fragment;
|
|
47549
47550
|
const metaMap = this.options.ydoc.getMap("media");
|
|
@@ -47625,6 +47626,33 @@
|
|
|
47625
47626
|
editor.emit("locked", { editor, isLocked, lockedBy });
|
|
47626
47627
|
});
|
|
47627
47628
|
};
|
|
47629
|
+
const checkDocxChanged = (transaction) => {
|
|
47630
|
+
for (const [key, value] of transaction.changed?.entries()) {
|
|
47631
|
+
if (value instanceof Set && value.has("docx")) {
|
|
47632
|
+
return true;
|
|
47633
|
+
}
|
|
47634
|
+
}
|
|
47635
|
+
return false;
|
|
47636
|
+
};
|
|
47637
|
+
const initDocumentListener = ({ ydoc, editor }) => {
|
|
47638
|
+
const debouncedUpdate = debounce$2((editor2) => {
|
|
47639
|
+
updateYdocDocxData(editor2);
|
|
47640
|
+
}, 1e3);
|
|
47641
|
+
ydoc.on("afterTransaction", (transaction) => {
|
|
47642
|
+
const { local } = transaction;
|
|
47643
|
+
const hasChangedDocx = checkDocxChanged(transaction);
|
|
47644
|
+
if (!hasChangedDocx && transaction.changed?.size && local) {
|
|
47645
|
+
debouncedUpdate(editor);
|
|
47646
|
+
}
|
|
47647
|
+
});
|
|
47648
|
+
};
|
|
47649
|
+
const debounce$2 = (fn2, wait) => {
|
|
47650
|
+
let timeout2 = null;
|
|
47651
|
+
return (...args) => {
|
|
47652
|
+
clearTimeout(timeout2);
|
|
47653
|
+
timeout2 = setTimeout(() => fn2.apply(void 0, args), wait);
|
|
47654
|
+
};
|
|
47655
|
+
};
|
|
47628
47656
|
const initSyncListener = (ydoc, editor, extension) => {
|
|
47629
47657
|
const provider2 = editor.options.collaborationProvider;
|
|
47630
47658
|
if (!provider2) return;
|
|
@@ -48285,7 +48313,7 @@
|
|
|
48285
48313
|
* @returns {Object | void} Migration results
|
|
48286
48314
|
*/
|
|
48287
48315
|
processCollaborationMigrations() {
|
|
48288
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.12.
|
|
48316
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.12.23");
|
|
48289
48317
|
if (!this.options.ydoc) return;
|
|
48290
48318
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
48291
48319
|
let docVersion = metaMap.get("version");
|
|
@@ -89464,7 +89492,7 @@ ${style2}
|
|
|
89464
89492
|
this.config.colors = shuffleArray(this.config.colors);
|
|
89465
89493
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
89466
89494
|
this.colorIndex = 0;
|
|
89467
|
-
this.version = "0.12.
|
|
89495
|
+
this.version = "0.12.23";
|
|
89468
89496
|
console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
89469
89497
|
this.superdocId = config.superdocId || v4();
|
|
89470
89498
|
this.colors = this.config.colors;
|