@ones-editor/editor 2.8.37-beta.3 → 2.8.37-beta.31
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/composition/editor-input.d.ts +1 -0
- package/@ones-editor/core/src/core/selection/range/simple-range.d.ts +2 -2
- package/@ones-editor/core/src/core/types.d.ts +2 -0
- package/@ones-editor/html-to-doc/src/html-to-doc/office-html-to-doc/helper/elem.d.ts +1 -0
- package/@ones-editor/main-toolbar/src/index.d.ts +1 -0
- package/@ones-editor/main-toolbar/src/items/comment.d.ts +1 -0
- package/@ones-editor/main-toolbar/src/items/file.d.ts +8 -0
- package/@ones-editor/main-toolbar/src/items/index.d.ts +4 -2
- package/@ones-editor/main-toolbar/src/items/insert.d.ts +2 -1
- package/@ones-editor/main-toolbar/src/items/mention.d.ts +8 -0
- package/@ones-editor/main-toolbar/src/locale/en-us.d.ts +3 -0
- package/@ones-editor/main-toolbar/src/locale/ja-jp.d.ts +3 -0
- package/@ones-editor/main-toolbar/src/locale/zh-cn.d.ts +3 -0
- package/@ones-editor/main-toolbar/src/locale/zh-hant-hk.d.ts +3 -0
- package/@ones-editor/main-toolbar/src/types.d.ts +2 -1
- package/@ones-editor/scroll-container/src/scroll-bar-handle.d.ts +1 -4
- package/@ones-editor/sharedb-doc/src/doc/auth-connection.d.ts +1 -0
- package/@ones-editor/sharedb-doc/src/doc/edit-status.d.ts +1 -1
- package/@ones-editor/sharedb-doc/src/doc/sharedb-doc.d.ts +1 -0
- package/@ones-editor/to-docx/src/index.d.ts +1 -0
- package/@ones-editor/to-docx/src/locale/en-us.d.ts +7 -0
- package/@ones-editor/to-docx/src/locale/index.d.ts +1 -0
- package/@ones-editor/to-docx/src/locale/ja-jp.d.ts +7 -0
- package/@ones-editor/to-docx/src/locale/zh-cn.d.ts +7 -0
- package/@ones-editor/to-docx/src/locale/zh-hant-hk.d.ts +7 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui-base/src/icons/index.d.ts +3 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +643 -381
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -28,6 +28,7 @@ export declare class EditorInput implements OnesEditorInput {
|
|
|
28
28
|
composingTimer: NodeJS.Timeout | undefined;
|
|
29
29
|
callbacks: EditorInputCallbacks;
|
|
30
30
|
inputElement: HTMLTextAreaElement;
|
|
31
|
+
private focused;
|
|
31
32
|
constructor(editor: OnesEditor, callbacks: EditorInputCallbacks);
|
|
32
33
|
private isInCommandBar;
|
|
33
34
|
destroy(): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OnesEditorDocRange } from '../../doc';
|
|
2
|
-
import { OnesEditor, SelectionRange, SelectedBlock, ContainerElement, SimpleSelectionRange } from '../../types';
|
|
2
|
+
import { OnesEditor, SelectionRange, SelectedBlock, ContainerElement, SimpleSelectionRange, SimpleBlockPosition } from '../../types';
|
|
3
3
|
import { EditorSimpleBlockPosition } from '../editor-position';
|
|
4
4
|
interface SimpleRangeOptions {
|
|
5
5
|
anchor: EditorSimpleBlockPosition;
|
|
@@ -13,7 +13,7 @@ export default class EditorSimpleSelectionRange implements SelectionRange {
|
|
|
13
13
|
constructor(editor: OnesEditor, options: SimpleRangeOptions);
|
|
14
14
|
isCollapsed(): boolean;
|
|
15
15
|
isEqual(other: SelectionRange): boolean;
|
|
16
|
-
isSimple():
|
|
16
|
+
isSimple(): this is SimpleBlockPosition;
|
|
17
17
|
isReverse(): boolean;
|
|
18
18
|
getEditor(): OnesEditor;
|
|
19
19
|
get start(): EditorSimpleBlockPosition;
|
|
@@ -586,6 +586,8 @@ export interface OnesEditor extends TypedEmitter<OnesEditorEvents> {
|
|
|
586
586
|
getParentContainer: (block: BlockElement) => ContainerElement;
|
|
587
587
|
reloadBlock: (block: BlockElement) => void;
|
|
588
588
|
contains: (node: Node) => boolean;
|
|
589
|
+
scrollable: () => boolean;
|
|
590
|
+
setScrollable: (scrollable: boolean) => void;
|
|
589
591
|
getSelectedText: () => string;
|
|
590
592
|
clearSelectedContents: () => void;
|
|
591
593
|
insertBlock: (containerId: string, blockIndex: number, blockData: DocBlock, newRange?: OnesEditorDocRange, options?: InsertBlockOptions) => BlockElement;
|
|
@@ -2,3 +2,4 @@ export declare function isOfficeHtml(html: string): boolean;
|
|
|
2
2
|
export declare function isInlineElem(elem: Element): boolean;
|
|
3
3
|
export declare function isTextBlockElem(elem: Element): boolean;
|
|
4
4
|
export declare function replaceCrLf(text: string): string;
|
|
5
|
+
export declare function replaceCrLfWithSpace(text: string): string;
|
|
@@ -14,6 +14,7 @@ export declare class MainToolbar implements OnesEditorCustom {
|
|
|
14
14
|
private options;
|
|
15
15
|
toolbar: FixedToolbar;
|
|
16
16
|
toolbarFullScreen?: FixedToolbar;
|
|
17
|
+
root: HTMLElement;
|
|
17
18
|
constructor(editor: OnesEditor, parent: HTMLElement, options?: MainToolbarOptions);
|
|
18
19
|
destroy(): void;
|
|
19
20
|
setItems(items: ToolbarItem[]): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import { ToolbarItem } from '../types';
|
|
3
|
+
export declare class InsertFileItem implements ToolbarItem {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
onClick(editor: OnesEditor, item: ToolbarItem): Promise<void>;
|
|
8
|
+
}
|
|
@@ -13,5 +13,7 @@ import { FindReplaceItem } from './find';
|
|
|
13
13
|
import { CommentItem } from './comment';
|
|
14
14
|
import { ColorItem } from './text-color';
|
|
15
15
|
import { MoreItem } from './more-item';
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
import { InsertFileItem } from './file';
|
|
17
|
+
import { InsertMentionItem } from './mention';
|
|
18
|
+
export declare function getToolbarDefaultItems(editor: OnesEditor): (FontBoldItem | FontItalicItem | FontUnderlineItem | FontStrikethroughItem | InlineCodeItem | SuperscriptItem | SubscriptItem | InsertLinkItem | OrderedListItem | UnorderedListItem | CheckListItem | ParagraphItem | QuoteItem | SeparatorItem | AlignLeftItem | AlignCenterItem | AlignRightItem | UndoItem | RedoItem | InsertItem | FindReplaceItem | ColorItem)[];
|
|
19
|
+
export { UndoItem, RedoItem, FontBoldItem, FontItalicItem, FontUnderlineItem, FontStrikethroughItem, ColorItem, InlineCodeItem, SuperscriptItem, SubscriptItem, AlignLeftItem, AlignCenterItem, AlignRightItem, ParagraphItem, SeparatorItem, OrderedListItem, UnorderedListItem, CheckListItem, InsertImageItem, InsertFileItem, InsertLinkItem, QuoteItem, InsertItem, FindReplaceItem, CommentItem, MoreItem, InsertMentionItem, };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CommandItem, CommandItemChildrenPlacement, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import { AbstractCommandBar } from '../../../../@ones-editor/ui-base';
|
|
2
3
|
import { ToolbarItem } from '../types';
|
|
3
4
|
export declare class InsertItem implements ToolbarItem {
|
|
4
5
|
name: string;
|
|
@@ -8,5 +9,5 @@ export declare class InsertItem implements ToolbarItem {
|
|
|
8
9
|
childrenPlacement: CommandItemChildrenPlacement;
|
|
9
10
|
children: CommandItem[];
|
|
10
11
|
constructor(editor: OnesEditor);
|
|
11
|
-
onClick(editor: OnesEditor, item: ToolbarItem): void;
|
|
12
|
+
onClick(editor: OnesEditor, item: ToolbarItem, commandBar: AbstractCommandBar): void;
|
|
12
13
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import { ToolbarItem } from '../types';
|
|
3
|
+
export declare class InsertMentionItem implements ToolbarItem {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
onClick(editor: OnesEditor, item: ToolbarItem): void;
|
|
8
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CommandItem, OnesEditor } from '../../../@ones-editor/core';
|
|
2
|
+
import { AbstractCommandBar } from '../../../@ones-editor/ui-base';
|
|
2
3
|
export interface ToolbarItem extends CommandItem {
|
|
3
4
|
updateState?: (editor: OnesEditor) => void;
|
|
4
|
-
onClick?: (editor: OnesEditor, item: ToolbarItem) => void;
|
|
5
|
+
onClick?: (editor: OnesEditor, item: ToolbarItem, commandBar: AbstractCommandBar) => void;
|
|
5
6
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
/// <reference types="lodash" />
|
|
2
1
|
import { ScrollAreaElement, ScrollContainerElement, ScrollCore } from './common-types';
|
|
3
2
|
export declare function getScrollbarContainer(scrollContainer: ScrollContainerElement): HTMLDivElement;
|
|
4
|
-
declare
|
|
5
|
-
export declare const resetScrollbar: import("lodash").DebouncedFunc<typeof resetScrollbarCore>;
|
|
3
|
+
export declare const resetScrollbar: (scrollCore: ScrollCore, scrollWrap: ScrollAreaElement) => void | undefined;
|
|
6
4
|
export declare function calcScrollbarPos(scrollCore: ScrollCore, scrollContainer: ScrollContainerElement): void;
|
|
7
|
-
export {};
|
|
@@ -15,6 +15,7 @@ export interface AutoConnectionEvents {
|
|
|
15
15
|
writeConflictError: (error: Error) => void;
|
|
16
16
|
maxUsersError: () => void;
|
|
17
17
|
requestReloadError: (error: Error) => void;
|
|
18
|
+
opReceived: () => void;
|
|
18
19
|
ready: () => void;
|
|
19
20
|
}
|
|
20
21
|
export declare class AuthConnection extends TypedEmitter<AutoConnectionEvents> {
|
|
@@ -26,6 +26,7 @@ export default class ShareDBDoc extends EventCallbacks<ShareDBDocCallbacks> impl
|
|
|
26
26
|
private handleReload;
|
|
27
27
|
private handleReset;
|
|
28
28
|
private handleWriteConflictError;
|
|
29
|
+
private handleOpReceived;
|
|
29
30
|
private setStatus;
|
|
30
31
|
initEvents(): void;
|
|
31
32
|
clearEvents(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|