@ones-editor/editor 2.1.1-beta.71 → 2.1.1-beta.73
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.
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="lodash" />
|
|
2
1
|
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
3
2
|
import { CloseReason, CommandItem, Closeable } from '../../../../@ones-editor/core';
|
|
4
3
|
import { AbstractManualCommandBar, AbstractCommandBar, CommandBarEvents, CommandBarOptions, CommandItemElement, CreateManualCommandBarFunction, ManualShowCommandBarOptions, SelectItemFrom } from './types';
|
|
@@ -31,7 +30,8 @@ export default abstract class CommandBar extends TypedEmitter<CommandBarEvents>
|
|
|
31
30
|
private getSelectedItemIndex;
|
|
32
31
|
private getPrevItemIndex;
|
|
33
32
|
private getNextItemIndex;
|
|
34
|
-
protected clearSelectedItem
|
|
33
|
+
protected clearSelectedItem(): void;
|
|
34
|
+
private debounceClearSelectedItem;
|
|
35
35
|
selectItem(id: string, from?: SelectItemFrom): void;
|
|
36
36
|
private lastEnterPauseTime;
|
|
37
37
|
private startPauseMouseEnter;
|
package/dist/index.js
CHANGED
|
@@ -39113,16 +39113,7 @@ ${codeText}
|
|
|
39113
39113
|
disablePageScroll(this.id);
|
|
39114
39114
|
}
|
|
39115
39115
|
});
|
|
39116
|
-
__publicField(this, "
|
|
39117
|
-
const item = this.getSelectedItem();
|
|
39118
|
-
if (!item) {
|
|
39119
|
-
return;
|
|
39120
|
-
}
|
|
39121
|
-
const elem = this.getItemElementById(item.id);
|
|
39122
|
-
if (elem) {
|
|
39123
|
-
removeClass(elem, "selected");
|
|
39124
|
-
}
|
|
39125
|
-
}, 200));
|
|
39116
|
+
__publicField(this, "debounceClearSelectedItem", debounce__default.default(this.clearSelectedItem, 200));
|
|
39126
39117
|
__publicField(this, "lastEnterPauseTime", 0);
|
|
39127
39118
|
__publicField(this, "startPauseMouseEnter", () => {
|
|
39128
39119
|
this.lastEnterPauseTime = Date.now();
|
|
@@ -39183,7 +39174,7 @@ ${codeText}
|
|
|
39183
39174
|
}
|
|
39184
39175
|
if (clientType.isMobile) {
|
|
39185
39176
|
this.selectItem(id);
|
|
39186
|
-
this.
|
|
39177
|
+
this.debounceClearSelectedItem();
|
|
39187
39178
|
}
|
|
39188
39179
|
if (item.children && item.children.length > 0 && item.manualShowChildren) {
|
|
39189
39180
|
this.showSubCommandBar(item.childrenMenuId);
|
|
@@ -39354,6 +39345,16 @@ ${codeText}
|
|
|
39354
39345
|
}
|
|
39355
39346
|
}
|
|
39356
39347
|
}
|
|
39348
|
+
clearSelectedItem() {
|
|
39349
|
+
const item = this.getSelectedItem();
|
|
39350
|
+
if (!item) {
|
|
39351
|
+
return;
|
|
39352
|
+
}
|
|
39353
|
+
const elem = this.getItemElementById(item.id);
|
|
39354
|
+
if (elem) {
|
|
39355
|
+
removeClass(elem, "selected");
|
|
39356
|
+
}
|
|
39357
|
+
}
|
|
39357
39358
|
selectItem(id, from = "event") {
|
|
39358
39359
|
const exists = this.getSelectedItem();
|
|
39359
39360
|
if (exists) {
|
|
@@ -61534,6 +61535,10 @@ $$${mathData.mathjaxText}$$
|
|
|
61534
61535
|
return false;
|
|
61535
61536
|
}
|
|
61536
61537
|
filterCommands(editor, block, range, commands) {
|
|
61538
|
+
const { start, end } = editor.selection.range;
|
|
61539
|
+
if (start.blockId === end.blockId && isCodeBlock(block)) {
|
|
61540
|
+
return [];
|
|
61541
|
+
}
|
|
61537
61542
|
if (isCodeTextBlock(editor, block)) {
|
|
61538
61543
|
return [];
|
|
61539
61544
|
}
|
|
@@ -65021,7 +65026,7 @@ ${codeText}
|
|
|
65021
65026
|
});
|
|
65022
65027
|
}
|
|
65023
65028
|
const { enableComments = true } = this.editor.options;
|
|
65024
|
-
if (!enableComments) {
|
|
65029
|
+
if (!enableComments || this.editor.readonly) {
|
|
65025
65030
|
standardCommands = standardCommands.filter((command) => command.id !== "add-comment");
|
|
65026
65031
|
}
|
|
65027
65032
|
if (this.editor.readonly) {
|
|
@@ -86796,7 +86801,7 @@ ${data2.flowchartText}
|
|
|
86796
86801
|
}
|
|
86797
86802
|
}
|
|
86798
86803
|
});
|
|
86799
|
-
editor.version = "2.1.1-beta.
|
|
86804
|
+
editor.version = "2.1.1-beta.73";
|
|
86800
86805
|
if (Logger$2.level === LogLevel.DEBUG) {
|
|
86801
86806
|
window.setReauthFail = (fail) => {
|
|
86802
86807
|
window.isReauthError = fail;
|
|
@@ -86897,7 +86902,7 @@ ${data2.flowchartText}
|
|
|
86897
86902
|
});
|
|
86898
86903
|
editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
|
|
86899
86904
|
OnesEditorToolbar.register(editor);
|
|
86900
|
-
editor.version = "2.1.1-beta.
|
|
86905
|
+
editor.version = "2.1.1-beta.73";
|
|
86901
86906
|
return editor;
|
|
86902
86907
|
}
|
|
86903
86908
|
async function showDocVersions(editor, options, serverUrl) {
|