@ones-editor/editor 2.1.1-beta.63 → 2.1.1-beta.66
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/core/src/core/containers/root-container.d.ts +3 -0
- package/@ones-editor/core/src/core/types.d.ts +5 -4
- package/@ones-editor/core/src/utils/dom.d.ts +2 -2
- package/@ones-editor/mention/src/mention.d.ts +2 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/insert-menu.d.ts +2 -2
- package/@ones-editor/scroll-container/src/utils.d.ts +1 -1
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/providers/insert-above.d.ts +2 -2
- package/@ones-editor/ui/src/providers/insert-after.d.ts +2 -2
- package/@ones-editor/ui/src/providers/insert-box-provider.d.ts +3 -3
- package/@ones-editor/ui/src/providers/insert-menu.d.ts +3 -3
- package/@ones-editor/ui/src/providers/mobile-link-provider.d.ts +2 -2
- package/@ones-editor/ui/src/providers/proxy-provider.d.ts +3 -3
- package/@ones-editor/ui/src/providers/text-command-provider.d.ts +2 -2
- package/@ones-editor/ui-base/src/auto-suggest/auto-suggest-menu.d.ts +2 -0
- package/@ones-editor/ui-base/src/auto-suggest/auto-suggest.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +84 -68
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BlockElement, CommandItem, CommandParams, OnesEditor, SelectionRange } from '../../../../@ones-editor/core';
|
|
1
|
+
import { BlockElement, CommandItem, CommandItemWithSource, CommandParams, OnesEditor, SelectionRange } from '../../../../@ones-editor/core';
|
|
2
2
|
import { ProxyProvider } from './proxy-provider';
|
|
3
3
|
export default class InsertAboveProvider extends ProxyProvider {
|
|
4
4
|
private editor;
|
|
5
5
|
id: string;
|
|
6
6
|
constructor(editor: OnesEditor);
|
|
7
7
|
getAvailableCommands: (editor: OnesEditor, block: BlockElement) => CommandItem[];
|
|
8
|
-
executeCommand: (editor: OnesEditor, block: BlockElement, range: SelectionRange, command:
|
|
8
|
+
executeCommand: (editor: OnesEditor, block: BlockElement, range: SelectionRange, command: CommandItemWithSource, params: CommandParams) => boolean;
|
|
9
9
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BlockElement, CommandItem, CommandParams, OnesEditor, SelectionRange } from '../../../../@ones-editor/core';
|
|
1
|
+
import { BlockElement, CommandItem, CommandItemWithSource, CommandParams, OnesEditor, SelectionRange } from '../../../../@ones-editor/core';
|
|
2
2
|
import { ProxyProvider } from './proxy-provider';
|
|
3
3
|
export default class InsertAfterProvider extends ProxyProvider {
|
|
4
4
|
private editor;
|
|
5
5
|
id: string;
|
|
6
6
|
constructor(editor: OnesEditor);
|
|
7
7
|
getAvailableCommands: (editor: OnesEditor, block: BlockElement) => CommandItem[];
|
|
8
|
-
executeCommand: (editor: OnesEditor, block: BlockElement, range: SelectionRange, command:
|
|
8
|
+
executeCommand: (editor: OnesEditor, block: BlockElement, range: SelectionRange, command: CommandItemWithSource, params: CommandParams) => boolean;
|
|
9
9
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlockElement, CommandItem, CommandParams, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../@ones-editor/core';
|
|
1
|
+
import { BlockElement, CommandItem, CommandItemWithSource, CommandParams, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../@ones-editor/core';
|
|
2
2
|
import { ProxyProvider } from './proxy-provider';
|
|
3
3
|
export declare class InlineBoxCommandProvider extends ProxyProvider implements OnesEditorCommandProvider {
|
|
4
4
|
private editor;
|
|
@@ -7,6 +7,6 @@ export declare class InlineBoxCommandProvider extends ProxyProvider implements O
|
|
|
7
7
|
create(commands: CommandItem[]): CommandItem[];
|
|
8
8
|
getAvailableCommands: (editor: OnesEditor, block: BlockElement, range: SelectionRange) => CommandItem[];
|
|
9
9
|
getInsertCommands: (editor: OnesEditor, containerId: string) => CommandItem[];
|
|
10
|
-
executeCommand: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item:
|
|
11
|
-
executeInsertCommand: (editor: OnesEditor, containerId: string, blockIndex: number, item:
|
|
10
|
+
executeCommand: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItemWithSource, params: CommandParams) => boolean;
|
|
11
|
+
executeInsertCommand: (editor: OnesEditor, containerId: string, blockIndex: number, item: CommandItemWithSource, params: CommandParams) => boolean;
|
|
12
12
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlockElement, CommandItem, CommandParams, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../@ones-editor/core';
|
|
1
|
+
import { BlockElement, CommandItem, CommandItemWithSource, CommandParams, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../@ones-editor/core';
|
|
2
2
|
import { ProxyProvider } from './proxy-provider';
|
|
3
3
|
import { QuickMenuCommandProvider } from '../quick-menu/types';
|
|
4
4
|
export default class InsertMenuProvider extends ProxyProvider {
|
|
@@ -11,6 +11,6 @@ export default class InsertMenuProvider extends ProxyProvider {
|
|
|
11
11
|
constructor(editor: OnesEditor, options?: CommandParams | undefined);
|
|
12
12
|
getInsertCommands: (editor: OnesEditor, containerId: string) => CommandItem[];
|
|
13
13
|
getAvailableCommands: (editor: OnesEditor, block: BlockElement, range: SelectionRange) => CommandItem[];
|
|
14
|
-
executeInsertCommand: (editor: OnesEditor, containerId: string, blockIndex: number, item:
|
|
15
|
-
executeCommand: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item:
|
|
14
|
+
executeInsertCommand: (editor: OnesEditor, containerId: string, blockIndex: number, item: CommandItemWithSource, params: CommandParams) => boolean;
|
|
15
|
+
executeCommand: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItemWithSource, params: CommandParams) => boolean;
|
|
16
16
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlockElement, CommandItem, CommandParams, CommandResult, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../@ones-editor/core';
|
|
1
|
+
import { BlockElement, CommandItem, CommandItemWithSource, CommandParams, CommandResult, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../@ones-editor/core';
|
|
2
2
|
export declare class MobileLinkProvider implements OnesEditorCommandProvider {
|
|
3
3
|
id: string;
|
|
4
4
|
insertProvider: OnesEditorCommandProvider;
|
|
@@ -6,5 +6,5 @@ export declare class MobileLinkProvider implements OnesEditorCommandProvider {
|
|
|
6
6
|
constructor(editor: OnesEditor);
|
|
7
7
|
getSelectedLinkChild: (editor: OnesEditor, range: SelectionRange) => import("@ones-editor/core").TextBlockContentChild | null;
|
|
8
8
|
getAvailableCommands: (editor: OnesEditor, block: BlockElement, range: SelectionRange, params?: CommandParams) => CommandItem[];
|
|
9
|
-
executeCommand: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item:
|
|
9
|
+
executeCommand: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItemWithSource, params: CommandParams, result?: CommandResult) => boolean;
|
|
10
10
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BlockElement, CommandItem, CommandParams, CommandResult, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../@ones-editor/core';
|
|
1
|
+
import { BlockElement, CommandItem, CommandItemWithSource, CommandParams, CommandResult, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../@ones-editor/core';
|
|
2
2
|
export declare abstract class ProxyProvider implements OnesEditorCommandProvider {
|
|
3
3
|
abstract id: string;
|
|
4
4
|
providers: OnesEditorCommandProvider[];
|
|
5
5
|
getAvailableCommands: (editor: OnesEditor, block: BlockElement, range: SelectionRange, params?: CommandParams) => CommandItem[];
|
|
6
6
|
getInsertCommands: (editor: OnesEditor, containerId: string) => CommandItem[];
|
|
7
|
-
executeCommand(editor: OnesEditor, block: BlockElement, range: SelectionRange, command:
|
|
8
|
-
executeInsertCommand: (editor: OnesEditor, containerId: string, blockIndex: number, item:
|
|
7
|
+
executeCommand(editor: OnesEditor, block: BlockElement, range: SelectionRange, command: CommandItemWithSource, params: CommandParams, result?: CommandResult): boolean;
|
|
8
|
+
executeInsertCommand: (editor: OnesEditor, containerId: string, blockIndex: number, item: CommandItemWithSource, params: CommandParams, result?: CommandResult) => boolean;
|
|
9
9
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlockAttributesHandler, BlockElement, CommandItem, CommandParams, CommandResult, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../@ones-editor/core';
|
|
1
|
+
import { BlockAttributesHandler, BlockElement, CommandItem, CommandItemWithSource, CommandParams, CommandResult, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../@ones-editor/core';
|
|
2
2
|
export default class TextCommandProvider implements OnesEditorCommandProvider {
|
|
3
3
|
private editor;
|
|
4
4
|
private options?;
|
|
@@ -7,7 +7,7 @@ export default class TextCommandProvider implements OnesEditorCommandProvider {
|
|
|
7
7
|
private providers;
|
|
8
8
|
constructor(editor: OnesEditor, options?: CommandParams | undefined);
|
|
9
9
|
getAvailableCommands(editor: OnesEditor, block: BlockElement, range: SelectionRange): CommandItem[];
|
|
10
|
-
executeCommand(editor: OnesEditor, block: BlockElement, range: SelectionRange, item:
|
|
10
|
+
executeCommand(editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItemWithSource, params: CommandParams, result?: CommandResult): boolean;
|
|
11
11
|
get blockAttributesHandler(): BlockAttributesHandler;
|
|
12
12
|
private executeCommandOnEmptyText;
|
|
13
13
|
private setCommandsStates;
|
|
@@ -16,6 +16,7 @@ export interface AutoSuggestMenuOptions {
|
|
|
16
16
|
disableSelectedScroll?: boolean;
|
|
17
17
|
onClose?: () => void;
|
|
18
18
|
onShow?: (menu: AutoSuggestMenu) => boolean | undefined;
|
|
19
|
+
onShown?: (menu: AutoSuggestMenu) => void;
|
|
19
20
|
onClickItem: (menu: AutoSuggestMenu, item: CommandItem) => void;
|
|
20
21
|
queryItems: (menu: AutoSuggestMenu, text: string) => Promise<CommandItem[]>;
|
|
21
22
|
renderMenuItem?: (menu: AutoSuggestMenu, item: CommandItem) => HTMLElement | undefined;
|
|
@@ -40,6 +41,7 @@ export default class AutoSuggestMenu {
|
|
|
40
41
|
handleSearchTextPure(text: string): Promise<void>;
|
|
41
42
|
handleClick: import("lodash").DebouncedFuncLeading<(menu: AbstractCommandBar, item: CommandItem) => void>;
|
|
42
43
|
handleShow: (menu: AbstractCommandBar) => void;
|
|
44
|
+
handleShown: () => void;
|
|
43
45
|
handleClose: () => void;
|
|
44
46
|
handleKeydown: (event: KeyboardEvent) => boolean;
|
|
45
47
|
protected highlightText(search: string, items?: CommandItem[]): void;
|
|
@@ -26,6 +26,7 @@ export interface AutoSuggestOptions {
|
|
|
26
26
|
onClickItem: (menu: OnesEditorAutoSuggest, item: CommandItem, anchor: AutoSuggestAnchor) => void;
|
|
27
27
|
queryItems: (menu: OnesEditorAutoSuggest, text: string) => Promise<CommandItem[]>;
|
|
28
28
|
renderMenuItem?: (menu: OnesEditorAutoSuggest, item: CommandItem) => HTMLElement | undefined;
|
|
29
|
+
onShown?: (menu: OnesEditorAutoSuggest) => void;
|
|
29
30
|
}
|
|
30
31
|
declare class OnesEditorAutoSuggest implements OnesEditorInputHandler {
|
|
31
32
|
private editor;
|
|
@@ -46,6 +47,7 @@ declare class OnesEditorAutoSuggest implements OnesEditorInputHandler {
|
|
|
46
47
|
deleteTrigger: () => boolean;
|
|
47
48
|
private onClose;
|
|
48
49
|
private onShow;
|
|
50
|
+
private onShown;
|
|
49
51
|
private onClickItem;
|
|
50
52
|
private queryItems;
|
|
51
53
|
private renderMenuItem;
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { LayoutQuickMenuItemFilter, isLayoutBlock } from '../@ones-editor/layout
|
|
|
7
7
|
import ShareDBDocVersionsProvider from './versions/versions-provider';
|
|
8
8
|
import { CreateLocalEditorOptions, CreateOnesEditorOptions } from './types';
|
|
9
9
|
import './lang';
|
|
10
|
+
export * from '../@ones-editor/scroll-container';
|
|
10
11
|
export * from '../@ones-editor/to-docx';
|
|
11
12
|
export * from '../@ones-editor/core';
|
|
12
13
|
export * from '../@ones-editor/sharedb-doc';
|
package/dist/index.js
CHANGED
|
@@ -8985,9 +8985,6 @@ var __publicField = (obj, key, value) => {
|
|
|
8985
8985
|
});
|
|
8986
8986
|
return elem || document.body;
|
|
8987
8987
|
}
|
|
8988
|
-
function ensureIsMobileEvent$1(events2) {
|
|
8989
|
-
return clientType.isMobile;
|
|
8990
|
-
}
|
|
8991
8988
|
function createMouseEventFromTouchEvent(event, type) {
|
|
8992
8989
|
const touch = event.changedTouches[0];
|
|
8993
8990
|
const mouseEvent = new MouseEvent("mousedown", {
|
|
@@ -9002,24 +8999,24 @@ var __publicField = (obj, key, value) => {
|
|
|
9002
8999
|
Object.defineProperty(mouseEvent, "target", { value: event.target, enumerable: true });
|
|
9003
9000
|
return mouseEvent;
|
|
9004
9001
|
}
|
|
9005
|
-
function
|
|
9006
|
-
|
|
9007
|
-
|
|
9008
|
-
|
|
9009
|
-
|
|
9010
|
-
const
|
|
9011
|
-
if (
|
|
9012
|
-
|
|
9002
|
+
function ensureIsMobileEvent(events2) {
|
|
9003
|
+
return events2 instanceof TouchEvent;
|
|
9004
|
+
}
|
|
9005
|
+
function bindDbClick(elem, handler) {
|
|
9006
|
+
let touchTime = 0;
|
|
9007
|
+
const callback = (event) => {
|
|
9008
|
+
if (touchTime === 0) {
|
|
9009
|
+
touchTime = new Date().getTime();
|
|
9010
|
+
} else {
|
|
9011
|
+
if (new Date().getTime() - touchTime < 800) {
|
|
9012
|
+
handler(event);
|
|
9013
|
+
}
|
|
9014
|
+
touchTime = 0;
|
|
9013
9015
|
}
|
|
9014
|
-
isMove = false;
|
|
9015
9016
|
};
|
|
9016
|
-
|
|
9017
|
-
window.addEventListener("touchend", handleTouchEnd, true);
|
|
9018
|
-
elem.addEventListener("touchend", callback);
|
|
9017
|
+
elem.addEventListener("click", callback);
|
|
9019
9018
|
return () => {
|
|
9020
|
-
|
|
9021
|
-
window.removeEventListener("touchend", handleTouchEnd, true);
|
|
9022
|
-
elem.removeEventListener("touchend", callback);
|
|
9019
|
+
elem.removeEventListener("click", callback);
|
|
9023
9020
|
};
|
|
9024
9021
|
}
|
|
9025
9022
|
class ScrollDomElement {
|
|
@@ -11233,32 +11230,22 @@ var __publicField = (obj, key, value) => {
|
|
|
11233
11230
|
}
|
|
11234
11231
|
const logger$4m = getLogger("root-container");
|
|
11235
11232
|
const MIN_DISTANCE_THRESHOLD = 3;
|
|
11236
|
-
function ensureIsMobileEvent(events2) {
|
|
11237
|
-
return events2 instanceof TouchEvent;
|
|
11238
|
-
}
|
|
11239
|
-
function bindDbClick(elem, handler) {
|
|
11240
|
-
let touchTime = 0;
|
|
11241
|
-
const callback = (event) => {
|
|
11242
|
-
if (touchTime === 0) {
|
|
11243
|
-
touchTime = new Date().getTime();
|
|
11244
|
-
} else {
|
|
11245
|
-
if (new Date().getTime() - touchTime < 800) {
|
|
11246
|
-
handler(event);
|
|
11247
|
-
}
|
|
11248
|
-
touchTime = 0;
|
|
11249
|
-
}
|
|
11250
|
-
};
|
|
11251
|
-
elem.addEventListener("click", callback);
|
|
11252
|
-
return () => {
|
|
11253
|
-
elem.removeEventListener("click", callback);
|
|
11254
|
-
};
|
|
11255
|
-
}
|
|
11256
11233
|
class RootContainer {
|
|
11257
11234
|
constructor(editor, rootContainer) {
|
|
11258
11235
|
__publicField(this, "resizeObserver");
|
|
11259
11236
|
__publicField(this, "isMoved", false);
|
|
11260
11237
|
__publicField(this, "mouseDownEvent", null);
|
|
11261
11238
|
__publicField(this, "dbClickRef", null);
|
|
11239
|
+
__publicField(this, "isMove", false);
|
|
11240
|
+
__publicField(this, "handleTouchMove", (e2) => {
|
|
11241
|
+
this.isMove = true;
|
|
11242
|
+
});
|
|
11243
|
+
__publicField(this, "handleTouchEnd", (e2) => {
|
|
11244
|
+
if (this.isMove) {
|
|
11245
|
+
e2.stopPropagation();
|
|
11246
|
+
}
|
|
11247
|
+
this.isMove = false;
|
|
11248
|
+
});
|
|
11262
11249
|
__publicField(this, "handleContextMenu", (event) => {
|
|
11263
11250
|
if (clientType.isSafari) {
|
|
11264
11251
|
const sel = document.getSelection();
|
|
@@ -11400,18 +11387,19 @@ var __publicField = (obj, key, value) => {
|
|
|
11400
11387
|
this.resizeObserver.observe(rootContainer);
|
|
11401
11388
|
const container = this.editor.rootElement;
|
|
11402
11389
|
if (clientType.isMobile) {
|
|
11403
|
-
|
|
11404
|
-
|
|
11390
|
+
container.ontouchend = this.handleMouseDown;
|
|
11391
|
+
window.addEventListener("touchmove", this.handleTouchMove);
|
|
11392
|
+
window.addEventListener("touchend", this.handleTouchEnd, true);
|
|
11405
11393
|
} else {
|
|
11406
11394
|
container.onmousedown = this.handleMouseDown;
|
|
11407
11395
|
container.oncontextmenu = this.handleContextMenu;
|
|
11408
|
-
container.onclick = this.handleClick;
|
|
11409
11396
|
}
|
|
11410
11397
|
if (clientType.isIOS) {
|
|
11411
11398
|
this.dbClickRef = bindDbClick(container, this.handleDblClick);
|
|
11412
11399
|
} else {
|
|
11413
11400
|
container.ondblclick = this.handleDblClick;
|
|
11414
11401
|
}
|
|
11402
|
+
container.onclick = this.handleClick;
|
|
11415
11403
|
}
|
|
11416
11404
|
unbindEvents() {
|
|
11417
11405
|
this.resizeObserver.disconnect();
|
|
@@ -11420,6 +11408,9 @@ var __publicField = (obj, key, value) => {
|
|
|
11420
11408
|
container.ondblclick = null;
|
|
11421
11409
|
container.onclick = null;
|
|
11422
11410
|
container.oncontextmenu = null;
|
|
11411
|
+
container.ontouchend = null;
|
|
11412
|
+
window.removeEventListener("touchmove", this.handleTouchMove);
|
|
11413
|
+
window.removeEventListener("touchend", this.handleTouchEnd, true);
|
|
11423
11414
|
if (this.dbClickRef) {
|
|
11424
11415
|
this.dbClickRef();
|
|
11425
11416
|
this.dbClickRef = null;
|
|
@@ -24740,7 +24731,7 @@ var __publicField = (obj, key, value) => {
|
|
|
24740
24731
|
});
|
|
24741
24732
|
__publicField(this, "handleDocumentClick", (event) => {
|
|
24742
24733
|
const rootContainer = this.editor.rootContainer;
|
|
24743
|
-
const target =
|
|
24734
|
+
const target = ensureIsMobileEvent(event) ? event.changedTouches[0].target : event.target;
|
|
24744
24735
|
const isInDisableScrollMask = this.isInDisableScrollMask(target);
|
|
24745
24736
|
if (target && (isInDisableScrollMask || rootContainer.contains(target))) {
|
|
24746
24737
|
if (!isInDisableScrollMask && !isInBlockTools(target)) {
|
|
@@ -24878,7 +24869,7 @@ var __publicField = (obj, key, value) => {
|
|
|
24878
24869
|
input2.addEventListener("compositionend", this.handleCompositionend);
|
|
24879
24870
|
this.inputElement = input2;
|
|
24880
24871
|
if (clientType.isMobile) {
|
|
24881
|
-
|
|
24872
|
+
document.addEventListener("touchend", this.handleDocumentClick);
|
|
24882
24873
|
} else {
|
|
24883
24874
|
document.addEventListener("mousedown", this.handleDocumentClick);
|
|
24884
24875
|
}
|
|
@@ -24927,7 +24918,7 @@ var __publicField = (obj, key, value) => {
|
|
|
24927
24918
|
this.editor.selection.caret.update();
|
|
24928
24919
|
}
|
|
24929
24920
|
if (clientType.isMobile) {
|
|
24930
|
-
this.inputElement.focus();
|
|
24921
|
+
this.inputElement.focus(options);
|
|
24931
24922
|
this.callbacks.onFocus();
|
|
24932
24923
|
} else {
|
|
24933
24924
|
setTimeout(() => {
|
|
@@ -27102,7 +27093,7 @@ var __publicField = (obj, key, value) => {
|
|
|
27102
27093
|
if (newEndPos.blockId !== currentBlockId) {
|
|
27103
27094
|
newEndPos = createSimpleBlockPosition(block, getBlockTextLength$6(editor, block), "end");
|
|
27104
27095
|
}
|
|
27105
|
-
editor.selection.setSelection(newStartPos, newEndPos
|
|
27096
|
+
editor.selection.setSelection(newStartPos, newEndPos);
|
|
27106
27097
|
}
|
|
27107
27098
|
function editorFocusToEnd(editor) {
|
|
27108
27099
|
editorSelectEnd(editor);
|
|
@@ -27531,8 +27522,8 @@ var __publicField = (obj, key, value) => {
|
|
|
27531
27522
|
__publicField(this, "handleMouseDown", (event, options) => {
|
|
27532
27523
|
var _a;
|
|
27533
27524
|
this.mouseDownEvent = event;
|
|
27534
|
-
const x = ensureIsMobileEvent
|
|
27535
|
-
const y = ensureIsMobileEvent
|
|
27525
|
+
const x = ensureIsMobileEvent(event) ? event.changedTouches[0].clientX : event.x;
|
|
27526
|
+
const y = ensureIsMobileEvent(event) ? event.changedTouches[0].clientY : event.y;
|
|
27536
27527
|
const range = getBlockNearestRangeFromPoint(this.editor, x, y);
|
|
27537
27528
|
if (range) {
|
|
27538
27529
|
if (range instanceof EditorComplexSelectionRange) {
|
|
@@ -27569,7 +27560,7 @@ var __publicField = (obj, key, value) => {
|
|
|
27569
27560
|
return;
|
|
27570
27561
|
if (!this.mouseDownEvent)
|
|
27571
27562
|
return;
|
|
27572
|
-
if (ensureIsMobileEvent
|
|
27563
|
+
if (ensureIsMobileEvent(this.mouseDownEvent))
|
|
27573
27564
|
return;
|
|
27574
27565
|
if (Math.abs(this.mouseDownEvent.x - event.x) < 3 && Math.abs(this.mouseDownEvent.y - event.y) < 3) {
|
|
27575
27566
|
return;
|
|
@@ -40483,6 +40474,10 @@ ${codeText}
|
|
|
40483
40474
|
}, 300, { leading: true, trailing: false }));
|
|
40484
40475
|
__publicField(this, "handleShow", (menu) => {
|
|
40485
40476
|
});
|
|
40477
|
+
__publicField(this, "handleShown", () => {
|
|
40478
|
+
var _a, _b;
|
|
40479
|
+
(_b = (_a = this.options).onShown) == null ? void 0 : _b.call(_a, this);
|
|
40480
|
+
});
|
|
40486
40481
|
__publicField(this, "handleClose", () => {
|
|
40487
40482
|
var _a, _b;
|
|
40488
40483
|
(_b = (_a = this.options).onClose) == null ? void 0 : _b.call(_a);
|
|
@@ -40509,6 +40504,7 @@ ${codeText}
|
|
|
40509
40504
|
this.menu.addListener("click", this.handleClick);
|
|
40510
40505
|
this.menu.addListener("close", this.handleClose);
|
|
40511
40506
|
this.menu.addListener("show", this.handleShow);
|
|
40507
|
+
this.menu.addListener("shown", this.handleShown);
|
|
40512
40508
|
if (this.options.wait) {
|
|
40513
40509
|
this.handleSearchText = debounce__default.default(async (text2) => {
|
|
40514
40510
|
this.handleSearchTextPure(text2);
|
|
@@ -41310,6 +41306,10 @@ ${codeText}
|
|
|
41310
41306
|
}
|
|
41311
41307
|
return void 0;
|
|
41312
41308
|
});
|
|
41309
|
+
__publicField(this, "onShown", () => {
|
|
41310
|
+
var _a, _b;
|
|
41311
|
+
(_b = (_a = this.options).onShown) == null ? void 0 : _b.call(_a, this);
|
|
41312
|
+
});
|
|
41313
41313
|
__publicField(this, "onClickItem", (menu, item) => {
|
|
41314
41314
|
if (!this.anchor) {
|
|
41315
41315
|
return;
|
|
@@ -41343,6 +41343,7 @@ ${codeText}
|
|
|
41343
41343
|
highlight: options.highlight,
|
|
41344
41344
|
onClose: this.onClose,
|
|
41345
41345
|
onShow: this.onShow,
|
|
41346
|
+
onShown: this.onShown,
|
|
41346
41347
|
onClickItem: this.onClickItem,
|
|
41347
41348
|
queryItems: this.queryItems,
|
|
41348
41349
|
renderMenuItem: this.renderMenuItem
|
|
@@ -49701,6 +49702,9 @@ ${codeText}
|
|
|
49701
49702
|
super();
|
|
49702
49703
|
__publicField(this, "linkPopup");
|
|
49703
49704
|
__publicField(this, "onShow", () => {
|
|
49705
|
+
const scrollContainer = getScrollContainer$1(document.body);
|
|
49706
|
+
const clientHeight = scrollContainer.clientHeight;
|
|
49707
|
+
this.linkPopup.content.style.maxHeight = `${clientHeight - 20}px`;
|
|
49704
49708
|
this.emit("show");
|
|
49705
49709
|
});
|
|
49706
49710
|
__publicField(this, "close", () => {
|
|
@@ -49746,13 +49750,7 @@ ${codeText}
|
|
|
49746
49750
|
const { target } = this.options;
|
|
49747
49751
|
this.linkPopup.addListener("show", this.onShow);
|
|
49748
49752
|
this.linkPopup.addListener("shown", this.handleShown);
|
|
49749
|
-
|
|
49750
|
-
setTimeout(() => {
|
|
49751
|
-
const scrollContainer = getScrollContainer$1(document.body);
|
|
49752
|
-
const clientHeight = scrollContainer.clientHeight;
|
|
49753
|
-
this.linkPopup.content.style.maxHeight = `${clientHeight - 20}px`;
|
|
49754
|
-
this.linkPopup.manualShow(target);
|
|
49755
|
-
}, 200);
|
|
49753
|
+
this.linkPopup.manualShow(target);
|
|
49756
49754
|
});
|
|
49757
49755
|
this.editor = editor;
|
|
49758
49756
|
this.content = content;
|
|
@@ -78405,6 +78403,14 @@ ${content}
|
|
|
78405
78403
|
}
|
|
78406
78404
|
return true;
|
|
78407
78405
|
});
|
|
78406
|
+
__publicField(this, "onShown", (bar2) => {
|
|
78407
|
+
if (clientType.isMobile) {
|
|
78408
|
+
const mobileWrap = this.getMobileCommandElement();
|
|
78409
|
+
const input2 = mobileWrap.querySelector("input");
|
|
78410
|
+
input2.focus();
|
|
78411
|
+
scrollIntoView(bar2.menu.menu, this.editor);
|
|
78412
|
+
}
|
|
78413
|
+
});
|
|
78408
78414
|
__publicField(this, "handleClickItem", (item) => {
|
|
78409
78415
|
const user = item.data;
|
|
78410
78416
|
const mentionData = {
|
|
@@ -78475,33 +78481,40 @@ ${content}
|
|
|
78475
78481
|
this.createMobileItems(content, items, find);
|
|
78476
78482
|
});
|
|
78477
78483
|
}, 100));
|
|
78478
|
-
__publicField(this, "
|
|
78484
|
+
__publicField(this, "getMobileCommandElement", () => {
|
|
78485
|
+
if (this.mobileWrap) {
|
|
78486
|
+
return this.mobileWrap;
|
|
78487
|
+
}
|
|
78479
78488
|
this.mobileWrap = createElement("div", ["mobile-item-wrap"], null);
|
|
78480
78489
|
const content = createElement("div", ["mobile-item-content"], null);
|
|
78481
|
-
const clientHeight = this.editor.scrollContainer.clientHeight;
|
|
78482
|
-
content.style.maxHeight = `${clientHeight - 180}px`;
|
|
78483
78490
|
const icon = createElement("div", ["editor-input-icon"], null);
|
|
78484
78491
|
icon.innerHTML = SearchIcon;
|
|
78485
|
-
|
|
78492
|
+
createInput(this.mobileWrap, {
|
|
78486
78493
|
onChange: (e2) => this.onInputChanged(content, e2),
|
|
78487
78494
|
placeholder: i18n$1.t("mention.placeholder"),
|
|
78488
78495
|
prefix: icon,
|
|
78489
78496
|
suffixClose: true
|
|
78490
78497
|
});
|
|
78491
|
-
setTimeout(() => {
|
|
78492
|
-
input2.focus();
|
|
78493
|
-
}, 200);
|
|
78494
78498
|
this.mobileWrap.appendChild(content);
|
|
78495
|
-
this.createMobileItems(content, items, "");
|
|
78496
78499
|
this.mobileWrap.addEventListener("click", this.handleMobileWrapClick);
|
|
78497
78500
|
content.addEventListener("scroll", () => {
|
|
78498
78501
|
var _a;
|
|
78499
78502
|
return (_a = document.activeElement) == null ? void 0 : _a.blur();
|
|
78500
78503
|
});
|
|
78504
|
+
return this.mobileWrap;
|
|
78505
|
+
});
|
|
78506
|
+
__publicField(this, "createMobileCommandItem", (items) => {
|
|
78507
|
+
const mobileWrap = this.getMobileCommandElement();
|
|
78508
|
+
const content = mobileWrap.querySelector(".mobile-item-content");
|
|
78509
|
+
this.createMobileItems(content, items, "");
|
|
78510
|
+
setTimeout(() => {
|
|
78511
|
+
const clientHeight = this.editor.scrollContainer.clientHeight;
|
|
78512
|
+
content.style.maxHeight = `${clientHeight - 180}px`;
|
|
78513
|
+
}, 60);
|
|
78501
78514
|
return [{
|
|
78502
78515
|
id: "create-mobile-item",
|
|
78503
78516
|
name: "Create Mobile Item",
|
|
78504
|
-
element:
|
|
78517
|
+
element: mobileWrap
|
|
78505
78518
|
}];
|
|
78506
78519
|
});
|
|
78507
78520
|
__publicField(this, "_queryItems", async (text2) => {
|
|
@@ -78540,6 +78553,7 @@ ${content}
|
|
|
78540
78553
|
showLoading: true,
|
|
78541
78554
|
header: this.createMobileHeader(),
|
|
78542
78555
|
onShow: this.onShow,
|
|
78556
|
+
onShown: this.onShown,
|
|
78543
78557
|
onClickItem: this.onClickItem,
|
|
78544
78558
|
queryItems: this.queryItems,
|
|
78545
78559
|
onClose: this.onClose
|
|
@@ -86759,7 +86773,7 @@ ${data2.flowchartText}
|
|
|
86759
86773
|
}
|
|
86760
86774
|
}
|
|
86761
86775
|
});
|
|
86762
|
-
editor.version = "2.1.1-beta.
|
|
86776
|
+
editor.version = "2.1.1-beta.66";
|
|
86763
86777
|
if (Logger$2.level === LogLevel.DEBUG) {
|
|
86764
86778
|
window.setReauthFail = (fail) => {
|
|
86765
86779
|
window.isReauthError = fail;
|
|
@@ -86857,7 +86871,7 @@ ${data2.flowchartText}
|
|
|
86857
86871
|
});
|
|
86858
86872
|
editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
|
|
86859
86873
|
OnesEditorToolbar.register(editor);
|
|
86860
|
-
editor.version = "2.1.1-beta.
|
|
86874
|
+
editor.version = "2.1.1-beta.66";
|
|
86861
86875
|
return editor;
|
|
86862
86876
|
}
|
|
86863
86877
|
async function showDocVersions(editor, options, serverUrl) {
|
|
@@ -132691,6 +132705,7 @@ ${data2.flowchartText}
|
|
|
132691
132705
|
exports2.RequestReloadError = RequestReloadError;
|
|
132692
132706
|
exports2.RichText = RichText;
|
|
132693
132707
|
exports2.ScriptDropdownProvider = ScriptDropdownProvider;
|
|
132708
|
+
exports2.ScrollContainer = ScrollContainer;
|
|
132694
132709
|
exports2.ShareDBDoc = ShareDBDoc;
|
|
132695
132710
|
exports2.ShareDBDocVersionsProvider = ShareDBDocVersionsProvider;
|
|
132696
132711
|
exports2.ShareDBServer = ShareDBServer;
|
|
@@ -132722,8 +132737,8 @@ ${data2.flowchartText}
|
|
|
132722
132737
|
exports2.applyPlaceholderToBlock = applyPlaceholderToBlock;
|
|
132723
132738
|
exports2.assert = assert;
|
|
132724
132739
|
exports2.autoShowHideTemplates = autoShowHideTemplates;
|
|
132740
|
+
exports2.bindDbClick = bindDbClick;
|
|
132725
132741
|
exports2.bindKeyDownEvent = bindKeyDownEvent;
|
|
132726
|
-
exports2.bindTouchEnd = bindTouchEnd;
|
|
132727
132742
|
exports2.blob2String = blob2String$1;
|
|
132728
132743
|
exports2.blobToDataUrl = blobToDataUrl;
|
|
132729
132744
|
exports2.blobToString = blobToString;
|
|
@@ -132793,6 +132808,7 @@ ${data2.flowchartText}
|
|
|
132793
132808
|
exports2.createRange = createRange;
|
|
132794
132809
|
exports2.createRichText = createRichText;
|
|
132795
132810
|
exports2.createRootContainer = createRootContainer;
|
|
132811
|
+
exports2.createScrollContainer = createScrollContainer;
|
|
132796
132812
|
exports2.createSimpleBlockPosition = createSimpleBlockPosition;
|
|
132797
132813
|
exports2.createSimpleDocPos = createSimpleDocPos;
|
|
132798
132814
|
exports2.createTextBlockData = createTextBlockData;
|
|
@@ -132887,7 +132903,7 @@ ${data2.flowchartText}
|
|
|
132887
132903
|
exports2.editorUpdateCompositionText = editorUpdateCompositionText;
|
|
132888
132904
|
exports2.editorUpdateEmbedData = editorUpdateEmbedData;
|
|
132889
132905
|
exports2.enablePageScroll = enablePageScroll;
|
|
132890
|
-
exports2.ensureIsMobileEvent = ensureIsMobileEvent
|
|
132906
|
+
exports2.ensureIsMobileEvent = ensureIsMobileEvent;
|
|
132891
132907
|
exports2.escapeHtmlText = escapeHtmlText;
|
|
132892
132908
|
exports2.escapeRegExp = escapeRegExp;
|
|
132893
132909
|
exports2.escapeSpace = escapeSpace;
|