@ones-editor/editor 2.1.1-beta.75 → 2.1.1-beta.76
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/fixed-toolbar/toolbar-handler.d.ts +2 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui-base/src/command-bar/manual-command-bar.d.ts +1 -0
- package/@ones-editor/ui-base/src/command-bar/types.d.ts +1 -0
- package/dist/index.js +38 -11
- package/package.json +1 -1
|
@@ -4,6 +4,7 @@ import CommandBar from './command-bar';
|
|
|
4
4
|
import { AbstractManualCommandBar, ManualShowCommandBarOptions } from './types';
|
|
5
5
|
export default abstract class ManualCommandBar extends CommandBar implements AbstractManualCommandBar {
|
|
6
6
|
tippyInstance: Instance | null;
|
|
7
|
+
setProps: (props: ManualShowCommandBarOptions) => void;
|
|
7
8
|
manualShow(target: HTMLElement, options?: ManualShowCommandBarOptions): void;
|
|
8
9
|
close(reason: CloseReason): void;
|
|
9
10
|
destroy(): void;
|
|
@@ -31,6 +31,7 @@ export interface AbstractCommandBar extends TypedEmitter<CommandBarEvents> {
|
|
|
31
31
|
handleDocumentKeydown: (event: KeyboardEvent) => boolean;
|
|
32
32
|
getSubBarOptions: (item: CommandItem) => ManualShowCommandBarOptions;
|
|
33
33
|
updateItems: (items: CommandItem[]) => void;
|
|
34
|
+
setProps?: (props: ManualShowCommandBarOptions) => void;
|
|
34
35
|
}
|
|
35
36
|
export interface ShowCommandBarOptions {
|
|
36
37
|
placement?: Placement;
|
package/dist/index.js
CHANGED
|
@@ -6436,21 +6436,27 @@ div[data-command-bar-id=mobile-bottom-menu] .mobile-menu-wrap.editor-mention .co
|
|
|
6436
6436
|
.command-m-bar > .editor-command-bar-root::-webkit-scrollbar {
|
|
6437
6437
|
display: none;
|
|
6438
6438
|
}
|
|
6439
|
-
.command-m-bar > .editor-command-bar-root
|
|
6439
|
+
.command-m-bar > .editor-command-bar-root.overflowing::after {
|
|
6440
6440
|
content: "";
|
|
6441
6441
|
position: absolute;
|
|
6442
6442
|
top: 0;
|
|
6443
|
-
|
|
6443
|
+
right: 0;
|
|
6444
6444
|
bottom: 0;
|
|
6445
|
-
width:
|
|
6445
|
+
width: 18px;
|
|
6446
|
+
background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0, rgb(255, 255, 255));
|
|
6446
6447
|
z-index: 1;
|
|
6447
6448
|
pointer-events: none;
|
|
6448
6449
|
}
|
|
6449
|
-
.command-m-bar > .editor-command-bar-root.overflowing::after {
|
|
6450
|
-
background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0, rgb(255, 255, 255));
|
|
6451
|
-
}
|
|
6452
6450
|
.command-m-bar > .editor-command-bar-root.overflowing::before {
|
|
6451
|
+
content: "";
|
|
6452
|
+
position: absolute;
|
|
6453
|
+
top: 0;
|
|
6454
|
+
left: 0;
|
|
6455
|
+
bottom: 0;
|
|
6456
|
+
width: 18px;
|
|
6453
6457
|
background: linear-gradient(90deg, rgb(255, 255, 255) 0, rgba(255, 255, 255, 0));
|
|
6458
|
+
z-index: 1;
|
|
6459
|
+
pointer-events: none;
|
|
6454
6460
|
}
|
|
6455
6461
|
.command-m-bar > .editor-command-bar-root > .editor-command-bar {
|
|
6456
6462
|
width: max-content;
|
|
@@ -11186,6 +11192,13 @@ var __publicField = (obj, key, value) => {
|
|
|
11186
11192
|
__publicField(this, "mouseDownEvent", null);
|
|
11187
11193
|
__publicField(this, "dbClickRef", null);
|
|
11188
11194
|
__publicField(this, "handleContextMenu", (event) => {
|
|
11195
|
+
if (clientType.isMobile) {
|
|
11196
|
+
event.preventDefault();
|
|
11197
|
+
if (clientType.isAndroid) {
|
|
11198
|
+
this.editor.focus();
|
|
11199
|
+
}
|
|
11200
|
+
return;
|
|
11201
|
+
}
|
|
11189
11202
|
if (clientType.isSafari) {
|
|
11190
11203
|
const sel = document.getSelection();
|
|
11191
11204
|
if (sel && !sel.isCollapsed) {
|
|
@@ -11329,13 +11342,13 @@ var __publicField = (obj, key, value) => {
|
|
|
11329
11342
|
container.ontouchend = this.handleMouseDown;
|
|
11330
11343
|
} else {
|
|
11331
11344
|
container.onmousedown = this.handleMouseDown;
|
|
11332
|
-
container.oncontextmenu = this.handleContextMenu;
|
|
11333
11345
|
}
|
|
11334
11346
|
if (clientType.isIOS) {
|
|
11335
11347
|
this.dbClickRef = bindDbClick(container, this.handleDblClick);
|
|
11336
11348
|
} else {
|
|
11337
11349
|
container.ondblclick = this.handleDblClick;
|
|
11338
11350
|
}
|
|
11351
|
+
container.oncontextmenu = this.handleContextMenu;
|
|
11339
11352
|
container.onclick = this.handleClick;
|
|
11340
11353
|
}
|
|
11341
11354
|
unbindEvents() {
|
|
@@ -39582,6 +39595,10 @@ ${codeText}
|
|
|
39582
39595
|
constructor() {
|
|
39583
39596
|
super(...arguments);
|
|
39584
39597
|
__publicField(this, "tippyInstance", null);
|
|
39598
|
+
__publicField(this, "setProps", (props) => {
|
|
39599
|
+
var _a;
|
|
39600
|
+
(_a = this.tippyInstance) == null ? void 0 : _a.setProps(props);
|
|
39601
|
+
});
|
|
39585
39602
|
}
|
|
39586
39603
|
manualShow(target, options) {
|
|
39587
39604
|
var _a, _b, _c;
|
|
@@ -50318,7 +50335,6 @@ ${codeText}
|
|
|
50318
50335
|
commands.push(...this.provider.getAvailableCommands(editor, block, this.editor.selection.range, { child }));
|
|
50319
50336
|
if (clientType.isMobile) {
|
|
50320
50337
|
this.clipboardProvider.getAvailableCommands(editor, block).forEach((c) => commands.push(c));
|
|
50321
|
-
commands.push({ id: "separator", name: "", type: "separator" });
|
|
50322
50338
|
}
|
|
50323
50339
|
return {
|
|
50324
50340
|
element: child,
|
|
@@ -79984,8 +80000,10 @@ ${content}
|
|
|
79984
80000
|
__publicField(this, "mobileToolbar");
|
|
79985
80001
|
__publicField(this, "fixedProviders");
|
|
79986
80002
|
__publicField(this, "bar");
|
|
80003
|
+
__publicField(this, "subBar", null);
|
|
79987
80004
|
__publicField(this, "handleSubBarShown", (_2, subBar) => {
|
|
79988
80005
|
scrollBarIntoView(this.editor, subBar);
|
|
80006
|
+
this.subBar = subBar;
|
|
79989
80007
|
});
|
|
79990
80008
|
__publicField(this, "handleSelectionChange", debounce__default.default(() => {
|
|
79991
80009
|
const commands = this.fixedProviders.getCommands(this.editor.selection.range);
|
|
@@ -80017,6 +80035,12 @@ ${content}
|
|
|
80017
80035
|
}
|
|
80018
80036
|
}, 500);
|
|
80019
80037
|
}
|
|
80038
|
+
layoutSubBar() {
|
|
80039
|
+
var _a, _b, _c;
|
|
80040
|
+
if (((_a = this.subBar) == null ? void 0 : _a.isVisible) && this.subBar.parentItem) {
|
|
80041
|
+
(_c = (_b = this.subBar).setProps) == null ? void 0 : _c.call(_b, this.mobileToolbar.getSubBarOptions(this.subBar.parentItem));
|
|
80042
|
+
}
|
|
80043
|
+
}
|
|
80020
80044
|
destroy() {
|
|
80021
80045
|
this.editor.removeListener("selectionChanged", this.handleSelectionChange);
|
|
80022
80046
|
this.mobileToolbar.destroy();
|
|
@@ -80056,8 +80080,11 @@ ${content}
|
|
|
80056
80080
|
editorScrollIntoView(this.editor);
|
|
80057
80081
|
}
|
|
80058
80082
|
}
|
|
80059
|
-
this.preHeight = this.virtualViewportHeight;
|
|
80060
80083
|
this.commandBar.bar.style.bottom = `${offsetHeight}px`;
|
|
80084
|
+
if (this.preHeight !== this.virtualViewportHeight) {
|
|
80085
|
+
this.commandBar.layoutSubBar();
|
|
80086
|
+
}
|
|
80087
|
+
this.preHeight = this.virtualViewportHeight;
|
|
80061
80088
|
}, this.toggleDelay));
|
|
80062
80089
|
__publicField(this, "handScroll", debounce__default.default(() => {
|
|
80063
80090
|
const input2 = this.editor.input.getInput();
|
|
@@ -86689,7 +86716,7 @@ ${data2.flowchartText}
|
|
|
86689
86716
|
}
|
|
86690
86717
|
}
|
|
86691
86718
|
});
|
|
86692
|
-
editor.version = "2.1.1-beta.
|
|
86719
|
+
editor.version = "2.1.1-beta.76";
|
|
86693
86720
|
if (Logger$2.level === LogLevel.DEBUG) {
|
|
86694
86721
|
window.setReauthFail = (fail) => {
|
|
86695
86722
|
window.isReauthError = fail;
|
|
@@ -86790,7 +86817,7 @@ ${data2.flowchartText}
|
|
|
86790
86817
|
});
|
|
86791
86818
|
editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
|
|
86792
86819
|
OnesEditorToolbar.register(editor);
|
|
86793
|
-
editor.version = "2.1.1-beta.
|
|
86820
|
+
editor.version = "2.1.1-beta.76";
|
|
86794
86821
|
return editor;
|
|
86795
86822
|
}
|
|
86796
86823
|
async function showDocVersions(editor, options, serverUrl) {
|