@harbour-enterprises/superdoc 2.0.0-next.13 → 2.0.0-next.14
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/{PdfViewer-CHWTTxtm.cjs → PdfViewer-B2KasYH0.cjs} +1 -1
- package/dist/chunks/{PdfViewer-DGJe0yHt.es.js → PdfViewer-DHGCKcbn.es.js} +1 -1
- package/dist/chunks/{index-BbC6VsXh.es.js → index-BFL0Wf8L.es.js} +3 -3
- package/dist/chunks/{index-DwECJSoY.cjs → index-C5g9qqV4.cjs} +3 -3
- package/dist/chunks/{index-Bh0gd0Pm-DMBx9Ybz.es.js → index-CIGMPabO-0NmziL3U.es.js} +1 -1
- package/dist/chunks/{index-Bh0gd0Pm-BGAaVc0H.cjs → index-CIGMPabO-CaiVnKiQ.cjs} +1 -1
- package/dist/chunks/{super-editor.es-BJ1ZZaEo.es.js → super-editor.es-Cnykvny5.es.js} +99 -9
- package/dist/chunks/{super-editor.es-CZoFXUj4.cjs → super-editor.es-VSoDsxCy.cjs} +99 -9
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-Dx9n2qwO.js → converter-CHaTddld.js} +1 -3
- package/dist/super-editor/chunks/{docx-zipper-Ds8FGkok.js → docx-zipper-DukEuVKp.js} +1 -1
- package/dist/super-editor/chunks/{editor-C8TLVw8v.js → editor-Ca-y1mB-.js} +100 -8
- package/dist/super-editor/chunks/{index-Bh0gd0Pm.js → index-CIGMPabO.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-DpUoIWke.js → toolbar-C5IzePMi.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/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 +2 -2
- package/dist/superdoc.es.js +2 -2
- package/dist/superdoc.umd.js +101 -11
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const vue = require("./vue-gvuFr0vx.cjs");
|
|
4
|
-
const superdoc = require("./index-
|
|
4
|
+
const superdoc = require("./index-C5g9qqV4.cjs");
|
|
5
5
|
function self(vars) {
|
|
6
6
|
const {
|
|
7
7
|
opacityDisabled,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { y as defineComponent, A as h, P as Transition, a0 as process$1, K as watchEffect, a as computed, r as ref, j as onMounted, X as onUnmounted, b as createElementBlock, o as openBlock, f as createBaseVNode, e as createCommentVNode, s as createVNode, x as unref } from "./vue-CLFbn_1r.es.js";
|
|
2
|
-
import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-
|
|
2
|
+
import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-BFL0Wf8L.es.js";
|
|
3
3
|
function self(vars) {
|
|
4
4
|
const {
|
|
5
5
|
opacityDisabled,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, P as PresentationEditor, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-
|
|
1
|
+
import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, P as PresentationEditor, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-Cnykvny5.es.js";
|
|
2
2
|
import { B as BlankDOCX } from "./blank-docx-ABm6XYAA.es.js";
|
|
3
3
|
import { E as EventEmitter } from "./eventemitter3-D_2kqkfV.es.js";
|
|
4
4
|
import { HocuspocusProvider, HocuspocusProviderWebsocket } from "@hocuspocus/provider";
|
|
@@ -17470,7 +17470,7 @@ const _sfc_main = {
|
|
|
17470
17470
|
__name: "SuperDoc",
|
|
17471
17471
|
emits: ["selection-update"],
|
|
17472
17472
|
setup(__props, { emit: __emit }) {
|
|
17473
|
-
const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-
|
|
17473
|
+
const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-DHGCKcbn.es.js"));
|
|
17474
17474
|
const superdocStore = useSuperdocStore();
|
|
17475
17475
|
const commentsStore = useCommentsStore();
|
|
17476
17476
|
const {
|
|
@@ -18374,7 +18374,7 @@ class SuperDoc extends EventEmitter {
|
|
|
18374
18374
|
this.config.colors = shuffleArray(this.config.colors);
|
|
18375
18375
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
18376
18376
|
this.colorIndex = 0;
|
|
18377
|
-
this.version = "2.0.0-next.
|
|
18377
|
+
this.version = "2.0.0-next.14";
|
|
18378
18378
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
18379
18379
|
this.superdocId = config.superdocId || v4();
|
|
18380
18380
|
this.colors = this.config.colors;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const superEditor_es = require("./super-editor.es-
|
|
2
|
+
const superEditor_es = require("./super-editor.es-VSoDsxCy.cjs");
|
|
3
3
|
const blankDocx = require("./blank-docx-DfW3Eeh2.cjs");
|
|
4
4
|
const eventemitter3 = require("./eventemitter3-DIclNhoR.cjs");
|
|
5
5
|
const provider = require("@hocuspocus/provider");
|
|
@@ -17487,7 +17487,7 @@ const _sfc_main = {
|
|
|
17487
17487
|
__name: "SuperDoc",
|
|
17488
17488
|
emits: ["selection-update"],
|
|
17489
17489
|
setup(__props, { emit: __emit }) {
|
|
17490
|
-
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-
|
|
17490
|
+
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-B2KasYH0.cjs")));
|
|
17491
17491
|
const superdocStore = useSuperdocStore();
|
|
17492
17492
|
const commentsStore = useCommentsStore();
|
|
17493
17493
|
const {
|
|
@@ -18391,7 +18391,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
|
|
|
18391
18391
|
this.config.colors = shuffleArray(this.config.colors);
|
|
18392
18392
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
18393
18393
|
this.colorIndex = 0;
|
|
18394
|
-
this.version = "2.0.0-next.
|
|
18394
|
+
this.version = "2.0.0-next.14";
|
|
18395
18395
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
18396
18396
|
this.superdocId = config.superdocId || uuid.v4();
|
|
18397
18397
|
this.colors = this.config.colors;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const superEditor_es = require("./super-editor.es-
|
|
3
|
+
const superEditor_es = require("./super-editor.es-VSoDsxCy.cjs");
|
|
4
4
|
const indexCvBqQJbG = require("./index-CvBqQJbG-Dwm0THD7.cjs");
|
|
5
5
|
function bail(error) {
|
|
6
6
|
if (error) {
|
|
@@ -38529,8 +38529,6 @@ const decode$7 = (params2) => {
|
|
|
38529
38529
|
);
|
|
38530
38530
|
const isInternal = parentComment?.isInternal || originalComment.isInternal;
|
|
38531
38531
|
if (commentsExportType === "external" && isInternal) return;
|
|
38532
|
-
const isResolved = !!originalComment.resolvedTime;
|
|
38533
|
-
if (isResolved) return;
|
|
38534
38532
|
if (node.type !== "commentRangeStart" && node.type !== "commentRangeEnd") {
|
|
38535
38533
|
return;
|
|
38536
38534
|
}
|
|
@@ -42452,7 +42450,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
42452
42450
|
static getStoredSuperdocVersion(docx) {
|
|
42453
42451
|
return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
42454
42452
|
}
|
|
42455
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "2.0.0-next.
|
|
42453
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "2.0.0-next.14") {
|
|
42456
42454
|
return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
|
|
42457
42455
|
}
|
|
42458
42456
|
/**
|
|
@@ -57889,6 +57887,70 @@ const getCommentPositionsById = (commentId, doc2) => {
|
|
|
57889
57887
|
});
|
|
57890
57888
|
return positions;
|
|
57891
57889
|
};
|
|
57890
|
+
const getCommentMarkSegmentsById = (commentId, doc2) => {
|
|
57891
|
+
const segments = [];
|
|
57892
|
+
doc2.descendants((node, pos) => {
|
|
57893
|
+
if (!node.isInline) return;
|
|
57894
|
+
const commentMark = node.marks?.find(
|
|
57895
|
+
(mark) => mark.type.name === CommentMarkName$1 && mark.attrs?.commentId === commentId
|
|
57896
|
+
);
|
|
57897
|
+
if (!commentMark) return;
|
|
57898
|
+
segments.push({
|
|
57899
|
+
from: pos,
|
|
57900
|
+
to: pos + node.nodeSize,
|
|
57901
|
+
attrs: commentMark.attrs || {}
|
|
57902
|
+
});
|
|
57903
|
+
});
|
|
57904
|
+
return segments;
|
|
57905
|
+
};
|
|
57906
|
+
const getCommentMarkRangesById = (commentId, doc2) => {
|
|
57907
|
+
const segments = getCommentMarkSegmentsById(commentId, doc2);
|
|
57908
|
+
if (!segments.length) return { segments, ranges: [] };
|
|
57909
|
+
const ranges = [];
|
|
57910
|
+
let active = null;
|
|
57911
|
+
segments.forEach((seg) => {
|
|
57912
|
+
if (!active) {
|
|
57913
|
+
active = {
|
|
57914
|
+
from: seg.from,
|
|
57915
|
+
to: seg.to,
|
|
57916
|
+
internal: !!seg.attrs?.internal
|
|
57917
|
+
};
|
|
57918
|
+
return;
|
|
57919
|
+
}
|
|
57920
|
+
if (seg.from <= active.to) {
|
|
57921
|
+
active.to = Math.max(active.to, seg.to);
|
|
57922
|
+
return;
|
|
57923
|
+
}
|
|
57924
|
+
ranges.push(active);
|
|
57925
|
+
active = {
|
|
57926
|
+
from: seg.from,
|
|
57927
|
+
to: seg.to,
|
|
57928
|
+
internal: !!seg.attrs?.internal
|
|
57929
|
+
};
|
|
57930
|
+
});
|
|
57931
|
+
if (active) ranges.push(active);
|
|
57932
|
+
return { segments, ranges };
|
|
57933
|
+
};
|
|
57934
|
+
const resolveCommentById = ({ commentId, state: state2, tr, dispatch }) => {
|
|
57935
|
+
const { schema } = state2;
|
|
57936
|
+
const markType = schema.marks?.[CommentMarkName$1];
|
|
57937
|
+
if (!markType) return false;
|
|
57938
|
+
const { segments, ranges } = getCommentMarkRangesById(commentId, state2.doc);
|
|
57939
|
+
if (!segments.length) return false;
|
|
57940
|
+
segments.forEach(({ from: from2, to, attrs }) => {
|
|
57941
|
+
tr.removeMark(from2, to, markType.create(attrs));
|
|
57942
|
+
});
|
|
57943
|
+
const startType = schema.nodes?.commentRangeStart;
|
|
57944
|
+
const endType = schema.nodes?.commentRangeEnd;
|
|
57945
|
+
if (startType && endType) {
|
|
57946
|
+
ranges.slice().sort((a, b2) => b2.from - a.from).forEach(({ from: from2, to, internal }) => {
|
|
57947
|
+
tr.insert(to, endType.create({ "w:id": commentId }));
|
|
57948
|
+
tr.insert(from2, startType.create({ "w:id": commentId, internal }));
|
|
57949
|
+
});
|
|
57950
|
+
}
|
|
57951
|
+
dispatch(tr);
|
|
57952
|
+
return true;
|
|
57953
|
+
};
|
|
57892
57954
|
const prepareCommentsForExport = (doc2, tr, schema, comments = []) => {
|
|
57893
57955
|
const commentMap = /* @__PURE__ */ new Map();
|
|
57894
57956
|
comments.forEach((c2) => {
|
|
@@ -57995,6 +58057,7 @@ const getPreparedComment = (attrs) => {
|
|
|
57995
58057
|
const prepareCommentsForImport = (doc2, tr, schema, converter) => {
|
|
57996
58058
|
const toMark = [];
|
|
57997
58059
|
const toDelete = [];
|
|
58060
|
+
const toUpdate = [];
|
|
57998
58061
|
doc2.descendants((node, pos) => {
|
|
57999
58062
|
const { type: type2 } = node;
|
|
58000
58063
|
const commentNodes = ["commentRangeStart", "commentRangeEnd", "commentReference"];
|
|
@@ -58003,8 +58066,9 @@ const prepareCommentsForImport = (doc2, tr, schema, converter) => {
|
|
|
58003
58066
|
converter,
|
|
58004
58067
|
importedId: node.attrs["w:id"]
|
|
58005
58068
|
});
|
|
58069
|
+
const isDone = !!matchingImportedComment?.isDone;
|
|
58006
58070
|
if (type2.name === "commentRangeStart") {
|
|
58007
|
-
if (!
|
|
58071
|
+
if (!isDone) {
|
|
58008
58072
|
toMark.push({
|
|
58009
58073
|
commentId: resolvedCommentId,
|
|
58010
58074
|
importedId,
|
|
@@ -58018,8 +58082,29 @@ const prepareCommentsForImport = (doc2, tr, schema, converter) => {
|
|
|
58018
58082
|
commentId: resolvedCommentId,
|
|
58019
58083
|
importedId
|
|
58020
58084
|
});
|
|
58021
|
-
|
|
58085
|
+
if (isDone) {
|
|
58086
|
+
toUpdate.push({
|
|
58087
|
+
pos,
|
|
58088
|
+
attrs: {
|
|
58089
|
+
...node.attrs,
|
|
58090
|
+
"w:id": resolvedCommentId,
|
|
58091
|
+
internal
|
|
58092
|
+
}
|
|
58093
|
+
});
|
|
58094
|
+
} else {
|
|
58095
|
+
toDelete.push({ start: pos, end: pos + 1 });
|
|
58096
|
+
}
|
|
58022
58097
|
} else if (type2.name === "commentRangeEnd") {
|
|
58098
|
+
if (isDone) {
|
|
58099
|
+
toUpdate.push({
|
|
58100
|
+
pos,
|
|
58101
|
+
attrs: {
|
|
58102
|
+
...node.attrs,
|
|
58103
|
+
"w:id": resolvedCommentId
|
|
58104
|
+
}
|
|
58105
|
+
});
|
|
58106
|
+
return;
|
|
58107
|
+
}
|
|
58023
58108
|
const itemToMark = toMark.find((p) => p.importedId === importedId);
|
|
58024
58109
|
if (!itemToMark) return;
|
|
58025
58110
|
const { start: start2 } = itemToMark;
|
|
@@ -58034,6 +58119,11 @@ const prepareCommentsForImport = (doc2, tr, schema, converter) => {
|
|
|
58034
58119
|
toDelete.push({ start: pos, end: pos + 1 });
|
|
58035
58120
|
}
|
|
58036
58121
|
});
|
|
58122
|
+
if (typeof tr.setNodeMarkup === "function") {
|
|
58123
|
+
toUpdate.sort((a, b2) => b2.pos - a.pos).forEach(({ pos, attrs }) => {
|
|
58124
|
+
tr.setNodeMarkup(pos, void 0, attrs);
|
|
58125
|
+
});
|
|
58126
|
+
}
|
|
58037
58127
|
toDelete.sort((a, b2) => b2.start - a.start).forEach(({ start: start2, end: end2 }) => {
|
|
58038
58128
|
tr.delete(start2, end2);
|
|
58039
58129
|
});
|
|
@@ -58227,7 +58317,7 @@ const CommentsPlugin = Extension.create({
|
|
|
58227
58317
|
},
|
|
58228
58318
|
resolveComment: ({ commentId }) => ({ tr, dispatch, state: state2 }) => {
|
|
58229
58319
|
tr.setMeta(CommentsPluginKey, { event: "update" });
|
|
58230
|
-
|
|
58320
|
+
return resolveCommentById({ commentId, state: state2, tr, dispatch });
|
|
58231
58321
|
},
|
|
58232
58322
|
setCursorById: (id) => ({ state: state2, editor }) => {
|
|
58233
58323
|
const { from: from2 } = findRangeById(state2.doc, id) || {};
|
|
@@ -60533,7 +60623,7 @@ const isHeadless = (editor) => {
|
|
|
60533
60623
|
const shouldSkipNodeView = (editor) => {
|
|
60534
60624
|
return isHeadless(editor);
|
|
60535
60625
|
};
|
|
60536
|
-
const summaryVersion = "2.0.0-next.
|
|
60626
|
+
const summaryVersion = "2.0.0-next.14";
|
|
60537
60627
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
60538
60628
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
60539
60629
|
function mapAttributes(attrs) {
|
|
@@ -61322,7 +61412,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
61322
61412
|
{ default: remarkStringify },
|
|
61323
61413
|
{ default: remarkGfm }
|
|
61324
61414
|
] = await Promise.all([
|
|
61325
|
-
import("./index-
|
|
61415
|
+
import("./index-CIGMPabO-0NmziL3U.es.js"),
|
|
61326
61416
|
import("./index-DRCvimau-Cw339678.es.js"),
|
|
61327
61417
|
import("./index-C_x_N6Uh-DJn8hIEt.es.js"),
|
|
61328
61418
|
import("./index-D_sWOSiG-DE96TaT5.es.js"),
|
|
@@ -61527,7 +61617,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
61527
61617
|
* Process collaboration migrations
|
|
61528
61618
|
*/
|
|
61529
61619
|
processCollaborationMigrations() {
|
|
61530
|
-
console.debug("[checkVersionMigrations] Current editor version", "2.0.0-next.
|
|
61620
|
+
console.debug("[checkVersionMigrations] Current editor version", "2.0.0-next.14");
|
|
61531
61621
|
if (!this.options.ydoc) return;
|
|
61532
61622
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
61533
61623
|
let docVersion = metaMap.get("version");
|
|
@@ -38546,8 +38546,6 @@ const decode$7 = (params2) => {
|
|
|
38546
38546
|
);
|
|
38547
38547
|
const isInternal = parentComment?.isInternal || originalComment.isInternal;
|
|
38548
38548
|
if (commentsExportType === "external" && isInternal) return;
|
|
38549
|
-
const isResolved = !!originalComment.resolvedTime;
|
|
38550
|
-
if (isResolved) return;
|
|
38551
38549
|
if (node.type !== "commentRangeStart" && node.type !== "commentRangeEnd") {
|
|
38552
38550
|
return;
|
|
38553
38551
|
}
|
|
@@ -42469,7 +42467,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
42469
42467
|
static getStoredSuperdocVersion(docx) {
|
|
42470
42468
|
return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
42471
42469
|
}
|
|
42472
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "2.0.0-next.
|
|
42470
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "2.0.0-next.14") {
|
|
42473
42471
|
return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
|
|
42474
42472
|
}
|
|
42475
42473
|
/**
|
|
@@ -57906,6 +57904,70 @@ const getCommentPositionsById = (commentId, doc2) => {
|
|
|
57906
57904
|
});
|
|
57907
57905
|
return positions;
|
|
57908
57906
|
};
|
|
57907
|
+
const getCommentMarkSegmentsById = (commentId, doc2) => {
|
|
57908
|
+
const segments = [];
|
|
57909
|
+
doc2.descendants((node, pos) => {
|
|
57910
|
+
if (!node.isInline) return;
|
|
57911
|
+
const commentMark = node.marks?.find(
|
|
57912
|
+
(mark) => mark.type.name === CommentMarkName$1 && mark.attrs?.commentId === commentId
|
|
57913
|
+
);
|
|
57914
|
+
if (!commentMark) return;
|
|
57915
|
+
segments.push({
|
|
57916
|
+
from: pos,
|
|
57917
|
+
to: pos + node.nodeSize,
|
|
57918
|
+
attrs: commentMark.attrs || {}
|
|
57919
|
+
});
|
|
57920
|
+
});
|
|
57921
|
+
return segments;
|
|
57922
|
+
};
|
|
57923
|
+
const getCommentMarkRangesById = (commentId, doc2) => {
|
|
57924
|
+
const segments = getCommentMarkSegmentsById(commentId, doc2);
|
|
57925
|
+
if (!segments.length) return { segments, ranges: [] };
|
|
57926
|
+
const ranges = [];
|
|
57927
|
+
let active = null;
|
|
57928
|
+
segments.forEach((seg) => {
|
|
57929
|
+
if (!active) {
|
|
57930
|
+
active = {
|
|
57931
|
+
from: seg.from,
|
|
57932
|
+
to: seg.to,
|
|
57933
|
+
internal: !!seg.attrs?.internal
|
|
57934
|
+
};
|
|
57935
|
+
return;
|
|
57936
|
+
}
|
|
57937
|
+
if (seg.from <= active.to) {
|
|
57938
|
+
active.to = Math.max(active.to, seg.to);
|
|
57939
|
+
return;
|
|
57940
|
+
}
|
|
57941
|
+
ranges.push(active);
|
|
57942
|
+
active = {
|
|
57943
|
+
from: seg.from,
|
|
57944
|
+
to: seg.to,
|
|
57945
|
+
internal: !!seg.attrs?.internal
|
|
57946
|
+
};
|
|
57947
|
+
});
|
|
57948
|
+
if (active) ranges.push(active);
|
|
57949
|
+
return { segments, ranges };
|
|
57950
|
+
};
|
|
57951
|
+
const resolveCommentById = ({ commentId, state: state2, tr, dispatch }) => {
|
|
57952
|
+
const { schema } = state2;
|
|
57953
|
+
const markType = schema.marks?.[CommentMarkName$1];
|
|
57954
|
+
if (!markType) return false;
|
|
57955
|
+
const { segments, ranges } = getCommentMarkRangesById(commentId, state2.doc);
|
|
57956
|
+
if (!segments.length) return false;
|
|
57957
|
+
segments.forEach(({ from: from2, to, attrs }) => {
|
|
57958
|
+
tr.removeMark(from2, to, markType.create(attrs));
|
|
57959
|
+
});
|
|
57960
|
+
const startType = schema.nodes?.commentRangeStart;
|
|
57961
|
+
const endType = schema.nodes?.commentRangeEnd;
|
|
57962
|
+
if (startType && endType) {
|
|
57963
|
+
ranges.slice().sort((a, b2) => b2.from - a.from).forEach(({ from: from2, to, internal }) => {
|
|
57964
|
+
tr.insert(to, endType.create({ "w:id": commentId }));
|
|
57965
|
+
tr.insert(from2, startType.create({ "w:id": commentId, internal }));
|
|
57966
|
+
});
|
|
57967
|
+
}
|
|
57968
|
+
dispatch(tr);
|
|
57969
|
+
return true;
|
|
57970
|
+
};
|
|
57909
57971
|
const prepareCommentsForExport = (doc2, tr, schema, comments = []) => {
|
|
57910
57972
|
const commentMap = /* @__PURE__ */ new Map();
|
|
57911
57973
|
comments.forEach((c2) => {
|
|
@@ -58012,6 +58074,7 @@ const getPreparedComment = (attrs) => {
|
|
|
58012
58074
|
const prepareCommentsForImport = (doc2, tr, schema, converter) => {
|
|
58013
58075
|
const toMark = [];
|
|
58014
58076
|
const toDelete = [];
|
|
58077
|
+
const toUpdate = [];
|
|
58015
58078
|
doc2.descendants((node, pos) => {
|
|
58016
58079
|
const { type: type2 } = node;
|
|
58017
58080
|
const commentNodes = ["commentRangeStart", "commentRangeEnd", "commentReference"];
|
|
@@ -58020,8 +58083,9 @@ const prepareCommentsForImport = (doc2, tr, schema, converter) => {
|
|
|
58020
58083
|
converter,
|
|
58021
58084
|
importedId: node.attrs["w:id"]
|
|
58022
58085
|
});
|
|
58086
|
+
const isDone = !!matchingImportedComment?.isDone;
|
|
58023
58087
|
if (type2.name === "commentRangeStart") {
|
|
58024
|
-
if (!
|
|
58088
|
+
if (!isDone) {
|
|
58025
58089
|
toMark.push({
|
|
58026
58090
|
commentId: resolvedCommentId,
|
|
58027
58091
|
importedId,
|
|
@@ -58035,8 +58099,29 @@ const prepareCommentsForImport = (doc2, tr, schema, converter) => {
|
|
|
58035
58099
|
commentId: resolvedCommentId,
|
|
58036
58100
|
importedId
|
|
58037
58101
|
});
|
|
58038
|
-
|
|
58102
|
+
if (isDone) {
|
|
58103
|
+
toUpdate.push({
|
|
58104
|
+
pos,
|
|
58105
|
+
attrs: {
|
|
58106
|
+
...node.attrs,
|
|
58107
|
+
"w:id": resolvedCommentId,
|
|
58108
|
+
internal
|
|
58109
|
+
}
|
|
58110
|
+
});
|
|
58111
|
+
} else {
|
|
58112
|
+
toDelete.push({ start: pos, end: pos + 1 });
|
|
58113
|
+
}
|
|
58039
58114
|
} else if (type2.name === "commentRangeEnd") {
|
|
58115
|
+
if (isDone) {
|
|
58116
|
+
toUpdate.push({
|
|
58117
|
+
pos,
|
|
58118
|
+
attrs: {
|
|
58119
|
+
...node.attrs,
|
|
58120
|
+
"w:id": resolvedCommentId
|
|
58121
|
+
}
|
|
58122
|
+
});
|
|
58123
|
+
return;
|
|
58124
|
+
}
|
|
58040
58125
|
const itemToMark = toMark.find((p) => p.importedId === importedId);
|
|
58041
58126
|
if (!itemToMark) return;
|
|
58042
58127
|
const { start: start2 } = itemToMark;
|
|
@@ -58051,6 +58136,11 @@ const prepareCommentsForImport = (doc2, tr, schema, converter) => {
|
|
|
58051
58136
|
toDelete.push({ start: pos, end: pos + 1 });
|
|
58052
58137
|
}
|
|
58053
58138
|
});
|
|
58139
|
+
if (typeof tr.setNodeMarkup === "function") {
|
|
58140
|
+
toUpdate.sort((a, b2) => b2.pos - a.pos).forEach(({ pos, attrs }) => {
|
|
58141
|
+
tr.setNodeMarkup(pos, void 0, attrs);
|
|
58142
|
+
});
|
|
58143
|
+
}
|
|
58054
58144
|
toDelete.sort((a, b2) => b2.start - a.start).forEach(({ start: start2, end: end2 }) => {
|
|
58055
58145
|
tr.delete(start2, end2);
|
|
58056
58146
|
});
|
|
@@ -58244,7 +58334,7 @@ const CommentsPlugin = Extension.create({
|
|
|
58244
58334
|
},
|
|
58245
58335
|
resolveComment: ({ commentId }) => ({ tr, dispatch, state: state2 }) => {
|
|
58246
58336
|
tr.setMeta(CommentsPluginKey, { event: "update" });
|
|
58247
|
-
|
|
58337
|
+
return resolveCommentById({ commentId, state: state2, tr, dispatch });
|
|
58248
58338
|
},
|
|
58249
58339
|
setCursorById: (id) => ({ state: state2, editor }) => {
|
|
58250
58340
|
const { from: from2 } = findRangeById(state2.doc, id) || {};
|
|
@@ -60550,7 +60640,7 @@ const isHeadless = (editor) => {
|
|
|
60550
60640
|
const shouldSkipNodeView = (editor) => {
|
|
60551
60641
|
return isHeadless(editor);
|
|
60552
60642
|
};
|
|
60553
|
-
const summaryVersion = "2.0.0-next.
|
|
60643
|
+
const summaryVersion = "2.0.0-next.14";
|
|
60554
60644
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
60555
60645
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
60556
60646
|
function mapAttributes(attrs) {
|
|
@@ -61339,7 +61429,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
61339
61429
|
{ default: remarkStringify },
|
|
61340
61430
|
{ default: remarkGfm }
|
|
61341
61431
|
] = await Promise.all([
|
|
61342
|
-
Promise.resolve().then(() => require("./index-
|
|
61432
|
+
Promise.resolve().then(() => require("./index-CIGMPabO-CaiVnKiQ.cjs")),
|
|
61343
61433
|
Promise.resolve().then(() => require("./index-DRCvimau-H4Ck3S9a.cjs")),
|
|
61344
61434
|
Promise.resolve().then(() => require("./index-C_x_N6Uh-Db3CUJMX.cjs")),
|
|
61345
61435
|
Promise.resolve().then(() => require("./index-D_sWOSiG-BtDZzJ6I.cjs")),
|
|
@@ -61544,7 +61634,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
61544
61634
|
* Process collaboration migrations
|
|
61545
61635
|
*/
|
|
61546
61636
|
processCollaborationMigrations() {
|
|
61547
|
-
console.debug("[checkVersionMigrations] Current editor version", "2.0.0-next.
|
|
61637
|
+
console.debug("[checkVersionMigrations] Current editor version", "2.0.0-next.14");
|
|
61548
61638
|
if (!this.options.ydoc) return;
|
|
61549
61639
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
61550
61640
|
let docVersion = metaMap.get("version");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref, onMounted, onUnmounted, computed, createElementBlock, openBlock, withModifiers, createElementVNode, withDirectives, unref, vModelText, createCommentVNode, nextTick } from "vue";
|
|
2
|
-
import { T as TextSelection } from "./chunks/converter-
|
|
3
|
-
import { _ as _export_sfc } from "./chunks/editor-
|
|
2
|
+
import { T as TextSelection } from "./chunks/converter-CHaTddld.js";
|
|
3
|
+
import { _ as _export_sfc } from "./chunks/editor-Ca-y1mB-.js";
|
|
4
4
|
const DEFAULT_API_ENDPOINT = "https://sd-dev-express-gateway-i6xtm.ondigitalocean.app/insights";
|
|
5
5
|
const SYSTEM_PROMPT = "You are an expert copywriter and you are immersed in a document editor. You are to provide document related text responses based on the user prompts. Only write what is asked for. Do not provide explanations. Try to keep placeholders as short as possible. Do not output your prompt. Your instructions are: ";
|
|
6
6
|
async function baseInsightsFetch(payload, options = {}) {
|
|
@@ -38535,8 +38535,6 @@ const decode$7 = (params) => {
|
|
|
38535
38535
|
);
|
|
38536
38536
|
const isInternal = parentComment?.isInternal || originalComment.isInternal;
|
|
38537
38537
|
if (commentsExportType === "external" && isInternal) return;
|
|
38538
|
-
const isResolved = !!originalComment.resolvedTime;
|
|
38539
|
-
if (isResolved) return;
|
|
38540
38538
|
if (node.type !== "commentRangeStart" && node.type !== "commentRangeEnd") {
|
|
38541
38539
|
return;
|
|
38542
38540
|
}
|
|
@@ -42769,7 +42767,7 @@ const _SuperConverter = class _SuperConverter {
|
|
|
42769
42767
|
static getStoredSuperdocVersion(docx) {
|
|
42770
42768
|
return _SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
42771
42769
|
}
|
|
42772
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version = "2.0.0-next.
|
|
42770
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version = "2.0.0-next.14") {
|
|
42773
42771
|
return _SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
|
|
42774
42772
|
}
|
|
42775
42773
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as process$1, aJ as commonjsGlobal, B as Buffer, aK as getDefaultExportFromCjs, aL as getContentTypesFromXml, aM as xmljs } from "./converter-
|
|
1
|
+
import { p as process$1, aJ as commonjsGlobal, B as Buffer, aK as getDefaultExportFromCjs, aL as getContentTypesFromXml, aM as xmljs } from "./converter-CHaTddld.js";
|
|
2
2
|
function commonjsRequire(path) {
|
|
3
3
|
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
4
4
|
}
|