@ones-editor/editor 2.1.1-beta.52 → 2.1.1-beta.54
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/@ones-editor/mobile-helper/src/locale/en-us.d.ts +3 -0
- package/@ones-editor/mobile-helper/src/locale/ja-jp.d.ts +3 -0
- package/@ones-editor/mobile-helper/src/locale/zh-cn.d.ts +3 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui-base/src/command-bar/command-bar.d.ts +2 -1
- package/dist/index.js +55 -33
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="lodash" />
|
|
1
2
|
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
2
3
|
import { CloseReason, CommandItem, Closeable } from '../../../../@ones-editor/core';
|
|
3
4
|
import { AbstractManualCommandBar, AbstractCommandBar, CommandBarEvents, CommandBarOptions, CommandItemElement, CreateManualCommandBarFunction, ManualShowCommandBarOptions, SelectItemFrom } from './types';
|
|
@@ -29,7 +30,7 @@ export default abstract class CommandBar extends TypedEmitter<CommandBarEvents>
|
|
|
29
30
|
private getSelectedItemIndex;
|
|
30
31
|
private getPrevItemIndex;
|
|
31
32
|
private getNextItemIndex;
|
|
32
|
-
protected clearSelectedItem()
|
|
33
|
+
protected clearSelectedItem: import("lodash").DebouncedFunc<() => void>;
|
|
33
34
|
selectItem(id: string, from?: SelectItemFrom): void;
|
|
34
35
|
private lastEnterPauseTime;
|
|
35
36
|
private startPauseMouseEnter;
|
package/dist/index.js
CHANGED
|
@@ -5829,7 +5829,6 @@ div[data-command-bar-id=mobile-bottom-menu] .mobile-menu-wrap.editor-mention .co
|
|
|
5829
5829
|
line-height: 2.4;
|
|
5830
5830
|
}
|
|
5831
5831
|
div[data-command-bar-id=mobile-bottom-menu] .mobile-menu-wrap.editor-mention .command-item .mobile-item-wrap .mobile-item-content {
|
|
5832
|
-
max-height: 400px;
|
|
5833
5832
|
height: 400px;
|
|
5834
5833
|
overflow-x: auto;
|
|
5835
5834
|
overscroll-behavior: contain;
|
|
@@ -5857,6 +5856,17 @@ div[data-command-bar-id=mobile-bottom-menu] .mobile-menu-wrap.editor-mention .co
|
|
|
5857
5856
|
width: 100%;
|
|
5858
5857
|
height: 100%;
|
|
5859
5858
|
}
|
|
5859
|
+
div[data-command-bar-id=mobile-bottom-menu] .mobile-menu-wrap.editor-mention .command-item .mobile-item-wrap .mobile-item-content .mobile-item .mobile-item-icon .mention-user-avatar-string {
|
|
5860
|
+
align-items: center;
|
|
5861
|
+
display: flex;
|
|
5862
|
+
justify-content: center;
|
|
5863
|
+
overflow: hidden;
|
|
5864
|
+
height: 100%;
|
|
5865
|
+
width: 100%;
|
|
5866
|
+
font-size: 12px;
|
|
5867
|
+
color: white;
|
|
5868
|
+
flex-shrink: 0;
|
|
5869
|
+
}
|
|
5860
5870
|
div[data-command-bar-id=mobile-bottom-menu] .mobile-menu-wrap.editor-mention .command-item .mobile-item-wrap .mobile-item-content .mobile-item .mobile-item-name {
|
|
5861
5871
|
color: #2D2D2E;
|
|
5862
5872
|
font-size: 14px;
|
|
@@ -39062,6 +39072,16 @@ ${codeText}
|
|
|
39062
39072
|
disablePageScroll(this.id);
|
|
39063
39073
|
}
|
|
39064
39074
|
});
|
|
39075
|
+
__publicField(this, "clearSelectedItem", debounce__default.default(() => {
|
|
39076
|
+
const item = this.getSelectedItem();
|
|
39077
|
+
if (!item) {
|
|
39078
|
+
return;
|
|
39079
|
+
}
|
|
39080
|
+
const elem = this.getItemElementById(item.id);
|
|
39081
|
+
if (elem) {
|
|
39082
|
+
removeClass(elem, "selected");
|
|
39083
|
+
}
|
|
39084
|
+
}, 200));
|
|
39065
39085
|
__publicField(this, "lastEnterPauseTime", 0);
|
|
39066
39086
|
__publicField(this, "startPauseMouseEnter", () => {
|
|
39067
39087
|
this.lastEnterPauseTime = Date.now();
|
|
@@ -39122,9 +39142,7 @@ ${codeText}
|
|
|
39122
39142
|
}
|
|
39123
39143
|
if (clientType.isMobile) {
|
|
39124
39144
|
this.selectItem(id);
|
|
39125
|
-
|
|
39126
|
-
this.clearSelectedItem();
|
|
39127
|
-
}, 1e3);
|
|
39145
|
+
this.clearSelectedItem();
|
|
39128
39146
|
}
|
|
39129
39147
|
if (item.children && item.children.length > 0 && item.manualShowChildren) {
|
|
39130
39148
|
this.showSubCommandBar(item.childrenMenuId);
|
|
@@ -39295,16 +39313,6 @@ ${codeText}
|
|
|
39295
39313
|
}
|
|
39296
39314
|
}
|
|
39297
39315
|
}
|
|
39298
|
-
clearSelectedItem() {
|
|
39299
|
-
const item = this.getSelectedItem();
|
|
39300
|
-
if (!item) {
|
|
39301
|
-
return;
|
|
39302
|
-
}
|
|
39303
|
-
const elem = this.getItemElementById(item.id);
|
|
39304
|
-
if (elem) {
|
|
39305
|
-
removeClass(elem, "selected");
|
|
39306
|
-
}
|
|
39307
|
-
}
|
|
39308
39316
|
selectItem(id, from = "event") {
|
|
39309
39317
|
const exists = this.getSelectedItem();
|
|
39310
39318
|
if (exists) {
|
|
@@ -46568,6 +46576,9 @@ ${codeText}
|
|
|
46568
46576
|
}
|
|
46569
46577
|
}
|
|
46570
46578
|
get commands() {
|
|
46579
|
+
if (this.editor.readonly) {
|
|
46580
|
+
return [];
|
|
46581
|
+
}
|
|
46571
46582
|
const items = [];
|
|
46572
46583
|
const focusedBlock = this.editor.selection.focusedBlock;
|
|
46573
46584
|
for (const provider of this.providers) {
|
|
@@ -50421,14 +50432,14 @@ ${codeText}
|
|
|
50421
50432
|
OnesEditorHoveringBlock.get(editor).addListener("childChange", this.handleHoveringBlockChildChange);
|
|
50422
50433
|
OnesEditorHoveringBlock.get(editor).addFilter(this);
|
|
50423
50434
|
editor.blockHooks.push(new LinkCommands(editor));
|
|
50424
|
-
if (
|
|
50425
|
-
editor.editorCommandProviders.registerCommandProvider(new BlockTurnIntoCommandProvider(editor));
|
|
50426
|
-
editor.editorCommandProviders.registerCommandProvider(new ParagraphProvider$1(editor));
|
|
50427
|
-
editor.editorCommandProviders.registerCommandProvider(new AlignDropdownProvider$1(editor));
|
|
50428
|
-
} else {
|
|
50435
|
+
if (clientType.isMobile) {
|
|
50429
50436
|
editor.editorCommandProviders.registerCommandProvider(new MobileLinkProvider(editor));
|
|
50430
50437
|
editor.editorCommandProviders.registerCommandProvider(new StandardBoxProvider(editor));
|
|
50431
50438
|
editor.editorCommandProviders.registerCommandProvider(new ClipboardProvider(editor, { withPaste: true }));
|
|
50439
|
+
} else {
|
|
50440
|
+
editor.editorCommandProviders.registerCommandProvider(new BlockTurnIntoCommandProvider(editor));
|
|
50441
|
+
editor.editorCommandProviders.registerCommandProvider(new ParagraphProvider$1(editor));
|
|
50442
|
+
editor.editorCommandProviders.registerCommandProvider(new AlignDropdownProvider$1(editor));
|
|
50432
50443
|
}
|
|
50433
50444
|
}
|
|
50434
50445
|
disableTextToolbar() {
|
|
@@ -57961,7 +57972,7 @@ $$${mathData.mathjaxText}$$
|
|
|
57961
57972
|
heading: "Heading {name}",
|
|
57962
57973
|
headingGroup: "Text style",
|
|
57963
57974
|
text: "Text",
|
|
57964
|
-
paste: "
|
|
57975
|
+
paste: "Paste",
|
|
57965
57976
|
tab: "Tab",
|
|
57966
57977
|
shiftTab: "Shift+Tab"
|
|
57967
57978
|
}
|
|
@@ -62660,7 +62671,7 @@ ${codeText}
|
|
|
62660
62671
|
const block = editor.selection.focusedBlock;
|
|
62661
62672
|
const blockType = getBlockType(block);
|
|
62662
62673
|
const defaultPlaceholder = options.contentPlaceholder || i18n$1.t("placeholder.default");
|
|
62663
|
-
let placeholder2 = defaultPlaceholder;
|
|
62674
|
+
let placeholder2 = clientType.isMobile ? "" : defaultPlaceholder;
|
|
62664
62675
|
if (blockType && isTextKindBlockType(editor, blockType)) {
|
|
62665
62676
|
if (block) {
|
|
62666
62677
|
if (!editor.isBlockWritable(block)) {
|
|
@@ -62669,7 +62680,7 @@ ${codeText}
|
|
|
62669
62680
|
if (isCodeLineBlock(block)) {
|
|
62670
62681
|
return "";
|
|
62671
62682
|
}
|
|
62672
|
-
if (isChildBlock(block)) {
|
|
62683
|
+
if (isChildBlock(block) && !clientType.isMobile) {
|
|
62673
62684
|
const parentContainerBlock = getParentBlock(getParentContainer(block));
|
|
62674
62685
|
if (!parentContainerBlock || !((_b = (_a = getBlockClass(editor, parentContainerBlock)).getOptions) == null ? void 0 : _b.call(_a, editor).isMenuButtonBaseContainer)) {
|
|
62675
62686
|
placeholder2 = i18n$1.t("placeholder.common.contentInTable");
|
|
@@ -74886,7 +74897,7 @@ ${content}
|
|
|
74886
74897
|
const enUS$g = {
|
|
74887
74898
|
contextMenu: {
|
|
74888
74899
|
copyMarkdown: "Copy as Markdown",
|
|
74889
|
-
paste: "
|
|
74900
|
+
paste: "Paste",
|
|
74890
74901
|
copyImage: "Copy image",
|
|
74891
74902
|
copyImageUrl: "Copy image address",
|
|
74892
74903
|
imageSaveAs: "Save image as",
|
|
@@ -78304,6 +78315,8 @@ ${content}
|
|
|
78304
78315
|
__publicField(this, "createMobileCommandItem", (items) => {
|
|
78305
78316
|
this.mobileWrap = createElement("div", ["mobile-item-wrap"], null);
|
|
78306
78317
|
const content = createElement("div", ["mobile-item-content"], null);
|
|
78318
|
+
const clientHeight = this.editor.rootContainer.clientHeight;
|
|
78319
|
+
content.style.maxHeight = `${clientHeight - 180}px`;
|
|
78307
78320
|
const icon = createElement("div", ["editor-input-icon"], null);
|
|
78308
78321
|
icon.innerHTML = SearchIcon;
|
|
78309
78322
|
const input2 = createInput(this.mobileWrap, {
|
|
@@ -78484,16 +78497,16 @@ ${content}
|
|
|
78484
78497
|
mention: {
|
|
78485
78498
|
abstract: "Member",
|
|
78486
78499
|
placeholder: "Please select a member",
|
|
78487
|
-
noResult: "No
|
|
78488
|
-
header: "
|
|
78500
|
+
noResult: "No matches",
|
|
78501
|
+
header: "Mention members"
|
|
78489
78502
|
}
|
|
78490
78503
|
};
|
|
78491
78504
|
const jaJP$a = {
|
|
78492
78505
|
mention: {
|
|
78493
78506
|
abstract: "\u30E1\u30F3\u30D0\u30FC",
|
|
78494
78507
|
placeholder: "\u30E1\u30F3\u30D0\u30FC\u3092\u691C\u7D22",
|
|
78495
|
-
noResult: "\
|
|
78496
|
-
header: "\u30E1\u30F3\u30D0\u30FC\u3092\
|
|
78508
|
+
noResult: "\u4E00\u81F4\u3059\u308B\u7D50\u679C\u304C\u3042\u308A\u307E\u305B\u3093",
|
|
78509
|
+
header: "\u30E1\u30F3\u30D0\u30FC\u3092\u30E1\u30F3\u30B7\u30E7\u30F3"
|
|
78497
78510
|
}
|
|
78498
78511
|
};
|
|
78499
78512
|
i18n$1.mergeLang({
|
|
@@ -79606,7 +79619,7 @@ ${content}
|
|
|
79606
79619
|
this.toolbar.close("selectionChange");
|
|
79607
79620
|
});
|
|
79608
79621
|
__publicField(this, "getCommands", () => {
|
|
79609
|
-
const commands = [{ id: "select", name: "
|
|
79622
|
+
const commands = [{ id: "select", name: i18n$1.t("mobile.commands.select") }];
|
|
79610
79623
|
const focusBlock = this.editor.selection.focusedBlock;
|
|
79611
79624
|
const clipboardCommands = new ClipboardProvider(this.editor, { withPaste: true }).getAvailableCommands(this.editor, focusBlock);
|
|
79612
79625
|
clipboardCommands.filter((cmd) => cmd.id === "paste").forEach((cmd) => commands.push(cmd));
|
|
@@ -80028,17 +80041,26 @@ ${content}
|
|
|
80028
80041
|
const mobileHelperStyles = "";
|
|
80029
80042
|
const zhCN$7 = {
|
|
80030
80043
|
mobile: {
|
|
80031
|
-
insert: "\u63D2\u5165"
|
|
80044
|
+
insert: "\u63D2\u5165",
|
|
80045
|
+
commands: {
|
|
80046
|
+
select: "\u9009\u62E9"
|
|
80047
|
+
}
|
|
80032
80048
|
}
|
|
80033
80049
|
};
|
|
80034
80050
|
const enUS$7 = {
|
|
80035
80051
|
mobile: {
|
|
80036
|
-
insert: "Insert"
|
|
80052
|
+
insert: "Insert",
|
|
80053
|
+
commands: {
|
|
80054
|
+
select: "Select"
|
|
80055
|
+
}
|
|
80037
80056
|
}
|
|
80038
80057
|
};
|
|
80039
80058
|
const jaJP$7 = {
|
|
80040
80059
|
mobile: {
|
|
80041
|
-
insert: "\
|
|
80060
|
+
insert: "\u633F\u5165",
|
|
80061
|
+
commands: {
|
|
80062
|
+
select: "\u9078\u629E"
|
|
80063
|
+
}
|
|
80042
80064
|
}
|
|
80043
80065
|
};
|
|
80044
80066
|
i18n$1.mergeLang({
|
|
@@ -86518,7 +86540,7 @@ ${data2.flowchartText}
|
|
|
86518
86540
|
}
|
|
86519
86541
|
}
|
|
86520
86542
|
});
|
|
86521
|
-
editor.version = "2.1.1-beta.
|
|
86543
|
+
editor.version = "2.1.1-beta.54";
|
|
86522
86544
|
if (Logger$2.level === LogLevel.DEBUG) {
|
|
86523
86545
|
window.setReauthFail = (fail) => {
|
|
86524
86546
|
window.isReauthError = fail;
|
|
@@ -86616,7 +86638,7 @@ ${data2.flowchartText}
|
|
|
86616
86638
|
});
|
|
86617
86639
|
editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
|
|
86618
86640
|
OnesEditorToolbar.register(editor);
|
|
86619
|
-
editor.version = "2.1.1-beta.
|
|
86641
|
+
editor.version = "2.1.1-beta.54";
|
|
86620
86642
|
return editor;
|
|
86621
86643
|
}
|
|
86622
86644
|
async function showDocVersions(editor, options, serverUrl) {
|