@harbour-enterprises/superdoc 0.27.3-next.2 → 0.28.0-next.1
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-BjZ5mGJm.es.js → PdfViewer-9z5hlRyt.es.js} +1 -1
- package/dist/chunks/{PdfViewer-B4iIjHV0.cjs → PdfViewer-Jb55JUCS.cjs} +1 -1
- package/dist/chunks/{index-D6aLyyxJ.cjs → index-D0UvyM8m.cjs} +10 -4
- package/dist/chunks/{index-DkzQzDKS.es.js → index-DqP-8_tO.es.js} +10 -4
- package/dist/chunks/{super-editor.es-DAZHU_K5.es.js → super-editor.es-BBJIKdhr.es.js} +129 -34
- package/dist/chunks/{super-editor.es-BbpZtQLg.cjs → super-editor.es-Ca5D3ZTW.cjs} +129 -34
- package/dist/chunks/uuid-CjlX8hrF.es.js +35 -0
- package/dist/chunks/uuid-R7L08bOx.cjs +34 -0
- package/dist/components/CommentsLayer/use-comment.d.ts.map +1 -1
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/stores/comments-store.d.ts.map +1 -1
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-qTrGAY0a.js → converter-AR-76siZ.js} +37 -30
- package/dist/super-editor/chunks/{docx-zipper-BRttLmZq.js → docx-zipper-DVb-VGgt.js} +1 -1
- package/dist/super-editor/chunks/{editor-DqOCeU9J.js → editor-mK_uimq6.js} +93 -5
- package/dist/super-editor/chunks/{toolbar-cZin2t1V.js → toolbar-ByoNwr7x.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/src/components/toolbar/use-toolbar-item.d.ts +1 -1
- package/dist/super-editor/super-editor/src/core/commands/getSelectionMarks.d.ts +1 -0
- package/dist/super-editor/super-editor/src/core/commands/index.d.ts +2 -0
- package/dist/super-editor/super-editor/src/core/commands/setTextSelection.d.ts +4 -0
- package/dist/super-editor/super-editor/src/extensions/comment/comments-plugin.d.ts +2 -1
- package/dist/super-editor/super-editor/src/tests/helpers/helpers.d.ts +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 +161 -62
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +5 -8
- package/dist/chunks/uuid-CQzaMNgL.cjs +0 -36
- package/dist/chunks/uuid-DIIKH5Zc.es.js +0 -37
- package/dist/images/altText_add.svg +0 -3
- package/dist/images/altText_done.svg +0 -3
- package/dist/images/annotation-check.svg +0 -11
- package/dist/images/annotation-comment.svg +0 -16
- package/dist/images/annotation-help.svg +0 -26
- package/dist/images/annotation-insert.svg +0 -10
- package/dist/images/annotation-key.svg +0 -11
- package/dist/images/annotation-newparagraph.svg +0 -11
- package/dist/images/annotation-noicon.svg +0 -7
- package/dist/images/annotation-note.svg +0 -42
- package/dist/images/annotation-paperclip.svg +0 -6
- package/dist/images/annotation-paragraph.svg +0 -16
- package/dist/images/annotation-pushpin.svg +0 -7
- package/dist/images/cursor-editorFreeHighlight.svg +0 -6
- package/dist/images/cursor-editorFreeText.svg +0 -3
- package/dist/images/cursor-editorInk.svg +0 -4
- package/dist/images/cursor-editorTextHighlight.svg +0 -8
- package/dist/images/editor-toolbar-delete.svg +0 -5
- package/dist/images/loading-icon.gif +0 -0
- package/dist/images/toolbarButton-editorHighlight.svg +0 -6
- package/dist/images/toolbarButton-menuArrow.svg +0 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { m as defineComponent, B as h, O as Transition, $ as process$1, I as watchEffect, d as computed, r as ref, j as onMounted, W as onUnmounted, c as createElementBlock, o as openBlock, a as createBaseVNode, f as createCommentVNode, v as createVNode, x as unref } from "./vue-ZWZLQtoU.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-DqP-8_tO.es.js";
|
|
3
3
|
function self(vars) {
|
|
4
4
|
const {
|
|
5
5
|
opacityDisabled,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const vue = require("./vue-DKMj1I9B.cjs");
|
|
4
|
-
const superdoc = require("./index-
|
|
4
|
+
const superdoc = require("./index-D0UvyM8m.cjs");
|
|
5
5
|
function self(vars) {
|
|
6
6
|
const {
|
|
7
7
|
opacityDisabled,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const superEditor_es = require("./super-editor.es-
|
|
2
|
+
const superEditor_es = require("./super-editor.es-Ca5D3ZTW.cjs");
|
|
3
3
|
const vue = require("./vue-DKMj1I9B.cjs");
|
|
4
4
|
const blankDocx = require("./blank-docx-DfW3Eeh2.cjs");
|
|
5
5
|
const eventemitter3 = require("./eventemitter3-DkXkH2rT.cjs");
|
|
6
6
|
const provider = require("@hocuspocus/provider");
|
|
7
7
|
const Y = require("yjs");
|
|
8
8
|
const jszip = require("./jszip-u4dvXAKa.cjs");
|
|
9
|
-
const uuid = require("./uuid-
|
|
9
|
+
const uuid = require("./uuid-R7L08bOx.cjs");
|
|
10
10
|
function _interopNamespaceDefault(e) {
|
|
11
11
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
12
12
|
if (e) {
|
|
@@ -3431,6 +3431,7 @@ function useComment(params2) {
|
|
|
3431
3431
|
const isFocused = vue.ref(params2.isFocused || false);
|
|
3432
3432
|
const creatorEmail = params2.creatorEmail;
|
|
3433
3433
|
const creatorName = params2.creatorName;
|
|
3434
|
+
const creatorImage = params2.creatorImage;
|
|
3434
3435
|
const createdTime = params2.createdTime || Date.now();
|
|
3435
3436
|
const importedAuthor = vue.ref(params2.importedAuthor || null);
|
|
3436
3437
|
const commentText = vue.ref(params2.commentText || "");
|
|
@@ -3523,7 +3524,7 @@ function useComment(params2) {
|
|
|
3523
3524
|
selection.selectionBounds = newCoords;
|
|
3524
3525
|
};
|
|
3525
3526
|
const getCommentUser = () => {
|
|
3526
|
-
const user = importedAuthor.value ? { name: importedAuthor.value.name || "(Imported)", email: importedAuthor.value.email } : { name: creatorName, email: creatorEmail };
|
|
3527
|
+
const user = importedAuthor.value ? { name: importedAuthor.value.name || "(Imported)", email: importedAuthor.value.email } : { name: creatorName, email: creatorEmail, image: creatorImage };
|
|
3527
3528
|
return user;
|
|
3528
3529
|
};
|
|
3529
3530
|
const propagateUpdate = (superdoc2, event) => {
|
|
@@ -3544,6 +3545,7 @@ function useComment(params2) {
|
|
|
3544
3545
|
createdAtVersionNumber,
|
|
3545
3546
|
creatorEmail,
|
|
3546
3547
|
creatorName,
|
|
3548
|
+
creatorImage,
|
|
3547
3549
|
createdTime,
|
|
3548
3550
|
importedAuthor: importedAuthor.value,
|
|
3549
3551
|
isInternal: isInternal.value,
|
|
@@ -3570,6 +3572,7 @@ function useComment(params2) {
|
|
|
3570
3572
|
isFocused,
|
|
3571
3573
|
creatorEmail,
|
|
3572
3574
|
creatorName,
|
|
3575
|
+
creatorImage,
|
|
3573
3576
|
createdTime,
|
|
3574
3577
|
isInternal,
|
|
3575
3578
|
commentText,
|
|
@@ -3966,6 +3969,7 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
|
|
|
3966
3969
|
trackedChangeType,
|
|
3967
3970
|
deletedText,
|
|
3968
3971
|
authorEmail,
|
|
3972
|
+
authorImage,
|
|
3969
3973
|
date,
|
|
3970
3974
|
author: authorName,
|
|
3971
3975
|
importedAuthor,
|
|
@@ -3982,6 +3986,7 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
|
|
|
3982
3986
|
createdTime: date,
|
|
3983
3987
|
creatorName: authorName,
|
|
3984
3988
|
creatorEmail: authorEmail,
|
|
3989
|
+
creatorImage: authorImage,
|
|
3985
3990
|
isInternal: false,
|
|
3986
3991
|
importedAuthor,
|
|
3987
3992
|
selection: {
|
|
@@ -4091,6 +4096,7 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
|
|
|
4091
4096
|
parentCommentId,
|
|
4092
4097
|
creatorEmail: superdocStore.user.email,
|
|
4093
4098
|
creatorName: superdocStore.user.name,
|
|
4099
|
+
creatorImage: superdocStore.user.image,
|
|
4094
4100
|
commentText: currentCommentText.value,
|
|
4095
4101
|
selection,
|
|
4096
4102
|
...options
|
|
@@ -17167,7 +17173,7 @@ const _sfc_main = {
|
|
|
17167
17173
|
__name: "SuperDoc",
|
|
17168
17174
|
emits: ["selection-update"],
|
|
17169
17175
|
setup(__props, { emit: __emit }) {
|
|
17170
|
-
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-
|
|
17176
|
+
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-Jb55JUCS.cjs")));
|
|
17171
17177
|
const superdocStore = useSuperdocStore();
|
|
17172
17178
|
const commentsStore = useCommentsStore();
|
|
17173
17179
|
const {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, 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, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-BBJIKdhr.es.js";
|
|
2
2
|
import { a0 as effectScope, r as ref, _ as markRaw, $ as process$1, a1 as toRaw, d as computed, a2 as isRef, a3 as isReactive, C as toRef, i as inject, p as getCurrentInstance, l as watch, x as unref, a4 as hasInjectionContext, M as reactive, s as nextTick, a5 as getCurrentScope, a6 as onScopeDispose, a7 as toRefs, g as global$1, J as shallowRef, N as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, S as onActivated, q as onDeactivated, z as createTextVNode, F as Fragment, Q as Comment, m as defineComponent, D as provide, H as withDirectives, B as h, U as Teleport, R as renderSlot, V as isVNode, I as watchEffect, O as Transition, a8 as TransitionGroup, E as mergeProps, P as vShow, G as cloneVNode, T as Text, c as createElementBlock, o as openBlock, t as toDisplayString, v as createVNode, y as withCtx, a as createBaseVNode, A as normalizeStyle, f as createCommentVNode, u as createBlock, w as withModifiers, n as normalizeClass, a9 as resolveDirective, e as renderList, b as createApp, X as resolveDynamicComponent, aa as defineAsyncComponent } from "./vue-ZWZLQtoU.es.js";
|
|
3
3
|
import { B as BlankDOCX } from "./blank-docx-ABm6XYAA.es.js";
|
|
4
4
|
import { E as EventEmitter } from "./eventemitter3-BWEnUdTY.es.js";
|
|
@@ -6,7 +6,7 @@ import { HocuspocusProvider, HocuspocusProviderWebsocket } from "@hocuspocus/pro
|
|
|
6
6
|
import * as Y from "yjs";
|
|
7
7
|
import { Doc, Map as Map$2 } from "yjs";
|
|
8
8
|
import { B as Buffer$2 } from "./jszip-BDk3JBqp.es.js";
|
|
9
|
-
import { v as v4 } from "./uuid-
|
|
9
|
+
import { v as v4 } from "./uuid-CjlX8hrF.es.js";
|
|
10
10
|
const DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
11
11
|
const PDF = "application/pdf";
|
|
12
12
|
const HTML = "text/html";
|
|
@@ -3414,6 +3414,7 @@ function useComment(params2) {
|
|
|
3414
3414
|
const isFocused = ref(params2.isFocused || false);
|
|
3415
3415
|
const creatorEmail = params2.creatorEmail;
|
|
3416
3416
|
const creatorName = params2.creatorName;
|
|
3417
|
+
const creatorImage = params2.creatorImage;
|
|
3417
3418
|
const createdTime = params2.createdTime || Date.now();
|
|
3418
3419
|
const importedAuthor = ref(params2.importedAuthor || null);
|
|
3419
3420
|
const commentText = ref(params2.commentText || "");
|
|
@@ -3506,7 +3507,7 @@ function useComment(params2) {
|
|
|
3506
3507
|
selection.selectionBounds = newCoords;
|
|
3507
3508
|
};
|
|
3508
3509
|
const getCommentUser = () => {
|
|
3509
|
-
const user = importedAuthor.value ? { name: importedAuthor.value.name || "(Imported)", email: importedAuthor.value.email } : { name: creatorName, email: creatorEmail };
|
|
3510
|
+
const user = importedAuthor.value ? { name: importedAuthor.value.name || "(Imported)", email: importedAuthor.value.email } : { name: creatorName, email: creatorEmail, image: creatorImage };
|
|
3510
3511
|
return user;
|
|
3511
3512
|
};
|
|
3512
3513
|
const propagateUpdate = (superdoc2, event) => {
|
|
@@ -3527,6 +3528,7 @@ function useComment(params2) {
|
|
|
3527
3528
|
createdAtVersionNumber,
|
|
3528
3529
|
creatorEmail,
|
|
3529
3530
|
creatorName,
|
|
3531
|
+
creatorImage,
|
|
3530
3532
|
createdTime,
|
|
3531
3533
|
importedAuthor: importedAuthor.value,
|
|
3532
3534
|
isInternal: isInternal.value,
|
|
@@ -3553,6 +3555,7 @@ function useComment(params2) {
|
|
|
3553
3555
|
isFocused,
|
|
3554
3556
|
creatorEmail,
|
|
3555
3557
|
creatorName,
|
|
3558
|
+
creatorImage,
|
|
3556
3559
|
createdTime,
|
|
3557
3560
|
isInternal,
|
|
3558
3561
|
commentText,
|
|
@@ -3949,6 +3952,7 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
|
|
|
3949
3952
|
trackedChangeType,
|
|
3950
3953
|
deletedText,
|
|
3951
3954
|
authorEmail,
|
|
3955
|
+
authorImage,
|
|
3952
3956
|
date,
|
|
3953
3957
|
author: authorName,
|
|
3954
3958
|
importedAuthor,
|
|
@@ -3965,6 +3969,7 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
|
|
|
3965
3969
|
createdTime: date,
|
|
3966
3970
|
creatorName: authorName,
|
|
3967
3971
|
creatorEmail: authorEmail,
|
|
3972
|
+
creatorImage: authorImage,
|
|
3968
3973
|
isInternal: false,
|
|
3969
3974
|
importedAuthor,
|
|
3970
3975
|
selection: {
|
|
@@ -4074,6 +4079,7 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
|
|
|
4074
4079
|
parentCommentId,
|
|
4075
4080
|
creatorEmail: superdocStore.user.email,
|
|
4076
4081
|
creatorName: superdocStore.user.name,
|
|
4082
|
+
creatorImage: superdocStore.user.image,
|
|
4077
4083
|
commentText: currentCommentText.value,
|
|
4078
4084
|
selection,
|
|
4079
4085
|
...options
|
|
@@ -17150,7 +17156,7 @@ const _sfc_main = {
|
|
|
17150
17156
|
__name: "SuperDoc",
|
|
17151
17157
|
emits: ["selection-update"],
|
|
17152
17158
|
setup(__props, { emit: __emit }) {
|
|
17153
|
-
const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-
|
|
17159
|
+
const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-9z5hlRyt.es.js"));
|
|
17154
17160
|
const superdocStore = useSuperdocStore();
|
|
17155
17161
|
const commentsStore = useCommentsStore();
|
|
17156
17162
|
const {
|
|
@@ -11330,39 +11330,37 @@ function requireLib() {
|
|
|
11330
11330
|
}
|
|
11331
11331
|
var libExports = requireLib();
|
|
11332
11332
|
const xmljs = /* @__PURE__ */ getDefaultExportFromCjs$2(libExports);
|
|
11333
|
-
|
|
11334
|
-
|
|
11333
|
+
let getRandomValues;
|
|
11334
|
+
const rnds8 = new Uint8Array(16);
|
|
11335
11335
|
function rng() {
|
|
11336
11336
|
if (!getRandomValues) {
|
|
11337
|
-
getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)
|
|
11337
|
+
getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
|
11338
11338
|
if (!getRandomValues) {
|
|
11339
11339
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
11340
11340
|
}
|
|
11341
11341
|
}
|
|
11342
11342
|
return getRandomValues(rnds8);
|
|
11343
11343
|
}
|
|
11344
|
-
const
|
|
11345
|
-
|
|
11346
|
-
|
|
11344
|
+
const byteToHex = [];
|
|
11345
|
+
for (let i = 0; i < 256; ++i) {
|
|
11346
|
+
byteToHex.push((i + 256).toString(16).slice(1));
|
|
11347
11347
|
}
|
|
11348
|
-
|
|
11349
|
-
|
|
11350
|
-
byteToHex.push((i$2 + 256).toString(16).substr(1));
|
|
11351
|
-
}
|
|
11352
|
-
function stringify(arr) {
|
|
11353
|
-
var offset2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
11354
|
-
var uuid = (byteToHex[arr[offset2 + 0]] + byteToHex[arr[offset2 + 1]] + byteToHex[arr[offset2 + 2]] + byteToHex[arr[offset2 + 3]] + "-" + byteToHex[arr[offset2 + 4]] + byteToHex[arr[offset2 + 5]] + "-" + byteToHex[arr[offset2 + 6]] + byteToHex[arr[offset2 + 7]] + "-" + byteToHex[arr[offset2 + 8]] + byteToHex[arr[offset2 + 9]] + "-" + byteToHex[arr[offset2 + 10]] + byteToHex[arr[offset2 + 11]] + byteToHex[arr[offset2 + 12]] + byteToHex[arr[offset2 + 13]] + byteToHex[arr[offset2 + 14]] + byteToHex[arr[offset2 + 15]]).toLowerCase();
|
|
11355
|
-
if (!validate(uuid)) {
|
|
11356
|
-
throw TypeError("Stringified UUID is invalid");
|
|
11357
|
-
}
|
|
11358
|
-
return uuid;
|
|
11348
|
+
function unsafeStringify(arr, offset2 = 0) {
|
|
11349
|
+
return byteToHex[arr[offset2 + 0]] + byteToHex[arr[offset2 + 1]] + byteToHex[arr[offset2 + 2]] + byteToHex[arr[offset2 + 3]] + "-" + byteToHex[arr[offset2 + 4]] + byteToHex[arr[offset2 + 5]] + "-" + byteToHex[arr[offset2 + 6]] + byteToHex[arr[offset2 + 7]] + "-" + byteToHex[arr[offset2 + 8]] + byteToHex[arr[offset2 + 9]] + "-" + byteToHex[arr[offset2 + 10]] + byteToHex[arr[offset2 + 11]] + byteToHex[arr[offset2 + 12]] + byteToHex[arr[offset2 + 13]] + byteToHex[arr[offset2 + 14]] + byteToHex[arr[offset2 + 15]];
|
|
11359
11350
|
}
|
|
11351
|
+
const randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
11352
|
+
const native = {
|
|
11353
|
+
randomUUID
|
|
11354
|
+
};
|
|
11360
11355
|
function v4(options, buf, offset2) {
|
|
11356
|
+
if (native.randomUUID && true && !options) {
|
|
11357
|
+
return native.randomUUID();
|
|
11358
|
+
}
|
|
11361
11359
|
options = options || {};
|
|
11362
|
-
|
|
11360
|
+
const rnds = options.random || (options.rng || rng)();
|
|
11363
11361
|
rnds[6] = rnds[6] & 15 | 64;
|
|
11364
11362
|
rnds[8] = rnds[8] & 63 | 128;
|
|
11365
|
-
return
|
|
11363
|
+
return unsafeStringify(rnds);
|
|
11366
11364
|
}
|
|
11367
11365
|
function getDefaultExportFromCjs(x) {
|
|
11368
11366
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
@@ -14415,6 +14413,7 @@ class ParseContext {
|
|
|
14415
14413
|
addTextNode(dom, marks) {
|
|
14416
14414
|
let value = dom.nodeValue;
|
|
14417
14415
|
let top2 = this.top, preserveWS = top2.options & OPT_PRESERVE_WS_FULL ? "full" : this.localPreserveWS || (top2.options & OPT_PRESERVE_WS) > 0;
|
|
14416
|
+
let { schema } = this.parser;
|
|
14418
14417
|
if (preserveWS === "full" || top2.inlineContext(dom) || /[^ \t\r\n\u000c]/.test(value)) {
|
|
14419
14418
|
if (!preserveWS) {
|
|
14420
14419
|
value = value.replace(/[ \t\r\n\u000c]+/g, " ");
|
|
@@ -14424,13 +14423,22 @@ class ParseContext {
|
|
|
14424
14423
|
if (!nodeBefore || domNodeBefore && domNodeBefore.nodeName == "BR" || nodeBefore.isText && /[ \t\r\n\u000c]$/.test(nodeBefore.text))
|
|
14425
14424
|
value = value.slice(1);
|
|
14426
14425
|
}
|
|
14427
|
-
} else if (preserveWS
|
|
14428
|
-
value = value.replace(/\r?\n|\r/g, " ");
|
|
14429
|
-
} else {
|
|
14426
|
+
} else if (preserveWS === "full") {
|
|
14430
14427
|
value = value.replace(/\r\n?/g, "\n");
|
|
14428
|
+
} else if (schema.linebreakReplacement && /[\r\n]/.test(value) && this.top.findWrapping(schema.linebreakReplacement.create())) {
|
|
14429
|
+
let lines = value.split(/\r?\n|\r/);
|
|
14430
|
+
for (let i = 0; i < lines.length; i++) {
|
|
14431
|
+
if (i)
|
|
14432
|
+
this.insertNode(schema.linebreakReplacement.create(), marks, true);
|
|
14433
|
+
if (lines[i])
|
|
14434
|
+
this.insertNode(schema.text(lines[i]), marks, !/\S/.test(lines[i]));
|
|
14435
|
+
}
|
|
14436
|
+
value = "";
|
|
14437
|
+
} else {
|
|
14438
|
+
value = value.replace(/\r?\n|\r/g, " ");
|
|
14431
14439
|
}
|
|
14432
14440
|
if (value)
|
|
14433
|
-
this.insertNode(
|
|
14441
|
+
this.insertNode(schema.text(value), marks, !/\S/.test(value));
|
|
14434
14442
|
this.findInText(dom);
|
|
14435
14443
|
} else {
|
|
14436
14444
|
this.findInside(dom);
|
|
@@ -18990,7 +18998,6 @@ class Transaction extends Transform {
|
|
|
18990
18998
|
} else {
|
|
18991
18999
|
if (to == null)
|
|
18992
19000
|
to = from2;
|
|
18993
|
-
to = to == null ? from2 : to;
|
|
18994
19001
|
if (!text)
|
|
18995
19002
|
return this.deleteRange(from2, to);
|
|
18996
19003
|
let marks = this.storedMarks;
|
|
@@ -18999,7 +19006,7 @@ class Transaction extends Transform {
|
|
|
18999
19006
|
marks = to == from2 ? $from.marks() : $from.marksAcross(this.doc.resolve(to));
|
|
19000
19007
|
}
|
|
19001
19008
|
this.replaceRangeWith(from2, to, schema.text(text, marks));
|
|
19002
|
-
if (!this.selection.empty)
|
|
19009
|
+
if (!this.selection.empty && this.selection.to == from2 + text.length)
|
|
19003
19010
|
this.setSelection(Selection.near(this.selection.$to));
|
|
19004
19011
|
return this;
|
|
19005
19012
|
}
|
|
@@ -19191,7 +19198,7 @@ class EditorState {
|
|
|
19191
19198
|
return newInstance;
|
|
19192
19199
|
}
|
|
19193
19200
|
/**
|
|
19194
|
-
|
|
19201
|
+
Accessor that constructs and returns a new [transaction](https://prosemirror.net/docs/ref/#state.Transaction) from this state.
|
|
19195
19202
|
*/
|
|
19196
19203
|
get tr() {
|
|
19197
19204
|
return new Transaction(this);
|
|
@@ -28244,11 +28251,11 @@ function applyColorModifier(hexColor, modifier, value) {
|
|
|
28244
28251
|
} else {
|
|
28245
28252
|
return hexColor;
|
|
28246
28253
|
}
|
|
28247
|
-
const
|
|
28254
|
+
const clamp2 = (n) => Math.max(0, Math.min(255, Math.round(n)));
|
|
28248
28255
|
const toHex2 = (n) => n.toString(16).padStart(2, "0");
|
|
28249
|
-
newR =
|
|
28250
|
-
newG =
|
|
28251
|
-
newB =
|
|
28256
|
+
newR = clamp2(newR);
|
|
28257
|
+
newG = clamp2(newG);
|
|
28258
|
+
newB = clamp2(newB);
|
|
28252
28259
|
const result = `#${toHex2(newR)}${toHex2(newG)}${toHex2(newB)}`;
|
|
28253
28260
|
return result;
|
|
28254
28261
|
}
|
|
@@ -35926,7 +35933,7 @@ exportProcessNewRelationships_fn = function(rels = []) {
|
|
|
35926
35933
|
});
|
|
35927
35934
|
relationships.elements = [...relationships.elements, ...newRels];
|
|
35928
35935
|
};
|
|
35929
|
-
exportProcessMediaFiles_fn = async function(media = {}
|
|
35936
|
+
exportProcessMediaFiles_fn = async function(media = {}) {
|
|
35930
35937
|
const processedData = {
|
|
35931
35938
|
...this.convertedXml.media || {}
|
|
35932
35939
|
};
|
|
@@ -43693,6 +43700,8 @@ function readDOMChange(view, from2, to, typeOver, addedNodes) {
|
|
|
43693
43700
|
let deflt = () => mkTr(view.state.tr.insertText(text, chFrom, chTo));
|
|
43694
43701
|
if (!view.someProp("handleTextInput", (f2) => f2(view, chFrom, chTo, text, deflt)))
|
|
43695
43702
|
view.dispatch(deflt());
|
|
43703
|
+
} else {
|
|
43704
|
+
view.dispatch(mkTr());
|
|
43696
43705
|
}
|
|
43697
43706
|
} else {
|
|
43698
43707
|
view.dispatch(mkTr());
|
|
@@ -48890,6 +48899,49 @@ const restoreSelection = () => ({ editor, state: state2, tr }) => {
|
|
|
48890
48899
|
editor.view.dispatch(selectionTr);
|
|
48891
48900
|
}
|
|
48892
48901
|
};
|
|
48902
|
+
const clamp = (value, min2, max2) => Math.max(min2, Math.min(value, max2));
|
|
48903
|
+
const setTextSelection = ({ from: from2, to }) => ({ state: state2, dispatch, editor }) => {
|
|
48904
|
+
if (typeof from2 !== "number" && typeof to !== "number") {
|
|
48905
|
+
return false;
|
|
48906
|
+
}
|
|
48907
|
+
const doc2 = state2.doc;
|
|
48908
|
+
const docSize = doc2.content.size;
|
|
48909
|
+
const nextFrom = clamp(typeof from2 === "number" ? from2 : state2.selection.from, 0, docSize);
|
|
48910
|
+
const nextToBase = typeof to === "number" ? to : nextFrom;
|
|
48911
|
+
const nextTo = clamp(nextToBase, 0, docSize);
|
|
48912
|
+
const [head, anchor] = nextFrom <= nextTo ? [nextFrom, nextTo] : [nextTo, nextFrom];
|
|
48913
|
+
const selection = TextSelection$1.create(doc2, head, anchor);
|
|
48914
|
+
if (dispatch) {
|
|
48915
|
+
const transaction = state2.tr.setSelection(selection);
|
|
48916
|
+
dispatch(transaction);
|
|
48917
|
+
}
|
|
48918
|
+
if (editor?.view?.focus) {
|
|
48919
|
+
editor.view.focus();
|
|
48920
|
+
}
|
|
48921
|
+
return true;
|
|
48922
|
+
};
|
|
48923
|
+
const getSelectionMarks = () => ({ state: state2, tr }) => {
|
|
48924
|
+
tr.setMeta("preventDispatch", true);
|
|
48925
|
+
const marks = getMarksFromSelection(state2) ?? [];
|
|
48926
|
+
const uniqueByType = /* @__PURE__ */ new Map();
|
|
48927
|
+
for (const mark of marks) {
|
|
48928
|
+
const typeName = typeof mark?.type === "string" ? mark.type : mark?.type?.name;
|
|
48929
|
+
if (!typeName) continue;
|
|
48930
|
+
const existing = uniqueByType.get(typeName);
|
|
48931
|
+
if (!existing) {
|
|
48932
|
+
uniqueByType.set(typeName, mark);
|
|
48933
|
+
continue;
|
|
48934
|
+
}
|
|
48935
|
+
const existingAttrs = existing?.attrs ?? {};
|
|
48936
|
+
const nextAttrs = mark?.attrs ?? {};
|
|
48937
|
+
const existingHasValues = Object.values(existingAttrs).some((value) => value != null);
|
|
48938
|
+
const nextHasValues = Object.values(nextAttrs).some((value) => value != null);
|
|
48939
|
+
if (!existingHasValues && nextHasValues) {
|
|
48940
|
+
uniqueByType.set(typeName, mark);
|
|
48941
|
+
}
|
|
48942
|
+
}
|
|
48943
|
+
return Array.from(uniqueByType.values());
|
|
48944
|
+
};
|
|
48893
48945
|
const commands$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
48894
48946
|
__proto__: null,
|
|
48895
48947
|
atVisualParaEnd,
|
|
@@ -48905,6 +48957,7 @@ const commands$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
|
|
|
48905
48957
|
first,
|
|
48906
48958
|
getEffectiveStyleId,
|
|
48907
48959
|
getParaCtx,
|
|
48960
|
+
getSelectionMarks,
|
|
48908
48961
|
getStyleIdFromMarks,
|
|
48909
48962
|
handleBackspaceNextToList,
|
|
48910
48963
|
handleDeleteNextToList,
|
|
@@ -48936,6 +48989,7 @@ const commands$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
|
|
|
48936
48989
|
setMark,
|
|
48937
48990
|
setMeta,
|
|
48938
48991
|
setNode,
|
|
48992
|
+
setTextSelection,
|
|
48939
48993
|
sinkListItem,
|
|
48940
48994
|
splitBlock: splitBlock$1,
|
|
48941
48995
|
splitListItem,
|
|
@@ -49600,6 +49654,7 @@ const markInsertion = ({ tr, from: from2, to, user, date }) => {
|
|
|
49600
49654
|
id,
|
|
49601
49655
|
author: user.name,
|
|
49602
49656
|
authorEmail: user.email,
|
|
49657
|
+
authorImage: user.image,
|
|
49603
49658
|
date
|
|
49604
49659
|
});
|
|
49605
49660
|
tr.addMark(from2, to, insertionMark);
|
|
@@ -49636,6 +49691,7 @@ const markDeletion = ({ tr, from: from2, to, user, date, id: providedId }) => {
|
|
|
49636
49691
|
id,
|
|
49637
49692
|
author: user.name,
|
|
49638
49693
|
authorEmail: user.email,
|
|
49694
|
+
authorImage: user.image,
|
|
49639
49695
|
date
|
|
49640
49696
|
});
|
|
49641
49697
|
const deletionMap = new Mapping();
|
|
@@ -50332,6 +50388,9 @@ const normalizeCommentEventPayload = ({ conversation, editorOptions, fallbackCom
|
|
|
50332
50388
|
if (!normalized.creatorEmail && user?.email) {
|
|
50333
50389
|
normalized.creatorEmail = user.email;
|
|
50334
50390
|
}
|
|
50391
|
+
if (!normalized.creatorImage && user?.image) {
|
|
50392
|
+
normalized.creatorImage = user.image;
|
|
50393
|
+
}
|
|
50335
50394
|
if (!normalized.createdTime) {
|
|
50336
50395
|
normalized.createdTime = Date.now();
|
|
50337
50396
|
}
|
|
@@ -50790,7 +50849,7 @@ const createOrUpdateTrackedChangeComment = ({ event, marks, deletionNodes, nodes
|
|
|
50790
50849
|
const trackedMark = marks.insertedMark || marks.deletionMark || marks.formatMark;
|
|
50791
50850
|
const { type: type2, attrs } = trackedMark;
|
|
50792
50851
|
const { name: trackedChangeType } = type2;
|
|
50793
|
-
const { author, authorEmail, date, importedAuthor } = attrs;
|
|
50852
|
+
const { author, authorEmail, authorImage, date, importedAuthor } = attrs;
|
|
50794
50853
|
const id = attrs.id;
|
|
50795
50854
|
const node = nodes[0];
|
|
50796
50855
|
const isDeletionInsertion = !!(marks.insertedMark && marks.deletionMark);
|
|
@@ -50821,6 +50880,7 @@ const createOrUpdateTrackedChangeComment = ({ event, marks, deletionNodes, nodes
|
|
|
50821
50880
|
deletedText: marks.deletionMark ? deletionText : null,
|
|
50822
50881
|
author,
|
|
50823
50882
|
authorEmail,
|
|
50883
|
+
...authorImage && { authorImage },
|
|
50824
50884
|
date,
|
|
50825
50885
|
...importedAuthor && {
|
|
50826
50886
|
importedAuthor: {
|
|
@@ -50965,6 +51025,7 @@ const addMarkStep = ({ state: state2, step, newTr, doc: doc2, user, date }) => {
|
|
|
50965
51025
|
id: wid,
|
|
50966
51026
|
author: user.name,
|
|
50967
51027
|
authorEmail: user.email,
|
|
51028
|
+
authorImage: user.image,
|
|
50968
51029
|
date,
|
|
50969
51030
|
before,
|
|
50970
51031
|
after
|
|
@@ -51030,6 +51091,7 @@ const removeMarkStep = ({ state: state2, step, newTr, doc: doc2, user, date }) =
|
|
|
51030
51091
|
id: v4(),
|
|
51031
51092
|
author: user.name,
|
|
51032
51093
|
authorEmail: user.email,
|
|
51094
|
+
authorImage: user.image,
|
|
51033
51095
|
date,
|
|
51034
51096
|
before,
|
|
51035
51097
|
after
|
|
@@ -55029,6 +55091,9 @@ class GapBookmark {
|
|
|
55029
55091
|
return GapCursor.valid($pos) ? new GapCursor($pos) : Selection.near($pos);
|
|
55030
55092
|
}
|
|
55031
55093
|
}
|
|
55094
|
+
function needsGap(type2) {
|
|
55095
|
+
return type2.isAtom || type2.spec.isolating || type2.spec.createGapCursor;
|
|
55096
|
+
}
|
|
55032
55097
|
function closedBefore($pos) {
|
|
55033
55098
|
for (let d2 = $pos.depth; d2 >= 0; d2--) {
|
|
55034
55099
|
let index2 = $pos.index(d2), parent = $pos.node(d2);
|
|
@@ -55038,7 +55103,7 @@ function closedBefore($pos) {
|
|
|
55038
55103
|
continue;
|
|
55039
55104
|
}
|
|
55040
55105
|
for (let before = parent.child(index2 - 1); ; before = before.lastChild) {
|
|
55041
|
-
if (before.childCount == 0 && !before.inlineContent || before.
|
|
55106
|
+
if (before.childCount == 0 && !before.inlineContent || needsGap(before.type))
|
|
55042
55107
|
return true;
|
|
55043
55108
|
if (before.inlineContent)
|
|
55044
55109
|
return false;
|
|
@@ -55055,7 +55120,7 @@ function closedAfter($pos) {
|
|
|
55055
55120
|
continue;
|
|
55056
55121
|
}
|
|
55057
55122
|
for (let after = parent.child(index2); ; after = after.firstChild) {
|
|
55058
|
-
if (after.childCount == 0 && !after.inlineContent || after.
|
|
55123
|
+
if (after.childCount == 0 && !after.inlineContent || needsGap(after.type))
|
|
55059
55124
|
return true;
|
|
55060
55125
|
if (after.inlineContent)
|
|
55061
55126
|
return false;
|
|
@@ -69940,6 +70005,16 @@ const TrackInsert = Mark2.create({
|
|
|
69940
70005
|
};
|
|
69941
70006
|
}
|
|
69942
70007
|
},
|
|
70008
|
+
authorImage: {
|
|
70009
|
+
default: "",
|
|
70010
|
+
parseDOM: (elem) => elem.getAttribute("data-authorimage"),
|
|
70011
|
+
renderDOM: (attrs) => {
|
|
70012
|
+
if (!attrs.authorImage) return {};
|
|
70013
|
+
return {
|
|
70014
|
+
"data-authorimage": attrs.authorImage
|
|
70015
|
+
};
|
|
70016
|
+
}
|
|
70017
|
+
},
|
|
69943
70018
|
date: {
|
|
69944
70019
|
default: "",
|
|
69945
70020
|
parseDOM: (elem) => elem.getAttribute("data-date"),
|
|
@@ -70007,6 +70082,16 @@ const TrackDelete = Mark2.create({
|
|
|
70007
70082
|
};
|
|
70008
70083
|
}
|
|
70009
70084
|
},
|
|
70085
|
+
authorImage: {
|
|
70086
|
+
default: "",
|
|
70087
|
+
parseDOM: (elem) => elem.getAttribute("data-authorimage"),
|
|
70088
|
+
renderDOM: (attrs) => {
|
|
70089
|
+
if (!attrs.authorImage) return {};
|
|
70090
|
+
return {
|
|
70091
|
+
"data-authorimage": attrs.authorImage
|
|
70092
|
+
};
|
|
70093
|
+
}
|
|
70094
|
+
},
|
|
70010
70095
|
date: {
|
|
70011
70096
|
default: "",
|
|
70012
70097
|
parseDOM: (elem) => elem.getAttribute("data-date"),
|
|
@@ -70106,6 +70191,16 @@ const TrackFormat = Mark2.create({
|
|
|
70106
70191
|
};
|
|
70107
70192
|
}
|
|
70108
70193
|
},
|
|
70194
|
+
authorImage: {
|
|
70195
|
+
default: "",
|
|
70196
|
+
parseDOM: (elem) => elem.getAttribute("data-authorimage"),
|
|
70197
|
+
renderDOM: (attrs) => {
|
|
70198
|
+
if (!attrs.authorImage) return {};
|
|
70199
|
+
return {
|
|
70200
|
+
"data-authorimage": attrs.authorImage
|
|
70201
|
+
};
|
|
70202
|
+
}
|
|
70203
|
+
},
|
|
70109
70204
|
date: {
|
|
70110
70205
|
default: "",
|
|
70111
70206
|
parseDOM: (elem) => elem.getAttribute("data-date"),
|