@ones-editor/editor 2.9.3 → 2.9.4
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/index.js
CHANGED
|
@@ -26523,6 +26523,9 @@ var __publicField = (obj, key, value) => {
|
|
|
26523
26523
|
}
|
|
26524
26524
|
}
|
|
26525
26525
|
function editorScrollIntoView(editor) {
|
|
26526
|
+
if (!editor.scrollable()) {
|
|
26527
|
+
return;
|
|
26528
|
+
}
|
|
26526
26529
|
if (!isElementVisible(editor.rootContainer)) {
|
|
26527
26530
|
logger$3R.warn("editorScrollIntoView: editor is not visible");
|
|
26528
26531
|
return;
|
|
@@ -31866,6 +31869,7 @@ ${codeText}
|
|
|
31866
31869
|
__publicField(this, "inputHandlers", new EditorInputHandlers(this));
|
|
31867
31870
|
__publicField(this, "settingsProvider");
|
|
31868
31871
|
__publicField(this, "_readonly", false);
|
|
31872
|
+
__publicField(this, "_scrollable", true);
|
|
31869
31873
|
__publicField(this, "getColor", (index2) => {
|
|
31870
31874
|
const colors = this.options.colors;
|
|
31871
31875
|
if (colors.length === 0) {
|
|
@@ -32094,6 +32098,12 @@ ${codeText}
|
|
|
32094
32098
|
return false;
|
|
32095
32099
|
return elem.closest("div.editor-root") === this.rootElement;
|
|
32096
32100
|
}
|
|
32101
|
+
scrollable() {
|
|
32102
|
+
return this._scrollable;
|
|
32103
|
+
}
|
|
32104
|
+
setScrollable(scrollable2) {
|
|
32105
|
+
this._scrollable = scrollable2;
|
|
32106
|
+
}
|
|
32097
32107
|
insertBlock(containerId, blockIndex, blockData, newRange, options) {
|
|
32098
32108
|
const defaultPos = { blockId: blockData.id, offset: 0 };
|
|
32099
32109
|
const defaultRange = { anchor: defaultPos, focus: defaultPos };
|
|
@@ -70392,6 +70402,9 @@ ${codeText}
|
|
|
70392
70402
|
}
|
|
70393
70403
|
});
|
|
70394
70404
|
__publicField(this, "handleSelectionChanged", () => {
|
|
70405
|
+
if (!this.editor.scrollable()) {
|
|
70406
|
+
return;
|
|
70407
|
+
}
|
|
70395
70408
|
setTimeout(() => {
|
|
70396
70409
|
var _a;
|
|
70397
70410
|
if (this.type !== "current") {
|
|
@@ -71006,7 +71019,14 @@ ${codeText}
|
|
|
71006
71019
|
}
|
|
71007
71020
|
onCreateComment(commentId, local) {
|
|
71008
71021
|
const comment = this.commentsProvider.getComment(commentId);
|
|
71009
|
-
|
|
71022
|
+
try {
|
|
71023
|
+
this.editor.setScrollable(false);
|
|
71024
|
+
this.list.handleCreateComment(comment, local);
|
|
71025
|
+
} finally {
|
|
71026
|
+
setTimeout(() => {
|
|
71027
|
+
this.editor.setScrollable(true);
|
|
71028
|
+
}, 1e3);
|
|
71029
|
+
}
|
|
71010
71030
|
this.updateCommentCount();
|
|
71011
71031
|
}
|
|
71012
71032
|
onDeleteComment(commentId, local) {
|
|
@@ -71678,7 +71698,14 @@ ${codeText}
|
|
|
71678
71698
|
const range = createBlockSimpleRange(editor, block, selectedBlock.start.offset, selectedBlock.end.offset);
|
|
71679
71699
|
const command = `comment-${comment.id.toLocaleLowerCase()}`;
|
|
71680
71700
|
const value = comment.id;
|
|
71681
|
-
|
|
71701
|
+
try {
|
|
71702
|
+
editor.setScrollable(false);
|
|
71703
|
+
editorAddTextAttribute(editor, block, range, command, value);
|
|
71704
|
+
} finally {
|
|
71705
|
+
setTimeout(() => {
|
|
71706
|
+
editor.setScrollable(true);
|
|
71707
|
+
}, 1e3);
|
|
71708
|
+
}
|
|
71682
71709
|
}
|
|
71683
71710
|
function addCommentToTextBlocks(editor, range, provider) {
|
|
71684
71711
|
const selectedBlocks = getAllSelectedBlocks(editor, { range });
|
|
@@ -94109,9 +94136,19 @@ ${JSON.stringify(error2, null, 2)}`);
|
|
|
94109
94136
|
__publicField(this, "id", "comment");
|
|
94110
94137
|
__publicField(this, "name", i18n$1.t("comment.command"));
|
|
94111
94138
|
__publicField(this, "icon", CommentIcon$1);
|
|
94139
|
+
__publicField(this, "adding", false);
|
|
94112
94140
|
}
|
|
94113
94141
|
onClick(editor, item) {
|
|
94114
|
-
|
|
94142
|
+
if (this.adding) {
|
|
94143
|
+
return;
|
|
94144
|
+
}
|
|
94145
|
+
this.adding = true;
|
|
94146
|
+
setTimeout(() => {
|
|
94147
|
+
editorAddComment(editor);
|
|
94148
|
+
setTimeout(() => {
|
|
94149
|
+
this.adding = false;
|
|
94150
|
+
}, 300);
|
|
94151
|
+
}, 300);
|
|
94115
94152
|
}
|
|
94116
94153
|
}
|
|
94117
94154
|
class ColorItem extends TextColorItem {
|
|
@@ -94722,7 +94759,7 @@ ${JSON.stringify(error2, null, 2)}`);
|
|
|
94722
94759
|
}
|
|
94723
94760
|
}
|
|
94724
94761
|
});
|
|
94725
|
-
editor.version = "2.9.
|
|
94762
|
+
editor.version = "2.9.4";
|
|
94726
94763
|
return editor;
|
|
94727
94764
|
}
|
|
94728
94765
|
function isDoc(doc2) {
|
|
@@ -94836,7 +94873,7 @@ ${JSON.stringify(error2, null, 2)}`);
|
|
|
94836
94873
|
}
|
|
94837
94874
|
});
|
|
94838
94875
|
OnesEditorToolbar.register(editor);
|
|
94839
|
-
editor.version = "2.9.
|
|
94876
|
+
editor.version = "2.9.4";
|
|
94840
94877
|
return editor;
|
|
94841
94878
|
}
|
|
94842
94879
|
async function showDocVersions(editor, options, serverUrl) {
|