@ones-editor/editor 2.1.2-beta.19 → 2.1.2-beta.20
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
|
@@ -60349,6 +60349,23 @@ $$${mathData.mathjaxText}$$
|
|
|
60349
60349
|
return (_b = blockProperties == null ? void 0 : blockProperties.abstract) != null ? _b : "";
|
|
60350
60350
|
}).join(" ");
|
|
60351
60351
|
}
|
|
60352
|
+
function getCommentAbstractFromSelectedBlocks(editor, blocks) {
|
|
60353
|
+
return blocks.map((selectedBlock) => {
|
|
60354
|
+
var _a, _b;
|
|
60355
|
+
const block = selectedBlock.block;
|
|
60356
|
+
const blockClass = getBlockClass(editor, block);
|
|
60357
|
+
const blockProperties = (_a = blockClass.getBlockProperties) == null ? void 0 : _a.call(blockClass, editor, block);
|
|
60358
|
+
if (isEmbedBlock(block) || isComplexKindBlock(editor, block)) {
|
|
60359
|
+
return (blockProperties == null ? void 0 : blockProperties.abstract) ? `[${blockProperties.abstract}]` : "";
|
|
60360
|
+
}
|
|
60361
|
+
if (isTextKindBlock(editor, block)) {
|
|
60362
|
+
const doc2 = selectedBlockToDoc(editor, selectedBlock);
|
|
60363
|
+
const text2 = docToText(editor, doc2);
|
|
60364
|
+
return text2;
|
|
60365
|
+
}
|
|
60366
|
+
return (_b = blockProperties == null ? void 0 : blockProperties.abstract) != null ? _b : "";
|
|
60367
|
+
}).join(" ");
|
|
60368
|
+
}
|
|
60352
60369
|
function createComment(options) {
|
|
60353
60370
|
const { editor, commentGroupId, abstract = "text" } = options;
|
|
60354
60371
|
const id = genId();
|
|
@@ -68343,8 +68360,8 @@ ${codeText}
|
|
|
68343
68360
|
editorAddTextAttribute(editor, block, range, command, value);
|
|
68344
68361
|
}
|
|
68345
68362
|
function addCommentToTextBlocks(editor, range, provider) {
|
|
68346
|
-
const selectedBlocks = getAllSelectedBlocks(editor, { range })
|
|
68347
|
-
const abstract =
|
|
68363
|
+
const selectedBlocks = getAllSelectedBlocks(editor, { range });
|
|
68364
|
+
const abstract = getCommentAbstractFromSelectedBlocks(editor, selectedBlocks);
|
|
68348
68365
|
const comment = createComment({
|
|
68349
68366
|
editor,
|
|
68350
68367
|
abstract
|
|
@@ -68626,8 +68643,8 @@ ${codeText}
|
|
|
68626
68643
|
isFirst: "This is already the first comment",
|
|
68627
68644
|
isLast: "This is already the last comment",
|
|
68628
68645
|
more: "More",
|
|
68629
|
-
comment: "Add
|
|
68630
|
-
command: "Add
|
|
68646
|
+
comment: "Add annotation",
|
|
68647
|
+
command: "Add annotation",
|
|
68631
68648
|
quickMenuCommand: "Add annotation"
|
|
68632
68649
|
}
|
|
68633
68650
|
};
|
|
@@ -86432,7 +86449,6 @@ ${data2.flowchartText}
|
|
|
86432
86449
|
const comment = this.getComment(commentId);
|
|
86433
86450
|
delete this._doc.comments[commentId];
|
|
86434
86451
|
Array.from(this._listeners.values()).forEach((listener) => listener.onDeleteComment(commentId, true));
|
|
86435
|
-
console.log("delete comment", commentId);
|
|
86436
86452
|
if (comment) {
|
|
86437
86453
|
const groupId = comment.groupId;
|
|
86438
86454
|
const groupComments = this.getComments().filter((c) => c.groupId === groupId);
|
|
@@ -86454,7 +86470,6 @@ ${data2.flowchartText}
|
|
|
86454
86470
|
const id = shareDBComment.id;
|
|
86455
86471
|
this._doc.comments[id] = shareDBComment;
|
|
86456
86472
|
Array.from(this._listeners.values()).forEach((listener) => listener.onUpdateComment(id, true));
|
|
86457
|
-
console.log("update comment", comment);
|
|
86458
86473
|
}
|
|
86459
86474
|
createCommentEditor(parent, childDoc) {
|
|
86460
86475
|
const commentEditor = createCommentEditor(this.editor, {
|
|
@@ -88104,7 +88119,7 @@ ${data2.flowchartText}
|
|
|
88104
88119
|
}
|
|
88105
88120
|
}
|
|
88106
88121
|
});
|
|
88107
|
-
editor.version = "2.1.2-beta.
|
|
88122
|
+
editor.version = "2.1.2-beta.20";
|
|
88108
88123
|
if (Logger$2.level === LogLevel.DEBUG) {
|
|
88109
88124
|
window.setReauthFail = (fail) => {
|
|
88110
88125
|
window.isReauthError = fail;
|
|
@@ -88205,7 +88220,7 @@ ${data2.flowchartText}
|
|
|
88205
88220
|
});
|
|
88206
88221
|
editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
|
|
88207
88222
|
OnesEditorToolbar.register(editor);
|
|
88208
|
-
editor.version = "2.1.2-beta.
|
|
88223
|
+
editor.version = "2.1.2-beta.20";
|
|
88209
88224
|
return editor;
|
|
88210
88225
|
}
|
|
88211
88226
|
async function showDocVersions(editor, options, serverUrl) {
|