@ones-editor/editor 2.1.7-beta.13 → 2.1.7-beta.15
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 +4 -0
- package/@ones-editor/core/src/core/types.d.ts +8 -4
- package/@ones-editor/core/src/core/undo-manager/actions/action.d.ts +5 -1
- package/@ones-editor/core/src/core/undo-manager/actions/block-action.d.ts +1 -0
- package/@ones-editor/core/src/core/undo-manager/actions/update-block-data-action.d.ts +1 -0
- package/@ones-editor/core/src/utils/dom.d.ts +2 -2
- package/@ones-editor/image-embed/src/image-object.d.ts +1 -0
- package/@ones-editor/mention/src/mention.d.ts +2 -0
- package/@ones-editor/mobile-helper/src/cursor-toolbar.d.ts +1 -0
- package/@ones-editor/mobile-helper/src/embed-mask.d.ts +10 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/index.d.ts +4 -6
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/insert-menu.d.ts +3 -3
- package/@ones-editor/mobile-helper/src/fixed-toolbar/toolbar-handler.d.ts +1 -0
- package/@ones-editor/mobile-helper/src/index.d.ts +3 -1
- package/@ones-editor/scroll-container/src/utils.d.ts +1 -1
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/link-popup/mobile-link-popup.d.ts +22 -0
- package/@ones-editor/ui/src/link-popup/types.d.ts +34 -0
- package/@ones-editor/ui/src/link-popup/web-link-popup.d.ts +19 -0
- package/@ones-editor/ui/src/providers/clipboard-provider.d.ts +3 -2
- 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/@ones-editor/ui-base/src/color-button/text-color-item.d.ts +3 -2
- package/@ones-editor/ui-base/src/command-bar/command-bar.d.ts +1 -0
- package/@ones-editor/ui-base/src/command-bar/fixed-toolbar.d.ts +1 -2
- package/@ones-editor/ui-base/src/command-bar/types.d.ts +2 -1
- package/@ones-editor/ui-base/src/index.d.ts +1 -0
- package/@ones-editor/ui-base/src/mobile-command-bar/mobile-bottom-menu.d.ts +0 -1
- package/@ones-editor/ui-base/src/mobile-command-bar/scroll-into-view.d.ts +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1492 -1235
- package/dist/lang/en-us.d.ts +1 -1
- package/dist/lang/ja-jp.d.ts +1 -1
- package/dist/lang/zh-cn.d.ts +1 -1
- package/package.json +1 -1
|
@@ -6,7 +6,11 @@ export declare class RootContainer {
|
|
|
6
6
|
resizeObserver: ResizeObserver;
|
|
7
7
|
private isMoved;
|
|
8
8
|
private mouseDownEvent;
|
|
9
|
+
private dbClickRef;
|
|
9
10
|
constructor(editor: OnesEditor, rootContainer: ContainerElement);
|
|
11
|
+
private isMove;
|
|
12
|
+
handleTouchMove: (e: TouchEvent) => void;
|
|
13
|
+
handleTouchEnd: (e: TouchEvent) => void;
|
|
10
14
|
private bindEvents;
|
|
11
15
|
private unbindEvents;
|
|
12
16
|
destroy(): void;
|
|
@@ -356,6 +356,8 @@ export interface OnesEditorUndoAction {
|
|
|
356
356
|
redo: (editor: OnesEditor) => boolean;
|
|
357
357
|
combinable: (other: OnesEditorUndoAction) => boolean;
|
|
358
358
|
combine: (other: OnesEditorUndoAction) => void;
|
|
359
|
+
getTimeStamp: () => number;
|
|
360
|
+
getBatchActionId?: () => string | undefined;
|
|
359
361
|
}
|
|
360
362
|
export interface OnesEditorUndoManager {
|
|
361
363
|
reset: () => void;
|
|
@@ -642,6 +644,7 @@ export type PasteOptions = {
|
|
|
642
644
|
};
|
|
643
645
|
export interface OnesEditorInput {
|
|
644
646
|
readonly inputElement: HTMLTextAreaElement;
|
|
647
|
+
getInput: () => HTMLTextAreaElement;
|
|
645
648
|
destroy: () => void;
|
|
646
649
|
focus: () => void;
|
|
647
650
|
handleDocumentSelectionChange: () => void;
|
|
@@ -718,6 +721,7 @@ export type CommandParams = {
|
|
|
718
721
|
[index: string]: unknown;
|
|
719
722
|
} & {
|
|
720
723
|
source?: string[];
|
|
724
|
+
isFilter?: boolean;
|
|
721
725
|
};
|
|
722
726
|
export type CommandResult = {
|
|
723
727
|
[index: string]: unknown;
|
|
@@ -727,12 +731,12 @@ export interface OnesEditorCommandProvider {
|
|
|
727
731
|
groupIndex?: number;
|
|
728
732
|
getAvailableCommands: (editor: OnesEditor, block: BlockElement, range: SelectionRange, params?: CommandParams) => CommandItem[];
|
|
729
733
|
getInsertCommands?: (editor: OnesEditor, containerId: string) => CommandItem[];
|
|
730
|
-
executeInsertCommand?: (editor: OnesEditor, containerId: string, blockIndex: number, item:
|
|
734
|
+
executeInsertCommand?: (editor: OnesEditor, containerId: string, blockIndex: number, item: CommandItemWithSource, params: CommandParams, result?: CommandResult) => boolean;
|
|
731
735
|
executeRangeCommand?: (editor: OnesEditor, range: SelectionRange, command: CommandItemWithSource, params: CommandParams, result?: CommandResult) => boolean;
|
|
732
|
-
executeCommand?: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item:
|
|
736
|
+
executeCommand?: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItemWithSource, params: CommandParams, result?: CommandResult) => boolean;
|
|
733
737
|
filterCommands?: (editor: OnesEditor, block: BlockElement, range: SelectionRange, commands: CommandItemWithSource[]) => CommandItemWithSource[] | undefined;
|
|
734
|
-
beforeExecuteCommand?: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item:
|
|
735
|
-
afterExecuteCommand?: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item:
|
|
738
|
+
beforeExecuteCommand?: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItemWithSource, params: CommandParams) => boolean | undefined;
|
|
739
|
+
afterExecuteCommand?: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItemWithSource, params: CommandParams, result: CommandResult) => void;
|
|
736
740
|
}
|
|
737
741
|
export interface CommandItemWithSource extends CommandItem {
|
|
738
742
|
source: string;
|
|
@@ -4,11 +4,15 @@ export default class Action implements OnesEditorUndoAction {
|
|
|
4
4
|
protected containerId: string;
|
|
5
5
|
beforeRange: OnesEditorDocRange;
|
|
6
6
|
afterRange: OnesEditorDocRange;
|
|
7
|
-
|
|
7
|
+
batchActionId?: string;
|
|
8
|
+
ts: number;
|
|
9
|
+
constructor(editor: OnesEditor, containerId: string, afterRange: OnesEditorDocRange, batchActionId?: string);
|
|
10
|
+
getTimeStamp(): number;
|
|
8
11
|
undo(editor: OnesEditor): boolean;
|
|
9
12
|
redo(editor: OnesEditor): boolean;
|
|
10
13
|
combinable(other: OnesEditorUndoAction): boolean;
|
|
11
14
|
combine(other: OnesEditorUndoAction): void;
|
|
15
|
+
getBatchActionId(): string | undefined;
|
|
12
16
|
setAfterRange(range: OnesEditorDocRange): void;
|
|
13
17
|
hasDocContainerId(editor: OnesEditor, id: string): boolean;
|
|
14
18
|
findDocBlockById(editor: OnesEditor, id: string): DocBlock | undefined;
|
|
@@ -7,4 +7,5 @@ export default class BlockAction extends Action {
|
|
|
7
7
|
constructor(editor: OnesEditor, containerId: string, blockIndex: number, data: DocBlock, afterRange: OnesEditorDocRange);
|
|
8
8
|
deleteBlock(editor: OnesEditor, newRange: OnesEditorDocRange): boolean;
|
|
9
9
|
insertBlock(editor: OnesEditor, newRange: OnesEditorDocRange): boolean;
|
|
10
|
+
getBatchActionId(): string | undefined;
|
|
10
11
|
}
|
|
@@ -37,7 +37,7 @@ export declare function bindKeyDownEvent(input: HTMLInputElement | HTMLTextAreaE
|
|
|
37
37
|
export declare function getElementFromPoint(x: number, y: number, options?: {
|
|
38
38
|
noFilter: boolean;
|
|
39
39
|
}): Element;
|
|
40
|
-
export declare function ensureIsMobileEvent(events: MouseEvent | TouchEvent): events is TouchEvent;
|
|
41
40
|
export declare function createMouseEventFromTouchEvent(event: TouchEvent, type: 'mousedown' | 'mousemove' | 'mouseup' | 'click'): MouseEvent;
|
|
42
|
-
export declare function
|
|
41
|
+
export declare function ensureIsMobileEvent(events: MouseEvent | TouchEvent): events is TouchEvent;
|
|
42
|
+
export declare function bindDbClick(elem: HTMLElement, handler: (event: MouseEvent) => void): () => void;
|
|
43
43
|
export {};
|
|
@@ -42,4 +42,5 @@ export declare class ImageObject implements ImageObjectBase {
|
|
|
42
42
|
private setData;
|
|
43
43
|
static create(editor: OnesEditor, blockData: DocEmbedBlock): ImageObject;
|
|
44
44
|
static getImageObject(editor: OnesEditor, block: BlockElement | string): ImageObject;
|
|
45
|
+
static findImageObject(editor: OnesEditor, block: BlockElement | string): ImageObject | null;
|
|
45
46
|
}
|
|
@@ -13,12 +13,14 @@ export default class OnesEditorMention implements OnesEditorCustom {
|
|
|
13
13
|
onClose: () => void;
|
|
14
14
|
destroy(): void;
|
|
15
15
|
onShow: (suggest: OnesEditorAutoSuggest, containerId: string, blockIndex: number, offset: number) => boolean;
|
|
16
|
+
onShown: (bar: OnesEditorAutoSuggest) => void;
|
|
16
17
|
handleClickItem: (item: CommandItem) => void;
|
|
17
18
|
handleMobileWrapClick: (e: Event) => void;
|
|
18
19
|
onClickItem: (menu: OnesEditorAutoSuggest, item: CommandItem, anchor: AutoSuggestAnchor) => void;
|
|
19
20
|
createItemElement: (item: CommandItem, find: string) => HTMLElement;
|
|
20
21
|
createMobileItems: (content: HTMLElement, items: CommandItem[], find: string) => void;
|
|
21
22
|
onInputChanged: import("lodash").DebouncedFunc<(content: HTMLElement, e: Event) => void>;
|
|
23
|
+
getMobileCommandElement: () => HTMLElement;
|
|
22
24
|
createMobileCommandItem: (items: CommandItem[]) => {
|
|
23
25
|
id: string;
|
|
24
26
|
name: string;
|
|
@@ -2,6 +2,7 @@ import { type CommandItem, type OnesEditor } from '../../../@ones-editor/core';
|
|
|
2
2
|
export declare class CursorToolbarHandler {
|
|
3
3
|
private editor;
|
|
4
4
|
private toolbar;
|
|
5
|
+
private clipboardProvider;
|
|
5
6
|
constructor(editor: OnesEditor);
|
|
6
7
|
handleButtonClick: (toolbar: any, item: CommandItem) => void;
|
|
7
8
|
private handleSelectionChange;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="lodash" />
|
|
2
|
+
import { BlockElement, OnesEditor } from '../../../@ones-editor/core';
|
|
3
|
+
export default class MobileEmbedMask {
|
|
4
|
+
private editor;
|
|
5
|
+
constructor(editor: OnesEditor);
|
|
6
|
+
addMask: (block: BlockElement) => void;
|
|
7
|
+
removeMask: (block: BlockElement) => void;
|
|
8
|
+
handleSelectionChanged: import("lodash").DebouncedFunc<() => void>;
|
|
9
|
+
destroy(): void;
|
|
10
|
+
}
|
|
@@ -6,16 +6,14 @@ export declare class MobileCommandHandler {
|
|
|
6
6
|
private commandBar;
|
|
7
7
|
private observer;
|
|
8
8
|
constructor(editor: OnesEditor);
|
|
9
|
-
destroy(): void;
|
|
10
9
|
private showKeyboard;
|
|
11
|
-
private
|
|
12
|
-
private get isKeyboardShow();
|
|
10
|
+
private get window();
|
|
13
11
|
private get virtualViewportHeight();
|
|
14
12
|
private get clientHeight();
|
|
15
|
-
private
|
|
16
|
-
private get window();
|
|
17
|
-
private setDebugInfo;
|
|
13
|
+
private toggleDelay;
|
|
18
14
|
toggle: import("lodash").DebouncedFunc<() => void>;
|
|
15
|
+
handScroll: import("lodash").DebouncedFunc<() => void>;
|
|
16
|
+
destroy(): void;
|
|
19
17
|
handleFocusIn: () => void;
|
|
20
18
|
handleFocusOut: () => void;
|
|
21
19
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlockElement, CommandItem, CommandParams, ContainerElement, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../../@ones-editor/core';
|
|
1
|
+
import { BlockElement, CommandItem, CommandItemWithSource, CommandParams, ContainerElement, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../../@ones-editor/core';
|
|
2
2
|
import { ProxyProvider } from '../../../../../@ones-editor/ui';
|
|
3
3
|
export default class InsertMenuProvider extends ProxyProvider {
|
|
4
4
|
private editor;
|
|
@@ -8,8 +8,8 @@ export default class InsertMenuProvider extends ProxyProvider {
|
|
|
8
8
|
constructor(editor: OnesEditor);
|
|
9
9
|
getNextBlock(container: ContainerElement, block: BlockElement): number;
|
|
10
10
|
getInsertCommands: () => CommandItem[];
|
|
11
|
-
getAvailableCommands: (editor: OnesEditor, block: BlockElement, range: SelectionRange) => CommandItem[];
|
|
11
|
+
getAvailableCommands: (editor: OnesEditor, block: BlockElement, range: SelectionRange, params?: CommandParams) => CommandItem[];
|
|
12
12
|
executeInsertCommand: () => boolean;
|
|
13
13
|
getNextBlockIndex: (container: ContainerElement, block: BlockElement) => number;
|
|
14
|
-
executeCommand: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item:
|
|
14
|
+
executeCommand: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItemWithSource, params: CommandParams) => boolean;
|
|
15
15
|
}
|
|
@@ -5,6 +5,7 @@ export declare class MobileToolbarHandler {
|
|
|
5
5
|
private fixedProviders;
|
|
6
6
|
bar: HTMLElement;
|
|
7
7
|
constructor(editor: OnesEditor, parent: HTMLElement);
|
|
8
|
+
private handleSubBarShow;
|
|
8
9
|
private handleSelectionChange;
|
|
9
10
|
handleClick: (_: any, item: CommandItem) => void;
|
|
10
11
|
destroy(): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="lodash" />
|
|
1
2
|
import { OnesEditor, OnesEditorCustom } from '../../../@ones-editor/core';
|
|
2
3
|
import { MobileCommandHandler } from './fixed-toolbar';
|
|
3
4
|
import './mobile-helper-styles.scss';
|
|
@@ -10,9 +11,10 @@ export declare class OnesEditorMobileHelper implements OnesEditorCustom {
|
|
|
10
11
|
private gripper;
|
|
11
12
|
private cursorToolbar;
|
|
12
13
|
private isMoving;
|
|
14
|
+
private mobileEmbedMask;
|
|
13
15
|
constructor(editor: OnesEditor);
|
|
14
16
|
destroy(): void;
|
|
15
|
-
handleSelectionChange: () => void
|
|
17
|
+
handleSelectionChange: import("lodash").DebouncedFunc<() => void>;
|
|
16
18
|
handleLongPress: (event: TouchEvent) => boolean;
|
|
17
19
|
handleTouchMove: (event: TouchEvent) => void;
|
|
18
20
|
handleTouchStart: (event: TouchEvent) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ContainerElement, ScrollAreaElement, ScrollContainerElement, ScrollCore } from './common-types';
|
|
2
|
-
export declare function getContainerOption(scrollCore: ScrollCore, container: ContainerElement): import("
|
|
2
|
+
export declare function getContainerOption(scrollCore: ScrollCore, container: ContainerElement): import("@ones-editor/editor").ScrollContainerOptions | undefined;
|
|
3
3
|
export declare function getScrollContainer(scrollChild: HTMLElement): ScrollContainerElement;
|
|
4
4
|
export declare function getContainerScrollArea(scrollContainer: ScrollContainerElement): ScrollAreaElement;
|
|
5
5
|
export declare function getContainer(scrollChild: HTMLElement): ContainerElement;
|